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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct50
-rw-r--r--config/darwin-config.py5
-rw-r--r--config/irix6-config.py231
-rw-r--r--config/linux2-config.py3
-rw-r--r--config/linuxcross-config.py9
-rw-r--r--config/openbsd3-config.py5
-rw-r--r--config/sunos5-config.py5
-rw-r--r--config/win32-mingw-config.py6
-rw-r--r--config/win32-vc-config.py23
-rw-r--r--extern/Makefile5
-rw-r--r--intern/SoundSystem/Makefile3
-rw-r--r--intern/SoundSystem/SConscript2
-rw-r--r--intern/boolop/SConscript2
-rw-r--r--intern/boolop/intern/BOP_Merge2.cpp8
-rw-r--r--intern/bsp/SConscript4
-rw-r--r--intern/decimation/SConscript2
-rw-r--r--intern/elbeem/intern/utilities.h6
-rw-r--r--intern/ghost/GHOST_Types.h3
-rw-r--r--intern/ghost/SConscript2
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp5
-rw-r--r--intern/ghost/intern/GHOST_DisplayManager.h4
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerWin32.cpp2
-rw-r--r--intern/ghost/intern/GHOST_EventManager.h4
-rw-r--r--intern/ghost/intern/GHOST_EventPrinter.cpp32
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp12
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp35
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp34
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h14
-rw-r--r--intern/ghost/intern/GHOST_TimerManager.h4
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowManager.h4
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp55
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp375
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.h21
-rw-r--r--intern/guardedalloc/SConscript2
-rw-r--r--intern/moto/SConscript2
-rw-r--r--intern/opennl/SConscript2
-rw-r--r--intern/string/SConscript2
-rw-r--r--intern/string/STR_String.h2
-rw-r--r--projectfiles_vc9/blender/BPY_python/BPY_python.vcproj553
-rw-r--r--projectfiles_vc9/blender/blender.sln694
-rw-r--r--projectfiles_vc9/blender/blender.vcproj6
-rw-r--r--projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj13
-rw-r--r--projectfiles_vc9/blender/editors/ED_editors.vcproj533
-rw-r--r--projectfiles_vc9/blender/loader/BLO_loader.vcproj53
-rw-r--r--projectfiles_vc9/blender/makesdna/DNA_dna.vcproj196
-rw-r--r--projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj5
-rw-r--r--projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj741
-rw-r--r--projectfiles_vc9/blender/makesrna/RNA_rna.vcproj209
-rw-r--r--projectfiles_vc9/blender/nodes/nodes.vcproj17
-rw-r--r--projectfiles_vc9/blender/radiosity/BRA_radiosity.vcproj5
-rw-r--r--projectfiles_vc9/blender/windowmanager/windowmanager.vcproj271
-rw-r--r--projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj8
-rw-r--r--projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj1
-rw-r--r--projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj5
-rw-r--r--release/Makefile6
-rw-r--r--release/datafiles/blenderbuttonsbin68242 -> 103734 bytes
-rw-r--r--release/scripts/bpymodules/BPyImage.py19
-rw-r--r--release/scripts/bpymodules/BPyMathutils.py14
-rw-r--r--release/scripts/bpymodules/BPySys.py60
-rw-r--r--release/scripts/export_fbx.py38
-rw-r--r--release/scripts/import_dxf.py107
-rwxr-xr-xrelease/scripts/import_web3d.py458
-rw-r--r--source/Makefile49
-rw-r--r--source/blender/CMakeLists.txt2
-rw-r--r--source/blender/Makefile4
-rw-r--r--source/blender/SConscript6
-rw-r--r--source/blender/blenkernel/BKE_bad_level_calls.h241
-rw-r--r--source/blender/blenkernel/BKE_blender.h22
-rw-r--r--source/blender/blenkernel/BKE_bmesh.h2
-rw-r--r--source/blender/blenkernel/BKE_brush.h1
-rw-r--r--source/blender/blenkernel/BKE_customdata.h8
-rw-r--r--source/blender/blenkernel/BKE_font.h3
-rw-r--r--source/blender/blenkernel/BKE_global.h25
-rw-r--r--source/blender/blenkernel/BKE_idprop.h11
-rw-r--r--source/blender/blenkernel/BKE_library.h4
-rw-r--r--source/blender/blenkernel/BKE_main.h1
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/BKE_scene.h1
-rw-r--r--source/blender/blenkernel/BKE_screen.h94
-rw-r--r--source/blender/blenkernel/CMakeLists.txt2
-rw-r--r--source/blender/blenkernel/Makefile2
-rw-r--r--source/blender/blenkernel/SConscript2
-rw-r--r--source/blender/blenkernel/bad_level_call_stubs/SConscript14
-rw-r--r--source/blender/blenkernel/bad_level_call_stubs/stubs.c352
-rw-r--r--source/blender/blenkernel/intern/BME_conversions.c24
-rw-r--r--source/blender/blenkernel/intern/BME_tools.c3
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c30
-rw-r--r--source/blender/blenkernel/intern/Makefile2
-rw-r--r--source/blender/blenkernel/intern/action.c12
-rw-r--r--source/blender/blenkernel/intern/anim.c6
-rw-r--r--source/blender/blenkernel/intern/armature.c10
-rw-r--r--source/blender/blenkernel/intern/blender.c173
-rw-r--r--source/blender/blenkernel/intern/brush.c17
-rw-r--r--source/blender/blenkernel/intern/collision.c1
-rw-r--r--source/blender/blenkernel/intern/constraint.c13
-rw-r--r--source/blender/blenkernel/intern/curve.c2
-rw-r--r--source/blender/blenkernel/intern/customdata.c90
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c1
-rw-r--r--source/blender/blenkernel/intern/displist.c12
-rw-r--r--source/blender/blenkernel/intern/effect.c4
-rw-r--r--source/blender/blenkernel/intern/exotic.c113
-rw-r--r--source/blender/blenkernel/intern/font.c45
-rw-r--r--source/blender/blenkernel/intern/idprop.c8
-rw-r--r--source/blender/blenkernel/intern/image.c10
-rw-r--r--source/blender/blenkernel/intern/ipo.c5
-rw-r--r--source/blender/blenkernel/intern/key.c5
-rw-r--r--source/blender/blenkernel/intern/lattice.c4
-rw-r--r--source/blender/blenkernel/intern/library.c28
-rw-r--r--source/blender/blenkernel/intern/material.c3
-rw-r--r--source/blender/blenkernel/intern/mball.c5
-rw-r--r--source/blender/blenkernel/intern/mesh.c1
-rw-r--r--source/blender/blenkernel/intern/modifier.c16
-rw-r--r--source/blender/blenkernel/intern/multires-firstlevel.c8
-rw-r--r--source/blender/blenkernel/intern/multires.c21
-rw-r--r--source/blender/blenkernel/intern/nla.c6
-rw-r--r--source/blender/blenkernel/intern/node.c6
-rw-r--r--source/blender/blenkernel/intern/object.c7
-rw-r--r--source/blender/blenkernel/intern/packedFile.c19
-rw-r--r--source/blender/blenkernel/intern/particle.c8
-rw-r--r--source/blender/blenkernel/intern/particle_system.c15
-rw-r--r--source/blender/blenkernel/intern/pointcache.c1
-rw-r--r--source/blender/blenkernel/intern/property.c2
-rw-r--r--source/blender/blenkernel/intern/sca.c12
-rw-r--r--source/blender/blenkernel/intern/scene.c14
-rw-r--r--source/blender/blenkernel/intern/screen.c189
-rw-r--r--source/blender/blenkernel/intern/script.c9
-rw-r--r--source/blender/blenkernel/intern/softbody.c4
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c7
-rw-r--r--source/blender/blenkernel/intern/text.c15
-rw-r--r--source/blender/blenkernel/intern/texture.c7
-rw-r--r--source/blender/blenkernel/intern/verse_bitmap_node.c10
-rw-r--r--source/blender/blenkernel/intern/verse_geometry_node.c26
-rw-r--r--source/blender/blenkernel/intern/verse_method.c5
-rw-r--r--source/blender/blenkernel/intern/verse_node.c12
-rw-r--r--source/blender/blenkernel/intern/verse_object_node.c14
-rw-r--r--source/blender/blenkernel/intern/verse_session.c21
-rw-r--r--source/blender/blenkernel/intern/world.c1
-rw-r--r--source/blender/blenkernel/intern/writeavi.c10
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c63
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c10
-rw-r--r--source/blender/blenlib/BLI_arithb.h2
-rw-r--r--source/blender/blenlib/BLI_blenlib.h3
-rw-r--r--source/blender/blenlib/BLI_dynstr.h12
-rw-r--r--source/blender/blenlib/BLI_linklist.h1
-rw-r--r--source/blender/blenlib/BLI_memarena.h1
-rw-r--r--source/blender/blenlib/BLI_storage_types.h12
-rw-r--r--source/blender/blenlib/SConscript4
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c59
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c12
-rw-r--r--source/blender/blenlib/intern/BLI_memarena.c4
-rw-r--r--source/blender/blenlib/intern/Makefile6
-rw-r--r--source/blender/blenlib/intern/arithb.c61
-rw-r--r--source/blender/blenlib/intern/bpath.c15
-rw-r--r--source/blender/blenlib/intern/fileops.c6
-rw-r--r--source/blender/blenlib/intern/freetypefont.c19
-rw-r--r--source/blender/blenlib/intern/storage.c10
-rw-r--r--source/blender/blenlib/intern/threads.c2
-rw-r--r--source/blender/blenlib/intern/util.c17
-rw-r--r--source/blender/blenloader/BLO_readfile.h8
-rw-r--r--source/blender/blenloader/BLO_writefile.h8
-rw-r--r--source/blender/blenloader/SConscript2
-rw-r--r--source/blender/blenloader/intern/Makefile2
-rw-r--r--source/blender/blenloader/intern/readblenentry.c4
-rw-r--r--source/blender/blenloader/intern/readfile.c570
-rw-r--r--source/blender/blenloader/intern/writefile.c138
-rw-r--r--source/blender/editors/CMakeLists.txt (renamed from source/blender/src/CMakeLists.txt)20
-rw-r--r--source/blender/editors/Makefile34
-rw-r--r--source/blender/editors/SConscript27
-rw-r--r--source/blender/editors/datafiles/B.blend.c3076
-rw-r--r--source/blender/editors/datafiles/Bfont.c (renamed from source/blender/src/Bfont.c)2
-rw-r--r--source/blender/editors/datafiles/Makefile49
-rw-r--r--source/blender/editors/datafiles/SConscript9
-rw-r--r--source/blender/editors/datafiles/bfont.ttf.c (renamed from source/blender/src/bfont.ttf.c)0
-rw-r--r--source/blender/editors/datafiles/blenderbuttons.c3248
-rw-r--r--source/blender/editors/datafiles/splash.jpg.c2483
-rw-r--r--source/blender/editors/include/BIF_gl.h (renamed from source/blender/include/BIF_gl.h)2
-rw-r--r--source/blender/editors/include/BIF_glutil.h (renamed from source/blender/include/BIF_glutil.h)19
-rw-r--r--source/blender/editors/include/ED_datafiles.h (renamed from source/blender/include/datatoc.h)36
-rw-r--r--source/blender/editors/include/ED_interface.h0
-rw-r--r--source/blender/editors/include/ED_markers.h (renamed from source/blender/include/BIF_writeimage.h)34
-rw-r--r--source/blender/editors/include/ED_mesh.h (renamed from source/blender/include/BIF_drawscene.h)17
-rw-r--r--source/blender/editors/include/ED_object.h (renamed from source/blender/include/particle_effect.h)20
-rw-r--r--source/blender/editors/include/ED_previewrender.h (renamed from source/blender/include/BIF_previewrender.h)11
-rw-r--r--source/blender/editors/include/ED_screen.h85
-rw-r--r--source/blender/editors/include/ED_screen_types.h (renamed from source/blender/include/BIF_mainqueue.h)46
-rw-r--r--source/blender/editors/include/ED_space_api.h (renamed from source/blender/include/BSE_seqaudio.h)54
-rw-r--r--source/blender/editors/include/ED_transform.h (renamed from source/blender/blenloader/BLO_genfile.h)20
-rw-r--r--source/blender/editors/include/ED_types.h (renamed from source/blender/include/BIF_toets.h)25
-rw-r--r--source/blender/editors/include/ED_util.h (renamed from source/blender/include/BIF_drawoops.h)26
-rw-r--r--source/blender/editors/include/UI_interface.h (renamed from source/blender/include/BIF_interface.h)149
-rw-r--r--source/blender/editors/include/UI_interface_icons.h (renamed from source/blender/include/BIF_interface_icons.h)23
-rw-r--r--source/blender/editors/include/UI_resources.h (renamed from source/blender/include/BIF_resources.h)102
-rw-r--r--source/blender/editors/include/UI_text.h (renamed from source/blender/include/BIF_language.h)23
-rw-r--r--source/blender/editors/include/UI_view2d.h131
-rw-r--r--source/blender/editors/interface/Makefile60
-rw-r--r--source/blender/editors/interface/SConscript17
-rw-r--r--source/blender/editors/interface/interface.c2601
-rw-r--r--source/blender/editors/interface/interface.h (renamed from source/blender/include/interface.h)110
-rw-r--r--source/blender/editors/interface/interface_draw.c (renamed from source/blender/src/interface_draw.c)1253
-rw-r--r--source/blender/editors/interface/interface_handlers.c3608
-rw-r--r--source/blender/editors/interface/interface_icons.c (renamed from source/blender/src/interface_icons.c)196
-rw-r--r--source/blender/editors/interface/interface_regions.c1794
-rw-r--r--source/blender/editors/interface/resources.c (renamed from source/blender/src/resources.c)240
-rw-r--r--source/blender/editors/interface/text.c (renamed from source/blender/src/language.c)46
-rw-r--r--source/blender/editors/interface/view2d.c1479
-rw-r--r--source/blender/editors/interface/view2d_ops.c1192
-rw-r--r--source/blender/editors/mesh/Makefile52
-rw-r--r--source/blender/editors/mesh/SConscript0
-rw-r--r--source/blender/editors/object/Makefile52
-rw-r--r--source/blender/editors/object/SConscript0
-rw-r--r--source/blender/editors/screen/CMakeLists.txt87
-rw-r--r--source/blender/editors/screen/Makefile54
-rw-r--r--source/blender/editors/screen/SConscript15
-rw-r--r--source/blender/editors/screen/area.c628
-rw-r--r--source/blender/editors/screen/glutil.c (renamed from source/blender/src/glutil.c)242
-rw-r--r--source/blender/editors/screen/screen_edit.c1080
-rw-r--r--source/blender/editors/screen/screen_intern.h54
-rw-r--r--source/blender/editors/screen/screen_ops.c1359
-rw-r--r--source/blender/editors/screen/stubs.c97
-rw-r--r--source/blender/editors/space_action/Makefile53
-rw-r--r--source/blender/editors/space_action/SConscript9
-rw-r--r--source/blender/editors/space_action/action_header.c132
-rw-r--r--source/blender/editors/space_action/action_intern.h (renamed from source/blender/include/BSE_editnla_types.h)25
-rw-r--r--source/blender/editors/space_action/space_action.c276
-rw-r--r--source/blender/editors/space_api/Makefile (renamed from source/blender/blenkernel/bad_level_call_stubs/Makefile)32
-rw-r--r--source/blender/editors/space_api/SConscript15
-rw-r--r--source/blender/editors/space_api/space.c45
-rw-r--r--source/blender/editors/space_api/spacetypes.c175
-rw-r--r--source/blender/editors/space_buttons/Makefile53
-rw-r--r--source/blender/editors/space_buttons/SConscript9
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c200
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h (renamed from source/blender/include/BIF_butspace.h)85
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c272
-rw-r--r--source/blender/editors/space_file/Makefile53
-rw-r--r--source/blender/editors/space_file/SConscript10
-rw-r--r--source/blender/editors/space_file/file_header.c133
-rw-r--r--source/blender/editors/space_file/file_intern.h42
-rw-r--r--source/blender/editors/space_file/filesel.c92
-rw-r--r--source/blender/editors/space_file/space_file.c258
-rw-r--r--source/blender/editors/space_image/Makefile53
-rw-r--r--source/blender/editors/space_image/SConscript9
-rw-r--r--source/blender/editors/space_image/image_header.c132
-rw-r--r--source/blender/editors/space_image/image_intern.h (renamed from source/blender/include/BIF_drawscript.h)25
-rw-r--r--source/blender/editors/space_image/space_image.c258
-rw-r--r--source/blender/editors/space_info/Makefile53
-rw-r--r--source/blender/editors/space_info/SConscript9
-rw-r--r--source/blender/editors/space_info/info_header.c155
-rw-r--r--source/blender/editors/space_info/info_intern.h (renamed from source/blender/include/BIF_editsca.h)25
-rw-r--r--source/blender/editors/space_info/space_info.c235
-rw-r--r--source/blender/editors/space_ipo/Makefile53
-rw-r--r--source/blender/editors/space_ipo/SConscript9
-rw-r--r--source/blender/editors/space_ipo/ipo_header.c131
-rw-r--r--source/blender/editors/space_ipo/ipo_intern.h (renamed from source/blender/include/BIF_writemovie.h)25
-rw-r--r--source/blender/editors/space_ipo/space_ipo.c349
-rw-r--r--source/blender/editors/space_nla/Makefile53
-rw-r--r--source/blender/editors/space_nla/SConscript9
-rw-r--r--source/blender/editors/space_nla/nla_header.c132
-rw-r--r--source/blender/editors/space_nla/nla_intern.h (renamed from source/blender/include/playanim_ext.h)27
-rw-r--r--source/blender/editors/space_nla/space_nla.c275
-rw-r--r--source/blender/editors/space_node/Makefile53
-rw-r--r--source/blender/editors/space_node/SConscript9
-rw-r--r--source/blender/editors/space_node/node_header.c131
-rw-r--r--source/blender/editors/space_node/node_intern.h39
-rw-r--r--source/blender/editors/space_node/space_node.c269
-rw-r--r--source/blender/editors/space_outliner/Makefile54
-rw-r--r--source/blender/editors/space_outliner/SConscript10
-rw-r--r--source/blender/editors/space_outliner/outliner_header.c142
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h (renamed from source/blender/include/BIF_outliner.h)49
-rw-r--r--source/blender/editors/space_outliner/outliner_ops.c (renamed from source/blender/include/BIF_keyval.h)25
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c596
-rw-r--r--source/blender/editors/space_script/Makefile53
-rw-r--r--source/blender/editors/space_script/SConscript9
-rw-r--r--source/blender/editors/space_script/script_header.c132
-rw-r--r--source/blender/editors/space_script/script_intern.h39
-rw-r--r--source/blender/editors/space_script/space_script.c245
-rw-r--r--source/blender/editors/space_sequencer/Makefile53
-rw-r--r--source/blender/editors/space_sequencer/SConscript9
-rw-r--r--source/blender/editors/space_sequencer/sequencer_header.c132
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h41
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c264
-rw-r--r--source/blender/editors/space_sound/Makefile53
-rw-r--r--source/blender/editors/space_sound/SConscript9
-rw-r--r--source/blender/editors/space_sound/sound_header.c132
-rw-r--r--source/blender/editors/space_sound/sound_intern.h39
-rw-r--r--source/blender/editors/space_sound/space_sound.c270
-rw-r--r--source/blender/editors/space_text/Makefile53
-rw-r--r--source/blender/editors/space_text/SConscript9
-rw-r--r--source/blender/editors/space_text/space_text.c238
-rw-r--r--source/blender/editors/space_text/text_header.c132
-rw-r--r--source/blender/editors/space_text/text_intern.h39
-rw-r--r--source/blender/editors/space_time/Makefile54
-rw-r--r--source/blender/editors/space_time/SConscript10
-rw-r--r--source/blender/editors/space_time/ed_markers.c851
-rw-r--r--source/blender/editors/space_time/space_time.c311
-rw-r--r--source/blender/editors/space_time/time_header.c (renamed from source/blender/src/header_time.c)539
-rw-r--r--source/blender/editors/space_time/time_intern.h (renamed from source/blender/include/BIF_writeavicodec.h)33
-rw-r--r--source/blender/editors/space_time/time_ops.c238
-rw-r--r--source/blender/editors/space_view3d/Makefile53
-rw-r--r--source/blender/editors/space_view3d/SConscript9
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c266
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c132
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h (renamed from source/blender/include/BDR_drawmesh.h)32
-rw-r--r--source/blender/editors/transform/Makefile52
-rw-r--r--source/blender/editors/transform/SConscript0
-rw-r--r--source/blender/editors/util/Makefile54
-rw-r--r--source/blender/editors/util/SConscript10
-rw-r--r--source/blender/editors/util/ed_util.c82
-rw-r--r--source/blender/ftfont/SConscript4
-rw-r--r--source/blender/ftfont/intern/FTF_Api.cpp4
-rw-r--r--source/blender/ftfont/intern/Makefile3
-rw-r--r--source/blender/imbuf/IMB_imbuf.h7
-rw-r--r--source/blender/imbuf/SConscript2
-rw-r--r--source/blender/imbuf/intern/cineon/SConscript4
-rw-r--r--source/blender/imbuf/intern/dds/SConscript2
-rw-r--r--source/blender/imbuf/intern/imageprocess.c193
-rw-r--r--source/blender/imbuf/intern/openexr/SConscript4
-rw-r--r--source/blender/imbuf/intern/thumbs.c5
-rw-r--r--source/blender/imbuf/intern/writeimage.c2
-rw-r--r--source/blender/include/BDR_drawaction.h97
-rw-r--r--source/blender/include/BDR_drawobject.h79
-rw-r--r--source/blender/include/BDR_editcurve.h106
-rw-r--r--source/blender/include/BDR_editface.h61
-rw-r--r--source/blender/include/BDR_editmball.h53
-rw-r--r--source/blender/include/BDR_editobject.h134
-rw-r--r--source/blender/include/BDR_gpencil.h87
-rw-r--r--source/blender/include/BDR_imagepaint.h41
-rw-r--r--source/blender/include/BDR_sculptmode.h87
-rw-r--r--source/blender/include/BDR_unwrapper.h49
-rw-r--r--source/blender/include/BDR_vpaint.h55
-rw-r--r--source/blender/include/BIF_drawgpencil.h47
-rw-r--r--source/blender/include/BIF_drawimage.h68
-rw-r--r--source/blender/include/BIF_drawseq.h47
-rw-r--r--source/blender/include/BIF_drawtext.h52
-rw-r--r--source/blender/include/BIF_editaction.h232
-rw-r--r--source/blender/include/BIF_editarmature.h173
-rw-r--r--source/blender/include/BIF_editconstraint.h64
-rw-r--r--source/blender/include/BIF_editdeform.h75
-rw-r--r--source/blender/include/BIF_editfont.h70
-rw-r--r--source/blender/include/BIF_editgroup.h37
-rw-r--r--source/blender/include/BIF_editkey.h67
-rw-r--r--source/blender/include/BIF_editlattice.h42
-rw-r--r--source/blender/include/BIF_editmesh.h265
-rw-r--r--source/blender/include/BIF_editmode_undo.h57
-rw-r--r--source/blender/include/BIF_editnla.h62
-rw-r--r--source/blender/include/BIF_editparticle.h98
-rw-r--r--source/blender/include/BIF_editseq.h111
-rw-r--r--source/blender/include/BIF_editsima.h114
-rw-r--r--source/blender/include/BIF_editsound.h84
-rw-r--r--source/blender/include/BIF_editview.h63
-rw-r--r--source/blender/include/BIF_filelist.h86
-rw-r--r--source/blender/include/BIF_fsmenu.h73
-rw-r--r--source/blender/include/BIF_graphics.h56
-rw-r--r--source/blender/include/BIF_imasel.h50
-rw-r--r--source/blender/include/BIF_keyframing.h131
-rw-r--r--source/blender/include/BIF_meshlaplacian.h84
-rw-r--r--source/blender/include/BIF_meshtools.h51
-rw-r--r--source/blender/include/BIF_mywindow.h145
-rw-r--r--source/blender/include/BIF_oops.h78
-rw-r--r--source/blender/include/BIF_poselib.h52
-rw-r--r--source/blender/include/BIF_poseobject.h85
-rw-r--r--source/blender/include/BIF_radialcontrol.h62
-rw-r--r--source/blender/include/BIF_renderwin.h74
-rw-r--r--source/blender/include/BIF_retopo.h110
-rw-r--r--source/blender/include/BIF_scrarea.h51
-rw-r--r--source/blender/include/BIF_screen.h133
-rw-r--r--source/blender/include/BIF_space.h157
-rw-r--r--source/blender/include/BIF_spacetypes.h64
-rw-r--r--source/blender/include/BIF_tbcallback.h39
-rw-r--r--source/blender/include/BIF_toolbox.h75
-rw-r--r--source/blender/include/BIF_transform.h129
-rw-r--r--source/blender/include/BIF_usiblender.h52
-rw-r--r--source/blender/include/BIF_verse.h139
-rw-r--r--source/blender/include/BSE_drawimasel.h57
-rw-r--r--source/blender/include/BSE_drawipo.h77
-rw-r--r--source/blender/include/BSE_drawnla.h49
-rw-r--r--source/blender/include/BSE_drawoops.h47
-rw-r--r--source/blender/include/BSE_drawview.h86
-rw-r--r--source/blender/include/BSE_edit.h54
-rw-r--r--source/blender/include/BSE_editaction_types.h86
-rw-r--r--source/blender/include/BSE_editipo.h171
-rw-r--r--source/blender/include/BSE_editipo_types.h50
-rw-r--r--source/blender/include/BSE_filesel.h64
-rw-r--r--source/blender/include/BSE_headerbuttons.h155
-rw-r--r--source/blender/include/BSE_node.h148
-rw-r--r--source/blender/include/BSE_seqeffects.h94
-rw-r--r--source/blender/include/BSE_seqscopes.h41
-rw-r--r--source/blender/include/BSE_sequence.h100
-rw-r--r--source/blender/include/BSE_time.h82
-rw-r--r--source/blender/include/BSE_trans_types.h87
-rw-r--r--source/blender/include/BSE_types.h66
-rw-r--r--source/blender/include/BSE_view.h100
-rw-r--r--source/blender/include/LOD_DependKludge.h37
-rw-r--r--source/blender/include/blendef.h461
-rw-r--r--source/blender/include/butspace.h806
-rw-r--r--source/blender/include/editlattice_ext.h39
-rw-r--r--source/blender/include/editmesh.h107
-rw-r--r--source/blender/include/keyed_functions.h55
-rw-r--r--source/blender/include/multires.h59
-rw-r--r--source/blender/include/nla.h56
-rw-r--r--source/blender/include/objfnt.h102
-rw-r--r--source/blender/include/reeb.h192
-rw-r--r--source/blender/include/transform.h548
-rw-r--r--source/blender/makesdna/DNA_ID.h29
-rw-r--r--source/blender/makesdna/DNA_action_types.h1
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h2
-rw-r--r--source/blender/makesdna/DNA_documentation.h2
-rw-r--r--source/blender/makesdna/DNA_genfile.h (renamed from source/blender/blenloader/intern/genfile.h)20
-rw-r--r--source/blender/makesdna/DNA_material_types.h5
-rw-r--r--source/blender/makesdna/DNA_packedFile_types.h3
-rw-r--r--source/blender/makesdna/DNA_radio_types.h12
-rw-r--r--source/blender/makesdna/DNA_scene_types.h42
-rw-r--r--source/blender/makesdna/DNA_screen_types.h131
-rw-r--r--source/blender/makesdna/DNA_scriptlink_types.h8
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h30
-rw-r--r--source/blender/makesdna/DNA_sound_types.h1
-rw-r--r--source/blender/makesdna/DNA_space_types.h77
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesdna/DNA_vfont_types.h1
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h101
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h2
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h195
-rw-r--r--source/blender/makesdna/SConscript4
-rw-r--r--source/blender/makesdna/intern/Makefile16
-rw-r--r--source/blender/makesdna/intern/SConscript21
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c (renamed from source/blender/blenloader/intern/genfile.c)147
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
-rw-r--r--source/blender/makesrna/CMakeLists.txt (renamed from source/blender/blenkernel/bad_level_call_stubs/CMakeLists.txt)20
-rw-r--r--source/blender/makesrna/Makefile31
-rw-r--r--source/blender/makesrna/RNA_access.h306
-rw-r--r--source/blender/makesrna/RNA_define.h94
-rw-r--r--source/blender/makesrna/RNA_types.h145
-rw-r--r--source/blender/makesrna/SConscript11
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt34
-rw-r--r--source/blender/makesrna/intern/Makefile79
-rw-r--r--source/blender/makesrna/intern/SConscript68
-rw-r--r--source/blender/makesrna/intern/makesrna.c1040
-rw-r--r--source/blender/makesrna/intern/rna_ID.c207
-rw-r--r--source/blender/makesrna/intern/rna_access.c1632
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c81
-rw-r--r--source/blender/makesrna/intern/rna_armature.c420
-rw-r--r--source/blender/makesrna/intern/rna_brush.c153
-rw-r--r--source/blender/makesrna/intern/rna_camera.c146
-rw-r--r--source/blender/makesrna/intern/rna_color.c233
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c137
-rw-r--r--source/blender/makesrna/intern/rna_controller.c122
-rw-r--r--source/blender/makesrna/intern/rna_curve.c357
-rw-r--r--source/blender/makesrna/intern/rna_define.c1408
-rw-r--r--source/blender/makesrna/intern/rna_dependency.c92
-rw-r--r--source/blender/makesrna/intern/rna_group.c71
-rw-r--r--source/blender/makesrna/intern/rna_image.c230
-rw-r--r--source/blender/makesrna/intern/rna_internal.h193
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h246
-rw-r--r--source/blender/makesrna/intern/rna_ipo.c155
-rw-r--r--source/blender/makesrna/intern/rna_key.c350
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c385
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c92
-rw-r--r--source/blender/makesrna/intern/rna_main.c272
-rw-r--r--source/blender/makesrna/intern/rna_material.c186
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c983
-rw-r--r--source/blender/makesrna/intern/rna_meta.c150
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c117
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c63
-rw-r--r--source/blender/makesrna/intern/rna_object.c95
-rw-r--r--source/blender/makesrna/intern/rna_packedfile.c (renamed from source/blender/include/BIF_editoops.h)41
-rw-r--r--source/blender/makesrna/intern/rna_property.c153
-rw-r--r--source/blender/makesrna/intern/rna_radio.c139
-rw-r--r--source/blender/makesrna/intern/rna_rna.c602
-rw-r--r--source/blender/makesrna/intern/rna_scene.c153
-rw-r--r--source/blender/makesrna/intern/rna_screen.c203
-rw-r--r--source/blender/makesrna/intern/rna_sensor.c528
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c (renamed from source/blender/python/api2_2x/Font.h)49
-rw-r--r--source/blender/makesrna/intern/rna_wm.c93
-rw-r--r--source/blender/makesrna/intern/rna_world.c111
-rw-r--r--source/blender/nodes/CMakeLists.txt4
-rw-r--r--source/blender/nodes/Makefile4
-rw-r--r--source/blender/nodes/SConscript4
-rw-r--r--source/blender/nodes/TEX_node.h2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/CMP_util.h24
-rw-r--r--source/blender/nodes/intern/Makefile5
-rw-r--r--source/blender/nodes/intern/SHD_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c11
-rw-r--r--source/blender/nodes/intern/SHD_util.h26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_coord.c66
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_distance.c79
-rw-r--r--source/blender/nodes/intern/TEX_util.c31
-rw-r--r--source/blender/nodes/intern/TEX_util.h4
-rw-r--r--source/blender/python/BPY_extern.h2
-rw-r--r--source/blender/python/BPY_interface.c3024
-rw-r--r--source/blender/python/BPY_menus.c1166
-rw-r--r--source/blender/python/BPY_menus.h127
-rw-r--r--source/blender/python/CMakeLists.txt43
-rw-r--r--source/blender/python/Makefile6
-rw-r--r--source/blender/python/SConscript28
-rw-r--r--source/blender/python/api2_2x/Armature.c1489
-rw-r--r--source/blender/python/api2_2x/Armature.h67
-rw-r--r--source/blender/python/api2_2x/BGL.c1588
-rw-r--r--source/blender/python/api2_2x/BGL.h335
-rw-r--r--source/blender/python/api2_2x/BezTriple.c714
-rw-r--r--source/blender/python/api2_2x/BezTriple.h61
-rw-r--r--source/blender/python/api2_2x/Blender.c1112
-rw-r--r--source/blender/python/api2_2x/Blender.h38
-rw-r--r--source/blender/python/api2_2x/Bone.c1430
-rw-r--r--source/blender/python/api2_2x/Bone.h73
-rw-r--r--source/blender/python/api2_2x/Camera.c1060
-rw-r--r--source/blender/python/api2_2x/Camera.h79
-rw-r--r--source/blender/python/api2_2x/Constraint.c2906
-rw-r--r--source/blender/python/api2_2x/Constraint.h73
-rw-r--r--source/blender/python/api2_2x/CurNurb.c1146
-rw-r--r--source/blender/python/api2_2x/CurNurb.h67
-rw-r--r--source/blender/python/api2_2x/Curve.c1695
-rw-r--r--source/blender/python/api2_2x/Curve.h75
-rw-r--r--source/blender/python/api2_2x/Draw.c2455
-rw-r--r--source/blender/python/api2_2x/Draw.h74
-rw-r--r--source/blender/python/api2_2x/EXPP_interface.c227
-rw-r--r--source/blender/python/api2_2x/EXPP_interface.h53
-rw-r--r--source/blender/python/api2_2x/Effect.c1319
-rw-r--r--source/blender/python/api2_2x/Effect.h55
-rw-r--r--source/blender/python/api2_2x/Font.c400
-rw-r--r--source/blender/python/api2_2x/Geometry.c439
-rw-r--r--source/blender/python/api2_2x/Geometry.h39
-rw-r--r--source/blender/python/api2_2x/Group.c841
-rw-r--r--source/blender/python/api2_2x/Group.h63
-rw-r--r--source/blender/python/api2_2x/IDProp.c965
-rw-r--r--source/blender/python/api2_2x/IDProp.h58
-rw-r--r--source/blender/python/api2_2x/Image.c1475
-rw-r--r--source/blender/python/api2_2x/Image.h57
-rw-r--r--source/blender/python/api2_2x/Ipo.c1838
-rw-r--r--source/blender/python/api2_2x/Ipo.h60
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c1106
-rw-r--r--source/blender/python/api2_2x/Ipocurve.h55
-rw-r--r--source/blender/python/api2_2x/Key.c678
-rw-r--r--source/blender/python/api2_2x/Key.h65
-rw-r--r--source/blender/python/api2_2x/Lamp.c1728
-rw-r--r--source/blender/python/api2_2x/Lamp.h58
-rw-r--r--source/blender/python/api2_2x/Lattice.c810
-rw-r--r--source/blender/python/api2_2x/Lattice.h57
-rw-r--r--source/blender/python/api2_2x/Library.c1316
-rw-r--r--source/blender/python/api2_2x/Library.h77
-rw-r--r--source/blender/python/api2_2x/MTex.c943
-rw-r--r--source/blender/python/api2_2x/MTex.h64
-rw-r--r--source/blender/python/api2_2x/Material.c3479
-rw-r--r--source/blender/python/api2_2x/Material.h75
-rw-r--r--source/blender/python/api2_2x/Mathutils.c1759
-rw-r--r--source/blender/python/api2_2x/Mathutils.h82
-rw-r--r--source/blender/python/api2_2x/Mesh.c8880
-rw-r--r--source/blender/python/api2_2x/Mesh.h124
-rw-r--r--source/blender/python/api2_2x/Metaball.c1186
-rw-r--r--source/blender/python/api2_2x/Metaball.h78
-rw-r--r--source/blender/python/api2_2x/Modifier.c1748
-rw-r--r--source/blender/python/api2_2x/Modifier.h69
-rw-r--r--source/blender/python/api2_2x/NLA.c1592
-rw-r--r--source/blender/python/api2_2x/NLA.h74
-rw-r--r--source/blender/python/api2_2x/NMesh.c4166
-rw-r--r--source/blender/python/api2_2x/NMesh.h154
-rw-r--r--source/blender/python/api2_2x/Node.c1673
-rw-r--r--source/blender/python/api2_2x/Node.h103
-rw-r--r--source/blender/python/api2_2x/Noise.c710
-rw-r--r--source/blender/python/api2_2x/Object.c6313
-rw-r--r--source/blender/python/api2_2x/Object.h59
-rw-r--r--source/blender/python/api2_2x/Particle.c2012
-rw-r--r--source/blender/python/api2_2x/Particle.h53
-rw-r--r--source/blender/python/api2_2x/Pose.c1394
-rw-r--r--source/blender/python/api2_2x/Pose.h68
-rw-r--r--source/blender/python/api2_2x/Registry.c242
-rw-r--r--source/blender/python/api2_2x/Registry.h47
-rw-r--r--source/blender/python/api2_2x/Scene.c1873
-rw-r--r--source/blender/python/api2_2x/Scene.h67
-rw-r--r--source/blender/python/api2_2x/Sound.c604
-rw-r--r--source/blender/python/api2_2x/Sound.h54
-rw-r--r--source/blender/python/api2_2x/SurfNurb.c917
-rw-r--r--source/blender/python/api2_2x/SurfNurb.h65
-rw-r--r--source/blender/python/api2_2x/Sys.c421
-rw-r--r--source/blender/python/api2_2x/Text.c932
-rw-r--r--source/blender/python/api2_2x/Text.h51
-rw-r--r--source/blender/python/api2_2x/Text3d.c1250
-rw-r--r--source/blender/python/api2_2x/Text3d.h53
-rw-r--r--source/blender/python/api2_2x/Texture.c2569
-rw-r--r--source/blender/python/api2_2x/Texture.h61
-rw-r--r--source/blender/python/api2_2x/Types.c378
-rw-r--r--source/blender/python/api2_2x/Types.h38
-rw-r--r--source/blender/python/api2_2x/Window.c1585
-rw-r--r--source/blender/python/api2_2x/Window.h40
-rw-r--r--source/blender/python/api2_2x/World.c1138
-rw-r--r--source/blender/python/api2_2x/World.h55
-rw-r--r--source/blender/python/api2_2x/bpy.c83
-rw-r--r--source/blender/python/api2_2x/bpy.h38
-rw-r--r--source/blender/python/api2_2x/bpy_config.c412
-rw-r--r--source/blender/python/api2_2x/bpy_data.c820
-rw-r--r--source/blender/python/api2_2x/bpy_data.h52
-rw-r--r--source/blender/python/api2_2x/bpy_types.h90
-rw-r--r--source/blender/python/api2_2x/charRGBA.c472
-rw-r--r--source/blender/python/api2_2x/charRGBA.h56
-rw-r--r--source/blender/python/api2_2x/constant.c266
-rw-r--r--source/blender/python/api2_2x/constant.h50
-rw-r--r--source/blender/python/api2_2x/doc/API_intro.py245
-rw-r--r--source/blender/python/api2_2x/doc/API_related.py571
-rw-r--r--source/blender/python/api2_2x/doc/Armature.py381
-rw-r--r--source/blender/python/api2_2x/doc/BGL.py1778
-rw-r--r--source/blender/python/api2_2x/doc/BezTriple.py96
-rw-r--r--source/blender/python/api2_2x/doc/Blender.py260
-rw-r--r--source/blender/python/api2_2x/doc/Blender_API.css44
-rw-r--r--source/blender/python/api2_2x/doc/Bpy.py25
-rw-r--r--source/blender/python/api2_2x/doc/Bpy_config.py38
-rw-r--r--source/blender/python/api2_2x/doc/Bpy_data.py281
-rw-r--r--source/blender/python/api2_2x/doc/Camera.py257
-rw-r--r--source/blender/python/api2_2x/doc/Constraint.py254
-rw-r--r--source/blender/python/api2_2x/doc/Curve.py729
-rw-r--r--source/blender/python/api2_2x/doc/Curvedoc.txt105
-rw-r--r--source/blender/python/api2_2x/doc/Draw.py906
-rw-r--r--source/blender/python/api2_2x/doc/Effect.py591
-rw-r--r--source/blender/python/api2_2x/doc/Effectdoc.txt257
-rw-r--r--source/blender/python/api2_2x/doc/Font.py69
-rw-r--r--source/blender/python/api2_2x/doc/Geometry.py105
-rw-r--r--source/blender/python/api2_2x/doc/Group.py135
-rw-r--r--source/blender/python/api2_2x/doc/IDProp.py132
-rw-r--r--source/blender/python/api2_2x/doc/Image.py411
-rw-r--r--source/blender/python/api2_2x/doc/Ipo.py437
-rw-r--r--source/blender/python/api2_2x/doc/IpoCurve.py239
-rw-r--r--source/blender/python/api2_2x/doc/Ipodoc.txt66
-rw-r--r--source/blender/python/api2_2x/doc/Key.py124
-rw-r--r--source/blender/python/api2_2x/doc/Lamp.py532
-rw-r--r--source/blender/python/api2_2x/doc/Lattice.py209
-rw-r--r--source/blender/python/api2_2x/doc/LibData.py161
-rw-r--r--source/blender/python/api2_2x/doc/Library.py114
-rw-r--r--source/blender/python/api2_2x/doc/Material.py1149
-rw-r--r--source/blender/python/api2_2x/doc/Mathutils.py873
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py1266
-rw-r--r--source/blender/python/api2_2x/doc/MeshPrimitives.py157
-rw-r--r--source/blender/python/api2_2x/doc/Metaball.py246
-rw-r--r--source/blender/python/api2_2x/doc/Metaballdoc.txt58
-rw-r--r--source/blender/python/api2_2x/doc/Modifier.py231
-rw-r--r--source/blender/python/api2_2x/doc/NLA.py250
-rw-r--r--source/blender/python/api2_2x/doc/NMesh.py823
-rw-r--r--source/blender/python/api2_2x/doc/Noise.py298
-rw-r--r--source/blender/python/api2_2x/doc/Object.py1790
-rw-r--r--source/blender/python/api2_2x/doc/Particle.py185
-rw-r--r--source/blender/python/api2_2x/doc/Pose.py245
-rw-r--r--source/blender/python/api2_2x/doc/Radio.py351
-rw-r--r--source/blender/python/api2_2x/doc/Registry.py122
-rw-r--r--source/blender/python/api2_2x/doc/Render.py1244
-rw-r--r--source/blender/python/api2_2x/doc/Renderlayer.py92
-rw-r--r--source/blender/python/api2_2x/doc/SConscript28
-rw-r--r--source/blender/python/api2_2x/doc/Scene.py402
-rw-r--r--source/blender/python/api2_2x/doc/Sound.py147
-rw-r--r--source/blender/python/api2_2x/doc/Sys.py176
-rw-r--r--source/blender/python/api2_2x/doc/Text.py224
-rw-r--r--source/blender/python/api2_2x/doc/Text3d.py322
-rw-r--r--source/blender/python/api2_2x/doc/Texture.py612
-rw-r--r--source/blender/python/api2_2x/doc/Theme.py211
-rw-r--r--source/blender/python/api2_2x/doc/TimeLine.py80
-rw-r--r--source/blender/python/api2_2x/doc/Types.py93
-rw-r--r--source/blender/python/api2_2x/doc/Window.py544
-rw-r--r--source/blender/python/api2_2x/doc/World.py353
-rw-r--r--source/blender/python/api2_2x/doc/Worlddoc.txt55
-rw-r--r--source/blender/python/api2_2x/doc/epy_docgen.sh11
-rw-r--r--source/blender/python/api2_2x/doc/id_generics.py30
-rw-r--r--source/blender/python/api2_2x/doc/testbgl.py45
-rw-r--r--source/blender/python/api2_2x/doc/testcamera.py137
-rw-r--r--source/blender/python/api2_2x/doc/testcurve.py20
-rw-r--r--source/blender/python/api2_2x/doc/testeffect.py65
-rw-r--r--source/blender/python/api2_2x/doc/testipo.py24
-rw-r--r--source/blender/python/api2_2x/doc/testmball.py37
-rw-r--r--source/blender/python/api2_2x/doc/testtext.py29
-rw-r--r--source/blender/python/api2_2x/doc/testworld.py21
-rw-r--r--source/blender/python/api2_2x/euler.c499
-rw-r--r--source/blender/python/api2_2x/euler.h64
-rw-r--r--source/blender/python/api2_2x/gen_library.c332
-rw-r--r--source/blender/python/api2_2x/gen_library.h91
-rw-r--r--source/blender/python/api2_2x/gen_utils.c957
-rw-r--r--source/blender/python/api2_2x/gen_utils.h174
-rw-r--r--source/blender/python/api2_2x/logic.c526
-rw-r--r--source/blender/python/api2_2x/logic.h58
-rw-r--r--source/blender/python/api2_2x/matrix.c972
-rw-r--r--source/blender/python/api2_2x/matrix.h77
-rw-r--r--source/blender/python/api2_2x/meshPrimitive.c276
-rw-r--r--source/blender/python/api2_2x/meshPrimitive.h43
-rw-r--r--source/blender/python/api2_2x/modules.h62
-rw-r--r--source/blender/python/api2_2x/point.c523
-rw-r--r--source/blender/python/api2_2x/point.h64
-rw-r--r--source/blender/python/api2_2x/quat.c665
-rw-r--r--source/blender/python/api2_2x/quat.h70
-rw-r--r--source/blender/python/api2_2x/rgbTuple.c417
-rw-r--r--source/blender/python/api2_2x/rgbTuple.h53
-rw-r--r--source/blender/python/api2_2x/sceneRadio.c890
-rw-r--r--source/blender/python/api2_2x/sceneRadio.h48
-rw-r--r--source/blender/python/api2_2x/sceneRender.c3980
-rw-r--r--source/blender/python/api2_2x/sceneRender.h59
-rw-r--r--source/blender/python/api2_2x/sceneSequence.c1406
-rw-r--r--source/blender/python/api2_2x/sceneSequence.h80
-rw-r--r--source/blender/python/api2_2x/sceneTimeLine.c316
-rw-r--r--source/blender/python/api2_2x/sceneTimeLine.h55
-rw-r--r--source/blender/python/api2_2x/vector.c1313
-rw-r--r--source/blender/python/api2_2x/vector.h59
-rw-r--r--source/blender/python/api2_2x/windowTheme.c826
-rw-r--r--source/blender/python/api2_2x/windowTheme.h57
-rw-r--r--source/blender/python/intern/Makefile (renamed from source/blender/python/api2_2x/Makefile)60
-rw-r--r--source/blender/python/intern/bpy_compat.h60
-rw-r--r--source/blender/python/intern/bpy_interface.c85
-rw-r--r--source/blender/python/intern/bpy_rna.c1147
-rw-r--r--source/blender/python/intern/bpy_rna.h (renamed from source/blender/python/api2_2x/bpy_config.h)38
-rw-r--r--source/blender/python/intern/bpy_scriptlink.c73
-rw-r--r--source/blender/quicktime/SConscript6
-rw-r--r--source/blender/quicktime/apple/Makefile2
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c3
-rw-r--r--source/blender/radiosity/CMakeLists.txt2
-rw-r--r--source/blender/radiosity/SConscript4
-rw-r--r--source/blender/radiosity/extern/include/radio_types.h4
-rw-r--r--source/blender/radiosity/intern/source/Makefile2
-rw-r--r--source/blender/radiosity/intern/source/raddisplay.c58
-rw-r--r--source/blender/radiosity/intern/source/radfactors.c18
-rw-r--r--source/blender/radiosity/intern/source/radio.c18
-rw-r--r--source/blender/radiosity/intern/source/radnode.c4
-rw-r--r--source/blender/radiosity/intern/source/radpostprocess.c18
-rw-r--r--source/blender/radiosity/intern/source/radpreprocess.c12
-rw-r--r--source/blender/radiosity/intern/source/radrender.c5
-rw-r--r--source/blender/render/SConscript2
-rw-r--r--source/blender/render/intern/source/Makefile2
-rw-r--r--source/blender/render/intern/source/convertblender.c3
-rw-r--r--source/blender/render/intern/source/pipeline.c4
-rw-r--r--source/blender/src/.BCkey1
-rw-r--r--source/blender/src/B.blend.c4488
-rw-r--r--source/blender/src/SConscript101
-rw-r--r--source/blender/src/autoarmature.c2968
-rw-r--r--source/blender/src/blenderbuttons.c2139
-rw-r--r--source/blender/src/booleanops.c570
-rw-r--r--source/blender/src/booleanops_mesh.c293
-rw-r--r--source/blender/src/butspace.c807
-rw-r--r--source/blender/src/buttons_editing.c6826
-rw-r--r--source/blender/src/buttons_logic.c3822
-rw-r--r--source/blender/src/buttons_object.c5971
-rw-r--r--source/blender/src/buttons_scene.c3546
-rw-r--r--source/blender/src/buttons_script.c384
-rw-r--r--source/blender/src/buttons_shading.c4654
-rw-r--r--source/blender/src/cmap.tga.c89
-rw-r--r--source/blender/src/cmovie.tga.c202
-rw-r--r--source/blender/src/drawaction.c1882
-rw-r--r--source/blender/src/drawarmature.c2576
-rw-r--r--source/blender/src/drawdeps.c313
-rw-r--r--source/blender/src/drawgpencil.c1045
-rw-r--r--source/blender/src/drawimage.c2903
-rw-r--r--source/blender/src/drawimasel.c783
-rw-r--r--source/blender/src/drawipo.c2802
-rw-r--r--source/blender/src/drawmesh.c586
-rw-r--r--source/blender/src/drawnla.c862
-rw-r--r--source/blender/src/drawnode.c3733
-rw-r--r--source/blender/src/drawobject.c5569
-rw-r--r--source/blender/src/drawoops.c527
-rw-r--r--source/blender/src/drawscene.c135
-rw-r--r--source/blender/src/drawscript.c190
-rw-r--r--source/blender/src/drawseq.c1266
-rw-r--r--source/blender/src/drawsound.c237
-rw-r--r--source/blender/src/drawtext.c3493
-rw-r--r--source/blender/src/drawtime.c506
-rw-r--r--source/blender/src/drawview.c3927
-rw-r--r--source/blender/src/edit.c1918
-rw-r--r--source/blender/src/editaction.c5244
-rw-r--r--source/blender/src/editaction_gpencil.c755
-rw-r--r--source/blender/src/editarmature.c5079
-rw-r--r--source/blender/src/editconstraint.c990
-rw-r--r--source/blender/src/editcurve.c4722
-rw-r--r--source/blender/src/editdeform.c1085
-rw-r--r--source/blender/src/editface.c1456
-rw-r--r--source/blender/src/editfont.c1288
-rw-r--r--source/blender/src/editgroup.c255
-rw-r--r--source/blender/src/editimasel.c1183
-rw-r--r--source/blender/src/editipo.c4731
-rw-r--r--source/blender/src/editipo_lib.c410
-rw-r--r--source/blender/src/editipo_mods.c1412
-rw-r--r--source/blender/src/editkey.c777
-rw-r--r--source/blender/src/editlattice.c343
-rw-r--r--source/blender/src/editmball.c541
-rw-r--r--source/blender/src/editmesh.c2374
-rw-r--r--source/blender/src/editmesh_add.c1498
-rw-r--r--source/blender/src/editmesh_lib.c2311
-rw-r--r--source/blender/src/editmesh_loop.c951
-rw-r--r--source/blender/src/editmesh_mods.c4457
-rw-r--r--source/blender/src/editmesh_tools.c7206
-rw-r--r--source/blender/src/editmode_undo.c375
-rw-r--r--source/blender/src/editnla.c2085
-rw-r--r--source/blender/src/editnode.c2694
-rw-r--r--source/blender/src/editobject.c6091
-rw-r--r--source/blender/src/editoops.c672
-rw-r--r--source/blender/src/editparticle.c3194
-rw-r--r--source/blender/src/editscreen.c3843
-rw-r--r--source/blender/src/editseq.c3988
-rw-r--r--source/blender/src/editsima.c2863
-rw-r--r--source/blender/src/editsound.c1077
-rw-r--r--source/blender/src/edittime.c1019
-rw-r--r--source/blender/src/editview.c2914
-rw-r--r--source/blender/src/eventdebug.c192
-rw-r--r--source/blender/src/filelist.c1109
-rw-r--r--source/blender/src/filesel.c2649
-rw-r--r--source/blender/src/fluidsim.c1142
-rw-r--r--source/blender/src/fsmenu.c254
-rw-r--r--source/blender/src/ghostwinlay.c1004
-rw-r--r--source/blender/src/gpencil.c2137
-rw-r--r--source/blender/src/hddaudio.c586
-rw-r--r--source/blender/src/header_action.c1789
-rw-r--r--source/blender/src/header_buttonswin.c732
-rw-r--r--source/blender/src/header_filesel.c194
-rw-r--r--source/blender/src/header_image.c1352
-rw-r--r--source/blender/src/header_imasel.c219
-rw-r--r--source/blender/src/header_info.c2423
-rw-r--r--source/blender/src/header_ipo.c1433
-rw-r--r--source/blender/src/header_nla.c552
-rw-r--r--source/blender/src/header_node.c803
-rw-r--r--source/blender/src/header_oops.c582
-rw-r--r--source/blender/src/header_script.c285
-rw-r--r--source/blender/src/header_seq.c794
-rw-r--r--source/blender/src/header_sound.c441
-rw-r--r--source/blender/src/header_text.c1111
-rw-r--r--source/blender/src/header_view3d.c5937
-rw-r--r--source/blender/src/headerbuttons.c2161
-rw-r--r--source/blender/src/imagepaint.c929
-rw-r--r--source/blender/src/imasel.c105
-rw-r--r--source/blender/src/interface.c6808
-rw-r--r--source/blender/src/interface_panel.c1964
-rw-r--r--source/blender/src/keyframing.c2104
-rw-r--r--source/blender/src/keyval.c546
-rw-r--r--source/blender/src/lorem.c513
-rw-r--r--source/blender/src/mainqueue.c99
-rw-r--r--source/blender/src/meshlaplacian.c1912
-rw-r--r--source/blender/src/meshtools.c1174
-rw-r--r--source/blender/src/multires.c431
-rw-r--r--source/blender/src/mywindow.c729
-rw-r--r--source/blender/src/oops.c1178
-rw-r--r--source/blender/src/outliner.c4121
-rw-r--r--source/blender/src/parametrizer.c4295
-rw-r--r--source/blender/src/parametrizer.h97
-rw-r--r--source/blender/src/parametrizer_intern.h194
-rw-r--r--source/blender/src/playanim.c838
-rw-r--r--source/blender/src/poselib.c1329
-rw-r--r--source/blender/src/poseobject.c1743
-rw-r--r--source/blender/src/preview.blend.c13952
-rw-r--r--source/blender/src/previewrender.c962
-rw-r--r--source/blender/src/prvicons.c436
-rw-r--r--source/blender/src/radialcontrol.c267
-rw-r--r--source/blender/src/reeb.c3790
-rw-r--r--source/blender/src/renderwin.c1556
-rw-r--r--source/blender/src/retopo.c927
-rw-r--r--source/blender/src/scrarea.c66
-rw-r--r--source/blender/src/screendump.c159
-rw-r--r--source/blender/src/sculptmode-stroke.c284
-rw-r--r--source/blender/src/sculptmode.c2086
-rw-r--r--source/blender/src/seqaudio.c590
-rw-r--r--source/blender/src/seqeffects.c3139
-rw-r--r--source/blender/src/seqscopes.c697
-rw-r--r--source/blender/src/sequence.c2990
-rw-r--r--source/blender/src/space.c7150
-rw-r--r--source/blender/src/spacetypes.c158
-rw-r--r--source/blender/src/splash.jpg.c9036
-rw-r--r--source/blender/src/swapbuffers.c286
-rw-r--r--source/blender/src/toets.c1013
-rw-r--r--source/blender/src/toolbox.c2393
-rw-r--r--source/blender/src/transform.c4767
-rw-r--r--source/blender/src/transform_constraints.c1070
-rw-r--r--source/blender/src/transform_conversions.c4343
-rw-r--r--source/blender/src/transform_generics.c1114
-rw-r--r--source/blender/src/transform_manipulator.c1701
-rw-r--r--source/blender/src/transform_ndofinput.c153
-rw-r--r--source/blender/src/transform_numinput.c258
-rw-r--r--source/blender/src/transform_orientations.c774
-rw-r--r--source/blender/src/transform_snap.c1282
-rw-r--r--source/blender/src/unwrapper.c513
-rw-r--r--source/blender/src/verse_common.c295
-rw-r--r--source/blender/src/verse_image.c342
-rw-r--r--source/blender/src/verse_mesh.c1626
-rw-r--r--source/blender/src/verse_object.c598
-rw-r--r--source/blender/src/view.c2558
-rw-r--r--source/blender/src/vpaint.c1638
-rw-r--r--source/blender/src/winlay.h94
-rw-r--r--source/blender/src/writeavicodec.c832
-rw-r--r--source/blender/src/writeimage.c240
-rw-r--r--source/blender/src/writemovie.c499
-rw-r--r--source/blender/windowmanager/CMakeLists.txt83
-rw-r--r--source/blender/windowmanager/Makefile34
-rw-r--r--source/blender/windowmanager/SConscript16
-rw-r--r--source/blender/windowmanager/WM_api.h140
-rw-r--r--source/blender/windowmanager/WM_types.h189
-rw-r--r--source/blender/windowmanager/intern/Makefile (renamed from source/blender/src/Makefile)130
-rw-r--r--source/blender/windowmanager/intern/wm.c192
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c138
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c (renamed from source/blender/src/cursors.c)209
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c980
-rw-r--r--source/blender/windowmanager/intern/wm_files.c (renamed from source/blender/src/usiblender.c)774
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c202
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c286
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c147
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c363
-rw-r--r--source/blender/windowmanager/intern/wm_report.c134
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c528
-rw-r--r--source/blender/windowmanager/intern/wm_window.c582
-rw-r--r--source/blender/windowmanager/wm.h55
-rw-r--r--source/blender/windowmanager/wm_cursors.h (renamed from source/blender/include/BIF_cursors.h)26
-rw-r--r--source/blender/windowmanager/wm_event_system.h94
-rw-r--r--source/blender/windowmanager/wm_event_types.h (renamed from source/blender/include/mydevice.h)109
-rw-r--r--source/blender/windowmanager/wm_files.h (renamed from source/blender/python/api2_2x/Sys.h)25
-rw-r--r--source/blender/windowmanager/wm_subwindow.h51
-rw-r--r--source/blender/windowmanager/wm_window.h63
-rw-r--r--source/blender/yafray/SConscript2
-rw-r--r--source/creator/CMakeLists.txt20
-rw-r--r--source/creator/Makefile3
-rw-r--r--source/creator/SConscript6
-rw-r--r--source/creator/creator.c136
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp16
-rw-r--r--source/gameengine/BlenderRoutines/CMakeLists.txt2
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp16
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderGL.cpp22
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h21
-rw-r--r--source/gameengine/BlenderRoutines/Makefile4
-rw-r--r--source/gameengine/BlenderRoutines/SConscript5
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp14
-rw-r--r--source/gameengine/Converter/CMakeLists.txt1
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp74
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp9
-rw-r--r--source/gameengine/Converter/Makefile3
-rw-r--r--source/gameengine/Converter/SConscript5
-rw-r--r--source/gameengine/Expressions/SConscript2
-rw-r--r--source/gameengine/GameLogic/SConscript2
-rw-r--r--source/gameengine/GamePlayer/common/unix/Makefile1
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript2
-rw-r--r--source/gameengine/Ketsji/CMakeLists.txt24
-rw-r--r--source/gameengine/Ketsji/KXNetwork/SConscript2
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_BulletPhysicsController.h1
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp75
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp64
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h4
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h4
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp2
-rw-r--r--source/gameengine/Ketsji/Makefile2
-rw-r--r--source/gameengine/Ketsji/SConscript25
-rw-r--r--source/gameengine/Network/LoopBackNetwork/SConscript2
-rw-r--r--source/gameengine/Network/SConscript2
-rw-r--r--source/gameengine/Physics/Bullet/SConscript2
-rw-r--r--source/gameengine/Physics/Dummy/SConscript2
-rw-r--r--source/gameengine/Physics/Sumo/SConscript2
-rw-r--r--source/gameengine/Physics/common/SConscript2
-rw-r--r--source/gameengine/PyDoc/KX_GameObject.py48
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp136
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.h5
-rw-r--r--source/gameengine/Rasterizer/RAS_FramingManager.h5
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp8
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript2
-rw-r--r--source/gameengine/SceneGraph/SConscript2
-rw-r--r--source/gameengine/VideoTexture/CMakeLists.txt1
-rw-r--r--source/gameengine/VideoTexture/Exception.cpp6
-rw-r--r--source/gameengine/VideoTexture/Exception.h6
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp595
-rw-r--r--source/gameengine/VideoTexture/ImageRender.h48
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.cpp66
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.h14
-rw-r--r--source/gameengine/VideoTexture/Makefile2
-rw-r--r--source/gameengine/VideoTexture/SConscript2
-rw-r--r--source/gameengine/VideoTexture/Texture.cpp1
-rw-r--r--source/gameengine/VideoTexture/Texture.h6
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp4
-rw-r--r--source/nan_compile.mk36
-rw-r--r--source/nan_definitions.mk57
-rw-r--r--source/nan_link.mk20
-rw-r--r--tools/Blender.py6
-rwxr-xr-xtools/btools.py35
-rwxr-xr-xtools/crossmingw.py2
968 files changed, 61181 insertions, 428019 deletions
diff --git a/SConstruct b/SConstruct
index 59152cdc9f3..6cd89671bd9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -115,8 +115,8 @@ if toolset:
env.Tool('mstoolkit', ['tools'])
else:
env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
- if env:
- btools.SetupSpawn(env)
+ #if env:
+ # btools.SetupSpawn(env)
else:
env = BlenderEnvironment(ENV = os.environ)
@@ -249,7 +249,7 @@ if len(B.quickdebug) > 0 and printdebug != 0:
# remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
if env['WITH_BF_STATICCXX']:
if 'stdc++' in env['LLIBS']:
- env['LLIBS'] = env['LLIBS'].replace('stdc++', ' ')
+ env['LLIBS'].remove('stdc++')
else:
print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
@@ -284,6 +284,10 @@ if 'blenderlite' in B.targets:
env['BF_NO_ELBEEM'] = True
env['WITH_BF_PYTHON'] = False
+if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming'):
+ env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
+ env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
+
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
#B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
B.root_build_dir = env['BF_BUILDDIR']
@@ -421,8 +425,18 @@ if env['OURPLATFORM']!='darwin':
dn.remove('CVS')
if '.svn' in dn:
dn.remove('.svn')
+
for f in df:
- dotblendlist.append(dp+os.sep+f)
+ if not env['WITH_BF_INTERNATIONAL']:
+ if 'locale' in dp:
+ continue
+ if f == '.Blanguages':
+ continue
+ if not env['WITH_BF_FREETYPE']:
+ if f.endswith('.ttf'):
+ continue
+
+ dotblendlist.append(os.path.join(dp, f))
dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
dotblenderinstall = []
@@ -430,16 +444,17 @@ if env['OURPLATFORM']!='darwin':
td, tf = os.path.split(targetdir)
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
- #-- .blender/scripts
- scriptpath='release/scripts'
- for dp, dn, df in os.walk(scriptpath):
- if 'CVS' in dn:
- dn.remove('CVS')
- if '.svn' in dn:
- dn.remove('.svn')
- dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
- source=[dp+os.sep+f for f in df]
- scriptinstall.append(env.Install(dir=dir,source=source))
+ if env['WITH_BF_PYTHON']:
+ #-- .blender/scripts
+ scriptpath='release/scripts'
+ for dp, dn, df in os.walk(scriptpath):
+ if 'CVS' in dn:
+ dn.remove('CVS')
+ if '.svn' in dn:
+ dn.remove('.svn')
+ dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
+ source=[dp+os.sep+f for f in df]
+ scriptinstall.append(env.Install(dir=dir,source=source))
#-- icons
if env['OURPLATFORM']=='linux2':
@@ -461,6 +476,13 @@ if env['OURPLATFORM']=='linux2':
td, tf = os.path.split(targetdir)
iconinstall.append(env.Install(dir=td, source=srcfile))
+# dlls for linuxcross
+# TODO - add more libs, for now this lets blenderlite run
+if env['OURPLATFORM']=='linuxcross':
+ dir=env['BF_INSTALLDIR']
+ source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
+ scriptinstall.append(env.Install(dir=dir, source=source))
+
#-- plugins
pluglist = []
plugtargetlist = []
diff --git a/config/darwin-config.py b/config/darwin-config.py
index 7c118b78861..3ef7b7132d9 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -216,14 +216,14 @@ CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
#note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
-LLIBS = 'stdc++ SystemStubs'
+LLIBS = ['stdc++', 'SystemStubs']
# some flags shuffling for different Os versions
if MAC_MIN_VERS == '10.3':
CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
- LLIBS = LLIBS + ' crt3.o'
+ LLIBS.append('crt3.o')
if USE_SDK==True:
SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]
@@ -261,6 +261,7 @@ CC_WARN = ['-Wall', '-Wno-long-double']
##DYNLDFLAGS = -shared $(LDFLAGS)
BF_PROFILE_CCFLAGS = ['-pg', '-g ']
+BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False
BF_DEBUG = False
diff --git a/config/irix6-config.py b/config/irix6-config.py
new file mode 100644
index 00000000000..b643affb0b3
--- /dev/null
+++ b/config/irix6-config.py
@@ -0,0 +1,231 @@
+import os
+
+LCGDIR = os.getcwd()+"/../lib/irix-6.5-mips"
+LIBDIR = LCGDIR
+print LCGDIR
+
+WITH_BF_VERSE = 'false'
+BF_VERSE_INCLUDE = "#extern/verse/dist"
+
+BF_PYTHON = LCGDIR+'/python'
+BF_PYTHON_VERSION = '2.5'
+WITH_BF_STATICPYTHON = 'true'
+BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
+BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python2.5/config/libpython${BF_PYTHON_VERSION}.a'
+
+WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'true'
+BF_OPENAL = LCGDIR+'/openal'
+BF_OPENAL_INC = '${BF_OPENAL}/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+BF_OPENAL_LIBPATH = LIBDIR + '/lib'
+
+# some distros have a separate libalut
+# if you get linker complaints, you need to uncomment the line below
+# BF_OPENAL_LIB = 'openal alut'
+# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
+
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
+WITH_BF_SDL = 'true'
+BF_SDL = LCGDIR+'/SDL' #$(shell sdl-config --prefix)
+BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL audio iconv charset' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+BF_SDL_LIBPATH = '${BF_SDL}/lib'
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LIBDIR + '/fmod'
+
+WITH_BF_OPENEXR = 'false'
+WITH_BF_STATICOPENEXR = 'false'
+BF_OPENEXR = '/usr'
+# when compiling with your own openexr lib you might need to set...
+# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
+
+BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
+BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
+# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+
+
+WITH_BF_DDS = 'false'
+
+WITH_BF_JPEG = 'false'
+BF_JPEG = LCGDIR+'/jpeg'
+BF_JPEG_INC = '${BF_JPEG}/include'
+BF_JPEG_LIB = 'jpeg'
+BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
+
+WITH_BF_PNG = 'false'
+BF_PNG = LCGDIR+"/png"
+BF_PNG_INC = '${BF_PNG}/include'
+BF_PNG_LIB = 'png'
+BF_PNG_LIBPATH = '${BF_PNG}/lib'
+
+BF_TIFF = '/usr/nekoware'
+BF_TIFF_INC = '${BF_TIFF}/include'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = LCGDIR+"/zlib"
+BF_ZLIB_INC = '${BF_ZLIB}/include'
+BF_ZLIB_LIB = 'z'
+BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
+
+WITH_BF_INTERNATIONAL = 'true'
+
+BF_GETTEXT = LCGDIR+'/gettext'
+BF_GETTEXT_INC = '${BF_GETTEXT}/include'
+BF_GETTEXT_LIB = 'gettextpo intl'
+BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = '#extern/bFTGL'
+BF_FTGL_INC = '${BF_FTGL}/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+WITH_BF_GAMEENGINE='false'
+
+WITH_BF_ODE = 'false'
+BF_ODE = LIBDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet2/src'
+BF_BULLET_INC = '${BF_BULLET}'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = '${BF_SOLID}'
+BF_SOLID_LIB = 'extern_solid'
+
+WITH_BF_YAFRAY = 'true'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LIBDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB =
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LIBDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+BF_FREETYPE = LCGDIR+'/freetype'
+BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
+
+WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
+
+WITH_BF_ICONV = 'true'
+BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV_INC = '${BF_ICONV}/include'
+BF_ICONV_LIB = 'iconv charset'
+BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
+
+WITH_BF_BINRELOC = 'false'
+
+# enable ffmpeg support
+WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG
+# Uncomment the following two lines to use system's ffmpeg
+BF_FFMPEG = LCGDIR+'/ffmpeg'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil faad faac vorbis x264 ogg mp3lame z'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
+
+# enable ogg, vorbis and theora in ffmpeg
+WITH_BF_OGG = 'false' # -DWITH_OGG
+BF_OGG = '/usr'
+BF_OGG_INC = '${BF_OGG}/include'
+BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
+
+WITH_BF_OPENJPEG = 'false'
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}/include'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
+WITH_BF_REDCODE = 'false'
+BF_REDCODE = '#extern/libredcode'
+BF_REDCODE_LIB = ''
+BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_STATICOPENGL = 'false'
+BF_OPENGL = '/usr'
+BF_OPENGL_INC = '${BF_OPENGL}/include'
+BF_OPENGL_LIB = 'GL GLU X11 Xi Xext'
+BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
+BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
+
+
+CC = 'c99'
+CXX = 'CC'
+
+
+CCFLAGS = ['-pipe','-fPIC', '-n32']
+
+CPPFLAGS = ['-DXP_UNIX']
+CXXFLAGS = ['-pipe','-fPIC', '-n32']
+REL_CFLAGS = ['-O2']
+REL_CCFLAGS = ['-O2']
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = '-no_prelink -ptused'
+
+CC_WARN = '-no_prelink -ptused'
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = 'c m dl pthread dmedia movie'
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE_FLAGS = ['-pg','-g']
+BF_PROFILE = 'false'
+
+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS = '-g'
+
+BF_BUILDDIR = '../build/irix6'
+BF_INSTALLDIR='../install/irix6'
+BF_DOCDIR='../install/doc'
+
+#Link against pthread
+LDIRS = []
+LDIRS.append(BF_FREETYPE_LIBPATH)
+LDIRS.append(BF_PNG_LIBPATH)
+LDIRS.append(BF_ZLIB_LIBPATH)
+LDIRS.append(BF_SDL_LIBPATH)
+LDIRS.append(BF_OPENAL_LIBPATH)
+LDIRS.append(BF_ICONV_LIBPATH)
+
+PLATFORM_LINKFLAGS = []
+for x in LDIRS:
+ PLATFORM_LINKFLAGS.append("-L"+x)
+
+PLATFORM_LINKFLAGS += ['-L${LCGDIR}/jpeg/lib' , '-L/usr/lib32', '-n32', '-v', '-no_prelink']
+print PLATFORM_LINKFLAGS
+LINKFLAGS= PLATFORM_LINKFLAGS
diff --git a/config/linux2-config.py b/config/linux2-config.py
index 19b62dd2395..2984c06d2df 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -193,12 +193,13 @@ CC_WARN = ['-Wall']
##FIX_STUBS_WARNINGS = -Wno-unused
-LLIBS = 'util c m dl pthread stdc++'
+LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
##LOPTS = --dynamic
##DYNLDFLAGS = -shared $(LDFLAGS)
BF_PROFILE = False
BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g']
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
index 4c5f4859a6c..5981c8b96e5 100644
--- a/config/linuxcross-config.py
+++ b/config/linuxcross-config.py
@@ -1,4 +1,4 @@
-LCGDIR = '../lib/windows'
+LCGDIR = '#../lib/windows'
LIBDIR = '${LCGDIR}'
WITH_BF_VERSE = False
@@ -101,6 +101,9 @@ BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
+BF_WINTAB = LIBDIR + '/wintab'
+BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
+
# enable freetype2 support for text objects
BF_FREETYPE = LIBDIR + '/gcc/freetype'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
@@ -146,6 +149,10 @@ LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lw
BF_DEBUG = False
BF_DEBUG_CCFLAGS= []
+BF_PROFILE = False
+BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
+
BF_BUILDDIR = '../build/linuxcross'
BF_INSTALLDIR='../install/linuxcross'
BF_DOCDIR='../install/doc'
diff --git a/config/openbsd3-config.py b/config/openbsd3-config.py
index cd46d11867e..8fc334874f9 100644
--- a/config/openbsd3-config.py
+++ b/config/openbsd3-config.py
@@ -151,12 +151,13 @@ CC_WARN = ['-Wall']
##FIX_STUBS_WARNINGS = -Wno-unused
-LLIBS = 'm stdc++ pthread util'
+LLIBS = ['m', 'stdc++', 'pthread', 'util']
##LOPTS = --dynamic
##DYNLDFLAGS = -shared $(LDFLAGS)
-BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE = False
+BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g']
diff --git a/config/sunos5-config.py b/config/sunos5-config.py
index 4e7e99bc884..a44a9df7c75 100644
--- a/config/sunos5-config.py
+++ b/config/sunos5-config.py
@@ -165,11 +165,12 @@ CC_WARN = ['-Wall']
##FIX_STUBS_WARNINGS = -Wno-unused
-LLIBS = 'c m dl pthread stdc++'
+LLIBS = ['c', 'm', 'dl', 'pthread', 'stdc++']
##LOPTS = --dynamic
##DYNLDFLAGS = -shared $(LDFLAGS)
-BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_CCFLAGS = ['-pg', '-g ']
+BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False
BF_DEBUG = False
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index 22666851f28..e9e9aac1589 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -164,9 +164,11 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g']
-BF_PROFILE_CCFLAGS = ['-pg','-g']
+BF_PROFILE_CCFLAGS = ['-pg', '-g ']
+BF_PROFILE_LINKFLAGS = ['-pg']
+BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
BF_PROFILE = False
BF_BUILDDIR = '..\\build\\win32-mingw'
BF_INSTALLDIR='..\\install\\win32-mingw'
-BF_DOCDIR = '..\\install\\doc' \ No newline at end of file
+BF_DOCDIR = '..\\install\\doc'
diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py
index fe51abe0a89..8ba8c8f04e6 100644
--- a/config/win32-vc-config.py
+++ b/config/win32-vc-config.py
@@ -181,21 +181,14 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
-LLIBS = 'ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid'
-
-PLATFORM_LINKFLAGS = '''
- /SUBSYSTEM:CONSOLE
- /MACHINE:IX86
- /ENTRY:mainCRTStartup
- /INCREMENTAL:NO
- /NODEFAULTLIB:"msvcprt.lib"
- /NODEFAULTLIB:"glut32.lib"
- /NODEFAULTLIB:"libc.lib"
- /NODEFAULTLIB:"libcd.lib"
- /NODEFAULTLIB:"libcpd.lib"
- /NODEFAULTLIB:"libcp.lib"
- /LARGEADDRESSAWARE
- '''
+LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
+
+PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/ENTRY:mainCRTStartup','/INCREMENTAL:NO','/NODEFAULTLIB:"msvcprt.lib"','/NODEFAULTLIB:"glut32.lib"','/NODEFAULTLIB:"libc.lib"','/NODEFAULTLIB:"libcd.lib"','/NODEFAULTLIB:"libcpd.lib"','/NODEFAULTLIB:"libcp.lib"','/LARGEADDRESSAWARE']
+
+# # Todo
+# BF_PROFILE_CCFLAGS = ['-pg', '-g ']
+# BF_PROFILE_LINKFLAGS = ['-pg']
+# BF_PROFILE = False
BF_BUILDDIR = '..\\build\\win32-vc'
BF_INSTALLDIR='..\\install\\win32-vc'
diff --git a/extern/Makefile b/extern/Makefile
index 26ee25b608f..51213698ebb 100644
--- a/extern/Makefile
+++ b/extern/Makefile
@@ -57,10 +57,7 @@ ifeq ($(WITH_BINRELOC), true)
DIRS += binreloc
endif
-TARGET =
-ifneq ($(OS),irix)
- TARGET=solid
-endif
+TARGET = solid
all::
@[ -d $(OCGDIR)/extern ] || mkdir -p $(OCGDIR)/extern
diff --git a/intern/SoundSystem/Makefile b/intern/SoundSystem/Makefile
index d00339f351c..051e2643a87 100644
--- a/intern/SoundSystem/Makefile
+++ b/intern/SoundSystem/Makefile
@@ -47,6 +47,9 @@ ifneq ($(NAN_NO_OPENAL),true)
ifeq ($(OS),$(findstring $(OS), "linux freebsd solaris"))
DIRS += openal sdl
endif
+ ifeq ($(OS), irix)
+ DIRS += sdl
+ endif
else
export CPPFLAGS += -DNO_SOUND
endif
diff --git a/intern/SoundSystem/SConscript b/intern/SoundSystem/SConscript
index be19c4b7915..2be20a24042 100644
--- a/intern/SoundSystem/SConscript
+++ b/intern/SoundSystem/SConscript
@@ -17,4 +17,4 @@ else:
if not env['WITH_BF_SDL']:
defs += ' DISABLE_SDL'
-env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [20,140] )
+env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [25,135] )
diff --git a/intern/boolop/SConscript b/intern/boolop/SConscript
index bec263f251f..a3f3c0b6433 100644
--- a/intern/boolop/SConscript
+++ b/intern/boolop/SConscript
@@ -8,7 +8,7 @@ incs += ' ../../source/blender/makesdna ../../intern/guardedalloc'
incs += ' ../../source/blender/blenlib'
if (env['OURPLATFORM'] == 'win32-mingw'):
- env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [30,85] )
+ env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype=['common','intern'], priority = [5,50] )
else:
env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype='common', priority = 5 )
diff --git a/intern/boolop/intern/BOP_Merge2.cpp b/intern/boolop/intern/BOP_Merge2.cpp
index bbf3f8ba702..f75fddc554e 100644
--- a/intern/boolop/intern/BOP_Merge2.cpp
+++ b/intern/boolop/intern/BOP_Merge2.cpp
@@ -294,8 +294,8 @@ void BOP_Merge2::cleanup( void )
BOP_Vertexs v = m_mesh->getVertexs();
for( BOP_IT_Vertexs it = v.begin(); it != v.end(); ++it ) {
if( (*it)->getTAG() != BROKEN) {
- BOP_Indexs edges = (*it)->getEdges();
- for(BOP_IT_Indexs i = edges.begin();i!=edges.end();i++)
+ BOP_Indexs iedges = (*it)->getEdges();
+ for(BOP_IT_Indexs i = iedges.begin();i!=iedges.end();i++)
if( m_mesh->getEdge((*i))->getUsed( ) == false) (*it)->removeEdge( *i );
if( (*it)->getEdges().size() == 0 ) (*it)->setTAG(BROKEN);
}
@@ -432,8 +432,8 @@ bool BOP_Merge2::mergeFaces(BOP_Indexs &mergeVertices)
vert->setTAG(BROKEN);
for(BOP_IT_Indexs it = edges.begin(); it != edges.end();
++it ) {
- BOP_Edge *edge = m_mesh->getEdge(*it);
- edge->setUsed(false);
+ BOP_Edge *tedge = m_mesh->getEdge(*it);
+ tedge->setUsed(false);
}
didMerge = true;
}
diff --git a/intern/bsp/SConscript b/intern/bsp/SConscript
index 39f278625a9..0d1b74ea2ca 100644
--- a/intern/bsp/SConscript
+++ b/intern/bsp/SConscript
@@ -6,7 +6,7 @@ sources = env.Glob('intern/*.cpp')
incs = 'intern ../container ../moto/include ../memutil'
if (env['OURPLATFORM'] == 'win32-mingw'):
- env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,69] )
+ env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype=['common','intern'], priority=[26,26] )
else:
- env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype='core', priority=26 )
+ env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype='core', priority=20 )
diff --git a/intern/decimation/SConscript b/intern/decimation/SConscript
index cf199fb3bc5..2dd2ac38498 100644
--- a/intern/decimation/SConscript
+++ b/intern/decimation/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp')
incs = '. ../moto/include ../container ../memutil'
-env.BlenderLib ('bf_decimation', sources, Split(incs) , [], libtype=['core','common','player'], priority = [10, 20, 25] )
+env.BlenderLib ('bf_decimation', sources, Split(incs) , [], libtype=['core','common','player'], priority = [10, 20, 20] )
diff --git a/intern/elbeem/intern/utilities.h b/intern/elbeem/intern/utilities.h
index 825e92251fe..a5f63e696a6 100644
--- a/intern/elbeem/intern/utilities.h
+++ b/intern/elbeem/intern/utilities.h
@@ -154,12 +154,18 @@ int writePng(const char *fileName, unsigned char **rowsp, int w, int h);
*/
/* minimum */
+#ifdef MIN
+#undef MIN
+#endif
template < class T >
inline T
MIN( T a, T b )
{ return (a < b) ? a : b ; }
/* maximum */
+#ifdef MAX
+#undef MAX
+#endif
template < class T >
inline T
MAX( T a, T b )
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 6b1295f649b..b683740247a 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -150,6 +150,9 @@ typedef enum {
GHOST_kEventWindowDeactivate,
GHOST_kEventWindowUpdate,
GHOST_kEventWindowSize,
+ GHOST_kEventWindowMove,
+
+ GHOST_kEventTimer,
GHOST_kNumEventTypes
} GHOST_TEventType;
diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript
index f6283cfc0f2..ad6b4ff51ba 100644
--- a/intern/ghost/SConscript
+++ b/intern/ghost/SConscript
@@ -29,4 +29,4 @@ else:
incs = '. ../string ' + env['BF_OPENGL_INC']
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross'):
incs = env['BF_WINTAB_INC'] + ' ' + incs
-env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['core','player'], priority = [25,15] )
+env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['core','intern','player'], priority = [40,44,5] )
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index b7643784250..ad5189af0e9 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -48,11 +48,6 @@
#include "GHOST_IEventConsumer.h"
#include "intern/GHOST_CallbackEventConsumer.h"
-#ifdef WIN32
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-#endif //WIN32
-
-
GHOST_SystemHandle GHOST_CreateSystem(void)
{
GHOST_ISystem::createSystem();
diff --git a/intern/ghost/intern/GHOST_DisplayManager.h b/intern/ghost/intern/GHOST_DisplayManager.h
index a707b5aeddd..50c59a6d348 100644
--- a/intern/ghost/intern/GHOST_DisplayManager.h
+++ b/intern/ghost/intern/GHOST_DisplayManager.h
@@ -35,10 +35,6 @@
#include "GHOST_Types.h"
-#ifdef WIN32
-#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
-#endif // WIN32
-
#include <vector>
/**
diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
index a8565578967..1a61428bccc 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
@@ -126,7 +126,7 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::setCurrentDisplaySetting(GHOST_TUns8 d
GHOST_ASSERT((display==kMainDisplay), "GHOST_DisplayManagerWin32::setCurrentDisplaySetting(): only main display is supported");
GHOST_DisplaySetting match;
- GHOST_TSuccess success = findMatch(display, setting, match);
+ findMatch(display, setting, match);
DEVMODE dm;
int i = 0;
while (::EnumDisplaySettings(NULL, i++, &dm)) {
diff --git a/intern/ghost/intern/GHOST_EventManager.h b/intern/ghost/intern/GHOST_EventManager.h
index 33e5c2f20ba..c3ec9583c04 100644
--- a/intern/ghost/intern/GHOST_EventManager.h
+++ b/intern/ghost/intern/GHOST_EventManager.h
@@ -33,10 +33,6 @@
#ifndef _GHOST_EVENT_MANAGER_H_
#define _GHOST_EVENT_MANAGER_H_
-#ifdef WIN32
-#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
-#endif // WIN32
-
#include <deque>
#include <vector>
diff --git a/intern/ghost/intern/GHOST_EventPrinter.cpp b/intern/ghost/intern/GHOST_EventPrinter.cpp
index ae9c0d81a01..b4f5cc96083 100644
--- a/intern/ghost/intern/GHOST_EventPrinter.cpp
+++ b/intern/ghost/intern/GHOST_EventPrinter.cpp
@@ -48,36 +48,36 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
if (event->getType() == GHOST_kEventWindowUpdate) return false;
- //std::cout << "GHOST_EventPrinter::processEvent, time: " << (GHOST_TInt32)event->getTime() << ", type: ";
+ std::cout << "GHOST_EventPrinter::processEvent, time: " << (GHOST_TInt32)event->getTime() << ", type: ";
switch (event->getType()) {
case GHOST_kEventUnknown:
- //std::cout << "GHOST_kEventUnknown"; handled = false;
+ std::cout << "GHOST_kEventUnknown"; handled = false;
break;
case GHOST_kEventButtonUp:
{
GHOST_TEventButtonData* buttonData = (GHOST_TEventButtonData*)((GHOST_IEvent*)event)->getData();
- //std::cout << "GHOST_kEventCursorButtonUp, button: " << buttonData->button;
+ std::cout << "GHOST_kEventCursorButtonUp, button: " << buttonData->button;
}
break;
case GHOST_kEventButtonDown:
{
GHOST_TEventButtonData* buttonData = (GHOST_TEventButtonData*)((GHOST_IEvent*)event)->getData();
- //std::cout << "GHOST_kEventButtonDown, button: " << buttonData->button;
+ std::cout << "GHOST_kEventButtonDown, button: " << buttonData->button;
}
break;
case GHOST_kEventWheel:
{
GHOST_TEventWheelData* wheelData = (GHOST_TEventWheelData*)((GHOST_IEvent*)event)->getData();
- //std::cout << "GHOST_kEventWheel, z: " << wheelData->z;
+ std::cout << "GHOST_kEventWheel, z: " << wheelData->z;
}
break;
case GHOST_kEventCursorMove:
{
GHOST_TEventCursorData* cursorData = (GHOST_TEventCursorData*)((GHOST_IEvent*)event)->getData();
- //std::cout << "GHOST_kEventCursorMove, (x,y): (" << cursorData->x << "," << cursorData->y << ")";
+ std::cout << "GHOST_kEventCursorMove, (x,y): (" << cursorData->x << "," << cursorData->y << ")";
}
break;
@@ -86,7 +86,7 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
GHOST_TEventKeyData* keyData = (GHOST_TEventKeyData*)((GHOST_IEvent*)event)->getData();
STR_String str;
getKeyString(keyData->key, str);
- //std::cout << "GHOST_kEventKeyUp, key: " << str.Ptr();
+ std::cout << "GHOST_kEventKeyUp, key: " << str.Ptr();
}
break;
case GHOST_kEventKeyDown:
@@ -94,34 +94,34 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
GHOST_TEventKeyData* keyData = (GHOST_TEventKeyData*)((GHOST_IEvent*)event)->getData();
STR_String str;
getKeyString(keyData->key, str);
- //std::cout << "GHOST_kEventKeyDown, key: " << str.Ptr();
+ std::cout << "GHOST_kEventKeyDown, key: " << str.Ptr();
}
break;
case GHOST_kEventQuit:
- //std::cout << "GHOST_kEventQuit";
+ std::cout << "GHOST_kEventQuit";
break;
case GHOST_kEventWindowClose:
- //std::cout << "GHOST_kEventWindowClose";
+ std::cout << "GHOST_kEventWindowClose";
break;
case GHOST_kEventWindowActivate:
- //std::cout << "GHOST_kEventWindowActivate";
+ std::cout << "GHOST_kEventWindowActivate";
break;
case GHOST_kEventWindowDeactivate:
- //std::cout << "GHOST_kEventWindowDeactivate";
+ std::cout << "GHOST_kEventWindowDeactivate";
break;
case GHOST_kEventWindowUpdate:
- //std::cout << "GHOST_kEventWindowUpdate";
+ std::cout << "GHOST_kEventWindowUpdate";
break;
case GHOST_kEventWindowSize:
- //std::cout << "GHOST_kEventWindowSize";
+ std::cout << "GHOST_kEventWindowSize";
break;
default:
- //std::cout << "not found"; handled = false;
+ std::cout << "not found"; handled = false;
break;
}
- //std::cout << "\n";
+ std::cout << "\n";
return handled;
}
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index 067c8deee32..5de00d9ab3e 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -442,17 +442,15 @@ bool GHOST_SystemCarbon::processEvents(bool waitForEvent)
GHOST_TimerManager* timerMgr = getTimerManager();
if (waitForEvent) {
- GHOST_TUns64 curtime = getMilliSeconds();
GHOST_TUns64 next = timerMgr->nextFireTime();
double timeOut;
if (next == GHOST_kFireTimeNever) {
timeOut = kEventDurationForever;
} else {
- if (next<=curtime)
+ timeOut = (double)(next - getMilliSeconds())/1000.0;
+ if (timeOut < 0.0)
timeOut = 0.0;
- else
- timeOut = (double) (next - getMilliSeconds())/1000.0;
}
::ReceiveNextEvent(0, NULL, timeOut, false, &event);
@@ -959,10 +957,16 @@ bool GHOST_SystemCarbon::handleMouseDown(EventRef event)
* events. By setting m_ignoreWindowSizedMessages these are suppressed.
* @see GHOST_SystemCarbon::handleWindowEvent(EventRef event)
*/
+ /* even worse: scale window also generates a load of events, and nothing
+ is handled (read: client's event proc called) until you release mouse (ton) */
+
GHOST_ASSERT(validWindow(ghostWindow), "GHOST_SystemCarbon::handleMouseDown: invalid window");
m_ignoreWindowSizedMessages = true;
::DragWindow(window, mousePos, &GetQDGlobalsScreenBits(&screenBits)->bounds);
m_ignoreWindowSizedMessages = false;
+
+ pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowMove, ghostWindow) );
+
break;
case inContent:
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index feb0fe39040..6b5fcfe7705 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -38,8 +38,6 @@
#include <config.h>
#endif
-#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
-
#include "GHOST_SystemWin32.h"
// win64 doesn't define GWL_USERDATA
@@ -202,11 +200,12 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
::Sleep(1);
#else
GHOST_TUns64 next = timerMgr->nextFireTime();
+ GHOST_TInt64 maxSleep = next - getMilliSeconds();
if (next == GHOST_kFireTimeNever) {
::WaitMessage();
- } else {
- ::SetTimer(NULL, 0, next - getMilliSeconds(), NULL);
+ } else if(maxSleep >= 0.0) {
+ ::SetTimer(NULL, 0, maxSleep, NULL);
::WaitMessage();
::KillTimer(NULL, 0);
}
@@ -232,7 +231,7 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
{
POINT point;
- bool success = ::GetCursorPos(&point) == TRUE;
+ ::GetCursorPos(&point);
x = point.x;
y = point.y;
return GHOST_kSuccess;
@@ -766,10 +765,23 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
* message without calling DefWindowProc.
*/
event = processWindowEvent(GHOST_kEventWindowSize, window);
+ break;
case WM_CAPTURECHANGED:
window->lostMouseCapture();
break;
-
+ case WM_MOVING:
+ /* The WM_MOVING message is sent to a window that the user is moving. By processing
+ * this message, an application can monitor the size and position of the drag rectangle
+ * and, if needed, change its size or position.
+ */
+ case WM_MOVE:
+ /* The WM_SIZE and WM_MOVE messages are not sent if an application handles the
+ * WM_WINDOWPOSCHANGED message without calling DefWindowProc. It is more efficient
+ * to perform any move or size change processing during the WM_WINDOWPOSCHANGED
+ * message without calling DefWindowProc.
+ */
+ event = processWindowEvent(GHOST_kEventWindowMove, window);
+ break;
////////////////////////////////////////////////////////////////////////
// Window events, ignored
////////////////////////////////////////////////////////////////////////
@@ -782,12 +794,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
* to perform any move or size change processing during the WM_WINDOWPOSCHANGED
* message without calling DefWindowProc.
*/
- case WM_MOVE:
- /* The WM_SIZE and WM_MOVE messages are not sent if an application handles the
- * WM_WINDOWPOSCHANGED message without calling DefWindowProc. It is more efficient
- * to perform any move or size change processing during the WM_WINDOWPOSCHANGED
- * message without calling DefWindowProc.
- */
case WM_ERASEBKGND:
/* An application sends the WM_ERASEBKGND message when the window background must be
* erased (for example, when a window is resized). The message is sent to prepare an
@@ -822,11 +828,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
*/
case WM_SETFOCUS:
/* The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. */
- case WM_MOVING:
- /* The WM_MOVING message is sent to a window that the user is moving. By processing
- * this message, an application can monitor the size and position of the drag rectangle
- * and, if needed, change its size or position.
- */
case WM_ENTERSIZEMOVE:
/* The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving
* or sizing modal loop. The window enters the moving or sizing modal loop when the user
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 8073756e453..5a145510e54 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -107,6 +107,17 @@ GHOST_SystemX11(
m_wm_protocols= XInternAtom(m_display, "WM_PROTOCOLS", False);
m_wm_take_focus= XInternAtom(m_display, "WM_TAKE_FOCUS", False);
+ m_wm_state= XInternAtom(m_display, "WM_STATE", False);
+ m_wm_change_state= XInternAtom(m_display, "WM_CHANGE_STATE", False);
+ m_net_state= XInternAtom(m_display, "_NET_WM_STATE", False);
+ m_net_max_horz= XInternAtom(m_display,
+ "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+ m_net_max_vert= XInternAtom(m_display,
+ "_NET_WM_STATE_MAXIMIZED_VERT", False);
+ m_net_fullscreen= XInternAtom(m_display,
+ "_NET_WM_STATE_FULLSCREEN", False);
+ m_motif= XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
+
// compute the initial time
timeval tv;
@@ -308,7 +319,10 @@ processEvents(
if (next==GHOST_kFireTimeNever) {
SleepTillEvent(m_display, -1);
} else {
- SleepTillEvent(m_display, next - getMilliSeconds());
+ GHOST_TInt64 maxSleep = next - getMilliSeconds();
+
+ if(maxSleep >= 0)
+ SleepTillEvent(m_display, next - getMilliSeconds());
}
}
@@ -537,6 +551,24 @@ GHOST_SystemX11::processEvent(XEvent *xe)
// XCrossingEvents pointer leave enter window.
break;
case MapNotify:
+ /*
+ * From ICCCM:
+ * [ Clients can select for StructureNotify on their
+ * top-level windows to track transition between
+ * Normal and Iconic states. Receipt of a MapNotify
+ * event will indicate a transition to the Normal
+ * state, and receipt of an UnmapNotify event will
+ * indicate a transition to the Iconic state. ]
+ */
+ if (window->m_post_init == True) {
+ /*
+ * Now we are sure that the window is
+ * mapped, so only need change the state.
+ */
+ window->setState (window->m_post_state);
+ window->m_post_init = False;
+ }
+ break;
case UnmapNotify:
break;
case MappingNotify:
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 576577917ba..4b0ddd7a4f9 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -215,7 +215,19 @@ public:
*/
virtual void putClipboard(GHOST_TInt8 *buffer, int flag) const;
- /* Atom used for ICCCM. */
+ /**
+ * Atom used for ICCCM, WM-spec and Motif.
+ * We only need get this atom at the start, it's relative
+ * to the display not the window and are public for every
+ * window that need it.
+ */
+ Atom m_wm_state;
+ Atom m_wm_change_state;
+ Atom m_net_state;
+ Atom m_net_max_horz;
+ Atom m_net_max_vert;
+ Atom m_net_fullscreen;
+ Atom m_motif;
Atom m_wm_take_focus;
Atom m_wm_protocols;
Atom m_delete_window_atom;
diff --git a/intern/ghost/intern/GHOST_TimerManager.h b/intern/ghost/intern/GHOST_TimerManager.h
index 27bbdb1ea1d..b37b5b79c14 100644
--- a/intern/ghost/intern/GHOST_TimerManager.h
+++ b/intern/ghost/intern/GHOST_TimerManager.h
@@ -33,10 +33,6 @@
#ifndef _GHOST_TIMER_MANAGER_H_
#define _GHOST_TIMER_MANAGER_H_
-#ifdef WIN32
-#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
-#endif // WIN32
-
#include <vector>
#include "GHOST_Types.h"
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp
index 9ae9e283b69..b3df566e8aa 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.cpp
+++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp
@@ -252,7 +252,9 @@ void GHOST_WindowCarbon::getClientBounds(GHOST_Rect& bounds) const
{
Rect rect;
GHOST_ASSERT(getValid(), "GHOST_WindowCarbon::getClientBounds(): window invalid")
- ::GetPortBounds(m_grafPtr, &rect);
+ //::GetPortBounds(m_grafPtr, &rect);
+ ::GetWindowBounds(m_windowRef, kWindowContentRgn, &rect);
+
bounds.m_b = rect.bottom;
bounds.m_l = rect.left;
bounds.m_r = rect.right;
diff --git a/intern/ghost/intern/GHOST_WindowManager.h b/intern/ghost/intern/GHOST_WindowManager.h
index 46d8036328e..46e80d2c603 100644
--- a/intern/ghost/intern/GHOST_WindowManager.h
+++ b/intern/ghost/intern/GHOST_WindowManager.h
@@ -33,10 +33,6 @@
#ifndef _GHOST_WINDOW_MANAGER_H_
#define _GHOST_WINDOW_MANAGER_H_
-#ifdef WIN32
-#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
-#endif // WIN32
-
#include <vector>
#include "GHOST_Rect.h"
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 2094ae87c67..ce1a42176bd 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -111,9 +111,9 @@ GHOST_WindowWin32::GHOST_WindowWin32(
m_hasMouseCaptured(false),
m_nPressedButtons(0),
m_customCursor(0),
+ m_wintab(NULL),
m_tabletData(NULL),
m_tablet(0),
- m_wintab(NULL),
m_maxPressure(0)
{
if (state != GHOST_kWindowStateFullScreen) {
@@ -150,7 +150,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
}
if (m_hWnd) {
// Store a pointer to this class in the window structure
- LONG result = ::SetWindowLong(m_hWnd, GWL_USERDATA, (LONG)this);
+ ::SetWindowLongPtr(m_hWnd, GWL_USERDATA, (LONG_PTR)this);
// Store the device context
m_hDC = ::GetDC(m_hWnd);
@@ -297,11 +297,20 @@ void GHOST_WindowWin32::getWindowBounds(GHOST_Rect& bounds) const
void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const
{
RECT rect;
- ::GetClientRect(m_hWnd, &rect);
- bounds.m_b = rect.bottom;
- bounds.m_l = rect.left;
- bounds.m_r = rect.right;
- bounds.m_t = rect.top;
+ ::GetWindowRect(m_hWnd, &rect);
+
+ LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
+ if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) {
+ bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYSIZEFRAME)*2;
+ bounds.m_l = rect.left;
+ bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2;
+ bounds.m_t = rect.top;
+ } else {
+ bounds.m_b = rect.bottom;
+ bounds.m_l = rect.left;
+ bounds.m_r = rect.right;
+ bounds.m_t = rect.top;
+ }
}
@@ -310,7 +319,7 @@ GHOST_TSuccess GHOST_WindowWin32::setClientWidth(GHOST_TUns32 width)
GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
- if (cBnds.getWidth() != width) {
+ if (cBnds.getWidth() != (GHOST_TInt32)width) {
getWindowBounds(wBnds);
int cx = wBnds.getWidth() + width - cBnds.getWidth();
int cy = wBnds.getHeight();
@@ -329,7 +338,7 @@ GHOST_TSuccess GHOST_WindowWin32::setClientHeight(GHOST_TUns32 height)
GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
- if (cBnds.getHeight() != height) {
+ if (cBnds.getHeight() != (GHOST_TInt32)height) {
getWindowBounds(wBnds);
int cx = wBnds.getWidth();
int cy = wBnds.getHeight() + height - cBnds.getHeight();
@@ -348,7 +357,7 @@ GHOST_TSuccess GHOST_WindowWin32::setClientSize(GHOST_TUns32 width, GHOST_TUns32
GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds);
- if ((cBnds.getWidth() != width) || (cBnds.getHeight() != height)) {
+ if ((cBnds.getWidth() != (GHOST_TInt32)width) || (cBnds.getHeight() != (GHOST_TInt32)height)) {
getWindowBounds(wBnds);
int cx = wBnds.getWidth() + width - cBnds.getWidth();
int cy = wBnds.getHeight() + height - cBnds.getHeight();
@@ -369,7 +378,11 @@ GHOST_TWindowState GHOST_WindowWin32::getState() const
state = GHOST_kWindowStateMinimized;
}
else if (::IsZoomed(m_hWnd)) {
- state = GHOST_kWindowStateMaximized;
+ LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
+ if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE))
+ state = GHOST_kWindowStateMaximized;
+ else
+ state = GHOST_kWindowStateFullScreen;
}
else {
state = GHOST_kWindowStateNormal;
@@ -406,19 +419,21 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
wp.showCmd = SW_SHOWMINIMIZED;
break;
case GHOST_kWindowStateMaximized:
- ShowWindow(m_hWnd, SW_HIDE); //fe. HACK!
- //Solves redraw problems when switching from fullscreen to normal.
-
+ ShowWindow(m_hWnd, SW_HIDE);
wp.showCmd = SW_SHOWMAXIMIZED;
- SetWindowLong(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
+ SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
case GHOST_kWindowStateFullScreen:
wp.showCmd = SW_SHOWMAXIMIZED;
- SetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP | WS_MAXIMIZE);
+ wp.ptMaxPosition.x = 0;
+ wp.ptMaxPosition.y = 0;
+ SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_POPUP | WS_MAXIMIZE);
break;
case GHOST_kWindowStateNormal:
default:
+ ShowWindow(m_hWnd, SW_HIDE);
wp.showCmd = SW_SHOWNORMAL;
+ SetWindowLongPtr(m_hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
break;
}
return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
@@ -614,7 +629,7 @@ void GHOST_WindowWin32::loadCursor(bool visible, GHOST_TStandardCursor cursor) c
}
if (success) {
- HCURSOR hCursor = ::SetCursor(::LoadCursor(0, id));
+ ::SetCursor(::LoadCursor(0, id));
}
}
}
@@ -724,15 +739,15 @@ void GHOST_WindowWin32::processWin32TabletEvent(WPARAM wParam, LPARAM lParam)
*/
/* convert raw fixed point data to radians */
- altRad = (fabs((float)ort.orAltitude)/(float)m_maxAltitude) * M_PI/2.0;
- azmRad = ((float)ort.orAzimuth/(float)m_maxAzimuth) * M_PI*2.0;
+ altRad = (float)((fabs((float)ort.orAltitude)/(float)m_maxAltitude) * M_PI/2.0);
+ azmRad = (float)(((float)ort.orAzimuth/(float)m_maxAzimuth) * M_PI*2.0);
/* find length of the stylus' projected vector on the XY plane */
vecLen = cos(altRad);
/* from there calculate X and Y components based on azimuth */
m_tabletData->Xtilt = sin(azmRad) * vecLen;
- m_tabletData->Ytilt = sin(M_PI/2.0 - azmRad) * vecLen;
+ m_tabletData->Ytilt = (float)(sin(M_PI/2.0 - azmRad) * vecLen);
} else {
m_tabletData->Xtilt = 0.0f;
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 73d61a30977..3785b325eaf 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -55,6 +55,16 @@ typedef struct {
#define MWM_HINTS_DECORATIONS (1L << 1)
/*
+ * A Client can't change the window property, that is
+ * the work of the window manager. In case, we send
+ * a ClientMessage to the RootWindow with the property
+ * and the Action (WM-spec define this):
+ */
+#define _NET_WM_STATE_REMOVE 0
+#define _NET_WM_STATE_ADD 1
+#define _NET_WM_STATE_TOGGLE 2
+
+/*
import bpy
I = bpy.data.images['blender.png'] # the 48x48 icon
@@ -258,49 +268,25 @@ GHOST_WindowX11(
}
-
- // Are we in fullscreen mode - then include
- // some obscure blut code to remove decorations.
-
- if (state == GHOST_kWindowStateFullScreen) {
-
- MotifWmHints hints;
- Atom atom;
-
- atom = XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
-
- if (atom == None) {
- GHOST_PRINT("Could not intern X atom for _MOTIF_WM_HINTS.\n");
- } else {
- hints.flags = MWM_HINTS_DECORATIONS;
- hints.decorations = 0; /* Absolutely no decorations. */
- // other hints.decorations make no sense
- // you can't select individual decorations
-
- XChangeProperty(m_display, m_window,
- atom, atom, 32,
- PropModeReplace, (unsigned char *) &hints, 4);
- }
- } else if (state == GHOST_kWindowStateMaximized) {
- // With this, xprop should report the following just after launch
- // _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
- // After demaximization the right side is empty, though (maybe not the most correct then?)
- Atom state, atomh, atomv;
-
- state = XInternAtom(m_display, "_NET_WM_STATE", False);
- atomh = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
- atomv = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
- if (state == None ) {
- GHOST_PRINT("Atom _NET_WM_STATE requested but not avaliable nor created.\n");
- } else {
- XChangeProperty(m_display, m_window,
- state, XA_ATOM, 32,
- PropModeAppend, (unsigned char *) &atomh, 1);
- XChangeProperty(m_display, m_window,
- state, XA_ATOM, 32,
- PropModeAppend, (unsigned char *) &atomv, 1);
- }
- }
+ /*
+ * One of the problem with WM-spec is that can't set a property
+ * to a window that isn't mapped. That is why we can't "just
+ * call setState" here.
+ *
+ * To fix this, we first need know that the window is really
+ * map waiting for the MapNotify event.
+ *
+ * So, m_post_init indicate that we need wait for the MapNotify
+ * event and then set the Window state to the m_post_state.
+ */
+ if ((state != GHOST_kWindowStateNormal) && (state != GHOST_kWindowStateMinimized)) {
+ m_post_init = True;
+ m_post_state = state;
+ }
+ else {
+ m_post_init = False;
+ m_post_state = GHOST_kWindowStateNormal;
+ }
// Create some hints for the window manager on how
// we want this window treated.
@@ -620,7 +606,7 @@ screenToClient(
GHOST_TInt32& outX,
GHOST_TInt32& outY
) const {
- // not sure about this one!
+ // This is correct!
int ax,ay;
Window temp;
@@ -664,28 +650,299 @@ clientToScreen(
outY = ay;
}
+void GHOST_WindowX11::icccmSetState(int state)
+{
+ XEvent xev;
- GHOST_TWindowState
-GHOST_WindowX11::
-getState(
-) const {
- //FIXME
- return GHOST_kWindowStateNormal;
+ if (state != IconicState)
+ return;
+
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.display = m_display;
+ xev.xclient.window = m_window;
+ xev.xclient.format = 32;
+ xev.xclient.message_type = m_system->m_wm_change_state;
+ xev.xclient.data.l[0] = state;
+ XSendEvent (m_display, RootWindow(m_display, DefaultScreen(m_display)),
+ False, SubstructureNotifyMask | SubstructureRedirectMask, &xev);
}
- GHOST_TSuccess
-GHOST_WindowX11::
-setState(
- GHOST_TWindowState state
-){
- //TODO
+int GHOST_WindowX11::icccmGetState(void) const
+{
+ unsigned char *prop_ret;
+ unsigned long bytes_after, num_ret;
+ Atom type_ret;
+ int format_ret, st;
+
+ prop_ret = NULL;
+ st = XGetWindowProperty(m_display, m_window, m_system->m_wm_state, 0,
+ 0x7fffffff, False, m_system->m_wm_state, &type_ret,
+ &format_ret, &num_ret, &bytes_after, &prop_ret);
+
+ if ((st == Success) && (prop_ret) && (num_ret == 2))
+ st = prop_ret[0];
+ else
+ st = NormalState;
+
+ if (prop_ret)
+ XFree(prop_ret);
+ return (st);
+}
+
+void GHOST_WindowX11::netwmMaximized(bool set)
+{
+ XEvent xev;
+
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.window = m_window;
+ xev.xclient.message_type = m_system->m_net_state;
+ xev.xclient.format = 32;
+
+ if (set == True)
+ xev.xclient.data.l[0] = _NET_WM_STATE_ADD;
+ else
+ xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
+
+ xev.xclient.data.l[1] = m_system->m_net_max_horz;
+ xev.xclient.data.l[2] = m_system->m_net_max_vert;
+ xev.xclient.data.l[3] = 0;
+ xev.xclient.data.l[4] = 0;
+ XSendEvent(m_display, RootWindow(m_display, DefaultScreen(m_display)),
+ False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+}
+
+bool GHOST_WindowX11::netwmIsMaximized(void) const
+{
+ unsigned char *prop_ret;
+ unsigned long bytes_after, num_ret;
+ Atom type_ret;
+ bool st;
+ int format_ret, count, i;
+
+ prop_ret = NULL;
+ st = False;
+ i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+ 0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if ((i == Success) && (prop_ret) && (format_ret == 32)) {
+ count = 0;
+ for (i = 0; i < num_ret; i++) {
+ if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_horz)
+ count++;
+ if (((unsigned long *) prop_ret)[i] == m_system->m_net_max_vert)
+ count++;
+ if (count == 2) {
+ st = True;
+ break;
+ }
+ }
+ }
+
+ if (prop_ret)
+ XFree(prop_ret);
+ return (st);
+}
+
+void GHOST_WindowX11::netwmFullScreen(bool set)
+{
+ XEvent xev;
+
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.window = m_window;
+ xev.xclient.message_type = m_system->m_net_state;
+ xev.xclient.format = 32;
+
+ if (set == True)
+ xev.xclient.data.l[0] = _NET_WM_STATE_ADD;
+ else
+ xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
+
+ xev.xclient.data.l[1] = m_system->m_net_fullscreen;
+ xev.xclient.data.l[2] = 0;
+ xev.xclient.data.l[3] = 0;
+ xev.xclient.data.l[4] = 0;
+ XSendEvent(m_display, RootWindow(m_display, DefaultScreen(m_display)),
+ False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+}
+
+bool GHOST_WindowX11::netwmIsFullScreen(void) const
+{
+ unsigned char *prop_ret;
+ unsigned long bytes_after, num_ret;
+ Atom type_ret;
+ bool st;
+ int format_ret, i;
+
+ prop_ret = NULL;
+ st = False;
+ i = XGetWindowProperty(m_display, m_window, m_system->m_net_state, 0,
+ 0x7fffffff, False, XA_ATOM, &type_ret, &format_ret,
+ &num_ret, &bytes_after, &prop_ret);
+ if ((i == Success) && (prop_ret) && (format_ret == 32)) {
+ for (i = 0; i < num_ret; i++) {
+ if (((unsigned long *) prop_ret)[i] == m_system->m_net_fullscreen) {
+ st = True;
+ break;
+ }
+ }
+ }
+
+ if (prop_ret)
+ XFree(prop_ret);
+ return (st);
+}
+
+void GHOST_WindowX11::motifFullScreen(bool set)
+{
+ MotifWmHints hints;
+
+ hints.flags = MWM_HINTS_DECORATIONS;
+ if (set == True)
+ hints.decorations = 0;
+ else
+ hints.decorations = 1;
+
+ XChangeProperty(m_display, m_window, m_system->m_motif,
+ m_system->m_motif, 32, PropModeReplace,
+ (unsigned char *) &hints, 4);
+}
+
+bool GHOST_WindowX11::motifIsFullScreen(void) const
+{
+ unsigned char *prop_ret;
+ unsigned long bytes_after, num_ret;
+ MotifWmHints *hints;
+ Atom type_ret;
+ bool state;
+ int format_ret, st;
+
+ prop_ret = NULL;
+ state = False;
+ st = XGetWindowProperty(m_display, m_window, m_system->m_motif, 0,
+ 0x7fffffff, False, m_system->m_motif,
+ &type_ret, &format_ret, &num_ret,
+ &bytes_after, &prop_ret);
+ if ((st == Success) && (prop_ret)) {
+ hints = (MotifWmHints *) prop_ret;
+ if (hints->flags & MWM_HINTS_DECORATIONS) {
+ if (!hints->decorations)
+ state = True;
+ }
+ }
+
+ if (prop_ret)
+ XFree(prop_ret);
+ return (state);
+}
- if (state == (int)getState()) {
+GHOST_TWindowState GHOST_WindowX11::getState() const
+{
+ GHOST_TWindowState state_ret;
+ int state;
+
+ state_ret = GHOST_kWindowStateNormal;
+ state = icccmGetState();
+ /*
+ * In the Iconic and Withdrawn state, the window
+ * is unmaped, so only need return a Minimized state.
+ */
+ if ((state == IconicState) || (state == WithdrawnState))
+ state_ret = GHOST_kWindowStateMinimized;
+ else if (netwmIsMaximized() == True)
+ state_ret = GHOST_kWindowStateMaximized;
+ else if (netwmIsFullScreen() == True)
+ state_ret = GHOST_kWindowStateFullScreen;
+ else if (motifIsFullScreen() == True)
+ state_ret = GHOST_kWindowStateFullScreen;
+ return (state_ret);
+}
+
+GHOST_TSuccess GHOST_WindowX11::setState(GHOST_TWindowState state)
+{
+ GHOST_TWindowState cur_state;
+ bool is_max, is_full, is_motif_full;
+ int icccm_state;
+
+ cur_state = getState();
+ if (state == (int)cur_state)
return GHOST_kSuccess;
- } else {
- return GHOST_kFailure;
+
+ if (cur_state != GHOST_kWindowStateMinimized) {
+ /*
+ * The window don't have this property's
+ * if it's not mapped.
+ */
+ is_max = netwmIsMaximized();
+ is_full = netwmIsFullScreen();
+ }
+ else {
+ is_max = False;
+ is_full = False;
+ }
+
+ is_motif_full = motifIsFullScreen();
+
+ if (state == GHOST_kWindowStateNormal) {
+ if (is_max == True)
+ netwmMaximized(False);
+ if (is_full == True)
+ netwmFullScreen(False);
+ if (is_motif_full == True)
+ motifFullScreen(False);
+ icccmSetState(NormalState);
+ return (GHOST_kSuccess);
+ }
+
+ if (state == GHOST_kWindowStateFullScreen) {
+ /*
+ * We can't change to full screen if the window
+ * isn't mapped.
+ */
+ if (cur_state == GHOST_kWindowStateMinimized)
+ return (GHOST_kFailure);
+
+ if (is_max == True)
+ netwmMaximized(False);
+ if (is_full == False)
+ netwmFullScreen(True);
+ if (is_motif_full == False)
+ motifFullScreen(True);
+ return (GHOST_kSuccess);
+ }
+
+ if (state == GHOST_kWindowStateMaximized) {
+ /*
+ * We can't change to Maximized if the window
+ * isn't mapped.
+ */
+ if (cur_state == GHOST_kWindowStateMinimized)
+ return (GHOST_kFailure);
+
+ if (is_full == True)
+ netwmFullScreen(False);
+ if (is_motif_full == True)
+ motifFullScreen(False);
+ if (is_max == False)
+ netwmMaximized(True);
+ return (GHOST_kSuccess);
+ }
+
+ if (state == GHOST_kWindowStateMinimized) {
+ /*
+ * The window manager need save the current state of
+ * the window (maximized, full screen, etc).
+ */
+ icccmSetState(IconicState);
+ return (GHOST_kSuccess);
}
+ return (GHOST_kFailure);
}
#include <iostream>
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index abb5c131cb7..1392e2c19a6 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -212,6 +212,15 @@ public:
const GHOST_TabletData* GetTabletData()
{ return &m_xtablet.CommonData; }
+
+ /*
+ * Need this in case that we want start the window
+ * in FullScree or Maximized state.
+ * Check GHOST_WindowX11.cpp
+ */
+ bool m_post_init;
+ GHOST_TWindowState m_post_state;
+
protected:
/**
* Tries to install a rendering context in this window.
@@ -327,6 +336,18 @@ private :
/* Tablet devices */
XTablet m_xtablet;
+
+ void icccmSetState(int state);
+ int icccmGetState() const;
+
+ void netwmMaximized(bool set);
+ bool netwmIsMaximized() const;
+
+ void netwmFullScreen(bool set);
+ bool netwmIsFullScreen() const;
+
+ void motifFullScreen(bool set);
+ bool motifIsFullScreen() const;
};
diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript
index ef6c6b49266..0184ddd9785 100644
--- a/intern/guardedalloc/SConscript
+++ b/intern/guardedalloc/SConscript
@@ -5,4 +5,4 @@ Import('env')
sources = env.Glob('intern/*.c')
incs = '.'
-env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [10, 175] )
+env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [5, 175] )
diff --git a/intern/moto/SConscript b/intern/moto/SConscript
index 636515aa5c5..4152633e393 100644
--- a/intern/moto/SConscript
+++ b/intern/moto/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp')
incs = 'include'
-env.BlenderLib ('bf_moto', sources, Split(incs), [], libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )
+env.BlenderLib ('bf_moto', sources, Split(incs), [], libtype=['intern','game','game2','player'], priority = [15, 55, 60, 130] )
diff --git a/intern/opennl/SConscript b/intern/opennl/SConscript
index e46cefbff58..e5f5d12c7d7 100644
--- a/intern/opennl/SConscript
+++ b/intern/opennl/SConscript
@@ -8,5 +8,5 @@ incs = 'extern superlu'
if (env['OURPLATFORM'] == 'win32-mingw'):
env.BlenderLib ('blender_ONL', sources, Split(incs), [], libtype=['core','intern','player'], priority=[1,80,22] )
else:
- env.BlenderLib ('blender_ONL', sources, Split(incs), [], libtype=['core','player'], priority=[55,22] )
+ env.BlenderLib ('blender_ONL', sources, Split(incs), [], libtype=['core','player'], priority=[65,22] )
diff --git a/intern/string/SConscript b/intern/string/SConscript
index 7f817f82759..292ddf5aa63 100644
--- a/intern/string/SConscript
+++ b/intern/string/SConscript
@@ -4,4 +4,4 @@ Import ('env')
sources = env.Glob('intern/*.cpp')
incs = '.'
-env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['core', 'player'], priority = [30,10] )
+env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['core', 'common','player'], priority = [50,19,0] )
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h
index ec945c80c7c..941430fd976 100644
--- a/intern/string/STR_String.h
+++ b/intern/string/STR_String.h
@@ -142,7 +142,7 @@ public:
inline operator const char *() const { return pData; }
inline char *Ptr() { return pData; }
inline const char *ReadPtr() const { return pData; }
- inline float ToFloat() const { float x=atof(pData); return x; }
+ inline float ToFloat() const { float x=(float)(atof(pData)); return x; }
inline int ToInt() const { return atoi(pData); }
// Operators
diff --git a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
index 2ffc9afa67c..2db75983040 100644
--- a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
+++ b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="BPY_python"
ProjectGUID="{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}"
+ RootNamespace="BPY_python"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -119,7 +120,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -196,7 +197,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -273,7 +274,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -330,283 +331,23 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Armature.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\BGL.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Blender.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Bone.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy_config.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy_data.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Camera.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Constraint.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Curve.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Draw.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Effect.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\gen_library.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Geometry.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Group.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\IDProp.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Image.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Ipo.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Key.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Lamp.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Lattice.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Library.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Material.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Mathutils.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Mesh.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Metaball.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Modifier.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\NLA.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\NMesh.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Node.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Noise.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Object.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Pose.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Registry.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Scene.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneRadio.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneRender.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneSequence.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneTimeLine.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Sound.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\SurfNurb.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Sys.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Text.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Text3d.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Texture.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Window.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\World.c"
- >
- </File>
<Filter
Name="internal"
>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\BezTriple.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\BPY_interface.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\BPY_menus.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\charRGBA.c"
+ RelativePath="..\..\..\source\blender\python\intern\bpy_interface.c"
>
</File>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\constant.c"
+ RelativePath="..\..\..\source\blender\python\intern\bpy_rna.c"
>
</File>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\CurNurb.c"
+ RelativePath="..\..\..\source\blender\python\intern\bpy_rna.h"
>
</File>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\euler.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\EXPP_interface.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Font.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\gen_utils.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Ipocurve.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\logic.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\matrix.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\meshPrimitive.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\MTex.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Particle.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\point.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\quat.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\rgbTuple.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Types.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\vector.c"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\windowTheme.c"
+ RelativePath="..\..\..\source\blender\python\intern\bpy_scriptlink.c"
>
</File>
</Filter>
@@ -616,286 +357,14 @@
Filter="h;hpp;hxx;hm;inl"
>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\Armature.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\BGL.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Blender.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Bone.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy_config.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy_data.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Camera.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Constraint.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Curve.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Draw.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Effect.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\gen_library.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Geometry.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Group.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\IDProp.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Image.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Ipo.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Key.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Lamp.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Lattice.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Library.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Material.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Mathutils.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Mesh.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Metaball.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Modifier.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\NLA.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\NMesh.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Node.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Object.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Pose.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Registry.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Scene.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneRadio.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneRender.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneSequence.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\sceneTimeLine.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Sound.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\SurfNurb.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Sys.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Text.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Text3d.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Texture.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Window.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\World.h"
+ RelativePath="..\..\..\source\blender\python\BPY_extern.h"
>
</File>
<Filter
Name="internal"
>
<File
- RelativePath="..\..\..\source\blender\python\api2_2x\BezTriple.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\BPY_extern.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\BPY_menus.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\bpy_types.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\charRGBA.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\constant.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\CurNurb.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\euler.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\EXPP_interface.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Font.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\gen_utils.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Ipocurve.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\logic.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\matrix.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\meshPrimitive.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\modules.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\MTex.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Particle.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\point.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\quat.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\rgbTuple.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\Types.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\vector.h"
- >
- </File>
- <File
- RelativePath="..\..\..\source\blender\python\api2_2x\windowTheme.h"
+ RelativePath="..\..\..\source\blender\python\intern\bpy_compat.h"
>
</File>
</Filter>
diff --git a/projectfiles_vc9/blender/blender.sln b/projectfiles_vc9/blender/blender.sln
index 4a12fcb2963..cc4c2d46416 100644
--- a/projectfiles_vc9/blender/blender.sln
+++ b/projectfiles_vc9/blender/blender.sln
@@ -3,7 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj", "{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}"
ProjectSection(ProjectDependencies) = postProject
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F} = {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}
- {6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}
{F9850C15-FF0A-429E-9D47-89FB433C9BD8} = {F9850C15-FF0A-429E-9D47-89FB433C9BD8}
{A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}
{FB88301F-F725-401B-ACD7-D2ABBF333B71} = {FB88301F-F725-401B-ACD7-D2ABBF333B71}
@@ -11,7 +10,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
{9625642D-6F20-4FB6-A089-BE7441B223E3} = {9625642D-6F20-4FB6-A089-BE7441B223E3}
- {E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
{FAF46346-65CC-4DB2-85C4-B99826F79D0C} = {FAF46346-65CC-4DB2-85C4-B99826F79D0C}
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
@@ -20,10 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E} = {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D} = {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B} = {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}
- {0A73055E-4DED-40CD-9F72-9093ED3EEC7E} = {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}
{09222F5E-1625-4FF3-A89A-384D16875EE5} = {09222F5E-1625-4FF3-A89A-384D16875EE5}
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A} = {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}
- {E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
{D696C86B-0B53-4471-A50D-5B983A6FA4AD} = {D696C86B-0B53-4471-A50D-5B983A6FA4AD}
{138DD16C-CC78-4F6C-A898-C8DA68D89067} = {138DD16C-CC78-4F6C-A898-C8DA68D89067}
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
@@ -31,12 +29,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
{E784098D-3ED8-433A-9353-9679415DDDC5} = {E784098D-3ED8-433A-9353-9679415DDDC5}
- {6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{76D90B92-ECC7-409C-9F98-A8814B90F3C0} = {76D90B92-ECC7-409C-9F98-A8814B90F3C0}
- {F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23} = {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}
- {8154A59A-CAED-403D-AB94-BC4E7C032666} = {8154A59A-CAED-403D-AB94-BC4E7C032666}
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7} = {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
@@ -54,6 +50,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43}
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359} = {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}
{9A307EE5-CD77-47BC-BD87-62508C7E19D8} = {9A307EE5-CD77-47BC-BD87-62508C7E19D8}
{AB590CED-F71F-4A17-A89B-18583ECD633D} = {AB590CED-F71F-4A17-A89B-18583ECD633D}
{B83C6BED-11EC-46C8-AFFA-121EEDE94373} = {B83C6BED-11EC-46C8-AFFA-121EEDE94373}
@@ -63,6 +60,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BKE_blenkernel", "blenkernel\BKE_blenkernel.vcproj", "{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"
+ ProjectSection(ProjectDependencies) = postProject
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BLI_blenlib", "blenlib\BLI_blenlib.vcproj", "{31628053-825D-4C06-8A21-D13883489718}"
ProjectSection(ProjectDependencies) = postProject
@@ -77,9 +77,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_avi", "avi\BL_avi.vcproj
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_imbuf", "imbuf\BL_imbuf.vcproj", "{415BFD6E-64CF-422B-AF88-C07F040A7292}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_src", "src\BL_src.vcproj", "{FB88301F-F725-401B-ACD7-D2ABBF333B71}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPY_python", "BPY_python\BPY_python.vcproj", "{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}"
+ ProjectSection(ProjectDependencies) = postProject
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
+ {31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BRA_radiosity", "radiosity\BRA_radiosity.vcproj", "{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}"
EndProject
@@ -151,6 +154,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
+ {E784098D-3ED8-433A-9353-9679415DDDC5} = {E784098D-3ED8-433A-9353-9679415DDDC5}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{76D90B92-ECC7-409C-9F98-A8814B90F3C0} = {76D90B92-ECC7-409C-9F98-A8814B90F3C0}
@@ -167,13 +171,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
+ {0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4}
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = {E86B7BDE-C33C-4E55-9433-E74C141D7538}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = {32CC75E2-EE85-45E6-8E3D-513F58464F43}
{9A307EE5-CD77-47BC-BD87-62508C7E19D8} = {9A307EE5-CD77-47BC-BD87-62508C7E19D8}
{AB590CED-F71F-4A17-A89B-18583ECD633D} = {AB590CED-F71F-4A17-A89B-18583ECD633D}
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373} = {B83C6BED-11EC-46C8-AFFA-121EEDE94373}
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}
{B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598}
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B} = {524264F4-DF21-4B79-847F-E7CA643ECD0B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KX_blenderhook", "..\gameengine\blenderhook\KX_blenderhook.vcproj", "{8154A59A-CAED-403D-AB94-BC4E7C032666}"
@@ -188,7 +195,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NG_loopbacknetwork", "..\ga
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NG_network", "..\gameengine\network\network\NG_network.vcproj", "{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Dummy", "..\GAMEENGINE\PHYSICS\PHY_PHYSICS\PHY_Dummy\PHY_Dummy.vcproj", "{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Dummy", "..\GAMEENGINE\physics\PHY_PHYSICS\PHY_Dummy\PHY_Dummy.vcproj", "{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Ode", "..\gameengine\physics\PHY_Physics\PHY_Ode\PHY_Ode.vcproj", "{EC405272-28E3-4840-AAC2-53D6DE4E163D}"
EndProject
@@ -206,13 +213,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SYS_system", "..\kernel\sys
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenpluginapi", "blenpluginapi\blenpluginapi\blenpluginapi.vcproj", "{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_messaging", "..\KERNEL\gen_messaging\gen_messaging.vcproj", "{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gen_messaging", "..\kernel\gen_messaging\gen_messaging.vcproj", "{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Sumo", "..\gameengine\physics\PHY_Physics\PHY_Sumo\PHY_Sumo.vcproj", "{9625642D-6F20-4FB6-A089-BE7441B223E3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BRE_yafray", "yafray\BRE_yafray.vcproj", "{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PHY_Bullet", "..\gameengine\physics\PHY_Physics\PHY_Bullet\PHY_Bullet.vcproj", "{E90C7BC2-CF30-4A60-A8F2-0050D592E358}"
+ ProjectSection(ProjectDependencies) = postProject
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_nodes", "nodes\nodes.vcproj", "{4C3AB78A-52CA-4276-A041-39776E52D8C8}"
EndProject
@@ -322,20 +332,59 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_build_install_all", "..
{B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WM_windowmanager", "windowmanager\windowmanager.vcproj", "{884D8731-654C-4C7F-9A75-8F37A305BE1E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {E784098D-3ED8-433A-9353-9679415DDDC5} = {E784098D-3ED8-433A-9353-9679415DDDC5}
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359} = {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ED_editors", "editors\ED_editors.vcproj", "{FB88301F-F725-401B-ACD7-D2ABBF333B71}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RNA_makesrna", "makesrna\RNA_makesrna.vcproj", "{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}"
+ ProjectSection(ProjectDependencies) = postProject
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RNA_rna", "makesrna\RNA_rna.vcproj", "{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6} = {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_dna", "makesdna\DNA_dna.vcproj", "{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}"
+ ProjectSection(ProjectDependencies) = postProject
+ {E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ 3D Plugin Debug|Win32 = 3D Plugin Debug|Win32
+ 3D Plugin Release|Win32 = 3D Plugin Release|Win32
Blender Debug|Win32 = Blender Debug|Win32
Blender Release|Win32 = Blender Release|Win32
BlenderPlayer Debug|Win32 = BlenderPlayer Debug|Win32
BlenderPlayer Release|Win32 = BlenderPlayer Release|Win32
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Blender Release|Win32.Build.0 = Blender Release|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}.Release|Win32.Build.0 = Blender Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -344,6 +393,14 @@ Global
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -352,6 +409,14 @@ Global
{31628053-825D-4C06-8A21-D13883489718}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{31628053-825D-4C06-8A21-D13883489718}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{31628053-825D-4C06-8A21-D13883489718}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {31628053-825D-4C06-8A21-D13883489718}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -360,6 +425,14 @@ Global
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -368,6 +441,14 @@ Global
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -376,6 +457,14 @@ Global
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {9A307EE5-CD77-47BC-BD87-62508C7E19D8}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -384,12 +473,14 @@ Global
{415BFD6E-64CF-422B-AF88-C07F040A7292}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{415BFD6E-64CF-422B-AF88-C07F040A7292}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {415BFD6E-64CF-422B-AF88-C07F040A7292}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Debug|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.3D Plugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -398,18 +489,42 @@ Global
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Blender Release|Win32.Build.0 = Blender Release|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}.Release|Win32.Build.0 = Blender Release|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.Blender Release|Win32.Build.0 = Blender Release|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{106AE171-0083-41D6-A949-20DB0E8DC251}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {106AE171-0083-41D6-A949-20DB0E8DC251}.Release|Win32.Build.0 = Blender Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -418,6 +533,14 @@ Global
{E013786A-9575-4F34-81B2-33290357EE87}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E013786A-9575-4F34-81B2-33290357EE87}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {E013786A-9575-4F34-81B2-33290357EE87}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -426,74 +549,150 @@ Global
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{EADC3C5A-6C51-4F03-8038-1553E7D7F740}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {EADC3C5A-6C51-4F03-8038-1553E7D7F740}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Blender Release|Win32.Build.0 = Blender Release|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {A1CCF5B0-08E1-4F00-B417-8BFAC34E5E90}.Release|Win32.Build.0 = Blender Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Blender Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Blender Release|Win32.ActiveCfg = 3D Plugin Release|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.BlenderPlayer Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
{DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.BlenderPlayer Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {DF25E6F2-780C-438B-8AAD-D10CF8B3820A}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Debug|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Debug|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.3D Plugin Release|Win32.Build.0 = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{3D310C60-6771-48E4-BCCA-D2718CDED898}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3D310C60-6771-48E4-BCCA-D2718CDED898}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {8154A59A-CAED-403D-AB94-BC4E7C032666}.Blender Release|Win32.Build.0 = Blender Release|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{8154A59A-CAED-403D-AB94-BC4E7C032666}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {8154A59A-CAED-403D-AB94-BC4E7C032666}.Release|Win32.Build.0 = Blender Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Blender Release|Win32.Build.0 = Blender Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{F90BD995-FFA4-4B18-81E8-FA4322C939E8}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {F90BD995-FFA4-4B18-81E8-FA4322C939E8}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {E645CC32-4823-463E-82F0-46ADDE664018}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {E645CC32-4823-463E-82F0-46ADDE664018}.Blender Release|Win32.Build.0 = Blender Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E645CC32-4823-463E-82F0-46ADDE664018}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {E645CC32-4823-463E-82F0-46ADDE664018}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Blender Release|Win32.Build.0 = Blender Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{6E24BF09-9653-4166-A871-F65CC9E98A9B}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {6E24BF09-9653-4166-A871-F65CC9E98A9B}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {6B801390-5F95-4F07-81A7-97FBA046AACC}.Blender Release|Win32.Build.0 = Blender Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{6B801390-5F95-4F07-81A7-97FBA046AACC}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {6B801390-5F95-4F07-81A7-97FBA046AACC}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
- {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
- {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Blender Release|Win32.Build.0 = Blender Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {0A73055E-4DED-40CD-9F72-9093ED3EEC7E}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -502,10 +701,26 @@ Global
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.Blender Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
{EC405272-28E3-4840-AAC2-53D6DE4E163D}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {EC405272-28E3-4840-AAC2-53D6DE4E163D}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -514,6 +729,14 @@ Global
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -522,6 +745,14 @@ Global
{AB590CED-F71F-4A17-A89B-18583ECD633D}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{AB590CED-F71F-4A17-A89B-18583ECD633D}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {AB590CED-F71F-4A17-A89B-18583ECD633D}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -530,6 +761,14 @@ Global
{51FB3D48-2467-4BFA-A321-D848252B437E}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{51FB3D48-2467-4BFA-A321-D848252B437E}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {51FB3D48-2467-4BFA-A321-D848252B437E}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -538,6 +777,14 @@ Global
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{32CC75E2-EE85-45E6-8E3D-513F58464F43}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {32CC75E2-EE85-45E6-8E3D-513F58464F43}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -546,6 +793,14 @@ Global
{09222F5E-1625-4FF3-A89A-384D16875EE5}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{09222F5E-1625-4FF3-A89A-384D16875EE5}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {09222F5E-1625-4FF3-A89A-384D16875EE5}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -554,6 +809,14 @@ Global
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -562,6 +825,14 @@ Global
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -570,6 +841,14 @@ Global
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -578,12 +857,28 @@ Global
{9625642D-6F20-4FB6-A089-BE7441B223E3}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{9625642D-6F20-4FB6-A089-BE7441B223E3}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {9625642D-6F20-4FB6-A089-BE7441B223E3}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Blender Release|Win32.Build.0 = Blender Release|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}.Release|Win32.Build.0 = Blender Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -592,6 +887,14 @@ Global
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {E90C7BC2-CF30-4A60-A8F2-0050D592E358}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -600,6 +903,14 @@ Global
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{4C3AB78A-52CA-4276-A041-39776E52D8C8}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {4C3AB78A-52CA-4276-A041-39776E52D8C8}.Release|Win32.Build.0 = Blender Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -608,6 +919,14 @@ Global
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
{138DD16C-CC78-4F6C-A898-C8DA68D89067}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {138DD16C-CC78-4F6C-A898-C8DA68D89067}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Debug|Win32.ActiveCfg = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Debug|Win32.Build.0 = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Release|Win32.ActiveCfg = Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.3D Plugin Release|Win32.Build.0 = Release|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Debug|Win32.ActiveCfg = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Debug|Win32.Build.0 = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.Blender Release|Win32.ActiveCfg = Release|Win32
@@ -616,24 +935,62 @@ Global
{670EC17A-0548-4BBF-A27B-636C7C188139}.BlenderPlayer Debug|Win32.Build.0 = Debug|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.BlenderPlayer Release|Win32.ActiveCfg = Release|Win32
{670EC17A-0548-4BBF-A27B-636C7C188139}.BlenderPlayer Release|Win32.Build.0 = Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.Debug|Win32.ActiveCfg = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.Debug|Win32.Build.0 = Debug|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.Release|Win32.ActiveCfg = Release|Win32
+ {670EC17A-0548-4BBF-A27B-636C7C188139}.Release|Win32.Build.0 = Release|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender Release|Win32.Build.0 = Blender Release|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {0112CAD5-3584-412A-A2E5-1315A00437B4}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender Release|Win32.Build.0 = Blender Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender Release|Win32.Build.0 = Blender Release|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {524264F4-DF21-4B79-847F-E7CA643ECD0B}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -642,6 +999,14 @@ Global
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{D696C86B-0B53-4471-A50D-5B983A6FA4AD}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {D696C86B-0B53-4471-A50D-5B983A6FA4AD}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -650,12 +1015,28 @@ Global
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{FFD3C64A-30E2-4BC7-BC8F-51818C320400}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {FFD3C64A-30E2-4BC7-BC8F-51818C320400}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Blender Release|Win32.Build.0 = Blender Release|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{F9850C15-FF0A-429E-9D47-89FB433C9BD8}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {F9850C15-FF0A-429E-9D47-89FB433C9BD8}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -664,13 +1045,30 @@ Global
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release|Win32.Build.0 = Blender Release|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Blender Release|Win32.Build.0 = Blender Release|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {6461F05D-4698-47AB-A8E8-1CA2ACC9948B}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -679,34 +1077,84 @@ Global
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {531D4862-D0E7-4B9B-A0B6-B3A6A25B547A}.Release|Win32.Build.0 = Blender Release|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Blender Release|Win32.Build.0 = Blender Release|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {FC752464-F413-4D4F-842D-A5D3AA0E6A3D}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{9C71A793-C177-4CAB-8EC5-923D500B39F8}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {9C71A793-C177-4CAB-8EC5-923D500B39F8}.Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.Blender Release|Win32.Build.0 = Blender Release|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{E784098D-3ED8-433A-9353-9679415DDDC5}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {E784098D-3ED8-433A-9353-9679415DDDC5}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Blender Release|Win32.Build.0 = Blender Release|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Release|Win32.Build.0 = Blender Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -715,6 +1163,14 @@ Global
{51A348C1-8684-4D67-B980-97B1FC74159B}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{51A348C1-8684-4D67-B980-97B1FC74159B}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {51A348C1-8684-4D67-B980-97B1FC74159B}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -723,6 +1179,14 @@ Global
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -731,12 +1195,28 @@ Global
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{FAF46346-65CC-4DB2-85C4-B99826F79D0C}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {FAF46346-65CC-4DB2-85C4-B99826F79D0C}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Release|Win32.Build.0 = Blender Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -745,6 +1225,14 @@ Global
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {76D90B92-ECC7-409C-9F98-A8814B90F3C0}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -753,6 +1241,14 @@ Global
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -761,6 +1257,14 @@ Global
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{542A9FA1-B7FF-441C-AE15-054DB31D3488}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {542A9FA1-B7FF-441C-AE15-054DB31D3488}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -769,6 +1273,14 @@ Global
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{E86B7BDE-C33C-4E55-9433-E74C141D7538}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {E86B7BDE-C33C-4E55-9433-E74C141D7538}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -777,6 +1289,14 @@ Global
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -785,6 +1305,14 @@ Global
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{213356A9-3A1F-41DA-9819-1297BCD17DEE}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {213356A9-3A1F-41DA-9819-1297BCD17DEE}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -793,6 +1321,14 @@ Global
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {8B8D4FC3-3234-4E54-8376-5AB83D00D164}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -801,6 +1337,14 @@ Global
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{98330220-47A6-42E0-9DE4-AD0FF5D204D6}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {98330220-47A6-42E0-9DE4-AD0FF5D204D6}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
@@ -809,10 +1353,102 @@ Global
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {B789C2F3-279E-4A85-8F0A-7F7AC068E598}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Release|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.3D Plugin Release|Win32.Build.0 = 3DPlugin Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{02110D03-59DB-4571-8787-72B3C03B2F2D}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
+ {02110D03-59DB-4571-8787-72B3C03B2F2D}.Release|Win32.Build.0 = 3DPlugin Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Release|Win32.Build.0 = Blender Release|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Debug|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Release|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Release|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.Release|Win32.Build.0 = Blender Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.BlenderPlayer Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.BlenderPlayer Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Release|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}.Release|Win32.Build.0 = BlenderPlayer Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}.Release|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Release|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Release|Win32.ActiveCfg = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Release|Win32.Build.0 = Blender Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj
index 8950ef822a1..106231ecc51 100644
--- a/projectfiles_vc9/blender/blender.vcproj
+++ b/projectfiles_vc9/blender/blender.vcproj
@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_9\extern\glew\include;..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\windowmanager;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_9\extern\glew\include;..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;WITH_QUICKTIME;GAMEBLENDER=1;USE_SUMO_SOLID;FTGL_LIBRARY_STATIC;WITH_VERSE"
StringPooling="true"
RuntimeLibrary="0"
@@ -139,7 +139,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\include;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_9\extern\glew\include;..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\source\blender;..\..\source\blender\imbuf;..\..\source\blender\misc;..\..\source\blender\blenlib;..\..\source\blender\python;..\..\source\blender\windowmanager;..\..\source\blender\renderui;..\..\source\blender\makesdna;..\..\source\blender\blenkernel;..\..\source\blender\blenloader;..\..\source\blender\renderconverter;..\..\source\blender\render\extern\include;..\..\source\blender\radiosity\extern\include;..\..\source\kernel\gen_system;..\..\source\kernel\gen_messaging;..\..\..\build\msvc_9\extern\glew\include;..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;WITH_QUICKTIME;WITH_VERSE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -148,7 +148,7 @@
AssemblerListingLocation="..\..\..\build\msvc_9\source\blender\debug\"
ObjectFile="..\..\..\build\msvc_9\source\blender\debug\"
ProgramDataBaseFileName="..\..\..\build\msvc_9\source\blender\debug\"
- WarningLevel="2"
+ WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
index 3cc89a17f1e..21fd60987df 100644
--- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
+++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="BKE_blenkernel"
ProjectGUID="{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"
+ RootNamespace="BKE_blenkernel"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -192,7 +193,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2;UNWRAPPER;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
@@ -267,7 +268,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="2"
@@ -342,7 +343,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_FFMPEG"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -417,7 +418,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2;UNWRAPPER;WITH_FFMPEG"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj
new file mode 100644
index 00000000000..c57caa439e1
--- /dev/null
+++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj
@@ -0,0 +1,533 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="ED_editors"
+ ProjectGUID="{FB88301F-F725-401B-ACD7-D2ABBF333B71}"
+ RootNamespace="BL_editors"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\editors"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\editors"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\src\BL_editors.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\editors\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\editors\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\editors\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\BL_editors.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\editors\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\editors\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_VERSE;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\src\debug\editors_src.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\editors\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\editors\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\editors\debug\"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\debug\BL_editors.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="include"
+ Filter="h"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\BIF_gl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\BIF_glutil.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_datafiles.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_interface.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_markers.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_mesh.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_object.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_previewrender.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_screen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_screen_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_space_api.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_transform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\ED_util.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\UI_interface.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\UI_interface_icons.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\UI_resources.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\UI_text.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\include\UI_view2d.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="datafiles"
+ Filter="c"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\datafiles\B.blend.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\datafiles\Bfont.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\datafiles\bfont.ttf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\datafiles\blenderbuttons.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\datafiles\splash.jpg.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="interface"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface_draw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface_handlers.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface_icons.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\interface_regions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\resources.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\text.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\view2d.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\interface\view2d_ops.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_view3d"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_view3d\space_view3d.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_view3d\view3d_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_view3d\view3d_intern.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_time"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_time\ed_markers.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_time\space_time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_time\time_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_time\time_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_time\time_ops.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_outliner"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_outliner\outliner_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_outliner\outliner_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_outliner\outliner_ops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_outliner\space_outliner.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="screen"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\area.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\glutil.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\screen_edit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\screen_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\screen_ops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\screen\stubs.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="util"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\util\ed_util.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_api"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_api\space.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_api\spacetypes.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_ipo"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_ipo\ipo_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_ipo\ipo_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_ipo\space_ipo.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_image"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_image\image_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_image\image_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_image\space_image.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_node"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_node\node_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_node\node_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_node\space_node.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_buttons"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_buttons\buttons_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_buttons\space_buttons.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_file"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_file\file_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_file\file_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_file\filesel.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_file\space_file.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="space_info"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_info\info_header.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_info\info_intern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\editors\space_info\space_info.c"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc9/blender/loader/BLO_loader.vcproj b/projectfiles_vc9/blender/loader/BLO_loader.vcproj
index 2b82599b643..23a5ec53f47 100644
--- a/projectfiles_vc9/blender/loader/BLO_loader.vcproj
+++ b/projectfiles_vc9/blender/loader/BLO_loader.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="BLO_loader"
ProjectGUID="{E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}"
+ RootNamespace="BLO_loader"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -473,58 +474,6 @@
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath="..\..\..\source\blender\blenloader\intern\genfile.c"
- >
- <FileConfiguration
- Name="Blender Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="3D Plugin Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="3D Plugin Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Blender Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="BlenderPlayer Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="BlenderPlayer Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- />
- </FileConfiguration>
- </File>
- <File
RelativePath="..\..\..\source\blender\blenloader\intern\readblenentry.c"
>
</File>
diff --git a/projectfiles_vc9/blender/makesdna/DNA_dna.vcproj b/projectfiles_vc9/blender/makesdna/DNA_dna.vcproj
new file mode 100644
index 00000000000..c92c053f5bc
--- /dev/null
+++ b/projectfiles_vc9/blender/makesdna/DNA_dna.vcproj
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="DNA_dna"
+ ProjectGUID="{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}"
+ RootNamespace="DNA_dna"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesdna\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesdna\debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\debug\DNA_dna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesdna\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\makesdna\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesdna\debug\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\debug\DNA_dna.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesdna\release"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesdna\release"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\release\DNA_dna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\makesdna\intern\dna.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesdna\intern\dna_genfile.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\makesdna\DNA_genfile.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj b/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
index cb68fa41619..50fa6cc1bdd 100644
--- a/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
+++ b/projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="DNA_makesdna"
ProjectGUID="{E013786A-9575-4F34-81B2-33290357EE87}"
+ RootNamespace="DNA_makesdna"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -813,6 +814,10 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\makesdna\DNA_windowmanager_types.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\makesdna\DNA_world_types.h"
>
</File>
diff --git a/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj b/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
new file mode 100644
index 00000000000..41598558179
--- /dev/null
+++ b/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
@@ -0,0 +1,741 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="RNA_makesrna"
+ ProjectGUID="{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}"
+ RootNamespace="DNA_makesdna"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="3D Plugin Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesdna\mtdll\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesdna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include"
+ PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesdna\mtdll\debug\DNA_makesrna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesdna\mtdll\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern\mtdll\debug;..\..\..\..\build\msvc_9\libs\mtdll\debug"
+ IgnoreDefaultLibraryNames=" libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\debug\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesrna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\makesdna"
+ PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,WITH_VERSE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesrna\DNA_makesrna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern;..\..\..\..\build\msvc_9\libs"
+ IgnoreDefaultLibraryNames="libc.lib"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="3D Plugin Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesrna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include"
+ PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\DNA_makesrna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\mtdll\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern\mtdll;..\..\..\..\build\msvc_9\libs\mtdll"
+ IgnoreDefaultLibraryNames=" libc.lib, libcmt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesrna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\makesdna"
+ PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;WITH_VERSE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\DNA_makesrna.pch"
+ ExpandAttributedSource="false"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib DNA_dna.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern\debug;..\..\..\..\build\msvc_9\libs\debug"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames="libc.lib, libcd.lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\debug\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\blenplayer"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\blenplayer"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesrna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\makesdna"
+ PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\DNA_makesrna.pch"
+ ExpandAttributedSource="false"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern\debug;..\..\..\..\build\msvc_9\libs\debug"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames="libc.lib, libcd.lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\debug\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="BlenderPlayer Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\blenplayer"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\blenplayer"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\..\..\..\source\blender\makesrna\intern/DNA_makesrna.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\makesdna"
+ PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\makesrna\DNA_makesrna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="libguardedalloc.lib BLI_blenlib.lib odbc32.lib odbccp32.lib"
+ OutputFile="..\..\..\source\blender\makesrna\intern\RNA_makesrna.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\..\..\build\msvc_9\libs\intern;..\..\..\..\build\msvc_9\libs"
+ IgnoreDefaultLibraryNames="libc.lib"
+ ProgramDatabaseFile="..\..\..\..\build\msvc_9\libs\DNA_makesrna.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Building RNA"
+ CommandLine="CD ..\..\..\source\blender\makesrna\intern&#x0D;&#x0A;RNA_makesrna.exe rna.c&#x0D;&#x0A;"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\makesrna.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_actuator.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_armature.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_brush.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_camera.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_color.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_constraint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_controller.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_curve.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_define.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_group.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_ID.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_image.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_ipo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_key.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_lamp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_lattice.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_main.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_material.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_mesh.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_meta.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_modifier.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_nodetree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_object.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_packedfile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_property.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_radio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_rna.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_scene.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_screen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_sensor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_vfont.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_wm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_world.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
new file mode 100644
index 00000000000..9b79ca1513f
--- /dev/null
+++ b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="RNA_rna"
+ ProjectGUID="{DFE7F3E3-E62A-4677-B666-DF0DDF70C359}"
+ RootNamespace="RNA_rna"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\debug\RNA_rna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\makesrna\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\makesrna\debug\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\debug\RNA_rna.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\release"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\makesrna\release"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\release\RNA_rna.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\release\RNA_rna.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_access.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_dependency.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\RNA_access.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\intern\rna_internal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\makesrna\RNA_types.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc9/blender/nodes/nodes.vcproj b/projectfiles_vc9/blender/nodes/nodes.vcproj
index d32ef98da2f..b5f60bedc31 100644
--- a/projectfiles_vc9/blender/nodes/nodes.vcproj
+++ b/projectfiles_vc9/blender/nodes/nodes.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="BL_nodes"
ProjectGUID="{4C3AB78A-52CA-4276-A041-39776E52D8C8}"
+ RootNamespace="BL_nodes"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
@@ -41,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -111,7 +112,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@@ -181,7 +182,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_OPENEXR"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -251,7 +252,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_FREETYPE2, WITH_OPENEXR"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
@@ -616,10 +617,18 @@
>
</File>
<File
+ RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_coord.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_curves.c"
>
</File>
<File
+ RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_distance.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\source\blender\nodes\intern\TEX_nodes\TEX_hueSatVal.c"
>
</File>
diff --git a/projectfiles_vc9/blender/radiosity/BRA_radiosity.vcproj b/projectfiles_vc9/blender/radiosity/BRA_radiosity.vcproj
index edde52b0a07..bdecacc131e 100644
--- a/projectfiles_vc9/blender/radiosity/BRA_radiosity.vcproj
+++ b/projectfiles_vc9/blender/radiosity/BRA_radiosity.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="BRA_radiosity"
ProjectGUID="{2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}"
+ RootNamespace="BRA_radiosity"
TargetFrameworkVersion="131072"
>
<Platforms>
@@ -42,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_9\extern\glew\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_9\extern\glew\include"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
StringPooling="true"
RuntimeLibrary="0"
@@ -117,7 +118,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_9\extern\glew\include"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\render\intern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\..\build\msvc_9\extern\glew\include"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj b/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
new file mode 100644
index 00000000000..33ea6cff58d
--- /dev/null
+++ b/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="WM_windowmanager"
+ ProjectGUID="{884D8731-654C-4C7F-9A75-8F37A305BE1E}"
+ RootNamespace="WM_windowmanager"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug"
+ ConfigurationType="4"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\debug\WM_windowmanager.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\windowmanager\release"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\windowmanager\debug"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenloader;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\render\release\WM_windowmanager.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\windowmanager\release\"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_apple.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_cursors.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_event_system.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_files.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_gesture.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_init_exit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_keymap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_operators.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_report.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_subwindow.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\intern\wm_window.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\WM_api.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_cursors.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_event_system.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_event_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_files.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_gesture_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_subwindow.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\WM_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\windowmanager\wm_window.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
index 43e692e9bad..ab0b05c208c 100644
--- a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
@@ -72,12 +72,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
- AdditionalDependencies="odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
+ AdditionalDependencies="odelib.lib fmodvc.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
ShowProgress="0"
OutputFile="..\..\..\..\bin\debug\blenderplayer.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\build\msvc_9\libs\intern\debug;..\..\..\..\..\build\msvc_9\libs\extern\debug;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
+ AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
IgnoreDefaultLibraryNames="libc.lib;libcmt.lib;msvcrt.lib;libcd.lib;msvcrtd.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\..\..\build\msvc_9\libs\debug\blenderplayer.pdb"
@@ -166,11 +166,11 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="odelib.lib fmodvc.lib libbmfont.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
+ AdditionalDependencies="odelib.lib fmodvc.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib openal_static.lib libjpeg.lib dxguid.lib libeay32.lib libpng.lib libz.lib qtmlClient.lib SDL.lib freetype2ST.lib python25_d.lib pthreadVSE2.lib pthreadVC2.lib Half.lib Iex.lib IlmImf.lib IlmThread.lib Imath.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"
OutputFile="..\..\..\..\bin\blenderplayer.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
- AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\build\msvc_9\libs\intern;..\..\..\..\..\build\msvc_9\libs\extern;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
+ AdditionalLibraryDirectories="..\..\..\..\..\lib\windows\sdl\lib;..\..\..\..\..\lib\windows\zlib\lib;..\..\..\..\..\lib\windows\ode\lib;..\..\..\..\..\lib\windows\png\lib;..\..\..\..\..\lib\windows\jpeg\lib;..\..\..\..\..\lib\windows\fmod\lib;..\..\..\..\..\lib\windows\openal\lib;..\..\..\..\..\lib\windows\freetype\lib;..\..\..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\..\..\lib\windows\python\lib\lib25_vs2008;..\..\..\..\..\lib\windows\openssl\lib;..\..\..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\..\..\lib\windows\pthreads\lib;..\..\..\..\..\lib\windows\ffmpeg\lib"
IgnoreDefaultLibraryNames="libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib"
ProgramDatabaseFile="..\..\..\..\..\build\msvc_9\libs\blenderplayer.pdb"
SubSystem="1"
diff --git a/projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj b/projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
index 155290e5e39..d4cb1e465e6 100644
--- a/projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
+++ b/projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="RAS_openglrasterizer"
ProjectGUID="{AB590CED-F71F-4A17-A89B-18583ECD633D}"
+ RootNamespace="RAS_openglrasterizer"
TargetFrameworkVersion="131072"
>
<Platforms>
diff --git a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
index 4a3b4b865fc..726ab910e7c 100644
--- a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
+++ b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
@@ -4,6 +4,7 @@
Version="9,00"
Name="TEX_Video"
ProjectGUID="{670EC17A-0548-4BBF-A27B-636C7C188139}"
+ RootNamespace="TEX_Video"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
@@ -41,7 +42,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;WITH_FFMPEG;__STDC_CONSTANT_MACROS"
StringPooling="false"
BasicRuntimeChecks="3"
@@ -112,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
+ AdditionalIncludeDirectories="..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\gameengine\Ketsji;..\..\..\source\gameengine\Expressions;..\..\..\source\gameengine\GameLogic;..\..\..\source\gameengine\SceneGraph;..\..\..\source\gameengine\Rasterizer;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\BlenderRoutines;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\gpu;..\..\..\source\kernel\gen_system;..\..\..\intern\string;..\..\..\intern\moto\include;..\..\..\intern\guardedalloc;..\..\..\intern\SoundSystem;..\..\..\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;WITH_FFMPEG;__STDC_CONSTANT_MACROS"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/release/Makefile b/release/Makefile
index f440e2dface..43a369d8f77 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -57,6 +57,12 @@ ifeq ($(OS),$(findstring $(OS), "freebsd irix linux openbsd solaris"))
NOPLUGINS?=true
endif
endif
+ # don"t build plugins on irix if using gcc
+ ifeq ($(OS), irix)
+ ifeq ($(IRIX_USE_GCC), true)
+ NOPLUGINS?=true
+ endif
+ endif
endif
ifeq ($(OS),windows)
diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons
index 6993840e51f..07ab94b1c20 100644
--- a/release/datafiles/blenderbuttons
+++ b/release/datafiles/blenderbuttons
Binary files differ
diff --git a/release/scripts/bpymodules/BPyImage.py b/release/scripts/bpymodules/BPyImage.py
index 2c342ddec39..504e4ee29ba 100644
--- a/release/scripts/bpymodules/BPyImage.py
+++ b/release/scripts/bpymodules/BPyImage.py
@@ -79,7 +79,7 @@ def addSlash(path):
return path + sys.sep
-def comprehensiveImageLoad(imagePath, filePath, PLACE_HOLDER= True, RECURSIVE=True, VERBOSE=False):
+def comprehensiveImageLoad(imagePath, filePath, PLACE_HOLDER= True, RECURSIVE=True, VERBOSE=False, CONVERT_CALLBACK=None):
'''
imagePath: The image filename
If a path precedes it, this will be searched as well.
@@ -93,13 +93,30 @@ def comprehensiveImageLoad(imagePath, filePath, PLACE_HOLDER= True, RECURSIVE=Tr
RECURSIVE: If True, directories will be recursivly searched.
Be carefull with this if you have files in your root directory because it may take a long time.
+
+ CASE_INSENSITIVE: for non win32 systems, find the correct case for the file.
+
+ CONVERT_CALLBACK: a function that takes an existing path and returns a new one.
+ Use this when loading image formats blender may not support, the CONVERT_CALLBACK
+ can take the path for a GIF (for example), convert it to a PNG and return the PNG's path.
+ For formats blender can read, simply return the path that is given.
'''
+ # VERBOSE = True
+
if VERBOSE: print 'img:', imagePath, 'file:', filePath
+
+ if os == None and CASE_INSENSITIVE:
+ CASE_INSENSITIVE = True
+
# When we have the file load it with this. try/except niceness.
def imageLoad(path):
#if path.endswith('\\') or path.endswith('/'):
# raise 'INVALID PATH'
+
+ if CONVERT_CALLBACK:
+ path = CONVERT_CALLBACK(path)
+
try:
img = bpy.data.images.new(filename=path)
if VERBOSE: print '\t\tImage loaded "%s"' % path
diff --git a/release/scripts/bpymodules/BPyMathutils.py b/release/scripts/bpymodules/BPyMathutils.py
index 27736b4169e..bfa1dcc3c61 100644
--- a/release/scripts/bpymodules/BPyMathutils.py
+++ b/release/scripts/bpymodules/BPyMathutils.py
@@ -225,15 +225,5 @@ from math import pi, sin, cos, sqrt
def angleToLength(angle):
# Alredy accounted for
- if angle < 0.000001:
- return 1.0
-
- angle = 2*pi*angle/360
- x,y = cos(angle), sin(angle)
- # print "YX", x,y
- # 0 d is hoz to the right.
- # 90d is vert upward.
- fac=1/x
- x=x*fac
- y=y*fac
- return sqrt((x*x)+(y*y))
+ if angle < 0.000001: return 1.0
+ else: return abs(1.0 / cos(pi*angle/180));
diff --git a/release/scripts/bpymodules/BPySys.py b/release/scripts/bpymodules/BPySys.py
index 594264fad84..a2d2120ebff 100644
--- a/release/scripts/bpymodules/BPySys.py
+++ b/release/scripts/bpymodules/BPySys.py
@@ -12,3 +12,63 @@ def cleanName(name):
for ch in invalid: name = name.replace(ch, '_')
return name
+def caseInsensitivePath(path, RET_FOUND=False):
+ '''
+ Get a case insensitive path on a case sensitive system
+
+ RET_FOUND is for internal use only, to avoid too many calls to os.path.exists
+ # Example usage
+ getCaseInsensitivePath('/hOmE/mE/sOmEpAtH.tXt')
+ '''
+ import os # todo, what happens with no os?
+
+ if os==None:
+ if RET_FOUND: ret = path, True
+ else: ret = path
+ return ret
+
+ if path=='' or os.path.exists(path):
+ if RET_FOUND: ret = path, True
+ else: ret = path
+ return ret
+
+ f = os.path.basename(path) # f may be a directory or a file
+ d = os.path.dirname(path)
+
+ suffix = ''
+ if not f: # dir ends with a slash?
+ if len(d) < len(path):
+ suffix = path[:len(path)-len(d)]
+
+ f = os.path.basename(d)
+ d = os.path.dirname(d)
+
+ if not os.path.exists(d):
+ d, found = caseInsensitivePath(d, True)
+
+ if not found:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+ return ret
+
+ # at this point, the directory exists but not the file
+
+ try: # we are expecting 'd' to be a directory, but it could be a file
+ files = os.listdir(d)
+ except:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+
+ f_low = f.lower()
+
+ try: f_nocase = [fl for fl in files if fl.lower() == f_low][0]
+ except: f_nocase = None
+
+ if f_nocase:
+ if RET_FOUND: ret = os.path.join(d, f_nocase) + suffix, True
+ else: ret = os.path.join(d, f_nocase) + suffix
+ return ret
+ else:
+ if RET_FOUND: ret = path, False
+ else: ret = path
+ return ret # cant find the right one, just return the path as is. \ No newline at end of file
diff --git a/release/scripts/export_fbx.py b/release/scripts/export_fbx.py
index 3f02a71f951..ce17f78c5e2 100644
--- a/release/scripts/export_fbx.py
+++ b/release/scripts/export_fbx.py
@@ -66,8 +66,6 @@ import BPyMesh
import BPySys
import BPyMessages
-import sys
-
## This was used to make V, but faster not to do all that
##valid = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_,.()[]{}'
##v = range(255)
@@ -184,7 +182,19 @@ def sane_texname(data): return sane_name(data, sane_name_mapping_tex)
def sane_takename(data): return sane_name(data, sane_name_mapping_take)
def sane_groupname(data): return sane_name(data, sane_name_mapping_group)
-
+def derived_paths(fname_orig, basepath, FORCE_CWD=False):
+ '''
+ fname_orig - blender path, can be relative
+ basepath - fname_rel will be relative to this
+ FORCE_CWD - dont use the basepath, just add a ./ to the filename.
+ use when we know the file will be in the basepath.
+ '''
+ fname = Blender.sys.expandpath(fname_orig)
+ fname_strip = strip_path(fname)
+ if FORCE_CWD: fname_rel = '.' + Blender.sys.sep + fname_strip
+ else: fname_rel = Blender.sys.relpath(fname, basepath)
+ if fname_rel.startswith('//'): fname_rel = '.' + Blender.sys.sep + fname_rel[2:]
+ return fname, fname_strip, fname_rel
def mat4x4str(mat):
@@ -342,6 +352,8 @@ def write(filename, batch_objects = None, \
# end batch support
+ # Use this for working out paths relative to the export location
+ basepath = Blender.sys.dirname(filename)
# ----------------------------------------------
# storage classes
@@ -1141,10 +1153,9 @@ def write(filename, batch_objects = None, \
Property: "Width", "int", "",0
Property: "Height", "int", "",0''')
if tex:
- fname = tex.filename
- fname_strip = strip_path(fname)
+ fname, fname_strip, fname_rel = derived_paths(tex.filename, basepath, EXP_IMAGE_COPY)
else:
- fname = fname_strip = ''
+ fname = fname_strip = fname_rel = ''
file.write('\n\t\t\tProperty: "Path", "charptr", "", "%s"' % fname_strip)
@@ -1163,7 +1174,7 @@ def write(filename, batch_objects = None, \
file.write('\n\t\tFilename: "%s"' % fname_strip)
if fname_strip: fname_strip = '/' + fname_strip
- file.write('\n\t\tRelativeFilename: "fbx%s"' % fname_strip) # make relative
+ file.write('\n\t\tRelativeFilename: "%s"' % fname_rel) # make relative
file.write('\n\t}')
@@ -1202,13 +1213,14 @@ def write(filename, batch_objects = None, \
}''')
file.write('\n\t\tMedia: "Video::%s"' % texname)
+
if tex:
- fname = tex.filename
- file.write('\n\t\tFileName: "%s"' % strip_path(fname))
- file.write('\n\t\tRelativeFilename: "fbx/%s"' % strip_path(fname)) # need some make relative command
+ fname, fname_strip, fname_rel = derived_paths(tex.filename, basepath, EXP_IMAGE_COPY)
else:
- file.write('\n\t\tFileName: ""')
- file.write('\n\t\tRelativeFilename: "fbx"')
+ fname = fname_strip = fname_rel = ''
+
+ file.write('\n\t\tFileName: "%s"' % fname_strip)
+ file.write('\n\t\tRelativeFilename: "%s"' % fname_rel) # need some make relative command
file.write('''
ModelUVTranslation: 0,0
@@ -2658,7 +2670,7 @@ Takes: {''')
# copy images if enabled
if EXP_IMAGE_COPY:
- copy_images( Blender.sys.dirname(filename), [ tex[1] for tex in textures if tex[1] != None ])
+ copy_images( basepath, [ tex[1] for tex in textures if tex[1] != None ])
print 'export finished in %.4f sec.' % (Blender.sys.time() - start_time)
return True
diff --git a/release/scripts/import_dxf.py b/release/scripts/import_dxf.py
index bb0119a9a81..6a1981bb262 100644
--- a/release/scripts/import_dxf.py
+++ b/release/scripts/import_dxf.py
@@ -7,7 +7,7 @@ Group: 'Import'
Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).'
"""
__author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
-__version__ = '1.12 - 2008.08.03 by migius'
+__version__ = '1.12 - 2008.11.16 by migius'
__url__ = ["http://blenderartists.org/forum/showthread.php?t=84319",
"http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D"]
__email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"]
@@ -111,6 +111,9 @@ History:
-- support ortho mode for VIEWs and VPORTs as cameras
+ v1.12 - 2008.11.16 by migius
+ d1 remove try_finally: cause not supported in python <2.5
+ d1 add Bezier curves bevel radius support (default 1.0)
v1.12 - 2008.08.03 by migius
c2 warningfix: relocating of globals: layersmap, oblist
c2 modif UI: buttons newScene+targetLayer moved to start panel
@@ -299,7 +302,7 @@ History:
import Blender
from Blender import *
#from Blender.Mathutils import Vector, Matrix
-import bpy
+#import bpy #not used yet
#import BPyMessages
from dxfReader import readDXF
@@ -311,7 +314,7 @@ from math import *
try:
import os
- if os.name:# != 'mac':
+ if os.name != 'mac':
import psyco
psyco.log(Blender.Get('tempdir')+"/blender.log-psyco")
#psyco.log()
@@ -320,7 +323,7 @@ try:
psyco.profile(0.2)
#print 'psyco imported'
except ImportError:
- #print 'psyco not imported'
+ print 'psyco not imported'
pass
#try: Curve.orderU
@@ -346,7 +349,7 @@ THIN_RESOLUTION = 8 #(4-64) thin_cylinder arc_resolution - number of segments
MIN_THICK = MIN_DIST * 10.0 #minimal thickness by forced thickness
MIN_WIDTH = MIN_DIST * 10.0 #minimal width by forced width
TRIM_LIMIT = 3.0 #limit for triming of polylines-wide-segments (values:0.0 - 5.0)
-ELEVATION = 0.0 #standard elevation = coordinate Z
+ELEVATION = 0.0 #standard elevation = coordinate Z value
BYBLOCK = 0
BYLAYER = 256
@@ -817,6 +820,7 @@ class Line: #-----------------------------------------------------------------
curve.append(BezTriple.New(points[1]))
for point in curve:
point.handleTypes = [VECT, VECT]
+ point.radius = 1.0
curve.flagU = 0 # 0 sets the curve not cyclic=open
c.setResolu(settings.var['curve_res'])
c.update() #important for handles calculation
@@ -1341,9 +1345,11 @@ class Polyline: #--------------------------------------------------------------
nurbs_points.append(pkt)
firstpoint = nurbs_points[0]
curve = pline.appendNurb(firstpoint)
- curve.setType(4) # set curvetype NURBS
+ curve.setType(4) # set curve_type NURBS
+ print 'deb: dir(curve):', dir(curve[-1]) #----------------
for point in nurbs_points[1:]:
curve.append(point)
+ #TODO: what is the trick for bevel radius? curve[-1].radius = 1.0
if self.closed:
curve.flagU = 1+0 # Set curve cyclic=close and uni
else:
@@ -1359,6 +1365,7 @@ class Polyline: #--------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [AUTO, AUTO]
+ point.radius = 1.0
if self.closed:
curve.flagU = 1 # Set curve cyclic=close
else:
@@ -1380,6 +1387,7 @@ class Polyline: #--------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [AUTO, AUTO]
+ point.radius = 1.0
#curve.setType(1) #Bezier curve
if self.closed:
curve.flagU = 5 #1 # Set curve cyclic=close
@@ -1392,6 +1400,7 @@ class Polyline: #--------------------------------------------------------------
p0h1 = [p0h1[i]+begtangent[i] for i in range(3)]
curve.__setitem__(0,BezTriple.New(p0h1+p0+p0h2))
curve[0].handleTypes = [FREE, ALIGN] #remi--todo-----
+ curve[0].radius = 1.0
if endtangent:
#print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #-----
#print 'deb:polyline2dCurve.draw endtangent:', endtangent #-----
@@ -1401,6 +1410,7 @@ class Polyline: #--------------------------------------------------------------
curve.__setitem__(-1,BezTriple.New(p0h1+p0+p0h2))
#print 'deb:polyline2dCurve.draw curve[-1].vec:', curve[-1].vec #-----
curve[-1].handleTypes = [ALIGN, FREE] #remi--todo-----
+ curve[-1].radius = 1.0
@@ -1420,13 +1430,16 @@ class Polyline: #--------------------------------------------------------------
if i == 0: curve = pline.appendNurb(BezTriple.New(verts[0]))
else: curve.append(BezTriple.New(verts[0]))
curve[-1].handleTypes = [VECT, VECT] #--todo--calculation of bezier-tangents
+ curve[-1].radius = 1.0
for p in verts[1:]:
curve.append(BezTriple.New(p))
curve[-1].handleTypes = [AUTO, AUTO]
+ curve[-1].radius = 1.0
else:
if i == 0: curve = pline.appendNurb(BezTriple.New(point1.loc))
else: curve.append(BezTriple.New(point1.loc))
curve[-1].handleTypes = [VECT, VECT] #--todo--calculation of bezier-tangents
+ curve[-1].radius = 1.0
elif True: #----- optimised Bezier-Handles calculation --------------------------------
#print 'deb:drawPlineCurve: i:', i #---------
@@ -1446,10 +1459,12 @@ class Polyline: #--------------------------------------------------------------
if i == 0: curve = pline.appendNurb(BezTriple.New(VectorTriples[0]))
else: curve.append(BezTriple.New(VectorTriples[0]))
curve[-1].handleTypes = [prevHandleType, FREE]
+ curve[-1].radius = 1.0
for p in VectorTriples[1:-1]:
curve.append(BezTriple.New(p))
curve[-1].handleTypes = [FREE, FREE]
+ curve[-1].radius = 1.0
prevHandleVect = VectorTriples[-1][:3]
prevHandleType = FREE
@@ -1462,11 +1477,13 @@ class Polyline: #--------------------------------------------------------------
curve.append(BezTriple.New(VectorTriples))
curve[-1].handleTypes = [FREE, VECT]
prevHandleType = VECT
+ curve[-1].radius = 1.0
else:
if i == 0: curve = pline.appendNurb(BezTriple.New(point1.loc))
else: curve.append(BezTriple.New(point1.loc))
curve[-1].handleTypes = [VECT, VECT]
-
+ curve[-1].radius = 1.0
+
#print 'deb:drawPlineCurve: curve[-1].vec[0]', curve[-1].vec[0] #----------
@@ -1486,10 +1503,12 @@ class Polyline: #--------------------------------------------------------------
curve.__setitem__(0,BezTriple.New(p0h1+p0+p0h2))
curve[0].handleTypes = [FREE,prevHandleType2]
+ curve[0].radius = 1.0
#print 'deb:drawPlineCurve:closed curve[0].vec:', curve[0].vec #----------
#print 'deb:drawPlineCurve:closed curve[0].handleTypes:', curve[0].handleTypes #----------
else:
curve[0].handleTypes[0] = VECT
+ curve[0].radius = 1.0
else:
curve.flagU = 0 # Set curve not cyclic=open
@@ -2177,9 +2196,10 @@ DXF: X value; APP: 3D point, Y and Z values of control points (in WCS) (one entr
self.ctrlpk_len = getit(obj, 73, 0) # Number of control points
self.fit_pk_len = getit(obj, 74, 0) # Number of fit points (if any)
+ #TODO: import SPLINE as Bezier curve directly, possible?
#print 'deb:Spline self.fit_pk_len=', self.fit_pk_len #------------------------
#self.fit_pk_len = 0 # temp for debug
- if self.fit_pk_len and 'spline_as'==5:
+ if self.fit_pk_len and settings.var['splines_as']==5:
self.spline = False
self.curved = True
else:
@@ -2675,6 +2695,7 @@ class Circle: #----------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [FREE, FREE]
+ point.radius = 1.0
else: # standard version
c = Curve.New(obname) # create new curve data
p1 = (0, -radius, 0)
@@ -2693,6 +2714,7 @@ class Circle: #----------------------------------------------------------------
curve.append(p4)
for point in curve:
point.handleTypes = [AUTO, AUTO]
+ point.radius = 1.0
curve.flagU = 1 # 1 sets the curve cyclic=closed
if settings.var['fill_on']:
@@ -2893,6 +2915,7 @@ class Arc: #-----------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [FREE, FREE]
+ point.radius = 1.0
curve.flagU = 0 # 0 sets the curve not cyclic=open
arc.setResolu(settings.var['curve_res'])
@@ -3449,6 +3472,7 @@ class Ellipse: #---------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [FREE, FREE]
+ point.radius = 1.0
curve.flagU = 1 # 0 sets the curve not cyclic=open
if settings.var['fill_on']:
arc.setFlag(6) # 2+4 set top and button caps
@@ -3459,6 +3483,7 @@ class Ellipse: #---------------------------------------------------------------
curve.append(BezTriple.New(p))
for point in curve:
point.handleTypes = [FREE, FREE]
+ point.radius = 1.0
curve.flagU = 0 # 0 sets the curve not cyclic=open
arc.setResolu(settings.var['curve_res'])
@@ -4397,8 +4422,7 @@ def analyzeDXF(dxfFile): #---------------------------------------
Draw.PupMenu('DXF importer: report saved in INF-file:%t|' + '\'%s\'' %infFile)
except:
Draw.PupMenu('DXF importer: ERROR by writing report in INF-file:%t|' + '\'%s\'' %infFile)
- finally:
- f.close()
+ #finally: f.close()
@@ -4417,7 +4441,8 @@ def main(dxfFile): #---------------#############################-----------
global cur_COUNTER #counter for progress_bar
cur_COUNTER = 0
- try:
+ #try:
+ if 1:
#print "Getting settings..."
global GUI_A, GUI_B, g_scale_as
if not GUI_A['g_scale_on'].val:
@@ -4500,7 +4525,7 @@ def main(dxfFile): #---------------#############################-----------
#settings.write(message)
if UI_MODE: Draw.PupMenu('DXF importer: Done!|finished in %.4f sec.' % time_text)
- finally:
+ #finally:
# restore state even if things didn't work
#print 'deb:drawEntities finally!' #-----------------------
Window.WaitCursor(False)
@@ -5190,6 +5215,7 @@ def drawCurveCircle(circle): #--- no more used --------------------------------
curve.append(p4)
for point in curve:
point.handleTypes = [AUTO, AUTO]
+ point.radius = 1.0
curve.flagU = 1 # Set curve cyclic
c.update()
@@ -5231,6 +5257,7 @@ def drawCurveArc(self): #---- only for ELLIPSE --------------------------------
curve.append(p4)
for point in curve:
point.handleTypes = [AUTO, AUTO]
+ point.radius = 1.0
curve.flagU = 1 # Set curve cyclic
a.update()
@@ -5270,12 +5297,12 @@ GUI_B = {} # GUI-buttons dictionary for drawingTypes
# settings default, initialize ------------------------
points_as_menu = "convert to: %t|empty %x1|mesh.vertex %x2|thin sphere %x3|thin box %x4|*curve.vertex %x5"
-lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
+lines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|thin box %x4|Bezier-curve %x5|*NURBS-curve %x6"
mlines_as_menu = "convert to: %t|*edge %x1|*mesh %x2|*thin cylinder %x3|*thin box %x|*curve %x5"
plines_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
-splines_as_menu = "convert to: %t|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
+splines_as_menu = "convert to: %t|mesh %x2|*thin cylinder %x3|*thin box %x4|*Bezier-curve %x5|NURBS-curve %x6"
plines3_as_menu = "convert to: %t|*edge %x1|mesh %x2|*thin cylinder %x3|*thin box %x4|Bezier-curve %x5|NURBS-curve %x6"
-plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2|NURBS-surface %x6"
+plmesh_as_menu = "convert to: %t|*edge %x1|mesh %x2|*NURBS-surface %x6"
solids_as_menu = "convert to: %t|*edge %x1|mesh %x2"
blocks_as_menu = "convert to: %t|dupliGroup %x1|*real.Group %x2|*exploded %x3"
texts_as_menu = "convert to: %t|text %x1|*mesh %x2|*curve %x5"
@@ -5456,11 +5483,9 @@ def saveConfig(): #--todo-----------------------------------------------
else:
#if BPyMessages.Warning_SaveOver(iniFile): #<- remi find it too abstarct
if sys.exists(iniFile):
- try:
- f = file(iniFile, 'r')
- try: header_str = f.readline()
- finally: f.close()
- except: pass
+ f = file(iniFile, 'r')
+ header_str = f.readline()
+ f.close()
if header_str.startswith(INIFILE_HEADER[0:13]):
if Draw.PupMenu(' OK ? %t|SAVE OVER: ' + '\'%s\'' %iniFile) == 1:
save_ok = True
@@ -5480,10 +5505,9 @@ def saveConfig(): #--todo-----------------------------------------------
output_str = '{\n'.join(output_str.split('{'))
try:
f = file(iniFile, 'w')
- try:
- f.write(INIFILE_HEADER + '\n# this is a comment line\n')
- f.write(output_str)
- finally: f.close()
+ f.write(INIFILE_HEADER + '\n# this is a comment line\n')
+ f.write(output_str)
+ f.close()
#Draw.PupMenu('DXF importer: INI-file: Done!%t|config-data saved in ' + '\'%s\'' %iniFile)
except:
Draw.PupMenu('DXF importer: INI-file: Error!%t|failure by writing to ' + '\'%s\'|no config-data saved!' %iniFile)
@@ -5508,25 +5532,22 @@ def loadConfig(): #remi--todo-----------------------------------------------
update_RegistryKey('iniFileName', iniFile)
#print 'deb:loadConfig iniFile: ', iniFile #----------------------
if iniFile.lower().endswith(INIFILE_EXTENSION) and sys.exists(iniFile):
- try:
- f = file(iniFile, 'r')
- try:
- header_str = f.readline()
- if header_str.startswith(INIFILE_HEADER):
- data_str = f.read()
- f.close()
- #print 'deb:loadConfig data_str from %s: \n' %iniFile , data_str #-----------------
- data = eval(data_str)
- for k, v in data[0].iteritems():
- try: GUI_A[k].val = v
- except: GUI_A[k] = Draw.Create(v)
- for k, v in data[1].iteritems():
- try: GUI_B[k].val = v
- except: GUI_B[k] = Draw.Create(v)
- else:
- Draw.PupMenu('DXF importer: INI-file: Alert!%t|no valid header in INI-file: ' + '\'%s\'' %iniFile)
- finally: f.close()
- except: pass
+ f = file(iniFile, 'r')
+ header_str = f.readline()
+ if header_str.startswith(INIFILE_HEADER):
+ data_str = f.read()
+ f.close()
+ #print 'deb:loadConfig data_str from %s: \n' %iniFile , data_str #-----------------
+ data = eval(data_str)
+ for k, v in data[0].iteritems():
+ try: GUI_A[k].val = v
+ except: GUI_A[k] = Draw.Create(v)
+ for k, v in data[1].iteritems():
+ try: GUI_B[k].val = v
+ except: GUI_B[k] = Draw.Create(v)
+ else:
+ f.close()
+ Draw.PupMenu('DXF importer: INI-file: Alert!%t|no valid header in INI-file: ' + '\'%s\'' %iniFile)
else:
Draw.PupMenu('DXF importer: INI-file: Alert!%t|no valid INI-file selected!')
print "DXF importer: Alert!: no valid INI-file selected."
diff --git a/release/scripts/import_web3d.py b/release/scripts/import_web3d.py
index 9447f15fb79..06cde898ef2 100755
--- a/release/scripts/import_web3d.py
+++ b/release/scripts/import_web3d.py
@@ -48,6 +48,27 @@ def baseName(path):
def dirName(path):
return path[:-len(baseName(path))]
+def imageConvertCompat(path):
+
+ try: import os
+ except:
+ return path
+
+ if path.endswith('.gif'):
+ path_to = path[:-3] + 'png'
+
+ '''
+ if exists(path_to):
+ return path_to
+ '''
+ # print '\n'+path+'\n'+path_to+'\n'
+ os.system('convert "%s" "%s"' % (path, path_to)) # for now just hope we have image magick
+
+ if exists(path_to):
+ return path_to
+
+ return path
+
# notes
# transform are relative
# order dosnt matter for loc/size/rot
@@ -78,6 +99,7 @@ def vrmlFormat(data):
return l
# Most cases accounted for! if we have a comment at the end of the line do this...
+ #j = l.find('url "')
j = l.find('"')
if j == -1: # simple no strings
@@ -96,7 +118,40 @@ def vrmlFormat(data):
data = '\n'.join([strip_comment(l) for l in data.split('\n') ]) # remove all whitespace
+ EXTRACT_STRINGS = True # only needed when strings or filesnames containe ,[]{} chars :/
+
+ if EXTRACT_STRINGS:
+
+ # We need this so we can detect URL's
+ data = '\n'.join([' '.join(l.split()) for l in data.split('\n')]) # remove all whitespace
+ string_ls = []
+
+ #search = 'url "'
+ search = '"'
+
+ ok = True
+ last_i = 0
+ while ok:
+ ok = False
+ i = data.find(search, last_i)
+ if i != -1:
+
+ start = i + len(search) # first char after end of search
+ end = data.find('"', start)
+ if end != -1:
+ item = data[start:end]
+ string_ls.append( item )
+ data = data[:start] + data[end:]
+ ok = True # keep looking
+
+ last_i = end - len(item) + 1
+ # print last_i, item, '|' + data[last_i] + '|'
+
+ # done with messy extracting strings part
+
+
+
# Bad, dont take strings into account
'''
data = data.replace('#', '\n#')
@@ -108,6 +163,27 @@ def vrmlFormat(data):
data = data.replace(']', '\n]\n')
data = data.replace(',', ' , ') # make sure comma's seperate
+ if EXTRACT_STRINGS:
+ # add strings back in
+
+ search = '"' # fill in these empty strings
+
+ ok = True
+ last_i = 0
+ while ok:
+ ok = False
+ i = data.find(search + '"', last_i)
+
+ if i != -1:
+ start = i + len(search) # first char after end of search
+ item = string_ls.pop(0)
+ data = data[:start] + item + data[start:]
+
+ last_i = start + len(item)
+
+ ok = True
+
+
# More annoying obscure cases where USE or DEF are placed on a newline
# data = data.replace('\nDEF ', ' DEF ')
# data = data.replace('\nUSE ', ' USE ')
@@ -199,21 +275,46 @@ def is_numline(i):
'''
Does this line start with a number?
'''
+
+ # Works but too slow.
+ '''
l = lines[i]
+ for w in l.split():
+ if w==',':
+ pass
+ else:
+ try:
+ float(w)
+ return True
+
+ except:
+ return False
+
+ return False
+ '''
+
+ l = lines[i]
+
+ line_start = 0
+
+ if l.startswith(', '):
+ line_start += 2
+
line_end = len(l)-1
- line_end_new = l.find(' ') # comma's always have a space before them
+ line_end_new = l.find(' ', line_start) # comma's always have a space before them
if line_end_new != -1:
line_end = line_end_new
try:
- float(l[:line_end]) # works for a float or int
+ float(l[line_start:line_end]) # works for a float or int
return True
except:
return False
+
class vrmlNode(object):
- __slots__ = 'id', 'fields', 'node_type', 'parent', 'children', 'parent', 'array_data', 'reference', 'lineno', 'filename', 'blendObject', 'DEF_NAMESPACE', 'FIELD_NAMESPACE', 'x3dNode'
+ __slots__ = 'id', 'fields', 'node_type', 'parent', 'children', 'parent', 'array_data', 'reference', 'lineno', 'filename', 'blendObject', 'DEF_NAMESPACE', 'ROUTE_IPO_NAMESPACE', 'FIELD_NAMESPACE', 'x3dNode'
def __init__(self, parent, node_type, lineno):
self.id = None
self.node_type = node_type
@@ -231,6 +332,7 @@ class vrmlNode(object):
# Store in the root node because each inline file needs its own root node and its own namespace
self.DEF_NAMESPACE = None
+ self.ROUTE_IPO_NAMESPACE = None
self.FIELD_NAMESPACE = None
self.reference = None
@@ -257,12 +359,25 @@ class vrmlNode(object):
return self.DEF_NAMESPACE
else:
return self.parent.getDefDict()
+
+ def getRouteIpoDict(self):
+ if self.ROUTE_IPO_NAMESPACE != None:
+ return self.ROUTE_IPO_NAMESPACE
+ else:
+ return self.parent.getRouteIpoDict()
def setRoot(self, filename):
self.filename = filename
- self.FIELD_NAMESPACE = {}
- self.DEF_NAMESPACE= {}
-
+ self.FIELD_NAMESPACE = {}
+ self.DEF_NAMESPACE = {}
+ self.ROUTE_IPO_NAMESPACE = {}
+
+ def isRoot(self):
+ if self.filename == None:
+ return False
+ else:
+ return True
+
def getFilename(self):
if self.filename:
return self.filename
@@ -284,6 +399,11 @@ class vrmlNode(object):
except:
return None
+ def getPrefix(self):
+ if self.id:
+ return self.id[0]
+ return None
+
def getDefName(self):
self_real = self.getRealNode()
@@ -464,11 +584,13 @@ class vrmlNode(object):
child_array = None
for child in self_real.children:
+ # print "ID IS", child.id
if child.id and len(child.id) == 1 and child.id[0] == field:
child_array = child
break
if child_array==None:
+
# For x3d, should work ok with vrml too
# for x3d arrays are fields, vrml they are nodes, annoying but not tooo bad.
data_split = self.getFieldName(field)
@@ -489,9 +611,12 @@ class vrmlNode(object):
print '\tWarning, could not parse array data from field'
array_data = []
else:
-
+ # print child_array
# Normal vrml
array_data = child_array.array_data
+
+
+ # print 'array_data', array_data
if group==-1 or len(array_data)==0:
return array_data
@@ -520,8 +645,6 @@ class vrmlNode(object):
# We requested a flat array
if group == 0:
return flat_array
-
-
new_array = []
sub_array = []
@@ -537,6 +660,30 @@ class vrmlNode(object):
return new_array
+ def getFieldAsStringArray(self, field):
+ '''
+ Get a list of strings
+ '''
+ self_real = self.getRealNode() # incase we're an instance
+
+ child_array = None
+ for child in self_real.children:
+ if child.id and len(child.id) == 1 and child.id[0] == field:
+ child_array = child
+ break
+ if not child_array:
+ return []
+
+ # each string gets its own list, remove ""'s
+ try:
+ new_array = [f[0][1:-1] for f in child_array.fields]
+ except:
+ print '\twarning, string array could not be made'
+ new_array = []
+
+ return new_array
+
+
def getLevel(self):
# Ignore self_real
level = 0
@@ -564,19 +711,24 @@ class vrmlNode(object):
else:
text = ''
- text += ind + 'ID: ' + str(self.id) + ' ' + str(level) + ('lineno %d\n' % self.lineno)
+ text += ind + 'ID: ' + str(self.id) + ' ' + str(level) + (' lineno %d\n' % self.lineno)
if self.node_type==NODE_REFERENCE:
+ text += ind + "(reference node)\n"
return text
- for item in self.fields:
+ text += ind + 'FIELDS:\n'
+
+ for i,item in enumerate(self.fields):
+ text += ind + 'FIELD:\n'
text += ind + str(item) +'\n'
#text += ind + 'ARRAY: ' + str(len(self.array_data)) + ' ' + str(self.array_data) + '\n'
text += ind + 'ARRAY: ' + str(len(self.array_data)) + '[...] \n'
text += ind + 'CHILDREN: ' + str(len(self.children)) + '\n'
- for child in self.children:
+ for i, child in enumerate(self.children):
+ text += ind + ('CHILD%d:\n' % i)
text += str(child)
text += '\n' + ind + brackets[1]
@@ -590,12 +742,24 @@ class vrmlNode(object):
# If we were an inline then try load the file
if self.node_type == NODE_NORMAL and self.getSpec() == 'Inline':
+
url = self.getFieldAsString('url', None)
if url != None:
- if not exists(url):
- url = dirName(self.getFilename()) + baseName(url)
- if not exists(url):
+ urls = []
+ urls.append( url )
+ urls.append( BPySys.caseInsensitivePath(urls[-1]) )
+
+ urls.append( dirName(self.getFilename()) + baseName(url) )
+ urls.append( BPySys.caseInsensitivePath(urls[-1]) )
+
+ try:
+ url = [url for url in urls if exists(url)][0]
+ url_found = True
+ except:
+ url_found = False
+
+ if not url_found:
print '\tWarning: Inline URL could not be found:', url
else:
if url==self.getFilename():
@@ -603,12 +767,12 @@ class vrmlNode(object):
else:
try:
- f = open(url, 'rU')
+ data = gzipOpen(url)
except:
print '\tWarning: cant open the file:', url
- f = None
+ data = None
- if f:
+ if data:
# Tricky - inline another VRML
print '\tLoading Inline:"%s"...' % url
@@ -616,12 +780,15 @@ class vrmlNode(object):
lines_old = lines[:]
- lines[:] = vrmlFormat( f.read() )
- f.close()
+ lines[:] = vrmlFormat( data )
lines.insert(0, '{')
lines.insert(0, 'root_node____')
lines.append('}')
+ '''
+ ff = open('/test.txt', 'w')
+ ff.writelines([l+'\n' for l in lines])
+ '''
child = vrmlNode(self, NODE_NORMAL, -1)
child.setRoot(url) # initialized dicts
@@ -723,7 +890,9 @@ class vrmlNode(object):
values = l_split
# This should not extend over multiple lines however it is possible
- self.array_data.extend( values )
+ # print self.array_data
+ if values:
+ self.array_data.extend( values )
i+=1
else:
words = l.split()
@@ -843,12 +1012,12 @@ def vrml_parse(path):
lines.insert(0, '{')
lines.insert(0, 'dymmy_node')
lines.append('}')
-
# Use for testing our parsed output, so we can check on line numbers.
- ## ff = open('m:\\test.txt', 'w')
- ## ff.writelines([l+'\n' for l in lines])
-
+ '''
+ ff = open('/test.txt', 'w')
+ ff.writelines([l+'\n' for l in lines])
+ '''
# Now evaluate it
node_type, new_i = is_nodeline(0, [])
@@ -866,9 +1035,14 @@ def vrml_parse(path):
# Parse recursively
root.parse(0)
- # print root
+ # This prints a load of text
+ '''
+ print root
+ '''
+
return root, ''
+
# ====================== END VRML
@@ -996,6 +1170,9 @@ for i, f in enumerate(files):
# -----------------------------------------------------------------------------------
import bpy
import BPyImage
+import BPySys
+reload(BPySys)
+reload(BPyImage)
import Blender
from Blender import Texture, Material, Mathutils, Mesh, Types, Window
from Blender.Mathutils import TranslationMatrix
@@ -1090,6 +1267,7 @@ def translateTexTransform(node):
return new_mat
+
def getFinalMatrix(node, mtx, ancestry):
transform_nodes = [node_tx for node_tx in ancestry if node_tx.getSpec() == 'Transform']
@@ -1343,7 +1521,8 @@ def importMesh_IndexedFaceSet(geom, bpyima):
if len(ifs_vcol) < color_index:
c.r, c.g, c.b = ifs_vcol[color_index]
else:
- print '\tWarning: per face color index out of range'
+ #print '\tWarning: per face color index out of range'
+ pass
else:
if vcolor_spot: # use 1 color, when ifs_vcol is []
for c in fcol:
@@ -1517,6 +1696,9 @@ def importShape(node, ancestry):
bpymat = None
bpyima = None
texmtx = None
+
+ depth = 0 # so we can set alpha face flag later
+
if appr:
#mat = appr.getChildByName('material') # 'Material'
@@ -1561,12 +1743,17 @@ def importShape(node, ancestry):
if ima:
- # print ima
+
ima_url = ima.getFieldAsString('url')
+
+ if ima_url==None:
+ try: ima_url = ima.getFieldAsStringArray('url')[0] # in some cases we get a list of images.
+ except: ima_url = None
+
if ima_url==None:
print "\twarning, image with no URL, this is odd"
else:
- bpyima= BPyImage.comprehensiveImageLoad(ima_url, dirName(node.getFilename()), PLACE_HOLDER= False, RECURSIVE= False)
+ bpyima= BPyImage.comprehensiveImageLoad(ima_url, dirName(node.getFilename()), PLACE_HOLDER= False, RECURSIVE= False, CONVERT_CALLBACK= imageConvertCompat)
if bpyima:
texture= bpy.data.textures.new()
texture.setType('Image')
@@ -1588,7 +1775,8 @@ def importShape(node, ancestry):
ima_repS = ima.getFieldAsBool('repeatS', True)
ima_repT = ima.getFieldAsBool('repeatT', True)
- texture.repeat = max(1, ima_repS * 512), max(1, ima_repT * 512)
+ # To make this work properly we'd need to scale the UV's too, better to ignore th
+ # texture.repeat = max(1, ima_repS * 512), max(1, ima_repT * 512)
if not ima_repS: bpyima.clampX = True
if not ima_repT: bpyima.clampY = True
@@ -1632,15 +1820,22 @@ def importShape(node, ancestry):
# Only ever 1 material per shape
if bpymat: bpydata.materials = [bpymat]
- if bpydata.faceUV and texmtx:
- # Apply texture transform?
- uv_copy = Vector()
- for f in bpydata.faces:
- for uv in f.uv:
- uv_copy.x = uv.x
- uv_copy.y = uv.y
-
- uv.x, uv.y = (uv_copy * texmtx)[0:2]
+ if bpydata.faceUV:
+
+ if depth==32: # set the faces alpha flag?
+ transp = Mesh.FaceTranspModes.ALPHA
+ for f in bpydata.faces:
+ f.transp = transp
+
+ if texmtx:
+ # Apply texture transform?
+ uv_copy = Vector()
+ for f in bpydata.faces:
+ for uv in f.uv:
+ uv_copy.x = uv.x
+ uv_copy.y = uv.y
+
+ uv.x, uv.y = (uv_copy * texmtx)[0:2]
# Done transforming the texture
@@ -1733,7 +1928,7 @@ def importLamp_SpotLight(node):
# Convert
# lamps have their direction as -z, y==up
- mtx = TranslationMatrix(Vector(location)) * Vector(direction).toTrackQuat('-z', 'y').toMatrix().resize4x4()
+ mtx = Vector(direction).toTrackQuat('-z', 'y').toMatrix().resize4x4() * TranslationMatrix(Vector(location))
return bpylamp, mtx
@@ -1760,14 +1955,14 @@ def importViewpoint(node, ancestry):
fieldOfView = node.getFieldAsFloat('fieldOfView', 0.785398) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
# jump = node.getFieldAsBool('jump', True)
orientation = node.getFieldAsFloatTuple('orientation', (0.0, 0.0, 1.0, 0.0))
- position = node.getFieldAsFloatTuple('position', (0.0, 0.0, 10.0))
+ position = node.getFieldAsFloatTuple('position', (0.0, 0.0, 0.0))
description = node.getFieldAsString('description', '')
bpycam = bpy.data.cameras.new(name)
bpycam.angle = fieldOfView
- mtx = TranslationMatrix(Vector(position)) * translateRotation(orientation) * MATRIX_Z_TO_Y
+ mtx = translateRotation(orientation) * TranslationMatrix(Vector(position))
bpyob = node.blendObject = bpy.data.scenes.active.objects.new(bpycam)
@@ -1781,6 +1976,149 @@ def importTransform(node, ancestry):
bpyob = node.blendObject = bpy.data.scenes.active.objects.new('Empty', name) # , name)
bpyob.setMatrix( getFinalMatrix(node, None, ancestry) )
+
+#def importTimeSensor(node):
+
+
+def translatePositionInterpolator(node, ipo):
+ key = node.getFieldAsArray('key', 0)
+ keyValue = node.getFieldAsArray('keyValue', 3)
+
+ loc_x = ipo.addCurve('LocX')
+ loc_y = ipo.addCurve('LocY')
+ loc_z = ipo.addCurve('LocZ')
+
+ loc_x.interpolation = loc_y.interpolation = loc_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
+
+ for i, time in enumerate(key):
+ x,y,z = keyValue[i]
+
+ loc_x.append((time,x))
+ loc_y.append((time,y))
+ loc_z.append((time,z))
+
+def translateOrientationInterpolator(node, ipo):
+ key = node.getFieldAsArray('key', 0)
+ keyValue = node.getFieldAsArray('keyValue', 4)
+
+ rot_x = ipo.addCurve('RotX')
+ rot_y = ipo.addCurve('RotY')
+ rot_z = ipo.addCurve('RotZ')
+
+ rot_x.interpolation = rot_y.interpolation = rot_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
+
+ for i, time in enumerate(key):
+
+ mtx = translateRotation(keyValue[i])
+ eul = mtx.toEuler()
+ rot_x.append((time,eul.x/10.0))
+ rot_y.append((time,eul.y/10.0))
+ rot_z.append((time,eul.z/10.0))
+
+# Untested!
+def translateScalarInterpolator(node, ipo):
+ key = node.getFieldAsArray('key', 0)
+ keyValue = node.getFieldAsArray('keyValue', 4)
+
+ sca_x = ipo.addCurve('SizeX')
+ sca_y = ipo.addCurve('SizeY')
+ sca_z = ipo.addCurve('SizeZ')
+
+ sca_x.interpolation = sca_y.interpolation = sca_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
+
+ for i, time in enumerate(key):
+ x,y,z = keyValue[i]
+ sca_x.append((time,x/10.0))
+ sca_y.append((time,y/10.0))
+ sca_z.append((time,z/10.0))
+
+def translateTimeSensor(node, ipo):
+ '''
+ Apply a time sensor to an IPO, VRML has many combinations of loop/start/stop/cycle times
+ to give different results, for now just do the basics
+ '''
+
+ time_cu = ipo.addCurve('Time')
+ time_cu.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
+
+ cycleInterval = node.getFieldAsFloat('cycleInterval', None)
+
+ startTime = node.getFieldAsFloat('startTime', 0.0)
+ stopTime = node.getFieldAsFloat('stopTime', 250.0)
+
+ if cycleInterval != None:
+ stopTime = startTime+cycleInterval
+
+ loop = node.getFieldAsBool('loop', False)
+
+ time_cu.append((1+startTime, 0.0))
+ time_cu.append((1+stopTime, 1.0/10.0))# anoying, the UI uses /10
+
+
+ if loop:
+ time_cu.extend = Blender.IpoCurve.ExtendTypes.CYCLIC # or - EXTRAP, CYCLIC_EXTRAP, CONST,
+
+
+def importRoute(node):
+ '''
+ Animation route only at the moment
+ '''
+
+ routeIpoDict = node.getRouteIpoDict()
+
+ def getIpo(id):
+ try: ipo = routeIpoDict[id]
+ except: ipo = routeIpoDict[id] = bpy.data.ipos.new('web3d_ipo', 'Object')
+ return ipo
+
+ # for getting definitions
+ defDict = node.getDefDict()
+ '''
+ Handles routing nodes to eachother
+
+ROUTE vpPI.value_changed TO champFly001.set_position
+ROUTE vpOI.value_changed TO champFly001.set_orientation
+ROUTE vpTs.fraction_changed TO vpPI.set_fraction
+ROUTE vpTs.fraction_changed TO vpOI.set_fraction
+ROUTE champFly001.bindTime TO vpTs.set_startTime
+ '''
+
+ #from_id, from_type = node.id[1].split('.')
+ #to_id, to_type = node.id[3].split('.')
+
+ #value_changed
+ set_position_node = None
+ set_orientation_node = None
+ time_node = None
+
+ for field in node.fields:
+ if field and field[0]=='ROUTE':
+ from_id, from_type = field[1].split('.')
+ to_id, to_type = field[3].split('.')
+
+ if from_type == 'value_changed':
+ if to_type == 'set_position':
+ ipo = getIpo(to_id)
+ set_data_from_node = defDict[from_id]
+ translatePositionInterpolator(set_data_from_node, ipo)
+
+ if to_type == 'set_orientation':
+ ipo = getIpo(to_id)
+ set_data_from_node = defDict[from_id]
+ translateOrientationInterpolator(set_data_from_node, ipo)
+
+ if to_type == 'set_scale':
+ ipo = getIpo(to_id)
+ set_data_from_node = defDict[from_id]
+ translateScalarInterpolator(set_data_from_node, ipo)
+
+ elif from_type == 'bindTime':
+ ipo = getIpo(from_id)
+ time_node = defDict[to_id]
+ translateTimeSensor(time_node, ipo)
+
+
+
def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16, HELPER_FUNC = None):
@@ -1818,14 +2156,44 @@ def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16, HELPER_FUNC = None):
elif spec=='Transform':
# Only use transform nodes when we are not importing a flat object hierarchy
if PREF_FLAT==False:
- importTransform(node, ancestry)
- else:
+ importTransform(node, ancestry)
+ '''
+ # These are delt with later within importRoute
+ elif spec=='PositionInterpolator':
+ ipo = bpy.data.ipos.new('web3d_ipo', 'Object')
+ translatePositionInterpolator(node, ipo)
+ '''
+ else:
# Note, include this function so the VRML/X3D importer can be extended
# by an external script.
if HELPER_FUNC:
HELPER_FUNC(node, ancestry)
+
+
+
+ # After we import all nodes, route events - anim paths
+ for node, ancestry in all_nodes:
+ importRoute(node)
+
+ for node, ancestry in all_nodes:
+ if node.isRoot():
+ # we know that all nodes referenced from will be in
+ # routeIpoDict so no need to run node.getDefDict() for every node.
+ routeIpoDict = node.getRouteIpoDict()
+ defDict = node.getDefDict()
+ for key, ipo in routeIpoDict.iteritems():
+
+ # Assign anim curves
+ node = defDict[key]
+ if node.blendObject==None: # Add an object if we need one for animation
+ node.blendObject = bpy.data.scenes.active.objects.new('Empty', 'AnimOb') # , name)
+
+ node.blendObject.setIpo(ipo)
+
+
+
# Add in hierarchy
if PREF_FLAT==False:
child_dict = {}
@@ -1886,7 +2254,7 @@ def load_ui(path):
if __name__ == '__main__':
Window.FileSelector(load_ui, 'Import X3D/VRML97')
-
+
# Testing stuff
# load_web3d('/test.x3d')
diff --git a/source/Makefile b/source/Makefile
index 662cb1df0a6..fe48b26c14c 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -74,7 +74,7 @@ endif
# Note: the order is important here
GRPLIB = $(OCGDIR)/creator/$(DEBUG_DIR)libcreator.a
-GRPLIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
+GRPLIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a
GRPLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
GRPLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
@@ -84,7 +84,6 @@ GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a
GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a
GRPLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a
-GRPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
# nlin: the reason that some libraries appear more than once below is
# to handle circular dependencies in linking among libraries... some
@@ -156,6 +155,7 @@ ifneq ($(NAN_NO_KETSJI),true)
COMLIB += $(NAN_BULLET2)/lib/libbullet2.a
endif
+COMLIB += $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)libdna.a
COMLIB += $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
COMLIB += $(NAN_MEMUTIL)/lib/libmemutil.a
COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a
@@ -194,7 +194,7 @@ ifeq ($(WITH_FREETYPE2), true)
else
COMLIB += $(NAN_FTGL)/lib/libftgl.a
ifeq ($(OS), irix)
- COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a
+ COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
else
COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
endif
@@ -230,10 +230,33 @@ ifeq ($(WITH_OPENEXR), true)
COMLIB += $(NAN_OPENEXR_LIBS)
endif
+# note: space_api.a in begin of editors, screen.a in end
PULIB = $(NAN_MOTO)/lib/libmoto.a
PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
-PULIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
+PULIB += $(OCGDIR)/blender/ed_space/libed_space.a
+PULIB += $(OCGDIR)/blender/ed_sound/libed_sound.a
+PULIB += $(OCGDIR)/blender/ed_action/libed_action.a
+PULIB += $(OCGDIR)/blender/ed_nla/libed_nla.a
+PULIB += $(OCGDIR)/blender/ed_script/libed_script.a
+PULIB += $(OCGDIR)/blender/ed_text/libed_text.a
+PULIB += $(OCGDIR)/blender/ed_sequencer/libed_sequencer.a
+PULIB += $(OCGDIR)/blender/ed_file/libed_file.a
+PULIB += $(OCGDIR)/blender/ed_info/libed_info.a
+PULIB += $(OCGDIR)/blender/ed_buttons/libed_buttons.a
+PULIB += $(OCGDIR)/blender/ed_node/libed_node.a
+PULIB += $(OCGDIR)/blender/ed_image/libed_image.a
+PULIB += $(OCGDIR)/blender/ed_ipo/libed_ipo.a
+PULIB += $(OCGDIR)/blender/ed_outliner/libed_outliner.a
+PULIB += $(OCGDIR)/blender/ed_time/libed_time.a
+PULIB += $(OCGDIR)/blender/ed_view3d/libed_view3d.a
+PULIB += $(OCGDIR)/blender/ed_interface/libed_interface.a
+PULIB += $(OCGDIR)/blender/ed_util/libed_util.a
+PULIB += $(OCGDIR)/blender/ed_datafiles/libed_datafiles.a
+PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
+PULIB += $(OCGDIR)/blender/windowmanager/libwindowmanager.a
+PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
+PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
ifeq ($(NAN_NO_KETSJI),true)
PULIB += $(NAN_MOTO)/lib/libmoto.a
@@ -248,13 +271,12 @@ SPLIB1 += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
SPLIB1 += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
SPLIB1 += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
-SPLIB = $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)DNA.o
-SPLIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
+SPLIB = $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
# this is used for the plugin. It uses some things from libz.a,
# but somehow it consistently fails to resolve these symbols... or
# can I just not check them? nm claims they aren't...
SPLIB += $(OCGDIR)/blender/blenkernel/blenkernel_blc/$(DEBUG_DIR)libblenkernel_blc.a
-SPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
+SPLIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a
# These three need to be explicitly mentioned on the cl, because
# if they are offered as a lib, they are optimized away. (nzc)
@@ -395,9 +417,16 @@ else
NAN_SND_LIBS += $(ALUT)
NAN_SND_LIBS += $(SOUNDSYSTEM)
else
- NAN_SND_LIBS = $(SOUNDSYSTEM)
- NAN_SND_LIBS += $(DUMMYSOUND)
- NAN_SND_LIBS += $(SOUNDSYSTEM)
+ ifeq ($(OS), irix)
+ NAN_SND_LIBS = $(SOUNDSYSTEM)
+ NAN_SND_LIBS += $(DUMMYSOUND)
+ NAN_SND_LIBS += $(SDLSOUND)
+ NAN_SND_LIBS += $(SOUNDSYSTEM)
+ else
+ NAN_SND_LIBS = $(SOUNDSYSTEM)
+ NAN_SND_LIBS += $(DUMMYSOUND)
+ NAN_SND_LIBS += $(SOUNDSYSTEM)
+ endif
endif
endif
endif
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 007ee34e4e7..47b04b1df78 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SUBDIRS(avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon gpu makesdna python radiosity readblenfile render src yafray)
+SUBDIRS(windowmanager editors avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon gpu makesdna makesrna python radiosity readblenfile render yafray)
IF(WITH_INTERNATIONAL)
SUBDIRS(ftfont)
diff --git a/source/blender/Makefile b/source/blender/Makefile
index 52abd2cdddb..37d647788d0 100644
--- a/source/blender/Makefile
+++ b/source/blender/Makefile
@@ -30,9 +30,9 @@
include nan_definitions.mk
-DIRS = blenloader readblenfile
+DIRS = windowmanager editors blenloader readblenfile
DIRS += avi imbuf render radiosity blenlib blenkernel blenpluginapi
-DIRS += makesdna src yafray
+DIRS += makesdna makesrna yafray
DIRS += python nodes gpu
ifeq ($(WITH_FREETYPE2), true)
diff --git a/source/blender/SConscript b/source/blender/SConscript
index 543a0bf5ed6..93acf8a8430 100644
--- a/source/blender/SConscript
+++ b/source/blender/SConscript
@@ -8,14 +8,16 @@ SConscript(['avi/SConscript',
'blenloader/SConscript',
'blenpluginapi/SConscript',
'gpu/SConscript',
+ 'editors/SConscript',
'imbuf/SConscript',
'imbuf/intern/cineon/SConscript',
'makesdna/SConscript',
+ 'makesrna/SConscript',
'radiosity/SConscript',
'readblenfile/SConscript',
'render/SConscript',
- 'src/SConscript',
- 'nodes/SConscript'])
+ 'nodes/SConscript',
+ 'windowmanager/SConscript'])
diff --git a/source/blender/blenkernel/BKE_bad_level_calls.h b/source/blender/blenkernel/BKE_bad_level_calls.h
deleted file mode 100644
index 93bfb2339be..00000000000
--- a/source/blender/blenkernel/BKE_bad_level_calls.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
- * blenlib/BKE_bad_level_calls.h (mar-2001 nzc)
- *
- * Stuff that definitely does not belong in the kernel! These will all
- * have to be removed in order to restore sanity.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef BKE_BAD_LEVEL_CALLS_H
-#define BKE_BAD_LEVEL_CALLS_H
-
-/* blender.c */
-void freeAllRad(void);
-void free_editText(void);
-void free_vertexpaint(void);
-
-/* readfile.c */
-struct SpaceButs;
-void set_rects_butspace(struct SpaceButs *buts);
-struct SpaceImaSel;
-void check_imasel_copy(struct SpaceImaSel *simasel);
-struct ScrArea;
-struct bScreen;
-void unlink_screen(struct bScreen *sc);
-void setscreen(struct bScreen *sc);
-void force_draw_all(int);
- /* otherwise the WHILE_SEQ doesn't work */
-struct Sequence;
-struct ListBase;
-void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq);
-
-/* BPython API */
-struct ID;
-struct Script;
-struct Text;
-struct IpoDriver; /* DNA_curve_types.h */
-struct Object;
-struct PyObject;
-struct Node_Type;
-struct BPy_Node;
-struct bNode;
-struct bNodeStack;
-struct ShadeInput;
-struct bPythonConstraint;
-struct bConstraintOb;
-struct bConstraintTarget;
-void BPY_do_pyscript (struct ID *id, short int event);
-void BPY_clear_script (struct Script *script);
-void BPY_free_compiled_text (struct Text *text);
-/* pydrivers */
-struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver);
-float BPY_pydriver_eval(struct IpoDriver *driver);
-void BPY_pydriver_update(void);
-/* button python evaluation */
-int BPY_button_eval(char *expr, double *value);
-/* pyconstraints */
-void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
-void BPY_pyconstraint_targets(struct bPythonConstraint *con, struct bConstraintTarget *ct);
-/* pynodes */
-int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value);
-void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type);
-void InitNode(struct BPy_Node *self, struct bNode *node);
-void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi);
-struct BPy_NodeSockets *Node_CreateSocketLists(struct bNode *node);
-int pytype_is_pynode(struct PyObject *pyob);
-/* writefile.c */
-struct Oops;
-void free_oops(struct Oops *oops);
-void error(char *str, ...);
-
-/* anim.c */
-extern struct ListBase editNurb;
-
-void mainqenter (unsigned short event, short val);
-void waitcursor(int);
-void allqueue(unsigned short event, short val);
-#define REDRAWVIEW3D 0x4010
-#define REDRAWBUTSOBJECT 0x4018
-#define REDRAWBUTSEDIT 0x4019
-struct Material;
-extern struct Material defmaterial;
-
-
-/* exotic.c */
-void load_editMesh(void);
-void make_editMesh(void);
-struct EditMesh;
-void free_editMesh(struct EditMesh *);
-void free_editArmature(void);
-void docenter_new(void);
-int saveover(char *str);
-
-/* ipo.c */
-void copy_view3d_lock(short val); // was a hack, to make scene layer ipo's possible
-
-/* library.c */
-void allspace(unsigned short event, short val) ;
-#define OOPS_TEST 2
-
-/* mball.c */
-extern struct ListBase editelems;
-
-/* object.c */
-struct ScriptLink;
-void BPY_free_scriptlink(struct ScriptLink *slink);
-void BPY_copy_scriptlink(struct ScriptLink *scriptlink);
-float *give_cursor(void); // become a callback or argument
-void exit_posemode(int freedata);
-
-/* packedFile.c */
-short pupmenu(char *instr); // will be general callback
-
-/* sca.c */
-#define LEFTMOUSE 0x001 // because of mouse sensor
-
-/* scene.c */
-#include "DNA_sequence_types.h"
-void free_editing(struct Editing *ed); // scenes and sequences problem...
-void BPY_do_all_scripts (short int event, short int anim);
-int BPY_call_importloader(char *name);
-
-
-extern char texstr[20][12]; /* buttons.c */
-
-
-/* editsca.c */
-void make_unique_prop_names(char *str);
-
-/* DerivedMesh.c */
-void bglBegin(int mode);
-void bglVertex3fv(float *vec);
-void bglVertex3f(float x, float y, float z);
-void bglEnd(void);
-
-struct Object;
-
-/* booleanops.c */
-struct DerivedMesh *NewBooleanDerivedMesh(struct Object *ob,
- struct Object *ob_select, int int_op_type);
-
-/* verse_*.c */
-struct VerseVert;
-struct VerseFace;
-struct VerseSession;
-struct VNode;
-struct VTag;
-struct VTagGroup;
-struct VBitmapLayer;
-struct VLink;
-struct VLayer;
-struct Mesh;
-
-void post_vertex_create(struct VerseVert *vvert);
-void post_vertex_set_xyz(struct VerseVert *vvert);
-void post_vertex_delete(struct VerseVert *vvert);
-void post_vertex_free_constraint(struct VerseVert *vvert);
-void post_polygon_create(struct VerseFace *vface);
-void post_polygon_set_corner(struct VerseFace *vface);
-void post_polygon_delete(struct VerseFace *vface);
-void post_polygon_free_constraint(struct VerseFace *vface);
-void post_polygon_set_uint8(struct VerseFace *vface);
-void post_node_create(struct VNode *vnode);
-void post_node_destroy(struct VNode *vnode);
-void post_node_name_set(struct VNode *vnode);
-void post_tag_change(struct VTag *vtag);
-void post_taggroup_create(struct VTagGroup *vtaggroup);
-char *verse_client_name(void);
-void post_transform(struct VNode *vnode);
-void post_transform_pos(struct VNode *vnode);
-void post_transform_rot(struct VNode *vnode);
-void post_transform_scale(struct VNode *vnode);
-void post_object_free_constraint(struct VNode *vnode);
-void post_link_set(struct VLink *vlink);
-void post_link_destroy(struct VLink *vlink);
-void post_connect_accept(struct VerseSession *session);
-void post_connect_terminated(struct VerseSession *session);
-void post_connect_update(struct VerseSession *session);
-void add_screenhandler(struct bScreen *sc, short eventcode, short val);
-void post_bitmap_dimension_set(struct VNode *vnode);
-void post_bitmap_layer_create(struct VBitmapLayer *vblayer);
-void post_bitmap_layer_destroy(struct VBitmapLayer *vblayer);
-void post_bitmap_tile_set(struct VBitmapLayer *vblayer, unsigned int xs, unsigned int ys);
-void create_meshdata_from_geom_node(struct Mesh *me, struct VNode *vnode);
-void post_geometry_free_constraint(struct VNode *vnode);
-void post_layer_create(struct VLayer *vlayer);
-void post_layer_destroy(struct VLayer *vlayer);
-void post_server_add(void);
-
-/* zbuf.c */
-void antialias_tagbuf(int xsize, int ysize, char *rectmove);
-
-/* imagetexture.c */
-void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result);
-
-/* modifier.c */
-struct MeshDeformModifierData;
-
-void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
- float (*vertexcos)[3], int totvert, float cagemat[][4]);
-
-/* particle.c */
-struct ParticleSystem;
-
-void PE_free_particle_edit(struct ParticleSystem *psys);
-void PE_get_colors(char sel[4], char nosel[4]);
-void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys);
-
-/* texture.c */
-struct Tex;
-struct TexResult;
-int multitex_thread(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output);
-
-
-
-#endif
-
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index f392d57521c..5eb3de4404e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -39,18 +39,18 @@ extern "C" {
struct ListBase;
struct MemFile;
+struct bContext;
-#define BLENDER_VERSION 248
-#define BLENDER_SUBVERSION 1
+#define BLENDER_VERSION 250
+#define BLENDER_SUBVERSION 0
-#define BLENDER_MINVERSION 245
-#define BLENDER_MINSUBVERSION 15
+#define BLENDER_MINVERSION 250
+#define BLENDER_MINSUBVERSION 0
-int BKE_read_file(char *dir, void *type_r);
-int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r);
-int BKE_read_file_from_memfile(struct MemFile *memfile);
+int BKE_read_file(struct bContext *C, char *dir, void *type_r);
+int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, void *type_r);
+int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile);
-void duplicatelist(struct ListBase *list1, struct ListBase *list2);
void free_blender(void);
void initglobals(void);
@@ -61,11 +61,11 @@ void free_pushpop(void);
void pushpop_test(void);
/* global undo */
-extern void BKE_write_undo(char *name);
-extern void BKE_undo_step(int step);
+extern void BKE_write_undo(struct bContext *C, char *name);
+extern void BKE_undo_step(struct bContext *C, int step);
extern void BKE_reset_undo(void);
extern char *BKE_undo_menu_string(void);
-extern void BKE_undo_number(int nr);
+extern void BKE_undo_number(struct bContext *C, int nr);
extern void BKE_undo_save_quit(void);
#ifdef __cplusplus
diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h
index 8ec7144faf6..71c042e34fe 100644
--- a/source/blender/blenkernel/BKE_bmesh.h
+++ b/source/blender/blenkernel/BKE_bmesh.h
@@ -44,7 +44,7 @@
#include "DNA_image_types.h"
#include "BLI_editVert.h"
#include "BKE_DerivedMesh.h"
-#include "transform.h"
+//XXX #include "transform.h"
/*forward declerations*/
struct BME_Vert;
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index f1f4653f092..398d203709f 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -53,6 +53,7 @@ int brush_clone_image_delete(struct Brush *brush);
/* sampling */
float brush_sample_falloff(struct Brush *brush, float dist);
+float brush_sample_falloff_noalpha(struct Brush *brush, float dist);
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
struct ImBuf **imbuf);
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index c84b690bc49..10791968f79 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -198,8 +198,12 @@ int CustomData_get_layer_index(const struct CustomData *data, int type);
int CustomData_get_named_layer_index(const struct CustomData *data, int type, char *name);
int CustomData_get_active_layer_index(const struct CustomData *data, int type);
int CustomData_get_render_layer_index(const struct CustomData *data, int type);
+int CustomData_get_clone_layer_index(const struct CustomData *data, int type);
+int CustomData_get_mask_layer_index(const struct CustomData *data, int type);
int CustomData_get_active_layer(const struct CustomData *data, int type);
int CustomData_get_render_layer(const struct CustomData *data, int type);
+int CustomData_get_clone_layer(const struct CustomData *data, int type);
+int CustomData_get_mask_layer(const struct CustomData *data, int type);
/* copies the data from source to the data element at index in the first
* layer of type
@@ -227,10 +231,14 @@ void *CustomData_set_layer_n(const struct CustomData *data, int type, int n, voi
/* sets the nth layer of type as active */
void CustomData_set_layer_active(struct CustomData *data, int type, int n);
void CustomData_set_layer_render(struct CustomData *data, int type, int n);
+void CustomData_set_layer_clone(struct CustomData *data, int type, int n);
+void CustomData_set_layer_mask(struct CustomData *data, int type, int n);
/* same as above but works with an index from CustomData_get_layer_index */
void CustomData_set_layer_active_index(struct CustomData *data, int type, int n);
void CustomData_set_layer_render_index(struct CustomData *data, int type, int n);
+void CustomData_set_layer_clone_index(struct CustomData *data, int type, int n);
+void CustomData_set_layer_mask_index(struct CustomData *data, int type, int n);
/* adds flag to the layer flags */
void CustomData_set_layer_flag(struct CustomData *data, int type, int flag);
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index 33747eb35a3..3f6b295b9ba 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -41,6 +41,7 @@ struct VFont;
struct Object;
struct Curve;
struct objfnt;
+struct TmpFont;
struct chartrans {
float xof, yof;
@@ -58,7 +59,9 @@ extern struct SelBox *selboxes;
void BKE_font_register_builtin(void *mem, int size);
void free_vfont(struct VFont *sc);
+void free_ttfont(void);
struct VFont *load_vfont(char *name);
+struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
struct chartrans *text_to_curve(struct Object *ob, int mode);
int style_to_sel(int style, int toggle);
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 3a2dca525b8..498fd6169b2 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -55,12 +55,35 @@ struct SpaceNla;
struct Main;
struct Scene;
struct bScreen;
+struct ScrArea;
+struct ARegion;
struct Object;
struct bSoundListener;
struct BMF_Font;
struct EditMesh;
struct BME_Glob;
+/* former global stuff. context is derived, not storage! */
+typedef struct bContext {
+
+ /* windowmanager tree context */
+ struct wmWindowManager *wm;
+ struct wmWindow *window;
+ struct bScreen *screen;
+ struct ScrArea *area;
+ struct ARegion *region;
+
+ /* data context */
+ struct Scene *scene;
+ struct Object *obact;
+ struct Object *obedit;
+
+ /* edit data context */
+ struct EditMesh *editMesh;
+ struct ListBase edbo; /* Armature Editmode bones */
+
+} bContext;
+
typedef struct Global {
/* active pointers */
@@ -121,7 +144,7 @@ typedef struct Global {
/* Reevan's __NLA variables */
struct ListBase edbo; /* Armature Editmode bones */
- /* Rob's variables */
+ /* Rob's variables (keep here for WM recode) */
int have_quicktime;
int ui_international;
int charstart;
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 2274c54ad3b..0021d531c85 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -30,16 +30,6 @@
#include "DNA_ID.h"
-/*
-these two are included for their (new :P )function
-pointers.
-*/
-#include "BLO_readfile.h"
-#include "BLO_writefile.h"
-
-struct WriteData;
-struct FileData;
-
struct IDProperty;
struct ID;
@@ -176,5 +166,6 @@ void IDP_UnlinkProperty(struct IDProperty *prop);
#define IDP_Float(prop) (*(float*)&prop->data.val)
#define IDP_String(prop) ((char*)prop->data.pointer)
#define IDP_Array(prop) (prop->data.pointer)
+#define IDP_Double(prop) (*(double*)&prop->data.val)
#endif /* _BKE_IDPROP_H */
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index d840401d4fa..212e9f08c35 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -37,6 +37,8 @@ struct ListBase;
struct ID;
struct Main;
struct Library;
+struct wmWindowManager;
+struct bContext;
void *alloc_libblock(struct ListBase *lb, short type, const char *name);
void *copy_libblock(void *rt);
@@ -70,5 +72,7 @@ void IPOnames_to_pupstring(char **str, char *title, char *extraops, struct ListB
void flag_listbase_ids(ListBase *lb, short flag, short value);
void flag_all_listbases_ids(short flag, short value);
+void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
+
#endif
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index d1cc7515159..34ecb2bbba1 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -76,6 +76,7 @@ typedef struct Main {
ListBase nodetree;
ListBase brush;
ListBase particle;
+ ListBase wm;
} Main;
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index fa3a654c1c2..1c5b6b124b2 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -401,6 +401,8 @@ struct TexResult;
#define TEX_NODE_ROTATE 114
#define TEX_NODE_VIEWER 115
#define TEX_NODE_TRANSLATE 116
+#define TEX_NODE_COORD 117
+#define TEX_NODE_DISTANCE 118
/* 201-299 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */
#define TEX_NODE_PROC 200
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 2bd528ab8c8..35168cb65f2 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -41,6 +41,7 @@ struct SculptData;
struct RenderData;
/* sequence related defines */
+
#define WHILE_SEQ(base) { \
int totseq_, seq_; Sequence **seqar; \
build_seqar( base, &seqar, &totseq_); \
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index df904d3e08a..5a679b6475f 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -31,7 +31,101 @@
#ifndef BKE_SCREEN_H
#define BKE_SCREEN_H
+struct SpaceType;
+struct ScrArea;
+struct bScreen;
+struct ARegion;
+struct wmNotifier;
+struct wmWindowManager;
+struct ListBase;
+
+/* spacetype has everything stored to get an editor working, it gets initialized via
+ ED_spacetypes_init() in editors/area/spacetypes.c */
+/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
+
+#define BKE_ST_MAXNAME 32
+
+typedef struct SpaceType {
+ struct SpaceType *next, *prev;
+
+ char name[BKE_ST_MAXNAME]; /* for menus */
+ int spaceid; /* unique space identifier */
+ int iconid; /* icon lookup for menus */
+
+ /* initial allocation, after this WM will call init() too */
+ struct SpaceLink *(*new)(void);
+ /* not free spacelink itself */
+ void (*free)(struct SpaceLink *);
+
+ /* init is to cope with file load, screen (size) changes, check handlers */
+ void (*init)(struct wmWindowManager *, struct ScrArea *);
+ /* Listeners can react to bContext changes */
+ void (*listener)(struct ARegion *, struct wmNotifier *);
+
+ /* after a spacedata copy, an init should result in exact same situation */
+ struct SpaceLink *(*duplicate)(struct SpaceLink *);
+
+ /* register operator types on startup */
+ void (*operatortypes)(void);
+ /* add default items to WM keymap */
+ void (*keymap)(struct wmWindowManager *);
+
+ /* region type definitions */
+ ListBase regiontypes;
+
+ /* read and write... */
+
+ /* default keymaps to add */
+ int keymapflag;
+
+} SpaceType;
+
+/* region types are also defined using spacetypes_init, via a callback */
+
+typedef struct ARegionType {
+ struct ARegionType *next, *prev;
+
+ int regionid; /* unique identifier within this space */
+
+ /* add handlers, stuff you only do once or on area/region type/size changes */
+ void (*init)(struct wmWindowManager *, struct ARegion *);
+ /* draw entirely, view changes should be handled here */
+ void (*draw)(const struct bContext *, struct ARegion *);
+ /* contextual changes should be handled here */
+ void (*listener)(struct ARegion *, struct wmNotifier *);
+
+ void (*free)(struct ARegion *);
+
+ /* register operator types on startup */
+ void (*operatortypes)(void);
+ /* add own items to keymap */
+ void (*keymap)(struct wmWindowManager *);
+
+ /* hardcoded constraints, smaller than these values region is not visible */
+ int minsizex, minsizey;
+ /* default keymaps to add */
+ int keymapflag;
+} ARegionType;
+
+
+/* spacetypes */
+struct SpaceType *BKE_spacetype_from_id(int spaceid);
+const struct ListBase *BKE_spacetypes_list(void);
+void BKE_spacetype_register(struct SpaceType *st);
+void BKE_spacetypes_free(void); /* only for quitting blender */
+
+/* spacedata */
+void BKE_spacedata_freelist(ListBase *lb);
+void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
+
+/* area/regions */
+struct ARegion *BKE_area_region_copy(struct ARegion *ar);
+void BKE_area_region_free(struct ARegion *ar);
+
+void BKE_screen_area_free(struct ScrArea *sa);
+
void free_screen(struct bScreen *sc);
+
#endif
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 0ed4f38e457..4c6d5717591 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -27,7 +27,7 @@
FILE(GLOB SRC intern/*.c)
SET(INC
- . ../../../intern/guardedalloc ../include ../blenlib ../makesdna
+ . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna
../python ../render/extern/include ../../../intern/decimation/extern
../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
../../../intern/iksolver/extern ../blenloader ../quicktime
diff --git a/source/blender/blenkernel/Makefile b/source/blender/blenkernel/Makefile
index a5ee729b7e3..f0476bbf026 100644
--- a/source/blender/blenkernel/Makefile
+++ b/source/blender/blenkernel/Makefile
@@ -29,6 +29,6 @@
# Bounces make to subdirectories.
SOURCEDIR = source/blender/blenkernel
-DIRS = intern bad_level_call_stubs
+DIRS = intern
include nan_subdirs.mk
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index ab122e40bfc..071fd5d82d9 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('intern/*.c')
-incs = '. #/intern/guardedalloc ../include ../blenlib ../makesdna'
+incs = '. #/intern/guardedalloc ../editors/include ../blenlib ../makesdna'
incs += ' ../render/extern/include #/intern/decimation/extern'
incs += ' ../imbuf ../avi #/intern/elbeem/extern ../nodes'
incs += ' #/intern/iksolver/extern ../blenloader'
diff --git a/source/blender/blenkernel/bad_level_call_stubs/SConscript b/source/blender/blenkernel/bad_level_call_stubs/SConscript
deleted file mode 100644
index 955a989c9f9..00000000000
--- a/source/blender/blenkernel/bad_level_call_stubs/SConscript
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/python
-Import ('env')
-
-sources = 'stubs.c'
-
-incs = '. .. ../../render/extern/include'
-incs += ' #/intern/iksolver/extern ../../blenlib'
-incs += ' ../../include ../../makesdna'
-
-defs = ''
-if env['WITH_BF_INTERNATIONAL']:
- defs += 'WITH_FREETYPE2'
-
-env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype='player',priority=225 )
diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c
deleted file mode 100644
index 91fb9031597..00000000000
--- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * BKE_bad_level_calls function stubs
- */
-
-#include <stdlib.h>
-
-#include "BKE_bad_level_calls.h"
-#include "BLI_blenlib.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_material_types.h"
-#include "DNA_node_types.h"
-#include "DNA_scene_types.h"
-
-#include "RE_render_ext.h"
-#include "RE_shader_ext.h"
-#include "RE_pipeline.h"
-
-int winqueue_break= 0;
-
-char bprogname[1];
-char btempdir[1];
-
-struct IpoCurve;
-struct FluidsimSettings;
-struct Render;
-struct RenderResult;
-struct Object;
-struct bPythonConstraint;
-struct bConstraintOb;
-struct bConstraintTarget;
-struct ListBase;
-struct EditFace;
-
-char *getIpoCurveName( struct IpoCurve * icu );
-void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast);
-struct IpoCurve *verify_ipocurve(struct ID *id, short a, char *b, char *d, int e, short f);
-void elbeemDebugOut(char *msg);
-void fluidsimSettingsFree(struct FluidsimSettings* sb);
-void fluidsimSettingsCopy(struct FluidsimSettings* sb);
-
-
-/* readfile.c */
- /* struct SpaceButs; */
-void set_rects_butspace(struct SpaceButs *buts){}
- /* struct SpaceImaSel; */
-void check_imasel_copy(struct SpaceImaSel *simasel){}
- /* struct ScrArea; */
-void unlink_screen(struct bScreen *sc){}
-void freeAllRad(void){}
-void free_editText(void){}
-void free_editArmature(void){}
-void free_vertexpaint(void){}
-
-char *getIpoCurveName( struct IpoCurve * icu )
-{
- return 0;
-}
-
-void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast)
-{
-}
-
-
-struct IpoCurve *verify_ipocurve(struct ID *id, short a, char *b, char *d, int e, short f)
-{
- return 0;
-}
-
-
-void setscreen(struct bScreen *sc){}
-void force_draw_all(int header){}
- /* otherwise the WHILE_SEQ doesn't work */
- /* struct Sequence; */
-
-/* MAART: added "seqar = 0; totseq = 0" because the loader will crash without it. */
-void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq)
-{
- *seqar = 0;
- *totseq = 0;
-}
-
-/* blender.c */
-void mainqenter (unsigned short event, short val){}
-
-void BPY_do_pyscript(ID *id, short int event){}
-void BPY_clear_script(Script *script){}
-void BPY_free_compiled_text(struct Text *text){}
-void BPY_pydriver_update(void){}
-float BPY_pydriver_eval(struct IpoDriver *driver)
-{
- return 0;
-}
-
-/*
-int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value)
-{
- return 0;
-}
-*/
-
-void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type){}
-void InitNode(struct BPy_Node *self, struct bNode *node){}
-void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi){}
-struct BPy_NodeSockets *Node_CreateSocketLists(struct bNode *node)
-{
- return 0;
-}
-int pytype_is_pynode(struct PyObject *pyob)
-{
- return 0;
-}
-/* depsgraph.c: */
-struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver)
-{
- return 0;
-}
-int BPY_button_eval(char *expr, double *value)
-{
- return 0;
-}
-
-/* PyConstraints - BPY_interface.c */
-void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)
-{
-}
-void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct)
-{
-}
-
-
-/* writefile.c */
- /* struct Oops; */
-void free_oops(struct Oops *oops){}
-void exit_posemode(int freedata){}
-void error(char *str, ...){}
-
-/* anim.c */
-ListBase editNurb;
-
-void waitcursor(int val){}
-void allqueue(unsigned short event, short val){}
-#define REDRAWVIEW3D 0x4010
-Material defmaterial;
-
-/* exotic.c */
-void load_editMesh(void){}
-void make_editMesh(void){}
-void free_editMesh(struct EditMesh *em){}
-void docenter_new(void){}
-int saveover(char *str){ return 0;}
-
-/* ipo.c */
-void copy_view3d_lock(short val){} // was a hack, to make scene layer ipo's possible
-
-/* library.c */
-void allspace(unsigned short event, short val){}
-#define OOPS_TEST 2
-
-/* mball.c */
-ListBase editelems;
-
-/* object.c */
-void BPY_free_scriptlink(ScriptLink *slink){}
-void BPY_copy_scriptlink(ScriptLink *scriptlink){}
-float *give_cursor(void){ return 0;} // become a callback or argument
-
-
-/* packedFile.c */
-short pupmenu(char *instr){ return 0;} // will be general callback
-
-/* sca.c */
-#define LEFTMOUSE 0x001 // because of mouse sensor
-
-/* scene.c */
-#include "DNA_sequence_types.h"
-void free_editing(struct Editing *ed){} // scenes and sequences problem...
-void BPY_do_all_scripts (short int event, short int anim){}
-
-/*editmesh_lib.c*/
-void EM_select_face(struct EditFace *efa, int sel) {}
-void EM_select_edge(struct EditEdge *eed, int sel) {}
-
-/*editmesh.c*/
-struct EditVert *addvertlist(float *vec, struct EditVert *example) { return 0;}
-struct EditEdge *addedgelist(struct EditVert *v1, struct EditVert *v2, struct EditEdge *example) { return 0;}
-struct EditFace *addfacelist(struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges) { return 0;}
-struct EditEdge *findedgelist(struct EditVert *v1, struct EditVert *v2) { return 0;}
-/*edit.c*/
-
-void countall(void) {}
-
-/* exotic.c */
-int BPY_call_importloader(char *name)
-{
- return 0;
-}
-
-
-/* texture.c */
-#define FLO 128
-#define INT 96
-
-
-char texstr[20][12]; /* buttons.c */
-
-/* editsca.c */
-void make_unique_prop_names(char *str) {}
-
-/* DerivedMesh.c */
-void bglBegin(int mode) {}
-void bglVertex3fv(float *vec) {}
-void bglVertex3f(float x, float y, float z) {}
-void bglEnd(void) {}
-
-/* booleanops.c */
-struct DerivedMesh *NewBooleanDerivedMesh(struct Object *ob, struct Object *ob_select, int int_op_type) { return 0; }
-
-// bobj read/write debug messages
-void elbeemDebugOut(char *msg) {}
-void fluidsimSettingsFree(struct FluidsimSettings* sb) {}
-void fluidsimSettingsCopy(struct FluidsimSettings* sb) {}
-
-/*new render funcs */
-int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta) { return 0; }
-void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype) {}
-float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip) { return 0; }
-
-void RE_FreeRenderResult(struct RenderResult *rr) {}
-void RE_GetResultImage(struct Render *re, struct RenderResult *rr) {}
-struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return NULL;}
-struct Render *RE_GetRender(const char *name) {return (struct Render *)NULL;}
-struct RenderResult *RE_GetResult(Render *re) {return (struct RenderResult *)NULL;}
-float *RE_RenderLayerGetPass(RenderLayer *rl, int passtype) {return NULL;}
-float RE_filter_value(int type, float x) {return 0.0f;}
-struct RenderLayer *RE_GetRenderLayer(RenderResult *rr, const char *name) {return (struct RenderLayer *)NULL;}
-void RE_Database_Free (struct Render *re) {}
-void RE_FreeRender(Render *re) {}
-void RE_shade_external(Render *re, ShadeInput *shi, ShadeResult *shr) {}
-void RE_DataBase_GetView(Render *re, float mat[][4]) {}
-struct Render *RE_NewRender(const char *name) {return (struct Render *)NULL;}
-void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob) {};
-
-
-/* node_composite.c */
-void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect) {}
-
-int multitex_ext(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres)
-{
- return 1969;
-}
-
-/* verse */
-
-void post_vertex_create(struct VerseVert *vvert) {}
-void post_vertex_set_xyz(struct VerseVert *vvert) {}
-void post_vertex_delete(struct VerseVert *vvert) {}
-void post_vertex_free_constraint(struct VerseVert *vvert) {}
-void post_polygon_create(struct VerseFace *vface) {}
-void post_polygon_set_corner(struct VerseFace *vface) {}
-void post_polygon_delete(struct VerseFace *vface) {}
-void post_polygon_free_constraint(struct VerseFace *vface) {}
-void post_polygon_set_uint8(struct VerseFace *vface) {}
-void post_node_create(struct VNode *vnode) {}
-void post_node_destroy(struct VNode *vnode) {}
-void post_node_name_set(struct VNode *vnode) {}
-void post_tag_change(struct VTag *vtag) {}
-void post_taggroup_create(struct VTagGroup *vtaggroup) {}
-char *verse_client_name(void) { return NULL; }
-void post_transform(struct VNode *vnode) {}
-void post_transform_pos(struct VNode *vnode) {}
-void post_transform_rot(struct VNode *vnode) {}
-void post_transform_scale(struct VNode *vnode) {}
-void post_object_free_constraint(struct VNode *vnode) {}
-void post_link_set(struct VLink *vlink) {}
-void post_link_destroy(struct VLink *vlink) {}
-void post_connect_accept(struct VerseSession *session) {}
-void post_connect_terminated(struct VerseSession *session) {}
-void post_connect_update(struct VerseSession *session) {}
-void add_screenhandler(struct bScreen *sc, short eventcode, short val) {}
-void post_bitmap_dimension_set(struct VNode *vnode) {}
-void post_bitmap_layer_create(struct VBitmapLayer *vblayer) {}
-void post_bitmap_layer_destroy(struct VBitmapLayer *vblayer) {}
-void post_bitmap_tile_set(struct VBitmapLayer *vblayer, unsigned int xs, unsigned int ys) {}
-void create_meshdata_from_geom_node(struct Mesh *me, struct VNode *vnode) {}
-void post_geometry_free_constraint(struct VNode *vnode) {}
-void post_layer_create(struct VLayer *vlayer) {}
-void post_layer_destroy(struct VLayer *vlayer) {}
-void post_server_add(void) {}
-
-/* zbuf.c stub */
-void antialias_tagbuf(int xsize, int ysize, char *rectmove) {}
-
-/* imagetexture.c stub */
-void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {}
-
-void update_for_newframe() {}
-
-struct FileList;
-void BIF_filelist_freelib(struct FileList* filelist) {};
-
-/* edittime.c stub */
-TimeMarker *get_frame_marker(int frame){return 0;};
-
-/* editseq.c */
-Sequence *get_forground_frame_seq(int frame){return 0;};
-void clear_last_seq(Sequence *seq){};
-
-
-/* modifier.c stub */
-void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
- float (*vertexcos)[3], int totvert, float cagemat[][4]) {}
-
-/* particle.c */
-void PE_free_particle_edit(struct ParticleSystem *psys) {}
-void PE_get_colors(char sel[4], char nosel[4]) {}
-void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys) {}
-
-/* text.c */
-void txt_copy_clipboard (struct Text *text){}
-
-char stipple_quarttone[1];
-
-/* texture.c */
-int multitex_thread(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres, short thread, short which_output) {return 0;}
-
diff --git a/source/blender/blenkernel/intern/BME_conversions.c b/source/blender/blenkernel/intern/BME_conversions.c
index daf0de5b748..2129042bdc2 100644
--- a/source/blender/blenkernel/intern/BME_conversions.c
+++ b/source/blender/blenkernel/intern/BME_conversions.c
@@ -50,11 +50,11 @@
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_edgehash.h"
-#include "BIF_editmesh.h"
-#include "editmesh.h"
+//XXX #include "BIF_editmesh.h"
+//XXX #include "editmesh.h"
#include "bmesh_private.h"
-#include "BSE_edit.h"
+//XXX #include "BSE_edit.h"
/*merge these functions*/
static void BME_DMcorners_to_loops(BME_Mesh *bm, CustomData *facedata, int index, BME_Poly *f, int numCol, int numTex){
@@ -302,7 +302,7 @@ BME_Mesh *BME_editmesh_to_bmesh(EditMesh *em) {
e->flag = eed->f & SELECT;
if(eed->sharp) e->flag |= ME_SHARP;
if(eed->seam) e->flag |= ME_SEAM;
- if(eed->h & EM_FGON) e->flag |= ME_FGON;
+ //XXX if(eed->h & EM_FGON) e->flag |= ME_FGON;
if(eed->h & 1) e->flag |= ME_HIDE;
eed->tmp.e = (EditEdge*)e;
CustomData_bmesh_copy_data(&em->edata, &bm->edata, eed->data, &e->data);
@@ -378,7 +378,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
evlist= (EditVert **)MEM_mallocN(totvert*sizeof(void *),"evlist");
for (i=0,v1=bm->verts.first;v1;v1=v1->next,i++) {
v1->tflag1 = i;
- eve1 = addvertlist(v1->co,NULL);
+ eve1 = NULL; //XXX addvertlist(v1->co,NULL);
if (td && (vtd = BME_get_transdata(td,v1))) {
vtd->loc = eve1->co;
}
@@ -392,17 +392,17 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
/* make edges */
for (e=bm->edges.first;e;e=e->next) {
- if(!(findedgelist(evlist[e->v1->tflag1], evlist[e->v2->tflag1]))){
- eed= addedgelist(evlist[e->v1->tflag1], evlist[e->v2->tflag1], NULL);
+ if(0) { //XXX if(!(findedgelist(evlist[e->v1->tflag1], evlist[e->v2->tflag1]))){
+ eed= NULL; //XXX addedgelist(evlist[e->v1->tflag1], evlist[e->v2->tflag1], NULL);
eed->crease = e->crease;
eed->bweight = e->bweight;
if(e->flag & ME_SEAM) eed->seam = 1;
if(e->flag & ME_SHARP) eed->sharp = 1;
if(e->flag & SELECT) eed->f |= SELECT;
- if(e->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines!
+ //XXX if(e->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines!
if(e->flag & ME_HIDE) eed->h |= 1;
if(G.scene->selectmode==SCE_SELECT_EDGE)
- EM_select_edge(eed, eed->f & SELECT);
+ ; //XXX EM_select_edge(eed, eed->f & SELECT);
CustomData_em_copy_data(&bm->edata, &em->edata, e->data, &eed->data);
}
@@ -422,7 +422,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
eve4= NULL;
}
- efa = addfacelist(eve1, eve2, eve3, eve4, NULL, NULL);
+ efa = NULL; //XXX addfacelist(eve1, eve2, eve3, eve4, NULL, NULL);
efa->mat_nr = (unsigned char)f->mat_nr;
efa->flag= f->flag & ~ME_HIDE;
if(f->flag & ME_FACE_SEL) {
@@ -430,7 +430,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
}
if(f->flag & ME_HIDE) efa->h= 1;
if((G.f & G_FACESELECT) && (efa->f & SELECT))
- EM_select_face(efa, 1); /* flush down */
+ ; //XXX EM_select_face(efa, 1); /* flush down */
CustomData_em_copy_data(&bm->pdata, &em->fdata, f->data, &efa->data);
BME_loops_to_corners(bm, &em->fdata, efa->data, f,numCol,numTex);
}
@@ -438,7 +438,7 @@ EditMesh *BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td) {
MEM_freeN(evlist);
- countall();
+ //XXX countall();
return em;
}
diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c
index 90259031e5c..8aaa7aca023 100644
--- a/source/blender/blenkernel/intern/BME_tools.c
+++ b/source/blender/blenkernel/intern/BME_tools.c
@@ -38,14 +38,13 @@
#include "DNA_listBase.h"
#include "DNA_meshdata_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
#include "BKE_utildefines.h"
#include "BKE_bmesh.h"
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
-#include "blendef.h"
-
/*split this all into a seperate bevel.c file in src*/
/* ------- Bevel code starts here -------- */
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index b7f068c936b..aab39a099bf 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -87,6 +87,8 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
+//XXX #include "multires.h"
+//
#include "GPU_draw.h"
#include "GPU_extensions.h"
#include "GPU_material.h"
@@ -627,7 +629,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
if(draw) {
if (draw==2) { /* enabled with stipple */
glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
+ glPolygonStipple(0); //XXX stipple_quarttone);
}
glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
@@ -664,7 +666,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
if(draw) {
if (draw==2) { /* enabled with stipple */
glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
+ glPolygonStipple(0); //XXX stipple_quarttone);
}
glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
@@ -1706,12 +1708,12 @@ static void vDM_drawVerts(DerivedMesh *dm)
vvert = vdm->vertex_layer->dl.lb.first;
- bglBegin(GL_POINTS);
+ //XXX bglBegin(GL_POINTS);
while(vvert) {
- bglVertex3fv(vdm->vertexCos ? vvert->cos : vvert->co);
+ //XXX bglVertex3fv(vdm->vertexCos ? vvert->cos : vvert->co);
vvert = vvert->next;
}
- bglEnd();
+ //XXX bglEnd();
}
/* draw all edges of VerseFaces ... it isn't optimal, because verse
@@ -2816,18 +2818,18 @@ float *multires_render_pin(Object *ob, Mesh *me, int *orig_lvl)
int i;
/* Make sure all mesh edits are properly stored in the multires data*/
- multires_update_levels(me, 1);
+ //XXX multires_update_levels(me, 1);
/* Copy the highest level of multires verts */
*orig_lvl= me->mr->current;
- lvl= multires_level_n(me->mr, BLI_countlist(&me->mr->levels));
+ //XXX lvl= multires_level_n(me->mr, BLI_countlist(&me->mr->levels));
vert_copy= MEM_callocN(sizeof(float)*3*lvl->totvert, "multires vert_copy");
for(i=0; i<lvl->totvert; ++i)
VecCopyf(&vert_copy[i*3], me->mr->verts[i].co);
/* Goto the pin level for multires */
me->mr->newlvl= me->mr->pinlvl;
- multires_set_level(ob, me, 1);
+ //XXX multires_set_level(ob, me, 1);
}
return vert_copy;
@@ -2840,7 +2842,7 @@ void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_c
if(me->mr && !(me->mr->flag & MULTIRES_NO_RENDER)) {
if((*dm)->getNumVerts(*dm) == me->totvert &&
(*dm)->getNumFaces(*dm) == me->totface) {
- MultiresLevel *lvl= multires_level_n(me->mr, BLI_countlist(&me->mr->levels));
+ //XXX MultiresLevel *lvl= multires_level_n(me->mr, BLI_countlist(&me->mr->levels));
DerivedMesh *old= NULL;
MVert *vertdup= NULL;
int i;
@@ -2854,7 +2856,7 @@ void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_c
MEM_freeN(vertdup);
/* Go to the render level */
me->mr->newlvl= me->mr->renderlvl;
- multires_set_level(ob, me, 1);
+ //XXX multires_set_level(ob, me, 1);
(*dm)= getMeshDerivedMesh(me, ob, NULL);
/* Some of the data in dm is referenced externally, so make a copy */
@@ -2867,16 +2869,16 @@ void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_c
/* Restore the original verts */
me->mr->newlvl= BLI_countlist(&me->mr->levels);
- multires_set_level(ob, me, 1);
- for(i=0; i<lvl->totvert; ++i)
- VecCopyf(me->mvert[i].co, &vert_copy[i*3]);
+ //XXX multires_set_level(ob, me, 1);
+ //XXX for(i=0; i<lvl->totvert; ++i)
+ //XXX VecCopyf(me->mvert[i].co, &vert_copy[i*3]);
}
if(vert_copy)
MEM_freeN(vert_copy);
me->mr->newlvl= orig_lvl;
- multires_set_level(ob, me, 1);
+ //XXX multires_set_level(ob, me, 1);
}
}
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index 8921ea5d3b7..4cfc8f91efe 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -53,7 +53,7 @@ CPPFLAGS += -I../../avi
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# we still refer to /include a bit...
-CPPFLAGS += -I../../include
+CPPFLAGS += -I../../editors/include
# to include the render stuff:
CPPFLAGS += -I../../render/extern/include
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index e0afdec5e23..1c720cea21f 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -64,7 +64,7 @@
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
-#include "nla.h"
+//XXX #include "nla.h"
/* *********************** NOTE ON POSE AND ACTION **********************
@@ -195,9 +195,9 @@ bAction *copy_action (bAction *src)
dst= copy_libblock(src);
- duplicatelist(&(dst->chanbase), &(src->chanbase));
- duplicatelist(&(dst->groups), &(src->groups));
- duplicatelist(&(dst->markers), &(src->markers));
+ BLI_duplicatelist(&(dst->chanbase), &(src->chanbase));
+ BLI_duplicatelist(&(dst->groups), &(src->groups));
+ BLI_duplicatelist(&(dst->markers), &(src->markers));
for (dchan=dst->chanbase.first, schan=src->chanbase.first; dchan; dchan=dchan->next, schan=schan->next) {
for (dgrp=dst->groups.first, sgrp=src->groups.first; dgrp && sgrp; dgrp=dgrp->next, sgrp=sgrp->next) {
@@ -299,7 +299,7 @@ void copy_pose(bPose **dst, bPose *src, int copycon)
outPose= MEM_callocN(sizeof(bPose), "pose");
- duplicatelist(&outPose->chanbase, &src->chanbase);
+ BLI_duplicatelist (&outPose->chanbase, &src->chanbase);
if (copycon) {
for (pchan=outPose->chanbase.first; pchan; pchan=pchan->next) {
@@ -363,7 +363,7 @@ void game_copy_pose(bPose **dst, bPose *src)
out= MEM_dupallocN(src);
out->agroups.first= out->agroups.last= NULL;
- duplicatelist(&out->chanbase, &src->chanbase);
+ BLI_duplicatelist(&out->chanbase, &src->chanbase);
/* remap pointers */
ghash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 731c2a18c55..aeddabf8c1b 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -68,8 +68,6 @@
#include "BKE_particle.h"
#include "BKE_utildefines.h"
-#include "BKE_bad_level_calls.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -100,8 +98,8 @@ void calc_curvepath(Object *ob)
if(ob==NULL || ob->type != OB_CURVE) return;
cu= ob->data;
- if(ob==G.obedit) nu= editNurb.first;
- else nu= cu->nurb.first;
+ //XXX if(ob==G.obedit) nu= editNurb.first;
+ //XXX else nu= cu->nurb.first;
if(cu->path) free_path(cu->path);
cu->path= NULL;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 155d5a7d21c..8bb694f45e8 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -34,7 +34,7 @@
#include "MEM_guardedalloc.h"
-#include "nla.h"
+//XXX #include "nla.h"
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
@@ -67,7 +67,7 @@
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#include "BIF_editdeform.h"
+//XXX #include "BIF_editdeform.h"
#include "IK_solver.h"
@@ -180,7 +180,7 @@ static void copy_bonechildren (Bone* newBone, Bone* oldBone)
Bone *curBone, *newChildBone;
/* Copy this bone's list*/
- duplicatelist (&newBone->childbase, &oldBone->childbase);
+ BLI_duplicatelist (&newBone->childbase, &oldBone->childbase);
/* For each child in the list, update it's children*/
newChildBone=newBone->childbase.first;
@@ -197,7 +197,7 @@ bArmature *copy_armature(bArmature *arm)
Bone *oldBone, *newBone;
newArm= copy_libblock (arm);
- duplicatelist(&newArm->bonebase, &arm->bonebase);
+ BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
/* Duplicate the childrens' lists*/
newBone=newArm->bonebase.first;
@@ -1433,7 +1433,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
* so syncing things correctly needs careful attention
*/
BLI_freelistN(&pose->agroups);
- duplicatelist(&pose->agroups, &frompose->agroups);
+ BLI_duplicatelist(&pose->agroups, &frompose->agroups);
pose->active_group= frompose->active_group;
for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 5dcccc56d06..e5625fa03e0 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -48,12 +48,16 @@
#include "MEM_guardedalloc.h"
+#include "DNA_curve_types.h"
#include "DNA_listBase.h"
#include "DNA_sdna_types.h"
#include "DNA_userdef_types.h"
#include "DNA_object_types.h"
-#include "DNA_curve_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_sound_types.h"
+#include "DNA_sequence_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
@@ -61,9 +65,6 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "DNA_mesh_types.h"
-#include "DNA_screen_types.h"
-
#include "BKE_action.h"
#include "BKE_blender.h"
#include "BKE_curve.h"
@@ -76,6 +77,7 @@
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_scene.h"
+#include "BKE_screen.h"
#include "BKE_sound.h"
#include "BLI_editVert.h"
@@ -84,15 +86,12 @@
#include "BLO_readfile.h"
#include "BLO_writefile.h"
-#include "BKE_bad_level_calls.h" // for freeAllRad editNurb free_editMesh free_editText free_editArmature
#include "BKE_utildefines.h" // O_BINARY FALSE
-#include "BIF_mainqueue.h" // mainqenter for onload script
-#include "mydevice.h"
-#include "nla.h"
-#include "blendef.h"
+
Global G;
UserDef U;
+ListBase WMlist= {NULL, NULL};
char versionstr[48]= "";
@@ -168,6 +167,7 @@ void pushpop_test()
/* ********** free ********** */
+/* only to be called on exit blender */
void free_blender(void)
{
/* samples are in a global list..., also sets G.main->sound->sample NULL */
@@ -176,27 +176,13 @@ void free_blender(void)
free_main(G.main);
G.main= NULL;
+ BKE_spacetypes_free(); /* after free main, it uses space callbacks */
+
IMB_freeImBufdata(); /* imbuf lib */
free_nodesystem();
}
-void duplicatelist(ListBase *list1, ListBase *list2) /* copy from 2 to 1 */
-{
- struct Link *link1, *link2;
-
- list1->first= list1->last= 0;
-
- link2= list2->first;
- while(link2) {
-
- link1= MEM_dupallocN(link2);
- BLI_addtail(list1, link1);
-
- link2= link2->next;
- }
-}
-
static EditMesh theEditMesh;
void initglobals(void)
@@ -237,21 +223,19 @@ void initglobals(void)
static void clear_global(void)
{
- extern short winqueue_break; /* screen.c */
+// extern short winqueue_break; /* screen.c */
- freeAllRad();
+// XXX freeAllRad();
fastshade_free_render(); /* lamps hang otherwise */
free_main(G.main); /* free all lib data */
-
- /* force all queues to be left */
- winqueue_break= 1;
if (G.obedit) {
- freeNurblist(&editNurb);
- free_editMesh(G.editMesh);
- free_editText();
- free_editArmature();
+// freeNurblist(&editNurb);
+// free_editMesh(G.editMesh);
+// free_editText();
+// free_editArmature();
}
+// free_vertexpaint();
G.curscreen= NULL;
G.scene= NULL;
@@ -266,8 +250,6 @@ static void clear_global(void)
G.sima= NULL;
G.sipo= NULL;
- free_vertexpaint();
-
G.f &= ~(G_WEIGHTPAINT + G_VERTEXPAINT + G_FACESELECT + G_PARTICLEEDIT);
}
@@ -314,7 +296,10 @@ static void clean_paths(Main *main)
}
}
-static void setup_app_data(BlendFileData *bfd, char *filename)
+/* context matching */
+/* handle no-ui case */
+
+static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
{
Object *ob;
bScreen *curscreen= NULL;
@@ -328,6 +313,8 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
clean_paths(bfd->main);
+ /* XXX here the complex windowmanager matching */
+
/* no load screens? */
if(mode) {
/* comes from readfile.c */
@@ -337,7 +324,7 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
SWAP(ListBase, G.main->script, bfd->main->script);
/* we re-use current screen */
- curscreen= G.curscreen;
+ curscreen= C->screen;
/* but use new Scene pointer */
curscene= bfd->curscene;
if(curscene==NULL) curscene= bfd->main->scene.first;
@@ -348,11 +335,13 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
lib_link_screen_restore(bfd->main, curscene);
}
- clear_global(); /* free Main database */
+ /* free G.main Main database */
+ clear_global();
if(mode!='u') G.save_over = 1;
G.main= bfd->main;
+
if (bfd->user) {
/* only here free userdef themes... */
@@ -360,7 +349,6 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
U= *bfd->user;
MEM_freeN(bfd->user);
-
}
/* samples is a global list... */
@@ -368,20 +356,20 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
/* case G_FILE_NO_UI or no screens in file */
if(mode) {
- G.curscreen= curscreen;
- G.scene= curscene;
+ C->screen= curscreen;
+ C->scene= curscene;
}
else {
G.winpos= bfd->winpos;
G.displaymode= bfd->displaymode;
G.fileflags= bfd->fileflags;
- G.curscreen= bfd->curscreen;
- G.scene= G.curscreen->scene;
+ C->screen= bfd->curscreen;
+ C->scene= C->screen->scene;
}
/* this can happen when active scene was lib-linked, and doesnt exist anymore */
- if(G.scene==NULL) {
- G.scene= G.main->scene.first;
- G.curscreen->scene= G.scene;
+ if(C->scene==NULL) {
+ C->scene= G.main->scene.first;
+ C->screen->scene= C->scene;
}
/* special cases, override loaded flags: */
@@ -393,11 +381,11 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
G.f= bfd->globalf;
if (!G.background) {
- setscreen(G.curscreen);
+ //setscreen(G.curscreen);
}
/* baseflags, groups, make depsgraph, etc */
- set_scene_bg(G.scene);
+ set_scene_bg(C->scene);
/* clear BONE_UNKEYED flags, these are not valid anymore for proxies */
framechange_poses_clear_unkeyed();
@@ -409,11 +397,11 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
}
/* now tag update flags, to ensure deformers get calculated on redraw */
- DAG_scene_update_flags(G.scene, G.scene->lay);
+ DAG_scene_update_flags(C->scene, C->scene->lay);
if (G.f & G_DOSCRIPTLINKS) {
/* there's an onload scriptlink to execute in screenmain */
- mainqenter(ONLOAD_SCRIPT, 1);
+// XXX mainqenter(ONLOAD_SCRIPT, 1);
}
if (G.sce != filename) /* these are the same at times, should never copy to the same location */
strcpy(G.sce, filename);
@@ -432,7 +420,7 @@ static void handle_subversion_warning(Main *main)
char str[128];
sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile);
- error(str);
+// XXX error(str);
}
}
@@ -443,78 +431,55 @@ static void handle_subversion_warning(Main *main)
2: OK, and with new user settings
*/
-int BKE_read_file(char *dir, void *type_r)
+int BKE_read_file(bContext *C, char *dir, void *unused)
{
BlendReadError bre;
BlendFileData *bfd;
int retval= 1;
- if (!G.background)
- waitcursor(1);
-
bfd= BLO_read_from_file(dir, &bre);
if (bfd) {
if(bfd->user) retval= 2;
- if (type_r)
- *((BlenFileType*)type_r)= bfd->type;
- setup_app_data(bfd, dir);
+ setup_app_data(C, bfd, dir);
handle_subversion_warning(G.main);
}
else {
- error("Loading %s failed: %s", dir, BLO_bre_as_string(bre));
+// XXX error("Loading %s failed: %s", dir, BLO_bre_as_string(bre));
}
-
- if (!G.background)
- waitcursor(0);
-
+
return (bfd?retval:0);
}
-int BKE_read_file_from_memory(char* filebuf, int filelength, void *type_r)
+int BKE_read_file_from_memory(bContext *C, char* filebuf, int filelength, void *unused)
{
BlendReadError bre;
BlendFileData *bfd;
-
- if (!G.background)
- waitcursor(1);
-
+
bfd= BLO_read_from_memory(filebuf, filelength, &bre);
if (bfd) {
- if (type_r)
- *((BlenFileType*)type_r)= bfd->type;
-
- setup_app_data(bfd, "<memory2>");
+ setup_app_data(C, bfd, "<memory2>");
} else {
- error("Loading failed: %s", BLO_bre_as_string(bre));
+// XXX error("Loading failed: %s", BLO_bre_as_string(bre));
}
-
- if (!G.background)
- waitcursor(0);
-
+
return (bfd?1:0);
}
/* memfile is the undo buffer */
-int BKE_read_file_from_memfile(MemFile *memfile)
+int BKE_read_file_from_memfile(bContext *C, MemFile *memfile)
{
BlendReadError bre;
BlendFileData *bfd;
- if (!G.background)
- waitcursor(1);
-
bfd= BLO_read_from_memfile(G.sce, memfile, &bre);
if (bfd) {
- setup_app_data(bfd, "<memory1>");
+ setup_app_data(C, bfd, "<memory1>");
} else {
- error("Loading failed: %s", BLO_bre_as_string(bre));
+// XXX error("Loading failed: %s", BLO_bre_as_string(bre));
}
-
- if (!G.background)
- waitcursor(0);
-
+
return (bfd?1:0);
}
@@ -536,7 +501,7 @@ static ListBase undobase={NULL, NULL};
static UndoElem *curundo= NULL;
-static int read_undosave(UndoElem *uel)
+static int read_undosave(bContext *C, UndoElem *uel)
{
char scestr[FILE_MAXDIR+FILE_MAXFILE];
int success=0, fileflags;
@@ -546,9 +511,9 @@ static int read_undosave(UndoElem *uel)
G.fileflags |= G_FILE_NO_UI;
if(UNDO_DISK)
- success= BKE_read_file(uel->str, NULL);
+ success= BKE_read_file(C, uel->str, NULL);
else
- success= BKE_read_file_from_memfile(&uel->memfile);
+ success= BKE_read_file_from_memfile(C, &uel->memfile);
/* restore */
strcpy(G.sce, scestr);
@@ -558,7 +523,7 @@ static int read_undosave(UndoElem *uel)
}
/* name can be a dynamic string */
-void BKE_write_undo(char *name)
+void BKE_write_undo(bContext *C, char *name)
{
uintptr_t maxmem, totmem, memused;
int nr, success;
@@ -612,7 +577,7 @@ void BKE_write_undo(char *name)
sprintf(numstr, "%d.blend", counter);
BLI_make_file_string("/", tstr, btempdir, numstr);
- success= BLO_write_file(tstr, G.fileflags, &err);
+ success= BLO_write_file(C, tstr, G.fileflags, &err);
strcpy(curundo->str, tstr);
}
@@ -623,7 +588,7 @@ void BKE_write_undo(char *name)
if(curundo->prev) prevfile= &(curundo->prev->memfile);
memused= MEM_get_memory_in_use();
- success= BLO_write_file_mem(prevfile, &curundo->memfile, G.fileflags, &err);
+ success= BLO_write_file_mem(C, prevfile, &curundo->memfile, G.fileflags, &err);
curundo->undosize= MEM_get_memory_in_use() - memused;
}
@@ -657,28 +622,28 @@ void BKE_write_undo(char *name)
/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation
* Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */
-void BKE_undo_step(int step)
+void BKE_undo_step(bContext *C, int step)
{
if(step==0) {
- read_undosave(curundo);
+ read_undosave(C, curundo);
}
else if(step==1) {
/* curundo should never be NULL, after restart or load file it should call undo_save */
- if(curundo==NULL || curundo->prev==NULL) error("No undo available");
+ if(curundo==NULL || curundo->prev==NULL) ; // XXX error("No undo available");
else {
if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
curundo= curundo->prev;
- read_undosave(curundo);
+ read_undosave(C, curundo);
}
}
else {
/* curundo has to remain current situation! */
- if(curundo==NULL || curundo->next==NULL) error("No redo available");
+ if(curundo==NULL || curundo->next==NULL) ; // XXX error("No redo available");
else {
- read_undosave(curundo->next);
+ read_undosave(C, curundo->next);
curundo= curundo->next;
if(G.f & G_DEBUG) printf("redo %s\n", curundo->name);
}
@@ -700,7 +665,7 @@ void BKE_reset_undo(void)
}
/* based on index nr it does a restore */
-void BKE_undo_number(int nr)
+void BKE_undo_number(bContext *C, int nr)
{
UndoElem *uel;
int a=1;
@@ -709,7 +674,7 @@ void BKE_undo_number(int nr)
if(a==nr) break;
}
curundo= uel;
- BKE_undo_step(0);
+ BKE_undo_step(C, 0);
}
char *BKE_undo_menu_string(void)
@@ -754,7 +719,7 @@ void BKE_undo_save_quit(void)
file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
if(file == -1) {
- error("Unable to save %s, check you have permissions", str);
+ //XXX error("Unable to save %s, check you have permissions", str);
return;
}
@@ -766,7 +731,7 @@ void BKE_undo_save_quit(void)
close(file);
- if(chunk) error("Unable to save %s, internal error", str);
+ if(chunk) ; //XXX error("Unable to save %s, internal error", str);
else printf("Saved session recovery to %s\n", str);
}
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 1c53af97dbb..021f76fd2f1 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -328,6 +328,23 @@ float brush_sample_falloff(Brush *brush, float dist)
return 0.0f;
}
+float brush_sample_falloff_noalpha(Brush *brush, float dist)
+{
+ float outer, inner;
+
+ outer = brush->size >> 1;
+ inner = outer*brush->innerradius;
+
+ if (dist <= inner) {
+ return 1.0f;
+ }
+ else if ((dist < outer) && (inner < outer)) {
+ return 1.0f - sqrt((dist - inner)/(outer - inner));
+ }
+ else
+ return 0.0f;
+}
+
void brush_sample_tex(Brush *brush, float *xy, float *rgba)
{
MTex *mtex= brush->mtex[brush->texact];
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 775f1dee241..9db3dda94eb 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -45,7 +45,6 @@
#include "BKE_modifier.h"
#include "BKE_utildefines.h"
#include "BKE_DerivedMesh.h"
-#include "mydevice.h"
#include "Bullet-C-Api.h"
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 5639f00ee39..b8bfb002075 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -31,9 +31,10 @@
#include <stddef.h>
#include <string.h>
#include <math.h>
+#include <float.h>
#include "MEM_guardedalloc.h"
-#include "nla.h"
+//XXX #include "nla.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -68,8 +69,6 @@
#include "BPY_extern.h"
#endif
-#include "blendef.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -112,7 +111,7 @@ void copy_constraint_channels (ListBase *dst, ListBase *src)
bConstraintChannel *dchan, *schan;
dst->first = dst->last = NULL;
- duplicatelist(dst, src);
+ BLI_duplicatelist(dst, src);
for (dchan=dst->first, schan=src->first; dchan; dchan=dchan->next, schan=schan->next) {
dchan->ipo = copy_ipo(schan->ipo);
@@ -127,7 +126,7 @@ void clone_constraint_channels (ListBase *dst, ListBase *src)
bConstraintChannel *dchan, *schan;
dst->first = dst->last = NULL;
- duplicatelist(dst, src);
+ BLI_duplicatelist(dst, src);
for (dchan=dst->first, schan=src->first; dchan; dchan=dchan->next, schan=schan->next) {
id_us_plus((ID *)dchan->ipo);
@@ -1843,7 +1842,7 @@ static void pycon_copy (bConstraint *con, bConstraint *srccon)
bPythonConstraint *opycon = (bPythonConstraint *)srccon->data;
pycon->prop = IDP_CopyProperty(opycon->prop);
- duplicatelist(&pycon->targets, &opycon->targets);
+ BLI_duplicatelist(&pycon->targets, &opycon->targets);
}
static void pycon_new_data (void *cdata)
@@ -3372,7 +3371,7 @@ void copy_constraints (ListBase *dst, ListBase *src)
bConstraint *con, *srccon;
dst->first= dst->last= NULL;
- duplicatelist(dst, src);
+ BLI_duplicatelist(dst, src);
for (con=dst->first, srccon=src->first; con; srccon=srccon->next, con=con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 1a671dfe771..7fa4f406c7b 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -833,7 +833,6 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu
sum= (float *)MEM_callocN(sizeof(float)*len, "makeNurbcurve1");
resolu= (resolu*SEGMENTSU(nu));
- if((nu->flagu & CU_CYCLIC)==0) resolu++;
if(resolu==0) {
MEM_freeN(sum);
@@ -1685,7 +1684,6 @@ void makeBevelList(Object *ob)
else if((nu->type & 7)==CU_NURBS) {
if(nu->pntsv==1) {
len= (resolu*SEGMENTSU(nu));
- if((nu->flagu & CU_CYCLIC)==0) len++;
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList3");
BLI_addtail(&(cu->bev), bl);
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index e93266c85f3..05271aa59a7 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -606,7 +606,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
{
const LayerTypeInfo *typeInfo;
CustomDataLayer *layer, *newlayer;
- int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0;
+ int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0;
for(i = 0; i < source->totlayer; ++i) {
layer = &source->layers[i];
@@ -618,6 +618,8 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
number = 0;
lastactive = layer->active;
lastrender = layer->active_rnd;
+ lastclone = layer->active_clone;
+ lastmask = layer->active_mask;
lasttype = type;
}
else
@@ -637,6 +639,8 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
if(newlayer) {
newlayer->active = lastactive;
newlayer->active_rnd = lastrender;
+ newlayer->active_clone = lastclone;
+ newlayer->active_mask = lastmask;
}
}
}
@@ -736,6 +740,28 @@ int CustomData_get_render_layer_index(const CustomData *data, int type)
return -1;
}
+int CustomData_get_clone_layer_index(const CustomData *data, int type)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ return i + data->layers[i].active_clone;
+
+ return -1;
+}
+
+int CustomData_get_mask_layer_index(const CustomData *data, int type)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ return i + data->layers[i].active_mask;
+
+ return -1;
+}
+
int CustomData_get_active_layer(const CustomData *data, int type)
{
int i;
@@ -758,6 +784,27 @@ int CustomData_get_render_layer(const CustomData *data, int type)
return -1;
}
+int CustomData_get_clone_layer(const CustomData *data, int type)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ return data->layers[i].active_clone;
+
+ return -1;
+}
+
+int CustomData_get_mask_layer(const CustomData *data, int type)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ return data->layers[i].active_mask;
+
+ return -1;
+}
void CustomData_set_layer_active(CustomData *data, int type, int n)
{
@@ -777,6 +824,24 @@ void CustomData_set_layer_render(CustomData *data, int type, int n)
data->layers[i].active_rnd = n;
}
+void CustomData_set_layer_clone(CustomData *data, int type, int n)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ data->layers[i].active_clone = n;
+}
+
+void CustomData_set_layer_mask(CustomData *data, int type, int n)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ data->layers[i].active_mask = n;
+}
+
/* for using with an index from CustomData_get_active_layer_index and CustomData_get_render_layer_index */
void CustomData_set_layer_active_index(CustomData *data, int type, int n)
{
@@ -796,6 +861,23 @@ void CustomData_set_layer_render_index(CustomData *data, int type, int n)
data->layers[i].active_rnd = n-i;
}
+void CustomData_set_layer_clone_index(CustomData *data, int type, int n)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ data->layers[i].active_clone = n-i;
+}
+
+void CustomData_set_layer_mask_index(CustomData *data, int type, int n)
+{
+ int i;
+
+ for(i=0; i < data->totlayer; ++i)
+ if(data->layers[i].type == type)
+ data->layers[i].active_mask = n-i;
+}
void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
{
@@ -882,9 +964,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
if(index > 0 && data->layers[index-1].type == type) {
data->layers[index].active = data->layers[index-1].active;
data->layers[index].active_rnd = data->layers[index-1].active_rnd;
+ data->layers[index].active_clone = data->layers[index-1].active_clone;
+ data->layers[index].active_mask = data->layers[index-1].active_mask;
} else {
data->layers[index].active = 0;
data->layers[index].active_rnd = 0;
+ data->layers[index].active_clone = 0;
+ data->layers[index].active_mask = 0;
}
customData_update_offsets(data);
@@ -944,6 +1030,8 @@ int CustomData_free_layer(CustomData *data, int type, int totelem, int index)
for (; i < data->totlayer && data->layers[i].type == type; i++) {
data->layers[i].active--;
data->layers[i].active_rnd--;
+ data->layers[i].active_clone--;
+ data->layers[i].active_mask--;
}
}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 59619b25f8b..f5deda9c3c9 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -77,7 +77,6 @@
#include "BKE_scene.h"
#include "MEM_guardedalloc.h"
-#include "blendef.h"
#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 35097c05358..84025204ee4 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -60,7 +60,6 @@
#include "BLI_editVert.h"
#include "BLI_edgehash.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_displist.h"
@@ -558,6 +557,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
}
for (i=0; i<totface; i++) {
+ extern Material defmaterial; /* material.c */
MFace *mf= &mface[i];
Material *ma= give_current_material(ob, mf->mat_nr+1);
int j, vidx[4], nverts= mf->v4?4:3;
@@ -669,6 +669,8 @@ void shadeDispList(Base *base)
dl= cu->disp.first;
while(dl) {
+ extern Material defmaterial; /* material.c */
+
dlob= MEM_callocN(sizeof(DispList), "displistshade");
BLI_addtail(&ob->disp, dlob);
dlob->type= DL_VERTCOL;
@@ -739,6 +741,7 @@ void shadeDispList(Base *base)
if(dl->type==DL_INDEX4) {
if(dl->nors) {
+ extern Material defmaterial; /* material.c */
if(dl->col1) MEM_freeN(dl->col1);
col1= dl->col1= MEM_mallocN(sizeof(int)*dl->nr, "col1");
@@ -887,7 +890,6 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
}
else if((nu->type & 7)==CU_NURBS) {
len= (resolu*SEGMENTSU(nu));
- if((nu->flagu & CU_CYCLIC)==0) len++;
dl= MEM_callocN(sizeof(DispList), "makeDispListsurf");
dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts");
@@ -1370,7 +1372,7 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender)
float (*deformedVerts)[3];
if(!forRender && ob==G.obedit) {
- nubase= &editNurb;
+ //XXX nubase= &editNurb;
}
else {
nubase= &cu->nurb;
@@ -1381,7 +1383,7 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender)
for (nu=nubase->first; nu; nu=nu->next) {
if(forRender || nu->hide==0) {
if(nu->pntsv==1) {
- len= nu->pntsu*nu->resolu;
+ len= SEGMENTSU(nu)*nu->resolu;
dl= MEM_callocN(sizeof(DispList), "makeDispListsurf");
dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts");
@@ -1453,7 +1455,7 @@ void makeDispListCurveTypes(Object *ob, int forOrco)
float (*originalVerts)[3];
float (*deformedVerts)[3];
int obedit= (G.obedit && G.obedit->data==ob->data && G.obedit->type==OB_CURVE);
- ListBase *nubase = obedit?&editNurb:&cu->nurb;
+ ListBase *nubase; //XXX ListBase *nubase = obedit?&editNurb:&cu->nurb;
int numVerts;
BLI_freelistN(&(cu->bev));
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 122c6c71a6c..66e8a039dda 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -57,7 +57,6 @@
#include "BKE_action.h"
#include "BKE_anim.h" /* needed for where_on_path */
#include "BKE_armature.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_blender.h"
#include "BKE_collision.h"
#include "BKE_constraint.h"
@@ -92,7 +91,10 @@
#include <string.h>
#endif // DISABLE_ELBEEM
+//XXX #include "BIF_screen.h"
+
/* temporal struct, used for reading return of mesh_get_mapped_verts_nors() */
+
typedef struct VeNoCo {
float co[3], no[3];
} VeNoCo;
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index ee3fd59fe9f..28ed74aa9db 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -100,7 +100,6 @@
#include "DNA_view3d_types.h"
#include "DNA_userdef_types.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -125,8 +124,6 @@
#include "BPY_extern.h"
#endif
-#include "blendef.h"
-
#include "zlib.h"
static int is_dxf(char *str);
@@ -181,7 +178,6 @@ static int is_stl(char *str)
MEM_freeN(facedata); \
fclose(fpSTL); \
sprintf(error_msg, "Problems reading face %d!", i); \
- error(error_msg); \
return; \
} \
else { \
@@ -248,7 +244,7 @@ static void read_stl_mesh_binary(char *str)
fpSTL= fopen(str, "rb");
if(fpSTL==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -309,7 +305,7 @@ static void read_stl_mesh_binary(char *str)
mesh_add_normals_flags(me);
make_edges(me, 0);
}
- waitcursor(1);
+ //XXX waitcursor(1);
}
fclose(fpSTL);
@@ -321,7 +317,6 @@ static void read_stl_mesh_binary(char *str)
fclose(fpSTL); \
sprintf(error_msg, "Can't allocate storage for %d faces!", \
numtenthousand * 10000); \
- error(error_msg); \
return; \
}
@@ -330,7 +325,6 @@ static void read_stl_mesh_binary(char *str)
fclose(fpSTL); \
free(vertdata); \
sprintf(error_msg, "Line %d: %s", linenum, message); \
- error(message); \
return; \
}
@@ -366,7 +360,7 @@ static void read_stl_mesh_ascii(char *str)
fpSTL= fopen(str, "r");
if(fpSTL==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -376,7 +370,7 @@ static void read_stl_mesh_ascii(char *str)
*/
numtenthousand = 1;
vertdata = malloc(numtenthousand*3*30000*sizeof(float)); // uses realloc!
- if (!vertdata) STLALLOCERROR;
+ if (!vertdata); STLALLOCERROR;
linenum = 1;
/* Get rid of the first line */
@@ -399,7 +393,7 @@ static void read_stl_mesh_ascii(char *str)
++numtenthousand;
vertdata = realloc(vertdata,
numtenthousand*3*30000*sizeof(float));
- if (!vertdata) STLALLOCERROR;
+ if (!vertdata); STLALLOCERROR;
}
/* Don't read normal, but check line for proper syntax anyway
@@ -477,7 +471,7 @@ static void read_stl_mesh_ascii(char *str)
mesh_add_normals_flags(me);
make_edges(me, 0);
- waitcursor(1);
+ //XXX waitcursor(1);
}
#undef STLALLOCERROR
@@ -501,7 +495,7 @@ static void read_videoscape_mesh(char *str)
fp= fopen(str, "rb");
if(fp==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -510,12 +504,12 @@ static void read_videoscape_mesh(char *str)
fscanf(fp, "%d\n", &verts);
if(verts<=0) {
fclose(fp);
- error("Read error");
+ //XXX error("Read error");
return;
}
if(verts>MESH_MAX_VERTS) {
- error("too many vertices");
+ //XXX error("too many vertices");
fclose(fp);
return;
}
@@ -689,7 +683,7 @@ static void read_videoscape_mesh(char *str)
mesh_add_normals_flags(me);
make_edges(me, 0);
- waitcursor(1);
+ //XXX waitcursor(1);
}
static void read_radiogour(char *str)
@@ -707,7 +701,7 @@ static void read_radiogour(char *str)
fp= fopen(str, "rb");
if(fp==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -716,12 +710,12 @@ static void read_radiogour(char *str)
fscanf(fp, "%d\n", &verts);
if(verts<=0) {
fclose(fp);
- error("Read error");
+ //XXX error("Read error");
return;
}
if(verts>MESH_MAX_VERTS) {
- error("too many vertices");
+ //XXX error("too many vertices");
fclose(fp);
return;
}
@@ -757,7 +751,7 @@ static void read_radiogour(char *str)
if(totedge+tottria+totquad>MESH_MAX_VERTS) {
printf(" var1: %d, var2: %d, var3: %d \n", totedge, tottria, totquad);
- error("too many faces");
+ //XXX error("too many faces");
MEM_freeN(vertdata);
MEM_freeN(colvertdata);
fclose(fp);
@@ -872,7 +866,7 @@ static void read_radiogour(char *str)
mesh_add_normals_flags(me);
make_edges(me, 0);
- waitcursor(1);
+ //XXX waitcursor(1);
}
@@ -887,7 +881,7 @@ static void read_videoscape_lamp(char *str)
fp= fopen(str, "rb");
if(fp==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -932,7 +926,7 @@ static void read_videoscape_nurbs(char *str)
fp= fopen(str, "rb");
if(fp==NULL) {
- error("Can't read file");
+ //XXX error("Can't read file");
return;
}
@@ -1246,7 +1240,7 @@ static void read_inventor(char *str, struct ListBase *listb)
file= open(str, O_BINARY|O_RDONLY);
if(file== -1) {
- error("Can't read file\n");
+ //XXX error("Can't read file\n");
return;
}
@@ -2021,7 +2015,7 @@ static void displist_to_mesh(DispList *dlfirst)
}
if(totcol>16) {
- error("Found more than 16 different colors");
+ //XXX error("Found more than 16 different colors");
totcol= 16;
}
@@ -2260,7 +2254,7 @@ static void displist_to_objects(ListBase *lbase)
/* irst this: is still active */
if(ivsurf) {
where_is_object(ivsurf);
- docenter_new();
+// XXX docenter_new();
}
dl= lbase->first;
@@ -2296,7 +2290,7 @@ static void displist_to_objects(ListBase *lbase)
if(totvert==0) {
- if(ivsurf==0) error("Found no data");
+ if(ivsurf==0) ; //XXX error("Found no data");
if(lbase->first) BLI_freelistN(lbase);
return;
@@ -2382,7 +2376,7 @@ int BKE_read_exotic(char *name)
gzfile = gzopen(name,"rb");
if (NULL == gzfile ) {
- error("Can't open file: %s", name);
+ //XXX error("Can't open file: %s", name);
retval= -1;
} else {
gzread(gzfile, str, 31);
@@ -2390,11 +2384,11 @@ int BKE_read_exotic(char *name)
if ((*s0 != FORM) && (strncmp(str, "BLEN", 4) != 0) && !BLI_testextensie(name,".blend.gz")) {
- waitcursor(1);
+ //XXX waitcursor(1);
if(*s0==GOUR) {
if(G.obedit) {
- error("Unable to perform function in EditMode");
+ //XXX error("Unable to perform function in EditMode");
} else {
read_radiogour(name);
retval = 1;
@@ -2402,7 +2396,7 @@ int BKE_read_exotic(char *name)
}
else if ELEM4(*s0, DDG1, DDG2, DDG3, DDG4) {
if(G.obedit) {
- error("Unable to perform function in EditMode");
+ //XXX error("Unable to perform function in EditMode");
} else {
read_videoscape(name);
retval = 1;
@@ -2414,7 +2408,7 @@ int BKE_read_exotic(char *name)
displist_to_objects(&lbase);
retval = 1;
} else {
- error("Can only read Inventor 1.0 ascii");
+ //XXX error("Can only read Inventor 1.0 ascii");
}
}
else if((strncmp(str, "#VRML V1.0 asc", 14)==0)) {
@@ -2439,12 +2433,12 @@ int BKE_read_exotic(char *name)
if (BPY_call_importloader(name)) {
retval = 1;
} else {
- error("Unknown file type or error, check console");
+ //XXX error("Unknown file type or error, check console");
}
}
#endif /* DISABLE_PYTHON */
- waitcursor(0);
+ //XXX waitcursor(0);
}
}
}
@@ -2528,19 +2522,19 @@ void write_stl(char *str)
if (!during_script()) {
if (BLI_exists(str))
- if(saveover(str)==0)
- return;
+ ; //XXX if(saveover(str)==0)
+ //XXX return;
}
fpSTL= fopen(str, "wb");
if(fpSTL==NULL) {
- if (!during_script()) error("Can't write file");
+ if (!during_script()) ; //XXX error("Can't write file");
return;
}
strcpy(temp_dir, str);
- waitcursor(1);
+ //XXX waitcursor(1);
/* The header part of the STL */
/* First 80 characters are a title or whatever you want.
@@ -2577,7 +2571,7 @@ void write_stl(char *str)
fclose(fpSTL);
- waitcursor(0);
+ //XXX waitcursor(0);
}
static void write_videoscape_mesh(Object *ob, char *str)
@@ -2702,7 +2696,8 @@ void write_videoscape(char *str)
file= open(str,O_BINARY|O_RDONLY);
close(file);
- if(file>-1) if(!during_script() && saveover(str)==0) return;
+ //XXX saveover()
+ // if(file>-1) if(!during_script() && saveover(str)==0) return;
strcpy(temp_dir, str);
@@ -3017,18 +3012,17 @@ void write_vrml(char *str)
if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0;
if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
if(BLI_testextensie(str,".wrl")==0) strcat(str, ".wrl");
-
- if(!during_script() && saveover(str)==0) return;
+ //XXX saveover() if(!during_script() && saveover(str)==0) return;
fp= fopen(str, "w");
if(fp==NULL && !during_script()) {
- error("Can't write file");
+ //XXX error("Can't write file");
return;
}
strcpy(temp_dir, str);
- waitcursor(1);
+ //XXX waitcursor(1);
/* FIRST: write all the datablocks */
@@ -3096,7 +3090,7 @@ void write_vrml(char *str)
fclose(fp);
- waitcursor(0);
+ //XXX waitcursor(0);
}
@@ -3331,19 +3325,19 @@ void write_dxf(char *str)
if (!during_script()) {
if (BLI_exists(str))
- if(saveover(str)==0)
- return;
+ ; //XXX if(saveover(str)==0)
+ // return;
}
fp= fopen(str, "w");
if(fp==NULL && !during_script()) {
- error("Can't write file");
+ //XXX error("Can't write file");
return;
}
strcpy(temp_dir, str);
- waitcursor(1);
+ //XXX waitcursor(1);
/* The header part of the DXF */
@@ -3396,7 +3390,7 @@ void write_dxf(char *str)
write_group(0, "EOF");
fclose(fp);
- waitcursor(0);
+ //XXX waitcursor(0);
}
@@ -3523,13 +3517,14 @@ static int read_groupf(char *str)
return ret;
}
-#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);error(errmsg); return;}
+//XXX error() is now printf until we have a callback error
+#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf(errmsg); return;}
#define read_group(id,str) {id= read_groupf(str); id_test(id);}
#define group_is(idtst,str) (id==idtst&&strcmp(val,str)==0)
#define group_isnt(idtst,str) (id!=idtst||strcmp(val,str)!=0)
-#define id_check(idtst,str) if(group_isnt(idtst,str)) { fclose(dxf_fp); error("Error parsing dxf, near line %d", dxf_line); return;}
+#define id_check(idtst,str) if(group_isnt(idtst,str)) { fclose(dxf_fp); printf("Error parsing dxf, near line %d", dxf_line); return;}
static int id;
static char val[256];
@@ -4342,7 +4337,7 @@ static void dxf_read_polyline(int noob) {
} else if (vflags & 128) {
if(vids[2]==0) {
- error("(PL) Error parsing dxf, not enough vertices near line %d", dxf_line);
+ //XXX error("(PL) Error parsing dxf, not enough vertices near line %d", dxf_line);
error_exit=1;
fclose(dxf_fp);
@@ -4374,7 +4369,7 @@ static void dxf_read_polyline(int noob) {
mface->mat_nr= 0;
} else {
- error("Error parsing dxf, unknown polyline information near %d", dxf_line);
+ //XXX error("Error parsing dxf, unknown polyline information near %d", dxf_line);
error_exit=1;
fclose(dxf_fp);
@@ -4454,14 +4449,14 @@ static void dxf_read_lwpolyline(int noob) {
if (id == 10) {
vert[0]= (float) atof(val);
} else {
- error("Error parsing dxf, expected (10, <x>) at line %d", dxf_line);
+ //XXX error("Error parsing dxf, expected (10, <x>) at line %d", dxf_line);
}
read_group(id,val);
if (id == 20) {
vert[1]= (float) atof(val);
} else {
- error("Error parsing dxf, expected (20, <y>) at line %d", dxf_line);
+ //XXX error("Error parsing dxf, expected (20, <y>) at line %d", dxf_line);
}
mvert = &me->mvert[v];
@@ -4597,7 +4592,7 @@ static void dxf_read_3dface(int noob)
dxf_close_3dface();
if(nverts<3) {
- error("(3DF) Error parsing dxf, not enough vertices near line %d", dxf_line);
+ //XXX error("(3DF) Error parsing dxf, not enough vertices near line %d", dxf_line);
error_exit=1;
fclose(dxf_fp);
@@ -4710,7 +4705,7 @@ static void dxf_read(char *filename)
} else if (id==3) {
/* Now the object def should follow */
if(strlen(entname)==0) {
- error("Error parsing dxf, no mesh name near %d", dxf_line);
+ //XXX error("Error parsing dxf, no mesh name near %d", dxf_line);
fclose(dxf_fp);
return;
}
@@ -4820,7 +4815,7 @@ static void dxf_read(char *filename)
}
if(strlen(obname)==0) {
- error("Error parsing dxf, no object name near %d", dxf_line);
+ //XXX error("Error parsing dxf, no object name near %d", dxf_line);
fclose(dxf_fp);
return;
}
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 52275e507dd..a8a97742c24 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -53,7 +53,6 @@
#include "DNA_scene_types.h"
#include "BKE_utildefines.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_packedFile.h"
@@ -70,6 +69,8 @@
struct SelBox *selboxes= NULL;
+static ListBase ttfdata= {NULL, NULL};
+
/* UTF-8 <-> wchar transformations */
void
chtoutf8(unsigned long c, char *o)
@@ -270,22 +271,46 @@ static PackedFile *get_builtin_packedfile(void)
}
}
-static VFontData *vfont_get_data(VFont *vfont)
+void free_ttfont(void)
+{
+ struct TmpFont *tf;
+
+ tf= ttfdata.first;
+ while(tf) {
+ freePackedFile(tf->pf);
+ tf->pf= NULL;
+ tf->vfont= NULL;
+ tf= tf->next;
+ }
+ BLI_freelistN(&ttfdata);
+}
+
+struct TmpFont *vfont_find_tmpfont(VFont *vfont)
{
struct TmpFont *tmpfnt = NULL;
- PackedFile *tpf;
if(vfont==NULL) return NULL;
// Try finding the font from font list
- tmpfnt = G.ttfdata.first;
-
+ tmpfnt = ttfdata.first;
while(tmpfnt)
{
if(tmpfnt->vfont == vfont)
break;
tmpfnt = tmpfnt->next;
}
+ return tmpfnt;
+}
+
+static VFontData *vfont_get_data(VFont *vfont)
+{
+ struct TmpFont *tmpfnt = NULL;
+ PackedFile *tpf;
+
+ if(vfont==NULL) return NULL;
+
+ // Try finding the font from font list
+ tmpfnt = vfont_find_tmpfont(vfont);
// And then set the data
if (!vfont->data) {
@@ -309,7 +334,7 @@ static VFontData *vfont_get_data(VFont *vfont)
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
tmpfnt->pf= tpf;
tmpfnt->vfont= vfont;
- BLI_addtail(&G.ttfdata, tmpfnt);
+ BLI_addtail(&ttfdata, tmpfnt);
}
} else {
pf= newPackedFile(vfont->name);
@@ -322,7 +347,7 @@ static VFontData *vfont_get_data(VFont *vfont)
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
tmpfnt->pf= tpf;
tmpfnt->vfont= vfont;
- BLI_addtail(&G.ttfdata, tmpfnt);
+ BLI_addtail(&ttfdata, tmpfnt);
}
}
if(!pf) {
@@ -376,8 +401,6 @@ VFont *load_vfont(char *name)
if (pf) {
VFontData *vfd;
-
- waitcursor(1);
#ifdef WITH_FREETYPE2
vfd= BLI_vfontdata_from_freetypefont(pf);
@@ -402,7 +425,7 @@ VFont *load_vfont(char *name)
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
tmpfnt->pf= tpf;
tmpfnt->vfont= vfont;
- BLI_addtail(&G.ttfdata, tmpfnt);
+ BLI_addtail(&ttfdata, tmpfnt);
}
}
@@ -411,7 +434,7 @@ VFont *load_vfont(char *name)
freePackedFile(pf);
}
- waitcursor(0);
+ //XXX waitcursor(0);
}
return vfont;
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 79ecbf09f55..542a1dff651 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -25,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "DNA_listBase.h"
#include "DNA_ID.h"
@@ -37,10 +41,6 @@
#include "MEM_guardedalloc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b))
/* IDPropertyTemplate is a union in DNA_ID.h */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index d5166fc7a83..de1747e514c 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -55,6 +55,7 @@
#include "DNA_camera_types.h"
#include "DNA_sequence_types.h"
#include "DNA_texture_types.h"
+#include "DNA_sequence_types.h"
#include "DNA_userdef_types.h"
#include "BLI_arithb.h"
@@ -72,7 +73,7 @@
#include "BKE_texture.h"
#include "BKE_utildefines.h"
-#include "BIF_editseq.h"
+//XXX #include "BIF_editseq.h"
#include "PIL_time.h"
@@ -81,9 +82,6 @@
/* for stamp drawing to an image */
#include "BMF_Api.h"
-#include "blendef.h"
-#include "BSE_time.h"
-
#include "GPU_extensions.h"
#include "GPU_draw.h"
@@ -945,7 +943,7 @@ static void stampdata(StampData *stamp_data, int do_prefix)
}
if (G.scene->r.stamp & R_STAMP_MARKER) {
- TimeMarker *marker = get_frame_marker(CFRA);
+ TimeMarker *marker = NULL; // XXX get_frame_marker(G.scene->r.cfra);
if (marker) strcpy(text, marker->name);
else strcpy(text, "<none>");
@@ -1010,7 +1008,7 @@ static void stampdata(StampData *stamp_data, int do_prefix)
}
if (G.scene->r.stamp & R_STAMP_SEQSTRIP) {
- Sequence *seq = get_forground_frame_seq(CFRA);
+ Sequence *seq; //XXX = get_forground_frame_seq(G.scene->r.cfra);
if (seq) strcpy(text, seq->name+2);
else strcpy(text, "<none>");
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 29db0ddd808..8407c66d584 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -60,7 +60,6 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_action.h"
@@ -305,7 +304,7 @@ Ipo *copy_ipo (Ipo *src)
return NULL;
dst= copy_libblock(src);
- duplicatelist(&dst->curve, &src->curve);
+ BLI_duplicatelist(&dst->curve, &src->curve);
for (icu= src->curve.first; icu; icu= icu->next) {
icu->bezt= MEM_dupallocN(icu->bezt);
@@ -1539,7 +1538,7 @@ void do_ob_ipo (Object *ob)
if ((ob->id.name[2]=='S') && (ob->id.name[3]=='C') && (ob->id.name[4]=='E')) {
if (strcmp(G.scene->id.name+2, ob->id.name+6)==0) {
G.scene->lay= ob->lay;
- copy_view3d_lock(0);
+ //XXX copy_view3d_lock(0);
/* no redraw here! creates too many calls */
}
}
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 755a41ec4b2..a34da4377b1 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -45,7 +45,6 @@
#include "DNA_scene_types.h"
#include "BKE_action.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_blender.h"
#include "BKE_curve.h"
#include "BKE_global.h"
@@ -60,8 +59,6 @@
#include "BLI_blenlib.h"
-#include "blendef.h"
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -154,7 +151,7 @@ Key *copy_key(Key *key)
keyn->ipo= copy_ipo(key->ipo);
- duplicatelist(&keyn->block, &key->block);
+ BLI_duplicatelist(&keyn->block, &key->block);
kb= key->block.first;
kbn= keyn->block.first;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 6614c657647..3f9143bb405 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -70,14 +70,12 @@
#include "BKE_screen.h"
#include "BKE_utildefines.h"
-#include "BIF_editdeform.h"
+//XXX #include "BIF_editdeform.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include "blendef.h"
-
Lattice *editLatt=0;
static Lattice *deformLatt=0;
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 33c1a4da4c7..8e36ea0204b 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -76,12 +76,12 @@
#include "DNA_effect_types.h"
#include "DNA_brush_types.h"
#include "DNA_particle_types.h"
-#include "BKE_particle.h"
+#include "DNA_space_types.h"
+#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_global.h"
@@ -110,8 +110,7 @@
#include "BKE_effect.h"
#include "BKE_brush.h"
#include "BKE_idprop.h"
-
-#include "DNA_space_types.h"
+#include "BKE_particle.h"
#define MAX_IDPUP 60 /* was 24 */
@@ -195,6 +194,8 @@ ListBase *wich_libbase(Main *mainlib, short type)
return &(mainlib->brush);
case ID_PA:
return &(mainlib->particle);
+ case ID_WM:
+ return &(mainlib->wm);
}
return 0;
}
@@ -264,6 +265,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
lb[a++]= &(main->object);
lb[a++]= &(main->scene);
lb[a++]= &(main->library);
+ lb[a++]= &(main->wm);
lb[a]= NULL;
@@ -343,7 +345,7 @@ static ID *alloc_libblock_notest(short type)
id= MEM_callocN(sizeof(Text), "text");
break;
case ID_SCRIPT:
- id= MEM_callocN(sizeof(Script), "script");
+ //XXX id= MEM_callocN(sizeof(Script), "script");
break;
case ID_SO:
id= MEM_callocN(sizeof(bSound), "sound");
@@ -366,6 +368,9 @@ static ID *alloc_libblock_notest(short type)
case ID_PA:
id = MEM_callocN(sizeof(ParticleSettings), "ParticleSettings");
break;
+ case ID_WM:
+ id = MEM_callocN(sizeof(wmWindowManager), "Window manager");
+ break;
}
return id;
}
@@ -430,6 +435,13 @@ static void free_library(Library *lib)
/* no freeing needed for libraries yet */
}
+static void (*free_windowmanager_cb)(bContext *, wmWindowManager *)= NULL;
+
+void set_free_windowmanager_cb(void (*func)(bContext *C, wmWindowManager *) )
+{
+ free_windowmanager_cb= func;
+}
+
/* used in headerbuttons.c image.c mesh.c screen.c sound.c and library.c */
void free_libblock(ListBase *lb, void *idv)
{
@@ -494,7 +506,7 @@ void free_libblock(ListBase *lb, void *idv)
free_text((Text *)id);
break;
case ID_SCRIPT:
- free_script((Script *)id);
+ //XXX free_script((Script *)id);
break;
case ID_SO:
sound_free_sound((bSound *)id);
@@ -517,6 +529,10 @@ void free_libblock(ListBase *lb, void *idv)
case ID_PA:
psys_free_settings((ParticleSettings *)id);
break;
+ case ID_WM:
+ if(free_windowmanager_cb)
+ free_windowmanager_cb(NULL, (wmWindowManager *)id);
+ break;
}
if (id->properties) {
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 753058b1fdd..d697ef2de4e 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -47,7 +47,6 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_blender.h"
#include "BKE_displist.h"
#include "BKE_global.h"
@@ -860,7 +859,7 @@ void delete_material_index()
int a, actcol;
if(G.obedit) {
- error("Unable to perform function in EditMode");
+ //XXX error("Unable to perform function in EditMode");
return;
}
ob= ((G.scene->basact)? (G.scene->basact->object) : 0) ;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 79205814ae7..d84ad0a5215 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -50,7 +50,6 @@
#include "BLI_arithb.h"
#include "BKE_utildefines.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_global.h"
#include "BKE_main.h"
@@ -120,7 +119,7 @@ MetaBall *copy_mball(MetaBall *mb)
mbn= copy_libblock(mb);
- duplicatelist(&mbn->elems, &mb->elems);
+ BLI_duplicatelist(&mbn->elems, &mb->elems);
mbn->mat= MEM_dupallocN(mb->mat);
for(a=0; a<mbn->totcol; a++) {
@@ -288,6 +287,7 @@ int is_basis_mball(Object *ob)
*/
Object *find_basis_mball(Object *basis)
{
+ extern ListBase editelems; /* editmball.c */
Base *base;
Object *ob,*bob= basis;
MetaElem *ml=NULL;
@@ -1454,6 +1454,7 @@ void polygonize(PROCESS *mbproc, MetaBall *mb)
float init_meta(Object *ob) /* return totsize */
{
+ extern ListBase editelems; /* editmball.c */
Base *base;
Object *bob;
MetaBall *mb;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 77b9ea4fa2d..07a1a5c5f44 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -69,7 +69,6 @@
/* -- */
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#include "BKE_bad_level_calls.h"
#ifdef WITH_VERSE
#include "BKE_verse.h"
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 6bdd395a2ac..eebd5e6d056 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -77,7 +77,6 @@
#include "BKE_main.h"
#include "BKE_anim.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_bmesh.h"
#include "BKE_booleanops.h"
#include "BKE_cloth.h"
@@ -107,13 +106,15 @@
#include "BKE_shrinkwrap.h"
#include "BKE_simple_deform.h"
-#include "LOD_DependKludge.h"
+//XXX #include "LOD_DependKludge.h"
#include "LOD_decimation.h"
#include "CCGSubSurf.h"
#include "RE_shader_ext.h"
+//XXX #include "BIF_meshlaplacian.h"
+
/***/
static int noneModifier_isDisabled(ModifierData *md)
@@ -4055,6 +4056,8 @@ static void decimateModifier_copyData(ModifierData *md, ModifierData *target)
tdmd->percent = dmd->percent;
}
+//XXX
+#if 0
static DerivedMesh *decimateModifier_applyModifier(
ModifierData *md, Object *ob, DerivedMesh *derivedData,
int useRenderParams, int isFinalCalc)
@@ -4173,6 +4176,7 @@ static DerivedMesh *decimateModifier_applyModifier(
exit:
return result;
}
+#endif
/* Smooth */
@@ -7586,7 +7590,7 @@ static void meshdeformModifier_do(
/* progress bar redraw can make this recursive .. */
if(!recursive) {
recursive = 1;
- harmonic_coordinates_bind(mmd, vertexCos, numVerts, cagemat);
+ //XXX harmonic_coordinates_bind(mmd, vertexCos, numVerts, cagemat);
recursive = 0;
}
}
@@ -8131,7 +8135,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->flags = eModifierTypeFlag_AcceptsMesh;
mti->initData = decimateModifier_initData;
mti->copyData = decimateModifier_copyData;
- mti->applyModifier = decimateModifier_applyModifier;
+ //XXX mti->applyModifier = decimateModifier_applyModifier;
mti = INIT_TYPE(Smooth);
mti->type = eModifierTypeType_OnlyDeform;
@@ -8414,7 +8418,7 @@ void modifiers_clearErrors(Object *ob)
}
}
- if (qRedraw) allqueue(REDRAWBUTSEDIT, 0);
+// XXX if (qRedraw) allqueue(REDRAWBUTSEDIT, 0);
}
void modifiers_foreachObjectLink(Object *ob, ObjectWalkFunc walk,
@@ -8480,7 +8484,7 @@ void modifier_setError(ModifierData *md, char *format, ...)
md->error = BLI_strdup(buffer);
- allqueue(REDRAWBUTSEDIT, 0);
+// XXX allqueue(REDRAWBUTSEDIT, 0);
}
/* used for buttons, to find out if the 'draw deformed in editmode' option is
diff --git a/source/blender/blenkernel/intern/multires-firstlevel.c b/source/blender/blenkernel/intern/multires-firstlevel.c
index 3d417565eb1..8c667a9ecf0 100644
--- a/source/blender/blenkernel/intern/multires-firstlevel.c
+++ b/source/blender/blenkernel/intern/multires-firstlevel.c
@@ -38,7 +38,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "BIF_editmesh.h"
+//XXX #include "BIF_editmesh.h"
#include "BKE_customdata.h"
#include "BKE_global.h"
@@ -49,8 +49,6 @@
#include "MEM_guardedalloc.h"
-#include "blendef.h"
-
#include <string.h>
MDeformVert *subdivide_dverts(MDeformVert *src, MultiresLevel *lvl);
@@ -388,7 +386,7 @@ void multires_delete_layer(Mesh *me, CustomData *cd, const int type, int n)
CustomData_set_layer_active(cd, type, n);
CustomData_free_layer_active(cd, type, lvl1->totface);
- multires_level_to_mesh(OBACT, me, 0);
+ multires_level_to_mesh((G.scene->basact)->object, me, 0);
}
}
@@ -404,6 +402,6 @@ void multires_add_layer(Mesh *me, CustomData *cd, const int type, const int n)
CustomData_add_layer(cd, type, CD_DEFAULT, NULL, current_level(me->mr)->totface);
CustomData_set_layer_active(cd, type, n);
- multires_level_to_mesh(OBACT, me, 0);
+ multires_level_to_mesh((G.scene->basact)->object, me, 0);
}
}
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 4d312632b1a..96e81c604fa 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -35,8 +35,6 @@
#include "DNA_object_types.h"
#include "DNA_vec_types.h"
-#include "BIF_editmesh.h"
-
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
@@ -46,8 +44,7 @@
#include "BKE_global.h"
#include "BKE_multires.h"
-#include "blendef.h"
-#include "editmesh.h"
+//XXX #include "editmesh.h"
#include <math.h>
@@ -188,7 +185,7 @@ void eed_to_medge_flag(EditEdge *eed, short *flag, char *crease)
if(eed->f2==0) *flag |= ME_LOOSEEDGE;
if(eed->sharp) *flag |= ME_SHARP;
if(eed->seam) *flag |= ME_SEAM;
- if(eed->h & EM_FGON) *flag |= ME_FGON;
+ //XXX if(eed->h & EM_FGON) *flag |= ME_FGON;
if(eed->h & 1) *flag |= ME_HIDE;
*crease= (char)(255.0*eed->crease);
@@ -218,7 +215,7 @@ static void multires_get_face(MultiresFace *f, CustomData *fdata, int findex, Ed
tmp.v3= efa->v3->tmp.l;
tmp.v4= 0;
if(efa->v4) tmp.v4= efa->v4->tmp.l;
- test_index_face(&tmp, fdata, findex, efa->v4?4:3);
+ //XXX test_index_face(&tmp, fdata, findex, efa->v4?4:3);
for(j=0; j<4; ++j) f->v[j]= (&tmp.v1)[j];
/* Flags */
@@ -357,7 +354,7 @@ void multires_create(Object *ob, Mesh *me)
lvl= MEM_callocN(sizeof(MultiresLevel), "multires level");
- if(me->pv) mesh_pmv_off(ob, me);
+ //XXX if(me->pv) mesh_pmv_off(ob, me);
me->mr= MEM_callocN(sizeof(Multires), "multires data");
@@ -1037,7 +1034,7 @@ void multires_level_to_mesh(Object *ob, Mesh *me, const int render)
CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge);
CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface);
- mesh_update_customdata_pointers(me);
+ //XXX mesh_update_customdata_pointers(me);
/* Vertices/Edges/Faces */
@@ -1092,11 +1089,11 @@ void multires_level_to_mesh(Object *ob, Mesh *me, const int render)
}
- mesh_update_customdata_pointers(me);
+ //XXX mesh_update_customdata_pointers(me);
multires_edge_level_update(ob,me);
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
+ //XXX mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
}
void multires_add_level(Object *ob, Mesh *me, const char subdiv_type)
@@ -1107,7 +1104,7 @@ void multires_add_level(Object *ob, Mesh *me, const char subdiv_type)
MVert *oldverts= NULL;
lvl= MEM_callocN(sizeof(MultiresLevel), "multireslevel");
- if(me->pv) mesh_pmv_off(ob, me);
+ //XXX if(me->pv) mesh_pmv_off(ob, me);
check_colors(me);
multires_update_levels(me, 0);
@@ -1273,7 +1270,7 @@ void multires_add_level(Object *ob, Mesh *me, const char subdiv_type)
void multires_set_level(Object *ob, Mesh *me, const int render)
{
- if(me->pv) mesh_pmv_off(ob, me);
+ //XXX if(me->pv) mesh_pmv_off(ob, me);
check_colors(me);
multires_update_levels(me, render);
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 245c4179bd1..dc2bf26759f 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -73,7 +73,7 @@ void copy_actionstrip (bActionStrip **dst, bActionStrip **src){
dstrip->ipo->id.us++;
if (dstrip->modifiers.first) {
- duplicatelist (&dstrip->modifiers, &sstrip->modifiers);
+ BLI_duplicatelist (&dstrip->modifiers, &sstrip->modifiers);
}
}
@@ -84,7 +84,7 @@ void copy_nlastrips (ListBase *dst, ListBase *src)
dst->first=dst->last=NULL;
- duplicatelist (dst, src);
+ BLI_duplicatelist (dst, src);
/* Update specific data */
if (!dst->first)
@@ -97,7 +97,7 @@ void copy_nlastrips (ListBase *dst, ListBase *src)
strip->ipo->id.us++;
if (strip->modifiers.first) {
ListBase listb;
- duplicatelist (&listb, &strip->modifiers);
+ BLI_duplicatelist (&listb, &strip->modifiers);
strip->modifiers= listb;
}
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index ae81a31c373..0e43ecd61e1 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -994,7 +994,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal)
*nnode= *node;
BLI_addtail(&ntree->nodes, nnode);
- duplicatelist(&nnode->inputs, &node->inputs);
+ BLI_duplicatelist(&nnode->inputs, &node->inputs);
oldsock= node->inputs.first;
for(sock= nnode->inputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
oldsock->new_sock= sock;
@@ -1002,7 +1002,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal)
sock->own_index= 0;
}
- duplicatelist(&nnode->outputs, &node->outputs);
+ BLI_duplicatelist(&nnode->outputs, &node->outputs);
oldsock= node->outputs.first;
for(sock= nnode->outputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
if(internal)
@@ -2886,6 +2886,8 @@ static void registerTextureNodes(ListBase *ntypelist)
nodeRegisterType(ntypelist, &tex_node_curve_time);
nodeRegisterType(ntypelist, &tex_node_invert);
nodeRegisterType(ntypelist, &tex_node_hue_sat);
+ nodeRegisterType(ntypelist, &tex_node_coord);
+ nodeRegisterType(ntypelist, &tex_node_distance);
nodeRegisterType(ntypelist, &tex_node_output);
nodeRegisterType(ntypelist, &tex_node_viewer);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a25afeafaef..2d7a5283b0c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -81,7 +81,6 @@
#include "BLI_editVert.h"
#include "BKE_utildefines.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_main.h"
#include "BKE_global.h"
@@ -117,8 +116,6 @@
#include "GPU_material.h"
-#include "blendef.h"
-
/* Local function protos */
static void solve_parenting (Object *ob, Object *par, float obmat[][4], float slowmat[][4], int simul);
@@ -1417,7 +1414,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
ob->actcol= ob->totcol= 0;
if(ob->mat) MEM_freeN(ob->mat);
ob->mat = NULL;
- if ((target->totcol) && (target->mat) && OB_SUPPORT_MATERIAL(ob)) {
+ if ((target->totcol) && (target->mat) && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { //XXX OB_SUPPORT_MATERIAL
int i;
ob->colbits = target->colbits;
@@ -1717,7 +1714,7 @@ static void give_parvert(Object *par, int nr, float *vec)
cu= par->data;
nu= cu->nurb.first;
- if(par==G.obedit) nu= editNurb.first;
+ //XXX if(par==G.obedit) nu= editNurb.first;
count= 0;
while(nu && !found) {
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index f6a65bd72a5..22e4e8a8309 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -61,7 +61,6 @@
#include "BKE_image.h"
#include "BKE_font.h"
#include "BKE_packedFile.h"
-#include "BKE_bad_level_calls.h" /* <- waitcursor */
int seekPackedFile(PackedFile * pf, int offset, int whence)
{
@@ -180,7 +179,7 @@ PackedFile * newPackedFile(char * filename)
char name[FILE_MAXDIR+FILE_MAXFILE];
void * data;
- waitcursor(1);
+ //XXX waitcursor(1);
// convert relative filenames to absolute filenames
@@ -210,7 +209,7 @@ PackedFile * newPackedFile(char * filename)
close(file);
}
- waitcursor(0);
+ //XXX waitcursor(0);
return (pf);
}
@@ -283,7 +282,7 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode)
char tempname[FILE_MAXDIR + FILE_MAXFILE];
/* void * data; */
- if (guimode) waitcursor(1);
+ if (guimode); //XXX waitcursor(1);
strcpy(name, filename);
BLI_convertstringcode(name, G.sce);
@@ -306,28 +305,28 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode)
file = open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666);
if (file >= 0) {
if (write(file, pf->data, pf->size) != pf->size) {
- if(guimode) error("Error writing file: %s", name);
+ if(guimode) ; //XXX error("Error writing file: %s", name);
ret_value = RET_ERROR;
}
close(file);
} else {
- if(guimode) error("Error creating file: %s", name);
+ if(guimode); //XXX error("Error creating file: %s", name);
ret_value = RET_ERROR;
}
if (remove_tmp) {
if (ret_value == RET_ERROR) {
if (BLI_rename(tempname, name) != 0) {
- if(guimode) error("Error restoring tempfile. Check files: '%s' '%s'", tempname, name);
+ if(guimode); //XXX error("Error restoring tempfile. Check files: '%s' '%s'", tempname, name);
}
} else {
if (BLI_delete(tempname, 0, 0) != 0) {
- if(guimode) error("Error deleting '%s' (ignored)");
+ if(guimode); //XXX error("Error deleting '%s' (ignored)");
}
}
}
- if(guimode) waitcursor(0);
+ if(guimode); //XXX waitcursor(0);
return (ret_value);
}
@@ -450,7 +449,7 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how)
break;
}
- how = pupmenu(menu);
+ //XXX how = pupmenu(menu);
}
switch (how) {
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 44ee5c236fa..32da154321e 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -72,13 +72,11 @@
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_depsgraph.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_modifier.h"
#include "BKE_mesh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_pointcache.h"
-#include "blendef.h"
#include "RE_render_ext.h"
static void key_from_object(Object *ob, ParticleKey *key);
@@ -289,7 +287,7 @@ int psys_ob_has_hair(Object *ob)
}
int psys_in_edit_mode(ParticleSystem *psys)
{
- return ((G.f & G_PARTICLEEDIT) && psys==psys_get_current(OBACT) && psys->edit);
+ return ((G.f & G_PARTICLEEDIT) && psys==psys_get_current((G.scene->basact)->object) && psys->edit);
}
int psys_check_enabled(Object *ob, ParticleSystem *psys)
{
@@ -394,7 +392,7 @@ void psys_free(Object *ob, ParticleSystem * psys)
free_keyed_keys(psys);
- PE_free_particle_edit(psys);
+ //XXX PE_free_particle_edit(psys);
if(psys->particles){
MEM_freeN(psys->particles);
@@ -2353,7 +2351,7 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
//timed = edit->draw_timed;
- PE_get_colors(sel,nosel);
+ //XXX PE_get_colors(sel,nosel);
if(pset->brushtype == PE_BRUSH_WEIGHT){
sel_col[0] = sel_col[1] = sel_col[2] = 1.0f;
nosel_col[0] = nosel_col[1] = nosel_col[2] = 0.0f;
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 39226faff1e..6d8d6c233ac 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -58,7 +58,6 @@
#include "BLI_threads.h"
#include "BKE_anim.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_collision.h"
#include "BKE_displist.h"
@@ -80,10 +79,6 @@
#include "PIL_time.h"
-#include "BSE_headerbuttons.h"
-
-#include "blendef.h"
-
#include "RE_shader_ext.h"
/* fluid sim particle import */
@@ -965,7 +960,7 @@ int psys_threads_init_distribution(ParticleThread *threads, DerivedMesh *finaldm
return 0;
if (!finaldm->deformedOnly && !CustomData_has_layer( &finaldm->faceData, CD_ORIGINDEX ) ) {
- error("Can't paint with the current modifier stack, disable destructive modifiers");
+// XXX error("Can't paint with the current modifier stack, disable destructive modifiers");
return 0;
}
@@ -1555,9 +1550,9 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps
pa->lifetime= part->lifetime*ptex.life;
if(part->type==PART_HAIR)
- pa->time=0.0f;
+ pa->time= 0.0f;
else if(part->type==PART_REACTOR && (part->flag&PART_REACT_STA_END)==0)
- pa->time=MAXFRAMEF;
+ pa->time= 300000.0f; /* max frame */
else{
//icu=find_ipocurve(psys->part->ipo,PART_EMIT_TIME);
//if(icu){
@@ -4191,7 +4186,7 @@ static void hair_step(Object *ob, ParticleSystemModifierData *psmd, ParticleSyst
precalc_effectors(ob,psys,psmd,cfra);
if(psys_in_edit_mode(psys))
- PE_recalc_world_cos(ob, psys);
+ ; //XXX PE_recalc_world_cos(ob, psys);
psys_update_path_cache(ob,psmd,psys,cfra);
}
@@ -4690,7 +4685,7 @@ void particle_system_update(Object *ob, ParticleSystem *psys)
if(!psys_check_enabled(ob, psys))
return;
- cfra= bsystem_time(ob, CFRA, 0.0f);
+ cfra= bsystem_time(ob, (float)G.scene->r.cfra, 0.0f);
psmd= psys_get_modifier(ob, psys);
/* system was already updated from modifier stack */
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index d4676653a4e..596ac882d24 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -54,7 +54,6 @@
#include "BKE_softbody.h"
#include "BKE_utildefines.h"
-#include "blendef.h"
/* needed for directory lookup */
#ifndef WIN32
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index d2eb058a9a0..509cd8cf750 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -44,9 +44,7 @@
#include "DNA_object_types.h"
#include "DNA_listBase.h"
-
#include "BLI_blenlib.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_property.h"
void free_property(bProperty *prop)
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index 47d11bb9d29..e8c6c5c199f 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -37,7 +37,6 @@
#include <string.h>
#include "MEM_guardedalloc.h"
-#include "nla.h" /* For __NLA: Important, do not remove */
#include "DNA_text_types.h"
#include "DNA_controller_types.h"
#include "DNA_sensor_types.h"
@@ -45,13 +44,14 @@
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_blender.h"
#include "BKE_sca.h"
+//#include "wm_event_types.h"
+
void free_text_controllers(Text *txt)
{
Object *ob;
@@ -158,7 +158,7 @@ void init_sensor(bSensor *sens)
break;
case SENS_MOUSE:
ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens");
- ms->type= LEFTMOUSE;
+ //XXX ms->type= LEFTMOUSE;
break;
case SENS_COLLISION:
sens->data= MEM_callocN(sizeof(bCollisionSensor), "colsens");
@@ -195,7 +195,7 @@ bSensor *new_sensor(int type)
init_sensor(sens);
strcpy(sens->name, "sensor");
- make_unique_prop_names(sens->name);
+// XXX make_unique_prop_names(sens->name);
return sens;
}
@@ -319,7 +319,7 @@ bController *new_controller(int type)
init_controller(cont);
strcpy(cont->name, "cont");
- make_unique_prop_names(cont->name);
+// XXX make_unique_prop_names(cont->name);
return cont;
}
@@ -491,7 +491,7 @@ bActuator *new_actuator(int type)
init_actuator(act);
strcpy(act->name, "act");
- make_unique_prop_names(act->name);
+// XXX make_unique_prop_names(act->name);
return act;
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 1727edc10fc..096c04b7bd3 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -60,7 +60,7 @@
#include "BKE_action.h"
#include "BKE_anim.h"
#include "BKE_armature.h"
-#include "BKE_bad_level_calls.h"
+#include "BKE_colortools.h"
#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_depsgraph.h"
@@ -79,8 +79,8 @@
#include "BKE_world.h"
#include "BKE_utildefines.h"
-#include "BIF_previewrender.h"
-#include "BIF_editseq.h"
+//XXX #include "BIF_previewrender.h"
+//XXX #include "BIF_editseq.h"
#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
@@ -89,7 +89,7 @@
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
-#include "nla.h"
+//XXX #include "nla.h"
#ifdef WIN32
#else
@@ -138,7 +138,7 @@ void free_scene(Scene *sce)
/* do not free objects! */
BLI_freelistN(&sce->base);
- free_editing(sce->ed);
+ //XXX free_editing(sce->ed);
if(sce->radio) MEM_freeN(sce->radio);
sce->radio= 0;
@@ -325,7 +325,7 @@ void set_scene_bg(Scene *sce)
int flag;
// Note: this here is defined in editseq.c (BIF_editseq.h), NOT in blenkernel!
- clear_last_seq();
+ //XXX clear_last_seq();
G.scene= sce;
@@ -387,7 +387,7 @@ void set_scene_name(char *name)
}
}
- error("Can't find scene: %s", name);
+ //XXX error("Can't find scene: %s", name);
}
/* used by metaballs
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 7a45493e1f4..74e30984436 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -1,6 +1,4 @@
-
-/* screen.c
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -33,22 +31,197 @@
#include <stdio.h>
#include <math.h>
+#include "MEM_guardedalloc.h"
+
#include "DNA_screen_types.h"
-#include "BKE_bad_level_calls.h"
+#include "DNA_space_types.h"
+
#include "BLI_blenlib.h"
#include "BKE_screen.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#ifndef DISABLE_PYTHON
+#include "BPY_extern.h"
+#endif
+
+/* ************ Spacetype/regiontype handling ************** */
+
+/* keep global; this has to be accessible outside of windowmanager */
+static ListBase spacetypes= {NULL, NULL};
+
+/* not SpaceType itself */
+static void spacetype_free(SpaceType *st)
+{
+ BLI_freelistN(&st->regiontypes);
+}
+
+void BKE_spacetypes_free(void)
+{
+ SpaceType *st;
+
+ for(st= spacetypes.first; st; st= st->next) {
+ spacetype_free(st);
+ }
+
+ BLI_freelistN(&spacetypes);
+}
+
+SpaceType *BKE_spacetype_from_id(int spaceid)
+{
+ SpaceType *st;
+
+ for(st= spacetypes.first; st; st= st->next) {
+ if(st->spaceid==spaceid)
+ return st;
+ }
+ return NULL;
+}
+
+const ListBase *BKE_spacetypes_list()
+{
+ return &spacetypes;
+}
+
+void BKE_spacetype_register(SpaceType *st)
+{
+ SpaceType *stype;
+
+ /* sanity check */
+ stype= BKE_spacetype_from_id(st->spaceid);
+ if(stype) {
+ printf("error: redefinition of spacetype %s\n", stype->name);
+ spacetype_free(stype);
+ MEM_freeN(stype);
+ }
+
+ BLI_addtail(&spacetypes, st);
+}
+
+/* ***************** Space handling ********************** */
+
+void BKE_spacedata_freelist(ListBase *lb)
+{
+ SpaceLink *sl;
+ ARegion *ar;
+
+ for (sl= lb->first; sl; sl= sl->next) {
+ SpaceType *st= BKE_spacetype_from_id(sl->spacetype);
+
+ /* free regions for pushed spaces */
+ for(ar=sl->regionbase.first; ar; ar=ar->next) {
+ BKE_area_region_free(ar);
+ }
+ BLI_freelistN(&sl->regionbase);
+
+ if(st && st->free)
+ st->free(sl);
+ }
+
+ BLI_freelistN(lb);
+}
+
+ARegion *BKE_area_region_copy(ARegion *ar)
+{
+ ARegion *newar= MEM_dupallocN(ar);
+
+ newar->handlers.first= newar->handlers.last= NULL;
+ newar->uiblocks.first= newar->uiblocks.last= NULL;
+ newar->swinid= 0;
+
+ /* XXX regiondata callback */
+ if(ar->regiondata)
+ newar->regiondata= MEM_dupallocN(ar->regiondata);
+
+ return newar;
+}
+
+
+/* from lb2 to lb1, lb1 is supposed to be free'd */
+static void region_copylist(ListBase *lb1, ListBase *lb2)
+{
+ ARegion *ar;
+
+ /* to be sure */
+ lb1->first= lb1->last= NULL;
+
+ for(ar= lb2->first; ar; ar= ar->next) {
+ ARegion *arnew= BKE_area_region_copy(ar);
+ BLI_addtail(lb1, arnew);
+ }
+}
+
+
+/* lb1 should be empty */
+void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2)
+{
+ SpaceLink *sl;
+
+ lb1->first= lb2->last= NULL; /* to be sure */
+
+ for (sl= lb2->first; sl; sl= sl->next) {
+ SpaceType *st= BKE_spacetype_from_id(sl->spacetype);
+
+ if(st && st->duplicate) {
+ SpaceLink *slnew= st->duplicate(sl);
+
+ BLI_addtail(lb1, slnew);
+
+ region_copylist(&slnew->regionbase, &sl->regionbase);
+ }
+ }
+}
+
+/* not region itself */
+void BKE_area_region_free(ARegion *ar)
+{
+ if(ar && ar->type && ar->type->free)
+ ar->type->free(ar);
+}
+
+/* not area itself */
+void BKE_screen_area_free(ScrArea *sa)
+{
+ ARegion *ar, *arn;
+
+ for(ar=sa->regionbase.first; ar; ar=arn) {
+ arn= ar->next;
+ BKE_area_region_free(ar);
+ }
+
+ BKE_spacedata_freelist(&sa->spacedata);
+
+ BLI_freelistN(&sa->regionbase);
+ BLI_freelistN(&sa->actionzones);
+
+ BLI_freelistN(&sa->panels);
+ // uiFreeBlocks(&sa->uiblocks);
+ // uiFreePanels(&sa->panels);
+
+#ifndef DISABLE_PYTHON
+ BPY_free_scriptlink(&sa->scriptlink);
#endif
+}
/* don't free screen itself */
void free_screen(bScreen *sc)
{
- unlink_screen(sc);
-
+ ScrArea *sa, *san;
+ ARegion *ar, *arn;
+
+ for(ar=sc->regionbase.first; ar; ar=arn) {
+ arn= ar->next;
+ BKE_area_region_free(ar);
+ }
+ BLI_freelistN(&sc->regionbase);
+
+ for(sa= sc->areabase.first; sa; sa= san) {
+ san= sa->next;
+ BKE_screen_area_free(sa);
+ }
+
BLI_freelistN(&sc->vertbase);
BLI_freelistN(&sc->edgebase);
BLI_freelistN(&sc->areabase);
}
+
+
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
index 6145f6c3063..e34b1d0a1dd 100644
--- a/source/blender/blenkernel/intern/script.c
+++ b/source/blender/blenkernel/intern/script.c
@@ -35,7 +35,6 @@
#include "DNA_space_types.h"
#include "MEM_guardedalloc.h"
-#include "BKE_bad_level_calls.h" /* for BPY_clear_script */
/*
#include "BLI_blenlib.h"
@@ -47,15 +46,14 @@
#ifndef DISABLE_PYTHON
#include "BPY_extern.h" // Blender Python library
#endif
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
*/
/* XXX this function and so also the file should not be needed anymore,
* since we have to force clearing all Python related data before freeing
* Blender's library. Still testing, will decide later (Willian). */
+
+//XXX
+#if 0
void free_script (Script *script)
{
if (!script) return;
@@ -63,3 +61,4 @@ void free_script (Script *script)
BPY_clear_script(script);
#endif
}
+#endif
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 5d93f10526a..1ae547ba7b8 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -83,8 +83,8 @@ variables on the UI for now
#include "BKE_pointcache.h"
#include "BKE_modifier.h"
-#include "BIF_editdeform.h"
-#include "BIF_graphics.h"
+//XXX #include "BIF_editdeform.h"
+//XXX #include "BIF_graphics.h"
#include "PIL_time.h"
// #include "ONL_opennl.h" remove linking to ONL for now
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index f79009e673d..f5124ed9056 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -41,7 +41,6 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_customdata.h"
#include "BKE_DerivedMesh.h"
@@ -881,8 +880,8 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
static int hasGivenError = 0;
if(!hasGivenError) {
- error("Unrecoverable error in SubSurf calculation,"
- " mesh is inconsistent.");
+ //XXX error("Unrecoverable error in SubSurf calculation,"
+ // " mesh is inconsistent.");
hasGivenError = 1;
}
@@ -2098,7 +2097,7 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u
if (draw) {
if (draw==2) {
glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
+ glPolygonStipple(0); //XXX stipple_quarttone);
}
for (S=0; S<numVerts; S++) {
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index d33721541f8..d1d252ab210 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -40,7 +40,6 @@
#include "DNA_scene_types.h"
#include "DNA_text_types.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_text.h"
#include "BKE_library.h"
@@ -1169,7 +1168,7 @@ int txt_find_string(Text *text, char *findstr, int wrap)
void txt_cut_sel (Text *text)
{
if (!G.background) /* Python uses txt_cut_sel, which it should not, working around for now */
- txt_copy_clipboard(text);
+ ; //XXX txt_copy_clipboard(text);
txt_delete_sel(text);
txt_make_dirty(text);
@@ -1558,7 +1557,7 @@ void txt_print_undo(Text *text)
static void txt_undo_add_op(Text *text, int op)
{
- MAX_UNDO_TEST(2);
+ //XXX MAX_UNDO_TEST(2);
text->undo_pos++;
text->undo_buf[text->undo_pos]= op;
@@ -1571,7 +1570,7 @@ static void txt_undo_add_block(Text *text, int op, char *buf)
length= strlen(buf);
- MAX_UNDO_TEST(length+11);
+ //XXX MAX_UNDO_TEST(length+11);
text->undo_pos++;
text->undo_buf[text->undo_pos]= op;
@@ -1605,7 +1604,7 @@ static void txt_undo_add_block(Text *text, int op, char *buf)
void txt_undo_add_toop(Text *text, int op, unsigned int froml, unsigned short fromc, unsigned int tol, unsigned short toc)
{
- MAX_UNDO_TEST(15);
+ //XXX MAX_UNDO_TEST(15);
if (froml==tol && fromc==toc) return;
@@ -1648,7 +1647,7 @@ void txt_undo_add_toop(Text *text, int op, unsigned int froml, unsigned short fr
static void txt_undo_add_charop(Text *text, int op, char c)
{
- MAX_UNDO_TEST(4);
+ //XXX MAX_UNDO_TEST(4);
text->undo_pos++;
text->undo_buf[text->undo_pos]= op;
@@ -1869,7 +1868,7 @@ void txt_do_undo(Text *text)
text->undo_pos--;
break;
default:
- error("Undo buffer error - resetting");
+ //XXX error("Undo buffer error - resetting");
text->undo_pos= -1;
break;
@@ -2082,7 +2081,7 @@ void txt_do_redo(Text *text)
}
break;
default:
- error("Undo buffer error - resetting");
+ //XXX error("Undo buffer error - resetting");
text->undo_pos= -1;
break;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 52b88de06e0..9300b39a767 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -61,7 +61,6 @@
#include "BKE_plugin_types.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
@@ -177,8 +176,8 @@ PluginTex *add_plugin_tex(char *str)
open_plugin_tex(pit);
if(pit->doit==0) {
- if(pit->handle==0) error("no plugin: %s", str);
- else error("in plugin: %s", str);
+ if(pit->handle==0); //XXX error("no plugin: %s", str);
+ else ; //XXX error("in plugin: %s", str);
MEM_freeN(pit);
return NULL;
}
@@ -733,7 +732,7 @@ void make_local_texture(Tex *tex)
void autotexname(Tex *tex)
{
-/* extern char texstr[20][12]; *//* buttons.c, already in bad lev calls*/
+ extern char texstr[20][12]; /* buttons.c */
Image *ima;
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
diff --git a/source/blender/blenkernel/intern/verse_bitmap_node.c b/source/blender/blenkernel/intern/verse_bitmap_node.c
index 24295cd3ad0..92bdd28027f 100644
--- a/source/blender/blenkernel/intern/verse_bitmap_node.c
+++ b/source/blender/blenkernel/intern/verse_bitmap_node.c
@@ -33,7 +33,7 @@
#include "BLI_dynamiclist.h"
#include "BLI_blenlib.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
#include "BKE_verse.h"
@@ -219,10 +219,10 @@ VBitmapData *create_bitmap_data()
vbitmap->image = NULL;
- vbitmap->post_bitmap_dimension_set = post_bitmap_dimension_set;
- vbitmap->post_bitmap_layer_create = post_bitmap_layer_create;
- vbitmap->post_bitmap_layer_destroy = post_bitmap_layer_destroy;
- vbitmap->post_bitmap_tile_set = post_bitmap_tile_set;
+ //XXX vbitmap->post_bitmap_dimension_set = post_bitmap_dimension_set;
+ //XXX vbitmap->post_bitmap_layer_create = post_bitmap_layer_create;
+ //XXX vbitmap->post_bitmap_layer_destroy = post_bitmap_layer_destroy;
+ //XXX vbitmap->post_bitmap_tile_set = post_bitmap_tile_set;
return vbitmap;
}
diff --git a/source/blender/blenkernel/intern/verse_geometry_node.c b/source/blender/blenkernel/intern/verse_geometry_node.c
index 010e42d5cb7..a0afd1ef5f0 100644
--- a/source/blender/blenkernel/intern/verse_geometry_node.c
+++ b/source/blender/blenkernel/intern/verse_geometry_node.c
@@ -37,7 +37,7 @@
#include "BKE_verse.h"
#include "BKE_utildefines.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
#include "verse.h"
@@ -917,8 +917,8 @@ VLayer *create_verse_layer(
vlayer->flag = 0;
/* set up methods */
- vlayer->post_layer_create = post_layer_create;
- vlayer->post_layer_destroy = post_layer_destroy;
+ //XXX vlayer->post_layer_create = post_layer_create;
+ //XXX vlayer->post_layer_destroy = post_layer_destroy;
return vlayer;
}
@@ -942,16 +942,16 @@ VGeomData *create_geometry_data(void)
geom->hash = MEM_callocN(VEDHASHSIZE*sizeof(HashVerseEdge), "verse hashedge tab");
/* set up methods */
- geom->post_vertex_create = post_vertex_create;
- geom->post_vertex_set_xyz = post_vertex_set_xyz;
- geom->post_vertex_delete = post_vertex_delete;
- geom->post_vertex_free_constraint = post_vertex_free_constraint;
- geom->post_polygon_create = post_polygon_create;
- geom->post_polygon_set_corner = post_polygon_set_corner;
- geom->post_polygon_delete = post_polygon_delete;
- geom->post_polygon_free_constraint = post_polygon_free_constraint;
- geom->post_geometry_free_constraint = post_geometry_free_constraint;
- geom->post_polygon_set_uint8 = post_polygon_set_uint8;
+ //XXX geom->post_vertex_create = post_vertex_create;
+ //XXX geom->post_vertex_set_xyz = post_vertex_set_xyz;
+ //XXX geom->post_vertex_delete = post_vertex_delete;
+ //XXX geom->post_vertex_free_constraint = post_vertex_free_constraint;
+ //XXX geom->post_polygon_create = post_polygon_create;
+ //XXX geom->post_polygon_set_corner = post_polygon_set_corner;
+ //XXX geom->post_polygon_delete = post_polygon_delete;
+ //XXX geom->post_polygon_free_constraint = post_polygon_free_constraint;
+ //XXX geom->post_geometry_free_constraint = post_geometry_free_constraint;
+ //XXX geom->post_polygon_set_uint8 = post_polygon_set_uint8;
return geom;
}
diff --git a/source/blender/blenkernel/intern/verse_method.c b/source/blender/blenkernel/intern/verse_method.c
index 30886782019..b95b302f6c6 100644
--- a/source/blender/blenkernel/intern/verse_method.c
+++ b/source/blender/blenkernel/intern/verse_method.c
@@ -36,9 +36,8 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_library.h"
#include "BKE_text.h"
#include "BKE_verse.h"
@@ -493,7 +492,7 @@ static void cb_o_method_call(void *user_data, VNodeID node_id, uint8 group_id, u
if(text) {
txt_insert_buf(text, showstr);
txt_move_eof(text, 0);
- allqueue(REDRAWCHAT, 0);
+// XXX allqueue(REDRAWCHAT, 0);
} else {
printf("%s> %s: %s\n",arg[0].vstring, arg[1].vstring, arg[2].vstring);
}
diff --git a/source/blender/blenkernel/intern/verse_node.c b/source/blender/blenkernel/intern/verse_node.c
index 1fe86f24d6e..ee47896474a 100644
--- a/source/blender/blenkernel/intern/verse_node.c
+++ b/source/blender/blenkernel/intern/verse_node.c
@@ -34,7 +34,7 @@
#include "BLI_dynamiclist.h"
#include "BLI_blenlib.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
#include "BKE_verse.h"
@@ -206,8 +206,8 @@ static VTagGroup *create_verse_taggroup(VNode *vnode, uint16 group_id, const cha
BLI_dlist_init(&(taggroup->tags));
taggroup->queue.first = taggroup->queue.last = NULL;
- taggroup->post_tag_change = post_tag_change;
- taggroup->post_taggroup_create = post_taggroup_create;
+ //XXX taggroup->post_tag_change = post_tag_change;
+ //XXX taggroup->post_taggroup_create = post_taggroup_create;
return taggroup;
}
@@ -341,9 +341,9 @@ VNode* create_verse_node(VerseSession *session, VNodeID node_id, uint8 type, VNo
vnode->chat_flag = CHAT_NOTLOGGED;
#endif
- vnode->post_node_create = post_node_create;
- vnode->post_node_destroy = post_node_destroy;
- vnode->post_node_name_set = post_node_name_set;
+ //XXX vnode->post_node_create = post_node_create;
+ //XXX vnode->post_node_destroy = post_node_destroy;
+ //XXX vnode->post_node_name_set = post_node_name_set;
return vnode;
}
diff --git a/source/blender/blenkernel/intern/verse_object_node.c b/source/blender/blenkernel/intern/verse_object_node.c
index 89f9f0edcbd..e7827c8dc46 100644
--- a/source/blender/blenkernel/intern/verse_object_node.c
+++ b/source/blender/blenkernel/intern/verse_object_node.c
@@ -36,7 +36,7 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
#include "BKE_verse.h"
#include "BKE_utildefines.h"
@@ -244,8 +244,8 @@ VLink *create_verse_link(
vlink->flag = 0;
- vlink->post_link_set = post_link_set;
- vlink->post_link_destroy = post_link_destroy;
+ //XXX vlink->post_link_set = post_link_set;
+ //XXX vlink->post_link_destroy = post_link_destroy;
return vlink;
}
@@ -318,10 +318,10 @@ VObjectData *create_object_data(void)
/* set up pointers at post callback functions */
/* obj->post_transform = post_transform;*/
- obj->post_transform_pos = post_transform_pos;
- obj->post_transform_rot = post_transform_rot;
- obj->post_transform_scale = post_transform_scale;
- obj->post_object_free_constraint = post_object_free_constraint;
+ //XXX obj->post_transform_pos = post_transform_pos;
+ //XXX obj->post_transform_rot = post_transform_rot;
+ //XXX obj->post_transform_scale = post_transform_scale;
+ //XXX obj->post_object_free_constraint = post_object_free_constraint;
return obj;
}
diff --git a/source/blender/blenkernel/intern/verse_session.c b/source/blender/blenkernel/intern/verse_session.c
index 28a9ef85536..9771c8a46de 100644
--- a/source/blender/blenkernel/intern/verse_session.c
+++ b/source/blender/blenkernel/intern/verse_session.c
@@ -36,8 +36,8 @@
#include "BLI_dynamiclist.h"
#include "BLI_blenlib.h"
-#include "BIF_screen.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_screen.h"
+//XXX #include "BIF_verse.h"
#include "BKE_global.h"
#include "BKE_verse.h"
@@ -104,7 +104,7 @@ static void add_verse_server(VMSServer *server)
printf("Adding new verse server: %s at %s\n", newserver->name, newserver->ip);
BLI_addtail(&server_list, newserver);
- post_server_add();
+ //XXX post_server_add();
}
/*
@@ -363,11 +363,11 @@ VerseSession *create_verse_session(
session->queue.first = session->queue.last = NULL;
/* set up all client dependent functions */
- session->post_connect_accept = post_connect_accept;
- session->post_connect_terminated = post_connect_terminated;
- session->post_connect_update = post_connect_update;
+ //XXX session->post_connect_accept = post_connect_accept;
+ //XXX session->post_connect_terminated = post_connect_terminated;
+ //XXX session->post_connect_update = post_connect_update;
- post_server_add();
+ //XXX post_server_add();
return session;
}
@@ -439,7 +439,7 @@ void b_verse_ms_get(void)
if(cb_ping_registered==0) {
/* handle ping messages (for master server) */
verse_callback_set(verse_send_ping, cb_ping, NULL);
- add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
+ //XXX add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
cb_ping_registered++;
}
free_all_servers();
@@ -468,8 +468,9 @@ void b_verse_connect(char *address)
BLI_addtail(&session_list, session);
/* add verse handler if this is first session */
- if(session_list.first == session_list.last)
- add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
+ if(session_list.first == session_list.last) {
+ //XXX add_screenhandler(G.curscreen, SCREEN_HANDLER_VERSE, 1);
+ }
}
}
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 2e89ce3f805..bef372e39f1 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -45,7 +45,6 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_utildefines.h"
#include "BKE_library.h"
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index 44004eeee80..e63588e6d7f 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -50,10 +50,6 @@
#include "quicktime_export.h"
#endif
-#if defined(_WIN32) && !defined(FREE_WINDOWS)
-#include "BIF_writeavicodec.h"
-#endif
-
#ifdef WITH_FFMPEG
#include "BKE_writeffmpeg.h"
#endif
@@ -78,9 +74,9 @@ bMovieHandle *BKE_get_movie_handle(int imtype)
#endif
#if defined(_WIN32) && !defined(FREE_WINDOWS)
if (imtype == R_AVICODEC) {
- mh.start_movie= start_avi_codec;
- mh.append_movie= append_avi_codec;
- mh.end_movie= end_avi_codec;
+ //XXX mh.start_movie= start_avi_codec;
+ //XXX mh.append_movie= append_avi_codec;
+ //XXX mh.end_movie= end_avi_codec;
}
#endif
#ifdef WITH_QUICKTIME
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index cef6f802729..7008f254871 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -57,17 +57,13 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BSE_seqaudio.h"
-
#include "DNA_scene_types.h"
-#include "blendef.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -133,9 +129,9 @@ static int write_audio_frame(void)
c = get_codec_from_stream(audio_stream);
- audiostream_fill(audio_input_buffer,
- audio_input_frame_size
- * sizeof(short) * c->channels);
+ //XXX audiostream_fill(audio_input_buffer,
+ // audio_input_frame_size
+ // * sizeof(short) * c->channels);
av_init_packet(&pkt);
@@ -154,7 +150,7 @@ static int write_audio_frame(void)
pkt.stream_index = audio_stream->index;
pkt.flags |= PKT_FLAG_KEY;
if (av_interleaved_write_frame(outfile, &pkt) != 0) {
- error("Error writing audio packet");
+ //XXX error("Error writing audio packet");
return -1;
}
return 0;
@@ -276,7 +272,7 @@ static void write_video_frame(AVFrame* frame)
} else ret = 0;
if (ret != 0) {
G.afbreek = 1;
- error("Error writing frame");
+ //XXX error("Error writing frame");
}
}
@@ -294,7 +290,7 @@ static AVFrame* generate_video_frame(uint8_t* pixels)
rgb_frame = alloc_picture(PIX_FMT_RGBA32, width, height);
if (!rgb_frame) {
G.afbreek=1;
- error("Couldn't allocate temporary frame");
+ //XXX error("Couldn't allocate temporary frame");
return NULL;
}
} else {
@@ -520,7 +516,8 @@ static AVStream* alloc_video_stream(int codec_id, AVFormatContext* of,
set_ffmpeg_properties(c, "video");
if (avcodec_open(c, codec) < 0) {
- error("Couldn't initialize codec");
+ //
+ //XXX error("Couldn't initialize codec");
return NULL;
}
@@ -559,14 +556,14 @@ static AVStream* alloc_audio_stream(int codec_id, AVFormatContext* of)
c->channels = 2;
codec = avcodec_find_encoder(c->codec_id);
if (!codec) {
- error("Couldn't find a valid audio codec");
+ //XXX error("Couldn't find a valid audio codec");
return NULL;
}
set_ffmpeg_properties(c, "audio");
if (avcodec_open(c, codec) < 0) {
- error("Couldn't initialize audio codec");
+ //XXX error("Couldn't initialize audio codec");
return NULL;
}
@@ -644,20 +641,20 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
exts = get_file_extensions(ffmpeg_type);
if (!exts) {
G.afbreek = 1; /* Abort render */
- error("No valid formats found");
+ //XXX error("No valid formats found");
return;
}
fmt = guess_format(NULL, exts[0], NULL);
if (!fmt) {
G.afbreek = 1; /* Abort render */
- error("No valid formats found");
+ //XXX error("No valid formats found");
return;
}
of = av_alloc_format_context();
if (!of) {
G.afbreek = 1;
- error("Error opening output file");
+ //XXX error("Error opening output file");
return;
}
@@ -707,20 +704,20 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
if (fmt->video_codec == CODEC_ID_DVVIDEO) {
if (rectx != 720) {
G.afbreek = 1;
- error("Render width has to be 720 pixels for DV!");
+ //XXX error("Render width has to be 720 pixels for DV!");
return;
}
if (G.scene->r.frs_sec != 25 && recty != 480) {
G.afbreek = 1;
- error("Render height has to be 480 pixels "
- "for DV-NTSC!");
+ //XXX error("Render height has to be 480 pixels "
+ // "for DV-NTSC!");
return;
}
if (G.scene->r.frs_sec == 25 && recty != 576) {
G.afbreek = 1;
- error("Render height has to be 576 pixels "
- "for DV-PAL!");
+ //XXX error("Render height has to be 576 pixels "
+ // "for DV-PAL!");
return;
}
}
@@ -732,8 +729,8 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
if (ffmpeg_multiplex_audio
&& G.scene->audio.mixrate != 48000) {
G.afbreek = 1;
- error("FFMPEG only supports 48khz / stereo "
- "audio for DV!");
+ //XXX error("FFMPEG only supports 48khz / stereo "
+ // "audio for DV!");
return;
}
}
@@ -741,7 +738,7 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
video_stream = alloc_video_stream(fmt->video_codec, of, rectx, recty);
if (!video_stream) {
G.afbreek = 1;
- error("Error initializing video stream");
+ //XXX error("Error initializing video stream");
return;
}
@@ -749,20 +746,21 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
audio_stream = alloc_audio_stream(fmt->audio_codec, of);
if (!audio_stream) {
G.afbreek = 1;
- error("Error initializing audio stream");
+ //XXX error("Error initializing audio stream");
return;
}
- audiostream_play(SFRA, 0, 1);
+ //XXX audiostream_play(SFRA, 0, 1);
}
if (av_set_parameters(of, NULL) < 0) {
G.afbreek = 1;
- error("Error setting output parameters");
+ //XXX error("Error setting output parameters");
return;
}
if (!(fmt->flags & AVFMT_NOFILE)) {
if (url_fopen(&of->pb, name, URL_WRONLY) < 0) {
G.afbreek = 1;
- error("Could not open file for writing");
+ //
+ //XXX error("Could not open file for writing");
return;
}
}
@@ -778,8 +776,15 @@ void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty)
/* Get the output filename-- similar to the other output formats */
void makeffmpegstring(char* string) {
-
+
+ // XXX quick define, solve!
+#define FILE_MAXDIR 256
+#define FILE_MAXFILE 126
+
char txt[FILE_MAXDIR+FILE_MAXFILE];
+ // XXX
+#undef FILE_MAXDIR
+#undef FILE_MAXFILE
char autosplit[20];
const char ** exts = get_file_extensions(G.scene->r.ffcodecdata.type);
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index 40e1dc1bb03..64bf5f85d23 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -47,14 +47,12 @@
#include "BLI_blenlib.h"
#include "DNA_userdef_types.h"
-#include "BKE_bad_level_calls.h"
#include "BKE_global.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "DNA_scene_types.h"
-#include "blendef.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -110,14 +108,14 @@ void start_frameserver(RenderData *rd, int rectx, int recty)
if (!startup_socket_system()) {
G.afbreek = 1;
- error("Can't startup socket system");
+ //XXX error("Can't startup socket system");
return;
}
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
shutdown_socket_system();
G.afbreek = 1; /* Abort render */
- error("Can't open socket");
+ //XXX error("Can't open socket");
return;
}
@@ -131,14 +129,14 @@ void start_frameserver(RenderData *rd, int rectx, int recty)
if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
shutdown_socket_system();
G.afbreek = 1; /* Abort render */
- error("Can't bind to socket");
+ //XXX error("Can't bind to socket");
return;
}
if (listen(sock, SOMAXCONN) < 0) {
shutdown_socket_system();
G.afbreek = 1; /* Abort render */
- error("Can't establish listen backlog");
+ //XXX error("Can't establish listen backlog");
return;
}
connsock = -1;
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index e4b983d9ba3..186681fad7d 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -398,6 +398,8 @@ int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]
void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, float *x, float *v);
void PointInQuad2DUV(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
void PointInFace2DUV(int isquad, float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
+int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2]);
+int IsPointInTri2DInts(int x1, int y1, int x2, int y2, int a, int b);
int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3]);
float lambda_cp_line_ex(float p[3], float l1[3], float l2[3], float cp[3]);
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index 13d5b5fe829..f65aaa72a75 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -116,6 +116,9 @@ void BLI_sortlist(struct ListBase *listbase, int (*cmp)(void *, void *));
void BLI_freelist(struct ListBase *listbase);
int BLI_countlist(struct ListBase *listbase);
void BLI_freelinkN(ListBase *listbase, void *vlink);
+void BLI_duplicatelist(ListBase *list1, ListBase *list2); /* copy from 2 to 1 */
+
+
void BLI_splitdirstring(char *di,char *fi);
struct DynamicList *BLI_dlist_from_listbase(struct ListBase *lb);
diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h
index e5b94aecb4f..453e15a0f3b 100644
--- a/source/blender/blenlib/BLI_dynstr.h
+++ b/source/blender/blenlib/BLI_dynstr.h
@@ -56,7 +56,15 @@ DynStr* BLI_dynstr_new (void);
* @param ds The DynStr to append to.
* @param cstr The c-string to append.
*/
-void BLI_dynstr_append (DynStr *ds, char *cstr);
+void BLI_dynstr_append (DynStr *ds, const char *cstr);
+
+ /**
+ * Append a c-string to a DynStr, but with formatting like printf.
+ *
+ * @param ds The DynStr to append to.
+ * @param format The printf format string to use.
+ */
+void BLI_dynstr_appendf (DynStr *ds, const char *format, ...);
/**
* Find the length of a DynStr.
@@ -69,7 +77,7 @@ int BLI_dynstr_get_len (DynStr *ds);
/**
* Get a DynStr's contents as a c-string.
* <i> The returned c-string should be free'd
- * using BLI_freeN. </i>
+ * using MEM_freeN. </i>
*
* @param ds The DynStr of interest.
* @return The contents of @a ds as a c-string.
diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h
index e840ffd167a..ed202c11429 100644
--- a/source/blender/blenlib/BLI_linklist.h
+++ b/source/blender/blenlib/BLI_linklist.h
@@ -45,6 +45,7 @@ typedef struct LinkNode {
} LinkNode;
int BLI_linklist_length (struct LinkNode *list);
+int BLI_linklist_index (struct LinkNode *list, void *ptr);
void BLI_linklist_reverse (struct LinkNode **listp);
diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h
index 34d732e1862..a2954f8fa0d 100644
--- a/source/blender/blenlib/BLI_memarena.h
+++ b/source/blender/blenlib/BLI_memarena.h
@@ -50,6 +50,7 @@ typedef struct MemArena MemArena;
struct MemArena* BLI_memarena_new (int bufsize);
void BLI_memarena_free (struct MemArena *ma);
+void BLI_memarena_use_malloc (struct MemArena *ma);
void BLI_memarena_use_calloc (struct MemArena *ma);
void* BLI_memarena_alloc (struct MemArena *ma, int size);
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h
index fda20d73fad..01627f62e72 100644
--- a/source/blender/blenlib/BLI_storage_types.h
+++ b/source/blender/blenlib/BLI_storage_types.h
@@ -70,6 +70,18 @@ struct direntry{
struct ImBuf *image;
};
+#define SELECT 1
+#define HIDDEN 1
+#define FIRST 1
+#define ACTIVE 2
+/*#ifdef WITH_VERSE*/
+#define VERSE 3
+/*#endif*/
+#define DESELECT 0
+#define NOT_YET 0
+#define VISIBLE 0
+#define LAST 0
+
struct dirlink
{
struct dirlink *next,*prev;
diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript
index 0dc28960492..f664b75af5a 100644
--- a/source/blender/blenlib/SConscript
+++ b/source/blender/blenlib/SConscript
@@ -4,7 +4,7 @@ Import ('env')
sources = env.Glob('intern/*.c')
cflags=''
-incs = '. ../makesdna ../blenkernel #/intern/guardedalloc ../include'
+incs = '. ../makesdna ../blenkernel #/intern/guardedalloc ../editors/include'
incs += ' ' + env['BF_FREETYPE_INC']
incs += ' ' + env['BF_ZLIB_INC']
defs = ''
@@ -23,7 +23,7 @@ if env['OURPLATFORM'] == 'linux2':
cflags='-pthread'
incs += ' ../../../extern/binreloc/include'
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core', 'intern', 'player'], priority = [85,150,195], compileflags =cflags )
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 43c80dd24f0..1c539af2957 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -28,6 +28,8 @@
* Dynamically sized string ADT
*/
+#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -35,8 +37,10 @@
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#ifdef _WIN32
+#ifndef vsnprintf
+#define vsnprintf _vsnprintf
+#endif
#endif
/***/
@@ -63,7 +67,7 @@ DynStr *BLI_dynstr_new(void) {
return ds;
}
-void BLI_dynstr_append(DynStr *ds, char *cstr) {
+void BLI_dynstr_append(DynStr *ds, const char *cstr) {
DynStrElem *dse= malloc(sizeof(*dse));
int cstrlen= strlen(cstr);
@@ -79,6 +83,55 @@ void BLI_dynstr_append(DynStr *ds, char *cstr) {
ds->curlen+= cstrlen;
}
+void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
+{
+ va_list args;
+ char *message, fixedmessage[256];
+ int len= 256, maxlen= 65536, retval;
+
+ while(1) {
+ if(len == sizeof(fixedmessage))
+ message= fixedmessage;
+ else
+ message= MEM_callocN(sizeof(char)*len+1, "BLI_dynstr_appendf");
+
+ va_start(args, format);
+ retval= vsnprintf(message, len, format, args);
+ va_end(args);
+
+ if(retval == -1) {
+ /* -1 means not enough space, but on windows it may also mean
+ * there is a formatting error, so we impose a maximum length */
+ if(message != fixedmessage)
+ MEM_freeN(message);
+ message= NULL;
+
+ len *= 2;
+ if(len > maxlen) {
+ fprintf(stderr, "BLI_dynstr_append text too long or format error.\n");
+ break;
+ }
+ }
+ else if(retval > len) {
+ /* in C99 the actual length required is returned */
+ if(message != fixedmessage)
+ MEM_freeN(message);
+ message= NULL;
+
+ len= retval;
+ }
+ else
+ break;
+ }
+
+ if(message) {
+ BLI_dynstr_append(ds, message);
+
+ if(message != fixedmessage)
+ MEM_freeN(message);
+ }
+}
+
int BLI_dynstr_get_len(DynStr *ds) {
return ds->curlen;
}
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 506a1036ed6..962bbeea373 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -50,6 +50,18 @@ int BLI_linklist_length(LinkNode *list) {
}
}
+int BLI_linklist_index(struct LinkNode *list, void *ptr)
+{
+ int index;
+
+ for (index = 0; list; list= list->next, index++) {
+ if (list->link == ptr)
+ return index;
+ }
+
+ return -1;
+}
+
void BLI_linklist_reverse(LinkNode **listp) {
LinkNode *rhead= NULL, *cur= *listp;
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c
index 69dd13cd335..87d2f0426b2 100644
--- a/source/blender/blenlib/intern/BLI_memarena.c
+++ b/source/blender/blenlib/intern/BLI_memarena.c
@@ -60,6 +60,10 @@ void BLI_memarena_use_calloc(MemArena *ma) {
ma->use_calloc= 1;
}
+void BLI_memarena_use_malloc(MemArena *ma) {
+ ma->use_calloc= 0;
+}
+
void BLI_memarena_free(MemArena *ma) {
BLI_linklist_free(ma->bufs, (void(*)(void*)) MEM_freeN);
MEM_freeN(ma);
diff --git a/source/blender/blenlib/intern/Makefile b/source/blender/blenlib/intern/Makefile
index 10e032ac654..f92fa0a7e25 100644
--- a/source/blender/blenlib/intern/Makefile
+++ b/source/blender/blenlib/intern/Makefile
@@ -33,7 +33,7 @@ DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
-# CPPFLAGS += $(LEVEL_2_CPP_WARNINGS)
+CFLAGS += $(LEVEL_1_C_WARNINGS)
# path to SDNA types
CPPFLAGS += -I../../makesdna
@@ -46,7 +46,7 @@ CPPFLAGS += -I$(NAN_FREETYPE)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2
# path to blenkernel
CPPFLAGS += -I$(SRCHOME)/blender/blenkernel
-CPPFLAGS += -I../../include/
+CPPFLAGS += -I../../editors/include/
# path to zlib
CPPFLAGS += -I$(NAN_ZLIB)/include
@@ -58,4 +58,4 @@ ifeq ($(WITH_FREETYPE2), true)
endif
ifeq ($(OS),linux)
CPPFLAGS += -I$(OCGDIR)/extern/binreloc/include
-endif \ No newline at end of file
+endif
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 149d3cf1f8f..a47d37eb69a 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -1351,8 +1351,8 @@ void Mat4ToQuat( float m[][4], float *q)
void QuatOne(float *q)
{
- q[0]= q[2]= q[3]= 0.0;
- q[1]= 1.0;
+ q[0]= 1.0;
+ q[1]= q[2]= q[3]= 0.0;
}
void NormalQuat(float *q)
@@ -4394,6 +4394,63 @@ void PointInFace2DUV(int isquad, float v0[2], float v1[2], float v2[2], float v3
}
}
+int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
+{
+ /* not for quads, use for our abuse of LineIntersectsTriangleUV */
+ float p1_3d[3], p2_3d[3], v0_3d[3], v1_3d[3], v2_3d[3];
+ /* not used */
+ float lambda, uv[3];
+
+ p1_3d[0] = p2_3d[0] = uv[0]= pt[0];
+ p1_3d[1] = p2_3d[1] = uv[1]= uv[2]= pt[1];
+ p1_3d[2] = 1.0f;
+ p2_3d[2] = -1.0f;
+ v0_3d[2] = v1_3d[2] = v2_3d[2] = 0.0;
+
+ /* generate a new fuv, (this is possibly a non optimal solution,
+ * since we only need 2d calculation but use 3d func's)
+ *
+ * this method makes an imaginary triangle in 2d space using the UV's from the derived mesh face
+ * Then find new uv coords using the fuv and this face with LineIntersectsTriangleUV.
+ * This means the new values will be correct in relation to the derived meshes face.
+ */
+ Vec2Copyf(v0_3d, v0);
+ Vec2Copyf(v1_3d, v1);
+ Vec2Copyf(v2_3d, v2);
+
+ /* Doing this in 3D is not nice */
+ return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, &uv);
+}
+
+/*
+
+ x1,y2
+ | \
+ | \ .(a,b)
+ | \
+ x1,y1-- x2,y1
+
+*/
+int IsPointInTri2DInts(int x1, int y1, int x2, int y2, int a, int b)
+{
+ float v1[2], v2[2], v3[2], p[2];
+
+ v1[0]= (float)x1;
+ v1[1]= (float)y1;
+
+ v2[0]= (float)x1;
+ v2[1]= (float)y2;
+
+ v3[0]= (float)x2;
+ v3[1]= (float)y1;
+
+ p[0]= (float)a;
+ p[1]= (float)b;
+
+ return IsPointInTri2D(v1, v2, v3, p);
+
+}
+
/* (x1,v1)(t1=0)------(x2,v2)(t2=1), 0<t<1 --> (x,v)(t) */
void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, float *x, float *v)
{
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index e23c2658399..b907f77e64c 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -28,7 +28,7 @@
#include "BLI_bpath.h"
#include "BKE_global.h"
-#include "BIF_screen.h" /* only for wait cursor */
+//XXX #include "BIF_screen.h" /* only for wait cursor */
#include "DNA_ID.h" /* Library */
#include "DNA_vfont_types.h"
#include "DNA_image_types.h"
@@ -41,12 +41,13 @@
#include "BKE_main.h" /* so we can access G.main->*.first */
#include "BKE_image.h" /* so we can check the image's type */
-#include "blendef.h"
#include "BKE_utildefines.h"
#include "MEM_guardedalloc.h"
/* for sequence */
-#include "BSE_sequence.h"
+//XXX #include "BSE_sequence.h"
+//XXX define below from BSE_sequence.h - otherwise potentially odd behaviour
+#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
/* for writing to a textblock */
#include "BKE_text.h"
@@ -657,7 +658,7 @@ void findMissingFiles(char *str) {
char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX];
- waitcursor( 1 );
+ //XXX waitcursor( 1 );
BLI_split_dirfile_basic(str, dirname, NULL);
@@ -668,9 +669,9 @@ void findMissingFiles(char *str) {
libpath = BLI_bpathIterator_getLib(&bpi);
/* Check if esc was pressed because searching files can be slow */
- if (blender_test_break()) {
+ /*XXX if (blender_test_break()) {
break;
- }
+ }*/
if (libpath==NULL) {
@@ -706,5 +707,5 @@ void findMissingFiles(char *str) {
}
BLI_bpathIterator_free(&bpi);
- waitcursor( 0 );
+ //XXX waitcursor( 0 );
}
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index ebd8f4be1cf..a64185a896a 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -1,10 +1,4 @@
/*
- * blenlib/fileops.h
- *
- * cleaned up (a bit) mar-01 nzc
- *
- * More low-level file things.
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 48a40db6a72..2c114ea6971 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -49,9 +49,10 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
-#include "BIF_toolbox.h"
+//XXX #include "BIF_toolbox.h"
#include "BKE_global.h"
+#include "BKE_font.h"
#include "BKE_utildefines.h"
#include "DNA_vfont_types.h"
@@ -280,13 +281,7 @@ int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode)
struct TmpFont *tf;
// Find the correct FreeType font
- tf= G.ttfdata.first;
- while(tf)
- {
- if(tf->vfont == vfont)
- break;
- tf= tf->next;
- }
+ tf= vfont_find_tmpfont(vfont);
// What, no font found. Something strange here
if(!tf) return FALSE;
@@ -430,7 +425,7 @@ static int check_freetypefont(PackedFile * pf)
&face );
if(err) {
success = 0;
- error("This is not a valid font");
+ //XXX error("This is not a valid font");
}
else {
/*
@@ -459,7 +454,7 @@ static int check_freetypefont(PackedFile * pf)
if (glyph->format == ft_glyph_format_outline ) {
success = 1;
} else {
- error("Selected Font has no outline data");
+ //XXX error("Selected Font has no outline data");
success = 0;
}
}
@@ -477,7 +472,7 @@ VFontData *BLI_vfontdata_from_freetypefont(PackedFile *pf)
//init Freetype
err = FT_Init_FreeType( &library);
if(err) {
- error("Failed to load the Freetype font library");
+ //XXX error("Failed to load the Freetype font library");
return 0;
}
@@ -502,7 +497,7 @@ int BLI_vfontchar_from_freetypefont(VFont *vfont, unsigned long character)
// Init Freetype
err = FT_Init_FreeType(&library);
if(err) {
- error("Failed to load the Freetype font library");
+ //XXX error("Failed to load the Freetype font library");
return 0;
}
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index ca7a376d3a2..8ba03ad1343 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -47,9 +47,9 @@
#include <time.h>
#include <sys/stat.h>
-#if defined (__sun__) || defined (__sun)
+#if defined (__sun__) || defined (__sun) || defined (__sgi)
#include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
-#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sgi) || defined(__sparc) || defined(__sparc__))
+#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#include <sys/statfs.h>
#endif
@@ -179,7 +179,7 @@ double BLI_diskfree(char *dir)
return (double) (freec*bytesps*sectorspc);
#else
-#if defined (__sun__) || defined (__sun)
+#if defined (__sun__) || defined (__sun) || defined (__sgi)
struct statvfs disk;
#else
struct statfs disk;
@@ -204,9 +204,9 @@ double BLI_diskfree(char *dir)
return -1;
#endif
-#if defined (__sun__) || defined (__sun)
+#if defined (__sun__) || defined (__sun) || defined (__sgi)
if (statvfs(name, &disk)) return(-1);
-#elif !defined(__FreeBSD__) && !defined(linux) && (defined (__sgi) || defined(__sparc) || defined(__sparc__))
+#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */
if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1);
#endif
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 9df8bbc81e3..07c02b8024f 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -42,7 +42,7 @@
/* for checking system threads - BLI_system_thread_count */
#ifdef WIN32
-#include "Windows.h"
+#include "windows.h"
#elif defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 013b9e0bb1b..d3cfdf6417c 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -583,6 +583,23 @@ int BLI_findindex(ListBase *listbase, void *vlink)
return -1;
}
+void BLI_duplicatelist(ListBase *list1, ListBase *list2) /* copy from 2 to 1 */
+{
+ struct Link *link1, *link2;
+
+ list1->first= list1->last= 0;
+
+ link2= list2->first;
+ while(link2) {
+
+ link1= MEM_dupallocN(link2);
+ BLI_addtail(list1, link1);
+
+ link2= link2->next;
+ }
+}
+
+
/*=====================================================================================*/
/* Methods for access array (realloc) */
/*=====================================================================================*/
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 4aa2a229dcc..1219b1ba0c5 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -84,7 +84,7 @@ typedef struct BlendFileData {
int fileflags;
int displaymode;
int globalf;
-
+
struct bScreen* curscreen;
struct Scene* curscene;
@@ -233,8 +233,10 @@ BLO_blendhandle_close(
char *BLO_gethome(void);
int BLO_has_bfile_extension(char *str);
-void BLO_library_append(struct SpaceFile *sfile, char *dir, int idcode);
-void BLO_library_append_(BlendHandle **libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode);
+
+void BLO_library_append(struct SpaceFile *sfile, char *dir, int idcode, struct Scene *scene);
+void BLO_library_append_(BlendHandle **libfiledata, struct direntry* filelist, int totfile,
+ char *dir, char* file, short flag, int idcode, struct Scene *scene);
void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, int idcode, short flag, struct Scene *scene);
BlendFileData* blo_read_blendafterruntime(int file, char *name, int actualsize, BlendReadError *error_r);
diff --git a/source/blender/blenloader/BLO_writefile.h b/source/blender/blenloader/BLO_writefile.h
index 96eb770411f..0b88cb1fb77 100644
--- a/source/blender/blenloader/BLO_writefile.h
+++ b/source/blender/blenloader/BLO_writefile.h
@@ -32,10 +32,12 @@
#define BLO_WRITEFILE_H
struct MemFile;
+struct bContext;
-extern int BLO_write_file(char *dir, int write_flags, char **error_r);
-extern int BLO_write_file_mem(struct MemFile *compare, struct MemFile *current, int write_flags, char **error_r);
-extern void BLO_write_runtime(char *file, char *exename);
+extern int BLO_write_file(struct bContext *C, char *dir, int write_flags, char **error_r);
+extern int BLO_write_file_mem(struct bContext *C, struct MemFile *compare, struct MemFile *current,
+ int write_flags, char **error_r);
+extern void BLO_write_runtime(struct bContext *C, char *file, char *exename);
#endif
diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript
index e4e39e6cac4..ac3b1262cb7 100644
--- a/source/blender/blenloader/SConscript
+++ b/source/blender/blenloader/SConscript
@@ -4,7 +4,7 @@ Import ('env')
sources = env.Glob('intern/*.c')
incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
-incs += ' ../makesdna ../readblenfile ../include'
+incs += ' ../makesdna ../readblenfile ../editors/include'
incs += ' ../render/extern/include'
incs += ' ' + env['BF_ZLIB_INC']
diff --git a/source/blender/blenloader/intern/Makefile b/source/blender/blenloader/intern/Makefile
index 74db1947b63..4f729d98d00 100644
--- a/source/blender/blenloader/intern/Makefile
+++ b/source/blender/blenloader/intern/Makefile
@@ -67,7 +67,7 @@ CPPFLAGS += -I../../render/extern/include/
CPPFLAGS += -I../../python
# we still refer to /include a bit...
-CPPFLAGS += -I../../include
+CPPFLAGS += -I../../editors/include
# path to our own external headerfiles
CPPFLAGS += -I..
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index e4bc6e3abb2..d5f5bb663ab 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -43,6 +43,7 @@
#include "BLI_ghash.h"
#include "BLI_linklist.h"
+#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
@@ -59,7 +60,6 @@
#include "BLO_undofile.h"
#include "readfile.h"
-#include "genfile.h"
#include "BLO_readblenfile.h"
@@ -239,7 +239,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype)
}
} else if (bhead->code==DATA) {
if (looking) {
- if (bhead->SDNAnr == dna_findstruct_nr(fd->filesdna, "PreviewImage") ) {
+ if (bhead->SDNAnr == DNA_struct_find_nr(fd->filesdna, "PreviewImage") ) {
prv = (PreviewImage*) (bhead+1);
npreviews = 0;
memcpy(new_prv, prv, sizeof(PreviewImage));
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 423d050c862..df2c680c951 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -20,18 +20,13 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "zlib.h"
#ifdef WIN32
@@ -53,8 +48,6 @@
#include <io.h> // for open close read
#endif
-#include "nla.h"
-
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_ID.h"
@@ -69,6 +62,7 @@
#include "DNA_customdata_types.h"
#include "DNA_effect_types.h"
#include "DNA_fileglobal_types.h"
+#include "DNA_genfile.h"
#include "DNA_group_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_ipo_types.h"
@@ -104,16 +98,13 @@
#include "DNA_userdef_types.h"
#include "DNA_vfont_types.h"
#include "DNA_world_types.h"
+#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_storage_types.h" // for relname flags
-#include "BDR_sculptmode.h"
-
-#include "BKE_bad_level_calls.h" // for reopen_text build_seqar (from WHILE_SEQ) set_rects_butspace check_imasel_copy
-
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_cloth.h"
@@ -147,19 +138,16 @@
#include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
#include "BKE_idprop.h"
-#include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
-#include "BIF_filelist.h" // badlevel too, where to move this? - elubie
-#include "BIF_previewrender.h" // bedlelvel, for struct RenderInfo
+//XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
+//XXX #include "BIF_filelist.h" // badlevel too, where to move this? - elubie
+//XXX #include "BIF_previewrender.h" // bedlelvel, for struct RenderInfo
#include "BLO_readfile.h"
#include "BLO_undofile.h"
#include "BLO_readblenfile.h" // streaming read pipe, for BLO_readblenfile BLO_readblenfilememory
#include "readfile.h"
-#include "genfile.h"
-
-#include "mydevice.h"
-#include "blendef.h"
+//XXX #include "wm_event_types.h"
#include <errno.h>
@@ -804,12 +792,12 @@ static int read_file_dna(FileData *fd)
if (bhead->code==DNA1) {
int do_endian_swap= (fd->flags&FD_FLAGS_SWITCH_ENDIAN)?1:0;
- fd->filesdna= dna_sdna_from_data(&bhead[1], bhead->len, do_endian_swap);
+ fd->filesdna= DNA_sdna_from_data(&bhead[1], bhead->len, do_endian_swap);
if (fd->filesdna) {
- fd->compflags= dna_get_structDNA_compareflags(fd->filesdna, fd->memsdna);
+ fd->compflags= DNA_struct_get_compareflags(fd->filesdna, fd->memsdna);
/* used to retrieve ID names from (bhead+1) */
- fd->id_name_offs= dna_elem_offset(fd->filesdna, "ID", "char", "name[]");
+ fd->id_name_offs= DNA_elem_offset(fd->filesdna, "ID", "char", "name[]");
}
return 1;
@@ -918,8 +906,6 @@ static int fd_read_from_memfile(FileData *filedata, void *buffer, int size)
static FileData *filedata_new(void)
{
- extern unsigned char DNAstr[]; /* DNA.c */
- extern int DNAlen;
FileData *fd = MEM_callocN(sizeof(FileData), "FileData");
fd->filedes = -1;
@@ -929,7 +915,7 @@ static FileData *filedata_new(void)
* but it keeps us reentrant, remove once we have
* a lib that provides a nice lock. - zr
*/
- fd->memsdna = dna_sdna_from_data(DNAstr, DNAlen, 0);
+ fd->memsdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
fd->datamap = oldnewmap_new();
fd->globmap = oldnewmap_new();
@@ -1036,9 +1022,9 @@ void blo_freefiledata(FileData *fd)
BLI_freelistN(&fd->listbase);
if (fd->memsdna)
- dna_freestructDNA(fd->memsdna);
+ DNA_sdna_free(fd->memsdna);
if (fd->filesdna)
- dna_freestructDNA(fd->filesdna);
+ DNA_sdna_free(fd->filesdna);
if (fd->compflags)
MEM_freeN(fd->compflags);
@@ -1236,7 +1222,7 @@ static void switch_endian_structs(struct SDNA *filesdna, BHead *bhead)
nblocks= bhead->nr;
while(nblocks--) {
- dna_switch_endian_struct(filesdna, bhead->SDNAnr, data);
+ DNA_struct_switch_endian(filesdna, bhead->SDNAnr, data);
data+= blocksize;
}
@@ -1253,7 +1239,7 @@ static void *read_struct(FileData *fd, BHead *bh, char *blockname)
if (fd->compflags[bh->SDNAnr]) { /* flag==0: doesn't exist anymore */
if(fd->compflags[bh->SDNAnr]==2) {
- temp= dna_reconstruct(fd->memsdna, fd->filesdna, fd->compflags, bh->SDNAnr, bh->nr, (bh+1));
+ temp= DNA_struct_reconstruct(fd->memsdna, fd->filesdna, fd->compflags, bh->SDNAnr, bh->nr, (bh+1));
} else {
temp= MEM_mallocN(bh->len, blockname);
memcpy(temp, (bh+1), bh->len);
@@ -3115,7 +3101,7 @@ static void lib_link_object(FileData *fd, Main *main)
ob= ob->id.next;
}
- if(warn) error("WARNING IN CONSOLE");
+ if(warn); //XXX error("WARNING IN CONSOLE");
}
@@ -3502,7 +3488,7 @@ static void lib_link_scene(FileData *fd, Main *main)
ed= sce->ed;
if(ed) {
- WHILE_SEQ(&ed->seqbase) {
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
if(seq->sound) {
@@ -3576,7 +3562,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
if(sce->sculptdata.cumap)
direct_link_curvemapping(fd, sce->sculptdata.cumap);
else
- sculpt_reset_curve(&sce->sculptdata);
+ ; //XXX sculpt_reset_curve(&sce->sculptdata);
if(sce->ed) {
ListBase *old_seqbasep= &((Editing *)sce->ed)->seqbase;
@@ -3586,7 +3572,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
/* recursive link sequences, lb will be correctly initialized */
link_recurs_seq(fd, &ed->seqbase);
- WHILE_SEQ(&ed->seqbase) {
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
seq->seq1= newdataadr(fd, seq->seq1);
seq->seq2= newdataadr(fd, seq->seq2);
seq->seq3= newdataadr(fd, seq->seq3);
@@ -3738,7 +3724,7 @@ static Sequence * find_sequence_from_ipo_helper(Main * main, Ipo * ipo)
ed= sce->ed;
- WHILE_SEQ(&ed->seqbase) {
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
if (seq->ipo == ipo) {
found = 1;
break;
@@ -3778,6 +3764,47 @@ static void lib_link_screen_sequence_ipos(Main *main)
}
}
+/* ************ READ WM ***************** */
+
+static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm)
+{
+ wmWindow *win;
+
+ wm->id.us= 1;
+ link_list(fd, &(wm->windows));
+
+ for(win= wm->windows.first; win; win= win->next) {
+ win->ghostwin= NULL;
+ win->eventstate= NULL;
+ win->curswin= NULL;
+
+ win->queue.first= win->queue.last= NULL;
+ win->handlers.first= win->handlers.last= NULL;
+ win->subwindows.first= win->subwindows.last= NULL;
+ }
+
+ wm->operators.first= wm->operators.last= NULL;
+ wm->keymaps.first= wm->keymaps.last= NULL;
+
+ wm->queue.first= wm->queue.last= NULL;
+ wm->reports.first= wm->reports.last= NULL;
+
+ wm->windrawable= NULL;
+ wm->initialized= 0;
+}
+
+static void lib_link_windowmanager(FileData *fd, Main *main)
+{
+ wmWindowManager *wm;
+
+ for(wm= main->wm.first; wm; wm= wm->id.next) {
+ wmWindow *win;
+ for(win= wm->windows.first; win; win= win->next) {
+ win->screen= newlibadr(fd, NULL, win->screen);
+ }
+ }
+}
+
/* ************ READ SCREEN ***************** */
/* relinks grease-pencil data for 3d-view(s) - used for direct_link */
@@ -3857,7 +3884,7 @@ static void lib_link_screen(FileData *fd, Main *main)
SpaceButs *sbuts= (SpaceButs *)sl;
sbuts->lockpoin= NULL;
sbuts->ri= NULL;
- if(main->versionfile<132) set_rects_butspace(sbuts);
+// XXX if(main->versionfile<132) set_rects_butspace(sbuts);
}
else if(sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
@@ -4044,7 +4071,7 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene)
else if(sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs *)sl;
sbuts->lockpoin= NULL;
- if (sbuts->ri) sbuts->ri->curtile = 0;
+ //XXX if (sbuts->ri) sbuts->ri->curtile = 0;
}
else if(sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
@@ -4055,7 +4082,7 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene)
else if(sl->spacetype==SPACE_IMASEL) {
SpaceImaSel *simasel= (SpaceImaSel *)sl;
if (simasel->files) {
- BIF_filelist_freelib(simasel->files);
+ //XXX BIF_filelist_freelib(simasel->files);
}
}
else if(sl->spacetype==SPACE_ACTION) {
@@ -4135,8 +4162,10 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
link_list(fd, &(sc->vertbase));
link_list(fd, &(sc->edgebase));
link_list(fd, &(sc->areabase));
- sc->winakt= 0;
+ sc->regionbase.first= sc->regionbase.last= NULL;
+ sc->mainwin= sc->subwinactive= 0; /* indices */
+
/* hacky patch... but people have been saving files with the verse-blender,
causing the handler to keep running for ever, with no means to disable it */
for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
@@ -4147,8 +4176,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
/* edges */
- se= sc->edgebase.first;
- while(se) {
+ for(se= sc->edgebase.first; se; se= se->next) {
se->v1= newdataadr(fd, se->v1);
se->v2= newdataadr(fd, se->v2);
if( (intptr_t)se->v1 > (intptr_t)se->v2) {
@@ -4161,21 +4189,29 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
printf("error reading screen... file corrupt\n");
se->v1= se->v2;
}
- se= se->next;
}
/* areas */
- sa= sc->areabase.first;
- while(sa) {
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
Panel *pa;
SpaceLink *sl;
+ ARegion *ar;
link_list(fd, &(sa->spacedata));
link_list(fd, &(sa->panels));
+ link_list(fd, &(sa->regionbase));
+ sa->handlers.first= sa->handlers.last= NULL;
+ sa->uiblocks.first= sa->uiblocks.last= NULL;
+ sa->type= NULL; /* spacetype callbacks */
+
/* accident can happen when read/save new file with older version */
- if(sa->spacedata.first==NULL && sa->spacetype>SPACE_NLA)
- sa->spacetype= SPACE_EMPTY;
+ /* 2.50: we now always add spacedata for info */
+ if(sa->spacedata.first==NULL) {
+ SpaceInfo *sinfo= MEM_callocN(sizeof(SpaceInfo), "spaceinfo");
+ sa->spacetype= SPACE_INFO;
+ BLI_addtail(&sa->spacedata, sinfo);
+ }
for(pa= sa->panels.first; pa; pa=pa->next) {
pa->paneltab= newdataadr(fd, pa->paneltab);
@@ -4246,20 +4282,24 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
}
}
+
+ for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ ar->handlers.first= ar->handlers.last= NULL;
+ ar->uiblocks.first= ar->uiblocks.last= NULL;
+ ar->regiondata= NULL;
+ ar->swinid= 0;
+ ar->type= NULL;
+ }
+
+ sa->actionzones.first= sa->actionzones.last= NULL;
sa->v1= newdataadr(fd, sa->v1);
sa->v2= newdataadr(fd, sa->v2);
sa->v3= newdataadr(fd, sa->v3);
sa->v4= newdataadr(fd, sa->v4);
- sa->win= sa->headwin= 0;
-
- sa->uiblocks.first= sa->uiblocks.last= NULL;
-
/* space handler scriptlinks */
direct_link_scriptlink(fd, &sa->scriptlink);
-
- sa= sa->next;
}
}
@@ -4281,7 +4321,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
BLI_remlink(&main->library, lib);
MEM_freeN(lib);
- error("Library had multiple instances, save and reload!");
+ //XXX error("Library had multiple instances, save and reload!");
return;
}
}
@@ -4474,9 +4514,20 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
allocname= dataname(GS(id->name));
/* read all data */
+
while(bhead && bhead->code==DATA) {
- void *data= read_struct(fd, bhead, allocname);
-
+ void *data;
+#if 0
+ /* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
+ short *sp= fd->filesdna->structs[bhead->SDNAnr];
+ char *allocname = fd->filesdna->types[ sp[0] ];
+ char *tmp= malloc(100);
+
+ strcpy(tmp, allocname);
+ data= read_struct(fd, bhead, tmp);
+#endif
+ data= read_struct(fd, bhead, allocname);
+
if (data) {
oldnewmap_insert(fd->datamap, bhead->old, data, 0);
}
@@ -4486,6 +4537,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
/* init pointers direct data */
switch( GS(id->name) ) {
+ case ID_WM:
+ direct_link_windowmanager(fd, (wmWindowManager *)id);
+ break;
case ID_SCR:
direct_link_screen(fd, (bScreen *)id);
break;
@@ -4580,16 +4634,36 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
return (bhead);
}
-static void link_global(FileData *fd, BlendFileData *bfd, FileGlobal *fg)
+/* note, this has to be kept for reading older files... */
+/* also version info is written here */
+static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
{
- // this is nonsense... make it struct once (ton)
+ FileGlobal *fg= read_struct(fd, bhead, "Global");
+
+ /* copy to bfd handle */
+ bfd->main->subversionfile= fg->subversion;
+ bfd->main->minversionfile= fg->minversion;
+ bfd->main->minsubversionfile= fg->minsubversion;
+
bfd->winpos= fg->winpos;
bfd->fileflags= fg->fileflags;
bfd->displaymode= fg->displaymode;
bfd->globalf= fg->globalf;
- bfd->curscreen= newlibadr(fd, 0, fg->curscreen);
- bfd->curscene= newlibadr(fd, 0, fg->curscene);
+ bfd->curscreen= fg->curscreen;
+ bfd->curscene= fg->curscene;
+
+ MEM_freeN(fg);
+
+ return blo_nextbhead(fd, bhead);
+}
+
+/* note, this has to be kept for reading older files... */
+static void link_global(FileData *fd, BlendFileData *bfd)
+{
+
+ bfd->curscreen= newlibadr(fd, 0, bfd->curscreen);
+ bfd->curscene= newlibadr(fd, 0, bfd->curscene);
// this happens in files older than 2.35
if(bfd->curscene==NULL) {
if(bfd->curscreen) bfd->curscene= bfd->curscreen->scene;
@@ -4622,18 +4696,18 @@ static void vcol_to_fcol(Mesh *me)
static int map_223_keybd_code_to_224_keybd_code(int code)
{
switch (code) {
- case 312: return F12KEY;
- case 159: return PADSLASHKEY;
- case 161: return PAD0;
- case 154: return PAD1;
- case 150: return PAD2;
- case 155: return PAD3;
- case 151: return PAD4;
- case 156: return PAD5;
- case 152: return PAD6;
- case 157: return PAD7;
- case 153: return PAD8;
- case 158: return PAD9;
+//XXX case 312: return F12KEY;
+//XXX case 159: return PADSLASHKEY;
+//XXX case 161: return PAD0;
+//XXX case 154: return PAD1;
+//XXX case 150: return PAD2;
+//XXX case 155: return PAD3;
+//XXX case 151: return PAD4;
+//XXX case 156: return PAD5;
+//XXX case 152: return PAD6;
+//XXX case 157: return PAD7;
+//XXX case 153: return PAD8;
+//XXX case 158: return PAD9;
default: return code;
}
}
@@ -4979,6 +5053,185 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
}
}
+/* 2.50 patch */
+static void area_add_header_region(ScrArea *sa, ListBase *lb)
+{
+ ARegion *ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ if(sa->headertype==1)
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ else
+ ar->alignment= RGN_ALIGN_TOP;
+
+ /* initialise view2d data for header region, to allow panning */
+ /* is copy from ui_view2d.c */
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ ar->v2d.keepofs = V2D_LOCKOFS_Y;
+ ar->v2d.keeptot = 2; // this keeps the view in place when region size changes...
+ ar->v2d.align = V2D_ALIGN_NO_NEG_X;
+
+}
+
+/* 2.50 patch */
+static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
+{
+ ARegion *ar;
+
+ if(sl) {
+ /* first channels for ipo action nla... */
+ switch(sl->spacetype) {
+ case SPACE_IPO:
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_RIGHT;
+
+ break;
+ case SPACE_ACTION:
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+ break;
+ case SPACE_NLA:
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+ break;
+ }
+ }
+ /* main region */
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+
+ BLI_addtail(lb, ar);
+ ar->winrct= sa->totrct;
+
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ if(sl) {
+ /* if active spacetype has view2d data, copy that over to main region */
+ switch(sl->spacetype) {
+ case SPACE_OOPS:
+ {
+ SpaceOops *soops= (SpaceOops *)sl;
+
+ memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
+
+ ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_HORIZONTAL_O);
+ ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+ ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT);
+ ar->v2d.keeptot = 2;
+ }
+ break;
+ case SPACE_TIME:
+ {
+ SpaceTime *stime= (SpaceTime *)sl;
+ memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
+ ar->v2d.keepofs |= V2D_LOCKOFS_Y;
+ ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
+ ar->v2d.tot.ymin= ar->v2d.cur.ymin= -10.0;
+ ar->v2d.min[1]= ar->v2d.max[1]= 20.0;
+ }
+ break;
+ case SPACE_IPO:
+ {
+ SpaceIpo *sipo= (SpaceIpo *)sl;
+ memcpy(&ar->v2d, &sipo->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_LEFT);
+ break;
+ }
+ case SPACE_SOUND:
+ {
+ SpaceSound *ssound= (SpaceSound *)sl;
+ memcpy(&ar->v2d, &ssound->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_LEFT);
+ break;
+ }
+ case SPACE_NLA:
+ {
+ SpaceNla *snla= (SpaceNla *)sl;
+ memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ break;
+ }
+ case SPACE_ACTION:
+ {
+ SpaceAction *saction= (SpaceAction *)sl;
+ memcpy(&ar->v2d, &saction->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ break;
+ }
+ case SPACE_SEQ:
+ {
+ SpaceSeq *sseq= (SpaceSeq *)sl;
+ memcpy(&ar->v2d, &sseq->v2d, sizeof(View2D));
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_SCALE_RIGHT);
+ break;
+ }
+ case SPACE_NODE:
+ {
+ SpaceNode *snode= (SpaceNode *)sl;
+ memcpy(&ar->v2d, &snode->v2d, sizeof(View2D));
+ break;
+ }
+ case SPACE_BUTS:
+ {
+ SpaceButs *sbuts= (SpaceButs *)sl;
+ memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
+ ar->v2d.keepzoom |= V2D_KEEPASPECT;
+ break;
+ }
+ //case SPACE_XXX: // FIXME... add other ones
+ // memcpy(&ar->v2d, &((SpaceXxx *)sl)->v2d, sizeof(View2D));
+ // break;
+ }
+ }
+}
+
+static void do_versions_windowmanager_2_50(bScreen *screen)
+{
+ ScrArea *sa;
+ ARegion *ar;
+ SpaceLink *sl;
+
+ /* add regions */
+ for(sa= screen->areabase.first; sa; sa= sa->next) {
+
+ /* we keep headertype variable to convert old files only */
+ if(sa->headertype)
+ area_add_header_region(sa, &sa->regionbase);
+
+ area_add_window_regions(sa, sa->spacedata.first, &sa->regionbase);
+
+ /* pushed back spaces also need regions! */
+ if(sa->spacedata.first) {
+ sl= sa->spacedata.first;
+ for(sl= sl->next; sl; sl= sl->next) {
+ if(sa->headertype)
+ area_add_header_region(sa, &sl->regionbase);
+ area_add_window_regions(sa, sl, &sl->regionbase);
+ }
+ }
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -5306,7 +5559,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
while(sl) {
if(sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs*) sl;
- sbuts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK;
+ //XXX sbuts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK;
}
sl= sl->next;
}
@@ -5954,52 +6207,52 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if (sl->spacetype==SPACE_BUTS) {
SpaceButs *sbuts= (SpaceButs *) sl;
- sbuts->v2d.maxzoom= 1.2f;
- sbuts->align= 1; /* horizontal default */
-
- if(sbuts->mainb==BUTS_LAMP) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
- }
- else if(sbuts->mainb==BUTS_MAT) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
- }
- else if(sbuts->mainb==BUTS_TEX) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX;
- }
- else if(sbuts->mainb==BUTS_ANIM) {
- sbuts->mainb= CONTEXT_OBJECT;
- }
- else if(sbuts->mainb==BUTS_WORLD) {
- sbuts->mainb= CONTEXT_SCENE;
- sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_WORLD;
- }
- else if(sbuts->mainb==BUTS_RENDER) {
- sbuts->mainb= CONTEXT_SCENE;
- sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_RENDER;
- }
- else if(sbuts->mainb==BUTS_GAME) {
- sbuts->mainb= CONTEXT_LOGIC;
- }
- else if(sbuts->mainb==BUTS_FPAINT) {
- sbuts->mainb= CONTEXT_EDITING;
- }
- else if(sbuts->mainb==BUTS_RADIO) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_RAD;
- }
- else if(sbuts->mainb==BUTS_CONSTRAINT) {
- sbuts->mainb= CONTEXT_OBJECT;
- }
- else if(sbuts->mainb==BUTS_SCRIPT) {
- sbuts->mainb= CONTEXT_OBJECT;
- }
- else if(sbuts->mainb==BUTS_EDIT) {
- sbuts->mainb= CONTEXT_EDITING;
- }
- else sbuts->mainb= CONTEXT_SCENE;
+//XXX sbuts->v2d.maxzoom= 1.2f;
+//XXX sbuts->align= 1; /* horizontal default */
+//XXX
+//XXX if(sbuts->mainb==BUTS_LAMP) {
+//XXX sbuts->mainb= CONTEXT_SHADING;
+//XXX sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_MAT) {
+//XXX sbuts->mainb= CONTEXT_SHADING;
+//XXX sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_TEX) {
+//XXX sbuts->mainb= CONTEXT_SHADING;
+//XXX sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_ANIM) {
+//XXX sbuts->mainb= CONTEXT_OBJECT;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_WORLD) {
+//XXX sbuts->mainb= CONTEXT_SCENE;
+//XXX sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_WORLD;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_RENDER) {
+//XXX sbuts->mainb= CONTEXT_SCENE;
+//XXX sbuts->tab[CONTEXT_SCENE]= TAB_SCENE_RENDER;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_GAME) {
+//XXX sbuts->mainb= CONTEXT_LOGIC;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_FPAINT) {
+//XXX sbuts->mainb= CONTEXT_EDITING;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_RADIO) {
+//XXX sbuts->mainb= CONTEXT_SHADING;
+//XXX sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_RAD;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_CONSTRAINT) {
+//XXX sbuts->mainb= CONTEXT_OBJECT;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_SCRIPT) {
+//XXX sbuts->mainb= CONTEXT_OBJECT;
+//XXX }
+//XXX else if(sbuts->mainb==BUTS_EDIT) {
+//XXX sbuts->mainb= CONTEXT_EDITING;
+//XXX }
+//XXX else sbuts->mainb= CONTEXT_SCENE;
}
}
}
@@ -6269,7 +6522,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
while(sce) {
ed= sce->ed;
if(ed) {
- WHILE_SEQ(&ed->seqbase) {
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
if(seq->type==SEQ_IMAGE || seq->type==SEQ_MOVIE) seq->flag |= SEQ_MAKE_PREMUL;
}
END_SEQ
@@ -7245,8 +7498,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
simasel->v2d.minzoom= 0.5f;
simasel->v2d.maxzoom= 1.21f;
simasel->v2d.scroll= 0;
- simasel->v2d.keepaspect= 1;
- simasel->v2d.keepzoom= 1;
+ simasel->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
simasel->v2d.keeptot= 0;
simasel->prv_h = 96;
simasel->prv_w = 96;
@@ -8006,6 +8258,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+
+ if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 2)) {
+ Scene *sce;
+
+ /* Note, these will need to be added for painting */
+ for (sce= main->scene.first; sce; sce= sce->id.next) {
+ sce->toolsettings->imapaint.seam_bleed = 2;
+ sce->toolsettings->imapaint.normal_angle = 80;
+ }
+ }
+
+ if (main->versionfile < 250) {
+ bScreen *screen;
+
+ for(screen= main->screen.first; screen; screen= screen->id.next)
+ do_versions_windowmanager_2_50(screen);
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
@@ -8017,6 +8287,7 @@ static void lib_link_all(FileData *fd, Main *main)
{
oldnewmap_sort(fd);
+ lib_link_windowmanager(fd, main);
lib_link_screen(fd, main);
lib_link_scene(fd, main);
lib_link_object(fd, main);
@@ -8047,6 +8318,7 @@ static void lib_link_all(FileData *fd, Main *main)
lib_link_library(fd, main); /* only init users */
}
+
static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
{
Link *link;
@@ -8080,20 +8352,15 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
while(bhead) {
switch(bhead->code) {
- case GLOB:
case DATA:
case DNA1:
case TEST:
case REND:
- if (bhead->code==GLOB) {
- fg= read_struct(fd, bhead, "Global");
- /* set right away */
- bfd->main->subversionfile= fg->subversion;
- bfd->main->minversionfile= fg->minversion;
- bfd->main->minsubversionfile= fg->minsubversion;
- }
bhead = blo_nextbhead(fd, bhead);
break;
+ case GLOB:
+ bhead= read_global(bfd, fd, bhead);
+ break;
case USER:
bhead= read_userdef(bfd, fd, bhead);
break;
@@ -8112,6 +8379,10 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
bhead = read_libblock(fd, fd->mainlist.last, bhead, LIB_READ+LIB_EXTERN, NULL);
break;
+ /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
+ case ID_SCRN:
+ bhead->code= ID_SCR;
+ /* deliberate pass on to default */
default:
bhead = read_libblock(fd, bfd->main, bhead, LIB_LOCAL, NULL);
}
@@ -8129,11 +8400,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r)
lib_verify_nodetree(bfd->main, 1);
fix_relpaths_library(fd->filename, bfd->main); /* make all relative paths, relative to the open blend file */
- if(fg)
- link_global(fd, bfd, fg); /* as last */
-
- /* removed here: check for existance of curscreen/scene, moved to kernel setup_app */
- MEM_freeN(fg);
+ link_global(fd, bfd); /* as last */
return bfd;
}
@@ -9005,10 +9272,9 @@ static void append_named_part(FileData *fd, Main *mainvar, Scene *scene, char *n
if(id==NULL) ob= mainvar->object.last;
else ob= (Object *)id;
- /* this is bad code... G.vd nor G.scene should be used on this level... */
+ /* XXX use context to find view3d->lay */
if((flag & FILE_ACTIVELAY)) {
- if(G.vd) ob->lay= G.vd->layact;
- else ob->lay = G.scene->lay;
+ scene->lay;
}
base->lay= ob->lay;
base->object= ob;
@@ -9050,7 +9316,7 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r)
/* common routine to append/link something from a library */
-static Library* library_append( Scene *scene, char* file, char *dir, int idcode,
+static Library* library_append(Scene *scene, char* file, char *dir, int idcode,
int totsel, FileData **fd, struct direntry* filelist, int totfile, short flag)
{
Main *mainl;
@@ -9125,27 +9391,29 @@ static Library* library_append( Scene *scene, char* file, char *dir, int idcode,
/* this is a version of BLO_library_append needed by the BPython API, so
* scripts can load data from .blend files -- see Blender.Library module.*/
-/* append to G.scene */
+/* append to scene */
/* this should probably be moved into the Python code anyway */
void BLO_script_library_append(BlendHandle **bh, char *dir, char *name,
int idcode, short flag, Scene *scene )
{
/* try to append the requested object */
- library_append( scene, name, dir, idcode, 0, (FileData **)bh, NULL, 0, flag );
+ library_append(scene, name, dir, idcode, 0, (FileData **)bh, NULL, 0, flag );
/* do we need to do this? */
- DAG_scene_sort(G.scene);
+ DAG_scene_sort(scene);
}
-/* append to G.scene */
+/* append to scene */
/* dir is a full path */
-void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
+void BLO_library_append(SpaceFile *sfile, char *dir, int idcode, Scene *scene)
{
- BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile, dir, sfile->file, sfile->flag, idcode);
+ BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile,
+ dir, sfile->file, sfile->flag, idcode, scene);
}
-void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode)
+void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile,
+ char *dir, char* file, short flag, int idcode, Scene *scene)
{
Library *curlib;
Base *centerbase;
@@ -9166,20 +9434,20 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
if( strcmp(filelist[a].relname, file)==0) break;
}
if(a==totfile) {
- error("Wrong indicated name");
+ //XXX error("Wrong indicated name");
return;
}
}
else {
- error("Nothing indicated");
+ //XXX error("Nothing indicated");
return;
}
}
/* now we have or selected, or an indicated file */
- if(flag & FILE_AUTOSELECT) scene_deselect_all(G.scene);
+ if(flag & FILE_AUTOSELECT) scene_deselect_all(scene);
- curlib = library_append( G.scene, file, dir, idcode, totsel, (FileData**) libfiledata, filelist, totfile,flag );
+ curlib = library_append(scene, file, dir, idcode, totsel, (FileData**) libfiledata, filelist, totfile,flag );
/* when not linking (appending)... */
if((flag & FILE_LINK)==0) {
@@ -9189,7 +9457,7 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
INIT_MINMAX(min, max);
- centerbase= (G.scene->base.first);
+ centerbase= (scene->base.first);
while(centerbase) {
if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
VECCOPY(vec, centerbase->object->loc);
@@ -9202,10 +9470,10 @@ void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, i
centerloc[0]= (min[0]+max[0])/2;
centerloc[1]= (min[1]+max[1])/2;
centerloc[2]= (min[2]+max[2])/2;
- curs = G.scene->cursor;
+ curs = scene->cursor;
VECSUB(centerloc,curs,centerloc);
- centerbase= (G.scene->base.first);
+ centerbase= (scene->base.first);
while(centerbase) {
if(centerbase->object->id.lib==curlib && centerbase->object->parent==NULL) {
ob= centerbase->object;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index e06e7eb2d85..96611b6fa9d 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1,7 +1,4 @@
-/* writefile.c
- *
- * .blend file writing
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -23,9 +20,8 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -71,10 +67,6 @@ Any case: direct data is ALWAYS after the lib block
- write USER if filename is ~/.B.blend
*/
-/* for version 2.2+
-Important to know is that 'streaming' has been added to files, for Blender Publisher
-*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -97,8 +89,6 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include <string.h>
#include <stdlib.h>
-#include "nla.h" // __NLA is defined
-
#include "DNA_armature_types.h"
#include "DNA_action_types.h"
#include "DNA_actuator_types.h"
@@ -111,6 +101,7 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include "DNA_curve_types.h"
#include "DNA_customdata_types.h"
#include "DNA_effect_types.h"
+#include "DNA_genfile.h"
#include "DNA_group_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_image_types.h"
@@ -146,13 +137,13 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include "DNA_vfont_types.h"
#include "DNA_userdef_types.h"
#include "DNA_world_types.h"
+#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h" // MEM_freeN
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BKE_action.h"
-#include "BKE_bad_level_calls.h" // build_seqar (from WHILE_SEQ) free_oops error
#include "BKE_blender.h"
#include "BKE_cloth.h"
#include "BKE_curve.h"
@@ -171,7 +162,7 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include "BKE_idprop.h"
#ifdef WITH_VERSE
#include "BKE_verse.h"
-#include "BIF_verse.h"
+//XXX #include "BIF_verse.h"
#endif
#include "BLO_writefile.h"
@@ -179,7 +170,6 @@ Important to know is that 'streaming' has been added to files, for Blender Publi
#include "BLO_undofile.h"
#include "readfile.h"
-#include "genfile.h"
#include <errno.h>
@@ -200,9 +190,6 @@ typedef struct {
static WriteData *writedata_new(int file)
{
- extern unsigned char DNAstr[]; /* DNA.c */
- extern int DNAlen;
-
WriteData *wd= MEM_callocN(sizeof(*wd), "writedata");
/* XXX, see note about this in readfile.c, remove
@@ -211,7 +198,7 @@ static WriteData *writedata_new(int file)
if (wd == NULL) return NULL;
- wd->sdna= dna_sdna_from_data(DNAstr, DNAlen, 0);
+ wd->sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0);
wd->file= file;
@@ -238,7 +225,7 @@ static void writedata_do_write(WriteData *wd, void *mem, int memlen)
static void writedata_free(WriteData *wd)
{
- dna_freestructDNA(wd->sdna);
+ DNA_sdna_free(wd->sdna);
MEM_freeN(wd->buf);
MEM_freeN(wd);
@@ -356,7 +343,7 @@ static void writestruct(WriteData *wd, int filecode, char *structname, int nr, v
bh.old= adr;
bh.nr= nr;
- bh.SDNAnr= dna_findstruct_nr(wd->sdna, structname);
+ bh.SDNAnr= DNA_struct_find_nr(wd->sdna, structname);
if(bh.SDNAnr== -1) {
printf("error: can't find SDNA code <%s>\n", structname);
return;
@@ -491,14 +478,14 @@ static void write_scriptlink(WriteData *wd, ScriptLink *slink)
writedata(wd, DATA, sizeof(short)*slink->totscript, slink->flag);
}
-static void write_renderinfo(WriteData *wd) /* for renderdeamon */
+static void write_renderinfo(bContext *C, WriteData *wd) /* for renderdeamon */
{
Scene *sce;
int data[8];
sce= G.main->scene.first;
while(sce) {
- if(sce->id.lib==0 && ( sce==G.scene || (sce->r.scemode & R_BG_RENDER)) ) {
+ if(sce->id.lib==0 && ( sce==C->scene || (sce->r.scemode & R_BG_RENDER)) ) {
data[0]= sce->r.sfra;
data[1]= sce->r.efra;
@@ -1181,7 +1168,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
struct VNode *vnode = (VNode*)mesh->vnode;
if(vnode) {
/* mesh has to be created from verse geometry node*/
- create_meshdata_from_geom_node(mesh, vnode);
+ //XXX create_meshdata_from_geom_node(mesh, vnode);
/* pointer at verse node can't be stored in file */
mesh->vnode = NULL;
}
@@ -1483,13 +1470,14 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
writestruct(wd, DATA, "Editing", 1, ed);
/* reset write flags too */
- WHILE_SEQ(&ed->seqbase) {
+
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
if(seq->strip) seq->strip->done= 0;
writestruct(wd, DATA, "Sequence", 1, seq);
}
END_SEQ
- WHILE_SEQ(&ed->seqbase) {
+ WHILE_SEQ(&ed->seqbase) { //XXX todo replace WHILE_SEQ
if(seq->strip && seq->strip->done==0) {
/* write strip with 'done' at 0 because readfile */
@@ -1608,6 +1596,19 @@ static void write_gpencil(WriteData *wd, bGPdata *gpd)
}
}
+static void write_windowmanagers(WriteData *wd, ListBase *lb)
+{
+ wmWindowManager *wm;
+ wmWindow *win;
+
+ for(wm= lb->first; wm; wm= wm->id.next) {
+ writestruct(wd, ID_WM, "wmWindowManager", 1, wm);
+
+ for(win= wm->windows.first; win; win= win->next)
+ writestruct(wd, DATA, "wmWindow", 1, win);
+ }
+}
+
static void write_screens(WriteData *wd, ListBase *scrbase)
{
bScreen *sc;
@@ -1617,35 +1618,32 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
sc= scrbase->first;
while(sc) {
+
/* write LibData */
- writestruct(wd, ID_SCR, "Screen", 1, sc);
- if (sc->id.properties) IDP_WriteProperty(sc->id.properties, wd);
+ /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
+ writestruct(wd, ID_SCRN, "Screen", 1, sc);
+ if (sc->id.properties)
+ IDP_WriteProperty(sc->id.properties, wd);
/* direct data */
- sv= sc->vertbase.first;
- while(sv) {
+ for(sv= sc->vertbase.first; sv; sv= sv->next)
writestruct(wd, DATA, "ScrVert", 1, sv);
- sv= sv->next;
- }
- se= sc->edgebase.first;
- while(se) {
+ for(se= sc->edgebase.first; se; se= se->next)
writestruct(wd, DATA, "ScrEdge", 1, se);
- se= se->next;
- }
- sa= sc->areabase.first;
- while(sa) {
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
SpaceLink *sl;
Panel *pa;
+ ARegion *ar;
writestruct(wd, DATA, "ScrArea", 1, sa);
- pa= sa->panels.first;
- while(pa) {
+ for(pa= sa->panels.first; pa; pa= pa->next)
writestruct(wd, DATA, "Panel", 1, pa);
- pa= pa->next;
- }
+
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ writestruct(wd, DATA, "ARegion", 1, ar);
/* space handler scriptlinks */
write_scriptlink(wd, &sa->scriptlink);
@@ -1684,7 +1682,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
Oops *oopsn= oops->next;
if(oops->id==0) {
BLI_remlink(&so->oops, oops);
- free_oops(oops);
+// XXX free_oops(oops);
}
oops= oopsn;
}
@@ -1743,8 +1741,6 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
}
sl= sl->next;
}
-
- sa= sa->next;
}
sc= sc->id.next;
@@ -2014,13 +2010,17 @@ static void write_scripts(WriteData *wd, ListBase *idbase)
}
}
-static void write_global(WriteData *wd)
+/* context is usually defined by WM, two cases where no WM is available:
+ * - for forward compatibility, curscreen has to be saved
+ * - for undofile, curscene needs to be saved */
+/* XXX still remap G */
+static void write_global(bContext *C, WriteData *wd)
{
FileGlobal fg;
char subvstr[8];
- fg.curscreen= G.curscreen;
- fg.curscene= G.scene;
+ fg.curscreen= C->screen;
+ fg.curscene= C->scene;
fg.displaymode= G.displaymode;
fg.winpos= G.winpos;
fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns...
@@ -2037,7 +2037,8 @@ static void write_global(WriteData *wd)
}
/* if MemFile * there's filesave to memory */
-static int write_file_handle(int handle, MemFile *compare, MemFile *current, int write_user_block, int write_flags)
+static int write_file_handle(bContext *C, int handle, MemFile *compare, MemFile *current,
+ int write_user_block, int write_flags)
{
BHead bhead;
ListBase mainlist;
@@ -2051,11 +2052,14 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (G.order==B_ENDIAN)?'V':'v', G.version);
mywrite(wd, buf, 12);
- write_renderinfo(wd);
- write_global(wd);
+ write_renderinfo(C, wd);
+ write_global(C, wd);
- if(current==NULL)
- write_screens (wd, &G.main->screen); /* no UI save in undo */
+ /* no UI save in undo */
+ if(current==NULL) {
+ write_windowmanagers(wd, &G.main->wm);
+ write_screens (wd, &G.main->screen);
+ }
write_scenes (wd, &G.main->scene);
write_curves (wd, &G.main->curve);
write_mballs (wd, &G.main->mball);
@@ -2086,7 +2090,7 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
if (write_user_block) {
write_userdef(wd);
}
-
+
/* dna as last, because (to be implemented) test for which structs are written */
writedata(wd, DNA1, wd->sdna->datalen, wd->sdna->data);
@@ -2102,7 +2106,7 @@ static int write_file_handle(int handle, MemFile *compare, MemFile *current, int
}
/* return: success (1) */
-int BLO_write_file(char *dir, int write_flags, char **error_r)
+int BLO_write_file(bContext *C, char *dir, int write_flags, char **error_r)
{
char userfilename[FILE_MAXDIR+FILE_MAXFILE];
char tempname[FILE_MAXDIR+FILE_MAXFILE];
@@ -2120,7 +2124,7 @@ int BLO_write_file(char *dir, int write_flags, char **error_r)
write_user_block= BLI_streq(dir, userfilename);
- err= write_file_handle(file, NULL,NULL, write_user_block, write_flags);
+ err= write_file_handle(C, file, NULL,NULL, write_user_block, write_flags);
close(file);
if(!err) {
@@ -2157,11 +2161,11 @@ int BLO_write_file(char *dir, int write_flags, char **error_r)
}
/* return: success (1) */
-int BLO_write_file_mem(MemFile *compare, MemFile *current, int write_flags, char **error_r)
+int BLO_write_file_mem(bContext *C, MemFile *compare, MemFile *current, int write_flags, char **error_r)
{
int err;
- err= write_file_handle(0, compare, current, 0, write_flags);
+ err= write_file_handle(C, 0, compare, current, 0, write_flags);
if(err==0) return 1;
return 0;
@@ -2259,7 +2263,8 @@ cleanup:
return 1;
}
-void BLO_write_runtime(char *file, char *exename) {
+void BLO_write_runtime(bContext *C, char *file, char *exename)
+{
char gamename[FILE_MAXDIR+FILE_MAXFILE];
int outfd = -1;
char *cause= NULL;
@@ -2277,7 +2282,7 @@ void BLO_write_runtime(char *file, char *exename) {
outfd= open(gamename, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
if (outfd != -1) {
- write_file_handle(outfd, NULL,NULL, 0, G.fileflags);
+ write_file_handle(C, outfd, NULL,NULL, 0, G.fileflags);
if (write(outfd, " ", 1) != 1) {
cause= "Unable to write to output file";
@@ -2297,7 +2302,8 @@ cleanup:
#else /* !__APPLE__ */
-static int handle_append_runtime(int handle, char *exename, char **cause_r) {
+static int handle_append_runtime(int handle, char *exename, char **cause_r)
+{
char *cause= NULL, *runtime= get_runtime_path(exename);
unsigned char buf[1024];
int count, progfd= -1;
@@ -2333,7 +2339,8 @@ cleanup:
return 1;
}
-static int handle_write_msb_int(int handle, int i) {
+static int handle_write_msb_int(int handle, int i)
+{
unsigned char buf[4];
buf[0]= (i>>24)&0xFF;
buf[1]= (i>>16)&0xFF;
@@ -2343,7 +2350,8 @@ static int handle_write_msb_int(int handle, int i) {
return (write(handle, buf, 4)==4);
}
-void BLO_write_runtime(char *file, char *exename) {
+void BLO_write_runtime(bContext *C, char *file, char *exename)
+{
int outfd= open(file, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0777);
char *cause= NULL;
int datastart;
@@ -2357,7 +2365,7 @@ void BLO_write_runtime(char *file, char *exename) {
datastart= lseek(outfd, 0, SEEK_CUR);
- write_file_handle(outfd, NULL,NULL, 0, G.fileflags);
+ write_file_handle(C, outfd, NULL,NULL, 0, G.fileflags);
if (!handle_write_msb_int(outfd, datastart) || (write(outfd, "BRUNTIME", 8)!=8)) {
cause= "Unable to write to output file";
@@ -2369,7 +2377,7 @@ cleanup:
close(outfd);
if (cause)
- error("Unable to make runtime: %s", cause);
+ ; //XXX error("Unable to make runtime: %s", cause);
}
#endif /* !__APPLE__ */
diff --git a/source/blender/src/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index e2757dbc75d..44557558bc6 100644
--- a/source/blender/src/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -24,18 +24,19 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC *.c)
+FILE(GLOB SRC */*.c)
-SET(INC
+SET(INC ../windowmanager
+ ../editors/include
../../../intern/guardedalloc ../../../intern/memutil
- ../blenlib ../makesdna ../blenkernel
+ ../blenlib ../makesdna ../makesrna ../blenkernel
../include ../../../intern/bmfont ../imbuf ../render/extern/include
../../../intern/bsp/extern ../radiosity/extern/include
../../../intern/decimation/extern ../blenloader ../python
../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue
../quicktime ../../../intern/elbeem/extern
- ../../../intern/ghost ../../../intern/opennl/extern
- ../nodes ../../../extern/glew/include ../gpu
+ ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include
+ ../nodes
${PYTHON_INC}
${SDL_INC}
)
@@ -74,12 +75,9 @@ IF(BF_BUILDINFO)
ADD_DEFINITIONS(-DNAN_BUILDINFO)
ENDIF(BF_BUILDINFO)
-BLENDERLIB_NOLIST(src "${SRC}" "${INC}")
+BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
IF(WITH_VERSE)
- ADD_DEPENDENCIES(src mkprot verse)
+ ADD_DEPENDENCIES(bf_editors mkprot verse)
ENDIF(WITH_VERSE)
-IF(NOT WITH_ELBEEM)
- ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_ELBEEM)
diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile
new file mode 100644
index 00000000000..59450f31711
--- /dev/null
+++ b/source/blender/editors/Makefile
@@ -0,0 +1,34 @@
+#
+# $Id: Makefile
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) Blender Foundation.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Bounces make to subdirectories.
+
+SOURCEDIR = source/blender/editors
+DIRS = datafiles screen space_outliner space_time space_view3d interface util space_api space_ipo space_image space_node space_buttons space_info space_file space_sound space_action space_nla space_script space_text space_sequencer
+
+include nan_subdirs.mk
diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript
new file mode 100644
index 00000000000..84afc5512a7
--- /dev/null
+++ b/source/blender/editors/SConscript
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+Import ('env')
+
+
+SConscript(['datafiles/SConscript',
+ 'space_api/SConscript',
+ 'util/SConscript',
+ 'interface/SConscript',
+ 'mesh/SConscript',
+ 'object/SConscript',
+ 'space_buttons/SConscript',
+ 'space_file/SConscript',
+ 'space_image/SConscript',
+ 'space_info/SConscript',
+ 'space_ipo/SConscript',
+ 'space_node/SConscript',
+ 'space_outliner/SConscript',
+ 'space_time/SConscript',
+ 'space_view3d/SConscript',
+ 'space_sound/SConscript',
+ 'space_action/SConscript',
+ 'space_nla/SConscript',
+ 'space_script/SConscript',
+ 'space_text/SConscript',
+ 'space_sequencer/SConscript',
+ 'transform/SConscript',
+ 'screen/SConscript'])
diff --git a/source/blender/editors/datafiles/B.blend.c b/source/blender/editors/datafiles/B.blend.c
new file mode 100644
index 00000000000..0a33fc99013
--- /dev/null
+++ b/source/blender/editors/datafiles/B.blend.c
@@ -0,0 +1,3076 @@
+/* DataToC output of file <B_blend> */
+
+int datatoc_B_blend_size= 98212;
+char datatoc_B_blend[]= {
+ 66, 76, 69, 78,
+ 68, 69, 82, 95,118, 50, 52, 49, 82, 69, 78, 68, 32, 0, 0, 0,144,240,255,191, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+250, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 83, 82, 0, 0,
+116, 0, 0, 0, 8,237,195, 8,109, 0, 0, 0, 1, 0, 0, 0, 96, 40,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 82, 49, 45, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+232,150,192, 8,168,240,195, 8,232,240,195, 8, 24,247,195, 8, 96,247,195, 8,152, 31,196, 8,136,251,196, 8, 0, 0,231, 3,
+143, 1,174, 4,232, 3, 32, 3, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,150,192, 8,110, 0, 0, 0, 1, 0, 0, 0,168,237,195, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,237,195, 8,110, 0, 0, 0, 1, 0, 0, 0,
+232,237,195, 8,232,150,192, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,237,195, 8,
+110, 0, 0, 0, 1, 0, 0, 0, 40,238,195, 8,168,237,195, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65,
+ 20, 0, 0, 0, 40,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,238,195, 8,232,237,195, 8, 0, 0, 0, 0,232, 3, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,238,195, 8, 40,238,195, 8,
+ 0, 0, 0, 0,232, 3,248, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0,
+232,238,195, 8,104,238,195, 8, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,238,195, 8,
+110, 0, 0, 0, 1, 0, 0, 0, 40,239,195, 8,168,238,195, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65,
+ 20, 0, 0, 0, 40,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,239,195, 8,232,238,195, 8, 0, 0, 0, 0,160, 2,248, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,239,195, 8, 40,239,195, 8,
+ 0, 0, 0, 0,160, 2, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0,
+232,239,195, 8,104,239,195, 8, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,239,195, 8,
+110, 0, 0, 0, 1, 0, 0, 0, 40,240,195, 8,168,239,195, 8, 0, 0, 0, 0,232, 3,188, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 20, 0, 0, 0, 40,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,240,195, 8,232,239,195, 8, 0, 0, 0, 0,204, 0,248, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,240,195, 8, 40,240,195, 8,
+ 0, 0, 0, 0,204, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0,104,240,195, 8, 0, 0, 0, 0,204, 0,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,232,240,195, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 48,241,195, 8, 0, 0, 0, 0,168,237,195, 8,232,237,195, 8, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 48,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0,120,241,195, 8,232,240,195, 8,232,150,192, 8,
+ 40,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,120,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0,
+192,241,195, 8, 48,241,195, 8,168,237,195, 8,168,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+192,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 8,242,195, 8,120,241,195, 8,232,237,195, 8,232,238,195, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,242,195, 8,192,241,195, 8,
+168,238,195, 8,232,238,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,242,195, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,152,242,195, 8, 8,242,195, 8,104,238,195, 8, 40,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,152,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0,224,242,195, 8, 80,242,195, 8,232,238,195, 8,104,239,195, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 40,243,195, 8,
+152,242,195, 8, 40,239,195, 8,104,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 40,243,195, 8,
+111, 0, 0, 0, 1, 0, 0, 0,112,243,195, 8,224,242,195, 8,104,238,195, 8,232,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,112,243,195, 8,111, 0, 0, 0, 1, 0, 0, 0,184,243,195, 8, 40,243,195, 8,232,150,192, 8,
+168,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,243,195, 8,111, 0, 0, 0, 1, 0, 0, 0,
+ 0,244,195, 8,112,243,195, 8,104,238,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+ 0,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 72,244,195, 8,184,243,195, 8, 40,238,195, 8,232,239,195, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 72,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0,144,244,195, 8, 0,244,195, 8,
+168,239,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,244,195, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,216,244,195, 8, 72,244,195, 8, 40,239,195, 8, 40,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,216,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 32,245,195, 8,144,244,195, 8,168,238,195, 8,104,240,195, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 32,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0,104,245,195, 8,
+216,244,195, 8,104,239,195, 8,104,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104,245,195, 8,
+111, 0, 0, 0, 1, 0, 0, 0,176,245,195, 8, 32,245,195, 8, 40,240,195, 8,104,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,176,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0,248,245,195, 8,104,245,195, 8,168,239,195, 8,
+168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0,
+ 64,246,195, 8,176,245,195, 8,232,239,195, 8,168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+ 64,246,195, 8,111, 0, 0, 0, 1, 0, 0, 0,136,246,195, 8,248,245,195, 8,104,238,195, 8, 40,240,195, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,136,246,195, 8,111, 0, 0, 0, 1, 0, 0, 0,208,246,195, 8, 64,246,195, 8,
+ 40,240,195, 8,168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,246,195, 8,111, 0, 0, 0,
+ 1, 0, 0, 0, 24,247,195, 8,136,246,195, 8,168,238,195, 8,168,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0, 24,247,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,208,246,195, 8,104,240,195, 8,168,240,195, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 96,247,195, 8,113, 0, 0, 0, 1, 0, 0, 0,104, 5,196, 8,
+ 0, 0, 0, 0,232,150,192, 8,168,239,195, 8,232,239,195, 8, 40,238,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
+ 0, 0, 0, 0,187, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,161, 0, 0, 0,187, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
+ 0, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,233, 3,161, 0, 3, 0, 3, 0, 79, 1, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 2,196, 8,232, 3,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 88,248,195, 8, 24, 2,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 88,248,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 40,249,195, 8,
+ 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 40,249,195, 8,112, 0, 0, 0, 1, 0, 0, 0,248,249,195, 8, 88,248,195, 8, 77,101,115,104,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
+105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+248,249,195, 8,112, 0, 0, 0, 1, 0, 0, 0,200,250,195, 8, 40,249,195, 8, 65,110,105,109, 32,115,101,116,116,105,110,103,
+115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200,250,195, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,152,251,195, 8,248,249,195, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,152,251,195, 8,112, 0, 0, 0, 1, 0, 0, 0,104,252,195, 8,
+200,250,195, 8, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,104,252,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 56,253,195, 8,152,251,195, 8, 69,102,102,101,
+ 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
+ 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0,
+162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+ 56,253,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 8,254,195, 8,104,252,195, 8, 72,111,111,107,115, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,250,195, 8, 68, 65, 84, 65,164, 0, 0, 0, 8,254,195, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,216,254,195, 8, 56,253,195, 8, 80, 97,114,116,105, 99,108,101, 32, 73,110,116,101,114, 97, 99,116,105,111,110,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,152,251,195, 8, 68, 65, 84, 65,164, 0, 0, 0,216,254,195, 8,112, 0, 0, 0, 1, 0, 0, 0,168,255,195, 8,
+ 8,254,195, 8, 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,251,195, 8,
+ 68, 65, 84, 65,164, 0, 0, 0,168,255,195, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 0,196, 8,216,254,195, 8, 79,117,116,112,
+117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+120, 0,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 72, 1,196, 8,168,255,195, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 1,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 24, 2,196, 8,120, 0,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 24, 2,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 72, 1,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,212, 0, 0, 0,232, 2,196, 8, 94, 0, 0, 0, 1, 0, 0, 0,232, 3,196, 8, 0, 0, 0, 0, 4, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,141, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0,193, 0, 64,212, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,145,133,185, 68, 0, 0, 0,193, 0, 0,104, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
+ 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,161, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,232, 3,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+232, 2,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,141, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,104, 5,196, 8,113, 0, 0, 0,
+ 1, 0, 0, 0, 96, 6,196, 8, 96,247,195, 8,168,238,195, 8,168,237,195, 8,232,237,195, 8,232,238,195, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0,
+ 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1,
+196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 96, 6,196, 8,113, 0, 0, 0,
+ 1, 0, 0, 0, 88, 13,196, 8,104, 5,196, 8, 40,240,195, 8,104,240,195, 8,104,239,195, 8, 40,239,195, 8, 0, 0, 0, 0,
+ 71,187,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 19, 1, 0, 0,
+205, 0, 0, 0,159, 2, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,211, 1,242, 1, 1, 0, 3, 0,
+251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 8,196, 8,216, 11,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 88, 7,196, 8, 40, 8,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 88, 7,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 40, 8,196, 8, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 40, 8,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 88, 7,196, 8, 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,180, 2, 0, 0,248, 8,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,216, 11,196, 8, 0, 0, 0, 0, 1, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,178, 13, 32, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
+111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 0, 1, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,162, 77, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,216, 11,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+248, 8,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 88, 13,196, 8,113, 0, 0, 0,
+ 1, 0, 0, 0,240, 24,196, 8, 96, 6,196, 8, 40,239,195, 8,104,239,195, 8,232,238,195, 8,104,238,195, 8, 0, 0, 0, 0,
+ 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,
+161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 19, 1, 0, 0,
+161, 2, 0, 0,232, 3, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 72, 1,242, 1, 3, 0, 3, 0,
+203, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 15,196, 8,112, 23,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 80, 14,196, 8, 80, 14,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80, 14,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 32, 15,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,120, 16,196, 8,
+ 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67,
+ 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0,
+ 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0, 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60,
+ 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,
+205,204,140, 63, 68, 65, 84, 65,196, 0, 0, 0,120, 16,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,104, 17,196, 8, 32, 15,196, 8,
+ 3, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
+124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+160, 0, 0, 0,104, 17,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 56, 18,196, 8,120, 16,196, 8, 11, 0, 0, 0, 51, 51, 51, 63,
+ 1, 86,160, 92, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192,
+ 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70,
+ 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0, 56, 18,196, 8,100, 0, 0, 0,
+ 1, 0, 0, 0,224, 18,196, 8,104, 17,196, 8, 9, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,240, 3,197, 8, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0,
+ 17, 0, 0, 0,114, 1, 0, 0,116, 1, 0, 0, 5, 0, 0, 0, 17, 0, 0, 0, 2, 0, 0, 0,116, 1, 0, 0, 68, 65, 84, 65,
+164, 0, 0, 0,224, 18,196, 8, 99, 0, 0, 0, 1, 0, 0, 0,176, 19,196, 8, 56, 18,196, 8, 13, 0, 0, 0, 51, 51, 51, 63,
+ 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0, 0, 0,182, 67,108, 1, 0, 0,
+124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 0,
+108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,122, 68,205,204,204, 61,
+ 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0,176, 19,196, 8,
+177, 0, 0, 0, 1, 0, 0, 0,144, 20,196, 8,224, 18,196, 8, 12, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67, 0, 0, 0,191,
+ 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 14, 2, 0, 0,128, 0, 0, 0,
+108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,
+144, 20,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,112, 23,196, 8,176, 19,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191,
+ 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 33,195, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194,
+ 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 84, 1, 0, 0,112, 23,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,144, 20,196, 8, 5, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,240, 24,196, 8,113, 0, 0, 0, 1, 0, 0, 0,152, 31,196, 8,
+ 88, 13,196, 8,168,240,195, 8, 40,240,195, 8,104,238,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,
+189, 0, 0, 0,247, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,189, 0, 0, 0,215, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,
+216, 0, 0, 0,247, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15, 28, 3, 32, 0, 3, 0, 3, 0,192, 2, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 27,196, 8, 24, 30,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+232, 25,196, 8,184, 26,196, 8, 68, 65, 84, 65,164, 0, 0, 0,232, 25,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 26,196, 8,
+ 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,184, 26,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,232, 25,196, 8, 77,101,115,104,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
+105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0,
+136, 27,196, 8,102, 0, 0, 0, 1, 0, 0, 0, 72, 28,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76,
+ 0, 0,128,192, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 16, 66,123, 10, 4,194,181,186,152, 67, 0, 0, 0, 0, 0, 0, 16, 66,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 28, 3, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0, 16, 66, 0, 0,250, 70, 0, 0, 16, 66,
+205,204,204, 61, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0,
+ 68, 65, 84, 65,160, 0, 0, 0, 72, 28,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 24, 29,196, 8,136, 27,196, 8, 11, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,170, 76, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66,
+ 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0,
+ 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 36, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67,
+ 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 24, 29,196, 8,
+ 94, 0, 0, 0, 1, 0, 0, 0, 24, 30,196, 8, 72, 28,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0, 0, 35, 68, 0, 0, 0,193,
+ 0, 0,104, 67,135, 22, 0,193,178, 16, 96, 68,112, 74,103, 67, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0,
+ 1, 0, 1, 0,251, 4, 1, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 84, 1, 0, 0, 24, 30,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 24, 29,196, 8, 5, 0, 0, 0, 51, 51, 51, 63,
+ 1, 86,170, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,152, 31,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240, 24,196, 8,
+168,239,195, 8,168,238,195, 8,104,240,195, 8,168,240,195, 8, 0, 0, 0, 0,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187,
+ 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0,
+ 5, 3, 0, 0, 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0,203, 0, 0, 0,216, 0, 0, 0,
+ 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3,204, 0, 46, 2, 3, 0, 3, 0,145, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 34,196, 8,224, 38,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,144, 32,196, 8,
+ 96, 33,196, 8, 68, 65, 84, 65,164, 0, 0, 0,144, 32,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 96, 33,196, 8, 0, 0, 0, 0,
+ 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+164, 0, 0, 0, 96, 33,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,144, 32,196, 8, 51, 68, 32, 86,105,101,119,112,
+111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,196, 0, 0, 0, 48, 34,196, 8,
+ 97, 0, 0, 0, 1, 0, 0, 0, 0, 36,196, 8, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 67, 0, 0,190,194, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 60, 67, 0,128, 11,196, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0,192,194,
+ 0,128, 11,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,188, 0, 46, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 35,196, 8, 1, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 12, 0, 0, 0, 32, 35,196, 8,128, 0, 0, 0, 1, 0, 0, 0,
+ 10, 0, 0, 0, 10, 0, 0, 0, 88, 35,196, 8, 68, 65, 84, 65,120, 0, 0, 0, 88, 35,196, 8,127, 0, 0, 0, 10, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0,136,251,196, 8, 0, 0, 0, 0, 1, 0, 1, 0,160, 2,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,
+ 72, 12,197, 8, 0, 0, 0, 0, 1, 0, 1, 0, 24, 22,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,184, 18,197, 8, 0, 0, 0, 0,
+ 1, 0, 1, 0, 8, 21,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,152, 15,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,120, 1,197, 8,
+ 0, 0, 0, 0, 1, 0, 1, 0, 40, 9,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,216, 0,197, 8, 68, 65, 84, 65,180, 2, 0, 0,
+ 0, 36,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,224, 38,196, 8, 48, 34,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,233,234, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0, 7, 0,175, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 84, 1, 0, 0,224, 38,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 36,196, 8, 5, 0, 0, 0,
+ 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0, 96, 40,196, 8,109, 0, 0, 0, 1, 0, 0, 0,192, 99,196, 8,
+ 8,237,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 50, 45, 77,111,100,101,108, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 41,196, 8,192, 42,196, 8, 0, 43,196, 8,136, 45,196, 8,208, 45,196, 8,
+144, 86,196, 8,136,251,196, 8, 1, 0, 0, 5,254,255,253, 3, 0, 5, 0, 4, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 8, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 0, 41,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0, 64, 41,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+ 64, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0,128, 41,196, 8, 0, 41,196, 8, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,128, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0,192, 41,196, 8, 64, 41,196, 8, 0, 0, 0, 0,
+ 0, 5, 0, 4, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,192, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 42,196, 8,
+128, 41,196, 8, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 0, 42,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0, 64, 42,196, 8,192, 41,196, 8, 0, 0, 0, 0, 0, 0,236, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+ 64, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0,128, 42,196, 8, 0, 42,196, 8, 0, 0, 0, 0, 0, 5,236, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,128, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0,192, 42,196, 8, 64, 42,196, 8, 0, 0, 0, 0,
+ 0, 0,224, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,192, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+128, 42,196, 8, 0, 0, 0, 0, 0, 5,224, 3, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 0, 43,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0, 72, 43,196, 8, 0, 0, 0, 0, 64, 41,196, 8,128, 41,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0, 72, 43,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144, 43,196, 8, 0, 43,196, 8, 0, 41,196, 8,192, 41,196, 8,
+ 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144, 43,196, 8,111, 0, 0, 0, 1, 0, 0, 0,216, 43,196, 8,
+ 72, 43,196, 8, 0, 41,196, 8, 0, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,216, 43,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 32, 44,196, 8,144, 43,196, 8,192, 41,196, 8, 64, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 32, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0,104, 44,196, 8,216, 43,196, 8, 0, 42,196, 8,
+ 64, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+176, 44,196, 8, 32, 44,196, 8, 64, 41,196, 8,128, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+176, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248, 44,196, 8,104, 44,196, 8,128, 41,196, 8,192, 42,196, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 64, 45,196, 8,176, 44,196, 8,
+128, 42,196, 8,192, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 64, 45,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,136, 45,196, 8,248, 44,196, 8, 0, 42,196, 8,128, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,136, 45,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 45,196, 8, 64, 42,196, 8,192, 42,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,208, 45,196, 8,113, 0, 0, 0, 1, 0, 0, 0,152, 85,196, 8,
+ 0, 0, 0, 0, 0, 41,196, 8, 0, 42,196, 8, 64, 42,196, 8,192, 41,196, 8, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
+ 0, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,209, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
+ 0, 0, 0, 0,208, 0, 0, 0, 5, 0, 4, 0, 2, 0, 4, 4, 1, 5,209, 0, 1, 1, 1, 0, 79, 1, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 79,196, 8, 24, 84,196, 8, 56,189,193, 8,112,188,195, 8,
+200, 46,196, 8,144,165,193, 8, 68, 65, 84, 65,164, 0, 0, 0,200, 46,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 47,196, 8,
+ 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,152, 47,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 48,196, 8,200, 46,196, 8, 76, 97,109,112,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+104, 48,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 49,196, 8,152, 47,196, 8, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 49,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 8, 50,196, 8,104, 48,196, 8, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8, 50,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 50,196, 8,
+ 56, 49,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 49,196, 8,
+ 68, 65, 84, 65,164, 0, 0, 0,216, 50,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 51,196, 8, 8, 50,196, 8, 80,114,101,118,
+105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
+114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+168, 51,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 52,196, 8,216, 50,196, 8, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120, 52,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 72, 53,196, 8,168, 51,196, 8, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 53,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24, 54,196, 8,
+120, 52,196, 8, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 24, 54,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232, 54,196, 8, 72, 53,196, 8, 77,105,115,116,
+ 32, 83,116, 97,114,115, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,
+100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+232, 54,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 55,196, 8, 24, 54,196, 8, 84,101,120,116,117,114,101, 32, 97,110,100, 32,
+ 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184, 55,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,136, 56,196, 8,232, 54,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,232, 54,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 56,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 57,196, 8,
+184, 55,196, 8, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 88, 57,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40, 58,196, 8,136, 56,196, 8, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+ 40, 58,196, 8,112, 0, 0, 0, 1, 0, 0, 0,248, 58,196, 8, 88, 57,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,248, 58,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,200, 59,196, 8, 40, 58,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200, 59,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 60,196, 8,
+248, 58,196, 8, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,152, 60,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 61,196, 8,200, 59,196, 8, 77,101,115,104,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
+105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+104, 61,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 62,196, 8,152, 60,196, 8, 77,101,115,104, 32, 84,111,111,108,115, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 62,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 8, 63,196, 8,104, 61,196, 8, 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8, 63,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 63,196, 8,
+ 56, 62,196, 8, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,216, 63,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 64,196, 8, 8, 63,196, 8, 83,104, 97,100,
+101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
+114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 76,196, 8, 68, 65, 84, 65,164, 0, 0, 0,
+168, 64,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 65,196, 8,216, 63,196, 8, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120, 65,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 72, 66,196, 8,168, 64,196, 8, 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 66,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24, 67,196, 8,
+120, 65,196, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 24, 67,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232, 67,196, 8, 72, 66,196, 8, 67,111,110,115,
+116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
+ 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+232, 67,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 68,196, 8, 24, 67,196, 8, 83, 99,114,105,112,116,108,105,110,107,115, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184, 68,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,136, 69,196, 8,232, 67,196, 8, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 24, 67,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 69,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 70,196, 8,
+184, 68,196, 8, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 64,196, 8,
+ 68, 65, 84, 65,164, 0, 0, 0, 88, 70,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40, 71,196, 8,136, 69,196, 8, 77, 97,112, 32,
+ 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
+114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 64,196, 8, 68, 65, 84, 65,164, 0, 0, 0,
+ 40, 71,196, 8,112, 0, 0, 0, 1, 0, 0, 0,248, 71,196, 8, 88, 70,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,248, 71,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,200, 72,196, 8, 40, 71,196, 8, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200, 72,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 73,196, 8,
+248, 71,196, 8, 76,105,115,116,101,110,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,152, 73,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 74,196, 8,200, 72,196, 8, 83,101,113,117,
+101,110, 99,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,
+100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+104, 74,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 75,196, 8,152, 73,196, 8, 65,114,109, 97,116,117,114,101, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 75,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 8, 76,196, 8,104, 74,196, 8, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,168, 51,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 8, 76,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 76,196, 8,
+ 56, 75,196, 8, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,216, 76,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 77,196, 8, 8, 76,196, 8, 77,105,115,116,
+ 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,
+100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+168, 77,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 78,196, 8,216, 76,196, 8, 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 76,196, 8, 68, 65, 84, 65,164, 0, 0, 0,120, 78,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 8,158,193, 8,168, 77,196, 8, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8,158,193, 8,112, 0, 0, 0, 1, 0, 0, 0,144,165,193, 8,
+120, 78,196, 8, 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,144,165,193, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8,158,193, 8, 83,104, 97,112,
+101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
+105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,
+ 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 8,158,193, 8, 68, 65, 84, 65,212, 0, 0, 0,
+ 72, 79,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 72, 80,196, 8, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63,208, 45,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0,192,202, 68,
+ 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193, 40,224,182, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63,
+ 0, 0, 1, 0, 1, 0, 1, 0, 1, 5,209, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0, 24, 22,197, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,141, 0, 0, 0, 0, 0,109, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,180, 2, 0, 0, 72, 80,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 40, 83,196, 8, 72, 79,196, 8, 1, 0, 0, 0,
+ 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,196, 0, 0, 0, 40, 83,196, 8, 97, 0, 0, 0, 1, 0, 0, 0, 24, 84,196, 8,
+ 72, 80,196, 8, 3, 0, 0, 0, 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,192,192, 0, 0,160, 64, 0, 0, 0, 0,205,204,140, 65,201, 82, 5,194,124,171, 30, 66, 49,238,226, 64,140,108,168, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0,245, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67,
+ 10,215, 35, 60, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 84, 1, 0, 0, 24, 84,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40, 83,196, 8, 5, 0, 0, 0,
+ 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,152, 85,196, 8,113, 0, 0, 0, 1, 0, 0, 0,144, 86,196, 8,
+208, 45,196, 8,128, 42,196, 8, 64, 41,196, 8,128, 41,196, 8,192, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
+225, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,225, 3, 0, 0,251, 3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
+252, 3, 0, 0, 0, 4, 0, 0, 7, 0, 6, 0, 1, 0, 7, 7, 1, 5, 5, 0, 1, 1, 1, 1,196, 2, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 27,194, 8,176,231,195, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,144, 86,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+152, 85,196, 8, 0, 42,196, 8,128, 42,196, 8,192, 42,196, 8, 64, 42,196, 8, 0, 0, 0, 0,184,119,162, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111, 18,131,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, 0, 5, 0, 0,
+237, 0, 0, 0,223, 3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,237, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
+ 8, 1, 0, 0,223, 3, 0, 0, 9, 0, 8, 0, 1, 0, 1, 1, 1, 5,216, 2, 1, 0, 1, 0, 5, 3, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 89,196, 8, 64, 98,196, 8,104,176,195, 8,104,176,195, 8,
+136, 87,196, 8, 88, 88,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 87,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 88,196, 8,
+ 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 44, 0, 21, 2, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 88, 88,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136, 87,196, 8, 86,105,101,119,
+ 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119,
+ 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 1, 8, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,
+ 40, 89,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 8, 92,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,123,176, 73, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 25, 62,229, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,121,195, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0,
+ 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+123,176, 73, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 3, 0,251,255, 8, 8, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63,189, 57,161, 60,205,204,204, 61, 0, 0,250, 67,
+ 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128,193, 55,143, 63, 0,174,255,192, 88, 23,141,191, 60, 0, 1, 0, 7, 0,175, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 3, 0,255,255,170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 40, 1, 0, 0, 8, 92,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, 96, 93,196, 8, 40, 89,196, 8, 2, 0, 0, 0,
+ 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64,
+ 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
+ 16, 0, 0, 0,168, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65,
+196, 0, 0, 0, 96, 93,196, 8, 97, 0, 0, 0, 1, 0, 0, 0, 96, 96,196, 8, 8, 92,196, 8, 3, 0, 0, 0, 51, 51, 51, 63,
+144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,246, 24,167, 65,102,102,174,193,
+122, 20,238, 65, 75, 95,116,194, 75, 95,116, 66, 51, 51, 9,194, 51, 51, 9, 66, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,
+ 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
+ 50, 2, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67, 10,215, 35, 60, 0, 0, 0, 64, 0, 0, 0, 0,
+ 1, 0, 0, 0,233, 3, 50, 2, 0, 0, 0, 0, 80, 94,196, 8, 8, 96,196, 8, 0, 0,143, 3, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 80, 94,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0,168, 94,196, 8, 0, 0, 0, 0, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 61, 10,192,
+ 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,168, 94,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0, 0, 95,196, 8, 80, 94,196, 8, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0,192, 64,205,204,124, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 0, 95,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0, 88, 95,196, 8,168, 94,196, 8, 65, 77, 5, 0, 0, 0, 0, 0,235, 49,126, 65, 98, 62,200, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0,184, 18,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 88, 95,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0,176, 95,196, 8, 0, 95,196, 8, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0,152, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,176, 95,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0, 8, 96,196, 8, 88, 95,196, 8, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65,
+ 0, 0, 0, 0, 0, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 8, 96,196, 8,
+129, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176, 95,196, 8, 67, 83, 0, 0, 0, 0, 0, 0, 0, 0,192, 64,102,102,174,193,
+ 0, 0, 0, 0, 0, 0, 0, 0,136,251,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0, 96, 96,196, 8,
+177, 0, 0, 0, 1, 0, 0, 0, 64, 97,196, 8, 96, 93,196, 8, 12, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192,
+ 0, 0,130, 66, 0, 0, 0, 0, 0,128, 8, 68,217, 3, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0,128, 0, 0, 0,
+217, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,217, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0,
+ 64, 97,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 64, 98,196, 8, 96, 96,196, 8, 4, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68,
+ 0, 0,160,193, 0, 0,100, 67,246, 56,165, 67, 26, 29,110, 68, 13,102,183,193,246, 25,161, 67, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63,
+ 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 84, 1, 0, 0, 64, 98,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 97,196, 8, 5, 0, 0, 0,
+ 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0,
+ 83, 97,118,101, 32, 70,105,108,101, 0, 78, 84, 0, 32, 80, 73, 67, 84, 85, 82, 69, 83, 0, 0, 47, 85,115,101,114,115, 47,116,
+111,110, 47, 68,101,115,107,116,111,112, 47, 0,117,109,112, 98,117,103, 32, 70,111,108,100,101,114, 47, 0,101,110,100,101,114,
+ 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100,
+ 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 11, 0, 1, 0, 0, 0,251, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0,192, 99,196, 8,109, 0, 0, 0, 1, 0, 0, 0,232,163,196, 8,
+ 96, 40,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 51, 45, 77, 97,116,101,114,105, 97,108, 0,111,100,101,108, 32, 83,105,
+110,103, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,100,196, 8,160,103,196, 8,224,103,196, 8, 16,110,196, 8, 88,110,196, 8,
+ 56,156,196, 8,136,251,196, 8, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,100,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,160,100,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+160,100,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,100,196, 8, 96,100,196, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,224,100,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,101,196, 8,160,100,196, 8, 0, 0, 0, 0,
+232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,101,196, 8,
+224,100,196, 8, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,101,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,160,101,196, 8, 32,101,196, 8, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+160,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,101,196, 8, 96,101,196, 8, 0, 0, 0, 0,232, 3, 60, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,224,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,102,196, 8,160,101,196, 8, 0, 0, 0, 0,
+ 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,102,196, 8,
+224,101,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,102,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,160,102,196, 8, 32,102,196, 8, 0, 0, 0, 0, 44, 3, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+160,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,102,196, 8, 96,102,196, 8, 0, 0, 0, 0, 44, 3, 6, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,224,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,103,196, 8,160,102,196, 8, 0, 0, 0, 0,
+ 0, 0,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,103,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,103,196, 8,
+224,102,196, 8, 0, 0, 0, 0, 44, 3,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,103,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,160,103,196, 8, 32,103,196, 8, 0, 0, 0, 0,164, 1,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+160,103,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,103,196, 8, 0, 0, 0, 0,164, 1, 6, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,224,103,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 40,104,196, 8, 0, 0, 0, 0,160,100,196, 8,
+224,100,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 40,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+112,104,196, 8,224,103,196, 8, 96,100,196, 8, 32,101,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+112,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0,184,104,196, 8, 40,104,196, 8, 96,100,196, 8, 96,101,196, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0,105,196, 8,112,104,196, 8,
+ 32,101,196, 8,160,101,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 0,105,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0, 72,105,196, 8,184,104,196, 8, 96,101,196, 8,160,101,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0, 72,105,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144,105,196, 8, 0,105,196, 8,160,100,196, 8,224,101,196, 8,
+ 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,105,196, 8,111, 0, 0, 0, 1, 0, 0, 0,216,105,196, 8,
+ 72,105,196, 8,224,100,196, 8, 32,102,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,216,105,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 32,106,196, 8,144,105,196, 8,224,101,196, 8, 32,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 32,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0,104,106,196, 8,216,105,196, 8,160,101,196, 8,
+ 32,102,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+176,106,196, 8, 32,106,196, 8, 96,101,196, 8, 96,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+176,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248,106,196, 8,104,106,196, 8,160,101,196, 8, 96,102,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 64,107,196, 8,176,106,196, 8,
+ 32,102,196, 8,160,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 64,107,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,136,107,196, 8,248,106,196, 8, 96,102,196, 8,160,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,136,107,196, 8,111, 0, 0, 0, 1, 0, 0, 0,208,107,196, 8, 64,107,196, 8, 96,101,196, 8,224,102,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,107,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 24,108,196, 8,
+136,107,196, 8,224,101,196, 8,224,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 24,108,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 96,108,196, 8,208,107,196, 8,160,102,196, 8, 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 96,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0,168,108,196, 8, 24,108,196, 8, 96,102,196, 8,
+ 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,168,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+240,108,196, 8, 96,108,196, 8,224,102,196, 8, 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+240,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 56,109,196, 8,168,108,196, 8,224,102,196, 8, 96,103,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 56,109,196, 8,111, 0, 0, 0, 1, 0, 0, 0,128,109,196, 8,240,108,196, 8,
+ 32,103,196, 8, 96,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,128,109,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,200,109,196, 8, 56,109,196, 8,224,101,196, 8,160,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,200,109,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 16,110,196, 8,128,109,196, 8,160,102,196, 8,160,103,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 16,110,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+200,109,196, 8, 96,103,196, 8,160,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 88,110,196, 8,
+113, 0, 0, 0, 1, 0, 0, 0,112,122,196, 8, 0, 0, 0, 0, 96,100,196, 8, 96,101,196, 8,160,101,196, 8, 32,101,196, 8,
+ 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188,
+ 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0,
+ 26, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 27, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 33, 0,
+ 1, 1, 1, 0,192, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,114,196, 8,
+240,120,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 80,111,196, 8,192,113,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80,111,196, 8,
+112, 0, 0, 0, 1, 0, 0, 0, 32,112,196, 8, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 32,112,196, 8,112, 0, 0, 0, 1, 0, 0, 0,
+240,112,196, 8, 80,111,196, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,240,112,196, 8,112, 0, 0, 0, 1, 0, 0, 0,192,113,196, 8, 32,112,196, 8,
+ 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+164, 0, 0, 0,192,113,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240,112,196, 8, 70,111,114,109, 97,116, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0,144,114,196, 8,
+102, 0, 0, 0, 1, 0, 0, 0, 80,115,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0,128,192,
+ 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+233, 3, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,128, 63, 0, 0, 16, 65, 0, 0,250, 70, 0, 0, 16, 65,205,204,204, 61,
+ 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65,
+160, 0, 0, 0, 80,115,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 32,116,196, 8,144,114,196, 8, 11, 0, 0, 0, 51, 51, 51, 63,
+ 1, 86,239, 92, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192,
+ 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 9, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70,
+ 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 32,116,196, 8, 94, 0, 0, 0,
+ 1, 0, 0, 0, 32,117,196, 8, 80,115,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67,
+ 63, 0, 0,193,172, 3,182, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,
+251, 4,209, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,109, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,
+ 32,117,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 0,120,196, 8, 32,116,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191,
+ 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194,
+ 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,196, 0, 0, 0, 0,120,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,240,120,196, 8, 32,117,196, 8, 3, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,192, 0, 0,160, 64,
+ 0, 0, 0, 0,205,204,140, 65,201, 82, 5,194,124,171, 30, 66, 49,238,226, 64,140,108,168, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0,
+ 0, 0, 0, 0,245, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67, 10,215, 35, 60, 0, 0, 0, 64,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,
+240,120,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,120,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,204, 0, 0, 0,112,122,196, 8,113, 0, 0, 0, 1, 0, 0, 0,104,123,196, 8, 88,110,196, 8,224,101,196, 8,
+160,100,196, 8,224,100,196, 8, 32,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0,
+ 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0,
+ 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 1, 1, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,204, 0, 0, 0,104,123,196, 8,113, 0, 0, 0, 1, 0, 0, 0,216,140,196, 8,112,122,196, 8, 96,102,196, 8,
+160,102,196, 8, 32,102,196, 8,160,101,196, 8, 0, 0, 0, 0,255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,255,255,139, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191,
+ 0, 0, 0,128, 0, 0, 0,128, 74,215, 76,190, 0, 0, 0,128, 45, 3, 0, 0,232, 3, 0, 0, 61, 0, 0, 0, 5, 3, 0, 0,
+ 45, 3, 0, 0,232, 3, 0, 0, 61, 0, 0, 0, 87, 0, 0, 0, 45, 3, 0, 0,232, 3, 0, 0, 88, 0, 0, 0, 5, 3, 0, 0,
+ 0, 0, 0, 0, 1, 0, 4, 4,188, 0,174, 2, 1, 1, 1, 0,179, 1,126, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 32,134,196, 8, 88,139,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 96,124,196, 8, 80,133,196, 8,
+ 68, 65, 84, 65,164, 0, 0, 0, 96,124,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 48,125,196, 8, 0, 0, 0, 0, 79,117,116,112,
+117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+ 48,125,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0,126,196, 8, 96,124,196, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 0,126,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,208,126,196, 8, 48,125,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,208,126,196, 8,112, 0, 0, 0, 1, 0, 0, 0,160,127,196, 8,
+ 0,126,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,160,127,196, 8,112, 0, 0, 0, 1, 0, 0, 0,112,128,196, 8,208,126,196, 8, 80,114,101,118,
+105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
+114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+112,128,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 64,129,196, 8,160,127,196, 8, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 64,129,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 16,130,196, 8,112,128,196, 8, 83,104, 97,100,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 16,130,196, 8,112, 0, 0, 0, 1, 0, 0, 0,224,130,196, 8,
+ 64,129,196, 8, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 68,252, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,224,130,196, 8,112, 0, 0, 0, 1, 0, 0, 0,176,131,196, 8, 16,130,196, 8, 77, 97,112, 32,
+ 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
+114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,251,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+176,131,196, 8,112, 0, 0, 0, 1, 0, 0, 0,128,132,196, 8,224,130,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, 4, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,128,132,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 80,133,196, 8,176,131,196, 8, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,112,128,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80,133,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+128,132,196, 8, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,212, 0, 0, 0, 32,134,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 32,135,196, 8, 0, 0, 0, 0, 4, 0, 0, 0,
+ 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0,193, 0, 0,163, 67, 0,128,148,196, 0, 0,104, 67, 0, 0, 0,193, 0, 0,163, 67,170,175,118,196,255,255,103, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
+ 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,188, 0,174, 2, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,141, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 32,135,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 0,138,196, 8,
+ 32,134,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,200, 80, 98,190, 0, 0, 0, 0,
+239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,122,166,182,193, 0, 0,128, 63,
+186, 74,140, 62, 35,120,117, 63,254,220,151, 61, 0, 0, 0, 0,160,194, 72,191,131,105, 54, 62, 30, 40, 24, 63, 0, 0, 0, 0,
+ 32,132, 14, 63,190, 80, 98,190, 94,255, 76, 63, 0, 0, 0, 0, 92,160, 70, 65,162, 28,188,192,224, 17,146, 65, 0, 0,128, 63,
+197, 52, 91, 63,228,148, 91,191,186,146, 14,191, 33,132, 14,191,223,197, 63, 64,106,131, 71, 62,246,103, 98, 62,200, 80, 98, 62,
+ 52, 73,109, 62,225,107, 38, 63, 93, 20, 77,191, 94,255, 76,191,240, 60, 48, 64,130, 29,156,189,128, 31,181, 65,122,166,182, 65,
+252,146,179, 61,173, 25,157, 62, 75, 99,194, 60, 0, 0,165, 50,214,141, 55,191,192,199, 38, 62,176, 28, 11, 63, 0,128, 24,181,
+167, 58,120,194,184, 22,235, 65, 49,140,182,194, 27,247,159,192, 5, 26,118, 66, 44,106,233,193,230, 4,181, 66,126, 7,160, 64,
+255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,139, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 74,215, 76,190, 0, 0, 0,128,
+188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,200, 80, 98,190, 0, 0, 0, 0,
+239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,122,166,182,193, 0, 0,128, 63,
+218, 31, 64, 63, 36, 17,139,190,182,154, 36,190,156,165, 20,191,221, 79,187, 65, 1, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 0,138,196, 8, 93, 0, 0, 0,
+ 1, 0, 0, 0, 88,139,196, 8, 32,135,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65,
+ 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 88,139,196, 8, 96, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0,138,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47,117,115,114, 47,104,111,109,101, 47,105,110,116,114,114, 47, 98,108,101,110,100,101,114, 47, 98,108,101,110,
+100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 24, 0, 1, 0, 0, 0,203, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,216,140,196, 8,
+113, 0, 0, 0, 1, 0, 0, 0,136,148,196, 8,104,123,196, 8, 96,101,196, 8,224,102,196, 8, 32,103,196, 8, 96,102,196, 8,
+ 0, 0, 0, 0, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,237,119,206, 61, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0,
+ 87, 0, 0, 0, 0, 0, 0, 0, 43, 3, 0, 0, 88, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 44, 3, 88, 1,
+ 1, 0, 1, 0,251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,141,196, 8,
+ 8,147,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,208,141,196, 8,
+ 89, 0, 0, 0, 1, 0, 0, 0,176,144,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63,
+106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30,191,
+106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,202, 25,217, 60,
+235, 76,145, 61, 70,151,128,186, 0, 0,128, 63,172, 79,187, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1,181, 30, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,255,255,249,195, 0, 0, 0, 0,103,217, 30,191,
+106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63,
+106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,172, 79,187, 65,
+ 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
+ 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63,
+106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 1, 0, 7, 0,175, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 3, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,104,138, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+212, 0, 0, 0,176,144,196, 8, 94, 0, 0, 0, 1, 0, 0, 0,176,145,196, 8,208,141,196, 8, 4, 0, 0, 0, 51, 51, 51, 63,
+ 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,
+225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,176,145,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, 8,147,196, 8,176,144,196, 8,
+ 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193,
+ 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70,
+ 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 84, 1, 0, 0, 8,147,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176,145,196, 8, 5, 0, 0, 0,
+ 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
+ 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,
+111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100,
+ 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,136,148,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 56,156,196, 8,
+216,140,196, 8, 96,103,196, 8,160,103,196, 8,160,102,196, 8, 32,103,196, 8, 0, 0, 0, 0,173,101,182, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+154, 65,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128,165, 1, 0, 0, 43, 3, 0, 0,
+177, 1, 0, 0, 5, 3, 0, 0,165, 1, 0, 0, 43, 3, 0, 0,177, 1, 0, 0,177, 1, 0, 0,165, 1, 0, 0, 43, 3, 0, 0,
+177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,135, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,149,196, 8,184,154,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,128,149,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 96,152,196, 8,
+ 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,
+191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63,
+223,149, 47, 63, 55, 70, 58, 63,192, 56, 49,188, 0, 0, 0, 0, 87,126,162,190,228,251,159, 62, 56, 53,101, 63, 0, 0, 0, 0,
+ 7,165, 39, 63,150, 84, 28,191, 50,247,227, 62, 0, 0, 0, 0,110,101,239, 64,151, 62,208,192, 77,255,170, 64, 0, 0,128, 63,
+144, 52,122, 63, 39,192, 4,191,244,250, 39,191, 8,165, 39,191,228,183,132, 63, 75,179, 2, 63,180,164, 28, 63,149, 84, 28, 63,
+118,137,124,188,232, 64,187, 63, 8,108,228,190, 50,247,227,190, 18,188,246,190,141,144, 29,191,216, 49, 49, 65,152, 9, 52, 65,
+116,112,246, 62,142,184, 2, 63, 64,191,248,187, 0, 0,144,179, 64,230, 70,190,226,211, 67, 62,254, 71, 12, 63, 0, 0, 0, 52,
+211,120, 21,194,144, 5, 2, 66, 7,136,213,193,193,214,159,192,219, 38, 19, 66,196,173,255,193,155,101,210, 65,173, 40,160, 64,
+173,101,182, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128,
+221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,
+191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63,
+241, 22, 72, 63, 78,162,246,190, 44, 8, 90,190, 3, 35,171,190,221, 79,187, 65, 2, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,221,224, 65, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 96,152,196, 8, 94, 0, 0, 0,
+ 1, 0, 0, 0, 96,153,196, 8,128,149,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,
+172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,
+ 96,153,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,184,154,196, 8, 96,152,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
+ 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,184,154,196, 8,
+ 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,153,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,
+100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
+ 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+204, 0, 0, 0, 56,156,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,148,196, 8,224,102,196, 8,224,101,196, 8,
+160,103,196, 8, 96,103,196, 8, 0, 0, 0, 0,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7, 43,186, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0,
+163, 1, 0, 0,177, 1, 0, 0,177, 1, 0, 0, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1,164, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48,157,196, 8,104,162,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+180, 2, 0, 0, 48,157,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 16,160,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
+ 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128,
+ 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51,
+ 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,107, 40, 52,191, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 1, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,128,191,176, 2, 19, 51,
+ 0, 0, 0, 0, 59,248, 30, 64,107, 40, 52,191, 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 80,209, 85, 49,110, 18, 3, 59, 0, 0, 0, 0, 0, 0, 0, 0, 6, 43,186, 61,234,137,150,174,
+ 0, 0, 0, 0,195,184, 59,190,143, 90,179,190, 79,123,184, 58, 0, 0,128, 63, 74,202, 88, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 53, 0, 0,128, 52, 85, 3, 48, 65, 0, 0, 0, 0, 0, 0,128,171, 1, 0,250, 67,160,144,143,183,
+ 0, 0, 0, 0, 59,248, 30, 64,106, 40, 52,191, 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 43,186, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187,
+ 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128,
+ 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51,
+ 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,107, 40, 52,191, 0, 0,128, 63,243, 4, 53, 63,243, 4, 53,191, 0, 0, 0, 0,
+ 0, 0, 0, 0, 73,202, 88, 65, 0, 0, 1, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61,
+ 0, 0,250, 67, 58,248, 30,192,106, 40, 52, 63, 46,161,118,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 2, 0,
+ 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 16,160,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 16,161,196, 8, 48,157,196, 8,
+ 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,169,101, 28,195,
+ 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68,
+ 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 16,161,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,
+104,162,196, 8, 16,160,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0,
+ 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60,
+ 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,104,162,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 16,161,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0,232,163,196, 8,109, 0, 0, 0,
+ 1, 0, 0, 0,136,207,196, 8,192, 99,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 52, 45, 83,101,113,117,101,110, 99,101,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,164,196, 8,200,167,196, 8, 8,168,196, 8,
+168,173,196, 8,240,173,196, 8, 96,201,196, 8,136,251,196, 8, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 4, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+136,164,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,164,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,200,164,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,165,196, 8,136,164,196, 8, 0, 0, 0, 0,
+ 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,165,196, 8,
+200,164,196, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,165,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,136,165,196, 8, 8,165,196, 8, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+136,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,165,196, 8, 72,165,196, 8, 0, 0, 0, 0, 0, 0,200, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,200,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,166,196, 8,136,165,196, 8, 0, 0, 0, 0,
+232, 3,200, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,166,196, 8,
+200,165,196, 8, 0, 0, 0, 0, 0, 0, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,166,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,136,166,196, 8, 8,166,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+136,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,166,196, 8, 72,166,196, 8, 0, 0, 0, 0, 0, 0,244, 1, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,200,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,167,196, 8,136,166,196, 8, 0, 0, 0, 0,
+232, 3,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,167,196, 8,
+200,166,196, 8, 0, 0, 0, 0, 84, 2,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,167,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,136,167,196, 8, 8,167,196, 8, 0, 0, 0, 0, 84, 2, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+136,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,167,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,200,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,167,196, 8, 0, 0, 0, 0,
+232, 3, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,168,196, 8,
+ 0, 0, 0, 0,200,164,196, 8, 8,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,168,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0,152,168,196, 8, 8,168,196, 8,136,164,196, 8, 72,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,152,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0,224,168,196, 8, 80,168,196, 8,136,164,196, 8,
+136,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+ 40,169,196, 8,152,168,196, 8, 72,165,196, 8,200,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+ 40,169,196, 8,111, 0, 0, 0, 1, 0, 0, 0,112,169,196, 8,224,168,196, 8,136,165,196, 8,200,165,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,112,169,196, 8,111, 0, 0, 0, 1, 0, 0, 0,184,169,196, 8, 40,169,196, 8,
+200,164,196, 8, 8,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,169,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0, 0,170,196, 8,112,169,196, 8, 8,165,196, 8, 72,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0, 0,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 72,170,196, 8,184,169,196, 8, 8,166,196, 8, 72,166,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 72,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144,170,196, 8,
+ 0,170,196, 8, 8,166,196, 8,136,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,170,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0,216,170,196, 8, 72,170,196, 8, 72,166,196, 8,200,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,216,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 32,171,196, 8,144,170,196, 8,136,166,196, 8,
+200,166,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 32,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+104,171,196, 8,216,170,196, 8,136,166,196, 8, 8,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+104,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0,176,171,196, 8, 32,171,196, 8,200,166,196, 8, 8,167,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,176,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248,171,196, 8,104,171,196, 8,
+ 8,166,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,171,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0, 64,172,196, 8,176,171,196, 8, 72,166,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0, 64,172,196, 8,111, 0, 0, 0, 1, 0, 0, 0,136,172,196, 8,248,171,196, 8, 8,167,196, 8, 72,167,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,136,172,196, 8,111, 0, 0, 0, 1, 0, 0, 0,208,172,196, 8,
+ 64,172,196, 8,136,165,196, 8,136,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,172,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 24,173,196, 8,136,172,196, 8,136,166,196, 8,136,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 24,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 96,173,196, 8,208,172,196, 8,200,166,196, 8,
+200,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 96,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+168,173,196, 8, 24,173,196, 8,200,165,196, 8,200,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+168,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,173,196, 8,136,167,196, 8,200,167,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,240,173,196, 8,113, 0, 0, 0, 1, 0, 0, 0,168,180,196, 8, 0, 0, 0, 0,
+136,164,196, 8,136,165,196, 8,200,165,196, 8, 72,165,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0,
+199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,173, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0,
+172, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,233, 3,173, 0, 1, 0, 1, 1,139, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,178,196, 8, 40,179,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,232,174,196, 8,
+ 88,177,196, 8, 68, 65, 84, 65,164, 0, 0, 0,232,174,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184,175,196, 8, 0, 0, 0, 0,
+ 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+164, 0, 0, 0,184,175,196, 8,112, 0, 0, 0, 1, 0, 0, 0,136,176,196, 8,232,174,196, 8, 82,101,110,100,101,114, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,136,176,196, 8,
+112, 0, 0, 0, 1, 0, 0, 0, 88,177,196, 8,184,175,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 88,177,196, 8,112, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0,136,176,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 40,178,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 40,179,196, 8, 0, 0, 0, 0,
+ 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 30,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,118,149,172, 68, 0, 0, 0,193,
+ 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68,
+ 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,173, 0, 0, 0, 0, 0, 0, 0,255,255,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 40,179,196, 8, 96, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 40,178,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 30,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,168,180,196, 8,
+113, 0, 0, 0, 1, 0, 0, 0,160,181,196, 8,240,173,196, 8, 8,166,196, 8,200,164,196, 8, 8,165,196, 8, 72,166,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0,
+ 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0,
+ 1, 0, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,160,181,196, 8,
+113, 0, 0, 0, 1, 0, 0, 0,136,188,196, 8,168,180,196, 8,136,165,196, 8,136,167,196, 8,200,167,196, 8,200,165,196, 8,
+ 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128,
+ 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0,
+227, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,228, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 32, 0,
+ 1, 0, 1, 1,192, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,182,196, 8,
+ 8,187,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0,152,182,196, 8,
+102, 0, 0, 0, 1, 0, 0, 0, 88,183,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188, 0, 0,128,192,
+ 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+233, 3, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 66, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61,
+ 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65,
+164, 0, 0, 0, 88,183,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 40,184,196, 8,152,182,196, 8, 8, 0, 0, 0, 51, 51, 51, 63,
+ 1, 87, 38,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0,
+ 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,
+ 32, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0,
+ 32, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 40,184,196, 8,
+ 89, 0, 0, 0, 1, 0, 0, 0, 8,187,196, 8, 88,183,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 38,140, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65,
+ 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
+ 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 84, 1, 0, 0, 8,187,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40,184,196, 8, 5, 0, 0, 0, 51, 51, 51, 63,
+ 1, 87, 38,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69,
+ 32, 84, 65, 82, 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46, 98,108,101,110,100, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,136,188,196, 8,113, 0, 0, 0, 1, 0, 0, 0,176,194,196, 8,160,181,196, 8,
+ 8,167,196, 8, 72,167,196, 8, 72,166,196, 8,200,166,196, 8, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187,
+ 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0,
+ 5, 3, 0, 0, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0,245, 1, 0, 0, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0,
+ 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,148, 1, 17, 1, 3, 0, 1, 1, 9, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,189,196, 8, 48,193,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,128,189,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 80,190,196, 8, 0, 0, 0, 0,
+ 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0, 49, 1, 0, 0, 17, 0, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0,
+124, 2, 0, 0, 17, 0, 0, 0, 49, 1, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61,
+ 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+180, 2, 0, 0, 80,190,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 48,193,196, 8,128,189,196, 8, 1, 0, 0, 0, 51, 51, 51, 63,
+ 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 42,251,220, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60,
+ 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 48,193,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 80,190,196, 8,
+ 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82, 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46,
+ 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,176,194,196, 8,113, 0, 0, 0, 1, 0, 0, 0,
+ 96,201,196, 8,136,188,196, 8,136,166,196, 8, 8,166,196, 8, 72,167,196, 8, 8,167,196, 8, 0, 0, 0, 0,228, 56,142, 61,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,220, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0,
+ 83, 2, 0, 0,245, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0,245, 1, 0, 0, 15, 2, 0, 0, 0, 0, 0, 0,
+ 83, 2, 0, 0, 16, 2, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 84, 2,246, 0, 1, 0, 1, 0,203, 1, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,195,196, 8,224,199,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,195,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,
+ 0,197,196, 8, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66,205,204,204,189,205,204,140, 63, 0, 0,160,192,
+ 0, 0,210, 66,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,246, 0, 0, 0, 16, 0, 0, 0,
+ 19, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 19, 2, 0, 0, 16, 0, 0, 0,246, 0, 0, 0, 10,215, 35, 60,
+ 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 83, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66,
+205,204,204,189,205,204,140, 63, 68, 65, 84, 65,180, 2, 0, 0, 0,197,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,224,199,196, 8,
+168,195,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,220, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,179,146,207, 64, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,224,199,196, 8, 96, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0,197,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 79, 65, 68, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
+ 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,
+ 96,201,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176,194,196, 8,136,167,196, 8,136,166,196, 8,200,166,196, 8,
+200,167,196, 8, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
+ 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0, 5, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
+ 5, 1, 0, 0, 31, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0, 1, 0, 8, 8,
+233, 3,212, 0, 1, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 88,202,196, 8, 8,206,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+ 88,202,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 40,203,196, 8, 0, 0, 0, 0, 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65,
+ 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,212, 0, 0, 0,
+ 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0,212, 0, 0, 0,
+ 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 40,203,196, 8, 89, 0, 0, 0,
+ 1, 0, 0, 0, 8,206,196, 8, 88,202,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 38,140, 64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0,
+ 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24,
+ 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,
+ 8,206,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40,203,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82,
+ 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
+ 83, 82, 0, 0,116, 0, 0, 0,136,207,196, 8,109, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,232,163,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 83, 82, 53, 45, 83, 99,114,105,112,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 40,208,196, 8,104,210,196, 8,168,210,196, 8,152,214,196, 8,224,214,196, 8,176,236,196, 8,136,251,196, 8,
+ 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,208,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,208,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,168,208,196, 8, 40,208,196, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+168,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0,232,208,196, 8,104,208,196, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,232,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 40,209,196, 8,168,208,196, 8, 0, 0, 0, 0,
+232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,209,196, 8,
+232,208,196, 8, 0, 0, 0, 0, 0, 0,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,209,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0,168,209,196, 8, 40,209,196, 8, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,
+168,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0,232,209,196, 8,104,209,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0,
+ 68, 65, 84, 65, 20, 0, 0, 0,232,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 40,210,196, 8,168,209,196, 8, 0, 0, 0, 0,
+156, 1,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,210,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,210,196, 8,
+232,209,196, 8, 0, 0, 0, 0,156, 1, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,210,196, 8,110, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 40,210,196, 8, 0, 0, 0, 0,156, 1, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+168,210,196, 8,111, 0, 0, 0, 1, 0, 0, 0,240,210,196, 8, 0, 0, 0, 0,104,208,196, 8,168,208,196, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,240,210,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 56,211,196, 8,168,210,196, 8,
+104,208,196, 8,104,209,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 56,211,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,128,211,196, 8,240,210,196, 8,168,208,196, 8,168,209,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,128,211,196, 8,111, 0, 0, 0, 1, 0, 0, 0,200,211,196, 8, 56,211,196, 8,104,209,196, 8,168,209,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,200,211,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 16,212,196, 8,
+128,211,196, 8, 40,209,196, 8,232,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 16,212,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0, 88,212,196, 8,200,211,196, 8,104,209,196, 8, 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0, 88,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0,160,212,196, 8, 16,212,196, 8,168,209,196, 8,
+ 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,160,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0,
+232,212,196, 8, 88,212,196, 8,232,209,196, 8, 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+232,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 48,213,196, 8,160,212,196, 8, 40,209,196, 8,104,209,196, 8, 1, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 48,213,196, 8,111, 0, 0, 0, 1, 0, 0, 0,120,213,196, 8,232,212,196, 8,
+ 40,208,196, 8, 40,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,120,213,196, 8,111, 0, 0, 0,
+ 1, 0, 0, 0,192,213,196, 8, 48,213,196, 8, 40,208,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 24, 0, 0, 0,192,213,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 8,214,196, 8,120,213,196, 8,232,208,196, 8,104,210,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,214,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,214,196, 8,
+192,213,196, 8,232,209,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,214,196, 8,
+111, 0, 0, 0, 1, 0, 0, 0,152,214,196, 8, 8,214,196, 8, 40,210,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65, 24, 0, 0, 0,152,214,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 80,214,196, 8,232,208,196, 8,
+168,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,224,214,196, 8,113, 0, 0, 0, 1, 0, 0, 0,
+216,215,196, 8, 0, 0, 0, 0,104,209,196, 8,104,208,196, 8,168,208,196, 8,168,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,
+232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1,196, 2, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,216,215,196, 8,113, 0, 0, 0, 1, 0, 0, 0,
+208,222,196, 8,224,214,196, 8, 40,209,196, 8,104,209,196, 8, 40,210,196, 8,232,209,196, 8, 0, 0, 0, 0,122,214,248, 61,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,
+ 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+155, 1, 0, 0,213, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,213, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 0,
+155, 1, 0, 0,240, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,156, 1, 22, 2, 1, 0, 3, 0,251, 2, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,218,196, 8, 80,221,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0,208,216,196, 8,160,217,196, 8, 68, 65, 84, 65,164, 0, 0, 0,208,216,196, 8,112, 0, 0, 0, 1, 0, 0, 0,
+160,217,196, 8, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,160,217,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,208,216,196, 8,
+ 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+180, 2, 0, 0,112,218,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 80,221,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
+ 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 38,175, 3, 65, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187,
+ 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61,
+ 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0,
+ 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 80,221,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,112,218,196, 8,
+ 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,208,222,196, 8,113, 0, 0, 0, 1, 0, 0, 0,
+176,236,196, 8,216,215,196, 8,104,210,196, 8, 40,210,196, 8,168,209,196, 8,232,208,196, 8, 0, 0, 0, 0, 1,184,157, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,157, 1, 0, 0,
+232, 3, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0,157, 1, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,157, 1, 0, 0,
+232, 3, 0, 0, 27, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 9, 9, 76, 2,235, 2, 3, 0, 3, 0,165, 2, 0, 0,
+ 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,224,196, 8, 48,235,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0,200,223,196, 8,200,223,196, 8, 68, 65, 84, 65,164, 0, 0, 0,200,223,196, 8,112, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0,152,224,196, 8,100, 0, 0, 0, 1, 0, 0, 0, 64,225,196, 8, 0, 0, 0, 0,
+ 9, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 3,197, 8,
+ 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,225, 2, 0, 0,227, 2, 0, 0,
+ 5, 0, 0, 0, 17, 0, 0, 0,207, 2, 0, 0,227, 2, 0, 0, 68, 65, 84, 65,184, 0, 0, 0, 64,225,196, 8, 98, 0, 0, 0,
+ 1, 0, 0, 0, 40,226,196, 8,152,224,196, 8, 6, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, 0, 0,120,190, 0, 0,159, 63,
+ 0, 0,242,190, 0,128,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 40, 1, 0, 0, 40,226,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,128,227,196, 8, 64,225,196, 8, 2, 0, 0, 0, 51, 51, 51, 63,
+ 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,
+ 59, 1, 0, 0, 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65,196, 0, 0, 0,
+128,227,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,208,229,196, 8, 40,226,196, 8, 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
+ 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,
+108, 1,124, 1, 0, 0, 0, 0,112,228,196, 8,120,229,196, 8, 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,112,228,196, 8,129, 0, 0, 0,
+ 1, 0, 0, 0,200,228,196, 8, 0, 0, 0, 0, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0,152, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,200,228,196, 8,129, 0, 0, 0,
+ 1, 0, 0, 0, 32,229,196, 8,112,228,196, 8, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 32,229,196, 8,129, 0, 0, 0,
+ 1, 0, 0, 0,120,229,196, 8,200,228,196, 8, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 61, 10,192, 0, 0, 0, 0,
+ 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,120,229,196, 8,129, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 32,229,196, 8, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,174,143, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,208,229,196, 8,166, 0, 0, 0,
+ 1, 0, 0, 0,160,230,196, 8,128,227,196, 8, 11, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0,128,192, 0, 0,122, 67,
+ 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
+ 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65,
+ 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,160,230,196, 8, 99, 0, 0, 0, 1, 0, 0, 0,112,231,196, 8,208,229,196, 8,
+ 13, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0,
+ 0, 0,182, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0,
+ 16, 0, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68,
+ 0, 0,122, 68,205,204,204, 61, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+176, 0, 0, 0,112,231,196, 8,177, 0, 0, 0, 1, 0, 0, 0, 80,232,196, 8,160,230,196, 8, 12, 0, 0, 0, 51, 51, 51, 63,
+ 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193,
+ 0, 0,247, 67, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,
+ 14, 2, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,
+ 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,180, 2, 0, 0, 80,232,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 48,235,196, 8,112,231,196, 8, 1, 0, 0, 0,
+ 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 1,184,157, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 33,195, 79, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 48,235,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 80,232,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,176,236,196, 8,113, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,208,222,196, 8, 40,208,196, 8, 40,209,196, 8,232,209,196, 8,104,210,196, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,185, 0, 0, 0,211, 0, 0, 0,
+ 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,156, 1,185, 0, 3, 0, 3, 0,
+ 79, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,249,196, 8, 8,250,196, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0,168,237,196, 8, 56,248,196, 8, 68, 65, 84, 65,164, 0, 0, 0,168,237,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,120,238,196, 8, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120,238,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 72,239,196, 8,
+168,237,196, 8, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0, 72,239,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24,240,196, 8,120,238,196, 8, 65,110,105,109,
+ 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
+ 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+ 24,240,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232,240,196, 8, 72,239,196, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,232,240,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,184,241,196, 8, 24,240,196, 8, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184,241,196, 8,112, 0, 0, 0, 1, 0, 0, 0,136,242,196, 8,
+232,240,196, 8, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,210, 3, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,136,242,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88,243,196, 8,184,241,196, 8, 72,111,111,107,
+115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
+ 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0,
+ 88,243,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40,244,196, 8,136,242,196, 8, 80, 97,114,116,105, 99,108,101, 32, 73,110,116,
+101,114, 97, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 40,244,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0,248,244,196, 8, 88,243,196, 8, 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,232,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0,248,244,196, 8,112, 0, 0, 0, 1, 0, 0, 0,200,245,196, 8,
+ 40,244,196, 8, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,164, 0, 0, 0,200,245,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152,246,196, 8,248,244,196, 8, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
+101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0,
+ 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,
+152,246,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104,247,196, 8,200,245,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,104,247,196, 8,112, 0, 0, 0,
+ 1, 0, 0, 0, 56,248,196, 8,152,246,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56,248,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+104,247,196, 8, 83, 99,114,105,112,116,108,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 68, 65, 84, 65,212, 0, 0, 0, 8,249,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 8,250,196, 8, 0, 0, 0, 0, 4, 0, 0, 0,
+ 51, 51, 51, 63, 1, 89, 48,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0,193, 0, 0,163, 67, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193, 35,159, 3, 68, 0, 0, 0,193, 0, 0,104, 67,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
+ 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,156, 1,185, 0, 0, 0, 0, 0, 5, 0,255,255, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 8,250,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 8,249,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 48,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0,244, 3, 0, 0,136,251,196, 8, 87, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,116, 97,103,101,
+ 0, 97,105,110, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40, 9,197, 8,160, 2,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0,168,255,196, 8, 56, 0,197, 8,168,255,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0,128, 0,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
+250, 0,100, 0,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0,100, 0,141, 0, 32, 3, 88, 2,
+100, 0,100, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 4, 0, 0, 0, 90, 0, 16, 0, 23, 0, 1, 0, 0, 0,128, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 8, 0, 25, 0, 10, 0, 0, 0, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,205,204, 76, 63,102,102,102, 63, 0, 0,128, 63, 0, 0,128, 64,
+ 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47, 47, 98, 97, 99,107, 98,117,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47, 47,102,116,121,112,101, 0, 64, 38, 35, 0, 0, 0, 0, 0, 64, 94, 0, 0, 64, 38, 94, 0, 0, 0, 35, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,226,187, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 28, 0, 0, 0,
+168,255,196, 8, 79, 0, 0, 0, 1, 0, 0, 0,240,255,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
+128, 2,108, 1, 72, 12,197, 8, 68, 65, 84, 65, 28, 0, 0, 0,240,255,196, 8, 79, 0, 0, 0, 1, 0, 0, 0, 56, 0,197, 8,
+168,255,196, 8, 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 78, 3,159, 1,152, 15,197, 8, 68, 65, 84, 65, 28, 0, 0, 0,
+ 56, 0,197, 8, 79, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240,255,196, 8, 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,
+251, 3, 33, 0, 40, 9,197, 8, 68, 65, 84, 65, 40, 0, 0, 0,128, 0,197, 8, 78, 0, 0, 0, 1, 0, 0, 0, 44, 1, 0, 0,
+ 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 0,244, 1,200, 0,100, 0, 20, 0, 16, 39, 0, 0,205,204,204, 61, 0, 0,240, 65,
+ 0, 0, 0, 64, 68, 65, 84, 65, 28, 0, 0, 0, 48, 49,197, 8, 86, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 90, 0, 9, 0,
+ 1, 0, 0, 0, 0, 0,128, 63,111, 18,131, 58, 32, 0, 32, 0, 32, 0, 0, 0, 67, 65, 0, 0,116, 0, 0, 0,216, 0,197, 8,
+ 23, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97,
+ 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,205,204, 76, 62,
+ 0, 0, 0, 0,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66,161, 14,234, 64, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,
+252, 0, 0, 0,120, 1,197, 8, 31, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 32, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,247,255,239, 65,
+ 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 64, 11, 3, 0, 46, 26,128, 63, 25, 4,240, 65,
+ 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 0, 0, 32, 1, 0, 0,160, 2,197, 8, 77, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,174,103, 61,112, 29, 98, 62,
+205,204,204, 62, 0, 0, 0, 0,205,204,204, 61,205,204,204, 61,205,204,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+205,204, 28, 65, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 84, 88, 0, 0,100, 0, 0, 0,240, 3,197, 8, 21, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0,128, 4,197, 8,128, 4,197, 8,128, 4,197, 8,128, 4,197, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0,248, 4,197, 8,255,255,255,255, 0, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,
+128, 4,197, 8, 20, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 4,197, 8, 0, 0, 0, 0, 0, 0, 0, 0,
+ 69, 69, 82, 70, 68, 65, 84, 65, 4, 0, 0, 0,200, 4,197, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 79, 66, 0, 0,
+244, 2, 0, 0, 40, 9,197, 8, 71, 0, 0, 0, 1, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 1, 89, 70,108, 0, 0, 0, 0,
+ 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 42,254,141, 63,192, 57, 49, 60, 34,159, 80, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63,
+ 53, 70, 58, 63,222, 56, 49,188, 0, 0, 0, 0, 86,126,162,190,227,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,
+149, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+157,190,215, 49,167,170, 4, 52, 0, 0, 0,128,129,116,157,178, 1, 0,128, 63, 33, 69, 15, 51, 0, 0, 0,128, 73,254, 67, 51,
+243, 97,106, 49, 0, 0,128, 63, 0, 0, 0,128, 3, 0, 64, 52,183,164,157, 39, 0, 0,128, 53, 0, 0,128, 63, 1, 0, 0, 0,
+ 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 6, 41,100, 63, 0, 0,128, 63,205,204,204, 62, 0, 0, 0, 0, 6, 41,100, 63,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 79, 66, 0, 0,244, 2, 0, 0, 72, 12,197, 8, 71, 0, 0, 0, 1, 0, 0, 0,152, 15,197, 8, 40, 9,197, 8,
+ 1, 89,123, 92, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63,222,149, 47, 63, 52, 70, 58, 63,179, 56, 49,188, 0, 0, 0,128, 86,126,162,190,227,251,159, 62, 56, 53,101, 63,
+ 0, 0, 0,128, 7,165, 39, 63,149, 84, 28,191, 50,247,227, 62, 0, 0, 0,128,110,101,239, 64,151, 62,208,192, 77,255,170, 64,
+ 0, 0,128, 63, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,
+ 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 24,218,193, 8,200, 29,197, 8, 68, 65, 84, 65, 4, 0, 0, 0,104, 15,197, 8, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 79, 66, 0, 0,244, 2, 0, 0,152, 15,197, 8, 71, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8,
+ 1, 89,121, 92, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 1,197, 8, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,123, 38, 63, 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54,236,148,190, 25,134,116, 63,236, 13, 98,189, 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190, 34,194, 26, 63,
+ 0, 0, 0, 0, 37,255, 16, 63,241,161, 95, 62,164,111, 75, 63, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 53,236,148,190,222,102, 69,191, 37,255, 16, 63, 0, 0, 0,128, 24,134,116, 63, 57,174, 76,190,240,161, 95, 62,
+ 0, 0, 0,128,235, 13, 98,189, 34,194, 26, 63,166,111, 75, 63, 0, 0, 0,128,208, 19, 13, 63,234, 65,102,190, 10, 10,231,192,
+ 0, 0,128, 63, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,
+ 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0,156, 1, 0, 0,184, 18,197, 8, 33, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63,
+ 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63,
+ 0, 0, 0, 0, 2, 0, 2, 0, 50, 0, 0, 6, 3, 0, 1, 3, 0, 0, 0, 0, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,
+205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 1, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,128, 63, 0, 0,128, 63,128, 20,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
+ 88, 0, 0, 0,128, 20,197, 8, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 21,197, 8,
+ 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0,
+ 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,
+205,204, 76, 62, 0, 0, 0, 0, 84, 69, 0, 0,228, 0, 0, 0, 8, 21,197, 8, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63,
+ 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
+ 1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 77, 69, 0, 0,188, 0, 0, 0, 24, 22,197, 8, 46, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0,232, 31,194, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23,197, 8, 88, 0,194, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0,216, 21,194, 8,120, 28,194, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180,
+ 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0, 0, 23,197, 8, 0, 0, 0, 0,
+ 1, 0, 0, 0,184, 18,197, 8, 68, 65, 84, 65,160, 0, 0, 0,216, 21,194, 8, 51, 0, 0, 0, 8, 0, 0, 0, 0, 0,128, 63,
+255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182, 3,255, 0, 0,128, 63, 0, 0,128,191, 0, 0,128,191,230, 73, 26,182,
+ 26,182, 3,255, 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, 26,182, 3,255,250,255,127,191, 3, 0,128, 63,
+ 0, 0,128,191, 26,182,230, 73, 26,182, 3,255, 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,230, 73,230, 73,230, 73, 3,255,
+245,255,127, 63, 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 3,255, 3, 0,128,191,250,255,127,191, 0, 0,128, 63,
+ 26,182, 26,182,230, 73, 3,255,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, 26,182,230, 73,230, 73, 3,255, 68, 65, 84, 65,
+144, 0, 0, 0,120, 28,194, 8, 48, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0,
+ 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0,
+ 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,
+ 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0,
+ 68, 65, 84, 65,120, 0, 0, 0, 88, 0,194, 8, 47, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 2, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 71, 76, 79, 66, 24, 0, 0, 0,160,240,255,191,114, 0, 0, 0, 1, 0, 0, 0,
+ 96, 40,196, 8,136,251,196, 8, 1, 0, 0, 1, 0, 0, 0, 0,128, 32, 4, 0, 0, 0, 0, 0, 85, 83, 69, 82,168, 7, 0, 0,
+224,226,172, 8,108, 0, 0, 0, 1, 0, 0, 0, 33, 24, 0, 0, 63, 2, 0, 0, 5, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85,115,101,114,115,
+ 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98,108,101,110,100,
+101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 48, 52, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 64, 0,
+ 5, 0, 2, 0, 0,104, 97,108,107, 98,111, 97,114,100, 46,116,116,102, 0, 55, 46, 53, 46, 48, 45,112,111,119,101,114,112, 99,
+ 47, 98,105,110, 47, 98,108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114,
+ 99,101,115, 47, 46, 98,102,111,110,116, 46,116,116,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,200, 32,197, 8,216, 40,197, 8, 32, 0, 0, 0, 5, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,
+205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 30, 90,100,191,
+154,153,153, 62,102,102,102, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62, 9, 0, 0, 63,156,153, 25, 63,
+ 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62,205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63, 32,133,235, 62,184,243,125, 62,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 43,135, 61,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190, 0, 0, 0, 0, 14, 0, 0, 0,
+ 25, 0, 15, 0,120, 0, 0, 0, 60, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,224, 7, 0, 0,200, 32,197, 8,
+106, 0, 0, 0, 1, 0, 0, 0,216, 40,197, 8, 0, 0, 0, 0, 68,101,102, 97,117,108,116, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,160,160,255,160,160,160,255,173,160,147,255,138,158,161,255,
+161,161,174,255,161,153,167,255,144,144,144,255,144,144,144,255,198,119,119,255,160,160,160,255, 0, 0, 0,255,255,255,255,255,
+210,210,210,255,218,218,218,255,127,127,127,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0,180,180,180,255, 0, 0, 0,255,
+255,255,255,255,195,195,195,255,255,255,255, 40,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,
+255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,
+230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+115,115,115,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
+ 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255,
+ 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,
+200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,160,160,160,100,
+127,112,112,100,160,160,208,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,
+255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,
+255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,120,120,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,
+255,255,255,150,172,172,172,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,
+255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255,
+ 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,
+255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,
+255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,
+230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,173,173,173,255,127,112,112,100, 0, 0, 0, 0,
+140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255,
+ 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,
+200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,172,172,172,255,
+ 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,
+255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255,166,166,166,255,200,100,200, 60,
+255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,
+165,165,165,127,172,172,172,255, 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,
+255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255,
+ 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,228,156,198,255,255,255,170,255,
+ 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,115,115,115,255, 0, 0, 0,255,
+255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,
+255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,
+230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 53, 53, 53,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0,
+ 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255,
+ 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 40,200,100,200, 80,255,138, 48,255, 34,221,221,255,
+200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,110,110,110,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,170,170,186,255,
+127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,
+255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,
+255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,
+165,165,165,127,143,143,143,255,198,119,119,255,255, 0, 0,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,
+255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255,
+ 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2, 4, 0, 0,100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255,153,153,153,255, 0, 0, 0,255,
+255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,
+255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,
+230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,173,173,173,255,127,112,112,100, 0, 0, 0, 0,
+140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255,
+ 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,
+200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,224, 7, 0, 0,216, 40,197, 8,106, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+200, 32,197, 8, 82,111,117,110,100,101,100, 0, 0,101,119, 32, 85,115,101,114, 32, 84,104,101,109,101, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,176,176,176,255,107,107,107,255,177,177,177,255,178,178,178,255,143,143,143,255,143,143,143,255,
+107,107,107,255,198,119,119,255,143,143,143,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0,111, 0, 0, 33, 83,255,130, 0,255,
+255,255,255,255, 0, 0, 0,255, 2, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,175,175,175, 51,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,
+255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,
+200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
+107,107,107,255, 0, 0, 0, 51,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255,
+ 0, 0, 0, 40,255,255,255,255,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255,
+ 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0,
+ 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255,
+ 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100,255,130, 0,255, 88, 88, 88,255,
+ 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
+144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,107,107,107,150,107,107,107,100,143,143,143,100,
+ 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,255,255,255,
+255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,
+255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,
+200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255,
+158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255,
+ 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255,
+ 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255,
+ 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
+144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0,143,143,143,255,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,165,165,165,150,107,107,107,255,178,178,178,100,
+255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,
+255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,255,255,255,170,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,
+255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,
+200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0,255,255,255,255,255,
+195,195,195,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
+ 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255,
+ 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,150,143,143,143,255,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255,
+ 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
+144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,255,255,255,255,153,153,153,255,165,165,165,150,143,143,143,255,198,119,119,255,
+255, 0, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,
+255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,100, 0, 0,255, 0, 0,200,255,
+128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,
+160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,
+255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,
+200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255,
+158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255,
+ 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 78, 65, 49,
+ 60,100, 0, 0, 16,170,197, 8, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69,196, 5, 0, 0, 42,110,101,120,
+116, 0, 42,112,114,101,118, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, 0,122, 0,119, 0,120,109,105,
+110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,
+101, 91, 50, 52, 93, 0,117,115, 0,102,108, 97,103, 0,112, 97,100, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102,
+105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0,116,111,116, 0, 99,117,114,118,101, 0, 99,117,114, 0,
+ 98,108,111, 99,107,116,121,112,101, 0,115,104,111,119,107,101,121, 0,112,111,115, 0, 99,117,114,118, 97,108, 0,116,121,112,
+101, 0, 97,100,114, 99,111,100,101, 0,116,111,116,101,108,101,109, 0, 42,100, 97,116, 97, 0, 42,119,101,105,103,104,116,115,
+ 0,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,
+108,105,100,101,114,109, 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,
+109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,
+117,114,112,104, 0, 42, 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,
+111,116,115, 99,114,105,112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0,108,101,110, 0, 98,108,101,110, 0,
+ 42,110, 97,109,101, 0,102,108, 97,103,115, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,
+115,101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,
+115, 0,117,110,100,111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,115,105,122,101, 0,115,101,101,107, 0,112,
+ 97,115,115,101,112, 97,114,116, 97,108,112,104, 97, 0,112, 97,100, 49, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101,
+110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0, 89, 70, 95,
+100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117,114,101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89,
+ 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114,111,116, 0,115, 99,114,105,112,116,108,105,110,107, 0, 42,
+ 97,110,105,109, 0, 42,105, 98,117,102, 0, 42,109,105,112,109, 97,112, 91, 49, 48, 93, 0,111,107, 0,108, 97,115,116,102,114,
+ 97,109,101, 0,108, 97,115,116,113,117, 97,108,105,116,121, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110,
+100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101,
+ 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0,108, 97,115,116,117,112,100, 97,116,101,
+ 0,108, 97,115,116,117,115,101,100, 0, 97,110,105,109,115,112,101,101,100, 0,114,101,115,101,114,118,101,100, 49, 0,114,101,
+115,101,114,118,101,100, 50, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101,
+110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,
+112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,
+102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0,
+ 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,
+112,102, 97, 99, 0, 42,104, 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,
+112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100,
+ 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,
+118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0,100, 97,116, 97, 91, 49, 54, 93, 0, 42,105,109, 97, 0,
+ 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,115,116,121,112,101, 0,110,111,116,108, 97,121,
+ 0, 99,117, 98,101,114,101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110,
+111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,
+114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,
+103, 95,108, 97, 99,117,110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,
+116, 0,109,103, 95,103, 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,
+101, 0,118,110, 95,119, 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,
+112, 0,118,110, 95,100,105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104,
+ 0,110,111,105,115,101,116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115,
+ 50, 0,105,109, 97,102,108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,
+120,109, 97,120, 0, 99,114,111,112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120,
+116,101,110,100, 0, 99,104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,102,114, 97,109,101,115, 0,111,102,
+102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0,
+ 42,101,110,118, 0,102,114, 97,100,117,114, 91, 52, 93, 91, 50, 93, 0,109,111,100,101, 0,116,111,116,101,120, 0,101,110,101,
+114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110,
+116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0,115,104, 97,100,115,112,111,
+116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109,
+112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95,
+115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95,
+115,105,122,101,122, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0, 89, 70, 95,110,117,109,
+112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116,104, 0,
+ 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, 95, 99,
+ 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119,105,110,
+116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,112, 97,100, 51, 0, 89, 70, 95,103,108,111,119,116,121,112,101,
+ 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, 91, 49, 48, 93, 0,108, 97,121, 0,115,112,101, 99,114, 0,115,112,101,
+ 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98,
+ 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,
+109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,
+116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108,
+ 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105,
+ 0,102,105,108,116,101,114, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, 0,
+104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,109,111,100,101, 50, 0,102,108, 97,114,101, 99, 0,115,116, 97,
+114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0,
+115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,
+114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,114,103, 98,115,101,108, 0,112,114, 95,116,
+121,112,101, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,115,101,112,116,101,120, 0,112, 97,100, 52, 0,
+112, 97,100, 53, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,
+103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,
+101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95,
+ 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,
+109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,112, 97,100, 51, 0,114, 97,109,112,
+102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0,102,114,105, 99,116,105,111,110, 0,102,104,
+ 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101,
+ 0,112, 97,100, 50, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100,115, 99, 97,108,
+101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,101,116, 0, 89, 70, 95,100,
+106,105,116, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99, 97,108,101, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49,
+ 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52,
+ 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116,
+ 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, 0,108,
+111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101,
+ 0,116,104,114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,104, 49,
+ 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,
+112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117,
+ 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111,
+116,115,118, 0, 42, 98,112, 0, 42, 98,101,122,116, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114,
+ 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101,
+ 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108,
+ 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105,
+110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99,
+101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100,
+116,104, 0, 42,115,116,114, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116,
+ 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,111,116, 98,111,
+120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,
+114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0, 42,111, 98, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0,109, 97,120,114,
+ 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120,
+116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0, 42,100,114,105,118,101,114, 0, 42,116,112, 97,103,101, 0,117,
+118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,
+112, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,100,102, 97, 99,101, 0, 42,109,
+118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,
+121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,111, 99, 0, 42,115,117,109,111,104, 97,110,100,108,101, 0,116,111,116,
+101,100,103,101, 0,116,111,116,102, 97, 99,101, 0, 99,117, 98,101,109, 97,112,115,105,122,101, 0,115,109,111,111,116,104,114,
+101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0,118,
+ 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0,100,101,102, 95,110,114, 0,
+ 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0, 99,111, 91, 50, 93, 0,
+ 42,101,114,114,111,114, 0,109,111,100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112,101, 0,108,101,118,101,108,
+115, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,
+115,116, 97,114,116, 0,108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 97,120,105,115,
+ 0,116,111,108,101,114, 97,110, 99,101, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,115,116, 97,
+114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100,
+ 97,109,112, 0,116,105,109,101,111,102,102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103,
+ 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0,102, 97,108,108,111,102,102,
+ 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,101, 0,111,112,101,114, 97,116,105,
+111,110, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,
+112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,
+119, 0, 42,100,101,102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,100,118,101, 99, 91, 51, 93, 0,109, 97,120, 0, 42, 42,111,
+ 98, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115,
+116,114, 91, 51, 50, 93, 0, 42,112, 97,114,100, 97,116, 97, 0, 42,112, 97,114,101,110,116, 0, 42,116,114, 97, 99,107, 0, 42,
+ 97, 99,116,105,111,110, 0, 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,
+110,101,116,119,111,114,107, 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51,
+ 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,100,113,117, 97,116,
+ 91, 52, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97,
+103, 0,105,112,111,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,108,
+ 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99,
+ 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,
+100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, 0, 99,116,105,109,101, 0,109, 97,115,115, 0,100, 97,109,112,
+105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,115,111,102,116,116,105,109,101, 0,
+114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,112,
+114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114,
+115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0,100,102,114, 97,115, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,
+103, 0,103, 97,109,101,102,108, 97,103, 50, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99,
+ 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112,
+115, 0,104,111,111,107,115, 0, 42,112,100, 0, 42,115,111,102,116, 0, 42,108,105,102,101, 0,108, 98,117,102, 0,112,111,114,
+116, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103,
+ 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100,101,114,105,118,101,100, 68,101,102,111,114,
+109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,117,114,105,110,100,
+101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,112,100,101,
+102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,102, 95,115,116,
+114,101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,109, 97,120,100,105,115,116, 0,112,100,101,102, 95,115, 98,100, 97,
+109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0,116,111,116,112,111,105,110,
+116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,110,111,100,
+101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112,104,
+121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99,116,
+ 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114,111,
+117,112, 0,105,110,115,112,114,105,110,103, 0,105,110,102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,
+108, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,
+101,100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,
+101,115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,
+110,100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,
+105,115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,
+114, 97,118,120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,
+110,100, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,
+108,121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101,
+ 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97,
+114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111,114,
+103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, 0,
+ 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, 0,
+108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66,111,
+120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,109,105,
+115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114,114,
+ 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97,114,
+109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100,111,
+102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115,116,
+ 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111,100,
+101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 42, 97,111,115,112,104,101,114,101,
+ 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116,121,112,101, 0,115,117, 98,115,104,111,
+111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0,109, 97,120,115,117, 98,108, 97,109,112,
+ 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, 97,120,110,111,100,101, 0, 99,111,110,
+118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0,115,101,108, 99,111,108, 0,115,120, 0,
+115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, 99,
+ 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,119, 75,101,121, 70,
+114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115, 80,101,114, 83,101,
+ 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,101,114,121, 0, 97,
+118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, 99,
+100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0,109,105,120,114, 97,116,101, 0,109,
+ 97,105,110, 0,112, 97,100, 91, 51, 93, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101,
+ 99,100, 97,116, 97, 0, 99,102,114, 97, 0,105,109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,102,114, 97,109,101,
+108,101,110, 0, 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,
+108,108,115, 99,114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,
+116,114,105, 98, 0,114,116, 49, 0,114,116, 50, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,
+110,115,112,114,101,115,101,116, 0,102,105,108,116,101,114,116,121,112,101, 0,109, 97,120,105,109,115,105,122,101, 0,120,115,
+ 99,104, 0,121,115, 99,104, 0,120, 97,115,112, 0,121, 97,115,112, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,115, 0,
+115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,
+112,101, 0, 98,117,102,102,108, 97,103, 0,113,117, 97,108,105,116,121, 0,115, 99,101,109,111,100,101, 0,114,101,110,100,101,
+114,101,114, 0,111, 99,114,101,115, 0,114,112, 97,100, 91, 50, 93, 0, 97,108,112,104, 97,109,111,100,101, 0,100,111,103, 97,
+109,109, 97, 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,109,101, 95,109, 97,116,
+ 95,114,101,100,117,120, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0,112,111,115,116,103, 97,109,109, 97, 0,112,
+111,115,116, 97,100,100, 0,112,111,115,116,105,103, 97,109,109, 97, 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97,
+116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0,122,109,105,110, 0,102,111, 99,117,115, 0,122,103,
+ 97,109,109, 97, 0,122,115,105,103,109, 97, 0,122, 98,108,117,114, 0, 71, 73,113,117, 97,108,105,116,121, 0, 71, 73, 99, 97,
+ 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110,115, 0, 71, 73,100,105,114,101, 99,116, 0,
+ 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95,110,111, 98,117,109,112, 0, 89, 70, 95, 99,
+108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, 71, 73, 99, 97,117,115,100,101,112,
+116,104, 0, 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, 71, 73,112,104,111,116,111,110, 99,111,117,
+110,116, 0, 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111,116,111,110,114, 97,100,105,117,115, 0, 89,
+ 70, 95,110,117,109,112,114,111, 99,115, 0, 89, 70, 95,114, 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115,
+101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108,101,115, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108,105,116,121, 0,
+ 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114,112,111,119,101,
+114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, 98,105, 97,
+115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111,108,100, 0,
+ 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, 0,102,116,121,112,101, 91, 49, 54, 48, 93,
+ 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97,109,101, 91, 54, 52, 93, 0, 99,111,114,110,101,114,116,121,112,
+101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,100,101,103,114, 0,115,116,101,112, 0,116,117,114,110, 0,101,120,116,
+114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,
+118,101,114,116,105, 99,101,115, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115,
+101, 0, 42, 98, 97,115, 97, 99,116, 0, 42,103,114,111,117,112, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,
+116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,115,101,108,101, 99,116,109,111,100,
+101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0,101,100,105,116, 98,117,116,
+115,105,122,101, 0, 42,101,100, 0, 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103, 0, 42,116,111,111,108,115,101,116,
+116,105,110,103,115, 0, 97,117,100,105,111, 0,109, 97,114,107,101,114,115, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,
+115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0,100,105,114,116,121, 0,122,111,111,109, 0, 98,108,101,110,100,
+ 0,120,105,109, 0,121,105,109, 0, 42,114,101, 99,116, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, 99,107,115, 99,
+ 97,108,101, 0, 42, 97,114,101, 97, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,118,105,101,119,109, 97,
+116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93,
+ 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,
+118,105,101,119,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,112,101,114,115,112,
+ 0,118,105,101,119, 0, 42, 98,103,112,105, 99, 0, 42,108,111, 99, 97,108,118,100, 0,108,111, 99, 97,108,118,105,101,119, 0,
+108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0, 99, 97,109,122,111,111,109, 0,
+103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112,105,120,115,105,122,101, 0,110,101, 97,114, 0,102, 97,114, 0,103,
+114,105,100,108,105,110,101,115, 0,118,105,101,119, 98,117,116, 0,103,114,105,100,102,108, 97,103, 0,109,111,100,101,115,101,
+108,101, 99,116, 0,109,101,110,117,110,114, 0,116,101,120,110,114, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,
+116,119,102,108, 97,103, 0,116,119,100,114, 97,119,102,108, 97,103, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108,
+105,112, 91, 52, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,
+120,114, 97,121, 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93,
+ 0,109,105,110,122,111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,107,101,101,112,116,111,116, 0,
+107,101,101,112, 97,115,112,101, 99,116, 0,107,101,101,112,122,111,111,109, 0,111,108,100,119,105,110,120, 0,111,108,100,119,
+105,110,121, 0,114,111,119, 98,117,116, 0,118, 50,100, 0, 42,101,100,105,116,105,112,111, 0,105,112,111,107,101,121, 0, 97,
+ 99,116,110, 97,109,101, 91, 51, 50, 93, 0, 99,111,110,115,116,110, 97,109,101, 91, 51, 50, 93, 0,116,111,116,105,112,111, 0,
+112,105,110, 0, 98,117,116,111,102,115, 0, 99,104, 97,110,110,101,108, 0,108,111, 99,107, 0,109,101,100,105, 97,110, 91, 51,
+ 93, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0, 97,108,105,103,110, 0,116, 97, 98,111, 0,109, 97,105,110,
+ 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120,102,114,111,109, 0,115,104,111,119,103,
+114,111,117,112, 0,114,101, 99,116,120, 0,114,101, 99,116,121, 0, 99,117,114,121, 0,109,111,100,101,108,116,121,112,101, 0,
+115, 99,114,105,112,116, 98,108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115,
+ 0,116, 97, 98, 91, 55, 93, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,108,101, 0,116,105,116,108,101, 91,
+ 50, 52, 93, 0,100,105,114, 91, 49, 54, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,102,115, 0,115,111,114,116, 0,109,
+ 97,120,110, 97,109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0, 42,108,105, 98,102,105,108,101,100, 97,116, 97, 0,114,
+101,116,118, 97,108, 0,109,101,110,117, 0, 97, 99,116, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 42,
+109,101,110,117,112, 0,111,111,112,115, 0,118,105,115,105,102,108, 97,103, 0,116,114,101,101, 0, 42,116,114,101,101,115,116,
+111,114,101, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,101,112,115, 95,102,108,
+ 97,103,115, 0, 42,105,109, 97,103,101, 0,105,109, 97,110,114, 0, 99,117,114,116,105,108,101, 0, 42,116,101,120,116, 0,116,
+111,112, 0,118,105,101,119,108,105,110,101,115, 0,102,111,110,116, 95,105,100, 0,108,104,101,105,103,104,116, 0,108,101,102,
+116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0, 99,117,114,114,116, 97, 98, 95,
+115,101,116, 0,115,104,111,119,115,121,110,116, 97,120, 0,117,110,117,115,101,100, 95,112, 97,100,100, 0,112,105,120, 95,112,
+101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, 97,114, 0, 42,115, 99,114,105,112,116,
+ 0,114,101,100,114, 97,119,115, 0,116,105,116,108,101, 91, 50, 56, 93, 0,102, 97,115,101, 0,115,117, 98,102, 97,115,101, 0,
+109,111,117,115,101, 95,109,111,118,101, 95,114,101,100,114, 97,119, 0,105,109, 97,102, 97,115,101, 0,109,120, 0,109,121, 0,
+100,105,114,115,108,105, 0,100,105,114,115,108,105, 95,108,105,110,101,115, 0,100,105,114,115,108,105, 95,115,120, 0,100,105,
+114,115,108,105, 95,101,121, 0,100,105,114,115,108,105, 95,101,120, 0,100,105,114,115,108,105, 95,104, 0,105,109, 97,115,108,
+105, 0,102,105,108,101,115,101,108,109,101,110,117,105,116,101,109, 0,105,109, 97,115,108,105, 95,115,120, 0,105,109, 97,115,
+108,105, 95,101,121, 0,105,109, 97,115,108,105, 95,101,120, 0,105,109, 97,115,108,105, 95,104, 0,100,115,115,120, 0,100,115,
+115,121, 0,100,115,101,120, 0,100,115,101,121, 0,100,101,115,120, 0,100,101,115,121, 0,100,101,101,120, 0,100,101,101,121,
+ 0,102,115,115,120, 0,102,115,115,121, 0,102,115,101,120, 0,102,115,101,121, 0,100,115,100,104, 0,102,115,100,104, 0,102,
+101,115,120, 0,102,101,115,121, 0,102,101,101,120, 0,102,101,101,121, 0,105,110,102,115,120, 0,105,110,102,115,121, 0,105,
+110,102,101,120, 0,105,110,102,101,121, 0,100,110,115,120, 0,100,110,115,121, 0,100,110,119, 0,100,110,104, 0,102,110,115,
+120, 0,102,110,115,121, 0,102,110,119, 0,102,110,104, 0,102,111,108,101, 91, 49, 50, 56, 93, 0,100,111,114, 91, 49, 50, 56,
+ 93, 0,102,105,108,101, 91, 49, 50, 56, 93, 0,100,105,114, 91, 49, 50, 56, 93, 0, 42,102,105,114,115,116,100,105,114, 0, 42,
+102,105,114,115,116,102,105,108,101, 0,116,111,112,100,105,114, 0,116,111,116, 97,108,100,105,114,115, 0,104,105,108,105,116,
+101, 0,116,111,112,102,105,108,101, 0,116,111,116, 97,108,102,105,108,101,115, 0,105,109, 97,103,101, 95,115,108,105,100,101,
+114, 0,115,108,105,100,101,114, 95,104,101,105,103,104,116, 0,115,108,105,100,101,114, 95,115,112, 97, 99,101, 0,116,111,112,
+105,109, 97, 0,116,111,116, 97,108,105,109, 97, 0, 99,117,114,105,109, 97,120, 0, 99,117,114,105,109, 97,121, 0, 42,102,105,
+114,115,116, 95,115,101,108, 95,105,109, 97, 0, 42,104,105,108,105,116,101, 95,105,109, 97, 0,116,111,116, 97,108, 95,115,101,
+108,101, 99,116,101,100, 0,105,109, 97, 95,114,101,100,114, 97,119, 0, 42, 99,109, 97,112, 0, 42, 97,114,103, 49, 0,111,117,
+116,108,105,110,101, 91, 52, 93, 0,110,101,117,116,114, 97,108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101,
+116,116,105,110,103, 91, 52, 93, 0,115,101,116,116,105,110,103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93,
+ 0,110,117,109, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104,
+105, 91, 52, 93, 0,112,111,112,117,112, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93,
+ 0,109,101,110,117, 95, 98, 97, 99,107, 91, 52, 93, 0,109,101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95,
+104,105,108,105,116,101, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116,
+ 95,104,105, 91, 52, 93, 0, 98,117,116, 95,100,114, 97,119,116,121,112,101, 0,112, 97,100, 49, 91, 51, 93, 0, 98, 97, 99,107,
+ 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93,
+ 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,
+101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93,
+ 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,
+101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,
+101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99,
+101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,
+110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,
+101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0,118,101,
+114,116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115,
+121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,
+115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,
+116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116,115,110,100, 0,116, 97, 99,116, 0,
+116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97,115,101,108, 0,116,101,120,116, 0,116,111,111,112,
+115, 0,116,116,105,109,101, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101,
+ 0,116,101,109,112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,100,101,
+114,100,105,114, 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,120,100,
+105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,100,105,
+114, 91, 49, 54, 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,105,114,
+ 91, 49, 54, 48, 93, 0,118,101,114,115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103,
+115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103,
+101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,108,101, 95, 98,117,102,102,
+101,114, 0, 99,111,110,115,111,108,101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101, 0,102,111,110,116,115,105,
+122,101, 0,101,110, 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,
+111,108,100, 49, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110, 97,109,101, 91, 50, 53, 54,
+ 93, 0,116,104,101,109,101,115, 0,117,110,100,111,115,116,101,112,115, 0, 99,117,114,115,115,105,122,101, 0,116, 98, 95,108,
+101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,
+116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101,
+ 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,
+116,101, 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115,
+101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,115, 99,101,110,101, 0,101,110,100,120, 0,101,110,100,121, 0,115,105,122,101,
+120, 0,115,105,122,101,121, 0,115, 99,101,110,101,110,114, 0,115, 99,114,101,101,110,110,114, 0,102,117,108,108, 0,109, 97,
+105,110,119,105,110, 0,119,105,110, 97,107,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101,
+ 99, 0, 42,118, 49, 0, 42,118, 50, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91,
+ 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, 0, 99,111,110,116,114,111,108, 0,111,108,100, 95,111,102,115,120, 0,111,
+108,100, 95,111,102,115,121, 0,115,111,114,116, 99,111,117,110,116,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42,118,
+ 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,104,101, 97,100,114, 99,116,
+ 0,119,105,110,114, 99,116, 0,104,101, 97,100,119,105,110, 0,119,105,110, 0,104,101, 97,100,101,114,116,121,112,101, 0, 98,
+117,116,115,112, 97, 99,101,116,121,112,101, 0,119,105,110,120, 0,119,105,110,121, 0,104,101, 97,100, 95,115,119, 97,112, 0,
+104,101, 97,100, 95,101,113,117, 97,108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,110, 95,101,113,117, 97,108, 0,104,101,
+ 97,100, 98,117,116,108,101,110, 0,104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,114,115,111,114, 0,115,112, 97, 99,101,
+100, 97,116, 97, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42, 99,117,114,115, 99,114,101,101,110, 0,
+ 42, 99,117,114,115, 99,101,110,101, 0,100,105,115,112,108, 97,121,109,111,100,101, 0,102,105,108,101,102,108, 97,103,115, 0,
+103,108,111, 98, 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,
+110,114, 0,100,111,110,101, 0, 42,115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42,110,101,119,115,
+101,113, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110,
+100,115,116,105,108,108, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112,
+ 0,109,117,108, 0,104, 97,110,100,115,105,122,101, 0, 42,115,116,114,105,112, 0, 42, 99,117,114,101,108,101,109, 0,102, 97,
+ 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98,
+ 97,115,101, 0, 42,115,111,117,110,100, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,116,114,111,
+ 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113,
+ 0, 42,115,101,113, 98, 97,115,101,112, 0,109,101,116, 97,115,116, 97, 99,107, 0,101,100,103,101, 87,105,100,116,104, 0, 97,
+110,103,108,101, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,
+109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112,
+ 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,101,110,100, 0,116,111,116,112, 97,114,116,
+ 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,
+110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,100,101,102,118,101, 99, 91,
+ 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91,
+ 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,
+116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50, 0,102,108, 97,103, 50,110,101,
+103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,
+111,117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0,
+ 42,105,100, 0,117,115,101,100,101,108,101,109, 0,100,120, 0,100,121, 0,108,105,110,107, 0,111,116,121,112,101, 0,100, 97,
+116, 97, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116,100,105,115,116, 0,
+108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,101,
+116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97,108,117,101, 91, 51,
+ 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93,
+ 0,100, 97,109,112,116,105,109,101,114, 0,100,101,108, 97,121, 0,112,114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97,
+116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,
+117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,
+111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,105,110,118,101,114,116, 0,102,114,101,113, 50, 0, 97,120,105,
+115,102, 0, 98,117,116,116,111,110, 0, 98,117,116,116,111,110,102, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,
+115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,
+108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108, 0,118, 97,108,111, 0,116,105,109,101, 0, 42, 97, 99,
+116, 0, 98,108,101,110,100,105,110, 0,112,114,105,111,114,105,116,121, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0,
+115,116,114,105,100,101, 97,120,105,115, 0,114,101,115,101,114,118,101,100, 51, 0,115,110,100,110,114, 0,109, 97,107,101, 99,
+111,112,121, 0, 99,111,112,121,109, 97,100,101, 0,112, 97,100, 91, 49, 93, 0,116,114, 97, 99,107, 0,118,111,108,117,109,101,
+ 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,102,111,
+114, 99,101,108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111,
+ 99,105,116,121, 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,100,100,101,100,
+108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,111,116,104,101,114,112, 97,100, 91, 52, 93, 0,
+ 98,117,116,115,116, 97, 0, 98,117,116,101,110,100, 0,109,105,110, 0,102, 97, 99, 0,118,105,115,105,102, 97, 99, 0,115,108,
+111,119, 0,109,105,110,108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93,
+ 0,109, 97,120,114,111,116, 91, 51, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,103, 95,
+ 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95, 97,114,
+103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,111,100,
+121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101, 91, 54,
+ 52, 93, 0,103,111, 0, 97, 99, 99,101,108,108,101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120,
+114,111,116,115,112,101,101,100, 0,109, 97,120,116,105,108,116,115,112,101,101,100, 0,114,111,116,100, 97,109,112, 0,116,105,
+108,116,100, 97,109,112, 0,115,112,101,101,100,100, 97,109,112, 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109,
+ 0, 42,110,101,119,112, 97, 99,107,101,100,102,105,108,101, 0, 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105,
+110,103, 0, 97,116,116,101,110,117, 97,116,105,111,110, 0,112,105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,
+120, 95,103, 97,105,110, 0,100,105,115,116, 97,110, 99,101, 0,115,116,114,101, 97,109,108,101,110, 0,108,111,111,112,115,116,
+ 97,114,116, 0,108,111,111,112,101,110,100, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,112,114,105,111, 0,112, 97,
+100, 91, 49, 48, 93, 0,103, 97,105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,100,111,112,112,108,101,114,
+118,101,108,111, 99,105,116,121, 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114, 0,110,117,109,115,111,117,
+110,100,115,103, 97,109,101,101,110,103,105,110,101, 0, 42,103,107,101,121, 0,112, 97,100,102, 0,111,107,101,121, 0,103,111,
+ 98,106,101, 99,116, 0,103,107,101,121, 0, 42, 97, 99,116,105,118,101, 0, 99,104,105,108,100, 98, 97,115,101, 0,114,111,108,
+108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91, 51, 93, 91, 51, 93,
+ 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116,
+ 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50,
+ 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108, 0, 98,111,110,101, 99,108, 97,115,115, 0, 98,111,110,
+101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122,
+101, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0,
+105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91,
+ 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,
+111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120,
+ 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 99,104, 97,110, 98,
+ 97,115,101, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97, 99,116,110,114, 0,116,105,109,101,115,
+108,105,100,101, 0,110, 97,109,101, 91, 51, 48, 93, 0,101,110,102,111,114, 99,101, 0, 42,116, 97,114, 0,105,116,101,114, 97,
+116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,111,114,105,
+101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,109,105,110,109, 97,120,102,108,
+ 97,103, 0,115,116,105, 99,107,121, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99, 97,108, 0,108,
+111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,111,102,102,115,101,116, 91, 51, 93, 0,122,109, 97,
+120, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,
+115,116,114,105,100,101, 95, 97,120,105,115, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0,115,116,114,105,
+100,101,108,101,110, 0,114,101,112,101, 97,116, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,
+110,101,108, 91, 51, 50, 93, 0, 84, 89, 80, 69,219, 0, 0, 0, 99,104, 97,114, 0,117, 99,104, 97,114, 0,115,104,111,114,116,
+ 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,110,103, 0,102,108,111, 97,116, 0,100,111,117,
+ 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,115,116, 66, 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99,
+ 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118,101, 99, 51,105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100,
+ 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, 52,100, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 0,
+ 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,
+121, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,116, 76,105,110,101, 0, 84,101,120,116, 0, 80, 97, 99,107,101,
+100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101, 0, 97,110,105,109, 0, 73,109, 66,117,102, 0, 77, 84,
+101,120, 0, 79, 98,106,101, 99,116, 0, 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,
+111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 76, 97,109,112, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105,
+ 97,108, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110,
+100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 66,101,122, 84,114,105,112,108,101, 0, 66, 80,111,105,110,116, 0, 78,
+117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116, 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0,
+ 73,112,111, 68,114,105,118,101,114, 0, 73,112,111, 67,117,114,118,101, 0, 84, 70, 97, 99,101, 0, 77,101,115,104, 0, 77, 70,
+ 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108,
+ 0, 77, 83,116,105, 99,107,121, 0, 79, 99, 73,110,102,111, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77,111,
+100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76,
+ 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114,
+ 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100,
+105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87,
+ 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114,
+ 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111,
+100,105,102,105,101,114, 68, 97,116, 97, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76,
+ 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 76, 66,117,102, 0, 98, 65, 99,116,105,111,110,
+ 0, 98, 80,111,115,101, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 76,105,102,101,
+ 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 68,101,114,105,118,101,100, 77,101,115,104, 0, 79, 98,
+ 72,111,111,107, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105,
+110,103, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97,
+ 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 82,101,
+110,100,101,114, 68, 97,116, 97, 0, 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0,
+ 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 83, 99,101,110,101, 0, 71,114,111,117,112, 0, 68, 97,103, 70,111,114,101,
+115,116, 0, 66, 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 83, 99,114, 65,114,101,
+ 97, 0, 86,105,101,119, 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 83,112, 97, 99,
+101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0,100,105,114,101,110,116,114,
+121, 0, 66,108,101,110,100, 72, 97,110,100,108,101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,
+101, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0,
+ 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,112, 97,
+ 99,101, 73,109, 97, 83,101,108, 0, 73,109, 97, 68,105,114, 0, 79,110,101, 83,101,108,101, 99,116, 97, 98,108,101, 73,109, 97,
+ 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100,
+ 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,
+114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109,
+ 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100,
+ 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 69,100,105,116,105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119,
+ 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,
+116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 84,114,101,101, 83,116,111,114,101, 69,108,101,109, 0, 79,111,112,115,
+ 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,
+115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114,
+ 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,
+114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,
+121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98,
+ 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,
+101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114,
+ 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,
+116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98,
+ 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,
+114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,
+116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114,
+ 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,
+116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117,
+ 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,
+116,117, 97,116,111,114, 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100,
+ 76,105,115,116,101,110,101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 75,101,121, 0, 79, 98,106,
+101, 99,116, 75,101,121, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109, 97,116,117,114,
+101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 83,112,
+ 97, 99,101, 65, 99,116,105,111,110, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,
+110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,
+114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111,110,115,
+116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 77,105,
+110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116,
+ 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,
+104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68,105,115,116, 97,110, 99,101, 76,105,109,105,116, 67,111,110,115,116,114,
+ 97,105,110,116, 0, 98, 82,111,116, 97,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101,116, 99,
+104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 83,116,114,105,112, 0, 0, 84, 76, 69, 78,
+ 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 8, 0, 8, 0, 4, 0, 8, 0, 8, 0, 16, 0,
+ 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 48, 0,224, 0, 0, 0, 80, 0,104, 0,116, 0, 16, 0, 24, 0,
+100, 0, 20, 0,116, 0, 48, 1, 0, 0, 0, 0, 88, 0,244, 2,228, 0, 80, 1, 24, 0,136, 1,128, 0,252, 0, 52, 0,156, 1,
+ 64, 1, 0, 0,108, 0, 96, 0,132, 0, 56, 0, 28, 0, 56, 0, 8, 0, 16, 0, 44, 1, 0, 0,140, 0, 84, 0, 60, 0,188, 0,
+ 20, 0, 20, 0, 12, 0, 12, 0, 4, 0, 8, 0, 24, 0, 8, 0, 52, 0, 68, 0, 88, 0, 88, 0, 68, 0, 60, 0, 60, 0, 92, 0,
+ 64, 0,180, 0, 52, 0, 64, 0,108, 0, 40, 0, 12, 0, 56, 0, 24, 0, 44, 0, 92, 0, 0, 0, 84, 1, 0, 0,208, 0, 16, 0,
+ 0, 0, 0, 0, 32, 1, 40, 0, 28, 0,176, 0,144, 0, 16, 0, 16, 3, 16, 0, 80, 0, 28, 0,244, 3, 68, 0, 0, 0, 36, 0,
+180, 2, 36, 0,204, 0,120, 0, 36, 0, 40, 1,212, 0,164, 0, 84, 1, 0, 0, 0, 0,196, 0, 12, 0,184, 0,164, 0,120, 0,
+ 32, 0, 0, 0,148, 0,224, 2, 0, 0, 0, 0, 72, 0,136, 0,224, 7, 56, 0,168, 7,116, 0, 20, 0, 24, 0,164, 0, 24, 0,
+104, 0,188, 0,160, 1,172, 0, 32, 1, 16, 0, 28, 0, 12, 0, 24, 0, 16, 0, 24, 0,236, 0, 0, 0, 56, 0, 12, 0, 44, 0,
+ 64, 0, 48, 0, 8, 0, 44, 0, 72, 0,104, 0, 72, 0, 44, 0, 40, 0,108, 0, 68, 0, 76, 0, 80, 0, 64, 0,128, 0, 4, 0,
+ 60, 0, 12, 0, 60, 0, 20, 0, 16, 0, 64, 0, 16, 0, 76, 0,120, 0, 48, 0, 28, 0, 56, 0, 52, 0, 56, 0,108, 0,136, 0,
+ 4, 0, 40, 0, 0, 0, 64, 0,160, 0, 48, 0,112, 1, 20, 0, 4, 1, 80, 0, 68, 1, 60, 0,176, 0, 44, 0, 52, 0, 76, 0,
+ 44, 0, 44, 0, 44, 0, 60, 0, 56, 0, 44, 0, 20, 0, 60, 0, 24, 0, 52, 0, 88, 0, 0, 0, 83, 84, 82, 67,192, 0, 0, 0,
+ 10, 0, 2, 0, 10, 0, 0, 0, 10, 0, 1, 0, 11, 0, 2, 0, 9, 0, 2, 0, 9, 0, 3, 0, 12, 0, 2, 0, 2, 0, 4, 0,
+ 2, 0, 5, 0, 13, 0, 2, 0, 4, 0, 4, 0, 4, 0, 5, 0, 14, 0, 2, 0, 7, 0, 4, 0, 7, 0, 5, 0, 15, 0, 2, 0,
+ 8, 0, 4, 0, 8, 0, 5, 0, 16, 0, 3, 0, 4, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 17, 0, 3, 0, 7, 0, 4, 0,
+ 7, 0, 5, 0, 7, 0, 6, 0, 18, 0, 3, 0, 8, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 19, 0, 4, 0, 4, 0, 4, 0,
+ 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 20, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0,
+ 21, 0, 4, 0, 8, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 22, 0, 4, 0, 4, 0, 8, 0, 4, 0, 9, 0,
+ 4, 0, 10, 0, 4, 0, 11, 0, 23, 0, 4, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 24, 0, 8, 0,
+ 9, 0, 0, 0, 9, 0, 1, 0, 24, 0, 12, 0, 25, 0, 13, 0, 0, 0, 14, 0, 2, 0, 15, 0, 2, 0, 16, 0, 4, 0, 17, 0,
+ 25, 0, 6, 0, 24, 0, 18, 0, 24, 0, 19, 0, 26, 0, 20, 0, 0, 0, 21, 0, 4, 0, 22, 0, 4, 0, 17, 0, 27, 0, 6, 0,
+ 24, 0, 18, 0, 11, 0, 23, 0, 23, 0, 24, 0, 2, 0, 25, 0, 2, 0, 26, 0, 4, 0, 17, 0, 28, 0, 13, 0, 28, 0, 0, 0,
+ 28, 0, 1, 0, 7, 0, 27, 0, 7, 0, 28, 0, 2, 0, 29, 0, 2, 0, 30, 0, 4, 0, 31, 0, 9, 0, 32, 0, 7, 0, 33, 0,
+ 0, 0, 34, 0, 0, 0, 35, 0, 7, 0, 36, 0, 7, 0, 37, 0, 29, 0, 12, 0, 24, 0, 18, 0, 28, 0, 38, 0, 0, 0, 39, 0,
+ 4, 0, 40, 0, 7, 0, 28, 0, 11, 0, 41, 0, 27, 0, 42, 0, 24, 0, 43, 0, 2, 0, 29, 0, 2, 0, 44, 0, 2, 0, 45, 0,
+ 2, 0, 16, 0, 30, 0, 5, 0, 24, 0, 46, 0, 2, 0, 47, 0, 2, 0, 48, 0, 2, 0, 49, 0, 4, 0, 17, 0, 31, 0, 6, 0,
+ 31, 0, 0, 0, 31, 0, 1, 0, 0, 0, 50, 0, 0, 0, 51, 0, 4, 0, 52, 0, 4, 0, 53, 0, 32, 0, 13, 0, 24, 0, 18, 0,
+ 0, 0, 54, 0, 4, 0, 55, 0, 4, 0, 56, 0, 11, 0, 57, 0, 31, 0, 58, 0, 31, 0, 59, 0, 4, 0, 60, 0, 4, 0, 61, 0,
+ 0, 0, 62, 0, 4, 0, 63, 0, 4, 0, 64, 0, 9, 0, 65, 0, 33, 0, 5, 0, 4, 0, 66, 0, 4, 0, 67, 0, 4, 0, 55, 0,
+ 4, 0, 17, 0, 9, 0, 32, 0, 34, 0, 17, 0, 24, 0, 18, 0, 2, 0, 29, 0, 2, 0, 16, 0, 7, 0, 68, 0, 7, 0, 69, 0,
+ 7, 0, 70, 0, 7, 0, 71, 0, 7, 0, 72, 0, 7, 0, 73, 0, 7, 0, 74, 0, 7, 0, 75, 0, 7, 0, 76, 0, 2, 0, 77, 0,
+ 2, 0, 78, 0, 7, 0, 79, 0, 27, 0, 42, 0, 30, 0, 80, 0, 35, 0, 23, 0, 24, 0, 18, 0, 0, 0, 21, 0, 36, 0, 81, 0,
+ 37, 0, 82, 0, 37, 0, 83, 0, 2, 0, 84, 0, 2, 0, 16, 0, 2, 0, 85, 0, 2, 0, 86, 0, 2, 0, 87, 0, 2, 0, 88, 0,
+ 2, 0, 89, 0, 2, 0, 90, 0, 2, 0, 91, 0, 2, 0, 92, 0, 4, 0, 93, 0, 4, 0, 94, 0, 33, 0, 95, 0, 7, 0, 96, 0,
+ 4, 0, 97, 0, 2, 0, 98, 0, 2, 0, 99, 0, 4, 0,100, 0, 38, 0, 24, 0, 2, 0,101, 0, 2, 0,102, 0, 2, 0,103, 0,
+ 2, 0,104, 0, 39, 0,105, 0, 40, 0,106, 0, 0, 0,107, 0, 0, 0,108, 0, 0, 0,109, 0, 0, 0,110, 0, 7, 0,111, 0,
+ 7, 0,112, 0, 2, 0,113, 0, 2, 0,114, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, 0,
+ 7, 0,120, 0, 7, 0,121, 0, 7, 0,122, 0, 7, 0,123, 0, 7, 0,124, 0, 41, 0, 14, 0, 0, 0, 21, 0, 9, 0,125, 0,
+ 0, 0,126, 0, 0, 0,127, 0, 4, 0,128, 0, 4, 0,129, 0, 9, 0,130, 0, 7, 0,131, 0, 7, 0,132, 0, 7, 0,133, 0,
+ 4, 0,134, 0, 9, 0,135, 0, 4, 0,136, 0, 4, 0, 17, 0, 42, 0, 6, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0,
+ 7, 0,137, 0, 7, 0, 27, 0, 4, 0, 24, 0, 43, 0, 5, 0, 2, 0, 16, 0, 2, 0, 22, 0, 2, 0, 24, 0, 2, 0,138, 0,
+ 42, 0,139, 0, 44, 0, 16, 0, 39, 0,105, 0, 35, 0,140, 0, 35, 0,141, 0, 7, 0,142, 0, 2, 0, 29, 0, 2, 0,143, 0,
+ 7, 0, 70, 0, 7, 0, 71, 0, 4, 0,144, 0, 2, 0,145, 0, 2, 0,146, 0, 2, 0, 84, 0, 2, 0, 85, 0, 2, 0,147, 0,
+ 2, 0,148, 0, 4, 0, 69, 0, 40, 0, 52, 0, 24, 0, 18, 0, 7, 0,149, 0, 7, 0,150, 0, 7, 0,151, 0, 7, 0,152, 0,
+ 7, 0,153, 0, 7, 0,154, 0, 7, 0,155, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0,
+ 7, 0,161, 0, 7, 0,162, 0, 7, 0,163, 0, 7, 0,164, 0, 7, 0,165, 0, 7, 0,166, 0, 7, 0,167, 0, 7, 0,168, 0,
+ 2, 0,169, 0, 2, 0,170, 0, 2, 0,171, 0, 2, 0,172, 0, 2, 0,173, 0, 2, 0,174, 0, 2, 0,175, 0, 2, 0, 16, 0,
+ 2, 0, 29, 0, 2, 0,143, 0, 7, 0,176, 0, 7, 0,177, 0, 7, 0,178, 0, 7, 0,179, 0, 2, 0,180, 0, 2, 0,181, 0,
+ 2, 0,182, 0, 2, 0, 52, 0, 7, 0,183, 0, 7, 0,184, 0, 2, 0,185, 0, 2, 0,186, 0, 2, 0,187, 0, 2, 0,188, 0,
+ 7, 0,121, 0, 27, 0, 42, 0, 35, 0,140, 0, 41, 0,189, 0, 43, 0,190, 0, 44, 0,191, 0, 2, 0,192, 0, 45, 0, 50, 0,
+ 24, 0, 18, 0, 2, 0, 29, 0, 2, 0,193, 0, 2, 0,114, 0, 2, 0,194, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0,
+ 7, 0,118, 0, 7, 0,195, 0, 7, 0,196, 0, 7, 0,197, 0, 7, 0,198, 0, 7, 0,199, 0, 7, 0,200, 0, 7, 0,201, 0,
+ 2, 0,202, 0, 2, 0,203, 0, 7, 0, 70, 0, 7, 0, 71, 0, 7, 0,204, 0, 7, 0,205, 0, 7, 0,206, 0, 2, 0,207, 0,
+ 2, 0,208, 0, 2, 0,209, 0, 2, 0,210, 0, 2, 0,211, 0, 2, 0, 17, 0, 7, 0,212, 0, 7, 0,213, 0, 7, 0,214, 0,
+ 2, 0,215, 0, 2, 0,216, 0, 4, 0,217, 0, 4, 0,218, 0, 2, 0,219, 0, 2, 0,220, 0, 2, 0,221, 0, 2, 0,222, 0,
+ 7, 0,223, 0, 7, 0,224, 0, 7, 0,225, 0, 7, 0,226, 0, 7, 0,227, 0, 2, 0,228, 0, 2, 0,229, 0, 38, 0,230, 0,
+ 27, 0, 42, 0, 30, 0, 80, 0, 46, 0, 2, 0, 24, 0, 18, 0, 27, 0, 42, 0, 47, 0, 95, 0, 24, 0, 18, 0, 2, 0,114, 0,
+ 2, 0,231, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,232, 0, 7, 0,233, 0, 7, 0,234, 0, 7, 0,235, 0,
+ 7, 0,236, 0, 7, 0,237, 0, 7, 0,238, 0, 7, 0,239, 0, 7, 0,240, 0, 7, 0,241, 0, 7, 0,242, 0, 7, 0,243, 0,
+ 7, 0,244, 0, 7, 0,245, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248, 0, 7, 0,249, 0, 7, 0,250, 0, 7, 0,251, 0,
+ 7, 0,252, 0, 7, 0,253, 0, 7, 0,254, 0, 7, 0,255, 0, 7, 0, 0, 1, 2, 0, 1, 1, 2, 0, 2, 1, 2, 0, 3, 1,
+ 0, 0, 4, 1, 0, 0, 5, 1, 4, 0,193, 0, 4, 0, 6, 1, 2, 0, 7, 1, 2, 0, 8, 1, 2, 0, 9, 1, 2, 0, 10, 1,
+ 7, 0, 11, 1, 7, 0, 12, 1, 7, 0, 13, 1, 7, 0, 14, 1, 7, 0, 15, 1, 7, 0, 16, 1, 7, 0, 17, 1, 0, 0, 18, 1,
+ 0, 0,215, 0, 0, 0, 19, 1, 0, 0, 17, 0, 2, 0, 20, 1, 2, 0, 21, 1, 2, 0, 22, 1, 2, 0, 23, 1, 4, 0, 24, 1,
+ 2, 0, 25, 1, 2, 0, 26, 1, 7, 0, 27, 1, 7, 0, 28, 1, 7, 0, 29, 1, 7, 0, 30, 1, 7, 0, 31, 1, 2, 0,101, 0,
+ 2, 0,102, 0, 43, 0, 32, 1, 43, 0, 33, 1, 0, 0, 34, 1, 0, 0, 35, 1, 0, 0, 36, 1, 0, 0, 37, 1, 2, 0, 38, 1,
+ 2, 0, 39, 1, 7, 0, 40, 1, 7, 0, 41, 1, 38, 0,230, 0, 27, 0, 42, 0, 7, 0, 42, 1, 7, 0, 43, 1, 7, 0, 44, 1,
+ 7, 0, 45, 1, 7, 0, 46, 1, 2, 0, 47, 1, 2, 0, 48, 1, 7, 0, 49, 1, 7, 0, 50, 1, 7, 0, 51, 1, 7, 0, 52, 1,
+ 7, 0, 53, 1, 4, 0, 54, 1, 4, 0, 55, 1, 4, 0, 56, 1, 30, 0, 80, 0, 48, 0, 6, 0, 24, 0, 18, 0, 0, 0, 57, 1,
+ 7, 0, 58, 1, 7, 0, 17, 0, 49, 0, 32, 0, 33, 0, 95, 0, 50, 0, 26, 0, 50, 0, 0, 0, 50, 0, 1, 0, 51, 0, 59, 1,
+ 4, 0, 60, 1, 4, 0, 61, 1, 4, 0, 62, 1, 4, 0, 63, 1, 4, 0, 64, 1, 4, 0, 65, 1, 2, 0, 29, 0, 2, 0, 16, 0,
+ 2, 0, 66, 1, 2, 0, 67, 1, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 68, 1, 7, 0, 69, 1, 7, 0, 70, 1,
+ 7, 0, 71, 1, 7, 0, 72, 1, 7, 0, 73, 1, 7, 0, 74, 1, 7, 0, 52, 0, 7, 0, 75, 1, 7, 0, 76, 1, 52, 0, 15, 0,
+ 24, 0, 18, 0, 51, 0, 59, 1, 11, 0, 77, 1, 11, 0, 78, 1, 27, 0, 42, 0, 47, 0, 79, 1, 2, 0, 16, 0, 2, 0, 80, 1,
+ 4, 0,113, 0, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1, 7, 0, 83, 1, 7, 0, 84, 1, 7, 0, 85, 1, 53, 0, 10, 0,
+ 7, 0, 86, 1, 7, 0, 87, 1, 7, 0, 88, 1, 7, 0, 17, 0, 2, 0, 89, 1, 2, 0, 90, 1, 0, 0, 91, 1, 0, 0, 92, 1,
+ 0, 0, 93, 1, 0, 0, 94, 1, 54, 0, 5, 0, 7, 0, 95, 1, 7, 0, 87, 1, 7, 0, 88, 1, 2, 0, 91, 1, 2, 0, 94, 1,
+ 55, 0, 20, 0, 55, 0, 0, 0, 55, 0, 1, 0, 2, 0, 29, 0, 2, 0, 96, 1, 2, 0, 94, 1, 2, 0, 16, 0, 2, 0, 97, 1,
+ 2, 0, 98, 1, 2, 0, 99, 1, 2, 0,100, 1, 2, 0,101, 1, 2, 0,102, 1, 2, 0,103, 1, 2, 0,104, 1, 7, 0,105, 1,
+ 7, 0,106, 1, 54, 0,107, 1, 53, 0,108, 1, 4, 0,109, 1, 4, 0, 17, 0, 56, 0, 5, 0, 2, 0,110, 1, 2, 0, 96, 1,
+ 0, 0, 16, 0, 0, 0, 17, 0, 2, 0, 48, 1, 57, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 7, 0, 7, 0,111, 1,
+ 58, 0, 54, 0, 24, 0, 18, 0, 51, 0, 59, 1, 11, 0,112, 1, 11, 0, 78, 1, 39, 0,113, 1, 39, 0,114, 1, 39, 0,115, 1,
+ 27, 0, 42, 0, 59, 0,116, 1, 29, 0,117, 1, 47, 0, 79, 1, 11, 0,118, 1, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1,
+ 4, 0,113, 0, 2, 0,119, 1, 2, 0, 80, 1, 2, 0, 16, 0, 2, 0,120, 1, 7, 0,121, 1, 7, 0,122, 1, 7, 0,123, 1,
+ 2, 0, 99, 1, 2, 0,100, 1, 2, 0, 52, 0, 2, 0, 57, 0, 2, 0, 27, 0, 2, 0,124, 1, 7, 0,125, 1, 7, 0,126, 1,
+ 7, 0,127, 1, 7, 0,128, 1, 7, 0,129, 1, 7, 0,130, 1, 7, 0,131, 1, 7, 0,132, 1, 7, 0,133, 1, 7, 0,134, 1,
+ 0, 0,135, 1, 0, 0,136, 1, 48, 0,137, 1, 48, 0,138, 1, 48, 0,139, 1, 48, 0,140, 1, 4, 0,141, 1, 4, 0,142, 1,
+ 4, 0,143, 1, 4, 0, 17, 0, 57, 0,144, 1, 4, 0,145, 1, 4, 0,146, 1, 56, 0,147, 1, 56, 0,148, 1, 60, 0, 6, 0,
+ 39, 0,149, 1, 2, 0, 25, 0, 2, 0, 30, 0, 2, 0, 29, 0, 2, 0, 16, 0, 0, 0,150, 1, 61, 0, 19, 0, 61, 0, 0, 0,
+ 61, 0, 1, 0, 54, 0,107, 1, 53, 0,108, 1, 23, 0,151, 1, 23, 0,152, 1, 2, 0, 25, 0, 2, 0, 30, 0, 2, 0,153, 1,
+ 2, 0,154, 1, 2, 0,155, 1, 2, 0,156, 1, 2, 0, 16, 0, 2, 0,157, 1, 7, 0, 10, 0, 7, 0, 11, 0, 4, 0,158, 1,
+ 7, 0, 28, 0, 60, 0,159, 1, 62, 0, 8, 0, 9, 0,160, 1, 7, 0,161, 1, 4, 0,162, 1, 0, 0, 16, 0, 0, 0,163, 1,
+ 2, 0,193, 0, 2, 0,164, 1, 2, 0,165, 1, 63, 0, 32, 0, 24, 0, 18, 0, 51, 0, 59, 1, 11, 0,166, 1, 27, 0, 42, 0,
+ 29, 0,117, 1, 47, 0, 79, 1, 64, 0,167, 1, 62, 0,168, 1, 9, 0,169, 1, 65, 0,170, 1, 66, 0,171, 1, 67, 0,172, 1,
+ 68, 0,173, 1, 69, 0,174, 1, 63, 0,175, 1, 70, 0,176, 1, 9, 0,177, 1, 4, 0,154, 1, 4, 0,178, 1, 4, 0,179, 1,
+ 4, 0,113, 0, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1, 7, 0,180, 1, 7, 0, 17, 0, 2, 0,181, 1, 2, 0, 16, 0,
+ 2, 0,182, 1, 2, 0,183, 1, 2, 0, 80, 1, 2, 0,184, 1, 64, 0, 8, 0, 4, 0,185, 1, 4, 0,186, 1, 4, 0,187, 1,
+ 4, 0,188, 1, 0, 0, 17, 0, 0, 0, 96, 1, 0, 0,189, 1, 0, 0, 16, 0, 66, 0, 5, 0, 4, 0,185, 1, 4, 0,186, 1,
+ 0, 0,190, 1, 0, 0, 17, 0, 2, 0, 16, 0, 71, 0, 2, 0, 4, 0,191, 1, 7, 0, 88, 1, 67, 0, 3, 0, 71, 0,192, 1,
+ 4, 0,193, 1, 4, 0, 16, 0, 65, 0, 4, 0, 7, 0,194, 1, 2, 0,195, 1, 0, 0, 16, 0, 0, 0, 96, 1, 68, 0, 4, 0,
+ 0, 0,137, 0, 0, 0,115, 0, 0, 0,116, 0, 0, 0,117, 0, 69, 0, 1, 0, 7, 0,196, 1, 72, 0, 6, 0, 72, 0, 0, 0,
+ 72, 0, 1, 0, 4, 0, 29, 0, 4, 0,193, 0, 0, 0, 34, 0, 0, 0,197, 1, 73, 0, 7, 0, 72, 0,198, 1, 2, 0,199, 1,
+ 2, 0,200, 1, 2, 0,201, 1, 2, 0, 55, 0, 9, 0,202, 1, 9, 0,203, 1, 74, 0, 3, 0, 72, 0,198, 1, 39, 0,105, 0,
+ 0, 0, 34, 0, 75, 0, 3, 0, 72, 0,198, 1, 39, 0,105, 0, 0, 0, 34, 0, 76, 0, 5, 0, 72, 0,198, 1, 7, 0,204, 1,
+ 7, 0,205, 1, 4, 0,206, 1, 4, 0,207, 1, 77, 0, 4, 0, 72, 0,198, 1, 2, 0,208, 1, 2, 0, 16, 0, 7, 0,209, 1,
+ 78, 0, 3, 0, 72, 0,198, 1, 7, 0,210, 1, 4, 0,211, 1, 79, 0, 12, 0, 72, 0,198, 1, 2, 0, 16, 0, 2, 0, 17, 0,
+ 7, 0,212, 1, 7, 0,213, 1, 7, 0,214, 1, 7, 0,121, 1, 7, 0,215, 1, 7, 0,216, 1, 7, 0,217, 1, 7, 0,218, 1,
+ 7, 0,219, 1, 80, 0, 5, 0, 72, 0,198, 1, 2, 0,220, 1, 2, 0, 69, 0, 4, 0, 48, 1, 39, 0,105, 0, 81, 0, 9, 0,
+ 72, 0,198, 1, 39, 0,105, 0, 7, 0,221, 1, 7, 0,222, 1, 7, 0,223, 1, 4, 0,224, 1, 4, 0,225, 1, 7, 0,226, 1,
+ 0, 0, 34, 0, 82, 0, 1, 0, 72, 0,198, 1, 83, 0, 4, 0, 72, 0,198, 1, 39, 0,105, 0, 4, 0,227, 1, 4, 0, 17, 0,
+ 84, 0, 23, 0, 24, 0, 18, 0, 2, 0, 97, 1, 2, 0, 98, 1, 2, 0,228, 1, 2, 0, 16, 0, 2, 0,229, 1, 2, 0,230, 1,
+ 2, 0,231, 1, 2, 0, 48, 1, 0, 0,232, 1, 0, 0,233, 1, 0, 0,234, 1, 0, 0, 29, 0, 4, 0, 17, 0, 7, 0,235, 1,
+ 7, 0,236, 1, 7, 0,237, 1, 7, 0,238, 1, 7, 0,239, 1, 7, 0,240, 1, 54, 0,241, 1, 27, 0, 42, 0, 29, 0,117, 1,
+ 85, 0, 3, 0, 85, 0, 0, 0, 85, 0, 1, 0, 0, 0, 34, 0, 51, 0, 1, 0, 7, 0,242, 1, 70, 0, 2, 0, 7, 0,243, 1,
+ 7, 0,112, 0, 86, 0, 4, 0, 2, 0, 22, 0, 2, 0,244, 1, 4, 0, 17, 0, 39, 0,245, 1, 39, 0, 95, 0, 24, 0, 18, 0,
+ 2, 0, 29, 0, 2, 0,246, 1, 4, 0,247, 1, 4, 0,248, 1, 4, 0,249, 1, 0, 0,250, 1, 9, 0,251, 1, 39, 0,252, 1,
+ 39, 0,253, 1, 27, 0, 42, 0, 59, 0,116, 1, 51, 0, 59, 1, 87, 0,254, 1, 88, 0,255, 1, 9, 0, 32, 0, 11, 0, 0, 2,
+ 11, 0,166, 1, 11, 0, 1, 2, 11, 0, 78, 1, 11, 0, 2, 2, 11, 0, 3, 2, 47, 0, 79, 1, 7, 0, 81, 1, 7, 0, 4, 2,
+ 7, 0, 5, 2, 7, 0,112, 0, 7, 0, 6, 2, 7, 0, 82, 1, 7, 0, 7, 2, 7, 0, 68, 1, 7, 0, 8, 2, 7, 0, 9, 2,
+ 7, 0,221, 1, 7, 0,142, 0, 4, 0,231, 0, 2, 0, 16, 0, 2, 0, 10, 2, 2, 0, 11, 2, 2, 0, 12, 2, 2, 0, 13, 2,
+ 2, 0, 14, 2, 2, 0, 15, 2, 2, 0, 16, 2, 2, 0, 17, 2, 2, 0, 18, 2, 2, 0, 19, 2, 2, 0, 20, 2, 2, 0, 21, 2,
+ 2, 0, 22, 2, 2, 0, 23, 2, 2, 0, 24, 2, 7, 0, 25, 2, 7, 0, 26, 2, 7, 0, 27, 2, 7, 0, 28, 2, 7, 0, 29, 2,
+ 7, 0, 30, 2, 7, 0, 31, 2, 7, 0, 32, 2, 7, 0, 33, 2, 0, 0, 34, 2, 0, 0, 35, 2, 0, 0, 80, 1, 0, 0, 36, 2,
+ 30, 0, 80, 0, 11, 0, 37, 2, 11, 0, 38, 2, 11, 0, 39, 2, 11, 0, 40, 2, 9, 0,177, 1, 7, 0, 41, 2, 2, 0, 42, 2,
+ 2, 0, 43, 2, 7, 0,162, 1, 4, 0, 44, 2, 4, 0, 45, 2, 2, 0, 46, 2, 2, 0,147, 0, 7, 0, 47, 2, 11, 0, 48, 2,
+ 11, 0, 49, 2, 11, 0, 50, 2, 89, 0, 51, 2, 90, 0, 52, 2, 91, 0, 53, 2, 86, 0, 54, 2, 86, 0, 55, 2, 2, 0, 56, 2,
+ 0, 0, 57, 2, 0, 0, 58, 2, 7, 0,181, 1, 92, 0, 59, 2, 93, 0, 60, 2, 93, 0, 61, 2, 94, 0, 14, 0, 94, 0, 0, 0,
+ 94, 0, 1, 0, 39, 0,252, 1, 7, 0,221, 1, 7, 0, 62, 2, 7, 0,222, 1, 7, 0,223, 1, 0, 0, 34, 0, 4, 0,224, 1,
+ 4, 0,225, 1, 4, 0, 63, 2, 2, 0, 29, 0, 2, 0, 64, 2, 7, 0,226, 1, 89, 0, 13, 0, 2, 0, 65, 2, 2, 0, 66, 2,
+ 2, 0, 16, 0, 2, 0, 17, 0, 7, 0, 67, 2, 7, 0, 68, 2, 7, 0, 69, 2, 7, 0, 70, 2, 7, 0, 71, 2, 7, 0, 72, 2,
+ 7, 0, 73, 2, 7, 0, 74, 2, 7, 0, 75, 2, 95, 0, 1, 0, 7, 0, 95, 1, 90, 0, 26, 0, 4, 0, 76, 2, 4, 0, 77, 2,
+ 96, 0, 78, 2, 97, 0, 79, 2, 7, 0, 26, 2, 7, 0, 80, 2, 7, 0, 81, 2, 7, 0, 82, 2, 7, 0, 83, 2, 7, 0, 84, 2,
+ 7, 0, 85, 2, 7, 0, 86, 2, 7, 0, 87, 2, 7, 0, 88, 2, 7, 0, 89, 2, 2, 0, 90, 2, 2, 0, 69, 0, 7, 0, 91, 2,
+ 7, 0, 92, 2, 2, 0,187, 0, 2, 0, 93, 2, 2, 0, 94, 2, 2, 0, 48, 1, 95, 0, 95, 2, 4, 0, 96, 2, 4, 0, 44, 0,
+ 92, 0, 26, 0, 2, 0, 29, 0, 2, 0, 97, 2, 2, 0, 98, 2, 2, 0, 99, 2, 7, 0,100, 2, 2, 0,101, 2, 2, 0,102, 2,
+ 7, 0,103, 2, 2, 0,104, 2, 2, 0,105, 2, 7, 0,106, 2, 7, 0,107, 2, 7, 0,108, 2, 7, 0,109, 2, 7, 0,110, 2,
+ 7, 0,111, 2, 4, 0,112, 2, 7, 0,113, 2, 7, 0,114, 2, 7, 0,115, 2, 63, 0,116, 2, 63, 0,117, 2, 63, 0,118, 2,
+ 0, 0,119, 2, 7, 0,120, 2, 7, 0,121, 2, 98, 0, 56, 0, 24, 0, 18, 0, 2, 0,114, 0, 2, 0,194, 0, 2, 0,215, 0,
+ 2, 0,122, 2, 7, 0,123, 2, 7, 0,124, 2, 7, 0,125, 2, 7, 0,126, 2, 7, 0,127, 2, 7, 0,128, 2, 7, 0,129, 2,
+ 7, 0,130, 2, 7, 0,238, 0, 7, 0,240, 0, 7, 0,239, 0, 7, 0,131, 2, 4, 0,132, 2, 7, 0,133, 2, 7, 0,134, 2,
+ 7, 0,135, 2, 7, 0,136, 2, 7, 0,137, 2, 7, 0,138, 2, 7, 0,139, 2, 2, 0,140, 2, 2, 0,193, 0, 4, 0,141, 2,
+ 7, 0,142, 2, 7, 0,143, 2, 7, 0,144, 2, 7, 0,145, 2, 7, 0,146, 2, 7, 0,147, 2, 7, 0,148, 2, 7, 0,149, 2,
+ 7, 0,150, 2, 7, 0,151, 2, 7, 0,152, 2, 7, 0,153, 2, 2, 0,154, 2, 2, 0,155, 2, 2, 0,156, 2, 2, 0,157, 2,
+ 7, 0,158, 2, 7, 0,159, 2, 7, 0,160, 2, 7, 0,161, 2, 2, 0,162, 2, 2, 0,163, 2, 2, 0,164, 2, 2, 0,165, 2,
+ 7, 0,166, 2, 27, 0, 42, 0, 38, 0,230, 0, 30, 0, 80, 0, 99, 0, 16, 0, 2, 0,167, 2, 2, 0,168, 2, 2, 0,169, 2,
+ 2, 0, 16, 0, 2, 0,170, 2, 2, 0,171, 2, 2, 0,172, 2, 2, 0,173, 2, 2, 0,174, 2, 2, 0,175, 2, 2, 0,176, 2,
+ 2, 0,177, 2, 4, 0,178, 2, 7, 0,179, 2, 7, 0,180, 2, 7, 0,181, 2,100, 0, 8, 0,100, 0, 0, 0,100, 0, 1, 0,
+ 4, 0,231, 0, 4, 0,182, 2, 4, 0, 16, 0, 2, 0,183, 2, 2, 0,184, 2, 39, 0,105, 0,101, 0, 13, 0, 9, 0,185, 2,
+ 9, 0,186, 2, 4, 0,187, 2, 4, 0,188, 2, 4, 0,189, 2, 4, 0,190, 2, 4, 0,191, 2, 4, 0,192, 2, 4, 0,193, 2,
+ 4, 0,194, 2, 4, 0,195, 2, 4, 0, 17, 0, 0, 0,196, 2,102, 0, 5, 0, 9, 0,197, 2, 9, 0,198, 2, 4, 0,199, 2,
+ 4, 0, 48, 1, 0, 0,200, 2,103, 0, 4, 0, 4, 0,201, 2, 7, 0,202, 2, 2, 0, 16, 0, 2, 0,203, 2,104, 0, 98, 0,
+101, 0,204, 2,102, 0,205, 2, 2, 0,206, 2, 2, 0,187, 0, 2, 0, 93, 2, 2, 0,207, 2, 2, 0,208, 2, 2, 0, 16, 0,
+ 7, 0, 26, 2, 7, 0,209, 2, 7, 0,210, 2, 7, 0,211, 2, 7, 0,212, 2, 7, 0,213, 2, 2, 0,214, 2, 2, 0,215, 2,
+ 2, 0,216, 2, 2, 0,217, 2, 2, 0,146, 0, 2, 0,218, 2, 2, 0,219, 2, 2, 0,220, 2, 2, 0,221, 2, 2, 0,222, 2,
+ 2, 0,223, 2, 2, 0, 17, 0, 2, 0, 66, 0, 2, 0,224, 2, 2, 0,225, 2, 2, 0,226, 2, 2, 0,227, 2, 2, 0,228, 2,
+ 2, 0,229, 2, 2, 0,230, 2, 23, 0,231, 2, 23, 0,232, 2, 2, 0,233, 2, 2, 0,234, 2, 2, 0,235, 2, 2, 0,236, 2,
+ 2, 0,237, 2, 2, 0,238, 2, 4, 0,193, 0, 2, 0,239, 2, 2, 0,240, 2, 2, 0,241, 2, 2, 0,242, 2, 2, 0,243, 2,
+ 2, 0,244, 2, 2, 0,245, 2, 2, 0,246, 2, 2, 0,247, 2, 7, 0,181, 2, 7, 0,248, 2, 7, 0,249, 2, 7, 0,250, 2,
+ 7, 0,251, 2, 7, 0,252, 2, 7, 0,253, 2, 7, 0,254, 2, 7, 0,255, 2, 7, 0, 0, 3, 7, 0, 1, 3, 7, 0, 2, 3,
+ 7, 0, 3, 3, 7, 0, 4, 3, 2, 0, 5, 3, 2, 0, 6, 3, 2, 0, 7, 3, 2, 0, 8, 3, 2, 0, 9, 3, 2, 0, 10, 3,
+ 2, 0, 11, 3, 2, 0, 12, 3, 2, 0, 13, 3, 2, 0, 14, 3, 4, 0, 15, 3, 4, 0, 16, 3, 4, 0, 17, 3, 4, 0, 18, 3,
+ 4, 0, 19, 3, 7, 0, 20, 3, 4, 0, 21, 3, 4, 0, 22, 3, 4, 0, 23, 3, 4, 0, 24, 3, 7, 0, 25, 3, 7, 0, 26, 3,
+ 7, 0, 27, 3, 7, 0, 28, 3, 7, 0, 29, 3, 7, 0, 30, 3, 7, 0, 31, 3, 7, 0, 32, 3, 7, 0, 33, 3, 0, 0, 34, 3,
+ 0, 0, 35, 3, 0, 0, 36, 3,105, 0, 5, 0, 7, 0, 37, 3, 0, 0, 29, 0, 0, 0, 69, 0, 0, 0, 48, 1, 0, 0, 39, 1,
+106, 0, 5, 0,106, 0, 0, 0,106, 0, 1, 0, 4, 0, 38, 3, 0, 0, 39, 3, 4, 0, 16, 0,107, 0, 13, 0, 2, 0, 40, 3,
+ 2, 0, 41, 3, 2, 0, 42, 3, 2, 0, 43, 3, 2, 0, 44, 3, 2, 0, 69, 0, 7, 0, 45, 3, 7, 0, 46, 3, 2, 0, 47, 3,
+ 2, 0, 48, 3, 2, 0, 49, 3, 0, 0, 48, 1, 0, 0, 39, 1,108, 0, 31, 0, 24, 0, 18, 0, 39, 0, 50, 3, 98, 0, 51, 3,
+108, 0, 52, 3, 35, 0,140, 0, 11, 0, 53, 3,100, 0, 54, 3,109, 0, 55, 3, 7, 0, 56, 3, 7, 0, 57, 3, 7, 0, 58, 3,
+ 7, 0, 59, 3, 4, 0,231, 0, 2, 0, 60, 3, 2, 0, 17, 0, 2, 0, 61, 3, 2, 0, 62, 3, 7, 0, 63, 3, 9, 0, 64, 3,
+ 99, 0, 65, 3, 9, 0,177, 1,105, 0, 66, 3,107, 0, 67, 3,104, 0,115, 0,103, 0, 68, 3, 30, 0, 80, 0, 11, 0, 69, 3,
+110, 0, 70, 3, 2, 0, 71, 3, 2, 0, 72, 3, 4, 0, 73, 3,111, 0, 10, 0, 35, 0,140, 0, 40, 0,106, 0, 7, 0,132, 1,
+ 7, 0,133, 1, 7, 0, 66, 0, 7, 0, 74, 3, 7, 0, 75, 3, 2, 0, 76, 3, 2, 0, 77, 3, 4, 0, 78, 3,112, 0, 53, 0,
+113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 7, 0, 83, 3, 7, 0, 84, 3,
+ 7, 0, 85, 3, 7, 0, 86, 3, 7, 0, 87, 3, 7, 0, 88, 3, 7, 0, 89, 3, 7, 0,196, 0, 2, 0, 90, 3, 2, 0, 91, 3,
+ 39, 0, 50, 3,111, 0, 92, 3,112, 0, 93, 3, 2, 0,169, 2, 2, 0, 94, 3, 4, 0,231, 0, 4, 0, 95, 3, 2, 0, 96, 3,
+ 2, 0, 97, 3, 2, 0, 98, 3, 2, 0, 16, 0, 7, 0, 72, 0, 7, 0, 99, 3, 7, 0,100, 3, 7, 0,101, 3, 7, 0,102, 3,
+ 7, 0,103, 3, 7, 0,111, 0, 7, 0, 56, 3, 2, 0,104, 3, 2, 0,105, 3, 2, 0,106, 3, 2, 0,107, 3, 2, 0,108, 3,
+ 2, 0,109, 3, 2, 0,110, 3, 2, 0,111, 3, 2, 0,112, 3, 2, 0,113, 3, 7, 0,114, 3, 7, 0,115, 3, 51, 0,116, 3,
+ 11, 0,117, 3, 2, 0,118, 3, 2, 0,163, 1, 2, 0,119, 3, 2, 0, 48, 1,115, 0, 16, 0, 23, 0, 22, 0, 23, 0, 24, 0,
+ 22, 0,120, 3, 22, 0,121, 3, 22, 0,122, 3, 7, 0,123, 3, 7, 0,124, 3, 7, 0,125, 3, 7, 0,126, 3, 2, 0,127, 3,
+ 2, 0,128, 3, 2, 0,129, 3, 2, 0,130, 3, 2, 0,131, 3, 2, 0,132, 3, 4, 0, 16, 0,113, 0, 6, 0,113, 0, 0, 0,
+113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,116, 0, 6, 0,113, 0, 0, 0,113, 0, 1, 0,
+ 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,117, 0, 26, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3,
+ 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 4, 0,133, 3, 4, 0, 48, 1,115, 0,134, 3, 9, 0,135, 3, 11, 0,136, 3,
+ 27, 0, 42, 0, 24, 0, 43, 0, 0, 0,137, 3, 0, 0,138, 3, 2, 0,139, 3, 2, 0,140, 3, 2, 0,141, 3, 2, 0,142, 3,
+ 2, 0, 26, 0, 2, 0, 25, 0, 2, 0,108, 3, 2, 0,143, 3, 4, 0, 16, 0, 7, 0,144, 3, 23, 0, 22, 0,118, 0, 31, 0,
+113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 2, 0,145, 3, 2, 0,146, 3,
+ 2, 0,147, 3, 2, 0,148, 3,115, 0,134, 3, 2, 0,149, 3, 2, 0,108, 3, 2, 0,140, 3, 2, 0,150, 3, 9, 0,151, 3,
+ 2, 0,109, 3, 0, 0,152, 3, 0, 0,153, 3, 2, 0,154, 3, 2, 0,155, 3, 4, 0, 78, 3, 2, 0,156, 3, 2, 0,157, 3,
+ 2, 0,158, 3, 2, 0, 18, 2, 2, 0,159, 3, 2, 0, 69, 0, 4, 0,160, 3, 0, 0,215, 0, 0, 0,161, 3,119, 0, 10, 0,
+113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 2, 0,149, 3,
+ 2, 0, 74, 3, 4, 0, 48, 1,120, 0, 24, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3,
+ 2, 0, 82, 3,121, 0,162, 3, 4, 0,163, 3, 0, 0,164, 3, 0, 0,165, 3, 0, 0,166, 3, 2, 0, 29, 0, 2, 0,167, 3,
+ 2, 0, 16, 0, 2, 0,168, 3, 2, 0,169, 3, 2, 0,170, 3,122, 0,171, 3, 2, 0,172, 3, 2, 0,138, 0, 2, 0,173, 3,
+ 2, 0,174, 3, 9, 0,175, 3, 2, 0,176, 3,123, 0, 19, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,
+114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 11, 0,177, 3, 2, 0,140, 3, 2, 0,178, 3, 2, 0, 16, 0, 2, 0,157, 1,
+ 9, 0,151, 3, 11, 0,179, 3,124, 0,180, 3, 2, 0, 29, 0, 2, 0,181, 3, 2, 0,182, 3, 2, 0,183, 3,125, 0, 17, 0,
+113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 35, 0,184, 3,
+ 7, 0, 74, 3, 2, 0,193, 0, 2, 0,108, 3, 2, 0,185, 3, 2, 0,186, 3, 7, 0,132, 1, 7, 0,133, 1, 2, 0, 16, 0,
+ 2, 0,143, 3,126, 0, 10, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,
+ 2, 0,108, 3, 2, 0,143, 3, 4, 0, 17, 0,115, 0,134, 3,127, 0, 22, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3,
+ 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 32, 0,187, 3, 4, 0,188, 3, 4, 0,189, 3, 2, 0, 55, 0, 2, 0,108, 3,
+ 4, 0,190, 3, 4, 0,191, 3, 4, 0,192, 3, 4, 0,193, 3, 4, 0,194, 3, 4, 0,195, 3, 4, 0,196, 3, 4, 0,197, 3,
+ 7, 0,198, 3, 22, 0,199, 3, 22, 0,200, 3,128, 0, 9, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,
+114, 0, 81, 3,129, 0,201, 3, 4, 0, 48, 1, 2, 0, 55, 0, 2, 0,108, 3,130, 0, 8, 0,113, 0, 0, 0,113, 0, 1, 0,
+ 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3,115, 0,134, 3, 4, 0, 16, 0, 4, 0,202, 3,131, 0, 81, 0,113, 0, 0, 0,
+113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 0, 0,203, 3, 4, 0,204, 3, 2, 0,193, 0, 2, 0,205, 3,
+ 2, 0,206, 3, 2, 0,207, 3, 2, 0,208, 3, 2, 0,209, 3, 2, 0,210, 3, 2, 0,211, 3, 2, 0,212, 3, 2, 0,213, 3,
+ 2, 0,214, 3, 2, 0,215, 3, 2, 0,216, 3, 2, 0,217, 3, 2, 0,218, 3, 2, 0,219, 3, 2, 0,220, 3, 2, 0,221, 3,
+ 2, 0,222, 3, 2, 0,223, 3, 2, 0,224, 3, 2, 0,225, 3, 2, 0,226, 3, 2, 0,227, 3, 2, 0,228, 3, 2, 0,229, 3,
+ 2, 0,230, 3, 2, 0,231, 3, 2, 0,232, 3, 2, 0,233, 3, 2, 0,234, 3, 2, 0,235, 3, 2, 0,236, 3, 2, 0,237, 3,
+ 2, 0,238, 3, 2, 0,239, 3, 2, 0,240, 3, 2, 0,241, 3, 2, 0,242, 3, 2, 0,243, 3, 2, 0,244, 3, 2, 0,245, 3,
+ 2, 0,246, 3, 2, 0,247, 3, 2, 0,248, 3, 2, 0,249, 3, 2, 0,250, 3, 2, 0,251, 3, 0, 0,252, 3, 0, 0,253, 3,
+ 0, 0,254, 3, 0, 0,255, 3,132, 0, 0, 4,132, 0, 1, 4, 4, 0, 2, 4, 4, 0, 3, 4, 4, 0, 4, 4, 4, 0, 5, 4,
+ 4, 0, 6, 4, 7, 0, 7, 4, 7, 0, 8, 4, 7, 0, 9, 4, 2, 0, 10, 4, 2, 0, 11, 4, 2, 0, 12, 4, 2, 0, 13, 4,
+133, 0, 14, 4,133, 0, 15, 4, 2, 0, 16, 4, 2, 0, 17, 4, 4, 0, 48, 1, 37, 0, 18, 4, 9, 0,175, 3, 9, 0, 19, 4,
+134, 0, 19, 0, 0, 0, 20, 4, 0, 0, 21, 4, 0, 0, 22, 4, 0, 0, 23, 4, 0, 0, 24, 4, 0, 0, 25, 4, 0, 0, 26, 4,
+ 0, 0, 27, 4, 0, 0, 28, 4, 0, 0, 29, 4, 0, 0, 30, 4, 0, 0, 31, 4, 0, 0, 32, 4, 0, 0, 33, 4, 0, 0, 34, 4,
+ 0, 0, 35, 4, 0, 0, 36, 4, 0, 0, 37, 4, 0, 0, 38, 4,135, 0, 36, 0, 0, 0, 39, 4, 0, 0, 30, 4, 0, 0, 31, 4,
+ 0, 0, 40, 4, 0, 0, 41, 4, 0, 0, 42, 4, 0, 0, 43, 4, 0, 0, 44, 4, 0, 0, 45, 4, 0, 0, 46, 4, 0, 0, 47, 4,
+ 0, 0, 48, 4, 0, 0, 49, 4, 0, 0, 50, 4, 0, 0, 51, 4, 0, 0, 52, 4, 0, 0, 53, 4, 0, 0, 54, 4, 0, 0, 55, 4,
+ 0, 0, 56, 4, 0, 0, 57, 4, 0, 0, 58, 4, 0, 0, 59, 4, 0, 0, 60, 4, 0, 0, 61, 4, 0, 0, 62, 4, 0, 0, 63, 4,
+ 0, 0, 64, 4, 0, 0, 65, 4, 0, 0, 66, 4, 0, 0, 67, 4, 0, 0, 68, 4, 0, 0, 69, 4, 0, 0, 70, 4, 0, 0, 71, 4,
+ 0, 0, 72, 4,136, 0, 18, 0,136, 0, 0, 0,136, 0, 1, 0, 0, 0, 34, 0,134, 0, 73, 4,135, 0, 74, 4,135, 0, 75, 4,
+135, 0, 76, 4,135, 0, 77, 4,135, 0, 78, 4,135, 0, 79, 4,135, 0, 80, 4,135, 0, 81, 4,135, 0, 82, 4,135, 0, 83, 4,
+135, 0, 84, 4,135, 0, 85, 4,135, 0, 86, 4,135, 0, 87, 4,137, 0, 5, 0, 4, 0, 16, 0, 4, 0, 17, 0, 7, 0,162, 1,
+ 7, 0, 88, 4, 7, 0, 95, 1,138, 0, 45, 0, 4, 0, 16, 0, 4, 0, 89, 4, 4, 0, 90, 4, 0, 0, 91, 4, 0, 0, 92, 4,
+ 0, 0, 93, 4, 0, 0, 94, 4, 0, 0, 95, 4, 0, 0, 96, 4, 0, 0, 97, 4, 0, 0, 98, 4, 0, 0, 99, 4, 2, 0,100, 4,
+ 2, 0,101, 4, 4, 0,102, 4, 4, 0,103, 4, 4, 0,104, 4, 4, 0,105, 4, 2, 0,106, 4, 2, 0,107, 4, 2, 0,108, 4,
+ 2, 0,109, 4, 4, 0,110, 4, 4, 0,111, 4, 2, 0,112, 4, 2, 0,113, 4, 2, 0,114, 4, 2, 0,115, 4, 0, 0,116, 4,
+ 11, 0,117, 4, 2, 0,118, 4, 2, 0,119, 4, 2, 0,120, 4, 2, 0,121, 4,137, 0,122, 4, 2, 0,123, 4, 2, 0,124, 4,
+ 2, 0,125, 4, 2, 0,126, 4, 4, 0,127, 4, 4, 0,128, 4, 2, 0,129, 4, 2, 0, 69, 0, 2, 0, 48, 1, 2, 0, 39, 1,
+139, 0, 18, 0, 24, 0, 18, 0, 11, 0,130, 4, 11, 0,131, 4, 11, 0,132, 4,108, 0,133, 4, 2, 0,212, 1, 2, 0,134, 4,
+ 2, 0,213, 1, 2, 0,135, 4, 2, 0,136, 4, 2, 0,137, 4, 2, 0,138, 4, 2, 0,139, 4, 2, 0,140, 4, 2, 0, 17, 0,
+ 2, 0,141, 4, 2, 0,142, 4, 2, 0,143, 4,140, 0, 5, 0,140, 0, 0, 0,140, 0, 1, 0,140, 0,144, 4, 12, 0,145, 4,
+ 4, 0, 16, 0,141, 0, 7, 0,141, 0, 0, 0,141, 0, 1, 0,140, 0,146, 4,140, 0,147, 4, 2, 0,232, 2, 2, 0, 16, 0,
+ 4, 0, 17, 0,142, 0, 16, 0,142, 0, 0, 0,142, 0, 1, 0, 0, 0,148, 4, 0, 0,149, 4, 2, 0,150, 4, 2, 0,151, 4,
+ 2, 0,136, 4, 2, 0,137, 4, 2, 0, 16, 0, 2, 0, 64, 2, 2, 0,152, 4, 2, 0, 17, 0, 2, 0,153, 4, 2, 0,154, 4,
+ 4, 0,155, 4,142, 0,156, 4,114, 0, 30, 0,114, 0, 0, 0,114, 0, 1, 0,140, 0,146, 4,140, 0,147, 4,140, 0,157, 4,
+140, 0,158, 4,139, 0,159, 4, 7, 0,160, 4, 22, 0,152, 1, 22, 0,161, 4, 22, 0,162, 4, 2, 0,163, 4, 2, 0,164, 4,
+ 2, 0,165, 4, 0, 0, 79, 3, 0, 0,166, 4, 2, 0,167, 4, 2, 0,168, 4, 0, 0,169, 4, 0, 0,170, 4, 0, 0,171, 4,
+ 0, 0,172, 4, 2, 0,173, 4, 2, 0,174, 4, 2, 0,175, 4, 2, 0, 16, 0, 30, 0, 80, 0, 11, 0,176, 4, 11, 0,177, 4,
+ 11, 0,178, 4,143, 0, 7, 0, 9, 0,179, 4, 9, 0,180, 4, 2, 0,181, 4, 2, 0,233, 2, 4, 0,182, 4, 4, 0,183, 4,
+ 4, 0, 17, 0,144, 0, 8, 0, 0, 0,184, 4, 37, 0, 82, 0,144, 0,185, 4,144, 0,186, 4,144, 0,187, 4, 2, 0, 84, 0,
+ 2, 0,188, 4, 4, 0, 17, 0,145, 0, 11, 0,145, 0, 0, 0,145, 0, 1, 0, 2, 0,157, 1, 2, 0, 52, 0, 2, 0, 15, 0,
+ 2, 0,189, 4,144, 0,190, 4, 0, 0,165, 3, 2, 0,191, 4, 2, 0,192, 4, 4, 0, 17, 0,146, 0, 10, 0, 0, 0, 57, 1,
+ 9, 0,125, 0, 0, 0,126, 0, 4, 0,129, 0, 4, 0,136, 0, 9, 0,130, 0, 7, 0,132, 0, 7, 0,133, 0, 9, 0,134, 0,
+ 9, 0,135, 0,147, 0, 38, 0,147, 0, 0, 0,147, 0, 1, 0,147, 0,193, 4, 9, 0, 13, 0, 0, 0, 14, 0, 2, 0, 16, 0,
+ 2, 0, 29, 0, 4, 0, 52, 0, 4, 0,204, 1, 4, 0,194, 4, 4, 0,195, 4, 4, 0,196, 4, 4, 0,197, 4, 4, 0,198, 4,
+ 4, 0,146, 0, 4, 0,199, 4, 4, 0,200, 4, 7, 0,201, 4, 7, 0,202, 4, 4, 0,187, 0,145, 0,203, 4,144, 0,204, 4,
+ 27, 0, 42, 0,108, 0,133, 4, 36, 0, 81, 0, 7, 0,205, 4, 7, 0,206, 4,146, 0,189, 0,147, 0,207, 4,147, 0,208, 4,
+147, 0,209, 4, 11, 0,210, 4,148, 0,211, 4, 7, 0,212, 4, 7, 0,213, 4, 4, 0,214, 4, 7, 0,215, 4, 9, 0,216, 4,
+149, 0, 4, 0,149, 0, 0, 0,149, 0, 1, 0, 11, 0,217, 4,147, 0,218, 4,150, 0, 6, 0, 11, 0,219, 4, 11, 0,210, 4,
+ 11, 0,220, 4, 2, 0, 16, 0, 2, 0,157, 1, 4, 0, 17, 0,151, 0, 4, 0, 7, 0,221, 4, 7, 0,222, 4, 2, 0,223, 4,
+ 2, 0,224, 4,152, 0, 6, 0, 7, 0,225, 4, 7, 0,226, 4, 7, 0,227, 4, 7, 0,228, 4, 4, 0,229, 4, 4, 0,230, 4,
+153, 0, 6, 0,153, 0, 0, 0,153, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,157, 1,154, 0, 8, 0,
+154, 0, 0, 0,154, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,157, 1, 7, 0, 52, 0, 7, 0,187, 0,
+155, 0, 41, 0,155, 0, 0, 0,155, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,143, 0, 2, 0, 90, 2,
+ 2, 0,232, 4, 7, 0,233, 4, 7, 0,234, 4, 7, 0,219, 1, 4, 0,235, 4, 4, 0, 44, 0, 4, 0,207, 1, 7, 0,236, 4,
+ 7, 0,237, 4, 7, 0,238, 4, 7, 0,239, 4, 7, 0,240, 4, 7, 0,241, 4, 7, 0,217, 1, 7, 0,184, 0, 7, 0,242, 4,
+ 7, 0,243, 4, 7, 0,244, 4, 7, 0,245, 4, 2, 0,246, 4, 2, 0,247, 4, 2, 0,248, 4, 2, 0,249, 4, 2, 0,250, 4,
+ 2, 0,251, 4, 2, 0,252, 4, 2, 0,253, 4, 2, 0,254, 4, 2, 0,255, 4, 2, 0, 78, 1, 2, 0, 0, 5, 0, 0, 1, 5,
+ 0, 0, 2, 5,156, 0, 3, 5,157, 0, 16, 0,157, 0, 0, 0,157, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4,
+ 2, 0,143, 0, 7, 0,212, 1, 7, 0,213, 1, 7, 0,214, 1, 7, 0,121, 1, 7, 0,215, 1, 7, 0,216, 1, 7, 0, 4, 5,
+ 7, 0,217, 1, 7, 0,218, 1, 7, 0,219, 1,158, 0, 5, 0, 2, 0, 29, 0, 2, 0,188, 4, 2, 0, 16, 0, 2, 0, 5, 5,
+ 24, 0, 6, 5,124, 0, 3, 0, 4, 0, 31, 0, 4, 0, 7, 5,158, 0, 32, 0,159, 0, 12, 0,159, 0, 0, 0,159, 0, 1, 0,
+ 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 34, 2, 2, 0, 94, 1, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 8, 5, 7, 0, 9, 5,
+ 24, 0, 6, 5, 11, 0, 10, 5,160, 0, 11, 0,160, 0, 0, 0,160, 0, 1, 0, 0, 0, 34, 0, 2, 0, 29, 0, 2, 0, 11, 5,
+ 4, 0, 12, 5, 4, 0, 13, 5, 2, 0, 16, 0, 2, 0, 17, 0, 9, 0, 14, 5, 9, 0, 15, 5,161, 0, 5, 0, 0, 0, 34, 0,
+ 7, 0,196, 0, 7, 0, 16, 5, 4, 0, 17, 5, 4, 0, 17, 0,162, 0, 4, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 69, 0,
+ 2, 0, 48, 1,163, 0, 4, 0, 0, 0, 34, 0, 47, 0, 18, 5, 7, 0,196, 0, 7, 0, 17, 0,164, 0, 6, 0, 2, 0, 19, 5,
+ 2, 0, 20, 5, 2, 0, 29, 0, 2, 0, 21, 5, 0, 0, 22, 5, 0, 0, 23, 5,165, 0, 5, 0, 4, 0, 29, 0, 4, 0, 17, 0,
+ 0, 0, 34, 0, 0, 0, 24, 5, 0, 0, 25, 5,166, 0, 6, 0, 0, 0, 34, 0, 0, 0, 26, 5, 2, 0, 27, 5, 2, 0,217, 1,
+ 2, 0,193, 0, 2, 0, 48, 1,167, 0, 5, 0, 0, 0, 34, 0, 7, 0,222, 4, 7, 0,135, 2, 2, 0, 16, 0, 2, 0,208, 1,
+168, 0, 3, 0, 0, 0, 34, 0, 4, 0,207, 1, 4, 0, 28, 5,169, 0, 7, 0, 0, 0, 34, 0, 7, 0,135, 2, 0, 0, 29, 5,
+ 0, 0, 30, 5, 2, 0,193, 0, 2, 0, 69, 0, 4, 0, 31, 5,170, 0, 3, 0, 39, 0, 32, 5, 0, 0, 33, 5, 0, 0, 34, 5,
+171, 0, 17, 0,171, 0, 0, 0,171, 0, 1, 0, 2, 0, 29, 0, 2, 0, 11, 5, 2, 0, 16, 0, 2, 0, 35, 5, 2, 0, 36, 5,
+ 2, 0, 37, 5, 2, 0, 69, 0, 2, 0, 48, 1, 0, 0, 34, 0, 9, 0, 32, 0,172, 0, 38, 5, 39, 0,149, 1, 2, 0, 39, 5,
+ 2, 0, 40, 5, 4, 0, 17, 0,173, 0, 10, 0, 0, 0, 34, 0, 2, 0, 29, 0, 2, 0, 17, 0, 4, 0,208, 1, 4, 0, 41, 5,
+ 4, 0, 42, 5, 4, 0, 43, 5, 4, 0, 44, 5, 4, 0, 45, 5, 4, 0, 46, 5,174, 0, 1, 0, 0, 0, 47, 5,175, 0, 1, 0,
+ 32, 0,187, 3,172, 0, 18, 0,172, 0, 0, 0,172, 0, 1, 0,172, 0, 48, 5, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 49, 5,
+ 2, 0, 37, 5, 2, 0, 11, 5, 2, 0, 50, 5, 2, 0, 48, 1, 2, 0, 39, 1, 0, 0, 34, 0, 9, 0, 32, 0,176, 0, 38, 5,
+171, 0, 51, 5, 2, 0, 52, 5, 2, 0, 53, 5, 4, 0, 24, 1,177, 0, 3, 0, 4, 0, 54, 5, 4, 0, 17, 0, 39, 0,149, 1,
+178, 0, 13, 0, 87, 0, 55, 5, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 34, 0, 2, 0, 56, 5,
+ 2, 0, 57, 5, 7, 0, 58, 5, 2, 0, 59, 5, 2, 0, 99, 0, 2, 0,100, 0, 2, 0, 60, 5,179, 0, 9, 0, 2, 0, 16, 0,
+ 2, 0, 61, 5, 2, 0,233, 4, 2, 0,234, 4,148, 0,211, 4, 2, 0, 29, 0, 2, 0, 62, 5, 2, 0, 63, 5, 2, 0, 64, 5,
+180, 0, 7, 0, 2, 0, 16, 0, 2, 0, 61, 5, 2, 0,233, 4, 2, 0,234, 4, 2, 0, 29, 0, 2, 0, 65, 5, 7, 0, 66, 5,
+181, 0, 9, 0, 4, 0, 54, 5, 2, 0, 29, 0, 2, 0, 16, 0, 39, 0,149, 1, 63, 0, 67, 5, 0, 0, 34, 0, 7, 0, 68, 5,
+ 2, 0, 69, 5, 2, 0, 17, 0,182, 0, 5, 0, 2, 0, 29, 0, 2, 0, 16, 0, 4, 0, 17, 0,108, 0,133, 4, 39, 0, 50, 3,
+183, 0, 5, 0, 4, 0, 16, 0, 4, 0, 29, 0, 0, 0, 34, 0, 0, 0, 24, 5, 39, 0,149, 1,184, 0, 12, 0, 4, 0, 16, 0,
+ 4, 0, 29, 0, 7, 0, 70, 5, 7, 0, 71, 5, 7, 0, 81, 1, 7, 0, 82, 1, 7, 0, 4, 2, 7, 0, 7, 2, 7, 0, 72, 5,
+ 7, 0, 73, 5, 7, 0, 74, 5, 0, 0, 75, 5,185, 0, 9, 0, 2, 0, 16, 0, 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4,
+ 0, 0, 34, 0, 2, 0, 69, 0, 2, 0, 24, 0, 2, 0, 76, 5, 2, 0, 77, 5,186, 0, 8, 0, 39, 0,149, 1, 7, 0,214, 1,
+ 7, 0, 78, 5, 7, 0,244, 1, 7, 0, 79, 5, 2, 0, 16, 0, 2, 0,208, 1, 7, 0, 80, 5,187, 0, 7, 0, 2, 0, 16, 0,
+ 2, 0,217, 1, 7, 0, 81, 5, 7, 0, 82, 5, 7, 0, 83, 5, 7, 0, 84, 5, 7, 0, 85, 5,188, 0, 10, 0, 2, 0, 16, 0,
+ 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 34, 0, 2, 0, 69, 0, 2, 0, 24, 0, 2, 0, 76, 5, 2, 0, 77, 5,
+109, 0, 55, 3,189, 0, 7, 0, 4, 0,207, 1, 4, 0, 86, 5, 4, 0, 87, 5, 4, 0, 88, 5, 7, 0, 89, 5, 7, 0, 90, 5,
+ 0, 0, 29, 5,190, 0, 7, 0, 0, 0, 91, 5, 39, 0, 92, 5, 0, 0, 33, 5, 2, 0, 93, 5, 2, 0, 69, 0, 4, 0, 48, 1,
+ 0, 0, 34, 5,191, 0, 6, 0, 2, 0, 16, 0, 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 94, 5, 0, 0, 95, 5,
+192, 0, 1, 0, 4, 0, 16, 0,176, 0, 10, 0,176, 0, 0, 0,176, 0, 1, 0,176, 0, 48, 5, 2, 0, 29, 0, 2, 0, 16, 0,
+ 2, 0, 11, 5, 2, 0, 96, 5, 0, 0, 34, 0, 9, 0, 32, 0, 39, 0,149, 1,193, 0, 10, 0, 7, 0, 27, 2, 7, 0, 97, 5,
+ 7, 0, 98, 5, 7, 0, 99, 5, 7, 0,100, 5, 4, 0, 16, 0, 7, 0,101, 5, 7, 0,102, 5, 7, 0,103, 5, 7, 0, 17, 0,
+148, 0, 22, 0, 24, 0, 18, 0, 0, 0, 21, 0,194, 0,104, 5, 9, 0,105, 5, 33, 0, 95, 0, 33, 0,106, 5, 9, 0,107, 5,
+ 27, 0, 42, 0, 7, 0, 66, 5, 7, 0,108, 5, 7, 0,109, 5, 7, 0,110, 5, 7, 0,111, 5, 7, 0,112, 5, 7, 0,113, 5,
+ 4, 0, 55, 0, 4, 0,114, 5, 4, 0,115, 5, 4, 0,116, 5, 0, 0,117, 5, 0, 0,118, 5, 0, 0,119, 5,195, 0, 6, 0,
+ 24, 0, 18, 0, 7, 0,120, 5, 7, 0,121, 5, 7, 0,122, 5, 2, 0,123, 5, 2, 0,124, 5,196, 0, 14, 0,113, 0, 0, 0,
+113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3,115, 0,134, 3,148, 0,211, 4, 2, 0,193, 0, 2, 0, 61, 5,
+ 2, 0,132, 1, 2, 0,133, 1, 2, 0, 16, 0, 2, 0,143, 3, 4, 0, 48, 1,197, 0, 6, 0,197, 0, 0, 0,197, 0, 1, 0,
+ 2, 0,187, 0, 2, 0, 93, 2, 7, 0,206, 2, 0, 0, 34, 0,198, 0, 31, 0,198, 0, 0, 0,198, 0, 1, 0,197, 0,125, 5,
+ 2, 0,246, 1, 2, 0, 17, 0, 4, 0,247, 1, 4, 0,248, 1, 4, 0,249, 1, 39, 0,252, 1, 39, 0,253, 1, 27, 0, 42, 0,
+ 7, 0, 81, 1, 7, 0, 4, 2, 7, 0, 5, 2, 7, 0,112, 0, 7, 0, 6, 2, 7, 0, 82, 1, 7, 0, 7, 2, 7, 0, 68, 1,
+ 7, 0, 8, 2, 7, 0, 9, 2, 7, 0,221, 1, 7, 0,142, 0, 4, 0,231, 0, 0, 0, 11, 2, 0, 0, 12, 2, 0, 0, 13, 2,
+ 0, 0, 14, 2, 7, 0, 25, 2, 7, 0, 26, 2, 7, 0,126, 5,199, 0, 4, 0,199, 0, 0, 0,199, 0, 1, 0, 39, 0,149, 1,
+ 11, 0,127, 5,109, 0, 4, 0, 24, 0, 18, 0, 11, 0,128, 5, 11, 0,129, 5,197, 0,130, 5,200, 0, 25, 0,200, 0, 0, 0,
+200, 0, 1, 0,200, 0,252, 1, 11, 0,131, 5, 0, 0, 34, 0, 7, 0,132, 5, 7, 0,133, 5, 7, 0,134, 5, 7, 0,135, 5,
+ 4, 0, 16, 0, 7, 0,136, 5, 7, 0,137, 5, 7, 0,138, 5, 7, 0,196, 0, 7, 0, 88, 1, 7, 0,139, 5, 7, 0,205, 1,
+ 7, 0,140, 5, 7, 0,141, 5, 7, 0,142, 5, 7, 0,143, 5, 7, 0,144, 5, 7, 0,112, 0, 2, 0,145, 5, 2, 0, 47, 3,
+201, 0, 8, 0, 24, 0, 18, 0, 11, 0,146, 5, 11, 0,147, 5, 4, 0, 16, 0, 4, 0,169, 2, 4, 0,220, 1, 2, 0,148, 5,
+ 2, 0,149, 5,202, 0, 29, 0,202, 0, 0, 0,202, 0, 1, 0, 11, 0, 48, 2, 0, 0, 34, 0, 2, 0, 16, 0, 2, 0,150, 5,
+ 2, 0,151, 5, 2, 0,119, 1, 2, 0, 16, 2, 2, 0, 17, 0, 2, 0, 69, 0, 2, 0, 48, 1,200, 0,152, 5,202, 0,252, 1,
+202, 0,153, 5, 11, 0,154, 5, 9, 0,155, 5, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 68, 1, 7, 0,156, 5, 7, 0,157, 5,
+ 7, 0,158, 5, 7, 0,159, 5, 7, 0,160, 5, 7, 0,161, 5, 7, 0,162, 5, 7, 0,163, 5, 7, 0,116, 1, 88, 0, 3, 0,
+ 11, 0,164, 5, 4, 0, 16, 0, 7, 0,165, 5,203, 0, 7, 0,203, 0, 0, 0,203, 0, 1, 0, 27, 0, 42, 0, 11, 0, 0, 2,
+ 4, 0, 16, 0, 0, 0, 34, 0, 4, 0, 99, 0, 87, 0, 2, 0, 24, 0, 18, 0, 11, 0,164, 5,204, 0, 14, 0,113, 0, 0, 0,
+113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 87, 0,254, 1, 4, 0, 16, 0,
+ 2, 0,140, 3, 2, 0,166, 5, 2, 0,143, 3, 2, 0, 17, 0, 7, 0,167, 5,205, 0, 5, 0,205, 0, 0, 0,205, 0, 1, 0,
+ 27, 0, 42, 0, 2, 0, 16, 0, 0, 0,168, 5,206, 0, 8, 0,206, 0, 0, 0,206, 0, 1, 0, 9, 0, 32, 0, 2, 0, 29, 0,
+ 2, 0, 16, 0, 2, 0, 99, 0, 0, 0,168, 5, 7, 0,169, 5,207, 0, 11, 0, 39, 0,170, 5, 7, 0,209, 1, 2, 0,171, 5,
+ 2, 0, 16, 0, 4, 0,172, 5, 4, 0, 17, 0, 0, 0,173, 5, 7, 0, 88, 1, 7, 0,174, 5, 7, 0,175, 5, 7, 0, 48, 1,
+208, 0, 4, 0, 39, 0,170, 5, 4, 0, 99, 0, 4, 0,100, 0, 0, 0,173, 5,209, 0, 4, 0, 39, 0,170, 5, 4, 0, 16, 0,
+ 4, 0, 99, 0, 0, 0,173, 5,210, 0, 4, 0, 39, 0,170, 5, 4, 0, 16, 0, 4, 0, 99, 0, 0, 0,173, 5,211, 0, 7, 0,
+ 39, 0,170, 5, 4, 0,176, 5, 7, 0,186, 0, 2, 0,177, 5, 2, 0,178, 5, 7, 0,179, 5, 0, 0,173, 5,212, 0, 9, 0,
+ 39, 0,170, 5, 2, 0, 29, 0, 2, 0,180, 5, 2, 0,204, 1, 2, 0,234, 4, 7, 0, 78, 5, 7, 0,244, 1, 87, 0, 55, 5,
+ 0, 0,173, 5,213, 0, 4, 0, 39, 0,170, 5, 4, 0, 13, 2, 4, 0,181, 5, 0, 0,173, 5,214, 0, 5, 0, 39, 0,170, 5,
+ 7, 0,186, 0, 4, 0,182, 5, 4, 0, 13, 2, 4, 0, 14, 2,215, 0, 6, 0, 39, 0,170, 5, 0, 0,173, 5, 7, 0, 69, 0,
+ 7, 0, 48, 1, 7, 0,113, 5, 7, 0,183, 5,216, 0, 6, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0,
+ 7, 0, 0, 3, 7, 0,184, 5,217, 0, 6, 0, 39, 0,170, 5, 4, 0,185, 5, 4, 0,186, 5, 7, 0,187, 5, 7, 0,188, 5,
+ 0, 0,173, 5,218, 0, 17, 0,218, 0, 0, 0,218, 0, 1, 0, 2, 0, 16, 0, 2, 0,193, 0, 2, 0,189, 5, 2, 0, 17, 0,
+ 27, 0, 42, 0, 87, 0, 55, 5, 7, 0,204, 1, 7, 0,234, 4, 7, 0,190, 5, 7, 0,191, 5, 7, 0,192, 5, 7, 0,193, 5,
+ 7, 0, 56, 5, 7, 0,194, 5, 0, 0,195, 5, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
diff --git a/source/blender/src/Bfont.c b/source/blender/editors/datafiles/Bfont.c
index cd45debcbe4..4080a0d369f 100644
--- a/source/blender/src/Bfont.c
+++ b/source/blender/editors/datafiles/Bfont.c
@@ -1,6 +1,6 @@
/* DataToC output of file <Bfont> */
/*
- * $Id$
+ * $Id: Bfont.c 125 2002-11-25 12:02:15Z mein $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/editors/datafiles/Makefile b/source/blender/editors/datafiles/Makefile
new file mode 100644
index 00000000000..4162125623e
--- /dev/null
+++ b/source/blender/editors/datafiles/Makefile
@@ -0,0 +1,49 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_datafiles
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../../blenkernel
+CPPFLAGS += -I../../../blenlib
+CPPFLAGS += -I../../../makesdna
+CPPFLAGS += -I../../../imbuf
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/datafiles/SConscript b/source/blender/editors/datafiles/SConscript
new file mode 100644
index 00000000000..e69c8567ca0
--- /dev/null
+++ b/source/blender/editors/datafiles/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' #/intern/guardedalloc'
+
+env.BlenderLib ( 'bf_editor_datafiles', sources, Split(incs), [], libtype=['core','intern'], priority=[50, 55] )
diff --git a/source/blender/src/bfont.ttf.c b/source/blender/editors/datafiles/bfont.ttf.c
index a52d6ded28a..a52d6ded28a 100644
--- a/source/blender/src/bfont.ttf.c
+++ b/source/blender/editors/datafiles/bfont.ttf.c
diff --git a/source/blender/editors/datafiles/blenderbuttons.c b/source/blender/editors/datafiles/blenderbuttons.c
new file mode 100644
index 00000000000..e7c8087893b
--- /dev/null
+++ b/source/blender/editors/datafiles/blenderbuttons.c
@@ -0,0 +1,3248 @@
+/* DataToC output of file <blenderbuttons> */
+
+int datatoc_blenderbuttons_size= 103734;
+char datatoc_blenderbuttons[]= {
+137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 0, 0, 0,
+ 1, 0, 8, 6, 0, 0, 0,197,144,206,103, 0, 0, 0, 4,115, 66, 73, 84, 8, 8, 8, 8,124, 8,100,136, 0, 0, 0, 9,112,
+ 72, 89,115, 0, 0, 13,215, 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 0, 25,116, 69, 88,116, 83,111,102,116,119, 97,114,101,
+ 0,119,119,119, 46,105,110,107,115, 99, 97,112,101, 46,111,114,103,155,238, 60, 26, 0, 0, 32, 0, 73, 68, 65, 84,120,156,236,
+157,119, 88, 84,215,214,198,223, 83,166, 23,102, 64, 4,105, 98, 99, 20, 59, 86, 44,140, 93, 98,137,198,118, 21, 9,198, 22, 59,
+ 22,108,137, 53,209,216,174, 45,118, 19,187, 40, 38, 38, 98, 98, 47,136, 99,111,216, 21, 71, 35, 98, 1,233, 51, 8,211,103,206,
+249,254,160, 92, 52,192, 12,234,189,201,253,238,252,158,231, 60, 48,103,206,121,103,157, 41,103,173,189,246,218,123, 19,106,141,
+ 10, 78,156, 56,113,226,196,137,147,255, 45,200,191,218, 0, 39, 78,156, 56,113,226,196,201,127, 30,103, 0,224,196,137, 19, 39,
+ 78,156,252, 15,226, 12, 0,156, 56,113,226,196,137,147,255, 65,232,191,218, 0, 39, 78,156, 56,113,226,196,201,199,231,249, 77,
+157,177,180,253, 28, 82, 32,243,106, 68, 26,157, 1,128, 19, 39, 78,156,252,135, 81,200,149,164, 90,163, 98,254,106, 59,156,252,
+255,166,106,144,136, 95,222,243,196,223,101, 20,192,192, 14,147,188, 40,138,106, 6,192,205,102,179, 29,223,119,102,117,234, 95,
+109,147,147,191, 63, 10,185,146, 0, 0,181, 70,197,254,213,182,252,213,244,109, 59,238, 98,112,112,112,157,155, 55,111,154, 25,
+134, 1, 73,146, 32, 8,162,120, 99, 24, 38,101,207,169, 21, 77,254,106, 59,255,215,233, 88,127,240,226,182,109,219, 78,190,126,
+253,250,143, 71,174,111,157, 80,209,243,219,215, 29, 20, 36,149, 74,191,179, 90,173,205,173, 86,171, 64, 40, 20,222,207,205,205,
+ 93,123,230,254,222,221,239, 99,207,223, 93,207,201,135, 83,148, 9, 40,106,249, 23,237,127,239, 0, 32,188,203,212,234, 12,195,
+ 12, 1, 16,206,178,236,173,152,184, 85,253, 42,114,254, 23,221,102, 10, 44, 22,203, 4,150,101,131, 73,138,211,172, 86,253, 86,
+222, 65, 45,149,208,232, 88,156,250,233,159, 79,133, 60, 78,189,205,177,223,148,154,190, 40,141,176, 78, 83, 14, 3,232, 94,218,
+115, 4, 65,124,179,231,212,138,249,142,106, 13,234, 56, 57, 20,192,204,194,135, 75, 98,226, 86, 29,119,244,220,255, 4,138, 47,
+215,113, 61,212,236, 33,138,195,233,192,218,172, 52,195, 88,167,158, 83, 77, 90,241, 87,219, 85,132,178,205,202, 64, 23,185,108,
+ 20, 73, 17,116, 78,142,102,211,185,115, 83,238,253, 59, 94, 71, 33, 87, 10,191, 29, 89,175, 7, 77,146,204,215,155,239,198,170,
+ 53, 42,219, 7,234,241, 1,248, 1,120,174,214,168, 76,246,142,175,175,152, 86, 95,224, 34, 61,106,122, 99,110,123,231,209,130,
+228, 15,121,237,119,236,112,173, 82,165, 74, 61,155,205,230, 75,146,228,171,180,180,180,251,106,141, 42,219,222,121, 3,218, 69,
+190,184,121,243,166,239,137, 19, 39, 32, 20, 10, 33, 22,139, 33,145, 72, 32, 22,139, 33, 22,139,209,163, 71,143,212, 45,191, 47,
+244,118,212,142, 33,159,204,120,110,177, 88,252, 42, 98, 59,151,203,205,228,241,120, 94,155, 99,191,177,190,251, 92,187,192,129,
+207, 9,130,168,144, 30, 65, 16,153, 41, 41, 41, 94,106,141,234,223,174, 87, 26, 10,185,178,166, 68, 34, 25,197, 48, 76, 40, 73,
+146,167,242,242,242, 54,171, 53, 42,117, 69, 94,179, 36, 93, 27, 15,145,117,237,218, 85,179,113,227, 70,140, 31, 63,158, 57,120,
+240,160, 71,252,131,152, 44, 71,207,239,214,116, 88, 36,135,195, 89, 52,123,246,108, 97,171, 86,173, 9,161, 80,136, 7, 15,238,
+ 99,254,252,249,121, 25, 25, 25,231,213,106,117,207,138,100, 22, 74,234,181,110, 93,160,119,255,254,223, 71,207,201,135,243,252,
+166,206, 88,228,248, 75,254, 15, 84,176, 6,160, 79,155,177, 98, 30,143,215,159, 36,201, 47, 26, 53,109,213,182,215,128,161,132,
+149, 16, 98,225,212, 48,135,126, 76, 69, 12,236, 48, 41,152,164, 57, 59, 35, 38, 44,174, 85,181,102, 32,248, 34, 23,228,155, 8,
+164,105,109,224,233, 24,248, 54, 82,215, 72,190,246,115, 8,128,147, 21,144,237,254,211,145, 43, 72,213,216, 64, 16, 0, 65, 0,
+ 36, 1,228, 25, 24,124, 61,172,237, 60, 0,243, 29, 21, 34, 73,114,238,176,197,103,130, 25, 22,216,241,117, 7, 46,128,191, 77,
+ 0,160,248,114, 29,215,243, 41,153,173,168, 93, 77, 60,111,242, 96,108, 59,120, 29,113, 39,143, 47, 5,240,151, 6, 0,173,218,
+253,211, 91, 38, 16, 15,229,112,121,195,234, 55,168, 45,233,219,179,179, 27, 8, 2,177, 71,226,254,209,235,211,173,249, 86, 27,
+179, 67,255, 38,111,107,252,249, 41, 47,237,105,133,180, 95,247,156,181,149,239,120,196,110,222,135,150,140,169,191,111,122,184,
+ 98,193,134, 95,159, 46, 7,224, 14, 32,237,221,227,218,117,222,122,148,160,248,213, 1,128, 32, 1,138, 36, 0,155, 57,245,212,
+177, 47, 58,148, 60, 78, 33, 87, 10,151,140,169,223, 59, 42, 76, 49,145,211,246,151,137, 10,185,242,122,121, 1, 69,131,186,211,
+ 63,145,186,185, 29,170,221,164, 61,245,248,102,220,163, 6, 13,102,246,189,123,119,201, 17,123,215, 86, 22, 10,185,146, 87,185,
+114,229,218, 52, 77,215,233,216,177, 35,111,252,248,241,188, 46, 93,186,224,228,201,147,138,245,235,215, 87, 13,169, 61,192, 98,
+ 50,153, 30,106,181, 90,181, 90,163, 42, 53, 48,182,217,108, 47,199,140, 25, 35, 78, 72, 72, 40, 43, 3,240,167,247,167, 60,108,
+ 54,155, 87,124,124, 60,196, 98,177,221, 99, 9,130, 64,126,126, 62, 58,118,236,232,138,130,251, 74,105,247, 4,175,200,200, 72,
+ 72,165, 82, 24, 12, 6, 24, 12, 6, 24,141, 70, 24,141, 70,152, 76, 38,152, 76, 38,152,205,102,152,205,102, 88, 44, 22, 24,141,
+ 70, 36, 36, 36,184,250,251,251,151,169, 55, 97,194, 4, 72, 36,146, 98, 45,131,193, 80,172, 99, 52, 26,139,245, 76, 38, 19,140,
+ 70, 35,110,223,190, 93,158, 30, 0, 64, 33, 87, 74,197, 98,113, 24, 73,146,195,125,125,125,201, 62,125,250, 36,184,185,185,157,
+201,202,202,146,196,198,198,238,109,226,219, 29, 0,182,231,231,231,239, 86,107, 84,185, 14,189,153,133, 24, 12, 6, 5, 65, 16,
+120,241,226, 5, 8,130, 32, 25,134,169, 7,224,172, 35,231,118,168, 23,214, 72, 44, 22, 47, 62,112, 56, 78,104,161, 92,160,177,
+ 49,208,228, 3,110,254,205, 16,189,255,176,100,100, 68,127,165,193, 96,152, 10, 96, 89, 69,244,206,158, 61, 43,244,240,240,248,
+215,254, 14, 29, 16, 28, 28, 44,233,221,187,247,123,235, 85,174, 92, 25, 44, 91,144,148,107,223,190,253,123,233,253,183,178,120,
+242,246,111, 77, 38,211, 87, 12,195,208, 36, 73,218, 4, 2,193,202, 25, 43,134, 76,255, 0, 61,127,179,217,236,103,177, 88, 8,
+ 14,135,195,242,249,252, 87, 51, 86, 12, 73,250, 24,182,218, 13, 0, 20,114, 37,209,180,105, 83, 37,203,178, 95, 84,171, 81,171,
+127,223,193,163,132,213, 2, 26, 32,143,113, 65, 82, 38,131,155,103, 98, 0, 96,159, 35, 47,214,189,217,112,158, 76, 38, 91, 80,
+ 45,176, 69,212,200, 73,243,201,123,105, 2,156, 77,178,129, 38,205,160, 72,192,148,151,129,220,212, 68,164, 61, 58,171,183, 88,
+ 44, 23, 43,122, 49, 47,115,172, 56,151,104, 2, 69, 2,100,225,205,158, 34, 42,170, 2,176, 44,235,197, 2, 56,122,219, 0,150,
+101, 29,110, 49,253, 39,240, 80,179,135,235,212,173, 33, 94, 56,103, 26,166,172,137,199,243,171,199,193,218, 44, 51, 62, 84,183,
+ 81,221,113,190, 52,193, 29, 77,144,132, 12, 4, 41, 4, 99,123,206, 51,153,150, 95,120,188, 33,223,222,185,173, 91,125, 95,133,
+230,114,158,215,170, 89, 29,243,166,143,165, 92,229, 46,197,207,181,111,211,220, 77,163,125,227,246,221,138, 77,115,174, 37,220,
+155,171,108,191,170,186, 42,126,114,114,121,122, 44, 99,245, 90,179,110, 61, 60,228,124,100,230,154, 49, 97,252,120,124,191,102,
+ 13,188, 43, 9,240, 70,111,195, 15, 39, 94,165, 52,201, 91,118,118,250,167,138, 5,123, 79,191,220, 48,126,229,173,187, 0,116,
+165,138,145,116,141, 29, 27, 23, 5,248, 84,226,129, 34, 73,228,228, 91, 48,248,203,233,220,146,135, 20, 57,255,233,225,138, 5,
+ 27, 99,147,118, 1,224, 0, 16, 0, 40,245,218, 27,212,253,122,172,139,171,251,218, 14, 3,166,146,138, 26,126,104,221,188, 49,
+239,194,169,216, 67,189,123,108,128,193,160,103,205, 86, 54, 37, 43, 59,103,250,189,251,139, 29,250, 93,132, 6,125,209,182,118,
+237,218,213, 71,142, 28,201,253,199, 63, 6, 81, 95, 45,221,217,109,246,154,195,193, 99,191,141,150,203,165, 46,185, 13, 2, 67,
+174, 93,218,178,237,208,239,177,191, 54,219,184,113, 99,195, 78, 13,194,147, 79,223,141, 62,247,174,206,175,231,215,183, 6,128,
+ 62,109, 46, 94,108,217,178,101,157, 27, 55,110,152, 89,150, 45, 25, 4,120,135,117,154,146, 86,178, 75, 96,239,233,149,229,118,
+ 9,240,120, 60,168, 84, 42, 80, 20,133,186, 29, 59,130,176, 88,240,226,234, 85,208, 34, 17,170, 4, 5,129, 48,155,145,247,248,
+ 49, 56, 98, 49,104,218,126,123, 66, 34,145,160,107,215,174,224,241,120,104,218,180, 41,184, 92, 46, 56, 28, 78,153,155, 61, 68,
+ 34, 17,190,249,230, 27, 0, 0, 77,211,144, 8, 4, 24,219,188, 57,132, 44,139, 45,106, 53,140, 12, 3,154,166, 65,211,180, 67,
+122, 77,253,122,236,144, 74,165,237,218,183,111,127, 99,230,204,153,251, 91,182,108,169, 5,128,221,187,119,251,206,156, 57,243,
+225,247,223,127,127,253,218,181,107, 46, 75,150, 44, 81,198,197,197, 77,105,228, 21,122,233,118,234,241,112,123,186, 10,185,146,
+244,242,242,154,215,183,111,223, 89, 35, 70,140,128,187,187, 59, 70,140, 24, 1,138,162,226,218,215, 29,180, 44, 53, 53,117,182,
+189, 12,150, 68, 34, 89, 60, 99,198, 12, 1,195,113,193,226,159,146,161,213, 89, 0, 0, 2, 46,133,113,157, 37,136,138,138, 18,
+141, 26, 53,106, 46, 28,116,176, 69,122, 37,157, 63, 0, 88, 44, 22,228,228,228,124,144, 94, 66, 66, 2, 76,166,130, 36, 26, 65,
+ 16,240,245,245,173,176,222,127, 35, 17,161,211, 61,130,130,130,102,175, 92,185,146,144,203,229,200,203,203,163,102,204,152, 49,
+109,120,207, 89,235,182, 30,250,238, 69, 69,245,250,180, 25,203, 13, 9, 9,169,186,106,213, 42,200,100, 50,228,231,231, 19,211,
+167, 79,247,157, 20,182, 36,101,245,222,153,118,179,148,246,176,251,139, 13, 10, 10, 58,210,173, 79,196, 39,193,202,174,176,114,
+ 61,144,152, 78,224, 69, 18, 11,154,178,130, 4,131, 63,174,197,178, 36, 73,238,116,224, 66,196, 46, 50,217,165,254,163,190,169,
+ 95,163,126, 91, 28,190,111, 1, 99, 51, 33,243,225, 81,104,159, 95,195,155,215, 15, 76, 86, 99,222, 93,130, 32,206,209, 52,253,
+207,253,170,181,165,223,208,203,129,101, 1,134,101, 65,176, 4,192, 0, 0, 91,144, 6,168, 56,183, 14,158,121, 80,149,224,138,
+193,178,236,227,247, 17,248,119, 65,114, 56,202,249,147, 6, 99,230,198, 75,120,126, 53, 6,172,173, 32,253,223,166,221,234,177,
+ 60,154,183,218, 98, 49,125, 85,145,238, 0, 69,227, 33,124,137,173,210, 28, 15,119,207, 97,202, 30, 17,172, 68, 42, 99, 51,181,
+ 70,203,203,231,127,224,201,245,195, 35,155, 54,152,180,242,198,221,213,229,234, 93,188, 52,241,117,136,114,121,173,164,231,175,
+ 38, 15,155, 48,187,127,135,182,205,133,125,122,118,145, 18, 4,129, 3,135, 79,229,159, 81, 93,209,179, 44, 14, 48, 12,179,226,
+194,185,168,100, 71,236,114,147,112, 49,113,115, 34, 44,182,130, 86,132,135,156,135,133, 63, 61, 3,159, 75,166, 52,201, 91,182,
+114,246,167,150,113, 59,207,154,247,204, 59,228, 19, 10,151, 71,219,212,201,191,231,149,165,229, 33,227, 98,194,166, 71, 16, 10,
+104,200, 68, 92, 80,196,191,190, 19,239, 58,255,113,203,111,158, 5,160, 86,107, 84,165, 58,255,198,141,231,174,150,187,123, 68,
+118, 26, 52,157,168,238, 83, 25, 85, 92,249,240,174,213, 20, 33,173,154, 17, 0, 96, 48,153,137,203, 87, 19,124,247, 71,111,218,
+219,184,222, 44,151, 91,247,191,219,108,239, 90,245,122,189,111,108,108,172,205,221,211, 51,163,199,144,121,171, 69, 18,153, 87,
+248,144,225, 92,207, 42, 94,200,201,209,184,198,197,157,234,248,217,136,111, 27,236, 93, 29, 21,105,181, 90,169, 5, 11, 22,148,
+155, 29, 33, 73,210,119,243,230,205,242,232,232,104,240,249,124, 8,133, 66,136, 68, 34,136, 68,162,183,254,239,215,175,159,221,
+ 46, 19,155,205, 6, 14,135, 3,146, 36, 11,210,106, 0, 56, 52, 13,138,166, 81,244, 46, 22, 57, 88, 71, 2, 0,147,201,132, 1,
+ 3, 6, 0,128, 93,231,239,136,195, 54,153, 76,160,105, 26, 53,253, 42, 99,110,239,166,104,107,182, 66,151,198,128, 76,203,199,
+ 48,155, 13, 9,129,129,248, 94,163, 65,114,126,190, 67,246, 89, 44,150, 86, 53,106,212, 72,126,248,240,161,247,141, 27, 55,228,
+138,122, 77,244, 79, 83,245,210,196, 55,222,213, 19,254,120, 99, 82,248, 74,181,215,175, 95,151,221,186,117,203, 91, 42,149,190,
+202,200,200,104, 97, 87, 20, 64,149, 42, 85,190, 89,186,116,233,236,240,240,130, 88,129, 97, 24, 52,106,212, 8,223,127,255, 61,
+217,182,109,219,153, 19, 39, 78,164, 1, 76, 43, 79,195,102,179, 53,105,221,186, 53, 97,100, 89,104,117, 22, 44, 25,222, 0, 28,
+138, 68,212, 15,183,145,157,163,129, 11, 1,112, 56, 28,178, 99,253,193,181,226,238,237,121, 98,207,166, 34,189,146,251, 76,102,
+ 51, 50,210, 51,144,153,153, 9,224,253,245, 76, 38, 19, 90,182,108, 9,134, 97,112,226,196, 9,240,120,188, 10,235,149,135, 66,
+174, 36,251,247,239, 79, 44,252, 97,252, 7,117,251,125,108,108, 54,219,108,169, 84, 74, 16,133,191, 21,130, 32,224,226,226, 2,
+179,217, 60, 23,192,136,138,234,241,120, 60,191,119, 51,112, 50,153, 12,153,153,153,254, 0, 28,238,138,178, 48, 6,237,243,155,
+127,250, 95,230, 72, 23,128,203, 75,189, 28,121, 73,238,160, 73, 6, 52, 69,128,166, 0,128, 64,214,139, 7, 48,229,103,157,223,
+115,106,133,221,116, 4,159,207, 95,250,143, 49,139,234,219, 42, 53,199,225,219,102, 88,114, 95,224,197,217,229,172, 62, 67,189,
+137, 32,136, 31, 89,150,189, 31, 19,183,202,226,232, 5,149, 6,195, 2,182,146,142,159, 1, 8,188, 87,109,216,243,162,127, 8,
+130, 72,249, 16,155, 62, 58,140,149, 43,119,115,135,149, 77, 6, 81,120,117,109,218,173, 30, 43,228, 9,214,143, 29,218, 7,223,
+255,240,211, 63,225, 96,119, 64,195, 58,163,252,165, 28,249,201,113,145,147,233, 65,125,187,227,198, 99,109,198,237,167,154, 92,
+ 49,105,160,188, 89, 30,197,146, 18,238,227,107, 7,166, 4,213, 25,155,121, 51,113,195,174,210, 52,186,116,253,225, 22, 69,211,
+153, 44, 67,206, 63,244,251,240, 72, 69,167, 61, 81,111,142,156,238,117,230,194,181,153, 4, 8, 74,155,175, 91, 38, 55,176,191,
+198, 94, 24,111, 86,182, 91, 94,183, 75,183,237,191,130,101, 60, 79, 30, 27,222,186, 60,219,210,181, 38,216, 88, 20, 59, 25,109,
+190, 21, 34, 62,149,210, 40,119,105,177,243,143,205, 9, 31,106, 52, 69, 87,241,151,127,102, 40, 75,135, 0, 64,146, 4, 36, 66,
+ 14, 68,124, 26, 82, 97,161, 51, 67,153,206, 63, 81,173, 81,101,148,166,213,168,238,172, 65, 18, 55,215,200,174,159,207, 33,124,
+ 61,164,168,226,198,135,151,155, 0,100, 97,144,105,181, 49,200,206,179,193,165, 74,109,180,239, 63,149,184,118,114,231,166,230,
+ 65, 95, 15,191,118,115, 81,115,123,159,133,209,104, 20,142,157,177,170,175, 88, 34,171,242,229,152, 9, 92,130, 32, 97,101, 88,
+ 8,165,110,104,219,165, 15, 39,254,196,239,238,131,199, 47, 28,209, 82, 33,142, 5,160, 47, 79,139, 97,152,151,163, 71,143, 22,
+ 95,191,126,221, 12, 20,220,132,138,254,150,236, 22, 96, 89,214,110,151, 0,195, 48,168,211,190,125,113,203,159, 18, 10,225,213,
+164, 73,113,203,159, 22,137, 32,168, 86, 13, 48,155,193, 41,116, 26,229, 97, 50,153,144,150,150, 6,146, 36, 63, 56, 0, 32, 8,
+ 2,102,179, 25, 2, 62, 15,113, 27, 66,144,246,216,130, 5,199,210, 16,123,227, 25,104,154, 70,207, 26,181,240, 15, 19,139,229,
+ 22, 26,195,133, 66,152, 89,251,247, 2,138,162, 76, 91,183,110,221,251,240,225, 67,233,166, 31,183,119,218,124,244,249,231,210,
+ 58,159,185,217, 88, 17, 95,245, 84,109,210, 60,136,205, 54, 62, 61,242,176,117,235,214, 7,253,253,253,181,203,151, 47, 47,183,
+136,175,117,173,190, 18,154,166,107,247,232,209,227,235,240,240,112, 36, 37, 37, 33, 50, 50, 50,255,206,157, 59, 41,245,234,213,
+171,242,253,247,223, 75,251,245,235,135,248,248,248,168,246,117, 7,197,210, 52,157,120,234,206,110, 77,105, 90, 12,195,240, 68,
+ 34, 17,140,133,119, 73,171,141, 5,192,128,101, 1,141, 86, 11,163, 57, 29, 60, 30, 15, 44,203, 6, 42,228,202,167,246,250,218,
+139,244,138, 72,205,210,225,209,179, 12,100,102,107,160,205,205,133, 86,243, 6, 92,137, 7,161,211, 37,189,151,158,197, 98, 65,
+126,126, 62,242,242,242, 64, 81, 20, 50, 51, 51,193,227,241,160,215,235, 21, 0, 42, 28, 0,132,117,154,210, 66, 44, 22, 71, 49,
+ 12,211,169, 69,139, 22,178,228,228,100, 12,239, 57, 43,151,162,168, 51, 58,157,110,229,158, 83, 43, 42,156, 53,254, 24,132,117,
+154,242, 28, 5,181, 67, 96, 89,214,172,213,106,177,113,227,198,226,231,205,102, 51, 24,134,249, 60,172,211,148,225, 36, 73,102,
+138, 68,162, 82,107,100,138, 24,212,113,114, 75,138,162,120,133,122,236,187,122, 70,163, 17, 4, 65,120,132,119,153,234, 9,192,
+114,253,250,245,203,229, 21, 65,151, 55, 18,192,110, 0, 64, 81, 84,223,187,199, 86,223, 8,176,192,219,179, 94,119, 0, 44, 10,
+110,171, 44,146,111, 31, 3,195, 48, 59,236,105,132,117,154,210,222, 39,160,249, 24,159,218, 45,113,248,150, 9,111,158, 28, 71,
+218,229,245,207, 25,171,121, 88, 76,220,170, 51,246,206,183,199,224,206, 81,253,228,149,170,192,104,102, 11, 3, 0,160,100, 16,
+240,255, 9,150,160, 76,153, 25,233,188, 26,213,252,224, 38, 28,130,155,167,119, 45,231,209, 4,182,175,158,137,196,215, 12, 56,
+ 92,142, 67, 17,113,195, 58,163,252,249, 92,225,201,109,219,119, 27, 27, 5,250, 75,215, 31, 74, 62,149,156,161, 51,228,101,189,
+ 20,229,103, 62,147,228,188, 76,244,200,211,164, 72, 57, 36,204, 22,138,250, 10, 64,169, 1, 0,205,229,186,117,239, 19,222,232,
+234,249,211, 77,186,118,219,162,169,194,154,150,114, 52,210,221, 7,207, 12,253, 5, 0, 20,242,120,210,214,232,126,207,206,221,
+118,206,246,240, 15,242,169,221,180,131,231,173, 51,251,236, 70,174, 83, 38,142,127,235,241,226, 77, 7,181, 61,170,168,222,114,
+254,158,190,181,124, 8,146, 46,247,122, 9,146, 64,118,158, 5, 34, 62, 13,137,144, 3,137,144, 6, 73, 18, 21,118,254, 0, 96,
+176, 9,126, 23, 89,140, 22,237,203, 27,220,166, 1, 93,225,229,202, 47,168, 41, 0, 96,179,177, 72,215,154,144, 81,184,177, 60,
+ 25, 58,246,159,140, 67,219,230, 5,217,187,214, 34,254,120,145, 25, 60, 40,124, 40,143, 32, 8, 88,109, 44,116, 38, 43,114,117,
+ 22,100,106,141,168, 92,163, 5,231,201,253,107,193, 0, 98,237,233, 28,184,176,161, 48,184,250,188,120, 95,239, 86,163, 47,182,
+110,221,186,206,141, 27, 55,138,131, 2,146, 36,189,195,187, 76, 77, 99, 89,182,204,209, 1, 12,195, 20,183,252,105,138, 2,205,
+225,252,169,229, 95,252,188,157, 22, 54, 65, 16,176, 88, 44,197, 25,133,147, 39, 79, 66, 40, 20,162,123,247,238,101, 6, 0, 4,
+ 81,126, 6,207,100, 50, 65, 32,224,129,227, 78, 33, 98,226, 21,100,228,232,138,237, 58,149,250, 10, 87, 5, 66,204,171, 28, 8,
+177,241, 21,222,152, 29,207,152, 6, 6, 6,190,153, 48,107,249,185,205,241,108,155,205, 83, 90, 20,221, 64,121,195,151,195,181,
+101,221,202, 42,119, 78,150,214,158, 70,104,208, 23,203,250,246,237, 59, 89, 32, 16,208,131, 7, 15, 6, 0, 68, 69, 69,229,221,
+191,127, 95, 17,119,111,207,235,144,218, 3, 42, 79,154, 52, 73,125,244,232, 81,217,208,161, 67, 9,157, 78,119,145,207,231,163,
+ 75,163,136,181, 39,111,239,138,124, 87,143,207,231, 63, 72, 72, 72, 8,174,209,168, 3,220, 93,184,152,189,253, 30, 88, 0, 34,
+ 46,139,180,148,231, 72,121,116, 9,213,170, 85, 19,240,249,252, 95,189,188,188,216,207,187, 78, 91, 88,181,106,213,133,101,181,
+146,139,244,188,188,188, 96, 50,153,160, 78,206,192,198,211,111,144,103, 36,192,178, 50,192,198,135,164, 82, 85, 62,105,121,179,
+151,203,229,146,161, 65, 95, 44,120,246,236,217,210,178,186, 42, 74,234,113, 56, 28,156, 62,125, 26,121,121,121, 48, 24, 12,200,
+201,201,193,237,219,183, 81,173, 90, 53, 65,245,234,213, 15, 14,238, 28,101, 75, 79, 79,255,246,229,203,151,139,237, 5, 22, 10,
+185,146,108,221,186,245,122,185, 92, 30, 30, 17, 17, 33, 8, 9, 9,161,248,124, 62,150, 47, 95,142,244,244,116, 89,231,206,157,
+123, 71, 71, 71,119, 25,241,233,236, 95, 61, 61, 61,135, 87, 52, 43, 16, 32, 11, 33, 0,224,177,246,220,251,142, 36,242,158, 57,
+115, 38, 76, 38, 19, 94,188,120,193,125,246,236, 25,244,122, 61,234,215,175,143,199,143, 31, 35, 39, 39, 7,193,193,193, 92, 23,
+ 23, 23, 28, 63,126,188,188, 26, 25, 0, 0,203,178,220,105,211,166,193,106,181, 34, 57, 57,153,120,246,236, 25, 12, 6, 3,234,
+215,175,143, 71,143, 30, 65,171,213,162,101,203,150,132, 76, 38,195,241,227,199,105, 20, 57,100, 7, 41, 89, 8,104, 55, 0, 96,
+ 89,182,141,220,221,219, 99, 84, 88, 87,196,222, 1,172,133, 45,108,179, 81,135,215,137,103,116, 38,147,105,127,121,231,247,105,
+ 51, 86,204, 23,138,183, 13,157, 48,151,248, 41,193, 4, 99,246, 51,188,190,180, 46, 25,140,181, 81, 76,220,170, 10, 21,208,148,
+198,224,206, 81,253,100,110,158, 49,115,150,109, 69,220, 99, 19, 24, 22, 32, 10, 2,227, 2,254, 31,205,117,168,108,179, 98, 50,
+ 45, 16,242, 92, 36, 98,200,197, 38,136, 5, 53, 81,107,216, 36, 12, 86, 86, 70,138,193, 21,251,127, 89, 5,171,213,122,197,158,
+ 78,195, 58,163,252,121, 52,239,248,198,205, 63,190,172,171,168, 42, 90,119,248,197, 1,189,201, 98,227, 89,179, 68,185,111,146,
+137,148,135,113,213, 53,233,175, 56, 54,214,186,142, 34,233, 86, 44,203,120,149,167,231, 87,173, 22,252,170,213,114,205,123,163,
+117, 77,184,162, 90,117,239,214,213,233, 0,106, 1,128,119,243,164, 11,149,171,135,212,245, 85,180,144,138,196, 66,240, 56, 20,
+ 28,104,136, 97,205,186,245,240,174, 36, 64,174,222,134, 5,235, 98,181,221, 60, 84, 11,223,114,254,126,181,124,164, 82,169, 93,
+ 29,130,181, 62, 29, 54,246,107,150,162, 8,144, 36, 1,154, 36, 96, 53, 27,211, 43,234,252, 1, 64,253,104,182,174, 73,157,137,
+ 62, 23, 78,252, 18,119,235,220,239, 10,138,162, 40,177, 72, 72, 54,105, 30, 76,212,107,218, 30, 70,136,145,161, 53, 34,207,104,
+129, 84, 64,227,242,153, 88,164,167, 36,205,177,127,181, 5,188,121,147,239, 90,217,179, 10, 44, 54, 22,122,163, 13,218,124, 51,
+ 50,180, 70,164,100,233,241, 42,211, 8,189,193, 36,101, 89,246,189,250,180,104,154,246,221,180,105,147, 60, 54, 54, 22, 18,137,
+ 4,114,185, 28, 50,153, 12, 50,153,172,220,174, 0,150,101, 11,250,252,105,186,184,229,255, 70,173, 6, 71, 44, 46,110,249,211,
+ 25, 25,224, 72, 36, 14,165,216,205,102,115,113, 0, 48,102,204,152,226,190,249,247,237, 2, 48,155,205, 32, 41, 26,224, 87, 7,
+131, 43,111,117, 71,208, 52, 13,154,203, 69, 82, 64, 99,144,137,233,160,153,138,101,139, 31,167, 17,222, 22,134, 21,149,220,199,
+130,226,107,225,225,231,142,172,114,191, 43, 10,185,146, 12, 11, 11,155,176,113,227, 70,250,245,235,215,144, 74,165, 96, 24, 6,
+ 55,110,220, 72,139,187,183,231, 53, 0,156,123,244,115, 70,187,192,129,175,204,102,179,172,102,205,154, 24, 60,120, 48, 2, 3,
+ 3, 97, 52, 26,199,132,117,154, 18,181,247,244,202,183, 50,162, 26,141,102,217,194,133, 11,119,255,124,176,141,120,104, 91, 62,
+114, 52, 70,104, 52, 90, 60,186,119, 29,176, 89,176,106,245,106, 8, 5, 66, 0,160, 50, 50, 51, 48,123,214,172,185, 15, 31, 62,
+ 12, 5, 16, 92,154,141, 69,122,237,218,181, 19,107,181, 90,228,104, 52,200, 51, 18, 88, 58,162, 97,113,215,194,250, 13, 27,209,
+184,186, 68,248,226,197,115, 76,156, 56,241, 43, 14,135,211, 30, 64,103,123,122,158,158,158,160, 40, 10, 20, 69, 65,173, 86,195,
+ 98,121,219,190,244,140,116,106,218,212,169,223, 38, 36, 36,116, 1,160, 44,239,189,108,213,170,213,220,154, 53,107, 70,172, 93,
+187, 86,152,152,152, 8,189, 94,143, 11, 23, 46, 96,249,242,229,248,236,179,207,224,237,237, 77, 30, 56,112, 64, 60,105,210,164,
+254,137,137,137, 25, 0,236, 22,220, 21, 58,125, 46, 10,156, 49, 9,128, 13,144,133,216, 34, 35, 35,153,181,107,215, 18, 69,251,
+ 0,216,212, 26,149,185, 60, 45,130, 32,160,215,235, 17, 29, 29, 13,130, 32, 48,100,200, 16,252,246,219,111,216,189,123, 55,154,
+ 53,107,134,177, 99,199, 98,199,142, 29,246, 76, 42,134,166,105, 24,141, 70,236,222, 93, 48,106,114,232,208,161,136,141,141, 45,
+214, 27, 51,102, 12,182,111,223,238,176,222,187,148,204, 8,148,251,139, 29,220, 57,170,159,139, 91,149,152,175, 22,111,161, 15,
+220,166,144,147,250, 8,134,244, 71,240,107,210, 27,105,234,139, 96,109,150, 95, 15, 92, 40,191, 72,140,207,231,207,232, 59, 98,
+190,255,249,103,124, 24, 76, 6,164, 95, 92,206, 48, 86,243,144,125,103, 86,127, 20,231,239,226,234, 17, 51,107,233, 86,250,247,
+123, 28,100,165, 60, 66,226,193, 25,176,153,255, 84, 62,224,112,117,182, 66,174, 36,154, 52,105,226, 21,224, 37, 4,201,227,227,
+ 18,224, 57,251,203,117,212, 95,221,215,212, 58,100,117, 36, 95, 32, 88,249,227,242, 25, 56,114,159, 69, 78,118, 14,104, 24,224,
+230,237,133, 99, 9,217,136, 59,177, 27, 73,127, 60, 54,165, 64,214,181, 60,157,134,117, 70,249,243, 40,238,209, 21, 43,215, 94,
+107, 88, 79, 65,255,122, 37, 45,158,207, 37,108, 60,142,136, 48,103, 26,100,132, 53, 15,218,140,151,222,111,228,108, 45,245,133,
+ 77,102, 0,223, 59,106,163, 68, 42, 67,187, 46,189, 68,234,251,183,132, 69,251, 8,146,227,230, 94,171,181, 20, 52, 9,171,141,
+ 5, 69, 58, 22,168,122,200,254,213,231,223,221, 51,126,229,187,206,223, 69, 42, 5,159, 75,217,213,137, 59, 62,172, 91,201,199,
+239,211,242, 47, 73, 66,226,247,153, 0, 26, 20, 61,110,220,112,182,231,147,164,103,115,221, 78, 30, 31,213,121,224,116, 18,124,
+ 87, 72,248, 5,206,255,193,249,253,115,238, 36,174, 94,236,208, 5, 3,144, 74,197, 57,217, 57, 26, 15,177,139, 59,180,249, 5,
+ 45,255,148, 44, 29,158,165,229, 65, 38, 36, 33, 20,240,222, 16, 4,241, 94,173,148,162,110,129,132,132, 4, 51,203,178,160, 40,
+170,184, 75,160,188,209, 1, 44,203,130,195,225, 20, 28, 95,184,175,180,150, 63, 77,211,160, 40,251,159,135,197, 98, 41, 62, 54,
+ 43, 43,235,131,107, 0,204,102, 51, 40,154,198,101, 9, 7, 44,135,122,203,249,115, 56, 28,144, 28, 14,146,252,234,128,124,114,
+ 6,180,173, 66,131,149, 16,224,201,166,196, 39, 66, 7,160, 56, 8, 32, 96, 51,202,144,110,183,152, 75,173, 81, 49,157, 26,132,
+175,155, 48, 97,194, 84,146, 36,241,249,231,159,163, 89,179,102,104,218,180,105,149, 46,141, 34,170,156,188,189,235,117, 72,237,
+ 1,149,131,130,130,188,185, 92, 46,238,220,185,131,157, 59,119,130,199,227,217, 46, 94,188,184,233,200,245,173,127,234, 14,141,
+127, 16,115,176, 87,240,168,223,135, 14,238,251,105,100,100,164, 88,196,231, 35, 61, 43, 9, 2,228, 99,236,164,185,120,154, 97,
+134,213, 86, 80, 10, 67, 17, 2, 76,155,253, 29, 57,115,242,232,230,131, 59, 71, 13,219,115,106,197,182,178,244,122,245,234,245,
+105,100,100,164, 88, 99,150,130,101,101,197, 93, 11, 37,169, 90,181, 42,182,109,219, 38,254,236,179,207, 90,118,106, 16,254,197,
+233,187,209, 59,236,233,241,249,124, 36, 37, 37,193, 98,177, 96,226,244,121,239,216, 39,196,156,133, 43,200,168,241,195,219,116,
+168, 23,246,197,153,251,123,255,164, 87, 4, 73,146, 35, 34, 34, 34,132, 18,137, 4, 2,129, 0,209,209,209, 88,179,102, 13,248,
+124, 62, 8,130, 40,174,105, 25, 58,116,168,112,198,140, 25, 67, 97, 39, 0, 80,200,149,141,199,140, 25,147,188, 97,195, 6, 6,
+ 5, 65, 0, 5,128,189,127,255, 62, 60, 61, 61,209,170, 85, 43, 54, 55, 55,151,156, 57,115,166,199,176, 97,195,184, 0,174,151,
+167,199,178, 44, 97, 48, 24, 96,181, 90,209,178,101, 75, 28, 56,112, 0, 81, 81, 81,152, 55,111, 30,226,227,227,225,231,231,135,
+214,173, 91,227,198,141, 27,229,201,148,132, 48, 26,141,197,122,177,177,177,152, 60,121,114,177,158,143,143, 15,218,182,109,139,
+235,215,203, 53,171,152,119,135,254,149,164,204, 0,160,200,249,207, 92,180,133,254, 57,129,132, 38, 53, 17,201,199,190,182,218,
+204,186,116,134,177,120,231, 60, 61, 15, 0, 59, 28,120,253,118, 85,170, 55,196,133, 91,102, 24, 18,127,129, 57,231,233,234,125,
+103, 86,255,169,130,185,162, 20, 57,255,175,151,108,165, 15,220,166,145,157,242, 8,127, 28,158,105,179,154,242,135,196,196,173,
+218,243, 62,154,159,119,157, 22,208,186, 89,147,109,225,158,150,214,189, 6,212, 0, 79,192,197,140, 39,116,215,251, 23,159, 93,
+ 27,212,113,242,208,152,184, 85,119, 63,212,238,247,161, 77,200,138, 9,124,158,224,251, 31,151,207,196,149, 20, 41,238, 61,122,
+138,171, 71,183,128, 36, 72,139,217, 98,226,240,120, 60, 27, 99,179, 93,231,231,230,117, 85, 95, 31, 83,102,255,112,195, 58,163,
+252,185, 36,231,240,244,175,231,252, 28,220,178,137,249,220,131,220,155,124,138,203, 8, 93,184,132,149,101, 72,120,120,104,180,
+175, 31, 27, 88,150, 96,220, 51, 88, 46,128,114, 35,223,114,120,171,149,106,181,177,197,206,159,162, 24, 48, 14,164, 0,180, 58,
+ 43,132,124, 42,165,113,137, 62,255,131,154,183,157,191,128,103,223,225,148,228, 93,231,255,213,207, 28,109,229,250,253,124, 56,
+ 2, 87,113,135,174,123, 0, 26, 32, 24,179, 46,238,216,208,179,142,106,222,186,179, 48, 13,192,216, 70,117,167,186, 36, 61,188,
+ 30,214,160, 85,247,146,206,127, 97, 69,236,171,233,231,126,249,236,233,147,221, 90,119,233,207,205,208, 26,145,146,169, 67,114,
+122, 65,124,109, 74,187,107,149, 10,168,203,229,157,223,183,237,184,139,173, 90,181,170, 83,114, 24, 96,161,131, 79, 57,112, 97,
+ 67, 97,138,255,243,242, 36,254, 4,203,178,197,213,254,111,212,106,208, 34, 17,132,213,171, 23,183,252,105,177, 24, 70,185, 28,
+ 70,147, 9, 46,250,114, 75, 19, 0,160,184, 11,128,162,168, 98, 39,191,115,231, 78, 72, 36, 18, 12, 29, 58,180,194, 1,128,197,
+ 98, 1,197,161,240, 27, 87, 13,112,232, 63,101, 0, 72,154,131,100,183,170, 32, 56, 52,104, 27,109,183, 75, 1, 0,204,102, 51,
+121,251,246,109,215,164, 23,175,221,170,112,155, 94, 26,185,242, 74, 27, 27, 67, 8, 8,216,140, 2,221,163,179,105,233,215,249,
+102, 49, 87,230,235,235,251,166, 60,157,211,119,163,167,125,210,100,232, 66,189, 94, 31, 96, 48, 24,174, 52,107,214,140, 92,177,
+ 98,133, 56, 50, 50, 82,221,177,254,224,212,198,141, 27,123,173, 94,189, 90, 2, 0, 59,118,236, 96,227,227,227,219,240,249,252,
+ 7,199, 18,182,151,217, 56,250,237,242,230,193,157, 27,126, 62,106,234,212,169,139, 9,130,224,123,120,120, 8,142, 29, 59,134,
+ 23, 26, 51, 22,239, 47, 57, 50,128,196,240,182, 28,116,239,222,157,220,182,109,219, 28, 0,127, 10, 0,222,213,227, 87,174, 45,
+244,110, 59,133, 55,123, 71,193,180, 29, 50, 17, 7, 84,225, 48, 42,173, 86,139,172,172, 44,132,133,133,137,215,174, 93, 59, 5,
+101,220,251,223,181,175,114,229,202,130,163, 71,143,226,149,182,116,251,122,247,238, 77, 38, 37, 37,125, 93,150, 30, 0,232,245,
+250,225,223,124,243, 77,108,141, 26, 53, 4,117,235,214, 69, 86, 86, 22, 66, 67, 67, 1, 0, 66,161, 16, 65, 65, 65, 72, 79, 79,
+199,220,185,115,117, 70,163,113,120,121,159, 73, 33,169, 91,182,108,169, 53, 96,192,128,212,118,237,218, 81, 0, 56,153,153,153,
+ 68, 86, 86, 22,235,227,227, 67, 70, 68, 68,208,190,190,190,146,240,240,112,218, 98,177, 60,115, 64, 15, 70,163, 17, 36, 73,162,
+113,227,198,216,189,123, 55, 22, 45, 90,132,187,119,239,194,211,211, 19, 47, 94,188,192,240,225,195,113,243,230, 77, 71,164,138,
+245,104,154, 46,214, 51, 26,141,184,119,239, 30,170, 84,169,130, 87,175, 94,225,203, 47,191,116, 40, 0, 40,154, 0,168,100, 17,
+ 32, 96,103, 42,224,193,157,163,250, 73, 93, 61, 99,166, 45,252,145,222,115,157,132, 54,245, 33, 82, 78,206,178,178, 86,195, 32,
+146, 36, 47,188,184,248,195,126, 0,186,132,132,132,179,229,189,184, 66,174, 36,155,182, 12,105, 76,241, 37, 96, 89, 61,244,175,
+ 46,129, 36,201,127, 58,252, 46,148, 65,145,243,159,185,120, 11,253,243, 77, 26, 57,169,137, 72, 62,250,149,205,102,214,189,151,
+243, 31,245,217, 60, 58, 47, 47,111,106,125,145,237,155, 40,127, 51,215,135,199,226,193,198, 25, 72,172, 42, 69,253, 96, 17,170,
+ 5, 50, 65, 87,142, 26, 18,194, 58, 77, 89, 98, 52, 26, 23, 28,184,176,225,125, 29, 99,133,105,163, 92, 57,142,199, 19,172,249,
+ 97,249, 12, 92,122, 41,193,221,135,127,224,250,201,109,176,153,204,223,158, 59, 63,105,158,163, 58, 13,235,140,242,231, 16,228,
+161, 46,221,123, 47,236,211,243,147,156, 59, 79, 77,169, 98, 33,143, 17,242, 72,146,181, 17, 36, 73,130,144,137, 3, 72, 30, 12,
+ 25,247,111,157, 61,240,250,213,171,147,141,106,143,158, 98, 16, 24,110,171,111,237,116,120, 66, 38,160,160, 24,179, 8, 22,128,
+149, 97, 96,181, 17,160, 72, 6,180,205,177,178,204,173,167, 94,166, 54,215,175,124,203,249,123,248, 22, 58,127, 30, 5, 1,183,
+ 96,115, 52, 31, 94, 90,203,191,114,253,126, 62,209, 59, 55, 50, 94,149, 4, 82, 10,128, 70,103, 67,248,151, 51,237,106,189, 75,
+227,192, 41,243, 27,180,236, 26, 86, 63, 56, 20,151, 78,239,199,195,139,177, 21,118,254, 0, 16, 53,178,231,137,241,115,183, 53,
+142, 63, 17,235, 85,185, 86, 43,206,171, 44, 19,100, 66, 18,230,244,123,214,244,167,215, 50,218, 4,138, 15,149,119, 62, 69, 81,
+190, 27, 55,110,148,171, 84, 42,136, 68,162,226, 9,128,194,194,194, 62, 40,123,101,175,229, 95, 17,138,186, 0, 74, 6, 0,243,
+230,205, 3, 77,211,248,241,199, 31, 1, 0, 83,167, 78,173, 80, 6, 0, 44,129, 43,204,121,120,109,172, 7,236, 20,226,245,217,
+ 7,224,112, 56,168,210,162, 11,152,102,253,145,205,151, 65, 84, 56, 28,208, 30, 54,155,141,191,104,209,162, 16, 31, 31,159,172,
+150, 45, 91,190,234, 94,211, 43,249,245, 27, 82,245,205,146, 53, 35,155,212,175,181,197,133,202,203, 53, 72,120,156,215,175, 95,
+123, 60,121,242,164, 22,203,178,229, 78,181, 90,232,204,175,183, 11, 28,184, 40, 58, 58,122,118,120,120, 56, 14, 31, 62, 44,177,
+217,108,138,162,140,201, 47,191,252,130,131, 7, 15,174,136,127, 16,115,201,129,183, 16,167,238,236,222, 12, 96,115,175,224, 81,
+237,188,188,188, 78, 75, 36, 18,138,201,201,127,123,100,192,230,219,200,206,214, 66, 32, 20,130,203,229,250, 58,162,247,105,247,
+239,251,101, 93, 91, 31,189, 99,199, 78, 30, 0,144, 4, 1, 15, 25, 23, 90,173, 6,153,153,153,200,200,200,128, 80, 40,132, 78,
+167, 11,112, 68, 79, 89,231, 31,237, 3, 3, 3, 79,185,184,184, 80, 47,180,101,219, 39, 22,139,171,149,167, 23, 19,183,234,196,
+144, 79,102,140,141,136,136, 88, 31, 17, 17,193, 29, 50,100, 8,125,233,210, 37, 88, 44, 22,180,104,209, 2, 91,182,108,177,198,
+196,196, 88, 45, 22,203,212, 61,167, 86,252,110,239,253, 83,107, 84,233, 10,185,146,211,185,115,103,191, 54,109,218,152, 63,249,
+228, 19,180,107,215, 14, 54,155,141,120,240,224, 1,117,229,202, 21,242,210,165, 75,164,213,106, 77, 86,107, 84,142,204, 72, 75,
+152,205,102,136, 68, 34,168,213,106,116,236,216, 17, 71,142, 28,129,167,167, 39, 60, 61, 61,209,169, 83, 39,220,185,115, 7, 82,
+169,212,161, 0, 20, 40, 8, 0,248,124, 62, 30, 61,122,132,246,237,219,227,216,177, 99,168, 82,165, 10, 60, 61, 61,209,185,115,
+103,220,186,117, 11, 50,153,204,174, 78,213, 32, 17,191, 66, 25,128, 65, 29, 39,119,149, 85,242,138,153,186,240, 71,122,231, 21,
+ 10,218,212, 7,200, 60, 51,219, 10,155,113,208,158, 83, 43,126, 41, 60,172,173, 35, 23, 17, 20, 20,164,168, 86, 55,236,211,212,
+254, 0, 0, 32, 0, 73, 68, 65, 84, 88,148,158,203,128,101,172,176,105,159,165,237, 57,185,188, 66,147,145,148,106,159,155,103,
+204,244,239,182,208,123,111,208,208,164, 60, 68,202,201, 89,239,237,252, 7,117,156, 28,202, 37,137,221,145,190,230, 74, 61,221,
+173,176,177,192,238,215, 28,196,220,186,172,178,128, 53,212, 11, 22,132, 54, 8,225,163,211, 32, 17,253,244,174,121,246,181,147,
+152, 52,168,227,228, 65, 49,113,171, 14,127,200,117, 56, 10, 69,114,214,110, 90, 54, 29, 23, 94, 72,112,247,193, 99,220, 60,181,
+ 3, 22,139,121,238,133,243,147, 23, 84, 68,135, 38,200,174, 2,161,112,244, 55,147,190,189,158,102, 3,233,129, 76,100,210,254,
+132, 64,248,154,128, 87, 21,112, 51,211, 9, 99, 30, 73,122, 85, 11, 34,154,175, 59,126,119,202,164,158, 65,169, 47,146, 39,145,
+ 70, 65,173,166,117,198,196,220, 72,220,184,188, 52, 93,198,106, 33, 50,211, 83,225,238, 81,178, 76,160, 68,250,144, 45, 40,144,
+179,146, 12, 40,146,128, 62, 47, 23,140,197, 82,238,175, 64,226,230,189,191,105,254,170,155,179,123,151,104,249,251, 22,244,249,
+ 11,120, 84, 65,235,159, 75,129,207,163,224, 72, 4, 80, 86,218,159, 35,112, 21,123,184,112,165,227, 54, 60,128, 72,192,129,171,
+136, 11,170,130,171, 99, 52, 14,156, 50,191,126,203,174,243,154,118, 14,195,249,223, 55,227,241,237, 11, 21,118,254, 22,139, 37,
+ 39, 50, 50,146,158, 49, 99, 6,127,221,252, 97, 75,254,249,227,161,110,119, 78,109, 9,206,125,147, 47, 23,240,185,185, 18, 62,
+121, 77, 25, 40, 62,164,211,229, 89,207, 92,186,100,178, 90,173,101, 85,137, 23, 79, 4, 4,224,189, 39, 0, 42,137,213,106, 5,
+ 63, 59, 27, 36, 73,130, 95,216,101, 64,230,229, 21,143, 38, 32, 73, 18,114, 99,193,125,133,117, 32,179, 99,179,217,222, 74,209,
+115, 56, 28,104, 52, 26,112, 56, 28, 44, 92,184, 16, 36, 73, 98,233,210,165,240,241,241, 65,106,106, 42,142, 29, 59,102,215, 62,
+ 48, 0,247,115, 55, 8,199,184, 0,163,106,162, 94,207, 81,200,125,227,143, 59, 38, 49, 2,243, 31, 65, 30, 55, 31,102,198,234,
+ 80, 0,192,178,236,211,123,247,238,249,247,232,209,227, 94,189,122,245,180, 0, 32,225,179,153,185,143, 79,228,136,107,243, 50,
+104, 30, 15,174,174,174, 38,134, 97, 56, 55,111,222, 12,102, 24,198,161,177,221,175, 95,191,158, 55, 99,198, 12,230,242,229,203,
+179,134, 12, 25, 66, 5, 4, 4,224,201,147, 39,136,142,142,102,126,249,229,151,101,169,169,169,179, 29,209, 41,137, 64, 32,120,
+ 92, 52,214,190,248,253, 40, 26, 25, 0, 64,155,171,133, 53, 39, 13, 12,195, 56, 52,186, 74,255,242,250, 37, 27,143,199,214,175,
+250,175, 97,103, 26,141, 6, 25, 25, 25,197, 1,192,235,215,175, 65, 81, 84,153,163,110, 74, 66,146,228, 31, 70,227,219, 62,167,
+ 52,251,108, 54,155, 93,251,118, 30, 91,186, 35,188,203,212,235,187,118,237,154, 78,146,164,210,104, 52,122, 2, 96, 79,157, 58,
+149, 98,181, 90,227,141, 70,227,234,232,147,203, 31, 56, 98, 23, 0,168, 53,170, 87, 10,185, 50,251,234,213,171,149,238,220,185,
+ 35,159, 53,107,150, 4, 0,120, 60, 94,190, 78,167,203, 1,144,165,214,168, 28,186, 78,160, 32, 16,149, 72, 36,120,242,228, 9,
+190,252,242, 75, 84,171, 86, 13,207,158, 61,131, 82,169, 68,199,142, 29,177,121,243,102, 84,170, 84,201, 81, 57, 88,173, 86,136,
+197, 98, 60,121,242, 4, 35, 71,142, 68,173, 90,181,240,228,201, 19,180,111,223, 30,157, 59,119,198,134, 13, 27,224,238,238,238,
+144, 86,133, 70, 1,144, 36,249,117,171,126,115,232, 29,151,105,228,188,186, 7,237,185,185,239, 58,255,138,208,164, 94,227, 96,
+252,145,102,133, 45, 55, 25, 44, 99,117,184, 19,164, 28,190,106,221,127, 14,189,235, 26, 13,109,202, 3,100,156,153,243,222,206,
+191,144, 57,103,166,246,171, 4,198,138,219,135,247, 97,213, 11, 94, 94,146,129,152,146,144,144,176, 85,173, 81,177,131, 58, 78,
+ 14,127,161,182,172, 13,238, 46,144,245,253,108, 16, 62,235,109, 21, 79, 29,190,107, 22,128,255, 72, 0,192, 2,216,120,244, 37,
+108,224,224,238,153,157,176,154,205, 95, 95, 56, 63,217,225,126,229, 34, 18, 30,110, 44, 28,143,126, 14, 94, 0,208, 8,240, 66,
+209,189,235, 73,225, 32,150,127,241,219,177,105,103,225,192, 12,101,122,125, 94,191,125, 59,214,109,241,175,174,240,238,240,201,
+103,114,145, 88, 10,150,253,151, 91,102, 81, 48, 60,142, 96,204, 72,123,112, 62, 59, 47,253,241, 35,107,126,238,200,178,244, 10,
+157,245,225,233,189, 21, 11,222,114,254, 46,210,226, 86,127, 81,250,223,145, 26,128,242,250,252, 59,116,221, 3,138,164, 32, 21,
+112,224, 34,226, 66, 46,230, 22, 14,113,117,140, 70,129,147, 35, 27,180, 12,253, 32,231, 15, 0,151,159,198, 30, 87,200,149,222,
+ 35, 71,142,108, 29, 28, 28, 44,136,140,140, 60,236,226,226,114,248,213,171, 87,175, 79,157, 58, 85,197,104, 52,226,226,197,243,
+230,231,207,159, 27, 13, 6,195, 5,181, 70,245,170, 52,157, 95,206,173, 43,172,254, 31,252,167,231, 74,118, 15, 0, 40, 26, 6,
+104,119, 34,160,173, 27,231,226, 81,146,222,161,194,205, 34,221,242,176, 90,173,224,112, 56,127, 42,254,163,105, 26, 90,173, 22,
+ 28, 14, 7,107,215,174,133,139,139, 11,222,117, 30,165, 81, 84, 83,160,123,145,143,167,115,110,131, 47,122,130,218, 93,164,144,
+112,158, 32,224,252, 1, 88,173,102,160, 2,243, 20,220, 77, 59, 25,170,144, 43,187, 71, 69, 69, 45,170, 85,171,214,139,121,243,
+230,197,249,250,250,234,139,174, 75,171,213, 10,227,227,227, 59,100,101,101, 85,179, 90,173,179,212, 26,149,221, 22, 39, 80, 80,
+ 19, 0, 96, 94, 72,237, 1, 71, 53, 26,205,149, 33, 67,134, 96,215,174, 93, 56,115,230, 76, 71, 85,226, 79,103, 29,209,120,151,
+125,103, 86,167,142,236, 53,199,168, 86,171, 69,148,208, 7,149, 36, 52,102,109,191, 7,128,133,144,203, 34,239,141, 22,154,148,
+ 20, 88, 44,150, 59,142,232,157,190, 27,157,218,189,217,112,221,195,135, 15,249,129,129,129,200,201,201, 41,118,252,153,153,153,
+200,202,202, 66, 86, 86, 22,203,229,114, 19, 28,209,139,127, 16,243,114, 64,187, 72, 75, 98, 98, 34, 69,137,253,202,180, 47, 47,
+ 47,207,161,220,120,161,131, 31,226,200,177,142, 80,232,224, 95, 22,110, 31, 2,161,215,235, 33, 16, 8,192,178, 44,118,237,218,
+133, 70,141, 26,161, 71,143, 30, 72, 76, 76,196,230,205,155,139, 51,114,142,146,151,151, 7,177, 88, 12,171,213,138,221,187,119,
+163,113,227,198, 8, 13, 13,197,163, 71,143,176, 97,195,134,226, 41,190, 29,229,249, 77, 93,241,168, 21,171, 9, 30, 53,130, 69,
+ 38,160,244, 26, 0,225,133, 4, 53, 72,126, 58,222, 92, 89,246, 33,206, 31, 0,240, 58,199,128,151,124, 43, 44,217,143, 64, 16,
+132, 67, 95,156,242, 32, 8, 66,122, 62,225, 9,104, 65, 22,180,151,151,218, 24,139,254, 67,156, 63, 0, 88,192, 88, 97,138,223,
+139,137,106, 97, 38, 3, 52,220,123,122,229,235,162, 39, 99,226, 86, 69,247, 87, 78, 56,121,124, 23,115,175,147,210, 90,249,110,
+210,111, 32, 8,226, 63,214, 5,192,176,182,241, 9,167,118,175, 7, 0,150,181, 77, 59,127,126,114,169, 45,241,191,138,115,170,
+ 41, 87, 1,212,111,215,110,109,159, 23,207,158,172,104,208, 52,216,141,101,153,226,177, 23, 12, 99,163, 52,207,174,230,235, 82,
+239,188,180,154,117,145,231,206,140, 59, 93,158,222,164, 1, 1, 93,166,135, 23,204,240, 55,247, 55,159,142, 70,211, 46, 31,130,
+ 44,251,198,205,225,112,114,146,253,147, 75,173,238, 82,200,149,252,114, 11,254,104, 32, 75,103,134,139,136, 11,169,152, 11,169,
+148, 3,170, 2, 41, 0,174, 64, 48, 57,168,125,255, 15,114,254, 69,168, 53,170, 20, 0, 63, 43,228,202, 26,151, 46, 93,106,209,
+187,119,111, 94,171, 86,173,200,132,132, 4,107, 98, 98,162, 73,167,211, 93, 85,107, 84,127,188,175,126, 81,247,192,229,203,151,
+ 33,149, 74, 33,147,201,236,118, 13,112,185,220,228,169,195, 60,107,238,141,243,133,141,113, 44,117,153,148,148,244,198,221,221,
+189,204, 22,157, 94,175, 47,213,249,151,124,156,151,151, 7,163,209,232, 80, 23,128, 78,167, 3, 69, 81,197, 26, 4,195,224,233,
+233,253,127, 30, 13,224,224, 76,128, 0,160,214,168,142, 40,228,202, 99,137,137,137,225,225,225,225, 51,155, 55,111,126,135,101,
+ 89, 50, 46, 46,174, 93, 74, 74, 74, 99,150,101,151,218,108,182, 93,239, 51,167,189,197, 98, 73, 36, 73,210, 86,187,118,109, 74,
+ 32, 16,192,102,179, 61,170,168, 70, 73,244,122,253,196,121,243,230,109,158,191,104, 37, 53,168, 57,137,156, 28, 29,180, 90, 45,
+242,222,228,130,178,229,225,214,173, 91, 86,171,213, 58,186, 2,122,211, 70,143, 30,189,118,223,190,125,162, 55,111,222, 20, 59,
+255,236,236,108,232,245,122,196,198,198, 26, 10,167,243,117,136,156,156,156, 41,243,230,205, 91,251,237,146,213,127,182,143,201,
+199,229,203,151,109,249,249,249,127, 26,242,248,223, 4, 65, 16,105, 39, 78,156,240, 44,122,204,178, 44,174, 94,189,138,141, 27,
+ 55,130, 36,201,226,130, 91, 0,160, 40, 42, 7,229, 12, 1, 44,212, 51,159, 62,125,186,120,182, 82,171,213,138, 27, 55,110, 96,
+227,198,141,197, 65,108,137, 96,214, 10, 59, 67, 0,159,223,212,105,173, 38,248, 1, 40,112,250, 60,164, 63,189,172,243,168, 17,
+ 44, 50,253,105, 49,160,240, 46, 83, 91, 49, 12,179, 4,128, 7,128, 41,123, 79,175,124,239,249,205,195,187, 76,245, 5, 71,122,
+155,231,211,202,213,248, 66,149,199, 90,116,245,246,158, 94, 89,225,233, 16, 75, 50,176,195,164, 16,138,162,150,176, 44,235,206,
+178,236,244,152,184, 85,118,199, 69,151, 71,209,194, 63, 36, 73, 18, 12,195, 44, 46,107,225,159,191,251, 2, 65,127, 7, 20, 95,
+174,163,124,158,211, 99, 57, 20,167,203,241,163,195,123, 2, 64,187,206, 91,247, 50,172,229, 76,122, 66,204, 86,123, 43,246, 41,
+228, 74, 98, 80, 23,191, 30,141, 3, 92,170, 76, 95,119,239, 1,128,187,106,141,170,204, 25,254,236,218, 35, 87, 86, 55,170,250,
+110,223,122,232,217,153,210,170,253, 59,126,178,189, 29,151, 35, 16, 81, 52, 64, 83, 0, 69,209,176,154, 12,186,223, 98, 63, 63,
+235,136,126,163, 58, 19, 7,210, 92,254, 2,171,217,188,241,118,226,170,149,239,107,103, 41,118,147, 98,177, 56,144,203,229, 42,
+ 76, 38,211, 99,157, 78,247,224, 67, 23, 80,233, 23, 50,190,120,165, 64,224, 95, 25,128,242, 86, 7, 12,239, 50,213,147,199,227,
+ 93, 52, 24, 12,213, 29,121, 13,129, 64,144,162,215,235,219,197,196,173, 42, 53, 80,233, 80, 47,236, 57,203,178, 21, 90,188,135,
+162,168,204,151, 47, 95,150,186,120,207,251,232,145, 36,153,249,234,213,171,138, 44, 6,196,165,105,122, 2,203,178,163, 89,150,
+221,196, 48,204, 58, 71, 22,138, 42,143,208,160, 47,254, 25, 28, 28, 60,225,194,133, 11,155, 78,221,217, 61,233, 67,180, 0,224,
+139,110, 51,127,174, 84,169, 82,159,246,237,219, 83, 18,137, 4,217,217,217, 72, 79, 79,199,157, 59,119,172, 58,157,110,230,174,
+227,203, 42,180, 78, 72,207, 22, 35,119, 8,133,194,126,131, 7, 15, 22, 9,133,194,162, 76, 0,123,228,200, 17, 35,195, 48, 51,
+142,223,220,177,182,130,122, 7,170, 87,175,254,105,151, 46, 93,222,178,239,218,181,107,214,212,212,212,175,142,223,220,241,183,
+106,212,124, 44, 20,114, 37,241,119, 88,165,180, 48, 0, 40,110,245,151,124,252,111, 95, 14, 56, 34,116,186,212, 98,177,116,178,
+ 90,173, 39,222,103,122, 95, 39,255, 91, 20, 46,239, 91, 25,128,254, 67,156,127,161, 22, 15, 64, 29, 0, 18, 20, 76,239,235,208,
+ 80, 63, 39, 78,254,221, 40,228, 74,242, 99,174,138, 55,184,115, 84, 55, 14,135, 51,159,166,233,186, 4, 65, 88, 44, 22,203, 85,
+139,197, 18,181,231,212,138,251,239,163,215,177,254,224,110, 46, 46, 46, 83, 45, 22, 75,125,146, 36,205, 0,174,106, 52,154,185,
+231, 30,253,252, 94,122,237,235, 14,234, 45,149, 74,231, 8,133,194, 64,150,101,205,122,189, 62, 33, 63, 63,127,202,153,251,123,
+111,191,143,158, 19,199,249, 75, 3, 0, 39, 78,254,106, 20,114, 37,239, 67, 91,109, 78,156, 56,113,242,223,200,211,203, 58, 30,
+205, 67,122,209, 99,171, 9,126, 53,130, 69,111, 0,192, 25, 0, 56,113,226,196,137, 19, 39,255,131, 84,112,208,147, 19, 39, 78,
+156, 56,113,226,228,191,141,162, 73,129, 0, 59, 19, 1, 57,113,226,196,137, 19, 39, 78,254,127, 80,214,100, 64,255,143,150,202,
+113,226,196,137, 19, 39, 78,156, 56,138, 51, 3,224,196,137,131,124,222,117, 90,154,205,102,243,168,232,121, 60, 30,239,197,246,
+ 35,139,171,254,187,245,156, 56,113,226,164, 36, 37,211,254, 37,215, 3,112,118, 1, 56,113, 82, 65,108, 54,155,199,217,179,103,
+ 33, 22,139,193, 48, 12,108, 54, 27, 24,134, 1,195, 48, 96, 89, 22, 12, 83, 48,170,171,228,148,184, 86,171, 21,161,161,161,165,
+ 46,167,252,177,245,254,147,132,117,154, 50,147,162,168, 72,155,205,118, 34, 33, 33, 97,216,223, 97,188,179, 19, 39, 78,222,166,
+188,105,128, 1,103, 6,224,127, 30,133, 92,217, 38, 32, 32, 32,246,233,211,167, 23,109, 54,219, 64,181, 70, 85,161,133,127,222,
+209,242, 5, 80, 29,128, 43, 10,102,233,207, 6,240, 76,173, 81,189,215,228, 79,129,181, 38,124, 74,241,164,131, 1, 54,136, 32,
+ 8, 51,203,226,170,217,144,251,163,250,233,186,114, 87,197, 43, 83, 47, 96, 98, 55,138, 39, 9, 7,203, 52, 39, 8, 82, 15,130,
+185,104,202,211,110, 82, 63,219,224,208, 84,169, 0, 32, 22,139,177,111,223, 62,112, 56, 28,112,185,220,226,191, 37,255, 47,249,
+183, 82,165, 74, 96, 89,182,204,174,182,143,173,247,159, 96, 96,135, 73, 94,254,254,254, 83, 23, 46, 92,232,182,107,215,174, 65,
+ 44,203,166, 0,168,240, 92,246,127, 71, 58,212, 11, 51,179, 44,235,216,148,129,133,112,185, 92,193,137, 10, 46,152,245,190, 40,
+228, 74, 1, 0,145, 90,163,202,114,224, 88, 87, 0,226,242,126,127, 10,185,210, 5,128, 84,173, 81,217,157, 14, 87, 33, 87,122,
+ 2,144,168, 53,170, 39, 21,177,217,201,223,151,255,234, 0, 64, 33, 87, 82, 0,250,112, 56,156,190,181,106,213,106,246,248,241,
+227,155, 86,171,245, 87, 0,191,170, 53, 42,135, 22,192, 40, 67,183,147,183,183,247,119, 41, 41, 41,235,212, 26,213,238,143,103,
+241,223,143, 58,117,234, 28, 56,121,242,100,165,253,251,247,247,154, 50,101,202, 63, 0,236,172,168,134, 66,174,228, 0,104,133,
+ 2,167,255, 16, 5,142, 31, 0,220, 0,212, 86,200,149, 53, 1, 92, 80,107, 84, 14, 77,161,172,168, 54, 81, 70, 11, 4, 49,161,
+159, 14,104,221,167,207,103, 18, 15,119, 55,104,242,141, 72,124,156, 28, 24, 27,179,173,119,195,250, 51,247, 27, 95,241,198,169,
+ 53,223, 56, 54,155,155,255,120, 57, 45, 20,239,251,164,215,128, 86,221,186,117, 23,187,186,186, 33, 83,107,192,163,199, 73,245,
+127,255,233,199, 1, 13,234,207,220,102,122,117,121,134, 35, 19,179, 48, 12, 99,119, 13,251,146,155,189,185,241, 63,182, 94, 17,
+ 29,235, 15,174,229,225,225,177,207,207,207,175,234,181,107,215,206, 18, 4, 49,211,102,179,205, 15, 10, 10, 10, 77, 73, 73,121,
+153,145,145, 49, 40,254, 65,140,195,211,208, 14,238, 28,181,143, 32,136, 96,134, 97,238,153,205,230,129, 90,173, 54,207,108, 54,
+187,141, 25, 51,134,247,199, 31,127,140, 9,235, 52,229,208,222,211, 43,175, 58,170,247,119,133,101, 89, 98,205,154, 53,224,114,
+185, 32, 73, 18, 54,155,173, 56, 51, 83,148,149, 97, 89,182, 56, 43, 51, 99,198,140, 15, 90,105,241, 61,112, 1,240,173, 66,174,
+220,164,214,168,202,156, 67, 95, 33, 87,214, 2, 48, 2,192, 6, 59,122, 28, 0, 11, 21,114,229, 78,181, 70,117,166, 28,189, 38,
+ 0,194, 1, 44,123, 15,155, 63, 26,227,250, 47,216,166,209,104, 86,237, 61,189,242,222,199,208, 83,214,249, 71, 32,203,178,207,
+207, 61,250,249,163, 78, 82,167,144, 43,201,254,253,251, 19, 11,127, 24,255,159,254,126,252,137,210,170,255,139, 30,219, 13, 0,
+ 20,114,101,101,146, 36,151, 84,175, 94,189, 69, 82, 82,210, 13,134, 97,102,170, 53,170,215,246,206, 43, 67,171, 57,128,222, 66,
+161,176,153,191,191,191,226,249,243,231, 79,116, 58,221,117, 0,191,171, 53, 42,135,150,194, 44,161,197, 19,137, 68, 39,102,205,
+154,165,236,217,179, 39,220,220,220,160,209,104,170, 31, 57,114,164,223,130, 5, 11, 46, 43,228,202, 78,106,141,202,254, 2,229,
+165, 80,189,122,245,173, 42,149,202,111,224,192,129, 91, 20,114,229,254, 15,105, 21, 23,218, 74, 1,104, 8,224,214,223, 41, 85,
+170,144, 43,107, 13, 29, 58,212,157,162, 40,116,233,210, 5, 0, 66,240, 30, 1, 0,128,214, 0, 82,213, 26,213,227,119,246,103,
+ 0,200, 80,200,149, 53, 10,181,203, 93, 7,160, 8, 90, 32,136, 93,184,120, 89, 72,171,166,117,201,216,203, 25, 56,241, 32, 29,
+ 28,138, 68, 37,151, 42,248, 98,226,183,242, 99, 7, 99, 34,174,158, 61,172, 3, 48,197, 33, 61,161,248,224,162, 37,255,108,211,
+168, 65,109,242,183, 43,153, 72,127,148, 13, 14, 77, 64, 42,244, 69,255, 49,223,185,158,250,117,235,232, 39, 12,163, 7, 96,119,
+121,229,162,197,108, 74,219,182,108,217,130,137, 19, 39,190,181,143, 36,203,111,172,151,167, 23,212,164, 9,212,143, 30, 85, 72,
+175, 8, 14,135, 19,115,246,236,217,186, 34,145,136,119,242,228,201,214, 63,252,240,195,245, 65,131, 6, 25,219,183,111,239,166,
+213,106,165,161,161,161,191, 0,168,231,136, 86,120,151,169,117,253,252,252, 58,127,251,237,183,174,113,113,113, 62,209,209,209,
+ 9,185,185,185, 63,174, 93,187,118,198,226,197,139,165, 95,125,245,149,235,132, 9, 19,246, 42,228,202, 90, 31,115,118,187,191,
+ 10,138,162,138,231,113,127, 55, 43, 83,114, 11, 10, 10,114,104, 5,196, 34, 20,114, 37, 85,181,106,213, 25, 20, 69,141, 48,153,
+ 76,190,124, 62, 63,197,102,179,237,112,115,115,251,110,239,233,149, 14, 53, 88,212, 26, 85,154, 66,174, 60, 0,224, 72, 19,223,
+238, 26,134, 97,188, 11,109, 78,201,203,203,171,175,214,168,108, 10,185,178, 62,128, 19, 0, 34,212, 26,213,115, 59,122, 89, 10,
+185,114, 19,128,131, 10,185,114, 80,105, 65,128, 66,174,108, 3,224, 87, 0, 61,223,247,222,255,177, 32, 8,162,155,187,187,123,
+143,176, 78, 83, 58,126,164, 32, 64, 68,146,100,237,144,218, 3, 30,125,104, 16, 16,214,105, 74, 11,177, 88, 28,197, 48, 76,167,
+ 22, 45, 90,200,146,147,147, 49,188,231,172, 92,138,162,206,232,116,186,149,123, 78,173,184,248, 17,236,173, 16, 37,171,255,139,
+ 2,129,146,251,202, 13, 0, 20,114, 37,191,114,229,202,103,126,254,249,231,186, 1, 1, 1, 72, 74, 74, 10, 28, 48, 96, 64, 75,
+133, 92, 25,164,214,168, 28,126,179, 20,114,165,136, 36,201,165, 67,135, 14, 29, 27, 22, 22, 70, 40, 20, 10,208, 52, 13,171,213,
+234,251,228,201,147, 14, 63,253,244,211,140,192, 74, 29,126,180,217,108, 81,142, 76,255,170,144, 43, 73, 30,143,183,111,243,230,
+205,202,150, 45, 91, 98,231,206,157,184,122,245, 42,211,188,121,115, 50, 34, 34, 2,254,254,254,193, 17, 17, 17,191, 40,228,202,
+158,106,141,170, 66, 17,152, 66,174,244, 15, 15, 15,247,163, 40, 10,173, 91,183,230, 94,188,120,177, 9,128,247,254,224, 20,114,
+165,196,221,221, 61,190, 67,135, 14, 77, 78,157, 58,117, 67, 33, 87,118,112,116,138, 91,133, 92,217,219,199,199,103,153,171,171,
+171,171,163,175,151,155,155,171,123,254,252,249, 84,181, 70,181,223,129,195, 91, 55,107,214, 12, 86,171, 21,174,174,174,240,241,
+241,105,171,144, 43,163, 92, 93, 93,251,228,228,228, 76, 81,107, 84,118, 91,116, 10,185,210, 7, 0, 89,228,252, 21,114,101, 53,
+ 20, 76,191, 11, 0,143,212, 26, 85,146, 90,163,122,170,144, 43,189, 21,114,165,159,189,238,128,192,218, 81,131,250,254, 35,188,
+105,147, 70,117,200,197,251,159,193, 98, 54,130,180,234, 65, 83,128, 73, 47, 6,203,186,161,121,251,126,252,196, 59, 87, 62, 87,
+ 84, 27,187, 75,253,108, 67,185, 83,137, 6, 6, 76,254,162,223,160, 33, 65,245, 2, 21,228,138,216,100,164, 61, 77, 96,146,111,
+ 28,202, 22, 74,228,100,253, 54,125,220,170,214,172,141,150,221,134,136, 83,147,238,142, 86, 84, 29,187, 91,253,124, 67,185, 11,
+238,148,215, 98, 47,185,198,253,199,200, 0, 0,168,144, 94,135,122, 97, 1,174,174,174, 11,172, 86,107,151,142, 29, 59,186,168,
+213,106,130,101, 89,200,100, 50,207,237,219,183,227,198,141, 27,184,118,237, 26, 76, 38, 19,167, 89,179,102,129, 61, 91,140,212,
+242,249,252,184,140,140,140, 57,170,196,159, 30,150,165, 75,211,244,235,236,236,108, 67, 90, 90, 26,250,244,233, 67,214,172, 89,
+ 51, 96,249,242,229,227,238,222,189,251,224,192,129, 3, 45, 62,255,252,115,178,109,219,182, 30, 70,163,177, 61,128,184,114, 47,
+248,191,128,162,207,145,162, 40, 52,105,210, 4,159,126,250, 41,106,215,174,141,151, 47, 95, 34, 62, 62, 30,106,181, 26, 92, 46,
+215,225,108, 12, 80,224,252,171, 85,171,118,177, 75,151, 46, 13, 34, 35, 35, 5, 85,171, 86, 69, 98, 98, 98,213, 13, 27, 54, 76,
+ 59,127,254,124,175,176, 78, 83,154, 87, 32, 8, 56,174,144, 43, 71,229,231,231, 31, 76, 78, 78, 38,120, 60, 30, 2, 2, 2,164,
+ 2,129, 64,211,216,251, 19, 86, 36, 18,241,116, 58, 93,132, 90,163,114, 40,224, 86,107, 84,151, 21,114,101, 95, 0,191,190, 27,
+ 4,148,112,254,131,212, 26,213, 53,135, 47,248,223, 4,135,195, 49,175, 95,191,222,119,204,152, 49,113, 31, 35, 8, 32, 8,130,
+161, 40,234, 33,128,192,247, 13, 2, 20,114, 37,217,186,117,235,245,114,185, 60, 60, 34, 34, 66, 16, 18, 18, 66,241,249,124, 44,
+ 95,190, 28,233,233,233,178,206,157, 59,247,142,142,142,238, 50,226,211,217,191,122,122,122, 14,175,104, 86, 32, 64, 22, 66, 0,
+192, 99,237,185,247,110, 60,150,204, 2,148,196, 94,115, 98,232,215, 95,127, 93,215,205,205, 13,163, 71,143,134, 72, 36,194,220,
+185,115, 3, 0,124,233,232, 11, 43,228, 74, 97,149, 42, 85,174,237,219,183,111,220,119,223,125, 71, 36, 39, 39, 99,222,188,121,
+ 24, 56,112,160,117,238,220,185,120,242,228, 9,230,205,155,135,253,251,247,143,244,246,246, 78, 80,200,149, 18, 7,100,135,205,
+155, 55,175,119,219,182,109, 49,114,228, 72,227,130, 5, 11,122,157, 60,121, 82,184,112,225,194,238,195,134, 13,211, 55,111,222,
+ 28,139, 22, 45,250, 4,192, 24, 71,237, 44,193,103, 74,165, 18, 0,208,182,109, 91, 0, 8,125, 15, 13, 0, 5, 89, 10, 23, 23,
+151, 67, 59,118,236,104,178,106,213, 42,108,223,190,189,169, 88, 44, 62, 84, 56, 71,189, 93,124,125,125,151,158, 57,115,166,214,
+241,227,199,221, 28,221,206,156, 57,227, 87,179,102,205, 37, 14,154,216,186,105,211,166, 56,122,244, 40, 0,160, 73,147, 38,181,
+ 86,175, 94,189,252,246,237,219,173,218,181,107,119, 94, 33, 87, 58,178,224,180, 63,128,196,194,235,173, 10, 32, 0,192,133,194,
+173,166, 66,174, 44, 90, 72,230, 17,128,106,246,196,104,174,112, 76,191, 62,189,197, 63,157, 75,135,197,100,128,127, 37, 10,237,
+155,250, 67,225,239, 9,214,164, 1,151,213, 65, 40,160,209,170,107, 88, 37,129, 68, 26, 97, 79,143,226,138, 70,254,163,127, 47,
+241, 47,151,210,241,234,193, 89,243,131,184, 45,135,115,211, 94,180,120,157,116,163,135,106,255, 50, 53,171, 75,133,191,135, 8,
+205,218,247,174,196, 21,240,251,217,211,179,217,108,197,206,120,215,174, 93,216,177, 99,199, 91,173,243,210,130,130,242, 90,137,
+ 37,245,148,235,220,208,106,149,180,220, 0,160, 60,189, 74,149, 42,109,157, 57,115,230,128,187,119,239,202,122,245,234, 69, 4,
+ 5, 5,161, 77,155, 54,168, 86,173, 26,140, 70, 35,106,214,172,137,222,189,123,195,219,219, 27, 65, 65, 65,196,222,189,123, 93,
+ 38, 78,156,216,167, 74,149, 42,101,118,115,133,117,154,178,215, 98,177,220,202,207,207,207,157, 59,119,110,234,185,115,231,216,
+230,205,155, 99,234,212,169, 94, 44,203, 10, 15, 31, 62,156, 73,211, 52, 58,117,234, 36, 34, 73,114,178,189,247,239,191, 1,155,
+205, 6, 30,143,135,160,160, 32, 68, 69, 69,193,106,181,226,252,249,243, 48, 24, 12, 8, 13, 13, 69,221,186,117,193,227,241, 28,
+206,198, 0,128,175,175,239,140, 78,157, 58,213, 91,179,102,141,128,162, 40, 36, 38, 38,194,197,197, 5, 11, 22, 44, 16, 54,111,
+222,188, 86, 78, 78,206,220,138,216,168,214,168,126,167, 40,202,230,225,225, 1, 79, 79, 79,232,245,122, 36, 38, 38, 74,158, 62,
+125, 42, 53,153, 76, 52, 0,135,150, 41, 46,161,119, 1, 64, 95, 0, 71, 20,114, 37, 91,184,101,224, 95,206,191,204,238,129,255,
+ 52,254,254,254,216,184,113,163,187,187,187,123, 92, 88,167, 41,245, 63, 84, 47,238,222, 30, 3, 69, 81, 15, 11, 51, 1,162,138,
+158,223,170, 85,171,185, 53,107,214,140, 56,112,224,128, 88,161, 80, 80,122,189, 30,167, 79,159,198,242,229,203,145,159,159, 15,
+111,111,111,178,240,185,254,169,169,169, 14, 45,229, 30, 32, 11, 33, 2,100, 33,188, 0, 89,136, 8,128, 24,128, 40, 64, 22, 34,
+ 88, 55,247, 23,158, 66,174,228, 43,228, 74,161, 66,174, 20, 40,228, 74,174, 61, 45,160,160, 24,176,106,144,136, 95,161,121, 0,
+220,221,221, 39,244,238,221, 27,235,215,175,199,239,191,255, 62,101,205,154, 53,232,214,173, 27,188,189,189,199, 23, 46,218,226,
+ 8,255, 92,181,106, 85, 96, 96, 96, 32,134, 12, 25, 98, 26, 57,114,100,212,246,237,219,171,159, 59,119,142,187, 99,199,142,106,
+163, 71,143,158, 56,120,240, 96, 67,141, 26, 53,176,118,237,218, 90, 36, 73,174,182, 39,232,233,233, 57, 57, 44, 44, 12,203,151,
+ 47, 71,124,124,124, 63,181, 70,245,187, 90,163, 50,169, 53,170,163, 23, 46, 92,248,116,209,162, 69,232,215,175, 31,124,125,125,
+ 43,180,210,150, 66,174,148,212,173, 91,119,206, 39,159,124,130,115,231,206,161, 73,147, 38,104,213,170,213, 20, 7, 29,225,187,
+ 90, 36,143,199,139,217,188,121,179,178, 86,173, 90,152, 54,109, 26,234,212,169,131, 77,155, 54, 41,121, 60, 94,140, 66,174,180,
+123,247,112,115,115,147,136,197, 98, 68, 70, 70,178,161,161,161,217,246,182,209,163, 71,179, 2,129, 0,110,110,110, 50, 59,182,
+ 81, 10,185,210,205,199,199, 71,233,227,227,131, 35, 71,142,224,198,141, 27,152, 63,127, 62, 6, 12, 24, 0,189, 94,143,136,136,
+ 8, 14,128, 65, 14, 92,106, 37, 0, 69, 5, 73,117, 1, 92, 86,107, 84,111,212, 26,213, 27, 0,151, 1,212, 46,124, 46, 27, 5,
+ 53, 1,229, 66,128,173, 37, 18, 9,241, 90, 99, 2,201,232, 80,205,219, 13,143,211, 44,208, 26, 41, 72,228,149,160,201, 78,131,
+111, 37, 62,124,170,214, 0,135,230,134,216,211,227,112,136, 26,124,190, 8,153,185, 22, 36,223, 60,154,107,213,229, 14, 87, 39,
+175,125,166,126,186,233,138, 73,151, 63,234,222,197, 35,154,106, 30, 2,248, 84, 83,144,124,161,184,131, 61,189,146, 45,246,209,
+163, 71, 99,220,184,113,248,225,135, 31,138,157,243,154, 53,107,176,106,213,170,183, 28,182,163,122,215,167, 27,112,103,182, 13,
+ 13, 23, 82,197, 1,128,175,159, 31, 60,171, 84,113, 72,143, 97, 24,183,198,141, 27,227,238,221,187, 72, 74, 74,130,217,108, 70,
+122,122, 58, 88,150,133,193, 96,128,193, 96,192,181,107,215,192, 48, 12,158, 62,125,138,219,183,111,163, 90,181,106, 48,155,205,
+165,126, 95,194, 58, 77,169, 93,173, 90,181,174, 63,253,244,147,223,144, 33, 67,106,155,205,102,219,202,149, 43, 83, 46, 95,190,
+ 12,165, 82,137, 14, 29, 58,212, 76, 75, 75,115,121,248,240, 33,218,182,109, 11,129, 64,208,208,222,251,247,223, 0,195, 48,224,
+241,120,248,244,211, 79,241,240,225, 67,188,122,245, 10, 20, 69,193,104, 52,194,104, 52,162, 73,147, 38, 21,206, 0,240,120,188,
+207, 35, 35, 35, 69, 73, 73, 73,200,202,202, 2, 73,146,176, 90,173,176,217,108,248,242,203, 47, 69, 60, 30, 47,188,162,118,114,
+185, 92,141,167,167,167, 65, 38,147, 25, 0,160, 40, 24,120, 95, 10,131, 0,194, 96, 48,152, 10,131,204, 74, 0,134,252,157,156,
+127, 17,127,167, 32,128, 36,201, 17, 17, 17, 17, 66,137, 68, 2,129, 64,128,232,232,104,140, 30, 61, 26,124, 62, 31, 4, 65, 64,
+ 36, 18, 65, 36, 18, 97,232,208,161, 66,130, 32,134,218,211, 83,200,149,141,199,142, 29, 43, 3,192, 7, 32, 4, 32, 2, 32,186,
+127,255,190,212,211,211, 83,214,170, 85, 43,105,221,186,117,165,187,119,239, 14,224,112, 56,229,254,230,170, 6,137,248, 5,195,
+255,116,198,162,173,100, 29, 64,153, 78, 72, 33, 87,118, 24, 56,112, 96, 29,134, 97,240,243,207, 63,223, 81,107, 84,171, 14, 28,
+ 56,112,213,104, 52, 98,208,160, 65,213, 1,124,226,192,133, 52, 31, 60,120,240,216,144,144, 16, 76,154, 52,201,124,234,212,169,
+166,106,141,106,165, 90,163,122,166,214,168, 88,181, 70,149,172,214,168,214,156, 61,123,182,241,132, 9, 19,140, 45, 90,180,192,
+ 23, 95,124, 49, 76, 33, 87,150,121, 99, 87,200,149,173,195,194,194, 2, 25,134, 65, 76, 76,204,109,181, 70,245,214,114,197,106,
+141, 42,110,255,254,253,151, 77, 38, 19,194,195,195,107, 40,228,202,142,246,236, 44,212,229,242,249,252,159, 23, 44, 88, 32,127,
+245,234, 21, 34, 34, 34,140,137,137,137,152, 63,127,190, 80, 38,147, 29,113, 48, 51, 81, 12, 69, 81,155,191,255,254,251,207, 90,
+182,108,137, 17, 35, 70,152,246,236,217, 19, 57, 98,196, 8, 83,155, 54,109,176,106,213,170,207, 40,138,218,236,168,214,203,151,
+ 47, 53,251, 85,107, 43,217,219, 94,188,120,145,230,192,117,202, 43, 87,174,124, 39, 36, 36, 36,179,121,243,230, 53, 1,224,198,
+141, 27, 25,219,183,111,103, 61, 60, 60,112,224,192, 1,172, 88,177, 2, 29, 59,118,132,139,139,139, 35, 1, 0,139,127,173, 71,
+ 93, 90,211,148, 45,229,184, 50, 33, 73,150,208,234,172,224,208, 36,104, 48, 72,205, 49,130,101, 1, 14,135, 4,135, 36, 64,194,
+ 6, 55, 9, 7, 92, 14, 13, 22,140,221, 26, 22,146, 32, 8, 77,190, 21, 52, 69,160,224,126, 77,150,176,193,202,242,121, 52, 81,
+ 73,202,129, 64,192, 7, 8,148, 59,100, 6,120,219, 97,111,221,186, 21, 63,252,240, 67,113,202,152, 36, 73,204,156, 57, 19,179,
+102,205,194,178,101,203, 42,220, 5,208,108,153, 0, 13, 23, 22, 56,248,162, 0, 32, 59, 43, 11,111,114,115, 33,145, 74,237,234,
+101,103,103,143, 28, 57,114,164,214,100, 50,161, 95,191,126, 80,169, 84,208,233,116, 48, 24, 12,168, 92,185, 50,140, 70, 35,116,
+ 58, 29, 46, 95,190,140,230,205,155,131,195,225, 96,206,156, 57, 90,173, 86, 91, 86, 70,239,117,118,118,182, 62, 45, 45, 13, 97,
+ 97, 97,228,226,197,139,125, 37, 18,137,104,243,230,205, 89, 54,155, 13, 95,124,241,133, 8, 0,253,244,233, 83,240,120, 60,184,
+187,187,115,250, 43, 39, 84,184, 5,245,119,163,232, 51, 9, 8, 8,128, 86,171,133,139,139, 11,164, 82, 41, 36, 18, 9,248,124,
+ 62, 60, 61, 61,139, 51, 0,142, 6, 1,102,179,185,170,175,175, 47,242,242,242, 32, 16, 8,138, 55, 30,143,135,218,181,107, 67,
+167,211,249, 84,212,206,194,101,154,159,152,205,102, 27,151,203,101, 61, 60, 60, 24,153, 76,102, 32, 73,210, 0, 59,107,206,219,
+193,136,130,181,227,205, 0,206,126,128,206,191,149,191, 75, 16,160,215,235,135,127,243,205, 55,134,231,207,159,163,110,221,186,
+200,202,202, 66,104,104, 40,122,244,232, 1,177, 88,140,160,160, 32,164,167,167, 99,238,220,185, 58,163,209, 56,220, 1,201,212,
+ 45, 91,182,212, 58,123,246,172, 4, 5, 1,128, 56, 51, 51, 83,154,149,149, 37,241,241,241,113,137,136,136,168,180,108,217,178,
+170,145,145,145, 98,139,197,146, 98, 79,172,168,245, 95, 90, 22,160,204, 0,192,197,197,101,201,168, 81,163,176,111,223, 62,228,
+228,228,172, 6,128,220,220,220,213,123,246,236,193,200,145, 35, 81,185,114,229, 37, 14,100, 1,186, 13, 26, 52, 8, 71,143, 30,
+197,233,211,167,231,168, 53,170, 82,151,146, 84,107, 84,234,115,231,206,205, 56,120,240, 32,194,194,194, 0,160, 91, 57,154, 93,
+ 66, 67, 67,113,228,200, 17,100,101,101,173, 47,237, 0,141, 70,179,225,183,223,126, 67,104,104, 40, 0,116,177, 99, 35, 20,114,
+101,160, 76, 38, 59,191,121,243,230,208,134, 13, 27, 98,210,164, 73, 6,179,217, 28, 58,109,218,180, 55,126,126,126,216,185,115,
+103, 51, 15, 15,143, 43, 10,185, 50,216,158, 86,161,222,162,239,190,251,110, 68,247,238,221, 49,110,220, 56,235,185,115,231,122,
+169, 53,170,181,231,206,157,235, 61,110,220, 56, 91,207,158, 61,177, 96,193,130, 17, 10,185,114,145, 35,122, 31, 19, 14,135,179,
+124,219,182,109,117,247,237,219, 71, 44, 91,182,140, 72, 76, 76,196,235,215,175,247,196,198,198,126,210,162, 69,139,187,227,199,
+143,159,123,244,232,209,151, 28, 14, 7, 33, 33, 33,205, 11,135, 18,149, 71,201,150,253, 3, 0,193, 10,185, 82,170,144, 43,165,
+ 0,130, 81,144,250, 7, 10,134, 6,230,216,179,143,101,200,103, 73, 47, 50,225, 42,230, 66, 32, 18,227,117,106, 10, 8,198, 8,
+ 88,116,208,107, 94,162,118, 13,127, 48, 44,144,249,234, 15,176, 12,115,193,158,158,217,106,123,245, 44, 37, 11,114, 49, 7,129,
+ 45, 63,149,114, 69,146, 13,138,128,177,158,138,234,163,235,241,197,178, 13,225,159,127, 46,179,216, 88,100,165, 62, 99,205, 70,
+125,188, 93,251, 88, 22, 28, 14, 7,219,182,109,195,132, 9, 19, 48,105,210,164,226,212,127,201, 26, 0,146, 36, 75,166,136,203,
+252,157, 20,233, 53,255,167, 16, 15,230, 19,120,178,168,160,119,232,221, 46, 0, 0,118,245,226, 31,196, 92,124,246,236, 89,255,
+177, 99,199, 30,233,212,169,147,102,226,196,137,198,118,237,218,177, 6,131, 1, 7, 15, 30, 68,126,126, 62,134, 12, 25,194,174,
+ 95,191,222,184,100,201, 18,205,138, 21, 43,142, 39, 37, 37, 13, 58,115,127,111,169,253,246,123, 79,175,204,213,106,181, 93,167,
+ 79,159,158,116,225,194, 5, 54, 56, 56, 24,163, 71,143,150,167,165,165,185,222,185,115, 7, 10,133, 2, 34,145,232, 77,126,126,
+ 62, 0, 64, 44, 22,211, 20, 69, 85,178,247, 30,254,221, 97, 89, 22, 60, 30, 15, 79,158, 60, 65,229,202,149,139,157,191, 88, 44,
+134, 72, 36,130,217,108, 6,143,199,179,219,189, 83, 18, 30,143,247,188, 40,237, 95, 50, 0, 16, 8, 4,120,253,250, 53,196, 98,
+241,171,138,218,169,214,168,242,243,243,243, 3, 19, 19, 19,197,247,238,221, 35,244,122, 61,155,155,155, 91,199,108, 54,123,169,
+ 53,170,247, 13, 0,146, 5, 2,129, 11, 65, 16, 60, 0,153,248,176, 64,226,223, 66, 94, 94, 30,158, 62,125,138,147, 39, 79, 98,
+244,232,209,121,102,179,153,150,201,100, 21,234, 66, 41,137, 66,174,164, 67,106, 15, 16,181,175, 59,168,146,213,106,173,199,178,
+ 44,201,225,112,170,219, 63,179,128,152,184, 85, 39,204,102,243,216,136,136, 8,253,246,237,219,173, 67,134, 12, 65,139, 22, 45,
+ 16, 20, 20,132, 33, 67,134, 96,203,150, 45,214,254,253,251, 27,117, 58,221,212, 61,167, 86,216,237,154, 81,107, 84,233, 22,139,
+ 37,181,115,231,206,126,237,219,183,119, 95,182,108,153,236,217,179,103, 46, 54,155, 77,254,224,193, 3,215,189,123,247,202,122,
+245,234,197,209,104, 52,207,213, 26, 85,234,251, 94, 55, 80,202, 40,128,194,138,245,209, 83,167, 78,109, 38, 16, 8,176,110,221,
+186,167, 0,162, 11,159,254,121,195,134, 13,115,195,194,194,234, 68, 70, 70,214,159, 61,123,246, 20,133, 92,185,186,172, 66, 59,
+ 46,151,219,180,110,221,186, 56,112,224, 0, 0, 28,176, 99,203,254,139, 23, 47,126,223,179,103, 79, 8, 4,130,102,229, 28, 87,
+221,207,207, 15, 7, 15, 30, 4,128,178,134,193,220, 76, 76, 76, 68,223,190,125, 65, 16, 68,185, 31,164, 66,174,236,221,181,107,
+215,253,139, 23, 47,166,165, 82, 41,134, 15, 31,110,186,114,229, 74,119,181, 70,165, 82,200,149, 29,194,195,195,207, 70, 71, 71,
+139,207,158, 61, 27,248,221,119,223, 93,172,227,214,126, 81, 98,118,124,153, 99,158, 21,114,229,176,233,211,167,127, 21, 17, 17,
+129,168,168, 40,246,200,145, 35,131,213, 26,213, 9,160,184,120, 39, 98,250,244,233,209, 43, 86,172, 32, 52, 26,205, 87, 10,185,
+242,165, 90,163,218, 88,154, 86, 94, 94,158,214,102,179, 85,201,203,203,115,104, 41, 91, 71,142,175, 93,187,118,183,160,160, 32,
+236,221,187, 23, 3, 7, 14,196,239,131,162, 61, 24, 0, 0, 32, 0, 73, 68, 65, 84,191,255, 14, 0,135, 11,211,124, 39, 10,175,
+ 65,246,240,225,195, 41, 93,186,116, 33, 15, 29, 58,212, 23,192,143,229,188,108, 18, 10, 70, 56,156, 84,107, 84, 47, 20,114, 37,
+ 80, 48, 42,128, 0,240,160, 68, 21,114, 3, 0,118,199, 15, 91, 25,243,174,211, 39, 14,215, 11,238,242, 15,177,136,231, 14,171,
+129,134, 38, 43, 25, 86,154, 64, 61, 69, 53, 52,175,231,139,155,207,116,184,124, 38, 54, 43, 63,239,205, 30,123,122, 54,139, 37,
+230,244,241,195, 1, 77, 59,244, 19, 7,181,238,202,171,234,227,218,231,150,234,112, 59,153,220,149, 26, 62, 98,164,107,112,163,
+234, 56,126, 83,131, 11, 39,247,103, 27,245,250, 88,123,122, 69, 14,123,252,248,241,216,180,105, 19, 40,138,122, 43, 3,176,108,
+217, 50, 80, 20,133,249,243,231,219,147,122, 75,239,254, 60,160,238,124, 22, 5, 13,175,127, 5, 0, 82, 23,151,130,227, 24,199,
+138,235,227, 31,196,156, 70,137,209, 22,109, 2,250,157,209,235,245,237,253,252,252,138, 82,216,215,226,238,237,105,233,144, 24,
+128,125,103, 86, 63,140, 8,157,222,120,193,130, 5, 55,171, 86,173, 90,163, 87,175, 94,248,225,135, 31, 44,119,239,222,229,181,
+105,211, 6,117,234,212,225,235,116, 5,117, 83, 98,177,152, 67, 16, 68, 37, 0,229, 86,158,255,157, 41,106,209,243,120, 60, 92,
+188,120, 17,159,124,242, 9, 24,134, 1,159,207,135, 80, 40,132, 64, 32,192,213,171, 87,193,229,114,237,118,239,148,196,108, 54,
+239, 94,187,118,237, 87, 75,150, 44, 17, 23, 5, 24, 66,161, 16,133,197, 98,249, 70,163, 49,218,190, 74,233,120,120,120,128,207,
+ 47, 78, 94,165,127,200,168, 37,181, 70, 85, 91, 33, 87, 26, 1,200, 62,116,244,211,191,139, 5, 11, 22,228,201,100, 50, 73, 84,
+ 84, 20,150, 46, 93,250,106,227,175,243, 2, 63, 68,207,203,203,171, 6, 0, 34, 53, 53,245,177,151,151,151,111,252,131,152, 91,
+ 21,213,216,121,108,233,142,240, 46, 83,175,239,218,181,107, 58, 73,146, 74,163,209,232, 9,128, 61,117,234, 84,138,213,106,141,
+ 55, 26,141,171,163, 79, 46,127,224,168,158, 90,163,122,165,144, 43,179,175, 94,189, 90,233,206,157, 59,242, 89,179,102, 73, 0,
+128,199,227,229,235,116,186, 28, 0, 89,106,141,202,224,136,214,187,105,255, 50, 71, 1, 40,228,202,207, 26, 54,108,184,163, 91,
+183,110,210,177, 99,199, 98,205,154, 53, 72, 77, 77,157, 89, 20, 77,170, 53, 42, 70, 33, 87, 78, 95,191,126,253,161, 25, 51,102,
+192,108, 54, 47, 63,114,228,200, 55, 10,185,114,180, 90,163,250,211, 23,184,114,229,202,190, 52, 77, 35, 33, 33, 33, 87,173, 81,
+149, 91, 93,173,214,252, 31,123,231, 29,215,212,253,253,255,215, 29, 89,132, 21,246, 22,113, 32,226, 70,220, 18, 81,220, 91,235,
+ 0,119,235,172, 86, 45,174,106,181, 90,235,168,214,162,173,180, 85,235,182, 5,183,182,110,139, 34,238,137, 85, 68, 13,130, 2,
+178, 87, 88, 33,235,142,223, 31,140, 34, 66, 8,214,207,167,253,124,127, 60, 31,230, 97, 32,247, 30,222, 55,185,121,159,243, 62,
+239, 51,162,210,135,116,154,158, 65, 16,132,131,147,147, 83,227,154,142,179,182,182,110, 98,110,110,142,148,148, 20,160, 84,249,
+ 84,199,171,212,212, 84, 94, 36, 18, 17,206,206,206, 77, 13,253, 93, 43, 43,171,197, 59,119,238,164, 47, 95,190,140,149, 43, 87,
+190, 78, 76, 76, 28,175, 80, 70, 93, 45, 27,211, 3, 79,153,220,175,103,207,158, 97, 75,150, 44,105,182, 97,195, 6,226,217,179,
+103,179, 96,160,232,137,149,149,213,180, 79, 62,249, 4,107,214,172, 65,120,120,248, 44,133, 50,234,112,149,235, 12,243,148,201,
+173,100, 50,217,214,101,203,150, 97,207,158, 61,129, 0,170, 53, 0, 18, 18, 18,150,180,111,223,254,139,204,204, 76,163, 60, 5,
+181, 29,239, 41,147, 15,157, 53,107,150, 3,207,243, 88,179,102, 77,250,154, 53,107, 84,249,249,249,191, 84,179,199,119,244,248,
+241,227,193, 75,150, 44,193,217,179,103, 67, 61,101,114, 94,161,140,218, 89,157, 76,133, 50, 42,205, 83, 38,111,236, 41,147,123,
+ 43,148, 81,177,101, 81,254,111, 68,250,123,202,228,205,202,142,173,181,216,136, 62,245,246,182,187, 87,169,143,108, 92,154,181,
+115,106,212,146,240,112,119,134,115, 59, 15,200,204, 4, 0, 15,252,153,168, 66,196,233, 35,186,204,180,215,103,141, 41, 8,196,
+100,220, 9,185,115,133,156,104,237,218,188,165,163,187, 23, 58,118,238, 65, 7, 14,239,111,103,101, 38,128, 70,199,225,226,159,
+249,136, 60,123, 72,147,159,151,121,188,182,140,130,114,202, 87,229,193,193,193, 21,105, 98,101,238,244,106, 21, 67,109,171,196,
+242,243, 95,109, 20,190, 33,175, 68,165,122, 39,121,149, 97, 89, 86,163, 82,169,216,128,128, 0,234,224,193,131, 80,171,213,117,
+158,212,247,159,223, 88, 24, 20, 16,124,225,246,237,219, 31,183,110,221, 26,238,238,238,100,126,126, 62, 0, 64, 42,149, 10,202,
+ 61, 0, 38, 38, 38, 98,148,238, 27,255, 79,195,243, 60,132, 66, 33,146,147,147, 17, 17, 17,129,142, 29, 59,194,220,220, 28,197,
+197,197,184,121,243, 38,210,211,211, 43, 60, 0,198,146,148,148,180, 65, 32, 16, 12,249,228,147, 79,188,103,206,156,105,218,188,
+121,115,188,122,245, 10, 33, 33, 33,170, 71,143, 30,197, 91, 89, 89,173,126,151,177, 10,133, 66,165, 76, 38,179, 20,137, 68, 12,
+ 73,146, 44,254,133, 43,246,247,137, 90,173, 54,121,252,248,241,109,141, 70, 99, 61,127,254,252,118,125,251,246,245, 26,219,115,
+126,231,131,151,183,188, 83,113, 48,138,162,104,134, 97, 40,138,162,132, 0, 72,146, 36,139,251,251, 76,177, 56,247, 96, 79, 65,
+ 93,101,149, 41,248, 73,239, 50,142,234, 40, 83,240,175,203, 30,127, 11, 61,167,206, 79,251,243,237,102, 64,111, 24, 0, 54, 54,
+ 54, 11, 78,159, 62,109,174,211,233,240,253,247,223, 35, 36, 36,100,151, 66, 25,117,180,202,160, 78,123, 89,251,255, 64,146,228,
+236, 57,115,230, 96,198,140, 25, 82, 95, 95,223, 96,252,229, 37,168, 32, 37, 37,101,121, 93, 20,152, 66,161,152,222,190,125,251,
+229,153,153,153, 53, 22,155, 48, 53, 53, 53,101, 89, 22, 47, 95,190,204, 83, 40,163,242,171,149,163,140, 82, 15,238, 56, 45,133,
+101, 89, 87,169, 84,106, 48,240, 44, 47, 47,111,157,175,175,239,170,140,140,140, 11, 0,214, 84,181,170, 20,202,168,135,158, 50,
+121,203,121,243,230,125,242,245,215, 95,143, 76, 79, 79, 15,175, 69,222,134,246,237,219, 47,203,204,204, 60,160, 80, 70, 85,187,
+207,175, 80, 70,133,122,202,228,186,195,135, 15, 79,207,201,201,169,241, 90, 21,202,168, 83, 0, 78, 25,250,123,117, 57,222,214,
+214,118,201,231,159,127,142, 99,199,142, 33, 63, 63,255, 59,133, 50,106, 67, 13,114,110,181,114,232,243,155,191,191,255,208, 93,
+187,118, 9,125,125,125,103, 1,168,214, 0, 40,227, 38,128,110,101,241, 22, 79,241, 87, 80,160, 53, 74, 83, 2, 9,148,102, 5,
+ 24,115, 13,188,103,147,153,131,207,134,133,252,222,184,101, 39,207, 14, 61,134,155, 41, 29,157, 64,147, 60,242, 50,147,113,233,
+183, 3,202,212,228,184,235,133,122,118,166,145,242, 56, 79,143,143, 7,157,249,229,235,115,109,187, 12,114, 69,183,126,102, 5,
+ 37,214, 16, 10, 72,168,242,179,113,230,240,246,220,196,248,167, 55,139,144, 54,207, 24,121, 0,222,168,204, 87, 93,148,126,101,
+140,217, 35,126,223,242,170,200,126,241,242,229, 75,191, 99,199,142, 73, 83, 82, 82, 74,104,154,174, 90,171,193, 40,120,158, 63,
+149,150,150,246, 33, 0,177,173,173, 45,173, 82,169, 56, 0,164, 68, 34,161,139,138,138, 88, 0,148, 88, 44, 22,144, 36,105,116,
+202,234,191, 25,145, 72, 4,154,166,145,149,149,133, 11, 23, 46,188,145,255, 47, 18,137,140, 10,240,172, 76, 89,126,126, 87,150,
+101,151,204,159, 63,127,170, 74,165,114, 53, 53, 53, 77,213,233,116,123,101, 50,153,209,117, 0,170, 82, 22, 7,144,171,209,104,
+188, 0,228,253, 13,215,255,255, 10, 97, 57, 57, 57,171, 1, 12, 59,127,254,252,207, 35, 71,142,196,225,195,135,167,163, 52,224,
+184,206, 48, 12, 83,100,109,109, 29, 95, 92, 92,108,237,226,226, 98,175,213,106,211, 89,150,117, 5, 80,103, 3,224,223,140,128,
+148, 88,150, 27, 1,149,127,255,134, 1,144,147,147,179,182,115,231,206, 33, 89, 89, 89, 9, 58,157,238,176, 66, 25,181,191, 58,
+ 97,207,114, 35,231,120,202,228, 55, 66, 67, 67, 3,109,109,109, 29,210,211,211,171, 77, 59,123,223, 10, 12, 0,146,146,146,150,
+150, 41, 88,131,169,110,113,113,113,179,203,142, 51, 88,185, 74,161,140, 58, 13,224,116, 45,199, 48, 0, 54,151, 61, 12,162, 80,
+ 70,157, 4,112,210,136,227,118, 0,216, 81,219,113,239,147,236,236,236,245, 29, 58,116, 88,157,150,150,118, 25,192, 38, 67,199,
+106,181,218,192, 81,163, 70,173,118,118,118,238,154,154,154,250,173,161, 99,203,222,159, 43,101,165,128,155, 0,232, 88,246, 82,
+ 30,128,132,186,150, 2, 86,188,216,150, 14,192,183,117,203, 37, 83,147,159, 71, 79, 96, 57,166, 9,120,158, 19, 8, 4, 49, 37,
+106,213, 15,143,159,124, 99,240,243,122, 75,222,203, 31,147, 61,101,161,173, 30, 94, 63,189, 56,246,206,133,209, 60,120,103,128,
+103, 40,146,124, 89, 84, 84,180,229,105,220,150,163,181, 75, 41,133,227, 56,216,219,219, 87, 4,128, 81, 20, 5,146, 36, 65,211,
+180,161,180,176, 26,181,246,251,150, 87, 21,154,166, 87,175, 94,189,218,195,218,218,218, 55, 47, 47, 47,154,227,184,119,218, 43,
+ 37, 8,226,197,165, 75,151, 84,206,206,206,226,155, 55,111, 42,121,158,103,182,109,219,102,119,253,250,245, 60,134, 97,216,159,
+126,250,201,238,218,181,107, 74,189, 94,127,245, 93,228,255,155, 32, 8, 2,109,218,180, 1, 65, 16, 21, 6, 87,121, 76, 71,249,
+131,162, 40,208,116,221, 10,169,150,109,149,174, 43,123,188, 23, 20,202,168, 98, 79,153,252, 49,128, 12,133, 50,202,168,173, 66,
+ 35,184, 7,224, 95, 89,208,105,219,241, 85,115, 1, 96, 68,183,143, 15, 30, 59,118,108,203,160, 65,131,164, 50,153,204,168,216,
+172,234, 40,175,127,225, 41,147,103, 57, 57, 57,181,206,206,206, 78,115,113,113,249,159,174,144, 91, 19, 13,218, 73,197, 85,235,
+ 1, 16, 10,101,212, 63, 53,158,122,234,249,159, 98, 82,255, 37, 25,122,189,190,206,221,251,196, 98,113,198,238,211,235, 28,255,
+211,242,254,211,140,235,189,160, 55, 0,107,142,227,242,203,220,205,111, 61, 15,191,180,249,252,127,123, 92,239,147,127,123, 47,
+128,234,240,148,201,151, 1,216,248,190, 86,255,158, 50,121, 48,128,239,255,237,222,132,192, 94,159, 14,146, 74,165,203, 75, 74,
+ 74,190, 13,139, 8, 49,166,240,153, 65,228, 94, 99,108, 1,216,177, 44,155,123, 61,238,104,173, 25, 85,255, 43, 24,138, 1,168,
+ 55, 0,234,169,167,158,122,254,135, 41,171,190,153,248,190,202,140,123,202,228,102,198, 86, 43,173,231,127,155,122, 3,160,158,
+122,234,169,167,158,122,254, 15, 83, 83, 67,160,127,180,173,104, 61,245,212, 83, 79, 61,245,212,243,159,163,220,229, 95, 94, 8,
+168, 52, 24,144, 19, 3,245, 6, 64, 61,245,212, 83, 79, 61,245,252,127, 73,189, 1, 80, 79, 61,245,212, 83, 79, 61,255, 31, 82,
+111, 0,212, 83, 79, 61,245,212, 83,207,123, 36,238, 59,185,201, 63, 61,134,114,170, 54, 4,170, 28, 3,240, 95, 13, 2,156, 50,
+112,105,146, 86,171,117, 51,116,140, 80, 40,204, 22,137, 68, 78,219, 79,124,249,175, 78, 65,169, 43, 65, 1,193, 22, 97, 17, 33,
+255,167,138, 75,212, 83, 79, 61,239, 70,240,248,141, 66,138,162,200,111,246, 45,248, 87,150,219,125,223, 12,244,253, 72,228,226,
+226, 66,108, 63,241,229,123,189, 94,127,239, 64, 73,100,108,184, 81, 37,113,141,148, 71, 71,198,134,191,179,238,121, 52, 93, 78,
+ 41, 36,130, 43,106,161, 99, 87,161, 54, 61, 38,240,251,136,127,117,135, 76,163, 12,128,193,141,229,205,228,205,155,125,252, 44,
+ 41,229,218,245,228,226,163,239,154,110, 50,161,239, 34,253,181, 69,139,104,136,197, 96,123,244, 0, 71, 16, 32,214,172, 1,151,
+145, 1,221,134, 13, 96, 0, 12, 30, 60,152, 53, 49, 49, 49,125,223, 55, 74, 77, 44,158, 28,146,193,113,156,209,185,216, 52, 77,
+103,126,189,123,126,173, 61, 55,131, 2,130, 73, 0, 51, 68, 34,209, 48,158,231,125,117, 58,157, 76, 40, 20, 22, 16, 4,113, 79,
+171,213,254, 14,224,199,176,136,144,106,123, 40, 24, 98,140,255, 60,119,146, 36,131, 8,130, 24,139, 82, 15,206, 33,146, 36,127,
+253,229,226,166,154,202, 34,215, 83,207, 59,209,212,210,175,110,101, 7,171, 16,151,127,245,189,164,165,189, 43,158, 50, 57,225,
+226,226,226,200,113,156,187,163,163,163, 83,102,102,102,242,165,152, 95,239,214,118, 78,149, 95,241,255,137, 69,210,194,137,155,
+ 6, 74, 36, 18, 51,141, 70,147,194,113,220,179,111, 15, 44,202,125, 31,114, 61,101,114,210,210,189,135,121,126,162,109,145, 66,
+ 57,167,206,243, 75, 57,129,189, 62, 29, 4, 96,161,149,149,172, 67, 94,158,242, 46,128, 77,225,151, 54,215, 90,128, 43, 40, 32,
+216, 22,192, 98, 0, 2, 0, 27,194, 34, 66,210,131, 2,130, 79, 9,133,194, 65, 0,160,211,233,174,135, 69,132,116,175,114, 14,
+ 17, 22, 17, 98,244,189,226,239, 29,104, 33,149, 74,215, 54,110,220,184,175,131,131, 67,163,196,196,196,130,215,175, 95,223, 41,
+ 41, 41,249, 34, 50, 54,220,224,231, 91,131, 60, 83,169, 84,186,186, 85,171, 86,253, 45, 44, 44, 26,199,197,197,229,164,166,166,
+222,214,106,181,171,235,218, 23,224,254,170,190,126,127,150, 56, 71,109, 12,217,139,229, 75,166,195, 83,240,178, 95,199, 85, 23,
+ 47,212,117, 76,239,155,170, 43,255,114,140, 50, 0,190, 30,248,209,166,221,243,167, 44,200,201, 47,200, 89,182,239,216,177, 75,
+ 79, 19,150,156,123, 25, 85,231,213,236,132,190,139,244,215,215,172,161, 11, 7, 14,132, 46, 46, 14, 16,137, 32,116,119, 7,116,
+ 58,232, 94,189, 2, 68, 34, 12, 27, 54,236,191,106, 0, 44,156,184,137, 15, 11, 11,131,169,169, 41,128,210,202,108, 44,203, 86,
+ 60,120,158, 7,199,113,224,121, 30, 12,195, 96,202,148, 41,216,180,127,161,193,137, 49, 40, 32,184,137, 72, 36, 10,247,246,246,
+110, 53,127,254,124,129,155,155, 27,164, 82, 41, 84, 42, 21,146,147,147,177,117,235, 86,253,227,199,143,159,106,181,218,192,176,
+136,144,103,181,141,241, 3,191, 57, 50,129, 64, 48,138, 32,136,241,141, 27, 55,238, 54,107,214, 44,162, 99,199,142,224,121, 30,
+ 55,110,220,192,174, 93,187, 16, 23, 23,119,147, 32,136, 95, 40,138, 58,124,224,194, 55,239,101, 50,121, 87,134,180,146, 75, 40,
+ 33,156, 9, 30, 4,199, 35,237,100,116,148,202,216,115,155, 90,202,177,127, 57, 36,156, 14,252,228,141,208,184,186,186, 8, 57,
+142,115, 7,208, 0, 0,199,243,124,146, 68, 34, 73, 74, 72,120,169,175,124, 92, 92,190,113,147,116, 83, 75, 57,182,124, 9, 33,
+ 5,240,159,172,130, 62,238, 61, 77,238, 19,251, 45,182, 23,139,197,237,180, 90,173,185, 72, 36, 42,100, 89, 54,118,215,169,181,
+117,170,128, 8, 0,157, 60,166, 8, 53, 36,235, 32, 18,153, 88,105,181, 37,121, 98,142,202,184,253,114,143,238, 93,198, 52, 99,
+184,156,144,138, 4,109,133, 2,214,133,162, 56, 19,150, 35,213, 58, 45,149,202, 81,250,232, 45, 97, 81,181, 86,122,171,106, 0,
+248,249,249,137,245,122,125,103,145, 72,100,165,211,233, 4,101, 77,109,244, 90,173, 86,105,110,110,126,235,194,133, 11,111,172,
+196,170, 26, 0,255, 77,131,162,103,139, 32, 27, 43, 43,171,110,157, 59,119,150,248,250,250,194,194,194, 2, 59,119,238,196,243,
+231,207,143,253,241,232, 64,181,239,103, 80, 64, 48,233,232,232,216,137, 32,136, 6,134,100, 11, 4, 2,109, 94, 94,222,137,237,
+ 39,190,172,147,129,179,112,226,166,166,122,189,222,130,162,168, 56,146, 36,251,237,217,179,135,140,143,143,199,129, 3, 7,144,
+156,156,156, 69, 16,196,179,223,127,255, 61,237, 93, 12, 14,207,225, 43,105,171,215,220,124,177, 84, 58,175, 97,195,198, 46,233,
+233, 41, 25,121,202,220, 31,242,121,233, 55,138,123,159,213,169, 66, 96, 96,175, 79, 7,117,238,220,233,240,226, 37,139, 73, 71,
+ 7, 39,209,171, 87, 9, 37,223,124,243, 45, 17, 29, 29, 61,186, 54, 35, 32, 40, 32,120,245,228,201,147, 87, 88, 89, 89, 97,243,
+230,205, 10,158,231, 59, 2,200,188,116,233,146, 72, 32, 16, 32, 32, 32, 0, 28,199,185, 48, 12, 51, 0,192, 40, 75, 75,203, 30,
+249,249,249, 87, 1,140, 9,139, 8,169,117,222,242,247, 14,244,243,245,245, 61, 28, 28, 28,108,111,103,103, 7,177, 88, 12,145,
+ 72, 4,165, 82,137,197,139, 23,179, 15, 31, 62, 92, 17, 25, 27,190,222,216,107,245,247, 14,236,210,179,103,207, 99,139, 22, 45,
+114, 32, 8, 2, 52, 77, 67, 40, 20, 34, 47, 47, 15,139, 23, 47,102,226,226,226, 62,141,140, 13, 15, 53, 70,214,144, 78,211,233,
+ 30, 77,139,182,187, 53,178,250,112,217, 87, 63,225,155,117,139,144,250,252,213,209,243, 79, 45, 3,127,191,189,227, 31,243,104,
+215,164,252,129,106,186, 1, 2,192, 8,153, 92,200,201,208,148, 47, 43, 57,202, 3, 15,247, 71, 92,143,157,224,231,235,245,211,
+244, 81, 83,126, 56,123,181,249, 48, 15,249,199, 39, 95, 86,223,222,215, 16,250,174, 93,161, 75, 74,122, 75,241,151,255, 44,108,
+223,190,174, 34,255, 54,166,166,166, 56,116,232, 80,181,181,216, 43, 63, 26, 52, 48, 56, 47, 0, 0,130, 2,130,189, 4, 2,193,
+195,149, 43, 87, 10,122,247,238, 77, 86,174,221, 78, 16, 4,156,156,156,176,101,203, 22,193,185,115,231, 90,110,220,184,241,207,
+160,128, 96,223,176,136,144,199, 6,228, 69,217,218,218,118,155, 49, 99, 6,217,167, 79, 31, 88, 90,190, 81,202, 25, 1, 1, 1,
+232,213,171, 23, 82, 82, 82,186,156, 61,123,182,203,193,131, 7, 67,131, 2,130, 31,132, 69,132,116,168, 73,230,128, 65,187, 6,
+ 17, 60,196, 60,120,240, 28, 15, 30,165, 13, 80,202,254,149, 63, 47, 53,126, 88, 78,115, 37,114,246,153,218,174,123,114, 75, 57,
+ 85, 44,130, 35,199,193,213,163,129,181,205,252, 25, 35, 69, 57,202, 18,236,254,245, 84,179, 17, 62,242, 92,158, 71, 10, 97,130,
+180,227,215,107,174, 46,214,212, 82,142,109,159,161, 29, 15,120,130, 2, 63,109,164,180, 72, 42,149,154,206,156, 57,147, 28, 58,
+116, 40,242,242,242,112,244,232, 81,187,195,135, 15,183,155, 59, 86,172,242,114,215,152, 19, 20,248,159, 62, 67,236,172,175,229,
+ 49,181, 25, 1, 77, 45,229,216,246, 57, 90,138, 56, 52, 7,128, 85,211,161,248, 85, 38,127,124, 70, 89,187, 50, 52,196,248, 62,
+ 11, 61, 36, 18, 73,251, 47,190,248,130,106,213,170, 21,158, 63,127,110,249,249,231,159,119,154,216,111, 49,183,255,252,198, 90,
+219,188,250, 52,251, 80,204,176,188, 83,131, 6, 13, 93,167, 46, 88,234,208,205,207, 79,208,192,197,145, 76, 74, 73,231,174, 95,
+189,170, 31, 18,176, 58, 35, 41,233,213,107,154, 34,210, 30, 60,223,109,148, 97, 60, 99,184,156,176,148,210,253, 70,140, 90, 34,
+254, 96,244, 18, 90, 40,148,240,217,217,105,216,187,123,129,227,157,155,199,250,207, 15,146,159, 51,198, 8, 40,167, 83,167, 78,
+ 77, 5, 20,213,118,193,164, 73, 68,199,110,221, 96,230,226, 2, 58, 35, 3, 5, 12, 35,184,246,228,137, 93,104,104,232,144,142,
+ 29, 59,198,220,185,115,231,169, 33, 57, 93,187,118, 29,168,215,235, 77,141,253,187, 52, 77,107, 38, 79,158,252,251,244,233,211,
+141, 86,182,158, 50, 57,209,166, 77,155,238,235,214,173, 19, 83, 20,133,216,216, 88,156, 63,127, 30, 79,159, 62,141, 79, 73, 73,
+ 49,168,252, 27, 53,106,228,188,113,227, 70,196,197,197,161,121,243,230,111, 44, 8, 56,142, 3,199,113,152, 56,113,162, 16,165,
+222,183, 58,173,176,149, 74,101,219,105,211,166,145,135, 15, 31,110,204, 48, 12, 95, 80, 80, 0,169, 84,138, 47,191,252, 18, 89,
+ 89, 89,118,225,225,225,118, 60,207, 23, 44,156,184, 41,122,211,254,133, 70, 85,162,235,214,109,165, 41,163,129,187,140,224,214,
+122,183,235, 60,164, 69,235,246,176,150, 89,193, 74,102,225,144,158,154,248,213,190,221, 63,249,121,250,126, 61,184, 58, 35, 96,
+ 68,183,143,133, 18,137,228, 43, 43, 43,171,201, 0,144,151,151,183, 87,173, 86,175, 16,137, 68, 11, 23, 47, 89, 76, 94,191,126,
+ 93,228,230,238,130, 3,123,195, 76, 62,154, 58,185, 48,250,227,232,133,168,165,108, 58, 0,153,147,147, 19, 70,140, 24, 1,141,
+ 70,227,249,227,143, 63, 30, 6, 64, 22, 23, 23, 67, 40, 20, 2, 0,236,236,236,146,252,252,252,168,238,221,187,163,113,227,198,
+216,177, 99, 71,175, 99,199,142,245, 2,112,216,144, 96,127,239,192,129,195,134, 13, 59,249,201, 39,159,208, 42,149, 10,197,197,
+197, 96, 24, 6, 44,203,194,194,194, 2, 59,118,236,160,198,143, 31,191,214,223, 59,240,102,100,108,120,173, 86,148,191,119, 96,
+239, 41, 83,166,156,249,248,227,143, 5,207,158, 61,131, 78,167,131, 68, 34,129,137,137, 9, 76, 76, 76,176,117,235, 86,122,234,
+212,169, 91,252,189, 3, 31, 68,198,134,215,216,107, 96, 72,167,233,189,164, 82,233,122, 11, 11,139,182,142,141,154, 83,237, 92,
+ 18, 1, 0,190,174, 2,104, 85,109, 71, 88,164,230,169,199,246,156,255, 88,173, 86,127,254,219,173,237,255,170, 74,153,213, 26,
+ 0,237, 58, 53,250,230,139,160, 33, 35,104, 2, 28,120, 14,224, 56,128,103,160,211,170,139, 68, 20, 97, 49,183,111,231,238,109,
+ 93,237, 78,204,108, 61,240,243,109,143,206, 24,252,208,170, 82,151, 78,102,198, 16, 20, 16,236,129,210, 14, 76, 65, 40,253, 82,
+134, 3,216, 27, 22, 17, 98,176,251, 96, 85,170, 83,248, 85, 27,180,212,214,136, 37, 40, 32,152, 18, 10,133,225, 95,126,249,165,
+160,119,239,222,111, 4, 88, 22, 22, 22,162,160,160, 0,133,133,133, 40, 41, 41,129,143,143, 15, 57,103,206, 28, 58, 52, 52,244,
+ 80, 80, 64,112, 43, 3,205, 64,186, 93,184,112,129,212,235,245,144, 72, 36,213, 30, 64, 16, 4, 92, 93, 93, 49,106,212, 40,180,
+108,217,146,156, 59,119,174,161,118,202, 32,120,136,239,158,223, 33, 16, 11, 41,232,244, 44,180,122, 22, 26, 45, 3,181,150,129,
+ 74,163,135, 74,205,160,168, 68,135,180,156, 98,172, 90, 93,123,217,242, 97,237,229,110, 18, 41,237, 61,103,124, 31,201,208,161,
+ 67, 4,118, 13, 59,146, 4, 89,250,101, 31, 51, 41, 88,160,120,116,197,228,228,111,191, 59, 28, 60,117, 85, 61,220, 71,174, 56,
+241, 32,170,218,237,138,189, 75, 33,165,104,202,115,218,216,233,224, 56,150,216,113,112,151,249,230,221, 81, 48,181, 40,221,161,
+105,216,176, 33,124,124,124, 16, 60,119, 50,117,242,199, 22,230,211,198,204, 2,199,177,196,246,240, 29,222, 59, 22, 34,174,199,
+114, 24, 92,233,236, 89, 14, 19,158,131,247,135, 31, 76, 33, 88,150,197,222,227,191,120, 57,118,107,215,204,219,182, 87, 26,195,
+ 48,127, 42,148, 81,133,181, 94,108, 37,166, 12, 92,106,167,215,235,157, 36, 18, 73,211,125,251,246, 81,238,238,238, 0,128,110,
+221,186, 97,245,234,213,212,202,149, 43, 91, 2, 48,104, 0,180,109, 52,169,245,200,160,169,158,131,135, 12, 17, 54,109,228, 78,
+102,102,231,241,247,163,163, 75,182,255,248,189,178,171, 95, 47, 89, 64, 64,111,147,113,129, 99, 26,196, 37, 36,186,254,126,250,
+140,190,109,147, 41,207, 31,190,216,243,168,182,177,153,136, 4,109, 71,142,250, 76, 52,126,210,106, 49,203,178, 92,102,102,114,
+ 46,199, 50,248,112,234,102,234,245,107, 5,149,148,248,204, 7,165, 53,223,107,165, 99,199,142,158, 78, 14, 14,109,127, 92,187,
+ 22, 66,165, 18, 74,158,135, 42, 35, 3,244,218,181,160, 37, 18, 4,124,241, 5,252,252,252,136, 57,115,230,180,234,208,161, 3,
+238,222,189, 91,163, 17,160,215,235, 77,175,253,240, 3, 65,187,184,128,215,233,160,179,177, 1,199,151, 26,157,194,103,207, 0,
+173, 22,188, 78, 7, 77,219,182,208,179, 44,134, 14, 29, 42,126,240,224, 1, 1,192,232,137,195,193,193,193,220,199,199, 71,108,
+110,110,142,165, 75,151,242, 9, 9, 9,207, 57,142,123, 21,245,236, 80,181, 94, 75, 79,153,156, 24, 52,104, 80, 71, 15, 15, 15,
+199,141, 27, 55,210, 66,161, 16, 49, 49, 49,200,202,202,130,173,173, 45, 36, 18, 73, 69,243,159,186,214,255,247,247, 14,148, 19,
+ 4, 33, 3,240,204,197,197, 5,189,123,247, 70, 64, 64, 0, 18, 18, 18,136,136,136, 8,216,219,219,131,227, 56, 88, 89, 89, 97,
+217,178,101,200,202,202,178,152, 63,127,126,215, 25,195, 87, 30, 55,228, 97,232,218,105,153, 25,203, 81, 95,216,219, 59,204,240,
+246,110,101,150,175, 98, 64,137,204, 17,247,252, 25,242,115,210,208,214,183, 19,252,123,248,131, 0,223,123,231,246,173, 75, 1,
+172,170, 42, 67, 34,145,124,181,234,203,149,159,244,233,221, 87, 82,162, 86,241, 39,127, 59, 57, 59,244,251, 31, 96,105,105,209,
+193,209,193, 73,228,230,238, 2,181,186, 4,129,227, 71, 67, 44, 17,155, 91, 89,201,106, 92, 84, 84, 98,109, 72, 72,200,136,102,
+205,154, 57,125,248,225,135,160,105,186, 79,118,118, 54,194,195,195, 97,106,106,138,159,126,250, 9, 13, 27, 54,164, 88,150,133,
+ 90,173,198,213,171, 87,113,235,214, 45, 21,106,105, 21,238,239, 29, 56,100,222,188,121, 39, 6, 12, 24, 64,102,103,103,131,101,
+ 89, 28, 57,114, 4, 15, 30, 60,128,171,171, 43, 22, 47, 94,140, 38, 77,154, 96,237,218,181,196, 7, 31,124,176, 9,128,193, 57,
+208,223, 59,112,192,138, 73,147, 78, 13,250,232, 35,242,222,189,123, 96, 24, 6,127,252,241, 7, 30, 63,126, 12, 71, 71, 71,204,
+159, 63, 31, 13, 26, 52,192,231,159,127, 78,205,156, 57,243, 91, 0, 93,170,147, 51,174,247,130, 76, 47, 47, 47,235, 41, 83,166,
+ 80,253,250,245, 67, 81,202, 29, 60,249,125, 54, 0, 64, 76,113,248,104,218, 12,114,241, 55, 3,200, 83,167, 78,181,219,187,119,
+239,169,113,189, 23,228,255,250,199,183,182, 70,188,143,239,149,210, 32,192,191,126,174,182, 29,112, 57, 52, 1, 94,175,215,115,
+ 20, 69,130, 38,120,210,213,218,220, 5, 28, 11,112, 44, 32, 16, 3,170,124,116,111,236,220, 56,116, 98,191,111, 70, 55,233,149,
+125,248,197,165, 72, 67,127, 60, 40, 32,216, 20,192, 7, 20, 69, 81,244,145, 35, 16, 78,155, 6,221,139, 23,213,110, 1,232,134,
+ 13,171,222, 42,121, 91,222, 40, 0,147,109,109,109,187,119,237,218,149,208,106,181, 8, 12, 12,196,249,243,231, 63, 63,127,254,
+252,231, 65, 1,193, 55, 0,236, 5,112, 56, 44, 34,196,224,196,206,113, 92,141,221,216,234, 98, 0, 0,248,184, 85,171, 86,205,
+ 3, 2, 2,222, 80,254, 69, 69, 69, 40, 44, 44,172, 48, 2, 10, 10, 10,144,156,156,140, 54,109,218,144, 13, 27, 54,108,164, 80,
+ 40,230, 3,248,166, 6,153, 12, 77,211,194, 7, 15, 30,160,176,176, 16,174,174,174,104,214,172,217, 27, 7, 60,123,246, 12,151,
+ 47, 95, 70,102,102, 38,124,125, 13,222,247, 0,202,122,208,211, 36,246,158,122, 4,134,213,160, 88,205, 32, 43, 95,143,188, 66,
+ 6,197,106, 29,138, 75,244, 40, 42,209, 97, 92, 95, 47,144, 68,237,137, 34, 36,135,230,183,239, 60,182,164,249, 28, 16,194, 55,
+155, 47, 82,180, 8,205,125,250,146,238, 77,218,136,198,140,121, 41, 28, 22, 56,213, 43, 40, 64,158, 24, 22, 81,251,234,147, 32,
+136,106, 27,226,212,165, 11,219, 27,242,116,160, 64,129, 16,137,196,224, 56, 14, 36, 9,108, 9,217, 68, 36,167, 42,157, 55,108,
+216,224,228, 41,147,223, 85, 40,171, 55, 78,202,241,148,201,137, 78,157, 58, 53,163,105,186,153,173,173, 45,213,167, 79, 31,170,
+ 95,191,126,100,185,242, 47,199,213,213,149,212,104, 52, 22,181,141,201,204,202,190,225,152, 9,211,196,206,214, 2, 68, 69, 93,
+209,127,189,102, 85,118, 65,161,242,121, 73, 78, 78,209,149,136,179,102, 22,150, 86, 94, 11,151,172,180,237,216,161, 29,237,223,
+123,176,232,242,133,115,238, 0,106, 53, 0,132, 2,214,105,208,208,185, 36,203,234, 25,189, 94,205,230,101, 95, 85, 23,230,199,
+233, 76, 77, 27, 10,134, 14,153, 32,220,190,237, 51,167,218,100, 0,165,110,127,161, 64,208,230,135,181,107,193,220,191, 15, 81,
+247,238,104,228,225,129,188,188, 60,228, 23, 21,129, 77, 78, 70,193,170, 85,160, 87,172,192,214,173, 91, 49,118,236,216, 86,189,
+122,245, 74,188,116,233, 82, 73, 77, 50, 41,123,123,164, 54,108, 8, 94,171,197,171,243,231, 65,136,197,160, 40, 10, 46, 61,123,
+130,208,151,218,193,121,183,110,193,221,211,211, 80, 67,164, 26, 97, 24,166, 36, 41, 41,137,167,105,154,104,217,178, 37, 17, 31,
+ 31, 95,100, 64,249, 3, 0,104,154,110,176,126,253,122,162,124,149, 90,222,152,137,166,105, 80, 20, 85,241, 92, 32,168, 83,155,
+ 0,136, 68, 34,199,149,155,126, 32,174,252,113,190, 93,196,233,227, 72, 78, 78, 6,195, 48,176,177,177,193,200,145, 35,145,146,
+146,130,219,183,111,163,117,235,214, 32, 73, 18, 14, 14, 14, 16, 8, 4, 6, 61, 12, 93, 59, 45, 51, 35, 73,201, 31,115,230,126,
+218,177,115,151,238,208,233,245, 40, 42, 86,225,222,189, 7, 56,176,251,251,252,146,162,220,137, 47, 95,196,126,108, 46, 53,233,
+215,167, 79, 95,252,118,242,200,108,207,128,224,181,138, 42,139, 12, 43, 43,171,201,125,122,247,149,204,153, 51, 7, 65,227, 71,
+ 19,190,237,125,164,102,102,166,139,149,202,124, 60, 87, 60,197,129,189, 97, 8, 28, 63, 26,207,159, 42, 96,107,103,205,149,197,
+ 2, 24, 36, 44, 34, 36, 35, 40, 32,120,216,194,133, 11,175,237,223,191, 95, 52,126,252,248, 55,182, 84,139,139,139,113,249,242,
+101, 92,187,118, 13,119,239,222, 85,170,213,234, 19, 0,190, 15,139, 8,169,241,158,246,247, 14, 28,177,116,233,210,163,237,218,
+181, 35,126,249,229, 23, 52,109,218, 20, 59,119,238,228,147,146,146,214, 3,216,240,250,245,235,128,165, 75,151, 30, 59,121,242,
+ 36, 90,180,104, 1, 7, 7,135, 54,134,130, 3,253,189, 3,135, 29,248,228,147,227,173,186,117, 35,190, 13, 8,128,211,216,177,
+ 56, 20, 21,197,191,122,245,234, 27, 0,155,146,146,146,122,127,253,245,215,191,254,252,243,207,240,245,245,133,149,149,149,143,
+191,119,160, 32, 50, 54,252,173, 69,154, 80, 40,180,254,229,151, 95, 40,113,217, 61,108,229,222, 5,140,158,195,237,240,165, 40,
+ 86,230,192,186, 97, 55, 8,133, 66, 12, 26, 52, 8,110,110,110,244, 39,159,124, 34,171,237, 61,124,223, 52,104, 39, 21,215,244,
+ 90,181,186,118,207,173,132, 5, 55,159,135,238,110, 96, 43,155,243,211,180, 81, 3,192,234,161,179,112, 42, 46,108,211,159,183,
+113,111,106,150,151,242,178, 88,122,231, 4,154,235,181,110, 75,250,181,223, 60,170,153,188,235,145,231,213,239,243,142,236, 62,
+123,129,137,137,201,151, 93,186,116,145,222,186,117, 11,124, 73,141,243, 66, 57, 84,113,113,241, 60, 0,213,182,170,173, 44,207,
+205,205, 13, 69, 69, 69,200,205,205, 69, 86, 86, 22, 26, 55,110,140,224,224, 96,204,155, 55, 15, 55,110,220,232,122,250,244,233,
+174,215,174, 93,251, 46, 40, 32,248,139,176,136,144, 26, 59,218,177, 44, 91,171,242, 55,198, 0, 16,137, 68, 3,231,204,153, 35,
+168,124, 92, 81, 81, 81,197,202,191, 92,249,151, 63,143,137,137,129, 92, 46, 23, 36, 37, 37, 13, 66,205, 6, 0, 15,148, 78, 72,
+ 22, 22, 22, 40, 44, 44, 68, 68, 68, 4,100, 50, 25,180, 90, 45, 46, 95,190,140,220,220, 92,136, 68, 34, 8,133, 66,232,116,181,
+111, 23,243, 60, 15,173,142, 5,203,106,241,113,183, 75,160, 72, 30,139,143,248,160, 88,205, 85, 40,255, 98,181, 14, 37, 26,189,
+ 81, 30, 27,130, 0, 41,176,240,130, 54,194,155, 39,173, 59, 18,180,227, 0, 16,230,205, 1, 0, 89,175,238,225,197,189, 48,188,
+126,118,137,111,221,127, 29,193,243, 32, 10,106,136, 30,153,188, 30,170,208, 37,108,220,143,191,252,212,148,162, 40,152, 58,143,
+198,181,155,209,112,117,117, 69,131, 6, 13, 80, 88, 88,136,235,215,175,227,209,163, 71,176,228,125,240,211,175,219,192,243, 60,
+ 8, 32,118,250, 38,104,227,170,109, 14, 93, 73,254, 70, 20,253,180, 20,201, 63,253,250,147, 27, 0, 68, 43, 40,205,238,217,139,
+ 4,115,230,204,161,182,109,219, 70, 76,154, 52,201,215, 83, 38,207, 49,228, 9,104,219,182,173,163,157,157, 93,139,117,235,214,
+209,222,222,222,111,189,126,251,246,109,139,152,152, 24,139,155, 55,111, 74, 9,130,184, 95,219,123,103,106,110, 77,221, 79, 80,
+ 33, 70,145,205,117,244,233, 38,248,253,236, 69,199, 43, 81,215,108, 79, 28, 63,164,239, 63,116,140,176,179,111, 91, 58, 75,169,
+198,209,136, 39,124,114,142,142,144,152, 91, 27,165,129,104,138, 55,145, 72, 36,220,235,164, 63,114, 52,197,247,245,208,199,242,
+150,230,156,136,231, 94,243, 30, 13,253, 41,146, 96,171,119, 39, 85, 65,163,209,116,154, 57,115, 38, 33,176,183,135, 96,224, 64,
+ 8,178,178,240,114,194, 4, 32, 63, 31,250,245,235,129, 50,133, 72,140, 27, 7,113,183,110, 88, 51,104, 16, 62, 59,121,178, 51,
+128, 75, 53,201,228, 43,221,163, 20, 69,129, 40, 83,176,229,112, 34, 17,200,119, 52,242, 0,224,198,139, 99,122,127,239, 64,197,
+221,187,119,155, 5, 6, 6, 34, 49, 49,209,183,103,139, 32,205,229, 39, 97,169, 53,157,195,113, 28,226,226,226,240,236,217, 51,
+ 16, 4, 1, 51, 51, 51,152,154,154,190,177, 48,160,105,186,206, 30, 0,177, 88, 12,177,212, 12, 45, 58,247, 66,175, 1, 67,176,
+ 43,252, 4, 84, 57,169, 24, 57, 98, 56, 56,142,131,141,141, 13, 38, 78,156,136,240,240,112, 88, 90, 90,194,196,196,196,224,119,
+206,223, 59,216,132,180,176, 58, 63, 63,120, 73,199,246,190, 29,241,199,197,243,120,250, 50, 29,182, 86,150,104,228,209, 16,254,
+189, 7, 91,254,113,230,112, 15,189, 42,123,195,195,232,187,253,250,245,235,143,166, 77,189,108,242, 34,179,172, 1,188,181,173,
+160,214,168,249,160,241,163,137,176, 95, 14,227,163,233,147,209,163, 71, 15,184,186,186,225, 82,196,101, 76,157, 62, 5, 2,129,
+ 0,141, 26, 53,196,174,157,123, 73,212,210, 65,180,156,176,136,144,123, 65, 1,193, 65,163, 71,143, 14,109,212,168,145, 35, 0,
+180,109,219, 22,227,198,141,195,119,223,125,135,139, 23, 47, 30, 69,105, 39,212, 43, 0,200,176,136,144, 26, 61,119, 1,173,198,
+143, 93,179,102, 77, 88,147, 38, 77,136, 67,135, 14,129,101, 89,156, 60,121,146, 79, 74, 74,154, 25, 25, 27, 94,222, 77,245,120,
+191,118,147, 85, 36, 73, 74, 41,138,130,163,163, 35,157,145,145,225, 4, 32,161, 26,121,163, 15, 46, 89,114,168,109,179,102, 72,
+ 25, 53, 10,221, 89, 22, 59, 15, 28,224, 95,177,236, 71,145,177,225,123,202, 47, 97,160,239, 71, 63,211, 52,109, 66, 81, 20, 92,
+ 92, 92,132,121,121,121, 46, 0, 94, 85, 55, 70,189, 94,143, 39, 79,158, 64, 34,145,192,202,202, 10,237, 38,159, 67,134, 34, 2,
+158,158,189,145,144,156,141,251,247,207, 33, 45, 45, 13, 22, 22,181,174, 7,254,163,148,151, 3,174, 28, 15, 80,237,221,220,198,
+ 18,102, 93, 91, 54, 13, 94, 63,110,224, 80, 51, 33,109, 9,150, 65, 97,235,190, 56, 24,157,110,182, 62,120, 31, 62, 25, 41, 55,
+157,225,255,129, 74,116,100, 37,122, 52,118,180,251,242, 20,188, 0, 84, 59,217, 49, 12,179,218,214,214,214,228,201,147, 39,224,
+121, 30,186,241,227,161, 27, 62,252,173,149, 63,237,238,142,171, 54, 54,112,246,245, 69,102,118,246,218,160,128,224,205, 97, 17,
+ 33,111,105,179,202,242, 10, 10, 10,160, 84, 42,193,178,111, 26,202, 20, 69,161, 91,183,110, 80,171,213,160,105,218, 36, 42, 42,
+106, 67, 80, 64,240,214,234,228, 1,239,207, 0,224,121,222,199,205,237,175, 44,199,226,226,226,138,149,127,126,126,254, 91, 94,
+128,252,252,124,216,219,219,131,101,217, 54, 6, 5, 87,193,220,220, 28, 44,203, 98,223,190,125, 21, 65, 43,229, 24,103, 0, 0,
+ 26, 29, 3,149,250,175,237,120,149, 90,143, 34, 21,139, 98,181, 30,197,106, 29,120, 30, 40,209,212, 49,110,133,231,192,229,220,
+226,117, 57,183, 64, 72, 93, 17,113,227, 37, 81,144,149, 80, 49,155,233,181,134, 61,236,113,249, 81, 8,187, 54,238, 79,141, 74,
+216,244,218,181, 27,136,188,122, 31,122,189, 30, 47, 95,190,132, 66,161,192,185,115,231, 32, 18,137, 32, 22,139, 81,100,210, 23,
+205,219,207,195,252,249,193, 92, 92, 66, 70,173,251,255,229,242,103,173,151,223,216,181, 20, 79, 65,130,251,249, 56, 91, 64, 16,
+247, 36, 31,126,248, 97,151, 3, 7, 14,216, 45, 95,190,156, 28, 53,106,148, 23,128,233,125,146, 87, 0, 0, 32, 0, 73, 68, 65,
+ 84, 59, 53,201,176,180,180,244,154, 58,117,234, 91,202, 95,167,211,145,105,105,105, 66,133, 66, 97,254,226,197, 11,171, 59,119,
+238, 8, 77, 77, 77,141,142,145,217,185,229, 75,245,118, 70,199, 14, 30,253,161,164,111,159, 0, 65,215,174, 93, 4, 79, 95,102,
+227,192,137,171, 76,212,217,131,106, 74, 32,162, 90,245,154, 98,116,110, 49,207, 83,170,140,244,103, 52,207,189, 68,244,221,117,
+ 78,221,186,249,229,221,188,121,213, 90,238, 55, 66,153,144,124,139, 34, 9,202,168,212, 41, 19, 19, 19,171,238,221,187,163,160,
+160, 0,141, 60, 60,240,106,225, 66, 32, 63, 31, 40,122,179, 87, 76,145,175, 47, 10,118,237, 66,227,159,127,134, 88, 44, 54,184,
+202,209, 58, 56, 32,241,226, 69, 0,128, 91, 64, 64,197,170, 63,231,198,141, 10,111,128,217,200,145,160,215,175, 7,109,228,150,
+161,191,119,160, 76, 42,149,250,232,116,186,162,164,164,164,187, 54, 54, 54, 79, 66, 67, 67, 29, 87,173, 90,101,177,120,241, 98,
+ 98,209,162, 69,157,122,182, 8, 58,119,249, 73,216, 27, 43, 16,133, 50,170,194, 11,208,172, 89, 51,228,229,229,129,162, 40,152,
+154,154,194,204,204, 12,141, 27, 55, 70, 70, 70, 70,133,242,167,105,218, 24, 79,224, 27,104,180,122,220,136,126, 2,146, 0,154,
+120,180, 68, 39,121, 47,156,191,118, 5, 49, 49, 49, 24, 61,122, 52, 68, 34, 81,197,220, 32,149, 74, 13, 26, 0,106,169,116,217,
+172,233,179,186,180,247,237,136, 35,135,195,112,229, 74, 36,156, 27,181,197,147,232,155,200,105,221, 22,246,142,110,144,154,201,
+ 38, 23,147,180, 87,199, 78, 93,193,178, 44,158, 62,121,156,147,109, 93,244, 86,128, 93, 94, 94,222,222,147,191,157,152,221,190,
+189,143,116,234,244, 41,184,120,241, 15,196,198, 62, 69,122,122, 6, 72,146,196,147, 39,177, 16, 10, 5,112,113,113, 69,124,124,
+ 2, 8,130,200,159,208,119,145,138, 32,136,162,253,231, 55, 26,204,132, 10,139, 8, 57, 30, 20, 16,124,234,225,195,135, 30, 0,
+ 2,173,173,173, 87,234,245,122,112, 28, 7,148,182, 75,191, 7,224,172,157,157, 93,143,160,128,224, 67, 97, 17, 33,227,171,202,
+240,247, 14,108, 60, 96,192,128, 95, 27, 53,106, 68, 28, 58,116, 8, 58,157, 14,105,105,105,124,116,116,116,101,101, 13,127,239,
+192,201,163, 71,143,150, 10, 4, 2,104,181, 90, 60,127,254,188, 8,213, 40,107,127,239,192,230, 51,122,246, 60,216,218,205, 13,
+175,199,143, 7, 87, 92,140,135,118,118,252, 29,189,126, 74,100,108,248,190, 74,199,205,152, 48, 97,130,137, 80, 40, 4,203,178,
+136,143,143, 47, 2,144,100,232,122, 9,130,128, 70,163,193,235,215,175, 81, 80, 80,128,172, 44, 10,201, 87,246,130, 97, 24,136,
+ 68, 34,208, 52, 13,134,249,231, 50,219, 43, 7, 2, 38, 69,171, 52,105,127,150, 62,127,203,191, 54,172,129,188,201,132,222,157,
+ 79,126, 55,101,104, 32,197,179,224, 24,157, 14, 2, 17,108, 26, 54, 51,221,124, 56, 18,105, 57, 5,248, 38, 60, 2, 50,167, 6,
+ 82,152, 88,192, 78, 34,180,165,132,104, 88,211, 31,150, 74,165,212,111,191,253,134, 41, 83,166,192,194,194, 2,219,183,111, 71,
+ 73, 37, 47,128, 86,171,197,145, 35, 71,176,162,125,123, 92, 27, 50, 4,190, 29, 59,130, 32, 8, 10, 53, 20, 41,170, 44, 47, 35,
+ 35, 3,229,251, 65,229,104, 52, 26,236,222,189, 27,115,231,206,197,185,115,231, 96,102,102,102, 80, 30, 80,106,253,215, 20, 3,
+ 80,249, 97,200,245, 28, 20, 16, 44,209,233,116, 54,229,217, 4,197,197,197, 21,138,190,124,213, 95, 89,249, 23, 20, 20, 32, 61,
+ 61, 29, 12,195, 64,175,215,155, 7, 5, 4, 91,214, 40,188, 14,104,181,181, 7,252,242, 60,143, 18,141, 30,153, 5, 12, 22, 30,
+106,143,105,187,219, 34, 41,139, 65,218,139,155, 80,199, 31, 66,113,252,239, 96, 52, 5, 40,209,214, 20,150, 80, 59,188,234, 53,
+ 42, 43,127, 0,208,107,107,111, 48,150,158, 78, 67,165,161, 33, 49,181,171,245, 26, 52,122, 17, 84, 26, 18,198,102, 0, 0,165,
+ 70, 64,247, 37, 81,202,238,139,162, 10,226,242,163,160, 80, 70,169, 89,150,189, 27, 22, 22,134,166, 77,155,194,210,210,210,202,
+208,249, 90,173,214,178, 73,147, 38, 21, 63, 39, 38, 38,138, 47, 94,188,104,115,255,254,125,115,119,119,119,141,157,157,157,218,
+198,198,166,132, 97,152, 28,130, 32,234,148, 41,147,155,147,124,110,199,230,207, 31,174, 95,187, 70,125,225,207, 98,236,218,181,
+ 83,115,248,231,149,209,185, 89,241,103,235, 34, 7, 0, 52, 58, 50,109,239,206,121,132,204,178,153,180,223,128,185, 69,119,238,
+221,182, 30,216,191,173,214,204,210, 82,114,230,204,105,137, 86, 71,167, 25, 35, 71,175,215, 11,109,109,109,193, 48, 12,242, 34,
+ 35, 43,148, 63, 81, 88, 88,106, 73, 2, 80, 21, 23,163,200,199, 7, 69, 57, 57, 96, 51, 50,160,213,106, 13, 46,147,121,158,175,
+112,177, 87,166,220,213, 78, 81, 20, 8, 51, 51,240, 4, 97,148,178,237,238, 57, 74,236,232,232,216,227,244,233,211,182, 65, 65,
+ 65, 30,206,206,206,214, 55, 94, 28,211, 23, 22, 22, 94, 90,191,126,125, 9,195, 48,152, 61,123,182,144,227,184,183, 93, 54,101,
+ 67, 34,202,254,150,173,173, 45,236,237,237, 97,105,105, 9, 79, 79, 79, 0,120, 67,249,215,213, 3,192,243, 60,212, 90, 45,200,
+226,103, 32,181, 41,208,234,244,248,112,120,111,120,181,235, 12, 69, 92, 28, 10, 11, 11,161, 82,169, 42, 22, 8, 69, 69, 53,127,
+ 71, 60,135,175,164,205, 76,205,103,116,235,238,143,219,183,174,227,200,193,125,199, 10,242,210,146, 93,157, 29,208,162,149, 15,
+ 18,226,158, 33, 53, 45, 19, 38,166, 50,171,225, 35,199,245,239,218,205, 15,151, 47, 93,128, 82,153,251, 67, 85,247, 63, 0,168,
+213,234, 21, 91,191, 11,253, 97,206,199,159,224,194,185, 63,240,232, 97, 12, 44, 45, 45, 33, 18,137,224,229,229, 5, 55, 55, 55,
+252,200,110,131,151,151, 23, 76, 76, 76, 52,179,102,205,186,114,245,234, 85, 19,134, 97,140, 74,155, 46,139,107,114,180,182,182,
+ 94, 58,126,252,120, 48, 12,131,158, 61,123,194,214,214,118, 47, 65, 16,209, 83,167, 78, 13, 8, 9, 9,161, 27, 53,106, 52, 46,
+ 40, 32,184, 81,213,243, 35, 99,195,227,207,158, 61,187, 96,207,158, 61,208,233,116, 72, 77, 77,229,162,163,163, 39, 85, 81,254,
+ 3,186,118,237,186, 99,217,178,101, 0,128,139, 23, 47, 66,173, 86, 71, 69,198,134,191,181,197, 24, 25, 27,254,116,251,229,203,
+ 43, 15,172, 90, 5,174,184, 24, 39,108,108,248, 31,245,250,201, 85,148,127, 64,191,126,253,182,126,250,233,167, 32, 8, 2, 87,
+175, 94, 69, 73, 73,201,213,234,228,149,195,243, 28,116, 57,127, 66,151,121, 15, 36,116,176,178,178, 66,108,108, 44,116, 58, 29,
+ 40,138,130, 9,147, 4, 19,253, 75,176,204, 59, 37,243,252, 71,121,235,110,254,176, 79,199,125,193, 3,186,117, 78,202,202, 77,
+155,189,251,196,201,159, 38, 13, 30,236,106,169,115,205,121,249,188,248,211,209,254,166,235,127,185,136, 79, 70,202,161, 76, 77,
+ 82,201,242, 51,164,121, 69,170, 28,142, 69,141,174, 53,160,212, 58,242,242,242,194,250,245,235,145,145,158,142, 31, 22, 44,128,
+217,162, 69,208,177, 44,146,198,143,135,180, 85, 43,152,119,234, 4,145, 72,100,212,158, 95,185,188,175,190,250, 10,233,233,233,
+ 56,116,232, 16,226,227,227,225,235,235,139,134, 13, 27,194,214,214, 22,230,230,230, 70,203, 51, 54, 6,192,144, 1, 16, 22, 17,
+162,158, 60,224,179,156,226,226, 98, 27,129, 64,240,150,203,191,170, 23,160,176,176, 16, 28,199,225,229,203,151, 16, 8, 4,133,
+251,206,109,168,197,129,109, 28, 70, 25, 0, 0,175,210, 48, 80, 22,234,144, 95,172, 71, 65, 65, 1,180, 47,143,225,235, 5,147,
+208,162,229, 76,196, 39, 39,227,171,175,190, 71, 86,134, 45,120,227, 99,175,106,133,209, 22,191, 55, 89, 0,222, 48, 36,255, 38,
+148, 72, 36, 42, 87, 76, 6, 53, 14,203,178, 47,142, 28, 57,210,108,197,138, 21, 84,153,242,183, 47, 44, 44, 20, 57, 59, 59, 23,
+119,233,210, 37,191,127,255,254, 57, 94, 94, 94,197,169,169,169, 38,119,239,222,109, 12,192,232,148,204,162,180, 56, 29,128,120,
+ 70,175,109, 69,144, 4, 56, 70,203,171,179, 95,189, 0,192,217, 57,215,164,187,170,231,204,121,221, 67,177,240,158,195,177, 35,
+107,168, 15, 70,250, 81,118,118, 93, 9,169,169, 86,114,234,220, 29,125,194,171, 28,117, 65,137,190,214,237,137,114,168,172, 44,
+ 8,190,250, 10,217, 83,166, 0, 27,254,218,153, 19,245,234, 5, 85, 94, 30, 24,141, 6,250,166, 77, 81,188,111, 31,114,171,196,
+ 66, 84, 7,207,243,160, 40, 10, 36, 73, 86, 40,120,222,196, 4, 36, 69,149, 62, 72, 18,156, 84, 10,158, 32,192,213,226, 1, 8,
+ 10, 8, 38, 77, 77, 77,187,135,134,134,138,165, 82, 41,162,162,162,244, 58,157, 46,191, 87,203,113, 20, 73,146,162,188,188,188,
+215, 87,174, 92,241, 28, 52,104, 16, 8,130, 48,171, 78,134, 66, 25,133,197,147, 67,192,243, 60, 76, 76, 76,240,224,193, 3,140,
+ 25, 51,166,226,117, 27, 27, 27,120,120,120,160,111,223,190, 24, 48, 96,128, 49,111,217, 27,215,202,168,210, 48, 37,112, 32, 46,
+ 94,190,137,140,220,124, 4,111,218, 11, 0, 96, 24, 6, 69, 69, 69, 48, 53, 53, 69, 81, 81, 81,197,163,108,149,252, 22,150,137,
+ 48,109,210,209,211,134,166,105,220,191,119, 7,122,117,193, 78, 70, 75,255,169,202, 79,255,170,157, 79, 7, 56, 57,185,224,117,
+ 90, 6,250,246, 27, 0,255,158, 1,120,112,239, 54,118,239,252,233,143, 60, 72,171, 77,139, 59,126,253, 71, 29,128, 37, 65, 1,
+193,139, 91,181,106,141,228,228,215,165, 91, 22, 98, 49,156,157,157, 81, 82, 82,130,173, 45,190, 71, 3,138, 66,175, 94,189,196,
+173, 91,183, 70, 76, 76,140,209,215, 30, 20, 16,220,204,220,220,252,247,181,107,215, 10,173,173,173, 17, 29, 29, 13,111,111,111,
+124,251,237,183,244,243,231,207, 27,122,121,121, 65,161, 80, 32, 37, 37, 37, 9, 64,181,177, 55,145,177,225, 91,252,189, 3,197,
+ 14, 14, 14,107, 50, 50, 50,198, 71,198,134, 31, 44,127,205,223, 59,112,200,152, 49, 99, 78,124,244,209, 71,164,153,153, 25,178,
+179,179,177,114,229,202, 18, 0, 11,107, 26, 83,100,108,248, 87,254,222,129,130, 8, 27,155,229,119, 89,118, 98,100,108,248, 47,
+149,228, 13,232, 57,124,230,239,139,231, 79,162, 4, 2, 1,178,179,179,177,106,213,170, 18, 0,159,214, 36,207,222,180,132,136,
+216,210, 13,246, 86, 52, 8,146, 70,194, 61, 30,141, 6,252, 0,173, 86, 11,145, 72,132, 38,154,253,112,180, 17,129,164, 5,200,
+201,248, 13, 13, 45, 45,137,240,239,228,100,224,188,191,151,121,244,190,120,195, 0,240,148,201,169, 37,189,189,139,126,141,186,
+ 31,251,221,197,155, 75, 75,244,218,200, 11,143, 20, 29,166,118,107,233,106,126,231, 48,198,118, 26, 93, 52,103,196, 90,179,188,
+215,241,197, 38, 87,246, 0, 12,131,136,103,201,153, 2, 22,181,230,178,151,227,224,232,136,113, 43, 86,160,176,176, 16,251,246,
+237,131, 89,187,118,111,184,176,235,234, 94, 43,143,216, 44, 44, 44,196,207, 63,255, 12, 51, 51,179, 58,203,227,121,222,168, 45,
+128,218,130,207, 8,130,120,144,152,152,216,215,221,221,189,218, 85,127, 85, 15, 64,121,109, 0,138,162,254, 52, 36,183,234, 22,
+135, 33,140,141, 1, 80,169,117, 40, 40, 86, 35,253,197, 13,184,155,102,224,251, 95,183, 35, 62,237, 22,174,255,121, 1, 26, 86,
+130,160,233,227, 16,190,227, 16,120,230,253, 85,139, 54,198, 3, 80, 14, 65, 16, 16, 8, 4,208,235,171,247, 66, 80, 20, 85, 39,
+ 3,160,166,252,127, 79,153,220,194,194,194,162,243, 7, 31,124,128, 71,143, 30, 65,169, 84,166, 27,146, 67,146,228,139,243,231,
+207, 55, 73, 78, 78,230, 44, 44, 44, 26,232,116, 58, 91,154,166,121, 91, 91,219, 10,151,186,149,149,149,166,111,223,190,154,123,
+247,238, 57, 26, 59, 62,142,211, 17, 0, 76, 1,232, 65, 80,165, 90,175,244,214,165, 0,136, 56, 78, 95,167, 47,134, 66, 25,133,
+ 89, 67,251, 60, 60,246, 91,146, 92, 89,152,160, 47, 46, 82,113, 87,174,151,240,103,207, 61,162,196, 34,193,253,159,207, 68, 24,
+101,217, 9, 4, 2, 93,126,118,182, 80, 32,145,128,189,123, 23,156,139, 11,128,210,123,168,176,176, 16,106,141, 6,106, 0,170,
+ 65,131, 0,181, 26,169, 9, 9, 16,137, 68, 6,125,157,194,152, 24,184,244,236, 9, 94,167, 67,238,205,155, 21,110,127,211, 81,
+163, 0,161, 16, 48, 53, 5,191,103, 15,120, 7, 7,176,155, 55, 27, 28, 95,122,122,122,203,111,191,253,214,166,125,251,246, 8,
+ 9, 9,129, 84, 42,165, 91,183,110, 61,220,196,196,132,182,181,181,133,155,155, 27,134, 12, 25,130,196,196, 68,240, 60,111,240,
+ 6, 44,247, 4, 86,183,202, 47, 15, 72,173,235,252, 4, 2,104,209,212, 9, 5, 37,175,208,204,211, 21,137,119, 50,144,164,211,
+ 67,102, 46,133, 86,171,173,112,251,199,199,199,163, 89,179,102, 21,245, 72,170, 35, 63,241, 74,193, 11, 43,179, 4,157, 78,215,
+168,107,119,127,220,190,117,109,173,186, 48,247,251,200, 75,231,114, 29,156,220,173, 59,119,106, 15,127,145, 16, 82,169, 9,110,
+ 94,191,130, 61, 59,127,186, 44, 41,209, 14, 85,196,124, 89,235,170,128,231,121,216,217,217,193,222,222, 30, 78, 78, 78,176,181,
+181, 69,114,114, 50, 36, 18, 9, 40,138,194,229,203,151, 53,201,201,201, 2, 79, 79,207,186, 4,103, 76,153, 53,107,150,153,147,
+147, 19,246,239,223,143, 35, 71,142,100,180,108,217,210,225,163,143, 62, 66,179,102,205,240,236,217, 51,108,222,188, 57, 79,171,
+213, 14, 51, 84, 8, 40, 50, 54,252,107,127,239,192,223, 34, 99,195, 43,244,140,191,119,224,136, 9, 19, 38, 28,233,222,189, 59,
+ 25, 30, 30,142,254,253,251, 99,245,234,213,124, 94, 94,222,172,200,216,112,133,161, 65, 69,198,134,127,225,239, 29,120, 60, 50,
+ 54,252,207, 74,242,134,142,152,187,231,196,152, 65, 93,136, 49, 11, 55, 99,197,244,158,216, 21,186,150,207,201,201,153, 17, 25,
+ 27, 94,109,134,194,230, 25,129, 47, 91, 52,181, 34,173, 90,244,134, 95,255, 81, 0,128, 43, 59,102,128, 41, 40, 77, 64, 19,243,
+ 74,216,152,234, 33,159, 86,234,176,184,121,229, 52, 60, 85, 23,200,226,231,146,251, 0,218, 25,255, 54,190, 59,149,219, 0, 87,
+205, 4, 0,170, 24, 0, 10,101, 20,235, 41,147,247,107,140, 88,225, 25,101,148, 22, 0, 70, 52,150, 47,233,226,110,183,167,185,
+ 94,235,102,115,124, 53, 32,150,194,170, 88,105, 10,150, 69, 98,110, 97,218,166,107, 79, 87, 31, 77,140, 82, 26, 24,131,158, 97,
+ 24,145,139,139, 11,210,211,211, 43, 38,116,115,115,243, 55,190, 76, 52, 77, 87,236,109,243, 60,207, 2,168,201, 66,170, 81, 94,
+101,197, 95, 46,143, 36,201,218,228,213,184, 5, 80,245, 81,155, 55, 65,171,213,158,249,225,135, 31,122,134,134,134, 10,212,106,
+117,181, 94,128,242,231,106,181, 26,214,214,214,120,240,224, 1,163,209,104, 12,229,214,178,122,189, 30,182,182,182,200,201,201,
+169,113,127,144, 32, 8,136,197, 98,168,213,106, 24,186, 86, 0,224, 57,134, 8,219,185, 1,182,188, 6, 83,167, 15,130,143,111,
+ 75, 60, 84,156,130, 74,157, 15, 16, 66,176,140, 14, 69,218, 34, 12,159, 20,136,111, 54, 28, 53,120,205, 0,192,243,208, 51, 37,
+233, 16,180,218, 76, 48,241,155,121,190,228,205,250, 55, 66, 19, 43,200,156, 90, 19, 57, 57, 57, 28, 0,182,109,219,154,221, 10,
+137,137,137,156,155,155, 91,241,253,251,247, 77,123,244,232,129,248,248,120, 36, 38, 38,130,211, 43, 65,147,106, 80,148, 9,156,
+157,157, 97, 98, 98,130,235,215,175, 3, 64,173,110,246,166,150,114,108, 91,138,150, 66,192, 27, 60,248, 9,253,145,253,139, 76,
+ 94,108, 97, 97, 97, 55,104,208, 32,179, 25, 51,102,192,218,218, 26,243,230,205,227, 81,195, 74,164,156,189,103,191, 86,123,202,
+228, 39, 74, 74, 74,220,120,158, 39,149, 74,165,168, 73,147, 38,230,157, 59,119,102, 88,150, 69, 82, 82, 18, 18, 19, 19,145,152,
+152, 8,134, 97, 68,181,190,121,101,216,187,120, 18,233,175, 19, 26,147, 4,163,248,235, 62, 35, 97, 98,227, 74,115, 60,237,105,
+237,212,180,206,150,216,229,171, 90,201,193,131,235,137, 49, 99,198,138,242,243,243,113,226,196, 9,148,104,191,225,238, 62,120,
+102, 6, 32,211, 24, 25, 37, 37, 37,121,119,111,222,116,232,233,231, 7, 38, 60, 28,186, 17, 35,192,113, 28, 84, 69, 69, 96,180,
+ 90,168, 1,104, 27, 53,130,174, 65, 3,152,147, 36,110, 60,120, 0,141, 70, 99,104, 62, 0,202,140, 84,158, 36,223, 8, 2,228,
+ 77, 77, 65,136,197,128,169, 41,136, 50,101, 91,155,194,109,210,164,137,251,216,177, 99, 1, 0,159,126,250, 41,102,207,158, 77,
+232,245,122, 90,167,211, 65,167,211, 65,173, 86,227,210,165, 75, 8, 13, 13, 45, 38, 73, 50,214,144, 44,142,227, 64,211, 52,186,
+118,237,138,156,156, 28,216,216,216, 0, 40,221, 86,164,105,186,226,251,191,115,231, 78, 99,222,186, 82,153, 44, 7,130, 86, 67,
+167,215,192,179, 73, 3, 92,186,246, 24,188, 72, 6,141, 78,143,146,146, 18, 20, 21, 21, 65, 42,149, 34, 35, 35, 3,103,207,158,
+229,189,188,188, 8,150,101, 97,107,107,251,214,119, 68,161,140,226, 59,249,174,216,124,236,104,120,232,160,193, 35, 49,105,234,
+ 39,237,174, 94,185,180, 87,102,227,140, 39,138, 87,184,113,235, 6,108,204, 69, 72, 77,123,157,157,149,158,254,163, 57, 67,126,
+125, 33,230,235, 90,235, 70, 16, 4, 81,242,240,225, 67,147,246,149,106,176,228,230,230,194,195,195, 3, 20, 69, 33, 41, 41, 9,
+ 26,141,134,123,244,232, 81,143, 39, 79,158, 92, 16, 8, 4,198, 90,242, 13,164, 82, 41, 74, 74, 74,112,244,232,209, 66, 0,141,
+ 98, 98, 98, 70, 44, 89,178,228,251, 6, 13, 26,200,146,146,146,178,180, 90,109,111, 67,117, 80,202,169,162,252, 71,127,244,209,
+ 71, 7,253,252,252,136,243,231,207,131,101, 89,108,222,188,153,127,242,228,201,140,200,216,240,253,198, 12,172,138,242, 31, 53,
+114,238,158, 67, 31, 12,237, 67,124,126, 88,143, 66,162, 33, 62, 91, 19,202,151, 36, 61,154, 89,217, 67, 80,153,240,239,228,100,
+139,214,125, 27,206,158,187, 28, 0,240,252,238, 89,100,197,156, 70, 70, 62, 1, 15,203,166, 0,162,161, 37,100,200, 46, 22,227,
+234,174,143, 97,237, 25,128, 46, 61, 70,160, 75,143, 65,216,179,115, 75,219,111, 3,228,130, 5, 17, 81,239,190,199,106, 36,134,
+ 50, 0,128,106,182, 0,202,202,252, 86, 88,140,199,227,163, 46,143,246,236, 53,253,211, 30,173,214,245,109,226,232,104, 99,162,
+182,202, 43, 82, 43, 47,199,167,101,133, 92,123,186, 60, 92,113,249, 84, 45, 99,248, 42, 40, 40,104,221,103,159,125, 70,181,110,
+221, 26,185,185,185,200,204,204, 4,195, 48, 40,171, 36, 6,119,119,119,152,152,152,224,213,171, 87,136,142,142,102,181, 90,237,
+ 87, 53, 5,236, 25,146, 7,224, 93,228,129, 97, 24,148, 7,239,149, 79, 58,100,217,228, 84,249,127, 35,248, 49, 38, 38,230,163,
+211,167, 79,183,236,212,169, 19,153,146,146, 82,173, 23, 64,173, 86,195,206,206, 14,233,233,233,156, 94,175,143, 7,176,197,128,
+204,205, 31,126,248,225,231,243,230,205,131,135,135, 7,114,114,114,222,218, 39, 52, 53, 53,133,133,133, 5,146,146,146,240,232,
+209, 35, 0, 8, 49, 52, 72,137, 68, 76,108,220,176, 26,175, 51,159, 33, 71,249, 26, 55,254,252, 75,201,147, 4, 7,130,228, 65,
+146, 0, 37, 20,128, 32,141, 48,248, 73, 60,238,214,185, 73,235,181, 43,230,155,119,247, 95, 39, 32,115, 46,128, 75, 59,193,211,
+ 34, 83,216, 54,236, 70, 16, 98,123,254,143,168,187,218, 51, 87,226, 84, 4, 16,179,102, 71,205,165,164, 21,202, 40,222,223, 59,
+ 48,106,216,176, 97,109,186,118,237,234,188,110,221, 58,152,104,207, 34,249,207,159,208, 82, 70, 64,226, 48, 2,113,153, 38,248,
+253,247,223,161, 84, 42,147, 57,142, 51,232, 61, 1,202,242,255, 1,239,143,199,205, 34, 56,142, 37, 72,114,183,253,200,169,251,
+237, 27, 52,108, 6,154,166,241,228,201, 19, 4, 7, 7,235, 95,188,120,113, 67,161,172,189,194,165,162,180,112, 80, 34,128,196,
+201, 3, 62,147,100,101,101, 77, 72, 75, 75,227,239,222,189,139,196,196, 68, 36, 37, 37,225,225,195,135,128, 17,198, 73, 78, 70,
+ 82, 90, 86,234, 75,143,126, 65, 11, 36,205,125,123,122, 93, 57,241,115,131,242,165, 63, 1,192,190, 65,219,190,205, 59, 15, 51,
+ 17,154,218, 80,172,174,152,203, 77,143, 55,106,239,190,140,220,189,123,247, 17,207,159, 43,144,155,155,139,173, 91,183, 2,165,
+177, 48, 70,111, 75,136,197,226,219, 33, 39, 79, 14,109, 31, 22, 70, 8,123,246, 4,179,116, 41,180, 71,142,128,209,106,161,252,
+245, 87,232, 53, 26,112,175, 95, 67,186,105, 19, 40, 55, 55, 92,101, 89,152,152,152,212, 88, 52, 5, 40,205, 2,224, 72, 18,188,
+ 84, 10,162,242,247,203,204, 12, 16,137, 64,152,153,129,164, 40,163, 86,219,241,241,241,105,103,206,156,105, 60,112,224, 64,236,
+216,177, 3,183,111,223, 46,189,240,220, 92, 46, 35, 35, 67,157,157,157,173,226, 56, 46, 19,192,179,200,216,112,131,174,180,242,
+173,137,242,189,254,226,226, 98,152,154,154,190,161,252,235, 74,113,113,113,246,186,117, 63,219,245, 31,218, 29, 98, 81, 62, 6,
+ 6,180,197,131, 63, 21, 40, 44,100,240,252,249,115, 28, 59,118, 12,195,134, 13, 3,199,113, 96, 24,230,220,227,199,143, 27, 19,
+ 4,161, 94,179, 99, 78,181, 70,188, 50,254,234,143,191, 29,231,125,138,139,138,166,248,245, 28,128,222,253,134,225,117,106, 42,
+162,239,221, 64,202,171,103, 97, 47,213,130,185, 69,169, 86,249, 10,229, 87, 70,187, 13,121,158,239,123,230,204,153, 11,167, 79,
+159,174, 54,200,148,162,168, 18,150,101,251,134, 69,132, 92, 7, 32,173,195,229,191, 72, 73, 73, 65,179,102,205, 96,105,105,105,
+166, 84, 42,249,176,136,144, 95,130, 2,130,143,199,197,197, 53, 6,144, 28, 22, 17, 82,167,173, 79,127,239,192,198, 77,154, 52,
+ 9,235,219,183, 47,113,242,228, 73, 20, 21, 21, 33, 59, 59,155,191,115,231,206, 27,129,129,117,144,215,220,169,197,144,131,195,
+135,244, 33, 86, 28, 97,241,252,246, 33,152, 21,223, 67, 73,210,213,105,145,177,225,187,106, 58, 47,112, 94, 20, 23, 50, 35,232,
+229,202,207,231,120, 72,105, 61, 92,132, 42,180, 27,178, 30, 50, 83,111,168,213,165, 54, 23,199,243,120,109, 54, 30,133,234, 20,
+200,174, 28,196,169, 11,103,161,225, 68, 40,201,140,123,244,223, 80,254,149,169,236, 9, 0,106,169, 3, 80,149,195,138, 75, 23,
+ 70, 52,149,223, 88,119, 9, 94, 36, 15, 55, 2, 72,213,242,120,102, 76, 57,224,176,136,144,141, 65, 1,193,199,103,206,156,185,
+220,221,221,125,252,194,133, 11, 41, 47, 47, 47, 20, 20, 20,160, 83,167, 78,176,183,183,199,211,167, 79,113,241,226, 69, 54, 39,
+ 39,231, 32,128,175,194, 34, 66,106,116,225,188,111,121, 52, 77,103, 78,153, 50,197,232, 94, 0, 2,129,160,198,149, 83, 88, 68,
+ 8, 27, 20, 16, 28,184,113,227,198,135, 51,103,206, 20,116,233,210,133,228, 56, 14, 69, 69, 69,208,104, 52, 32, 73, 18, 22, 22,
+ 22,176,177,177, 65,124,124, 60,151,158,158,206,176, 44, 59,198, 64, 17, 32,132, 69,132, 44, 15, 10, 8,254,109,246,236,217,235,
+219,181,107,215,235,195, 15, 63,132,131,131, 3,242,243,243, 97,110,110, 14, 59, 59, 59,228,229,229,225,226,197,139,200,203,203,
+187, 6, 96, 73, 88, 68,136,193, 9,184, 68,173,227,226, 95, 63, 0, 69,210, 48, 53,177,130, 68,100, 6,134,213,131, 97,117, 80,
+235, 56,152,168,121, 8, 75, 8, 40, 85, 58,240,124,237, 91, 85,199,239, 71,101, 78,110, 41,191, 52,111,201, 90, 15, 71,251, 29,
+ 77,190, 88, 48, 73,234,219,110, 14,221,164, 75, 60,127,227,214, 45,253,175,191, 31, 42, 41, 46,214,188, 52, 23, 32, 97,247,221,
+218,111,252,200,216,240, 66, 0, 87,123, 52, 31,107, 55,108,112,215,118,115, 71,230,202,102, 5,205, 4,199,177,216, 22,246, 51,
+142, 29,117,200, 46,209, 82, 15, 35, 99,195,141, 82,100,186,178,252,255,210,159, 8,240, 60,139,251,247,110, 35,252,208, 73,220,
+184,113, 67,157,154,154,154, 12, 64,161, 80, 26, 95,178,184,156,189,103,191, 86, 79,232,187,232,216,193,131, 7,123, 37, 36, 36,
+ 80, 44,203,226,229,203,151,200,202,202, 98, 5, 2, 65,173,117,196, 25,189,234,207,221, 27,102,160, 77,231,254, 46, 93, 7, 76,
+ 20, 77, 88, 24,106,158,149,246,146,229,120, 30, 78, 94,126, 34, 71,111,177,132,231, 25,254,117,236, 21,237,147, 91,191, 37, 83,
+ 4, 91,171,193, 83, 9,219,225,195,135,171,167, 77,155, 38, 73, 75, 75, 67,187,118,237,176,101,203,150,194, 71,143, 30,217, 2,
+ 48,188, 74, 47,227,234,213,171,154,142, 29, 59,254, 57,103,206,156,182,223,127,255, 61,164,171, 87,163, 48, 38, 6,234,199,143,
+161, 47, 44, 4,193,113, 48,127,240, 0,132,141, 13, 66,120, 30, 69, 44,251,248,174,129, 26, 0, 0,160,233,208, 1, 5,183,111,
+131, 36, 73,152,142, 29, 91,225,246,199,206,157, 32,202,131,109,183,108, 1,215,183, 47,200, 90, 98, 0, 8,130,136, 94,184,112,
+161,141,167,167,167,229,152, 49, 99,176,119,239, 94,109, 90, 90,218,249,180,180,180,146,186,150,212,229,121,254,173,128, 63,134,
+ 97,222, 89,249, 3, 64,122,122,250,101,226, 30,225,241,228,222,163,214, 45,124, 91,139,250, 15,237, 14,255, 30,222, 32, 8, 2,
+215,206, 94,134, 74,165, 74, 14, 13, 13,117,181,176,176,208,250,248,248, 20, 6,206,243,127, 96, 72,158, 66, 25,197,123,202,228,
+ 31,253, 1, 50,242,246,237, 27, 11,108,109, 29,154,103,102,164, 42, 84,234,146,144,252,248,171,251, 20,239, 80,213,242, 29, 20,
+187,177,188, 72, 77, 77, 5,195, 48,176,183,183, 39,148, 74,101, 35, 0, 79,194, 34, 66, 74, 0,212,186,234,175,142,200,216,240,
+120,127,239,192,133,135, 15, 31,222,172,209,104,144,153,153,201,221,187,119,111, 82, 77, 43,117, 35,228, 61,245,247, 14, 92,181,
+121,247,200,213, 47, 18,244, 48, 41,184,197,171, 19, 79, 26,101, 76, 56, 54, 79,109,226,150,149,211,227,113,138,149,223,153,108,
+143,224, 38,217,151, 76,103,205,106, 74, 88, 91, 91,195,202,202, 10,182,182,182,200,203,203,195,233,219,169, 92,110,110, 3,149,
+175, 99,210, 38, 31,151,252,136, 78,219, 46,220,124,151,177,190, 43,134, 74, 1,255, 87,187, 1, 6, 5, 4, 55, 6,176,220,205,
+205,109,252,204,153, 51, 41,133, 66,129,243,231,207,179,153,153,153,181, 42,234,255,134,188,247, 69,121, 47, 0, 71, 71,199,214,
+ 3, 7, 14,164,203, 39,144,228,228,100,164,164,164, 64,161, 80,232,245,122,189,209,189, 0, 42,201,237, 13, 96,125,183,110,221,
+124, 70,143, 30,141, 43, 87,174,224,222,189,123,120,253,250,117, 12,128,101, 97, 17, 33,181, 54,235, 0, 0,255, 94, 63,245, 39,
+ 8,190,230,148,178, 74,115, 46,203, 66, 19,117,229,227, 90, 75, 1,151, 51,180,179, 92, 68,233,208,164,137,135,147,187,186, 68,
+ 75,188,206,204, 77, 34, 57,196, 29,139,142,122,167,222, 14,151, 55,200,165, 36, 69, 13,153, 94, 90, 29, 16,219,195,118,240, 20,
+131, 19, 61,150, 71, 25, 93,223,188,169,165, 28,219,150,161, 11,207,163, 1, 0, 36,166, 33,235,219, 95, 17,199,178, 40, 86, 40,
+ 13,110, 95, 25,205,196,126,139,237,121,158,247,102, 24,198, 6, 64, 1, 69, 81, 79,127,185,184,233,181,177,231,183,105,244,145,
+ 45, 45, 18,180,232,216,235, 3,219,142,189, 2, 69, 12, 7,226,101, 66, 2, 50, 18,238,235,254,188,118, 52,147,209,104,159,252,
+153,176, 43,187, 46, 99,242,148,201, 69, 0,186, 3,168, 92,121, 44, 7,192, 53,133,178,246,207,163,114,237,254, 78,157, 58, 53,
+165, 40,170,237,200, 17, 35,136,174, 54, 54, 48,191,113, 3,153,189,122, 33,239,225, 67,148, 68, 69, 97, 31,207,243,133, 60,255,
+ 70, 41,224,234,122, 1,116,232,208, 97,204,153, 51,103, 8,161, 80, 88,186,226,190,118, 13, 60,199,149,222,114,126,126, 32,202,
+226,108,184,187,119,193,179, 44,134,172, 94,205, 55,111,209,226,200,246,237,219,185,154,122, 1, 4,180, 26,111,218,168, 81,163,
+126,167, 79,159, 22,132,134,134, 98,235,214,173,127, 92,126, 18,150, 83,135,183, 10,139, 39,135,140,221,191,127, 63, 81,213, 8,
+168, 78,249,143, 24, 49,130,207,207,207, 63,178,253,196,151, 70,175,178, 61,101,114,194,201,201,201, 3, 64,133, 33,176,101,245,
+ 14, 16,192,225, 86,173, 90, 9,244,122, 61,191, 37,172,110, 53,251,255,237, 4, 5, 4,183,240,240,240,120,252,197, 23, 95, 16,
+107,214,172, 65,124,124,124,107, 99,220,253,198,224,239, 29,248,153,139,139,203,154,148,148,148, 55, 2, 3,255,134,188,213,166,
+238,254,203,139, 94, 93,158,114,229,233,193,125,181,159,241, 54,195,186,204,156, 99,107,107,187,169,125,251,246, 66,169, 84, 74,
+196,197,197,241,201,201,201,186,252,252,252,133, 39,111,110, 51,170,159,192,127,130,170,171,127,224, 47, 15,192,127,213, 0, 40,
+167, 76,113,207, 67,169, 59,242,251,191,171,168,223,183,188,247,193,127,170, 27, 96, 80, 64, 48, 1, 96, 20, 73,146, 63,243, 60,
+ 47,224,121,126, 22,128, 3, 97, 17, 33,255,138,168,210,114, 6,119,148,139, 56, 14, 56,115,207,120, 69, 93, 29,101,251,247,237,
+120, 30,158, 4, 1,158, 39, 16, 59,107, 29,140,202,251,175, 70,142, 12, 36,184,153,107, 81, 80,215,243,255, 27,120,202,228, 48,
+177,105,232, 34,145,202,218,249, 13,158, 98,114,253,212,222, 18,149, 42, 47,186, 36,231, 85,202,223,249,158,122,202,228,205, 1,
+180, 6,240, 84,161,140,170,181,138, 96, 57,255,137,102, 64, 93,186,116, 25,194, 48, 76,133,241, 89,213,205, 95,141,219, 95,219,
+191,127,255,147, 43, 87,174,228, 13, 53, 3,234,213,114,156,157,131,131,131,111, 94, 94, 94, 17, 73,146,215,207,220,219, 85,167,
+239,195,231,211,182, 14,213,106,181, 70,213, 89, 16, 10,133,218,220,220,220, 58, 55, 3, 2,222, 48, 4, 90, 16, 4, 81,124,249,
+ 73, 88,141, 5,147,254, 47, 16, 20, 16,188,138,166,233,137, 12,195, 28, 12,139, 8, 89,246, 62,101,251,123, 7,122, 85,142, 13,
+120, 15,242,218, 84,142, 13,120, 87, 70,201, 63,217,104, 98, 98,242,177, 74,165,250,241,232,213,208,197,239, 99,108,127,135, 50,
+ 3,192,178, 65, 59,233, 63,235, 1,248,255,153,160,128, 96,139,176,136,144, 58,119, 80,172,231,237, 14,129,255, 70,229,253, 62,
+241,148,133, 18, 82,203,251,150,170,124,135, 66,133,242,235,119,110,233,250,119,121,223,221,251,254,215,219, 11,215, 83,207,255,
+ 34,213,121, 0, 80,102, 16,212, 27, 0,245,212, 83,207,127,133,122, 3,160,158,122,254, 93,212,173,172, 85, 61,245,212, 83,207,
+ 59, 82,175,192,235,169,231,159,161,166, 44,128,247, 87,229,165,158,122,234,169,167,158,122,234,249, 87, 81,158, 5, 0,148, 42,
+254,202,175,213,123, 0,234,169,199, 8, 60,101,242,191,101, 44,191, 75,122, 86, 61,245,212, 83,207,127,146,122, 3,160,158,122,
+234,169,150,166,150,126,127,203,232,137,203,191,250,143, 26, 61,158, 50, 57,229,226,226,210,151,227,184, 9,142,142,142, 3, 51,
+ 51, 51, 15, 94,138,249,117,122, 45,231,144,248,171,113, 24, 7,128, 47, 43,142,246, 94, 9, 30,191, 81, 70, 81,148,240,155,125,
+ 11,140,170,200, 88, 23,252,154,141,150, 82, 20,213, 38, 45, 45,237,182, 66, 25,245,143, 5,145,214,243,239,231,173, 32,192,137,
+253, 22, 39, 49, 12,227, 86,195,241,111, 33, 16, 8,178,245,122,189, 83, 88, 68, 72,181,245,191,199,247, 89,152,196,113,220, 91,
+242, 72,146,228, 56,142,123,107,130, 17, 8, 4,217, 98,177,216,105,251,137, 47,255,185,222,137,245,252, 45,134,180,146, 59, 81,
+ 66, 12, 38,120, 80, 28,143, 51, 39,163,163, 12,182,210,172, 76, 83, 75, 57,177,127, 57,156, 56, 29,216,201, 27,145,233,234,234,
+ 34,227, 56, 46, 8, 64, 32, 0,134,231,249, 95, 37, 18,201,161,132,132,151,133,149,143,139,203, 55,110,146,174, 42,223,216,243,
+106,243, 0,180,109,219,182,167,165,165,229, 38,181, 90,221, 76, 44, 22,199,169,213,234,117,119,238,220, 57, 92,254,186,177, 30,
+128, 78, 30, 83, 44, 52, 36,219, 83, 32, 18,183,213,107, 53, 15,197, 28,117,249,246,203, 61,239,148, 61, 50, 99,248, 74, 90,173,
+202, 94, 73,211,130,190, 20, 5, 27,142,227,114,245,122, 62,194,205,189,217,202, 53, 59,230,212,218, 52,162,170, 1,224,231,231,
+103,175,215,235, 15,136, 68, 34, 95,157, 78,103, 86,150, 6, 88,172,213,106,163,205,205,205, 39, 92,184,112,225,141,166, 96, 85,
+ 13,128,166,150,126,127,107,193, 17,151,127,213,232, 57,161,103,139,160,206, 86, 86, 86,199, 58,119,238,236,232,235,235, 11, 11,
+ 11, 11,236,220,185, 19,207,159, 63,183,250,227,209,129,106,107, 63, 4, 5, 4, 11,156,157,157,247,243, 60, 63,214,144,108,129,
+ 64,144,157,151,151,247,183,230,168,133, 19, 55, 61,151, 72, 36, 77, 52, 26,205,113,142,227,190,249,246,192,162,187,239, 42,171,
+ 50,254,222,129, 67, 0, 28,114,117,117,229, 94,191,126,157, 75,146,228,168, 75, 49,191,214,216,222,250,127,157,238,221,191,181,
+167, 36, 86,243, 65,208, 35, 56,142, 61,195,178,185,155,110, 92, 94, 80,151,106,153,255, 95, 81,181, 40,208, 91, 6,192,184,222,
+ 11,244, 17, 17, 17,116,165,186,252,224, 56, 14, 60,207, 87, 60,202, 97, 89, 22,125,250,244, 97,245,122,189,105, 88, 68, 72,181,
+133, 69,198,245, 94,160,191,120,241, 34, 45,147,253,213, 34, 60, 43, 43, 11, 3, 7, 14,196,197,139, 23, 81,245,247,131, 7, 15,
+102, 77, 76, 76, 76,183,159,248,242,157, 10,199,252, 95,164,255,192,157, 26,130,128, 16, 28,192,161,252,115,192,155,255,163,236,
+ 57,199,233,175, 92,158,109,176, 6,125,255,129, 59, 57,130, 0, 81,173, 60,160,210,103, 13,240, 28,199, 95,185, 60,187,214,149,
+224,228,150,114, 73,177, 8,125, 57, 14, 35,220,156,173,187,204,159, 49,210, 54, 87, 89,130, 93,191,156,202,201,200, 41,184,203,
+243, 56, 78,152,224,220,241,235, 81, 53,182, 4,108,106, 41, 39,182, 45,197,102,158,199, 92, 16,224,163,227,164,138,107,177, 46,
+141,102,206,156, 41, 28, 58,116, 40,242,242,242,112,244,232, 81, 28, 62,124, 88, 61,176, 99,122,178,151,155,186, 41, 65,128,227,
+ 9,172,157,181, 14,171,106, 83,230, 85,229,167,229, 8,194,247, 93,144,173,140,120,124, 36,161,182,235, 51,100, 0,116,236,216,
+113,178, 88, 44, 14, 93,190,124,185,164, 77,155,214,120,254,252, 57,150, 47, 95,161, 46, 42, 42, 26, 23, 29, 29,253, 27, 96,216,
+ 0,240,105,246,161, 29,195,242,189, 27, 52,112, 31, 54,120, 88,160,191, 92,238,103,238,230,226, 40, 72, 78, 73,215, 71, 69, 93,
+ 45, 60,117, 50, 60, 50, 41, 41,241, 36, 77, 17,127, 60,120,190, 59,171,182,177, 2,165,202, 95,167, 85, 94, 24, 51,102,156,235,
+ 7,163, 2,165,102,102,102,194,164,196,248,172,189,187,119, 48,119,238,222, 41,112,116,110, 26, 80,155, 17, 80,217, 0,232,212,
+169,211, 92,154,162,190,253,116,194, 4,178, 67,183,110, 48,119,117, 5,149,158,142,124,134,193,245, 39, 79, 16, 26, 26,202,233,
+245,250, 21,119,238,220,249,186,252,156,234, 12,128, 46, 93,186,232, 24,134, 49, 58, 27,128,166,105,172, 88,177, 66,220,191,127,
+127,214, 88, 3,192, 83, 38,167,219,180,105,147,178,110,221, 58,123,138,162, 16, 27, 27,139, 27, 55,110,224,206,157, 59, 59, 82,
+ 82, 82,102, 86,183,162, 15, 10, 8, 22, 56, 57, 57,237,247,240,240, 24,180,113,227, 70,211,184,184, 56, 52,111,222, 28, 28,199,
+129,101, 89,176, 44, 11,142,227,192,113, 28, 38, 78,156,200, 22, 20, 20,212,121,142, 90, 56,113,211, 92,189, 94,223,156,162,168,
+ 80,146, 36,239,239,217,179, 71, 20, 31, 31,143, 3, 7, 14, 32, 57, 57, 57,138, 32,136,111,126,255,253,247,179,239,234,113,232,
+219,118,146,165,153,153, 89,242,134,175,191, 54, 59,115,230, 12, 78,156, 60, 9, 0,169,105,105,105,238, 10,101,212,255,185, 5,
+149,127,192, 38, 27, 7,231,230,177,159, 6, 47,176,177,182,182, 33, 79,221, 72,228,207, 31,250, 46,179, 40,255,149, 79,189, 17,
+ 96, 28,213, 90,228, 38, 38, 38, 56,121,242, 36,104,154,134, 64, 32,168,104,149, 43, 20, 10,223,120,238,236,236,108, 84,153, 76,
+115,115,115,156, 58,117, 10,230,230,230,176,176,176,128,165,165,165,193,223,255,147, 76,236,183,248,130, 94,175,223, 16,126,105,
+243,229,127,122, 44,229, 16, 4,132,247,206,237, 32,196, 66, 26, 58, 61, 11,173,158,133, 70,203, 64,173,101,160,210,232,161, 82,
+ 51, 62,114,162, 9, 0, 0, 32, 0, 73, 68, 65, 84, 40, 42,209, 33, 61,167, 24, 95,124,181, 78, 96,132, 60,226,222,185, 29, 48,
+ 82, 94,173,147,245,176,246,242, 49, 98, 41,189,116,206,132, 62,206, 67,135, 12,177,176,107,216, 73, 64,144,165,195, 24, 61, 41,
+216,252,249,163, 43,174,191,253,246,123,192,225, 83, 87, 83,135,251,200,191, 63,241, 32,106,119,117,114,182, 45, 69, 3,138,162,
+230, 78, 27, 59,157,224, 56,142,216,113,104,151,215,230, 61, 81, 48, 53, 47,173,212,220,176, 97, 67,248,248,248, 32,120,238,100,
+201,137, 31, 90,120, 78, 31, 59, 11, 28,199, 81,219,195,183, 47,219,177, 16, 91,123, 44,135,193,234,111,219,150,162, 1, 15,204,
+155, 53,243, 59,112, 28, 67,108,255,121,209, 56,191,174, 93,198, 13,234, 48,245,185, 74,165,154, 23, 25, 27,126,177,182,107,173,
+252, 54,250,248,248,248,209, 52, 61, 64, 36, 18,205,222,179,103,183,196,205,173, 1, 0,160,115,231, 46, 88,181,106,165,100,245,
+234,175, 86, 1,248,205,144,144,214,141, 38,173,250, 32,104,234,199, 67,134, 12,177,104,218,168,129, 48, 51, 91,201,220,123, 16,
+157,186,253,199,239, 99, 58,117,239,213,178,119,239,222,206,227,131, 70,127, 16,151,144, 52,228,212,169,211, 5,173, 26, 77,222,
+251, 56, 97,111,173,197, 69, 52,234,220,149, 99, 70, 5, 57,207,158,243,169,187, 94,175, 45,121,242,248,218, 85,130, 4, 53,117,
+250, 36,105,118,118,138,228, 69,188, 98, 45,128, 69,198, 92,104,199,142, 29,231, 59, 58, 56,124,251,211,218,181, 16, 42,149, 80,
+242, 60,210,211,211, 65,175, 93, 11, 90, 34, 65,192, 23, 95,192,207,207,143,156, 51,103,206,218, 14, 29, 58,144,119,239,222, 93,
+ 87,147, 44,157, 78, 71,220,220,181, 11,148,157, 29,120,157, 14, 58, 91,219,138, 5,134,240,233, 83, 64,167, 3,175,211, 65,227,
+227, 3,189, 94,143,254,253,251,227,238,221,187,130,254,253,251, 27,237,202,118,112,112,104,234,227,227, 99,111,110,110,142,165,
+ 75,151,114, 9, 9, 9,155, 56,142,219, 31,245,236, 80,181,205,128, 60,101,114,114,208,160, 65,187, 26, 54,108,216,111,227,198,
+141,166, 66,161, 16, 49, 49, 49,200,202,202,130,173,173, 45, 36, 18, 73, 69, 55,208,234, 58, 5, 26,139, 82,169,252,102,218,180,
+105,194,195,135, 15, 79,215,235,245,124,121, 71,208, 47,191,252, 18, 89, 89, 89,242,240,240,112, 57,207,243,177, 11, 39,110, 10,
+222,180,127, 97, 93,238, 69, 0,128, 86,171,237,184,110,237, 90, 97, 66, 66, 2, 78,159,169, 40,222,105,225,226,226,210, 13,192,
+149,119, 30,120, 29, 8, 10, 8,182, 0,176,148, 32, 8,150,101,217, 31, 14, 94,222,146, 86,233, 53, 71, 0,203, 1, 20,234,116,
+186,141, 71,175,134,214, 90,133,211, 83, 38,167,106,218,198,208,235, 77,150,207,155, 55,207, 46, 69,109,139,109,103, 1, 27,211,
+134,132,121,139, 9,246, 37,183,183, 45,130,129, 22,190,245,252,197, 91,119, 51, 65, 16, 96, 89,182,162, 45,166,161,238,120, 4,
+ 65,212,216,157,174,178, 60,130, 32, 96,105,105, 9, 51, 51, 51, 88, 90, 90, 86, 40,250,154,126,255, 79,194, 48, 76, 31,129, 64,
+208, 53,176,215,167, 67,254, 53, 70, 0, 7, 8, 40, 18,123, 79, 63, 6,195,168, 81,172,214, 35, 75,201, 32,175,136, 65,177, 90,
+135,226, 18, 61,138, 74,116, 24,223,207, 11, 4,140,216,182,125,207,242, 72, 14, 75,238,222,121,220,138,226,115, 9, 66,104,245,
+198,107, 20, 45,130,183, 79, 95, 65,195, 38,109,108,198,140,121,105, 53, 44,112,234,194,160, 0,249,129, 48, 35,154, 97, 16, 64,
+181, 6, 38, 89, 75, 91,230,218,208,106, 84, 96, 89, 61, 8,130,192,232, 49,163, 49,112, 8,154, 29, 63,126,252, 66,207, 22, 65,
+ 43, 46, 63, 9, 91, 83,203,233,100,135, 14, 29, 22, 8,133,194, 79,173,173,173, 36, 1, 1,189, 37,253,250,245, 21,148, 43,255,
+114, 26, 54,108, 8,149, 74,213,184,182,177, 88, 88,217, 7,141,157, 48,205,198,217, 90,128, 43, 81, 81, 69,235,215,172,186, 85,
+ 84,168, 12, 45,201, 73,123,126,233,226, 5,107, 11, 27,139, 79, 23, 44, 90, 53,168,115,135,182,146, 30,125,134,216, 68, 92, 60,
+ 55, 12, 64,173, 6,128,128,162,122, 13, 27, 57, 66,172,209,148, 20,233,116,197,197,137,175,174,166,101,100,198, 20,184, 57, 55,
+183, 14,232,211,214, 62, 57, 57,205,191, 54, 25, 64,169,219, 95, 40, 16,124,243,227,218,181, 96,238,223,135,168,123,119, 52,242,
+240, 64, 94, 94, 30,148, 69, 69, 96,147,147,145,191,114, 37, 4, 95,124,129,173, 91,183, 98,204,152, 49,171,123,245,234,117,224,
+210,165, 75, 53,150, 65,166,236,236,144,226,228, 4, 0,120,121,249,114, 69,195, 45,215,238,221, 43,142,201,125,240, 0, 30, 30,
+ 30,198, 12,241, 45, 24,134,121,157,148,148,196,208, 52, 77,183,108,217,146,140,143,143,143, 55,160,252, 9, 0, 36, 77,211,227,
+214,175, 95, 79,150,119, 20, 37, 8,162, 66,225, 83,101,221, 10,203,231,195,186,180, 4,246,247, 14, 60, 77, 16, 68, 91, 0,155,
+ 92, 92, 92,136,222,189,123, 35, 32, 32,128,136,143,143, 39, 34, 34, 34, 96,103,103, 7,142,227, 96,101,101,133,101,203,150, 33,
+ 43, 43,203,123,254,252,249, 7,103, 12, 95,105,103,236, 22, 67,207, 22, 65,103,120,158, 31, 64,211, 52, 18, 18, 18,216,240,240,
+240,202,109,180, 5, 52, 77,255,237,234,118,117, 96,193,224,193,131,151,216,219,219, 99,215,174, 93,227,198,248,207,235,113, 40,
+242,187,196,241,125, 22,186, 2,136,156, 56,113, 98,163,162,162, 34,156, 56,113,130,134, 17, 6,232,170, 85,171,156, 63,240,155,
+ 67,199,196,196,100, 40,148, 81,111,244,152,160, 4,130,241,246,246,246,248,249, 44,160, 44, 1, 10, 74, 88, 20,171, 52, 4, 73,
+210,253, 81,111, 0, 24, 69,181,230, 44,203,178,181, 42,127, 99, 13,128,114, 44, 44, 44, 42, 86,250, 22, 22, 22, 21, 95,162,170,
+191,127, 87, 58,121, 12, 59,175,252,127,236,157,119, 88, 84, 71,247,199,191,115,119,239,118,154, 84, 65, 1, 91,176,215, 24,187,
+216, 53,246,134, 10, 26, 53,121, 99,139, 38,177, 27, 83, 94,141,198, 94,163,198,196, 18,163, 6,177, 27, 11,118,163, 98, 47, 40,
+198, 14,162, 20,165, 72,135,101,219,109,243,251, 3, 33, 26,129, 93,140, 49,201,239,221,207,243,236, 3,187,123,239,119,103,203,
+157,115,230,204,204, 57,217,217,203,162,179, 35,142,190,178,200, 51,166, 77,155,166, 93,184,112,225,254,127,138, 19, 32,129,194,
+194, 75, 16, 69, 51, 62,106,121, 18, 50, 70,194,212,157,141,144,111,146,138,140,117,190,137, 67,190,137, 7, 74,174,180,251,151,
+233, 17, 2, 86,238, 84,131, 88, 78,212,150, 24,215,119,136,188,124, 87, 16,199,154, 4, 0,210, 18, 34,233,131,203, 91,240,248,
+254,175,180, 94,151,185,132, 82,200,114,115,139,247, 42, 70,207, 67,194,234,105,226,119,223,111,249,126, 28, 97,100,112,240, 25,
+128,179,231,175,163, 98,197,138,240,243,243, 67, 94, 94, 30,206,157, 59,135,223,126,251, 13, 46,104,132,239,195,126, 0,149, 0,
+194, 96,238,200,197,200,140,177, 82, 87,108,244, 60, 36,252, 48, 29,223,110,216,244,249, 39,160,192,181, 7, 14,137, 49,231,190,
+247,232,211,167,143,122,216,176, 97, 48,153, 76,179,218,212, 28, 20,113,250,238,182,179, 37,105, 52,108,216,176,139,167,167,199,
+ 87,115,230,204,209,214,172, 89,235,165,231, 35, 34, 34,112,241,226, 69,156, 59,119, 22,146, 36,221,183,246,217,233, 28, 93, 21,
+145, 15, 13,228, 86,116, 58,215,164, 81, 75,135,240, 67,199, 58,156,138, 56,211,108,223,238,237, 57,239,246, 30,228,218,180,113,
+ 3,117, 90,182,153,236, 62,113, 91, 72,200,224,229, 26, 71, 55,181, 53, 77, 0, 32, 12,113,115,208,105,228,215, 35,183,159,124,
+154,114, 45, 35, 51,253,166, 94,205, 18,185, 94, 31,105,244,247,237, 8, 10, 82,206,186, 10, 96, 54,155, 55,141, 25, 51,134, 97,
+ 61, 61,193,118,235, 6, 54, 45, 13, 15,223,123, 15, 36, 39, 7,194,188,121, 0, 91, 16,233, 97, 6, 15,134,186, 85, 43,204,233,
+209,131,124,182,119,111, 40,128,192,146, 52, 41,247,251,204,195,243, 21, 55, 11,145,148,202, 23,238,151,149,243, 15,118,235,219,
+214, 10,254,246,202,149, 43,147,130,131,131, 17, 31, 31,255, 67,187,218, 33, 41, 39,111,135,149, 88, 43,131, 82, 74,163,163,163,
+113,255,254,125, 16, 66,224,224,224, 0,157, 78, 87, 20,241, 44, 28, 16,149, 53, 2,160, 82,169,186,172,220,124, 84,246,235,241,
+195, 75,119,252,184, 8,137,137,137, 16, 4, 1,238,238,238,168, 85,171, 22,146,146,146,112,241,226, 69,212,175, 95, 31, 12,195,
+192,203,203, 11, 44,203,186,160,160,111,182,201, 1, 48,155,205,235,221,221,221,223,237,210,165, 11,249, 97,205, 26,153, 36, 73,
+ 34, 33,196, 0, 64, 70, 8,249,224,104,212,166, 50, 85,220,251, 51, 80, 74, 93, 28, 28, 28, 48,122,244,104,184,185,185,249, 45,
+ 88,176,224,212,144, 78,147,135, 75,146,244,211,184,113,227, 42, 13, 31, 62,188,176, 42,165,201,154, 22, 0, 84,169, 82,133, 95,
+182,108,153,243,234,213,171, 59,180, 10, 8, 74, 56, 27,189,243, 55, 0, 8,112, 9,172,232, 83,187, 83,218,225, 11, 15,203,121,
+ 59, 85, 35,185, 6, 14,198,180, 7,224,159,222,164, 20,130, 77, 53, 81, 0,160, 87,179, 81, 67,213,106,245, 18, 0,142,148,210,
+124,142,227,166,255,114,254,251,181,175,244,230, 1,204, 9, 14,153,228,235,108,154, 15, 62, 95, 14, 86, 43, 38,229,106,102,127,
+ 22, 22,246,245,171,234,253,213, 20,251,107,150, 36,201,170,241, 47,139, 39,156,146,146, 82,100,232,159, 31,229,151,244,248,171,
+240,214, 91,111,181,215,106,181,173, 3, 92, 2,123, 69,103, 71, 28,255, 51, 90,125,250,244, 65,106,106,170,246,231,159,127,126,
+ 37, 39, 96,104,151,169, 71, 5, 65,232,100,237, 56,141, 70,115,114,253,254,111,218, 91, 59,142, 82, 10, 51, 39,192, 96,250,189,
+ 63, 48,152,120,232, 13, 34,242, 77, 60,242, 77, 28, 40, 5, 76,102,193, 22,123,253,218,245,126, 23, 22, 33,101, 92,164, 92,198,
+ 69, 16,109, 69,122,226,252, 35,228,166,255, 62,189,206, 91,242, 74, 61, 61, 38, 39,130,134,158, 29, 60,213,108, 80,140, 59,123,
+238, 60, 78, 69, 68,130,231,121, 60,122,244, 8,209,209,209, 56,124,248, 48,148, 74, 37, 84, 42, 21,114,213,157, 80,163,201,167,
+ 24, 63,126, 34, 23,243, 48,213,234,252,127,161,254,232,121,129, 19, 54,127,137, 69, 18, 7,113,253,110,253,211,242,229, 31,184,
+ 45, 93,186,116,219,148, 41, 83,218, 13, 26, 52,136, 92,191,126,253, 19, 0, 37, 58, 0,142,142,142,147, 71,140, 24,249,146,241,
+231, 57, 14,137,143, 19, 17, 25, 25,137,203,151, 47,225,250,245, 40,209,199,199,231, 59,107,109, 42,100,253,242,175, 83,214, 8,
+ 28,215, 99,192, 7, 94, 93, 58,117,208,181,108,209,194,225,238,163, 52,250,243,222, 51,166, 51,135,119, 62,144,177, 10,101,221,
+118,195,171,219,170, 7, 72,105, 9, 9,119,203, 9,124,178,216,171,133,231,104, 54, 79, 15,184,244,193,225,171,183,183, 37, 61,
+121,168, 38, 12,181,169, 88,142, 70,163,105,220,178,101, 75,228,230,230,162, 74,229,202,120, 52,121, 50, 72, 78, 14,240,135,146,
+212,249,141, 27, 35,119,253,122, 84, 93,191, 30, 42,149,170,126,105,154,188,135, 7,226, 78,157, 2,195, 48,240, 11,252,221, 79,
+ 72,191,122,181,200, 25,112,232,217, 19,178,229,165, 85,201,126,145,182,181,130, 27,104,181,218,111, 57,142,123,144,144,144, 48,
+194,205,205,237,235, 85,171, 86,117,153, 57,115,102,173,169, 83,167, 50, 83,166, 76,249,185, 93,237,144, 58, 39,111,135, 61,121,
+254,188,103,213,245, 36, 0,180, 70,141, 26,200,206,206,134, 76, 38,131, 78,167,131,131,131, 3,170, 86,173,138,212,212,212, 23,
+ 10, 4,149, 5,165, 82, 9,145,209,160, 73,187,190,232,213,187, 31,142,158, 62,141,216,168, 19,232,221,171, 59, 36, 73,130,171,
+171, 43,134, 13, 27,134,173, 91,183,194,217,217, 25, 26,141,198,230, 65, 21, 0, 4,184, 4, 86,232,212,169,211,138, 86,173, 90,
+145, 53,107,214, 80, 74, 41,121, 22,117,253, 80, 16,132,136, 51,247,119,216,180,102,228,117, 33, 8,194,236,176,176,176, 14, 58,
+157,174,250,200,145, 35, 1,192,127,193,130, 5,167,199,141, 27,135,225,195,135, 35, 52, 52, 20,155, 54,109,122,200, 48,204,106,
+ 91,244,246,239,223,159, 86,177, 98, 69,175,181,107,215,166,206,157, 59,183, 94,251, 58,131,107, 61,121,242,100,183,155,155,219,
+135, 95,124, 50, 48,226,135,125,107, 43,202, 43,180,215,230,228,152,136,144, 19, 71,197,140, 91,233,176,100, 45,178,181,189,106,
+181,122,113,255,254,253,117,174,174,174,226,181,107,215,212,145,145,145,243, 1,188,178, 3, 80,209,217, 50,111,242,162,131,114,
+ 39, 87, 31, 36,221,217, 47, 91,179,228,171,255, 2,248,199, 58, 0,197,142,196, 36, 73,178, 41, 2,192, 48,140, 77, 83, 0,125,
+250,244, 65,112,112, 48,186,117,235,134, 22, 45, 90,160,105,211,166, 37, 62,206, 48,204, 43,165, 11, 85,169, 84,232,214,173,155,
+186, 71,143, 30,191, 4,184, 4, 90, 53,170,214,168, 93,187, 54, 62,253,244, 83,173, 90,173,222, 31,220,126, 66,187,178,156, 43,
+ 8,194,108,185, 92,110,156, 54,109, 26, 34, 35, 35, 95,186,109,220,184, 17, 42,149,202,104, 48, 24,230,216,162, 71, 41, 96, 52,
+243,120,154, 43, 96,242,246, 70, 24,177,161, 62, 18,158, 10, 72,126,112, 30,166,216,237,200,143,221, 15,193,156, 11,131,153,183,
+201, 94,191,110,189, 98, 95,195,240,248, 5,227, 15, 0,188, 69, 95,194,209,191,147,146, 34,167, 6,179, 28,106,173,135,213, 99,
+ 45,130, 10, 6, 51, 67,109, 93,201, 15, 20, 56, 1, 77, 39, 71, 36, 53,255, 60, 34, 53, 38, 39,130, 70,220,219,158, 78, 41,157,
+120,225,194, 5, 56, 59, 59,195,221,221,189, 89,105,231,243, 60, 95,167, 74,149,223, 67,211,137,137, 9,248,229,151, 95,112,246,
+220, 57, 84,169, 82, 21,149, 42, 85,130,175,175, 47,212,106,181, 68, 8,185, 91,138,212, 75,100,102, 36, 54, 95,187,236,139,207,
+231,206,249,230,233,209,223,242,241,227,143, 63,166,237,248,126,230,208,184,235,201,141,229,114, 69,153, 58,114,142, 19,143,255,
+184,110,157,228, 89,190,170,247,229, 7,105,187, 66,230, 84,205, 63,120,233,215,109,174,110,110,142, 71,142,223,119,231, 57,225,
+180, 45, 58, 60,207, 59,185,187,187, 67, 16, 4,100,157, 58, 85,100,252, 73, 94, 94,193, 15, 9,128,193, 96, 64,110,163, 70,200,
+203,200,128,152,154, 10,139,197,162, 43, 77, 83,146,164,151, 70,253, 0,138, 66,237, 50,153, 12,112,112,176,249,183,215, 42, 32,
+200,179,124,249,242,135,194,195,195, 91,133,132,132,124,224,227,227,211,228,252,131,221,250,188,188,188,182,243,230,205,123, 44,
+ 8, 2,198,142, 29,235, 44, 73,210, 23, 37, 72, 80,160,160,175,114,119,119,135,167,167, 39,156,157,157, 17, 16, 16, 0, 0, 47,
+149, 8, 46, 43, 41, 89,102,236, 63, 31,135,189, 23, 18, 81,173,110, 19,140,153, 52, 5,113, 25,192,174,221,187,145,151,151,135,
+252,252,124,228,230,230, 22,253,111,171, 3, 16,224, 18, 88,161,107,215,174, 23,118,236,216, 81,161,105,211,166, 8, 10, 10, 34,
+180,224,100,134,101,217, 3,111,218,248, 3,192,206,136,149,105, 12,195,180, 93,187,118,237,253,181,107,215,162,127,255,254,216,
+178,101, 11,134, 15, 31,142,205,155, 55, 99,249,242,229,113, 12,195,180, 13, 61,182, 56,213, 22,189,111,214,142, 19,183,108,217,
+ 18,243,233,167,159,186,142, 31, 63, 62,117,198,140, 25,186, 10, 21, 42,204,172, 88,177, 98,133, 49, 35, 62,120,114,112,237,212,
+159, 26,151,123,116, 67,140,219,155, 47,166, 92, 93, 47, 71,102,173,179,103,109,223, 90, 73, 8,113,116,118,118,166,199,142, 29,
+ 19, 69, 81,148, 8, 33,154,160,192,143, 95,185, 52, 50, 35, 26, 88,199,114,222, 64,114, 24,124,188,116,128,104, 98,230,189, 63,
+244,239,159,219, 46, 1,155, 35, 0,207,135,194,158,119, 0,172, 33, 73, 18,142, 31, 63, 14, 7, 7,135,162,136,193,179,213,254,
+197, 62,222,171, 87,175, 87,178, 57, 42,149, 10, 46, 46, 46, 8, 9, 9,209, 62,121,242,100, 35,128,138,175,162, 83,136,131,131,
+ 3, 26, 52,104,128,193,131, 7,107, 67, 67, 67, 55,149, 69, 47,236,196,210,115, 33, 29, 38,118, 94,186,116,233,209,228,228,100,
+ 77,195,134, 13,225,224,224, 0, 7, 7, 7,196,198,198, 98,214,172, 89, 38,179,217,220,195,214,200, 2,165, 20, 6,179,128,236,
+ 60, 30, 57,122, 30,185,185,185,176, 60,218,141,249, 19,135,161, 86,221, 49,136, 77,124,140, 57,223,124,139,140,167,110,176,101,
+200,254,186,245,108, 69,176,148,184, 1,224,149, 48, 24, 12,175, 69,135, 82,234,169,211,233, 64, 41,133, 40,138,165,134, 38, 69,
+ 81,252,126,231,206, 93,147,190,252,242, 75, 85, 98, 98, 2,182,108, 9,195,211,167,169,168, 94,189, 6,218,181,107,135,190,125,
+251,226,237,183, 27, 65,146, 36, 38, 42,234,198,127, 0,216,188,189, 75,159, 28,147, 3,224, 39,129,183,124, 73, 8,129, 36, 88,
+168, 41,235,209, 33, 0, 18, 69,181, 50,237,201,191,116,229,246,108,133, 66,214,106,231,182,109,218,158,221,171,106, 43, 85,170,
+ 36,115,117,147,156,206,158, 77,116, 75, 76,204,203,102,149,110, 54, 87,102,147,165,165, 65, 62,123, 54, 50, 62,248, 0,116,193,
+130,162,199,149,237,219,195,144,149, 5,193,108,134,240,214, 91,200,223,180, 9,153,126,126,165, 40, 21, 64, 41,253,221,208, 63,
+ 67,210,106,139,166, 3, 24,134, 1,213,233,108,250,229,133,116,152,200,234,116,186, 61,171, 86,173,242,210,106,181,136,136,136,
+200,229, 56,238, 86,251, 58,131,213, 12,195,148,203,202,202,218,115,250,244,233, 79,187,119,239, 14, 66, 72,181,226, 52,162,179,
+ 35,232,212,225, 75, 65, 41,133, 70,163,193,181,107,215, 48,112,224,192,162,231,221,220,220, 80,185,114,101,116,238,220, 25, 93,
+187,118,181,161, 85, 47,190,215, 39, 25, 70,240, 79,182, 33, 61,203, 19,143,180, 77, 17,236,191, 14,166,250, 95, 96,195,170, 3,
+200,203,203,131, 70,163, 65, 94, 94, 30,242,242,242,160,211,149,234, 59, 21, 17,224, 18, 88,161, 87,175, 94, 23,183,108,217, 82,
+ 33, 38, 38, 6,201,201,201,216,190,125,123,130,197, 98,153,166, 82,169, 62,140,143,143,255,219, 86,253,135, 30, 91,156, 58,184,
+227,164,144,181,107,215, 94,111,214,172, 25,234,212,169,131,152,152, 24,172, 92,185, 18, 12,195,188, 95,150, 50,217, 0,112,230,
+254, 14, 67,211,202,189, 47,232,245,250,222, 91,182,108,201,104,208,160,129,220,217,217, 57, 19,128, 50, 37, 41,158,217,191,241,
+155,148,140,140,140,209,183,211, 78,148,121, 43, 37,165, 52, 47, 50, 50, 82,231,232,232,136,248,248,120, 66, 41, 53,238,140, 88,
+249,202, 29, 11,149,105,249, 39,183,247,177, 21,188,125,112,255,218, 97,128,209,136,211,127,218,252,198,166, 96,202, 74,177, 14,
+ 0,165,212,166, 41, 0, 91, 34, 0, 64,129,103,191,127,255,254, 98, 23,251,149,244,120, 89, 81, 42,149,112,118,118,198,209,163,
+ 71, 77, 81, 81, 81, 35, 94, 89,232, 25, 14, 14, 14,136,143,143, 71, 88, 88,152,193,108, 54, 15, 43,235,249,133, 78,192,246,237,
+219,143,186,184,184,104,154, 54,109,138,232,232,104,204,153, 51,199,100, 54,155,187,151,101, 90,129, 82,192, 96,226,144,171, 55,
+ 34,229,193,121,248,235, 82,177, 98,203, 26,196, 38, 95,192,185,223,142,130, 19, 52, 8, 25, 17,130,176,181, 59, 64,121,235, 1,
+ 20,138,178,232,189,190,108,209,182, 68, 0, 10, 33,132,128,101,217,231, 23, 51,189,128, 76, 38,131,209,104, 44,246,185,226, 40,
+110,255,127,223,150, 31, 41,178,179,179,223,117,119,119, 95,223,178,101, 75, 36, 36, 36, 32, 39, 39,167,212,249, 67,163,209,248,
+195,177, 99,199, 62,122,252, 56,145,167,148, 58,196,197,197, 65, 46,151,227,249, 69,128,174,229, 92,209,173, 91,119,217,111,191,
+221,236,102,107,251, 36,137, 99, 1,248, 2,200, 1,145, 21,108,159, 43,248, 42,149, 0, 92, 68,158, 83,217,252,102, 81,176,237,
+112,112,199,143,102, 68, 94, 51,236,113,243,208,231,137,124,126,254,158,125,143, 42,157,142,224,157,136,164,232,247,243, 73,219,
+ 22,152,177, 44,155,155,147,158,238,172, 80,171, 97,185,114, 5, 98,159, 62, 0, 10,250, 8,125, 94, 30,140,102, 51, 76, 0,140,
+221,187, 3,102, 51,146, 30, 61,130, 82,169, 44,213,211, 99,239,220, 65,133,150, 45, 1, 0, 25,145,145, 69,209, 0, 93,239,222,
+128, 86, 91, 96,252, 67, 67, 1,119,119, 96, 78,233, 65,178,148,148,148,217, 75,150, 44,105,254,246,219,111, 99,233,210,165,208,
+106,181,218,122,245,234,165,104, 52, 26,157,187,187, 59,124,125,125,209,179,103, 79,196,199,199,131, 82,250,160, 52,173,231, 23,
+ 63,255, 17, 66, 8, 24,134, 41,211, 2, 64,160,224,115, 42,135, 91, 24, 21,220, 9, 71, 78,158,195,181, 56, 5,254,203,253, 7,
+174,174, 44, 56,142,131, 94,175,135, 78,167, 67, 94, 94, 30,244,122, 61,244,122, 61, 36,169,244,148, 17, 1, 46,129,218,158, 61,
+123,158,221,182,109, 91,133,180,180, 52,164,166,166,226,171,175,190, 74, 72, 78, 78,110, 23,157, 29,241, 8,192,246, 50, 53,242,
+ 53, 51,168,221,120,111,134, 97,182, 77,156, 56, 17,117,234,212,193,173, 91,183, 80,167, 78, 29, 76,155, 54, 13, 11, 22, 44,216,
+ 84,184, 48,176, 44,154,151, 30,237,205,109, 82,169,215,233, 79, 63,253,180,207,143, 63,254,152, 5, 64,102, 54,155,213,189,123,
+247,246, 77, 73, 73, 25, 23,157, 29, 17,247, 42,109,181, 88, 44, 83,162,162,162,150, 16, 66, 28, 0, 24,120,158,159,254, 42, 58,
+133, 36,230, 40,167,175, 93,246,245,124,240,122, 57, 88, 7, 33, 41, 79,109,109, 81,241,223,202,159,114, 0,108,185, 24, 8, 33,
+200,207,207,135,131,131, 3, 28, 29, 29,139, 70,194, 64,193, 8,174,184,199, 95, 5,149, 74,133,147, 39, 79,154,214,172, 89, 19,
+ 20,157, 29,113,228,149,133,158,145,144,144,128,153, 51,103, 26,140, 70,227, 43, 47, 4, 44,116, 2,126,248,225,135,163,233,233,
+233,154, 61,123,246,148,217,248, 3, 0, 36, 1, 97,235, 23,192,131,154,241,225,200,238,104,212,184, 14,162,162, 15,192, 96,202,
+ 1, 1, 11, 65,180, 64,111,166,232, 51, 44, 4, 11, 23,238,180,174, 39,190, 94, 61, 74,161, 23,140, 41,148,173,187,156, 8,177,
+ 75, 41, 53, 38,190,240,188, 66, 83, 14,206,229,235,145,140,204, 12, 1,128,169, 65,131,146, 23, 55,197,199,199,115,190,190,190,
+143, 34, 35, 35, 43,183,105,211, 6,177,177,177,136,143,143,135,196,103, 67,206,152, 32,147,105,224,227,227, 3,141, 70,131,115,
+231,206, 1,128,213,122,224,133,251,255,213, 90,199, 79,136,130, 98, 84,144,120, 59,252, 66,112,154,183,183,119,211,166, 77,155,
+106, 59,118,236, 8, 66, 8, 54,110,220, 40, 8,130,240, 99,105, 90, 55,111,222, 76,246,247,247,247, 54,155,205,253, 41,165, 95,
+ 36, 37, 37, 85,117,113,113,145,185,184,184, 16, 81, 20,145,152,152,128,248,248, 4, 36, 36, 36,128,227,184,114, 40, 48,227, 86,
+189,100,207, 10, 1,178,148,199, 15, 63,144,203,153, 21,191, 71,214, 24, 0,109,242, 53,110,113, 45, 92,188, 42,121, 91,211,248,
+ 35,201,201,217, 95, 79,154,244,165, 71,207,158, 61, 61,244,122, 61,194,195,195,221, 47, 71,110,198,131, 7, 15,150, 3,104, 98,
+139,134,209,104,188,122,229,194,133,142,237, 90,183, 6,191,117, 43,196, 62,125, 32, 73, 18,242,243,242, 32, 90, 44, 48, 1,176,
+ 84,169, 2,139,159, 31, 28, 0, 92,184,118, 13,102,179,185,244, 85,231,207, 22, 1,210,103,134,191,104, 58,192,193, 1,208,233,
+ 64,116, 58, 16, 27,162,139, 0, 80,173, 90,181,193,131, 6, 21,228,237,153, 48, 97, 2,198,142, 29, 43,231,121, 94,199,113, 28,
+ 56,142,131,201,100,194,175,191,254,138, 85,171, 86,197, 49, 12, 83,170, 55, 81, 56,245,217,162, 69, 11,100,100,100,192,205,205,
+ 13, 0, 96, 54,155, 33,151,203,139, 34,158,235,215,175,183,169,109, 0, 0, 2,188, 83,211, 11, 60,205, 68,237,234,126,248,245,
+112, 44,178, 12,111,161,122, 69, 14,102,179, 25,121,121,121,208,106,181,136,141,141, 69,245,234,213,109,138, 0,248,250,250,254,
+176,121,243,102, 63, 73,146,144,145,145,129,113,227,198,197, 39, 38, 38,182,123, 85, 35,248, 58, 9, 10,252,216,131,101,217,211,
+ 19, 39, 78,172, 22, 18, 18,130,141, 27, 55, 98,213,170, 85, 40, 92, 3, 0,192,111,193,130, 5,167,135,118,153,218,114,243,145,
+133, 79,172,200,189,192,229,184,125, 9,157,234, 15,141, 89,189,122,117,237,143, 62,250,200,244,209, 71, 31,249,230,231,231,111,
+251, 51,239,251,151,243,223,111, 2,176,233, 85,207,255, 35, 95,108, 13, 91, 2, 96,201,235,210,251,171, 41,214, 1,224,121, 30,
+126,126,126, 69, 91,248,152, 63, 92,168, 50,153,172, 76,158,176,217,108, 46, 90, 84, 83,104,236, 9, 33,176, 88, 44, 47, 61,254,
+170, 92,191,126,253,124,108,108,236,146,232,236,136,131,214,143, 46,157,187,119,239, 98,198,140, 25,127,202,248, 23, 82,232, 4,
+236,219,183,111,147,217,108, 30,241, 42,122, 42,181, 10, 11, 23,204,194,227,167,247,144,145,253, 24,231,111,236, 42,122,142, 16,
+ 10, 66, 40, 24, 2,200, 88, 57, 8,177,222,113,150, 77,207,134,213,216, 12,190,108,217,180,218,220, 57, 95,141,175,217,170,221,
+ 28, 29,147,113, 12, 82,242, 47, 84,174,212,193,221,191, 37, 33, 42, 79,233,196,233, 43, 89,225, 17, 49,113, 4,248,250,155,181,
+ 37,167, 39,141,206,142,144,218,214, 10,238,218,187,119,239,197, 45, 90,180,232, 62,119,238, 92,168,205, 7,145,120,227, 7,212,
+113, 33, 80,123,245, 69,204, 83, 13,246,239,223,143,236,236,236,157,146, 36, 89,221, 18, 87,184,255,127,216,144,217,144, 36, 1,
+166,245, 83,235,116, 30,184, 0, 10,149, 51, 40,165,136,137,137, 65, 88, 88, 88,206,211,167, 79,251,157,185,191,227,182, 53,189,
+248,248,120, 46, 62, 62, 62, 12, 64, 88,189,122,245,202,115, 28,119, 47, 39, 39,199,225,234,213, 43, 72, 72, 72, 68, 66, 66, 2,
+110,220,136, 2, 10,156,147, 82,141,127, 70,106,194,241,180,164, 71, 67,186,132, 76,242,172,217,184,221,248,211,191,172, 11, 42,
+ 28,250, 19, 0,213,154,184,157,124,235,157, 97,239, 40,117,110, 74,193,172,231, 51,146, 31, 92,176,214,190, 66, 78,221,217,218,
+225,235,177,107,164,228,228,100,146,157,157,141, 13, 27, 10,210, 47, 40,149,202, 18, 87,232,255, 17,149, 74, 53,108,233,222,189,
+ 79,222, 14, 11, 99,148,237,218, 65,252,236, 51,152,119,237,130,104,177, 32,103,203, 22,112,102, 51,164,199,143,161, 93,178, 4,
+108,197,138, 56, 35,138, 84,163,209, 12, 41, 77,147,114, 28,232,179, 48,255,243,125, 11, 28, 28, 0,173, 22,196,193, 1,140,141,
+125, 76,108,108,236,161,131, 7, 15,142,236,214,173, 27,214,174, 93,139, 75,151, 46, 1, 0, 50, 51, 51,185,212,212,212,228,244,
+244,244,120, 73,146, 78, 1, 88,124,234,206,214, 82, 67, 70,133, 83, 19,133,115,253,249,249,249,208,233,116, 47, 24,255,178, 34,
+137, 18,212, 90, 10, 99,182, 5, 53, 2,170,161,210,169, 61,136, 76,241, 2, 67, 8, 24,163, 17,122,189, 30, 90,173, 22,169,169,
+169, 56,116,232,144, 88,163, 70, 13,153, 40,138,112,119,119, 47, 54, 12, 80,175,124,231,182,223,125,247, 93, 79, 39, 39, 39,114,
+230,204, 25,241,131, 15, 62,136,127,244,232, 81,135,232,236,136,248, 87,106,224,107,134,101,217, 81, 67,135, 14,125,222,248,199,
+ 16, 66, 6,173, 90,181, 42, 12, 64,245,225,195,135, 35, 59, 59,219,111,205,154, 53, 51, 0,148, 57, 82,155,144,144,112,236,219,
+111,191,173,171, 82,169,188, 14, 28, 56, 64,243,242,242,182,189,254,119,241,191, 67,177, 14,192,249,240,137,216, 23, 65, 32,218,
+144,188,212,150,139, 52,225,246, 70,132,238, 77, 4, 47, 20, 8, 22, 78, 27, 36,222,217,132,208,189,137, 16,196,223,251,200,178,
+134,216, 10, 57,120,245,199, 54,175,116, 98, 49,140, 26, 53,234,181, 24,255, 66,194, 78, 44, 61, 7,160,202,171,158,111, 52,113,
+136,125,124, 13, 50, 70, 14,157,166, 28,212, 74, 7, 8, 34, 15, 65,228, 96,178, 72,200, 55, 83, 40,141, 4, 89, 6,206,166, 41,
+ 25,163,185, 44,122,214,127, 4,123, 34, 35, 78, 14,175, 19,216,246,211,207,230,188, 95,222,115,237,152,255, 78, 26,230,223,184,
+225, 56,109,181,230,177,244,220,133,139,121, 91,247,111,127,162,207, 55,111,112,100,177,110,195,149, 8,171,243, 0,167,238,108,
+141, 6,208,163, 77,205, 65,173,251,246,108,177,124, 92,223,204, 6, 99, 66, 70, 67,146, 36,252, 16,182, 22,187,119,121,157, 55,
+ 90,100, 19, 79,221,217, 90,166, 57, 63,158,183, 64, 18,121, 80, 74,113,246,236, 25, 36,165,228,224,214,173, 91,241,121,121,121,
+187, 0,172, 56,117,103,107,153,230, 38, 1,224,183,223,126, 75,105,208,160, 65,231,221,187,119,159,120,252, 56, 81, 35, 8, 2,
+ 30, 62,124,136,140,140, 76,163, 36, 73,147,173,157, 47,240,134,175, 54, 44, 24, 69,235, 55,123,183, 71,139,174, 67, 93,223,155,
+188,234,173,180,228, 71,102, 73,146,224, 93,163,149,107,249,218, 26, 47, 42,242, 98,226,237, 83, 25,119, 47,253,114,136,178,228,
+ 43, 91,219,214,182, 86,240,175, 83,167, 78,197,144, 33, 67,144,158,158, 14,127,127,127,108,222,188, 25,177,177,177,167, 1, 52,
+181, 69,227,204,153, 51, 79,155, 52,105, 50,101,220,184,113, 75, 86,172, 88, 1,237,172, 89,200,187,125, 27,198,155, 55,193,229,
+229,129,145, 36,232, 34, 35,193,184,186, 98, 9,165,208,139,226,127,175,148,146, 3, 0, 0, 44,111,191,141,156,107,215, 10,194,
+254,253,250, 1, 90, 45,160,211,129,110,218, 84,228, 16,208,197,139, 65,123,244,176,218, 62, 66,200,248,201,147, 39, 55, 11, 8,
+ 8,168, 51,112,224, 64,108,220,184, 49, 35, 57, 57,185, 97,114,114,242,147,178,102,212,163,148,190,180,224, 79, 16,132, 87, 54,
+254, 0,144,159,159,127,118,209,183,219,218,244,235,215, 12, 10, 86,143,129, 93, 27,161, 74,212, 49,164,230, 72,248, 53,250, 62,
+246,236,217,131, 94,189,122, 65, 20, 69, 8,130, 80,239,230,205,155,163, 9, 33, 79, 74,202,210,232,234,234, 58,187, 77,155, 54,
+142, 19, 38, 76,200,218,183,111,223,201,184,184,184, 15,162,179,173, 95, 83,111, 10, 66,136, 44, 45, 45, 13,203,151, 47, 71,104,
+104,232, 3, 73,146,218,110, 59,185, 60,121, 72,167,201,109, 87,173, 90,117, 42, 39, 39,167,186, 94,175, 7,165, 52,235, 85,244,
+163,179, 35,132, 0,151,192, 13,211,166, 77,251, 38, 35, 35, 99,158,189,200,214,159,227, 37, 7, 64,161, 80,196,247,110, 35, 85,
+205,146, 90, 67,124, 57, 85,255, 75, 36, 37, 37,165,230,231,231,151,152, 82,148,101,217,248, 86, 53,162,171, 62,206,238, 4, 65,
+ 44, 48,238,148, 82, 68, 71, 71,163, 85,141,104, 60,206,238,244,194,235, 36, 36, 36,164,158, 62,125,218,106,158,242,191, 10,173,
+ 86,123, 44, 63, 63,255, 31,149, 9, 80,162,146,165,107,200,186, 82,211,251, 22, 29, 43, 73, 86, 19,236, 72, 18,165, 93, 67,214,
+217,228,105, 73,146,100, 83, 39,186,241, 86,132, 9,192,234, 94,205, 2,183,143,153,186,120,108,181,202,222,239,153,140, 22, 60,
+126,154,185,131,145,176, 98,247,245,136, 50, 23, 61, 57,125,119,219,153,147, 11, 2,251, 2,178,162, 16, 31, 1, 21, 39,245, 78,
+233,221,230,203, 8,155,182,177, 1,191,239,255, 95,191, 97,234, 39, 0,104,124,138, 98,255,206, 19,135,126,148, 36,233,225,233,
+187,219,172, 78, 33, 88, 35, 42, 42,234,114,195,134, 13,123, 92,186,116,249, 11, 81, 20,155, 74,146,116, 7,192,194,168,168,168,
+ 83,214,206,189, 30,179, 41, 21,192,200,250, 85,254,211,244, 78,228,175,159, 53,105,223,191,121,147,246,193,174, 22, 11, 7,153,
+ 66, 39, 79,137,189,154,243,219,185, 29, 23,169,193, 60, 63, 42,110,227,153,178,180,235,212,157,173,237,219,212, 28,196, 47, 92,
+184,240,133,235, 92,161, 80,180, 41,139,206,229,203,151,151, 55,109,218, 84, 26, 50,100,200,146,254,125,251, 50,205, 38, 76,128,
+247,249,243,120,234,226,130,172, 27, 55,144,146,145,129, 77, 10,133,148, 39, 8, 95, 93,185,114,101,190, 53, 61, 65, 16, 80,169,
+ 82,165,130, 17,247,162, 69, 5,233,167, 1,192,205,173,104, 0, 64,123,244,128, 36, 90, 79,254,247,235,173, 45,166, 14,117,135,
+244, 25, 49, 98, 68, 84,120,120,184, 67,255,254,253,221, 86,174, 92, 89, 33, 58, 59,162,204,206, 28,240,242,138,255, 63, 99,252,
+ 1, 32, 37, 37,165, 99, 68,248,193,225, 17,225, 7,231, 6,118,239,230,222,175, 95, 51,116,238,208, 20, 32, 4, 23, 14, 30, 67,
+126,126,254,142, 85,171, 86,245,119,116,116, 76,107,212,168,209,189,224, 79,219,126, 92,154, 94, 82, 82,210,160,192,192,192,157,
+121,121,121, 51,175, 38, 28,248,211, 57, 79, 94, 55, 28,199, 45, 58,114,228,136, 72, 41,117,145,201,100, 11,195, 78, 44, 77, 5,
+ 10, 22, 6,134,116,152,216,234,231,159,127, 30, 11, 64,195,178,172, 77, 59,160, 2, 92, 2, 91, 2,232, 1,192, 11,128,103,225,
+223,140,140, 12, 47, 0, 61, 3, 92, 2,159, 2,120,254,118, 36, 58, 59,226,196, 95,240,214,254, 95,242, 82, 45,128,144, 14, 19,
+189, 84, 42,213,121,179,217,108, 53, 13,151, 90,173, 78, 54,153, 76,205,194, 78, 44, 77, 44,233,152, 33,157, 38,123, 41, 20,138,
+ 23,244, 8, 33,148,101,217, 35, 60,207,119,166,148, 22, 93, 97, 26,141,230, 49,199,113,205,203, 58, 55,100,231,159, 71,143, 38,
+129,110,146, 4,114,240,106, 68,250,159,209,121, 62,127,127, 89,242,254, 23,167,243, 42, 69,128, 10,121, 19,229,128, 3, 92, 2,
+137,198,173, 82,119,181,206,229,235,214,221,223,175,116,238,192,198, 39,249,250,236,153,166,172, 71,191,252,153,145, 78,128, 75,
+224,103, 0,230, 1, 88, 16,157, 29,241,153,173,231,253, 21,197,128,154, 53,107,198,139,207, 25,246, 63, 70,252,138,187, 63,122,
+244,104,245,176, 97,195,132,210,106, 1,180,175, 51,184,141,151,151,215, 15, 89, 89, 89, 15, 24,134,233,127,240,234,143, 22, 91,
+223, 39, 0,124,254,225,138, 4,142,227,108, 42,130,166, 80, 40,210, 51, 51, 51,203, 84, 12, 40,192, 37, 80,238,237,237, 61, 28,
+ 64,145, 35, 48,117,220, 60, 72, 60,175,174, 91,183,174, 19,207,243,210,242,176,207,254,212,181, 98,199, 78, 89,121,201, 1,176,
+ 99,231,159,198,159, 53,222,255, 54, 2, 92, 86,201,116,229,162,170,231,171,156,226,162,239, 44,181,125,171,195,107,230,117,151,
+ 3,126,147,213, 0,255,169, 60,231, 8,204, 32,132,196,158,188, 29,102, 83, 74,102, 59,118,254, 10,236, 14,128, 29, 59,118,222,
+ 8,118, 7,192,142,157,127, 22,118, 7,192,142, 29, 59,118,236,216,249, 31,228,245,101,121,177, 99,199,142, 29, 59,118,236,252,
+107,176, 59, 0,118,236,216,177, 99,199,206,255, 32,127,106, 78,206,142, 29, 59,118,236,252,125,180,174, 62, 64, 75, 8,121,155,
+ 82,122,239,117, 20,255, 9,172, 49,208,157, 97,152, 0, 81, 20, 99,254,142, 98, 66,118,222, 44,255,170, 53, 0,175,123, 85,242,
+ 95,165, 89, 26,109,107, 5,107, 40,165,125, 88,150, 29,230,234,234,218, 36, 45, 45,109,230,201,219, 97,203,254, 76, 27,254, 44,
+ 31,245,159, 53,139,231,249,233, 12,195,200,149, 74,165,232,232,232,184,244,155,181,227,172,102,216,179,243,215, 16,220,126,194,
+ 46, 66, 72, 63, 0,160,148,158,216,250,235,178,142,127,119,155,236,252,179,104, 87, 59,164, 30,128, 73, 78, 78, 78,253,106,214,
+172,169,137,141,141, 69, 90, 90,218, 5,153, 76, 54,244,196,205,208,135, 86, 5,254, 64,155,154,131,252, 8, 33,155, 61, 60, 60,
+ 90, 87,171, 86, 13, 15, 30, 60,248, 83,122,118,254, 29,188,113, 7, 96, 84,159, 25,114,147, 33,125,134, 92,206,118,150,201,224,
+ 38, 73, 82, 38,207,211, 19,190,254,213,103,148,148,253,170,144, 63, 26,235,145, 61,122,168,226,239,220, 89, 67,213,234, 14, 22,
+133,194,141, 18, 2,149,197,146, 73,140,198, 83, 21,188,189, 71,110, 56,127,254,133,170, 78, 37, 57, 0, 45, 90,180,136,230,121,
+222,223,214,247, 32,151,203,159, 14, 31, 62,188,210,200,145, 35,197,178, 56, 0,237,106,135, 12,240,241,241,217,208,172, 89, 51,
+109,131, 6, 13,160, 84, 42,177, 96,193,130,164,237,167,190,173, 96,203,249, 1,125,102,200, 61,179, 93,135,202, 88,182, 39,165,
+180, 62, 40, 0, 34,187, 33,241, 92,248,211,114, 25, 27,163,109,220,151,220,191, 70, 96,160,130,197,251,162,132,157, 50,175, 70,
+215,203,151, 47,159,252,211, 79, 63,193,205,205, 13,185,185,185, 24, 55,110, 28,238,221,187,231, 87, 90,126,135, 66,222,114, 14,
+ 36, 27,166,161, 60, 0,124,176, 0, 41,149, 42,249,212, 97,155,230, 0, 0, 32, 0, 73, 68, 65, 84, 59,241, 60, 31, 76, 41, 13,
+ 1, 0, 66, 72, 24,203,178, 91,227,226,226,115,159, 63,206,214,173,124,147,222, 91, 84,143, 16, 50,149, 16,210,140, 82, 90, 81,
+ 38,147, 37, 1,184,196,243,252,162,165,161, 83,175,217,162,241, 87, 17,224, 18, 72,130, 3, 16,228,232,198,244, 32, 20,141, 64,
+ 64, 8,112, 61, 47, 83, 58, 88,237, 62,182, 5,219,184,119,127, 80,187,241,238, 12,195,172, 1,160,149, 36,105, 2,195, 48,215,
+ 15, 28, 56,160,148,201,100,232,209,163, 7, 4, 65,168,199, 48,204, 2,141, 70, 35,153, 76,166,255,216, 90, 74,213,206,235,161,
+142,103,199, 30,132,144, 25,148, 82,119, 74,105, 22, 33,100,206,173,167,199,119, 89, 63,243, 69,158,229,146, 40,236,195, 36, 0,
+180,172,217, 10, 1,160,115,131, 97,206,162, 40,222,157, 63,127,126,249, 1, 3, 6, 64, 38,147,193,100, 50, 97,231,206,157,152,
+ 61,123,118,190,201,100,122,251, 89, 54, 77,155,104, 93,125, 64,101,173, 86, 27, 53,111,222, 60,199,160,160, 32, 0, 5,117, 90,
+118,239,222,253, 74,122,118,254, 61,188,209, 41,128, 81,125,102,200, 57, 75,246,209,144,193,195, 42,246, 15, 10,214, 58, 56, 56,
+ 40, 18,226, 99, 77, 27, 55,172,237,122,249,202,229, 22, 95,142, 92,213,193,154, 19, 80, 72,151,202,149,123,154, 28, 29,183, 15,
+155, 58, 85,209,164,121,115,120,121,123,195,144,155,139, 7,247,239,123, 94,185,116,105,208,225, 3, 7,250,117,244,243, 27,118,
+ 60, 33,193,106,101, 44,158,231,253,207,126,247,157, 92, 94,161, 2, 40,199,129,115,115,131, 68, 41, 40,165, 80,220,187, 7, 88,
+ 44,160, 28, 7,115,131, 6,224, 69, 17,189,122,245,242,186,118,237, 26, 11,192,122,170,178,103,180,175, 51,216,167,122,245,234,
+ 63,127,246,217,103, 10,179,217,140,235,215,175,227,194,133, 11, 82, 90, 90,154,213,204,105, 0,208, 58,112,121,237,242,242,242,
+ 59,251,244,233, 90,169,123, 39, 47,165, 95,121, 15, 80,170,198,189,135,156,223,209,136,200,119, 15, 30, 62, 58,165, 85,203,229,
+ 3,206,158, 27,255,155, 53, 45, 5,139,129,231, 38, 98, 88,155,111,161,176,136, 98,207,114,229,202, 21,101, 60, 99, 24, 6,229,
+202,149,131, 92, 46,255, 58,192, 37,240, 63,165, 37,160,121,203, 57,144,172,153,142,121, 18,131, 41, 0, 48,102,128, 58, 70,161,
+ 80, 84, 26, 55,110,156,178,111,223,190,200,201,201,193,238,221,187, 91,110,223,190,125,217,152, 1,234,184,186, 85, 76,111, 1,
+192,154,233, 88, 52,106, 94,224,244,210,156,128, 47, 71,174,146, 89, 44,150,153,206,206,206,147,135, 12, 25,162,170, 84,169, 18,
+212,106, 53,158, 62,125,234,247,240,225, 67,223, 3, 7, 14,244,156,254,159,111, 87,186,185,185,125, 57,105,193, 96,171,217, 15,
+ 95, 55,255,109, 28, 88,101, 84, 51,102,103,171, 97,195,107, 57,123, 55, 87, 48,114, 79, 0,128, 40,164, 85,207, 75,189, 28,116,
+250,167, 13,159,253,183, 81, 96,255, 89,215, 34, 98,172,105,201,100,178,149,243,231,207,239,227,234,234,138, 41, 83,166,220,246,
+245,245, 37, 46, 46, 46,248,241,199, 31,225,226,226, 2, 65, 16,162, 22, 46, 92,200, 60,121,242, 4, 43, 86,172,248, 9,192,187,
+101,105,107,112,251, 9,173,116, 58,221,151,235,246,205,238, 12, 0,131,190,178,120, 75, 22, 70,199, 40,165,252,109,179,149,201,
+182,234,212,241,236,216,131, 82, 58,131, 16,226, 78, 8,201,162,148,190,146, 33,252, 55,208,190,206,224,249,172,140, 76,225, 4,
+145, 41, 87,174, 28, 22, 47, 94,140,160,160, 32, 28, 62,124,216,119,244,232,209, 59,219,215, 14,129,130,101, 36, 73,196,202,163,
+ 55, 67,199,151,164, 83, 56,104,249,248,227,143,217, 30, 61,122,108, 2, 48,240,249,231, 39, 15, 93,252,194,241, 44,203,166,215,
+169, 83,167,194,204,153, 51, 5,160,248, 65,139,197, 98,153,215,169, 83,167,242,193,193,193, 56,122,244, 40,142, 29, 59,134, 38,
+ 77,154,160, 75,151, 46,136,141,141,213,109,216,176, 97, 4, 0,171,105,168, 11, 97, 24,230,131, 15, 63,252,208, 49, 40, 40, 8,
+225,225,225, 56,113,226, 4,154, 53,107,246,202,122,118,254, 61,188,209, 8,192,176, 46,227,102, 15, 12, 10, 9,250,120,252,228,
+202, 60,111, 49,222,190,121,246, 12, 97, 32,211,106, 29,181,243,230,204, 81, 63,136,125,114,102,227,145,149, 83, 74, 58,191,240,
+ 98,122,183, 82,165,174,186, 58,117,246,207, 93,188,152,184,185,187, 35, 37, 37, 5, 22,139, 5,137,119,239, 2, 0, 42,248,251,
+ 35, 51, 53, 21,223,174, 94, 77,197, 7, 15,222, 59,146,152,184, 21, 40, 57, 2,240,206, 59,239, 88, 46,236,220, 41, 79, 14, 8,
+ 0,181, 88, 16,119,228, 8,136, 74, 5,153, 76,134, 10,237,218,129, 60, 43, 73,155,117,241, 34,252, 3, 2,208,163, 71, 15,177,
+ 86,173, 90,142,107,214,172, 49,219, 26, 1,104, 87, 59, 36,232,195, 15, 63,220,209,162, 69, 11,140, 27, 55, 46, 55, 63, 63,127,
+ 30, 33,100,203,201,219, 97, 86,179, 30,182, 8, 92, 18,224,229,233,117, 97,201,236,145,229, 26, 86, 15, 0,129,132,196,167, 73,
+ 0,156, 1, 42,131,209,148,134,216,132,219, 88,242,221,137,236,180,212,140,192, 51,103, 38,222, 42, 73,107,112,199, 73, 9,162,
+ 37,207,151,152, 51,144,203, 41,225, 94,222,143,239,210,165, 11,155,157,157, 13,153, 76, 6,133, 66, 1, 15, 15, 15,236,216,177,
+131,183, 88, 44, 44,203,178,102, 65, 16,186, 21,151, 26,249,220,188, 64,111, 11,131,199, 99, 6,143, 97, 0,224,135,176, 53, 8,
+153, 18, 15, 71,151,138, 47, 28,151,149, 30,143, 29,203,170, 96,116,200, 40, 0,192,247, 91,190,151,148, 18, 42,182,156, 30, 81,
+162,241,153, 60,116,241,172,186,117,235, 78,153, 60,121,178,234,210,165, 75,136,143,143, 71,120,120, 56, 42, 84,168,128, 42, 85,
+170,160,109,219,182,216,180,105,147, 49, 37, 37,101,221,220,245,159,148,216, 1,255, 21, 76,111, 24,232, 87,163, 97,133, 43, 83,
+214,253,236,177,251,151,251,216,184, 49, 12, 15, 30, 20, 84,154,173, 90,181, 42, 6, 15, 14,194,160, 1,141,177,124,220,144,140,
+219, 23, 31,181,154, 27, 21,113,191, 52,189,144, 14, 19,127, 25, 52,104, 80,239,198,141, 27,163, 90,181,106,144,203,229,136,137,
+137,193,253,251,247,161,209,104, 80,183,110, 93,104,181, 90,132,135,135, 99,243,230,205, 71,182, 28, 95, 98,179, 3, 48,164,211,
+228, 64,149, 74, 21,110, 52, 26,117, 97, 39,150, 18, 0, 24, 48,149,127,139,200,233,135, 4,228, 24,203, 32,234,231,111,216,204,
+146,206,111, 95,103,240,124,133,156,153,194,241, 34, 35, 8, 2, 22, 47, 89,130,160,160, 32, 28, 57,114, 4,163, 71,143, 6,195,
+ 16, 40,100, 50, 73,162,226,202, 99, 55,183,218,244, 61,124, 49, 98,101,130,197, 98, 41, 49,235,158, 76, 38, 75,207,201,201, 41,
+ 83,166,189,215, 77,231,250, 67,196, 13, 43, 22, 48,249,250,124,236,216,127, 4, 83,191,156, 9,158,231,161, 84, 42,177,112,246,
+127,209,179, 67, 83, 56,104,213, 24, 61,125, 17,141, 75, 72,148,151,228, 40,191,229,220,154,249,248,227,143,217,132,132,132, 77,
+190,190,190,221,150, 46, 93,170, 59,112,224, 0, 42, 87,174, 12,133, 66,241, 82,145,181,241,227,199,139, 30, 30, 30,142,107,215,
+174, 53, 3,197,247, 89,109,107, 5,251, 18, 66,126,104,221,186,245,187,103,206,156, 73,144, 36,105, 46, 33,100, 74, 88, 88, 88,
+ 85,150,101, 49, 96,192,128,116, 47, 47, 47,159,176, 19, 75,173, 58,198, 1, 46,129, 50, 31, 31,159,132,115,231,206,249, 8,130,
+128,192,192,192, 4, 0,159, 1,152, 29, 22, 22, 86, 85,161, 80, 32, 40, 40,200,102, 61, 59,255, 46,222,104, 4,128,149,201,218,
+247,238,215, 87,101, 54, 27,245, 28,151,159, 31, 31,119, 38, 57,245,233,173, 92, 95,159,154,174, 29, 58, 53,240, 76, 76, 76,182,
+154, 21,107,230,240,225, 10,163,163,227,174, 85, 75,151, 18, 70, 38, 3,207,243,240,247,247,199,141, 27, 55,144,155,157, 13,163,
+ 94,143,132,155, 55,225,231,239,143,113, 67,135,146, 5,203,151,255, 52,184, 73,147, 3, 91, 46, 95, 46,181, 70, 57,125,174,238,
+188, 76, 38, 3,121,118, 65, 22, 34, 41,149, 96,100, 54, 84,198, 43, 1, 73,146, 30, 37, 37, 37, 65,167,211,161, 86,173, 90, 14,
+ 87,174, 92, 57, 99,139,241, 15, 24,185, 74,230,173, 80,237, 91, 52, 59,184,156,156,141,197,253,132, 60,120,186,212,135, 32,186,
+ 32, 71,111,193,173,152,147,184,117, 47, 28, 85,124,124, 49, 98,112, 53,151,101,107,158, 30, 8,232,176,165, 90,244,137, 18, 71,
+197,222,107, 55,108, 65, 94, 94, 30,118,237,218, 5,119,119,119,246,246,237,219, 72, 74, 74,130, 76, 38,131, 70,163, 65, 64, 64,
+ 0,222,127,255,125,214,219,219, 27,145,145,145,170,195,135, 15, 31, 28,213,103,134,131, 45, 29,114,113,101, 92,101,101,252,220,
+ 38, 15, 93,220,208,193,193, 97,242,196,137, 19, 85,161,161,161,200,206,206,134,147,147, 19, 60, 60, 60, 16, 21, 21,133,200,200,
+ 72, 76,158, 60, 25,106,181, 90, 51,107,214,172, 17,147,222, 91,180,125,201,207, 83, 46,150,233, 69, 94,145, 0,151, 64, 50,170,
+ 25,217,243,217,134, 77, 30,114,246, 6,170, 84,154,137, 43, 87,242, 96,177, 20, 4, 51, 50, 51,159,226,139,207, 19,161,214, 76,
+199,212,181,155,220, 38,118,110,187,107,171, 75, 96,221,210,166, 3,100, 50,217,196,237,219,183,119,207,202,202,146, 95,185,114,
+ 5, 42,149, 10, 26,141,166,232,150,146,146, 2, 81, 20,177,101,203, 22,202, 48,204,167,165,181,111,116,223,153, 95, 27, 12,134,
+207, 1, 64, 46,151,239, 84,169, 84, 61,191,253,246, 91,237,136, 17, 35, 16, 50,141,115, 18, 25,193, 69, 33,103, 5,158,130, 3,
+ 67,231,153, 77,178, 33,163,190,149,114,215,124,202, 20,251,221, 42,228,204,148,205,171,230, 49,121,122, 61,182,236, 57,140,186,
+117,235,226,246,237,219, 5, 78, 88,139,198,104,251,118, 13, 40,100, 50,102,230,170,208, 79, 2, 92, 2, 39,218,146,178,152,231,
+121,239,221,187,119,131, 97,152,194, 34, 56, 16, 4, 1, 60,207, 67,175,215, 99,194,132, 9,229, 80,208, 55,149,217, 1,104,223,
+113,117, 2, 87,138,115, 33,151,179,233,201, 78,233,222,214,166,203,120, 65,100,220, 93,156, 16,186,233, 39,124, 58,101, 6,106,
+215,174, 13, 74, 41, 8, 33,152,246,197,127,177,108,214, 84, 76, 26, 51, 20,188, 32, 18,127,127,127, 71, 0, 57,197,233,204,156,
+ 57,147,137,143,143, 95,239,231,231,215,121,233,210,165, 58,133, 66,129,213,171, 87,131,101, 89,116,235,214, 13,110,110,110, 56,
+122,244, 40, 20, 10, 5,166, 76, 41,113,236,243, 2,167,238,108, 77, 4,208,181, 77,205, 65,239, 81, 74, 19, 35,238,109,143,104,
+ 87, 59, 68,187,119,239,222,165, 99,199,142, 69,173, 90,181,220,239,222,189,219, 2,192,105,107, 90,222,222,222,245,234,213,171,
+231,227,231,231,135,111,190,249, 6,132,144,117, 39,111,135,109,107, 87, 59,164,252,222,189,123,151,142, 27, 55,174, 76,122,118,
+254, 93,188, 81, 7,128, 48,196,205, 65,167,145, 95,143,220,126,242,105,202,181,140,204,244,155,122, 53, 75,228,122,125,164,209,
+223,183, 35, 40, 72, 57,107, 26,103,207,156, 89,241,159,207, 63, 87, 58, 23,132, 70,225,238,238,142,199,143, 31,195,100, 50,193,
+144,155, 11, 46, 59, 27,124, 78, 14,238,197,198,162,233,187,239,162, 67,211,166,236,153, 99,199, 54, 0, 24, 80,154,174,197,203,
+ 11,241,199,142, 1, 0,124, 59,116, 40, 26,245,103,156, 63, 95, 20, 13,112,232,215, 15,178,121,243, 32,183,161,226,222, 31, 57,
+125,119,219,181, 78,245,135, 30,122,247,221,119,187,142, 28, 57,146, 73, 73, 73, 57,220,186,250,128,150,214,202,207,122, 70,139,
+195,135,142,104, 84,213,179,156, 28, 7,206, 29, 66, 77,191,238,144, 51,102,228,230, 91,144,147,111,193,237,251, 71, 64, 37, 7,
+220,188,151,136, 38,181,181,104,245,142, 75,197,252,147,153, 35, 1,124, 87,146,166,193, 96,192, 79, 63,253,132,219,183,111, 67,
+ 46,151,195,213,213, 21,109,218,180, 65,245,234,213,145,148,148,132, 7, 15, 30,224,194,133, 11,168, 82,165, 10, 82, 83, 83, 33,
+ 73, 18,139, 98, 58,228, 15, 22, 32,101,205,116, 44, 90, 29,250,253, 52,134, 97,224,224,211, 23,231, 47,222, 66,197,138, 57,240,
+247,247, 71,126,126, 62,206,157, 59,135, 27, 55,110,192, 1, 77,241, 67,216, 26, 72,146, 4, 25,193,162,130,117, 0,197,183,143,
+ 16, 50, 54, 56, 56, 88,125,245,234,213, 34,227,239,236,236, 12, 31, 31, 31,220,125, 22,229, 1, 0,111,111,111, 12, 29, 58, 84,
+ 29, 26, 26,250, 41,128, 55,226, 0, 4, 7, 32,104,200,231,163,106,169, 52, 58,232,115,191, 65,221,186, 12,190,252, 82,141,175,
+190, 42,200,216, 59,109,106, 57, 52,107,234, 12,139,121, 19,212,218,121,248,207,204,177,213, 86, 78,248,118, 40,128,141,197,234,
+ 61, 91,240, 87,187,118,109,140, 27, 55, 14,187,119,239, 70,104,104, 40, 10,243,229,247,234,213, 11, 3, 7, 14,132, 94,175,135,
+143,143, 15, 73, 72, 72,136, 14,110, 63,161,196,133,129, 6,131,225,243,117,235,214,201,101, 50, 25,102,207,158,221,107,234,212,
+169,154,106,213,170, 61,123,150,113, 3,228,239,243, 2,246, 73,162,236,103,153, 74,236,204,168,165,126,217,169,166, 77,128, 99,
+ 82,113,122, 28, 47, 50,229,221, 93, 16,182, 37, 20, 19, 38,125,241,130, 33,252,226,171,175, 49,255,171, 73, 8,126,183, 53, 4,
+ 73, 42,213, 16,254, 17, 66, 8,226,226,226, 96, 48, 24, 96, 52, 26, 97, 52, 26, 97, 50,153, 80,171, 86,173, 87,174, 8, 10, 0,
+ 2,207,123, 71, 95,220, 5,149,130,129, 32, 82,112, 2, 5, 47, 72,224, 68,138, 92,131,128, 78,189,135,149,243,143,247,183,201,
+185,176,152, 77,240,119,213, 96,205,178,121, 32,140, 28, 32, 0, 67, 8, 8,161,168,227,239, 6,206,108, 42,245,252, 0,151, 64,
+210,191,127,127, 70, 46,151,135, 44, 92,184,144, 81, 40, 20, 0, 0, 55, 55, 55,176, 44,139, 58,117,234,192,209,209, 17,103,207,
+158,133, 40,138, 40,124,222, 86, 78,223,221,246,243,115,119, 47, 62,121, 82, 48,158,112,112,112,128, 40,138, 42, 91, 52, 8, 33,
+ 10,103,103,103, 0, 64,124,124, 60, 36, 73, 42, 92, 87,243, 74,122,118,254, 93,188,225,109,128, 82, 90, 66,194,221,114, 2,159,
+ 44,246,106,225, 57,154,205,211, 3, 46,125,112,248,234,237,109, 73, 79, 30,170, 9, 67,173, 86,120, 99, 84,170, 46,141,155, 53,
+ 67, 74, 74, 10,170, 85,171,134, 39, 79,158, 32, 58, 58, 26, 22,147, 9,230,204, 76,240, 57, 57, 16,178,178, 32,229,228, 32,238,
+204, 25,212, 8, 8,192,105,149,202,106,253,115, 74, 41, 24,134,121,169,243,121, 33, 26,160,211, 1,132,216,220, 65,181,173, 21,
+220,219,201,201,105, 90, 94, 94,222,193,147,183,195,190,177, 88, 44, 99,231,205,155,119,101,214,172, 89,238,211,166, 77,115,154,
+ 54,109,218,142,206, 13,134, 53, 60, 26,181,201, 92,146,134,163,171, 24,212,172,126,128, 44,246,201, 45,212,242,239, 5,207,114,
+ 77,144,149,103, 66,142,222,130, 92, 3,135,106,111, 77, 42,112, 6,244, 6,252,118,127, 11,124,188, 42, 49, 50, 54,246, 93,148,
+224, 0, 80, 74, 97, 52, 26,193,243, 60,204,102, 51, 42, 86,172,136, 30, 61,122, 32, 61, 61, 29,155, 55,111,134,217,108,198,168,
+ 81,163,112,253,250,117, 24, 12, 6, 72,146, 84, 98,137,225,152,156, 8, 58,106, 94,224,244,128,170, 94,211,162,162,162,112, 50,
+ 34, 18,130, 32, 32, 46, 46, 14,113,113,113, 56,112,224, 0, 20, 10, 5, 84, 42, 21,168,178, 45,234, 53,255, 20,159,124,242, 41,
+162, 99, 83, 75,157,255, 7,208,220,219,219, 27, 87,175, 94, 45, 50,254, 78, 78, 78,232,222,189, 59,102,207,158,253,251,103,227,
+232,136, 26, 53,106, 16, 66,136, 77,165,109, 95, 7, 78,174, 76,247,218, 77,187, 42,205,166,239, 80,176,142, 11, 24, 59, 70,135,
+222,189,156, 65,136, 10, 21,124, 28, 64,136, 10, 32, 42,240,220, 65, 84,107,208, 92,161,115, 89,213, 3, 37, 56, 0,132,144,238,
+ 7, 14, 28,128,171,171, 43,174, 94,189, 10,141, 70, 3, 66, 8, 58,118,236,248,177,187,187,123, 27,147,201,212, 55, 60, 60,156,
+228,228,228,192,207,207,175,240,184, 14, 65,129, 31,107,119, 70,172, 52,252, 81, 79, 20, 69,185,219,179,170,122, 61,123,246,212,
+ 84,172, 88, 17, 22, 75, 65, 93, 28,129,129, 89, 70, 80,159,202, 33,151, 41,232,247,144,176,153, 64,234, 33,147,100,165,174,147,
+225,204, 38,212,244,117,197,143, 43, 23, 98, 29,101, 32, 81, 10, 80,128, 82, 17,149,221,181, 48, 25,243,109, 42, 67,253, 60,146,
+ 36,129,231,121,240, 60,143, 31,127,252, 17,185,185,185, 16, 69, 17,111,189,245, 22, 0,200,242,243,243, 77, 33, 29, 38, 22, 30,
+254,196,193,193,161,146,173, 83, 2, 10, 57,193,161,168, 60,152, 45, 18, 56,225,247, 91,155, 90, 14, 96,152,146,175,221,169, 31,
+172, 20, 57,179,145, 81, 40, 20,104,222,188, 5,190,221,188, 23, 44, 91, 14,172,139, 2, 10, 5, 11, 7,141, 26,117,148,201, 96,
+229, 50,200, 89, 25, 44, 86, 28,128,231,222, 43, 61,116,232, 16, 86,175, 94, 13, 55, 55, 55,116,238,220, 25,229,203,151,199,206,
+157, 59, 65, 41,197,184,113,227,138,162, 61,214,248,160,251,231, 9,102,179,249,165, 8,135,155,155, 27,228,242,130,238, 92, 46,
+151,195,203,203, 43,108, 84,159, 25, 30,214, 62,179, 10, 21, 42,236, 82,171,213, 0, 0,149, 74, 5, 15, 15,143,195, 33, 29, 38,
+194,221,221, 29,133,143,171,213,106,120,123,123,111, 25,213,103,134,231,223, 57, 45, 99,231,245,243, 70, 29, 0,142, 19,143,255,
+184,110, 93,208,216,143,123,123, 95,126,112,110,215,234,245, 85,187, 12,238,255,107,184,187,103, 45,199,237,187,238,185,243,156,
+ 96,181,188, 37,167, 84,122,185,123,122, 34, 46, 46, 14, 87,174, 92,129,201,100,130,197,100,130,144,147, 3, 46, 51, 19,124,118,
+ 54,144,151, 7,133, 32,192,240,248, 49, 42,215,175, 15,139, 82,233, 98, 77,183,208, 1, 96, 24, 6,120,102,224, 37,141, 6,140,
+ 76, 86,112, 99, 24, 80,157, 14,148,144,130, 14,208, 10,109,106, 14,122,187, 81,163, 70,219,215,172, 89,163,152, 52,105, 82,211,
+206, 13,134,173,138,184,183, 61,190,125,157,193, 29, 22, 45, 90,116,249,155,111,190, 81, 13, 25, 50,164,198,154, 53,107,134, 1,
+ 88, 83,146, 14,171,180,212,243, 47, 31, 0, 25,105,141,204, 92, 11,178,242,204,200, 53, 88,144,171,183,224,200,145, 15, 96, 54,
+ 25,193,155, 57, 8, 22, 14, 14,158,189, 80,173,118,123, 0, 15,234,150,214, 54,139,197, 2, 81, 20, 33,138, 34, 26, 53,106,132,
+244,244,116,116,232,208, 1, 23, 46, 92,192,221,187,119,177,127,255,126,244,238,221, 27,215,175, 95,183,218,177,199,228, 68,208,
+124, 83, 48, 52, 14, 94,197,126,166, 47,188,174,160, 66,190,137,129, 13, 59, 0,252, 20, 10, 5, 40,165, 69,198,223,201,201, 9,
+219,182,109, 51,206,153, 51,231,165, 94, 82,165, 82,189,250,144,177,140, 80,138, 70, 14, 46, 13,145,159,247,213,179, 71, 88, 16,
+162,194,219,141, 31,195, 98,161,120,154,250, 14, 84, 42, 13, 8, 84,160, 82, 26,180, 78, 21, 64, 41, 45,245,251,144, 36, 9,235,
+214,173, 43, 10,253, 3,128, 86,171,109, 58,113,226,196,126,197, 29,223,176, 97, 67, 24,141,198, 18,231, 85,244,122, 61, 8, 33,
+ 56,127,254, 60, 26, 52,104,128,252,252,130,217, 47,129, 97,114, 9,149,194, 8,232, 60,185,132,181, 60,197, 45, 2,124, 37, 80,
+ 69,169,115, 52, 22,147, 17,190, 46, 74,120,105,157, 33, 8, 34,110,243, 62,200,205, 55,130,227,120, 60,230, 56, 60,140, 74, 69,
+179,102,205,193,243,124,246,132,193, 11,192,178, 44, 85, 40, 20,170,210, 22,244,138,162, 8,142,227,192,113, 28,242,242,242,176,
+105,211, 38, 40, 20,138,151, 28, 78, 74, 41, 58,118,236,232,142, 18,166, 4, 90,181, 94,118, 31, 64, 64,225,125,134, 97, 48,231,
+219,205,136,184,114, 31,146, 4,200, 21, 74, 4, 15, 31, 11,241, 89, 52,160, 52,178, 51,211,153, 95,126,217, 3,165, 82, 9,185,
+ 92, 14,150,101, 65, 8, 1,165, 20, 22,139, 5,211,167, 79, 7,199,136,207,106, 23, 3,156,169,244, 58, 77,209,217, 17, 52,108,
+249, 73, 41, 42, 42,138, 86,174, 92, 25, 44,203,130,101, 89,120,121,121,193,197,197, 5,146, 36, 65,146, 36,168,213,106,104, 52,
+ 26, 40, 20, 10,171,131, 11,158,231,189,175, 94,189,250,194,113,133,215,114,225, 52,202,210,165, 75,209,183,111, 95,199,146, 62,
+179,231,161,148,122,174, 91,183, 14,132, 16,124,247, 93,193,152, 65,146,164, 23,244, 22, 45, 90,132,222,189,123, 59,217,162,103,
+231,223,197, 27,117, 0, 46, 93,185, 61, 91,161,144,181,218,185,109,155,182,103,247,170,218, 74,149, 42,201, 92,221, 36,167,179,
+103, 19,221, 18, 19,243,178, 89,165,219,231,182,232,228,231,228, 32,254,246,109,228,100,101,193,148,151, 7, 62, 55, 23,124, 86,
+ 22, 42,250,249,129,186,184, 64,102, 54, 67,102, 50, 65, 33, 73,208,170,108,139, 92, 41,110,221, 66,133,118,237, 64, 57, 14,153,
+ 23, 46, 20,133,253,117, 65, 65,128, 66, 81, 96,252, 55,108, 0, 45, 95, 30,226,178,210,183,237, 7,214, 24,232,238,237,237,189,
+111,229,202,149,138,204,204, 76,220,186,117, 43,234,104,212,166,156,102, 85,250, 56,178, 44, 43, 69, 71, 71, 31,191,119,239, 94,
+143, 42, 85,170,128, 82, 90,173, 52, 45,125,142,150, 19,120,138,199, 25,113,184,247,232, 58, 24,198, 19, 12,235,135,220,124, 11,
+ 24,198, 11,188,241, 30,120,142, 3, 21, 37,152, 12, 79, 96,176, 88,183,133,146, 36, 21, 69, 59,106,212,168,129,208,208, 80,220,
+184,113, 3,177,177,177,240,240,240, 64, 78, 78, 14, 2, 2, 2,112,243,230,205,162, 81,197,235,192, 96,120,105,192, 90, 44, 50,
+153, 44,225,201,147, 39,213, 61, 61, 61,193, 48, 76, 81, 20,160,117,235,214,154, 39, 79,158,164, 91, 44,150,154,139, 55, 79,182,
+ 26, 45,250,171, 56,112,224, 34, 70,141, 74, 65, 90, 90, 54, 0,224, 80,248,239,139, 30, 99, 98, 40, 90,181, 62, 5, 0,112,113,
+113,193,146, 37,173, 74,213,162,148,134,247,234,213,171,159,163,163, 35, 62,252,240, 67,104, 52, 26,244,234,213, 11, 70,163,113,
+ 48, 0, 44, 95,190, 28, 19, 38, 76, 0, 0, 76,155, 54, 13,243,231,207, 71,126,126,190, 57, 54, 54,182,196,114,183, 17, 17, 17,
+ 96, 24, 6,215,175, 95,199,165, 75,151,138,140,133, 76,207, 81,232, 24,128, 82, 6,132, 0,114, 25, 15, 81,146,195, 74,228,217,
+ 98, 50,128,231, 69,240,130, 8,129, 23,144,155,111,196,220,185,243,138,162, 21,146, 36, 65, 16, 4,136,162, 8,158,231,209,171,
+ 87, 47, 66, 8,209, 0,176,201, 1,144, 36, 9,114,185, 28,109,219,182,133,201,244,226,168,250,220,185,115, 69, 59, 84, 74,192,
+255,254,133,157,212, 69, 39, 39,130, 68, 33, 8, 20,188, 8, 76,145, 40,140, 28, 69,191, 15,191,130, 32, 73, 16, 37, 9, 28, 47,
+ 21, 25,239,226,224, 56, 14,114,185, 28,125,250,244,129,217,252, 98, 80,238,244,233,211,207,222,159, 8, 2, 10,128,194,108,197,
+ 1, 0,128, 90,181,106,209,168,168, 40,176, 44,139, 78,157, 58,161,110,221,186,216,187,119, 47, 36, 73,194,216,177, 99,161,209,
+104,176,124,249,114, 8,130,128,249,243,109,218, 16, 4, 66, 8,140, 70, 35,204,102,115,177, 55, 95, 95,223, 50, 77,163, 16, 66,
+192,113,220, 11, 26, 22,139,165,232,127, 31, 31,159, 63, 53, 45, 99,231,159,203, 27,117, 0,162,179, 35,164,193, 29, 63,154, 17,
+121,205,176,199,205, 67,159, 39,242,249,249,123,246, 61,170,116, 58,130,119, 34,146,162,223,207, 39,173,135,151, 88,139, 37, 37,
+ 54, 58,218,151, 74, 18, 12,207,230,251,185,236,108, 8,153,153,128,171, 43,228,102, 51, 24,179, 25, 44,111,129, 70,235,128,236,
+180, 52, 40, 45,150, 44,171,141,227, 10,250, 42,202, 48, 69,163,126,153, 76, 6, 56, 56, 0, 74, 37,136, 78, 7, 34,147,129,216,
+ 48, 5,160,209,104,182,172, 93,187,214,219,219,219, 27, 83,166, 76,129,143,143, 79,205,177, 65,179, 13,109,218,180,209,184,187,
+187,163,122,245,234,104,220,184, 49,126,253,245, 87, 16, 66, 30,148,166, 37,112,202,200, 59,177,130,111,190,241, 10, 46, 69,254,
+ 12,139,153, 67, 64,141,207,192,195, 3,142,229,255, 3,131,113, 15, 56, 83,193, 2,125, 85,185, 54, 72, 77, 77, 7, 64,110,150,
+166,201, 48, 12,212,106, 53, 20, 10, 5, 30, 61,122, 4,134, 97,112,237,218, 53,232,116, 58,120,123,123,163, 77,155, 54, 72, 74,
+ 74,130, 86,171,125,169, 67, 46, 13,150,101,193,243,197,175, 61,148,201,100, 48, 26,109,171,108, 75, 41,189,144,144,144, 16, 80,
+181,106, 85, 34,147,201,138,162, 0,129,129,129,200,201,201,113, 62,118,236,216,193, 81,125,102,180,248, 91,194,145, 4,215,169,
+148, 86,179,106,213,170, 72, 75, 43, 72,148,182,102,157, 30,177, 49,141, 65,161,194,162,197,143,139, 14,245,243,243,195,211,167,
+ 15, 64, 72,201,223,199,214, 95,151,245, 15,233, 48,209,151, 82, 26, 83,183,110, 93,101,106,106, 42,250,245,235,135, 93,187, 10,
+118,215,141, 31, 63, 30,227,199,191,184,184, 94,175,215,151,234, 73,165,164,164,128, 97, 24,196,196,196, 20,253, 15, 0, 68, 43,
+119,102, 32,133, 72,132,108, 21, 24, 34, 66,148,234, 83,224,134,156, 33,165,110,103,181,152, 11,166,140, 4, 94, 0, 47,136,224,
+ 56, 30, 26,141, 6, 93,187,118,125,225, 59,165,148,226,224,193,131, 16, 69, 17,133,243,199, 37, 81, 56,186,228,121, 30,244,217,
+150,219,159,126,250,169,104,228,205,178,108,209, 42,121,107, 81, 40, 71,141,140,212,238, 57, 19, 70,211,139, 62,209,249, 29,179,
+192, 16, 2, 81,164, 16, 68, 10, 51, 47,129,150,226, 1, 88, 44, 22, 80, 74,177,126,253,122, 88, 44, 22, 40,149, 74,100,101,101,
+129,231,249, 2, 35,105,177,128,151, 11, 96, 80, 16, 48,177,216,240,123, 14, 10, 10,162,161,161,161, 40,252, 29, 59, 58, 58,130,
+ 82,250,194,200,191,112, 17, 36,203,178, 86,245,108,161,112,202,231,117, 81,210, 53,109,231,223,207, 27, 79, 5,156,156,156,253,
+245,164, 73, 95,122,244,236,217,211, 67,175,215, 35, 60, 60,220,253,114,228,102, 60,120,240, 96, 57,128, 38,214,206,167, 28,119,
+232,234,165, 75,163, 91,183,108,137,184,107,215, 32,100,101,129,207,204,132,156,231, 33, 51,153,192,152, 76,144,153, 76,240,107,
+164, 3,168, 55, 46, 61, 74, 6,204,230,211, 54,232,130, 50, 12,168, 86, 91,180, 45,135, 97,152,130,121,127,165, 18,196,193, 1,
+204, 51, 7,160, 52, 90, 87, 31,160,237,218,181,107,135, 70,141, 26,129, 82,138, 69,139, 22,193, 98,177, 40, 11, 59,187,194,144,
+231,238,221,187,177,105,211,166,243,206,206,206, 63,149,166, 39, 9,230, 67,191,158,189,222,109, 88, 80, 59,229,161, 99,235,192,
+ 89, 68,152,132,114,200, 53,152,144,107,148,131,215,117, 1, 50, 34, 64, 25, 21,124, 43,214,194,131,232,219, 38,145,231, 14,151,
+164, 71, 8, 1,203,178,112,116,116,132,131,131, 3,238,223,191,143, 81,163, 70,225,216,177, 99, 72, 74, 74, 66, 96, 96, 32,218,
+180,105,131,227,199,143,195,213,213,181, 40,156,108,133,251, 23, 47, 94,172,222,182,109, 91,196,198,198, 34, 62, 62, 30,188, 57,
+ 19, 44, 99, 4,195,168,225,237,237, 13,173, 86,139,115,231,206, 1, 64,169, 91,226, 0, 64, 20,197,239,142, 29, 59, 54,168, 66,
+133, 10, 26, 31, 31,159,162, 41, 0, 39, 39, 39, 12, 27, 54,140,141,141,141,173, 45,138,226, 10, 0, 31, 89,211,122,221,232, 51,
+164,131,198,140,200, 1,189,123,247, 86, 92,188,120, 17,148, 82,212,168,225, 0, 39, 39, 29, 64,212,168, 83,219, 13, 64, 28, 8,
+ 33,104,219,182, 45, 24,115,140, 96,200, 18, 15, 90,145, 93, 62,127,254,124,165, 78,167,131,197, 98,129, 94,175, 71,102,102,193,
+206,188,226, 34, 0, 70,163, 81, 5,160,216, 47,133, 16, 34, 60,126,252, 88, 78, 8,129, 40,138, 98, 76, 76,140,204,201,201,169,
+224, 57, 48,172, 68,165, 27, 16,201, 62, 81, 36, 42, 70, 41, 14, 37, 96,142, 48,162,192,149,212, 21, 80, 80, 88, 12, 6,240,130,
+248, 44, 10, 32,128,123,230, 44,207,157, 59, 23, 12,195,188, 16, 50,151,201,100, 54, 25, 32,147,201,132,202,149, 43,195, 98,177,
+160, 70,141, 26,160,148,226,131, 15, 62,120,201, 73,188,112,225,130, 85, 45, 65,164,152, 56,126, 28,100, 12, 1, 43,103,160,144,
+ 51, 96,229, 12, 40, 10,194,247,162, 84,112,179,240,165,111, 80, 40, 52,116,195,135, 15,127,193,241,165,148,226,252,249,243,224,
+ 56, 14,130, 66, 4, 67, 41, 40, 40, 76, 70,219, 34, 90, 64,129,211,125,250,244,105, 68, 70, 70, 98,204,152, 49,208,104, 52, 88,
+177, 98, 5, 4, 65,192,172, 89,179,160,209,104,160, 84, 42,109,210,178,230, 16,113, 28, 87,166, 53, 25,175, 91,207,206,191,135,
+ 55,238, 0,156,186,179,181,195,215, 99,215, 72,201,201,201, 36, 59, 59, 27, 27, 54,108, 0, 0, 40,149, 74,171, 11,245, 0,160,
+213,144, 33,159, 30,221,187,247,253,250,181,107, 43, 43, 85,170,132, 59, 49, 49, 80, 8, 2, 88,158, 7, 99, 50,129,229,204,168,
+220,196, 17, 74,141, 59,146,227,205,216,126,229, 10,239, 91,165,202,251,214,116,205,239,188,131,156, 75,151,192, 48, 12,116, 3,
+ 7, 2, 74, 37,160,211,129,174, 91, 7, 70,169, 44, 24,137, 44, 95, 14,169,115,103, 48,165, 92, 12,103,238,239, 48,116,127,231,
+195,171,119,239,222,125,167, 70,141, 26,248,250,235,175,145,152,152, 8, 73,146,144,150,150,102, 74, 75, 75,123,146,145,145, 17,
+ 71, 8,217,147,148,148,180,206,218,182,169,167, 1,178,141, 71,143,159,152,252,118,195,218,213,187,116,152,137, 61,191,252, 23,
+153,217,217,200, 51,203,145,163,183, 64,111,164, 80, 41,106,160, 74,149,198,176,152, 13,136,185, 21,249, 56, 93,225,186,182, 52,
+ 77,185, 92, 14,103,103,103, 56, 59, 59, 67, 46,151, 35, 60, 60, 28,141, 27, 55,198,176, 97,195, 16, 31, 31,143, 67,135, 14, 65,
+173, 86,195,213,213, 21,169,169,214,147,206,201,100,178,238,253,251,247, 95,244,206, 59,239,244,153, 63,127, 62,180,252,113,220,
+139, 92,129,218, 46, 20,106,207, 94,120,152,233,136, 13, 27, 54, 32, 43, 43,235, 23,153, 76,102,117,175,211,226,205,147,175, 79,
+123,127,217,146, 3, 7, 14, 76, 28, 61,122,180,182,208,248, 23,142,100,167, 79,159,174,249,248,227,143,135, 77, 29,190,244,220,
+194,141, 19,195,172, 54,240, 53,242, 86, 12,118, 68,108,216, 56,189,253,248,239,235, 14, 25, 50, 4,187,118,109,197,152, 81,149,
+ 0, 82, 48,239,223,183,111, 53,124,254,197,109, 52,105,210, 14, 94, 94, 50,220,223,185,239, 97,162, 7, 54, 91,145, 53, 31, 58,
+116, 8,206,206,206,216,190,125,187,224,238,238, 46,247,240,240, 0, 80,124, 4,224,153, 3, 80, 44,132,144,185,191,253,246,219,
+231, 0, 80,173, 90,181,157,119,238,220,233,233,237,237,173, 5, 0, 37,107,202,178,240,100,189,140, 80, 25, 81,201,135, 17, 74,
+ 88,142,167,219,184,220,220,167, 64,201, 83,101, 38,131,225,217,232, 95,128,192,139,224,158,141,148, 39, 79,158,252, 82,132,232,
+232,209,163, 86, 29, 0,185, 92,158, 60,106,212,168, 23, 22,178, 73,146,132,208,208, 80, 40, 20,138,162, 8, 0,203,178, 54, 77,
+ 65, 9, 18,232,146,101,171,136,201,252,226,235,158,222,250, 53,234,213,168,132, 38,111,233, 96,230, 36,228, 26, 5, 72, 82,201,
+215, 46,199,113, 32,132, 32, 44, 44, 12, 28,199, 65, 38,147, 65,175,215, 23, 68, 63, 4, 1,220, 51, 39,158, 60,235, 54,205,101,
+112, 0, 10, 35,135,162, 40,190, 52,242, 87,171,213, 80,217, 56, 85, 9,216, 29, 0, 59,175,143, 55,238, 0,180,173, 21,252,235,
+212,169, 83, 49,100,200, 16,164,167,167,195,223,223, 31,155, 55,111, 70,108,108,236,105, 0, 86, 87,115,207,156, 57, 83,232,188,
+121,115,239,213,107,214, 28, 26, 21, 28, 76, 90,244,234,133,196,139, 23, 97, 78, 74,130, 82,146,160,212,232,192, 27,189,144,153,
+106,193,154,107,215,169, 50, 59,251,189,159,111,220,176, 26,199, 22, 4, 1,254,254,254,160,148, 66,182, 96, 1,168, 36, 21, 4,
+ 11, 61, 61, 65,158,237, 99,167, 93,187, 66, 18, 69, 72, 82,233, 35, 9,131,193,208,127,228,200,145, 55, 14, 30, 60, 88, 46, 36,
+ 36, 4,189,122,245,186,150,157,157,221,238,226,195, 95,242,108,249,140,158, 39,122,237, 56,177, 69,224,146,222,171,126, 88,127,
+126,248,176, 97,174,125,251,174,194,181, 91,183,144,193,121,130, 82, 10, 31,119, 29, 42,214,158, 10,179, 41, 31,103,127, 61,144,
+ 37, 9,166,254,209,103,198,148, 26,179, 99, 24, 6,205,155, 55,135,193, 96, 64, 64, 64, 0,244,122, 61, 50, 50, 50,112,242,228,
+ 73,168,213,106,248,250,250,194,205,205, 13, 78, 78, 78,120,252,248,177,213, 8,192,179, 92,225,125,219,214, 10,110,222,187, 71,
+224,242, 79,250,165, 53, 30, 51,120, 52, 0,224,251, 45, 63, 96,215,238,139, 87,243, 12,178,241,167,238,108,181, 62,156,123, 6,
+203,178, 95,103,102,102,146,185,115,231, 78, 26, 48, 96,128,170, 70,141, 26,164, 98,197,138, 72, 75, 75,195,253,251,247,169,217,
+108, 38, 26,141,198,199, 86,189,215, 69,112,118,132,244,121,147,192, 62,183,246,204,187,212,123,208,116,247,238,221,154,193,221,
+ 35, 21,146,152, 2, 16, 21, 52,218,242,248,241,199,183,145,154,146,137,248, 99,155, 50,141,217,180,255,154,227, 17,165, 78, 85,
+ 40, 20,138,113,225,225,225,132, 97, 24,103,134, 97, 62, 77, 73, 73,185,169,124, 54, 28, 44, 46, 2, 80, 26,161,199, 22,207, 0,
+ 48,163,240,254,144, 78,147, 3,147,146,146,194, 1,232, 54,207,210,230, 1,200, 27,248,153,165, 26, 40, 81, 81, 70,154,198,138,
+ 98,198,182,181,158,165,102,223, 52, 25,243,193,241, 5, 17,128, 2, 67,200, 65, 16, 4,172, 88,177,226,133,144,125,225,205,154,
+ 3, 48,119,253, 39,126,207,223, 15,233, 48,209, 76, 8, 97,131,131,131,153,194,115,135, 14, 29,138, 49, 99,198,216, 52,247,204,
+ 11, 20,211,167,124, 12,185, 76, 6,197,115, 17, 0,128,193,225, 99,167,176,103,255,239, 1, 49,153,156,205,138,247,143, 47,246,
+251, 40,116, 0,212,106,117,209,118,204, 66, 78,158, 60, 9,142,227,160,212, 58,131,129, 4, 64,196,253,132, 84,200,101, 12,141,
+143,143,183,122, 93, 51, 12,131,247,223,127, 31,222,222,222, 88,185,114, 37, 68, 81,196,215, 95,127, 13,141, 70,131,207, 63,255,
+ 28, 60,207, 99,249,242,229, 86,223, 43, 80, 96,176, 21, 10, 5, 24,134, 1,203,178, 80, 42,149, 80,169, 84, 48,155,205, 5,219,
+161, 13,134, 50, 59, 0,114,185, 28,170,103,235,158, 10, 53, 21, 10, 5, 20, 10, 5,140, 70,163,221, 1,248,127,202,223, 17, 1,
+104,223,166,230, 32,126,225,194,133, 47,188,182, 66,161,104, 99,171,198,209, 71,143,142,117,170, 90,181,199,162,239,190,219,221,
+225,237,183,149,213, 43, 87, 70,229, 90,181,224,160,209, 32, 39, 35, 3,145,241, 41,216,126,253, 58,199,100,103, 15,254, 53, 33,
+ 97,143, 53, 61,185, 92,158,220,173, 91,183,162, 17,201, 11,157,206,220,185,197,117, 66,217,222,222,222, 37,118,234,167,238,108,
+125,220,174,118, 72,255,143, 63,254,248,196,198,141, 27,153,182,109,219, 54,220,183,111, 95,153,138, 6, 61,207,249,136, 73,209,
+173, 3,151,183, 89,177,114,245,206, 70,141,155,249, 87,170, 92, 89,213,220,215, 9, 22, 94, 68,234,211, 12, 60,184,123,195, 28,
+125, 39, 42, 81,226, 44, 3,206,158, 43, 57, 11, 32, 0, 48, 12,147, 60,125,250,116, 95,160, 96,181,248,201,147, 39, 95, 88,121,
+ 77, 8, 41,218, 13, 81,248,190, 89,150,205,130, 13,171,127, 79,221,217,122,225,220,188,192,222, 22,138, 39, 40, 12, 81, 83, 74,
+167,244,121,218,187,180,172,127,197,241,205,218,113, 34,128,175, 38,189,183,104,215,174, 93,187,166, 18, 66,154,153, 76,166,138,
+ 42,149, 42,141, 16,114,221, 96, 48,204, 88,188,121,242,245,178,104,190, 46,230, 94,142,120,244,229,219,129,205,211,159,140,219,
+ 61,104,218, 7, 1,102, 67,160, 82,231,212, 1, 0,143,188,172, 88, 56, 72, 23,184,240,159,126,126,144,147, 38,245,251,230,122,
+132,213, 28,234, 27, 15,205,207, 2, 16, 92,120, 63,184,253,132,240, 59,119,238,244, 3,138,143, 0,148,133,208, 99,139, 35,130,
+219, 79,232, 74, 8,249,178,240, 49, 25,149,242, 69,137, 89, 39, 19, 25, 75,216, 82, 85,122,105,231,179,114, 70,122,144,144,194,
+120, 57,170, 32,136,102, 8, 34, 15,142, 43, 24, 17,143, 29, 59,182,104, 58, 96,224,192,129,120,255,253,247,193, 48,204, 43,205,
+ 25, 75,146, 68,159,173,137, 1, 33,228,247, 41,184,130,231, 74, 77, 38, 37,136, 20,115, 23,124, 11, 51, 87,240,186, 93,218,183,
+ 68,191,238,237, 32, 81,128,130, 90, 52,122,103,231,163, 81,239,151,184,213,182, 16,142,227,192, 48,218, 40,244,132, 0, 0, 32,
+ 0, 73, 68, 65, 84, 12,228,114, 57,134, 14, 29,138,144,144, 16, 0, 5,215, 4,207,243, 48,153, 76,152,183,243, 82,209, 0,128,
+149, 49,148, 74,116,173,181, 40, 94,225, 53,229,238,238, 14,173, 86, 91,180,194, 94,173, 86, 67,173, 86, 23, 69, 24,108, 49,178,
+ 44,203, 38, 55,105,210,164,196, 68, 71,207, 29,103,211, 53,251,186,245,236,252,187,248,219,170, 1, 6,184, 4,126, 6, 96, 30,
+128, 5,209,217, 17,159,217,114,206, 31,139, 1,205, 28, 62, 92,113,254,236,217, 85, 80,171,187, 88, 88,214, 3,132, 16, 37,199,
+165,193,104, 60, 94,175,106,213,177,139,143, 29,123, 97,228,255,166,171, 1,182,173, 21, 28,226,235,235, 59, 63, 41, 41,105,247,
+137,155,161, 19,254,204,235, 0,191, 23, 3, 98,100,138, 30,148,210,250, 0, 8, 97,152, 50, 23, 3, 42,210,115, 9, 36, 40, 48,
+212, 50,252, 62,167, 76, 1,136,182,100,116, 43,142,162,250, 0, 40,168, 15,192, 0,139, 70,205,131,181,125,255,255, 74,182,186,
+ 4, 50,177,117, 16,236,224,196,116,151, 36, 52, 64, 65, 34,196,223, 12,217,210, 65,211, 29,132,126,147, 29, 97,115,173,136, 63,
+210,174,118,200, 37,179,217, 92,211,100, 50, 41, 77, 38, 19, 75, 41, 45,242, 66, 53, 26, 77,166,209,104,244,138,206, 46, 61,178,
+240, 58,232, 80, 39,120, 57, 67,152, 79,120, 81, 42,122,253,186,117,235, 98,203,150, 45, 5, 91, 99,159, 25,173,194,145,163, 92,
+ 46, 71,165, 74,149,192,178,172,203,209,168, 77, 54, 37, 5, 10,233, 48,241,133,173,124,197, 80, 98, 30,128, 86,173,151,153, 47,
+255,186,157, 85,202, 9, 35, 81, 20, 24,125, 90,176, 78,159, 19, 40,218,117, 31, 98,145,103,106,108,114, 0,186,190, 51, 82, 50,
+ 25,242,137, 82,169, 44, 26, 5, 23,254,175, 80, 40,160, 82,171, 17,109, 54,169,143,254,242,181, 85,173, 66,222,114,110,205,244,
+238,221,219,178,124,249,114,185, 92, 46,135,242,217,116,162, 66,161,128, 86,171, 5,128, 34,227,207,178, 44,250,246,237, 43,186,
+187,187,151,154, 10,216,142,157,215,133,189, 28,240, 27, 46, 7,252,191,192, 31, 43, 4,254,127, 52,254,255,203, 76, 30,186, 88,
+202,205,205, 37,133, 43,249, 45, 22, 11, 44, 22, 75,209,255, 12,195,224,241,227,199,234,232,236, 8,155, 13,229,171,242,199, 60,
+ 0,197,240, 36,205, 53,167,146, 45,206,113, 64,139, 49, 10,231,100, 86, 83,152, 25,239,121,156,157, 93,144,227,156, 99, 46,139,
+241, 7, 10,250,151,254,253,251,199,113, 28,103,117,148, 13, 0, 10,133, 34,189,118,237,218,165, 22, 3,178, 99,231,117,241,175,
+114, 0,236,216,177,243,247,243,229,200, 85,138,244,244,116, 77,124,124,252, 75,207, 61,123,204,252, 38,140,255,191, 1,251, 0,
+195,206, 63,153, 55,190, 6,192,142, 29, 59,255,110,158,101,248,179,169,108,183, 29, 59,118,254,185,216, 29, 0, 59,118,236,216,
+249,139,176,143,224,237,252,147,249, 83,225, 41, 59,118,236,216,177, 99,199,206,191, 19,187, 3, 96,199,142, 29, 59,118,236,252,
+ 15, 98,119, 0,236,216,177, 99,199,142,157,255, 65,236,107, 0,254,135,105,213,122,153,138,145,201, 87,203, 89,121, 23, 74,169,
+123,193,158,110, 89,134, 36,242,199, 36, 81, 24,117,246,204, 4,251, 74,238, 18,104, 94,181,111,121, 73,146, 54,201,100,178,122,
+106,181,218,205,209,209, 17,142,142,142, 25,106,181,250, 55,150,101,135,173,216,246,121,202,223,221,198,215, 77, 29,207,142, 61,
+ 40,165, 51, 8, 33,238,132,144, 44, 74,233,156, 91, 79,143,239,250,187,219,101,199,142,157, 87,195,190, 13,240, 13,208,176,250,
+ 40, 95, 0, 67, 61,188,124,154,167,165, 38, 93, 6,176,249,250,253, 53,113,127,103,155, 90,181, 94,214, 91,174, 80,111,239,221,
+163,155,162,123, 39, 15,248,149,247, 4,165,106,220,123,200,225, 88, 68, 36, 14, 30, 62,202, 9,156,105,200,217, 51, 19,118,254,
+157,237,252, 39,210,188,106,223,201,121,121,121,243, 28, 29, 29,229,110,110,110, 80,171,213, 96, 89,182,168,126,130,139,139,139,
+192,113,220,244,175, 86,142, 88,252,119,183,245,207,210,177,238,224,249,114, 25, 51,133, 19, 68, 70, 16, 4, 44, 94,188, 4, 65,
+ 65, 65, 56,114,228, 8,198,140, 30,253, 44,115, 30, 35, 73, 18, 93,121,252,230, 22,155, 82, 22,126, 49, 98,101,130,197, 98, 41,
+113, 95,188, 76, 38, 75,207,201,201,241,254, 91,170, 61,218,177,243, 63,132,221, 1,248,139,105, 88,125, 84,197,230,173,218,221,
+ 9,249,224, 83, 7, 86,231,142,135,113,113,216,189,105,133,225,225,157,203,245,175,223, 95, 19,251,119,180,169, 85,235,101, 93,
+ 60,189, 60, 14, 45,158, 61,138, 52,172,254, 22, 8, 68, 36, 62, 77, 2, 80, 14,160, 12,140,166,116,196, 38,220,194,146, 85,199,
+232,211,167,217,253,207,158,153, 96, 53,157,114, 33, 75, 63, 11,107,100, 50,153,186,114, 28, 87, 1, 0, 28, 29, 29,227,124,124,
+124,142, 12,250,164,205,141, 87,105,235, 31,245,116, 58, 93,124,249,242,229,143, 12,153,216, 33,234, 85,244,254, 44,205,171,246,
+157,156,149,149,181,168,176, 94,194, 31, 33,132,192,223,223, 31,245,235,215, 71,122,122,250,148,143,102,246, 45,179, 19, 48,164,
+211,228, 4, 73,146,124,129, 2, 99, 40,138,162,119,216,137,165,127,139, 49,124,183,193,123,226,230, 85,243,152, 60,189, 30, 97,
+123,142, 96,234, 87,179,192,243, 60,148, 74, 37,230,206,252, 28,109, 27,213,128, 66, 46,195,204, 85,161,212,194, 11,242, 83,119,
+182, 90, 93,245, 62,117,248, 82,126,231,206,157,114,134, 97,138,210,226, 22, 38, 21,210,235,245,152, 48, 97,130,152,147,147,163,
+ 91, 83,198,164, 59,118, 10, 8,112, 9,172, 11,160, 18,128,148,232,236,136, 43,175, 65,111, 65,141, 26, 53, 6,223,187,119,111,
+ 81,116,118,196,183,127,190,133,118,254, 41,148, 58, 5, 16,224, 18,152, 3,192, 9,128, 75,116,118,132, 77,105, 61,173,104, 21,
+149,188, 98, 89, 22, 42,149,170, 40, 31,246,195,135, 15,119,201,100,178,247, 99,114,206,216,148, 72,188,150,123,251,251,132, 16,
+ 5,128,243, 60,207,159, 6, 16, 22,157, 29, 97,123,241,250, 55,132, 82,169, 26,243,159,177,211, 28, 46,156, 57,129, 99,123, 55,
+161, 81,135, 33,104,209,243, 35,109,220,221,200, 9, 0,198,190,233,246,180,106,189, 76,193, 42, 21,251, 22,206, 14, 33,114,246,
+ 1,162, 19,242,224,225, 82, 15,130, 88, 14, 57,122, 11,110,197,156,196,173,123,225,168,234,227,139, 17,239, 85, 39,203,126, 56,
+187,163, 85,235,101,142,103,207, 76,176, 90,252,124,254,196,141,239, 1,104,213,181,107,215, 71, 53,107,214,252,141, 97, 24,154,
+144,144,224,144,148,148,244,225,157, 83,153, 23,106,181,117, 45, 83,229,190, 69, 83,126, 30, 34,138, 98,235, 46, 93,186, 60,170,
+ 93,187,246,111, 12,195,208,184,184, 56,199,132,132,132, 17, 81, 71, 83, 46, 54,232, 92,254,231,178,190,255, 0,151,192,138,132,
+144,229, 0,218,161, 96, 13,204,105, 55, 55,183, 79,207,197,236,138,183,118,110,243,170,125,203,231,229,229,205,123,222,248, 43,
+149, 74,180,108,217, 18, 6,131, 1,145,145,145, 16, 4, 1,113,113,113,112,114,114, 66,227,198,141,231,253,188,228,248,150,247,
+ 38,117, 44,211,116, 0,165,212,251,232,209,163,144,203,229,232,216,177, 99, 57, 20, 92,167,127,139, 3,192, 9, 34, 83,222,221,
+ 5, 97, 91, 66, 49,126,210, 23,168, 93,187, 54, 40,165, 32,132,252, 31,123,231, 29, 30, 69,185,182,241,123,250,246,205,166, 19,
+ 32, 64, 32, 44,144, 80,164,234,161, 44, 96,232,130, 93, 52,116, 65,164, 73,137, 20,105,138,128,120, 56, 72, 40, 98, 64,164, 43,
+ 65,133,163,242, 33,130, 16,144, 80, 69,122, 9,100,169,129,144,144,190,164,109,155,157,153,239,143,205,174, 9,144,100, 19,138,
+158,115,246,119, 93,123, 37,217,221,185,231,157,201,238, 60,229,125,231,121, 48,243,195,143,241,207, 89,239,227,173, 94,157, 32,
+136, 18, 1, 64, 3,192,163,235, 4, 65, 16,184,121,243, 38,138,139,139, 97, 54,155, 97, 54,155, 97,177, 88, 16, 17, 17,225,238,
+ 1,224,165,234,232,117,134, 86, 0, 88,163, 41,113,187, 94,103,232,167,215, 25,232, 71, 41, 25,173,215, 25,150,204,157, 59,119,
+226,244,233,211,209,168, 81,163,143,245, 58,195, 10,227, 35,148,184,246,242,247,194,211, 53, 0,166,136,128,231,161, 82,169,116,
+199,111,110,175,174, 35, 32, 3,192, 1,112,119,158,114,181,193,172, 74, 43, 76, 23,130, 32,212,223,185,115, 39,189,100,201,146,
+122, 55,110,220,120, 41, 53, 53,117,190, 94,103, 24,100, 52, 37, 38, 84,115,124, 79,140, 34,139, 3, 22,187, 0, 65,144, 96,182,
+ 9, 32, 45, 85,111,150,242,184, 32, 41,122,245,160, 33,205,217, 32, 95, 10, 59, 14,255,130,136, 58, 47,128, 34,173,200, 47,178,
+225, 94,145, 13, 23,141,187, 33, 9, 42,156,187,124, 27,237,154, 42,208,161,157,142,218,123,192,178, 30, 64,255,138,116, 23,190,
+191,177, 21,128,142, 31,124,240,193,105,181, 90,237,190,224,248,250,250,230, 53,105,210,164, 32, 43, 43,203, 96,191,163, 48,178,
+181,242, 78,121, 50,206,165, 51,190,109, 33, 8, 66,167,241,227,199,159, 91,180,104, 81,235, 9, 19, 38,116, 6,128,238,221,187,
+255, 54,107,214,172,147,153,153,153,157, 77, 70, 46, 89,167,183,157,240,244,216,245, 58, 67, 45,130, 32, 46,178, 44, 43, 83, 42,
+149, 44, 73,146, 80,169, 84, 61,107,213,170,117, 97,206,152, 85,205,230,196,141,170,112, 90, 70, 20,197,141, 42,149,138,246,243,
+243, 3, 0,244,235,215, 15, 3, 7, 14,196,173, 91,183,248,244,244,116,132,133,133, 49, 7, 14, 28, 64,122,122, 58,206,159, 63,
+143,103,159,125,150, 14, 10, 10,218, 8,160,187,167, 99,116,225,227,227,131,237,219,183, 87,117,179, 39,130,221,106, 65,147, 80,
+ 63,172,253,252, 95, 88, 45,149,212,255,151, 0, 81, 18, 16, 22,160,132,197, 92, 84,229,110,113,162, 40,130, 47,105,175,187,110,
+221, 58,152, 76, 38,136,162,136,134, 13, 27, 66,146, 36,170,176,176,208, 18, 29, 21,227,122,251, 29, 0,245,254,170, 44,200,127,
+ 10,165,140,255,177,146,167, 46, 2,232, 4, 96,127, 53,245,150,204,153, 51,103,226,244,233,211, 81, 80, 80,128,161, 67,135,106,
+103,207,158,189, 24, 64,245,187, 83,121,249, 91,225,145, 3, 64, 81, 20,100, 50, 25, 24,134, 49,117,107, 62, 8, 36, 73,202,127,
+ 61,179,177,170,233, 57, 45,128,124,154,166,185,210,134, 95, 46,151,227,252,249,243,223, 86, 37,250,119,209,173, 91, 55, 92,186,
+116, 9, 10,133, 66,117,227,198, 13,213,154, 53,107,126,106, 17,210,115,249,217,244,221, 51,170, 56,182, 39,134,205,102, 93,185,
+ 54,110,225,184,168, 87, 71,171,223,152,218, 13, 89, 89,217,216,247,253, 50,155, 40, 9, 75,170,171,169,215, 25,218, 2,136, 5,
+ 96, 3, 48,211,104, 74,252,221,211,109, 53, 62, 98,223,231, 90,232,113, 45,245, 2,154,212,121, 17, 65,126,237,144, 87, 96,193,
+189, 66, 27,242,139,237, 8, 15,127,223,233, 12, 20,154,113,238,242, 55,168, 25, 84, 15, 36,125,173,115,229,199,105,235,217,183,
+111,223, 27,165,141,191, 11,142,227, 28, 1, 1, 1,183,213,106,117,223, 60,120,230, 0, 20, 23, 23,247,234,214,173,219,205, 69,
+139, 22,181,142,143,143, 31,234,122,126,243,230,205,195, 88,150,117, 76,155, 54,237,150, 76, 38,123,201,134, 91, 30, 59, 0, 4,
+ 65, 44,101, 89, 86,230,231,231,199,186,158,179,219,237,172,159,159, 31,194,195,195, 87, 0,232, 83,209,246, 36, 73, 54,247,243,
+243, 3, 65, 16,224, 56, 14, 67,135, 14,197,209,163, 71,215, 80, 20, 53,138,101, 89, 92,185,114,101,149, 90,173, 30, 1, 56, 13,
+ 92, 74, 74, 10, 90,181,106,213,220,147,177,149, 78,251,203,229,114, 27, 65, 16,180, 78,167,131, 78,167,179,231,230,230, 90,162,
+163, 98,192,178,108,182,221,110,247,104, 58, 96, 80,143, 41, 25,130, 32, 4, 85,244, 30,150,101, 51, 55,252,242,207,224,202,180,
+108, 22, 51, 66,117, 28,130,149, 62,112, 56, 4, 92,228, 67,144, 95,100,129,221,206, 35,213,110,199,245, 51, 25,120,246,185,231,
+192,243,188,105,210,128,133, 96, 24, 70,202,201,201,145,173,251,121, 65,185,213, 2, 5, 65,128,221,110,135,221,110,199,189,123,
+247,176,105,211, 38,176, 44, 91,166, 51, 37,224,108, 85,219,173, 91,183, 0,139,197,242,151,101, 65,254, 19, 40,109,252,245, 58,
+131, 2, 64, 36,128,179, 0, 58, 86, 83,111,217,156, 57,115,198,207,152, 49, 3,199,142, 29,195,206,157, 59,241,198, 27,111, 32,
+ 54, 54,246,185,199, 57,110, 47,127, 45,149, 58, 0, 36, 73,186,141,117, 41,163,109, 25,210,107, 26, 14, 31, 62,188,217, 83,195,
+109, 52, 37,218, 34, 2,158, 47, 99,248, 93,142, 0, 69, 81, 85, 78, 41,185,218,134,234,116, 58, 40, 20, 10,116,233,210, 5,157,
+ 59,119, 86,190,245,214, 91, 19,244, 58,195,207, 70, 83,162,199,189,231,159, 36,167,147,191, 76,109,217,232,221,200,203, 73, 23,
+246,207, 88,176,186, 62, 41,183,160, 32,223,148,164, 12,108,148,251, 8,178,139, 0,180, 47,249,125, 37,128,103, 60,221,144,102,
+ 45, 62,117,131, 27,130, 34, 58, 34,183,192,142,188, 2, 43,242,139,109,200, 47,180, 97,215,238,225,176,153,139,193,219,236,112,
+216,120,168,131,251, 33, 60,242,121, 72,226, 85,191,202,116, 29, 14, 71,173,136,136,136,243,229,189, 46,147,201, 10,212,106,117,
+219, 60, 15, 39,105,172, 86,107,205,198,141, 27, 95,142,137,137,233,124,255,107,187,119,239,238, 50,111,222,188,207,149, 74,229,
+115, 89,158,201,185,232,172, 84, 42,217,251,159,204,203,203, 99, 27, 53,106,212,169,178,141, 57,142,243, 87, 40, 20, 78,161,206,
+157,113,231,206, 29,158,162,168, 81,205,187, 5, 9, 0,176,117,107,222,168,220,220,220, 33, 14,135,131,161,105, 26,153,153,153,
+104,208,160,129, 63, 96,170,116, 96,146, 36,133,236,221,187, 23, 58,157, 14, 0, 56,155,205, 6,157, 78,135,149, 43, 87,202,181,
+ 90, 45,180, 90, 45,218,183,111,239,241,116,128, 32, 8, 65,191,253,246, 27,212,106, 53,138,138,138, 96,181, 90,221, 93,231, 92,
+ 25,184, 46, 93,186, 84,232, 32, 56, 7, 6,216, 44,197,224,121, 1,188, 67,128,131,119, 32,191,200,130, 5, 11, 62,133, 66,161,
+ 0, 65, 16, 16, 69, 17, 14,135, 3,130, 32,128,231,121,188,244,210, 75,132,221,110, 87,160,130,114,193,165, 29, 0,215,152,186,
+118,237, 10,179,185,236, 76,211,225,195,135,189, 83, 2,149,112,159,241,247, 51,154, 18,115,245, 58,131, 8, 32, 26,192,185, 42,
+106, 17, 0, 62,159, 55,111,222,216,105,211,166,225,232,209,163, 8, 13, 13, 69,102,102, 38, 58,117,234,148, 82, 92, 92, 60,255,
+ 73, 28,131,151,191,134, 10, 29, 0,146, 36,221,134,250, 97,143,170,226,112, 56,180,114,185, 60, 95, 46,151,115, 46, 71,224,143,
+ 63,254,168, 86,244,239, 66,167,211, 65,169, 84, 66,173, 86, 67,163,209, 96,233,210,165,138,241,227,199,127,175,215, 25,234, 27,
+ 77,137,182,234,104, 62,110, 78, 39,127,121,187, 99,167, 37,177,167, 79,254,254, 69,151,238, 47,226,181, 65,163, 90,238,216,246,
+205,249,142,157,150,140, 56,116,112,210,175,213,144, 44,221,174,172, 74, 81, 81, 97,190, 66,228, 29, 32, 83,115, 82,112,249,250,
+105,144, 84, 48, 72, 38, 20,249, 69, 54,144,100, 16,236,214,203,112, 88,237,144, 68, 17,214,162, 59, 40,182, 17,149,139, 2,160,
+ 40, 74,168,232, 66, 77,211, 52, 72,146, 84,121, 58, 78,154,166, 69,154,166,203,203, 43, 75, 20, 69, 65,169, 84,202, 80,236,169,
+ 34,160, 86,171,161, 86,171, 31,232, 87,175, 82,169,160,215,235, 1, 20, 85,184,189, 70,163, 1, 77,211,144, 36, 9, 22,139, 5,
+ 89, 89, 15,186, 31, 89, 89, 89,176,217,108,238,247,106, 52, 26,216, 60,112, 0, 0,224,198,141, 27,184,123,247, 46, 52, 26, 13,
+180, 90, 45,116, 58, 29, 92,198,191, 58, 92,191,126, 29,169,169,169, 80,169, 84, 80,169, 84,238,227,231, 56,206,221,138,214, 19,
+108, 86,179,179,103, 61,239, 0,239, 16, 96,183,243, 80, 40, 20,232,221,187,119, 25,131, 45, 73, 18,118,238,220, 9,135,195, 1,
+187,189,226, 86, 1,174, 69,127, 60,207,187,163,254,117,235,214,129,166,105, 48, 12,227,110,193, 75, 81, 84,149,167, 23,254,219,
+209,235, 12,190, 0,218, 2, 80,195,217,190, 59,173,196,248,135, 1,104, 93,178,222,138, 3,112,192,104, 74, 76,241, 64,175, 35,
+ 69, 81,211,154, 54,109,250, 12, 77,211,247,230,206,157,219,100,242,228,201, 88,182,108, 25,166, 78,157,122,237,245,215, 95,111,
+112,235,214, 45, 71,113,113,241,139, 70, 83, 98,185, 78,190,151,255, 60, 42,116, 0,238,143,252, 93,143,146,200,159, 4,240,127,
+ 0, 60,174,117,109, 52, 37,218,162,154, 13, 44, 51,255, 95,157,232,223, 5, 65, 16,240,241,241,129, 74,165, 66,201,125,216,232,
+223,191, 63,190,248,226, 11,205,233,211,167,187, 2,216, 85, 93,237, 39,192, 87,251,247,236,124,209,106,119,116,239, 24,213, 15,
+ 67,130,234,212,218,241,253,218, 95, 58,118, 90, 18,117,232,224,164,223,170,168, 53, 17,192, 18, 0, 74, 0,211,170,178,161, 32,
+112, 89,151,174, 57, 66,138,204,127,224,247, 83, 95,195,102,181, 67,223,248, 3,240, 8,132,182,198,112,152, 45, 63,130, 55,239,
+ 3, 0,112,190,157,145,145,145, 13,130, 36, 42,205, 86,232,116,186,235,233,233,233, 42,157, 78,247, 80,107,199,178,108,144, 40,
+138,119, 60, 29,167, 78,167,187,145,158,158,174,233,222,189,251,111,155, 55,111, 30, 86,250,181,222,189,123,255, 38,151,203, 3,
+171,162, 7, 0,122,189,254,128, 86,171,237,123,233,210,165, 50, 89,128,232,232,104,123,120,120,248,193,187, 66,197, 55, 22,168,
+213,234, 28,142,227, 2, 45, 22, 11,142, 29, 59,134, 38, 77,154, 48, 23, 47, 94, 92,181,117,107,250, 40, 0,184,122,245,234,170,
+204,204, 76,166, 86,173, 90, 0,128,198,141, 27, 35, 63, 63, 63, 71,230,129,253,166,105, 58,253,221,119,223, 13, 45,217,143,109,
+253,250,245,156, 78,167,195,128, 1, 3, 44,119,239,222,149, 3, 0,203,178,121,130, 32,120,228,240,209, 52,157, 57, 98,196,136,
+ 10, 35,124,142,227, 50, 61,209,178, 21, 23,131,119, 8, 37, 89,128, 63,141,251,130, 5, 11, 64,146, 36, 56,142,115, 27,110,138,
+162, 96,179,217, 42,117, 0, 44, 22, 11,194,194,194, 96,179,217,208,164, 73, 19, 72,146,132,183,223,126,251,129, 12,192,209,163,
+127,139, 68,222,223, 6,189,206,224, 7,103, 90,255,119, 0,153, 0,180, 70, 83,226,189, 18,227,223, 16,192,191, 1, 4, 0, 32,
+141,166,196,116, 15,244,218,247,234,213,107,127, 92, 92, 28, 93,183,110, 93,228,228,228,132,148, 4, 82,152, 54,109,218,102, 73,
+146,134,124,255,253,247,205, 0,216,140,166,196, 75, 79,240,208,188,252, 5, 84,201, 1, 56,113,226,196,183, 44,203, 74, 0,170,
+ 29,177, 39,156,255, 70,246,186,225, 61,171, 76, 38,227,142, 28, 57,226,241, 20, 66,121,232,116,186, 50, 14, 0,199,113,232,211,
+167,143,210,104, 52,118,199, 95,232, 0,116,236,180,228, 69, 0,239, 0,216,116,232,224,164,239, 15, 29,156,196,119,236,180,164,
+247,209, 3,191,126,118,235,230,245,137, 61, 94, 30, 2, 67,239, 55,201,239,215,252,107, 22,128, 42, 57, 0, 70, 83,226,111, 0,
+ 90, 84,103, 92,162,195,190,119,223,225,211, 67,134,188,214, 21,191,236,253, 10,118,171, 0,139, 67,135,252, 98, 11,242,205, 52,
+120,101, 15, 32,231, 0, 36,200, 16, 90, 59, 2,215,140, 23, 37,209,193, 31,168, 76,183, 78,157, 58, 9, 57, 57, 57, 35,236,118,
+123, 17,203,178,101,254,159, 20, 69,201,228,114,121, 43, 73,146,230,121, 58,206,122,245,234,237,205,201,201, 25, 61,107,214,172,
+ 83, 44,203, 58,118,239,222,221, 5,128,212,187,119,239,223, 62,250,232,163, 11, 50,153,172, 23,128, 79,170,114,236,141, 27, 55,
+158, 24, 18, 18,210,173, 85,171, 86,184,120,241, 34, 43,147,201, 48,112,224, 64,123,159, 62,125,236, 52, 77,143, 67,126,197,219,
+ 43,149,202,115, 26,141,166, 91,122,122, 58,120,158,199,175,191,254,138,128,128,128, 17, 86,171,117, 72,122,122, 58, 50, 50, 50,
+ 24,165, 82, 89,114,111, 60,141, 30, 61,122, 32, 61, 61,253, 92,205, 80,170,210,177,109,220,181,176,142,235,247,129,221, 39,243,
+ 90,173, 22,106,181, 26, 89, 89, 89, 44, 0,121,124, 66,108,149,214,220,108,218,253,175, 74,231,246, 61,197, 82, 92, 92, 18,253,
+ 59,224,224, 5,216,109, 54, 72,146,132,201,147, 39,195, 98, 41, 59,167,243,235,175,191,194,102,179,193,102, 43, 63,249, 86,218,
+217,113, 33,138, 34,190,254,250,107,112, 28,231,206, 0, 48, 12, 3,154,246,214, 42,187,143,150, 0, 78, 3,176, 0,232, 12,224,
+138, 94,103, 40, 2,240, 15, 0, 91, 74, 86,232,103,120, 42, 70, 81,212,180,184,184, 56,218,108, 54,227,157,119,222,193,232,209,
+163,161,211,233, 48,115,230,204, 27,146, 36, 13, 41,209,251, 75,110,185,245,242,228,241,200, 1, 72, 74, 74,114, 25,254, 33,143,
+ 98,172, 75,235, 86,103, 10,161, 52, 4, 65,192,106,181,150,113, 0, 92, 23,139, 46, 93,186,144, 95,124,241, 69, 47, 0,147, 30,
+117,172,213,161, 99,167, 37,180, 70,235,243,205, 59,239, 77, 87,109, 90,179,172,123,199, 78, 75,142, 28, 58, 56, 41,237,208,193,
+ 73, 2,128, 73, 29, 59, 45,185,244,199,161, 61,171,219,117,125, 5,186,128, 26, 93, 59,118, 90,194, 28, 58, 56,233,169,220, 26,
+ 32, 10,142,145,123,246, 38,188,213,250,153, 72,182,231,243,115,240,195,143, 31, 34,215,116, 15, 5, 86, 26,247, 10,109, 40, 52,
+ 75,144,177,141, 81,191, 94, 27,216,172,197, 48, 94, 60,201,139,130, 99, 88,101,186, 47,190,211,238,194,173, 19,182, 35,133,133,
+133, 93,125,124,124, 82, 25,134,201, 39, 73,146, 96, 89, 54, 72, 46,151,183, 18, 69,241,151,219,214, 63, 60, 14,231,250, 14,111,
+147,116,245, 72,225,161,226,226,226,110,179,102,205,186, 61,127,254,252,229, 37,139, 81,131,100, 50, 89, 31, 73,146,170,164, 7,
+ 0, 51,151, 13,191,115,124,199,173,200,192,192,192,165,131, 6, 13,234, 90,179,102, 77, 82, 38,147, 29,160,105,122,194,213,252,
+ 67, 41,149,109, 79,211,244, 16,173, 86,123,155, 97, 24, 58, 37, 37, 5, 55,111,222, 68, 74, 74, 10, 0, 48, 22,139, 5, 53,106,
+212,112,207, 87, 15, 29, 58, 20,190,190,190,142,115,231,206, 13,169,137,170,217, 98,130, 32,224, 90,107,240,119,192, 98, 46,130,
+157,119,102, 0, 28, 14, 7,236,188, 29, 14,135, 3,203,151, 47, 47,147,178,119, 61, 92,115,251,229,177, 96,205,248, 58,165,255,
+142,142,138,177, 18, 4,193, 68, 71, 71,147, 46,199, 97,208,160, 65, 24, 51,102, 12, 8,194,179, 41,168,255, 33, 84,112,222, 21,
+209, 22, 64, 56, 0,165,209,148,248,179, 94,103, 40,168,206,237,121,145,145,145,173,234,214,173,139,247,222,123, 15,107,214,172,
+201,179, 88, 44,190,115,231,206,133, 94,175,215,254,251,208, 23,222,219,253,254,203,169,208, 1, 72, 75, 75,219, 14,128,193, 99,
+ 50,252, 46,142, 31, 63,254, 93,137,238,206,234,234,178, 44,155,174, 84, 42,203,173, 38,166, 84, 42,171,126,111,225,227, 67,224,
+121,222,193,202,213,104,214,170, 61,179,111,231,214, 53, 29, 59, 45,249, 26, 78,207,253, 25, 0,253,100, 74, 45,108,188, 0,171,
+185,184, 24,206,121,188,167,194,161,131,147,236, 29, 59, 45,121,113,197,170, 53, 59,135, 14, 25, 66,190,242,234, 10,156, 58,127,
+ 1, 57,246, 32, 72,146,132,154, 1, 42,212,142,156, 10,171,165, 8,135,247,237,144, 4,222,250,150, 39, 53, 0, 0,160, 78, 27,
+238,123,121,161,246,138, 86,171,125,153,101,217, 14, 4, 65, 40, 37, 73, 74,145, 36,105, 94, 85,141, 53, 0,132,183, 87,127, 39,
+101,170,174,170, 84,170, 87, 84, 42, 85, 7,154,166, 21,146, 36,165, 0,168,150, 30, 0,180,235, 91, 39, 21,192,171, 64, 46,178,
+144, 11, 88,225,124,120,192, 23, 91,103,223,157, 51,102,213,244,200,200,200, 69, 90,173, 22, 23, 46, 92,128, 40, 58,103,192, 92,
+ 14, 45, 77,211, 24, 58,116, 40, 70,140, 24,129, 95,126,249,101,122,139,238,193, 85, 46, 9,204, 48, 76,122,251,246,237, 67,129,
+170,165,253,159, 4, 52, 69,138, 87,111,221, 37,131, 53, 50, 56, 4, 43, 28, 2, 15,187,157,135,195,225,192,216,177, 99,221,134,
+190,127,255,254, 24, 54,108, 24, 72,146,172,212, 1,120, 24,162, 40, 74,251,246,237,115, 47,238,165, 40,202,237, 76,185,206,177,
+ 23, 0,206,133, 42,181, 0, 36, 3,144,195,153, 1,224, 80,205,178,238, 23, 47, 94, 60,149,146,146, 18, 50,124,248,112,228,231,
+231,251,190,249,230,155,184,118,237, 26,146,147,147, 79, 63,198, 49,123,249,155,226,173, 4,248,132,232,216,105,201,234,158, 47,
+ 15,122,167, 81,179,182,184,121,245, 50, 82,174, 39, 35,235,238,109,248, 5,214, 66, 80,104, 56, 2,107, 53,196,205,228,179,248,
+125,207,230,175, 15, 29,156, 52,248, 47, 24,223, 75, 52, 43,255,174, 85,155,103,153,122,245,234, 19, 90, 31,167, 67,146,145,153,
+131, 91, 41,215,165, 43, 73,103,120,129,183,122, 75, 1, 63,132,207,103,111,157,220,168, 81,163, 79, 41,138,162,111,223,190,141,
+172,172, 44, 48, 12,131, 70,141, 26,161,123,247,238,240,247,247,119, 28, 59,118,108,122,163, 78, 62,255,241,165,128,163,154, 69,
+ 47, 37, 65,140,231, 5,209, 29,138, 55,107,214, 12,155, 55,111, 6, 73,146,238, 5,122, 20, 69,185, 83,246,245,234,213, 67,113,
+113,177,199, 53, 67,162,163, 98,146, 1,232, 43,120,139,183, 14, 64, 9,165,214, 0, 28, 53,154, 18,179,244, 58,131, 26, 64, 27,
+ 0,183,140,166,196,235,213,208,107,223,163, 71,143, 3, 11, 22, 44,160,181, 90, 45,174, 94,189,138,249,243,231, 11, 71,142, 28,
+233, 86, 50,213,232,229,191, 24,175, 3,240,132,232,216,105,137, 15, 73,146,123, 91,117,232,209, 58,180, 65, 83,104,124,131, 32,
+ 8,128, 67, 20,144,155,157,137, 59,215, 47,226,242,137,132,115,162, 40, 60,127,232,224,164, 71,185, 37,240, 81,198, 40, 35, 41,
+ 58,142,164,217,158,146, 40, 6, 0, 18, 8,130,244, 54, 3,242,128, 13,255,218, 93, 35, 56, 56,120, 99, 72, 72, 72,243,240,240,
+112,127,141, 70,131,252,252,252, 28,147,201,116, 46, 59, 59,123, 72,117, 34,255,255, 20, 38, 15,254, 76, 44, 40, 40, 32, 92,171,
+253, 93,139,254, 92,191,147, 36,137,156,156, 28,249,217,244,221,222,207,207, 19, 64,175, 51, 4,194, 57, 5, 64, 3, 32, 0, 92,
+ 48,154, 18,171, 93, 86, 92,175, 51,116, 36, 73,114, 90,120,120,120,139,107,215,174,157, 23, 4, 97,145,215,248,255,111,224,117,
+ 0,158, 32, 29, 59, 45,145, 1,120, 27, 64, 47, 78,174,236,172,245, 11, 86,229,231,102, 22,219, 44, 69,137, 0,118, 3, 88,235,
+105,122,221,139,151,191, 11,195,250, 76,103,109, 54,155,194,101,244, 31,242,176,122,141,191, 23, 47,127,127,188, 14,192, 83,162,
+ 99,167, 37, 52,128,154, 0,210, 14, 29,156,244, 63,159,202,244,226,197,139, 23, 47,127, 45, 94, 7,192,139, 23, 47, 94,188,120,
+249, 31,196, 91, 99,211,139, 23, 47, 94,188,120,249, 31,196, 91,101,227,127, 24,189,206, 0, 56, 23, 17, 73,143, 35, 19, 84, 82,
+ 71,220,165,247,200,183, 54, 62,110, 61, 47, 94,188,120,241,242, 39,255,177, 83, 0,165,140, 3,224,188,143,254,145,140,152, 94,
+103, 32,241,103, 70, 68,196,127,185,209, 41,117,254, 72,148, 28, 47, 30,225, 28,150,156, 63, 26, 0, 5, 64, 40,121,136,213, 61,
+135,143, 91,239,113,242,184, 63,123, 37,154,255, 83,159, 63, 47, 94,188,252,245,252,199, 56, 0,203,103,125,111,133,179,193, 5,
+ 36, 73, 66,113,113,197, 93, 96,148, 74,229, 3, 85,196,138,139,139,229,211,151, 12,179, 62, 76,239,206,157, 59,229, 54, 29,145,
+ 36, 9,161,161,161, 30,235,221,191, 45, 0,143, 42,154, 85,166, 39, 73, 82, 25,189,202, 52,239,215,147, 8,201,125,188,230,162,
+138,111, 62, 80,170,148,127,154, 56, 0,132, 68,148,209, 91, 54,251,187, 50,122,105,183,210, 42,212,171, 89,167,102,153,241, 18,
+ 18, 1,115,145,217,173,167,247,249,211, 0, 70, 78,137, 84,132, 94, 14,189, 74,145, 84, 96,121,122, 89,141,179,116,199, 23, 30,
+ 47,221,189, 71, 52,222, 75,124,226, 21, 99,244, 58, 3,217,176, 97,195,215,117, 58,157,182,116,177, 27,215,255,131, 32, 8,177,
+ 94,189,122,235,230,175, 30,231,241, 88, 6,116,123,159, 85, 40, 20,103,180, 90,109,147,135,189, 46,138,162, 40, 8,130,114,217,
+150,233,222,149,245, 94,254, 35,136,142,138,209, 80, 20, 53,145, 97,152,110,130, 32, 52, 7, 0,154,166,207,241, 60,191,215,225,
+112, 44,141, 79,136, 45,248,171,199,232,165,130, 41, 0,189,206,224,207,113,220,155, 42,149,170,155, 40,138, 13, 40,138,186, 84,
+ 80, 80,176,215,110,183,111, 49,154, 18, 11, 31,117,199,122,157, 65,231,167,166,167, 30,189,189,111,122, 85,182,147, 36, 9,102,
+179, 25, 44,203,162,115,231,206,200,201,201, 65, 64, 64, 64,153,215, 19, 18, 18,170,164,119,231,206, 29,104, 52, 26,172, 95,191,
+ 30,103,207,158, 69,235,214,173,221,175, 11,130,128, 55,222,120, 3,146, 36, 85,185, 44,169,171, 5,107, 69, 80, 20,229, 81, 89,
+100, 73,146,144,155,155,251, 64,179,148,251, 97, 89, 22,193,193, 21,148,158,149, 0,115,145, 25, 36, 73,162,107,215,174,200,202,
+202,130, 86,171,133, 40,137,238,253, 28, 61,114,212,243,227,149,128,180,219,105, 96, 24, 6,155, 55,111,198,239,127,252, 14,125,
+184, 30,188,131,135, 4, 9,130, 40, 96,226,123, 19, 33,138, 34, 40,170,242,154,248, 45, 62,108, 33,175,121,185,230,117,142,227,
+252, 42,210, 83,154,148, 74, 84,214,190,239, 49, 83, 98,252,251,215,171, 87, 79,181,121,243,102,100,103,103, 67,169, 84, 66, 20,
+ 69, 8,130, 0,155,205,134, 65,131, 6,145,217,217,217, 52, 42,104,133, 91,154, 1,221,222,103,213,106,245,177, 90,181,106, 53,
+ 90,183,110, 29, 50, 50, 50,202,116,234, 19, 4, 1,111,191,253, 54, 73, 16,132, 12, 30,215, 44,172,152, 62, 45, 6, 60, 83,187,
+102,141,111, 68, 65,224,211, 50,178, 62,216,121,118,243,238,242,222,155,182,172, 23,113,213,102,169, 41, 73,160, 27,202,228,183,
+ 0, 72,131,190,210, 53, 7, 48, 84,146,164,110, 4, 65,236, 5,176, 97,255,197,248, 42,181,157, 45, 77,215,200,232,191,165, 94,
+116, 84, 76,115,134, 97,166, 18, 4,241, 28,207,243,181, 89,150, 77, 3,240,187,205,102, 91, 20,159, 16,123,170,186,227,171, 46,
+131,123, 78,189,229,112, 56,202,173,126, 90, 30, 12,195,100,243, 60, 31,226,105, 33, 37,189,206,160,129,179,143, 73, 91, 56,195,
+128, 19, 0,214, 24, 77,137, 30,181,181,140,142,138,233,202,113,220,183,163, 70,141,210,181,109,219,150,246,247,247,135,221,110,
+ 71,106,106,106,135,223,127,255,189,221,247,223,127, 63, 46, 58, 42,230,205,248,132,216,253, 85, 61, 22, 47,143,151,135, 58, 0,
+205,107,244,120,179, 89,179,102,203,151, 45, 91,230, 95,191,126,125, 66,161, 80, 32, 61, 61,189,201,217,179,103, 95,249,232,163,
+143, 62,106, 26,212,109,216,133,204,189,123, 30,101,199, 53,124,169, 69, 42, 5, 53,160,169,127,215,223, 47,228,236,223,238,233,
+118,197,197,197,110,227, 79, 16, 4,178,179,179, 81, 92, 92, 12,185, 92,238,238, 70, 38,138,162, 59, 67,240,176, 76,128,139,251,
+141, 63, 77,211, 56,113,226, 4,238,220,185,131,160,160, 32,168, 84, 42,200,100, 50, 56, 28, 14,220,185,227,108, 60, 87,187,118,
+109,143, 12,163,213,106,133, 76, 38,195,115,207, 61,135, 91,183,110, 65,163,209,128, 36,201,210,145, 34, 8,130,192,177, 99,199,
+ 42, 53,182, 46,227,239,239,239,143,216,216, 88,236,216,177, 3, 97, 97, 97,238,118,169,174,178,169, 20, 69, 97,226,196,137, 21,
+234, 21, 23, 21,187,141, 63, 69, 81,184,112,225, 2, 0,160, 85,171, 86,224, 56, 14,130,224, 44,255,109, 46,118, 58, 26,247,103,
+ 2,238, 31, 87,218,173, 63,141,191, 76, 38,195,210,216,165, 32, 8, 2, 31,125,244, 17,124,125,125, 97,179, 59,107,187,223, 77,
+117,214,197,185, 63, 19, 80,134,173, 32, 67, 78,135, 92, 45, 49,254,132, 76, 38, 67,126,159,190,184, 89, 84, 4,237,169, 83, 80,
+251,251,187,245,148, 25,202, 59,125,251,245,125, 88, 38,224,137,160,215, 25,136,240,240,240, 55,234,214,173,171,250,241,199, 31,
+ 9,185, 92,142, 77,155, 54, 33, 32, 32, 0,190,190,190, 4,199,113,132, 76, 38, 3, 0,137, 97, 24,143, 60, 69,189,206, 64,118,
+237,218,117,111, 72, 72, 72,139,117,235,214,145, 52, 77, 99,215,174, 93, 8, 14, 14, 70,141, 26, 53,160, 86,171,203,148, 24,126,
+ 28,244,105, 49, 64,219,164,113,163, 3, 43,150, 47,209,228,231,220,197,240,145, 99,183,245,105, 49,224,205,157,103, 55,255,124,
+255,123,211,150,245, 34,146,173,230,185, 0,166, 3, 32,118,167, 56, 14,197, 39, 4,104, 26, 54,108, 72, 14, 31, 62, 60, 85, 16,
+132,124,158,231,235,174, 95,191,126, 99,151,136,183, 68, 73,146, 54, 18, 4,177,249,183,164, 45, 57, 15,219,119,218,178, 94,238,
+169,147,209,155, 52,254,133, 86, 34,154, 32,200,193,213,213, 43,173, 57,124,157,214,207,202, 35,154, 36,201, 33,143,162, 7, 0,
+209, 81, 49, 20, 69, 81,115,252,253,253, 39, 79,155, 54, 77, 22, 22, 22, 6,181, 90,141,204,204,204, 58, 70,163, 49,116,229,202,
+149,253,134,246,254,224,115,187,221, 62,243,105, 86, 39, 20, 4, 33, 36, 33, 33, 1, 62, 62,127,118, 3,191,114,229, 10,190,253,
+246, 91, 76,152, 48,225,161,109,163, 77, 38, 19,122,246,236,233, 11,231,181,190,210,177,234,117,134,118, 62, 62, 62,107, 94,121,
+229, 21, 91,104,104,104, 93,181, 90, 77,154,205,230,250, 95,126,249,229, 96,189,206, 48,218,104, 74, 60, 92,209,246,209, 81, 49,
+ 61,107,213,170,245,239,207, 63,255, 92, 1, 56, 91, 92,115, 28, 7,130, 32, 32,138, 34,122,246,236,201,180,106,213, 42, 96,222,
+188,121, 59,162,163, 98, 94,141, 79,136, 45,215,249,244,242,228,121,224, 46,128, 22, 33, 61,199,143, 30, 61,122,221,209,163, 71,
+ 3,148, 74, 37,113,241,226, 69, 28, 61,122, 20,185,185,185,104,214,172, 25,185,115,231,206, 16,131,193,176,181, 89,112,247, 87,
+171,187, 83,189,206, 80,183, 70,128,242,197,131,113,205,100,126, 62,244, 82,189,206, 80,121,104,136, 63,211,233,157, 58,117,114,
+ 27, 17,151, 1,164,105,218,253, 83, 38,147,149,137,226, 43,211,251,234,171,175,220, 23, 88,142,227,202,180, 43,150,203,229,240,
+245,245,197,220,185,115, 61, 62,190,210,198,159, 36, 73, 92,186,116, 9,199,143, 31, 71,122,122, 58,114,115,115,113,230,204, 25,
+156, 59,119,206,163, 26,231, 46,227,239,231,231,135,216,216, 88,176, 44,139,184,184, 56,124,240,193, 7,216,191,127, 63,206,156,
+ 57,131, 79, 62,249, 4, 11, 23, 46, 4,207,243,229, 59, 59,248,115,250,192, 96, 48,184,163,241,210,181,236, 9,130, 0, 69, 83,
+ 96, 88, 6, 45, 91,183, 44,115,142, 30,170, 41, 58, 95, 91,187,118, 45, 74,140, 31, 28, 14, 7, 36, 73, 66, 96, 96, 32, 8,130,
+128, 76, 38,131,202, 71,133,217, 31,207, 46,179,191, 7,216, 10, 2,123, 65, 83, 36, 21,180,118,237, 90,151, 49,133,153, 32, 32,
+ 0,229,234,113, 57,156,231,141,237, 31, 13,194,199,199, 71,179,117,235, 86,194,101,148, 9,130,128, 32, 8,212,103,159,125, 54,
+247,243,207, 63, 95,249,201, 39,159,172, 12, 12, 12, 92, 69,211,180,117,210,128,133, 82,204,192,127, 73,147, 6, 44,180,205, 26,
+185,130,189, 95,172,100, 29, 1,169, 82,169, 58,125,245,213, 87,164,235,243,199, 48, 12,228,114,121,153, 71,201,126, 76,147, 7,
+127, 38, 77, 30,252,153,244, 94,255, 79,132,126,207,142,172, 86,175, 11,142,165, 39, 79,158,244,158,162,224,198,113,100,157,250,
+ 9,237,195,131,148, 44, 69, 46,120,216,123,175,217, 44,126, 0,166,142,124,243, 93,114,244,128,209,100,253,154,130, 97,239, 47,
+223, 20,236,223,191,255,214,128, 1, 3,178,253,252,252,110, 13, 31, 62, 60,231,240,225,195,151,246,237,219,119,173, 95,191,126,
+221, 21, 10,197,153, 46, 17,111,125, 90,222, 57,188, 42,224,102,178,213, 44,140,126,173,224,238,136, 17,195,250,252,254,251,239,
+153,143,160, 7, 0,196,129,116,242,116,251, 22,162,113,228, 59,131,250,253,254,251,177,172,253,251,247, 61,138, 30, 40,138,250,
+168, 67,135, 14,147,183,109,219, 38,243,243,243, 67,114,114, 50,182,111,223,142,172,172, 44,132,133,133, 17,203,150, 45,147,183,
+104,209,226, 61,150,101, 43,212,121, 18,200,100, 50,248,251,251,227,163,143, 62,194, 15, 63,252,128, 43, 87,174, 0,112,102,254,
+ 54,111,222,140,109,219,182, 97,215,174, 93, 56,120,240, 32, 78,159, 62,237, 46, 83,237, 9,122,157, 65,165,209,104,214,143, 25,
+ 51, 38,104,218,180,120, 40,117, 70, 0, 0, 32, 0, 73, 68, 65, 84,105, 5, 83,167, 78, 93, 63, 96,192,128,161,145,145,145,223,
+173, 94,189, 58,168,118,237,218,107,245, 58, 67,185,205,173,163,163, 98,180, 12,195,124,189,100,201, 18, 69, 86, 86, 22, 14, 29,
+ 58, 4, 31, 31, 31,124,240,193, 7, 24, 59,118, 44, 2, 2, 2,144,157,157, 13,157, 78,135,233,211,167, 43, 56,142,251, 58, 58,
+ 42,198,131,102,217, 94,158, 20,101,194, 10,189,206, 80,175,109,219,182, 31,207,159, 63, 95,158,144,144,128,203,151, 47, 99,193,
+ 2,231,181, 65,165, 82,225,151, 95,126,129, 32, 8, 88,188,120,177,166,119,239,222,113,122,157,225,128,209,148, 88,229, 50,182,
+ 53,252,233,149,191,252,180,209, 63,136,185,130,183, 95,202,247,255,226,187,155, 99, 0,124,238,201,182,146, 36, 33, 47, 47, 15,
+ 57, 57, 57, 32, 8, 2, 28,199,129,101, 89,208, 52, 93,198, 9,160, 40, 10, 4, 65,160,184,184, 24,162, 40, 66,173, 86, 63, 84,
+ 79, 16, 4,156, 63,127, 30,103,207,158, 5, 73,146,240,245,245,133, 86,171,133, 66,161,128, 66,161, 0,199,113, 80, 42,149,144,
+201,100, 32, 73, 18,169,169,169,224,121, 30,245,234,213, 43,119,124,130, 32,160, 93,187,118,238,102, 38,174,109,125,125,125,193,
+ 48, 12,238,222,189, 11, 73,146, 60, 74,137, 75,146, 4,155,205,134, 69,139, 22,129,101,157,118,196,223,223, 31, 12,195,160,105,
+211,166,208,104, 52, 56,116,232, 16, 4, 65,112,191, 94,190,152,243, 71,118, 78, 54, 46,156,191, 0, 65, 16,208,164, 73, 19,104,
+181, 90,156, 60,121, 18, 4, 65,160,101,235,150,160, 25, 26, 52,229,252,104,148,201, 4,220, 55, 46,215,180,193,201,211, 39,177,
+ 52,118, 41, 44, 22, 11,198,142, 29,139, 6, 13, 26,224,195, 15, 63, 4, 73,146,248,112,238,135, 80, 42,149,238, 72,214,149, 9,
+168, 21, 90,171,236,216,146, 64, 32, 3,148, 75,175,176,247, 11, 40,182,217,160,254,254,123,104,245,122,160, 65, 3, 4,216,108,
+200,191,147, 82, 70, 79,155,173,189,211,183, 95, 95, 20, 4, 20,104,177, 24, 79,116, 94, 81, 16, 4,100,101,101, 97,237,218,181,
+160, 40, 10, 28,199, 81, 27, 54,108,152, 91,163, 70, 13,191,184,184, 56,100,100,100, 64,165, 82, 65, 20, 69,184,202,228, 78,157,
+ 58,149,205,206,206, 86,160,156, 41, 1, 65, 16,144,155,155,139,159,127,254, 25, 12,195,192,207,207, 15, 62, 62, 62, 80, 40, 20,
+110, 39, 84,167,211, 97,221,186,117, 32, 8, 2,119,238,220,193,232,209,163, 73, 31, 31,159, 42, 77, 9,244,105, 49,160,165, 94,
+ 31,190,127,241,178, 21,234,136, 8, 61,121, 97,199,231, 56,127,254, 38, 50, 51,243, 32, 65,170,112, 14, 74,130, 84,226, 85, 18,
+240,247,211,222, 2,144, 13, 0, 62,206, 80, 52, 31, 64,126,163, 70,141,152,184,184, 56,123, 82, 82,210,137,222,189,123,143,131,
+ 51,107,240, 0,162, 96, 11, 25, 53,224, 61,172,249,126, 13, 49,122,198,180,219, 44,167,177,184,142,163, 58,122, 0, 16,236, 91,
+220,252,185, 22, 33,124,122,102, 92, 71,227,145,219, 23,213, 93, 63, 58,174,245,111,104,246,241,209,106,171,170, 23, 29, 21,211,
+ 92,167,211, 77,158, 51,103,142,236,216,177, 99,200,203,203, 67,102,102, 38, 38, 76,152,128,149, 43, 87,162,105,211,166, 80,169,
+ 84, 24, 63,126,188,124,204,152, 49, 99,162,163, 98,190,143, 79,136, 61, 81,209,249, 3, 0,189,206,240,111, 0,129, 0, 94, 55,
+154, 18, 51, 74, 61,239, 11,224, 71, 0, 38,163, 41,241,165,202,116,120,158, 71, 92, 92, 28,104,154, 6,203,178,238,239,188, 40,
+138, 24, 59,118, 44, 36, 73,114, 95, 11, 25,134,193,254,253, 85,202,178, 15,125,245,213, 87, 45,209,209,209,103, 26, 54,108,216,
+ 29, 64,170, 92, 46,103,125,124,124,190, 47, 40, 40,144,199,197,197,189,220,183,111,223,119, 0, 60,180,199, 5, 69, 81,147,223,
+121,231, 29, 45,195, 48, 48, 26,141, 96, 89, 22, 69, 69, 69,232,211,167, 15,138,138,138, 32, 8, 2, 56,142,131,195,225, 64,221,
+186,117,209,189,123,119,245,238,221,187, 39, 3,152, 93,149, 65,122,121,124,148,113, 0, 52, 26,205,236,213,171, 87,251,156, 59,
+119, 14,201,201,201, 88,178,100, 9,230,206,157, 11,150,101,145,151,151,135, 23, 95,124, 17, 71,142, 28,129,205,102,195,140, 25,
+ 51,252, 62,248,224,131,113, 0, 62,174,202, 14,245, 58, 67,171, 17,253,159,109, 71,107,155,160, 67,175, 17,248, 53,174,179,106,
+195,142,180,233,122,157, 97,157,209,148, 88,225,202, 62, 87,218,220,223,223, 31, 22,139,197,221,128,132,227, 56,247,135,158, 36,
+ 73,119, 83, 18,133, 66,129,198,141, 27,227,228,201,147, 21,234,181,110,221, 26,217,217,217, 96, 89, 22, 26,141,198,125, 1,150,
+201,100,224, 56, 14, 42,149, 10,114,185, 28, 53,106,212,192,200,145, 35,241,225,135, 31, 86, 24, 25, 3, 64,106,106, 42,146,146,
+146, 32,147,201, 80,187,118,109, 40, 20, 10,220,184,113, 3,146, 36, 33, 34, 34,194, 61, 94, 79, 16, 69, 17,191,252,242, 11,226,
+226,226,224,239,239,143, 30, 61,122,160, 70,141, 26,216,186,117, 43, 36, 73,194,184,113,227,220, 14, 75,133,148, 92,198,125,117,
+ 78, 71,132, 36, 73,168,213,106,200,100,178, 63, 51, 42,100,137, 3, 69, 83,160, 89, 26,205,154, 53,195,233,147,167, 31, 56, 94,
+130, 32, 64, 18, 78, 7,167,105,132,243,162,200, 48, 12,234,214,173,139,128,128, 0, 80, 20, 5, 73,146, 32, 99,101,110, 99,166,
+212, 42, 17, 19, 19,131,121, 31,205,123, 48, 19, 16, 1, 9,233, 16,144,225,212,187, 65,211, 16,108, 54,104, 74,244,184,146,225,
+151,167, 71, 23,211, 74,224,137, 58, 0, 18, 0,232,116, 58,248,250,250,130,162, 40, 98,205,154, 53,115, 66, 66, 66,252,214,173,
+ 91, 71,200,100, 50,172, 95,191, 30,129,129,129, 8, 8, 8,112, 59,141, 0,202,164,108, 93, 24, 77,137,146, 94,103, 16, 1,231,
+ 52, 85,104,104, 40, 56,142, 67,175, 94,189,112,230,204, 25, 52,106,212, 8,119,238,220,113,103,161, 14, 29, 58, 4,165, 82,233,
+ 78,167, 86, 21, 57,199,108,154, 50,254, 93,173, 62, 44, 0, 23,175,220,194,193, 83,183,113,228,228, 53,219,173,124,171,213, 33,
+ 74, 15,109,247,220,128,147,231, 38, 91,205,255, 90,189,101,245, 44,130, 36, 36,159,224, 14,167,139,121,221, 41, 95, 81,100, 73,
+146, 12,246,247,247,183, 3,128,205,102,203,216,185,115,167,237,196,137, 19,181,195,195,195,107, 3,158,117,183, 60,123,230,116,
+ 65,112, 72,216,141, 90,181,106,113,143,170,215,237, 31,157, 25,179,213,140,115,151, 47, 68,254,123, 69,203,200,160,208,103,175,
+249,135,191,115, 22,144,238,217,108,118,143,245, 24,134, 25, 63,121,242,100,121,106,106, 42, 76, 38, 19,100, 50, 89,153,207,170,
+203,153,231, 56, 14, 67,134, 12,145,175, 93,187, 54, 6,192, 91, 30, 28,174, 63,128, 14, 0,246,235,117,134, 46, 70, 83, 98,102,
+137,241, 79,128,179, 67,104,133,169,117, 23, 60,207, 99,236,216,177,174,177, 98,195,134, 13, 0,156,142,228,166, 77,155,156,223,
+ 11,165,178,204,163, 10,159,151,182, 97, 97, 97,245, 66, 67, 67,247,195,233,228,237,186,112,225,194,205, 46, 93,186, 8, 47,191,
+252,242,209,216,216,216,169, 4, 65,180, 45,111, 99,134, 97,162,218,180,105,195, 92,191,126,221, 29,152, 57, 28, 14,116,239,222,
+ 29, 0,112,247,238, 93,247,243, 0,208,170, 85, 43, 46, 49, 49, 49, 10, 94, 7,224, 47,163,140, 5, 34, 73,242,185,208,208, 80,
+ 36, 38, 38, 34, 44, 44, 12,179,103,207, 70,147, 38, 77,160, 84, 42,145,145,145,129,162,162, 34,168, 84, 42, 8,130,128,214,173,
+ 91, 83,106,181,186, 43,170,232, 0,212,240,165,215, 44,249,108,129, 46,231,218,102,156,188,108,130,210,167, 54,102,142,108,227,
+ 59, 39,238,196, 71, 0,166,122,170, 35,151,203, 31, 72,253,223, 63, 29,224,122,148,135,235,139, 33,138, 34,130,130,130,192,113,
+156,219,240,203,229,114,112, 28, 87, 38, 3,224, 74,201, 86,132, 75, 83,173, 86,131, 36, 73,144, 36, 9,185, 92, 14,150,101,221,
+171,248, 75, 59, 43,149,225,114, 82,194,194,194,220,253,214,131,131,131,161,211,233, 32,138, 34, 68, 81,132, 92, 46,135, 66,161,
+168, 48, 3, 64,128,112, 59, 0,162, 40,162,101,203,150,144,203,229,248,227,143, 63, 0, 0,237,219,183,135,205,102,115,238,131,
+118,174,165,112,253,116,111,127,191, 38,233,124,206,225,112,224,195, 15, 63, 68, 64, 64, 0,166, 79,119, 6, 86, 43, 86,172, 64,
+ 94, 94, 30,148,106,165,251,252,149, 54,138, 15, 92,148, 94,135, 4,192,129,175,157,122,218, 63,254,112, 46,238,172, 93, 27, 50,
+155, 13,138,162, 34,100,230,231, 67,231,163,121,168,158, 66, 94,137,243,243,232, 72,128,243, 66, 27, 28, 28, 12, 73,146, 8,173,
+ 86, 27,184,122,245,234, 50,199,228,114, 74, 89,150, 5,199, 61,112, 83,200, 3,154, 4, 65, 64,146, 36, 4, 5, 5, 65, 38,147,
+ 97,203,150, 45,136,136,136,192, 15, 63,252, 0, 31, 31, 31,208, 52,237,254,220,185, 28,210,234, 96, 23, 48,233,131,217,159,236,
+122,247,133,230, 84, 86,174, 21,107,118, 30,227, 21, 50,118,157, 67,148, 62,222,121,118,115,230,195,182,169, 57, 97,151,132,101,
+189, 62, 28,183,197,103,204, 79, 63,124,119, 41,175,144, 57,158,145,145, 25,154,145,145, 9,157, 78,119,151, 32, 8,235,226,197,
+139,101,201,201,201, 53, 92,227,227,121,222,227,187, 31, 4, 65, 32,239,222,189, 91,231,238,221,187,143, 69, 79,173, 84,163, 67,
+235,127, 48,109,154,181,194,197, 43, 73,250,211,123,223, 14, 59,124,226,206,172,228,228, 43,193,158,234,145, 36,217,190,126,253,
+250,184,117,235, 22, 50, 50, 50, 96,181, 90,145,145,225, 12,216, 83, 83, 83, 81,187,118,109,248,250,250,162,118,237,218,104,212,
+168, 17, 65,146,228,179, 30, 14,239,101,252,105,236,127,211,235, 12,175, 0,216, 2,160, 5,128,203, 0, 94,175, 76,128, 32, 8,
+ 56, 28, 14,108,216,176,193,157, 1, 96, 24, 6,174,207,208,123,239,189, 7, 0,238,235, 4,203,178,216,179,167,106, 75,181,180,
+ 90, 45,114,114,114, 14,169,213,106,238,228,201,147,183, 58,118,236,152, 7, 32,160,160,160,192,183,188, 44,170, 11,135,195, 17,
+ 25, 16, 16,128,212,212, 84,183,161,175, 89,179, 38,198,141, 27,135,226,226, 98,172, 91,183, 14,249,249,249,224, 56, 14, 12,195,
+ 32, 60, 60, 28, 54,155, 45,178, 74, 3,244,242, 88, 41,227, 0, 4, 6, 6, 6, 56, 28, 14,144, 36, 9,149, 74, 5, 63, 63, 63,
+ 40, 20, 10,100,103,103, 99,252,248,241,216,181,107, 23,108, 54, 27, 88,150, 69,253,250,245,193,243,124,131,170,236,172,137,191,
+225,133, 57, 19,122,135,169,252,245,200, 57, 85, 50,167,174,109,133,145,253, 41,110,241,166, 11, 67,244, 58,195, 98,163, 41,241,
+161, 23,163,210,136,162, 8,150,101, 65,146,164,219,144,186,140, 61, 65, 16,238,197,128,158, 70,217, 14,135, 3, 26,141, 6, 44,
+203,186, 47,178,174,135,235, 92,200,100,127, 70,158, 64,229,183,245,145, 36,137, 90,181,106,193,207,207, 15, 41, 41, 41,101, 34,
+255, 11, 23, 46, 64,146, 36,180,109, 91,174, 51,237,198,181, 31,134, 97,208,173, 91, 55, 52,111,222, 28, 63,253,244,147, 59,229,
+167, 80, 40,176,116,233, 82, 56, 28, 14,252,243,159,255,172, 84,207,133, 43,125,232,106,233,234,218, 15, 65, 16,206,243, 70,209,
+238, 76, 74,101, 99, 19, 37,231, 20,139,143,143,143,219,235,119,253, 47, 40,138,114, 59, 85, 42,149,170,226, 44,197,235, 16,241,
+117, 89, 61, 1, 78,191,165, 90,122,143, 17,163, 41, 17,111, 61, 63, 9,162, 40, 66,169, 84, 66, 16, 4, 66, 20, 69,100,100,100,
+ 96,199,142, 29,160, 40, 10,106,181, 26, 26,141,166, 76,250,190,162,207,137,209,148, 40,189, 63,104, 17, 0,167,195, 24, 25, 25,
+ 9,215,173,133,253,251,247, 7,207,243, 48,155,205,110, 45,215, 3,120,120, 86,161, 60,162,163, 98,124, 13,207,119,251,114,208,
+160, 65,212, 71, 51,166, 8, 90,235, 61, 74,198,177,246,237,167,191, 25, 83,217,182, 53, 39,236,146, 10,215, 14, 20, 85,186,250,
+150,188,194,219,238,231, 77, 38, 83,141,171, 87,175, 94, 63,119,238, 92, 13,142,227,220, 81,178,195,225,168,214,173,152,143, 83,
+143, 99, 57,180,104,220,156, 60,113,254, 4,115,254,220,249, 26, 44, 39,147, 60,213,115, 56, 28,117,148, 74, 37,178,179,179,221,
+ 11,106, 93,184,166, 67, 1, 32, 57, 57, 25,181,107,215,134,197, 98,169,245, 48,157,251, 49,154, 18,243,244, 58, 67, 20,128,125,
+112, 26,253, 51, 0,100,112, 26,255, 46,158, 92,247, 0,167, 3, 26, 19, 19,227,190,206,173, 90,181, 10,128,243,154,184,113,227,
+ 70,119, 6, 64,165, 82,185, 51, 0, 85,224,143,194,194,194,136,164,164,164, 38, 63,255,252,243,214, 41, 83,166,192,102,179,249,
+ 1,240, 29, 49, 98, 68,175,140,140,140,235,146, 36,253, 81,193,246, 4,207,243, 96, 24, 6,146, 36,185,157,128,194,194, 66,220,
+187,119,207,237, 20,187,126,150,124,214,171,158,206,242,242,216, 40,115,117,207,201,201, 41,180,219,237,126, 10,133,194,237, 97,
+102,103,103,227,195, 15, 63,196,119,223,125,135,122,245,234,193,225,112,128,227, 56,100,101,101,129,101, 89,143, 91,158,234,117,
+ 6, 42,216,151, 90, 62,117,198, 92, 13,238,172,133, 78,195,161,235,115,225,128, 42, 2, 84,209,101,196,206,234,235,247,238,204,
+ 31,151,194,131,116,154, 43,138, 46,109,248, 75, 71,250,247,103, 5, 42,162,100,129,149, 59, 74,119, 45, 2, 44, 29,105,185, 34,
+ 77,151,225,241, 36,165, 70, 16,132,219, 67,119, 69,254,174, 49, 73,146, 4, 81, 20, 61,202, 0,184,160, 40, 10, 62, 62, 62,208,
+104, 52,238,237, 93,145,191,195,225,128,195,225,240,120,177,143, 4, 9,231,206, 58, 23, 33,182,111,223, 30, 36, 73,226,200,145,
+ 35, 16, 69, 17,207,253,227, 57,208,140,231,231,207,165,247,175,133,255, 2,207,243, 88,177, 98, 5, 24,134,193,216,177, 99,225,
+112, 56, 16,187, 60,246,129,243,231,137, 94,176,190, 17, 96,177, 64,102,177, 0, 50, 25,120,153, 12,254, 54, 27,164,226,252, 42,
+235, 61, 46, 92, 43,153, 75,178, 79,162, 36, 73,240,241,241,129,175,175,111,153,233,163,210, 6, 27,192, 67, 87,103,223,143, 92,
+ 46, 71, 90, 90, 26, 46, 92,184,128,174, 93,187, 98,251,246,237,232,217,179,167,251,181,210, 89, 41, 79, 62,127,209, 81, 49, 45,
+ 41,138, 74,160, 40, 74, 19, 25, 25, 73, 14, 27, 54,140,216,184,113, 99,106,250,221,172, 81,233, 2,191, 92,148,164,161,213, 61,
+ 15, 14,135,131, 40, 40, 40, 96,138,138,138, 24, 65, 16, 72,201,105, 37, 37, 0,224,121, 94,248,171,245, 74, 83,162,231, 42,116,
+ 85,169, 30,195, 48,169, 89, 89, 89,225,161,161,161, 88,187,118, 45, 72,146, 68, 90, 90, 26,102,206,156,137, 79, 63,253, 20,207,
+ 62,251, 44, 52, 26, 13, 66, 67, 67,113,229,202, 21, 40, 20,138,116, 79,199, 82,226, 4,188, 1,224, 28, 0, 57, 0, 27,156,107,
+ 2, 60, 50,254, 37,199,131, 85,171, 86,185, 35,252,210,223,249,137, 19, 39,130, 36, 73,183,115,207,178, 44,118,236,216,225,145,
+174, 94,103, 96, 0,156,252,241,199, 31, 63,139,140,140,108, 26, 26, 26,234,107, 48, 24,126,179, 90,173,186,247,222,123,175,215,
+ 11, 47,188,208,167, 69,139, 22,217, 0,190, 42, 79,131, 97,152,164,219,183,111,183,213,104, 52,176, 90,173,238,181, 89, 46,104,
+154,118, 59, 0, 44,203,226,250,245,235,144,203,229, 73,158, 30,187,151,199, 79, 25, 7,128, 32,136, 83, 55,111,222,172,235,227,
+227, 3,158,231,193,113, 28,154, 53,107,134,163, 71,143,194,106,181,194,102,179, 65, 38,147,129,101, 89, 92,184,112, 1, 54,155,
+205,227, 42, 66, 42, 5, 57,114,225,204,183,130, 89,153, 6,200, 77,132, 86,171,195,218, 85,159, 1,214, 52,128,228,208,175,219,
+ 51,212,199,159, 31,120, 94,175, 51, 52, 50,154, 18,147, 43,210,146, 36,233,129,232,191, 52,174,249,109, 79, 13,152, 40,138,101,
+ 12,255,253,169,116,165, 82,233,190, 95,223, 83,131, 67, 16, 4,238,222,189,139,156,156, 28, 52,105,210, 4, 52, 77,227,226,197,
+139,144, 36, 9,173, 91,183,246,120,108, 46, 72,146, 68, 98, 98, 34, 78,157, 58,133,209,163, 71, 67,161, 80, 96,249,242,229,112,
+ 56, 28,152, 59,119,174,123,193, 98, 85,177, 88, 44,238, 20,162,115,224,206, 47, 42, 65, 18,101,199,232,161,159,158,145,145,225,
+118,114, 0,231,121,112,157,191,210, 99,244,116, 94, 50, 35, 35, 3, 18,199,193, 79,146, 64, 84,160,247,180, 50, 1,146, 36, 65,
+ 38,147,185, 83,175,162, 40, 34, 56, 56, 24, 44,203,186, 35,127,151, 99, 82, 21,231,164,126,253,250, 72, 75, 75, 67,175, 94,189,
+ 96, 54,155,161,211,233,220,115,208, 85,157, 2,136,142,138,105,169, 86,171,247,143, 24, 49, 66, 75,211, 52,124,124,124,176,106,
+213, 42, 92,188,120,177,237,246, 19,235, 51, 0,252, 82,141,227, 22,114,114,114,184,155, 55,111,170,108, 54, 27, 85,167, 78,157,
+ 34,138,162, 36,135,195, 65,229,230,230,202, 25,134, 65, 96, 96,160, 69, 16, 4,143, 35,246,220,220, 60, 54,229,246,101,205,227,
+210,123, 24, 37,122, 74, 79,245, 68, 81, 60,114,229,202,149, 6, 17, 17, 17, 68,163, 70,141,192,113, 28,106,213,114, 6,249, 45,
+ 90,180, 64,147, 38, 77,220,215,135,171, 87,175, 2,192,113, 79,199,162,215, 25,252, 1,108,131,211,248, 91,225,204, 0,124, 87,
+178, 38, 32,219, 19, 13, 87,246,179,116,154,223,197,218,181,107, 31,152,255,175,116, 97,176,115, 92,181,154, 55,111,126,112,212,
+168, 81,245, 50, 50, 50, 48,123,246,108,235, 39,159,124,242,252,234,213,171,223, 81,171,213,100, 90, 90,218,205, 86,173, 90,165,
+ 25,141,198,209, 70, 83, 98,126,121, 58, 60,207,239, 59,126,252,248, 51,125,251,246,101,114,115,115,221,183, 41,187,112,173,157,
+112, 57, 0, 71,142, 28,177,155,205,230,125,158, 28,183,151, 39, 67, 25, 7, 32, 55, 55,119,209,188,121,243,186,172, 90,181,202,
+ 55, 63, 63, 31, 12,195, 32, 53, 53, 21, 93,187,118, 69, 82,146,211, 81,115,165,197,103,207,158,157,149,157,157,189,202,147,157,
+232,117, 6, 69,173, 64,110,214,192,119,102,203,113,251, 75,128,100,145,141,150,104, 97, 24,142,204,155, 71,129,162, 36,128, 96,
+177,234,159, 35, 2, 94, 28,182,120, 53,128, 78,149, 14,188,196, 56, 61, 44,138,118,121,157,158, 26, 89,130, 32,220,209,213,195,
+162,104,215, 66,154,210, 14, 64,101, 6,204,245,122,233,200, 95, 20, 69,247,223, 85, 49,254, 46,189,210,217, 10,133, 66, 1,158,
+231,221,127, 87,197,216, 16, 4,129,214,109, 91,151, 57,127,255,232,240, 15,247,235,238,243, 87,234,110,128,138, 32, 73, 18,243,
+ 62,157, 87,230,252, 45,251, 98,153,251,117,151,113, 46,189,122,191, 50,189,226,204, 52,112, 28, 7, 63,215,255,195,250,231,173,
+254, 85,213,123,156,148,114, 22, 37,215,223,174,197,121,247,167,234, 61,205, 22,185,110,245,148,201,100,176, 88, 44, 0,224,254,
+ 9,160,140,174,203, 1, 40, 47,171, 48,160,219,251,207,104,181,218,223,134, 15, 31,174,185,124,249, 50, 24,134,129, 90,173,198,
+165, 75,151,132,248,132,216,140,135,110, 84, 9, 14,135,131,218,184,113, 99, 96,102,102, 38,217,184,113,227, 59,205,154, 53, 51,
+113, 28, 39, 90,173, 86, 7,199,113,188, 82,169, 20,204,102,179,242,198,141, 27,181,210,210,210, 40,135,195,225, 65,106, 75,194,
+111, 7, 14, 52,104,168,111,118,251,145,245, 42, 88, 34,200,113, 28,175, 80,170, 28,158,234,217,237,246, 21, 43, 87,174,124, 35,
+ 46, 46, 78,161, 86,171, 65, 16, 4, 2, 3,157, 5, 41,213,106,117,153,244,117, 92, 92,156,185,176,176,112,105,229,199,234, 54,
+254,251, 1, 52, 5,144, 4,224, 85, 0,223, 3,104, 6,231,194,192,174,158, 56, 1,162, 40,150, 49,254,174,239, 27, 65, 16,152,
+ 54,109, 26, 40,138, 42,147,201, 92,183,110, 93,101,227,170,245,204, 51,207, 28, 57,120,240, 96,232,141, 27, 55, 16, 19, 19,131,
+243,231,207,191,208,183,111,223, 22,168, 98, 33, 32,135,195,177,104,219,182,109,163,218,182,109,171,243,247,247,135, 32, 8, 32,
+ 8,194,189, 40,184,244,216, 46, 94,188,136, 61,123,246, 20,219,237,246, 69,149,158, 60, 47, 79,140, 50, 87,119,163, 41,241,248,
+179, 97, 47,125,187,105,211,166,225, 67,135, 14,229, 68, 81,132, 66,161, 64, 76, 76,140,123, 78,135,162, 40,140, 25, 51,166, 48,
+ 43, 43,107,137,209,148,120,213,147,157, 4,104,233, 15, 63, 30,217,208,143, 44, 56, 9,228,159, 4,104, 31, 4,248,105,112,246,
+ 68, 34,112,239, 4, 64,178, 0,201,161, 77,203, 38,104,209, 52,188,137, 94,103,232,104, 52, 37, 30,122,152, 22, 73,146,216,191,
+127, 63, 72,146,132, 78,167,115,207,243,151,126,184, 46,146,229, 57, 8,101, 78, 0, 77, 35, 58, 58, 26, 52, 77, 35, 34, 34, 2,
+ 74,165,210,189,162,222, 21,209,249,250,250,186, 29,128,170, 24,110,189, 94, 15,165, 82,137,164,164, 36,136,162,232,142,252, 79,
+156, 56,225, 76,183, 63,247,156,199, 90, 36, 73, 98,216,176, 97, 8, 9, 9,193,231,159,127, 94, 38,242,159, 49, 99, 6,120,158,
+199,210,165, 30, 93,139,112,248,144,115,193,177,143,206,199,109,228, 41,154,114,255,228, 56, 14, 4, 8,119, 38,160, 66, 8, 96,
+204, 40,231, 84,178, 62, 66,239, 54,202,165,163, 86, 95, 95, 95,144, 36,233,142,220, 43, 65, 26, 51,106, 12,241, 24,245, 30, 27,
+ 20, 69, 73,175,190,250, 42,225, 50,234,129,129,129,238, 41, 1,215, 5,247,254, 7, 80,233,124, 61, 63,116,232, 80,183,215, 73,
+ 81, 20,250,246,237,139,148,148, 20,247,103,208,223,223,223,157, 85,240,224,243, 60,229,255,254,239,255, 52,123,246,236,129, 76,
+ 38,131, 43, 29, 75, 16, 68,181,171, 8, 74,146,148,146,144,144,224, 51,123,246,236,156,144,144, 16,182,176,176,144, 42, 61,151,
+ 46,147,201, 16, 18, 18, 98,207,207,207, 55,239,217,179,167,165, 36, 73,169,229,105,145, 20,151,190,106,243,231,161, 14,168,196,
+ 23,250,190, 44,213,172, 25,250, 72,122, 0, 96, 42,146,153,191,251,229, 71, 89,215,103, 59,144,193, 1, 15, 86,193,172,138, 94,
+124, 66,236,169, 33,189,166,173,140,141,141, 29, 51,113,226, 68,185, 66,161,128, 86,171, 69,114,114, 50,234,212,169, 3, 0, 48,
+155,205,152, 62,125,186,217,110,183,111,136, 79,136, 61, 90,241,217,115,179, 5, 78,227,127, 17, 64, 87,163, 41, 49, 91,175, 51,
+ 60,143, 63,157,130,159, 1,180,171, 76, 68,146,164,135,102, 0, 92, 83, 3, 10,133,194, 29,253, 87,246,221, 40,109,252,111,223,
+190,141,141, 27, 55,226,200,145, 35, 70,163, 41,113, 31,156,107, 21,170, 68,124, 66,172, 41, 58, 42,102,200,252,249,243,183,204,
+156, 57, 83, 25, 26, 26, 10,158,231,241,249,231,159,187,199,206,113, 28,146,146,146, 48,101,202,148, 98,171,213, 58, 36, 62, 33,
+214,163,234,130, 94,158, 12, 15,132,119, 38,147,105,226,242,229,203,169, 93,187,118,189,177, 96,193, 2, 93,227,198,141, 49,112,
+224, 64,216,108, 54,156, 59,119, 14,163, 70,141,202,205,206,206,254, 50, 47, 47,111,161,167, 59,225, 69,241,149, 79,214, 38, 23,
+124,186,126,184, 4,162,164,228, 59,249, 27,156,191, 83,112, 63, 71,144, 48,155,237,108, 80,128,255, 16, 0, 15,117, 0, 92,209,
+ 95, 81, 81, 17, 92, 41,186,202, 50, 1, 21, 17, 18, 18, 2,192,185,194,247,157,119,222,129, 78,167, 43, 55, 19,224,233, 2, 64,
+ 0,238,213,255,165, 35,127,151,131,226, 90,189, 95, 21, 40,138,114,223, 94,230,112, 56,220,145,191, 92, 46, 7,207,243,238, 2,
+ 60,149,161, 84, 59, 23, 5, 21, 23, 22,163, 81,163, 70,144,201,101,143,116,254,106,213,113,166, 71,239,164,220,193,136, 17, 35,
+ 16, 24, 24, 88,238,249, 43,157,166, 47,239, 28,238,248,191, 29, 44, 0,244,237,215,151,175,138,222,211,200, 4,132,132,132,108,
+180,219,237,172,203,176,219,237,246, 47, 1,184, 35,243,251,141,191, 39,206,201,226,175,167,148,201,209,190, 63,104,145,212,191,
+127,127,228,229,229,149,187, 38,165,162,207,159, 32, 8, 75, 22, 47, 94,252,210,204,153, 51,229,106,181, 26,231,207,159,199,246,
+237,219, 11, 28, 14,199, 11,213, 59,106, 32, 35, 35,163, 53, 69, 81,131,134, 13, 27, 54,191, 99,199,142, 1,163, 71,143,190,161,
+ 86,171,243, 56,142, 99, 2, 3, 3,229,130, 32, 40,247,238,221,219, 56, 61, 61,189,134, 36, 73,179, 51, 51, 51,191, 46, 71, 74,
+ 10,167, 80,111,227, 33,134,220,127, 77, 59,144,250,246,157,121, 29, 59,118,244,127, 4, 61, 0,144,236,191,243, 62,251,235,152,
+151,231,152,126, 25, 89, 39,164, 6, 12,109,159, 35,213, 74, 53, 8, 0, 1,129,129,114, 65, 16, 21, 85,208, 3,207,243,211,147,
+146,146, 48,118,236,216,209,131, 7, 15, 86, 52,110,220, 24,117,235,214,133,209,104, 68,114,114, 50, 86,173, 90,101,113, 56, 28,
+107,173, 86,235,228, 42,156,198, 60, 0, 71, 1,188,228,138,244,141,166,196, 28,189,206,208, 21,192, 86, 56,215, 3, 84, 74,242,
+169, 77,216,182,235, 22,238,159,201,120,255,253,247, 43, 58,158,135, 62, 31, 28, 28,188,228,224,193,131,161,169,169,169, 88,191,
+126, 61, 86,173, 90,117,199,106,181,246,244,232,104,202, 33, 62, 33,118, 71,116, 84,204,235,211,167, 79,255,166, 71,143, 30,170,
+118,237,218,177,245,235,215, 7,203,178, 72, 73, 73,193,193,131, 7,237,187,119,239, 46,178, 88, 44, 3,227, 19, 98,119, 61,202,
+190,188, 60, 58, 15, 92,225,141,166, 68, 30,192, 40,189,206,176,113,208,160, 65, 51, 4, 65,104, 74,146,164, 82,146,164, 66,146,
+ 36, 79,167,167,167,127,108, 52, 37, 94,168,202, 78,142,223,254,173,225, 99, 27,113, 9,174,133,107, 36, 73,194,207,207,239,129,
+ 91,255, 74, 10,181,184,223, 95,153,209,102, 24, 6,227,198,141, 3,195, 48,104,209,162,197, 3, 81, 29,199,113,208,233,116,110,
+ 67,233,137, 19,224,154, 3,107,211,166,141,123, 77, 2, 0,119,228, 95,149, 69,128, 36, 73,194,199,199, 7, 28,199, 97,254,252,
+249,238, 57,103, 0, 88,186,116, 41, 36, 73,242,120, 17,160,139,223,143,253, 14,160,242, 76,128, 71, 16,192,148, 73, 83, 0, 84,
+ 30,185,123,136, 52,101,210, 20,143, 50, 1, 79,139,133,235, 39,217, 81,170,160,207,228,193,159,185,139,155, 84,199,248,151,135,
+221,110,175,112, 77, 10, 80,126, 86,225,155, 61,159,157,136,142,138,233, 78, 16,196,222, 41, 83,166,200, 62,249,228,147, 66,187,
+221,222,111,203,190, 37, 15,117,168, 61,193,104, 74, 20, 1,108,236,211,102,248,183, 7, 14, 28, 24,119,244,232,209, 41,207, 63,
+255,252,141,103,159,125, 54,239,228,201,147,205,111,222,188, 89, 95, 20,197,207,100, 50,217,138,157, 39,214,150,107,200,106, 78,
+216, 37, 1,144,102, 76,128, 56, 3,216,208,167,205,240, 45,143,162,231,210, 52,160, 23, 15, 72, 99,182, 39, 41, 63,184,126, 39,
+231,155, 59, 25,255,238,211,176, 94,152, 36, 1, 56,121,242, 84,179,170,232, 1, 64,124, 66, 44, 15, 96,114,116, 84,204,119, 27,
+ 54,108,152, 1,160,173,217,108,174,161, 80, 40, 50, 72,146, 60, 81, 88, 88,248,207,248,132,216, 99, 85, 60,135,253,203,121, 62,
+ 7, 64, 23, 79, 52, 88,150, 77,233,254, 28, 26,228,152, 59, 66, 16, 61, 95, 60,159,146,146,146, 81, 84, 84,244, 64, 33, 42,141,
+ 70,211,242,210,165, 75,216,186,117, 43,226,226,226,238,152,205,230,142, 70, 83, 98,138,199,194,229, 16,159, 16,187, 43, 58, 42,
+ 38,124,247,238,221, 83,126,251,237,183,110, 22,139,165, 9, 0, 40,149,202, 75, 86,171,117,175,213,106, 93, 20,159, 16,155,247,
+168,251,241,242,232,148, 27,226, 25, 77,137,199, 0,244,125,138, 99,169, 18,165, 51, 1,225,225,225,238,139,110,117, 13,130,171,
+129,206,173, 91,183, 48,104,208, 32,248,249,249,149, 27,121, 86, 6, 73,146, 56,122,212,179,204,160,235,246,182,138,224, 56, 14,
+227,199,143,247, 72,207,211,121,231,170,100, 2, 60,161, 42,153, 0, 79,168, 74, 38,224, 47, 68, 24, 59,118, 44, 85,250, 22,202,
+251,127,103, 89, 86,242,241,241,241, 56,253, 46, 8, 2, 63,100,200,144, 10, 15,146, 97, 24, 17, 21, 84, 1,140, 79,136, 61, 28,
+ 29, 21,211,249,192,129, 3, 51,139,138,138, 98, 55,239, 93,252, 88, 90,126,150, 24,207,197,207,213,127,249,171, 93,187,118, 77,
+255,245,215, 95, 95,230,121,254, 71,171,213,218,251,216,245, 31,171, 92,132,233,113,233,213,156,176, 11, 0,164, 23,151,245,202,
+ 7,208,111,211, 9,170,246,237,204,212,109, 26,165, 60,242,218,181,171,135, 45,150,234,141,175,164,194,223,203, 0, 16, 29, 21,
+ 67,126,181,125,222, 19,239, 54, 89, 17, 86,171,181,163,161,255,222, 35, 86,171, 53,204,211,109,228,114,121,170,197, 98,249, 71,
+124, 66,236, 3, 99,191,114,229, 74, 76,207,158, 61, 23, 20, 23, 23,231,219,237,246,232,199, 97,252, 93,148, 24,248,233, 0,166,
+ 71, 71,197, 16, 0, 16,183,237, 67,111,123,235,191, 25,143,167,195,200, 95, 76,101,198,182,170, 70,173, 50, 99, 91,217,202,218,
+199,157,142, 46,221,237,240, 73,224,202, 4, 84, 68,117, 50, 1,229,190,133, 32, 60,215, 43,149, 9,168, 72,143,244, 35, 43,238,
+ 15,253, 4,160, 40,202, 95, 38,147,105, 93,153,166,210,169,122, 87, 38, 64,163,209, 20,246, 29,222,198, 99, 7, 96,105,252, 7,
+149, 47,219,246,128,248,132,216,227, 0,250, 61, 14,173,251, 41, 49,166,211, 81, 65,121,222,191, 66,207,229, 8, 12, 94,214,235,
+ 54, 32,181, 3, 64,252,227,157,123, 82, 73,230,225,145,120,152, 1,125,218,148, 44,226,172,255,184,244,140,166,196,237, 0, 60,
+110,196, 86, 93,226, 19, 98,189,134,255,111, 10, 97, 52, 61,150,224,192,139, 23, 47, 94,188,120,241,242, 31,196,211,155, 64,245,
+226,197,139, 23, 47, 94,188,252,109,240, 58, 0, 94,188,120,241,226,197,203,255, 32, 94, 7,192,139, 23, 47, 94,188,120,249, 31,
+196,235, 0,120,241,226,197,139, 23, 47,255,131,252, 87,220, 5,240,184,233,211,102, 56,103,177, 88,158, 97, 24, 38,249,215, 51,
+ 27,239, 61,170, 94,251,240, 87,213, 52, 77, 55,146,201,100, 87, 31, 69, 79,175, 51,144,205,154, 53,147, 11,130, 64,200,100, 50,
+145,101, 89,137,227,184,251, 87,216, 58,190,252,241, 99, 71, 21, 52, 9,252, 89,233, 95, 50,154, 18,189, 43,118,189,120,241,226,
+229,127,128,167,114, 23,192,160, 30, 83, 50, 4, 65, 8,242,244,253, 44,203,102,115, 28, 23, 82, 21, 67,246, 56, 48, 52,238,223,
+132, 36,201,137, 10,133,226,141, 38, 77,154,104,111,220,184, 33,229,230,230, 38, 74,146, 52, 44,241,242,119, 41, 85,213,235,208,
+240,181, 96,154,166,215,250,248,248,244, 12, 15, 15, 39, 31, 69,239,149, 14, 99,216,176,176,176,239, 72,146,124, 17, 64,185,183,
+ 36,145, 36, 89, 96, 50,153, 2, 61, 57,119,122,157,129,236,215,175,223,243, 0,234, 85,244, 62,138,162,172, 63,254,248,227, 55,
+ 37, 5, 97,158, 10,239,190,252, 17, 93, 84, 84, 52,152,166,233, 23, 36, 73,122, 6, 0, 65,146,228, 89,135,195,177, 83, 20,197,
+ 13, 37,197, 90,170,140, 94,103,176, 2,120, 88, 71, 29,185,209,148, 88,237,114,185,255,205, 52,244, 49, 16,171, 39,195, 15, 0,
+ 70,126,134,220,192,192, 0, 37,203,178,175, 73,146, 52,160,228, 45,241, 60,207,111,205,202,202, 46, 46,253,190, 43,247,158,188,
+ 51,217,208,199, 64,172,155,134, 26, 0,240,246, 66,220,173, 87,175,174,150,231,249,183, 36, 73,138, 6, 0,130, 32,226, 25,134,
+217,114,243,102, 74,126,233,247, 61,141,177,181, 8,233,153, 97,177, 88,130, 0, 64, 46,151,103, 90, 44,150, 26, 40,113,182, 95,
+127,253,117, 34, 59, 59,155, 0,128, 3, 7, 14,184,186, 31,254,229, 14,248, 91,207, 79,106, 12, 96, 0, 65, 16,111,192,153, 33,
+222, 74, 16,196,230,205,123, 23, 95,172,138,206, 27,157,199,215,164,105,122, 24,128,193, 0, 40, 73,146,182, 0,216,176,101,223,
+146,107,143,127,212, 94,170,203, 83,113, 0,162,163, 98,164,132,132, 4,104, 52,154, 7, 7,112, 95,209,154,156,156, 28,188,240,
+194, 11,130, 66,161, 80,125,249,227,199, 79,237,130,220,169,209, 27, 74,150,101, 47,204,153, 51,167,222,192,129, 3,193, 48, 12,
+ 44, 22, 11,226,227,227,241,207,127,254,179,208,102,179,181,218,119, 97,179, 71,189, 15, 0, 32,170,217,192, 16,146, 36,207,205,
+153, 51,199,127,240,224,193, 32, 8, 2,102,179, 25, 91,182,108,169,178,222, 43, 29,198,176,245,234,213,251,182, 65,131, 6,221,
+ 23, 46, 92,168,188,122,245, 42, 34, 34, 34, 32,138,162,187, 44,176, 32, 8,144, 36, 9,131, 6, 13, 18,242,243,243, 43, 61,119,
+122,157,129,236,219,183,111,148, 94,175,175,185, 96,193, 2,230,234,213,171,104,212,168, 17, 4, 65,128, 40,138,101,126, 14, 30,
+ 60, 88,226, 56,110,221,252,213,227, 30,169, 53,171,167, 12,232,246,126, 36, 77,211,255, 30, 56,112, 96,221, 78,157, 58,177, 65,
+ 65, 65, 48,155,205, 72, 78, 78,198,241,227,199,109,187,119,239, 78,181,217,108,175,125,187,127,233,185,170,106,123, 29,128,170,
+209,208,199, 64,172,156,129, 57,144, 48, 3, 18,136,179,215, 21, 73,123, 79, 5,213,127,251,237,183,149,111,188,241, 6, 76, 38,
+ 19,182,109,219,134,109,219,182, 21,247,104,147,117,173,121,152, 57, 18, 4, 36, 16, 88, 48,122, 1,230, 60, 73, 67,219,208,199,
+ 64,124, 57, 29,159,138,192, 20, 0, 56,127, 93,126,101,255,185,218,245, 70,140, 24,193,189,250,234,171,200,207,207,199,191,255,
+253,111,124,247,221,119,182,168,103,210,110, 54,171,111,105, 8, 0, 36,176,232,221, 79, 49,253, 73, 59, 1,122,157, 65, 42,221,
+ 21,115,228,200,145,224,121, 30,118,187, 29,118,187, 29, 86,171,245,130,217,108, 62,109,183,219,143,115, 28,119,120,239,222,189,
+151,154, 4, 43,218,104, 53,170,168,141,127,108,155,255, 36,199, 86,154, 18, 99,253, 22,128,232,214,173, 91, 63, 51,102,204, 24,
+ 52,110,220, 24, 86,171, 21,199,143, 31, 71,124,124, 60,206,159, 63,127, 30, 64, 60,128, 45,241, 9,177,183,203,211,138,142,138,
+105, 9, 96,110, 88, 88, 88,207, 33, 67,134, 80, 29, 58,116, 64, 97, 97, 33,126,253,245, 87,252,240,195, 15,200,204,204, 60, 2,
+ 96,118,124, 66,236,111,158,140,109, 88,159,233,183,108, 54, 91,168,235,111,134, 97,178,101, 50,217, 83, 15, 14,255, 91,121,106,
+ 83, 0, 44,203, 98,251,246,237,160,105, 26, 12,195, 32, 55, 55, 23,161,161,161,238,214,144, 15,235,111,253, 52,161, 40,234,227,
+174, 93,187,214, 27, 54,108, 24, 14, 29, 58,132, 93,187,118,161, 85,171, 86,232,219,183, 47,238,220,185,163,254,234,171,175, 70,
+ 0,152,230,169,158,195,225, 24, 50,102,204, 24,255, 33, 67,134, 96,223,190,125,216,179,103, 15,218,180,105,131,190,125,251, 34,
+ 45, 45, 77,189,122,245,106,143,244,244, 58, 3,217,167, 79,159,175,235,215,175,255,252,194,133, 11,149, 44,203,226,220,185,115,
+184,123,247, 46, 2, 3, 3, 33,151,203,193, 48,140,251,188,122,130, 94,103, 32,250,244,233,211, 53, 60, 60, 60,100,193,130, 5,
+ 12,195, 48, 56,125,250, 52, 50, 51, 51,221,141,103, 24,134, 1, 69, 81, 30,105, 70, 71,197,212,151,203,229,139, 0,180,178, 90,
+173,181, 0, 64,161, 80,220,145, 36,233, 7,179,217, 60, 51, 62, 33,214,236,209,192, 0, 12,232,246,190, 62, 56, 56,248,224,138,
+ 21, 43,116,254,254,254, 40, 44, 44,196,173, 91,183, 80, 88, 88, 8,154,166,209,177, 99, 71, 78,175,215, 55, 88,191,126,253,254,
+232,168,152,206,241, 9,177, 30,149,165,118, 25,126, 81, 20, 31, 90, 10, 86,161, 80,220,211,235, 12, 28,188,142, 64, 25, 54, 76,
+ 69, 16, 65, 97,230,200,183,222,165, 0, 96,245,183, 95, 53,251,215,151, 7,161,245,173,229,126, 79,187,118,237, 48,109,242, 24,
+229,182,101, 13,154,143,124,243, 93, 0,192,234, 45, 95,206,220, 48, 21, 43,255, 49, 3,213,234, 64,232, 9,235,166,161,134, 72,
+ 98,202,232, 1,163, 73, 0, 88, 21,255,101,163,133, 95, 38, 64,163,171,237,126,207, 51,207, 60,131,152, 9, 35,184,239,151,212,
+111, 52, 42,122, 52, 0, 96,229,230,149, 83,214, 77,195,242, 14,211,145,254,164,198,246, 48,162,163,163,145,147,147,131,220,220,
+ 92,228,231,231,167, 21, 20, 20,100, 90, 44,150, 52,133, 66,113,233,197, 23, 95, 76,110, 28,160,169,175,243,215,253,223,188,201,
+111,167, 3,120, 42, 14,192,128,110,239,207,169, 93,187,246,236,152,152, 24,178, 93,187,118,101,250,107, 48, 12,131,168,168, 40,
+ 68, 69, 69, 33, 35, 35,163,217,129, 3, 7,154,109,222,188,249,211, 1,221,222,255,108,243,222,197, 83,203,145,220,186,109,219,
+182,176,218,181,107,187,203, 97,107,181, 90, 12, 31, 62, 28,131, 7, 15,198, 47,191,252,210,254,147, 79, 62,217,246,238,203, 31,
+ 5,121, 98,196,121,158, 15, 57,124,248, 48,100, 50, 25,236,118, 59,183, 42,151,210, 0, 0, 32, 0, 73, 68, 65, 84,250,244,233,
+163, 50,153, 76,124,116, 84, 76,153,247,121, 29,131,234, 81,174, 3,160,215, 25,126, 2,224, 7,224,117,163, 41, 49,163,212,243,
+ 1, 0,126, 2,144,107, 52, 37,122, 92,105,204,225,112,184, 13,213,238,221,187,177,108,217, 50,108,221,186, 21, 97, 97, 97,238,
+206, 86,174,199, 95,129, 36, 73,159,239,221,187,183,233,240,225,195,187,239,219,183, 47,131,231,249,133,155, 54,109, 26, 31, 31,
+ 31, 95,175,119,239,222, 88,191,126,253, 16,189,206, 48,211,104, 74,244, 36,181, 78,132,132,132,188,253,214, 91,111,225,246,237,
+219, 24, 58,116,104,186, 36, 73,179, 55,111,222, 60,203,165,183,110,221,186, 74,245, 74,230,231, 73,134, 97, 94, 91,176, 96, 1,
+233,170, 64, 72,146,164,251, 92,185, 12,191,171,209,144,135, 16, 44,203,214, 91,176, 96, 1,225, 58,223, 36, 73,186, 13,190,171,
+151, 2,195, 48,149, 86, 81,124,179,235,196, 38, 74,165,242,200,226,197,139,181,145,145,145, 4,195, 48,112, 56, 28, 48, 26,141,
+161, 95,127,253,245,187,127,252,241, 71,239,232,168,152, 72, 79, 82,246,179, 70,174,160, 40,138,250, 97,249,242,229, 58, 87, 41,
+102,158,231, 97, 50,153, 96, 50,153, 80, 88, 88,136,194,194, 66,200,229,114,188,254,250,235,190,107,214,172,217,230,169,182,151,
+234, 65,178,160, 36, 7,200, 63, 63, 7, 18, 40,234,193,194,140, 44, 75, 67,130,228,254,188, 72, 18, 72,146,197,211,107,213, 88,
+ 2,241,144,207,235,211,236, 24, 89, 26,185, 92,158, 73, 16, 68, 16, 0,248,251,251, 99,213,170, 85,176,217,108,146,217,108, 62,
+107,181, 90, 79, 89,173,214, 99, 52, 77, 31, 89,247,243, 2,227,171,122, 67, 16, 43,103,118,175,142, 91, 38, 81,162,165,230,211,
+ 26,163, 36, 73, 83,191,251,238, 59,210,213, 84,173, 60,130,131,131, 17, 21, 21,133,160,160, 32, 98,218,180,105, 83,250,180, 25,
+ 62,187,156,190, 10, 53, 67, 67, 67,113,246,236, 89,248,250,250, 34, 32, 32, 0,247,238,221,195,177, 99,199,112,252,248,113, 68,
+ 68, 68,128, 36, 73, 95, 56,109,143, 71,198,218,149, 69,145, 36, 9, 11, 22, 44,144, 75,146,228,110,168,230,250,253,253,247,223,
+247,171,138,166, 23, 39, 21, 89, 12, 29,128, 14, 0,126,211,235, 12, 93,140,166,196,140, 18,227,191, 15,206,246,149,135,171,178,
+ 35,151, 3,144,150,150,134, 85,171, 86, 97,240,224,193,104,219,182, 45,242,243,243,255, 22, 14,192,129, 75,223,222, 2,208,163,
+107,100,244, 80, 65, 16, 50, 19, 47,127,183,171,115,147, 55,241,211, 79, 63, 45, 25, 55,110, 28, 34, 35, 35,131,236,118,123,123,
+ 0,149,206,153,212,172, 89,179, 89, 68, 68, 68,131,176,176, 48,124,246,217,103,144, 36,105,245,111, 73, 91,214,117,110,242,166,
+230,167,159,126, 90,242,222,123,239,161,105,211,166, 30,235,137,162, 40, 93,189,122, 21, 23, 46, 92, 0, 73,146,208,106,181, 80,
+169, 84,238,214,160,165, 91, 33,123,138, 32, 8, 72, 78, 78, 70, 82, 82, 18, 40,138,114,107,150,254, 63,184, 28,141,138,144,203,
+229,147,231,207,159,175,141,140,140, 36,178,179,179, 33, 73, 78, 35, 16, 16, 16,128, 41, 83,166,200,103,206,156, 89, 43, 57, 57,
+121, 6,128,143, 43, 27,211,245,235,215, 7, 13, 29, 58,180,129,171,238,255,133, 11, 23,112,247,238, 93,183,225,119, 61,210,210,
+210,208,176, 97, 67,180,108,217, 50,244,228,201,147,239, 0,136, 43, 79,243, 33,145,127,153,244,191, 36, 73, 40, 40, 40,128,209,
+104,228, 10, 11, 11,209,178,101, 75,139, 94,103,128,209,148,232,121,183,149,255, 98, 6,207, 71,250,170,233, 88,190,250,219,213,
+ 19, 0, 2,170, 26,253,112,244,120, 18,106,215, 46, 64,157, 58,117, 96,177, 88,112,228,200, 17,156, 62,125, 26, 74,180,193,234,
+111,191, 2, 32,129, 32,176,124,240,124,164, 95,121,228, 37,180,229,243,246, 66,220,253,114, 58, 22,197,125,179,114, 26, 73,146,
+ 80,215,124, 5, 71,142, 93, 64,237,218,247, 80,183,110, 93, 20, 21, 21,225,240,225,195, 56,123,246, 44,212,120, 22,171,226,191,
+132, 40,138,160, 8, 44,114,174, 3,120,114, 99, 3,128,179,233,187,131, 63, 26,189,178,232,237,183,223, 86,126,243,205, 55, 72,
+ 74, 74,242,137, 79,136,205,191,255,125,175, 52,124, 77, 37, 82,228,206,149, 75, 62,161,101, 44, 25,120,124,215,238, 91,109, 90,
+189,251,100, 7,247, 39, 36,241,243,207,200, 26, 56, 16,108, 74, 10, 84, 37,142,119,105,174, 94,189,138, 3, 7, 14,224,198,141,
+ 27,168, 87,175, 30, 8,130, 64,173, 90,181,202,253,126,184,166, 14,179,178,178,144,149,149,133,181,107,215,186, 95, 51,155,205,
+144, 36, 9, 54,155,141, 24,216,125,114,216, 55,123, 62,187, 81,217, 0, 79,157, 58,133,188,188, 60,247, 84,103,233, 41,202, 82,
+157, 85,189,139,151,171, 65, 69, 22,227,101, 0, 9, 0,158,129,211, 9,120, 13,127,246,180,190, 12,224,245,170,236, 72, 16, 4,
+ 48, 12,131, 79, 63,253, 20, 54,155, 13, 39, 79,158,196,107,175,189, 6,192, 25,125,170, 84, 42,124,241,197, 23, 79,188,238,125,
+101,236,191, 24,191,193,245, 59, 73,146,191,223,184,113, 3,146, 36, 65,163,209,128, 32, 8, 79,139,252,203,213,106, 53, 0,224,
+230,205,155,144, 36,233,120,105, 61, 0, 30,233, 25, 77,137,146, 94,103, 16, 1, 72,122,189, 30,121,121,121,160, 40, 10, 42,149,
+ 10, 44,203, 34, 34, 34, 2, 25, 25, 25,101, 28, 0, 79, 26, 1, 1,144, 8,130,144,154, 52,105, 66,228,228,228,128, 97, 24,183,
+241,111,220,184, 49,238,220,185, 83, 38,203, 80, 81,100, 64,146,100,207,198,141, 27, 19,247,238,221,131, 36, 73, 15,116,100,156,
+ 50,101,138, 98,248,240,225,179,134,246,254, 96, 10,195, 48,249, 14,135, 99, 75, 97, 97,225, 39,219, 14,174,120,160, 15, 56,203,
+178,189, 59,116,232,192, 22, 21, 21,193, 98,177, 60,212,248, 23, 22, 22,162,168,168, 8, 70,163, 17, 53,107,214,148,157, 57,115,
+166, 23, 42,112, 0, 42,130,231,121, 20, 22, 22,162,160,160, 0, 5, 5, 5, 40, 44, 44,172,142,204,127, 53, 87,238, 37, 74,163,
+ 62, 53, 76,106,210,208,127,194, 31,127,252,129, 3,135,207,195,110,183,227,250,245,235,184,113,227, 6,254,239,255,254, 15, 44,
+203, 66, 38,147,193,193,117, 67,211,103, 39, 32, 38, 38, 6,151,174,100, 78,122,210,115,236, 87,238, 37, 74,239,126,106,152,174,
+111, 16, 60,237,204,153, 51,216,159,120, 18, 14,135, 3, 55,111,222,196,205,155, 55,177, 99,199, 14,247,216, 36,174, 11,154,255,
+ 99, 2,198,143,159, 0,227,181,140, 39, 62,255,239,130,231,121, 34, 51, 51, 19, 22,139, 69,228,121,254,129,232, 84,175, 51, 16,
+209,111,190,190,253,217, 6,254,225,181,235,214,215, 28,222,190, 25,215,175,167, 73,109,158,198,224, 92,216,156,190,177,221,110,
+ 71, 94, 94, 30,136,142, 29,193,180,107,135,235,227,198, 97,239,254,253,200,200,200,112, 79,213, 58, 28,149, 7,216,130, 80,254,
+ 82, 33,139,197, 2, 0,224,121,126, 41, 73,146,253,163,163, 98,122,148,244,173, 40, 23,158,231,221,215,131,226,226, 98, 56, 28,
+ 14,119, 11,116,215,131,227, 56,170,176,176,208, 18, 29, 21, 3,154,166, 69,185, 92,174,124,154,107,200,254, 83,169,168, 27, 96,
+158, 94,103,136,130, 51,226,111, 1,224, 20,156,209,211,101, 0, 93,140,166,196,204,170,236, 72, 16, 4, 80, 20,229,242,214,160,
+ 84, 42,209,170, 85, 43, 0, 78, 7,192,108, 54, 87,105, 30,251,113, 50,162,223,172, 43, 54,155,173,204, 74,120, 73,146, 16, 24,
+ 24, 72,208, 52, 45, 1, 32,104,154,150,130,131,131, 55,205, 26,185,162, 70,101,139,225,106,215,174, 29,175, 80, 40, 36, 0,132,
+ 76, 38,147,106,212,168,241,243,160, 30, 83,164,160,160, 32,200,229,114,247,243, 33, 33, 33, 27,102,141, 92, 81,179, 18, 61,201,
+213, 89, 46, 32, 32, 0, 52, 77, 67, 20, 69, 68, 68, 68, 0,112,158, 87, 87,218,213,211,166, 71, 70, 83,162, 52,117,104, 44, 0,
+ 32, 48, 48,208,109,232, 27, 52,104, 80, 38,242,175,204,248, 3,128,195,225,208,184, 82,245,174,150,204,165, 91, 51,215,170, 85,
+ 11,123,246,236,161,139,139,139,233,156,156, 28,229,218,181,107,223, 59,113,226, 68, 8,128,232,251,181, 68, 81,108, 25, 28, 28,
+140,148,148,148, 50, 41,255,251, 31,102,179, 25, 14,135, 3,161,161,161, 16, 69,177,153, 71, 7,125, 31, 86,171,181,140,225,119,
+253,238, 74, 55,122,249,147, 43,247, 18,165,252,226,183,160,242, 9, 5,112,222,253,188, 36, 73, 15,156, 47,187,168, 66,126, 49,
+133,167,101, 96,175,220, 75,148,138, 44,111, 65,161, 14,126,224,181,251,199,102,115,200, 80,100, 33,159,218,216, 0,128,231,121,
+ 41, 43, 43, 75, 42, 44, 44, 60,107, 54,155, 31,176,158,131, 6, 13,154,163,215,235,219,188,208,255, 53,250,224,166,127,229, 27,
+147,110,104,115, 77, 5, 79,181, 62,139,240,242,203, 64, 84, 20, 80,183, 46, 96,183, 67,186,121, 19,118,142,195,202, 25, 51,192,
+ 48, 76,153,140, 64, 69,198,221, 69, 69, 78,130,197, 98,129, 40,138,120,254,249,231, 71, 78,154, 52, 9, 47,190,248,226,175, 3,
+186,189,223,110,243,222,197,198,242,182,177,219,237,176, 88, 44, 48,153, 76,248,248,227, 74, 19,137,120,238,185,231, 72, 0, 50,
+ 84,208, 49,211,139,147, 10,115,198, 37, 78, 64,127, 0,231,224, 60,161, 54, 0,253,171,106,252, 1,103, 90,136,101, 89,124,250,
+233,167, 24, 60,120, 48, 2, 3, 3, 49,107,214, 44,247,252,117,233, 57,232,167,141,205,102,171,119,244,232, 81,154,162, 40,247,
+ 69,195,149,110,226,121, 30, 60,207, 99,193,130, 5,196,107,175,189,230,155,157,157,205, 0,168,240, 91, 32,138, 98,237, 13, 27,
+ 54, 16, 4, 65, 96,241,226,197, 4, 0,202,149,182,114,121,174,243,230,205, 35, 94,121,229, 21,255,202,244, 92,198, 90,146, 36,
+200,229,114, 28, 59,118, 12,131, 6, 13,114,191, 94,179,102, 77,132,133,133,161, 71,143, 30,232,221,187,119,149,142, 91, 20, 69,
+ 40, 20, 10,156, 60,121, 18,111,190,249, 38, 0,167,183, 29, 16, 16,128,250,245,235,163, 87,175, 94,232,217,179,103,101, 26, 44,
+ 73,146,112, 61,238,207, 0,184,156, 1,133, 66,129,128,128, 0, 76,159, 62,157,125,233,165,151,202,109, 51,109, 54,155, 81, 84,
+ 84,132,252,252,252, 50, 70,191,160,160, 0, 69, 69, 69, 48,155,157,235, 9, 75,210,136, 85, 58, 94, 23, 69, 69, 69, 15, 24,126,
+215,239, 94, 30,141,226,226,167,222,148,209, 99,254,138,177,241, 60, 47,230,229,229,221, 40, 42, 42, 58,113,237,218,181, 50,223,
+243, 15, 71,197,189, 41,147,201, 38,190,255,254,251,234,187,119,239,226,182,195,135,202,202,201,231,109, 14,254,204,211, 28, 99,
+ 69, 78,239,253, 25, 69, 79, 28, 0, 65, 16, 64,211, 52,120,190,236,210, 28,138,162,112,234,212, 41, 60,255,252,243,152, 54,109,
+ 26, 8,130,192,222,189,123,181, 61,122,244, 56,255,238,203, 31,105,203,139,216, 93, 14, 64, 81, 81, 17, 36, 73,130,201,100,194,
+154, 53,107,176,108,217, 50,156, 56,113, 2,237,219,183,199,192,129, 3, 49,113,226, 68, 0, 21, 59, 32, 94,202, 82,161,167, 89,
+ 50,231,191, 13,127,122, 83, 28,128,239,245, 58,195,131,238,118, 37, 72,146, 4,134, 97,160,215,235, 49,109,218, 52,236,220,185,
+ 19, 70,163,209,125,251, 90,233,168,243,175,128,162, 40, 88, 44, 22,220,187,119, 15, 25, 25, 25, 72, 77, 77,197,141, 27, 55,112,
+245,234, 85, 36, 39, 39, 59, 91,206, 86,161,173, 48, 73,146,176,219,237, 40, 44, 44, 68, 78, 78, 14,238,222,189,139,219,183,255,
+159,189,243, 14,139,226,250,250,248,119,102,123, 97, 97, 65, 16, 81, 80,192,184,182, 24,123,140, 81, 87, 20, 53,230,103,143,104,
+196, 26,243,198, 18, 19, 53, 68,141, 38,182, 88,162, 70,197,222, 91,212, 4,123,212, 88, 80,138,186,246, 2,104, 44,200, 42, 40,
+160, 72,149,165,110,153,217,153,121,255,128, 69, 36,148, 5, 75, 52,238,231,121,246, 97,247,206,236,119,207, 14, 48,231,220,123,
+207,189, 39, 17, 15, 31, 62, 68,108,108,108,145,195,180, 22,150,101, 33, 16, 8,160, 84, 42,159, 43, 71, 44, 18,137, 32, 18,137,
+ 32, 20, 10, 43,157,236,100,153,150, 41,203, 14, 43,237, 35, 30, 63,126,140, 85,171, 86, 33, 48, 48, 16, 41, 41, 41,207,229, 17,
+164,164,164, 96,206,156, 57,152, 49, 99, 6, 18, 19, 19,225,228,228, 4,154,166, 37,163,251,206,250, 71,240, 73,146,100, 84,116,
+116, 52, 24,134, 41,114,200,165, 57,127,160,160,228,114,106,106, 42, 72,146,188, 89, 82,167, 44, 88,150, 69, 86, 86, 86, 81, 82,
+ 97,102,102,102,209,115,203,195, 54, 2, 80, 62,229,229,153,240,120,188,231,126, 71,175,155,242,238, 29,255,150,109,249,249,249,
+ 55,158, 62,125,122, 35, 43, 43,235, 60, 10, 3,253,157, 75, 67,191,154, 62,106,117, 76,122,122,122, 80,155, 54,109,196,143, 30,
+ 61, 42, 88, 41,116, 33,130, 9,143, 77,165,174,197, 61, 58,250, 58,109, 36, 55,109, 2, 60, 60, 0,173, 22,120,242, 4, 80,169,
+ 0, 55, 55,240, 75,113,246, 86, 56, 87,237,233,211,167, 81,189,122,117, 56, 56, 56, 20,221,215, 93, 92, 92,144,146,146, 82,116,
+255, 15, 12, 12, 4,199,113,108,183,110,221, 40,138,162,202, 44,129,109, 9,244,141, 70, 99, 81, 0,103, 52, 26,177,110,221, 58,
+ 0, 64,171, 86,173, 64, 81, 20,182,110,221,138,156,156, 28, 24,141, 70,219,255,112, 37, 40,111, 21, 64,241,132,191, 59, 0, 62,
+ 3,176, 23, 64, 19, 20, 75, 12,180,246,131, 44, 1,128, 64, 32,192,144, 33, 67,208,173, 91, 55,120,122,122,254, 35, 1,176, 50,
+ 78,241,101, 99, 25,210, 44,237, 65, 81,212, 75,213,173,172, 30,203,178,224,243,249,104,217,178, 37,158, 60,121,130,154, 53,107,
+194,100, 50, 33, 59, 59,187,104, 4, 5, 0, 54,110,220, 88, 41, 93, 30,143, 7,181, 90,141,244,244,116, 56, 59, 59, 67, 44, 22,
+ 35, 43, 43,235,185,223, 69,241, 36,158, 82,236,226, 38, 78,156,136, 77,155, 54,129, 36, 73, 12, 31, 62, 28,217,217,207,242,156,
+156,156,156, 74, 59,198, 67, 41, 25,187, 20, 69, 29,191,122,245,106,207,206,157, 59,139, 45,115,253, 37,157, 63,143,199,131,147,
+147, 19,196, 98, 49, 98, 99, 99, 13, 12,195, 4, 91,243, 61, 45,193, 88,105,195,254,197,131, 13, 27,101, 18,123,237,218,181,186,
+ 62, 62, 62,184,127,255, 62, 18, 18, 18,192,208, 57,224, 17, 38, 16,132, 24,174,174,174, 80, 40, 20,184,112,225, 2, 0,188,238,
+205, 94, 98, 46, 93,186, 84,223,199,199, 7,177,177,177,136,143,143, 7,109,124, 10, 1,169, 7, 73, 74,224,230,230, 6,153, 76,
+134,243,231,207, 3, 64,204,235, 52, 44, 55, 55,247, 90, 90, 90, 90, 92,114,114,242,105,173, 78,195,109, 89,112,236,167,152,152,
+152,105,169,169,169, 50,142,227, 16, 24, 24, 40, 56,125,250,180, 62, 44, 44,204,156,149,149,117,156,101,217, 73, 90,157, 38,233,
+117,218,200, 85, 98, 36,205,138, 17,128,126,115,231,206,157,235,236,236, 60,112,240,224,193,100,203,150, 45,113,237,218, 53, 48,
+ 12, 3, 95, 95,223, 34,231, 31, 28, 28,252, 71,112,112,176, 31, 0,161,157,157,157,164,188,249,250,226, 35, 0, 0, 96, 50,153,
+176,114,229, 74,140, 25, 51,166,232,156,197,139, 23,131,101, 89, 24,141, 5, 50, 89, 89,175, 56,195,243, 63, 66,121, 83, 0, 65,
+ 40,112,254,183, 1,116,210,234, 52,233, 42,165,186, 51,128, 83,133,237, 71, 1,180,180,246,131,138, 7, 0, 66,161, 16,117,234,
+212,121,227,156,127,121, 80, 20, 85,169,200,242, 85,232, 89,134,212,249,124, 62,158, 62,125, 10, 39, 39,167,231,156,127,101,177,
+140, 42, 88,162,244,244,244,116,184,187,187, 87,234,119,241, 71,232, 82,225,164, 97, 75,194, 0,116,190,115,231, 14, 88,150,189,
+ 16, 20, 22,216,206,114,188,188, 99, 37,241,246,246,222, 25, 26, 26, 58,185, 65,131, 6, 13,101, 50, 25,146,146,146,144,155,155,
+ 91,148, 56, 36, 20, 10,225,230,230, 6,133, 66,129, 39, 79,158, 32, 62, 62,254, 17,203,178,155,202,179, 79,171,211,136, 1, 64,
+ 44, 22, 27, 1, 32, 34, 34,194,148,147,147, 35, 42, 25, 0, 76,159, 62,221,100, 54,155,109,251, 0,148, 77,207,190,125,251, 6,
+126,252,241,199,221, 23, 44, 88, 0, 5,119, 14,119,174, 45, 69, 19, 71, 14, 18,215,190,136,215, 57, 98,199,142, 29,120,250,244,
+105, 48,128,128, 10,213, 94, 34, 60, 30,175, 71,255,254,253, 23,183,110,221,186,239,194,133, 11, 33,163, 67,113, 55, 98, 37, 26,
+ 43, 57, 72,170,247, 70,220, 83, 5,182,110,221,138,204,204,204,131, 60, 30,111,242,235,180, 45, 55, 55,247,210,159,127,254,121,
+ 65,171,211, 36,255,246,235,137,254, 9, 9, 9,211, 62,252,240, 67,153, 82,169, 68,112,112, 48,110,220,184, 65,196,199,199,231,
+211, 52,221, 75,171,211, 92,126,157,182, 21, 98, 54,252,223,255,137,132,163, 70,129,242,240, 0,244,122,224,225, 67, 64, 36, 2,
+243,211, 79, 69, 67,196, 4, 65, 64, 40, 20,194,100, 50,129,227, 56, 54, 61, 61,189,212, 93, 65,131,194, 2,227, 0,248, 15,237,
+ 54,121,246,178,101,203,166, 19, 4, 49, 52, 36, 36,164,104,116,198,226,252,189,188,188,134,207,219,248,205, 16,107, 12, 52, 24,
+ 12,224, 56,174, 40, 0, 48, 26,141,240,246,246,198,202,149, 43, 49,126,252,120,252,242,203, 47,104,218,180, 41, 76, 38,211, 63,
+166, 29,108,148, 79,121, 1, 64, 10, 10,150,168,249,105,117,154,116, 0,208,234, 52, 25, 42,165,186, 19,128,125, 0, 42, 53,161,
+118, 63,106, 19,118, 30,122,100,149,211,179, 50,147,253,165, 82,145, 93,149,157,111,174, 72,175,178,127,168, 28,199, 61,151,237,
+207,231,243,145,159,159,255,194, 65, 83,241,169, 23,177, 88, 92, 37,205, 39, 79,158,140, 30, 51,102,204, 6,163,209,200,207,203,
+203, 27,109,237,177,146,204,219,248, 13, 51,184,203,247,253,182,109,219,118,113,192,128, 1,142, 13, 26, 52,192,189,123,247, 0,
+ 20,124,127, 55, 55, 55, 56, 58, 58, 34, 33, 33, 1, 87,175, 94,125,106, 54,155,251, 87,118, 15, 0,157, 78, 87,234, 8,128,109,
+216,176,124, 78,223,217, 21, 3,224,211, 78,141,253, 59,125,250, 73,219,165, 19, 62, 75,107, 58,122,208, 40, 0,192,250, 93, 27,
+177,251,192,185, 27,121,122,254,247,167,110, 7,157,122,221,182,133,221,252, 61, 14, 64, 63,159, 70,131,218,246,233,169, 94, 62,
+254,179,180, 86, 99, 7, 23,244, 14,215,253,177, 30,251, 15, 92,186,150,147,207,155,120,250,206,174,139,175,219,182,216,216,216,
+115, 90,157, 38,245,183, 95, 79,212,123,240,224,193,182,134, 13, 27,202,170, 85,171,134,163, 71,143,226,200,145, 35, 64,193,125,
+116,212,191,228,252, 1, 96,209, 23, 95,124, 49,123,244,232,209,100,251,126,253, 64, 93,186,244,143,132, 36,177, 88, 12,137, 68,
+130,164,164, 36,196,196,196,112, 44,203, 46,250,243,252,218,114,135, 48,119,158, 92,124, 15,192, 48,127,223,128,129, 2,129, 0,
+246,246,246,188,164,164, 36,222,201,147, 39, 1, 96,148,181,187,138,242,120,188, 99,251,247,239,239, 82,163, 70, 13,105,251,246,
+237,193,113, 92,209, 48,191,167,167,167,229, 26,194,104, 52,130,166,105, 76,158, 60,153, 49,155,205, 79,247,158, 89,105, 27, 2,
+176,130,242, 86, 1, 12, 45,163, 61, 3,128, 79,101, 62, 68, 32, 16,100,118,106,205,115, 76,212,169,173, 58, 63, 33, 33, 33,229,
+204,153, 51, 85, 31,115,175, 2,150, 53,245, 22,135, 40, 18,137, 32, 22,139, 97, 50,153, 96, 48, 24,144,159,159, 95,180,130,193,
+ 90, 61, 62,159, 15,177, 88, 12, 30,143, 87,180,140, 70, 40, 20,194,104, 52, 66,175,215, 87, 74,143,166,233,127, 76, 35,188,104,
+178,139, 37, 7,160,248,174,127, 85, 9, 40, 10,163,126,223,202, 30, 43,141, 63, 66,151,106, 7,119,249, 94,189,101,203,150, 3,
+ 77,155, 54,245,240,240,240, 16,187,185,185,193,100, 50, 33, 61, 61, 29, 49, 49, 49,134,248,248,248, 36,138,162,250,239, 62,181,
+220,170, 93, 0,129,103, 35, 1,133,251, 2,148,134,131,173,231, 95, 49,167,110, 7,157, 58,187, 64,221,147, 6, 18, 73,146, 36,
+ 0,128, 0,199, 77,234,155,218,179,195, 52,205,227,127,211,182,211,119,118, 93, 60,191, 64,221,199,196,225, 49, 44, 5,174, 56,
+142,155,220, 55,181, 79,187,105,154,215,186,235,159, 5,173, 78,147,186,109, 81,112,139,216,216,216,211, 73, 73, 73,178,123,247,
+238, 65,171,213, 66,175,215,155, 80,176,118,125, 13,128,195,255,134,109, 0, 16, 20, 22, 56,247,243, 78, 19,255,154, 61,123,246,
+ 2, 47, 47,175,238, 95,173, 93,139, 22, 35, 70,192,124,235, 22, 20, 3, 6, 64,170, 84, 66,167,211,225,218,181,107,200,203,203,
+ 11, 5, 48, 53, 40, 44, 48,170, 18, 31,193, 1, 64,118,118,182, 37, 65,137,178,179,179,179,250,198, 39,145, 72,250,235,116,186,
+144,244,244,116,159,155, 55,111, 98,215,174, 93,229,158, 79, 81,212,211,148,148, 20,239, 74,216,247, 78,243,186,106, 1,120,139,
+197,226,112,163,209, 88,187,162,115,165, 82,233, 35,138,162,218,238, 56,241,235,107,187,153,140,236,241,227, 99,179,217,236, 90,
+220,249, 21,223,125, 10, 40, 24, 46, 39, 73, 50, 71, 34,145, 84, 88,104,231,101,235,253,244,213,170,123, 52, 77,151, 91,176,199,
+130, 64, 32, 72, 37, 8,162,118, 69, 17,246,244, 81,171,253, 77, 38,147,220, 26,205,255, 88, 49,160, 44, 20, 36,181,150,196, 94,
+171,211, 84,109, 89,193, 59, 70, 61, 7, 53,177,126, 26,150,241,120,188,241, 0,192, 48,204,202, 49, 11,240,202,215,253, 91,107,
+ 91,241,250, 0,175,107,223,255,242,152, 58,114,249,233, 71,143, 30,125, 24, 23, 23,151,162,211,233, 30,162, 32, 15,225, 30,128,
+227, 90,157,198,234,250, 34,175,154, 33, 93, 39,169, 89,150, 93,212,163, 70,141, 15, 71, 8, 4, 88, 85,171, 22,110,197,196, 32,
+ 51, 51, 51,146, 36,201,169,191,135, 44, 9,171,138,174,191,111, 64, 81,253,141,138,230,251,109,188, 94, 94, 75, 0,240,166, 51,
+125,212,106, 94,225,114,188,138,176,170,212,238,203,214,179, 97,227, 77,163, 48, 8,168, 13, 0, 99, 22, 32,225, 77,112,254, 22,
+ 74, 86, 8,252,183,109, 27,221,119, 22,255,109,250, 63, 31,212,249,187,126, 4, 65,252, 8,128,228, 56,110, 97, 84, 84,212,190,
+127,187, 74,161,141, 87,131, 45, 0,176, 97,195,134, 13, 27, 54,222, 65,254,189,180,123, 27, 54,108,216,176, 97,195,198,191,134,
+ 45, 0,176, 97,195,134, 13, 27, 54,222, 65,108, 1,128, 13, 27, 54,108,216,176,241, 14, 98, 11, 0,108,216,176, 97,195,134,141,
+119, 16,235, 11,200,219,176, 97,195,198, 11, 80,207,161,195, 11,117, 56,238,101,157,125,109,203, 80,109,216,120, 23,176, 5, 0,
+111, 9,211,253,212,183, 0, 52,155,183, 79, 83,234,114,162,138,142, 91, 80, 41,213,246, 0, 20, 90,157,230, 81, 69,159, 89, 88,
+244, 73,166,213,105,226, 94,162,158,221,155,180,246,249,191,198, 7, 53,186, 61, 53, 26,141,142,101, 29, 39, 8,130, 19, 10,133,
+102,145, 72,148, 47, 18,137,140,124, 62,159,207, 48, 76, 90, 90, 90, 90,139,146, 27, 33,169,148,106, 17,128,100, 0,202,114, 62,
+146, 5,160, 7,144, 1, 32, 27, 5,163,138, 73, 0,122,104,117,154,127,236, 69,225,213,214,233, 10,143,199,115, 47,178,167,216,
+ 49, 14, 0,195, 48,143, 30, 92,124,250,161, 21, 95,245,141,167,169,219, 39, 9, 6,131,193,163,100,187, 64, 32,160,149, 74,229,
+211,106,213,170,101, 86,175, 94, 61, 83, 40, 20,222, 76, 79, 79, 63, 21, 21, 21,117,185,170,117, 0,252,125, 3, 72,137, 68,178,
+156, 97,152, 47, 69, 34,209,227,220,220,220, 97, 65, 97,129, 87, 42,163,241, 85,239, 25,179, 69, 34,209, 20,134, 97,214,174, 59,
+ 48,107, 82, 85,236,176,241,118,241, 86, 6, 0, 67,186, 78,114,101, 89, 54, 20, 64,227,114, 78,187, 77,146,100,151,223, 67,150,
+ 88, 93,176,232, 13,231, 61,148, 82, 64,167, 18,199, 45,136, 0,204, 87, 41,213,191,105,117,154, 50,183,109, 85, 41,213, 45, 0,
+ 12, 5,176,184, 2, 61, 1,128,121, 42,165,122,187, 21,122, 67, 0,252, 90,129, 94,185, 52,171,217, 61, 65,175,215,123, 0,128,
+ 88, 44, 78, 55, 26,141,110, 90, 93,249, 65,207,187, 4, 77,211, 14,166, 27, 55, 64, 42,149, 96, 51, 50, 64,213,173, 11,115, 97,
+ 41,106,222,250,245, 96,244,122,194, 76,211, 2,195,168, 81, 18, 51,192,164,165,165,153, 71,143, 30, 45, 78, 75, 75, 43,237, 94,
+192, 7, 96,151,147,147,243,212,206,206, 78, 0, 32, 35, 57, 57,153, 52, 24, 12, 57, 94, 94, 94,127, 3,200, 8, 15, 15,119,205,
+201,201,209,245,237,219, 55,220,100, 50, 61, 17,139,197, 18, 0,223,163, 32, 16,248, 71, 0,192,227,241,220,207,239,191, 85, 93,
+ 42,149,194, 82, 34,219,242, 51, 47, 47, 15,221, 71,124, 4, 29,149, 2,165,176,210, 5, 71,223, 56, 40,138,114, 51, 94,189, 10,
+152,205, 48,199,199, 67,239,227, 3,170,160, 36,184, 64,216,187,183,171,137,227, 92,153,220,220,216,252,197,139,199, 74,154,146,
+183, 1,160, 79,163,238,254, 14,118,242, 25,191, 93,222,215,160, 50,159, 69, 16,196, 48,119,119,247,145, 75,150, 44,145, 70, 68,
+ 68,212, 91,186,116,233, 46, 0, 94,149,209,120,239,189,247,166,205,156, 57, 83, 56,120,240,224,255, 27,221,119,214,212,210,246,
+ 46,232, 85,255,127,157,170, 57,218,125,178,245,226,238, 41,149,209,182,241,102, 82,106, 0,208,192,201,135, 98, 89, 86,128,194,
+194, 40, 21,189,126,173, 22, 3, 96, 89, 54,116,218,180,105,141, 45, 53,167,205,102, 51, 24,134,129,217,108, 46,122,110, 52, 26,
+ 27,239,216,177, 35, 20, 5,133,139,222, 90,166,251,169,111,226,217,119, 48, 76,247, 43,119, 59,101,195,116, 63,117,236,188,125,
+154,247,202, 58, 65,171,211,164,169,148,234, 45, 0,246,171,148,234,129,165, 57,109,149, 82,221, 14,192, 65, 0,125, 42,234,145,
+ 20,214,135, 88, 15,224, 80, 19,215,174, 48,153, 76, 46,192,243,206,185, 80,239, 0,128,158, 90,157, 38,185, 60,189, 98, 54, 24,
+ 35, 34, 34,208,182,109, 91, 92,188,120, 17,109,219,182,197,153, 51,103, 68, 28,199,153, 13, 6, 3,196, 98, 49, 4, 2,129, 35,
+172, 11,122,254, 65, 3, 39,159,239, 8,130,248,150, 97,152, 70, 90,157,198, 80,216,246, 13,143,199,155, 68,211,116, 19,173, 78,
+147, 83,142,109,124, 30,143,167,229, 56,110,237,221,167,167,151, 90,218, 27, 86,235,116,159, 32,136,173,102,179,121,225,191,184,
+113, 10, 75,218,217,145, 79,222,123, 15, 28, 69, 33,231,218, 53, 64, 36, 2, 0,200,214,175, 7,167, 80,128, 83, 42,153,204, 62,
+125,140, 52,199,153,237,236,236, 30,203,229,242, 76,148,126, 13, 25, 0,140,157,157,157,128, 32,136,201, 0, 24,173, 78,179, 69,
+229,166,230, 1, 24, 0,192,164,213,105,254, 84, 41,251,145, 40,216,238, 89,172,213,105, 78,171,148,234, 30, 40,220, 2,182, 52,
+164, 82, 41,158, 60,121, 82, 84, 17,211,108, 54, 35, 55, 55, 23, 53,106,212, 0, 0, 92,207, 8, 33,219,187, 14,100, 5,164,232,
+229, 93,149,127,145,148,182,109, 1,224,249,223, 5,203,114,172, 72,116,151,120,242,228,192, 7, 62, 62,209,247,116, 26,244,172,
+223, 77,237,232,160,220,185,240,167,113,149,158,234,144,203,229, 67,251,245,235, 39,171, 86,173, 26,218,181,107,135, 95,126,249,
+165,150,191,111,128, 60, 40, 44, 48,207,154,247,143,248,116,170,163,157,157,157,153, 36, 73, 97,147, 38, 77, 4, 55,111,222, 76,
+ 29,211,111,246,150,245,127,206, 46,114,244,189, 84,159, 54,169, 81,221,121,255,207,147,191, 76, 6, 96, 11, 0,254, 3,148, 26,
+ 0, 16,207,170,241, 52, 83, 41,213, 87,120, 60, 94,185,175, 95,231, 22,177,133, 52, 78, 74, 74, 66,112,112,217,149, 96, 61, 61,
+ 61,129,242, 71, 8,222, 10,230,237,211, 52, 1,128,233,126,106,227,222,221,154, 76, 16, 36, 9,115, 54, 13, 58,155, 6,173,163,
+ 65,103,209,160,117,244,224,128,101, 13,104,134,117,152,183,175,226,128, 76,171,211,104, 84, 74,245, 64, 0,123, 74, 6, 1,197,
+156,255, 80,173, 78,115,193, 26, 27,181, 58,205, 37,149, 82,253, 25, 69, 81,103, 45,206, 89, 42,149, 58, 3,160, 85, 74, 53, 68,
+ 34,145,217,100, 50,125,170,213,105,174, 90,251,189, 35, 34, 34, 0,192,209,100, 50, 25, 1,112,150, 98, 76,212,139,212,101, 6,
+160, 82,170, 29,132, 66,225,110, 71, 71,199,118,153,153,153, 34, 0, 34,149, 82, 45, 16, 10,133,127, 40,149, 74,159,236,236,108,
+ 33, 0, 41,128, 50, 3, 0, 0,124,150,101,235, 40,149,202, 57, 77, 92,187,118, 53,153, 76, 3,181, 58, 77, 22,195, 48,117, 93,
+ 92, 92,166,103,103,103,119, 85, 41,213,159,105,117,154,204, 23,177,181,170,176,153,101,124,108,181,106,224,228,114, 51,103,111,
+ 79,153,205,102, 3,197, 48, 70, 0, 57, 98,177, 56, 23,229, 56,108, 0,233,133, 63,139,247,232,105, 60, 31, 52,152, 11,219, 0,
+ 64, 87,158,125, 12,195,128,162, 40, 80, 20, 5,150,101,145,150,150,134,156,156, 28, 40,149, 5, 51, 13, 52, 75,225,182,238, 44,
+209, 72,217,158, 19,146,165,237,218,252,246,192, 60, 42,117,102, 44,155,149, 74, 99, 17, 27,187,159,203,204,188, 76, 0, 92,221,
+ 6,255,171, 47, 22,138, 66, 55,172, 93, 6, 33,107,226,149,246,166,242,200,205,205,221, 19, 28, 28,220,194,215,215,215,158, 36,
+ 73,116,235,214,205,124,242,228,201,140,175,122,207,120,156,159,159, 63, 48, 40, 44, 48,178,172,247,142,248,116,170,163, 72, 36,
+186,188,114,229, 74,177, 84, 42,197,240,225,195,165,201,201,201,210, 5, 11, 22,124,139, 66, 71,223,175,209, 39, 30, 50,169, 52,
+120,221,218,101, 44,171,215, 57, 87,214, 62, 27,111, 38,111,229, 20, 0, 0,124,252,241,199, 41,181,107,215,206, 17,137, 68, 16,
+137, 68, 16, 10,133,176, 60, 47, 44,228, 67,244,235,215,175,204,158,240,219, 8, 7, 22,196,229,174, 17, 96, 77,207,223,172,107,
+ 13,115,169,172,150, 86,167, 57, 85, 24, 4, 28, 87, 41,139, 70, 21, 82, 81,224,252,134,106,117,154, 19,149,212, 59,223,176, 90,
+ 39, 6,133,127, 83,150, 26,222,133, 61,117, 2,192,185,202,232,181,108,217, 18, 45, 90,180, 64, 80, 88,224,115,193,165, 72, 36,
+122, 34,145, 72, 44, 83, 0,153,230, 74, 84, 68, 82, 41,213,173, 68, 34,209,145,249,243,231, 59,118,234,212, 73,240,225,135, 31,
+154, 88,150,109, 46, 18,137,126,159, 55,111, 94,181,174, 93,187, 10,218,180,105, 99,176, 70, 82, 32, 16,112,193,193,193,210,137,
+ 19, 39,170,163,162,162,180, 42,165,186, 39,159,207, 71,112,112,176, 52, 32, 32,160,237,229,203,151,181, 42,165,186,151, 86,167,
+185, 84,153,239,253, 18, 32,141,245,234, 33, 39, 50, 18, 28,199,193,238,163,143,192,217,217,129,115,114, 66,254,142, 29,185, 6,
+179,217, 76, 81,148,177,218,222,189, 20,167, 80,228,166,240,120,181, 40,147, 73,132,210, 87, 4,241, 0,240,146,147,147, 9,173,
+ 78,179, 81,165, 84,243, 84, 74,245, 32, 20,244,252,247, 3,128, 74,169,238, 10,192, 92,248,247, 68,170,148,234,150, 40,248, 27,
+ 42, 51,160, 96, 24, 6, 28,199, 21, 57,255,180,180, 52,220,143,143,193,254,240,237,160,204,148,243,232,254,147,146,132, 66,209,
+ 13, 3,149,247,211,205,179,113, 81,111,243,116, 64,238,199, 31, 35,231,230, 77, 0,128, 93,251,246, 96,106,213,162, 56,177,248,
+174, 96,248,240,206,166,161, 31,232, 1,160, 73,125,181, 11, 13, 46, 98,205,146,185,164, 76, 44, 36, 47, 31, 63,204,181,106, 57,
+166, 92,221,226,248,251, 6,120,136, 68,162, 57,223,126,251,173, 29, 0,228,231,231, 99,212,168, 81,146,129, 3, 7, 34, 34, 34,
+194,123,243,230,205,123, 1,252,163, 64,206,200, 30, 63, 78,227, 56,110, 50,195, 48,178, 53,107,214,240,107,212,168, 65,174, 88,
+177,194,124,236,216, 49, 51,199,113, 60,145, 72,180, 10, 0,250,127,208, 75, 9,142,127, 98,253,202, 95,193, 99,105,167,171,103,
+ 66, 18,218,180, 30,251, 18,174,142,141,127,155, 82, 3, 0,174, 68,109,212,138, 94,255, 75,176, 98,177,248, 57,199, 47, 22,139,
+ 33, 18,137, 32, 16, 8, 32, 20, 10,223, 4, 27, 95, 46,230, 28,186,212,251, 42,245,180,244,246, 10, 40,188,105,139, 12, 6, 3,
+ 0,160,208,177,118,175,172,243,183, 80,220, 57,243,120,149,238,196, 60, 71, 68, 68, 4, 40,138,226,158,117, 42, 11,184,158, 20,
+ 92, 27, 0,158,222, 21,112, 27, 55,110,172, 55,109,217, 23, 86, 5, 0,141, 93,124, 39, 86,171, 86,109,254,201,147, 39,165, 94,
+ 94, 94,184,114,229, 10, 8,130, 32,156,156,156,142,133,134,134,138,189,189,189,113,227,198, 13,171, 75, 81,243,249,124,180,108,
+217, 18,227,199,143, 23, 93,189,122,213,101,221,186,117,103, 0,160,105,211,166,152, 56,113,162, 48, 34, 34,162, 90, 96, 96, 96,
+248,251,213,187,204,161, 40,106,209,235,156, 18, 40, 30,192,176, 78, 78,128, 66, 1,214,193,193, 12, 32,135,162, 40,130,162, 40,
+ 19,227,224,144, 71, 42,149, 58, 61, 77,203, 73, 30, 79,143,114,254,128,244,122,125, 46, 36,207,228, 81,118,207, 31,133,207,117,
+101,233, 17, 64,209,188,191,197,249,135, 92, 56,130,244,188, 39,216,188, 56, 8,181,106,120,144, 0, 92, 30, 39, 39,118,253,226,
+251, 1,109, 90,119,110,188, 40, 90,147,180,240,109,157, 14, 40, 94,246,155,241,242,210,115,192, 53, 94,100,228, 31,191, 69, 70,
+ 26, 7, 13, 45,216,134,189,121,183, 33,119, 27,185, 73,165,181,189, 85,196,133,195,127,224, 65,236, 19,180,178, 82,223,223, 55,
+192, 93, 36, 18, 93, 94,189,122,181,115,253,250,245,201,132,132, 4, 92,190,124, 25,109,218,180, 1,159,207, 71,221,186,117, 97,
+ 50,153,106,150,246, 94,150,101,167, 6, 5, 5, 41,178,179,179, 33,147,201,176,120,241, 98,243,169, 83,167,146, 89,150,109,109,
+201,157,218,181,226, 52,217, 66,221, 51,184, 77,189,106,181,156, 93, 93,237,206, 30,252, 29, 15,226,146,184, 54, 47,120, 93,108,
+188, 25,148, 26, 0,220,125,122, 90,168, 82,170,155,163, 48, 73,183,162,215,255, 6, 60, 30,143, 43,236, 93,254,195,249, 91, 94,
+255,231,160,179, 74, 31,254,166, 50,170, 84, 25,207, 66,241,107, 85, 85,231, 15, 20, 56,103, 75,146,158, 80, 40,132, 68, 34,177,
+232, 87,170,167, 14, 20,140, 0,212,170, 85, 11,225,183,254, 40,245,120,219,182,109, 77, 0,140,211,150,125, 81,177,150, 71,143,
+ 29, 53,106,212,232, 27, 25, 25, 41,165,105, 26,209,209,209,176,179,179, 67, 64, 64, 0,111,210,164, 73, 66,150,101,241,224,193,
+ 3, 40, 20, 10,171, 3, 0,203,121,110,110,110,232,219,183, 47,218,180,105, 35,137,140,140,100, 0,240,220,220,220,208,187,119,
+111,124,244,209, 71,146,128,128,128,233,105,105,105, 45, 1,244,183,242,171,191, 40,172,217,108,126,214,155,119,116, 4,107,103,
+ 71,211, 10, 5,155,157,147, 67, 40, 28, 29, 31, 17, 4,145,157, 74, 16,181,245, 52,109, 87,187, 89,179,107,238, 55,110, 60, 70,
+ 57, 57, 0,158,158,158,127,243,120,117,253, 81,208,243,223, 87,216,211,239, 86,248,186,120,207,159,210,234, 52,127,171,148,234,
+ 82, 29, 14, 80,148,233,143,172,172, 44,100,101,101,225,222,195,104,164,231, 61, 65, 72,208, 69, 48, 12, 3, 75, 48, 90,211,213,
+ 29, 97,187,174, 40, 58, 13,104, 53,181, 78,107,101,120, 82,132,254,218, 75,188, 70,175, 5,185, 92,158, 77,211,180, 83,225,203,
+235, 28, 65,164, 16, 81, 81,123, 25,224,230,160,194,105,211, 5,223,109, 11,113,175,237,169, 28, 54,110, 44,113,116,245, 79,220,
+195,187,177, 68,198,211,220, 50, 53,253,125, 3,248, 36, 73,126, 37,145, 72,134,233,245,250,189, 34,145,104,210,170, 85,171,170,
+171, 84, 42, 50, 46, 46, 14, 20, 69, 33, 46, 46,142, 61,119,238,156,190, 89,179,102,242,211,167, 79,231, 11, 4,130, 82,107,232,
+146, 36,121,104,200,144, 33, 3, 91,183,110,205, 53,109,218, 84, 28, 18, 18, 98,230, 56,174,117,241,196,233,248,248,248, 69, 31,
+ 52,111,209,168, 71,223,222,228,201,245,179,116,177, 49,241, 74, 93, 86,158, 85,209,125,167,198,254, 62, 66,161,112,179,209,104,
+ 28,113, 38,122,119,165, 70, 0,109,188, 30,202,156, 2,208,234, 52, 81,149,121,253,186, 33, 73,146, 43,107,248,223,210,246,159,
+131,206, 42,221,209, 83,233,244, 11, 12,202, 60, 38, 8,194, 21, 5, 55,251,244,138, 78,174, 8,147,201,228, 86,108,232,159, 49,
+155,205,242,191,147, 79, 86, 58, 81,244,226,197,139,162,157, 59,119,138, 1, 24, 74, 59, 30, 17, 17,129,220,220,178,111,148,197,
+ 97, 89,246,113, 94, 94, 30,113,241,226, 69, 52,104,208, 0,213,171, 87, 7, 73,146,200,205,205,165, 47, 93,186,196,107,214,172,
+ 89, 81, 91,241, 18,206, 21, 65, 16, 4,220,220,220, 64, 16,132,101, 30,219, 76, 16, 4,207,210,150,153,153,137,236,236,108,130,
+101,217, 10,151, 72,190, 44, 72,146,100,133,219,182, 65,190,118, 45, 24,133, 2,249,219,183,235, 32, 16,228,100,101,110,193,192,
+ 59, 0, 0, 32, 0, 73, 68, 65, 84,101,241, 37, 65, 65, 66, 65,181,106, 98,206,209,209,144,209,176, 97,186,193,104, 52,185,187,
+184,164,201,100,178, 50,123,236, 0, 40, 20,252, 93,208,120,190,167, 95,218, 72,128,229,117,121,122,200,207,207,135,155,155, 27,
+148, 74, 37, 14,156,218,129,205,139,131,192, 48, 12,114,114,158,165, 93,164,167,167, 67, 38,147, 97,222,247,203,236,190,156,234,
+ 55, 7, 64,247, 74, 95,140,127, 25, 71, 71,199, 12,209,196,137, 78, 76, 98,162, 14, 44,251,232,250,205,155,253, 62, 40,182, 52,
+114,222,248,205,107, 24,134,241,157, 58,117, 42,145,154,154,138,124,251,247,136,212,140,171, 48, 80, 76,153,255,135, 34,145,104,
+ 81,223,190,125,199,245,239,223, 95,164,209,104,154,234,116, 58, 94,157, 58,117,200,232,232,104,152,205,102,132,133,133, 49,225,
+225,225,169,102,179,121,229,189,123,247, 62,210,235,245, 7, 1,148, 26, 69,111, 61,250,203,240, 65,157,191, 91,122,225,194,133,
+107, 78, 78, 78,224, 56,142, 44,238,252,167,143, 90, 61,218,222,222,254,171,175,191,254, 90,158,144,144,128, 84, 97, 77,126,134,
+238,186,209,104,162, 47, 86,244,221, 59,191, 63,184,163, 76, 38, 59, 50,125,250,116,217,236,217,179,143,119,108,248,249,255,206,
+ 68,239, 62, 91,201, 75,104,227, 21,243, 90,114, 0, 94,197,170, 2,129, 64,192,150,116,250, 37,131,129,255, 28,116, 22, 13,174,
+148,124, 75, 83,234,139,140, 0,120,162,224,198,110,135, 42,100,211,191, 10, 10, 71, 17, 0, 32,115,219,182,109,165, 46,245,107,
+217,178, 37, 0,192,154,106,150, 81,143,143,255,168, 82,170, 47, 13, 26, 52,232,247, 41, 83,166, 72, 39, 77,154,196,231,241,120,
+216,178,101, 11,177,101,203,150,188, 41, 83,166,136,102,206,156, 41,168, 76, 0, 64, 16, 4, 8,130,128,171,171, 43, 86,174, 92,
+201,204,155, 55,207,192,113,156,124,221,186,117,168, 81,163, 6,214,172, 89,195, 76,155, 54,205, 96, 50,153,190,136,206, 56,181,
+191,210, 23,161,138, 8,133, 66,134,161,105,176, 14, 14, 28,107,111, 79,231,235,245, 12,197,178,124, 7, 7,135, 4,161,139,139,
+ 36,137,227,196,249, 20,165,120,175, 94,189,243,124, 62, 63, 43, 60, 60,188,126, 92, 92,156, 43, 74, 95,182,199, 3, 64,133,135,
+135, 87, 47,214,243,255, 4, 5, 61,255,112,160, 32,175, 2, 0,173,213,105,110,168,148,106, 66,165, 84,123,161,176,246,123,105,
+ 48, 12,243,232,211, 47,218, 22,189,166,104,202,185, 86, 13, 15,210,210,243, 7,128,236,236,108, 36, 36, 36,128,166,105, 84,171,
+ 86, 13,148,137,106,250,210, 46,208,107,164,122,245,234, 25, 52,224, 68,208,116, 24,238,220, 57,228, 7,176,247, 0,108, 91, 20,
+188, 55, 54, 54,182, 95, 74, 74, 10,207,199,199, 7,143, 31, 63,198,153, 51,103,176,235,207, 35, 72,140, 77,226,236, 72, 42,164,
+ 44, 77,129, 64,240,229,119,223,125, 39,138,139,139,195,231,159,127, 46,142,137,137, 65, 84, 84, 65, 95,236,236,217,179, 76,120,
+120,120,170,201,100,106, 21, 20, 22,248,196, 26, 27,119,133, 47,187,249,197,255,166,237, 61,126,252,120, 43,129, 64,112, 0, 0,
+ 22,124,183,109,106, 74, 74,202,120,163,209,232,250,241,199, 31,211,113,113,113, 56,125,250, 52,254, 10, 57, 77,165,196, 39, 83,
+ 98,206,248, 87,121,154, 29, 27,126,222, 65, 46,151, 31, 61,118,236,152, 76, 38,147,193,104, 52,202, 23, 46, 92,120, 92,221, 96,
+224,255, 52,119,247,216,202,207,190, 65,188,150, 0,224, 85,172, 42,176, 76, 1,148,230,248,255,147,189,127, 0,160, 51,105,212,
+ 28,236, 12, 42,131, 46,120,164,211, 48,165,210, 96,242,171,188, 10,163,112,153, 30, 94,214,114,206, 23, 73,210,179, 80, 98, 20,
+161,212,165,126,149, 25, 1, 0, 0,173, 78,115, 68,165, 84,191,191,116,233,210, 35,103,206,156,241,222,179,103,143, 12, 0,140,
+ 70, 99,235,229,203,151,239, 8, 15, 15,111,176,111,223, 62,153,181,122, 52, 77, 35, 47, 47, 15,125,251,246,213, 95,185,114,229,
+129,193, 96,232,193,227,241,226,245,122, 61,252,252,252,244,231,207,159, 79,208,235,245,255,211,234, 52, 15,173, 54,242, 37, 32,
+ 22,139, 41, 51, 69,137, 25,165,146,134,157,157,137,166,105, 3,197, 48, 38, 0,217,172,163,163, 65,111, 52,218,229,200,100,122,
+142,227,178, 1,100,231,229,229, 25, 0,148,181, 10,128, 3,144,159,157,157,157, 5, 20,229,153,150,204,254, 47,109, 53, 64,102,
+ 25,122,120,112,241,233,135, 58, 42, 5, 81, 25, 33,164,153,165, 48,186,255,164, 36, 20, 19,207,202,202, 66, 98, 98, 34,226,227,
+227, 11,196,205, 52, 56,238,223,155,106,124, 17, 36, 18,201, 29,234,193, 3, 45,239,206,157, 99, 28,112,243,158, 78,195,109,152,
+123,248,100,116,116,116,151,236,236,108,130,207,231, 99,231,206,157,184,114,229, 10, 46, 94,188,200, 49, 12,147, 0,160,255,169,
+ 39, 39,202,204,216,103, 24,230,225,249,243,231,155,102,101,101, 33, 62, 62, 30, 44,203,226,254,253,251,120,248,240, 33,123,229,
+202,149,148, 66,231,111,213, 82, 91, 11,219,142, 45, 24,106,121, 62,247,219, 77, 75, 30, 61,122, 52,198,108, 54,203, 8,130,192,
+154, 53,107, 4,161,161,161,185, 23, 46, 92, 32,114,114,114,118,177, 44, 59, 93,171,211,164,149,165,213,177,225,231,237,229,114,
+249,241, 99,199,142,201,228,114, 57,238,223,191,143,230,205,155, 99,209,162, 69,178,105,211,166, 29,235,212,216,191,231,169,219,
+ 65,167, 43, 99,159,141, 87,199,219,186, 10,224,246,153, 51,103,220,124,125,125, 77, 37, 71, 0, 4, 2, 1, 0, 96,219,182,109,
+ 74, 0,183,255, 93, 51, 95,156,226,251, 0, 12,156,184,162, 69, 5,167, 87,184, 15,192,171,230,122, 82,112,109,149, 82,109, 4,
+224, 80,149,161,255,210,136,140,140, 52,180,170,237,131, 83,167, 78,153,138,239, 11, 64, 81,148, 85, 35, 0, 22,180, 58, 77,162,
+ 74,169,110,113,237,218,181,197, 13, 26, 52, 24, 69,211,180, 8, 64,114, 78, 78, 78,155,168,168,168,121, 13, 27, 54,156,160,215,
+235, 5,214,104,209, 52, 77,122,121,121,233, 13, 6,195,150,188,188,188,239,181, 58, 13,173, 82,170,225,237,237,173,207,203,203,
+219,158,151,151, 55, 81,171,211,188,208,146,197,170, 32, 22,139,159,230,143, 24,129,140,238,221, 41,138,162,140,213,255,252,211,
+ 4,133, 34,231, 49, 65,212, 73,175, 95, 63,163, 97,163, 70,231, 73,146,204, 14, 13, 13,109,152,151,151,103,234,209,163, 71,112,
+147, 38, 77,238,174,255,115,118, 89, 57, 0,241,125,250,244, 9, 19, 8, 4, 69, 61,255,194,145,128, 86, 40,152,243, 47,222,243,
+167, 11,175,113, 90,121,191, 23,165,208, 21,237, 93, 7,176,119,116,231, 8, 62,159, 31,245, 56, 57,241,147,154,174,238, 72, 77,
+ 77, 69, 66, 66, 2, 18, 18, 18,144,152,152,136,122,245,234,225, 65,124, 44, 68, 98,209,245, 87,115,181, 94, 45,105,105,105,225,
+245,238,220,217,103, 73, 0, 93,247,243,193, 5,247,239,223,239,210,177, 99, 71,162, 90,181,106, 56,122,244, 40, 46, 94,188,136,
+196,196, 68, 78, 34,145, 12,191,241,228,196,206,138, 52, 13, 6,195,231, 63,254,248,227, 1,179,217,236,245,222,123,239,113,189,
+123,247,150, 86,175, 94, 29, 23, 46, 92,208, 83, 20,245, 75,101,157,127,113,230,126,187,233,139,180,180,180, 49,189,123,247,150,
+ 73, 36, 18, 28, 61,122, 20, 87,174, 92, 33, 30, 62,124,152,103, 54,155,187,105,117,154, 91, 21,105, 8, 4,130,163, 75,150, 44,
+145,201,100, 50,104,181, 90, 72,165, 82, 72, 36, 18,180,106,213, 10,107,215,174,149,125,245,213, 87,199, 85, 74,181,157,109,243,
+174, 55,131,215, 18, 0,188,236, 85, 5, 36, 73,118,217,184,113, 99,232,198,141, 27, 43,220, 9,176, 50,186,111, 34,197,247, 1,
+ 0, 80,230, 58,255,138,142, 87, 64,196, 11,152, 88, 26,215, 80,176, 69,108,149, 40, 57,138,208,162, 69,139,194, 41,128,124,220,
+ 74, 13,197,179,159,149,167,240,198,243,157, 74,169, 14, 85, 40, 20,227,115,114,114, 12,133, 91,214, 78, 83, 41,213,225, 10,133,
+ 98, 50, 77,211, 21, 13, 45,208,114,185,252, 68,122,122,250,106,173, 78,115,220,210,104,111,111,127, 60, 37, 37,101,163, 86,167,
+ 57, 92, 37,227, 94, 2, 34,145, 40,223,108, 54,139, 40,138, 98, 40,138, 50,114, 14, 14,185, 80, 42,117,249, 70,163,194, 96, 52,
+ 26, 56,142,203, 65, 97,207, 63, 55, 55,215,196,113, 92,182,167,167,103,118, 25, 75,247, 57, 0, 58,134, 97, 82,240,207, 41,162,
+ 50,115, 0,172, 25, 77, 18,146, 98, 52, 86,118,224, 76,102,195,140, 47,190, 31,208, 54, 52,232,178, 66, 46,151, 23,101,205,191,
+247,222,123,224,243,249,216,124, 96,101, 94,110, 94,246,204, 42, 93,140,127,153, 59,119,238, 92,182, 56,255, 21, 63,237,233, 26,
+ 23, 23,247, 67,179,102,205, 8, 59, 59, 59, 28, 58,116, 8, 71,143, 30,181,156,186, 62,234,241,241, 10,157, 63, 0, 4,133, 5,
+106, 1, 52,246,247, 13, 16,199,198,198,166,167,165,165, 65, 46,151,163,110,221,186,242, 71,143, 30, 13, 7,176,182, 42,182,254,
+ 60,110, 67,211,148,148,148, 85, 29, 58,116,144,241,120, 60, 28, 60,120, 16, 33, 33, 33, 0,144, 15,224, 43,107,156, 63, 0,144,
+ 36,153, 53,118,236, 88, 69, 89,199, 11,247,156,176,241,134,240, 90, 2,128,151,189,170,160, 48, 81,229,173,222,225,175, 10,196,
+160,252, 57,250,138,142,151,199,203,158,163, 62,136, 23, 8, 0, 44, 75,253, 94, 37,133,142,251,120,137,182, 48, 0, 97, 86,188,
+151, 1,240,105,201,246,171,241,127,253,239,165, 25, 88, 69,120, 60,158, 52, 49, 49,145,117,113,113,121, 72, 16, 68, 78, 18,224,
+149,103, 50,217,123,181,110,125,209,203,217, 57, 35, 36, 36,164, 65,110,110, 46,221,189,123,247, 96,169, 84,170,251,229,151, 95,
+212,183,111,223,110,124,251,246,237,192, 82,246,238, 39, 1, 72,197, 98,177, 76,171,211,132, 21,246,252, 91,163,160,231,127, 29,
+ 0, 84, 74,181, 55,158,245,252, 9,149, 82,237, 80,248, 58,191, 34, 91, 5,164, 8, 55,207,198, 69,181,234,212,104, 97,231,129,
+173,167,205, 13, 8,180,115,118,113,134,217,108,198,131,132, 88,108, 57,176, 42, 47,207,148,181, 32, 57,202,248,214,173, 0, 0,
+ 10, 70,156, 0,224,215, 73, 59,134,198,198,198,110, 79, 73, 73, 33, 98, 99, 99,241,248,241, 99, 88, 54,182, 2,112, 5,192,196,
+202,106, 7,133, 5, 26, 71,124, 58,245, 65,116,116,244,251, 30, 30, 30, 68, 84, 84,148,158,166,233,223,171, 98,231,204, 49,107,
+213,201,201,201, 39,178,178,178,196,187,119,239, 70, 92, 92, 28, 75,211,180, 30, 5, 57, 32, 11,181, 58,205, 49,107,181, 78, 94,
+223,254,202,255,119,109,188, 60, 94,219, 20,192,155,190,170,224, 77,103,222, 62, 77,185,137, 80, 21, 29,175,128,245, 47,240,222,
+210, 8,194, 27,146, 80,248,174,161,215,235, 19,191,255,254,123, 39,133, 66,145, 44, 22,139,179,243,242,242, 4, 36, 73,154, 60,
+111,221,138, 83, 40, 20, 79,163,163,163,149, 12,195, 80, 45, 91,182,188, 89,187,118,237,220,235,215,175, 55, 76, 77, 45, 51,137,
+148, 1,144, 6, 96, 68, 97, 45,135, 92, 0, 14, 0,178, 85, 74,181, 12, 5,197,127,236, 0,100,170,148,106, 66,171,211,112, 42,
+165,186,228,200, 64,185, 40,133,174,136, 62,155,180,168, 78,107,199, 83,255, 55,109,224, 28,147,209,212,140, 32,192, 9, 69,162,
+ 27,185,121,217, 51,223, 86,231, 95,156,152,152,152,121, 15, 31, 62, 68,122,122,186,145,101,217, 76,134, 97, 30, 2,184, 7, 96,
+171, 86,167, 57, 95, 85, 93,138,162, 62,191,126,253,250, 31, 17, 17, 17,222, 36, 73,238,100, 89,118, 93, 85,116, 18, 19, 19,127,
+ 76, 77, 77,205, 75, 77, 77,141,201,207,207,143, 5, 16, 13,224, 33,128,208,170, 22, 39,178,241,118, 64, 84,102, 14,213,134, 13,
+ 27, 54,170,138,173, 28,176, 13, 27,111, 22,111,107, 18,160, 13, 27, 54,222, 50,108, 14,220,134,141, 55,139, 23,138,200,109,216,
+176, 97,195,134, 13, 27,111, 39,182, 0,192,134, 13, 27, 54,108,216,120, 7,177, 5, 0, 54,108,216,176, 97,195,198, 59,136, 45,
+ 0,176, 97,195,134, 13, 27, 54,222, 65,108, 73,128, 54, 0, 0,254,190, 1, 34, 0, 68, 80, 88,224, 11,239,222, 87, 82,203, 62,
+100, 2, 0, 16, 71, 78,223,170, 9, 14,100,207, 78,239, 63, 2,192,101,119, 93,241,162, 31,101,227, 95, 96,156,223,220,253, 28,
+199,125,102, 54,155,193,227,241,194,215, 29,152,229,251,111,219,100,195,134,141,202, 99, 91, 6,248,142,225,239, 27,224, 12, 96,
+ 10, 0, 1,128, 69, 65, 97,129,201,254,190, 1, 71,132, 66, 97, 15, 0,160, 40,234,124, 80, 88, 96,251, 18,239, 33,130,194, 2,
+255,177, 91,163,181, 90,246, 33, 19,136,131, 33, 55,126,225,128,201, 0, 8, 2, 88,217,183,107,211,128,236,174, 43, 42,181, 3,
+164, 74,169,118, 7,176, 88, 46,151,119, 38, 73,146,204,201,201, 57, 5, 96,178, 86,167,137,175,252,149,176, 81, 85,198,126,246,
+179,113,211,166, 77, 34, 62,159,143, 33, 67,134,192,100, 50,201,118,158, 92,172,255,183,237,122,147, 25,220,229,251, 24,130, 32,
+206,178, 44, 59, 57, 40, 44, 48,251,223,182,231,117,226,239, 27,112, 20,128,101,147,172, 99, 65, 97,129, 61,222, 36,189,119, 25,
+ 91, 0,240,142,225,239, 27, 48,103,196,136, 17, 51, 28, 29, 29,177,108,217, 50, 45,199,113, 31, 2, 72, 13, 15, 15, 23, 9, 4,
+ 2,248,250,250,130,162,168, 90, 40,216,233,206,207,193,193,161, 99, 86, 86,214, 89, 0, 3,131,194, 2,159, 86, 69,203, 81, 98,
+ 24,208,167,222,221,165, 95,127, 55,134, 0,128,141,171, 55,114, 36,224,213, 97,225,169,120,107,237, 86, 41,213,181,236,236,236,
+110,118,239,222,157,106,221,186,181, 66, 40, 20,114,233,233,233, 57, 91,183,110,149, 38, 37, 37, 53,125,221, 69,119,222, 84,212,
+157,215,199,128, 36, 29, 8, 16, 32,136,130,104,139, 44,124, 14,224, 70,232,137,255,251,164, 50,122,227,252,230,214, 70, 65,197,
+200, 34, 40,138, 10,217,186,117,171,128,207,231, 99,192,128, 1, 16,139,197, 61,132, 66,161,101,231,191,167,107,246,205,168,112,
+219,216,161,221, 38, 39, 48, 12,227, 1, 0,124, 62, 63,221,108, 54,187, 5,133, 5,154,203,106, 47, 77, 99,250,168, 84,232, 84,
+222, 66,128, 16, 0, 0, 71,112,180,119, 42, 71, 61,112, 33, 42,108,107,207,107, 78, 13,154,240,250,170,211,250,251, 6,208, 74,
+165,146,201,206,206, 54,114, 28, 55,145,227,184,237,165, 5,213,255, 5,252,125, 3, 92, 81,176,185,152, 8,192, 4, 0,218,224,
+224, 96, 48, 12,131, 30, 61,122, 0,128, 10,192, 10,185, 92,206,230,229,229,125, 25, 20, 22,152, 82,142,220, 75,215,179,241, 12,
+219, 20,192,187,135,210,205,205, 13,253,250,245,131,209,104, 84,173, 93,187,118, 47, 0, 50, 47, 47,175,168,138,162,155,155, 91,
+ 66,135, 14, 29,120,237,219,183, 71,221,186,117,177,113,227,198,206, 7, 14, 28,232, 12, 96,111, 85,180,212, 31,183,228,145,113,
+115,172, 50,174,176,166,129,232,143,105, 13, 76, 2, 62, 33, 26, 48, 55,218, 4, 64,228,215, 81,193, 58,212,246, 33,127, 89,178,
+250,145, 82,233, 24, 74,211,244,129,211,167, 79,127, 80,163, 70,141,207,191,254,250,235, 64, 0,125, 95,206,229,121,187,145,202,
+236, 28,215, 46,159,239,108, 47, 21,128, 71, 18,224,241, 8,240, 72, 2,105,217, 20,190, 26,251, 93,189,202,104,141,243,155,251,
+163,139,139,203,156, 26, 53,106,240,138,183, 27, 12, 6, 76,157, 58, 21,185,185,185,112,119,119, 71,205,154, 53,143,146, 36, 9,
+142,227,144,145,145,129,113,126,115,231,174,217, 55,163,220,253,251, 89,150,117, 11, 13, 13, 5,159,207, 71,231,206,157,139, 42,
+ 62,150,213, 94,154,134, 78, 85, 87,152,171, 55,127, 70,112,236, 34, 14,224, 8,130,152,242,192, 69,240, 87,174,222,220,167,162,
+182,243,210,168,131,131,128, 10,139, 53, 77,111,161,110, 39, 32, 48,143,225,208,156, 32, 64,240,129, 27, 70, 2, 51,230, 95,211,
+156,177,250, 66,162,160,124,244,246,237,219, 69,243,230,205, 19,197,196,196,172,210,235,245, 1,254,190, 1,195,130,194, 2,111,
+ 84, 70, 7, 0,252,125, 3, 34, 1,108, 14, 10, 11, 44,218,249,111, 72,215, 73,151, 0,236,254, 61,100,201,138, 98,109, 9, 44,
+203,122, 16, 4,145, 46,151,203,221, 54, 28,252,185,212,235,232,239, 27,112, 15,128, 39, 65, 16, 79,254, 8, 93, 90,187, 88,251,
+255,145, 36,249,197,239, 33, 75, 62, 46,214, 54,156,199,227,141,145, 74,165,237,203,210, 3,176,254,215, 95,127,237,173, 80, 40,
+ 48,101,202,148, 24, 79, 79, 79,216,219,219, 99,195,134, 13,112,116,116, 4,195, 48, 49, 75,150, 44, 33, 18, 19, 19,177, 98,197,
+138, 45,120,214,155, 47,139,151,173,103,163, 16, 91, 0,240,238, 49, 63, 48, 48,176, 95,253,250,245,221, 70,142, 28, 9, 62,159,
+223, 53, 61, 61, 29,187,118,237,130, 92, 46,199,186,117,235,224,233,233,201, 99, 24, 6, 6,131, 1,103,207,158,197,165, 75,151,
+242, 1,220,127, 17,173,200, 35, 25, 88,183, 98, 13, 56,142, 67, 30, 37,220, 53,188, 71,131,132,178,198, 65,101,102, 72, 30, 54,
+ 95,111, 4,128,121,251, 10,218,154,213,236,158, 60,183,103, 7, 59,165,210, 49,138,199,227,133, 62,126,252,248,230,130, 5, 11,
+206,109,216,176, 97, 84,141, 26, 53, 58,190,138, 11,245, 54, 34,149, 8,193, 35, 73,252,178,239, 33,164, 98, 62,164, 34, 30,164,
+ 34, 62,164, 98, 30,158, 85,229,182,154,145,139, 23, 47,230,185,185,185,253,227,192,163, 71,143,144,149,149, 5, 59, 59, 59, 56,
+ 58, 58,194,108, 54,131, 97, 24,164,167,167, 99,194,132, 9, 35, 1, 84, 88,192, 71,161, 80,224,200,145, 35, 86,183,151,130, 0,
+ 28,187, 48, 96,240,135,238, 0,176,244,143,171, 11, 8, 16,199,172,105, 3,136,163,168, 32, 0,152,213, 66, 61,219,181, 70,173,
+201, 99,126, 88, 36,245,104,214, 6, 84,182, 14, 9, 23, 67,219,109,219,188,236,216,220, 86,234, 85, 51,174,105,166, 90, 99,164,
+ 5, 23, 23, 23,184,185,185,161, 86,173, 90,242,164,164,164,198,215,175, 95,191, 48,188,251, 15,187,104,154,158, 20, 20, 22,152,
+ 85, 9,169,230, 2,129, 96,241,144,174,147, 62, 37, 73,114,240,142, 19,191,230,112, 28,215, 82, 40, 20,126, 48,236,147, 41,221,
+204,102,243,160,160,176,192,108,142,227,220,166, 78,157,138, 69,139, 22,149, 27, 72, 17, 4,225, 57,108,216, 48,254,246,237,219,
+ 61, 0,192, 79,253,173, 76, 44, 22,255, 38,145, 72,186, 27, 12, 6, 25, 0,248,251, 6, 72,121, 60,222,102,137, 68,210,219, 96,
+ 48, 72,202,211, 3, 32,188,113,227, 6,154, 54,109,138, 63,254,248,131,224,241,120,184,124,249, 50,164, 82, 41, 70,140, 24,129,
+ 38, 77,154, 16, 18,137, 4,177,177,177,200,201,201,177,230,143,242,101,235,189,115,168,148,234,231, 70,155,180, 58, 13, 1,216,
+ 2,128,119,142,160,176,192, 20,127,223,128, 62,147, 38, 77, 58,183, 99,199, 14,209,144, 33, 67,192, 48, 76,209, 35, 47, 47, 15,
+167, 78,157,194,185,115,231,112,245,234, 85,157,193, 96, 56, 8, 96,101, 80, 88,224,223, 47,166,117, 93, 39,226, 26,132,184,217,
+229,253,182,248, 11,229, 73,148, 81, 47,126,239,140,134, 0,171,199,189, 18,237, 4, 65, 64, 34,145,112, 20, 69,237,123,244,232,
+209, 93,149, 74,149,218,184,113,227, 26, 74,165, 18, 36,105, 91,204, 98,129, 0, 1, 62,143,128, 92,194,199,149, 35,171,178, 24,
+202, 96, 34, 8, 18, 4, 0,130,224, 74, 94,214,138,216,250,195, 15, 63,204,175, 94,189,250,115,141,238,238,238, 24, 61,122, 52,
+142, 28, 57,130,123,247,238,129,227,184,162, 71, 70, 70, 6, 11, 96,171, 53,226, 38,147, 9, 18,137,196,234,246,215,201,140,150,
+234,143, 93,106,212,154,178,232,224, 85, 73,220,111,129,136, 88,245, 35,132, 28, 7,167,166, 31, 98,234,183, 83,165,243,151,205,
+251,118,122, 75,117,200,188, 8,205, 41,107, 53, 9,130,128,157,157, 29, 72,146, 68,147, 38, 77,136, 38, 77,154, 72,175, 92,185,
+ 50,248,238,221,187,253,135,116,157, 20,192,178,236, 54,107,167, 5,126,250,233, 39,217,166, 77,155,186,164,164,164,196, 12,234,
+252, 93, 79,146, 36,241,243,207, 63, 75, 54,110,220,216, 41, 49, 49, 49,230,243, 78, 19,123,242,120, 60,212,172, 89,211,170,192,
+207,203,203, 11, 0, 48,164,235,164, 70, 50,153,236,248, 55,223,124,227,214,183,111, 95,126,199,142, 29,241,121,167,137, 13,197,
+ 98,241,177,241,227,199,215,236,211,167,143,192,199,199,167,100,209,168,146,124,179,107,215, 46,109,102,102, 38, 63, 34, 34, 2,
+ 18,137, 4, 82,169,180,168, 52,112,114,114, 50, 76, 38, 19,246,238,221,107, 6,240,173, 21, 95,247,101,235,189, 83,168,148,106,
+ 78,171,211, 16,150,159,197,143,217, 2,128,119,144,160,176,192,107,254,190, 1,254, 3, 6, 12, 88,237,237,237, 93, 3, 0,154,
+ 53,107,134,193,131, 7, 99,197,138, 21, 8, 9, 9,217, 15, 96, 35,128, 51, 0,200,160,176, 64,211,203,208, 50, 64, 76,174, 61,
+186,214, 84,217, 12, 40,149, 82, 45, 0,112,253,193,131, 7,237,255,252,243,207,255,253,241,199, 31,145,173, 91,183,118, 95,190,
+124,249,248,232,232,232,220,164,164,164, 43, 85,185, 14,255, 69, 72, 2,224,243, 8,200,196,124, 48,148, 81, 23, 18,252,127, 94,
+ 85,213, 90,179,111,198, 47,227,252,230, 30, 74, 73, 73,113, 41,214,220,142,162,168,185, 52, 77, 35, 62, 62, 30,119,238,220,153,
+143,231, 43, 40, 38,174,217, 55,227, 65, 69,218, 4, 65,192, 96, 48, 64, 42,149, 90,213, 94, 6, 52, 8,114,106,224, 31, 87, 44,
+ 67,251,211, 56,112,140, 53,109, 0, 87, 86, 1, 36, 0, 0,159,195,156, 81, 1,115, 37, 15,182, 45,197,147, 63,150, 67, 92, 56,
+157, 98,212, 28,134, 56, 59, 29,195,218,182,149,174, 59,113,108, 30,128,182,214, 24,106,193, 18, 0, 8,133, 66, 8,133, 66,244,
+233,211, 71,220,174, 93, 59,241,161, 67,135, 86,100,102,102,126,231,239, 27, 48, 60, 40, 44,176,194,194,104,221,187,119,135, 86,
+171, 21,197,199,199,187, 94,187,118,237,156,217,108,230,249,248,248, 32, 33, 33, 65, 20, 27, 27,235,122,230,204,153,179, 52, 77,
+243,100, 50,153, 85,118, 89,174,183, 82,169,188,182,108,217, 50, 73,157, 58,117,112,252,248,113, 48, 12,131,234,213,171, 71, 44,
+ 95,190, 92,226,225,225, 1,141, 70, 3,134, 41,219,255, 91, 18,244,222,127,255,125,140, 29, 59, 22,127,254,249, 39,182,111,223,
+ 94,116,220,207,207, 15,125,251,246, 69, 94, 94, 30, 92, 93, 93,249, 73, 73, 73,177,254,190, 1,101, 38,242,189,108,189,119, 17,
+139,243, 7,158,141, 4,216, 70, 0,222,113,130,194, 2,255,244,247, 13, 56,114,253,250,117, 47, 0,131,156,156,156,102,209, 52,
+ 13,150,101, 1,224, 16,128,107, 0,142,187,184,184,116,244,247, 13,216, 19, 20, 22, 56,228,117,104, 13,152, 27, 13,153, 25,152,
+118,176,224,181, 74,169,174, 89,187,118,237, 51,125,251,246,173,107, 52, 26,241,244,233,211, 94, 43, 87,174,236,227,224,224, 0,
+237,237,139,226,177, 99, 38,229, 1, 8,120, 73,151,229,173,135, 32, 8, 8,120, 36,228, 98, 62, 8, 2,248,184,205, 82, 59, 82,
+ 44,120, 4,150,177, 47,237,124,158, 64,116,251, 76,248,215,101,150,214, 94,179,111, 70, 52, 10,170,195, 97,156,223, 92, 2,192,
+226, 46, 93,186,128,166,105,180,111,223, 30,215,175, 95,239, 9, 96,214,154,125, 51, 42,234, 21,254, 3,154,166, 75,117,244,101,
+181,151, 68,169,141,165,160,242, 62, 0,240,255, 2, 10,146,251,188, 82, 89,234,129, 11,175,194,182,118,188,230, 20, 80,118, 18,
+ 32, 7, 52,117,243,174,143,187,235,102, 66,202, 35, 32, 38, 9,136, 10,127,146,177, 55,224,209,178, 35,104,142,171,116, 73,242,
+146, 1,128, 80, 40,132,147,147, 19,126,250,233, 39,249,181,107,215, 26,237,221,187,247,220,168, 62, 51, 87,111, 60, 52,231,135,
+138,180,156,157,157,225,236,236, 76, 52,104,208, 64, 18, 23, 23,103, 38, 8,130,239,236,236, 12, 23, 23, 23, 52,106,212, 72, 18,
+ 19, 19, 99,150,203,229, 86,221,227, 37, 18, 9, 90,183,110, 77, 47, 92,184, 80,146,159,159,143, 35, 71,142,128,162, 40,116,232,
+208,129,254,249,231,159, 37, 70,163, 17,103,206,156, 1, 77,151, 27, 55, 1,192,255,130,131,131, 97,111,111, 95, 52, 76, 15, 0,
+159,126,250,233,183, 14, 14, 14, 29, 13, 6,195,103, 71,143, 30,133, 78,167,131,183,183, 55,170, 87,175,142,203,151, 47,151, 55,
+103,255,178,245,222, 73, 74,246,252, 45,216, 2,128,119,152,160,176, 64,218,223, 55,160,134,147,147,211,180, 33, 67,134,192,108,
+ 54,163, 83,167, 78,248,251,239,191,127,203,200,200,120,244,229,151, 95,122,118,236,216, 17,179,102,205, 26,236,239, 27, 48, 43,
+ 40, 44, 48,174,248,251, 45,235,251, 15,159,186, 85,243,235, 15,193, 95,127,181,169,155,210,177,106, 90,165,161, 82,170,107,120,
+122,122,158,141,136,136,240, 74, 72, 72,192,132, 9, 19,176,122,245,234, 75,139, 22, 45,106, 74,146, 36,217,218, 43, 71, 36,102,
+140,173,108, 43, 0,158, 65,155,205, 48,210, 44,100, 18, 62, 8, 16, 32,248, 34,153, 68, 34, 18,174, 94, 17, 8,185,132, 7,130,
+ 0,120, 36, 9, 62,143,192,163,212, 60,140,159, 24,224, 81, 9,249, 47,234,213,171,215,242,163,143, 62, 66,124,124, 60,154, 53,
+107, 6,149, 74,213, 68,171,213,142, 6,176,182,178,182,154,205,102,200,100,178,127, 12, 81,151,213, 94,146,121, 27,171, 3,200,
+163, 0, 80, 29,234, 15,240,106,220,184,241,252, 19,247,239, 31, 8,253,123,231,126, 20,155,223,239,242,193,208,254,222,222,222,
+125,162,163,163,103,158,141,217, 91, 56, 58, 81,241, 10, 0, 42, 51, 21, 98,176,224,241,158, 57,127, 17, 73, 64, 76,114, 96, 51,
+ 83, 81,153,148, 10,130, 32, 64, 16, 4,228,114, 57,248,124, 62, 4, 2,193,115, 65,128, 64, 32,128, 88, 44, 46, 58,215, 26, 61,
+103,103,103, 16, 4, 1, 30,143, 7,145, 72,196, 1, 5,121, 6, 4, 65,128,207,231, 67, 46,151, 91,117, 29, 11,167,215,160, 80,
+ 40,136, 11, 23, 46,128,162, 40, 72,165, 82,216,217,217, 65, 42,149, 18, 17, 17, 17, 32, 73, 18,114,185, 28, 60, 94,197,185, 36,
+ 12,195, 96,195,134, 13, 69,195,244, 0, 32, 18,137,218, 5, 4, 4,124, 86,218,249,141, 27, 55,126,173,122,239, 34, 42,165,218,
+ 8,192, 65,171,211, 24,139, 63,183, 77,158,190,195,248,251, 6,212, 87, 40, 20,127,205,159, 63, 95,232,228,228,132,168,168, 40,
+168, 84, 42, 44, 93,186,148, 63,109,218, 52, 79,181, 90, 13,173, 86,139,199,143, 31, 39, 0, 40,109, 88,151,248, 51,244,198,108,
+198,204, 60, 52,153,152,184,246,117, 82, 79,188,128, 22,128,130, 28,128,109,179,234, 0, 0,106,215,174,125, 44, 34, 34,194, 43,
+ 47, 47, 15,155, 55,111,198,213,171, 87,239,105,117,154, 46,167,239,236,114, 14,191,245,135, 19, 79,152, 67, 55,247,160, 18, 94,
+201,197,121, 75,201,205,206,206, 28, 49,106, 98,106,208,218,217,169, 40,156,243, 23,137, 4, 4,199,113,248,118,253, 93, 76,221,
+118, 31,179,131,226,176, 96, 95, 60,246,104, 30,195, 90, 31, 54,206,111, 46, 9,224,231,161, 67,135,226,201,147, 39,152, 61,123,
+ 54,146,146,146,208,191,127,127, 16, 4, 49,107,156,223, 92, 65,101,109,229, 56,174,212,185,254,178,218,203,162, 67,253, 1, 94,
+190,190,190,135,247,236,217,211,223,219,219,187, 79,201,227,239,189,247,222,103,251,246,237, 27,216,169, 83,167, 67, 29,234, 15,
+176,106, 74,132, 71,224, 70,194,149, 51,112,106,220, 2, 82, 30,241,236,193, 39, 32,179,119, 64,220,163,120, 8, 65, 84,184,220,
+177, 36,118,118,118,176,179,179,131, 66,161, 40,122,254,244,233, 83,204,154, 53, 43,111,199,142, 29,119,244,122,125,251, 13, 7,
+127,174,176,247, 15, 20, 56,251,184,184, 56,110,205,154, 53,250,144,144, 16,190, 37, 40,136,141,141,229,230,207,159,111,216,191,
+127, 63,207,218,235, 40,149, 74, 17, 22, 22,198,159, 59,119,174, 33, 49, 49, 17, 78, 78, 78,168, 86,173, 26, 78,156, 56,193,159,
+ 62,125,186, 65,171,213,114, 78, 78, 78,112,114,114,170, 72,234,112,143, 30, 61,112,228,200,145, 34,135, 93,184, 74,104, 32, 0,
+ 44, 92,184,176, 40, 24,154, 61,123, 54, 0, 32, 63, 63,191,188,205,199, 94,182,222, 59,135,197,225, 3,200, 82, 41,213,226,226,
+199,108, 1,192,187,205, 23, 99,199,142,181,115,115,115,195,142, 29, 59, 48,115,230,204,148,217,179,103, 35, 51, 51, 19,245,235,
+215,199,221,187,119,177,100,201,146, 76,147,201,212,167,180,228,164, 80,205,109, 39,112,152, 58,122,252,104,114,236,196,177,164,
+170, 90,138, 80, 41,227,170,164, 85, 18,149, 82,237,213,171, 87,175,102, 79,159, 62,197,175,191,254,138,173, 91,183, 62, 54,153,
+ 76,221, 94,205,101,248,239, 16, 26, 50,170,254,201,227, 35, 93, 79, 28, 27,233,122,226,216,151, 69,107,254, 9,162, 32, 49, 80,
+ 38,225, 67, 38,230, 67, 46,230, 67, 38,230,193,234, 8, 0,240,241,244,244,172,229,238,238,142, 3, 7, 14,192, 96, 48,220, 63,
+120,240, 32, 92, 92, 92, 80,167, 78, 29, 23, 0,149,254,221, 16, 4,129,210,230,168,203,106, 47, 13,139,243, 95,177, 98, 69,253,
+113,227,198, 37,199,196,196, 48, 62,141, 6,253, 92,252, 17, 29, 29, 77,141, 27, 55, 46,121,229,202,149, 13, 58,118,236,104, 85,
+ 16, 64, 1, 51,183,239,219,110, 16,213, 81,193,161, 97, 51,200, 36, 18, 72,197, 34, 72,149, 78, 48, 48, 12, 54, 63, 76,201,207,
+227,184,233,149,253,206, 22,167,111,103,103, 7, 62,159,143,223,127,255,221, 56, 99,198,140,236,248,248,248, 9,122,189,190,137,
+ 53,243,255, 0,144,145,145,129, 93,187,118, 25,119,239,222,253,152,162,168, 54, 60, 30,143,201,201,201,193,142, 29, 59,140,235,
+215,175, 79, 49, 24, 12,237,121, 60, 30, 99,237,117,180, 4, 10,102,179, 89,189,123,247,238,212,131, 7, 15,154, 20, 10, 5, 0,
+192, 96, 48,124,180, 99,199,142, 39,219,183,111, 55,218,217,217,149,171, 19, 20, 22,216, 7, 64, 61,154,166,205,239,191,255, 62,
+100, 50, 25,252,252,252,138,150, 5, 79,157, 58,181, 40, 97,212,226,176,115,115,115, 13,175, 75,239, 93, 70,171,211,136, 1, 60,
+183,218,196, 54, 5,240,110, 83, 91, 38,147, 65,175,215, 99,255,254,253, 57, 0,188,111,221,186,213,239,135, 31,126, 88, 89,187,
+118,109,101, 66, 66, 66,154,201,100,234, 18, 20, 22,120,211, 90, 65,131,193,240, 66, 90,150, 28, 0, 0, 15,127,251,237,183,200,
+ 43, 87,174,180,184,121,243,230, 67,163,209,216,169,228,142,127,101,173, 24,176,241, 79, 44,137,129,114,241,179, 32,128,199,242,
+ 43,225,255, 49,164, 77,155, 54,200,207,207, 71,100,100, 36, 3,160,223,205,155, 55,163,114,115,115, 5, 77,155, 54,197,195,135,
+ 15, 7, 3, 56, 90, 41,155,248,252, 82,231,250,203,106, 47,137, 74,169, 38,220,220,220, 2,151, 46, 93, 90,223,201,201,137,191,
+107,215, 46,119,142,227,134,177, 44,203,113, 92, 65,140, 73, 16, 4, 72,146, 36, 44,189,196, 21, 43, 86, 52,104,222,188,249, 18,
+ 0,253,202,211,158, 27,161,185, 48,183,149,250,215,185, 91, 55, 76, 30,250, 65, 67,169,167, 87, 35, 48,185, 58,252,157,156,140,
+237, 79,178,242,105,142, 91, 93,153, 21, 0, 22, 91,228,114, 57, 4, 2, 1,206,157, 59,199,109,218,180,201,192,178,236, 46,163,
+209, 88,217,101,128, 24, 57,114,100,126,110,110,238,241,156,156,156, 47,246,105, 86,229, 15,237, 54, 25,195,134, 13,211,103,101,
+101,133,209, 52, 61,116, 87,248,178,156,161,221, 38,151,155,176, 87, 28,203,121,191,135, 44,185,230,239, 27,160,186,124,249,242,
+174,251,247,239,119, 0, 32,219,125,106,249,223, 35,123,252,216,224,210,165, 75, 59, 98, 98, 98,186,176, 44, 91,209,176,194,202,
+ 95,127,253,149, 47,149, 74, 97, 50,153,144,155,155,139,140,140, 12, 0, 5, 61,246,105,211,166, 1, 0,102,205,154,133,217,179,
+103, 35, 63, 63,255,117,235,189, 83, 20, 58,254,127, 60, 7,108, 1,192,187,206,253,199,143, 31,163,126,253,250,112,112,112,176,
+211,233,116, 92, 80, 88,224,239,254,190, 1,127,222,187,119,175, 46,128,196,242,110, 76, 93,212,141,159,254, 25,122, 99,225,134,
+149, 27,126, 4, 64,144,174,190,132,212,161, 86,149,180, 74,162,213,105, 56,149, 82,221,250,234,213,171, 94, 0, 30,105,117,154,
+ 50, 87, 34,216, 40,159,130,165,129,228,115,206, 95, 46,230,131, 96,120, 21,191, 25,192, 56,191,185, 98,146, 36,251, 53,111,222,
+ 28, 81, 81, 81, 48,153, 76,167,214,236,155,113,123,156,223,220, 19, 55,110,220,232, 89,191,126,125,240,120,188, 94,227,252,230,
+202,215,236,155,145,103,173, 93, 66,161,176,212,161,254,178,218, 75,162,213,105,184, 14,245, 7, 4, 76,152, 48,193,107,245,234,
+213, 13,198,143, 31,159,124,254,252,249, 51, 66,161, 48,129,199,227, 17, 0,192, 48, 12, 71, 81, 84,237,118,237,218,117, 92,181,
+106, 85,141,239,191,255, 62,134,101, 89,171,146, 70,103, 92,211,204,158,222, 66, 29,182,249,210,149,121, 20,199, 53,231, 0, 66,
+ 68, 18, 55,114, 57,174,210, 27, 1, 1, 64, 78, 78, 14, 50, 50, 50,176,124,249,242,188,228,228,228,135,121,121,121, 85,218, 8,
+ 72, 38,147, 93, 76, 75, 75,219,244,123,200,146,223, 44,109, 18,137,228,124, 74, 74,202,238,157, 39, 23,111,176,180, 9, 4,130,
+ 39,109,219,182,245, 16,137, 68,153, 40,123,205, 62, 4, 2, 65,234,128, 1, 3, 92, 11,207, 67,225, 86,197,159, 14,239,254,195,
+120,169, 84, 58, 28, 0,182, 30,253, 37, 23, 64,223,161,221, 38,143,145, 74,165,163,202,211, 3, 96, 8, 14, 14,134, 68, 34,193,
+254,253,251,205,174,174,174,124,165, 82, 9,160,160,199, 62,117,234,243,219, 39, 24,141, 70,113,105, 34,175, 80,239,157,166,120,
+ 14,128, 45, 0,120,183,185,159,148,148, 4,179,217,140,234,213,171, 19, 58,157,206, 27,192,237,160,176, 64, 61, 0,107,122,253,
+ 92,191, 46, 77,103, 31, 62,117,107,211,241,251,222, 3, 62,168,217,118,233, 11,104, 1,120,190, 87,175,213,105, 88, 0,177,101,
+157, 91,114,197,128,141,210,161,105, 51,151,111, 98, 32,147, 88,134,254, 11, 2, 1,152,249,214, 78, 1,200, 28, 29, 29, 21, 18,
+137, 4,151, 47, 95, 6,128,223, 11,219,127,143,140,140,236,217,160, 65, 3, 40,149, 74,105, 70, 70, 70,125, 0, 17,214, 8, 10,
+133,194, 39, 93,187,118,245, 40,124,158,201, 48,140,185,188,246,178, 56, 27,179,247, 65,135,250, 3,250,140, 31, 63,254,208,170,
+ 85,171, 26, 12, 28, 56, 80,176,118,255,204, 25,197,207, 25,211,111,246,239,171, 86,173,170, 49, 97,194,132,152,176,176,176,222,
+103, 99,246,198, 91,245,173, 1,204,139,212,156, 7,208,209,218,243,203, 35, 48, 48,208,116,234,212, 41, 35, 69, 81, 19, 25,134,
+169,242, 86,192,155, 14,207,253,184,100,219,198, 67,115,124, 74,182,109, 61,250, 75,237,146,109,165, 81,179,102,205,218,233,233,
+233, 2,148,112,234,219,131, 23,173, 4,176,178,120,219,206,147,139,215,163, 96, 91,222,242, 24,253,215, 95,127,153, 1,200, 0,
+140, 79, 74, 74,138,181,236,213, 81, 90,143,221, 10, 94,182,222, 59, 77,241, 81, 0, 91, 0,240,110, 19,117,247,238, 93,142,162,
+ 40,194,108, 54, 3,149,204, 9, 41,172,230,199,117,236,138,199, 27,125, 3, 66,132, 47,160,245, 28,164,212, 48,221, 79,109, 66,
+ 41, 91, 2,151,124, 93,229,207,120, 71,224,204,166,252,124, 61, 71,141,250,106, 84,169, 93,106,145, 88,156,104,133, 76,102, 70,
+ 70,198,137, 25, 51,102,124,162,211,233,110,224,217,150,208, 7, 31, 62,124,248,215,170, 85,171,122,101,101,101,157, 1, 96,213,
+252, 53, 80,182,115,178,214,105, 21,199, 18, 4,248,249,249,205,137,139,139, 59, 84,242,120, 92, 92,220,161,129, 3, 7,242,110,
+223,190,253,211,179, 85, 0,175, 23,177, 88, 28,119,230,204,153,179, 6,131,225,141, 43, 6, 52,111,227, 55, 12,128, 74, 47,227,
+ 44,139,160,176,192,116, 0, 3, 44,175,253,125, 3, 14, 71, 71, 71,247, 6, 74,239,177,191,110,189,119,145,194, 94,191,229,126,
+ 41,209,234, 52, 70,192, 86, 12,232,157,199,223, 55, 96, 54,159,207, 31,102, 54,155,119, 7,133, 5,254,248,166,104,217,120,243,
+ 24,231, 55,183,246,154,125, 51, 18, 74,180,241, 1, 56, 2,200, 92,179,111, 70,185,189,117, 27,239, 46, 62,141, 6, 69,154, 76,
+166,247, 12, 6,131,200, 96, 48, 8, 45, 57, 26, 0, 32,149, 74,211,174, 39, 5, 87, 47,231,237,175, 92,239, 93,162,248, 20,128,
+ 45, 0,176, 97,195,134, 13, 27, 54,254,195,216, 70, 0,108,216,176, 97,195,134, 13, 27, 69,216,246, 1,176, 97,195,134, 13, 27,
+ 54,222, 65,108, 73,128, 54,108, 84,129,122, 55,199,146, 32,185, 58, 96, 57, 87,128,159, 6,176, 15,238, 53, 89,199,190,144, 30,
+ 80, 27, 44, 91, 13, 66,100,194, 76,219, 98, 80,112, 0, 0, 32, 0, 73, 68, 65, 84, 62,124, 17,189,183, 1,149, 82, 77,104,117,
+154, 42,101,194,151,165, 7, 20, 44, 15,124, 89,122, 47,211, 62, 27, 54,222, 52,108, 1,128,141, 55,134,122, 14, 29, 94,104, 68,
+234, 94,214,217,215,231, 48, 89,174, 1, 64,206, 3,193,186,131, 99, 99, 0,118, 33,128,219, 85,214, 35, 8, 21, 88,110, 14,120,
+132, 39,204,184, 13,150, 91, 12,224,206, 75,179,247, 13, 66,165, 84,147, 40, 24,125, 36, 84, 74, 53, 11,128,125, 17, 71, 91,232,
+248,121, 40,188,159,169,148,106, 51, 0,166,170,154, 47,219, 62, 27, 54,222, 84,108, 57, 0, 21,176,123,170,250, 75,145,144,247,
+ 41,203,129,164, 40,230,244,160, 69,154,149, 21,191,203, 70, 85,120, 91, 2,128,122, 55,199,202, 0,140,166,204,204,144,200,152,
+ 28,167,230,245, 21, 79, 69, 60,222, 30, 16, 88,123,175,201,186,220, 42,233, 17,196, 87, 20,109, 30,118,234,186,209,185,195, 7,
+162, 12,169, 80, 16, 4,112,235,171,162,103,161,127,135,111,148, 18,137, 36,136,166,233, 97,187, 79, 45, 79,175,170, 78, 73, 84,
+ 74,181, 2,192, 87, 0, 90,163, 96, 39,129,107, 0, 54,107,117, 26, 93, 5,239, 35, 26, 53,106, 36,112,116,116,188,238,224,224,
+208,176,180,115,204,102, 51,107, 48, 24,100, 27, 14,254,108,213,126,238, 42,165,154,168, 83,167,142,200,195,195, 35,202,222,222,
+190, 65,105,231,176, 44,203,230,231,231, 87,168,105,141,125, 12,195,176,122,189,222,106,251,108, 84,157, 93, 43, 78,147, 0,112,
+231,206, 29, 34, 42, 42,234, 91,169, 84,250, 63, 62,159,239,198,178, 44,161,215,235,159, 24,141,198, 16,111,111,239,192,142, 29,
+ 59,150,250,127, 63,104,130, 15, 91,154, 30, 0,204,155, 55,175,181,163,163,227,232,198,141, 27,215,139,139,139,123,244,232,209,
+163,157, 29, 58,116, 56,121,246,236,217,110,238,238,238, 67,189,189,189,221,111,223,190,125, 47, 51, 51,115,195,244,233,211,175,
+150,167,247, 42,236, 3,128, 35, 71,142,116, 3, 96,169, 11,177,168,103,207,158, 39,203,187, 94, 37,245, 44,248, 29,186,220,134,
+ 37,112,201,242,154,227,136,238,127,246,249,240, 4, 96,197, 8,128, 74,169, 38,221,220,220,124, 21, 10,197, 56,131,193,224, 35,
+149, 74,207,229,228,228,172, 77, 74, 74, 58,161,213,105, 94,218,218,209, 23,229,243, 78, 19, 91,146, 36,249,173, 82,233,208, 91,
+167,203, 58, 70,146,228,154,223, 67,150, 92,124, 81, 93,142, 67,171,201,227,231,244, 35, 97,192,252,101,243, 56,148,216, 24,163,
+ 60, 84, 74, 53,169, 80, 40,186, 10,133,194,175,245,122,125,115,169, 84,250, 55,128,245, 25, 25, 25,199, 10, 55,185,169, 20, 42,
+165,186, 30,128, 81, 0, 62, 5,224, 14, 32, 9,192,113, 0,155,180, 58,205,221,202,234,117,106,236,255,129, 92, 46,159, 66, 16,
+196, 71,121,121,121,238,114,185, 60,137,227,184,203, 57, 57, 57,139,207, 68,239,142,172,138, 30,159,207,159, 66, 16,196, 71, 52,
+ 77,187, 11, 4,130, 36, 0,151, 77, 38, 83,149,244, 58,190, 87,173, 23, 45,148, 46,166, 72,137, 71,174,209, 44,180, 19,243,105,
+ 1,107,120,196, 51,229, 79, 61, 23,251,244, 64,101,245, 94, 26, 36,231, 10,134,232,252,224,137, 65,150,174,163,221,162, 31,228,
+209,205,234,217,119, 2,143, 61, 8,160,242, 14,155,228, 92,193,114,157, 99, 18,244,242, 43,241, 46,174,246,178, 52,250,163, 6,
+252,206,224,113,135,170,164, 87,136, 72, 36, 26,203,113, 92, 87,129, 64, 48, 17,192, 79, 85,213, 41,142, 74,169,254,208,193,193,
+ 97,115,191,126,253, 76,181,107,215,174, 35,151,203, 73,189, 94,239,189, 97,195,134, 97, 42,165,122,172, 86,167, 57, 95,214,123,
+235,214,173, 43,116,113,113,185, 88,171, 86,173,250, 91,183,110,197,245,235,215,209,170, 85, 43,208, 52, 13,179,217, 12,150,101,
+225,239,239, 79, 26, 12, 6, 49,128, 10, 29,172,197,249,215,169, 83,231,162,135,135,135,106,203,150, 45,184,123,247, 46,188,189,
+189, 65, 16, 4,204,102, 51, 12, 6, 3, 70,143, 30, 77, 2,168, 80,179, 44,251, 88,150, 5, 77,211, 96, 24, 6,131, 7, 15, 38,
+245,122,189, 85,246, 89, 24,222,253,135, 4,154,166,173,170,186, 40, 20, 10,211, 69, 34,145,219,134,131, 63,151,185,164,242,101,
+235,189,233, 60,120,240,224,183, 17, 35, 70,124, 94,191,126,125,190,229,119, 97, 48, 24, 26, 68, 69, 69,117, 12, 9, 9,105, 5,
+ 96, 96,101,244,230,204,153,211, 99,202,148, 41, 27,231,204,153,227, 34, 16, 8, 8,154,166,185, 61,123,246,124, 50,102,204,152,
+ 27,219,183,111,111, 58,112,224, 64, 69, 97,251, 71,179,102,205,234, 62,103,206,156,128,153, 51,103,238,126, 93,246, 21,227,135,
+ 47, 23,158,238,192,114,192,111, 63,118, 2,128,114, 3,128,178, 96, 9,156,201,227, 12,146,147,125,124,140, 0,240,217,225,203,
+198,110,135, 78, 59,156,236,227, 83,246, 78,128, 62,141, 6,169,236,237,237,199,122,122,122, 14,113,118,118,166,250,246,237,155,
+208,187,119,239,240, 67,135, 14, 57,255,245,215, 95, 27,132, 66,161,164, 95,187,175,119, 61,125,250,116,173,230,238,158,232,170,
+125,191,202, 83,154,163, 7,160,111,243,209,135,225,211,166, 77,227,187,186,214,144,198, 39, 62,236,189,116,201,210, 79,253,125,
+ 3, 62, 9, 10, 11,188, 98,173,246,238,169,234, 47, 5, 2,222,167,192,243,189,125,142,201,135, 57,251, 23, 16, 4,172,114,218,
+ 45, 61,122,212,147,201,100,223, 40, 20,138,255,169, 84,170,196,145, 35, 71, 94, 54,153, 76, 49,124, 62,159,221,185,115,103, 0,
+ 77,211, 43, 59, 53,246, 63, 97, 48, 24, 86, 93,138, 59, 88,225,181, 43, 28,226,156, 64,146,228,183,173, 90,181,250,139, 97,152,
+123,225,225,225,243,186,118,237,250, 25,199,113, 92, 68, 68,196, 17,149, 82,189, 17,192, 18,107, 2, 11,149, 82,205,243,246,246,
+158,237,238,238, 62,105,221,186,117, 98, 47, 47, 47,200,100, 50,228,228,228,212,214,106,181, 30, 19, 38, 76,232,253,105,203,145,
+ 43, 29, 28, 28,166, 7,133, 5, 86, 88, 0, 92,165, 84,243,220,221,221,103,187,186,186, 78, 90,178,100,137,184, 94,189,122,144,
+ 74,165,120,244,232, 81,237,136,136, 8,143,229,203,151,247,238,242,193,208,149,206,206,206, 86,233,253, 60,112, 32, 63,228,239,
+179,193, 14,222,205,125,214,111,220, 76,184,202,229,224,243,120,160, 41, 74,144,148,151,231,245,205,216,209,123,218,214,119,187,
+160,250, 72,213,101,219,182,211, 84, 69,122, 47,147,122, 55,199, 10, 1,116, 96,193,186,198, 61,214, 59,127,212,174, 51,255,244,
+169, 16,151,247,235,218,101,243, 57,162, 99,189,155, 99, 19,239, 53, 89,103,181,115,168,119,115,172, 16, 44,241, 49, 75,176,110,
+151,239, 11,157,235,181, 30,201,191,118,115,169,115,171, 6,172,142,207,146,234,122, 55,199, 62,170,140,158, 5,127,223, 0, 1,
+159,207, 15, 24, 54,108, 24,185, 99,199,142,111,254,215,234,203, 57,199,174,109,121,161,237,148, 85, 74,181, 92,161, 80,108,251,
+250,235,175,171, 13, 31, 62,252,182,187,187,251,182,156,156,156,115,151, 46, 93,170,191, 97,195,134,201, 99,198,140,217,162, 82,
+170, 91,107,117,154,127,108,116,163, 82,170,201, 78,157, 58,133,184,185,185, 53,221,186,117, 43,201,231,243,113,245,234, 85, 36,
+ 37, 37,161,102,205,154, 80, 40, 20,144, 72, 36, 96,217, 74,197,197, 60, 79, 79,207,208, 90,181,106,125,176,101,203, 22,146,207,
+231,227,210,165, 75, 72, 74, 74,130,171,171, 43, 40,138, 66,110,110, 46, 24,134,129,131,131, 67, 69,223,205, 42,251,172,221, 91,
+191, 56, 12,195,184,133,135,135,195,222,222,190,220,243,116, 58, 29, 62,249,228, 19, 71, 20,116,204,202,116,216, 12,195,184,157,
+ 62,125, 26,197, 11,243, 36, 39, 39, 99,243,230,205, 24, 55,110, 28, 28, 29, 29,139,218, 6, 12, 24, 80,161,222,155,142, 68, 34,
+105,208,175, 95, 63,126, 90, 90, 26, 4, 2, 1, 40,138, 66,114,114, 50,234,214,173,203, 59,124,248,176,170,178,122, 42,149,106,
+244,130, 5, 11,170, 31, 59,118,140,250,253,247,223,141, 93,186,116, 17,142, 28, 57,210, 94,173, 86,183,119,119,119, 39,183,110,
+221,106, 12, 13, 13,165,134, 12, 25, 34,254,229,151, 95,170, 7, 7, 7, 15, 2, 80,102, 0,240,178,237,179, 64, 16,132, 27, 7,
+224,248, 13, 3, 56,142, 83, 86, 85,167, 60, 74, 13, 0, 62,109, 57, 50, 84, 44, 22,127,212,169, 83,167,132, 47,190,248, 34,162,
+ 69,139, 22, 25, 0,242, 0,152, 26, 52,104,144, 60,109,218,180,187,145,145,145,138, 45, 91,182,180, 9, 13, 13, 29,214,181,233,
+176,164,132,132,132, 70, 85,233,213, 86,134, 33, 93, 39, 53, 45,114,244,213, 93,165, 15, 19, 30,246, 14, 12, 12,252, 52,226,106,
+164,102,218,212,169,228,130, 95, 22, 74, 7,250,247,199,158,160,253,178,225, 35,134,101, 93,187, 18, 49, 14,128,213, 1, 0,199,
+161,213, 15,227,103,244, 35, 73, 96,126,224,108,110,247, 84,117,190, 80, 64,118, 93,180,114, 33,104, 51,226, 8, 2,193, 21,105,
+ 52,117,251, 36, 76, 34,145,120,250,249,249,157,154, 53,107, 86,160,147,147, 19, 13, 0,187,118,237,170,217,191,127,255, 39,227,
+198,141,123,160,211,233,248,115,231,206,253, 96,231,206,157,127, 53,117,251, 36,249,198,147, 19,237, 43,144,253, 86, 38,147,245,
+184,122,245,234,252, 5, 11, 22,180, 30, 62,124,120,152, 66,161,224, 86,175, 94, 29,178,104,209,162,214, 59,119,238,252,185,121,
+243,230,131,242,243,243, 1,224,215,138,108,244,244,244,156,229,231,231, 55,105,222,188,121, 98, 30,239,217,126,240, 74,165, 18,
+109,218,180, 33, 52, 26,141,120,202,148, 41,227,143, 31, 63, 46, 2, 48,177, 34, 61,119,119,247, 89, 3, 6, 12,152, 52,111,222,
+ 60,177,193, 96, 64,102,102, 38,210,211,211,161,215,235, 81,175, 94, 61, 98,227,198,141,226,197,139, 23,143,191,118,237,154, 85,
+122, 33, 55, 52, 39, 6,126, 61,197,103,220, 55, 19, 10,162,233,169, 83,193,236,223, 15, 94,215,174,168,190,122, 53, 14, 31, 61,
+ 78, 4, 46, 93,220,238,240,182, 85, 97, 0, 58, 84,164,247,146,169, 14,144,190, 9,201,249, 18, 87,143,198,114,231,247,122,193,
+ 49,242,180, 36, 58, 33,207,174,137,167,189, 47,192,157, 0, 96,205,238,122,207,244, 72,116,137,127, 98,144, 8, 92,186,202,154,
+ 52, 87,227,228,253,163,226,155,177,183, 20,205,235, 41,124,193, 33,164,146,122, 22,252, 90,180,104, 33, 82,171,213, 8, 15, 15,
+231, 49, 12, 51, 4,192,150, 42,232, 20,103,196,103,159,125,102,240,247,247,191, 94,175, 94,189,174, 0, 30, 73, 36, 18,161,131,
+131,195,222,156,156, 28,201,154, 53,107,250,245,234,213,235, 43, 0, 75,138,191,169, 48,128, 37,229,114,121,135, 77,155, 54,129,
+207, 47,184,237, 8, 4, 2, 72, 36,146,231, 30, 0, 96,103,103,167,155, 52,236,153, 4, 77,211,108, 76, 76,140,236,228,245,237,
+198, 18,154,124, 59, 59,187,118, 27, 55,110, 44,210,212,235,245,208,235,245,200,206,206, 46, 42, 28, 83, 17,149,181,175, 42,136,
+ 68, 34, 28, 62,124, 24,124, 62, 31, 66,161,240, 31, 15,145, 72, 84, 84,225,206, 90,189, 51,103,206, 60,167, 7, 0,114,185, 28,
+167, 78,157,130, 66,161,128,101,191,252,183, 29,142,227, 88, 0, 56,123,246, 44, 82, 82, 82,144,150,150,134,180,180, 52,120,120,
+120, 20, 29,171, 12,247,238,221, 91,217,162, 69, 11,242,250,245,235,127, 53,111,222,124,243,222,189,123,251,102,102,102,174,157,
+ 52,105,146,211,146, 37, 75,158,254,240,195, 15, 95, 55,107,214,236, 96,175, 94,189, 70, 52,105,210,164,215,173, 91,183,150,247,
+233,243,143, 42,211,175,204,190, 98,186,247, 15,107,238,215, 5, 64, 1,168,244, 8,111,113,228,132,196,240,217,225,203,255,104,
+ 47, 53, 0, 48, 26,141, 29,223,127,255,253,228,200,200, 72, 89,163, 70,141,114, 90,180,104,145, 82,236, 48, 13, 0,231,206,157,
+179, 59,119,238,156,189, 76, 38, 75, 78, 79, 79,175, 91,167, 78, 29, 33, 42, 49, 44, 86, 21, 88,150,253,250,153,163,255, 12,123,
+130, 14,200,134, 13, 31,154, 21, 19, 29,211,205,165,186,171,216,127,232, 64, 24, 12,122,248,125,222, 15, 18,177,216,193,217,197,
+185, 87,121,122, 62,141, 6,125,233,236, 40,251,148,199, 39,200,148,180,188,211,163,122, 0, 44,107, 0,171, 91, 12,130, 0,203,
+113,104,245,195,196,185,158,133,195,255, 55,253,230,107, 42,188,129,114, 28, 87,211,221,221,253,225,206,157, 59, 59, 61,121,242,
+196,188, 97,195,134,219, 78, 78, 78,116,181,106,213, 76, 60, 30, 15, 58,157,142,255,213, 87, 95,125, 16, 18, 18,210,217,222,222,
+ 62, 49, 39, 39,167, 86,121,122, 42,165,186, 46, 73,146, 19,207,159, 63, 63,167, 97,195,134,166,148,148, 20, 71, 31, 31,159, 76,
+ 0,104,217,178,101,142, 78,167, 83,184,186,186,154, 15, 31, 62,188,167, 75,151, 46,211, 85, 74,245,145,242,166, 3,124, 26, 13,
+106, 94,171, 86,173,127, 56,255,226,208, 52,141, 31,127,252, 81,124,254,252,249,175, 58, 53,246,223,115,234,118,208,165, 82, 79,
+ 44,212,115,113,113,153, 52,127,254,124,177, 78,167,131, 80, 40, 68,237,218,181,145,152,152,136,248,248,120,228,231,231,131,101,
+ 89,140, 30, 61, 90, 28, 19, 19, 83,161, 94, 7,111,101,111, 89,157,166, 62,227,190,153, 0,195,168, 81, 48,109,221, 10,234,225,
+ 67,224,135,130,169, 48,161, 82, 9,198,199, 7, 19, 14, 30,196,137,227,199,219,170,189, 29, 63,215,196,101,150, 25,157,191, 76,
+234,221, 28,203, 3,208, 12, 4,171,138, 73,204,171,214,174, 71, 15, 1,158,158, 70, 35, 79, 59,126, 88,100, 70,245, 38, 94,118,
+ 94, 0,209,170,222,205,177, 79,238, 53, 89, 87, 97,143,171,222,205,177, 60, 16,196, 7, 0,219,224, 66, 12,233,162,234, 60, 64,
+144,156,156, 12, 39,143, 78,252,139, 49,183, 92,155,215,227,234,130, 35, 91, 88,171, 87, 28,129, 64, 48,171,111,223,190,242,228,
+228,100,124,252,241,199,178,212,212,212,153,120,241, 0,160,181,151,151,151,167,135,135,199, 41, 0,233, 0,130,111,221,186,245,
+208,199,199,135,233,219,183,239,197,101,203,150, 77, 38, 73,178,117, 25,239, 37, 24,134, 65,100,100, 36,174, 95,191, 14, 62,159,
+ 15,103,103,103, 40,149, 74,200,100, 50, 72, 36, 18,136,197, 98, 12, 26, 52, 8,254,254,254,160,105,186,104,216,125,232,208,161,
+164,131,131, 67,169,195,238, 12,195, 64,171,213,226,226,197,139,200,207,207,135, 66,161, 0, 65, 16,208,233,116,208,106,181, 72,
+ 76, 76, 68, 94, 94, 30,164, 82,233,170,239,135, 46,158,186,116,231,228,164,242,236,187,126,253, 58, 34, 35, 35,203,180, 15, 64,
+133,163, 9,165, 65,211, 52,252,252,252,192, 48, 12, 4, 2, 1, 4, 2, 1,132, 66, 33, 4, 2, 65,145,243, 63,115,230,140,213,
+122, 20, 69,161,107,215,174, 96, 89, 22, 2,129, 0,151, 46, 61,251,151, 26, 56,176, 96,196,249,202, 21,171,251, 62, 80, 41,213,
+100,141, 26, 53,254,207,215,215,183,191,179,179,179,195,227,199,143,179,206,158, 61,123, 40, 37, 37,101,163, 86,167,169,244,232,
+129, 74,169, 38,157,157,157, 71,244,236,217,179,191,147,147,147,227,147, 39, 79, 50,195,194,194, 14,165,166,166,110,174, 76, 71,
+241,222,189,123, 77,188,189,189, 93,247,220,114, 68,182,160, 1, 24,190, 17,172,144, 6, 83,173, 14,238, 9,155,161,102, 77,109,
+245,160,160,160,182,254,254,254, 86, 79,247,206,152, 49, 35, 20, 64,104,175, 94, 5,238,161,103,207,158,251,127,248,225, 7,122,
+242,228,201,131, 73,146,220, 61,115,230,204, 63, 11,219,183, 0,216, 82,158,243,127, 21,246, 21,227,209,255,179,247,230, 97, 77,
+156,109,251,240, 57,147,153, 76, 86, 32,132, 29, 65,197, 5,173, 90,119,171,182,138, 11,238, 75,221, 23,180,173,214,221,214,106,
+177,238, 75,107, 91,173, 91,177,174,213,186, 87, 68,171,214,125,171,160, 8, 85,107,213,170, 85,177,197, 42,171, 34, 32, 16,132,
+ 4,146,204,246,253, 1,147, 6,133, 16,180, 79,159,231,253,126,158,199, 49, 71, 72,152,156,185,103,230,158,185,214,251,186, 80,
+ 34,252,141,162, 40,190,112, 9,235, 31,223,110, 93, 97,115,164, 10, 67, 0, 95,126,249,229,245, 43, 87,174,228, 29, 62,124,184,
+241,134, 13, 27, 90,247,238,221,251,202,212,169, 83, 31, 47, 93,186,212,255,196,137, 19, 45,212,106,117, 78,195,134, 13,227, 3,
+ 3, 3,139,118,239,222, 61,225, 69, 7, 87, 21,104,181,218, 62, 94,222, 62,154,103, 5,189, 66,161,192, 31,127,220, 69,212,174,
+ 31, 48,112, 72, 63,236,223,123, 16,157,187,116, 16,158,100, 63, 57,230,136, 79, 20,197,150,151,175,254, 62,128, 32, 72,140, 26,
+ 20, 80,157,166, 72,183,149,235, 34, 0,200, 64, 0,111, 0,130,165,170,238,127,146, 36,217, 77,155, 54,237, 75, 79, 79, 87,173,
+ 89,179, 38,164, 86,173, 90, 61, 95,127,253,245,159,195,194,194, 82, 63,255,252,243,134,191,253,246,219,155,222,222,222, 55, 7,
+ 13, 26,180,222,207,207,207,180,114,229,202,169,149, 80,142,105,211,166,205, 15,126,126,126, 66,122,122, 58, 99,181, 90,229,201,
+201,201, 10,158,231, 9,153, 76, 38, 22, 23, 23,211,183,111,223,150,115, 28, 39, 52,106,212,104,247,173, 91,183,198, 3,248,184,
+ 34, 50,181, 90,253,193,119,223,125,167,172, 72,248,231,231,231, 35, 51, 51, 19, 44,203, 98,230,204,153,202,207, 62,251,108, 42,
+128, 10, 5, 54, 77,211, 31,172, 94,189, 90, 89, 92, 92, 12,133, 66, 1,150,101,113,233,210, 37, 24, 12, 6,152, 76, 38, 24,141,
+ 70,155, 18, 48,116,232, 80,229,182,109,219, 28,242, 89,228,170,175,190,223,178, 13, 44,203,194, 18, 25, 89,238, 62,214,159,126,
+ 2,204,102, 44, 93,241, 53,241,209,232,193,139,225,192, 61, 39,161,110,198,100, 57,178,121, 63, 0, 53, 64,139,247,192,250,102,
+223,107, 82,229,184,168, 7, 8,116,205,204,177, 48,180,210,203, 69,235, 81, 23, 72,220, 5, 95, 61, 3,130, 32,148,247,210, 77,
+234,186,213, 52, 93, 1, 92, 4,144, 89, 25, 25, 0, 15,136,232,250, 40,215,162, 40,162,234,105,189,253,106,226,198,141, 27,208,
+251,212, 67,206,125,111,197,159,105,217,154,122,129, 46, 93, 33,226, 23, 39,249, 0, 0,195, 58, 77,107, 95,171, 86, 45,159,154,
+ 53, 75,248,234,214,173, 11,173, 86,235, 30, 22, 26,222, 53, 42, 38,226, 76, 21,143,185, 12, 92, 93, 93,145,147,147,243,179, 86,
+171,101,174, 93,187,150,218,174, 93,187, 60, 0,158, 5, 5, 5,238, 26,141,166,220,214, 66,165,157, 29, 5, 0,104,222,188, 57,
+ 36, 69,209,205,205, 13,111,188,241, 6, 0, 32, 61, 61, 29,110,110,110,136,137,137,129,191,191, 63,212,106, 53, 24,134, 1,195,
+ 48,229,186,221, 75, 57, 57, 0,168, 93,187, 54,178,178,178, 96, 52,150, 52, 34,188,117,235, 22,218,183,111,143, 73,147, 38, 65,
+171,213, 34, 43, 43, 11, 87,175, 94,237,190, 98,197,138,190,211,223, 89, 49,242,235, 93, 51,142,149,195, 37, 0,192, 27,111,188,
+129,220,220, 92,219,248,220,221,221,161, 82,169,160, 80, 40,108, 10,192,139,128,227, 56,156, 60,121,178, 66, 15,128,164, 12, 84,
+133,239,210,165, 75, 54, 69, 66, 46,151,131, 32, 74, 78,255,169, 83,167,224,234,234, 10, 23, 23, 23,167,184,130,117, 33,100,135,
+ 14, 29,162,118,237,218, 21,196,113, 28, 9, 0, 44,203,186,167,165,165,189, 55,107,214,172, 14,193,186,144,176,170, 40, 1,193,
+186, 16,242,205, 55,223,220, 21, 25, 25, 89,135, 97, 24,178, 52,191,195,235,221,119,223, 29, 51,111,222,188, 78,193,186,144, 17,
+206,230,143,229,230,230,126, 27, 25, 25, 25,176,254,162, 22, 63, 91,123,225,190,216, 31,188,187, 0, 95,198,128,250,218, 52, 52,
+169,214,195,103,215,174, 93,107, 0,180,112,118,124,229, 97,225,194,133, 71, 0, 28,169,234,247,254,147,227, 19, 69,145, 71,137,
+231,189,144, 32, 8, 11, 0, 28, 62,124,152,201,205,205,109,166,215,235,175,247,235,215,207,169,144,222,124,157,222,172,134,218,
+109,142, 33,205,252,236,251, 10, 21, 0,130, 32,196, 26, 53,106, 20, 76,153, 50, 37, 54, 55, 55, 87,113,244,232,209, 38,109,218,
+180,233,228,233,233,249, 71,235,214,173,143,169, 84,170, 98,130, 32, 8,158,231,157,159,181, 47,137,194,194,194, 99,169,169, 41,
+ 67,162,118,253,224, 42, 9,250,129,131,250, 97,236,216,113,120,244,240, 17,198,142,127, 31, 36, 73, 96,240,208,129,216,178,121,
+ 43, 9,224,187,202, 56, 73,130,192,147,156, 28,184,107, 88,183,217,211, 22,214, 36,169, 82,183, 25,159, 85,109,201,170, 37,201,
+ 95, 70, 44,217, 4,160, 29, 77,145,111,252,184,160,211, 33,103, 87, 2, 4, 4, 4, 20,173, 88,177,226,148,209,104,140, 94,189,
+122,117,235,240,240,240,209,254,254,254,231,134, 12, 25,178,220,213,213,149,173,194,205,254, 86,112,112,240,175,103,207,158,245,
+244,243,243, 43, 22, 69,145,112,113,113,225, 92, 92, 92,120,131,193, 0,142,227,196,164,164, 36,249,253,251,247, 21,122,189,158,
+ 7,240, 92,167, 48,123,208, 52,221, 54, 40, 40,168,220,255,229,231,231,227,241,227,199,120,252,248, 49,158, 62,125, 10,141, 70,
+ 67,144, 36,217,218, 17, 31, 65, 16,109,107,215,174,141,188,188, 60, 84,175, 94, 29,113,113,113, 40, 44, 44, 44, 35,252,141, 70,
+ 35,172, 86, 43,124,125,125, 9, 0, 14,249,120,153,170,134,159, 86, 11,203,252,249,176,222,187, 7,200,229,144,215,168, 1, 88,
+ 75, 66,253,214,228,100,128, 97, 64, 78,156,136,218,147, 38,129, 3,227,208,131, 2, 0,117,111,190,167, 0,169,110, 11,146,248,
+ 0, 32, 60, 33,136, 41,160,178,215,215,125, 16,126,253, 94,173,202,115, 18, 0,160,238,173, 73, 4,100, 98, 93, 8, 68,203,219,
+201,133,250, 38,111, 14,102,144,119, 1, 16, 89,128,144,161,217,107,129,244, 47,119,211,125,234, 86,211, 52, 5, 73,212,175,123,
+107, 82,214,189,215,191,173,112,233, 88,221, 91,147, 8, 16, 68,109,136, 98,171, 43,127,114,250,218, 45,223,151,103,103,103, 67,
+ 46,151, 67,161, 80,160,122,195, 33,212,249,132, 85,190,245, 2,196,102,224,137,122,149,241,217, 67,161, 80, 44, 24, 54,108,152,
+214,158,175,103,207,158,154, 3, 7, 14,124, 10,224,101, 20,128, 43,133,133,133, 13, 18, 18, 18, 94, 59,126,252,248,254, 25, 51,
+102,192, 98,177,232, 1,184,143, 29, 59,182, 71, 86, 86,214, 3, 65, 16,174, 84,240, 93,155, 2,237,235,235, 11,133, 66, 1,149,
+ 74,133,204,204, 76,168,213,106,104,181, 90, 60,126,252, 24, 26,141,198,102,109, 75, 10, 0, 80,161,213,109, 19, 34, 30, 30, 30,
+160, 40, 10, 23, 46, 92,192,196,137, 19,193,243, 60,126,255,253,119,108,223,190, 29,227,199,143, 71,195,134, 13, 61, 54,109,218,
+244,120,252,248,241, 81, 31,143, 88,214,112,213,238, 89,169,207,112,217,198,231,231,231, 7,134, 97,160, 82,169,160, 82,169,108,
+202,136, 20, 26,120, 17,112, 28,135,129, 3, 7,130, 32, 8,155, 7, 64,178,252,165,227,140,142,142,174, 18, 95,159, 62,125, 32,
+138, 34,228,114, 57, 98, 99, 99,109,255, 27, 49, 98, 4, 8,130,192,197,139, 23,157,226,242,245,245, 29,251,253,247,223, 7, 89,
+173, 86,210,104, 52,218, 20,138, 70,141, 26,201,102,204,152, 17, 56,109,218,180,137, 0,214, 57, 59, 54,119,119,247,247,118,237,
+218, 85,135, 97, 24, 50, 35, 35, 3,111,189,245, 22, 46, 95,190,140,214,173, 91,203,102,204,152, 81,253,131, 15, 62, 24,135,202,
+ 59, 10, 2, 0, 68, 81, 36, 56,142,195,132, 55, 12,152,212,134, 4,199,113, 48, 24, 12, 72, 77, 77,197,237,219,183,113,249,242,
+109,103,135, 85, 6, 59,118,236,120, 95,163,209,116,163,105,186, 6,199,113,164,201,100, 74,181, 90,173,209,109,218,180,249,174,
+ 65,131, 6, 78, 47,249,252, 79,141, 47, 35, 35, 67, 70, 16,132,174,142,175,210, 72,146, 48, 94, 16, 4,253,150, 45, 91, 70, 9,
+130,208,181, 70,141, 26,158, 41, 41, 41, 79, 54,111,222,124, 90,171,213, 30, 28, 54,108,152, 83, 45,184, 37,193, 15,152,108,159,
+149, 59,163, 69, 81, 36, 96,119, 67,232,245,122,243,232,209,163, 47,223,190,125,219,191,105,211,166,101,172, 55, 65, 16,254,181,
+245,177, 36, 73,110, 88,190,124,249,144, 17, 35,134, 67,231,174, 67,247,158, 93, 17, 19,125, 14,249,249, 79,161, 80, 40,160, 84,
+ 42,225,234,230,138,160,154, 65,120,112, 63,137,151,201,100,204, 59,221,102,152, 0,152, 84, 42, 85,185,153,176,130, 40,194, 90,
+ 42, 92, 4,161, 24,194,147,207, 33, 29, 58, 37, 35, 25,130, 36,188,173, 86,158,153, 61,109, 97, 53,146,224,170, 85,117, 37,128,
+ 70,163,225,230,205,155,119,225,252,249,243,111,180,111,223, 62,190, 42, 90,126, 41, 26, 14, 28, 56,112,111,207,158, 61,243, 0,
+ 64, 46,151,179, 94, 94, 94,172,193, 96,128,209,104, 4,199,113,188, 86,171, 53,250,249,249, 25, 27, 54,108,248, 52, 54, 54,182,
+220,165, 80, 18,138,138,138,170,171, 84,170,231, 62, 55, 24, 12,200,204,204, 68, 70, 70,134, 45,142, 85,179,102, 77, 24,141, 70,
+127, 71,124, 60,207, 87, 87, 40, 20,120,252,248, 49,114,115,115,203, 8,127, 73, 1,176, 90,173,224,121, 30, 42,149, 10, 44,203,
+ 58,228, 43, 52,243, 12, 69, 16, 48,237,223, 15,124,248, 97,133,251,137,209,209, 80,189,249, 38,138,138,172, 14,159,202, 54,225,
+ 15,113,218,131,140,226,106,191,220, 49, 4,118,104,166, 87, 86,243, 84, 76,135,185, 40,162,238,131,240,223,156, 84, 2,220, 32,
+144, 93,159, 26,173,204, 83, 19,237,230, 81,227, 45,224,193, 98, 0, 50,128,118, 71,189,218,238, 56,245,107,186, 38, 35,183, 88,
+229,231,161,234,134,146, 22,200,185, 14,249, 32,118,205, 55, 90,149,105, 5, 30,110,111, 7, 55, 71, 66,194, 93,219, 60,118,175,
+223, 9, 9,151, 86,169,211,159, 20,171, 3, 60,149, 93, 0,220,174,132, 15, 0, 48,188,243,199,181,221,220,220,218, 52,107,214,
+140,184,123,247,111,190,182,109,219,226,224,193,131,141,135,117,154,246,218,222,115,223, 84, 57,105, 55, 88, 23, 66, 3,184,118,
+232,208,161,149, 13, 26, 52,104, 20, 24, 24,232, 30, 18, 18, 18,107, 54,155,117, 83,166, 76,233,209,167, 79,159, 94,141, 27, 55,
+126, 2, 96,115,121,223, 79, 52,196,137,225, 35,151, 67, 16, 4,184,184,184,216,198,229,233,233, 89,102, 63,173, 86,107,179,182,
+ 37, 37,160, 34, 36, 26,226,196,233,239,172, 0,203,178,176, 90,173,200,207,207, 71,187,118,237,192,243, 60,174, 95,191, 14,133,
+ 66,129,200,200, 72,140, 25, 51, 6, 70,163, 17, 46, 46, 46,190,239,188,243,206,189,253,251,247,175, 1,240,118,121,227,179, 31,
+131,164,136, 40, 20, 10, 72, 30, 51,138,162,192,113,156, 45, 71,193,217, 37,134, 60,207,227,212,169, 83,101, 44,246,151,241, 0,
+ 8,130,128,216,216,216, 50,138,132,132, 99,199,142,193,213,213,181, 76,146,160, 35,116,234,212,169, 31, 0,242,254,253,251,200,
+206,206,134,155,155, 27, 52, 26, 13,170, 85,171,134,206,157, 59, 83,117,234,212,233,133, 42, 40, 0, 61,123,246, 28,164, 86,171,
+201,148,148, 20, 36, 39, 39,195,108, 54, 35, 49, 49, 17,110,110,110,232,210,165, 11, 29, 28, 28,220, 23, 78, 42, 0, 15, 31, 62,
+252,113,233,210,165,250, 78,157, 58,213,162, 40,138, 48, 24, 12,200,206,206, 70,102,102, 38,210,210,210,196,228,228,228,251, 60,
+207,239,119,118,108, 0,112,228,200,145,205, 35, 71,142,124,167, 97,195,134,180, 40,138, 96, 89, 22, 38,147,169,217,229,203,151,
+251,254,252,243,207,237, 27, 52,104, 48,194, 89,174, 71,143, 30,237, 95,190,124,185,166, 67,135, 14,245, 41,138, 34,255,137,241,
+157, 58,117,170,165, 28,220,178, 73,213,216, 26, 61, 6, 5, 22, 42,149,148,113,208,113, 75,167, 58,117,218, 14, 92,178,100,137,
+ 75, 80, 80,144,230,230,205,155, 5, 95,124,241, 69,192,149, 43, 87, 8, 0, 59,171,194,111,143,138, 30,158, 36, 65, 16, 34, 73,
+146,162,189,251,173, 84, 49, 40, 3,158,231,255, 53, 5, 32,242,204,202,155,195, 58, 77, 11,189,121,227,247, 43, 11, 22, 46, 32,
+ 14, 31, 58, 2,185, 92, 14,165, 82,137,160,160, 32,228,231,231,227,147,142,243,113,252, 97, 36, 84, 42,149,117,200,144, 33,167,
+223,123,239, 61, 89,151, 46, 93, 24, 84,144, 9, 43,138, 2,172, 86, 43,242,140,174,110,211, 23,239, 72, 1, 60, 33, 8,188,168,
+161,243,148,139,231, 46,244, 35, 9,107,191,197, 17, 75, 32, 8,102, 8, 79,151, 59, 29, 10,144,240,248,241, 99,101, 97, 97, 33,
+ 37,138,162,204, 98,177, 80, 60,207, 19, 12,195, 56,101,117,150, 34, 49, 60, 60,124, 64, 86, 86,214, 79,195,135, 15,127, 4,148,
+ 8,235,172,172, 44,228,228,228,192,106,181, 34, 61, 61,157,188,112,225,130,111,116,116,116, 23, 0, 15, 28,145,169, 84,170,212,
+130,130,130,122,246, 9, 66, 6,131,193,102,249, 75, 91, 97, 97, 33,148, 74, 37, 52, 26, 77, 69, 49, 83, 0,128, 76, 38, 75,205,
+200,200,168,199,178, 44,178,178,178,202, 21,254, 64, 73,210, 82,105,150,172, 67, 62,173, 66,102,177,114, 28, 35,235,223, 31, 32,
+ 42,110, 86, 79,132,132, 32, 63, 40, 8, 74,149,188,194,115, 89, 55,103, 12, 3, 66,221, 6, 16,167,165, 60, 46,242,191,112,199,
+ 24,252,102,219, 46,170,195,209, 39,149,125,223,244, 33, 2, 61, 21,211, 97, 52, 69,212,125, 16,126,173, 82, 37,128, 32,124, 32,
+136,237,127,191, 95,168,107,214,166,151,130, 48, 38, 0,156, 17,144,235, 1,218, 29, 36,237,142, 86, 77,155,203,206,221,186,233,
+ 51,178,163,242, 45, 16,252, 94, 56, 20,216,164, 55, 68, 33,228,106,162, 89, 87,171, 69, 56, 83, 80, 80, 8,153, 76,102, 19, 56,
+ 74,149, 10,141,218,188, 79,158,189,181,213,119, 84, 39, 69, 59, 16,226, 62,199,124, 37,144,203,229, 51,135, 14, 29,202, 20, 22,
+150,229, 83,169, 84,232,223,191,191,226,224,193,131,243, 1,132, 85,198, 99,143, 96, 93, 72,181,198,141, 27,199, 79,156, 56,177,
+102,102,102, 38, 22, 44, 88, 96, 94,178,100, 73,231,239,190,251,110,156, 86,171, 37, 51, 50, 50,146,154, 53,107,246, 40, 49, 49,
+113, 82,121, 43, 0,254, 62,133, 4, 4, 65,128, 74,165, 2,195, 48,240,244,244,196,147, 39, 79,160,215,235, 33,245,119, 95,190,
+124, 57,150, 44, 89, 98,251, 78,118,118,182,205,181, 93, 17,138,139,139,145,159,159,143, 59,119,238,224,131, 15, 62,128,164,248,
+ 40, 20, 10, 16, 4, 97, 19,230, 36, 73,162,123,247,238,178, 29, 59,118,188, 85, 17,151,164,168, 50, 12,243,156,240, 7,128,160,
+160, 32, 44, 95,190,220, 54,222, 1, 3, 6,144, 38,147,169,210,101,129, 60,207, 99,200,144, 33, 32, 8,194, 38,240, 37, 5, 71,
+122, 61,126,252,184,195,227,180,135, 40,138, 54, 62,251,239, 18, 4,129, 81,163, 70, 65, 38,147, 33, 38, 38,198, 41, 46,189, 94,
+239, 46,138, 34,198,141, 27,135,180,180,191,243, 77,171, 85,171,134,180,180, 52,112, 28,167,119,122, 96, 0,220,221,221,245, 44,
+203,162, 67,135, 14, 40, 46, 46, 6, 80,146,151, 64,211, 52,178,178,178,192,178,172,135, 51, 60,219,183,111,151,135,134,134, 94,
+214,233,116,181,119,237,218,149,249,232,209, 35, 61,203,178,106,150,101,173, 69, 69, 69,127, 89, 44,150, 11,130, 32,196,140, 29,
+ 59,246, 90, 85,198,167, 86,171, 27, 15, 27, 54,140,206,205,205,181,101,237,103,103,103,163,121,243,230,178,152,152,152, 6, 85,
+225, 26, 60,120,240,170,173, 91,183,158, 63,122,244,104, 87,181, 90,221,130, 97, 24, 31, 65, 16,120,163,209,152, 85, 92, 92,124,
+163, 42,227, 59,122,244,104,119,146, 36,215,183,113,225, 92, 62, 12,176, 22,122, 49, 98,225,221,181, 83,140,183,170,171,138,204,
+197,108,181,165,107, 23,123, 10,130,136,249,243,231, 63, 30, 58,116,168,203,199, 31,127,220,104,216,176, 97, 93,143, 30, 61,186,
+167,111,223,190, 14, 87, 67,153, 96, 42,182,127,149, 80,161,245, 68,146,164, 83, 49,154,127, 83, 1, 0,128,189,231,190,185, 54,
+162,203,116, 94,224, 5, 74,114,157, 41, 20, 10,248,251,251,195, 98,177, 96,195,229, 8, 4, 6, 42,208,161, 67, 7,101,211,166,
+ 77,145,144,144, 0,251, 86,145,207, 66, 16, 74, 60, 0,223,238,186,169, 99, 24, 70, 7,148,184,215,102,143, 15, 76, 22,132, 98,
+ 8, 79, 87, 0, 64,242,226,136,165,103, 0,128, 32,112,181,178, 49, 26,141, 70,234,234,213,171,158, 25, 25, 25, 90, 47, 47, 47,
+ 99,163, 70,141,242, 8,130, 16, 1, 16,249,249,249,154,204,204, 76,181, 86,171, 53, 87,175, 94, 61,223,137, 67, 62,235,226,226,
+ 34,191,114,229,138,255,222,189,123,155,221,189,123,183,126,207,158, 61, 7, 90,173, 86, 88,173, 86, 60,122,244,168,254,234,213,
+171,121,133, 66,145, 77,146,228, 21, 0,207,155,247,118, 96, 89,246, 82, 98, 98, 98,112,235,214,173, 9, 0,200,203,203,179, 9,
+125,123, 15,128,135,135, 7, 10, 11, 11, 69, 65, 16,158, 79, 29,181,131, 40,138,151,126,253,245,215,224,198,141, 27, 19,246, 46,
+127,123,225,239,238,238, 14, 23, 23, 23,220,188,121, 83, 4,224,144, 79,198, 21, 37,167, 61,125, 90, 47,224,171,175, 32,119,115,
+ 3,172, 86,155,219, 31,128, 45, 28, 32,102,101,225,183, 43, 87, 64,139,150,135,229,241,212,205,152, 44, 71,158,162, 13, 8, 97,
+ 90,202,227, 34,255,248,219,133,245, 6,189,251,153, 74, 77, 26,208,203,248,155,234,135,216,204,134, 3,218,121,145,181,252, 85,
+225, 48,153, 86,213,221, 23,126,245,222, 16, 7, 74, 0,207,107, 32, 35,212,105,217,197,174,117,155, 18, 4,114, 98, 0,218, 29,
+160,117, 37,175,114,119,120,120,139,196, 79, 63, 95,112, 3,225,169, 0, 47,243,113,116,156, 16, 56, 45,100,132,230,175,199,162,
+107,157, 96,119, 34, 39, 39,167,140,229,171, 80, 40,224, 83,173, 1,241, 91,188,209, 21,164,187, 10, 4,233, 11,224,119,135,156,
+ 0, 68, 81,236,163,211,233,168,220,220,220,231,248,130,130,130,100, 44,203,118,175,140,195, 30,193,186,144,106, 77,155, 54,189,
+ 24, 31, 31, 31,152,148,148,132,240,240,112,220,190,125,187,119,159, 62,125,154,160,138,133,128, 74,199,103,187,103, 89,150,125,
+206,234, 93,181,106, 21,250,245,235, 7,165, 82, 9,127,127,127,167, 18,239, 76, 38, 19,242,243,243,145,154,154, 10,134, 97,164,
+164, 83, 36, 37, 37,193,213,213, 21, 26,141,198,254, 60, 4,240, 60, 47,155,208,255, 83,197,179, 86, 59, 65, 16,224,121,190, 66,
+225, 15, 0, 74,165, 18,231,206,157,179,133, 42, 56,206,185,208,184, 40,138, 56,113,226,132, 67, 15, 64, 85, 66, 12,162, 40,226,
+228,201,147,101,190, 47,225,224,193,131,112,115,115,115,122, 85,193,195,135, 15,115, 1,120,159, 58,117, 10,217,217,217,182,207,
+107,212,168,129,220,220, 92,152,205,230, 28,167, 7, 86,194,151, 3,192,231,198,141, 27, 72, 78, 78, 70,143, 30, 61,112,232,208,
+ 33,180,108,217, 18, 60,207,195,106,181, 58,197, 87, 88, 88, 88,115,212,168, 81,163,115,115,115,169,109,219,182,237,204,204,204,
+140,159, 59,119,238,125,251,125,190,252,242,203,230,139, 22, 45, 90, 14,128, 6,224, 3,128, 35, 8,226,204,194,133, 11,119, 85,
+196, 43,138,162, 64, 16, 4,206,159, 63,255, 92,214,190, 80,197,117,168, 0,240,228,201,147,188,102,205,154, 53, 73, 76, 76, 60,
+ 60,101,202,148,221,207,254,127,229,202,149,125, 27, 54,108, 56,252,198,141, 27, 11,231,204,153,243, 87, 69, 60, 4, 65, 44,143,
+255,100,128, 11, 4,190, 48, 47,122,143,113, 93, 26, 99, 60,126,227, 86,188,169,184, 88, 86,171,118,237, 6, 53,106,212,162, 23,
+ 44,156,149,121,227,206, 47,201, 57, 57, 57,190, 51,102,204,168, 89,183,110, 93,191,164,164,164,186,112, 80,133,244, 75, 67,110,
+ 57,201, 43, 37,182, 68, 69, 51,142,224, 56,142,119,115,115,115, 47, 40, 40, 40,176, 88, 44, 82,178,129, 77, 21,167, 40,138,164,
+105,154,176, 90,173,255,149,122,229,162, 40,194,203,203, 11, 30, 30, 30,240,243,243,131,167,167, 39, 30, 61,122, 4,165, 82, 9,
+138,162, 16, 23, 23, 87,156,156,156, 44,175, 95,191,190,204,209, 53, 21, 75, 67, 0, 73, 73, 73, 32, 73, 18, 50,153, 12, 36, 73,
+ 34,215,206, 35,144, 99, 32,159,158,191, 78,220,141, 77,216, 83,169,235,159,231,121,229,210,165, 75,219,191,246,218,107,233,237,
+219,183,127, 24, 16, 16, 80, 36,253, 14,195, 48,172, 70,163, 49,176, 44, 91,148,145,145,225, 21, 23, 23, 23, 36,138, 98,101,153,
+ 69,155,175, 93,187,118,118,195,134, 13,139,107,212,168, 81,220,183,111, 95,114,241,226,197,135,243,242,242,196,172,172, 44,124,
+253,245,215, 3,122,246,236,121, 56, 49, 49,145, 76, 72, 72, 88,132,146, 34, 65, 21,194,100, 50,173,255,240,195, 15,135, 95,184,
+112, 65,105, 54,155,159,179,252, 31, 63,126, 12,138,162,160,215,235,177,118,237, 90,179,209,104, 92,237,136,143,101,217,245,171,
+ 86,173, 26,182,109,219, 54, 21, 73,146,207, 9,127,133, 66, 1, 31, 31, 31, 60,125,184,244,248, 40, 0, 0, 32, 0, 73, 68, 65,
+ 84,250, 20,167, 79,159, 46,102, 89,214, 33, 31, 99, 45,154, 53,105,252,216, 35,167,163,207, 66,222,171, 23,172,135, 14, 61,183,
+143, 44, 40, 8, 86,150,197,231,139, 22,138,180,213, 56,187, 92,162, 52,222, 15, 42,242,195,180, 44,179,127,252, 29, 99,189,129,
+239,124,166, 82,203,140,192,163, 31, 80,179,154, 47, 6,116,241, 99,162, 78, 93,111, 56, 52,196,139,168, 27,160,153,136, 70,133,
+169, 40, 41,172, 84, 62, 72,170, 0,130,144,213,190,177,187,242,240,225,189, 76,175,183,234, 40, 2, 2,170,151, 42, 1,238, 72,
+126, 92,136, 93,251,163,132,225, 29, 60, 31, 64, 32, 30,129,132, 99, 55, 59, 73, 21, 64, 20,178,123,183,162,149,123,127,154, 81,
+171, 86,155,217,140,127,141,102, 54,193,147,243,248, 22,142, 71, 78, 16,134,119,112,127, 0, 17,143, 33, 86,194, 87, 10,142,227,
+ 6,175, 90,181,234,212,232,209,163, 53,141, 26, 53,178,241, 37, 37, 37, 97,217,178,101, 69,102,179,121,144, 51, 60, 64, 89,225,
+159,150,150,134,157, 59,119,226,226,197,139,137,137,134,184,179, 0,206, 58,203,243, 44,236,133,235,179,247,166, 90,173,182, 41,
+244, 57, 57, 57, 80,171,213, 14,185, 8,130,128,209,104, 68,126,126, 62, 24,134,193,227,199,143,161,213,106,177,111,223,190, 50,
+ 22,182,180,137,162,152, 38,147,201, 60, 42,114,217,139,162, 88,161,240, 7, 74, 20, 0,181, 90,109,203, 15, 0,156, 91, 21, 32,
+138,162, 45,246,255,236, 86, 85,247,191,116,220,146,235,223, 94, 1,120,250,244,169, 45,175,192, 89,196,199,199, 31,254,243,207,
+ 63,199,182,108,217, 82,230,235,235, 91,102, 92,139, 23, 47,182,166,164,164, 56,239,154, 0,112,246,236,217, 67,183,110,221, 26,
+215,174, 93, 59,202,221,221, 29, 10,133, 2,175,191,254, 58,252,252,252,176,120,241, 98,107, 82, 82,146, 83,124,125,250,244,105,
+235,237,237,221,244,228,201,147, 55, 50, 51, 51,127,126, 86,248, 3, 64,173, 90,181, 62,187,125,251,118, 15,154,166,109,178,137,
+ 36, 73, 17, 64,185, 10, 64, 66, 66, 66,189,234,213,171,123,156,184,231,134,124,186, 54, 4,210, 0, 81,166, 0,239,222, 4, 41,
+116, 67,248,248,220,245,248,254,251,239,155,190,251,238,187, 55,156, 25,227,210,165, 75,171,247,235,215,239,232,230,205,155, 95,
+235,217,179, 39, 3,224, 57, 5,160,126,253,250, 3,163,163,163, 7, 77,158, 60,185,241,146, 37, 75,250,205,157, 59,247, 94, 5,
+116, 70,240,188,209,114, 62,202, 56,246, 15,165, 33,151,151,125,218,171, 87,175,243, 87,175, 94,141, 11,170, 89,215, 13, 0,138,
+139,121,189,154,241, 80,211, 52,205, 0, 64,245,234,213, 91,138,162,184, 30, 64, 72, 69, 99,188,161,243,108, 77, 66,248,133,128,
+216, 77, 4,113, 28, 0,109,130, 90,217,182,162, 36, 64,153, 76,118,253,189,247,222,107, 62,106,212,168, 63,218,183,111, 15,139,
+197, 98, 45, 42, 42, 50,137,162, 72, 48, 12, 35, 99, 24,134, 18, 69, 81,124,240,224,129,199,157, 59,119,154, 18, 4,241,103, 74,
+ 74,202,191, 86,144,133, 32,136,162,223,127,255,221,165, 89,179,102,182,207,242,242,242, 80,163, 70, 13,200,100, 50,105,233, 15,
+113,231,206,157,208,187,119,239,158, 32, 73,210,132, 10, 10, 97,136, 66, 73, 8,128, 32,136, 50, 10,192,183,223,223,208, 49, 12,
+163, 35, 8, 2, 44,203,226,205,182,141, 59,192,137,216, 63,199,113,103,127,253,245,215,230, 45, 90,180,184, 39, 9,127,105,216,
+210, 31, 26,141,198, 66, 16,132,120,247,238,221,215,121,158,143,119,196,151,104,136, 75, 9,214,133,172,120,235,173,183,222,217,
+177, 99,199, 78, 23, 23,151,220,152,152, 24,189,191,191,127,206,181,107,215,220, 72,146,124,122,239,222, 61, 58, 58, 58,122, 4,
+128,117,137,134,184,138, 38, 23, 0, 32, 54, 97,207,245,238,205, 70,173,156, 54,109,218, 39, 11, 22, 44, 80,178, 44,139,252,252,
+124,100,103,103,195,104, 52,194,211,211, 19, 46, 46, 46,136,142,142, 54,155,205,230,239, 28, 45,217,147,248, 66, 95, 31,249,245,
+226,197,139, 63,249,224,131, 15,148, 28,199,217,170,186,233,245,122,248,251,251, 35, 63, 63, 31,145,145,145,197, 86,171,117,115,
+101,124,241, 73,134,227,109,131,125, 98,150,125,245,101,232,244,221,187, 1,142, 3, 57,110, 28,196,211,167, 65, 52,107, 6,241,
+241, 99, 88, 88, 22,243,231,205, 6, 89,152,249,243,133,251,185, 7,158,229,168,235, 22, 66, 64, 85,175, 25, 47,192, 59,250, 90,
+ 78,221,129,253, 7,171,212, 84, 1,240, 40, 10,144,169, 1,218, 13,181,106,122, 98,104, 95, 95,122,231,193,163, 13, 23,191, 87,
+187, 16,172,188, 1, 28, 41, 0, 16, 82, 64, 8,203, 3,189,148,179,186,191,225, 65,236,139,253,171,214,160,238,213,228,213,107,
+184, 35, 57,179, 16,155, 35,119, 8,195, 59,120,222,111, 84, 93,155, 2, 17,107, 0,100, 57, 58, 78, 64, 72,129,136,149,129, 94,
+170, 89,131,223, 52, 17,187,227, 22,213,214,106,151,211,238,238,109,144,243,248, 22, 14,111,127, 87, 8,235,160,187,223,168,186,
+ 54, 13,130,176, 6, 36, 81, 9, 95, 9,162, 98, 34, 46,132,133,134,247,216,177, 99,199,169,169, 83,167,106,154, 52,105,130,164,
+164, 36, 44, 90,180,168,168,184,184,184,207,158,179,171,206, 57,195, 3, 0, 62, 62, 62,171,226,227,227, 3,211,211,211,177,125,
+251,118,108,220,184,241,161,217,108,174,146, 7,193, 30, 4, 65,176, 35, 70,140, 40, 35,233,104,154,198,248,241,227,241,215, 95,
+127, 65,165, 82, 65,175,215,163, 90,181,106,200,205,205,181, 9,216, 74, 66, 0,236,194,133, 11,105,160,196,205,126,230,204, 25,
+244,232,209, 3,210,170,148,103,243, 9,246,237,219,103,209,104, 52,229,206, 65, 65, 16,216,161, 67,135,150, 43,137,105,154,198,
+235,175,191, 14,189, 94, 15,181, 90,109, 91, 26,232, 44,238, 95, 91,142,200,227, 70, 84,230, 48,173, 44,220, 33,237,115, 51,118,
+ 1,246, 69,179,207,241,125,242,201, 39,101,222,179, 44, 91,169,103, 33, 39, 39,103,235,140, 25, 51, 58,205,153, 51,167, 70,235,
+214,173,105, 15, 15, 15, 60,122,244, 8, 81, 81, 81,214,205,155, 55, 63, 52, 24, 12,149, 38, 83,219,227,233,211,167,219,103,206,
+156, 25, 58,111,222,188, 26, 93,186,116,161,243,242,242, 96, 54,155,177,120,241, 98,235,230,205,155, 31, 22, 20, 20, 56,197,119,
+224,192,129,188, 69,139, 22,121,142, 25, 51,166,231,185,115,231, 84,159,127,254,249, 41,153, 76,118, 85, 46,151, 63, 33, 73,146,
+183, 88, 44,158, 44,203, 94,240,242,242,242,221,187,119,111,157,110,221,186,105, 42,227, 44, 40, 40,216,188,107,215,174,154, 95,
+159,119,193, 73,227, 64,164,137, 67, 33,234, 69,232,229, 5,104,160, 77, 69,167,128,135,254,145,145,145,155, 80,226,221,114,136,
+ 37, 75,150, 52,236,219,183,239,143,155, 55,111, 14,154, 48, 97, 66,250,197,139, 23,211, 46, 94,188,248, 89, 57,187,230,140, 30,
+ 61, 58,101,251,246,237,117,120,158, 63,185,100,201,146, 94,115,231,206, 77, 44,103,191,249,237, 87, 29,153, 6,168,173, 0, 86,
+247,238,221,235,103, 0, 80,169, 84,222, 17, 17, 17, 12, 0,124,189,242,107, 90, 20, 69,154,227, 56, 88, 44, 22,124,241,197, 23,
+202,241,227,199,123, 59, 26, 39, 9,225,188, 9,106,165, 26,166,124, 19,212, 46,109, 13,105,102,135, 30,128,244,244,244,150,254,
+254,254, 35, 87,175, 94,189,248,135, 31,126,200, 27, 59,118,108,194,107,175,189, 6,138,162,100,174,174,174, 76, 82, 82,146,250,
+183,223,126,107,108, 50,153,188, 5, 65,152,159,145,145,177,227, 63, 93, 4,200, 30, 28,199,117, 63,121,242,228,153, 19, 39, 78,
+148,123,193,101, 50,153,153,227,184, 94,123,206,174, 58, 15,192,161, 9, 81, 84, 84, 8,214, 98, 4, 73,146, 32, 72, 18, 66,169,
+ 2,240,224,254, 93,155, 50, 64,146, 36, 68,158,112,234,248,238,230,156,155, 24,172, 11,105,180, 98,197,138,101,219,182,109,107,
+ 59,103,206,156,179,109,218,180,201, 69,169, 2,240,240,225, 67,143,248,248,248,206, 69, 69, 69, 28,207,243,227, 19, 13,113, 55,
+ 43,227, 76, 52,196,109, 12,214,133, 32, 44, 44,108, 97, 64, 64,192,145,219,183,111,119, 25, 48, 96,192,238,163, 71,143,118,101,
+ 89, 54,249,254,253,251,159, 2, 88, 13, 96,173, 51, 99, 76, 78, 78, 94, 20, 19, 19, 67, 92,190,124,121,122,120,120,184, 66,171,
+213, 18, 53,106,212, 64,118,118, 54,242,242,242,196,141, 27, 55,154,205,102,243, 90, 55, 55,183,249,206,240,165,167,167, 47, 2,
+ 64, 76,157, 58,117,250,160, 65,131, 20,254,254,254,132,159,159, 31, 50, 51, 51,113,230,204, 25, 49, 58, 58,218,204,178,236, 90,
+ 79, 79, 79,167,248, 70,117,120,187,231,142,168,205,199, 99,162, 99,186, 44, 93,190,146,168, 51,121, 50, 84,173, 91,163,192,215,
+ 23,215, 46, 93,194,231,139, 22,138,100, 97,102,124,203,160, 38,221, 42, 36, 17, 9, 17, 40, 89, 74,179, 45, 50,202, 98,229, 4,
+130,227, 69,194,194,131,100, 57,129,176,242, 2,193, 11, 2,161,119, 85,150,132,186, 72,209, 97, 31,130,123,175,127,107,169,123,
+107,210,175,128,176,172,134,183,106,214,219,109,244, 68,228,145,216,218,237,223, 2,117, 42, 54,218, 94,248, 47, 7,129, 75,247,
+ 94,255,214,225, 18,157, 82,190, 75, 16,177,172,166,143,122,214,208,118, 32,190, 63, 50,181,142,169,195, 84,217,149,179, 17,246,
+194,127, 57, 72,242, 66,101,124,246,144,148,128, 53,107,214,156, 12, 11, 11,211, 70, 69, 69, 85, 89,248, 3,128,139,139, 75,179,
+187,119,239, 98,255,254,253,216,176, 97,195,195,162,162,162,118,137,134,184,148,170,112,216, 99,229,247,159, 60,231,147,158,254,
+206, 10,177, 93,187,118,104,210,164, 9, 24,134,129,143,143, 15, 44, 22, 11, 52,154,146, 91,187,168,168, 68,135,174,200,202,182,
+231,156,253,254, 55, 94, 81, 81, 81,247, 90,183,110,109,208,235,245, 53,104,154, 46,163, 0, 24, 12,134, 63,214,173, 91, 23,232,
+233,233, 89,238,194,238, 85,187,103, 85,232, 51,159,254,206, 10,113,193,130, 5,248,227,143, 63,108, 69,129, 84, 42,149, 83, 2,
+155,166,233,148,246,141,158,212,126, 88,216, 21,188,224,184,221, 69, 74, 74, 74,214,249,243,231, 29, 26, 83, 52, 77,167,132,182,
+ 40,168,157,109,173,156, 47, 53, 53, 53,179, 50,190, 68, 67,156, 16,172, 11, 25, 57,113,226,196,177,245,234,213,123, 91, 16, 4,
+ 15,139,197,146,147,146,146,114,188,160,160,160,202,117, 0, 74,249, 70, 76,154, 52,105, 84,112,112,240, 32,150,101, 61, 56,142,
+203, 73, 77, 77, 61,252,244,233,211,109,206,242,113, 28,119,115,214,172, 89,215, 54,110,220,216,253,226,197,139, 67,206,159, 63,
+223, 51, 38, 38,166, 56, 37, 37,133, 99, 89, 86,244,243,243,163,218,181,107,167,236,213,171,151, 70,161, 80,144,243,230,205,123,
+178,120,241, 98, 79, 0, 21,134, 24, 68, 81,148, 9,130,128,240,144,167,152,217,153,130,217,108,129, 33,223,128, 71, 15, 31,226,
+246,237,219,184,120,241, 14, 68,209,241,179, 64, 2,203,178,223, 68, 70, 70,214, 98, 24,134,216,189,123,119,245,221,187,119, 79,
+169,236, 59,223,127,255,125,205, 61,123,246,172, 63,127,254,124,215,103,107,247,247,233,211,231, 28,128, 10,239, 81, 41,148, 93,
+ 84, 84,132, 39, 79,158,224,201,147, 39,112,115,115, 3,225,204, 36,172, 0,229, 42, 0,165,194,252,251, 94, 45,199,252,240,232,
+209,163, 73, 95,126,249,229,188,160,160,160, 36,142,227,168, 35, 71,142,180,200,203,203,171, 45,138,226, 50,185, 92,190,218,190,
+ 58,215,191,133,189,231,190,249, 5,128,115, 41,174, 14, 64, 16, 68,124,211,102,149, 42,122,210,190,149,198,254, 37, 36, 26,226,
+110, 3,232, 25,172, 11,105, 55, 99,198,140,175, 2, 3, 3,159,240, 60, 47, 63,114,228, 72,239,252,252,124, 15,158,231,231, 36,
+ 26,226,170,212,133,169, 84, 9, 56,157,150,150, 54, 22, 64,192,186,117,235, 54,161,164, 66,220, 31, 0,186, 37, 26,226,158,115,
+143, 57,224,226, 1, 44,232,212, 48,236,192,146, 37, 75, 94,186, 23,128, 61,223,174, 93,187, 94,186, 23,192,248, 77,155,248,241,
+216,212,163, 93, 29,143, 62,225, 99,135, 45,101,101,138,154,133,197, 28,163, 85, 82, 22,138, 47, 78, 97,172,166, 5,241,127, 85,
+220, 11,224, 94,126,156, 88,151,158,120, 93,198, 33,117,108,239,128,202,115, 84, 8, 49, 17, 86,177,210, 74, 91,247, 94,255,214,
+ 44, 41, 1,181,253,212,179, 6,181, 23,137, 31, 47,198,214, 24,222,193, 51,245, 25,225, 95, 92, 25,151, 29,223, 37,136, 88, 86,
+199, 79, 61,107, 68, 7,145,248,241,210,234, 26, 97, 29,116,169,207, 8,127,167,248,236, 81,170, 4,244,220,179,103,207,206,226,
+226,226,113, 85, 21,254, 0,112,239,222,189,240,238,221,187, 47, 49,153, 76, 79,173, 86,107,216,203, 8,127, 71, 16, 69, 17, 74,
+165, 18, 12,195,216,146,198, 94, 4, 75,183, 77,203,158,241,222,215,195,166, 78,157,250,195,160, 65,131,146,222,126,251,109, 66,
+167,211,121, 89,173,214,172,195,135, 15,179, 27, 54,108, 8,240,240,240,152,176, 98,231,116,167,239, 21, 9, 4, 65,128, 32, 8,
+ 91,136, 66, 82, 0,128,202, 67, 0, 44,203,182, 11, 25,245,240,162,217,188,161,252,245,183,165, 80, 42,149, 25,197,197,197,109,
+ 42, 51,166,172, 86,107,187, 14,163, 31, 93, 44, 46,118,204,167, 82,169,210,173, 86,107, 91,103,140,179,210,123,120, 83,233,246,
+210, 40,253,205,109,165,219, 11, 97,206,156, 57,169, 75,150, 44,153,117,237,218, 53,229,196,137, 19,155,143, 28, 57,210,181,115,
+231,206,101,158,251, 69, 69, 69,194,209,163, 71,141, 27, 55,110,204,137,143,143,191,250,254,251,239,247, 7, 80,161,178,156,145,
+145,113, 98,253,250,245,110, 33, 33, 33,193, 60,207,227,201,147, 39,182, 28,128,180,180, 52,164,166,166,166,240, 60,127,212,153,
+241,209, 52,253,225,200,145, 35,143,109,223,190,189,198,132, 9, 19,210,247,238,221,123, 20, 64,121,121, 93,218, 1, 3, 6,244,
+ 45,221, 47,149,166,233,169, 21, 53, 8,170, 10, 68, 81,132,209,104,132,232, 40,201,173, 20,234,210,228, 63, 53, 76,197,191,235,
+244,144, 66, 0, 78,117, 3,124,179,206, 64, 45,195, 48, 51, 68, 81,156, 6, 96, 35, 69, 81, 95, 69,255,190,171,210,132,159, 87,
+ 40, 65,176, 46,164, 31, 65, 16,211, 69, 81,252, 58,209, 16,119,248,191, 61,158,255, 85,252,147,221, 0, 75,146, 0,217,106, 16,
+101,175, 67, 68,197, 1, 81, 65, 52,129,150,221, 66, 6, 50,239,117,217,224, 84, 24,171,238,173, 73, 10, 64,120, 3, 34, 49, 21,
+ 36, 2, 75, 98,244,196, 55, 85, 17,254,207,241,137,104, 11, 66,252, 24, 4,124, 33, 18, 79, 32, 8, 17, 47, 42,252,255, 47,225,
+227, 17,203,172, 50,153,204, 97, 0, 92, 46,151, 11, 90,173, 86, 61,103,213,104,167,140,141, 25,239,125,237,103,177, 88, 86, 22,
+ 21, 21,117,180, 88, 44,222,114,185, 60, 87,173, 86, 95,100, 24,230,147, 23, 17,254, 0,240,201,187, 43,173, 40, 73, 52, 43, 3,
+154,166, 5, 23, 23, 23,167,199,246, 10,206, 67,234,142,183,111,223, 62, 42, 49, 49,177,157, 32, 8,189,171, 85,171,214,176,122,
+245,234,129, 36, 73,146, 25, 25, 25, 79,210,211,211,147, 89,150,141, 81, 42,149, 39,120,158,151, 91, 44,150, 48,133, 66, 17, 57,
+107,214,172,204,138,186,237,109,221,186,181,173, 70,163,233,165, 82,169, 26,200,229,114,119,142,227,200,194,194,194, 60,139,197,
+146,192,113,220,241, 49, 99,198,148, 91, 64,161, 60, 62,251, 28,128, 62,125,250,156,236,208,161,195,219,207,126,239,248,241,227,
+219, 99, 99, 99, 71, 78,158, 60,249,175, 31,126,248,193,150, 3, 80, 89, 55, 64, 9, 9, 9, 9,127,238,219,183,175,142,244,222,
+106,181,226,233,211,167,200,203,203, 67,118,118, 54,190,252,242,203,191,218,182,109, 91,175,162,110,128,142,240,170, 29,240, 43,
+252,255, 26,117,221, 66, 8, 44, 66,197, 46,178, 79, 33,222,203,175,122,175,247,186,183, 38, 49, 0,124, 32, 18,193,144, 9,247,
+ 33, 16, 25, 47,210,180,231, 57, 62,130,104, 8,158, 77, 4, 73, 61,124, 25,190, 87, 40, 65,121,217,254,175,240,127, 3, 21, 9,
+ 68,103,225,172,128,125, 89,190,165, 75,151, 86,111,220,184,241,226,123,247,238,157,154, 58,117,234,115, 73,128,203,150, 45,235,
+219,172, 89,179,145,215,174, 93,155,103,191, 10,192,217,241,221,184,113,227,132, 66,161,168, 69, 16, 4, 33,150, 0, 60,207,219,
+202,101, 91, 44,150, 7,237,219,183,239, 85,145, 2,192,234,178,204,192,223, 70, 16, 1,244,160, 12,222,167,129, 87, 10,192, 43,
+188,194, 43,188,194, 43,188,194,255, 51, 96,117, 89,102, 53, 76,110, 86, 67,144,249,165, 52,162, 87,120,133, 87,120,133, 87,120,
+133, 87,248,191,137, 23, 47,110,253, 10,175,240, 10,175,240, 10,175,240, 10,255,211, 40, 47, 4, 96, 53, 4,153,129, 87, 10,192,
+ 43,252, 63,130,210,158,239, 4, 0, 49,209, 80,245,152,255, 43,188,194, 43,188,194,255, 69,208, 6,239, 10,139,205,189,202, 1,
+248, 15, 32, 88, 23, 66, 2,144,194, 43, 2, 94, 9,157,255, 42, 74,175, 7, 5, 64,134,146, 14,114, 60, 0,225,213, 53,249,191,
+139,186,110,237, 95,120,237, 51, 0,220,203,143,127,117,237, 95,225,165, 80,183,228,185,242,194,184,247,204,242,204,127,154,207,
+ 30,172,110,157,205, 11,160,134, 90,105, 53,148,172, 90,113, 90, 1, 8, 11, 13,175, 13, 64, 22, 21, 19, 81, 94, 5,163,127, 13,
+195, 59,127,124,185, 86,173, 90, 53,238,221,187,199, 74,107,115, 73,146,180, 21,228,160,105, 58,126,199,201,165, 78,119,115,250,
+167, 49,162,203,116,185,155,155,219,105,165, 82,217,177,188,255,139,162, 40,176, 44,171, 94,179,119,110,165,153,201,193,110, 47,
+ 55, 33, 18,243,255,157,226, 76,205, 3,122, 9, 36, 73, 18,246,149, 20,237, 95,203,251,204,106,181,106, 79, 92,221, 90,110, 27,
+203, 9, 31, 93,118, 5,208, 15,192, 85, 2,104,137,146, 26, 12, 45,255,126,143,171, 0,209, 18, 64,204,183,223,180,122,174,122,
+ 95,233,121, 35, 1,160,225,140,134,170,192, 63, 2,255,146,145, 50,175,138,198,159, 93, 63, 91,247,235,178, 95,237,199, 34,252,
+ 91,231,238, 21, 94, 12,246, 10, 64,181,106,213, 66, 68, 81, 92, 3,160,145,253, 62, 4, 65,220, 37, 73,114, 90, 90, 90,218,115,
+ 93,113, 94, 41, 0,175,240,178,120,167,219,140, 76,158,231, 29, 86,225, 43, 15,114,185, 60,235,210, 47,191,248, 61, 43,176, 95,
+148,143, 97,152,180,139,151, 46,213,172, 72, 1, 96,117,235,204,106,168,221, 36,161,111,255,190,194, 16, 64, 88,104,120, 93, 0,
+ 29, 74,183,144,122,245,234,249,153,205,102,132,133,134,103, 1,136, 3, 16, 11,224,124, 84, 76,196,159,142, 6,247,110,247,153,
+169, 28,199, 5, 86,229,128,104,154,126,194,178,172, 95, 84, 76,196,115, 21,163,124,124,124,106, 69, 70, 70,122,252,254,251,239,
+208,104, 52,101, 54,138,162,208,166, 77,155, 54, 85,249,173,127, 18,165,194,255,140,143,143, 79,187,237,219,183,227,230,205,155,
+104,209,162,133,237,255,165, 29,193, 72,149, 74, 85,105,247, 48, 9,173,219,180, 78,102, 89,182, 74,231, 79, 46,151,231,100,181,
+203,242,199, 28, 56, 92,215, 30, 22, 26,238, 66,146,228, 12,154,166, 59, 11,130,208, 8, 0, 40,138,186,109,181, 90,207,242, 60,
+191, 34, 42, 38,162,192,153,223, 35, 73,146,120,242,228, 9,246,236,217,131,128, 22, 67, 33,128, 68,167,215,228, 32, 75, 31,209,
+199,111, 88,192,242,192,159,103, 87, 99,198,244,112, 52,111,222, 28,130, 32, 84, 56,247, 20, 12,115, 14, 4,154, 1, 82,253,228,
+ 82, 34,194,174,158,114,201,155, 43, 0,222,168,136,167,201,194, 38, 74,255, 63,252, 31, 48, 12,163,223,189,123, 55, 46, 95,185,
+140,224, 58,193, 96, 57, 22, 34, 68,240, 2,143,105, 83,166,129,201, 97,212, 0,156,234,169, 93, 17,130,117, 33,111, 2, 24, 13,
+ 32, 27,192,182,170, 20,102,250,167, 48,180,227,212,139,173, 91,183,174,255,219,111,191, 89, 69, 81,180, 41,197,146,162,204,243,
+252,163,221,209, 95, 55,127,217,223, 9, 11, 13, 63, 0, 96, 96,233,219,152,168,152,136, 46, 47,194,211,177,193,112, 23,138,162,
+102,200,229,242,206, 28,199, 53, 2, 0,154,166,111, 91, 44,150,179, 28,199,173,136, 77,216,227,212,252, 19, 69,113,213,150, 45,
+ 91, 26, 85,175, 94,221,214,220,197, 96, 48,160,176,176,240,181, 45, 91,182,172, 7, 16,252, 34,227,123,133,255, 46,222,237, 62,
+ 51,147,227,184, 23, 18,176, 59, 78, 46,117,220,140,235, 31, 0,207,243,222,231,207,159,135, 70,163,129, 32, 8,224,121,222, 86,
+ 6, 93,218, 68, 81,132,253,189, 40,138, 34,186,116,233, 82,238, 49,149,199, 87, 30,151,125,221, 31,158,231,209,173, 91, 55,191,
+ 23, 61,134,231, 30,194, 97,161,225,135, 0,116,169, 87,175,158,186,107,215,174,104,209,162, 5,106,214,172,105,171,123,157,155,
+155,235,157,144,144, 48,228,250,245,235, 67, 46, 93,186,132,176,208,240, 34, 0,151, 42,122, 8,240, 60,239,119,238,220, 57,184,
+184,184, 56, 53,160,156,156, 28,244,236,217,211, 29, 21,180,239,205,200,200, 16, 22, 46, 92,104,184,112,225,130,181,244,164, 18,
+165,165, 16,137,210,223,171, 82,231,170,127, 10,193,186, 16, 50, 52, 52,244, 84,169,240, 39, 41,138,194,213,171, 87,241,240,225,
+ 67,120,123,123,219, 58,146,113, 28, 7,150,101, 13,159,188,187, 82,176, 90,173,149,122, 2,120,158,247,147, 38,133, 51,224,121,
+ 30,237,218,181,211, 49,143, 24, 10,168, 88, 1, 8, 11, 13,239,196, 48,204,222,137, 19, 39,234, 90,181,106, 69,121,120,120,128,
+101, 89,164,165,165,181,185,124,249,114,139,125,251,246, 77, 8, 11, 13, 31, 22, 21, 19, 81,105, 5, 57,146, 36,177,115,231, 78,
+124,249,229,151,232,245, 89,111,172,121, 87, 15,146, 40,105,250,146,159,159,143,222, 77, 21,248,120,119, 33,206,238,249, 1,230,
+ 34, 19,100, 50,153,195,234,105, 10, 5,211,224,135,136,177, 24, 57,107, 59, 34,151,141,198, 59,179,119, 96,215,210, 81,182,215,
+119,231,236,192,247, 95,141,194,187,115,118,182,154,251,233,159,138, 37,139,234, 61,127, 14,247,131,244,187,238,247, 87,169,240,
+ 39, 20, 10, 5,158,246,234,131,100,163, 17,174,191,253, 6,173,135, 7, 44,214,146,130, 97,174, 79, 92, 31,246,233,219,167, 60,
+ 79,128,211,240,244,244,220,245,227,143, 63,214,100, 89, 22,115,231,206, 13, 15,214,133,244, 77, 52,196,157,121, 17, 46, 9,193,
+186,144,238, 0,164,102, 71, 75, 19, 13,113,167, 29,237, 79, 81, 84,192,134, 13, 27,116,119,239,222, 45,211,110, 86,106,136,211,
+165, 75, 23,167, 58,124, 62,139,176,208,112, 79,148, 84,136, 83, 1,248, 8, 64,239,211,167, 79, 67, 38,147,161,123,247,238,161,
+ 97,161,225,175, 1, 88,169,209,104, 68,163,209, 56, 38, 42, 38, 34,179, 50,206,142, 13,134,119, 82, 42,149,123,231,204,153,163,
+107,215,174, 29,229,233,233,137,203,151, 47, 67,167,211,181,137,143,143,111,177,121,243,230, 9, 29, 27, 12, 31, 22,155,176,199,
+153, 10,134,245, 3, 3, 3,177, 96,193, 2,184,186,186, 66,175,215,195,221,221, 29,122,189, 30,141,131,114,107,207, 25,235,145,
+151,147,207, 22,158,254,213,101, 62, 77,211,231,146,146,146, 28,182,164,126,133,255, 13,112, 28,231, 29, 31, 31, 15,149, 74, 85,
+ 70,232, 73,194, 81, 18,144,246, 66, 86, 20, 69,116,236,216,177,202, 74,195,139, 66,163,209, 96,239,222,189,101,154, 58, 73,205,
+153,158,253,140,166,105,232,245,142, 59, 43,191, 32,159,195,112, 24,109,248, 80, 97,210,173, 51, 67,183,238,185, 16, 64,121, 86,
+ 88,223,179,103,207,146,130, 32,192,197,197,229,185,142, 88,122,189, 30,237,219,183, 71,235,214,173,209,165, 75, 23,252,249,231,
+159,170,229,203,151,135,134,133,134,203,163, 98, 34,202, 21, 56, 26,141, 6, 71,143, 30, 5, 65, 16,160, 40, 10, 52, 77,131,162,
+168, 50,127,219,127,230,168,180,177,155,155,155,255,241,227,199, 73,133, 66, 33,106,181, 90,241,252,249,243, 34, 0, 17, 47, 24,
+103, 15, 11, 13,247,149,203,229,203, 56,142, 27, 34, 8, 66,133, 21,227,100, 50, 25, 43,151,203, 15,153, 76,166,153,123,207,125,
+147,106,255,191,210, 4, 51, 82,165, 82,117,218,188,121,179,173,249,134,244,224, 85, 42,149,182, 87,119,119,119,124,244,209, 71,
+248,244,211, 79, 73, 87, 87, 87,167, 60, 1, 42,149, 10,231,207,159,135, 76, 38,195,107,157, 59,131,100, 89,164,253,250, 43, 40,
+181, 26,190,205,154,129,176, 90, 81,120,239, 30,104,141, 6, 62, 62, 62,229,118, 49,123,230,152,187, 7, 4, 4,252,184,102,205,
+ 26, 21, 0, 36, 37, 37,129, 97,152,146,158, 7,162,136,238,221,187,211, 45, 90,180,240,252,252,243,207,143,133,133,134, 15,140,
+138,137,112, 40,120,100, 50, 25,222,123,239, 61,172, 88,177, 2,107,223,211, 67, 70,150, 8,255,191,155, 72, 2,171, 70,104,209,
+114, 13,131, 5, 11, 22,224,196,137, 19,182,126,234,207,226,189, 30,179, 82,171,183, 29,195,100,103,103,131,145,203,145,149,149,
+ 5,134, 46,125,181,123,159,153,153, 9, 70, 46, 71,218, 47,223,165,135,133, 22,251,150,241, 22,237, 7,129,104, 80, 50, 82,230,
+189,117,235, 86, 91, 75,217, 34,130, 0, 15,192,203,203, 11,230,210,174,111,106, 87, 53,194,195,195,241,197,167, 95,188,148, 39,
+160,118,237,218,213,218,181,107, 7,179,217,140,232,232,104,166,111,223,190,199,131,117, 33,171, 0,108, 72, 52,196,165, 86, 74,
+ 80, 62,102,139,162, 24, 2,216,154,196, 56,188, 14, 28,199,165, 79,158, 60, 89,227,192, 3, 80,169, 96,174, 0,107,143, 30, 61,
+218,223,106,181, 98,204,152, 49, 9, 65, 65, 65,148,187,187, 59, 54,109,218, 4,119,119,119,152,205,230,223, 35, 34, 34,168,244,
+244,116,172, 89,179,102, 59,128, 30,142,200, 58, 54, 24,222, 61, 40, 40,232,199,125,251,246,169, 0,224,193,131, 7, 72, 75, 75,
+195, 79, 63,253,132,225,195,135, 99,240,224,193,244, 91,111,189,229, 57,101,202,148, 99, 29, 27, 12, 31, 24,155,176,199,225,113,
+ 3,128, 78,167,227,103,205,154, 37, 83,171,213,101,188,130,191, 69,207, 34,190,250,216,207,109,205, 94,194,181,121,232,135,179,
+ 54,110,220,248,102, 80, 80,208,151,167,175,239, 72,119,246,224,231, 15, 14,105,164,100, 16, 85,108,193,164, 47,247,199, 93,112,
+246,123, 21, 33, 44, 52,252, 13,185, 92,190,213,106,181,190, 27, 21, 19,113,253,101,249,254, 83, 8, 11, 13,127, 75, 46,151,127,
+202, 48, 76,143, 77,135, 22, 85,169, 31,192, 63, 5,149, 74,133,211,167, 79,219, 4,158, 36, 43,100, 50, 25, 24,134, 41,211, 85,
+145,162, 40,104,181, 47, 93, 33,190, 74, 16, 4, 1, 52, 77, 99,208,160, 65, 32, 8, 2, 50,153,236, 57,185, 22, 31, 31,143,174,
+ 93,187,130,166,105,140, 29, 59,214, 41,190,225,195,135,131,227,184,231,248, 98, 98, 98,202, 28,115, 69,207,209,103, 65, 27, 62,
+180, 37, 2,218, 11,233,242, 20, 0, 78,171,213,202,175, 95,191, 14, 81, 20,161,213,106,225,230,230, 6, 55, 55, 55, 20, 20, 20,
+224,206,157, 59,184,123,247, 46,146,146,146, 64, 16, 4,106,213,170, 37,125,175,220,145, 72, 15, 33,153, 76, 6, 86, 32,112,230,
+150, 1,162, 40, 96, 80,155,234,229, 10,255,202,218, 98,110, 58,180,136,219, 52,117,216, 69,214, 82,232,197,115,150,248, 77,134,
+184, 49, 97,161,225,151,189,188,188, 2,135,118,156,202, 75,191,231,108, 94, 0, 77,211, 43, 39, 77,154, 52,108,232,208,161,164,
+125,215, 44,158,231, 97, 54,155, 97,181, 90,193,178, 44,138,138,138,232, 3, 7, 14, 12, 58,126,252,184, 26, 64,239,242,184,120,
+158,199,173, 91,183,112,243,230, 77,144, 36, 9,119,119,119,184,186,186,218, 90,135, 50, 12, 99,235, 34, 70,146, 36,138,139,139,
+ 13, 31, 13, 91, 34,228,228,228,168,163, 98, 34, 28, 42, 2,210,197,150,142, 73, 58, 95, 18,156, 81,158, 0, 32, 44, 52,220,149,
+166,233,200, 85,171, 86,169,178,179,179,145,152,152,136, 6, 13, 26, 96,246,236,217, 48, 26,141, 88,189,122, 53, 50, 51, 51,161,
+211,233, 48,103,206, 28,213,188,121,243, 34,195, 66,195,107, 69,197, 68, 60,173,136,147, 36, 73,108,217,178, 5, 28,199, 65,154,
+143,102,179,217, 38,120, 37,136,162,136, 79, 63,253, 20, 50,153,172,194,113,242, 60,239,231,229,161,195,145,115,183, 33,151,211,
+ 56,118,254, 14,104,233,149,182,127,159, 0, 5, 35,135, 40,240, 58, 60,235, 45, 74, 0,129, 76,200, 0,224,218,245,107, 40,236,
+217, 27, 38,139, 5,218,125,251,224, 26, 28, 12,212,174, 13, 79,139, 5, 79, 31,166,216,106,187, 3,127,123, 2, 10, 60, 11, 92,
+241, 53,156,114, 63, 75,144,142,103,210,164, 73,152, 49, 99, 6, 98, 98, 98,232,159,127,254,121,230,160, 65,131,218, 3,112, 42,
+ 44, 21,172, 11,105,234,237,237,189,173,126,253,250, 77, 0, 32, 36,164,194, 14,159,229,226,135,216,213,111, 2,192,193,121, 27,
+ 23,248,213, 10, 89,152,114,239,103, 74, 20,203,132, 5,189,247,204, 10, 17, 1,128, 36,192,201, 41, 44,239,255,101,220, 60, 39,
+168,153, 59,119,238, 64,171,213, 98,227,198,141,148,135,135, 7,174, 92,185, 2,185, 92,142,119,222,121, 7, 77,154, 52,161, 52,
+ 26, 13,226,227,227,145,159, 95, 94, 41,244,191,209,177,193,112, 87,134, 97, 34,247,236,217,163,154, 61,123, 54, 90,182,108,137,
+122,245,234,129, 32, 8, 12, 28, 56, 16,162, 40,194, 96, 48,192,203,203, 11, 43, 87,174, 84,141, 27, 55, 46,178, 99,131,225,181,
+ 98, 19,246, 84, 56,255, 0,136, 22,139, 69,148,154,244, 72,205,127,228,114, 57,178,243, 73,113,246, 55, 57,249, 4,165, 39,251,
+246,108, 92,231,195, 15, 63, 36, 63,251,236,179, 80, 0,219,157, 56,110,204, 31, 28,210, 72,163,146,199, 79, 30,247,174,219,250,
+239,182, 29,159, 63, 56,164,247,203, 40, 1, 97,161,225,111,104,181,218,232,137, 19, 39,106,215,172, 89,115, 54, 44, 52,188,243,
+255,162, 18, 16, 22, 26,254, 22, 77,211,167,172, 86,171,154, 97,152,114,189,177,255, 22, 40,138,130, 76, 38,131,209,104, 68,108,
+108, 44,238,222,189,139,243,231,207,195, 98,177,192,203,203, 11, 58,157, 14,157, 59,119,198,232,209,163,225,234,234,250,175,142,
+141,227, 56,208, 52,141,147, 39, 79, 58,180,216, 47, 92,184, 0,154,166,161,213,106,177,127,255,254, 74,249,142, 28, 57,226,144,
+ 79,218, 94,164, 15, 16,171, 11, 49,171, 1, 55,171, 33,174,220, 28, 0,155, 21, 45,138, 34, 10, 10, 10, 80, 80, 80,128,180,180,
+ 52,108,220,184,209, 38,104, 36, 97,205,113,206,205, 11,154,166,113, 39,173, 8, 4, 73,160,216, 44, 34,254,110, 22,122,181,170,
+ 89,174, 18, 80, 25,222,234, 20,214,160,127,131, 63, 93, 39, 47, 61, 35, 2, 37,121, 1,135, 14, 29,242, 72, 76, 76,180, 53,233,
+ 80,169, 84, 80, 42,149,160,105,218, 97, 94,128, 32, 8, 3,134, 12, 25, 66,158, 57,115, 6, 28,199,129,162, 40,219, 9,183,255,
+ 91, 46,151,163,111,223,190,228,143, 63,254,216,117, 66,255, 79, 41,123,141, 56,209, 16, 39, 6,235, 66, 4,130, 32,208,162, 69,
+ 11, 60,121,242, 4,114,185, 28, 46, 46, 46,112,115,115,131, 74,165,178,185, 99, 53, 26, 13,148, 74, 37,124,125,125, 49,126,252,
+120, 44, 92,184,144,164,105,186, 82, 79, 64,189,142, 29,109,150,191, 76,165,130, 95,243,230, 54,203,159, 82,171,161,168, 89, 19,
+132,213, 10,177,146,102, 42, 50,153,236,147,177, 99,199,186, 82, 20,133,123,247,238,129, 97, 24, 24,141, 70,244,235,215, 15,133,
+133,133,224,121, 30, 12,195,128,227, 56, 84,175, 94, 29,157, 59,119,214,158, 57,115,230, 19, 0, 11, 28,112, 98,236,216,177, 88,
+191,126, 61, 62,216,158,139, 13,163,159,119,115,125,180,171, 16, 0,176,104,209, 34,196,198,198, 58,156,184, 3,187, 52,193,209,
+216, 91, 8,242,213, 32, 57,179, 8,117,170,185, 32, 37,203,140,122,129, 58,164,101, 91, 80,191,134, 30,233,185, 86,188,221,241,
+ 53,220,254,169, 28,130, 6, 16,145, 1, 30,153, 64,163, 6,141,144, 68, 81,224, 45, 22,184,212,168, 1, 79, 79, 79, 48, 40,241,
+153, 41,228, 10,104, 52, 26,168, 84,170, 50,158, 0,133, 89,161, 6,170,172, 0, 16, 0,144,145,145,129,142, 29, 59, 62,152, 48,
+ 97, 66,173,230,205,155,131, 36, 73,167, 26,179, 7,235, 66,154,189,246,218,107,177,103,207,158,117,241,241,241,145, 66, 69, 40,
+ 44, 44,196,176, 97,195, 0, 96,159,179, 99, 17, 68,132,191, 59, 45,154,194,111,253, 0,161,252, 40,144, 8, 80,203,119,157,155,
+ 6,192, 25, 5, 32,124,238,220,185,189,123,244,232, 65,185,185,185,129, 97, 24, 91, 71, 60,165, 82,137,244,244,116,112, 28,135,
+189,123,247,138, 0,166, 58, 34,162, 40,234,147, 25, 51,102,184,210, 52,141,250,245,235, 99,218,180,105,216,189,123, 55,252,253,
+253, 75,120,173,231, 64, 90, 21,224,249,238,168, 91,183, 46,250,246,237,171, 61,120,240,160,195,249, 7,224,166,217,108,110, 41,
+221,103,210,184, 0,224,118,178,238,246,161,232,251, 77,170, 87,175,222,208,173, 70,252,182, 14, 29, 58, 52,241,240,240,104,221,
+177,193,240, 29,177, 9,123, 28,122, 12, 37,225,191,226,155,253,110,174,110, 94,152,250,100,155,235,170, 31,137, 19,243, 7,135,
+244,122, 17, 37, 64, 18,254, 59,118,236,208, 50, 12,131, 39, 79,158,184,237,217,179,231, 92, 88,104,120,167,255, 37, 37, 32, 44,
+ 52,252, 45,133, 66,113,106,193,130, 5,154, 5, 11, 22,188, 80,216,232, 89, 62,138,162,118,178, 44,251, 66, 77,169, 40,138,130,
+ 32, 8,248,228,147, 79,176,124,249,114, 12, 27, 54, 12, 29, 58,116,192,156, 57,115, 48,118,236,216, 50, 30,128,151,104,140,247,
+ 66,224,121, 30, 52, 77, 99,224,192,129,101,228, 98, 76, 76, 12,250,244,233,243,156,219,190,103,207,158, 78,241, 13, 27, 54, 12,
+162, 40,150,145,141,167, 78,157, 42, 35,252,171,226, 1,168, 8, 47, 93, 7,192, 89, 5,128,162, 40,164,228,154,209, 50, 72, 7,
+ 81, 4,206,220, 76,199,219,109,235,148, 57, 64, 16,100,165, 30, 0, 0, 56,125,108, 83,209,197,104,161, 72,224,197, 76, 0,120,
+252,248,177,248,213, 87, 95, 21,156, 57,115, 70,242, 57, 19,118, 73, 23,132,163,188, 0, 81, 20, 41,138,162,192,178,236,115, 89,
+235,157, 58,117, 66,124,124,188,237,179, 82, 75, 81, 90, 82,246,236,129,139, 64,137, 11,199,219,219, 27, 12,195,192,254,129, 36,
+197, 98,237,187,137, 73, 15, 41,103,142,217,222,147, 98,191,191,179,150,191, 4,154,166, 67, 91,181,106, 69, 61,120,240,192,166,
+216,112, 28,135,142, 29, 59,130, 32, 8, 60,126,252, 24, 12,195, 64, 46,151,131, 32, 8,180,106,213, 74,254,243,207, 63,135,194,
+193, 3,152, 36, 73,124,251,237,183, 96, 89, 22, 0,240,225,247,133, 88,247,174, 22,102,179,217,246, 94,218,111,254,252,249,182,
+ 22,203, 21,161, 93,179,154, 16,141,233,182,235, 33, 89, 0,207,190,234,245,250, 50,177, 65, 27, 6, 67, 4,192, 97, 87,201,252,
+116,189,114, 5,158,158,158, 64, 64, 0, 20, 22, 11, 84, 70, 35,178,158, 62,133,206,205,197,118,141,236, 61, 1,149,133, 80,202,
+131, 52,225, 68, 81, 68,118,118,118,227, 47,190,248,226, 45, 0,129, 0, 42,205, 3, 8,214,133,248, 72,194, 95, 20, 69,244,238,
+221, 27,211,166, 77, 67,171, 86,173, 80, 80, 80,128,233,211,167,195, 96, 48,172, 31, 28, 50,101,213,173, 91,183,102, 36, 26,226,
+214, 56,226, 35, 9, 68,124,255, 77,151,242, 60, 0,246,251,112,114, 10,223, 84, 54, 54, 41,225,239,245,215, 95,199, 71, 31,125,
+132, 31,126,248, 1,187,118,237, 2,207,151,200,133, 1, 3, 6, 96,240,224,193, 48, 24, 12,240,245,245, 37,210,210,210, 18,195,
+ 66,195, 43, 76, 12,100, 24, 38,180, 93,187,118, 84, 74, 74, 10,218,182,109,139,241,227,199, 99,236,216,177, 56,114,228, 8, 60,
+ 20,247,112,251,194,108,212,125, 99, 46,148,165,243,175, 93,187,118,242,159,126,250,201,225,252,147,203,229,211,186,116,233,178,
+ 66, 20,197, 70, 40, 27, 15, 77,144,201,100, 51, 1, 32, 53, 53,245,206,219,111,191,157, 20, 26, 26,218,162,118,237,218, 94, 79,
+158, 60,161, 0,176, 21,113,150, 17,254, 58,111, 20, 94,238,134, 64, 31, 37,194,135,105, 92, 34,246,230, 84, 89, 9,176, 23,254,
+ 10,133, 2, 87,175, 94, 69,112,112, 48,198,141, 27,231,186,117,235,214,255, 25, 37, 64, 18,254, 91,183,110,213,232,116,186,151,
+ 22,168,165,124, 39, 39, 78,156,168, 93,191,126,253,177,225,157, 63,174,114, 91,106,138,162,144,149,149, 5,146, 36, 17, 16, 16,
+128, 95,126,249, 5,133,133,133,232,210,165, 75, 25,183,187,244, 92,248, 55, 33, 9,236, 83,167, 78,149,177,212,105,154,198,217,
+179,103,159,179,220, 21, 10, 5,142, 31, 63, 94, 33,159, 20, 2, 56,122,244,168, 67,203, 95,218, 74,143,215,225, 69, 98,117, 33,
+101,123, 26, 56,179, 0, 0, 20, 35, 73, 68, 65, 84, 10, 1,217,163, 74, 10, 64,121,147,129,227,184,242, 31,194,207, 32,179,128,
+ 7,199,139,168,227,231, 10,153,140,194,209, 43, 41, 72,207, 49, 33, 56,208, 19, 20, 69,225,240,133, 63,177,253,248, 21,212, 9,
+240,128, 64,202, 1,190, 98, 75,118,250,150, 19,101,178, 30, 93, 92, 92,252,246,237,219,247,194,121, 1, 82,110,130, 76, 38,195,
+219,111,191,141, 19, 39, 78,216,220, 43, 50,153, 12, 45, 90,180,176,185,245, 43, 66,162, 33, 78,156,254,206, 10,112, 28, 7, 23,
+ 23,151,231,146,176,164, 24,187,148, 12, 40,121, 40, 0,231, 20,128,244, 43, 87, 32,147,201,108,150,127, 65, 98, 34,104,141,198,
+102,249,203,178,179, 33,215,106, 65, 40, 42,172,249, 0, 0,224, 56,174,145,167,167, 39,210,210,210,108,130,222,223,223, 31, 31,
+126,248, 33, 76, 38, 19,182,109,219,134,167, 79,159,218,226,107,117,234,212,129,197, 98,105,228,136, 83, 38,147, 97,226,196,137,
+216,182,109, 27,206, 46,109, 11,153, 76,134,134,203, 73,155,160,151, 20, 42,146, 36,177,120,241, 98,116,234,212,169,210, 7, 11,
+ 77,211,216,185,115, 39, 0,216,150,122,218,111, 83,166, 76,113, 60,239, 6, 67,192, 46, 64, 16, 5, 91, 24,139, 71,201,157, 34,
+133, 32,100, 50,153, 45, 52, 35,121, 2,164,227,169, 42,236, 21, 0, 0,214, 68, 67, 92,121,190,137,138,208,115,246,236,217, 46,
+130, 32,160, 83,167, 78,120,255,253,247,209,178,101, 75,172, 93,187, 22, 23, 46, 92,192,230,205,155,177,123,247,110,112, 28, 39,
+239,222,189,251, 12, 0, 14, 21,128, 1,139,227,190, 0,240, 69,107,187,207,134,116,248,232,185, 21, 2, 4, 65,140, 57,216,109,
+198, 24, 65, 16, 28,173, 14,232,125,250,244,105,120,120,120,224,215, 95,127,181,205, 89, 0,202,168,152, 8,115,244,238,219,172,
+ 82,169,164,204,102, 51,150, 47, 95, 14,165, 82,137, 65,131, 6,133,134,133,134, 43,202, 11,107, 89,173,214, 70,143, 30, 61,194,
+137, 19, 39,208,167, 79, 31,140, 27, 55, 14,105,105,105, 24, 49, 98, 24, 62, 31,103, 66,157,122, 33,112, 15, 26, 7,130, 44,121,
+160, 55,104,208, 0,102,179,217,225,252, 75, 78, 78,190, 2,160,210,120,137, 52, 95, 42,155,123,229, 9,127, 81,228, 64,210,122,
+212, 8,116,199,244, 81,129, 46, 95,239,188,233,180, 18, 32, 9,255,237,219,183,219,132,191,228, 69,105,212,168, 17,166, 77,155,
+230,186,122,245,234,255,186, 18, 16, 22, 26,254, 22,195, 48,167,182,108,217,162,113,115,115, 67,106,234,139,166,174,252,205,167,
+ 80, 40, 78,109,217,178, 69,227,226,226, 2,171,213,170,218,186,117,107,149,149, 0,138,162, 80,163, 70, 13, 68, 70, 70,130,166,
+105, 28, 60,120, 16, 26,141, 6,253,251,247,135, 94,175,199,103,159,125,102,179,182, 95,214, 34,174, 42, 36,129, 61,100,200, 16,
+155, 49, 43,109,114,185, 28,167, 79,159,198,192,129, 3,109,207, 90,251, 85, 97,142,248,194,194,194, 0,192, 22, 14, 40, 79,248,
+219, 41, 0, 14, 65, 27,226,158, 19, 10,146, 95,240, 63,238, 1,160, 24, 37,238, 63,204,193,141,116, 35,234,251,187, 64,173,100,
+ 64, 81, 20,234,248,187,227, 86,114, 14, 26, 4,249, 34, 59,191, 8, 81,103,110, 96,238,168, 46,248, 49,246, 38,138, 92,235,145,
+202,156, 27, 21,114,110, 14, 31,113,149, 53, 63,117,103, 45,230, 95,166,110,141, 25, 89, 80, 80,112,165, 78,157, 58,254,169,169,
+169, 92, 65, 65, 1,154, 55, 47,121,150, 17, 4,129,145, 93, 63,129, 76, 38,251,101,231,169,101,131, 28,142,147,162, 48,120,240,
+ 96, 28, 58,116, 8, 3, 6, 12,192, 79, 63,149, 60,191, 91,181,106,133,132,132, 4,168,213,234, 74, 5,117,105,162, 21,148, 74,
+ 37,228,114,185, 45, 9,144, 97,254, 86,190, 36, 75, 83,178, 60, 9,130,112,138,247, 89,237,246, 89,203,223,217,240, 9, 0,176,
+ 44, 11,185, 92, 14, 81, 20,109, 19,179,176,176, 16,249,249,249,182,113, 75,175, 86,107,229, 29,114,101, 50, 25,214,174, 93, 11,
+150,101,209,121,246, 37,144, 50, 57,190, 25,161, 5, 85, 58,220,143,119, 23,130,229,129, 27,155,251, 96,246,236,217,101,114, 25,
+ 42, 2, 69, 81, 24, 55,110,220,115,218,189,253, 43,128, 74,149, 79, 17, 34,124,234,213, 7,138,138,160, 40, 46, 6, 20, 10,176,
+ 10, 5, 60, 44, 22,136,166,167,182,156, 12,233,122, 0,128,140,122,113, 43,162,116, 60, 85, 77, 70, 61, 56,115,230,204, 9, 44,
+203, 54,108,213,170,149,106,252,248,241, 72, 75, 75,195,170, 85,171,138,115,115,115, 87,119,237,218,117,130, 86,171,213, 25,141,
+198,194,164,164,164,175, 94,100, 92, 50,153, 44, 96,195,134, 13,186,155, 55,111,150,233,103,175, 84, 42,209,187,119,111,135,110,
+ 94, 65, 16,176, 97,195, 6,155,208,122, 22, 52, 77,151, 9, 9, 84,118,109, 27, 54,108, 8,141, 70, 3, 81, 20,193,178, 44,150,
+ 45, 91,134,193,253, 58,224,228, 37, 25,214,188,191, 30,164,172,228,225,182,109,219, 54,251, 28,163,114, 17, 24, 24, 24,194,243,
+252,179, 53, 0,238,146, 36, 57, 45, 61, 61,253,185,245,255,206, 64,197,224,251,241,239,143,176, 19,254, 60, 72,185, 30, 4,173,
+ 7, 33,119, 71, 80, 77,119,140,232,175,113,217,117,240,226, 94, 0,213, 42,227,163,105,122,247,212,169, 83,181, 74,165, 18, 87,
+175, 94,133, 92, 46, 47,115,190,154, 53,107,134,145, 35, 71,186, 70, 69, 69, 69, 2,120,237, 69,198,252, 79,128,162,168,237, 99,
+198,140,209,184,186,186,226,254,253,251,149,102,172, 59,130, 36,252,183,109,219,102,227,107,209,162, 5,124,125,125, 85,139, 23,
+ 47,174,146, 18, 96,239, 90, 55, 24, 12,136,141,141,197,225,195,135,209,188,121,243, 50,238,127, 71,185, 69,255, 41, 72, 2,251,
+248,241,227, 21, 90,236,146,119, 64, 82, 80, 78,159,174, 56,167, 85,226, 59,124,248,240,115, 30,133,242, 54,105,229, 67,101, 96,
+199,255,237, 5, 80,171,161,180,174,138,115, 92, 10,152, 36, 73, 8,130,227, 90, 40, 4, 65, 56, 84, 0,130,221,218, 19, 31,245,
+159, 66,173,251,241, 18,130,188,148,104, 83,215,195,118, 33,155,212,242,198,177,203,127,225,157,110, 52, 78,255,250, 23,154,213,
+171,134, 30,109, 27,160, 73,112, 32, 6, 76,114,172, 4,183, 13, 25, 90,167, 52, 7,128, 7, 0, 95, 95,223,128,125,251,246, 57,
+202, 1,104,230,136,207,108, 54,151, 36,152, 29, 59,134,110,221,186, 33, 54, 54,214,102, 13,222,185,115, 7, 77,155, 54, 69, 98,
+ 98,162, 83,150,186, 32, 8,101, 4,191, 92, 46, 47,243,127,181, 90, 13,153, 76,102, 75, 86, 2,240,220, 62,229, 65,202,246, 47,
+ 72, 76, 4,165, 86, 67, 25, 20,100,179,252,105,141, 6,102,157, 14, 22,139, 5,110,149,228, 0,208, 52,125, 39, 45, 45,237, 13,
+ 23, 23, 23,152,205,102, 91,174,131, 4,138,162,108,227,150,203,229,120,240,224, 1, 20, 10,197, 29, 71,156,146, 69,190,119,239,
+ 94, 0,192, 55, 35,180,208,168, 75, 86, 1, 20, 23, 23, 99,213, 8, 45, 62,222, 93, 8,146, 36,241,213, 87, 95,161, 91,183,110,
+149, 30, 47, 77,211,216,186,117, 43, 68, 81, 44, 99,249, 75,222,128,143, 63,254,216,182,106,161, 82,148,238,147,153,153, 9,145,
+ 97,160, 23, 69, 16, 40,153,191,210,245,144, 60, 1, 64,213, 60, 0,193,186, 16, 26, 64,173,246,237, 75, 10,211,148,222, 15, 78,
+ 21, 17, 10,214,133,124,208,176, 97,195,217, 74,165, 50, 53, 51, 51,115,183,175,175,111,248,234,213,171,171,167,164,164,192,213,
+213, 21, 39, 79,158, 84, 78,153, 50,101,234,149, 43, 87, 6, 38, 26,226, 78, 57, 61,168,114,192,243,124,250,228,201,147, 53,215,
+175, 95,127,110,133,128, 32, 8,142, 86, 7,156,238,217,179,231,219,174,174,174, 24, 51,102, 12,148, 74, 37, 6, 14, 28, 8, 55,
+ 55,183,226,243,251,254, 68,203,150, 45, 65, 81, 20,148, 74, 37,166, 79,159,142,251,247,239, 3,192,233,138,146, 90, 25,134,185,
+147,146,146,242,134, 90,173,134,213,106,181,221, 83,199, 78,197,130, 36, 68,144,180,155,237, 1, 58,101,202, 20,196,197,197, 65,
+169, 84, 86, 56,255,120,158, 95,185,101,203,150, 70,222,222,222,120,248,240, 33,242,242,242, 80, 88, 88,248,218,186,117,235, 86,
+ 23,222,252,186,161, 96,201, 35, 72,185,155,248,122,255,245,117,223, 31, 51, 38,144,231,121, 33, 41, 41, 41, 7, 14,146,218,140,
+ 44, 38,110,220,188, 35,122,114,214,118,109,237, 64,109, 25,225, 79,210,238,200,200, 35,176,231,200, 47,133, 22,179,213,113, 74,
+119, 41,172, 86,235,248,149, 43, 87, 30, 30, 57,114,164, 54, 40, 40,168,140,240, 87, 42,149,120,248,240, 33,118,239,222, 93,104,
+ 50,153,198, 59,195,247,159, 2,199,113,163, 55,111,222,124,138,227, 56, 77,235,214,173,157, 94,186,253, 44,164, 4,194,185,115,
+231,106,116, 58, 29, 82, 82, 82,160,215,235,225,226,226,130,154, 53,107, 98,237,218,181,170,143, 62,250,200,105, 37,128,162, 40,
+ 91, 82,241,129, 3, 7,208,174, 93, 59, 52,107,214,172, 76, 62,154, 20,166,253,183, 33, 9,108,103, 54,103,188, 19,162, 40,218,
+ 60, 0,246,158, 4,251,109,223,190,125, 54,190,210,231,159,227, 16,192,248, 16,179, 90, 13, 55, 73,232,155,198,135,152,213, 31,
+135,184, 89, 87,149,159, 4,248,231,181,107,215, 26, 55,105,210, 4, 41, 41, 41, 21,102,245, 74,203,109,254,250,235, 47,136,162,
+152,132,114,214,156, 39,230,199,139,239, 29, 88,197,197,158, 63, 79,253,121, 55,161,140, 53,215,180,142, 47,126, 56,159,128,200,
+ 51, 55,113,238,250, 3, 44, 26,215, 29, 52, 77, 35,168,154, 23,180,249,183, 5, 71, 38,201,233,163,223, 62,253,249, 39,209, 40,
+ 8, 98, 58, 0, 60,126,252, 88,248,226,139, 47, 10,127,250,233, 39,139,180,228, 9,128,237,132,243, 60,159, 81, 17, 23, 65, 16,
+ 92, 65, 65, 1,197, 48, 12, 8,130,176,101,107,210, 52,141, 59,119, 74, 50,207,147,147,147, 33,151,203, 37,107, 88,128,131,135,
+ 7, 65, 16,182,152,127,121, 10,131, 90,173,182,237, 35, 41, 0,206, 90,238,210,190, 47,106,249, 3,128,213,106,141,185,114,229,
+ 74,179, 62,125,250,208, 57, 57, 57,144,203,229,101,110, 28,146, 36,203, 40, 0,151, 46, 93,178, 20, 21, 21, 57,180,164,100, 50,
+ 25, 86,173, 90, 5,171,213,106, 91, 6, 40,197,255,165, 90, 0,171, 70,104, 17,186, 67,142, 25, 51,102, 56, 37,184, 41,138,194,
+164, 73,147,202,181,252,171,114,195,147, 36, 9, 83,214, 35, 48, 12, 3,189,116, 61,204,127,175,244,147, 20, 61,201, 19, 0, 0,
+148,204,185,243, 25,172, 11,233,237,229,229,181,122,216,176, 97, 65,109,219,182,133,193, 96, 64,113,137, 2,230,148, 25, 18, 20,
+ 20, 52,239,250,245,235,190,121,121,121,213,142, 29, 59,246,166,183,183, 55, 20, 10, 5,250,247,239,111, 18, 69,145,252,230,155,
+111,148,155, 54,109, 82,206,156, 57,115, 51,156,176, 52,165, 66, 64,215,175, 95,183, 10,130, 96, 91,254, 39, 8,194,163,125,231,
+215,148,186,248,195,156, 58, 54, 9, 81, 49, 17,253,194, 66,195,107,242, 60,127,175,105,211,166, 84,122,122, 58,250,247,239, 15,
+149, 74,101,187, 79, 88,150,133,213,106, 69, 90, 90,154, 8,160, 94, 84, 76,196,189,138,248,204,102,115, 76, 92, 92, 92,179,176,
+176, 48, 58, 63, 63,255,111, 87, 38, 85,254, 58,231,115,231,206, 89, 76, 38,147,163,249,215, 32, 32, 32, 0,159,126,250, 41, 60,
+ 60, 60,224,237,237,141,218,181,107,227,245,154, 57,193, 95,172, 89,146,103, 44,150, 89, 30,153,222,184, 48,126,252,184,106,237,
+ 67, 58, 52,190,123,247,238,131,172,172,172, 95, 29, 37, 0, 46,249, 33,238,215,185, 67, 67,186,172, 63, 74, 68, 79, 25,172,214,
+214, 9, 42, 81, 0, 72,185, 59, 30,231, 17,248,106,221,225, 66,147,201, 60,228,203, 3,142,235, 50, 72,216,115,118,213,185,225,
+157, 63,238, 23, 25, 25,121,248,131, 15, 62,208,214,169, 83,167,140,240,159, 63,127,126,161,201,100,234, 25, 21, 19,241,210, 75,
+ 12, 95, 6, 81, 49, 17, 23,194, 66,195,123,236,220,185,243,148,175,175,175,166,102,205,154, 47,196, 67,211,244, 28,150,101, 53,
+ 11, 23, 46,116,180,155, 74,163,209,124, 10,192,161, 2, 32, 37,194,173, 89,179, 6,121,121,121,224, 56, 14,139, 23, 47, 46, 35,
+252,171,250, 12,252,167,241, 79, 9,127,224,111, 5,224, 89, 15,192,179,175,255, 84,168,163,188,179,214,111,242,228,201,223,118,
+236,216,177,251,204,153, 51,225,226,226,130,140,140, 12,155,165, 47,151,203, 17, 24, 24, 8,179,217,140,248,248,120,228,230,230,
+198, 1,152, 16, 21, 19, 81,174,213,195,115, 44,228, 84,217, 7,120,137,203,144,194,148,129,109,177,246,192, 37,244, 15,121, 29,
+173, 26,212,116,250, 66, 78,223,122,170,186,253,251, 61,103, 87,121, 3,192,200,240,208,170, 30, 63, 40,138, 58,180,127,255,254,
+161,221,187,119, 39,101, 50, 25,120,158,183, 9, 39,251, 4, 69,179,217,140,239,191,255, 94, 84,169, 84,103, 42, 90, 19, 43,147,
+201,216,176,176, 48, 90,138, 93,170,213,106,155, 55, 66,242, 72,184,187,187,219, 20, 0, 73,128, 85,230, 89, 96, 89,182, 36,219,
+223,206, 21, 38,203,206, 46,179,114, 66,178,252, 43,115,129,241, 60,191,226,192,129, 3, 19, 91,181,106,165,215,235,245,224,121,
+ 30, 4, 65,192,203,203,203, 38, 84, 37,247,127, 66, 66, 2,206,156, 57, 99,100, 89,118,133, 35, 78,201, 34, 63,116,232, 16,236,
+231,165, 36,252, 37, 69, 71, 16, 69,172, 88,177, 2,189,123,247,118,232, 93,146, 66, 30,223,125,247, 93, 25, 15,128,125, 46,192,
+204,153, 51,157,153, 43,226,228,137,147, 9, 0, 8,110, 16,108, 19,242,246,203,197,220,221,221, 65,146,164,205, 19, 0, 56,231,
+ 1, 8,214,133,244,236,215,175,223,177,205,155, 55, 67,175,215,195,104, 52,226,254,253,251,210,220,241, 0,144, 85, 25, 71, 82,
+ 82,210,218,190,125,251, 46,238,215,175, 31,209,165, 75, 23,168, 84, 42,204,159, 63, 31, 9, 9, 9,227, 0,220, 60,114,228,200,
+221,241,227,199, 35, 40, 40,200,191,210, 1,225,239, 66, 64,137,137,137,101,114, 79,250,245,235,247,178,153,220, 17, 43, 87,174,
+164,212,106, 53, 44, 22, 11, 12, 6, 3, 44, 22,139,237, 60,154, 76, 38, 4, 4, 4, 96,246,236,217,196,231,159,127,190, 26, 14,
+234, 0,112, 28,183, 98,219,182,109, 19, 67, 66, 66,244, 62, 62, 62, 54, 11,202,222,213, 41,253,125,227,198, 13, 28, 57,114,196,
+104,181, 90, 29,205, 63,194,207,207, 79,152, 55,111, 30,233,226,226, 2, 23, 23, 23,184,186,186,226,226,177,169,228,242,233,126,
+174,107,127, 32, 48,230,237, 79, 7,240, 60, 47,220,189,251,199,131, 13, 27, 54, 92,164,105,250,108,101, 7, 44, 41, 1,107,247,
+ 63,137,254,232,157, 0,109,112, 29, 61, 30,231, 17, 88,178,246, 72,129,201,100, 30,234,172,240,151, 32, 41, 1, 27, 54,108, 56,
+ 60,123,246,108,237,107,175,189,134, 71,143, 30, 97,193,130, 5, 5, 38,147,169,215,127, 91,248, 75,144,148,128,101,203,150,157,
+242,246,246,118,174,250,216, 51,216,121,106, 89,175,127,106, 60, 22,139, 5,193,193,193,248,246,219,111,203, 24, 13,246,101,224,
+255, 27,150,191, 4, 73, 96, 59,218,170, 50, 62,137,239,189,247,222,171,208,242,127,150,175, 50, 99,138,254, 46, 78, 97, 26, 31,
+ 98,198,248,144,202, 67, 0, 81, 49, 17, 41, 0,122,132,133,134, 15,187,112,225,194,170,105,211,166,249,116,232,208, 1,185,185,
+185, 8, 12, 12,132,191,191, 63,174, 93,187,134,235,215,175,231, 10,130, 48, 3,192,142,168,152, 8,135, 35,144, 30,232,207, 46,
+ 33,108, 94, 47, 0,145,159,141, 40, 35,200,156,137,225, 60,155, 3, 48,188,243,199,215, 3, 3, 3,253, 83, 83, 83, 57,123, 15,
+128,244,183,163, 28,128,226,226,226, 79,246,237,219, 71,239,218,181,235,109, 65, 16, 42,148,196, 50,153,140, 83, 42,149,167,138,
+139,139, 43, 92,230,180,108,251,199,114, 0,152,241,222,215,226,184,113,227,160,211,233, 42,244, 4, 72,214,166, 51, 57, 0,137,
+183,207, 96,195,150,227, 16, 4,241,185,100,184,103,183, 65,131, 28,166, 58, 32, 42, 38,226,105, 88,104,248,168, 47,190,248, 98,
+239,188,121,243,212,213,171, 87,135,213,106,197,186,117,235,108, 85,181, 36,225, 63,125,250,116, 83,113,113,241, 40, 71, 53, 0,
+ 74,207, 13,150, 47, 95, 14,142,227,108,203, 0,165, 66, 64, 74,165, 18,197,197,197,152,185,191,100,149,197,244,233,211, 33,147,
+201, 28, 78, 90,150,101, 65,211, 52, 62,250,232, 35,135,171, 0, 42, 83, 0,142, 29, 61, 38, 7,128, 62,125,251,176, 99,199,142,
+133,151,151, 87,133,215, 67,242, 4, 72,199,227, 4,222, 95,183,110, 29,244,122, 61,114,114,114,112,255,254,125, 92,185,114, 5,
+ 55,111,222,252, 35,209, 16, 87,169,240, 7,128, 68, 67,220, 87,193,186,144,157,167, 79,159, 30,168, 80, 40,134,122,121,121, 5,
+164,165,165, 69, 38, 26,226,246, 0,192,170, 57,123,192,178,172, 45,227,190, 50, 72,133,128,202,241, 0,188,104, 1, 32, 9,150,
+ 99,199,142,193,213,213, 21,251,246,237,227, 60, 60, 60,168,136,136, 8,155,219,255,193,131, 7,220,180,105,211,168,210,194, 79,
+ 22, 71, 68,177, 9,123,158,118,108, 48,124,212,148, 41, 83,246,126,243,205, 55,234,218,181,107,131, 32, 8,108,223,190, 29, 19,
+ 38, 76, 40, 35,252,223,127,255,125, 83, 81, 81,209,168,202,106, 0,112, 28, 39,218, 39,220,202,229,114,228, 60, 37,197,185,171,
+159, 20, 20, 22,201,204, 23,150, 45,187,156,146,146,146,247, 40,227,241,175, 52, 77, 71, 39, 39, 39,167,220,203,143,175,244,160,
+ 37, 37, 96, 77,228,205,232,176,126, 90,237,222,163,151, 11, 76,166,162, 42, 11,127, 9,146, 18,176,108,217,178,195,227,199,143,
+215,110,217,178,165,192,104, 52,254,207, 8,127, 9,146, 18, 48,125,250,244, 83,130, 32,168,255,155, 99, 57,189,103, 12,142,196,
+151,132, 72,237,101,195,179,114, 66,122,158, 56, 21, 18,252,135,225, 68,150,126,149,249, 14, 28, 56, 80,174,229,255, 44,159,211,
+171,191,190,139,115,186, 16, 16, 0, 32, 42, 38, 98,111, 88,104,248,233, 21, 43, 86,124,117,240,224,193, 9, 83,167, 78, 37,220,
+221,221,177,127,255,126,228,230,230,238, 2, 48, 61, 42, 38,226,137, 51, 63,158,149,149,101, 27,124, 69,213,255,170,178,148,237,
+159,204, 1,216,123,238,155, 12, 0,131,157,250, 97, 39, 65, 81, 20,251,225,135, 31,210, 52, 77,163, 73,147, 38,182,144,128, 84,
+160,132, 97, 24,232,116, 58,155, 27,199,145, 2, 32,103,228, 41, 13,124,175,215,238,223,175, 47, 64, 80,182,135,186,125, 19, 36,
+251,173,168,168, 8, 36, 73, 22, 22,213, 47,170,112,137, 83, 84, 76,196,241,176,208,240,193,179,103,207,142,236,214,173,155,186,
+117,235,214, 76,173, 90,181, 32,151,203,145,146,146,130,248,248,120,203,169, 83,167, 76,102,179,121,100, 84, 76, 68,165,177,103,
+146, 36,109,174,125,255, 90, 12,182,199, 23,219, 66, 0, 0,176, 46,186, 24,181,188,101,144, 53,106,136, 21,203,190, 66,255,254,
+253, 29, 94,107,150,101,225,235,235, 91,110, 45,109,123, 5,160, 10, 55,151, 56,227,227, 25, 78,121, 2,164,223,112, 2,202,168,
+168, 40,244,235,215, 15,183,110,221,194,161, 67,135,240,227,143, 63,254,197,178,108,149,124,236,137,134,184, 12, 0,107, 75,183,
+ 50,200,204,204, 52, 89,173, 86,117, 70, 70, 70,133,215,210, 30, 82, 33, 32, 96,248,115,255,179, 15, 15, 72,231,179,146,236,127,
+123, 76, 57,113,226,132, 28,165,165,128, 51, 51, 51,111, 49, 12,195, 40,149, 74,164,166,166, 66, 16,132,198, 17, 17, 17, 43, 81,
+242,108,153, 88, 25, 89,108,194,158,227, 29, 27, 12, 31, 60,122,244,232,200,129, 3, 7,170, 59,116,232,192,212,171, 87, 15,133,
+133,133,184,113,227, 6,206,156, 57, 99, 57,116,232,144,169,168,168,104,100,108,194,158,202,230, 95,130,213,106,109,170,215,235,
+ 65,211,180,205,219,244,123,146,238,143,237, 75, 70, 53, 18, 89, 35, 65,208, 42,168,234, 44, 17, 40,215, 58, 78, 28,106, 89, 72,
+ 74,192,238,195, 23,246,155,139,173,227, 95, 84,248, 75,144,148,128,239,190,251,110,103, 81, 81,209,240,255, 53,225, 47, 65, 82,
+ 2, 84, 42,213,167,248, 47, 21, 1, 82, 40, 20,201,253, 66,216,154,249, 68,213, 90, 77, 60,120,240, 32,249, 63, 52,164,231, 32,
+ 8, 2, 60, 61, 61,203, 24, 97,246,207,168, 23,225,243,242,242,122,110, 5, 21, 69, 81,142,220,254,142,115, 0,162, 67,204,106,
+ 19,220,172,253, 74,172,126,251,247, 14, 77,168,168,152,136,124, 0,147,194, 66,195,191,159, 58,117,234, 81,224,255,107,239,254,
+ 65,155,136,226, 56,128,127,239,206,119,144, 19,148,144, 37,139, 99,113,104, 71, 49,210,160, 71, 37,129, 4,147, 52, 24, 80, 26,
+ 12,130,107, 65, 33,145, 8,213, 81, 20, 42,141, 75,183,162, 99,138,153,130, 13,164,218, 64, 8,136, 34, 56,182,134, 44,145, 14,
+ 70,186,180, 75,123,119, 36, 36,113,200,157, 20, 77,114,151,127,165,210,223,103,123, 67,222, 29,228, 65, 94,126,239,247,126, 63,
+216,218,237,246,124,186,144, 50, 13,161, 25, 24, 99,181, 64, 32, 48,104, 51,155,253,102,179,217,115,209,141, 51, 7, 96, 18, 94,
+190,121, 36, 2, 64, 34,246,170, 29,139,197,224,112, 56,122,254,243, 4,250, 39, 1, 30,178, 67,249,198,221,143,159, 52,245,189,
+165, 3, 57,155,205,246,243, 8, 71, 55,119,159,238, 54,209,167, 40, 91,186,144,202, 71, 61,241,169,124, 62,159, 40, 22,139, 94,
+ 77,211,102,244,207,111,171,170,186,213,104, 52, 86,210,133,212,190,149,103, 10,130,208,118,187,221,157,110,128, 27, 27,224,121,
+ 30,111,123,116, 5, 12,135,195, 16, 4, 1,173, 86,171,235,247,203, 24,171,201,178,108,121,189,152,173, 21, 96,176, 72, 0, 96,
+ 45, 39,163,114, 80,186,117,217, 46, 47, 38,147,201, 32,128, 26,128,111, 0,214, 42, 7, 37, 75, 63,214, 86,100,179,217,100,165,
+ 82, 89, 42,151,203,203,175,241,100,164,185,140,227,129,106,181,250,231, 22, 74, 40, 20,178, 20, 90,208, 55,250,183,141,113,212,
+ 19,223,140, 68, 34,243,250,112, 51, 93, 72,125, 7,208,191,194,201, 95,138, 59,235,249,185,233,133,169, 76, 38,147,200,229,114,
+ 94, 85, 85,103, 0, 64,146,164,109, 69, 81,182,234,245,250, 74,113,103,221,116,253, 9,130,240,216,229,114,117,189, 5,112,225,
+202, 51,227, 58,240, 72, 94,188, 43,125, 69,167,166,195, 88,232,137,111,151,198, 53,223,164,232,155,147,161, 26, 61,141,131,166,
+105,179,215,239,255,250,172,170,171,150,147, 17, 36, 73,250,161, 40,202,236, 36,223,203, 32, 50,182,231,247,251,135,233,222,215,
+ 53, 66, 40, 50,182,231,243,249,134,153,111,232, 8,159,229,118,192,100,112,241,123,203,117,158,231,251,198,247, 69, 81,108, 57,
+157,206,243, 15,159,223,249, 39,107,250, 36,219, 1, 71, 61,113, 14, 0,204,142,115,254, 7,199,219, 1, 31, 23, 12, 5,235, 48,
+217, 45,115, 28, 7,251, 85,251,197,165,197, 7, 3, 85, 2, 60,237, 70,140, 0, 76,220,220,244, 2, 7, 0,102,213,249, 8, 33,
+131,105,126,144,175,181,120,124, 49,198, 28,224, 63,231,237, 68,178,104, 3, 64, 8, 33,132,156, 65, 39, 91, 54,137, 16, 66, 8,
+ 33,167, 2,109, 0, 8, 33,132,144, 51,232, 55, 68,174, 55,250, 74,146, 7, 83, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
+ 0};
+
diff --git a/source/blender/editors/datafiles/splash.jpg.c b/source/blender/editors/datafiles/splash.jpg.c
new file mode 100644
index 00000000000..c1ca8b575e6
--- /dev/null
+++ b/source/blender/editors/datafiles/splash.jpg.c
@@ -0,0 +1,2483 @@
+/* DataToC output of file <splash_jpg> */
+
+int datatoc_splash_jpg_size= 79258;
+char datatoc_splash_jpg[]= {
+255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0,255,225, 0, 22, 69,120,
+105,102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0,255,219, 0, 67, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2,
+ 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,219, 0, 67, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,192, 0, 17,
+ 8, 1, 15, 1,245, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1,255,196, 0, 31, 0, 0, 1, 3, 5, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 7, 10, 3, 5, 6, 8, 9, 2, 1, 11,255,196, 0,103, 16, 0, 1, 3, 3, 2, 4, 3, 4, 6, 4, 7,
+ 11, 5, 9, 13, 9, 1, 2, 3, 4, 5, 6, 17, 0, 7, 8, 18, 33, 49, 19, 65, 81, 9, 20, 34, 97, 10, 21,113,129,145,240, 35,
+ 50,161,193, 22, 23, 24, 66,177,209,225, 25, 26, 36, 40, 51, 56, 73, 82, 98,232,241, 72,104,105,136,168, 41, 52, 57, 67, 84, 88,
+120,150,178, 37, 38, 68, 83, 87,115,130,135,147,152,181,200,210, 54, 89, 99,114,146,184,213,214,215,255,196, 0, 29, 1, 0, 0,
+ 6, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 6, 7, 1, 4, 8, 9,255,196, 0, 80, 17, 0, 2, 1,
+ 2, 4, 4, 3, 4, 6, 7, 5, 7, 0, 7, 9, 0, 1, 2, 3, 4, 17, 0, 5, 18, 33, 6, 19, 49, 65, 7, 34, 81, 20, 97,113,
+240, 8, 35, 50,129,161,209, 21, 66, 82,145,177,193,210, 36, 51, 98,162,225, 9, 67, 83, 84,114,130,241, 52, 56, 68, 85,116,148,
+211, 22, 23, 24,115,131,146,147,180,181,255,218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,159,198,150,150,150,134, 6, 22,
+150,150,190,100,122,143,199, 67, 3, 31,116,203,220, 60, 68,108,181,171,123, 70,219,170,254,224,209, 41,183,140,167, 25,101, 20,
+135,189,241, 73,101,249, 28,165,136,243,170, 77, 69, 84, 74,116,149,133,163,149,185, 15,180,226,185,211,132,158, 97,151,159, 35,
+212,126, 35, 92,108,227, 63,131, 43,145, 85,251,143,120, 54,213, 18,235,236, 86, 37,191, 87,185,237,148,243, 72,170, 67,146,224,
+ 11,147, 81,162,128, 57,167, 69, 42, 5, 75,143,213,230,242, 75, 94, 34, 50,148, 86,158, 42,113, 39, 27,112,159, 14, 38,119,193,
+ 60, 55, 23, 19,212, 81,204,173, 89, 4,134, 67, 34,209,128,198, 87,130, 56,138,188,146, 2, 0,242,151, 49,169, 50,114,101, 1,
+128,179,188, 40,225,158, 7,226,222, 37,108,143,142, 56,150,110, 23,166,172,133,150,142,120,196, 98, 54,173, 44,162, 36,158, 73,
+ 85,146, 56,200, 44,124,193, 4,140, 4,124,232,139, 41, 61,145,109,196, 58,132,173,181, 37,104, 80,200, 82, 72, 32,131,243, 26,
+247,174, 11,240,211,199, 61,219,180,206, 66,179, 55, 36, 79,186,108,118, 29, 68, 54,166, 58, 92,122,228,181,217, 65, 13, 22,219,
+ 47, 30,106,157, 61,174, 95,242, 14, 16,243, 97, 37, 45, 44,128,150,181,219,219, 46,247,181,247, 6,129, 2,231,180, 43, 48,171,
+148,106,139, 65,216,211, 33, 58, 29, 65,232, 57,219,113, 63,172,203,233, 86, 66,219, 88, 74,208,160, 66,146, 14,147,240,211,197,
+174, 19,241, 67, 46, 53, 25, 37, 79,179,102,180,202, 13, 86, 95, 49, 2,166,156,244, 38,219, 9, 97,213,178,207, 29,212,220, 7,
+ 17,201,120,194,158, 38,248, 69,197,190, 22,102, 66,159, 60,166,246,156,166,165,136,165,204, 33, 4,210,212,142,160, 95,115, 12,
+218,119,104, 36,179, 11, 18,134, 72,237, 33,202,244,180,180,181,103,226,173,194,210,210,210,208,192,194,210,210,210,208,192,194,
+210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,
+215, 13,125,163,254,220, 13,158,224,130,240,159,178,214, 5,156,238,249,111,173, 45,150, 21,116, 81,219,173,155,110,200,219,199,
+ 39,194, 98,116, 8,215, 53,192,138,116,167,170,213,245, 68,151, 17,255, 0,171, 32,177,132, 50,233, 76,186,132, 39,249, 26, 91,
+214, 67,195,217,207, 19,102, 9,149,228,116, 47, 95, 90,224,177, 85, 42,161, 80, 16, 11,200,238, 85, 35, 64, 72, 5,157,128,185,
+ 10, 46,204, 1, 98,226, 46, 38,200,248, 79, 45,124,219,136, 51, 20,203,104, 81,130, 6, 96,204,206,237,114,169, 28,104, 26, 73,
+ 28,128, 78,148, 86, 58, 85,152,128,170,196,119, 43, 75, 80,124, 63, 73,159,141,131, 84, 83,195,103, 56, 94, 20, 82,242,212,138,
+127,240,103,117, 13, 77, 44, 20,171,195,105, 85,127,227,115,194, 91,193,101, 37, 75, 16,146, 20, 1, 1,180,147,204, 58,247,192,
+ 39,183,219,102,184,168,189,173,253,156,222,171, 32,236, 38,233,221, 18,227,210,109, 58,154,110, 6,238, 13,182,188,107,111,132,
+162, 53, 29,138,204,184,113, 36,218,181,233,114, 84, 26,131, 10, 91, 82, 88,144,233, 68,118,234,107,152,244,120,206,205,115,175,
+ 7,248,243, 35,161,151, 49,169,202, 86,166,150,157, 75,200,105,230,142,102,141, 64,185,102,140, 17, 33, 10, 55, 98,138,225, 64,
+ 44,108,160,156, 64,178, 47, 27,188, 58,226, 12,194, 28,174,151, 57,106, 90,186,150, 9, 16,169,134, 72, 82, 71, 38,202,171, 35,
+ 3, 26,179, 27, 5, 18, 50, 22, 36, 42,130,196, 12, 72, 35, 75, 94, 80,180,173, 41, 90, 8, 82, 84, 1, 73, 29, 65, 7,204, 29,
+122,213, 97,139,107, 11, 75, 75, 94, 29,117,182, 91,113,231,156, 67, 76,180,133, 56,235,174, 41, 40,109,182,208,146,165,184,226,
+212, 64, 66, 2, 65, 36,147,128, 6, 78,134, 6, 61,233,107,140, 28, 63,123, 94,236,238, 39,253,160,119,151, 9,219, 61,108,210,
+ 43,219, 63,103, 88,247, 29, 77,157,231, 77, 86, 91,178,239, 43,178,215,171, 80,169,213, 69,219, 84,214,227,166, 57,178,252,106,
+195,236,197,150, 92,117, 83,126,173,247,214, 23,238,178, 89, 3,231,181,219,218,129,127,123, 56, 15, 15,137,177,182,194,209,220,
+115,188,169,221, 85, 85, 13,213, 86,172,210,254,165,254, 47, 78,219,136, 94,225,245, 74, 79,188,123,199,240,222, 95,139,226,126,
+167,184,183,201,250,202,212,182, 30, 7,226,105,179,220,183,134,191, 71,242,179,156,218, 1, 81, 12, 50, 72,136,121, 70, 41, 38,
+ 5,203, 48, 17,183, 46, 39, 37, 28,171,130, 52,149, 12,109,136, 92,222, 32,240,164, 60, 61,154,241, 87,233, 46,118, 69,147, 78,
+105,167,158, 56,228,145,121,162,104,160, 34, 48,170, 90, 84,230,202,138, 36,140, 50, 48, 58,149,138,139,227,180, 26, 90,134, 23,
+247,207,155,251,255, 0,155, 30,209,127,235, 93,227,255, 0,232,210,254,249,243,127,127,243, 99,218, 47,253,107,188,127,253, 26,
+152,127,247, 29,226, 55,254,233,139,255, 0,155,166,255, 0,234, 98, 19,255, 0,226, 11,194,239,253,245, 55,255, 0, 37, 87,255,
+ 0,210,196,207,116,181,166,252, 3,241, 57, 89,226,255, 0,133,157,171,223,235,138,219,165,218, 85,203,250,153, 89,157, 81,183,
+232,178,101,204,165,211,157,166, 93, 53,202, 3,109,195,147, 56,120,175, 33,108, 82,154,113, 69,125, 66,221, 80, 29, 0,214,228,
+106,172,174,163,168,203,171,107, 50,250,180, 17,213, 80, 75, 36, 50,168, 33,128,146, 39, 40,224, 48, 36, 16, 25, 72,184, 36, 30,
+160,219, 22,246, 95, 93, 77,154, 80, 80,230, 84,110,100,163,204, 97,138,120,152,130,165,163,153, 22, 68, 37, 88, 6, 82, 85,129,
+ 32,128, 71, 66, 47,133,165,165,165,173, 92,110, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,
+105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,107,
+ 3,168,110, 45, 6, 60,249,116,122, 75, 21,123,182,183, 5,239,118,155, 75,181, 41,174, 85, 12, 9, 92,174,168,197,170, 85,150,
+166,169,212,105, 67,194, 32,183, 54,108,117,130,164,229, 32, 40, 29, 12, 12,103,154, 90,104,166,239, 21, 38,143, 91,167,219,119,
+ 13,169,123,209, 43,245,152, 83, 39,208,233, 9,165, 83, 46,121,213,134, 41,225,159,126, 83, 12, 88,181,170,177,130,134,188, 97,
+151, 38,251,171, 42,228, 95, 35,139,228, 86, 47,143, 95, 53, 54,130,157,111,109,119, 6, 76, 70,208, 28,118, 91, 44, 90, 40, 45,
+183,221,106, 77, 58, 85,222,220,217, 43, 74,114, 75,108,197,113,213, 99,149,182,214,178, 18, 70, 6, 28, 29, 45, 88,232, 23, 37,
+ 18,231,136,236,202, 36,244, 76,110, 60,135, 33,205, 97, 77,191, 18,125, 54,115, 56, 47, 83,234,212,201,141, 55, 38,149, 80, 64,
+ 82, 10,216,146,211, 78,164, 45, 36,160, 5, 2,111,154, 24, 24, 90, 90, 90, 90, 24, 24, 90, 90, 90, 90, 24, 24, 99,120,143,168,
+110,117, 51,103,174,233, 91, 65, 29,201, 23,200,138,203,116,255, 0,119,109,167,170, 12, 69,114, 67,104,169, 72,165, 50,240, 40,
+118,166,136, 69,226,200, 32,144,175,137, 0,184, 17,174, 20, 60,223, 25, 18, 95,121,199,215,190,238, 72, 83,138, 83,202, 92,139,
+187,156,186,165, 18,178,175,210,126,183, 54,117, 36,133, 36, 40, 16,160, 8, 61, 8, 35, 32,253,218,208,158, 40, 56,198,176, 54,
+ 85,185,246,165,163, 22,151,119,238,105, 66,153, 92, 54,212,151,168,214,187,171, 78, 67,245,249, 12, 43,244,179, 83,148,148,194,
+109, 65,206,185,121,108,167,148, 47,157, 60,116,224,190, 27,204, 99,139,140, 56,175,196,124,203,131,114,188,170, 14, 66,193, 75,
+ 56, 17, 77, 38,167,144,114, 96,182,185, 42,165,190,146, 16, 51, 50, 70,132,233, 84,102,199, 72,120, 15,198,220, 77,151, 75, 55,
+ 7,112,151,134,185,103, 26,102,153,172,252,246,158,170, 2,101,134, 61, 49,198,121,211,223, 68,116,145, 17,172, 23,210,170,242,
+ 53,139, 51,170,227,143,215, 53,223,196,133,153,238,191,194,219,167,117,237,195, 59,196,247, 52,214,107,151, 20, 5,201, 13, 99,
+196, 83, 45,200,148,149, 45, 41, 42, 0,144, 49,147,140,231, 88,195, 91,199,188,114, 93,109,134, 55, 39,112,100, 60,226,194, 90,
+101,171,158,186,235,142, 44,159,133, 40,109, 50,201, 90,179,216, 0, 78,177,155,198,244,186,247, 18,225,151,114, 93,181,137,181,
+218,221, 69,209,207, 34, 82,202,131,105, 39, 13, 68,134,194,112,136,145, 17,156, 33,166,210,148, 36,118, 25, 36,157,221,188, 47,
+ 45,145,246,104,112,186,239, 19, 59,221, 70, 93,217,123,214,159,133, 73,179,173, 8,106,140,213,106,227,187, 42,177, 94,153, 78,
+181,233, 18, 37,182,177, 72,167,177, 22, 51,207,212,167,150,214, 25,110, 59,132, 37,229,170, 52,119,121, 7,194,159, 15,120,203,
+198,222, 60,159,134,248, 23,136, 51,106,108,146, 23, 75,212, 85,212,201, 45, 66,164,141,162, 37, 49,195, 36, 81, 52,243,178,187,
+ 44, 97,214, 56,145, 92,188,204,177,150,110,196,241,107,196,110, 10,240, 51,128, 32,226,126, 62,225,252,162,167, 58,153, 28,251,
+ 61, 37, 52,112,211, 51, 70,161,230, 97, 36,209,203, 42,211,192,172,138,210, 20,105, 37,118,141, 82, 21,105, 2,174,163, 72,218,
+189,222,170,162, 69,126, 85,135,123,206, 76,183, 23, 46, 77, 77,218, 13, 81,227, 33,199,137, 91,146, 29,120,199, 37,106, 82,148,
+ 73, 81,238, 73, 58,203,118, 91,127, 55, 47,135,155,149,114,173,233, 18, 19, 1,201, 8, 23, 5,159, 86, 18, 27,166,212,210,217,
+229, 80,122, 50,192, 84, 10,130, 81,144,135,219, 1,196,246, 80, 91,101, 77,171,150, 85, 47,164,143,198, 35,151, 97,170, 81,118,
+183, 97,169, 54,130, 37,133,179,102, 61,111, 92, 53, 14,120, 40, 95,195, 22, 93,192,171,133,185, 46, 62,166,176, 22,235, 65,161,
+204, 74,144,218, 6, 18, 59,121,195,151, 16, 59, 31,237,121,225,250,232,188,108,251, 74, 62,216,241, 35,181,232,138,205,221,106,
+ 37,246,165,173,185,210, 97,201,126,152,244, 42,139,108,182,186,213,159, 85, 16,103, 34, 50,222,109, 50, 33,200,136,182, 92, 7,
+194, 14,201,234,207, 16,126,128,222, 38,248, 71,147,143, 16,120, 59,138,106, 38,207, 50,127,174,217,162, 46,210, 29,204,124,216,
+156,104,105,141,227, 9, 42, 77, 79, 51,176,134, 89, 64,146,237,200,222, 28,127,180, 43,194,191, 25, 51,195,225,207, 24,112,181,
+ 60, 89, 30,113,245, 32, 50,202, 17, 98, 29, 36, 17, 76,191, 88,176,139, 72,205, 19,193, 81, 10, 35, 77, 20, 76, 99, 32,118, 27,
+ 96,248,137,177,183,250,218, 21,123,106, 66,161,213,225, 37,166,235,214,228,213,160, 84,232,242,156, 78, 64,113, 41, 56,147, 13,
+101, 43,240,159, 71,192,224, 65, 7,149,105, 90, 19,106,226, 39,139,222, 29,184, 78,110,198,145,196, 38,229, 82,246,206, 6,226,
+214, 42, 20, 27, 86,171, 91,137, 84, 93, 38, 85, 78,151, 17,153,211, 89,157, 82,131, 5,214,105, 13,162, 43,237,171,196,148,182,
+ 91, 86, 72, 74,138,129, 26,224,102,199,110,133,115, 99,247, 86,135,116,199, 84,134, 26,129, 81,250,170,231,166, 5,148, 9,180,
+119, 95, 17,234,144,223,108, 28, 41,230,185, 75,173,103, 33, 47,197, 65,236, 8, 56,167,210,118,170,198,173,240,251,194, 53, 82,
+ 35,168,126, 52,237,202,189, 36,178,235,106, 10,109,214,222,179,169,238, 54,226, 20, 58, 41, 37, 10, 4, 31, 67,171, 87,232,151,
+199,112,248,245, 61, 22, 67,196,119,203,243,234, 9,141, 61,127,179,133, 66,234,105,230,150, 10,168,209,213,213, 57,175, 11,164,
+177,216,133,120,223, 78,133,116, 11, 85,125, 48,120, 26,127,163,229, 30, 99,196, 92, 52, 23, 49,200,107, 97, 90,156,188, 84,150,
+112,140, 42, 96,138,162,146, 87, 70, 70,147,148,147, 35,197, 32, 96, 89, 36,143, 86,182, 71, 38, 80,214, 61,247,102,238,101,169,
+ 68,190,118,250,231,162, 94, 86,117,203, 5,186,157, 2,229,183,106, 17,170,180, 90,196, 7, 74,146,220,186,125, 66, 35,138,110,
+ 83, 5, 72, 80,230, 66,136,202, 72,238, 8,214, 89,168, 64,112,175,237,189,221,253,134,225,159,102,120,123,225,163,133,105,251,
+189, 82,218,155, 26, 53, 58,249,186, 43,172, 93, 53, 88,104,168, 59, 62,163, 61,244, 83, 40, 54, 52,101, 57, 18,156,216,146, 0,
+149, 42, 82, 84,242,185,200,142,216, 71, 50,250, 53,193,103,210, 48,176, 55,151,114, 45,253,161,226,123,106,154,216,235,138,230,
+171,179,111,210,175,154, 45,102, 69, 70,198, 98,189, 45,246,226, 66,166, 92,208, 43, 49,218,153,107, 54,228,197,120, 94,244,183,
+101, 50,219,175, 32, 72, 17,218, 11,121, 61, 57,156,120, 63,198,153,119,233, 74,154,108,168,214, 80, 80, 73, 45,180,205, 3,212,
+154,116,102,229,204,244,233, 33,144,107,140, 7,210, 20,181,143,217, 29,185,103, 35,241,187,128,243, 63,209, 20,149, 89,184,162,
+204,179, 40,225, 7, 84, 53, 9, 74, 42, 93, 19,153, 2, 84,188, 98, 35,203,145,140,122,139,232,184,251,102,226,253,250,171,113,
+ 37,195,245, 6,251,107,107,171, 91,211,182, 52,173,200,122,165, 79,163, 51, 98,207,189,104, 17,110,183,106,213,101, 50,154, 93,
+ 53, 20, 39,167, 9, 42,157, 33, 82, 99,134, 90, 13,243,184, 95, 72, 64, 60,195, 47, 80, 32,128, 65, 4, 17,144, 71, 98, 53, 2,
+158, 50, 84,211,191, 72, 26,128,243, 1, 10, 14,113, 65,195,147,232, 82, 80,159,137,193, 34,193, 91, 78,246,248,156, 5, 45,144,
+174,224,164, 16,122, 13,118, 87,143, 15,111, 68, 62, 31,247, 89,238, 25,120, 83,218,134, 55,231,120,232,117, 24,214,189,203, 90,
+170, 59, 86,145,107, 83,239, 39, 22, 24,122,204,183,168, 86,222, 39,222, 53,230, 36, 56,219, 82, 84,212,136,236,177, 41, 11,138,
+145, 33,196, 56, 91, 91, 48,240,167, 51,118,225, 88,120,116,201,154,212,103,249,106,102, 51,243, 57,112,197, 76,172, 19, 86,169,
+ 89,130, 8,193,123, 6, 98, 25,182, 0, 19,182, 17,203, 60, 97,202,145, 56,190,163,137,196,121, 61, 47, 14,230,178,101,148,252,
+190,100,210,213,186,151,211,162, 37, 82,237, 35, 4,185, 84, 5, 84, 92,179, 1,190, 36,133,165,168,139,220,190,218,255, 0,106,
+111, 13,237, 80,239,190, 41,184, 29,183,169, 27, 89, 90,168, 69,138,228,225, 66,187,237, 23, 16,167,193,117, 20,246, 46, 35, 90,
+169, 70,163, 85,156,101, 14,120, 77, 84, 34,149,172,182,172, 54, 74, 84, 7, 85, 46,223,109,143, 13, 22,231, 5,182, 47, 26,148,
+171,102,247,187,237, 43,183,112,233,251, 83, 88,178, 40,166,138,205,225,100, 95, 50, 40, 85,218,228,250, 85,194,221, 66,123,108,
+120, 76, 51, 65,115,145,214,150,161, 37,154,132, 89, 13, 39,195,116,242,177,215,248,105,197,180, 35, 47,120,168,226,205,105,243,
+ 57,189,158, 25,168,170, 33,169,137,167,177, 60,146,241,185, 8,246, 6,193,244,130, 65, 0,146, 8,196,131, 46,241, 91,131, 43,
+206,100,147, 87, 77,147,212,229, 48,251, 76,240,215,211, 79, 73, 50,211,220, 14,112,142, 68, 5,227,187, 45,202,106, 32, 16, 72,
+ 0,223, 29,148,210,212, 92,183, 35,233, 31,162,243,160,209,233,124, 25,112,161,184,187,163,185, 51, 34, 63, 58,227,131,120, 83,
+170,147,233,118,147, 44,202,113,150,152,250,163,111,196,153,119, 10,221,142, 27,116,188,153, 48,153, 96,159, 12,248,202, 37, 72,
+198,248, 54,250, 69,151,109,251,190,214,214,200,241,107,178, 86,230,220,166,238,185, 96,217,113, 46,235, 45, 87, 21, 53,219, 86,
+231,169,204, 77, 62,159, 26,239,181,110,153, 50, 30, 76, 37,212, 94,142,195,174,178,251, 78, 69, 46,135, 23, 29,196,133, 99,108,
+248, 71,199,171, 65, 85, 94,249, 46,143, 99, 86,119,128,205, 7,180,136,210,247,113, 0,144,200, 87, 98, 84, 91, 83,129,116, 86,
+ 4, 95, 68,120,211,225,211,102, 52,121,116,121,233,147,219,157, 99,142,160, 83,212,123, 33,145,237,166, 51, 80, 99, 17,134,243,
+ 0,198,250, 99, 38,210, 50,144,109, 43, 29,120,113,198,217,109,199,157, 90, 91,105,164, 45,199, 28, 89, 9, 67,109,161, 37, 75,
+ 90,212,122, 37, 33, 32,146,124,128,215, 14,253,164,222,219,221,157,224, 86,233, 59, 61,101,218, 15,111, 86,249, 34,155, 14,165,
+ 92,161, 49, 88, 69, 18,210,176, 89,169,199,110,101, 41,155,170,176,220,103,222,151, 90,126, 19,172,190,154,124, 86,130,209, 30,
+ 75, 79, 63, 37,143, 17,182,220,230, 77,175,244,142, 56,132,142,220,122,222,253,112, 91,245, 86,205, 92,140,191, 79, 85,221,100,
+ 38,245,165, 74,102, 61, 69,151, 99,183, 46,153, 83,187,226,187, 77,174,184,128,224, 80,100, 59, 27,198, 13,148,165,214,201,230,
+ 8,229, 94, 22,113,190,113,150, 83,230,244,153, 69,168,170,198,168,121,147, 65, 20,147,169, 23, 6, 24,228,145, 93,245, 13,211,
+ 97,172, 88,173,193, 4,175,156,120,191,192, 25, 38,109, 81,146,214,231,119,174,163, 58,103,229, 65, 81, 52, 84,237,123, 17, 52,
+177, 70,232,133, 78,207,185,229,155,135,210, 65, 2, 71,219, 95,199,191, 8,187,217,187,147,118, 59,104, 55,194,208,220,189,198,
+166,208,234, 87, 13, 70,153,102, 59, 46,189, 76,133, 76,164,205,137, 79,158,183,238, 88, 81, 85, 78, 18, 91,151, 54, 58, 11, 41,
+148,167, 73, 89, 33, 4, 37, 68,109,254,160, 19,244,127,110,123,126,214,227,115,113,175, 26,237, 82, 45, 14,212,183,182, 43,113,
+ 46, 74,213,102,160,164,196,131, 73,183,233, 85,139,126,167, 62,165, 57,121, 34, 52, 86, 32, 48,235,174, 30,161, 9,104,247,198,
+186,103,185, 63, 72, 83,125,183,147,120, 38,237, 23,179,215,133,198,183, 45,182,164, 77, 98,145,112,222, 16,174, 10,229,197,113,
+192,167, 58, 82,245,199, 30,212,183,230, 68,102,215,162, 45, 1, 42, 11,168, 75,116,161,181,165, 79,248, 14, 57,225, 53, 36,226,
+ 95, 8,115, 26, 94, 38,172,201,120,104, 61, 93, 6, 89, 75, 4,245, 53,117,114,195, 4, 81, 25, 67,146,100,145,185,104,163,202,
+ 74,160,212,224, 2, 73, 32, 18, 34,220, 41,227, 94, 89, 89,194,148, 57,247, 21,178, 81,102, 57,181,101, 69, 61, 45, 29, 20, 83,
+212, 77, 48,132,160, 2, 56,151,153, 35,155,184, 12,231, 66, 18, 85, 64, 4,128,101,135,165,168,156,219,158,223, 30, 44,184,114,
+221, 75,123,111,253,161,252, 36, 55,183,244, 42,247,131, 37,117,235, 78,155, 93,160, 92, 80,232,239,201, 68,119,171,244,186,109,
+102,169, 54,159,121,211,227, 40, 44, 58,212, 57,113,220,230, 73, 71,139,226, 0,218,186, 89,198, 87,182,211,135, 30, 14,235, 27,
+ 75, 6,163,102,223, 59,171, 70,222, 93,176,167,238,197,161,117, 88, 18, 40, 31, 82,200,182,106,181, 25,180,248, 5, 70,177, 61,
+135,125,225,126,226,183, 10,124, 49,200,151, 18,149,128,224, 82, 83, 20,171,240,211,140,105,171,114,250, 40,178,177,152,182,106,
+143, 37, 52,148,179, 67, 60, 19,172, 66,242, 24,230, 71,208, 74, 13,202,146, 26,219,128, 70,248,152,209,120,173,192,245,116, 57,
+149,124,217,177,202,215, 39,120,227,171,138,178, 9,169,234, 41,218, 83,166, 46,100, 14,156,192, 28,236, 25, 67, 45,246, 36, 29,
+177,217,173,112,163,112,253,133, 28, 55, 95,188,105,212,248,162,173,202,171,215,108,187,186,163, 93,190, 47,125,152,175,202,157,
+ 87,160,214,183, 90,175, 85,141, 82,118,228,122,179, 46,114,165,201,181,228, 73,126,179, 50,101, 17,245, 57, 25,115, 93,105,180,
+ 56, 41, 5,116,160,202,240,191,237,190,220,158, 50,248,231,219, 77,158,218, 29,130,147,111,112,189, 93,145,119,193,184,247, 10,
+229,165,214,170, 87,151,189,209,182,206,237,185,233,142,205,168,210,100,170,143,106, 52,237,203, 71,166, 71,110, 59,134, 83,174,
+180,249, 30, 48,117,228, 33,185, 31,161, 92,200, 74,187,115, 37, 42,199,166, 64, 58, 74,170, 30, 49,240,218,181,169, 26,169,242,
+ 74,252,226,140, 25, 82, 41, 81,156, 65, 43,200,129, 36, 40, 91,149, 48,104,217,133,136,150, 59,130, 25, 75, 17,133,169, 38,224,
+127, 20,232, 22,181,105, 35,207,242,236,146,184,136,164,154, 23, 84, 53, 16,164,110, 94, 33, 32, 83, 44, 44,178,170,155,131, 20,
+182, 33,149,130,131,134,126,151,176,123, 71, 74,180, 27,176,226,237,253,162,205,158,136,126,226, 45,102,173,218, 59, 86,224,136,
+ 80, 27, 49, 69, 13,184, 98, 40,143,200, 0,228, 13,114,224, 99, 24,212, 4,189,180, 92, 57,109,223, 10,156,122, 93,182,174,205,
+192,141,105,218,119, 45,169,102,238,133, 50,218,161,145, 14,159,102,213,171,255, 0, 88, 69,169,211,168,140,199,193,165, 66, 53,
+106, 19,243,227,176,217, 74, 34,138,178, 89,140,150,163, 54,195, 77,254,136, 21, 90,173, 54,133, 75,169, 86,235, 51,225,210,168,
+244,120, 19, 42,149, 90,165, 66, 67, 81, 32, 83,105,180,248,238, 75,157, 62,108,183,214,148, 70,136,204, 86, 93,113,199, 22,160,
+132, 33,181, 41, 68, 0, 78,191, 57, 62, 35,175,107,151,218,161,237, 50,184, 37,109,235, 50,196, 29,229,220,202, 77,141,183,190,
+ 43, 14,184,170, 30,215, 90, 80,163, 80, 97,220,243, 97, 43, 10,140,219,118,133, 14,117,126,160,198, 73,109,217, 50,144,146,162,
+ 19,155, 39,192, 39,174,139, 62,226, 12,218,122,167,135, 34,160,161,145,235, 29,217,140, 69,217,213,208,184, 38,197,194, 71, 52,
+154,236, 88, 42,184,189,156,131, 86,125, 35,211, 47,155,135,120,111, 38,167,164, 73,184,135, 50,204, 35,142,133, 17, 84, 74, 17,
+ 81,146, 64,132, 0, 66, 51,201, 4,122, 1, 10, 89,144,218,233,113, 61,206, 11,119, 14,189,187, 28, 40,240,239,185, 23, 75,138,
+118,228,190,118, 83,107,110,250,243,171, 32,173,202,197,203, 99,208,235, 85, 53,168,134,209,146,102,205,124,159,129, 61, 79,234,
+167,176,217,253, 55, 59, 75,100,210,182,231,110,237, 11, 38,133, 20, 65,162,218,246,245, 30,223,164, 66, 7,152, 68,165, 81,169,
+241,233,212,232,193, 88, 25, 13,196,142,210,123, 15,213,211,141,170, 34,178, 72,102,172,170,154,158, 62, 77, 60,178, 59, 34,126,
+202, 51, 18,171,255, 0,106,144, 62,236,116, 69, 12, 83,193, 69, 71, 5, 76,188,250,152, 98,141, 36,127,219,117, 64, 29,191,238,
+ 96, 79,223,133,168,165,123,119,125,170,238,209, 91,175,240, 39,195,117,192,235,151, 29, 77, 14, 81,120,135,190, 40, 15,243,187,
+ 74,135, 49, 41,105,123, 57,111, 76,138,162,181,214,165, 33,194, 46, 23, 26, 41, 49,152, 90, 40,225, 78, 63, 38,166,204, 61,237,
+246,205,251, 82,224,240, 79,182,174,108,238,209, 85,161,203,226,135,116, 40,142,253, 82,227, 78, 37,255, 0,226,146,206,156,167,
+161,191,184, 53, 54, 18, 8, 53,247,252, 41,108, 80, 99, 56, 82, 61,229,165,212,159, 75,177,161, 8,147,185, 93,236,136,246, 94,
+213,106,214,149,199,198,255, 0, 17,212,217,179,238, 10,173,173,115,221, 27, 61, 64,185, 22,228,217,136, 85, 70,147, 62,106,247,
+ 98,229, 19,146,183,100,220, 18,214,234,221,164,120,203, 82,154,110, 66,170,174, 5,201,122, 11,177,110, 14, 3,225,236,179,135,
+178,212,241, 23,140, 33,215, 71, 11,133,202,168,154,193,235,170,175,228,151, 73,191,212,196,192,178,146, 8, 37, 76,132, 21, 68,
+ 89,105, 31, 17,120,151, 54,226,108,214, 79, 12, 56, 34,126, 93,116,209,151,206, 43,214,229, 40, 41, 45,231,132, 50,145,245,242,
+169, 10,202, 8, 32, 50,196, 8,105, 29,161,210,223,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199,236,141,116, 43,233,
+ 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,207, 95,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199,
+236,141,116, 43,233, 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,106,102,159,250,197,112,231,255, 0, 5, 39,
+255, 0,208,175,197, 59,147,255, 0,234,195,197, 95,252,124,127,255, 0,161,150,227,167,222,201,206, 30,246, 78,244,224, 27,134,
+234,253,209,181,155,125, 93,172,206,219,232,206,205,170, 85,108,219,118,161, 80,150,239,214, 85, 36,151,101, 76,151, 78, 91,146,
+ 29,229, 74, 71, 50,212, 78, 0,235,174,142,127, 36,254, 28,127,249, 20,218,239,253, 65,181,127,255, 0, 21,168, 67,236,206,242,
+251,107,106, 27, 11,183,118,135, 14,118,230,248,218,123, 35, 96,219, 49,169,246,138,246,239,108,225, 81, 63,132, 20,246, 12,185,
+ 95, 92,181,113, 85,232,203,170, 93,234,124,188,224,255, 0, 4,146,236, 21, 45,180,166, 60,100, 57,144,172,147,102,189,184,158,
+209,254, 22,247, 41, 54,175, 17, 19,170,123,167, 72,160, 84, 35,193,188,246,187,121,108,216, 86,109,253, 75, 99,149,165,201, 68,
+ 43,134, 21, 2, 5, 86,143, 93, 49, 75,106,105, 85, 86,234, 49,190, 62,117, 68, 87,136, 87,168, 78,113,225, 63, 21,230,217,158,
+127, 91,147,241, 53, 5,117, 75, 84,212,207,236, 81, 87, 72,103, 68,121,153,145, 24, 4,229,164,150,101, 82,174,202,138,219,115,
+ 58, 98,193,200,252,101,224,252,151, 41,225,202, 12,239,133, 51, 44,186,145, 41,105, 96,246,233,178,248,197, 59,201, 28, 17,171,
+186,157,124,201, 35,186,179, 6, 68,121, 25, 70,174, 95,164,237,173, 75, 62,218,177,233, 17,168, 22,157, 22,153,111,209, 33, 37,
+105,135, 73,163,193,139, 77,167, 68, 67,142,173,231, 17, 26, 20, 54,144,211, 9, 83,206, 56,178, 16,144, 10,156, 82,143, 82, 78,
+178, 93, 49, 28, 53,113, 19,183, 28, 85,108,189,139,190,123, 87, 80,118,125,159,125,210, 5, 74, 19,114,219,105,138,157, 46, 99,
+ 18, 31,167,214, 40, 85,152,204,188,226, 34,214, 96, 85,226, 78,135, 45,180, 56,227,105,126, 18,252, 55, 93,108,161,197, 62,250,
+231,250,168,106, 41,170,106, 41,234,227,104,170,224,119, 73, 85,193, 14,178, 43, 21,117,112,119, 12, 24, 16,215,222,247,190, 58,
+ 70,146,122, 90,170, 74,106,154, 41, 18,106, 58,136,209,225,120,200, 40,209, 58,134,141,144,141,138, 50,144, 84,141,172, 69,176,
+180,180,180,180,134, 54, 48,180,180,180,180, 48, 48,180,180,181,192,111,104, 5,251,125, 80, 56,143,220,198, 45,253,213,169, 89,
+ 9,183, 54,167,110,238, 27,118, 11,123,151,122, 90, 50,220,172,139,138,158,153, 72,178, 45,251,125,102, 37,197,116, 63, 9, 82,
+ 82,182, 38, 6, 89, 68,111, 26, 95,138, 30,142,216, 47, 57, 30, 78,249,221, 99, 81,164,226, 6, 84, 47,168,169,111,215, 68,181,
+129, 7,171,130, 78,246, 0,236, 78,216,215,169,168, 20,209,243, 10,234, 23,181,175,110,196,255, 0, 44,119,231, 75, 81,244,103,
+138, 29,229,219,186,190,226, 38,204,169, 55,100, 67,220,238, 34,247, 45,250,213,217,125, 65,164,205,147,104,206,165,216,118, 61,
+ 94,129,106,212, 95,186,100,197,162, 91,207, 73,151, 86,156,153, 30, 59,169, 82,141, 53,244,196,109,181, 55,135,114,241,198,191,
+ 22, 21,107, 15,123,247, 58, 21,239,182, 80, 41,252, 61,195,225,246, 85, 90,221,164,217,177,110, 10,125,254,238,232, 42, 29, 18,
+168, 34,221, 38,172, 62,174,129,245,162, 36,204, 82,163, 52,225, 82,101,134, 98,190,203,109, 37,110, 59,183, 5,230, 62, 70, 90,
+152, 57,114,114,192, 44,206, 14,169, 36, 72,144, 16,168,246,213, 43,132, 6,228, 91,204,218, 84,223, 8, 12,198, 29,193, 70,184,
+191, 64, 58, 0, 88,157,200,232,162,231,111,112,185,199,119, 52,181, 31,219,163,138, 13,215,187,247, 63,109,175,153, 87,125, 18,
+185,126,217, 23,151, 19, 82,104,252, 60,211, 45,201, 52,233,150, 71,240, 34,193,174,162,217,167,220,143,211,222, 93, 66,233,145,
+ 84,147, 75,108,134,220, 72,230,113,130,136,203, 97, 74,115,194,187,218, 60,116,241, 71, 94,159,183, 22,253, 63,112, 54,166,175,
+ 63,117,119, 39,104,237,104,115,229, 80,109,233,245, 11, 49,235,225,117,154,109,106,149, 86,182, 45, 90,232,117,138, 91, 85, 35,
+ 79, 91,126,254,228,106,167, 37, 61,109,158, 66,226,214,144,220, 23,153, 8,213,214,162, 27,132,212,225,139,174,147,174, 69, 33,
+ 78,131,172, 1, 25,109,118, 10,194,252,179, 32, 1,136, 25,140, 58,136, 42,221,108, 45, 99,125,129,245,219,115,107,117, 29,237,
+142,245,233,107,147,209,223,222, 43, 46,151,189,123,171, 87,168, 91,247, 45,193, 96,238,236,107, 86,163,184, 18,175, 13,204,135,
+ 26,223, 51,155,219,155,122,229,185,225,109, 4,121,171,160, 11, 66,149, 6,229,173, 86, 75, 18,101,144,211, 81, 94, 47, 30, 86,
+130,245,116,153,197,253,205,104,175,125,224,212,119, 98,196,186,104,182, 78,217,238,236,253,159,220, 25, 80,109,250, 84, 61,204,
+189,109, 75,111,110,106,180, 88,240, 28,129, 37, 16, 46,122,140, 59,158,240,173,209,164, 71,165, 4,181, 37,202, 9,253, 10, 30,
+ 67,199, 90, 31,253,157,169,144,255, 0,100,153, 42,109, 96,108, 24, 93,173, 25, 33,108, 27, 96, 37, 66, 3,232,144,141, 71,151,
+101, 98, 20,246,180, 31,222, 41, 75,252, 58,110, 5,250,122, 30,151, 3,109,247, 24,234,110,150,185,121,125,113, 27,190,246,141,
+ 14,226,220,138, 85,122,149, 95,137, 79,221, 29,192,219, 42, 86,219,187,104, 69,247, 57, 66,135,195,181,213,186,212,122,171,149,
+122,104, 85, 74, 93, 76, 92,212, 56,173,120, 13,169,182, 94,140,242,153, 95,134,178, 36,161,188,127,125,171, 86,214,225,238, 11,
+ 22,199, 16, 84,107,178,163,121, 39,108,124, 29,207, 68,141,169,183,108, 72,233,163,237,245,233, 92,170,211,106, 53,186,204, 89,
+ 52,202, 39, 35,139,138,182, 99, 49, 2,101, 90, 83, 81,212,194,240,184,239, 73, 25,143,134,171, 36, 66,194,104,254,198,161,110,
+ 97, 23, 14,138,202,199, 64, 11,164, 54,162,119, 6,214, 93, 86, 98,161,171, 35, 6,218, 79, 91,118,238, 9, 4, 11,239,126,158,
+238,246,218,253,134,210,215, 23,168,252, 66,238,173,122,152,237,253, 54,243, 85,110,231,171, 76,225,138,243,161,236,203, 18,102,
+193,102,123,213,219, 34,129, 34,173, 62,218,133, 2,172,137,173,218,242, 46,180,203,140,244, 86, 80,236, 39,101,213,208,220,211,
+ 33,228,132,186,236, 80,248,135,221,139,146,237,218,187, 18,214,222,123,102,243,129,185, 51,246,200,220,219,133,110,217,182,220,
+151, 54,246,175,118, 89, 27,207,114,220, 59,126,196, 88,238, 61, 5,154,162,127,128,148, 71,161,179, 83, 67,181, 56, 13,161,255,
+ 0,172, 27,152,151,144, 18,105,120, 98,178, 37,118, 51,199,104,151, 83,147,204, 1,108,138,237,184, 67,125, 33,173,125,181, 16,
+ 66,106,107,129,133,173,141,136, 1, 79,155,167, 77,247, 32,119,239,248,119,182, 58,147,171, 69,118,187, 74,182,233,114,107, 21,
+153,105,135, 2, 47,132,149,185,225,188,251,206,189, 33,212, 71,139, 18, 28, 72,205,173,217,211,223,148,235, 45, 49, 29,148, 45,
+231,222,121, 13, 52,133,184,180,164,182, 60, 63, 94, 23, 13,249,180,118,173,203,117,202,141, 58,225,125,219,146,149, 84,168, 68,
+134,221, 57,154,140,139,106,235,174,219, 34,165,238, 12,168,183, 13,217, 13, 81,219,121,198,219,253, 26, 28,125, 73,108, 37, 1,
+ 41, 13, 62,232,111,214,218, 88, 87, 53,221, 90,189,235,241,103, 84, 54,214, 35,223,192,237,191,166,243,212, 43,146,234,168,162,
+210,230,214,174, 85,210,219,108, 4, 84, 20,139,146, 5, 54, 10,228, 56,219,108, 55,239, 43,109,212,137,238, 41, 44, 50,192,240,
+207, 45, 59, 88,201, 19,178, 27,116,186,146, 13,137,182,215, 29, 72, 27,117,198,210,176,101, 86, 29, 24, 3,251,247,199,221,233,
+222,106,181,159, 75,167, 84,174,234, 93, 66,210,177,231, 69,184,235,115,168,180, 74,161,155,188,183, 37,187,104, 81,151, 91,175,
+ 70,163, 80, 40,200, 81,166, 32, 83, 84,169, 82,149, 18, 91,178,216,139, 78, 83, 11,126,159, 42,107, 42,103,136,187,179,237, 34,
+226,147,119,235, 63,197,223, 8,251,124,189,158,219,184, 97, 16, 40,176,233,212,196, 92,251,157, 84,166,150,212,167,102,185, 76,
+180, 34, 77,106,221,117,114, 22, 2, 25,135, 45, 15, 52,181, 45,110,204,125, 71,175,108,182, 23,109,174,187,130,169, 84,222,157,
+223,125,186,149,249,123, 65,247,101,210, 60,100,212,104, 54, 69,155, 36, 7,224,237,133,176,149, 2,203,148,166,146,166,158,173,
+205,109, 3,235,170,160, 43, 86, 98, 69,134,211, 59, 51,104,216,150, 77,129, 77,110,141, 99, 90, 54,213,159, 74,109, 41, 66,105,
+246,205, 18,155, 68,137,132,126,169, 91, 20,232,205,165,197,117, 57, 82,129, 81, 36,146, 73, 39, 78,217,109, 94, 95,150, 60,146,
+ 85, 80,254,145,169, 22,208, 11, 40,141, 58,223, 82,180,114, 93,186, 91, 96, 71, 98,164, 27,234,212,195, 81, 80, 21, 35,159,217,
+227,223, 81, 0,150, 61, 45, 98, 25,108, 58,223,168,247, 17,136,175,109,165,111,136, 46, 22,110, 90,253,251,188, 55,190,238, 65,
+226, 39,118,227, 73, 22,188, 43,214,173, 93, 15,170,216,230,151, 29, 53, 11,198, 13, 89,199, 26,118,108,119, 24,169, 38,135, 69,
+ 37,232,207,174, 19,213,119,127,239, 68, 64,213, 43,151,138,189,231,148,233, 93,203,191,247,220,103, 10,148,232,142,246,226, 85,
+105, 32, 96,149, 21, 51, 79,141, 84,100, 37, 35,175, 68, 55,129,142,128,107,190, 92, 81,109,158,214,113, 35, 67,184,108,237,202,
+102, 60, 43, 2,198,163,212, 42,247, 21,248,211, 49,155,173, 80, 37,183,202,252,118,173,218,155,209,221, 83, 79,170,117, 53,160,
+227, 77, 36,169,228, 67,121, 32,178,242,233,207, 57,194,234, 71, 15,220, 39, 90, 75,109,193, 77,191,119, 2,124, 94, 96,220,151,
+161,219,182,108,103,243,144, 18,185, 21,119,174, 89,106,100,163, 0,129,224,171,201, 60,131, 83,252,135, 54,165,204,160,150,105,
+ 50,197,106,184,152, 41, 60,176,194,223,170, 17,180, 5, 22, 29, 67, 58,155,146,119,189,240,193, 93, 73, 45, 59,170, 45, 73,228,
+176,184, 26,172,111,176, 36,139,220,223,181,129,216, 91,107, 91, 29, 21,246,100,113, 47,186, 91,235,125,110, 4, 59,162, 92, 75,
+222,214,164, 89,244,136,116,189,196,146,195,109, 87,221, 69, 6,164,227, 77, 68,157, 83,101,164,170,228,142,252,250,245, 93,166,
+ 94,150, 12,132,127, 7, 30, 90, 93,113,183, 73, 87,102,245,197, 62, 8,247, 59,106,118,179,113, 23,103, 90,182, 36, 75, 2, 30,
+235, 85,168,116, 25, 13,199,172,212,107, 14, 87, 43,209,216,152,205,189, 33,239,126, 9,109,170,147,105,114, 75, 75, 16,216,138,
+219,177, 93, 46, 62,219,134, 27, 74, 71,107, 53, 4,226,104,132,121,180,197, 40,197, 20,114, 5,101, 80, 0, 13,113,230,112, 20,
+149, 23,107,139, 2,109,109,247,185, 47,153,107, 22,165, 75,205,206,101,184, 39,115,107,116, 27,128,122, 88,239,235,233,133,165,
+165,165,168,254, 55,240,180, 29, 66,161, 2,147, 6, 93, 78,169, 50, 45, 58,157, 2, 59,178,166,206,154,251,113,162, 68,140,194,
+ 11,143, 72,147, 33,229, 4,178,202, 80,149, 21, 41, 68, 0, 6, 73,209,154,212,158, 53,182,250,255, 0,220,189,141,169,219,187,
+118,235,139,169,181, 89,166,213,106,148,134,158, 12, 59,113, 81, 32, 51, 52,201,162,180,181, 16,149, 58,102, 59, 6, 74, 80,165,
+ 0,225,167, 6,243,149, 0, 88,184,159, 52,173,201, 56,123, 58,205,242,220,170, 76,242,191, 45,166,150,104,105, 34,254,242,162,
+ 68, 66,203, 18,216, 19,118, 35,162,171, 57, 23, 8,172,214, 82,253,194,249, 85, 14,121,196, 89, 38, 79,153,230,209,228, 89,126,
+101, 83, 12, 51, 86, 75,253,221, 60,114, 56, 87,149,174, 85,108,160,245,102, 84, 6,197,221, 86,236, 52,131,138, 95,104, 4,186,
+199,214, 54, 22,197, 77,122, 13, 40,151,161,213,183, 5, 41, 91, 51,234, 13,245,109,214,109,116, 44, 5, 64,138,174,191,225,138,
+ 1,245,164,254,133, 45,116,112,232,102,217,108,157,245,187,134,183, 88,166,198,146,138, 37, 30, 21, 78,171, 88,184,102, 54,243,
+205,188,244, 72,207, 77,118, 44,101, 40,243, 79,168,186,180, 97, 88, 36, 32,185,206,226,129, 32, 43,100, 54, 19,129,203,238,248,
+173,181, 55,114, 41,115,173, 91,118, 27,233,241,105,111,225,154,189, 85, 72, 80,230,100,242, 40,251,132, 63, 37, 44,159, 21, 64,
+225,180,167, 62, 34,123,107,102,109,165,171,100,219,108, 91, 52,106, 68, 40,116,214, 97, 24, 34, 35, 12, 33,184,233,142,182,203,
+107,104, 54, 7, 80,164,169, 92,196,228,168,168,149, 18, 73, 58,227, 46, 26,240,155,196, 15, 27,243,131,198,254, 48,212, 79,148,
+100,169,175,216,178,205, 50, 64,197, 79,217, 84,129,142,186, 74, 91,129,173,223,251, 93, 72, 91,234, 0,172,216,237, 78, 38,241,
+115,195,223, 3, 50, 97,192,254, 13, 83, 65,156,103,114, 20, 53,217,166,164,168, 64, 71,218,103,168, 81,162,174,168,169,109, 8,
+159,217, 41, 75, 17,164,144,208,226, 44, 52,185, 13,195,169,211,165,188,142,118, 98,207,137, 33,212, 30,203,109,137, 13,184,226,
+ 8,249,165, 36,125,250,127,189,191, 59, 1,126,241, 15,193, 94,202,238,238,208,211,167, 93,244,109,151,184,170,119,101,215, 68,
+161,176,236,233,235,179,175, 10, 4, 24,142, 93, 76, 66,140, 20,185, 76,211, 95,167, 69, 50, 66, 18,165,179, 30,166,244,130, 3,
+ 76, 60,164,211,226,127,101, 42, 59, 29,186,181,187,117,109, 62,187,118,168,251,213,155, 78,162,182,200,106, 93, 34, 91,202, 95,
+186,135, 57, 66, 85, 38, 43,203, 84,119, 64,193,253, 26, 87,128,151, 18, 75,183,195, 79, 26, 53,221,151,166,139, 34,240,164,187,
+122,109,226,148,224,141, 17, 46,182,154,189, 13,183,212,165, 72,102, 2,165, 31, 10,109, 61, 74, 90,213,238,238,148, 4, 41,106,
+ 40,113, 41, 37, 5,151,232,189,226,236,127, 70,191, 20,115,188,175,140,233,189,135,151, 83, 26, 73, 43,163, 50, 69, 61, 47, 62,
+ 45, 50,104, 12,254,207, 83, 5, 76,154, 39,141, 95, 65, 49, 74, 20,198,204,234,241,244,170,240,114, 79,164,247,132,249, 46, 99,
+193,117, 94,220, 37,165,149,227,137, 29, 21,229,130,168,211,204, 26, 46, 97, 84,246,154, 89,233,163,215, 79, 35, 71,204, 2, 88,
+139, 9, 21, 81,160, 87,169,110,253, 27, 78, 31,247, 14,201, 78,246,241, 53,120, 64,159,107,237,173,207,108, 82,237,139, 90, 69,
+ 85,167,160,179,114, 68,163, 76,149, 92,175,220,241,144,248, 79,137, 70,138, 26,139, 29,153, 56, 45,188,228,137, 73,109, 71,193,
+ 94,122, 95, 89,143,236,147,185,110, 37,110, 61,103,134,205,190,118,245,118, 71,214, 47,186,246,201, 80, 28,168, 63, 81,230,241,
+ 76,135,214,152, 94,233, 38,103,139,215,198,113, 69,124,221,121,181,134,239,223, 25, 43,190,109,119, 54,195,105,109,159,226,243,
+110, 28, 97, 16,106, 24, 17,153,172,214,169,236, 0,134,169,158, 5, 63,244, 20,106, 55, 34, 82, 21, 29,165, 56,167, 82, 2, 22,
+180,183,204,210,189, 25,241,187,233,237,225,100,220, 3,152, 80,112,253, 92, 57,166, 99,153, 70,182,130, 10,152,234,164,119, 86,
+ 89, 18, 33,201, 5, 97, 70,145, 87,153, 52,237, 25, 88,195,132,133,228, 42, 7,154, 94, 3,127,179,211,197,122, 79, 17,114,220,
+207,136,233,166,203, 50,220,174, 70,250,249,233,164,165,141, 17,213,163,121,155,158,193,230,117,141,219,151, 5, 58,200, 30, 82,
+133,230, 72,149,201,211,219,222,171, 18,185,121,221,181,168, 8, 8,131, 86,185,107,149, 40,105, 74,121, 64,139, 58,167, 42, 76,
+127,132,143,135,244, 78, 35,167,207, 77, 71,183,193, 83,207, 4, 92, 7,166,161,226,120,232,185,171,137, 62, 46,121,194, 5,131,
+ 73,240, 82,160,174,160,134, 66, 7,221,173,145,216,173,173,169,238,230,227,208,109,120,108, 60,170,120,148,204,234,252,180, 33,
+ 69,184,116,136,238,161, 82, 57,156, 72,194, 30,120,132,178,214,123,173,224,113,202,149, 17,210, 31,105, 23,179, 6, 31,180, 15,
+107, 54,119,111,211,186, 82,118,157, 59, 83,112, 85,238, 6, 95,131,103, 71,187, 17, 86, 21,122, 52,122, 72,130, 99,187,113, 83,
+133, 57, 44,166, 58, 86,149,165, 78,133, 5, 20, 20, 12, 5,107,144,127,217,239, 11,228,156,117,155,248,159,196, 50, 53, 6, 69,
+ 81, 49,167, 14, 35,118, 89, 36,209, 81, 36,238,145,198, 25,217, 98,121, 98,141, 74,171, 13, 82, 58,223,200,246,236,191,246,140,
+186,241, 7,135,185, 87,133,124, 53, 18,230, 60, 67, 79, 0,168, 49,153, 35, 86,142, 62,101, 52,112, 70,242, 72,200,138,210,199,
+ 20,210,176,118, 83,166, 56,218,223, 88,151,102,125,130,112,118, 42,169,192, 62,220,155, 3,248, 58,253,211, 14, 69,121,189,216,
+141, 20,197,250,250, 61,248,229,122,168, 93,114,229,109, 39,197, 75,206, 82, 17, 78, 84, 37, 57,240,170, 2, 88, 75, 71, 8, 80,
+ 17,173,246,250, 13,156, 87,180, 78,224,103,100, 28,162, 63, 88,110,202,179, 25,220,245,218, 78, 69,118, 49,221,175,121,170, 25,
+141,184,237, 53, 69,181,220, 41,161, 42,215, 76,222, 83,227, 38, 98, 92, 68,140, 74, 75,192,117, 38,227,250, 54,119,189,161, 79,
+164, 73,216, 46, 46,110,123, 78,180,253, 25,154,101,232,154,149, 18,165, 73,135, 95,154,143, 16, 72,168,192,114,215,185, 18,237,
+ 62, 19,168, 82, 1,129, 35,223, 2, 20,149, 45, 50,202, 86, 27, 67,243,193,111,209,227,219,173,146,220,107,127,118,119,231,112,
+164,239, 85,205,109, 84,218,174, 81,173,207,169, 81, 69,178, 35, 87, 35, 60,153, 16,234,149,118, 37,204,149, 42,232,125,153, 9,
+ 75,205, 33,229,199,142, 93, 0,191, 29,240,156, 31, 80, 50,110, 36,240,255, 0,133,248,167,136,120,250,159,140,167,206,102,204,
+197, 81,139, 47, 20,147,199, 51, 60,242, 9, 52, 75, 52,159, 86,209,161, 80, 35, 44, 16, 5,210,199,204,186, 91,202,188,243,133,
+252, 73,226,222, 17,225,159, 14,106,120, 26,159, 34,131, 42, 52,130,108,204,214,211, 75, 2,165, 60, 92,190,100, 48, 71,245,171,
+ 35,134, 38, 64,165,201,109,106, 60,175,173,120,101,186,226,227, 30,216,222, 31,145,113,169,212,222, 13,238, 7, 6,204,215,213,
+ 43,196, 18, 19,114,181,106,109,123, 85, 19, 47,197,202,132,164,212,146,231,141,205,215,196, 74,201,235,211, 90,121,178,118,150,
+251, 86,248,244,118,209,176, 55, 14,149,181, 28, 67, 63,187,123,137, 77,165, 94, 87,124,150,160,183, 79,191, 68,251,137,138,172,
+ 71,101, 79,167,202, 75, 85,121,111,253, 99, 25,144,182,148,167, 95,150,150,144,124, 71, 18, 12,191, 55,139,216,145, 27,114,184,
+246,164,241,181, 23,126,103,210, 85, 77,220,141,186,220, 36,237,202,118,242, 36,168,229, 86, 2,232,107, 69, 32, 92,230,240,109,
+ 65,169, 66,136,128, 94,247, 2,166,125,229, 68, 33,194,145,159,188,127,251, 8,246,135,139,155,230, 86,246,237,181,237, 81,216,
+221,230,170,248, 18,174,153,244,186, 83, 85,171, 78,238,170, 68,109,180, 49, 90,169, 81, 81, 50, 35,244,171,136,165,166,146,236,
+232,146,128,119,194, 75,143, 69,117,254,103, 75,214, 91,226,215, 8, 67, 22, 85,150,205, 86, 35,138,175, 35,134,138,121,205, 36,
+147, 69, 73, 85, 26,176,229,203, 3,162,251, 69, 57,230, 48, 97, 30,180,109, 10,167,202,197,149,139, 52,240,103,141,106, 37,205,
+243, 72,104,140,147, 80,241, 4,245,244,244,226,182, 40, 37,173,163,149,163, 60,200,170, 35,145,189,154,161,121, 42, 80,203,203,
+117,214,204, 6,181, 8,220,174,226, 71,130,207,107,101, 91,105,167,218,220, 83,113,207,179,208,246,122,238,169,208,173,233,177,
+183, 54,243,164,208,173,170,181,102,101, 69,135,109,234, 98,103,201,178, 88, 45,207, 85, 69,134,150,209, 67,168, 82, 61,221, 78,
+173, 73,109,181,173, 58,117,197, 87, 1,155,253,192,167,179,178,235,160,238,229,199,101,215,173,141,200,226,147,102,174,107, 61,
+ 22, 93, 90,117, 86, 35,117, 8, 59,103,187,240,170,243,222, 92,168, 76,160, 38, 69, 61,202, 40,109,109,115,248,137,137,146,174,
+ 80,141,116,161,143,163,193,196, 46,228,213,168, 20,254, 34,120,219,187,111,155, 38,221,113,180,211,233, 77,199,185,174, 25,241,
+ 97,167, 8,114, 37, 29,203,202,228,122, 53,190,165, 48, 57, 82,234, 35,200, 8, 29, 60, 21,142,154,234,183, 19,126,200,187, 31,
+124, 56, 36,218,238, 11,108,125,198,175,109,125,165,181, 87,181, 22,242,163, 87, 39,211,158,220,106,188,245,210,168,215, 85, 46,
+ 68, 42,129,170,215,224,171,196,147, 34,233,147, 37,110,182,234, 91,105, 81,195, 44, 70,109,146,148, 54,214,158, 34,228,185, 53,
+ 87, 15, 81, 71,196,212, 85,249,107, 87, 71, 81, 94,180, 57, 43, 81, 65, 18, 68, 85,227,149, 89,109, 43, 77,170, 53, 86, 9, 12,
+154,144,144, 89, 2,128,238,210,120, 95,158,231,148,156, 75,152, 73,194,149,249,118,106,153,124,148,217,123,102, 25,242,215, 84,
+ 77, 36,193,146, 72,157, 90,240,164, 26,100,118, 66,243, 71,165,192, 96,175,172,152,216,127,163,207,182, 54, 85, 63,129, 26, 5,
+213, 18,131, 1,186,245,225,121, 94,117, 27,146,168, 35, 51,239,213,105, 84,250,195,212,170,127,190, 73, 8, 11,121,152,244,248,
+205, 54,202, 20, 74, 90, 10, 95, 32, 5,107, 39,133, 62,218,203,122,129,108,123, 96,109,245,210, 41,177,105,109,213,209,195,221,
+118,176, 97,180,134, 12,218,147,149, 56,208,159,168, 62, 91, 3,158, 81,133, 78,134,130,179,241, 17, 25, 57, 61, 53, 47, 47,103,
+175, 7, 75,224,115,135,139,127, 97,141,234,237,254,138, 5, 74,189, 81, 77,202,253, 13,187,113,201,102,185, 84,122,164,166,141,
+ 41,170,164,208,194, 90, 47,114, 3,239, 11, 42, 8,230, 56,206, 53,160, 92,119,251, 21,218,227, 43,139,138, 79, 20,201,223,169,
+214, 59,244,232, 27,125, 4,217,141,109,212,106,251, 11, 22, 36,247, 38,120,191, 94,185,121,196, 82, 76,164, 44, 39,151,221, 15,
+128, 83,205,151,129,228, 17,110, 24,227,108,134,131,196,238, 46,226, 60,195, 51,120,242,140,217, 51, 4,134,110, 92,238, 92, 77,
+ 42, 52, 0,198,177,153, 20,104, 81, 96,232, 2, 5, 0,233,176, 24,151,241,111, 0,241, 22, 99,225, 63, 5,112,190, 91,148,164,
+153,214, 76,249,107,207, 8,150,157, 4,109, 4, 46,181, 12, 36,105, 22, 38, 58,216,234, 40,236, 92,177, 35, 85,201,196, 94,166,
+255, 0, 4,227,251,102,171,138,226,141, 80,145,106,127, 43,106,227,151,155,183,111,130, 40, 41,134,253,197, 45,203,106, 77,100,
+206, 72,103,248, 45,250, 74, 26,201, 88, 17,189,203,148,159,208,106,118,219,255, 0, 77,225,202, 23, 11,155,155, 59,120,151,101,
+141,146,115,108, 43,142,220,242,235, 79, 83, 77, 2, 85,186,237, 13,231, 25, 76, 37,173, 94, 28,153, 78, 35,192,250,189, 49,242,
+243,146, 21, 28, 67, 5,242,214,185,225,237, 10,246, 37,236,223, 28, 51,160,110, 93, 50,230,159,180,155,231, 14,139, 6,141, 84,
+188,169, 20,168,245,170, 53,231, 14,149, 20, 69,166, 34,238,183, 93,151, 24,202,168, 48,195,108,176,204,230, 36,178,250, 35, 54,
+134, 94, 76,166,217,142,134,185,163, 99,253, 27,221,214,159, 80,165, 91,187,205,197,181,110,187,181,116,121, 33,246,109, 11, 90,
+155, 92, 73,125,180,171, 33,152,105,184, 43,142,194,160,169, 67,169,117,184,146, 84,156, 20,165, 25, 60,195,123, 59,206,248, 23,
+142, 41, 56, 79, 52,204, 56,182,110, 23,174,225,202,104,160,154,140, 82, 79, 49, 38, 34,167, 93, 35,197,104,209,156,173,149,152,
+146, 20, 70, 93, 84,165,153,191, 32,200, 60, 65,240,254,183,140,178,156,183,130,224,226,234, 14, 40,171,154,162, 10,227, 91, 4,
+ 0, 9,129, 81, 29,108,114,131, 35,162, 6,187,162,128, 11, 25, 66, 51,137, 46,188, 20,224,130, 37,122,161,107,241,207, 22,205,
+ 68,229,213,151,193,189,253, 34, 59,113,121,149, 53, 84, 40, 55,206,223, 79,185,147,150,134, 72, 22,172,106,177,123, 29, 60, 36,
+ 57,159,135, 58,112,125,151, 27,107,197,206,231,238,109,253, 66,224,219,124,109,173,154,220,132, 90,144,164, 85,209, 87,159, 18,
+ 13, 86,231,182,219,170,182,183,153,164,123,205, 6,114,159,102, 44,244,195,114, 64,108, 32,164, 58,218,149,148,246,148,183, 0,
+ 30,195,186,103, 4, 59,219, 95,221, 41, 91,210,238,236, 81,174, 43, 18,191, 97, 78,179,235, 27,115, 6,133, 5,234,101,126, 92,
+ 7,229, 25,178,149,117,212, 19, 61,159,118,131,224,173,133,199, 8,117, 50, 23,206,113,240,235, 95,184,128,250, 57, 52, 5,238,
+ 92,237,211,224,251,126,238,109,132,155, 34,168,253, 90,157,107, 61, 18,125, 66, 21,175, 38, 90,150,227,236,218, 87, 93, 26,179,
+ 18,165, 71,166,165, 75, 33,152,239, 9,107,109, 10, 40, 18,121, 2, 82, 39,213,158, 45,112, 93,125,119, 19,229,145,230,113,193,
+ 73,155,199, 76,244,245,181, 20, 18,212,211,115,163, 69, 71,134,162,150, 72,214, 70, 81,203, 66,172, 80,165,217,219, 82,178,174,
+170,226,135,193,142, 59,203,114,254, 18,205,101,202,100,158,183, 36,150,174, 58,154, 26, 92,198, 42, 74,174, 68,178, 51,199, 61,
+ 45, 92, 82, 52,106,228, 72,225,215,152, 30,200,138, 85,149,155, 79, 63,120,152,246,113,123, 73,247,246,235,219,109,167,226,139,
+140,141,138,188,175,178,213,122,187,181,118, 29,241,126, 64,166,221,115, 99, 73, 93, 54,159,112, 78,182, 41,145,237, 56,210,106,
+ 13, 56,228,106,115,110, 33, 60,254, 41,132, 84,218, 23,238,207, 41,173, 31,246,169,108, 70,229,240,207, 70,224,147, 98,119,114,
+163, 71,170,222,187,125,195,213,118,150,252,234, 12,137, 18,233, 70,139, 43,118,239, 89,244, 56,177,164,203, 97,167, 29, 12, 68,
+146, 91, 60,200, 72, 79, 32, 74, 71, 40, 26,238, 94,204,253, 30, 26,228,253,212,164,238,167, 22,156, 77, 94,219,207, 82,164, 79,
+131, 56,192,167, 63, 93,167, 79,170,174,154,224,118, 27, 85, 91,234,181, 93,149, 83, 76, 20,173, 8, 10,106, 34, 99, 59,203,144,
+220,182,137,206,183, 63,218, 81,236,103,137,199,254,225,237,141,254,141,242,159,182, 63,197,206,219,177,183,108, 80,227,216, 76,
+ 93,200,157, 30, 61,114,165, 89,102,162,106, 82,110,248, 10,142,176,154,138,153, 45, 22,157,230, 12, 37,207, 23, 42, 41,211, 54,
+ 91,226,118, 67,149,113, 15, 14, 82, 84,113, 37, 61,110, 65,151, 37, 76,179, 61, 46, 80,244,112, 67, 83, 36, 82,198,139, 2, 70,
+ 26, 87, 71,230,182,191,169, 81,168, 7, 46,218,138,163,238,105,225, 55, 17,103, 28, 53,197, 21,180,220, 43, 85, 67,196,121,172,
+148,176,195, 29,102,117, 29,117, 68,244,145,205, 12,142,213, 15, 41, 72, 99,120,249, 43,203,250,242,218, 47, 24,141,116,134,125,
+234,246,125,236,206,223,237,103, 9,155, 11, 64,179,173,250,125, 38, 3, 59, 97,100,212, 92, 17,163, 54,202,230, 85,234,214,237,
+ 54,167, 88,172, 76, 82, 19,151,234, 82,234, 82,100, 72,125,213,100,173,199,207,100,132,164,111, 48, 24, 24, 29,135, 65,166,203,
+102,236, 37,237,126,216, 88,187,122,185,202,169,155, 50,212,183,173,113, 82, 83, 9,138,169,233,160, 82, 33,210,147, 53, 81,146,
+234,196,117, 58,152,129,101,176,181,132, 21,242,133, 40, 12,150, 11,143, 78, 49,236,142, 6, 56,109,189,119,206,237,247,106,133,
+ 98, 35, 63, 80,109,189,164,235,165,183,175,125,198,171, 71,147,252, 28,183,209,200,180,173, 16, 18,168,242, 38, 84, 93, 65,230,
+143, 77,165,203,121,176,183, 80,219, 78,115,121,134,183, 63,207, 30, 26, 53,122,250,236,222,165,132, 99,114,242,188,210, 27, 18,
+ 91,123,146,215, 98,214,176,185,107, 0,113,212, 98,122, 30, 27,225,232,231,174,100,203,178,252,150,145, 76,135, 96,145, 71, 12,
+ 64, 48, 1,118,178,133,178,170,222,230,193, 65, 36, 12,113, 23,233, 10,251, 69,127,139,219, 56,240, 51,180,149,207, 14,246,220,
+ 58, 76, 90,158,253,213,105,238,225,251,107,110,170, 45,166, 69, 35,111,195,236,175,154, 61, 90,224, 64, 68,138,131,100,165, 72,
+161,165,182, 28,109,216,245,192,166,197,250, 63, 62,207,199, 44, 27, 45,238, 46,247, 46,142,166,111, 45,207,164, 38, 30,218,192,
+168, 71, 90, 31,183,118,209,231,218,148, 43,105,105,228, 15, 10,125,126, 68,104,146, 26, 88, 10, 34,147, 18, 26,217,112, 38,161,
+ 37,189,113, 27,217,255, 0,195, 62,227,251, 81,184,218,174,223,155,197, 50,161,115,219, 13, 92,234,221, 61,253,186, 37, 37,214,
+218,174, 63, 83,168,185, 34,149, 99, 68, 49,148,129, 0, 85, 37, 71,114, 43, 76, 50,166,145, 6,141, 74,151,238,188,134, 52,102,
+151,250, 18,218,182,237, 58,213,161,211,168,148,168,145,160,194,167,196,143, 18, 60, 88,140,183, 30, 52,118, 35,180,150,153,143,
+ 29,134, 82, 16,203, 8,109, 41, 74, 16,144, 18,148,164, 37, 32, 0, 53,117,113,253,101, 39, 0,112,165, 23,134, 89, 44,193,243,
+ 42,197, 90,140,226,116,234,236,225, 88, 67,126,160, 61,151,202,108, 86,153, 34, 86,213,206,123,208,254, 27, 80,214,248,145,198,
+ 53,254, 44,103,208, 52,121, 85, 11, 61, 54, 73, 76,251,132, 68, 44,166,123,116, 38, 59,183,152, 92, 53, 84,146,178,149,228, 32,
+ 25, 10, 82, 18,144,148,140, 4,128, 0,244, 3,160,215, 62, 61,164, 30,208, 29,190,246,125,108, 68,221,193,174,166, 21,195,185,
+183, 74,103,208,246,111,110, 92,144, 91,126,238,186,153,142,218,156,168, 84,144,203,169,118, 61,155, 75, 18,162, 72,171, 73, 65,
+ 65, 8,121,152,108,172, 76,155, 21, 42,223,186,157, 78,157, 69,167, 84, 43, 21,138,132, 42, 77, 34,147, 10, 85, 74,169, 84,169,
+ 74, 98, 13, 58,155, 78,130,195,146,166,207,159, 54, 83,137,106, 28, 38, 99, 52,235,142,186,226,146,134,208,218,150,181, 4,130,
+ 71, 9,184,174,225,239,128,223,109, 5,235,103,196,178,120,186,133, 90,187,118, 26,145,116,193, 93,191,180, 87, 53,159, 80,147,
+ 34,153,115,212,232,158,253, 88,147, 10,183, 72,146,245, 74,148,212,218, 52, 38,155,157, 7,154, 22,102, 37, 42,117, 74,117,156,
+212,252, 35, 69,149,207,156, 82,213,241, 20, 21, 13,195, 52, 45,174,178, 72, 34,146, 64,163, 75, 24,163,145,145, 78,133,154, 64,
+177,177,184,109, 37,180,144, 64, 34,228,227, 92,195, 55,166,201, 42,232,248, 98,122,101,226,188,193,116, 80,199, 81, 52, 81, 22,
+ 98,202, 37,146, 53,145,135, 49,160,137,154, 69, 91, 50,235, 85, 12, 10,155, 24,223,112, 43, 69,217,158, 45,184,165,187,120,165,
+246,138,241, 35,182,116,170,123, 23, 91,119, 61, 74,223,220,203,198,221,164,212,247, 82,240, 90,154,145, 18, 4,155,122, 83,169,
+ 76, 13,179,165,195,106, 27, 94,232,150, 88,134,243,109, 69,164,194,109, 80,163,204,105,153,125,220, 94,209,127,103,156, 61,184,
+186,232, 52, 94, 47, 56,125,117,247,237, 26,244, 24,113, 99,110, 45,186, 93,145, 37,234, 60,166, 35,176,203,104,151,241, 45, 78,
+ 41, 9, 74, 64,234, 84, 0,215, 43,127,189,146,225,251,255, 0,151,141,236,252,108, 47,255, 0,212,117, 98,186, 62,141, 70,193,
+ 80,109,171,134,184,206,250,111, 75,206,209,168,117,106,171, 77, 58,108, 79, 9,215, 41,240, 31,150,134,220,228,180,193,240,212,
+166, 64, 56, 32,224,156, 28,234,227,226,156,231,194,238, 48,205, 41, 42,234,248,179, 49,165,167,161, 88,226,165,164,134,136, 37,
+ 61, 52,107,164,104,141, 76,102,218,138,130,204,119, 54, 10, 44,136,138, 40,222, 15,200,252, 93,224,124,162,178,142,139,131, 50,
+202,202,154,247,146,106,202,201,235,245,213, 85, 72,218,137,121, 92, 72, 47,160, 51, 4, 81,176,187, 49,187,187,179,241,151,216,
+125,188,123, 87,177,188,108,155,223,120,111,251, 87,109,173, 15,226,150,243,164,127, 8,239, 10,196, 74, 37, 35,235, 57,181,155,
+ 69,248,144, 61,246,107,137, 71,189, 56,212, 57, 74, 66, 51,149, 6, 20, 64,192, 58,156, 37,241,179, 92, 40,241,203,106,237, 46,
+225,220,246,214,221,239,165,175,107, 85,218,191,118,150,241,196,122,245, 54, 52,165,184,202, 93,157, 69,169, 68,120, 38,161, 71,
+146,245, 54, 31,189, 67,112,189, 2,106,233, 81,140,168,239, 42, 43, 5,184, 0,123, 51,184, 59,180,120,227,226, 73,123, 35,122,
+ 92,215, 45,167, 72,254, 47,238, 75,185, 21, 91, 80,210,133, 79,223,104,181, 43,126, 19, 17,149,245,197, 62, 75, 62,234,182,234,
+239, 21,254,143,159,153,164,114,168, 12,131,250, 11,240,185,177,214,207, 9,155, 29,181,187, 7, 78,186,100,213, 41,118,141, 53,
+ 54,133,175, 62,230,151, 77, 98,183, 95,122, 59, 21, 90,234,227,165,168,172,176,212,202,144,167,198,170, 72, 83,113,218, 4, 70,
+167, 60,241, 64,109,167, 22, 49,227,201,203,105, 56,158,154,191, 47,204,234, 97,226,113, 20, 74,241,160, 40,145,211,114,230, 28,
+196,153, 44,218,218,229, 29,117,125,130,110, 45,140,253, 29, 23, 52,173,225, 42,188,187, 50,202,105,103,225, 38,158,102, 73,100,
+ 43, 36,146, 85,137, 41,207, 41,224,123,174,133, 0, 58, 57, 91,243, 2,216,220, 12, 63,180,219,118,145, 74,138,212, 72,144,152,
+ 67, 77, 33, 40, 72, 13,164, 97, 41, 24, 0, 0, 58, 12, 1,168,214,125, 36,238, 26, 44,170,175, 15, 59,113,196,205, 42,137, 14,
+ 22,224,216, 59,137, 73,176,171, 53,136,200, 98, 51,213, 75, 2,242,167, 86,221, 76, 42,145, 5, 42,168, 46, 29,213, 78,163, 42,
+ 16, 60,230, 50, 42,243,249, 18, 18,251,170, 18,111, 4, 30,160,228,122,141, 71, 19,233, 42,111, 69,183,107,112,145,182,219, 37,
+239,241,156,189,119, 91,118,169,119, 3, 20,143, 17,179, 37,155, 43,111,169, 53,105, 85,170,210,208, 57,148,210, 5,199, 87,180,
+163, 53,144,128,239,189,200, 40, 89,247,119, 16,170,219,194,167,174, 95, 16,120, 99,216, 11, 9, 94,160, 7,211,125,224, 42,220,
+240,214,234,188,157,100,223,109,175,219, 22,175,140, 41,151,191,134,156, 91,250, 68, 41,133, 41,137,143, 85,182,168, 14,158,207,
+166,253, 27,157,160, 45,183,222,221,240,212,253, 25, 45,199,171,212,118,115,136, 29,176,151, 33,247,169, 54,142,229, 80,110,122,
+ 75,110,168, 41,184,138,190, 45,181, 67,159, 26, 49, 42, 42, 67, 62, 61,152,135,139,120, 8, 14, 76, 91,137,202,221,112,234, 82,
+ 58,139,207,209,155,219, 90,149, 31, 99,247,187,115,230, 71,118, 60, 91,231,115,160,208,105,106,117,183, 80, 38,192,177,109,214,
+ 20,185,241,212,165,114,187, 24,213,110,170,156,110,100,164, 31, 22,152,242, 20,163,202, 2,101, 13,163,120,178,105,219,196, 78,
+ 41, 52,214,229,243,208, 27,116,230, 8, 34, 19,125,252,208,250,189,247,193, 60, 25, 90,149,240,199,132, 5, 93,249,190,206,228,
+ 95,175, 40,212, 76, 97,251,185, 38, 61, 63,225,181,182,194,210,210,210,213,119,139, 59, 11, 75, 75, 75, 67, 3, 11, 86,231,168,
+244,137, 50,219,159, 34,151, 78,126,123, 74,105,109, 77,122, 12,103,101,180,182, 20, 20,202,155,146,182,138,208,164, 40, 2,146,
+ 20, 10, 72,200,193,213,199, 75, 89, 4,141,193,177,247, 96, 98,222,186, 77, 45,198,165,199,114,155, 79,113,137,239,123,196,230,
+ 87, 14, 50,154,153, 32, 41, 11, 15,203,109, 77,226, 67,220,237,182,121,150, 10,178,128,115,144, 52,195, 92,219,245,176,182,149,
+122,185,103,220,245, 58,117, 38,177, 14,165, 62,137, 88,166,205,183,100,165, 18, 94,180,182,226, 54,233, 43,153,126,224, 91,159,
+ 5,155, 45,232,238,197, 88, 82,208,167,241, 10, 62,100,128,214,182, 39, 90,175,186,220, 34,237,174,239, 92, 87,189,203,114,202,
+174,179, 62,249,180,173,155, 70,114, 96, 73, 97,182,233,177,104, 55, 4, 90,205, 74,117, 39,196, 97, 70, 44,234,189, 58,155, 70,
+165,212,213,146,151,233,244,134, 89,229, 24, 36,239,229,230,133,166, 97,152,203, 44,112, 21,216,197, 98,193,245, 40, 4,130, 13,
+194,173,216,141,137,210, 0, 32,219, 9, 75,204, 10, 12, 42,165,129,253,111, 75, 29,135,199, 97,247,227,225,226,159,135, 84, 56,
+170,163,213, 95,119,172, 38, 13,219, 88,247,105, 22,125, 85,171,145, 66,203,155, 66,162,214, 18,136,138,166,123,195,149, 5, 46,
+227,166, 8,173,167, 43,148,194,220,113,158,102,153,112,164,250, 39, 17,220, 62, 92, 21, 58, 93, 58,145, 81,141, 34,185, 94,151,
+ 97,212,226,211,133,167, 80,106,170,170,149,249,112,215, 45,203,118, 92,198, 28,166,133,197,168, 51, 86,164, 85,125,241,199,121,
+ 87, 1,181,165,233, 10,109, 15,161, 74,182,220, 60, 32,109,125,201,123,215, 47,185,174, 86, 27,170, 87, 55, 43,109, 55, 45,216,
+204, 61, 29, 48, 33,205,219,106, 84,138, 75, 84, 24, 49,212,193, 12, 91,213, 70,167, 84,156,170,176, 58,201,118,122,151,204, 20,
+134,139,116,232, 92, 31,109,165,187,120,209,239,138, 92,218,235, 53,202, 30,226,110,142,227, 66,113, 79, 68,117,145, 63,115,169,
+177,233,206, 81,214,211,177,136, 85, 10,144,168, 20,183,233, 12,118,138,245, 57, 11,202,185,222, 14, 56,145,195,220,178, 86,106,
+161, 46,139,128, 74,144, 27, 78,161, 30,201,246, 67,125, 94,175,251,237,109,176,143,246,189, 67,202,133,111,239,189,175,107,245,
+235,111, 53,190,235,247,192,151, 23, 20,214,213,149,120,238,245,161,112, 90,149, 90,123,118, 93,223,110,218,116,155,146, 37, 34,
+165, 34,213,175, 92, 87,142,216, 91,119,181, 10, 5,199, 93,102, 0, 98,139, 83,155, 86,172,154, 91, 40,230,144, 74,145, 17, 79,
+169,147, 50, 58, 23,100,166,241,143,176,110, 91,118,252,155,150, 60,202,122, 85,111, 48,244,196,211,236,186,197,114,218,166, 92,
+206, 88,209,239, 59,138,199,163,207,137, 73, 87,214, 85,120,214,244,153,202, 90, 88,103,194,117, 48,100, 69, 14, 42, 91,110,197,
+ 77,226,167,194, 53, 62,224,168,214,164, 92,187,177,184,117,202, 93,207, 86,176,238,171,166,132,252, 75, 34, 52, 75,138,247,219,
+171, 22,218,178,232, 23,101, 70,124, 75, 81, 19, 90,146,100, 90,180,154,171,241, 99, 73, 98, 19,149, 8,201,195, 8,139,207, 29,
+204, 89,174, 3, 54,230, 28, 89, 84,218, 93,213,112, 83,169, 85, 8, 13,183, 62, 50,109,173,179,153, 84,126,170,109,166, 45,137,
+213, 38,111, 9,246, 59,149,202,124, 73, 44,199, 68,199, 96,199,169,183, 24, 77, 91,133, 9, 76, 55, 93,134,181,227, 28, 52, 99,
+ 65, 52,210, 44,161, 35,212, 99, 50, 88,176,141, 85,236, 90, 50, 67, 23,214,214,210, 86,214,179,139,144, 10, 77,101,201, 85, 4,
+ 92,245,183, 75,220,116, 61,133,133,239,123,246, 56,201,110, 78, 45, 54,210,143, 71,187, 69, 26,206,190,106, 23,221,159, 10,239,
+174, 77,176,164,109,229,114,157, 93,162,200,181,109, 26, 5,194,253,122,230, 66,160, 17,111,208,220,164,222, 86,170, 68,245, 41,
+ 75, 91, 85,192,134, 91,117,109,188,218, 1,107,139,222, 30, 41,208,160, 38,182,212,154, 96, 81, 98, 34,164, 83,236,138,173, 86,
+132,229,233, 73,143, 2, 77, 86,210,160,202,167, 82,150,229,102,224,167, 57, 85,155,240,177, 28,130,105,117, 4, 48,181,191, 26,
+ 67, 73,200,239, 78, 20,232,247, 93,227,184,151,181, 59,113,239,187, 58,175,186, 16,107, 20, 59,177, 20, 6,109, 25, 81, 38, 91,
+ 85,235, 26,194,177,234,148, 36, 49,113, 91, 83, 67, 13,174, 54,221, 80,228,162, 75,124,147, 24,118, 76,180,176,251,104,120,114,
+ 97, 71,129, 29,185,102, 75,134,157,116, 87,233,212,215,107,237,221,142,192,102,217,219, 23,234, 46,220,107,153, 26,125, 70, 66,
+175, 41, 86, 50,235,200,165, 73,156,220,169, 11,130,138,162, 26, 67,243,150, 16, 68, 68,166, 32,196, 67,134,204, 81,243,102,154,
+ 55, 96, 25,172, 90,225,180,141, 75,126, 89, 22, 86,190,141,141,197,203, 50,155, 12, 6,246,205, 70,202,164, 3,177,176,251,143,
+218,190,227,175,167, 96,112,231, 92,188, 65,108,253,156,237, 21, 85,234, 37,205, 77,117, 54,204, 75,162,127,188,109,197,114, 52,
+173,190,178,220,185,255, 0,131,148,235,130,242,141, 38,152,219,246,149, 21,117,198, 37, 41,160,227, 97,192,213, 50, 76,191, 5,
+ 44,199,113,212,227,232,226,211,100, 21, 21,169,244,186, 61,249, 82, 97,202,109,126,252,241,169,187, 81,118,165, 40,183,173,245,
+ 24,119, 77,250, 28,149, 70,101, 47, 81,162,201,144, 35, 61, 61,165, 56, 94,122, 73,102, 57,144,174,112,155,149,235,194,253, 54,
+254,147, 62, 77,127,114,247, 1, 75,185,109,201,150, 53,252,136,169,180, 27, 69,243,183,234,190,107,183,181, 30,208,169,151,173,
+119, 21, 76,139, 79, 23, 21, 86,150,196,154,122,162,203,114,155, 49,212, 72,121,217, 74, 76,164, 52,251,165,194,237,235, 26,209,
+179,173,109,147,172, 76,141, 81,133,182, 87,238,208, 87, 46,106,213,219, 71,163, 71,122,208,188,167,211, 39,166, 53,106,131, 47,
+109,107,104,172, 50,153,222,250,242,158,167, 46,147, 80, 97,184,166, 59, 47,172,204, 15, 66, 37, 60, 57, 12,220,152,228,168,144,
+ 77, 35, 16,197,159, 68,106,161, 88,234,102,104,191,104, 88, 1,114, 84,173,192,114,193,114,237, 84,161,152, 32, 33, 64,176, 2,
+228,155,141,128, 13,233,248,131,216, 12,110,107,245,216,236,216,210,174,155,102, 19, 51, 24,254, 12, 74,185,104,144, 74,126,174,
+102,127,139, 76,118,175, 5,151, 65,108,123,159,142,181,183,206, 74,121,146, 94, 82,148, 50, 14,180,215,116,165,219,144, 32,213,
+182,215,234, 10, 53,122,167, 42,135, 42,149,118,221,213, 70,214,169, 21,107,134,188,202,229, 86,106, 18, 4, 96,219,174,148,212,
+ 36,135,144,147, 32, 54,202,144, 24,109,164, 55, 29,160,157,199,135,107, 57, 22,193,139,100,166,162,160,236,107, 61,139, 88, 85,
+154, 99,195, 80,113,154, 42,105, 34,162,212,101, 58,174, 69,115, 39,197, 74, 10,206, 14, 19,204,123,235,144, 59,209, 19,116,167,
+ 75,115,110,234, 52,115,107,213, 46,219,210,159, 99,220,151,204, 58,236, 73,212,214, 41,117,135,213, 18,124,250, 47,142,152,243,
+ 99,207,171, 72, 8,129, 8,201,140,219, 77, 59, 90,111,154, 74,212,166,148,189, 76,174, 26,121,106,106, 29,239, 34, 68, 9, 80,
+110, 46, 9,181,201,219,183, 91,237,190,248, 60,236,234,136, 7,148,183, 95,203, 29, 10,217,141,236,135,113,237,133,155, 34,137,
+104, 94, 55, 7,131, 64,143, 79,110,109, 18,136,236,138, 4,185, 20, 96,229, 38, 91, 17,174, 7,228, 6, 36,186,204,216, 18, 99,
+188,239, 63, 35,146, 34,186,166, 84,235, 74,109,197,229,117,203,231,113,228, 81, 38, 76, 27,115, 80,181,169, 66, 35,130,109, 86,
+161, 91,167,203,170,192,109,238,102,132,198,233, 52, 53, 63, 33,184, 44,146,133,204,125, 1, 82, 99, 70,241, 95,139, 22, 83,173,
+ 37,181,115,182,167,188,183, 37,129, 6,159,182,219, 79, 95,118,221,177,236,232, 45,208,224,166,152,212, 39, 19, 54, 68, 95,130,
+ 92,184,146,164, 69, 83,145,233,254, 40, 83,113,195,107, 72,113,182, 68,151, 7,140,251,152,109,170, 91,157,184,213,165,133, 85,
+ 47,171,178,127, 33,230, 75,114,171,213, 23, 35,250,156,199, 84,159, 15,147, 25,200, 41,229,229,200, 61, 52,228,156, 45, 83, 33,
+ 46,213, 9, 12,109,184,184, 98,214, 61, 46, 54,177,183, 93,246,239,141,118,204, 17,118,208, 89,135, 93,192, 23,247,125,248,187,
+241, 61,191, 16,171, 20,120, 91, 43,100, 59, 38, 45, 50,223,155,227,110,163,143,165,182,103,212,183, 14, 41,104,204,160,206,247,
+ 98, 91,122,157, 79, 90, 99, 41,149, 50,183, 97,190,216,132,184, 46, 57, 2, 52, 39,156,210, 5, 41, 40, 66,220, 89, 66, 27,109,
+ 42, 90,220, 95,192,219,105, 72,202,150,226,212,112,218, 7, 82, 73, 32, 0, 59,247,214,204, 79,218,105, 60, 77, 67,171,238, 54,
+206,186,245, 31,112, 40,173, 83,169, 53,218, 12, 24,116,183,153,221, 11,113,130,220, 51,122, 91, 76, 85, 22,150, 26, 76, 26,164,
+146,195, 50, 28, 10, 83,241,203,235,111,199,134,228, 45,102,150, 23,179, 43,113,174,103,163, 78,220,186,172, 10, 83, 3,192,117,
+104,185,234,127,195, 25,237, 41, 32,164,174, 53,175, 72, 83, 84,104,143,114, 21,146,164,150,212, 20,190,185,198, 4,179, 46,173,
+203, 50,156,190, 58,121,100, 74, 87,131,103, 86, 97,169,159, 98, 92, 0, 11,184,125,138,176, 91,105, 32,109,107, 6,154,136,106,
+106,106, 25,213, 76,161,250, 16, 54, 3,176, 36,216, 2, 58, 17,126,183, 62,252, 48, 60, 43,109,125, 79,127,119,214,218,118,158,
+185, 44,218, 22,100,195, 85, 21,152, 78,173,176, 24,129, 33,164,215, 46, 72, 51, 89, 87,232,220,113,192,221, 34,148,242, 50,174,
+121,115,101, 55,205, 29,104,115, 82, 78,211, 25,177, 59, 3,102,236, 21,187, 50,139,108,185, 46,165, 62,173, 33,153, 53,170,245,
+ 73, 17,145, 54,114,162,180, 89,135, 17,150,162,180,148, 67,165,176,133, 61,224,176, 57,202, 21, 37,197, 41,197,149,100, 62,122,
+131,113, 6,106,185,165, 96,104,175,236,208, 11, 33, 34,197,137,182,166, 35,168,189,128, 0,244, 85, 23,220,156, 61, 80,210,154,
+104,136,127,239, 28,220,251,189, 7,243, 39,212,156, 45, 45, 45, 45, 48,227,119, 11, 95, 8, 4, 16, 70, 65,232, 65,215,221, 45,
+ 12, 12, 83, 67, 45, 53,146,219,104, 65, 61,202, 82, 1, 63,128,213, 77, 45, 45, 12, 12, 51,123,215,177,246, 78,250, 90,142,219,
+ 55,132, 15, 17, 77,169, 82, 41, 53, 88,229, 45, 85, 40,211,185, 57, 19, 46,159, 36,164,248,107,198, 2,208,160,166,221, 72,229,
+113, 10, 24,199, 21, 55, 95,128,189,229,176,101,201,126,218,136,213,251, 65, 75,139, 49,164, 82,249, 99, 86, 27,103, 36,161, 50,
+233, 82, 22, 57,221, 9,192,203, 14, 59,205,140,242,163, 60,162, 65,250,242,180, 33,192, 82,180,165, 96,247, 10, 0,143,219,170,
+147,196,127, 5, 56, 23,196,226,149, 89,229, 28,148,121,204, 74, 17, 43,169, 25, 98,168,208, 62,202, 73,169, 94, 41,209,127, 84,
+ 75, 27, 50, 11,136,217, 1, 55,183,188, 54,241,191,143, 60, 47, 87,165,200,171, 99,172,201,165,114,239, 65, 86,173, 45, 54,179,
+246,158, 61, 46,146,192,237,250,198, 41, 21, 92,216,200,174, 64,180, 88,213,177,251,198,219,222, 2,182,186,252, 11, 10,228,255,
+ 0,246, 90,178, 91,207,151,233,189,211,147, 31, 62,108,117,239,167,207,108,248, 36,222, 91,238,100,115, 87,165,127, 3,105, 10,
+113, 62, 60,170,176,241,106, 37,172,142,111,119,166, 48,172,135, 49,156,120,203,100, 12,103,174, 48,100, 58,105,148,245, 30, 99,
+ 13,130,123,231,195, 26, 33,168,236, 50, 48,211, 77,182, 63,217, 72, 31,208, 53, 83,100,223, 67,239, 15,232,107, 82,167, 52,206,
+115, 28,238,154, 50, 15,179,179, 69, 4,111, 99,246,100,120, 99, 18,149, 61,249,111, 17,244, 97,139,115, 58,250, 99,248,133, 95,
+ 67, 37, 46, 85,146,229,217, 29, 76,128,143,104, 85,150,162, 68,184,251, 81,164,210, 24,131, 14,220,200,229, 95,240,156,107,150,
+193,112,227,103,236,125, 9,184, 52,136,161,218,131,220,143, 84,106,146,130, 29,168, 84,101, 37, 56, 15, 74,120, 32, 14, 80, 10,
+130, 27, 64, 13,182, 9, 8, 72,201, 39,100,244,180,181,212,185, 94, 87,151,100,153,125, 38, 85,148,209, 71,151,101,180, 40, 35,
+134, 24,148, 36,113,160,232, 21, 70,221,110, 73,234,204, 75, 49, 36,147,142, 85,205,115, 92,203, 59,204,106,243,108,222,182, 76,
+199, 50,175,115, 36,211,204,197,228,145,207, 82,204,119,233, 96, 7, 69, 80, 21, 64, 0, 0,180,180,180,181,191,134,252, 45, 45,
+ 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12,104, 15, 16,151, 95, 24, 54,239, 17,123,
+ 83,103,109, 12, 84,212, 54, 75,118, 69,182, 47, 27,216,219,148, 90,131,187, 24,189,180,184,101, 92,219,132, 23, 42, 76, 82, 37,
+139,234,202,151, 77,160,210,125,241,138,135,213,181, 58,116,137,140,248, 9, 90, 64,231,117, 43,136,239,106,117,199, 89,185,105,
+117, 10, 52,219, 42, 68,189,220,218,235, 50,177, 79,135,177,151,213,106,118,216, 64,186,248,146,182,109, 10,197, 94,196,168,220,
+ 27, 33, 79,182,247, 3,109, 33,236,132,171,166,163, 88,171, 53,117,221,106,132,229, 62, 29, 72,212, 41,241, 36, 73,106, 28,131,
+ 84,132, 47, 28,201, 10,199,108,140,227, 84, 76, 88,197, 69, 69,150,202,143,115,203,215,203,250,134,165, 20, 60, 69, 77, 73, 4,
+113, 75,195,212, 85,111, 18,196, 57,143, 18,150,102,142, 70, 98,238, 24, 50,182,184,244, 70,234, 2,130, 99, 89, 13,218, 73,249,
+209, 44,195,134, 42,235,106, 36,154, 46, 37,175,163,142, 87,148,152,210,102, 8,171, 36,106,161, 35, 42,200,203,203,148, 73, 42,
+ 49, 44, 87,154,209,139, 36,116,252,158, 18,111, 54,228,113,174,250,120,178,217,207,122,222, 77,206,102,216,218,235, 50,169,182,
+183,141, 11, 96,170,118,165,187, 86,174, 81, 46, 93,174,102,187,109,151, 87,181,116,241,125,223,117,200,235,187,229, 59, 34,206,
+174, 87,232,109, 83,149, 52, 24,150,188,232,144,226,189,121,221,222, 37,189,160,182,229,237,191,208,108, 59, 58,250,169,203,183,
+173,190, 38,157,179,108,216,155, 3, 85,170, 88,180,107, 78,206,216,154,213,197,195,166,226,216,251,164,154, 35,177,247, 99,117,
+ 46, 45,225,139,109,211,166, 90,113,234, 19,223, 67, 85,233,113, 87,111, 66, 52,228,205,149,220, 51, 22, 58,149,204, 89, 65, 80,
+ 24, 4,167,168, 30,131,211, 95, 12, 72,196,133, 22, 91, 42, 29, 1,229, 25, 3,211, 75,197,197, 20,136,176,163,240,229, 36,235,
+ 18,176, 33,145, 44,210, 60, 84,241,180,133, 86, 48,170, 73,131,152, 2, 42,144,206,124,197, 76,130, 93,105,120, 70,177,218,103,
+143,138, 43, 96,121, 93, 72, 43, 36,132,172,105, 45, 76,169, 24,102,149,157,128, 21, 28,178,100,103, 82,136, 60,129,132, 70, 29,
+ 28,224,214,249,226, 54,181, 83,222,219, 55,136, 39, 43, 85,241,100, 94,246,107, 27,119,127, 86,246,245,141,190,145,120, 91, 23,
+102,204,109,181,247, 91,109,168,212,184, 17,169,213,150, 40,215,245,201,118,208,253,234, 19, 64,161,116, 5, 67,154,165,207,141,
+ 37, 70, 41, 62,217,106,175, 29, 60,104,113, 79, 93,164, 80,248, 84,226,128,108,102,199,212,235,214, 38,211,193,135,178, 27,169,
+ 46,147,113, 46, 44,255, 0,115,185,183, 61, 15,199,182, 20,196,245, 87, 38,211,216, 92, 23,154, 60,130,143, 6,156,148,254,148,
+200,113,217,206, 33,150,155, 57, 67,105, 73,237,144, 49,211,211, 67,187, 77,128,242,138,221,136,195,139, 61,212,180, 5, 19,247,
+157,111,240,175, 28,175, 11,103,243,113, 12, 25, 5, 53, 85, 91, 66,177, 70,164,152,227,133,180, 34, 75, 44,105, 26,133, 87,155,
+ 75, 19,164, 5, 65, 35,170, 0,166,216,110,227, 15, 15,159,139,248,110, 14, 25,168,226, 74,186, 58, 36,153,165,149,192, 89,101,
+157, 4,143, 36, 48,202,242,146,204,144,234, 80, 53, 18,206, 99,141,156,150, 92,126,116,252, 63,207,246,190,240,179,111, 84, 45,
+109,128,218, 78, 44,118,210,133, 86,172, 61, 95,169,195,163,240,195,113, 77,114,125, 93,248,145, 32,174,108,185,213,189,175,149,
+ 33,245,136,112, 98,182,132,169,210,134,210,214, 16,148,229, 89,216, 95,229,123,244,129, 63,242,126, 52, 63,251,173,204,255, 0,
+254, 61,169,231,253, 81, 76,255, 0,200, 99,127,246, 73,254,173, 47,170, 41,159,249, 12,111,254,201, 63,213,169,173, 79,140,244,
+149,147,203, 85, 89,225,206, 77, 85, 85, 49,212,242, 73, 10,188,142,118,221,157,162, 44,199,110,164,147,211,211, 16, 58, 95, 2,
+107,104,105,226,164,162,241, 71, 60,163,164,128,105, 72,162,157,227,141, 23,246, 81, 18, 80,170, 58,236, 0, 27,226, 37,155,115,
+253,212,126, 49,125,153,188,113,237,174,247,198,222,153, 59,193, 46,175, 96, 72,219,250, 22,228,109,202,182,202,225,187,172,138,
+ 21, 82,137,114,222,246,157,180,203,246,205, 29, 85, 20,205,129, 74,154,216, 8, 67,198, 83,220,180,197, 40, 34, 90,211,174,108,
+123, 29, 56, 93,226,149, 28,122,109, 85,237, 78,219,189,198,219,219,123,106,234,245,201,187,145,114,220,214,181,114,217,129, 10,
+149, 34,223,173, 81,102, 90, 18, 69,110, 36,113, 58,173, 81,126, 98, 97,251,154, 2,223,101, 46, 57, 49, 77,165, 17, 22,226, 63,
+ 64, 22, 96,195,143,159, 6, 51, 45,115, 12, 43,145, 0,100,124,245, 69,170, 85, 61,151,140,134,162, 50,135,137, 36,184,148, 36,
+ 40,147,243,198,154,161,241,114,174,151, 42,226,204,162,135,135, 40,168,169, 56,157,157,130, 68,186, 35,166,230,211, 71, 75, 40,
+ 72,213, 66, 72,165, 35, 14,129,130,132,145,152,182,181, 58,112,239, 63,130,212, 85,153,191, 6,103, 85,252, 79, 95, 95, 91,194,
+ 43, 26,151,149,181,201, 87,201,170,146,174, 18,242,179, 23,141,131,202, 81,202,150, 47, 18,162,175, 45,134,178, 91, 28,254, 11,
+ 94, 39,235,248,104,231,255, 0,249,185, 70,127,110,177,109,192,143, 34, 93,135,122,196,136,195,210,165, 74,180,238, 40,241,163,
+ 71,105,111, 72,145, 33,234, 68,198,217, 97,134, 91, 73, 83,175, 45,197, 37, 41, 74, 65, 82,148,160, 0, 36,235, 46,210, 35, 32,
+131,216,244, 58,169, 35,115, 27,163,129,114,132, 31,220,111,139,166, 68, 18, 35,161, 54, 14, 8,253,226,216,132, 15,176,167,134,
+142, 35,182,159,142,131,114,110,159, 15,251,217,182,150,232,218, 43,214,152,107,251,129,181, 87,213,153, 69,250,202, 85,110,207,
+118, 45, 59,235, 91,142,131, 25,143,127,113,168,178, 84,219, 62, 39,136,180,199,112,165, 36, 33, 68,117, 47,219,205,195, 55, 28,
+251,238, 54, 30,243,225,142, 29, 70,225,177,182, 89, 85,139,166,109,187, 96,220, 82, 40,155,167, 77,220,121,146, 24,110, 13,239,
+ 72,138,151, 99, 46,172,220, 26, 44, 70, 24,129,245,108,167, 42,145,159,169,206, 83,113, 11, 78,151, 83, 34,132,192,132,135, 60,
+100,198,101, 46,147,146,224, 64, 11,207,219,162, 84,132,172, 20,173, 41, 82, 79,112,160, 8, 63,113,213,149,152,120,159,153, 87,
+113,173, 39, 27,140,170,149, 43,105, 34, 16,136, 36, 15, 44, 37,116, 73, 27, 19,114,172, 24,164,140, 1, 7,202,108,119,232,106,
+156,179,194, 76,171, 47,224, 42,222, 1,108,226,174, 74, 26,217,140,230,162, 50,144,206,175,174, 41, 20, 11, 43,161, 85,120,148,
+144, 65,212, 46, 54,216,136, 25,208, 61,170, 30,218,237,168,164, 39,110,107,112,119, 42,161, 86,167,180,154,124, 73,123,145,195,
+123,147,175,152, 73, 79, 52,102, 82,236,185, 86,131, 14,213,229, 7, 80,172, 61, 80,106, 99,238,173, 39,196,113,206,163, 77,149,
+151,192,119,180,211,218, 97,189, 44,110, 46,255, 0, 64,220,170, 74,107, 38, 36, 90,246,237,239,133, 26, 85,175, 26,139,111, 48,
+234,221,106,157,101, 88, 47,198,128,235,144, 71,143, 49,200,112, 41, 20,248,116,144,252,135, 28,117,248,190, 58,222, 95,232, 6,
+237, 2,142,250,185,220,129, 29, 74,245,240,211,253, 90, 50, 61, 62, 20, 79,251,222, 43, 45, 99,205, 8, 0,254, 56,212,132,120,
+202,153,122,212, 79,195, 92, 13,149,240,246,109, 84,165, 90,170, 40,213,156,106,234, 81, 86, 56,128,223,205,165,153,208,176, 5,
+209,237, 99, 26, 62, 5,190,100,244,176,113, 87,136, 57,191, 19,100,212,110,174,148,114,202,202,135, 79, 64,238,210,202, 78,215,
+ 82,200,169, 32, 82, 66, 58, 94,248,215,190, 20,248,114,178,184, 89,217, 43, 15,102, 44, 56, 70, 37,191,100,208,163,210,163, 45,
+222, 85, 76,168, 74, 82,220,153, 87,173, 84,156, 72, 1,218,172,250,188,153,211, 37, 41, 41, 74, 21, 34,123,133,180, 33, 28,168,
+ 78,200,105,105,106,151,168,168,158,174,121,234,170,101,105,234, 42, 93,164,145,216,221,157,220,150,102, 98,119, 44,204, 73, 39,
+185, 56,189,233,169,169,232,233,169,232,233, 97, 90,122, 90, 84, 88,227,141, 5,149, 35, 69, 10,136,160,108, 21, 84, 0, 7, 96,
+ 48,180,180,180,180,142, 23,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,
+210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,214, 53,117,217,246,213,239, 67,171,219,183, 69, 34, 21,
+ 94,149, 91,165, 79,163, 84, 24,146,195,107,113,112, 42,113, 93,135, 45,182, 95, 41,231,142,178,203,206,114,173, 5, 42, 66,136,
+ 82, 72, 80, 7, 89, 46,150,178, 24,169, 5, 77,136,238, 48, 8, 7, 98, 46, 49,196,171,235,133,221,241,219,202,252,170, 5, 5,
+186,133,255, 0,110, 54,227,142, 91,183, 24,180, 43, 87, 5, 89,218, 66,156, 34, 28, 91,130,109, 22,174,210, 93,171,176,128, 27,
+113,199, 24,105,215,249, 3,170, 47, 40,169,247, 49, 56,124, 52,111,189,235, 81,137, 67,173, 91, 85,184,244, 57,175, 52,212,250,
+127,240, 58,177,105,211,231, 52,181, 0, 89,174,220, 21,122,163,202, 77, 11,186,164,199, 97, 13, 46, 66, 17,224,173,197,178,183,
+ 24,123,188, 58, 90,146,167, 20, 85,172, 74,141, 2, 59,168,182,162, 91,115,107, 92,168, 54,223,184,232,119,216, 13,176,222,114,
+248,203, 92, 57, 11,126,155,126, 7,249,225,157,217,141,156,160,236,245,178,138, 85, 60, 53, 50,183, 53, 12, 57, 94,173,134, 82,
+202,230,190,210, 57, 90,139, 21,176, 63,193,105, 44, 36,169, 17,217, 29, 0, 37,106,202,214,163,167,139, 75, 75, 81,233,166,150,
+162, 87,154,103, 50, 73, 33,185, 39,231, 96, 58, 0, 54, 3, 97,182, 55,149, 85, 20, 42,139, 42,244,194,210,210,210,210, 88, 54,
+ 22,150,150,150,134, 6, 32,111,253,251,111,253, 25,127,246,206,255, 0,117, 13, 84, 31, 77,167, 61,189,153,157,251,127,142,111,
+251,168,234, 6,201, 25, 61, 71, 79,216,116, 66, 7, 92,227,160,237,253, 29,191, 61,180,202,213,149, 2,195, 94,231,220,191,150,
+ 52,249,178,126,215,224, 63, 44, 79, 25, 63, 77,151, 39,255, 0, 6,119,218,127,150,103,111,251, 41,107,223,247,236, 95,244,103,
+255, 0,219, 47,253,212,245, 4, 4, 2, 7, 95, 63, 47,223,170,169, 25, 61,186,122,250, 31, 81,243,210,126,219, 83,255, 0, 19,
+240, 95,203, 24,230,201,127,181,183,192, 98,119,163,233,176,103, 24,246,104, 30,163,167,248,229,121,231, 24,255, 0, 53, 62,250,
+168, 62,154,225, 35,175,179, 71, 31, 47,229,149,254,234,154,130, 42, 65,207, 67,215,212,255, 0, 96,209, 9,238, 1, 57,207, 66,
+113,249,198,136,213,245, 67, 97, 37,143,253, 43,249, 99, 60,217, 45,187,126, 3,242,196,238, 7,211, 87,201,199,247, 52,251,255,
+ 0,207, 39,240,255, 0,146,174,190,171,233,171,114,130,127,185,167,159,151,242,200,255, 0,117, 93, 65, 69, 9,235,159,151, 79,
+207,231,190,171, 4,115, 15,151,207,215,229,233,211, 26, 76,230, 21,118, 63, 93,254, 85,254,156, 37,237, 18,245,215,248, 15,203,
+ 19,165, 79,211, 89, 73, 4,159,102,170, 83,233,158, 50,135,207,254,106,191, 45, 18,215,211, 80,241, 19,205,253,205, 94, 80,123,
+127,142, 62,115,255, 0,101,109, 65, 56, 67,100,168, 18,128,163,223,185,239,242, 25,237,223, 87, 54,211,203,202, 0, 0,118, 29,
+ 49,229,158,131,238,210,103, 49,173, 22,250,254,191,225, 79,233,198, 13, 68,189,155,240, 31,150, 39, 74,159,166,146, 79,127,102,
+191, 47,111,249, 99,122,255, 0,213, 99, 85, 71,211, 69,207,250, 54, 71, 94,199,249, 98,244,199,175,249,172,106, 11,137, 0,145,
+159, 63, 79,199,240,209, 41, 7,203, 0,118, 57,237,143, 77, 96,230, 85,191,241,191,202,159,211,140,123, 76,223,183,248, 15,203,
+ 19,158,254,253, 11,254,141,175,251, 98,127,186,206,189,143,166,127,144, 15,247, 54,241,159,249,225,255, 0,186,214,160,208,144,
+ 8,234,123,244,199,237,253,218, 36, 39, 29,124,250,119, 29,189,116,145,205, 43,199,251,255, 0,242, 39,187,252, 56,199,180,205,
+109,218,196,123,135,229,137,201,143,166,116, 79,250, 55, 15,111,252,240,187,127,217,107, 94,199,211, 56, 39,191,179,119, 29, 51,
+254,120, 95,111,127,241, 91,233,219, 80,111, 66,135,111, 60,254, 7, 24,209, 8,238,125, 72,239,223, 31,119,231,182,138,115, 90,
+253,254,190,214,255, 0, 10,127, 78, 11,237, 51,116, 50, 88,250,233, 31,150, 39, 26, 62,153,166,112, 71,179,131, 57,237,142, 48,
+ 63,221,115, 94,135,211, 49, 57, 0,251, 55,241,156,227,252,112, 51,219,254,171,154,131,194, 82, 70, 48, 64,232, 51,143, 33,242,
+252, 52, 66, 49,158,191, 96,244,255, 0,142,136,115,108,195,114, 42, 46, 7,248, 19,250, 48, 95,107,159,246,255, 0, 5,252,177,
+ 56, 65,244,203, 15,159,179,135, 31,245,191,207,255, 0,149,221,122,254,252,175,166,127,185,197,246,143,229,127,219,211,254, 75,
+218,132, 10,112, 10,114,160, 9, 29, 7,168, 61,127,167, 94,243,144, 72,238,122,100,244,207,207, 69,253, 47,152,255, 0,204,127,
+146, 63,233,198, 13, 93, 64,255, 0,121,248, 47,229,137,189,127,126, 89,255, 0, 71, 16,255, 0,239,127,229,235,254,107,186, 95,
+223,150,127,209,197,255, 0,107,255, 0,247, 93,212, 32,130, 70, 78, 83,156,121,142,227,167, 97,235,175,129, 39, 36, 96,158,227,
+228, 15,174,116, 63, 75,230, 63,243, 31,228, 79,233,198, 61,174,163,175, 50,254,235, 47,229,137,191,255, 0,126, 86,112, 79,247,
+ 56,187, 99, 63,227,127,235,216,255, 0,154,238,144,250,101,100,228, 15,103, 9,200, 56,255, 0, 59,241,143,159, 95,228,189,168,
+ 65, 28, 19,201,158,160, 12,125,189, 71, 93,124,228, 56, 61, 58,142,199,215,215, 67,244,190, 96,127,246,143,242, 39,244,227, 34,
+170,163,188,157, 61,195,242,196,224, 26,250,101, 42,117,105, 66,125,155,238,173, 74, 90, 16,134,216,226,229,114, 31,117,110, 45,
+ 45,180,204,120,237,112,184, 87, 34, 67,142,173, 8,109,180, 2,183, 28,113, 40, 64, 42, 80, 26,145,125,139,237, 28,187,106,123,
+107, 97, 92,219,161,195,163, 59, 99,184,215, 61,173, 2,228,186,182,189,141,220, 55,106,172, 25, 85, 68,137, 81,173,154,141,204,
+118,206,154,106, 53,248,244,231,225,154,131,105,167, 50,136,178,214,252, 70,220,146, 35,151,215,249,251,123, 18,120, 79,167,111,
+111, 18,114,247,186,251,163, 49, 85,218,222, 24,163,210,111, 53,194,156,128,245, 62,228,222, 74,163,175, 29,169,183,157, 96,172,
+ 9,108, 83,222,131, 80,184,101, 52,174,132,209, 41,225, 89, 75,196, 25,105, 85,110, 39,101, 73,126,161, 41,197,174, 75,239,169,
+114,139,171,241, 63,239,176,162,251,170, 86,121,157, 65, 89,113, 67, 7, 35,169, 4, 18,115, 82,113,247,137,217,238, 79, 87, 22,
+ 91,147,230, 34, 26,136,198,185,156, 69, 79, 33, 23,221, 80, 44,145, 56, 6,222, 98,116,157,153,122,110, 71, 99,125, 27, 60, 13,
+161,241, 3, 47,175,226,174, 50,162,122,236,146, 71, 48, 81, 64, 36,150, 14,107, 70,214,150,114,244,239, 20,133,117,222, 36, 93,
+ 65,110,172, 77,203, 45,186,186,215,180, 61,151,139, 72, 78,210, 40, 56,230, 50,147,125, 47,149, 37, 77,151, 65,231,254, 5, 97,
+ 72, 9,229,201,242,231, 29, 51,240,235, 38,139,199, 80,146,160,145,181,193, 5,104, 75,168,255, 0,223,202, 78, 90, 39,195, 82,
+214, 13,164, 11,120,116,164, 96,142,161, 65, 94,120,215, 37, 97,212,227,199,149, 78, 9,151, 17,105,146, 42, 43,109,228,184,158,
+ 66,150,152, 96,162, 49, 81, 60,133,229, 15, 16,124, 93, 73, 25,192,198,117,127,135,119,198,133, 85,181,154, 92,152,232, 50, 28,
+186,224, 45, 77,133,168,134,145, 77,106,160,134,156, 25,228,241,210,136, 43, 91,107, 60,205,168,199, 90, 80, 50,188, 26,248,120,
+191,199, 91,223, 62,222,224, 91,217,168,122, 27,111,255, 0,163,123,205,183,183,173,183,183, 70,215,125, 26,252, 47,211,253,139,
+131,216, 17, 28,143,189,110,104,215, 17,164,174,118, 53,123,111, 17, 95, 80, 78,224,219, 29,102,143,198,144,125,124,131,109, 74,
+ 72, 74, 85,145,120,165,105,198, 84,135, 7, 50,109,142,133, 46,164,167, 31,102,112, 78, 53,145,195,226,200, 74,117, 13, 42,195,
+ 67, 36,164, 41,197, 27,185, 11, 13, 21, 41, 73,194,147,252, 30, 10, 94, 8, 28,197, 41, 32, 5,103, 39,166,121,115, 2,240,167,
+ 70, 20, 80,180,187,134,229,185, 73,145, 29,134,150,242,101, 73,157, 30, 64, 97,134,152, 42,230,117,245, 61, 19,152,140,164, 39,
+ 42, 42, 1, 32,105,211,165, 85, 16,235,177,228, 37,200,205, 55, 48,170, 47,130,211,169,144,168,175,186,194,157, 76, 57, 13,129,
+240,203, 11,104,243,140, 39,147,168, 74, 84, 64,202,195,197,222, 56, 99,182,126, 45,113,183,178,209,131, 98, 7, 66,105,253,247,
+233,115,110,128, 3,138,247, 55,240, 35,129, 40,195, 21,225,118,129, 72,107, 19, 85, 94,119, 82,194,219,213, 27,146,171,175, 96,
+ 71,152,124, 11,113,237, 58,246,213,110,191,179,158,220,176, 55, 74, 7, 3, 3,126,182, 34,238,121,155,106,229,220,202, 87, 17,
+ 78, 89, 19,118,199,113,165,190,239,212,246,205,239,105,183,176,245,193, 6,220,171, 67, 74, 62,167,174,138,129,141, 46,106, 28,
+166,201,143, 6, 89,138,153,124,121, 63, 76,188,131,211,217,192, 8,233,212,113,129,228,124,255, 0,205,115,211, 93,240,187,108,
+ 11, 23,121, 44, 27,215,104,183, 62,212,167,238, 22,218,110, 61,183, 91,177,239,203, 66,160,208, 85, 46,224,160, 85, 98, 2,253,
+ 61,213,161,121,131, 48, 56,162,244, 73, 72, 34, 68, 57,212,248,242,227, 45,183,153,109, 73,252,231,120,230,246,106,239,183, 6,
+ 60, 82, 94,220, 62, 83,108,205,193,221, 91, 81,182, 13,241,179, 87,213,187,104,220, 55, 36,155,231,104,106,242,164, 10, 21, 78,
+166,154, 13, 41,239, 10,232,165,186,219,212,154,235,124,169,228,168,210, 87, 32, 1, 30,100,114,171, 79,131, 60, 72,204,115,136,
+ 37,165,205, 43, 2, 87, 83,141, 66, 67, 28, 72,146,161, 61,172,129, 53,165,192,178,216, 50, 16, 84, 54,151,115,201,126, 41,240,
+ 67,240,133, 90, 87,229,108, 70, 77, 84,193, 66, 19,169,160,115,246, 86,238, 90, 66,143,111, 41,114, 72,109,181, 29, 64, 44,156,
+255, 0,191, 47,234, 71,247, 56, 71, 65,159,243,192,245,237,255, 0, 37,221,124,254,252,192,255, 0,251,184, 58,127,233,129,251,
+191,146,230,161, 89, 94,176, 47,187, 81,114, 17,117,216,247,149,174, 99,171,195,147,252, 35,181,171,244, 20,198,115,152,128,219,
+235,171,211, 88, 13, 56, 84, 8, 9, 81, 4,144, 64, 7, 88,123, 74, 75,159, 19, 69, 14,164, 21, 0,180, 45, 46, 36, 20,146, 20,
+ 9,109, 68, 2, 15,124,246,212,249, 51,218,185, 55,142,181, 92,123,132,103,248, 46, 42, 15,110,150,246, 51, 0,111,208,133,191,
+238,181,241, 56, 81,244,203,137,239,236,225,192, 29,201,226,255, 0,215,254,171,186,248,126,153,120, 29, 15,179,135,175,203,139,
+254,159,143,242, 93,212, 32, 71,158, 48, 9,235,223,204,253,191,118,188,167, 39,161,193,199, 83,242, 36,159,221,165,127, 75,230,
+ 63,243, 31,228, 79,233,193,189,170,162,223,222,111,255, 0, 72,252,177, 56, 1,244,203,201, 56, 30,206, 14,191,250, 95,255, 0,
+186,238,190, 43,233,152, 4,128,127,185,195,159, 80, 56,191,234, 62,223,241, 93,212, 32,142,124,128,239,248,116,243,251,245,224,
+ 2, 84,115,211, 3,186,122,117, 63,111,200,157, 15,210,249,143,252,199,249, 19,250,113,159,106,159,254, 39,224, 63, 44, 78, 11,
+251,242,241,128,127,185,197,247,127, 43,254,191,183,133,221, 47,239,203,198, 79,253,206, 35,129,231,252,175,186,125,255, 0,226,
+187,211, 80,130, 66, 58,149, 12,115,116, 4,159, 63,159,111,206, 53,240,167,226,206, 58,142,135, 29,189, 58,232,126,151,204,127,
+230, 63,200,159,211,129,237,117, 31,183,248, 47,229,137,190, 15,166, 96, 9, 35,251,156, 36, 99,204,241,125,223,236,255, 0, 21,
+237,123, 31, 76,184, 28,127,220,226,239,156,127,141,247,167,127,249, 47,106, 16, 24,207,151,108,247,244,199, 92,126,124,181,244,
+117,192,232, 61, 63,183,166,135,233,124,199,254, 99,252,145,255, 0, 78, 49,237, 85, 23, 31, 89,248, 47,229,137,191,143,166, 88,
+ 79,250, 56,122,245,233,252,175,255, 0,163,252, 87,122,235,233,250,101,100,119,246,112,227, 63,243,191,235,248,127, 37,221, 66,
+ 19, 3,190, 50, 71, 94,159,213,159,150,190,247, 32,249,119,193, 25,253,190, 93,244, 63, 75,230, 63,243, 31,228,143,250,112, 61,
+170,163,254, 39,224,191,150, 38,238,126,153,113, 31,232,224, 56,245,254, 87,248,253,159,201,119,166,169, 43,233,153, 17,254,141,
+252,140,227, 63,203, 3, 30, 93,255, 0,205,115, 80,137, 32,156,156, 0, 51,142,224,117,245, 61,123,245,213, 5, 32, 17,128, 51,
+158,253,127, 63,145,172,254,151,204, 44,127,180,111,255, 0, 68,127,211,140,251, 84,255, 0,183,248, 15,203, 19,121, 63, 76,212,
+130,113,236,221, 39, 7, 31,231,129,248,255, 0,201,111, 95, 15,211, 55, 35,183,179,120, 30,153,255, 0, 60, 47,217,254,107,125,
+245, 7,245,128, 51,129,133,119,198, 14, 62,255, 0, 77, 10,172,140,244, 29,122,244,245, 31,111,111,237,209,151, 54,175,239, 83,
+123,255, 0,129, 63,167, 25,246,169,251,191,224, 63, 44, 78, 33, 95, 76,228,167,253, 27,185, 30,191,203, 11,253,214,245, 72,253,
+ 51,220, 28,127,115,115, 63,245,194,255, 0,117,175, 77, 65,216,247,233,128,113,149, 30,227, 30,127,111,150,188, 16,112,114, 0,
+207, 92, 14,248,249,244,232, 59,232,227, 53,175, 32, 30,127, 95,240,167,244,224,235, 81, 49, 23, 50,126, 3,242,196,226, 85,244,
+208, 57,127,209,181,145,235,252,176,255, 0,221,103, 84,207,211, 67, 35,253, 27, 63,135, 24,191,238,177,168, 57, 45, 35, 56,193,
+193, 29,252,191, 31, 95,234,208,235, 73, 57,230, 30,125,255, 0,163, 74, 46,103, 90,127,223,127,149, 63,167, 0,212,205,183,155,
+175,184,126, 88,156,137,250,105, 24,200,254,230,199,108, 99,252,113,123,255, 0,217, 99, 84,213,244,210,249,127,209,175,159,250,
+227,126,239,228,175,168, 52, 41, 61, 72, 62, 89,255, 0,142,168, 41, 56, 62,164,103, 31,126, 58,232,227, 50,173,255, 0,141,127,
+251, 83,250,113,145, 81, 41,232,255, 0,128,252,177, 57,179,244,211,113,219,217,173,147,233,252,177,255, 0,221, 95, 94, 15,211,
+ 80,198,127,238,106,246,242,254, 88,253,127,254,213,181, 6, 5,142,164,147,229,220,116,200,251, 71, 97,211, 84,150, 6, 51,159,
+179,211,246,104,227, 48,172,218,243, 94,253,244,175,244,227, 62,209, 55,237,254, 3,242,196,231,207,211, 85, 32,103,251,154,121,
+199,252,242,113,255, 0,229, 87, 84,149,244,214, 72,255, 0, 70,150, 71,254,153, 61,191,236,169,168, 45,169, 56,237,219,247,143,
+ 95,191, 67, 44,117, 35, 3,175, 92,104,195, 48,171,190,242,237,255, 0, 74,254, 88, 56,158, 75,253,187,253,195,221,238,196,233,
+215,244,215,249, 15,254, 13, 12,143, 95,229,149,251,191,146,159,174,168, 31,166,202, 57,185, 71,179, 56,159, 60,255, 0, 44,190,
+159,179,133, 62,250,130,147,205,243,116, 35,207,203,167,159, 76,103,203,250,244, 42,153, 60,221,200, 3,183,150, 62,206,158,154,
+ 88, 86,212,216,125,109,255, 0,237, 95,203, 6,231, 73,183,159,240, 24,157,183,247,236,196,140,143,102,104,199,110,188,102,224,
+231,211, 31,201, 71, 94, 15,211,105,229,239,236,204,199,253,115,191,221, 71, 80, 71, 82, 0,206, 51,208,227,167, 94,222,154, 25,
+105, 72, 7, 35,174,124,242,122,252,243,246,104,235, 89, 57, 27,203,191,192,126, 88,199, 58, 77,183,189,253,195, 19,188,254,253,
+183,254,140,191,251,103,127,186,134,150,160,120, 80, 60,142, 63,111,239,210,209,253,170,163,254, 39,224,191,150, 13,205,147,246,
+191, 1,249, 99,234, 65, 0, 3,249,235,162,146, 15, 64,123,244, 31,156,106,138, 70, 79,203,207,243,246,232,132, 12,159,179,175,
+223,157,105, 22,185,191, 75,116,194,120,174, 1, 61,189,113,249,249,106,176, 0, 96,121,121,254,253, 83, 70,122,244,200, 36, 12,
+231,183,231, 58,174,144, 14,115,158,131, 61, 52, 76, 12,123, 74, 74, 73,234, 49,249,252, 52, 66, 7, 76,250,254,204,106,130, 50,
+ 71, 92,224,158,153,235,223,231,231,253,154, 41,180,246, 7,203,169,252,253,186, 65,141,205,241,131,176,191,166, 43,163, 29,135,
+197,143, 79,159,217,162,144,140,142,131, 3,207,237,253,231, 84, 17,208,244, 3,175,125, 20,140,253,223,191, 68, 98, 69,192,194,
+ 36, 91,248,227,210, 7, 98, 79, 83,230,122,244,253,253,180, 72,193, 3,207,211,167,159,110,218,164,145,147,246,117,209, 9,237,
+140,128, 1,200,251, 71,223,219, 73, 49,185,233,108, 99, 21, 18, 0,193,193,235,223, 61,241,233,162, 83,140, 14,157, 60,134,124,
+191,118,168,164,115, 31,219,247,116,237,162, 80,158,163,167, 65,235,162,147, 97,115,219, 4,244, 23,177,255, 0,199,207,250, 98,
+170, 64,242, 3,229,162, 82, 9,192,249,119,249,252,245,118,183, 45,171,130,238,172, 83,173,203, 86,135, 85,184,238, 26,180,164,
+196,164, 80,104, 52,233,117,122,213, 90, 99,129,106, 68, 58,109, 46,158,203,143,206,146,164,161,100, 33,180, 40,242,182,165, 16,
+ 2, 73,213,222,187, 99, 94,182,156,151, 98, 93, 54,117,215,108, 74, 96,148, 63, 30,227,182,235,180, 39, 90, 90, 78, 20, 28, 77,
+ 82,158,215, 41,230, 7, 90,109, 60, 43, 32,137,165, 81, 43, 11,133, 36,106,181,237,123,117,183,107,224,250, 36,229,180,162, 54,
+ 49, 41,179, 56, 83,164, 27, 94,197,173,164, 27, 88,218,247,182,248,198, 80,144,123,128, 8,207, 65,220,156,249,122,157, 86, 70,
+ 62, 33,143,179,215,239,252, 63,110,188, 32, 18, 50,217, 14, 1,220,161, 73,115,211,185, 65, 56,237,162, 27, 73, 86, 58,128,125,
+ 7,127, 95, 61,101,136,223,126,191,127,195, 26,250,131, 11,131,127,120,239,138,168, 73, 56,233,212, 12, 30,190, 64,234,179,125,
+ 79,108,128, 65, 3,191,221,251, 53,245, 40,236, 58,103,190,122,253,191,187, 85,144,140, 43,169, 3,207,228,114, 15, 95,217,164,
+240, 49, 84, 39, 42,193,232, 59,129,129,148,140,118,207,225,175, 74,108,245, 4,242,143, 47, 81,233,175,160,149,103, 24, 10,245,
+ 30, 99,243,231,175, 67,174, 2,178, 51,230, 48,123,121,159,195,246,235, 24,199,195,174, 40,165, 56,206, 85,212,156,142,157,254,
+204,246,215,148,164, 2, 50,163,223,238,235,242,243, 58,172,224,201, 29,122,122,142,157, 51,140,159,151, 93, 92,168,148, 58,189,
+195, 84,167, 81, 40,116,202,141,102,177, 88,152,213, 58,145, 73,165, 65,153, 85,171, 85,170, 18, 20, 16,196, 10, 77, 42, 3, 46,
+ 72,169,206, 90,136, 8,101,134,214,226,179,209, 58,195, 50,162,150,118, 10,171,185, 39, 96, 48, 91,133, 2,231, 97,181,254, 54,
+183,239,197,153, 93,240, 57, 64, 30,106, 3,174, 51,128, 61, 53,233, 88, 67, 69,215, 84, 27,101, 56,241, 29, 89, 8,105, 40,238,
+165, 21,172,129,140,103, 82, 39,224,247,232,242,113, 5,186, 44,209,175,126, 45,110,120,252, 41,109,245, 65, 45, 76, 98,212,168,
+192,137,115,111,205,126, 34,210,167, 80,219, 22, 95,189, 38, 13,132,167, 80,143,133, 85,151,221,152, 18,178, 69, 47,152, 99, 82,
+ 25,217,126, 4,125,158,220, 32, 70,111,248,177,225,226,214,187,174,202, 84,112,204,221,208,222,132,198,220,171,212,205,121,104,
+ 12, 72,241,238, 54,151, 77,163,211,164, 45, 56,103,220,169,241,154,109, 74,229, 79, 82, 64,134,103, 28,115,148,101,101,145, 24,
+213,204,187, 89, 14,215,247,144, 9,248, 27, 91,212,226,216,224,191, 5,184,251,142, 12,111,150,229, 38,134,142, 80, 8,158,164,
+ 20, 4, 18, 0,100,140,217,216, 94,195,204, 99,185,176, 23, 36, 3,170,254,203, 46, 26, 46, 77,165,224, 39,102,233,180,203, 98,
+123, 55, 94,240,135,247,210,247,144,229, 50, 82, 28,149, 42,249, 17,191,130, 80, 39,169,184,229, 79,197,133, 96,194,183,154,100,
+100, 99,197,117, 73, 37, 43, 81, 86,234, 87,236,203,238,132,204, 33, 46,221,170, 32,138,139, 45, 45,243, 6, 98, 99, 20,165,137,
+143,123,195,179, 60, 34, 27, 65,240,249, 15, 57, 79, 42,214, 17,130, 72, 35, 99,155,223, 42,234,221,136,202,101,194,143, 66,171,
+184,105,112,211, 76, 5,132,211,101,181, 28,123,180,100, 71, 82, 83,238,168, 82, 80,227, 9, 67, 73, 8, 14, 54,132, 97,180, 20,
+130, 37, 39,125, 42,234,171,170,153, 34,124,151,131,206,170, 19, 32, 54, 57,101,207,141,200,137,172, 48, 57,190, 37, 8,222, 27,
+165, 60,170, 39, 42, 9, 10,109, 42, 35,158,243, 89,104,243,106,250,186,249, 38,156,203, 86,236,231,104,202,139,157,149, 87, 85,
+236, 1, 10,190,110,130,198,230,248,244,231,129,168,248,183,129,184,107, 38,225,202, 14, 30,163,155, 47,200,105, 99, 77, 38, 89,
+121,146,114,215, 68,146, 59, 8,236,178, 22, 87,121, 1, 82, 69,181, 95, 73, 7, 26, 81, 90,169, 61, 79,168,208,167,204, 91, 44,
+184,170,148,168, 83, 66, 11,141, 70,124, 78,167, 84, 35, 51, 29,198, 66,130, 11, 8,121,168,165, 36,146,181, 41, 14, 44, 21, 40,
+224, 88,100, 92,178, 84,252, 41, 12, 58,134,169,236,223, 20, 56, 17, 31, 91,158, 31,213,209,106, 45, 85,162,212, 38, 53,239, 67,
+159,220,194,222,100,171, 9, 37, 41,111, 45,133, 37,120,214,238,238, 21,145,110,110,237, 53,104,141, 18,147, 65,187,160,213,226,
+ 84,226, 75, 44, 52,154, 77, 70,163,111,200,247,152,240,235,208,227,114,167,192,113, 14, 20, 25, 44,164, 59, 28,191,226, 56,135,
+145,206,141,115, 74,240, 69, 70,139, 58,226, 93, 94,157, 42,151, 38,217,171,209,163,191, 18, 75, 72, 91,241,167,211,107,148, 86,
+235, 13,120,141,225, 15,143,117,147,200,218,176,158,118,242,164,158, 78,241, 42,202,121,105,230, 69, 46, 37,138, 83,229, 96, 54,
+ 39, 96, 53, 11, 27, 48,191,217, 61,150,247, 32, 99,163,184, 11, 53,202,248,178,154, 72,228,131,244,126,105, 66,170,147,211, 72,
+202,218, 17,229, 26, 94, 18, 8, 15, 27, 23,116, 14,187, 34, 6, 89, 17, 67,170, 54,206, 82,238,185,177,160,198, 76,229,153, 13,
+208,110, 74, 4,198,235, 44, 56,149,128, 69,106, 35, 41,155, 33, 8,201, 46, 37,233,173,153, 1,226, 91, 60,203, 41, 39,176,223,
+221,171,219,215,238, 40,178, 42,213,233, 10,163,209,233,181, 8,142, 38,114, 84,251,110,185, 54, 35,209, 31, 13,197, 91,138, 79,
+143,206,150,212, 57,242,124, 38,229, 16, 84, 73,240,213,204, 75, 50,143, 87,173, 84,164, 89, 20,181,168, 46,225,151, 26,159, 71,
+109, 65, 14,184,229,111,223,226,166, 53, 41,224,179,148, 64,114, 79,132, 90,113, 73,200,104,184,146,174,118,146, 79,101,175,201,
+205,219,204,155,102,128,180, 26,125, 18, 28,150, 98,195,105, 10, 14, 85, 92,139, 49, 44, 74,113, 69,160, 66,149, 34, 98, 36, 58,
+ 20, 83,202,178,235,104, 56, 3, 26,125,225,170,120,167,231,215, 85,141,112,211,105, 68, 66,108, 25,200, 98, 1, 35,204, 2,129,
+118, 32,139,221, 73,211,171, 88,164, 60,112,168,124,170,167, 38,200,178,103, 72, 51, 44,237,231,149,166, 81,253,213, 50, 10, 79,
+172, 10, 67, 42,201, 44,175, 42,128,126,168, 90, 67,176, 82, 27, 44,157,124, 91, 86,163,172,210, 40,209, 33, 66,112,182,149, 48,
+228,143, 4,186,243,202,144,134,136, 71, 50, 71, 59,195,196, 43,253, 81,128,121,143, 54, 9,213, 9,123,191, 49,153,245, 55, 35,
+206,109,168,116,233,113, 41,236,173,165,115,203,126,108,150, 24,126, 66, 34,165,149,164, 32, 41,215,163,182,233, 78, 22,166,155,
+ 90,143, 48,108,145,165, 85, 75,154, 37, 70,161, 46,164,219,243,155,165,183, 95,162, 83, 41,204,184,183, 31,120, 38, 3,190, 45,
+101,232,203,231, 40, 76,115, 83, 50,127, 74, 20,164,143,112, 40,242, 9, 31, 98, 92, 79, 79,129, 78,140,203, 11,121,138,245, 72,
+215,101,185, 49,196, 39,158, 19, 18, 21, 36,165,158, 84,115,163,196,105,234,116,116, 44,252, 60,143,172,114,249,234,105,237,243,
+234, 88,226,151,149, 96, 84, 34, 93, 22,215, 29,128, 4, 3,181,141,183,216,168,177,185,166,163,240,166,136, 67, 12,245,145, 53,
+ 84,238, 0,153,166,177, 96,204, 18, 87, 55,144,155,186, 70,146, 43, 45,216,107,212, 1, 59, 91,122,169, 91,167, 70,186,227,184,
+197,203, 10,131, 87,163,189, 10, 69, 85,214,171,148, 90, 69,113,166, 35, 70, 56,136,137, 81,234,204,184,151,100,173,214,164,200,
+104, 6,254, 24,254, 26,193, 30, 33,214,177,238,127, 2, 62,206, 30, 34,208,151,119,167,131, 14, 31,170, 51,171, 76, 70,150,170,
+189, 2,208,133,100, 93, 16,152,156,135, 92, 15,166,232,176, 13, 54, 74,101,165,135, 57,220, 33, 69, 97,249, 39,169,192, 0, 26,
+ 93,210, 95,153, 46,142,195, 48,212,207,240,138, 76,170,188,247,144, 86,212,166, 41,209, 88, 17,109,147,200,217,240, 91,113,230,
+ 10, 86,128,162,166, 98,165, 96, 97,201, 9, 78,178,250, 69, 65,249,177,152,150,228,245, 53, 78,141,239,234,159, 40,211,220,125,
+234,189,102,123,128,204,166,210,121, 79, 70,152, 89, 40,114, 90,121,185, 11, 65,166,199,232,221,121,189,200,179, 42,152, 93, 92,
+ 75,230,181,135,235, 18,204, 69,152,107,221, 75, 2, 72,234, 69,174, 46, 14, 32, 60, 65,225, 38, 67, 80,102,246,156,185, 96,142,
+ 64,186, 65, 26,216, 43, 6, 40, 6,149,221,157,212, 46,150, 93, 69, 68,110,116,131, 41,199, 40, 55,231,232,175,112, 39,186, 52,
+233,149,158, 27,247,143,120, 56,116,174,173,153, 18, 34,210,174, 57,144,247,130,194,102, 74,185,149, 26, 52,200, 23, 10,162, 86,
+ 96,176, 86,182,130,146,213, 93,197,161,183, 1, 8, 39,149, 38, 53, 60,110,123, 1,189,162, 92, 20, 64,171,222, 82,246,226, 47,
+ 16,123, 65, 75, 15, 72,127,116,120,126, 77, 82,239, 20,202,115, 40, 46,174,117,219,183,111, 65, 69,126,215, 97, 8,232,243,169,
+139, 58, 27, 74, 74,185,166,114,142, 99,250, 18,209, 46,181,183,224, 68,113,102, 52,106,107,177, 37,200, 76, 89,105,113,113,218,
+ 56,118, 12, 55,101, 50, 10,230, 23, 86, 85, 37,215,208, 22,167,192, 67, 77,169, 69,206,125,108,205,177,123,137, 81,132,228, 77,
+240,230, 79,154,105,244,170, 68,172, 70,170, 45, 44,243, 23,229,205,128,165,133,198, 42, 67,110, 60,176,176,144,220, 86,155, 75,
+156,175,184, 82, 37,249,111, 22, 85, 64,218, 42, 36, 46,150,235,171, 86,247,176,186,185, 5,172, 47,228,140,198, 46, 44, 72,234,
+121,147,139, 60, 39, 92,176,153,168,117, 68,140,198,218, 71,144, 3, 98,138, 64,212,159,103, 84,140,214, 0, 32, 12, 28,131,124,
+126, 50,105,198, 21,146, 20, 2,150,143,132,228, 7, 26, 81,109,214,212, 65,248, 92, 74,194,146,164,156, 20,169, 37, 42, 0,131,
+165,219,161,234, 58, 18, 58,228,124,254, 71, 95,166,111,180,163,216, 17,194, 7, 31,240,238, 45,193,218,248,212,110, 26,248,173,
+144,137, 82,206,229, 89, 52, 54, 25,176,183, 2,186,219, 40,113, 49,183,135,111,169, 74,106, 53, 73,215,223,228, 75,245,122,111,
+187,214,152, 50, 20,235,206, 84, 2, 61,217,127,158,255, 0, 24,156, 20,241, 33,192,134,239,206,217, 30, 38, 54,238,125,139,118,
+182,211,245, 43,118,166,211,159, 90,217,123,137,109, 53, 37,113,155,187,182,234,235,101,180,177,115, 80,148,226, 64,116, 0,220,
+200, 46,171,221,234, 49, 34, 72, 30, 25,177,178,252,214,159, 48,137, 36,141,135,159,161, 6,234, 78,231, 77,251, 48, 0,221, 90,
+199,202,197,117, 32,214,105,170,234, 26,172,186, 65, 29, 84,101, 65, 54, 87,177, 10,215, 32, 13,141,138,150,236, 14,199,245, 75,
+111,141, 87,232, 7, 78,223, 46,186,240,164,147,156, 28, 3,215, 4,145,249,235,175, 68,129,142,189, 7, 76, 99,191,151,125, 32,
+ 65, 39, 61, 71, 76, 36,140,103,167,252,116,233,141, 78,248,166, 18, 9,199, 92,122,143, 95,234,239,175,161, 36,250,244,200, 30,
+ 93,115,158,191,142,170,121,127,171,248,116,215,196,144, 1,202,147,156,231,167, 92,228,232, 96,111,143,129, 56, 33, 89,201, 25,
+230,243,242,215,164,117, 4,143,135, 25, 61,115,251, 63, 29,125,233,140,254,206,216,252,245,215,209,215,246, 12, 1,220,121,253,
+253, 52, 48, 58,123,176,136,207, 68,245,233,231,142,164,103,246,106,130,219,198, 9,242, 61, 70,124,244, 78, 14, 58,140,121, 2,
+ 70, 49,246,252,191,175, 84,207,110,131, 39,246,103, 63,212,127,167, 88, 6,255, 0, 17,140,224, 37,160,224,249,103,215,184,207,
+168,252,247,208,170, 64, 0,231, 36, 18,123,250,252,190, 90,184, 57,205,158,184, 61, 58,231,190,125, 58,121,245,208,238, 32,242,
+231, 4,117,232, 58,231,175,203,236,214, 65,232,122, 99, 32,158,221, 78, 45,197, 1, 39, 32,245, 29, 49,158,152,199,174,188, 20,
+231, 36, 28,121, 28,159,179,207,240,209, 42, 73,234, 20, 7, 79,245,123,146,126,126, 67,174,168,242, 12, 40,100, 99,166, 0,243,
+235,158,231, 75,169,184,235,131,168, 34,219,109,243,243,111,195, 3, 40, 3,212,147,129,248,125,186,160, 70, 70, 63, 35, 70, 41,
+ 35, 56, 30,153, 63, 44, 13, 12,180,144, 73, 3,167,246,126,206,186, 81, 79,108, 24,216,116, 23,254, 71, 0,184, 0, 32,116,206,
+122,159,217,215, 31,158,154,162,160, 78, 58,100,103,175,175,221,163, 20,147,230, 7,221,216,158,250, 25, 89,201,230, 56, 39,183,
+207,211, 31,119,244,105, 92, 1,208, 95,113,129, 22,128,114, 64,199,200,249,250,140,104,117, 35,166, 6, 1,239,246,103,200,244,
+209,138,206, 65, 56,207,160,242,208,199,169,200,207, 95, 92, 14,221, 63,118,149, 7,160, 39,167,207, 95,158,248, 54, 5, 87, 76,
+228,103, 25,253,159,187, 66,172,116,206, 15, 78,216,253,164,244,237,211, 70,172,100,142,152,235,220, 30,253,124,255, 0, 62,122,
+ 25,196,228,156,100, 1,208,227,182, 79,228,104,248, 50,250, 91,127, 92, 91,215,128,112, 14, 73, 39,167,161, 29,123,232,115,223,
+168,235,158,191,184,104,199, 19,144, 83,211, 62,126,189, 61, 63, 13, 12, 80, 70, 78,114,125, 15,225,223, 58, 89,122, 97, 81,107,
+ 3,210,216, 29,105,243, 25,206,133, 90, 72, 39,183,153,251, 62,223,150,116,105, 25,251,186,250,103,228,126, 90, 25,105,206, 73,
+200, 62,126,125, 59,253,250, 85, 79, 91,157,176, 69,216,144,119,183,250, 96, 34, 48,113,165,175,107, 73, 39, 35,175,224, 52,180,
+174, 15,113,220,216,227,234, 49,143,233,209, 40, 24, 3,231,215,243,247,106,128,198, 6, 1, 31, 35,223, 85,211,204, 59,128, 49,
+233,223, 61, 58,233, 18,118, 3,231,221,140,226,178, 60,250,253,223,191, 85,209,220,253,157,189,127, 63,191, 84, 81,143, 33,215,
+204,234,178, 6,122,231,177,237,249,242,254,173, 16,157,137,190, 6, 8, 78,112,112, 70, 7,124,143,196,244,243,233,162, 27,234,
+126,239,234,213, 4,125,189,188,191,126,189, 18, 64, 86, 14, 8, 30,125, 1,207,244,255, 0,102,181,216,133,193, 78,224,142,199,
+ 7, 54,115,211, 61, 62,206,158,126, 99, 69,164, 14,128, 16,123, 15,151,236,213,189,146,233, 74, 78, 19,142,153,251,112, 63,171,
+ 71, 55,223,162,122,140, 28,224,246,249,233, 34,215,194, 71,174, 43,165, 61, 65, 57,232,123, 99,191,167,237,209, 9, 0,142,169,
+249,103, 39,175,175,217,170, 64, 18, 71,145,233,231,230,123,231,229,170,232,200, 36,116, 29,135,203,168,243, 62,103,182,176, 73,
+ 61,123, 96,167, 21,209,156, 1,208, 14,195,241,243,249,104,148, 3,216,156,228,224,103,250,117, 65,160, 72, 29, 58, 3,231,163,
+ 16, 58,231,175,203,211,211, 73,191,175,207,108, 99,107,145,181,206, 58,159,236,114,180, 36,215,120,223,178,238,166, 92,121,134,
+ 54,178,207,191,175,249, 50,154, 42, 65,101,248,212, 39,104, 52,196,151, 17,213,181, 46,101, 96,132,144, 65,248, 62,103, 82,170,
+147,119, 79,171, 52, 99,214, 12, 27,130, 56,200, 92, 43,154,147, 73,175,197,113, 32,149, 96,181, 85,136,238, 83,215,166,114, 61,
+117, 30,111, 98, 93, 13, 12,206,226,110,249, 80, 74, 93,129,102,217,118,147, 11, 61, 22,147, 89,172,205,170, 73, 66, 84, 58,128,
+180, 66,104, 17,242,215,110, 85, 89, 62, 34, 74, 78, 18,162, 18,178, 78, 2, 72, 24,243,252, 53,207,158, 33,214, 52,188, 67, 60,
+ 91,218,146, 56,163, 6,254,160, 73,191,190,242, 16, 55,233,143, 67,190,140,252, 57, 24,240,222, 10,185, 97, 89, 6,113, 87, 87,
+ 57, 12, 1, 4, 44,130,152, 2, 8,181,138,211,143,223,140, 91,113,184, 80,224,223,122, 90,127,248,197,225,195,111,141, 78, 74,
+ 74, 28,185,236, 6,100,109,189,210,202,149,255, 0,194, 25,155,109, 45,182, 30,116, 14,184,114, 58,193, 35, 36, 29,114,235,126,
+ 61,136,232,153, 30,101,195,194, 78,234, 11,142, 74, 18,167, 81,180, 59,192,184, 84, 27,145,224,126, 38,225,219, 27,129, 13, 41,
+129, 85,124,254,171,109, 79,106, 42,220, 56, 5,240, 78, 79, 93,141,126, 51,110,161,151, 93, 72, 82,213,250, 21,147,128,162,159,
+242,172,156,116, 75,192, 96,143,245,128,214,109,101, 34,179,125, 87, 98,219,150,188, 73,117, 58,171,235, 8, 75,113, 88,113,228,
+190,130,160,148, 6,130, 7,194,176,163,212,158,137, 41,207,108,226, 37, 67,197, 89,254, 85, 44,107, 65, 92,242,128,109,202,127,
+172,140,251,130, 53,244,131,234,154, 77,174, 21,133,241,105,113, 79,128,254, 26,113,109, 13, 76,249,182, 65, 22, 83, 80, 16,177,
+174,164, 11, 73, 52,123,127,120,210, 70,162, 57,108,123, 78,146,165,250,169,223, 16,133,191,246,226,251,218,171,186,173, 97,110,
+ 77,165,112,216,183,165, 5,229, 49, 86,182,110,106,115,212,202,172, 69, 5, 40, 7, 80,219,163,150,100, 37,129,150,164, 48,167,
+ 88,117, 63, 19,110, 40, 29, 97,233,193,243, 24, 29,250,143,184,116,215,232,143,190, 62,204, 45,147,226, 95,110, 34,219, 28, 90,
+ 85,225, 64,173,211, 34, 4,217, 87, 45, 7,192,123,116,108, 57, 14, 35,197, 13,193,172,182,131,239, 52,194,172,248,180,249,101,
+232,171,201,194, 80,172, 40,106, 85,157,236, 48,246, 94, 89, 49, 96, 11,150,111, 16, 59,185, 80, 43, 83, 18, 93,168,222, 84,251,
+ 54,159, 41,214,155,241, 92, 81,129, 64,166,133,196, 36,117, 74, 67,170,207,108,116,206,173,202, 63, 17, 40,214,142, 55,205,233,
+ 13, 21,112,217,227, 87,141,135,185,128, 46, 29, 67,117,210,202, 74,244,212,246,213,142, 20,207,126,143,124, 95, 14,119, 61, 31,
+ 6,200, 56,195, 36, 55,104,107, 68,114, 83, 2, 59,199, 46,168,204, 70, 69,177,250,200,100,120,157,124,223, 84, 73,137, 96,225,
+130, 70,121, 22, 8,237,202,133, 96,250, 28,227, 72,168, 32, 0, 58,146,113,140, 31, 63,151,222, 53, 61,230,125,146,190,201, 76,
+ 62,208,225,254,252, 87,128,217,112,248,251,193,118,173,197, 4, 39,152,242,173, 11, 29,115,211, 32,117,193,211, 69,186, 94,193,
+159,103, 5,247, 75, 55, 6,222,220,187,247,177,170,142,168,178, 84,212, 27,150,141,124,210, 39, 70, 74,144,228,182,226,199,187,
+233,222, 60, 23, 11, 1,196, 7, 82,242,195,107,113, 42,240,151,142, 83,177, 77,226, 46, 75, 83, 47, 41, 81,193,177, 55,242,216,
+ 0, 46, 73,185, 22,183,223,238,190, 25,235,190,143,254, 42,229,177,123, 69, 87, 14,170,171, 21, 80, 22,161, 11, 51, 57, 1, 84,
+ 2,160, 93,137, 3,114, 63,142, 35, 1,192, 79,179,155,127,248,252,190,165,208,246,210,151, 26,220,219,219, 90, 68, 49,185,187,
+209,119,179, 45,157,189,219,184,210,112,227,112,228, 57, 29, 33,219,162,244,145, 27,153, 80, 40, 80, 57,165, 61,128,236,151, 33,
+196, 10,146, 38,173,194, 71, 5, 92, 32,251, 61,109,198,127,137, 11, 71,248,111,187,134, 47,186, 92,156, 68, 95,208,233,213, 77,
+203,169,188,166,210,220,230, 45,176,210, 20,198,221, 91, 60,222, 42,147, 78,163,161, 14,132, 16,169, 50,102, 40, 41,100,251, 2,
+ 70,221,108,222,222,208,118, 35,135,219, 98,141,182,187, 99,183, 80,221, 22,253,169, 5,240, 28,175,120,202,109,117, 43,158,224,
+172,168, 42, 69,193,113,212,166, 35,154,109, 86, 73,117,239,122, 88, 75,220,172, 22,219, 70, 15, 39,112, 35,202,153, 34,108, 9,
+ 83, 16,228,242,167, 30,167,205, 67,209,101, 60,247, 40, 75,203,132,133,184, 16,103,115, 6,213,204,193,117,183,249,130, 73, 35,
+ 5, 53, 87, 20,120,131, 91,154, 84, 73, 73, 68,198,158,137, 73, 10, 65,221,198,214,239,181,250,134,185,234, 8, 61,113,217, 30,
+ 12,253, 20, 41, 50,184,169,243,158, 45,133,115, 76,244, 44,114,114,236, 90, 10,109,118,101, 69, 7,109, 69,110, 68,166,247, 32,
+244, 91, 5,122, 46, 93,207,151,112,185, 82, 84,201,237, 85,196,152,174,184, 88,241, 23,239,197, 8,146,129,239,112,210,195,217,
+143, 82, 97,220,134,151,240, 7,148,160,230, 82, 64, 42,108, 46, 11,170, 52,200,142, 42,108,229, 75,154, 25, 10,128,251,176,220,
+ 69, 62,231,164,248,160, 73,129, 34, 43, 32,148, 79,109,191, 21,101,149, 97,198,164, 54, 36, 52,149, 5,184, 19, 97,136,251,117,
+212, 9,207, 47,222, 75, 83,204, 70,166,198,109, 84,203,178,149, 49, 96, 25, 28,237,178,132,166, 28, 66,181,167, 45,188,144, 84,
+217, 47, 45,181,163,161,199,231,178,168,238, 61, 67,174,165, 50, 30, 68,210,138,101, 69, 41, 66,226,214, 24,154,175, 18, 68, 23,
+ 25,200, 16, 43,237, 53,206, 89, 40, 41,101,229, 18,227, 11, 67,153,107, 85,228,149, 94,103,214, 88,177,181,218,251, 49,190,198,
+219, 19,126,194,199,107,117, 59, 14,220,202, 56,115, 41,161,100,166,134, 46, 65,164,220,199, 24, 80,202, 6,149, 99, 29,208, 93,
+ 86,200,179, 38,148,109, 12,205,160, 36,107, 36, 87,151,170,161,165, 46,223,113,167,151, 78,170, 42, 43,148,218,139,143,133, 60,
+212,244, 50,100,136,203,150,242,135,136,250, 60, 22,164,198,112,144,183, 19, 29, 76, 58,165, 45, 0,185,112,131, 94,118, 83,239,
+ 68, 41,110,145, 84,110, 85, 61, 77, 75,109,178, 94,166,215,169,104, 8, 67,209,226,188, 8,118, 28,136,175, 69,146,129,147,227,
+180,167,144,130,160, 73, 24,237, 74,148, 41,180,184,241,225,200,118,224,181,231, 71,136, 98, 84,161,159, 30,183,110, 75,101,207,
+122,101,135, 67,139, 34,171, 78, 67,173,161, 72,116, 98, 92, 85,128,204,132, 60,193,241, 18, 44,199,101, 84, 85,252, 43,112,177,
+ 42, 84, 4, 52, 95, 52,245, 4,179, 84,167,160, 46, 60,163,202, 84, 82,137,173,158,119, 35, 43, 36, 50,180, 41,160, 2, 22, 0,
+ 48,114,196,178,177, 80, 55,211,178,238, 64,223,114,118,234, 70,226,196,234,190,160,112,250, 40,232,234, 98, 13, 29,180, 72, 74,
+135, 58,129, 51,142, 88, 77,113,191,149, 76,133, 66, 76,142, 54, 49,137, 46,240,201,115,180,187,121,113,159,112,167, 74,168,126,
+134,164, 39, 75, 21,246,192, 76,150, 24,152,101, 59, 6,160, 22,251,164, 23, 22, 86, 34,169, 37, 64, 41, 77,186,215,114,156,150,
+ 43,139, 43, 97,169, 85,218,101,105,162, 25, 69,219,106, 92, 52,234,159, 51,106,114, 59,213,187, 98, 11,114, 96,186,162,129,133,
+ 58,105, 47, 71, 91,228,165, 74,112,210, 83,241, 18,146, 11,135,106,214, 98, 78,172, 73,102, 43,177,164, 67,184,105,116,249, 76,
+184,164, 4, 42, 59,240, 23,245, 98,155,113,151,208, 49, 37,216,174, 66, 88, 82,250, 45,200,200,202,137, 72, 26,161,196, 82,249,
+ 44,237,191,114,123, 77,202,228,191, 13, 50,108,176,183, 27, 75,109,213, 41, 83,161, 73, 7, 42, 42, 37,230,219,111,224, 71, 41,
+ 82,129, 72, 56, 26, 82,178,211, 80,176, 96,117, 33, 87, 27,130, 65, 15,123,139,250, 43, 17,247,133,176, 59,154,251, 35,230,229,
+ 30, 34,101,181, 84,209,154,121,115, 5,168,137,162, 38,222, 89,169,228,145, 35,177, 23,211, 13, 74, 42,128,222, 98,209, 33, 93,
+247, 45,207, 13,114,155,103,122, 54,250,161, 33,214, 94,250,215,234,202,139,111,115, 54,235, 9,117,115, 33, 84, 25,247,117,161,
+ 36,186, 75,171,142,226, 92, 32,132,169, 8,234, 2,250,244,178,232,151, 46, 85, 85, 97, 46,180,218,152,141, 41,185, 10, 82,146,
+133, 56, 87, 49,135, 28, 75,206, 54,128, 82,149,182,149,114,148,252, 73, 40, 42, 25, 63,173,202,173,165,149,245, 27, 59,105, 37,
+133,198,106, 75, 46,199, 11,153,201,226, 56,179, 68,204,101, 51,206,133, 4,148,184,138,122, 64,229,229,233,145,221, 56, 61, 81,
+185, 75, 51, 27,159, 80,109, 41,125,186,148, 24,239, 53, 37,180,135, 92,106, 52,136,171,113, 78,165, 68,140, 37, 16,223, 89, 4,
+156,167,195, 25, 30,171,240,236,165,105,234,169,128, 26,161,150,226,251, 18, 25,116,220,216,131,250,167,125,192, 39,222,113, 12,
+241,161, 4,252, 89,144,102,166, 63, 45, 69, 19,211,173,192, 32, 52, 53, 5, 73,183,217, 0,172,167, 96,196,253, 93,251,227, 89,
+170,116,137,115, 41,150,180, 88,239, 52,228,155,128,190,219,171,105, 45,132, 20, 84,125,242,101,110, 97,109,192, 60, 15, 6, 4,
+169, 41, 7,205,101, 42, 4, 30,100,235, 48, 98,100,183,170,109, 55, 77,129, 26, 53, 90, 77, 38,159, 64,165, 69,109,165, 59, 30,
+ 52,118, 31, 90,205,199, 80, 1,144, 68, 88,139, 74, 3, 44,182, 0,117, 80,218,100,243, 23, 20, 81,245,170, 20,128,229,191, 57,
+231, 18,227,180,170, 21, 94, 83,170,231,105, 13,211, 41, 41,129, 19,194, 45,180, 74, 72,152,162,162,165,171, 24, 90,155, 91,121,
+ 64, 1, 10,190, 89,208,106, 49,147, 38,123,140,190, 42,215, 59,205, 63, 4, 41, 77, 7,232,116,248, 77, 39,221, 90,229, 3, 45,
+ 60,220, 25, 11,121, 77,164,169,180,203,154, 2,178,180,171, 50, 56, 55,242,106, 47,163,123,251,137,182,215, 39,127,128, 23, 32,
+147,183, 70, 90,252,198, 22,163,102,103,142,115, 15, 52,168, 39, 72, 47, 37, 68,133,131, 88,139,196,145, 68,178, 49, 42, 54, 4,
+ 38,158,106, 17,126,147, 14,157, 74,146,213, 34,214,106,160, 3,145, 23, 72, 93, 65,214,154,147, 60, 45,214,208,171,150,181,227,
+ 40,145, 58,176,135, 20, 0, 88, 40, 71,191, 85, 50,133, 16,199, 40,204,233,149,217, 16, 81, 74,106,213,167,196, 41,166, 68, 93,
+ 61,218,202,202,222,163, 83, 36,180,202,163, 63,224, 83, 73, 82,235, 51,209, 30, 63, 41, 12,169, 45,248,223, 4,213,169, 74, 90,
+ 53,128,211,101, 42, 82,164, 55,109,135, 89,147, 41, 74,163,196,152,181, 2,229, 14,132,196,169,105,114, 84,194,235, 37, 15,213,
+165,203, 74,222,142,144, 8, 75,184,116,146, 25,235,123, 77,126, 53, 26,159, 50,222,163, 82, 34, 87,170,209, 34,199,165,211, 98,
+196,145, 42, 52, 27, 97,182,148, 76,169,143,206,119,244, 45, 5, 21,254,145, 74, 46, 58,167, 16,167, 2, 71, 51,139,214,220,104,
+ 21,172, 65, 37,238, 69,201, 58,119, 82, 55, 23, 34,254, 81,127, 40,177, 82, 54, 23, 48,154,250, 57, 42, 21,105,164,129,171,170,
+ 20,141, 98, 87, 0,144,254, 73, 38,170, 44,234,129, 19, 88,176,146, 78, 89, 34,103,179,171,162, 77,157, 81,164,143,123,163, 8,
+ 73,114, 60, 56, 14, 56, 25,153, 92, 82, 27, 64,113,230,129,159,116,212,234,141,165, 30, 35,232,150,149, 34, 26,138, 67, 35,195,
+229,195, 64,160,161,215,163,214,229, 61,114,193,118, 3, 18,169,144,234,116,244, 83,105,213, 73,128, 42,170,162,244,180, 53, 84,
+173, 73,139, 52,114,195,114, 72, 17,209, 13, 46,130, 91, 66,252, 80,144,164,132,233,150,102,139, 89,170,162, 58, 42, 11,109, 2,
+156,194, 86,221, 33,181,251,181, 38, 42,218, 67, 77,174, 97,127,153, 78,214, 92, 14, 2,191, 29,239, 13,182, 62, 55, 80,210, 57,
+121,206,113, 74,153, 54,127,189, 8,203, 67,140,225,184,143, 85,220,123,222,211, 87,121,197,162, 59, 80,232,138, 96,225,196, 37,
+231, 93,231,158,158,124,173,226,166, 18,183, 1,113, 59,104,206, 7,217,212,166,214, 54, 39,125,193,177,184,189,190,201, 2,219,
+129,115,109, 36, 64,115,202, 58,106,133,145,131,199, 51,172,111, 27,220,150, 84, 18, 57, 32,181,236, 38,119,102,187, 2,172,173,
+245,138,161,227,115, 42,109, 53,183, 89,113,151,211, 75,165,167, 49, 32,171,220, 30, 90, 20,243,205, 83,164, 33,100, 75, 87,189,
+190,190,121, 21, 18,250, 71, 48, 94, 91,105, 75, 43,121, 74,230,229, 45,103, 23,124, 32,112,213,237, 11,217, 74,166,193,241, 37,
+103,179,117, 80, 93,247,138,133,163,115, 83, 94, 17,183, 11,108, 46,100,165,216,113, 47, 43, 30,236, 12, 41,116, 27,141,183,211,
+202, 18,144,184,181, 22,208, 98,204,139, 46, 18,220,104,135, 30,225, 76, 56, 81,105,212,133, 48, 41,180,229, 70,162,206,126, 38,
+ 92, 98,148,206, 66,164,193,166,164, 45,105,171,200, 68,140,120,203, 37, 97, 47, 60,174,114,244,144, 80, 29,171, 42,165, 30,155,
+ 49, 51, 37,181, 81, 79,132, 15,185,196,151,151,234,114, 30, 44,248, 41,113,104, 4,248,238,184,148,190,180,184, 74,188, 52,182,
+ 16,234,154, 81, 58,124,203,115, 9,169, 39, 2, 57, 12,104,246, 82,172, 26,204,163, 72, 34,253, 44, 52, 92, 91,236,149, 12,133,
+109,183, 62,241,103, 9, 69, 81, 77, 83, 52,208,150, 44, 27, 66,145,121, 36, 63,181, 37,206,204,250,129, 61,116,169,212, 89,131,
+ 43,201,249,104,123, 74,253,155,155,225,236,203,226, 10,102,204,110,202, 63,132, 86,125,198,138,149,127,100,183,134,155, 1,112,
+237,173,219,177,225,202, 67, 75,152,211, 60,203, 77, 6,247,167,123,204, 54,107,180, 85,184,167, 33, 62,251,114, 35,170, 69, 54,
+ 84, 73, 46,115,200, 36,167, 25,234, 60,137, 61, 71,217,242,198,191, 92,191,104, 95, 2, 27, 99,237, 47,225, 82,247,225,235,116,
+208,197, 6,191, 47, 55, 54,209,110, 43, 17, 27,149, 84,218, 45,211,165,197,120, 90,215,101, 56,171, 11,149, 13, 70, 66,225,214,
+ 96,115,165, 21, 26, 85, 74, 92, 66,166,214,227, 79, 55,249, 64,239, 46,206,238, 55, 15,155,187,185,155, 17,187,212, 5, 91, 27,
+163,180, 55,157,106,194,190,104,165,101,216,241,171,116, 57, 30, 18,166,211, 37, 16, 5, 70,131, 54, 18,226, 79,167, 74, 70, 81,
+ 42, 5, 78, 52,132, 18, 28, 26,183,178,186,229,171,129, 84, 73,169,212,119, 35, 85,129, 0,134,181,188,202, 72, 5,128,210,110,
+164,121,139, 34,115,126, 99,150,201,150, 78,208,177,215, 21,236,173,125, 91,218,250, 75,126,181,187, 55,113,190,246, 44, 91, 95,
+135,148,129,156,147,147,205,212, 31,144,244, 3, 58,243,202,158,132, 96,121,118,234, 51,223,167,152,213, 84,132,144, 83,212,144,
+122,231,250, 71, 93,121,229, 7,168,206, 61, 58,103,231,212,233,216,126,242, 48,223,133,202,123,243, 12,118,207,203,183,111, 61,
+ 32, 14,126, 17,140, 14,161, 90,245,202, 0,199,235, 2,114, 60,191,110,190, 5, 15,139, 57,201, 32,114,253,216,239,161,239,192,
+233,108,123, 39,162,135, 78,189, 62,195,246,249,106,136, 10, 78,112, 73, 80, 61,113,230, 62, 64,254,122,234,166, 18, 83,202,122,
+103,184,207, 81,130, 49,223,236,215,174, 80, 6, 9,201,199, 47,111, 46,189, 71,203, 89,192, 63, 27, 96, 53, 1,149, 31, 49,140,
+143,183,211, 84, 10,122,103,152,159, 49,204,115,211,229,233,253,186, 57,109,140, 0, 0, 42, 35,161, 61,188,137,207,221,161, 86,
+ 58,145,216,118,198, 58,231, 30, 93,116, 48, 63,158, 1,112, 96,228,246, 63,119,203, 84, 21,220, 28,101, 35,160,235,242,245, 31,
+102,138, 90, 22,121, 72,232, 51,231,247,231,247,104,117, 39, 61, 58, 2, 59, 96,249,104,234, 64,191,160,198, 65, 55,247,255, 0,
+ 60, 14,160, 50, 60,137, 24,206, 58,103,203, 61, 58,234,146,135,124,156,121, 99,160, 31, 51,219,236,252,116, 73,206, 49,128, 51,
+231,231,251,123,106,130,209,216,142,152, 32,159, 63,195, 75, 14,184, 84, 94,215, 29, 79,250, 96, 55, 19,215, 9, 7,190, 79,166,
+113,212,157, 10,180,231,174, 51,219, 30,163,230, 61,124,245,112, 94, 8, 35, 56,199,150, 58,254, 63, 97,208,174, 36,246, 79, 78,
+132,250,231,203,175,160,237,165,148,155, 11,141,240, 1, 23,176,233,128,148,158,253,122,158,192,247,206,126,126, 93,116, 42,219,
+ 61,126, 33,142,248, 29,128,238, 64,251,180, 98,130, 72,235,144,115,140, 99, 39,215, 61,190, 90, 29,105, 56, 32,252,142,124,190,
+223,195, 58, 58,223,238,254, 95, 39, 6,192,106, 72, 24,199,207,169,245, 30, 90,160,176, 6, 79, 92,227,183,145,249,118,249,104,
+165,167, 61,148, 78, 62, 93,254,239, 93, 12,179,220, 30,157, 60,198,115,242,249,127,110,150,193,148,246,192, 42, 80,207, 64,115,
+230, 7, 95,188,250,119,213, 21, 12,100, 99, 63,179,231,162,150,129,220, 12,103, 57, 35,191,246,104,101, 2, 7, 81,158,249, 35,
+174,127,183, 74, 39,124, 40,187,129,129,212, 62, 68,122,250,125,199, 84, 23,140,143, 92,117,213,117, 19,215,184, 4,231,175, 66,
+ 79,245,106,130,251,142,158, 93,255, 0,118,149, 29,122, 95, 24, 34,198,227,107,126,239,159,158,216, 20,140, 18, 59,227, 75, 95,
+ 85,250,199, 75, 75, 13,192, 56, 53,129,222,221,113,224, 31, 34, 70,125, 6,170,115,117, 4, 36,146,112,146, 71,252, 62, 67, 84,
+ 57, 57,156, 74,190, 46,131,167,126,189, 72,198, 14,138, 73, 72, 0,249,103,174,123,247,243,198,181,201, 39,189,191, 44, 27,238,
+190, 43,164,129,129,211, 63,236,245,233,243, 58, 32, 97, 35, 36,140, 31, 65,231,246,249,232,100,242,133, 16, 14, 78, 58,158,157,
+ 7,144, 58, 37, 4, 36, 28,167,155, 7,168,239,223,182,147, 44,119, 29,113,140, 86, 9, 88, 80, 33, 67,148,142,189, 58,147,229,
+223,183,125, 16, 27, 14, 36, 37, 73,206, 14, 71,113,233,215, 84,146,114, 59, 96,121,126,113,162,219, 33, 61, 20,122,227,203, 61,
+135,228,105, 51,107,111,211, 4, 38,221, 6,253,190,126, 24,172,132,132,167, 25,192, 31, 46,167,238,209,141,168,114,132,252,186,
+ 31, 95,234, 58, 17, 41, 24, 32,168,146,115,128, 59,159,179,174,138,108, 18,115,203,216, 12,131,215, 0,103,174,144,194, 71,174,
+ 42,227,160,207, 92,117,206, 62,223, 33,242,209, 40,194,176, 79, 64,124,186,245, 61,190,239,236,213, 16, 1, 81, 29, 64,242,237,
+249,245,209, 45,130, 6, 1,237,228,113,147,251, 59,104, 99, 7,241,193, 13,224,100, 14,158,159,183, 68, 33,125,121,112,122,103,
+ 36,117, 25,207,111,219,170, 8,237,156, 12,250,116,207,217,159, 61,101, 86,165,169,113,222,213,218, 85,175,104,208,234,151, 29,
+199, 92,154,205, 58,143, 67,162, 64,145, 83,170,213,103, 62,174, 86,162,193,129, 17,181, 57, 37,226, 79, 92, 12, 36, 30,101, 16,
+144, 78,144,150, 68,141, 93,157,130, 34,110, 73, 54, 0, 1,212,158,192, 96, 14,194,219,159, 78,228,237, 97,234, 73,216,119, 56,
+239, 95,177,184, 52,198,205,241, 34,250, 82,145, 37,219,203,111,154,116,243, 97, 74,140,138, 52,229,161, 36,121, 36, 56,165, 99,
+ 62,127,102,186,125, 58,178,168,165,224,240,108,180,227,106, 45,243,168,133, 3,219,224, 41,253, 99,156, 28,124,181,130,123, 43,
+ 61,153,123,231,176,246, 46,230, 76,226, 66, 69, 19,109, 99,238,172,123,102, 85,189,105, 61, 82,102,161,115, 83, 77, 53, 47, 41,
+114,110, 56,241, 22, 91,166,201, 83, 79, 37, 41, 96, 41, 78, 35, 7,156,131,211, 91,183,187, 60, 21, 87,216,164,202,171,216, 55,
+ 44, 43,172,211, 80,185, 34,157, 13,254, 73,133,108,167,153, 73,110, 58,212,124, 76,167,200,119,206,185,175,140,211,219,115,250,
+250,186,121,150,106, 87, 41,102, 86, 4,217, 99, 69, 62, 95,180, 64, 96, 69,237, 98, 6,161,177, 7, 30,160,125, 30, 51, 92,167,
+ 42,240,231,133, 50, 92,240,205,148,102, 10, 42, 3,172,240, 74,138,188,202,201,222, 50,206,202, 2,106, 70, 70,243, 90,193,183,
+223, 26, 33, 89,187, 38, 56,211,173, 73, 82, 68,134, 29,100, 33,180, 43,195,241,146,165,129, 30,115, 42, 79, 82,234, 84, 82, 20,
+ 61, 53,220,158, 22,104,113,246,115, 98,169, 87, 66,163,180,230,226,223, 48,159,157,245,162,217,109,215,233, 84,130, 15,134,212,
+ 53,167, 42, 99,197, 78, 84,181,167,226,199, 98, 53, 30, 10,163,245, 54,234,111,196,144,202,209, 82,166, 75, 80,109,137, 72, 83,
+ 78, 49, 38, 59,153,147, 79,146,210,250,165,126, 35,100, 96,227, 24,215,127,118,138,242,164,110, 62,192,109,157,106,149, 47, 30,
+229, 76, 54,197, 89, 17,150, 68,186,101, 86, 23, 51,106, 97,104, 7, 45,130, 23,217, 88,202,117, 28,118, 20, 81, 23,136,105,153,
+198,204, 58,139,149,189,143,111, 45,236, 65,254, 3, 29, 5,199,185,104,158, 14, 29,203,164, 80,217,101, 77, 86,170,133, 93,209,
+180,199,170, 20, 96, 14,241,187, 6, 37,127, 93,148, 45,136,181,242,106,229,223, 42,176, 31,122, 91,235, 11,114, 43,173, 63, 43,
+152,169,199,159,143,135,153, 45,243, 30,101,243,182,162,159,187,215, 88,194,171,109, 42, 52, 22,155,105,229, 73,168, 62, 22,203,
+206, 5, 45,198,219, 49,203, 37, 62, 31, 54,124, 70,223, 9,248,135, 92, 47,174,172,242, 97, 74,133, 54,150,235,136, 92,152,237,
+ 58,252, 89, 13, 45, 92,139, 46, 50,219,136, 74, 20, 9,248, 28, 41, 32,143, 62,190,122,188, 83, 18,164, 54,242,101, 71, 65,114,
+ 44, 22,132, 53, 40,114,187, 30, 75,239, 23, 82, 65, 72,234,224, 65, 70,125,121,117, 30, 87, 45,172,129,168,158,155,237,126,135,
+115,211,189,187,236, 62, 56,127,142,130,130,138,154, 49, 79, 24,120,134,234,170,193,123,180, 96, 91,169, 10, 66, 18, 15,151, 77,
+128, 4,226,231, 71,140,106,110,203,144, 95, 44, 50,131, 42, 92,249, 46, 56,161,202,196, 32,136,201,141, 24, 96, 36,190,183,201,
+194, 51,149, 21, 28,117,214,187,111,102,251,181, 33,243,106, 81,228, 61, 14, 37, 33, 97,130,251, 50, 21, 30, 63, 51,105,194,152,
+ 98,106,148, 82, 95, 81,200, 60,195,245,138,142, 20, 14, 19,125,222, 75,250, 78,218,216,238,219,180,169,142, 42,187, 85,231,169,
+204, 91,107,109, 14,183, 50,106, 86,182, 24,105,167,112,133,173,168,202, 43, 80,230, 79,199, 45, 56, 33, 67, 58,228,228,187,229,
+250,132,217, 47, 75, 67,178, 96, 58,242, 83, 61,164, 56,226,208,226,208,181,175,198,125, 46,167,157, 35,226,117, 68, 43,152, 40,
+ 32, 32, 40,140,101,246, 58, 73, 18,147,146,135, 76,211,128,242,145,107,170,177,186,198, 9,237,250,205,184,185,216,218,219,233,
+112,238, 72, 56,183, 63,169,204,229, 28,252,143,135,165, 49, 82, 40, 35,235,170, 18,203, 36,204,173, 96,202,132, 24, 98, 13,183,
+146, 66,118, 56,218,122,181,245, 81,114,145, 37,110, 60,103,198, 97,207,125,165, 84, 31, 79,131, 90,163,190,219, 97, 10,108, 48,
+ 26, 9,169, 66, 90, 80,227, 47,128, 80,181, 33,204,169, 42, 79, 34,145,144, 27,238, 36,202, 77, 46, 61, 71,146,158, 91, 77, 34,
+ 80,129, 80,121,196,192,149, 37,107, 67,234,250,134,230,105, 96,211,223,104,169, 92,205,169, 77, 58,128, 83,145,140, 41, 90,141,
+ 75,174,173, 77,251,204, 9, 44,170,156,220,176,219,244,224,164,200,165, 79,117,183, 20,184,138, 75,160,173,218,100,118, 89, 33,
+ 75, 40,230, 73, 95, 94, 82, 7, 38,179,218,117,105, 35,154,151, 61,164,211, 34, 50,180, 74,121,186,147,237,205,163, 21, 60,162,
+ 29,110, 35,204,164, 37,216,238, 48,180,134,146,248, 5,180,189,243,232,211, 62, 92,169,112,162,228, 27,221,109,123,121,123, 16,
+109,110,225, 46, 44,215,186, 62,199,161,242,220,190,156, 36,113,114, 47,203,109,107,162,234,192,145,231, 26, 47,177,110,190, 75,
+ 27, 13, 65,145,137, 24,220,138, 82,100, 86,167, 67, 85, 85, 5,217, 21, 54, 83, 26,153, 91,143, 41, 84,218,173, 77,175, 19,157,
+ 16,100, 78,167,184,142,105,169, 96,169, 46,243, 41,104,121,178, 22,223, 34,202,155, 23,250,140,137, 20,138,148,138,125, 82, 20,
+234,253, 56, 69,122, 35,244,247, 86,135, 43,244,199,152,112, 33,197, 60,228, 96,159,173,226,132, 50, 84,121,113, 53,165,176,135,
+ 82,167, 71,194, 53,242, 20, 11,121, 84,166, 35,198,155, 38, 4, 37,169, 19, 41,142,209, 42, 19,225,165,233, 62, 34, 25,142,226,
+ 80, 30,113, 17,157, 66,149,252,196,164, 18,216, 82, 84,115,167, 38,148,205,126,152,227, 49, 97,220, 38,171, 81, 86, 91, 68, 26,
+187, 13,248, 14, 69, 97, 62, 35,143,138,156,112, 22,101, 41, 15, 18, 22,226, 10,194,136,230,230,233,134,127, 42, 6, 37,206,199,
+117,101, 43,181,186,143,180, 75, 2,110, 73, 96, 5,128,176, 42, 44,157, 77, 28, 1,181, 71, 86,166, 56,195,160,133,227,150, 34,
+ 10, 48, 60,200,165, 70,147,146,168,163,204, 71, 45, 85,148, 2,193, 25,163,195,167,111,214, 86,203,172,196,137, 45,186,155,174,
+161, 10,167, 73,203, 62,227, 94,136,211,232, 33,202,160, 82,127,192,238, 54, 24, 88, 10,120, 37, 1,208,149, 43,151,151,153,182,
+170,166, 34,105,117, 25,181, 40,161, 79,194,159, 53, 78,221,148, 2,130,244,202, 62, 11,173,203,168,196,140,210,177,239,188,139,
+ 79,188, 52,148,143, 25, 25,113,159,210,140,171, 8,167, 26, 85, 94, 65,131, 35,235, 11,102,226,130, 87, 49,132, 48,166, 27,155,
+ 34,167, 24, 20, 49, 81,133, 37, 81,151, 26,170, 90,112, 31, 21,124,188,252,170, 13,201, 72, 73,201,204,105,149, 74,157, 57,200,
+147,110, 38,154,139, 18, 67,205,195,153,115, 70,104, 51, 79,155, 83, 70, 23, 21, 85, 85, 0,161, 70,146,242,249, 2, 78, 76,126,
+101,128,219,173,128,148,235, 34, 80,196, 0,231, 83, 92, 1,220, 90,204, 10,145,112, 0,185, 42, 1, 2,236,108, 45, 99,136,197,
+109, 57,134, 90,147, 78, 60,243,173,165,136,149, 15, 48,189,215,148, 86,241,202,190, 93, 81,152,134,165,148, 13, 11,202,242, 35,
+169,110,248,110,177, 16, 67, 42,158,104,128,170, 20,215, 22,194,141,110,142,176,131, 25,131,225, 54, 11,133, 84,196,180, 99,164,
+ 18, 82,252, 36, 58, 2, 73, 90,181,243,137,137,169, 94,219, 91, 8,140,165,159, 30,241,143, 84, 66,139,156,202,240, 96,192, 62,
+ 18,156, 82,206,124, 78, 89,140,129,203,241, 21, 30, 76, 19,163,109,106, 99,148,203,129,215,161, 22,149, 70,170, 36, 45,108,171,
+ 31,224, 53, 5,243, 58,217,101,215, 79,193, 25, 79,185, 33, 32, 39, 1,165,190, 66, 50,135, 15, 45,187,123,227, 46,167, 87,178,
+ 45,198, 26,115,194,143, 66,171,214,144, 26, 91,156,200,171, 26,148,118, 84,145, 31,151, 10, 8,167,198, 11, 4, 31,135,197,207,
+235, 37, 39, 74,201, 56, 20,179, 48,220, 2,160, 89,137, 27, 48,218,251, 92,218,224, 27,108,182,181,237,189, 90,213,112,199,197,
+185, 37, 66, 63, 50, 26, 82,245, 33,186, 21, 2, 41, 29,149,214,224, 41, 89,127, 85, 64, 0,155,129,164,168,195,121,106,210,157,
+ 49, 16,180, 67,123,221,105, 23,132,151, 98,143, 8,133,181, 9,233, 2,160,114,132,149, 41,152,202, 77, 80, 0,122, 20,224,133,
+140, 19,174,145,216, 85, 22,174,139, 58,117, 20,167,255, 0,116, 45,215,218,183, 92,253, 48,116, 59, 66,168, 71,135, 84,162,201,
+ 91,137, 33, 46,115, 83,165, 76,101, 96,101, 41, 92, 44,103,200,106,117,145,110,169,112,231, 15, 1,196,123,195, 84,153, 12,178,
+ 20,148, 41, 94, 28, 38,226,200,119,157,100,120, 95,165,138, 1,112,228,146,114,114,161,173,186,219, 8, 70,145, 86,150,137, 9,
+ 45, 70,158,138, 76, 55,148,216, 65,109, 45,150, 86,152,239,128, 57, 65, 12, 75,229,234,122,225,213,148,244,209,114,119,104,171,
+ 4,128,125, 92,254, 87,191, 96,110,192,158,223,104, 2,109,189,142,214,189,197,123,226,102,115, 14,101,151,130,175,170,167, 41,
+126,116, 54, 59,220, 24,181, 41, 23,243, 93, 94, 65, 97,177,125, 39,160, 56,182, 92, 20, 69, 77,185,225,210,208,218, 12,121,177,
+214,245,101,132,175,147, 20,200,207,169, 77, 67, 12,161, 64,187,239, 14, 55, 24, 58, 82,112,164,176,232,229, 32,231, 94, 29, 77,
+ 69,138,133, 70, 29, 29,163, 30,174,236, 24, 12, 74,171,176,182, 29, 93, 18,157, 80, 46,135, 10, 99,172, 22,209, 86,126, 34, 28,
+247, 86, 74,249, 90, 42, 50,212,149, 37,164,133, 61,149, 74, 50, 96,174,108,231,227,148, 73,104, 70, 98, 34, 90,232,251,142, 52,
+174, 65, 30, 63, 46, 28,230,126, 90,201,119, 25, 60,138,113, 64,225,189, 82,183,173,152,148,155,102,178,203,203, 68,215,166, 72,
+114,183, 95,156,227,173,149, 84,171, 51, 30, 74, 27, 67, 12,173, 36, 52,203, 81,219,102, 60, 68,130,144,203,109,165, 36,133,120,
+138,212,193, 31, 77,212,144, 72, 34,198,251, 27,245, 44, 15,154,214, 6,230,224,239,182,149, 3, 21, 18,113, 76, 43, 65, 3, 50,
+137,214, 49, 12, 40,135,117,121, 29,209,158, 71,223, 75, 42, 46,136,204,108, 8,145,132, 74,193,144, 72, 75, 74,213, 54, 21, 45,
+ 76, 91,246,218, 94,139, 17,193, 28, 86, 29, 14, 46,115,208,212,249, 67, 77, 64,167, 72,144, 20,185,149,135,226,180,158,101,145,
+202,195, 40, 83,141,144,227,200, 2,245, 21,216, 52, 92,248, 96, 70,161, 83,252,103, 98,197,145, 15,156,115, 78,109, 49, 66,157,
+109, 1,110,205,152,167, 16,175,119, 65,203,206,130,172,229, 69, 42, 23, 85,184,213, 38,116,122, 77, 49, 30,243,112, 48,191,122,
+156,175, 0,120, 52,218,131,205, 97, 18,106, 83,146,149, 4,194, 76, 0,146, 91, 88,241,164,101, 41,109,188,184, 10,126, 34,216,
+ 84, 0,137,213,234,155,149, 73,236,160, 76, 76,164,176,212,104,116,198,150,183, 7,131, 18, 42, 93,229,167,198,253, 69, 23,214,
+ 76,149,151, 57, 71,195,200,157,109, 69, 33, 82,243, 60,133,180,234,176,248,250,244,211,107, 91,226, 72,211,167,112,188,181,209,
+ 76,160,213,204,197,106, 0, 96, 24,179, 79, 82,204, 72, 51,121,144,128, 10,249, 98,149,218,225, 28,149, 89, 27,152,205, 94,144,
+220,249, 80,209, 79,171, 70, 91, 20,181,184,135, 92,141, 50, 72, 14, 84, 76,118, 19, 36, 34,177, 25,151, 21,138,119,187,114, 19,
+ 21, 68, 12,117,150,149,132,150,213,150, 54, 98,220,136, 16,188,119,163, 67,101, 5,113,196,105, 72,165,185, 82,119,197, 5,126,
+248,228,114,219,144,233,141, 70, 67,104,106, 56, 82,124, 82, 79,136,218, 88, 9,105, 88,156,247,222,169, 82,227,191, 45,232,212,
+218, 11, 78, 71, 98, 59,143,161,113, 39, 84, 75, 46,153, 13, 76,172, 45,229,243, 37,135, 29,104,251,180, 52,101,110, 6,210,236,
+148,169, 74, 12,138,140, 74,153, 50, 51,206, 33,177, 76,164,162, 59, 73,171, 73, 72,104, 78,168,197,125,231,124, 63, 6, 48,109,
+102,142,200, 60,234, 28,229, 82, 93, 7,244,104,105, 39, 91,241,105,141, 99, 37,254,169,195, 11, 90,214,220,144, 53, 30,151,233,
+216, 2, 62,226,207, 81, 79, 37, 64, 53, 1,150,150,100,144,129,164,144,145, 57, 33,117, 0, 73,102,157,197,144,162,146,201,229,
+185, 91, 7,133,199,163,200,101, 79,198,131, 70,106, 76,183, 83, 33, 17, 40,212,166, 60, 24,241,189,234, 27,101,247,106, 85,121,
+ 13, 51,138, 77, 9,190, 85, 34, 58,146,217, 82,185,213,225,182,227,202,108, 33,244,163, 51, 30,132, 13,122,179, 61, 46,206,167,
+178,218,106, 21, 83, 17,198,105,113, 16,255, 0,130,203, 84,152, 48,121,220,112, 58, 60, 70,144,219, 72, 14,202,154,226, 91, 75,
+137,117,229,164, 37,133,166, 84,233, 54,205, 18,152, 42, 78, 72, 74,100, 38,109, 70,157, 75,167,176,101,215,110,185, 45,168,183,
+ 26, 21, 45,132, 58, 22,233, 81, 25, 47, 73, 45, 70,101, 9, 42,121,228, 37, 28,165,217,183, 32,206,171, 85,105,149,250,165, 82,
+149, 14, 75, 94, 12,218, 69,174,167, 26, 93, 42,136,182,199, 51,171,157, 33,213,135,234, 53, 63, 17,100,187, 57, 41,104, 33, 40,
+ 8,142,218, 24, 74,121,221,169, 86, 22, 72,193,212,205, 96,202, 46, 67, 48,184, 22, 31,101,130,133,184, 4, 88, 49, 35, 72,181,
+216, 86, 28, 81, 1,116,150, 73, 25,169,242,225,205, 66,229, 73,146,164,163,105,104,209,130,181,131, 0, 76,135, 75, 68,143,118,
+149,228,145, 98,129, 95,138, 36,233,202,152,138,141, 93,169,141, 69, 80, 30,227, 5,244, 43,222, 82,165, 36,243, 74,171,176,208,
+ 41,106,160,226,222, 82, 83, 28,169, 98, 40, 10, 73, 90,220,201, 68, 52,254,150,111, 2,144,225,187,179,158,209,187, 10,132,211,
+ 79,213,165, 82,118, 15,137, 25, 20,246,210,148, 75, 91,140,190,246,200, 95,117, 36, 32,115, 57, 41, 10,102,175,109,202,146,122,
+ 41, 18,232,108, 40,225,134,134,166, 17, 71,172, 75,173,183,254, 28,202,224,136, 19,125,223,220,189,237,247, 37, 21,179, 37,214,
+ 81, 80,121,191, 1, 45, 16,166,130, 31,105, 33,106, 75, 76,149, 56,163,206,177,200,205,113,141,195,133, 51,141, 78, 12,248,147,
+225,150,176,148, 59, 23,119,182,166,230,182,237, 57, 15, 97,150,105,151,140, 70, 87, 85,176,107,200, 50, 27,253, 3,177,111, 58,
+ 93,191, 49,181, 28, 41, 2, 57, 60,193, 74,200,158,100,149,102, 22,210,191, 88,166,198,203,123,107, 2,250, 84, 17,179, 17,170,
+ 37, 36, 88, 6, 45,176, 1,135, 60,241, 94, 80,210,197, 55, 50, 52,167,146, 27, 38,149,177,141,119,250,189, 44, 46, 13,254,219,
+ 16,222,117, 4,220,220,223,242, 16, 41, 10, 0,121,103, 35, 29, 63, 35,174,144, 0,146,129,231,232,122,252,251,246,242,213,103,
+105,213, 58, 52,201,244, 90,252, 69,192,174,208,170, 53, 26, 21,114, 3,128,135, 96, 86,232,211, 30,166, 85,233,238,115, 96,133,
+177, 82,139, 41,165,103,205,147,175, 33, 3, 57, 79,194, 14, 78,124,199,203,236,212,253, 72, 96, 25, 78,160, 70,198,251, 27,216,
+220, 31, 76, 83,251,247, 22, 56,241,142, 65,215,160,207, 76,143, 35,229,243,210, 78, 79,144, 72, 39,250,186,145,142,218,250, 74,
+136, 25,198,115,208,129,220,124,245,247, 36,146,124,191,217,244,236,126,205,103,127,191, 3, 30, 72,200,230,229,206, 58,121, 15,
+199,215,251,117,236, 5, 31,245, 72,242, 7,190, 62,223, 76,233,114,133,144,114,164,245,198, 7, 65,219,215,238,215,190, 92,127,
+ 56,224,103, 31, 47,191,211, 67,221,233,129,138, 43, 71,124,156, 15,196, 14,221,186,244,208,171, 3, 3,191,166, 64,201,249,119,
+249,234,232,212, 41,147, 22,132, 71,105, 74, 46,186,134, 91, 32, 16, 29,125,194, 18,211, 12,249,188,250,213,209, 40, 72, 43, 89,
+ 56, 72, 39,166,186, 71,195,191,178, 43,142,110, 36, 99,196,171,219, 27, 61, 83,178,237, 25, 97,151, 26,188,247, 98, 90, 54,206,
+131, 38, 59,229, 63,225, 52,182,171,241,205, 66,178,148, 52,175, 16,166, 60, 5,115, 36, 97, 43,202,147,157,121,171, 41,169,236,
+ 37,148, 43, 55, 69,234,199,224,162,228,159,112,198,205, 37, 29, 93,124,188,138, 26, 89, 43, 38, 29, 86, 36,103, 32,122,182,144,
+116,143,123, 88,123,241,204, 5,140,156, 36,231, 29,252,135,224,124,251,232,117, 0, 14, 70, 1, 7, 7,183,159,203,207,166,117,
+177,124, 80,240,223,126,112,157,189,183,214,195,110,107, 49,211,119,216, 53, 54, 96,207,155, 77, 84,151,104,213,200,115,224,199,
+169,209,174, 75,118, 76,184,204,185, 50,223,157, 79,148,219,177,157,113,166,212, 74, 28, 66,144, 20,218,181,174,203,234, 48, 7,
+159, 79, 94,255, 0,111, 83,141,108, 83,203, 28,200,146,198,218,163,144, 2, 58,142,190,160,216,223,220, 69,240,155,199, 36, 18,
+203, 12,200, 98,158, 22,100,116, 59, 50,178,157, 44,164, 14,132, 16, 65,247,140, 12,160, 58, 18,122, 12,253,253, 63,179, 67,171,
+168,200, 61, 58,140,249,227,207,167,231,182,138, 63,173,208, 17,223,167,203, 25,201,252, 53, 69, 64, 1,142,253,115,246, 15, 67,
+173,144,108, 65,244,198, 70,227,125,199,254, 48, 26,129,245, 28,189,186,140,125,224,250,245,208,171,192,201, 25, 7,255, 0,104,
+122,103, 69,184, 70, 72, 57, 0, 30,195, 29,124,186,126, 31,179, 66, 47, 62,163, 30,158,121,249,116,210,202, 73, 23, 56, 0,108,
+ 61, 54,192,202,193,193,193, 4,247,206,116, 58,199,159,175, 67,233,162, 87,235,229,140,122, 96,250,252,244, 58,129,201,200,200,
+251,113,131,219, 56,209,199,198,216, 54, 6, 88, 0,100, 39,175,203,167,231,251, 52, 43,131, 39, 36, 2, 64,236, 58,254, 63, 61,
+ 22,231, 76,100,244,201,251, 60,134,132, 80, 30,188,221,127,104,193,245,251, 52,170,155,223,107, 91, 25, 22,223, 2, 44, 12, 18,
+ 70, 49,219,212,117,237,161, 87,243,234, 15,111, 44, 31, 92,249,249,232,197,140,103,249,222,127,105,251, 6,133,115, 24,236,123,
+246,244,239,223,229,165,147, 10,139, 27,123,190,126,126,252, 12,188,246,199, 76,103, 62,152,254,142,154, 13,206,249,201, 78, 51,
+156,140,231,211, 31, 46,250, 49,194, 2,122,244,243,207,151, 79, 93, 90,212,167,148,162, 20, 50,159, 34,158,248, 35,184,244,210,
+152, 2,247, 55,232, 48, 59,171, 82, 85,220,156,231,177,199, 79,179, 75, 84,137, 89, 82,129, 64,192, 61, 9,238,125,123,157, 45,
+ 11,159, 92,102,195,211, 7, 1,145,228, 49,230,115,215,175,153,251,245, 85, 41,199, 65,212,158,255, 0,159, 77, 82, 78,114, 7,
+145,207, 79, 35,223,203,237, 26, 37, 0,231, 61, 49,231,219,242, 53,130, 1,198,113, 85,164, 37, 39, 24, 29, 70, 51,230,123,121,
+232,129,156,245, 31, 8, 29,193,235,233,231,223,190,169,163, 29,176, 58,117, 7, 26,244,121,242, 2, 82, 20, 60,250,224,142,189,
+251,246,210, 76, 0,248,223, 3, 5, 39, 29, 51,146, 59,252,240,123,103,174,138, 64,206, 8, 35, 31,183,240,208,109, 54, 70, 78,
+ 78, 73,235,147,144, 6, 78, 6, 51,215, 70,163, 57,233,142,157,199,203,229,162, 27,218,255, 0,203,124, 17,187,155,224,134,240,
+161,156,231,174, 64,235,211, 29, 63,164,104,132,168,143, 60, 14,199, 24,243,245,249,127, 86,168,160, 96,103,207,203,243,246,141,
+ 16,132,224,228,245, 7,174, 63,160,231,215, 73, 16, 5,253,223, 39, 9, 28, 86, 71,127, 62,223,143,231, 58, 44, 1,220,122, 99,
+160,192,252, 52, 58, 82, 7,219,143,207,238,213, 86,242,162, 60,134,112, 57,142, 0,243, 42, 62,128, 12,232,167, 5, 97,182,231,
+108,101, 54,149,175, 93,188,238, 42, 37,171,108, 82,103,215,174, 43,142,169, 10,139, 68,162,210,216, 92,170,133, 82,169, 80,121,
+ 49,225, 64,134,195, 96,151, 31,113,229,164,118,194, 70, 84, 72, 0,157, 78, 55,217,195,236,235,180, 56, 5,219,136,183,189,229,
+ 6,143,114,241,101,120,210,144,245,197,112,186,195, 83, 99,109,101, 38,115, 41,113, 22, 77,152,167, 82, 66, 42, 9, 66,147,245,
+132,212, 0,227,174,130,132,144,210, 64, 58, 65,236, 48,224, 78,145,183,150, 91, 28,115,238,229, 25, 47, 93, 23, 10,101,211,120,
+127,163, 84,163,165, 73,163,211, 57, 87, 30,165,184, 46, 48,226, 73, 76,201, 4, 45,184,107, 35, 40,101, 37,105, 33, 78,103, 93,
+206,171,207,168, 77,158,242,214,234,165,120,206, 45,240,239, 57, 83,188,203, 36,252, 62,157, 9,239,170, 51,196, 46, 48,105, 37,
+147, 42,160,151, 76, 16,146, 37, 96,109,169,129, 27, 92,118, 83,208,119, 32,181,143,145,135,112,125, 25,188, 13,143, 54, 16,113,
+223, 19, 82,137, 17,172,244, 16, 72, 60,170,157,125,165,213,191, 93,246, 49,126,194, 16,247,212,254, 92,102,175, 95,155, 82, 46,
+162,100,151,208,236,151, 84, 86,135,157, 83,143, 45, 96,146, 94,142,181, 28,149, 31,231, 39, 61,245, 66,141,115,205,137, 57,175,
+ 1,247, 75, 76, 35,195, 76,148, 41, 72,125, 46, 37, 67,149, 50, 80, 63, 89,178,122,100,246, 29,245,245,218, 59,147,164, 45, 78,
+ 62,215, 50,202,148,134,101,254,133,244, 62,145,140,180,188,124, 11, 56,232, 71, 67,171, 83,148,233, 49,170, 13,190,247,248, 44,
+245,182, 90,104, 56,144,150, 39, 33, 63, 10,154,125, 67,225,241, 20,158,202,245,193,243,213, 56,106, 88,146,193,203,105,235,239,
+ 59, 19,191,201,199,127,158, 23,202,218,157,233,146, 24,236, 81,136, 80, 46, 1, 43,107,143, 46,174,130,197,183, 3,169,212, 47,
+102, 23,138, 45,142,166,222, 16, 42, 27,183,108,211, 81, 10,232,163, 70,247,155,186,155, 13,174, 83, 92,132, 0, 8,170,165,134,
+192, 6,115, 39, 5,106, 72,203,136, 86, 73,233,166,207,131,205,208,115,108,174, 89,118,133,206,234,163,216, 59,146,166, 20,169,
+ 42, 82,136,161, 93, 77,252, 49, 42, 33, 4,225,182,215,204,148,185,216, 20,171, 61,198,186, 27,110,114,132,166, 53, 69,148, 59,
+ 30, 90, 23, 25,101,236,171,154, 43,201,240,223,133, 36, 17,241, 35,145, 74,229, 39,161,215, 63,238,253,167,145,106,238,109,193,
+110,177, 27,154,158,103,166,165, 71,109,208, 75, 65,135,207,188, 66,117,149,227,252,159, 41,228,233,219, 3, 75,181, 66,188,109,
+ 27,157, 72,221, 61,223,199, 99,123,219,220, 65,219,108, 51,192, 88,210, 85,228, 53,174, 76,116,104, 30,157,201,185,229, 35, 0,
+ 2, 19,125,224,147, 75, 37,239,101, 33, 13,213, 69,250,103,114, 80, 10,102,173, 46, 58,164,199,113,180,212,163,184,159,141, 18,
+ 38,180,144, 27,150,219,136,255, 0, 40,194,218,193,244,234, 52, 13, 53,152, 76, 85,228, 75,126, 75,175, 83,218,112,212,170, 11,
+111, 28,170,135, 77,132,169, 78,242,115, 15,209,175, 45,242,143,153,236,117,227, 97,231, 85,171,148, 38,109,155,155,154, 91, 20,
+248,232,126,139, 84, 87,199, 38, 34, 85,134,223,163, 74, 82,186,185, 28, 40,126,141, 95,205, 7, 30, 67, 69,110,125, 33,219, 19,
+109,119, 58,172, 90, 66, 93,116, 66,166,211,214,225, 63,160,250,214, 82, 3,169, 64,233,241,150, 27,112, 39,168, 3,155, 62, 88,
+ 58,244,144,243,106,233,148, 11,197, 35,128,123,129,109,205,246,238, 6,199,184,235,108, 71, 42,184,155,216,242,188,198,154,162,
+ 95,237,180,208,232,140, 11, 90, 66,236,136,172,189,245, 3,160,145,212, 16,122,249, 73,227,159, 17,187,137, 50,231,190,101, 63,
+ 18,112,228,140,252,162,176, 30, 62, 10,228, 73, 82,164, 22, 95, 72, 63, 2, 91, 10, 66, 22,112, 8, 82, 66,185,126, 28, 29, 79,
+145, 81, 80,168, 42, 68,213, 63, 12, 37,188, 63, 45,130,209,128,132,156,150, 26, 75,203, 73, 74,254, 39, 10,138, 92, 67,124,164,
+229, 42, 25, 25,186,221,245, 35, 87,185, 43, 18,155, 90,227, 77,126,164,251,143, 7,129,118, 51,188,178, 11,120,144,148,242,135,
+ 91,232, 71, 50, 10, 92, 36, 36, 39,211, 88,139,213,131, 77,117,196,212, 27, 16,219, 83,220,225,196,169, 47,211,101,161, 71,194,
+ 11, 92,133, 4,174, 9, 66,203,105,113,183,145,240,248,193,124,202,108,130, 38, 34, 59,179, 29,137,125,253,230,246, 63,127,165,
+250, 13,186, 11,218,248,225,108,186, 60,159, 36,202,104, 33, 80,239, 79, 18, 6,232, 36, 44,108,206, 88,216,171,134,102, 58,137,
+189,193,232,183,182, 51,138,107,197,167, 35,145, 32,194, 75,137, 45,162,170,204,129, 26, 59,172, 0, 57, 16,250, 88, 42, 67,173,
+168, 44,132, 33, 97,105, 81, 89,194,193,192, 15, 21,183, 34, 93,189, 17,133,173,196,213, 88,150,133,188,239, 51, 44,199,149, 29,
+ 45,142, 86,210, 82,135, 2, 38, 68,112,144,144,148,168, 41, 39, 32,133, 0, 2, 89,200, 80,154,117,109,186,212,100,199,139, 80,
+101, 13, 33,216, 78,199,114, 51,238, 37, 74, 91, 78,189, 27,148,178,231, 80,164,172,130, 9, 41,201,238, 14,179,250, 11, 83,227,
+182,194,154,145, 2,161, 25,212,187, 44,196, 66,213, 18,124,111, 5,107,100,166, 20,148,169,198,211, 12,115,175,153, 42, 74, 80,
+ 70, 78, 78, 51,166,186,192,172,178, 6,109,136,220,117,189,189,227,117,177, 30,160, 27,119,233,139, 14,158,162, 39,142, 0,101,
+ 66, 93,128, 10,247, 70,216,130,108,214,176, 96,108, 65,243, 95,175,187, 27, 7,111,210, 27,168,182,211,116,199,151, 78, 75,232,
+110, 83,209,169,177, 26,125, 10,125, 72, 91,143,187, 34, 34,142, 34,172, 0,129,128,132, 45, 73, 72, 9, 43, 56, 80,206,163,202,
+184,216,125,223, 26,158,154,225, 56, 80,114,142,180, 69,150,162,178,150,227, 46, 61, 62,106,200, 76,129,146, 74, 91,146, 28, 87,
+ 54, 67,121, 73,211, 37, 69,159, 9, 83, 19, 42,175, 34,171, 13,106, 74,227,154,156, 84,200, 79,185,120,108,229,135, 25,169, 81,
+213,250, 96,176,134,208,128, 65, 64,248,130,145,141, 58,116, 74,219,236,148,159,175, 97, 86, 33,180,182, 20, 87, 17,108,199,169,
+180,216, 91,106, 47, 79,130,128, 61,245,230,208,113,204,207, 34,215,156,148,247,212, 94,170, 25,163,109,148, 76,140, 5,245, 41,
+218,254,142, 8,213,107,116, 44, 47, 97,229, 55,198,205, 75, 85, 29, 71,255, 0, 73, 68, 85, 96,178,164,159,111, 98,202,179, 71,
+229, 98, 69,134,130,202, 77,238, 0, 83, 96,239, 82,107, 84,106,164,152,205,214, 16,245, 17, 75,247,101, 22, 43, 1,232, 83,105,
+203,136,165, 50,229, 98, 34,151,202, 17,226, 61,202,145,202,178, 48,162,146,142,250,216,251,105,128,186, 36,170,100,211, 22, 67,
+ 77,176,209,122, 60,214,153,145, 30,167, 10, 65,240,214,164,164,158, 79, 13, 73, 45,115, 37,224,181, 33,120, 81,230, 79, 42,131,
+ 59, 69, 16,106,201,139, 50, 64,129, 87,142,243,161,150,146, 80,211,168, 90, 71,134,148, 54,236, 25, 3,150, 43,129, 5,101,229,
+ 41, 92,199,162, 51,130,112,245,208,236,136, 14, 52, 88,165, 63, 50,139, 34, 51,197,246, 98, 51,239, 14, 83,216, 91,139,113,121,
+ 76, 73,110,172, 58,223, 48, 72, 13,160,134,135,112,144, 6,154,194, 70, 23,117,229,143,129,216,236, 71, 80, 47, 96,118,184, 4,
+222,231,114, 6, 41,222, 44,205,105, 4, 73, 28,205, 45, 7, 45,193,177,250,212,141,149,187, 31, 44,137,107,144,124,172,109,102,
+184,117, 1,243, 59, 82,158,154, 90, 88,167,200,142,181,210,164,169,181, 70, 81, 89,144,237, 61,164, 97, 8,142, 95, 89, 89,114,
+156,227,128, 6,143, 58,148,202,185,146,172,161, 73, 41, 58,230,163,187, 82,190,163,190,164, 15,240, 15,170, 97, 12,245, 79, 47,
+184,169, 46, 41,174,193, 14,169,111,140,231,161, 40,198,122,227, 89, 5, 18, 3,176,154,143, 6,166,202, 9, 1, 73,143, 61,174,
+116,199,117, 99, 11,126, 47,134, 18, 84,193,229, 10, 37, 10, 37,180,225, 64, 40, 28, 13,100,168,166,120,245,217, 15,133,120,168,
+146,220, 87,219, 46, 28,171, 6, 52,112,158,128,225, 60,175, 70, 87,197,205,140, 40, 16,112, 64,214, 42,193, 90,101, 10,126,211,
+169,184,233,123, 31,188,110, 72,220, 3,125,207, 67,138, 55, 49,206,155,219,234, 42,132,129,216,197, 32, 46, 15,145,195, 50, 2,
+235,191, 86, 80, 85,250, 18, 70,227, 86,166, 57,149,157,109,178,148,183,224, 71, 1,183, 35,200,142,217, 40, 25, 72,109,212,201,
+ 82,185, 20,122,144,165,158,100,158,128,171, 25,198, 50,253,209, 40,136, 75,137, 56, 90, 16,244,102,139,216, 60,229, 92,174, 20,
+160, 14,224, 59,241,225, 62,105,200,244,214, 51,107,195,108,165,151, 16,146, 22, 20,133, 20, 2, 74, 64,121, 60,138, 65, 87, 76,
+ 96,117,207,114, 8,243, 3, 79, 5, 53,182,146, 64, 57,193,111,145, 35,178, 84, 80,226, 28,232,165,126,162,177,219, 31,234, 19,
+220,105,223, 44,132,121, 88,223, 77,198,253,250,119, 62,253,247,252,113, 75,113, 30,119, 60,175, 32, 4,249,186,239,191, 91,252,
+ 54,176,222,214,184,191,174, 50, 89, 20,195, 81,143, 72,144,180,173, 79,134, 84,226,176, 3,206, 10,131, 10, 49,156,120,149, 12,
+182, 3, 33,100, 31, 37,188, 73,238, 14,172, 46, 81, 36,215,106, 78,136, 82, 13, 46,159, 29,244,173,218,140, 98, 3,147, 86,130,
+148, 42,159, 79,101,212,148,184, 90, 82, 9,117,242, 64, 39,157,182, 86, 64, 39, 89,163,142, 4,210, 26,113,106,112, 18,169,104,
+109, 13,148, 32,151, 20,219, 9, 95, 85,156,163, 43, 88, 5, 64, 16, 3,157, 50, 73,215,199, 43, 45, 65, 83,113, 91, 14,161,136,
+145, 25, 84,196,198, 1,231, 22, 91, 74, 20,150,219,107, 33, 42,116,156, 18,165, 16, 57, 84, 58,142,131, 82, 86,141,140,129, 80,
+ 14, 99, 42, 29,250, 93,128, 39, 98, 55,238, 64,233, 99,214,219, 98,176,130,186,186, 61, 66,153, 3,200, 12,138,151, 0,172,107,
+174,228,216,130, 24,139,170,168, 32,128, 73,218,246, 35, 9,159, 71,167,209,161,120, 20,248,236,194,134,100,203, 91,178, 29, 95,
+186,251,203,202, 90, 28,149, 81,118, 76,215,143,188, 39,196, 74,202,151, 33, 97, 35,155,151,196, 40, 72,195, 37, 84,174, 73,169,
+ 84,154,106,129, 77, 18,105, 49, 10,229, 68,157, 80,241,218,102,167, 32,224, 55, 84, 90, 25,111,222,102,198, 15, 5,251,154, 64,
+109, 11,229, 46,180,231, 39, 33, 15,133, 74, 59,117,246,189,234,168,242, 95,136,212,199, 36,199,182,218,105,167,105,241,249, 74,
+146,211,181,151, 92, 73, 53, 87, 2,149,206,150, 9, 76, 54,221, 64, 80,109,197, 32, 43, 88,189, 94,149, 6, 43,205,191, 86,230,
+247,217,135,221,162,211,216,142,170,140,185,124,205,173, 45, 70,131, 10, 58,124,106,140,226, 75,124,160, 0,202, 50, 8, 82, 18,
+ 57,198,220, 72,224,134,210, 45,176,191, 96,122, 95,208, 6,189,206,219,216, 29,247,196,207, 33,174,134,153,155,219, 85,171,171,
+156, 48,220,187, 89,207, 83, 96, 67, 75, 32, 91,221,193, 17, 45,216,175, 48, 50,178,224, 84, 74, 44,154,236,184,109, 72,113,234,
+237,116,165,197,177, 54, 82,143,185,194,138,164,184,249, 16,105,241,143, 44,103,208,121, 50,164,146,226,240,182,220,119, 4,235,
+ 37,164, 65,153, 92, 80,137,106, 70,139, 82,125,151,164,197,155, 93,168,123,196,123, 46,150,251, 8,240,252, 17,238, 40, 42,185,
+170,222, 34,155, 80,141, 16,150, 88,230, 75,114,101, 51,130,141,103,113,118,222, 84,228,199,126,232, 95,240,106,136, 16,215,189,
+218, 86,235,201, 53,185, 52,220,146, 81,114, 92,236, 97, 49, 90,112,128, 36,194,166, 1,146,181, 52,236,199,138, 84, 53,147, 85,
+149, 73,182, 92,129, 6,223,109, 81,169,207,198,147, 79,163, 83, 41,232, 5, 82, 81, 29,145,152,108,180,165, 54, 91,134,211,156,
+200,113,210, 18,218, 3,193,103,153, 99, 39,101,145,165, 85,144, 39, 49,211,208,128,187,218,251,146, 58, 53,134,171, 94,215, 4,
+ 88,173,147,175,226,120,170,103,246,122, 6, 21,149, 44, 27, 66,168,189, 44, 37, 67, 23, 6, 68, 33, 36, 54, 58,210, 58,127,236,
+202,171,173,165,149, 12,145, 11, 77, 10,223,167, 90, 47,203,153, 93,154, 39,203,117,178,229, 86,225,153, 22, 43, 10, 90,217, 97,
+108,173,148, 73,109,194,197, 34,138,149,128, 98,176,158, 86, 18,160,180, 32,169,197, 18,171,243, 12, 71,188, 39, 42,174,205, 61,
+ 18, 45, 72,169, 45, 52,144,181, 82, 30,158,238, 86,184,179,219,134,160,218,163, 82,146,160,225,109, 14, 58,219,178, 20, 76,135,
+249, 18, 91,109, 56,227,176, 25,153, 75,137, 81,185,166,184,212, 78, 68,193,165, 81, 33, 56, 20,195, 85, 39, 10, 11, 82,165, 48,
+193, 47, 87,234,137,240,209,202,128,158, 72,168, 70, 91, 66, 74,214,240,187,209,162, 25,147, 29,241, 80,243, 20, 40, 45,185, 21,
+234,107,146, 57,170,243,146,235,172,178,227, 19,125,225,132, 36,196, 91,197, 42, 68,112,151, 28, 82, 94, 80,113,210, 62, 13, 58,
+210,106, 66,183, 75, 35, 17,168,117, 97,109,198,228, 16,111,212,237,190,224, 90,197,113, 23,172,103,117,158,190, 74,182,147, 48,
+ 80, 99,105, 64,211, 10, 1,101,209, 78,168, 99, 38,107,105,141, 52, 17, 20, 68,221,110,162, 55, 14,212, 81, 18,171, 73, 69, 54,
+151, 80,170,193,183,229,135,231, 85, 42,149, 41, 47, 79,143, 80,247, 20, 52,203, 16, 98,229,240,126,168,115,170, 31,125, 39,149,
+208,202, 26, 10, 40,231,230,113,232, 15, 68,139, 87,166, 53, 26, 60,198, 94,122, 51, 68, 71,148,250,148, 25,103, 63,162, 83,229,
+ 41, 41, 99, 37, 69, 44,160, 37, 60,201,103,152,129,206, 20, 27,135, 43, 8,141, 22,153, 2,220,110, 28,171,174,170,134, 89,142,
+153,169, 66, 35,209, 88,108,174, 57,126, 80,125, 99,220, 96,135, 91,113, 92,141,161, 33,199, 27, 75,101, 92,216, 34,241, 2, 53,
+ 62,152,134,101, 34,161, 49,233,206,169,137,117, 56,178,156, 90,231, 45,245,190, 29,112,130,215,199,159, 17, 9,113, 10, 64, 72,
+240,130, 80, 82, 83,212, 76,105, 31,217,222, 25, 64,230,104, 8,110,162,224, 1,102,223, 85,193, 99,246,172,183, 96, 73,103, 47,
+101, 81, 84,230, 84,205, 52, 18,164,134, 72,163,156,202, 35,140,221,164,118, 98, 85,165,150,214,109, 39, 74,162, 72,246, 71,229,
+ 5, 65, 26,139,159,203,207,219, 83,176,204,240,223,237, 79,227, 35,111, 41,204, 69,139, 67,175,238, 80,222, 59, 98, 36, 38,195,
+113,161,208,183,162,149, 7,112,132, 52,182,144, 3,101,170,213,102,182,215, 40,232,148,176,158,221,135, 48, 73, 36,100, 96, 99,
+184, 61,250,246,212,159, 62,150, 45,137, 6,222,246,135,108,254,224, 66, 67,137,123,117, 56, 94,183,220,168,135, 22,209, 74,230,
+ 88, 87,181,215, 66,109,109,161,180, 2,209, 52,250,172, 0,176,165, 45, 68,165, 61, 64, 1, 34, 48, 64,228, 21, 18, 15,251, 56,
+236,115,211, 86, 37, 3,171, 82, 68, 23,236, 70, 90, 53,182,195, 76,108,209,131,111, 66, 22,227,189,136,190,247,199, 60,230, 49,
+152,171,170, 80,253,162,193,143,184,200,162, 66, 62,237, 86,255, 0, 76,120, 41,206, 48,160,113,145,142,217,207,150, 15,125,123,
+ 0,227,148, 14, 92,116, 63,209,247,244,215,220, 39, 25, 35,191, 83,230, 71,159,125, 87,109,178,242,146,134, 70, 92, 87, 96,172,
+ 36, 4,128, 84,165, 45, 71,162, 80, 0, 36,146,112, 0,201,233,173,195,210,228,218,223,187, 26, 93,174,118,199,134, 90,117,213,
+ 33,166,208,167, 28, 90,185, 80,132, 2,165, 40,158,192, 1,174,165,240, 33,236,163,226, 11,141,133,195,187,161,181, 31,108, 54,
+ 57,185,170,102,161,188,215,148, 9, 46,210, 42,138,140,234, 81, 54,157,182,214,243, 78, 53, 39,113, 42,232,234,133, 62,203,140,
+ 81,226,186,164,251,205, 65, 68, 45,141,111,127,178,155,217, 11, 7,117,232,244, 30, 38,184,174,161,203,107,103,231,248, 21,109,
+173,218, 73,190,241, 78,168,239, 51, 13,168,169,155,182,242,228, 90, 36, 81,246,136,186,131,238,144,210, 90,151,113,134,203,171,
+ 91, 20,149, 36,203,150,181, 2, 36, 72,241, 41,180,202,125, 62, 5, 42,149, 74,131, 14,149, 68,162, 82,162, 70,166,209,168,180,
+168,109, 37,152, 52,202, 93, 50, 19, 72, 98,155, 79, 98, 58, 66, 90, 97,150,208,219,105, 24, 66, 83,166, 25,243, 9, 42, 36, 48,
+211, 63, 42, 59,216,200, 44, 75, 90,215, 17,131,112, 7, 91,187, 2, 54,178,171, 92,178, 89,124, 43,192, 18,102, 49, 69,153,103,
+ 74,240,208,200, 3, 69, 2,157, 18, 76,166,196, 60,141,179, 69, 19, 15,178, 22,210, 56, 58,131, 70,186, 89,244,203,132,143,102,
+ 23, 8,220, 37,199,165,207,176,182,222, 37,237,184,240,218, 71,188,239, 38,234, 68,167,221, 55,203,178, 8, 5,199,104, 48,157,
+143,245,101,141, 16,184, 57,155,143, 75,138,210,217, 36,230, 83,228,243,158,151, 69,160,187, 49,126, 36,133, 58,235,129, 35, 46,
+ 60, 86,226,143, 94,131,153, 68,246, 24, 3,200,118,213,202,135, 74,248, 27, 28,132,168,164, 41, 71, 3, 60,167,178,137,239,204,
+123, 15, 64, 52,232,211,232,248, 74, 64, 64, 35, 29, 71,146, 73,235,146,113,212, 96,254,205,107, 90, 40, 75,114,198,159, 86, 38,
+236,109,251, 76, 73, 38,219,253,162,109,208, 91, 22,226, 81, 83,208,192,148,180,116,233, 71, 78,189, 18, 53, 84, 94,219,144,182,
+187, 30,236,110,205,212,155,226, 36,191, 73,131,133,184, 14,237,254,198,241,107, 70,166, 37,170,205, 10,172,246,199,238, 12,230,
+ 90, 72, 51,232,213, 6,101, 92, 59,127, 50,122,210, 50,227,241,167, 51, 87,134,218,213,158, 86,166, 6,193, 0, 1,168,116,169,
+ 41, 33, 39,204,245,237,215, 39,203,251,117,250, 82,251,111,182,226,159,122,123, 47,248,158, 68,212,183,205,103,209,237,109,192,
+166, 56,164,149,248, 53, 59, 98,234,166, 45,165,183,223,145, 74, 98,100,132,103,253, 85,145,219, 95,154,217, 61, 0, 4, 2, 74,
+134, 8, 61, 7, 49,198, 52,227,147, 73,255, 0,165, 66, 15,216,112,195,220, 36, 0,159,222,225,201,223,169,197, 33,199,180,137,
+ 77,196, 45, 34, 0, 5,116, 17, 74, 69,250,190,167,136,155,109, 98,194, 32,222,246, 36,247,192,206,116, 56, 35,174, 1,207,238,
+253,186, 25, 65, 61,243,212,246,243, 7, 26, 53,192, 0,199, 55, 83,220,158,189,254, 95,142,132, 88, 87, 83,128, 65,237,142,152,
+192,193, 56,199,174,159,241, 15,192, 46, 18, 50, 66,124,241,246,227,185,249,232, 98, 58,147,216,252,251, 39,236, 30, 90, 53,207,
+ 47,191, 65, 58, 65,207,175,110,189,250, 16, 14, 52,178,244, 30,252, 20,218,254,159,207,182, 5,112,227, 39,190, 51,142,131, 31,
+120,199, 78,154, 17, 68,242,243, 31,159, 40,251,126,126,154, 37, 72, 61,249,137,198,122,121,118,238,122,245,213, 5,161, 68,100,
+ 16,191, 34,124,135,231,247,232,227,183,207,254, 48,111,134, 5, 42, 36, 16, 71,124,114,231,182, 61,126,122, 29, 68,103, 25,234,
+ 1,232, 6, 0,235,229,162, 84,147,145,215,246,116, 0,106,130,240, 62,121,237,229,142,217,251,124,180,162,141,133,183, 31, 63,
+ 61,177,144, 1, 62,151,192,138, 73, 25,229, 57,201, 57,255, 0,103,240,208,221,251,232,197, 2, 50, 70, 0,235,156, 30,227, 61,
+ 50, 61,116, 50,192, 29,129,245, 39,203,236,252,116,170,117,249,219, 10, 40, 4,116,183,200,197,185,230,249,199, 41, 42,198, 70,
+ 82, 58,103, 25,238, 71,150,116, 51,141,184, 1,235,202, 2,112,144, 0, 36,143,159,167,158,174, 42, 0, 30,132,158,249,207,174,
+132,121,178,164,158, 85,169, 7, 39, 24,254,119,219,234, 51,165,176,110,158,235,226,222, 82,148,255, 0,148, 36,147,212, 99,211,
+208,244,239,165,175, 69,181,182, 0, 82,148,225, 61, 73,192,233,242,239,165,161, 99,233,140,227,210, 7, 92,249, 15,233,252,157,
+ 20,130, 49,129,223,185,251,245, 65, 32,224, 12,117,234, 63, 19,255, 0, 13, 86, 64,238,124,199, 76,122,104, 96, 96,148,167, 3,
+175, 66,127, 28,126,227,253, 90,168,210, 0,200, 56, 61,207, 79,158, 58,231,243,223, 84,210, 73,233,142,131,166,126,239,219,162,
+ 91, 73, 57,233,223,215,207,166,147,112, 55, 61,255, 0,241,129,143, 96,121,224,159,199,161,251,180, 91, 63, 23,113,203,215, 25,
+238,123, 13, 83,109, 35,160,235,215,175,223,141, 18,148,131,208,116,233,158,223,102,147,193, 77,141,238,118,193, 72, 79,216,122,
+118,249,250,227,203,207, 85,146, 1, 56, 61, 61, 49,251, 7,109, 14,216,230,198,125, 50,122, 99, 68,160, 2, 64,198,125, 63,225,
+164, 90,192,144, 62,122, 97, 28, 86, 29, 14, 58,140,121,159, 62,158,186,218,174, 11,120,121,159,197, 23, 18,123, 87,179,145,130,
+147, 79,185,110, 40,206,220,178, 66, 73, 76, 27, 74,150,164,207,184,229,172,143,213, 6,158,202,219, 7,253,105, 35, 90,172, 1,
+206,113,144, 59,143,159,245,234, 71,254,193,173,178, 98,146,141,245,226, 34,165, 22, 63,188, 82,169,144,118,234,211,150,250, 66,
+158, 98, 93, 83, 19,235,142, 70,200,253, 26,253,223,221, 91, 42, 24, 61,198,152, 56,151, 50, 57, 86, 77, 91, 84,173,166, 80,186,
+ 80,142,161,155,107,143,122,130, 91,254,220, 76, 56, 7,134, 79, 24,113,142, 65,195,218, 75, 67, 95, 58,243,173,255, 0, 2, 48,
+101,152, 92,116,213, 26, 20, 7,179, 48,196,149,103,214, 45,203,102,139, 77,179,109,136,172, 83,237,139, 54,149, 2,215,182,224,
+ 65, 9,106, 37, 62,145, 72,142,136, 76,165, 49,147,211, 5, 45,100,145,212,231, 39, 86,118,235, 42,143,200,227, 47, 37,210,234,
+ 18, 24, 83,124,167, 5,120, 37, 7, 39,169, 39, 31,142,154, 22,235,241,228,173,213, 7, 98,188,149,229,164,178,233,228, 89, 82,
+186, 30,101,122, 21,107, 39,167, 33,181,182,204, 85, 70,113,109, 7, 2,195,161,204,169,167, 50, 20, 18,130, 15,196, 61, 53,201,
+ 85,114,187,206,236,205,119,148,147,111,221,239,252,122, 91,240,246,231,132, 50, 26, 12,191, 43,166,165,142, 30, 84, 80,168, 93,
+ 32, 13, 58, 85, 84,105,177,176, 1,109,176, 91, 3,211, 99,135,136,196,145, 38, 52,105,210, 76,121, 79,186, 10, 76,117,169, 45,
+200, 65, 31,170,160, 65,233,140,104,132,199, 66,144,161, 62, 50,221,107,148,150,150,164,248,168,109, 67, 33, 74, 86, 6, 71,200,
+131,160, 41,209,224, 56, 99,202,116, 72, 15, 50,217, 66,222,125, 75, 64,192, 24, 0,163,205, 35,215,229,172,162, 35,108, 56,218,
+125,222,104, 97,121,193, 42, 81,113, 50, 18,162, 73, 1,181,118, 3, 58, 69,199,148,148, 66,227,107,244,216,237,190,219,127, 28,
+ 18,170, 83, 9, 43,230,178, 30,161, 74, 4,185, 54, 11,164,181,128, 27, 95, 77,200, 59,139, 97, 81,169,202,247,134,228, 67, 90,
+ 39, 71, 36, 55, 34, 19,199, 15, 6,193, 24, 91, 89,234,160, 7,109, 86,220,221,191, 69, 90, 85,181,115, 68, 96, 46, 68, 6,140,
+ 7,138,147,149,150, 82,160,166,208,188,140,168, 39, 39, 25,242,233,167, 58,137, 71,166,201,142,194,201,142,212,216,196, 6,229,
+ 50,121, 11,153, 61, 65, 3,161,199,207, 78,207,240,125,201,244,162,195,141,165,106, 65, 67,236,188,216,248, 92, 90, 48, 74, 84,
+ 7, 98, 83,144,126,221,106,152,228,100,145, 44, 64,101, 22,223,184,183, 79,141,173,235, 98,111,138,187,136,120,137, 99,171,130,
+101, 58, 30, 38,100,109, 86, 82,202,195, 78,228, 88, 56, 32,141,236,172, 58, 16,109,124, 91,182, 90,193,101,183,152, 82, 35,165,
+ 30,248,200,113, 65, 41, 9, 79,140, 82, 57,198, 49,211,152,245,251, 78,155,223,104, 77, 33,251, 91,135,122,140,200,202, 44, 42,
+ 69,199, 77,109, 75, 9, 39,197,247,120, 85, 7, 27,105,208, 6, 86,128,176,147,145,219,151, 56, 58,220,141,174,167, 53, 29,232,
+216, 70, 58, 14,152,232,133,143,214, 72, 31,205, 26, 97,253,170,148,143, 23,133, 86,229, 70, 46,101,187,202, 15, 56,105, 57, 89,
+ 75,148,154,162, 84, 79, 78,191,171,143, 92,159, 93, 75, 50, 90,104,205, 42,203,166,242, 70,111,241,189,135,243,239,235,142,124,
+204,184,154,105,248,255, 0, 33,161,119,211, 75, 85, 83, 4,100,118,176,147, 86,254,237,133,254, 24,136, 5, 65,227, 38, 82,145,
+202,226, 39, 41,110,184,151,185,156,241, 27, 46, 17,149,180,210, 23,200,250, 75,169,109, 32, 45, 42, 64,235,207,202,174,244,225,
+ 84,213, 6, 69, 67,223,225,189, 84,158,167,131,113,207,129, 29,150,216,138, 80,148,182,153,212,240,151, 19, 0,248,133,126,240,
+180,243,120,152, 79,110,128, 7, 61,166, 95, 74, 93, 83,147, 93,247,105, 92,175, 73,101,190, 69, 71,105, 74,202,153, 10,108,130,
+212,142,100,163, 40, 88,230, 36,130,160, 83,202, 52, 77, 26, 68,232,229, 30, 27, 79,123,184, 37, 79,205,166,196,101, 85,116,182,
+ 73, 71, 35,108, 72, 90, 68,166,220, 46, 4, 56,180, 23, 84,209, 5, 97, 7, 3,149,225,214,234,123,129,216,253,221,239,113,176,
+ 23, 3,174,219, 95,167,161,116,245, 3,200,177,221,159,162,132,176, 97,182,229, 73, 27,128, 53, 11,223,179, 1,176, 39, 14, 61,
+179,110, 49, 87, 92,138,164, 73,146,233,178,165,150, 16,227, 84, 69, 42, 50, 94,109, 10, 71, 71, 96,168, 22, 37,159,133,105, 75,
+193, 9, 83,132,168, 41, 95, 14,158, 74, 45, 26,235,147, 34, 76,184,244,134,171, 40,104,204, 83,146, 41,175, 68,162, 76,140, 26,
+117, 76,161, 51,233,207, 31, 0,115,161,149,165, 62, 10,135, 57, 87,234, 12,157, 54,148,138,123, 5, 81,133,159, 38,108, 39, 22,
+195,242,231, 68, 66,152,157, 2, 68,128,208, 83,174, 57, 5,247, 3,144, 18,140,142,105, 41, 91,107, 89, 89, 79,134, 84,158,109,
+108,157,156,170,253, 2, 24,110, 77, 1, 74, 65,106, 28,151,106, 52, 57, 77,206,132,236,118,255, 0, 72,150,159,167,169, 41,148,
+219,202,116, 37,124,170,241, 18,165, 16, 50, 10,136,212,110,190, 89, 0,102, 91, 57, 54, 10,173, 96,125, 45,246,150,247,176,217,
+ 88,139,245,185,184,195,137,205,164,100, 34,153, 99,169,146, 43, 14, 92,202, 82, 66,118,230,106, 62, 73, 25, 71, 75,134,111, 41,
+ 23, 70, 4, 1,238,148,138, 91, 79,179, 2,163, 42,161,107, 43,221,217,145, 13, 23, 52, 5,211, 28, 76,196,148,190, 35,243,188,
+223,129, 37,188,163,195,105,198, 94, 1,193,212, 37, 68,105,199,141,108,212,103, 60,153,146,233, 80,100,164, 73,113, 42,158,134,
+163,128, 66,210,128,223, 59,193,178, 90, 87, 40, 29, 82, 74,185, 79, 84,231,174,179,235, 33,170, 93, 82, 77, 65,154,147, 17, 46,
+ 76,178,176, 41, 85, 40,140, 45,104,144,248, 64, 74, 13, 62,115,105,115, 41,101, 46,164,185,225,171,144, 31,132,142,153,120,104,
+155, 91,103, 58,196,127,118,165, 59,108,201,150,211, 50,140,139, 86,167, 83,165,188,209, 10, 66, 17, 17,112, 22,243,140, 60, 16,
+ 72, 81,231, 97,105,115,147,153, 93,245, 22,146,172,134,180,138,209, 72, 58,244, 55,189,174, 71,217, 35,212,143, 54,251,139, 30,
+173,181,252,117, 14, 86,239, 28,240, 77, 72,225, 81,117, 42, 44,182, 50, 45,220,171, 22,130, 84,251, 42, 72, 28,237, 90, 65, 85,
+ 58, 66,227, 1,178,236,216, 17,129,148,194,170,116,121,146, 79,188, 38, 93, 38, 95,133, 10, 82,217, 78, 91, 18, 24,229,114, 60,
+196,167,194, 87,134, 28,105, 10,115,149, 65, 71, 7, 26,218,107,126,109, 90, 10,162,154,132,152, 21, 33, 32, 55,133, 48,201,165,
+212, 26, 80, 33, 63, 20,102,159,113,167,222, 82, 65, 82,130, 11,105, 73, 39,225,199, 46,172,180, 45,177,175,198,113,230,233,151,
+117, 62,124, 98,178,148,183, 92,183,144,196,137, 9, 81,248,202,103, 82, 28, 65,109, 73,194,146, 20, 24,229, 74,149,158, 83,170,
+151,157, 90, 22,218, 91,117,139,187,113, 17, 73,181,172,155, 85,134,101,215,110,181,213, 99,253, 77, 72, 98, 68,134,161, 70, 15,
+171,149, 18, 12,199,165, 63, 30, 59, 44, 48,211,146,228, 58,240, 75, 8,112,149, 16,164, 80,243, 60,247, 50, 62,199,125,199,193,
+ 73, 23,219, 99,125,143, 82, 0,239, 80,241, 39, 21, 71,196,149,209, 83, 82,212,174,107, 81, 80,226, 56,226, 80,230,162, 70,147,
+234,226,138, 33, 50, 71, 80,238,238, 21, 99,138, 13,122,152,170,128,194,195, 15, 28,122,147,162, 40,105,244, 58,132, 37,223, 18,
+ 3,231,194,234,242, 86, 28,114, 59,165, 43, 30, 26,249,214,164,228,128,219,188,202,202,185,192,213,242, 37, 81,151, 30,143, 37,
+197, 57,226, 48, 3, 43, 43, 9, 11, 44,184,174,102,157, 83, 95,206, 90, 22, 66, 70, 64,200, 86,124,137, 13, 21,189,112, 82, 46,
+ 11,114,151,114, 91,117,216,119, 21,175,113, 83, 33, 86,232,117,120,238,174, 76,106,173, 26, 82, 67,145,101, 66,125,192, 11,141,
+ 45, 4,130,146,128,164, 41, 37,183, 57, 92, 66,210, 3,147,114,251,147,205, 46, 54, 83,202,178, 2, 20,226, 80,132,161, 96,169,
+ 73, 10, 36,120,173,129,204,140,147,204, 20, 64,198, 59,150,162, 37,117, 42, 5,134,194,253,108, 65,216,110,125, 71, 75, 11,250,
+ 92,139, 85, 45, 11, 75, 83, 85, 72,209,180, 51,196,206,140,172, 25, 25, 24, 29, 14,146, 35, 0,209,184, 32,134, 82, 46, 24, 18,
+ 55, 26, 78,240, 90,213, 31,208,130, 86, 9, 4, 18,130, 72, 73,229, 80, 42,230,108,126,177,199, 46,112, 65, 25,207, 93, 58,209,
+ 39,130, 16,145,159,214, 81, 60,157, 65,194, 72, 0,114,156,158,128, 96, 14,165, 71, 30,128,234, 46,217,220,212,153,116,202,237,
+193,112,215,105,214,197,177,108, 64,126,171, 91,175,213, 37,166, 53, 46,151, 79,136, 18,100, 76,145, 41, 67,244, 76, 39, 45,163,
+148, 5, 41,199, 22,134,154, 11, 82,210,147,121,177, 56,210,225,140,221, 20,202, 80,185, 43,180,231, 43, 85, 4,209,236,251,142,
+240,181,165,219, 54,109,110,224,123,244, 52,198,233,213,121,111, 56,150,164,191, 39, 34, 8,154,220, 70,223,145,203,133,133,114,
+ 37, 82, 44,159, 40,174,158,140, 87,178, 8,168, 83,237, 72, 72, 38,202, 69,200, 91,220,219, 97,125,133,250,145,136, 77,103, 11,
+113, 14, 98,249,179,100,188, 59, 93,159, 12,160, 94,161,169,105,165,154, 56,137, 78, 96, 87,150, 53,100, 83,203, 28,198, 91,150,
+ 88,129,148,174,133, 36,110,229,114, 79,128,205, 58,148,133, 31, 26, 20,100, 59, 45, 60,196,132,212, 39, 20,202,122, 50, 84, 70,
+ 84, 27, 10,142,218,188,129,109, 73,206, 70, 5,137,201, 14, 46, 63, 35,110,172, 30, 98,236,137, 60,136, 43, 66,208, 65, 73, 5,
+196,225,111,114,171,166, 73,229, 9, 25,193, 3, 88, 95,215,200,158,183, 30, 67,206, 41, 43,116,248,202,117,107,231, 82,249,143,
+ 62, 86,165,101, 75, 43, 42,230, 4, 2, 9, 87, 55,198, 14,178, 38, 92, 98, 67, 32, 20,251,201, 8, 88,240, 16,146,164, 41, 67,
+178,192, 65,194,147,145,216,231, 10,198,125,116,226,139,237, 51,153,109,101,216, 45,137,176, 85, 0, 40, 38,219,249, 64,243, 91,
+246,186, 2, 70, 32,113, 80,251, 44, 81, 44,131, 83,130, 89,141,129,187, 49,212,196,131,181,139, 18, 64, 38,192, 90,228,140, 52,
+ 23, 71, 18,155, 27,182,247,133, 23,109,175,221,230,219,141,180,184,238, 72,209,228,209,169,247,213,194,220, 10,181, 86, 20,201,
+ 78, 65,135, 62, 60,103,163,251,172, 38, 37, 75,102, 75, 81,164,214, 36, 66,142,250,153, 91,141,169,214,146, 84,119, 30,147, 66,
+165, 80,195,147, 41,232, 38,166,235,108, 25,149,121, 74, 76,250,173, 65, 50, 26, 67,141,184, 37,252, 94, 36, 34,194,208,182,218,
+140, 81, 20,180, 82, 89, 10,109, 73, 89,131, 15,180, 99,113, 31,190,120,217,226,105,247, 21, 37, 48,237,189,193,122,201,132,220,
+231, 27, 90,216,183,172, 58, 52, 11, 98, 37, 40,182,149, 41, 9,140,210,225,202, 12,167,155,149,105,150,162,177,158,154,222,143,
+101, 55,180,158,109,129,120, 91, 92, 38,241, 1,118, 84,165,108,197,201, 83,133, 67,218, 59,194,177, 84,117, 3,105,238, 58,130,
+145, 22,145,102,215, 42, 78,168,190, 54,130,167, 53,198, 99,180,128,239,129, 65,155, 33,153, 40, 74, 41,207, 76, 66, 18,163,204,
+ 18,106,169,105,103,136, 44,113,146,169, 37,205,135,152, 11, 55, 64, 21,137,251, 98,218, 65, 1,129, 26,156,119,103,137,223, 65,
+ 12,230,155,192,222, 23,241, 67,129,120,142,163, 57,207,166,202,105,115, 92,243, 34,120, 80,201, 36, 83,210, 71, 89, 57,203, 94,
+ 45, 47, 81, 37, 18,146,173, 69, 62,179, 89,161,231,164,145, 39, 16,209, 79, 40,202,229,206,203, 50, 92,167,210,208,107, 18,249,
+ 17,239,226, 44,119,234, 17,224,182,163,206,183, 36, 8,104, 87,141, 37, 68, 5, 37,149,169, 33,190,156,196,116, 73, 21, 52,233,
+ 79,123,195,137,167, 34,158,186,130, 89,101,234,213, 77, 81,234, 87, 35, 64,168, 41,152,136,167, 35, 45,198,233,144,132,186,180,
+161,158,159,161, 42, 57,214,118,211,109, 82,144, 99,162, 60,122,107, 81,146,184,210, 98, 6,209, 25, 12,173,165,168, 41,185, 13,
+180,145,149,165,224,224, 89, 57, 61,193, 61, 53,141, 63,114, 33,233, 11, 85, 22, 2,170, 6, 42, 84,212,185, 46,120, 80,168,201,
+117, 77,148,182, 88,156,160,181, 73,125, 4,163, 41,105, 11, 32, 40,146,226, 20, 64,212,177, 40,249,104,218,136, 93, 29, 1,247,
+238, 71,235, 92,237,232, 58, 18, 54,181,252,231,165,168, 98,130, 44,186,134,201, 24, 5,166,121, 54, 99,112, 87, 94,233, 10,130,
+202,186, 81,249,136, 78,144,193,201, 44, 84,122, 5, 38, 28, 86,234,113,156,144,169,205,161,212, 57, 82,170,201, 76,201, 45, 60,
+163,153,137,113,197,182,159,113,143,202,130, 20,219, 0, 33, 33, 33, 36,173, 0,232, 37,215, 92,148,250,153,181,195,113, 24,204,
+ 83,252, 40,144,178,220,218,116,212, 96,205, 77,188,203,169,196,146,181,168, 6,221,112, 41,150,139,220,205,165, 69, 32,139, 44,
+136,107,113,106,122,179, 49,215,100, 48,241,113, 20,248,234,113,186,107, 6, 70, 20,166,155,136, 28,230,125, 10, 89, 0,151, 66,
+148,164,164,149, 30,184, 24,253,199,122, 66,165, 47,234,152,208, 81, 88,170, 60,133,169,134,151, 37, 17, 89,142,182,144,160,195,
+138,116, 16,184,175,115,146, 26,228, 35,152, 2,144, 10, 70,182, 97, 64, 14,163,229,113,223,173,246,245,220,141,236, 46,119,233,
+208,144,112,239, 75,150, 79, 93, 50,162,150,205,103,109, 68,106,254,230, 52,186,181,201,144,170,200,168, 55, 28,194,177, 0, 89,
+ 74, 58, 49,195,130,197, 46,151, 71,143, 89,156,136, 50, 16,226,147,239, 45,220,146,230, 75, 91,181, 22,228,134, 85, 46, 53, 65,
+ 42,116,169,215, 27, 81,116, 21,143,136, 56,176, 83,223, 69,209,101,194,118,104,120,212,188,105, 41,116,182,242, 25, 83,206,149,
+ 54,218,214,160,181,186,242,194,131,168,108,182, 83,205,250,200,108, 3,147,240,233,134,126, 83,142,181, 21,235,160,213, 20,137,
+105,109,136,245, 1, 33,149, 69,131, 86, 73, 74,228,162, 18,225, 47,194, 98, 66,176,143,133,208, 29, 73, 36,133, 44,128, 52,237,
+ 91, 17,157, 91,145, 84,244,169,143,180,227, 68, 21, 75,109,133,243, 33,111,129, 20, 74,114, 56,241, 39,182, 84,174, 82, 70, 20,
+165,173, 69, 57,239,167,120,101, 42,241,198, 6,146, 55,181,138,219,126,164, 14,187, 16, 5,245, 16, 5,201, 45,115,133, 51, 76,
+165,169, 40,229,154,170,189,170,102,150,227, 88, 37,145,130, 42,169, 88,221,140,154,183, 83,169, 71, 40, 43,236,138, 6,155,195,
+227,233,107,174,155, 39,136,190, 10, 30, 97,107,118,164, 56,127,220, 70,158,146,160, 16,217,132,155,246,143,200,210,154, 35,155,
+222, 4,191,120, 37, 71, 9, 82, 86, 10, 64,235,168,152,132,228, 28,164,164, 19,215,231,143, 77, 73,155,233, 79, 95,204, 87,248,
+240,217,189,185, 66,217,147, 47,105,120,111,164,154,148,182,157, 83,138,126, 70,226,221,245,186,220, 86,150,133,146, 80,148, 83,
+104,144,212,158,249, 18,186,147,129,168,234,237,246,223,222, 27,165,119,219,150, 21,133,110, 86,174,219,186,237,172, 68,160, 91,
+118,213,189, 79,122,169, 91,174, 86, 39, 44, 34, 53, 58,153, 1,128, 75,239, 43,226, 82,212, 74, 91,101,180, 45,231,150,219, 72,
+ 90,211, 98,229, 79,202,203,150, 89, 92, 34,171, 76, 88,147,176, 28,199, 55,185,216, 11,111,185,252, 49,198, 60, 76,139,250,126,
+189, 32, 28,197,102,132, 46,145,114,196,195, 16, 0, 0, 1, 44, 73,181,128, 4,182,214, 7,108, 96,193, 42, 89, 72, 66,114, 71,
+100,165, 36,149, 99,176, 0,119, 58,237,167,177,211,217,215, 3,138,221,197,169,239, 54,241,210, 85, 43,135, 45,155,171,194, 77,
+122,148,248, 83,108,110,166,227, 37, 13, 84,169, 27, 94,149,140, 21,219,145, 99, 42, 44,251,145, 77,156,169,135,162, 82,185,144,
+185,207, 4,246, 39,129,175,163,187,181, 22, 69, 46,141,184, 92,116,214,164,223, 87,121,101,186,140,141,132,177,171,110,211,108,
+ 90, 17, 41, 14, 34,153,125,223, 20,181,162,117,229, 60, 3,201, 42, 45, 53,216, 84,224,161,200,151,229, 4,149, 43,177, 76, 91,
+ 27,113,181,244, 24,150, 14,210, 88, 54,166,216,237,189,188,185, 31, 81,216,214, 37, 26, 21, 6,221,166, 25,110,243, 75,144,204,
+ 24,141,132,174,107,238,225,201, 18, 29, 43,126, 67,129, 42,121,215, 23,130, 27,243, 44,205,164,167, 43, 26, 24,161, 39,118, 99,
+165,220,118, 10,191,105, 84,157,152,182,150,181,202,117, 86, 19,158, 18,240,238,182,106,218, 90,236,242, 5,138,150, 59, 56,166,
+ 62,103,145,133,180, 9, 71,217, 84,185, 12,200, 75, 22,182,135, 80, 11, 12,100, 74,154,169,242,176,132, 54,203,109, 54,195, 44,
+ 71,140,203, 81,226, 70,137, 29,164,179, 10, 4, 72,236,165, 45,195,134,212,102, 91, 75,109,182,148,182,219, 76,161, 8, 74, 80,
+ 18,144,232, 90,112, 2,249, 93,117, 25, 66,146,209, 71, 66, 22,162,163,134,241,211,245,150,177,159,152, 58,106,104,113, 92, 82,
+188, 39, 22, 57,159,117,107,144,172,114,134,208,144, 20,235, 77,249,242, 37, 62, 27, 96,249,156,159,144,217, 59, 62,158, 23, 33,
+162,160,146, 26, 67, 60,168,236,129, 33,209,134,130,134, 48, 2, 26, 35, 31, 51,211, 77,180, 46,116, 52,199,224, 54,176, 30,128,
+ 14,214, 29,134,219,219, 98, 14, 47,113, 78, 21, 72, 3, 87,123,254,238,135,222,126,240, 59, 91, 14,157, 22,158, 26,105,164,172,
+ 5,168, 4,243,159,213,231,121,125,145,208, 99, 30, 93, 60,129,211,139, 26, 35,109, 54, 49,133, 17,220, 16, 79, 83,232, 60,250,
+246, 31,187, 86,138,100, 68,165, 73, 8,229, 81,142, 64, 42, 86,112,183, 22,144, 21,130, 15, 85, 36, 19,242, 28,218,203,218, 78,
+ 49,240,169, 41, 70, 66, 74,122,165, 68,142,170,207,160, 57, 72,251,254, 88,216, 14, 90,230,251, 15,244,249,254,125, 48,211, 87,
+166, 54,210, 5,205,133,251,123,192,239,235,247, 3,211, 99,142, 83,123,105,234,144, 40, 62,204, 78, 45,213, 56,172, 10,158,223,
+193,161, 68,109,166,214,234,222,168,213,110,106, 44,120, 49,210,219,105,230, 42, 83,161,103,253,144,131,228, 53,249,148, 74,163,
+ 86, 33,178, 31,157, 73,168, 68, 97, 73, 37, 15, 75,136,244,102,150,130,114, 10, 29,117,176,149,119,242, 39, 7,166,117,250,228,
+239, 21, 54,139,113, 81,162, 91, 21,234, 77, 58,187, 2,167, 53,185, 83, 41, 53,168, 81, 42,144, 36, 71,167, 16,227,102, 68, 9,
+141, 45,167,146, 37,173,178,146,164,171, 5, 25,232, 70,154, 39,182,131,105, 43,148,145, 68,173,237, 86,217, 86,168,230, 58,226,
+138, 93, 86,195,181,102,211,147, 24,131,204,194, 99,191, 75, 41,109,188, 19,219,175, 94,132, 30,186,205, 29,108,244,181, 21, 13,
+ 12,113,200,178,104, 7, 83, 48, 55, 91,237,178,176,177,213,114,119, 55,218,198,215,196, 43,137,120, 6,163,136,230,167,205,151,
+ 49, 90, 53, 72, 22, 32,134, 2,250,180,203, 43,106, 45,205, 75, 41, 46, 64,178,159,179,125,239,183,228,250,227,101, 60,188,224,
+140,142,128,244,207,144,199,168,198, 48,126,122, 21,192, 0, 3,155, 35, 57,233,215,215,166,191, 65, 78, 47,125,129,220, 19,241,
+ 21, 2,167, 90,218,170, 35,252, 48,110, 99,233,144,252, 74,205,131, 29,202,134,222,212,103,172, 18,132, 92, 59,119, 53,242,134,
+ 99, 45,220,115, 59, 76,122, 43,169, 25, 41,109, 88,229, 48,230,227,131,217,183,196,255, 0, 1,119, 35,112,119,146,205, 19,108,
+ 74,180,247, 33,217,251,193,104,151,171, 59,105,118,144,165,248, 44, 49, 88, 13, 5,219,245,162,132,229, 84,234,138, 35,202, 73,
+200,108, 58,145,204,100,244,217,164, 82,178,199, 50, 26,105, 9, 0, 92,221, 24,250, 43,250,158,193,130,177,236,164, 11,226,164,
+206,184, 91, 56,200, 65,146,174, 1, 45, 32,219,159, 17, 47, 24,222,195, 93,194,188,123,216, 93,212, 33, 36, 42,187, 28,115,229,
+210,158,163,169, 24, 62, 96,119,253,255, 0,215,160,212, 66,187,167, 24,232, 58,249,116,198, 49,219,174,141,117, 3,152,133,229,
+ 39, 56, 41,199, 80,122,227, 65,120, 97,165,169, 73,201, 43,238, 14, 79, 41,235,146, 61, 52,244, 14,192, 1,182, 35,160, 31, 92,
+ 14,231, 32, 73, 74,186,231,203, 24,251,137,244,208,101, 3,148, 32, 40,165, 57,236, 60,201,209,133, 63, 26,186,168,231,201, 71,
+225, 29,187,121, 13, 81, 86, 50,122, 16,115,246, 12,124,177,163,142,222,236,103, 3, 40, 3,211, 29,186, 30,189,241,215, 57,208,
+203, 24, 36, 15, 67,140,252,199,207,203, 69, 47,208,103,166,115,229,147,129,215, 62,186, 25, 64,244,230, 29,124,143,175,113,215,
+212,233, 85,189,129,245,235,243,240,198, 69,172,126,125, 48, 42,129,193, 30,127,147,161, 85,246,156, 17,215,204, 2, 8,199,217,
+162,148, 58,146, 20,122,103,207,167,159, 83,161, 92, 42,235,233,230, 71,159, 95,232,210,139,215,173,176,170,143, 95,157,176, 50,
+206, 15, 76, 31, 80, 71,224,126,220,104, 85,168,227, 28,189,125, 61,126,206,154, 37,100,103, 3,200,156,244,243,249,232,117,227,
+ 57,235,233,242,251,180,182, 50,126, 54, 56, 25, 99,175,159, 81,231,229,242,210,215,178,172,119,200,244,198, 14,127, 31, 61, 45,
+ 40, 47, 97,229,191,200,255, 0, 79,155,224,126, 56,162,144, 64, 30,191,143,158,170,163, 62,125,137,232,115,220,250,106,159,236,
+213, 69, 35,156,131,204, 71,166, 63, 63,156,233, 54,219,160,220, 99, 35,227,108, 20,131,208, 14,228,121, 99,231,251,116, 80, 56,
+ 35,184,249,250,104, 22, 57,146, 8, 81,234, 59, 31, 80, 60,243,247,232,209,216,117,207,207, 68,223, 77,200,244,254, 88, 24, 45,
+ 24,207, 92,231,203, 69, 35,207,183,239,208,173,124,207, 92,126,127,118,138, 64,232, 79,221,249,252,249,105, 44, 16,142,190,251,
+ 15,145,130, 80, 58,103,215,250,244, 66, 49,140,129,215,212,247,207,245,106,146, 48, 57, 79,150, 7,252,116, 64,193,232, 49,223,
+ 31, 97,210, 44, 79, 91,236,127,211,253, 48,153,183, 97,138,128, 40, 5,103,208,224,119,235,169,123,123, 41,104,112,173, 78, 2,
+173,121, 73,134,167,220,191,111,139,158,183, 80,116, 97, 14, 1, 26, 65,131, 29, 41,199,146, 91,142, 0, 58,136,106, 65,193, 4,
+140,224,156,227,211,175, 77, 75,111,217,163,113,199,172,240, 9,183,233,105,231,146,187, 86,241,187, 45,249,133,131,143, 9,213,
+ 78,114, 75, 97,196,121, 2,219,168, 32,158,224,244,213,121,226, 65,147,244, 28, 33, 13,148,206,186,191,254, 57, 45,142,131,250,
+ 49, 71, 12,158, 42,209,137,118,101,162,169, 41,214,225,249,148,226,226,196, 27,233, 45,211,181,251, 99,118,128, 83,114,214,210,
+153,146,220,116,144,235,125, 10,212,129,205,144, 20,161,156,249,105,224,180,100,161, 50, 35, 25,130, 74, 80, 57, 85,206, 20,176,
+ 26,230,198, 22,164, 30,253,198,153, 40,181, 49,238,232, 92,122,195, 47, 73, 82,210,211, 81,100, 39,149,110,184,178, 82,218, 1,
+ 61,252,180,248,219,242,107, 80,222,162, 71,155, 77, 98,169, 61,192,124,102, 35, 56,130, 91,108,254,170, 94, 72,254,110, 58,245,
+215, 54,213, 70,193,217,152,217,148,130,111,182,219,117,233,112,127, 28,123, 9,151,215,172, 84,113,194,236,164,181,215,237,232,
+114,116,222,246,144, 11,142,228,222,194,248,216, 58, 84,210,135, 89,145,227, 49, 81,108,184, 26, 12,189,132,132,180,123, 21,146,
+ 58,249,103, 78, 29, 49,216,145,157, 46,202,141, 0, 50,165, 99,153,162,151, 0, 10,255, 0, 80, 14,216,207, 93, 55, 22,253, 58,
+116,249, 14,180,186, 68,194,162,227,110, 41, 40,100, 22,154, 72,236,208, 41,238, 63,167, 78,237, 50,222,105,197, 50,210,160,203,
+ 5, 43,248,209,238,139, 82, 16,172,254,170, 84, 6, 15, 64,123,246,209, 97,137,100, 58,121,100, 21, 38,219,129,125,253,251,159,
+203,124, 66, 51,202,138, 53, 13,169,202,221,119, 10,203,112,189, 71,216, 96, 1, 27,139,233,177,239,124, 60, 54,123, 86,252,196,
+161, 45,162, 50,155,229, 7,170, 74, 10,129,238, 6, 71,112,116,252,211,104,240,209, 29, 41,140,174, 68, 20,228, 53,207,204,217,
+ 24,234, 19,232,174,250,105,109, 74, 83,112,209, 24, 57, 24, 70, 14, 44, 8,200,152, 24,136,167,206,112,124, 36,200, 90, 75,189,
+ 71,243,115,233,167,174,148,195,204, 73,247,101,182,182, 20,172, 18,219,237, 41, 33, 67,200,161, 67,203,168,237,167,136,114,230,
+101,187, 11,252, 13,192,191, 66,125,255, 0,150, 57,147,139,234,195, 84,202, 96,169,114,138, 75, 0,206, 26,224,108, 77,134,219,
+119, 54,216,237,113,131,109,233, 2,149, 48,165, 68,165, 30, 38, 65, 7,177,206, 58, 19,172, 11,142,250,104,187,248, 72,189,156,
+100,243,201,160,212,173,234,211, 33, 37, 75, 0, 55, 52,196,120,156,116, 8,228,153,212,158,131, 26,214,142, 52, 56,200,162,240,
+178,104,182,149, 18,205,170,110, 30,239, 93,144, 68,251,106,214,167,179, 37,200,145,162, 56,240,138,204,250,159,186, 52,167, 29,
+ 74,229, 97, 13,180,210, 74,150, 65,201, 72, 25,215, 24,110,255, 0,109,214,236, 89,181,169,123, 63,196,206,212,209,225,216,219,
+139, 33, 54,133,121,152,140,200,163, 86,236,207,172, 95, 67, 44,213, 92, 50, 29, 90, 28,247, 39,220,142,243,241,228,161, 37,109,
+ 48,160, 22,133, 16,160,237,150,210, 77, 74, 30, 57, 24, 4,148, 29, 42, 55,123,122,233, 0,155, 3,252,176,190, 77,224,151, 30,
+113,173, 21, 7, 27,228,116, 52,241,195,151,149,172,136, 84,213,193, 77, 53, 92, 16, 72,162, 73, 41,163,149,129,100, 44, 12,107,
+ 36,134, 56,222, 75, 34,185, 39, 28,240,171, 81, 92, 18,235, 15,189, 50, 83, 15,182,251,205,242,193, 1,135, 11,172,188,227,129,
+215, 90,116, 41, 15,167,152, 55,128,160,127, 87,190,113,171,197,186,251, 84,199, 27,110,231, 91, 11, 8,109,105,102,164,211,204,
+152, 75, 4,120,205, 50,166, 93, 67,142, 51, 33,194, 84,147,146,190, 85, 0, 82,178, 59,103,187,207, 96, 84,168,155,135, 92,164,
+148,251,168,139, 80,118, 74,101, 49,206,195,115, 26, 83,165,196,200, 97,164,164,165, 44,172,160, 41, 39, 56, 83,110, 36,144, 0,
+213, 45,183,165,251,180,225, 57,214, 41,211,231, 46, 59,134, 32,155, 57,137, 75, 47, 56,165, 48,251,207, 7, 20,216, 97,211,207,
+ 28, 22,210,121,212,147,204,148,242,228,105,122,137, 21, 98, 46,198,247, 22, 0, 1,112,118, 0, 3,218,222,150,216,220,157,247,
+199, 91,101, 89,173, 61, 78, 87, 77, 84, 36, 38, 42,136, 21,215, 65,180,182, 96, 28, 89,154,203,123,157,181, 30,246, 5,126,214,
+ 30, 11, 94,207,114,229,117,201,237, 69,164,202,120,197,143, 54, 85, 82,157, 37,183,147, 22, 59,235,108, 65,134,165, 70,194,224,
+ 61,226, 33, 45,144,231, 55, 47,196,226,209,149,116,219,107, 39,110,107,207,161,154, 43, 53, 69,192,105,220, 59, 45, 51,224, 51,
+ 86, 64,151,226,135,152,104,200, 64, 67,211, 90, 7, 24, 74, 94, 41,111, 9,230, 0,233,156,176,182,201, 77,169, 18,170,137,115,
+223, 42,193,152,112, 99, 91,243,158,143, 35,199, 74,144,226, 36, 74,147, 13,192,137,144, 80,224, 4,151, 2,137, 82,194, 64, 37,
+ 56, 27,217,102, 90,215,133, 41, 49, 27,133, 84, 98,165, 57,224,159,142,189, 5,146, 26,113, 35,153,236,152,138,109, 46,169, 69,
+ 25, 87,137,133,140,117, 36, 18, 53, 10,175,145,203, 5,138, 80,109,208, 48, 59, 17, 96, 8,190,160,123,246, 0,108, 20, 27, 91,
+ 12, 57,247, 17, 10,106,116,134,130,190,154, 78, 89, 80,156,196, 87, 1,193, 91, 30, 97, 18,163,152,205,238,197, 65, 6,218, 88,
+ 22,108, 90,237,237,189,152,234,185, 95,164, 89,245,210,228,149, 56,245, 82,107, 53, 74,100,246, 35, 52,164,165,243, 25, 77,135,
+115,204,242, 70,121, 29, 74,177,211,148, 96, 43, 79, 29,187, 98, 95,172, 58,106, 17,164, 80, 67, 45, 56, 12, 74,109, 70,100,217,
+240, 85, 24,171,153, 44, 69,113,113, 82,236, 53, 20, 4,149, 21, 41, 69, 5, 39, 41, 86, 6,179,123,118,157, 92,141, 29, 16,156,
+183,161,203,117,169, 45, 41, 85, 8,181, 70, 27,109, 47,173,212,248,236, 71,106, 84, 99,132,175, 36, 36,133,242,100,225, 68, 4,
+141, 58,241, 37,169, 36,181, 81,162,206,163,163,196, 75,109,173,245,177, 34, 3, 69, 39,152,189,239,177, 10,146,225, 89, 79,232,
+208,128, 73,194,129, 72, 61,117,169, 79, 70,103, 39,152, 2,179,118,234, 61,230,215,211,210,196,129, 98, 64, 29,141,241, 79,103,
+220,101,153, 30,114, 70,144, 85, 43, 2, 13,228, 73, 14,130, 64, 58, 33,230, 2,133,252,192,233,140, 21,185, 0,130, 72,108,110,
+143, 14,191, 8,188, 39,209, 80,234, 30, 65,115,252, 6,171, 17,212, 71, 73, 7,149, 40, 68,198,155,113,192, 74, 65, 61,137, 39,
+175,124,235,131,126,216,205,247,152,111,141,190,225,194,146,243,176,233,118,141, 10,155,186,215,228, 17, 33,165,138,133,245,119,
+ 54,244,107, 38, 20,208,210,212, 86,213, 50,201, 6, 83, 77, 44,254,130, 77,220,242,193, 10, 9, 34, 68, 98,167, 69,113,239,115,
+ 98,162,209,150,227,169,100,164, 50,250, 30,142,153, 10, 67,104, 47,161,113,185,149,250,217,193,234, 7,124,117, 58,132,167,180,
+ 11,114,157,191, 56,207,226,110,235, 91,220,193,123,191,119, 82,161,167, 35, 13,210,109, 57,205,218, 52,134, 80,174, 65,250, 54,
+233,246,252,102,210, 48, 48,150,250,247, 58,147, 81,229,101, 16,136,212, 49,107,111,110,151,247,223,215,107,145,238, 29,206, 45,
+ 63,161,246, 88,153,247,139,149,156, 79,155,208, 8,233,184, 47, 46,150,174, 32,203, 38,147, 89, 80,241, 82,211,189,164,119, 95,
+ 36, 18,213,200,157, 74, 75, 28,114, 11, 50,130, 59,157,236,172,221, 24,215,231, 13, 23, 37,147, 81,118, 25,168,236,189,253, 46,
+152,218, 93,144,151,101, 53,102,223,141,191,116, 91,190, 19,107, 28,209, 97, 71,172, 69,186,152, 65,253, 80,165, 4,167, 7, 26,
+218,107,158,228,161,191, 61,218,125, 49, 94,245, 40,172, 37,210,202,148, 67, 42, 11,229, 81,117,224, 57, 60,114, 15, 92, 2,160,
+149, 14,100,228,234, 49,124, 2,239,229, 79,110, 55,233,155, 77,234,234,233,116, 45,237,130,141,181,173,200,114, 66, 99, 70,106,
+181, 46,104,159, 98, 79,117,194,147,225, 52,221,203, 17,152,171,112, 17,134,171,110,142, 96, 9,204,138,108,186, 50,226,248, 65,
+230, 94, 18,210,234,138,218,116, 40, 56,144,201,253, 42,228, 2,144, 82,232,125, 39,155,155,185, 24,199,163, 70,113, 75, 61, 53,
+ 66,211, 24,192,102, 80,250,173,177, 4,158,128,236,109,107, 27,244,244, 55,216,120,245,195,212, 92, 51,226,119, 20,241, 60, 83,
+ 51,208,241, 68,223,164, 41, 96, 4,170, 44,179, 42,251,111, 53,134,197,189,176, 77, 41,141,108,170,146,160, 98, 5,181, 97, 28,
+ 75,220,181, 26, 38,200,211,104,247, 69, 74,235,183,182,170,177,190,251, 65, 11,117,110,107, 14,159, 10,179,117, 91,182, 75,207,
+220, 78,183, 82,133, 14,168, 4, 79,171,216,186,153,183, 21, 41, 82,210, 98, 36, 41, 9,115, 46,170, 58, 78,196,185,236,244,224,
+218,187,107, 59,115,220,156, 71,239,126,228,237,173, 2,138,187,170,107, 84,230, 45, 75, 86, 5,193, 65,109,135,229, 52,252, 91,
+142,223,106, 82,213, 70,114, 67,192,198,106, 35, 40,154,243,242, 91,140,151, 91,112,244,112,233,245, 17, 14, 44,120,174, 52,203,
+140, 76,104,179, 45,183, 16,135, 25,122, 52,130,142,120,210,155,117, 36, 60,203,137, 64, 5,181,165, 73, 88, 7, 57,232, 53,131,
+111, 20,122,181,183,183, 23,101,181,105,248, 52,138, 5, 74, 76, 74,251,148,250,116, 97, 1, 16,222,167, 60,106, 47, 70,165, 53,
+ 21, 77,181, 6,159, 41,244,182,244,150, 67,100, 56,236,116,184, 10, 10,220, 42, 89, 95, 56,135, 46,142, 10, 39,138, 88, 81,180,
+202, 38, 14, 74,164,134,226, 72,138, 50,168,146, 61,200, 73, 86, 72,223,161, 85,177,213, 91,112,255, 0,139,220, 97, 77, 6, 89,
+195,156, 53,196, 21, 60, 22,207,152, 77, 60,242,208,138, 52, 21, 75, 82,148,144,150,121, 38,162,154,174,158,178, 4,129,185,117,
+ 52,245, 41,169, 36, 80, 81, 94, 4,118, 96,232,187,243,188, 52, 58, 53,183, 22,179,113, 84,169, 53,196, 81,160,251,245, 41,201,
+ 62,244,245, 37, 30, 24, 17,105,181, 9, 10,121,208,245, 77,152, 9,140,153, 37,110, 58,225,146,151,148,235,139,112, 41,106,217,
+189,151,227, 46,253,131,118,219,180,250,252,122,125,201, 79,118,165, 17,114,150,164, 24,178,216,166,197,117, 15,212, 36, 41,109,
+252, 46,145, 13,149,146, 84,156, 16,146,163,211, 58,229, 18,107,239, 62,242,147, 37,199, 31, 91,206,242,186,241,117,192,165, 58,
+115,211, 39,155,149,210,121, 78, 15,117, 43,161,198,175,245,237,208,133,180,123, 77,185, 27,181, 83,195,175,211, 41, 12,109,245,
+155, 17,197,165, 15, 85, 55, 47,117, 95, 93,149,109, 82, 48,149,164,169,198,162, 73,174, 84, 86, 89,234,134,109,247, 20,190, 92,
+115, 20, 34,161,174,138,166, 35, 73, 52,177, 73, 35, 11, 42,177, 35,177,251, 38,224,129,110,227,176,216, 3,139, 63, 49,225,124,
+159, 58,137,168,171, 50,122, 67, 83,155,200,176,199,104,150, 37, 89,170,228, 17, 68, 21,129,214,136, 36,145, 64, 37,137, 84, 80,
+ 88,147,124,113, 55,116,247, 70, 69,253,187,251,165,124,248,206, 6,183, 3,113, 47,219,205,230,124,103, 29,108, 53,115, 87, 43,
+ 21, 40,234, 47,172,146,232, 75, 18, 90, 9, 39, 39, 13, 39, 9,232, 14,172, 14,214,153,120, 48,183, 78, 92,152, 57,157, 10, 37,
+ 43,109,167, 26, 13,184,150,207, 80,131,206,176,172, 30,169, 9, 5, 24, 32,105,155,145, 77,159, 79,177, 55,214,248,122, 99,102,
+ 14,214,238, 37, 54,195,167, 33,244, 45,181,207,144,221, 5,213,204, 44, 21, 16,151,138, 88,241,164,244, 32,167,198, 64, 82, 64,
+ 41,200, 53, 27,141, 40,118,147, 76, 15, 45,169, 62, 12, 25,243, 2, 86, 20,234, 16,197, 62, 19, 65,165,164,117,229,247,167,138,
+ 73, 61, 22,177,202, 7, 66, 69,171, 7, 12,211, 48,141, 68, 97,196, 42, 34,118,176,243,125, 68, 82, 27,237,230, 26,101, 64, 77,
+183, 59, 94,221,125, 38,200,188, 76,203,114,202, 54,165,142, 67, 20,116, 65, 22, 8,217,183, 68, 90,250,204,182, 21, 7,236,171,
+ 60,153,116,228, 2, 70,148, 58,202,134,186, 15,209, 95,217,213,187,149,126, 36, 56, 44,216,253,206,187,174, 26,157,110,227,126,
+218,126,193,186,149,240,199, 84,155,163,109, 39,191,101, 84, 39,204,125,144, 23, 80,149, 50,149, 75,163, 76,121,231, 85,202,227,
+245, 23,148, 15, 58,213,173,192,169,181, 57,184,233, 69, 62, 75, 17,217,117,148, 54, 25,157, 8, 41, 77,184, 20, 57, 18, 85, 21,
+196, 40, 55,148, 36,167, 33,106,235,158,185, 26,226,103,176,146,232,171, 73,224,105,202, 90,107, 52,248, 49, 97,111,182,232,183,
+ 25,185,145,221,148,239,233,169,118, 36,151, 91, 74,223,144,136,236, 44, 74, 46, 41, 40,108,169, 68,173,101, 73,230, 86,187, 41,
+ 49,154,218,209,205, 42,173, 52, 52,180,165, 74, 68, 70, 98, 69,116,182, 9, 42, 83, 15,150, 84, 82,172,173, 43,228, 0,100, 3,
+231,140,166,170, 86,154, 21,107,179,160, 10, 88,238,110,160,139,147,114, 77,254, 59,238,122,227,195,207, 25,248,114,151,135,188,
+100,241, 27, 44,203,158, 10, 60,158,155, 59,204, 26,142,156, 69,166, 56,105,158,169,228,130, 24,163, 88,121, 65, 97,137,146, 53,
+ 32,147,100, 5,141,201,182, 5, 94, 69,230, 10, 94,145, 46,158,251, 79, 45,104,148,212, 6, 23, 14, 74,219,229, 12, 45,182, 36,
+ 58,225, 37,149, 97, 25,231, 83,121, 7,151,152,115,103, 88,171,145,168,116,244,134, 97,194,115,222,240,219,142,210,234,106,145,
+ 26, 99, 65,211,209,246,222,146, 74,159,116, 16, 64, 41,113, 93,130, 80,224, 61, 53,146,220, 18, 42,169, 71,189, 65,175, 23,224,
+ 43,196,110,100,138,180, 52, 73,141, 20,132,150,219,121,201, 49,146,211,140, 32,184, 66, 20, 84, 8, 65, 74, 73,198,117,138, 87,
+ 28,148,234,162, 34,187, 74,117,192,134,195,141, 85,221,124,204,165, 74, 66, 64, 8,106, 33,105, 1,113,212,225, 81, 86, 31, 66,
+ 49,205,221, 67, 11,214,189,142,171, 48,185,237,109,186,218,221,251, 94,219,220,117, 0,118,198,190, 89,205,228, 83,161,104,226,
+136,234,212,180,224,194,199, 64, 4, 7,140,136,249,140,128,157,144,137, 21, 72,107,233, 54, 57, 45, 21,111, 50,239,128,212,167,
+155,106, 99,237, 53, 50, 5, 82, 58,170,112,130, 22,133,248,114,226,201, 82, 20, 84,194, 84,162, 75, 79,133, 20,150,202,144,180,
+144, 70,158,219, 70,151, 29,231,155,118, 60,104,204, 22, 63,193,222,142,151, 20,169, 10,146,203,194, 58,208,195,190, 63,232,220,
+ 83,255, 0, 26, 27, 64, 12,165, 9, 10,230, 9, 32,105,148,162, 91,141, 33,248, 83, 89,126, 99, 48,230,182, 20,180,198,150,244,
+129, 79,113, 60,188,170,101,153,170,115,222, 32,173, 37, 93,149,240, 99,149,124,169, 9, 89,109,184,249,226, 98, 31, 5,220, 21,
+239,191, 17, 15,200,136,155,150,213,178,166,210,246,246, 59, 73,141, 4, 86, 55, 54,239,228,181,236, 42, 83, 8, 90,185, 31,124,
+220, 21, 40,178,202, 18,149,144,213, 45,220,101, 41, 86,157,232,209,181,169, 10,100,111, 40, 23, 59,177, 54,181,129, 23, 4,146,
+ 58, 1,212,220, 92, 98, 11,198,117,212,212,212,243, 58,213, 20, 77, 12,210, 54,146, 52,132, 30,109, 96, 29,244,170,155,187, 57,
+ 42, 0, 96,197, 77,204, 4,253,172,219,203, 47,139, 95,105,175, 18,183,101,176,204,138,245, 61,141,200,141,179, 22, 18, 41, 9,
+ 93, 86, 93,102,147,182,162, 46,222,210,152,166, 51, 24, 19, 62,108,219,142, 29, 80,176,134,211,151, 87, 57, 0, 2, 78, 76,168,
+189,147, 30,205, 59,119,129,141,189,137,185,219,145, 71,167,212,120,177,191,168, 72,110,225,150,239,131, 57,157,155,182, 42,104,
+109,241,183, 54,188,132,130,150,171,238,183,225,154,253, 69,162, 22,251,224,192,105, 98, 36,114, 29,230,127,176,159,128, 53, 76,
+144,190, 60,247,198,152,229, 94,166,106,149, 39, 54, 34, 21,106, 58, 84, 43, 87,116,135,159, 77,209,188,211,162, 60,140, 58,227,
+ 18,159,150,197, 29,103, 9, 19, 37, 74,154,140,150,153, 34, 80,232,121,231, 86, 94,194,151,206, 84,165,229, 89, 83,132,156,149,
+100,255, 0, 59,169,238,117, 52,214,174,144,192, 15,246,106, 75, 42,129,210, 73, 19,102,115,254, 20, 96,116, 95,171,221,172, 52,
+163, 53, 11,192,252, 48,106,170,102,226,204,206, 29, 53, 57,147,188,180,145, 48,254,234, 41, 9,101,148,237, 96,238,166,209,126,
+196, 86, 97,188,158, 91,213,199, 90, 49,104, 79,128,238, 30,144,121, 9, 61,192,192,201, 10,245,242,251,181,174, 71,196,148,241,
+192, 74,219,247,143, 25,101,101, 88, 83,109,158,100, 32,143,231,159, 20,183,140,231,245,116,231,222,179, 3,236,178,194, 18,160,
+158, 67,240,159,214,231, 63, 8,200,245,230, 7,246,107, 16,183,233,171,125,220,148, 41, 94, 26,193, 82, 72, 56, 30, 24, 42, 25,
+ 7,182, 93, 82,127,254,159,144,211, 69, 97,106,138,152,227, 83,176,254, 38,222,238,150,252, 15, 81,139, 78, 53, 68, 46, 72,176,
+ 83,107,124, 58,253,247,191,243,198,113,108,211, 19,227,169,194,215, 63,134,203, 99, 5, 93, 27,101,146, 22,246, 14, 62, 37, 45,
+242, 7,255, 0, 71, 91, 55,104, 83,196, 88,200, 91,141, 21, 62,226,125,225,196,142,201,144,233, 1,182,178,161,208, 1,200, 7,
+158, 18,112, 52,218,218, 20, 34, 11, 72, 82, 48,167, 29, 66, 86,162, 9, 37,168,227,198,115, 36,249,169,100, 15,158,126,122,216,
+ 74, 93, 56,165,176,160, 48, 80,160,230, 79, 96,234,193,228, 24,207, 80,150,250,245,243, 58,216,145,194,132,133, 59,122,123,247,
+233,252, 61, 58,123,176,171,188,113,197,169,205,134,223,126,214, 23,251,250,216,250, 19,223, 23,184, 45, 45, 45,164,250,130,146,
+ 81,130,165, 58, 79,198,161,205,211,205, 71, 39, 29,135,217,171,242, 82,161,202,146, 14, 66, 64, 79, 92, 18,112, 18,132, 16, 7,
+ 82, 71,151,110,167,174, 79, 64,225, 49,204, 6, 74,148, 8,194, 60,151,142,203, 80, 0,244,206, 50, 62, 95,110,173, 87,197, 93,
+ 84, 74, 17, 76,101,242,212,170,171, 93, 62,154, 51,254, 77,126, 25, 50,166, 56,148,245, 8,102, 57, 81, 78, 59,184,180, 13, 2,
+252,184,139,157,194,142,158,167,111,226,127,215, 17,237, 18, 87, 87, 69, 75, 8, 13, 45, 67,233, 30,130,251,146,127,194,160, 22,
+111, 64, 9,233,134, 94,191, 60,214,174, 57,178,155, 80, 92, 88,138,250,178, 34,146, 73, 75,205,197, 89,247,133,181,215,245, 87,
+ 40,172, 41, 93,185, 91, 30, 93,117,113,101,178,148, 36, 20,167, 60,185, 33, 32,115,124,125,242,123, 32, 17,235,228, 58,103, 58,
+ 6,155, 5, 49,217, 1, 3, 41, 72, 72, 43, 80,202,251,124, 13,167, 57,231,230, 87,116,142,188,202,202,181,122,119,157,164,242,
+182,128, 48,114, 74,210, 29, 82,148,174,231,149, 4, 14,112,122, 96,156, 36, 12,232, 82,130, 20, 22,181,207, 83,241,235,252,127,
+134, 38,117,241,198,136,144, 66, 60,145, 40, 65,126,182, 80, 5,205,187,158,167,191,125,177,107,145,209, 56, 56, 42,192, 31, 7,
+ 50,136, 81, 39,245,114, 6,113,145,215,212,143, 62,186,109,183, 18,195,178,183, 58,203,185,118,235,114, 45, 74, 13,245, 98, 93,
+244,185, 20,123,178,204,185,224,179, 84,161,215, 41,210,208, 90, 83, 50,227,188,143,209,202, 66, 15, 51, 50, 26, 45,202,140,234,
+ 80,244,119, 91, 90, 65, 46, 20,133,132,149, 18,121, 66, 82,146,158,167,227, 3, 9, 11,231,233,205,133, 28,116,233,240,231,231,
+171, 4,167,130,146, 70,115,130, 7, 41,230, 1,190, 97,133,140,168,119,230, 25, 87, 47,167, 66,115,128,228,164, 50,233, 32, 21,
+ 35,161, 23, 7,226, 15, 81,234, 45,238,196, 78,170, 0,218,129, 93, 72,247, 12, 8, 22, 32,141,193, 7, 98, 10,220, 16,110, 45,
+112,118,216,254,127, 62,215,111,101, 5,107,129, 75,173,157,208,218,223,173, 46,126, 22, 47,170,217,166,219, 21, 73,139,114,161,
+ 95,218,219,154, 98, 29,148,206,220,223, 83, 66, 63,194, 24, 91, 77,191,245, 45, 81, 88, 76,246, 99,150, 29,196,198,148, 28,226,
+ 11,202,192,207,250,185,206, 65,252, 7,207,183,227,175,213, 99,121,118,187,111,119,183,109,239,125,163,221, 75,114, 53,215,183,
+ 27,137, 66,147,110, 93,212, 9, 73, 66,132,168, 18, 70, 89,155, 1,197, 28,211,235,208,230, 33,137,116,249, 72, 41, 92,105,113,
+154, 90, 84, 7, 50, 85,249,178,113,225,194, 13,235,193, 55, 17,215,238,197, 93,238,191, 80,167, 82,159, 69,111,111,238,242,201,
+110, 45,251,182,117,197,186,245,165,117,196,233,203,239, 75,138,218,226,212, 26, 24, 84,122,141, 58, 75, 74, 74, 64, 71, 51,238,
+ 85, 86,192,138, 57,152,176,223,150,204,110, 72, 29, 81,137,234,203,216,159, 51, 46,237,118, 86, 99, 65,113,143, 12,174, 75, 50,
+215, 81, 41, 25,101, 83,105, 43,215,145, 46,237,160, 27,127,116,226,230, 50,126,201, 86, 67, 97,203,213,166, 30, 57, 89, 86, 50,
+ 57, 63, 91, 35,175,110,154,250,115,156,144,122,249,254,255, 0,158,190,132, 99,161, 63, 14, 7, 46, 51,204,122,121,244,234,117,
+245, 72,229, 29, 50,113,234,114, 6,127,226, 52,254, 46,118,196, 36, 11, 11,116,192,142, 40,231,160, 24, 29,207,175,231,166,135,
+ 82,137,238, 64,232,124,241,143,179, 68, 44, 19,211, 24,237,156, 99,160,245, 31,126, 52, 50,128,235,212,121,128, 78, 49,215,207,
+246,105, 68, 59, 91,211, 6,181,253,109,251,240, 59,128, 1,240,171,174,122,121,121,246,207,159,246,104,101,244,200,243, 35,246,
+ 1,147,162, 21,140, 28,140,254,113,161,148,112, 8,235,215, 56,237,248,125,154, 85,112,176,189,136, 39, 3,168, 0, 15,145, 62,
+ 99,204,143, 35,249,242,208,203,229,235,235,211,242,126,225,162, 87,140,117,249,224,122,159,158,135, 88,233,231,247,118,251,254,
+237, 44, 58,142,248,193,237,183, 67,243,247, 96, 69, 12, 31,183,175,217,165,175,171,198,113,140,126,255, 0,187,241,210,210,202,
+ 77,133,197,207,221,131, 99,202,112, 72, 7,242,117, 92, 15, 35,128, 60,190, 67,250,245, 69, 3, 39,236, 25,209, 40,239,246, 15,
+207,219,164,143,175,174, 6, 42,164,124, 64, 14,131,166, 15,207,236,243,242,209, 35,215, 56,198, 62,220,124,191, 62,122,164,143,
+ 51,208,255, 0, 72,235,253, 31,213,170,160,100,227, 56,233,145,243,252,254,237, 17,175,109,186,223, 3, 4,160,140,231, 62, 93,
+207, 79, 77, 22,130, 49,143, 63,233,251, 52, 26, 72, 30, 64,143,179,183,217,162, 1, 74,146, 72, 61, 65,252,115,142,159,159, 93,
+ 35,140, 48,184,235,108, 20,140, 18, 1,239,158,135,203,239,209,169, 7,166, 14, 79,145,253,186, 1,158,132, 17,149, 14,196, 19,
+140,124,243,251,180,122, 72, 79, 76,145,211,160,233,147,164, 9, 36,220,225, 54, 29,199,206,216, 33, 4,224,142,153, 29, 85,219,
+183,166,164, 73,236,110,220, 31,173,246,111,125,182,170, 68,175, 13,251,106,189, 68,191,169,177,199,196,183, 33, 84,227, 24, 21,
+ 2,134,250,229, 41,151, 17, 57, 35, 63,229, 6,117, 29,198,252,179,144,122, 1,230, 79,219,211, 93, 44,246, 85,110,228, 13,175,
+226,214,210,164,215,229, 24,246,198,234,192,168,237,157, 95,227,228,108, 75,174, 32, 59,111,188,224, 39, 4, 38,172,195,104, 4,
+246,247,157, 70,120,186,135,219,242, 26,232,130,234,146, 37,230, 46,215,221, 14,166,255, 0, 32, 97,247,226,198,240,131,136,227,
+225, 95, 18, 56, 87, 54,157,180, 83,123, 64,167,148,237, 97, 29, 72, 48,220,223,107, 43,186, 57,255, 0,166,248,146, 36, 30,101,
+188, 76,200, 92,160,148,190,196,228, 14, 82,218,114, 10, 92, 8,242, 87, 93,108,205,136,136, 94, 60,105,208,170, 83, 26,151, 9,
+191, 29, 82,222, 74,157, 92,231, 64, 7,195, 90, 79, 64,192,244,244, 26,103, 63,131,149,104,117, 26,148, 68,184,195,109, 83,228,
+173,134,209, 44, 2,226,202, 22, 82, 16,178, 79,234,114,242,159,179, 79,213,149, 33,113, 88, 77, 61,112, 27,121,229,248,106,149,
+ 58, 39, 41,101,148, 19,213, 63, 32, 79, 66, 62,237,115, 51,211,150,121, 6,155,219,175, 91,109,181,133,253,226,219,123,241,235,
+ 75,241, 11, 79, 76,188,137, 11, 48, 93,149, 89,118, 13,107,151, 89, 1,176, 11,212, 3, 98, 79, 75,219, 27, 67,183,181, 74,244,
+214,231, 56,229, 74,158,135, 38, 41, 14, 18,160,166,156, 74, 16,156, 36, 32,118, 65, 62,159,191, 89,190,241,113, 11,110,112,191,
+176,215,206,245, 95, 6, 20,202, 61,145, 74, 92,138,101, 45, 18,130,100, 92,247, 68,212,150, 40,116, 70,185,198, 84, 94,156,164,
+120,132, 3,202,211,110, 40,118,198,137,219,165, 83,139, 76,133, 80, 28, 90,114,210,212,240,109, 10,241, 74, 15, 76,167,253, 94,
+159,126,117,202, 47,164, 21, 92,174, 69,225,135,102, 32,209,169,178,160, 90,181,125,216,152,229,206,180, 71, 8,142,167,224, 81,
+ 11,148,102, 36,173,177,132,143, 17,201, 42, 66, 85,208,148,156,117, 26,113,203,168, 3, 58,157, 54,103, 33,125,118, 36, 94,196,
+237,222,227,213,182,195, 70, 89, 79, 69,197, 92, 91,144,112,245,125, 61,168, 43,234, 1,157,252,177,147, 20, 49, 60,207, 26,149,
+ 58,245, 75, 28, 77, 18,149, 55, 93, 87, 27,139,227,130,123,191,198,175, 16, 27,247,184, 53, 45,208,191,119, 70,231, 85, 90,163,
+ 41,199,233,180,154, 61,106,117, 46,133,107,211, 84,247, 52, 26, 77, 22,153, 17,228, 34, 20,118, 27, 40, 72, 87, 47, 57, 41, 37,
+106, 42, 36,235,167, 28, 15,251,109,119,107, 98,106,116,123, 7,136,169,179,119,107,102, 31,113,136, 72,172, 74, 90,101,223,214,
+ 83, 75, 33,180, 78,165,212, 93, 60,213,120,109,143,137,113,159, 82,138,146,217, 13,173, 11,198,163,142,186,235,108,188,164,169,
+213,165,121, 56, 0,143,231, 19,148, 16, 58,242,145,159, 46,186, 6,109,204,220, 84,151,229, 73, 75, 76,165, 69, 13,186,181,124,
+ 13,149,252, 65,167, 20,122, 32, 43,175, 41, 61, 51,208, 28,156, 25, 60, 92, 63, 80, 37, 67, 1, 49, 19,208,129,189,141,182,255,
+ 0, 21,246,184, 55, 7,184, 56,236,142, 32,151,195,140,255, 0,133,223,133,248,147,134,104, 42, 50, 10, 88,196,113,162,172,112,
+123, 24, 69,210,178, 83, 74,129,100,164,145, 7,247,111, 27, 39, 75, 54,164, 44,167,244, 98,220,125,244,218,109,207,181, 44, 93,
+211,218,219,134,218,187, 42, 87, 53, 36, 51, 69,220, 10, 51, 17,100, 76, 69,191, 35,149,215, 40, 82,159,113, 5,234, 52,228, 57,
+209,198, 86, 27,121,151, 16,161,243, 44, 38,219,240, 59,195,109,247,187, 50,119,219,118,236,200,251,153,118, 75,170, 65,173, 67,
+182,174,118,154,153,103,210,171, 16,188, 32,197, 90, 69, 61,192, 77,102, 97, 83, 13, 41, 94, 54, 91, 36,117, 74,129, 58,135, 95,
+ 6,188,107,223,252, 45,110, 43, 52,233, 52,170,149,203, 96,222, 20,101,215, 83,103, 60,250,190,174,187,227,193, 5,199, 38, 91,
+143, 44,148,196,174,178,208,123,149, 72,234,165, 37, 41, 87, 50, 84, 70,166, 95,193, 71, 19,251, 57,196,190,221, 82,183, 35,102,
+111, 8,119, 37, 13,224,211, 21,170, 59,206,165,155,154,207,170,129,201, 34,143,114, 82,138,185,226,186,219,193, 72, 75,184,240,
+221, 9,202, 85,215, 26,134,231,185, 70,123, 75,158, 38,105, 42,145, 71,202, 88,163,146, 50, 90, 29, 18, 16,197, 88, 92,133,119,
+146, 38,219,245,140,108,190,102, 70, 11,198, 92, 75,194, 16,120, 95, 13,105,224,204,246,176, 46,111, 21, 85, 20,213, 74,239, 79,
+ 89,200,142, 74,121, 30,138,165, 99, 8,209,242, 82,106, 70, 89, 32,229,195, 52, 53, 48, 77, 24, 84,168, 68, 26,105,237, 7,217,
+ 19, 64,220,153,215, 20, 88,210,156,133, 88,145, 38,124, 79,119,101, 69,163, 18,166,128,243,109, 37, 40, 1, 44,161,169, 41,117,
+174,100,245, 74, 25, 74, 0, 3, 3, 90, 51, 69,177,226,173,138, 60,234,204,122, 85, 38,221,129, 41, 51,103,211,161,176, 94,110,
+ 91,208,250,114, 84,204,148,115, 56,210,150,121,194, 65, 70, 22, 18, 73, 35, 82, 72,226, 42,210,160,110,117,160,197,162,168,115,
+ 29,188,213, 74,168, 86, 45, 9, 77, 65,126, 76, 10,156,120,126, 17,171,208,229, 78,105, 60,176,167,150, 84,151,226,161,194, 60,
+101, 71,113,182,200, 89, 26,226, 82, 54,226, 82, 43,245, 56, 55, 19,146,165, 82,168,173,189, 53,234,122,121,219,167,174, 92, 53,
+ 21,161,215,162,173,172, 60,148, 33, 24, 82, 73, 88,113, 92,185,201,201, 27,117,108,244,241,194, 26, 80, 4,200,175,177, 5,212,
+177, 33,144,129,246, 88,144, 74,234,211,113,184,242,225,135,128,248,146,174,159, 42,143, 44,172,115, 72,249,120, 15, 20,146, 35,
+ 63, 50,152, 72,218, 26, 20, 93,164,179,172,144,173,201, 8,234, 67,105,179, 12, 29,182,244,136,190,236,139,162, 43,211, 44,218,
+ 8,144,234,232,245, 56, 11, 17,235, 21,134,156,116,152, 20,134, 80,176,164, 56,209, 72, 43,143,200,135, 22,133,101, 74,113, 57,
+214,238,237,187,251,130,203, 76, 67,151, 72,167, 84, 98,133,170, 91,213, 42,148,233, 12, 76,138,192, 82,148,219,210, 68,113,202,
+170,138,219,193, 89, 73, 67,106, 72, 42, 40,200,248,181,222,133, 7,252, 38, 61, 94,168,236, 48,218, 34,198,106,222,121,215, 12,
+ 42, 5,177, 73, 72,109,202,131, 44, 54,165, 4,166,172,236,131,241, 5,128, 23,219,155,149, 1, 39,109, 54,169, 47,214,159,141,
+ 78, 48, 42, 53, 11, 73,106,126, 99,142,173,244,196,145,119,169,196,182,166,100,201, 84,167, 3,137,162,161,194, 72,100, 6,202,
+154, 9, 82,143,134, 60, 50,195, 58,115, 25,121,138, 2, 2, 5,250,155,236, 2,134,216,220, 95,168,238, 13,133,186, 73,115,220,
+216,213, 80, 74,207, 75, 13, 76, 72,128,234,144,106, 49, 40, 80,161, 99,149, 74, 52,149, 4,141,198,181, 87,112,116,142, 90,187,
+151,130,212,169,221, 85,192, 81, 71,162, 69,143, 17,233,177, 66,234,213,121,210, 29,109,249,104, 83,136, 47,211, 99,197,142,149,
+ 42, 58, 27, 13,132,100,161, 42, 4, 36, 14,234,214,192, 82,168,207, 6,100, 72,146,243,115, 36,115, 37,223,120, 83, 66, 40,134,
+150,151,200,182,225, 67,103,224,109,191, 19,152,143,214, 95, 97,205,166,202,221,175,203,122,100, 42,117, 14, 27, 48, 96, 45,217,
+109,187, 93,144,132, 73,164,149, 65, 11,113,200,212, 8,170, 80, 21,149,224, 37, 41,120,242, 70, 10, 10, 9, 83,160, 99, 78, 43,
+116,232,146, 18,162,237, 86,169, 54, 43, 79, 52,133, 63, 42,172,182,163, 42, 83,190, 32,120,165,166, 16,210, 27, 75, 65, 69,178,
+ 18,158, 64,162, 82, 50, 81,157,111, 81, 68, 21,129, 8, 22,227,101,189,237,123,109,114, 1,185,236,109,232, 47,107,226,137,226,
+141, 77, 41, 30,203, 30, 87, 20,158, 96,168, 26,121,138, 19,111,172,118,118,179, 18,159,221,137, 20, 88,110,150, 85,193, 53, 73,
+145,226,170, 46,101,196, 76,164,184, 28,240, 12,134,153, 95, 43, 10, 74,155, 46,181,207,144,121,194, 7, 62, 9, 82,143, 47,108,
+234, 4, 62,210, 58, 72,219,158, 58,184,155,183, 37, 40,183, 29,237,225,189,234, 44, 58, 57,127,200,220,181, 35,117,198, 37, 8,
+ 56,229,118,159, 89, 74,128,242, 87, 67,131,157, 78,142,170,138, 83,209,158, 69, 30, 52, 6,160, 54,228,136,114, 46, 38, 99, 50,
+181,206,146,133,248, 78, 67,166, 72,113, 37, 82, 16,149,149, 37,199,134, 91, 66,242, 26, 11, 88, 90,147, 16,207,164, 3,178,234,
+161,113, 5,183,251,173, 73,167,134,104, 59,189, 97,210,168, 85, 9, 52,211,200,236, 43,223,109,162, 38,218,168,185, 41,231, 21,
+137, 21, 23,168, 70,202,152,128, 87,226, 56, 92, 95,235,114,171, 51, 28,157, 98,150,190, 8,100,110, 92, 83,221, 79,199, 69,239,
+185,177,177, 27, 15,128,189,142, 45, 63,163,127, 17,212,112,127, 20,113, 29, 53, 38,185,106,243,156,177,196, 81, 58,133,230,212,
+ 82, 85, 83, 84, 44,108,169,172,160, 52,166,171, 97,169,163, 3, 91,114,200, 24,226, 4,154,196,244,219,106,220, 88, 18, 36,123,
+230,213,238,117, 58,151,184,116,120,110,184,212,168,118,117, 66, 76, 20,196,186,144,180, 43,157,136,145,234, 12,197, 91,146, 81,
+132, 70,114, 83, 75, 43, 75,110,100, 74,151,217,207,198,213, 39,137, 54,238, 61,133,221, 10,180, 42,127, 21,123, 72,167,219,169,
+193,146,168,241, 90,223,139, 2, 44,118,170, 52, 45,207,178, 66, 74, 81, 80,184, 88,183,166,211,141,199, 76,103,157,106, 33, 53,
+232,129,216,210,102,162, 20, 59,161,215,121,234, 81, 43, 84, 91,170,177,103,222,204, 45,171, 98,241,138,155,114,161, 89, 69, 74,
+148,180, 59, 78,143, 92,122,151, 17,151, 83,112, 82,132, 69,184,196,200,129,133, 59, 38, 25,125,133,176,243,141,180,149,244, 87,
+132,222, 13,248,140,184, 47,203, 39,113,120,121,171,199,191,238, 93,185, 98, 53,251,111, 91,251, 99, 85,166,215,175, 87, 41,240,
+ 42,241,155,165,214,182,154, 47,191, 41, 91,145,104,211,234, 42, 83, 92,148,103, 83, 85,163,199,117, 84,250,197, 33,136,225, 97,
+185,206,113,194,121,109,101, 27, 45,125, 80,163,171, 2, 95, 99, 38, 41,121,134,115,162, 78, 66,144,133, 38,141,138,205,202, 84,
+102,150,120,231,139,150,134, 90,104,163,158, 75,196,249,142,105,226,180,212, 89,118, 93,165,163,138,170,138, 74,220,202, 74,236,
+184,209, 80,208,200,239, 65, 46, 97, 87, 27,213, 71, 85, 72,252,182,203, 23, 53,133,225,134, 42, 12,195, 41,170,210,211, 69,154,
+203, 85,150,205,166,227,165, 61, 6, 5, 54, 97, 74,156, 18,227, 69,110, 35,140,180,165,169,249, 82,156, 67, 13, 71,138,218, 85,
+241,185,226,184,218, 91, 31, 9, 82,214, 50,122,244, 11,114,111, 27,114,131,182,251,199, 34,255, 0,136,154, 45,247,176,245, 58,
+ 22,218,111, 22,216,181, 81,143, 85,184, 45,221,195,188, 89,183,161, 89, 20, 42,100,159,117, 96, 92,148,187,141,187,194,223,118,
+133, 84,102, 59,113,170, 72,126, 72,105, 41,114, 12,164, 55, 75, 99,119,122,224,174, 51,245, 7, 19,219, 89,112,112,215,186,220,
+ 60,220,144,175, 61,215, 77,193,108, 87,174,237,159,151,101,211,226, 77,189, 33,110,173,151, 93,162, 70,144,154,221,142, 81, 76,
+164, 63, 80,165, 60,241,153, 77, 68,215, 72,114,100, 8,147, 31,135,146,113, 71,183, 59,103, 34, 92, 13,253,110,235,173,110,165,
+205,184,176,173,202,147,143,193,221, 91, 86, 92, 45,209,191,156,186,104, 59,129,181, 86,205,199,245, 20,121, 48,102,109,181,175,
+123,214, 32, 86,104, 82, 40,181, 28,208,209, 13, 52, 53,191, 38,135, 86,101,109,214, 19, 84,229,188, 53, 74,207,159,161,161,167,
+175,150, 56, 86,121,140,113,211, 67,100, 55, 51,107,101,157, 73,146, 72,180,145, 11, 42,168,147,153,162,197,146,162,201, 56,112,
+210,113,141, 46, 79,196, 20,245, 18, 53, 58,173, 84, 67, 46, 95,106,106,245, 73, 41,170, 2,208,207, 24, 52,245, 80, 86, 80, 37,
+ 72,165,150,158,114, 90,122,170, 9,135,212,151, 87,227, 20,104, 45, 87, 24, 85, 86,218,241, 42,148, 71,110, 43,170,211, 76,212,
+ 52,150,132,106,245,151,114, 85,109, 11,162,129, 84,104,168,251,149,106,157,112,209, 42,113,229, 48,188, 58,218,227,142,108, 33,
+ 77,169, 90, 21,237, 94,168,222, 22,133,223,195,254,202, 10, 93, 82, 93,177,180, 43,183,183,154,236,164, 81, 20,153,146, 98,238,
+125,229, 73,129, 91,163,213,175,116, 52,191, 22, 53, 66, 29,188,253,173, 71,167, 81, 57, 76,150,133,213, 81,149, 33, 81,220,148,
+211, 74,150,182,225,218, 92, 50,112,247,195,165,153, 77,165, 90,219,117, 99, 91,150, 60, 43,174,244,174,223, 49,109, 27,134,228,
+218,202,205,255, 0,107,212,149, 18,116,251,243,114,104,207,201,168, 51,121, 72,220, 7,211, 38,169, 13,184,115,170,215,251,244,
+217,244, 88,238, 70,155, 37,169, 49,121, 20,212, 93,185,118,222,225, 46,203,225,223, 98,183, 23,120,253,160,252,116, 84, 55,118,
+117,213,191, 91,223, 72,247, 69,219,219,105,184, 23,221, 98, 20,254, 44,230,237,204, 42,236,138,109, 42, 84,217,212,251,153,118,
+ 17,144, 93, 52,138,101,143, 85,175,174, 58,252, 58,125, 67, 79,254, 28, 54, 93,153,214,174,113, 79, 20,121,133, 44, 97,185,112,
+ 9,150,105,100, 73, 41, 86, 94, 92, 38, 35, 21,167, 43, 81, 29, 57,169,144, 44, 20,142, 37,170,101,154, 49, 70,106,111,238, 14,
+168,151,137,248,115,244,207, 19,210,215,101,116,144,212,140,186,131, 48,134,146, 36,164,139, 59,164,121,107,219, 53,204, 26,181,
+229,163,139, 38,160,162,201,235, 36,205,169, 85,235,234,125,154,190, 36,140, 9,162,154, 90, 72,169,213, 45,253,208,118,151, 97,
+ 90, 91,181, 38, 13,167,103, 94,215,213,102,231,174, 55, 49,215, 31,172,238, 77,247, 17,216,119, 14,228, 45, 49,233,233, 9, 77,
+ 46, 21, 66, 69,159, 70, 41,134,135, 99,193,140,211, 84,180,200,231,102, 82,155, 18,155, 83,131,120, 85,111,219,154, 3, 50,105,
+148,169, 19,160,193,160,214,170,113,194,103,214, 98,211,229,168,183, 62,159, 72, 66,178, 89,147, 84, 14,152,173,252, 45,248, 13,
+ 54,178, 84,149,147,169,133,123, 64,189,146, 86,255, 0, 13,187,109,182,187,145, 64,219,248,219,185, 14,215,178,234,116, 13,218,
+222, 42,148,217, 2, 53, 42,184,204, 22,226,237,117,131, 14,206,132,240,114,194,225,222,157, 83, 53,138,149,106,161, 29, 14, 73,
+171, 86, 42,171,153, 89,124,169,230,121, 34,177,182, 91, 65,116,111, 46,243,196,218,253,171,247,251,206,183,116,213,106,146,228,
+110, 45, 77,182, 89,136,139,118, 28,148,197,186,119, 9, 54,243, 47, 6,109,107, 54,152,143, 26, 45, 38, 35,139,255, 0, 5,141,
+ 9, 78,190, 85, 41,232,140,170,115, 83, 86,212,245, 25,140, 21,212, 63,162,231,161,141, 36,125, 43,202,166, 45, 35,172,211, 73,
+ 10, 63,152,169, 40,176, 6,149,220,186,195,120,162,104,238, 34,191,184, 15, 62,224,252,219,132,178,206, 51,225,190, 45, 60, 75,
+193,102,174,190, 55,168,174,180,249,164,116,185,109, 52,249, 86, 93, 75,153, 84,195, 32,246,103,141,107, 43,115,158, 82,101,249,
+ 74,150,205,227,150,183, 49,167,173,118,253, 35, 52,143, 98,189, 5, 54,159,179,243,109, 77,101, 98, 4,221,196,190,119, 71,112,
+ 90,102,181, 21, 8,139, 91,164,212,174, 88,182,196, 10,140, 85, 56, 18,219,240,220,254, 9,200, 41,115, 33, 74,231, 82,146,146,
+218,155, 42,234,187,209, 27,163,184,237, 90, 72,168, 42,130,200,240,165, 64,143, 38, 82,158,160,173, 74, 13, 9, 84,182,157,124,
+ 46, 93, 57, 73, 90, 10,152, 73, 43,100,172, 41,160,180,115, 32, 49, 27, 9, 77,177,109, 93,139,217,139, 99,111,227, 72,143,183,
+214,214,217,218,118,173,163, 6,173,153, 19, 88,131,108,210, 99,208,101, 65,174,135, 83,148,212,157,159, 79,150,244,181, 20,148,
+123,204,229, 43,177, 57,114,208,124, 17, 57,202, 83, 14,170, 36, 5,137, 85, 10, 36,185, 75, 84, 55, 96,202, 71, 42,132,120,171,
+113,106,241,219,116,146,219,173, 15, 11,186, 85,148,168,114,194,132,136,200,173, 31,158, 54, 80, 65, 3,168, 34,224,129,232, 65,
+213,184,220,116, 23,199, 0,113,150,101, 55, 20,241,127, 20,113, 19,235,165, 25,245,125, 85, 67,198,196,108,179, 84,182,152,185,
+133,129, 73,145, 89, 34, 14,220,203, 72, 8,103,229,150, 86,247, 81,110, 91, 49,167, 78,161,215, 37,212,219,113,213,165,218, 85,
+ 69,240,244, 26,132, 54,129, 11, 49,228,181, 29, 46, 66,168,140,245, 75,156,193,124,161,183, 27, 28,201, 86,190, 81,155,125,104,
+135, 34, 12,114,220,121, 41, 40, 98,157, 53,228,170, 35,114, 20,230, 86,221, 26, 80,200,167, 40,169,103,158, 59,169, 8,202,112,
+128,131,144, 60,211,163, 71,152,183,230, 83,229,191, 4,133,169,153, 76,134,179, 60,198, 89,109,232, 14,212,225, 62, 86,221, 65,
+ 13,185,148,165,196,101, 78, 32,243, 37,209,130, 19,153,208,146,134, 81, 41, 19, 11, 49,214, 86, 24,121,165,178,165, 69,168, 40,
+ 31,135, 1, 64,169, 46,149, 41, 36, 40,254,144, 5, 36,146,188,100, 38,134, 48, 25,152,141,172, 46, 77,136,220, 27,250,141,253,
+222,226,122,130,193, 89, 80, 41,169,164,139, 72,146, 84, 43,112,200, 85,236, 84, 40, 87, 84, 1, 94,219, 21,144, 93,244,155, 22,
+ 69,101,209,125,183,168,209, 97,190,250,204, 70,152, 5, 64,200,140,166,150,203,176, 87,241,151, 94,136,160,178,134,218, 89,230,
+ 82,128,202,114,162,164,100, 2, 53, 28,111,107, 60, 59,251,143, 63,104, 23, 11,126,205,170, 3, 53,106, 46,201,109,173, 53, 27,
+255, 0,189,117,166,249,216,137, 90,147, 49, 18,105,172,202, 66,146,174, 71, 98, 81, 45,102,106, 49, 24, 42,193, 53,155,189,229,
+160, 5,197, 73,215,123, 47,141,211, 98,142,167,173,155, 89,193, 42,229, 25,106, 76,148,165, 47, 71,180, 91,112, 5,120,181, 23,
+ 14, 83, 34,182, 58,174, 44, 18,162,180, 43,149,249, 92,173,165, 40,113,184,160,218,118,243, 51,158,189,219,161, 64, 93,228,170,
+ 58,109,137, 55, 99,177,210,229,194,253,186,103, 61, 86, 93, 46, 69, 85,196,248,174,194, 85, 90, 68,169, 42, 65, 86, 20,243,235,
+ 89,234,113,167, 76,190, 73, 36,154, 36, 66, 2,174,204,196,216,168, 96, 86,235, 97,187,142,171,113,179, 0, 79, 96, 43, 78, 39,
+200,167,207,168, 64,172,169, 48,195, 60,176,243, 35, 59,153,169,213,129,145, 9,184, 40,178,128, 35,189,201,120,217,238, 72, 33,
+152, 74, 45,191,110,218, 20, 10, 5,159,104, 82,163, 80,109, 43, 50,145, 78,182,173,138, 20, 36, 37,152,116,202, 37, 38, 58, 33,
+ 65,136,219,104, 24, 24, 97,176,165, 43,186,214,165, 45, 89, 82,137,214, 66,192, 44, 56, 50, 64, 66,255, 0, 84,246, 74, 22,174,
+188,167,230, 79,109,121, 92,114, 87,226,132,243, 5, 16,162,145,156, 45, 62, 69, 56,238,161,231,246,106,239, 2, 58, 29,109,109,
+140, 45, 4,158,231,170, 65, 29, 58, 31, 49,251,181, 41, 93,150,200, 52, 42,216, 5,236,161, 64, 0, 1,233,167,107, 95,107, 15,
+118, 6,132,133, 20,133,242, 45,129, 0, 88, 1,181,128, 29, 5,187, 14,150,219,160,198, 15, 92,140,185,115,138, 64, 42, 71,192,
+ 48, 51,148,245, 42, 81, 7,237,199,237,198,179, 75, 74,130,162,174,110, 64,124, 66, 48,124,213,215,155,149, 64,142,249, 35,240,
+215,148, 83, 60, 73,124,161, 36,156,132,103,190,121, 71, 64,125,124,254,243,173,128,177,237,177,134,150,166,134, 7, 42,186,224,
+143, 44, 12,121, 14,154, 67,202,160,201,111, 49,218,255, 0, 63,127,239,196,120,213, 0, 90,237,117,185, 55,251,239,238,249,252,
+ 47,182,197,185,224,181,226,148, 36, 57,202,148, 5,148,228,167,152, 5, 58, 79, 79, 76, 14,157,180,226, 8,126,236,203,104,229,
+ 60,234, 39, 41, 0,168,144,160, 20,178, 64, 31,173,203,129,242,206,178,138, 93, 27,145,148, 5, 35,225, 35, 39, 61,212, 7,196,
+ 78, 60,251, 1,143, 61,123,145, 19,153, 69, 69, 4, 41,106, 8, 66, 83,212,227, 32, 37, 32,103,190, 59,159, 85,124,134,144,177,
+221,137,249,239,127,225,134,106,140,228, 77, 49,141, 79,213,198,127,211,243, 54,237,139, 84,118, 89,109, 14, 61, 41,212, 70,139,
+ 13,135, 37,204,148,176, 18,212,104,172, 36,184,227,206, 40,246,108, 37, 56,249,146, 7,158,181,250,179, 86,126,239,172,200,171,
+165,165, 49, 78,105, 40,133, 70,101,239,129, 48, 41,109,171,225, 88, 0,126,146, 83,234,203,139, 61, 57, 66,130,124,177,167, 30,
+243,170, 10,151, 53,173, 13,126, 37, 62, 51,173,185, 94,117, 25,228,155, 49,165, 7, 24,164,151, 19,254, 82, 35, 74, 8, 47, 36,
+116, 83,129, 32,146, 1, 26,196,209, 13,152,192,120,189, 72, 36,248,109,160, 56, 2,128, 5, 63,163, 79, 92,103, 3, 39,160,236,
+ 58,233, 61, 70,161,194,166,241, 70,119, 63,180,195,227,217,127, 22,248, 41,196,175,135,160, 90, 56,228,204, 39, 66,107,106,150,
+209, 41, 6,241,194,108, 75, 91, 99,174, 91, 3,191,217,140, 1,191, 54, 69,192, 76, 50, 27,111, 13, 54, 73, 64, 9, 75,139, 82,
+155, 0, 43,169, 44,128, 9, 62, 93, 64,193, 61,206,129,152, 95, 41, 82,138,208, 22, 65, 72, 12,164, 32,165, 0, 36,148,163,152,
+144,217,234,147,145,223, 36,228, 96, 13, 93,159, 83,174,103,149, 32, 40,182,126, 55, 51,206,132,145,201,240,161, 7, 35, 62, 99,
+ 32,129,158,249,214, 55, 45,212, 37, 96, 41, 41,120,167,152, 0,148, 0,129,149,167, 39,148,225, 32,224,247, 61, 71,166,116,224,
+158, 91,109,185, 27,219,231,253,127,117,240,237, 35,179,146, 77,153,143,253,199,183,115,176,223,225,139, 75,238,163,147,144, 21,
+ 40, 96,142,116,142,164,165, 71,170,222, 82,187, 31,136, 4,140,243, 1,229,215, 88,252,183, 65, 72, 11, 82, 74,126, 16, 8, 28,
+184, 82, 72, 9, 66, 86,188, 18, 18,124,176, 62,100,224,157, 92, 39, 56,224, 82,146, 23,204,162,174, 95, 9, 9, 79, 55, 83,240,
+ 40,169, 64,252, 33, 36,252, 92,160,245,192,214, 45, 49,208,142,112, 21,241,171,170, 65, 78, 85,128, 50, 82, 74,129,229, 60,160,
+143,187,169,234, 53,176,135,175,112, 15,243, 31,187,175,201,195, 45, 82, 13,247,235,252, 62,255, 0,187,182,253,175,139, 84,247,
+ 82,160,163,130, 9, 39, 36,167,159,175,196, 10,138, 66,176, 19,215,191,145, 57, 25,215, 6, 61,188, 92, 35, 69,226, 19,132,201,
+ 91,199,110, 82,195,187,161,195, 10,102, 93,241, 28,140,192,126,125,115,105,170, 47, 48,214,226,219,142,184,128, 86,242, 33, 44,
+195,173,196, 64,207, 34,224, 76,242,116,235,186,178,222, 24, 37, 41, 81,237,144, 82,160, 20, 48, 84, 0, 3,162,199, 82, 58,245,
+ 31,127, 70,250,191, 79,164,215, 96, 84, 40, 85,216,173, 79,160,215, 96, 84, 40, 53,232, 14,182,151, 35,203,161,214, 98, 61, 73,
+173, 66,121,165,116,117,135,105,115,166, 54, 71,126, 85,224, 28,246,216, 14,203,105, 35, 63, 89, 25, 12,191, 17, 98, 47,238, 61,
+ 15,184,145,176, 59,197,243, 92,186, 44,214,138,175, 46,156,218, 42,180, 41,114, 7,145,137, 5, 36,183,172,110, 22, 65,210,229,
+109,238,199,229,128, 82, 2,137,239,143, 49,212, 31,152,199,126,154,248,172,145,219,166, 51,147,251,191, 13, 61,188, 74,237, 67,
+251, 7,196, 22,245,108,212,198, 21, 21, 91,103,185, 87,117,161, 21,133,168,173, 72,164, 83, 42,242, 5, 1, 65, 71,170,194,232,
+ 46, 83, 92, 10,235,144,230,114,115,146,198,169,106, 88, 4, 43,155,166, 71, 76,119,245, 30,186,153,211,202,179,197, 12,202,124,
+178,168, 97,235, 98, 1,254,120,230,119,142, 72,157,226,149,116, 75, 17, 42,227,209,212,233,101,251,152, 17,138, 46, 16, 70, 51,
+235,156, 28, 99,251,116, 42,177,142,195,148,103, 30,125,187,147,243,213,117,168, 30,224, 12,142,248,206, 79,217,161, 87,208, 31,
+ 60,156,126,255, 0,221,173,192, 44, 0,244,192, 29,190, 56, 29, 89,193,233,255, 0, 14,253, 52, 34,142,113,223,207,184, 3,240,
+209,107,237,223, 29, 71,231,243,233,161,156, 32, 2, 51,147,231,142,191, 62,154, 85, 7,124, 42, 44,119,192,171, 35,203, 63,126,
+113,231,228,117, 69,125,179,147,255, 0, 31, 93, 87, 95, 55,158, 49,229,249,245,208,235,199,207, 62, 94,159,126,149, 2,228, 99,
+ 29, 0, 3,231,255, 0, 24, 21,103,175,216, 49,159, 93, 45, 37,254,183,221,211, 75, 74,139,128, 0, 31,142, 13,143,168,198, 79,
+124,227,238,199, 79,219,162,145,140,118,235,230,113,251,254,205, 8,223, 83,147,145,208,244,251,241,215, 69, 35,177,235,231,219,
+247,232,141,107, 47,108, 12, 18,142,199,167,223,235,249,253,250,169,158,221,250,124,254,126, 94,154,164,140,245,233,211,215,247,
+124,245,237, 36, 40,144, 15, 99,131,223,161,210, 78, 54,248, 96, 99,223,140,142,249, 24, 0,103, 25,202, 78,139,108,149,129,212,
+ 0,124,241,215,168,233,211,239,253,154, 16,180, 1, 56, 0, 36,228,159, 79, 44,147,243,254,189, 86,109, 65, 36, 14,184,198, 2,
+143,203,212,253,218, 64,155,117,192,193,237, 39,151, 3,175, 66,123,119, 63, 63,144,209, 8, 95, 51,137, 73, 78, 57,115,241, 30,
+221, 60,178,126,122, 8, 60,140,148,130, 85,216,224,117, 87,159,124,253,167,240,209, 63, 11,137,248,186, 28,252, 35,168,207,219,
+248,233, 22,234,113,131,235,243,233,139,187, 64, 43,162,136, 63, 49,147,235,233,247,106,247, 70,169,212,104, 85, 90,117,110,145,
+ 41,200, 53, 90, 68,248,117, 58, 92,198,148, 80,236, 90,141, 62, 75, 82,225, 74,109, 67,170, 84,137, 44,180,175,184,141, 88,152,
+ 10,229, 79, 96, 48, 57,177,219, 35,167, 79,219,162,211,156, 40,118, 30, 71,184,249,245,242,233,162,144, 24, 21, 97,112,118, 32,
+239,132, 15,196,169, 30,155, 16, 71,112, 71, 67,137,193,240,233,185, 20, 62, 44,120,124,219, 61,240,167, 76, 71,191, 84,105,140,
+ 81, 55, 14,155, 5, 64, 73,165,223,148, 54,155,135, 89,139, 53, 8, 57,103,197,121,191, 25, 25,253,100, 72, 65, 4,131,173,161,
+180,210,245, 40,183, 10, 44, 52,248, 14,171,153,247, 36, 40,150,208,211,100, 16,181,171,201, 93, 7, 79, 83,168,161,123, 40,248,
+226,137,194,214,237,191, 97,110, 76,199, 6,196,111, 20,202,117, 42,239,113,106, 82,155,179,174, 82, 83, 18,135,123,178,146,127,
+ 69, 25, 42,113, 12, 78,199,254, 43,149,211,158, 67,169,140, 46,220,104,182,207,128,184,210,104, 79,178,197, 70,159, 80,128,226,
+ 36, 70,171, 65,146,132,189, 18, 92,121, 77,168,165,248,174, 52,182,212, 10, 73, 7,155, 84, 39, 16,240,233,203,115, 25, 99, 88,
+201,130, 67,170, 35,216,169, 61, 47,220,173,244,155,247,243, 17,102, 24,239,143, 11, 60, 80,110, 39,225,218, 88,107,103, 15,152,
+229,170,144,213, 33, 98, 60,234, 0, 89,236, 55, 34,117, 93, 98,219,115, 3,198, 8,209,135, 82,196,175,212,218,113,133,198, 84,
+117, 38, 71, 32, 67, 78,101, 4,182,142,157, 7,255, 0, 22,125,124,255, 0, 13,121,226,147, 97,169,220,100,236, 45,251,195,253,
+214, 96, 83, 89,184, 96, 55, 58,221,184,156, 71,138, 45,139,210,151,207, 34,220,169,161, 93,196,113, 36,248, 82,113,221,137, 11,
+244,198,172,116, 62,102,100,181, 29,160, 61,231,149, 60,142, 99,224,101,164,246, 3, 29,128, 25,233,173,128,164, 74, 18, 99,198,
+ 73,116,183, 25,181,114, 60,178, 57, 76,151, 16, 50,162,162, 14,124, 60,129,246,235, 82,158, 2,165,118,210,203, 98, 45,216,245,
+190,219, 94,253, 7,223,139, 66,108,214,122, 57,232,179, 76,177, 18,150,182,141,214,104,102,243, 49, 73, 35, 33,209,244,220,171,
+217,133,180,176,210,230,225,188,151,199,230,211,196, 86,208,238, 55, 15,155,153,121,237, 22,231, 81,100,219,215,221,143, 82,149,
+ 79,168, 71,125,106,110, 52,230, 88, 90,132,122,157, 46,106,128, 76,202,124,136,220,143, 71,121, 63, 11,141,186,146, 8, 36,141,
+107, 90,238,137,210, 99,242, 84,194, 39,208,228,243, 69,156,165,101, 50, 16,209, 35,156,184, 17,212, 56,158,138, 66,198, 72,229,
+ 26,253, 19,125,160,126,206, 29,169,246,133, 88,112,226,214,219,129,100,111, 5,191, 18, 68, 91, 19,116,219,132, 28,148,220, 38,
+208,181, 53, 65,186, 99,180, 66,170,182,233,119, 30, 25, 39,198,138, 86,165, 50,121, 74,144, 97, 29,196,223,179,219,138,238, 14,
+171, 85, 42, 30,238,109, 69,202,253,158,137,146, 26,165, 95,150,229, 61,202,229,149, 91,134,219,133, 41,155, 18,173, 13,165, 6,
+ 91, 82, 48,172, 57,202,180,231, 5, 26,179,178, 42,250, 57,225, 72,106,149, 86,169, 74,233, 44,116,220, 29,175, 27,118,123,216,
+133,216,130, 59,142,146,250,158, 42,173,226,215, 74,204,190,189,178,218,167,133,214,182,141,111, 32, 18,142,242, 68,219, 84,208,
+202,162, 69,119,250,199, 68, 58, 38, 17,181,158, 86, 98,205, 98,245,184,155,179,246,190,133,117, 81, 43,212, 69,205, 93,107,111,
+171,201,247,180,220, 22,125, 75,170,221,143, 77,172, 67, 70, 41, 51,212, 66,147,225, 62,180,195,146,121,152,117, 41, 82,145,153,
+ 39,123, 14, 56,116,186,118,163,136, 57,119,139, 91,231,181, 82,105,117, 56,211, 85,187, 59, 81, 50,174,154, 46,225, 86, 41,142,
+178,236, 71, 96, 81, 44, 39,154, 15, 79,169,138,138,154,146,169,140,169,198,154,240,202,146,121, 8,214,156,123, 19,246,162,147,
+184,219,245,181,214,173, 74,157,114, 91,212, 68, 94,177, 46, 9, 87,209,164, 82, 35,166,152,213, 40, 26,147,148,152, 53,249, 12,
+182,135,161, 77, 92,118,163,188,212,150,221, 87, 43,171, 72, 10, 95, 41,212,194,248,217,224, 59, 96,239,203,211,110,184,157,163,
+220,219,119,195,142,224,236,189, 90, 53,199,112,238,141,180,213, 54,131, 86,184,173, 90, 80,241,158,162,204,105,137, 44, 68,247,
+146,216,120, 38, 83,136, 82,185, 95, 91,106, 14, 36,132,105, 42,177, 85, 95, 69,196, 84,180,235, 13, 45, 13, 59, 8,229, 63, 84,
+100,153,228, 44,254,209,101,229, 8,180, 29, 45, 34, 57,120,102, 98,238, 84, 54,248,177,115, 46, 32,224,110, 24,171,225,142, 26,
+226,122,217,198,119,199, 25, 21, 76,116,245,242, 71, 93, 93, 67,144, 67, 83, 72,217,122,208,154, 38,146,170, 74,254,122,137, 97,
+203,171, 80,123,126, 86, 13, 50,114,230,134, 52, 43,104,160,110, 52,106,229, 82,239,218, 10,165,197, 42,143, 92,155,112, 63, 79,
+182,109,170,172, 86, 42, 53, 42,212, 72,110,166, 83, 17, 83, 38, 18,137,166,133, 50,164,172, 60, 85,240,145,228,123, 92,248,153,
+225, 90,117,139, 14,223,186,217,144,212,184,247, 13, 37,217,245,234, 50, 30, 68,154,188, 47,118, 5,245,153, 13, 36, 5, 84,225,
+248, 64, 45,114, 16,133, 4,120, 5,183,210,145,135, 23,170, 17,120,166,246,122,210,239, 8,251,245, 73,221, 42,108,202,125, 54,
+ 85,110, 12,136,116, 25,110, 42,164,252,181,186,183, 36, 84,100, 71,157,200,243,176,212,251, 97, 40,154,128, 27, 80, 87, 42, 0,
+ 73,215, 28,248,248,246,138,238,223, 31, 27,209,100, 13,189,190,175, 61,174,217, 13,133,184,168,247,110,220, 46,215,168, 72,182,
+ 43, 50,175, 26, 23,136,134,174, 58,133, 66, 41, 14,213, 96, 61,144,143,113,148, 85, 17,198,121,155,117,149,165, 68, 30, 78,240,
+151, 41,171,203,168,248,214,139,140,242,218,147, 61, 39, 46,146,154,176, 74, 94, 58,115, 70,238,237,110,102,210,194,237, 49, 74,
+101,167,176,152,106,242, 71,253,233, 17,120, 7,226,111,137,188, 85,195,180,126, 29,112,252,188, 55,150, 71, 72,245, 89,147,103,
+144, 54, 91, 11,230, 13, 18, 65,236,212,236,144, 84, 78,202,220,184,170, 37,144,199, 57,137, 21,156, 76,199,149, 3,245, 94,101,
+153, 14, 91, 11,118,106, 60, 38, 42, 50, 98,248, 52,232,255, 0,224, 76,210,169,176,210, 23, 58, 67, 75, 75,170,196,215, 65, 90,
+ 66,200, 82,134, 70, 57,121,122,190,116, 74, 93, 58,224,113, 52,104,137,117, 22,180, 38, 41,236, 84,166,201,117,250,127,189,196,
+138,202,165, 63, 77,135, 61,213, 5, 70,128,166,194, 12,199, 18,144,165,140,160, 16,130,179,166,155,101, 55,170,133,187,214,166,
+214,220, 55, 67, 20, 74, 22,231,223,150, 76, 91,182, 85,181, 1,133, 66,160,215,231,197,159, 82,164,204,170, 90, 80,221, 39,244,
+ 42,118,154,185, 47,211,155, 89,114, 42,164,175,221,144,228, 84, 39,195,216, 74,124, 72,107, 67,204, 60,133,205, 66,221, 76,153,
+140,248,200,105, 21,106,162,212,144,195,107,125, 39,244,116,228, 20,254,149, 32,124, 73, 74, 16, 82,160,149, 5, 73,200, 40,225,
+ 8, 33,133,138,157,182, 82, 3, 95, 73,181,137,216,116,212, 13,238,110, 49, 90,230,167, 55,225,188,207, 50,225,188,237,100,164,
+205,114, 10,186,138,102, 10, 67, 66,181, 20,181, 15, 75, 52,145, 56, 33,102, 11, 36, 14,177,206, 9, 14, 84, 59, 29,188,174, 84,
+ 59,173,112, 93,143, 85,131, 21,160,229,114, 44, 58, 45,153, 66, 12, 7, 27,139, 74, 91,136,101,170,139,205, 35,148, 83,216, 89,
+109, 47,175,160, 45,198, 97,150, 17,149, 40,129,153,191, 33,138, 45, 46, 76, 10,157, 73, 53,234,220,249, 45, 83,233,211, 28,109,
+ 44, 82,226, 34,114,131, 18, 43, 40,129, 31,153, 48, 97, 70, 47, 36,186,181,120,174, 58,242, 82,209, 95, 50,212, 18,208, 73, 83,
+ 80, 80,204,199,127,194, 85, 21,242, 79,187, 56,168,170,169,212,221,108, 50, 91,138,234,193,240,227,178,130, 24,101, 57,229,108,
+ 41, 75, 86, 74, 20, 9,139,172, 74,165, 58,245,126,172,220, 89,142, 26,131,177,226,196,130, 86,202, 30,125,154,122,189,198,155,
+ 17,167, 0, 8,166,198,149,239, 78, 60,238, 79,139,135, 31, 80, 75,139, 70,183,210, 72,208, 37,152, 14,131,107,157,246,216,129,
+183, 77,134,221,141,183, 54,195, 12,185,100, 85,145,194,212,139,125, 68,121, 69,150, 73, 36, 70, 28,168,213,141,221, 80, 38,242,
+239,121, 25,155,153,118, 55,137,194,174, 84, 41,148, 85,183, 64,162,120, 21, 9, 84,184, 49,145, 29, 46, 45, 79, 64,165, 64,110,
+ 50,132,154,165, 69,214,148, 82,194,220, 74,138,147, 28,101,231,150,232,192, 66, 9, 86,185, 17,237, 36,216, 24,156, 79,108, 45,
+ 91,106,157,145, 17,119,146,170, 52,251,163,110,235,115,214,150, 35,192,191,179, 38, 60, 55, 42, 47,160, 19, 2,219,168,211, 29,
+118,157, 56,164, 20, 50,202,227,203, 3,158, 10, 73,232,220,233,143,193,167,180,203, 82, 67,210, 37,192,145, 88,170, 20, 52,150,
+230, 54,253, 90,120,113, 41,119,149, 69, 38,115,235, 1, 12,182, 7,193, 25, 9, 82,185,130, 82,117,175,119,139, 85,218,217,157,
+245,121, 66, 42,143,213, 32,176,154,170,185, 28,143, 69, 75, 2,115,178,106, 74,141,250,175, 22, 25,108,248, 12, 35, 8, 91,142,
+ 54,181,252, 5,122, 88,213,203, 28,145, 75, 78,229, 37,167, 97, 34,183,236,148, 33,148,223, 96, 69,197,183,176, 63,102,214,216,
+ 58,240,190, 68,114,250,243,152, 23, 19,199, 8,114,242, 72, 72,231, 22,188,108,205,176,101,137,213,157,138,160, 37,149,131,121,
+245, 2, 96,171,183, 20,137,123, 31,191,149, 91, 47,123,232, 85, 27, 62, 93, 6,181, 34,220,190,237,155,214,132,186,220, 88,179,
+217,150,220, 71,128,149, 75,125,138,149,169, 90, 75,203, 96,211,110, 42, 91,143,176,165,184,194,229,195,126, 59,201,121, 83,127,
+216,175,102,198,192,241,189,192, 78,211, 93,151,173, 66,131, 11,121,110, 27,122,109, 78,202,226,103,134,152,244,170, 29,255, 0,
+106, 75, 77, 80,127, 7,147,118,200,183,170, 81,169, 27,137,124, 65,102, 20, 38,171, 53, 4, 24,110,205,241, 18,226,164,123,227,
+ 13,202,211, 37,186,124, 33,108, 79, 16, 66,211,103,113,182,182,139,118, 84,173, 7,156,166,216,183, 99,192, 67,187, 32,202, 95,
+ 52,202,236,231,238, 88,201, 46,213,173,214,193, 83,203,133, 49, 50, 99,173,245,243, 52,203, 11,115,159, 93, 2,225, 42,126,233,
+240,185,105, 84,108, 74, 45, 95,108, 43, 59, 35, 69, 97,250,141, 10,138,230,217, 90,251, 48,139, 9,233, 47,173, 83,167, 92, 23,
+133,177, 85, 69, 46,182,212,244, 48,183, 86,228,216,112,223, 43,138, 95,241, 29,230,228, 19,170, 78, 41,201,115, 12,218,154,183,
+ 54,203,228, 66,244,207, 79, 57, 83,174, 48,118,211, 36,113,139, 51,236,182,144,200,197,209, 89, 4, 74, 66, 18,100,220, 71,196,
+ 25,253, 47,135,176,101, 60, 41,197, 99, 32,207,114, 92,228,102, 52,138,194,116,168,154, 25, 34,146, 41,169,214,165, 68,180,176,
+199, 36,210, 6,122, 3, 28, 20,213, 45, 28,143, 83, 37, 84,238, 34,143, 74,120, 89,225,111,121,247,111,121,238, 89,155,225,184,
+220, 82,237,142,251,112,146,253, 17,207,229,239, 14,200,188, 40,150,199, 16, 91, 53,100,203,106,223,161,219, 59,177,105,238, 28,
+ 8,141,191,184, 84,122,123,188,237, 86, 66, 93,102,187, 65,135, 61,155,146,157, 54, 68,117, 85,170, 29, 5,246,132,237, 76,171,
+ 94,215,181, 54,235,103,182,227, 99,237,219, 50,147,100,221,151,117,186,253, 38,155, 38,143,114, 90, 87, 4,106,212, 53,220,242,
+118,242,194,180,160,179, 75,166, 81, 39, 84,235,112, 68,217,140, 61,226, 50,212,247, 22, 89,118, 35, 77,235, 83,184,202,246,199,
+112,111, 70,219,122,181, 6,171,108, 65,226,231,125,105,213,122,204, 75, 11,108,236, 27,130,252,141,176,118,155, 98, 2, 33,193,
+175,238,213,251, 13, 81, 98,223, 52,197,206, 75,206,187, 71,165, 38,170,196,168,241,155,138, 85, 9,111, 46, 98, 52, 47,111,189,
+188,183, 37,209,109, 10,103, 17, 22, 2,110,109,194,146,227,138,131,118,219,246,163,116, 11, 98,132,235,103, 52,122, 75,118,253,
+157, 38, 77, 80, 90, 17,210,101,178,248,116,206,118, 75, 83,212, 28,101,175, 1,149,162, 45,226,190, 70,185,231, 0,203,149,228,
+121,123,231,153,198,105, 91, 28,230, 88, 16, 36,112,211, 70,154,212, 24, 39,149,165, 18, 74,198, 72, 89, 35,105,100, 12, 41,231,
+158,112, 57,145,137,231, 10,100, 94, 51,241, 87, 23,112,111, 30,211,112, 52,153, 38, 73,225,242, 10, 90,124,155, 50,146, 42,116,
+ 99, 45, 52,112,243,178,218,153, 12, 21, 85, 52,171, 42,205, 88,212,181,201, 75,149,209, 37, 91, 81,100,148, 51, 81, 75, 49, 50,
+ 6,217,173,183,155,188, 84,118,173,158, 32,172,235, 87,118, 54,166,179,183,149,203,134,222,225,242, 30,215, 80,233, 54,151,241,
+165,100,213,106,245,122,156,138,221,227, 2,160,150, 46, 42,164,235,130,161, 57, 86,251,132, 51, 77,169, 64,173,174,167, 38, 59,
+ 85, 4, 56, 26, 3,109,118,123,135, 41,252, 96,110,135, 23,245,109,254,221,189,165,168,219,173, 91,123, 97, 87,216,251,190,175,
+183,219, 85, 99,219,212,155,126,209,183,217,137,183, 10,131, 66,169, 76,169,205,176,225, 70,165,194, 83,180,116,125, 88,219,175,
+148,178,243,175,199, 75,173, 59, 29, 61,249,246,206,238, 94,228,237, 61,211,181,155,117, 97, 50,205, 62,247,110,151, 14,183,114,
+ 57, 71,149,102, 55,111,211, 40,145,161,125, 74,213, 25, 54,141,222,227,180,202,188,130,169, 82, 23, 30,151, 57,136, 16,218, 83,
+108, 72, 50, 38, 25, 64,114, 67,110, 47,253,229,176,174, 10,205,199,103,238,253,237, 99, 85,238,119,154,122,231,157, 75,174,215,
+ 74,238, 7, 25, 46,152,207,214,220,157, 58, 73,170, 74,109, 18, 30, 75,110,190, 29,121,180, 44,165, 42, 9,232, 21,240,162,151,
+ 56,225, 46, 16,143, 36,205,178, 88,214,186,130,176,206,181, 50,212,206, 37,168,141, 97,228, 37, 63, 46, 9,201, 90, 37, 96,103,
+142, 25,155, 74,243, 26,157, 97,150, 33,237, 83,203,114,127,162,199,141,220, 86,188, 75, 85,151,241,125, 31, 2,167, 23,193, 83,
+150, 54, 91, 79, 78,166,152,101, 85,109, 75, 81, 85, 61, 59, 60, 98,150,158,166,174,122, 58, 72, 42,106,150,136,102, 51,123, 10,
+ 85,205,152, 73, 43, 44, 16,206,123,218, 61,196,127, 12, 59,235,177, 53, 46, 29,169, 86,189, 55,136,234,109,215, 88,166, 26,197,
+ 38, 53,233,116,109,198,223, 91,198,222, 80,171,209,234,119, 5,221, 67,164, 25,151, 10, 5, 85,136, 33,154, 93, 49, 37, 18, 15,
+233,100,202, 97,150,139,131,132,251, 87,179,251, 79,179,194,224,147,101,216,244,202, 5, 90,229,159, 17,119,149,211, 72,110, 69,
+ 46,248,110,163, 29,217, 43,129, 66,171, 79,122,116,167, 35, 90, 76, 72,147, 37,216,236, 37,215, 98,203,117,126,245, 45, 50,100,
+114,186,222,133,219, 60, 77,113, 16,220,102, 29,123,136, 11,214,170, 86,194,217,230,148,229, 46, 98, 20,211,128,115, 50,125,254,
+146,190,100,228,116,200, 4, 30,163, 7,187,151, 72,226,234,249,165, 72,105,119,173, 54,145,119,199, 91,105,138, 42,209,169,240,
+173,203,214, 44,100,188,211,178, 16,205,110,152,208,135,112, 48,176,215,197, 10,171, 13,109,124, 69,109,200, 97, 95, 24,214,226,
+126, 46,204,248,131, 53,169,253, 34,207, 26, 53,144, 71, 4, 79, 21, 56, 17,133, 22,229,150,231, 57, 26, 1, 47, 34,187, 2, 44,
+ 52,198,170,139, 50,202,126,130,126, 47,120,111,192,109,194,252, 57,154,229,220, 65,148, 9,205,116,180,137,154,214, 10,186,170,
+162, 10,137,109, 91, 69, 71,150,198,235, 25, 10, 22, 25,169,163,100, 69,105,125,166,116, 70,126,237,240,173,188,242,233, 18,100,
+237, 93,235, 42, 60,202,109,114, 92,138,190,220,221,209,196,104,148,181, 76, 74, 16,170,157,149, 92,105,110,132,210, 43,242, 74,
+ 19, 42,158,164,115,198,158,234, 36, 48,143, 6, 66,144,210,247,177, 85,202,124, 85, 41, 50, 23,238,234, 96,171,220, 84,131,201,
+ 81,167,186,242, 66,220,103,194,112,116,136,167, 49,204,218,135, 38,114,149, 36,142, 82,142, 24,109,205,249,100,111,109,188,154,
+141,169, 87,121,132, 69,149, 25,154,133, 12, 70,102, 35,244,170,162,202,228,211,227,215,160,171,156, 70, 90,220,109,197,198,112,
+ 60, 25,150,134, 86, 98, 60,242,193, 74, 54, 70, 21,203,185,137, 49, 41,209, 55, 38,242,181,228,211, 26, 17,157,129, 46,114, 42,
+180,121, 76,135,128,240,207,214,112,156,148,134, 86, 18, 75, 79, 49, 33, 50,163,165,120,248,146, 57, 73,105,106,159,147, 26, 7,
+ 37, 20,121, 74,249,129, 29,199, 81,176, 38,192,147,176,176, 11,229, 39, 28,113,196, 92, 57, 81,148,103, 21,249,110,121, 69, 46,
+ 69,155, 81,200,201, 87, 73, 60,114, 67, 44, 19, 46,155,235,139, 65,117, 46,165, 73, 11, 30,131,175, 80,250,185, 64,199, 74,170,
+247,117,187,111, 83,215, 94,171,203,137, 65,135, 79, 67,143,174,161,207, 41, 13, 62,140, 15, 16, 83, 24,105,167, 37, 84, 28, 81,
+ 82,130,227, 69,105,245, 45, 71, 41, 66,191, 91, 76,133, 87,124,171,187,130, 29,167,217, 76,213,237,251,106, 66,189,205,119,162,
+ 28, 98, 37,199, 86,142, 16,162,185, 54,235, 12, 41,106,181,161,242, 45, 99,199,119,154,162, 48, 80, 81, 16,158,154,182,205, 62,
+117, 86,178,221, 66,238,151, 81,166,214,156, 82,227, 66,168, 73,171, 77,171,198,152, 82,188,180,236, 27,145,222, 95,115, 36,148,
+242, 70, 81,136,160, 29, 56, 67,138, 29, 54, 42,202,179,153,139, 37,154,143, 44,138, 93, 90,115, 13,179, 42, 84, 55, 84,228, 58,
+130,154, 32,177, 34,167, 76,116,248, 83,164,158, 85, 21, 58, 66, 29,194,202, 84,242,134, 53,191, 74, 37,168,148, 34, 92,139,239,
+126,187,219,125,133,150,228,146, 47, 98, 55,179, 1,136, 86,103, 62, 91, 69, 8, 36,153,106, 8, 60,182,111, 58, 40,216,157, 54,
+ 98, 36, 0,234,243,171, 58, 3,101,229,106,179, 43,139,104, 91, 70, 44,120,176,217, 45, 59, 21,146,164, 50,232, 71, 43,133,111,
+117, 90,230,100,144,252,149, 40,149, 41,210, 74,150,181, 21, 44,149,171, 39, 97,160,209,196, 74, 98,138,211,204, 1,101, 39, 41,
+232,160, 84, 80, 91, 86,122, 5,117,207,217,171, 93,167, 74,230,109,190,118,227,151, 50, 18, 67, 73, 80,101,207,212, 10, 45,182,
+190,169, 65, 32, 16, 14, 72, 61, 50,113,157, 59,206,211,128,167,184,215,134, 84,218,139, 67, 9,202,136, 9, 81,207,134, 79,235,
+ 28, 17,243,252,113,169,165, 53, 56,166, 68,176, 35, 72, 23,245, 29, 5,183,191, 78,155,254, 24,174,234,171, 13, 76,138,146,157,
+228,111, 49,216, 94,228,111,219,173,201, 22,181,250,250,130,207, 61, 76, 83, 78,129,201,136,206, 30,102,214, 63,241, 74, 61,219,
+ 81,242, 79, 81,141, 92, 33, 83, 11, 11, 43, 74, 70, 79,235,128, 48,146,159, 95,183, 89,187, 48, 16,248,113,190, 78,100,130, 82,
+160,176, 65, 32, 28, 5, 99,215,168,252, 53, 65,216,162, 34,146,199,235, 39, 31, 2,200,193,233,215,144,231, 79, 81,206,164,117,
+233,252,125,253,240,213, 89,206, 82,241,176,243, 14,190,132,117, 7,227,110,189,143, 94,183,197,134,155, 9, 14, 77, 73, 35,160,
+115, 31,105,236,123,140,118,214,207,217,208, 91, 67, 45, 2, 19,212, 36, 12, 14,163,212,156,142,135,247,233,135,163, 69, 10,155,
+158, 95,135,196,200, 0,103, 57,200,252,115,173,138,183, 84,150, 18,214, 79, 47, 42, 82, 64,200,200,192, 25, 63, 34, 51,173,102,
+107,129,181,255, 0,158, 33, 53,234,201, 4,224,108,194,246,251,207,207,175,124, 57,232,109,180, 51,202, 72,248,130,113,142,248,
+ 78, 0, 31, 35,235,246,233,191,188, 42,206, 66,108,193,167,132,253,103, 41,181, 0, 71,255, 0, 2,140,174,134, 73, 35,245, 92,
+ 39, 33, 30,121,235,229,171,141, 90,228,106, 11, 32, 52, 80,236,183, 73, 12, 70, 4,229, 74, 7, 30, 43,152, 63, 3, 41, 29, 84,
+123, 28,224,100,235, 5, 13,173,197, 57, 46, 67,138,125,249, 46,120,146, 95, 88,253,117,156, 97, 40, 39,245, 91, 0,225, 35,176,
+ 29,180,142,179, 80,220,168,205,149,126,211, 15,223,164, 16,122,250,158,195,208,145,134,108,155, 45,116,149,107,106,210,241, 41,
+186,161,255, 0,120,194,221, 71,236, 47,127,218, 35, 79, 77, 86,176, 66,163, 8,205,225,197, 43, 56, 37,105, 65, 56, 36,252, 75,
+ 82,212,174,171,112,149, 28,156,245,207, 93, 15, 45,216,241, 57,146, 57, 27, 56,200, 72,192, 89, 78, 15, 85,168,159,128, 99, 39,
+226, 63, 33,223, 89, 20,167,114,130, 10,130, 80, 72,248, 26, 31, 30, 65, 0, 16,165, 3,208,231,174, 61, 61, 53,129,212,188, 52,
+ 7, 20, 82,214, 78, 74,148,226,186,164,228, 18, 84,181,103, 36,244,238,122, 30,157, 53,185, 26, 44,106,170,160, 1,238,236, 54,
+253,214,249,247,206,169,100,122,153, 25,234, 36,251, 71,160,233,212,122,216,124,236,119,197,146,116,196, 43,156, 23, 20,234,176,
+ 66, 83, 24, 44, 50, 18, 79, 66,235,132,167,159, 61, 50, 50, 18, 9,206, 15, 83,172, 58,116,165, 37, 64, 4,182,218, 73,199, 59,
+139, 10, 82, 73, 66,186, 33, 13, 30, 94, 96,174,108,228,231,168,198,123,139,140,202,131, 79, 30, 70,148,227,238, 33, 74, 65,102,
+ 43, 97,196, 54,147,211,226, 81, 41, 74,129, 0,103,226, 56,236, 70, 51,172, 78,114,228,243, 5, 43,193,100,115,243, 36,120,134,
+ 75,201,194,128, 42, 71, 54, 17,204, 60,206, 74,114,122, 18,116,112,214,210, 59,223,241,219,240,190,226,251,116,251,158,201,176,
+ 10, 23, 73, 61,143, 95,141,182, 61, 58, 16,167,226,118,197, 23,220, 24, 42, 82,202,147,250, 50,234,130,146,217, 45, 36,168,133,
+ 45, 94, 71,175,197,215,174, 49,223,174,177,233, 50,208, 66,131,105, 61,214, 66, 64, 78,114, 64, 32,244, 61, 27, 42, 36,100, 30,
+ 80, 0, 29,250,232,185,104, 66, 49, 33,199, 21,150,220, 43, 66,158, 90,158, 9, 94, 72,229, 74, 84,180,165, 36,173, 63,234,146,
+156,146, 6,173,114, 20, 80,180,165, 72, 80,112, 20,145,206,164, 41, 92,139, 1, 96,182,144,172, 56,130, 20, 14, 50, 0, 39, 56,
+233,141, 46,141, 98, 54,244,254, 95, 29,247,198,133, 76, 90,206,166, 58,175,233,178,237, 97,238,254, 93,189,215,178,204, 42, 33,
+ 93, 64, 42,248,136, 81, 57,235,147,209, 95,205, 61, 51,156,117,229,239,140,107, 16,158, 7, 42,147,206, 74,138, 85,241,171,148,
+ 17,140, 96,145,216, 96, 12,125,253, 6,178,233, 89, 1, 42, 89, 0,224,140, 40, 16,146,179,204,164, 55,201,216, 60,158,153, 29,
+114, 59,100,118,197,106, 10,207, 40, 35,170, 73,230, 36,114,149,103,155,161, 9, 87, 86,241,147,231,213, 88,193, 58, 92, 49,218,
+223,135,110,159,187,221,238,253,216,103,145, 0, 34,219,123,186,124,143,147,136, 13,251,114,237,134,237,143,105, 46,242, 73, 13,
+ 22,133,233,109,109,125,248,227,197, 1, 40,126, 69,118,199,166,197,148,182,249, 0,241, 0,122,146,174,101, 31,136,168,158, 98,
+ 78,117,200,194,180,168,126,137,101, 88,239,233,246,107,183,127, 72, 24,180,175,104, 99,158, 27,161,215, 19,195,254,205, 37,246,
+129,255, 0, 34,180,195,184,124, 52,148, 17,150,202,152, 45,175,169,201, 11, 7, 0, 99, 92, 70, 83,105,199, 81,140,246,229,242,
+249, 29, 75,178,155,181, 13, 41, 59,217,109,211,176, 36,116,235,219,242,199, 51,241, 50, 44,124, 69,158, 34,159, 47,181,212, 31,
+255, 0,116,172,199,247, 18,113, 76,168, 40,116, 72, 29, 62, 47, 63,188,117,208,235, 35, 24,207, 92,244,254,221, 86, 40, 35, 62,
+152,207, 95,232,251,116, 51,133, 67,168, 78, 71, 81,243,251,244,236, 6,194,221, 48,206,160, 29,173,211,161,253,216,162,179,229,
+143,191,211,175,217,170, 11, 0,227,176,245,245,199,175,207,160, 58,244,188,254,177,201, 82,124,188,177,231,246, 29, 81, 39, 39,
+ 58, 93, 70,194,221, 63,158, 20, 24,164,230, 60,136,232, 72,244, 39,183,109, 12,178, 9, 61,242, 59,122, 30,223,214,116, 74,241,
+130, 73, 3, 7,167,246,245,213,189,240,234,136,240,212,148, 97, 95, 22, 70, 74,128,236, 58,249,233, 68,235,140, 3,126,155,227,
+193, 36,156,254,113,165,175, 10, 63,237, 99,238,206,116,180,125, 62,182,191,207,191, 25,199,180,146, 15, 65,159,151,174,171,165,
+ 93,142, 58,142,227, 61, 70,135, 31,120,254,145,251,117, 92, 96,245, 30,127, 46,250, 37,188,191, 15,195,231,231,124, 12, 86,241,
+ 19,156,117,235,231,142,159,126,136,111, 10,193, 74,187, 28, 99, 24,201, 62,191,136,252, 53, 65, 9, 0,131,220,244,251, 58,232,
+164,225, 61,178, 7, 94,221,254,236,246,210, 76, 24,139,124,252,223, 25,219,239,197, 69,160,168,119,233,221, 93, 78, 6, 49,216,
+125,186, 33,164,115, 36, 40,247, 29, 66, 71,160,233,235,170, 64,133, 15,207,113,215, 69, 36,242,224,244,244, 35,208,105, 34, 0,
+ 39,190, 49,143,104,101, 42,238, 57, 85,215,168,198, 72,251,188,244,123,104, 72, 72, 24,201, 79, 78,191,187,166,132, 65, 39,226,
+ 72, 25,244, 39,167,152,251,180, 90, 22,144, 1, 87,195,147,231,252,236,250,124,244,153, 23,216,158,159,233,140, 17,124, 28,214,
+ 58,114,244, 24, 61, 62, 93,191,167, 70, 32, 12,103, 39,230, 60,137,199, 94,154, 13,178, 23,215,168, 29,253, 59, 99,250,245, 93,
+ 11, 73, 95, 47,114, 62,127,102,127,103,150,147,194, 39,221,190, 13,108,129,145,140,228, 16,160, 70, 82,164,158,133, 36,121,130,
+ 9,200,212,133,253,149, 30,214, 40,187, 66,197,191,195, 39, 20,245,169, 15,236,235,143,162, 14,220,110,140,213,189, 54,163,181,
+211,100,184, 17, 30,135,114, 58,162,165,203,177,148,226,240,211,164,149, 65,206, 21,150, 70, 83, 30,118,242, 14,122,121,126,206,
+218, 33, 39, 37, 68,227,168,229, 32,128, 82, 65,232, 65, 7,184, 56,237,231,157, 55,102, 89,109, 54,103, 78,208, 84, 37,251,171,
+ 11,106, 86,236, 71,240, 32,236, 71, 81,211, 14,249, 22,123,153,112,230, 99, 22,103,149,205,202,158, 63, 43, 43, 92,199, 44,100,
+130,209, 74,160,141, 72,214, 29,195, 41, 1,144,171, 0, 71,233,189, 78,163,199,149, 6, 5,118,137, 50,159, 88,161, 86, 97,179,
+ 50,145,112,209,228,179, 81,164,214, 32,202, 66, 93,106,101, 62,161, 25, 74,109,214,150,210,146, 82, 66,186,115,105,198,165,210,
+220, 45, 54,156, 0,210, 18,130, 16,156,144,132,160,130,113,234,163,215, 63,102,191, 63,142, 13, 61,168,188, 90,112, 88, 35, 91,
+187,121,119,179,119,109,106,165, 54,185,123, 83,184, 1,218,213,172,195, 74,112, 25, 31,193,231,222,112,191,110, 58,164, 21,224,
+ 48,176,215, 49, 7,195,198,117, 59, 45,161,226,130,149,124,109,157,131,126, 59,105, 34, 25,190,109, 42, 53,196,184,241, 30, 15,
+198,138,237, 78, 35, 82, 31,140,211,167,245,219, 66,220, 41, 7,190, 19,170,167, 56,203,165,200,101,140, 85,149,104,230,213,203,
+101,189,155, 78,155,220,117, 82, 3, 46,198,227,123, 43,181,137,199, 98,248,121,226, 4, 60,107, 28,144, 81,211, 52, 25,134, 94,
+168,243,195, 33, 13,165, 88,233, 15, 20,151, 2, 68,212, 8, 23, 84,117,184,212,128, 27,157,174,166,211,138,218,110, 68,166,202,
+ 12,226,136,177,129,232,166,216, 72,248,148, 83,159,213, 41, 3, 58,199,247,101,136,115, 44,202,189,191, 58, 53, 62,165, 75,147,
+ 13,232,255, 0, 85, 84,225, 70,168,193,124, 22,212, 1, 92, 57,109,173, 42, 25,207, 92,107, 7, 94,247, 82,222, 44,120, 49, 37,
+ 54,166,153, 62, 27, 97,162,180,183,147,212, 19,228,122,244,251, 53,166, 60, 82,241,139, 69,219,203, 98, 69, 54,140,180, 86,247,
+ 30,234,150,139, 66,201,183, 25,149, 29,233,234,185, 42,196, 70,134,169,113,219, 89,247, 70,154, 91,161,107, 46,114,242,132,100,
+244,206,153,205, 97,168, 2,158, 4, 44,100,219,125,135, 64, 78,228,219,222, 73,244,222,221,174, 76,131, 35,204,179,124,218,130,
+135, 45,164, 51, 85,202,227, 76,106, 62,206,255, 0,109,219,126, 90, 70,190,103,145,136, 84, 93, 78, 72, 23,191, 48,247,123,113,
+ 54,107, 98,106,146,105, 9,180, 41, 21,123,162,141, 80,151, 62,153,110, 91,228, 81,105,212,218,178,156,241, 34, 77,169, 72,130,
+226, 75, 2, 57,229, 90, 91, 71, 95, 19, 25, 61, 49,174,102,239,183, 16, 27,245,196,245, 64, 82,110,171,182,181, 46,217, 96, 6,
+ 35,218,212,137, 51, 32,219,108,198,105, 92,201, 85, 69,199, 30, 6,166,164,128, 10,220,112,144, 72,251, 53,214,202, 31,178,178,
+163,118, 58,154,214,227,110,196,250,141,229, 94, 90,234,215, 82,232,240, 89,168, 70,166, 84,170, 4,190,168, 41,121,249, 0, 76,
+ 90, 29,119,151, 56, 9,248, 73, 25,214,146,202,219, 91, 51,104,184,161,111,104, 55, 2,101, 83,114, 54,198,194,191,169, 77,110,
+ 68,221,177,164, 63, 85,175,214,237, 88,241,211, 82,147, 76,141, 78,128, 22, 91, 87,142,150, 98,205, 74, 85,132,248,171,248,142,
+ 53,173,150, 83, 84, 83,203, 81, 44,142,139,160, 27, 2,160,233, 3,114,117, 16, 12,141,127, 70, 80, 9, 35,125,241,233,239,130,
+ 41,224, 38,103, 13,117, 54, 67,153,205,226, 87, 28,112,190, 95, 45,125, 92,210, 83, 86,187,242,226, 42,178,174, 80,149,113,165,
+ 44, 65,229,100,134, 4,141,150,122,141, 81, 51, 73,162,237, 30,168,196,225,210,109,131,180,183,158,251, 93,182,173, 90, 77,131,
+ 96, 89,181, 75,242,173, 86, 98, 49,102, 9,183, 41, 18, 99, 82,213, 61,169,147, 28,108, 26,115,213,233,208, 41,241,139, 73, 89,
+155, 50, 88, 98, 57, 82,144,225, 71, 44,173,110, 47,174,107,174,254, 98, 13, 58,249, 85, 6,131, 87,171, 39,220, 44,241,181,244,
+153,180,166, 32, 5,149,154,122, 42,162,227, 19, 75,165,128, 71,188, 56,178,174,115,204, 82,145,128, 36, 3,237,235,223,234,222,
+215,112, 55,182,219, 31, 86, 98, 61,181,187,220,112, 95,208,183,126,253,180, 97, 54,220, 21,109,191, 13,155, 89, 33,113, 54, 95,
+106,218,165, 50, 18, 40,148,150,231,154,107,198, 55, 42, 67,242, 41,179, 93,113, 42,113, 74, 86,162, 97,177, 48,209, 39,113,161,
+ 58, 64, 13,211,225, 75,148, 51,140, 36,165,190, 84,143,159, 65,171, 75,135,178,168,107,242, 90,172,214,180, 51, 59,234, 16,134,
+ 17,190,133, 64, 20, 55,158, 54, 2, 70,146,225,136, 0,174,157, 43, 97,185,243, 63,233, 63,244,231,241, 66,159,196,102,225, 15,
+ 14, 51, 37,224,188,143,132, 9,142,161,114,156,207, 55,165,122,154,211,180,201, 83, 95,148,230, 89,116,181,212,212,192, 8,224,
+ 5,150, 25,142,186,190, 84,124,245,138, 25,117,109,141,230,157,201,225, 47, 99,174,184,147, 81, 37,251, 42,185,185, 27,109,239,
+116,234,109, 66,219,122, 4,155, 82,247,170, 85, 97,120, 77, 63, 82,121,198, 42, 45, 83,110,106, 65,247,182, 36,165, 14,184,226,
+150,194, 25, 9,113, 3,110,182,151,139,125,212,183,132,104, 23,139,113, 55, 18,137, 24, 33, 42,171,202,150,138, 77,231, 10, 58,
+ 80,148, 41,215,106,105,101,113,238, 23, 2, 0,109, 6, 99, 41,127,224, 0,190, 84,115,174, 89,251, 50,110,182,111,109,161,226,
+ 3,101, 36, 58,211,149,138, 21, 94,218,222,203, 78, 35,202, 81, 46, 82,231,199, 69,129,126,193,167,180, 63, 93,214,103,194,179,
+170, 50, 48, 15, 42,103, 21,168, 17,147,174,130,217,182, 49, 51,154, 91,177,188,102,144,164, 58, 35,144,191,242,169, 25, 99,159,
+148,124, 72, 7,226,207, 80, 49,207,131,216, 83, 92, 69, 69, 29, 6, 99, 95, 73, 34,235, 8,250,148,236, 9, 14, 17,197,138,133,
+ 2,215,210,116,217,110,164, 91, 97,105,119,134, 62, 33,208,248,151,225,118, 89,196, 28, 81, 28, 85,249,213, 91,213,189, 89, 99,
+ 36,143,237,143, 83, 41,169,117,146, 89,165,169, 6,105,139, 75,170, 73,228,145,245,134,150, 73, 9, 44,122, 97,110,111,221,149,
+120, 67,165,189, 58,161, 34,214,201,105,134,233, 55,148, 69, 83, 11, 50,221, 90, 92, 68, 40,213, 72,110,200,135, 46, 73, 41,108,
+171, 14,167,245, 84,130, 65,200,211,166, 94,171, 84,102, 51, 47,194,143, 89,131, 9, 5,184,240,105, 85, 40,147,218, 74,222, 40,
+ 89, 97,227, 2, 67,137, 97, 78,252, 5,254,110, 85,114,132, 39, 9, 72, 32,233, 93, 14,201,122, 65,143, 22,156,212, 69, 86,100,
+ 46, 44,135, 38, 57,135, 33,219,180,231, 22,234, 83, 60,161,192, 10,170,170, 8,144, 33,178, 71,233, 29, 30,242,191,208,181,133,
+191,182,125,129, 22,137, 24,184,219, 16,105,244,122,116,229, 24,172,196,140,227, 51,106, 82, 37,172, 0, 92,153,226, 37,249,213,
+ 57, 83, 22,165, 18,225, 82,222,113, 69, 74, 9, 71,234, 68, 9,208,198,209, 94,219,218,228, 15, 83,112, 65,184, 62,227,110,189,
+109,178,169, 62, 83, 5,218,149,249, 37,181, 42,198, 87, 89, 80,199,253,217, 86, 70, 70, 98,204, 20,146, 89,197,201,101, 22,230,
+ 59,242, 41,215, 69, 77, 73,128,236, 67, 18, 58,167,154,138,231, 60, 4,102,158,150, 80, 82,130,218,157,115, 45,198,101,174, 84,
+165, 1, 68,114, 52,130,156, 99, 89, 45, 34,212,134,228, 73, 16,146,227,205,181, 1,201, 78, 77,171, 38, 42,218,143,227,144, 4,
+201, 12,201,115, 36, 71, 12, 32,165, 43, 3,226,248,212,144, 10,146, 53,126,180,172,233, 73,154,154,212,168,202, 93,197, 80, 97,
+136,104,140,211,242,100,192,162,196,109,194,166, 41,208,221,148,163,201,135, 23,227, 62,232, 78, 95,127, 36, 0,218, 27, 1,238,
+160, 90,138,170,136,112, 34,196,122,116, 24,179, 26, 97,224,201, 66,151, 91,158, 22,121, 26, 8,112, 2,184,136,155,133, 28, 30,
+ 89, 15, 32, 1,204,132,117,220,138, 25,100, 69,141, 33, 42, 95,185,185, 36,108, 64,216, 41, 3,125, 76,119, 96, 54,234,214, 58,
+ 53,249,220, 11, 78,232,142,144,194,128, 23,101, 1, 6,175,214, 62,103,112,219,249, 82,197, 84,238,108, 17,110, 52,139,118, 47,
+ 29,184,225,215,110, 42,187,173,184,204,207, 72, 80, 85,167,183,182, 36, 9,173, 70,184,111,106,192, 66,170,116,219,106,146,227,
+200, 80,164, 50,235, 10, 77, 66,191, 84,117, 10,106,153, 79,228, 73,241, 36,174, 36,119,184, 21,190, 59,243,185,156, 69, 84,159,
+170,238, 77,125,233,212, 64,224,114,153, 96, 80,157,149, 74,219, 91,113,168,200, 9,139, 79,161,218,173,191,225,204,247,118,130,
+ 18,103,207, 18,106, 18, 92, 10,125,231,194,214, 80,151,139,218, 61,196, 11, 91,199,196,197,237, 22,149, 81, 84,157,189,217,229,
+191,180,182, 2, 88, 11, 17,100, 68,160,212, 84,221,239,112,178,210, 9,241,102,214,111,225, 52,151, 48, 84,168,148,168, 76,161,
+ 74,109,180,160,115,231,137,235,103,118, 56,127,147,104,217, 55,156,251,107,111,175,235,178,220,141,117, 86,109, 75,154,123,113,
+238, 29,183,163, 87, 2, 87,106,211,239, 74, 50,150,145, 64,189,234,148,231, 29,158,154, 36,149,174,165, 75,167,166, 52,138,188,
+ 24,138,159, 21,133,236, 83,112,252,185,180,169, 8,169, 20,176,234, 0, 18, 88, 7,176, 39, 89,211,114,119, 4, 70,189, 44,161,
+148, 22,190,159, 75,188, 43,225,207, 12,190,140,158, 22,229, 62, 49,120,177, 11,207,199,124, 79, 74, 43, 96,166,138,138, 92,199,
+ 54,166,167,120, 99,153, 50,252,166,134, 37,121,162,150, 40, 36,137,243,154,231,228, 65, 75, 44,172,185,141,117, 61, 12, 49,202,
+ 64,184,109,119,103,132,181, 74,129, 79,134,194,135, 43,190,237, 21,191, 29,100, 96, 37, 40,117, 73, 82, 99, 35, 32,124, 88, 42,
+ 63,170, 53,226,221,219, 54,154,144,210,159,144,184,110,188,191, 9,111, 50,130,176,158,110, 80, 84,251,171,202,128, 1, 93, 73,
+229, 25, 56, 37, 0,140,233,155,215,238,236,178, 81,245, 6,230,196,184, 38, 72,117,114,146,204, 10,157, 18,124,222, 68, 55,238,
+229, 13,192, 85, 62, 51,171,139,134,207, 35, 41,140,233,231,202,146,147,144,117, 96,166,239,230,251, 91, 78,170, 52,187,154,100,
+238, 69,175,198,143, 95,161, 83,106, 18,154,101, 79,165,231,152,117,164, 67,133, 45,134,212, 82, 91,194,156, 5, 45, 44,164, 2,
+ 66, 84,155, 34,147,133,243, 36,165, 20,116,217,188, 35,151,238,126, 97, 4,254,177,125, 68,239,211, 82,223,173,172, 0, 24,167,
+179, 47,246,170,125, 30,232,243,104, 31,139,124, 24,227,142, 30,161,169,102,142,147, 50,172,203, 50,121, 41,229, 42, 69,218, 3,
+ 30,118,241,202, 0,243,200, 41, 94,165,129, 22, 42, 88,227,163,116,203, 17, 8,185, 93,183,106,208,252, 38,221, 75,239, 69, 82,
+148,212, 98,226, 86,217,118, 44,165,167, 9, 65,101,223, 60,148,144,181, 96,168, 43, 0,252,174, 91,214,181,183, 10,117, 86,179,
+ 50,153, 73,166, 83,194,214,252,233, 83,209, 26, 43, 44,162, 64,140,219,206, 58,234,210,112,235,191, 11, 64,100, 44,244, 4,168,
+145,172,123, 98,119,186,189,184,148,118,141, 70,148,197, 50,191,111,207, 66,201,167,161,249, 52,249,241, 42,212,229, 7,204, 15,
+126, 66, 92,110, 3,140,161, 73,118, 19,202, 81, 97,108,148,161,199, 27, 91, 78,107, 86,119,238,216,221, 43,230,252,250,182, 13,
+ 58,183, 46,147, 70, 13, 38, 4, 56,116,185,179,162, 69, 46,180,223,141, 81,142,184,140, 41,147, 41,114, 84,242, 75,171, 82, 84,
+194, 91, 72,230, 64, 90,214,181, 33,200,201,170, 43, 89, 94,208, 24,128, 15,166, 66, 20,216, 3,112,111, 96, 88,110, 78,159,118,
+155,220, 99,160, 60, 98,250, 99,112,207,134,255, 0, 71, 46, 29,250, 64,120, 83,195, 50,248,169,148,241,245, 69, 30, 93,144,193,
+ 67, 79, 83, 28, 82,215, 85,189,122,153,115, 32,105,154,178,134, 26,105,168,101,163,146,156,211,189, 75,102,130, 44,173, 68,114,
+ 77,207, 71,110, 15, 18, 59, 61, 18,251,183, 45,234,180,107,233,187, 1,250,171, 17,238,235,214,213,164, 83,170,247, 53, 22,146,
+247, 59,114, 43, 22,149,141, 85,159, 17,119,100,134, 63, 68,234,163,187, 34, 18,164, 53,206,152,138,117,244,161,183, 58,193, 87,
+225, 15,135,235,154,206,165, 93,187, 71,198, 37,215,186, 16,174, 74, 84,106,197,183,252, 7,217, 27,135,115, 66,233,111,133,248,
+ 82,110, 88, 27,108,185, 18, 44, 98,226,138,217, 76, 74,176, 98,168,211,208, 31, 14, 67,113, 0, 40,199,138, 77, 58,219,219, 50,
+244,105,201,133,114, 94, 12, 56,227, 82,225, 41,246,106, 20,107,126, 74, 1, 10, 21,105,145, 29, 83, 87, 29,105,183,135, 90, 99,
+ 14, 24,108,168,230,161, 33,210,145, 21,121,134,197,241,157,196,167, 13,119,204,187,239,101,247, 94,228,180,103, 85, 93, 74,238,
+122, 27,239, 11,130,196,190, 89, 74, 3, 65,139,247,111,234,106, 52,187,152, 37,129,200,203,193,152,211, 98, 54, 3,112,101,197,
+108, 4,133,235, 56, 58, 10,228, 87,202, 71,178,152,134,242, 75,119, 19, 27,222,225, 88,150, 31,254, 96, 54, 34,214,141,213,129,
+ 30, 77, 63,251, 74,190,146, 28, 63,196,245, 21, 94, 41,241, 81, 90,138,137,238,120,103,135,232,114, 90, 51,145,166,250,161,204,
+ 42,243, 28,191, 56,115, 80,172, 17, 36,201,106, 30,171, 49,165, 99, 58,215,215,101, 85,180,199, 46,155,165, 84,250,206,231,112,
+167,186, 84,202,229, 58, 84, 41,147,169,133,248,238,197,175, 91,119, 93, 18,221,187,232,146, 84,224,168,218,183,125,171,122, 80,
+169,146, 69, 62, 91, 77,165,197, 50,182,199,186,202, 90, 37,197,125,153, 76,161,221, 73, 67,102,161,181,186, 27, 75, 97,238,133,
+149, 75,174, 53,111,223, 86,211, 87,109, 54,213,185, 35, 77,146,237, 17,137, 14,200,167, 84,169, 77, 86, 23, 24,190,212,104, 85,
+ 56,114,217, 98, 72, 75,241,159,101,166,228, 0, 16,240, 9,226,206,213,123,125,246,154,253,183, 26,179,248,203,225,125,202,139,
+ 46,178,168,179,235,251,104,229, 22,255, 0,179,166, 52, 82,164, 41,247,246,211,115,158,110,161, 69,150,180,149,143, 14,155, 84,
+150,134,210,172, 54,180,249,236,206,213,123, 69, 61,143,214,236,216, 85,123,123,115, 55,238,195,166,195,122, 53,197, 19,108, 46,
+ 26, 79, 16, 44,236,253, 26,226,128,250,223,131, 85,141,183, 84,234,188,232,106,173,199, 90,212, 89,142,137, 15, 83, 81,144,125,
+209,101, 40,228,141, 47, 10,102,180,149, 86,154,156, 24, 92, 29,108,129,135,154,226,204, 2, 44,137,115,111, 54,226,254, 93,182,
+ 24,147,120,185,244,188,240,119,233, 7,195,249, 54,103, 93, 17,224,159, 17,114, 33,203,106,209, 45, 37, 92,121,173, 8, 71, 34,
+150,170, 58,150,200,101,166,150, 41,220, 61, 44,139, 5, 76,112,171,213, 71, 20,136, 39, 4,118, 6, 29,186,134,194, 27,148,195,
+193, 62, 44, 68,187, 21,106,102, 84, 30, 70, 85,205,142, 80,158, 87,201, 81, 7,153,192, 0,192, 80, 64,211,149, 66,165,180,203,
+136, 67,104,240, 27, 90,130,130, 17,226, 37,166,148,162, 1, 67, 73, 94, 66, 83,252,227,140, 39, 39,160,215, 35, 46,223,110, 95,
+179,178,219,105,233,244,219,195,120, 47,233,139, 89,112, 67,182,118,102,191, 77,247,149, 21,115, 41,196,213,175, 41,244,200,241,
+ 80, 85,142,139,201,194,137, 9,207, 77,115,159,136,255, 0,164,222,229,137, 30,163, 15,134,190, 13,228, 85,153, 9, 87,213, 91,
+165,191, 87,204,167, 45, 40,174, 45, 76,182,204,169, 86, 14,216,198,101,228,255, 0,133,202,109,178,212,219,137,132, 41,194,148,
+158, 96,180,131, 37,202,248,118,182, 90,133,138, 42,118,185,221,117,133, 75,133, 32, 29,216,168,185,189,236, 14,163,109,129, 0,
+219,143,243, 63, 16,184, 90,150, 55,105,115,232, 42,165, 31,169, 77, 42,212,177, 32, 14,130, 18,226,224, 0, 53, 57, 0,216,238,
+ 55,196,195, 45, 68, 22,211,205,146,176,133, 54,151, 20,132, 15,133,229,231,144, 40,224, 37, 5, 65, 39,151,155,148, 18,158,152,
+235,167, 48, 77, 75,205,166, 35, 10,241, 36,158, 64,164, 52, 60, 79, 9, 9,207, 48, 83,160,114,149,103,148, 96,103,182, 73,215,
+230, 7, 43,219,203,237, 79,157,190,246,230,253, 61,196,180,212, 75,181, 94,156,213, 51,101,233,182,221, 22,223,225,210, 69, 2,
+168,227, 11,169,218,181,125,167,162,176,212,122,212, 25, 8,142,218,126,176,154,244,170,211, 68, 7, 88,168,182,234, 82,177,213,
+203,167,233, 12,113,211,199,133,235,182,188, 54,240, 99,176,227,101,238,251,254, 37, 46,135, 81,183,246,214,113,190,247, 95,112,
+ 47, 39, 98, 37,203,129, 54,157,199, 86,136,195, 22, 53,140,193,106, 91,252,225,149,204, 98, 19, 75,118, 84,180,165, 7, 18,169,
+178, 74,170, 69, 51, 56, 73,209, 23, 81,210,224, 42,219,115,204, 50, 5,109, 34,219,149, 87, 3,115,219, 16, 36,241, 71, 32,204,
+ 22, 85,167,138,163,219, 12,129, 32,128, 37,228,152,177, 1,116, 88,216, 92,246,107, 17,218,230,195, 19,125,171, 92,246,205, 30,
+ 90, 32, 84,171,244,168,149, 5, 16, 61,205, 83, 89,247,180,147,216, 56,218, 23,148,121,247,198,178,122,125, 22, 5,114, 40,154,
+138,154, 22,210,134, 80, 99,180,183,112, 79,162,136, 1, 95,118,123,235,152,220, 17,123, 63,247, 3,103,237, 26, 77,219,197, 85,
+255, 0, 51,114,119,174,160,202, 42, 21, 90, 12, 74,180,170,149,181,104,202,120, 37,197,211,222,171, 73, 81,114,229,171,182,181,
+ 40, 63, 37, 88,100,184,149,120, 41,228,194,143, 75,153,101, 48,185, 91,107,153,134,155, 1, 8,109,165, 41, 41, 74, 64, 1, 32,
+ 4,224, 99, 3, 80,103, 78, 51,204,101,157,185,180, 57, 21, 10,146, 34, 81, 20,149, 19,184,236,206, 95,148,177,131,216,104, 15,
+110,168,167,108, 60,209,182,123, 57,246,138,169,146,133, 91,117,142, 38,105,152,127,215, 43, 89, 24,145,251, 10, 7,241,197, 84,
+154,117, 14, 91, 72, 18,147, 35, 46,114, 97,104, 83,107, 42, 39, 25, 0,249,254,115,167, 66, 11,229, 77,120,141, 0,191,209, 21,
+ 33, 25,229,241, 84, 82, 74, 83,146, 59,103, 90,221, 94, 77, 82,101,118,154,148,130,244, 86,221,202,228,255, 0, 60, 39,160,229,
+ 89,254,119,200,247,211,203, 6,164, 88,105,150, 65,236,148,131,147,213, 56, 24,206, 62,221, 45,195,237,153,206, 43,169, 51,119,
+ 73,100,164,125, 34, 72,211, 64, 97, 96,110, 1,191, 81,243,214,210, 12,210,138, 24, 41, 40,102, 89, 57,178,213, 33,105, 1, 32,
+244, 32,111, 96, 45,125,246,219,221,139,140, 97, 48, 58,236,154,131, 46,153, 46,146, 87,204,146, 82,132, 15,242,109, 36,167,167,
+132, 6, 59,119,206,190,200,170,100,132,160, 21, 41, 56, 1, 36,134,210,133,100,156,114,158,195,191,225,170,166,170,211,105,248,
+149,212,255, 0, 59, 56, 36,156,100, 15, 64,113,246,235, 24,171,213,226, 60, 10,142, 60, 84,244, 75,137,232,164,103,245, 65, 82,
+ 71, 80, 58,100,117, 7, 79,209, 82,242,147, 69, 59,116,245, 27,159, 93,250,111,240,235,241,195,116, 85,144, 77, 56, 50,195,229,
+ 27,121,122, 40, 22, 2,202,123, 1,254, 33,247,226,229, 38, 74,212,210,138,159, 75, 96, 2, 2, 89, 3,156,146, 72,192, 46,118,
+242,234, 6,176,138,131,208,130,143, 59,105,144,180,243, 97,114, 84,183, 74, 71,117, 30, 85,124, 41, 72, 32,103,160,201,234, 15,
+ 82, 53,100,169,214,165, 52,218,131, 78,182, 91, 7, 5,229,115, 43, 41, 62,101, 9,253, 85, 99, 29,115,128,122, 16, 53,132, 78,
+168,190,250,242,169,137, 87, 33, 4, 48, 26, 80,111, 0, 28,172,132,175,226, 56, 4,128,162, 71,159, 77, 32,237, 34, 54,153, 1,
+ 86, 59,239,247,110, 15,243,248,219,221, 40,164,162, 89, 84,201, 21, 66,136,191,195,112,122,116, 32, 11,143,131, 90,221, 78,196,
+ 28, 93,170, 53, 86,220, 45,182,214,121,193, 56, 75, 24,202, 63,156,175,242,120, 8, 79,194, 49,147,208,172,140,107, 28,144,185,
+ 14,165,196,243, 54,128,227,107, 95, 40, 1,247,148, 10, 82,160,148, 36,114,161,156, 18,146,126, 53, 99, 7,225,193, 26, 21,201,
+165,223,209,170, 87, 43, 69,196,145,224,199,109, 32, 21,142, 84, 37, 68,147,135, 50, 73, 61, 7,235, 99, 61,180, 42,150, 9, 83,
+110, 45,199,193, 66,138, 91, 83,156,173,178, 57, 84,149, 20,132, 36, 4, 47, 4,158,234, 33, 74, 7,212,107, 34, 85, 36, 91,174,
+195,111,187, 14, 2, 4,136, 88, 88, 50,239,114, 9,216,252, 64,239,107,131,210,253,111, 96,106,135, 9,241, 91, 90,152,154,224,
+ 81, 10,117,183, 66,150,132,132, 32,132,199, 90, 18, 18,211, 62, 25,202,136,229, 86, 80, 71, 55, 78,180, 86,211,138, 90,218,109,
+210,132,173, 42, 40,195, 97,226,160,188,146,149, 61,202, 17, 24,252, 7, 4,147,128,148,146,114,179,143,162, 72, 66, 20, 93, 82,
+ 91, 32,243,151, 0, 13,184,226,121, 87,250, 54,210,216, 3, 57, 40,248,112, 84, 48,188,119,233,112,142, 86,234, 29, 75,124,173,
+161,158,235,112,133, 50, 75,156,174, 56,246, 66,135, 48, 3, 10, 10, 0,128, 64, 10, 4, 29,108, 70,250,118,191,227,252,183,237,
+110,134,223,125,175,163, 80,140,221,139, 15, 94,194,214,251,186,251,205,239,140,110,108, 82,150,189,228, 33,212, 54,225, 10,142,
+ 29,108, 40,168, 1,209, 40, 65, 63, 3, 28,169, 5, 42,200,193, 95, 80, 71,124, 14,168, 18,210, 86, 21,203,202, 82,160, 8, 0,
+169, 41, 24, 9, 81, 60,184, 87,196,165,224, 12, 28, 28,231,190,156,202,203, 43,100, 60,180,187, 46, 83,142,128, 90, 68,167, 20,
+ 70, 74,148,144,167, 1,235,149, 35,157, 71,249,216, 72, 0, 37, 61,155,106,154, 76,153, 41,136,149, 4,169,231,163,196, 66,202,
+129, 9,117,245, 33,158, 98,160,112, 71,136,224, 32,158,132,126, 26, 84, 48, 2,250,134,223,233,191,126,157,125,253,112,216,241,
+ 18,202,161, 65, 55, 29, 0,222,246,181,135,238, 29,126,252, 64, 99,219,127,112,181,112,123, 74,183,173,166, 28, 82,255, 0,130,
+214,206,212, 89,178, 82,176, 66, 90,159, 67,176,105, 47, 75, 67, 68,147,204,215,137, 82, 24, 35,204, 30,154,228,170,206, 51,216,
+231,166, 58, 99,237,251, 53,183, 60,121,238, 60, 93,220,227, 99,138,189,200,132,233,122,157,114,111,133,244,154,114,249,150,180,
+154,125, 6,168,171, 94, 25,104,172,228, 50, 89,161,161, 72, 29,130, 92, 0,116, 26,212,101,246, 56, 61, 59, 96,227, 63,241,212,
+247, 43,140,165, 5, 18,176,179, 8,144,144,122,130, 84, 18, 62, 32,155, 28,114,150,121, 50, 85,103,185,197, 66, 29, 81,207, 87,
+ 80,202,123, 21, 51, 57, 82, 15,189,108,126,252, 8,178, 15, 79, 76,232,117,245, 36,142,192,224,252,191,179, 85,214,174,254,137,
+207,231,246,104,101,224, 28,231,161,235,248,233,200,126,252,104, 1,220,109,129,221,230,199, 97,142,189,189, 51,215, 63,159, 61,
+ 14, 64, 0, 96,247, 29,126, 71, 68,169, 89, 62,120,252,245,208,202,238, 79,204,253,154, 92,108, 5,240, 48, 58,192,202,135, 67,
+215,243,231,249,198,133, 81, 3, 57,249,224,119,237,229,162, 28, 39,169,249,249,126,125, 52, 26,200,251,199,127,179, 74, 45,198,
+227,126,216,200,253,248,160,178, 50, 58, 3,211,207, 63,184,253,186, 90,240,163,147,159,195,236,210,210,184, 24,175,170,168, 61,
+ 49,215,167,225,161, 16,112,122,156,116,213, 97,248,103,161,251, 51,164,216, 90,227,174,173,255, 0, 60,100,245, 38,214,190, 14,
+ 73, 56, 0,142,152,239,145,247,116,213, 66,176, 7, 82,172,142,216,249,246,207,222, 52, 58, 84, 83,211, 29, 7,111,236, 58,242,
+ 80,162,174,101, 47, 8, 61,128,206, 71,222, 7,174,116,131,222,222,236,101, 69,254,127,150, 46,141,168, 96, 0, 57,137,206, 73,
+254,145,243,192,215,213, 44,173, 73, 8, 39, 9, 56, 87,124,103,247,245,254,141, 80,105,188,242,146,174, 81,158,128,117, 61, 49,
+215, 25,244,209,205,167, 57,192,206,127,164,117,237,249,237,164,172, 79,207,166, 48,109,219, 21, 90, 56, 35, 35, 32,143, 46,221,
+ 61,125, 15,125, 28, 57, 72, 79,160, 62,127,205,251, 62,125,244, 50,121,112, 0,252,253,190,154, 37,176, 85,142,192,124,135,244,
+231,207,166,177, 97,123,227, 24,184,178, 15, 76,159, 82, 63,163,247,234,184, 24, 57, 24,201, 57, 7, 31,135,219,161, 16,175, 35,
+231,219,250, 49,162,146,113,220,245,232, 65,198, 59,246,199,175,246,233, 22, 22, 36, 97, 50,187,220,155,223,231,255, 0, 56, 37,
+ 43, 8,199, 58,186,159, 32, 59,244,249,104,146,238, 70,113,140,249,250,227,183,159, 77, 4,113,144,190,153, 63, 44,227,184,200,
+252, 53, 81, 36,116, 32,231, 29,201,251,125, 7,150,146, 98, 58,223,225,130,219,221,123,117,193, 41,119, 24,248,249, 64, 32,224,
+227,175, 94,160,122,244,206,167, 39,236,166,220,118,247,115,129,157,165,148,252,148, 73,171, 88, 74,169,237,245, 93, 33, 73, 46,
+ 54,186, 44,133, 38, 1,113, 61, 74, 65,132,228,126, 92,227, 35,168,212, 42,118,215,108,110,189,211,185, 98,219, 86,181, 49, 83,
+231, 73, 5,229,186,227,137,139, 78,167,194, 66,128,145, 85,173, 84, 93, 79,135, 74,164,183,252,247,156,234,162, 66, 26, 67,174,
+148,160,203, 23,217, 2,214,215,112,241,106,238,110,209,215,119,102,143, 34,181, 87,151, 2,239,168, 76,172, 75,110,139,108, 53,
+ 53,136,201,133, 34, 21,179,239,238, 5,184,218, 82,218, 11,139,119,149,215, 15,196, 91, 66,126, 17, 4,227, 9,104,167,142,154,
+137,228, 6,169, 95, 86,155, 95, 74, 21, 96, 75,158,136, 11, 5, 3, 81, 26,142,194,230,246,184, 60, 26,124,214,135,136,167,204,
+ 41,105,100,124,178, 88, 36,167,158, 80, 44,129,137, 73, 35, 0,159,180,193,212, 2, 20, 18,129,238,218, 65, 23,235,214,231, 75,
+174,219, 59, 83,184, 21,235, 93,151, 30,184,224, 91,147, 13, 27,193,104,188,236,105,178, 18, 35, 38,162,134, 82, 50,234,163, 33,
+213,188, 0,207, 86, 70,181,171,102,120, 8,183,217,222,155,115,124, 46, 59,138, 53,229,105,208,108, 90,123, 86, 21, 10, 66,223,
+155, 42,179,121,215, 33,166, 69,211,124,221,210, 95,234,244,211, 45,231, 83, 25,177,128,216,198,122,164,107,107,162,239,150,195,
+ 32,148, 57,188,187,110,233,193, 75,141, 34,227,167, 60,130,146, 48,180, 45, 33,226, 20, 8, 39, 35,207, 26, 14,226,227, 7,134,
+ 29,183,182,107,183, 12,173,200,163,213,169,246,180, 23, 39,205,163, 89,141,125,115, 86, 84,102,186,172, 83,169,144,129, 84,133,
+127,178,128,126,237, 65,225,142,150,158, 82,226,162, 33,169,116, 0, 89,111,114, 69,200, 23, 59,157,133,183, 61,135, 91, 99,179,
+242,190, 62,226, 28,135, 33,205,114,204,161,165,203, 70,109,205,246,202,132, 82, 30, 74, 87,138, 56,249, 76,250,117, 70,177, 5,
+155, 76,136,234,116, 85, 84, 45,129,101, 97,144,207,224,179,103,238,181, 56,183, 81,123,208,158,152,250,158,156,245,169,125,220,
+ 20,116, 60,235,202, 42,121,197, 48,137, 42, 66,150, 73, 60,184, 78, 0, 56,244,208, 91,129,114,240,113,236,166,216,187,155,114,
+235, 20,202,117,183, 21,229,201,153, 69,162,189, 37,138,222,236,111, 13,232,227, 74, 84, 26, 29, 62,109, 77, 74,149, 44, 56,247,
+ 39,140,233, 40,139, 17,165, 41,231,112, 0,207, 27,248,128,250, 66,114,226, 82,170, 52,190, 16,184,115,190, 43, 19, 3, 14, 52,
+141,201,220,155,106,174, 41, 84,247,112, 66,100,195,183, 41,209, 86,185, 78,160, 14, 96, 30,113, 8, 56,248,186,103, 81,143,226,
+ 11,136,157,247,226,127,114,100,238, 30,253,238, 45,126,244,188,158,105,214,162,199,173, 62,168,205, 81,169,238, 40,172,211,168,
+ 86,223,192,221, 6,154, 50, 7, 43, 76,160,168, 1,206,181,158,186,127,203, 56,124,207, 46,161, 18,211, 34,253,166, 54, 14, 6,
+215,180,103,204, 24,247, 50, 42,129,179, 89,197,215, 20,239, 27,253, 36,248,135,244, 13, 71, 12, 80,113, 94, 97,196, 20,179,105,
+ 38, 7,168,168,108,188, 50,127,118,243,135, 96,181, 38, 34,111, 20, 96, 58,169,220, 60,100, 95, 24, 39,180,115,137,253,201,226,
+247,127,170,251,223,186, 82, 27,254, 16, 94, 74,118,124, 26, 44, 87, 92,118,155,105, 91, 81,121,162, 91, 54,141, 31,196, 63, 13,
+ 58, 13, 59, 9,230,192, 47, 62,243,210, 23,241,186,117,175, 92, 57,196, 97,202,237,211, 57,208,178,252, 42, 34,147, 24, 1,211,
+ 46,149, 5, 18, 60,253, 6,173,251,228,231, 53,219, 29,128, 65,247, 42, 12, 6, 79, 41,200, 5, 73, 4,129,215,191,174,178, 14,
+ 26,216,118, 93,122,230,134,202,121,164,204,167, 68,139, 29, 9,238,183,223,119,194,101, 41,207,153,113,104, 31,126,172,212,141,
+ 41,120,124,197, 24,209, 26, 34,128, 46,118, 28,192,119, 59,147,183, 82, 73, 39,169, 36,239,142, 53, 53,117, 21,115,214, 86, 85,
+ 74,211,213, 84,180,178, 72,231,118,103, 42,204, 73,176,238,123, 0, 0,232, 0, 27, 98,109, 63, 71,223,128,234,125,203,195, 15,
+ 16,156, 74,220,244,174,123,199,114, 99,200,218,237,155,145, 45,177,136,116,123, 98, 92, 90,221,217, 83,134,149,167,225, 85, 82,
+187, 18, 29, 56,186, 15,197, 30,152,164, 14,138, 57,216,168,246, 17,161,213, 31,142,228,117, 50, 90,146,235, 97, 10,230, 75,225,
+ 8, 56,228,115,185, 67,169,229, 41,229,239,204,112, 8, 58,236,151, 0,219, 99, 15, 98,184, 76,225,239,107,105,113, 83, 17,187,
+ 99,109,109,231,167,180,148,132, 41, 85,138,164, 38,234,181,105, 14,116, 28,206,174,124,199,201, 39,174,123,233,168,226, 23,134,
+171,150, 93,110,226,220, 91, 38, 61, 58,161, 65,144,255, 0,214,146,168, 44, 62,182, 43,237,206,148,240,247,152, 52,168, 9,103,
+146,167,207, 53,197, 58,202, 3,136, 63,166, 80, 94, 2, 65, 52,151, 19,209, 54, 99, 28, 89,138, 38,170,131,118,127, 82,142,117,
+ 40, 61, 55,137, 74,160,247, 13,239,215, 29,145,225,180,210,240,102, 89, 6, 69, 36,194, 24, 42,163, 73,100,212,214, 95,105,101,
+ 94,110,228,237,169,174, 22,254,128,108, 0, 3, 82,108,234, 84,116, 52,134,210,201, 41,147, 33, 50, 29, 8,240,203,143,186, 2,
+ 0, 83,220,201,207, 58, 67, 40, 7, 36, 0, 19,132,156,107, 99,104, 52, 8,210, 93, 98,116,150,210, 36,193,113, 47, 65, 13,129,
+225,199,203,101,135,198, 79,235, 74,113,133, 41, 10, 89, 5, 32, 16,148,242,167, 36,170, 87, 15, 59,203, 71, 82, 20,230,223, 76,
+148,128,134,151,205, 74,153, 75,168, 33,105,194, 64, 39, 19,144,162, 0, 37, 71, 41, 4, 99, 28,189,244,241,218,123, 83,186, 79,
+ 41,180, 35,109,238,133, 20,114,133, 45,113,162, 37, 61, 14, 28, 74,221,114,104, 72, 79, 81,147,216,245,198,162, 81,100,213, 74,
+ 64,146,146, 66, 91,182,134,244, 22,232, 13,237,215,211,210,214, 24,178, 78,125, 70,186,229,108,198, 24,237,177,102,158, 32, 0,
+ 54, 4, 18, 91, 96, 64, 3,222, 5,177,113,161,208, 12,134, 16,211, 10, 90, 34,143,242,202,115,224,151, 49,158,230, 50, 29, 74,
+147,238,236, 18,160, 10,191, 89, 64,114, 35, 1, 74, 86,178,171,163,112,237,237,158, 85,185, 95,170,208,239,234,203,242, 38,132,
+ 82,227,109,214,216,222,251,153, 34, 51,212,224,196,176,253,106,153, 99,209,229, 46,149, 79, 64,228, 45, 41,208,217,144,176, 88,
+142,149,168, 40, 7,150,209,216, 45,211,158,164, 57, 54,149, 73,183,217, 80,229, 46,213,234, 77, 72,113, 41, 0,142,127,114,166,
+182,234,138,136, 63, 8,231, 66,124,250,119,214,136,251,111,106,123,151,194, 15,179, 87,116,183, 91,103,247, 82,225,178,183, 81,
+ 55, 54,223, 91, 16,111, 43,121,168,212,249,212,202,101,201,112,177, 6,177, 22,136,227,168,117,112,106, 47,198, 43, 67,115,185,
+253,229,144, 74,152, 83, 75,194,132,166,147,135,179, 55,167,146,177,104,218, 8,163, 49,131, 44,171,101, 82,242, 36,105,101, 37,
+ 93,174,238, 0,210, 13,137,213,184,190, 34, 25,199,137,124, 27,150, 48, 25,157, 89,207,105, 98, 73,154, 90, 74, 25,209,101,153,
+ 68, 78,197, 69, 87, 38,162, 8,201, 42, 11,115, 17,137, 23, 64, 22,225,150, 51,124,116,238, 62,206,240, 93,121,221, 53,125,139,
+ 98,254,183,183,166,236,173,213, 46,123, 18,139,190, 78, 91,107,223,205,183,143,115, 74,157, 85, 27,132,254,217,209, 34,200,137,
+176,244,148, 57, 59,154,223,149,118,189, 34,254,168, 6,195,212,202, 37, 1,178,229,101, 17,220,184, 46,123,134,236,174, 85,110,
+107,134,183, 87,184,110, 58,228,233,117, 42,229,201, 93,156,253, 74,191, 90,168,206,125,114, 39, 77,169, 84,100,184, 86,235,239,
+ 72, 90,214,224, 4, 37, 74, 86, 72, 39, 36,218, 42,181, 73,149,138,165, 74,181, 92,157, 58,167, 88,172,212,165, 86, 43, 53,106,
+148,217, 85, 42,173, 98,179, 80,115,198,159, 87,171,212,230,186,183,234,149, 55,158, 37, 78,200,125,199, 29,112,245, 90,142, 6,
+128,109,101,110, 97, 36, 6,179,241,128, 71, 49, 62,185,242, 26,176,114, 30, 31,163,201, 33,178, 14,117, 76,191,106, 66, 5,197,
+194,141, 9,251, 40, 52,128, 22,229,136, 85,214,206, 85, 72,164,252,120,250, 73,120,157,244,128,204,169, 36,227, 28,238, 99,195,
+217, 60,113, 67, 69,150,137,165,120, 17, 41,193, 88,102,171,119, 98,213,213,195, 83,191,180, 77,245,112, 73, 61, 64,160,130,138,
+ 25,228,133,136, 90,148,234, 57, 93, 9,121, 9, 80, 90, 91,144,148,188,144,176,114,149,165, 14, 2, 18,224, 80, 4, 40, 96,130,
+ 50, 8, 58,204,169,155,143,113,209,211, 21,169,110,192,185,160, 68, 11, 17,232,183,173, 53,187,170,154,198, 82, 82, 61,205,249,
+174, 9,212,229, 15,255, 0,131, 48, 54, 63,248,163,211, 24, 96,228, 10, 88,201, 41, 7,162,137,244,238, 63, 57,213, 53,164, 43,
+ 36, 14,185,200,252,159,150,159, 39,166,130,161, 52, 77, 10,202,163,166,160, 13,137,238, 13,174,167,222, 44, 71, 99,138,111,135,
+120,167,136,248, 74,170,106,190, 27,206,170, 50,105, 42,192, 74,133,134, 66,176,213, 68, 13,249, 53,148,230,244,245,180,228,253,
+170,106,184,166,129,255, 0, 94, 54, 24,116,231,239,189,238,150, 89,133, 64,254, 15,237,252, 36,248,206,123,141,131, 77, 48, 29,
+151, 33,230,210,209,151, 80,170, 84,195,206,184,250, 26, 64,229, 8, 74, 50,160,149, 45,107, 8,109, 8,177,171,117,119, 10,108,
+ 7,169,170,189,110,207,170,159, 74,208,253, 57, 21,201,173, 71,113, 46,161, 40,144,133, 73, 74,196,165, 54,232, 78, 92,111,222,
+ 60, 37,149,168,148,124, 74,206, 0,166,219,230, 33,120, 36,117,206,124,251,143,219,175,170, 91, 74, 90, 19,207,241, 32, 19,200,
+147,240,156,250,254,205, 37, 29, 21, 36, 32,133,167, 64, 24,223,236,130,111,182,228,145,114, 71, 98, 73, 54,218,248,156,102,190,
+ 58,120,209,157,242, 99,172,241, 87, 62,130,146,154,148, 80,197, 71, 69,153,213,101,153,108, 20, 34, 40,225, 52, 84,185, 86, 89,
+ 37, 30, 91, 75, 70,241, 68,139, 37, 45, 45, 36, 84,242,232, 13, 44,108,196,177,172,227,188,193, 37, 92,169, 75,105, 8,109,150,
+208, 16,219,109,131,209, 13,161, 0, 37,180,228,147,128, 7, 82, 79,114,117, 72,146,163,205,129,140, 14, 81,216,140,129,158,184,
+237,223, 94, 84,177,158,216, 4,224, 31, 32, 73,237,246,107,233, 9, 80, 79, 50,129,198, 79,194, 64, 35,215, 61,126,205,109, 95,
+111, 47,109,189,216,170, 85, 2,233, 91,105, 10, 6,221, 0, 3,160, 30,158,131,165,177,229,212,133,160,131,128,125,112, 51,211,
+236,243,208,105, 11,230, 60,201, 8,109,191,139,226,248, 78, 71,159,207,251,116,122, 20, 20, 50, 7,145,200, 61,199,151, 95,191,
+ 67,169, 36, 55,151, 49,215,161,201, 4,252,137, 0,246,233,161,179,111,219, 6,177, 6,221,251,126,255, 0,227,138,110,123,186,
+192, 82,130,150, 8,200,194, 73, 3,182, 73, 31, 61, 75,227,232,215,112,195, 99,223,219, 35,198, 38,227,110,133,131,105,238, 13,
+175,184,202,183,248,125, 93,173,121, 80, 32, 92, 54,253,118,207, 69, 45,203,170,246,167, 78,131, 84, 97,109,174, 60,137,213,122,
+ 35, 78,132,242,171, 48, 16,160,164,173,180, 40, 68, 24,149,143, 8, 54,158,138, 74,147,205,144,144,181, 99, 24, 3, 29, 15,109,
+ 77,123,217,103,184,103,103,189,143,246,187,116, 6,164, 81,171,123,149,186,219,227, 85,173,205, 79, 52,105,170,164, 82,174,168,
+214,139, 78,199,144,180,167,195,143, 48, 82, 93, 67, 79,160,169, 10,102, 26,210,135, 57,138,185, 98,156, 99,155,193,146,101, 73,
+ 89, 80, 12,138, 37, 10,177,139, 6,150, 66,173,201,141, 9,232, 76,161, 9, 36, 16,136, 25,200, 33, 72,197,129,225,126, 86,115,
+110, 47,162,164, 72,185,210,136,228,101, 7,117,187, 20,132,234,244, 26,101,111,190,214,223, 28,193,223, 63, 97, 79, 4,115,184,
+194,185,209,179, 27,239,185, 54,175, 14,116,135,150, 47, 93,165,163, 83,105,149,186,237,191,122,205, 66,164,162,196,218,237,215,
+185, 31,144,220,155, 36, 48,243, 62, 60,137,208, 39,207,167, 56,164, 69,140,229, 65, 78,120,204,111, 6,212,251, 26,125,155,123,
+125, 58,216,185,109,203, 55,136,138,110,227, 80, 37,198,122,216,220, 26, 55, 21,119,221,175,121,219,245,200,177,194,145,114, 81,
+170, 86,149, 42, 2,105, 21,166,212, 60, 80,227, 40, 75, 45,172,132,134,150,223,194,108, 27, 71,113,203,157, 91,184, 42,197, 34,
+ 81,147,122, 93, 21, 71, 34,115, 36, 46, 82,152,170, 10,100, 82,181,243,128,150,154, 17, 84,177,200, 6, 11,105, 81, 80, 1, 58,
+222,155, 74,229,118,163, 38,164,121, 90,136,212, 8,204, 83, 34,180,202,131,110,158, 98, 36, 84,159, 83, 97, 28,172, 45, 43, 91,
+109, 37, 72,230, 95, 43, 74, 4,164,144, 53, 71,103,220, 99,198,175, 58,200,217,245, 68, 48,132, 0,197, 3,242, 22,221, 8, 44,
+154,100,147,169, 93, 83,188,174, 86,218,156,144,111,212,220, 79,225, 79, 9,228, 78,100,161,201,225, 89, 2,172,143, 33, 82, 89,
+164,178,130,234, 9,180,107,204, 58,149, 35, 85, 80,157, 55, 14,113,212,219, 99,136,234,228,106,101, 18,155, 87, 66, 43,171,106,
+ 35, 20,230,230,213, 86,165, 86,106, 81,233,145,219,143,245,157, 94,162,202, 82, 39,213,158, 8, 74,228, 72,240,144, 31,125,213,
+185,225,160,171,151, 78,181,189,187, 22,141,226,232,140,220,143,169,234, 75,115,193,110, 28,247, 27, 75, 82, 94,236, 27,137, 40,
+ 30, 71, 22, 72,232,147,202,162,122, 0, 78,185, 81, 30,244,240, 36, 85, 11, 97, 75,143, 66,134,205, 38, 36,144,114,151,170,110,
+182,100, 75, 96, 4,171,162,144,234,163,165, 65, 32,245, 74,178, 8, 26, 10, 61,219, 41,136, 17,203,239, 31,124,142,204,154,156,
+175, 13,210,158, 95,136, 52,201,108,142,169, 62, 50,148,126, 69,191,150,148,202,184,199, 54,167,208, 37,169, 53,106, 7,153,101,
+243, 27, 0,162,250,143,152, 27,234, 59,146, 0,182,199, 21,248,142,186,130, 68, 16, 73,204, 22, 91,197, 37,200, 58,148,200, 0,
+ 63,105,108,186, 23, 99,179, 29,212,244, 27,233,106,113,119,182,151,183, 20,183,231, 10, 22, 90, 95,184,110,205,174,179, 85,117,
+110, 45,213, 17,214, 92,183,173,234,168,126, 51, 38,204, 66,193,230,145, 91,105, 50,153,247,130, 7, 35, 78, 18,214, 74,210,172,
+108,130,235,136, 99,157,106, 88,230, 57, 24,206,126, 30,184, 29,122, 99, 35,174,184,239,193,253,153,180, 27, 99,196,214,228,110,
+244, 17, 42,218,187,248,132,179, 97,219,181,104, 40,144,201,180,230,222, 73,172,174,167, 38,226,195,235, 46,192,175,213,208,195,
+104,125, 33, 94,236,228,180, 23,194, 91,114, 74,129,232,125,205,113, 42, 50,221, 64,113, 73, 41, 74,147,200, 62, 21,165,105, 39,
+ 60,201, 61,142, 2,178, 62, 90,181,184,106,180,102,212,111, 59, 48, 18, 60,132, 50, 0, 46,130,202, 66,144, 55,247,134, 61, 71,
+223,105,215, 25, 75,194, 85,210,100,173,193,144,212,211,209, 46, 91, 68,149,130,172,222, 99,154, 8,239, 94,118,188, 98, 35, 41,
+ 2, 1, 17,229,242, 66,157,152,184, 14,149, 74,248,109,178, 71,136, 2,123,168,115, 2, 14, 14, 57,186,118, 32,228, 31, 62,191,
+ 45, 97, 51, 47, 98, 23,151, 29, 87,134,165, 30, 85, 12,144, 73, 56, 9, 36, 28,115,140,128, 50, 48,190,217,242,214,190, 84,238,
+181,120,174, 53,206, 10,138, 20,251,121, 81,248,208, 14, 28,111, 62,153, 35,167,145, 94,177,148, 93,188,217,104,175,152, 41, 36,
+165, 46, 12,115, 32, 15,137, 25, 36, 18,180, 96,127,181,202,144,175, 93, 74, 99,129, 80,108,110,126, 63, 15,221,249,252,113, 22,
+167,164, 88,198,195, 87, 75,254, 23,239,215,227,252,142, 54,149,187,161, 46,158,100,184, 10, 85,203,158,101, 4,148,156,144,121,
+194,199,192,114, 21,229,141, 90, 42,114,158, 91,107,145, 76, 8,113,208, 10,213, 17, 74, 45,161,212,100,229, 76, 41, 32,144,224,
+234,174, 78,161, 92,159, 14, 20,113,166, 18, 37,213,201,202, 92,120, 40, 0, 57, 92, 36, 41, 65, 39, 56, 67,160,145,146, 15, 76,
+158,152, 57, 32, 19,157,102,144,110, 4,175,225, 82,207, 50, 70, 72, 4,148,117, 57,200,207, 83,144, 6, 64,237,203,243,234,149,
+ 69, 58, 78,154, 36, 23,244, 61,193,236,111,235,211,249,140,110, 67, 81, 45, 20,162,104, 13,237,177, 83,114,174, 63,101,198,215,
+ 30,253,136,189,193, 83,190, 47,109,215,101,185,200,130,228,102,194, 92, 90, 75,164, 58,231, 42,146, 73,229, 80,113, 35, 60,189,
+138,136,248, 74,128, 86, 58,234,234,212,199,221, 1, 78,200, 88, 33, 68, 16,142,102, 27, 82, 21,132,242, 40, 55,146, 82,112, 59,
+ 17,133, 39, 33, 64,231, 88, 13,198,183, 11, 6,169, 79, 9, 91,204, 2,185,108,130,176,149,181,132,149,201, 71,135,250,206,161,
+180,146,226,123,173, 0,158,139, 29,113,232,181,233,174, 28,169, 77,128,142, 71, 27, 45,169,120, 83, 43, 79, 55, 50,121,143,249,
+ 64, 84,147,211,161, 24,193,202,134, 98,211, 43, 81,204, 98,153,246,107,216,216, 88,131,109,238, 59,250,223,241, 6,248,157, 80,
+188,121,165, 42,212, 83, 34, 68,192,217,212,145,169, 24,117,235,185,235,117, 35,175,186,197, 67,227, 22, 64, 10, 60,141,168,243,
+128, 10,146, 74,212, 91, 65, 32, 37, 74, 41, 42, 91, 32,227,252,152,234, 9,207, 49, 35, 87,149, 84, 92,140,217, 90, 25, 74, 60,
+117, 4, 33, 47,165,213,199,195,201, 42,109,160,129,149,198,144,226,142, 19,206, 49,147,240,163,148,243,105,158,139, 82, 82,138,
+ 1,113, 92,142, 19,203, 33,183,156,229, 70, 87,204,203,109,242,184,163, 29,174,101,225, 33, 28,203, 82,148,148,148,231, 35, 87,
+196, 84,214,134,138,188, 73, 40,112,151,217, 83,209,203,109,180,180,164,252, 94, 34, 22,162,183,100,103, 28,223,168, 83,130,148,
+143,136,157, 47, 28,195,190,192, 88, 95,247,119,235,183,190,247,177,191, 77,244, 42,224,209,114, 95, 93,183,232,119,183,196,245,
+ 29, 59, 16, 63, 12,178,167, 82,117,101,214,158,116,143, 5, 24, 90, 23,206,135,176,149, 30,171, 28,152, 67,133,148, 37, 68,130,
+ 72, 82,136,233,216,106,111, 20,187,199, 75,216, 78, 31,183,187,123,107, 14, 3, 11,107, 54,178,243,187,194, 90, 57,118, 69, 74,
+ 29, 37,232,118,227, 17, 80,181, 15, 26, 67,151, 45, 70,140,218, 83,159,252, 98,186,121,105,253,153, 86, 47, 7, 9,115, 32, 43,
+ 45, 41,124,222, 48,200, 88, 62, 39, 83,200,159,140,117, 57, 42,192,233,231,168,229,253, 33,126, 36,209,101,112,247,183,156, 51,
+ 81,166, 20,220,123,253,118,139,190,234,105, 14,114,189, 19,107, 54,170,107, 47, 14,101, 54,172, 24,245, 77,192,149, 76,140,166,
+ 92,229,230,106,223,125, 65, 36, 5, 99,118,157, 26,170,122,122, 52, 39, 85, 75, 0,125, 66,117,118, 29, 62,202, 6, 59,122,116,
+190,198, 41,159, 87,166, 83,147,230, 89,163, 16,134,138, 38,100,189,183,152,128,144,169, 29,124,210,178, 41,223, 96, 73,219, 16,
+244, 92,153, 82,150,236,202,131,161,234,140,247,159,157, 80,125, 32, 97,234,132,215,151, 38,107,224, 96,116, 92,167, 94, 87,207,
+155, 66,172,131,211,207, 61,115,246,127,110,136,115,169, 29,135,115,161, 87,230,174,152,245,239,216,121,254,124,181,105,160, 0,
+ 11,108, 63, 45,182,199, 34, 42,236, 13,205,207,174,253, 14, 6, 86, 50,113,249, 63, 47,150,135, 81, 10,242,192,235,159,159,204,
+250,104,133,250,130, 20, 72,252,244, 26, 21, 71,161, 62,125, 79,223,165, 20, 18, 70, 21,192,234, 32,117,249,224,103,231,246,124,
+180, 51,131, 57,234, 1, 4,245,209, 90, 17,194, 14,122,247, 57,199,203,231,165,199, 81,129,129, 85,211,167, 82, 79,115,242,244,
+199,166,116, 42,200,207,108,117,199,219,215,207, 68,185,242,238, 7,159,111, 95,223,160,150, 79,126,152, 61,193,243, 61,127, 63,
+118,148, 65, 97,210,247,249,255, 0, 92, 12, 82, 36, 2,122,129,247,254,255, 0, 61, 45, 81, 95,235,119,242,252, 62, 95,159, 93,
+ 45, 31, 3,108, 86, 29,251,103,229,162, 52, 42, 87,219, 61, 15,145,199, 76,131,229,170,129, 68,158, 94,108,116,207,111,159, 94,
+190,189,244, 71, 2,221,108, 70, 14,195,173,190, 63,195, 7, 54,123, 21,125,223, 63, 67,162, 7, 95, 35,246,121,232, 38,240, 58,
+100,147,243,252,247,254,173, 22,149,245,244, 62, 94,126, 95,102,146,193, 58,116, 56, 41,161,203,212,156, 99,200,252,243,216,104,
+214,200,243, 0,253,248, 39, 64,165, 89, 29,191, 17,231,231,131,157, 86,108, 20, 44,168,172, 16,172, 1,159, 47,179,238,210,109,
+233,109,135,242,198,113,112, 10,193, 1, 67, 4,249,129,223,237, 35,243,215, 68,167, 3,168,200, 39,161, 29,191,102,122,118,208,
+169, 81, 32, 12, 12,140,119,237,140, 1,140,143, 60,232,128,172,100,156,100, 96,228, 96,147,246, 99,229,253, 58, 79, 24,193,141,
+168,119, 61,113,211,239,233,131,248,104,132, 28,224,245, 56,235,243,233,235,143, 45, 0,133,103, 3,168, 4,250, 14,255, 0,105,
+213,126,108, 17,133, 41, 57,207,234,250,255, 0,195, 72, 55, 94,183,198, 45,251,240, 96,194,212, 65,206, 15, 99,156, 99,167, 83,
+223,166,178,107, 86,133, 46,228,174, 83,168, 84,230,131,242,231,203,102, 43, 41, 89,195, 69,215, 20,122,190,224,255, 0, 37, 29,
+ 13,165,110, 56,175,230,182,210,136,235,140,226,141,149,172,148, 40,242,164,140,243, 0,115,229,231,167, 83,107,106,201,163,215,
+ 27,102, 59,168,106,161, 80, 68,168, 17,165,168, 14,120,254,244,202,121,148,223, 55,119,212,203,110,165, 63, 53,159, 44,231, 74,
+177,164,138,154,105, 34, 0,200,138, 72,248,250,159,147,183, 77,240,231,146,208,195,153,231, 25, 94, 91, 81, 57,166,167,174,158,
+ 24,157,199, 85, 87,117, 86, 43,125,181, 16,108,183,219, 81, 23,218,248,222,138,101,205,111,109, 53,188,139, 14,206, 6, 92,185,
+106, 97,219,158,165, 20, 33,169,181,218,147,105,229, 75,211,229, 39,172,106,107, 74, 42, 76, 88,249,229,105,177,148,165, 78,169,
+197,168,202, 52, 58,189,201, 45,107,152,251,134, 43,136,241, 26,136,133, 56,212, 96, 73,206, 22, 82,160,183,187,255, 0, 56,129,
+159,230,233,172,181,109,231,101, 77,113,174, 96, 84,151, 11,234, 90,143, 58,214,238,114,165,184,181, 28,173,106, 39,185,234,115,
+211,167, 77,109, 61,163, 22, 44, 22, 27, 91,137, 83,171, 74,128, 82, 1,207,234,158,188,201, 56, 29,255, 0, 15,232,173, 43,102,
+142,152, 57, 86,230,207, 39,153,152,245, 98,109,185,219,238, 30,131, 97,176,176,238, 92,135,135, 96,160,165,130,158,154,139,217,
+233,169,194,164, 80, 40,217, 20, 91,173,247,102, 39,119, 98,117, 51, 18,204, 75, 18,113,157, 88, 27, 77, 6,162,243, 10, 91, 45,
+173,210, 17,204,134,249,192, 79, 80, 63,214,237,246,249, 13,116,123, 98,182, 58, 4, 74,205, 30,167, 79,136,195, 21, 8,242, 27,
+109,110,132, 5, 41, 73, 87,235,167, 43, 4, 56,130,140,228, 96,131,208, 99, 90,225,182, 40, 67,142, 48, 16,148,176,211,139,108,
+165, 13,164, 41,196,146, 1, 0, 28, 0,122,103,200,227, 93, 65,218,186,205,175,107,194, 23, 45,203, 58, 29, 22,218,182, 96, 72,
+174,220,149,170,131,237,177, 22,155, 74,165,199, 84,185,211,101,200,116,132,182,210, 35, 52,242,142, 78,112,156, 0, 78, 6,171,
+ 12,238,173,234,222, 88,228,156,164,106, 9, 35,215,160, 2,195,177, 61,189, 58, 92,224,103,185,230,105,150, 32,167,167,102, 26,
+193, 82, 7,165,183, 6,219, 90,219, 1,190, 56,205,197,103,181,207,127,173, 13,203,184,118,215,133,170,141, 31,104,108,203, 18,
+227,169,219,114,110, 38,173, 59,114,175,120,222, 85,138, 12,199, 41,181,154,156,153, 53,154,123,241,232,148,133, 84,163, 74,110,
+ 60, 86, 88, 82,220,105,176,227,238,146,190, 68,232,182,233,123, 64,184,141,223,154, 60,154, 6,249, 57,181,123,167, 78,146, 84,
+227, 18,107,187, 67, 98, 81,110, 42,116,165, 0,145, 34,159,117,218,148,120,114, 99,114,227,163,101, 42, 70, 84,115,229,173, 86,
+221,155,170, 61,231,185, 27,133,121, 69, 66, 4, 43,174,251,188, 46,104, 37,150,148,210, 87, 78,184, 46,106,173, 86,152,226, 26,
+ 95, 86,138,160, 76,140, 84,147,241, 37, 74, 32,128, 65, 26,194,202,138, 27, 72, 66, 66,146,164,249,147,216,250,231,207, 87, 69,
+ 31, 7,240,224,142,134,170,163, 33,165,108,202, 5, 70, 19,180, 17,154,132,144, 1,186,205,167,154,132, 27,219, 75, 46,158,139,
+101,216,113, 46,113,196, 25,150,101,152,213,213, 75, 88,211,164,146,185, 69, 33, 74, 4,212,116, 0, 45,109,150,194,253, 77,174,
+196,146, 78, 25, 29,226, 14, 57,121,205,113,232,130, 3,142,211,225,184, 35,161,210,251, 60,158, 24,194,153,113, 74, 39,194,232,
+ 48, 51,240,246,211,245,236,251,162,194,185,248,143,179, 45,121, 83, 19, 21,250,213,203,107,181, 9,165, 71,118, 87,191,186,213,
+102, 27,130, 3, 81,152, 66,148,243,239, 41, 41,105, 3, 24, 5,238,101,124, 41, 58,101,247,161,159, 22,181, 69,168, 39, 42,110,
+109, 13,166,193,234, 48,228,124, 36,164,245,239,145,174,129,251, 9,174,186, 5,165,237, 66,225,233,203,134,153, 75,169,179, 93,
+122,232,183,105,102,171, 29,185, 77,211,107,245, 27,114,161,245, 77, 90, 19,110,130,148, 84,153,121,149, 6, 86, 70, 82, 94, 37,
+ 63, 16, 4, 76,106,145,166,225,202,216,163,115, 19,154,118, 0,141,244, 17,182,175, 48,111,179,107,216,131,211,124, 55,240,245,
+ 50,102,121,237, 29, 36,238, 33, 74,218,128,140, 64, 27,115, 13,172,189, 64, 38,246, 91,130, 3, 17,112, 70,216,253, 60,108,203,
+170, 61, 38,218,163, 69,169,210,215, 6,123, 52,168, 12, 42, 18, 30, 74,149, 13, 45,197,109, 30, 2,136,232, 84,156, 96,142,195,
+ 24,211,173, 99,205,135, 95, 67,163,195, 82,216,105,226,174, 71,124,148,149, 2, 51,235,129,141,105, 44, 90,227,175,203,110, 58,
+159, 60,234,145,200,227,139, 86,113,133,225, 74, 81,201,236,156,159,187,231,170, 28, 4,113, 50,246,254,220,188, 78,211, 27,167,
+174,157, 67,217,253,200, 98,198,160, 62,226, 84,149,213,154,110, 59,134, 85, 65, 74, 80,193, 38, 67, 46,128,145,156, 36,167, 56,
+206,171,117,160,130,138,122, 97,237, 82,206,210, 2,164, 74,193,245,233, 0,234, 42, 2,170,144,127,100, 1,189,173,233,213,116,
+ 57, 94,103,152,229, 89,246,102,140,213, 17,228,201, 12,179, 73, 36,128, 58, 9,234, 18,153, 52, 40,182,162,210, 72,183, 8, 0,
+ 85, 5,141,128, 24,234, 84, 22, 97,190,160,211,140,160, 37, 73, 9, 37, 39,151, 35,203, 4,118, 61, 53,114,153, 78,153, 71,107,
+235, 40, 14, 61, 50,158,222, 60, 88,104, 36,186,207,108, 43,161,248,155, 29, 63, 29, 97, 20,201,202, 47,103,152,116,235,202, 79,
+126,158, 94,167,229,242,211,203,110,200,247,142, 86,186, 45, 43, 28,139, 74,199, 69, 36,140, 40, 28,142,185,211,232,142, 26,149,
+210,124,143,250,172, 54, 32,246,233,212,123,143,108, 87, 57,193,168,203, 88, 74,126,186, 30,174,140,110, 24, 27, 95,115,186,183,
+163, 11, 88,251,182, 38, 90,149,147, 81,103, 43,113, 42, 36,101, 41, 4, 97, 63,236,131,246,106, 57,159, 74,191,116, 98, 90,254,
+207, 59, 39,109,189,229, 13,212,183,107,126, 44,232,173, 70, 10, 79,139, 34,151,103,194,170,220, 21, 37, 33, 4,228,182,151, 83,
+ 3,152,129,211,196, 79, 81,158,178, 30,102,146,109,219,145, 41, 96, 40, 65,169, 43,197,142,145,209, 8,117, 68, 7, 25, 3,237,
+ 80, 32,127,181,168, 24,253, 41,190, 42,105,187,177,198, 54,217,240,225,110, 85, 81, 54,139,195,101,145, 34,125,214,152,206, 7,
+ 99,181,184,187,128,182, 37, 59, 9,124,170,199,189,197,183, 98, 83,146,176,122,161, 83, 8, 58, 74, 58,202,145, 17,201,101, 26,
+102,168,170,131, 88,244, 90,105, 22,173,158,223,176,226, 5,136,155, 90,243, 32,234,192, 98, 1,158, 71, 76,139, 85, 95, 79,189,
+ 36,176, 18,155, 91,205, 48,228,232,235,246,147, 91,189,183, 39,148,198,196, 2,113, 23,105, 12,224,142, 92,114,128, 57,115,230,
+ 60,193, 31,158,218,166,220,116, 96,148,167, 35,185, 0, 30,135,231,131,219, 70, 58, 91,112,228,147,129,219,200,129,212,245, 26,
+163,239, 1,162,164,182, 58, 16, 2,148, 48,123,246,233,248,234, 69,123,110, 78,199,253, 49, 95,238,192, 91,182, 41,184,218,146,
+112, 2, 85,145,205,128,115,240,232,117,175,166, 2,185, 84,122,144,123,252,146, 48, 58,249,126, 26,246,165,183,205,207,226,242,
+ 41, 68, 0,146,160, 57,188,186,141, 8,236,164,182,248, 10, 66, 79, 40,192, 24,234, 78, 51,205,246,235, 5,182,178,131,140,233,
+ 61,206, 62, 37, 37,100,130, 84,143, 85, 20,247,251, 9,215,196, 52,218, 22, 28,108, 23, 20, 73, 10, 73, 32, 16, 58,117, 3, 29,
+117,111, 83,203,146,247, 41,116,161,190, 96,162,140,245, 64, 79,113,246,247,209,173,134,220,112, 58,130,174, 68,156, 21, 96,167,
+ 56, 29,142,124,186,235, 23, 38,226,214,237,108, 24, 0, 8,223,231,108, 84,202, 80,181, 45, 75, 37, 10,236,140, 14, 84, 19,208,
+ 21, 19,249,206,145,240, 91, 89, 35, 4,168, 2,181, 39, 36, 1,143, 63,207,219,175, 14,180,248, 91,135,225, 44, 44, 19,203,230,
+113,158,202, 35,190,147, 72, 75,188,184, 10, 97,180,167,149, 94,101, 68,116,193,200,235,219, 67,113,176,234, 62,253,255, 0,241,
+140, 88, 27,158,199,247, 99,223,138,128,176, 16, 74,202,192,200, 64,234, 51,216,159,151,174,144, 56,112,168,255, 0,226,210, 65,
+ 39,211,169,193, 30,191,219,161,201, 91, 97,101, 11,229, 33,124,169,112,164, 97, 67, 25, 41,193, 29, 62,221, 18,149, 30, 64, 28,
+ 41, 83,138,201, 81,233,203,131,211, 7,167, 95,158,178,160,129,238,248, 99, 4, 11,219,211,111,159,187, 23, 91,122,216,174,223,
+151, 45,171,103, 91, 30, 48,173, 94, 23, 45, 2,211,161,169,134,124,101,166,185,117,214,160,219,116, 71, 18,206, 63, 72,148,213,
+170,176,202,135,110, 84,156,234,116,188, 70, 90, 86,214,200,237,141,191,195,253,145, 22, 45, 26,196,217,203, 30,212,219, 59,118,
+140,216, 15, 52,105,182, 85, 52,210,220,144,228,146, 7,188, 57, 58,187, 14,173, 81,121,213,101,199,100, 86,221,117,213, 5,175,
+ 81, 5,246,122, 41,151,120,231,225, 49,165, 45,167, 25, 70,253,237,171,138,109, 68, 6,138,152,185, 35, 72, 66, 58,164,128, 60,
+ 86, 81,140,142,248, 24,212,167,184,174,185,213, 80,146,133, 73, 46,189, 42,116,101,176,243,171,116,136,206,165, 92,181, 24,242,
+ 29, 66,122, 56,175,137,244, 12,128,174,102,202,115,202, 19,170, 83,197, 9,101,168,206,184,107, 46, 36,242, 99,215, 57,177, 27,
+176, 33,119, 7,246, 0,242,159,241,145,183,126,148,250, 56,229,176,205,157, 87,230, 36, 3, 52, 82, 67, 18,237,186, 42,142,113,
+ 96, 78,222,114, 22,253,238,138, 65,198,134,236,221,125, 48,227, 85,230, 51, 33,182, 20, 46,139,193, 78, 71,146, 11,172,173, 49,
+107,213, 39, 22,218,176, 65,104, 45,181, 17,240, 28,231, 10, 57,192,214,224, 91, 87, 56, 52,186,124, 87, 37, 60,195, 17, 27,114,
+181, 86,168, 52,165, 33,208,211,232, 84,135, 35,180, 82,172, 45,194,149, 57,206, 62, 17,225,181,156,149, 19,174,110, 88, 21,191,
+119,114,244,165,183,202, 67, 27,155,118,199, 87, 58,178, 4, 89, 50, 96,212,208,176,140,117, 30, 4,208, 18, 6,122, 47,168, 24,
+193,216,148,220,233, 17, 19, 8, 58,234,126,185,152,195,115,214,218,208, 94, 77, 49, 13,178,244,133,248,196, 0,223,193, 29,180,
+ 33, 36,116, 68,133,242,242,101, 71, 81,250,188,185,106, 15, 67,113, 99,239,183,107,245,232, 9,183,107,219,224, 58,227, 63,165,
+142,190,158, 48, 77,158,254, 98, 55,217,118, 36, 14,246, 5,200, 7,112, 64, 22, 35,166,219,210, 47,185, 82,233, 80,131,107,114,
+ 60,217, 83, 30,159, 55, 1, 97, 10,126, 99,143, 59,200, 93, 39, 36,248, 79, 52,216, 74,146, 85,208,149, 28,227, 87, 58,150,229,
+ 67,154,202, 4, 96, 35, 72,171, 77,110, 44, 73,100, 36,180,229, 58,157,136,136, 91,136, 10,230,111,157,193, 37,215, 17,208,101,
+244,168,228,117,214,181, 64,187,158,122, 93, 82, 99, 15, 54,251, 37,214,153,128, 31,117, 72,105,199, 39,177,225, 23,146,164,156,
+ 48,194, 20,135,157, 91,128,140, 41,148,243,100, 17,156, 82,117,230,220,185,110, 46,150,234,204, 86,210,213, 38, 18,207, 68,178,
+246, 20,194,221,232, 57,159, 45, 69, 67,133, 75, 72, 8, 74,217, 4,243, 28,107, 65,114,134, 28,192, 19, 72,150,215,216,116,216,
+247, 29,143,240, 35,215, 20,246,103,146, 44,245, 78,252,176,174,237,171, 80, 54,208, 8, 14, 67, 30,182, 4,169, 0,130, 8,141,
+150,215, 27,108,165, 82,240, 65, 91,130, 60,226,182,132,167,101,192,151, 29,238, 83, 25, 20,197,120, 81,158, 74,218, 87,253,240,
+ 30, 74,156, 5, 56, 40, 82,144, 70, 78, 52,237, 90, 94,211,206, 31,238, 61,215, 87, 13,251,187,120,211,246, 99,125,216,166,219,
+ 53, 27, 46, 70,225,213,169,180,173,188,223,218, 29,126, 20,116,211,238, 11, 14,254,117,214,224,219,183,114,235, 2,165, 77,157,
+110,215,151, 5,255, 0,172, 41,143, 26,124,233,201, 95,132,215, 47,235,155,134,253, 49,169,137,139, 33, 17,217, 13,120,112, 82,
+ 15, 49,240, 35, 44,163,195,112,169, 32,252,110,120,100, 14,255, 0, 6, 84, 78,117,197,111,105,134,220,238, 93,231, 65,219, 45,
+247,167,109,213,197, 90,217,251, 58,155,114,237,149,225,186, 16,105,102,169,111,209,111, 26,133,206,237,223, 6,220,186, 37, 68,
+ 46, 57, 71, 74,105,117,120,239,199,126, 99, 76,195, 90,234,170,101,153, 10,125, 14,182,139, 3,128,178,227, 14,113,200,102, 49,
+197, 94,146, 41, 26,186, 58, 14,100, 76, 1, 54,102, 4, 50,105,239,205,107, 48,109,241, 25,226,106, 58,222, 29,225,154,236,230,
+154,152, 85, 54, 88,209,177,136, 41, 60,216,218,101,137,193, 42, 24,198,232,143,175, 85,138,168,137,139, 93, 73, 6,112,183, 37,
+ 78,163, 2, 75,208,150,135,161,212, 82,216,153, 17,169,141,173,151,176,166,195,172,115, 50,232, 25,142,243, 42,192, 88,248, 20,
+135, 67,169, 82,146, 1,214, 30,110,102,229, 6,164, 37,229,248, 15,167,153, 14, 21,167,199,131, 45,149, 41,178,218,193,232,133,
+ 37,208,234, 20,133, 14,138, 74,146,161,200,172,136, 53,240,131,237,106,226,159,133, 24, 84, 59, 53,218,219, 59,239,178, 52,133,
+176, 33,109, 62,233,213, 42,115, 87,110, 83,210, 19,207, 27,108,183, 21,133,187, 86,176, 89, 90, 16,222, 98,161, 83,232,235, 9,
+248,233, 74,207, 48,145,223, 13,254,212,238, 15,184,152,159, 78,162,209, 47,183, 54,118,249,175,188,219, 14,237, 94,249, 74,164,
+218,245, 37, 92, 79,169, 49, 99, 27, 63,112,216,112, 91,183,164,105,106, 74, 80,226, 84,253, 38,123,107, 83, 14,125, 94,162,183,
+ 66,108,186,204,183, 48,166,102,149, 71, 62,156, 30,169,168,233, 30,174,159,105, 0, 23, 14,192, 50,168, 43,245,131, 77,196, 95,
+135,248,215,135,243,244,142, 40, 42,125,147, 48, 63,251, 60,246, 73, 9, 31,170,141,253,220,164,236, 80, 35,107,102, 86, 28,176,
+ 93, 65,235,149, 54,227,231, 82,252, 98,143,120,111, 30, 50, 3,153, 10, 74,242,148,190,207, 95,141,149, 1,219,201, 64,160,158,
+157, 92, 10, 45,120, 41, 72, 30, 42,210,211,129, 60,138, 36, 39,194, 40, 56, 9,201,199, 34, 15,194, 82,125, 71, 47, 98, 51,173,
+ 78, 57, 42, 4,150,225, 74, 68,136, 85, 24,204, 38, 66, 27,148,194,153, 91,140, 60,112,210,188, 53,165, 42, 92, 71, 18,144, 65,
+ 31, 2,199, 43,141, 41, 93, 9,204,232,245,213, 45, 41,192, 82, 28, 24, 15, 5,245, 67,125, 1,240,211,143,214, 37, 36, 97, 93,
+148, 8, 56, 7, 58,212, 89, 53, 45,155,126,155,250,244,189,247,220,131,214,195,222, 7, 80, 36, 83, 0,111,109,143, 66, 55,176,
+233,219,176,244,244,232,113,182,208,103, 41,109, 2,130, 8, 28,170, 10, 7, 24, 72, 25,194,155, 35,170,130,179,216, 16,115,215,
+ 3, 58,111, 43, 10,114,143, 57, 62, 8, 83,116,247,138,158,104, 35, 42,247, 7, 50, 75,237, 35, 36,226, 62, 87,206, 17,241, 16,
+ 21,132,140, 32, 1,125,182,231,180,168, 76, 58, 9, 40, 84,116,130,133, 30, 98,133, 5, 4,164,144,145,213, 29,122,131,213, 61,
+ 0, 36, 29, 13,118, 6,157,142,165,164,161, 74, 66,131,137, 36, 16, 75,137, 11,198, 66, 58, 1,225,133,117, 7,177,199, 76,105,
+179, 52,167, 21, 20,206, 20, 94, 88,188,203,247, 14,159,247, 13,175,219, 99,141,204,138,188,229,245,233,172,222,154,164,132,144,
+123,143, 71,223, 96, 84,155,244, 59,106, 94,135,127, 84,218,177, 40, 8,109, 77,171,152, 21,173,176,163,224,169, 71,153, 72,125,
+ 10, 73,232,160, 71, 80,122,228,147,140,224,235, 37,102,160, 10, 82,164,185,132, 45, 57, 74,215,202,149, 96,228, 37, 5, 93, 73,
+ 30, 65, 68,115, 96,128, 73,233,134, 98,157, 41, 13, 56, 75, 78,101, 30, 32, 41,200, 60,139,109,106, 31,174,223, 79,137, 36, 30,
+189,207, 76,140,117,214, 72,221,101, 45,182,162,165, 36, 32,100,243, 41, 75, 81, 70,115,204, 0,245,193,235,219, 60,157,117, 24,
+134, 67,166,254,131,225,214,223,195,240,185, 63, 9,141,122, 6,118, 85, 58,239,247, 92,246,191,191,212,255, 0,166, 51, 26,229,
+207, 71,161, 82,171, 21,250,253, 86, 21, 10,222,160,210,170, 53,218,245,110,162,164,183, 78,161,208,104,176,228, 85, 43,117,153,
+206, 45, 73, 9,137, 18,151, 18, 91,238,228,225, 72,142,160,158,165, 57,252,241,248,236,226,198,175,198,143, 19,187,139,190,210,
+211, 34, 37,167, 54, 67, 54,134,209, 80, 36, 40,149, 91,187, 67,106, 59, 42, 29,153, 29,224, 82, 63,247, 86,123, 78,203,172, 84,
+ 21,128,163, 54,224,117, 10,232,210,117,219,143,110, 55, 31,168,247, 9,220, 13,237, 45,117,106,153, 60, 65,155,196,245,118,153,
+ 33, 73,250,186,148,129, 22,167,110,108,123, 50,218, 88,204,249,174, 8,181, 59,157,180,158,102, 99, 49, 2,144,247, 42,222,154,
+216,140, 58,201, 42, 87, 55, 92,245, 24,242, 62, 93, 51,208, 99, 86, 23, 10,101,174,168,115, 74,133,179,204,161, 98, 4,110, 35,
+184, 38, 79,255, 0, 83,109, 63,224, 1,129, 34, 76,115,135,139, 28, 75, 29, 69, 68,124, 51, 69, 46,168,168, 95, 93, 91, 41,184,
+105,192,178, 67,126,252,133, 36,200, 55,250,214,208, 64,120,119,164,226,207, 66, 6, 58, 99, 61,253,127,110,168, 40,146, 14, 79,
+145, 3,176,234,117,236,175, 32,140,119,245,254,173, 14,178, 50, 7,166,115,251, 53, 54,197, 56, 6,195,215,223,143, 26, 25,222,
+163,190,112,127,103, 95,199,190,136, 80, 4, 28,249,117,233,242,208,171,236, 62,223,191, 74,170,144, 55, 30,252, 27, 3,172, 12,
+ 19,233,219,241, 26, 21,194,122,100, 96, 15, 50,122, 99,167,203, 68, 45, 88, 7,168,198,127, 12,119,207,207, 39,246,104, 39, 14,
+ 65,238,122,244,207, 92,117,243,209,240, 49, 73,194,122,158,135,167, 78,221,191,225,160,214, 70, 49,230,127,175, 85,214,124,179,
+246,254,237, 12,162,115,131,131,230, 15,203, 74,168,176, 3,231,255, 0, 56, 24,164,161,156,124, 57,251,241,165,175, 42, 81, 4,
+128,123,105,104,248, 61,215,161,234, 61,195, 9, 4, 17,131,140,142,223,159,183, 85, 65,193, 7,254, 56,208,233, 56, 57,252,117,
+ 84, 28,245,242,237,243,207,245,104, 16, 14,221,176,115,176,176,216,246,251,173,130,144,113,212,117, 31,209,147,251, 52, 64, 81,
+ 7, 3, 57,199, 92, 12,227,237,208,169, 35,151, 56,237,220,122,227,174,171,161, 97, 64, 96, 17,233,247, 31,233,206,144, 35,125,
+251,225, 50, 15,218,181,186,127, 44, 28,217, 61,137,207, 79,219,211, 69,160,115, 4,228,115, 96,228, 12,227,183,110,191,142,129,
+ 66,176,164,143, 53, 1,246,117,209,136, 61,199,167, 81,162,144, 13,182,219, 5,193,232, 56,201, 61,187,103,231,233,170,157, 57,
+128,201,237,219,190,122,158,195, 61,244, 58, 14, 70, 85,219,229,220,254, 78,137, 78, 6, 9,248,142, 58, 30,199,229,215, 73,176,
+ 32,251,176, 49, 85,178, 80, 71, 49, 24, 29,179,128,122,159,234,206,170,161,228,172,227, 5, 63, 51,208,106,130,129, 57, 36, 12,
+ 43,246, 12,103,250, 53,245, 33, 41, 28,169, 39,168,200, 39,169,243, 62,154,215,113,110,214,192,193, 69, 75, 80, 41, 11, 40, 72,
+242, 79,235, 44,117,198, 14,142,138, 84,193, 74,208,181,165,208, 82,164,172, 44,165,214,212,133, 5,182,227,107, 79, 84, 56,149,
+ 0, 82, 71,108,122,116,213,184, 21,116, 32, 12, 36, 16,175, 92,121, 99,240, 58, 41, 11, 82,192,198, 50,156, 1,158,159,143,207,
+ 73,144, 8, 32,238, 14, 5,200, 32,131, 98, 8, 32,251,198,227,247, 28,108, 53,141,190,213,107,108,134, 43,180,182,171,204,124,
+ 41, 19, 35, 60,136, 85, 18,145,128, 11,205,175, 13,186,160, 60,210,164,149, 28,156, 13,108,141,181,197, 54,220, 70, 82,197, 66,
+151,116,195,121, 72,202,146,221, 49,185,109,229, 32,244, 75,141, 75, 60,221,199, 95, 93,115,201, 4,164,124, 94,189,207, 82, 7,
+168,253,186, 37,176, 66,144, 22, 84,164,142,169, 32,227,161,236, 8,243,244,251,245, 28,174,225,188,174,181,153,164,137,162,103,
+235,203,114,160,244,191,151,117, 31,114,140, 91,121, 55,141,220,125,147,211,199, 74,107,169,243, 88,225, 80,170,107, 41,214, 89,
+ 52,139, 90,242,161,142, 87, 35,177,119,115,110,248,235,133,191,199,206,218,219, 45, 52,170,125,157,118,214,229, 55,146,132,186,
+136,148,166,213,201,219,244,179,102,224, 18, 71,250,170, 3, 29,180,196,241, 5,199, 86,232,111,197, 1,251, 8, 50,221,147,182,
+143, 56,211,211,237, 58, 60,167,100, 74,185,156,140,226, 94,138,213,215, 87, 83,109,251,229, 61,183,144,219,158,226,195,104,140,
+227,141,161,111,151,249, 82,145,162, 3,148,130, 92, 5,192, 20, 20,148,231,148, 55,212,227, 4, 14,186, 61,162, 86,176,146,225,
+ 80, 56,228,194,113,201,219,161,207,235,116, 56,211,117, 47, 5,112,245, 21, 84,117,201, 69,207,170,132,134, 71,149,218, 77, 12,
+ 8, 33,149, 73,229,134, 82, 46,173,163, 82,145,169, 72, 32, 28, 53,241, 15,138,188, 97,196,116,243, 82,213, 84,195, 69, 77, 80,
+ 10,200,180,176, 44, 69,212,245, 83, 35, 25, 38, 10,219,134, 85,145, 85,193, 42,192,169, 32,158,135, 75,235,241, 20,165,243,156,
+130,149,228,227,191,234,252,191,175, 69, 53,226, 20,169,146, 9, 42, 80, 87, 50,134, 0, 79, 79,192,118,208,142, 44, 52,130, 84,
+175,137, 56,248,146, 49,143, 64,122,117,233,170,145,222, 81, 66, 66, 73,248,178, 73, 87, 82, 79,108, 12,246, 29, 53, 36, 61, 54,
+ 29, 62, 70, 43, 94,183, 35,123, 91,175,205,241,136,238,148, 54,166, 91, 20,250,139, 88, 47,209,166,170, 59,233, 79,254, 76,255,
+ 0, 80,172, 99,160,230, 39,240, 58,198,120,103,221, 57,187, 25,196,150,199,238,244, 21,134, 94,176, 55, 62,210,175,186,181, 28,
+ 15,112,143, 87,142,138,146, 84,113,217, 84,215,101, 39,255, 0,165,167,117,218,108,106,205, 62,177, 68, 90, 2, 93,157, 79,120,
+165, 71,245, 68,134, 82, 86,218,243,228,123,254, 61,245,167, 85, 38, 11,109,188,210,135,233,152, 91,140,184,160,122,120,145,212,
+ 83,145,142,255, 0,171,251,117,187, 66, 18,104,170, 41, 36,251, 18,234, 83,255, 0, 68,162,196,254,253, 93,251,227, 20,149, 82,
+101,249,133, 45,100, 91, 73, 4,145,202,189, 62,212,108,174, 63, 16, 49,250,180,211,238,200,245, 37, 67,171,211,156, 15,194,174,
+ 65,129, 89,167, 45, 4, 20,189, 10,173, 21,153,145,214,133,121,160,178,242,122,249,231,190,180,239,217, 89,188,242,168, 28,101,
+113,223,195, 53, 74,165, 21,248,241,110,200, 59,151,105, 48,148, 54,212,150, 99, 85, 66, 25,171, 70, 90,211,133, 72, 8,121,198,
+149,215, 37, 35, 61,129,214,138,112,241,237, 18,181,246,247,217, 85,195,199, 23, 55,221,185, 92,188, 87,110,170,222,216,155,158,
+135, 70,113,168, 85, 74,133,213, 66,154,237,182,137,209,228,212, 2, 90,247, 81, 18, 12,119,150,178,172, 40, 40,165, 36,172, 99,
+ 92, 76,225,195,218, 43,112,108,191,180, 68,241,163, 87,137, 53,218, 13,213,121, 85, 13,251,109, 69,117, 79, 59,252, 93,220,210,
+ 61,214, 85, 57,148,140, 9,179,169,240, 12, 87, 90, 24,253, 35,176,207, 39, 85,140,213, 94,201, 95, 89, 89, 81, 50, 68, 88,229,
+ 41, 44, 77, 97,114,211,137, 33, 50, 70,130,251,177,141, 24, 11,126,210,130,124,216,234, 92,247,139,178,110, 30,135,135, 86, 26,
+240,171,156,212, 69, 53, 68, 96, 18, 70, 89, 60, 14, 18, 89, 46, 45,161,102,104,166, 0, 18,247,167,107, 0, 6,255, 0,166, 5,
+ 42,103, 57, 65, 82,185, 64, 32,133,247,194,134, 58, 28,253,191,183, 79,189,167, 40,130,133, 15,136,130, 15, 48,207, 92,244,234,
+ 62,127,191, 90,215,182,213,122, 45,249,108, 90, 55,197,175, 49, 85, 11, 94,248,160,211,110, 91,114,123,145,228,195, 92,170, 77,
+ 82, 51,114,163, 41,232, 51, 90,109,232,174,134,220, 0,165,196, 37, 67, 29,181,181, 22,173, 32,176,218, 22,172, 0, 58,144, 15,
+ 48, 35,161,232, 51,211,182,149,165,204, 0,210,250,182, 96, 8, 55,216,131,107, 17,234, 8,177, 7,208,223, 12,252,106,244,209,
+ 69, 44, 79,229,112, 89, 74,158,160,131,165,148,142,161,131, 2, 8,234, 8, 32,216,139, 99, 84,189,166, 92, 73, 94, 92, 36,240,
+ 71,190, 60, 72,109,253,170,139,190,243,218,251, 81,202,181, 6,152,247, 63,185,197,151, 53,246,105,136,172, 84, 2, 7, 50,224,
+ 67, 84,180,200,117, 35, 4,165,140, 2,158,227,242,123,220, 13,193,188,183,102,246,187, 55, 70,255, 0,174,202,185,175,125,193,
+184,106,119,117,217, 95,154,225, 92,154,165,106,179, 33, 82,165,200, 61,127, 70,202, 74,130, 26, 64,248, 91,109,180, 33, 32, 37,
+ 35, 95,176,103, 17, 91, 65, 79,226, 3, 96, 55,155,100,106, 73,104,195,221, 29,180,188, 44,162,167,194, 11, 49,228,215,104,147,
+ 33, 65,146,176,160, 71, 43, 83, 28, 97,207,145,107, 58,252,126,111,173,183,174,109,101,223,114,237,205,200,243, 14, 87,172,107,
+134,183,104, 86, 21, 21,196,191, 31,235, 27,118,163, 34,153, 41,108, 62,142,143, 50,181,199, 42, 74,135,250,248,242,211,205, 11,
+ 23,205,103,169,168,185,146,170,158, 46, 83,159, 68,102, 90,132, 67,211,202, 69, 43,202,122,183, 50, 37, 98,121,105,106, 87, 55,
+ 74,198,201,233,231,141, 79,232,234, 57,204, 82, 16, 6,132,158, 85, 50, 83,153, 27,174,169, 99, 74,129, 10, 55,149, 68, 19,180,
+118, 47, 41, 56, 67,100,168,171,151,155, 61, 79, 95, 60,122, 15, 61, 35,130,164,243, 43,195,200,232, 85,144,149, 30,190,103,160,
+235,163,138, 10, 81,148,161, 61, 1, 57,207,196, 1,237,229,215, 58,179, 73, 73,100, 1, 32,169,109,175, 10,108,133,117, 65, 61,
+ 64, 35,211,190,164, 33, 71, 78,184,138, 6, 12,221,108,127,211,249, 99,203,205, 18,188,146,148,164, 30,157,114,114, 49,212,122,
+121,235,227,237, 45,212, 2, 7, 84,167,184, 57,230,251,255, 0,214,210,105,196,231,225,201, 72, 78,112, 71,161,193,239,249,235,
+162,163, 54,227,231, 9,229,102, 56, 25, 86,126, 37, 18, 58,142,158,154, 26, 64,223,165,177,147,211,115,112, 58,252,252,223, 22,
+213, 70,117,150,146,176,201, 81, 88,230, 39, 35,152, 1,253, 61,115,159,248,104,168,146,144,231,232,202,255, 0, 85, 56, 40,229,
+ 0, 30,157, 78,124,245,114, 83, 5, 65, 72, 11,202,122,142,131, 4, 30,196,245,208, 41,136,220, 55, 57,130, 80,160,172,229, 74,
+ 5, 71, 24, 57,192, 61,188,255, 0, 13,102,195,174, 10, 13,246,245,219,231,231,243,194, 75,106, 66,138,139,202,121, 62, 73, 39,
+ 41, 64,244,249,235,195,175,165, 29, 16,164,129,215, 3,176, 10,244,237,242, 58, 13,247, 86, 20,162,210,241,205,219, 9,199, 76,
+118, 57,252,252,244, 57,121,183, 22, 18,162,114, 8, 46, 36,167,166,122, 30,132,122,147,160, 1, 61,122,224,218,109,176, 59,124,
+252,244,193, 73, 62, 42,249,210,160,160, 6, 10, 58, 4,243,117,237,215,174,169,202,116,144,148,163, 9, 35, 41,232,112, 73, 35,
+ 26,244,226,149,225, 44, 52,218, 83,202, 50, 6,112, 73, 3,166, 20, 60,186,106,200, 38, 56, 22,159, 25, 41, 42, 74,136,229, 35,
+ 39,237,230, 7, 25, 25,253,154,205,172, 79, 99,140,129,115,240,254,120,124,184,115,189,156,218,173,243,217,253,196,140,226,154,
+114,201,221, 29,189,186,157,144, 2, 28, 76,104,148, 91,202,137, 62,170,234,144,226,146, 10, 19, 71,106,164, 78, 72,192,235,229,
+214, 89,252, 84, 79,135, 38,165, 91,167, 64,144,125,222, 21, 90, 83,212,194, 9,203,148,103,102,202,149, 75,147, 29,226,231,198,
+199,134,165,180, 86,174, 83,250, 48, 82,145,204,117, 12,134, 36, 32, 58, 89,144,219,141, 68,148, 28, 97,215, 25,112,135,124, 41,
+ 13,150, 30, 13,148,156,182,191, 13,197,224,142,160,224,143, 93, 73,106,193,222, 9,123,221,195,158,213,110, 37, 84, 5,220,177,
+173,145, 99,221,170, 9, 90, 82,245,211, 97, 33,139, 66,186,235,106,113, 41, 18, 89,144,221, 38,151, 80,109,206,169,241,170, 79,
+ 3,133,165, 68,213,126, 32,229,133,243, 12,131, 53, 81,228,136,205, 3,157,175,169,213, 36,139,223,107, 71, 40,244, 5,135, 82,
+109,142,146,250, 55,230, 49,199,158,230,217, 92,205,165,166,142, 42,152,199,111,171, 99, 12,173,241,188,212,235,255, 0,117,239,
+229,177,215, 10, 45,116,211,119, 43,112,233,170, 37,182,230, 76,183, 43,177, 16, 48, 67,141,212,104,203,167, 84, 84,210, 85,250,
+200,247,186, 39, 42,135, 76,169,127, 17,201, 25,126, 41,181,229, 37, 94,246,130,227,139, 83, 98,158,134,210,180,160,134,139,132,
+169, 8,228,234, 57,157, 60,196,119, 33,160, 58, 3,173, 54,220,106,162,232,187,147, 64,173, 32,128,221,114,157, 86,182,101,168,
+ 2,112,236, 98,110, 58, 71, 42, 0,200, 82,156,139, 85,108,168, 12, 37, 47, 14, 99,215, 89,237, 42,241,122, 42, 89,121,149,120,
+143, 68,240,228, 71, 67,193, 97, 42,112, 20,248,104, 82,146, 14, 81,149, 36, 43, 61,130,149,202, 79, 77, 54,154, 98,201, 79, 48,
+ 93,157, 23,215,245, 64,140,254,242,183,247, 3,113,214,216,234,185,107, 85, 90,190,153,200,103,134, 73, 8,185,181,196,141,207,
+ 0,122,217, 95, 77,199,166, 54, 18,161, 94,151, 79,143,238,201, 90,156, 74, 11,144,195, 67, 45,167,222,100,242,185, 41,107, 79,
+ 47, 68,161,128,211, 94, 17, 4,143,139,237,214, 33, 94,188,163, 65,166, 48,194, 95, 91,117, 54,202,144,132, 54,165,128,183, 95,
+199,188,184,162,159,133, 33, 12,114, 39, 3,184,113, 99, 62, 90,108,110,125,200,155, 57,192,243,237, 54,135, 98, 37, 65,105,104,
+184, 83, 38, 67,170, 74,157,117,106, 82, 65,231, 43, 42, 36,158,164, 28,103,182,152, 91,179,113, 22,203, 82, 31,144,227,141,177,
+ 29,133, 60,243,188,138,117,126, 27,202,229, 79,134,132,140,173,213,186,224, 64,230, 35, 28,249, 82,146,156,168,109, 83, 80,180,
+133, 70,155,131,247,250, 91,173,253,215,233,123,143,190, 31,153,230, 40,116,234, 94, 76,155, 11, 13,199,112,250,136, 0, 48,181,
+193, 30,164,142,215, 14, 21,209,121,205, 91,172,198,128, 37,214, 37,203,151, 18,147, 71,162, 69, 74,158,159, 91,173, 84, 31, 76,
+ 74, 61, 38, 10, 82, 57,149, 46, 76,199,210,132, 36,116, 79,141,204,122, 13, 72,111,103,182,153,253,140,217, 59, 59,105,234,166,
+ 43,245,214, 40,146,102,238, 75,165,136,243,169,213, 75,230,241,120, 86, 47, 54, 36,211,230,178,227, 21, 26, 75, 53, 55, 26,167,
+ 24,207,180,236,119, 35,210, 16, 22,218,146,117, 21, 91, 99,137, 58,134,192,111, 54,211,110, 76,122, 84, 42,181,197,100,221,246,
+174,224,205,167, 84,216, 19,169,212,123, 66, 37, 89, 42,151, 77, 97,181, 39,195,159,114, 79,128,212,245,169,240, 22,212,111,116,
+105, 13,225, 69, 58,152,173,218,236, 42,179,108, 87,233, 14,186,253, 46,181, 6,157,112, 82, 30,120, 56,211,238,209,110, 10,124,
+106,204, 5, 62,219,128, 41, 18, 61,194,107, 60,193, 64, 44, 45, 4, 30,186,117,106,119,163, 48,188,177,253, 92,232,116, 31,218,
+177, 26,182, 29, 0, 5,108,118, 44, 24,145,181,142, 35,114,231,116, 85,239,152,101,148,181,162, 92,195, 43,146, 35, 87, 18,135,
+188, 13, 42, 22,128, 23, 42, 35, 98, 66,200, 24, 35, 57,137,208,164,161, 30,202,120, 41,197,183,177,147, 96, 55,194,117, 82,245,
+225,250,163, 11,134,125,197,158,169, 14,206,182,216,166, 75,169,236, 93,114,190,156,248,141,189,108,196, 90,166,237,169,121,196,
+181,250,106, 40,147, 79, 30, 49,116, 81,219, 78,117, 26, 30, 33,248, 90,223,142, 22,238, 53, 90,251,235,183, 21, 75, 77,169,146,
+228, 66,162, 92,232, 13, 87,118,250,239,240, 22,241, 75,150,189,233, 78, 11,167,214, 10,153, 99,198, 17,203,141,204,109,181,161,
+ 79, 69,104,144, 53, 62, 58,210, 27,142,235,239, 21,135, 25, 12,160, 78,108, 32,130, 2, 20,150,218,156,215,108, 60,148,173, 41,
+ 88, 7, 42, 65, 24, 28,201, 25,193,174,203,122,131,116,219,213,139,110,241,182,232, 55,173,161,112, 70, 84, 43,170,207,186,169,
+ 84,234,253,183,113,211,152,109, 97, 46, 84,104,245, 86, 28,142,237, 70, 59, 5,226,196,128,132,200, 66, 22,182,154,125,146, 80,
+180,201,178,222, 38,170,167,211, 29, 71,246,200, 86,223,104,218, 69, 29, 1, 87,177,189,186,233, 96,214, 30, 85, 40, 0, 56,170,
+184,143,195,156,143, 60, 18, 84, 69, 23,232,156,193,247, 18,194,160, 70,237,183,247,176,221, 84,146, 79,219, 83, 27,110, 29,203,
+146,109, 13, 30, 23, 61,163, 28,100,240,219, 38,149,107,237,182,228, 73,189,236,148, 58,150,218,218, 61,216, 67,151,221,136,166,
+144,210, 25,240, 41, 6,169, 45, 53, 11, 53, 66, 58, 57, 80,186, 76,248, 97,190, 98,160,218,142,164,109,178,158,214,237,167,175,
+ 65,161,127, 41,109,181,191,248, 74,174, 85,212,196, 72,247,141,118,159, 86,189,184,118,184, 38, 56,243,200, 67, 20,205,205,163,
+ 65, 92,187,103,244,108,243,134, 42,113, 37,120, 42,121, 41,114,160, 80, 84,117,167,220, 73,251, 19,182,242,247,150,245,217,194,
+ 29,220,173,162,186,165, 45,185,180,237,176,187,166,214,235, 27,115, 85,154,242,203,141, 53,105,221,169,247,138,213,131, 33,111,
+ 58, 60, 24,243, 19, 85,132,218, 80, 19,227,198, 71,195,173, 7,218,190, 57,120,161,246,121,238,117,107,135, 46, 42, 54,246,212,
+222,125,182, 66,215, 76,220,221,149,190,133,155,115,191, 81,182,165,170, 84, 41, 82,173,155,198,146,212,216, 50,159,240,155,121,
+200,241,235, 44, 76, 97,206, 80,135,152,140,178,151, 90,121,170,146, 44,222, 17, 46, 79, 77, 21,101, 90,144,210, 68,210, 26, 90,
+141, 23, 26,157, 24, 36,177, 72,226,224,221,193, 66, 60,166,100, 39,106,230,105,184,247,129,158, 20,172,144,102, 25, 56, 96,130,
+ 73, 11, 77, 13,172, 72, 85,114, 4,208,176, 63,238,220,198, 0, 12,193, 90,219,205,107,111, 55, 22,222,185,109,106, 77,203,105,
+ 92,212, 27,170,209,172,183,227,209, 46,123, 90,179, 79,185, 45,186,219, 47,160, 44, 55, 78,175, 80,230, 63, 25,215,130, 20, 20,
+227, 72,116,188,206, 64,121,180, 19,141,103,175, 87,204,134,148,133, 47,152,148,124, 42, 90,135, 81,202, 0, 79, 42,142, 57,128,
+233,159,246, 64, 39, 57, 58,138, 47, 16, 27, 71,120,112, 95, 98,211, 61,164, 94,203, 13,207,174,217,124, 50,238, 29,187,102,110,
+ 70,229,240,243,119,189, 42, 85,155, 77,162,222,245, 72, 16, 41,117, 22,108,155,169,231, 90,184,109, 7,235, 46,162,151, 58,152,
+243,203,175,208,101,130,245, 6,171, 58,144, 89,145, 18, 68,155, 3,127,214,247,155, 98,118,115,120,231, 91,109, 90,114,247, 99,
+108,236,173,194,145,108,177, 83, 77, 90, 45,188,253,219, 67,139, 87,122,147, 14,164,243,190, 44,248, 45,185, 37, 98, 59,143,101,
+242,194,155, 18, 15,188, 7, 73,143,214,196, 35,167,138,170, 9,185,212,211, 51, 37,153,116, 75, 28,128, 41, 49, 75, 29,205,152,
+ 95,170,150, 83,177,218,235,123, 43,134,115,213,207,218, 72,189,141,233,170,169,213, 93,148,221,209,145,142,149,120,220, 40,189,
+200,177, 4, 41, 27, 0, 8,185,198,215,109,149, 22, 37,219,112, 75,167, 73,165, 92, 21,191,118,183,110, 26,195, 20,107, 85,228,
+ 68,174, 84,165, 82,105,206,202, 98, 44, 87, 92,162,212, 48,165, 45,180,169,192,152,142,168,161, 4, 36, 36,229, 99, 64, 56,226,
+223, 77,219,218,203, 74,243,176,184,111,131,100,212,184,131,106,210,106,188,182,174,237,198,176,104,236,108,117, 26,191,107,238,
+ 45,231, 67,159,114, 83,238, 42,188, 53,220, 59,203, 46,201,218,125,206,169,219, 54,146, 99,166,100,164,216,146,234, 18,227,161,
+ 2,157, 2,167,204, 14, 62, 61,170,123,199,195,134,245,239, 23, 13,187,105,102,194,182,165, 83,246,238,171,105, 84,183, 81, 53,
+244,170,245,137, 87,220,107, 45,183,233,117,187, 54, 41,166, 73,133, 64,143, 76,250,217,135,130,156, 67,211,229, 61, 20,165, 50,
+ 32,160,164,235,150,155,127,199,229, 2,218,166,220, 17, 47,141,155,184,239,201,213, 27, 39,106,105,180,122,212,125,229,250,134,
+170,214,227,109, 78,199,111,230,200, 68,190,174,249,149,109,181,172,187,121, 82,106, 16, 56,129,184, 42,147, 41, 97,218,124,229,
+ 79,183,224, 36,215,213, 28,203,110, 70,206, 69,195,144, 85, 69, 5, 70, 98,154,105,203, 23, 84, 82, 9,145, 88, 2,188,203, 43,
+ 29, 22,223, 64,107,155,217,130, 11,134,211,227, 63, 18,206, 91, 83, 89,150,100, 83,153,115, 5, 2, 9,166,100,112, 41,101, 77,
+ 75, 50,195,172,141, 83, 43,150, 83, 39, 47, 66,149,186, 60,183, 82,141,110,225,240, 39,196,221,155, 81,191,231,222,141, 89,213,
+ 55,237, 88,247,245,205,127,221,171,222,173,181,185, 61,226,240,182,175, 86,237, 91,186,211,159, 89, 98,236,113,202,246,245, 75,
+190,106,209,152,110,218,100, 61,112, 84, 36,212, 28, 91, 16, 22,220,105,170,139,127,159,236,242,222,186, 77, 26,239,166, 87,232,
+112,233,215,213,183,115, 90,106,118,188, 55, 27,106, 92,217,154, 61,128,237, 3,137,199,119, 10,177,114,223, 77,221,139, 75, 53,
+122, 53,223,195, 53,253, 73,112, 71,241, 98,181, 54,200,172, 83,221,113,115,223,163, 51, 57,230,147,199, 5,183,187,182,199, 20,
+139,188,118,233,203, 98,159, 84,186,183,115,137, 91, 34, 52, 27,238, 84,170,188, 61,236,220, 94, 32, 44,203,171,108, 40,237, 75,
+107,110, 95,141, 88,160, 80,145, 95,186, 77, 97,137,205, 83, 25,174,211,162,188, 99, 84, 40,149, 52, 64,143, 46,157, 75,218, 83,
+101, 77,186,105, 19,162,236, 45,249,108,218, 84, 43,254,198,220, 58,109, 34,211,226, 14,155, 2,237, 19,173,203,215,141, 77,199,
+186,173,217,247,125, 99, 98,170, 16,170,182,125,110,232,227, 78,236,167,187, 2, 77, 5,212,166,211,181,219,161, 84, 87, 88,151,
+ 81,153, 91, 22, 42,173, 58,216, 2, 66,109,243,176,249,247,227,159,188,172,197,153,181, 23,220,146, 73, 36,158,189,183, 55,238,
+119,191, 83,134, 79,133, 94, 26, 54,163,119, 40, 23,245, 15,114,220,191,142,226,213, 56,139,225,227,133,189,165,172,237,181,249,
+ 97,155, 30,221,191,119,242,131,196, 96,167, 93,151,172, 39,236,250,202, 55, 62,208,102,241,218,107, 53,128,138, 37,126,130,149,
+ 83,107, 53, 9,204, 84,230, 17, 17,189, 55,212,190, 3,248,146,172,211,160,212,169,214,189,181, 33,186,142,219,211,247, 54, 44,
+ 95,227, 14,196,106,162,186,125, 98,181,178,180, 58, 45,166,105,207, 92, 9,120,110,100,217, 28, 70,108,107,177,109,190, 79,173,
+221, 99,115, 41,203, 76, 94, 97, 37, 17,242,109,137,226,246,211,217,104,251,163, 81,127,101, 62,187,186,171,187,235,180,188, 70,
+108,210,237,235,249, 22, 93,137,180,219,153,179, 84,221,245,137,101, 55, 93,179, 23, 99,212,230,110, 13,155, 14,126,244, 71,153,
+ 30,155, 22,183,110, 58,135, 44,136,172,191, 58, 84,105, 79,178,151,218, 87,181, 90,244, 52,109,183, 49,108, 26,164,171,191,110,
+ 45, 11, 30,153, 2,181,115,110, 83,149,219, 97,171,198,196,221, 46, 9,183, 14, 21,126,223,177, 98,217, 80,152,183,109,137, 17,
+184, 39,182,216,149, 73,247,169,115, 94,157,126,212, 38,174,188,170,109, 62,145, 66,136,100, 17, 21, 93, 71,204, 47,211,227,220,
+219,115,111,195,225,108, 1,107, 11,252,252,239,134,106, 63,179,199,115,133,155,125,215,171,187,135,179,118,237,197,106,110,150,
+201,109,205, 10,223,153,185,246, 52,250, 21,249, 15,122,172, 61,215,189,169, 23, 85,173,123,210,110, 87,226, 85,161,161,221,180,
+ 69, 50, 35, 16,154,153,245,133, 70,101, 86, 39,143, 18,101,191, 50, 43,173, 61,131,193, 94,250,238,142,241,110, 54,200, 89,144,
+172,105,247,150,215, 94, 63,197,253,209, 54,126,230, 88,150,253,156,245,230,245,238,157,187,165, 91,118,205,231,112, 87,162,211,
+175, 26,213, 74,234, 15,179, 73,139, 75,126, 92,138,179, 48,164, 75,167,183, 38, 43, 46, 58,157,172,107,218, 71,106,187,184,205,
+ 93,151, 6,202,110, 37,197,110,209,175, 29,134,190,172,246, 39,241, 13, 5,253,203,160, 93, 60, 62,109,135, 18,118,213,139,112,
+ 73,220, 10,142,200, 73,165, 84,170,177,119, 63,136, 8, 23, 60, 70,218,180,225,210,217,143,182,241, 40,114,169,117, 3, 80,155,
+ 86, 12, 7, 9,252, 89,216,124, 52,223,247, 21,199, 92,217,203,159,115,109, 71,183, 27,106,119, 94,200,183,218,221,216, 86, 93,
+205,110,222, 91, 37,184,134,249,219,247, 46, 91,196,109, 93, 86, 53,227, 71, 49,101, 84,161,213,227,179, 69,164, 59, 61,217, 13,
+ 76,139, 38,154,150, 85, 17,245,109, 21,212, 94,194,230,253,122,118,237,252, 63,118, 51,229,219,231,249, 97,202,188, 61,155,155,
+199,118,239,117,185,183,155, 45,111,219, 48,169,151,253,165,181,247, 29,144,197,255, 0,186, 86, 69,154,185,177,175,167, 54,191,
+110,233, 53, 41,149, 43,218,189, 9,184,108,215,247,190,249,155, 69,160, 50,234,210,253, 65,250, 53, 77,200,172, 42,159, 74,151,
+ 45,166,227,134, 30, 29,118,127,120,246,186,191, 46,244, 59,148,198,229, 93, 91,162,198,209,109, 69, 98,214,187, 45,122, 85,145,
+109,220,147, 54,155,112,111,218, 69, 66,255, 0,180,170,251,125, 80,157,121, 82,101,220,150,181, 18,154,240,167,215,104, 46, 83,
+162, 85, 36,212, 19,245,147,172, 55, 5,237,158,182,189,170,118,111,241,175,183,251,177,186, 92, 50,213, 47,138,213,133, 67,216,
+ 27,113, 74,181,183,186, 14,223, 84,174,122, 47, 11,119,174,202,223, 59, 29, 14,226,170,191,178,245,148,204,114,158,230,219,222,
+ 52, 89,210, 61,212, 74,157,109,221,244, 74,100,119,233,207,218,140,207,171,105,175, 15, 60, 86,219, 59, 19,183, 23, 37,185, 55,
+107, 42,215,157,246,197,244,141,202,218,155,189,189,196,135,110,218,246, 85,232,222,219,222,187,117, 26,163,120, 88,142,109,229,
+ 70, 70,225, 69,136,139,192, 85, 33, 71,143, 94,160, 33, 53, 10, 36,116,205, 53, 8, 43,126, 27,135, 2, 45, 74,111,229,107,222,
+224,251,173,219,227,235,252,241,159, 47, 99,243,255, 0,140,109,229,209,192, 61,139, 67,254, 54, 13, 55,134, 30, 56,238,159,226,
+247,134,189,165,221,155, 88, 82,239, 26, 58,127,141, 58,134,224, 29,184,254, 17,110,133,181,238,252, 37, 74,228,217,202, 39,240,
+190,165,239, 17, 99,253,100,191,208, 49,227,221, 17,185, 92,241,117, 46,135,178,187, 35, 81, 28, 31,213, 31,183,183,186,171, 31,
+122,172,157,204, 93,241,102,218,215,157,151, 58,233,188,119, 54,204,184,111, 91, 90,206,160,237,157, 94,102,218, 53, 31,110,232,
+ 55, 5,201, 73,181, 97, 62,229, 82, 21,212,253, 17,170,156,202,136, 53,143, 5,170,122,233,238,255, 0, 21,182, 21,251, 73,221,
+ 38,109, 61,163,187,173, 42,230,243,109,206,204,217,215,189, 66,226,221,186, 53,235, 74,102,187,180, 15, 88,202,106,225,181, 40,
+212,205,160,161, 61, 71,164,207,141,102,114, 42,155, 50,125, 77,232,203,169,120,130,166,250, 89,240,157,111,237,173,252,177, 83,
+ 70,217,139, 67,114,246,121,205,192,178,182,194,199,221,235, 38,179, 78,133,124, 51,107,215,171,138,221, 10,189,205, 93,167, 93,
+ 54,173,114, 93,149, 85,143,101, 93, 20, 42,173,118, 11,240,157,147, 78,174, 70,121,218, 70, 95,139,225,190, 91,109, 66, 82,230,
+223, 59,143,119,166, 50, 8,184, 3,231,127,135,166, 49, 78, 42,118,162,139,177,156, 68,238,246,208, 80, 63,132, 77, 83,182,246,
+242,168, 91, 74,166, 93,239, 65,153,117,219,117, 40, 41,100, 86,172,219,150,169, 75,166,194,137, 94,175, 81, 43, 42,159, 72,151,
+ 83,133, 10, 28, 42,156,138, 35,149, 8, 81, 34,197,146,211, 13,173, 88,184,129,221,147,190, 91,193,122,238,130, 40, 10,181,162,
+ 92,146,233,172,210,109,231,107, 47, 92,147, 40,244, 11,118,135, 75,181,237,216, 53, 75,142, 68, 40,170,184,107, 72,161, 81,105,
+222,253, 60, 68,134,137,147, 11,242, 90,133, 13,183, 81, 21,165,172, 21, 55, 58, 70,221,186,116,193,180,169,223,215, 31,255,217,
+};
+
diff --git a/source/blender/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
index c1b3b056d62..014201648c9 100644
--- a/source/blender/include/BIF_gl.h
+++ b/source/blender/editors/include/BIF_gl.h
@@ -1,5 +1,5 @@
/**
- * $Id$
+ * $Id: BIF_gl.h 10455 2007-04-04 13:18:41Z campbellbarton $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index ed9096549ca..b354591fc5f 100644
--- a/source/blender/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -1,9 +1,5 @@
/**
- * @file BIF_glutil.h
- *
- * OpenGL drawing utility functions.
- *
- * $Id$
+ * $Id: BIF_glutil.h
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -24,9 +20,7 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation 2002-2008
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -37,6 +31,13 @@
struct rcti;
struct rctf;
+void fdrawline(float x1, float y1, float x2, float y2);
+void fdrawbox(float x1, float y1, float x2, float y2);
+void sdrawline(short x1, short y1, short x2, short y2);
+void sdrawtri(short x1, short y1, short x2, short y2);
+void sdrawtrifill(short x1, short y1, short x2, short y2);
+void sdrawbox(short x1, short y1, short x2, short y2);
+
void sdrawXORline(int x0, int y0, int x1, int y1);
void sdrawXORline4(int nr, int x0, int y0, int x1, int y1);
@@ -204,8 +205,8 @@ void bglVertex2fv(float *vec);
/* intel gfx cards frontbuffer problem */
void bglFlush(void);
int is_a_really_crappy_intel_card(void);
-int is_a_really_crappy_nvidia_card(void);
void set_inverted_drawing(int enable);
+void setlinestyle(int nr);
/* own working polygon offset */
diff --git a/source/blender/include/datatoc.h b/source/blender/editors/include/ED_datafiles.h
index 069f0874041..ddf3f0c9468 100644
--- a/source/blender/include/datatoc.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -1,6 +1,4 @@
-/*
- * datatoc.h
- *
+/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -8,7 +6,7 @@
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,42 +17,34 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef DATATOC_H
-#define DATATOC_H
+#ifndef ED_DATAFILES_H
+#define ED_DATAFILES_H
+
+/* Datafiles embedded in Blender */
extern int datatoc_B_blend_size;
extern char datatoc_B_blend[];
-extern int datatoc_Bfs_size;
-extern char datatoc_Bfs[];
-
extern int datatoc_blenderbuttons_size;
extern char datatoc_blenderbuttons[];
-extern int datatoc_prvicons_size;
-extern char datatoc_prvicons[];
+extern int datatoc_splash_jpg_size;
+extern char datatoc_splash_jpg[];
extern int datatoc_Bfont_size;
-extern char datatoc_Bfont[];
+extern char datatoc_Bfont;
extern int datatoc_bfont_ttf_size;
extern char datatoc_bfont_ttf[];
-extern int datatoc_cmap_tga_size;
-extern char datatoc_cmap_tga[];
-
-extern int datatoc_cmovie_tga_size;
-extern char datatoc_cmovie_tga[];
-
-#endif /* DATATOC_H */
+#endif /* ED_DATAFILES_H */
diff --git a/source/blender/editors/include/ED_interface.h b/source/blender/editors/include/ED_interface.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/source/blender/editors/include/ED_interface.h
diff --git a/source/blender/include/BIF_writeimage.h b/source/blender/editors/include/ED_markers.h
index 74f84324b02..cad985ce37c 100644
--- a/source/blender/include/BIF_writeimage.h
+++ b/source/blender/editors/include/ED_markers.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,26 +17,30 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_MARKERS_H
+#define ED_MARKERS_H
+
+/* flags for drawing markers */
+enum {
+ DRAW_MARKERS_LINES = (1<<0),
+ DRAW_MARKERS_LOCAL = (1<<1)
+};
+
+
-#ifndef BIF_WRITEIMAGE_H
-#define BIF_WRITEIMAGE_H
+void draw_markers_time(const bContext *C, int flag);
-struct ImBuf;
-struct EnvMap;
+/* register operators, called in ED_operatortypes_screen() */
+void ED_marker_operatortypes(void);
-void BIF_save_rendered_image(char *name);
-void BIF_save_rendered_image_fs(void);
-void BIF_save_envmap(struct EnvMap *env, char *str);
-void save_image_filesel_str(char *str);
-#endif
+#endif /* ED_MARKERS_H */
diff --git a/source/blender/include/BIF_drawscene.h b/source/blender/editors/include/ED_mesh.h
index 0c2567efeb4..882ced8a27b 100644
--- a/source/blender/include/BIF_drawscene.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,16 +17,17 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_MESH_H
+#define ED_MESH_H
+
-struct Scene;
-void set_scene(struct Scene *sce);
+#endif /* ED_MESH_H */
diff --git a/source/blender/include/particle_effect.h b/source/blender/editors/include/ED_object.h
index 9488aa513d8..ad55a691d6d 100644
--- a/source/blender/include/particle_effect.h
+++ b/source/blender/editors/include/ED_object.h
@@ -1,13 +1,12 @@
-/* dec 95
- * jan feb 96
- * $Id$
+/**
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,18 +17,17 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_OBJECT_H
+#define ED_OBJECT_H
-#ifndef PARTICLE_EFFECT_H
-#define PARTICLE_EFFECT_H
-#endif
+#endif /* ED_OBJECT_H */
diff --git a/source/blender/include/BIF_previewrender.h b/source/blender/editors/include/ED_previewrender.h
index 52deceed28f..f0a9ead4757 100644
--- a/source/blender/include/BIF_previewrender.h
+++ b/source/blender/editors/include/ED_previewrender.h
@@ -1,6 +1,4 @@
/**
- * $Id$
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -17,13 +15,9 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
* ***** END GPL LICENSE BLOCK *****
*/
@@ -74,6 +68,7 @@ pr_method:
#define PR_ICON_RENDER 1
#define PR_DO_RENDER 2
+#if 0
void BIF_previewrender (struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method);
void BIF_previewrender_buts (struct SpaceButs *sbuts);
void BIF_previewdraw (struct ScrArea *sa, struct uiBlock *block);
@@ -89,3 +84,5 @@ void BIF_view3d_previewrender_clear(struct ScrArea *sa);
void BIF_view3d_previewrender_signal(struct ScrArea *sa, short signal);
#endif
+
+#endif
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
new file mode 100644
index 00000000000..2cb394da2b0
--- /dev/null
+++ b/source/blender/editors/include/ED_screen.h
@@ -0,0 +1,85 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SCREEN_H
+#define ED_SCREEN_H
+
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_view3d_types.h"
+
+struct wmWindowManager;
+struct wmWindow;
+struct wmNotifier;
+struct SpaceType;
+struct AreagionType;
+struct uiBlock;
+
+/* regions */
+void ED_region_do_listen(ARegion *ar, struct wmNotifier *note);
+void ED_region_do_draw(struct bContext *C, struct ARegion *ar);
+void ED_region_exit(struct bContext *C, struct ARegion *ar);
+void ED_region_pixelspace(const struct bContext *C, struct ARegion *ar);
+void ED_region_init(struct bContext *C, struct ARegion *ar);
+
+/* spaces */
+void ED_spacetypes_init(void);
+void ED_spacetypes_keymap(struct wmWindowManager *wm);
+struct ARegionType *ED_regiontype_from_id(struct SpaceType *st, int regionid);
+int ED_area_header_standardbuttons(const bContext *C, struct uiBlock *block, int yco);
+
+/* areas */
+void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
+void ED_area_exit(struct bContext *C, struct ScrArea *sa);
+void ED_area_do_draw(struct bContext *C, struct ScrArea *sa);
+int ED_screen_area_active(const struct bContext *C);
+
+/* screens */
+void ED_screens_initialize(struct wmWindowManager *wm);
+void ED_screen_draw(struct wmWindow *win);
+void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
+void ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note);
+bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc);
+void ED_screen_set_subwinactive(struct wmWindow *win);
+void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
+
+void ED_operatortypes_screen(void);
+void ED_keymap_screen(struct wmWindowManager *wm);
+
+/* operators; context poll callbacks */
+int ED_operator_screenactive(struct bContext *C);
+int ED_operator_screen_mainwinactive(struct bContext *C);
+int ED_operator_areaactive(struct bContext *C);
+
+/* default keymaps, bitflags */
+#define ED_KEYMAP_UI 1
+#define ED_KEYMAP_VIEW2D 2
+#define ED_KEYMAP_MARKERS 4
+
+#endif /* ED_SCREEN_H */
+
diff --git a/source/blender/include/BIF_mainqueue.h b/source/blender/editors/include/ED_screen_types.h
index 689b2e8dacf..29e62d51f7d 100644
--- a/source/blender/include/BIF_mainqueue.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -1,14 +1,12 @@
-/*
- * Central queue handling functions.
- *
- * $Id$
+/**
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,26 +17,38 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_MAINQUEUE_H
-#define BIF_MAINQUEUE_H
+#ifndef ED_SCREEN_TYPES_H__
+#define ED_SCREEN_TYPES_H__
-#define MAXQUEUE 4096
+typedef struct AZone {
+ struct AZone *next, *prev;
+ int type;
+ int flag;
+ int pos;
+ short x1, y1, x2, y2;
+} AZone;
-unsigned short mainqtest (void);
-unsigned short mainqread (short *val, char *ascii);
-void mainqenter (unsigned short event, short val);
-void mainqenter_ext (unsigned short event, short val, char ascii);
-void mainqpushback (unsigned short event, short val, char ascii);
+/* actionzone type */
+#define AZONE_TRI 1
+#define AZONE_QUAD 2
-#endif /* BIF_MAINQUEUE_H */
+/* actionzone pos */
+#define AZONE_S 1
+#define AZONE_SW 2
+#define AZONE_W 3
+#define AZONE_NW 4
+#define AZONE_N 5
+#define AZONE_NE 6
+#define AZONE_E 7
+#define AZONE_SE 8
+#endif /* ED_SCREEN_TYPES_H__ */
diff --git a/source/blender/include/BSE_seqaudio.h b/source/blender/editors/include/ED_space_api.h
index 64aa50c661d..70d33531bbd 100644
--- a/source/blender/include/BSE_seqaudio.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -1,10 +1,12 @@
/**
+ * $Id:
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -15,40 +17,36 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2003 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
- *
*/
-#ifndef BSE_SEQAUDIO_H
-#define BSE_SEQAUDIO_H
-
-#ifndef DISABLE_SDL
-#include "SDL.h"
-#endif
-
-/* muha, we don't init (no SDL_main)! */
-#ifdef main
-# undef main
-#endif
+#ifndef ED_AREA_H
+#define ED_AREA_H
-#include "DNA_sound_types.h"
-#include "BLO_sys_types.h"
+/* the pluginnable API for export to editors */
-void audio_mixdown();
-void audio_makestream(bSound *sound);
-void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown);
-void audiostream_fill(uint8_t* mixdown, int len);
-void audiostream_start(uint32_t frame);
-void audiostream_scrub(uint32_t frame);
-void audiostream_stop(void);
-int audiostream_pos(void);
+/* calls for registering default spaces */
+void ED_spacetype_outliner(void);
+void ED_spacetype_time(void);
+void ED_spacetype_view3d(void);
+void ED_spacetype_ipo(void);
+void ED_spacetype_image(void);
+void ED_spacetype_node(void);
+void ED_spacetype_buttons(void);
+void ED_spacetype_info(void);
+void ED_spacetype_file(void);
+void ED_spacetype_sound(void);
+void ED_spacetype_action(void);
+void ED_spacetype_nla(void);
+void ED_spacetype_script(void);
+void ED_spacetype_text(void);
+void ED_spacetype_sequencer(void);
-#endif
+#endif /* ED_AREA_H */
diff --git a/source/blender/blenloader/BLO_genfile.h b/source/blender/editors/include/ED_transform.h
index 2f5ab21cef0..1d47d8ad190 100644
--- a/source/blender/blenloader/BLO_genfile.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -1,12 +1,12 @@
-/*
- * $Id$
+/**
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,19 +17,17 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
- * external genfile function prototypes
*/
+#ifndef ED_TRANSFORM_H
+#define ED_TRANSFORM_H
-#ifndef BLO_GENFILE_H
-#define BLO_GENFILE_H
-#endif
+#endif /* ED_TRANSFORM_H */
diff --git a/source/blender/include/BIF_toets.h b/source/blender/editors/include/ED_types.h
index 9bda40c9118..7b19341fb9e 100644
--- a/source/blender/include/BIF_toets.h
+++ b/source/blender/editors/include/ED_types.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_TYPES_H
+#define ED_TYPES_H
+
+/* **************** GENERAL EDITOR-WIDE TYPES AND DEFINES ************************** */
-#ifndef BIF_TOETS_H
-#define BIF_TOETS_H
+/* old blender defines... should be depricated? */
+#define SELECT 1
+#define ACTIVE 2
-int blenderqread(unsigned short event, short val);
-void persptoetsen(unsigned short event); /* dutch rules man */
-int untitled(char *name);
-#endif
+#endif /* ED_TYPES_H */
diff --git a/source/blender/include/BIF_drawoops.h b/source/blender/editors/include/ED_util.h
index bb8444641d7..d0a4b93bfae 100644
--- a/source/blender/include/BIF_drawoops.h
+++ b/source/blender/editors/include/ED_util.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,24 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_UTIL_H
+#define ED_UTIL_H
+
+/* ************** XXX OLD CRUFT WARNING ************* */
-#ifndef BIF_DRAWOOPS_H
-#define BIF_DRAWOOPS_H
+#define XIC 20
+#define YIC 20
-void give_oopslink_line(Oops *oops, OopsLink *ol, float *v1, float *v2);
-void mysbox(float x1, float y1, float x2, float y2);
-void boundbox_oops(short sel);
+void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert);
+int GetButStringLength(char *str);
-#endif
+#endif /* ED_UTIL_H */
diff --git a/source/blender/include/BIF_interface.h b/source/blender/editors/include/UI_interface.h
index 3da4466d4d3..5b0f0bbc2bf 100644
--- a/source/blender/include/BIF_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -27,13 +27,18 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_INTERFACE_H
-#define BIF_INTERFACE_H
+#ifndef UI_INTERFACE_H
+#define UI_INTERFACE_H
struct ID;
struct ListBase;
-struct ScrArea;
+struct ARegion;
+struct wmWindow;
+struct wmWindowManager;
struct AutoComplete;
+struct bContext;
+struct PointerRNA;
+struct PropertyRNA;
/* uiBlock->dt */
#define UI_EMBOSS 0 /* use one of the themes for drawing */
@@ -41,6 +46,7 @@ struct AutoComplete;
#define UI_EMBOSSM 2 /* Minimal builtin emboss, also for logic buttons */
#define UI_EMBOSSP 3 /* Pulldown */
#define UI_EMBOSSR 4 /* Rounded */
+#define UI_EMBOSST 5 /* Table */
#define UI_EMBOSSX 0 /* for a python file, which i can't change.... duh! */
@@ -57,25 +63,21 @@ struct AutoComplete;
#define UI_BLOCK_COLLUMNS 1
#define UI_BLOCK_ROWS 2
-/* return from uiDoBlock */
-#define UI_CONT 0
-#define UI_NOTHING 1
-#define UI_RETURN_CANCEL 2
-#define UI_RETURN_OK 4
-#define UI_RETURN_OUT 8
-#define UI_RETURN 14
-#define UI_EXIT_LOOP 16
-
/* uiBlock->flag (controls) */
-#define UI_BLOCK_LOOP 1
-#define UI_BLOCK_REDRAW 2
-#define UI_BLOCK_RET_1 4
-#define UI_BLOCK_BUSY 8
-#define UI_BLOCK_NUMSELECT 16
-#define UI_BLOCK_ENTER_OK 32
-#define UI_BLOCK_NOSHADOW 64
-#define UI_BLOCK_FRONTBUFFER 128
-#define UI_BLOCK_NO_HILITE 256
+#define UI_BLOCK_LOOP 1
+#define UI_BLOCK_REDRAW 2
+#define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */
+#define UI_BLOCK_NUMSELECT 8
+#define UI_BLOCK_ENTER_OK 16
+#define UI_BLOCK_NOSHADOW 32
+#define UI_BLOCK_NO_HILITE 64 /* XXX 2.5 not implemented */
+#define UI_BLOCK_MOVEMOUSE_QUIT 128
+#define UI_BLOCK_KEEP_OPEN 256
+
+/* uiMenuBlockHandle->menuretval */
+#define UI_RETURN_CANCEL 1 /* cancel all menus cascading */
+#define UI_RETURN_OK 2 /* choice made */
+#define UI_RETURN_OUT 4 /* left the menu */
/* block->flag bits 12-15 are identical to but->flag bits */
@@ -167,42 +169,69 @@ struct AutoComplete;
#define NUMABS (36<<9)
#define BUTTYPE (63<<9)
-
-
typedef struct uiBut uiBut;
typedef struct uiBlock uiBlock;
+/* Common Drawing Functions */
+
void uiEmboss(float x1, float y1, float x2, float y2, int sel);
void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad, int active);
void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad);
void uiSetRoundBox(int type);
void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
-
void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag);
-void uiTextBoundsBlock(uiBlock *block, int addval);
+void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
+
+/* Popup Menu's */
+
+typedef struct uiMenuBlockHandle {
+ struct ARegion *region;
+ int butretval;
+ int menuretval;
+
+ float retvalue;
+ float retvec[3];
+} uiMenuBlockHandle;
+
+typedef uiBlock* (*uiBlockFuncFP)(struct bContext *C, struct uiMenuBlockHandle *handle, void *arg1);
+
+extern void pupmenu_set_active(int val);
+extern uiMenuBlockHandle *pupmenu_col(struct bContext *C, char *instr, int mx, int my, int maxrow);
+extern uiMenuBlockHandle *pupmenu(struct bContext *C, char *instr, int mx, int my);
+extern void pupmenu_free(struct bContext *C, uiMenuBlockHandle *handle);
+
+/* Block */
+
+uiBlock *uiBeginBlock(const struct bContext *C, struct ARegion *region, char *name, short dt, short font);
+void uiEndBlock(const struct bContext *C, uiBlock *block);
+uiBlock *uiGetBlock(char *name, struct ARegion *ar);
+void uiFreeBlock(const struct bContext *C, uiBlock *block);
+void uiFreeBlocks(const struct bContext *C, struct ListBase *lb);
+
void uiBoundsBlock(struct uiBlock *block, int addval);
void uiDrawBlock(struct uiBlock *block);
-void uiGetMouse(int win, short *adr);
-void uiComposeLinks(uiBlock *block);
-void uiSetButLock(int val, char *lockstr);
-uiBut *uiFindInlink(uiBlock *block, void *poin);
-void uiClearButLock(void);
-int uiDoBlocks(struct ListBase *lb, int event, int movemouse_quit);
-void uiSetCurFont(uiBlock *block, int index);
-void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small);
-void uiFreeBlock(uiBlock *block);
-void uiFreeBlocks(struct ListBase *lb);
-void uiFreeBlocksWin(struct ListBase *lb, int win);
-uiBlock *uiNewBlock(struct ListBase *lb, char *name, short dt, short font, short win);
-uiBlock *uiGetBlock(char *name, struct ScrArea *sa);
-
-void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval);
+void uiTextBoundsBlock(uiBlock *block, int addval);
+void uiBlockSetButLock(uiBlock *block, int val, char *lockstr);
+void uiBlockClearButLock(uiBlock *block);
/* automatic aligning, horiz or verical */
void uiBlockBeginAlign(uiBlock *block);
void uiBlockEndAlign(uiBlock *block);
+/* Misc */
+
+void uiSetCurFont(uiBlock *block, int index);
+void *uiSetCurFont_ext(float aspect);
+void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small);
+
+void uiComposeLinks(uiBlock *block);
+uiBut *uiFindInlink(uiBlock *block, void *poin);
+
+void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval);
+
+/* Defining Buttons */
+
uiBut *uiDefBut(uiBlock *block,
int type, int retval, char *str,
short x1, short y1,
@@ -246,11 +275,10 @@ uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int i
uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
-typedef void (*uiIDPoinFuncFP) (char *str, struct ID **idpp);
+typedef void (*uiIDPoinFuncFP) (struct bContext *C, char *str, struct ID **idpp);
uiBut *uiDefIDPoinBut(struct uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str,
short x1, short y1, short x2, short y2, void *idpp, char *tip);
-typedef uiBlock* (*uiBlockFuncFP) (void *arg1);
uiBut *uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip);
uiBut *uiDefPulldownBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip);
@@ -259,6 +287,8 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int retv
void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip);
+uiBut *uiDefRNABut(uiBlock *block, int retval, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, short x1, short y1, short x2, short y2);
+
void uiAutoBlock(struct uiBlock *block,
float minx, float miny,
float sizex, float sizey, int flag);
@@ -284,19 +314,17 @@ int uiButGetRetVal (uiBut *but);
void uiButSetFlag (uiBut *but, int flag);
void uiButClearFlag (uiBut *but, int flag);
-void uiBlockSetButmFunc (uiBlock *block, void (*butmfunc)(void *arg, int but_a2), void *arg);
+void uiBlockSetHandleFunc(uiBlock *block, void (*func)(struct bContext *C, void *arg, int event), void *arg);
+void uiBlockSetButmFunc (uiBlock *block, void (*func)(struct bContext *C, void *arg, int but_a2), void *arg);
-void uiBlockSetFunc (uiBlock *block, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2);
-void uiButSetFunc (uiBut *but, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2);
+void uiBlockSetFunc (uiBlock *block, void (*func)(struct bContext *C, void *arg1, void *arg2), void *arg1, void *arg2);
+void uiButSetFunc (uiBut *but, void (*func)(struct bContext *C, void *arg1, void *arg2), void *arg1, void *arg2);
-void uiButSetCompleteFunc(uiBut *but, void (*func)(char *str, void *arg), void *arg);
+void uiButSetCompleteFunc(uiBut *but, void (*func)(struct bContext *C, char *str, void *arg), void *arg);
-void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(struct ScrArea *sa, uiBlock *block));
+void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(struct bContext *C, uiBlock *block));
-
-extern void pupmenu_set_active(int val);
-extern short pupmenu(char *instr);
-extern short pupmenu_col(char *instr, int maxrow);
+/* Panels */
extern void uiFreePanels(struct ListBase *lb);
extern void uiNewPanelTabbed(char *, char *);
@@ -315,10 +343,7 @@ extern int uiAlignPanelStep(struct ScrArea *sa, float fac);
extern void uiPanelControl(int);
extern void uiSetPanelHandler(int);
-extern void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
-extern void *uiSetCurFont_ext(float aspect);
-
-void shade_buttons_change_3d(void);
+/* Autocomplete */
typedef struct AutoComplete AutoComplete;
@@ -326,5 +351,17 @@ AutoComplete *autocomplete_begin(char *startname, int maxlen);
void autocomplete_do_name(AutoComplete *autocpl, const char *name);
void autocomplete_end(AutoComplete *autocpl, char *autoname);
-#endif /* BIF_INTERFACE_H */
+/* Handlers for regions with UI blocks */
+
+void UI_add_region_handlers(struct ListBase *handlers);
+
+/* Module initialization and exit */
+
+void UI_init(void);
+void UI_init_userdef(void);
+void UI_exit(void);
+
+void uiTestRegion(const struct bContext *C); /* XXX 2.50 temporary test */
+
+#endif /* UI_INTERFACE_H */
diff --git a/source/blender/include/BIF_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index 37e752fef85..52a17a669f7 100644
--- a/source/blender/include/BIF_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -43,27 +43,26 @@ typedef struct IconFile {
int index;
} IconFile;
-
#define ICON_DEFAULT_HEIGHT 16
#define PREVIEW_DEFAULT_HEIGHT 96
/*
Resizable Icons for Blender
*/
-void BIF_icons_init(int first_dyn_id);
-int BIF_icon_get_width(int icon_id);
-int BIF_icon_get_height(int icon_id);
+void UI_icons_init(int first_dyn_id);
+int UI_icon_get_width(int icon_id);
+int UI_icon_get_height(int icon_id);
-void BIF_icon_draw(float x, float y, int icon_id);
-void BIF_icon_draw_preview(float x, float y, int icon_id, int nocreate);
+void UI_icon_draw(float x, float y, int icon_id);
+void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate);
-void BIF_icon_draw_aspect(float x, float y, int icon_id, float aspect);
-void BIF_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade);
-void BIF_icons_free();
-void BIF_icons_free_drawinfo(void *drawinfo);
+void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect);
+void UI_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade);
+void UI_icons_free();
+void UI_icons_free_drawinfo(void *drawinfo);
-struct ListBase *BIF_iconfile_list(void);
-int BIF_iconfile_get_index(char *filename);
+struct ListBase *UI_iconfile_list(void);
+int UI_iconfile_get_index(char *filename);
#endif /* BIF_ICONS_H */
diff --git a/source/blender/include/BIF_resources.h b/source/blender/editors/include/UI_resources.h
index b6a9882309d..6d2b1147ff4 100644
--- a/source/blender/include/BIF_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -1,12 +1,15 @@
/**
- * $Id$
+ * $Id: UI_resources.h 13057 2007-12-30 12:08:28Z aligorith $
*
- * ***** BEGIN GPL LICENSE BLOCK *****
+ * ***** BEGIN GPL/BL DUAL 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,14 +27,14 @@
*
* Contributor(s): none yet.
*
- * ***** END GPL LICENSE BLOCK *****
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
-#ifndef BIF_RESOURCES_H
-#define BIF_RESOURCES_H
+#ifndef UI_RESOURCES_H
+#define UI_RESOURCES_H
-/* elubie: TODO: move the typedef for icons to BIF_interface_icons.h */
-/* and add/replace include of BIF_resources.h by BIF_interface_icons.h */
+/* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
+/* and add/replace include of UI_resources.h by UI_interface_icons.h */
typedef enum {
#define BIFICONID_FIRST (ICON_VIEW3D)
ICON_VIEW3D,
@@ -57,8 +60,8 @@ typedef enum {
ICON_TRIA_UP,
ICON_FONTPREVIEW,
ICON_BLANK4,
- ICON_WORDWRAP,
- ICON_WORDWRAP_OFF,
+ ICON_BLANK5,
+ ICON_BLANK6,
ICON_ORTHO,
ICON_PERSP,
@@ -81,10 +84,10 @@ typedef enum {
ICON_SHORTDISPLAY,
ICON_TRIA_DOWN,
ICON_TRIA_RIGHT,
- ICON_NDOF_TURN,
- ICON_NDOF_FLY,
- ICON_NDOF_TRANS,
- ICON_NDOF_DOM,
+ ICON_BLANK7,
+ ICON_BLANK8,
+ ICON_BLANK9,
+ ICON_BLANK10,
ICON_VIEW_AXIS_ALL,
ICON_VIEW_AXIS_NONE,
@@ -108,7 +111,7 @@ typedef enum {
ICON_FF,
ICON_REW,
ICON_PYTHON,
- ICON_PYTHON_ON,
+ ICON_BLANK11,
ICON_BLANK12,
ICON_BLANK13,
ICON_BLANK14,
@@ -266,8 +269,8 @@ typedef enum {
ICON_WINDOW_WINDOW,
ICON_PANEL_CLOSE,
ICON_PHYSICS,
- ICON_LAYER_USED,
- ICON_LAYER_ACTIVE,
+ ICON_BLANK36,
+ ICON_BLANK37,
ICON_BLANK38,
ICON_BLENDER,
@@ -293,7 +296,7 @@ typedef enum {
ICON_ARMATURE_DEHLT,
ICON_SNAP_GEAR,
ICON_SNAP_GEO,
- ICON_SNAP_NORMAL,
+ ICON_BLANK41,
ICON_BLANK42,
ICON_SMOOTHCURVE,
@@ -524,18 +527,15 @@ enum {
TH_EDGE_SHARP,
TH_EDITMESH_ACTIVE,
-
- TH_HANDLE_VERTEX,
- TH_HANDLE_VERTEX_SELECT,
- TH_HANDLE_VERTEX_SIZE,
};
/* XXX WARNING: previous is saved in file, so do not change order! */
/* theme drawtypes */
-#define TH_MINIMAL 0
-#define TH_SHADED 1
-#define TH_ROUNDED 2
-#define TH_OLDSKOOL 3
+#define TH_MINIMAL 0
+#define TH_ROUNDSHADED 1
+#define TH_ROUNDED 2
+#define TH_OLDSKOOL 3
+#define TH_SHADED 4
/* specific defines per space should have higher define values */
@@ -544,61 +544,53 @@ struct bTheme;
// THE CODERS API FOR THEMES:
// sets the color
-void BIF_ThemeColor(int colorid);
+void UI_ThemeColor(int colorid);
// sets the color plus alpha
-void BIF_ThemeColor4(int colorid);
+void UI_ThemeColor4(int colorid);
// sets color plus offset for shade
-void BIF_ThemeColorShade(int colorid, int offset);
+void UI_ThemeColorShade(int colorid, int offset);
// sets color plus offset for alpha
-void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
+void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
// sets color, which is blend between two theme colors
-void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac);
+void UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
// same, with shade offset
-void BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
+void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
// returns one value, not scaled
-float BIF_GetThemeValuef(int colorid);
-int BIF_GetThemeValue(int colorid);
+float UI_GetThemeValuef(int colorid);
+int UI_GetThemeValue(int colorid);
// get three color values, scaled to 0.0-1.0 range
-void BIF_GetThemeColor3fv(int colorid, float *col);
+void UI_GetThemeColor3fv(int colorid, float *col);
// get the 3 or 4 byte values
-void BIF_GetThemeColor3ubv(int colorid, char *col);
-void BIF_GetThemeColor4ubv(int colorid, char *col);
+void UI_GetThemeColor3ubv(int colorid, char *col);
+void UI_GetThemeColor4ubv(int colorid, char *col);
// get a theme color from specified space type
-void BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col);
+void UI_GetThemeColorType4ubv(int colorid, int spacetype, char *col);
// blends and shades between two color pointers
-void BIF_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset);
+void UI_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset);
// get a 3 byte color, blended and shaded between two other char color pointers
-void BIF_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset);
+void UI_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset);
struct ScrArea;
// internal (blender) usage only, for init and set active
-void BIF_InitTheme(void);
-void BIF_SetTheme(struct ScrArea *sa);
-void BIF_resources_init (void);
-void BIF_resources_free (void);
-void BIF_colors_init (void);
-void BIF_load_ui_colors (void);
+void UI_SetTheme(struct ScrArea *sa);
+void ui_theme_init_userdef (void);
+void ui_resources_init (void);
+void ui_resources_free (void);
/* only for buttons in theme editor! */
-char *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
-char *BIF_ThemeColorsPup(int spacetype);
-
-/* only for Bone Color sets */
-char *BIF_ThemeColorSetsPup(short inc_custom);
-
-
-void BIF_def_color (BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b);
+char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
+char *UI_ThemeColorsPup(int spacetype);
-#endif /* BIF_ICONS_H */
+#endif /* UI_ICONS_H */
diff --git a/source/blender/include/BIF_language.h b/source/blender/editors/include/UI_text.h
index d2f61fc418e..03a51f5ee49 100644
--- a/source/blender/include/BIF_language.h
+++ b/source/blender/editors/include/UI_text.h
@@ -27,10 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_LANGUAGE_H
-#define BIF_LANGUAGE_H
-
-#include "DNA_vec_types.h"
+#ifndef UI_TEXT_H
+#define UI_TEXT_H
struct BMF_Font;
@@ -44,13 +42,16 @@ void lang_setlanguage(void); /* usiblender.c */
char *language_pup(void);
char *fontsize_pup(void);
-int BIF_DrawString(struct BMF_Font* font, char *str, int translate);
-float BIF_GetStringWidth(struct BMF_Font* font, char *str, int translate);
-void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf* bbox);
+int UI_DrawString(struct BMF_Font* font, char *str, int translate);
+float UI_GetStringWidth(struct BMF_Font* font, char *str, int translate);
+void UI_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf* bbox);
+
+void UI_set_international(int international);
+int UI_get_international(void);
-void BIF_RasterPos(float x, float y);
-void BIF_SetScale(float aspect);
-void refresh_interface_font(void);
+void UI_RasterPos(float x, float y);
+void UI_SetScale(float aspect);
+void ui_text_init_userdef(void);
struct LANGMenuEntry {
struct LANGMenuEntry *next;
@@ -62,5 +63,5 @@ struct LANGMenuEntry {
struct LANGMenuEntry *find_language(short langid);
-#endif /* BIF_LANGUAGE_H */
+#endif /* UI_TEXT_H */
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
new file mode 100644
index 00000000000..2705c5de4f6
--- /dev/null
+++ b/source/blender/editors/include/UI_view2d.h
@@ -0,0 +1,131 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation, Joshua Leung
+ *
+ *
+ * Generic 2d view with should allow drawing grids,
+ * panning, zooming, scrolling, ..
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef UI_VIEW2D_H
+#define UI_VIEW2D_H
+
+/* ------------------------------------------ */
+/* Settings and Defines: */
+
+/* generic value to use when coordinate lies out of view when converting */
+#define V2D_IS_CLIPPED 12000
+
+/* 'dummy' argument to pass when argument is irrelevant */
+#define V2D_ARG_DUMMY -1
+
+
+/* grid-units (for drawing time) */
+#define V2D_UNIT_SECONDS 0
+#define V2D_UNIT_FRAMES 1
+
+/* grid-units (for drawing values) */
+#define V2D_UNIT_VALUES 2
+#define V2D_UNIT_DEGREES 3
+#define V2D_UNIT_TIME 4
+#define V2D_UNIT_SECONDSSEQ 5
+
+/* clamping of grid values to whole numbers */
+#define V2D_GRID_NOCLAMP 0
+#define V2D_GRID_CLAMP 1
+
+
+/* flags for grid-lines to draw */
+#define V2D_HORIZONTAL_LINES (1<<0)
+#define V2D_VERTICAL_LINES (1<<1)
+#define V2D_HORIZONTAL_AXIS (1<<2)
+#define V2D_VERTICAL_AXIS (1<<3)
+#define V2D_HORIZONTAL_FINELINES (1<<4)
+
+#define V2D_GRIDLINES_MAJOR (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS|V2D_HORIZONTAL_LINES|V2D_HORIZONTAL_AXIS)
+#define V2D_GRIDLINES_ALL (V2D_GRIDLINES_MAJOR|V2D_HORIZONTAL_FINELINES)
+
+
+/* ------------------------------------------ */
+/* Macros: */
+
+/* test if mouse in a scrollbar */
+#define IN_2D_VERT_SCROLL(v2d, co) (BLI_in_rcti(&v2d->vert, co[0], co[1]))
+#define IN_2D_HORIZ_SCROLL(v2d, co) (BLI_in_rcti(&v2d->hor, co[0], co[1]))
+
+/* ------------------------------------------ */
+/* Type definitions: */
+
+struct View2D;
+struct View2DGrid;
+struct View2DScrollers;
+
+struct wmWindowManager;
+struct bContext;
+
+typedef struct View2DGrid View2DGrid;
+typedef struct View2DScrollers View2DScrollers;
+
+/* ----------------------------------------- */
+/* Prototypes: */
+
+/* refresh and validation (of view rects) */
+void UI_view2d_size_update(struct View2D *v2d, int winx, int winy);
+void UI_view2d_curRect_validate(struct View2D *v2d);
+void UI_view2d_curRect_reset(struct View2D *v2d);
+void UI_view2d_totRect_set(struct View2D *v2d, int width, int height);
+
+/* view matrix operations */
+void UI_view2d_view_ortho(const struct bContext *C, struct View2D *v2d);
+void UI_view2d_view_orthoSpecial(const struct bContext *C, struct View2D *v2d, short xaxis);
+void UI_view2d_view_restore(const struct bContext *C);
+
+/* grid drawing */
+View2DGrid *UI_view2d_grid_calc(const struct bContext *C, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy);
+void UI_view2d_grid_draw(const struct bContext *C, struct View2D *v2d, View2DGrid *grid, int flag);
+void UI_view2d_grid_free(View2DGrid *grid);
+
+/* scrollbar drawing */
+View2DScrollers *UI_view2d_scrollers_calc(const struct bContext *C, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp);
+void UI_view2d_scrollers_draw(const struct bContext *C, struct View2D *v2d, View2DScrollers *scrollers);
+void UI_view2d_scrollers_free(View2DScrollers *scrollers);
+
+/* coordinate conversion */
+void UI_view2d_region_to_view(struct View2D *v2d, int x, int y, float *viewx, float *viewy);
+void UI_view2d_view_to_region(struct View2D *v2d, float x, float y, short *regionx, short *regiony);
+void UI_view2d_to_region_no_clip(struct View2D *v2d, float x, float y, short *regionx, short *region_y);
+
+/* utilities */
+struct View2D *UI_view2d_fromcontext(const struct bContext *C);
+struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C);
+void UI_view2d_getscale(struct View2D *v2d, float *x, float *y);
+void UI_view2d_header_default(struct View2D *v2d);
+
+/* operators */
+void ui_view2d_operatortypes(void);
+void UI_view2d_keymap(struct wmWindowManager *wm);
+
+#endif /* UI_VIEW2D_H */
+
diff --git a/source/blender/editors/interface/Makefile b/source/blender/editors/interface/Makefile
new file mode 100644
index 00000000000..fe223fabf2a
--- /dev/null
+++ b/source/blender/editors/interface/Makefile
@@ -0,0 +1,60 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_interface
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../ftfont
+
+# own include
+
+CPPFLAGS += -I../include
+
+ifeq ($(INTERNATIONAL), true)
+ CPPFLAGS += -DINTERNATIONAL
+endif
+
diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript
new file mode 100644
index 00000000000..42e4db60edb
--- /dev/null
+++ b/source/blender/editors/interface/SConscript
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc #intern/bmfont'
+incs += ' #/extern/glew/include'
+
+defs = []
+
+if env['WITH_BF_INTERNATIONAL']:
+ incs += ' ../../ftfont'
+ defs.append('INTERNATIONAL')
+ defs.append('FTGL_STATIC_LIBRARY')
+
+env.BlenderLib ( 'bf_editors_interface', sources, Split(incs), Split(defs), libtype=['core','intern'], priority=[40, 45] )
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
new file mode 100644
index 00000000000..2562a5e6bb3
--- /dev/null
+++ b/source/blender/editors/interface/interface.c
@@ -0,0 +1,2601 @@
+/**
+ * $Id: interface.c 16882 2008-10-02 12:29:45Z ton $
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <float.h>
+#include <math.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_ID.h"
+#include "DNA_listBase.h"
+#include "DNA_screen_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_userdef_types.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "BLI_dynstr.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_text.h"
+
+#include "BMF_Api.h"
+#ifdef INTERNATIONAL
+#include "FTF_Api.h"
+#endif
+
+#include "ED_screen.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_subwindow.h"
+#include "wm_window.h"
+
+#include "RNA_access.h"
+#include "RNA_types.h"
+
+#include "interface.h"
+
+/*
+ * a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt
+ *
+ * uiBlahBlah() external function
+ * ui_blah_blah() internal function
+ */
+
+static void ui_free_but(const bContext *C, uiBut *but);
+
+/* ************ GLOBALS ************* */
+
+static uiFont UIfont[UI_ARRAY]; // no init needed
+
+/* ************* translation ************** */
+
+/* XXX 2.50 missing from context */
+int ui_translate_buttons()
+{
+ return (U.transopts & USER_TR_BUTTONS);
+}
+
+int ui_translate_menus()
+{
+ return (U.transopts & USER_TR_MENUS);
+}
+
+int ui_translate_tooltips()
+{
+ return (U.transopts & USER_TR_TOOLTIPS);
+}
+
+/* ************* window matrix ************** */
+
+void ui_block_to_window_fl(const ARegion *ar, uiBlock *block, float *x, float *y)
+{
+ float gx, gy;
+ int sx, sy, getsizex, getsizey;
+
+ getsizex= ar->winrct.xmax-ar->winrct.xmin+1;
+ getsizey= ar->winrct.ymax-ar->winrct.ymin+1;
+ sx= ar->winrct.xmin;
+ sy= ar->winrct.ymin;
+
+ gx= *x;
+ gy= *y;
+ *x= ((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]));
+ *y= ((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]));
+}
+
+void ui_block_to_window(const ARegion *ar, uiBlock *block, int *x, int *y)
+{
+ float fx, fy;
+
+ fx= *x;
+ fy= *y;
+
+ ui_block_to_window_fl(ar, block, &fx, &fy);
+
+ *x= (int)(fx+0.5f);
+ *y= (int)(fy+0.5f);
+}
+
+void ui_block_to_window_rct(const ARegion *ar, uiBlock *block, rctf *graph, rcti *winr)
+{
+ rctf tmpr;
+
+ tmpr= *graph;
+ ui_block_to_window_fl(ar, block, &tmpr.xmin, &tmpr.ymin);
+ ui_block_to_window_fl(ar, block, &tmpr.xmax, &tmpr.ymax);
+
+ winr->xmin= tmpr.xmin;
+ winr->ymin= tmpr.ymin;
+ winr->xmax= tmpr.xmax;
+ winr->ymax= tmpr.ymax;
+}
+
+void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */
+{
+ float a, b, c, d, e, f, px, py;
+ int sx, sy, getsizex, getsizey;
+
+ getsizex= ar->winrct.xmax-ar->winrct.xmin+1;
+ getsizey= ar->winrct.ymax-ar->winrct.ymin+1;
+ sx= ar->winrct.xmin;
+ sy= ar->winrct.ymin;
+
+ a= .5*((float)getsizex)*block->winmat[0][0];
+ b= .5*((float)getsizex)*block->winmat[1][0];
+ c= .5*((float)getsizex)*(1.0+block->winmat[3][0]);
+
+ d= .5*((float)getsizey)*block->winmat[0][1];
+ e= .5*((float)getsizey)*block->winmat[1][1];
+ f= .5*((float)getsizey)*(1.0+block->winmat[3][1]);
+
+ px= *x - sx;
+ py= *y - sy;
+
+ *y= (a*(py-f) + d*(c-px))/(a*e-d*b);
+ *x= (px- b*(*y)- c)/a;
+}
+
+void ui_window_to_block(const ARegion *ar, uiBlock *block, int *x, int *y)
+{
+ float fx, fy;
+
+ fx= *x;
+ fy= *y;
+
+ ui_window_to_block_fl(ar, block, &fx, &fy);
+
+ *x= (int)(fx+0.5f);
+ *y= (int)(fy+0.5f);
+}
+
+void ui_window_to_region(const ARegion *ar, int *x, int *y)
+{
+ *x-= ar->winrct.xmin;
+ *y-= ar->winrct.ymin;
+}
+
+/* ******************* block calc ************************* */
+
+/* only for pulldowns */
+void uiTextBoundsBlock(uiBlock *block, int addval)
+{
+ uiBut *bt;
+ int i = 0, j, x1addval= 0, nextcol;
+
+ bt= block->buttons.first;
+ while(bt) {
+ if(bt->type!=SEPR) {
+ int transopts= ui_translate_buttons();
+ if(bt->type==TEX || bt->type==IDPOIN) transopts= 0;
+ j= UI_GetStringWidth(bt->font, bt->drawstr, transopts);
+
+ if(j > i) i = j;
+ }
+ bt= bt->next;
+ }
+
+ /* cope with multi collumns */
+ bt= block->buttons.first;
+ while(bt) {
+ if(bt->next && bt->x1 < bt->next->x1)
+ nextcol= 1;
+ else nextcol= 0;
+
+ bt->x1 = x1addval;
+ bt->x2 = bt->x1 + i + addval;
+
+ ui_check_but(bt); // clips text again
+
+ if(nextcol)
+ x1addval+= i + addval;
+
+ bt= bt->next;
+ }
+}
+
+void uiBoundsBlock(uiBlock *block, int addval)
+{
+ uiBut *bt;
+ int xof;
+
+ if(block==NULL)
+ return;
+
+ if(block->buttons.first==NULL) {
+ if(block->panel) {
+ block->minx= 0.0; block->maxx= block->panel->sizex;
+ block->miny= 0.0; block->maxy= block->panel->sizey;
+ }
+ }
+ else {
+
+ block->minx= block->miny= 10000;
+ block->maxx= block->maxy= -10000;
+
+ bt= block->buttons.first;
+ while(bt) {
+ if(bt->x1 < block->minx) block->minx= bt->x1;
+ if(bt->y1 < block->miny) block->miny= bt->y1;
+
+ if(bt->x2 > block->maxx) block->maxx= bt->x2;
+ if(bt->y2 > block->maxy) block->maxy= bt->y2;
+
+ bt= bt->next;
+ }
+
+ block->minx -= addval;
+ block->miny -= addval;
+ block->maxx += addval;
+ block->maxy += addval;
+ }
+
+ /* hardcoded exception... but that one is annoying with larger safety */
+ bt= block->buttons.first;
+ if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10;
+ else xof= 40;
+
+ block->safety.xmin= block->minx-xof;
+ block->safety.ymin= block->miny-xof;
+ block->safety.xmax= block->maxx+xof;
+ block->safety.ymax= block->maxy+xof;
+}
+
+void uiBlockTranslate(uiBlock *block, int x, int y)
+{
+ uiBut *bt;
+
+ for(bt= block->buttons.first; bt; bt=bt->next) {
+ bt->x1 += x;
+ bt->y1 += y;
+ bt->x2 += x;
+ bt->y2 += y;
+ }
+
+ block->minx += x;
+ block->miny += y;
+ block->maxx += x;
+ block->maxy += y;
+}
+
+void uiBlockOrigin(uiBlock *block)
+{
+ uiBut *bt;
+ int minx= 10000, miny= 10000;
+
+ for(bt= block->buttons.first; bt; bt=bt->next) {
+ if(bt->x1 < minx) minx= bt->x1;
+ if(bt->y1 < miny) miny= bt->y1;
+ }
+
+ uiBlockTranslate(block, -minx, -miny);
+}
+
+void ui_autofill(uiBlock *block)
+{
+ uiBut *but;
+ float *maxw, *maxh, startx = 0, starty, height = 0;
+ float totmaxh;
+ int rows=0, /* cols=0, */ i, lasti;
+
+ /* first count rows */
+ but= block->buttons.last;
+ rows= but->x1+1;
+
+ /* calculate max width / height for each row */
+ maxw= MEM_callocN(sizeof(float)*rows, "maxw");
+ maxh= MEM_callocN(sizeof(float)*rows, "maxh");
+ but= block->buttons.first;
+ while(but) {
+ i= but->x1;
+ if( maxh[i] < but->y2) maxh[i]= but->y2;
+ maxw[i] += but->x2;
+ but= but->next;
+ }
+
+ totmaxh= 0.0;
+ for(i=0; i<rows; i++) totmaxh+= maxh[i];
+
+ /* apply widths/heights */
+ starty= block->maxy;
+ but= block->buttons.first;
+ lasti= -1;
+ while(but) {
+ // signal for aligning code
+ but->flag |= UI_BUT_ALIGN_DOWN;
+
+ i= but->x1;
+
+ if(i!=lasti) {
+ startx= block->minx;
+ height= (maxh[i]*(block->maxy-block->miny))/totmaxh;
+ starty-= height;
+ lasti= i;
+ }
+
+ but->y1= starty+but->aspect;
+ but->y2= but->y1+height-but->aspect;
+
+ but->x2= (but->x2*(block->maxx-block->minx))/maxw[i];
+ but->x1= startx+but->aspect;
+
+ startx+= but->x2;
+ but->x2+= but->x1-but->aspect;
+
+ ui_check_but(but);
+
+ but= but->next;
+ }
+
+ uiBlockEndAlign(block);
+
+ MEM_freeN(maxw); MEM_freeN(maxh);
+ block->autofill= 0;
+}
+
+/* ************** LINK LINE DRAWING ************* */
+
+/* link line drawing is not part of buttons or theme.. so we stick with it here */
+
+static void ui_draw_linkline(uiBut *but, uiLinkLine *line)
+{
+ float vec1[2], vec2[2];
+
+ if(line->from==NULL || line->to==NULL) return;
+
+ vec1[0]= (line->from->x1+line->from->x2)/2.0;
+ vec1[1]= (line->from->y1+line->from->y2)/2.0;
+ vec2[0]= (line->to->x1+line->to->x2)/2.0;
+ vec2[1]= (line->to->y1+line->to->y2)/2.0;
+
+ if(line->flag & UI_SELECT) UI_ThemeColorShade(but->themecol, 80);
+ else glColor3ub(0,0,0);
+ fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]);
+}
+
+static void ui_draw_links(uiBlock *block)
+{
+ uiBut *but;
+ uiLinkLine *line;
+
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==LINK && but->link) {
+ line= but->link->lines.first;
+ while(line) {
+ ui_draw_linkline(but, line);
+ line= line->next;
+ }
+ }
+ but= but->next;
+ }
+}
+
+/* ************** BLOCK ENDING FUNCTION ************* */
+
+static int ui_but_equals_old(uiBut *but, uiBut *oldbut)
+{
+ /* various properties are being compared here, hopfully sufficient
+ * to catch all cases, but it is simple to add more checks later */
+ if(but->retval != oldbut->retval) return 0;
+ if(but->poin != oldbut->poin || but->pointype != oldbut->pointype) return 0;
+ if(but->rnapoin.data != oldbut->rnapoin.data) return 0;
+ if(but->rnaprop != oldbut->rnaprop)
+ if(but->rnaindex != oldbut->rnaindex) return 0;
+ if(but->func != oldbut->func) return 0;
+ if(but->func_arg1 != oldbut->func_arg1) return 0;
+ if(but->func_arg2 != oldbut->func_arg2) return 0;
+
+ return 1;
+}
+
+static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut *but)
+{
+ uiBlock *oldblock;
+ uiBut *oldbut;
+ int found= 0;
+
+ oldblock= block->oldblock;
+ if(!oldblock)
+ return found;
+
+ for(oldbut=oldblock->buttons.first; oldbut; oldbut=oldbut->next) {
+ if(ui_but_equals_old(oldbut, but)) {
+ if(oldbut->active) {
+ but->flag= oldbut->flag;
+ but->active= oldbut->active;
+ but->pos= oldbut->pos;
+ but->editstr= oldbut->editstr;
+ but->editval= oldbut->editval;
+ but->editvec= oldbut->editvec;
+ but->editcoba= oldbut->editcoba;
+ but->editcumap= oldbut->editcumap;
+ but->selsta= oldbut->selsta;
+ but->selend= oldbut->selend;
+ found= 1;
+
+ oldbut->active= NULL;
+ }
+
+ /* ensures one button can get activated, and in case the buttons
+ * draw are the same this gives O(1) lookup for each button */
+ BLI_remlink(&oldblock->buttons, oldbut);
+ ui_free_but(C, oldbut);
+
+ break;
+ }
+ }
+
+ return found;
+}
+
+void uiEndBlock(const bContext *C, uiBlock *block)
+{
+ uiBut *but;
+
+ /* inherit flags from 'old' buttons that was drawn here previous, based
+ * on matching buttons, we need this to make button event handling non
+ * blocking, while still alowing buttons to be remade each redraw as it
+ * is expected by blender code */
+ for(but=block->buttons.first; but; but=but->next)
+ if(ui_but_update_from_old_block(C, block, but))
+ ui_check_but(but);
+
+ if(block->oldblock) {
+ block->auto_open= block->oldblock->auto_open;
+ block->auto_open_last= block->oldblock->auto_open_last;
+ block->tooltipdisabled= block->oldblock->tooltipdisabled;
+
+ uiFreeBlock(C, block->oldblock);
+ block->oldblock= NULL;
+ }
+
+ /* handle pending stuff */
+ if(block->autofill) ui_autofill(block);
+ if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0);
+ if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
+}
+
+/* ************** BLOCK DRAWING FUNCTION ************* */
+
+void uiDrawBlock(uiBlock *block)
+{
+ uiBut *but;
+
+ /* we set this only once */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ /* XXX 2.50 no panels yet */
+ //uiPanelPush(block); // panel matrix
+
+ if(block->flag & UI_BLOCK_LOOP) {
+ uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag);
+ }
+ else {
+ /* XXX 2.50 no panels yet */
+ //if(block->panel) ui_draw_panel(block);
+ }
+
+ /* XXX 2.50 need context here? */
+ //if(block->drawextra) block->drawextra(curarea, block);
+
+ for (but= block->buttons.first; but; but= but->next)
+ ui_draw_but(but);
+
+ ui_draw_links(block);
+
+ /* XXX 2.50 no panels yet */
+ //uiPanelPop(block); // matrix restored
+}
+
+/* ************* EVENTS ************* */
+
+static void ui_is_but_sel(uiBut *but)
+{
+ double value;
+ int lvalue;
+ short push=0, true=1;
+
+ value= ui_get_but_val(but);
+
+ if( but->type==TOGN || but->type==ICONTOGN) true= 0;
+
+ if( but->bit ) {
+ lvalue= (int)value;
+ if( BTST(lvalue, (but->bitnr)) ) push= true;
+ else push= !true;
+ }
+ else {
+ switch(but->type) {
+ case BUT:
+ push= 2;
+ break;
+ case KEYEVT:
+ if (value==-1) push= 1;
+ break;
+ case TOG:
+ case TOGR:
+ case TOG3:
+ case BUT_TOGDUAL:
+ case ICONTOG:
+ if(value!=but->min) push= 1;
+ break;
+ case ICONTOGN:
+ case TOGN:
+ if(value==0.0) push= 1;
+ break;
+ case ROW:
+ if(value == but->max) push= 1;
+ break;
+ case COL:
+ push= 1;
+ break;
+ default:
+ push= 2;
+ break;
+ }
+ }
+
+ if(push==2);
+ else if(push==1) but->flag |= UI_SELECT;
+ else but->flag &= ~UI_SELECT;
+}
+
+/* XXX 2.50 no links supported yet */
+
+#if 0
+static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval)
+{
+ uiBut *bt;
+
+ /* find button to link to */
+ for (bt= block->buttons.first; bt; bt= bt->next)
+ if(bt!=but && uibut_contains_pt(bt, mval))
+ break;
+
+ if (bt) {
+ if (but->type==LINK && bt->type==INLINK) {
+ if( but->link->tocode == (int)bt->min ) {
+ return bt;
+ }
+ }
+ else if(but->type==INLINK && bt->type==LINK) {
+ if( bt->link->tocode == (int)but->min ) {
+ return bt;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+static int ui_is_a_link(uiBut *from, uiBut *to)
+{
+ uiLinkLine *line;
+ uiLink *link;
+
+ link= from->link;
+ if(link) {
+ line= link->lines.first;
+ while(line) {
+ if(line->from==from && line->to==to) return 1;
+ line= line->next;
+ }
+ }
+ return 0;
+}
+
+static uiBut *ui_find_inlink(uiBlock *block, void *poin)
+{
+ uiBut *but;
+
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==INLINK) {
+ if(but->poin == poin) return but;
+ }
+ but= but->next;
+ }
+ return NULL;
+}
+
+static void ui_add_link_line(ListBase *listb, uiBut *but, uiBut *bt)
+{
+ uiLinkLine *line;
+
+ line= MEM_callocN(sizeof(uiLinkLine), "linkline");
+ BLI_addtail(listb, line);
+ line->from= but;
+ line->to= bt;
+}
+
+uiBut *uiFindInlink(uiBlock *block, void *poin)
+{
+ return ui_find_inlink(block, poin);
+}
+
+void uiComposeLinks(uiBlock *block)
+{
+ uiBut *but, *bt;
+ uiLink *link;
+ void ***ppoin;
+ int a;
+
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==LINK) {
+ link= but->link;
+
+ /* for all pointers in the array */
+ if(link) {
+ if(link->ppoin) {
+ ppoin= link->ppoin;
+ for(a=0; a < *(link->totlink); a++) {
+ bt= ui_find_inlink(block, (*ppoin)[a] );
+ if(bt) {
+ ui_add_link_line(&link->lines, but, bt);
+ }
+ }
+ }
+ else if(link->poin) {
+ bt= ui_find_inlink(block, *(link->poin) );
+ if(bt) {
+ ui_add_link_line(&link->lines, but, bt);
+ }
+ }
+ }
+ }
+ but= but->next;
+ }
+}
+
+static void ui_add_link(uiBut *from, uiBut *to)
+{
+ /* in 'from' we have to add a link to 'to' */
+ uiLink *link;
+ void **oldppoin;
+ int a;
+
+ if(ui_is_a_link(from, to)) {
+ printf("already exists\n");
+ return;
+ }
+
+ link= from->link;
+
+ /* are there more pointers allowed? */
+ if(link->ppoin) {
+ oldppoin= *(link->ppoin);
+
+ (*(link->totlink))++;
+ *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link");
+
+ for(a=0; a< (*(link->totlink))-1; a++) {
+ (*(link->ppoin))[a]= oldppoin[a];
+ }
+ (*(link->ppoin))[a]= to->poin;
+
+ if(oldppoin) MEM_freeN(oldppoin);
+ }
+ else {
+ *(link->poin)= to->poin;
+ }
+
+}
+
+static int ui_do_but_LINK(uiBlock *block, uiBut *but)
+{
+ /*
+ * This button only visualizes, the dobutton mode
+ * can add a new link, but then the whole system
+ * should be redrawn/initialized.
+ *
+ */
+ uiBut *bt=0, *bto=NULL;
+ short sval[2], mval[2], mvalo[2], first= 1;
+
+ uiGetMouse(curarea->win, sval);
+ mvalo[0]= sval[0];
+ mvalo[1]= sval[1];
+
+ while (get_mbut() & L_MOUSE) {
+ uiGetMouse(curarea->win, mval);
+
+ if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || first) {
+ /* clear completely, because of drawbuttons */
+ bt= ui_get_valid_link_button(block, but, mval);
+ if(bt) {
+ bt->flag |= UI_ACTIVE;
+ ui_draw_but(bt);
+ }
+ if(bto && bto!=bt) {
+ bto->flag &= ~UI_ACTIVE;
+ ui_draw_but(bto);
+ }
+ bto= bt;
+
+ if (!first) {
+ glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]);
+ }
+ glutil_draw_front_xor_line(sval[0], sval[1], mval[0], mval[1]);
+
+ mvalo[0]= mval[0];
+ mvalo[1]= mval[1];
+
+ first= 0;
+ }
+ else UI_wait_for_statechange();
+ }
+
+ if (!first) {
+ glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]);
+ }
+
+ if(bt) {
+ if(but->type==LINK) ui_add_link(but, bt);
+ else ui_add_link(bt, but);
+
+ scrarea_queue_winredraw(curarea);
+ }
+
+ return 0;
+}
+#endif
+
+/* ************************************************ */
+
+void uiBlockSetButLock(uiBlock *block, int val, char *lockstr)
+{
+ block->lock |= val;
+ if(val) block->lockstr= lockstr;
+}
+
+void uiBlockClearButLock(uiBlock *block)
+{
+ block->lock= 0;
+ block->lockstr= NULL;
+}
+
+/* *************************************************************** */
+
+/* XXX 2.50 no button editing */
+
+#if 0
+static void setup_file(uiBlock *block)
+{
+ uiBut *but;
+ FILE *fp;
+
+ fp= fopen("butsetup","w");
+ if(fp==NULL);
+ else {
+ but= block->buttons.first;
+ while(but) {
+ ui_check_but(but);
+ fprintf(fp,"%d,%d,%d,%d %s %s\n", (int)but->x1, (int)but->y1, (int)( but->x2-but->x1), (int)(but->y2-but->y1), but->str, but->tip);
+ but= but->next;
+ }
+ fclose(fp);
+ }
+}
+
+
+static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent)
+{
+ short dx, dy, mval[2], mvalo[2], didit=0;
+
+ getmouseco_sc(mvalo);
+ while(TRUE) {
+ if( !(get_mbut() & L_MOUSE) ) break;
+
+ getmouseco_sc(mval);
+ dx= (mval[0]-mvalo[0]);
+ dy= (mval[1]-mvalo[1]);
+
+ if(dx!=0 || dy!=0) {
+ mvalo[0]= mval[0];
+ mvalo[1]= mval[1];
+
+ cpack(0xc0c0c0);
+ glRectf(but->x1-2, but->y1-2, but->x2+2, but->y2+2);
+
+ if((uevent->qual & LR_SHIFTKEY)==0) {
+ but->x1 += dx;
+ but->y1 += dy;
+ }
+ but->x2 += dx;
+ but->y2 += dy;
+
+ ui_draw_but(but);
+ ui_block_flush_back(but->block);
+ didit= 1;
+
+ }
+ /* idle for this poor code */
+ else PIL_sleep_ms(30);
+ }
+ if(didit) setup_file(block);
+}
+#endif
+
+/* XXX 2.50 no links supported yet */
+#if 0
+static void ui_delete_active_linkline(uiBlock *block)
+{
+ uiBut *but;
+ uiLink *link;
+ uiLinkLine *line, *nline;
+ int a, b;
+
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==LINK && but->link) {
+ line= but->link->lines.first;
+ while(line) {
+
+ nline= line->next;
+
+ if(line->flag & UI_SELECT) {
+ BLI_remlink(&but->link->lines, line);
+
+ link= line->from->link;
+
+ /* are there more pointers allowed? */
+ if(link->ppoin) {
+
+ if(*(link->totlink)==1) {
+ *(link->totlink)= 0;
+ MEM_freeN(*(link->ppoin));
+ *(link->ppoin)= NULL;
+ }
+ else {
+ b= 0;
+ for(a=0; a< (*(link->totlink)); a++) {
+
+ if( (*(link->ppoin))[a] != line->to->poin ) {
+ (*(link->ppoin))[b]= (*(link->ppoin))[a];
+ b++;
+ }
+ }
+ (*(link->totlink))--;
+ }
+ }
+ else {
+ *(link->poin)= NULL;
+ }
+
+ MEM_freeN(line);
+ }
+ line= nline;
+ }
+ }
+ but= but->next;
+ }
+
+ /* temporal! these buttons can be everywhere... */
+ allqueue(REDRAWBUTSLOGIC, 0);
+}
+
+static void ui_do_active_linklines(uiBlock *block, short *mval)
+{
+ uiBut *but;
+ uiLinkLine *line, *act= NULL;
+ float mindist= 12.0, fac, v1[2], v2[2], v3[3];
+ int foundone= 0;
+
+ if(mval) {
+ v1[0]= mval[0];
+ v1[1]= mval[1];
+
+ /* find a line close to the mouse */
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==LINK && but->link) {
+ foundone= 1;
+ line= but->link->lines.first;
+ while(line) {
+ v2[0]= line->from->x2;
+ v2[1]= (line->from->y1+line->from->y2)/2.0;
+ v3[0]= line->to->x1;
+ v3[1]= (line->to->y1+line->to->y2)/2.0;
+
+ fac= PdistVL2Dfl(v1, v2, v3);
+ if(fac < mindist) {
+ mindist= fac;
+ act= line;
+ }
+ line= line->next;
+ }
+ }
+ but= but->next;
+ }
+ }
+
+ /* check for a 'found one' to prevent going to 'frontbuffer' mode.
+ this slows done gfx quite some, and at OSX the 'finish' forces a swapbuffer */
+ if(foundone) {
+ glDrawBuffer(GL_FRONT);
+
+ /* draw */
+ but= block->buttons.first;
+ while(but) {
+ if(but->type==LINK && but->link) {
+ line= but->link->lines.first;
+ while(line) {
+ if(line==act) {
+ if((line->flag & UI_SELECT)==0) {
+ line->flag |= UI_SELECT;
+ ui_draw_linkline(but, line);
+ }
+ }
+ else if(line->flag & UI_SELECT) {
+ line->flag &= ~UI_SELECT;
+ ui_draw_linkline(but, line);
+ }
+ line= line->next;
+ }
+ }
+ but= but->next;
+ }
+ bglFlush();
+ glDrawBuffer(GL_BACK);
+ }
+}
+#endif
+
+/* ******************************************************* */
+
+/* XXX 2.50 no screendump supported yet */
+
+#if 0
+/* nasty but safe way to store screendump rect */
+static int scr_x=0, scr_y=0, scr_sizex=0, scr_sizey=0;
+
+static void ui_set_screendump_bbox(uiBlock *block)
+{
+ if(block) {
+ scr_x= block->minx;
+ scr_y= block->miny;
+ scr_sizex= block->maxx - block->minx;
+ scr_sizey= block->maxy - block->miny;
+ }
+ else {
+ scr_sizex= scr_sizey= 0;
+ }
+}
+
+/* used for making screenshots for menus, called in screendump.c */
+int uiIsMenu(int *x, int *y, int *sizex, int *sizey)
+{
+ if(scr_sizex!=0 && scr_sizey!=0) {
+ *x= scr_x;
+ *y= scr_y;
+ *sizex= scr_sizex;
+ *sizey= scr_sizey;
+ return 1;
+ }
+
+ return 0;
+}
+#endif
+
+/* *********************** data get/set ***********************
+ * this either works with the pointed to data, or can work with
+ * an edit override pointer while dragging for example */
+
+/* for buttons pointing to color for example */
+void ui_get_but_vectorf(uiBut *but, float *vec)
+{
+ void *poin;
+ int pointype;
+
+ poin= (but->editvec)? (void*)but->editvec: but->poin;
+ pointype= (but->editvec)? FLO: but->pointype;
+
+ if(!but->editvec && pointype == CHA) {
+ char *cp= (char *)poin;
+ vec[0]= ((float)cp[0])/255.0;
+ vec[1]= ((float)cp[1])/255.0;
+ vec[2]= ((float)cp[2])/255.0;
+ }
+ else if(pointype == FLO) {
+ float *fp= (float *)poin;
+ VECCOPY(vec, fp);
+ }
+}
+
+/* for buttons pointing to color for example */
+void ui_set_but_vectorf(uiBut *but, float *vec)
+{
+ void *poin;
+ int pointype;
+
+ poin= (but->editvec)? (void*)but->editvec: but->poin;
+ pointype= (but->editvec)? FLO: but->pointype;
+
+ if(!but->editvec && but->pointype == CHA) {
+ char *cp= (char *)poin;
+ cp[0]= (char)(0.5 +vec[0]*255.0);
+ cp[1]= (char)(0.5 +vec[1]*255.0);
+ cp[2]= (char)(0.5 +vec[2]*255.0);
+ }
+ else if( but->pointype == FLO ) {
+ float *fp= (float *)poin;
+ VECCOPY(fp, vec);
+ }
+}
+
+int ui_is_but_float(uiBut *but)
+{
+ if(but->pointype==FLO && but->poin)
+ return 1;
+
+ if(but->rnaprop && RNA_property_type(&but->rnapoin, but->rnaprop) == PROP_FLOAT)
+ return 1;
+
+ return 0;
+}
+
+double ui_get_but_val(uiBut *but)
+{
+ PropertyRNA *prop;
+ double value = 0.0;
+
+ if(but->editval) { return *(but->editval); }
+ if(but->poin==NULL && but->rnapoin.data==NULL) return 0.0;
+
+ if(but->rnaprop) {
+ prop= but->rnaprop;
+
+ switch(RNA_property_type(&but->rnapoin, prop)) {
+ case PROP_BOOLEAN:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_boolean_get_array(&but->rnapoin, prop, but->rnaindex);
+ else
+ value= RNA_property_boolean_get(&but->rnapoin, prop);
+ break;
+ case PROP_INT:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_int_get_array(&but->rnapoin, prop, but->rnaindex);
+ else
+ value= RNA_property_int_get(&but->rnapoin, prop);
+ break;
+ case PROP_FLOAT:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_float_get_array(&but->rnapoin, prop, but->rnaindex);
+ else
+ value= RNA_property_float_get(&but->rnapoin, prop);
+ break;
+ case PROP_ENUM:
+ value= RNA_property_enum_get(&but->rnapoin, prop);
+ break;
+ default:
+ value= 0.0;
+ break;
+ }
+ }
+ else if(but->type== HSVSLI) {
+ float h, s, v, *fp;
+
+ fp= (but->editvec)? but->editvec: (float *)but->poin;
+ rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
+
+ switch(but->str[0]) {
+ case 'H': value= h; break;
+ case 'S': value= s; break;
+ case 'V': value= v; break;
+ }
+ }
+ else if( but->pointype == CHA ) {
+ value= *(char *)but->poin;
+ }
+ else if( but->pointype == SHO ) {
+ value= *(short *)but->poin;
+ }
+ else if( but->pointype == INT ) {
+ value= *(int *)but->poin;
+ }
+ else if( but->pointype == FLO ) {
+ value= *(float *)but->poin;
+ }
+
+ return value;
+}
+
+void ui_set_but_val(uiBut *but, double value)
+{
+ PropertyRNA *prop;
+
+ /* value is a hsv value: convert to rgb */
+ if(but->rnaprop) {
+ prop= but->rnaprop;
+
+ if(RNA_property_editable(&but->rnapoin, prop)) {
+ switch(RNA_property_type(&but->rnapoin, prop)) {
+ case PROP_BOOLEAN:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_boolean_set_array(&but->rnapoin, prop, but->rnaindex, value);
+ else
+ RNA_property_boolean_set(&but->rnapoin, prop, value);
+ break;
+ case PROP_INT:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_int_set_array(&but->rnapoin, prop, but->rnaindex, value);
+ else
+ RNA_property_int_set(&but->rnapoin, prop, value);
+ break;
+ case PROP_FLOAT:
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_float_set_array(&but->rnapoin, prop, but->rnaindex, value);
+ else
+ RNA_property_float_set(&but->rnapoin, prop, value);
+ break;
+ case PROP_ENUM:
+ RNA_property_enum_set(&but->rnapoin, prop, value);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else if(but->pointype==0);
+ else if(but->type==HSVSLI ) {
+ float h, s, v, *fp;
+
+ fp= (but->editvec)? but->editvec: (float *)but->poin;
+ rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
+
+ switch(but->str[0]) {
+ case 'H': h= value; break;
+ case 'S': s= value; break;
+ case 'V': v= value; break;
+ }
+
+ hsv_to_rgb(h, s, v, fp, fp+1, fp+2);
+
+ }
+ else {
+ /* first do rounding */
+ if(but->pointype==CHA)
+ value= (char)floor(value+0.5);
+ else if(but->pointype==SHO ) {
+ /* gcc 3.2.1 seems to have problems
+ * casting a double like 32772.0 to
+ * a short so we cast to an int, then
+ to a short */
+ int gcckludge;
+ gcckludge = (int) floor(value+0.5);
+ value= (short)gcckludge;
+ }
+ else if(but->pointype==INT )
+ value= (int)floor(value+0.5);
+ else if(but->pointype==FLO ) {
+ float fval= (float)value;
+ if(fval>= -0.00001f && fval<= 0.00001f) fval= 0.0f; /* prevent negative zero */
+ value= fval;
+ }
+
+ /* then set value with possible edit override */
+ if(but->editval)
+ *but->editval= value;
+ else if(but->pointype==CHA)
+ *((char *)but->poin)= (char)value;
+ else if(but->pointype==SHO)
+ *((short *)but->poin)= (short)value;
+ else if(but->pointype==INT)
+ *((int *)but->poin)= (int)value;
+ else if(but->pointype==FLO)
+ *((float *)but->poin)= (float)value;
+ }
+
+ /* update select flag */
+ ui_is_but_sel(but);
+}
+
+void ui_get_but_string(uiBut *but, char *str, int maxlen)
+{
+ if(but->rnaprop) {
+ char *buf;
+
+ buf= RNA_property_string_get_alloc(&but->rnapoin, but->rnaprop, str, maxlen);
+
+ if(buf != str) {
+ /* string was too long, we have to truncate */
+ BLI_strncpy(str, buf, maxlen);
+ MEM_freeN(buf);
+ }
+ }
+ else
+ BLI_strncpy(str, but->poin, maxlen);
+
+}
+
+void ui_set_but_string(uiBut *but, const char *str)
+{
+ if(but->rnaprop) {
+ if(RNA_property_editable(&but->rnapoin, but->rnaprop))
+ RNA_property_string_set(&but->rnapoin, but->rnaprop, str);
+ }
+ else
+ BLI_strncpy(but->poin, str, but->max);
+}
+
+/* ******************* Font ********************/
+
+static void ui_set_ftf_font(float aspect)
+{
+#ifdef INTERNATIONAL
+ if(aspect<1.15) {
+ FTF_SetFontSize('l');
+ }
+ else if(aspect<1.59) {
+ FTF_SetFontSize('m');
+ }
+ else {
+ FTF_SetFontSize('s');
+ }
+#endif
+}
+
+void uiSetCurFont(uiBlock *block, int index)
+{
+ ui_set_ftf_font(block->aspect);
+
+ if(block->aspect<0.60) {
+ block->curfont= UIfont[index].xl;
+ }
+ else if(block->aspect<1.15) {
+ block->curfont= UIfont[index].large;
+ }
+ else if(block->aspect<1.59) {
+ block->curfont= UIfont[index].medium;
+ }
+ else {
+ block->curfont= UIfont[index].small;
+ }
+
+ if(block->curfont==NULL) block->curfont= UIfont[index].large;
+ if(block->curfont==NULL) block->curfont= UIfont[index].medium;
+ if(block->curfont==NULL) printf("error block no font %s\n", block->name);
+
+}
+
+/* called by node editor */
+void *uiSetCurFont_ext(float aspect)
+{
+ void *curfont;
+
+ ui_set_ftf_font(aspect);
+
+ if(aspect<0.60) {
+ curfont= UIfont[0].xl;
+ }
+ else if(aspect<1.15) {
+ curfont= UIfont[0].large;
+ }
+ else if(aspect<1.59) {
+ curfont= UIfont[0].medium;
+ }
+ else {
+ curfont= UIfont[0].small;
+ }
+
+ if(curfont==NULL) curfont= UIfont[0].large;
+ if(curfont==NULL) curfont= UIfont[0].medium;
+
+ return curfont;
+}
+
+void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small)
+{
+ if(index>=UI_ARRAY) return;
+
+ UIfont[index].xl= xl;
+ UIfont[index].large= large;
+ UIfont[index].medium= medium;
+ UIfont[index].small= small;
+}
+
+/* ******************* Free ********************/
+
+static void ui_free_link(uiLink *link)
+{
+ if(link) {
+ BLI_freelistN(&link->lines);
+ MEM_freeN(link);
+ }
+}
+
+static void ui_free_but(const bContext *C, uiBut *but)
+{
+ if(but->active) ui_button_active_cancel(C, but);
+ if(but->str && but->str != but->strdata) MEM_freeN(but->str);
+ ui_free_link(but->link);
+
+ MEM_freeN(but);
+}
+
+void uiFreeBlock(const bContext *C, uiBlock *block)
+{
+ uiBut *but;
+
+ while( (but= block->buttons.first) ) {
+ BLI_remlink(&block->buttons, but);
+ ui_free_but(C, but);
+ }
+
+ if(block->panel) block->panel->active= 0;
+ BLI_freelistN(&block->saferct);
+
+
+ MEM_freeN(block);
+}
+
+void uiFreeBlocks(const bContext *C, ListBase *lb)
+{
+ uiBlock *block;
+
+ while( (block= lb->first) ) {
+ BLI_remlink(lb, block);
+ uiFreeBlock(C, block);
+ }
+}
+
+uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt, short font)
+{
+ ListBase *lb;
+ uiBlock *block, *oldblock= NULL;
+ wmWindow *window;
+ int getsizex, getsizey;
+
+ window= C->window;
+ lb= &region->uiblocks;
+
+ /* each listbase only has one block with this name, free block
+ * if is already there so it can be rebuilt from scratch */
+ if(lb) {
+ for (oldblock= lb->first; oldblock; oldblock= oldblock->next)
+ if (BLI_streq(oldblock->name, name))
+ break;
+
+ if (oldblock)
+ BLI_remlink(lb, oldblock);
+ }
+
+ block= MEM_callocN(sizeof(uiBlock), "uiBlock");
+ block->oldblock= oldblock;
+
+ /* at the beginning of the list! for dynamical menus/blocks */
+ if(lb)
+ BLI_addhead(lb, block);
+
+ BLI_strncpy(block->name, name, sizeof(block->name));
+
+#if 0
+ /* draw win */
+ block->win= win;
+ /* window where queue event should be added, pretty weak this way!
+ this is because the 'mainwin' pup menu's */
+ block->winq= mywinget();
+#endif
+
+ block->dt= dt;
+ block->themecol= TH_AUTO;
+
+ /* window matrix and aspect */
+ if(region->swinid) {
+ wm_subwindow_getmatrix(window, region->swinid, block->winmat);
+ wm_subwindow_getsize(window, region->swinid, &getsizex, &getsizey);
+
+ /* TODO - investigate why block->winmat[0][0] is negative
+ * in the image view when viewRedrawForce is called */
+ block->aspect= 2.0/fabs( (getsizex)*block->winmat[0][0]);
+ }
+ else {
+ /* no subwindow created yet, for menus for example, so we
+ * use the main window instead, since buttons are created
+ * there anyway */
+ wm_subwindow_getmatrix(window, window->winid, block->winmat);
+ wm_subwindow_getsize(window, window->winid, &getsizex, &getsizey);
+
+ block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]);
+ block->auto_open= 2;
+ }
+
+ uiSetCurFont(block, font);
+
+ return block;
+}
+
+uiBlock *uiGetBlock(char *name, ARegion *ar)
+{
+ uiBlock *block= ar->uiblocks.first;
+
+ while(block) {
+ if( strcmp(name, block->name)==0 ) return block;
+ block= block->next;
+ }
+
+ return NULL;
+}
+
+void ui_check_but(uiBut *but)
+{
+ /* if something changed in the button */
+ ID *id;
+ double value;
+ float okwidth;
+ int transopts= ui_translate_buttons();
+ short pos;
+
+ ui_is_but_sel(but);
+
+ if(but->type==TEX || but->type==IDPOIN) transopts= 0;
+
+ /* test for min and max, icon sliders, etc */
+ switch( but->type ) {
+ case NUM:
+ case SLI:
+ case SCROLL:
+ case NUMSLI:
+ case HSVSLI:
+ value= ui_get_but_val(but);
+ if(value < but->min) ui_set_but_val(but, but->min);
+ else if(value > but->max) ui_set_but_val(but, but->max);
+ break;
+
+ case NUMABS:
+ value= fabs( ui_get_but_val(but) );
+ if(value < but->min) ui_set_but_val(but, but->min);
+ else if(value > but->max) ui_set_but_val(but, but->max);
+ break;
+
+ case ICONTOG:
+ case ICONTOGN:
+ if(but->flag & UI_SELECT) but->iconadd= 1;
+ else but->iconadd= 0;
+ break;
+
+ case ICONROW:
+ value= ui_get_but_val(but);
+ but->iconadd= (int)value- (int)(but->min);
+ break;
+
+ case ICONTEXTROW:
+ value= ui_get_but_val(but);
+ but->iconadd= (int)value- (int)(but->min);
+ break;
+ }
+
+
+ /* safety is 4 to enable small number buttons (like 'users') */
+ if(but->type==NUMSLI || but->type==HSVSLI)
+ okwidth= -4 + (but->x2 - but->x1)/2.0;
+ else
+ okwidth= -4 + (but->x2 - but->x1);
+
+ /* name: */
+ switch( but->type ) {
+
+ case MENU:
+ case ICONTEXTROW:
+
+ if(but->x2 - but->x1 > 24) {
+ value= ui_get_but_val(but);
+ ui_set_name_menu(but, (int)value);
+ }
+ break;
+
+ case NUM:
+ case NUMSLI:
+ case HSVSLI:
+ case NUMABS:
+
+ value= ui_get_but_val(but);
+
+ if(ui_is_but_float(but)) {
+ if(value == FLT_MAX) sprintf(but->drawstr, "%sFLT_MAX", but->str);
+ else if(value == -FLT_MAX) sprintf(but->drawstr, "%s-FLT_MAX", but->str);
+ else if(but->a2) { /* amount of digits defined */
+ if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);
+ else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value);
+ else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value);
+ else sprintf(but->drawstr, "%s%.4f", but->str, value);
+ }
+ else {
+ if(but->max<10.001) sprintf(but->drawstr, "%s%.3f", but->str, value);
+ else sprintf(but->drawstr, "%s%.2f", but->str, value);
+ }
+ }
+ else {
+ sprintf(but->drawstr, "%s%d", but->str, (int)value);
+ }
+ break;
+
+ case LABEL:
+ if(ui_is_but_float(but)) {
+ value= ui_get_but_val(but);
+ if(but->a2) { /* amount of digits defined */
+ if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);
+ else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value);
+ else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value);
+ else sprintf(but->drawstr, "%s%.4f", but->str, value);
+ }
+ else {
+ sprintf(but->drawstr, "%s%.2f", but->str, value);
+ }
+ }
+ else strcpy(but->drawstr, but->str);
+
+ break;
+
+ case IDPOIN:
+ id= *(but->idpoin_idpp);
+ strcpy(but->drawstr, but->str);
+ if(id) strcat(but->drawstr, id->name+2);
+ break;
+
+ case TEX:
+ if(!but->editstr) {
+ char str[UI_MAX_DRAW_STR];
+
+ ui_get_but_string(but, str, UI_MAX_DRAW_STR-strlen(but->str));
+
+ strcpy(but->drawstr, but->str);
+ strcat(but->drawstr, str);
+ }
+ break;
+
+ case KEYEVT:
+ strcpy(but->drawstr, but->str);
+ if (but->flag & UI_SELECT) {
+ strcat(but->drawstr, "Press a key");
+ } else {
+ /* XXX 2.50 function not supported */
+ /* strcat(but->drawstr, key_event_to_string((short) ui_get_but_val(but))); */
+ }
+ break;
+
+ case BUT_TOGDUAL:
+ /* trying to get the dual-icon to left of text... not very nice */
+ if(but->str[0]) {
+ strcpy(but->drawstr, " ");
+ strcpy(but->drawstr+2, but->str);
+ }
+ break;
+ default:
+ strcpy(but->drawstr, but->str);
+
+ }
+
+ /* if we are doing text editing, this will override the drawstr */
+ if(but->editstr) {
+ strcpy(but->drawstr, but->str);
+ strcat(but->drawstr, but->editstr);
+ }
+
+ if(but->drawstr[0]) {
+ but->strwidth= but->aspect*UI_GetStringWidth(but->font, but->drawstr, transopts);
+ // here should be check for less space for icon offsets...
+ if(but->type==MENU) okwidth -= 15;
+ }
+ else
+ but->strwidth= 0;
+
+ /* automatic width */
+ if(but->x2==0.0f && but->x1 > 0.0f) {
+ but->x2= (but->x1+but->strwidth+6);
+ }
+
+ if(but->strwidth==0) but->drawstr[0]= 0;
+ else if(but->type==BUTM || but->type==BLOCK); // no clip string, uiTextBoundsBlock is used (hack!)
+ else {
+
+ /* calc but->ofs, to draw the string shorter if too long */
+ but->ofs= 0;
+
+ while(but->strwidth > (int)okwidth ) {
+
+ if ELEM3(but->type, NUM, NUMABS, TEX) { // only these cut off left
+ but->ofs++;
+ but->strwidth= but->aspect*UI_GetStringWidth(but->font, but->drawstr+but->ofs, transopts);
+
+ /* textbut exception */
+ if(but->editstr && but->pos != -1) {
+ pos= but->pos+strlen(but->str);
+ if(pos-1 < but->ofs) {
+ pos= but->ofs-pos+1;
+ but->ofs -= pos;
+ if(but->ofs<0) {
+ but->ofs= 0;
+ pos--;
+ }
+ but->drawstr[ strlen(but->drawstr)-pos ]= 0;
+ }
+ }
+ }
+ else {
+ but->drawstr[ strlen(but->drawstr)-1 ]= 0;
+ but->strwidth= but->aspect*UI_GetStringWidth(but->font, but->drawstr, transopts);
+ }
+
+ if(but->strwidth < 10) break;
+ }
+ }
+}
+
+static int ui_auto_themecol(uiBut *but)
+{
+
+ switch(but->type) {
+ case BUT:
+ return TH_BUT_ACTION;
+ case ROW:
+ case TOG:
+ case TOG3:
+ case TOGR:
+ case TOGN:
+ case BUT_TOGDUAL:
+ return TH_BUT_SETTING;
+ case SLI:
+ case NUM:
+ case NUMSLI:
+ case NUMABS:
+ case HSVSLI:
+ return TH_BUT_NUM;
+ case TEX:
+ return TH_BUT_TEXTFIELD;
+ case PULLDOWN:
+ case BLOCK:
+ case MENU:
+ case BUTM:
+ // (weak!) detect if it is a blockloop
+ if(but->block->dt == UI_EMBOSSP) return TH_MENU_ITEM;
+ return TH_BUT_POPUP;
+ case ROUNDBOX:
+ return TH_PANEL;
+ default:
+ return TH_BUT_NEUTRAL;
+ }
+}
+
+void uiBlockBeginAlign(uiBlock *block)
+{
+ /* if other align was active, end it */
+ if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
+
+ block->flag |= UI_BUT_ALIGN_DOWN;
+ /* buttons declared after this call will this align flag */
+}
+
+static int buts_are_horiz(uiBut *but1, uiBut *but2)
+{
+ float dx, dy;
+
+ dx= fabs( but1->x2 - but2->x1);
+ dy= fabs( but1->y1 - but2->y2);
+
+ if(dx > dy) return 0;
+ return 1;
+}
+
+void uiBlockEndAlign(uiBlock *block)
+{
+ uiBut *prev, *but=NULL, *next;
+ int flag= 0, cols=0, rows=0;
+ int theme= UI_GetThemeValue(TH_BUT_DRAWTYPE);
+
+ if ( !(ELEM3(theme, TH_MINIMAL, TH_SHADED, TH_ROUNDED)) ) {
+ block->flag &= ~UI_BUT_ALIGN; // all 4 flags
+ return;
+ }
+
+ /* auto align:
+ - go back to first button of align start (ALIGN_DOWN)
+ - compare triples, and define flags
+ */
+ prev= block->buttons.last;
+ while(prev) {
+ if( (prev->flag & UI_BUT_ALIGN_DOWN)) but= prev;
+ else break;
+
+ if(but && but->next) {
+ if(buts_are_horiz(but, but->next)) cols++;
+ else rows++;
+ }
+
+ prev= prev->prev;
+ }
+ if(but==NULL) return;
+
+ /* rows==0: 1 row, cols==0: 1 collumn */
+
+ /* note; how it uses 'flag' in loop below (either set it, or OR it) is confusing */
+ prev= NULL;
+ while(but) {
+ next= but->next;
+
+ /* clear old flag */
+ but->flag &= ~UI_BUT_ALIGN_DOWN;
+
+ if(flag==0) { /* first case */
+ if(next) {
+ if(buts_are_horiz(but, next)) {
+ if(rows==0)
+ flag= UI_BUT_ALIGN_RIGHT;
+ else
+ flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT;
+ }
+ else {
+ flag= UI_BUT_ALIGN_DOWN;
+ }
+ }
+ }
+ else if(next==NULL) { /* last case */
+ if(prev) {
+ if(buts_are_horiz(prev, but)) {
+ if(rows==0)
+ flag= UI_BUT_ALIGN_LEFT;
+ else
+ flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT;
+ }
+ else flag= UI_BUT_ALIGN_TOP;
+ }
+ }
+ else if(buts_are_horiz(but, next)) {
+ /* check if this is already second row */
+ if( prev && buts_are_horiz(prev, but)==0) {
+ flag |= UI_BUT_ALIGN_TOP;
+ /* exception case: bottom row */
+ if(rows>0) {
+ uiBut *bt= but;
+ while(bt) {
+ if(bt->next && buts_are_horiz(bt, bt->next)==0 ) break;
+ bt= bt->next;
+ }
+ if(bt==0) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT;
+ }
+ }
+ else flag |= UI_BUT_ALIGN_LEFT;
+ }
+ else {
+ if(cols==0) {
+ flag |= UI_BUT_ALIGN_TOP;
+ }
+ else { /* next button switches to new row */
+ if( (flag & UI_BUT_ALIGN_TOP)==0) { /* stil top row */
+ if(prev)
+ flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT;
+ else
+ flag |= UI_BUT_ALIGN_DOWN;
+ }
+ else
+ flag |= UI_BUT_ALIGN_TOP;
+ }
+ }
+
+ but->flag |= flag;
+
+ /* merge coordinates */
+ if(prev) {
+ // simple cases
+ if(rows==0) {
+ but->x1= (prev->x2+but->x1)/2.0;
+ prev->x2= but->x1;
+ }
+ else if(cols==0) {
+ but->y2= (prev->y1+but->y2)/2.0;
+ prev->y1= but->y2;
+ }
+ else {
+ if(buts_are_horiz(prev, but)) {
+ but->x1= (prev->x2+but->x1)/2.0;
+ prev->x2= but->x1;
+ /* copy height too */
+ but->y2= prev->y2;
+ }
+ else if(prev->prev && buts_are_horiz(prev->prev, prev)==0) {
+ /* the previous button is a single one in its row */
+ but->y2= (prev->y1+but->y2)/2.0;
+ prev->y1= but->y2;
+ }
+ else {
+ /* the previous button is not a single one in its row */
+ but->y2= prev->y1;
+ }
+ }
+ }
+
+ prev= but;
+ but= next;
+ }
+
+ block->flag &= ~UI_BUT_ALIGN; // all 4 flags
+}
+
+#if 0
+static void uiBlockEndAligno(uiBlock *block)
+{
+ uiBut *but;
+
+ /* correct last defined button */
+ but= block->buttons.last;
+ if(but) {
+ /* vertical align case */
+ if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_DOWN) ) {
+ but->flag &= ~UI_BUT_ALIGN_DOWN;
+ }
+ /* horizontal align case */
+ if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT) ) {
+ but->flag &= ~UI_BUT_ALIGN_RIGHT;
+ }
+ /* else do nothing, manually provided flags */
+ }
+ block->flag &= ~UI_BUT_ALIGN; // all 4 flags
+}
+#endif
+
+/*
+ui_def_but is the function that draws many button types
+
+for float buttons:
+ "a1" Click Step (how much to change the value each click)
+ "a2" Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4,
+ all greater values will be clamped to 4.
+
+*/
+static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ uiBut *but;
+ short slen;
+
+ if(type & BUTPOIN) { /* a pointer is required */
+ if(poin==NULL) {
+ /* if pointer is zero, button is removed and not drawn */
+ UI_ThemeColor(block->themecol);
+ glRects(x1, y1, x1+x2, y1+y2);
+ return NULL;
+ }
+ }
+
+ but= MEM_callocN(sizeof(uiBut), "uiBut");
+
+ but->type= type & BUTTYPE;
+ but->pointype= type & BUTPOIN;
+ but->bit= type & BIT;
+ but->bitnr= type & 31;
+ but->icon = 0;
+
+ BLI_addtail(&block->buttons, but);
+
+ but->retval= retval;
+ if( strlen(str)>=UI_MAX_NAME_STR-1 ) {
+ but->str= MEM_callocN( strlen(str)+2, "uiDefBut");
+ strcpy(but->str, str);
+ }
+ else {
+ but->str= but->strdata;
+ strcpy(but->str, str);
+ }
+ but->x1= x1;
+ but->y1= y1;
+ if(block->autofill) {
+ but->x2= x2;
+ but->y2= y2;
+ }
+ else {
+ but->x2= (x1+x2);
+ but->y2= (y1+y2);
+ }
+ but->poin= poin;
+ but->min= min;
+ but->max= max;
+ but->a1= a1;
+ but->a2= a2;
+ but->tip= tip;
+
+ but->font= block->curfont;
+
+ but->lock= block->lock;
+ but->lockstr= block->lockstr;
+
+ but->aspect= block->aspect;
+ but->win= block->win;
+ but->block= block; // pointer back, used for frontbuffer status, and picker
+
+ if(block->themecol==TH_AUTO) but->themecol= ui_auto_themecol(but);
+ else but->themecol= block->themecol;
+
+ if(but->type != BUTM) {
+ but->func= block->func;
+ but->func_arg1= block->func_arg1;
+ but->func_arg2= block->func_arg2;
+ }
+
+ ui_set_embossfunc(but, block->dt);
+
+ but->pos= -1; /* cursor invisible */
+
+ if(ELEM(but->type, NUM, NUMABS)) { /* add a space to name */
+ slen= strlen(but->str);
+ if(slen>0 && slen<UI_MAX_NAME_STR-2) {
+ if(but->str[slen-1]!=' ') {
+ but->str[slen]= ' ';
+ but->str[slen+1]= 0;
+ }
+ }
+ }
+
+ if(but->type==HSVCUBE) { /* hsv buttons temp storage */
+ float rgb[3];
+ ui_get_but_vectorf(but, rgb);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2);
+ }
+
+ if ELEM8(but->type, HSVSLI , NUMSLI, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM) {
+ but->flag |= UI_TEXT_LEFT;
+ }
+
+ if(but->type==BUT_TOGDUAL) {
+ but->flag |= UI_ICON_LEFT;
+ }
+
+ if(but->type==ROUNDBOX)
+ but->flag |= UI_NO_HILITE;
+
+ but->flag |= (block->flag & UI_BUT_ALIGN);
+ if(block->flag & UI_BLOCK_NO_HILITE)
+ but->flag |= UI_NO_HILITE;
+
+ return but;
+}
+
+uiBut *uiDefBut(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+
+ ui_check_but(but);
+
+ return but;
+}
+
+ /* if _x_ is a power of two (only one bit) return the power,
+ * otherwise return -1.
+ * (1<<findBitIndex(x))==x for powers of two.
+ */
+static int findBitIndex(unsigned int x) {
+ if (!x || (x&(x-1))!=0) { /* x&(x-1) strips lowest bit */
+ return -1;
+ } else {
+ int idx= 0;
+
+ if (x&0xFFFF0000) idx+=16, x>>=16;
+ if (x&0xFF00) idx+=8, x>>=8;
+ if (x&0xF0) idx+=4, x>>=4;
+ if (x&0xC) idx+=2, x>>=2;
+ if (x&0x2) idx+=1;
+
+ return idx;
+ }
+}
+
+/* autocomplete helper functions */
+struct AutoComplete {
+ int maxlen;
+ char *truncate;
+ char *startname;
+};
+
+AutoComplete *autocomplete_begin(char *startname, int maxlen)
+{
+ AutoComplete *autocpl;
+
+ autocpl= MEM_callocN(sizeof(AutoComplete), "AutoComplete");
+ autocpl->maxlen= maxlen;
+ autocpl->truncate= MEM_callocN(sizeof(char)*maxlen, "AutoCompleteTruncate");
+ autocpl->startname= startname;
+
+ return autocpl;
+}
+
+void autocomplete_do_name(AutoComplete *autocpl, const char *name)
+{
+ char *truncate= autocpl->truncate;
+ char *startname= autocpl->startname;
+ int a;
+
+ for(a=0; a<autocpl->maxlen-1; a++) {
+ if(startname[a]==0 || startname[a]!=name[a])
+ break;
+ }
+ /* found a match */
+ if(startname[a]==0) {
+ /* first match */
+ if(truncate[0]==0)
+ BLI_strncpy(truncate, name, autocpl->maxlen);
+ else {
+ /* remove from truncate what is not in bone->name */
+ for(a=0; a<autocpl->maxlen-1; a++) {
+ if(truncate[a]!=name[a])
+ truncate[a]= 0;
+ }
+ }
+ }
+}
+
+void autocomplete_end(AutoComplete *autocpl, char *autoname)
+{
+ if(autocpl->truncate[0])
+ BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen);
+ else
+ BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen);
+
+ MEM_freeN(autocpl->truncate);
+ MEM_freeN(autocpl);
+}
+
+/* autocomplete callback for ID buttons */
+static void autocomplete_id(bContext *C, char *str, void *arg_v)
+{
+ /* int blocktype= (intptr_t)arg_v; */
+ ListBase *listb= NULL /* XXX 2.50 needs context, wich_libbase(G.main, blocktype) */;
+
+ if(listb==NULL) return;
+
+ /* search if str matches the beginning of an ID struct */
+ if(str[0]) {
+ AutoComplete *autocpl= autocomplete_begin(str, 22);
+ ID *id;
+
+ for(id= listb->first; id; id= id->next)
+ autocomplete_do_name(autocpl, id->name+2);
+
+ autocomplete_end(autocpl, str);
+ }
+}
+
+static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ int bitIdx= findBitIndex(bit);
+ if (bitIdx==-1) {
+ return NULL;
+ } else {
+ return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+}
+uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+
+uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+
+ but->icon= (BIFIconID) icon;
+ but->flag|= UI_HAS_ICON;
+
+ ui_check_but(but);
+
+ return but;
+}
+static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ int bitIdx= findBitIndex(bit);
+ if (bitIdx==-1) {
+ return NULL;
+ } else {
+ return uiDefIconBut(block, type|BIT|bitIdx, retval, icon, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+}
+
+uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+
+/* Button containing both string label and icon */
+uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+
+ but->icon= (BIFIconID) icon;
+ but->flag|= UI_HAS_ICON;
+
+ but->flag|= UI_ICON_LEFT;
+
+ ui_check_but(but);
+
+ return but;
+}
+static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+{
+ int bitIdx= findBitIndex(bit);
+ if (bitIdx==-1) {
+ return NULL;
+ } else {
+ return uiDefIconTextBut(block, type|BIT|bitIdx, retval, icon, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
+ }
+}
+
+uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+{
+ return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
+}
+
+uiBut *uiDefRNABut(uiBlock *block, int retval, PointerRNA *ptr, PropertyRNA *prop, int index, short x1, short y1, short x2, short y2)
+{
+ uiBut *but;
+
+ switch(RNA_property_type(ptr, prop)) {
+ case PROP_BOOLEAN: {
+ int value, length;
+
+ length= RNA_property_array_length(ptr, prop);
+
+ if(length)
+ value= RNA_property_boolean_get_array(ptr, prop, index);
+ else
+ value= RNA_property_boolean_get(ptr, prop);
+
+ but= ui_def_but(block, TOG, 0, (value)? "True": "False", x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
+ break;
+ }
+ case PROP_INT: {
+ int softmin, softmax, step;
+
+ RNA_property_int_ui_range(ptr, prop, &softmin, &softmax, &step);
+ but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, 0, (char*)RNA_property_ui_description(ptr, prop));
+ break;
+ }
+ case PROP_FLOAT: {
+ float softmin, softmax, step, precision;
+
+ RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision);
+ but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, precision, (char*)RNA_property_ui_description(ptr, prop));
+ break;
+ }
+ case PROP_ENUM: {
+ const EnumPropertyItem *item;
+ DynStr *dynstr;
+ char *menu;
+ int i, totitem;
+
+ RNA_property_enum_items(ptr, prop, &item, &totitem);
+
+ dynstr= BLI_dynstr_new();
+ BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(ptr, prop));
+ for(i=0; i<totitem; i++)
+ BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value);
+ menu= BLI_dynstr_get_cstring(dynstr);
+ BLI_dynstr_free(dynstr);
+
+ but= ui_def_but(block, MENU, 0, menu, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
+ MEM_freeN(menu);
+ break;
+ }
+ case PROP_STRING: {
+ int maxlength;
+
+ maxlength= RNA_property_string_maxlength(ptr, prop);
+ if(maxlength == 0)
+ /* interface code should ideally support unlimited length */
+ maxlength= UI_MAX_DRAW_STR;
+
+ but= ui_def_but(block, TEX, 0, "", x1, y1, x2, y2, NULL, 0, maxlength, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
+ break;
+ }
+ case PROP_POINTER: {
+ PointerRNA pptr;
+ PropertyRNA *nameprop;
+ char name[256]= "", *nameptr= name;
+
+ RNA_property_pointer_get(ptr, prop, &pptr);
+
+ if(pptr.data) {
+ nameprop= RNA_struct_name_property(&pptr);
+ if(pptr.type && nameprop)
+ nameptr= RNA_property_string_get_alloc(&pptr, nameprop, name, sizeof(name));
+ else
+ strcpy(nameptr, "->");
+ }
+
+ but= ui_def_but(block, BUT, 0, nameptr, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
+ but->flag |= UI_TEXT_LEFT;
+
+ if(nameptr != name)
+ MEM_freeN(nameptr);
+
+ break;
+ }
+ default:
+ but= NULL;
+ break;
+ }
+
+ if(but) {
+ but->rnapoin= *ptr;
+ but->rnaprop= prop;
+ but->rnaindex= index;
+
+ ui_check_but(but);
+ }
+
+ return but;
+}
+
+/* END Button containing both string label and icon */
+
+void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, int flag)
+{
+ block->minx= minx;
+ block->maxx= minx+sizex;
+ block->miny= miny;
+ block->maxy= miny+sizey;
+
+ block->autofill= flag; /* also check for if it has to be done */
+
+}
+
+void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to)
+{
+ uiLink *link;
+
+ link= but->link= MEM_callocN(sizeof(uiLink), "new uilink");
+
+ link->poin= poin;
+ link->ppoin= ppoin;
+ link->totlink= tot;
+ link->fromcode= from;
+ link->tocode= to;
+}
+
+/* cruft to make uiBlock and uiBut private */
+
+int uiBlocksGetYMin(ListBase *lb)
+{
+ uiBlock *block;
+ int min= 0;
+
+ for (block= lb->first; block; block= block->next)
+ if (block==lb->first || block->miny<min)
+ min= block->miny;
+
+ return min;
+}
+
+int uiBlockGetCol(uiBlock *block)
+{
+ return block->themecol;
+}
+void uiBlockSetCol(uiBlock *block, int col)
+{
+ block->themecol= col;
+}
+void uiBlockSetEmboss(uiBlock *block, int emboss)
+{
+ block->dt= emboss;
+}
+void uiBlockSetDirection(uiBlock *block, int direction)
+{
+ block->direction= direction;
+}
+
+/* this call escapes if there's alignment flags */
+void uiBlockFlipOrder(uiBlock *block)
+{
+ ListBase lb;
+ uiBut *but, *next;
+ float centy, miny=10000, maxy= -10000;
+
+// if(U.uiflag & USER_PLAINMENUS)
+// return;
+
+ for(but= block->buttons.first; but; but= but->next) {
+ if(but->flag & UI_BUT_ALIGN) return;
+ if(but->y1 < miny) miny= but->y1;
+ if(but->y2 > maxy) maxy= but->y2;
+ }
+ /* mirror trick */
+ centy= (miny+maxy)/2.0;
+ for(but= block->buttons.first; but; but= but->next) {
+ but->y1 = centy-(but->y1-centy);
+ but->y2 = centy-(but->y2-centy);
+ SWAP(float, but->y1, but->y2);
+ }
+
+ /* also flip order in block itself, for example for arrowkey */
+ lb.first= lb.last= NULL;
+ but= block->buttons.first;
+ while(but) {
+ next= but->next;
+ BLI_remlink(&block->buttons, but);
+ BLI_addtail(&lb, but);
+ but= next;
+ }
+ block->buttons= lb;
+}
+
+
+void uiBlockSetFlag(uiBlock *block, int flag)
+{
+ block->flag= flag;
+}
+void uiBlockSetXOfs(uiBlock *block, int xofs)
+{
+ block->xofs= xofs;
+}
+void* uiBlockGetCurFont(uiBlock *block)
+{
+ return block->curfont;
+}
+
+void uiButSetFlag(uiBut *but, int flag)
+{
+ but->flag|= flag;
+}
+void uiButClearFlag(uiBut *but, int flag)
+{
+ but->flag&= ~flag;
+}
+
+int uiButGetRetVal(uiBut *but)
+{
+ return but->retval;
+}
+
+void uiBlockSetHandleFunc(uiBlock *block, void (*func)(struct bContext *C, void *arg, int event), void *arg)
+{
+ block->handle_func= func;
+ block->handle_func_arg= arg;
+}
+
+void uiBlockSetButmFunc(uiBlock *block, void (*func)(struct bContext *C, void *arg, int but_a2), void *arg)
+{
+ block->butm_func= func;
+ block->butm_func_arg= arg;
+}
+
+void uiBlockSetFunc(uiBlock *block, void (*func)(struct bContext *C, void *arg1, void *arg2), void *arg1, void *arg2)
+{
+ block->func= func;
+ block->func_arg1= arg1;
+ block->func_arg2= arg2;
+}
+
+void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)())
+{
+ block->drawextra= func;
+}
+
+void uiButSetFunc(uiBut *but, void (*func)(struct bContext *C, void *arg1, void *arg2), void *arg1, void *arg2)
+{
+ but->func= func;
+ but->func_arg1= arg1;
+ but->func_arg2= arg2;
+}
+
+void uiButSetCompleteFunc(uiBut *but, void (*func)(struct bContext *C, char *str, void *arg), void *arg)
+{
+ but->autocomplete_func= func;
+ but->autofunc_arg= arg;
+}
+
+uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, short x1, short y1, short x2, short y2, void *idpp, char *tip)
+{
+ uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
+ but->idpoin_func= func;
+ but->idpoin_idpp= (ID**) idpp;
+ ui_check_but(but);
+
+ if(blocktype)
+ uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype);
+
+ return but;
+}
+
+uiBut *uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip)
+{
+ uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ but->block_func= func;
+ ui_check_but(but);
+ return but;
+}
+
+uiBut *uiDefPulldownBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip)
+{
+ uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+ but->block_func= func;
+ ui_check_but(but);
+ return but;
+}
+
+/* Block button containing both string label and icon */
+uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip)
+{
+ uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+
+ but->icon= (BIFIconID) icon;
+ but->flag|= UI_HAS_ICON;
+
+ but->flag|= UI_ICON_LEFT;
+ but->flag|= UI_ICON_RIGHT;
+
+ but->block_func= func;
+ ui_check_but(but);
+
+ return but;
+}
+
+/* Block button containing icon */
+uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip)
+{
+ uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
+
+ but->icon= (BIFIconID) icon;
+ but->flag|= UI_HAS_ICON;
+
+ but->flag|= UI_ICON_LEFT;
+ but->flag|= UI_ICON_RIGHT;
+
+ but->block_func= func;
+ ui_check_but(but);
+
+ return but;
+}
+
+void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip)
+{
+ uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip);
+ ui_check_but(but);
+}
+
+/* Program Init/Exit */
+
+void UI_init(void)
+{
+ uiDefFont(UI_HELVB,
+ BMF_GetFont(BMF_kHelveticaBold14),
+ BMF_GetFont(BMF_kHelveticaBold12),
+ BMF_GetFont(BMF_kHelveticaBold10),
+ BMF_GetFont(BMF_kHelveticaBold8));
+ uiDefFont(UI_HELV,
+ BMF_GetFont(BMF_kHelvetica12),
+ BMF_GetFont(BMF_kHelvetica12),
+ BMF_GetFont(BMF_kHelvetica10),
+ BMF_GetFont(BMF_kHelveticaBold8));
+
+ ui_resources_init();
+}
+
+void UI_init_userdef()
+{
+ ui_text_init_userdef();
+ ui_theme_init_userdef();
+}
+
+void UI_exit(void)
+{
+ ui_resources_free();
+}
+
diff --git a/source/blender/include/interface.h b/source/blender/editors/interface/interface.h
index f488ddb1b28..fac72b22089 100644
--- a/source/blender/include/interface.h
+++ b/source/blender/editors/interface/interface.h
@@ -1,5 +1,5 @@
/**
- * $Id$
+ * $Id: interface.h 14444 2008-04-16 22:40:48Z hos $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -30,7 +30,13 @@
#ifndef INTERFACE_H
#define INTERFACE_H
-#include "BIF_resources.h"
+#include "UI_resources.h"
+#include "RNA_types.h"
+
+struct uiHandleButtonData;
+struct wmWindow;
+struct ARegion;
+struct bContext;
/* general defines */
@@ -49,7 +55,6 @@
#define UI_HAS_ICON 8
/* warn: rest of uiBut->flag in BIF_interface.c */
-
/* internal panel drawing defines */
#define PNL_GRID 4
#define PNL_DIST 8
@@ -120,14 +125,14 @@ struct uiBut {
float a1, a2, hsv[3]; // hsv is temp memory for hsv buttons
float aspect;
- void (*func)(void *, void *);
+ void (*func)(struct bContext*, void *, void *);
void *func_arg1;
void *func_arg2;
void (*embossfunc)(int , int , float, float, float, float, float, int);
void (*sliderfunc)(int , float, float, float, float, float, float, int);
- void (*autocomplete_func)(char *, void *);
+ void (*autocomplete_func)(struct bContext*, char *, void *);
void *autofunc_arg;
uiLink *link;
@@ -149,9 +154,19 @@ struct uiBut {
/* BLOCK data */
uiBlockFuncFP block_func;
- /* BUTM data */
- void (*butm_func)(void *arg, int event);
- void *butm_func_arg;
+ /* RNA */
+ struct PointerRNA rnapoin;
+ struct PropertyRNA *rnaprop;
+ int rnaindex;
+
+ /* activation button data */
+ struct uiHandleButtonData *active;
+
+ char *editstr;
+ double *editval;
+ float *editvec;
+ void *editcoba;
+ void *editcumap;
/* pointer back */
uiBlock *block;
@@ -162,6 +177,7 @@ struct uiBlock {
ListBase buttons;
Panel *panel;
+ uiBlock *oldblock;
char name[UI_MAX_NAME_STR];
@@ -170,12 +186,15 @@ struct uiBlock {
float minx, miny, maxx, maxy;
float aspect;
- void (*butm_func)(void *arg, int event);
- void *butm_func_arg;
-
- void (*func)(void *arg1, void *arg2);
+ void (*func)(struct bContext*, void *arg1, void *arg2);
void *func_arg1;
void *func_arg2;
+
+ void (*butm_func)(struct bContext*, void *arg, int but_a2);
+ void *butm_func_arg;
+
+ void (*handle_func)(struct bContext*, void *arg, int event);
+ void *handle_func_arg;
/* extra draw function for custom blocks */
void (*drawextra)();
@@ -187,32 +206,67 @@ struct uiBlock {
void *curfont;
short autofill, win, winq, direction, dt;
- short needflush, auto_open, in_use, pad; //flush see below
- void *overdraw;
- struct uiBlock *parent; // nested pulldowns
+ short auto_open, in_use, pad;
+ double auto_open_last;
+
+ int lock;
+ char *lockstr;
- float xofs, yofs; // offset to parent button
- rctf parentrct; // for pulldowns, rect the mouse is allowed outside of menu (parent button)
- rctf safety; // pulldowns, to detect outside, can differ per case how it is created
+ float xofs, yofs; // offset to parent button
- rctf flush; // rect to be flushed to frontbuffer
- int handler; // for panels in other windows than buttonswin... just event code
+ rctf safety; // pulldowns, to detect outside, can differ per case how it is created
+ ListBase saferct; // uiSafetyRct list
+
+ uiMenuBlockHandle *handle; // handle
+ int tooltipdisabled; // to avoid tooltip after click
};
+typedef struct uiSafetyRct {
+ struct uiSafetyRct *next, *prev;
+ rctf parent;
+ rctf safety;
+} uiSafetyRct;
+
/* interface.c */
-extern void ui_graphics_to_window(int win, float *x, float *y);
-extern void ui_graphics_to_window_rct(int win, rctf *graph, rcti *winr);
-extern void ui_window_to_graphics(int win, float *x, float *y);
+extern int ui_translate_buttons(void);
+extern int ui_translate_menus(void);
+extern int ui_translate_tooltips(void);
-extern void ui_block_flush_back(uiBlock *block);
-extern void ui_block_set_flush(uiBlock *block, uiBut *but);
+extern void ui_block_to_window_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y);
+extern void ui_block_to_window(const struct ARegion *ar, uiBlock *block, int *x, int *y);
+extern void ui_block_to_window_rct(const struct ARegion *ar, uiBlock *block, rctf *graph, rcti *winr);
+extern void ui_window_to_block_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y);
+extern void ui_window_to_block(const struct ARegion *ar, uiBlock *block, int *x, int *y);
+extern void ui_window_to_region(const ARegion *ar, int *x, int *y);
-extern void ui_check_but(uiBut *but);
extern double ui_get_but_val(uiBut *but);
+extern void ui_set_but_val(uiBut *but, double value);
+extern void ui_set_but_hsv(uiBut *but);
extern void ui_get_but_vectorf(uiBut *but, float *vec);
extern void ui_set_but_vectorf(uiBut *but, float *vec);
+extern void ui_get_but_string(uiBut *but, char *str, int maxlen);
+extern void ui_set_but_string(uiBut *but, const char *str);
+
+extern void ui_check_but(uiBut *but);
extern void ui_autofill(uiBlock *block);
+extern int ui_is_but_float(uiBut *but);
+extern void ui_update_block_buts_hsv(uiBlock *block, float *hsv);
+
+/* interface_regions.c */
+uiBlock *ui_block_func_MENU(struct bContext *C, uiMenuBlockHandle *handle, void *arg_but);
+uiBlock *ui_block_func_ICONROW(struct bContext *C, uiMenuBlockHandle *handle, void *arg_but);
+uiBlock *ui_block_func_ICONTEXTROW(struct bContext *C, uiMenuBlockHandle *handle, void *arg_but);
+uiBlock *ui_block_func_COL(struct bContext *C, uiMenuBlockHandle *handle, void *arg_but);
+
+struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but);
+void ui_tooltip_free(struct bContext *C, struct ARegion *ar);
+
+uiMenuBlockHandle *ui_menu_block_create(struct bContext *C, struct ARegion *butregion, uiBut *but,
+ uiBlockFuncFP block_func, void *arg);
+void ui_menu_block_free(struct bContext *C, uiMenuBlockHandle *handle);
+
+void ui_set_name_menu(uiBut *but, int value);
/* interface_panel.c */
extern void ui_draw_panel(uiBlock *block);
@@ -220,6 +274,7 @@ extern void ui_do_panel(uiBlock *block, uiEvent *uevent);
extern void ui_scale_panel(uiBlock *block);
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
+extern void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
/* interface_draw.c */
extern void ui_set_embossfunc(uiBut *but, int drawtype);
@@ -229,5 +284,8 @@ extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
extern void ui_draw_anti_x(float x1, float y1, float x2, float y2);
extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
+/* interface_handlers.c */
+extern void ui_button_active_cancel(const struct bContext *C, uiBut *but);
+
#endif
diff --git a/source/blender/src/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 78e74442342..613c0b1c3b2 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1,6 +1,5 @@
-
/**
- * $Id$
+ * $Id: interface_draw.c 15733 2008-07-24 09:23:13Z aligorith $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -28,77 +27,393 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/*
- a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt
-
- */
-
-
#include <math.h>
-#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
#include "DNA_color_types.h"
-#include "DNA_key_types.h"
-#include "DNA_packedFile_types.h"
+#include "DNA_listBase.h"
+#include "DNA_object_types.h"
#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_vfont_types.h"
-#include "BKE_blender.h"
+#include "BLI_arithb.h"
+
#include "BKE_colortools.h"
-#include "BKE_font.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_utildefines.h"
#include "BKE_texture.h"
-
-#include "datatoc.h" /* std font */
+#include "BKE_utildefines.h"
#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_butspace.h"
-#include "BIF_language.h"
-#include "BSE_view.h"
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
+#include "UI_text.h"
+#include "BMF_Api.h"
#ifdef INTERNATIONAL
#include "FTF_Api.h"
#endif
-#include "mydevice.h"
#include "interface.h"
-#include "blendef.h"
-// globals
-extern float UIwinmat[4][4];
+#define UI_RB_ALPHA 16
+static int roundboxtype= 15;
+
+void uiSetRoundBox(int type)
+{
+ /* Not sure the roundbox function is the best place to change this
+ * if this is undone, its not that big a deal, only makes curves edges
+ * square for the */
+ if (UI_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
+ roundboxtype= 0;
+ else
+ roundboxtype= type;
+
+ /* flags to set which corners will become rounded:
+
+ 1------2
+ | |
+ 8------4
+ */
+
+}
+
+void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad)
+{
+ float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ int a;
+
+ /* mult */
+ for(a=0; a<7; a++) {
+ vec[a][0]*= rad; vec[a][1]*= rad;
+ }
+
+ glBegin(mode);
+
+ /* start with corner right-bottom */
+ if(roundboxtype & 4) {
+ glVertex2f( maxx-rad, miny);
+ for(a=0; a<7; a++) {
+ glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]);
+ }
+ glVertex2f( maxx, miny+rad);
+ }
+ else glVertex2f( maxx, miny);
+
+ /* corner right-top */
+ if(roundboxtype & 2) {
+ glVertex2f( maxx, maxy-rad);
+ for(a=0; a<7; a++) {
+ glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]);
+ }
+ glVertex2f( maxx-rad, maxy);
+ }
+ else glVertex2f( maxx, maxy);
+
+ /* corner left-top */
+ if(roundboxtype & 1) {
+ glVertex2f( minx+rad, maxy);
+ for(a=0; a<7; a++) {
+ glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
+ }
+ glVertex2f( minx, maxy-rad);
+ }
+ else glVertex2f( minx, maxy);
+
+ /* corner left-bottom */
+ if(roundboxtype & 8) {
+ glVertex2f( minx, miny+rad);
+ for(a=0; a<7; a++) {
+ glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]);
+ }
+ glVertex2f( minx+rad, miny);
+ }
+ else glVertex2f( minx, miny);
+
+ glEnd();
+}
+
+static void round_box_shade_col(float *col1, float *col2, float fac)
+{
+ float col[3];
+
+ col[0]= (fac*col1[0] + (1.0-fac)*col2[0]);
+ col[1]= (fac*col1[1] + (1.0-fac)*col2[1]);
+ col[2]= (fac*col1[2] + (1.0-fac)*col2[2]);
+
+ glColor3fv(col);
+}
+
+/* linear horizontal shade within button or in outline */
+void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
+{
+ float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ float div= maxy-miny;
+ float coltop[3], coldown[3], color[4];
+ int a;
+
+ /* mult */
+ for(a=0; a<7; a++) {
+ vec[a][0]*= rad; vec[a][1]*= rad;
+ }
+ /* get current color, needs to be outside of glBegin/End */
+ glGetFloatv(GL_CURRENT_COLOR, color);
+
+ /* 'shade' defines strength of shading */
+ coltop[0]= color[0]+shadetop; if(coltop[0]>1.0) coltop[0]= 1.0;
+ coltop[1]= color[1]+shadetop; if(coltop[1]>1.0) coltop[1]= 1.0;
+ coltop[2]= color[2]+shadetop; if(coltop[2]>1.0) coltop[2]= 1.0;
+ coldown[0]= color[0]+shadedown; if(coldown[0]<0.0) coldown[0]= 0.0;
+ coldown[1]= color[1]+shadedown; if(coldown[1]<0.0) coldown[1]= 0.0;
+ coldown[2]= color[2]+shadedown; if(coldown[2]<0.0) coldown[2]= 0.0;
+
+ if (UI_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glShadeModel(GL_SMOOTH);
+ glBegin(mode);
+ }
+
+ /* start with corner right-bottom */
+ if(roundboxtype & 4) {
+
+ round_box_shade_col(coltop, coldown, 0.0);
+ glVertex2f(maxx-rad, miny);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(coltop, coldown, vec[a][1]/div);
+ glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
+ }
+
+ round_box_shade_col(coltop, coldown, rad/div);
+ glVertex2f(maxx, miny+rad);
+ }
+ else {
+ round_box_shade_col(coltop, coldown, 0.0);
+ glVertex2f(maxx, miny);
+ }
+
+ /* corner right-top */
+ if(roundboxtype & 2) {
+
+ round_box_shade_col(coltop, coldown, (div-rad)/div);
+ glVertex2f( maxx, maxy-rad);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])/div);
+ glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
+ }
+ round_box_shade_col(coltop, coldown, 1.0);
+ glVertex2f(maxx-rad, maxy);
+ }
+ else {
+ round_box_shade_col(coltop, coldown, 1.0);
+ glVertex2f(maxx, maxy);
+ }
+
+ /* corner left-top */
+ if(roundboxtype & 1) {
+
+ round_box_shade_col(coltop, coldown, 1.0);
+ glVertex2f( minx+rad, maxy);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(coltop, coldown, (div-vec[a][1])/div);
+ glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
+ }
+
+ round_box_shade_col(coltop, coldown, (div-rad)/div);
+ glVertex2f(minx, maxy-rad);
+ }
+ else {
+ round_box_shade_col(coltop, coldown, 1.0);
+ glVertex2f(minx, maxy);
+ }
+
+ /* corner left-bottom */
+ if(roundboxtype & 8) {
+
+ round_box_shade_col(coltop, coldown, rad/div);
+ glVertex2f(minx, miny+rad);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(coltop, coldown, (rad-vec[a][1])/div);
+ glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
+ }
+
+ round_box_shade_col(coltop, coldown, 0.0);
+ glVertex2f(minx+rad, miny);
+ }
+ else {
+ round_box_shade_col(coltop, coldown, 0.0);
+ glVertex2f(minx, miny);
+ }
+
+ glEnd();
+ glShadeModel(GL_FLAT);
+}
+
+/* linear vertical shade within button or in outline */
+void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight)
+{
+ float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
+ float div= maxx-minx;
+ float colLeft[3], colRight[3], color[4];
+ int a;
+
+ /* mult */
+ for(a=0; a<7; a++) {
+ vec[a][0]*= rad; vec[a][1]*= rad;
+ }
+ /* get current color, needs to be outside of glBegin/End */
+ glGetFloatv(GL_CURRENT_COLOR, color);
+
+ /* 'shade' defines strength of shading */
+ colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0) colLeft[0]= 1.0;
+ colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0) colLeft[1]= 1.0;
+ colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0) colLeft[2]= 1.0;
+ colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0) colRight[0]= 0.0;
+ colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0) colRight[1]= 0.0;
+ colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0) colRight[2]= 0.0;
+
+ if (UI_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
+ glShadeModel(GL_SMOOTH);
+ glBegin(mode);
+ }
+
+ /* start with corner right-bottom */
+ if(roundboxtype & 4) {
+ round_box_shade_col(colLeft, colRight, 0.0);
+ glVertex2f(maxx-rad, miny);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(colLeft, colRight, vec[a][0]/div);
+ glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
+ }
+
+ round_box_shade_col(colLeft, colRight, rad/div);
+ glVertex2f(maxx, miny+rad);
+ }
+ else {
+ round_box_shade_col(colLeft, colRight, 0.0);
+ glVertex2f(maxx, miny);
+ }
+
+ /* corner right-top */
+ if(roundboxtype & 2) {
+ round_box_shade_col(colLeft, colRight, 0.0);
+ glVertex2f(maxx, maxy-rad);
+
+ for(a=0; a<7; a++) {
+
+ round_box_shade_col(colLeft, colRight, (div-rad-vec[a][0])/div);
+ glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
+ }
+ round_box_shade_col(colLeft, colRight, (div-rad)/div);
+ glVertex2f(maxx-rad, maxy);
+ }
+ else {
+ round_box_shade_col(colLeft, colRight, 0.0);
+ glVertex2f(maxx, maxy);
+ }
+
+ /* corner left-top */
+ if(roundboxtype & 1) {
+ round_box_shade_col(colLeft, colRight, (div-rad)/div);
+ glVertex2f(minx+rad, maxy);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(colLeft, colRight, (div-rad+vec[a][0])/div);
+ glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
+ }
+
+ round_box_shade_col(colLeft, colRight, 1.0);
+ glVertex2f(minx, maxy-rad);
+ }
+ else {
+ round_box_shade_col(colLeft, colRight, 1.0);
+ glVertex2f(minx, maxy);
+ }
+
+ /* corner left-bottom */
+ if(roundboxtype & 8) {
+ round_box_shade_col(colLeft, colRight, 1.0);
+ glVertex2f(minx, miny+rad);
+
+ for(a=0; a<7; a++) {
+ round_box_shade_col(colLeft, colRight, (vec[a][0])/div);
+ glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
+ }
+
+ round_box_shade_col(colLeft, colRight, 1.0);
+ glVertex2f(minx+rad, miny);
+ }
+ else {
+ round_box_shade_col(colLeft, colRight, 1.0);
+ glVertex2f(minx, miny);
+ }
+
+ glEnd();
+ glShadeModel(GL_FLAT);
+}
+
+/* plain fake antialiased unfilled round rectangle */
+void uiRoundRectFakeAA(float minx, float miny, float maxx, float maxy, float rad, float asp)
+{
+ float color[4];
+ float raddiff;
+ int i, passes=4;
+
+ /* get the colour and divide up the alpha */
+ glGetFloatv(GL_CURRENT_COLOR, color);
+ color[3]= 1/(float)passes;
+ glColor4fv(color);
+
+ /* set the 'jitter amount' */
+ raddiff = (1/(float)passes) * asp;
+
+ glEnable( GL_BLEND );
+
+ /* draw lots of lines on top of each other */
+ for (i=passes; i>=(-passes); i--) {
+ gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad+(i*raddiff));
+ }
+
+ glDisable( GL_BLEND );
+}
+
+
+void uiTriangleFakeAA(float x1, float y1, float x2, float y2, float x3, float y3)
+{
+ float color[4];
+ float jitter;
+ int i, passes=4;
+
+ /* get the colour and divide up the alpha */
+ glGetFloatv(GL_CURRENT_COLOR, color);
+ color[3]= 1/(float)passes;
+ glColor4fv(color);
+
+ /* set the 'jitter amount' */
+ jitter = 1/(float)passes;
+
+ glEnable( GL_BLEND );
+
+ /* draw lots of lines on top of each other */
+ for (i=passes; i>=(-passes); i--) {
+ glBegin(GL_TRIANGLES);
+
+ /* 'point' first, then two base vertices */
+ glVertex2f(x1+(i*jitter), y1+(i*jitter));
+ glVertex2f(x2, y2+(i*jitter));
+ glVertex2f(x3, y3+(i*jitter));
+ glEnd();
+ }
+
+ glDisable( GL_BLEND );
+}
/* ************** safe rasterpos for pixmap alignment with pixels ************* */
@@ -126,8 +441,8 @@ void ui_rasterpos_safe(float x, float y, float aspect)
if(doit) glRasterPos2f(x, y);
- BIF_RasterPos(x, y);
- BIF_SetScale(aspect);
+ UI_RasterPos(x, y);
+ UI_SetScale(aspect);
}
/* ************** generic embossed rect, for window sliders etc ************* */
@@ -216,49 +531,43 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon, int blend)
else if(but->flag & UI_ACTIVE);
else blend= -60;
}
- BIF_icon_draw_aspect_blended(xs, ys, icon, aspect, blend);
+ UI_icon_draw_aspect_blended(xs, ys, icon, aspect, blend);
glDisable(GL_BLEND);
-
}
/* ************** DEFAULT THEME, SHADED BUTTONS ************* */
-#define M_WHITE BIF_ThemeColorShade(colorid, 80)
+#define M_WHITE UI_ThemeColorShade(colorid, 80)
-#define M_ACT_LIGHT BIF_ThemeColorShade(colorid, 55)
-#define M_LIGHT BIF_ThemeColorShade(colorid, 45)
-#define M_HILITE BIF_ThemeColorShade(colorid, 25)
-#define M_LMEDIUM BIF_ThemeColorShade(colorid, 10)
-#define M_MEDIUM BIF_ThemeColor(colorid)
-#define M_LGREY BIF_ThemeColorShade(colorid, -20)
-#define M_GREY BIF_ThemeColorShade(colorid, -45)
-#define M_DARK BIF_ThemeColorShade(colorid, -80)
+#define M_ACT_LIGHT UI_ThemeColorShade(colorid, 55)
+#define M_LIGHT UI_ThemeColorShade(colorid, 45)
+#define M_HILITE UI_ThemeColorShade(colorid, 25)
+#define M_LMEDIUM UI_ThemeColorShade(colorid, 10)
+#define M_MEDIUM UI_ThemeColor(colorid)
+#define M_LGREY UI_ThemeColorShade(colorid, -20)
+#define M_GREY UI_ThemeColorShade(colorid, -45)
+#define M_DARK UI_ThemeColorShade(colorid, -80)
-#define M_NUMTEXT BIF_ThemeColorShade(colorid, 25)
-#define M_NUMTEXT_ACT_LIGHT BIF_ThemeColorShade(colorid, 35)
+#define M_NUMTEXT UI_ThemeColorShade(colorid, 25)
+#define M_NUMTEXT_ACT_LIGHT UI_ThemeColorShade(colorid, 35)
-#define MM_WHITE BIF_ThemeColorShade(TH_BUT_NEUTRAL, 120)
+#define MM_WHITE UI_ThemeColorShade(TH_BUT_NEUTRAL, 120)
/* Used for the subtle sunken effect around buttons.
* One option is to hardcode to white, with alpha, however it causes a
* weird 'building up' efect, so it's commented out for now.
*/
-
-/*
-#define MM_WHITE_OP glColor4ub(255, 255, 255, 60)
-#define MM_WHITE_TR glColor4ub(255, 255, 255, 0)
- */
-#define MM_WHITE_OP BIF_ThemeColorShadeAlpha(TH_BACK, 55, -100)
-#define MM_WHITE_TR BIF_ThemeColorShadeAlpha(TH_BACK, 55, -255)
+#define MM_WHITE_OP UI_ThemeColorShadeAlpha(TH_BACK, 55, -100)
+#define MM_WHITE_TR UI_ThemeColorShadeAlpha(TH_BACK, 55, -255)
-#define MM_LIGHT BIF_ThemeColorShade(TH_BUT_OUTLINE, 45)
-#define MM_MEDIUM BIF_ThemeColor(TH_BUT_OUTLINE)
-#define MM_GREY BIF_ThemeColorShade(TH_BUT_OUTLINE, -45)
-#define MM_DARK BIF_ThemeColorShade(TH_BUT_OUTLINE, -80)
+#define MM_LIGHT UI_ThemeColorShade(TH_BUT_OUTLINE, 45)
+#define MM_MEDIUM UI_ThemeColor(TH_BUT_OUTLINE)
+#define MM_GREY UI_ThemeColorShade(TH_BUT_OUTLINE, -45)
+#define MM_DARK UI_ThemeColorShade(TH_BUT_OUTLINE, -80)
/* base shaded button */
static void shaded_button(float x1, float y1, float x2, float y2, float asp, int colorid, int flag, int mid)
@@ -422,8 +731,88 @@ static void flat_button(float x1, float y1, float x2, float y2, float asp, int c
/* END OUTER OUTLINE */
}
+/* shaded round button */
+static void round_button_shaded(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag, int rad)
+{
+ float shadefac;
+
+ /* colour shading */
+ if (flag & UI_SELECT) {
+ shadefac = -0.05;
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -40);
+ else UI_ThemeColorShade(colorid, -30);
+ } else {
+ shadefac = 0.05;
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, +30);
+ else UI_ThemeColorShade(colorid, +20);
+ }
+ /* end colour shading */
+
+
+ /* the shaded base */
+ gl_round_box_shade(GL_POLYGON, x1, y1, x2, y2, rad, shadefac, -shadefac);
+
+ /* outline */
+ UI_ThemeColorBlendShade(TH_BUT_OUTLINE, TH_BACK, 0.1, -40);
+
+ uiRoundRectFakeAA(x1, y1, x2, y2, rad, asp);
+ /* end outline */
+}
+
+/* base round flat button */
+static void round_button_flat(int colorid, float asp, float x1, float y1, float x2, float y2, int flag, float rad)
+{
+ /* colour shading */
+ if(flag & UI_SELECT) {
+ if (flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -20);
+ else UI_ThemeColorShade(colorid, -45);
+ }
+ else {
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 35);
+ else UI_ThemeColorShade(colorid, 25);
+ }
+ /* end colour shading */
+
+ /* the solid base */
+ gl_round_box(GL_POLYGON, x1, y1, x2, y2, rad);
+
+ /* outline */
+ UI_ThemeColorBlendShade(TH_BUT_OUTLINE, TH_BACK, 0.1, -30);
+
+ uiRoundRectFakeAA(x1, y1, x2, y2, rad, asp);
+ /* end outline */
+}
+
+static void ui_checkmark_box(int colorid, float x1, float y1, float x2, float y2)
+{
+ uiSetRoundBox(15);
+ UI_ThemeColorShade(colorid, -5);
+ gl_round_box_shade(GL_POLYGON, x1+4, (y1+(y2-y1)/2)-5, x1+14, (y1+(y2-y1)/2)+4, 2, -0.04, 0.03);
+
+ UI_ThemeColorShade(colorid, -30);
+ gl_round_box(GL_LINE_LOOP, x1+4, (y1+(y2-y1)/2)-5, x1+14, (y1+(y2-y1)/2)+4, 2);
+
+}
+static void ui_checkmark(float x1, float y1, float x2, float y2)
+{
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glLineWidth(1.5);
+
+ glBegin( GL_LINE_STRIP );
+ glVertex2f(x1+5, (y1+(y2-y1)/2)-1);
+ glVertex2f(x1+8, (y1+(y2-y1)/2)-4);
+ glVertex2f(x1+13, (y1+(y2-y1)/2)+5);
+ glEnd();
+
+ glLineWidth(1.0);
+ glDisable( GL_BLEND );
+ glDisable( GL_LINE_SMOOTH );
+}
+
/* small side double arrow for iconrow */
-static void ui_default_iconrow_arrows(float x1, float y1, float x2, float y2)
+static void ui_iconrow_arrows(float x1, float y1, float x2, float y2)
{
glEnable( GL_POLYGON_SMOOTH );
glEnable( GL_BLEND );
@@ -446,86 +835,310 @@ static void ui_default_iconrow_arrows(float x1, float y1, float x2, float y2)
}
/* side double arrow for menu */
-static void ui_default_menu_arrows(float x1, float y1, float x2, float y2)
+static void ui_menu_arrows(float x1, float y1, float x2, float y2)
{
- glEnable( GL_POLYGON_SMOOTH );
- glEnable( GL_BLEND );
-
- glShadeModel(GL_FLAT);
- glBegin(GL_TRIANGLES);
- glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1);
- glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1);
- glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4);
- glEnd();
-
- glBegin(GL_TRIANGLES);
- glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -1);
- glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2) -1);
- glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2) -4);
- glEnd();
-
- glDisable( GL_BLEND );
- glDisable( GL_POLYGON_SMOOTH );
+ /* 'point' first, then two base vertices */
+ uiTriangleFakeAA(x2-9, (y2-(y2-y1)/2)+6,
+ x2-6, (y2-(y2-y1)/2)+2,
+ x2-11, (y2-(y2-y1)/2)+2);
+
+ uiTriangleFakeAA(x2-8, (y2-(y2-y1)/2)-6,
+ x2-6, (y2-(y2-y1)/2)-2,
+ x2-11, (y2-(y2-y1)/2)-2);
}
/* left/right arrows for number fields */
-static void ui_default_num_arrows(float x1, float y1, float x2, float y2)
+static void ui_num_arrows(float x1, float y1, float x2, float y2)
{
if( x2-x1 > 25) { // 25 is a bit arbitrary, but small buttons cant have arrows
- glEnable( GL_POLYGON_SMOOTH );
- glEnable( GL_BLEND );
-
- glShadeModel(GL_FLAT);
- glBegin(GL_TRIANGLES);
-
- glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2));
- glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4);
- glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4);
- glEnd();
-
- /* right */
- glShadeModel(GL_FLAT);
- glBegin(GL_TRIANGLES);
+ /* 'point' first, then two base vertices */
+ uiTriangleFakeAA(x1+4, y2-(y2-y1)/2,
+ x1+9, y2-(y2-y1)/2+3,
+ x1+9, y2-(y2-y1)/2-3);
- glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2));
- glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4);
- glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4);
- glEnd();
-
- glDisable( GL_BLEND );
- glDisable( GL_POLYGON_SMOOTH );
+ uiTriangleFakeAA(x2-4, y2-(y2-y1)/2,
+ x2-9, y2-(y2-y1)/2+3,
+ x2-9, y2-(y2-y1)/2-3);
}
}
+
/* changing black/white for TOG3 buts */
static void ui_tog3_invert(float x1, float y1, float x2, float y2, int seltype)
{
- short alpha = 30;
-
+
if (seltype == 0) {
- glEnable(GL_BLEND);
+ UI_ThemeColorShade(TH_BUT_SETTING, -120);
- glColor4ub(0, 0, 0, alpha);
- glRectf(x2-6, y1, x2, (y1+(y2-y1)/2));
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glLineWidth(1.0);
- glColor4ub(255, 255, 255, alpha);
- glRectf(x2-6, (y1+(y2-y1)/2), x2, y2);
+ fdrawline(x1+10, (y1+(y2-y1)/2+4), x1+10, (y1+(y2-y1)/2)-4);
+ fdrawline(x1+6, (y1+(y2-y1)/2), x1+14, (y1+(y2-y1)/2));
- glDisable(GL_BLEND);
+ glLineWidth(1.0);
+ glDisable( GL_BLEND );
+ glDisable( GL_LINE_SMOOTH );
} else {
- glEnable(GL_BLEND);
+ /* horiz line */
+ UI_ThemeColorShade(TH_BUT_SETTING, -120);
+
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glLineWidth(1.0);
- glColor4ub(255, 255, 255, alpha);
- glRectf(x2-6, y1, x2, (y1+(y2-y1)/2));
+ fdrawline(x1+6, (y1+(y2-y1)/2), x1+14, (y1+(y2-y1)/2));
- glColor4ub(0, 0, 0, alpha);
- glRectf(x2-6, (y1+(y2-y1)/2), x2, y2);
+ glLineWidth(1.0);
+ glDisable( GL_BLEND );
+ glDisable( GL_LINE_SMOOTH );
- glDisable(GL_BLEND);
}
}
+/* roundshaded button/popup menu/iconrow drawing code */
+static void ui_roundshaded_button(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
+{
+ float rad, maxrad;
+ int align= (flag & UI_BUT_ALIGN);
+ int round_align_fix= 0;
+
+ /* rounded corners */
+ if (ELEM4(type, MENU, ROW, ICONROW, ICONTEXTROW)) maxrad = 5.0;
+ else maxrad= 10.0;
+
+ rad= (y2-y1)/2.0;
+ if (rad>(x2-x1)/2) rad = (x2-x1)/2;
+ if (rad > maxrad) rad = maxrad;
+
+ /* end rounded corners */
+
+ /* alignment */
+ if(align) {
+ switch(align) {
+ case UI_BUT_ALIGN_TOP:
+ uiSetRoundBox(12);
+ round_align_fix= 4;
+ break;
+ case UI_BUT_ALIGN_DOWN:
+ uiSetRoundBox(3);
+ round_align_fix= 2;
+ break;
+ case UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(6);
+ round_align_fix= 6;
+ break;
+ case UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(9);
+ round_align_fix= 9;
+ break;
+
+ case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(1);
+ round_align_fix= 0;
+ break;
+ case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(2);
+ round_align_fix= 2;
+ break;
+ case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(8);
+ round_align_fix= 0;
+ break;
+ case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(4);
+ round_align_fix= 4;
+ break;
+
+ default:
+ uiSetRoundBox(0);
+ round_align_fix= 0;
+ break;
+ }
+ }
+ else {
+ uiSetRoundBox(15);
+ if (x2 - x1 > 19) {
+ round_align_fix= 6;
+ } else {
+ round_align_fix= 15;
+ }
+ }
+ /* end alignment */
+
+
+ /* draw the base button */
+ round_button_shaded(type, colorid, asp, x1, y1, x2, y2, flag, rad);
+
+ /* *** EXTRA DRAWING FOR SPECIFIC CONTROL TYPES *** */
+ switch(type) {
+ case ICONROW:
+ case ICONTEXTROW:
+ /* iconrow double arrow */
+ if(flag & UI_SELECT) {
+ UI_ThemeColorShade(colorid, -80);
+ } else {
+ UI_ThemeColorShade(colorid, -45);
+ }
+ ui_iconrow_arrows(x1, y1, x2, y2);
+ /* end iconrow double arrow */
+ break;
+ case MENU:
+ /* menu double arrow */
+ if(flag & UI_SELECT) {
+ UI_ThemeColorShade(colorid, -110);
+ } else {
+ UI_ThemeColorShade(colorid, -80);
+ }
+ ui_menu_arrows(x1, y1, x2, y2);
+ /* end menu double arrow */
+ break;
+ }
+}
+
+static void ui_roundshaded_flat(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
+{
+ float rad, maxrad=10.0;
+ int align= (flag & UI_BUT_ALIGN);
+
+ /* rounded corners */
+ rad= (y2-y1)/2.0;
+ if (rad>(x2-x1)/2) rad = (x2-x1)/2;
+ if (maxrad) {
+ if (rad > maxrad) rad = maxrad;
+ }
+ /* end rounded corners */
+
+ /* alignment */
+ if(align) {
+ switch(align) {
+ case UI_BUT_ALIGN_TOP:
+ uiSetRoundBox(12);
+ break;
+ case UI_BUT_ALIGN_DOWN:
+ uiSetRoundBox(3);
+ break;
+ case UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(6);
+ break;
+ case UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(9);
+ break;
+
+ case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(1);
+ break;
+ case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(2);
+ break;
+ case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT:
+ uiSetRoundBox(8);
+ break;
+ case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT:
+ uiSetRoundBox(4);
+ break;
+
+ default:
+ uiSetRoundBox(0);
+ break;
+ }
+ }
+ else {
+ uiSetRoundBox(15);
+ }
+ /* end alignment */
+
+ /* draw the base button */
+ round_button_flat(colorid, asp, x1, y1, x2, y2, flag, rad);
+
+ /* *** EXTRA DRAWING FOR SPECIFIC CONTROL TYPES *** */
+ switch(type) {
+ case TOG:
+ case TOGN:
+ case TOG3:
+ if (!(flag & UI_HAS_ICON)) {
+ /* check to see that there's room for the check mark
+ * draw a check mark, or if it's a TOG3, draw a + or - */
+ if (x2 - x1 > 20) {
+ ui_checkmark_box(colorid, x1, y1, x2, y2);
+
+ /* TOG3 is handled with ui_tog3_invert()
+ * remember to update checkmark drawing there too*/
+ if((flag & UI_SELECT) && (type != TOG3)) {
+ UI_ThemeColorShade(colorid, -140);
+
+ ui_checkmark(x1, y1, x2, y2);
+ }
+ /* draw a dot: alternate, for layers etc. */
+ } else if(flag & UI_SELECT) {
+ uiSetRoundBox(15);
+ UI_ThemeColorShade(colorid, -60);
+
+ glPushMatrix();
+ glTranslatef((x1+(x2-x1)/2), (y1+(y2-y1)/2), 0.0);
+
+ /* circle */
+ glutil_draw_filled_arc(0.0, M_PI*2.0, 2, 16);
+
+ glEnable( GL_LINE_SMOOTH );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+
+ /* smooth outline */
+ glutil_draw_lined_arc(0.0, M_PI*2.0, 2, 16);
+
+ glDisable( GL_BLEND );
+ glDisable( GL_LINE_SMOOTH );
+
+ glPopMatrix();
+ }
+ }
+ break;
+ case NUM:
+ /* side arrows */
+ if(flag & UI_SELECT) {
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -70);
+ else UI_ThemeColorShade(colorid, -70);
+ } else {
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -40);
+ else UI_ThemeColorShade(colorid, -20);
+ }
+
+ ui_num_arrows(x1, y1, x2, y2);
+ /* end side arrows */
+ break;
+ }
+}
+
+/* roundshaded theme callback */
+static void ui_draw_roundshaded(int type, int colorid, float aspect, float x1, float y1, float x2, float y2, int flag)
+{
+
+ switch(type) {
+ case TOG:
+ case TOGN:
+ case TOG3:
+ case SLI:
+ case NUMSLI:
+ case HSVSLI:
+ case TEX:
+ case IDPOIN:
+ case NUM:
+ ui_roundshaded_flat(type, colorid, aspect, x1, y1, x2, y2, flag);
+ break;
+ case ICONROW:
+ case ICONTEXTROW:
+ case MENU:
+ default:
+ ui_roundshaded_button(type, colorid, aspect, x1, y1, x2, y2, flag);
+ }
+
+}
+
/* button/popup menu/iconrow drawing code */
static void ui_default_button(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
{
@@ -683,7 +1296,7 @@ static void ui_default_button(int type, int colorid, float asp, float x1, float
/* ICONROW DOUBLE-ARROW */
M_DARK;
- ui_default_iconrow_arrows(x1, y1, x2, y2);
+ ui_iconrow_arrows(x1, y1, x2, y2);
/* END ICONROW DOUBLE-ARROW */
break;
case MENU:
@@ -698,13 +1311,12 @@ static void ui_default_button(int type, int colorid, float asp, float x1, float
/* MENU DOUBLE-ARROW */
M_DARK;
- ui_default_menu_arrows(x1, y1, x2, y2);
+ ui_menu_arrows(x1, y1, x2, y2);
/* MENU DOUBLE-ARROW */
break;
}
}
-
/* number/text field drawing code */
static void ui_default_flat(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
{
@@ -862,7 +1474,7 @@ static void ui_default_flat(int type, int colorid, float asp, float x1, float y1
else M_LGREY;
}
- ui_default_num_arrows(x1, y1, x2, y2);
+ ui_num_arrows(x1, y1, x2, y2);
/* END SIDE ARROWS */
}
}
@@ -877,40 +1489,40 @@ static void ui_default_slider(int colorid, float fac, float aspect, float x1, fl
yc = 2.3; // height of center line
if(flag & UI_SELECT)
- BIF_ThemeColorShade(TH_BUT_NUM, -5);
+ UI_ThemeColorShade(TH_BUT_NUM, -5);
else {
if(flag & UI_ACTIVE)
- BIF_ThemeColorShade(TH_BUT_NUM, +35);
+ UI_ThemeColorShade(TH_BUT_NUM, +35);
else
- BIF_ThemeColorShade(TH_BUT_NUM, +25);
+ UI_ThemeColorShade(TH_BUT_NUM, +25);
}
glRectf(x1, ymid-yc, x2, ymid+yc);
/* top inner bevel */
- if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, -40);
- else BIF_ThemeColorShade(TH_BUT_NUM, -5);
+ if(flag & UI_SELECT) UI_ThemeColorShade(TH_BUT_NUM, -40);
+ else UI_ThemeColorShade(TH_BUT_NUM, -5);
fdrawline(x1+1, ymid+yc, x2, ymid+yc);
/* bottom inner bevel */
- if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, +15);
- else BIF_ThemeColorShade(TH_BUT_NUM, +45);
+ if(flag & UI_SELECT) UI_ThemeColorShade(TH_BUT_NUM, +15);
+ else UI_ThemeColorShade(TH_BUT_NUM, +45);
fdrawline(x1+1, ymid-yc, x2, ymid-yc);
/* the movable slider */
- if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, +80);
- else BIF_ThemeColorShade(TH_BUT_NUM, -45);
+ if(flag & UI_SELECT) UI_ThemeColorShade(TH_BUT_NUM, +80);
+ else UI_ThemeColorShade(TH_BUT_NUM, -45);
glShadeModel(GL_SMOOTH);
glBegin(GL_QUADS);
- BIF_ThemeColorShade(TH_BUT_NUM, -45);
+ UI_ThemeColorShade(TH_BUT_NUM, -45);
glVertex2f(x1, y1+2.5);
glVertex2f(x1+fac, y1+2.5);
- BIF_ThemeColor(TH_BUT_NUM);
+ UI_ThemeColor(TH_BUT_NUM);
glVertex2f(x1+fac, y2-2.5);
glVertex2f(x1, y2-2.5);
@@ -922,21 +1534,21 @@ static void ui_default_slider(int colorid, float fac, float aspect, float x1, fl
glShadeModel(GL_SMOOTH);
glBegin(GL_QUADS);
- BIF_ThemeColor(TH_BUT_NUM);
+ UI_ThemeColor(TH_BUT_NUM);
glVertex2f(x1+fac-3, y1+2);
glVertex2f(x1+fac, y1+4);
- BIF_ThemeColorShade(TH_BUT_NUM, +80);
+ UI_ThemeColorShade(TH_BUT_NUM, +80);
glVertex2f(x1+fac, y2-2);
glVertex2f(x1+fac-3, y2-2);
glEnd();
/* slider handle left bevel */
- BIF_ThemeColorShade(TH_BUT_NUM, +70);
+ UI_ThemeColorShade(TH_BUT_NUM, +70);
fdrawline(x1+fac-3, y2-2, x1+fac-3, y1+2);
/* slider handle right bevel */
- BIF_ThemeColorShade(TH_BUT_NUM, -35);
+ UI_ThemeColorShade(TH_BUT_NUM, -35);
fdrawline(x1+fac, y2-2, x1+fac, y1+2);
glShadeModel(GL_FLAT);
@@ -995,12 +1607,12 @@ static void ui_draw_oldskool(int type, int colorid, float asp, float x1, float y
{
/* paper */
if(flag & UI_SELECT) {
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40);
- else BIF_ThemeColorShade(colorid, -30);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -40);
+ else UI_ThemeColorShade(colorid, -30);
}
else {
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +30);
- else BIF_ThemeColorShade(colorid, +20);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, +30);
+ else UI_ThemeColorShade(colorid, +20);
}
glRectf(x1+1, y1+1, x2-1, y2-1);
@@ -1011,16 +1623,16 @@ static void ui_draw_oldskool(int type, int colorid, float asp, float x1, float y
y2-= asp;
/* below */
- if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, 0);
- else BIF_ThemeColorShade(colorid, -30);
+ if(flag & UI_SELECT) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -30);
fdrawline(x1, y1, x2, y1);
/* right */
fdrawline(x2, y1, x2, y2);
/* top */
- if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -30);
- else BIF_ThemeColorShade(colorid, 0);
+ if(flag & UI_SELECT) UI_ThemeColorShade(colorid, -30);
+ else UI_ThemeColorShade(colorid, 0);
fdrawline(x1, y2, x2, y2);
/* left */
@@ -1035,28 +1647,28 @@ static void ui_draw_oldskool(int type, int colorid, float asp, float x1, float y
switch(type) {
case NUM:
case NUMABS:
- if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
- else BIF_ThemeColorShade(colorid, -30);
- ui_default_num_arrows(x1, y1, x2, y2);
+ if(flag & UI_SELECT) UI_ThemeColorShade(colorid, -60);
+ else UI_ThemeColorShade(colorid, -30);
+ ui_num_arrows(x1, y1, x2, y2);
break;
case ICONROW:
case ICONTEXTROW:
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
- else BIF_ThemeColorShade(colorid, -10);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
glRectf(x2-9, y1+asp, x2-asp, y2-asp);
- BIF_ThemeColorShade(colorid, -50);
- ui_default_iconrow_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, -50);
+ ui_iconrow_arrows(x1, y1, x2, y2);
break;
case MENU:
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
- else BIF_ThemeColorShade(colorid, -10);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
glRectf(x2-17, y1+asp, x2-asp, y2-asp);
- BIF_ThemeColorShade(colorid, -50);
- ui_default_menu_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, -50);
+ ui_menu_arrows(x1, y1, x2, y2);
break;
}
@@ -1078,7 +1690,7 @@ static void round_button(float x1, float y1, float x2, float y2, float asp,
if(menudeco) {
uiSetRoundBox(round & ~9);
- BIF_ThemeColorShade(colorid, curshade-20);
+ UI_ThemeColorShade(colorid, curshade-20);
gl_round_box(GL_POLYGON, x2-menudeco, y1, x2, y2, rad);
}
@@ -1086,7 +1698,7 @@ static void round_button(float x1, float y1, float x2, float y2, float asp,
uiSetRoundBox(round);
glEnable( GL_BLEND );
- BIF_GetThemeColor3ubv(colorid, col);
+ UI_GetThemeColor3ubv(colorid, col);
if(col[0]<100) col[0]= 0; else col[0]-= 100;
if(col[1]<100) col[1]= 0; else col[1]-= 100;
@@ -1109,11 +1721,11 @@ static void round_button_mid(float x1, float y1, float x2, float y2, float asp,
glRectf(x1, y1, x2, y2);
if(menudeco) {
- BIF_ThemeColorShade(colorid, curshade-20);
+ UI_ThemeColorShade(colorid, curshade-20);
glRectf(x2-menudeco, y1, x2, y2);
}
- BIF_ThemeColorBlendShade(colorid, TH_BACK, 0.5, -70);
+ UI_ThemeColorBlendShade(colorid, TH_BACK, 0.5, -70);
// we draw full outline, its not AA, and it works better button mouse-over hilite
// left right
@@ -1143,7 +1755,7 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1,
else curshade= +20;
}
- BIF_ThemeColorShade(colorid, curshade);
+ UI_ThemeColorShade(colorid, curshade);
if(align) {
switch(align) {
@@ -1186,20 +1798,20 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1,
switch(type) {
case NUM:
case NUMABS:
- BIF_ThemeColorShade(colorid, curshade-60);
- ui_default_num_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, curshade-60);
+ ui_num_arrows(x1, y1, x2, y2);
break;
case ICONROW:
case ICONTEXTROW:
- BIF_ThemeColorShade(colorid, curshade-60);
- ui_default_iconrow_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, curshade-60);
+ ui_iconrow_arrows(x1, y1, x2, y2);
break;
case MENU:
case BLOCK:
- BIF_ThemeColorShade(colorid, curshade-60);
- ui_default_menu_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, curshade-60);
+ ui_menu_arrows(x1, y1, x2, y2);
break;
}
}
@@ -1228,18 +1840,18 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
/* paper */
if(flag & UI_SELECT) {
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40);
- else BIF_ThemeColorShade(colorid, -30);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, -40);
+ else UI_ThemeColorShade(colorid, -30);
}
else {
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +20);
- else BIF_ThemeColorShade(colorid, +10);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, +20);
+ else UI_ThemeColorShade(colorid, +10);
}
glRectf(x1, y1, x2, y2);
if (type==TEX || type==IDPOIN) {
- BIF_ThemeColorShade(colorid, -60);
+ UI_ThemeColorShade(colorid, -60);
/* top */
fdrawline(x1, y2, x2, y2);
@@ -1248,14 +1860,14 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
/* text underline, some */
- BIF_ThemeColorShade(colorid, +50);
+ UI_ThemeColorShade(colorid, +50);
glEnable(GL_LINE_STIPPLE);
glLineStipple(1, 0x8888);
fdrawline(x1+(asp*2), y1+(asp*3), x2-(asp*2), y1+(asp*3));
glDisable(GL_LINE_STIPPLE);
- BIF_ThemeColorShade(colorid, +60);
+ UI_ThemeColorShade(colorid, +60);
/* below */
fdrawline(x1, y1, x2, y1);
/* right */
@@ -1263,13 +1875,13 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
} else {
if(flag & UI_SELECT) {
- BIF_ThemeColorShade(colorid, -60);
+ UI_ThemeColorShade(colorid, -60);
/* top */
fdrawline(x1, y2, x2, y2);
/* left */
fdrawline(x1, y1, x1, y2);
- BIF_ThemeColorShade(colorid, +40);
+ UI_ThemeColorShade(colorid, +40);
/* below */
fdrawline(x1, y1, x2, y1);
@@ -1277,14 +1889,14 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
fdrawline(x2, y1, x2, y2);
}
else {
- BIF_ThemeColorShade(colorid, +40);
+ UI_ThemeColorShade(colorid, +40);
/* top */
fdrawline(x1, y2, x2, y2);
/* left */
fdrawline(x1, y1, x1, y2);
- BIF_ThemeColorShade(colorid, -60);
+ UI_ThemeColorShade(colorid, -60);
/* below */
fdrawline(x1, y1, x2, y1);
/* right */
@@ -1296,29 +1908,29 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
switch(type) {
case NUM:
case NUMABS:
- if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
- else BIF_ThemeColorShade(colorid, -30);
- ui_default_num_arrows(x1, y1, x2, y2);
+ if(flag & UI_SELECT) UI_ThemeColorShade(colorid, -60);
+ else UI_ThemeColorShade(colorid, -30);
+ ui_num_arrows(x1, y1, x2, y2);
break;
case ICONROW:
case ICONTEXTROW:
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
- else BIF_ThemeColorShade(colorid, -10);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
glRectf(x2-9, y1+asp, x2-asp, y2-asp);
- BIF_ThemeColorShade(colorid, -50);
- ui_default_iconrow_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, -50);
+ ui_iconrow_arrows(x1, y1, x2, y2);
break;
case MENU:
case BLOCK:
- if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
- else BIF_ThemeColorShade(colorid, -10);
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
glRectf(x2-17, y1+asp, x2-asp, y2-asp);
- BIF_ThemeColorShade(colorid, -50);
- ui_default_menu_arrows(x1, y1, x2, y2);
+ UI_ThemeColorShade(colorid, -50);
+ ui_menu_arrows(x1, y1, x2, y2);
break;
}
@@ -1336,9 +1948,9 @@ static void ui_draw_slider(int colorid, float fac, float aspect, float x1, float
yc= 1.7*aspect;
if(flag & UI_ACTIVE)
- BIF_ThemeColorShade(colorid, -50);
+ UI_ThemeColorShade(colorid, -50);
else
- BIF_ThemeColorShade(colorid, -40);
+ UI_ThemeColorShade(colorid, -40);
/* left part */
glRectf(x1, ymid-2.0*yc, x1+fac, ymid+2.0*yc);
@@ -1347,7 +1959,7 @@ static void ui_draw_slider(int colorid, float fac, float aspect, float x1, float
/* the movable slider */
- BIF_ThemeColorShade(colorid, +70);
+ UI_ThemeColorShade(colorid, +70);
glRectf(x1+fac-aspect, ymid-2.0*yc, x1+fac+aspect, ymid+2.0*yc);
}
@@ -1409,7 +2021,7 @@ void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, fl
void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag)
{
char col[4];
- BIF_GetThemeColor4ubv(TH_MENU_BACK, col);
+ UI_GetThemeColor4ubv(TH_MENU_BACK, col);
if( (flag & UI_BLOCK_NOSHADOW)==0) {
/* accumulated outline boxes to make shade not linear, is more pleasant */
@@ -1434,18 +2046,18 @@ static void ui_draw_pulldown_item(int type, int colorid, float asp, float x1, fl
{
char col[4];
- BIF_GetThemeColor4ubv(TH_MENU_BACK, col);
+ UI_GetThemeColor4ubv(TH_MENU_BACK, col);
if(col[3]!=255) {
glEnable(GL_BLEND);
}
if((flag & UI_ACTIVE) && type!=LABEL) {
- BIF_ThemeColor4(TH_MENU_HILITE);
+ UI_ThemeColor4(TH_MENU_HILITE);
glRectf(x1, y1, x2, y2);
} else {
- BIF_ThemeColor4(colorid); // is set at TH_MENU_ITEM when pulldown opened.
+ UI_ThemeColor4(colorid); // is set at TH_MENU_ITEM when pulldown opened.
glRectf(x1, y1, x2, y2);
}
@@ -1457,7 +2069,7 @@ static void ui_draw_pulldown_round(int type, int colorid, float asp, float x1, f
{
if(flag & UI_ACTIVE) {
- BIF_ThemeColor(TH_MENU_HILITE);
+ UI_ThemeColor(TH_MENU_HILITE);
uiSetRoundBox(15);
gl_round_box(GL_POLYGON, x1, y1+3, x2, y2-3, 7.0);
@@ -1469,13 +2081,12 @@ static void ui_draw_pulldown_round(int type, int colorid, float asp, float x1, f
glDisable( GL_BLEND );
} else {
- BIF_ThemeColor(colorid); // is set at TH_MENU_ITEM when pulldown opened.
+ UI_ThemeColor(colorid); // is set at TH_MENU_ITEM when pulldown opened.
glRectf(x1-1, y1+2, x2+1, y2-2);
}
}
-
/* ************** TEXT AND ICON DRAWING FUNCTIONS ************* */
@@ -1496,7 +2107,7 @@ static void ui_draw_text_icon(uiBut *but)
else {
/* text button selection and cursor */
- if(but->pos != -1) {
+ if(but->editstr && but->pos != -1) {
if ((but->selend - but->selsta) > 0) {
/* text button selection */
@@ -1507,7 +2118,7 @@ static void ui_draw_text_icon(uiBut *but)
ch= but->drawstr[selsta_tmp];
but->drawstr[selsta_tmp]= 0;
- selsta_draw = but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3;
+ selsta_draw = but->aspect*UI_GetStringWidth(but->font, but->drawstr+but->ofs, ui_translate_buttons()) + 3;
but->drawstr[selsta_tmp]= ch;
@@ -1515,11 +2126,11 @@ static void ui_draw_text_icon(uiBut *but)
ch= but->drawstr[selend_tmp];
but->drawstr[selend_tmp]= 0;
- selwidth_draw = but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3;
+ selwidth_draw = but->aspect*UI_GetStringWidth(but->font, but->drawstr+but->ofs, ui_translate_buttons()) + 3;
but->drawstr[selend_tmp]= ch;
- BIF_ThemeColor(TH_BUT_TEXTFIELD_HI);
+ UI_ThemeColor(TH_BUT_TEXTFIELD_HI);
glRects(but->x1+selsta_draw+1, but->y1+2, but->x1+selwidth_draw+1, but->y2-2);
}
} else {
@@ -1530,7 +2141,7 @@ static void ui_draw_text_icon(uiBut *but)
ch= but->drawstr[pos];
but->drawstr[pos]= 0;
- t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3;
+ t= but->aspect*UI_GetStringWidth(but->font, but->drawstr+but->ofs, ui_translate_buttons()) + 3;
but->drawstr[pos]= ch;
}
@@ -1563,15 +2174,21 @@ static void ui_draw_text_icon(uiBut *but)
/* If there's an icon too (made with uiDefIconTextBut) then draw the icon
and offset the text label to accomodate it */
- if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) {
+ if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) )
+ {
ui_draw_icon(but, but->icon, 0);
-
- if(but->flag & UI_TEXT_LEFT) x= but->x1 + but->aspect*BIF_icon_get_width(but->icon)+5.0;
+
+ if(but->editstr || (but->flag & UI_TEXT_LEFT)) x= but->x1 + but->aspect*UI_icon_get_width(but->icon)+5.0;
else x= (but->x1+but->x2-but->strwidth+1)/2.0;
}
- else {
- if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0;
- else x= (but->x1+but->x2-but->strwidth+1)/2.0;
+ else
+ {
+ if(but->editstr || (but->flag & UI_TEXT_LEFT))
+ x= but->x1+4.0;
+ else if ELEM3(but->type, TOG, TOGN, TOG3)
+ x= but->x1+18.0; /* offset for checkmark */
+ else
+ x= (but->x1+but->x2-but->strwidth+1)/2.0;
}
/* tog3 button exception; draws with glColor! */
@@ -1593,40 +2210,40 @@ static void ui_draw_text_icon(uiBut *but)
if(tog3); // color already set
else if(but->dt==UI_EMBOSSP) {
if((but->flag & (UI_SELECT|UI_ACTIVE)) && but->type!=LABEL) { // LABEL = title in pulldowns
- BIF_ThemeColor(TH_MENU_TEXT_HI);
+ UI_ThemeColor(TH_MENU_TEXT_HI);
} else {
- BIF_ThemeColor(TH_MENU_TEXT);
+ UI_ThemeColor(TH_MENU_TEXT);
}
}
else {
if(but->flag & UI_SELECT) {
- BIF_ThemeColor(TH_BUT_TEXT_HI);
+ UI_ThemeColor(TH_BUT_TEXT_HI);
} else {
- BIF_ThemeColor(TH_BUT_TEXT);
+ UI_ThemeColor(TH_BUT_TEXT);
}
}
/* LABEL button exception */
- if(but->type==LABEL && but->min!=0.0) BIF_ThemeColor(TH_BUT_TEXT_HI);
+ if(but->type==LABEL && but->min!=0.0) UI_ThemeColor(TH_BUT_TEXT_HI);
ui_rasterpos_safe(x, (but->y1+but->y2- 9.0)/2.0, but->aspect);
if(but->type==IDPOIN) transopts= 0; // no translation, of course!
- else transopts= (U.transopts & USER_TR_BUTTONS);
+ else transopts= ui_translate_buttons();
#ifdef INTERNATIONAL
if (but->type == FTPREVIEW)
FTF_DrawNewFontString (but->drawstr+but->ofs, FTF_INPUT_UTF8);
else
- BIF_DrawString(but->font, but->drawstr+but->ofs, transopts);
+ UI_DrawString(but->font, but->drawstr+but->ofs, transopts);
#else
- BIF_DrawString(but->font, but->drawstr+but->ofs, transopts);
+ UI_DrawString(but->font, but->drawstr+but->ofs, transopts);
#endif
/* part text right aligned */
if(cpoin) {
- len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS));
+ len= UI_GetStringWidth(but->font, cpoin+1, ui_translate_buttons());
ui_rasterpos_safe( but->x2 - len*but->aspect-3, (but->y1+but->y2- 9.0)/2.0, but->aspect);
- BIF_DrawString(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS));
+ UI_DrawString(but->font, cpoin+1, ui_translate_buttons());
*cpoin= '|';
}
}
@@ -1657,13 +2274,15 @@ static void ui_draw_but_COL(uiBut *but)
/* exception... hrms, but can't simply use the emboss callback for this now. */
/* this button type needs review, and nice integration with rest of API here */
+ /* XXX 2.50 bad U global access */
if(but->embossfunc == ui_draw_round) {
- char *cp= BIF_ThemeGetColorPtr(U.themes.first, 0, TH_CUSTOM);
+ char *cp= UI_ThemeGetColorPtr(U.themes.first, 0, TH_CUSTOM);
cp[0]= colr; cp[1]= colg; cp[2]= colb;
but->flag &= ~UI_SELECT;
but->embossfunc(but->type, TH_CUSTOM, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
}
- else {
+ else
+ {
glColor3ub(colr, colg, colb);
glRectf((but->x1), (but->y1), (but->x2), (but->y2));
@@ -1791,6 +2410,8 @@ static void ui_draw_but_HSVCUBE(uiBut *but)
#ifdef INTERNATIONAL
static void ui_draw_but_CHARTAB(uiBut *but)
{
+ /* XXX 2.50 bad global access */
+#if 0
/* Some local variables */
float sx, sy, ex, ey;
float width, height;
@@ -1934,7 +2555,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
else
{
ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect);
- BIF_DrawString(but->font, (char *) ustr, 0);
+ UI_DrawString(but->font, (char *) ustr, 0);
}
// Calculate the next position and character
@@ -1969,19 +2590,20 @@ static void ui_draw_but_CHARTAB(uiBut *but)
{
uiSetCurFont(but->block, UI_HELV);
}
+#endif
}
#endif // INTERNATIONAL
static void ui_draw_but_COLORBAND(uiBut *but)
{
- ColorBand *coba= (ColorBand *)but->poin;
+ ColorBand *coba;
CBData *cbd;
float x1, y1, sizex, sizey;
float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2];
- float pos, colf[4];
int a;
+ coba= (ColorBand *)(but->editcoba? but->editcoba: but->poin);
if(coba==NULL) return;
x1= but->x1;
@@ -2000,7 +2622,7 @@ static void ui_draw_but_COLORBAND(uiBut *but)
v1[0]+= dx;
}
- glShadeModel(GL_FLAT);
+ glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND);
cbd= coba->data;
@@ -2014,16 +2636,17 @@ static void ui_draw_but_COLORBAND(uiBut *but)
glColor4fv( &cbd->r );
glVertex2fv(v1); glVertex2fv(v2);
- for( a = 1; a < sizex; a++ ) {
- pos = ((float)a) / (sizex-1);
- do_colorband( coba, pos, colf );
-
- v1[0]=v2[0]= x1 + a;
-
- glColor4fv( colf );
+ for(a=0; a<coba->tot; a++, cbd++) {
+
+ v1[0]=v2[0]= x1+ cbd->pos*sizex;
+
+ glColor4fv( &cbd->r );
glVertex2fv(v1); glVertex2fv(v2);
}
-
+
+ v1[0]=v2[0]= x1+ sizex;
+ glVertex2fv(v1); glVertex2fv(v2);
+
glEnd();
glShadeModel(GL_FLAT);
glDisable(GL_BLEND);
@@ -2111,7 +2734,7 @@ static void ui_draw_but_NORMAL(uiBut *but)
glGetMaterialfv(GL_FRONT, GL_DIFFUSE, diff);
/* backdrop */
- BIF_ThemeColor(TH_BUT_NEUTRAL);
+ UI_ThemeColor(TH_BUT_NEUTRAL);
uiSetRoundBox(15);
gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, 5.0f);
@@ -2203,20 +2826,23 @@ static void ui_draw_but_curve_grid(uiBut *but, float zoomx, float zoomy, float o
static void ui_draw_but_CURVE(uiBut *but)
{
- CurveMapping *cumap= (CurveMapping *)but->poin;
- CurveMap *cuma= cumap->cm+cumap->cur;
+ CurveMapping *cumap;
+ CurveMap *cuma;
CurveMapPoint *cmp;
float fx, fy, dx, dy, fac[2], zoomx, zoomy, offsx, offsy;
GLint scissor[4];
int a;
+
+ cumap= (CurveMapping *)(but->editcumap? but->editcumap: but->poin);
+ cuma= cumap->cm+cumap->cur;
/* need scissor test, curve can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
fx= but->x1; fy= but->y1;
- ui_graphics_to_window(but->win, &fx, &fy);
+ /* XXX 2.50 need context: ui_graphics_to_window(but->win, &fx, &fy); */
dx= but->x2; dy= but->y2;
- ui_graphics_to_window(but->win, &dx, &dy);
- glScissor((int)floor(fx), (int)floor(fy), (int)ceil(dx-fx), (int)ceil(dy-fy));
+ /* XXX 2.50 need context: ui_graphics_to_window(but->win, &dx, &dy); */
+ //glScissor((int)floor(fx), (int)floor(fy), (int)ceil(dx-fx), (int)ceil(dy-fy));
/* calculate offset and zoom */
zoomx= (but->x2-but->x1-2.0*but->aspect)/(cumap->curr.xmax - cumap->curr.xmin);
@@ -2226,27 +2852,27 @@ static void ui_draw_but_CURVE(uiBut *but)
/* backdrop */
if(cumap->flag & CUMA_DO_CLIP) {
- BIF_ThemeColorShade(TH_BUT_NEUTRAL, -20);
+ UI_ThemeColorShade(TH_BUT_NEUTRAL, -20);
glRectf(but->x1, but->y1, but->x2, but->y2);
- BIF_ThemeColor(TH_BUT_NEUTRAL);
+ UI_ThemeColor(TH_BUT_NEUTRAL);
glRectf(but->x1 + zoomx*(cumap->clipr.xmin-offsx),
but->y1 + zoomy*(cumap->clipr.ymin-offsy),
but->x1 + zoomx*(cumap->clipr.xmax-offsx),
but->y1 + zoomy*(cumap->clipr.ymax-offsy));
}
else {
- BIF_ThemeColor(TH_BUT_NEUTRAL);
+ UI_ThemeColor(TH_BUT_NEUTRAL);
glRectf(but->x1, but->y1, but->x2, but->y2);
}
/* grid, every .25 step */
- BIF_ThemeColorShade(TH_BUT_NEUTRAL, -16);
+ UI_ThemeColorShade(TH_BUT_NEUTRAL, -16);
ui_draw_but_curve_grid(but, zoomx, zoomy, offsx, offsy, 0.25f);
/* grid, every 1.0 step */
- BIF_ThemeColorShade(TH_BUT_NEUTRAL, -24);
+ UI_ThemeColorShade(TH_BUT_NEUTRAL, -24);
ui_draw_but_curve_grid(but, zoomx, zoomy, offsx, offsy, 1.0f);
/* axes */
- BIF_ThemeColorShade(TH_BUT_NEUTRAL, -50);
+ UI_ThemeColorShade(TH_BUT_NEUTRAL, -50);
glBegin(GL_LINES);
glVertex2f(but->x1, but->y1 + zoomy*(-offsy));
glVertex2f(but->x2, but->y1 + zoomy*(-offsy));
@@ -2255,15 +2881,17 @@ static void ui_draw_but_CURVE(uiBut *but)
glEnd();
/* cfra option */
+ /* XXX 2.48
if(cumap->flag & CUMA_DRAW_CFRA) {
glColor3ub(0x60, 0xc0, 0x40);
glBegin(GL_LINES);
glVertex2f(but->x1 + zoomx*(cumap->sample[0]-offsx), but->y1);
glVertex2f(but->x1 + zoomx*(cumap->sample[0]-offsx), but->y2);
glEnd();
- }
+ }*/
/* sample option */
- if(cumap->flag & CUMA_DRAW_SAMPLE) {
+ /* XXX 2.48
+ * if(cumap->flag & CUMA_DRAW_SAMPLE) {
if(cumap->cur==3) {
float lum= cumap->sample[0]*0.35f + cumap->sample[1]*0.45f + cumap->sample[2]*0.2f;
glColor3ub(240, 240, 240);
@@ -2286,10 +2914,10 @@ static void ui_draw_but_CURVE(uiBut *but)
glVertex2f(but->x1 + zoomx*(cumap->sample[cumap->cur]-offsx), but->y2);
glEnd();
}
- }
+ }*/
/* the curve */
- BIF_ThemeColorBlend(TH_TEXT, TH_BUT_NEUTRAL, 0.35);
+ UI_ThemeColorBlend(TH_TEXT, TH_BUT_NEUTRAL, 0.35);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
glBegin(GL_LINE_STRIP);
@@ -2329,9 +2957,9 @@ static void ui_draw_but_CURVE(uiBut *but)
bglBegin(GL_POINTS);
for(a=0; a<cuma->totpoint; a++) {
if(cmp[a].flag & SELECT)
- BIF_ThemeColor(TH_TEXT_HI);
+ UI_ThemeColor(TH_TEXT_HI);
else
- BIF_ThemeColor(TH_TEXT);
+ UI_ThemeColor(TH_TEXT);
fac[0]= but->x1 + zoomx*(cmp[a].x-offsx);
fac[1]= but->y1 + zoomy*(cmp[a].y-offsy);
bglVertex2fv(fac);
@@ -2343,16 +2971,15 @@ static void ui_draw_but_CURVE(uiBut *but)
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
/* outline */
- BIF_ThemeColor(TH_BUT_OUTLINE);
+ UI_ThemeColor(TH_BUT_OUTLINE);
fdrawbox(but->x1, but->y1, but->x2, but->y2);
-
}
static void ui_draw_roundbox(uiBut *but)
{
glEnable(GL_BLEND);
- BIF_ThemeColorShadeAlpha(but->themecol, but->a2, but->a2);
+ UI_ThemeColorShadeAlpha(but->themecol, but->a2, but->a2);
uiSetRoundBox(but->a1);
gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->min);
@@ -2366,6 +2993,66 @@ static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1
{
}
+/* minimal drawing for table items */
+static void ui_draw_table(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
+{
+ int background= 1;
+
+ /* paper */
+ if(flag & UI_SELECT) {
+ if(flag & UI_ACTIVE) glColor4f(0, 0, 0, 0.2f);
+ else glColor4f(0, 0, 0, 0.1f);
+ }
+ else {
+ if(flag & UI_ACTIVE) glColor4f(1.0f, 1.0f, 1.0f, 0.2f);
+ else background= 0;
+ }
+
+ if(background) {
+ glEnable(GL_BLEND);
+ glRectf(x1, y1, x2, y2);
+ glDisable(GL_BLEND);
+ }
+
+ /* special type decorations */
+ switch(type) {
+ case NUM:
+ case NUMABS:
+ if(flag & UI_SELECT) UI_ThemeColorShade(colorid, -120);
+ else UI_ThemeColorShade(colorid, -90);
+ ui_num_arrows(x1, y1, x2, y2);
+ break;
+
+ case TOG:
+ ui_checkmark_box(colorid, x1, y1, x2, y2);
+
+ if(flag & UI_SELECT) {
+ UI_ThemeColorShade(colorid, -140);
+ ui_checkmark(x1, y1, x2, y2);
+ }
+ break;
+
+ case ICONROW:
+ case ICONTEXTROW:
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
+ glRectf(x2-9, y1+asp, x2-asp, y2-asp);
+
+ UI_ThemeColorShade(colorid, -50);
+ ui_iconrow_arrows(x1, y1, x2, y2);
+ break;
+
+ case MENU:
+ case BLOCK:
+ if(flag & UI_ACTIVE) UI_ThemeColorShade(colorid, 0);
+ else UI_ThemeColorShade(colorid, -10);
+ glRectf(x2-17, y1+asp, x2-asp, y2-asp);
+
+ UI_ThemeColorShade(colorid, -50);
+ ui_menu_arrows(x1, y1, x2, y2);
+ break;
+ }
+}
/* ************** EXTERN, called from interface.c ************* */
/* ************** MAIN CALLBACK FUNCTION ************* */
@@ -2385,11 +3072,15 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
else if(drawtype==UI_EMBOSSN) but->embossfunc= ui_draw_nothing;
else if(drawtype==UI_EMBOSSP) but->embossfunc= ui_draw_pulldown_item;
else if(drawtype==UI_EMBOSSR) but->embossfunc= ui_draw_round;
+ else if(drawtype==UI_EMBOSST) but->embossfunc= ui_draw_table;
else {
- int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
+ int theme= UI_GetThemeValue(TH_BUT_DRAWTYPE);
switch(theme) {
+ case TH_SHADED:
+ but->embossfunc= ui_draw_default;
+ break;
case TH_ROUNDED:
but->embossfunc= ui_draw_round;
break;
@@ -2399,9 +3090,9 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
case TH_MINIMAL:
but->embossfunc= ui_draw_minimal;
break;
- case TH_SHADED:
+ case TH_ROUNDSHADED:
default:
- but->embossfunc= ui_draw_default;
+ but->embossfunc= ui_draw_roundshaded;
but->sliderfunc= ui_default_slider;
break;
}
@@ -2414,18 +3105,22 @@ void ui_draw_but(uiBut *but)
{
double value;
float x1, x2, y1, y2, fac;
+ int type;
if(but==NULL) return;
+ /* XXX 2.50 no frontbuffer drawing allowed */
+#if 0
/* signal for frontbuf flush buttons and menus, not when normal drawing */
if(but->block->in_use) ui_block_set_flush(but->block, but);
+#endif
switch (but->type) {
case NUMSLI:
case HSVSLI:
-
- but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
+ type= (but->editstr)? TEX: but->type;
+ but->embossfunc(type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
ui_draw_text_icon(but);
x1= (but->x1+but->x2)/2;
@@ -2478,7 +3173,8 @@ void ui_draw_but(uiBut *but)
break;
default:
- but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
+ type= (but->editstr)? TEX: but->type;
+ but->embossfunc(type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
ui_draw_text_icon(but);
}
@@ -2514,3 +3210,4 @@ void ui_dropshadow(rctf *rct, float radius, float aspect, int select)
glDisable(GL_BLEND);
}
+
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
new file mode 100644
index 00000000000..144e8490661
--- /dev/null
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -0,0 +1,3608 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_color_types.h"
+#include "DNA_object_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+#include "PIL_time.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+
+#include "UI_interface.h"
+#include "UI_text.h"
+#include "interface.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+/***************** structs and defines ****************/
+
+#define BUTTON_TOOLTIP_DELAY 500
+#define BUTTON_FLASH_DELAY 20
+#define BUTTON_AUTO_OPEN_THRESH 0.3
+#define BUTTON_MOUSE_TOWARDS_THRESH 1.0
+
+typedef enum uiButtonActivateType {
+ BUTTON_ACTIVATE_OVER,
+ BUTTON_ACTIVATE,
+ BUTTON_ACTIVATE_APPLY,
+ BUTTON_ACTIVATE_TEXT_EDITING,
+ BUTTON_ACTIVATE_OPEN
+} uiButtonActivateType;
+
+typedef enum uiHandleButtonState {
+ BUTTON_STATE_INIT,
+ BUTTON_STATE_HIGHLIGHT,
+ BUTTON_STATE_WAIT_FLASH,
+ BUTTON_STATE_WAIT_RELEASE,
+ BUTTON_STATE_WAIT_KEY_EVENT,
+ BUTTON_STATE_NUM_EDITING,
+ BUTTON_STATE_TEXT_EDITING,
+ BUTTON_STATE_TEXT_SELECTING,
+ BUTTON_STATE_MENU_OPEN,
+ BUTTON_STATE_EXIT
+} uiHandleButtonState;
+
+typedef struct uiHandleMenuData {
+ uiMenuBlockHandle *handle;
+
+ int towardsx, towardsy;
+ double towardstime;
+ int dotowards;
+} uiHandleMenuData;
+
+typedef struct uiHandleButtonData {
+ wmWindow *window;
+ ARegion *region;
+
+ int interactive;
+
+ /* overall state */
+ uiHandleButtonState state;
+ int cancel, retval;
+ int applied, appliedinteractive;
+ wmTimerHandle *flashtimer;
+
+ /* edited value */
+ char *str, *origstr;
+ double value, origvalue;
+ float vec[3], origvec[3];
+ int togdual, togonly;
+ ColorBand *coba;
+ CurveMapping *cumap;
+
+ /* tooltip */
+ ARegion *tooltip;
+ wmTimerHandle *tooltiptimer;
+ wmTimerHandle *autoopentimer;
+
+ /* text selection/editing */
+ int maxlen, selextend, selstartx;
+
+ /* number editing / dragging */
+ int draglastx, draglasty;
+ int dragstartx, dragstarty;
+ int dragchange, draglock, dragsel;
+ float dragf, dragfstart;
+ CBData *dragcbd;
+
+ /* menu open */
+ uiHandleMenuData *menu;
+ int menuretval;
+
+ /* post activate */
+ uiButtonActivateType posttype;
+ uiBut *postbut;
+} uiHandleButtonData;
+
+typedef struct uiAfterFunc {
+ struct uiAfterFunc *next, *prev;
+
+ void (*func)(struct bContext*, void *, void *);
+ void *func_arg1;
+ void *func_arg2;
+
+ void (*handle_func)(struct bContext*, void *arg, int event);
+ void *handle_func_arg;
+ int retval;
+
+ void (*butm_func)(struct bContext*, void *arg, int event);
+ void *butm_func_arg;
+ int a2;
+} uiAfterFunc;
+
+static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state);
+static int ui_handler_window(bContext *C, wmEvent *event);
+
+/* ********************** button apply/revert ************************/
+
+static ListBase UIAfterFuncs = {NULL, NULL};
+
+static void ui_apply_but_func(bContext *C, uiBut *but)
+{
+ uiAfterFunc *after;
+ uiBlock *block= but->block;
+
+ /* these functions are postponed and only executed after all other
+ * handling is done, i.e. menus are closed, in order to avoid conflicts
+ * with these functions removing the buttons we are working with */
+
+ if(but->func || block->handle_func || (but->type == BUTM && block->butm_func)) {
+ after= MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc");
+ after->func= but->func;
+ after->func_arg1= but->func_arg1;
+ after->func_arg2= but->func_arg2;
+
+ after->handle_func= block->handle_func;
+ after->handle_func_arg= block->handle_func_arg;
+ after->retval= but->retval;
+
+ if(but->type == BUTM) {
+ after->butm_func= block->butm_func;
+ after->butm_func_arg= block->butm_func_arg;
+ after->a2= but->a2;
+ }
+
+ BLI_addtail(&UIAfterFuncs, after);
+ }
+}
+
+static void ui_apply_but_funcs_after(bContext *C)
+{
+ uiAfterFunc *after;
+ ListBase funcs;
+
+ /* copy to avoid recursive calls */
+ funcs= UIAfterFuncs;
+ UIAfterFuncs.first= UIAfterFuncs.last= NULL;
+
+ for(after=funcs.first; after; after=after->next) {
+ if(after->func)
+ after->func(C, after->func_arg1, after->func_arg2);
+
+ if(after->handle_func)
+ after->handle_func(C, after->handle_func_arg, after->retval);
+ if(after->butm_func)
+ after->butm_func(C, after->butm_func_arg, after->a2);
+ }
+
+ BLI_freelistN(&funcs);
+}
+
+static void ui_apply_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_BUTM(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_set_but_val(but, but->min);
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ if(but->type == COL)
+ ui_set_but_vectorf(but, data->vec);
+ else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+ ui_set_but_val(but, data->value);
+
+ ui_check_but(but);
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_TOG(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
+{
+ double value;
+ int w, lvalue, push;
+
+ /* local hack... */
+ if(but->type==BUT_TOGDUAL && data->togdual) {
+ if(but->pointype==SHO)
+ but->poin += 2;
+ else if(but->pointype==INT)
+ but->poin += 4;
+ }
+
+ value= ui_get_but_val(but);
+ lvalue= (int)value;
+
+ if(but->bit) {
+ w= BTST(lvalue, but->bitnr);
+ if(w) lvalue = BCLR(lvalue, but->bitnr);
+ else lvalue = BSET(lvalue, but->bitnr);
+
+ if(but->type==TOGR) {
+ if(!data->togonly) {
+ lvalue= 1<<(but->bitnr);
+
+ ui_set_but_val(but, (double)lvalue);
+ }
+ else {
+ if(lvalue==0) lvalue= 1<<(but->bitnr);
+ }
+ }
+
+ ui_set_but_val(but, (double)lvalue);
+ if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
+ }
+ else {
+
+ if(value==0.0) push= 1;
+ else push= 0;
+
+ if(but->type==TOGN || but->type==ICONTOGN) push= !push;
+ ui_set_but_val(but, (double)push);
+ if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
+ }
+
+ /* end local hack... */
+ if(but->type==BUT_TOGDUAL && data->togdual) {
+ if(but->pointype==SHO)
+ but->poin -= 2;
+ else if(but->pointype==INT)
+ but->poin -= 4;
+ }
+
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
+{
+ ui_set_but_val(but, but->max);
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ if(!data->str)
+ return;
+
+ ui_set_but_string(but, data->str);
+ ui_check_but(but);
+
+ /* give butfunc the original text too */
+ /* feature used for bone renaming, channels, etc */
+ if(but->func_arg2==NULL) but->func_arg2= data->origstr;
+ ui_apply_but_func(C, but);
+ if(but->func_arg2==data->origstr) but->func_arg2= NULL;
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ if(data->str) {
+ /* XXX 2.50 missing python api */
+#if 0
+ if(BPY_button_eval(data->str, &data->value)) {
+ WM_report(C, WM_LOG_WARNING, "Invalid Python expression, check console");
+ data->value = 0.0f; /* Zero out value on error */
+
+ if(data->str[0]) {
+ data->cancel= 1; /* invalidate return value if eval failed, except when string was null */
+ return;
+ }
+ }
+#else
+ data->value= atof(data->str);
+#endif
+
+ if(!ui_is_but_float(but)) data->value= (int)data->value;
+ if(but->type==NUMABS) data->value= fabs(data->value);
+ if(data->value<but->min) data->value= but->min;
+ if(data->value>but->max) data->value= but->max;
+ }
+
+ ui_set_but_val(but, data->value);
+ ui_check_but(but);
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_LABEL(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_TOG3(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ if(but->pointype==SHO ) {
+ short *sp= (short *)but->poin;
+
+ if( BTST(sp[1], but->bitnr)) {
+ sp[1]= BCLR(sp[1], but->bitnr);
+ sp[0]= BCLR(sp[0], but->bitnr);
+ }
+ else if( BTST(sp[0], but->bitnr)) {
+ sp[1]= BSET(sp[1], but->bitnr);
+ } else {
+ sp[0]= BSET(sp[0], but->bitnr);
+ }
+ }
+ else {
+ if( BTST(*(but->poin+2), but->bitnr)) {
+ *(but->poin+2)= BCLR(*(but->poin+2), but->bitnr);
+ *(but->poin)= BCLR(*(but->poin), but->bitnr);
+ }
+ else if( BTST(*(but->poin), but->bitnr)) {
+ *(but->poin+2)= BSET(*(but->poin+2), but->bitnr);
+ } else {
+ *(but->poin)= BSET(*(but->poin), but->bitnr);
+ }
+ }
+
+ ui_check_but(but);
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_VEC(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_set_but_vectorf(but, data->vec);
+ ui_check_but(but);
+ ui_apply_but_func(C, but);
+
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_COLORBAND(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_CURVE(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+static void ui_apply_but_IDPOIN(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ but->idpoin_func(C, data->str, but->idpoin_idpp);
+ ui_check_but(but);
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+
+#ifdef INTERNATIONAL
+static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ ui_apply_but_func(C, but);
+ data->retval= but->retval;
+ data->applied= 1;
+}
+#endif
+
+static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, int interactive)
+{
+ char *editstr;
+ double *editval;
+ float *editvec;
+ ColorBand *editcoba;
+ CurveMapping *editcumap;
+
+ data->retval= 0;
+
+ /* if we cancel and have not applied yet, there is nothing to do,
+ * otherwise we have to restore the original value again */
+ if(data->cancel) {
+ if(!data->applied)
+ return;
+
+ if(data->str) MEM_freeN(data->str);
+ data->str= data->origstr;
+ data->origstr= NULL;
+ data->value= data->origvalue;
+ data->origvalue= 0.0;
+ VECCOPY(data->vec, data->origvec);
+ data->origvec[0]= data->origvec[1]= data->origvec[2]= 0.0f;
+ }
+ else {
+ /* we avoid applying interactive edits a second time
+ * at the end with the appliedinteractive flag */
+ if(interactive)
+ data->appliedinteractive= 1;
+ else if(data->appliedinteractive)
+ return;
+ }
+
+ /* ensures we are writing actual values */
+ editstr= but->editstr;
+ editval= but->editval;
+ editvec= but->editvec;
+ editcoba= but->editcoba;
+ editcumap= but->editcumap;
+ but->editstr= NULL;
+ but->editval= NULL;
+ but->editvec= NULL;
+ but->editcoba= NULL;
+ but->editcumap= NULL;
+
+ /* handle different types */
+ switch(but->type) {
+ case BUT:
+ ui_apply_but_BUT(C, but, data);
+ break;
+ case TEX:
+ ui_apply_but_TEX(C, but, data);
+ break;
+ case TOG:
+ case TOGR:
+ case ICONTOG:
+ case ICONTOGN:
+ case TOGN:
+ case BUT_TOGDUAL:
+ ui_apply_but_TOG(C, block, but, data);
+ break;
+ case ROW:
+ ui_apply_but_ROW(C, block, but, data);
+ break;
+ case SCROLL:
+ break;
+ case NUM:
+ case NUMABS:
+ ui_apply_but_NUM(C, but, data);
+ break;
+ case SLI:
+ case NUMSLI:
+ ui_apply_but_NUM(C, but, data);
+ break;
+ case HSVSLI:
+ break;
+ case ROUNDBOX:
+ case LABEL:
+ ui_apply_but_LABEL(C, but, data);
+ break;
+ case TOG3:
+ ui_apply_but_TOG3(C, but, data);
+ break;
+ case MENU:
+ case ICONROW:
+ case ICONTEXTROW:
+ case BLOCK:
+ case PULLDOWN:
+ case COL:
+ ui_apply_but_BLOCK(C, but, data);
+ break;
+ case BUTM:
+ ui_apply_but_BUTM(C, but, data);
+ break;
+ case BUT_NORMAL:
+ case HSVCUBE:
+ ui_apply_but_VEC(C, but, data);
+ break;
+ case BUT_COLORBAND:
+ ui_apply_but_COLORBAND(C, but, data);
+ break;
+ case BUT_CURVE:
+ ui_apply_but_CURVE(C, but, data);
+ break;
+ case IDPOIN:
+ ui_apply_but_IDPOIN(C, but, data);
+ break;
+#ifdef INTERNATIONAL
+ case CHARTAB:
+ ui_apply_but_CHARTAB(C, but, data);
+ break;
+#endif
+ case LINK:
+ case INLINK:
+ break;
+ }
+
+ but->editstr= editstr;
+ but->editval= editval;
+ but->editvec= editvec;
+ but->editcoba= editcoba;
+ but->editcumap= editcumap;
+}
+
+/* ******************* copy and paste ******************** */
+
+/* c = copy, v = paste */
+static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, char mode)
+{
+ static ColorBand but_copypaste_coba = {0};
+ char buf[UI_MAX_DRAW_STR+1]= {0};
+ double val;
+
+ if(mode=='v' && but->lock)
+ return;
+
+ if(mode=='v') {
+ /* extract first line from clipboard in case of multi-line copies */
+ char *p = NULL; /* XXX 2.48 getClipboard(0); */
+ if(p) {
+ int i = 0;
+ while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR) {
+ buf[i++]=*p;
+ p++;
+ }
+ buf[i]= 0;
+ }
+ }
+
+ /* numeric value */
+ if ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI) {
+
+ if(but->poin==NULL && but->rnapoin.data==NULL);
+ else if(mode=='c') {
+ sprintf(buf, "%f", ui_get_but_val(but));
+ /* XXX 2.48 putClipboard(buf, 0); */
+ }
+ else {
+ if (sscanf(buf, " %lf ", &val) == 1) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ data->value= val;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ }
+ }
+
+ /* RGB triple */
+ else if(but->type==COL) {
+ float rgb[3];
+
+ if(but->poin==NULL && but->rnapoin.data==NULL);
+ else if(mode=='c') {
+
+ ui_get_but_vectorf(but, rgb);
+ sprintf(buf, "[%f, %f, %f]", rgb[0], rgb[1], rgb[2]);
+ /* XXX 2.48 putClipboard(buf, 0); */
+
+ }
+ else {
+ if (sscanf(buf, "[%f, %f, %f]", &rgb[0], &rgb[1], &rgb[2]) == 3) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ VECCOPY(data->vec, rgb);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ }
+ }
+
+ /* text/string and ID data */
+ else if(ELEM(but->type, TEX, IDPOIN)) {
+ uiHandleButtonData *data= but->active;
+
+ if(but->poin==NULL && but->rnapoin.data==NULL);
+ else if(mode=='c') {
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ BLI_strncpy(buf, data->str, UI_MAX_DRAW_STR);
+ /* XXX 2.48 putClipboard(data->str, 0); */
+ data->cancel= 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else {
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ BLI_strncpy(data->str, buf, data->maxlen);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ }
+ /* colorband (not supported by system clipboard) */
+ else if(but->type==BUT_COLORBAND) {
+ if(mode=='c') {
+ if(but->poin)
+ return;
+
+ memcpy(&but_copypaste_coba, but->poin, sizeof(ColorBand));
+ }
+ else {
+ if(but_copypaste_coba.tot==0)
+ return;
+
+ if(!but->poin)
+ but->poin= MEM_callocN(sizeof(ColorBand), "colorband");
+
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ memcpy(data->coba, &but_copypaste_coba, sizeof(ColorBand) );
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ }
+}
+
+/* ************* in-button text selection/editing ************* */
+
+/* return 1 if char ch is special character, otherwise return 0 */
+static short test_special_char(char ch)
+{
+ switch(ch) {
+ case '\\':
+ case '/':
+ case '~':
+ case '!':
+ case '@':
+ case '#':
+ case '$':
+ case '%':
+ case '^':
+ case '&':
+ case '*':
+ case '(':
+ case ')':
+ case '+':
+ case '=':
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case ':':
+ case ';':
+ case '\'':
+ case '\"':
+ case '<':
+ case '>':
+ case ',':
+ case '.':
+ case '?':
+ case '_':
+ case '-':
+ case ' ':
+ return 1;
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
+{
+ char *str;
+ int x, changed;
+
+ str= data->str;
+ changed= (but->selsta != but->selend);
+
+ for(x=0; x< strlen(str); x++) {
+ if (but->selend + x <= strlen(str) ) {
+ str[but->selsta + x]= str[but->selend + x];
+ } else {
+ str[but->selsta + x]= '\0';
+ break;
+ }
+ }
+
+ but->pos = but->selend = but->selsta;
+
+ return changed;
+}
+
+static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x)
+{
+ char *origstr;
+
+ origstr= MEM_callocN(sizeof(char)*(data->maxlen+1), "ui_textedit origstr");
+
+ BLI_strncpy(origstr, but->drawstr, data->maxlen+1);
+ but->pos= strlen(origstr)-but->ofs;
+
+ while((but->aspect*UI_GetStringWidth(but->font, origstr+but->ofs, 0) + but->x1) > x) {
+ if (but->pos <= 0) break;
+ but->pos--;
+ origstr[but->pos+but->ofs] = 0;
+ }
+
+ but->pos -= strlen(but->str);
+ but->pos += but->ofs;
+ if(but->pos<0) but->pos= 0;
+
+ MEM_freeN(origstr);
+}
+
+static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data, short x)
+{
+ if (x > data->selstartx) data->selextend = EXTEND_RIGHT;
+ else if (x < data->selstartx) data->selextend = EXTEND_LEFT;
+
+ ui_textedit_set_cursor_pos(but, data, x);
+
+ if (data->selextend == EXTEND_RIGHT) but->selend = but->pos;
+ if (data->selextend == EXTEND_LEFT) but->selsta = but->pos;
+
+ ui_check_but(but);
+}
+
+static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
+{
+ char *str;
+ int len, x, changed= 0;
+
+ str= data->str;
+ len= strlen(str);
+
+ if(len-(but->selend - but->selsta)+1 <= data->maxlen) {
+ /* type over the current selection */
+ if ((but->selend - but->selsta) > 0)
+ changed= ui_textedit_delete_selection(but, data);
+
+ len= strlen(str);
+ if(len < data->maxlen) {
+ for(x= data->maxlen; x>but->pos; x--)
+ str[x]= str[x-1];
+ str[but->pos]= ascii;
+ str[len+1]= '\0';
+
+ but->pos++;
+ changed= 1;
+ }
+ }
+
+ return WM_UI_HANDLER_BREAK;
+}
+
+void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump)
+{
+ char *str;
+ int len;
+
+ str= data->str;
+ len= strlen(str);
+
+ if(direction) { /* right*/
+ /* if there's a selection */
+ if ((but->selend - but->selsta) > 0) {
+ /* extend the selection based on the first direction taken */
+ if(select) {
+ if (!data->selextend) {
+ data->selextend = EXTEND_RIGHT;
+ }
+ if (data->selextend == EXTEND_RIGHT) {
+ but->selend++;
+ if (but->selend > len) but->selend = len;
+ } else if (data->selextend == EXTEND_LEFT) {
+ but->selsta++;
+ /* if the selection start has gone past the end,
+ * flip them so they're in sync again */
+ if (but->selsta == but->selend) {
+ but->pos = but->selsta;
+ data->selextend = EXTEND_RIGHT;
+ }
+ }
+ } else {
+ but->selsta = but->pos = but->selend;
+ data->selextend = 0;
+ }
+ } else {
+ if(select) {
+ /* make a selection, starting from the cursor position */
+ but->selsta = but->pos;
+
+ but->pos++;
+ if(but->pos>strlen(str)) but->pos= strlen(str);
+
+ but->selend = but->pos;
+ } else if(jump) {
+ /* jump betweenn special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while(but->pos < len) {
+ but->pos++;
+ if(test_special_char(str[but->pos])) break;
+ }
+ } else {
+ but->pos++;
+ if(but->pos>strlen(str)) but->pos= strlen(str);
+ }
+ }
+ }
+ else { /* left */
+ /* if there's a selection */
+ if ((but->selend - but->selsta) > 0) {
+ /* extend the selection based on the first direction taken */
+ if(select) {
+ if (!data->selextend) {
+ data->selextend = EXTEND_LEFT;
+ }
+ if (data->selextend == EXTEND_LEFT) {
+ but->selsta--;
+ if (but->selsta < 0) but->selsta = 0;
+ } else if (data->selextend == EXTEND_RIGHT) {
+ but->selend--;
+ /* if the selection start has gone past the end,
+ * flip them so they're in sync again */
+ if (but->selsta == but->selend) {
+ but->pos = but->selsta;
+ data->selextend = EXTEND_LEFT;
+ }
+ }
+ } else {
+ but->pos = but->selend = but->selsta;
+ data->selextend = 0;
+ }
+ } else {
+ if(select) {
+ /* make a selection, starting from the cursor position */
+ but->selend = but->pos;
+
+ but->pos--;
+ if(but->pos<0) but->pos= 0;
+
+ but->selsta = but->pos;
+ } else if(jump) {
+ /* jump betweenn special characters (/,\,_,-, etc.),
+ * look at function test_special_char() for complete
+ * list of special character, ctr -> */
+ while(but->pos > 0){
+ but->pos--;
+ if(test_special_char(str[but->pos])) break;
+ }
+ } else {
+ if(but->pos>0) but->pos--;
+ }
+ }
+ }
+}
+
+void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select)
+{
+ char *str;
+
+ str= data->str;
+
+ if(direction) { /* right */
+ if(select) {
+ but->selsta = but->pos;
+ but->selend = strlen(str);
+ data->selextend = EXTEND_RIGHT;
+ } else {
+ but->selsta = but->selend = but->pos= strlen(str);
+ }
+ }
+ else { /* left */
+ if(select) {
+ but->selend = but->pos;
+ but->selsta = 0;
+ data->selextend = EXTEND_LEFT;
+ } else {
+ but->selsta = but->selend = but->pos= 0;
+ }
+ }
+}
+
+static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, int all)
+{
+ char *str;
+ int len, x, changed= 0;
+
+ str= data->str;
+ len= strlen(str);
+
+ if(all) {
+ if(len) changed=1;
+ str[0]= 0;
+ but->pos= 0;
+ }
+ else if(direction) { /* delete */
+ if ((but->selend - but->selsta) > 0) {
+ changed= ui_textedit_delete_selection(but, data);
+ }
+ else if(but->pos>=0 && but->pos<len) {
+ for(x=but->pos; x<len; x++)
+ str[x]= str[x+1];
+ str[len-1]='\0';
+ changed= 1;
+ }
+ }
+ else { /* backspace */
+ if(len!=0) {
+ if ((but->selend - but->selsta) > 0) {
+ ui_textedit_delete_selection(but, data);
+ }
+ else if(but->pos>0) {
+ for(x=but->pos; x<len; x++)
+ str[x-1]= str[x];
+ str[len-1]='\0';
+
+ but->pos--;
+ changed= 1;
+ }
+ }
+ }
+
+ return changed;
+}
+
+static int ui_textedit_autocomplete(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ char *str;
+ int changed= 1;
+
+ str= data->str;
+ but->autocomplete_func(C, str, but->autofunc_arg);
+ but->pos= strlen(str);
+
+ return changed;
+}
+
+static int ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, int paste, int copy, int cut)
+{
+ char buf[UI_MAX_DRAW_STR]={0};
+ char *str, *p;
+ int len, x, y, i, changed= 0;
+
+ str= data->str;
+ len= strlen(str);
+
+ /* paste */
+ if (paste) {
+ /* extract the first line from the clipboard */
+ p = NULL; /* XXX 2.48 getClipboard(0); */
+
+ if(p && p[0]) {
+ while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR) {
+ buf[i++]=*p;
+ p++;
+ }
+ buf[i]= 0;
+
+ /* paste over the current selection */
+ if ((but->selend - but->selsta) > 0)
+ ui_textedit_delete_selection(but, data);
+
+ for (y=0; y<strlen(buf); y++)
+ {
+ /* add contents of buffer */
+ if(len < data->maxlen) {
+ for(x= data->maxlen; x>but->pos; x--)
+ str[x]= str[x-1];
+ str[but->pos]= buf[y];
+ but->pos++;
+ len++;
+ str[len]= '\0';
+ }
+ }
+
+ changed= 1;
+ }
+ }
+ /* cut & copy */
+ else if (copy || cut) {
+ /* copy the contents to the copypaste buffer */
+ for(x= but->selsta; x <= but->selend; x++) {
+ if (x==but->selend)
+ buf[x] = '\0';
+ else
+ buf[(x - but->selsta)] = str[x];
+ }
+ /* XXX 2.48 putClipboard(buf, 0); */
+
+ /* for cut only, delete the selection afterwards */
+ if(cut)
+ if((but->selend - but->selsta) > 0)
+ changed= ui_textedit_delete_selection(but, data);
+ }
+
+ return changed;
+}
+
+static void ui_textedit_begin(uiBut *but, uiHandleButtonData *data)
+{
+ if(data->str) {
+ MEM_freeN(data->str);
+ data->str= NULL;
+ }
+
+ /* retrieve string */
+ if(but->type == TEX) {
+ data->maxlen= but->max;
+ data->str= MEM_callocN(sizeof(char)*(data->maxlen+1), "textedit str");
+
+ ui_get_but_string(but, data->str, data->maxlen+1);
+ }
+ else if(but->type == IDPOIN) {
+ ID *id;
+
+ data->maxlen= 22;
+ data->str= MEM_callocN(sizeof(char)*(data->maxlen+1), "textedit str");
+
+ id= *but->idpoin_idpp;
+ if(id) BLI_strncpy(data->str, id->name+2, data->maxlen+1);
+ else data->str[0]= 0;
+ }
+ else {
+ double value;
+
+ data->maxlen= UI_MAX_DRAW_STR;
+ data->str= MEM_callocN(sizeof(char)*(data->maxlen+1), "textedit str");
+
+ value= ui_get_but_val(but);
+ if(ui_is_but_float(but)) {
+ if(but->a2) { /* amount of digits defined */
+ if(but->a2==1) sprintf(data->str, "%.1f", value);
+ else if(but->a2==2) sprintf(data->str, "%.2f", value);
+ else if(but->a2==3) sprintf(data->str, "%.3f", value);
+ else sprintf(data->str, "%.4f", value);
+ }
+ else sprintf(data->str, "%.3f", value);
+ }
+ else {
+ sprintf(data->str, "%d", (int)value);
+ }
+ }
+
+ data->origstr= BLI_strdup(data->str);
+ data->selextend= 0;
+ data->selstartx= 0;
+
+ /* set cursor pos to the end of the text */
+ but->editstr= data->str;
+ but->pos= strlen(data->str);
+ but->selsta= 0;
+ but->selend= strlen(but->drawstr) - strlen(but->str);
+
+ ui_check_but(but);
+}
+
+static void ui_textedit_end(uiBut *but, uiHandleButtonData *data)
+{
+ if(but) {
+ but->editstr= 0;
+ but->pos= -1;
+ }
+}
+
+static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonData *data)
+{
+ uiBut *but;
+
+ /* label and roundbox can overlap real buttons (backdrops...) */
+ if(actbut->type==LABEL && actbut->type==ROUNDBOX)
+ return;
+
+ for(but= actbut->next; but; but= but->next) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
+ }
+ for(but= block->buttons.first; but!=actbut; but= but->next) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
+ }
+}
+
+static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonData *data)
+{
+ uiBut *but;
+
+ /* label and roundbox can overlap real buttons (backdrops...) */
+ if(actbut->type==LABEL && actbut->type==ROUNDBOX)
+ return;
+
+ for(but= actbut->prev; but; but= but->prev) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
+ }
+ for(but= block->buttons.last; but!=actbut; but= but->prev) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_TEXT_EDITING;
+ return;
+ }
+ }
+}
+
+static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my, changed= 0, retval= WM_UI_HANDLER_CONTINUE;
+
+ switch(event->type) {
+ case RIGHTMOUSE:
+ case ESCKEY:
+ data->cancel= 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case LEFTMOUSE: {
+ if(event->val) {
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if ((but->y1 <= my) && (my <= but->y2) && (but->x1 <= mx) && (mx <= but->x2)) {
+ ui_textedit_set_cursor_pos(but, data, mx);
+ but->selsta = but->selend = but->pos;
+ data->selstartx= mx;
+
+ button_activate_state(C, but, BUTTON_STATE_TEXT_SELECTING);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else {
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ }
+ break;
+ }
+ }
+
+ if(event->val) {
+ switch (event->type) {
+ case VKEY:
+ case XKEY:
+ case CKEY:
+ if(event->ctrl || event->oskey) {
+ if(event->type == VKEY)
+ changed= ui_textedit_copypaste(but, data, 1, 0, 0);
+ else if(event->type == XKEY)
+ changed= ui_textedit_copypaste(but, data, 0, 1, 0);
+ else if(event->type == CKEY)
+ changed= ui_textedit_copypaste(but, data, 0, 0, 1);
+
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ break;
+ case RIGHTARROWKEY:
+ ui_textedit_move(but, data, 1, event->shift, event->ctrl);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case LEFTARROWKEY:
+ ui_textedit_move(but, data, 0, event->shift, event->ctrl);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case DOWNARROWKEY:
+ case ENDKEY:
+ ui_textedit_move_end(but, data, 1, event->shift);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case UPARROWKEY:
+ case HOMEKEY:
+ ui_textedit_move_end(but, data, 0, event->shift);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case PADENTER:
+ case RETKEY:
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ case DELKEY:
+ changed= ui_textedit_delete(but, data, 1, 0);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+
+ case BACKSPACEKEY:
+ changed= ui_textedit_delete(but, data, 0, event->shift);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+
+ case TABKEY:
+ /* there is a key conflict here, we can't tab with autocomplete */
+ if(but->autocomplete_func) {
+ changed= ui_textedit_autocomplete(C, but, data);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ /* the hotkey here is not well defined, was G.qual so we check all */
+ else if(event->shift || event->ctrl || event->alt || event->oskey) {
+ ui_textedit_prev_but(block, but, data);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else {
+ ui_textedit_next_but(block, but, data);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ }
+
+ if(event->ascii && (retval == WM_UI_HANDLER_CONTINUE)) {
+ changed= ui_textedit_type_ascii(but, data, event->ascii);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ if(changed) {
+ if(data->interactive) ui_apply_button(C, block, but, data, 1);
+ else ui_check_but(but);
+ }
+
+ if(changed || (retval == WM_UI_HANDLER_BREAK))
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+}
+
+static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my, retval= WM_UI_HANDLER_CONTINUE;
+
+ switch(event->type) {
+ case MOUSEMOVE: {
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ ui_textedit_set_cursor_select(but, data, mx);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ }
+ case LEFTMOUSE:
+ if(event->val == 0)
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ }
+
+ if(retval == WM_UI_HANDLER_BREAK) {
+ ui_check_but(but);
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+}
+
+/* ************* number editing for various types ************* */
+
+static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
+{
+ float butrange;
+
+ if(but->type == BUT_CURVE) {
+ data->cumap= (CurveMapping*)but->poin;
+ but->editcumap= data->coba;
+ }
+ else if(but->type == BUT_COLORBAND) {
+ data->coba= (ColorBand*)but->poin;
+ but->editcoba= data->coba;
+ }
+ else if(ELEM(but->type, BUT_NORMAL, HSVCUBE)) {
+ ui_get_but_vectorf(but, data->origvec);
+ VECCOPY(data->vec, data->origvec);
+ but->editvec= data->vec;
+ }
+ else {
+ data->origvalue= ui_get_but_val(but);
+ data->value= data->origvalue;
+ but->editval= &data->value;
+
+ butrange= (but->max - but->min);
+ data->dragfstart= (butrange == 0.0)? 0.0f: (data->value - but->min)/butrange;
+ data->dragf= data->dragfstart;
+ }
+
+ data->dragchange= 0;
+ data->draglock= 1;
+}
+
+static void ui_numedit_end(uiBut *but, uiHandleButtonData *data)
+{
+ but->editval= NULL;
+ but->editvec= NULL;
+ but->editcoba= NULL;
+ but->editcumap= NULL;
+
+ data->dragstartx= 0;
+ data->draglastx= 0;
+ data->dragchange= 0;
+ data->dragcbd= NULL;
+ data->dragsel= 0;
+}
+
+static void ui_numedit_apply(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data)
+{
+ if(data->interactive) ui_apply_button(C, block, but, data, 1);
+ else ui_check_but(but);
+
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+}
+
+/* ****************** menu opening for various types **************** */
+
+static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ uiBlockFuncFP func= NULL;
+ void *arg= NULL;
+
+ switch(but->type) {
+ case BLOCK:
+ case PULLDOWN:
+ func= but->block_func;
+ arg= but->poin;
+ break;
+ case MENU:
+ data->origvalue= ui_get_but_val(but);
+ data->value= data->origvalue;
+ but->editval= &data->value;
+
+ func= ui_block_func_MENU;
+ arg= but;
+ break;
+ case ICONROW:
+ func= ui_block_func_ICONROW;
+ arg= but;
+ break;
+ case ICONTEXTROW:
+ func= ui_block_func_ICONTEXTROW;
+ arg= but;
+ break;
+ case COL:
+ ui_get_but_vectorf(but, data->origvec);
+ VECCOPY(data->vec, data->origvec);
+ but->editvec= data->vec;
+
+ func= ui_block_func_COL;
+ arg= but;
+ break;
+ }
+
+ if(func) {
+ data->menu= MEM_callocN(sizeof(uiHandleMenuData), "uiHandleMenuData");
+ data->menu->handle= ui_menu_block_create(C, data->region, but, func, arg);
+ }
+
+ /* this makes adjacent blocks auto open from now on */
+ if(but->block->auto_open==0) but->block->auto_open= 1;
+}
+
+static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
+{
+ if(but) {
+ but->editval= NULL;
+ but->editvec= NULL;
+
+ but->block->auto_open_last= PIL_check_seconds_timer();
+ }
+
+ if(data->menu) {
+ ui_menu_block_free(C, data->menu->handle);
+ MEM_freeN(data->menu);
+ data->menu= NULL;
+ }
+}
+
+/* ***************** events for different button types *************** */
+
+static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->type == LEFTMOUSE && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_RELEASE);
+ return WM_UI_HANDLER_BREAK;
+ }
+ else if(ELEM(event->type, PADENTER, RETKEY) && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
+ if(event->type == LEFTMOUSE && event->val==0) {
+ if(!(but->flag & UI_SELECT))
+ data->cancel= 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_WAIT_KEY_EVENT) {
+ if(event->type == MOUSEMOVE)
+ return WM_UI_HANDLER_CONTINUE;
+
+ /* XXX 2.50 missing function */
+#if 0
+ if(event->val) {
+ if(!key_event_to_string(event)[0])
+ data->cancel= 1;
+ else
+ ui_set_but_val(but, event->type);
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+#endif
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ ui_do_but_textedit(C, block, but, data, event);
+ return WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ ui_do_but_textedit_select(C, block, but, data, event);
+ return WM_UI_HANDLER_BREAK;
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ data->togdual= event->ctrl;
+ data->togonly= !event->shift;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, int snap, int mx)
+{
+ float deler, tempf;
+ int lvalue, temp, changed= 0;
+
+ if(mx == data->draglastx)
+ return changed;
+
+ /* drag-lock - prevent unwanted scroll adjustments */
+ /* change value (now 3) to adjust threshold in pixels */
+ if(data->draglock) {
+ if(abs(mx-data->dragstartx) <= 3)
+ return changed;
+
+ data->draglock= 0;
+ data->dragstartx= mx; /* ignore mouse movement within drag-lock */
+ }
+
+ deler= 500;
+ if(!ui_is_but_float(but)) {
+ if((but->max-but->min)<100) deler= 200.0;
+ if((but->max-but->min)<25) deler= 50.0;
+ }
+ deler /= fac;
+
+ if(ui_is_but_float(but) && but->max-but->min > 11) {
+ /* non linear change in mouse input- good for high precicsion */
+ data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.002);
+ } else if (!ui_is_but_float(but) && but->max-but->min > 129) { /* only scale large int buttons */
+ /* non linear change in mouse input- good for high precicsionm ints need less fine tuning */
+ data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.004);
+ } else {
+ /*no scaling */
+ data->dragf+= ((float)(mx-data->draglastx))/deler ;
+ }
+
+ if(data->dragf>1.0) data->dragf= 1.0;
+ if(data->dragf<0.0) data->dragf= 0.0;
+ data->draglastx= mx;
+ tempf= ( but->min + data->dragf*(but->max-but->min));
+
+ if(!ui_is_but_float(but)) {
+
+ temp= floor(tempf+.5);
+
+ if(tempf==but->min || tempf==but->max);
+ else if(snap) {
+ if(snap == 2) temp= 100*(temp/100);
+ else temp= 10*(temp/10);
+ }
+ if( temp>=but->min && temp<=but->max) {
+ lvalue= (int)data->value;
+
+ if(temp != lvalue ) {
+ data->dragchange= 1;
+ data->value= (double)temp;
+ changed= 1;
+ }
+ }
+
+ }
+ else {
+ temp= 0;
+ if(snap) {
+ if(snap == 2) {
+ if(tempf==but->min || tempf==but->max);
+ else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf);
+ else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf);
+ else tempf= floor(tempf);
+ }
+ else {
+ if(tempf==but->min || tempf==but->max);
+ else if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf);
+ else if(but->max-but->min < 21.0) tempf= floor(tempf);
+ else tempf= 10.0*floor(tempf/10.0);
+ }
+ }
+
+ if( tempf>=but->min && tempf<=but->max) {
+ if(tempf != data->value) {
+ data->dragchange= 1;
+ data->value= tempf;
+ changed= 1;
+ }
+ }
+ }
+
+ return changed;
+}
+
+static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my, click= 0;
+ int retval= WM_UI_HANDLER_CONTINUE;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->val) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->shift) {
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(event->type == LEFTMOUSE) {
+ data->dragstartx= mx;
+ data->draglastx= mx;
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(ELEM(event->type, PADENTER, RETKEY) && event->val)
+ click= 1;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == LEFTMOUSE && event->val==0) {
+ if(data->dragchange)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ else
+ click= 1;
+ }
+ else if(event->type == MOUSEMOVE) {
+ float fac;
+ int snap;
+
+ fac= 1.0f;
+ if(event->shift) fac /= 10.0f;
+ if(event->alt) fac /= 20.0f;
+
+ if(event->custom == EVT_DATA_TABLET) {
+ wmTabletData *wmtab= event->customdata;
+
+ /* de-sensitise based on tablet pressure */
+ if (ELEM(wmtab->Active, DEV_STYLUS, DEV_ERASER))
+ fac *= wmtab->Pressure;
+ }
+
+ snap= (event->ctrl)? (event->shift)? 2: 1: 0;
+
+ if(ui_numedit_but_NUM(but, data, fac, snap, mx))
+ ui_numedit_apply(C, block, but, data);
+ }
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ ui_do_but_textedit(C, block, but, data, event);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ ui_do_but_textedit_select(C, block, but, data, event);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+
+ if(click) {
+ /* we can click on the side arrows to increment/decrement,
+ * or click inside to edit the value directly */
+ float tempf;
+ int temp;
+
+ if(!ui_is_but_float(but)) {
+ if(mx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ temp= (int)data->value - 1;
+ if(temp>=but->min && temp<=but->max)
+ data->value= (double)temp;
+ else
+ data->cancel= 1;
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else if(mx > (but->x1 + (2*(but->x2 - but->x1)/3) + 3)) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ temp= (int)data->value + 1;
+ if(temp>=but->min && temp<=but->max)
+ data->value= (double)temp;
+ else
+ data->cancel= 1;
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ }
+ else {
+ if(mx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ tempf= data->value - 0.01*but->a1;
+ if (tempf < but->min) tempf = but->min;
+ data->value= tempf;
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else if(mx > but->x1 + (2*((but->x2 - but->x1)/3) + 3)) {
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ tempf= data->value + 0.01*but->a1;
+ if (tempf < but->min) tempf = but->min;
+ data->value= tempf;
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ }
+
+ retval= WM_UI_HANDLER_BREAK;
+ }
+
+ return retval;
+}
+
+static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, int shift, int ctrl, int mx)
+{
+ float deler, f, tempf;
+ int temp, lvalue, changed= 0;
+
+ if(but->type==NUMSLI) deler= ((but->x2-but->x1)/2 - 5.0*but->aspect);
+ else if(but->type==HSVSLI) deler= ((but->x2-but->x1)/2 - 5.0*but->aspect);
+ else deler= (but->x2-but->x1- 5.0*but->aspect);
+
+ f= (float)(mx-data->dragstartx)/deler + data->dragfstart;
+
+ if(shift)
+ f= (f-data->dragfstart)/10.0 + data->dragfstart;
+
+ CLAMP(f, 0.0, 1.0);
+ tempf= but->min+f*(but->max-but->min);
+ temp= floor(tempf+.5);
+
+ if(ctrl) {
+ if(tempf==but->min || tempf==but->max);
+ else if(ui_is_but_float(but)) {
+
+ if(shift) {
+ if(tempf==but->min || tempf==but->max);
+ else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf);
+ else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf);
+ else tempf= floor(tempf);
+ }
+ else {
+ if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf);
+ else if(but->max-but->min < 21.0) tempf= floor(tempf);
+ else tempf= 10.0*floor(tempf/10.0);
+ }
+ }
+ else {
+ temp= 10*(temp/10);
+ tempf= temp;
+ }
+ }
+
+ if(!ui_is_but_float(but)) {
+ lvalue= floor(data->value+0.5);
+
+ if(temp != lvalue) {
+ data->value= temp;
+ data->dragchange= 1;
+ changed= 1;
+ }
+ }
+ else {
+ if(tempf != data->value) {
+ data->value= tempf;
+ data->dragchange= 1;
+ changed= 1;
+ }
+ }
+
+ return changed;
+}
+
+static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my, click= 0;
+ int retval= WM_UI_HANDLER_CONTINUE;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ /* start either dragging as slider, or editing as text */
+ if(mx>= -6+(but->x1+but->x2)/2) {
+ if(event->type == LEFTMOUSE) {
+ data->dragstartx= mx;
+ data->draglastx= mx;
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ }
+ else
+ click= 1;
+ }
+ else
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == LEFTMOUSE && event->val==0) {
+ if(data->dragchange)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ else
+ click= 1;
+ }
+ else if(event->type == MOUSEMOVE) {
+ if(ui_numedit_but_SLI(but, data, event->shift, event->ctrl, mx))
+ ui_numedit_apply(C, block, but, data);
+ }
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_TEXT_EDITING) {
+ ui_do_but_textedit(C, block, but, data, event);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_TEXT_SELECTING) {
+ ui_do_but_textedit_select(C, block, but, data, event);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+
+ if(click) {
+ float f, h;
+ float tempf;
+ int temp;
+
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ tempf= data->value;
+ temp= (int)data->value;
+
+ h= but->y2-but->y1;
+
+ if(but->type==SLI) f= (float)(mx-but->x1)/(but->x2-but->x1-h);
+ else f= (float)(mx- (but->x1+but->x2)/2)/((but->x2-but->x1)/2 - h);
+
+ f= but->min+f*(but->max-but->min);
+
+ if(!ui_is_but_float(but)) {
+ if(f<temp) temp--;
+ else temp++;
+
+ if(temp>=but->min && temp<=but->max)
+ data->value= temp;
+ else
+ data->cancel= 1;
+ }
+ else {
+ if(f<tempf) tempf-=.01;
+ else tempf+=.01;
+
+ if(tempf>=but->min && tempf<=but->max)
+ data->value= tempf;
+ else
+ data->cancel= 1;
+ }
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+
+ return retval;
+}
+
+static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, int my)
+{
+ float dx, dy, rad, radsq, mrad, *fp;
+ int mdx, mdy, changed= 1;
+
+ /* button is presumed square */
+ /* if mouse moves outside of sphere, it does negative normal */
+
+ fp= data->origvec;
+ rad= (but->x2 - but->x1);
+ radsq= rad*rad;
+
+ if(fp[2]>0.0f) {
+ mdx= (rad*fp[0]);
+ mdy= (rad*fp[1]);
+ }
+ else if(fp[2]> -1.0f) {
+ mrad= rad/sqrt(fp[0]*fp[0] + fp[1]*fp[1]);
+
+ mdx= 2.0f*mrad*fp[0] - (rad*fp[0]);
+ mdy= 2.0f*mrad*fp[1] - (rad*fp[1]);
+ }
+ else mdx= mdy= 0;
+
+ dx= (float)(mx+mdx-data->dragstartx);
+ dy= (float)(my+mdy-data->dragstarty);
+
+ fp= data->vec;
+ mrad= dx*dx+dy*dy;
+ if(mrad < radsq) { /* inner circle */
+ fp[0]= dx;
+ fp[1]= dy;
+ fp[2]= sqrt( radsq-dx*dx-dy*dy );
+ }
+ else { /* outer circle */
+
+ mrad= rad/sqrt(mrad); // veclen
+
+ dx*= (2.0f*mrad - 1.0f);
+ dy*= (2.0f*mrad - 1.0f);
+
+ mrad= dx*dx+dy*dy;
+ if(mrad < radsq) {
+ fp[0]= dx;
+ fp[1]= dy;
+ fp[2]= -sqrt( radsq-dx*dx-dy*dy );
+ }
+ }
+ Normalize(fp);
+
+ data->draglastx= mx;
+ data->draglasty= my;
+
+ return changed;
+}
+
+static int ui_do_but_NORMAL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->type==LEFTMOUSE && event->val) {
+ data->dragstartx= mx;
+ data->dragstarty= my;
+ data->draglastx= mx;
+ data->draglasty= my;
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ /* also do drag the first time */
+ if(ui_numedit_but_NORMAL(but, data, mx, my))
+ ui_numedit_apply(C, block, but, data);
+
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == MOUSEMOVE) {
+ if(mx!=data->draglastx || my!=data->draglasty) {
+ if(ui_numedit_but_NORMAL(but, data, mx, my))
+ ui_numedit_apply(C, block, but, data);
+ }
+ }
+ else if(event->type==LEFTMOUSE && event->val==0)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+
+ return WM_UI_HANDLER_BREAK;
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, int my)
+{
+ float x, y;
+ int changed= 1;
+
+ /* relative position within box */
+ x= ((float)mx-but->x1)/(but->x2-but->x1);
+ y= ((float)my-but->y1)/(but->y2-but->y1);
+ CLAMP(x, 0.0, 1.0);
+ CLAMP(y, 0.0, 1.0);
+
+ if(but->a1==0) {
+ but->hsv[0]= x;
+ but->hsv[2]= y;
+ }
+ else if(but->a1==1) {
+ but->hsv[0]= x;
+ but->hsv[1]= y;
+ }
+ else if(but->a1==2) {
+ but->hsv[2]= x;
+ but->hsv[1]= y;
+ }
+ else
+ but->hsv[0]= x;
+
+ ui_set_but_hsv(but); // converts to rgb
+
+ // update button values and strings
+ ui_update_block_buts_hsv(but->block, but->hsv);
+
+ data->draglastx= mx;
+ data->draglasty= my;
+
+ return changed;
+}
+
+static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->type==LEFTMOUSE && event->val) {
+ data->dragstartx= mx;
+ data->dragstarty= my;
+ data->draglastx= mx;
+ data->draglasty= my;
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
+ /* also do drag the first time */
+ if(ui_numedit_but_HSVCUBE(but, data, mx, my))
+ ui_numedit_apply(C, block, but, data);
+
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == MOUSEMOVE) {
+ if(mx!=data->draglastx || my!=data->draglasty) {
+ if(ui_numedit_but_HSVCUBE(but, data, mx, my))
+ ui_numedit_apply(C, block, but, data);
+ }
+ }
+ else if(event->type==LEFTMOUSE && event->val==0)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+
+ return WM_UI_HANDLER_BREAK;
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int verg_colorband(const void *a1, const void *a2)
+{
+ const CBData *x1=a1, *x2=a2;
+
+ if( x1->pos > x2->pos ) return 1;
+ else if( x1->pos < x2->pos) return -1;
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static void ui_colorband_update(ColorBand *coba)
+{
+ int a;
+
+ if(coba->tot<2) return;
+
+ for(a=0; a<coba->tot; a++) coba->data[a].cur= a;
+ qsort(coba->data, coba->tot, sizeof(CBData), verg_colorband);
+ for(a=0; a<coba->tot; a++) {
+ if(coba->data[a].cur==coba->cur) {
+ coba->cur= a;
+ break;
+ }
+ }
+}
+
+static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx)
+{
+ float dx;
+ int changed= 0;
+
+ if(data->draglastx == mx)
+ return changed;
+
+ dx= ((float)(mx - data->draglastx))/(but->x2-but->x1);
+ data->dragcbd->pos += dx;
+ CLAMP(data->dragcbd->pos, 0.0, 1.0);
+
+ ui_colorband_update(data->coba);
+ data->dragcbd= data->coba->data + data->coba->cur; /* because qsort */
+
+ data->draglastx= mx;
+ changed= 1;
+
+ return changed;
+}
+
+static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ ColorBand *coba;
+ CBData *cbd;
+ int mx, my, a, xco, mindist= 12;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->type==LEFTMOUSE && event->val) {
+ coba= (ColorBand*)but->poin;
+
+ if(event->ctrl) {
+ /* insert new key on mouse location */
+ if(coba->tot < MAXCOLORBAND-1) {
+ float pos= ((float)(mx - but->x1))/(but->x2-but->x1);
+ float col[4];
+
+ do_colorband(coba, pos, col); /* executes it */
+
+ coba->tot++;
+ coba->cur= coba->tot-1;
+
+ coba->data[coba->cur].r= col[0];
+ coba->data[coba->cur].g= col[1];
+ coba->data[coba->cur].b= col[2];
+ coba->data[coba->cur].a= col[3];
+ coba->data[coba->cur].pos= pos;
+
+ ui_colorband_update(coba);
+ }
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else {
+ data->dragstartx= mx;
+ data->dragstarty= my;
+ data->draglastx= mx;
+ data->draglasty= my;
+
+ /* activate new key when mouse is close */
+ for(a=0, cbd= coba->data; a<coba->tot; a++, cbd++) {
+ xco= but->x1 + (cbd->pos*(but->x2-but->x1));
+ xco= ABS(xco-mx);
+ if(a==coba->cur) xco+= 5; // selected one disadvantage
+ if(xco<mindist) {
+ coba->cur= a;
+ mindist= xco;
+ }
+ }
+
+ data->dragcbd= coba->data + coba->cur;
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ }
+
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == MOUSEMOVE) {
+ if(mx!=data->draglastx || my!=data->draglasty) {
+ if(ui_numedit_but_COLORBAND(but, data, mx))
+ ui_numedit_apply(C, block, but, data);
+ }
+ }
+ else if(event->type==LEFTMOUSE && event->val==0)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+
+ return WM_UI_HANDLER_BREAK;
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, int mx, int my)
+{
+ CurveMapping *cumap= data->cumap;
+ CurveMap *cuma= cumap->cm+cumap->cur;
+ CurveMapPoint *cmp= cuma->curve;
+ float fx, fy, zoomx, zoomy, offsx, offsy;
+ int a, changed= 0;
+
+ zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
+ zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
+ offsx= cumap->curr.xmin;
+ offsy= cumap->curr.ymin;
+
+ if(data->dragsel != -1) {
+ int moved_point= 0; /* for ctrl grid, can't use orig coords because of sorting */
+
+ fx= (mx-data->draglastx)/zoomx;
+ fy= (my-data->draglasty)/zoomy;
+ for(a=0; a<cuma->totpoint; a++) {
+ if(cmp[a].flag & SELECT) {
+ float origx= cmp[a].x, origy= cmp[a].y;
+ cmp[a].x+= fx;
+ cmp[a].y+= fy;
+ if(snap) {
+ cmp[a].x= 0.125f*floor(0.5f + 8.0f*cmp[a].x);
+ cmp[a].y= 0.125f*floor(0.5f + 8.0f*cmp[a].y);
+ }
+ if(cmp[a].x!=origx || cmp[a].y!=origy)
+ moved_point= 1;
+ }
+ }
+
+ curvemapping_changed(cumap, 0); /* no remove doubles */
+
+ if(moved_point) {
+ data->draglastx= mx;
+ data->draglasty= my;
+ changed= 1;
+ }
+
+ data->dragchange= 1; /* mark for selection */
+ }
+ else {
+ fx= (mx-data->draglastx)/zoomx;
+ fy= (my-data->draglasty)/zoomy;
+
+ /* clamp for clip */
+ if(cumap->flag & CUMA_DO_CLIP) {
+ if(cumap->curr.xmin-fx < cumap->clipr.xmin)
+ fx= cumap->curr.xmin - cumap->clipr.xmin;
+ else if(cumap->curr.xmax-fx > cumap->clipr.xmax)
+ fx= cumap->curr.xmax - cumap->clipr.xmax;
+ if(cumap->curr.ymin-fy < cumap->clipr.ymin)
+ fy= cumap->curr.ymin - cumap->clipr.ymin;
+ else if(cumap->curr.ymax-fy > cumap->clipr.ymax)
+ fy= cumap->curr.ymax - cumap->clipr.ymax;
+ }
+
+ cumap->curr.xmin-=fx;
+ cumap->curr.ymin-=fy;
+ cumap->curr.xmax-=fx;
+ cumap->curr.ymax-=fy;
+
+ data->draglastx= mx;
+ data->draglasty= my;
+
+ changed= 1;
+ }
+
+ return changed;
+}
+
+static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ int mx, my, a, changed= 0;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(event->type==LEFTMOUSE && event->val) {
+ CurveMapping *cumap= (CurveMapping*)but->poin;
+ CurveMap *cuma= cumap->cm+cumap->cur;
+ CurveMapPoint *cmp= cuma->curve;
+ float fx, fy, zoomx, zoomy, offsx, offsy;
+ float dist, mindist= 200.0f; // 14 pixels radius
+ int sel= -1;
+
+ zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
+ zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
+ offsx= cumap->curr.xmin;
+ offsy= cumap->curr.ymin;
+
+ if(event->ctrl) {
+ fx= ((float)my - but->x1)/zoomx + offsx;
+ fy= ((float)my - but->y1)/zoomy + offsy;
+
+ curvemap_insert(cuma, fx, fy);
+ curvemapping_changed(cumap, 0);
+ changed= 1;
+ }
+
+ /* check for selecting of a point */
+ cmp= cuma->curve; /* ctrl adds point, new malloc */
+ for(a=0; a<cuma->totpoint; a++) {
+ fx= but->x1 + zoomx*(cmp[a].x-offsx);
+ fy= but->y1 + zoomy*(cmp[a].y-offsy);
+ dist= (fx-mx)*(fx-mx) + (fy-my)*(fy-my);
+ if(dist < mindist) {
+ sel= a;
+ mindist= dist;
+ }
+ }
+
+ if (sel == -1) {
+ /* if the click didn't select anything, check if it's clicked on the
+ * curve itself, and if so, add a point */
+ fx= ((float)mx - but->x1)/zoomx + offsx;
+ fy= ((float)my - but->y1)/zoomy + offsy;
+
+ cmp= cuma->table;
+
+ /* loop through the curve segment table and find what's near the mouse.
+ * 0.05 is kinda arbitrary, but seems to be what works nicely. */
+ for(a=0; a<=CM_TABLE; a++) {
+ if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) {
+
+ curvemap_insert(cuma, fx, fy);
+ curvemapping_changed(cumap, 0);
+
+ changed= 1;
+
+ /* reset cmp back to the curve points again, rather than drawing segments */
+ cmp= cuma->curve;
+
+ /* find newly added point and make it 'sel' */
+ for(a=0; a<cuma->totpoint; a++)
+ if(cmp[a].x == fx)
+ sel = a;
+
+ break;
+ }
+ }
+ }
+
+ if(sel!= -1) {
+ /* ok, we move a point */
+ /* deselect all if this one is deselect. except if we hold shift */
+ if(event->shift==0 && (cmp[sel].flag & SELECT)==0)
+ for(a=0; a<cuma->totpoint; a++)
+ cmp[a].flag &= ~SELECT;
+ cmp[sel].flag |= SELECT;
+ }
+ else {
+ /* move the view */
+ data->cancel= 1;
+ }
+
+ data->dragsel= sel;
+
+ data->dragstartx= mx;
+ data->dragstarty= my;
+ data->draglastx= mx;
+ data->draglasty= my;
+
+ button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(data->state == BUTTON_STATE_NUM_EDITING) {
+ if(event->type == MOUSEMOVE) {
+ if(mx!=data->draglastx || my!=data->draglasty) {
+ if(ui_numedit_but_CURVE(but, data, event->shift, mx, my))
+ ui_numedit_apply(C, block, but, data);
+ }
+ }
+ else if(event->type==LEFTMOUSE && event->val==0) {
+ if(data->dragsel != -1) {
+ CurveMapping *cumap= data->cumap;
+ CurveMap *cuma= cumap->cm+cumap->cur;
+ CurveMapPoint *cmp= cuma->curve;
+
+ if(!data->dragchange) {
+ /* deselect all, select one */
+ if(event->shift==0) {
+ for(a=0; a<cuma->totpoint; a++)
+ cmp[a].flag &= ~SELECT;
+ cmp[data->dragsel].flag |= SELECT;
+ }
+ }
+ else
+ curvemapping_changed(cumap, 1); /* remove doubles */
+ }
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+
+ return WM_UI_HANDLER_BREAK;
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+#ifdef INTERNATIONAL
+static int ui_do_but_CHARTAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
+{
+ /* XXX 2.50 bad global and state access */
+#if 0
+ float sx, sy, ex, ey;
+ float width, height;
+ float butw, buth;
+ int mx, my, x, y, cs, che;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(data->region, block, &mx, &my);
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val) {
+ /* Calculate the size of the button */
+ width = abs(but->x2 - but->x1);
+ height = abs(but->y2 - but->y1);
+
+ butw = floor(width / 12);
+ buth = floor(height / 6);
+
+ /* Initialize variables */
+ sx = but->x1;
+ ex = but->x1 + butw;
+ sy = but->y1 + height - buth;
+ ey = but->y1 + height;
+
+ cs = G.charstart;
+
+ /* And the character is */
+ x = (int) ((mx / butw) - 0.5);
+ y = (int) (6 - ((my / buth) - 0.5));
+
+ che = cs + (y*12) + x;
+
+ if(che > G.charmax)
+ che = 0;
+
+ if(G.obedit)
+ {
+ do_textedit(0,0,che);
+ }
+
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ else if(ELEM(event->type, WHEELUPMOUSE, PAGEUPKEY)) {
+ for(but= block->buttons.first; but; but= but->next) {
+ if(but->type == CHARTAB) {
+ G.charstart = G.charstart - (12*6);
+ if(G.charstart < 0)
+ G.charstart = 0;
+ if(G.charstart < G.charmin)
+ G.charstart = G.charmin;
+ ui_draw_but(but);
+
+ //Really nasty... to update the num button from the same butblock
+ for(bt= block->buttons.first; bt; bt= bt->next)
+ {
+ if(ELEM(bt->type, NUM, NUMABS)) {
+ ui_check_but(bt);
+ ui_draw_but(bt);
+ }
+ }
+ retval=UI_CONT;
+ break;
+ }
+ }
+
+ return WM_UI_HANDLER_BREAK;
+ }
+ else if(ELEM(event->type, WHEELDOWNMOUSE, PAGEDOWNKEY)) {
+ for(but= block->buttons.first; but; but= but->next)
+ {
+ if(but->type == CHARTAB)
+ {
+ G.charstart = G.charstart + (12*6);
+ if(G.charstart > (0xffff - 12*6))
+ G.charstart = 0xffff - (12*6);
+ if(G.charstart > G.charmax - 12*6)
+ G.charstart = G.charmax - 12*6;
+ ui_draw_but(but);
+
+ for(bt= block->buttons.first; bt; bt= bt->next)
+ {
+ if(ELEM(bt->type, NUM, NUMABS)) {
+ ui_check_but(bt);
+ ui_draw_but(bt);
+ }
+ }
+
+ but->flag |= UI_ACTIVE;
+ retval=UI_RETURN_OK;
+ break;
+ }
+ }
+
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+#endif
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+#endif
+
+static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
+{
+ uiHandleButtonData *data;
+ int retval;
+
+ data= but->active;
+ retval= WM_UI_HANDLER_CONTINUE;
+
+ /* handle copy-paste */
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ if(ELEM(event->type, CKEY, VKEY) && event->val && (event->ctrl || event->oskey)) {
+ ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v');
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ /* verify if we can edit this button */
+ if(ELEM(event->type, LEFTMOUSE, RETKEY)) {
+ if(but->lock) {
+ if(but->lockstr) {
+ WM_report(C, WM_LOG_WARNING, but->lockstr);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+ else if(but->pointype && but->poin==0) {
+ /* there's a pointer needed */
+ WM_reportf(C, WM_LOG_WARNING, "DoButton pointer error: %s", but->str);
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ return WM_UI_HANDLER_BREAK;
+ }
+ }
+
+ switch(but->type) {
+ case BUT:
+ retval= ui_do_but_BUT(C, but, data, event);
+ break;
+ case KEYEVT:
+ retval= ui_do_but_KEYEVT(C, but, data, event);
+ break;
+ case TOG:
+ case TOGR:
+ case ICONTOG:
+ case ICONTOGN:
+ case TOGN:
+ case BUT_TOGDUAL:
+ retval= ui_do_but_TOG(C, but, data, event);
+ break;
+#if 0
+ case SCROLL:
+ /* DrawBut(b, 1); */
+ /* do_scrollbut(b); */
+ /* DrawBut(b,0); */
+ break;
+#endif
+ case NUM:
+ case NUMABS:
+ retval= ui_do_but_NUM(C, block, but, data, event);
+ break;
+ case SLI:
+ case NUMSLI:
+ case HSVSLI:
+ retval= ui_do_but_SLI(C, block, but, data, event);
+ break;
+ case ROUNDBOX:
+ case LABEL:
+ case TOG3:
+ case ROW:
+ retval= ui_do_but_EXIT(C, but, data, event);
+ break;
+ case TEX:
+ case IDPOIN:
+ retval= ui_do_but_TEX(C, block, but, data, event);
+ break;
+ case MENU:
+ retval= ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case ICONROW:
+ retval= ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case ICONTEXTROW:
+ retval= ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case BLOCK:
+ case PULLDOWN:
+ retval= ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case BUTM:
+ retval= ui_do_but_BUT(C, but, data, event);
+ break;
+ case COL:
+ if(but->a1 == -1) // signal to prevent calling up color picker
+ retval= ui_do_but_EXIT(C, but, data, event);
+ else
+ retval= ui_do_but_BLOCK(C, but, data, event);
+ break;
+ case BUT_NORMAL:
+ retval= ui_do_but_NORMAL(C, block, but, data, event);
+ break;
+ case BUT_COLORBAND:
+ retval= ui_do_but_COLORBAND(C, block, but, data, event);
+ break;
+ case BUT_CURVE:
+ retval= ui_do_but_CURVE(C, block, but, data, event);
+ break;
+ case HSVCUBE:
+ retval= ui_do_but_HSVCUBE(C, block, but, data, event);
+ break;
+#ifdef INTERNATIONAL
+ case CHARTAB:
+ retval= ui_do_but_CHARTAB(C, block, but, data, event);
+ break;
+#endif
+ /* XXX 2.50 links not implemented yet */
+#if 0
+ case LINK:
+ case INLINK:
+ retval= retval= ui_do_but_LINK(block, but);
+ break;
+#endif
+ }
+
+ return retval;
+}
+
+/* ************************ button utilities *********************** */
+
+static int ui_but_contains_pt(uiBut *but, int mx, int my)
+{
+ return ((but->x1<mx && but->x2>=mx) && (but->y1<my && but->y2>=my));
+}
+
+static uiBut *ui_but_find_activated(ARegion *ar)
+{
+ uiBlock *block;
+ uiBut *but;
+
+ for(block=ar->uiblocks.first; block; block=block->next)
+ for(but=block->buttons.first; but; but= but->next)
+ if(but->active)
+ return but;
+
+ return NULL;
+}
+
+static void ui_blocks_set_tooltips(ARegion *ar, int enable)
+{
+ uiBlock *block;
+
+ /* we disabled buttons when when they were already shown, and
+ * re-enable them on mouse move */
+ for(block=ar->uiblocks.first; block; block=block->next)
+ block->tooltipdisabled= !enable;
+}
+
+static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
+{
+ uiBlock *block;
+ uiBut *but, *butover= NULL;
+ int mx, my;
+
+ /* check if the mouse is in the region, and in case of a view2d also check
+ * if it is inside the view2d itself, not over scrollbars for example */
+ if(!BLI_in_rcti(&ar->winrct, x, y))
+ return NULL;
+
+ if(ar->v2d.mask.xmin!=ar->v2d.mask.xmax) {
+ mx= x;
+ my= y;
+ ui_window_to_region(ar, &mx, &my);
+
+ if(!BLI_in_rcti(&ar->v2d.mask, mx, my))
+ return NULL;
+ }
+
+ for(block=ar->uiblocks.first; block; block=block->next) {
+ mx= x;
+ my= y;
+ ui_window_to_block(ar, block, &mx, &my);
+
+ for(but=block->buttons.first; but; but= but->next) {
+ /* give precedence to already activated buttons */
+ if(ui_but_contains_pt(but, mx, my))
+ if(!butover || (!butover->active && but->active))
+ butover= but;
+ }
+ }
+
+ return butover;
+}
+
+/* ****************** button state handling **************************/
+
+static int button_modal_state(uiHandleButtonState state)
+{
+ return ELEM6(state, BUTTON_STATE_WAIT_RELEASE, BUTTON_STATE_WAIT_KEY_EVENT,
+ BUTTON_STATE_NUM_EDITING, BUTTON_STATE_TEXT_EDITING,
+ BUTTON_STATE_TEXT_SELECTING, BUTTON_STATE_MENU_OPEN);
+}
+
+static void button_tooltip_timer_start(uiBut *but)
+{
+ uiHandleButtonData *data;
+
+ data= but->active;
+
+ /* XXX 2.50 U missing from context */
+ if(U.flag & USER_TOOLTIPS)
+ if(!data->tooltiptimer && !but->block->tooltipdisabled)
+ data->tooltiptimer= WM_event_add_window_timer(data->window, BUTTON_TOOLTIP_DELAY, ~0);
+}
+
+static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state)
+{
+ uiHandleButtonData *data;
+
+ data= but->active;
+ if(data->state == state)
+ return;
+
+ /* highlight has timers for tooltips and auto open */
+ if(state == BUTTON_STATE_HIGHLIGHT) {
+ but->flag &= ~UI_SELECT;
+
+ button_tooltip_timer_start(but);
+
+ /* automatic open pulldown block timer */
+ if(but->type==BLOCK || but->type==MENU || but->type==PULLDOWN || but->type==ICONTEXTROW) {
+ if(!data->autoopentimer) {
+ int time;
+
+ if(but->block->auto_open==2) time= 1; // test for toolbox
+ else if(but->block->flag & UI_BLOCK_LOOP || but->block->auto_open) time= 5*U.menuthreshold2;
+ else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
+ else time= -1;
+
+ if(time >= 0)
+ data->autoopentimer= WM_event_add_window_timer(data->window, time*20, ~0);
+ }
+ }
+ }
+ else {
+ but->flag |= UI_SELECT;
+
+ if(data->tooltiptimer) {
+ WM_event_remove_window_timer(data->window, data->tooltiptimer);
+ data->tooltiptimer= NULL;
+ }
+ if(data->tooltip) {
+ ui_tooltip_free(C, data->tooltip);
+ data->tooltip= NULL;
+ }
+
+ if(data->autoopentimer) {
+ WM_event_remove_window_timer(data->window, data->autoopentimer);
+ data->autoopentimer= NULL;
+ }
+ }
+
+ /* text editing */
+ if(state == BUTTON_STATE_TEXT_EDITING && data->state != BUTTON_STATE_TEXT_SELECTING)
+ ui_textedit_begin(but, data);
+ else if(data->state == BUTTON_STATE_TEXT_EDITING && state != BUTTON_STATE_TEXT_SELECTING)
+ ui_textedit_end(but, data);
+
+ /* number editing */
+ if(state == BUTTON_STATE_NUM_EDITING)
+ ui_numedit_begin(but, data);
+ else if(data->state == BUTTON_STATE_NUM_EDITING)
+ ui_numedit_end(but, data);
+
+ /* menu open */
+ if(state == BUTTON_STATE_MENU_OPEN)
+ ui_blockopen_begin(C, but, data);
+ else if(data->state == BUTTON_STATE_MENU_OPEN)
+ ui_blockopen_end(C, but, data);
+
+ /* add a short delay before exiting, to ensure there is some feedback */
+ if(state == BUTTON_STATE_WAIT_FLASH) {
+ data->flashtimer= WM_event_add_window_timer(data->window, BUTTON_FLASH_DELAY, ~0);
+ }
+ else if(data->flashtimer) {
+ WM_event_remove_window_timer(data->window, data->flashtimer);
+ data->flashtimer= NULL;
+ }
+
+ /* add a blocking ui handler at the window handler for blocking, modal states */
+ if(button_modal_state(state)) {
+ if(!button_modal_state(data->state))
+ WM_event_add_ui_handler(C, &data->window->handlers, ui_handler_window, NULL);
+ }
+ else {
+ if(button_modal_state(data->state))
+ WM_event_remove_ui_handler(&data->window->handlers);
+ }
+
+ data->state= state;
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+}
+
+static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type)
+{
+ uiHandleButtonData *data;
+
+ /* setup struct */
+ data= MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData");
+ data->window= C->window;
+ data->region= ar;
+ data->interactive= 0;
+ data->state = BUTTON_STATE_INIT;
+
+ /* activate button */
+ but->flag |= UI_ACTIVE;
+ but->active= data;
+
+ /* we disable auto_open in the block after a threshold, because we still
+ * want to allow auto opening adjacent menus even if no button is activated
+ * inbetween going over to the other button, but only for a short while */
+ if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open)
+ if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
+ but->block->auto_open= 0;
+
+ button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
+
+ if(type == BUTTON_ACTIVATE_OPEN)
+ button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
+ else if(type == BUTTON_ACTIVATE_TEXT_EDITING)
+ button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
+ else if(type == BUTTON_ACTIVATE_APPLY)
+ button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
+}
+
+static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *but, int mousemove)
+{
+ uiBlock *block= but->block;
+
+ /* ensure we are in the exit state */
+ if(data->state != BUTTON_STATE_EXIT)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+
+ /* if this button is in a menu, this will set the button return
+ * value to the button value and the menu return value to ok, the
+ * menu return value will be picked up and the menu will close */
+ if(block->handle && !(block->flag & UI_BLOCK_KEEP_OPEN) && !data->cancel) {
+ uiMenuBlockHandle *handle;
+
+ handle= block->handle;
+ handle->butretval= data->retval;
+ handle->menuretval= UI_RETURN_OK;
+ }
+
+ /* apply the button action or value */
+ ui_apply_button(C, block, but, data, 0);
+
+ /* disable tooltips until mousemove */
+ ui_blocks_set_tooltips(data->region, 0);
+
+ /* clean up */
+ if(data->str)
+ MEM_freeN(data->str);
+ if(data->origstr)
+ MEM_freeN(data->origstr);
+
+ /* clean up button */
+ MEM_freeN(but->active);
+ but->active= NULL;
+ but->flag &= ~(UI_ACTIVE|UI_SELECT);
+
+ /* redraw */
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+
+ /* adds empty mousemove in queue for re-init handler, in case mouse is
+ * still over a button. we cannot just check for this ourselfs because
+ * at this point the mouse may be over a button in another region */
+ if(mousemove)
+ WM_event_add_mousemove(C);
+}
+
+void ui_button_active_cancel(const bContext *C, uiBut *but)
+{
+ uiHandleButtonData *data;
+
+ /* this gets called when the button somehow disappears while it is still
+ * active, this is bad for user interaction, but we need to handle this
+ * case cleanly anyway in case it happens */
+ if(but->active) {
+ data= but->active;
+ data->cancel= 1;
+ button_activate_exit((bContext*)C, data, but, 0);
+ }
+}
+
+/************** handle activating a button *************/
+
+static int ui_handle_button_over(bContext *C, wmEvent *event, ARegion *ar)
+{
+ uiBut *but;
+
+ if(event->type == MOUSEMOVE) {
+ but= ui_but_find_mouse_over(ar, event->x, event->y);
+
+ if(but)
+ button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
+ }
+
+ return WM_UI_HANDLER_CONTINUE;
+}
+
+static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type)
+{
+ uiBut *oldbut;
+ uiHandleButtonData *data;
+
+ oldbut= ui_but_find_activated(ar);
+ if(oldbut) {
+ data= oldbut->active;
+ data->cancel= 1;
+ button_activate_exit(C, data, oldbut, 0);
+ }
+
+ button_activate_init(C, ar, but, type);
+}
+
+/************ handle events for an activated button ***********/
+
+static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
+{
+ uiHandleButtonData *data;
+ uiBlock *block;
+ ARegion *ar;
+ uiBut *postbut;
+ uiButtonActivateType posttype;
+ int retval, mx, my;
+
+ data= but->active;
+ block= but->block;
+ ar= data->region;
+
+ retval= WM_UI_HANDLER_CONTINUE;
+
+ if(data->state == BUTTON_STATE_HIGHLIGHT) {
+ switch(event->type) {
+ case MOUSEMOVE:
+ /* verify if we are still over the button, if not exit */
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(ar, block, &mx, &my);
+
+ if(!ui_but_contains_pt(but, mx, my)) {
+ data->cancel= 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ else if(event->x!=event->prevx || event->y!=event->prevy) {
+ /* re-enable tooltip on mouse move */
+ ui_blocks_set_tooltips(ar, 1);
+ button_tooltip_timer_start(but);
+ }
+
+ break;
+ case TIMER: {
+ /* handle tooltip timer */
+ if(event->customdata == data->tooltiptimer) {
+ WM_event_remove_window_timer(data->window, data->tooltiptimer);
+ data->tooltiptimer= NULL;
+
+ if(!data->tooltip) {
+ data->tooltip= ui_tooltip_create(C, data->region, but);
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+ }
+ /* handle menu auto open timer */
+ else if(event->customdata == data->autoopentimer) {
+ WM_event_remove_window_timer(data->window, data->autoopentimer);
+ data->autoopentimer= NULL;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(ar, block, &mx, &my);
+
+ if(ui_but_contains_pt(but, mx, my))
+ button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
+ }
+
+ retval= WM_UI_HANDLER_CONTINUE;
+ break;
+ default:
+ /* handle button type specific events */
+ retval= ui_do_button(C, block, but, event);
+ }
+ }
+ }
+ else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
+ switch(event->type) {
+ case MOUSEMOVE:
+ /* deselect the button when moving the mouse away */
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(ar, block, &mx, &my);
+
+ if(ui_but_contains_pt(but, mx, my)) {
+ if(!(but->flag & UI_SELECT)) {
+ but->flag |= UI_SELECT;
+ data->cancel= 0;
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+ }
+ else {
+ if(but->flag & UI_SELECT) {
+ but->flag &= ~UI_SELECT;
+ data->cancel= 1;
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+ }
+ break;
+ default:
+ /* otherwise catch mouse release event */
+ ui_do_button(C, block, but, event);
+ break;
+ }
+
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ else if(data->state == BUTTON_STATE_WAIT_FLASH) {
+ switch(event->type) {
+ case TIMER: {
+ if(event->customdata == data->flashtimer)
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ }
+
+ retval= WM_UI_HANDLER_CONTINUE;
+ }
+ else if(data->state == BUTTON_STATE_MENU_OPEN) {
+ switch(event->type) {
+ case MOUSEMOVE: {
+ uiBut *bt= ui_but_find_mouse_over(ar, event->x, event->y);
+
+ if(bt && bt->active != data) {
+ data->cancel= 1;
+ button_activate_state(C, but, BUTTON_STATE_EXIT);
+ }
+ break;
+ }
+ }
+
+ ui_do_button(C, block, but, event);
+ retval= WM_UI_HANDLER_CONTINUE;
+ }
+ else {
+ ui_do_button(C, block, but, event);
+ retval= WM_UI_HANDLER_BREAK;
+ }
+
+ if(data->state == BUTTON_STATE_EXIT) {
+ postbut= data->postbut;
+ posttype= data->posttype;
+
+ button_activate_exit(C, data, but, (postbut == NULL));
+
+ /* for jumping to the next button with tab while text editing */
+ if(postbut)
+ button_activate_init(C, ar, postbut, posttype);
+ }
+
+ return retval;
+}
+
+static void ui_handle_button_closed_submenu(bContext *C, uiBut *but)
+{
+ uiHandleButtonData *data;
+ uiMenuBlockHandle *handle;
+
+ data= but->active;
+ handle= data->menu->handle;
+
+ /* copy over return values from the closing menu */
+ if(handle->menuretval == UI_RETURN_OK) {
+ if(but->type == COL)
+ VECCOPY(data->vec, handle->retvec)
+ else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
+ data->value= handle->retvalue;
+ }
+
+ /* now change button state or exit, which will close the submenu */
+ if(ELEM(handle->menuretval, UI_RETURN_OK, UI_RETURN_CANCEL)) {
+ if(handle->menuretval != UI_RETURN_OK)
+ data->cancel= 1;
+
+ button_activate_exit(C, data, but, 1);
+ }
+ else if(handle->menuretval == UI_RETURN_OUT)
+ button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
+}
+
+/* ******************** menu navigation helpers ************** */
+
+static uiBut *ui_but_prev(uiBut *but)
+{
+ while(but->prev) {
+ but= but->prev;
+ if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
+ }
+ return NULL;
+}
+
+static uiBut *ui_but_next(uiBut *but)
+{
+ while(but->next) {
+ but= but->next;
+ if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
+ }
+ return NULL;
+}
+
+static uiBut *ui_but_first(uiBlock *block)
+{
+ uiBut *but;
+
+ but= block->buttons.first;
+ while(but) {
+ if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
+ but= but->next;
+ }
+ return NULL;
+}
+
+static uiBut *ui_but_last(uiBlock *block)
+{
+ uiBut *but;
+
+ but= block->buttons.last;
+ while(but) {
+ if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
+ but= but->prev;
+ }
+ return NULL;
+}
+
+/* ************************* menu handling *******************************/
+
+/* function used to prevent loosing the open menu when using nested pulldowns,
+ * when moving mouse towards the pulldown menu over other buttons that could
+ * steal the highlight from the current button, only checks:
+ *
+ * - while mouse moves in triangular area defined old mouse position and
+ * left/right side of new menu
+ * - only for 1 second
+ */
+
+static void ui_mouse_motion_towards_init(uiHandleMenuData *menu, int mx, int my)
+{
+ if(!menu->dotowards) {
+ menu->dotowards= 1;
+ menu->towardsx= mx;
+ menu->towardsy= my;
+ menu->towardstime= PIL_check_seconds_timer();
+ }
+}
+
+static int ui_mouse_motion_towards_check(uiBlock *block, uiHandleMenuData *menu, int mx, int my)
+{
+ int fac, dx, dy, domx, domy;
+
+ if(!menu->dotowards) return 0;
+ if((block->direction & UI_TOP) || (block->direction & UI_DOWN)) {
+ menu->dotowards= 0;
+ return menu->dotowards;
+ }
+
+ /* calculate dominant direction */
+ domx= (-menu->towardsx + (block->maxx+block->minx)/2);
+ domy= (-menu->towardsy + (block->maxy+block->miny)/2);
+
+ /* we need some accuracy */
+ if(abs(domx) < 4) {
+ menu->dotowards= 0;
+ return menu->dotowards;
+ }
+
+ /* check direction */
+ dx= mx - menu->towardsx;
+ dy= my - menu->towardsy;
+
+ /* threshold */
+ if(abs(dx)+abs(dy) > 4) {
+ /* menu to right */
+ if(domx>0) {
+ fac= (mx - menu->towardsx)*( menu->towardsy - (int)(block->maxy+20)) +
+ (my - menu->towardsy)*(-menu->towardsx + (int)block->minx);
+ if(fac>0) menu->dotowards= 0;
+
+ fac= (mx - menu->towardsx)*( menu->towardsy - (int)(block->miny-20)) +
+ (my - menu->towardsy)*(-menu->towardsx + (int)block->minx);
+ if(fac<0) menu->dotowards= 0;
+ }
+ else {
+ fac= (mx - menu->towardsx)*( menu->towardsy - (int)(block->maxy+20)) +
+ (my - menu->towardsy)*(-menu->towardsx + (int)block->maxx);
+ if(fac<0) menu->dotowards= 0;
+
+ fac= (mx - menu->towardsx)*( menu->towardsy - (int)(block->miny-20)) +
+ (my - menu->towardsy)*(-menu->towardsx + (int)block->maxx);
+ if(fac>0) menu->dotowards= 0;
+ }
+ }
+
+ /* 1 second timer */
+ if(PIL_check_seconds_timer() - menu->towardstime > BUTTON_MOUSE_TOWARDS_THRESH)
+ menu->dotowards= 0;
+
+ return menu->dotowards;
+}
+
+int ui_handle_menu_event(bContext *C, wmEvent *event, uiHandleMenuData *menu, int topmenu)
+{
+ ARegion *ar;
+ uiBlock *block;
+ uiBut *but, *bt;
+ uiMenuBlockHandle *handle;
+ int inside, act, count, mx, my, retval;
+
+ ar= menu->handle->region;
+ block= ar->uiblocks.first;
+ handle= menu->handle;
+
+ act= 0;
+ retval= WM_UI_HANDLER_CONTINUE;
+
+ mx= event->x;
+ my= event->y;
+ ui_window_to_block(ar, block, &mx, &my);
+
+ /* check if mouse is inside block */
+ inside= 0;
+ if(block->minx <= mx && block->maxx >= mx)
+ if(block->miny <= my && block->maxy >= my)
+ inside= 1;
+
+ if(topmenu && event->type != TIMER) {
+ /* for ui_mouse_motion_towards_block */
+ if(event->type == MOUSEMOVE)
+ ui_mouse_motion_towards_init(menu, mx, my);
+
+ switch(event->type) {
+ /* closing sublevels of pulldowns */
+ case LEFTARROWKEY:
+ if(event->val && (block->flag & UI_BLOCK_LOOP))
+ if(BLI_countlist(&block->saferct) > 0)
+ handle->menuretval= UI_RETURN_OUT;
+
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+
+ /* opening sublevels of pulldowns */
+ case RIGHTARROWKEY:
+ if(event->val && (block->flag & UI_BLOCK_LOOP)) {
+ but= ui_but_find_activated(ar);
+
+ if(!but) {
+ /* no item active, we make first active */
+ if(block->direction & UI_TOP) but= ui_but_last(block);
+ else but= ui_but_first(block);
+ }
+
+ if(but && but->type==BLOCK)
+ ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_OPEN);
+ }
+
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+
+ case UPARROWKEY:
+ case DOWNARROWKEY:
+ case WHEELUPMOUSE:
+ case WHEELDOWNMOUSE:
+ /* arrowkeys: only handle for block_loop blocks */
+ if(inside || (block->flag & UI_BLOCK_LOOP)) {
+ if(event->val) {
+ but= ui_but_find_activated(ar);
+
+ if(but) {
+ if(ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) {
+ if(block->direction & UI_TOP) but= ui_but_next(but);
+ else but= ui_but_prev(but);
+ }
+ else {
+ if(block->direction & UI_TOP) but= ui_but_prev(but);
+ else but= ui_but_next(but);
+ }
+
+ if(but)
+ ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE);
+ }
+
+ if(!but) {
+ if(ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) {
+ if(block->direction & UI_TOP) bt= ui_but_first(block);
+ else bt= ui_but_last(block);
+ }
+ else {
+ if(block->direction & UI_TOP) bt= ui_but_last(block);
+ else bt= ui_but_first(block);
+ }
+
+ if(bt)
+ ui_handle_button_activate(C, ar, bt, BUTTON_ACTIVATE);
+ }
+ }
+ }
+
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+
+ case ONEKEY: case PAD1:
+ act= 1;
+ case TWOKEY: case PAD2:
+ if(act==0) act= 2;
+ case THREEKEY: case PAD3:
+ if(act==0) act= 3;
+ case FOURKEY: case PAD4:
+ if(act==0) act= 4;
+ case FIVEKEY: case PAD5:
+ if(act==0) act= 5;
+ case SIXKEY: case PAD6:
+ if(act==0) act= 6;
+ case SEVENKEY: case PAD7:
+ if(act==0) act= 7;
+ case EIGHTKEY: case PAD8:
+ if(act==0) act= 8;
+ case NINEKEY: case PAD9:
+ if(act==0) act= 9;
+ case ZEROKEY: case PAD0:
+ if(act==0) act= 10;
+
+ if(block->flag & UI_BLOCK_NUMSELECT) {
+ if(event->alt) act+= 10;
+
+ count= 0;
+ for(but= block->buttons.first; but; but= but->next) {
+ int doit= 0;
+
+ if(but->type!=LABEL && but->type!=SEPR)
+ count++;
+
+ /* exception for menus like layer buts, with button aligning they're not drawn in order */
+ if(but->type==TOGR) {
+ if(but->bitnr==act-1)
+ doit= 1;
+ }
+ else if(count==act)
+ doit=1;
+
+ if(doit) {
+ ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_APPLY);
+ break;
+ }
+ }
+ }
+
+ retval= WM_UI_HANDLER_BREAK;
+ break;
+ }
+
+ /* here we check return conditions for menus */
+ if(block->flag & UI_BLOCK_LOOP) {
+ /* if we click outside the block, verify if we clicked on the
+ * button that opened us, otherwise we need to close */
+ if(inside==0) {
+ uiSafetyRct *saferct= block->saferct.first;
+
+ if(ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val)
+ if(saferct && !BLI_in_rctf(&saferct->parent, event->x, event->y))
+ handle->menuretval= UI_RETURN_OK;
+ }
+
+ if(handle->menuretval);
+ else if(event->type==ESCKEY && event->val) {
+ /* esc cancels this and all preceding menus */
+ handle->menuretval= UI_RETURN_CANCEL;
+ }
+ else if(ELEM(event->type, RETKEY, PADENTER) && event->val) {
+ /* enter will always close this block, but note that the event
+ * can still get pass through so the button is executed */
+ handle->menuretval= UI_RETURN_OK;
+ }
+ else {
+ ui_mouse_motion_towards_check(block, menu, mx, my);
+
+ /* check mouse moving outside of the menu */
+ if(inside==0 && (block->flag & UI_BLOCK_MOVEMOUSE_QUIT)) {
+ uiSafetyRct *saferct;
+
+ /* check for all parent rects, enables arrowkeys to be used */
+ for(saferct=block->saferct.first; saferct; saferct= saferct->next) {
+ /* for mouse move we only check our own rect, for other
+ * events we check all preceding block rects too to make
+ * arrow keys navigation work */
+ if(event->type!=MOUSEMOVE || saferct==block->saferct.first) {
+ if(BLI_in_rctf(&saferct->parent, (float)event->x, (float)event->y))
+ break;
+ if(BLI_in_rctf(&saferct->safety, (float)event->x, (float)event->y))
+ break;
+ }
+ }
+
+ /* strict check, and include the parent rect */
+ if(!menu->dotowards && !saferct)
+ handle->menuretval= (block->flag & UI_BLOCK_KEEP_OPEN)? UI_RETURN_OK: UI_RETURN_OUT;
+ else if(menu->dotowards && event->type==MOUSEMOVE)
+ retval= WM_UI_HANDLER_BREAK;
+ }
+ }
+ }
+ }
+
+ /* if we are inside the region and didn't handle the event yet, lets
+ * pass it on to buttons inside this region */
+ if((inside && !handle->menuretval && retval == WM_UI_HANDLER_CONTINUE) || event->type == TIMER) {
+ but= ui_but_find_activated(ar);
+
+ if(but)
+ retval= ui_handle_button_event(C, event, but);
+ else
+ retval= ui_handle_button_over(C, event, ar);
+ }
+
+ /* if we set a menu return value, ensure we continue passing this on to
+ * lower menus and buttons, so always set continue then, and if we are
+ * inside the region otherwise, ensure we swallow the event */
+ if(handle->menuretval)
+ return WM_UI_HANDLER_CONTINUE;
+ else if(inside)
+ return WM_UI_HANDLER_BREAK;
+ else
+ return retval;
+}
+
+static int ui_handle_menu_closed_submenu(bContext *C, uiHandleMenuData *menu)
+{
+ ARegion *ar;
+ uiBut *but;
+ uiBlock *block;
+ uiHandleButtonData *data;
+ uiMenuBlockHandle *handle, *subhandle;
+
+ ar= menu->handle->region;
+ block= ar->uiblocks.first;
+ handle= menu->handle;
+
+ but= ui_but_find_activated(ar);
+ data= but->active;
+ subhandle= data->menu->handle;
+
+ if(subhandle->menuretval) {
+ /* first decide if we want to close our own menu cascading, if
+ * so pass on the sub menu return value to our own menu handle */
+ if(ELEM(subhandle->menuretval, UI_RETURN_OK, UI_RETURN_CANCEL)) {
+ if(!(block->flag & UI_BLOCK_KEEP_OPEN)) {
+ handle->menuretval= subhandle->menuretval;
+ handle->butretval= data->retval;
+ }
+ }
+
+ /* now let activated button in this menu exit, which
+ * will actually close the submenu too */
+ ui_handle_button_closed_submenu(C, but);
+ }
+
+ if(handle->menuretval)
+ return WM_UI_HANDLER_CONTINUE;
+ else
+ return WM_UI_HANDLER_BREAK;
+}
+
+static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiHandleMenuData *menu)
+{
+ uiBut *but;
+ uiHandleButtonData *data;
+ uiHandleMenuData *submenu;
+ int retval= WM_UI_HANDLER_CONTINUE;
+
+ /* check if we have a submenu, and handle events for it first */
+ but= ui_but_find_activated(menu->handle->region);
+ data= (but)? but->active: NULL;
+ submenu= (data)? data->menu: NULL;
+
+ if(submenu)
+ retval= ui_handle_menus_recursive(C, event, submenu);
+
+ /* now handle events for our own menu */
+ if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
+ if(submenu && submenu->handle->menuretval)
+ retval= ui_handle_menu_closed_submenu(C, menu);
+ else
+ retval= ui_handle_menu_event(C, event, menu, (submenu == NULL));
+ }
+
+ return retval;
+}
+
+/* *************** UI event handlers **************** */
+
+static int ui_handler_region(bContext *C, wmEvent *event)
+{
+ ARegion *ar;
+ uiBut *but;
+ int retval;
+
+ /* here we handle buttons at the region level, non-modal */
+ ar= C->region;
+ retval= WM_UI_HANDLER_CONTINUE;
+
+ if(ar==NULL) return retval;
+ if(ar->uiblocks.first==NULL) return retval;
+
+ /* either handle events for already activated button or try to activate */
+ but= ui_but_find_activated(ar);
+
+ if(but)
+ retval= ui_handle_button_event(C, event, but);
+ else
+ retval= ui_handle_button_over(C, event, ar);
+
+ /* re-enable tooltips */
+ if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
+ ui_blocks_set_tooltips(ar, 1);
+
+ /* delayed apply callbacks */
+ ui_apply_but_funcs_after(C);
+
+ return retval;
+}
+
+static void ui_handler_remove_region(bContext *C)
+{
+ bScreen *sc;
+ ARegion *ar;
+
+ ar= C->region;
+ if(ar == NULL) return;
+
+ uiFreeBlocks(C, &ar->uiblocks);
+
+ sc= C->screen;
+ if(sc == NULL) return;
+
+ /* delayed apply callbacks, but not for screen level regions, those
+ * we rather do at the very end after closing them all, which will
+ * be done in ui_handler_region/window */
+ if(BLI_findindex(&sc->regionbase, ar) == -1)
+ ui_apply_but_funcs_after(C);
+}
+
+static int ui_handler_window(bContext *C, wmEvent *event)
+{
+ ARegion *ar;
+ uiBut *but;
+ uiHandleButtonData *data;
+ int retval;
+
+ /* here we handle buttons at the window level, modal, for example
+ * while number sliding, text editing, or when a menu block is open */
+ ar= C->region;
+
+ /* handle activated button events */
+ but= ui_but_find_activated(ar);
+
+ if(but) {
+ data= but->active;
+
+ if(data->state == BUTTON_STATE_MENU_OPEN) {
+ /* handle events for menus and their buttons recursively,
+ * this will handle events from the top to the bottom menu */
+ retval= ui_handle_menus_recursive(C, event, data->menu);
+
+ /* handle events for the activated button */
+ if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) {
+ if(data->menu->handle->menuretval)
+ ui_handle_button_closed_submenu(C, but);
+ else
+ ui_handle_button_event(C, event, but);
+ }
+ }
+ else {
+ /* handle events for the activated button */
+ ui_handle_button_event(C, event, but);
+ }
+ }
+
+ /* re-enable tooltips */
+ if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
+ ui_blocks_set_tooltips(ar, 1);
+
+ /* delayed apply callbacks */
+ ui_apply_but_funcs_after(C);
+
+ /* we block all events, this is modal interaction */
+ return WM_UI_HANDLER_BREAK;
+}
+
+void UI_add_region_handlers(ListBase *handlers)
+{
+ WM_event_remove_ui_handler(handlers);
+ WM_event_add_ui_handler(NULL, handlers, ui_handler_region, ui_handler_remove_region);
+}
+
diff --git a/source/blender/src/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index bd06e461745..2b22e47b5bf 100644
--- a/source/blender/src/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -43,49 +43,28 @@
#include "BLI_blenlib.h"
#include "BLI_storage_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-#include "DNA_object_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_image_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
-#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
-#include "BKE_global.h"
-#include "BKE_material.h"
-#include "BKE_texture.h"
-#include "BKE_world.h"
-#include "BKE_image.h"
-#include "BKE_object.h"
+
#include "BKE_utildefines.h"
+#include "BKE_image.h"
#include "BKE_icons.h"
-#include "BKE_packedFile.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_previewrender.h"
-#include "BIF_screen.h"
-#include "BIF_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */
-
-#include "interface.h"
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
-#include "PIL_time.h"
+// XXX #include "BIF_previewrender.h"
+// XXX #include "BIF_screen.h"
-#include "blendef.h" // CLAMP
-#include "datatoc.h"
-#include "mydevice.h"
+#include "UI_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */
+#include "interface.h"
+#include "ED_datafiles.h"
#define ICON_IMAGE_W 512
#define ICON_IMAGE_H 256
@@ -103,6 +82,8 @@ typedef struct IconImage {
unsigned int *rect;
} IconImage;
+typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
+
typedef struct DrawInfo {
int w;
int h;
@@ -117,8 +98,6 @@ typedef struct DrawInfo {
static struct ListBase iconfilelist = {0, 0};
-static int preview_render_size(int miplevel);
-
/* **************************************************** */
static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs)
@@ -151,7 +130,7 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs)
di->icon = iimg;
- new_icon->drawinfo_free = BIF_icons_free_drawinfo;
+ new_icon->drawinfo_free = UI_icons_free_drawinfo;
new_icon->drawinfo = di;
BKE_icon_set(icon_id, new_icon);
@@ -199,18 +178,6 @@ static void viconutil_draw_tri(GLint (*pts)[2])
glEnd();
}
-#if 0
-static void viconutil_draw_quad(GLint (*pts)[2])
-{
- glBegin(GL_QUADS);
- glVertex2iv(pts[0]);
- glVertex2iv(pts[1]);
- glVertex2iv(pts[2]);
- glVertex2iv(pts[3]);
- glEnd();
-}
-#endif
-
static void viconutil_draw_lineloop(GLint (*pts)[2], int numPoints)
{
int i;
@@ -341,10 +308,10 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float alpha)
viconutil_set_point(pts[1], x+3, y+4);
viconutil_set_point(pts[2], x+w-3, y+4);
- glColor4f(0.0, 0.0, 0.0, 1);
+ glColor4f(0.0f, 0.0f, 0.0f, 1);
viconutil_draw_lineloop_smooth(pts, 3);
- glColor3f(.9, .9, .9);
+ glColor3f(.9f, .9f, .9f);
viconutil_draw_points(pts, 3, 1);
}
@@ -361,15 +328,15 @@ static void vicon_disclosure_tri_right_draw(int x, int y, int w, int h, float al
glShadeModel(GL_SMOOTH);
glBegin(GL_TRIANGLES);
- glColor4f(0.8, 0.8, 0.8, alpha);
+ glColor4f(0.8f, 0.8f, 0.8f, alpha);
glVertex2iv(pts[0]);
glVertex2iv(pts[1]);
- glColor4f(0.3, 0.3, 0.3, alpha);
+ glColor4f(0.3f, 0.3f, 0.3f, alpha);
glVertex2iv(pts[2]);
glEnd();
glShadeModel(GL_FLAT);
- glColor4f(0.0, 0.0, 0.0, 1);
+ glColor4f(0.0f, 0.0f, 0.0f, 1);
viconutil_draw_lineloop_smooth(pts, 3);
}
@@ -386,15 +353,15 @@ static void vicon_disclosure_tri_down_draw(int x, int y, int w, int h, float alp
glShadeModel(GL_SMOOTH);
glBegin(GL_TRIANGLES);
- glColor4f(0.8, 0.8, 0.8, alpha);
+ glColor4f(0.8f, 0.8f, 0.8f, alpha);
glVertex2iv(pts[0]);
glVertex2iv(pts[1]);
- glColor4f(0.3, 0.3, 0.3, alpha);
+ glColor4f(0.3f, 0.3f, 0.3f, alpha);
glVertex2iv(pts[2]);
glEnd();
glShadeModel(GL_FLAT);
- glColor4f(0.0, 0.0, 0.0, 1);
+ glColor4f(0.0f, 0.0f, 0.0f, 1);
viconutil_draw_lineloop_smooth(pts, 3);
}
@@ -436,44 +403,6 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float alpha)
/***/
-
-/* this only works for the hardcoded buttons image, turning the grey AA pixels to alpha, and slight off-grey to half alpha */
-#if 0
-static void clear_transp_rect_soft(unsigned char *transp, unsigned char *rect, int w, int h, int rowstride)
-{
- int x, y, val;
-
- for (y=1; y<h-1; y++) {
- unsigned char *row0= &rect[(y-1)*rowstride];
- unsigned char *row= &rect[y*rowstride];
- unsigned char *row1= &rect[(y+1)*rowstride];
- for (x=1; x<w-1; x++) {
- unsigned char *pxl0= &row0[x*4];
- unsigned char *pxl= &row[x*4];
- unsigned char *pxl1= &row1[x*4];
-
- if(pxl[3]!=0) {
- val= (abs(pxl[0]-transp[0]) + abs(pxl[1]-transp[1]) + abs(pxl[2]-transp[2]))/3;
- if(val<20) {
- pxl[3]= 128;
- }
- else if(val<50) {
- // one of pixels surrounding has alpha null?
- if(pxl[3-4]==0 || pxl[3+4]==0 || pxl0[3]==0 || pxl1[3]==0) {
-
- if(pxl[0]>val) pxl[0]-= val; else pxl[0]= 0;
- if(pxl[1]>val) pxl[1]-= val; else pxl[1]= 0;
- if(pxl[2]>val) pxl[2]-= val; else pxl[2]= 0;
-
- pxl[3]= 128;
- }
- }
- }
- }
- }
-}
-#endif
-
static void clear_icon_grid_margins(unsigned char *rect, int w, int h)
{
int x, y;
@@ -502,22 +431,6 @@ static void prepare_internal_icons(ImBuf *bbuf)
/* this sets the icon grid margin area outside of icon to zero alpha */
clear_icon_grid_margins(back, bbuf->x, bbuf->y);
- /* hack! */
-#if 0
- for (y=0; y<12; y++) {
- for (x=0; x<21; x++) {
- unsigned char *start= ((unsigned char*) bbuf->rect) + (y*21 + 3)*rowstride + (x*20 + 3)*4;
- /* this sets backdrop of icon to zero alpha */
- transp[0]= start[0];
- transp[1]= start[1];
- transp[2]= start[2];
- transp[3]= start[3];
- clear_transp_rect(transp, start, 20, 21, rowstride);
- clear_transp_rect_soft(transp, start, 20, 21, rowstride);
-
- }
- }
-#endif
}
@@ -656,7 +569,7 @@ static void free_iconfile_list(struct ListBase *list)
}
}
-int BIF_iconfile_get_index(char *filename)
+int UI_iconfile_get_index(char *filename)
{
IconFile *ifile;
ListBase *list=&(iconfilelist);
@@ -670,7 +583,7 @@ int BIF_iconfile_get_index(char *filename)
return 0;
}
-ListBase *BIF_iconfile_list(void)
+ListBase *UI_iconfile_list(void)
{
ListBase *list=&(iconfilelist);
@@ -678,13 +591,13 @@ ListBase *BIF_iconfile_list(void)
}
-void BIF_icons_free()
+void UI_icons_free()
{
free_iconfile_list(&iconfilelist);
BKE_icons_free();
}
-void BIF_icons_free_drawinfo(void *drawinfo)
+void UI_icons_free_drawinfo(void *drawinfo)
{
DrawInfo *di = drawinfo;
@@ -713,7 +626,7 @@ static DrawInfo *icon_create_drawinfo()
return di;
}
-int BIF_icon_get_width(int icon_id)
+int UI_icon_get_width(int icon_id)
{
Icon *icon = NULL;
DrawInfo *di = NULL;
@@ -721,7 +634,7 @@ int BIF_icon_get_width(int icon_id)
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("BIF_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("UI_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
return 0;
}
@@ -737,7 +650,7 @@ int BIF_icon_get_width(int icon_id)
return 0;
}
-int BIF_icon_get_height(int icon_id)
+int UI_icon_get_height(int icon_id)
{
Icon *icon = NULL;
DrawInfo *di = NULL;
@@ -745,7 +658,7 @@ int BIF_icon_get_height(int icon_id)
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("BIF_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("UI_icon_get_height: Internal error, no icon for icon ID: %d\n", icon_id);
return 0;
}
@@ -762,13 +675,14 @@ int BIF_icon_get_height(int icon_id)
return 0;
}
-void BIF_icons_init(int first_dyn_id)
+void UI_icons_init(int first_dyn_id)
{
init_iconfile_list(&iconfilelist);
BKE_icons_init(first_dyn_id);
init_internal_icons();
}
+#if 0
static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned int *rect)
{
struct ImBuf *ima;
@@ -819,6 +733,16 @@ static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned
IMB_freeImBuf(ima);
}
+/* Render size for preview images at level miplevel */
+static int preview_render_size(int miplevel)
+{
+ switch (miplevel) {
+ case 0: return 32;
+ case 1: return PREVIEW_DEFAULT_HEIGHT;
+ }
+ return 0;
+}
+
static void icon_create_mipmap(struct PreviewImage* prv_img, int miplevel)
{
unsigned int size = preview_render_size(miplevel);
@@ -879,11 +803,13 @@ static void set_alpha(char* cp, int sizex, int sizey, char alpha)
}
}
}
+#endif
/* only called when icon has changed */
-/* only call with valid pointer from BIF_icon_draw */
+/* only call with valid pointer from UI_icon_draw */
static void icon_set_image(ID *id, DrawInfo *di, PreviewImage* prv_img, int miplevel)
{
+#if 0 // XXX - preview renders have to be redesigned - possibly low level op (elubie)
RenderInfo ri;
unsigned int pr_size = 0;
@@ -932,13 +858,16 @@ static void icon_set_image(ID *id, DrawInfo *di, PreviewImage* prv_img, int mipl
ri.rect = 0;
}
}
+#endif
}
static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect)
{
ui_rasterpos_safe(x, y, aspect);
- if((w<1 || h<1) && G.f & G_DEBUG) {
+ if((w<1 || h<1)) {
+ // XXX - TODO 2.5 verify whether this case can happen
+ // and only print in debug
printf("what the heck! - icons are %i x %i pixels?\n", w, h);
}
/* rect contains image in 'rendersize', we only scale if needed */
@@ -962,16 +891,6 @@ static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw,
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect);
}
-/* Render size for preview images at level miplevel */
-static int preview_render_size(int miplevel)
-{
- switch (miplevel) {
- case 0: return 32;
- case 1: return PREVIEW_DEFAULT_HEIGHT;
- }
- return 0;
-}
-
/* Drawing size for preview images at level miplevel */
static int preview_size(int miplevel)
{
@@ -992,7 +911,7 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("BIF_icon_set_aspect: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("icon_draw_mipmap: Internal error, no icon for icon ID: %d\n", icon_id);
return;
}
@@ -1002,7 +921,7 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi
di = icon_create_drawinfo();
icon->drawinfo = di;
- icon->drawinfo_free = BIF_icons_free_drawinfo;
+ icon->drawinfo_free = UI_icons_free_drawinfo;
}
di->aspect = aspect;
@@ -1027,11 +946,11 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi
if (pi) {
if (!nocreate && (pi->changed[miplevel] ||!pi->rect[miplevel])) /* changed only ever set by dynamic icons */
{
- waitcursor(1);
+ // XXX waitcursor(1);
/* create the preview rect if necessary */
icon_set_image((ID*)icon->obj, icon->drawinfo, pi, miplevel);
pi->changed[miplevel] = 0;
- waitcursor(0);
+ // XXX waitcursor(0);
}
if (!pi->rect[miplevel]) return; /* something has gone wrong! */
@@ -1041,30 +960,29 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi
}
}
-void BIF_icon_draw_aspect(float x, float y, int icon_id, float aspect)
+void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect)
{
icon_draw_mipmap(x,y,icon_id, aspect, PREVIEW_MIPMAP_ZERO, 0);
}
-void BIF_icon_draw(float x, float y, int icon_id)
+void UI_icon_draw(float x, float y, int icon_id)
{
- BIF_icon_draw_aspect(x, y, icon_id, 1.0f);
+ UI_icon_draw_aspect(x, y, icon_id, 1.0f);
}
-void BIF_icon_draw_preview(float x, float y, int icon_id, int nocreate)
+void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate)
{
icon_draw_mipmap(x,y,icon_id, 1.0f, PREVIEW_MIPMAP_LARGE, nocreate);
}
-void BIF_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade)
+void UI_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade)
{
-
if(shade < 0) {
float r= (128+shade)/128.0f;
glPixelTransferf(GL_ALPHA_SCALE, r);
}
- BIF_icon_draw_aspect(x, y, icon_id, aspect);
+ UI_icon_draw_aspect(x, y, icon_id, aspect);
if(shade < 0)
glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
new file mode 100644
index 00000000000..2e01eb8c8b1
--- /dev/null
+++ b/source/blender/editors/interface/interface_regions.c
@@ -0,0 +1,1794 @@
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_screen_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_arithb.h"
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_subwindow.h"
+#include "wm_window.h"
+
+#include "BIF_gl.h"
+
+#include "UI_interface.h"
+#include "UI_text.h"
+#include "UI_view2d.h"
+
+#include "ED_screen.h"
+
+#include "interface.h"
+
+#define MENU_BUTTON_HEIGHT 20
+#define B_NOP -1
+#define MENU_SHADOW_LEFT -1
+#define MENU_SHADOW_BOTTOM -10
+#define MENU_SHADOW_RIGHT 10
+#define MENU_SHADOW_TOP 1
+
+/*********************** Menu Data Parsing ********************* */
+
+typedef struct {
+ char *str;
+ int retval;
+ int icon;
+} MenuEntry;
+
+typedef struct {
+ char *instr;
+ char *title;
+ int titleicon;
+
+ MenuEntry *items;
+ int nitems, itemssize;
+} MenuData;
+
+static MenuData *menudata_new(char *instr)
+{
+ MenuData *md= MEM_mallocN(sizeof(*md), "MenuData");
+
+ md->instr= instr;
+ md->title= NULL;
+ md->titleicon= 0;
+ md->items= NULL;
+ md->nitems= md->itemssize= 0;
+
+ return md;
+}
+
+static void menudata_set_title(MenuData *md, char *title, int titleicon)
+{
+ if (!md->title)
+ md->title= title;
+ if (!md->titleicon)
+ md->titleicon= titleicon;
+}
+
+static void menudata_add_item(MenuData *md, char *str, int retval, int icon)
+{
+ if (md->nitems==md->itemssize) {
+ int nsize= md->itemssize?(md->itemssize<<1):1;
+ MenuEntry *oitems= md->items;
+
+ md->items= MEM_mallocN(nsize*sizeof(*md->items), "md->items");
+ if (oitems) {
+ memcpy(md->items, oitems, md->nitems*sizeof(*md->items));
+ MEM_freeN(oitems);
+ }
+
+ md->itemssize= nsize;
+ }
+
+ md->items[md->nitems].str= str;
+ md->items[md->nitems].retval= retval;
+ md->items[md->nitems].icon= icon;
+ md->nitems++;
+}
+
+void menudata_free(MenuData *md)
+{
+ MEM_freeN(md->instr);
+ if (md->items)
+ MEM_freeN(md->items);
+ MEM_freeN(md);
+}
+
+ /**
+ * Parse menu description strings, string is of the
+ * form "[sss%t|]{(sss[%xNN]|), (%l|)}", ssss%t indicates the
+ * menu title, sss or sss%xNN indicates an option,
+ * if %xNN is given then NN is the return value if
+ * that option is selected otherwise the return value
+ * is the index of the option (starting with 1). %l
+ * indicates a seperator.
+ *
+ * @param str String to be parsed.
+ * @retval new menudata structure, free with menudata_free()
+ */
+MenuData *decompose_menu_string(char *str)
+{
+ char *instr= BLI_strdup(str);
+ MenuData *md= menudata_new(instr);
+ char *nitem= NULL, *s= instr;
+ int nicon=0, nretval= 1, nitem_is_title= 0;
+
+ while (1) {
+ char c= *s;
+
+ if (c=='%') {
+ if (s[1]=='x') {
+ nretval= atoi(s+2);
+
+ *s= '\0';
+ s++;
+ } else if (s[1]=='t') {
+ nitem_is_title= 1;
+
+ *s= '\0';
+ s++;
+ } else if (s[1]=='l') {
+ nitem= "%l";
+ s++;
+ } else if (s[1]=='i') {
+ nicon= atoi(s+2);
+
+ *s= '\0';
+ s++;
+ }
+ } else if (c=='|' || c=='\0') {
+ if (nitem) {
+ *s= '\0';
+
+ if (nitem_is_title) {
+ menudata_set_title(md, nitem, nicon);
+ nitem_is_title= 0;
+ } else {
+ /* prevent separator to get a value */
+ if(nitem[0]=='%' && nitem[1]=='l')
+ menudata_add_item(md, nitem, -1, nicon);
+ else
+ menudata_add_item(md, nitem, nretval, nicon);
+ nretval= md->nitems+1;
+ }
+
+ nitem= NULL;
+ nicon= 0;
+ }
+
+ if (c=='\0')
+ break;
+ } else if (!nitem)
+ nitem= s;
+
+ s++;
+ }
+
+ return md;
+}
+
+void ui_set_name_menu(uiBut *but, int value)
+{
+ MenuData *md;
+ int i;
+
+ md= decompose_menu_string(but->str);
+ for (i=0; i<md->nitems; i++)
+ if (md->items[i].retval==value)
+ strcpy(but->drawstr, md->items[i].str);
+
+ menudata_free(md);
+}
+
+/******************** Creating Temporary regions ******************/
+
+ARegion *ui_add_temporary_region(bScreen *sc)
+{
+ ARegion *ar;
+
+ ar= MEM_callocN(sizeof(ARegion), "area region");
+ BLI_addtail(&sc->regionbase, ar);
+
+ ar->regiontype= RGN_TYPE_TEMPORARY;
+ ar->alignment= RGN_ALIGN_FLOAT;
+
+ return ar;
+}
+
+void ui_remove_temporary_region(bContext *C, bScreen *sc, ARegion *ar)
+{
+ ED_region_exit(C, ar);
+ BKE_area_region_free(ar);
+ BLI_freelinkN(&sc->regionbase, ar);
+}
+
+/************************* Creating Tooltips **********************/
+
+typedef struct uiTooltipData {
+ rctf bbox;
+ struct BMF_Font *font;
+ char *tip;
+ float aspect;
+} uiTooltipData;
+
+static void ui_tooltip_region_draw(const bContext *C, ARegion *ar)
+{
+ uiTooltipData *data;
+ int x1, y1, x2, y2;
+
+ data= ar->regiondata;
+
+ x1= ar->winrct.xmin;
+ y1= ar->winrct.ymin;
+ x2= ar->winrct.xmax;
+ y2= ar->winrct.ymax;
+
+ /* draw drop shadow */
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+
+ glColor4ub(0, 0, 0, 20);
+
+ gl_round_box(GL_POLYGON, 3, 3, x2-x1-3, y2-y1-2, 2.0);
+ gl_round_box(GL_POLYGON, 3, 2, x2-x1-2, y2-y1-2, 3.0);
+
+ glColor4ub(0, 0, 0, 8);
+
+ gl_round_box(GL_POLYGON, 3, 1, x2-x1-1, y2-y1-3, 4.0);
+ gl_round_box(GL_POLYGON, 3, 0, x2-x1-0, y2-y1-3, 5.0);
+
+ glDisable(GL_BLEND);
+
+ /* draw background */
+ glColor3f(1.0f, 1.0f, 0.8666f);
+ glRectf(0, 4, x2-x1+4, y2-y1);
+
+ /* draw text */
+ glColor3ub(0,0,0);
+
+ /* set the position for drawing text +4 in from the left edge, and leaving
+ * an equal gap between the top of the background box and the top of the
+ * string's bbox, and the bottom of the background box, and the bottom of
+ * the string's bbox */
+ ui_rasterpos_safe(4, ((y2-data->bbox.ymax)+(y1+data->bbox.ymin))/2 - data->bbox.ymin - y1, data->aspect);
+ UI_SetScale(1.0);
+
+ UI_DrawString(data->font, data->tip, ui_translate_tooltips());
+}
+
+static void ui_tooltip_region_free(ARegion *ar)
+{
+ uiTooltipData *data;
+
+ data= ar->regiondata;
+ MEM_freeN(data->tip);
+ MEM_freeN(data);
+}
+
+ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
+{
+ static ARegionType type;
+ ARegion *ar;
+ uiTooltipData *data;
+ int x1, x2, y1, y2, winx, winy;
+
+ if(!but->tip || strlen(but->tip)==0)
+ return NULL;
+
+ /* create area region */
+ ar= ui_add_temporary_region(C->window->screen);
+
+ memset(&type, 0, sizeof(ARegionType));
+ type.draw= ui_tooltip_region_draw;
+ type.free= ui_tooltip_region_free;
+ ar->type= &type;
+
+ /* create tooltip data */
+ data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
+ data->tip= BLI_strdup(but->tip);
+ data->font= but->font;
+ data->aspect= but->aspect;
+ UI_GetBoundingBox(data->font, data->tip, ui_translate_tooltips(), &data->bbox);
+
+ ar->regiondata= data;
+
+ /* compute position */
+ x1= (but->x1+but->x2)/2;
+ x2= x1+but->aspect*((data->bbox.xmax-data->bbox.xmin) + 8);
+ y2= but->y1-10;
+ y1= y2-but->aspect*((data->bbox.ymax+(data->bbox.ymax-data->bbox.ymin)));
+
+ y2 += 8;
+ x2 += 8;
+
+ if(butregion) {
+ /* XXX temp, region v2ds can be empty still */
+ if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) {
+ short tx, ty;
+ UI_view2d_to_region_no_clip(&butregion->v2d, x1, y1, &tx, &ty);
+ x1= (int)tx; y1= (int)ty;
+ UI_view2d_to_region_no_clip(&butregion->v2d, x2, y2, &tx, &ty);
+ x2= (int)tx; y2= (int)ty;
+ }
+
+ x1 += butregion->winrct.xmin;
+ x2 += butregion->winrct.xmin;
+ y1 += butregion->winrct.ymin;
+ y2 += butregion->winrct.ymin;
+ }
+
+ wm_window_get_size(C->window, &winx, &winy);
+
+ if(x2 > winx) {
+ /* super size */
+ if(x2 > winx + x1) {
+ x2= winx;
+ x1= 0;
+ }
+ else {
+ x1 -= x2-winx;
+ x2= winx;
+ }
+ }
+ if(y1 < 0) {
+ y1 += 36;
+ y2 += 36;
+ }
+
+ ar->winrct.xmin= x1;
+ ar->winrct.ymin= y1;
+ ar->winrct.xmax= x2;
+ ar->winrct.ymax= y2;
+
+ /* adds subwindow */
+ ED_region_init(C, ar);
+
+ /* notify change and redraw */
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+
+ return ar;
+}
+
+void ui_tooltip_free(bContext *C, ARegion *ar)
+{
+ ui_remove_temporary_region(C, C->window->screen, ar);
+
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+}
+
+/************************* Creating Menu Blocks **********************/
+
+/* position block relative to but, result is in window space */
+static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, uiBlock *block)
+{
+ uiBut *bt;
+ uiSafetyRct *saferct;
+ rctf butrct;
+ float aspect;
+ int xsize, ysize, xof=0, yof=0, center;
+ short dir1= 0, dir2=0;
+
+ /* transform to window coordinates, using the source button region/block */
+ butrct.xmin= but->x1; butrct.xmax= but->x2;
+ butrct.ymin= but->y1; butrct.ymax= but->y2;
+
+ ui_block_to_window_fl(butregion, but->block, &butrct.xmin, &butrct.ymin);
+ ui_block_to_window_fl(butregion, but->block, &butrct.xmax, &butrct.ymax);
+
+ /* calc block rect */
+ if(block->minx == 0.0f && block->maxx == 0.0f) {
+ if(block->buttons.first) {
+ block->minx= block->miny= 10000;
+ block->maxx= block->maxy= -10000;
+
+ bt= block->buttons.first;
+ while(bt) {
+ if(bt->x1 < block->minx) block->minx= bt->x1;
+ if(bt->y1 < block->miny) block->miny= bt->y1;
+
+ if(bt->x2 > block->maxx) block->maxx= bt->x2;
+ if(bt->y2 > block->maxy) block->maxy= bt->y2;
+
+ bt= bt->next;
+ }
+ }
+ else {
+ /* we're nice and allow empty blocks too */
+ block->minx= block->miny= 0;
+ block->maxx= block->maxy= 20;
+ }
+ }
+
+ aspect= (float)(block->maxx - block->minx + 4);
+ ui_block_to_window_fl(butregion, but->block, &block->minx, &block->miny);
+ ui_block_to_window_fl(butregion, but->block, &block->maxx, &block->maxy);
+
+ //block->minx-= 2.0; block->miny-= 2.0;
+ //block->maxx+= 2.0; block->maxy+= 2.0;
+
+ xsize= block->maxx - block->minx+4; // 4 for shadow
+ ysize= block->maxy - block->miny+4;
+ aspect/= (float)xsize;
+
+ if(but) {
+ int left=0, right=0, top=0, down=0;
+ int winx, winy;
+
+ wm_window_get_size(window, &winx, &winy);
+
+ if(block->direction & UI_CENTER) center= ysize/2;
+ else center= 0;
+
+ if( butrct.xmin-xsize > 0.0) left= 1;
+ if( butrct.xmax+xsize < winx) right= 1;
+ if( butrct.ymin-ysize+center > 0.0) down= 1;
+ if( butrct.ymax+ysize-center < winy) top= 1;
+
+ dir1= block->direction & UI_DIRECTION;
+
+ /* secundary directions */
+ if(dir1 & (UI_TOP|UI_DOWN)) {
+ if(dir1 & UI_LEFT) dir2= UI_LEFT;
+ else if(dir1 & UI_RIGHT) dir2= UI_RIGHT;
+ dir1 &= (UI_TOP|UI_DOWN);
+ }
+
+ if(dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
+ if(dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
+
+ /* no space at all? dont change */
+ if(left || right) {
+ if(dir1==UI_LEFT && left==0) dir1= UI_RIGHT;
+ if(dir1==UI_RIGHT && right==0) dir1= UI_LEFT;
+ /* this is aligning, not append! */
+ if(dir2==UI_LEFT && right==0) dir2= UI_RIGHT;
+ if(dir2==UI_RIGHT && left==0) dir2= UI_LEFT;
+ }
+ if(down || top) {
+ if(dir1==UI_TOP && top==0) dir1= UI_DOWN;
+ if(dir1==UI_DOWN && down==0) dir1= UI_TOP;
+ if(dir2==UI_TOP && top==0) dir2= UI_DOWN;
+ if(dir2==UI_DOWN && down==0) dir2= UI_TOP;
+ }
+
+ if(dir1==UI_LEFT) {
+ xof= butrct.xmin - block->maxx;
+ if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
+ else yof= butrct.ymax - block->maxy+center;
+ }
+ else if(dir1==UI_RIGHT) {
+ xof= butrct.xmax - block->minx;
+ if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
+ else yof= butrct.ymax - block->maxy+center;
+ }
+ else if(dir1==UI_TOP) {
+ yof= butrct.ymax - block->miny;
+ if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
+ else xof= butrct.xmin - block->minx;
+ // changed direction?
+ if((dir1 & block->direction)==0) {
+ if(block->direction & UI_SHIFT_FLIPPED)
+ xof+= dir2==UI_LEFT?25:-25;
+ uiBlockFlipOrder(block);
+ }
+ }
+ else if(dir1==UI_DOWN) {
+ yof= butrct.ymin - block->maxy;
+ if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
+ else xof= butrct.xmin - block->minx;
+ // changed direction?
+ if((dir1 & block->direction)==0) {
+ if(block->direction & UI_SHIFT_FLIPPED)
+ xof+= dir2==UI_LEFT?25:-25;
+ uiBlockFlipOrder(block);
+ }
+ }
+
+ /* and now we handle the exception; no space below or to top */
+ if(top==0 && down==0) {
+ if(dir1==UI_LEFT || dir1==UI_RIGHT) {
+ // align with bottom of screen
+ yof= ysize;
+ }
+ }
+
+ /* or no space left or right */
+ if(left==0 && right==0) {
+ if(dir1==UI_TOP || dir1==UI_DOWN) {
+ // align with left size of screen
+ xof= -block->minx+5;
+ }
+ }
+
+ // apply requested offset in the block
+ xof += block->xofs/block->aspect;
+ yof += block->yofs/block->aspect;
+ }
+
+ /* apply */
+
+ for(bt= block->buttons.first; bt; bt= bt->next) {
+ ui_block_to_window_fl(butregion, but->block, &bt->x1, &bt->y1);
+ ui_block_to_window_fl(butregion, but->block, &bt->x2, &bt->y2);
+
+ bt->x1 += xof;
+ bt->x2 += xof;
+ bt->y1 += yof;
+ bt->y2 += yof;
+
+ bt->aspect= 1.0;
+ // ui_check_but recalculates drawstring size in pixels
+ ui_check_but(bt);
+ }
+
+ block->minx += xof;
+ block->miny += yof;
+ block->maxx += xof;
+ block->maxy += yof;
+
+ /* safety calculus */
+ if(but) {
+ float midx= (butrct.xmin+butrct.xmax)/2.0;
+ float midy= (butrct.ymin+butrct.ymax)/2.0;
+
+ /* when you are outside parent button, safety there should be smaller */
+
+ // parent button to left
+ if( midx < block->minx ) block->safety.xmin= block->minx-3;
+ else block->safety.xmin= block->minx-40;
+ // parent button to right
+ if( midx > block->maxx ) block->safety.xmax= block->maxx+3;
+ else block->safety.xmax= block->maxx+40;
+
+ // parent button on bottom
+ if( midy < block->miny ) block->safety.ymin= block->miny-3;
+ else block->safety.ymin= block->miny-40;
+ // parent button on top
+ if( midy > block->maxy ) block->safety.ymax= block->maxy+3;
+ else block->safety.ymax= block->maxy+40;
+
+ // exception for switched pulldowns...
+ if(dir1 && (dir1 & block->direction)==0) {
+ if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3;
+ if(dir2==UI_LEFT) block->safety.xmin= block->minx-3;
+ }
+ block->direction= dir1;
+ }
+ else {
+ block->safety.xmin= block->minx-40;
+ block->safety.ymin= block->miny-40;
+ block->safety.xmax= block->maxx+40;
+ block->safety.ymax= block->maxy+40;
+ }
+
+ /* keep a list of these, needed for pulldown menus */
+ saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
+ saferct->parent= butrct;
+ saferct->safety= block->safety;
+ BLI_freelistN(&block->saferct);
+ if(but)
+ BLI_duplicatelist(&block->saferct, &but->block->saferct);
+ BLI_addhead(&block->saferct, saferct);
+}
+
+static void ui_block_region_draw(const bContext *C, ARegion *ar)
+{
+ uiBlock *block;
+
+ for(block=ar->uiblocks.first; block; block=block->next) {
+ wm_subwindow_getmatrix(C->window, ar->swinid, block->winmat);
+ uiDrawBlock(block);
+ }
+}
+
+uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockFuncFP block_func, void *arg)
+{
+ static ARegionType type;
+ ARegion *ar;
+ uiBlock *block;
+ uiBut *bt;
+ uiMenuBlockHandle *handle;
+ uiSafetyRct *saferct;
+
+ /* create handle */
+ handle= MEM_callocN(sizeof(uiMenuBlockHandle), "uiMenuBlockHandle");
+
+ /* create area region */
+ ar= ui_add_temporary_region(C->window->screen);
+
+ memset(&type, 0, sizeof(ARegionType));
+ type.draw= ui_block_region_draw;
+ ar->type= &type;
+
+ UI_add_region_handlers(&ar->handlers);
+
+ handle->region= ar;
+ ar->regiondata= handle;
+
+ /* create ui block */
+ block= block_func(C, handle, arg);
+ block->handle= handle;
+
+ /* if this is being created from a button */
+ if(but) {
+ if(ELEM(but->type, BLOCK, PULLDOWN))
+ block->xofs = -2; /* for proper alignment */
+
+ /* only used for automatic toolbox, so can set the shift flag */
+ if(but->flag & UI_MAKE_TOP) {
+ block->direction= UI_TOP|UI_SHIFT_FLIPPED;
+ uiBlockFlipOrder(block);
+ }
+ if(but->flag & UI_MAKE_DOWN) block->direction= UI_DOWN|UI_SHIFT_FLIPPED;
+ if(but->flag & UI_MAKE_LEFT) block->direction |= UI_LEFT;
+ if(but->flag & UI_MAKE_RIGHT) block->direction |= UI_RIGHT;
+
+ ui_block_position(C->window, butregion, but, block);
+ }
+ else {
+ /* keep a list of these, needed for pulldown menus */
+ saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
+ saferct->safety= block->safety;
+ BLI_addhead(&block->saferct, saferct);
+ }
+
+ /* the block and buttons were positioned in window space as in 2.4x, now
+ * these menu blocks are regions so we bring it back to region space.
+ * additionally we add some padding for the menu shadow */
+ ar->winrct.xmin= block->minx + MENU_SHADOW_LEFT;
+ ar->winrct.xmax= block->maxx + MENU_SHADOW_RIGHT;
+ ar->winrct.ymin= block->miny + MENU_SHADOW_BOTTOM;
+ ar->winrct.ymax= block->maxy + MENU_SHADOW_TOP;
+
+ block->minx -= ar->winrct.xmin;
+ block->maxx -= ar->winrct.xmin;
+ block->miny -= ar->winrct.ymin;
+ block->maxy -= ar->winrct.ymin;
+
+ for(bt= block->buttons.first; bt; bt= bt->next) {
+ bt->x1 -= ar->winrct.xmin;
+ bt->x2 -= ar->winrct.xmin;
+ bt->y1 -= ar->winrct.ymin;
+ bt->y2 -= ar->winrct.ymin;
+ }
+
+ block->flag |= UI_BLOCK_LOOP|UI_BLOCK_MOVEMOUSE_QUIT;
+
+ /* adds subwindow */
+ ED_region_init(C, ar);
+
+ /* notify change and redraw */
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+
+ return handle;
+}
+
+void ui_menu_block_free(bContext *C, uiMenuBlockHandle *handle)
+{
+ ui_remove_temporary_region(C, C->window->screen, handle->region);
+ MEM_freeN(handle);
+
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+}
+
+/***************************** Menu Button ***************************/
+
+uiBlock *ui_block_func_MENU(bContext *C, uiMenuBlockHandle *handle, void *arg_but)
+{
+ uiBut *but= arg_but;
+ uiBlock *block;
+ uiBut *bt;
+ MenuData *md;
+ ListBase lb;
+ float aspect;
+ int width, height, boxh, columns, rows, startx, starty, x1, y1, xmax, a;
+
+ /* create the block */
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block->dt= UI_EMBOSSP;
+ block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
+ block->themecol= TH_MENU_ITEM;
+
+ /* compute menu data */
+ md= decompose_menu_string(but->str);
+
+ /* columns and row calculation */
+ columns= (md->nitems+20)/20;
+ if(columns<1)
+ columns= 1;
+ if(columns>8)
+ columns= (md->nitems+25)/25;
+
+ rows= md->nitems/columns;
+ if(rows<1)
+ rows= 1;
+ while(rows*columns<md->nitems)
+ rows++;
+
+ /* prevent scaling up of pupmenu */
+ aspect= but->aspect;
+ if(aspect < 1.0f)
+ aspect = 1.0f;
+
+ /* size and location */
+ if(md->title)
+ width= 1.5*aspect*strlen(md->title)+UI_GetStringWidth(block->curfont, md->title, ui_translate_menus());
+ else
+ width= 0;
+
+ for(a=0; a<md->nitems; a++) {
+ xmax= aspect*UI_GetStringWidth(block->curfont, md->items[a].str, ui_translate_menus());
+ if(md->items[a].icon)
+ xmax += 20*aspect;
+ if(xmax>width)
+ width= xmax;
+ }
+
+ width+= 10;
+ if(width < (but->x2 - but->x1))
+ width = (but->x2 - but->x1);
+ if(width<50)
+ width=50;
+
+ boxh= MENU_BUTTON_HEIGHT;
+
+ height= rows*boxh;
+ if(md->title)
+ height+= boxh;
+
+ /* here we go! */
+ startx= but->x1;
+ starty= but->y1;
+
+ if(md->title) {
+ uiBut *bt;
+ uiSetCurFont(block, block->font+1);
+ if (md->titleicon) {
+ bt= uiDefIconTextBut(block, LABEL, 0, md->titleicon, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
+ } else {
+ bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
+ bt->flag= UI_TEXT_LEFT;
+ }
+ uiSetCurFont(block, block->font);
+ }
+
+ for(a=0; a<md->nitems; a++) {
+
+ x1= startx + width*((int)(md->nitems-a-1)/rows);
+ y1= starty - boxh*(rows - ((md->nitems - a - 1)%rows)) + (rows*boxh);
+
+ if (strcmp(md->items[md->nitems-a-1].str, "%l")==0) {
+ bt= uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, "");
+ }
+ else if(md->items[md->nitems-a-1].icon) {
+ bt= uiDefIconTextButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].icon ,md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
+ }
+ else {
+ bt= uiDefButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
+ }
+ }
+
+ menudata_free(md);
+
+ /* the code up here has flipped locations, because of change of preferred order */
+ /* thats why we have to switch list order too, to make arrowkeys work */
+
+ lb.first= lb.last= NULL;
+ bt= block->buttons.first;
+ while(bt) {
+ uiBut *next= bt->next;
+ BLI_remlink(&block->buttons, bt);
+ BLI_addhead(&lb, bt);
+ bt= next;
+ }
+ block->buttons= lb;
+
+ block->direction= UI_TOP;
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+uiBlock *ui_block_func_ICONROW(bContext *C, uiMenuBlockHandle *handle, void *arg_but)
+{
+ uiBut *but= arg_but;
+ uiBlock *block;
+ int a;
+
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
+ block->themecol= TH_MENU_ITEM;
+
+ for(a=(int)but->min; a<=(int)but->max; a++) {
+ uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->min), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, &handle->retvalue, (float)a, 0.0, 0, 0, "");
+ }
+
+ block->direction= UI_TOP;
+
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+uiBlock *ui_block_func_ICONTEXTROW(bContext *C, uiMenuBlockHandle *handle, void *arg_but)
+{
+ uiBut *but= arg_but;
+ uiBlock *block;
+ MenuData *md;
+ int width, xmax, ypos, a;
+
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
+ block->themecol= TH_MENU_ITEM;
+
+ md= decompose_menu_string(but->str);
+
+ /* size and location */
+ /* expand menu width to fit labels */
+ if(md->title)
+ width= 2*strlen(md->title)+UI_GetStringWidth(block->curfont, md->title, ui_translate_menus());
+ else
+ width= 0;
+
+ for(a=0; a<md->nitems; a++) {
+ xmax= UI_GetStringWidth(block->curfont, md->items[a].str, ui_translate_menus());
+ if(xmax>width) width= xmax;
+ }
+
+ width+= 30;
+ if (width<50) width=50;
+
+ ypos = 1;
+
+ /* loop through the menu options and draw them out with icons & text labels */
+ for(a=0; a<md->nitems; a++) {
+
+ /* add a space if there's a separator (%l) */
+ if (strcmp(md->items[a].str, "%l")==0) {
+ ypos +=3;
+ }
+ else {
+ uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(md->items[a].retval-but->min)), md->items[a].str, 0, ypos,(short)width, 19, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
+ ypos += 20;
+ }
+ }
+
+ if(md->title) {
+ uiBut *bt;
+ uiSetCurFont(block, block->font+1);
+ bt= uiDefBut(block, LABEL, 0, md->title, 0, ypos, (short)width, 19, NULL, 0.0, 0.0, 0, 0, "");
+ uiSetCurFont(block, block->font);
+ bt->flag= UI_TEXT_LEFT;
+ }
+
+ menudata_free(md);
+
+ block->direction= UI_TOP;
+
+ uiBoundsBlock(block, 3);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void ui_warp_pointer(short x, short y)
+{
+ /* XXX 2.50 which function to use for this? */
+#if 0
+ /* OSX has very poor mousewarp support, it sends events;
+ this causes a menu being pressed immediately ... */
+ #ifndef __APPLE__
+ warp_pointer(x, y);
+ #endif
+#endif
+}
+
+/********************* Color Button ****************/
+
+/* picker sizes S hsize, F full size, D spacer, B button/pallette height */
+#define SPICK 110.0
+#define FPICK 180.0
+#define DPICK 6.0
+#define BPICK 24.0
+
+#define UI_PALETTE_TOT 16
+/* note; in tot+1 the old color is stored */
+static float palette[UI_PALETTE_TOT+1][3]= {
+{0.93, 0.83, 0.81}, {0.88, 0.89, 0.73}, {0.69, 0.81, 0.57}, {0.51, 0.76, 0.64},
+{0.37, 0.56, 0.61}, {0.33, 0.29, 0.55}, {0.46, 0.21, 0.51}, {0.40, 0.12, 0.18},
+{1.0, 1.0, 1.0}, {0.85, 0.85, 0.85}, {0.7, 0.7, 0.7}, {0.56, 0.56, 0.56},
+{0.42, 0.42, 0.42}, {0.28, 0.28, 0.28}, {0.14, 0.14, 0.14}, {0.0, 0.0, 0.0}
+};
+
+/* for picker, while editing hsv */
+void ui_set_but_hsv(uiBut *but)
+{
+ float col[3];
+
+ hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2);
+ ui_set_but_vectorf(but, col);
+}
+
+static void update_picker_hex(uiBlock *block, float *rgb)
+{
+ uiBut *bt;
+ char col[16];
+
+ sprintf(col, "%02X%02X%02X", (unsigned int)(rgb[0]*255.0), (unsigned int)(rgb[1]*255.0), (unsigned int)(rgb[2]*255.0));
+
+ // this updates button strings, is hackish... but button pointers are on stack of caller function
+
+ for(bt= block->buttons.first; bt; bt= bt->next) {
+ if(strcmp(bt->str, "Hex: ")==0) {
+ strcpy(bt->poin, col);
+ ui_check_but(bt);
+ break;
+ }
+ }
+}
+
+void ui_update_block_buts_hsv(uiBlock *block, float *hsv)
+{
+ uiBut *bt;
+ float r, g, b;
+ float rgb[3];
+
+ // this updates button strings, is hackish... but button pointers are on stack of caller function
+ hsv_to_rgb(hsv[0], hsv[1], hsv[2], &r, &g, &b);
+
+ rgb[0] = r; rgb[1] = g; rgb[2] = b;
+ update_picker_hex(block, rgb);
+
+ for(bt= block->buttons.first; bt; bt= bt->next) {
+ if(bt->type==HSVCUBE) {
+ VECCOPY(bt->hsv, hsv);
+ ui_set_but_hsv(bt);
+ }
+ else if(bt->str[1]==' ') {
+ if(bt->str[0]=='R') {
+ ui_set_but_val(bt, r);
+ }
+ else if(bt->str[0]=='G') {
+ ui_set_but_val(bt, g);
+ }
+ else if(bt->str[0]=='B') {
+ ui_set_but_val(bt, b);
+ }
+ else if(bt->str[0]=='H') {
+ ui_set_but_val(bt, hsv[0]);
+ }
+ else if(bt->str[0]=='S') {
+ ui_set_but_val(bt, hsv[1]);
+ }
+ else if(bt->str[0]=='V') {
+ ui_set_but_val(bt, hsv[2]);
+ }
+ }
+ }
+}
+
+static void ui_update_block_buts_hex(uiBlock *block, char *hexcol)
+{
+ uiBut *bt;
+ float r=0, g=0, b=0;
+ float h, s, v;
+
+
+ // this updates button strings, is hackish... but button pointers are on stack of caller function
+ hex_to_rgb(hexcol, &r, &g, &b);
+ rgb_to_hsv(r, g, b, &h, &s, &v);
+
+ for(bt= block->buttons.first; bt; bt= bt->next) {
+ if(bt->type==HSVCUBE) {
+ bt->hsv[0] = h;
+ bt->hsv[1] = s;
+ bt->hsv[2] = v;
+ ui_set_but_hsv(bt);
+ }
+ else if(bt->str[1]==' ') {
+ if(bt->str[0]=='R') {
+ ui_set_but_val(bt, r);
+ }
+ else if(bt->str[0]=='G') {
+ ui_set_but_val(bt, g);
+ }
+ else if(bt->str[0]=='B') {
+ ui_set_but_val(bt, b);
+ }
+ else if(bt->str[0]=='H') {
+ ui_set_but_val(bt, h);
+ }
+ else if(bt->str[0]=='S') {
+ ui_set_but_val(bt, s);
+ }
+ else if(bt->str[0]=='V') {
+ ui_set_but_val(bt, v);
+ }
+ }
+ }
+}
+
+/* bt1 is palette but, col1 is original color */
+/* callback to copy from/to palette */
+static void do_palette_cb(bContext *C, void *bt1, void *col1)
+{
+ uiBut *but1= (uiBut *)bt1;
+ float *col= (float *)col1;
+ float *fp, hsv[3];
+
+ fp= (float *)but1->poin;
+
+ /* XXX 2.50 bad access, how to solve?
+ *
+ if( (get_qual() & LR_CTRLKEY) ) {
+ VECCOPY(fp, col);
+ }
+ else*/ {
+ VECCOPY(col, fp);
+ }
+
+ rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
+ ui_update_block_buts_hsv(but1->block, hsv);
+ update_picker_hex(but1->block, col);
+}
+
+/* bt1 is num but, hsv1 is pointer to original color in hsv space*/
+/* callback to handle changes in num-buts in picker */
+static void do_palette1_cb(bContext *C, void *bt1, void *hsv1)
+{
+ uiBut *but1= (uiBut *)bt1;
+ float *hsv= (float *)hsv1;
+ float *fp= NULL;
+
+ if(but1->str[1]==' ') {
+ if(but1->str[0]=='R') fp= (float *)but1->poin;
+ else if(but1->str[0]=='G') fp= ((float *)but1->poin)-1;
+ else if(but1->str[0]=='B') fp= ((float *)but1->poin)-2;
+ }
+ if(fp) {
+ rgb_to_hsv(fp[0], fp[1], fp[2], hsv, hsv+1, hsv+2);
+ }
+ ui_update_block_buts_hsv(but1->block, hsv);
+}
+
+/* bt1 is num but, col1 is pointer to original color */
+/* callback to handle changes in num-buts in picker */
+static void do_palette2_cb(bContext *C, void *bt1, void *col1)
+{
+ uiBut *but1= (uiBut *)bt1;
+ float *rgb= (float *)col1;
+ float *fp= NULL;
+
+ if(but1->str[1]==' ') {
+ if(but1->str[0]=='H') fp= (float *)but1->poin;
+ else if(but1->str[0]=='S') fp= ((float *)but1->poin)-1;
+ else if(but1->str[0]=='V') fp= ((float *)but1->poin)-2;
+ }
+ if(fp) {
+ hsv_to_rgb(fp[0], fp[1], fp[2], rgb, rgb+1, rgb+2);
+ }
+ ui_update_block_buts_hsv(but1->block, fp);
+}
+
+static void do_palette_hex_cb(bContext *C, void *bt1, void *hexcl)
+{
+ uiBut *but1= (uiBut *)bt1;
+ char *hexcol= (char *)hexcl;
+
+ ui_update_block_buts_hex(but1->block, hexcol);
+}
+
+/* used for both 3d view and image window */
+static void do_palette_sample_cb(bContext *C, void *bt1, void *col1) /* frontbuf */
+{
+ /* XXX 2.50 this should become an operator? */
+#if 0
+ uiBut *but1= (uiBut *)bt1;
+ uiBut *but;
+ float tempcol[4];
+ int x=0, y=0;
+ short mval[2];
+ float hsv[3];
+ short capturing;
+ int oldcursor;
+ Window *win;
+ unsigned short dev;
+
+ oldcursor=get_cursor();
+ win=winlay_get_active_window();
+
+ while (get_mbut() & L_MOUSE) UI_wait_for_statechange();
+
+ SetBlenderCursor(BC_EYEDROPPER_CURSOR);
+
+ /* loop and wait for a mouse click */
+ capturing = TRUE;
+ while(capturing) {
+ char ascii;
+ short val;
+
+ dev = extern_qread_ext(&val, &ascii);
+
+ if(dev==INPUTCHANGE) break;
+ if(get_mbut() & R_MOUSE) break;
+ else if(get_mbut() & L_MOUSE) {
+ uiGetMouse(mywinget(), mval);
+ x= mval[0]; y= mval[1];
+
+ capturing = FALSE;
+ break;
+ }
+ else if(dev==ESCKEY) break;
+ }
+ window_set_cursor(win, oldcursor);
+
+ if(capturing) return;
+
+ if(x<0 || y<0) return;
+
+ /* if we've got a glick, use OpenGL to sample the color under the mouse pointer */
+ glReadBuffer(GL_FRONT);
+ glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol);
+ glReadBuffer(GL_BACK);
+
+ /* and send that color back to the picker */
+ rgb_to_hsv(tempcol[0], tempcol[1], tempcol[2], hsv, hsv+1, hsv+2);
+ ui_update_block_buts_hsv(but1->block, hsv);
+ update_picker_hex(but1->block, tempcol);
+
+ for (but= but1->block->buttons.first; but; but= but->next) {
+ ui_check_but(but);
+ ui_draw_but(but);
+ }
+
+ but= but1->block->buttons.first;
+ ui_block_flush_back(but->block);
+#endif
+}
+
+/* color picker, Gimp version. mode: 'f' = floating panel, 'p' = popup */
+/* col = read/write to, hsv/old/hexcol = memory for temporal use */
+void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval)
+{
+ uiBut *bt;
+ float h, offs;
+ int a;
+
+ VECCOPY(old, col); // old color stored there, for palette_cb to work
+
+ // the cube intersection
+ bt= uiDefButF(block, HSVCUBE, retval, "", 0,DPICK+BPICK,FPICK,FPICK, col, 0.0, 0.0, 2, 0, "");
+ uiButSetFlag(bt, UI_NO_HILITE);
+
+ bt= uiDefButF(block, HSVCUBE, retval, "", 0,0,FPICK,BPICK, col, 0.0, 0.0, 3, 0, "");
+ uiButSetFlag(bt, UI_NO_HILITE);
+
+ // palette
+
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ bt=uiDefButF(block, COL, retval, "", FPICK+DPICK, 0, BPICK,BPICK, old, 0.0, 0.0, -1, 0, "Old color, click to restore");
+ uiButSetFunc(bt, do_palette_cb, bt, col);
+ uiDefButF(block, COL, retval, "", FPICK+DPICK, BPICK+DPICK, BPICK,60-BPICK-DPICK, col, 0.0, 0.0, -1, 0, "Active color");
+
+ h= (DPICK+BPICK+FPICK-64)/(UI_PALETTE_TOT/2.0);
+ uiBlockBeginAlign(block);
+ for(a= -1+UI_PALETTE_TOT/2; a>=0; a--) {
+ bt= uiDefButF(block, COL, retval, "", FPICK+DPICK, 65.0+(float)a*h, BPICK/2, h, palette[a+UI_PALETTE_TOT/2], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette");
+ uiButSetFunc(bt, do_palette_cb, bt, col);
+ bt= uiDefButF(block, COL, retval, "", FPICK+DPICK+BPICK/2, 65.0+(float)a*h, BPICK/2, h, palette[a], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette");
+ uiButSetFunc(bt, do_palette_cb, bt, col);
+ }
+ uiBlockEndAlign(block);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ // buttons
+ rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
+ sprintf(hexcol, "%02X%02X%02X", (unsigned int)(col[0]*255.0), (unsigned int)(col[1]*255.0), (unsigned int)(col[2]*255.0));
+
+ offs= FPICK+2*DPICK+BPICK;
+
+ /* note; made this a TOG now, with NULL pointer. Is because BUT now gets handled with a afterfunc */
+ bt= uiDefIconTextBut(block, TOG, UI_RETURN_OK, ICON_EYEDROPPER, "Sample", offs+55, 170, 85, 20, NULL, 0, 0, 0, 0, "Sample the color underneath the following mouse click (ESC or RMB to cancel)");
+ uiButSetFunc(bt, do_palette_sample_cb, bt, col);
+ uiButSetFlag(bt, UI_TEXT_LEFT);
+
+ bt= uiDefBut(block, TEX, retval, "Hex: ", offs, 140, 140, 20, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
+ uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol);
+
+ uiBlockBeginAlign(block);
+ bt= uiDefButF(block, NUMSLI, retval, "R ", offs, 110, 140,20, col, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette1_cb, bt, hsv);
+ bt= uiDefButF(block, NUMSLI, retval, "G ", offs, 90, 140,20, col+1, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette1_cb, bt, hsv);
+ bt= uiDefButF(block, NUMSLI, retval, "B ", offs, 70, 140,20, col+2, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette1_cb, bt, hsv);
+
+ uiBlockBeginAlign(block);
+ bt= uiDefButF(block, NUMSLI, retval, "H ", offs, 40, 140,20, hsv, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette2_cb, bt, col);
+ bt= uiDefButF(block, NUMSLI, retval, "S ", offs, 20, 140,20, hsv+1, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette2_cb, bt, col);
+ bt= uiDefButF(block, NUMSLI, retval, "V ", offs, 0, 140,20, hsv+2, 0.0, 1.0, 10, 3, "");
+ uiButSetFunc(bt, do_palette2_cb, bt, col);
+ uiBlockEndAlign(block);
+}
+
+uiBlock *ui_block_func_COL(bContext *C, uiMenuBlockHandle *handle, void *arg_but)
+{
+ uiBut *but= arg_but;
+ uiBlock *block;
+ static float hsvcol[3], oldcol[3];
+ static char hexcol[128];
+
+ block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS, UI_HELV);
+ block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN;
+ block->themecol= TH_BUT_NUM;
+
+ VECCOPY(handle->retvec, but->editvec);
+ uiBlockPickerButtons(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0);
+
+ /* and lets go */
+ block->direction= UI_TOP;
+ uiBoundsBlock(block, 3);
+
+ return block;
+}
+
+/* ******************** PUPmenu ****************** */
+
+static int pupmenu_set= 0;
+
+void pupmenu_set_active(int val)
+{
+ pupmenu_set= val;
+}
+
+/* value== -1 read, otherwise set */
+static int pupmenu_memory(char *str, int value)
+{
+ static char mem[256], first=1;
+ int val=0, nr=0;
+
+ if(first) {
+ memset(mem, 0, 256);
+ first= 0;
+ }
+ while(str[nr]) {
+ val+= str[nr];
+ nr++;
+ }
+
+ if(value >= 0) mem[ val & 255 ]= value;
+ else return mem[ val & 255 ];
+
+ return 0;
+}
+
+#define PUP_LABELH 6
+
+typedef struct uiPupMenuInfo {
+ char *instr;
+ int mx, my;
+ int startx, starty;
+ int maxrow;
+} uiPupMenuInfo;
+
+uiBlock *ui_block_func_PUPMENU(bContext *C, uiMenuBlockHandle *handle, void *arg_info)
+{
+ uiBlock *block;
+ uiPupMenuInfo *info;
+ int columns, rows, mousemove[2]= {0, 0}, mousewarp= 0;
+ int width, height, xmax, ymax, maxrow;
+ int a, startx, starty, endx, endy, x1, y1;
+ int lastselected;
+ MenuData *md;
+
+ info= arg_info;
+ maxrow= info->maxrow;
+ height= 0;
+
+ /* block stuff first, need to know the font */
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
+ block->themecol= TH_MENU_ITEM;
+
+ md= decompose_menu_string(info->instr);
+
+ rows= md->nitems;
+ columns= 1;
+
+ /* size and location, title slightly bigger for bold */
+ if(md->title) {
+ width= 2*strlen(md->title)+UI_GetStringWidth(uiBlockGetCurFont(block), md->title, ui_translate_buttons());
+ width /= columns;
+ }
+ else width= 0;
+
+ for(a=0; a<md->nitems; a++) {
+ xmax= UI_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, ui_translate_buttons());
+ if(xmax>width) width= xmax;
+
+ if(strcmp(md->items[a].str, "%l")==0) height+= PUP_LABELH;
+ else height+= MENU_BUTTON_HEIGHT;
+ }
+
+ width+= 10;
+ if (width<50) width=50;
+
+ wm_window_get_size(C->window, &xmax, &ymax);
+
+ /* set first item */
+ lastselected= 0;
+ if(pupmenu_set) {
+ lastselected= pupmenu_set-1;
+ pupmenu_set= 0;
+ }
+ else if(md->nitems>1) {
+ lastselected= pupmenu_memory(info->instr, -1);
+ }
+
+ startx= info->mx-(0.8*(width));
+ starty= info->my-height+MENU_BUTTON_HEIGHT/2;
+ if(lastselected>=0 && lastselected<md->nitems) {
+ for(a=0; a<md->nitems; a++) {
+ if(a==lastselected) break;
+ if( strcmp(md->items[a].str, "%l")==0) starty+= PUP_LABELH;
+ else starty+=MENU_BUTTON_HEIGHT;
+ }
+
+ //starty= info->my-height+MENU_BUTTON_HEIGHT/2+lastselected*MENU_BUTTON_HEIGHT;
+ }
+
+ if(startx<10) {
+ startx= 10;
+ }
+ if(starty<10) {
+ mousemove[1]= 10-starty;
+ starty= 10;
+ }
+
+ endx= startx+width*columns;
+ endy= starty+height;
+
+ if(endx>xmax) {
+ endx= xmax-10;
+ startx= endx-width*columns;
+ }
+ if(endy>ymax-20) {
+ mousemove[1]= ymax-endy-20;
+ endy= ymax-20;
+ starty= endy-height;
+ }
+
+ if(mousemove[0] || mousemove[1]) {
+ ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]);
+ mousemove[0]= info->mx;
+ mousemove[1]= info->my;
+ mousewarp= 1;
+ }
+
+ /* here we go! */
+ if(md->title) {
+ uiBut *bt;
+ char titlestr[256];
+ uiSetCurFont(block, UI_HELVB);
+
+ if(md->titleicon) {
+ width+= 20;
+ sprintf(titlestr, " %s", md->title);
+ uiDefIconTextBut(block, LABEL, 0, md->titleicon, titlestr, startx, (short)(starty+height), width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
+ }
+ else {
+ bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+height), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
+ bt->flag= UI_TEXT_LEFT;
+ }
+ uiSetCurFont(block, UI_HELV);
+ }
+
+ x1= startx + width*((int)a/rows);
+ y1= starty + height - MENU_BUTTON_HEIGHT;
+
+ for(a=0; a<md->nitems; a++) {
+ char *name= md->items[a].str;
+ int icon = md->items[a].icon;
+
+ if(strcmp(name, "%l")==0) {
+ uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
+ y1 -= PUP_LABELH;
+ }
+ else if (icon) {
+ uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
+ y1 -= MENU_BUTTON_HEIGHT;
+ }
+ else {
+ uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
+ y1 -= MENU_BUTTON_HEIGHT;
+ }
+ }
+
+ uiBoundsBlock(block, 1);
+ uiEndBlock(C, block);
+
+ menudata_free(md);
+
+ /* XXX 2.5 need to store last selected */
+#if 0
+ /* calculate last selected */
+ if(event & ui_return_ok) {
+ lastselected= 0;
+ for(a=0; a<md->nitems; a++) {
+ if(val==md->items[a].retval) lastselected= a;
+ }
+
+ pupmenu_memory(info->instr, lastselected);
+ }
+#endif
+
+ /* XXX 2.5 need to warp back */
+#if 0
+ if(mousemove[1] && (event & ui_return_out)==0)
+ ui_warp_pointer(mousemove[0], mousemove[1]);
+ return val;
+#endif
+
+ return block;
+}
+
+uiBlock *ui_block_func_PUPMENUCOL(bContext *C, uiMenuBlockHandle *handle, void *arg_info)
+{
+ uiBlock *block;
+ uiPupMenuInfo *info;
+ int columns, rows, mousemove[2]= {0, 0}, mousewarp;
+ int width, height, xmax, ymax, maxrow;
+ int a, startx, starty, endx, endy, x1, y1;
+ float fvalue;
+ MenuData *md;
+
+ info= arg_info;
+ maxrow= info->maxrow;
+ height= 0;
+
+ /* block stuff first, need to know the font */
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
+ block->themecol= TH_MENU_ITEM;
+
+ md= decompose_menu_string(info->instr);
+
+ /* columns and row calculation */
+ columns= (md->nitems+maxrow)/maxrow;
+ if (columns<1) columns= 1;
+
+ if(columns > 8) {
+ maxrow += 5;
+ columns= (md->nitems+maxrow)/maxrow;
+ }
+
+ rows= (int) md->nitems/columns;
+ if (rows<1) rows= 1;
+
+ while (rows*columns<(md->nitems+columns) ) rows++;
+
+ /* size and location, title slightly bigger for bold */
+ if(md->title) {
+ width= 2*strlen(md->title)+UI_GetStringWidth(uiBlockGetCurFont(block), md->title, ui_translate_buttons());
+ width /= columns;
+ }
+ else width= 0;
+
+ for(a=0; a<md->nitems; a++) {
+ xmax= UI_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, ui_translate_buttons());
+ if(xmax>width) width= xmax;
+ }
+
+ width+= 10;
+ if (width<50) width=50;
+
+ height= rows*MENU_BUTTON_HEIGHT;
+ if (md->title) height+= MENU_BUTTON_HEIGHT;
+
+ wm_window_get_size(C->window, &xmax, &ymax);
+
+ /* find active item */
+ fvalue= handle->retvalue;
+ for(a=0; a<md->nitems; a++) {
+ if( md->items[a].retval== (int)fvalue ) break;
+ }
+
+ /* no active item? */
+ if(a==md->nitems) {
+ if(md->title) a= -1;
+ else a= 0;
+ }
+
+ if(a>0)
+ startx = info->mx-width/2 - ((int)(a)/rows)*width;
+ else
+ startx= info->mx-width/2;
+ starty = info->my-height + MENU_BUTTON_HEIGHT/2 + ((a)%rows)*MENU_BUTTON_HEIGHT;
+
+ if (md->title) starty+= MENU_BUTTON_HEIGHT;
+
+ if(startx<10) {
+ mousemove[0]= 10-startx;
+ startx= 10;
+ }
+ if(starty<10) {
+ mousemove[1]= 10-starty;
+ starty= 10;
+ }
+
+ endx= startx+width*columns;
+ endy= starty+height;
+
+ if(endx>xmax) {
+ mousemove[0]= xmax-endx-10;
+ endx= xmax-10;
+ startx= endx-width*columns;
+ }
+ if(endy>ymax) {
+ mousemove[1]= ymax-endy-10;
+ endy= ymax-10;
+ starty= endy-height;
+ }
+
+ if(mousemove[0] || mousemove[1]) {
+ ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]);
+ mousemove[0]= info->mx;
+ mousemove[1]= info->my;
+ mousewarp= 1;
+ }
+
+ /* here we go! */
+ if(md->title) {
+ uiBut *bt;
+ uiSetCurFont(block, UI_HELVB);
+
+ if(md->titleicon) {
+ }
+ else {
+ bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*MENU_BUTTON_HEIGHT), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, "");
+ bt->flag= UI_TEXT_LEFT;
+ }
+ uiSetCurFont(block, UI_HELV);
+ }
+
+ for(a=0; a<md->nitems; a++) {
+ char *name= md->items[a].str;
+ int icon = md->items[a].icon;
+
+ x1= startx + width*((int)a/rows);
+ y1= starty - MENU_BUTTON_HEIGHT*(a%rows) + (rows-1)*MENU_BUTTON_HEIGHT;
+
+ if(strcmp(name, "%l")==0) {
+ uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
+ y1 -= PUP_LABELH;
+ }
+ else if (icon) {
+ uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
+ y1 -= MENU_BUTTON_HEIGHT;
+ }
+ else {
+ uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, "");
+ y1 -= MENU_BUTTON_HEIGHT;
+ }
+ }
+
+ uiBoundsBlock(block, 1);
+ uiEndBlock(C, block);
+
+#if 0
+ event= uiDoBlocks(&listb, 0, 1);
+#endif
+
+ menudata_free(md);
+
+ /* XXX 2.5 need to warp back */
+#if 0
+ if((event & UI_RETURN_OUT)==0)
+ ui_warp_pointer(mousemove[0], mousemove[1]);
+#endif
+
+ return block;
+}
+
+uiMenuBlockHandle *pupmenu_col(bContext *C, char *instr, int mx, int my, int maxrow)
+{
+ uiPupMenuInfo info;
+
+ memset(&info, 0, sizeof(info));
+ info.instr= instr;
+ info.mx= mx;
+ info.my= my;
+ info.maxrow= maxrow;
+
+ return ui_menu_block_create(C, NULL, NULL, ui_block_func_PUPMENUCOL, &info);
+}
+
+uiMenuBlockHandle *pupmenu(bContext *C, char *instr, int mx, int my)
+{
+ uiPupMenuInfo info;
+
+ memset(&info, 0, sizeof(info));
+ info.instr= instr;
+ info.mx= mx;
+ info.my= my;
+
+ return ui_menu_block_create(C, NULL, NULL, ui_block_func_PUPMENU, &info);
+}
+
+
+void pupmenu_free(bContext *C, uiMenuBlockHandle *handle)
+{
+ ui_menu_block_free(C, handle);
+}
+
+/*************** Temporary Buttons Tests **********************/
+
+static uiBlock *test_submenu(bContext *C, uiMenuBlockHandle *handle, void *arg)
+{
+ ARegion *ar= handle->region;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, ar, "test_viewmenu", UI_EMBOSSP, UI_HELV);
+ //uiBlockSetButmFunc(block, do_test_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT,
+ "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT,
+ "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static uiBlock *test_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_area)
+{
+ ScrArea *area= arg_area;
+ ARegion *ar= handle->region;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, ar, "test_viewmenu", UI_EMBOSSP, UI_HELV);
+ //uiBlockSetButmFunc(block, do_test_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT,
+ "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT,
+ "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBlockBut(block, test_submenu, NULL, ICON_RIGHTARROW_THIN, "Sub Menu", 0, yco-=20, 120, 19, "");
+ uiDefIconTextBlockBut(block, test_submenu, NULL, ICON_RIGHTARROW_THIN, "Sub Menu", 0, yco-=20, 120, 19, "");
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ if(area->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+void uiTestRegion(const bContext *C)
+{
+ uiBlock *block;
+ short xco;
+
+ static float testcol[3];
+ static char testtext[64];
+ static float testnumf=5.0f;
+ static short testchoice= 0, testtog= 0, testicontog= 0;
+
+#if 0
+ static CurveMapping *cumap= NULL;
+ static ColorBand *coba= NULL;
+#endif
+
+ block= uiBeginBlock(C, C->region, "header buttons", UI_EMBOSS, UI_HELV);
+
+ uiDefPulldownBut(block, test_viewmenu, C->area, "View",
+ 13, 1, 50, 24, "");
+
+ uiDefBut(block, BUT, 31415, "Type BUT",
+ 13+50+5, 3, 80, 20, NULL, 0, 0, 0, 0, "A tooltip.");
+ uiDefButS(block, MENU, 31416, "Gather Method%t|Raytrace %x0|Approximate %x1",
+ 13+50+5+80+5, 3, 100, 20, &testchoice, 0, 0, 0, 0, "Method for occlusion gathering");
+ uiDefButBitS(block, TOG, 1, 31417, "Pixel Cache",
+ 13+50+5+80+5+100+5, 3, 100, 20, &testtog, 0, 0, 0, 0, "Cache AO results in pixels and interpolate over neighbouring pixels for speedup.");
+
+ uiDefBut(block, TEX, 31418, "Text: ",
+ 13+50+5+80+5+100+5+100+5, 3, 200, 20, testtext, 0, sizeof(testtext), 0, 0, "User defined text");
+
+ uiDefButF(block, NUMSLI, 31419, "Slider: ",
+ 13+50+5+80+5+100+5+100+5+200+5, 3, 150, 20, &testnumf, 0.0, 10.0, 0, 0, "Some tooltip.");
+ uiDefButF(block, NUM, 31419, "N: ",
+ 13+50+5+80+5+100+5+100+5+200+5+150+5, 3, 100, 20, &testnumf, 0.0, 10.0, 0, 0, "Some tooltip.");
+
+ uiDefButF(block, COL, 3142, "",
+ 13+50+5+80+5+100+5+100+5+200+5+150+5+100+5, 3, 100, 20, testcol, 0, 0, 0, 0 /*B_BANDCOL*/, "");
+
+ xco = 13+50+5+80+5+100+5+100+5+200+5+150+5+100+5+100+5;
+ uiDefIconButBitS(block, ICONTOG, 1 /*AUTOKEY_ON*/, REDRAWINFO, ICON_PYTHON,
+ xco, 3, 20, 20, &testicontog, 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
+ xco += 5;
+
+#if 0
+ if(!cumap) {
+ cumap= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+ cumap->flag &= ~CUMA_DO_CLIP;
+ }
+ if(!coba)
+ coba= add_colorband(0);
+
+ uiDefBut(block, BUT_CURVE, 3143, "",
+ 13+400, 33, 100, 100, cumap, 0.0f, 1.0f, 0, 0, "");
+ uiDefBut(block, BUT_COLORBAND, 3143, "",
+ 13+400+100+10, 33, 150, 30, coba, 0.0f, 1.0f, 0, 0, "");
+#endif
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
diff --git a/source/blender/src/resources.c b/source/blender/editors/interface/resources.c
index 5481f717971..6e498a5fc29 100644
--- a/source/blender/src/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1,12 +1,15 @@
/**
- * $Id$
+ * $Id: resources.c 12755 2007-12-02 05:50:38Z aligorith $
*
- * ***** BEGIN GPL LICENSE BLOCK *****
+ * ***** BEGIN GPL/BL DUAL 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,7 +27,7 @@
*
* Contributor(s): none yet.
*
- * ***** END GPL LICENSE BLOCK *****
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include <math.h>
@@ -48,13 +51,12 @@
#include "BKE_utildefines.h"
#include "BIF_gl.h"
-#include "BIF_resources.h"
-#include "BIF_interface_icons.h"
+
+#include "UI_resources.h"
+#include "UI_interface_icons.h"
+//#include "UI_icons.h"
#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-#include "blendef.h" // CLAMP
-#include "datatoc.h"
/* global for themes */
typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
@@ -63,14 +65,14 @@ static bTheme *theme_active=NULL;
static int theme_spacetype= SPACE_VIEW3D;
-void BIF_resources_init(void)
+void ui_resources_init(void)
{
- BIF_icons_init(BIFICONID_LAST+1);
+ UI_icons_init(BIFICONID_LAST+1);
}
-void BIF_resources_free(void)
+void ui_resources_free(void)
{
- BIF_icons_free();
+ UI_icons_free();
}
@@ -78,7 +80,7 @@ void BIF_resources_free(void)
/* THEMES */
/* ******************************************************** */
-char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
+char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
{
ThemeSpace *ts= NULL;
static char error[4]={240, 0, 240, 255};
@@ -313,15 +315,7 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
cp= ts->transition; break;
case TH_SEQ_META:
cp= ts->meta; break;
- case TH_HANDLE_VERTEX:
- cp= ts->handle_vertex;
- break;
- case TH_HANDLE_VERTEX_SELECT:
- cp= ts->handle_vertex_select;
- break;
- case TH_HANDLE_VERTEX_SIZE:
- cp= &ts->handle_vertex_size;
- break;
+
}
}
@@ -336,7 +330,7 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
Note: when you add new colors, created & saved themes need initialized
in usiblender.c, search for "versionfile"
*/
-void BIF_InitTheme(void)
+void ui_theme_init_userdef(void)
{
bTheme *btheme= U.themes.first;
@@ -351,19 +345,19 @@ void BIF_InitTheme(void)
strcpy(btheme->name, "Default");
}
- BIF_SetTheme(NULL); // make sure the global used in this file is set
+ UI_SetTheme(NULL); // make sure the global used in this file is set
/* UI buttons (todo) */
SETCOL(btheme->tui.outline, 0xA0,0xA0,0xA0, 255);
- SETCOL(btheme->tui.neutral, 0xA0,0xA0,0xA0, 255);
- SETCOL(btheme->tui.action, 0xAD,0xA0,0x93, 255);
- SETCOL(btheme->tui.setting, 0x8A,0x9E,0xA1, 255);
- SETCOL(btheme->tui.setting1, 0xA1,0xA1,0xAE, 255);
- SETCOL(btheme->tui.setting2, 0xA1,0x99,0xA7, 255);
- SETCOL(btheme->tui.num, 0x90,0x90,0x90, 255);
- SETCOL(btheme->tui.textfield, 0x90,0x90,0x90, 255);
- SETCOL(btheme->tui.textfield_hi,0xc6,0x77,0x77, 255);
- SETCOL(btheme->tui.popup, 0xA0,0xA0,0xA0, 255);
+ SETCOL(btheme->tui.neutral, 180, 180, 180, 255);
+ SETCOL(btheme->tui.action, 180, 180, 180, 255);
+ SETCOL(btheme->tui.setting, 180, 180, 180, 255);
+ SETCOL(btheme->tui.setting1, 180, 180, 180, 255);
+ SETCOL(btheme->tui.setting2, 180, 180, 180, 255);
+ SETCOL(btheme->tui.num, 143, 143, 143, 255);
+ SETCOL(btheme->tui.textfield, 143, 142, 143, 255);
+ SETCOL(btheme->tui.textfield_hi,255, 151, 26, 255);
+ SETCOL(btheme->tui.popup, 174, 174, 174, 255);
SETCOL(btheme->tui.text, 0,0,0, 255);
SETCOL(btheme->tui.text_hi, 255, 255, 255, 255);
@@ -373,72 +367,10 @@ void BIF_InitTheme(void)
SETCOL(btheme->tui.menu_hilite, 0x7F,0x7F,0x7F, 255);
SETCOL(btheme->tui.menu_text, 0, 0, 0, 255);
SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255);
- btheme->tui.but_drawtype= TH_SHADED;
+ btheme->tui.but_drawtype= TH_ROUNDSHADED;
BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile));
- /* bone color sets */
- /* set 1 */
- SETCOL(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
- SETCOL(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
- SETCOL(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
- /* set 2 */
- SETCOL(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
- SETCOL(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
- SETCOL(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
- /* set 3 */
- SETCOL(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
- SETCOL(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
- SETCOL(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
- /* set 4 */
- SETCOL(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
- SETCOL(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
- SETCOL(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
- /* set 5 */
- SETCOL(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
- SETCOL(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
- SETCOL(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
- /* set 6 */
- SETCOL(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
- SETCOL(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
- SETCOL(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
- /* set 7 */
- SETCOL(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
- SETCOL(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
- SETCOL(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
- /* set 8 */
- SETCOL(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
- SETCOL(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
- SETCOL(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
- /* set 9 */
- SETCOL(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
- SETCOL(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
- SETCOL(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
- /* set 10 */
- SETCOL(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
- SETCOL(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
- SETCOL(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
- /* set 11 */
- SETCOL(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
- SETCOL(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
- SETCOL(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
- /* set 12 */
- SETCOL(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
- SETCOL(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
- SETCOL(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
- /* set 13 */
- SETCOL(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
- SETCOL(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
- SETCOL(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
- /* set 14 */
- SETCOL(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
- SETCOL(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
- SETCOL(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
- /* set 15 */
- SETCOL(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
- SETCOL(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
- SETCOL(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
-
/* space view3d */
SETCOL(btheme->tv3d.back, 115, 115, 115, 255);
SETCOL(btheme->tv3d.text, 0, 0, 0, 255);
@@ -463,10 +395,7 @@ void BIF_InitTheme(void)
SETCOL(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
SETCOL(btheme->tv3d.edge_select, 0xb0, 0xb0, 0x30, 255);
SETCOL(btheme->tv3d.edge_seam, 230, 150, 50, 255);
- SETCOL(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
SETCOL(btheme->tv3d.edge_facesel, 75, 75, 75, 255);
- SETCOL(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
-
SETCOL(btheme->tv3d.face, 0, 50, 150, 30);
SETCOL(btheme->tv3d.face_select, 200, 100, 200, 60);
SETCOL(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
@@ -501,10 +430,6 @@ void BIF_InitTheme(void)
SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
btheme->tipo.vertex_size= 3;
- SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255);
- SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255);
- btheme->tipo.handle_vertex_size= 3;
-
/* space file */
/* to have something initialized */
btheme->tfile= btheme->tv3d;
@@ -528,8 +453,6 @@ void BIF_InitTheme(void)
SETCOL(btheme->tact.hilite, 17, 27, 60, 100); // bar
SETCOL(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 255);
SETCOL(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 255);
- SETCOL(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
- SETCOL(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
/* space nla */
btheme->tnla= btheme->tv3d;
@@ -621,9 +544,9 @@ void BIF_InitTheme(void)
}
-char *BIF_ThemeColorsPup(int spacetype)
+char *UI_ThemeColorsPup(int spacetype)
{
- char *cp= MEM_callocN(32*64, "theme pup");
+ char *cp= MEM_callocN(32*32, "theme pup");
char *str = cp;
if(spacetype==0) {
@@ -684,7 +607,7 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Active Vert/Edge/Face %%x%d|", TH_EDITMESH_ACTIVE);
str += sprintf(str, "Normal %%x%d|", TH_NORMAL);
str += sprintf(str, "Bone Solid %%x%d|", TH_BONE_SOLID);
- str += sprintf(str, "Bone Pose %%x%d|", TH_BONE_POSE);
+ str += sprintf(str, "Bone Pose %%x%d", TH_BONE_POSE);
str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
break;
case SPACE_IPO:
@@ -696,10 +619,7 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Vertex %%x%d|", TH_VERTEX);
str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT);
str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE);
- str += sprintf(str, "Current Frame %%x%d|", TH_CFRAME);
- str += sprintf(str, "Handle Vertex %%x%d|", TH_HANDLE_VERTEX);
- str += sprintf(str, "Handle Vertex Selected %%x%d|", TH_HANDLE_VERTEX_SELECT);
- str += sprintf(str, "Handle Vertex Size %%x%d", TH_HANDLE_VERTEX_SIZE);
+ str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
break;
case SPACE_FILE:
str += sprintf(str, "Selected file %%x%d", TH_HILITE);
@@ -723,8 +643,6 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "View Sliders %%x%d|", TH_SHADE1);
str += sprintf(str, "Channels %%x%d|", TH_SHADE2);
str += sprintf(str, "Channels Selected %%x%d|", TH_HILITE);
- str += sprintf(str, "Channel Group %%x%d|", TH_GROUP);
- str += sprintf(str, "Active Channel Group %%x%d|", TH_GROUP_ACTIVE);
str += sprintf(str, "Long Key %%x%d|", TH_STRIP);
str += sprintf(str, "Long Key selected %%x%d|", TH_STRIP_SELECT);
str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
@@ -736,9 +654,6 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE);
str += sprintf(str, "Face %%x%d|", TH_FACE);
str += sprintf(str, "Face Selected %%x%d", TH_FACE_SELECT);
- str += sprintf(str, "Face Dot Selected %%x%d|", TH_FACE_DOT);
- str += sprintf(str, "Face Dot Size %%x%d|", TH_FACEDOT_SIZE);
- str += sprintf(str, "Active Vert/Edge/Face %%x%d|", TH_EDITMESH_ACTIVE);
break;
case SPACE_SEQ:
str += sprintf(str, "Grid %%x%d|", TH_GRID);
@@ -753,8 +668,6 @@ char *BIF_ThemeColorsPup(int spacetype)
str += sprintf(str, "Transition Strip %%x%d|", TH_SEQ_TRANSITION);
str += sprintf(str, "Meta Strip %%x%d|", TH_SEQ_META);
str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);
- str += sprintf(str, "Keyframe %%x%d|", TH_VERTEX_SELECT);
- str += sprintf(str, "Draw Action %%x%d|", TH_BONE_POSE);
break;
case SPACE_SOUND:
str += sprintf(str, "Grid %%x%d|", TH_GRID);
@@ -774,7 +687,6 @@ char *BIF_ThemeColorsPup(int spacetype)
break;
case SPACE_TEXT:
str += sprintf(str, "Scroll Bar %%x%d|", TH_SHADE1);
- str += sprintf(str, "Line Numbers Background %%x%d|", TH_GRID);
str += sprintf(str, "Selected Text %%x%d|", TH_SHADE2);
str += sprintf(str, "Cursor %%x%d|", TH_HILITE);
str += sprintf(str, "%%l|");
@@ -803,34 +715,7 @@ char *BIF_ThemeColorsPup(int spacetype)
return cp;
}
-char *BIF_ThemeColorSetsPup (short inc_custom)
-{
- DynStr *pupds= BLI_dynstr_new();
- char *str;
- char buf[48];
- int i;
-
- /* add title first (and the "default" entry) */
- BLI_dynstr_append(pupds, "Bone Color Set%t|Default Colors%x0|");
-
- /* loop through set indices, adding them */
- for (i=1; i<21; i++) {
- sprintf(buf, "%d - Theme Color Set%%x%d|", i, i);
- BLI_dynstr_append(pupds, buf);
- }
-
- /* add the 'custom' entry */
- if (inc_custom)
- BLI_dynstr_append(pupds, "Custom Set %x-1");
-
- /* convert to normal MEM_malloc'd string */
- str= BLI_dynstr_get_cstring(pupds);
- BLI_dynstr_free(pupds);
-
- return str;
-}
-
-void BIF_SetTheme(ScrArea *sa)
+void UI_SetTheme(ScrArea *sa)
{
if(sa==NULL) { // called for safety, when delete themes
theme_active= U.themes.first;
@@ -845,32 +730,32 @@ void BIF_SetTheme(ScrArea *sa)
}
// for space windows only
-void BIF_ThemeColor(int colorid)
+void UI_ThemeColor(int colorid)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
glColor3ub(cp[0], cp[1], cp[2]);
}
// plus alpha
-void BIF_ThemeColor4(int colorid)
+void UI_ThemeColor4(int colorid)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
glColor4ub(cp[0], cp[1], cp[2], cp[3]);
}
// set the color with offset for shades
-void BIF_ThemeColorShade(int colorid, int offset)
+void UI_ThemeColorShade(int colorid, int offset)
{
int r, g, b;
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
r= offset + (int) cp[0];
CLAMP(r, 0, 255);
g= offset + (int) cp[1];
@@ -880,12 +765,12 @@ void BIF_ThemeColorShade(int colorid, int offset)
//glColor3ub(r, g, b);
glColor4ub(r, g, b, cp[3]);
}
-void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
+void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
{
int r, g, b, a;
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
r= coloffset + (int) cp[0];
CLAMP(r, 0, 255);
g= coloffset + (int) cp[1];
@@ -898,13 +783,13 @@ void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
}
// blend between to theme colors, and set it
-void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac)
+void UI_ThemeColorBlend(int colorid1, int colorid2, float fac)
{
int r, g, b;
char *cp1, *cp2;
- cp1= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
- cp2= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
+ cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
+ cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0;
r= floor((1.0-fac)*cp1[0] + fac*cp2[0]);
@@ -915,13 +800,13 @@ void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac)
}
// blend between to theme colors, shade it, and set it
-void BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
+void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
{
int r, g, b;
char *cp1, *cp2;
- cp1= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
- cp2= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
+ cp1= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
+ cp2= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0;
r= offset+floor((1.0-fac)*cp1[0] + fac*cp2[0]);
@@ -936,65 +821,65 @@ void BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
}
// get individual values, not scaled
-float BIF_GetThemeValuef(int colorid)
+float UI_GetThemeValuef(int colorid)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((float)cp[0]);
}
// get individual values, not scaled
-int BIF_GetThemeValue(int colorid)
+int UI_GetThemeValue(int colorid)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((int) cp[0]);
}
// get the color, range 0.0-1.0
-void BIF_GetThemeColor3fv(int colorid, float *col)
+void UI_GetThemeColor3fv(int colorid, float *col)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0]= ((float)cp[0])/255.0;
col[1]= ((float)cp[1])/255.0;
col[2]= ((float)cp[2])/255.0;
}
// get the color, in char pointer
-void BIF_GetThemeColor3ubv(int colorid, char *col)
+void UI_GetThemeColor3ubv(int colorid, char *col)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0]= cp[0];
col[1]= cp[1];
col[2]= cp[2];
}
// get the color, in char pointer
-void BIF_GetThemeColor4ubv(int colorid, char *col)
+void UI_GetThemeColor4ubv(int colorid, char *col)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0]= cp[0];
col[1]= cp[1];
col[2]= cp[2];
col[3]= cp[3];
}
-void BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col)
+void UI_GetThemeColorType4ubv(int colorid, int spacetype, char *col)
{
char *cp;
- cp= BIF_ThemeGetColorPtr(theme_active, spacetype, colorid);
+ cp= UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
col[0]= cp[0];
col[1]= cp[1];
col[2]= cp[2];
@@ -1002,7 +887,7 @@ void BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col)
}
// blends and shades between two char color pointers
-void BIF_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset)
+void UI_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset)
{
int r, g, b;
@@ -1019,7 +904,7 @@ void BIF_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset)
}
// get a 3 byte color, blended and shaded between two other char color pointers
-void BIF_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset)
+void UI_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset)
{
int r, g, b;
@@ -1036,3 +921,4 @@ void BIF_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, i
col[1] = g;
col[2] = b;
}
+
diff --git a/source/blender/src/language.c b/source/blender/editors/interface/text.c
index 07c17b58a44..edca092f42b 100644
--- a/source/blender/src/language.c
+++ b/source/blender/editors/interface/text.c
@@ -24,10 +24,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/* XXX 2.50 this file must be cleanup still, using globals etc. */
#include <string.h>
#include <stdlib.h>
+#include "MEM_guardedalloc.h"
+
#include "DNA_listBase.h"
#include "DNA_userdef_types.h"
#include "DNA_vec_types.h"
@@ -39,14 +42,9 @@
#include "BLI_linklist.h" /* linknode */
#include "BIF_gl.h"
-#include "BIF_language.h"
-#include "BIF_space.h" /* allqueue() */
-#include "BIF_toolbox.h" /* error() */
-#include "datatoc.h" /* std font */
-
-#include "MEM_guardedalloc.h" /* vprintf, etc ??? */
+#include "UI_text.h"
-#include "mydevice.h" /* REDRAWALL */
+#include "ED_datafiles.h"
#include "BMF_Api.h"
@@ -85,35 +83,34 @@ static int tot_lang = 0;
#endif // INTERNATIONAL
-void BIF_RasterPos(float x, float y)
+void UI_RasterPos(float x, float y)
{
#ifdef INTERNATIONAL
FTF_SetPosition(x, y);
#endif // INTERNATIONAL
}
-void BIF_SetScale(float aspect)
+void UI_SetScale(float aspect)
{
#ifdef INTERNATIONAL
FTF_SetScale(aspect);
#endif // INTERNATIONAL
}
-void refresh_interface_font(void)
+void ui_text_init_userdef(void)
{
#ifdef INTERNATIONAL
if(U.transopts & USER_DOTRANSLATE)
start_interface_font();
else
- G.ui_international = FALSE;
+ G.ui_international= FALSE;
#else // INTERNATIONAL
- G.ui_international = FALSE;
+ G.ui_international= FALSE;
#endif
}
-int BIF_DrawString(BMF_Font* font, char *str, int translate)
+int UI_DrawString(BMF_Font* font, char *str, int translate)
{
-
#ifdef INTERNATIONAL
if(G.ui_international == TRUE) {
if(translate)
@@ -146,11 +143,9 @@ int BIF_DrawString(BMF_Font* font, char *str, int translate)
#else // INTERNATIONAL
return BMF_DrawString(font, str);
#endif
-
}
-
-float BIF_GetStringWidth(BMF_Font* font, char *str, int translate)
+float UI_GetStringWidth(BMF_Font* font, char *str, int translate)
{
float rt;
@@ -169,7 +164,8 @@ float BIF_GetStringWidth(BMF_Font* font, char *str, int translate)
return rt;
}
-void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *bbox){
+void UI_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *bbox)
+{
#ifdef INTERNATIONAL
float dummy;
if(G.ui_international == TRUE)
@@ -184,7 +180,6 @@ void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *b
#endif
}
-
#ifdef INTERNATIONAL
char *fontsize_pup(void)
@@ -230,7 +225,6 @@ char *language_pup(void)
return string;
}
-
struct LANGMenuEntry *find_language(short langid)
{
struct LANGMenuEntry *lme = langmenu;
@@ -270,13 +264,12 @@ void set_interface_font(char *str)
U.fontname[0]= 0;
FTF_SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize);
G.ui_international = TRUE; // this case will switch to standard font
- okee("Invalid font selection - reverting to built-in font.");
+ /* XXX 2.50 bad call okee("Invalid font selection - reverting to built-in font."); */
}
- allqueue(REDRAWALL, 0);
+ /* XXX 2.50 bad call allqueue(REDRAWALL, 0); */
}
}
-
void start_interface_font(void)
{
int result = 0;
@@ -304,7 +297,6 @@ void start_interface_font(void)
}
if(result) {
-
lang_setlanguage();
G.ui_international = TRUE;
@@ -316,10 +308,9 @@ void start_interface_font(void)
U.fontsize = 0;
}
- allqueue(REDRAWALL, 0);
+ /* XXX 2.50 bad call allqueue(REDRAWALL, 0); */
}
-
static char *first_dpointchar(char *string)
{
char *dpointchar;
@@ -339,7 +330,7 @@ static void splitlangline(char *line, struct LANGMenuEntry *lme)
*(dpointchar)=0;
lme->language= BLI_strdup(line);
} else {
- error("Invalid language file");
+ /* XXX 2.50 bad call error("Invalid language file"); */
}
}
@@ -448,3 +439,4 @@ void free_languagemenu(void)
}
#endif /* INTERNATIONAL */
+
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
new file mode 100644
index 00000000000..7177d62ef4e
--- /dev/null
+++ b/source/blender/editors/interface/view2d.c
@@ -0,0 +1,1479 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation, Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_view2d_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "ED_screen.h"
+
+#include "UI_resources.h"
+#include "UI_text.h"
+#include "UI_view2d.h"
+
+#include "UI_interface.h"
+#include "interface.h"
+
+/* *********************************************************************** */
+/* Refresh and Validation */
+
+#if 0 // experimental code - not ready to be used yet!
+/* common View2D view types */
+// XXX move this to header as part of API
+enum {
+ /* 4 quadrants, centered at (0,0), zoomable and pannable, best for flexible sized data with precision needed */
+ V2D_VIEWTYPE_CANVAS = 0,
+ V2D_VIEWTYPE_LIST,
+ V2D_VIEWTYPE_PANEL,
+ /* same as canvas, except aspect ratio is important */
+ // XXX is this more of the sort tweaks that region should do to its view2d data first?
+ V2D_VIEWTYPE_IMAGE,
+} eView2D_CommonViewTypes;
+
+/* Initialise all View2D data for a given region */
+void UI_view2d_regiondata_init(View2D *v2d, short type, int winx, int winy)
+{
+
+}
+#endif
+
+/* Adjust mask size in response to view size changes
+ * - This should only be called in region init() callbacks, which are
+ * called when the region is resized or area changes...
+ */
+// XXX pre2.5 -> this used to be called calc_scrollrcts()
+void UI_view2d_size_update(View2D *v2d, int winx, int winy)
+{
+ v2d->winx= winx;
+ v2d->winy= winy;
+
+ /* mask - view frame */
+ v2d->mask.xmin= v2d->mask.ymin= 0;
+ v2d->mask.xmax= winx - 1; /* -1 yes! masks are pixels */
+ v2d->mask.ymax= winy - 1;
+
+ /* scrollers shrink mask area, but should be based off regionsize
+ * - they can only be on one to two edges of the region they define
+ * - if they overlap, they must not occupy the corners (which are reserved for other widgets)
+ */
+ if (v2d->scroll) {
+ /* vertical scroller */
+ if (v2d->scroll & V2D_SCROLL_LEFT) {
+ /* on left-hand edge of region */
+ v2d->vert= v2d->mask;
+ v2d->vert.xmax= V2D_SCROLL_WIDTH;
+ v2d->mask.xmin= v2d->vert.xmax + 1;
+ }
+ else if (v2d->scroll & V2D_SCROLL_RIGHT) {
+ /* on right-hand edge of region */
+ v2d->vert= v2d->mask;
+ v2d->vert.xmin= v2d->vert.xmax - V2D_SCROLL_WIDTH;
+ v2d->mask.xmax= v2d->vert.xmin - 1;
+ }
+
+ /* horizontal scroller */
+ if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) {
+ /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */
+ v2d->hor= v2d->mask;
+ v2d->hor.ymax= V2D_SCROLL_HEIGHT;
+ v2d->mask.ymin= v2d->hor.ymax + 1;
+ }
+ else if (v2d->scroll & V2D_SCROLL_TOP) {
+ /* on upper edge of region */
+ v2d->hor= v2d->mask;
+ v2d->hor.ymin= v2d->hor.ymax - V2D_SCROLL_HEIGHT;
+ v2d->mask.ymax= v2d->hor.ymin - 1;
+ }
+
+ /* adjust vertical scroller if there's a horizontal scroller, to leave corner free */
+ if (v2d->scroll & V2D_SCROLL_VERTICAL) {
+ /* just set y min/max for vertical scroller to y min/max of mask as appropriate */
+ if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) {
+ /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */
+ v2d->vert.ymin= v2d->mask.ymin;
+ }
+ else if (v2d->scroll & V2D_SCROLL_TOP) {
+ /* on upper edge of region */
+ v2d->vert.ymax= v2d->mask.ymax;
+ }
+ }
+ }
+
+ /* cope with unitialized veriables for simple cases, like header or outliner */
+ // XXX er... this shouldn't be here??? or at least some extra checks are needed for some things...
+ if ((v2d->tot.xmin==v2d->tot.xmax) || (v2d->cur.xmin==v2d->cur.xmax)) {
+ if (v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y)) {
+ BLI_init_rctf(&v2d->tot, v2d->mask.xmin, v2d->mask.xmax, v2d->mask.ymin, v2d->mask.ymax);
+ BLI_init_rctf(&v2d->cur, v2d->mask.xmin, v2d->mask.xmax, v2d->mask.ymin, v2d->mask.ymax);
+
+ v2d->min[0]= v2d->max[0]= winx;
+ v2d->min[1]= v2d->max[1]= winy;
+ v2d->minzoom= 1.0f;
+ v2d->maxzoom= 1.0f;
+ }
+ }
+
+ /* make sure that 'cur' rect is in a valid state as a result of these changes */
+ UI_view2d_curRect_validate(v2d);
+}
+
+/* Ensure View2D rects remain in a viable configuration
+ * - cur is not allowed to be: larger than max, smaller than min, or outside of tot
+ */
+// XXX pre2.5 -> this used to be called test_view2d()
+void UI_view2d_curRect_validate(View2D *v2d)
+{
+ float totwidth, totheight, curwidth, curheight, width, height;
+ float winx, winy;
+ rctf *cur, *tot;
+
+ /* use mask as size of region that View2D resides in, as it takes into account scrollbars already */
+ winx= (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
+ winy= (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
+
+ /* get pointers to rcts for less typing */
+ cur= &v2d->cur;
+ tot= &v2d->tot;
+
+ /* we must satisfy the following constraints (in decreasing order of importance):
+ * - cur must not fall outside of tot
+ * - axis locks (zoom and offset) must be maintained
+ * - zoom must not be excessive (check either sizes or zoom values)
+ * - aspect ratio should be respected (NOTE: this is quite closely realted to zoom too)
+ */
+
+ /* Step 1: if keepzoom, adjust the sizes of the rects only
+ * - firstly, we calculate the sizes of the rects
+ * - curwidth and curheight are saved as reference... modify width and height values here
+ */
+ totwidth= tot->xmax - tot->xmin;
+ totheight= tot->ymax - tot->ymin;
+ curwidth= width= cur->xmax - cur->xmin;
+ curheight= height= cur->ymax - cur->ymin;
+
+ /* if zoom is locked, size on the appropriate axis is reset to mask size */
+ if (v2d->keepzoom & V2D_LOCKZOOM_X)
+ width= winx;
+ if (v2d->keepzoom & V2D_LOCKZOOM_Y)
+ height= winy;
+
+ /* keepzoom (V2D_KEEPZOOM set), indicates that zoom level on each axis must not exceed limits
+ * NOTE: in general, it is not expected that the lock-zoom will be used in conjunction with this
+ */
+ if (v2d->keepzoom & V2D_KEEPZOOM) {
+ float zoom, fac;
+
+ /* check if excessive zoom on x-axis */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
+ zoom= winx / width;
+ if ((zoom < v2d->minzoom) || (zoom > v2d->maxzoom)) {
+ fac= (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
+ width *= fac;
+ }
+ }
+
+ /* check if excessive zoom on y-axis */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
+ zoom= winy / height;
+ if ((zoom < v2d->minzoom) || (zoom > v2d->maxzoom)) {
+ fac= (zoom < v2d->minzoom) ? (zoom / v2d->minzoom) : (zoom / v2d->maxzoom);
+ height *= fac;
+ }
+ }
+ }
+ else {
+ /* make sure sizes don't exceed that of the min/max sizes (even though we're not doing zoom clamping) */
+ CLAMP(width, v2d->min[0], v2d->max[0]);
+ CLAMP(height, v2d->min[1], v2d->max[1]);
+ }
+
+ /* check if we should restore aspect ratio (if view size changed) */
+ if (v2d->keepzoom & V2D_KEEPASPECT) {
+ short do_x=0, do_y=0, do_cur, do_win;
+ float curRatio, winRatio;
+
+ /* when a window edge changes, the aspect ratio can't be used to
+ * find which is the best new 'cur' rect. thats why it stores 'old'
+ */
+ if (winx != v2d->oldwinx) do_x= 1;
+ if (winy != v2d->oldwiny) do_y= 1;
+
+ curRatio= height / width;
+ winRatio= winy / winx;
+
+ /* both sizes change (area/region maximised) */
+ if (do_x == do_y) {
+ if (do_x && do_y) {
+ /* here is 1,1 case, so all others must be 0,0 */
+ if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y= 0;
+ else do_x= 0;
+ }
+ else if (winRatio > 1.0f) do_x= 0;
+ else do_x= 1;
+ }
+ do_cur= do_x;
+ do_win= do_y;
+
+ if (do_cur) {
+ if ((v2d->keeptot == 2) && (winx != v2d->oldwinx)) {
+ /* special exception for Outliner (and later channel-lists):
+ * - The view may be moved left to avoid contents being pushed out of view when view shrinks.
+ * - The keeptot code will make sure cur->xmin will not be less than tot->xmin (which cannot be allowed)
+ * - width is not adjusted for changed ratios here...
+ */
+ if (winx < v2d->oldwinx) {
+ float temp = v2d->oldwinx - winx;
+
+ cur->xmin -= temp;
+ cur->xmax -= temp;
+
+ /* width does not get modified, as keepaspect here is just set to make
+ * sure visible area adjusts to changing view shape!
+ */
+ }
+ }
+ else {
+ /* portrait window: correct for x */
+ width= height / winRatio;
+ }
+ }
+ else {
+ /* landscape window: correct for y */
+ height = width * winRatio;
+ }
+
+ /* store region size for next time */
+ v2d->oldwinx= winx;
+ v2d->oldwiny= winy;
+ }
+
+ /* Step 2: apply new sizes of cur rect to cur rect */
+ if ((width != curwidth) || (height != curheight)) {
+ float temp, dh;
+
+ /* resize around 'center' of frame */
+ if (width != curwidth) {
+ temp= (cur->xmax + cur->xmin) * 0.5f;
+ dh= width * 0.5f;
+
+ cur->xmin = temp - dh;
+ cur->xmax = temp + dh;
+ }
+ if (height != curheight) {
+ temp= (cur->ymax + cur->ymin) * 0.5f;
+ dh= height * 0.5f;
+
+ cur->ymin = temp - dh;
+ cur->ymax = temp + dh;
+ }
+ }
+
+ /* Step 3: adjust so that it doesn't fall outside of bounds of tot */
+ if (v2d->keeptot) {
+ float temp, diff;
+
+ /* recalculate extents of cur */
+ curwidth= cur->xmax - cur->xmin;
+ curheight= cur->ymax - cur->ymin;
+
+ /* width */
+ if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X)) ) {
+ /* if zoom doesn't have to be maintained, just clamp edges */
+ if (cur->xmin < tot->xmin) cur->xmin= tot->xmin;
+ if (cur->xmax > tot->xmax) cur->xmax= tot->xmax;
+ }
+ else if (v2d->keeptot == 2) {
+ /* This is an exception for the outliner (and later channel-lists)
+ * - must clamp within tot rect (absolutely no excuses)
+ * --> therefore, cur->xmin must not be less than tot->xmin
+ */
+ if (cur->xmin < tot->xmin) {
+ /* move cur across so that it sits at minimum of tot */
+ temp= tot->xmin - cur->xmin;
+
+ cur->xmin += temp;
+ cur->xmax += temp;
+ }
+ else if (cur->xmax > tot->xmax) {
+ /* - only offset by difference of cur-xmax and tot-xmax if that would not move
+ * cur-xmin to lie past tot-xmin
+ * - otherwise, simply shift to tot-xmin???
+ */
+ temp= cur->xmax - tot->xmax;
+
+ if ((cur->xmin - temp) < tot->xmin) {
+ /* only offset by difference from cur-min and tot-min */
+ temp= cur->xmin - tot->xmin;
+
+ cur->xmin -= temp;
+ cur->xmax -= temp;
+ }
+ else {
+ cur->xmin -= temp;
+ cur->xmax -= temp;
+ }
+ }
+ }
+ else {
+ /* This here occurs when:
+ * - width too big, but maintaining zoom (i.e. widths cannot be changed)
+ * - width is OK, but need to check if outside of boundaries
+ *
+ * So, resolution is to just shift view by the gap between the extremities.
+ * We favour moving the 'minimum' across, as that's origin for most things
+ * (XXX - in the past, max was favoured... if there are bugs, swap!)
+ */
+ if ((cur->ymin < tot->ymin) && (cur->ymax > tot->ymax)) {
+ /* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
+ temp= (tot->ymax + tot->ymin) * 0.5f;
+ diff= curheight * 0.5f;
+
+ cur->ymin= temp - diff;
+ cur->ymax= temp + diff;
+ }
+ else if (cur->xmin < tot->xmin) {
+ /* move cur across so that it sits at minimum of tot */
+ temp= tot->xmin - cur->xmin;
+
+ cur->xmin += temp;
+ cur->xmax += temp;
+ }
+ else if (cur->xmax > tot->xmax) {
+ /* - only offset by difference of cur-xmax and tot-xmax if that would not move
+ * cur-xmin to lie past tot-xmin
+ * - otherwise, simply shift to tot-xmin???
+ */
+ temp= cur->xmax - tot->xmax;
+
+ if ((cur->xmin - temp) < tot->xmin) {
+ /* only offset by difference from cur-min and tot-min */
+ temp= cur->xmin - tot->xmin;
+
+ cur->xmin -= temp;
+ cur->xmax -= temp;
+ }
+ else {
+ cur->xmin -= temp;
+ cur->xmax -= temp;
+ }
+ }
+ }
+
+ /* height */
+ if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_Y)) ) {
+ /* if zoom doesn't have to be maintained, just clamp edges */
+ if (cur->ymin < tot->ymin) cur->ymin= tot->ymin;
+ if (cur->ymax > tot->ymax) cur->ymax= tot->ymax;
+ }
+ else {
+ /* This here occurs when:
+ * - height too big, but maintaining zoom (i.e. heights cannot be changed)
+ * - height is OK, but need to check if outside of boundaries
+ *
+ * So, resolution is to just shift view by the gap between the extremities.
+ * We favour moving the 'minimum' across, as that's origin for most things
+ */
+ if ((cur->ymin < tot->ymin) && (cur->ymax > tot->ymax)) {
+ /* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
+ temp= (tot->ymax + tot->ymin) * 0.5f;
+ diff= curheight * 0.5f;
+
+ cur->ymin= temp - diff;
+ cur->ymax= temp + diff;
+ }
+ else if (cur->ymin < tot->ymin) {
+ /* there's still space remaining, so shift up */
+ temp= tot->ymin - cur->ymin;
+
+ cur->ymin += temp;
+ cur->ymax += temp;
+ }
+ else if (cur->ymax > tot->ymax) {
+ /* there's still space remaining, so shift down */
+ temp= cur->ymax - tot->ymax;
+
+ cur->ymin -= temp;
+ cur->ymax -= temp;
+ }
+ }
+ }
+
+}
+
+/* ------------------ */
+
+/* Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot) */
+void UI_view2d_curRect_reset (View2D *v2d)
+{
+ float width, height;
+
+ /* assume width and height of 'cur' rect by default, should be same size as mask */
+ width= (float)(v2d->mask.xmax - v2d->mask.xmin + 1);
+ height= (float)(v2d->mask.ymax - v2d->mask.ymin + 1);
+
+ /* handle width - posx and negx flags are mutually exclusive, so watch out */
+ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
+ /* width is in negative-x half */
+ v2d->cur.xmin= (float)-width;
+ v2d->cur.xmax= 0.0f;
+ }
+ else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
+ /* width is in positive-x half */
+ v2d->cur.xmin= 0.0f;
+ v2d->cur.xmax= (float)width;
+ }
+ else {
+ /* width is centered around x==0 */
+ const float dx= (float)width / 2.0f;
+
+ v2d->cur.xmin= -dx;
+ v2d->cur.xmax= dx;
+ }
+
+ /* handle height - posx and negx flags are mutually exclusive, so watch out */
+ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
+ /* height is in negative-y half */
+ v2d->cur.ymin= (float)-height;
+ v2d->cur.ymax= 0.0f;
+ }
+ else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
+ /* height is in positive-y half */
+ v2d->cur.ymin= 0.0f;
+ v2d->cur.ymax= (float)height;
+ }
+ else {
+ /* height is centered around y==0 */
+ const float dy= (float)height / 2.0f;
+
+ v2d->cur.ymin= -dy;
+ v2d->cur.ymax= dy;
+ }
+}
+
+/* ------------------ */
+
+/* Change the size of the maximum viewable area (i.e. 'tot' rect) */
+void UI_view2d_totRect_set (View2D *v2d, int width, int height)
+{
+ /* don't do anything if either value is 0 */
+ if (ELEM3(0, v2d, width, height))
+ return;
+
+ /* handle width - posx and negx flags are mutually exclusive, so watch out */
+ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
+ /* width is in negative-x half */
+ v2d->tot.xmin= (float)-width;
+ v2d->tot.xmax= 0.0f;
+ }
+ else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
+ /* width is in positive-x half */
+ v2d->tot.xmin= 0.0f;
+ v2d->tot.xmax= (float)width;
+ }
+ else {
+ /* width is centered around x==0 */
+ const float dx= (float)width / 2.0f;
+
+ v2d->tot.xmin= -dx;
+ v2d->tot.xmax= dx;
+ }
+
+ /* handle height - posx and negx flags are mutually exclusive, so watch out */
+ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
+ /* height is in negative-y half */
+ v2d->tot.ymin= (float)-height;
+ v2d->tot.ymax= 0.0f;
+ }
+ else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
+ /* height is in positive-y half */
+ v2d->tot.ymin= 0.0f;
+ v2d->tot.ymax= (float)height;
+ }
+ else {
+ /* height is centered around y==0 */
+ const float dy= (float)height / 2.0f;
+
+ v2d->tot.ymin= -dy;
+ v2d->tot.ymax= dy;
+ }
+
+ /* make sure that 'cur' rect is in a valid state as a result of these changes */
+ UI_view2d_curRect_validate(v2d);
+}
+
+/* *********************************************************************** */
+/* View Matrix Setup */
+
+/* mapping function to ensure 'cur' draws extended over the area where sliders are */
+static void view2d_map_cur_using_mask(View2D *v2d, rctf *curmasked)
+{
+ *curmasked= v2d->cur;
+
+ if ((v2d->scroll)) {
+ float dx= (v2d->cur.xmax-v2d->cur.xmin)/((float)(v2d->mask.xmax-v2d->mask.xmin+1));
+ float dy= (v2d->cur.ymax-v2d->cur.ymin)/((float)(v2d->mask.ymax-v2d->mask.ymin+1));
+
+ if (v2d->mask.xmin != 0)
+ curmasked->xmin -= dx*(float)v2d->mask.xmin;
+ if (v2d->mask.xmax+1 != v2d->winx)
+ curmasked->xmax += dx*(float)(v2d->winx - v2d->mask.xmax-1);
+
+ if (v2d->mask.ymin != 0)
+ curmasked->ymin -= dy*(float)v2d->mask.ymin;
+ if (v2d->mask.ymax+1 != v2d->winy)
+ curmasked->ymax += dy*(float)(v2d->winy - v2d->mask.ymax-1);
+
+ }
+}
+
+/* Set view matrices to use 'cur' rect as viewing frame for View2D drawing
+* - this assumes viewport/scissor been set for the region, taking scrollbars into account
+*/
+
+void UI_view2d_view_ortho(const bContext *C, View2D *v2d)
+{
+ rctf curmasked;
+
+ /* set the matrix - pixel offsets (-0.375) for 1:1 correspondance are not applied,
+ * as they were causing some unwanted offsets when drawing
+ */
+ view2d_map_cur_using_mask(v2d, &curmasked);
+ wmOrtho2(C->window, curmasked.xmin, curmasked.xmax, curmasked.ymin, curmasked.ymax);
+
+ /* XXX is this necessary? */
+ wmLoadIdentity(C->window);
+}
+
+/* Set view matrices to only use one axis of 'cur' only
+ * - this assumes viewport/scissor been set for the region, taking scrollbars into account
+ *
+ * - xaxis = if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x)
+ */
+void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis)
+{
+ ARegion *ar= C->region;
+ rctf curmasked;
+
+ /* set the matrix - pixel offsets (-0.375) for 1:1 correspondance are not applied,
+ * as they were causing some unwanted offsets when drawing
+ */
+ view2d_map_cur_using_mask(v2d, &curmasked);
+ if (xaxis)
+ wmOrtho2(C->window, curmasked.xmin, curmasked.xmax, 0, ar->winy);
+ else
+ wmOrtho2(C->window, 0, ar->winx, curmasked.ymin, curmasked.ymax);
+
+ /* XXX is this necessary? */
+ wmLoadIdentity(C->window);
+}
+
+
+/* Restore view matrices after drawing */
+void UI_view2d_view_restore(const bContext *C)
+{
+ ED_region_pixelspace(C, C->region);
+}
+
+/* allowing horizontal pan */
+void UI_view2d_header_default(View2D *v2d)
+{
+ v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ v2d->keepofs = V2D_LOCKOFS_Y;
+ v2d->keeptot = 2; // this keeps the view in place when region size changes...
+ v2d->align = V2D_ALIGN_NO_NEG_X;
+
+}
+
+/* *********************************************************************** */
+/* Gridlines */
+
+/* minimum pixels per gridstep */
+#define MINGRIDSTEP 35
+
+/* View2DGrid is typedef'd in UI_view2d.h */
+struct View2DGrid {
+ float dx, dy; /* stepsize (in pixels) between gridlines */
+ float startx, starty; /* initial coordinates to start drawing grid from */
+ int powerx, powery; /* step as power of 10 */
+};
+
+/* --------------- */
+
+/* try to write step as a power of 10 */
+static void step_to_grid(float *step, int *power, int unit)
+{
+ const float loga= log10(*step);
+ float rem;
+
+ *power= (int)(loga);
+
+ rem= loga - (*power);
+ rem= pow(10.0, rem);
+
+ if (loga < 0.0) {
+ if (rem < 0.2) rem= 0.2;
+ else if(rem < 0.5) rem= 0.5;
+ else rem= 1.0;
+
+ *step= rem * pow(10.0, (float)(*power));
+
+ /* for frames, we want 1.0 frame intervals only */
+ if (unit == V2D_UNIT_FRAMES) {
+ rem = 1.0;
+ *step = 1.0;
+ }
+
+ /* prevents printing 1.0 2.0 3.0 etc */
+ if (rem == 1.0) (*power)++;
+ }
+ else {
+ if (rem < 2.0) rem= 2.0;
+ else if(rem < 5.0) rem= 5.0;
+ else rem= 10.0;
+
+ *step= rem * pow(10.0, (float)(*power));
+
+ (*power)++;
+ /* prevents printing 1.0, 2.0, 3.0, etc. */
+ if (rem == 10.0) (*power)++;
+ }
+}
+
+/* Intialise settings necessary for drawing gridlines in a 2d-view
+ * - Currently, will return pointer to View2DGrid struct that needs to
+ * be freed with UI_view2d_grid_free()
+ * - Is used for scrollbar drawing too (for units drawing)
+ * - Units + clamping args will be checked, to make sure they are valid values that can be used
+ * so it is very possible that we won't return grid at all!
+ *
+ * - xunits,yunits = V2D_UNIT_* grid steps in seconds or frames
+ * - xclamp,yclamp = V2D_CLAMP_* only show whole-number intervals
+ * - winx = width of region we're drawing to
+ * - winy = height of region we're drawing into
+ */
+View2DGrid *UI_view2d_grid_calc(const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy)
+{
+ View2DGrid *grid;
+ float space, pixels, seconddiv;
+ int secondgrid;
+
+ /* check that there are at least some workable args */
+ if (ELEM(V2D_ARG_DUMMY, xunits, xclamp) && ELEM(V2D_ARG_DUMMY, yunits, yclamp))
+ return NULL;
+
+ /* grid here is allocated... */
+ grid= MEM_callocN(sizeof(View2DGrid), "View2DGrid");
+
+ /* rule: gridstep is minimal GRIDSTEP pixels */
+ if (xunits == V2D_UNIT_SECONDS) {
+ secondgrid= 1;
+ seconddiv= 0.01f * FPS;
+ }
+ else {
+ secondgrid= 0;
+ seconddiv= 1.0f;
+ }
+
+ /* calculate x-axis grid scale (only if both args are valid) */
+ if (ELEM(V2D_ARG_DUMMY, xunits, xclamp) == 0) {
+ space= v2d->cur.xmax - v2d->cur.xmin;
+ pixels= v2d->mask.xmax - v2d->mask.xmin;
+
+ grid->dx= (MINGRIDSTEP * space) / (seconddiv * pixels);
+ step_to_grid(&grid->dx, &grid->powerx, xunits);
+ grid->dx *= seconddiv;
+
+ if (xclamp == V2D_GRID_CLAMP) {
+ if (grid->dx < 0.1f) grid->dx= 0.1f;
+ grid->powerx-= 2;
+ if (grid->powerx < -2) grid->powerx= -2;
+ }
+
+ grid->startx= v2d->cur.xmin;
+ }
+
+ /* calculate y-axis grid scale (only if both args are valid) */
+ if (ELEM(V2D_ARG_DUMMY, yunits, yclamp) == 0) {
+ space= v2d->cur.ymax - v2d->cur.ymin;
+ pixels= winy;
+
+ grid->dy= MINGRIDSTEP * space / pixels;
+ step_to_grid(&grid->dy, &grid->powery, yunits);
+
+ if (yclamp == V2D_GRID_CLAMP) {
+ if (grid->dy < 1.0f) grid->dy= 1.0f;
+ if (grid->powery < 1) grid->powery= 1;
+ }
+
+ grid->starty= v2d->cur.ymin;
+ }
+
+ /* calculate start position */
+ if (ELEM(V2D_ARG_DUMMY, xunits, xclamp) == 0) {
+ grid->startx= seconddiv*(v2d->cur.xmin/seconddiv - fmod(v2d->cur.xmin/seconddiv, grid->dx/seconddiv));
+ if (v2d->cur.xmin < 0.0f) grid->startx-= grid->dx;
+ }
+ if (ELEM(V2D_ARG_DUMMY, yunits, yclamp) == 0) {
+ grid->starty= (v2d->cur.ymin - fmod(v2d->cur.ymin, grid->dy));
+ if (v2d->cur.ymin < 0.0f) grid->starty-= grid->dy;
+ }
+
+ return grid;
+}
+
+/* Draw gridlines in the given 2d-region */
+void UI_view2d_grid_draw(const bContext *C, View2D *v2d, View2DGrid *grid, int flag)
+{
+ float vec1[2], vec2[2];
+ int a, step;
+
+ /* check for grid first, as it may not exist */
+ if (grid == NULL)
+ return;
+
+ /* vertical lines */
+ if (flag & V2D_VERTICAL_LINES) {
+ /* initialise initial settings */
+ vec1[0]= vec2[0]= grid->startx;
+ vec1[1]= grid->starty;
+ vec2[1]= v2d->cur.ymax;
+
+ /* minor gridlines */
+ step= (v2d->mask.xmax - v2d->mask.xmin + 1) / MINGRIDSTEP;
+ UI_ThemeColor(TH_GRID);
+
+ for (a=0; a<step; a++) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+
+ vec2[0]= vec1[0]+= grid->dx;
+ }
+
+ /* major gridlines */
+ vec2[0]= vec1[0]-= 0.5f*grid->dx;
+ UI_ThemeColorShade(TH_GRID, 16);
+
+ step++;
+ for (a=0; a<=step; a++) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+
+ vec2[0]= vec1[0]-= grid->dx;
+ }
+ }
+
+ /* horizontal lines */
+ if (flag & V2D_HORIZONTAL_LINES) {
+ /* only major gridlines */
+ vec1[1]= vec2[1]= grid->starty;
+ vec1[0]= grid->startx;
+ vec2[0]= v2d->cur.xmax;
+
+ step= (v2d->mask.ymax - v2d->mask.ymin + 1) / MINGRIDSTEP;
+
+ UI_ThemeColor(TH_GRID);
+ for (a=0; a<=step; a++) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+
+ vec2[1]= vec1[1]+= grid->dy;
+ }
+
+ /* fine grid lines */
+ vec2[1]= vec1[1]-= 0.5f*grid->dy;
+ step++;
+
+ if (flag & V2D_HORIZONTAL_FINELINES) {
+ UI_ThemeColorShade(TH_GRID, 16);
+ for (a=0; a<step; a++) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+
+ vec2[1]= vec1[1]-= grid->dy;
+ }
+ }
+ }
+
+ /* Axes are drawn as darker lines */
+ UI_ThemeColorShade(TH_GRID, -50);
+
+ /* horizontal axis */
+ if (flag & V2D_HORIZONTAL_AXIS) {
+ vec1[0]= v2d->cur.xmin;
+ vec2[0]= v2d->cur.xmax;
+ vec1[1]= vec2[1]= 0.0f;
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+ }
+
+ /* vertical axis */
+ if (flag & V2D_VERTICAL_AXIS) {
+ vec1[1]= v2d->cur.ymin;
+ vec2[1]= v2d->cur.ymax;
+ vec1[0]= vec2[0]= 0.0f;
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec1);
+ glVertex2fv(vec2);
+ glEnd();
+ }
+}
+
+/* free temporary memory used for drawing grid */
+void UI_view2d_grid_free(View2DGrid *grid)
+{
+ /* only free if there's a grid */
+ if (grid)
+ MEM_freeN(grid);
+}
+
+/* *********************************************************************** */
+/* Scrollbars */
+
+/* View2DScrollers is typedef'd in UI_view2d.h
+ * WARNING: the start of this struct must not change, as view2d_ops.c uses this too.
+ * For now, we don't need to have a separate (internal) header for structs like this...
+ */
+struct View2DScrollers {
+ /* focus bubbles */
+ int vert_min, vert_max; /* vertical scrollbar */
+ int hor_min, hor_max; /* horizontal scrollbar */
+
+ /* scales */
+ View2DGrid *grid; /* grid for coordinate drawing */
+ short xunits, xclamp; /* units and clamping options for x-axis */
+ short yunits, yclamp; /* units and clamping options for y-axis */
+};
+
+/* Calculate relevant scroller properties */
+View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short xunits, short xclamp, short yunits, short yclamp)
+{
+ View2DScrollers *scrollers;
+ rcti vert, hor;
+ float fac, totsize, scrollsize;
+
+ vert= v2d->vert;
+ hor= v2d->hor;
+
+ /* scrollers is allocated here... */
+ scrollers= MEM_callocN(sizeof(View2DScrollers), "View2DScrollers");
+
+ /* scroller 'buttons':
+ * - These should always remain within the visible region of the scrollbar
+ * - They represent the region of 'tot' that is visible in 'cur'
+ */
+
+ /* horizontal scrollers */
+ if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
+ /* scroller 'button' extents */
+ totsize= v2d->tot.xmax - v2d->tot.xmin;
+ scrollsize= hor.xmax - hor.xmin;
+
+ fac= (v2d->cur.xmin- v2d->tot.xmin) / totsize;
+ scrollers->hor_min= hor.xmin + (fac * scrollsize);
+
+ fac= (v2d->cur.xmax - v2d->tot.xmin) / totsize;
+ scrollers->hor_max= hor.xmin + (fac * scrollsize);
+
+ if (scrollers->hor_min > scrollers->hor_max)
+ scrollers->hor_min= scrollers->hor_max;
+ }
+
+ /* vertical scrollers */
+ if (v2d->scroll & V2D_SCROLL_VERTICAL) {
+ /* scroller 'button' extents */
+ totsize= v2d->tot.ymax - v2d->tot.ymin;
+ scrollsize= vert.ymax - vert.ymin;
+
+ fac= (v2d->cur.ymin- v2d->tot.ymin) / totsize;
+ scrollers->vert_min= vert.ymin + (fac * scrollsize);
+
+ fac= (v2d->cur.ymax - v2d->tot.ymin) / totsize;
+ scrollers->vert_max= vert.ymin + (fac * scrollsize);
+
+ if (scrollers->vert_min > scrollers->vert_max)
+ scrollers->vert_min= scrollers->vert_max;
+ }
+
+ /* grid markings on scrollbars */
+ if (v2d->scroll & (V2D_SCROLL_SCALE_HORIZONTAL|V2D_SCROLL_SCALE_VERTICAL)) {
+ /* store clamping */
+ scrollers->xclamp= xclamp;
+ scrollers->xunits= xunits;
+ scrollers->yclamp= yclamp;
+ scrollers->yunits= yunits;
+
+ scrollers->grid= UI_view2d_grid_calc(C, v2d, xunits, xclamp, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
+ }
+
+ /* return scrollers */
+ return scrollers;
+}
+
+/* XXX */
+extern void ui_rasterpos_safe(float x, float y, float aspect);
+
+/* Print scale marking along a time scrollbar */
+static void scroll_printstr(View2DScrollers *scrollers, float x, float y, float val, int power, short unit, char dir)
+{
+ int len;
+ char str[32];
+
+ /* adjust the scale unit to work ok */
+ if (dir == 'v') {
+ /* here we bump up the power by factor of 10, as
+ * rotation values (hence 'degrees') are divided by 10 to
+ * be able to show the curves at the same time
+ */
+ if ELEM(unit, V2D_UNIT_DEGREES, V2D_UNIT_TIME) {
+ power += 1;
+ val *= 10;
+ }
+ }
+
+ /* get string to print */
+ if (unit == V2D_UNIT_SECONDS) {
+ /* SMPTE timecode style:
+ * - In general, minutes and seconds should be shown, as most clips will be
+ * within this length. Hours will only be included if relevant.
+ * - Only show frames when zoomed in enough for them to be relevant
+ * (using separator convention of ';' for frames, ala QuickTime).
+ * When showing frames, use slightly different display to avoid confusion with mm:ss format
+ */
+ int hours=0, minutes=0, seconds=0, frames=0;
+ char neg[2]= "";
+
+ /* get values */
+ if (val < 0) {
+ /* correction for negative values */
+ sprintf(neg, "-");
+ val = -val;
+ }
+ if (val >= 3600) {
+ /* hours */
+ /* XXX should we only display a single digit for hours since clips are
+ * VERY UNLIKELY to be more than 1-2 hours max? However, that would
+ * go against conventions...
+ */
+ hours= (int)val / 3600;
+ val= fmod(val, 3600);
+ }
+ if (val >= 60) {
+ /* minutes */
+ minutes= (int)val / 60;
+ val= fmod(val, 60);
+ }
+ if (power <= 0) {
+ /* seconds + frames
+ * Frames are derived from 'fraction' of second. We need to perform some additional rounding
+ * to cope with 'half' frames, etc., which should be fine in most cases
+ */
+ seconds= (int)val;
+ frames= (int)floor( ((val - seconds) * FPS) + 0.5f );
+ }
+ else {
+ /* seconds (with pixel offset) */
+ seconds= (int)floor(val + 0.375f);
+ }
+
+ /* print timecode to temp string buffer */
+ if (power <= 0) {
+ /* include "frames" in display */
+ if (hours) sprintf(str, "%s%02d:%02d:%02d;%02d", neg, hours, minutes, seconds, frames);
+ else if (minutes) sprintf(str, "%s%02d:%02d;%02d", neg, minutes, seconds, frames);
+ else sprintf(str, "%s%d;%02d", neg, seconds, frames);
+ }
+ else {
+ /* don't include 'frames' in display */
+ if (hours) sprintf(str, "%s%02d:%02d:%02d", neg, hours, minutes, seconds);
+ else sprintf(str, "%s%02d:%02d", neg, minutes, seconds);
+ }
+ }
+ else {
+ /* round to whole numbers if power is >= 1 (i.e. scale is coarse) */
+ if (power <= 0) sprintf(str, "%.*f", 1-power, val);
+ else sprintf(str, "%d", (int)floor(val + 0.375f));
+ }
+
+ /* get length of string, and adjust printing location to fit it into the horizontal scrollbar */
+ len= strlen(str);
+ if (dir == 'h') {
+ /* seconds/timecode display has slightly longer strings... */
+ if (unit == V2D_UNIT_SECONDS)
+ x-= 3*len;
+ else
+ x-= 4*len;
+ }
+
+ /* Add degree sympbol to end of string for vertical scrollbar? */
+ if ((dir == 'v') && (unit == V2D_UNIT_DEGREES)) {
+ str[len]= 186;
+ str[len+1]= 0;
+ }
+
+ /* draw it */
+ ui_rasterpos_safe(x, y, 1.0);
+ UI_DrawString(G.fonts, str, 0); // XXX check this again when new text-drawing api is done
+}
+
+/* local defines for scrollers drawing */
+ /* radius of scroller 'button' caps */
+#define V2D_SCROLLCAP_RAD 5
+ /* shading factor for scroller 'bar' */
+#define V2D_SCROLLBAR_SHADE 0.1f
+ /* shading factor for scroller 'button' caps */
+#define V2D_SCROLLCAP_SHADE 0.2f
+
+/* Draw scrollbars in the given 2d-region */
+void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *vs)
+{
+ const short darker= -50, dark= -10, light= 20, lighter= 50;
+ rcti vert, hor, corner;
+
+ /* make copies of rects for less typing */
+ vert= v2d->vert;
+ hor= v2d->hor;
+
+ /* horizontal scrollbar */
+ if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
+ /* scroller backdrop */
+ UI_ThemeColorShade(TH_SHADE1, light);
+ glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax);
+
+ /* scroller 'button'
+ * - if view is zoomable in x, draw handles too
+ * - handles are drawn darker
+ */
+ if (v2d->keepzoom & V2D_LOCKZOOM_X) {
+ /* draw base bar as rounded shape */
+ UI_ThemeColorShade(TH_SHADE1, dark);
+ uiSetRoundBox(15);
+
+ /* check that box is large enough for round drawing */
+ if ((vs->hor_max - vs->hor_min) < (V2D_SCROLLCAP_RAD * 2)) {
+ /* Rounded box still gets drawn at the minimum size limit
+ * This doesn't represent extreme scaling well, but looks nicer...
+ */
+ float mid= 0.5f * (vs->hor_max + vs->hor_min);
+
+ gl_round_box_shade(GL_POLYGON,
+ mid-V2D_SCROLLCAP_RAD, hor.ymin+2,
+ mid+V2D_SCROLLCAP_RAD, hor.ymax-2,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+ }
+ else {
+ /* draw rounded box as per normal */
+ gl_round_box_shade(GL_POLYGON,
+ vs->hor_min, hor.ymin+2,
+ vs->hor_max, hor.ymax-2,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+ }
+ }
+ else {
+ /* base bar drawn as shaded rect */
+ UI_ThemeColorShade(TH_SHADE1, dark);
+ uiSetRoundBox(0);
+ gl_round_box_shade(GL_POLYGON,
+ vs->hor_min, hor.ymin+2,
+ vs->hor_max, hor.ymax-2,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+
+ /* 'minimum' handle */
+ uiSetRoundBox(9);
+ UI_ThemeColorShade(TH_SHADE1, darker);
+
+ gl_round_box_shade(GL_POLYGON,
+ vs->hor_min-V2D_SCROLLER_HANDLE_SIZE, hor.ymin+2,
+ vs->hor_min+V2D_SCROLLER_HANDLE_SIZE, hor.ymax-2,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE);
+
+ /* maximum handle */
+ uiSetRoundBox(6);
+ UI_ThemeColorShade(TH_SHADE1, darker);
+
+ gl_round_box_shade(GL_POLYGON,
+ vs->hor_max-V2D_SCROLLER_HANDLE_SIZE, hor.ymin+2,
+ vs->hor_max+V2D_SCROLLER_HANDLE_SIZE, hor.ymax-2,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE);
+ }
+
+ /* scale indicators */
+ // XXX will need to update the font drawing when the new stuff comes in
+ if ((v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) && (vs->grid)) {
+ View2DGrid *grid= vs->grid;
+ float fac, dfac, fac2, val;
+
+ /* the numbers: convert grid->startx and -dx to scroll coordinates
+ * - fac is x-coordinate to draw to
+ * - dfac is gap between scale markings
+ */
+ fac= (grid->startx - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ fac= hor.xmin + fac*(hor.xmax - hor.xmin);
+
+ dfac= (grid->dx) / (v2d->cur.xmax - v2d->cur.xmin);
+ dfac= dfac * (hor.xmax - hor.xmin);
+
+ /* set starting value, and text color */
+ UI_ThemeColor(TH_TEXT);
+ val= grid->startx;
+
+ /* if we're clamping to whole numbers only, make sure entries won't be repeated */
+ if (vs->xclamp == V2D_GRID_CLAMP) {
+ while (grid->dx < 0.9999f) {
+ grid->dx *= 2.0f;
+ dfac *= 2.0f;
+ }
+ }
+ if (vs->xunits == V2D_UNIT_FRAMES)
+ grid->powerx= 1;
+
+ /* draw numbers in the appropriate range */
+ if (dfac != 0.0f) {
+ for (; fac < hor.xmax; fac+=dfac, val+=grid->dx) {
+ switch (vs->xunits) {
+ case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/
+ scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMES, 'h');
+ break;
+
+ case V2D_UNIT_SECONDS: /* seconds */
+ fac2= val/FPS;
+ scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), fac2, grid->powerx, V2D_UNIT_SECONDS, 'h');
+ break;
+
+ case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */
+ {
+ float time;
+
+ fac2= val/FPS;
+ time= floor(fac2);
+ fac2= fac2-time;
+
+ scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), time+FPS*fac2/100.0, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h');
+ }
+ break;
+
+ case V2D_UNIT_DEGREES: /* IPO-Editor for rotation IPO-Drivers */
+ /* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
+ scroll_printstr(vs, fac, 3.0+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_DEGREES, 'v');
+ break;
+ }
+ }
+ }
+ }
+
+ /* decoration outer bevel line */
+ UI_ThemeColorShade(TH_SHADE1, lighter);
+ if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O))
+ sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax);
+ else if (v2d->scroll & V2D_SCROLL_TOP)
+ sdrawline(hor.xmin, hor.ymin, hor.xmax, hor.ymin);
+ }
+
+ /* vertical scrollbar */
+ if (v2d->scroll & V2D_SCROLL_VERTICAL) {
+ /* scroller backdrop */
+ UI_ThemeColorShade(TH_SHADE1, light);
+ glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax);
+
+ /* scroller 'button'
+ * - if view is zoomable in y, draw handles too
+ * - handles are drawn darker
+ */
+ if (v2d->keepzoom & V2D_LOCKZOOM_Y) {
+ /* draw base bar as rounded shape */
+ UI_ThemeColorShade(TH_SHADE1, dark);
+ uiSetRoundBox(15);
+
+ /* check that box is large enough for round drawing */
+ if ((vs->vert_max - vs->vert_min) < (V2D_SCROLLCAP_RAD * 2)) {
+ /* Rounded box still gets drawn at the minimum size limit
+ * This doesn't represent extreme scaling well, but looks nicer...
+ */
+ float mid= 0.5f * (vs->vert_max + vs->vert_min);
+
+ gl_round_box_vertical_shade(GL_POLYGON,
+ vert.xmin+2, mid-V2D_SCROLLCAP_RAD,
+ vert.xmax-2, mid+V2D_SCROLLCAP_RAD,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+ }
+ else {
+ /* draw rounded box as per normal */
+ gl_round_box_vertical_shade(GL_POLYGON,
+ vert.xmin+2, vs->vert_min,
+ vert.xmax-2, vs->vert_max,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+ }
+ }
+ else {
+ /* base bar drawn as shaded rect */
+ UI_ThemeColorShade(TH_SHADE1, dark);
+ uiSetRoundBox(0);
+ gl_round_box_vertical_shade(GL_POLYGON,
+ vert.xmin+2, vs->vert_min,
+ vert.xmax-2, vs->vert_max,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE);
+
+ /* 'minimum' handle */
+ UI_ThemeColorShade(TH_SHADE1, darker);
+ uiSetRoundBox(12);
+
+ gl_round_box_vertical_shade(GL_POLYGON,
+ vert.xmin+2, vs->vert_min-V2D_SCROLLER_HANDLE_SIZE,
+ vert.xmax-2, vs->vert_min+V2D_SCROLLER_HANDLE_SIZE,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE);
+
+ /* maximum handle */
+ UI_ThemeColorShade(TH_SHADE1, darker);
+ uiSetRoundBox(3);
+
+ gl_round_box_vertical_shade(GL_POLYGON,
+ vert.xmin+2, vs->vert_max-V2D_SCROLLER_HANDLE_SIZE,
+ vert.xmax-2, vs->vert_max+V2D_SCROLLER_HANDLE_SIZE,
+ V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE);
+ }
+
+ /* scale indiators */
+ // XXX will need to update the font drawing when the new stuff comes in
+ if ((v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) && (vs->grid)) {
+ View2DGrid *grid= vs->grid;
+ float fac, dfac, val;
+
+ /* the numbers: convert grid->starty and dy to scroll coordinates
+ * - fac is y-coordinate to draw to
+ * - dfac is gap between scale markings
+ * - these involve a correction for horizontal scrollbar
+ * NOTE: it's assumed that that scrollbar is there if this is involved!
+ */
+ fac= (grid->starty- v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+ fac= (vert.ymin + V2D_SCROLL_HEIGHT) + fac*(vert.ymax - vert.ymin - V2D_SCROLL_HEIGHT);
+
+ dfac= (grid->dy) / (v2d->cur.ymax - v2d->cur.ymin);
+ dfac= dfac * (vert.ymax - vert.ymin - V2D_SCROLL_HEIGHT);
+
+ /* set starting value, and text color */
+ UI_ThemeColor(TH_TEXT);
+ val= grid->starty;
+
+ /* if vertical clamping (to whole numbers) is used (i.e. in Sequencer), apply correction */
+ // XXX only relevant to Sequencer, so need to review this when we port that code
+ if (vs->yclamp == V2D_GRID_CLAMP)
+ fac += 0.5f * dfac;
+
+ /* draw vertical steps */
+ for (; fac < vert.ymax; fac+= dfac, val += grid->dy) {
+ scroll_printstr(vs, (float)(vert.xmax)-14.0, fac, val, grid->powery, vs->yunits, 'v');
+ }
+ }
+
+ /* decoration outer bevel line */
+ UI_ThemeColorShade(TH_SHADE1, lighter);
+ if (v2d->scroll & V2D_SCROLL_RIGHT)
+ sdrawline(vert.xmin, vert.ymin, vert.xmin, vert.ymax);
+ else if (v2d->scroll & V2D_SCROLL_LEFT)
+ sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax);
+ }
+
+ /* draw a 'sunken square' to cover up any overlapping corners resulting from intersection of overflowing scroller data */
+ if ((v2d->scroll & V2D_SCROLL_VERTICAL) && (v2d->scroll & V2D_SCROLL_HORIZONTAL)) {
+ /* set bounds (these should be right) */
+ corner.xmin= vert.xmin;
+ corner.xmax= vert.xmax;
+ corner.ymin= hor.ymin;
+ corner.ymax= hor.ymax;
+
+ /* firstly, draw using background color to cover up any overlapping junk */
+ UI_ThemeColor(TH_SHADE1);
+ glRecti(corner.xmin, corner.ymin, corner.xmax, corner.ymax);
+
+ /* now, draw suggestive highlighting... */
+ /* first, dark lines on top to suggest scrollers overlap box */
+ UI_ThemeColorShade(TH_SHADE1, darker);
+ sdrawline(corner.xmin, corner.ymin, corner.xmin, corner.ymax);
+ sdrawline(corner.xmin, corner.ymax, corner.xmax, corner.ymax);
+ /* now, light lines on bottom to show box is sunken in */
+ UI_ThemeColorShade(TH_SHADE1, lighter);
+ sdrawline(corner.xmax, corner.ymin, corner.xmax, corner.ymax);
+ sdrawline(corner.xmin, corner.ymin, corner.xmax, corner.ymin);
+ }
+}
+
+/* free temporary memory used for drawing scrollers */
+void UI_view2d_scrollers_free(View2DScrollers *scrollers)
+{
+ /* need to free grid as well... */
+ if (scrollers->grid) MEM_freeN(scrollers->grid);
+ MEM_freeN(scrollers);
+}
+
+/* *********************************************************************** */
+/* Coordinate Conversions */
+
+/* Convert from screen/region space to 2d-View space
+ *
+ * - x,y = coordinates to convert
+ * - viewx,viewy = resultant coordinates
+ */
+void UI_view2d_region_to_view(View2D *v2d, int x, int y, float *viewx, float *viewy)
+{
+ float div, ofs;
+
+ if (viewx) {
+ div= v2d->mask.xmax - v2d->mask.xmin;
+ ofs= v2d->mask.xmin;
+
+ *viewx= v2d->cur.xmin + (v2d->cur.xmax-v2d->cur.xmin) * ((float)x - ofs) / div;
+ }
+
+ if (viewy) {
+ div= v2d->mask.ymax - v2d->mask.ymin;
+ ofs= v2d->mask.ymin;
+
+ *viewy= v2d->cur.ymin + (v2d->cur.ymax - v2d->cur.ymin) * ((float)y - ofs) / div;
+ }
+}
+
+/* Convert from 2d-View space to screen/region space
+ * - Coordinates are clamped to lie within bounds of region
+ *
+ * - x,y = coordinates to convert
+ * - regionx,regiony = resultant coordinates
+ */
+void UI_view2d_view_to_region(View2D *v2d, float x, float y, short *regionx, short *regiony)
+{
+ /* set initial value in case coordinate lies outside of bounds */
+ if (regionx)
+ *regionx= V2D_IS_CLIPPED;
+ if (regiony)
+ *regiony= V2D_IS_CLIPPED;
+
+ /* express given coordinates as proportional values */
+ x= (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ y= (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+
+ /* check if values are within bounds */
+ if ((x>=0.0f) && (x<=1.0f) && (y>=0.0f) && (y<=1.0f)) {
+ if (regionx)
+ *regionx= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin);
+ if (regiony)
+ *regiony= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin);
+ }
+}
+
+/* Convert from 2d-view space to screen/region space
+ * - Coordinates are NOT clamped to lie within bounds of region
+ *
+ * - x,y = coordinates to convert
+ * - regionx,regiony = resultant coordinates
+ */
+void UI_view2d_to_region_no_clip(View2D *v2d, float x, float y, short *regionx, short *regiony)
+{
+ /* step 1: express given coordinates as proportional values */
+ x= (x - v2d->cur.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ y= (y - v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+
+ /* step 2: convert proportional distances to screen coordinates */
+ x= v2d->mask.xmin + x*(v2d->mask.xmax - v2d->mask.xmin);
+ y= v2d->mask.ymin + y*(v2d->mask.ymax - v2d->mask.ymin);
+
+ /* although we don't clamp to lie within region bounds, we must avoid exceeding size of shorts */
+ if (regionx) {
+ if (x < -32760) *regionx= -32760;
+ else if(x > 32760) *regionx= 32760;
+ else *regionx= x;
+ }
+ if (regiony) {
+ if (y < -32760) *regiony= -32760;
+ else if(y > 32760) *regiony= 32760;
+ else *regiony= y;
+ }
+}
+
+/* *********************************************************************** */
+/* Utilities */
+
+/* View2D data by default resides in region, so get from region stored in context */
+View2D *UI_view2d_fromcontext(const bContext *C)
+{
+ if (C->area == NULL) return NULL;
+ if (C->region == NULL) return NULL;
+ return &(C->region->v2d);
+}
+
+/* same as above, but it returns regionwindow. Utility for pulldowns or buttons */
+View2D *UI_view2d_fromcontext_rwin(const bContext *C)
+{
+ if (C->area == NULL) return NULL;
+ if (C->region == NULL) return NULL;
+ if (C->region->regiontype!=RGN_TYPE_WINDOW) {
+ ARegion *ar= C->area->regionbase.first;
+ for(; ar; ar= ar->next)
+ if(ar->regiontype==RGN_TYPE_WINDOW)
+ return &(ar->v2d);
+ return NULL;
+ }
+ return &(C->region->v2d);
+}
+
+
+/* Calculate the scale per-axis of the drawing-area
+ * - Is used to inverse correct drawing of icons, etc. that need to follow view
+ * but not be affected by scale
+ *
+ * - x,y = scale on each axis
+ */
+void UI_view2d_getscale(View2D *v2d, float *x, float *y)
+{
+ if (x) *x = (v2d->mask.xmax - v2d->mask.xmin) / (v2d->cur.xmax - v2d->cur.xmin);
+ if (y) *y = (v2d->mask.ymax - v2d->mask.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
+}
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
new file mode 100644
index 00000000000..f1dde562c9d
--- /dev/null
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -0,0 +1,1192 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation, Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_view2d_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+/* ********************************************************* */
+/* General Polling Funcs */
+
+/* Check if mouse is within scrollbars
+ * - Returns appropriate code for match
+ * 'h' = in horizontal scrollbar
+ * 'v' = in vertical scrollbar
+ * 0 = not in scrollbar
+ *
+ * - x,y = mouse coordinates in screen (not region) space
+ */
+static short mouse_in_v2d_scrollers (const bContext *C, View2D *v2d, int x, int y)
+{
+ ARegion *ar= C->region;
+ int co[2];
+
+ /* clamp x,y to region-coordinates first */
+ co[0]= x - ar->winrct.xmin;
+ co[1]= y - ar->winrct.ymin;
+
+ /* check if within scrollbars */
+ if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
+ if (IN_2D_HORIZ_SCROLL(v2d, co)) return 'h';
+ }
+ if (v2d->scroll & V2D_SCROLL_VERTICAL) {
+ if (IN_2D_VERT_SCROLL(v2d, co)) return 'v';
+ }
+
+ /* not found */
+ return 0;
+}
+
+
+/* ********************************************************* */
+/* VIEW PANNING OPERATOR */
+
+/* This group of operators come in several forms:
+ * 1) Modal 'dragging' with MMB - where movement of mouse dictates amount to pan view by
+ * 2) Scrollwheel 'steps' - rolling mousewheel by one step moves view by predefined amount
+ *
+ * In order to make sure this works, each operator must define the following RNA-Operator Props:
+ * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
+ */
+
+/* ------------------ Shared 'core' stuff ---------------------- */
+
+/* temp customdata for operator */
+typedef struct v2dViewPanData {
+ View2D *v2d; /* view2d we're operating in */
+
+ float facx, facy; /* amount to move view relative to zoom */
+
+ /* options for version 1 */
+ int startx, starty; /* mouse x/y values in window when operator was initiated */
+ int lastx, lasty; /* previous x/y values of mouse in window */
+
+ short in_scroller; /* for MMB in scrollers (old feature in past, but now not that useful) */
+} v2dViewPanData;
+
+/* initialise panning customdata */
+static int view_pan_init(bContext *C, wmOperator *op)
+{
+ v2dViewPanData *vpd;
+ ARegion *ar;
+ View2D *v2d;
+ float winx, winy;
+
+ /* regions now have v2d-data by default, so check for region */
+ if (C->region == NULL)
+ return 0;
+ ar= C->region;
+
+ /* set custom-data for operator */
+ vpd= MEM_callocN(sizeof(v2dViewPanData), "v2dViewPanData");
+ op->customdata= vpd;
+
+ /* set pointers to owners */
+ vpd->v2d= v2d= &ar->v2d;
+
+ /* calculate translation factor - based on size of view */
+ winx= (float)(ar->winrct.xmax - ar->winrct.xmin);
+ winy= (float)(ar->winrct.ymax - ar->winrct.ymin);
+ vpd->facx= (v2d->cur.xmax - v2d->cur.xmin) / winx;
+ vpd->facy= (v2d->cur.ymax - v2d->cur.ymin) / winy;
+
+ return 1;
+}
+
+/* apply transform to view (i.e. adjust 'cur' rect) */
+static void view_pan_apply(bContext *C, wmOperator *op)
+{
+ v2dViewPanData *vpd= op->customdata;
+ View2D *v2d= vpd->v2d;
+ float dx, dy;
+
+ /* calculate amount to move view by */
+ dx= vpd->facx * (float)RNA_int_get(op->ptr, "deltax");
+ dy= vpd->facy * (float)RNA_int_get(op->ptr, "deltay");
+
+ /* only move view on an axis if change is allowed */
+ if ((v2d->keepofs & V2D_LOCKOFS_X)==0) {
+ v2d->cur.xmin += dx;
+ v2d->cur.xmax += dx;
+ }
+ if ((v2d->keepofs & V2D_LOCKOFS_Y)==0) {
+ v2d->cur.ymin += dy;
+ v2d->cur.ymax += dy;
+ }
+
+ /* validate that view is in valid configuration after this operation */
+ UI_view2d_curRect_validate(v2d);
+
+ /* request updates to be done... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ /* XXX: add WM_NOTE_TIME_CHANGED? */
+}
+
+/* cleanup temp customdata */
+static void view_pan_exit(bContext *C, wmOperator *op)
+{
+ if (op->customdata) {
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+ }
+}
+
+/* ------------------ Modal Drag Version (1) ---------------------- */
+
+/* for 'redo' only, with no user input */
+static int view_pan_exec(bContext *C, wmOperator *op)
+{
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ view_pan_apply(C, op);
+ view_pan_exit(C, op);
+ return OPERATOR_FINISHED;
+}
+
+/* set up modal operator and relevant settings */
+static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ v2dViewPanData *vpd;
+ View2D *v2d;
+
+ /* set up customdata */
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ vpd= op->customdata;
+ v2d= vpd->v2d;
+
+ /* set initial settings */
+ vpd->startx= vpd->lastx= event->x;
+ vpd->starty= vpd->lasty= event->y;
+ RNA_int_set(op->ptr, "deltax", 0);
+ RNA_int_set(op->ptr, "deltay", 0);
+
+#if 0 // XXX - enable this when cursors are working properly
+ if (v2d->keepofs & V2D_LOCKOFS_X)
+ WM_set_cursor(C, BC_NS_SCROLLCURSOR);
+ else if (v2d->keepofs & V2D_LOCKOFS_Y)
+ WM_set_cursor(C, BC_EW_SCROLLCURSOR);
+ else
+ WM_set_cursor(C, BC_NSEW_SCROLLCURSOR);
+#endif // XXX - enable this when cursors are working properly
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
+static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ v2dViewPanData *vpd= op->customdata;
+
+ /* execute the events */
+ switch (event->type) {
+ case MOUSEMOVE:
+ {
+ /* calculate new delta transform, then store mouse-coordinates for next-time */
+ RNA_int_set(op->ptr, "deltax", (vpd->lastx - event->x));
+ RNA_int_set(op->ptr, "deltay", (vpd->lasty - event->y));
+
+ vpd->lastx= event->x;
+ vpd->lasty= event->y;
+
+ view_pan_apply(C, op);
+ }
+ break;
+
+ case MIDDLEMOUSE:
+ if (event->val==0) {
+ /* calculate overall delta mouse-movement for redo */
+ RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx));
+ RNA_int_set(op->ptr, "deltay", (vpd->starty - vpd->lasty));
+
+ view_pan_exit(C, op);
+ //WM_set_cursor(C, CURSOR_STD); // XXX - enable this when cursors are working properly
+
+ return OPERATOR_FINISHED;
+ }
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void ED_View2D_OT_view_pan(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Pan View";
+ ot->idname= "ED_View2D_OT_view_pan";
+
+ /* api callbacks */
+ ot->exec= view_pan_exec;
+ ot->invoke= view_pan_invoke;
+ ot->modal= view_pan_modal;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_INT, PROP_NONE);
+}
+
+/* ------------------ Scrollwheel Versions (2) ---------------------- */
+
+/* this operator only needs this single callback, where it callsthe view_pan_*() methods */
+static int view_scrollright_exec(bContext *C, wmOperator *op)
+{
+ /* initialise default settings (and validate if ok to run) */
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - only movement in positive x-direction */
+ RNA_int_set(op->ptr, "deltax", 20);
+ RNA_int_set(op->ptr, "deltay", 0);
+
+ /* apply movement, then we're done */
+ view_pan_apply(C, op);
+ view_pan_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_scrollright(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Scroll Right";
+ ot->idname= "ED_View2D_OT_view_rightscroll";
+
+ /* api callbacks */
+ ot->exec= view_scrollright_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_INT, PROP_NONE);
+}
+
+
+
+/* this operator only needs this single callback, where it callsthe view_pan_*() methods */
+static int view_scrollleft_exec(bContext *C, wmOperator *op)
+{
+ /* initialise default settings (and validate if ok to run) */
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - only movement in negative x-direction */
+ RNA_int_set(op->ptr, "deltax", -20);
+ RNA_int_set(op->ptr, "deltay", 0);
+
+ /* apply movement, then we're done */
+ view_pan_apply(C, op);
+ view_pan_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_scrollleft(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Scroll Left";
+ ot->idname= "ED_View2D_OT_view_leftscroll";
+
+ /* api callbacks */
+ ot->exec= view_scrollleft_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_INT, PROP_NONE);
+}
+
+/* this operator only needs this single callback, where it callsthe view_pan_*() methods */
+static int view_scrolldown_exec(bContext *C, wmOperator *op)
+{
+ /* initialise default settings (and validate if ok to run) */
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - only movement in positive x-direction */
+ RNA_int_set(op->ptr, "deltax", 0);
+ RNA_int_set(op->ptr, "deltay", -20);
+
+ /* apply movement, then we're done */
+ view_pan_apply(C, op);
+ view_pan_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_scrolldown(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Scroll Down";
+ ot->idname= "ED_View2D_OT_view_downscroll";
+
+ /* api callbacks */
+ ot->exec= view_scrolldown_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_INT, PROP_NONE);
+}
+
+
+
+/* this operator only needs this single callback, where it callsthe view_pan_*() methods */
+static int view_scrollup_exec(bContext *C, wmOperator *op)
+{
+ /* initialise default settings (and validate if ok to run) */
+ if (!view_pan_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - only movement in negative x-direction */
+ RNA_int_set(op->ptr, "deltax", 0);
+ RNA_int_set(op->ptr, "deltay", 20);
+
+ /* apply movement, then we're done */
+ view_pan_apply(C, op);
+ view_pan_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_scrollup(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Scroll Up";
+ ot->idname= "ED_View2D_OT_view_upscroll";
+
+ /* api callbacks */
+ ot->exec= view_scrollup_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_INT, PROP_NONE);
+}
+
+/* ********************************************************* */
+/* SINGLE-STEP VIEW ZOOMING OPERATOR */
+
+/* This group of operators come in several forms:
+ * 1) Scrollwheel 'steps' - rolling mousewheel by one step zooms view by predefined amount
+ * 2) Scrollwheel 'steps' + alt + ctrl/shift - zooms view on one axis only (ctrl=x, shift=y) // XXX this could be implemented...
+ * 3) Pad +/- Keys - pressing each key moves the zooms the view by a predefined amount
+ *
+ * In order to make sure this works, each operator must define the following RNA-Operator Props:
+ * zoomfacx, zoomfacy - These two zoom factors allow for non-uniform scaling.
+ * It is safe to scale by 0, as these factors are used to determine
+ * amount to enlarge 'cur' by
+ */
+
+/* ------------------ 'Shared' stuff ------------------------ */
+
+/* check if step-zoom can be applied */
+static short view_zoomstep_ok(bContext *C)
+{
+ View2D *v2d;
+
+ /* check if there's a region in context to work with */
+ if (C->region == NULL)
+ return 0;
+ v2d= &C->region->v2d;
+
+ /* check that 2d-view is zoomable */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) && (v2d->keepzoom & V2D_LOCKZOOM_Y))
+ return 0;
+
+ /* view is zoomable */
+ return 1;
+}
+
+/* apply transform to view (i.e. adjust 'cur' rect) */
+static void view_zoomstep_apply(bContext *C, wmOperator *op)
+{
+ View2D *v2d= &C->region->v2d;
+ float dx, dy;
+
+ /* calculate amount to move view by */
+ dx= (v2d->cur.xmax - v2d->cur.xmin) * (float)RNA_float_get(op->ptr, "zoomfacx");
+ dy= (v2d->cur.ymax - v2d->cur.ymin) * (float)RNA_float_get(op->ptr, "zoomfacy");
+
+ /* only move view on an axis if change is allowed */
+ if ((v2d->keepzoom & V2D_LOCKOFS_X)==0) {
+ v2d->cur.xmin += dx;
+ v2d->cur.xmax -= dx;
+ }
+ if ((v2d->keepzoom & V2D_LOCKOFS_Y)==0) {
+ v2d->cur.ymin += dy;
+ v2d->cur.ymax -= dy;
+ }
+
+ /* validate that view is in valid configuration after this operation */
+ UI_view2d_curRect_validate(v2d);
+
+ /* request updates to be done... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ /* XXX: add WM_NOTE_TIME_CHANGED? */
+}
+
+/* --------------- Individual Operators ------------------- */
+
+/* this operator only needs this single callback, where it calls the view_zoom_*() methods */
+static int view_zoomin_exec(bContext *C, wmOperator *op)
+{
+ /* check that there's an active region, as View2D data resides there */
+ if (!view_zoomstep_ok(C))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - zooming in by uniform factor */
+ RNA_float_set(op->ptr, "zoomfacx", 0.0375f);
+ RNA_float_set(op->ptr, "zoomfacy", 0.0375f);
+
+ /* apply movement, then we're done */
+ view_zoomstep_apply(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_zoomin(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Zoom In";
+ ot->idname= "ED_View2D_OT_view_zoomin";
+
+ /* api callbacks */
+ ot->exec= view_zoomin_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "zoomfacx", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "zoomfacy", PROP_FLOAT, PROP_NONE);
+}
+
+
+
+/* this operator only needs this single callback, where it callsthe view_zoom_*() methods */
+static int view_zoomout_exec(bContext *C, wmOperator *op)
+{
+ /* check that there's an active region, as View2D data resides there */
+ if (!view_zoomstep_ok(C))
+ return OPERATOR_CANCELLED;
+
+ /* set RNA-Props - zooming in by uniform factor */
+ RNA_float_set(op->ptr, "zoomfacx", -0.0375f);
+ RNA_float_set(op->ptr, "zoomfacy", -0.0375f);
+
+ /* apply movement, then we're done */
+ view_zoomstep_apply(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_View2D_OT_view_zoomout(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Zoom Out";
+ ot->idname= "ED_View2D_OT_view_zoomout";
+
+ /* api callbacks */
+ ot->exec= view_zoomout_exec;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "zoomfacx", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "zoomfacy", PROP_FLOAT, PROP_NONE);
+}
+
+/* ********************************************************* */
+/* DRAG-ZOOM OPERATOR */
+
+/* This group of operators come in several forms:
+ * 1) MMB Drag - allows non-uniform scaling by dragging mouse
+ * - method of scaling depends upon U.viewzoom setting (Continue, Dolly, Scale)
+ * XXX should we store this info as RNA prop?
+ *
+ * In order to make sure this works, each operator must define the following RNA-Operator Props:
+ * deltax, deltay - amounts to add to each side of the 'cur' rect
+ */
+
+/* ------------------ Shared 'core' stuff ---------------------- */
+
+/* temp customdata for operator */
+typedef struct v2dViewZoomData {
+ View2D *v2d; /* view2d we're operating in */
+
+ int lastx, lasty; /* previous x/y values of mouse in window */
+ float dx, dy; /* running tally of previous delta values (for obtaining final zoom) */
+} v2dViewZoomData;
+
+/* initialise panning customdata */
+static int view_zoomdrag_init(bContext *C, wmOperator *op)
+{
+ v2dViewZoomData *vzd;
+ View2D *v2d;
+
+ /* regions now have v2d-data by default, so check for region */
+ if (C->region == NULL)
+ return 0;
+ v2d= &C->region->v2d;
+
+ /* check that 2d-view is zoomable */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X) && (v2d->keepzoom & V2D_LOCKZOOM_Y))
+ return 0;
+
+ /* set custom-data for operator */
+ vzd= MEM_callocN(sizeof(v2dViewZoomData), "v2dViewZoomData");
+ op->customdata= vzd;
+
+ /* set pointers to owners */
+ vzd->v2d= v2d;
+
+ return 1;
+}
+
+/* apply transform to view (i.e. adjust 'cur' rect) */
+static void view_zoomdrag_apply(bContext *C, wmOperator *op)
+{
+ v2dViewZoomData *vzd= op->customdata;
+ View2D *v2d= vzd->v2d;
+ float dx, dy;
+
+ /* get amount to move view by */
+ dx= RNA_float_get(op->ptr, "deltax");
+ dy= RNA_float_get(op->ptr, "deltay");
+
+ /* only move view on an axis if change is allowed */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
+ v2d->cur.xmin += dx;
+ v2d->cur.xmax -= dx;
+ }
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
+ v2d->cur.ymin += dy;
+ v2d->cur.ymax -= dy;
+ }
+
+ /* validate that view is in valid configuration after this operation */
+ UI_view2d_curRect_validate(v2d);
+
+ /* request updates to be done... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ /* XXX: add WM_NOTE_TIME_CHANGED? */
+}
+
+/* cleanup temp customdata */
+static void view_zoomdrag_exit(bContext *C, wmOperator *op)
+{
+ if (op->customdata) {
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+ }
+}
+
+/* for 'redo' only, with no user input */
+static int view_zoomdrag_exec(bContext *C, wmOperator *op)
+{
+ if (!view_zoomdrag_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ view_zoomdrag_apply(C, op);
+ view_zoomdrag_exit(C, op);
+ return OPERATOR_FINISHED;
+}
+
+/* set up modal operator and relevant settings */
+static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ v2dViewZoomData *vzd;
+ View2D *v2d;
+
+ /* set up customdata */
+ if (!view_zoomdrag_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ vzd= op->customdata;
+ v2d= vzd->v2d;
+
+ /* set initial settings */
+ vzd->lastx= event->x;
+ vzd->lasty= event->y;
+ RNA_float_set(op->ptr, "deltax", 0);
+ RNA_float_set(op->ptr, "deltay", 0);
+
+#if 0 // XXX - enable this when cursors are working properly
+ if (v2d->keepofs & V2D_LOCKOFS_X)
+ WM_set_cursor(C, BC_NS_SCROLLCURSOR);
+ else if (v2d->keepofs & V2D_LOCKOFS_Y)
+ WM_set_cursor(C, BC_EW_SCROLLCURSOR);
+ else
+ WM_set_cursor(C, BC_NSEW_SCROLLCURSOR);
+#endif // XXX - enable this when cursors are working properly
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
+static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ v2dViewZoomData *vzd= op->customdata;
+ View2D *v2d= vzd->v2d;
+
+ /* execute the events */
+ switch (event->type) {
+ case MOUSEMOVE:
+ {
+ float dx, dy;
+
+ /* calculate new delta transform, based on zooming mode */
+ if (U.viewzoom == USER_ZOOM_SCALE) { // XXX store this setting as RNA prop?
+ /* 'scale' zooming */
+ float dist;
+
+ /* x-axis transform */
+ dist = (v2d->mask.xmax - v2d->mask.xmin) / 2.0f;
+ dx= 1.0f - (fabs(vzd->lastx - dist) + 2.0f) / (fabs(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 - (fabs(vzd->lasty - dist) + 2.0) / (fabs(event->y - dist) + 2.0f);
+ dy*= 0.5f * (v2d->cur.ymax - v2d->cur.ymin);
+ }
+ else {
+ /* 'continuous' or 'dolly' */
+ float fac;
+
+ /* x-axis transform */
+ fac= 0.01f * (event->x - vzd->lastx);
+ dx= fac * (v2d->cur.xmax - v2d->cur.xmin);
+
+ /* y-axis transform */
+ fac= 0.01f * (event->y - vzd->lasty);
+ dy= fac * (v2d->cur.ymax - v2d->cur.ymin);
+
+ /* continous zoom shouldn't move that fast... */
+ if (U.viewzoom == USER_ZOOM_CONT) { // XXX store this setting as RNA prop?
+ dx /= 20.0f;
+ dy /= 20.0f;
+ }
+ }
+
+ /* set transform amount, and add current deltas to stored total delta (for redo) */
+ RNA_float_set(op->ptr, "deltax", dx);
+ RNA_float_set(op->ptr, "deltay", dy);
+ vzd->dx += dx;
+ vzd->dy += dy;
+
+ /* store mouse coordinates for next time, if not doing continuous zoom
+ * - continuous zoom only depends on distance of mouse to starting point to determine rate of change
+ */
+ if (U.viewzoom != USER_ZOOM_CONT) { // XXX store this setting as RNA prop?
+ vzd->lastx= event->x;
+ vzd->lasty= event->y;
+ }
+
+ /* apply zooming */
+ view_zoomdrag_apply(C, op);
+ }
+ break;
+
+ case MIDDLEMOUSE:
+ if (event->val==0) {
+ /* for redo, store the overall deltas - need to respect zoom-locks here... */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0)
+ RNA_float_set(op->ptr, "deltax", vzd->dx);
+ else
+ RNA_float_set(op->ptr, "deltax", 0);
+
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0)
+ RNA_float_set(op->ptr, "deltay", vzd->dy);
+ else
+ RNA_float_set(op->ptr, "deltay", 0);
+
+ /* free customdata */
+ view_zoomdrag_exit(C, op);
+ //WM_set_cursor(C, CURSOR_STD); // XXX - enable this when cursors are working properly
+
+ return OPERATOR_FINISHED;
+ }
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void ED_View2D_OT_view_zoom(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Zoom View";
+ ot->idname= "ED_View2D_OT_view_zoom";
+
+ /* api callbacks */
+ ot->exec= view_zoomdrag_exec;
+ ot->invoke= view_zoomdrag_invoke;
+ ot->modal= view_zoomdrag_modal;
+
+ /* operator is repeatable */
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna - must keep these in sync with the other operators */
+ prop= RNA_def_property(ot->srna, "deltax", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "deltay", PROP_FLOAT, PROP_NONE);
+}
+
+/* ********************************************************* */
+/* SCROLLERS */
+
+/* Scrollers should behave in the following ways, when clicked on with LMB (and dragged):
+ * 1) 'Handles' on end of 'bubble' - when the axis that the scroller represents is zoomable,
+ * enlarge 'cur' rect on the relevant side
+ * 2) 'Bubble'/'bar' - just drag, and bar should move with mouse (view pans opposite)
+ *
+ * In order to make sure this works, each operator must define the following RNA-Operator Props:
+ * deltax, deltay - define how much to move view by (relative to zoom-correction factor)
+ */
+
+/* customdata for scroller-invoke data */
+typedef struct v2dScrollerMove {
+ View2D *v2d; /* View2D data that this operation affects */
+
+ short scroller; /* scroller that mouse is in ('h' or 'v') */
+ short zone; /* -1 is min zoomer, 0 is bar, 1 is max zoomer */ // XXX find some way to provide visual feedback of this (active colour?)
+
+ float fac; /* view adjustment factor, based on size of region */
+ float delta; /* amount moved by mouse on axis of interest */
+
+ int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */
+} v2dScrollerMove;
+
+
+/* View2DScrollers is typedef'd in UI_view2d.h
+ * This is a CUT DOWN VERSION of the 'real' version, which is defined in view2d.c, as we only need focus bubble info
+ * WARNING: the start of this struct must not change, so that it stays in sync with the 'real' version
+ * For now, we don't need to have a separate (internal) header for structs like this...
+ */
+struct View2DScrollers {
+ /* focus bubbles */
+ int vert_min, vert_max; /* vertical scrollbar */
+ int hor_min, hor_max; /* horizontal scrollbar */
+};
+
+/* quick enum for vsm->zone (scroller handles) */
+enum {
+ SCROLLHANDLE_MIN= -1,
+ SCROLLHANDLE_BAR,
+ SCROLLHANDLE_MAX
+} eV2DScrollerHandle_Zone;
+
+/* ------------------------ */
+
+/* check if mouse is within scroller handle
+ * - mouse = relevant mouse coordinate in region space
+ * - sc_min, sc_max = extents of scroller
+ * - sh_min, sh_max = positions of scroller handles
+ */
+static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_min, int sh_max)
+{
+ short in_min, in_max, in_view=1;
+
+ /* firstly, check if
+ * - 'bubble' fills entire scroller
+ * - 'bubble' completely out of view on either side
+ */
+ if ((sh_min <= sc_min) && (sh_max >= sc_max)) in_view= 0;
+ if (sh_min == sh_max) {
+ if (sh_min <= sc_min) in_view= 0;
+ if (sh_max >= sc_max) in_view= 0;
+ }
+ else {
+ if (sh_max <= sc_min) in_view= 0;
+ if (sh_min >= sc_max) in_view= 0;
+ }
+
+
+ if (in_view == 0) {
+ /* handles are only activated if the mouse is within the relative quater lengths of the scroller */
+ int qLen = (sc_max + sc_min) / 4;
+
+ if (mouse >= (sc_max - qLen))
+ return SCROLLHANDLE_MAX;
+ else if (mouse <= qLen)
+ return SCROLLHANDLE_MIN;
+ else
+ return SCROLLHANDLE_BAR;
+ }
+
+ /* check if mouse is in or past either handle */
+ in_max= ( (mouse >= (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse <= (sh_max + V2D_SCROLLER_HANDLE_SIZE)) );
+ in_min= ( (mouse <= (sh_min + V2D_SCROLLER_HANDLE_SIZE)) && (mouse >= (sh_min - V2D_SCROLLER_HANDLE_SIZE)) );
+
+ /* check if overlap --> which means user clicked on bar, as bar is within handles region */
+ if (in_max && in_min)
+ return SCROLLHANDLE_BAR;
+ else if (in_max)
+ return SCROLLHANDLE_MAX;
+ else if (in_min)
+ return SCROLLHANDLE_MIN;
+
+ /* unlikely to happen, though we just cover it in case */
+ return SCROLLHANDLE_BAR;
+}
+
+/* initialise customdata for scroller manipulation operator */
+static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, short in_scroller)
+{
+ v2dScrollerMove *vsm;
+ View2DScrollers *scrollers;
+ ARegion *ar= C->region;
+ View2D *v2d= &ar->v2d;
+ float mask_size;
+ int x, y;
+
+ /* set custom-data for operator */
+ vsm= MEM_callocN(sizeof(v2dScrollerMove), "v2dScrollerMove");
+ op->customdata= vsm;
+
+ /* set general data */
+ vsm->v2d= v2d;
+ vsm->scroller= in_scroller;
+
+ /* store mouse-coordinates, and convert mouse/screen coordinates to region coordinates */
+ vsm->lastx = event->x;
+ vsm->lasty = event->y;
+ x= event->x - ar->winrct.xmin;
+ y= event->y - ar->winrct.ymin;
+
+ /* 'zone' depends on where mouse is relative to bubble
+ * - zooming must be allowed on this axis, otherwise, default to pan
+ */
+ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ if (in_scroller == 'h') {
+ /* horizontal scroller - calculate adjustment factor first */
+ mask_size= (float)(v2d->hor.xmax - v2d->hor.xmin);
+ vsm->fac= (v2d->tot.xmax - v2d->tot.xmin) / mask_size;
+
+ /* get 'zone' (i.e. which part of scroller is activated) */
+ if (v2d->keepzoom & V2D_LOCKZOOM_X) {
+ /* default to scroll, as handles not usable */
+ vsm->zone= SCROLLHANDLE_BAR;
+ }
+ else {
+ /* check which handle we're in */
+ vsm->zone= mouse_in_scroller_handle(x, v2d->hor.xmin, v2d->hor.xmax, scrollers->hor_min, scrollers->hor_max);
+ }
+ }
+ else {
+ /* vertical scroller - calculate adjustment factor first */
+ mask_size= (float)(v2d->vert.ymax - v2d->vert.ymin);
+ vsm->fac= (v2d->tot.ymax - v2d->tot.ymin) / mask_size;
+
+ /* get 'zone' (i.e. which part of scroller is activated) */
+ if (v2d->keepzoom & V2D_LOCKZOOM_Y) {
+ /* default to scroll, as handles not usable */
+ vsm->zone= SCROLLHANDLE_BAR;
+ }
+ else {
+ /* check which handle we're in */
+ vsm->zone= mouse_in_scroller_handle(y, v2d->vert.ymin, v2d->vert.ymax, scrollers->vert_min, scrollers->vert_max);
+ }
+ }
+ UI_view2d_scrollers_free(scrollers);
+}
+
+/* cleanup temp customdata */
+static void scroller_activate_exit(bContext *C, wmOperator *op)
+{
+ if (op->customdata) {
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+ }
+}
+
+/* apply transform to view (i.e. adjust 'cur' rect) */
+static void scroller_activate_apply(bContext *C, wmOperator *op)
+{
+ v2dScrollerMove *vsm= op->customdata;
+ View2D *v2d= vsm->v2d;
+ float temp;
+
+ /* calculate amount to move view by */
+ temp= vsm->fac * vsm->delta;
+
+ /* type of movement */
+ switch (vsm->zone) {
+ case SCROLLHANDLE_MIN:
+ /* only expand view on axis if zoom is allowed */
+ if ((vsm->scroller == 'h') && !(v2d->keepzoom & V2D_LOCKZOOM_X))
+ v2d->cur.xmin -= temp;
+ if ((vsm->scroller == 'v') && !(v2d->keepzoom & V2D_LOCKZOOM_Y))
+ v2d->cur.ymin -= temp;
+ break;
+
+ case SCROLLHANDLE_MAX:
+ /* only expand view on axis if zoom is allowed */
+ if ((vsm->scroller == 'h') && !(v2d->keepzoom & V2D_LOCKZOOM_X))
+ v2d->cur.xmax += temp;
+ if ((vsm->scroller == 'v') && !(v2d->keepzoom & V2D_LOCKZOOM_Y))
+ v2d->cur.ymax += temp;
+ break;
+
+ default: /* SCROLLHANDLE_BAR */
+ /* only move view on an axis if panning is allowed */
+ if ((vsm->scroller == 'h') && !(v2d->keepofs & V2D_LOCKOFS_X)) {
+ v2d->cur.xmin += temp;
+ v2d->cur.xmax += temp;
+ }
+ if ((vsm->scroller == 'v') && !(v2d->keepofs & V2D_LOCKOFS_Y)) {
+ v2d->cur.ymin += temp;
+ v2d->cur.ymax += temp;
+ }
+ break;
+ }
+
+ /* validate that view is in valid configuration after this operation */
+ UI_view2d_curRect_validate(v2d);
+
+ /* request updates to be done... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ /* XXX: add WM_NOTE_TIME_CHANGED? */
+}
+
+/* handle user input for scrollers - calculations of mouse-movement need to be done here, not in the apply callback! */
+static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ v2dScrollerMove *vsm= op->customdata;
+
+ /* execute the events */
+ switch (event->type) {
+ case MOUSEMOVE:
+ {
+ /* calculate new delta transform, then store mouse-coordinates for next-time */
+ if (vsm->zone != SCROLLHANDLE_MIN) {
+ /* if using bar (i.e. 'panning') or 'max' zoom widget */
+ switch (vsm->scroller) {
+ case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
+ vsm->delta= (float)(event->x - vsm->lastx);
+ break;
+ case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
+ vsm->delta= (float)(event->y - vsm->lasty);
+ break;
+ }
+ }
+ else {
+ /* using 'min' zoom widget */
+ switch (vsm->scroller) {
+ case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves with mouse) */
+ vsm->delta= (float)(vsm->lastx - event->x);
+ break;
+ case 'v': /* vertical scroller - so only vertical movement ('cur' moves with to mouse) */
+ vsm->delta= (float)(vsm->lasty - event->y);
+ break;
+ }
+ }
+
+ /* store previous coordinates */
+ vsm->lastx= event->x;
+ vsm->lasty= event->y;
+
+ scroller_activate_apply(C, op);
+ }
+ break;
+
+ case LEFTMOUSE:
+ if (event->val==0) {
+ scroller_activate_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+
+/* a click (or click drag in progress) should have occurred, so check if it happened in scrollbar */
+static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ View2D *v2d= NULL;
+ short in_scroller= 0;
+
+ /* firstly, check context to see if mouse is actually in region */
+ // XXX isn't this the job of poll() callbacks which can't check events, but only context?
+ if (C->region == NULL)
+ return OPERATOR_CANCELLED;
+ else
+ v2d= &C->region->v2d;
+
+ /* check if mouse in scrollbars, if they're enabled */
+ in_scroller= mouse_in_v2d_scrollers(C, v2d, event->x, event->y);
+
+ /* if in a scroller, init customdata then set modal handler which will catch mousedown to start doing useful stuff */
+ if (in_scroller) {
+ v2dScrollerMove *vsm;
+
+ /* initialise customdata */
+ scroller_activate_init(C, op, event, in_scroller);
+ vsm= (v2dScrollerMove *)op->customdata;
+
+ /* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */
+ if (vsm->zone == SCROLLHANDLE_BAR) {
+ if ( ((vsm->scroller=='h') && (v2d->keepofs & V2D_LOCKOFS_X)) ||
+ ((vsm->scroller=='v') && (v2d->keepofs & V2D_LOCKOFS_Y)) )
+ {
+ /* free customdata initialised */
+ scroller_activate_exit(C, op);
+
+ /* can't catch this event for ourselves, so let it go to someone else? */
+ return OPERATOR_PASS_THROUGH;
+ }
+ }
+
+ /* still ok, so can add */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+ return OPERATOR_RUNNING_MODAL;
+ }
+ else {
+ /* not in scroller, so nothing happened... (pass through let's something else catch event) */
+ return OPERATOR_PASS_THROUGH;
+ }
+}
+
+/* LMB-Drag in Scrollers - not repeatable operator! */
+void ED_View2D_OT_scroller_activate(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Scroller Activate";
+ ot->idname= "ED_View2D_OT_scroller_activate";
+
+ /* api callbacks */
+ ot->invoke= scroller_activate_invoke;
+ ot->modal= scroller_activate_modal;
+}
+
+/* ********************************************************* */
+/* Registration */
+
+void ui_view2d_operatortypes(void)
+{
+ WM_operatortype_append(ED_View2D_OT_view_pan);
+
+ WM_operatortype_append(ED_View2D_OT_view_scrollleft);
+ WM_operatortype_append(ED_View2D_OT_view_scrollright);
+ WM_operatortype_append(ED_View2D_OT_view_scrollup);
+ WM_operatortype_append(ED_View2D_OT_view_scrolldown);
+
+ WM_operatortype_append(ED_View2D_OT_view_zoomin);
+ WM_operatortype_append(ED_View2D_OT_view_zoomout);
+
+ WM_operatortype_append(ED_View2D_OT_view_zoom);
+
+ WM_operatortype_append(ED_View2D_OT_scroller_activate);
+}
+
+void UI_view2d_keymap(wmWindowManager *wm)
+{
+ ListBase *keymap= WM_keymap_listbase(wm, "View2D", 0, 0);
+
+ /* pan/scroll */
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0);
+
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_rightscroll", WHEELDOWNMOUSE, KM_ANY, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_leftscroll", WHEELUPMOUSE, KM_ANY, KM_CTRL, 0);
+
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_downscroll", WHEELDOWNMOUSE, KM_ANY, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_upscroll", WHEELUPMOUSE, KM_ANY, KM_SHIFT, 0);
+
+ /* zoom - single step */
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_zoomout", WHEELUPMOUSE, KM_ANY, 0, 0);
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_zoomin", WHEELDOWNMOUSE, KM_ANY, 0, 0);
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_zoomout", PADMINUS, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_zoomin", PADPLUSKEY, KM_PRESS, 0, 0);
+
+ /* zoom - drag */
+ WM_keymap_add_item(keymap, "ED_View2D_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0);
+
+ /* scrollers */
+ WM_keymap_add_item(keymap, "ED_View2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
+}
+
diff --git a/source/blender/editors/mesh/Makefile b/source/blender/editors/mesh/Makefile
new file mode 100644
index 00000000000..b2aeaa145f7
--- /dev/null
+++ b/source/blender/editors/mesh/Makefile
@@ -0,0 +1,52 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/source/blender/editors/mesh/SConscript
diff --git a/source/blender/editors/object/Makefile b/source/blender/editors/object/Makefile
new file mode 100644
index 00000000000..b2aeaa145f7
--- /dev/null
+++ b/source/blender/editors/object/Makefile
@@ -0,0 +1,52 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/object/SConscript b/source/blender/editors/object/SConscript
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/source/blender/editors/object/SConscript
diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt
new file mode 100644
index 00000000000..da0475cebdd
--- /dev/null
+++ b/source/blender/editors/screen/CMakeLists.txt
@@ -0,0 +1,87 @@
+# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
+# ***** BEGIN GPL/BL DUAL 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. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+
+FILE(GLOB SRC */*.c)
+
+SET(INC ../../windowmanager
+ ../../editors/include
+ ../../../../intern/guardedalloc ../../../../intern/memutil
+ ../../blenlib ../../makesdna ../../makesrna ../../blenkernel
+ ../../include ../../../../intern/bmfont ../../imbuf
+ ../../render/extern/include ../../../../intern/bsp/extern
+ ../../radiosity/extern/include
+ ../../../intern/decimation/extern ../../blenloader ../../python
+ ../../../kernel/gen_system ../../../../intern/SoundSystem ../../readstreamglue
+ ../../quicktime ../../../../intern/elbeem/extern
+ ../../../../intern/ghost ../../../../intern/opennl/extern
+ ../../nodes
+ ${PYTHON_INC}
+ ${SDL_INC}
+)
+
+IF(WITH_INTERNATIONAL)
+ SET(INC ${INC} ../../ftfont)
+ ADD_DEFINITIONS(-DINTERNATIONAL)
+ ADD_DEFINITIONS(-DFTGL_STATIC_LIBRARY)
+ENDIF(WITH_INTERNATIONAL)
+
+IF(WITH_OPENEXR)
+ ADD_DEFINITIONS(-DWITH_OPENEXR)
+ENDIF(WITH_OPENEXR)
+
+IF(WITH_QUICKTIME)
+ SET(INC ${INC} ${QUICKTIME_INC})
+ ADD_DEFINITIONS(-DWITH_QUICKTIME)
+ENDIF(WITH_QUICKTIME)
+
+IF(WITH_FFMPEG)
+ SET(INC ${INC} ${FFMPEG_INC})
+ ADD_DEFINITIONS(-DWITH_FFMPEG)
+ENDIF(WITH_FFMPEG)
+
+IF(WIN32)
+ SET(INC ${INC} ${PTHREADS_INC})
+ENDIF(WIN32)
+
+IF(WITH_VERSE)
+ SET(INC ${INC} ${VERSE_INC})
+ ADD_DEFINITIONS(-DWITH_VERSE)
+ENDIF(WITH_VERSE)
+
+# TODO buildinfo
+IF(BF_BUILDINFO)
+ ADD_DEFINITIONS(-DNAN_BUILDINFO)
+ENDIF(BF_BUILDINFO)
+
+BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
+
+IF(WITH_VERSE)
+ ADD_DEPENDENCIES(bf_editors mkprot verse)
+ENDIF(WITH_VERSE)
+
diff --git a/source/blender/editors/screen/Makefile b/source/blender/editors/screen/Makefile
new file mode 100644
index 00000000000..16ff8867eb0
--- /dev/null
+++ b/source/blender/editors/screen/Makefile
@@ -0,0 +1,54 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/screen/SConscript b/source/blender/editors/screen/SConscript
new file mode 100644
index 00000000000..57a8e1ac931
--- /dev/null
+++ b/source/blender/editors/screen/SConscript
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../blenloader ../../windowmanager ../../python ../../makesrna'
+incs += ' #/intern/guardedalloc #/extern/glew/include'
+
+defs = ''
+
+if not env['WITH_BF_PYTHON']:
+ defs += 'DISABLE_PYTHON'
+
+env.BlenderLib ( 'bf_editors_screen', sources, Split(incs), Split(defs), libtype=['core','intern'], priority=[30, 35] )
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
new file mode 100644
index 00000000000..fc6ed8cee54
--- /dev/null
+++ b/source/blender/editors/screen/area.c
@@ -0,0 +1,628 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "ED_screen.h"
+#include "ED_screen_types.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_subwindow.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#ifndef DISABLE_PYTHON
+#include "BPY_extern.h"
+#endif
+
+#include "ED_util.h"
+
+#include "screen_intern.h"
+
+/* general area and region code */
+
+static void region_draw_emboss(ARegion *ar)
+{
+ short winx, winy;
+
+ winx= ar->winrct.xmax-ar->winrct.xmin;
+ winy= ar->winrct.ymax-ar->winrct.ymin;
+
+ /* set transp line */
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+
+ /* right */
+ glColor4ub(0,0,0, 50);
+ sdrawline(winx, 0, winx, winy);
+
+ /* bottom */
+ glColor4ub(0,0,0, 80);
+ sdrawline(0, 0, winx, 0);
+
+ /* top */
+ glColor4ub(255,255,255, 60);
+ sdrawline(0, winy, winx, winy);
+
+ /* left */
+ glColor4ub(255,255,255, 50);
+ sdrawline(0, 0, 0, winy);
+
+ glDisable( GL_BLEND );
+}
+
+void ED_region_pixelspace(const bContext *C, ARegion *ar)
+{
+ int width= ar->winrct.xmax-ar->winrct.xmin+1;
+ int height= ar->winrct.ymax-ar->winrct.ymin+1;
+
+ wmOrtho2(C->window, -0.375, (float)width-0.375, -0.375, (float)height-0.375);
+ wmLoadIdentity(C->window);
+}
+
+void ED_region_do_listen(ARegion *ar, wmNotifier *note)
+{
+
+ /* generic notes first */
+ switch(note->type) {
+ case WM_NOTE_WINDOW_REDRAW:
+ case WM_NOTE_AREA_REDRAW:
+ case WM_NOTE_REGION_REDRAW:
+ case WM_NOTE_GESTURE_REDRAW:
+ case WM_NOTE_SCREEN_CHANGED:
+ ar->do_draw= 1;
+ break;
+ default:
+ if(ar->type->listener)
+ ar->type->listener(ar, note);
+ }
+}
+
+/* only internal decoration, AZone for now */
+void ED_area_do_draw(bContext *C, ScrArea *sa)
+{
+ AZone *az;
+
+ /* hrmf, screenspace for zones */
+ wm_subwindow_set(C->window, C->window->screen->mainwin);
+
+ /* temporary viz for 'action corner' */
+ for(az= sa->actionzones.first; az; az= az->next) {
+
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ glColor4ub(0, 0, 0, 80);
+ if(az->type==AZONE_TRI) sdrawtrifill(az->x1, az->y1, az->x2, az->y2);
+ //if(az->type==AZONE_TRI) sdrawtri(az->x1, az->y1, az->x2, az->y2);
+ glDisable( GL_BLEND );
+ }
+
+}
+
+void ED_region_do_draw(bContext *C, ARegion *ar)
+{
+ ARegionType *at= ar->type;
+
+ wm_subwindow_set(C->window, ar->swinid);
+
+ if(ar->swinid && at->draw) {
+ UI_SetTheme(C->area);
+ at->draw(C, ar);
+ UI_SetTheme(NULL);
+ }
+ else {
+ float fac= 0.1*ar->swinid;
+
+ fac= fac - (int)fac;
+
+ glClearColor(0.5, fac, 1.0f-fac, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* swapbuffers indicator */
+ fac= BLI_frand();
+ glColor3f(fac, fac, fac);
+ glRecti(20, 2, 30, 12);
+ }
+
+ if(C->area)
+ region_draw_emboss(ar);
+
+ /* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */
+ ED_region_pixelspace(C, ar);
+
+ ar->do_draw= 0;
+}
+
+/* *************************************************************** */
+
+/* dir is direction to check, not the splitting edge direction! */
+static int rct_fits(rcti *rect, char dir, int size)
+{
+ if(dir=='h') {
+ return rect->xmax-rect->xmin - size;
+ }
+ else { // 'v'
+ return rect->ymax-rect->ymin - size;
+ }
+}
+
+static void region_rect_recursive(ARegion *ar, rcti *remainder)
+{
+ int prefsizex, prefsizey;
+
+ if(ar==NULL)
+ return;
+
+ /* clear state flags first */
+ ar->flag &= ~RGN_FLAG_TOO_SMALL;
+ if(ar->next==NULL)
+ ar->alignment= RGN_ALIGN_NONE;
+
+ prefsizex= ar->type->minsizex;
+ prefsizey= ar->type->minsizey;
+
+ /* hidden is user flag */
+ if(ar->flag & RGN_FLAG_HIDDEN);
+ /* XXX floating area region, not handled yet here */
+ else if(ar->alignment == RGN_ALIGN_FLOAT);
+ /* remainder is too small for any usage */
+ else if( rct_fits(remainder, 'v', 1)<0 || rct_fits(remainder, 'h', 1) < 0 ) {
+ ar->flag |= RGN_FLAG_TOO_SMALL;
+ }
+ else if(ar->alignment==RGN_ALIGN_NONE) {
+ /* typically last region */
+ ar->winrct= *remainder;
+ BLI_init_rcti(remainder, 0, 0, 0, 0);
+ }
+ else if(ar->alignment==RGN_ALIGN_TOP || ar->alignment==RGN_ALIGN_BOTTOM) {
+
+ if( rct_fits(remainder, 'v', prefsizey) < 0 ) {
+ ar->flag |= RGN_FLAG_TOO_SMALL;
+ }
+ else {
+ int fac= rct_fits(remainder, 'v', prefsizey);
+
+ if(fac < 0 )
+ prefsizey += fac;
+
+ ar->winrct= *remainder;
+
+ if(ar->alignment==RGN_ALIGN_TOP) {
+ ar->winrct.ymin= ar->winrct.ymax - prefsizey + 1;
+ remainder->ymax= ar->winrct.ymin - 1;
+ }
+ else {
+ ar->winrct.ymax= ar->winrct.ymin + prefsizey - 1;
+ remainder->ymin= ar->winrct.ymax + 1;
+ }
+ }
+ }
+ else if(ar->alignment==RGN_ALIGN_LEFT || ar->alignment==RGN_ALIGN_RIGHT) {
+
+ if( rct_fits(remainder, 'h', prefsizex) < 0 ) {
+ ar->flag |= RGN_FLAG_TOO_SMALL;
+ }
+ else {
+ int fac= rct_fits(remainder, 'h', prefsizex);
+
+ if(fac < 0 )
+ prefsizex += fac;
+
+ ar->winrct= *remainder;
+
+ if(ar->alignment==RGN_ALIGN_RIGHT) {
+ ar->winrct.xmin= ar->winrct.xmax - prefsizex + 1;
+ remainder->xmax= ar->winrct.xmin - 1;
+ }
+ else {
+ ar->winrct.xmax= ar->winrct.xmin + prefsizex - 1;
+ remainder->xmin= ar->winrct.xmax + 1;
+ }
+ }
+ }
+ else {
+ /* percentage subdiv*/
+ ar->winrct= *remainder;
+
+ if(ar->alignment==RGN_ALIGN_HSPLIT) {
+ if( rct_fits(remainder, 'h', prefsizex) > 4) {
+ ar->winrct.xmax= (remainder->xmin+remainder->xmax)/2;
+ remainder->xmin= ar->winrct.xmax+1;
+ }
+ else {
+ BLI_init_rcti(remainder, 0, 0, 0, 0);
+ }
+ }
+ else {
+ if( rct_fits(remainder, 'v', prefsizey) > 4) {
+ ar->winrct.ymax= (remainder->ymin+remainder->ymax)/2;
+ remainder->ymin= ar->winrct.ymax+1;
+ }
+ else {
+ BLI_init_rcti(remainder, 0, 0, 0, 0);
+ }
+ }
+ }
+ /* for speedup */
+ ar->winx= ar->winrct.xmax - ar->winrct.xmin + 1;
+ ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1;
+
+ region_rect_recursive(ar->next, remainder);
+}
+
+static void area_calc_totrct(ScrArea *sa, int sizex, int sizey)
+{
+
+ if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1;
+ else sa->totrct.xmin= sa->v1->vec.x;
+ if(sa->v4->vec.x<sizex-1) sa->totrct.xmax= sa->v4->vec.x-1;
+ else sa->totrct.xmax= sa->v4->vec.x;
+
+ if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1;
+ else sa->totrct.ymin= sa->v1->vec.y;
+ if(sa->v2->vec.y<sizey-1) sa->totrct.ymax= sa->v2->vec.y-1;
+ else sa->totrct.ymax= sa->v2->vec.y;
+
+ /* for speedup */
+ sa->winx= sa->totrct.xmax-sa->totrct.xmin+1;
+ sa->winy= sa->totrct.ymax-sa->totrct.ymin+1;
+}
+
+#define AZONESPOT 12
+void area_azone_initialize(ScrArea *sa)
+{
+ AZone *az;
+ if(sa->actionzones.first==NULL) {
+ /* set action zones - should these actually be ARegions? With these we can easier check area hotzones */
+ /* (ton) for time being just area, ARegion split is not foreseen on user level */
+ az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
+ BLI_addtail(&(sa->actionzones), az);
+ az->type= AZONE_TRI;
+ az->pos= AZONE_SW;
+
+ az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
+ BLI_addtail(&(sa->actionzones), az);
+ az->type= AZONE_TRI;
+ az->pos= AZONE_NE;
+ }
+
+ for(az= sa->actionzones.first; az; az= az->next) {
+ if(az->pos==AZONE_SW) {
+ az->x1= sa->v1->vec.x+1;
+ az->y1= sa->v1->vec.y+1;
+ az->x2= sa->v1->vec.x+AZONESPOT;
+ az->y2= sa->v1->vec.y+AZONESPOT;
+ }
+ else if (az->pos==AZONE_NE) {
+ az->x1= sa->v3->vec.x;
+ az->y1= sa->v3->vec.y;
+ az->x2= sa->v3->vec.x-AZONESPOT;
+ az->y2= sa->v3->vec.y-AZONESPOT;
+ }
+ }
+}
+
+/* used for area initialize below */
+static void region_subwindow(wmWindowManager *wm, wmWindow *win, ARegion *ar)
+{
+ if(ar->flag & (RGN_FLAG_HIDDEN|RGN_FLAG_TOO_SMALL)) {
+ if(ar->swinid)
+ wm_subwindow_close(win, ar->swinid);
+ ar->swinid= 0;
+ }
+ else if(ar->swinid==0)
+ ar->swinid= wm_subwindow_open(win, &ar->winrct);
+ else
+ wm_subwindow_position(win, ar->swinid, &ar->winrct);
+}
+
+static void ed_default_handlers(wmWindowManager *wm, ListBase *handlers, int flag)
+{
+ /* note, add-handler checks if it already exists */
+
+ if(flag & ED_KEYMAP_UI) {
+ UI_add_region_handlers(handlers);
+ }
+ if(flag & ED_KEYMAP_VIEW2D) {
+ ListBase *keymap= WM_keymap_listbase(wm, "View2D", 0, 0);
+ WM_event_add_keymap_handler(handlers, keymap);
+ }
+ if(flag & ED_KEYMAP_MARKERS) {
+ ListBase *keymap= WM_keymap_listbase(wm, "Markers", 0, 0);
+ WM_event_add_keymap_handler(handlers, keymap);
+ }
+}
+
+
+/* called in screen_refresh, or screens_init, also area size changes */
+void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
+{
+ ARegion *ar;
+ rcti rect;
+
+ /* set typedefinitions */
+ sa->type= BKE_spacetype_from_id(sa->spacetype);
+
+ if(sa->type==NULL) {
+ sa->butspacetype= sa->spacetype= SPACE_VIEW3D;
+ sa->type= BKE_spacetype_from_id(sa->spacetype);
+ }
+
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ ar->type= ED_regiontype_from_id(sa->type, ar->regiontype);
+
+ /* area sizes */
+ area_calc_totrct(sa, win->sizex, win->sizey);
+
+ /* region rect sizes */
+ rect= sa->totrct;
+ region_rect_recursive(sa->regionbase.first, &rect);
+
+ /* default area handlers */
+ ed_default_handlers(wm, &sa->handlers, sa->type->keymapflag);
+ /* checks spacedata, adds own handlers */
+ if(sa->type->init)
+ sa->type->init(wm, sa);
+
+ /* region windows, default and own handlers */
+ for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ region_subwindow(wm, win, ar);
+
+ /* default region handlers */
+ ed_default_handlers(wm, &ar->handlers, ar->type->keymapflag);
+
+ if(ar->type->init)
+ ar->type->init(wm, ar);
+
+ }
+ area_azone_initialize(sa);
+}
+
+/* externally called for floating regions like menus */
+void ED_region_init(bContext *C, ARegion *ar)
+{
+// ARegionType *at= ar->type;
+
+ /* refresh can be called before window opened */
+ region_subwindow(C->wm, C->window, ar);
+
+}
+
+
+/* sa2 to sa1, we swap spaces for fullscreen to keep all allocated data */
+/* area vertices were set */
+void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
+{
+ Panel *pa1, *pa2, *patab;
+ ARegion *ar;
+
+ sa1->headertype= sa2->headertype;
+ sa1->spacetype= sa2->spacetype;
+
+ if(swap_space) {
+ SWAP(ListBase, sa1->spacedata, sa2->spacedata);
+ /* exception: ensure preview is reset */
+// if(sa1->spacetype==SPACE_VIEW3D)
+// XXX BIF_view3d_previewrender_free(sa1->spacedata.first);
+ }
+ else {
+ BKE_spacedata_freelist(&sa1->spacedata);
+ BKE_spacedata_copylist(&sa1->spacedata, &sa2->spacedata);
+ }
+
+ BLI_freelistN(&sa1->panels);
+ BLI_duplicatelist(&sa1->panels, &sa2->panels);
+
+ /* copy panel pointers */
+ for(pa1= sa1->panels.first; pa1; pa1= pa1->next) {
+
+ patab= sa1->panels.first;
+ pa2= sa2->panels.first;
+ while(patab) {
+ if( pa1->paneltab == pa2) {
+ pa1->paneltab = patab;
+ break;
+ }
+ patab= patab->next;
+ pa2= pa2->next;
+ }
+ }
+
+ /* regions... XXX */
+ BLI_freelistN(&sa1->regionbase);
+
+ for(ar= sa2->regionbase.first; ar; ar= ar->next) {
+ ARegion *newar= BKE_area_region_copy(ar);
+ BLI_addtail(&sa1->regionbase, newar);
+ }
+
+#ifndef DISABLE_PYTHON
+ /* scripts */
+ BPY_free_scriptlink(&sa1->scriptlink);
+ sa1->scriptlink= sa2->scriptlink;
+ BPY_copy_scriptlink(&sa1->scriptlink); /* copies internal pointers */
+#endif
+}
+
+/* *********** Space switching code, local now *********** */
+/* XXX make operator for this */
+
+static void newspace(bContext *C, ScrArea *sa, int type)
+{
+ if(sa->spacetype != type) {
+ SpaceType *st;
+ SpaceLink *slold;
+ SpaceLink *sl;
+
+ ED_area_exit(C, sa);
+
+ st= BKE_spacetype_from_id(type);
+ slold= sa->spacedata.first;
+
+ sa->spacetype= type;
+ sa->butspacetype= type;
+
+ /* check previously stored space */
+ for (sl= sa->spacedata.first; sl; sl= sl->next)
+ if(sl->spacetype==type)
+ break;
+
+ /* old spacedata... happened during work on 2.50, remove */
+ if(sl && sl->regionbase.first==NULL) {
+ st->free(sl);
+ MEM_freeN(sl);
+ sl= NULL;
+ }
+
+ if (sl) {
+
+ /* swap regions */
+ slold->regionbase= sa->regionbase;
+ sa->regionbase= sl->regionbase;
+ sl->regionbase.first= sl->regionbase.last= NULL;
+
+ /* put in front of list */
+ BLI_remlink(&sa->spacedata, sl);
+ BLI_addhead(&sa->spacedata, sl);
+ }
+ else {
+ /* new space */
+ if(st) {
+ sl= st->new();
+ BLI_addhead(&sa->spacedata, sl);
+
+ /* swap regions */
+ slold->regionbase= sa->regionbase;
+ sa->regionbase= sl->regionbase;
+ sl->regionbase.first= sl->regionbase.last= NULL;
+ }
+ }
+
+ }
+}
+
+static char *windowtype_pup(void)
+{
+ return(
+ "Window type:%t" //14
+ "|3D View %x1" //30
+
+ "|%l" // 33
+
+ "|Ipo Curve Editor %x2" //54
+ "|Action Editor %x12" //73
+ "|NLA Editor %x13" //94
+
+ "|%l" //97
+
+ "|UV/Image Editor %x6" //117
+
+ "|Video Sequence Editor %x8" //143
+ "|Timeline %x15" //163
+ "|Audio Window %x11" //163
+ "|Text Editor %x9" //179
+
+ "|%l" //192
+
+
+ "|User Preferences %x7" //213
+ "|Outliner %x3" //232
+ "|Buttons Window %x4" //251
+ "|Node Editor %x16"
+ "|%l" //254
+
+ "|Image Browser %x10" //273
+ "|File Browser %x5" //290
+
+ "|%l" //293
+
+ "|Scripts Window %x14"//313
+ );
+}
+
+static void spacefunc(struct bContext *C, void *arg1, void *arg2)
+{
+ newspace(C, C->area, C->area->butspacetype);
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+}
+
+/* returns offset for next button in header */
+int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
+{
+ uiBut *but;
+ int xco= 8;
+
+ if(ED_screen_area_active(C)) uiBlockSetCol(block, TH_HEADER);
+ else uiBlockSetCol(block, TH_HEADERDESEL);
+
+ but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
+ windowtype_pup(), xco, yco, XIC+10, YIC,
+ &(C->area->butspacetype), 1.0, SPACEICONMAX, 0, 0,
+ "Displays Current Window Type. "
+ "Click for menu of available types.");
+ uiButSetFunc(but, spacefunc, NULL, NULL);
+
+ xco += XIC + 14;
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ if (C->area->flag & HEADER_NO_PULLDOWN) {
+ uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
+ ICON_DISCLOSURE_TRI_RIGHT,
+ xco,yco,XIC,YIC-2,
+ &(C->area->flag), 0, 0, 0, 0,
+ "Show pulldown menus");
+ }
+ else {
+ uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
+ ICON_DISCLOSURE_TRI_DOWN,
+ xco,yco,XIC,YIC-2,
+ &(C->area->flag), 0, 0, 0, 0,
+ "Hide pulldown menus");
+ }
+ xco+=XIC;
+
+ return xco;
+}
+
diff --git a/source/blender/src/glutil.c b/source/blender/editors/screen/glutil.c
index 69a44aff1e4..0be29fc53c0 100644
--- a/source/blender/src/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -1,14 +1,12 @@
-
-
/**
- * $Id$
+ * $Id: glutil.c 11920 2007-09-02 17:25:03Z elubie $
*
* ***** 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
@@ -22,9 +20,7 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -45,49 +41,126 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
#ifndef GL_CLAMP_TO_EDGE
#define GL_CLAMP_TO_EDGE 0x812F
#endif
-/* defined in BIF_gl.h */
-GLubyte stipple_halftone[128] = {
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
- 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
-
-
-/* repeate this pattern
- X000X000
- 00000000
- 00X000X0
- 00000000 */
-
-
-GLubyte stipple_quarttone[128] = {
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0,
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0};
+/* ******************************************** */
+
+void fdrawline(float x1, float y1, float x2, float y2)
+{
+ float v[2];
+
+ glBegin(GL_LINE_STRIP);
+ v[0] = x1; v[1] = y1;
+ glVertex2fv(v);
+ v[0] = x2; v[1] = y2;
+ glVertex2fv(v);
+ glEnd();
+}
+
+void fdrawbox(float x1, float y1, float x2, float y2)
+{
+ float v[2];
+
+ glBegin(GL_LINE_STRIP);
+
+ v[0] = x1; v[1] = y1;
+ glVertex2fv(v);
+ v[0] = x1; v[1] = y2;
+ glVertex2fv(v);
+ v[0] = x2; v[1] = y2;
+ glVertex2fv(v);
+ v[0] = x2; v[1] = y1;
+ glVertex2fv(v);
+ v[0] = x1; v[1] = y1;
+ glVertex2fv(v);
+
+ glEnd();
+}
+
+void sdrawline(short x1, short y1, short x2, short y2)
+{
+ short v[2];
+
+ glBegin(GL_LINE_STRIP);
+ v[0] = x1; v[1] = y1;
+ glVertex2sv(v);
+ v[0] = x2; v[1] = y2;
+ glVertex2sv(v);
+ glEnd();
+}
+
+/*
+
+ x1,y2
+ | \
+ | \
+ | \
+ x1,y1-- x2,y1
+
+*/
+
+static void sdrawtripoints(short x1, short y1, short x2, short y2){
+ short v[2];
+ v[0]= x1; v[1]= y1;
+ glVertex2sv(v);
+ v[0]= x1; v[1]= y2;
+ glVertex2sv(v);
+ v[0]= x2; v[1]= y1;
+ glVertex2sv(v);
+}
+
+void sdrawtri(short x1, short y1, short x2, short y2)
+{
+ glBegin(GL_LINE_STRIP);
+ sdrawtripoints(x1, y1, x2, y2);
+ glEnd();
+}
+
+void sdrawtrifill(short x1, short y1, short x2, short y2)
+{
+ glBegin(GL_TRIANGLES);
+ sdrawtripoints(x1, y1, x2, y2);
+ glEnd();
+}
+
+void sdrawbox(short x1, short y1, short x2, short y2)
+{
+ short v[2];
+
+ glBegin(GL_LINE_STRIP);
+
+ v[0] = x1; v[1] = y1;
+ glVertex2sv(v);
+ v[0] = x1; v[1] = y2;
+ glVertex2sv(v);
+ v[0] = x2; v[1] = y2;
+ glVertex2sv(v);
+ v[0] = x2; v[1] = y1;
+ glVertex2sv(v);
+ v[0] = x1; v[1] = y1;
+ glVertex2sv(v);
+
+ glEnd();
+}
+
+
+/* ******************************************** */
+
+void setlinestyle(int nr)
+{
+ if(nr==0) {
+ glDisable(GL_LINE_STIPPLE);
+ }
+ else {
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(nr, 0xAAAA);
+ }
+}
/* Invert line handling */
@@ -292,63 +365,15 @@ static int get_cached_work_texture(int *w_r, int *h_r)
void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *rect)
{
- float *f_rect;
- float xzoom, yzoom;
- unsigned char *uc_rect;
- int ltexid, lrowlength, texid, tex_w, tex_h;
- int subpart_x, subpart_y, nsubparts_x, nsubparts_y;
-
- uc_rect= (unsigned char*) rect;
- f_rect= (float *)rect;
-
-#ifdef __APPLE__
- /* On Nvidia, Mac OS X 10.5 this function doesn't work correct and
- * can crash even, use glDrawPixels instead of textures then */
- if(is_a_really_crappy_nvidia_card()) {
- float col[4], modcol[4];
- unsigned char *srect = rect;
- int a;
-
- /* modulate with current color */
- glGetFloatv(GL_CURRENT_COLOR, col);
- if(col[0]!=1.0f || col[1]!=1.0f ||col[2]!=1.0f ||col[3]!=1.0f) {
- srect = MEM_callocN(4*img_w*img_h, "glDrawPixelsTexSafe");
- for(a=0; a<img_w*img_h*4; a+=4) {
- if(format == GL_FLOAT) {
- modcol[0]= col[0]*f_rect[a];
- modcol[1]= col[1]*f_rect[a+1];
- modcol[2]= col[2]*f_rect[a+2];
- modcol[3]= col[3]*f_rect[a+3];
- }
- else {
- modcol[0]= col[0]*uc_rect[a]*(1.0f/255.0f);
- modcol[1]= col[1]*uc_rect[a+1]*(1.0f/255.0f);
- modcol[2]= col[2]*uc_rect[a+2]*(1.0f/255.0f);
- modcol[3]= col[3]*uc_rect[a+3]*(1.0f/255.0f);
- }
-
- srect[a]= FTOCHAR(modcol[0]);
- srect[a+1]= FTOCHAR(modcol[1]);
- srect[a+2]= FTOCHAR(modcol[2]);
- srect[a+3]= FTOCHAR(modcol[3]);
- }
- }
-
- glaDrawPixelsSafe(x, y, img_w, img_h, img_w, GL_RGBA, format, srect);
-
- if(srect != rect)
- MEM_freeN(srect);
-
- return;
- }
-#endif
-
- xzoom= glaGetOneFloat(GL_ZOOM_X), yzoom= glaGetOneFloat(GL_ZOOM_Y);
- ltexid= glaGetOneInteger(GL_TEXTURE_2D);
- lrowlength= glaGetOneInteger(GL_UNPACK_ROW_LENGTH);
- texid= get_cached_work_texture(&tex_w, &tex_h);
- nsubparts_x= (img_w+(tex_w-1))/tex_w;
- nsubparts_y= (img_h+(tex_h-1))/tex_h;
+ unsigned char *uc_rect= (unsigned char*) rect;
+ float *f_rect= (float *)rect;
+ float xzoom= glaGetOneFloat(GL_ZOOM_X), yzoom= glaGetOneFloat(GL_ZOOM_Y);
+ int ltexid= glaGetOneInteger(GL_TEXTURE_2D);
+ int lrowlength= glaGetOneInteger(GL_UNPACK_ROW_LENGTH);
+ int subpart_x, subpart_y, tex_w, tex_h;
+ int texid= get_cached_work_texture(&tex_w, &tex_h);
+ int nsubparts_x= (img_w+(tex_w-1))/tex_w;
+ int nsubparts_y= (img_h+(tex_h-1))/tex_h;
/* Specify the color outside this function, and tex will modulate it.
* This is useful for changing alpha without using glPixelTransferf()
@@ -764,23 +789,12 @@ int is_a_really_crappy_intel_card(void)
return well_is_it;
}
-int is_a_really_crappy_nvidia_card(void)
-{
- static int well_is_it= -1;
-
- /* Do you understand the implication? Do you? */
- if (well_is_it==-1)
- well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0);
-
- return well_is_it;
-}
-
void bglFlush(void)
{
glFlush();
#ifdef __APPLE__
- if(is_a_really_crappy_intel_card())
- myswapbuffers(); //hack to get mac intel graphics to show frontbuffer
+// if(is_a_really_crappy_intel_card())
+// XXX myswapbuffers(); //hack to get mac intel graphics to show frontbuffer
#endif
}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
new file mode 100644
index 00000000000..3af5ac2652c
--- /dev/null
+++ b/source/blender/editors/screen/screen_edit.c
@@ -0,0 +1,1080 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_vec_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_screen.h"
+#include "ED_screen_types.h"
+
+#include "wm_subwindow.h"
+
+#include "screen_intern.h" /* own module include */
+
+
+/* ******************* screen vert, edge, area managing *********************** */
+
+static ScrVert *screen_addvert(bScreen *sc, short x, short y)
+{
+ ScrVert *sv= MEM_callocN(sizeof(ScrVert), "addscrvert");
+ sv->vec.x= x;
+ sv->vec.y= y;
+
+ BLI_addtail(&sc->vertbase, sv);
+ return sv;
+}
+
+static void sortscrvert(ScrVert **v1, ScrVert **v2)
+{
+ ScrVert *tmp;
+
+ if (*v1 > *v2) {
+ tmp= *v1;
+ *v1= *v2;
+ *v2= tmp;
+ }
+}
+
+static ScrEdge *screen_addedge(bScreen *sc, ScrVert *v1, ScrVert *v2)
+{
+ ScrEdge *se= MEM_callocN(sizeof(ScrEdge), "addscredge");
+
+ sortscrvert(&v1, &v2);
+ se->v1= v1;
+ se->v2= v2;
+
+ BLI_addtail(&sc->edgebase, se);
+ return se;
+}
+
+
+ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2)
+{
+ ScrEdge *se;
+
+ sortscrvert(&v1, &v2);
+ for (se= sc->edgebase.first; se; se= se->next)
+ if(se->v1==v1 && se->v2==v2)
+ return se;
+
+ return NULL;
+}
+
+void removedouble_scrverts(bScreen *sc)
+{
+ ScrVert *v1, *verg;
+ ScrEdge *se;
+ ScrArea *sa;
+
+ verg= sc->vertbase.first;
+ while(verg) {
+ if(verg->newv==NULL) { /* !!! */
+ v1= verg->next;
+ while(v1) {
+ if(v1->newv==NULL) { /* !?! */
+ if(v1->vec.x==verg->vec.x && v1->vec.y==verg->vec.y) {
+ /* printf("doublevert\n"); */
+ v1->newv= verg;
+ }
+ }
+ v1= v1->next;
+ }
+ }
+ verg= verg->next;
+ }
+
+ /* replace pointers in edges and faces */
+ se= sc->edgebase.first;
+ while(se) {
+ if(se->v1->newv) se->v1= se->v1->newv;
+ if(se->v2->newv) se->v2= se->v2->newv;
+ /* edges changed: so.... */
+ sortscrvert(&(se->v1), &(se->v2));
+ se= se->next;
+ }
+ sa= sc->areabase.first;
+ while(sa) {
+ if(sa->v1->newv) sa->v1= sa->v1->newv;
+ if(sa->v2->newv) sa->v2= sa->v2->newv;
+ if(sa->v3->newv) sa->v3= sa->v3->newv;
+ if(sa->v4->newv) sa->v4= sa->v4->newv;
+ sa= sa->next;
+ }
+
+ /* remove */
+ verg= sc->vertbase.first;
+ while(verg) {
+ v1= verg->next;
+ if(verg->newv) {
+ BLI_remlink(&sc->vertbase, verg);
+ MEM_freeN(verg);
+ }
+ verg= v1;
+ }
+
+}
+
+void removenotused_scrverts(bScreen *sc)
+{
+ ScrVert *sv, *svn;
+ ScrEdge *se;
+
+ /* we assume edges are ok */
+
+ se= sc->edgebase.first;
+ while(se) {
+ se->v1->flag= 1;
+ se->v2->flag= 1;
+ se= se->next;
+ }
+
+ sv= sc->vertbase.first;
+ while(sv) {
+ svn= sv->next;
+ if(sv->flag==0) {
+ BLI_remlink(&sc->vertbase, sv);
+ MEM_freeN(sv);
+ }
+ else sv->flag= 0;
+ sv= svn;
+ }
+}
+
+void removedouble_scredges(bScreen *sc)
+{
+ ScrEdge *verg, *se, *sn;
+
+ /* compare */
+ verg= sc->edgebase.first;
+ while(verg) {
+ se= verg->next;
+ while(se) {
+ sn= se->next;
+ if(verg->v1==se->v1 && verg->v2==se->v2) {
+ BLI_remlink(&sc->edgebase, se);
+ MEM_freeN(se);
+ }
+ se= sn;
+ }
+ verg= verg->next;
+ }
+}
+
+void removenotused_scredges(bScreen *sc)
+{
+ ScrEdge *se, *sen;
+ ScrArea *sa;
+ int a=0;
+
+ /* sets flags when edge is used in area */
+ sa= sc->areabase.first;
+ while(sa) {
+ se= screen_findedge(sc, sa->v1, sa->v2);
+ if(se==0) printf("error: area %d edge 1 doesn't exist\n", a);
+ else se->flag= 1;
+ se= screen_findedge(sc, sa->v2, sa->v3);
+ if(se==0) printf("error: area %d edge 2 doesn't exist\n", a);
+ else se->flag= 1;
+ se= screen_findedge(sc, sa->v3, sa->v4);
+ if(se==0) printf("error: area %d edge 3 doesn't exist\n", a);
+ else se->flag= 1;
+ se= screen_findedge(sc, sa->v4, sa->v1);
+ if(se==0) printf("error: area %d edge 4 doesn't exist\n", a);
+ else se->flag= 1;
+ sa= sa->next;
+ a++;
+ }
+ se= sc->edgebase.first;
+ while(se) {
+ sen= se->next;
+ if(se->flag==0) {
+ BLI_remlink(&sc->edgebase, se);
+ MEM_freeN(se);
+ }
+ else se->flag= 0;
+ se= sen;
+ }
+}
+
+/* adds no space data */
+static ScrArea *screen_addarea(bScreen *sc, ScrVert *v1, ScrVert *v2, ScrVert *v3, ScrVert *v4, short headertype, short spacetype)
+{
+ ScrArea *sa= MEM_callocN(sizeof(ScrArea), "addscrarea");
+ sa->v1= v1;
+ sa->v2= v2;
+ sa->v3= v3;
+ sa->v4= v4;
+ sa->headertype= headertype;
+ sa->spacetype= sa->butspacetype= spacetype;
+
+ BLI_addtail(&sc->areabase, sa);
+
+ return sa;
+}
+
+static void screen_delarea(bScreen *sc, ScrArea *sa)
+{
+ /* XXX need context to cancel operators ED_area_exit(C, sa); */
+ BKE_screen_area_free(sa);
+ BLI_remlink(&sc->areabase, sa);
+ MEM_freeN(sa);
+}
+
+/* return 0: no split possible */
+/* else return (integer) screencoordinate split point */
+static short testsplitpoint(wmWindow *win, ScrArea *sa, char dir, float fac)
+{
+ short x, y;
+
+ // area big enough?
+ if(dir=='v' && (sa->v4->vec.x- sa->v1->vec.x <= 2*AREAMINX)) return 0;
+ if(dir=='h' && (sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY)) return 0;
+
+ // to be sure
+ if(fac<0.0) fac= 0.0;
+ if(fac>1.0) fac= 1.0;
+
+ if(dir=='h') {
+ y= sa->v1->vec.y+ fac*(sa->v2->vec.y- sa->v1->vec.y);
+
+ if(y- sa->v1->vec.y < AREAMINY)
+ y= sa->v1->vec.y+ AREAMINY;
+ else if(sa->v2->vec.y- y < AREAMINY)
+ y= sa->v2->vec.y- AREAMINY;
+ else y-= (y % AREAGRID);
+
+ return y;
+ }
+ else {
+ x= sa->v1->vec.x+ fac*(sa->v4->vec.x- sa->v1->vec.x);
+
+ if(x- sa->v1->vec.x < AREAMINX)
+ x= sa->v1->vec.x+ AREAMINX;
+ else if(sa->v4->vec.x- x < AREAMINX)
+ x= sa->v4->vec.x- AREAMINX;
+ else x-= (x % AREAGRID);
+
+ return x;
+ }
+}
+
+ScrArea *area_split(wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac)
+{
+ ScrArea *newa=NULL;
+ ScrVert *sv1, *sv2;
+ short split;
+
+ if(sa==NULL) return NULL;
+
+ split= testsplitpoint(win, sa, dir, fac);
+ if(split==0) return NULL;
+
+ if(dir=='h') {
+ /* new vertices */
+ sv1= screen_addvert(sc, sa->v1->vec.x, split);
+ sv2= screen_addvert(sc, sa->v4->vec.x, split);
+
+ /* new edges */
+ screen_addedge(sc, sa->v1, sv1);
+ screen_addedge(sc, sv1, sa->v2);
+ screen_addedge(sc, sa->v3, sv2);
+ screen_addedge(sc, sv2, sa->v4);
+ screen_addedge(sc, sv1, sv2);
+
+ /* new areas: top */
+ newa= screen_addarea(sc, sv1, sa->v2, sa->v3, sv2, sa->headertype, sa->spacetype);
+ area_copy_data(newa, sa, 0);
+
+ /* area below */
+ sa->v2= sv1;
+ sa->v3= sv2;
+
+ }
+ else {
+ /* new vertices */
+ sv1= screen_addvert(sc, split, sa->v1->vec.y);
+ sv2= screen_addvert(sc, split, sa->v2->vec.y);
+
+ /* new edges */
+ screen_addedge(sc, sa->v1, sv1);
+ screen_addedge(sc, sv1, sa->v4);
+ screen_addedge(sc, sa->v2, sv2);
+ screen_addedge(sc, sv2, sa->v3);
+ screen_addedge(sc, sv1, sv2);
+
+ /* new areas: left */
+ newa= screen_addarea(sc, sa->v1, sa->v2, sv2, sv1, sa->headertype, sa->spacetype);
+ area_copy_data(newa, sa, 0);
+
+ /* area right */
+ sa->v1= sv1;
+ sa->v2= sv2;
+ }
+
+ /* remove double vertices en edges */
+ removedouble_scrverts(sc);
+ removedouble_scredges(sc);
+ removenotused_scredges(sc);
+
+ return newa;
+}
+
+/* empty screen, with 1 dummy area without spacedata */
+/* uses window size */
+bScreen *screen_add(wmWindow *win, char *name)
+{
+ bScreen *sc;
+ ScrVert *sv1, *sv2, *sv3, *sv4;
+
+ sc= alloc_libblock(&G.main->screen, ID_SCR, name);
+ sc->scene= G.scene;
+ sc->do_refresh= 1;
+
+ win->screen= sc;
+
+ sv1= screen_addvert(sc, 0, 0);
+ sv2= screen_addvert(sc, 0, win->sizey-1);
+ sv3= screen_addvert(sc, win->sizex-1, win->sizey-1);
+ sv4= screen_addvert(sc, win->sizex-1, 0);
+
+ screen_addedge(sc, sv1, sv2);
+ screen_addedge(sc, sv2, sv3);
+ screen_addedge(sc, sv3, sv4);
+ screen_addedge(sc, sv4, sv1);
+
+ /* dummy type, no spacedata */
+ screen_addarea(sc, sv1, sv2, sv3, sv4, HEADERDOWN, SPACE_INFO);
+
+ return sc;
+}
+
+static void screen_copy(bScreen *to, bScreen *from)
+{
+ ScrVert *s1, *s2;
+ ScrEdge *se;
+ ScrArea *sa, *saf;
+
+ /* free contents of 'to', is from blenkernel screen.c */
+ free_screen(to);
+
+ BLI_duplicatelist(&to->vertbase, &from->vertbase);
+ BLI_duplicatelist(&to->edgebase, &from->edgebase);
+ BLI_duplicatelist(&to->areabase, &from->areabase);
+ to->regionbase.first= to->regionbase.last= NULL;
+
+ s2= to->vertbase.first;
+ for(s1= from->vertbase.first; s1; s1= s1->next, s2= s2->next) {
+ s1->newv= s2;
+ }
+
+ for(se= to->edgebase.first; se; se= se->next) {
+ se->v1= se->v1->newv;
+ se->v2= se->v2->newv;
+ sortscrvert(&(se->v1), &(se->v2));
+ }
+
+ saf= from->areabase.first;
+ for(sa= to->areabase.first; sa; sa= sa->next, saf= saf->next) {
+ sa->v1= sa->v1->newv;
+ sa->v2= sa->v2->newv;
+ sa->v3= sa->v3->newv;
+ sa->v4= sa->v4->newv;
+
+ sa->spacedata.first= sa->spacedata.last= NULL;
+ sa->uiblocks.first= sa->uiblocks.last= NULL;
+ sa->panels.first= sa->panels.last= NULL;
+ sa->regionbase.first= sa->regionbase.last= NULL;
+ sa->actionzones.first= sa->actionzones.last= NULL;
+ sa->scriptlink.totscript= 0;
+
+ area_copy_data(sa, saf, 0);
+ }
+
+ /* put at zero (needed?) */
+ for(s1= from->vertbase.first; s1; s1= s1->next)
+ s1->newv= NULL;
+
+}
+
+
+/* with sa as center, sb is located at: 0=W, 1=N, 2=E, 3=S */
+/* -1 = not valid check */
+/* used with join operator */
+int area_getorientation(bScreen *screen, ScrArea *sa, ScrArea *sb)
+{
+ ScrVert *sav1, *sav2, *sav3, *sav4;
+ ScrVert *sbv1, *sbv2, *sbv3, *sbv4;
+
+ if(sa==NULL || sb==NULL) return -1;
+
+ sav1= sa->v1;
+ sav2= sa->v2;
+ sav3= sa->v3;
+ sav4= sa->v4;
+ sbv1= sb->v1;
+ sbv2= sb->v2;
+ sbv3= sb->v3;
+ sbv4= sb->v4;
+
+ if(sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
+ return 0;
+ }
+ else if(sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
+ return 1;
+ }
+ else if(sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
+ return 2;
+ }
+ else if(sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
+ return 3;
+ }
+
+ return -1;
+}
+
+/* Helper function to join 2 areas, it has a return value, 0=failed 1=success
+* used by the split, join operators
+*/
+int screen_area_join(bScreen* scr, ScrArea *sa1, ScrArea *sa2)
+{
+ int dir;
+
+ dir = area_getorientation(scr, sa1, sa2);
+ /*printf("dir is : %i \n", dir);*/
+
+ if (dir < 0)
+ {
+ if (sa1 ) sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
+ if (sa2 ) sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ return 0;
+ }
+
+ if(dir == 0) {
+ sa1->v1= sa2->v1;
+ sa1->v2= sa2->v2;
+ screen_addedge(scr, sa1->v2, sa1->v3);
+ screen_addedge(scr, sa1->v1, sa1->v4);
+ }
+ else if(dir == 1) {
+ sa1->v2= sa2->v2;
+ sa1->v3= sa2->v3;
+ screen_addedge(scr, sa1->v1, sa1->v2);
+ screen_addedge(scr, sa1->v3, sa1->v4);
+ }
+ else if(dir == 2) {
+ sa1->v3= sa2->v3;
+ sa1->v4= sa2->v4;
+ screen_addedge(scr, sa1->v2, sa1->v3);
+ screen_addedge(scr, sa1->v1, sa1->v4);
+ }
+ else if(dir == 3) {
+ sa1->v1= sa2->v1;
+ sa1->v4= sa2->v4;
+ screen_addedge(scr, sa1->v1, sa1->v2);
+ screen_addedge(scr, sa1->v3, sa1->v4);
+ }
+
+ screen_delarea(scr, sa2);
+ removedouble_scrverts(scr);
+ sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
+
+ return 1;
+}
+
+void select_connected_scredge(bScreen *sc, ScrEdge *edge)
+{
+ ScrEdge *se;
+ ScrVert *sv;
+ int oneselected;
+ char dir;
+
+ /* select connected, only in the right direction */
+ /* 'dir' is the direction of EDGE */
+
+ if(edge->v1->vec.x==edge->v2->vec.x) dir= 'v';
+ else dir= 'h';
+
+ sv= sc->vertbase.first;
+ while(sv) {
+ sv->flag = 0;
+ sv= sv->next;
+ }
+
+ edge->v1->flag= 1;
+ edge->v2->flag= 1;
+
+ oneselected= 1;
+ while(oneselected) {
+ se= sc->edgebase.first;
+ oneselected= 0;
+ while(se) {
+ if(se->v1->flag + se->v2->flag==1) {
+ if(dir=='h') if(se->v1->vec.y==se->v2->vec.y) {
+ se->v1->flag= se->v2->flag= 1;
+ oneselected= 1;
+ }
+ if(dir=='v') if(se->v1->vec.x==se->v2->vec.x) {
+ se->v1->flag= se->v2->flag= 1;
+ oneselected= 1;
+ }
+ }
+ se= se->next;
+ }
+ }
+}
+
+/* test if screen vertices should be scaled */
+static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
+{
+ ScrVert *sv=NULL;
+ ScrArea *sa, *san;
+ int sizex, sizey;
+ float facx, facy, tempf, min[2], max[2];
+
+ /* calculate size */
+ min[0]= min[1]= 10000.0f;
+ max[0]= max[1]= 0.0f;
+
+ for(sv= sc->vertbase.first; sv; sv= sv->next) {
+ min[0]= MIN2(min[0], sv->vec.x);
+ min[1]= MIN2(min[1], sv->vec.y);
+ max[0]= MAX2(max[0], sv->vec.x);
+ max[1]= MAX2(max[1], sv->vec.y);
+ }
+
+ /* always make 0.0 left under */
+ for(sv= sc->vertbase.first; sv; sv= sv->next) {
+ sv->vec.x -= min[0];
+ sv->vec.y -= min[1];
+ }
+
+ sizex= max[0]-min[0];
+ sizey= max[1]-min[1];
+
+ if(sizex!= winsizex || sizey!= winsizey) {
+ facx= winsizex;
+ facx/= (float)sizex;
+ facy= winsizey;
+ facy/= (float)sizey;
+
+ /* make sure it fits! */
+ for(sv= sc->vertbase.first; sv; sv= sv->next) {
+ tempf= ((float)sv->vec.x)*facx;
+ sv->vec.x= (short)(tempf+0.5);
+ sv->vec.x+= AREAGRID-1;
+ sv->vec.x-= (sv->vec.x % AREAGRID);
+
+ CLAMP(sv->vec.x, 0, winsizex);
+
+ tempf= ((float)sv->vec.y )*facy;
+ sv->vec.y= (short)(tempf+0.5);
+ sv->vec.y+= AREAGRID-1;
+ sv->vec.y-= (sv->vec.y % AREAGRID);
+
+ CLAMP(sv->vec.y, 0, winsizey);
+ }
+ }
+
+ /* test for collapsed areas. This could happen in some blender version... */
+ for(sa= sc->areabase.first; sa; sa= san) {
+ san= sa->next;
+ if(sa->v1==sa->v2 || sa->v3==sa->v4 || sa->v2==sa->v3)
+ screen_delarea(sc, sa);
+ }
+
+ /* make each window at least HEADERY high */
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
+ int headery= HEADERY+1;
+
+ if(sa->v1->vec.y+headery > sa->v2->vec.y) {
+ /* lower edge */
+ ScrEdge *se= screen_findedge(sc, sa->v4, sa->v1);
+ if(se && sa->v1!=sa->v2 ) {
+ int yval;
+
+ select_connected_scredge(sc, se);
+
+ /* all selected vertices get the right offset */
+ yval= sa->v2->vec.y-headery;
+ sv= sc->vertbase.first;
+ while(sv) {
+ /* if is a collapsed area */
+ if(sv!=sa->v2 && sv!=sa->v3) {
+ if(sv->flag) sv->vec.y= yval;
+ }
+ sv= sv->next;
+ }
+ }
+ }
+ }
+
+}
+
+/* *********************** DRAWING **************************************** */
+
+
+#define SCR_BACK 0.55
+#define SCR_ROUND 12
+
+/* draw vertical shape visualising future joining (left as well
+ * right direction of future joining) */
+static void draw_horizontal_join_shape(ScrArea *sa, char dir)
+{
+ vec2f points[10];
+ short i;
+ float w, h;
+ float width = sa->v3->vec.x - sa->v1->vec.x;
+ float height = sa->v3->vec.y - sa->v1->vec.y;
+
+ if(height<width) {
+ h = height/8;
+ w = height/4;
+ }
+ else {
+ h = width/8;
+ w = width/4;
+ }
+
+ points[0].x = sa->v1->vec.x;
+ points[0].y = sa->v1->vec.y + height/2;
+
+ points[1].x = sa->v1->vec.x;
+ points[1].y = sa->v1->vec.y;
+
+ points[2].x = sa->v4->vec.x - w;
+ points[2].y = sa->v4->vec.y;
+
+ points[3].x = sa->v4->vec.x - w;
+ points[3].y = sa->v4->vec.y + height/2 - 2*h;
+
+ points[4].x = sa->v4->vec.x - 2*w;
+ points[4].y = sa->v4->vec.y + height/2;
+
+ points[5].x = sa->v4->vec.x - w;
+ points[5].y = sa->v4->vec.y + height/2 + 2*h;
+
+ points[6].x = sa->v3->vec.x - w;
+ points[6].y = sa->v3->vec.y;
+
+ points[7].x = sa->v2->vec.x;
+ points[7].y = sa->v2->vec.y;
+
+ points[8].x = sa->v4->vec.x;
+ points[8].y = sa->v4->vec.y + height/2 - h;
+
+ points[9].x = sa->v4->vec.x;
+ points[9].y = sa->v4->vec.y + height/2 + h;
+
+ if(dir=='l') {
+ /* when direction is left, then we flip direction of arrow */
+ float cx = sa->v1->vec.x + width;
+ for(i=0;i<10;i++) {
+ points[i].x -= cx;
+ points[i].x = -points[i].x;
+ points[i].x += sa->v1->vec.x;
+ }
+ }
+
+ glBegin(GL_POLYGON);
+ for(i=0;i<5;i++)
+ glVertex2f(points[i].x, points[i].y);
+ glEnd();
+ glBegin(GL_POLYGON);
+ for(i=4;i<8;i++)
+ glVertex2f(points[i].x, points[i].y);
+ glVertex2f(points[0].x, points[0].y);
+ glEnd();
+
+ glRectf(points[2].x, points[2].y, points[8].x, points[8].y);
+ glRectf(points[6].x, points[6].y, points[9].x, points[9].y);
+}
+
+/* draw vertical shape visualising future joining (up/down direction) */
+static void draw_vertical_join_shape(ScrArea *sa, char dir)
+{
+ vec2f points[10];
+ short i;
+ float w, h;
+ float width = sa->v3->vec.x - sa->v1->vec.x;
+ float height = sa->v3->vec.y - sa->v1->vec.y;
+
+ if(height<width) {
+ h = height/4;
+ w = height/8;
+ }
+ else {
+ h = width/4;
+ w = width/8;
+ }
+
+ points[0].x = sa->v1->vec.x + width/2;
+ points[0].y = sa->v3->vec.y;
+
+ points[1].x = sa->v2->vec.x;
+ points[1].y = sa->v2->vec.y;
+
+ points[2].x = sa->v1->vec.x;
+ points[2].y = sa->v1->vec.y + h;
+
+ points[3].x = sa->v1->vec.x + width/2 - 2*w;
+ points[3].y = sa->v1->vec.y + h;
+
+ points[4].x = sa->v1->vec.x + width/2;
+ points[4].y = sa->v1->vec.y + 2*h;
+
+ points[5].x = sa->v1->vec.x + width/2 + 2*w;
+ points[5].y = sa->v1->vec.y + h;
+
+ points[6].x = sa->v4->vec.x;
+ points[6].y = sa->v4->vec.y + h;
+
+ points[7].x = sa->v3->vec.x;
+ points[7].y = sa->v3->vec.y;
+
+ points[8].x = sa->v1->vec.x + width/2 - w;
+ points[8].y = sa->v1->vec.y;
+
+ points[9].x = sa->v1->vec.x + width/2 + w;
+ points[9].y = sa->v1->vec.y;
+
+ if(dir=='u') {
+ /* when direction is up, then we flip direction of arrow */
+ float cy = sa->v1->vec.y + height;
+ for(i=0;i<10;i++) {
+ points[i].y -= cy;
+ points[i].y = -points[i].y;
+ points[i].y += sa->v1->vec.y;
+ }
+ }
+
+ glBegin(GL_POLYGON);
+ for(i=0;i<5;i++)
+ glVertex2f(points[i].x, points[i].y);
+ glEnd();
+ glBegin(GL_POLYGON);
+ for(i=4;i<8;i++)
+ glVertex2f(points[i].x, points[i].y);
+ glVertex2f(points[0].x, points[0].y);
+ glEnd();
+
+ glRectf(points[2].x, points[2].y, points[8].x, points[8].y);
+ glRectf(points[6].x, points[6].y, points[9].x, points[9].y);
+}
+
+/* draw join shape due to direction of joining */
+static void draw_join_shape(ScrArea *sa, char dir)
+{
+ if(dir=='u' || dir=='d')
+ draw_vertical_join_shape(sa, dir);
+ else
+ draw_horizontal_join_shape(sa, dir);
+}
+
+/* draw screen area darker with arrow (visualisation of future joining) */
+static void scrarea_draw_shape_dark(ScrArea *sa, char dir)
+{
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ glColor4ub(0, 0, 0, 50);
+ draw_join_shape(sa, dir);
+ glDisable(GL_BLEND);
+}
+
+/* draw screen area ligher with arrow shape ("eraser" of previous dark shape) */
+static void scrarea_draw_shape_light(ScrArea *sa, char dir)
+{
+ glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ /* value 181 was hardly computed: 181~105 */
+ glColor4ub(255, 255, 255, 50);
+ /* draw_join_shape(sa, dir); */
+ glRecti(sa->v1->vec.x, sa->v1->vec.y, sa->v3->vec.x, sa->v3->vec.y);
+ glDisable(GL_BLEND);
+}
+
+/** screen edges drawing **/
+static void drawscredge_area(ScrArea *sa)
+{
+ short x1= sa->v1->vec.x;
+ short y1= sa->v1->vec.y;
+ short x2= sa->v3->vec.x;
+ short y2= sa->v3->vec.y;
+
+ cpack(0x0);
+
+ /* right border area */
+ sdrawline(x2, y1, x2, y2);
+
+ /* left border area */
+ if(x1>0) { /* otherwise it draws the emboss of window over */
+ sdrawline(x1, y1, x1, y2);
+ }
+
+ /* top border area */
+ sdrawline(x1, y2, x2, y2);
+
+ /* bottom border area */
+ sdrawline(x1, y1, x2, y1);
+
+}
+
+/* ****************** EXPORTED API TO OTHER MODULES *************************** */
+
+bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc)
+{
+ bScreen *newsc;
+
+ if(sc->full != SCREENNORMAL) return NULL; /* XXX handle this case! */
+
+ /* make new empty screen: */
+ newsc= screen_add(win, sc->id.name+2);
+ /* copy all data */
+ screen_copy(newsc, sc);
+
+ return newsc;
+}
+
+
+void ED_screen_do_listen(wmWindow *win, wmNotifier *note)
+{
+
+ /* generic notes */
+ switch(note->type) {
+ case WM_NOTE_WINDOW_REDRAW:
+ win->screen->do_draw= 1;
+ break;
+ case WM_NOTE_SCREEN_CHANGED:
+ win->screen->do_draw= win->screen->do_refresh= 1;
+ break;
+ case WM_NOTE_GESTURE_REDRAW:
+ win->screen->do_gesture= 1; /* XXX gestures are stored in window, draw per region... a bit weak? wait for proper composite? (ton) */
+ break;
+ }
+}
+
+
+void ED_screen_draw(wmWindow *win)
+{
+ ScrArea *sa;
+ ScrArea *sa1=NULL;
+ ScrArea *sa2=NULL;
+ int dir = -1;
+ int dira = -1;
+
+ wm_subwindow_set(win, win->screen->mainwin);
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa;
+ if (sa->flag & AREA_FLAG_DRAWJOINTO) sa2 = sa;
+ drawscredge_area(sa);
+ }
+
+ /* blended join arrow */
+ if (sa1 && sa2) {
+ dir = area_getorientation(win->screen, sa1, sa2);
+ if (dir >= 0) {
+ switch(dir) {
+ case 0: /* W */
+ dir = 'r';
+ dira = 'l';
+ break;
+ case 1: /* N */
+ dir = 'd';
+ dira = 'u';
+ break;
+ case 2: /* E */
+ dir = 'l';
+ dira = 'r';
+ break;
+ case 3: /* S */
+ dir = 'u';
+ dira = 'd';
+ break;
+ }
+ }
+ scrarea_draw_shape_dark(sa2, dir);
+ scrarea_draw_shape_light(sa1, dira);
+ }
+
+ if(G.f & G_DEBUG) printf("draw screen\n");
+ win->screen->do_draw= 0;
+}
+
+/* make this screen usable */
+/* for file read and first use, for scaling window, area moves */
+void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
+{
+ ScrArea *sa;
+ rcti winrct= {0, win->sizex-1, 0, win->sizey-1};
+
+ screen_test_scale(win->screen, win->sizex, win->sizey);
+
+ if(win->screen->mainwin==0)
+ win->screen->mainwin= wm_subwindow_open(win, &winrct);
+ else
+ wm_subwindow_position(win, win->screen->mainwin, &winrct);
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ /* set spacetype and region callbacks, calls init() */
+ /* sets subwindows for regions, adds handlers */
+ ED_area_initialize(wm, win, sa);
+ }
+
+ if(G.f & G_DEBUG) printf("set screen\n");
+ win->screen->do_refresh= 0;
+
+}
+
+/* file read, set all screens, ... */
+void ED_screens_initialize(wmWindowManager *wm)
+{
+ wmWindow *win;
+
+ for(win= wm->windows.first; win; win= win->next) {
+
+ if(win->screen==NULL)
+ win->screen= G.main->screen.first;
+
+ ED_screen_refresh(wm, win);
+ }
+}
+
+void ED_region_exit(bContext *C, ARegion *ar)
+{
+ ARegion *prevar= C->region;
+
+ C->region= ar;
+ WM_event_remove_handlers(C, &ar->handlers);
+ C->region= prevar;
+}
+
+void ED_area_exit(bContext *C, ScrArea *sa)
+{
+ ScrArea *prevsa= C->area;
+ ARegion *ar;
+
+ C->area= sa;
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ ED_region_exit(C, ar);
+
+ WM_event_remove_handlers(C, &sa->handlers);
+ C->area= prevsa;
+}
+
+void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
+{
+ wmWindow *prevwin= C?C->window:NULL;
+ ScrArea *sa;
+ ARegion *ar;
+
+ C->window= window;
+ for(ar= screen->regionbase.first; ar; ar= ar->next)
+ ED_region_exit(C, ar);
+
+ for(sa= screen->areabase.first; sa; sa= sa->next)
+ ED_area_exit(C, sa);
+
+ WM_event_remove_handlers(C, &window->handlers);
+ C->window= prevwin;
+}
+
+
+/* called in wm_event_system.c. sets state var in screen */
+void ED_screen_set_subwinactive(wmWindow *win)
+{
+ if(win->screen) {
+ wmEvent *event= win->eventstate;
+ ScrArea *sa;
+ int oldswin= win->screen->subwinactive;
+
+ /* XXX prevent this call for modal menus now */
+ if(win->screen->regionbase.first)
+ return;
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ if(event->x > sa->totrct.xmin && event->x < sa->totrct.xmax)
+ if(event->y > sa->totrct.ymin && event->y < sa->totrct.ymax)
+ break;
+ }
+ if(sa) {
+ ARegion *ar;
+ for(ar= sa->regionbase.first; ar; ar= ar->next) {
+ if(BLI_in_rcti(&ar->winrct, event->x, event->y))
+ win->screen->subwinactive= ar->swinid;
+ }
+ }
+ else
+ win->screen->subwinactive= win->screen->mainwin;
+
+ /* check for redraw headers */
+ if(oldswin!=win->screen->subwinactive) {
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ ARegion *ar;
+ int do_draw= 0;
+
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ if(ar->swinid==oldswin || ar->swinid==win->screen->subwinactive)
+ do_draw= 1;
+
+ if(do_draw) {
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ if(ar->regiontype==RGN_TYPE_HEADER)
+ ar->do_draw= 1; /* XXX */
+ }
+ }
+ }
+ }
+}
+
+int ED_screen_area_active(const bContext *C)
+{
+
+ if(C->screen && C->area) {
+ ARegion *ar;
+ for(ar= C->area->regionbase.first; ar; ar= ar->next)
+ if(ar->swinid == C->screen->subwinactive)
+ return 1;
+ }
+ return 0;
+}
diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h
new file mode 100644
index 00000000000..7b44b1910c7
--- /dev/null
+++ b/source/blender/editors/screen/screen_intern.h
@@ -0,0 +1,54 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SCREEN_INTERN_H
+#define ED_SCREEN_INTERN_H
+
+/* internal exports only */
+struct wmWindow;
+
+/* area.c */
+void area_copy_data (ScrArea *sa1, ScrArea *sa2, int swap_space);
+
+/* screen_edit.c */
+bScreen *screen_add(struct wmWindow *win, char *name);
+ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2);
+ScrArea *area_split(wmWindow *win, bScreen *sc, ScrArea *sa, char dir, float fac);
+int screen_area_join(bScreen* scr, ScrArea *sa1, ScrArea *sa2);
+int area_getorientation(bScreen *screen, ScrArea *sa, ScrArea *sb);
+void select_connected_scredge(bScreen *sc, ScrEdge *edge);
+
+void removenotused_scrverts(bScreen *sc);
+void removedouble_scrverts(bScreen *sc);
+void removedouble_scredges(bScreen *sc);
+void removenotused_scredges(bScreen *sc);
+
+#endif /* ED_SCREEN_INTERN_H */
+
+
+
+
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
new file mode 100644
index 00000000000..9a96edf243c
--- /dev/null
+++ b/source/blender/editors/screen/screen_ops.c
@@ -0,0 +1,1359 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_markers.h"
+#include "ED_screen.h"
+#include "ED_screen_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "screen_intern.h" /* own module include */
+
+/* ************** Exported Poll tests ********************** */
+
+int ED_operator_areaactive(bContext *C)
+{
+ if(C->window==NULL) return 0;
+ if(C->screen==NULL) return 0;
+ if(C->area==NULL) return 0;
+ return 1;
+}
+
+int ED_operator_screenactive(bContext *C)
+{
+ if(C->window==NULL) return 0;
+ if(C->screen==NULL) return 0;
+ return 1;
+}
+
+/* when mouse is over area-edge */
+int ED_operator_screen_mainwinactive(bContext *C)
+{
+ if(C->window==NULL) return 0;
+ if(C->screen==NULL) return 0;
+ if (C->screen->subwinactive!=C->screen->mainwin) return 0;
+ return 1;
+}
+
+/* *************************** action zone operator ************************** */
+
+/* operator state vars used:
+ none
+
+functions:
+
+ apply() set actionzone event
+
+ exit() free customdata
+
+callbacks:
+
+ exec() never used
+
+ invoke() check if in zone
+ add customdata, put mouseco and area in it
+ add modal handler
+
+ modal() accept modal events while doing it
+ call apply() with gesture info, active window, nonactive window
+ call exit() and remove handler when LMB confirm
+
+*/
+
+typedef struct sActionzoneData {
+ ScrArea *sa1, *sa2;
+ AZone *az;
+ int x, y, gesture_dir;
+} sActionzoneData;
+
+/* used by other operators too */
+static ScrArea *screen_areahascursor(bScreen *scr, int x, int y)
+{
+ ScrArea *sa= NULL;
+ sa= scr->areabase.first;
+ while(sa) {
+ if(BLI_in_rcti(&sa->totrct, x, y)) break;
+ sa= sa->next;
+ }
+
+ return sa;
+}
+
+
+static AZone *is_in_area_actionzone(ScrArea *sa, int x, int y)
+{
+ AZone *az= NULL;
+ int i= 0;
+
+ for(az= sa->actionzones.first, i= 0; az; az= az->next, i++) {
+ if(az->type == AZONE_TRI) {
+ if(IsPointInTri2DInts(az->x1, az->y1, az->x2, az->y2, x, y))
+ break;
+ }
+ if(az->type == AZONE_QUAD) {
+ if(az->x1 < x && x < az->x2 && az->y1 < y && y < az->y2)
+ break;
+ }
+ }
+
+ return az;
+}
+
+static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ AZone *az= is_in_area_actionzone(C->area, event->x, event->y);
+ sActionzoneData *sad;
+
+ /* quick escape */
+ if(az==NULL)
+ return OPERATOR_PASS_THROUGH;
+
+ /* ok we do the actionzone */
+ sad= op->customdata= MEM_callocN(sizeof(sActionzoneData), "sActionzoneData");
+ sad->sa1= C->area;
+ sad->az= az;
+ sad->x= event->x; sad->y= event->y;
+
+ /* add modal handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static void actionzone_exit(bContext *C, wmOperator *op)
+{
+ if(op->customdata)
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+}
+
+/* send EVT_ACTIONZONE event */
+static void actionzone_apply(bContext *C, wmOperator *op)
+{
+ wmEvent event;
+
+ event= *(C->window->eventstate); /* XXX huh huh? make api call */
+ event.type= EVT_ACTIONZONE;
+ event.customdata= op->customdata;
+ event.customdatafree= TRUE;
+ op->customdata= NULL;
+
+ wm_event_add(C->window, &event);
+}
+
+static int actionzone_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sActionzoneData *sad= op->customdata;
+ int deltax, deltay;
+
+ switch(event->type) {
+ case MOUSEMOVE:
+ /* calculate gesture direction */
+ deltax= (event->x - sad->x);
+ deltay= (event->y - sad->y);
+
+ if(deltay > ABS(deltax))
+ sad->gesture_dir= AZONE_N;
+ else if(deltax > ABS(deltay))
+ sad->gesture_dir= AZONE_E;
+ else if(deltay < -ABS(deltax))
+ sad->gesture_dir= AZONE_S;
+ else
+ sad->gesture_dir= AZONE_W;
+
+ /* gesture is large enough? */
+ if(ABS(deltax) > 12 || ABS(deltay) > 12) {
+
+ /* second area, for join */
+ sad->sa2= screen_areahascursor(C->screen, event->x, event->y);
+ /* apply sends event */
+ actionzone_apply(C, op);
+ actionzone_exit(C, op);
+
+ return OPERATOR_FINISHED;
+ }
+ break;
+ case ESCKEY:
+ case LEFTMOUSE:
+ actionzone_exit(C, op);
+ return OPERATOR_CANCELLED;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void ED_SCR_OT_actionzone(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Handle area action zones";
+ ot->idname= "ED_SCR_OT_actionzone";
+
+ ot->invoke= actionzone_invoke;
+ ot->modal= actionzone_modal;
+
+ ot->poll= ED_operator_areaactive;
+}
+
+/* ****************** cursor near edge operator ********************************* */
+
+static int scredge_is_horizontal(ScrEdge *se)
+{
+ return (se->v1->vec.y == se->v2->vec.y);
+}
+
+static ScrEdge *screen_find_active_scredge(bScreen *sc, int mx, int my)
+{
+ ScrEdge *se;
+
+ for (se= sc->edgebase.first; se; se= se->next) {
+ if (scredge_is_horizontal(se)) {
+ short min, max;
+ min= MIN2(se->v1->vec.x, se->v2->vec.x);
+ max= MAX2(se->v1->vec.x, se->v2->vec.x);
+
+ if (abs(my-se->v1->vec.y)<=2 && mx>=min && mx<=max)
+ return se;
+ }
+ else {
+ short min, max;
+ min= MIN2(se->v1->vec.y, se->v2->vec.y);
+ max= MAX2(se->v1->vec.y, se->v2->vec.y);
+
+ if (abs(mx-se->v1->vec.x)<=2 && my>=min && my<=max)
+ return se;
+ }
+ }
+
+ return NULL;
+}
+
+
+/* operator cb */
+static int screen_cursor_test(bContext *C, wmOperator *op, wmEvent *event)
+{
+ if (C->screen->subwinactive==C->screen->mainwin) {
+ ScrEdge *actedge= screen_find_active_scredge(C->screen, event->x, event->y);
+
+ if (actedge && scredge_is_horizontal(actedge)) {
+ WM_set_cursor(C, CURSOR_Y_MOVE);
+ } else {
+ WM_set_cursor(C, CURSOR_X_MOVE);
+ }
+ return OPERATOR_FINISHED;
+ }
+ else {
+ ScrArea *sa= NULL;
+ AZone *az= NULL;
+
+ for(sa= C->screen->areabase.first; sa; sa= sa->next) {
+ az= is_in_area_actionzone(sa, event->x, event->y);
+ if(az!=NULL) break;
+ }
+
+ if(az!=NULL) WM_set_cursor(C, CURSOR_EDIT);
+ else WM_set_cursor(C, CURSOR_STD);
+ }
+
+ return OPERATOR_PASS_THROUGH;
+}
+
+static void ED_SCR_OT_cursor_type(wmOperatorType *ot)
+{
+ ot->name= "Cursor type";
+ ot->idname= "ED_SCR_OT_cursor_type";
+
+ ot->invoke= screen_cursor_test;
+ ot->poll= ED_operator_screenactive;
+}
+
+
+
+/* *********** Rip area operator ****************** */
+
+
+/* operator callback */
+/* (ton) removed attempt to merge ripped area with another, don't think this is desired functionality.
+conventions: 'atomic' and 'dont think for user' :) */
+static int screen_area_rip_op(bContext *C, wmOperator *op)
+{
+ wmWindow *win;
+ bScreen *newsc;
+ rcti rect;
+
+ /* poll() checks area context, but we don't accept full-area windows */
+ if(C->screen->full != SCREENNORMAL)
+ return OPERATOR_CANCELLED;
+
+ /* adds window to WM */
+ rect= C->area->totrct;
+ BLI_translate_rcti(&rect, C->window->posx, C->window->posy);
+ win= WM_window_open(C, &rect);
+
+ /* allocs new screen and adds to newly created window, using window size */
+ newsc= screen_add(win, C->screen->id.name+2);
+
+ /* copy area to new screen */
+ area_copy_data((ScrArea *)newsc->areabase.first, C->area, 0);
+
+ /* screen, areas init */
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_SCR_OT_area_rip(wmOperatorType *ot)
+{
+ ot->name= "Rip Area into New Window";
+ ot->idname= "ED_SCR_OT_area_rip";
+
+ ot->invoke= NULL; //WM_operator_confirm;
+ ot->exec= screen_area_rip_op;
+ ot->poll= ED_operator_areaactive;
+}
+
+
+/* ************** move area edge operator *********************************** */
+
+/* operator state vars used:
+ x, y mouse coord near edge
+ delta movement of edge
+
+ functions:
+
+ init() set default property values, find edge based on mouse coords, test
+ if the edge can be moved, select edges, calculate min and max movement
+
+ apply() apply delta on selection
+
+ exit() cleanup, send notifier
+
+ cancel() cancel moving
+
+ callbacks:
+
+ exec() execute without any user interaction, based on properties
+ call init(), apply(), exit()
+
+ invoke() gets called on mouse click near edge
+ call init(), add handler
+
+ modal() accept modal events while doing it
+ call apply() with delta motion
+ call exit() and remove handler
+
+*/
+
+typedef struct sAreaMoveData {
+ int bigger, smaller, origval;
+ char dir;
+} sAreaMoveData;
+
+/* helper call to move area-edge, sets limits */
+static void area_move_set_limits(bScreen *sc, int dir, int *bigger, int *smaller)
+{
+ ScrArea *sa;
+
+ /* we check all areas and test for free space with MINSIZE */
+ *bigger= *smaller= 100000;
+
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
+ if(dir=='h') {
+ int y1= sa->v2->vec.y - sa->v1->vec.y-AREAMINY;
+
+ /* if top or down edge selected, test height */
+ if(sa->v1->flag && sa->v4->flag)
+ *bigger= MIN2(*bigger, y1);
+ else if(sa->v2->flag && sa->v3->flag)
+ *smaller= MIN2(*smaller, y1);
+ }
+ else {
+ int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX;
+
+ /* if left or right edge selected, test width */
+ if(sa->v1->flag && sa->v2->flag)
+ *bigger= MIN2(*bigger, x1);
+ else if(sa->v3->flag && sa->v4->flag)
+ *smaller= MIN2(*smaller, x1);
+ }
+ }
+}
+
+/* validate selection inside screen, set variables OK */
+/* return 0: init failed */
+static int area_move_init (bContext *C, wmOperator *op)
+{
+ ScrEdge *actedge;
+ sAreaMoveData *md;
+ int x, y;
+
+ /* required properties */
+ x= RNA_int_get(op->ptr, "x");
+ y= RNA_int_get(op->ptr, "y");
+
+ /* setup */
+ actedge= screen_find_active_scredge(C->screen, x, y);
+ if(actedge==NULL) return 0;
+
+ md= MEM_callocN(sizeof(sAreaMoveData), "sAreaMoveData");
+ op->customdata= md;
+
+ md->dir= scredge_is_horizontal(actedge)?'h':'v';
+ if(md->dir=='h') md->origval= actedge->v1->vec.y;
+ else md->origval= actedge->v1->vec.x;
+
+ select_connected_scredge(C->screen, actedge);
+ /* now all vertices with 'flag==1' are the ones that can be moved. */
+
+ area_move_set_limits(C->screen, md->dir, &md->bigger, &md->smaller);
+
+ return 1;
+}
+
+/* moves selected screen edge amount of delta, used by split & move */
+static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int bigger, int smaller)
+{
+ ScrVert *v1;
+
+ delta= CLAMPIS(delta, -smaller, bigger);
+
+ for (v1= C->screen->vertbase.first; v1; v1= v1->next) {
+ if (v1->flag) {
+ /* that way a nice AREAGRID */
+ if((dir=='v') && v1->vec.x>0 && v1->vec.x<C->window->sizex-1) {
+ v1->vec.x= origval + delta;
+ if(delta != bigger && delta != -smaller) v1->vec.x-= (v1->vec.x % AREAGRID);
+ }
+ if((dir=='h') && v1->vec.y>0 && v1->vec.y<C->window->sizey-1) {
+ v1->vec.y= origval + delta;
+
+ v1->vec.y+= AREAGRID-1;
+ v1->vec.y-= (v1->vec.y % AREAGRID);
+
+ /* prevent too small top header */
+ if(v1->vec.y > C->window->sizey-AREAMINY)
+ v1->vec.y= C->window->sizey-AREAMINY;
+ }
+ }
+ }
+
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+}
+
+static void area_move_apply(bContext *C, wmOperator *op)
+{
+ sAreaMoveData *md= op->customdata;
+ int delta;
+
+ delta= RNA_int_get(op->ptr, "delta");
+ area_move_apply_do(C, md->origval, delta, md->dir, md->bigger, md->smaller);
+}
+
+static void area_move_exit(bContext *C, wmOperator *op)
+{
+ if(op->customdata)
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+
+ /* this makes sure aligned edges will result in aligned grabbing */
+ removedouble_scrverts(C->screen);
+ removedouble_scredges(C->screen);
+}
+
+static int area_move_exec(bContext *C, wmOperator *op)
+{
+ if(!area_move_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ area_move_apply(C, op);
+ area_move_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+/* interaction callback */
+static int area_move_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ RNA_int_set(op->ptr, "x", event->x);
+ RNA_int_set(op->ptr, "y", event->y);
+
+ if(!area_move_init(C, op))
+ return OPERATOR_PASS_THROUGH;
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int area_move_cancel(bContext *C, wmOperator *op)
+{
+
+ RNA_int_set(op->ptr, "delta", 0);
+ area_move_apply(C, op);
+ area_move_exit(C, op);
+
+ return OPERATOR_CANCELLED;
+}
+
+/* modal callback for while moving edges */
+static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sAreaMoveData *md;
+ int delta, x, y;
+
+ md= op->customdata;
+
+ x= RNA_int_get(op->ptr, "x");
+ y= RNA_int_get(op->ptr, "y");
+
+ /* execute the events */
+ switch(event->type) {
+ case MOUSEMOVE:
+ delta= (md->dir == 'v')? event->x - x: event->y - y;
+ RNA_int_set(op->ptr, "delta", delta);
+
+ area_move_apply(C, op);
+ break;
+
+ case LEFTMOUSE:
+ if(event->val==0) {
+ area_move_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+
+ case ESCKEY:
+ return area_move_cancel(C, op);
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void ED_SCR_OT_area_move(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Move area edges";
+ ot->idname= "ED_SCR_OT_area_move";
+
+ ot->exec= area_move_exec;
+ ot->invoke= area_move_invoke;
+ ot->cancel= area_move_cancel;
+ ot->modal= area_move_modal;
+
+ ot->poll= ED_operator_screen_mainwinactive; /* when mouse is over area-edge */
+
+ /* rna */
+ prop= RNA_def_property(ot->srna, "x", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "y", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "delta", PROP_INT, PROP_NONE);
+}
+
+/* ************** split area operator *********************************** */
+
+/*
+operator state vars:
+ fac spit point
+ dir direction 'v' or 'h'
+
+operator customdata:
+ area pointer to (active) area
+ x, y last used mouse pos
+ (more, see below)
+
+functions:
+
+ init() set default property values, find area based on context
+
+ apply() split area based on state vars
+
+ exit() cleanup, send notifier
+
+ cancel() remove duplicated area
+
+callbacks:
+
+ exec() execute without any user interaction, based on state vars
+ call init(), apply(), exit()
+
+ invoke() gets called on mouse click in action-widget
+ call init(), add modal handler
+ call apply() with initial motion
+
+ modal() accept modal events while doing it
+ call move-areas code with delta motion
+ call exit() or cancel() and remove handler
+
+*/
+
+#define SPLIT_STARTED 1
+#define SPLIT_PROGRESS 2
+
+typedef struct sAreaSplitData
+{
+ int x, y; /* last used mouse position */
+
+ int origval; /* for move areas */
+ int bigger, smaller; /* constraints for moving new edge */
+ int delta; /* delta move edge */
+ int origmin, origsize; /* to calculate fac, for property storage */
+
+ ScrEdge *nedge; /* new edge */
+ ScrArea *sarea; /* start area */
+ ScrArea *narea; /* new area */
+} sAreaSplitData;
+
+/* generic init, no UI stuff here */
+static int area_split_init(bContext *C, wmOperator *op)
+{
+ sAreaSplitData *sd;
+ int dir;
+
+ /* required context */
+ if(C->area==NULL) return 0;
+
+ /* required properties */
+ dir= RNA_enum_get(op->ptr, "dir");
+
+ /* minimal size */
+ if(dir=='v' && C->area->winx < 2*AREAMINX) return 0;
+ if(dir=='h' && C->area->winy < 2*AREAMINY) return 0;
+
+ /* custom data */
+ sd= (sAreaSplitData*)MEM_callocN(sizeof (sAreaSplitData), "op_area_split");
+ op->customdata= sd;
+
+ sd->sarea= C->area;
+ sd->origsize= dir=='v' ? C->area->winx:C->area->winy;
+ sd->origmin = dir=='v' ? C->area->totrct.xmin:C->area->totrct.ymin;
+
+ return 1;
+}
+
+/* with sa as center, sb is located at: 0=W, 1=N, 2=E, 3=S */
+/* used with split operator */
+static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *sa, ScrArea *sb)
+{
+ ScrVert *sav1= sa->v1;
+ ScrVert *sav2= sa->v2;
+ ScrVert *sav3= sa->v3;
+ ScrVert *sav4= sa->v4;
+ ScrVert *sbv1= sb->v1;
+ ScrVert *sbv2= sb->v2;
+ ScrVert *sbv3= sb->v3;
+ ScrVert *sbv4= sb->v4;
+
+ if(sav1==sbv4 && sav2==sbv3) { /* sa to right of sb = W */
+ return screen_findedge(screen, sav1, sav2);
+ }
+ else if(sav2==sbv1 && sav3==sbv4) { /* sa to bottom of sb = N */
+ return screen_findedge(screen, sav2, sav3);
+ }
+ else if(sav3==sbv2 && sav4==sbv1) { /* sa to left of sb = E */
+ return screen_findedge(screen, sav3, sav4);
+ }
+ else if(sav1==sbv2 && sav4==sbv3) { /* sa on top of sb = S*/
+ return screen_findedge(screen, sav1, sav4);
+ }
+
+ return NULL;
+}
+
+
+/* do the split, return success */
+static int area_split_apply(bContext *C, wmOperator *op)
+{
+ sAreaSplitData *sd= (sAreaSplitData *)op->customdata;
+ float fac;
+ int dir;
+
+ fac= RNA_float_get(op->ptr, "fac");
+ dir= RNA_enum_get(op->ptr, "dir");
+
+ sd->narea= area_split(C->window, C->screen, sd->sarea, dir, fac);
+
+ if(sd->narea) {
+ ScrVert *sv;
+
+ sd->nedge= area_findsharededge(C->screen, sd->sarea, sd->narea);
+
+ /* select newly created edge, prepare for moving edge */
+ for(sv= C->screen->vertbase.first; sv; sv= sv->next)
+ sv->flag = 0;
+
+ sd->nedge->v1->flag= 1;
+ sd->nedge->v2->flag= 1;
+
+ if(dir=='h') sd->origval= sd->nedge->v1->vec.y;
+ else sd->origval= sd->nedge->v1->vec.x;
+
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+static void area_split_exit(bContext *C, wmOperator *op)
+{
+ if (op->customdata) {
+ MEM_freeN(op->customdata);
+ op->customdata = NULL;
+ }
+
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+
+ /* this makes sure aligned edges will result in aligned grabbing */
+ removedouble_scrverts(C->screen);
+ removedouble_scredges(C->screen);
+}
+
+
+/* UI callback, adds new handler */
+static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sAreaSplitData *sd;
+
+ if(event->type==EVT_ACTIONZONE) {
+ sActionzoneData *sad= event->customdata;
+ int dir;
+
+ /* verify *sad itself */
+ if(sad==NULL || sad->sa1==NULL || sad->az==NULL)
+ return OPERATOR_PASS_THROUGH;
+
+ /* is this our *sad? if areas not equal it should be passed on */
+ if(C->area!=sad->sa1 || sad->sa1!=sad->sa2)
+ return OPERATOR_PASS_THROUGH;
+
+ /* prepare operator state vars */
+ if(sad->gesture_dir==AZONE_N || sad->gesture_dir==AZONE_S) {
+ dir= 'h';
+ RNA_float_set(op->ptr, "fac", ((float)(event->x - sad->sa1->v1->vec.x)) / (float)sad->sa1->winx);
+ }
+ else {
+ dir= 'v';
+ RNA_float_set(op->ptr, "fac", ((float)(event->y - sad->sa1->v1->vec.y)) / (float)sad->sa1->winy);
+ }
+ RNA_enum_set(op->ptr, "dir", dir);
+
+ /* general init, also non-UI case, adds customdata, sets area and defaults */
+ if(!area_split_init(C, op))
+ return OPERATOR_PASS_THROUGH;
+
+ sd= (sAreaSplitData *)op->customdata;
+
+ sd->x= event->x;
+ sd->y= event->y;
+
+ /* do the split */
+ if(area_split_apply(C, op)) {
+ area_move_set_limits(C->screen, dir, &sd->bigger, &sd->smaller);
+
+ /* add temp handler for edge move or cancel */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+ }
+
+ }
+ else {
+ /* nonmodal for now */
+ return op->type->exec(C, op);
+ }
+
+ return OPERATOR_PASS_THROUGH;
+}
+
+/* function to be called outside UI context, or for redo */
+static int area_split_exec(bContext *C, wmOperator *op)
+{
+
+ if(!area_split_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ area_split_apply(C, op);
+ area_split_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+
+static int area_split_cancel(bContext *C, wmOperator *op)
+{
+ sAreaSplitData *sd= (sAreaSplitData *)op->customdata;
+
+ if (screen_area_join(C->screen,sd->sarea, sd->narea)) {
+ if (C->area == sd->narea) {
+ C->area = NULL;
+ }
+ sd->narea = NULL;
+ }
+ area_split_exit(C, op);
+
+ return OPERATOR_CANCELLED;
+}
+
+static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sAreaSplitData *sd= (sAreaSplitData *)op->customdata;
+ float fac;
+ int dir;
+
+ /* execute the events */
+ switch(event->type) {
+ case MOUSEMOVE:
+ dir= RNA_enum_get(op->ptr, "dir");
+
+ sd->delta= (dir == 'v')? event->x - sd->origval: event->y - sd->origval;
+ area_move_apply_do(C, sd->origval, sd->delta, dir, sd->bigger, sd->smaller);
+
+ fac= (dir == 'v') ? event->x-sd->origmin : event->y-sd->origmin;
+ RNA_float_set(op->ptr, "fac", fac / (float)sd->origsize);
+
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+ break;
+
+ case LEFTMOUSE:
+ if(event->val==0) { /* mouse up */
+ area_split_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ case RIGHTMOUSE: /* cancel operation */
+ case ESCKEY:
+ return area_split_cancel(C, op);
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static EnumPropertyItem prop_direction_items[] = {
+ {'h', "HORIZONTAL", "Horizontal", ""},
+ {'v', "VERTICAL", "Vertical", ""},
+ {0, NULL, NULL, NULL}};
+
+void ED_SCR_OT_area_split(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ ot->name = "Split area";
+ ot->idname = "ED_SCR_OT_area_split";
+
+ ot->exec= area_split_exec;
+ ot->invoke= area_split_invoke;
+ ot->modal= area_split_modal;
+
+ ot->poll= ED_operator_areaactive;
+ ot->flag= OPTYPE_REGISTER;
+
+ /* rna */
+ prop= RNA_def_property(ot->srna, "dir", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_direction_items);
+ RNA_def_property_enum_default(prop, 'h');
+
+ prop= RNA_def_property(ot->srna, "fac", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_float_default(prop, 0.5f);
+}
+
+/* ************** join area operator ********************************************** */
+
+/* operator state vars used:
+ x1, y1 mouse coord in first area, which will disappear
+ x2, y2 mouse coord in 2nd area, which will become joined
+
+functions:
+
+ init() find edge based on state vars
+ test if the edge divides two areas,
+ store active and nonactive area,
+
+ apply() do the actual join
+
+ exit() cleanup, send notifier
+
+callbacks:
+
+ exec() calls init, apply, exit
+
+ invoke() sets mouse coords in x,y
+ call init()
+ add modal handler
+
+ modal() accept modal events while doing it
+ call apply() with active window and nonactive window
+ call exit() and remove handler when LMB confirm
+
+*/
+
+typedef struct sAreaJoinData
+{
+ ScrArea *sa1; /* first area to be considered */
+ ScrArea *sa2; /* second area to be considered */
+ ScrArea *scr; /* designed for removal */
+
+} sAreaJoinData;
+
+
+/* validate selection inside screen, set variables OK */
+/* return 0: init failed */
+/* XXX todo: find edge based on (x,y) and set other area? */
+static int area_join_init(bContext *C, wmOperator *op)
+{
+ ScrArea *sa1, *sa2;
+ sAreaJoinData* jd= NULL;
+ int x1, y1;
+ int x2, y2;
+
+ /* required properties, make negative to get return 0 if not set by caller */
+ x1= RNA_int_get(op->ptr, "x1");
+ y1= RNA_int_get(op->ptr, "y1");
+ x2= RNA_int_get(op->ptr, "x2");
+ y2= RNA_int_get(op->ptr, "y2");
+
+ sa1 = screen_areahascursor(C->screen, x1, y1);
+ sa2 = screen_areahascursor(C->screen, x2, y2);
+ if(sa1==NULL || sa2==NULL || sa1==sa2)
+ return 0;
+
+ jd = (sAreaJoinData*)MEM_callocN(sizeof (sAreaJoinData), "op_area_join");
+
+ jd->sa1 = sa1;
+ jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM;
+ jd->sa2 = sa2;
+ jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
+
+ op->customdata= jd;
+
+ return 1;
+}
+
+/* apply the join of the areas (space types) */
+static int area_join_apply(bContext *C, wmOperator *op)
+{
+ sAreaJoinData *jd = (sAreaJoinData *)op->customdata;
+ if (!jd) return 0;
+
+ if(!screen_area_join(C->screen,jd->sa1,jd->sa2)){
+ return 0;
+ }
+ if (C->area == jd->sa2) {
+ C->area = NULL;
+ }
+
+ return 1;
+}
+
+/* finish operation */
+static void area_join_exit(bContext *C, wmOperator *op)
+{
+ if (op->customdata) {
+ MEM_freeN(op->customdata);
+ op->customdata = NULL;
+ }
+
+ /* this makes sure aligned edges will result in aligned grabbing */
+ removedouble_scredges(C->screen);
+ removenotused_scredges(C->screen);
+ removenotused_scrverts(C->screen);
+}
+
+static int area_join_exec(bContext *C, wmOperator *op)
+{
+ if(!area_join_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ area_join_apply(C, op);
+ area_join_exit(C, op);
+
+ return OPERATOR_FINISHED;
+}
+
+/* interaction callback */
+static int area_join_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+
+ if(event->type==EVT_ACTIONZONE) {
+ sActionzoneData *sad= event->customdata;
+
+ /* verify *sad itself */
+ if(sad==NULL || sad->sa1==NULL || sad->sa2==NULL)
+ return OPERATOR_PASS_THROUGH;
+
+ /* is this our *sad? if areas equal it should be passed on */
+ if(sad->sa1==sad->sa2)
+ return OPERATOR_PASS_THROUGH;
+
+ /* prepare operator state vars */
+ RNA_int_set(op->ptr, "x1", sad->x);
+ RNA_int_set(op->ptr, "y1", sad->y);
+ RNA_int_set(op->ptr, "x2", event->x);
+ RNA_int_set(op->ptr, "y2", event->y);
+
+ if(!area_join_init(C, op))
+ return OPERATOR_PASS_THROUGH;
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+ }
+
+ return OPERATOR_PASS_THROUGH;
+}
+
+static int area_join_cancel(bContext *C, wmOperator *op)
+{
+ sAreaJoinData *jd = (sAreaJoinData *)op->customdata;
+
+ if (jd->sa1) {
+ jd->sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
+ jd->sa1->flag &= ~AREA_FLAG_DRAWJOINTO;
+ }
+ if (jd->sa2) {
+ jd->sa2->flag &= ~AREA_FLAG_DRAWJOINFROM;
+ jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ }
+
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+
+ area_join_exit(C, op);
+
+ return OPERATOR_CANCELLED;
+}
+
+/* modal callback while selecting area (space) that will be removed */
+static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ sAreaJoinData *jd = (sAreaJoinData *)op->customdata;
+
+ /* execute the events */
+ switch(event->type) {
+
+ case MOUSEMOVE:
+ {
+ ScrArea *sa = screen_areahascursor(C->screen, event->x, event->y);
+ int dir;
+
+ if (sa) {
+ if (jd->sa1 != sa) {
+ dir = area_getorientation(C->screen, jd->sa1, sa);
+ if (dir >= 0) {
+ if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ jd->sa2 = sa;
+ jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
+ }
+ else {
+ /* we are not bordering on the previously selected area
+ we check if area has common border with the one marked for removal
+ in this case we can swap areas.
+ */
+ dir = area_getorientation(C->screen, sa, jd->sa2);
+ if (dir >= 0) {
+ if (jd->sa1) jd->sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
+ if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ jd->sa1 = jd->sa2;
+ jd->sa2 = sa;
+ if (jd->sa1) jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM;
+ if (jd->sa2) jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
+ }
+ else {
+ if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ jd->sa2 = NULL;
+ }
+ }
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+ else {
+ /* we are back in the area previously selected for keeping
+ * we swap the areas if possible to allow user to choose */
+ if (jd->sa2 != NULL) {
+ if (jd->sa1) jd->sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
+ if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ jd->sa1 = jd->sa2;
+ jd->sa2 = sa;
+ if (jd->sa1) jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM;
+ if (jd->sa2) jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
+ dir = area_getorientation(C->screen, jd->sa1, jd->sa2);
+ if (dir < 0) {
+ printf("oops, didn't expect that!\n");
+ }
+ }
+ else {
+ dir = area_getorientation(C->screen, jd->sa1, sa);
+ if (dir >= 0) {
+ if (jd->sa2) jd->sa2->flag &= ~AREA_FLAG_DRAWJOINTO;
+ jd->sa2 = sa;
+ jd->sa2->flag |= AREA_FLAG_DRAWJOINTO;
+ }
+ }
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ }
+ }
+ }
+ break;
+ case LEFTMOUSE:
+ if(event->val==0) {
+ area_join_apply(C, op);
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+ area_join_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+
+ case ESCKEY:
+ return area_join_cancel(C, op);
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* Operator for joining two areas (space types) */
+void ED_SCR_OT_area_join(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Join area";
+ ot->idname= "ED_SCR_OT_area_join";
+
+ /* api callbacks */
+ ot->exec= area_join_exec;
+ ot->invoke= area_join_invoke;
+ ot->modal= area_join_modal;
+
+ ot->poll= ED_operator_screenactive;
+
+ /* rna */
+ prop= RNA_def_property(ot->srna, "x1", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, -100);
+ prop= RNA_def_property(ot->srna, "y1", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, -100);
+ prop= RNA_def_property(ot->srna, "x2", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, -100);
+ prop= RNA_def_property(ot->srna, "y2", PROP_INT, PROP_NONE);
+ RNA_def_property_int_default(prop, -100);
+}
+
+/* ************** repeat last operator ***************************** */
+
+static int repeat_last_exec(bContext *C, wmOperator *op)
+{
+ wmOperator *lastop= C->wm->operators.last;
+
+ if(lastop) {
+ printf("repeat %s\n", lastop->type->idname);
+ lastop->type->exec(C, lastop);
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_SCR_OT_repeat_last(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Repeat Last";
+ ot->idname= "ED_SCR_OT_repeat_last";
+
+ /* api callbacks */
+ ot->exec= repeat_last_exec;
+
+ ot->poll= ED_operator_screenactive;
+
+}
+
+/* ************** region split operator ***************************** */
+
+/* insert a region in the area region list */
+static int region_split_exec(bContext *C, wmOperator *op)
+{
+ ARegion *newar= BKE_area_region_copy(C->region);
+ int dir= RNA_enum_get(op->ptr, "dir");
+
+ BLI_insertlinkafter(&C->area->regionbase, C->region, newar);
+
+ newar->alignment= C->region->alignment;
+
+ if(dir=='h')
+ C->region->alignment= RGN_ALIGN_HSPLIT;
+ else
+ C->region->alignment= RGN_ALIGN_VSPLIT;
+
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+static int region_split_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+
+ /* can't do menu, so event is checked manually */
+ if(evt->shift)
+ RNA_enum_set(op->ptr, "dir", 'v');
+ else
+ RNA_enum_set(op->ptr, "dir", 'h');
+
+ return region_split_exec(C, op);
+}
+
+
+void ED_SCR_OT_region_split(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Split Region";
+ ot->idname= "ED_SCR_OT_region_split";
+
+ /* api callbacks */
+ ot->exec= region_split_exec;
+ ot->invoke= region_split_invoke;
+
+ ot->poll= ED_operator_areaactive;
+
+ prop= RNA_def_property(ot->srna, "dir", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_direction_items);
+ RNA_def_property_enum_default(prop, 'h');
+}
+
+
+/* ************** border select operator (template) ***************************** */
+
+/* operator state vars used: (added by default WM callbacks)
+ xmin, ymin
+ xmax, ymax
+
+ customdata: the wmGesture pointer
+
+callbacks:
+
+ exec() has to be filled in by user
+
+ invoke() default WM function
+ adds modal handler
+
+ modal() default WM function
+ accept modal events while doing it, calls exec(), handles ESC and border drawing
+
+ poll() has to be filled in by user for context
+*/
+#if 0
+static int border_select_do(bContext *C, wmOperator *op)
+{
+ int event_type= RNA_int_get(op->ptr, "event_type");
+
+ if(event_type==LEFTMOUSE)
+ printf("border select do select\n");
+ else if(event_type==RIGHTMOUSE)
+ printf("border select deselect\n");
+ else
+ printf("border select do something\n");
+
+ return 1;
+}
+
+void ED_SCR_OT_border_select(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Border select";
+ ot->idname= "ED_SCR_OT_border_select";
+
+ /* api callbacks */
+ ot->exec= border_select_do;
+ ot->invoke= WM_border_select_invoke;
+ ot->modal= WM_border_select_modal;
+
+ ot->poll= ED_operator_areaactive;
+
+ /* rna */
+ RNA_def_property(ot->srna, "event_type", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "xmin", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "xmax", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "ymin", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "ymax", PROP_INT, PROP_NONE);
+
+}
+#endif
+
+/* **************** Assigning operatortypes to global list, adding handlers **************** */
+
+/* called in spacetypes.c */
+void ED_operatortypes_screen(void)
+{
+ /* generic UI stuff */
+ WM_operatortype_append(ED_SCR_OT_cursor_type);
+ WM_operatortype_append(ED_SCR_OT_actionzone);
+ WM_operatortype_append(ED_SCR_OT_repeat_last);
+
+ /* screen tools */
+ WM_operatortype_append(ED_SCR_OT_area_move);
+ WM_operatortype_append(ED_SCR_OT_area_split);
+ WM_operatortype_append(ED_SCR_OT_area_join);
+ WM_operatortype_append(ED_SCR_OT_area_rip);
+ WM_operatortype_append(ED_SCR_OT_region_split);
+
+ /* tools shared by more space types */
+ ED_marker_operatortypes();
+
+}
+
+/* called in spacetypes.c */
+void ED_keymap_screen(wmWindowManager *wm)
+{
+ ListBase *keymap= WM_keymap_listbase(wm, "Screen", 0, 0);
+
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_cursor_type", MOUSEMOVE, 0, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0);
+
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_area_move", LEFTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_area_split", EVT_ACTIONZONE, 0, 0, 0); /* action tria */
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_area_join", EVT_ACTIONZONE, 0, 0, 0); /* action tria */
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_area_rip", RKEY, KM_PRESS, KM_ALT, 0);
+
+ /* tests */
+ WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_verify_item(keymap, "ED_SCR_OT_repeat_last", F4KEY, KM_PRESS, 0, 0);
+}
+
diff --git a/source/blender/editors/screen/stubs.c b/source/blender/editors/screen/stubs.c
new file mode 100644
index 00000000000..6e6881d8e5c
--- /dev/null
+++ b/source/blender/editors/screen/stubs.c
@@ -0,0 +1,97 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+/* various UI stuff */
+void blender_test_break() {}
+void error() {}
+void set_timecursor() {}
+void waitcursor() {}
+void mainqenter() {}
+void saveover() {}
+void BIF_icons_free() {}
+void BIF_icons_init() {}
+
+char texstr[20][12];
+
+/* global vars */
+void *editNurb;
+void *editelems;
+
+/* python, will come back */
+void BPY_post_start_python() {}
+//void BPY_run_python_script() {}
+void BPY_start_python() {}
+void BPY_do_all_scripts() {}
+void BPY_call_importloader() {}
+void BPY_do_pyscript() {}
+void BPY_pydriver_eval() {}
+void BPY_pydriver_get_objects() {}
+void BPY_clear_script() {}
+void BPY_free_compiled_text() {}
+void BPY_pyconstraint_eval() {}
+void BPY_pyconstraint_target() {}
+
+/* areas */
+void copy_view3d_lock() {}
+
+/* seq */
+void do_render_seq() {}
+void free_editing() {}
+void get_forground_frame_seq() {}
+void build_seqar() {}
+
+/* sculpt */
+void sculptmode_free_all() {}
+void sculptmode_init() {}
+
+/* mesh */
+void free_realtime_image() {}
+void NewBooleanDerivedMesh() {}
+void harmonic_coordinates_bind() {}
+
+/* particle */
+void PE_recalc_world_cos() {}
+void PE_free_particle_edit() {}
+void PE_get_colors() {}
+
+/* fluid */
+void fluidsimSettingsCopy() {}
+void fluidsimSettingsFree() {}
+
+void BIF_filelist_freelib() {}
+
+/* audio */
+void audiostream_play() {}
+void audiostream_fill() {}
+
+struct RenderData;
+void start_avi_codec(struct RenderData *rd,int rectx, int recty ){}
+void append_avi_codec(int frame,int *pixels,int rectx, int recty){};
+void end_avi_codec(void){};
diff --git a/source/blender/editors/space_action/Makefile b/source/blender/editors/space_action/Makefile
new file mode 100644
index 00000000000..b737a3dc9d5
--- /dev/null
+++ b/source/blender/editors/space_action/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_action
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_action/SConscript b/source/blender/editors/space_action/SConscript
new file mode 100644
index 00000000000..f1152e95d0c
--- /dev/null
+++ b/source/blender/editors/space_action/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_action', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c
new file mode 100644
index 00000000000..aa3e3c09962
--- /dev/null
+++ b/source/blender/editors/space_action/action_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "action_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_action_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void action_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_action_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BSE_editnla_types.h b/source/blender/editors/space_action/action_intern.h
index f23821e8aa3..cd4886f50c4 100644
--- a/source/blender/include/BSE_editnla_types.h
+++ b/source/blender/editors/space_action/action_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_ACTION_INTERN_H
+#define ED_ACTION_INTERN_H
+
+/* internal exports only */
+
-#ifndef BSE_EDITNLA_TYPES_H
-#define BSE_EDITNLA_TYPES_H
+/* action_header.c */
+void action_header_buttons(const bContext *C, ARegion *ar);
-#define NLAWIDTH 196
-#define NLACHANNELHEIGHT 16
-#define NLACHANNELSKIP 1
-#endif /* BSE_EDITNLA_TYPES_H */
+#endif /* ED_ACTION_INTERN_H */
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
new file mode 100644
index 00000000000..5409fa07397
--- /dev/null
+++ b/source/blender/editors/space_action/space_action.c
@@ -0,0 +1,276 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_action_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "action_intern.h" // own include
+
+/* ******************** default callbacks for action space ***************** */
+
+static SpaceLink *action_new(void)
+{
+ ARegion *ar;
+ SpaceAction *saction;
+
+ saction= MEM_callocN(sizeof(SpaceAction), "initaction");
+ saction->spacetype= SPACE_ACTION;
+ saction->autosnap = SACTSNAP_FRAME;
+
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for action");
+
+ BLI_addtail(&saction->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for action");
+
+ BLI_addtail(&saction->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= 1.0f;
+ ar->v2d.tot.ymin= -1000.0f;
+ ar->v2d.tot.xmax= 1000.0f;
+ ar->v2d.tot.ymax= 0.0f;
+
+ ar->v2d.cur.xmin= -5.0f;
+ ar->v2d.cur.ymin= -75.0f;
+ ar->v2d.cur.xmax= 65.0f;
+ ar->v2d.cur.ymax= 5.0f;
+
+ ar->v2d.min[0]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 1000.0f;
+
+ ar->v2d.minzoom= 0.01f;
+ ar->v2d.maxzoom= 50;
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
+
+ /* channel list region XXX */
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(&saction->regionbase, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+
+
+ return (SpaceLink *)saction;
+}
+
+/* not spacelink itself */
+static void action_free(SpaceLink *sl)
+{
+// SpaceAction *saction= (SpaceAction*) sl;
+
+}
+
+
+/* spacetype; init callback */
+static void action_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *action_duplicate(SpaceLink *sl)
+{
+ SpaceAction *sactionn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)sactionn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void action_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Action", SPACE_ACTION, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void action_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceAction *saction= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void action_operatortypes(void)
+{
+
+}
+
+void action_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void action_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void action_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ action_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_action(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype action");
+ ARegionType *art;
+
+ st->spaceid= SPACE_ACTION;
+
+ st->new= action_new;
+ st->free= action_free;
+ st->init= action_init;
+ st->duplicate= action_duplicate;
+ st->operatortypes= action_operatortypes;
+ st->keymap= action_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= action_main_area_init;
+ art->draw= action_main_area_draw;
+ art->listener= action_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= action_header_area_init;
+ art->draw= action_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= action_channel_area_init;
+// art->draw= action_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/blenkernel/bad_level_call_stubs/Makefile b/source/blender/editors/space_api/Makefile
index 5268bfd8a48..46f926afbc9 100644
--- a/source/blender/blenkernel/bad_level_call_stubs/Makefile
+++ b/source/blender/editors/space_api/Makefile
@@ -1,12 +1,12 @@
#
-# $Id$
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
#
# ***** 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
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
@@ -26,23 +26,25 @@
#
# ***** END GPL LICENSE BLOCK *****
#
-#
+# Makes module object directory and bounces make to subdirectories.
-LIBNAME = blenkernel_blc
-DIR = $(OCGDIR)/blender/blenkernel/$(LIBNAME)
+LIBNAME = ed_space
+DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
-CFLAGS += $(LEVEL_2_C_WARNINGS)
-CFLAGS += $(FIX_STUBS_WARNINGS)
+CFLAGS += $(LEVEL_1_C_WARNINGS)
-CPPFLAGS += $(OGL_CPPFLAGS)
-CPPFLAGS += -I../../makesdna
-CPPFLAGS += -I../../include
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../render/extern/include
-CPPFLAGS += -I$(NAN_IKSOLVER)/include
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-# path to our own external headerfiles
-CPPFLAGS += -I..
+# own include
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_api/SConscript b/source/blender/editors/space_api/SConscript
new file mode 100644
index 00000000000..533c3d8b4d3
--- /dev/null
+++ b/source/blender/editors/space_api/SConscript
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna'
+incs += ' ../../windowmanager ../../python ../../makesrna'
+incs += ' #/intern/guardedalloc #/extern/glew/include'
+
+defs = ''
+
+if not env['WITH_BF_PYTHON']:
+ defs += 'DISABLE_PYTHON'
+
+env.BlenderLib ( 'bf_editors_space_api', sources, Split(incs), Split(defs), libtype=['core','intern'], priority=[30, 35] )
diff --git a/source/blender/editors/space_api/space.c b/source/blender/editors/space_api/space.c
new file mode 100644
index 00000000000..1d9e3ac97ff
--- /dev/null
+++ b/source/blender/editors/space_api/space.c
@@ -0,0 +1,45 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+
+/* */
+
+
+
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
new file mode 100644
index 00000000000..59198aaf3ba
--- /dev/null
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -0,0 +1,175 @@
+/**
+ * $Id: spacetypes.c
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation, 2008
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
+
+#include "DNA_windowmanager_types.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "UI_interface.h"
+#include "UI_view2d.h"
+
+#include "BIF_gl.h"
+
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+
+ARegionType *ED_regiontype_from_id(SpaceType *st, int regionid)
+{
+ ARegionType *art;
+
+ for(art= st->regiontypes.first; art; art= art->next)
+ if(art->regionid==regionid)
+ return art;
+
+ printf("Error, region type missing in %s\n", st->name);
+ return st->regiontypes.first;
+}
+
+
+/* only call once on startup, storage is global in BKE kernel listbase */
+void ED_spacetypes_init(void)
+{
+ const ListBase *spacetypes;
+ SpaceType *type;
+
+ /* create space types */
+ ED_spacetype_outliner();
+ ED_spacetype_time();
+ ED_spacetype_view3d();
+ ED_spacetype_ipo();
+ ED_spacetype_image();
+ ED_spacetype_node();
+ ED_spacetype_buttons();
+ ED_spacetype_info();
+ ED_spacetype_file();
+ ED_spacetype_sound();
+ ED_spacetype_action();
+ ED_spacetype_nla();
+ ED_spacetype_script();
+ ED_spacetype_text();
+ ED_spacetype_sequencer();
+// ...
+
+ /* register operator types for screen and all spaces */
+ ED_operatortypes_screen();
+ ui_view2d_operatortypes();
+
+ spacetypes = BKE_spacetypes_list();
+ for(type=spacetypes->first; type; type=type->next)
+ type->operatortypes();
+}
+
+/* called in wm.c */
+/* keymap definitions are registered only once per WM initialize, usually on file read,
+ using the keymap the actual areas/regions add the handlers */
+void ED_spacetypes_keymap(wmWindowManager *wm)
+{
+ const ListBase *spacetypes;
+ SpaceType *stype;
+ ARegionType *atype;
+
+ ED_keymap_screen(wm);
+ UI_view2d_keymap(wm);
+
+ spacetypes = BKE_spacetypes_list();
+ for(stype=spacetypes->first; stype; stype=stype->next) {
+ if(stype->keymap)
+ stype->keymap(wm);
+ for(atype=stype->regiontypes.first; atype; atype=atype->next) {
+ if(atype->keymap)
+ atype->keymap(wm);
+ }
+ }
+}
+
+/* ****************************** space template *********************** */
+
+/* allocate and init some vars */
+static SpaceLink *xxx_new(void)
+{
+ return NULL;
+}
+
+/* not spacelink itself */
+static void xxx_free(SpaceLink *sl)
+{
+
+}
+
+/* spacetype; init callback for usage, should be redoable */
+static void xxx_init(wmWindowManager *wm, ScrArea *sa)
+{
+
+ /* link area to SpaceXXX struct */
+
+ /* define how many regions, the order and types */
+
+ /* add types to regions */
+}
+
+static SpaceLink *xxx_duplicate(SpaceLink *sl)
+{
+
+ return NULL;
+}
+
+static void xxx_operatortypes(void)
+{
+ /* register operator types for this space */
+}
+
+static void xxx_keymap(wmWindowManager *wm)
+{
+ /* add default items to keymap */
+}
+
+/* only called once, from screen/spacetypes.c */
+void ED_spacetype_xxx(void)
+{
+ static SpaceType st;
+
+ st.spaceid= SPACE_VIEW3D;
+
+ st.new= xxx_new;
+ st.free= xxx_free;
+ st.init= xxx_init;
+ st.duplicate= xxx_duplicate;
+ st.operatortypes= xxx_operatortypes;
+ st.keymap= xxx_keymap;
+
+ BKE_spacetype_register(&st);
+}
+
+/* ****************************** end template *********************** */
+
+
+
+
diff --git a/source/blender/editors/space_buttons/Makefile b/source/blender/editors/space_buttons/Makefile
new file mode 100644
index 00000000000..33fe2cfc9cb
--- /dev/null
+++ b/source/blender/editors/space_buttons/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_buttons
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript
new file mode 100644
index 00000000000..eb3e6bda207
--- /dev/null
+++ b/source/blender/editors/space_buttons/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
new file mode 100644
index 00000000000..3f07b220b64
--- /dev/null
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -0,0 +1,200 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "buttons_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+#define B_CONTEXT_SWITCH 101
+#define B_BUTSPREVIEW 102
+#define B_NEWFRAME 103
+
+static void do_buttons_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ case B_NEWFRAME:
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ break;
+ }
+}
+
+
+void buttons_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ SpaceButs *sbuts= sa->spacedata.first;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_buttons_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ uiBlockBeginAlign(block);
+ uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_GAME, xco, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_LOGIC, 0, 0, "Logic (F4) ");
+ uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCRIPT, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_SCRIPT, 0, 0, "Script ");
+ uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL_DEHLT,xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_SHADING, 0, 0, "Shading (F5) ");
+ uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_OBJECT, 0, 0, "Object (F7) ");
+ uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_EDIT, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_EDITING, 0, 0, "Editing (F9) ");
+ uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE_DEHLT, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)CONTEXT_SCENE, 0, 0, "Scene (F10) ");
+
+ xco+= XIC;
+
+ /* select the context to be drawn, per contex/tab the actual context is tested */
+ uiBlockSetEmboss(block, UI_EMBOSS); // normal
+ switch(sbuts->mainb) {
+ case CONTEXT_SCENE:
+ uiBlockBeginAlign(block);
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons ");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SEQUENCE, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SEQUENCER, 0, 0, "Sequencer buttons ");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_ANIM, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_ANIM, 0, 0, "Anim/playback buttons");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SOUND, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SOUND, 0, 0, "Sound block buttons");
+
+ break;
+ case CONTEXT_OBJECT:
+ uiBlockBeginAlign(block);
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_OBJECT, 0, 0, "Object buttons ");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PHYSICS, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PHYSICS, 0, 0, "Physics buttons");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PARTICLES, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PARTICLE, 0, 0, "Particle buttons");
+
+ break;
+ case CONTEXT_SHADING:
+ uiBlockBeginAlign(block);
+ uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_LAMP, 0, 0, "Lamp buttons");
+ uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_MAT, 0, 0, "Material buttons");
+ uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_TEX, 0, 0, "Texture buttons(F6)");
+ uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_RADIO,xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_RAD, 0, 0, "Radiosity buttons");
+ uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_WORLD, xco+=XIC, yco, XIC, YIC, &(sbuts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_WORLD, 0, 0, "World buttons");
+
+ break;
+ case CONTEXT_EDITING:
+
+ break;
+ case CONTEXT_SCRIPT:
+
+ break;
+ case CONTEXT_LOGIC:
+
+ break;
+ }
+
+ uiBlockEndAlign(block);
+
+ xco+=XIC;
+ uiDefButI(block, NUM, B_NEWFRAME, "", (xco+20),yco,60,YIC, &(C->scene->r.cfra), 1.0, MAXFRAMEF, 0, 0, "Displays Current Frame of animation. Click to change.");
+ xco+= 80;
+
+// XXX buttons_active_id(&id, &idfrom);
+// sbuts->lockpoin= id;
+
+
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BIF_butspace.h b/source/blender/editors/space_buttons/buttons_intern.h
index f0b37814947..7c818488265 100644
--- a/source/blender/include/BIF_butspace.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,49 +17,16 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_BUTSPACE_H
-#define BIF_BUTSPACE_H
-
-/* all internal/external calls and event codes for buttons space */
-/* should be split in 2 parts... */
-
-struct Base;
-struct ID;
-
-/* external, butspace.c */
-extern void do_butspace(unsigned short event);
-extern void redraw_test_buttons(struct Object *new);
-
-extern char *image_type_pup(void);
-
-/* buttons_editing.c */
-extern void validate_editbonebutton_cb(void *bonev, void *namev);
-
-/* buts->mainb old */
-#define BUTS_VIEW 0
-#define BUTS_LAMP 1
-#define BUTS_MAT 2
-#define BUTS_TEX 3
-#define BUTS_ANIM 4
-#define BUTS_WORLD 5
-#define BUTS_RENDER 6
-#define BUTS_EDIT 7
-#define BUTS_GAME 8
-#define BUTS_FPAINT 9
-#define BUTS_RADIO 10
-#define BUTS_SCRIPT 11
-#define BUTS_SOUND 12
-#define BUTS_CONSTRAINT 13
-#define BUTS_EFFECTS 14
+#ifndef ED_BUTTONS_INTERN_H
+#define ED_BUTTONS_INTERN_H
/* warning: the values of these defines are used in sbuts->tabs[7] */
/* buts->mainb new */
@@ -103,38 +70,12 @@ extern void validate_editbonebutton_cb(void *bonev, void *namev);
#define BUTS_ACT_STATE 1024
-/* buttons grid */
-#define PANELX 320
-#define PANELY 0
-#define PANELW 318
-#define PANELH 204
-
-#define BUTW1 300
-#define BUTW2 145
-#define BUTW3 93
-#define BUTW4 67
-#define ICONBUTW 20
-#define BUTH 22
-
-#define YSPACE 6
-#define XSPACE 10
-#define PANEL_YMAX 210
-#define PANEL_XMAX 310
-
-#define X1CLM1 10
-
-#define X2CLM1 X1CLM1
-#define X2CLM2 165
-
-#define X3CLM1 X1CLM1
-#define X3CLM2 113
-#define X3CLM3 217
+/* internal exports only */
+
+
+/* image_header.c */
+void buttons_header_buttons(const bContext *C, ARegion *ar);
-#define X4CLM1 X1CLM1
-#define X4CLM2 77
-#define X4CLM3 165
-#define X4CLM4 232
-
-#endif
+#endif /* ED_BUTTONS_INTERN_H */
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
new file mode 100644
index 00000000000..9fc7ca123dc
--- /dev/null
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -0,0 +1,272 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_previewrender.h"
+
+#include "buttons_intern.h" // own include
+
+/* ******************** default callbacks for buttons space ***************** */
+
+static SpaceLink *buttons_new(void)
+{
+ ARegion *ar;
+ SpaceButs *sbuts;
+
+ sbuts= MEM_callocN(sizeof(SpaceButs), "initbuts");
+ sbuts->spacetype= SPACE_BUTS;
+ sbuts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for buts");
+
+ BLI_addtail(&sbuts->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for buts");
+
+ BLI_addtail(&sbuts->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* buts space goes from (0,0) to (1280, 228) */
+
+ sbuts->v2d.tot.xmin= 0.0f;
+ sbuts->v2d.tot.ymin= 0.0f;
+ sbuts->v2d.tot.xmax= 1279.0f;
+ sbuts->v2d.tot.ymax= 228.0f;
+
+ sbuts->v2d.min[0]= 256.0f;
+ sbuts->v2d.min[1]= 42.0f;
+
+ sbuts->v2d.max[0]= 2048.0f;
+ sbuts->v2d.max[1]= 450.0f;
+
+ sbuts->v2d.minzoom= 0.5f;
+ sbuts->v2d.maxzoom= 1.21f;
+
+ sbuts->v2d.scroll= 0; // TODO: will we need scrollbars?
+ sbuts->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
+ sbuts->v2d.keeptot= 1;
+ sbuts->v2d.cur= sbuts->v2d.tot;
+
+
+ return (SpaceLink *)sbuts;
+}
+
+/* not spacelink itself */
+static void buttons_free(SpaceLink *sl)
+{
+ SpaceButs *sbuts= (SpaceButs*) sl;
+
+ if(sbuts->ri) {
+ if (sbuts->ri->rect) MEM_freeN(sbuts->ri->rect);
+ MEM_freeN(sbuts->ri);
+ }
+
+}
+
+
+/* spacetype; init callback */
+static void buttons_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *buttons_duplicate(SpaceLink *sl)
+{
+ SpaceButs *sbutsn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+ sbutsn->ri= NULL;
+
+ return (SpaceLink *)sbutsn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Buttons", SPACE_BUTS, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void buttons_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceButs *sbuts= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void buttons_operatortypes(void)
+{
+
+}
+
+void buttons_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void buttons_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void buttons_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ buttons_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void buttons_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_buttons(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype buttons");
+ ARegionType *art;
+
+ st->spaceid= SPACE_BUTS;
+
+ st->new= buttons_new;
+ st->free= buttons_free;
+ st->init= buttons_init;
+ st->duplicate= buttons_duplicate;
+ st->operatortypes= buttons_operatortypes;
+ st->keymap= buttons_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype buttons region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= buttons_main_area_init;
+ art->draw= buttons_main_area_draw;
+ art->listener= buttons_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype buttons region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= buttons_header_area_init;
+ art->draw= buttons_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype buttons region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= buttons_channel_area_init;
+// art->draw= buttons_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_file/Makefile b/source/blender/editors/space_file/Makefile
new file mode 100644
index 00000000000..5376f01325d
--- /dev/null
+++ b/source/blender/editors/space_file/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_file
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_file/SConscript b/source/blender/editors/space_file/SConscript
new file mode 100644
index 00000000000..832fbc296aa
--- /dev/null
+++ b/source/blender/editors/space_file/SConscript
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../blenloader'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_file', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c
new file mode 100644
index 00000000000..b4f2817d3cb
--- /dev/null
+++ b/source/blender/editors/space_file/file_header.c
@@ -0,0 +1,133 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "file_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+
+static void do_file_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void file_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_file_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
new file mode 100644
index 00000000000..2322c60f9c9
--- /dev/null
+++ b/source/blender/editors/space_file/file_intern.h
@@ -0,0 +1,42 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_FILE_INTERN_H
+#define ED_FILE_INTERN_H
+
+/* internal exports only */
+
+
+/* file_header.c */
+void file_header_buttons(const bContext *C, ARegion *ar);
+
+/* filesel.c */
+
+void freefilelist(SpaceFile *sfile);
+
+#endif /* ED_FILE_INTERN_H */
+
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
new file mode 100644
index 00000000000..36e2bae133b
--- /dev/null
+++ b/source/blender/editors/space_file/filesel.c
@@ -0,0 +1,92 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#ifdef WIN32
+#include <io.h>
+#include <direct.h>
+#include "BLI_winstuff.h"
+#else
+#include <unistd.h>
+#include <sys/times.h>
+#endif
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_linklist.h"
+#include "BLI_storage_types.h"
+#include "BLI_dynstr.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "file_intern.h"
+
+
+void freefilelist(SpaceFile *sfile)
+{
+ int num;
+
+ num= sfile->totfile-1;
+
+ if (sfile->filelist==0) return;
+
+ for(; num>=0; num--){
+ MEM_freeN(sfile->filelist[num].relname);
+
+ if (sfile->filelist[num].string) MEM_freeN(sfile->filelist[num].string);
+ }
+ free(sfile->filelist);
+ sfile->filelist= 0;
+}
+
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
new file mode 100644
index 00000000000..b6d87ee0224
--- /dev/null
+++ b/source/blender/editors/space_file/space_file.c
@@ -0,0 +1,258 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLO_readfile.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "file_intern.h" // own include
+
+/* ******************** default callbacks for file space ***************** */
+
+static SpaceLink *file_new(void)
+{
+ ARegion *ar;
+ SpaceFile *sfile;
+
+ sfile= MEM_callocN(sizeof(SpaceFile), "initfile");
+ sfile->spacetype= SPACE_FILE;
+
+ sfile->dir[0]= '/';
+ sfile->type= FILE_UNIX;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for file");
+
+ BLI_addtail(&sfile->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for file");
+
+ BLI_addtail(&sfile->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)sfile;
+}
+
+/* not spacelink itself */
+static void file_free(SpaceLink *sl)
+{
+ SpaceFile *sfile= (SpaceFile *) sl;
+
+ if(sfile->libfiledata)
+ BLO_blendhandle_close(sfile->libfiledata);
+ if(sfile->filelist)
+ freefilelist(sfile);
+ if(sfile->pupmenu)
+ MEM_freeN(sfile->pupmenu);
+
+}
+
+
+/* spacetype; init callback */
+static void file_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *file_duplicate(SpaceLink *sl)
+{
+ SpaceFile *sfilen= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)sfilen;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void file_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceFile *sfile= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void file_operatortypes(void)
+{
+
+}
+
+void file_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void file_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void file_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ file_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_file(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype file");
+ ARegionType *art;
+
+ st->spaceid= SPACE_FILE;
+
+ st->new= file_new;
+ st->free= file_free;
+ st->init= file_init;
+ st->duplicate= file_duplicate;
+ st->operatortypes= file_operatortypes;
+ st->keymap= file_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= file_main_area_init;
+ art->draw= file_main_area_draw;
+ art->listener= file_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= file_header_area_init;
+ art->draw= file_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= file_channel_area_init;
+// art->draw= file_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_image/Makefile b/source/blender/editors/space_image/Makefile
new file mode 100644
index 00000000000..8110bd1c2a3
--- /dev/null
+++ b/source/blender/editors/space_image/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_image
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript
new file mode 100644
index 00000000000..6ecba4acb03
--- /dev/null
+++ b/source/blender/editors/space_image/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_image', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c
new file mode 100644
index 00000000000..44b068cebc1
--- /dev/null
+++ b/source/blender/editors/space_image/image_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "image_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_image_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void image_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_image_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BIF_drawscript.h b/source/blender/editors/space_image/image_intern.h
index f8b2e5651a7..42187447445 100644
--- a/source/blender/include/BIF_drawscript.h
+++ b/source/blender/editors/space_image/image_intern.h
@@ -1,12 +1,12 @@
/**
- *
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_IMAGE_INTERN_H
+#define ED_IMAGE_INTERN_H
+
+/* internal exports only */
+
-#ifndef BIF_DRAWSCRIPT_H
-#define BIF_DRAWSCRIPT_H
+/* image_header.c */
+void image_header_buttons(const bContext *C, ARegion *ar);
-struct ScrArea;
-struct SpaceScript;
-void free_scriptspace(struct SpaceScript *sc);
+#endif /* ED_IMAGE_INTERN_H */
-#endif /* BIF_DRAWSCRIPT_H */
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
new file mode 100644
index 00000000000..6cefcd8321b
--- /dev/null
+++ b/source/blender/editors/space_image/space_image.c
@@ -0,0 +1,258 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_image_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "image_intern.h" // own include
+
+/* ******************** default callbacks for image space ***************** */
+
+static SpaceLink *image_new(void)
+{
+ ARegion *ar;
+ SpaceImage *simage;
+
+ simage= MEM_callocN(sizeof(SpaceImage), "initimage");
+ simage->spacetype= SPACE_IMAGE;
+ simage->zoom= 1;
+
+ simage->iuser.ok= 1;
+ simage->iuser.fie_ima= 2;
+ simage->iuser.frames= 100;
+
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for image");
+
+ BLI_addtail(&simage->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for image");
+
+ BLI_addtail(&simage->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)simage;
+}
+
+/* not spacelink itself */
+static void image_free(SpaceLink *sl)
+{
+ SpaceImage *simage= (SpaceImage*) sl;
+
+ if(simage->cumap)
+ curvemapping_free(simage->cumap);
+// if(simage->gpd)
+// XXX free_gpencil_data(simage->gpd);
+
+}
+
+
+/* spacetype; init callback */
+static void image_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *image_duplicate(SpaceLink *sl)
+{
+ SpaceImage *simagen= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)simagen;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void image_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Image", SPACE_IMAGE, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void image_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceImage *simage= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void image_operatortypes(void)
+{
+
+}
+
+void image_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void image_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void image_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ image_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void image_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_image(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype image");
+ ARegionType *art;
+
+ st->spaceid= SPACE_IMAGE;
+
+ st->new= image_new;
+ st->free= image_free;
+ st->init= image_init;
+ st->duplicate= image_duplicate;
+ st->operatortypes= image_operatortypes;
+ st->keymap= image_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= image_main_area_init;
+ art->draw= image_main_area_draw;
+ art->listener= image_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= image_header_area_init;
+ art->draw= image_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype image region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= image_channel_area_init;
+// art->draw= image_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_info/Makefile b/source/blender/editors/space_info/Makefile
new file mode 100644
index 00000000000..31401d8f628
--- /dev/null
+++ b/source/blender/editors/space_info/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_info
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_info/SConscript b/source/blender/editors/space_info/SConscript
new file mode 100644
index 00000000000..c967cf9c4b6
--- /dev/null
+++ b/source/blender/editors/space_info/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_info', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c
new file mode 100644
index 00000000000..0ecb0c27b65
--- /dev/null
+++ b/source/blender/editors/space_info/info_header.c
@@ -0,0 +1,155 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "info_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+
+static void do_info_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void info_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_info_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("File");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area, "File", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Add");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area, "Add", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Timeline");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area, "Timeline", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Game");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area, "Game", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Render");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area, "Render", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+ xmax= GetButStringLength("Help");
+ uiDefPulldownBut(block, dummy_viewmenu, NULL, "Help", xco, yco, xmax-3, 22, "");
+ xco+= xmax;
+
+
+
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BIF_editsca.h b/source/blender/editors/space_info/info_intern.h
index bb935ecb2ff..213c0688f20 100644
--- a/source/blender/include/BIF_editsca.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_INFO_INTERN_H
+#define ED_INFO_INTERN_H
+
+/* internal exports only */
+
-#ifndef BIF_EDITSCA_H
-#define BIF_EDITSCA_H
+/* info_header.c */
+void info_header_buttons(const bContext *C, ARegion *ar);
-void make_unique_prop_names(char *str);
-void do_gamebuts(unsigned short event);
-void gamebuts(void);
-#endif
+#endif /* ED_INFO_INTERN_H */
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
new file mode 100644
index 00000000000..7a54297a2f3
--- /dev/null
+++ b/source/blender/editors/space_info/space_info.c
@@ -0,0 +1,235 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "info_intern.h" // own include
+
+/* ******************** default callbacks for info space ***************** */
+
+static SpaceLink *info_new(void)
+{
+ ARegion *ar;
+ SpaceInfo *sinfo;
+
+ sinfo= MEM_callocN(sizeof(SpaceInfo), "initinfo");
+ sinfo->spacetype= SPACE_INFO;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for info");
+
+ BLI_addtail(&sinfo->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for info");
+
+ BLI_addtail(&sinfo->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)sinfo;
+}
+
+/* not spacelink itself */
+static void info_free(SpaceLink *sl)
+{
+// SpaceInfo *sinfo= (SpaceInfo*) sl;
+
+}
+
+
+/* spacetype; init callback */
+static void info_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *info_duplicate(SpaceLink *sl)
+{
+ SpaceInfo *sinfon= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)sinfon;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "info", SPACE_INFO, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void info_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceInfo *sinfo= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void info_operatortypes(void)
+{
+
+}
+
+void info_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void info_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void info_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ info_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_info(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype info");
+ ARegionType *art;
+
+ st->spaceid= SPACE_INFO;
+
+ st->new= info_new;
+ st->free= info_free;
+ st->init= info_init;
+ st->duplicate= info_duplicate;
+ st->operatortypes= info_operatortypes;
+ st->keymap= info_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype info region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= info_main_area_init;
+ art->draw= info_main_area_draw;
+ art->listener= info_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype info region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= info_header_area_init;
+ art->draw= info_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_ipo/Makefile b/source/blender/editors/space_ipo/Makefile
new file mode 100644
index 00000000000..deb61b90362
--- /dev/null
+++ b/source/blender/editors/space_ipo/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_ipo
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_ipo/SConscript b/source/blender/editors/space_ipo/SConscript
new file mode 100644
index 00000000000..801501d635e
--- /dev/null
+++ b/source/blender/editors/space_ipo/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_ipo', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_ipo/ipo_header.c b/source/blender/editors/space_ipo/ipo_header.c
new file mode 100644
index 00000000000..62b553991d6
--- /dev/null
+++ b/source/blender/editors/space_ipo/ipo_header.c
@@ -0,0 +1,131 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ipo_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_ipo_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void ipo_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_ipo_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BIF_writemovie.h b/source/blender/editors/space_ipo/ipo_intern.h
index b2b5ce4f2e9..86b20d4bdd0 100644
--- a/source/blender/include/BIF_writemovie.h
+++ b/source/blender/editors/space_ipo/ipo_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,22 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_IPO_INTERN_H
+#define ED_IPO_INTERN_H
+
+/* internal exports only */
+
-#ifndef BIF_WRITEMOVIE_H
-#define BIF_WRITEMOVIE_H
+/* ipo_header.c */
+void ipo_header_buttons(const bContext *C, ARegion *ar);
-void start_movie(void);
-void append_movie(int fnum);
-void end_movie(void);
-#endif
+#endif /* ED_IPO_INTERN_H */
diff --git a/source/blender/editors/space_ipo/space_ipo.c b/source/blender/editors/space_ipo/space_ipo.c
new file mode 100644
index 00000000000..520a99d166b
--- /dev/null
+++ b/source/blender/editors/space_ipo/space_ipo.c
@@ -0,0 +1,349 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_ipo_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "ipo_intern.h" // own include
+
+/* ******************** default callbacks for ipo space ***************** */
+
+static SpaceLink *ipo_new(void)
+{
+ ARegion *ar;
+ SpaceIpo *sipo;
+
+ sipo= MEM_callocN(sizeof(SpaceIpo), "initipo");
+ sipo->spacetype= SPACE_IPO;
+ sipo->blocktype= ID_OB;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for ipo");
+
+ BLI_addtail(&sipo->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* channels */
+ ar= MEM_callocN(sizeof(ARegion), "main area for ipo");
+
+ BLI_addtail(&sipo->regionbase, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_RIGHT;
+
+ /* XXX view2d init for channels */
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for ipo");
+
+ BLI_addtail(&sipo->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= 0.0f;
+ ar->v2d.tot.ymin= -10.0f;
+ ar->v2d.tot.xmax= 250.0;
+ ar->v2d.tot.ymax= 10.0f;
+
+ ar->v2d.cur= ar->v2d.tot;
+
+ ar->v2d.min[0]= 0.01f;
+ ar->v2d.min[1]= 0.01f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 10000.0f;
+
+ ar->v2d.scroll= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_LEFT);
+
+ ar->v2d.keeptot= 0;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)sipo;
+}
+
+/* not spacelink itself */
+static void ipo_free(SpaceLink *sl)
+{
+ SpaceIpo *si= (SpaceIpo*) sl;
+
+ if(si->editipo) MEM_freeN(si->editipo);
+ // XXX free_ipokey(&si->ipokey);
+
+}
+
+
+/* spacetype; init callback */
+static void ipo_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *ipo_duplicate(SpaceLink *sl)
+{
+ SpaceIpo *sipon= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+ sipon->editipo= NULL;
+ sipon->ipokey.first= sipon->ipokey.last= NULL;
+
+ return (SpaceLink *)sipon;
+}
+
+
+// XXX this should be defined in some general lib for anim editors...
+static void draw_cfra(const bContext *C, SpaceIpo *sipo, View2D *v2d)
+{
+ Scene *scene= C->scene;
+ float vec[2];
+
+ //vec[0] = get_ipo_cfra_from_cfra(sipo, scene->r.cfra);
+ vec[0] = scene->r.cfra;
+ vec[0]*= scene->r.framelen;
+
+ vec[1]= v2d->cur.ymin;
+ UI_ThemeColor(TH_CFRAME);
+ glLineWidth(2.0);
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec);
+ vec[1]= v2d->cur.ymax;
+ glVertex2fv(vec);
+ glEnd();
+
+#if 0
+ if(sipo->blocktype==ID_OB) {
+ ob= (G.scene->basact) ? (G.scene->basact->object) : 0;
+ if (ob && (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0)) {
+ vec[0]-= give_timeoffset(ob);
+
+ UI_ThemeColorShade(TH_HILITE, -30);
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2fv(vec);
+ vec[1]= G.v2d->cur.ymin;
+ glVertex2fv(vec);
+ glEnd();
+ }
+ }
+#endif
+
+ glLineWidth(1.0);
+
+ /* Draw current frame number in a little box */
+ //draw_cfra_number(vec[0]);
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void ipo_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Ipo", SPACE_IPO, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void ipo_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ SpaceIpo *sipo= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ View2DGrid *grid;
+ View2DScrollers *scrollers;
+ float col[3];
+ int unit;
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* grid */
+ unit= (sipo->flag & SIPO_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
+ grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_NOCLAMP, V2D_UNIT_VALUES/*unit-y*/, V2D_GRID_NOCLAMP, ar->winx, ar->winy);
+ UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL);
+ UI_view2d_grid_free(grid);
+
+ /* data... */
+
+ /* current frame */
+ draw_cfra(C, sipo, v2d);
+
+ /* markers */
+ UI_view2d_view_orthoSpecial(C, v2d, 1);
+ draw_markers_time(C, 0);
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers */
+ // FIXME: args for scrollers depend on the type of data being shown...
+ scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_NOCLAMP, V2D_UNIT_VALUES/*unit-y*/, V2D_GRID_NOCLAMP);
+ UI_view2d_scrollers_draw(C, v2d, scrollers);
+ UI_view2d_scrollers_free(scrollers);
+}
+
+void ipo_operatortypes(void)
+{
+}
+
+void ipo_keymap(struct wmWindowManager *wm)
+{
+}
+
+static void ipo_channel_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_SHADE2, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void ipo_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void ipo_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ ipo_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void ipo_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_ipo(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype ipo");
+ ARegionType *art;
+
+ st->spaceid= SPACE_IPO;
+
+ st->new= ipo_new;
+ st->free= ipo_free;
+ st->init= ipo_init;
+ st->duplicate= ipo_duplicate;
+ st->operatortypes= ipo_operatortypes;
+ st->keymap= ipo_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype ipo region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= ipo_main_area_init;
+ art->draw= ipo_main_area_draw;
+ art->listener= ipo_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype ipo region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= ipo_header_area_init;
+ art->draw= ipo_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype ipo region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= ipo_channel_area_init;
+ art->draw= ipo_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_nla/Makefile b/source/blender/editors/space_nla/Makefile
new file mode 100644
index 00000000000..85405a2a3f5
--- /dev/null
+++ b/source/blender/editors/space_nla/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_nla
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript
new file mode 100644
index 00000000000..3be15b917f6
--- /dev/null
+++ b/source/blender/editors/space_nla/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c
new file mode 100644
index 00000000000..47860a71345
--- /dev/null
+++ b/source/blender/editors/space_nla/nla_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "nla_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_nla_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void nla_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_nla_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/playanim_ext.h b/source/blender/editors/space_nla/nla_intern.h
index f2e5ace851f..c544bd9a408 100644
--- a/source/blender/include/playanim_ext.h
+++ b/source/blender/editors/space_nla/nla_intern.h
@@ -1,13 +1,12 @@
-/*
- * external interface
- * $Id$
+/**
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,21 +17,23 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_NLA_INTERN_H
+#define ED_NLA_INTERN_H
+
+/* internal exports only */
+
-#ifndef PLAYANIM_EXT_H
-#define PLAYANIM_EXT_H
+/* nla_header.c */
+void nla_header_buttons(const bContext *C, ARegion *ar);
-/* used in apps */
-extern void playanim(int argc, char **argv);
-#endif
+#endif /* ED_NLA_INTERN_H */
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
new file mode 100644
index 00000000000..2d05bc06c8b
--- /dev/null
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -0,0 +1,275 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_nla_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "nla_intern.h" // own include
+
+/* ******************** default callbacks for nla space ***************** */
+
+static SpaceLink *nla_new(void)
+{
+ ARegion *ar;
+ SpaceNla *snla;
+
+ snla= MEM_callocN(sizeof(SpaceNla), "initnla");
+ snla->spacetype= SPACE_NLA;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for nla");
+
+ BLI_addtail(&snla->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for nla");
+
+ BLI_addtail(&snla->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= 1.0f;
+ ar->v2d.tot.ymin= 0.0f;
+ ar->v2d.tot.xmax= 1000.0f;
+ ar->v2d.tot.ymax= 1000.0f;
+
+ ar->v2d.cur.xmin= -5.0f;
+ ar->v2d.cur.ymin= 0.0f;
+ ar->v2d.cur.xmax= 65.0f;
+ ar->v2d.cur.ymax= 1000.0f;
+
+ ar->v2d.min[0]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 1000.0f;
+
+ ar->v2d.minzoom= 0.1f;
+ ar->v2d.maxzoom= 50.0f;
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
+
+
+ /* channel list region XXX */
+ ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+ BLI_addtail(&snla->regionbase, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+
+
+ return (SpaceLink *)snla;
+}
+
+/* not spacelink itself */
+static void nla_free(SpaceLink *sl)
+{
+// SpaceNla *snla= (SpaceNla*) sl;
+
+}
+
+
+/* spacetype; init callback */
+static void nla_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *nla_duplicate(SpaceLink *sl)
+{
+ SpaceNla *snlan= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)snlan;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void nla_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "NLA", SPACE_NLA, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void nla_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceNla *snla= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void nla_operatortypes(void)
+{
+
+}
+
+void nla_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void nla_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void nla_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ nla_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_nla(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype nla");
+ ARegionType *art;
+
+ st->spaceid= SPACE_NLA;
+
+ st->new= nla_new;
+ st->free= nla_free;
+ st->init= nla_init;
+ st->duplicate= nla_duplicate;
+ st->operatortypes= nla_operatortypes;
+ st->keymap= nla_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype nla region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= nla_main_area_init;
+ art->draw= nla_main_area_draw;
+ art->listener= nla_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype nla region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= nla_header_area_init;
+ art->draw= nla_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype nla region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= nla_channel_area_init;
+// art->draw= nla_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_node/Makefile b/source/blender/editors/space_node/Makefile
new file mode 100644
index 00000000000..d6280dd143c
--- /dev/null
+++ b/source/blender/editors/space_node/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_node
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_node/SConscript b/source/blender/editors/space_node/SConscript
new file mode 100644
index 00000000000..220ac809d4e
--- /dev/null
+++ b/source/blender/editors/space_node/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_node', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
new file mode 100644
index 00000000000..11f8a38ce18
--- /dev/null
+++ b/source/blender/editors/space_node/node_header.c
@@ -0,0 +1,131 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "node_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_node_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void node_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_node_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
new file mode 100644
index 00000000000..8d0e64a679a
--- /dev/null
+++ b/source/blender/editors/space_node/node_intern.h
@@ -0,0 +1,39 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_NODE_INTERN_H
+#define ED_NODE_INTERN_H
+
+/* internal exports only */
+
+
+/* node_header.c */
+void node_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_NODE_INTERN_H */
+
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
new file mode 100644
index 00000000000..6569200196c
--- /dev/null
+++ b/source/blender/editors/space_node/space_node.c
@@ -0,0 +1,269 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_node_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "node_intern.h" // own include
+
+/* ******************** default callbacks for node space ***************** */
+
+static SpaceLink *node_new(void)
+{
+ ARegion *ar;
+ SpaceNode *snode;
+
+ snode= MEM_callocN(sizeof(SpaceNode), "initnode");
+ snode->spacetype= SPACE_NODE;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for node");
+
+ BLI_addtail(&snode->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for node");
+
+ BLI_addtail(&snode->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= -10.0f;
+ ar->v2d.tot.ymin= -10.0f;
+ ar->v2d.tot.xmax= 512.0f;
+ ar->v2d.tot.ymax= 512.0f;
+
+ ar->v2d.cur.xmin= 0.0f;
+ ar->v2d.cur.ymin= 0.0f;
+ ar->v2d.cur.xmax= 512.0f;
+ ar->v2d.cur.ymax= 512.0f;
+
+ ar->v2d.min[0]= 1.0f;
+ ar->v2d.min[1]= 1.0f;
+
+ ar->v2d.max[0]= 32000.0f;
+ ar->v2d.max[1]= 32000.0f;
+
+ ar->v2d.minzoom= 0.5f;
+ ar->v2d.maxzoom= 1.21f;
+
+ ar->v2d.scroll= 0;
+ ar->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
+ ar->v2d.keeptot= 0;
+
+
+ return (SpaceLink *)snode;
+}
+
+/* not spacelink itself */
+static void node_free(SpaceLink *sl)
+{
+// SpaceNode *snode= (SpaceNode*) sl;
+
+// XXX if(snode->gpd) free_gpencil_data(snode->gpd);
+}
+
+
+/* spacetype; init callback */
+static void node_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *node_duplicate(SpaceLink *sl)
+{
+ SpaceNode *snoden= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+ snoden->nodetree= NULL;
+// XXX snoden->gpd= gpencil_data_duplicate(snode->gpd);
+
+ return (SpaceLink *)snoden;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Node", SPACE_NODE, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void node_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceNode *snode= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void node_operatortypes(void)
+{
+
+}
+
+void node_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void node_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void node_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ node_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void node_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_node(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype node");
+ ARegionType *art;
+
+ st->spaceid= SPACE_NODE;
+
+ st->new= node_new;
+ st->free= node_free;
+ st->init= node_init;
+ st->duplicate= node_duplicate;
+ st->operatortypes= node_operatortypes;
+ st->keymap= node_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype node region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= node_main_area_init;
+ art->draw= node_main_area_draw;
+ art->listener= node_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype node region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= node_header_area_init;
+ art->draw= node_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype node region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= node_channel_area_init;
+// art->draw= node_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_outliner/Makefile b/source/blender/editors/space_outliner/Makefile
new file mode 100644
index 00000000000..19d40a4a31e
--- /dev/null
+++ b/source/blender/editors/space_outliner/Makefile
@@ -0,0 +1,54 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_outliner
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_outliner/SConscript b/source/blender/editors/space_outliner/SConscript
new file mode 100644
index 00000000000..f5d6ddc76d3
--- /dev/null
+++ b/source/blender/editors/space_outliner/SConscript
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc ../../makesrna'
+incs += ' #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_outliner', sources, Split(incs), [], libtype=['core', 'intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c
new file mode 100644
index 00000000000..16b64e0a328
--- /dev/null
+++ b/source/blender/editors/space_outliner/outliner_header.c
@@ -0,0 +1,142 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "outliner_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_outliner_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void outliner_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ SpaceOops *soutliner= sa->spacedata.first;
+ uiBlock *block;
+ int xco, yco= 3;
+ char *path;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_outliner_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco += xmax;
+
+ /* header text */
+ xco += XIC*2;
+
+ path= (soutliner->rnapath)? soutliner->rnapath: "Main";
+ xmax= GetButStringLength(path);
+ uiDefBut(block, LABEL, 0, path, xco, yco-2, xmax-3, 24, 0, 0, 0, 0, 0, "Current RNA Path");
+ xco += xmax;
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BIF_outliner.h b/source/blender/editors/space_outliner/outliner_intern.h
index fcd206bb828..50c5156f4df 100644
--- a/source/blender/include/BIF_outliner.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id: BIF_outliner.h
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,18 +17,21 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2004 Blender Foundation.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_OUTLINER_H
-#define BIF_OUTLINER_H
+#ifndef ED_OUTLINER_INTERN_H
+#define ED_OUTLINER_INTERN_H
+
+/* internal exports only */
+
+struct wmWindowManager;
struct TreeStoreElem;
@@ -39,7 +42,7 @@ typedef struct TreeElement {
int store_index; // offset in tree store
short flag, index; // flag for non-saved stuff, index for data arrays
short idcode; // from TreeStore id
- short xend; // width of item display, for select
+ short xend; // width of item display, for select
char *name;
void *directdata; // Armature Bones, Base, Sequence, Strip...
} TreeElement;
@@ -73,7 +76,7 @@ typedef struct TreeElement {
#define TSE_R_LAYER 20
#define TSE_R_PASS 21
#define TSE_LINKED_MAT 22
- /* NOTE, is used for light group */
+/* NOTE, is used for light group */
#define TSE_LINKED_LAMP 23
#define TSE_POSEGRP_BASE 24
#define TSE_POSEGRP 25
@@ -90,22 +93,14 @@ typedef struct TreeElement {
/* button events */
#define OL_NAMEBUTTON 1
-extern void draw_outliner(struct ScrArea *sa, struct SpaceOops *so);
-extern void outliner_free_tree(struct ListBase *lb);
-extern void outliner_mouse_event(struct ScrArea *sa, short event);
-extern void outliner_toggle_visible(struct ScrArea *sa);
-extern void outliner_show_active(struct ScrArea *sa);
-extern void outliner_show_hierarchy(struct ScrArea *sa);
-extern void outliner_one_level(struct ScrArea *sa, int add);
-extern void outliner_select(struct ScrArea *sa);
-extern void outliner_toggle_selected(struct ScrArea *sa);
-extern void outliner_toggle_visibility(struct ScrArea *sa);
-extern void outliner_toggle_selectability(struct ScrArea *sa);
-extern void outliner_toggle_renderability(struct ScrArea *sa);
-extern void outliner_del(struct ScrArea *sa);
-extern void outliner_operation_menu(struct ScrArea *sa);
-extern void outliner_page_up_down(struct ScrArea *sa, int up);
-extern void outliner_find_panel(struct ScrArea *sa, int again, int flags);
-#endif
+/* outliner_ops.c */
+void outliner_operatortypes(void);
+void outliner_keymap(struct wmWindowManager *wm);
+
+/* outliner_header.c */
+void outliner_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_OUTLINER_INTERN_H */
diff --git a/source/blender/include/BIF_keyval.h b/source/blender/editors/space_outliner/outliner_ops.c
index 9693684e425..c512b495a5c 100644
--- a/source/blender/include/BIF_keyval.h
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,23 +17,26 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_KEYVAL_H
-#define BIF_KEYVAL_H
+#include <stdlib.h>
-char *key_event_to_string(unsigned short event);
-int decode_key_string(char *str, unsigned short *key, unsigned short *qual);
+#include "DNA_windowmanager_types.h"
-#endif
+/* ************************** registration **********************************/
+void outliner_operatortypes(void)
+{
+}
+void outliner_keymap(wmWindowManager *wm)
+{
+}
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
new file mode 100644
index 00000000000..923710d22b3
--- /dev/null
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -0,0 +1,596 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_color_types.h"
+#include "DNA_object_types.h"
+#include "DNA_oops_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_vec_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+#include "BKE_texture.h"
+#include "BKE_utildefines.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_text.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "RNA_access.h"
+#include "RNA_types.h"
+
+#include "outliner_intern.h"
+
+#define SET_INT_IN_POINTER(i) ((void*)(intptr_t)(i))
+#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
+
+#define ROW_HEIGHT 19
+#define COLUMN_WIDTH 150
+
+typedef void (*uiTableCellFunc)(void *userdata, int row, int col, struct rcti *rct, struct uiBlock *block);
+
+typedef struct uiTable {
+ rcti rct;
+ int rows, cols;
+
+ uiTableCellFunc cellfunc;
+ void *userdata;
+} uiTable;
+
+uiTable *UI_table_create(int rows, int cols, rcti *rct, uiTableCellFunc cellfunc, void *userdata)
+{
+ uiTable *table;
+
+ table= MEM_callocN(sizeof(uiTable), "uiTable");
+ table->rct= *rct;
+ table->cellfunc= cellfunc;
+ table->rows= rows;
+ table->cols= cols;
+ table->userdata= userdata;
+
+ return table;
+}
+
+void UI_table_free(uiTable *table)
+{
+ MEM_freeN(table);
+}
+
+void UI_table_draw(const bContext *C, uiTable *table)
+{
+ uiBlock *block;
+ View2D *v2d;
+ rcti *rct, cellrct;
+ int y, row, col;
+
+ v2d= &C->region->v2d;
+ rct= &table->rct;
+
+ block= uiBeginBlock(C, C->region, "table outliner", UI_EMBOSST, UI_HELV);
+
+ for(y=rct->ymax, row=0; y>rct->ymin; y-=ROW_HEIGHT, row++) {
+ if(row%2 == 0) {
+ UI_ThemeColorShade(TH_BACK, 6);
+ glRecti(v2d->cur.xmin, y-ROW_HEIGHT, v2d->cur.xmax, y);
+ }
+
+ if(row >= table->rows)
+ continue;
+
+ for(col=0; col<table->cols; col++) {
+ cellrct.xmin= rct->xmin+COLUMN_WIDTH*col + 1;
+ cellrct.xmax= rct->xmin+COLUMN_WIDTH*(col+1);
+ cellrct.ymin= y-ROW_HEIGHT;
+ cellrct.ymax= y;
+
+ table->cellfunc(table->userdata, row, col, &cellrct, block);
+ }
+ }
+
+ UI_ThemeColorShadeAlpha(TH_BACK, -15, -200);
+
+ for(col=0; col<table->cols; col++)
+ fdrawline(rct->xmin+COLUMN_WIDTH*(col+1), rct->ymin, rct->xmin+COLUMN_WIDTH*(col+1), rct->ymax);
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
+/* ************************ main outliner area region *********************** */
+
+typedef struct CellRNA {
+ SpaceOops *space;
+ StructRNA *srna;
+ PropertyRNA *prop;
+ PointerRNA ptr;
+ int lastrow, index;
+
+ CollectionPropertyIterator iter;
+} CellRNA;
+
+static void rna_back_cb(bContext *C, void *arg_unused, void *arg_unused2)
+{
+ SpaceOops *soutliner= C->area->spacedata.first;
+ char *newpath;
+
+ newpath= RNA_path_back(soutliner->rnapath);
+ if(soutliner->rnapath)
+ MEM_freeN(soutliner->rnapath);
+ soutliner->rnapath= newpath;
+}
+
+static void rna_pointer_cb(bContext *C, void *arg_prop, void *arg_index)
+{
+ SpaceOops *soutliner= C->area->spacedata.first;
+ PropertyRNA *prop= arg_prop;
+ char *newpath;
+ int index= GET_INT_FROM_POINTER(arg_index);;
+
+ newpath= RNA_path_append(soutliner->rnapath, NULL, prop, index, NULL);
+ if(soutliner->rnapath)
+ MEM_freeN(soutliner->rnapath);
+ soutliner->rnapath= newpath;
+}
+
+static void rna_label(CellRNA *cell, rcti *rct, uiBlock *block)
+{
+ PropertySubType subtype;
+ PropertyType type;
+ PropertyRNA *prop;
+ char *vectoritem[4]= {"x", "y", "z", "w"};
+ char *quatitem[4]= {"w", "x", "y", "z"};
+ char *coloritem[4]= {"r", "g", "b", "a"};
+ char item[32];
+ int arraylength;
+
+ prop= cell->prop;
+ type= RNA_property_type(&cell->ptr, prop);
+ subtype= RNA_property_subtype(&cell->ptr, prop);
+ arraylength= RNA_property_array_length(&cell->ptr, prop);
+
+ if(cell->index == -1) {
+ uiDefBut(block, LABEL, 0, (char*)RNA_property_ui_name(&cell->ptr, prop), rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, (char*)RNA_property_ui_description(&cell->ptr, prop));
+ }
+ else if (type != PROP_COLLECTION) {
+ if(arraylength == 4 && subtype == PROP_ROTATION)
+ sprintf(item, " %s", quatitem[cell->index]);
+ else if(arraylength <= 4 && (subtype == PROP_VECTOR || subtype == PROP_ROTATION))
+ sprintf(item, " %s", vectoritem[cell->index]);
+ else if(arraylength <= 4 && subtype == PROP_COLOR)
+ sprintf(item, " %s", coloritem[cell->index]);
+ else
+ sprintf(item, " %d", cell->index+1);
+
+ uiDefBut(block, LABEL, 0, item, rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, "");
+ }
+}
+
+static void rna_collection_but(CellRNA *cell, rcti *rct, uiBlock *block)
+{
+ uiBut *but;
+ PointerRNA lookup;
+ PropertyRNA *nameprop;
+ char name[256]= "", *nameptr= name;
+
+ RNA_property_collection_lookup_int(&cell->ptr, cell->prop, cell->index, &lookup);
+
+ if(lookup.data) {
+ nameprop= RNA_struct_name_property(&lookup);
+
+ if(nameprop)
+ nameptr= RNA_property_string_get_alloc(&lookup, nameprop, name, sizeof(name));
+ else
+ sprintf(nameptr, "%d", cell->index+1);
+ }
+
+ but= uiDefBut(block, BUT, 0, nameptr, rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, "");
+ uiButSetFlag(but, UI_TEXT_LEFT);
+
+ if(nameptr != name)
+ MEM_freeN(nameptr);
+
+ uiButSetFunc(but, rna_pointer_cb, cell->prop, SET_INT_IN_POINTER(cell->index));
+}
+
+static void rna_but(CellRNA *cell, rcti *rct, uiBlock *block)
+{
+ uiBut *but;
+ PropertyRNA *prop;
+ PropertyType type;
+ int arraylength, index;
+
+ prop= cell->prop;
+ type= RNA_property_type(&cell->ptr, prop);
+ arraylength= RNA_property_array_length(&cell->ptr, prop);
+
+ if(type == PROP_COLLECTION) {
+ /* item in a collection */
+ if(cell->index >= 0)
+ rna_collection_but(cell, rct, block);
+ }
+ else {
+ /* other cases */
+ index= (arraylength)? cell->index: 0;
+
+ if(index >= 0) {
+ but= uiDefRNABut(block, 0, &cell->ptr, prop, index, rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin);
+
+ if(type == PROP_POINTER)
+ uiButSetFunc(but, rna_pointer_cb, prop, SET_INT_IN_POINTER(0));
+ }
+ }
+}
+
+static void rna_path_but(CellRNA *cell, rcti *rct, uiBlock *block)
+{
+ uiBut *but;
+
+ but= uiDefBut(block, BUT, 0, (cell->space->rnapath)? "..": ".", rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, "");
+ uiButSetFlag(but, UI_TEXT_LEFT);
+ uiButSetFunc(but, rna_back_cb, cell->space, NULL);
+}
+
+static void rna_table_cell_func(void *userdata, int row, int col, rcti *rct, uiBlock *block)
+{
+ CellRNA *cell= userdata;
+ PropertyType type;
+ int length;
+
+ /* path button */
+ if(row == 0) {
+ if(col == 0)
+ rna_path_but(cell, rct, block);
+
+ return;
+ }
+
+ /* set next property for new row */
+ if(row != cell->lastrow) {
+ if(cell->prop) {
+ cell->index++;
+
+ type= RNA_property_type(&cell->ptr, cell->prop);
+ if(type == PROP_COLLECTION)
+ length= RNA_property_collection_length(&cell->ptr, cell->prop);
+ else
+ length= RNA_property_array_length(&cell->ptr, cell->prop);
+
+ /* verify if we need to go to the next property */
+ if(type == PROP_COLLECTION && cell->index < length);
+ else if(length && cell->index < length);
+ else {
+ RNA_property_collection_next(&cell->iter);
+ cell->prop= cell->iter.ptr.data;
+ cell->index= -1;
+ }
+ }
+ else {
+ /* initialize */
+ cell->prop= cell->iter.ptr.data;
+ cell->index= -1;
+ }
+
+ cell->lastrow= row;
+ }
+
+ /* make button */
+ if(col == 0)
+ rna_label(cell, rct, block);
+ else if(col == 1)
+ rna_but(cell, rct, block);
+}
+
+static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+}
+
+static void outliner_main_area_draw(const bContext *C, ARegion *ar)
+{
+ uiTable *table;
+ rcti rct;
+ CellRNA cell;
+ PropertyRNA *prop, *iterprop;
+ PointerRNA newptr;
+ float col[3];
+ int rows, cols, awidth, aheight, width, height;
+ SpaceOops *soutliner= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ View2DScrollers *scrollers;
+
+ /* clear */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ awidth= width= ar->winx;
+ aheight= height= ar->winy;
+
+ /* create table */
+ cell.space= soutliner;
+ cell.lastrow= -1;
+ RNA_main_pointer_create(G.main, &cell.ptr);
+ cell.prop= NULL;
+
+ /* solve RNA path or reset if fails */
+ if(soutliner->rnapath) {
+ if(!RNA_path_resolve(&cell.ptr, soutliner->rnapath, &newptr, &prop)) {
+ newptr.data= NULL;
+ printf("RNA outliner: failed resolving path. (%s)\n", soutliner->rnapath);
+ }
+
+ if(newptr.data && newptr.type) {
+ cell.ptr= newptr;
+ }
+ else {
+ MEM_freeN(soutliner->rnapath);
+ soutliner->rnapath= NULL;
+ }
+ }
+
+ /* compute number of rows and columns */
+ rows= 1;
+ cols= 2;
+
+ iterprop= RNA_struct_iterator_property(&cell.ptr);
+ RNA_property_collection_begin(&cell.ptr, iterprop, &cell.iter);
+
+ for(; cell.iter.valid; RNA_property_collection_next(&cell.iter)) {
+ prop= cell.iter.ptr.data;
+
+ rows += 1 + RNA_property_array_length(&cell.ptr, prop);
+ if(RNA_property_type(&cell.ptr, prop) == PROP_COLLECTION)
+ rows += RNA_property_collection_length(&cell.ptr, prop);
+ }
+
+ RNA_property_collection_end(&cell.iter);
+
+ /* determine extents of data
+ * - height must be at least the height of the mask area
+ * - width is columns + 1, as otherwise, part of last column
+ * will be obscured by scrollers
+ */
+ if ((rows*ROW_HEIGHT) > height)
+ height= rows * ROW_HEIGHT;
+ width= (cols + 1) * COLUMN_WIDTH;
+
+ /* update size of tot-rect (extents of data/viewable area) */
+ UI_view2d_totRect_set(v2d, width, height);
+
+ rct.xmin= 0;
+ rct.ymin= -height;
+ rct.xmax= width;
+ rct.ymax= 0;
+
+ /* set matrix for 2d-view controls */
+ UI_view2d_view_ortho(C, v2d);
+
+ /* create and draw table */
+ table= UI_table_create(rows, 2, &rct, rna_table_cell_func, &cell);
+
+ RNA_property_collection_begin(&cell.ptr, iterprop, &cell.iter);
+ UI_table_draw(C, table);
+ RNA_property_collection_end(&cell.iter);
+
+ UI_table_free(table);
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers */
+ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ UI_view2d_scrollers_draw(C, v2d, scrollers);
+ UI_view2d_scrollers_free(scrollers);
+}
+
+static void outliner_main_area_free(ARegion *ar)
+{
+}
+
+/* ************************ header outliner area region *********************** */
+
+
+static void outliner_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ outliner_header_buttons(C, ar);
+}
+
+static void outliner_header_area_free(ARegion *ar)
+{
+}
+
+/* ******************** default callbacks for outliner space ***************** */
+
+static SpaceLink *outliner_new(void)
+{
+ ARegion *ar;
+ SpaceOops *soutliner;
+
+ soutliner= MEM_callocN(sizeof(SpaceOops), "initoutliner");
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for outliner");
+
+ BLI_addtail(&soutliner->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for outliner");
+
+ BLI_addtail(&soutliner->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O);
+ ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ ar->v2d.keeptot= 2; /* XXX make define */
+
+ return (SpaceLink*)soutliner;
+}
+
+static void free_oops(Oops *oops) /* also oops itself */
+{
+ BLI_freelistN(&oops->link);
+ MEM_freeN(oops);
+}
+
+static void outliner_free_tree(ListBase *lb)
+{
+
+ while(lb->first) {
+ TreeElement *te= lb->first;
+
+ outliner_free_tree(&te->subtree);
+ BLI_remlink(lb, te);
+ MEM_freeN(te);
+ }
+}
+
+/* not spacelink itself */
+static void outliner_free(SpaceLink *sl)
+{
+ SpaceOops *soutliner= (SpaceOops*)sl;
+ Oops *oops;
+
+ if(soutliner->rnapath) {
+ MEM_freeN(soutliner->rnapath);
+ soutliner->rnapath= NULL;
+ }
+
+ while( (oops= soutliner->oops.first) ) {
+ BLI_remlink(&soutliner->oops, oops);
+ free_oops(oops);
+ }
+
+ outliner_free_tree(&soutliner->tree);
+ if(soutliner->treestore) {
+ if(soutliner->treestore->data) MEM_freeN(soutliner->treestore->data);
+ MEM_freeN(soutliner->treestore);
+ }
+
+}
+
+/* spacetype; init callback */
+static void outliner_init(wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *outliner_duplicate(SpaceLink *sl)
+{
+ SpaceOops *soutliner= (SpaceOops *)sl;
+ SpaceOops *soutlinern= MEM_dupallocN(soutliner);
+
+ if(soutlinern->rnapath)
+ soutlinern->rnapath= MEM_dupallocN(soutlinern->rnapath);
+
+ soutlinern->oops.first= soutlinern->oops.last= NULL;
+ soutlinern->tree.first= soutlinern->tree.last= NULL;
+ soutlinern->treestore= NULL;
+
+ return (SpaceLink *)soutlinern;
+}
+
+/* only called once, from space_api/spacetypes.c */
+void ED_spacetype_outliner(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype time");
+ ARegionType *art;
+
+ st->spaceid= SPACE_OOPS;
+ strncpy(st->name, "Outliner", BKE_ST_MAXNAME);
+
+ st->new= outliner_new;
+ st->free= outliner_free;
+ st->init= outliner_init;
+ st->duplicate= outliner_duplicate;
+ st->operatortypes= outliner_operatortypes;
+ st->keymap= outliner_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= outliner_main_area_init;
+ art->draw= outliner_main_area_draw;
+ art->free= outliner_main_area_free;
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI;
+
+ art->draw= outliner_header_area_draw;
+ art->free= outliner_header_area_free;
+ BLI_addhead(&st->regiontypes, art);
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_script/Makefile b/source/blender/editors/space_script/Makefile
new file mode 100644
index 00000000000..4d5d3e54167
--- /dev/null
+++ b/source/blender/editors/space_script/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_script
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_script/SConscript b/source/blender/editors/space_script/SConscript
new file mode 100644
index 00000000000..1bea5b3f3b8
--- /dev/null
+++ b/source/blender/editors/space_script/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_script', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c
new file mode 100644
index 00000000000..c50fb58697c
--- /dev/null
+++ b/source/blender/editors/space_script/script_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "script_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_script_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void script_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_script_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h
new file mode 100644
index 00000000000..ede9d8468cb
--- /dev/null
+++ b/source/blender/editors/space_script/script_intern.h
@@ -0,0 +1,39 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SCRIPT_INTERN_H
+#define ED_SCRIPT_INTERN_H
+
+/* internal exports only */
+
+
+/* script_header.c */
+void script_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_SCRIPT_INTERN_H */
+
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
new file mode 100644
index 00000000000..081da6f5505
--- /dev/null
+++ b/source/blender/editors/space_script/space_script.c
@@ -0,0 +1,245 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "script_intern.h" // own include
+
+/* ******************** default callbacks for script space ***************** */
+
+static SpaceLink *script_new(void)
+{
+ ARegion *ar;
+ SpaceScript *sscript;
+
+ sscript= MEM_callocN(sizeof(SpaceScript), "initscript");
+ sscript->spacetype= SPACE_SCRIPT;
+
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for script");
+
+ BLI_addtail(&sscript->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for script");
+
+ BLI_addtail(&sscript->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)sscript;
+}
+
+/* not spacelink itself */
+static void script_free(SpaceLink *sl)
+{
+ SpaceScript *sscript= (SpaceScript*) sl;
+
+#ifndef DISABLE_PYTHON
+ /*free buttons references*/
+ if (sscript->but_refs) {
+// XXX BPy_Set_DrawButtonsList(sscript->but_refs);
+// BPy_Free_DrawButtonsList();
+ sscript->but_refs = NULL;
+ }
+#endif
+ sscript->script = NULL;
+}
+
+
+/* spacetype; init callback */
+static void script_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *script_duplicate(SpaceLink *sl)
+{
+ SpaceScript *sscriptn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)sscriptn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void script_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Script", SPACE_SCRIPT, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void script_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceScript *sscript= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void script_operatortypes(void)
+{
+
+}
+
+void script_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void script_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void script_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ script_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void script_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_script(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype script");
+ ARegionType *art;
+
+ st->spaceid= SPACE_SCRIPT;
+
+ st->new= script_new;
+ st->free= script_free;
+ st->init= script_init;
+ st->duplicate= script_duplicate;
+ st->operatortypes= script_operatortypes;
+ st->keymap= script_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype script region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= script_main_area_init;
+ art->draw= script_main_area_draw;
+ art->listener= script_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype script region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= script_header_area_init;
+ art->draw= script_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_sequencer/Makefile b/source/blender/editors/space_sequencer/Makefile
new file mode 100644
index 00000000000..f6f837a107a
--- /dev/null
+++ b/source/blender/editors/space_sequencer/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_sequencer
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_sequencer/SConscript b/source/blender/editors/space_sequencer/SConscript
new file mode 100644
index 00000000000..33e389c880e
--- /dev/null
+++ b/source/blender/editors/space_sequencer/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_sequencer/sequencer_header.c b/source/blender/editors/space_sequencer/sequencer_header.c
new file mode 100644
index 00000000000..d732a09ac8d
--- /dev/null
+++ b/source/blender/editors/space_sequencer/sequencer_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "sequencer_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_sequencer_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void sequencer_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_sequencer_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
new file mode 100644
index 00000000000..d3eb681686b
--- /dev/null
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -0,0 +1,41 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SEQUENCER_INTERN_H
+#define ED_SEQUENCER_INTERN_H
+
+#define MAXSEQ 32
+
+/* internal exports only */
+
+
+/* sequencer_header.c */
+void sequencer_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_SEQUENCER_INTERN_H */
+
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
new file mode 100644
index 00000000000..fc45b06e3c7
--- /dev/null
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -0,0 +1,264 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "sequencer_intern.h" // own include
+
+/* ******************** default callbacks for sequencer space ***************** */
+
+static SpaceLink *sequencer_new(void)
+{
+ ARegion *ar;
+ SpaceSeq *sseq;
+
+ sseq= MEM_callocN(sizeof(SpaceSeq), "initsequencer");
+ sseq->spacetype= SPACE_SEQ;
+ sseq->zoom= 4;
+ sseq->chanshown = 0;
+
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for sequencer");
+
+ BLI_addtail(&sseq->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for sequencer");
+
+ BLI_addtail(&sseq->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+
+ /* seq space goes from (0,8) to (250, 0) */
+
+ ar->v2d.tot.xmin= 0.0f;
+ ar->v2d.tot.ymin= 0.0f;
+ ar->v2d.tot.xmax= 250.0f;
+ ar->v2d.tot.ymax= 8.0f;
+
+ ar->v2d.cur= ar->v2d.tot;
+
+ ar->v2d.min[0]= 10.0f;
+ ar->v2d.min[1]= 4.0f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= MAXSEQ;
+
+ ar->v2d.minzoom= 0.01f;
+ ar->v2d.maxzoom= 100.0f;
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_SCALE_RIGHT);
+ ar->v2d.keepzoom= 0;
+ ar->v2d.keeptot= 0;
+
+
+
+ return (SpaceLink *)sseq;
+}
+
+/* not spacelink itself */
+static void sequencer_free(SpaceLink *sl)
+{
+// SpaceSeq *sseq= (SpaceSequencer*) sl;
+
+// XXX if(sseq->gpd) free_gpencil_data(sseq->gpd);
+
+}
+
+
+/* spacetype; init callback */
+static void sequencer_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *sequencer_duplicate(SpaceLink *sl)
+{
+ SpaceSeq *sseqn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+// XXX sseq->gpd= gpencil_data_duplicate(sseq->gpd);
+
+ return (SpaceLink *)sseqn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Sequencer", SPACE_SEQ, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void sequencer_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceSeq *sseq= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void sequencer_operatortypes(void)
+{
+
+}
+
+void sequencer_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void sequencer_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void sequencer_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ sequencer_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_sequencer(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype sequencer");
+ ARegionType *art;
+
+ st->spaceid= SPACE_SEQ;
+
+ st->new= sequencer_new;
+ st->free= sequencer_free;
+ st->init= sequencer_init;
+ st->duplicate= sequencer_duplicate;
+ st->operatortypes= sequencer_operatortypes;
+ st->keymap= sequencer_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= sequencer_main_area_init;
+ art->draw= sequencer_main_area_draw;
+ art->listener= sequencer_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= sequencer_header_area_init;
+ art->draw= sequencer_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_sound/Makefile b/source/blender/editors/space_sound/Makefile
new file mode 100644
index 00000000000..9b1e95bf3a6
--- /dev/null
+++ b/source/blender/editors/space_sound/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_sound
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_sound/SConscript b/source/blender/editors/space_sound/SConscript
new file mode 100644
index 00000000000..0a45072ca49
--- /dev/null
+++ b/source/blender/editors/space_sound/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_sound', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_sound/sound_header.c b/source/blender/editors/space_sound/sound_header.c
new file mode 100644
index 00000000000..a8121fdd179
--- /dev/null
+++ b/source/blender/editors/space_sound/sound_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "sound_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_sound_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void sound_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_sound_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_sound/sound_intern.h b/source/blender/editors/space_sound/sound_intern.h
new file mode 100644
index 00000000000..3b6d2c456bc
--- /dev/null
+++ b/source/blender/editors/space_sound/sound_intern.h
@@ -0,0 +1,39 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_SOUND_INTERN_H
+#define ED_SOUND_INTERN_H
+
+/* internal exports only */
+
+
+/* sound_header.c */
+void sound_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_SOUND_INTERN_H */
+
diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c
new file mode 100644
index 00000000000..787d8663488
--- /dev/null
+++ b/source/blender/editors/space_sound/space_sound.c
@@ -0,0 +1,270 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_sound_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "sound_intern.h" // own include
+
+/* ******************** default callbacks for sound space ***************** */
+
+static SpaceLink *sound_new(void)
+{
+ ARegion *ar;
+ SpaceSound *ssound;
+
+ ssound= MEM_callocN(sizeof(SpaceSound), "initsound");
+ ssound->spacetype= SPACE_SOUND;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for sound");
+
+ BLI_addtail(&ssound->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for sound");
+
+ BLI_addtail(&ssound->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= -4.0f;
+ ar->v2d.tot.ymin= -4.0f;
+ ar->v2d.tot.xmax= 250.0f;
+ ar->v2d.tot.ymax= 255.0f;
+
+ ar->v2d.cur.xmin= -4.0f;
+ ar->v2d.cur.ymin= -4.0f;
+ ar->v2d.cur.xmax= 50.0f;
+ ar->v2d.cur.ymax= 255.0f;
+
+ ar->v2d.min[0]= 1.0f;
+ ar->v2d.min[1]= 259.0f;
+
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 259.0f;
+
+ ar->v2d.minzoom= 0.1f;
+ ar->v2d.maxzoom= 10.0f;
+
+ ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.scroll |= (V2D_SCROLL_LEFT);
+ ar->v2d.keepzoom= 0;
+ ar->v2d.keeptot= 0;
+
+
+ return (SpaceLink *)ssound;
+}
+
+/* not spacelink itself */
+static void sound_free(SpaceLink *sl)
+{
+// SpaceSound *ssound= (SpaceSound*) sl;
+
+
+}
+
+
+/* spacetype; init callback */
+static void sound_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *sound_duplicate(SpaceLink *sl)
+{
+ SpaceSound *ssoundn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)ssoundn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void sound_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Sound", SPACE_SOUND, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void sound_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceSound *ssound= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void sound_operatortypes(void)
+{
+
+}
+
+void sound_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void sound_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void sound_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ sound_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void sound_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_sound(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype sound");
+ ARegionType *art;
+
+ st->spaceid= SPACE_SOUND;
+
+ st->new= sound_new;
+ st->free= sound_free;
+ st->init= sound_init;
+ st->duplicate= sound_duplicate;
+ st->operatortypes= sound_operatortypes;
+ st->keymap= sound_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype sound region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= sound_main_area_init;
+ art->draw= sound_main_area_draw;
+ art->listener= sound_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype sound region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= sound_header_area_init;
+ art->draw= sound_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: channels */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype sound region");
+ art->regionid = RGN_TYPE_CHANNELS;
+ art->minsizex= 80;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+// art->init= sound_channel_area_init;
+// art->draw= sound_channel_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_text/Makefile b/source/blender/editors/space_text/Makefile
new file mode 100644
index 00000000000..fb685389d56
--- /dev/null
+++ b/source/blender/editors/space_text/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_text
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_text/SConscript b/source/blender/editors/space_text/SConscript
new file mode 100644
index 00000000000..db6fcd6b64c
--- /dev/null
+++ b/source/blender/editors/space_text/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_text', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
new file mode 100644
index 00000000000..54ec53b2434
--- /dev/null
+++ b/source/blender/editors/space_text/space_text.c
@@ -0,0 +1,238 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_text_types.h"
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_colortools.h"
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "text_intern.h" // own include
+
+/* ******************** default callbacks for text space ***************** */
+
+static SpaceLink *text_new(void)
+{
+ ARegion *ar;
+ SpaceText *stext;
+
+ stext= MEM_callocN(sizeof(SpaceText), "inittext");
+ stext->spacetype= SPACE_TEXT;
+
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for text");
+
+ BLI_addtail(&stext->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for text");
+
+ BLI_addtail(&stext->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ /* channel list region XXX */
+
+
+ return (SpaceLink *)stext;
+}
+
+/* not spacelink itself */
+static void text_free(SpaceLink *sl)
+{
+ SpaceText *stext= (SpaceText*) sl;
+
+ stext->text= NULL;
+}
+
+
+/* spacetype; init callback */
+static void text_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *text_duplicate(SpaceLink *sl)
+{
+ SpaceText *stextn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+ return (SpaceLink *)stextn;
+}
+
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "Text", SPACE_TEXT, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+static void text_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceText *stext= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
+
+void text_operatortypes(void)
+{
+
+}
+
+void text_keymap(struct wmWindowManager *wm)
+{
+
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void text_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void text_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ text_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+static void text_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_text(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype text");
+ ARegionType *art;
+
+ st->spaceid= SPACE_TEXT;
+
+ st->new= text_new;
+ st->free= text_free;
+ st->init= text_init;
+ st->duplicate= text_duplicate;
+ st->operatortypes= text_operatortypes;
+ st->keymap= text_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->init= text_main_area_init;
+ art->draw= text_main_area_draw;
+ art->listener= text_main_area_listener;
+ art->keymapflag= ED_KEYMAP_VIEW2D;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= text_header_area_init;
+ art->draw= text_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
new file mode 100644
index 00000000000..3ef7522d477
--- /dev/null
+++ b/source/blender/editors/space_text/text_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "text_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+static void do_text_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void text_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_text_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ xco+=XIC+xmax;
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h
new file mode 100644
index 00000000000..9fb2f0e07c3
--- /dev/null
+++ b/source/blender/editors/space_text/text_intern.h
@@ -0,0 +1,39 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef ED_TEXT_INTERN_H
+#define ED_TEXT_INTERN_H
+
+/* internal exports only */
+
+
+/* text_header.c */
+void text_header_buttons(const bContext *C, ARegion *ar);
+
+
+#endif /* ED_TEXT_INTERN_H */
+
diff --git a/source/blender/editors/space_time/Makefile b/source/blender/editors/space_time/Makefile
new file mode 100644
index 00000000000..20877b48559
--- /dev/null
+++ b/source/blender/editors/space_time/Makefile
@@ -0,0 +1,54 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_time
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_time/SConscript b/source/blender/editors/space_time/SConscript
new file mode 100644
index 00000000000..5295aa25e28
--- /dev/null
+++ b/source/blender/editors/space_time/SConscript
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+incs += ' ../../makesrna'
+
+env.BlenderLib ( 'bf_editors_space_time', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_time/ed_markers.c b/source/blender/editors/space_time/ed_markers.c
new file mode 100644
index 00000000000..deb56b286b4
--- /dev/null
+++ b/source/blender/editors/space_time/ed_markers.c
@@ -0,0 +1,851 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_view2d_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
+#include "UI_view2d.h"
+#include "UI_resources.h"
+#include "UI_text.h"
+
+#include "ED_markers.h"
+#include "ED_screen.h"
+#include "ED_types.h"
+#include "ED_util.h"
+
+/* ************* Marker API **************** */
+
+static ListBase *context_get_markers(const bContext *C)
+{
+
+#if 0
+ /* XXX get them from pose */
+ if ((slink->spacetype == SPACE_ACTION) && (saction->flag & SACTION_POSEMARKERS_MOVE)) {
+ if (saction->action)
+ markers= &saction->action->markers;
+ else
+ markers= NULL;
+ }
+ else
+#endif
+
+ return &C->scene->markers;
+}
+
+/* ************* Marker Drawing ************ */
+
+/* XXX */
+extern void ui_rasterpos_safe(float x, float y, float aspect);
+
+/* function to draw markers */
+static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
+{
+ float xpos, ypixels, xscale, yscale;
+ int icon_id= 0;
+
+ xpos = marker->frame;
+ /* no time correction for framelen! space is drawn with old values */
+
+ ypixels= v2d->mask.ymax-v2d->mask.ymin;
+ UI_view2d_getscale(v2d, &xscale, &yscale);
+
+ glScalef(1.0/xscale, 1.0, 1.0);
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ /* verticle line */
+ if (flag & DRAW_MARKERS_LINES) {
+ setlinestyle(3);
+ if(marker->flag & SELECT)
+ glColor4ub(255,255,255, 96);
+ else
+ glColor4ub(0,0,0, 96);
+
+ glBegin(GL_LINES);
+ glVertex2f((xpos*xscale)+0.5, 12);
+ glVertex2f((xpos*xscale)+0.5, 34*yscale); /* a bit lazy but we know it cant be greater then 34 strips high*/
+ glEnd();
+ setlinestyle(0);
+ }
+
+ /* 5 px to offset icon to align properly, space / pixels corrects for zoom */
+ if (flag & DRAW_MARKERS_LOCAL) {
+ icon_id= (marker->flag & ACTIVE) ? ICON_PMARKER_ACT :
+ (marker->flag & SELECT) ? ICON_PMARKER_SEL :
+ ICON_PMARKER;
+ }
+ else {
+ icon_id= (marker->flag & SELECT) ? ICON_MARKER_HLT :
+ ICON_MARKER;
+ }
+
+ UI_icon_draw(xpos*xscale-5.0, 16.0, icon_id);
+
+ glBlendFunc(GL_ONE, GL_ZERO);
+ glDisable(GL_BLEND);
+
+ /* and the marker name too, shifted slightly to the top-right */
+ if(marker->name && marker->name[0]) {
+ if(marker->flag & SELECT) {
+ UI_ThemeColor(TH_TEXT_HI);
+ ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
+ }
+ else {
+ UI_ThemeColor(TH_TEXT);
+ if((marker->frame <= cfra) && (marker->frame+5 > cfra))
+ ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
+ else
+ ui_rasterpos_safe(xpos*xscale+4.0, 17.0, 1.0);
+ }
+ UI_DrawString(G.font, marker->name, 0);
+ }
+ glScalef(xscale, 1.0, 1.0);
+}
+
+/* Draw Scene-Markers in time window */
+void draw_markers_time(const bContext *C, int flag)
+{
+ ListBase *markers= context_get_markers(C);
+ View2D *v2d= UI_view2d_fromcontext(C);
+ TimeMarker *marker;
+
+ /* unselected markers are drawn at the first time */
+ for (marker= markers->first; marker; marker= marker->next) {
+ if (!(marker->flag & SELECT)) draw_marker(v2d, marker, C->scene->r.cfra, flag);
+ }
+
+ /* selected markers are drawn later */
+ for (marker= markers->first; marker; marker= marker->next) {
+ if (marker->flag & SELECT) draw_marker(v2d, marker, C->scene->r.cfra, flag);
+ }
+}
+
+
+
+/* ************************** add markers *************************** */
+
+/* add TimeMarker at curent frame */
+static int ed_marker_add(bContext *C, wmOperator *op)
+{
+ ListBase *markers= context_get_markers(C);
+ TimeMarker *marker;
+ int frame= C->scene->r.cfra;
+
+ /* two markers can't be at the same place */
+ for(marker= markers->first; marker; marker= marker->next)
+ if(marker->frame == frame)
+ return OPERATOR_CANCELLED;
+
+ /* deselect all */
+ for(marker= markers->first; marker; marker= marker->next)
+ marker->flag &= ~SELECT;
+
+ marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
+ marker->flag= SELECT;
+ marker->frame= frame;
+ sprintf(marker->name, "Frame %d", frame); // XXX - temp code only
+ BLI_addtail(markers, marker);
+
+ //BIF_undo_push("Add Marker");
+
+ return OPERATOR_FINISHED;
+}
+
+static void ED_MARKER_OT_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Time Marker";
+ ot->idname= "ED_MARKER_OT_add";
+
+ /* api callbacks */
+ ot->exec= ed_marker_add;
+ ot->poll= ED_operator_areaactive;
+
+}
+
+/* ************************** transform markers *************************** */
+
+
+/* operator state vars used:
+ frs: delta movement
+
+functions:
+
+ init() check selection, add customdata with old values and some lookups
+
+ apply() do the actual movement
+
+ exit() cleanup, send notifier
+
+ cancel() to escpae from modal
+
+callbacks:
+
+ exec() calls init, apply, exit
+
+ invoke() calls init, adds modal handler
+
+ modal() accept modal events while doing it, ends with apply and exit, or cancel
+
+*/
+
+typedef struct MarkerMove {
+ SpaceLink *slink;
+ ListBase *markers;
+ int event_type; /* store invoke-event, to verify */
+ int *oldframe, evtx, firstx;
+} MarkerMove;
+
+/* copy selection to temp buffer */
+/* return 0 if not OK */
+static int ed_marker_move_init(bContext *C, wmOperator *op)
+{
+ ListBase *markers= context_get_markers(C);
+ MarkerMove *mm;
+ TimeMarker *marker;
+ int totmark=0;
+ int a;
+
+ for (marker= markers->first; marker; marker= marker->next)
+ if (marker->flag & SELECT) totmark++;
+
+ if (totmark==0) return 0;
+
+ op->customdata= mm= MEM_callocN(sizeof(MarkerMove), "Markermove");
+ mm->slink= C->area->spacedata.first;
+ mm->markers= markers;
+ mm->oldframe= MEM_callocN(totmark*sizeof(int), "MarkerMove oldframe");
+
+ for (a=0, marker= markers->first; marker; marker= marker->next) {
+ if (marker->flag & SELECT) {
+ mm->oldframe[a]= marker->frame;
+ a++;
+ }
+ }
+
+ return 1;
+}
+
+/* free stuff */
+static void ed_marker_move_exit(bContext *C, wmOperator *op)
+{
+ MarkerMove *mm= op->customdata;
+
+ MEM_freeN(mm->oldframe);
+ MEM_freeN(op->customdata);
+ op->customdata= NULL;
+}
+
+static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ if(ed_marker_move_init(C, op)) {
+ MarkerMove *mm= op->customdata;
+
+ mm->evtx= evt->x;
+ mm->firstx= evt->x;
+ mm->event_type= evt->type;
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ /* reset frs delta */
+ RNA_int_set(op->ptr, "frs", 0);
+
+ return OPERATOR_RUNNING_MODAL;
+ }
+
+ return OPERATOR_CANCELLED;
+}
+
+/* note, init has to be called succesfully */
+static void ed_marker_move_apply(bContext *C, wmOperator *op)
+{
+ MarkerMove *mm= op->customdata;
+ TimeMarker *marker;
+ int a, offs;
+
+ offs= RNA_int_get(op->ptr, "frs");
+ for (a=0, marker= mm->markers->first; marker; marker= marker->next) {
+ if (marker->flag & SELECT) {
+ marker->frame= mm->oldframe[a] + offs;
+ a++;
+ }
+ }
+}
+
+/* only for modal */
+static void ed_marker_move_cancel(bContext *C, wmOperator *op)
+{
+
+ RNA_int_set(op->ptr, "frs", 0);
+ ed_marker_move_apply(C, op);
+ ed_marker_move_exit(C, op);
+
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+}
+
+
+/* for tweak handlers, check configuration for how to interpret events */
+int WM_modal_tweak_check(wmEvent *evt, int tweak_event)
+{
+ /* user preset?? dunno... */
+ int tweak_modal= 1;
+
+ switch(tweak_event) {
+ case EVT_TWEAK_L:
+ case EVT_TWEAK_M:
+ case EVT_TWEAK_R:
+ if(evt->val==tweak_modal)
+ return 1;
+ default:
+ /* this case is when modal callcback didnt get started with a tweak */
+ if(evt->val)
+ return 1;
+ }
+ return 0;
+}
+
+static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ MarkerMove *mm= op->customdata;
+ View2D *v2d= UI_view2d_fromcontext(C);
+ TimeMarker *marker, *selmarker=NULL;
+ float dx, fac;
+ char str[256];
+
+ switch(evt->type) {
+ case ESCKEY:
+ ed_marker_move_cancel(C, op);
+ return OPERATOR_CANCELLED;
+
+ case LEFTMOUSE:
+ case MIDDLEMOUSE:
+ case RIGHTMOUSE:
+ if(WM_modal_tweak_check(evt, mm->event_type)) {
+ ed_marker_move_exit(C, op);
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ return OPERATOR_FINISHED;
+ }
+
+ break;
+ case MOUSEMOVE:
+
+ dx= v2d->mask.xmax-v2d->mask.xmin;
+ dx= (v2d->cur.xmax-v2d->cur.xmin)/dx;
+
+ if (evt->x != mm->evtx) { /* XXX maybe init for firsttime */
+ int a, offs, totmark=0;
+
+ mm->evtx= evt->x;
+
+ fac= ((float)(evt->x - mm->firstx)*dx);
+
+ if (ELEM(mm->slink->spacetype, SPACE_TIME, SPACE_SOUND))
+ apply_keyb_grid(&fac, 0.0, FPS, 0.1*FPS, 0);
+ else
+ apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
+
+ offs= (int)fac;
+ RNA_int_set(op->ptr, "frs", offs);
+ ed_marker_move_apply(C, op);
+
+ /* cruft below is for header print */
+ for (a=0, marker= mm->markers->first; marker; marker= marker->next) {
+ if (marker->flag & SELECT) {
+ selmarker= marker;
+ a++; totmark++;
+ }
+ }
+
+ if (totmark==1) {
+ /* we print current marker value */
+ if (ELEM(mm->slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
+ SpaceTime *stime= (SpaceTime *)mm->slink;
+ if (stime->flag & TIME_DRAWFRAMES)
+ sprintf(str, "Marker %d offset %d", selmarker->frame, offs);
+ else
+ sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
+ }
+ else if (mm->slink->spacetype == SPACE_ACTION) {
+#if 0
+XXX if (saction->flag & SACTION_DRAWTIME)
+ sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
+ else
+ sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
+#endif
+ }
+ else {
+ sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
+ }
+ }
+ else {
+ /* we only print the offset */
+ if (ELEM(mm->slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
+ SpaceTime *stime= (SpaceTime *)mm->slink;
+ if (stime->flag & TIME_DRAWFRAMES)
+ sprintf(str, "Marker offset %d ", offs);
+ else
+ sprintf(str, "Marker offset %.2f ", FRA2TIME(offs));
+ }
+#if 0
+XXX else if (mm->slink->spacetype == SPACE_ACTION) {
+ if (saction->flag & SACTION_DRAWTIME)
+ sprintf(str, "Marker offset %.2f ", FRA2TIME(offs));
+ else
+ sprintf(str, "Marker offset %.2f ", (double)(offs));
+ }
+#endif
+ else {
+ sprintf(str, "Marker offset %.2f ", (double)(offs));
+ }
+ }
+
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ // headerprint(str); XXX
+ }
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int ed_marker_move_exec(bContext *C, wmOperator *op)
+{
+ if(ed_marker_move_init(C, op)) {
+ ed_marker_move_apply(C, op);
+ ed_marker_move_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ return OPERATOR_CANCELLED;
+}
+
+static void ED_MARKER_OT_move(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Move Time Marker";
+ ot->idname= "ED_MARKER_OT_move";
+
+ /* api callbacks */
+ ot->exec= ed_marker_move_exec;
+ ot->invoke= ed_marker_move_invoke;
+ ot->modal= ed_marker_move_modal;
+ ot->poll= ED_operator_areaactive;
+
+ /* rna storage */
+ RNA_def_property(ot->srna, "frs", PROP_INT, PROP_NONE);
+}
+
+/* ************************** duplicate markers *************************** */
+
+/* operator state vars used:
+ frs: delta movement
+
+functions:
+
+ apply() do the actual duplicate
+
+callbacks:
+
+ exec() calls apply, move_exec
+
+ invoke() calls apply, move_invoke
+
+ modal() uses move_modal
+
+*/
+
+
+/* duplicate selected TimeMarkers */
+static void ed_marker_duplicate_apply(bContext *C, wmOperator *op)
+{
+ ListBase *markers= context_get_markers(C);
+ TimeMarker *marker, *newmarker;
+
+ /* go through the list of markers, duplicate selected markers and add duplicated copies
+ * to the begining of the list (unselect original markers) */
+ for(marker= markers->first; marker; marker= marker->next) {
+ if(marker->flag & SELECT){
+ /* unselect selected marker */
+ marker->flag &= ~SELECT;
+ /* create and set up new marker */
+ newmarker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
+ newmarker->flag= SELECT;
+ newmarker->frame= marker->frame;
+ BLI_strncpy(newmarker->name, marker->name, sizeof(marker->name));
+ /* new marker is added to the begining of list */
+ BLI_addhead(markers, newmarker);
+ }
+ }
+}
+
+static int ed_marker_duplicate_exec(bContext *C, wmOperator *op)
+{
+ ed_marker_duplicate_apply(C, op);
+ ed_marker_move_exec(C, op); /* assumes frs delta set */
+
+ return OPERATOR_FINISHED;
+
+}
+
+static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ ed_marker_duplicate_apply(C, op);
+ return ed_marker_move_invoke(C, op, evt);
+}
+
+static void ED_MARKER_OT_duplicate(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Duplicate Time Marker";
+ ot->idname= "ED_MARKER_OT_duplicate";
+
+ /* api callbacks */
+ ot->exec= ed_marker_duplicate_exec;
+ ot->invoke= ed_marker_duplicate_invoke;
+ ot->modal= ed_marker_move_modal;
+ ot->poll= ED_operator_areaactive;
+
+ /* rna storage */
+ RNA_def_property(ot->srna, "frs", PROP_INT, PROP_NONE);
+}
+
+/* ************************** selection ************************************/
+
+/* select/deselect TimeMarker at current frame */
+static void select_timeline_marker_frame(int frame, unsigned char shift)
+{
+ TimeMarker *marker;
+ int select=0;
+
+ for(marker= G.scene->markers.first; marker; marker= marker->next) {
+ /* if Shift is not set, then deselect Markers */
+ if(!shift) marker->flag &= ~SELECT;
+ /* this way a not-shift select will allways give 1 selected marker */
+ if((marker->frame == frame) && (!select)) {
+ if(marker->flag & SELECT)
+ marker->flag &= ~SELECT;
+ else
+ marker->flag |= SELECT;
+ select = 1;
+ }
+ }
+}
+
+static int find_nearest_marker_time(ListBase *markers, float dx)
+{
+ TimeMarker *marker, *nearest= NULL;
+ float dist, min_dist= 1000000;
+
+ for(marker= markers->first; marker; marker= marker->next) {
+ dist = ABS((float)marker->frame - dx);
+ if(dist < min_dist){
+ min_dist= dist;
+ nearest= marker;
+ }
+ }
+
+ if(nearest) return nearest->frame;
+ else return (int)floor(dx); /* hrmf? */
+}
+
+
+static int ed_marker_select(bContext *C, wmEvent *evt, int extend)
+{
+ ListBase *markers= context_get_markers(C);
+ View2D *v2d= UI_view2d_fromcontext(C);
+ float viewx;
+ int x, y, cfra;
+
+ x= evt->x - C->region->winrct.xmin;
+ y= evt->y - C->region->winrct.ymin;
+
+ UI_view2d_region_to_view(v2d, x, y, &viewx, NULL);
+
+ cfra= find_nearest_marker_time(markers, viewx);
+
+ if (extend)
+ select_timeline_marker_frame(cfra, 1);
+ else
+ select_timeline_marker_frame(cfra, 0);
+
+ /* XXX notifier for markers... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+ return OPERATOR_PASS_THROUGH;
+}
+
+static int ed_marker_select_extend_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ return ed_marker_select(C, evt, 1);
+}
+
+static int ed_marker_select_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ return ed_marker_select(C, evt, 0);
+}
+
+static void ED_MARKER_OT_mouseselect(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Select Time Marker";
+ ot->idname= "ED_MARKER_OT_mouseselect";
+
+ /* api callbacks */
+ ot->invoke= ed_marker_select_invoke;
+ ot->poll= ED_operator_areaactive;
+}
+
+static void ED_MARKER_OT_mouseselect_extend(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Extend Select Time Marker";
+ ot->idname= "ED_MARKER_OT_mouseselect_extend";
+
+ /* api callbacks */
+ ot->invoke= ed_marker_select_extend_invoke;
+ ot->poll= ED_operator_areaactive;
+}
+
+/* *************************** border select markers **************** */
+
+/* operator state vars used: (added by default WM callbacks)
+ xmin, ymin
+ xmax, ymax
+
+customdata: the wmGesture pointer, with subwindow
+
+callbacks:
+
+ exec() has to be filled in by user
+
+ invoke() default WM function
+ adds modal handler
+
+ modal() default WM function
+ accept modal events while doing it, calls exec(), handles ESC and border drawing
+
+ poll() has to be filled in by user for context
+*/
+
+static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
+{
+ View2D *v2d= UI_view2d_fromcontext(C);
+ ListBase *markers= context_get_markers(C);
+ TimeMarker *marker;
+ float xminf, xmaxf, yminf, ymaxf;
+ int event_type= RNA_int_get(op->ptr, "event_type");
+ int xmin= RNA_int_get(op->ptr, "xmin");
+ int xmax= RNA_int_get(op->ptr, "xmax");
+ int ymin= RNA_int_get(op->ptr, "ymin");
+ int ymax= RNA_int_get(op->ptr, "ymax");
+
+ UI_view2d_region_to_view(v2d, xmin, ymin, &xminf, &yminf);
+ UI_view2d_region_to_view(v2d, xmax, ymax, &xmaxf, &ymaxf);
+
+ /* XXX disputable */
+ if(yminf > 30.0f || ymaxf < 0.0f)
+ return 0;
+
+ /* XXX marker context */
+ for(marker= markers->first; marker; marker= marker->next) {
+ if ((marker->frame > xminf) && (marker->frame <= xmaxf)) {
+ switch (event_type) {
+ case LEFTMOUSE:
+ if ((marker->flag & SELECT) == 0)
+ marker->flag |= SELECT;
+ break;
+ case RIGHTMOUSE:
+ if (marker->flag & SELECT)
+ marker->flag &= ~SELECT;
+ break;
+ }
+ }
+ }
+
+ /* XXX notifier for markers... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+ return 1;
+}
+
+static void ED_MARKER_OT_border_select(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Marker Border select";
+ ot->idname= "ED_MARKER_OT_border_select";
+
+ /* api callbacks */
+ ot->exec= ed_marker_border_select_exec;
+ ot->invoke= WM_border_select_invoke;
+ ot->modal= WM_border_select_modal;
+
+ ot->poll= ED_operator_areaactive;
+
+ /* rna */
+ RNA_def_property(ot->srna, "event_type", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "xmin", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "xmax", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "ymin", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "ymax", PROP_INT, PROP_NONE);
+
+}
+
+/* *********************** (de)select all ***************** */
+
+static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
+{
+ ListBase *markers= context_get_markers(C);
+ TimeMarker *marker;
+ int select= RNA_int_get(op->ptr, "select_type");
+
+ if(RNA_int_get(op->ptr, "select_swap")) {
+ for(marker= markers->first; marker; marker= marker->next) {
+ if(marker->flag & SELECT)
+ break;
+ }
+ if(marker)
+ select= 0;
+ else
+ select= 1;
+ }
+
+ for(marker= markers->first; marker; marker= marker->next) {
+ if(select)
+ marker->flag |= SELECT;
+ else
+ marker->flag &= ~SELECT;
+ }
+
+ /* XXX notifier for markers... */
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+static int ed_marker_select_all_invoke(bContext *C, wmOperator *op, wmEvent *evt)
+{
+ RNA_int_set(op->ptr, "select_swap", 1);
+
+ return ed_marker_select_all_exec(C, op);
+}
+
+static void ED_MARKER_OT_select_all(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "(De)select all markers";
+ ot->idname= "ED_MARKER_OT_select_all";
+
+ /* api callbacks */
+ ot->exec= ed_marker_select_all_exec;
+ ot->invoke= ed_marker_select_all_invoke;
+ ot->poll= ED_operator_areaactive;
+
+ /* rna */
+ RNA_def_property(ot->srna, "select_swap", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "select_type", PROP_INT, PROP_NONE);
+
+}
+
+/* ******************************* remove marker ***************** */
+
+/* remove selected TimeMarkers */
+static int ed_marker_delete_exec(bContext *C, wmOperator *op)
+{
+ ListBase *markers= context_get_markers(C);
+ TimeMarker *marker, *nmarker;
+ short changed= 0;
+
+ for(marker= markers->first; marker; marker= nmarker) {
+ nmarker= marker->next;
+ if(marker->flag & SELECT) {
+ BLI_freelinkN(markers, marker);
+ changed= 1;
+ }
+ }
+
+ /* XXX notifier for markers... */
+ if(changed)
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+
+static void ED_MARKER_OT_delete(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Delete Markers";
+ ot->idname= "ED_MARKER_OT_delete";
+
+ /* api callbacks */
+ ot->exec= ed_marker_delete_exec;
+ ot->poll= ED_operator_areaactive;
+
+}
+
+/* ************************** registration **********************************/
+
+/* called in ED_operatortypes_screen() */
+void ED_marker_operatortypes(void)
+{
+ WM_operatortype_append(ED_MARKER_OT_add);
+ WM_operatortype_append(ED_MARKER_OT_move);
+ WM_operatortype_append(ED_MARKER_OT_duplicate);
+ WM_operatortype_append(ED_MARKER_OT_mouseselect);
+ WM_operatortype_append(ED_MARKER_OT_mouseselect_extend);
+ WM_operatortype_append(ED_MARKER_OT_border_select);
+ WM_operatortype_append(ED_MARKER_OT_select_all);
+ WM_operatortype_append(ED_MARKER_OT_delete);
+}
+
+
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
new file mode 100644
index 00000000000..b74896782f3
--- /dev/null
+++ b/source/blender/editors/space_time/space_time.c
@@ -0,0 +1,311 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "ED_markers.h"
+
+#include "time_intern.h"
+
+/* ************************ main time area region *********************** */
+
+/* draws a current frame indicator for the TimeLine */
+static void time_draw_cfra_time(const bContext *C, SpaceTime *stime, ARegion *ar)
+{
+ Scene *scene= C->scene;
+ float vec[2];
+
+ vec[0]= scene->r.cfra*scene->r.framelen;
+
+ UI_ThemeColor(TH_CFRAME); // no theme, should be global color once...
+ glLineWidth(3.0);
+
+ glBegin(GL_LINES);
+ vec[1]= ar->v2d.cur.ymin;
+ glVertex2fv(vec);
+ vec[1]= ar->v2d.cur.ymax;
+ glVertex2fv(vec);
+ glEnd();
+
+ glLineWidth(1.0);
+}
+
+static void time_draw_sfra_efra(const bContext *C, SpaceTime *stime, ARegion *ar)
+{
+ View2D *v2d= UI_view2d_fromcontext(C);
+
+ /* draw darkened area outside of active timeline
+ * frame range used is preview range or scene range */
+ UI_ThemeColorShade(TH_BACK, -25);
+
+ if (PSFRA < PEFRA) {
+ glRectf(v2d->cur.xmin, v2d->cur.ymin, PSFRA, v2d->cur.ymax);
+ glRectf(PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+ }
+ else {
+ glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+ }
+
+ UI_ThemeColorShade(TH_BACK, -60);
+ /* thin lines where the actual frames are */
+ fdrawline(PSFRA, v2d->cur.ymin, PSFRA, v2d->cur.ymax);
+ fdrawline(PEFRA, v2d->cur.ymin, PEFRA, v2d->cur.ymax);
+}
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void time_main_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ ListBase *keymap;
+
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+
+ /* own keymap */
+ keymap= WM_keymap_listbase(wm, "TimeLine", SPACE_TIME, 0); /* XXX weak? */
+ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+}
+
+
+static void time_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ SpaceTime *stime= C->area->spacedata.first;
+ View2D *v2d= &ar->v2d;
+ View2DGrid *grid;
+ View2DScrollers *scrollers;
+ float col[3];
+ int unit;
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* start and end frame */
+ time_draw_sfra_efra(C, stime, ar);
+
+ /* grid */
+ unit= (stime->flag & TIME_DRAWFRAMES)? V2D_UNIT_FRAMES: V2D_UNIT_SECONDS;
+ grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
+ UI_view2d_grid_draw(C, v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS));
+ UI_view2d_grid_free(grid);
+
+ /* current frame */
+ time_draw_cfra_time(C, stime, ar);
+
+ /* markers */
+ UI_view2d_view_orthoSpecial(C, v2d, 1);
+ draw_markers_time(C, 0);
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers */
+ scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ UI_view2d_scrollers_draw(C, v2d, scrollers);
+ UI_view2d_scrollers_free(scrollers);
+}
+
+static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+}
+
+/* ************************ header time area region *********************** */
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void time_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void time_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ time_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+
+/* ******************** default callbacks for time space ***************** */
+
+static SpaceLink *time_new(void)
+{
+ ARegion *ar;
+ SpaceTime *stime;
+
+ stime= MEM_callocN(sizeof(SpaceTime), "inittime");
+
+ stime->spacetype= SPACE_TIME;
+ stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
+ stime->flag |= TIME_DRAWFRAMES;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for time");
+
+ BLI_addtail(&stime->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for time");
+
+ BLI_addtail(&stime->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ ar->v2d.tot.xmin= -4.0;
+ ar->v2d.tot.ymin= 0.0;
+ ar->v2d.tot.xmax= (float)EFRA + 4.0;
+ ar->v2d.tot.ymax= 50.0;
+
+ ar->v2d.cur= ar->v2d.tot;
+
+ ar->v2d.min[0]= 1.0;
+ ar->v2d.min[1]= 50.0;
+
+ ar->v2d.max[0]= 32000.0;
+ ar->v2d.max[1]= 50.0;
+
+ ar->v2d.minzoom= 0.1f;
+ ar->v2d.maxzoom= 10.0;
+
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
+ ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
+ ar->v2d.keepofs |= V2D_LOCKOFS_Y;
+ ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
+
+ return (SpaceLink*)stime;
+}
+
+/* not spacelink itself */
+static void time_free(SpaceLink *sl)
+{
+}
+
+
+/* spacetype; init callback in ED_area_initialize() */
+/* init is called to (re)initialize an existing editor (file read, screen changes) */
+/* validate spacedata, add own area level handlers */
+static void time_init(wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *time_duplicate(SpaceLink *sl)
+{
+ SpaceTime *stime= (SpaceTime *)sl;
+ SpaceTime *stimen= MEM_dupallocN(stime);
+
+ return (SpaceLink *)stimen;
+}
+
+/* only called once, from space_api/spacetypes.c */
+/* it defines all callbacks to maintain spaces */
+void ED_spacetype_time(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype time");
+ ARegionType *art;
+
+ st->spaceid= SPACE_TIME;
+ strncpy(st->name, "Timeline", BKE_ST_MAXNAME);
+
+ st->new= time_new;
+ st->free= time_free;
+ st->init= time_init;
+ st->duplicate= time_duplicate;
+ st->operatortypes= time_operatortypes;
+ st->keymap= NULL;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_MARKERS;
+
+ art->init= time_main_area_init;
+ art->draw= time_main_area_draw;
+ art->listener= time_main_area_listener;
+ art->keymap= time_keymap;
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= time_header_area_init;
+ art->draw= time_header_area_draw;
+ BLI_addhead(&st->regiontypes, art);
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/src/header_time.c b/source/blender/editors/space_time/time_header.c
index 574e0b3a9f1..e996c29d61c 100644
--- a/source/blender/src/header_time.c
+++ b/source/blender/editors/space_time/time_header.c
@@ -1,13 +1,12 @@
/**
- *
- * $Id:
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -16,169 +15,87 @@
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_butspace.h"
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_pointcache.h"
+#include "BKE_screen.h"
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-#include "BSE_editipo.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_seqaudio.h"
-#include "BSE_time.h"
+#include "ED_screen.h"
+#include "ED_util.h"
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
+#include "WM_api.h"
+#include "WM_types.h"
-static void start_animated_screen(SpaceTime *stime)
-{
- add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws);
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
- if(stime->redraws & TIME_WITH_SEQ_AUDIO)
- audiostream_start( CFRA );
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
- BKE_ptcache_set_continue_physics((stime->redraws & TIME_CONTINUE_PHYSICS));
-}
+#include "ED_markers.h"
-static void end_animated_screen(SpaceTime *stime)
-{
- rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
+#include "time_intern.h"
- audiostream_stop();
- BKE_ptcache_set_continue_physics(0);
-}
-void do_time_buttons(ScrArea *sa, unsigned short event)
-{
- SpaceTime *stime= sa->spacedata.first;
-
- switch(event) {
+/* ************************ header time area region *********************** */
- case B_TL_REW:
- CFRA= PSFRA;
- update_for_newframe();
- break;
- case B_TL_PLAY:
- start_animated_screen(stime);
- break;
- case B_TL_STOP:
- end_animated_screen(stime);
- allqueue(REDRAWALL, 0);
- break;
- case B_TL_FF:
- /* end frame */
- CFRA= PEFRA;
- update_for_newframe();
- break;
- case B_TL_PREVKEY:
- /* previous keyframe */
- nextprev_timeline_key(-1);
- break;
- case B_TL_NEXTKEY:
- /* next keyframe */
- nextprev_timeline_key(1);
- break;
-
- case B_TL_PREVIEWON:
- if (G.scene->r.psfra) {
- /* turn on preview range */
- G.scene->r.psfra= G.scene->r.sfra;
- G.scene->r.pefra= G.scene->r.efra;
- }
- else {
- /* turn off preview range */
- G.scene->r.psfra= 0;
- G.scene->r.pefra= 0;
- }
- BIF_undo_push("Set anim-preview range");
- allqueue(REDRAWALL, 0);
- break;
-
- case B_TL_INSERTKEY:
- /* insert keyframe */
- common_insertkey();
- allqueue(REDRAWTIME, 1);
- break;
- case B_TL_DELETEKEY:
- /* delete keyframe */
- common_deletekey();
- allqueue(REDRAWTIME, 1);
- break;
- }
-}
-static void do_time_redrawmenu(void *arg, int event)
+static void do_time_redrawmenu(bContext *C, void *arg, int event)
{
- SpaceTime *stime= curarea->spacedata.first;
+ SpaceTime *stime= C->area->spacedata.first;
if(event < 1001) {
stime->redraws ^= event;
/* update handler when it's running */
- if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
- start_animated_screen(stime);
+// if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
+// start_animated_screen(stime);
}
else {
if(event==1001) {
- button(&G.scene->r.frs_sec,1,120,"FPS:");
+// button(&C->scene->r.frs_sec,1,120,"FPS:");
}
}
}
-
-static uiBlock *time_redrawmenu(void *arg_unused)
+
+static uiBlock *time_redrawmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
+ ScrArea *curarea= C->area;
SpaceTime *stime= curarea->spacedata.first;
uiBlock *block;
short yco= 0, menuwidth=120, icon;
char str[32];
- block= uiNewBlock(&curarea->uiblocks, "time_redrawmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
+ block= uiBeginBlock(C, handle->region, "header time_redrawmenu", UI_EMBOSSP, UI_HELV);
uiBlockSetButmFunc(block, do_time_redrawmenu, NULL);
if(stime->redraws & TIME_LEFTMOST_3D_WIN) icon= ICON_CHECKBOX_HLT;
else icon= ICON_CHECKBOX_DEHLT;
uiDefIconTextBut(block, BUTM, 1, icon, "Top-Left 3D Window", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_LEFTMOST_3D_WIN, "");
-
+
if(stime->redraws & TIME_ALL_3D_WIN) icon= ICON_CHECKBOX_HLT;
else icon= ICON_CHECKBOX_DEHLT;
uiDefIconTextBut(block, BUTM, 1, icon, "All 3D Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_3D_WIN, "");
@@ -199,14 +116,14 @@ static uiBlock *time_redrawmenu(void *arg_unused)
if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT;
else icon= ICON_CHECKBOX_DEHLT;
uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, "");
-
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- sprintf(str, "Set Frames/Sec (%d/%f)", G.scene->r.frs_sec, G.scene->r.frs_sec_base);
+ sprintf(str, "Set Frames/Sec (%d/%f)", C->scene->r.frs_sec, C->scene->r.frs_sec_base);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1001, "");
-
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
+
if(stime->redraws & TIME_CONTINUE_PHYSICS) icon= ICON_CHECKBOX_HLT;
else icon= ICON_CHECKBOX_DEHLT;
uiDefIconTextBut(block, BUTM, 1, icon, "Continue Physics", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_CONTINUE_PHYSICS, "During playblack, continue physics simulations regardless of the frame number");
@@ -221,75 +138,83 @@ static uiBlock *time_redrawmenu(void *arg_unused)
}
uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
return block;
}
-static void do_time_viewmenu(void *arg, int event)
+static void do_time_viewmenu(bContext *C, void *arg, int event)
{
+ ScrArea *curarea= C->area;
SpaceTime *stime= curarea->spacedata.first;
+ View2D *v2d= UI_view2d_fromcontext_rwin(C);
int first;
switch(event) {
case 2: /* Play Back Animation */
- if(!has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
- start_animated_screen(stime);
+ //if(!has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
+ // start_animated_screen(stime);
break;
case 3: /* View All */
- first= G.scene->r.sfra;
- if(first >= G.scene->r.efra) first= G.scene->r.efra;
- G.v2d->cur.xmin=G.v2d->tot.xmin= (float)first-2;
- G.v2d->cur.xmax=G.v2d->tot.xmax= (float)G.scene->r.efra+2;
+ if(v2d) {
+ first= C->scene->r.sfra;
+ if(first >= C->scene->r.efra) first= C->scene->r.efra;
+ v2d->cur.xmin=v2d->tot.xmin= (float)first-2;
+ v2d->cur.xmax=v2d->tot.xmax= (float)C->scene->r.efra+2;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+ }
break;
case 4: /* Maximize Window */
- /* using event B_FULL */
+ /* using event B_FULL */
break;
case 5: /* show time or frames */
stime->flag ^= TIME_DRAWFRAMES;
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
break;
case 6:
- nextprev_marker(1);
+ //nextprev_marker(1);
break;
case 7:
- nextprev_marker(-1);
+ //nextprev_marker(-1);
break;
case 8:
- nextprev_timeline_key(1);
+ //nextprev_timeline_key(1);
break;
case 9:
- nextprev_timeline_key(-1);
+ //nextprev_timeline_key(-1);
break;
case 10:
- timeline_frame_to_center();
+ //timeline_frame_to_center();
break;
case 11:
- G.v2d->flag ^= V2D_VIEWLOCK;
- if(G.v2d->flag & V2D_VIEWLOCK)
- view2d_do_locks(curarea, 0);
- break;
+ if(v2d) {
+ //v2d->flag ^= V2D_VIEWSYNC_X;
+ //if(v2d->flag & V2D_VIEWSYNC_X)
+ // view2d_do_locks(curarea, 0);
+ }
+ break;
case 12: /* only show keyframes from selected data */
stime->flag ^= TIME_ONLYACTSEL;
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
break;
}
- allqueue(REDRAWVIEW3D, 0);
}
-static uiBlock *time_viewmenu(void *arg_unused)
+static uiBlock *time_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
+ ScrArea *curarea= C->area;
SpaceTime *stime= curarea->spacedata.first;
+ View2D *v2d= UI_view2d_fromcontext_rwin(C);
uiBlock *block;
short yco= 0, menuwidth=120;
- block= uiNewBlock(&curarea->uiblocks, "time_viewmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
+ block= uiBeginBlock(C, handle->region, "time_viewmenu", UI_EMBOSSP, UI_HELV);
uiBlockSetButmFunc(block, do_time_viewmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
if(stime->flag & TIME_DRAWFRAMES)
@@ -311,13 +236,13 @@ static uiBlock *time_viewmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
+ uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_X)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
"Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
+// if (!curarea->full)
+// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
+// else
+// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
@@ -326,65 +251,61 @@ static uiBlock *time_viewmenu(void *arg_unused)
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
}
-
+
uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
return block;
}
-static void do_time_framemenu(void *arg, int event)
+static void do_time_framemenu(bContext *C, void *arg, int event)
{
switch(event) {
case 1: /*Set as Start */
- if (G.scene->r.psfra) {
- if (G.scene->r.pefra < CFRA)
- G.scene->r.pefra= CFRA;
- G.scene->r.psfra= CFRA;
+ if (C->scene->r.psfra) {
+ if (C->scene->r.pefra < CFRA)
+ C->scene->r.pefra= CFRA;
+ C->scene->r.psfra= CFRA;
}
else
- G.scene->r.sfra = CFRA;
- allqueue(REDRAWALL, 1);
+ C->scene->r.sfra = CFRA;
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
break;
case 2: /* Set as End */
- if (G.scene->r.psfra) {
- if (CFRA < G.scene->r.psfra)
- G.scene->r.psfra= CFRA;
- G.scene->r.pefra= CFRA;
+ if (C->scene->r.psfra) {
+ if (CFRA < C->scene->r.psfra)
+ C->scene->r.psfra= CFRA;
+ C->scene->r.pefra= CFRA;
}
else
- G.scene->r.efra = CFRA;
- allqueue(REDRAWALL, 1);
+ C->scene->r.efra = CFRA;
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
break;
case 3: /* Add Marker */
- add_marker(CFRA);
+ WM_operator_call_rwin(C, "ED_MARKER_OT_add");
break;
case 4: /* Remove Marker */
- remove_marker();
+ WM_operator_call_rwin(C, "ED_MARKER_OT_delete");
break;
case 5: /* Rename Marker */
- rename_marker();
+ //rename_marker();
break;
case 6: /* Grab Marker */
- transform_markers('g', 0);
+ WM_operator_call_rwin(C, "ED_MARKER_OT_move");
break;
case 7: /* duplicate marker */
- duplicate_marker();
+ WM_operator_call_rwin(C, "ED_MARKER_OT_duplicate");
break;
}
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWSOUND, 0);
}
-static uiBlock *time_framemenu(void *arg_unused)
+static uiBlock *time_framemenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
{
+ ScrArea *curarea= C->area;
uiBlock *block;
short yco= 0, menuwidth=120;
- block= uiNewBlock(&curarea->uiblocks, "time_framemenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
+ block= uiBeginBlock(C, handle->region, "time_framemenu", UI_EMBOSSP, UI_HELV);
uiBlockSetButmFunc(block, do_time_framemenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
@@ -393,21 +314,21 @@ static uiBlock *time_framemenu(void *arg_unused)
menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as Start|S", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as End|E", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
+
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
}
@@ -415,172 +336,244 @@ static uiBlock *time_framemenu(void *arg_unused)
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
}
-
+
uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
return block;
}
-void time_buttons(ScrArea *sa)
+static void start_animated_screen(SpaceTime *stime)
{
- SpaceTime *stime= sa->spacedata.first;
- uiBlock *block;
- short xco, xmax;
- char name[256];
+ // XXX add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws);
- sprintf(name, "header %d", sa->headwin);
- block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->headwin);
-
- if(area_is_active_area(sa)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
+ // if(stime->redraws & TIME_WITH_SEQ_AUDIO)
+ // audiostream_start( CFRA );
- sa->butspacetype= SPACE_TIME;
+ // BKE_ptcache_set_continue_physics((stime->redraws & TIME_CONTINUE_PHYSICS));
+}
- xco = 8;
+static void end_animated_screen(SpaceTime *stime)
+{
+ // rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco, 0, XIC+10, YIC,
- &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays Current Window Type. "
- "Click for menu of available types.");
+ // audiostream_stop();
+ // BKE_ptcache_set_continue_physics(0);
+}
- xco += XIC + 14;
+#define B_REDRAWALL 750
+#define B_TL_REW 751
+#define B_TL_PLAY 752
+#define B_TL_FF 753
+#define B_TL_PREVKEY 754
+#define B_TL_NEXTKEY 755
+#define B_TL_STOP 756
+#define B_TL_PREVIEWON 757
+#define B_TL_INSERTKEY 758
+#define B_TL_DELETEKEY 759
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if (sa->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(sa->flag), 0, 0, 0, 0,
- "Show pulldown menus");
- }
- else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(sa->flag), 0, 0, 0, 0,
- "Hide pulldown menus");
+#define B_FLIPINFOMENU 0
+#define B_NEWFRAME 0
+#define AUTOKEY_ON 0
+#define B_DIFF 0
+
+
+void do_time_buttons(bContext *C, void *arg, int event)
+{
+ SpaceTime *stime= C->area->spacedata.first;
+
+ switch(event) {
+ case B_REDRAWALL:
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ break;
+ case B_TL_REW:
+ CFRA= PSFRA;
+ //update_for_newframe();
+ break;
+ case B_TL_PLAY:
+ start_animated_screen(stime);
+ break;
+ case B_TL_STOP:
+ end_animated_screen(stime);
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ break;
+ case B_TL_FF:
+ /* end frame */
+ CFRA= PEFRA;
+ //update_for_newframe();
+ break;
+ case B_TL_PREVKEY:
+ /* previous keyframe */
+ //nextprev_timeline_key(-1);
+ break;
+ case B_TL_NEXTKEY:
+ /* next keyframe */
+ //nextprev_timeline_key(1);
+ break;
+
+ case B_TL_PREVIEWON:
+ if (C->scene->r.psfra) {
+ /* turn on preview range */
+ C->scene->r.psfra= C->scene->r.sfra;
+ C->scene->r.pefra= C->scene->r.efra;
+ }
+ else {
+ /* turn off preview range */
+ C->scene->r.psfra= 0;
+ C->scene->r.pefra= 0;
+ }
+ //BIF_undo_push("Set anim-preview range");
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ break;
+
+ case B_TL_INSERTKEY:
+ /* insert keyframe */
+ //common_insertkey();
+ //allqueue(REDRAWTIME, 1);
+ break;
+ case B_TL_DELETEKEY:
+ /* delete keyframe */
+ //common_deletekey();
+ //allqueue(REDRAWTIME, 1);
+ break;
}
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
+}
+
+void time_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ SpaceTime *stime= sa->spacedata.first;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_time_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
/* pull down menus */
uiBlockSetEmboss(block, UI_EMBOSSP);
-
+
xmax= GetButStringLength("View");
- uiDefPulldownBut(block, time_viewmenu, NULL,
- "View", xco, -2, xmax-3, 24, "");
+ uiDefPulldownBut(block, time_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
xco+= xmax;
xmax= GetButStringLength("Frame");
- uiDefPulldownBut(block, time_framemenu, NULL,
- "Frame", xco, -2, xmax-3, 24, "");
+ uiDefPulldownBut(block, time_framemenu, C->area,
+ "Frame", xco, yco-2, xmax-3, 24, "");
xco+= xmax;
-
+
xmax= GetButStringLength("Playback");
- uiDefPulldownBut(block, time_redrawmenu, NULL,
- "Playback", xco, -2, xmax-3, 24, "");
+ uiDefPulldownBut(block, time_redrawmenu, C->area,
+ "Playback", xco, yco-2, xmax-3, 24, "");
xco+= xmax;
}
-
+
uiBlockSetEmboss(block, UI_EMBOSS);
uiBlockBeginAlign(block);
uiDefButI(block, TOG, B_TL_PREVIEWON,"Preview",
- xco,0, XIC, YIC,
- &G.scene->r.psfra,0, 1, 0, 0,
- "Show settings for frame range of animation preview");
-
+ xco,yco, XIC, YIC,
+ &C->scene->r.psfra,0, 1, 0, 0,
+ "Show settings for frame range of animation preview");
+
xco += XIC;
- if (G.scene->r.psfra) {
- uiDefButI(block, NUM, REDRAWALL,"Start:",
- xco,0, 4.5*XIC, YIC,
- &G.scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0,
- "The start frame of the animation preview (inclusive)");
-
+ if (C->scene->r.psfra) {
+ uiDefButI(block, NUM, B_REDRAWALL,"Start:",
+ xco,yco, 4.5*XIC, YIC,
+ &C->scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0,
+ "The start frame of the animation preview (inclusive)");
+
xco += (short)(4.5*XIC);
-
- uiDefButI(block, NUM, REDRAWALL,"End:",
- xco,0,4.5*XIC,YIC,
- &G.scene->r.pefra,PSFRA,MAXFRAMEF, 0, 0,
- "The end frame of the animation preview (inclusive)");
+
+ uiDefButI(block, NUM, B_REDRAWALL,"End:",
+ xco,yco,4.5*XIC,YIC,
+ &C->scene->r.pefra,PSFRA,MAXFRAMEF, 0, 0,
+ "The end frame of the animation preview (inclusive)");
}
else {
- uiDefButI(block, NUM, REDRAWALL,"Start:",
- xco,0, 4.5*XIC, YIC,
- &G.scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0,
- "The start frame of the animation (inclusive)");
-
+ uiDefButI(block, NUM, B_REDRAWALL,"Start:",
+ xco,yco, 4.5*XIC, YIC,
+ &C->scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0,
+ "The start frame of the animation (inclusive)");
+
xco += (short)(4.5*XIC);
-
- uiDefButI(block, NUM, REDRAWALL,"End:",
- xco,0,4.5*XIC,YIC,
- &G.scene->r.efra,(float)SFRA,MAXFRAMEF, 0, 0,
- "The end frame of the animation (inclusive)");
+
+ uiDefButI(block, NUM, B_REDRAWALL,"End:",
+ xco,yco,4.5*XIC,YIC,
+ &C->scene->r.efra,(float)SFRA,MAXFRAMEF, 0, 0,
+ "The end frame of the animation (inclusive)");
}
uiBlockEndAlign(block);
-
+
xco += (short)(4.5 * XIC + 16);
uiDefButI(block, NUM, B_NEWFRAME, "",
- xco,0,3.5*XIC,YIC,
- &(G.scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0,
- "Displays Current Frame of animation");
+ xco,yco,3.5*XIC,YIC,
+ &(C->scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0,
+ "Displays Current Frame of animation");
xco += (short)(3.5 * XIC + 16);
uiDefIconBut(block, BUT, B_TL_REW, ICON_REW,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
xco+= XIC+4;
uiDefIconBut(block, BUT, B_TL_PREVKEY, ICON_PREV_KEYFRAME,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to previous keyframe (Ctrl PageDown)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to previous keyframe (Ctrl PageDown)");
xco+= XIC+4;
- if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
- uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline");
- else
+// if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM))
+// uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE,
+// xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline");
+// else
uiDefIconBut(block, BUT, B_TL_PLAY, ICON_PLAY,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline ");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline ");
xco+= XIC+4;
uiDefIconBut(block, BUT, B_TL_NEXTKEY, ICON_NEXT_KEYFRAME,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to next keyframe (Ctrl PageUp)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to next keyframe (Ctrl PageUp)");
xco+= XIC+4;
uiDefIconBut(block, BUT, B_TL_FF, ICON_FF,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)");
xco+= XIC+8;
uiDefIconButBitS(block, TOG, AUTOKEY_ON, REDRAWINFO, ICON_REC,
- xco, 0, XIC, YIC, &(G.scene->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
+ xco, yco, XIC, YIC, &(C->scene->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
xco+= XIC;
- if (IS_AUTOKEY_ON) {
+ if (C->scene->autokey_mode & AUTOKEY_ON) {
uiDefButS(block, MENU, REDRAWINFO,
- "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5",
- xco, 0, 3.5*XIC, YIC, &(G.scene->autokey_mode), 0, 1, 0, 0,
- "Mode of automatic keyframe insertion for Objects and Bones");
+ "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5",
+ xco, yco, 3.5*XIC, YIC, &(C->scene->autokey_mode), 0, 1, 0, 0,
+ "Mode of automatic keyframe insertion for Objects and Bones");
xco+= (4*XIC);
}
xco+= 16;
uiDefIconBut(block, BUT, B_TL_INSERTKEY, ICON_KEY_HLT,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Insert Keyframe for the context of the largest area (IKEY)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Insert Keyframe for the context of the largest area (IKEY)");
xco+= XIC+4;
uiDefIconBut(block, BUT, B_TL_DELETEKEY, ICON_KEY_DEHLT,
- xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Delete Keyframe for the context of the largest area (ALTKEY-IKEY)");
+ xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Delete Keyframe for the context of the largest area (ALTKEY-IKEY)");
xco+= XIC+4;
xco+= 16;
uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
- xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
+ xco, yco, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
/* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
-
+
+ uiEndBlock(C, block);
uiDrawBlock(block);
}
+
+
diff --git a/source/blender/include/BIF_writeavicodec.h b/source/blender/editors/space_time/time_intern.h
index d725bc27195..25f4c63fed1 100644
--- a/source/blender/include/BIF_writeavicodec.h
+++ b/source/blender/editors/space_time/time_intern.h
@@ -1,14 +1,12 @@
/**
- * Functions for writing windows avi-format files.
- *
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,23 +17,28 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
- *
*/
-#ifdef _WIN32
+#ifndef ED_TIME_INTERN_H
+#define ED_TIME_INTERN_H
+
+/* internal exports only */
+
+struct wmWindowManager;
+
+/* time_ops.c */
+void time_operatortypes(void);
+void time_keymap(struct wmWindowManager *wm);
-void start_avi_codec(RenderData *rd,int rectx, int recty );
-void append_avi_codec(int frame,int *pixels,int rectx, int recty);
-void end_avi_codec(void);
-int get_avicodec_settings(void);
+/* time_header.c */
+void time_header_buttons(const bContext *C, ARegion *ar);
-#endif
+#endif /* ED_TIME_INTERN_H */
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c
new file mode 100644
index 00000000000..bc0ed1634da
--- /dev/null
+++ b/source/blender/editors/space_time/time_ops.c
@@ -0,0 +1,238 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "UI_interface.h"
+#include "UI_view2d.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_markers.h"
+
+/* ********************** frame change operator ***************************/
+
+static int change_frame_init(bContext *C, wmOperator *op)
+{
+ SpaceTime *stime= C->area->spacedata.first;
+
+ stime->flag |= TIME_CFRA_NUM;
+
+ return 1;
+}
+
+static void change_frame_apply(bContext *C, wmOperator *op)
+{
+ int cfra;
+
+ cfra= RNA_int_get(op->ptr, "frame");
+
+ if(cfra < MINFRAME)
+ cfra= MINFRAME;
+
+#if 0
+ if( cfra!=CFRA || first )
+ {
+ first= 0;
+ CFRA= cfra;
+ update_for_newframe_nodraw(0); // 1= nosound
+ timeline_force_draw(stime->redraws);
+ }
+ else PIL_sleep_ms(30);
+#endif
+
+ if(cfra!=CFRA)
+ CFRA= cfra;
+
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ /* XXX: add WM_NOTE_TIME_CHANGED? */
+}
+
+static void change_frame_exit(bContext *C, wmOperator *op)
+{
+ SpaceTime *stime= C->area->spacedata.first;
+
+ stime->flag &= ~TIME_CFRA_NUM;
+}
+
+static int change_frame_exec(bContext *C, wmOperator *op)
+{
+ if(!change_frame_init(C, op))
+ return OPERATOR_CANCELLED;
+
+ change_frame_apply(C, op);
+ change_frame_exit(C, op);
+ return OPERATOR_FINISHED;
+}
+
+static int frame_from_event(bContext *C, wmEvent *event)
+{
+ ARegion *region= C->region;
+ int x, y;
+ float viewx;
+
+ x= event->x - region->winrct.xmin;
+ y= event->y - region->winrct.ymin;
+ UI_view2d_region_to_view(&region->v2d, x, y, &viewx, NULL);
+
+ return (int)floor(viewx+0.5f);
+}
+
+static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
+ change_frame_init(C, op);
+ change_frame_apply(C, op);
+
+ /* add temp handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int change_frame_cancel(bContext *C, wmOperator *op)
+{
+ change_frame_exit(C, op);
+ return OPERATOR_CANCELLED;
+}
+
+static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ /* execute the events */
+ switch(event->type) {
+ case MOUSEMOVE:
+ RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
+ change_frame_apply(C, op);
+ break;
+
+ case LEFTMOUSE:
+ if(event->val==0) {
+ change_frame_exit(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void ED_TIME_OT_change_frame(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name= "Change frame";
+ ot->idname= "ED_TIME_OT_change_frame";
+
+ /* api callbacks */
+ ot->exec= change_frame_exec;
+ ot->invoke= change_frame_invoke;
+ ot->cancel= change_frame_cancel;
+ ot->modal= change_frame_modal;
+
+ /* rna */
+ prop= RNA_def_property(ot->srna, "frame", PROP_INT, PROP_NONE);
+}
+
+/* ****************** time display toggle operator ****************************/
+
+static int toggle_time_exec(bContext *C, wmOperator *op)
+{
+ SpaceTime *stime;
+
+ if (ELEM(NULL, C->area, C->area->spacedata.first))
+ return OPERATOR_CANCELLED;
+
+ /* simply toggle draw frames flag for now */
+ // XXX in past, this displayed menu to choose... (for later!)
+ stime= C->area->spacedata.first;
+ stime->flag ^= TIME_DRAWFRAMES;
+
+ return OPERATOR_FINISHED;
+}
+
+void ED_TIME_OT_toggle_time(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Toggle Frames/Seconds";
+ ot->idname= "ED_TIME_OT_toggle_time";
+
+ /* api callbacks */
+ ot->exec= toggle_time_exec;
+}
+
+/* ************************** registration **********************************/
+
+void time_operatortypes(void)
+{
+ WM_operatortype_append(ED_TIME_OT_change_frame);
+ WM_operatortype_append(ED_TIME_OT_toggle_time);
+}
+
+void time_keymap(wmWindowManager *wm)
+{
+ ListBase *keymap= WM_keymap_listbase(wm, "TimeLine", SPACE_TIME, 0);
+
+ WM_keymap_verify_item(keymap, "ED_TIME_OT_change_frame", LEFTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_TIME_OT_toggle_time", TKEY, KM_PRESS, 0, 0);
+
+
+ /* markers (XXX move to function?) */
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_add", MKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_move", EVT_TWEAK_R, KM_ANY, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_mouseselect", RIGHTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_mouseselect_extend", RIGHTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_border_select", BKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_select_all", AKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "ED_MARKER_OT_delete", XKEY, KM_PRESS, 0, 0);
+
+ WM_keymap_add_item(keymap, "ED_MARKER_OT_move", GKEY, KM_PRESS, 0, 0);
+
+ /* generates event, in end to make select work */
+ WM_keymap_verify_item(keymap, "WM_OT_tweak_gesture", RIGHTMOUSE, KM_PRESS, 0, 0);
+
+}
+
diff --git a/source/blender/editors/space_view3d/Makefile b/source/blender/editors/space_view3d/Makefile
new file mode 100644
index 00000000000..45b6ca648d2
--- /dev/null
+++ b/source/blender/editors/space_view3d/Makefile
@@ -0,0 +1,53 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_view3d
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript
new file mode 100644
index 00000000000..01ee5bd4a06
--- /dev/null
+++ b/source/blender/editors/space_view3d/SConscript
@@ -0,0 +1,9 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+
+env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
new file mode 100644
index 00000000000..015a931d806
--- /dev/null
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -0,0 +1,266 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_view3d_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+#include "BLI_rand.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_space_api.h"
+#include "ED_screen.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "view3d_intern.h" // own include
+
+/* ******************** default callbacks for view3d space ***************** */
+
+static SpaceLink *view3d_new(void)
+{
+ ARegion *ar;
+ View3D *vd;
+
+ vd= MEM_callocN(sizeof(View3D), "initview3d");
+ vd->spacetype= SPACE_VIEW3D;
+ vd->blockscale= 0.7f;
+ vd->lay= vd->layact= 1;
+ if(G.scene) {
+ vd->lay= vd->layact= G.scene->lay;
+ vd->camera= G.scene->camera;
+ }
+ vd->scenelock= 1;
+ vd->grid= 1.0f;
+ vd->gridlines= 16;
+ vd->gridsubdiv = 10;
+ vd->drawtype= OB_WIRE;
+
+ vd->gridflag |= V3D_SHOW_X;
+ vd->gridflag |= V3D_SHOW_Y;
+ vd->gridflag |= V3D_SHOW_FLOOR;
+ vd->gridflag &= ~V3D_SHOW_Z;
+
+ vd->depths= NULL;
+
+ /* XXX move view data to region? */
+ vd->viewquat[0]= 1.0f;
+ vd->viewquat[1]= vd->viewquat[2]= vd->viewquat[3]= 0.0f;
+ vd->persp= 1;
+ vd->view= 7;
+ vd->dist= 10.0;
+ vd->lens= 35.0f;
+ vd->near= 0.01f;
+ vd->far= 500.0f;
+
+ /* header */
+ ar= MEM_callocN(sizeof(ARegion), "header for view3d");
+
+ BLI_addtail(&vd->regionbase, ar);
+ ar->regiontype= RGN_TYPE_HEADER;
+ ar->alignment= RGN_ALIGN_BOTTOM;
+ UI_view2d_header_default(&ar->v2d);
+
+ /* main area */
+ ar= MEM_callocN(sizeof(ARegion), "main area for view3d");
+
+ BLI_addtail(&vd->regionbase, ar);
+ ar->regiontype= RGN_TYPE_WINDOW;
+
+ return (SpaceLink *)vd;
+}
+
+/* not spacelink itself */
+static void view3d_free(SpaceLink *sl)
+{
+ View3D *vd= (View3D *) sl;
+
+ if(vd->bgpic) {
+ if(vd->bgpic->ima) vd->bgpic->ima->id.us--;
+ MEM_freeN(vd->bgpic);
+ }
+
+ if(vd->localvd) MEM_freeN(vd->localvd);
+ if(vd->clipbb) MEM_freeN(vd->clipbb);
+ if(vd->depths) {
+ if(vd->depths->depths) MEM_freeN(vd->depths->depths);
+ MEM_freeN(vd->depths);
+ vd->depths= NULL;
+ }
+
+// XXX retopo_free_view_data(vd);
+
+ if(vd->properties_storage) MEM_freeN(vd->properties_storage);
+ if(vd->ri) {
+// XXX BIF_view3d_previewrender_free(vd);
+ }
+
+}
+
+
+/* spacetype; init callback */
+static void view3d_init(struct wmWindowManager *wm, ScrArea *sa)
+{
+
+}
+
+static SpaceLink *view3d_duplicate(SpaceLink *sl)
+{
+ View3D *v3do= (View3D *)sl;
+ View3D *v3dn= MEM_dupallocN(sl);
+
+ /* clear or remove stuff from old */
+
+// XXX BIF_view3d_previewrender_free(v3do);
+ v3do->depths= NULL;
+ v3do->retopo_view_data= NULL;
+
+ if(v3do->localvd) {
+// XXX restore_localviewdata(v3do);
+ v3do->localvd= NULL;
+ v3do->properties_storage= NULL;
+ v3do->localview= 0;
+ v3do->lay &= 0xFFFFFF;
+ }
+
+ /* copy or clear inside new stuff */
+
+ if(v3dn->bgpic) {
+ v3dn->bgpic= MEM_dupallocN(v3dn->bgpic);
+ if(v3dn->bgpic->ima) v3dn->bgpic->ima->id.us++;
+ }
+ v3dn->clipbb= MEM_dupallocN(v3dn->clipbb);
+ v3dn->ri= NULL;
+ v3dn->properties_storage= NULL;
+
+ return (SpaceLink *)v3dn;
+}
+
+void view3d_operatortypes(void)
+{
+}
+
+void view3d_keymap(struct wmWindowManager *wm)
+{
+}
+
+static void view3d_main_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+}
+
+
+/* add handlers, stuff you only do once or on area/region changes */
+static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+}
+
+static void view3d_header_area_draw(const bContext *C, ARegion *ar)
+{
+ float col[3];
+
+ /* clear */
+ if(ED_screen_area_active(C))
+ UI_GetThemeColor3fv(TH_HEADER, col);
+ else
+ UI_GetThemeColor3fv(TH_HEADERDESEL, col);
+
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* set view2d view matrix for scrolling (without scrollers) */
+ UI_view2d_view_ortho(C, &ar->v2d);
+
+ view3d_header_buttons(C, ar);
+
+ /* restore view matrix? */
+ UI_view2d_view_restore(C);
+}
+
+
+/* only called once, from space/spacetypes.c */
+void ED_spacetype_view3d(void)
+{
+ SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype time");
+ ARegionType *art;
+
+ st->spaceid= SPACE_VIEW3D;
+
+ st->new= view3d_new;
+ st->free= view3d_free;
+ st->init= view3d_init;
+ st->duplicate= view3d_duplicate;
+ st->operatortypes= view3d_operatortypes;
+ st->keymap= view3d_keymap;
+
+ /* regions: main window */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_WINDOW;
+ art->draw= view3d_main_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ /* regions: header */
+ art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
+ art->regionid = RGN_TYPE_HEADER;
+ art->minsizey= HEADERY;
+ art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
+
+ art->init= view3d_header_area_init;
+ art->draw= view3d_header_area_draw;
+
+ BLI_addhead(&st->regiontypes, art);
+
+ BKE_spacetype_register(st);
+}
+
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
new file mode 100644
index 00000000000..f85ecc468e3
--- /dev/null
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -0,0 +1,132 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+#include <stdio.h>
+
+#include "DNA_space_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_screen.h"
+
+#include "ED_screen.h"
+#include "ED_util.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "view3d_intern.h"
+
+
+/* ************************ header area region *********************** */
+
+static void do_viewmenu(bContext *C, void *arg, int event)
+{
+
+}
+
+static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused)
+{
+ ScrArea *curarea= C->area;
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiBeginBlock(C, handle->region, "dummy_viewmenu", UI_EMBOSSP, UI_HELV);
+ uiBlockSetButmFunc(block, do_viewmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+ uiEndBlock(C, block);
+
+ return block;
+}
+
+
+static void do_view3d_buttons(bContext *C, void *arg, int event)
+{
+ switch(event) {
+ }
+}
+
+
+void view3d_header_buttons(const bContext *C, ARegion *ar)
+{
+ ScrArea *sa= C->area;
+ uiBlock *block;
+ int xco, yco= 3;
+
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ uiBlockSetHandleFunc(block, do_view3d_buttons, NULL);
+
+ xco= ED_area_header_standardbuttons(C, block, yco);
+
+ if((sa->flag & HEADER_NO_PULLDOWN)==0) {
+ int xmax;
+
+ /* pull down menus */
+ uiBlockSetEmboss(block, UI_EMBOSSP);
+
+ xmax= GetButStringLength("View");
+ uiDefPulldownBut(block, dummy_viewmenu, C->area,
+ "View", xco, yco-2, xmax-3, 24, "");
+ }
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+
+ /* always as last */
+ sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
+
+ uiEndBlock(C, block);
+ uiDrawBlock(block);
+}
+
+
diff --git a/source/blender/include/BDR_drawmesh.h b/source/blender/editors/space_view3d/view3d_intern.h
index 34351549345..40c30269d87 100644
--- a/source/blender/include/BDR_drawmesh.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,24 +17,30 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
+#ifndef ED_VIEW3D_INTERN_H
+#define ED_VIEW3D_INTERN_H
+
+/* internal exports only */
-#ifndef BDR_DRAWMESH_H
-#define BDR_DRAWMESH_H
+typedef struct ViewDepths {
+ unsigned short w, h;
+ float *depths;
+ double depth_range[2];
+
+ char damaged;
+} ViewDepths;
-struct Object;
-struct DerivedMesh;
+/* view3d_header.c */
+void view3d_header_buttons(const bContext *C, ARegion *ar);
-void draw_mesh_textured(struct Object *ob, struct DerivedMesh *dm, int facesel);
-void draw_mesh_text(struct Object *ob, int glsl);
-#endif /* BDR_DRAWMESH_H */
+#endif /* ED_VIEW3D_INTERN_H */
diff --git a/source/blender/editors/transform/Makefile b/source/blender/editors/transform/Makefile
new file mode 100644
index 00000000000..b2aeaa145f7
--- /dev/null
+++ b/source/blender/editors/transform/Makefile
@@ -0,0 +1,52 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_screen
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../imbuf
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/source/blender/editors/transform/SConscript
diff --git a/source/blender/editors/util/Makefile b/source/blender/editors/util/Makefile
new file mode 100644
index 00000000000..da701dc5d86
--- /dev/null
+++ b/source/blender/editors/util/Makefile
@@ -0,0 +1,54 @@
+#
+# $Id: Makefile 14 2002-10-13 15:57:19Z hans $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2007 Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Makes module object directory and bounces make to subdirectories.
+
+LIBNAME = ed_util
+DIR = $(OCGDIR)/blender/$(LIBNAME)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += -I$(OPENGL_HEADERS)
+
+# not very neat....
+CPPFLAGS += -I../../windowmanager
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../python
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+
+# own include
+
+CPPFLAGS += -I../include
diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript
new file mode 100644
index 00000000000..48b0a99d889
--- /dev/null
+++ b/source/blender/editors/util/SConscript
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('*.c')
+
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
+incs += ' ../../makesrna'
+
+env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core','intern'], priority=[40, 45] )
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
new file mode 100644
index 00000000000..841c5cd3cb5
--- /dev/null
+++ b/source/blender/editors/util/ed_util.c
@@ -0,0 +1,82 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+
+#include "ED_util.h"
+
+#include "UI_text.h"
+
+/* ********* general editor util funcs, not BKE stuff please! ********* */
+/* ***** XXX: functions are using old blender names, cleanup later ***** */
+
+
+/* now only used in 2d spaces, like time, ipo, nla, sima... */
+/* XXX clean G.qual */
+void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert)
+{
+ /* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */
+ int ctrl;
+
+ if(invert) {
+ if(G.qual & LR_CTRLKEY) ctrl= 0;
+ else ctrl= 1;
+ }
+ else ctrl= (G.qual & LR_CTRLKEY);
+
+ if(ctrl && (G.qual & LR_SHIFTKEY)) {
+ if(fac3!= 0.0) *val= fac3*floor(*val/fac3 +.5);
+ }
+ else if(ctrl) {
+ if(fac2!= 0.0) *val= fac2*floor(*val/fac2 +.5);
+ }
+ else {
+ if(fac1!= 0.0) *val= fac1*floor(*val/fac1 +.5);
+ }
+}
+
+
+int GetButStringLength(char *str)
+{
+ int rt;
+
+ rt= UI_GetStringWidth(G.font, str, (U.transopts & USER_TR_BUTTONS));
+
+ return rt + 15;
+}
+
diff --git a/source/blender/ftfont/SConscript b/source/blender/ftfont/SConscript
index 615b274677c..9cdfbe41026 100644
--- a/source/blender/ftfont/SConscript
+++ b/source/blender/ftfont/SConscript
@@ -4,11 +4,11 @@ Import ('env')
sources = env.Glob('intern/*.cpp')
-incs = '. intern ../blenkernel ../blenlib ../makesdna ../include'
+incs = '. intern ../blenkernel ../blenlib ../makesdna ../editors/include'
incs += ' ' + env['BF_FTGL_INC']
incs += ' ' + env['BF_FREETYPE_INC']
incs += ' ' + env['BF_GETTEXT_INC']
-
+
defs = 'FTGL_STATIC_LIBRARY'
if sys.platform == 'win32':
defs += ' _WIN32 USE_GETTEXT_DLL'
diff --git a/source/blender/ftfont/intern/FTF_Api.cpp b/source/blender/ftfont/intern/FTF_Api.cpp
index c8f779e5d5e..702d054e71c 100644
--- a/source/blender/ftfont/intern/FTF_Api.cpp
+++ b/source/blender/ftfont/intern/FTF_Api.cpp
@@ -43,7 +43,7 @@
#ifdef __cplusplus
extern "C" {
#endif
- #include "datatoc.h"
+//XXX #include "datatoc.h"
#ifdef __cplusplus
}
#endif
@@ -68,7 +68,7 @@ FTF_EXPORT int FTF_GetNewFont (const unsigned char *str, int datasize, int fonts
newfont= new FTF_TTFont();
if (!(newfont->SetFont((unsigned char*)str, datasize, fontsize))) {
- newfont->SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, fontsize);
+ //XXX newfont->SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, fontsize);
return 0;
}
return 1;
diff --git a/source/blender/ftfont/intern/Makefile b/source/blender/ftfont/intern/Makefile
index 6bddda9a25c..6e145ee442e 100644
--- a/source/blender/ftfont/intern/Makefile
+++ b/source/blender/ftfont/intern/Makefile
@@ -39,12 +39,11 @@ CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../include
+CPPFLAGS += -I../../editors/include
CPPFLAGS += -I$(NAN_FTGL)/include
CPPFLAGS += -I$(NAN_FTGL)/include/FTGL
CPPFLAGS += -I$(NAN_GETTEXT)/include
CPPFLAGS += -I$(NAN_FREETYPE)/include
-CPPFLAGS += -I$(OPENGL_HEADERS)
ifeq ($(OS), windows)
CPPFLAGS += -I$(NAN_ICONV)/include
ifeq ($(FREE_WINDOWS), true)
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index d4d8030bf10..8bc1439fd09 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -403,9 +403,14 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf);
*
* @attention defined in imageprocess.c
*/
-void bicubic_interpolation(struct ImBuf *in, struct ImBuf *out, float x, float y, int xout, int yout);
+void bicubic_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
void neareast_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
void bilinear_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
+
+void bicubic_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);
+void neareast_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);
+void bilinear_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);
+
/**
* Change the ordering of the color bytes pointed to by rect from
* rgba to abgr. size * 4 color bytes are reordered.
diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript
index a8c49c0394e..cb4759ed240 100644
--- a/source/blender/imbuf/SConscript
+++ b/source/blender/imbuf/SConscript
@@ -39,4 +39,4 @@ if env['WITH_BF_QUICKTIME']:
incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
defs.append('WITH_QUICKTIME')
-env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [80, 40] )
+env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [95, 35] )
diff --git a/source/blender/imbuf/intern/cineon/SConscript b/source/blender/imbuf/intern/cineon/SConscript
index 7bfaa8dbdf2..f887516443c 100644
--- a/source/blender/imbuf/intern/cineon/SConscript
+++ b/source/blender/imbuf/intern/cineon/SConscript
@@ -13,5 +13,5 @@ incs = ['.',
'../../../makesdna']
defs = []
-
-env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [90, 200])
+
+env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [120, 75])
diff --git a/source/blender/imbuf/intern/dds/SConscript b/source/blender/imbuf/intern/dds/SConscript
index d005bae02be..f56c238fd2a 100644
--- a/source/blender/imbuf/intern/dds/SConscript
+++ b/source/blender/imbuf/intern/dds/SConscript
@@ -16,4 +16,4 @@ incs = ['.',
defs = ['WITH_DDS']
-env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [90, 200])
+env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [110, 105])
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index d7f1ab4419d..fe7e26eac2b 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -80,6 +80,17 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
}
}
}
+static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **outF, int x, int y)
+
+{
+ int offset = ibuf->x * y * 4 + 4*x;
+
+ if (ibuf->rect)
+ *outI= (unsigned char *)ibuf->rect + offset;
+
+ if (ibuf->rect_float)
+ *outF= (float *)ibuf->rect_float + offset;
+}
/**************************************************************************
* INTERPOLATIONS
@@ -92,32 +103,40 @@ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf)
/* More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
*/
/* function assumes out to be zero'ed, only does RGBA */
+
+static float P(float k){
+ float p1, p2, p3, p4;
+ p1 = MAX2(k+2.0f,0);
+ p2 = MAX2(k+1.0f,0);
+ p3 = MAX2(k,0);
+ p4 = MAX2(k-1.0f,0);
+ return (float)(1.0f/6.0f)*( p1*p1*p1 - 4.0f * p2*p2*p2 + 6.0f * p3*p3*p3 - 4.0f * p4*p4*p4);
+}
+
+
+#if 0
+/* older, slower function, works the same as above */
static float P(float k){
return (float)(1.0f/6.0f)*( pow( MAX2(k+2.0f,0) , 3.0f ) - 4.0f * pow( MAX2(k+1.0f,0) , 3.0f ) + 6.0f * pow( MAX2(k,0) , 3.0f ) - 4.0f * pow( MAX2(k-1.0f,0) , 3.0f));
}
+#endif
-void bicubic_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, int yout)
+void bicubic_interpolation_color(struct ImBuf *in, unsigned char *outI, float *outF, float u, float v)
{
int i,j,n,m,x1,y1;
- unsigned char *dataI,*outI;
- float a,b,w,wx,wy[4], outR,outG,outB,outA,*dataF,*outF;
- int do_rect, do_float;
-
- if (in == NULL) return;
- if (in->rect == NULL && in->rect_float == NULL) return;
+ unsigned char *dataI;
+ float a,b,w,wx,wy[4], outR,outG,outB,outA,*dataF;
- do_rect= (out->rect != NULL);
- do_float= (out->rect_float != NULL);
+ /* ImBuf in must have a valid rect or rect_float, assume this is alredy checked */
- i= (int)floor(x);
- j= (int)floor(y);
- a= x - i;
- b= y - j;
+ i= (int)floor(u);
+ j= (int)floor(v);
+ a= u - i;
+ b= v - j;
- outR= 0.0f;
- outG= 0.0f;
- outB= 0.0f;
- outA= 0.0f;
+ outR = outG = outB = outA = 0.0f;
+
+/* Optimized and not so easy to read */
/* avoid calling multiple times */
wy[0] = P(b-(-1));
@@ -137,14 +156,14 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, in
/* except that would call P() 16 times per pixel therefor pow() 64 times, better precalc these */
w = wx * wy[m+1];
- if (do_float) {
+ if (outF) {
dataF= in->rect_float + in->x * y1 * 4 + 4*x1;
outR+= dataF[0] * w;
outG+= dataF[1] * w;
outB+= dataF[2] * w;
outA+= dataF[3] * w;
}
- if (do_rect) {
+ if (outI) {
dataI= (unsigned char*)in->rect + in->x * y1 * 4 + 4*x1;
outR+= dataI[0] * w;
outG+= dataI[1] * w;
@@ -155,15 +174,42 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, in
}
}
}
- if (do_rect) {
- outI= (unsigned char *)out->rect + out->x * yout * 4 + 4*xout;
+
+/* Done with optimized part */
+
+#if 0
+ /* older, slower function, works the same as above */
+ for(n= -1; n<= 2; n++){
+ for(m= -1; m<= 2; m++){
+ x1= i+n;
+ y1= j+m;
+ if (x1>0 && x1 < in->x && y1>0 && y1<in->y) {
+ if (do_float) {
+ dataF= in->rect_float + in->x * y1 * 4 + 4*x1;
+ outR+= dataF[0] * P(n-a) * P(b-m);
+ outG+= dataF[1] * P(n-a) * P(b-m);
+ outB+= dataF[2] * P(n-a) * P(b-m);
+ outA+= dataF[3] * P(n-a) * P(b-m);
+ }
+ if (do_rect) {
+ dataI= (unsigned char*)in->rect + in->x * y1 * 4 + 4*x1;
+ outR+= dataI[0] * P(n-a) * P(b-m);
+ outG+= dataI[1] * P(n-a) * P(b-m);
+ outB+= dataI[2] * P(n-a) * P(b-m);
+ outA+= dataI[3] * P(n-a) * P(b-m);
+ }
+ }
+ }
+ }
+#endif
+
+ if (outI) {
outI[0]= (int)outR;
outI[1]= (int)outG;
outI[2]= (int)outB;
outI[3]= (int)outA;
}
- if (do_float) {
- outF= (float *)out->rect_float + out->x * yout * 4 + 4*xout;
+ if (outF) {
outF[0]= outR;
outF[1]= outG;
outF[2]= outB;
@@ -171,23 +217,33 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, in
}
}
+
+void bicubic_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
+{
+
+ unsigned char *outI = NULL;
+ float *outF = NULL;
+
+ if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
+
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+
+ bicubic_interpolation_color(in, outI, outF, u, v);
+}
+
/* function assumes out to be zero'ed, only does RGBA */
/* BILINEAR INTERPOLATION */
-void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
+void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float *outF, float u, float v)
{
- float *row1, *row2, *row3, *row4, a, b, *outF;
- unsigned char *row1I, *row2I, *row3I, *row4I, *outI;
+ float *row1, *row2, *row3, *row4, a, b;
+ unsigned char *row1I, *row2I, *row3I, *row4I;
float a_b, ma_b, a_mb, ma_mb;
float empty[4]= {0.0f, 0.0f, 0.0f, 0.0f};
unsigned char emptyI[4]= {0, 0, 0, 0};
int y1, y2, x1, x2;
- int do_rect, do_float;
-
- if (in==NULL) return;
- if (in->rect==NULL && in->rect_float==NULL) return;
-
- do_rect= (out->rect != NULL);
- do_float= (out->rect_float != NULL);
+
+
+ /* ImBuf in must have a valid rect or rect_float, assume this is alredy checked */
x1= (int)floor(u);
x2= (int)ceil(u);
@@ -197,16 +253,7 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i
// sample area entirely outside image?
if (x2<0 || x1>in->x-1 || y2<0 || y1>in->y-1) return;
- if (do_rect)
- outI=(unsigned char *)out->rect + out->x * yout * 4 + 4*xout;
- else
- outI= NULL;
- if (do_float)
- outF=(float *)out->rect_float + out->x * yout * 4 + 4*xout;
- else
- outF= NULL;
-
- if (do_float) {
+ if (outF) {
// sample including outside of edges of image
if (x1<0 || y1<0) row1= empty;
else row1= (float *)in->rect_float + in->x * y1 * 4 + 4*x1;
@@ -229,7 +276,7 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i
outF[2]= ma_mb*row1[2] + a_mb*row3[2] + ma_b*row2[2]+ a_b*row4[2];
outF[3]= ma_mb*row1[3] + a_mb*row3[3] + ma_b*row2[3]+ a_b*row4[3];
}
- if (do_rect) {
+ if (outI) {
// sample including outside of edges of image
if (x1<0 || y1<0) row1I= emptyI;
else row1I= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x1;
@@ -254,45 +301,44 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i
}
}
+void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, int yout)
+{
+
+ unsigned char *outI = NULL;
+ float *outF = NULL;
+
+ if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
+
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+
+ bilinear_interpolation_color(in, outI, outF, u, v);
+}
+
/* function assumes out to be zero'ed, only does RGBA */
/* NEAREST INTERPOLATION */
-void neareast_interpolation(ImBuf *in, ImBuf *out, float u, float v,int xout, int yout)
+void neareast_interpolation_color(struct ImBuf *in, unsigned char *outI, float *outF, float u, float v)
{
- float *outF,*dataF;
- unsigned char *dataI,*outI;
+ float *dataF;
+ unsigned char *dataI;
int y1, x1;
- int do_rect, do_float;
-
- if (in==NULL) return;
- if (in->rect==NULL && in->rect_float==NULL) return;
-
- do_rect= (out->rect != NULL);
- do_float= (out->rect_float != NULL);
+ /* ImBuf in must have a valid rect or rect_float, assume this is alredy checked */
+
x1= (int)(u);
y1= (int)(v);
- if (do_rect)
- outI=(unsigned char *)out->rect + out->x * yout * 4 + 4*xout;
- else
- outI= NULL;
- if (do_float)
- outF=(float *)out->rect_float + out->x * yout * 4 + 4*xout;
- else
- outF= NULL;
-
// sample area entirely outside image?
if (x1<0 || x1>in->x-1 || y1<0 || y1>in->y-1) return;
// sample including outside of edges of image
if (x1<0 || y1<0) {
- if (do_rect) {
+ if (outI) {
outI[0]= 0;
outI[1]= 0;
outI[2]= 0;
outI[3]= 0;
}
- if (do_float) {
+ if (outF) {
outF[0]= 0.0f;
outF[1]= 0.0f;
outF[2]= 0.0f;
@@ -300,14 +346,14 @@ void neareast_interpolation(ImBuf *in, ImBuf *out, float u, float v,int xout, in
}
} else {
dataI= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x1;
- if (do_rect) {
+ if (outI) {
outI[0]= dataI[0];
outI[1]= dataI[1];
outI[2]= dataI[2];
outI[3]= dataI[3];
}
dataF= in->rect_float + in->x * y1 * 4 + 4*x1;
- if (do_float) {
+ if (outF) {
outF[0]= dataF[0];
outF[1]= dataF[1];
outF[2]= dataF[2];
@@ -315,3 +361,16 @@ void neareast_interpolation(ImBuf *in, ImBuf *out, float u, float v,int xout, in
}
}
}
+
+void neareast_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, int yout)
+{
+
+ unsigned char *outI = NULL;
+ float *outF = NULL;
+
+ if (in == NULL || (in->rect == NULL && in->rect_float == NULL)) return;
+
+ pixel_from_buffer(out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */
+
+ neareast_interpolation_color(in, outI, outF, x, y);
+}
diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript
index 1b0a0ed6110..2ce3d18feb5 100644
--- a/source/blender/imbuf/intern/openexr/SConscript
+++ b/source/blender/imbuf/intern/openexr/SConscript
@@ -14,5 +14,5 @@ incs = ['.',
incs += Split(env['BF_OPENEXR_INC'])
defs = []
-
-env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [90, 200])
+
+env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [125, 85])
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 718b0537b48..14d6cb2d54b 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -27,9 +27,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/* also defined in BKE_utildefines, repeated here to avoid dependency */
-#define FILE_MAX 240
+#include <stdio.h>
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 5a4f83a473b..11cb1ed039a 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -33,6 +33,8 @@
#include <io.h>
#endif
+#include <stdio.h>
+
#include "BKE_global.h"
#include "BLI_blenlib.h"
diff --git a/source/blender/include/BDR_drawaction.h b/source/blender/include/BDR_drawaction.h
deleted file mode 100644
index 7cb0768e832..00000000000
--- a/source/blender/include/BDR_drawaction.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_DRAWACTION_H
-#define BDR_DRAWACTION_H
-
-struct BezTriple;
-struct Ipo;
-struct IpoCurve;
-struct gla2DDrawInfo;
-struct bAction;
-struct bActionGroup;
-struct Object;
-struct ListBase;
-struct bGPDlayer;
-
-/* ****************************** Base Structs ****************************** */
-
-/* Keyframe Column Struct */
-typedef struct ActKeyColumn {
- struct ActKeyColumn *next, *prev;
- short sel, handle_type;
- float cfra;
-
- /* only while drawing - used to determine if long-keyframe needs to be drawn */
- short modified;
- short totcurve;
-} ActKeyColumn;
-
-/* 'Long Keyframe' Struct */
-typedef struct ActKeyBlock {
- struct ActKeyBlock *next, *prev;
- short sel, handle_type;
- float val;
- float start, end;
-
- /* only while drawing - used to determine if block needs to be drawn */
- short modified;
- short totcurve;
-} ActKeyBlock;
-
-
-/* Inclusion-Range Limiting Struct (optional) */
-typedef struct ActKeysInc {
- struct Object *ob; /* if present, used to find action-scaled time */
- float start, end; /* frames (global-time) to only consider keys between */
-} ActKeysInc;
-
-/* ******************************* Methods ****************************** */
-
-/* Action Generics */
-void draw_cfra_action(void);
-
-/* Channel Drawing */
-void draw_icu_channel(struct gla2DDrawInfo *di, struct IpoCurve *icu, float ypos);
-void draw_ipo_channel(struct gla2DDrawInfo *di, struct Ipo *ipo, float ypos);
-void draw_agroup_channel(struct gla2DDrawInfo *di, struct bActionGroup *agrp, float ypos);
-void draw_action_channel(struct gla2DDrawInfo *di, struct bAction *act, float ypos);
-void draw_object_channel(struct gla2DDrawInfo *di, struct Object *ob, float ypos);
-void draw_gpl_channel(struct gla2DDrawInfo *di, struct bGPDlayer *gpl, float ypos);
-
-/* Keydata Generation */
-void icu_to_keylist(struct IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-void ipo_to_keylist(struct Ipo *ipo, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki);
-
-#endif /* BDR_DRAWACTION_H */
-
diff --git a/source/blender/include/BDR_drawobject.h b/source/blender/include/BDR_drawobject.h
deleted file mode 100644
index 635b73af80c..00000000000
--- a/source/blender/include/BDR_drawobject.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_DRAWOBJECT_H
-#define BDR_DRAWOBJECT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-struct Object;
-struct Nurb;
-struct Lamp;
-struct ListBase;
-struct BoundBox;
-struct Base;
-struct BPoint;
-struct BezTriple;
-struct EditVert;
-struct EditFace;
-struct EditEdge;
-
-int draw_glsl_material(struct Object *ob, int dt);
-
-void mesh_foreachScreenVert(void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
-void mesh_foreachScreenEdge(void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts);
-void mesh_foreachScreenFace(void (*func)(void *userData, struct EditFace *efa, int x, int y, int index), void *userData);
-
-void lattice_foreachScreenVert(void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
-void nurbs_foreachScreenVert(void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
-
-void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
-void get_local_bounds(struct Object *ob, float *center, float *size);
-
-/* drawing flags: */
-#define DRAW_PICKING 1
-#define DRAW_CONSTCOLOR 2
-#define DRAW_SCENESET 4
-void draw_object(struct Base *base, int flag);
-void drawaxes(float size, int flag, char drawtype);
-
-void draw_object_ext(struct Base *base);
-void drawsolidcube(float size);
-extern void draw_object_backbufsel(struct Object *ob);
-void draw_object_instance(struct Object *ob, int dt, int outline);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BDR_DRAWOBJECT_H */
-
diff --git a/source/blender/include/BDR_editcurve.h b/source/blender/include/BDR_editcurve.h
deleted file mode 100644
index 363a6567f3e..00000000000
--- a/source/blender/include/BDR_editcurve.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_EDITCURVE_H
-#define BDR_EDITCURVE_H
-
-struct Object;
-struct Curve;
-struct Nurb;
-struct BezTriple;
-struct BPoint;
-struct BezTripleNurb;
-
-void set_actNurb(struct Nurb *nu);
-struct Nurb * get_actNurb( void );
-
-short isNurbsel(struct Nurb *nu);
-int isNurbsel_count(struct Nurb *nu);
-void printknots(void);
-void load_editNurb(void);
-void make_editNurb(void);
-void remake_editNurb(void);
-void separate_nurb(void);
-short isNurbselUV(struct Nurb *nu, int *u, int *v, int flag);
-void setflagsNurb(short flag);
-void rotateflagNurb(short flag, float *cent, float rotmat[][3]);
-void translateflagNurb(short flag, float *vec);
-void weightflagNurb(short flag, float w, int mode);
-void deleteflagNurb(short flag);
-short extrudeflagNurb(int flag);
-void adduplicateflagNurb(short flag);
-void switchdirectionNurb2(void);
-void switchdirection_knots(float *base, int tot);
-void deselectall_nurb(void);
-void hideNurb(int swap);
-void revealNurb(void);
-void selectswapNurb(void);
-void subdivideNurb(void);
-
-int convertspline(short type, struct Nurb *nu);
-void setsplinetype(short type);
-void rotate_direction_nurb(struct Nurb *nu);
-int is_u_selected(struct Nurb *nu, int u);
-void make_selection_list_nurb(void);
-void merge_2_nurb(struct Nurb *nu1, struct Nurb *nu2);
-void merge_nurb(void);
-void addsegment_nurb(void);
-void mouse_nurb(void);
-void spinNurb(float *dvec, short mode);
-void addvert_Nurb(int mode);
-void extrude_nurb(void);
-void makecyclicNurb(void);
-void selectconnected_nurb(void);
-void selectrow_nurb(void);
-void selectend_nurb(short selfirst, short doswap, short selstatus);
-void select_more_nurb(void);
-void select_less_nurb(void);
-void select_next_nurb(void);
-void select_prev_nurb(void);
-void select_random_nurb(void);
-void select_every_nth_nurb(void);
-void adduplicate_nurb(void);
-void delNurb(void);
-void nurb_set_smooth(short event);
-int join_curve(int type);
-struct Nurb *addNurbprim(int type, int stype, int newname);
-void default_curve_ipo(struct Curve *cu);
-void add_primitiveCurve(int stype);
-void add_primitiveNurb(int type);
-void clear_tilt(void);
-void clever_numbuts_curve(void);
-int bezt_compare (const void *e1, const void *e2);
-void setweightNurb( void );
-void setradiusNurb( void );
-void smoothradiusNurb( void );
-void smoothNurb( void );
-
-extern void undo_push_curve(char *name);
-
-#endif /* BDR_EDITCURVE_H */
diff --git a/source/blender/include/BDR_editface.h b/source/blender/include/BDR_editface.h
deleted file mode 100644
index 58b344981ca..00000000000
--- a/source/blender/include/BDR_editface.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_EDITFACE_H
-#define BDR_EDITFACE_H
-
-struct MTFace;
-struct EditFace;
-struct EditEdge;
-struct Mesh;
-struct MCol;
-
-struct MTFace *get_active_mtface(struct EditFace **efa, struct MCol **mcol, int sloppy);
-void calculate_uv_map(unsigned short mapmode);
-void default_uv(float uv[][2], float size);
-void make_tfaces(struct Mesh *me);
-void reveal_tface(void);
-void hide_tface(void);
-void select_linked_tfaces(int mode);
-void deselectall_tface(void);
-void selectswap_tface(void);
-void rotate_uv_tface(void);
-void mirror_uv_tface(void);
-int minmax_tface(float *min, float *max);
-void face_select(void);
-void face_borderselect(void);
-void uv_autocalc_tface(void);
-void set_texturepaint(void);
-void get_same_uv(void);
-void seam_mark_clear_tface(short mode);
-int edgetag_shortest_path(struct EditEdge *source, struct EditEdge *target);
-void edgetag_context_set(struct EditEdge *eed, int val);
-int edgetag_context_check(struct EditEdge *eed);
-#endif /* BDR_EDITFACE_H */
-
diff --git a/source/blender/include/BDR_editmball.h b/source/blender/include/BDR_editmball.h
deleted file mode 100644
index 607d65a64df..00000000000
--- a/source/blender/include/BDR_editmball.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_EDITMBALL_H
-#define BDR_EDITMBALL_H
-
-void make_editMball(void);
-void load_editMball(void);
-
-/**
- * @attention The argument is discarded. It is there for
- * compatibility.
- */
-void add_primitiveMball(int);
-void deselectall_mball(void);
-void selectinverse_mball(void);
-void selectrandom_mball(void);
-void mouse_mball(void);
-void adduplicate_mball(void);
-void delete_mball(void);
-void freeMetaElemlist(struct ListBase *lb);
-void undo_push_mball(char *name);
-void hide_mball(char hide);
-void reveal_mball(void);
-
-#endif /* BDR_EDITMBALL_H */
-
diff --git a/source/blender/include/BDR_editobject.h b/source/blender/include/BDR_editobject.h
deleted file mode 100644
index 11e6478f29a..00000000000
--- a/source/blender/include/BDR_editobject.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_EDITOBJECT_H
-#define BDR_EDITOBJECT_H
-
-struct Object;
-struct Tex;
-struct Material;
-struct Base;
-struct HookModifierData;
-struct Scene;
-
-void add_object_draw(int type);
-void add_objectLamp(short type);
-void free_and_unlink_base_from_scene(struct Scene *scene, struct Base *base);
-void free_and_unlink_base(struct Base *base);
-void delete_obj(int ok);
-void make_track(void);
-void apply_obmat(struct Object *ob);
-void clear_parent(void);
-void clear_track(void);
-void clear_object(char mode);
-void reset_slowparents(void);
-void set_slowparent(void);
-void make_vertex_parent(void);
-int test_parent_loop(struct Object *par, struct Object *ob);
-void make_parent(void);
-void make_proxy(void);
-
-#define EM_WAITCURSOR (1 << 0)
-#define EM_FREEDATA (1 << 1)
-#define EM_FREEUNDO (1 << 2)
-
-void exit_editmode(int flag);
-void check_editmode(int type);
-void enter_editmode(int wc);
-
-void exit_paint_modes(void);
-
-void docenter(int centermode);
-void docenter_new(void);
-void docenter_cursor(void);
-void movetolayer(void);
-void special_editmenu(void);
-void convertmenu(void);
-void copy_attr_menu(void);
-void copy_attr(short event);
-void link_to_scene(unsigned short nr);
-void make_links_menu(void);
-void make_links(short event);
-void make_duplilist_real(void);
-void make_object_duplilist_real(struct Base *base);
-void apply_objects_locrot(void);
-void apply_objects_scale(void);
-void apply_objects_rot(void);
-void apply_objects_visual_tx(void);
-void apply_object(void);
-
-/* old transform */
-void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert);
-void headerprint(char *str);
-/* used for old game engine collision optimize */
-int cylinder_intersect_test(void);
-int sphere_intersect_test(void);
-
-
-void std_rmouse_transform(void (*xf_func)(int, int));
-void rightmouse_transform(void);
-void single_object_users(int flag);
-void new_id_matar(struct Material **matar, int totcol);
-void single_obdata_users(int flag);
-void single_mat_users(int flag);
-void single_ipo_users(int flag);
-void do_single_tex_user(struct Tex **from);
-void single_tex_users_expand(void);
-void single_mat_users_expand(void);
-void single_user(void);
-void make_local_menu(void);
-void make_local(int mode);
-void adduplicate(int mode, int dupflag); /* when the dupflag is 0 no data is duplicated */
-void selectlinks_menu(void);
-void selectlinks(int nr);
-void image_aspect(void);
-void set_ob_ipoflags(void);
-void select_select_keys(void);
-int vergbaseco(const void *a1, const void *a2);
-void auto_timeoffs(void);
-void ofs_timeoffs(void);
-void rand_timeoffs(void);
-void texspace_edit(void);
-void flip_subdivison(int);
-void mirrormenu(void);
-void hookmenu(void); /* object mode hook menu */
-
-
-void add_hook_menu(void);
-void add_hook(int mode);
-void hook_select(struct HookModifierData *hmd);
-int hook_getIndexArray(int *tot, int **indexar, char *name, float *cent_r);
-
-int object_is_libdata(struct Object *ob);
-int object_data_is_libdata(struct Object *ob);
-void hide_objects(int select);
-void show_objects(void);
-
-#endif /* BDR_EDITOBJECT_H */
-
diff --git a/source/blender/include/BDR_gpencil.h b/source/blender/include/BDR_gpencil.h
deleted file mode 100644
index 6af156775be..00000000000
--- a/source/blender/include/BDR_gpencil.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_GPENCIL_H
-#define BDR_GPENCIL_H
-
-struct ListBase;
-struct bScreen;
-struct ScrArea;
-struct View3D;
-struct SpaceNode;
-struct SpaceSeq;
-struct bGPdata;
-struct bGPDlayer;
-struct bGPDframe;
-
-/* ------------- Grease-Pencil Helpers -------------- */
-
-/* Temporary 'Stroke Point' data */
-typedef struct tGPspoint {
- short x, y; /* x and y coordinates of cursor (in relative to area) */
- float pressure; /* pressure of tablet at this point */
-} tGPspoint;
-
-/* ------------ Grease-Pencil API ------------------ */
-
-void free_gpencil_strokes(struct bGPDframe *gpf);
-void free_gpencil_frames(struct bGPDlayer *gpl);
-void free_gpencil_layers(struct ListBase *list);
-void free_gpencil_data(struct bGPdata *gpd);
-
-struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe);
-struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd);
-struct bGPdata *gpencil_data_addnew(void);
-
-struct bGPDframe *gpencil_frame_duplicate(struct bGPDframe *src);
-struct bGPDlayer *gpencil_layer_duplicate(struct bGPDlayer *src);
-struct bGPdata *gpencil_data_duplicate(struct bGPdata *gpd);
-
-struct bGPdata *gpencil_data_getactive(struct ScrArea *sa);
-short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd);
-struct ScrArea *gpencil_data_findowner(struct bGPdata *gpd);
-
-void gpencil_frame_delete_laststroke(struct bGPDframe *gpf);
-
-struct bGPDframe *gpencil_layer_getframe(struct bGPDlayer *gpl, int cframe, short addnew);
-void gpencil_layer_delframe(struct bGPDlayer *gpl, struct bGPDframe *gpf);
-struct bGPDlayer *gpencil_layer_getactive(struct bGPdata *gpd);
-void gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active);
-void gpencil_layer_delactive(struct bGPdata *gpd);
-
-void gpencil_delete_actframe(struct bGPdata *gpd);
-void gpencil_delete_laststroke(struct bGPdata *gpd);
-
-void gpencil_delete_operation(short mode);
-void gpencil_delete_menu(void);
-
-void gpencil_convert_operation(short mode);
-void gpencil_convert_menu(void);
-
-short gpencil_do_paint(struct ScrArea *sa, short mousebutton);
-
-#endif /* BDR_GPENCIL_H */
diff --git a/source/blender/include/BDR_imagepaint.h b/source/blender/include/BDR_imagepaint.h
deleted file mode 100644
index bd1ac301416..00000000000
--- a/source/blender/include/BDR_imagepaint.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_IMAGEPAINT_H
-#define BDR_IMAGEPAINT_H
-
-void imagepaint_redraw_tool(void);
-void imagepaint_pick(short mousebutton);
-void imagepaint_paint(short mousebutton, short texturepaint);
-
-void undo_imagepaint_step(int step);
-void undo_imagepaint_clear(void);
-
-#endif /* BDR_IMAGEPAINT_H */
-
diff --git a/source/blender/include/BDR_sculptmode.h b/source/blender/include/BDR_sculptmode.h
deleted file mode 100644
index e36b8674612..00000000000
--- a/source/blender/include/BDR_sculptmode.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_SCULPTMODE_H
-#define BDR_SCULPTMODE_H
-
-#include "DNA_listBase.h"
-#include "DNA_vec_types.h"
-#include "BKE_sculpt.h"
-
-struct uiBlock;
-struct BrushAction;
-struct BrushData;
-struct IndexNode;
-struct KeyBlock;
-struct Mesh;
-struct Object;
-struct PartialVisibility;
-struct Scene;
-struct ScrArea;
-struct SculptData;
-struct SculptStroke;
-
-struct SculptSession *sculpt_session(void);
-struct SculptData *sculpt_data(void);
-
-/* Memory */
-void sculptmode_correct_state(void);
-
-/* Interface */
-void sculptmode_draw_interface_tools(struct uiBlock *block,unsigned short cx, unsigned short cy);
-void sculptmode_draw_interface_brush(struct uiBlock *block,unsigned short cx, unsigned short cy);
-void sculptmode_draw_interface_textures(struct uiBlock *block,unsigned short cx, unsigned short cy);
-void sculptmode_rem_tex(void*,void*);
-void sculptmode_selectbrush_menu(void);
-void sculptmode_draw_mesh(int);
-void sculpt_paint_brush(char clear);
-void sculpt_stroke_draw();
-void sculpt_radialcontrol_start(int mode);
-
-struct BrushData *sculptmode_brush(void);
-void do_symmetrical_brush_actions(struct BrushAction *a, short *, short *);
-
-void sculptmode_update_tex(void);
-char sculpt_modifiers_active(struct Object *ob);
-void sculpt(void);
-void set_sculptmode(void);
-
-/* Stroke */
-void sculpt_stroke_new(const int max);
-void sculpt_stroke_free();
-void sculpt_stroke_add_point(const short x, const short y);
-void sculpt_stroke_apply(struct BrushAction *);
-void sculpt_stroke_apply_all(struct BrushAction *);
-void sculpt_stroke_draw();
-
-
-/* Partial Mesh Visibility */
-void sculptmode_pmv(int mode);
-
-#endif
diff --git a/source/blender/include/BDR_unwrapper.h b/source/blender/include/BDR_unwrapper.h
deleted file mode 100644
index e1983ee2f00..00000000000
--- a/source/blender/include/BDR_unwrapper.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_UNWRAPPER_H
-#define BDR_UNWRAPPER_H
-
-struct Mesh;
-
-void set_seamtface(void); /* set TF_SEAM flags in tfaces */
-void select_linked_tfaces_with_seams(int mode, struct Mesh *me, unsigned int index);
-
-void unwrap_lscm(short seamcut); /* unwrap faces selected in 3d view */
-void minimize_stretch_tface_uv(void); /* optimize faces selected in uv editor */
-void pack_charts_tface_uv(void);
-void average_charts_tface_uv(void);
-
-/* for live mode: no undo pushes, caching for quicky re-unwrap */
-void unwrap_lscm_live_begin(void);
-void unwrap_lscm_live_re_solve(void);
-void unwrap_lscm_live_end(short cancel);
-
-#endif /* BDR_UNWRAPPER_H */
-
diff --git a/source/blender/include/BDR_vpaint.h b/source/blender/include/BDR_vpaint.h
deleted file mode 100644
index a128c146e30..00000000000
--- a/source/blender/include/BDR_vpaint.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BDR_VPAINT_H
-#define BDR_VPAINT_H
-
-struct Mesh;
-struct MDeformVert; /* __NLA */
-
-unsigned int rgba_to_mcol(float r, float g, float b, float a);
-void do_shared_vertexcol(struct Mesh *me);
-void make_vertexcol(int shade);
-
-void clear_vpaint(void);
-void clear_vpaint_selectedfaces(void);
-void vpaint_dogamma(void);
-void sample_vpaint(void);
-
-void free_vertexpaint(void);
-void vertex_paint(void);
-void set_vpaint(void);
-
-void set_wpaint(void);
-void clear_wpaint_selectedfaces(void);
-void weight_paint(void);
-
-
-#endif /* BDR_VPAINT_H */
-
diff --git a/source/blender/include/BIF_drawgpencil.h b/source/blender/include/BIF_drawgpencil.h
deleted file mode 100644
index ae2ec192cc7..00000000000
--- a/source/blender/include/BIF_drawgpencil.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_DRAWGPENCIL_H
-#define BIF_DRAWGPENCIL_H
-
-
-struct bGPdata;
-struct ScrArea;
-struct View3D;
-struct SpaceNode;
-struct SpaceSeq;
-struct uiBlock;
-struct ImBuf;
-
-short draw_gpencil_panel(struct uiBlock *block, struct bGPdata *gpd, struct ScrArea *sa);
-
-void draw_gpencil_2dimage(struct ScrArea *sa, struct ImBuf *ibuf);
-void draw_gpencil_2dview(struct ScrArea *sa, short onlyv2d);
-void draw_gpencil_3dview(struct ScrArea *sa, short only3d);
-void draw_gpencil_oglrender(struct View3D *v3d, int winx, int winy);
-
-#endif /* BIF_DRAWGPENCIL_H */
diff --git a/source/blender/include/BIF_drawimage.h b/source/blender/include/BIF_drawimage.h
deleted file mode 100644
index 592c33ebb88..00000000000
--- a/source/blender/include/BIF_drawimage.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_DRAWIMAGE_H
-#define BIF_DRAWIMAGE_H
-
-struct ScrArea;
-struct SpaceImage;
-struct Render;
-struct Image;
-struct ImBuf;
-struct uiBlock;
-struct MTFace;
-
-void do_imagebuts(unsigned short event);
-void calc_image_view(struct SpaceImage *sima, char mode);
-void drawimagespace(struct ScrArea *sa, void *spacedata);
-int draw_uvs_face_check(void);
-void uv_center(float uv[][2], float cent[2], void * isquad);
-void draw_uvs_sima(void);
-void image_set_tile(struct SpaceImage *sima, int dotile);
-void image_home(void);
-void image_viewmove(int mode);
-void image_viewzoom(unsigned short event, int invert);
-void image_viewcenter(void);
-void uvco_to_areaco(float *vec, short *mval);
-void uvco_to_areaco_noclip(float *vec, int *mval);
-void what_image(struct SpaceImage *sima);
-void image_preview_event(int event);
-
-void image_info(struct Image *ima, struct ImBuf *ibuf, char *str);
-void imagespace_composite_flipbook(struct ScrArea *sa);
-
-void imagewindow_render_callbacks(struct Render *re);
-void imagewindow_toggle_render(void);
-struct ImBuf *imagewindow_get_ibuf(struct SpaceImage *sima);
-
-void image_editvertex_buts(struct uiBlock *block);
-void image_editcursor_buts(struct uiBlock *block);
-
-#endif
-
diff --git a/source/blender/include/BIF_drawseq.h b/source/blender/include/BIF_drawseq.h
deleted file mode 100644
index 85a6c7a9e2d..00000000000
--- a/source/blender/include/BIF_drawseq.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_DRAWSEQ_H
-#define BIF_DRAWSEQ_H
-
-struct ScrArea;
-struct Sequence;
-
-#define SEQ_ZOOM_FAC(szoom) (szoom > 0)? (szoom) : (szoom == 0)? (1.0) : (-1.0/szoom)
-
-void drawprefetchseqspace(struct ScrArea *sa, void *spacedata);
-void drawseqspace(struct ScrArea *sa, void *spacedata);
-void set_special_seq_update(int val);
-
-void seq_viewmove(SpaceSeq *sseq);
-void seq_reset_imageofs(SpaceSeq *sseq);
-void seq_viewzoom(unsigned short event, int invert);
-void seq_home(void);
-#endif
-
diff --git a/source/blender/include/BIF_drawtext.h b/source/blender/include/BIF_drawtext.h
deleted file mode 100644
index db2889d4e9d..00000000000
--- a/source/blender/include/BIF_drawtext.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_DRAWTEXT_H
-#define BIF_DRAWTEXT_H
-
-struct ScrArea;
-struct SpaceText;
-struct Text;
-struct TextLine;
-
-void unlink_text(struct Text *text);
-
-void free_textspace(struct SpaceText *st);
-
-void txt_write_file(struct Text *text);
-void add_text_fs(char *file);
-
-void free_txt_data(void);
-void pop_space_text(struct SpaceText *st);
-
-void txt_format_text(struct SpaceText *st);
-void txt_format_line(struct SpaceText *st, struct TextLine *line, int do_next);
-
-#endif
-
diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h
deleted file mode 100644
index ae330b30d81..00000000000
--- a/source/blender/include/BIF_editaction.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): 2007, Joshua Leung, Action Editor Recode
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITACTION_H
-#define BIF_EDITACTION_H
-
-/* some interface related sizes*/
-#define CHANNELHEIGHT 16
-#define CHANNELSKIP 2
-#define NAMEWIDTH 164
-#define SLIDERWIDTH 125
-#define ACTWIDTH (G.saction->actwidth)
-
-/* Some types for easier type-testing */
-enum {
- ACTTYPE_NONE= 0,
- ACTTYPE_GROUP,
- ACTTYPE_ACHAN,
- ACTTYPE_CONCHAN,
- ACTTYPE_CONCHAN2,
- ACTTYPE_ICU,
- ACTTYPE_FILLIPO,
- ACTTYPE_FILLCON,
- ACTTYPE_IPO,
- ACTTYPE_SHAPEKEY,
- ACTTYPE_GPDATABLOCK,
- ACTTYPE_GPLAYER,
- ACTTYPE_SPECIALDATA
-};
-
-/* Macros for easier/more consistant state testing */
-#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED)==0)
-#define EXPANDED_AGRP(agrp) (agrp->flag & AGRP_EXPANDED)
-#define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE))
-
-#define VISIBLE_ACHAN(achan) ((achan->flag & ACHAN_HIDDEN)==0)
-#define EDITABLE_ACHAN(achan) ((VISIBLE_ACHAN(achan)) && ((achan->flag & ACHAN_PROTECTED)==0))
-#define EXPANDED_ACHAN(achan) ((VISIBLE_ACHAN(achan)) && (achan->flag & ACHAN_EXPANDED))
-#define SEL_ACHAN(achan) ((achan->flag & ACHAN_SELECTED) || (achan->flag & ACHAN_HILIGHTED))
-#define FILTER_IPO_ACHAN(achan) ((achan->flag & ACHAN_SHOWIPO))
-#define FILTER_CON_ACHAN(achan) ((achan->flag & ACHAN_SHOWCONS))
-
-#define EDITABLE_CONCHAN(conchan) ((conchan->flag & CONSTRAINT_CHANNEL_PROTECTED)==0)
-#define SEL_CONCHAN(conchan) (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
-
-#define EDITABLE_ICU(icu) ((icu->flag & IPO_PROTECT)==0)
-#define SEL_ICU(icu) (icu->flag & IPO_SELECT)
-
-#define EXPANDED_GPD(gpd) (gpd->flag & GP_DATA_EXPAND)
-
-#define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0)
-#define SEL_GPL(gpl) ((gpl->flag & GP_LAYER_ACTIVE) || (gpl->flag & GP_LAYER_SELECT))
-
-#define NLA_ACTION_SCALED (G.saction->mode==SACTCONT_ACTION && G.saction->pin==0 && OBACT && OBACT->action)
-#define NLA_IPO_SCALED (OBACT && OBACT->action && G.sipo && G.sipo->pin==0 && G.sipo->actname)
-
-/* constants for setting ipo-interpolation type */
-enum {
- SET_IPO_MENU = -1,
- SET_IPO_POPUP = 0,
-
- SET_IPO_CONSTANT,
- SET_IPO_LINEAR,
- SET_IPO_BEZIER,
-};
-
-/* constants for setting ipo-extrapolation type */
-enum {
- SET_EXTEND_MENU = 9,
- SET_EXTEND_POPUP = 10,
-
- SET_EXTEND_CONSTANT,
- SET_EXTEND_EXTRAPOLATION,
- SET_EXTEND_CYCLIC,
- SET_EXTEND_CYCLICEXTRAPOLATION
-};
-
-/* constants for channel rearranging */
-/* WARNING: don't change exising ones without modifying rearrange func accordingly */
-enum {
- REARRANGE_ACTCHAN_TOP= -2,
- REARRANGE_ACTCHAN_UP= -1,
- REARRANGE_ACTCHAN_DOWN= 1,
- REARRANGE_ACTCHAN_BOTTOM= 2
-};
-
-
-struct bAction;
-struct bActionChannel;
-struct bActionGroup;
-struct bPose;
-struct bPoseChannel;
-struct Object;
-struct Ipo;
-struct BWinEvent;
-struct Key;
-struct ListBase;
-struct TimeMarker;
-struct bGPdata;
-struct bGPDlayer;
-
-/* Key operations */
-void transform_action_keys(int mode, int dummy);
-void duplicate_action_keys(void);
-void snap_cfra_action(void);
-void snap_action_keys(short mode);
-void mirror_action_keys(short mode);
-void insertkey_action(void);
-void delete_action_keys(void);
-void delete_action_channels(void);
-void clean_action(void);
-void sample_action_keys(void);
-
-/* Column/Channel Key select */
-void column_select_action_keys(int mode);
-void selectall_action_keys(short mval[], short mode, short selectmode);
-void markers_selectkeys_between(void);
-void nextprev_action_keyframe(short dir);
-
-/* Action Data Copying */
-void free_actcopybuf(void);
-void copy_actdata(void);
-void paste_actdata(void);
-
-/* Group/Channel Operations */
-struct bActionGroup *get_active_actiongroup(struct bAction *act);
-void set_active_actiongroup(struct bAction *act, struct bActionGroup *agrp, short select);
-void actionbone_group_copycolors(struct bActionGroup *grp, short init_new);
-void verify_pchan2achan_grouping(struct bAction *act, struct bPose *pose, char name[]);
-void sync_pchan2achan_grouping(void);
-void action_groups_group(short add_group);
-void action_groups_ungroup(void);
-
-/* Channel/Strip Operations */
-void rearrange_action_channels(short mode);
-
-void expand_all_action(void);
-void expand_obscuregroups_action(void);
-void openclose_level_action(short mode);
-void setflag_action_channels(short mode);
-
-/* IPO/Handle Types */
-void sethandles_action_keys(int code);
-void action_set_ipo_flags(short mode, short event);
-
-/* Select */
-void borderselect_action(void);
-void borderselect_actionchannels(void);
-void deselect_action_keys(short test, short sel);
-void deselect_action_channels(short mode);
-void deselect_actionchannels(struct bAction *act, short mode);
-int select_channel(struct bAction *act, struct bActionChannel *achan, int selectmode);
-void select_actionchannel_by_name(struct bAction *act, char *name, int select);
-void select_action_group_channels(struct bAction *act, struct bActionGroup *agrp);
-void selectkeys_leftright (short leftright, short select_mode);
-
-/* Action Markers */
-void action_set_activemarker(struct bAction *act, struct TimeMarker *active, short deselect);
-void action_add_localmarker(struct bAction *act, int frame);
-void action_rename_localmarker(struct bAction *act);
-void action_remove_localmarkers(struct bAction *act);
-
-/* Grease-Pencil Data */
-void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel);
-
-void deselect_gpencil_layers(void *data, short select_mode);
-
-short is_gplayer_frame_selected(struct bGPDlayer *gpl);
-void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode);
-void select_gpencil_frames(struct bGPDlayer *gpl, short select_mode);
-void select_gpencil_frame(struct bGPDlayer *gpl, int selx, short select_mode);
-void borderselect_gplayer_frames(struct bGPDlayer *gpl, float min, float max, short select_mode);
-
-void delete_gpencil_layers(void);
-void delete_gplayer_frames(struct bGPDlayer *gpl);
-void duplicate_gplayer_frames(struct bGPDlayer *gpd);
-
-void free_gpcopybuf(void);
-void copy_gpdata(void);
-void paste_gpdata(void);
-
-void snap_gplayer_frames(struct bGPDlayer *gpl, short mode);
-void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode);
-
-/* ShapeKey stuff */
-struct Key *get_action_mesh_key(void);
-int get_nearest_key_num(struct Key *key, short *mval, float *x);
-
-void *get_nearest_act_channel(short mval[], short *ret_type, void **owner);
-
-/* Action */
-struct bActionChannel *get_hilighted_action_channel(struct bAction* action);
-struct bAction *add_empty_action(char *name);
-struct bAction *ob_get_action(struct Object *ob);
-
-void actdata_filter(ListBase *act_data, int filter_mode, void *data, short datatype);
-void *get_action_context(short *datatype);
-
-void remake_action_ipos(struct bAction *act);
-void action_previewrange_set(struct bAction *act);
-
-/* event handling */
-void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-#endif
-
diff --git a/source/blender/include/BIF_editarmature.h b/source/blender/include/BIF_editarmature.h
deleted file mode 100644
index 02d73680818..00000000000
--- a/source/blender/include/BIF_editarmature.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef BIF_EDITARMATURE_H
-#define BIF_EDITARMATURE_H
-
-struct Object;
-struct Base;
-struct Bone;
-struct bArmature;
-struct ListBase;
-
-typedef struct EditBone
-{
- struct EditBone *next, *prev;
- struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer
- to parents. This is converted to a two-way link for
- normal bones when leaving editmode. */
- void *temp; /* Used to store temporary data */
-
- char name[32];
- float roll; /* Roll along axis. We'll ultimately use the axis/angle method
- for determining the transformation matrix of the bone. The axis
- is tail-head while roll provides the angle. Refer to Graphics
- Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
-
- float head[3]; /* Orientation and length is implicit during editing */
- float tail[3];
- /* All joints are considered to have zero rotation with respect to
- their parents. Therefore any rotations specified during the
- animation are automatically relative to the bones' rest positions*/
- int flag;
-
- int parNr; /* Used for retrieving values from the menu system */
-
- float dist, weight;
- float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
- float ease1, ease2;
- float rad_head, rad_tail;
- short layer, segments;
-
- float oldlength; /* for envelope scaling */
-
-} EditBone;
-
-void make_boneList(struct ListBase *list, struct ListBase *bones, EditBone *parent);
-void editbones_to_armature (struct ListBase *list, struct Object *ob);
-
-void adduplicate_armature(void);
-void addvert_armature(void);
-void add_primitiveArmature(int type);
-void apply_rot_armature (struct Object *ob, float mat[3][3]);
-void docenter_armature (struct Object *ob, int centermode);
-
-void clear_armature(struct Object *ob, char mode);
-
-void delete_armature(void);
-void deselectall_armature(int toggle, int doundo);
-void deselectall_posearmature (struct Object *ob, int test, int doundo);
-int draw_armature(struct Base *base, int dt, int flag);
-
-void extrude_armature(int forked);
-void subdivide_armature(int numcuts);
-void fill_bones_armature(void);
-void merge_armature(void);
-
-void free_editArmature(void);
-
-int join_armature(void);
-void separate_armature(void);
-void apply_armature_pose2bones(void);
-void load_editArmature(void);
-
-void make_bone_parent(void);
-void clear_bone_parent(void);
-struct Bone *get_indexed_bone (struct Object *ob, int index);
-
-void make_editArmature(void);
-void make_trans_bones (char mode);
-void remake_editArmature(void);
-void editbones_to_armature(struct ListBase *list, struct Object *ob);
-
-int do_pose_selectbuffer(struct Base *base, unsigned int *buffer, short hits);
-
-void generateSkeleton(void);
-
-void mouse_armature(void);
-void selectconnected_armature(void);
-void selectconnected_posearmature(void);
-void armature_select_hierarchy(short direction, short add_to_sel);
-
-void setflag_armature(short mode);
-void unique_editbone_name (struct ListBase *ebones, char *name);
-
-void auto_align_armature(short mode);
-void switch_direction_armature(void);
-
-void create_vgroups_from_armature(struct Object *ob, struct Object *par);
-void add_verts_to_dgroups(struct Object *ob, struct Object *par, int heat, int mirror);
-
-void hide_selected_pose_bones(void);
-void hide_unselected_pose_bones(void);
-void show_all_pose_bones(void);
-
-int bone_looper(struct Object *ob, struct Bone *bone, void *data,
- int (*bone_func)(struct Object *, struct Bone *, void *));
-
-void undo_push_armature(char *name);
-void armature_bone_rename(struct bArmature *arm, char *oldname, char *newname);
-void armature_flip_names(void);
-void armature_autoside_names(short axis);
-EditBone *armature_bone_get_mirrored(EditBone *ebo);
-void transform_armature_mirror_update(void);
-
-void hide_selected_armature_bones(void);
-void hide_unselected_armature_bones(void);
-void show_all_armature_bones(void);
-
-void align_selected_bones(void);
-
-#define BONESEL_ROOT 0x10000000
-#define BONESEL_TIP 0x20000000
-#define BONESEL_BONE 0x40000000
-#define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE)
-
-#define BONESEL_NOSEL 0x80000000 /* Indicates a negative number */
-
-/* from autoarmature */
-void BIF_retargetArmature();
-void BIF_adjustRetarget();
-void BIF_freeRetarget();
-
-struct ReebArc;
-float calcVariance(struct ReebArc *arc, int start, int end, float v0[3], float n[3]);
-float calcDistance(struct ReebArc *arc, int start, int end, float head[3], float tail[3]);
-
-/* useful macros */
-#define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
-#define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
-
-/* used in bone_select_hierachy() */
-#define BONE_SELECT_PARENT 0
-#define BONE_SELECT_CHILD 1
-
-#endif
-
-
-
diff --git a/source/blender/include/BIF_editconstraint.h b/source/blender/include/BIF_editconstraint.h
deleted file mode 100644
index 38ea96502ee..00000000000
--- a/source/blender/include/BIF_editconstraint.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITCONSTRAINT_H
-#define BIF_EDITCONSTRAINT_H
-
-struct ID;
-struct ListBase;
-struct Object;
-struct bConstraint;
-struct bConstraintChannel;
-struct Text;
-
-/* generic constraint editing functions */
-struct ListBase *get_active_constraints(struct Object *ob);
-struct bConstraint *get_active_constraint(struct Object *ob);
-struct ListBase *get_active_constraint_channels (struct Object *ob, int forcevalid);
-struct bConstraintChannel *get_active_constraint_channel(struct Object *ob);
-
-void add_constraint_to_object(struct bConstraint *con, struct Object *ob);
-struct bConstraint *add_new_constraint(short type);
-void add_constraint(short only_IK);
-void ob_clear_constraints(void);
-void rename_constraint(struct Object *ob, struct bConstraint *con, char *newname);
-
-void object_test_constraints(struct Object *owner);
-
-/* a few special functions for PyConstraints */
-char *buildmenu_pyconstraints(struct Text *con_text, int *pyconindex);
-void validate_pyconstraint_cb(void *arg1, void *arg2);
-void update_pyconstraint_cb(void *arg1, void *arg2);
-
-/* two special functions for ChildOf Constriant */
-void childof_const_setinv (void *conv, void *unused);
-void childof_const_clearinv(void *conv, void *unused);
-
-#endif
-
diff --git a/source/blender/include/BIF_editdeform.h b/source/blender/include/BIF_editdeform.h
deleted file mode 100644
index 6429b60a888..00000000000
--- a/source/blender/include/BIF_editdeform.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_DEFORM_H
-#define BIF_DEFORM_H
-
-#define WEIGHT_REPLACE 1
-#define WEIGHT_ADD 2
-#define WEIGHT_SUBTRACT 3
-
-struct Object;
-struct Mesh;
-struct MDeformVert;
-struct MDeformWeight;
-struct bDeformGroup;
-
-struct bDeformGroup *add_defgroup_name (struct Object *ob, char *name);
-void add_defgroup (struct Object *ob);
-void del_defgroup_in_object_mode (struct Object *ob );
-void del_defgroup (struct Object *ob);
-void del_all_defgroups (struct Object *ob);
-void duplicate_defgroup (struct Object *ob );
-void assign_verts_defgroup (void);
-void remove_verts_defgroup (int allverts);
-void remove_verts_defgroups (int allverts);
-void sel_verts_defgroup (int select);
-
-struct MDeformWeight *get_defweight (struct MDeformVert *dv, int defgroup);
-struct MDeformWeight *verify_defweight (struct MDeformVert *dv, int defgroup);
-
-
-void add_vert_to_defgroup (struct Object *ob, struct bDeformGroup *dg,
- int vertnum, float weight,
- int assignmode);
-void remove_vert_defgroup (struct Object *ob, struct bDeformGroup *dg,
- int vertnum);
-float get_vert_defgroup (struct Object *ob, struct bDeformGroup *dg,
- int vertnum);
-void create_dverts(ID *id);
-
-void vertexgroup_select_by_name(struct Object *ob, char *name);
-
-extern void object_apply_deform(struct Object *ob);
-
-void vgroup_assign_with_menu(void);
-void vgroup_operation_with_menu(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_editfont.h b/source/blender/include/BIF_editfont.h
deleted file mode 100644
index d41f52f3c25..00000000000
--- a/source/blender/include/BIF_editfont.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <wchar.h>
-
-#ifndef BIF_EDITFONT_H
-#define BIF_EDITFONT_H
-
-struct Text;
-
-extern char *BIF_lorem;
-extern wchar_t *copybuf;
-extern wchar_t *copybufinfo;
-
-typedef struct unicodect
-{
- char *name;
- char *longname;
- int start;
- int end;
-} unicodect;
-
-void do_textedit(unsigned short event, short val, unsigned long _ascii);
-void make_editText(void);
-void load_editText(void);
-void remake_editText(void);
-void free_editText(void);
-void paste_editText(void);
-void txt_export_to_object(struct Text *text);
-void txt_export_to_objects(struct Text *text);
-void undo_push_font(char *);
-void load_3dtext_fs(char *);
-void add_lorem(void);
-void paste_unicodeText(char *filename);
-
-/**
- * @attention The argument is discarded. It is there for
- * compatibility.
- */
-void add_primitiveFont(int);
-void to_upper(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_editgroup.h b/source/blender/include/BIF_editgroup.h
deleted file mode 100644
index c33ca3b05ae..00000000000
--- a/source/blender/include/BIF_editgroup.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-struct Group;
-struct Base;
-
-void add_selected_to_group(struct Group *group);
-void rem_selected_from_group(void);
-void group_operation_with_menu(void);
-void group_operation(int mode);
-
diff --git a/source/blender/include/BIF_editkey.h b/source/blender/include/BIF_editkey.h
deleted file mode 100644
index ab797819b61..00000000000
--- a/source/blender/include/BIF_editkey.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITKEY_H
-#define BIF_EDITKEY_H
-
-struct Key;
-struct KeyBlock;
-struct Mesh;
-struct Object;
-struct Lattice;
-struct Curve;
-struct uiBlock;
-struct BezTriple;
-struct IpoCurve;
-
-void mesh_to_key(struct Mesh *me, struct KeyBlock *kb);
-void key_to_mesh(struct KeyBlock *kb, struct Mesh *me);
-void insert_meshkey(struct Mesh *me, short rel);
-
-void latt_to_key(struct Lattice *lt, struct KeyBlock *kb);
-void key_to_latt(struct KeyBlock *kb, struct Lattice *lt);
-void insert_lattkey(struct Lattice *lt, short rel);
-
-void curve_to_key(struct Curve *cu, struct KeyBlock *kb, ListBase *nurb);
-void key_to_curve(struct KeyBlock *kb, struct Curve *cu, ListBase *nurb);
-void insert_curvekey(struct Curve *cu, short rel);
-
-void insert_shapekey(struct Object *ob);
-
-void delete_key(struct Object *ob);
-void move_keys(struct Object *ob);
-
-void make_rvk_slider(struct uiBlock *block, struct Object *ob, int keynum,
- int x, int y, int w, int h, char *tip);
-
-// FIXME: move me somewhere else
-struct BezTriple *get_bezt_icu_time(struct IpoCurve *icu, float *frame, float *val);
-
-#endif
-
diff --git a/source/blender/include/BIF_editlattice.h b/source/blender/include/BIF_editlattice.h
deleted file mode 100644
index 388353566a0..00000000000
--- a/source/blender/include/BIF_editlattice.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITLATTICE_H
-#define BIF_EDITLATTICE_H
-
-void free_editLatt(void);
-void make_editLatt(void);
-void load_editLatt(void);
-void remake_editLatt(void);
-void deselectall_Latt(void);
-void mouse_lattice(void);
-void undo_push_lattice(char *name);
-
-#endif
-
diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h
deleted file mode 100644
index 30e9e16355e..00000000000
--- a/source/blender/include/BIF_editmesh.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* External for editmesh_xxxx.c functions */
-
-#ifndef BIF_EDITMESH_H
-#define BIF_EDITMESH_H
-
-#include "BKE_mesh.h"
-
-struct EditMesh;
-struct EditFace;
-struct EditEdge;
-struct EditVert;
-struct Mesh;
-struct bDeformGroup;
-struct View3D;
-struct EditSelection;
-struct CustomData;
-
-// edge and face flag both
-#define EM_FGON 2
-// face flag
-#define EM_FGON_DRAW 1
-
-extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs;
-
-/* ******************* editmesh.c */
-extern void make_editMesh(void);
-extern void load_editMesh(void);
-extern void free_editMesh(struct EditMesh *);
-extern void remake_editMesh(void);
-
- /* Editmesh Undo code */
-extern void undo_push_mesh(char *name);
-
-extern void separatemenu(void);
-extern void separate_mesh(void);
-extern void separate_mesh_loose(void);
-extern void separate_material(void);
-
-/* ******************* editmesh_add.c */
-extern void make_prim(int type, float imat[3][3], int tot, int seg,
- int subdiv, float dia, float d, int ext, int fill,
- float cent[3] );
-extern void add_primitiveMesh(int type);
-extern void adduplicate_mesh(void);
-extern void add_click_mesh(void);
-extern void addedgeface_mesh(void);
-void addfaces_from_edgenet(void);
-
-/* ******************* editmesh_lib.c */
-
-extern void EM_set_flag_all(int flag);
-extern void EM_clear_flag_all(int flag);
-
-extern void EM_select_face(struct EditFace *efa, int sel);
-extern void EM_select_edge(struct EditEdge *eed, int sel);
-extern float EM_face_area(struct EditFace *efa);
-extern float EM_face_perimeter(struct EditFace *efa);
-extern void EM_editselection_center(float *center, struct EditSelection *ese);
-extern void EM_editselection_normal(float *normal, struct EditSelection *ese);
-extern void EM_editselection_plane(float *plane, struct EditSelection *ese);
-
-extern void EM_deselect_flush(void); // vertices to edges/faces (exception!)
-extern void EM_select_flush(void); // vertices to edges/faces (exception!)
-extern void EM_selectmode_set(void); // when mode changes
-extern void EM_selectmode_flush(void); // when selection changes
-extern void EM_convertsel(short oldmode, short selectmode);
-extern void EM_remove_selection(void *data, int type);
-extern void EM_store_selection(void *data, int type);
-extern void EM_validate_selections(void);
-
-extern int EM_nfaces_selected(void);
-extern int EM_nvertices_selected(void);
-
-extern int faceselectedAND(struct EditFace *efa, int flag);
-extern void recalc_editnormals(void);
-extern void flip_editnormals(void);
-
-extern void EM_data_interp_from_verts(struct EditVert *v1,
- struct EditVert *v2, struct EditVert *eve, float fac);
-extern struct EditFace *EM_face_from_faces(struct EditFace *efa1,
- struct EditFace *efa2, int i1, int i2, int i3, int i4);
-extern void EM_data_interp_from_faces(struct EditFace *efa1,
- struct EditFace *efa2, struct EditFace *efan, int i1, int i2, int i3, int i4);
-
-void EM_add_data_layer(struct CustomData *data, int type);
-void EM_free_data_layer(struct CustomData *data, int type);
-
-/* ******************* editmesh_mods.c */
-
-extern void EM_init_index_arrays(int forVert, int forEdge, int forFace);
-extern void EM_free_index_arrays(void);
-
-extern struct EditVert *EM_get_vert_for_index(int index);
-extern struct EditEdge *EM_get_edge_for_index(int index);
-extern struct EditFace *EM_get_face_for_index(int index);
-
-extern void EM_select_face_fgon(struct EditFace *efa, int sel);
-
-extern int EM_init_backbuf_border(short xmin, short ymin, short xmax, short ymax);
-extern int EM_mask_init_backbuf_border(short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
-extern int EM_init_backbuf_circle(short xs, short ys, short rads);
-extern int EM_check_backbuf(unsigned int index);
-extern void EM_free_backbuf(void);
-
-extern void EM_selectmode_menu(void);
-extern void EM_mesh_copy_face(short type);
-
-extern void vertexnoise(void);
-extern void vertexsmooth(void);
-extern void righthandfaces(int select);
-extern void mouse_mesh(void);
-
-extern void deselectall_mesh(void);
-extern void selectconnected_mesh_all(void);
-extern void selectconnected_mesh(void);
-extern void selectconnected_delimit_mesh(void);
-extern void selectconnected_delimit_mesh_all(void);
-extern void selectswap_mesh(void);
-
-extern void hide_mesh(int swap);
-extern void reveal_mesh(void);
-
-extern void vertices_to_sphere(void);
-
- /** Aligns the selected MTFace's of @a me to the @a v3d,
- * using the given axis (0-2). Can give a user error.
- */
-extern void faceselect_align_view_to_selected(struct View3D *v3d, struct Mesh *me, int axis);
- /** Aligns the selected faces or vertices of @a me to the @a v3d,
- * using the given axis (0-2). Can give a user error.
- */
-extern void editmesh_align_view_to_selected(struct View3D *v3d, int axis);
-
- /* Selection */
-extern void select_non_manifold(void);
-extern void select_sharp_edges(void);
-extern void select_linked_flat_faces(void);
-extern void select_faces_by_numverts(int numverts);
-extern void select_more(void);
-extern void select_less(void);
-extern void selectrandom_mesh(void);
-extern void editmesh_select_by_material(int index);
-extern void editmesh_deselect_by_material(int index);
-
-extern void Vertex_Menu(void);
-extern void Edge_Menu(void);
-extern void Face_Menu(void);
-extern void select_mesh_group_menu(void);
-extern void editmesh_mark_seam(int clear);
-extern void loop_multiselect(int looptype);
-
-extern void EM_select_more(void);
-extern void EM_select_less(void);
-
-/* ******************* editmesh_loop.c */
-
-#define KNIFE_PROMPT 0
-#define KNIFE_EXACT 1
-#define KNIFE_MIDPOINT 2
-#define KNIFE_MULTICUT 3
-
-extern void CutEdgeloop(int numcuts);
-extern void KnifeSubdivide(char mode);
-extern void LoopMenu(void);
-
-#define LOOP_SELECT 1
-#define LOOP_CUT 2
-
-extern short sharesFace(struct EditEdge* e1, struct EditEdge* e2);
-
-/* ******************* editmesh_tools.c */
-
-#define SUBDIV_SELECT_ORIG 0
-#define SUBDIV_SELECT_INNER 1
-#define SUBDIV_SELECT_INNER_SEL 2
-#define SUBDIV_SELECT_LOOPCUT 3
-
-extern void convert_to_triface(int direction);
-extern int removedoublesflag(short flag, short automerge, float limit);
-extern void xsortvert_flag(int flag);
-extern void hashvert_flag(int flag);
-
-extern void esubdivideflag(int flag, float rad, int beauty, int numcuts, int selecttype);
-
-extern void extrude_mesh(void);
-extern void split_mesh(void);
-extern void extrude_repeat_mesh(int steps, float offs);
-extern void spin_mesh(int steps,float degr,float *dvec, int mode);
-extern void screw_mesh(int steps,int turns);
-extern void delete_mesh(void);
-extern void beauty_fill(void);
-extern void join_triangles(void);
-extern void edge_flip(void);
-extern void fill_mesh(void);
-extern void bevel_menu(void);
-void mesh_set_face_flags(short mode);
-extern void mesh_set_smooth_faces(short event);
-extern void mesh_rotate_uvs(void);
-extern void mesh_mirror_uvs(void);
-extern void mesh_rotate_colors(void);
-extern void mesh_mirror_colors(void);
-void mesh_copy_menu(void);
-void edge_rotate_selected(int dir);
-int EdgeSlide(short immediate, float imperc);
-int EdgeLoopDelete(void);
-void mesh_rip(void);
-
-struct EditVert *editedge_getOtherVert(struct EditEdge *eed, struct EditVert *ev);
-struct EditVert *editedge_getSharedVert(struct EditEdge *eed, struct EditEdge *eed2);
-int editedge_containsVert(struct EditEdge *eed, struct EditVert *eve);
-int editface_containsVert(struct EditFace *efa, struct EditVert *eve);
-int editface_containsEdge(struct EditFace *efa, struct EditEdge *eed);
-
-void shape_copy_select_from(void);
-void shape_propagate(void);
-
-int collapseEdges(void);
-int merge_firstlast(int first, int uvmerge);
-int merge_target( int target, int uvmerge);
-
-void pathselect(void);
-void loop_to_region(void);
-void region_to_loop(void);
-
-UvVertMap *make_uv_vert_map_EM(int selected, int do_face_idx_array, float *limit);
-UvMapVert *get_uv_map_vert_EM(UvVertMap *vmap, unsigned int v);
-void free_uv_vert_map_EM(UvVertMap *vmap);
-
-int EM_texFaceCheck(void); /* can we edit UV's for this mesh?*/
-int EM_vertColorCheck(void); /* can we edit colors for this mesh?*/
-
-void EM_set_actFace(struct EditFace *efa);
-struct EditFace * EM_get_actFace(int sloppy);
-int EM_get_actSelection(struct EditSelection *ese);
-
-#endif
diff --git a/source/blender/include/BIF_editmode_undo.h b/source/blender/include/BIF_editmode_undo.h
deleted file mode 100644
index faa67f9fec1..00000000000
--- a/source/blender/include/BIF_editmode_undo.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#ifndef BIF_EDITMODE_UNDO_H
-#define BIF_EDITMODE_UNDO_H
-
-// Add this in your local code:
-
-extern void undo_editmode_push(char *name,
- void (*freedata)(void *), // pointer to function freeing data
- void (*to_editmode)(void *), // data to editmode conversion
- void *(*from_editmode)(void), // editmode to data conversion
- int (*validate_undo)(void *)); // check if undo data is still valid
-
-
-// Further exported for UI is:
-
-struct uiBlock;
-
-extern void undo_editmode_step(int step); // undo and redo
-extern void undo_editmode_clear(void); // free & clear all data
-extern void undo_editmode_menu(void); // history menu
-extern struct uiBlock *editmode_undohistorymenu(void *arg_unused);
-
-/* Hack to avoid multires undo data taking up insane amounts of memory */
-struct Object;
-void *undo_editmode_get_prev(struct Object *ob);
-
-#endif
-
diff --git a/source/blender/include/BIF_editnla.h b/source/blender/include/BIF_editnla.h
deleted file mode 100644
index 02655df6708..00000000000
--- a/source/blender/include/BIF_editnla.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITNLA_H
-#define BIF_EDITNLA_H
-
-struct BWinEvent;
-
-extern void winqreadnlaspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-/* NLA channel operations */
-void delete_nlachannel_keys(void);
-void duplicate_nlachannel_keys(void);
-void transform_nlachannel_keys(int mode, int dummy);
-
-/* Select */
-void borderselect_nla(void);
-void deselect_nlachannel_keys (int test);
-void deselect_nlachannels(int test);
-
-/* NLA Strip operations */
-void shift_nlastrips_up(void);
-void shift_nlastrips_down(void);
-void reset_action_strips(int val);
-void synchronize_action_strips(void);
-void snap_action_strips(int snap_mode);
-void add_nlablock(void);
-void add_empty_nlablock(void);
-void convert_nla(void);
-void copy_action_modifiers(void);
-
-/* Baking */
-void bake_all_to_action(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_editparticle.h b/source/blender/include/BIF_editparticle.h
deleted file mode 100644
index aecaee31d53..00000000000
--- a/source/blender/include/BIF_editparticle.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* BIF_editparticle.h
- *
- *
- * $Id: BIF_editparticle.h $
- *
- * ***** 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. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 by Janne Karhu.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITPARTICLE_H
-#define BIF_EDITPARTICLE_H
-
-struct Object;
-struct ParticleSystem;
-struct ParticleEditSettings;
-struct RadialControl;
-
-/* particle edit mode */
-void PE_set_particle_edit(void);
-void PE_create_particle_edit(struct Object *ob, struct ParticleSystem *psys);
-void PE_free_particle_edit(struct ParticleSystem *psys);
-
-void PE_change_act(void *ob_v, void *act_v);
-int PE_can_edit(struct ParticleSystem *psys);
-
-/* access */
-struct ParticleSystem *PE_get_current(struct Object *ob);
-short PE_get_current_num(struct Object *ob);
-int PE_minmax(float *min, float *max);
-void PE_get_colors(char sel[4], char nosel[4]);
-struct ParticleEditSettings *PE_settings(void);
-struct RadialControl **PE_radialcontrol(void);
-
-/* update calls */
-void PE_hide_keys_time(struct ParticleSystem *psys, float cfra);
-void PE_update_object(struct Object *ob, int useflag);
-void PE_update_selection(struct Object *ob, int useflag);
-void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys);
-
-/* selection tools */
-void PE_select_root(void);
-void PE_select_tip(void);
-void PE_deselectall(void);
-void PE_select_linked(void);
-void PE_select_less(void);
-void PE_select_more(void);
-
-void PE_mouse_particles(void);
-void PE_borderselect(void);
-void PE_selectionCB(short selecting, struct Object *editobj, short *mval, float rad);
-void PE_do_lasso_select(short mcords[][2], short moves, short select);
-
-/* tools */
-void PE_hide(int mode);
-void PE_rekey(void);
-void PE_subdivide(void);
-int PE_brush_particles(void);
-void PE_delete_particle(void);
-void PE_remove_doubles(void);
-void PE_mirror_x(int tagged);
-void PE_selectbrush_menu(void);
-void PE_remove_doubles(void);
-void PE_radialcontrol_start(const int mode);
-
-/* undo */
-void PE_undo_push(char *str);
-void PE_undo_step(int step);
-void PE_undo(void);
-void PE_redo(void);
-void PE_undo_menu(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_editseq.h b/source/blender/include/BIF_editseq.h
deleted file mode 100644
index be30a3eaaf3..00000000000
--- a/source/blender/include/BIF_editseq.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITSEQ_H
-#define BIF_EDITSEQ_H
-
-struct Sequence;
-
-void add_duplicate_seq(void);
-void add_sequence(int type);
-void borderselect_seq(void);
-void boundbox_seq(void);
-void change_sequence(void);
-void reload_sequence(void);
-void update_seq_ipo_rect(struct Sequence * seq);
-void update_seq_icu_rects(struct Sequence * seq);
-struct Sequence* get_last_seq();
-struct Sequence* get_forground_frame_seq( int frame );
-void set_last_seq(struct Sequence * seq);
-void clear_last_seq();
-void del_seq(void);
-void enter_meta(void);
-void exit_meta(void);
-struct Sequence* find_neighboring_sequence(struct Sequence *test, int lr, int sel);
-struct Sequence* find_next_prev_sequence(struct Sequence *test, int lr, int sel);
-struct Sequence* find_nearest_seq(int *hand);
-int insert_gap(int gap, int cfra);
-void make_meta(void);
-void select_single_seq(struct Sequence *seq, int deselect_all);
-void select_channel_direction(struct Sequence *test,int lr);
-void select_more_seq(void);
-void select_less_seq(void);
-void mouse_select_seq(void);
-void no_gaps(void);
-void seq_snap(short event);
-void seq_snap_menu(void);
-void seq_mute_sel( int mute );
-void seq_lock_sel(int lock);
-void set_filter_seq(void);
-void swap_select_seq(void);
-void touch_seq_files(void);
-void seq_remap_paths(void);
-void transform_seq(int mode, int context);
-void transform_seq_nomarker(int mode, int context);
-void un_meta(void);
-void seq_cut(int cutframe, int hard_cut);
-void seq_separate_images(void);
-void reassign_inputs_seq_effect(void);
-void select_surrounding_handles(struct Sequence *test);
-void select_surround_from_last();
-void select_dir_from_last(int lr);
-void select_neighbor_from_last(int lr);
-void select_linked_seq(int mode);
-int test_overlap_seq(struct Sequence *test);
-void shuffle_seq(struct Sequence *test);
-struct Sequence* alloc_sequence(ListBase *lb, int cfra, int machine); /*used from python*/
-int check_single_seq(struct Sequence *seq);
-
-/* seq funcs for transform
- notice the difference between start/end and left/right.
-
- left and right are the bounds at which the setuence is rendered,
-start and end are from the start and fixed length of the sequence.
-*/
-
-/* sequence transform functions, for internal used */
-int seq_tx_get_start(struct Sequence *seq);
-int seq_tx_get_end(struct Sequence *seq);
-
-int seq_tx_get_final_left(struct Sequence *seq, int metaclip);
-int seq_tx_get_final_right(struct Sequence *seq, int metaclip);
-
-void seq_tx_set_final_left(struct Sequence *seq, int i);
-void seq_tx_set_final_right(struct Sequence *seq, int i);
-
-/* check if one side can be transformed */
-int seq_tx_check_left(struct Sequence *seq);
-int seq_tx_check_right(struct Sequence *seq);
-
-#define SEQ_DEBUG_INFO(seq) printf("seq into '%s' -- len:%i start:%i startstill:%i endstill:%i startofs:%i endofs:%i depth:%i\n",\
- seq->name, seq->len, seq->start, seq->startstill, seq->endstill, seq->startofs, seq->endofs, seq->depth)
-
-
-#endif
-
diff --git a/source/blender/include/BIF_editsima.h b/source/blender/include/BIF_editsima.h
deleted file mode 100644
index a9f24c34f2f..00000000000
--- a/source/blender/include/BIF_editsima.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-struct Mesh;
-struct EditMesh;
-struct SpaceImage;
-struct EditFace;
-struct MTFace;
-struct Image;
-
-/* id can be from 0 to 3 */
-#define TF_PIN_MASK(id) (TF_PIN1 << id)
-#define TF_SEL_MASK(id) (TF_SEL1 << id)
-
-struct Object;
-
-void image_changed(struct SpaceImage *sima, struct Image *image);
-
-void object_uvs_changed(struct Object *ob);
-void object_tface_flags_changed(struct Object *ob, int updateButtons);
-
-int is_uv_tface_editing_allowed(void);
-int is_uv_tface_editing_allowed_silent(void);
-
-void get_connected_limit_tface_uv(float *limit);
-int minmax_tface_uv(float *min, float *max);
-int cent_tface_uv(float *cent, int mode);
-
-void transform_width_height_tface_uv(int *width, int *height);
-void transform_aspect_ratio_tface_uv(float *aspx, float *aspy);
-
-void mouseco_to_cursor_sima(void);
-void borderselect_sima(short whichuvs);
-void mouseco_to_curtile(void);
-void mouse_select_sima(void);
-void snap_menu_sima(void);
-void image_pixel_aspect(struct Image *image, float *x, float *y);
-void image_final_aspect(struct Image *image, float *x, float *y);
-
-
-void select_invert_tface_uv(void);
-void select_swap_tface_uv(void);
-void mirrormenu_tface_uv(void);
-void hide_tface_uv(int swap);
-void reveal_tface_uv(void);
-void stitch_limit_uv_tface(void);
-void stitch_vert_uv_tface(void);
-void unlink_selection(void);
-void uvface_setsel__internal(short select);
-void select_linked_tface_uv(int mode);
-void pin_tface_uv(int mode);
-void weld_align_menu_tface_uv(void);
-void weld_align_tface_uv(char tool);
-void be_square_tface_uv(struct EditMesh *em);
-void select_pinned_tface_uv(void);
-void select_edgeloop_tface_uv(struct EditFace *efa, int a, int shift, int *flush);
-
-void sima_sample_color(void);
-
-#define UV_SELECT_ALL 1
-#define UV_SELECT_PINNED 2
-
-void new_image_sima(void);
-void reload_image_sima(void);
-void save_image_sima(void);
-void save_as_image_sima(void);
-void save_image_sequence_sima(void);
-void replace_image_sima(short imageselect);
-void open_image_sima(short imageselect);
-void pack_image_sima(void);
-
-/* checks images for forced updates on frame change */
-void BIF_image_update_frame(void);
-
-void find_nearest_uv(struct MTFace **nearesttf, struct EditFace **nearestefa, unsigned int *nearestv, int *nearestuv);
-
-/* face selection check functions */
-
-int simaFaceDraw_Check_nolocal( struct EditFace *efa );
-int simaFaceDraw_Check( struct EditFace *efa, struct MTFace *tf );
-
-int simaFaceSel_Check( struct EditFace *efa, struct MTFace *tf );
-void simaFaceSel_Set( struct EditFace *efa, struct MTFace *tf );
-void simaFaceSel_UnSet( struct EditFace *efa, struct MTFace *tf );
-
-int simaUVSel_Check( struct EditFace *efa, struct MTFace *tf, int i);
-void simaUVSel_Set( struct EditFace *efa, struct MTFace *tf, int i);
-void simaUVSel_UnSet( struct EditFace *efa, struct MTFace *tf, int i);
diff --git a/source/blender/include/BIF_editsound.h b/source/blender/include/BIF_editsound.h
deleted file mode 100644
index 6561b3e6849..00000000000
--- a/source/blender/include/BIF_editsound.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITSOUND_H
-#define BIF_EDITSOUND_H
-
-struct bSound;
-struct bSample;
-struct ListBase;
-struct PackedFile;
-struct hdaudio;
-
-void sound_init_audio(void);
-void sound_initialize_sounds(void);
-void sound_exit_audio(void);
-int sound_get_mixrate(void);
-
-void* sound_get_audiodevice(void);
-void* sound_get_listener(void);
-
-int sound_set_sample(struct bSound* sound, struct bSample* sample);
-int sound_sample_is_null(struct bSound* sound);
-int sound_load_sample(struct bSound* sound);
-
-struct bSample* sound_find_sample(struct bSound* sound);
-struct bSample* sound_new_sample(struct bSound* sound);
-
-struct bSound* sound_new_sound(char *name);
-struct bSound* sound_make_copy(struct bSound* originalsound);
-void sound_end_all_sounds(void);
-
-void sound_initialize_sample(struct bSound * sound);
-void sound_load_samples(void);
-
-void sound_play_sound(struct bSound *sound);
-void sound_stop_all_sounds(void);
-
-void sound_set_position(void *object,
- struct bSound *sound,
- float obmatrix[4][4]);
-
-struct hdaudio * sound_open_hdaudio(char * name);
-struct hdaudio * sound_copy_hdaudio(struct hdaudio * c);
-
-long sound_hdaudio_get_duration(struct hdaudio * hdaudio, double frame_rate);
-void sound_hdaudio_extract(struct hdaudio * hdaudio,
- short * target_buffer,
- int sample_position /* units of target_rate */,
- int target_rate,
- int target_channels,
- int nb_samples /* in target */);
-
-void sound_close_hdaudio(struct hdaudio * hdaudio);
-
-
-
-#endif
-
diff --git a/source/blender/include/BIF_editview.h b/source/blender/include/BIF_editview.h
deleted file mode 100644
index 204733a19d6..00000000000
--- a/source/blender/include/BIF_editview.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITVIEW_H
-#define BIF_EDITVIEW_H
-
-struct Base;
-struct Object;
-struct Camera;
-struct View3D;
-struct rcti;
-
-void arrows_move_cursor(unsigned short event);
-void lasso_select_boundbox(struct rcti *rect, short mcords[][2], short moves);
-int lasso_inside(short mcords[][2], short moves, short sx, short sy);
-int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1);
-int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
-void borderselect(void);
-void circle_select(void);
-void deselectall(void);
-void selectswap(void);
-void selectrandom(void);
-void selectall_type(short obtype);
-void selectall_layer(unsigned int layernum);
-void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selecting);
-void fly(void);
-int gesture(void);
-void mouse_cursor(void);
-void mouse_select(void);
-void set_active_base(struct Base *base);
-void set_active_object(struct Object *ob);
-void set_render_border(void);
-void view3d_border_zoom(void);
-void view3d_edit_clipping(struct View3D *v3d);
-
-#endif
-
diff --git a/source/blender/include/BIF_filelist.h b/source/blender/include/BIF_filelist.h
deleted file mode 100644
index 730a41c22e9..00000000000
--- a/source/blender/include/BIF_filelist.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_FILELIST_H
-#define BIF_FILELIST_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct FileList;
-struct direntry;
-struct BlendHandle;
-
-struct FileList * BIF_filelist_new();
-void BIF_filelist_init_icons();
-void BIF_filelist_free_icons();
-struct FileList * BIF_filelist_copy(struct FileList* filelist);
-int BIF_filelist_find(struct FileList* filelist, char *file);
-void BIF_filelist_free(struct FileList* filelist);
-void BIF_filelist_freelib(struct FileList* filelist);
-void BIF_filelist_sort(struct FileList* filelist, short sort);
-int BIF_filelist_numfiles(struct FileList* filelist);
-const char * BIF_filelist_dir(struct FileList* filelist);
-void BIF_filelist_setdir(struct FileList* filelist, const char *dir);
-struct direntry * BIF_filelist_file(struct FileList* filelist, int index);
-void BIF_filelist_hidedot(struct FileList* filelist, short hide);
-void BIF_filelist_setfilter(struct FileList* filelist, unsigned int filter);
-void BIF_filelist_filter(struct FileList* filelist);
-void BIF_filelist_swapselect(struct FileList* filelist);
-void BIF_filelist_imgsize(struct FileList* filelist, short w, short h);
-void BIF_filelist_loadimage(struct FileList* filelist, int index);
-struct ImBuf * BIF_filelist_getimage(struct FileList* filelist, int index);
-
-void BIF_filelist_readdir(struct FileList* filelist);
-
-int BIF_filelist_empty(struct FileList* filelist);
-void BIF_filelist_parent(struct FileList* filelist);
-void BIF_filelist_setfiletypes(struct FileList* filelist, short has_quicktime);
-int BIF_filelist_islibrary (struct FileList* filelist, char* dir, char* group);
-void BIF_filelist_from_main(struct FileList* filelist);
-void BIF_filelist_from_library(struct FileList* filelist);
-void BIF_filelist_append_library(struct FileList* filelist, char *dir, char* file, short flag, int idcode);
-void BIF_filelist_settype(struct FileList* filelist, int type);
-short BIF_filelist_gettype(struct FileList* filelist);
-void BIF_filelist_setipotype(struct FileList* filelist, short ipotype);
-void BIF_filelist_hasfunc(struct FileList* filelist, int has_func);
-
-struct BlendHandle *BIF_filelist_lib(struct FileList* filelist);
-int BIF_groupname_to_code(char *group); /* TODO: where should this go */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/source/blender/include/BIF_fsmenu.h b/source/blender/include/BIF_fsmenu.h
deleted file mode 100644
index 7cd7f78a363..00000000000
--- a/source/blender/include/BIF_fsmenu.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef BSE_FSMENU_H
-#define BSE_FSMENU_H
-
- /** Returns the number of entries in the Fileselect Menu */
-int fsmenu_get_nentries (void);
-
- /** Returns true if the fsmenu entry at @a index exists and
- * is a seperator.
- */
-int fsmenu_is_entry_a_seperator (int index);
-
- /** Returns the fsmenu entry at @a index (or NULL if a bad index)
- * or a seperator.
- */
-char* fsmenu_get_entry (int index);
-
- /** Returns a new menu description string representing the
- * fileselect menu. Should be free'd with MEM_freeN.
- */
-char* fsmenu_build_menu (void);
-
- /** Append a seperator to the FSMenu, inserts always follow the
- * last seperator.
- */
-void fsmenu_append_separator (void);
-
- /** Inserts a new fsmenu entry with the given @a path.
- * Duplicate entries are not added.
- * @param sorted Should entry be inserted in sorted order?
- */
-void fsmenu_insert_entry (char *path, int sorted, short save);
-
- /** Removes the fsmenu entry at the given @a index. */
-void fsmenu_remove_entry (int index);
-
- /** saves the 'favourites' to the specified file */
-void fsmenu_write_file(const char *filename);
-
- /** Free's all the memory associated with the fsmenu */
-void fsmenu_free (void);
-
-#endif
-
diff --git a/source/blender/include/BIF_graphics.h b/source/blender/include/BIF_graphics.h
deleted file mode 100644
index 7ec7397eeec..00000000000
--- a/source/blender/include/BIF_graphics.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_GRAPHICS_H
-#define BIF_GRAPHICS_H
-
- /* XXX, should move somewhere else, with collected windowing
- * stuff, to be done once the proper windowing stuff has
- * been formed.
- */
-
-enum {
- CURSOR_VPAINT,
- CURSOR_FACESEL,
- CURSOR_WAIT,
- CURSOR_EDIT,
- CURSOR_X_MOVE,
- CURSOR_Y_MOVE,
- CURSOR_HELP,
- CURSOR_STD,
- CURSOR_NONE,
- CURSOR_PENCIL,
- CURSOR_TEXTEDIT
-};
-
-void set_cursor(int curs);
-int get_cursor(void);
-
-#endif /* BIF_GRAPHICS_H */
-
diff --git a/source/blender/include/BIF_imasel.h b/source/blender/include/BIF_imasel.h
deleted file mode 100644
index cbd547602e1..00000000000
--- a/source/blender/include/BIF_imasel.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef BIF_IMASEL_H
-#define BIF_IMASEL_H
-
-struct SpaceImaSel;
-struct ScrArea;
-struct ID;
-
-void free_imasel(struct SpaceImaSel *simasel);
-void reset_imaselspace(struct ScrArea *sa);
-
-void clever_numbuts_imasel(void);
-
-void activate_imageselect(int type, char *title, char *file, void (*func)(char *));
-void activate_imageselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *));
-void activate_imageselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2);
-
-void activate_databrowse_imasel(struct ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short));
-/*
-void activate_databrowse_imasel_args(struct ID *id, int idcode, int fromcode, short *menup, void (*func)(char *, void *, void *), void *arg1, void *arg2);
-*/
-#endif
-
diff --git a/source/blender/include/BIF_keyframing.h b/source/blender/include/BIF_keyframing.h
deleted file mode 100644
index dbbe55123e4..00000000000
--- a/source/blender/include/BIF_keyframing.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place * Suite 330, Boston, MA 02111*1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender (with some old code)
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_KEYFRAMING_H
-#define BIF_KEYFRAMING_H
-
-struct ListBase;
-struct ID;
-
-struct IpoCurve;
-struct BezTriple;
-
-/* ************ Keyframing Management **************** */
-
-/* Lesser Keyframing API call:
- * Use this when validation of necessary animation data isn't necessary as it already
- * exists, and there is a beztriple that can be directly copied into the array.
- */
-int insert_bezt_icu(struct IpoCurve *icu, struct BezTriple *bezt);
-
-/* Main Keyframing API call:
- * Use this when validation of necessary animation data isn't necessary as it
- * already exists. It will insert a keyframe using the current value being keyframed.
- */
-void insert_vert_icu(struct IpoCurve *icu, float x, float y, short flag);
-
-
-/* flags for use by keyframe creation/deletion calls */
-enum {
- /* used by isnertkey() and insert_vert_icu() */
- INSERTKEY_NEEDED = (1<<0), /* only insert keyframes where they're needed */
- INSERTKEY_MATRIX = (1<<1), /* insert 'visual' keyframes where possible/needed */
- INSERTKEY_FAST = (1<<2), /* don't recalculate handles,etc. after adding key */
- INSERTKEY_FASTR = (1<<3), /* don't realloc mem (or increase count, as array has already been set out) */
- INSERTKEY_REPLACE = (1<<4), /* only replace an existing keyframe (this overrides INSERTKEY_NEEDED) */
-
- /* used by common_*key() functions */
- COMMONKEY_ADDMAP = (1<<10), /* common key: add texture-slot offset bitflag to adrcode before use */
-} eInsertKeyFlags;
-
-/* -------- */
-
-/* Main Keyframing API calls:
- * Use this to create any necessary animation data, and then insert a keyframe
- * using the current value being keyframed, in the relevant place. Returns success.
- */
- // TODO: adapt this for new data-api -> this blocktype, etc. stuff is evil!
-short insertkey(struct ID *id, int blocktype, char *actname, char *constname, int adrcode, short flag);
-
-/* Main Keyframing API call:
- * Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case.
- */
-short deletekey(struct ID *id, int blocktype, char *actname, char *constname, int adrcode, short flag);
-
-
-/* Main Keyframe Management calls:
- * These handle keyframes management from various spaces. They will handle the menus
- * required for each space.
- */
-void common_insertkey(void);
-void common_deletekey(void);
-
-/* ************ Auto-Keyframing ********************** */
-/* Notes:
- * - All the defines for this (User-Pref settings and Per-Scene settings)
- * are defined in DNA_userdef_types.h
- * - Scene settings take presidence over those for userprefs, with old files
- * inheriting userpref settings for the scene settings
- * - "On/Off + Mode" are stored per Scene, but "settings" are currently stored
- * as userprefs
- */
-
-/* Auto-Keying macros for use by various tools */
- /* check if auto-keyframing is enabled (per scene takes presidence) */
-#define IS_AUTOKEY_ON ((G.scene) ? (G.scene->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON))
- /* check the mode for auto-keyframing (per scene takes presidence) */
-#define IS_AUTOKEY_MODE(mode) ((G.scene) ? (G.scene->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode))
- /* check if a flag is set for auto-keyframing (as userprefs only!) */
-#define IS_AUTOKEY_FLAG(flag) (U.autokey_flag & AUTOKEY_FLAG_##flag)
-
-/* ************ Keyframe Checking ******************** */
-
-/* Main Keyframe Checking API call:
- * Checks whether a keyframe exists for the given ID-block one the given frame.
- * - It is recommended to call this method over the other keyframe-checkers directly,
- * in case some detail of the implementation changes...
- * - frame: the value of this is quite often result of frame_to_float(CFRA)
- */
-short id_frame_has_keyframe(struct ID *id, float frame, short filter);
-
-/* filter flags for id_cfra_has_keyframe
- *
- * WARNING: do not alter order of these, as also stored in files
- * (for v3d->keyflags)
- */
-enum {
- /* general */
- ANIMFILTER_LOCAL = (1<<0), /* only include locally available anim data */
- ANIMFILTER_MUTED = (1<<1), /* include muted elements */
- ANIMFILTER_ACTIVE = (1<<2), /* only include active-subelements */
-
- /* object specific */
- ANIMFILTER_NOMAT = (1<<9), /* don't include material keyframes */
- ANIMFILTER_NOSKEY = (1<<10), /* don't include shape keys (for geometry) */
-} eAnimFilterFlags;
-
-#endif /* BIF_KEYFRAMING_H */
diff --git a/source/blender/include/BIF_meshlaplacian.h b/source/blender/include/BIF_meshlaplacian.h
deleted file mode 100644
index 71db8d0bba2..00000000000
--- a/source/blender/include/BIF_meshlaplacian.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * BIF_meshlaplacian.h: Algorithms using the mesh laplacian.
- */
-
-#ifndef BIF_MESHLAPLACIAN_H
-#define BIF_MESHLAPLACIAN_H
-
-//#define RIGID_DEFORM
-
-struct Object;
-struct Mesh;
-struct bDeformGroup;
-struct MeshDeformModifierData;
-
-#ifdef RIGID_DEFORM
-struct EditMesh;
-#endif
-
-/* Laplacian System */
-
-struct LaplacianSystem;
-typedef struct LaplacianSystem LaplacianSystem;
-
-LaplacianSystem *laplacian_construct_begin(int totvert, int totface, int lsq);
-
-void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned);
-void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3);
-
-void laplacian_construct_end(LaplacianSystem *sys);
-void laplacian_delete(LaplacianSystem *sys);
-
-void laplacian_begin_solve(LaplacianSystem *sys, int index);
-void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value);
-int laplacian_system_solve(LaplacianSystem *sys);
-float laplacian_system_get_solution(int v);
-
-/* Heat Weighting */
-
-void heat_bone_weighting(struct Object *ob, struct Mesh *me, float (*verts)[3],
- int numbones, struct bDeformGroup **dgrouplist,
- struct bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3],
- int *selected);
-
-#ifdef RIGID_DEFORM
-/* As-Rigid-As-Possible Deformation */
-
-void rigid_deform_begin(struct EditMesh *em);
-void rigid_deform_iteration(void);
-void rigid_deform_end(int cancel);
-#endif
-
-/* Harmonic Coordinates */
-
-void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
- float (*vertexcos)[3], int totvert, float cagemat[][4]);
-
-#endif
-
diff --git a/source/blender/include/BIF_meshtools.h b/source/blender/include/BIF_meshtools.h
deleted file mode 100644
index a894d66cb10..00000000000
--- a/source/blender/include/BIF_meshtools.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_MESHTOOLS_H
-#define BIF_MESHTOOLS_H
-
-#include "BLO_sys_types.h"
-
-struct Object;
-struct EditVert;
-
-extern int join_mesh(void);
-
-extern void sort_faces(void);
-extern void objects_bake_render_menu(void);
-extern void objects_bake_render_ui(short event);
-extern void objects_bake_render(short event, char **error_msg);
-
-extern intptr_t mesh_octree_table(struct Object *ob, float *co, char mode);
-extern int mesh_get_x_mirror_vert(struct Object *ob, int index);
-extern struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, float *co);
-extern int *mesh_get_x_mirror_faces(struct Object *ob);
-
-#endif
-
diff --git a/source/blender/include/BIF_mywindow.h b/source/blender/include/BIF_mywindow.h
deleted file mode 100644
index 25076c983b9..00000000000
--- a/source/blender/include/BIF_mywindow.h
+++ /dev/null
@@ -1,145 +0,0 @@
-
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * These are the protos for mywindow.c -- an emulation of the
- * (obsolete) IrisGL command set
- */
-
-#ifndef BIF_MYWINDOW_H
-#define BIF_MYWINDOW_H
-
-struct rcti;
-
-/*---*/
-
-typedef struct BWinEvent {
- unsigned short event;
- short val;
- char ascii;
-} BWinEvent;
-
-/*---*/
-
-int mywinget(void);
-void mywinclose(int winid);
-void mywinposition(int winid,
- int xmin, int xmax,
- int ymin, int ymax);
-/*---*/
-
- /** Test if there are events available on a BWin queue.
- *
- * @param winid The ID of the window to query.
- * @return True if there is an event available for _qread'ing.
- */
-int bwin_qtest(int winid);
-
- /** Read an event off of the BWin queue (if available).
- *
- * @param winid The ID of the window to read from.
- * @param event_r A pointer to return the event in.
- * @return True if an event was read and @a event_r filled.
- */
-int bwin_qread(int winid, BWinEvent *event_r);
-
- /** Add an event to the BWin queue.
- *
- * @param winid The ID of the window to add to.
- * @param event A pointer to copy the event from.
- */
-void bwin_qadd(int winid, BWinEvent *event);
-
-/*---*/
-
-void bwin_load_viewmatrix(int winid, float mat[][4]);
-void bwin_load_winmatrix(int winid, float mat[][4]);
-
-void bwin_get_viewmatrix(int winid, float mat[][4]);
-void bwin_get_winmatrix(int winid, float mat[][4]);
-
-void bwin_multmatrix(int winid, float mat[][4]);
-void bwin_scalematrix(int winid, float x, float y, float z);
-
-void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f);
-void bwin_ortho2(int win, float x1, float x2, float y1, float y2);
-void bwin_frustum(int winid, float x1, float x2, float y1, float y2, float n, float f);
-
-void bwin_getsize(int winid, int *x, int *y);
-void bwin_getsuborigin(int winid, int *x, int *y);
-void bwin_get_rect(int winid, struct rcti *rect_r);
-void bwin_getsinglematrix(int winid, float mat[][4]);
-void bwin_clear_viewmat(int winid);
-
-int myswinopen(int parentid, int xmin, int xmax, int ymin, int ymax);
-int myswinopen_allowed(void);
-void myswapbuffers(void);
-
-void mygetmatrix(float mat[][4]);
-void mymultmatrix(float [][4]);
-
-void myloadmatrix(float mat[][4]);
-void mywinset(int wid);
-void myortho(float x1, float x2, float y1, float y2, float n, float f);
-void myortho2(float x1, float x2, float y1, float y2);
-void mywindow(float x1, float x2, float y1, float y2, float n, float f);
-void mygetsingmatrix(float (*)[4]);
-
-void setlinestyle(int nr);
-
-void BIF_wait_for_statechange(void);
-
-#define L_MOUSE 1
-#define M_MOUSE 2
-#define R_MOUSE 4
-short get_mbut(void);
-short get_qual(void);
-void getmouse(short *mval);
-
-void getndof(float *sbval);
-void filterNDOFvalues(float *sbval);
-
-float get_pressure(void);
-void get_tilt(float *xtilt, float *ytilt);
-#define DEV_MOUSE 0
-#define DEV_STYLUS 1
-#define DEV_ERASER 2
-short get_activedevice(void);
-
-void warp_pointer(int x, int y);
-
-int framebuffer_to_index(unsigned int col);
-void set_framebuffer_index_color(int index);
-
-int mywin_inmenu(void);
-void mywin_getmenu_rect(int *x, int *y, int *sx, int *sy);
-
-void my_put_frontbuffer_image(void);
-void my_get_frontbuffer_image(int x, int y, int sx, int sy);
-
-#endif
-
diff --git a/source/blender/include/BIF_oops.h b/source/blender/include/BIF_oops.h
deleted file mode 100644
index 2375a918d0e..00000000000
--- a/source/blender/include/BIF_oops.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_OOPS_H
-#define BIF_OOPS_H
-
-struct Curve;
-struct Oops;
-struct OopsLink;
-struct SpaceOops;
-struct Material;
-struct Mesh;
-struct MetaBall;
-struct Object;
-struct Lamp;
-struct Camera;
-struct Texture;
-struct Lattice;
-struct bArmature;
-struct Tex;
-
-void add_curve_oopslinks(struct Curve *cu, struct Oops *oops, short flag);
-void add_from_link(struct Oops *from, struct Oops *oops);
-void add_material_oopslinks(struct Material *ma, struct Oops *oops, short flag);
-void add_mball_oopslinks(struct MetaBall *mb, struct Oops *oops, short flag);
-void add_mesh_oopslinks(struct Mesh *me, struct Oops *oops, short flag);
-void add_object_oopslinks(struct Object *ob, struct Oops *oops, short flag);
-void add_lamp_oopslinks(struct Lamp *la, struct Oops *oops, short flag);
-void add_camera_oopslinks(struct Camera *ca, struct Oops *oops, short flag);
-void add_texture_oopslinks(struct Tex *tex, struct Oops *oops, short flag);
-void add_lattice_oopslinks(struct Lattice *lt, struct Oops *oops, short flag);
-struct Oops *add_oops(void *id);
-struct OopsLink *add_oopslink(char *name, struct Oops *oops, short type, void *from, float xof, float yof);
-struct Oops *add_test_oops(void *id); /* incl links */
-void add_texture_oops(struct Material *ma);
-void build_oops(void);
-struct Oops *find_oops(ID *id);
-void free_oops(struct Oops *oops); /* ook oops zelf */
-void free_oopspace(struct SpaceOops *so);
-void new_oops_location(struct Oops *);
-int oops_test_overlap(struct Oops *test);
-int oops_test_overlaphide(struct Oops *test);
-float oopslink_totlen(struct Oops *oops);
-void shrink_oops(void);
-void shuffle_oops(void);
-int test_oops(struct Oops *oops);
-void test_oopslink(struct OopsLink *ol);
-void test_oopslinko(struct OopsLink *ol);
-
-#endif
-
-
diff --git a/source/blender/include/BIF_poselib.h b/source/blender/include/BIF_poselib.h
deleted file mode 100644
index 5b0205d593a..00000000000
--- a/source/blender/include/BIF_poselib.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 Blender Foundation
- * All rights reserved.
- *
- * The Original Code is: this is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_POSELIB_H
-#define BIF_POSELIB_H
-
-struct Object;
-struct bAction;
-struct TimeMarker;
-
-char *poselib_build_poses_menu(struct bAction *act, char title[]);
-int poselib_get_free_index(struct bAction *act);
-struct TimeMarker *poselib_get_active_pose(struct bAction *act);
-
-struct bAction *poselib_init_new(struct Object *ob);
-struct bAction *poselib_validate(struct Object *ob);
-
-void poselib_validate_act(struct bAction *act);
-
-void poselib_remove_pose(struct Object *ob, struct TimeMarker *marker);
-void poselib_rename_pose(struct Object *ob);
-void poselib_add_current_pose(struct Object *ob, int mode);
-
-void poselib_preview_poses(struct Object *ob, short apply_active);
-
-#endif
diff --git a/source/blender/include/BIF_poseobject.h b/source/blender/include/BIF_poseobject.h
deleted file mode 100644
index ab96f7ec03e..00000000000
--- a/source/blender/include/BIF_poseobject.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_POSEOBJECT
-#define BIF_POSEOBJECT
-
-
-struct Object;
-struct bPose;
-struct bPoseChannel;
-
-void enter_posemode(void);
-void exit_posemode(void);
-
- // sets chan->flag to POSE_KEY if bone selected
-void set_pose_keys(struct Object *ob);
-
-struct bPoseChannel *get_active_posechannel (struct Object *ob);
-int pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan);
-
-/* tools */
-void pose_select_constraint_target(void);
-void pose_special_editmenu(void);
-void pose_add_IK(void);
-void pose_clear_IK(void);
-void pose_clear_constraints(void);
-void pose_copy_menu(void);
-
-void free_posebuf(void);
-void copy_posebuf (void);
-void paste_posebuf (int flip);
-
-void pose_adds_vgroups(struct Object *meshobj, int heatweights);
-
-void pose_add_posegroup(void);
-void pose_remove_posegroup(void);
-char *build_posegroups_menustr(struct bPose *pose, short for_pupmenu);
-void pose_assign_to_posegroup(short active);
-void pose_remove_from_posegroups(void);
-void pgroup_operation_with_menu(void);
-
-void pose_select_hierarchy(short direction, short add_to_sel);
-
-void pose_select_grouped(short nr);
-void pose_select_grouped_menu(void);
-
-void pose_calculate_path(struct Object *ob);
-void pose_recalculate_paths(struct Object *ob);
-void pose_clear_paths(struct Object *ob);
-
-void pose_flip_names(void);
-void pose_autoside_names(short axis);
-void pose_activate_flipped_bone(void);
-void pose_movetolayer(void);
-void pose_relax(void);
-void pose_flipquats(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_radialcontrol.h b/source/blender/include/BIF_radialcontrol.h
deleted file mode 100644
index 81181a3a91e..00000000000
--- a/source/blender/include/BIF_radialcontrol.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * $Id: multires.h 13015 2007-12-27 07:27:03Z nicholasbishop $
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef RADIALCONTROL_H
-#define RADIALCONTROL_H
-
-struct NumInput;
-
-#define RADIALCONTROL_NONE 0
-#define RADIALCONTROL_SIZE 1
-#define RADIALCONTROL_STRENGTH 2
-#define RADIALCONTROL_ROTATION 3
-
-typedef void (*RadialControlCallback)(const int, const int);
-
-typedef struct RadialControl {
- int mode;
- short origloc[2];
-
- unsigned int tex;
-
- int new_value;
- int original_value;
- int max_value;
- RadialControlCallback callback;
-
- struct NumInput *num;
-} RadialControl;
-
-RadialControl *radialcontrol_start(const int mode, RadialControlCallback callback,
- const int original_value, const int max_value,
- const unsigned int tex);
-void radialcontrol_do_events(RadialControl *rc, const unsigned short event);
-void radialcontrol_draw(RadialControl *rc);
-
-#endif
diff --git a/source/blender/include/BIF_renderwin.h b/source/blender/include/BIF_renderwin.h
deleted file mode 100644
index ff12a7473d0..00000000000
--- a/source/blender/include/BIF_renderwin.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-struct Render;
-struct ScrArea;
-struct RenderStats;
-struct ImBuf;
-
-void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r[2], int rendersize_r[2]);
-
-void BIF_close_render_display(void);
-
-void BIF_do_render(int anim);
-
-/* render text */
-void BIF_make_render_text(struct RenderStats *rs);
-char *BIF_render_text(void);
-
-/* render spare buffer */
-int BIF_show_render_spare(void);
-struct ImBuf *BIF_render_spare_imbuf(void);
-void BIF_free_render_spare(void);
-
-/**
- * @param v3d The View3D space to render.
- */
-void BIF_do_ogl_render(struct View3D *v3d, int anim);
-
-void BIF_renderwin_set_for_ogl_render(void);
-void BIF_renderwin_set_custom_cursor(unsigned char mask[16][2], unsigned char bitmap[16][2]);
-
-void BIF_redraw_render_rect(void);
-void BIF_swap_render_rects(void);
-void BIF_store_spare(void);
-void BIF_toggle_render_display(void);
-
-void BIF_init_render_callbacks(struct Render *re, int do_display);
-void BIF_end_render_callbacks(void);
-
-/* should not be here, ~WIP~ */
-void make_renderinfo_string(struct RenderStats *rs, char *str);
-
-/* space for info text */
-#define RW_HEADERY 18
-
-/* header print for window */
-#define RW_MAXTEXT 512
-
diff --git a/source/blender/include/BIF_retopo.h b/source/blender/include/BIF_retopo.h
deleted file mode 100644
index cc2fda56b07..00000000000
--- a/source/blender/include/BIF_retopo.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_RETOPO_H
-#define BIF_RETOPO_H
-
-#include "DNA_vec_types.h"
-
-/* For bglMats */
-#include "BIF_glutil.h"
-
-struct EditVert;
-struct Mesh;
-struct View3D;
-
-typedef struct RetopoViewData {
- bglMats mats;
-
- char queue_matrix_update;
-} RetopoViewData;
-
-typedef struct RetopoPaintPoint {
- struct RetopoPaintPoint *next, *prev;
- vec2s loc;
- short index;
- float co[3];
- struct EditVert *eve;
-} RetopoPaintPoint;
-
-typedef struct RetopoPaintLine {
- struct RetopoPaintLine *next, *prev;
- ListBase points;
- ListBase hitlist; /* RetopoPaintHit */
- RetopoPaintPoint *cyclic;
-} RetopoPaintLine;
-
-typedef struct RetopoPaintSel {
- struct RetopoPaintSel *next, *prev;
- RetopoPaintLine *line;
- char first;
-} RetopoPaintSel;
-
-typedef struct RetopoPaintData {
- char in_drag;
- short sloc[2];
-
- ListBase lines;
- ListBase intersections; /* RetopoPaintPoint */
-
- short seldist;
- RetopoPaintSel nearest;
-
- struct View3D *paint_v3d;
-} RetopoPaintData;
-
-RetopoPaintData *get_retopo_paint_data(void);
-
-char retopo_mesh_check(void);
-char retopo_curve_check(void);
-
-void retopo_end_okee(void);
-
-void retopo_free_paint_data(RetopoPaintData *rpd);
-void retopo_free_paint(void);
-
-char retopo_mesh_paint_check(void);
-void retopo_paint_view_update(struct View3D *v3d);
-void retopo_force_update(void);
-void retopo_paint_toggle(void*,void*);
-char retopo_paint(const unsigned short event);
-void retopo_draw_paint_lines(void);
-RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd);
-
-void retopo_toggle(void*,void*);
-void retopo_do_vert(struct View3D *v3d, float *v);
-void retopo_do_all(void);
-void retopo_do_all_cb(void *, void *);
-void retopo_queue_updates(struct View3D *v3d);
-
-void retopo_matrix_update(struct View3D *v3d);
-
-void retopo_free_view_data(struct View3D *v3d);
-
-#endif
diff --git a/source/blender/include/BIF_scrarea.h b/source/blender/include/BIF_scrarea.h
deleted file mode 100644
index 6769ceb86fa..00000000000
--- a/source/blender/include/BIF_scrarea.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ScrArea;
-
- /**
- * Finds the first spacedata of @a type within
- * the scrarea.
- */
-void *scrarea_find_space_of_type(ScrArea *sa, int type);
-
-int scrarea_get_win_x (struct ScrArea *sa);
-int scrarea_get_win_y (struct ScrArea *sa);
-int scrarea_get_win_width (struct ScrArea *sa);
-int scrarea_get_win_height (struct ScrArea *sa);
-
-#ifdef __cplusplus
-}
-
-#endif
-
diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h
deleted file mode 100644
index 6f9c0ae194f..00000000000
--- a/source/blender/include/BIF_screen.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* replacement for screen.h */
-/*
- *
- * Leftovers here are actually editscreen.c thingies
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_SCREEN_H
-#define BIF_SCREEN_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* externs in editscreen.c */
-extern int displaysizex, displaysizey;
-extern struct ScrArea *curarea;
-
-struct View3D;
-struct bScreen;
-struct ScrArea;
-struct ScrVert;
-struct ScrEdge;
-struct ListBase;
-
-struct View3D *find_biggest_view3d(void);
-struct ScrArea *find_biggest_area_of_type(int spacecode);
-struct ScrArea *find_biggest_area(void);
-
-void scrarea_queue_redraw(struct ScrArea *area);
-void scrarea_queue_winredraw(struct ScrArea *area);
-void scrarea_queue_headredraw(struct ScrArea *area);
-
-int blender_test_break(void);
-
-void duplicate_screen(void);
-void init_screen_cursors(void);
-void set_timecursor(int nr);
-void waitcursor(int val);
-void wich_cursor(struct ScrArea *sa);
-void setcursor_space(int spacetype, short cur);
-void set_g_activearea(struct ScrArea *sa);
-void getmouseco_sc(short *mval);
-void getmouseco_areawin(short *mval);
-void getmouseco_headwin(short *mval);
-int qtest(void);
-int anyqtest(void);
-void areawinset(short win);
-void headerbox(struct ScrArea *sa);
-void defheaddraw(void);
-void defheadchange(void);
-unsigned short winqtest(struct ScrArea *sa);
-unsigned short headqtest(struct ScrArea *sa);
-void winqdelete(struct ScrArea *sa);
-void winqclear(struct ScrArea *sa);
-void addqueue(short win, unsigned short event, short val);
-void addafterqueue(short win, unsigned short event, short val);
-short ext_qtest(void);
-unsigned short extern_qread(short *val);
-unsigned short extern_qread_ext(short *val, char *ascii);
-
-extern void markdirty_all(void); // also sets redraw event
-extern void markdirty_all_back(void);
-extern void markdirty_win_back(short winid);
-
-void screen_swapbuffers(void);
-void set_debug_swapbuffers_ovveride(struct bScreen *sc, int mode);
-int is_allowed_to_change_screen(struct bScreen *newp);
-void splash(void * data, int datasizei, char * string);
-void screen_delayed_undo_push(char *name);
-void screenmain(void);
-void getdisplaysize(void);
-void setprefsize(int stax, int stay, int sizx, int sizy, int maximized);
-void calc_arearcts(struct ScrArea *sa);
-void resize_screen(int x, int y, int w, int h);
-struct ScrArea *closest_bigger_area(void);
-int mywinopen(int mode, short posx, short posy, short sizex, short sizey);
-void setscreen(struct bScreen *sc);
-void area_fullscreen(void);
-int select_area(int spacetype);
-struct bScreen *default_twosplit(void);
-void initscreen(void);
-void unlink_screen(struct bScreen *sc);
-void reset_autosave(void);
-int area_is_active_area(struct ScrArea *area);
-void draw_area_emboss(struct ScrArea *sa);
-
-void headerprint(char *str);
-
-/* ******* handlers ****** */
-void add_screenhandler(struct bScreen *sc, short eventcode, short val);
-void rem_screenhandler(struct bScreen *sc, short eventcode);
-int do_screenhandlers(struct bScreen *sc);
-int has_screenhandler(struct bScreen *sc, short eventcode);
-
- /***/
-
-/* return all layers of all 3d windows in a screen */
-unsigned int screen_view3d_layers(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BIF_SCREEN_H */
-
diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h
deleted file mode 100644
index c7d0f4a1ada..00000000000
--- a/source/blender/include/BIF_space.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_SPACE_H
-#define BIF_SPACE_H
-
-struct ListBase;
-struct ScrArea;
-struct SpaceButs;
-struct View2D;
-struct BWinEvent;
-struct SpaceOops;
-
-#define REMAKEIPO 1
-#define OOPS_TEST 2
-
-#define BUT_HORIZONTAL 1
-#define BUT_VERTICAL 2
-
-/* is hardcoded in DNA_space_types.h */
-#define SPACE_MAXHANDLER 8
-
-/* view3d handler codes */
-#define VIEW3D_HANDLER_BACKGROUND 1
-#define VIEW3D_HANDLER_PROPERTIES 2
-#define VIEW3D_HANDLER_OBJECT 3
-#define VIEW3D_HANDLER_PREVIEW 4
-#define VIEW3D_HANDLER_MULTIRES 5
-#define VIEW3D_HANDLER_TRANSFORM 6
-#define VIEW3D_HANDLER_GREASEPENCIL 7
-
-/* ipo handler codes */
-#define IPO_HANDLER_PROPERTIES 20
-
-/* image handler codes */
-#define IMAGE_HANDLER_PROPERTIES 30
-#define IMAGE_HANDLER_PAINT 31
-#define IMAGE_HANDLER_CURVES 32
-#define IMAGE_HANDLER_PREVIEW 33
-#define IMAGE_HANDLER_GAME_PROPERTIES 34
-#define IMAGE_HANDLER_VIEW_PROPERTIES 35
-#define IMAGE_HANDLER_GREASEPENCIL 36
-/*#define IMAGE_HANDLER_TRANSFORM_PROPERTIES 36*/
-
-/* action handler codes */
-#define ACTION_HANDLER_PROPERTIES 40
-
-/* nla handler codes */
-#define NLA_HANDLER_PROPERTIES 50
-
-/* sequence handler codes */
-#define SEQ_HANDLER_PROPERTIES 60
-#define SEQ_HANDLER_GREASEPENCIL 61
-
-/* imasel handler codes */
-#define IMASEL_HANDLER_IMAGE 70
-
-/* nodes handler codes */
-#define NODES_HANDLER_GREASEPENCIL 80
-
-/* text handler codes */
-#define TEXT_HANDLER_FIND 90
-
-/* theme codes */
-#define B_ADD_THEME 3301
-#define B_DEL_THEME 3302
-#define B_NAME_THEME 3303
-#define B_THEMECOL 3304
-#define B_UPDATE_THEME 3305
-#define B_CHANGE_THEME 3306
-#define B_THEME_COPY 3307
-#define B_THEME_PASTE 3308
-#define B_UPDATE_THEME_ICONS 3309
-
-#define B_RECALCLIGHT 3310
-
-
-void scrarea_do_winprefetchdraw (struct ScrArea *sa);
-void scrarea_do_windraw (struct ScrArea *sa);
-void scrarea_do_winchange (struct ScrArea *sa);
-void scrarea_do_winhandle (struct ScrArea *sa, struct BWinEvent *evt);
-void scrarea_do_headdraw (struct ScrArea *sa);
-void scrarea_do_headchange (struct ScrArea *sa);
-
-/* space.c */
-extern void add_blockhandler(struct ScrArea *sa, short eventcode, short action);
-extern void rem_blockhandler(struct ScrArea *sa, short eventcode);
-extern void toggle_blockhandler(struct ScrArea *sa, short eventcode, short action);
-
-extern void space_set_commmandline_options(void);
-extern void allqueue(unsigned short event, short val);
-extern void allspace(unsigned short event, short val);
-extern void copy_view3d_lock(short val);
-extern void drawemptyspace(struct ScrArea *sa, void *spacedata);
-extern void drawinfospace(struct ScrArea *sa, void *spacedata);
-extern void duplicatespacelist(struct ScrArea *area, struct ListBase *lb1, struct ListBase *lb2);
-extern void extern_set_butspace(int fkey, int do_cycle);
-extern void force_draw(int header);
-extern void force_draw_all(int header);
-extern void force_draw_plus(int type, int header);
-extern void freespacelist(struct ScrArea *sa);
-extern void handle_view3d_around(void);
-extern void handle_view3d_lock(void);
-extern void handle_view_middlemouse(void);
-extern void init_v2d_oops(struct ScrArea *, struct SpaceOops *);
-extern void initipo(struct ScrArea *sa);
-extern void newspace(struct ScrArea *sa, int type);
-extern void set_rects_butspace(struct SpaceButs *buts);
-extern void test_butspace(void);
-extern void start_game(void);
-extern void select_object_grouped(short nr);
-extern void join_menu(void);
-
-extern void BIF_undo_push(char *str);
-extern void BIF_undo(void);
-extern void BIF_redo(void);
-extern void BIF_undo_menu(void);
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
-extern void mainwindow_toggle_fullscreen(int fullscreen);
-#endif
-
-extern void mainwindow_set_filename_to_title(char *title);
-extern void mainwindow_raise(void);
-extern void mainwindow_make_active(void);
-extern void mainwindow_close(void);
-
-#endif
-
-
diff --git a/source/blender/include/BIF_spacetypes.h b/source/blender/include/BIF_spacetypes.h
deleted file mode 100644
index 3a3c1fc3e7a..00000000000
--- a/source/blender/include/BIF_spacetypes.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-struct ScrArea;
-struct BWinEvent;
-
-typedef struct _SpaceType SpaceType;
-
-typedef void (*SpacePrefetchDrawFP) (struct ScrArea *sa, void *spacedata);
-typedef void (*SpaceDrawFP) (struct ScrArea *sa, void *spacedata);
-typedef void (*SpaceChangeFP) (struct ScrArea *sa, void *spacedata);
-typedef void (*SpaceHandleFP) (struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
- /***/
-
-SpaceType* spacetype_new (char *name);
-
-void spacetype_set_winfuncs (SpaceType *st, SpacePrefetchDrawFP prefetch, SpaceDrawFP draw, SpaceChangeFP change, SpaceHandleFP handle);
-
- /***/
-
-SpaceType *spaceaction_get_type (void);
-SpaceType *spacebuts_get_type (void);
-SpaceType *spacefile_get_type (void);
-SpaceType *spaceimage_get_type (void);
-SpaceType *spaceimasel_get_type (void);
-SpaceType *spaceinfo_get_type (void);
-SpaceType *spaceipo_get_type (void);
-SpaceType *spacenla_get_type (void);
-SpaceType *spaceoops_get_type (void);
-SpaceType *spaceseq_get_type (void);
-SpaceType *spacesound_get_type (void);
-SpaceType *spacetext_get_type (void);
-SpaceType *spacescript_get_type (void);
-SpaceType *spaceview3d_get_type (void);
-SpaceType *spacetime_get_type (void);
-SpaceType *spacenode_get_type (void);
-
diff --git a/source/blender/include/BIF_tbcallback.h b/source/blender/include/BIF_tbcallback.h
deleted file mode 100644
index 27712d3020d..00000000000
--- a/source/blender/include/BIF_tbcallback.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $Id$
-*/
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****/
-
-/* defines callback structure for toolbox menu */
-typedef struct _TBcallback {
- char *desc;
- char *key;
- void (*cb)(int v); /* callback function takes value */
- int val;
-} TBcallback;
-
-typedef TBcallback * (*Tbox_callbackfunc)(int l, int x);
-void tboxSetCallback(Tbox_callbackfunc f);
-
diff --git a/source/blender/include/BIF_toolbox.h b/source/blender/include/BIF_toolbox.h
deleted file mode 100644
index dc2d5a89e9d..00000000000
--- a/source/blender/include/BIF_toolbox.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* toolbox (SPACEKEY) related
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_TOOLBOX_H
-#define BIF_TOOLBOX_H
-
-/* toolbox.c */
-void asciitoraw (int ch, short unsigned int *event, short unsigned int *qual);
-
-void toolbox_n(void);
-void toolbox_n_add(void);
-void reset_toolbox(void);
-
-void notice (char *str, ...);
-void error (char *fmt, ...);
-
-void error_libdata (void);
-
-int saveover (char *filename);
-int okee (char *fmt, ...);
-
-short button (short *var, short min, short max, char *str);
-short fbutton (float *var, float min, float max, float a1, float a2, char *str);
-short sbutton (char *var, short min, short max, char *str); /* __NLA */
-
-int movetolayer_buts (unsigned int *lay, char *title);
-int movetolayer_short_buts (short *lay, char *title);
-
-void draw_numbuts_tip (char *str, int x1, int y1, int x2, int y2);
-int do_clever_numbuts (char *name, int tot, int winevent);
-void clever_numbuts_buts(void);
-void add_numbut (int nr, int type, char *str, float min, float max, void *poin, char *tip);
-void clever_numbuts (void);
-void replace_names_but (void);
-
-void BIF_screendump(int fscreen);
-void write_screendump(char *name);
-
-typedef struct TBitem {
- int icon;
- char *name;
- int retval;
- void *poin;
-} TBitem;
-void toolbox_generic( struct TBitem *generic_menu ); /* for external toolbox - python only for now */
-
-void toolbox_mousepos( short *mpos, int save ); /* saves/restores mouse position when entering/exiting menus */
-
-#endif
diff --git a/source/blender/include/BIF_transform.h b/source/blender/include/BIF_transform.h
deleted file mode 100644
index 0e3985fc52c..00000000000
--- a/source/blender/include/BIF_transform.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_TRANSFORM_H
-#define BIF_TRANSFORM_H
-
-/* ******************** Macros & Prototypes *********************** */
-
-/* MODE AND NUMINPUT FLAGS */
-#define TFM_INIT -1
-#define TFM_DUMMY 0
-#define TFM_TRANSLATION 1
-#define TFM_ROTATION 2
-#define TFM_RESIZE 3
-#define TFM_TOSPHERE 4
-#define TFM_SHEAR 5
-#define TFM_WARP 7
-#define TFM_SHRINKFATTEN 8
-#define TFM_TILT 9
-#define TFM_LAMP_ENERGY 10
-#define TFM_TRACKBALL 11
-#define TFM_PUSHPULL 12
-#define TFM_CREASE 13
-#define TFM_MIRROR 14
-#define TFM_BONESIZE 15
-#define TFM_BONE_ENVELOPE 16
-#define TFM_CURVE_SHRINKFATTEN 17
-#define TFM_BONE_ROLL 18
-#define TFM_TIME_TRANSLATE 19
-#define TFM_TIME_SLIDE 20
-#define TFM_TIME_SCALE 21
-#define TFM_TIME_EXTEND 22
-#define TFM_BAKE_TIME 23
-#define TFM_BEVEL 24
-#define TFM_BWEIGHT 25
-#define TFM_ALIGN 26
-
-/* TRANSFORM CONTEXTS */
-#define CTX_NONE 0
-#define CTX_TEXTURE 1
-#define CTX_EDGE 2
-#define CTX_NO_PET 4
-#define CTX_TWEAK 8
-#define CTX_NO_MIRROR 16
-#define CTX_AUTOCONFIRM 32
-#define CTX_BMESH 64
-#define CTX_NDOF 128
-
-void initTransform(int mode, int context);
-void Transform(void);
-void NDofTransform();
-
-/* Standalone call to get the transformation center corresponding to the current situation
- * returns 1 if successful, 0 otherwise (usually means there's no selection)
- * (if 0 is returns, *vec is unmodified)
- * */
-int calculateTransformCenter(int centerMode, float *vec);
-
-struct TransInfo;
-struct ScrArea;
-struct Base;
-struct Scene;
-
-struct TransInfo * BIF_GetTransInfo(void);
-void BIF_setSingleAxisConstraint(float vec[3], char *text);
-void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text);
-void BIF_setLocalAxisConstraint(char axis, char *text);
-void BIF_setLocalLockConstraint(char axis, char *text);
-
-int BIF_snappingSupported(void);
-
-struct TransformOrientation;
-
-void BIF_clearTransformOrientation(void);
-void BIF_removeTransformOrientation(struct TransformOrientation *ts);
-void BIF_manageTransformOrientation(int confirm, int set);
-int BIF_menuselectTransformOrientation(void);
-void BIF_selectTransformOrientation(struct TransformOrientation *ts);
-void BIF_selectTransformOrientationFromIndex(int index);
-
-char * BIF_menustringTransformOrientation(char *title); /* the returned value was allocated and needs to be freed after use */
-int BIF_countTransformOrientation();
-
-/* Drawing callbacks */
-void BIF_drawConstraint(void);
-void BIF_drawPropCircle(void);
-void BIF_drawSnap(void);
-
-void BIF_getPropCenter(float *center);
-
-void BIF_TransformSetUndo(char *str);
-
-void BIF_selectOrientation(void);
-
-/* view3d manipulators */
-void initManipulator(int mode);
-void ManipulatorTransform();
-
-int BIF_do_manipulator(struct ScrArea *sa);
-void BIF_draw_manipulator(struct ScrArea *sa);
-
-#endif
-
diff --git a/source/blender/include/BIF_usiblender.h b/source/blender/include/BIF_usiblender.h
deleted file mode 100644
index 36471402ad0..00000000000
--- a/source/blender/include/BIF_usiblender.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_USIBLENDER_H
-#define BIF_USIBLENDER_H
-
-typedef struct RecentFile {
- struct RecentFile *next, *prev;
- char *filename;
-} RecentFile;
-
-void exit_usiblender(void);
-
-void BIF_init(void);
-
-void BIF_read_file(char *name);
-int BIF_read_homefile(int from_memory);
-void BIF_read_autosavefile(void);
-
-void BIF_write_file(char *target);
-void BIF_write_homefile(void);
-void BIF_write_autosave(void);
-void BIF_clear_tempfiles(void);
-
-#endif
-
diff --git a/source/blender/include/BIF_verse.h b/source/blender/include/BIF_verse.h
deleted file mode 100644
index 75834888e1c..00000000000
--- a/source/blender/include/BIF_verse.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#ifndef BIF_VERSE_H
-#define BIF_VERSE_H
-
-#include "BKE_verse.h"
-#include "DNA_meshdata_types.h"
-
-struct Object;
-
-struct EditMesh;
-struct EditVert;
-struct EditFace;
-struct Mesh;
-struct MVert;
-struct Mface;
-
-/* verse_object.c */
-void unsubscribe_from_obj_node(struct VNode *vnode);
-void unsubscribe_from_geom_node(struct VNode *vnode);
-void unsubscribe_from_bitmap_node(struct VNode *vnode);
-
-void test_and_send_idbutton_cb(void *obj, void *ob_name);
-
-struct Object *create_object_from_verse_node(struct VNode *vnode);
-
-void b_verse_pop_node(struct VNode *vnode);
-void b_verse_unsubscribe(VNode *vnode);
-void b_verse_push_object(struct VerseSession *session, struct Object *ob);
-void b_verse_delete_object(struct Object *ob);
-void b_verse_ms_get(void);
-
-void post_transform_pos(struct VNode *vnode);
-void post_transform_rot(struct VNode *vnode);
-void post_transform_scale(struct VNode *vnode);
-
-/*void post_transform(struct VNode *vnode);*/
-void post_link_set(struct VLink *vlink);
-void post_link_destroy(struct VLink *vlink);
-void post_object_free_constraint(struct VNode *vnode);
-
-void b_verse_send_transformation(struct Object *ob);
-
-/* verse_mesh.c */
-void b_verse_send_vertex_delete(struct EditVert *eve);
-void send_versevert_pos(struct VerseVert *vvert);
-
-void b_verse_send_face_delete(struct EditFace *efa);
-
-void sync_all_versefaces_with_editfaces(struct VNode *vnode);
-void sync_all_verseverts_with_editverts(struct VNode *vnode);
-
-void createVerseVert(struct EditVert *ev);
-void createVerseFace(struct EditFace *efa);
-
-void b_verse_duplicate_object(struct VerseSession *session, struct Object *ob, struct Object *n_ob);
-struct VNode *create_geom_vnode_from_geom_vnode(struct VNode *vnode);
-struct VNode *create_geom_vnode_data_from_editmesh(struct VerseSession *session, struct EditMesh *em);
-struct VNode *create_geom_vnode_data_from_mesh(struct VerseSession *session, struct Mesh *me);
-
-void destroy_unused_geometry(struct VNode *vnode);
-void destroy_binding_between_versemesh_and_editmesh(struct VNode *vnode);
-
-void destroy_versemesh(struct VNode *vnode);
-
-void unsubscribe_from_geom_node(struct VNode *vnode);
-
-void create_edit_mesh_from_geom_node(struct VNode *vnode);
-struct Mesh *create_mesh_from_geom_node(struct VNode *vnode);
-void create_meshdata_from_geom_node(struct Mesh *me, struct VNode *vnode);
-
-/* geometry post callback functions */
-void post_layer_create(struct VLayer *vlayer);
-void post_layer_destroy(struct VLayer *vlayer);
-
-void post_vertex_create(struct VerseVert *vvert);
-void post_vertex_set_xyz(struct VerseVert *vvert);
-void post_vertex_delete(struct VerseVert *vvert);
-void post_vertex_free_constraint(struct VerseVert *vvert);
-
-void post_polygon_set_uint8(struct VerseFace *vface);
-void post_polygon_create(struct VerseFace *vface);
-void post_polygon_set_corner(struct VerseFace *vface);
-void post_polygon_delete(struct VerseFace *vface);
-void post_polygon_free_constraint(struct VerseFace *vface);
-
-void post_geometry_free_constraint(struct VNode *vnode);
-
-/* verse_common.c */
-struct VerseSession *session_menu(void);
-char *verse_client_name(void);
-
-void post_tag_change(struct VTag *vtag);
-void post_taggroup_create(struct VTagGroup *vtaggroup);
-
-void post_node_create(struct VNode *vnode);
-void post_node_destroy(struct VNode *vnode);
-void post_node_name_set(struct VNode *vnode);
-
-void post_connect_accept(struct VerseSession *session);
-void post_connect_terminated(struct VerseSession *session);
-void post_connect_update(struct VerseSession *session);
-void post_server_add(void);
-
-/* verse_image.c */
-
-void sync_blender_image_with_verse_bitmap_node(struct VNode *vnode);
-void post_bitmap_dimension_set(struct VNode *vnode);
-void post_bitmap_layer_create(struct VBitmapLayer *vblayer);
-void post_bitmap_layer_destroy(struct VBitmapLayer *vblayer);
-void post_bitmap_tile_set(struct VBitmapLayer *vblayer, unsigned int xs, unsigned int ys);
-
-#endif
-
-#endif
diff --git a/source/blender/include/BSE_drawimasel.h b/source/blender/include/BSE_drawimasel.h
deleted file mode 100644
index 5c827653a21..00000000000
--- a/source/blender/include/BSE_drawimasel.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_DRAWIMASEL_H
-#define BSE_DRAWIMASEL_H
-
-
-/* button events */
-#define B_FS_FILENAME 1
-#define B_FS_DIRNAME 2
-#define B_FS_DIR_MENU 3
-#define B_FS_PARDIR 4
-#define B_FS_LOAD 5
-#define B_FS_CANCEL 6
-#define B_FS_LIBNAME 7
-#define B_FS_BOOKMARK 8
-
-/* ui geometry */
-#define IMASEL_BUTTONS_HEIGHT 60
-#define TILE_BORDER_X 8
-#define TILE_BORDER_Y 8
-
-struct ScrArea;
-struct SpaceImaSel;
-
-void drawimaselspace(struct ScrArea *sa, void *spacedata);
-void calc_imasel_rcts(SpaceImaSel *simasel, int winx, int winy);
-void do_imasel_buttonevents(short event, SpaceImaSel *simasel);
-
-#endif /* BSE_DRAWIMASEL_H */
-
diff --git a/source/blender/include/BSE_drawipo.h b/source/blender/include/BSE_drawipo.h
deleted file mode 100644
index b8388b2172a..00000000000
--- a/source/blender/include/BSE_drawipo.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_DRAWIPO_H
-#define BSE_DRAWIPO_H
-
-#define IN_2D_VERT_SCROLL(A) (BLI_in_rcti(&G.v2d->vert, A[0], A[1]))
-#define IN_2D_HORIZ_SCROLL(A) (BLI_in_rcti(&G.v2d->hor, A[0], A[1]))
-
-#define SELECT_REPLACE 1
-#define SELECT_ADD 2
-#define SELECT_SUBTRACT 4
-#define SELECT_INVERT 16
-
-struct ScrArea;
-struct EditIpo;
-struct View2D;
-struct rctf;
-struct SpaceLink;
-
-void calc_ipogrid(void);
-void draw_ipogrid(void);
-
-void areamouseco_to_ipoco (struct View2D *v2d, short *mval, float *x, float *y);
-void ipoco_to_areaco (struct View2D *v2d, float *vec, short *mval);
-void ipoco_to_areaco_noclip (struct View2D *v2d, float *vec, short *mval);
-
-struct View2D *spacelink_get_view2d(struct SpaceLink *sl);
-
-void view2d_do_locks (struct ScrArea *cursa, int flag);
-void view2d_zoom (struct View2D *v2d, float factor, int winx, int winy);
-void view2d_getscale (struct View2D *v2d, float *x, float *y);
-void test_view2d (struct View2D *v2d, int winx, int winy);
-void calc_scrollrcts (struct ScrArea *sa, struct View2D *v2d, int winx, int winy);
-
-int in_ipo_buttons(void);
-void draw_view2d_numbers_horiz(int drawframes);
-void drawscroll(int disptype);
-void drawipospace(struct ScrArea *sa, void *spacedata);
-
-void center_currframe(void);
-void scroll_ipobuts(void);
-int view2dzoom(unsigned short event);
-int view2dmove(unsigned short event);
-void view2dborder(void);
-
-struct EditIpo *select_proj_ipo(struct rctf *rectf, int event);
-
-
-#endif /* BSE_DRAWIPO_H */
-
diff --git a/source/blender/include/BSE_drawnla.h b/source/blender/include/BSE_drawnla.h
deleted file mode 100644
index 5d126ca9dfc..00000000000
--- a/source/blender/include/BSE_drawnla.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_DRAWNLA_H
-#define BSE_DRAWNLA_H
-
-struct ScrArea;
-struct Base;
-struct gla2DDrawInfo;
-struct Object;
-
-void drawnlaspace(struct ScrArea *sa, void *spacedata);
-void do_nlabuts(unsigned short event);
-
-int count_nla_levels(void);
-int nla_filter (struct Base* base);
-
- /* changes the gla2d system to map the strip transform */
-void map_active_strip(struct gla2DDrawInfo *di, struct Object *ob, int restore);
-
-
-#endif /* BSE_DRAWNLA */
-
diff --git a/source/blender/include/BSE_drawoops.h b/source/blender/include/BSE_drawoops.h
deleted file mode 100644
index 8b834ab5c12..00000000000
--- a/source/blender/include/BSE_drawoops.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_DRAWOOPS_H
-#define BSE_DRAWOOPS_H
-
-struct ScrArea;
-struct Oops;
-
-void boundbox_oops(short sel);
-void give_oopslink_line(struct Oops *oops, struct OopsLink *ol, float *v1, float *v2);
-void draw_oopslink(struct Oops *oops);
-void draw_icon_oops(float *co, short type);
-void mysbox(float x1, float y1, float x2, float y2);
-unsigned int give_oops_color(short type, short sel, unsigned int *border);
-void calc_oopstext(char *str, float *v1);
-void draw_oops(struct Oops *oops);
-void drawoopsspace(struct ScrArea *sa, void *spacedata);
-
-#endif /* BSE_DRAWOOPS */
-
diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h
deleted file mode 100644
index 1b2834b2e3b..00000000000
--- a/source/blender/include/BSE_drawview.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_DRAWVIEW_H
-#define BSE_DRAWVIEW_H
-
-struct Object;
-struct BGpic;
-struct rctf;
-struct ScrArea;
-struct ImBuf;
-
-void circf(float x, float y, float rad);
-void circ(float x, float y, float rad);
-
-void do_viewbuts(unsigned short event);
-
-/* View3DAfter->type */
-#define V3D_XRAY 1
-#define V3D_TRANSP 2
-void add_view3d_after(struct View3D *v3d, struct Base *base, int type, int flag);
-
-void backdrawview3d(int test);
-void check_backbuf(void);
-unsigned int sample_backbuf(int x, int y);
-struct ImBuf *read_backbuf(short xmin, short ymin, short xmax, short ymax);
-unsigned int sample_backbuf_rect(short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index));
-
-void drawview3dspace(struct ScrArea *sa, void *spacedata);
-void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int winy, float winmat[][4], int shadow);
-void draw_depth(struct ScrArea *sa, void *spacedata, int (*func)(void *) );
-void view3d_update_depths(struct View3D *v3d);
-
-int update_time(int cfra);
-void calc_viewborder(struct View3D *v3d, struct rctf *viewborder_r);
-void view3d_set_1_to_1_viewborder(struct View3D *v3d);
-
-int view3d_test_clipping(struct View3D *v3d, float *vec);
-void view3d_set_clipping(struct View3D *v3d);
-void view3d_clr_clipping(void);
-
-void sumo_callback(void *obp);
-void init_anim_sumo(void);
-void update_anim_sumo(void);
-void end_anim_sumo(void);
-
-void inner_play_anim_loop(int init, int mode);
-int play_anim(int mode);
-
-void make_axis_color(char *col, char *col2, char axis);
-char *view3d_get_name(struct View3D *v3d);
-
-/* SMOOTHVIEW */
-void smooth_view(struct View3D *v3d, float *ofs, float *quat, float *dist, float *lens);
-void smooth_view_to_camera(struct View3D *v3d);
-void view_settings_from_ob(struct Object *ob, float *ofs, float *quat, float *dist, float *lens);
-void object_view_settings(struct Object *ob, float *lens, float *clipsta, float *clipend);
-
-#endif /* BSE_DRAWVIEW_H */
-
diff --git a/source/blender/include/BSE_edit.h b/source/blender/include/BSE_edit.h
deleted file mode 100644
index 46c0a9dbf4d..00000000000
--- a/source/blender/include/BSE_edit.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_EDIT_H
-#define BSE_EDIT_H
-
-struct Object;
-struct rcti;
-
-int get_border(struct rcti *rect, short col);
-void countall(void);
-void snapmenu(void);
-void mergemenu(void);
-void alignmenu(void);
-void delete_context_selected(void);
-void duplicate_context_selected(void);
-void toggle_shading(void);
-int minmax_verts(float *min, float *max);
-
-void snap_sel_to_grid(void);
-void snap_sel_to_curs(void);
-void snap_curs_to_grid(void);
-void snap_curs_to_sel(void);
-void snap_to_center(void);
-void snap_curs_to_active(void);
-
-#endif /* BSE_EDIT_H */
-
diff --git a/source/blender/include/BSE_editaction_types.h b/source/blender/include/BSE_editaction_types.h
deleted file mode 100644
index be210415973..00000000000
--- a/source/blender/include/BSE_editaction_types.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * $Id: BIF_editaction.h 10519 2007-04-13 11:15:08Z aligorith $
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): 2007, Joshua Leung (major Action Editor recode)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BIF_EDITACTION_TYPES_H
-#define BIF_EDITACTION_TYPES_H
-
-/******************************************************* */
-/* FILTERED ACTION DATA - TYPES */
-
-/* types of keyframe data in ActListElem */
-typedef enum ALE_KEYTYPE {
- ALE_NONE = 0,
- ALE_IPO,
- ALE_ICU,
- ALE_GROUP,
- ALE_GPFRAME,
-} ALE_KEYTYPE;
-
-/* This struct defines a structure used for quick access */
-typedef struct bActListElem {
- struct bActListElem *next, *prev;
-
- void *data; /* source data this elem represents */
- int type; /* one of the ACTTYPE_* values */
- int flag; /* copy of elem's flags for quick access */
- int index; /* copy of adrcode where applicable */
-
- void *key_data; /* motion data - ipo or ipo-curve */
- short datatype; /* type of motion data to expect */
-
- struct bActionGroup *grp; /* action group that owns the channel */
-
- void *owner; /* will either be an action channel or fake ipo-channel (for keys) */
- short ownertype; /* type of owner */
-} bActListElem;
-
-/******************************************************* */
-/* FILTER ACTION DATA - METHODS/TYPES */
-
-/* filtering flags - under what circumstances should a channel be added */
-typedef enum ACTFILTER_FLAGS {
- ACTFILTER_VISIBLE = (1<<0), /* should channels be visible */
- ACTFILTER_SEL = (1<<1), /* should channels be selected */
- ACTFILTER_FOREDIT = (1<<2), /* does editable status matter */
- ACTFILTER_CHANNELS = (1<<3), /* do we only care that it is a channel */
- ACTFILTER_IPOKEYS = (1<<4), /* only channels referencing ipo's */
- ACTFILTER_ONLYICU = (1<<5), /* only reference ipo-curves */
- ACTFILTER_FORDRAWING = (1<<6), /* make list for interface drawing */
- ACTFILTER_ACTGROUPED = (1<<7) /* belongs to the active group */
-} ACTFILTER_FLAGS;
-
-/* Action Editor - Main Data types */
-typedef enum ACTCONT_TYPES {
- ACTCONT_NONE = 0,
- ACTCONT_ACTION,
- ACTCONT_SHAPEKEY,
- ACTCONT_GPENCIL
-} ACTCONT_TYPES;
-
-#endif
diff --git a/source/blender/include/BSE_editipo.h b/source/blender/include/BSE_editipo.h
deleted file mode 100644
index 807e338f514..00000000000
--- a/source/blender/include/BSE_editipo.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_EDITIPO_H
-#define BSE_EDITIPO_H
-
-struct TransVert;
-struct IpoCurve;
-struct BezTriple;
-struct Ipo;
-struct EditIpo;
-struct ID;
-struct ListBase;
-struct Object;
-struct IpoKey;
-struct TransOb;
-struct Tex;
-struct TransInfo;
-
-void remake_object_ipos(struct Object *ob);
-char *getname_ac_ei(int nr);
-char *getname_co_ei(int nr);
-char *getname_ob_ei(int nr, int colipo);
-char *getname_mtex_ei(int nr);
-char *getname_tex_ei(int nr);
-char *getname_mat_ei(int nr);
-char *getname_world_ei(int nr);
-char *getname_seq_ei(int nr);
-char *getname_cu_ei(int nr);
-char *getname_la_ei(int nr);
-char *getname_cam_ei(int nr);
-char *getname_snd_ei(int nr);
-char *getname_fluidsim_ei(int nr);
-char *getname_part_ei(int nr);
-
-char *getname_ipocurve(struct IpoCurve *icu, struct Object *ob);
-int geticon_ipo_blocktype(short blocktype);
-
-struct EditIpo *get_active_editipo(void);
-
-void boundbox_ipocurve(struct IpoCurve *icu, int selectedonly);
-void boundbox_ipo(struct Ipo *ipo, struct rctf *bb, int selectedonly);
-void editipo_changed(struct SpaceIpo *si, int doredraw);
-void scale_editipo(void);
-
-unsigned int ipo_rainbow(int cur, int tot);
-
-void test_editipo(int doit);
-void get_status_editipo(void);
-void update_editipo_flags(void);
-void set_editflag_editipo(void);
-void ipo_toggle_showkey(void);
-void swap_selectall_editipo(void);
-void swap_visible_editipo(void);
-void deselectall_editipo(void);
-
-void move_to_frame(void);
-void do_ipowin_buts(short event);
-void do_ipo_selectbuttons(void);
-
-
-/* gets ipo curve, creates if needed */
-struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int, short);
-struct Ipo *verify_ipo(struct ID *, short, char *, char *, char *, short);
-int texchannel_to_adrcode(int channel);
-
-
-void add_duplicate_editipo(void);
-void remove_doubles_ipo(void);
-void clean_ipo(void);
-void clean_ipo_curve(struct IpoCurve *icu);
-void smooth_ipo(void);
-void join_ipo_menu(void);
-void join_ipo(int mode);
-void ipo_snap_menu(void);
-void ipo_snap(short event);
-void ipo_mirror_menu(void);
-void ipo_mirror(short event);
-void mouse_select_ipo(void);
-void sethandles_ipo(int code);
-void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode);
-void select_icu_bezier_keys(struct IpoCurve *icu, int selectmode);
-void set_ipotype(void);
-void set_ipoextend(void);
-void borderselect_ipo(void);
-void del_ipo(int need_check);
-void del_ipoCurve ( struct IpoCurve * icu );
-void free_ipocopybuf(void);
-void copy_editipo(void);
-void paste_editipo(void);
-
-void set_exprap_ipo(int mode);
-
-void set_speed_editipo(float speed);
-void insertkey_editipo(void);
-void add_vert_ipo(void);
-void free_ipokey(struct ListBase *lb);
-void add_to_ipokey(struct ListBase *lb, struct BezTriple *bezt, int nr, int len);
-void make_ipokey(void);
-void make_ipokey_spec(struct ListBase *lb, struct Ipo *ipo);
-void make_ipokey_transform(struct Object *ob, struct ListBase *lb, int sel);
-void update_ipokey_val(void);
-void set_tob_old(float *old, float *poin);
-void set_ipo_pointers_transob(struct IpoKey *ik, struct TransOb *tob);
-void nextkey(struct ListBase *elems, int dir);
-void movekey_ipo(int dir);
-void movekey_obipo(int dir);
-void nextkey_ipo(int dir);
-void nextkey_obipo(int dir);
-void filter_sampledata(float *data, int sfra, int efra);
-void sampledata_to_ipocurve(float *data, int sfra, int efra, struct IpoCurve *icu);
-void ipo_record(void);
-
-void make_ipo_transdata(struct TransInfo *t);
-void remake_ipo_transdata(struct TransInfo *t);
-void transform_ipo(int mode);
-
-void actstrip_map_ipo_keys(struct Object *ob, struct Ipo *ipo, short restore, short only_keys);
-
-void sethandles_ipo_keys(struct Ipo *ipo, int code);
-void snap_cfra_ipo_keys(struct Ipo *ipo, short mode);
-void snap_ipo_keys(struct Ipo *ipo, short snaptype);
-void mirror_ipo_keys(struct Ipo *ipo, short mirror_mode);
-void setipotype_ipo(struct Ipo *ipo, int code);
-void set_ipo_key_selection(struct Ipo *ipo, int sel);
-int is_ipo_key_selected(struct Ipo *ipo);
-void delete_icu_key(struct IpoCurve *icu, int index, short do_recalc);
-void delete_ipo_keys(struct Ipo *ipo);
-int fullselect_ipo_keys(struct Ipo *ipo);
-int add_trans_ipo_keys(struct Ipo *ipo, struct TransVert *tv, int tvtot);
-void duplicate_ipo_keys(struct Ipo *ipo);
-void borderselect_ipo_key(struct Ipo *ipo, float xmin, float xmax, int val);
-void borderselect_icu_key(struct IpoCurve *icu, float xmin, float xmax,
- int (*select_function)(struct BezTriple *));
-void select_ipo_key(struct Ipo *ipo, float selx, int sel);
-void select_icu_key(struct IpoCurve *icu, float selx, int selectmode);
-void setexprap_ipoloop(struct Ipo *ipo, int code);
-
-/* callbacks */
-int select_bezier_add(struct BezTriple *bezt);
-int select_bezier_subtract(struct BezTriple *bezt);
-int select_bezier_invert(struct BezTriple *bezt);
-
-#endif /* BSE_EDITIPO_H */
-
diff --git a/source/blender/include/BSE_editipo_types.h b/source/blender/include/BSE_editipo_types.h
deleted file mode 100644
index c5ff1151e55..00000000000
--- a/source/blender/include/BSE_editipo_types.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_EDITIPO_TYPES_H
-#define BSE_EDITIPO_TYPES_H
-
-struct BezTriple;
-
-typedef struct IpoKey {
- struct IpoKey *next, *prev;
- short flag, rt;
- float val;
- struct BezTriple **data;
-} IpoKey;
-
-typedef struct EditIpo {
- char name[32]; // same length as keyblock->name
- IpoCurve *icu;
- short adrcode, flag;
- short disptype, rt;
- unsigned int col;
-} EditIpo;
-
-#endif /* BSE_EDITIPO_TYPES_H */
diff --git a/source/blender/include/BSE_filesel.h b/source/blender/include/BSE_filesel.h
deleted file mode 100644
index b46b2328ea4..00000000000
--- a/source/blender/include/BSE_filesel.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef BSE_FILESEL_H
-#define BSE_FILESEL_H
-
-struct SpaceFile;
-struct direntry;
-struct ID;
-struct ScrArea;
-struct BWinEvent;
-
-void filesel_statistics(struct SpaceFile *sfile, int *totfile, int *selfile, float *totlen, float *sellen);
-void test_flags_file(struct SpaceFile *sfile);
-void sort_filelist(struct SpaceFile *sfile);
-void read_dir(struct SpaceFile *sfile);
-void freefilelist(struct SpaceFile *sfile);
-void parent(struct SpaceFile *sfile);
-void swapselect_file(struct SpaceFile *sfile);
-void drawfilespace(struct ScrArea *sa, void *spacedata);
-
-void activate_fileselect(int type, char *title, char *file, void (*func)(char *));
-void activate_fileselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *));
-void activate_fileselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2);
-
-void activate_databrowse(struct ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short));
-void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short *menup, void (*func)(char *, void *, void *), void *arg1, void *arg2);
-
-void filesel_prevspace(void);
-void reset_filespace(struct ScrArea *sa);
-void free_filesel_spec(char *dir);
-void winqreadfilespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-void main_to_filelist(struct SpaceFile *sfile);
-
-void clever_numbuts_filesel(void);
-#endif
-
diff --git a/source/blender/include/BSE_headerbuttons.h b/source/blender/include/BSE_headerbuttons.h
deleted file mode 100644
index 472f8f9bdce..00000000000
--- a/source/blender/include/BSE_headerbuttons.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_HEADERBUTTONS_H
-#define BSE_HEADERBUTTONS_H
-
-struct uiBlock;
-struct ScrArea;
-struct ID;
-struct SpaceIpo;
-struct Ipo;
-
-/* these used to be in blender/src/headerbuttons.c: */
-#define XIC 20
-#define YIC 20
-
-int std_libbuttons(struct uiBlock *block,
- short xco, short yco, int pin, short *pinpoin,
- int browse, short id_code, short special, struct ID *id, struct ID *parid,
- short *menupoin, int users,
- int lib, int del, int autobut, int keepbut);
-
-char *windowtype_pup(void);
-
-int GetButStringLength(char *str);
-void load_space_sound(char *str);
-void load_sound_buttons(char *str);
-/* end of declarations moved from old headerbuttons.c */
-
-void update_for_newframe_muted(void);
-void update_for_newframe_nodraw(int nosound);
-void free_matcopybuf(void);
-void clear_matcopybuf(void);
-void write_vrml_fs(void);
-void write_dxf_fs(void);
-void write_stl_fs(void);
-int buttons_do_unpack(void);
-struct Scene *copy_scene(struct Scene *sce, int level);
-
-void buttons_active_id(struct ID **id, struct ID **idfrom);
-
-int start_progress_bar(void);
-void end_progress_bar(void);
-int progress_bar(float done, char *busy_info);
-
-void update_for_newframe(void);
-
-void action_buttons(void);
-void buts_buttons(void);
-void file_buttons(void);
-void image_buttons(void);
-void imasel_buttons(void);
-void info_buttons(void);
-void ipo_buttons(void);
-void nla_buttons(void);
-void oops_buttons(void);
-void seq_buttons(void);
-void sound_buttons(void);
-void text_buttons(void);
-void script_buttons(void);
-void view3d_buttons(void);
-void time_buttons(struct ScrArea *sa);
-void node_buttons(struct ScrArea *sa);
-
-void do_global_buttons(unsigned short event);
-void do_global_buttons2(short event);
-
-void do_action_buttons(unsigned short event);
-void do_buts_buttons(short event);
-void do_file_buttons(short event);
-void do_image_buttons(unsigned short event);
-void do_imasel_buttons(short event);
-void do_info_buttons(unsigned short event);
-void do_ipo_buttons(short event);
-void do_layer_buttons(short event);
-void do_nla_buttons(unsigned short event);
-void do_oops_buttons(short event);
-void do_seq_buttons(short event);
-void do_sound_buttons(unsigned short event);
-void do_text_buttons(unsigned short event);
-void do_script_buttons(unsigned short event);
-void do_view3d_buttons(short event);
-void do_time_buttons(struct ScrArea *sa, unsigned short event);
-void do_node_buttons(struct ScrArea *sa, unsigned short event);
-
-void do_headerbuttons(short event);
-
-/* header_ipo.c */
-void spaceipo_assign_ipo(struct SpaceIpo *si, struct Ipo *ipo);
-
-/* header_text.c */
-void do_text_editmenu_to3dmenu(void *arg, int event);
-void do_text_formatmenu_convert(void *arg, int event);
-
-/* header_info.c */
-void do_info_add_meshmenu(void *arg, int event);
-void do_info_add_curvemenu(void *arg, int event);
-void do_info_add_surfacemenu(void *arg, int event);
-void do_info_add_metamenu(void *arg, int event);
-void do_info_add_lampmenu(void *arg, int event);
-void do_info_addmenu(void *arg, int event);
-
-/* header_node.c */
-void do_node_addmenu(void *arg, int event);
-
-/* header_view3d.c */
-void do_view3d_select_objectmenu(void *arg, int event);
-void do_view3d_select_object_groupedmenu(void *arg, int event);
-void do_view3d_select_object_linkedmenu(void *arg, int event);
-void do_view3d_select_object_layermenu(void *arg, int event);
-void do_view3d_select_object_typemenu(void *arg, int event);
-void do_view3d_select_faceselmenu(void *arg, int event);
-void do_view3d_select_meshmenu(void *arg, int event);
-void do_view3d_select_curvemenu(void *arg, int event);
-void do_view3d_select_metaballmenu(void *arg, int event);
-void do_view3d_edit_snapmenu(void *arg, int event);
-void do_view3d_edit_mirrormenu(void *arg, int event);
-void do_view3d_transform_moveaxismenu(void *arg, int event);
-void do_view3d_transform_rotateaxismenu(void *arg, int event);
-void do_view3d_transform_scaleaxismenu(void *arg, int event);
-void do_view3d_object_mirrormenu(void *arg, int event);
-void do_view3d_edit_mesh_normalsmenu(void *arg, int event);
-void do_view3d_edit_mesh_verticesmenu(void *arg, int event);
-void do_view3d_edit_mesh_edgesmenu(void *arg, int event);
-void do_view3d_edit_mesh_facesmenu(void *arg, int event);
-void do_view3d_edit_curve_segmentsmenu(void *arg, int event);
-void do_view3d_edit_curve_showhidemenu(void *arg, int event);
-
-#endif /* BSE_HEADERBUTTONS_H */
diff --git a/source/blender/include/BSE_node.h b/source/blender/include/BSE_node.h
deleted file mode 100644
index d0656f09a46..00000000000
--- a/source/blender/include/BSE_node.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your opt ion) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL BLOCK *****
- */
-
-#ifndef BSE_NODE_H
-#define BSE_NODE_H
-
-/* ********** drawing sizes *********** */
-#define NODE_DY 20
-#define NODE_DYS 10
-#define NODE_SOCKSIZE 5
-#define BASIS_RAD 8.0f
-#define HIDDEN_RAD 15.0f
-
-
-struct SpaceNode;
-struct bNode;
-struct bNodeTree;
-struct Material;
-struct ID;
-struct Scene;
-struct Image;
-struct ImageUser;
-
-/* ************* API for editnode.c *********** */
-
- /* helper calls to retreive active context for buttons, does groups */
-struct Material *editnode_get_active_material(struct Material *ma);
-struct bNode *editnode_get_active_idnode(struct bNodeTree *ntree, short id_code);
-struct bNode *editnode_get_active(struct bNodeTree *ntree);
-
-void node_rename(struct SpaceNode *snode);
-
-void snode_tag_dirty(struct SpaceNode *snode);
-
-void snode_set_context(struct SpaceNode *snode);
-
-void snode_home(struct ScrArea *sa, struct SpaceNode *snode);
-void snode_zoom_in(struct ScrArea *sa);
-void snode_zoom_out(struct ScrArea *sa);
-
-void node_deselectall(struct SpaceNode *snode, int swap);
-void node_border_select(struct SpaceNode *snode);
-
-void node_delete(struct SpaceNode *snode);
-void node_make_group(struct SpaceNode *snode);
-void node_ungroup(struct SpaceNode *snode);
-void snode_make_group_editable(struct SpaceNode *snode, struct bNode *gnode);
-void node_hide(struct SpaceNode *snode);
-void node_read_renderlayers(struct SpaceNode *snode);
-void node_read_fullsamplelayers(struct SpaceNode *snode);
-void clear_scene_in_nodes(struct Scene *sce);
-void node_make_link(struct SpaceNode *snode);
-void node_active_link_viewer(struct SpaceNode *snode);
-
-void node_transform_ext(int mode, int unused);
-void node_shader_default(struct Material *ma);
-void node_composit_default(struct Scene *scene);
-void node_texture_default(struct Tex *tx);
-
-int node_has_hidden_sockets(struct bNode *node);
-
-struct bNode *node_add_node(struct SpaceNode *snode, int type, float locx, float locy);
-void node_adduplicate(struct SpaceNode *snode);
-
-void snode_autoconnect(struct SpaceNode *snode, struct bNode *node_to, int flag);
-void node_select_linked(struct SpaceNode *snode, int out);
-
-struct ImageUser *ntree_get_active_iuser(struct bNodeTree *ntree);
-
-void imagepaint_composite_tags(struct bNodeTree *ntree, struct Image *image, struct ImageUser *iuser);
-
-
-
-/* ************* drawnode.c *************** */
-struct SpaceNode;
-struct bNodeLink;
-void node_draw_link(struct SpaceNode *snode, struct bNodeLink *link);
-
-void node_rename_but(char *s);
-
-void init_node_butfuncs(void);
-
-void node_curvemap_sample(float *col);
-
-
-/* exported to CMP and SHD nodes */
-//void node_ID_title_cb(void *node_v, void *unused_v);
-//void node_but_title_cb(void *node_v, void *but_v);
-//void node_texmap_cb(void *texmap_v, void *unused_v);
-//void node_new_mat_cb(void *ntree_v, void *node_v);
-//void node_browse_mat_cb(void *ntree_v, void *node_v);
-//void node_mat_alone_cb(void *node_v, void *unused);
-
-
-//void node_browse_image_cb(void *ntree_v, void *node_v);
-//void node_active_cb(void *ntree_v, void *node_v);
-//void node_image_type_cb(void *node_v, void *unused);
-//char *node_image_type_pup(void);
-//char *layer_menu(struct RenderResult *rr);
-//void image_layer_cb(void *ima_v, void *iuser_v);
-//void set_render_layers_title(void *node_v, void *unused);
-//char *scene_layer_menu(struct Scene *sce);
-//void node_browse_scene_cb(void *ntree_v, void *node_v);
-
-
-//int node_buts_curvevec(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_curvecol(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_rgb(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_texture(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_valtorgb(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_value(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_mix_rgb(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_group(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_normal(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr);
-//int node_buts_math(struct uiBlock *block, struct bNodeTree *ntree, struct bNode *node, struct rctf *butr) ;
-
-
-/* ************* Shader nodes ***************** */
-
-
-#endif
-
diff --git a/source/blender/include/BSE_seqeffects.h b/source/blender/include/BSE_seqeffects.h
deleted file mode 100644
index 8d93f049794..00000000000
--- a/source/blender/include/BSE_seqeffects.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Peter Schlaile < peter [at] schlaile [dot] de >
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef BSE_SEQUENCE_EFFECTS_H
-#define BSE_SEQUENCE_EFFECTS_H
-
-/* Wipe effect */
-enum {DO_SINGLE_WIPE, DO_DOUBLE_WIPE, DO_BOX_WIPE, DO_CROSS_WIPE,
- DO_IRIS_WIPE,DO_CLOCK_WIPE};
-
-struct Sequence;
-struct ImBuf;
-
-struct SeqEffectHandle {
- /* constructors & destructor */
- /* init & init_plugin are _only_ called on first creation */
- void (*init)(struct Sequence *seq);
- void (*init_plugin)(struct Sequence * seq, const char * fname);
-
- /* number of input strips needed
- (called directly after construction) */
- int (*num_inputs)();
-
- /* load is called first time after readblenfile in
- get_sequence_effect automatically */
- void (*load)(struct Sequence *seq);
-
- /* duplicate */
- void (*copy)(struct Sequence *dst, struct Sequence * src);
-
- /* destruct */
- void (*free)(struct Sequence *seq);
-
- /* returns: -1: no input needed,
- 0: no early out,
- 1: out = ibuf1,
- 2: out = ibuf2 */
- int (*early_out)(struct Sequence *seq,
- float facf0, float facf1);
-
- /* stores the y-range of the effect IPO */
- void (*store_icu_yrange)(struct Sequence * seq,
- short adrcode, float * ymin, float * ymax);
-
- /* stores the default facf0 and facf1 if no IPO is present */
- void (*get_default_fac)(struct Sequence * seq, int cfra,
- float * facf0, float * facf1);
-
- /* execute the effect
- sequence effects are only required to either support
- float-rects or byte-rects
- (mixed cases are handled one layer up...) */
-
- void (*execute)(struct Sequence *seq, int cfra,
- float facf0, float facf1,
- int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out);
-};
-
-struct SeqEffectHandle get_sequence_effect(struct Sequence * seq);
-struct SeqEffectHandle get_sequence_blend(struct Sequence * seq);
-int get_sequence_effect_num_inputs(int seq_type);
-void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force);
-
-#endif
-
diff --git a/source/blender/include/BSE_seqscopes.h b/source/blender/include/BSE_seqscopes.h
deleted file mode 100644
index a2b3c65d6e9..00000000000
--- a/source/blender/include/BSE_seqscopes.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Author: Peter Schlaile < peter [at] schlaile [dot] de >
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef BSE_SEQUENCE_SCOPES_H
-#define BSE_SEQUENCE_SCOPES_H
-
-struct ImBuf;
-
-struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf);
-struct ImBuf *make_sep_waveform_view_from_ibuf(struct ImBuf * ibuf);
-struct ImBuf *make_vectorscope_view_from_ibuf(struct ImBuf * ibuf);
-struct ImBuf *make_zebra_view_from_ibuf(struct ImBuf * ibuf, float perc);
-struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf);
-
-#endif
-
diff --git a/source/blender/include/BSE_sequence.h b/source/blender/include/BSE_sequence.h
deleted file mode 100644
index 0d96de7be60..00000000000
--- a/source/blender/include/BSE_sequence.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef BSE_SEQUENCE_H
-#define BSE_SEQUENCE_H
-
-
-struct PluginSeq;
-struct StripElem;
-struct TStripElem;
-struct Strip;
-struct Sequence;
-struct ListBase;
-struct Editing;
-struct ImBuf;
-struct Scene;
-
-void free_tstripdata(int len, struct TStripElem *se);
-void free_strip(struct Strip *strip);
-void new_tstripdata(struct Sequence *seq);
-void free_sequence(struct Sequence *seq);
-void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq);
-
-#define BUILD_SEQAR_COUNT_NOTHING 0
-#define BUILD_SEQAR_COUNT_CURRENT 1
-#define BUILD_SEQAR_COUNT_CHILDREN 2
-
-void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar,
- int *totseq, int (*test_func)(struct Sequence * seq));
-void free_editing(struct Editing *ed);
-void calc_sequence(struct Sequence *seq);
-void calc_sequence_disp(struct Sequence *seq);
-void reload_sequence_new_file(struct Sequence * seq);
-void seq_proxy_rebuild(struct Sequence * seq);
-void sort_seq(void);
-void clear_scene_in_allseqs(struct Scene *sce);
-
-char *give_seqname_by_type(int type);
-char *give_seqname(struct Sequence *seq);
-
-int evaluate_seq_frame(int cfra);
-struct StripElem *give_stripelem(struct Sequence *seq, int cfra);
-struct TStripElem *give_tstripelem(struct Sequence *seq, int cfra);
-struct ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chansel);
-/* chansel: render this channel. Default=0 (renders end result)*/
-struct ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra,
- struct Sequence * seq);
-
-/* sequence prefetch API */
-void seq_start_threads();
-void seq_stop_threads();
-void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown);
-void seq_wait_for_prefetch_ready();
-struct ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra,
- int chanshown);
-
-
-void free_imbuf_seq_except(int cfra);
-void free_imbuf_seq_with_ipo(struct Ipo * ipo);
-void free_imbuf_seq(void);
-
-void update_changed_seq_and_deps(struct Sequence *seq, int len_change, int ibuf_change);
-
-/* still bad level call... */
-struct RenderResult;
-void do_render_seq(struct RenderResult *rr, int cfra);
-
-int seq_can_blend(struct Sequence *seq);
-
-#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
-
-#endif
-
diff --git a/source/blender/include/BSE_time.h b/source/blender/include/BSE_time.h
deleted file mode 100644
index bb235adb28a..00000000000
--- a/source/blender/include/BSE_time.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your opt ion) any later version. The Blender
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_TIME_H
-#define BSE_TIME_H
-
-struct ListBase;
-struct View2D;
-struct TimeMarker;
-
-/* ****** Marker Macros - General API ****** */
-
-/* macro for getting the scene's set of markers */
-#define SCE_MARKERS (&(G.scene->markers))
-
-/* ******** Markers - General API ********* */
-void add_marker(int frame);
-void duplicate_marker(void);
-void remove_marker(void);
-void rename_marker(void);
-void transform_markers(int mode, int smode);
-
-void borderselect_markers(void);
-void deselect_markers(short test, short sel);
-struct TimeMarker *find_nearest_marker(struct ListBase *markers, int clip_y);
-
-void nextprev_marker(short dir);
-void get_minmax_markers(short sel, float *first, float *last);
-int find_nearest_marker_time(float dx);
-struct TimeMarker *get_frame_marker(int frame);
-
-void add_marker_to_cfra_elem(struct ListBase *lb, struct TimeMarker *marker, short only_sel);
-void make_marker_cfra_list(struct ListBase *lb, short only_sel);
-
-/* ********* Markers - Drawing API ********* */
-
-/* flags for drawing markers */
-enum {
- DRAW_MARKERS_LINES = (1<<0),
- DRAW_MARKERS_LOCAL = (1<<1)
-};
-
-void draw_markers_timespace(struct ListBase *markers, int flag);
-
-/* ******** Animation - Preview Range ************* */
-void anim_previewrange_set(void);
-void anim_previewrange_clear(void);
-
-void draw_anim_preview_timespace(void);
-
-/* *********** TimeLine Specific ***************/
-void timeline_frame_to_center(void);
-void nextprev_timeline_key(short dir);
-
-#endif
-
diff --git a/source/blender/include/BSE_trans_types.h b/source/blender/include/BSE_trans_types.h
deleted file mode 100644
index ef8dbbc3160..00000000000
--- a/source/blender/include/BSE_trans_types.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BSE_TRANS_TYPES_H
-#define BSE_TRANS_TYPES_H
-
-struct Object;
-struct MDeformVert;
-struct ColorBand;
-
-typedef struct TransOb {
- float *loc;
- float oldloc[9];
- float *eff;
- float oldeff[3];
- float *rot;
- float oldrot[12];
- float olddrot[3];
- float *quat;
- float oldquat[16];
- float olddquat[4];
- float *size;
- float oldsize[12];
- float olddsize[3];
- float obmat[3][3];
- float obinv[3][3];
- float parmat[3][3];
- float parinv[3][3];
- float obvec[3];
- int flag; /* keys */
- float *locx, *locy, *locz;
- float *rotx, *roty, *rotz;
- float *quatx, *quaty, *quatz, *quatw;
- float *sizex, *sizey, *sizez;
- /* __NLA */
- float axismat[3][3]; /* Restmat of object (for localspace transforms) */
- void *data; /* Arbitrary data */
- /* end __NLA */
- struct Object *ob;
-} TransOb;
-
-typedef struct TransVert {
- float *loc;
- float oldloc[3], fac;
- float *val, oldval;
- int flag;
- float *nor;
-} TransVert;
-
-typedef struct VPaint {
- float r, g, b, a;
- float size; /* of brush */
- float gamma, mul;
- short mode, flag;
- int tot, pad; /* allocation size of prev buffers */
- unsigned int *vpaint_prev; /* previous mesh colors */
- struct MDeformVert *wpaint_prev; /* previous vertex weights */
-} VPaint;
-
-#endif /* BSE_TRANS_TYPES_H */
-
diff --git a/source/blender/include/BSE_types.h b/source/blender/include/BSE_types.h
deleted file mode 100644
index d228f85091a..00000000000
--- a/source/blender/include/BSE_types.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-/* forward declarations for some prototype header */
-/* these may wildly occur in other header files, too */
-
-struct BGpic;
-struct SpaceText;
-struct Oops;
-struct OopsLink;
-struct uiBlock;
-struct BoundBox;
-struct Image;
-struct ImBuf;
-struct SpaceImaSel;
-struct Sequence;
-struct Scene;
-struct IpoCurve;
-struct Ipo;
-struct IpoKey;
-struct Mesh;
-struct MTFace;
-struct Object;
-struct TransOb;
-struct TransVert;
-struct BPoint;
-struct BezTriple;
-
-struct Nurb;
-
-struct EditFace;
-struct EditVert;
-struct EditEdge;
-struct EditIpo;
-
-struct bArmature;
-struct Bone;
-
-/* interface crap */
-struct uiBut;
-
diff --git a/source/blender/include/BSE_view.h b/source/blender/include/BSE_view.h
deleted file mode 100644
index f7afce958f5..00000000000
--- a/source/blender/include/BSE_view.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * protos for view.c -- not complete
- */
-
-#ifndef BSE_VIEW_H
-#define BSE_VIEW_H
-
-struct Object;
-struct BoundBox;
-struct View3D;
-struct ScrArea;
-
-typedef struct ViewDepths {
- unsigned short w, h;
- float *depths;
- double depth_range[2];
-
- char damaged;
-} ViewDepths;
-
-#define PERSP_WIN 0
-#define PERSP_VIEW 1
-#define PERSP_STORE 2
-
-void persp_general(int a);
-void persp(int a);
-
-/* note, the define below is still used for shorts, to calc distances... */
-#define IS_CLIPPED 12000
-void view3d_get_object_project_mat(struct ScrArea *area, struct Object *ob, float pmat[4][4], float vmat[4][4]);
-void view3d_project_float(struct ScrArea *area, float *vec, float *adr, float mat[4][4]);
-void view3d_project_short_clip(struct ScrArea *area, float *vec, short *adr, float projmat[4][4], float viewmat[4][4]);
-void view3d_project_short_noclip(struct ScrArea *area, float *vec, short *adr, float mat[4][4]);
-
-void initgrabz(float x, float y, float z);
-void window_to_3d(float *vec, short mx, short my);
-void project_short(float *vec, short *adr);
-void project_short_noclip(float *vec, short *adr);
-void project_int(float *vec, int *adr);
-void project_int_noclip(float *vec, int *adr);
-void project_float(float *vec, float *adr);
-void project_float_noclip(float *vec, float *adr);
-void viewray(short mval[2], float ray_start[3], float ray_normal[3]);
-void viewline(short mval[2], float ray_start[3], float ray_end[3]);
-
-int boundbox_clip(float obmat[][4], struct BoundBox *bb);
-void fdrawline(float x1, float y1, float x2, float y2);
-void fdrawbox(float x1, float y1, float x2, float y2);
-void sdrawline(short x1, short y1, short x2, short y2);
-void sdrawbox(short x1, short y1, short x2, short y2);
-void calctrackballvecfirst(struct rcti *area, short *mval, float *vec);
-void calctrackballvec(struct rcti *area, short *mval, float *vec);
-void viewmove(int mode);
-void viewmoveNDOFfly(int mode);
-void viewmoveNDOF(int mode);
-void view_zoom_mouseloc(float dfac, short *mouseloc);
-
-int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
-void setwinmatrixview3d(int winx, int winy, struct rctf *rect);
-
-void obmat_to_viewmat(struct Object *ob, short smooth);
-void setviewmatrixview3d(void);
-float *give_cursor(void);
-unsigned int free_localbit(void);
-void initlocalview(void);
-void centerview(void);
-void restore_localviewdata(struct View3D *vd);
-void endlocalview(struct ScrArea *sa);
-void view3d_home(int center);
-short view3d_opengl_select(unsigned int *buffer, unsigned int buffsize, short x1, short y1, short x2, short y2);
-void view3d_align_axis_to_vector(struct View3D *v3d, int axisidx, float vec[3]);
-
-#endif
-
diff --git a/source/blender/include/LOD_DependKludge.h b/source/blender/include/LOD_DependKludge.h
deleted file mode 100644
index 12a73dc744c..00000000000
--- a/source/blender/include/LOD_DependKludge.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * Decimation file dependency fix (and kludge)
- * Use together with a NAN_DECIMATIONTEST env.var. for Makefile-based linking
- */
-#ifndef LOD_DEPENDKLUDGE_H
-#define LOD_DEPENDKLUDGE_H
-
-#define NAN_DECIMATION
-
-#endif //LOD_DEPENDKLUDGE_H
-
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
deleted file mode 100644
index 60d3a589c51..00000000000
--- a/source/blender/include/blendef.h
+++ /dev/null
@@ -1,461 +0,0 @@
-/* $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef BLENDEF_H
-#define BLENDEF_H
-
-
-/* **************** MAX ********************* */
-
-#define MAXFRAME 300000
-#define MAXFRAMEF 300000.0f
-
-#define MINFRAME 1
-#define MINFRAMEF 1.0
-
-/* max length material array, 16 because of bits in matfrom */
-#define MAXPICKBUF 10000
-#define MAXSEQ 32
-
-/* in buttons.c */
-#ifndef MAXFLOAT
-#define MAXFLOAT ((float)3.40282347e+38)
-#endif
-
-/* also fill in structs itself, dna cannot handle defines, duplicate with utildefines.h still */
-#ifndef FILE_MAXDIR
-#define FILE_MAXDIR 160
-#define FILE_MAXFILE 80
-#endif
-
-
-#include <float.h>
-
-
-
-
-/* **************** GENERAL ********************* */
-
-// return values
-
-#define RET_OK 0
-#define RET_ERROR 1
-#define RET_CANCEL 2
-
-#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-/* big endian */
-#define MAKE_ID2(c, d) ( (c)<<8 | (d) )
-#define MOST_SIG_BYTE 0
-#define BBIG_ENDIAN
-#else
-/* little endian */
-#define MAKE_ID2(c, d) ( (d)<<8 | (c) )
-#define MOST_SIG_BYTE 1
-#define BLITTLE_ENDIAN
-#endif
-
-#define SELECT 1
-#define HIDDEN 1
-#define FIRST 1
-#define ACTIVE 2
-/*#ifdef WITH_VERSE*/
-#define VERSE 3
-/*#endif*/
-#define DESELECT 0
-#define VISIBLE 0
-#define LAST 0
-
-#define TESTBASE(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) )
-#define TESTBASELIB(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
-
-/* This is a TESTBASELIB that can work without a 3D view */
-#define TESTBASELIB_BGMODE(base) ( ((base)->flag & SELECT) && ((base)->lay & (G.vd ? G.vd->lay : G.scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
-
-#define BASE_SELECTABLE(base) ((base->lay & G.vd->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
-#define FIRSTBASE G.scene->base.first
-#define LASTBASE G.scene->base.last
-#define BASACT (G.scene->basact)
-#define OBACT (BASACT? BASACT->object: 0)
-#define OB_SUPPORT_MATERIAL(ob) ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)
-#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
-#define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
-#define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;}
-#define CFRA (G.scene->r.cfra)
-#define F_CFRA ((float)(G.scene->r.cfra))
-#define SFRA (G.scene->r.sfra)
-#define EFRA (G.scene->r.efra)
-#define STFRA (G.scene->frame_step)
-#define PSFRA ((G.scene->r.psfra != 0)? (G.scene->r.psfra): (G.scene->r.sfra))
-#define PEFRA ((G.scene->r.psfra != 0)? (G.scene->r.pefra): (G.scene->r.efra))
-#define FRA2TIME(a) ((((double) G.scene->r.frs_sec_base) * (a)) / G.scene->r.frs_sec)
-#define TIME2FRA(a) ((((double) G.scene->r.frs_sec) * (a)) / G.scene->r.frs_sec_base)
-#define FPS (((double) G.scene->r.frs_sec) / G.scene->r.frs_sec_base)
-
-#define ISPOIN(a, b, c) ( (a->b) && (a->c) )
-#define ISPOIN3(a, b, c, d) ( (a->b) && (a->c) && (a->d) )
-#define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) )
-
-#define BEZSELECTED(bezt) (((bezt)->f1 & SELECT) || ((bezt)->f2 & SELECT) || ((bezt)->f3 & SELECT))
-/* for curve objects in editmode that can have hidden handles - may use for IPO's later */
-#define BEZSELECTED_HIDDENHANDLES(bezt) ((G.f & G_HIDDENHANDLES) ? (bezt)->f2 & SELECT : BEZSELECTED(bezt))
-
-#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; }
-#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; }
-#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; }
-
-/* getbutton */
-
-/* do_global_buttons(event) */
-
-// (first event)
-#define B_LOCAL_ALONE 20
-
-
-#define B_ACTLOCAL 24 /* __NLA */
-#define B_ACTALONE 25 /* __NLA */
-#define B_ARMLOCAL 26 /* __NLA */
-#define B_ARMALONE 27 /* __NLA */
-
-#define B_WORLDLOCAL 28
-#define B_WORLDALONE 29
-#define B_LATTLOCAL 30
-#define B_MBALLLOCAL 31
-#define B_CAMERALOCAL 32
-#define B_OBLOCAL 33
-#define B_IPOLOCAL 34
-#define B_LAMPLOCAL 35
-#define B_MATLOCAL 36
-#define B_TEXLOCAL 37
-#define B_MESHLOCAL 38
-#define B_CURVELOCAL 39
-
-#define B_LATTALONE 40
-#define B_MBALLALONE 41
-#define B_CAMERAALONE 42
-#define B_OBALONE 43
-#define B_IPOALONE 44
-#define B_LAMPALONE 45
-#define B_MATALONE 46
-#define B_TEXALONE 47
-#define B_MESHALONE 48
-#define B_CURVEALONE 49
-
-/* EVENT < 50: alones en locals */
-
-#define B_KEEPDATA 60
-#define B_DRAWINFO 62
-#define B_REDRCURW3D 63
-#define B_FLIPINFOMENU 64
-#define B_FLIPFULLSCREEN 65
-#define B_PLAINMENUS 66
-
-
-#define B_GLRESLIMITCHANGED 69
-#define B_SHOWSPLASH 70
-#define B_RESETAUTOSAVE 71
-#define B_SOUNDTOGGLE 72
-#define B_MIPMAPCHANGED 73
-#define B_CONSTRAINTBROWSE 74 /* __NLA */
-#define B_ACTIONDELETE 75 /* __NLA */
-#define B_ACTIONBROWSE 76 /* __NLA */
-#define B_IMAGEDELETE 77
-#define B_LTEXBROWSE 78
-#define B_MESHBROWSE 79
-#define B_EXTEXBROWSE 80
-#define B_LOADTEMP 81
-#define B_MATDELETE 82
-#define B_TEXDELETE 83
-#define B_IPODELETE 84
-#define B_WORLDDELETE 85
-#define B_WTEXBROWSE 86
-#define B_WORLDBROWSE 87
-#define B_IPOBROWSE 88
-#define B_NEWFRAME 89
-#define B_LAMPBROWSE 90
-#define B_MATBROWSE 91
-#define B_TEXBROWSE 92
-#define B_EDITBROWSE 93
-#define B_AUTOTEXNAME 94
-#define B_AUTOMATNAME 95
-#define B_MATLOCK 96
-#define B_IDNAME 97
-#define B_NEWSPACE 98
-#define B_FULL 99
-#define B_REDR 100
-
-
-/* VIEW3D: 100 */
-#define B_HOME 101
-#define B_LAY 102
-/* watch: codes 102-132 in in use for layers */
-#define B_AUTOKEY 139
-#define B_SCENELOCK 140
-#define B_U_CAPSLOCK 142
-
-#define B_VIEWBUT 146
-#define B_PERSP 147
-#define B_VIEWRENDER 149
-#define B_STARTGAME 150
-
-#define B_MODESELECT 156
-#define B_AROUND 157
-#define B_SEL_VERT 158
-#define B_SEL_EDGE 159
-#define B_SEL_FACE 160
-#define B_MAN_TRANS 161
-#define B_MAN_ROT 162
-#define B_MAN_SCALE 163
-#define B_SEL_PATH 166
-#define B_SEL_POINT 167
-#define B_SEL_END 168
-#define B_MAN_MODE 169
-#define B_NDOF 170
-#define B_VIEW_BUTSEDIT 171
-
-/* IPO: 200 */
-#define B_IPOHOME 201
-#define B_IPOBORDER 202
-#define B_IPOCOPY 203
-#define B_IPOPASTE 204
-#define B_IPOCONT 205
-#define B_IPOEXTRAP 206
-#define B_IPOCYCLIC 207
-#define B_IPOMAIN 208
-#define B_IPOSHOWKEY 209
-#define B_IPOCYCLICX 210
- /* warn: also used for oops and seq */
-#define B_VIEW2DZOOM 211
-#define B_IPOPIN 212
-#define B_IPO_ACTION_OB 213
-#define B_IPO_ACTION_KEY 214
-#define B_IPOVIEWCENTER 215
-#define B_IPOVIEWALL 216
-#define B_IPOREDRAW 217
-
-/* OOPS: 250 */
-#define B_OOPSHOME 251
-#define B_NEWOOPS 252
-#define B_OOPSVIEWSEL 253
-
-/* INFO: 300 */
-/* watch: also in filesel.c and editobject.c */
-#define B_INFOSCR 301
-#define B_INFODELSCR 302
-#define B_INFOSCE 304
-#define B_INFODELSCE 305
-
-#define B_CONSOLEOUT 308
-#define B_CONSOLENUMLINES 309
-#define B_USERPREF 310
-#define B_LOADUIFONT 311
-#define B_SETLANGUAGE 312
-#define B_SETFONTSIZE 313
-#define B_SETENCODING 314
-#define B_SETTRANSBUTS 315
-#define B_DOLANGUIFONT 316
-#define B_RESTOREFONT 317
-#define B_USETEXTUREFONT 318
-
-#define B_UITHEMERESET 322
-
-#define B_MEMCACHELIMIT 325
-#define B_WPAINT_RANGE 326
-
-/* Definitions for the fileselect buttons in user prefs */
-#define B_FONTDIRFILESEL 330
-#define B_TEXTUDIRFILESEL 331
-#define B_PLUGTEXDIRFILESEL 332
-#define B_PLUGSEQDIRFILESEL 333
-#define B_RENDERDIRFILESEL 334
-#define B_PYTHONDIRFILESEL 335
-#define B_SOUNDDIRFILESEL 336
-#define B_TEMPDIRFILESEL 337
-/* yafray: for exportdir select */
-#define B_YAFRAYDIRFILESEL 338
-#define B_PYMENUEVAL 339 /* re-eval scripts registration in menus */
-/* END Definitions for the fileselect buttons in user prefs */
-
-/* IMAGE: 350 */
-#define B_SIMAGEHOME 351
-#define B_SIMABROWSE 352
-#define B_SIMAGELOAD 353
-#define B_SIMA_REDR_IMA_3D 354
-#define B_SIMAGETILE 355
-#define B_TWINANIM 357
-#define B_SIMAGEPAINTTOOL 362
-#define B_SIMAPACKIMA 363
-#define B_SIMACLONEBROWSE 365
-#define B_SIMACLONEDELETE 366
-#define B_SIMANOTHING 368
-#define B_SIMACURVES 369
-#define B_SIMARANGE 370
-#define B_SIMA_USE_ALPHA 371
-#define B_SIMA_SHOW_ALPHA 372
-#define B_SIMA_SHOW_ZBUF 373
-#define B_SIMABRUSHBROWSE 374
-#define B_SIMABRUSHDELETE 375
-#define B_SIMABRUSHLOCAL 376
-#define B_SIMABRUSHCHANGE 377
-#define B_SIMABTEXBROWSE 378
-#define B_SIMABTEXDELETE 379
-#define B_SIMARELOAD 380
-#define B_SIMANAME 381
-#define B_SIMAMULTI 382
-#define B_TRANS_IMAGE 383
-#define B_CURSOR_IMAGE 384
-#define B_SIMA_REPACK 385
-#define B_SIMA_PLAY 386
-#define B_SIMA_RECORD 387
-#define B_SIMAPIN 388
-#define B_SIMA3DVIEWDRAW 389
-
-
-/* BUTS: 400 */
-#define B_BUTSHOME 401
-#define B_BUTSPREVIEW 402
-#define B_MATCOPY 403
-#define B_MATPASTE 404
-#define B_CONTEXT_SWITCH 405
-
-/* IMASEL: 450 */
-/* in imasel.h - not any more - elubie */
-#define B_SORTIMASELLIST 451
-#define B_RELOADIMASELDIR 452
-#define B_FILTERIMASELDIR 453
-
-/* TEXT: 500 */
-#define B_TEXTBROWSE 501
-#define B_TEXTDELETE 504
-#define B_TEXTFONT 505
-#define B_TEXTSTORE 506
-#define B_TEXTLINENUM 507
-#define B_TAB_NUMBERS 508
-#define B_SYNTAX 509
-#define B_WORDWRAP 510
-#define B_TEXTPLUGINS 511
-#define B_PASTEFIND 512
-#define B_PASTEREPLACE 513
-#define B_TEXTREPLACE 514
-#define B_TEXTFIND 515
-#define B_TEXTMARKALL 516
-
-/* SCRIPT: 525 */
-#define B_SCRIPTBROWSE 526
-#define B_SCRIPT2PREV 527
-
-/* FILE: 550 */
-#define B_SORTFILELIST 551
-#define B_RELOADDIR 552
-
-/* SEQUENCE: 600 */
-#define B_SEQCLEAR 601
-
-/* SOUND: 650 */
-#define B_SOUNDBROWSE 651
-#define B_SOUNDBROWSE2 652
-#define B_SOUNDHOME 653
-
-/* ACTION: 701 - 750 */
-#define B_ACTHOME 701
-#define B_ACTCOPY 702
-#define B_ACTPASTE 703
-#define B_ACTPASTEFLIP 704
-#define B_ACTCYCLIC 705
-#define B_ACTCONT 706
-#define B_ACTMAIN 707
-#define B_ACTPIN 708
-#define B_ACTBAKE 709
-#define B_ACTCOPYKEYS 710
-#define B_ACTPASTEKEYS 711
-
-#define B_ACTCUSTCOLORS 712
-#define B_ACTCOLSSELECTOR 713
-#define B_ACTGRP_SELALL 714
-#define B_ACTGRP_ADDTOSELF 715
-#define B_ACTGRP_UNGROUP 716
-
-/* TIME: 751 - 800 */
-#define B_TL_REW 751
-#define B_TL_PLAY 752
-#define B_TL_FF 753
-#define B_TL_PREVKEY 754
-#define B_TL_NEXTKEY 755
-#define B_TL_STOP 756
-#define B_TL_PREVIEWON 757
-#define B_TL_INSERTKEY 758
-#define B_TL_DELETEKEY 759
-
-/* NLA: 801-850 */
-#define B_NLAHOME 801
-
-/* NODE: 851-900 */
-#define B_NODE_USEMAT 851
-#define B_NODE_USESCENE 852
-#define B_NODE_USETEX 853
-
-/* FREE 901 - 999 */
-
-
-#define B_NOP -1
-
-
-/* editbutflag */
-#define B_CLOCKWISE 1
-#define B_KEEPORIG 2
-#define B_BEAUTY 4
-#define B_SMOOTH 8
-#define B_BEAUTY_SHORT 16
-#define B_AUTOFGON 32
-#define B_KNIFE 0x80
-#define B_PERCENTSUBD 0x40
-#define B_MESH_X_MIRROR 0x100
-#define B_JOINTRIA_UV 0x200
-#define B_JOINTRIA_VCOL 0X400
-#define B_JOINTRIA_SHARP 0X800
-#define B_JOINTRIA_MAT 0X1000
-
-/* DISPLAYMODE */
-#define R_DISPLAYIMAGE 0
-#define R_DISPLAYWIN 1
-#define R_DISPLAYSCREEN 2
-
-/* Gvp.flag and Gwp.flag */
-#define VP_COLINDEX 1
-#define VP_AREA 2
-#define VP_SOFT 4
-#define VP_NORMALS 8
-#define VP_SPRAY 16
-#define VP_MIRROR_X 32
-#define VP_HARD 64
-#define VP_ONLYVGROUP 128
-
-/* Error messages */
-#define ERROR_LIBDATA_MESSAGE "Can't edit external libdata"
-
-#define MAX_RENDER_PASS 100
-
-#endif
diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h
deleted file mode 100644
index fd3f6e926b9..00000000000
--- a/source/blender/include/butspace.h
+++ /dev/null
@@ -1,806 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef BUTSPACE_H
-#define BUTSPACE_H
-
-/* all internal calls and event codes for buttons space */
-
-struct Base;
-struct Object;
-struct ID;
-struct ColorBand;
-struct uiBlock;
-struct rctf;
-struct CurveMap;
-struct ImageUser;
-struct RenderResult;
-struct Image;
-
-/* buts->scaflag */
-#define BUTS_SENS_SEL 1
-#define BUTS_SENS_ACT 2
-#define BUTS_SENS_LINK 4
-#define BUTS_CONT_SEL 8
-#define BUTS_CONT_ACT 16
-#define BUTS_CONT_LINK 32
-#define BUTS_ACT_SEL 64
-#define BUTS_ACT_ACT 128
-#define BUTS_ACT_LINK 256
-#define BUTS_SENS_STATE 512
-#define BUTS_ACT_STATE 1024
-
-/* internal */
-
-/* scene */
-extern void render_panels(void);
-extern void do_render_panels(unsigned short event);
-extern void anim_panels(void);
-extern void sound_panels(void);
-extern void do_soundbuts(unsigned short event);
-extern void sequencer_panels(void);
-extern void do_sequencer_panels(unsigned short event);
-
-/* object */
-extern void object_panels(void);
-extern void physics_panels(void);
-extern void particle_panels(void);
-extern void do_object_panels(unsigned short event);
-extern void do_constraintbuts(unsigned short event);
-extern void object_panel_constraint(char *context);
-extern void autocomplete_bone(char *str, void *arg_v);
-extern void autocomplete_vgroup(char *str, void *arg_v);
-
-/* effects */
-extern void effects_panels(void);
-extern void do_effects_panels(unsigned short event);
-
-/* modifiers */
-extern int mod_moveUp(void *ob_v, void *md_v);
-extern int mod_moveDown(void *ob_v, void *md_v);
-
-/* constraint */
-extern void const_moveUp(void *ob_v, void *con_v);
-extern void const_moveDown(void *ob_v, void *con_v);
-extern void del_constr_func (void *ob_v, void *con_v);
-
-/* editing */
-extern void editing_panels(void);
-extern void do_common_editbuts(unsigned short event);
-extern void do_meshbuts(unsigned short event);
-extern void do_vgroupbuts(unsigned short event);
-extern void do_curvebuts(unsigned short event);
-extern void do_fontbuts(unsigned short event);
-extern void do_mballbuts(unsigned short event);
-extern void do_latticebuts(unsigned short event);
-extern void do_fpaintbuts(unsigned short event);
-extern void do_cambuts(unsigned short event);
-extern void do_armbuts(unsigned short event);
-extern void do_uvcalculationbuts(unsigned short event);
-extern void weight_paint_buttons(struct uiBlock *);
-extern void particle_edit_buttons(struct uiBlock *);
-
-extern char *get_vertexgroup_menustr(struct Object *ob); // used in object buttons
-
-/* shading */
-extern void draw_colorband_buts_small(struct uiBlock *block, struct ColorBand *coba, rctf *rct, int event);
-extern void material_panels(void);
-extern void do_matbuts(unsigned short event);
-extern void lamp_panels(void);
-extern void do_lampbuts(unsigned short event);
-extern void world_panels(void);
-extern void do_worldbuts(unsigned short event);
-extern void radio_panels(void);
-extern void do_radiobuts(unsigned short event);
-extern void texture_panels(void);
-extern void do_texbuts(unsigned short event);
-void uiblock_image_panel(struct uiBlock *block, struct Image **ima_pp, struct ImageUser *iuser,
- short redraw, short imagechanged);
-void uiblock_layer_pass_buttons(struct uiBlock *block, struct RenderResult *rr,
- struct ImageUser *iuser, int event, int x, int y, int w);
-
-/* logic */
-extern void do_logic_buts(unsigned short event);
-extern void logic_buts(void);
-
-/* script */
-extern void script_panels(void);
-extern void do_scriptbuts(unsigned short event);
-
-/* ipowindow */
-extern void do_ipobuts(unsigned short event); // drawipo.c (bad! ton)
-
-/* butspace.c */
-void test_meshpoin_but(char *name, struct ID **idpp);
-void test_obpoin_but(char *name, struct ID **idpp);
-void test_meshobpoin_but(char *name, struct ID **idpp);
-void test_scenepoin_but(char *name, struct ID **idpp);
-void test_matpoin_but(char *name, struct ID **idpp);
-void test_scriptpoin_but(char *name, struct ID **idpp);
-void test_actionpoin_but(char *name, ID **idpp);
-void test_grouppoin_but(char *name, ID **idpp);
-void test_texpoin_but(char *name, ID **idpp);
-void test_imapoin_but(char *name, ID **idpp);
-
-void test_idbutton_cb(void *namev, void *arg2_unused);
-
-struct CurveMapping;
-void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char labeltype, short event, short redraw, struct rctf *rect);
-
-/* -------------- internal event defines ------------ */
-
-
-#define B_DIFF 1
-
-/* *********************** */
-#define B_VIEWBUTS 1100
-
-#define B_OBJECTPANELROT 1007
-#define B_OBJECTPANELMEDIAN 1008
-#define B_ARMATUREPANEL1 1009
-#define B_ARMATUREPANEL2 1010
-#define B_OBJECTPANELPARENT 1011
-#define B_OBJECTPANEL 1012
-#define B_ARMATUREPANEL3 1013
-#define B_OBJECTPANELSCALE 1014
-#define B_OBJECTPANELDIMS 1015
-#define B_TRANSFORMSPACEADD 1016
-#define B_TRANSFORMSPACECLEAR 1017
-
-/* *********************** */
-#define B_LAMPBUTS 1200
-
-#define B_LAMPREDRAW 1101
-#define B_COLLAMP 1102
-#define B_TEXCLEARLAMP 1103
-#define B_SBUFF 1104
-#define B_SHADBUF 1105
-#define B_SHADRAY 1106
-#define B_LMTEXPASTE 1107
-#define B_LMTEXCOPY 1108
-#define B_LFALLOFFCHANGED 1109
-#define B_LMTEXMOVEUP 1110
-#define B_LMTEXMOVEDOWN 1111
-
-/* *********************** */
-#define B_MATBUTS 1300
-
-#define B_MATCOL 1201
-#define B_SPECCOL 1202
-#define B_MIRCOL 1203
-#define B_ACTCOL 1204
-#define B_MATFROM 1205
-#define B_MATPRV 1206
-#define B_LAMPPRV 1207
-#define B_WORLDPRV 1208
-#define B_MTEXCOL 1210
-#define B_TEXCLEAR 1211
-#define B_MTEXPASTE 1212
-#define B_MTEXCOPY 1213
-#define B_MATLAY 1214
-#define B_MATHALO 1215
-#define B_MATZTRANSP 1216
-#define B_MATRAYTRANSP 1217
-#define B_MATCOLORBAND 1218
- /* yafray: material preset menu event */
-#define B_MAT_YF_PRESET 1219
-
-#define B_MAT_LAYERBROWSE 1220
-#define B_MAT_USENODES 1221
-#define B_MAT_VCOL_PAINT 1222
-#define B_MAT_VCOL_LIGHT 1223
-
- /* world buttons: buttons-preview update, and redraw 3dview */
-#define B_WORLDPRV2 1224
-
-#define B_MAT_PARTICLE 1225
-
-#define B_MTEXMOVEUP 1226
-#define B_MTEXMOVEDOWN 1227
-
-/* *********************** */
-#define B_TEXBUTS 1400
-
-#define B_TEXTYPE 1301
-#define B_DEFTEXVAR 1302
-
-#define B_NAMEIMA 1304
-#define B_TEXCHANNEL 1305
-#define B_TEXREDR_PRV 1306
-#define B_IMAGECHANGED 1307
-
-#define B_LOADPLUGIN 1310
-#define B_NAMEPLUGIN 1311
-#define B_COLORBAND 1312
-#define B_ADDCOLORBAND 1313
-#define B_DELCOLORBAND 1314
-#define B_CALCCBAND 1315
-#define B_CALCCBAND2 1316
-#define B_DOCOLORBAND 1317
-#define B_REDRAWCBAND 1318
-#define B_BANDCOL 1319
-#define B_LOADTEXIMA1 1320
-#define B_TEXPRV 1321
-
-
-#define B_PLUGBUT 1325
-/* B_PLUGBUT reserves 24 buttons at least! */
-
-#define B_ENV_MAKE 1350
-#define B_ENV_FREE 1351
-#define B_ENV_DELETE 1352
-#define B_ENV_SAVE 1353
-#define B_ENV_OB 1354
-
-#define B_ENV_FREE_ALL 1357
-#define B_TEX_USENODES 1358
-
-
-/* **************** animbuts = object buttons ******* */
-#define B_ANIMBUTS 1500
-
-#define B_RECALCPATH 1401
-#define B_TRACKBUTS 1402
-#define B_DUPLI_FRAME 1403
-#define B_DUPLI_VERTS 1404
-#define B_DUPLI_FACES 1405
-#define B_DUPLI_GROUP 1406
-
-
-#define B_PRINTSPEED 1413
-#define B_PRINTLEN 1414
-#define B_RELKEY 1415
-#define B_CURVECHECK 1416
-
-#define B_SOFTBODY_CHANGE 1420
-#define B_SOFTBODY_DEL_VG 1421
-#define B_SOFTBODY_BAKE 1422
-#define B_SOFTBODY_BAKE_FREE 1423
-
-/* Fluidsim button defines */
-#define B_FLUIDSIM_BAKE 1450
-#define B_FLUIDSIM_SELDIR 1451
-#define B_FLUIDSIM_FORCEREDRAW 1452
-#define B_FLUIDSIM_MAKEPART 1453
-#define B_FLUIDSIM_CHANGETYPE 1454
-
-#define B_GROUP_RELINK 1460
-#define B_OBJECT_IPOFLAG 1461
-
-#define B_BAKE_CACHE_CHANGE 1470
-
-/* Cloth sim button defines */
-#define B_CLOTH_CHANGEPREROLL 1480
-
-/* *********************** */
-#define B_WORLDBUTS 1600
-
-#define B_TEXCLEARWORLD 1501
-#define B_COLHOR 1502
-#define B_COLZEN 1503
-#define B_WMTEXPASTE 1504
-#define B_WMTEXCOPY 1505
-#define B_AO_FALLOFF 1506
-#define B_WMTEXMOVEUP 1507
-#define B_WMTEXMOVEDOWN 1508
-
-/* *********************** */
-#define B_RENDERBUTS 1690
-#define B_SEQUENCERBUTS 1699
-
-#define B_FS_PIC 1601
-#define B_FS_BACKBUF 1602
-
-#define B_FS_FTYPE 1604 /* FTYPE is no more */
-#define B_DORENDER 1605
-#define B_DOANIM 1606
-#define B_PLAYANIM 1607
-#define B_PR_PAL 1608
-#define B_PR_FULL 1609
-#define B_PR_PRV 1610
-#define B_PR_HD 1611
-#define B_PR_PAL169 1612
-
-#define B_REDRAWDISP 1615
-#define B_SETBROWSE 1616
-#define B_CLEARSET 1617
-#define B_PR_PRESET 1618
-#define B_PR_PANO 1619
-#define B_PR_NTSC 1620
-
-#define B_IS_FTYPE 1622 /* FTYPE is nomore */
-#define B_IS_BACKBUF 1623
-#define B_PR_PC 1624
-
-#define B_PR_PANO360 1627
-#define B_PR_HALFFIELDS 1628
-#define B_NEWRENDERPIPE 1629
-#define B_R_SCALE 1630
-#define B_G_SCALE 1631
-#define B_B_SCALE 1632
-#define B_USE_R_SCALE 1633
-#define B_USE_G_SCALE 1634
-#define B_USE_B_SCALE 1635
-#define B_EDGECOLSLI 1636
-#define B_GAMMASLI 1637
-
-#define B_FILETYPEMENU 1638
-#define B_SELECTCODEC 1639
-#define B_RTCHANGED 1640
-#define B_SWITCHRENDER 1641
-#define B_FBUF_REDO 1642
-
-#define B_SET_EDGE 1643
-#define B_SET_ZBLUR 1644
-#define B_ADD_RENDERLAYER 1645
-#define B_SET_PASS 1646
-#define B_ADD_FFMPEG_VIDEO_OPTION 1647
-#define B_ADD_FFMPEG_AUDIO_OPTION 1648
-
-#define B_SEQ_BUT_PLUGIN 1691
-#define B_SEQ_BUT_RELOAD 1692
-#define B_SEQ_BUT_EFFECT 1693
-#define B_SEQ_BUT_RELOAD_ALL 1694
-#define B_SEQ_BUT_TRANSFORM 1695
-#define B_SEQ_BUT_RELOAD_FILE 1696
-#define B_SEQ_BUT_REBUILD_PROXY 1697
-#define B_SEQ_SEL_PROXY_DIR 1698
-/* *********************** */
-#define B_ARMATUREBUTS 1800
-#define B_POSE 1701
-
-/* *********************** */
-#define B_COMMONEDITBUTS 2049
-
-#define B_CHANGEDEP 2002
-#define B_MATWICH 2003
-#define B_MATNEW 2004
-#define B_MATDEL 2005
-#define B_MATASS 2006
-#define B_MATSEL 2007
-#define B_MATDESEL 2008
-#define B_HIDE 2009
-#define B_REVEAL 2010
-#define B_SELSWAP 2011
-#define B_SETSMOOTH 2012
-#define B_SETSOLID 2013
-#define B_AUTOTEX 2014
-#define B_DOCENTER 2015
-#define B_DOCENTERNEW 2016
-#define B_DOCENTERCURSOR 2017
-#define B_MATASS_BROWSE 2018
-
- /* 20 values! */
-#define B_OBLAY 2019
-
-#define B_ADDKEY 2041
-#define B_SETKEY 2042
-#define B_DELKEY 2043
-#define B_NAMEKEY 2044
-#define B_PREVKEY 2045
-#define B_NEXTKEY 2046
-#define B_LOCKKEY 2047
-#define B_MATCOL2 2048
-
-#define B_MESHBUTS 2090
-
-#define B_FLIPNORM 2050
-#define B_SPIN 2051
-#define B_SPINDUP 2052
-#define B_EXTR 2053
-#define B_SCREW 2054
-#define B_EXTREP 2055
-#define B_SPLIT 2056
-#define B_REMDOUB 2057
-#define B_SUBDIV 2058
-#define B_FRACSUBDIV 2059
-#define B_XSORT 2060
-#define B_HASH 2061
-#define B_MAKESTICKY 2062
-#define B_DELSTICKY 2063
-#define B_NEWMCOL 2064
-#define B_DELMCOL 2065
-#define B_TOSPHERE 2066
-#define B_DECIM_FACES 2067
-#define B_DECIM_CANCEL 2068
-#define B_DECIM_APPLY 2069
-/* B_SLOWERDRAW and B_FASTERDRAW removed */
-#define B_VERTEXNOISE 2072
-#define B_VERTEXSMOOTH 2073
-#define B_NEWTFACE 2074
-#define B_DELTFACE 2075
-#define B_CHROMADEPTH 2076
-#define B_DRAWEDGES 2077
-#define B_DRAWCREASES 2078
-#define B_SETTFACE 2079
-#define B_SETMCOL 2080
-#define B_JOINTRIA 2081
-#define B_SETTFACE_RND 2082
-#define B_SETMCOL_RND 2083
-#define B_DRAWBWEIGHTS 2084
-
-#define B_GEN_SKELETON 2085
-#define B_RETARGET_SKELETON 2086
-
-/* *********************** */
-#define B_VGROUPBUTS 2100
-
-#define B_NEWVGROUP 2091
-#define B_DELVGROUP 2092
-#define B_ASSIGNVGROUP 2093
-#define B_REMOVEVGROUP 2094
-#define B_SELVGROUP 2095
-#define B_DESELVGROUP 2096
-#define B_AUTOVGROUP 2097
-#define B_LINKEDVGROUP 2098
-#define B_COPYVGROUP 2099
-
-
-
-/* *********************** */
-#define B_CURVEBUTS 2200
-
-#define B_CONVERTPOLY 2101
-#define B_CONVERTBEZ 2102
-#define B_CONVERTBSPL 2103
-#define B_CONVERTCARD 2104
-#define B_CONVERTNURB 2105
-#define B_UNIFU 2106
-#define B_ENDPU 2107
-#define B_BEZU 2108
-#define B_UNIFV 2109
-#define B_ENDPV 2110
-#define B_BEZV 2111
-#define B_SETWEIGHT 2112
-#define B_SETW1 2113
-#define B_SETW2 2114
-#define B_SETW3 2115
-#define B_SETORDER 2116
-#define B_MAKEDISP 2117
-#define B_SUBDIVCURVE 2118
-#define B_SPINNURB 2119
-#define B_CU3D 2120
-#define B_SETRESOLU 2121
-#define B_SETW4 2122
-#define B_SUBSURFTYPE 2123
-#define B_TILTINTERP 2124
-#define B_SETPT_AUTO 2125
-#define B_SETPT_VECTOR 2126
-#define B_SETPT_ALIGN 2127
-#define B_SETPT_FREE 2128
-
-/* *********************** */
-#define B_FONTBUTS 2300
-
-#define B_MAKEFONT 2201
-#define B_TOUPPER 2202
-#define B_SETFONT 2203
-#define B_LOADFONT 2204
-#define B_TEXTONCURVE 2205
-#define B_PACKFONT 2206
-#define B_LOAD3DTEXT 2207
-#define B_LOREM 2208
-#define B_FASTFONT 2209
-#define B_INSTB 2210
-#define B_DELTB 2211
-#define B_STYLETOSELB 2212
-#define B_STYLETOSELU 2213
-#define B_STYLETOSELI 2214
-
-#define B_SETCHAR 2215
-#define B_SETUPCHAR 2216
-#define B_SETDOWNCHAR 2217
-#define B_SETCAT 2218
-#define B_SETUNITEXT 2219
-
-/* *********************** */
-#define B_ARMBUTS 2400
-
-#define B_ARM_RECALCDATA 2301
-#define B_ARM_STRIDE 2302
-#define B_ARM_CALCPATHS 2303
-#define B_ARM_CLEARPATHS 2304
-
-#define B_POSELIB_VALIDATE 2310
-#define B_POSELIB_ADDPOSE 2311
-#define B_POSELIB_REPLACEP 2312
-#define B_POSELIB_REMOVEP 2313
-#define B_POSELIB_APPLYP 2314
-
- /* these shouldn't be here... */
-#define B_POSELIB_BROWSE 2320
-#define B_POSELIB_ALONE 2321
-#define B_POSELIB_DELETE 2322
-
-
-#define B_POSEGRP_RECALC 2330
-#define B_POSEGRP_ADD 2331
-#define B_POSEGRP_REMOVE 2332
-#define B_POSEGRP_MCUSTOM 2333
-
-/* *********************** */
-#define B_CAMBUTS 2500
-
-/* *********************** */
-#define B_MBALLBUTS 2600
-
-#define B_RECALCMBALL 2501
-
-/* *********************** */
-#define B_LATTBUTS 2700
-
-#define B_RESIZELAT 2601
-#define B_DRAWLAT 2602
-#define B_LATTCHANGED 2603
-#define B_REGULARLAT 2604
-
-/* *********************** */
-#define B_GAMEBUTS 2800
-
-#define B_ADD_PROP 2701
-#define B_CHANGE_PROP 2702
-
-#define B_ADD_SENS 2703
-#define B_CHANGE_SENS 2704
-#define B_DEL_SENS 2705
-
-#define B_ADD_CONT 2706
-#define B_CHANGE_CONT 2707
-#define B_DEL_CONT 2708
-
-#define B_ADD_ACT 2709
-#define B_CHANGE_ACT 2710
-#define B_DEL_ACT 2711
-
-#define B_SOUNDACT_BROWSE 2712
-
-#define B_SETSECTOR 2713
-#define B_SETPROP 2714
-#define B_SETACTOR 2715
-#define B_SETMAINACTOR 2716
-#define B_SETDYNA 2717
-#define B_SET_STATE_BIT 2718
-#define B_INIT_STATE_BIT 2719
-
-/* *********************** */
-#define B_FPAINTBUTS 2900
-
-#define B_VPCOLSLI 2801
-#define B_VPGAMMA 2802
-#define B_COPY_TF_TRANSP 2803
-#define B_COPY_TF_MODE 2804
-#define B_COPY_TF_UV 2805
-#define B_COPY_TF_COL 2806
-#define B_REDR_3D_IMA 2807
-#define B_SET_VCOL 2808
-
-#define B_COPY_TF_TEX 2814
-#define B_TFACE_HALO 2815
-#define B_TFACE_BILLB 2816
-
-#define B_SHOWTEX 2832
-#define B_ASSIGNMESH 2833
-
-#define B_WEIGHT0_0 2840
-#define B_WEIGHT1_4 2841
-#define B_WEIGHT1_2 2842
-#define B_WEIGHT3_4 2843
-#define B_WEIGHT1_0 2844
-
-#define B_OPA1_8 2845
-#define B_OPA1_4 2846
-#define B_OPA1_2 2847
-#define B_OPA3_4 2848
-#define B_OPA1_0 2849
-
-#define B_CLR_WPAINT 2850
-
-#define B_BRUSHBROWSE 2851
-#define B_BRUSHDELETE 2852
-#define B_BRUSHLOCAL 2853
-#define B_BRUSHCHANGE 2854
-#define B_BTEXBROWSE 2855
-#define B_BTEXDELETE 2856
-#define B_BRUSHKEEPDATA 2857
-
-/* Sculptmode */
-#define B_SCULPT_TEXBROWSE 2860
-
-/* Particles */
-#define B_BAKE_OLENGTH 2870
-#define B_BAKE_APPLY_AV 2871
-#define B_BAKE_KEYTIME 2872
-#define B_BAKE_AV_CHANGE 2873
-#define B_BAKE_REDRAWEDIT 2874
-#define B_BAKE_RECACHE 2875
-
-/* *********************** */
-#define B_RADIOBUTS 3000
-
-#define B_RAD_GO 2901
-#define B_RAD_INIT 2902
-#define B_RAD_LIMITS 2903
-#define B_RAD_FAC 2904
-#define B_RAD_NODELIM 2905
-#define B_RAD_NODEFILT 2906
-#define B_RAD_FACEFILT 2907
-#define B_RAD_ADD 2908
-#define B_RAD_DELETE 2909
-#define B_RAD_COLLECT 2910
-#define B_RAD_SHOOTP 2911
-#define B_RAD_SHOOTE 2912
-#define B_RAD_REPLACE 2913
-#define B_RAD_DRAW 2914
-#define B_RAD_FREE 2915
-#define B_RAD_ADDMESH 2916
-
-/* *********************** */
-#define B_SCRIPTBUTS 3100
-
-#define B_SCRIPT_ADD 3001
-#define B_SCRIPT_DEL 3002
-#define B_SCRIPT_TYPE 3003
-
-/* Scene script buttons */
-#define B_SSCRIPT_ADD 3004
-#define B_SSCRIPT_DEL 3005
-#define B_SSCRIPT_TYPE 3006
-
-/* *********************** */
-#define B_SOUNDBUTS 3200
-enum B_SOUND_BUTTONS {
- B_SOUND_CHANGED = 3101,
- B_SOUND_REDRAW,
- B_SOUND_VOLUME,
- B_SOUND_PANNING,
- B_SOUND_PITCH,
- B_SOUND_LOAD_SAMPLE,
- B_SOUND_MENU_SAMPLE,
- B_SOUND_NAME_SAMPLE,
- B_SOUND_UNLINK_SAMPLE,
- B_SOUND_RELOAD_SAMPLE,
- B_SOUND_UNPACK_SAMPLE,
- B_SOUND_PLAY_SAMPLE,
- B_SOUND_COPY_SOUND,
- B_SOUND_LOOPSTART,
- B_SOUND_LOOPEND,
- B_SOUND_BIDIRECTIONAL,
- B_SOUND_RECALC,
- B_SOUND_RATECHANGED,
- B_SOUND_MIXDOWN
-};
-
-/* *********************** */
-#define B_CONSTRAINTBUTS 3300
-enum {
- B_CONSTRAINT_TEST = 3201,
- B_CONSTRAINT_CHANGETARGET,
- B_CONSTRAINT_ADD_NULL,
- B_CONSTRAINT_ADD_KINEMATIC,
- B_CONSTRAINT_ADD_TRACKTO,
- B_CONSTRAINT_ADD_MINMAX,
- B_CONSTRAINT_ADD_ROTLIKE,
- B_CONSTRAINT_ADD_LOCLIKE,
- B_CONSTRAINT_ADD_SIZELIKE,
- B_CONSTRAINT_ADD_ACTION,
- B_CONSTRAINT_ADD_LOCKTRACK,
- B_CONSTRAINT_ADD_FOLLOWPATH,
- B_CONSTRAINT_ADD_DISTLIMIT,
- B_CONSTRAINT_ADD_STRETCHTO,
- B_CONSTRAINT_ADD_LOCLIMIT,
- B_CONSTRAINT_ADD_ROTLIMIT,
- B_CONSTRAINT_ADD_SIZELIMIT,
- B_CONSTRAINT_ADD_RIGIDBODYJOINT,
- B_CONSTRAINT_ADD_CHILDOF,
- B_CONSTRAINT_ADD_PYTHON,
- B_CONSTRAINT_ADD_CLAMPTO,
- B_CONSTRAINT_ADD_TRANSFORM,
- B_CONSTRAINT_INF
-};
-
-/* *********************** */
-#define B_UVAUTOCALCBUTS 3400
-enum {
- B_UVAUTO_REDRAW = 3301,
- B_UVAUTO_SPHERE,
- B_UVAUTO_CYLINDER,
- B_UVAUTO_CYLRADIUS,
- B_UVAUTO_WINDOW,
- B_UVAUTO_CUBE,
- B_UVAUTO_CUBESIZE,
- B_UVAUTO_RESET,
- B_UVAUTO_BOUNDS,
- B_UVAUTO_TOP,
- B_UVAUTO_FACE,
- B_UVAUTO_OBJECT,
- B_UVAUTO_ALIGNX,
- B_UVAUTO_ALIGNY,
- B_UVAUTO_UNWRAP,
- B_UVAUTO_DRAWFACES
-};
-
-#define B_EFFECTSBUTS 3500
-
-#define B_AUTOTIMEOFS 3403 /* see B_OFSTIMEOFS, B_RANDTIMEOFS also */
-#define B_FRAMEMAP 3404
-#define B_PREVEFFECT 3406
-#define B_CHANGEEFFECT 3408
-#define B_RECALCAL 3411
-#define B_RECALC_DEFL 3412
-#define B_FIELD_DEP 3414
-#define B_FIELD_CHANGE 3415
-#define B_PARTBROWSE 3418
-#define B_PARTDELETE 3419
-#define B_PARTALONE 3420
-#define B_PARTLOCAL 3421
-#define B_PARTAUTONAME 3422
-#define B_PART_ALLOC 3423
-#define B_PART_DISTR 3424
-#define B_PART_INIT 3425
-#define B_PART_RECALC 3426
-#define B_PART_REDRAW 3427
-#define B_PARTTYPE 3428
-#define B_PARTACT 3429
-#define B_PARTTARGET 3430
-#define B_PART_ALLOC_CHILD 3431
-#define B_PART_DISTR_CHILD 3432
-#define B_PART_INIT_CHILD 3433
-#define B_PART_RECALC_CHILD 3434
-#define B_PART_EDITABLE 3435
-#define B_PART_REKEY 3436
-#define B_PART_ENABLE 3437
-#define B_OFSTIMEOFS 3438 /* see B_AUTOTIMEOFS too */
-#define B_RANDTIMEOFS 3439
-#define B_PART_REDRAW_DEPS 3440
-
-#define B_MODIFIER_BUTS 3600
-
-#define B_MODIFIER_RECALC 3501
-#define B_MODIFIER_REDRAW 3502
-
-/* *********************** */
-#define B_NODE_BUTS 4000
- /* 400 slots reserved, we want an exec event for each node */
-#define B_NODE_LOADIMAGE 3601
-#define B_NODE_SETIMAGE 3602
-#define B_NODE_TREE_EXEC 3603
-
-
- /* exec should be last in this list */
-#define B_NODE_EXEC 3610
-
-
-/* *********************** */
-/* BUTTON 4001-4032: layers? (sort this out!) */
-
-/* *********************** */
-/* event code 0x4000 (16384) and larger: general events (redraws, etc) */
-
-
-#endif
-
diff --git a/source/blender/include/editlattice_ext.h b/source/blender/include/editlattice_ext.h
deleted file mode 100644
index e4e07951ba6..00000000000
--- a/source/blender/include/editlattice_ext.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * editlattice_ext.h
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EDITLATTICE_EXT_H
-#define EDITLATTICE_EXT_H "$Id$"
-#define EDITLATTICE_EXT_H "Copyright (C) 2001 NaN Technologies B.V.
-
-void end_latt_deform(void);
-
-#endif /* EDITLATTICE_EXT_H */
-
diff --git a/source/blender/include/editmesh.h b/source/blender/include/editmesh.h
deleted file mode 100644
index 3855b8667dc..00000000000
--- a/source/blender/include/editmesh.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* Internal for editmesh_xxxx.c functions */
-
-#ifndef EDITMESH_H
-#define EDITMESH_H
-
-#define TEST_EDITMESH if(G.obedit==0) return; \
- if( (G.vd->lay & G.obedit->lay)==0 ) return;
-
-#define UVCOPY(t, s) memcpy(t, s, 2 * sizeof(float));
-
-
-
-/* ******************* editmesh.c */
-extern void free_editvert(EditVert *eve);
-extern void free_editedge(EditEdge *eed);
-extern void free_editface(EditFace *efa);
-
-extern void free_vertlist(ListBase *edve);
-extern void free_edgelist(ListBase *lb);
-extern void free_facelist(ListBase *lb);
-
-extern void remedge(EditEdge *eed);
-
-extern struct EditVert *addvertlist(float *vec, struct EditVert *example);
-extern struct EditEdge *addedgelist(struct EditVert *v1, struct EditVert *v2, struct EditEdge *example);
-extern struct EditFace *addfacelist(struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
-extern struct EditEdge *findedgelist(struct EditVert *v1, struct EditVert *v2);
-
-/* ******************* editmesh_add.c */
-
-
-/* ******************* editmesh_lib.c */
-extern void EM_fgon_flags(void);
-extern void EM_hide_reset(void);
-
-extern int faceselectedOR(EditFace *efa, int flag);
-extern int faceselectedAND(EditFace *efa, int flag);
-
-extern EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4);
-extern void flipface(EditFace *efa); // flips for normal direction
-extern int compareface(EditFace *vl1, EditFace *vl2);
-
-/* flag for selection bits, *nor will be filled with normal for extrusion constraint */
-/* return value defines if such normal was set */
-extern short extrudeflag_face_indiv(short flag, float *nor);
-extern short extrudeflag_verts_indiv(short flag, float *nor);
-extern short extrudeflag_edges_indiv(short flag, float *nor);
-extern short extrudeflag_vert(short flag, float *nor);
-extern short extrudeflag(short flag, float *nor);
-
-extern void adduplicateflag(int flag);
-extern void delfaceflag(int flag);
-
-extern void rotateflag(short flag, float *cent, float rotmat[][3]);
-extern void translateflag(short flag, float *vec);
-
-extern int convex(float *v1, float *v2, float *v3, float *v4);
-
-/* ******************* editmesh_mods.c */
-extern EditEdge *findnearestedge(int *dist);
-extern void EM_automerge(int update);
-
-/**
- * findnearestvert
- *
- * dist (in/out): minimal distance to the nearest and at the end, actual distance
- * sel: selection bias
- * if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts
- * if 0, unselected vertice are given the bias
- * strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
- */
-extern EditVert *findnearestvert(int *dist, short sel, short strict);
-
-/* ******************* editmesh_tools.c */
-
-
-#endif
-
diff --git a/source/blender/include/keyed_functions.h b/source/blender/include/keyed_functions.h
deleted file mode 100644
index d4a89865980..00000000000
--- a/source/blender/include/keyed_functions.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#define KEY_GETPTR(x) (g_ptrtab ? g_ptrtab[x] : 0)
-
-/* these are the defines for the keyed functions:
-
- #define key_func<n> <function name to be behind key>
-
- This function must be of type "int func(void*)"
-
- To prevent symbol table dumpers from retrieving certain key
- functions too easily, some of those functions have nonsense names.
-*/
-
-#define key_func1 key_return_true
-/* add the corresponding function pointer defines here.
- Example:
-
- #define key_func4 my_protected_function_name
- #define MY_PROTECTED_FUNCTION_PTR KEY_GETPTR(KEY_FUNC3)
-
- KEY_GETPTR(KEY_FUNC3) corresponds to the function pointer to function
- key_func3 after the python key code unscrambled the function pointer tables.
- Also add pointer initializations to these functions in
- license_key.c:init_ftable() if necessary.
-*/
-
-#define KEY_RETURN_TRUE KEY_GETPTR(KEY_FUNC1)
-
diff --git a/source/blender/include/multires.h b/source/blender/include/multires.h
deleted file mode 100644
index e4726c02d7e..00000000000
--- a/source/blender/include/multires.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef MULTIRES_H
-#define MULTIRES_H
-
-struct CustomData;
-struct EditMesh;
-struct Object;
-struct MDeformVert;
-struct Mesh;
-struct MultiresLevel;
-struct Multires;
-struct uiBlock;
-
-/* For canceling operations that don't work with multires on or on a non-base level */
-int multires_test();
-int multires_level1_test();
-
-void multires_draw_interface(struct uiBlock *block, unsigned short cx, unsigned short cy);
-
-void multires_make(void *ob, void *me);
-void multires_delete(void *ob, void *me);
-void multires_level_to_editmesh(struct Object *ob, struct Mesh *me, const int render);
-void multires_finish_mesh_update(struct Object *ob);
-void multires_subdivide(void *ob, void *me);
-void multires_del_lower(void *ob, void *me);
-void multires_del_higher(void *ob, void *me);
-void multires_set_level_cb(void *ob, void *me);
-void multires_edge_level_update_cb(void *ob, void *me);
-int multires_modifier_warning();
-
-#endif
diff --git a/source/blender/include/nla.h b/source/blender/include/nla.h
deleted file mode 100644
index af8949917ad..00000000000
--- a/source/blender/include/nla.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* nla.h May 2001
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Use this to turn experimental options on
- * or off with the #define flags. Please do not
- * put other includes, typdefs etc in this file.
- * ===========================================
- *
- * __NLA
- * This encompasses the new armature object, the
- * action datablock and the action window-type.
- *
- * __CON_IPO
- * Support for constraint ipo keys
- *
- * __NLA_ACTION_BY_MOTION_ACTUATOR
- * New action actuator playback type
- *
- * $Id$
- */
-
-#ifndef NLA_H
-#define NLA_H
-
-#define __NLA
-
-#define __CON_IPO // Not for Release: Not yet fully implemented
-//#define __NLA_ACTION_BY_MOTION_ACTUATOR // Not for release: Not yet fully implemented
-
-#endif
-
diff --git a/source/blender/include/objfnt.h b/source/blender/include/objfnt.h
deleted file mode 100644
index e57c5541568..00000000000
--- a/source/blender/include/objfnt.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $Id$
-*/
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
-#ifndef OBJFNTDEF
-#define OBJFNTDEF
-
-typedef struct chardesc {
- short movex, movey; /* advance */
- short llx, lly; /* bounding box */
- short urx, ury;
- short *data; /* char data */
- long datalen;
-} chardesc;
-
-typedef struct objfnt {
- struct objfnt *freeaddr; /* if freeaddr != 0, objfnt is one chunck */
- short type;
- short charmin, charmax;
- short my_nchars;
- short scale;
- chardesc *my_chars;
-} objfnt;
-
-#define OFMAGIC 0x93339333
-
-#define TM_TYPE 1
-#define PO_TYPE 2
-#define SP_TYPE 3
-
-/* ops for tmesh characters */
-
-#define TM_BGNTMESH (1)
-#define TM_SWAPTMESH (2)
-#define TM_ENDBGNTMESH (3)
-#define TM_RETENDTMESH (4)
-#define TM_RET (5)
-
-/* ops for poly characters */
-
-#define PO_BGNLOOP (1)
-#define PO_ENDBGNLOOP (2)
-#define PO_RETENDLOOP (3)
-#define PO_RET (4)
-
-/* ops for spline characters */
-
-#define SP_MOVETO (1)
-#define SP_LINETO (2)
-#define SP_CURVETO (3)
-#define SP_CLOSEPATH (4)
-#define SP_RETCLOSEPATH (5)
-#define SP_RET (6)
-
-
-#define MIN_ASCII ' '
-#define MAX_ASCII '~'
-#define NASCII (256 - 32)
-
-#define NOBBOX (30000)
-
-typedef struct pschar {
- char *name;
- int code;
- int prog;
-} pschar;
-
-extern pschar charlist[NASCII];
-
-/* objfnt *fontname(void); */
-/* objfnt *readobjfnt(void); */
-/* objfnt *newobjfnt(void); */
-/* float fontstringwidth(void); */
-/* short *getcharprog(void); */
-/* chardesc *BLI_getchardesc(void); */
-/* char *asciiname(void); */
-
-#endif
-
diff --git a/source/blender/include/reeb.h b/source/blender/include/reeb.h
deleted file mode 100644
index 57f7d1b60cf..00000000000
--- a/source/blender/include/reeb.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef REEB_H_
-#define REEB_H_
-
-//#define WITH_BF_REEB
-
-#include "DNA_listBase.h"
-
-#include "BLI_graph.h"
-
-struct GHash;
-struct EdgeHash;
-struct ReebArc;
-struct ReebEdge;
-struct ReebNode;
-
-typedef struct ReebGraph {
- ListBase arcs;
- ListBase nodes;
-
- float length;
-
- FreeArc free_arc;
- FreeNode free_node;
- RadialSymmetry radial_symmetry;
- AxialSymmetry axial_symmetry;
- /*********************************/
-
- int resolution;
- int totnodes;
- struct EdgeHash *emap;
- int multi_level;
- struct ReebGraph *link_up; /* for multi resolution filtering, points to higher levels */
-} ReebGraph;
-
-typedef struct EmbedBucket {
- float val;
- int nv;
- float p[3];
-} EmbedBucket;
-
-typedef struct ReebNode {
- void *next, *prev;
- float p[3];
- int flag;
-
- int degree;
- struct ReebArc **arcs;
-
- int subgraph_index;
-
- int symmetry_level;
- int symmetry_flag;
- float symmetry_axis[3];
- /*********************************/
-
- int index;
- float weight;
- int multi_level;
- struct ReebNode *link_down; /* for multi resolution filtering, points to lower levels, if present */
- struct ReebNode *link_up;
-} ReebNode;
-
-typedef struct ReebEdge {
- struct ReebEdge *next, *prev;
- struct ReebArc *arc;
- struct ReebNode *v1, *v2;
- struct ReebEdge *nextEdge;
- int flag;
-} ReebEdge;
-
-typedef struct ReebArc {
- void *next, *prev;
- struct ReebNode *head, *tail;
- int flag;
-
- float length;
-
- int symmetry_level;
- int symmetry_group;
- int symmetry_flag;
- /*********************************/
-
- ListBase edges;
- int bcount;
- struct EmbedBucket *buckets;
-
- struct GHash *faces;
- float angle;
- struct ReebArc *link_up; /* for multi resolution filtering, points to higher levels */
-} ReebArc;
-
-typedef struct ReebArcIterator {
- struct ReebArc *arc;
- int index;
- int start;
- int end;
- int stride;
- int length;
-} ReebArcIterator;
-
-struct EditMesh;
-struct EdgeIndex;
-
-int weightToHarmonic(struct EditMesh *em, struct EdgeIndex *indexed_edges);
-int weightFromDistance(struct EditMesh *em, struct EdgeIndex *indexed_edges);
-int weightFromLoc(struct EditMesh *me, int axis);
-void weightToVCol(struct EditMesh *em, int index);
-void arcToVCol(struct ReebGraph *rg, struct EditMesh *em, int index);
-void angleToVCol(struct EditMesh *em, int index);
-void renormalizeWeight(struct EditMesh *em, float newmax);
-
-ReebGraph * generateReebGraph(struct EditMesh *me, int subdivisions);
-ReebGraph * newReebGraph();
-
-void initArcIterator(struct ReebArcIterator *iter, struct ReebArc *arc, struct ReebNode *head);
-void initArcIterator2(struct ReebArcIterator *iter, struct ReebArc *arc, int start, int end);
-void initArcIteratorStart(struct ReebArcIterator *iter, struct ReebArc *arc, struct ReebNode *head, int start);
-struct EmbedBucket * nextBucket(struct ReebArcIterator *iter);
-struct EmbedBucket * nextNBucket(ReebArcIterator *iter, int n);
-struct EmbedBucket * peekBucket(ReebArcIterator *iter, int n);
-struct EmbedBucket * currentBucket(struct ReebArcIterator *iter);
-struct EmbedBucket * previousBucket(struct ReebArcIterator *iter);
-int iteratorStopped(struct ReebArcIterator *iter);
-
-/* Filtering */
-void filterNullReebGraph(ReebGraph *rg);
-int filterSmartReebGraph(ReebGraph *rg, float threshold);
-int filterExternalReebGraph(ReebGraph *rg, float threshold);
-int filterInternalReebGraph(ReebGraph *rg, float threshold);
-
-/* Post-Build processing */
-void repositionNodes(ReebGraph *rg);
-void postprocessGraph(ReebGraph *rg, char mode);
-void removeNormalNodes(ReebGraph *rg);
-
-void sortNodes(ReebGraph *rg);
-void sortArcs(ReebGraph *rg);
-
-/*------------ Sanity check ------------*/
-void verifyBuckets(ReebGraph *rg);
-void verifyFaces(ReebGraph *rg);
-
-/*********************** PUBLIC *********************************/
-
-#define REEB_MAX_MULTI_LEVEL 10
-
-ReebGraph *BIF_ReebGraphFromEditMesh(void);
-ReebGraph *BIF_ReebGraphMultiFromEditMesh(void);
-void BIF_flagMultiArcs(ReebGraph *rg, int flag);
-
-void BIF_GlobalReebGraphFromEditMesh(void);
-void BIF_GlobalReebFree(void);
-
-ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node);
-ReebNode *BIF_NodeFromIndex(ReebArc *arc, ReebNode *node);
-ReebNode *BIF_lowestLevelNode(ReebNode *node);
-
-ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node);
-
-void REEB_freeGraph(ReebGraph *rg);
-void REEB_exportGraph(ReebGraph *rg, int count);
-void REEB_draw();
-
-
-#endif /*REEB_H_*/
diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h
deleted file mode 100644
index bd91bf8100a..00000000000
--- a/source/blender/include/transform.h
+++ /dev/null
@@ -1,548 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef TRANSFORM_H
-#define TRANSFORM_H
-
-#include "BIF_transform.h"
-
-/* ************************** Types ***************************** */
-
-struct TransInfo;
-struct TransData;
-struct TransSnap;
-struct NumInput;
-struct Object;
-struct View3D;
-struct ScrArea;
-struct bPose;
-struct bConstraint;
-struct BezTriple;
-
-typedef struct NDofInput {
- int flag;
- int axis;
- float fval[7];
- float factor[3];
-} NDofInput;
-
-typedef struct NumInput {
- short idx;
- short idx_max;
- short flag; /* Different flags to indicate different behaviors */
- float val[3]; /* Direct value of the input */
- int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
-} NumInput ;
-
-/*
- The ctrl value has different meaning:
- 0 : No value has been typed
-
- otherwise, |value| - 1 is where the cursor is located after the period
- Positive : number is positive
- Negative : number is negative
-*/
-
-typedef struct TransSnap {
- short modePoint;
- short modeTarget;
- int status;
- float snapPoint[3];
- float snapTarget[3];
- float snapNormal[3];
- float snapTangent[3];
- float dist; // Distance from snapPoint to snapTarget
- double last;
- void (*applySnap)(struct TransInfo *, float *);
- void (*calcSnap)(struct TransInfo *, float *);
- void (*targetSnap)(struct TransInfo *);
- float (*distance)(struct TransInfo *, float p1[3], float p2[3]); // Get the transform distance between two points (used by Closest snap)
-} TransSnap;
-
-typedef struct TransCon {
- char text[50]; /* Description of the Constraint for header_print */
- float mtx[3][3]; /* Matrix of the Constraint space */
- float imtx[3][3]; /* Inverse Matrix of the Constraint space */
- float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
- float center[3]; /* transformation center to define where to draw the view widget
- ALWAYS in global space. Unlike the transformation center */
- short imval[2]; /* initial mouse value for visual calculation */
- /* the one in TransInfo is not garanty to stay the same (Rotates change it) */
- int mode; /* Mode flags of the Constraint */
- void (*drawExtra)(struct TransInfo *);
- /* For constraints that needs to draw differently from the other
- uses this instead of the generic draw function */
- void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
- /* Apply function pointer for linear vectorial transformation */
- /* The last three parameters are pointers to the in/out/printable vectors */
- void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
- /* Apply function pointer for size transformation */
- void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
- /* Apply function pointer for rotation transformation */
-} TransCon;
-
-typedef struct TransDataIpokey {
- int flag; /* which keys */
- float *locx, *locy, *locz; /* channel pointers */
- float *rotx, *roty, *rotz;
- float *quatx, *quaty, *quatz, *quatw;
- float *sizex, *sizey, *sizez;
- float oldloc[9]; /* storage old values */
- float oldrot[9];
- float oldsize[9];
- float oldquat[12];
-} TransDataIpokey;
-
-typedef struct TransDataExtension {
- float drot[3]; /* Initial object drot */
- float dsize[3]; /* Initial object dsize */
- float *rot; /* Rotation of the data to transform (Faculative) */
- float irot[3]; /* Initial rotation */
- float *quat; /* Rotation quaternion of the data to transform (Faculative) */
- float iquat[4]; /* Initial rotation quaternion */
- float *size; /* Size of the data to transform (Faculative) */
- float isize[3]; /* Initial size */
- float obmat[4][4]; /* Object matrix */
-} TransDataExtension;
-
-typedef struct TransData2D {
- float loc[3]; /* Location of data used to transform (x,y,0) */
- float *loc2d; /* Pointer to real 2d location of data */
-} TransData2D;
-
-/* we need to store 2 handles for each transdata incase the other handle wasnt selected */
-typedef struct TransDataCurveHandleFlags {
- short ih1, ih2;
- short *h1, *h2;
-} TransDataCurveHandleFlags;
-
-
-typedef struct TransData {
- float dist; /* Distance needed to affect element (for Proportionnal Editing) */
- float rdist; /* Distance to the nearest element (for Proportionnal Editing) */
- float factor; /* Factor of the transformation (for Proportionnal Editing) */
- float *loc; /* Location of the data to transform */
- float iloc[3]; /* Initial location */
- float *val; /* Value pointer for special transforms */
- float ival; /* Old value*/
- float center[3]; /* Individual data center */
- float mtx[3][3]; /* Transformation matrix from data space to global space */
- float smtx[3][3]; /* Transformation matrix from global space to data space */
- float axismtx[3][3];/* Axis orientation matrix of the data */
- struct Object *ob;
- struct bConstraint *con; /* for objects/bones, the first constraint in its constraint stack */
- TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */
- TransDataIpokey *tdi; /* for objects, ipo keys. per transdata a malloc */
- TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */
- void *tdmir; /* mirrored element pointer, in editmode mesh to EditVert */
- short flag; /* Various flags */
- short protectflag; /* If set, copy of Object or PoseChannel protection */
-/*#ifdef WITH_VERSE*/
- void *verse; /* pointer at verse data struct (VerseVert, etc.) */
-/*#endif*/
-} TransData;
-
-typedef struct TransInfo {
- int mode; /* current mode */
- int flag; /* generic flags for special behaviors */
- short state; /* current state (running, canceled,...)*/
- int context; /* current context */
- float val; /* init value for some transformations (and rotation angle) */
- float fac; /* factor for distance based transform */
- int (*transform)(struct TransInfo *, short *);
- /* transform function pointer */
- int (*handleEvent)(struct TransInfo *, unsigned short event, short val);
- /* event handler function pointer RETURN 1 if redraw is needed */
- int total; /* total number of transformed data */
- TransData *data; /* transformed data (array) */
- TransDataExtension *ext; /* transformed data extension (array) */
- TransData2D *data2d; /* transformed data for 2d (array) */
- TransCon con; /* transformed constraint */
- TransSnap tsnap;
- NumInput num; /* numerical input */
- NDofInput ndof; /* ndof input */
- char redraw; /* redraw flag */
- float propsize; /* proportional circle radius */
- char proptext[20]; /* proportional falloff text */
- float center[3]; /* center of transformation */
- int center2d[2]; /* center in screen coordinates */
- short imval[2]; /* initial mouse position */
- short shiftmval[2]; /* mouse position when shift was pressed */
- short idx_max; /* maximum index on the input vector */
- float snap[3]; /* Snapping Gears */
-
- float viewmat[4][4]; /* copy from G.vd, prevents feedback, */
- float viewinv[4][4]; /* and to make sure we don't have to */
- float persmat[4][4]; /* access G.vd from other space types */
- float persinv[4][4];
- short persp;
- short around;
- char spacetype; /* spacetype where transforming is */
-
- float vec[3]; /* translation, to show for widget */
- float mat[3][3]; /* rot/rescale, to show for widget */
-
- char *undostr; /* if set, uses this string for undo */
- float spacemtx[3][3]; /* orientation matrix of the current space */
- char spacename[32]; /* name of the current space */
-
- struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */
-
- void *customData; /* Per Transform custom data */
-} TransInfo;
-
-
-/* ******************** Macros & Prototypes *********************** */
-
-/* NUMINPUT FLAGS */
-#define NUM_NULL_ONE 2
-#define NUM_NO_NEGATIVE 4
-#define NUM_NO_ZERO 8
-#define NUM_NO_FRACTION 16
-#define NUM_AFFECT_ALL 32
-
-/* NDOFINPUT FLAGS */
-#define NDOF_INIT 1
-
-/* transinfo->state */
-#define TRANS_RUNNING 0
-#define TRANS_CONFIRM 1
-#define TRANS_CANCEL 2
-
-/* transinfo->flag */
-#define T_OBJECT (1 << 0)
-#define T_EDIT (1 << 1)
-#define T_POSE (1 << 2)
-#define T_TEXTURE (1 << 3)
-#define T_CAMERA (1 << 4)
- // when shift pressed, higher resolution transform. cannot rely on G.qual, need event!
-#define T_SHIFT_MOD (1 << 5)
- // trans on points, having no rotation/scale
-#define T_POINTS (1 << 6)
- // for manipulator exceptions, like scaling using center point, drawing help lines
-#define T_USES_MANIPULATOR (1 << 7)
-
- /* restrictions flags */
-#define T_ALL_RESTRICTIONS ((1 << 8)|(1 << 9)|(1 << 10))
-#define T_NO_CONSTRAINT (1 << 8)
-#define T_NULL_ONE (1 << 9)
-#define T_NO_ZERO (1 << 10)
-
-#define T_PROP_EDIT (1 << 11)
-#define T_PROP_CONNECTED (1 << 12)
-
- /* if MMB is pressed or not */
-#define T_MMB_PRESSED (1 << 13)
-
-#define T_V3D_ALIGN (1 << 14)
- /* for 2d views like uv or ipo */
-#define T_2D_EDIT (1 << 15)
-#define T_CLIP_UV (1 << 16)
-
-#define T_FREE_CUSTOMDATA (1 << 17)
- /* auto-ik is on */
-#define T_AUTOIK (1 << 18)
-
-/* ******************************************************************************** */
-
-/* transinfo->con->mode */
-#define CON_APPLY 1
-#define CON_AXIS0 2
-#define CON_AXIS1 4
-#define CON_AXIS2 8
-#define CON_SELECT 16
-#define CON_NOFLIP 32 /* does not reorient vector to face viewport when on */
-#define CON_LOCAL 64
-#define CON_USER 128
-
-/* transdata->flag */
-#define TD_SELECTED 1
-#define TD_ACTIVE (1 << 1)
-#define TD_NOACTION (1 << 2)
-#define TD_USEQUAT (1 << 3)
-#define TD_NOTCONNECTED (1 << 4)
-#define TD_SINGLESIZE (1 << 5) /* used for scaling of MetaElem->rad */
-#ifdef WITH_VERSE
- #define TD_VERSE_OBJECT (1 << 6)
- #define TD_VERSE_VERT (1 << 7)
-#endif
-#define TD_TIMEONLY (1 << 8)
-#define TD_NOCENTER (1 << 9)
-#define TD_NO_EXT (1 << 10) /* ext abused for particle key timing */
-#define TD_SKIP (1 << 11) /* don't transform this data */
-#define TD_BEZTRIPLE (1 << 12) /* if this is a bez triple, we need to restore the handles, if this is set transdata->misc.hdata needs freeing */
-#define TD_NO_LOC (1 << 13) /* when this is set, don't apply translation changes to this element */
-
-/* transsnap->status */
-#define SNAP_ON 1
-#define TARGET_INIT 2
-#define POINT_INIT 4
-
-/* transsnap->modePoint */
-#define SNAP_GRID 0
-#define SNAP_GEO 1
-
-/* transsnap->modeTarget */
-#define SNAP_CLOSEST 0
-#define SNAP_CENTER 1
-#define SNAP_MEDIAN 2
-#define SNAP_ACTIVE 3
-
-void checkFirstTime(void);
-
-void setTransformViewMatrices(TransInfo *t);
-void convertViewVec(TransInfo *t, float *vec, short dx, short dy);
-void projectIntView(TransInfo *t, float *vec, int *adr);
-void projectFloatView(TransInfo *t, float *vec, float *adr);
-
-void convertVecToDisplayNum(float *vec, float *num);
-void convertDisplayNumToVec(float *num, float *vec);
-
-void initWarp(TransInfo *t);
-int handleEventWarp(TransInfo *t, unsigned short event, short val);
-int Warp(TransInfo *t, short mval[2]);
-
-void initShear(TransInfo *t);
-int handleEventShear(TransInfo *t, unsigned short evenl, short val);
-int Shear(TransInfo *t, short mval[2]);
-
-void initResize(TransInfo *t);
-int Resize(TransInfo *t, short mval[2]);
-
-void initTranslation(TransInfo *t);
-int Translation(TransInfo *t, short mval[2]);
-
-void initToSphere(TransInfo *t);
-int ToSphere(TransInfo *t, short mval[2]);
-
-void initRotation(TransInfo *t);
-int Rotation(TransInfo *t, short mval[2]);
-
-void initShrinkFatten(TransInfo *t);
-int ShrinkFatten(TransInfo *t, short mval[2]);
-
-void initTilt(TransInfo *t);
-int Tilt(TransInfo *t, short mval[2]);
-
-void initCurveShrinkFatten(TransInfo *t);
-int CurveShrinkFatten(TransInfo *t, short mval[2]);
-
-void initTrackball(TransInfo *t);
-int Trackball(TransInfo *t, short mval[2]);
-
-void initPushPull(TransInfo *t);
-int PushPull(TransInfo *t, short mval[2]);
-
-void initBevel(TransInfo *t);
-int handleEventBevel(TransInfo *t, unsigned short evenl, short val);
-int Bevel(TransInfo *t, short mval[2]);
-
-void initBevelWeight(TransInfo *t);
-int BevelWeight(TransInfo *t, short mval[2]);
-
-void initCrease(TransInfo *t);
-int Crease(TransInfo *t, short mval[2]);
-
-void initBoneSize(TransInfo *t);
-int BoneSize(TransInfo *t, short mval[2]);
-
-void initBoneEnvelope(TransInfo *t);
-int BoneEnvelope(TransInfo *t, short mval[2]);
-
-void initBoneRoll(TransInfo *t);
-int BoneRoll(TransInfo *t, short mval[2]);
-
-void initTimeTranslate(TransInfo *t);
-int TimeTranslate(TransInfo *t, short mval[2]);
-
-void initTimeSlide(TransInfo *t);
-int TimeSlide(TransInfo *t, short mval[2]);
-
-void initTimeScale(TransInfo *t);
-int TimeScale(TransInfo *t, short mval[2]);
-
-void initBakeTime(TransInfo *t);
-int BakeTime(TransInfo *t, short mval[2]);
-
-void initMirror(TransInfo *t);
-int Mirror(TransInfo *t, short mval[2]);
-
-void initAlign(TransInfo *t);
-int Align(TransInfo *t, short mval[2]);
-
-/*********************** transform_conversions.c ********** */
-struct ListBase;
-void flushTransGPactionData(TransInfo *t);
-void flushTransIpoData(TransInfo *t);
-void flushTransUVs(TransInfo *t);
-void flushTransParticles(TransInfo *t);
-int clipUVTransform(TransInfo *t, float *vec, int resize);
-
-/*********************** exported from transform_manipulator.c ********** */
-void draw_manipulator_ext(struct ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3]);
-int calc_manipulator_stats(struct ScrArea *sa);
-float get_drawsize(struct View3D *v3d, float *co);
-
-/*********************** TransData Creation and General Handling *********** */
-void createTransData(TransInfo *t);
-void sort_trans_data_dist(TransInfo *t);
-void add_tdi_poin(float *poin, float *old, float delta);
-void special_aftertrans_update(TransInfo *t);
-
-void transform_autoik_update(TransInfo *t, short mode);
-
-/* auto-keying stuff used by special_aftertrans_update */
-short autokeyframe_cfra_can_key(struct Object *ob);
-void autokeyframe_ob_cb_func(struct Object *ob, int tmode);
-void autokeyframe_pose_cb_func(struct Object *ob, int tmode, short targetless_ik);
-
-/*********************** Constraints *****************************/
-
-void getConstraintMatrix(TransInfo *t);
-void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]);
-void setLocalConstraint(TransInfo *t, int mode, const char text[]);
-void setUserConstraint(TransInfo *t, int mode, const char text[]);
-
-void constraintNumInput(TransInfo *t, float vec[3]);
-
-void getConstraintMatrix(TransInfo *t);
-int isLockConstraint(TransInfo *t);
-int getConstraintSpaceDimension(TransInfo *t);
-char constraintModeToChar(TransInfo *t);
-
-void startConstraint(TransInfo *t);
-void stopConstraint(TransInfo *t);
-
-void initSelectConstraint(TransInfo *t, float mtx[3][3]);
-void selectConstraint(TransInfo *t);
-void postSelectConstraint(TransInfo *t);
-
-void setNearestAxis(TransInfo *t);
-
-/*********************** Snapping ********************************/
-
-typedef enum {
- NO_GEARS = 0,
- BIG_GEARS = 1,
- SMALL_GEARS = 2
-} GearsType;
-
-void snapGrid(TransInfo *t, float *val);
-void snapGridAction(TransInfo *t, float *val, GearsType action);
-
-void initSnapping(struct TransInfo *t);
-void applySnapping(TransInfo *t, float *vec);
-void resetSnapping(TransInfo *t);
-int handleSnapping(TransInfo *t, int event);
-void drawSnapping(TransInfo *t);
-int usingSnappingNormal(TransInfo *t);
-int validSnappingNormal(TransInfo *t);
-
-/*********************** Generics ********************************/
-
-void initTrans(TransInfo *t);
-void postTrans (TransInfo *t);
-
-void drawLine(float *center, float *dir, char axis, short options);
-
-TransDataCurveHandleFlags *initTransDataCurveHandes(TransData *td, struct BezTriple *bezt);
-
-/* DRAWLINE options flags */
-#define DRAWLIGHT 1
-#define DRAWDASHED 2
-#define DRAWBOLD 4
-
-void applyTransObjects(TransInfo *t);
-void restoreTransObjects(TransInfo *t);
-void recalcData(TransInfo *t);
-
-void calculateCenter(TransInfo *t);
-void calculateCenter2D(TransInfo *t);
-void calculateCenterBound(TransInfo *t);
-void calculateCenterMedian(TransInfo *t);
-void calculateCenterCursor(TransInfo *t);
-
-void calculateCenterCursor2D(TransInfo *t);
-void calculatePropRatio(TransInfo *t);
-
-void getViewVector(float coord[3], float vec[3]);
-void getViewRay(short mval[2], float p[3], float d[3]);
-
-TransInfo * BIF_GetTransInfo(void);
-
-/*********************** NumInput ********************************/
-
-void initNumInput(NumInput *n);
-void outputNumInput(NumInput *n, char *str);
-short hasNumInput(NumInput *n);
-void applyNumInput(NumInput *n, float *vec);
-char handleNumInput(NumInput *n, unsigned short event);
-
-/*********************** NDofInput ********************************/
-
-void initNDofInput(NDofInput *n);
-int hasNDofInput(NDofInput *n);
-void applyNDofInput(NDofInput *n, float *vec);
-int handleNDofInput(NDofInput *n, unsigned short event, short val);
-
-/* handleNDofInput return values */
-#define NDOF_REFRESH 1
-#define NDOF_NOMOVE 2
-#define NDOF_CONFIRM 3
-#define NDOF_CANCEL 4
-
-
-/*********************** TransSpace ******************************/
-
-int manageObjectSpace(int confirm, int set);
-int manageMeshSpace(int confirm, int set);
-int manageBoneSpace(int confirm, int set);
-
-/* Those two fill in mat and return non-zero on success */
-int createSpaceNormal(float mat[3][3], float normal[3]);
-int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]);
-
-int addMatrixSpace(float mat[3][3], char name[]);
-int addObjectSpace(struct Object *ob);
-void applyTransformOrientation(void);
-
-
-#define ORIENTATION_NONE 0
-#define ORIENTATION_NORMAL 1
-#define ORIENTATION_VERT 2
-#define ORIENTATION_EDGE 3
-#define ORIENTATION_FACE 4
-
-int getTransformOrientation(float normal[3], float plane[3], int activeOnly);
-int createSpaceNormal(float mat[3][3], float normal[3]);
-int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]);
-
-#endif
-
-
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 3054e038ba2..3ad2ae48d53 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -51,9 +51,9 @@ typedef struct IDPropertyData {
typedef struct IDProperty {
struct IDProperty *next, *prev;
- char name[32];
char type, subtype;
short flag;
+ char name[32];
int saved; /*saved is used to indicate if this struct has been saved yet.
seemed like a good idea as a pad var was needed anyway :)*/
IDPropertyData data; /* note, alignment for 64 bits */
@@ -69,17 +69,18 @@ typedef struct IDProperty {
#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
/*->type*/
-#define IDP_STRING 0
-#define IDP_INT 1
-#define IDP_FLOAT 2
-#define IDP_ARRAY 5
-#define IDP_GROUP 6
-/*the ID link property type hasn't been implemented yet, this will require
- some cleanup of blenkernel, most likely.*/
-#define IDP_ID 7
-#define IDP_DOUBLE 8
-
-/*add any future new id property types here.*/
+#define IDP_STRING 0
+#define IDP_INT 1
+#define IDP_FLOAT 2
+#define IDP_ARRAY 5
+#define IDP_GROUP 6
+/* the ID link property type hasn't been implemented yet, this will require
+ some cleanup of blenkernel, most likely.*/
+#define IDP_ID 7
+#define IDP_DOUBLE 8
+#define IDP_NUMTYPES 9
+
+/* add any future new id property types here.*/
/* watch it: Sequence has identical beginning. */
/**
@@ -87,6 +88,8 @@ typedef struct IDProperty {
* provides a common handle to place all data in double-linked lists.
* */
+#define MAX_ID_NAME 24
+
/* There's a nasty circular dependency here.... void* to the rescue! I
* really wonder why this is needed. */
typedef struct ID {
@@ -171,6 +174,7 @@ typedef struct PreviewImage {
#define ID_KE MAKE_ID2('K', 'E')
#define ID_WO MAKE_ID2('W', 'O')
#define ID_SCR MAKE_ID2('S', 'R')
+#define ID_SCRN MAKE_ID2('S', 'N')
#define ID_VF MAKE_ID2('V', 'F')
#define ID_TXT MAKE_ID2('T', 'X')
#define ID_SO MAKE_ID2('S', 'O')
@@ -182,6 +186,7 @@ typedef struct PreviewImage {
#define ID_NT MAKE_ID2('N', 'T')
#define ID_BR MAKE_ID2('B', 'R')
#define ID_PA MAKE_ID2('P', 'A')
+#define ID_WM MAKE_ID2('W', 'M')
/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
#define ID_SEQ MAKE_ID2('S', 'Q')
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 4a10ecf2368..73a20512470 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -175,6 +175,7 @@ typedef struct bAction {
/* Action Editor Space. This is defined here instead of in DNA_space_types.h */
typedef struct SpaceAction {
struct SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
struct ScrArea *area;
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 6c098e220bb..e6b18641d2a 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -37,6 +37,8 @@ typedef struct CustomDataLayer {
int flag; /* general purpose flag */
int active; /* number of the active layer of this type */
int active_rnd; /* number of the layer to render*/
+ int active_clone; /* number of the layer to render*/
+ int active_mask; /* number of the layer to render*/
char pad[4];
char name[32]; /* layer name */
void *data; /* layer data */
diff --git a/source/blender/makesdna/DNA_documentation.h b/source/blender/makesdna/DNA_documentation.h
index b0b3646aed5..f8aa8ae5b2a 100644
--- a/source/blender/makesdna/DNA_documentation.h
+++ b/source/blender/makesdna/DNA_documentation.h
@@ -65,7 +65,7 @@
/* PLEASE READ INSTRUCTIONS ABOUT ADDING VARIABLES IN 'DNA' STRUCTS IN
- ../blenloader/intern/genfile.c
+ intern/dna_genfile.c
(ton)
*/
diff --git a/source/blender/blenloader/intern/genfile.h b/source/blender/makesdna/DNA_genfile.h
index 81475252c46..4b9401bf4b9 100644
--- a/source/blender/blenloader/intern/genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -33,14 +33,20 @@
struct SDNA;
-int dna_findstruct_nr(struct SDNA *sdna, char *str);
-char *dna_get_structDNA_compareflags(struct SDNA *sdna, struct SDNA *newsdna);
-void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data);
-void *dna_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data);
-int dna_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name);
+extern unsigned char DNAstr[]; /* DNA.c */
+extern int DNAlen;
-struct SDNA *dna_sdna_from_data(void *data, int datalen, int do_endian_swap);
-void dna_freestructDNA(struct SDNA *sdna);
+struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap);
+void DNA_sdna_free(struct SDNA *sdna);
+
+int DNA_struct_find_nr(struct SDNA *sdna, const char *str);
+void DNA_struct_switch_endian(struct SDNA *oldsdna, int oldSDNAnr, char *data);
+char *DNA_struct_get_compareflags(struct SDNA *sdna, struct SDNA *newsdna);
+void *DNA_struct_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data);
+
+int DNA_elem_array_size(const char *astr, int len);
+int DNA_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name);
#endif
+
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index aa847050581..d2bb93162d0 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -41,7 +41,6 @@
struct MTex;
struct Ipo;
-struct Material;
struct ColorBand;
struct Group;
struct bNodeTree;
@@ -97,7 +96,9 @@ typedef struct Material {
/* shaders */
short diff_shader, spec_shader;
float roughness, refrac;
- float param[4]; /* size, smooth, size, smooth, for toonshader */
+ /* XXX param[4] needs review and improvement (shader system as whole anyway)
+ This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
+ float param[4]; /* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
float rms;
float darkness;
short texco, mapto;
diff --git a/source/blender/makesdna/DNA_packedFile_types.h b/source/blender/makesdna/DNA_packedFile_types.h
index 2c965c92849..f11c51692e1 100644
--- a/source/blender/makesdna/DNA_packedFile_types.h
+++ b/source/blender/makesdna/DNA_packedFile_types.h
@@ -36,8 +36,6 @@
typedef struct PackedFile {
int size;
int seek;
- int flags;
- int pad;
void * data;
} PackedFile;
@@ -60,3 +58,4 @@ enum PF_FileStatus
#endif /* PACKEDFILE_TYPES_H */
+
diff --git a/source/blender/makesdna/DNA_radio_types.h b/source/blender/makesdna/DNA_radio_types.h
index e757024603b..4219bf59b93 100644
--- a/source/blender/makesdna/DNA_radio_types.h
+++ b/source/blender/makesdna/DNA_radio_types.h
@@ -46,5 +46,17 @@ typedef struct Radio {
} Radio;
+
+/* **************** RADIOSITY ********************* */
+
+/* draw type */
+#define RAD_WIREFRAME 0
+#define RAD_SOLID 1
+#define RAD_GOURAUD 2
+
+/* flag */
+#define RAD_SHOWLIMITS 1
+#define RAD_SHOWZ 2
+
#endif
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index c1c164f136f..859b3abd7e2 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -37,7 +37,6 @@ extern "C" {
#include "DNA_listBase.h"
#include "DNA_scriptlink_types.h"
#include "DNA_ID.h"
-#include "DNA_scriptlink_types.h"
struct Radio;
struct Object;
@@ -345,7 +344,9 @@ typedef struct TimeMarker {
typedef struct ImagePaintSettings {
struct Brush *brush;
short flag, tool;
- int pad3;
+
+ /* for projection painting only */
+ short seam_bleed,normal_angle;
} ImagePaintSettings;
typedef struct ParticleBrushData {
@@ -712,6 +713,34 @@ typedef struct Scene {
#define R_BAKE_SPACE_TANGENT 3
/* **************** SCENE ********************* */
+
+/* for general use */
+#define MAXFRAME 300000
+#define MAXFRAMEF 300000.0f
+
+#define MINFRAME 1
+#define MINFRAMEF 1.0
+
+#define TESTBASE(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) )
+#define TESTBASELIB(base) ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
+#define BASE_SELECTABLE(base) ((base->lay & G.vd->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
+#define FIRSTBASE G.scene->base.first
+#define LASTBASE G.scene->base.last
+#define BASACT (G.scene->basact)
+#define OBACT (BASACT? BASACT->object: 0)
+#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
+#define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
+#define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;}
+#define CFRA (G.scene->r.cfra)
+#define F_CFRA ((float)(G.scene->r.cfra))
+#define SFRA (G.scene->r.sfra)
+#define EFRA (G.scene->r.efra)
+#define PSFRA ((G.scene->r.psfra != 0)? (G.scene->r.psfra): (G.scene->r.sfra))
+#define PEFRA ((G.scene->r.psfra != 0)? (G.scene->r.pefra): (G.scene->r.efra))
+#define FRA2TIME(a) ((((double) G.scene->r.frs_sec_base) * (a)) / G.scene->r.frs_sec)
+#define TIME2FRA(a) ((((double) G.scene->r.frs_sec) * (a)) / G.scene->r.frs_sec_base)
+#define FPS (((double) G.scene->r.frs_sec) / G.scene->r.frs_sec_base)
+
#define RAD_PHASE_PATCHES 1
#define RAD_PHASE_FACES 2
@@ -799,6 +828,15 @@ typedef struct Scene {
#define IMAGEPAINT_DRAW_TOOL 2
#define IMAGEPAINT_DRAW_TOOL_DRAWING 4
+/* projection painting only */
+#define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */
+#define IMAGEPAINT_PROJECT_XRAY 16
+#define IMAGEPAINT_PROJECT_BACKFACE 32
+#define IMAGEPAINT_PROJECT_FLAT 64
+#define IMAGEPAINT_PROJECT_LAYER_CLONE 128
+#define IMAGEPAINT_PROJECT_LAYER_MASK 256
+#define IMAGEPAINT_PROJECT_LAYER_MASK_INV 512
+
/* toolsettings->uvcalc_flag */
#define UVCALC_FILLHOLES 1
#define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 9f0a70d9bca..73ee9cd9114 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -1,6 +1,4 @@
/**
- * blenlib/DNA_screen_types.h (mar-2001 nzc)
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -22,9 +20,7 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -32,23 +28,37 @@
#define DNA_SCREEN_TYPES_H
#include "DNA_listBase.h"
+#include "DNA_view2d_types.h"
#include "DNA_vec_types.h"
-#include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
+#include "DNA_ID.h"
+struct SpaceType;
+struct SpaceLink;
+struct ARegionType;
struct Scene;
typedef struct bScreen {
ID id;
- ListBase vertbase, edgebase, areabase;
+
+ ListBase vertbase, edgebase;
+ ListBase areabase;
+ ListBase regionbase; /* screen level regions, runtime only */
struct Scene *scene;
- short startx, endx, starty, endy; /* framebuffer coords */
- short sizex, sizey;
+
short scenenr, screennr; /* only for pupmenu */
- short full, pad;
- short mainwin, winakt;
- short handler[8]; /* similar to space handler now */
+
+ short full, winid; /* winid from WM, starts with 1 */
+ short do_draw; /* notifier for drawing edges */
+ short do_refresh; /* notifier for scale screen, changed screen, etc */
+ short do_gesture; /* notifier for gesture draw. */
+ short pad[3];
+
+ short mainwin; /* screensize subwindow, for screenedges and global menus */
+ short subwinactive; /* active subwindow */
+
+ short handler[8]; /* similar to space handler */
} bScreen;
typedef struct ScrVert {
@@ -65,20 +75,9 @@ typedef struct ScrEdge {
int pad;
} ScrEdge;
-#ifndef DNA_USHORT_FIX
-#define DNA_USHORT_FIX
-/**
- * @deprecated This typedef serves to avoid badly typed functions when
- * @deprecated compiling while delivering a proper dna.c. Do not use
- * @deprecated it in any case.
- */
-typedef unsigned short dna_ushort_fix;
-#endif
-
-
-
typedef struct Panel { /* the part from uiBlock that needs saved in file */
struct Panel *next, *prev;
+
char panelname[64], tabname[64]; /* defined as UI_MAX_NAME_STR */
char drawname[64]; /* panelname is identifier for restoring location */
short ofsx, ofsy, sizex, sizey;
@@ -92,36 +91,65 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
typedef struct ScrArea {
struct ScrArea *next, *prev;
+
ScrVert *v1, *v2, *v3, *v4;
bScreen *full; /* if area==full, this is the parent */
- float winmat[4][4];
- rcti totrct, headrct, winrct;
- short headwin, win;
- short headertype; /* 0=no header, 1= down, 2= up */
- char spacetype, butspacetype; /* SPACE_... */
- short winx, winy; /* size */
- char head_swap, head_equal;
- char win_swap, win_equal;
+ rcti totrct; /* rect bound by v1 v2 v3 v4 */
+
+ char spacetype, butspacetype; /* SPACE_..., butspacetype is button arg */
+ short winx, winy; /* size */
- short headbutlen, headbutofs;
+ short headertype; /* OLD! 0=no header, 1= down, 2= up */
+ short headbutlen, headbutofs; /* OLD! */
short cursor, flag;
ScriptLink scriptlink;
-
+
+ struct SpaceType *type; /* callbacks for this space type */
+
ListBase spacedata;
- ListBase uiblocks;
+ ListBase uiblocks; /* uiBlock */
ListBase panels;
+ ListBase regionbase; /* ARegion */
+ ListBase handlers; /* wmEventHandler */
+
+ ListBase actionzones; /* AZone */
} ScrArea;
-#define MAXWIN 128
+typedef struct ARegion {
+ struct ARegion *next, *prev;
+
+ View2D v2d; /* 2D-View scrolling/zoom info (most regions are 2d anyways) */
+ rcti winrct; /* coordinates of region */
+ short winx, winy; /* size */
+
+ short swinid;
+ short regiontype; /* window, header, etc. identifier for drawing */
+ short alignment; /* how it should split */
+ short flag; /* hide, ... */
+
+ float fsize; /* current split size in float */
+
+ short do_draw; /* cached notifier events */
+ short pad;
+ int pad1;
+
+ struct ARegionType *type; /* callbacks for this region type */
+
+ ListBase uiblocks;
+ ListBase handlers; /* wmEventHandler */
+
+ void *regiondata; /* XXX 2.50, need spacedata equivalent? */
+} ARegion;
/* area->flag */
#define HEADER_NO_PULLDOWN 1
+#define AREA_FLAG_DRAWJOINTO 2
+#define AREA_FLAG_DRAWJOINFROM 4
/* If you change EDGEWIDTH, also do the global arrat edcol[] */
#define EDGEWIDTH 1
-#define EDGEWIDTH2 0
#define AREAGRID 4
#define AREAMINX 32
#define HEADERY 26
@@ -139,15 +167,6 @@ typedef struct ScrArea {
#define WIN_BACK_OK 2
#define WIN_EQUAL 3
-#define L_SCROLL 1 /* left scrollbar */
-#define R_SCROLL 2
-#define VERT_SCROLL 3
-#define T_SCROLL 4
-#define B_SCROLL 8
-#define HOR_SCROLL 12
-#define B_SCROLLO 16 /* special hack for outliner hscroll - prevent hanging */
-#define HOR_SCROLLO 20 /* in older versions of blender */
-
/* Panel->snap - for snapping to screen edges */
#define PNL_SNAP_NONE 0
#define PNL_SNAP_TOP 1
@@ -164,5 +183,25 @@ typedef struct ScrArea {
#define SCREEN_HANDLER_PYTHON 2
#define SCREEN_HANDLER_VERSE 3
+/* regiontype, first two are the default set */
+#define RGN_TYPE_WINDOW 0
+#define RGN_TYPE_HEADER 1
+#define RGN_TYPE_CHANNELS 2
+#define RGN_TYPE_TEMPORARY 3
+
+/* region alignment */
+#define RGN_ALIGN_NONE 0
+#define RGN_ALIGN_TOP 1
+#define RGN_ALIGN_BOTTOM 2
+#define RGN_ALIGN_LEFT 3
+#define RGN_ALIGN_RIGHT 4
+#define RGN_ALIGN_HSPLIT 5
+#define RGN_ALIGN_VSPLIT 6
+#define RGN_ALIGN_FLOAT 7
+
+/* region flag */
+#define RGN_FLAG_HIDDEN 1
+#define RGN_FLAG_TOO_SMALL 2
+
#endif
diff --git a/source/blender/makesdna/DNA_scriptlink_types.h b/source/blender/makesdna/DNA_scriptlink_types.h
index 95e20dd004d..9b50eb91a20 100644
--- a/source/blender/makesdna/DNA_scriptlink_types.h
+++ b/source/blender/makesdna/DNA_scriptlink_types.h
@@ -65,10 +65,12 @@ typedef struct ScriptLink {
/* these are special scriptlinks that can be assigned to
* a given space in a given ScrArea to:
* - (EVENT type) handle events sent to that space;
- * - (DRAW type) draw on the space after its own drawing function finishes
+ * - (EVENT_ALL type): handle release events, too;
+ * - (DRAW type) draw on the space after its own drawing function finishes.
*/
-#define SPACEHANDLER_VIEW3D_EVENT 1
-#define SPACEHANDLER_VIEW3D_DRAW 2
+#define SPACEHANDLER_VIEW3D_DRAW 1
+#define SPACEHANDLER_VIEW3D_EVENT 2
+#define SPACEHANDLER_VIEW3D_EVENT_ALL 3
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index ac0b77aacf9..5726837a723 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -33,21 +33,31 @@
#
#
-struct SDNA {
- char *data;
- int datalen, nr_names;
- char **names;
- int nr_types, pointerlen;
- char **types;
- short *typelens;
- int nr_structs;
- short **structs;
+typedef struct SDNA {
+ char *data; /* full copy of 'encoded' data */
+ int datalen; /* length of data */
+
+ int nr_names; /* total number of struct members */
+ char **names; /* struct member names */
+
+ int pointerlen; /* size of a pointer in bytes */
+
+ int nr_types; /* number of basic types + struct types */
+ char **types; /* type names */
+ short *typelens; /* type lengths */
+
+ int nr_structs; /* number of struct types */
+ short **structs; /* sp= structs[a] is the adress of a struct definintion
+ sp[0] is struct type number, sp[1] amount of members
+
+ (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
+ type and name numbers respectively */
/* wrong place for this really, its a simple
* cache for findstruct_nr.
*/
int lastfind;
-};
+} SDNA;
#
#
diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h
index d05e6f1bae8..5dedd20e1e4 100644
--- a/source/blender/makesdna/DNA_sound_types.h
+++ b/source/blender/makesdna/DNA_sound_types.h
@@ -132,6 +132,7 @@ typedef struct bSoundListener {
typedef struct SpaceSound {
struct SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
struct ScrArea *area;
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 226a3ecd834..d1af38b9e25 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -57,34 +57,34 @@ struct bGPdata;
* are derived (implicitly) from. Would be
* good to make this explicit.
*/
-typedef struct SpaceLink SpaceLink;
-struct SpaceLink {
- SpaceLink *next, *prev;
+
+typedef struct SpaceLink {
+ struct SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
- float blockscale;
- struct ScrArea *area;
- short blockhandler[8];
-};
+ float blockscale; /* XXX depricate this */
+ short blockhandler[8]; /* XXX depricate this */
+} SpaceLink;
typedef struct SpaceInfo {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
} SpaceInfo;
typedef struct SpaceIpo {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
unsigned int rowbut, pad2;
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
void *editipo;
ListBase ipokey;
@@ -105,16 +105,16 @@ typedef struct SpaceIpo {
typedef struct SpaceButs {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
struct RenderInfo *ri;
short blockhandler[8];
short cursens, curact;
short align, tabo; /* align for panels, tab is old tab */
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
short mainb, menunr; /* texnr and menunr have to remain shorts */
short pin, mainbo;
@@ -137,13 +137,13 @@ typedef struct SpaceButs {
typedef struct SpaceSeq {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
float xof, yof; /* offset for drawing the image preview */
short mainb, pad;
@@ -157,9 +157,9 @@ typedef struct SpaceSeq {
typedef struct SpaceFile {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
@@ -192,13 +192,13 @@ typedef struct SpaceFile {
typedef struct SpaceOops {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
ListBase oops;
short pin, visiflag, flag, rt;
@@ -214,18 +214,21 @@ typedef struct SpaceOops {
short type, outlinevis, storeflag;
short deps_flags;
+
+ /* RNA */
+ char *rnapath;
} SpaceOops;
typedef struct SpaceImage {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
struct Image *image;
struct ImageUser iuser;
@@ -252,9 +255,9 @@ typedef struct SpaceImage {
typedef struct SpaceNla {
struct SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
@@ -262,14 +265,14 @@ typedef struct SpaceNla {
short autosnap; /* this uses the same settings as autosnap for Action Editor */
short flag;
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
} SpaceNla;
typedef struct SpaceText {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
@@ -315,9 +318,9 @@ typedef struct Script {
typedef struct SpaceScript {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
struct Script *script;
short flags, menunr;
@@ -328,11 +331,11 @@ typedef struct SpaceScript {
typedef struct SpaceTime {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
int flag, redraws;
@@ -340,13 +343,13 @@ typedef struct SpaceTime {
typedef struct SpaceNode {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
struct ID *id, *from; /* context, no need to save in file? well... pinning... */
short flag, menunr; /* menunr: browse id block in header */
@@ -368,13 +371,13 @@ typedef struct SpaceNode {
typedef struct SpaceImaSel {
SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
- View2D v2d;
+ View2D v2d; /* depricated, copied to region */
struct FileList *files;
@@ -426,10 +429,12 @@ typedef struct SpaceImaSel {
} SpaceImaSel;
-/* **************** SPACE ********************* */
+/* view3d Now in DNA_view3d_types.h */
-/* view3d Now in DNA_view3d_types.h */
+
+/* **************** SPACE DEFINES ********************* */
+
/* button defines in BIF_butspace.h */
@@ -482,9 +487,6 @@ typedef struct SpaceImaSel {
#define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
#define FOLDERFILE 2048 /* represents folders for filtering */
-#define SCROLLH 16 /* height scrollbar */
-#define SCROLLB 16 /* width scrollbar */
-
/* SpaceImage->mode */
#define SI_TEXTURE 0
#define SI_SHOW 1
@@ -541,8 +543,11 @@ typedef struct SpaceImaSel {
#define SI_DISPGP 1<<22
/* SpaceIpo->flag */
-#define SIPO_LOCK_VIEW 1<<0
-#define SIPO_NOTRANSKEYCULL 1<<1
+#define SIPO_LOCK_VIEW (1<<0)
+#define SIPO_NOTRANSKEYCULL (1<<1)
+#define SIPO_NOHANDLES (1<<2)
+#define SIPO_NODRAWCFRANUM (1<<3)
+#define SIPO_DRAWTIME (1<<4)
/* SpaceText flags (moved from DNA_text_types.h) */
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index fbd962f9372..a8cd905f81c 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -218,7 +218,7 @@ typedef struct UserDef {
struct ColorBand coba_weight; /* from texture.h */
} UserDef;
-extern UserDef U; /* from usiblender.c !!!! */
+extern UserDef U; /* from blenkernel blender.c */
/* ***************** USERDEF ****************** */
diff --git a/source/blender/makesdna/DNA_vfont_types.h b/source/blender/makesdna/DNA_vfont_types.h
index 33b8efa8dd5..b90e853d772 100644
--- a/source/blender/makesdna/DNA_vfont_types.h
+++ b/source/blender/makesdna/DNA_vfont_types.h
@@ -40,7 +40,6 @@ typedef struct VFont {
ID id;
char name[256];
- float scale, pad;
struct VFontData *data;
struct PackedFile * packedfile;
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index d7c422407ca..986996e4341 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -24,7 +24,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -33,32 +33,91 @@
#include "DNA_vec_types.h"
+/* ---------------------------------- */
+
+/* View 2D data - stored per region */
typedef struct View2D {
- rctf tot, cur;
- rcti vert, hor, mask;
- float min[2], max[2];
- float minzoom, maxzoom;
- short scroll, keeptot;
- short keepaspect, keepzoom;
- short oldwinx, oldwiny;
- int flag;
+ rctf tot, cur; /* tot - area that data can be drawn in; cur - region of tot that is visible in viewport */
+ rcti vert, hor; /* vert - vertical scrollbar region; hor - horizontal scrollbar region */
+ rcti mask; /* mask - region (in screenspace) within which 'cur' can be viewed */
+
+ float min[2], max[2]; /* min/max sizes of 'cur' rect (only when keepzoom not set) */
+ float minzoom, maxzoom; /* self explanatory. allowable zoom factor range (only when keepzoom set) */
+
+ short scroll; /* scroll - scrollbars to display (bitflag) */
+ short keeptot; /* keeptot - 'cur' rect cannot move outside the 'tot' rect? */
+ short keepzoom; /* keepzoom - axes that zooming cannot occur on, and also clamp within zoom-limits */
+ short keepofs; /* keepofs - axes that translation is not allowed to occur on */
+
+ short flag; /* settings */
+ short align; /* alignment of content in totrect */
+ short type; /* basic 'type' of View2D (for easy init) */ // err... do we want to store this?
- float cursor[2]; /* only used in the UV view for now*/
- short around;
- char pad[6];
+ short winx, winy; /* storage of current winx/winy values, set in UI_view2d_size_update */
+ short oldwinx, oldwiny; /* storage of previous winx/winy values encountered by UI_view2d_curRect_validate(), for keepaspect */
+
+ short around; /* pivot point for transforms (rotate and scale) */
+ float cursor[2]; /* only used in the UV view for now (for 2D-cursor) */
} View2D;
-/* v2d->keepzoom */
-#define V2D_KEEPZOOM 0x0001
-#define V2D_LOCKZOOM_X 0x0100
-#define V2D_LOCKZOOM_Y 0x0200
+/* ---------------------------------- */
+
+/* view zooming restrictions, per axis (v2d->keepzoom) */
+#define V2D_KEEPZOOM 0x0001
+#define V2D_KEEPASPECT 0x0002
+#define V2D_LOCKZOOM_X 0x0100
+#define V2D_LOCKZOOM_Y 0x0200
+
+/* view panning restrictions, per axis (v2d->keepofs) */
+#define V2D_LOCKOFS_X (1<<1)
+#define V2D_LOCKOFS_Y (1<<2)
+
+/* general refresh settings (v2d->flag) */
+ /* global view2d horizontal locking (for showing same time interval) */
+#define V2D_VIEWSYNC_X (1<<0)
+ /* within region view2d vertical locking */
+#define V2D_VIEWSYNC_Y (1<<1)
+
+
+/* scroller thickness */
+#define V2D_SCROLL_HEIGHT 16
+#define V2D_SCROLL_WIDTH 16
+
+/* half the size (in pixels) of scroller 'handles' */
+#define V2D_SCROLLER_HANDLE_SIZE 5
+
+
+/* scroller flags for View2D (v2d->scroll) */
+ /* left scrollbar */
+#define V2D_SCROLL_LEFT (1<<0)
+#define V2D_SCROLL_RIGHT (1<<1)
+#define V2D_SCROLL_VERTICAL (V2D_SCROLL_LEFT|V2D_SCROLL_RIGHT)
+ /* horizontal scrollbar */
+#define V2D_SCROLL_TOP (1<<2)
+#define V2D_SCROLL_BOTTOM (1<<3)
+#define V2D_SCROLL_HORIZONTAL (V2D_SCROLL_TOP|V2D_SCROLL_BOTTOM)
+ /* special hacks for outliner hscroll - prevent hanging older versions of Blender */
+#define V2D_SCROLL_BOTTOM_O (1<<4)
+#define V2D_SCROLL_HORIZONTAL_O (V2D_SCROLL_TOP|V2D_SCROLL_BOTTOM_O)
+ /* scale markings - vertical */
+#define V2D_SCROLL_SCALE_LEFT (1<<5)
+#define V2D_SCROLL_SCALE_RIGHT (1<<6)
+#define V2D_SCROLL_SCALE_VERTICAL (V2D_SCROLL_SCALE_LEFT|V2D_SCROLL_SCALE_RIGHT)
+ /* scale markings - horizontal */
+#define V2D_SCROLL_SCALE_BOTTOM (1<<7)
+#define V2D_SCROLL_SCALE_TOP (1<<8)
+#define V2D_SCROLL_SCALE_HORIZONTAL (V2D_SCROLL_SCALE_BOTTOM|V2D_SCROLL_SCALE_TOP)
-/* event codes for locking function */
-#define V2D_LOCK_COPY 1
-#define V2D_LOCK_REDRAW 2
+/* alignment flags for totrect, flags use 'shading-out' convention (v2d->align) */
+ /* all quadrants free */
+#define V2D_ALIGN_FREE 0
+ /* horizontal restrictions */
+#define V2D_ALIGN_NO_POS_X (1<<0)
+#define V2D_ALIGN_NO_NEG_X (1<<1)
+ /* vertical restrictions */
+#define V2D_ALIGN_NO_POS_Y (1<<2)
+#define V2D_ALIGN_NO_NEG_Y (1<<3)
-/* v2d->flag */
-#define V2D_VIEWLOCK 1
#endif
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index b7b5f71c845..d281c1e5213 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -72,9 +72,9 @@ typedef struct BGpic {
/* 3D ViewPort Struct */
typedef struct View3D {
struct SpaceLink *next, *prev;
+ ListBase regionbase; /* storage of regions for inactive spaces */
int spacetype;
float blockscale;
- struct ScrArea *area;
short blockhandler[8];
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
new file mode 100644
index 00000000000..867007032b6
--- /dev/null
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -0,0 +1,195 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef DNA_WINDOWMANAGER_TYPES_H
+#define DNA_WINDOWMANAGER_TYPES_H
+
+#include "DNA_listBase.h"
+#include "DNA_vec_types.h"
+
+#include "DNA_ID.h"
+
+/* defined here: */
+struct wmWindowManager;
+struct wmWindow;
+
+struct wmEvent;
+struct wmOperatorType;
+struct wmOperator;
+
+/* forwards */
+struct bContext;
+struct wmLocal;
+struct bScreen;
+struct uiBlock;
+struct wmSubWindow;
+struct StructRNA;
+struct PointerRNA;
+
+/* windowmanager is saved, tag WMAN */
+typedef struct wmWindowManager {
+ ID id;
+
+ struct wmWindow *windrawable, *winactive; /* separate active from drawable */
+ ListBase windows;
+
+ int initialized; /* set on file read */
+ int pad;
+
+ ListBase operators; /* operator registry */
+
+ ListBase queue; /* refresh/redraw wmNotifier structs */
+
+ ListBase reports; /* information and error reports */
+
+ /* used keymaps, optionally/partially saved */
+ ListBase keymaps;
+
+} wmWindowManager;
+
+
+/* the savable part, rest of data is local in ghostwinlay */
+typedef struct wmWindow {
+ struct wmWindow *next, *prev;
+
+ void *ghostwin; /* dont want to include ghost.h stuff */
+
+ int winid, pad; /* winid also in screens, is for retrieving this window after read */
+
+ struct bScreen *screen; /* active screen */
+ char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */
+
+ short posx, posy, sizex, sizey; /* window coords */
+ short windowstate; /* borderless, full */
+ short monitor; /* multiscreen... no idea how to store yet */
+ short active; /* set to 1 if an active window, for quick rejects */
+ short cursor; /* current mouse cursor type */
+
+ struct wmEvent *eventstate; /* storage for event system */
+
+ struct wmSubWindow *curswin; /* internal for wm_subwindow.c only */
+
+ ListBase queue; /* all events (ghost level events were handled) */
+ ListBase handlers; /* window+screen handlers, overriding all queues */
+
+ ListBase subwindows; /* opengl stuff for sub windows, see notes in wm_subwindow.c */
+ ListBase gesture; /* gesture stuff */
+} wmWindow;
+
+#
+#
+typedef struct wmOperatorType {
+ struct wmOperatorType *next, *prev;
+
+ char *name; /* text for ui, undo */
+ char *idname; /* unique identifier */
+
+ /* this callback executes the operator without any interactive input,
+ * parameters may be provided through operator properties. cannot use
+ * any interface code or input device state.
+ * - see defines below for return values */
+ int (*exec)(struct bContext *, struct wmOperator *);
+
+ /* for modal temporary operators, initially invoke is called. then
+ * any further events are handled in modal. if the operation is
+ * cancelled due to some external reason, cancel is called
+ * - see defines below for return values */
+ int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *);
+ int (*cancel)(struct bContext *, struct wmOperator *);
+ int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *);
+
+ /* verify if the operator can be executed in the current context, note
+ * that the operator might still fail to execute even if this return true */
+ int (*poll)(struct bContext *);
+
+ /* panel for redo and repeat */
+ void *(*uiBlock)(struct wmOperator *);
+
+ /* rna for properties */
+ struct StructRNA *srna;
+
+ short flag;
+
+} wmOperatorType;
+
+#define OP_MAX_TYPENAME 64
+
+/* partial copy of the event, for matching by eventhandler */
+typedef struct wmKeymapItem {
+ struct wmKeymapItem *next, *prev;
+
+ char idname[64]; /* used to retrieve operator type pointer */
+
+ short type; /* event code itself */
+ short val; /* 0=any, 1=click, 2=release, or wheelvalue, or... */
+ short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */
+ short keymodifier; /* rawkey modifier */
+
+ short pad;
+} wmKeymapItem;
+
+#define KMAP_MAX_NAME 64
+
+/* stored in WM, the actively used keymaps */
+typedef struct wmKeyMap {
+ struct wmKeyMap *next, *prev;
+
+ ListBase keymap;
+
+ char nameid[64]; /* global editor keymaps, or for more per space/region */
+ int spaceid; /* same IDs as in DNA_space_types.h */
+ int regionid; /* see above */
+} wmKeyMap;
+
+
+/* this one is the operator itself, stored in files for macros etc */
+/* operator + operatortype should be able to redo entirely, but for different contextes */
+typedef struct wmOperator {
+ struct wmOperator *next, *prev;
+
+ wmOperatorType *type;
+ char idname[64]; /* used to retrieve type pointer */
+
+ /* custom storage, only while operator runs, not saved */
+ void *customdata;
+ /* IDproperty list */
+ IDProperty *properties;
+
+ /* runtime */
+ struct PointerRNA *ptr;
+ ListBase *modallist;
+} wmOperator;
+
+/* operator type exec(), invoke() modal(), return values */
+#define OPERATOR_RUNNING_MODAL 1
+#define OPERATOR_CANCELLED 2
+#define OPERATOR_FINISHED 4
+/* add this flag if the event should pass through */
+#define OPERATOR_PASS_THROUGH 8
+
+#endif /* DNA_WINDOWMANAGER_TYPES_H */
+
diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript
index d67be4955c4..cdb4caef8fd 100644
--- a/source/blender/makesdna/SConscript
+++ b/source/blender/makesdna/SConscript
@@ -4,8 +4,8 @@ Import ('env')
objs = []
o = SConscript('intern/SConscript')
-objs.append (o)
+objs += o
-incs = '#/intern/guardedalloc'
+incs = '#/intern/guardedalloc .'
env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['common','player'], priority = [10, 215] )
diff --git a/source/blender/makesdna/intern/Makefile b/source/blender/makesdna/intern/Makefile
index 1dc82a542c7..857e53d2573 100644
--- a/source/blender/makesdna/intern/Makefile
+++ b/source/blender/makesdna/intern/Makefile
@@ -28,10 +28,9 @@
#
#
+LIBNAME = dna
DIR = $(OCGDIR)/blender/makesdna
-CSRCS = $(wildcard *.c)
-
-ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)makesdna $(DIR)/$(SHARED_DIR)$(DEBUG_DIR)DNA.o
+CSRCS = DNA.c $(wildcard dna_*.c)
include nan_compile.mk
@@ -66,9 +65,10 @@ clean::
# A small note: we do not use the debug version of the alloc lib. That
# is done quite intentionally. If there is a bug in that lib, it needs
# to be fixed by the module maintainer.
-$(DIR)/$(DEBUG_DIR)makesdna: $(OBJS) $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
- $(CC) $(LDFLAGS) -o $@ $(OBJS) \
- $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a $(WINLIBS)
+DNAOBJS = $(filter-out %DNA.o, $(OBJS))
+
+$(DIR)/$(DEBUG_DIR)makesdna: $(DNAOBJS) $(DIR)/$(DEBUG_DIR)makesdna.o $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
+ $(CC) $(LDFLAGS) -o $@ $^
$(DIR)/$(DEBUG_DIR)DNA.c: $(DIR)/$(DEBUG_DIR)makesdna
ifeq ($(OS),windows)
@@ -78,6 +78,6 @@ $(DIR)/$(DEBUG_DIR)DNA.c: $(DIR)/$(DEBUG_DIR)makesdna
$(DIR)/$(DEBUG_DIR)makesdna $(DIR)/$(DEBUG_DIR)DNA.c
endif
-$(DIR)/$(SHARED_DIR)$(DEBUG_DIR)DNA.o: $(DIR)/$(DEBUG_DIR)DNA.c
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+$(DIR)/$(DEBUG_DIR)makesdna.o: makesdna.c $(wildcard ../*.h)
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) makesdna.c -o $@
diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript
index 0a2afd66dae..4aa8d6a9d54 100644
--- a/source/blender/makesdna/intern/SConscript
+++ b/source/blender/makesdna/intern/SConscript
@@ -18,9 +18,15 @@ makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
'../../makesdna'])
if env['OURPLATFORM'] == 'linuxcross':
- makesdna_tool.Replace(CC='gcc')
- makesdna_tool.Replace(AR='ar')
- makesdna_tool.Replace(LINK='gcc')
+ USE_WINE = True # when cross compiling on linux 64bit this is useful
+else:
+ USE_WINE = False
+
+if not USE_WINE:
+ if env['OURPLATFORM'] == 'linuxcross':
+ makesdna_tool.Replace(CC='gcc')
+ makesdna_tool.Replace(AR='ar')
+ makesdna_tool.Replace(LINK='gcc')
if sys.platform != 'cygwin':
makesdna_tool.Append (CCFLAGS = cflags)
@@ -30,7 +36,7 @@ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
targetdir = '#'+targetdir
makesdna_tool.Append (LIBPATH = targetdir)
if env['BF_PROFILE']:
- makesdna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS'])
+ makesdna_tool.Append (LINKFLAGS = env['BF_PROFILE_LINKFLAGS'])
targetdir = root_build_dir + '/makesdna'
@@ -43,8 +49,11 @@ dna_dict = dna.Dictionary()
dna.Depends ('dna.c', makesdna)
dna.Depends ('dna.c', header_files)
if env['OURPLATFORM'] != 'linuxcross':
- dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
+ if USE_WINE:
+ dna.Command ('dna.c', '', 'wine ' + root_build_dir+os.sep+"makesdna $TARGET")
+ else:
+ dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
else:
dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
-obj = 'intern/dna.c'
+obj = ['intern/dna.c', 'intern/dna_genfile.c']
Return ('obj')
diff --git a/source/blender/blenloader/intern/genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 86338ca9e89..0ffc170a5aa 100644
--- a/source/blender/blenloader/intern/genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -1,4 +1,4 @@
-/* genfile.c
+/* dna_genfile.c
*
* Functions for struct-dna, the genetic file dot c!
*
@@ -31,34 +31,15 @@
* DNA handling
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h> // for read close
-#else
-#include <io.h> // for open close read
-#endif
-
-#include <string.h> // strncmp
-#include <stdio.h> // for printf
-#include <stdlib.h> // for atoi
-#include <fcntl.h> // for open O_RDONLY
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN
-#include "BLI_blenlib.h" // for BLI_filesize
-
-#include "BKE_utildefines.h" // for O_BINARY TRUE MIN2
+#include "DNA_genfile.h"
#include "DNA_sdna_types.h" // for SDNA ;-)
-#include "BLO_writefile.h"
-#include "BLO_genfile.h"
-
-#include "genfile.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
/* gcc 4.1 on mingw was complaining that __int64 was alredy defined
actually is saw the line below as typedef long long long long...
@@ -181,31 +162,31 @@ static int le_int(int temp)
/* ************************* MAKE DNA ********************** */
/* allowed duplicate code from makesdna.c */
-static int arraysize(char *astr, int len)
+int DNA_elem_array_size(const char *astr, int len)
{
- int a, mul=1;
- char str[100], *cp=0;
-
- memcpy(str, astr, len+1);
-
- for(a=0; a<len; a++) {
- if( str[a]== '[' ) {
- cp= &(str[a+1]);
- }
- else if( str[a]==']' && cp) {
- str[a]= 0;
- mul*= atoi(cp);
- }
- }
-
- return mul;
+ int a, mul=1;
+ char str[100], *cp=0;
+
+ memcpy(str, astr, len+1);
+
+ for(a=0; a<len; a++) {
+ if( str[a]== '[' ) {
+ cp= &(str[a+1]);
+ }
+ else if( str[a]==']' && cp) {
+ str[a]= 0;
+ mul*= atoi(cp);
+ }
+ }
+
+ return mul;
}
/* ************************* END MAKE DNA ********************** */
/* ************************* DIV ********************** */
-void dna_freestructDNA(struct SDNA *sdna)
+void DNA_sdna_free(SDNA *sdna)
{
MEM_freeN(sdna->data);
MEM_freeN(sdna->names);
@@ -221,7 +202,7 @@ static int ispointer(char *name)
return (name[0]=='*' || (name[0]=='(' && name[1]=='*'));
}
-static int elementsize(struct SDNA *sdna, short type, short name)
+static int elementsize(SDNA *sdna, short type, short name)
/* call with numbers from struct-array */
{
int mul, namelen, len;
@@ -235,14 +216,14 @@ static int elementsize(struct SDNA *sdna, short type, short name)
if(ispointer(cp)) {
/* has the naam an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
+ if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
len= sdna->pointerlen*mul;
}
else if( sdna->typelens[type] ) {
/* has the naam an extra length? (array) */
mul= 1;
- if( cp[namelen-1]==']') mul= arraysize(cp, namelen);
+ if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen);
len= mul*sdna->typelens[type];
@@ -252,7 +233,7 @@ static int elementsize(struct SDNA *sdna, short type, short name)
}
#if 0
-static void printstruct(struct SDNA *sdna, short strnr)
+static void printstruct(SDNA *sdna, short strnr)
{
/* is for debug */
int b, nr;
@@ -270,7 +251,7 @@ static void printstruct(struct SDNA *sdna, short strnr)
}
#endif
-static short *findstruct_name(struct SDNA *sdna, char *str)
+static short *findstruct_name(SDNA *sdna, char *str)
{
int a;
short *sp=0;
@@ -286,7 +267,7 @@ static short *findstruct_name(struct SDNA *sdna, char *str)
return 0;
}
-int dna_findstruct_nr(struct SDNA *sdna, char *str)
+int DNA_struct_find_nr(SDNA *sdna, const char *str)
{
short *sp=0;
int a;
@@ -313,11 +294,11 @@ int dna_findstruct_nr(struct SDNA *sdna, char *str)
/* ************************* READ DNA ********************** */
-static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
+static void init_structDNA(SDNA *sdna, int do_endian_swap)
/* in sdna->data the data, now we convert that to something understandable */
{
int *data, *verg;
- intptr_t nr;
+ long nr; /* intptr_t 2.48 XXX */
short *sp;
char str[8], *cp;
@@ -353,7 +334,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
cp++;
nr++;
}
- nr= (intptr_t)cp; /* prevent BUS error */
+ nr= (long)cp; /* prevent BUS error */ /* intptr_t 2.48 XXX */
nr= (nr+3) & ~3;
cp= (char *)nr;
@@ -391,7 +372,7 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
cp++;
nr++;
}
- nr= (intptr_t)cp; /* prevent BUS error */
+ nr= (long)cp; /* prevent BUS error */ /* intptr_t 2.48 XXX */
nr= (nr+3) & ~3;
cp= (char *)nr;
@@ -479,9 +460,9 @@ static void init_structDNA(struct SDNA *sdna, int do_endian_swap)
}
}
-struct SDNA *dna_sdna_from_data(void *data, int datalen, int do_endian_swap)
+SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap)
{
- struct SDNA *sdna= MEM_mallocN(sizeof(*sdna), "sdna");
+ SDNA *sdna= MEM_mallocN(sizeof(*sdna), "sdna");
sdna->lastfind= 0;
@@ -498,7 +479,7 @@ struct SDNA *dna_sdna_from_data(void *data, int datalen, int do_endian_swap)
/* ******************* HANDLE DNA ***************** */
-static void recurs_test_compflags(struct SDNA *sdna, char *compflags, int structnr)
+static void recurs_test_compflags(SDNA *sdna, char *compflags, int structnr)
{
int a, b, typenr, elems;
short *sp;
@@ -538,7 +519,7 @@ static void recurs_test_compflags(struct SDNA *sdna, char *compflags, int struct
*/
-char *dna_get_structDNA_compareflags(struct SDNA *sdna, struct SDNA *newsdna)
+char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
{
/* flag: 0: doesn't exist anymore (or not yet)
* 1: is equal
@@ -632,7 +613,7 @@ static void cast_elem(char *ctype, char *otype, char *name, char *curdata, char
double val = 0.0;
int arrlen, curlen=1, oldlen=1, ctypenr, otypenr;
- arrlen= arraysize(name, strlen(name));
+ arrlen= DNA_elem_array_size(name, strlen(name));
/* define otypenr */
if(strcmp(otype, "char")==0) otypenr= 0;
@@ -729,7 +710,7 @@ static void cast_pointer(int curlen, int oldlen, char *name, char *curdata, char
#endif
int arrlen;
- arrlen= arraysize(name, strlen(name));
+ arrlen= DNA_elem_array_size(name, strlen(name));
while(arrlen>0) {
@@ -769,7 +750,7 @@ static int elem_strcmp(char *name, char *oname)
/* strcmp without array part */
- while(TRUE) {
+ while(1) {
if(name[a] != oname[a]) return 1;
if(name[a]=='[') break;
if(name[a]==0) break;
@@ -779,7 +760,7 @@ static int elem_strcmp(char *name, char *oname)
return 0;
}
-static char *find_elem(struct SDNA *sdna, char *type, char *name, short *old, char *olddata, short **sppo)
+static char *find_elem(SDNA *sdna, char *type, char *name, short *old, char *olddata, short **sppo)
{
int a, elemcount, len;
char *otype, *oname;
@@ -810,7 +791,7 @@ static char *find_elem(struct SDNA *sdna, char *type, char *name, short *old, ch
return 0;
}
-static void reconstruct_elem(struct SDNA *newsdna, struct SDNA *oldsdna, char *type, char *name, char *curdata, short *old, char *olddata)
+static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna, char *type, char *name, char *curdata, short *old, char *olddata)
{
/* rules: test for NAME:
- name equal:
@@ -856,16 +837,16 @@ static void reconstruct_elem(struct SDNA *newsdna, struct SDNA *oldsdna, char *t
if(oname[array]=='[' && strncmp(name, oname, array)==0 ) { /* basis equal */
- cursize= arraysize(name, strlen(name));
- oldsize= arraysize(oname, strlen(oname));
+ cursize= DNA_elem_array_size(name, strlen(name));
+ oldsize= DNA_elem_array_size(oname, strlen(oname));
if(ispointer(name)) { /* handle pointer or functionpointer */
if(cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata);
else cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata);
}
- else if(strcmp(type, otype)==0 ) { /* type equal */
+ else if(name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */
mul= len/oldsize;
- mul*= MIN2(cursize, oldsize);
+ mul*= (cursize < oldsize)? cursize: oldsize;
memcpy(curdata, olddata, mul);
}
else {
@@ -879,7 +860,7 @@ static void reconstruct_elem(struct SDNA *newsdna, struct SDNA *oldsdna, char *t
}
}
-static void reconstruct_struct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflags, int oldSDNAnr, char *data, int curSDNAnr, char *cur)
+static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna, char *compflags, int oldSDNAnr, char *data, int curSDNAnr, char *cur)
{
/* Recursive!
* Per element from cur_struct, read data from old_struct.
@@ -923,13 +904,13 @@ static void reconstruct_struct(struct SDNA *newsdna, struct SDNA *oldsdna, char
cpo= find_elem(oldsdna, type, name, spo, data, &sppo);
if(cpo) {
- oldSDNAnr= dna_findstruct_nr(oldsdna, type);
- curSDNAnr= dna_findstruct_nr(newsdna, type);
+ oldSDNAnr= DNA_struct_find_nr(oldsdna, type);
+ curSDNAnr= DNA_struct_find_nr(newsdna, type);
/* array! */
- mul= arraysize(name, strlen(name));
+ mul= DNA_elem_array_size(name, strlen(name));
nameo= oldsdna->names[sppo[1]];
- mulo= arraysize(nameo, strlen(nameo));
+ mulo= DNA_elem_array_size(nameo, strlen(nameo));
eleno= elementsize(oldsdna, sppo[0], sppo[1]);
@@ -957,7 +938,7 @@ static void reconstruct_struct(struct SDNA *newsdna, struct SDNA *oldsdna, char
}
}
-void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
+void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
{
/* Recursive!
* If element is a struct, call recursive.
@@ -988,13 +969,13 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
/* where does the old data start (is there one?) */
cpo= find_elem(oldsdna, type, name, spo, data, 0);
if(cpo) {
- oldSDNAnr= dna_findstruct_nr(oldsdna, type);
+ oldSDNAnr= DNA_struct_find_nr(oldsdna, type);
- mul= arraysize(name, strlen(name));
+ mul= DNA_elem_array_size(name, strlen(name));
elena= elen/mul;
while(mul--) {
- dna_switch_endian_struct(oldsdna, oldSDNAnr, cpo);
+ DNA_struct_switch_endian(oldsdna, oldSDNAnr, cpo);
cpo += elena;
}
}
@@ -1004,7 +985,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
if(ispointer(name)) {
if(oldsdna->pointerlen==8) {
- mul= arraysize(name, strlen(name));
+ mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
while(mul--) {
cval= cpo[0]; cpo[0]= cpo[7]; cpo[7]= cval;
@@ -1031,7 +1012,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
}
if(skip==0) {
- mul= arraysize(name, strlen(name));
+ mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
while(mul--) {
cval= cpo[0];
@@ -1043,7 +1024,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
}
else if(spc[0]>3 && spc[0]<8) { /* int-long-ulong-float */
- mul= arraysize(name, strlen(name));
+ mul= DNA_elem_array_size(name, strlen(name));
cpo= cur;
while(mul--) {
cval= cpo[0];
@@ -1061,7 +1042,7 @@ void dna_switch_endian_struct(struct SDNA *oldsdna, int oldSDNAnr, char *data)
}
}
-void *dna_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data)
+void *DNA_struct_reconstruct(SDNA *newsdna, SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data)
{
int a, curSDNAnr, curlen=0, oldlen;
short *spo, *spc;
@@ -1071,7 +1052,7 @@ void *dna_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflag
spo= oldsdna->structs[oldSDNAnr];
type= oldsdna->types[ spo[0] ];
oldlen= oldsdna->typelens[ spo[0] ];
- curSDNAnr= dna_findstruct_nr(newsdna, type);
+ curSDNAnr= DNA_struct_find_nr(newsdna, type);
/* init data and alloc */
if(curSDNAnr >= 0) {
@@ -1094,14 +1075,12 @@ void *dna_reconstruct(struct SDNA *newsdna, struct SDNA *oldsdna, char *compflag
return cur;
}
-int dna_elem_offset(struct SDNA *sdna, char *stype, char *vartype, char *name)
+int DNA_elem_offset(SDNA *sdna, char *stype, char *vartype, char *name)
{
- int SDNAnr= dna_findstruct_nr(sdna, stype);
+ int SDNAnr= DNA_struct_find_nr(sdna, stype);
short *spo= sdna->structs[SDNAnr];
char *cp= find_elem(sdna, vartype, name, spo, NULL, NULL);
- return (int)((intptr_t)cp);
+ return (int)((long)cp); /* intptr_t 2.48 XXX */
}
-
-
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index b4deb1f2b60..dd5aa518e24 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -131,6 +131,7 @@ char *includefiles[] = {
"DNA_gpencil_types.h",
// if you add files here, please add them at the end
// of makesdna.c (this file) as well
+ "DNA_windowmanager_types.h",
// empty string to indicate end of includefiles
""
@@ -518,7 +519,7 @@ int convert_include(char *filename)
overslaan= 0;
while(count<filelen) {
- /* code for skipping a struct: two hashes. (preprocess added a space) */
+ /* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */
if(md[0]=='#' && md[1]==' ' && md[2]=='#') {
overslaan= 1;
}
@@ -1151,4 +1152,5 @@ int main(int argc, char ** argv)
#include "DNA_particle_types.h"
#include "DNA_cloth_types.h"
#include "DNA_gpencil_types.h"
+#include "DNA_windowmanager_types.h"
/* end of list */
diff --git a/source/blender/blenkernel/bad_level_call_stubs/CMakeLists.txt b/source/blender/makesrna/CMakeLists.txt
index 7574f13c92e..879ebccc223 100644
--- a/source/blender/blenkernel/bad_level_call_stubs/CMakeLists.txt
+++ b/source/blender/makesrna/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id$
+# $Id: CMakeLists.txt 13161 2008-01-07 19:13:47Z hos $
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -24,20 +24,4 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC stubs.c)
-
-SET(INC
- .
- ..
- ../../render/extern/include
- ../../../intern/iksolver/extern
- ../../blenlib
- ../../include
- ../../makesdna
-)
-
-IF(WITH_INTERNATIONAL)
- ADD_DEFINITIONS(-DWITH_FREETYPE2)
-ENDIF(WITH_INTERNATIONAL)
-
-BLENDERLIB_NOLIST(blenkernel_blc "${SRC}" "${INC}")
+SUBDIRS(intern)
diff --git a/source/blender/makesrna/Makefile b/source/blender/makesrna/Makefile
new file mode 100644
index 00000000000..bed3e85550d
--- /dev/null
+++ b/source/blender/makesrna/Makefile
@@ -0,0 +1,31 @@
+#
+# $Id$
+#
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Contributor(s): Blender Foundation (2008).
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# This module does not build normal .o's, but a RNA.c file, to be
+# compiled with the rest of the sources.
+#
+
+SOURCEDIR = source/blender/makesrna
+DIRS = intern
+
+include nan_subdirs.mk
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
new file mode 100644
index 00000000000..020f01197ab
--- /dev/null
+++ b/source/blender/makesrna/RNA_access.h
@@ -0,0 +1,306 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RNA_ACCESS
+#define RNA_ACCESS
+
+#include "RNA_types.h"
+
+struct bContext;
+struct ID;
+struct Main;
+
+/* Types */
+
+extern BlenderRNA BLENDER_RNA;
+
+extern StructRNA RNA_Actuator;
+extern StructRNA RNA_ActuatorSensor;
+extern StructRNA RNA_AlwaysSensor;
+extern StructRNA RNA_AndController;
+extern StructRNA RNA_Armature;
+extern StructRNA RNA_BooleanProperty;
+extern StructRNA RNA_Bone;
+extern StructRNA RNA_Brush;
+extern StructRNA RNA_Camera;
+extern StructRNA RNA_CharInfo;
+extern StructRNA RNA_CollectionProperty;
+extern StructRNA RNA_CollisionSensor;
+extern StructRNA RNA_Constraint;
+// ... constraint types...
+extern StructRNA RNA_Controller;
+extern StructRNA RNA_Curve;
+extern StructRNA RNA_CurveMap;
+extern StructRNA RNA_CurveMapPoint;
+extern StructRNA RNA_CurveMapping;
+extern StructRNA RNA_DelaySensor;
+extern StructRNA RNA_EnumProperty;
+extern StructRNA RNA_EnumPropertyItem;
+extern StructRNA RNA_ExpressionController;
+extern StructRNA RNA_FloatProperty;
+extern StructRNA RNA_GameBooleanProperty;
+extern StructRNA RNA_GameFloatProperty;
+extern StructRNA RNA_GameIntProperty;
+extern StructRNA RNA_GameProperty;
+extern StructRNA RNA_GameStringProperty;
+extern StructRNA RNA_GameTimeProperty;
+extern StructRNA RNA_Group;
+extern StructRNA RNA_ID;
+extern StructRNA RNA_IDProperty;
+extern StructRNA RNA_IDPropertyGroup;
+extern StructRNA RNA_Image;
+extern StructRNA RNA_ImageUser;
+extern StructRNA RNA_IntProperty;
+extern StructRNA RNA_Ipo;
+extern StructRNA RNA_IpoCurve;
+extern StructRNA RNA_IpoDriver;
+extern StructRNA RNA_JoystickSensor;
+extern StructRNA RNA_Key;
+extern StructRNA RNA_KeyBlock;
+extern StructRNA RNA_KeyboardSensor;
+extern StructRNA RNA_Lamp;
+extern StructRNA RNA_Lattice;
+extern StructRNA RNA_Library;
+extern StructRNA RNA_MCol;
+extern StructRNA RNA_MColLayer;
+extern StructRNA RNA_MEdge;
+extern StructRNA RNA_MFace;
+extern StructRNA RNA_MFloatProperty;
+extern StructRNA RNA_MFloatPropertyLayer;
+extern StructRNA RNA_MIntProperty;
+extern StructRNA RNA_MIntPropertyLayer;
+extern StructRNA RNA_MMultires;
+extern StructRNA RNA_MSticky;
+extern StructRNA RNA_MStringProperty;
+extern StructRNA RNA_MStringPropertyLayer;
+extern StructRNA RNA_MTFace;
+extern StructRNA RNA_MTFaceLayer;
+extern StructRNA RNA_MVert;
+extern StructRNA RNA_MVertGroup;
+extern StructRNA RNA_Main;
+extern StructRNA RNA_Material;
+extern StructRNA RNA_Mesh;
+extern StructRNA RNA_MessageSensor;
+extern StructRNA RNA_MetaBall;
+extern StructRNA RNA_MetaElement;
+extern StructRNA RNA_ModifierData;
+extern StructRNA RNA_MouseSensor;
+extern StructRNA RNA_NandController;
+extern StructRNA RNA_NearSensor;
+extern StructRNA RNA_Node;
+extern StructRNA RNA_NodeTree;
+extern StructRNA RNA_NorController;
+extern StructRNA RNA_Object;
+extern StructRNA RNA_Operator;
+extern StructRNA RNA_OrController;
+extern StructRNA RNA_PackedFile;
+extern StructRNA RNA_Panel;
+extern StructRNA RNA_PointerProperty;
+extern StructRNA RNA_Property;
+extern StructRNA RNA_PropertySensor;
+extern StructRNA RNA_PythonController;
+extern StructRNA RNA_RadarSensor;
+extern StructRNA RNA_Radiosity;
+extern StructRNA RNA_RandomSensor;
+extern StructRNA RNA_RaySensor;
+extern StructRNA RNA_Region;
+extern StructRNA RNA_Scene;
+extern StructRNA RNA_ScrArea;
+extern StructRNA RNA_ScrEdge;
+extern StructRNA RNA_ScrVert;
+extern StructRNA RNA_Screen;
+extern StructRNA RNA_Sensor;
+extern StructRNA RNA_StringProperty;
+extern StructRNA RNA_Struct;
+extern StructRNA RNA_TextBox;
+extern StructRNA RNA_TouchSensor;
+extern StructRNA RNA_UnknownType;
+extern StructRNA RNA_VectorFont;
+extern StructRNA RNA_WindowManager;
+extern StructRNA RNA_World;
+extern StructRNA RNA_XnorController;
+extern StructRNA RNA_XorController;
+
+/* Pointer
+ *
+ * These functions will fill in RNA pointers, this can be done in three ways:
+ * - a pointer Main is created by just passing the data pointer
+ * - a pointer to a datablock can be created with the type and id data pointer
+ * - a pointer to data contained in a datablock can be created with the id type
+ * and id data pointer, and the data type and pointer to the struct itself.
+ */
+
+void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr);
+void RNA_id_pointer_create(StructRNA *idtype, struct ID *id, PointerRNA *r_ptr);
+void RNA_pointer_create(StructRNA *idtype, struct ID *id, StructRNA *type, void *data, PointerRNA *r_ptr);
+
+/* Structs */
+
+const char *RNA_struct_identifier(PointerRNA *ptr);
+const char *RNA_struct_ui_name(PointerRNA *ptr);
+
+PropertyRNA *RNA_struct_name_property(PointerRNA *ptr);
+PropertyRNA *RNA_struct_iterator_property(PointerRNA *ptr);
+
+int RNA_struct_is_ID(PointerRNA *ptr);
+
+PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
+
+/* Properties
+ *
+ * Access to struct properties. All this works with RNA pointers rather than
+ * direct pointers to the data. */
+
+/* Property Information */
+
+const char *RNA_property_identifier(PointerRNA *ptr, PropertyRNA *prop);
+PropertyType RNA_property_type(PointerRNA *ptr, PropertyRNA *prop);
+PropertySubType RNA_property_subtype(PointerRNA *ptr, PropertyRNA *prop);
+
+int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop);
+
+void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax);
+void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step);
+
+void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax);
+void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision);
+
+int RNA_property_string_maxlength(PointerRNA *ptr, PropertyRNA *prop);
+
+void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem);
+int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
+int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier);
+
+
+const char *RNA_property_ui_name(PointerRNA *ptr, PropertyRNA *prop);
+const char *RNA_property_ui_description(PointerRNA *ptr, PropertyRNA *prop);
+
+int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop);
+int RNA_property_evaluated(PointerRNA *ptr, PropertyRNA *prop);
+
+void RNA_property_notify(PropertyRNA *prop, struct bContext *C, PointerRNA *ptr);
+
+/* Property Data */
+
+int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop);
+void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value);
+int RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int index);
+void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, int value);
+
+int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop);
+void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value);
+int RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int index);
+void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, int value);
+
+float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop);
+void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value);
+float RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, int index);
+void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, float value);
+
+void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value);
+char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen);
+int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop);
+void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value);
+
+int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop);
+void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value);
+
+void RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr);
+void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *ptr_value);
+
+void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter);
+void RNA_property_collection_next(CollectionPropertyIterator *iter);
+void RNA_property_collection_end(CollectionPropertyIterator *iter);
+int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop);
+int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr);
+int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr);
+
+/* Path
+ *
+ * Experimental method to refer to structs and properties with a string,
+ * using a syntax like: scenes[0].objects["Cube"].data.verts[7].co
+ *
+ * This provides a way to refer to RNA data while being detached from any
+ * particular pointers, which is useful in a number of applications, like
+ * UI code or Actions, though efficiency is a concern. */
+
+char *RNA_path_append(const char *path, PointerRNA *ptr, PropertyRNA *prop,
+ int intkey, const char *strkey);
+char *RNA_path_back(const char *path);
+
+int RNA_path_resolve(PointerRNA *ptr, const char *path,
+ PointerRNA *r_ptr, PropertyRNA **r_prop);
+
+#if 0
+/* Dependency
+ *
+ * Experimental code that will generate callbacks for each dependency
+ * between ID types. This may end up being useful for UI
+ * and evaluation code that needs to know such dependencies for correct
+ * redraws and re-evaluations. */
+
+typedef void (*PropDependencyCallback)(void *udata, PointerRNA *from, PointerRNA *to);
+void RNA_test_dependencies_cb(void *udata, PointerRNA *from, PointerRNA *to);
+
+void RNA_generate_dependencies(PointerRNA *mainptr, void *udata, PropDependencyCallback cb);
+#endif
+
+/* Quick name based property access
+ *
+ * These are just an easier way to access property values without having to
+ * call RNA_struct_find_property. The names have to exist as RNA properties
+ * for the type in the pointer, if they do not exist an error will be printed.
+ *
+ * There is no support for pointers and collections here yet, these can be
+ * added when ID properties support them. */
+
+int RNA_boolean_get(PointerRNA *ptr, const char *name);
+void RNA_boolean_set(PointerRNA *ptr, const char *name, int value);
+void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values);
+void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values);
+
+int RNA_int_get(PointerRNA *ptr, const char *name);
+void RNA_int_set(PointerRNA *ptr, const char *name, int value);
+void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values);
+void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values);
+
+float RNA_float_get(PointerRNA *ptr, const char *name);
+void RNA_float_set(PointerRNA *ptr, const char *name, float value);
+void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values);
+void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values);
+
+int RNA_enum_get(PointerRNA *ptr, const char *name);
+void RNA_enum_set(PointerRNA *ptr, const char *name, int value);
+
+void RNA_string_get(PointerRNA *ptr, const char *name, char *value);
+char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen);
+int RNA_string_length(PointerRNA *ptr, const char *name);
+void RNA_string_set(PointerRNA *ptr, const char *name, const char *value);
+
+/* check if the idproperty exists, for operators */
+int RNA_property_is_set(PointerRNA *ptr, const char *name);
+
+#endif /* RNA_ACCESS */
+
+
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
new file mode 100644
index 00000000000..c437b9a840f
--- /dev/null
+++ b/source/blender/makesrna/RNA_define.h
@@ -0,0 +1,94 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RNA_DEFINE_H
+#define RNA_DEFINE_H
+
+/* Functions used during preprocess and runtime, for defining the RNA. */
+
+#include "DNA_listBase.h"
+#include "RNA_types.h"
+
+/* Blender RNA */
+
+BlenderRNA *RNA_create(void);
+void RNA_define_free(BlenderRNA *brna);
+void RNA_free(BlenderRNA *brna);
+void RNA_exit(void);
+
+/* Struct */
+
+StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from, const char *name);
+void RNA_def_struct_sdna(StructRNA *srna, const char *structname);
+void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname);
+void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop);
+void RNA_def_struct_flag(StructRNA *srna, int flag);
+void RNA_def_struct_funcs(StructRNA *srna, const char *notify, const char *refine);
+void RNA_def_struct_identifier(StructRNA *srna, const char *identifier, const char *name);
+
+/* Property */
+
+PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, int subtype);
+
+void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit);
+void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit);
+void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname);
+void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname);
+
+void RNA_def_property_flag(PropertyRNA *prop, int flag);
+void RNA_def_property_array(PropertyRNA *prop, int arraylength);
+void RNA_def_property_range(PropertyRNA *prop, double min, double max);
+
+void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item);
+void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength);
+void RNA_def_property_struct_type(PropertyRNA *prop, const char *type);
+
+void RNA_def_property_boolean_default(PropertyRNA *prop, int value);
+void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array);
+void RNA_def_property_int_default(PropertyRNA *prop, int value);
+void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array);
+void RNA_def_property_float_default(PropertyRNA *prop, float value);
+void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array);
+void RNA_def_property_enum_default(PropertyRNA *prop, int value);
+void RNA_def_property_string_default(PropertyRNA *prop, const char *value);
+
+void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description);
+void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision);
+
+void RNA_def_property_funcs(PropertyRNA *prop, const char *notify, const char *editable);
+void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set);
+void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
+void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range);
+void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set);
+void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set);
+void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *type, const char *set);
+void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *type, const char *length, const char *lookupint, const char *lookupstring);
+
+#endif /* RNA_DEFINE_H */
+
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
new file mode 100644
index 00000000000..cb42e89ecd0
--- /dev/null
+++ b/source/blender/makesrna/RNA_types.h
@@ -0,0 +1,145 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RNA_TYPES
+#define RNA_TYPES
+
+struct PropertyRNA;
+struct StructRNA;
+struct BlenderRNA;
+
+/* Pointer
+ *
+ * RNA pointers are not a single C pointer but include the type,
+ * and a pointer to the ID struct that owns the struct, since
+ * in some cases this information is needed to correctly get/set
+ * the properties and validate them. */
+
+typedef struct PointerRNA {
+ struct {
+ struct StructRNA *type;
+ void *data;
+ } id;
+
+ struct StructRNA *type;
+ void *data;
+} PointerRNA;
+
+/* Property */
+
+typedef enum PropertyType {
+ PROP_BOOLEAN = 0,
+ PROP_INT = 1,
+ PROP_FLOAT = 2,
+ PROP_STRING = 3,
+ PROP_ENUM = 4,
+ PROP_POINTER = 5,
+ PROP_COLLECTION = 6
+} PropertyType;
+
+typedef enum PropertySubType {
+ PROP_NONE = 0,
+ PROP_UNSIGNED = 1,
+ PROP_FILEPATH = 2,
+ PROP_COLOR = 3,
+ PROP_VECTOR = 4,
+ PROP_MATRIX = 5,
+ PROP_ROTATION = 6
+} PropertySubType;
+
+typedef enum PropertyFlag {
+ /* editable means the property is editable in the user
+ * interface, evaluated means that the property is set
+ * as part of an evaluation. these can change at runtime
+ * the property flag contains the default. editable is
+ * enabled by default except for collections. */
+ PROP_NOT_EDITABLE = 1,
+ PROP_EVALUATED = 2,
+
+ /* driveable means the property can be driven by some
+ * other input, be it animation curves, expressions, ..
+ * in other words making the property evaluated.
+ * enable by default except for pointers and collections. */
+ PROP_NOT_DRIVEABLE = 4,
+
+#if 0
+ /* for pointers and collections, means that the struct
+ * depends on the data pointed to for evaluation, such
+ * that a change in the data pointed to will affect the
+ * evaluated result of this struct. */
+ PROP_EVALUATE_DEPENDENCY = 8,
+ PROP_INVERSE_EVALUATE_DEPENDENCY = 16,
+
+ /* for pointers and collections, means that the struct
+ * requires the data pointed to for rendering in the,
+ * be it the render engine or viewport */
+ PROP_RENDER_DEPENDENCY = 32,
+ PROP_INVERSE_RENDER_DEPENDENCY = 64,
+#endif
+
+ /* internal flags */
+ PROP_BUILTIN = 128,
+ PROP_EXPORT = 256,
+ PROP_RUNTIME = 512,
+ PROP_IDPROPERTY = 1024
+} PropertyFlag;
+
+typedef struct CollectionPropertyIterator {
+ PointerRNA parent;
+ struct PropertyRNA *prop;
+ void *internal;
+
+ int valid;
+ PointerRNA ptr;
+} CollectionPropertyIterator;
+
+typedef struct EnumPropertyItem {
+ int value;
+ const char *identifier;
+ const char *name;
+ const char *description;
+} EnumPropertyItem;
+
+typedef struct PropertyRNA PropertyRNA;
+
+/* Struct */
+
+typedef enum StructFlag {
+ /* indicates that this struct is an ID struct */
+ STRUCT_ID = 1,
+
+ /* internal flags */
+ STRUCT_RUNTIME = 2
+} StructFlag;
+
+typedef struct StructRNA StructRNA;
+
+/* Blender RNA
+ *
+ * Root RNA data structure that lists all struct types. */
+
+typedef struct BlenderRNA BlenderRNA;
+
+#endif /* RNA_TYPES */
+
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
new file mode 100644
index 00000000000..a580072895a
--- /dev/null
+++ b/source/blender/makesrna/SConscript
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+Import ('env')
+
+objs = []
+
+o = SConscript('intern/SConscript')
+objs += o
+
+incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .'
+
+env.BlenderLib ( 'bf_rna', objs, Split(incs), [], libtype=['common','intern'], priority = [95, 95] )
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
new file mode 100644
index 00000000000..067ca80b974
--- /dev/null
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -0,0 +1,34 @@
+# $Id: CMakeLists.txt 17433 2008-11-12 21:16:53Z blendix $
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+FILE(GLOB SRC *.c ../../../../intern/guardedalloc/intern/mallocn.c ../../../../intern/guardedalloc/intern/mmap_win.c)
+
+INCLUDE_DIRECTORIES(../../../../intern/guardedalloc ..)
+
+FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
+ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
+
+MESSAGE(STATUS "Configuring makesrna")
diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile
new file mode 100644
index 00000000000..0a1f10ed713
--- /dev/null
+++ b/source/blender/makesrna/intern/Makefile
@@ -0,0 +1,79 @@
+#
+# $Id: Makefile 13161 2008-01-07 19:13:47Z hos $
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Contributor(s): Blender Foundation (2008).
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+
+LIBNAME = rna
+DIR = $(OCGDIR)/blender/makesrna
+CSRCS = RNA.c $(wildcard rna_*.c)
+
+include nan_compile.mk
+
+CFLAGS += $(LEVEL_1_C_WARNINGS)
+
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I..
+CPPFLAGS += -I.
+
+ifeq ($(OS),windows)
+ # Windows needs these extra libs because of winstuff... It is not
+ # _really_ needed, but it is the easiest fix for now. If you have
+ # some spare time, try to trace down the exact dep.
+ ifneq ($(FREE_WINDOWS),true)
+ WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
+ WINLIBS += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
+ WINLIBS += winmm.lib opengl32.lib glu32.lib largeint.lib
+ WINLIBS += /link /nodefaultlib:libc
+ else
+ LDFLAGS += -mwindows -mno-cygwin
+ endif
+endif
+
+clean::
+ @$(RM) $(DIR)/makesrna* $(DIR)/RNA.c
+ @$(RM) $(DIR)/debug/makesrna* $(DIR)/debug/RNA.c
+
+# TODO include right .mk for ldflags
+
+# A small note: we do not use the debug version of the alloc lib. That
+# is done quite intentionally. If there is a bug in that lib, it needs
+# to be fixed by the module maintainer.
+
+RNAOBJS = $(filter-out %rna_dependency.o, $(filter-out %rna_access.o, $(filter-out %RNA.o, $(OBJS))))
+
+$(DIR)/$(DEBUG_DIR)makesrna: $(RNAOBJS) $(DIR)/$(DEBUG_DIR)makesrna.o $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)libdna.a $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
+ $(CC) $(LDFLAGS) -o $@ $(WINLIBS) $^
+
+$(DIR)/$(DEBUG_DIR)RNA.c: $(DIR)/$(DEBUG_DIR)makesrna
+ ifeq ($(OS),windows)
+ $(SRCHOME)/tools/cygwin/cl_wrapper.pl - $(DIR)/$(DEBUG_DIR)makesrna \
+ $(DIR)/$(DEBUG_DIR)RNA.c
+ else
+ $(DIR)/$(DEBUG_DIR)makesrna $(DIR)/$(DEBUG_DIR)RNA.c
+ endif
+
+$(DIR)/$(DEBUG_DIR)makesrna.o: makesrna.c $(wildcard rna_*.c)
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) makesrna.c -o $@
+
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
new file mode 100644
index 00000000000..93d91a3afa6
--- /dev/null
+++ b/source/blender/makesrna/intern/SConscript
@@ -0,0 +1,68 @@
+#!/usr/bin/python
+import sys
+import os
+
+Import ('env')
+cflags = ''
+defines = []
+root_build_dir=env['BF_BUILDDIR']
+
+source_files = env.Glob('*.c')
+
+# making rna_access.c part of both makesrna and blender seems to
+# give conflict, how to solve?
+source_files.remove('rna_access.c')
+source_files.remove('rna_dependency.c')
+
+makesrna_tool = env.Clone()
+rna = env.Clone()
+makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ')
+
+makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
+ '../../blenlib',
+ '../../blenkernel',
+ '../../makesdna',
+ '../../makesrna'])
+
+if env['OURPLATFORM'] == 'linuxcross':
+ makesrna_tool.Replace(CC='gcc')
+ makesrna_tool.Replace(AR='ar')
+ makesrna_tool.Replace(LINK='gcc')
+
+if sys.platform != 'cygwin':
+ makesrna_tool.Append (CCFLAGS = cflags)
+makesrna_tool.Append (CPPDEFINES = defines)
+
+libdir = root_build_dir+'/lib'
+if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
+ libdir = '#' + libdir
+
+makesrna_tool.Append (LIBPATH = libdir)
+
+if env['BF_PROFILE']:
+ makesrna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS'])
+
+if env['BF_DEBUG']:
+ makesrna_tool.Append(CFLAGS = env['BF_DEBUG_CFLAGS'])
+ makesrna_tool.Append(CCFLAGS = env['BF_DEBUG_CCFLAGS'])
+ if env['OURPLATFORM'] == 'win32-vc':
+ makesrna_tool.Append(LINKFLAGS = ['/DEBUG','/PDB:makesrna.pdb'])
+
+targetpath = root_build_dir+'/makesrna'
+if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
+ targetpath = '#' + targetpath
+
+if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
+ makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
+else:
+ makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
+
+rna_dict = rna.Dictionary()
+rna.Depends ('rna.c', makesrna)
+if env['OURPLATFORM'] != 'linuxcross':
+ rna.Command ('rna.c', '', root_build_dir+os.sep+"makesrna $TARGET")
+else:
+ rna.Command ('rna.c', '', root_build_dir+os.sep+"makesrna.exe $TARGET")
+obj = ['intern/rna.c', 'intern/rna_access.c', 'intern/rna_dependency.c']
+Return ('obj')
+
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
new file mode 100644
index 00000000000..37af9abc08b
--- /dev/null
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -0,0 +1,1040 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <float.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#define RNA_VERSION_DATE "$Id$"
+
+#ifdef _WIN32
+#ifndef snprintf
+#define snprintf _snprintf
+#endif
+#endif
+
+/* Sorting */
+
+int cmp_struct(const void *a, const void *b)
+{
+ const StructRNA *structa= *(const StructRNA**)a;
+ const StructRNA *structb= *(const StructRNA**)b;
+
+ return strcmp(structa->identifier, structb->identifier);
+}
+
+int cmp_property(const void *a, const void *b)
+{
+ const PropertyRNA *propa= *(const PropertyRNA**)a;
+ const PropertyRNA *propb= *(const PropertyRNA**)b;
+
+ if(strcmp(propa->identifier, "rna_type") == 0) return -1;
+ else if(strcmp(propb->identifier, "rna_type") == 0) return 1;
+
+ if(strcmp(propa->identifier, "name") == 0) return -1;
+ else if(strcmp(propb->identifier, "name") == 0) return 1;
+
+ return strcmp(propa->name, propb->name);
+}
+
+void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*))
+{
+ Link *link;
+ void **array;
+ int a, size;
+
+ if(listbase->first == listbase->last)
+ return;
+
+ for(size=0, link=listbase->first; link; link=link->next)
+ size++;
+
+ array= MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
+ for(a=0, link=listbase->first; link; link=link->next, a++)
+ array[a]= link;
+
+ qsort(array, size, sizeof(void*), cmp);
+
+ listbase->first= listbase->last= NULL;
+ for(a=0; a<size; a++) {
+ link= array[a];
+ link->next= link->prev= NULL;
+ rna_addtail(listbase, link);
+ }
+
+ MEM_freeN(array);
+}
+
+/* Preprocessing */
+
+static void rna_print_c_string(FILE *f, const char *str)
+{
+ static char *escape[] = {"\''", "\"\"", "\??", "\\\\","\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL};
+ int i, j;
+
+ fprintf(f, "\"");
+ for(i=0; str[i]; i++) {
+ for(j=0; escape[j]; j++)
+ if(str[i] == escape[j][0])
+ break;
+
+ if(escape[j]) fprintf(f, "\\%c", escape[j][1]);
+ else fprintf(f, "%c", str[i]);
+ }
+ fprintf(f, "\"");
+}
+
+static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
+{
+ if(dp->dnastructfromname && dp->dnastructfromprop)
+ fprintf(f, " %s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname, dp->dnastructfromname, dp->dnastructfromprop);
+ else
+ fprintf(f, " %s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
+}
+
+static char *rna_alloc_function_name(const char *structname, const char *propname, const char *type)
+{
+ AllocDefRNA *alloc;
+ char buffer[2048];
+ char *result;
+
+ snprintf(buffer, sizeof(buffer), "rna_%s_%s_%s", structname, propname, type);
+ result= MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name");
+ strcpy(result, buffer);
+
+ alloc= MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA");
+ alloc->mem= result;
+ rna_addtail(&DefRNA.allocs, alloc);
+
+ return result;
+}
+
+static const char *rna_type_type(PropertyRNA *prop)
+{
+ switch(prop->type) {
+ case PROP_BOOLEAN:
+ case PROP_INT:
+ case PROP_ENUM:
+ return "int";
+ case PROP_FLOAT:
+ return "float";
+ case PROP_STRING:
+ return "char*";
+ default:
+ return "void*";
+ }
+}
+
+static int rna_enum_bitmask(PropertyRNA *prop)
+{
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ int a, mask= 0;
+
+ for(a=0; a<eprop->totitem; a++)
+ mask |= eprop->item[a].value;
+
+ return mask;
+}
+
+static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp)
+{
+ char *func;
+
+ if(prop->flag & PROP_IDPROPERTY)
+ return NULL;
+
+ if(!dp->dnastructname || !dp->dnaname) {
+ fprintf(stderr, "rna_def_property_get_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ if(prop->type == PROP_STRING && ((StringPropertyRNA*)prop)->maxlength == 0) {
+ fprintf(stderr, "rna_def_property_get_func: string %s.%s has max length 0.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ func= rna_alloc_function_name(srna->identifier, prop->identifier, "get");
+
+ switch(prop->type) {
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ fprintf(f, "static void %s(PointerRNA *ptr, char *value)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ fprintf(f, " BLI_strncpy(value, data->%s, %d);\n", dp->dnaname, sprop->maxlength);
+ fprintf(f, "}\n\n");
+ break;
+ }
+ default:
+ if(prop->arraylength) {
+ fprintf(f, "static %s %s(PointerRNA *ptr, int index)\n", rna_type_type(prop), func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(dp->dnaarraylength == 1) {
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit)
+ fprintf(f, " return (%s(data->%s & (%d<<index)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ else
+ fprintf(f, " return (%s)%s((&data->%s)[index]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
+ }
+ else {
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit)
+ fprintf(f, " return (%s(data->%s[index] & %d) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ else
+ fprintf(f, " return (%s)%s(data->%s[index]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
+ }
+ fprintf(f, "}\n\n");
+ }
+ else {
+ fprintf(f, "static %s %s(PointerRNA *ptr)\n", rna_type_type(prop), func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit)
+ fprintf(f, " return (%s((data->%s) & %d) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ else if(prop->type == PROP_ENUM && dp->enumbitflags)
+ fprintf(f, " return ((data->%s) & %d);\n", dp->dnaname, rna_enum_bitmask(prop));
+ else if(prop->type == PROP_POINTER && dp->dnapointerlevel == 0)
+ fprintf(f, " return (%s)&(data->%s);\n", rna_type_type(prop), dp->dnaname);
+ else
+ fprintf(f, " return (%s)%s(data->%s);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
+ fprintf(f, "}\n\n");
+ }
+ break;
+ }
+
+ return func;
+}
+
+static const char *rna_function_string(void *func)
+{
+ return (func)? (const char*)func: "NULL";
+}
+
+static void rna_float_print(FILE *f, float num)
+{
+ if(num == -FLT_MAX) fprintf(f, "-FLT_MAX");
+ else if(num == FLT_MAX) fprintf(f, "FLT_MAX");
+ else if((int)num == num) fprintf(f, "%.1ff", num);
+ else fprintf(f, "%.10ff", num);
+}
+
+static void rna_int_print(FILE *f, int num)
+{
+ if(num == INT_MIN) fprintf(f, "INT_MIN");
+ else if(num == INT_MAX) fprintf(f, "INT_MAX");
+ else fprintf(f, "%d", num);
+}
+
+static void rna_clamp_value(FILE *f, PropertyRNA *prop)
+{
+ if(prop->type == PROP_INT) {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+
+ if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
+ fprintf(f, " CLAMP(value, ");
+ rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
+ rna_int_print(f, iprop->hardmax); fprintf(f, ");\n");
+ }
+ }
+ else if(prop->type == PROP_FLOAT) {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+
+ if(fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
+ fprintf(f, " CLAMP(value, ");
+ rna_float_print(f, fprop->hardmin); fprintf(f, ", ");
+ rna_float_print(f, fprop->hardmax); fprintf(f, ");\n");
+ }
+ }
+}
+
+static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp)
+{
+ char *func;
+
+ if(prop->flag & PROP_IDPROPERTY)
+ return NULL;
+
+ if(!dp->dnastructname || !dp->dnaname) {
+ if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ fprintf(stderr, "rna_def_property_set_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ return NULL;
+ }
+
+ func= rna_alloc_function_name(srna->identifier, prop->identifier, "set");
+
+ switch(prop->type) {
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ fprintf(f, "static void %s(PointerRNA *ptr, const char *value)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ fprintf(f, " BLI_strncpy(data->%s, value, %d);\n", dp->dnaname, sprop->maxlength);
+ fprintf(f, "}\n\n");
+ break;
+ }
+ default:
+ if(prop->arraylength) {
+ fprintf(f, "static void %s(PointerRNA *ptr, int index, %s value)\n", func, rna_type_type(prop));
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(dp->dnaarraylength == 1) {
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ fprintf(f, " if(%svalue) data->%s |= (%d<<index);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ fprintf(f, " else data->%s &= ~(%d<<index);\n", dp->dnaname, dp->booleanbit);
+ }
+ else {
+ rna_clamp_value(f, prop);
+ fprintf(f, " (&data->%s)[index]= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": "");
+ }
+ }
+ else {
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ fprintf(f, " if(%svalue) data->%s[index] |= %d;\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ fprintf(f, " else data->%s[index] &= ~%d;\n", dp->dnaname, dp->booleanbit);
+ }
+ else {
+ rna_clamp_value(f, prop);
+ fprintf(f, " data->%s[index]= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": "");
+ }
+ }
+ fprintf(f, "}\n\n");
+ }
+ else {
+ fprintf(f, "static void %s(PointerRNA *ptr, %s value)\n", func, rna_type_type(prop));
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+ fprintf(f, " if(%svalue) data->%s |= %d;\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
+ fprintf(f, " else data->%s &= ~%d;\n", dp->dnaname, dp->booleanbit);
+ }
+ else if(prop->type == PROP_ENUM && dp->enumbitflags) {
+ fprintf(f, " data->%s &= ~%d;\n", dp->dnaname, rna_enum_bitmask(prop));
+ fprintf(f, " data->%s |= value;\n", dp->dnaname);
+ }
+ else {
+ rna_clamp_value(f, prop);
+ fprintf(f, " data->%s= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": "");
+ }
+ fprintf(f, "}\n\n");
+ }
+ break;
+ }
+
+ return func;
+}
+
+static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp)
+{
+ char *func= NULL;
+
+ if(prop->flag & PROP_IDPROPERTY)
+ return NULL;
+
+ if(prop->type == PROP_STRING) {
+ if(!dp->dnastructname || !dp->dnaname) {
+ fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ func= rna_alloc_function_name(srna->identifier, prop->identifier, "length");
+
+ fprintf(f, "static int %s(PointerRNA *ptr)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ fprintf(f, " return strlen(data->%s);\n", dp->dnaname);
+ fprintf(f, "}\n\n");
+ }
+ else if(prop->type == PROP_COLLECTION) {
+ if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
+ fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ func= rna_alloc_function_name(srna->identifier, prop->identifier, "length");
+
+ fprintf(f, "static int %s(PointerRNA *ptr)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(dp->dnalengthname)
+ fprintf(f, " return (data->%s == NULL)? 0: data->%s;\n", dp->dnaname, dp->dnalengthname);
+ else
+ fprintf(f, " return (data->%s == NULL)? 0: %d;\n", dp->dnaname, dp->dnalengthfixed);
+ fprintf(f, "}\n\n");
+ }
+
+ return func;
+}
+
+static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp)
+{
+ char *func;
+
+ if(prop->flag & PROP_IDPROPERTY)
+ return NULL;
+
+ if(!dp->dnastructname || !dp->dnaname) {
+ fprintf(stderr, "rna_def_property_begin_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ func= rna_alloc_function_name(srna->identifier, prop->identifier, "begin");
+
+ if(dp->dnalengthname || dp->dnalengthfixed) {
+ fprintf(f, "static void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ if(dp->dnalengthname)
+ fprintf(f, " rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthname);
+ else
+ fprintf(f, " rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthfixed);
+ fprintf(f, "}\n\n");
+ }
+ else {
+ fprintf(f, "static void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
+ fprintf(f, "{\n");
+ rna_print_data_get(f, dp);
+ fprintf(f, " rna_iterator_listbase_begin(iter, &data->%s, NULL);\n", dp->dnaname);
+ fprintf(f, "}\n\n");
+ }
+
+ return func;
+}
+
+static void rna_def_property_funcs(FILE *f, PropertyDefRNA *dp)
+{
+ PropertyRNA *prop;
+ StructRNA *srna;
+
+ srna= dp->srna;
+ prop= dp->prop;
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+
+ if(!prop->arraylength) {
+ if(!bprop->get) bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!bprop->set) bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ else {
+ if(!bprop->getarray) bprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!bprop->setarray) bprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ break;
+ }
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+
+ if(!prop->arraylength) {
+ if(!iprop->get) iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!iprop->set) iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ else {
+ if(!iprop->getarray) iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!iprop->setarray) iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+
+ if(!prop->arraylength) {
+ if(!fprop->get) fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!fprop->set) fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ else {
+ if(!fprop->getarray) fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!fprop->setarray) fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ }
+ break;
+ }
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+
+ if(!eprop->get) eprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!eprop->set) eprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ break;
+ }
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+
+ if(!sprop->get) sprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!sprop->length) sprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp);
+ if(!sprop->set) sprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ break;
+ }
+ case PROP_POINTER: {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+
+ if(!pprop->get) pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp);
+ if(!pprop->set) pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp);
+ if(!pprop->structtype && !pprop->type) {
+ fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have either type function or fixed type.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ break;
+ }
+ case PROP_COLLECTION: {
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(dp->dnatype && strcmp(dp->dnatype, "ListBase")==0) {
+ if(!cprop->begin)
+ cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp);
+ }
+ else if(dp->dnalengthname || dp->dnalengthfixed) {
+ if(!cprop->begin)
+ cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp);
+ if(!cprop->length)
+ cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp);
+ }
+
+ if(!cprop->begin) {
+ fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a begin function.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ if(!cprop->next) {
+ fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a next function.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ if(!cprop->get) {
+ fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a get function.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ if(!cprop->structtype && !cprop->type) {
+ fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have either type function or fixed type.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ break;
+ }
+ }
+}
+
+static const char *rna_find_type(const char *type)
+{
+ StructDefRNA *ds;
+
+ for(ds=DefRNA.structs.first; ds; ds=ds->next)
+ if(ds->dnaname && strcmp(ds->dnaname, type)==0)
+ return ds->srna->identifier;
+
+ return NULL;
+}
+
+static void rna_auto_types()
+{
+ StructDefRNA *ds;
+ PropertyDefRNA *dp;
+
+ for(ds=DefRNA.structs.first; ds; ds=ds->next) {
+ for(dp=ds->properties.first; dp; dp=dp->next) {
+ if(dp->dnatype) {
+ if(dp->prop->type == PROP_POINTER) {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+
+ if(!pprop->structtype && !pprop->type)
+ pprop->structtype= (StructRNA*)rna_find_type(dp->dnatype);
+ }
+ else if(dp->prop->type== PROP_COLLECTION) {
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+
+ if(!cprop->structtype && !cprop->type && strcmp(dp->dnatype, "ListBase")==0)
+ cprop->structtype= (StructRNA*)rna_find_type(dp->dnatype);
+ }
+ }
+ }
+ }
+}
+
+static void rna_auto_functions(FILE *f)
+{
+ StructDefRNA *ds;
+ PropertyDefRNA *dp;
+
+ fprintf(f, "/* Autogenerated Functions */\n\n");
+
+ for(ds=DefRNA.structs.first; ds; ds=ds->next)
+ for(dp=ds->properties.first; dp; dp=dp->next)
+ rna_def_property_funcs(f, dp);
+}
+
+static void rna_sort(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ rna_sortlist(&brna->structs, cmp_struct);
+
+ for(srna=brna->structs.first; srna; srna=srna->next)
+ rna_sortlist(&srna->properties, cmp_property);
+}
+
+static const char *rna_property_structname(PropertyType type)
+{
+ switch(type) {
+ case PROP_BOOLEAN: return "BooleanPropertyRNA";
+ case PROP_INT: return "IntPropertyRNA";
+ case PROP_FLOAT: return "FloatPropertyRNA";
+ case PROP_STRING: return "StringPropertyRNA";
+ case PROP_ENUM: return "EnumPropertyRNA";
+ case PROP_POINTER: return "PointerPropertyRNA";
+ case PROP_COLLECTION: return "CollectionPropertyRNA";
+ default: return "UnknownPropertyRNA";
+ }
+}
+
+static const char *rna_property_typename(PropertyType type)
+{
+ switch(type) {
+ case PROP_BOOLEAN: return "PROP_BOOLEAN";
+ case PROP_INT: return "PROP_INT";
+ case PROP_FLOAT: return "PROP_FLOAT";
+ case PROP_STRING: return "PROP_STRING";
+ case PROP_ENUM: return "PROP_ENUM";
+ case PROP_POINTER: return "PROP_POINTER";
+ case PROP_COLLECTION: return "PROP_COLLECTION";
+ default: return "PROP_UNKNOWN";
+ }
+}
+
+static const char *rna_property_subtypename(PropertyType type)
+{
+ switch(type) {
+ case PROP_NONE: return "PROP_NONE";
+ case PROP_UNSIGNED: return "PROP_UNSIGNED";
+ case PROP_FILEPATH: return "PROP_FILEPATH";
+ case PROP_COLOR: return "PROP_COLOR";
+ case PROP_VECTOR: return "PROP_VECTOR";
+ case PROP_MATRIX: return "PROP_MATRIX";
+ case PROP_ROTATION: return "PROP_ROTATION";
+ default: return "PROP_UNKNOWN";
+ }
+}
+
+static void rna_generate_prototypes(BlenderRNA *brna, FILE *f)
+{
+ StructRNA *srna;
+
+ for(srna=brna->structs.first; srna; srna=srna->next)
+ fprintf(f, "StructRNA RNA_%s;\n", srna->identifier);
+ fprintf(f, "\n");
+
+ fprintf(f, "BlenderRNA BLENDER_RNA = {");
+
+ srna= brna->structs.first;
+ if(srna) fprintf(f, "{&RNA_%s, ", srna->identifier);
+ else fprintf(f, "{NULL, ");
+
+ srna= brna->structs.last;
+ if(srna) fprintf(f, "&RNA_%s}", srna->identifier);
+ else fprintf(f, "NULL}");
+
+ fprintf(f, "};\n\n");
+}
+
+static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
+{
+ PropertyRNA *prop;
+
+ fprintf(f, "/* %s */\n", srna->name);
+
+ if(srna->properties.first)
+ fprintf(f, "\n");
+
+ for(prop=srna->properties.first; prop; prop=prop->next)
+ fprintf(f, "%s%s rna_%s_%s;\n", (prop->flag & PROP_EXPORT)? "": "static ", rna_property_structname(prop->type), srna->identifier, prop->identifier);
+ fprintf(f, "\n");
+
+ for(prop=srna->properties.first; prop; prop=prop->next) {
+ switch(prop->type) {
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ int i;
+
+ if(eprop->item) {
+ fprintf(f, "static EnumPropertyItem rna_%s_%s_items[%d] = {", srna->identifier, prop->identifier, eprop->totitem);
+
+ for(i=0; i<eprop->totitem; i++) {
+ fprintf(f, "{%d, ", eprop->item[i].value);
+ rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", ");
+ rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", ");
+ rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}");
+ if(i != eprop->totitem-1)
+ fprintf(f, ", ");
+ }
+
+ fprintf(f, "};\n\n");
+ }
+ else {
+ fprintf(stderr, "rna_generate_structs: %s.%s, enum must have items defined.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ break;
+ }
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ unsigned int i;
+
+ if(prop->arraylength) {
+ fprintf(f, "static int rna_%s_%s_default[%d] = {", srna->identifier, prop->identifier, prop->arraylength);
+
+ for(i=0; i<prop->arraylength; i++) {
+ if(bprop->defaultarray)
+ fprintf(f, "%d", bprop->defaultarray[i]);
+ else
+ fprintf(f, "%d", bprop->defaultvalue);
+ if(i != prop->arraylength-1)
+ fprintf(f, ", ");
+ }
+
+ fprintf(f, "};\n\n");
+ }
+ break;
+ }
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ unsigned int i;
+
+ if(prop->arraylength) {
+ fprintf(f, "static int rna_%s_%s_default[%d] = {", srna->identifier, prop->identifier, prop->arraylength);
+
+ for(i=0; i<prop->arraylength; i++) {
+ if(iprop->defaultarray)
+ fprintf(f, "%d", iprop->defaultarray[i]);
+ else
+ fprintf(f, "%d", iprop->defaultvalue);
+ if(i != prop->arraylength-1)
+ fprintf(f, ", ");
+ }
+
+ fprintf(f, "};\n\n");
+ }
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ unsigned int i;
+
+ if(prop->arraylength) {
+ fprintf(f, "static float rna_%s_%s_default[%d] = {", srna->identifier, prop->identifier, prop->arraylength);
+
+ for(i=0; i<prop->arraylength; i++) {
+ if(fprop->defaultarray)
+ rna_float_print(f, fprop->defaultarray[i]);
+ else
+ rna_float_print(f, fprop->defaultvalue);
+ if(i != prop->arraylength-1)
+ fprintf(f, ", ");
+ }
+
+ fprintf(f, "};\n\n");
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ fprintf(f, "%s%s rna_%s_%s = {\n", (prop->flag & PROP_EXPORT)? "": "static ", rna_property_structname(prop->type), srna->identifier, prop->identifier);
+
+ if(prop->next) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->next->identifier);
+ else fprintf(f, "\t{NULL, ");
+ if(prop->prev) fprintf(f, "(PropertyRNA*)&rna_%s_%s,\n", srna->identifier, prop->prev->identifier);
+ else fprintf(f, "NULL,\n");
+ fprintf(f, "\t%d, ", prop->magic);
+ rna_print_c_string(f, prop->identifier);
+ fprintf(f, ", %d, ", prop->flag);
+ rna_print_c_string(f, prop->name); fprintf(f, ",\n\t");
+ rna_print_c_string(f, prop->description); fprintf(f, ",\n");
+ fprintf(f, "\t%s, %s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), prop->arraylength);
+ fprintf(f, "\t%s, %s},\n", rna_function_string(prop->notify), rna_function_string(prop->editable));
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), rna_function_string(bprop->set), rna_function_string(bprop->getarray), rna_function_string(bprop->setarray), bprop->defaultvalue);
+ if(prop->arraylength) fprintf(f, "rna_%s_%s_default\n", srna->identifier, prop->identifier);
+ else fprintf(f, "NULL\n");
+ break;
+ }
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range));
+ rna_int_print(f, iprop->softmin); fprintf(f, ", ");
+ rna_int_print(f, iprop->softmax); fprintf(f, ", ");
+ rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
+ rna_int_print(f, iprop->hardmax); fprintf(f, ", ");
+ rna_int_print(f, iprop->step); fprintf(f, ", ");
+ rna_int_print(f, iprop->defaultvalue); fprintf(f, ", ");
+ if(prop->arraylength) fprintf(f, "rna_%s_%s_default\n", srna->identifier, prop->identifier);
+ else fprintf(f, "NULL\n");
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range));
+ rna_float_print(f, fprop->softmin); fprintf(f, ", ");
+ rna_float_print(f, fprop->softmax); fprintf(f, ", ");
+ rna_float_print(f, fprop->hardmin); fprintf(f, ", ");
+ rna_float_print(f, fprop->hardmax); fprintf(f, ", ");
+ rna_float_print(f, fprop->step); fprintf(f, ", ");
+ rna_float_print(f, fprop->precision); fprintf(f, ", ");
+ rna_float_print(f, fprop->defaultvalue); fprintf(f, ", ");
+ if(prop->arraylength) fprintf(f, "rna_%s_%s_default\n", srna->identifier, prop->identifier);
+ else fprintf(f, "NULL\n");
+ break;
+ }
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength);
+ rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n");
+ break;
+ }
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, rna_%s_%s_items, %d, %d\n", rna_function_string(eprop->get), rna_function_string(eprop->set), srna->identifier, prop->identifier, eprop->totitem, eprop->defaultvalue);
+ break;
+ }
+ case PROP_POINTER: {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, ", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->type));
+ if(pprop->structtype) fprintf(f, "&RNA_%s\n", (char*)pprop->structtype);
+ else fprintf(f, "NULL\n");
+ break;
+ }
+ case PROP_COLLECTION: {
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->type), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring));
+ if(cprop->structtype) fprintf(f, "&RNA_%s\n", (char*)cprop->structtype);
+ else fprintf(f, "NULL\n");
+ break;
+ }
+ }
+
+ fprintf(f, "};\n\n");
+ }
+
+ fprintf(f, "StructRNA RNA_%s = {\n", srna->identifier);
+
+ if(srna->next) fprintf(f, "\t&RNA_%s, ", srna->next->identifier);
+ else fprintf(f, "\tNULL, ");
+ if(srna->prev) fprintf(f, "&RNA_%s,\n", srna->prev->identifier);
+ else fprintf(f, "NULL,\n");
+
+ fprintf(f, "\t");
+ rna_print_c_string(f, srna->identifier);
+ fprintf(f, ", %d, ", srna->flag);
+ rna_print_c_string(f, srna->name);
+ fprintf(f, ",\n");
+
+ prop= srna->nameproperty;
+ if(prop) fprintf(f, "\t(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
+ else fprintf(f, "\tNULL, ");
+
+ fprintf(f, "(PropertyRNA*)&rna_%s_rna_properties,\n", srna->identifier);
+
+ if(srna->from) fprintf(f, "\t&RNA_%s,\n", (char*)srna->from);
+ else fprintf(f, "\tNULL,\n");
+
+ fprintf(f, "\t%s, %s,\n", rna_function_string(srna->notify), rna_function_string(srna->refine));
+
+ prop= srna->properties.first;
+ if(prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
+ else fprintf(f, "\t{NULL, ");
+
+ prop= srna->properties.last;
+ if(prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}\n", srna->identifier, prop->identifier);
+ else fprintf(f, "NULL}\n");
+
+ fprintf(f, "};\n");
+
+ fprintf(f, "\n");
+}
+
+typedef struct RNAProcessItem {
+ char *filename;
+ void (*define)(BlenderRNA *brna);
+} RNAProcessItem;
+
+RNAProcessItem PROCESS_ITEMS[]= {
+ {"rna_ID.c", RNA_def_ID},
+ {"rna_actuator.c", RNA_def_actuator},
+ {"rna_armature.c", RNA_def_armature},
+ {"rna_brush.c", RNA_def_brush},
+ {"rna_camera.c", RNA_def_camera},
+ {"rna_color.c", RNA_def_color},
+ {"rna_constraint.c", RNA_def_constraint},
+ {"rna_controller.c", RNA_def_controller},
+ {"rna_curve.c", RNA_def_curve},
+ {"rna_group.c", RNA_def_group},
+ {"rna_image.c", RNA_def_image},
+ {"rna_ipo.c", RNA_def_ipo},
+ {"rna_key.c", RNA_def_key},
+ {"rna_lamp.c", RNA_def_lamp},
+ {"rna_lattice.c", RNA_def_lattice},
+ {"rna_main.c", RNA_def_main},
+ {"rna_material.c", RNA_def_material},
+ {"rna_mesh.c", RNA_def_mesh},
+ {"rna_meta.c", RNA_def_meta},
+ {"rna_modifier.c", RNA_def_modifier},
+ {"rna_nodetree.c", RNA_def_nodetree},
+ {"rna_object.c", RNA_def_object},
+ {"rna_packedfile.c", RNA_def_packedfile},
+ {"rna_property.c", RNA_def_gameproperty},
+ {"rna_radio.c", RNA_def_radio},
+ {"rna_rna.c", RNA_def_rna},
+ {"rna_scene.c", RNA_def_scene},
+ {"rna_screen.c", RNA_def_screen},
+ {"rna_sensor.c", RNA_def_sensor},
+ {"rna_vfont.c", RNA_def_vfont},
+ {"rna_wm.c", RNA_def_wm},
+ {"rna_world.c", RNA_def_world},
+ {NULL, NULL}};
+
+static int rna_preprocess(char *basedirectory, FILE *f)
+{
+ BlenderRNA *brna;
+ StructRNA *srna;
+ int i, status;
+
+ fprintf(f, "\n/* Automatically generated struct definitions for the Data API.\n"
+ " Do not edit manually, changes will be overwritten */\n\n"
+ "#define RNA_RUNTIME\n\n");
+
+ brna= RNA_create();
+
+ fprintf(f, "#include <float.h>\n");
+ fprintf(f, "#include <limits.h>\n");
+ fprintf(f, "#include <string.h>\n\n");
+
+ fprintf(f, "#include \"BLI_blenlib.h\"\n\n");
+
+ fprintf(f, "#include \"BKE_utildefines.h\"\n\n");
+
+ fprintf(f, "#include \"RNA_define.h\"\n");
+ fprintf(f, "#include \"RNA_types.h\"\n");
+ fprintf(f, "#include \"rna_internal.h\"\n\n");
+
+ /* this is ugly, but we cannot have c files compiled for both
+ * makesrna and blender with some build systems at the moment */
+ fprintf(f, "#include \"rna_define.c\"\n\n");
+
+ for(i=0; PROCESS_ITEMS[i].filename; i++)
+ if(PROCESS_ITEMS[i].define)
+ PROCESS_ITEMS[i].define(brna);
+
+ rna_sort(brna);
+ rna_auto_types();
+
+ rna_generate_prototypes(brna, f);
+
+ for(i=0; PROCESS_ITEMS[i].filename; i++)
+ fprintf(f, "#include \"%s\"\n", PROCESS_ITEMS[i].filename);
+ fprintf(f, "\n");
+
+ rna_auto_functions(f);
+
+ for(srna=brna->structs.first; srna; srna=srna->next)
+ rna_generate_struct(brna, srna, f);
+
+ status= DefRNA.error;
+
+ RNA_define_free(brna);
+ RNA_free(brna);
+
+ return status;
+}
+
+static void make_bad_file(char *file)
+{
+ FILE *fp= fopen(file, "w");
+ fprintf(fp, "ERROR! Cannot make correct RNA.c file, STUPID!\n");
+ fclose(fp);
+}
+
+#ifndef BASE_HEADER
+#define BASE_HEADER "../"
+#endif
+
+int main(int argc, char **argv)
+{
+ FILE *file;
+ int totblock, return_status = 0;
+
+ if (argc!=2 && argc!=3) {
+ printf("Usage: %s outfile.c [base directory]\n", argv[0]);
+ return_status = 1;
+ }
+ else {
+ file = fopen(argv[1], "w");
+
+ if (!file) {
+ printf ("Unable to open file: %s\n", argv[1]);
+ return_status = 1;
+ }
+ else {
+ char baseDirectory[256];
+
+ printf("Running makesrna, program versions %s\n", RNA_VERSION_DATE);
+
+ if (argc==3)
+ strcpy(baseDirectory, argv[2]);
+ else
+ strcpy(baseDirectory, BASE_HEADER);
+
+ return_status= (rna_preprocess(baseDirectory, file));
+ fclose(file);
+
+ if(return_status) {
+ /* error */
+ make_bad_file(argv[1]);
+ return_status = 1;
+ }
+ }
+ }
+
+ totblock= MEM_get_memory_blocks_in_use();
+ if(totblock!=0) {
+ printf("Error Totblock: %d\n",totblock);
+ MEM_printmemlist();
+ }
+
+ return return_status;
+}
+
+
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
new file mode 100644
index 00000000000..35d59bad826
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -0,0 +1,207 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "DNA_ID.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_idprop.h"
+
+/* name functions that ignore the first two ID characters */
+static void rna_ID_name_get(PointerRNA *ptr, char *value)
+{
+ ID *id= (ID*)ptr->data;
+ BLI_strncpy(value, id->name+2, sizeof(id->name)-2);
+}
+
+static int rna_ID_name_length(PointerRNA *ptr)
+{
+ ID *id= (ID*)ptr->data;
+ return strlen(id->name+2);
+}
+
+static void rna_ID_name_set(PointerRNA *ptr, const char *value)
+{
+ ID *id= (ID*)ptr->data;
+ BLI_strncpy(id->name+2, value, sizeof(id->name)-2);
+}
+
+static StructRNA *rna_ID_refine(PointerRNA *ptr)
+{
+ ID *id= (ID*)ptr->data;
+
+ switch(GS(id->name)) {
+ case ID_AR: return &RNA_Armature;
+ case ID_BR: return &RNA_Brush;
+ case ID_CA: return &RNA_Camera;
+ case ID_CU: return &RNA_Curve;
+ case ID_GR: return &RNA_Group;
+ case ID_IM: return &RNA_Image;
+ case ID_IP: return &RNA_Ipo;
+ case ID_KE: return &RNA_Key;
+ case ID_LA: return &RNA_Lamp;
+ case ID_LI: return &RNA_Library;
+ case ID_LT: return &RNA_Lattice;
+ case ID_MA: return &RNA_Material;
+ case ID_MB: return &RNA_MetaBall;
+ case ID_NT: return &RNA_NodeTree;
+ case ID_ME: return &RNA_Mesh;
+ case ID_OB: return &RNA_Object;
+ case ID_SCE: return &RNA_Scene;
+ case ID_SCR: return &RNA_Screen;
+ case ID_VF: return &RNA_VectorFont;
+ case ID_WO: return &RNA_World;
+ case ID_WM: return &RNA_WindowManager;
+ default: return &RNA_ID;
+ }
+}
+
+static void rna_ID_fake_user_set(PointerRNA *ptr, int value)
+{
+ ID *id= (ID*)ptr->data;
+
+ if(value && !(id->flag & LIB_FAKEUSER)) {
+ id->flag |= LIB_FAKEUSER;
+ id->us++;
+ }
+ else if(!value && (id->flag & LIB_FAKEUSER)) {
+ id->flag &= ~LIB_FAKEUSER;
+ id->us--;
+ }
+}
+
+#else
+
+static void rna_def_ID_properties(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ /* this is struct is used for holding the virtual
+ * PropertyRNA's for ID properties */
+ srna= RNA_def_struct(brna, "IDProperty", NULL, "ID Property");
+
+ /* IDP_STRING */
+ prop= RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+
+ /* IDP_INT */
+ prop= RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+
+ prop= RNA_def_property(srna, "intarray", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+ RNA_def_property_array(prop, 1);
+
+ /* IDP_FLOAT */
+ prop= RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+
+ prop= RNA_def_property(srna, "floatarray", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+ RNA_def_property_array(prop, 1);
+
+ /* IDP_DOUBLE */
+ prop= RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+
+ prop= RNA_def_property(srna, "doublearray", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+ RNA_def_property_array(prop, 1);
+
+ /* IDP_GROUP */
+ prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_NOT_EDITABLE|PROP_IDPROPERTY);
+ RNA_def_property_struct_type(prop, "IDPropertyGroup");
+
+ /* IDP_ID -- not implemented yet in id properties */
+
+ /* ID property groups > level 0, since level 0 group is merged
+ * with native RNA properties. the builtin_properties will take
+ * care of the properties here */
+ srna= RNA_def_struct(brna, "IDPropertyGroup", NULL, "ID Property Group");
+}
+
+static void rna_def_ID(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ID", NULL, "ID");
+ RNA_def_struct_flag(srna, STRUCT_ID);
+ RNA_def_struct_funcs(srna, NULL, "rna_ID_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* must be unique */
+ RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name.");
+ RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
+ RNA_def_property_string_maxlength(prop, 22);
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "us");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced.");
+
+ prop= RNA_def_property(srna, "fake_user", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
+ RNA_def_property_ui_text(prop, "Fake User", "Saves this datablock even if it has no users");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
+
+ prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "lib");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from.");
+}
+
+static void rna_def_library(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Library", "ID", "Library");
+
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Filename", "Path to the library .blend file.");
+}
+void RNA_def_ID(BlenderRNA *brna)
+{
+ /* simple built-in unknown type */
+ RNA_def_struct(brna, "UnknownType", NULL, "Unknown Type");
+
+ rna_def_ID(brna);
+ rna_def_ID_properties(brna);
+ rna_def_library(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
new file mode 100644
index 00000000000..2c9cb9f4dfa
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -0,0 +1,1632 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_dynstr.h"
+
+#include "BKE_idprop.h"
+#include "BKE_utildefines.h"
+
+#include "DNA_ID.h"
+#include "DNA_windowmanager_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+/* Exit */
+
+void RNA_exit()
+{
+ RNA_free(&BLENDER_RNA);
+}
+
+/* Pointer */
+
+void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
+{
+ r_ptr->id.type= NULL;
+ r_ptr->id.data= NULL;
+ r_ptr->type= &RNA_Main;
+ r_ptr->data= main;
+}
+
+void RNA_id_pointer_create(StructRNA *idtype, ID *id, PointerRNA *r_ptr)
+{
+ r_ptr->id.type= idtype;
+ r_ptr->id.data= id;
+ r_ptr->type= idtype;
+ r_ptr->data= id;
+}
+
+void RNA_pointer_create(StructRNA *idtype, ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
+{
+ r_ptr->id.type= idtype;
+ r_ptr->id.data= id;
+ r_ptr->type= type;
+ r_ptr->data= data;
+}
+
+static void rna_pointer_inherit_id(PointerRNA *parent, PointerRNA *ptr)
+{
+ if(ptr->type && ptr->type->flag & STRUCT_ID) {
+ ptr->id.data= ptr->data;
+ ptr->id.type= ptr->type;
+ }
+ else {
+ ptr->id.data= parent->id.data;
+ ptr->id.type= parent->id.type;
+ }
+}
+
+/* ID Properties */
+
+IDProperty *rna_idproperties_get(StructRNA *type, void *data, int create)
+{
+ if(type->flag & STRUCT_ID)
+ return IDP_GetProperties(data, create);
+ else if(type == &RNA_IDPropertyGroup)
+ return data;
+ else if(type->from == &RNA_Operator) {
+ wmOperator *op= (wmOperator*)data;
+
+ if(create && !op->properties) {
+ IDPropertyTemplate val;
+ val.i = 0; /* silence MSVC warning about uninitialized var when debugging */
+ op->properties= IDP_New(IDP_GROUP, val, "property");
+ }
+
+ return op->properties;
+ }
+ else
+ return NULL;
+}
+
+static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
+{
+ IDProperty *group= rna_idproperties_get(ptr->type, ptr->data, 0);
+ IDProperty *idprop;
+
+ if(group) {
+ for(idprop=group->data.group.first; idprop; idprop=idprop->next)
+ if(strcmp(idprop->name, name) == 0)
+ return idprop;
+ }
+
+ return NULL;
+}
+
+static int rna_idproperty_verify_valid(PropertyRNA *prop, IDProperty *idprop)
+{
+ /* this verifies if the idproperty actually matches the property
+ * description and otherwise removes it. this is to ensure that
+ * rna property access is type safe, e.g. if you defined the rna
+ * to have a certain array length you can count on that staying so */
+
+ switch(idprop->type) {
+ case IDP_ARRAY:
+ if(prop->arraylength != idprop->len)
+ return 0;
+
+ if(idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
+ return 0;
+ if(idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+ return 0;
+
+ break;
+ case IDP_INT:
+ if(!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+ return 0;
+ break;
+ case IDP_FLOAT:
+ case IDP_DOUBLE:
+ if(prop->type != PROP_FLOAT)
+ return 0;
+ break;
+ case IDP_STRING:
+ if(prop->type != PROP_STRING)
+ return 0;
+ break;
+ case IDP_GROUP:
+ if(prop->type != PROP_POINTER)
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
+{
+ /* This is quite a hack, but avoids some complexity in the API. we
+ * pass IDProperty structs as PropertyRNA pointers to the outside.
+ * We store some bytes in PropertyRNA structs that allows us to
+ * distinguish it from IDProperty structs. If it is an ID property,
+ * we look up an IDP PropertyRNA based on the type, and set the data
+ * pointer to the IDProperty. */
+
+ if((*prop)->magic == RNA_MAGIC) {
+ if((*prop)->flag & PROP_IDPROPERTY) {
+ IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier);
+
+ if(idprop && !rna_idproperty_verify_valid(*prop, idprop)) {
+ IDProperty *group= rna_idproperties_get(ptr->type, ptr->data, 0);
+
+ IDP_RemFromGroup(group, idprop);
+ IDP_FreeProperty(idprop);
+ MEM_freeN(idprop);
+ return NULL;
+ }
+
+ return idprop;
+ }
+ else
+ return NULL;
+ }
+
+ {
+ static PropertyRNA *typemap[IDP_NUMTYPES] =
+ {(PropertyRNA*)&rna_IDProperty_string,
+ (PropertyRNA*)&rna_IDProperty_int,
+ (PropertyRNA*)&rna_IDProperty_float,
+ NULL, NULL, NULL,
+ (PropertyRNA*)&rna_IDProperty_group, NULL,
+ (PropertyRNA*)&rna_IDProperty_double};
+
+ static PropertyRNA *arraytypemap[IDP_NUMTYPES] =
+ {NULL, (PropertyRNA*)&rna_IDProperty_intarray,
+ (PropertyRNA*)&rna_IDProperty_floatarray,
+ NULL, NULL, NULL, NULL, NULL,
+ (PropertyRNA*)&rna_IDProperty_doublearray};
+
+ IDProperty *idprop= (IDProperty*)(*prop);
+
+ if(idprop->type == IDP_ARRAY)
+ *prop= arraytypemap[(int)(idprop->subtype)];
+ else
+ *prop= typemap[(int)(idprop->type)];
+
+ return idprop;
+ }
+}
+
+/* Structs */
+
+const char *RNA_struct_identifier(PointerRNA *ptr)
+{
+ return ptr->type->identifier;
+}
+
+const char *RNA_struct_ui_name(PointerRNA *ptr)
+{
+ return ptr->type->name;
+}
+
+PropertyRNA *RNA_struct_name_property(PointerRNA *ptr)
+{
+ return ptr->type->nameproperty;
+}
+
+PropertyRNA *RNA_struct_iterator_property(PointerRNA *ptr)
+{
+ return ptr->type->iteratorproperty;
+}
+
+int RNA_struct_is_ID(PointerRNA *ptr)
+{
+ return (ptr->type->flag & STRUCT_ID) != 0;
+}
+
+PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
+{
+ CollectionPropertyIterator iter;
+ PropertyRNA *iterprop, *prop;
+ int i = 0;
+
+ iterprop= RNA_struct_iterator_property(ptr);
+ RNA_property_collection_begin(ptr, iterprop, &iter);
+ prop= NULL;
+
+ for(; iter.valid; RNA_property_collection_next(&iter), i++) {
+ if(strcmp(identifier, RNA_property_identifier(&iter.ptr, iter.ptr.data)) == 0) {
+ prop= iter.ptr.data;
+ break;
+ }
+ }
+
+ RNA_property_collection_end(&iter);
+
+ return prop;
+}
+
+/* Property Information */
+
+const char *RNA_property_identifier(PointerRNA *ptr, PropertyRNA *prop)
+{
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return idprop->name;
+ else
+ return prop->identifier;
+}
+
+PropertyType RNA_property_type(PointerRNA *ptr, PropertyRNA *prop)
+{
+ rna_idproperty_check(&prop, ptr);
+
+ return prop->type;
+}
+
+PropertySubType RNA_property_subtype(PointerRNA *ptr, PropertyRNA *prop)
+{
+ rna_idproperty_check(&prop, ptr);
+
+ return prop->subtype;
+}
+
+int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
+{
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)) && idprop->type==IDP_ARRAY)
+ return idprop->len;
+ else
+ return prop->arraylength;
+}
+
+void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
+{
+ IntPropertyRNA *iprop;
+
+ rna_idproperty_check(&prop, ptr);
+ iprop= (IntPropertyRNA*)prop;
+
+ if(iprop->range) {
+ iprop->range(ptr, hardmin, hardmax);
+ }
+ else {
+ *hardmin= iprop->hardmin;
+ *hardmax= iprop->hardmax;
+ }
+}
+
+void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
+{
+ IntPropertyRNA *iprop;
+ int hardmin, hardmax;
+
+ rna_idproperty_check(&prop, ptr);
+ iprop= (IntPropertyRNA*)prop;
+
+ if(iprop->range) {
+ iprop->range(ptr, &hardmin, &hardmax);
+ *softmin= MAX2(iprop->softmin, hardmin);
+ *softmax= MIN2(iprop->softmax, hardmax);
+ }
+ else {
+ *softmin= iprop->softmin;
+ *softmax= iprop->softmax;
+ }
+
+ *step= iprop->step;
+}
+
+void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
+{
+ FloatPropertyRNA *fprop;
+
+ rna_idproperty_check(&prop, ptr);
+ fprop= (FloatPropertyRNA*)prop;
+
+ if(fprop->range) {
+ fprop->range(ptr, hardmin, hardmax);
+ }
+ else {
+ *hardmin= fprop->hardmin;
+ *hardmax= fprop->hardmax;
+ }
+}
+
+void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
+{
+ FloatPropertyRNA *fprop;
+ float hardmin, hardmax;
+
+ rna_idproperty_check(&prop, ptr);
+ fprop= (FloatPropertyRNA*)prop;
+
+ if(fprop->range) {
+ fprop->range(ptr, &hardmin, &hardmax);
+ *softmin= MAX2(fprop->softmin, hardmin);
+ *softmax= MIN2(fprop->softmax, hardmax);
+ }
+ else {
+ *softmin= fprop->softmin;
+ *softmax= fprop->softmax;
+ }
+
+ *step= fprop->step;
+ *precision= fprop->precision;
+}
+
+int RNA_property_string_maxlength(PointerRNA *ptr, PropertyRNA *prop)
+{
+ StringPropertyRNA *sprop;
+
+ rna_idproperty_check(&prop, ptr);
+ sprop= (StringPropertyRNA*)prop;
+
+ return sprop->maxlength;
+}
+
+void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem)
+{
+ EnumPropertyRNA *eprop;
+
+ rna_idproperty_check(&prop, ptr);
+ eprop= (EnumPropertyRNA*)prop;
+
+ *item= eprop->item;
+ *totitem= eprop->totitem;
+}
+
+int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value)
+{
+ const EnumPropertyItem *item;
+ int totitem, i;
+
+ RNA_property_enum_items(ptr, prop, &item, &totitem);
+
+ for (i=0; i<totitem; i++) {
+ if (strcmp(item[i].identifier, identifier)==0) {
+ *value = item[i].value;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
+{
+ const EnumPropertyItem *item;
+ int totitem, i;
+
+ RNA_property_enum_items(ptr, prop, &item, &totitem);
+
+ for (i=0; i<totitem; i++) {
+ if (item[i].value==value) {
+ *identifier = item[i].identifier;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+const char *RNA_property_ui_name(PointerRNA *ptr, PropertyRNA *prop)
+{
+ PropertyRNA *oldprop= prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)) && oldprop!=prop)
+ return idprop->name;
+ else
+ return prop->name;
+}
+
+const char *RNA_property_ui_description(PointerRNA *ptr, PropertyRNA *prop)
+{
+ PropertyRNA *oldprop= prop;
+
+ if(rna_idproperty_check(&prop, ptr) && oldprop!=prop)
+ return "";
+ else
+ return prop->description;
+}
+
+int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop)
+{
+ int flag;
+
+ rna_idproperty_check(&prop, ptr);
+
+ if(prop->editable)
+ flag= prop->editable(ptr);
+ else
+ flag= prop->flag;
+
+ return !(flag & PROP_NOT_EDITABLE);
+}
+
+int RNA_property_evaluated(PointerRNA *ptr, PropertyRNA *prop)
+{
+ int flag;
+
+ rna_idproperty_check(&prop, ptr);
+
+ if(prop->editable)
+ flag= prop->editable(ptr);
+ else
+ flag= prop->flag;
+
+ return (flag & PROP_EVALUATED);
+}
+
+void RNA_property_notify(PropertyRNA *prop, struct bContext *C, PointerRNA *ptr)
+{
+ rna_idproperty_check(&prop, ptr);
+
+ if(prop->notify)
+ prop->notify(C, ptr);
+}
+
+/* Property Data */
+
+int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
+{
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return IDP_Int(idprop);
+ else if(bprop->get)
+ return bprop->get(ptr);
+ else
+ return bprop->defaultvalue;
+}
+
+void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
+{
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ IDP_Int(idprop)= value;
+ else if(bprop->set)
+ bprop->set(ptr, value);
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.i= value;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group)
+ IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
+ }
+}
+
+int RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int index)
+{
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return ((int*)IDP_Array(idprop))[index];
+ else if(bprop->getarray)
+ return bprop->getarray(ptr, index);
+ else
+ return bprop->defaultarray[index];
+}
+
+void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
+{
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ ((int*)IDP_Array(idprop))[index]= value;
+ else if(bprop->setarray)
+ bprop->setarray(ptr, index, value);
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.array.len= prop->arraylength;
+ val.array.type= IDP_INT;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group) {
+ idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
+ IDP_AddToGroup(group, idprop);
+ memcpy(idprop->data.pointer, bprop->defaultarray, sizeof(int)*prop->arraylength);
+ ((int*)idprop->data.pointer)[index]= value;
+ }
+ }
+}
+
+int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
+{
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return IDP_Int(idprop);
+ else if(iprop->get)
+ return iprop->get(ptr);
+ else
+ return iprop->defaultvalue;
+}
+
+void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
+{
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ IDP_Int(idprop)= value;
+ else if(iprop->set)
+ iprop->set(ptr, value);
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.i= value;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group)
+ IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
+ }
+}
+
+int RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int index)
+{
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return ((int*)IDP_Array(idprop))[index];
+ else if(iprop->getarray)
+ return iprop->getarray(ptr, index);
+ else
+ return iprop->defaultarray[index];
+}
+
+void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
+{
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ ((int*)IDP_Array(idprop))[index]= value;
+ else if(iprop->setarray)
+ iprop->setarray(ptr, index, value);
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.array.len= prop->arraylength;
+ val.array.type= IDP_INT;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group) {
+ idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
+ IDP_AddToGroup(group, idprop);
+ memcpy(idprop->data.pointer, iprop->defaultarray, sizeof(int)*prop->arraylength);
+ ((int*)idprop->data.pointer)[index]= value;
+ }
+ }
+}
+
+float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
+{
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if(idprop->type == IDP_FLOAT)
+ return IDP_Float(idprop);
+ else
+ return (float)IDP_Double(idprop);
+ }
+ else if(fprop->get)
+ return fprop->get(ptr);
+ else
+ return fprop->defaultvalue;
+}
+
+void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
+{
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if(idprop->type == IDP_FLOAT)
+ IDP_Float(idprop)= value;
+ else
+ IDP_Double(idprop)= value;
+ }
+ else if(fprop->set) {
+ fprop->set(ptr, value);
+ }
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.f= value;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group)
+ IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, (char*)prop->identifier));
+ }
+}
+
+float RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, int index)
+{
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if(idprop->type == IDP_FLOAT)
+ return ((float*)IDP_Array(idprop))[index];
+ else
+ return (float)(((double*)IDP_Array(idprop))[index]);
+ }
+ else if(fprop->getarray)
+ return fprop->getarray(ptr, index);
+ else
+ return fprop->defaultarray[index];
+}
+
+void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
+{
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr))) {
+ if(idprop->type == IDP_FLOAT)
+ ((float*)IDP_Array(idprop))[index]= value;
+ else
+ ((double*)IDP_Array(idprop))[index]= value;
+ }
+ else if(fprop->setarray) {
+ fprop->setarray(ptr, index, value);
+ }
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.array.len= prop->arraylength;
+ val.array.type= IDP_FLOAT;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group) {
+ idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier);
+ IDP_AddToGroup(group, idprop);
+ memcpy(idprop->data.pointer, fprop->defaultarray, sizeof(float)*prop->arraylength);
+ ((float*)idprop->data.pointer)[index]= value;
+ }
+ }
+}
+
+void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
+{
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ strcpy(value, IDP_String(idprop));
+ else if(sprop->get)
+ sprop->get(ptr, value);
+ else
+ strcpy(value, sprop->defaultvalue);
+}
+
+char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen)
+{
+ char *buf;
+ int length;
+
+ length= RNA_property_string_length(ptr, prop);
+
+ if(length+1 < fixedlen)
+ buf= fixedbuf;
+ else
+ buf= MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+
+ RNA_property_string_get(ptr, prop, buf);
+
+ return buf;
+}
+
+int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
+{
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return strlen(IDP_String(idprop));
+ else if(sprop->length)
+ return sprop->length(ptr);
+ else
+ return strlen(sprop->defaultvalue);
+}
+
+void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
+{
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ IDP_AssignString(idprop, (char*)value);
+ else if(sprop->set)
+ sprop->set(ptr, value);
+}
+
+int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
+{
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ return IDP_Int(idprop);
+ else if(eprop->get)
+ return eprop->get(ptr);
+ else
+ return eprop->defaultvalue;
+}
+
+
+void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
+{
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ IDP_Int(idprop)= value;
+ else if(eprop->set) {
+ eprop->set(ptr, value);
+ }
+ else if(!(prop->flag & PROP_NOT_EDITABLE)) {
+ IDPropertyTemplate val;
+ IDProperty *group;
+
+ val.i= value;
+
+ group= rna_idproperties_get(ptr->type, ptr->data, 1);
+ if(group)
+ IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier));
+ }
+}
+
+static StructRNA *rna_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
+{
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ StructRNA *type;
+
+ if(pprop->type)
+ type= pprop->type(ptr);
+ else
+ type= pprop->structtype;
+
+ if(type && type->refine)
+ type= type->refine(r_ptr);
+
+ r_ptr->type= type;
+ return type;
+}
+
+void RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
+{
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ IDProperty *idprop;
+
+ if((idprop=rna_idproperty_check(&prop, ptr)))
+ r_ptr->data= idprop; /* for groups, data is idprop itself */
+ else if(pprop->get)
+ r_ptr->data= pprop->get(ptr);
+ else
+ r_ptr->data= NULL;
+
+ if(r_ptr->data && rna_property_pointer_type(ptr, prop, r_ptr))
+ rna_pointer_inherit_id(ptr, r_ptr);
+ else
+ memset(r_ptr, 0, sizeof(*r_ptr));
+}
+
+void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *ptr_value)
+{
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+
+ if(pprop->set)
+ pprop->set(ptr, ptr_value->data);
+}
+
+static StructRNA *rna_property_collection_type(CollectionPropertyIterator *iter)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
+ StructRNA *type;
+
+ if(cprop->type)
+ type= cprop->type(iter);
+ else
+ type= cprop->structtype;
+
+ if(type->refine)
+ type= type->refine(&iter->ptr);
+
+ iter->ptr.type= type;
+ return type;
+}
+
+static void rna_property_collection_get(CollectionPropertyIterator *iter)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
+
+ iter->ptr.data= cprop->get(iter);
+
+ if(iter->ptr.data && rna_property_collection_type(iter))
+ rna_pointer_inherit_id(&iter->parent, &iter->ptr);
+ else
+ memset(&iter->ptr, 0, sizeof(iter->ptr));
+}
+
+void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(cprop->begin) {
+ iter->parent= *ptr;
+ iter->prop= prop;
+ cprop->begin(iter, ptr);
+
+ if(iter->valid)
+ rna_property_collection_get(iter);
+ else
+ memset(&iter->ptr, 0, sizeof(iter->ptr));
+ }
+ else
+ memset(iter, 0, sizeof(*iter));
+}
+
+void RNA_property_collection_next(CollectionPropertyIterator *iter)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
+
+ cprop->next(iter);
+
+ if(iter->valid)
+ rna_property_collection_get(iter);
+ else
+ memset(&iter->ptr, 0, sizeof(iter->ptr));
+}
+
+void RNA_property_collection_end(CollectionPropertyIterator *iter)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)iter->prop;
+
+ if(cprop->end)
+ cprop->end(iter);
+}
+
+int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(cprop->length) {
+ return cprop->length(ptr);
+ }
+ else {
+ CollectionPropertyIterator iter;
+ int length= 0;
+
+ RNA_property_collection_begin(ptr, prop, &iter);
+ for(; iter.valid; RNA_property_collection_next(&iter))
+ length++;
+ RNA_property_collection_end(&iter);
+
+ return length;
+ }
+}
+
+int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(cprop->lookupint) {
+ /* we have a callback defined, use it */
+ r_ptr->data= cprop->lookupint(ptr, key, &r_ptr->type);
+
+ if(r_ptr->data) {
+ if(!r_ptr->type)
+ r_ptr->type= cprop->structtype;
+ rna_pointer_inherit_id(ptr, r_ptr);
+
+ return 1;
+ }
+ else {
+ memset(r_ptr, 0, sizeof(*r_ptr));
+ return 0;
+ }
+ }
+ else {
+ /* no callback defined, just iterate and find the nth item */
+ CollectionPropertyIterator iter;
+ int i;
+
+ RNA_property_collection_begin(ptr, prop, &iter);
+ for(i=0; iter.valid; RNA_property_collection_next(&iter), i++) {
+ if(i == key) {
+ *r_ptr= iter.ptr;
+ break;
+ }
+ }
+ RNA_property_collection_end(&iter);
+
+ if(!iter.valid)
+ memset(r_ptr, 0, sizeof(*r_ptr));
+
+ return iter.valid;
+ }
+}
+
+int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(cprop->lookupstring) {
+ /* we have a callback defined, use it */
+ r_ptr->data= cprop->lookupstring(ptr, key, &r_ptr->type);
+
+ if(r_ptr->data) {
+ if(!r_ptr->type)
+ r_ptr->type= cprop->structtype;
+ rna_pointer_inherit_id(ptr, r_ptr);
+
+ return 1;
+ }
+ else {
+ memset(r_ptr, 0, sizeof(*r_ptr));
+ return 0;
+ }
+ }
+ else {
+ /* no callback defined, compare with name properties if they exist */
+ CollectionPropertyIterator iter;
+ PropertyRNA *nameprop;
+ char name[256], *nameptr;
+ int found= 0;
+
+ RNA_property_collection_begin(ptr, prop, &iter);
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ if(iter.ptr.data && iter.ptr.type->nameproperty) {
+ nameprop= iter.ptr.type->nameproperty;
+
+ nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name));
+
+ if(strcmp(nameptr, key) == 0) {
+ *r_ptr= iter.ptr;
+ found= 1;
+ }
+
+ if ((char *)&name != nameptr)
+ MEM_freeN(nameptr);
+
+ if(found)
+ break;
+ }
+ }
+ RNA_property_collection_end(&iter);
+
+ if(!iter.valid)
+ memset(r_ptr, 0, sizeof(*r_ptr));
+
+ return iter.valid;
+ }
+}
+
+/* Standard iterator functions */
+
+void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
+{
+ ListBaseIterator *internal;
+
+ internal= MEM_callocN(sizeof(ListBaseIterator), "ListBaseIterator");
+ internal->link= lb->first;
+ internal->skip= skip;
+
+ iter->internal= internal;
+ iter->valid= (internal->link != NULL);
+
+ if(skip && iter->valid && skip(iter, internal->link))
+ rna_iterator_listbase_next(iter);
+}
+
+void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+
+ if(internal->skip) {
+ do {
+ internal->link= internal->link->next;
+ iter->valid= (internal->link != NULL);
+ } while(iter->valid && internal->skip(iter, internal->link));
+ }
+ else {
+ internal->link= internal->link->next;
+ iter->valid= (internal->link != NULL);
+ }
+}
+
+void *rna_iterator_listbase_get(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+
+ return internal->link;
+}
+
+void rna_iterator_listbase_end(CollectionPropertyIterator *iter)
+{
+ MEM_freeN(iter->internal);
+}
+
+void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip)
+{
+ ArrayIterator *internal;
+
+ if(ptr == NULL)
+ length= 0;
+
+ internal= MEM_callocN(sizeof(ArrayIterator), "ArrayIterator");
+ internal->ptr= ptr;
+ internal->endptr= ((char*)ptr)+length*itemsize;
+ internal->itemsize= itemsize;
+ internal->skip= skip;
+
+ iter->internal= internal;
+ iter->valid= (internal->ptr != internal->endptr);
+
+ if(skip && iter->valid && skip(iter, internal->ptr))
+ rna_iterator_array_next(iter);
+}
+
+void rna_iterator_array_next(CollectionPropertyIterator *iter)
+{
+ ArrayIterator *internal= iter->internal;
+
+ if(internal->skip) {
+ do {
+ internal->ptr += internal->itemsize;
+ iter->valid= (internal->ptr != internal->endptr);
+ } while(iter->valid && internal->skip(iter, internal->ptr));
+ }
+ else {
+ internal->ptr += internal->itemsize;
+ iter->valid= (internal->ptr != internal->endptr);
+ }
+}
+
+void *rna_iterator_array_get(CollectionPropertyIterator *iter)
+{
+ ArrayIterator *internal= iter->internal;
+
+ return internal->ptr;
+}
+
+void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
+{
+ ArrayIterator *internal= iter->internal;
+
+ /* for ** arrays */
+ return *(void**)(internal->ptr);
+}
+
+void rna_iterator_array_end(CollectionPropertyIterator *iter)
+{
+ MEM_freeN(iter->internal);
+}
+
+/* RNA Path - Experiment */
+
+static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int bracket)
+{
+ const char *p;
+ char *buf;
+ int i, j, len, escape;
+
+ len= 0;
+
+ if(bracket) {
+ /* get data between [], check escaping ] with \] */
+ if(**path == '[') (*path)++;
+ else return NULL;
+
+ p= *path;
+
+ escape= 0;
+ while(*p && (*p != ']' || escape)) {
+ escape= (*p == '\\');
+ len++;
+ p++;
+ }
+
+ if(*p != ']') return NULL;
+ }
+ else {
+ /* get data until . or [ */
+ p= *path;
+
+ while(*p && *p != '.' && *p != '[') {
+ len++;
+ p++;
+ }
+ }
+
+ /* empty, return */
+ if(len == 0)
+ return NULL;
+
+ /* try to use fixed buffer if possible */
+ if(len+1 < fixedlen)
+ buf= fixedbuf;
+ else
+ buf= MEM_callocN(sizeof(char)*(len+1), "rna_path_token");
+
+ /* copy string, taking into account escaped ] */
+ for(p=*path, i=0, j=0; i<len; i++, p++) {
+ if(*p == '\\' && *(p+1) == ']');
+ else buf[j++]= *p;
+ }
+
+ buf[j]= 0;
+
+ /* set path to start of next token */
+ if(*p == ']') p++;
+ if(*p == '.') p++;
+ *path= p;
+
+ return buf;
+}
+
+int RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
+{
+ CollectionPropertyIterator iter;
+ PropertyRNA *prop, *iterprop;
+ PointerRNA curptr, nextptr;
+ char fixedbuf[256], *token;
+ int len, intkey;
+
+ prop= NULL;
+ curptr= *ptr;
+
+ while(*path) {
+ /* look up property name in current struct */
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
+
+ if(!token)
+ return 0;
+
+ iterprop= RNA_struct_iterator_property(&curptr);
+ RNA_property_collection_begin(&curptr, iterprop, &iter);
+ prop= NULL;
+
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ if(strcmp(token, RNA_property_identifier(&iter.ptr, iter.ptr.data)) == 0) {
+ prop= iter.ptr.data;
+ break;
+ }
+ }
+
+ RNA_property_collection_end(&iter);
+
+ if(token != fixedbuf)
+ MEM_freeN(token);
+
+ if(!prop)
+ return 0;
+
+ /* now look up the value of this property if it is a pointer or
+ * collection, otherwise return the property rna so that the
+ * caller can read the value of the property itself */
+ if(RNA_property_type(&curptr, prop) == PROP_POINTER) {
+ RNA_property_pointer_get(&curptr, prop, &nextptr);
+
+ if(nextptr.data)
+ curptr= nextptr;
+ else
+ return 0;
+ }
+ else if(RNA_property_type(&curptr, prop) == PROP_COLLECTION && *path) {
+ /* resolve the lookup with [] brackets */
+ token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+
+ if(!token)
+ return 0;
+
+ len= strlen(token);
+
+ /* check for "" to see if it is a string */
+ if(len >= 2 && *token == '"' && token[len-2] == '"') {
+ /* strip away "" */
+ token[len-2]= 0;
+ RNA_property_collection_lookup_string(&curptr, prop, token+1, &nextptr);
+ }
+ else {
+ /* otherwise do int lookup */
+ intkey= atoi(token);
+ RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr);
+ }
+
+ if(token != fixedbuf)
+ MEM_freeN(token);
+
+ if(nextptr.data)
+ curptr= nextptr;
+ else
+ return 0;
+ }
+ }
+
+ *r_ptr= curptr;
+ *r_prop= prop;
+
+ return 1;
+}
+
+char *RNA_path_append(const char *path, PointerRNA *ptr, PropertyRNA *prop, int intkey, const char *strkey)
+{
+ DynStr *dynstr;
+ const char *s;
+ char appendstr[128], *result;
+
+ dynstr= BLI_dynstr_new();
+
+ /* add .identifier */
+ if(path) {
+ BLI_dynstr_append(dynstr, (char*)path);
+ if(*path)
+ BLI_dynstr_append(dynstr, ".");
+ }
+
+ BLI_dynstr_append(dynstr, (char*)RNA_property_identifier(ptr, prop));
+
+ if(RNA_property_type(ptr, prop) == PROP_COLLECTION) {
+ /* add ["strkey"] or [intkey] */
+ BLI_dynstr_append(dynstr, "[");
+
+ if(strkey) {
+ BLI_dynstr_append(dynstr, "\"");
+ for(s=strkey; *s; s++) {
+ if(*s == '[') {
+ appendstr[0]= '\\';
+ appendstr[1]= *s;
+ appendstr[2]= 0;
+ }
+ else {
+ appendstr[0]= *s;
+ appendstr[1]= 0;
+ }
+ BLI_dynstr_append(dynstr, appendstr);
+ }
+ BLI_dynstr_append(dynstr, "\"");
+ }
+ else {
+ sprintf(appendstr, "%d", intkey);
+ BLI_dynstr_append(dynstr, appendstr);
+ }
+
+ BLI_dynstr_append(dynstr, "]");
+ }
+
+ result= BLI_dynstr_get_cstring(dynstr);
+ BLI_dynstr_free(dynstr);
+
+ return result;
+}
+
+char *RNA_path_back(const char *path)
+{
+ char fixedbuf[256];
+ const char *previous, *current;
+ char *result, *token;
+ int i;
+
+ if(!path)
+ return NULL;
+
+ previous= NULL;
+ current= path;
+
+ /* parse token by token until the end, then we back up to the previous
+ * position and strip of the next token to get the path one step back */
+ while(*current) {
+ token= rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 0);
+
+ if(!token)
+ return NULL;
+ if(token != fixedbuf)
+ MEM_freeN(token);
+
+ /* in case of collection we also need to strip off [] */
+ token= rna_path_token(&current, fixedbuf, sizeof(fixedbuf), 1);
+ if(token && token != fixedbuf)
+ MEM_freeN(token);
+
+ if(!*current)
+ break;
+
+ previous= current;
+ }
+
+ if(!previous)
+ return NULL;
+
+ /* copy and strip off last token */
+ i= previous - path;
+ result= BLI_strdup(path);
+
+ if(i > 0 && result[i-1] == '.') i--;
+ result[i]= 0;
+
+ return result;
+}
+
+/* Quick name based property access */
+
+int RNA_boolean_get(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_boolean_get(ptr, prop);
+ }
+ else {
+ printf("RNA_boolean_get: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+void RNA_boolean_set(PointerRNA *ptr, const char *name, int value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_boolean_set(ptr, prop, value);
+ else
+ printf("RNA_boolean_set: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ values[i]= RNA_property_boolean_get_array(ptr, prop, i);
+ }
+ else
+ printf("RNA_boolean_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ RNA_property_boolean_set_array(ptr, prop, i, values[i]);
+ }
+ else
+ printf("RNA_boolean_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+int RNA_int_get(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_int_get(ptr, prop);
+ }
+ else {
+ printf("RNA_int_get: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+void RNA_int_set(PointerRNA *ptr, const char *name, int value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_int_set(ptr, prop, value);
+ else
+ printf("RNA_int_set: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ values[i]= RNA_property_int_get_array(ptr, prop, i);
+ }
+ else
+ printf("RNA_int_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ RNA_property_int_set_array(ptr, prop, i, values[i]);
+ }
+ else
+ printf("RNA_int_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+float RNA_float_get(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_float_get(ptr, prop);
+ }
+ else {
+ printf("RNA_float_get: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+void RNA_float_set(PointerRNA *ptr, const char *name, float value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_float_set(ptr, prop, value);
+ else
+ printf("RNA_float_set: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ values[i]= RNA_property_float_get_array(ptr, prop, i);
+ }
+ else
+ printf("RNA_float_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ int i, length;
+
+ if(prop) {
+ length= RNA_property_array_length(ptr, prop);
+ for(i=0; i<length; i++)
+ RNA_property_float_set_array(ptr, prop, i, values[i]);
+ }
+ else
+ printf("RNA_float_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+int RNA_enum_get(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_enum_get(ptr, prop);
+ }
+ else {
+ printf("RNA_enum_get: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_enum_set(ptr, prop, value);
+ else
+ printf("RNA_enum_set: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_string_get(ptr, prop, value);
+ else
+ printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen);
+ }
+ else {
+ printf("RNA_string_get_alloc: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+int RNA_string_length(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return RNA_property_string_length(ptr, prop);
+ }
+ else {
+ printf("RNA_string_length: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
+void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop)
+ RNA_property_string_set(ptr, prop, value);
+ else
+ printf("RNA_string_set: %s.%s not found.\n", ptr->type->identifier, name);
+}
+
+int RNA_property_is_set(PointerRNA *ptr, const char *name)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+
+ if(prop) {
+ return (rna_idproperty_find(ptr, name) != NULL);
+ }
+ else {
+ printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name);
+ return 0;
+ }
+}
+
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
new file mode 100644
index 00000000000..90550022cc5
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -0,0 +1,81 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_actuator_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_actuator(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem actuator_type_items[] ={
+ {ACT_OBJECT, "OBJECT", "Object", ""},
+ {ACT_IPO, "IPO", "IPO", ""},
+ {ACT_CAMERA, "CAMERA", "Camera", ""},
+ {ACT_SOUND, "SOUND", "Sound", ""},
+ {ACT_PROPERTY, "PROPERTY", "Property", ""},
+ {ACT_CONSTRAINT, "CONSTRAINT", "Constraint", ""},
+ {ACT_EDIT_OBJECT, "EDITOBJECT", "Edit Object", ""},
+ {ACT_SCENE, "SCENE", "Scene", ""},
+ {ACT_RANDOM, "RANDOM", "Random", ""},
+ {ACT_MESSAGE, "MESSAGE", "Message", ""},
+ {ACT_ACTION, "ACTION", "Action", ""},
+ {ACT_CD, "CD", "CD", ""},
+ {ACT_GAME, "GAME", "Game", ""},
+ {ACT_VISIBILITY, "VISIBILITY", "Visibility", ""},
+ {ACT_2DFILTER, "TWODFILTER", "2D Filter", ""},
+ {ACT_PARENT, "PARENT", "Parent", ""},
+ {ACT_SHAPEACTION, "SHAPEACTION", "Shape Action", ""},
+ {ACT_STATE, "STATE", "State", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Actuator", NULL , "Actuator");
+ RNA_def_struct_sdna(srna, "bActuator");
+
+ prop= RNA_def_property(srna, "actuator_name", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ /* type is not editable, would need to do proper data free/alloc */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, actuator_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
new file mode 100644
index 00000000000..a29722c802b
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -0,0 +1,420 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Joshua Leung
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_armature_types.h"
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+
+static void rna_Bone_layer_set(PointerRNA *ptr, int index, int value)
+{
+ Bone *bone= (Bone*)ptr->data;
+
+ if(value) bone->layer |= (1<<index);
+ else {
+ bone->layer &= ~(1<<index);
+ if(bone->layer == 0)
+ bone->layer |= (1<<index);
+ }
+}
+
+
+static void rna_Armature_layer_set(PointerRNA *ptr, int index, int value)
+{
+ bArmature *arm= (bArmature*)ptr->data;
+
+ if(value) arm->layer |= (1<<index);
+ else {
+ arm->layer &= ~(1<<index);
+ if(arm->layer == 0)
+ arm->layer |= (1<<index);
+ }
+}
+
+static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value)
+{
+ bArmature *data= (bArmature*)ptr->data;
+ CLAMP(value, 1, data->ghostef);
+ data->ghostsf= value;
+}
+
+static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
+{
+ bArmature *data= (bArmature*)ptr->data;
+ CLAMP(value, data->ghostsf, MAXFRAMEF/2);
+ data->ghostef= value;
+}
+
+static void rna_Armature_path_start_frame_set(PointerRNA *ptr, int value)
+{
+ bArmature *data= (bArmature*)ptr->data;
+ CLAMP(value, 1, data->pathef);
+ data->pathsf= value;
+}
+
+static void rna_Armature_path_end_frame_set(PointerRNA *ptr, int value)
+{
+ bArmature *data= (bArmature*)ptr->data;
+ CLAMP(value, data->pathsf, MAXFRAMEF/2);
+ data->pathef= value;
+}
+
+#else
+
+// err... bones should not be directly edited (only editbones should be...)
+static void rna_def_bone(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Bone", NULL, "Bone");
+
+ /* pointers/collections */
+ /* parent (pointer) */
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Bone");
+ RNA_def_property_pointer_sdna(prop, NULL, "parent");
+ RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature).");
+
+ /* children (collection) */
+ prop= RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL);
+ RNA_def_property_struct_type(prop, "Bone");
+ RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone");
+
+ /* strings */
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* must be unique */
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* flags */
+ /* layer */
+ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Bone Layers", "Layers bone exists in");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set");
+
+ /* flag */
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED);
+ RNA_def_property_ui_text(prop, "Selected", "");
+
+ prop= RNA_def_property(srna, "head_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL);
+ RNA_def_property_ui_text(prop, "Head Selected", "");
+
+ prop= RNA_def_property(srna, "tail_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL);
+ RNA_def_property_ui_text(prop, "Tail Selected", "");
+
+ prop= RNA_def_property(srna, "connected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
+ RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail.");
+
+ // XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here...
+ prop= RNA_def_property(srna, "posechannel_hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P);
+ RNA_def_property_ui_text(prop, "Pose Channel Hidden", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes).");
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ACTIVE);
+ RNA_def_property_ui_text(prop, "Active", "Bone was the last bone clicked on (most operations are applied to only this bone)");
+
+ prop= RNA_def_property(srna, "hinge", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HINGE);
+ RNA_def_property_ui_text(prop, "Hinge", "Bone doesn't inherit rotation or scale from parent bone.");
+
+ prop= RNA_def_property(srna, "editmode_hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A);
+ RNA_def_property_ui_text(prop, "Edit Mode Hidden", "Bone is not visible when in Edit Mode");
+
+ prop= RNA_def_property(srna, "multiply_vertexgroup_with_envelope", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV);
+ RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence.");
+
+ prop= RNA_def_property(srna, "deform", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM);
+ RNA_def_property_ui_text(prop, "Deform", "Bone does not deform any geometry.");
+
+ prop= RNA_def_property(srna, "inherit_scale", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE);
+ RNA_def_property_ui_text(prop, "Inherit scale", "Bone inherits scaling from parent bone.");
+
+ prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
+ RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes.");
+
+ prop= RNA_def_property(srna, "cyclic_offset", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET);
+ RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it recieves cyclic offset effects.");
+
+ prop= RNA_def_property(srna, "editmode_locked", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_EDITMODE_LOCKED);
+ RNA_def_property_ui_text(prop, "Edit Mode Locked", "Bone is not able to be transformed when in Edit Mode.");
+
+ /* Number values */
+ /* envelope deform settings */
+ prop= RNA_def_property(srna, "envelope_distance", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0, 1000);
+ RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only).");
+
+ prop= RNA_def_property(srna, "envelope_weight", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0, 1000);
+ RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only).");
+
+ prop= RNA_def_property(srna, "radius_head", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "rad_head");
+ //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
+ RNA_def_property_ui_text(prop, "Envelope Radius Head", "Radius of head of bone (for Envelope deform only).");
+
+ prop= RNA_def_property(srna, "radius_tail", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "rad_tail");
+ //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid);
+ RNA_def_property_ui_text(prop, "Envelope Radius Tail", "Radius of tail of bone (for Envelope deform only).");
+
+ /* b-bones deform settings */
+ prop= RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "segments");
+ RNA_def_property_range(prop, 1, 32);
+ RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only).");
+
+ prop= RNA_def_property(srna, "bbone_in", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ease1");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only).");
+
+ prop= RNA_def_property(srna, "bbone_out", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ease2");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only).");
+
+ /* editmode bone coordinates */
+ // XXX not sure if we want to wrap these here... besides, changing these requires changing the matrix?
+ prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Bone Head Location", "In Edit Mode, the location of the 'head' of the bone.");
+
+ prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Bone Tail Location", "In Edit Mode, the location of the 'head' of the bone.");
+
+ prop= RNA_def_property(srna, "roll", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_ui_text(prop, "Bone Roll", "In Edit Mode, the 'roll' (i.e. rotation around the bone vector, equivilant to local Y-axis rotation).");
+}
+
+void rna_def_armature(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_drawtype_items[] = {
+ {ARM_OCTA, "OCTAHEDRAL", "Octahedral", "Draw bones as octahedral shape (default)."},
+ {ARM_LINE, "STICK", "Stick", "Draw bones as simple 2D lines with dots."},
+ {ARM_B_BONE, "BBONE", "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"},
+ {ARM_ENVELOPE, "ENVELOPE", "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_ghosttype_items[] = {
+ {ARM_GHOST_CUR, "CURRENTFRAME", "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."},
+ {ARM_GHOST_RANGE, "RANGE", "In Range", "Draw Ghosts of poses within specified range."},
+ {ARM_GHOST_KEYS, "KEYS", "On Keyframes", "Draw Ghosts of poses on Keyframes."},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Armature", "ID", "Armature");
+ RNA_def_struct_sdna(srna, "bArmature");
+
+ /* Collections */
+ prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
+ RNA_def_property_struct_type(prop, "Bone");
+ RNA_def_property_ui_text(prop, "Bones", "");
+
+ /* Enum values */
+ prop= RNA_def_property(srna, "drawtype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_drawtype_items);
+ RNA_def_property_ui_text(prop, "Draw Type", "");
+
+ prop= RNA_def_property(srna, "ghosttype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_ghosttype_items);
+ RNA_def_property_ui_text(prop, "Ghost Drawing", "Method of Onion-skinning for active Action");
+
+ /* Boolean values */
+ /* layer */
+ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility.");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
+
+ /* layer protection */
+ prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
+ RNA_def_property_array(prop, 16);
+ RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo.");
+
+ /* flag */
+ prop= RNA_def_property(srna, "rest_position", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_RESTPOS);
+ RNA_def_property_ui_text(prop, "Rest Position", "Show Armature in Rest Position. No posing possible.");
+
+ prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
+ RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes.");
+
+ prop= RNA_def_property(srna, "draw_names", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
+ RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names.");
+
+ prop= RNA_def_property(srna, "delay_deform", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM);
+ RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode");
+
+ prop= RNA_def_property(srna, "x_axis_mirror", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT);
+ RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis.");
+
+ prop= RNA_def_property(srna, "auto_ik", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK);
+ RNA_def_property_ui_text(prop, "Auto IK", "Add temporaral IK constraints while grabbing bones in Pose Mode.");
+
+ prop= RNA_def_property(srna, "draw_custom_bone_shapes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM);
+ RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes.");
+
+ prop= RNA_def_property(srna, "draw_group_colors", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM);
+ RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors.");
+
+ prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL);
+ RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Keyframes Only", "");
+
+ /* deformflag */
+ prop= RNA_def_property(srna, "deform_vertexgroups", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP);
+ RNA_def_property_ui_text(prop, "Deform Vertex Groups", "Enable Vertex Groups when defining deform");
+
+ prop= RNA_def_property(srna, "deform_envelope", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE);
+ RNA_def_property_ui_text(prop, "Deform Envelopes", "Enable Bone Envelopes when defining deform");
+
+ prop= RNA_def_property(srna, "deform_quaternion", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION);
+ RNA_def_property_ui_text(prop, "Use Dual Quaternion Deformation", "Enable deform rotation with Quaternions");
+
+ prop= RNA_def_property(srna, "deform_bbone_rest", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST);
+ RNA_def_property_ui_text(prop, "B-Bones Deform in Rest Position", "Make B-Bones deform already in Rest Position");
+
+ //prop= RNA_def_property(srna, "deform_invert_vertexgroups", PROP_BOOLEAN, PROP_NONE);
+ //RNA_def_property_boolean_negative_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP);
+ //RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)");
+
+ /* pathflag */
+ prop= RNA_def_property(srna, "paths_show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_FNUMS);
+ RNA_def_property_ui_text(prop, "Bone Paths Show Frame Numbers", "When drawing Armature in Pose Mode, show frame numbers on Bone Paths");
+
+ prop= RNA_def_property(srna, "paths_highlight_keyframes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFRAS);
+ RNA_def_property_ui_text(prop, "Bone Paths Highlight Keyframes", "When drawing Armature in Pose Mode, emphasize position of keyframes on Bone Paths");
+
+ prop= RNA_def_property(srna, "paths_show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFNOS);
+ RNA_def_property_ui_text(prop, "Bone Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths");
+
+ prop= RNA_def_property(srna, "paths_show_around_current_frame", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_ACFRA);
+ RNA_def_property_ui_text(prop, "Bone Paths Around Current Frame", "When drawing Armature in Pose Mode, only show section of Bone Paths that falls around current frame");
+
+ prop= RNA_def_property(srna, "paths_calculate_head_positions", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_HEADS);
+ RNA_def_property_ui_text(prop, "Bone Paths Use Heads", "When calculating Bone Paths, use Head locations instead of Tips");
+
+ /* Number fields */
+ /* ghost/onionskining settings */
+ prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ghostep");
+ RNA_def_property_range(prop, 0, 30);
+ RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skining method).");
+
+ prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ghostsize");
+ RNA_def_property_range(prop, 1, 20);
+ RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skining method).");
+
+ prop= RNA_def_property(srna, "ghost_start_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ghostsf");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
+
+ prop= RNA_def_property(srna, "ghost_end_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ghostef");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method).");
+
+ /* bone path settings */
+ prop= RNA_def_property(srna, "path_size", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathsize");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Bone Paths Frame Step", "Number of frames between 'dots' on Bone Paths (when drawing).");
+
+ prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathsf");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_start_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "Bone Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations.");
+
+ prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathef");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_end_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations.");
+
+ prop= RNA_def_property(srna, "path_before_current", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathbc");
+ RNA_def_property_range(prop, 1, MAXFRAMEF/2);
+ RNA_def_property_ui_text(prop, "Bone Paths Frames Before Current", "Number of frames before current frame to show on Bone Paths (only for 'Around Current' option).");
+
+ prop= RNA_def_property(srna, "path_after_current", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathac");
+ RNA_def_property_range(prop, 1, MAXFRAMEF/2);
+ RNA_def_property_ui_text(prop, "Bone Paths Frames After Current", "Number of frames after current frame to show on Bone Paths (only for 'Around Current' option).");
+}
+
+void RNA_def_armature(BlenderRNA *brna)
+{
+ rna_def_armature(brna);
+ rna_def_bone(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
new file mode 100644
index 00000000000..9b720370fcc
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -0,0 +1,153 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_brush_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void rna_def_brush(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_blend_items[] = {
+ {BRUSH_BLEND_MIX, "MIX", "Mix", "Use mix blending mode while painting."},
+ {BRUSH_BLEND_ADD, "ADD", "Add", "Use add blending mode while painting."},
+ {BRUSH_BLEND_SUB, "SUB", "Subtract", "Use subtract blending mode while painting."},
+ {BRUSH_BLEND_MUL, "MUL", "Multiply", "Use multiply blending mode while painting."},
+ {BRUSH_BLEND_LIGHTEN, "LIGHTEN", "Lighten", "Use lighten blending mode while painting."},
+ {BRUSH_BLEND_DARKEN, "DARKEN", "Darken", "Use darken blending mode while painting."},
+ {BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", "Erase Alpha", "Erase alpha while painting."},
+ {BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", "Add Alpha", "Add alpha while painting."},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Brush", "ID", "Brush");
+
+ /* enums */
+ prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_blend_items);
+ RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode.");
+
+ /* number values */
+ prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 1, 200);
+ RNA_def_property_ui_text(prop, "Size", "Diameter of the brush.");
+
+ prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "innerradius");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Falloff", "Falloff radius of the brush.");
+
+ prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "spacing");
+ RNA_def_property_range(prop, 1.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps.");
+
+ prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rate");
+ RNA_def_property_range(prop, 0.010f, 1.0f);
+ RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush.");
+
+ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "rgb");
+ RNA_def_property_ui_text(prop, "Color", "");
+ RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "alpha");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Opacity", "The amount of pressure on the brush.");
+
+ /* flag */
+ prop= RNA_def_property(srna, "airbrush", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
+ RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray).");
+
+ prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
+ RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting.");
+
+ prop= RNA_def_property(srna, "alpha_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
+ RNA_def_property_ui_text(prop, "Opacity Pressure", "Enable tablet pressure sensitivity for opacity.");
+
+ prop= RNA_def_property(srna, "size_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
+ RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size.");
+
+ prop= RNA_def_property(srna, "falloff_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAD_PRESSURE);
+ RNA_def_property_ui_text(prop, "Falloff Pressure", "Enable tablet pressure sensitivity for falloff.");
+
+ prop= RNA_def_property(srna, "spacing_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
+ RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing.");
+
+ /* not exposed in the interface yet
+ prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
+ RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/
+
+ /* texture */
+ prop= RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mtex", "");
+ RNA_def_property_struct_type(prop, "UnknownType");
+ RNA_def_property_ui_text(prop, "Textures Slots", "");
+
+ prop= RNA_def_property(srna, "active_texture", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "texact");
+ RNA_def_property_range(prop, 0, MAX_MTEX-1);
+ RNA_def_property_ui_text(prop, "Active Texture", "Active texture index.");
+
+ /* clone tool */
+ prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool.");
+
+ prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display.");
+
+ prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "clone.offset");
+ RNA_def_property_ui_text(prop, "Clone Offset", "");
+ RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3.0f);
+}
+
+void RNA_def_brush(BlenderRNA *brna)
+{
+ rna_def_brush(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
new file mode 100644
index 00000000000..55fc5989fa8
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -0,0 +1,146 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_camera_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_camera(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] = {
+ {CAM_PERSP, "PERSP", "Perspective", ""},
+ {CAM_ORTHO, "ORTHO", "Orthographic", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_lens_unit_items[] = {
+ {0, "MILLIMETERS", "Millimeters", ""},
+ {CAM_ANGLETOGGLE, "DEGREES", "Degrees", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Camera", "ID", "Camera");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Type", "Camera types.");
+
+ /* Number values */
+
+ prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the passepartout area in Camera view.");
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "angle");
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens value in degrees.");
+
+ prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipsta");
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Clip Start", "Camera clipping start.");
+
+ prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipend");
+ RNA_def_property_range(prop, 1.0f, 5000.0f);
+ RNA_def_property_ui_text(prop, "Clip End", "Camera clipping end.");
+
+ prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "lens");
+ RNA_def_property_range(prop, 1.0f, 250.0f);
+ RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm.");
+
+ prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
+ RNA_def_property_range(prop, 0.01f, 1000.0f);
+ RNA_def_property_ui_text(prop, "Orthographic Scale", "Ortographic Camera scale.");
+
+ prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "drawsize");
+ RNA_def_property_range(prop, 0.1f, 10.0f);
+ RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View.");
+
+ prop= RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "shiftx");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift.");
+
+ prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "shifty");
+ RNA_def_property_range(prop, -2.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift.");
+
+ prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
+ RNA_def_property_range(prop, 0.0f, 5000.0f);
+ RNA_def_property_ui_text(prop, "DOF Distance", "Depth of field distance.");
+
+ /* flag */
+ prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS);
+ RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focal point in Camera view.");
+
+ prop= RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST);
+ RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area.");
+
+ prop= RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT);
+ RNA_def_property_ui_text(prop, "Show Passepartout", "Enable passepartout mode in Camera view.");
+
+ prop= RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE);
+ RNA_def_property_ui_text(prop, "Show Title Safe", "Draw a title safe zone in Camera view.");
+
+ prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME);
+ RNA_def_property_ui_text(prop, "Show Name", "Draw the active Camera's name in Camera view.");
+
+ prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_lens_unit_items);
+ RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface.");
+
+ /* pointers */
+ rna_def_ipo_common(srna);
+
+ prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
+ RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point.");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
new file mode 100644
index 00000000000..c3ebf591d81
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -0,0 +1,233 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "DNA_color_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_colortools.h"
+
+static int rna_CurveMapping_curves_length(PointerRNA *ptr)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+ int len;
+
+ for(len=0; len<CM_TOT; len++)
+ if(!cumap->cm[len].curve)
+ break;
+
+ return len;
+}
+
+static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), NULL);
+}
+
+static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ if(value) cumap->flag |= CUMA_DO_CLIP;
+ else cumap->flag &= ~CUMA_DO_CLIP;
+
+ curvemapping_changed(cumap, 0);
+}
+
+static void rna_CurveMapping_black_level_set(PointerRNA *ptr, int index, float value)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+ cumap->black[index]= value;
+ curvemapping_set_black_white(cumap, NULL, NULL);
+}
+
+static void rna_CurveMapping_white_level_set(PointerRNA *ptr, int index, float value)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+ cumap->white[index]= value;
+ curvemapping_set_black_white(cumap, NULL, NULL);
+}
+
+static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ *min= -100.0f;
+ *max= cumap->clipr.xmax;
+}
+
+static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ *min= -100.0f;
+ *max= cumap->clipr.ymax;
+}
+
+static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ *min= cumap->clipr.xmin;
+ *max= 100.0f;
+}
+
+static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max)
+{
+ CurveMapping *cumap= (CurveMapping*)ptr->data;
+
+ *min= cumap->clipr.ymin;
+ *max= 100.0f;
+}
+
+#else
+
+static void rna_def_curvemappoint(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_handle_type_items[] = {
+ {0, "AUTO", "Auto Handle", ""},
+ {CUMA_VECTOR, "VECTOR", "Vector Handle", ""},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna= RNA_def_struct(brna, "CurveMapPoint", NULL, "CurveMapPoint");
+
+ /* not editable for now, need to have CurveMapping to do curvemapping_changed */
+
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ prop= RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_handle_type_items);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Handle Type", "");
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_SELECT);
+ RNA_def_property_ui_text(prop, "Selected", "");
+}
+
+static void rna_def_curvemap(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_extend_items[] = {
+ {0, "HORIZONTAL", "Horizontal", ""},
+ {CUMA_EXTEND_EXTRAPOLATE, "EXTRAPOLATED", "Extrapolated", ""},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna= RNA_def_struct(brna, "CurveMap", NULL, "CurveMap");
+
+ /* not editable for now, need to have CurveMapping to do curvemapping_changed */
+
+ prop= RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_extend_items);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Extend", "");
+
+ prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "curve", "totpoint");
+ RNA_def_property_struct_type(prop, "CurveMapPoint");
+ RNA_def_property_ui_text(prop, "Points", "");
+}
+
+static void rna_def_curvemapping(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "CurveMapping", NULL, "CurveMapping");
+
+ prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
+ RNA_def_property_ui_text(prop, "Clip", "");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set");
+
+ prop= RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipr.xmin");
+ RNA_def_property_range(prop, -100.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Clip Min X", "");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminx_range");
+
+ prop= RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipr.ymin");
+ RNA_def_property_range(prop, -100.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Clip Min Y", "");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminy_range");
+
+ prop= RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipr.xmax");
+ RNA_def_property_range(prop, -100.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Clip Max X", "");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxx_range");
+
+ prop= RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipr.ymax");
+ RNA_def_property_range(prop, -100.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Clip Max Y", "");
+ RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");
+
+ prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_CurveMapping_curves_length", 0, 0);
+ RNA_def_property_struct_type(prop, "CurveMap");
+ RNA_def_property_ui_text(prop, "Curves", "");
+
+ prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "black");
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10, 3);
+ RNA_def_property_ui_text(prop, "Black Level", "");
+ RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
+
+ prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "white");
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10, 3);
+ RNA_def_property_ui_text(prop, "White Level", "");
+ RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);
+}
+
+void RNA_def_color(BlenderRNA *brna)
+{
+ rna_def_curvemappoint(brna);
+ rna_def_curvemap(brna);
+ rna_def_curvemapping(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
new file mode 100644
index 00000000000..5e1f2ed53e3
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -0,0 +1,137 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_constraint_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+/* base struct for constraints */
+void rna_def_constraint_basedata(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem type_items[] ={
+ {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""},
+ {CONSTRAINT_TYPE_CHILDOF, "CHILDOF", "Child Of", ""},
+ {CONSTRAINT_TYPE_TRACKTO, "TRACKTO", "Track To", ""},
+ {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""},
+ {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOWPATH", "Follow Path", ""},
+ {CONSTRAINT_TYPE_ROTLIMIT, "LIMITROT", "Limit Rotation", ""},
+ {CONSTRAINT_TYPE_LOCLIMIT, "LIMITLOC", "Limit Location", ""},
+ {CONSTRAINT_TYPE_SIZELIMIT, "LIMITSCALE", "Limit Scale", ""},
+ {CONSTRAINT_TYPE_ROTLIKE, "COPYROT", "Copy Rotation", ""},
+ {CONSTRAINT_TYPE_LOCLIKE, "COPYLOC", "Copy Location", ""},
+ {CONSTRAINT_TYPE_SIZELIKE, "COPYSCALE", "Copy Scale", ""},
+ {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""},
+ {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""},
+ {CONSTRAINT_TYPE_LOCKTRACK, "LOCKTRACK", "Locked Track", ""},
+ {CONSTRAINT_TYPE_DISTLIMIT, "LIMITDIST", "Limit Distance", ""},
+ {CONSTRAINT_TYPE_STRETCHTO, "STRETCHTO", "Stretch To", ""},
+ {CONSTRAINT_TYPE_MINMAX, "FLOOR", "Floor", ""},
+ {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGIDBODYJOINT", "Rigid Body Joint", ""},
+ {CONSTRAINT_TYPE_CLAMPTO, "CLAMPTO", "Clamp To", ""},
+ {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem space_items[] ={
+ {CONSTRAINT_SPACE_WORLD, "WORLD", "World Space", "World/Global space."},
+ {CONSTRAINT_SPACE_LOCAL, "LOCAL", "Local", "For objects (relative to parent/without parent influence). | For bones (along normals of bone, without parent/restpositions)."},
+ {CONSTRAINT_SPACE_POSE, "POSE", "Pose", "Pose/Armature space (only for Pose Channels)."},
+ {CONSTRAINT_SPACE_PARLOCAL, "PARLOCAL", "Local With Parent", "'Local' space with Parent transform taken into account (only for Pose Channels)."},
+ {0, NULL, NULL, NULL}};
+
+ /* data */
+ srna= RNA_def_struct(brna, "Constraint", NULL , "Constraint");
+ RNA_def_struct_sdna(srna, "bConstraint");
+
+ /* strings */
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+ /* flags */
+ // XXX do we want to wrap this?
+ prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
+ RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI.");
+
+ // XXX this is really an internal flag, but it may be useful for some tools to be able to access this...
+ prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE);
+ RNA_def_property_ui_text(prop, "Disabled", "Constraint has invalid settings and will not be evaluated.");
+
+ // TODO: setting this to true must ensure that all others in stack are turned off too...
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE);
+ RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited ");
+
+ prop= RNA_def_property(srna, "own_ipo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OWN_IPO);
+ RNA_def_property_ui_text(prop, "Local IPO", "Constraint has its own IPO data.");
+
+ prop= RNA_def_property(srna, "proxy_local", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL);
+ RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature).");
+
+
+ /* pointers */
+ // err... how to enable this to work, since data pointer can be of various types?
+ //prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
+ //RNA_def_property_ui_text(prop, "Settings", "Settings specific to this constraint type.");
+
+ prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "IPO", "Local IPO data.");
+}
+
+/* ---- */
+
+/* ---- */
+
+void RNA_def_constraint(BlenderRNA *brna)
+{
+ /* basic constraint struct (inherited data) */
+ rna_def_constraint_basedata(brna);
+
+ /* add data for specific constraint struct types here... */
+
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
new file mode 100644
index 00000000000..3b52069f556
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -0,0 +1,122 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_controller_types.h"
+
+#ifdef RNA_RUNTIME
+
+static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
+{
+ bController *controller= (bController*)ptr->data;
+
+ switch(controller->type) {
+ case CONT_LOGIC_AND:
+ return &RNA_AndController;
+ case CONT_LOGIC_OR:
+ return &RNA_OrController;
+ case CONT_LOGIC_NAND:
+ return &RNA_NandController;
+ case CONT_LOGIC_NOR:
+ return &RNA_NorController;
+ case CONT_LOGIC_XOR:
+ return &RNA_XorController;
+ case CONT_LOGIC_XNOR:
+ return &RNA_XnorController;
+ case CONT_EXPRESSION:
+ return &RNA_ExpressionController;
+ case CONT_PYTHON:
+ return &RNA_PythonController;
+ default:
+ return &RNA_Controller;
+ }
+}
+
+#else
+
+void RNA_def_controller(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem controller_type_items[] ={
+ {CONT_LOGIC_AND, "LOGICAND", "Logic And", ""},
+ {CONT_LOGIC_OR, "LOGICOR", "Logic Or", ""},
+ {CONT_LOGIC_NAND, "LOGICNAND", "Logic Nand", ""},
+ {CONT_LOGIC_NOR, "LOGICNOR", "Logic Nor", ""},
+ {CONT_LOGIC_XOR, "LOGICXOR", "Logic Xor", ""},
+ {CONT_LOGIC_XNOR, "LOGICXNOR", "Logic Xnor", ""},
+ {CONT_EXPRESSION, "EXPRESSION", "Expression", ""},
+ {CONT_PYTHON, "PYTHON", "Python Script", ""},
+ {0, NULL, NULL, NULL}};
+
+ /* Controller */
+ srna= RNA_def_struct(brna, "Controller", NULL , "Controller");
+ RNA_def_struct_sdna(srna, "bController");
+ RNA_def_struct_funcs(srna, NULL, "rna_Controller_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* type is not editable, would need to do proper data free/alloc */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, controller_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+ /* Expression Controller */
+ srna= RNA_def_struct(brna, "ExpressionController", "Controller", "Expression Controller");
+ RNA_def_struct_sdna_from(srna, "bExpressionCont", "data");
+
+ prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "str");
+ RNA_def_property_string_maxlength(prop, 127);
+ RNA_def_property_ui_text(prop, "Expression", "");
+
+ /* Python Controller */
+ srna= RNA_def_struct(brna, "PythonController", "Controller" , "Python Controller");
+ RNA_def_struct_sdna_from(srna, "bPythonCont", "data");
+
+ prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_ui_text(prop, "Python Text", "");
+
+ /* Other Controllers */
+ RNA_def_struct(brna, "AndController", "Controller", "And Controller");
+ RNA_def_struct(brna, "OrController", "Controller", "Or Controller");
+ RNA_def_struct(brna, "NorController", "Controller", "Nor Controller");
+ RNA_def_struct(brna, "NandController", "Controller", "Nand Controller");
+ RNA_def_struct(brna, "XorController", "Controller", "Xor Controller");
+ RNA_def_struct(brna, "XnorController", "Controller", "Xnor Controller");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
new file mode 100644
index 00000000000..c83bafc1c4c
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -0,0 +1,357 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_curve_types.h"
+
+#ifdef RNA_RUNTIME
+
+static int rna_Curve_texspace_editable(PointerRNA *ptr)
+{
+ Curve *cu= (Curve*)ptr->data;
+ return (cu->texflag & CU_AUTOSPACE)? PROP_NOT_EDITABLE: 0;
+}
+
+#else
+
+static void rna_def_path(BlenderRNA *brna, StructRNA *srna);
+static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna);
+static void rna_def_font(BlenderRNA *brna, StructRNA *srna);
+
+void rna_def_curve(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Curve", "ID", "Curve");
+
+ rna_def_ipo_common(srna);
+ rna_def_texmat_common(srna, "rna_Curve_texspace_editable");
+
+ prop= RNA_def_property(srna, "key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Shape Keys", "");
+
+ rna_def_path(brna, srna);
+ rna_def_nurbs(brna, srna);
+ rna_def_font(brna, srna);
+
+ /* Number values */
+ prop= RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "bevresol");
+ RNA_def_property_range(prop, 0, 32);
+ RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined.");
+
+ prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "width");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor.");
+
+ prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ext1");
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object.");
+
+ prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ext2");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object.");
+
+ prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolu");
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_text(prop, "U Resolution", "Surface resolution in U direction.");
+
+ prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolv");
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_text(prop, "V Resolution", "Surface resolution in V direction.");
+
+ prop= RNA_def_property(srna, "resolution_u_rendering", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "U Resolution (Rendering)", "Surface resolution in U direction used while rendering. Zero skips this property.");
+
+ prop= RNA_def_property(srna, "resolution_v_rendering", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "V Resolution (Rendering)", "Surface resolution in V direction used while rendering. Zero skips this property.");
+
+ /* pointers */
+ prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
+ RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape.");
+
+ prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
+ RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width).");
+
+ /* Flags */
+ prop= RNA_def_property(srna, "3d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_3D);
+ RNA_def_property_ui_text(prop, "3D Curve", "Define curve in three dimensions. Note that in this case fill won't work.");
+
+ prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
+ RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves.");
+
+ prop= RNA_def_property(srna, "back", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
+ RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves.");
+
+ prop= RNA_def_property(srna, "retopo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_RETOPO);
+ RNA_def_property_ui_text(prop, "Retopo", "Turn on the re-topology tool.");
+}
+
+static void rna_def_path(BlenderRNA *brna, StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ /* number values */
+ prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathlen");
+ RNA_def_property_range(prop, 1, 32767);
+ RNA_def_property_ui_text(prop, "Path Length", "If no speed IPO was set, the length of path in frames.");
+
+ /* flags */
+ prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH);
+ RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path.");
+
+ prop= RNA_def_property(srna, "follow", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW);
+ RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path.");
+
+ prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH);
+ RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path.");
+
+ prop= RNA_def_property(srna, "offset_path_distance", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST);
+ RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset.");
+}
+
+static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ /* flags */
+ prop= RNA_def_property(srna, "uv_orco", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
+ RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'.");
+
+ prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_NOPUNOFLIP);
+ RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
+}
+
+static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ /* number values */
+ prop= RNA_def_property(srna, "text_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fsize");
+ RNA_def_property_range(prop, 0.1f, 10.0f);
+ RNA_def_property_ui_text(prop, "Text Size", "");
+
+ prop= RNA_def_property(srna, "line_dist", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "linedist");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Distance Between Lines of Text", "");
+
+ prop= RNA_def_property(srna, "word_spacing", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "wordspace");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Word Spacing", "");
+
+ prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "spacing");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Character Spacing", "");
+
+ prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "shear");
+ RNA_def_property_range(prop, -1.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters.");
+
+ prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "xof");
+ RNA_def_property_range(prop, -50.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center.");
+
+ prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "yof");
+ RNA_def_property_range(prop, -50.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center.");
+
+ prop= RNA_def_property(srna, "ul_position", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ulpos");
+ RNA_def_property_range(prop, -0.2f, 0.8f);
+ RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline.");
+
+ prop= RNA_def_property(srna, "ul_height", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ulheight");
+ RNA_def_property_range(prop, -0.2f, 0.8f);
+ RNA_def_property_ui_text(prop, "Underline Thickness", "");
+
+ prop= RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "actbox");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Active Textbox", "");
+
+ /* strings */
+ prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_maxlength(prop, 21);
+ RNA_def_property_ui_text(prop, "Family", "Blender uses font from selfmade objects.");
+
+ prop= RNA_def_property(srna, "str", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "str");
+ RNA_def_property_ui_text(prop, "String", "");
+ RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
+ RNA_def_property_string_maxlength(prop, 8192); /* note that originally str did not have a limit! */
+ RNA_def_struct_name_property(srna, prop);
+
+ /* pointers */
+ prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
+ RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object.");
+
+ prop= RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "vfont");
+ RNA_def_property_ui_text(prop, "Font", "");
+
+ prop= RNA_def_property(srna, "textbox", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "tb");
+ RNA_def_property_ui_text(prop, "Textbox", "");
+
+ /*
+ TODO: struct CharInfo curinfo;
+
+ Obviously a pointer won't work in this case.
+ */
+ /*
+ prop= RNA_def_property(srna, "curinfo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
+ RNA_def_property_ui_text(prop, "curinfo", "");
+ */
+
+ /* flags */
+ prop= RNA_def_property(srna, "fast", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
+ RNA_def_property_ui_text(prop, "Fast", "Don't fill polygons while editing.");
+
+ prop= RNA_def_property(srna, "left_align", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_LEFT);
+ RNA_def_property_ui_text(prop, "Left Align", "Left align the text from the object center.");
+
+ prop= RNA_def_property(srna, "middle_align", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_MIDDLE);
+ RNA_def_property_ui_text(prop, "Middle Align", "Middle align the text from the object center.");
+
+ prop= RNA_def_property(srna, "right_align", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_RIGHT);
+ RNA_def_property_ui_text(prop, "Right Align", "Right align the text from the object center.");
+
+ prop= RNA_def_property(srna, "justify", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_JUSTIFY);
+ RNA_def_property_ui_text(prop, "Justify", "Fill complete lines to maximum textframe width.");
+
+ prop= RNA_def_property(srna, "flush", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "spacemode", CU_FLUSH);
+ RNA_def_property_ui_text(prop, "Left Align", "Fill every line to maximum textframe width distributing space among all characters.");
+}
+
+void rna_def_textbox(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "TextBox", NULL, "TextBox");
+
+ /* number values */
+ prop= RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "x");
+ RNA_def_property_range(prop, -50.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "Textbox X Offset", "");
+
+ prop= RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "y");
+ RNA_def_property_range(prop, -50.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "Textbox Y Offset", "");
+
+ prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "w");
+ RNA_def_property_range(prop, 0.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "Textbox Width", "");
+
+ prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "h");
+ RNA_def_property_range(prop, 0.0f, 50.0f);
+ RNA_def_property_ui_text(prop, "Textbox Height", "");
+}
+
+void rna_def_charinfo(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "CharInfo", NULL, "CharInfo");
+
+ /* flags */
+ prop= RNA_def_property(srna, "style", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STYLE);
+ RNA_def_property_ui_text(prop, "Style", "");
+
+ prop= RNA_def_property(srna, "bold", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BOLD);
+ RNA_def_property_ui_text(prop, "Bold", "");
+
+ prop= RNA_def_property(srna, "italic", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_ITALIC);
+ RNA_def_property_ui_text(prop, "Italic", "");
+
+ prop= RNA_def_property(srna, "underline", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UNDERLINE);
+ RNA_def_property_ui_text(prop, "Underline", "");
+
+ prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_WRAP);
+ RNA_def_property_ui_text(prop, "Wrap", "");
+}
+
+void RNA_def_curve(BlenderRNA *brna)
+{
+ rna_def_curve(brna);
+ rna_def_textbox(brna);
+ rna_def_charinfo(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
new file mode 100644
index 00000000000..77093938c55
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -0,0 +1,1408 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <float.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_genfile.h"
+#include "DNA_sdna_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+/* Global used during defining */
+
+BlenderDefRNA DefRNA = {0, {0, 0}, {0, 0}, 0, 0, 0};
+
+/* Duplicated code since we can't link in blenkernel or blenlib */
+
+#ifndef MIN2
+#define MIN2(x,y) ((x)<(y)? (x): (y))
+#define MAX2(x,y) ((x)>(y)? (x): (y))
+#endif
+
+void rna_addtail(ListBase *listbase, void *vlink)
+{
+ Link *link= vlink;
+
+ link->next = NULL;
+ link->prev = listbase->last;
+
+ if (listbase->last) ((Link *)listbase->last)->next = link;
+ if (listbase->first == 0) listbase->first = link;
+ listbase->last = link;
+}
+
+void rna_remlink(ListBase *listbase, void *vlink)
+{
+ Link *link= vlink;
+
+ if (link->next) link->next->prev = link->prev;
+ if (link->prev) link->prev->next = link->next;
+
+ if (listbase->last == link) listbase->last = link->prev;
+ if (listbase->first == link) listbase->first = link->next;
+}
+
+void rna_freelinkN(ListBase *listbase, void *vlink)
+{
+ rna_remlink(listbase, vlink);
+ MEM_freeN(vlink);
+}
+
+void rna_freelistN(ListBase *listbase)
+{
+ Link *link, *next;
+
+ for(link=listbase->first; link; link=next) {
+ next= link->next;
+ MEM_freeN(link);
+ }
+
+ listbase->first= listbase->last= NULL;
+}
+
+/* DNA utility function for looking up members */
+
+typedef struct DNAStructMember {
+ char *type;
+ char *name;
+ int arraylength;
+ int pointerlevel;
+} DNAStructMember;
+
+static int rna_member_cmp(const char *name, const char *oname)
+{
+ int a=0;
+
+ /* compare without pointer or array part */
+ while(name[0]=='*')
+ name++;
+ while(oname[0]=='*')
+ oname++;
+
+ while(1) {
+ if(name[a]=='[' && oname[a]==0) return 1;
+ if(name[a]==0) break;
+ if(name[a] != oname[a]) return 0;
+ a++;
+ }
+ if(name[a]==0 && oname[a] == '.') return 2;
+ if(name[a]==0 && oname[a] == '-' && oname[a+1] == '>') return 3;
+
+ return (name[a] == oname[a]);
+}
+
+static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *membername, DNAStructMember *smember)
+{
+ char *dnaname;
+ short *sp;
+ int a, b, structnr, totmember, cmp;
+
+ structnr= DNA_struct_find_nr(sdna, structname);
+ if(structnr == -1)
+ return 0;
+
+ sp= sdna->structs[structnr];
+ totmember= sp[1];
+ sp+= 2;
+
+ for(a=0; a<totmember; a++, sp+=2) {
+ dnaname= sdna->names[sp[1]];
+
+ cmp= rna_member_cmp(dnaname, membername);
+
+ if(cmp == 1) {
+ smember->type= sdna->types[sp[0]];
+ smember->name= dnaname;
+ smember->arraylength= DNA_elem_array_size(smember->name, strlen(smember->name));
+
+ smember->pointerlevel= 0;
+ for(b=0; dnaname[b] == '*'; b++)
+ smember->pointerlevel++;
+
+ return 1;
+ }
+ else if(cmp == 2) {
+ membername= strstr(membername, ".") + strlen(".");
+ return rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
+ }
+ else if(cmp == 3) {
+ membername= strstr(membername, "->") + strlen("->");
+ return rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
+ }
+ }
+
+ return 0;
+}
+
+/* Blender Data Definition */
+
+BlenderRNA *RNA_create()
+{
+ BlenderRNA *brna;
+
+ brna= MEM_callocN(sizeof(BlenderRNA), "BlenderRNA");
+
+ DefRNA.sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0);
+ DefRNA.structs.first= DefRNA.structs.last= NULL;
+ DefRNA.error= 0;
+ DefRNA.preprocess= 1;
+
+ return brna;
+}
+
+void RNA_define_free(BlenderRNA *brna)
+{
+ StructDefRNA *srna;
+ AllocDefRNA *alloc;
+
+ for(alloc=DefRNA.allocs.first; alloc; alloc=alloc->next)
+ MEM_freeN(alloc->mem);
+ rna_freelistN(&DefRNA.allocs);
+
+ for(srna=DefRNA.structs.first; srna; srna=srna->next)
+ rna_freelistN(&srna->properties);
+
+ rna_freelistN(&DefRNA.structs);
+
+ if(DefRNA.sdna) {
+ DNA_sdna_free(DefRNA.sdna);
+ DefRNA.sdna= NULL;
+ }
+
+ DefRNA.error= 0;
+}
+
+void RNA_free(BlenderRNA *brna)
+{
+ StructRNA *srna, *nextsrna;
+ PropertyRNA *prop, *nextprop;
+
+ if(DefRNA.preprocess) {
+ RNA_define_free(brna);
+
+ for(srna=brna->structs.first; srna; srna=srna->next)
+ rna_freelistN(&srna->properties);
+
+ rna_freelistN(&brna->structs);
+
+ MEM_freeN(brna);
+ }
+ else {
+ for(srna=brna->structs.first; srna; srna=nextsrna) {
+ nextsrna= srna->next;
+
+ for(prop=srna->properties.first; prop; prop=nextprop) {
+ nextprop= prop->next;
+
+ if(prop->flag & PROP_RUNTIME)
+ rna_freelinkN(&srna->properties, prop);
+ }
+
+ if(srna->flag & STRUCT_RUNTIME)
+ rna_freelinkN(&brna->structs, srna);
+ }
+ }
+}
+
+static size_t rna_property_type_sizeof(PropertyType type)
+{
+ switch(type) {
+ case PROP_BOOLEAN: return sizeof(BooleanPropertyRNA);
+ case PROP_INT: return sizeof(IntPropertyRNA);
+ case PROP_FLOAT: return sizeof(FloatPropertyRNA);
+ case PROP_STRING: return sizeof(StringPropertyRNA);
+ case PROP_ENUM: return sizeof(EnumPropertyRNA);
+ case PROP_POINTER: return sizeof(PointerPropertyRNA);
+ case PROP_COLLECTION: return sizeof(CollectionPropertyRNA);
+ default: return 0;
+ }
+}
+
+static StructDefRNA *rna_find_def_struct(StructRNA *srna)
+{
+ StructDefRNA *ds;
+
+ for(ds=DefRNA.structs.first; ds; ds=ds->next)
+ if(ds->srna == srna)
+ return ds;
+
+ return NULL;
+}
+
+static PropertyDefRNA *rna_find_def_property(StructRNA *srna, PropertyRNA *prop)
+{
+ StructDefRNA *ds= rna_find_def_struct(srna);
+ PropertyDefRNA *dp;
+
+ if(ds)
+ for(dp=ds->properties.first; dp; dp=dp->next)
+ if(dp->prop == prop)
+ return dp;
+
+ return NULL;
+}
+
+/* Struct Definition */
+
+StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from, const char *name)
+{
+ StructRNA *srna, *srnafrom= NULL;
+ StructDefRNA *ds= NULL, *dsfrom= NULL;
+ PropertyRNA *prop, *propfrom;
+
+ if(from) {
+ /* find struct to derive from */
+ for(srnafrom= brna->structs.first; srnafrom; srnafrom=srnafrom->next)
+ if(strcmp(srnafrom->identifier, from) == 0)
+ break;
+
+ if(!srnafrom) {
+ fprintf(stderr, "RNA_def_struct: struct %s not found to define %s.\n", from, identifier);
+ DefRNA.error= 1;
+ }
+ }
+
+ srna= MEM_callocN(sizeof(StructRNA), "StructRNA");
+ DefRNA.laststruct= srna;
+
+ if(srnafrom) {
+ /* copy from struct to derive stuff, a bit clumsy since we can't
+ * use MEM_dupallocN, data structs may not be alloced but builtin */
+ memcpy(srna, srnafrom, sizeof(StructRNA));
+ srna->properties.first= srna->properties.last= NULL;
+
+ if(DefRNA.preprocess) {
+ srna->from= (StructRNA*)from;
+ dsfrom= rna_find_def_struct(srnafrom);
+ }
+ else
+ srna->from= srnafrom;
+ }
+
+ srna->identifier= identifier;
+ srna->name= name;
+
+ rna_addtail(&brna->structs, srna);
+
+ if(DefRNA.preprocess) {
+ ds= MEM_callocN(sizeof(StructDefRNA), "StructDefRNA");
+ ds->srna= srna;
+ rna_addtail(&DefRNA.structs, ds);
+
+ if(dsfrom)
+ ds->dnafromname= dsfrom->dnaname;
+ }
+
+ /* in preprocess, try to find sdna */
+ if(DefRNA.preprocess)
+ RNA_def_struct_sdna(srna, srna->identifier);
+ else
+ srna->flag |= STRUCT_RUNTIME;
+
+ if(srnafrom) {
+ /* copy from struct to derive stuff, a bit clumsy since we can't
+ * use MEM_dupallocN, data structs may not be alloced but builtin */
+
+ for(propfrom= srnafrom->properties.first; propfrom; propfrom=propfrom->next) {
+ prop= RNA_def_property(srna, propfrom->identifier, propfrom->type, propfrom->subtype);
+
+ rna_remlink(&srna->properties, prop);
+ memcpy(prop, propfrom, rna_property_type_sizeof(propfrom->type));
+
+ if(!DefRNA.preprocess)
+ prop->flag |= PROP_RUNTIME;
+
+ prop->next= prop->prev= NULL;
+ rna_addtail(&srna->properties, prop);
+
+ if(propfrom == srnafrom->nameproperty)
+ srna->nameproperty= prop;
+ if(propfrom == srnafrom->iteratorproperty)
+ srna->iteratorproperty= prop;
+
+ if(DefRNA.preprocess) {
+ PropertyDefRNA *dp, *dpfrom;
+
+ dp= ds->properties.last;
+ dpfrom= rna_find_def_property(srnafrom, propfrom);
+
+ rna_remlink(&ds->properties, dp);
+ memcpy(dp, dpfrom, sizeof(*dp));
+ dp->srna= srna;
+ dp->prop= prop;
+ dp->next= dp->prev= NULL;
+ rna_addtail(&ds->properties, dp);
+ }
+ }
+ }
+ else {
+ /* define some builtin properties */
+ prop= RNA_def_property(srna, "rna_properties", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_BUILTIN);
+ RNA_def_property_ui_text(prop, "Properties", "RNA property collection.");
+
+ if(DefRNA.preprocess) {
+ RNA_def_property_struct_type(prop, "Property");
+ RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", 0, 0, 0, 0);
+ }
+ else {
+#ifdef RNA_RUNTIME
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ cprop->begin= rna_builtin_properties_begin;
+ cprop->next= rna_builtin_properties_next;
+ cprop->next= rna_iterator_listbase_end;
+ cprop->get= rna_builtin_properties_get;
+ cprop->structtype= &RNA_Property;
+#endif
+ }
+
+ prop= RNA_def_property(srna, "rna_type", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "RNA", "RNA type definition.");
+
+ if(DefRNA.preprocess) {
+ RNA_def_property_struct_type(prop, "Struct");
+ RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL);
+ }
+ else {
+#ifdef RNA_RUNTIME
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ pprop->get= rna_builtin_type_get;
+ pprop->structtype= &RNA_Struct;
+#endif
+ }
+ }
+
+ return srna;
+}
+
+void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
+{
+ StructDefRNA *ds= DefRNA.structs.last;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_struct_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_struct_sdna: %s not found.\n", structname);
+ DefRNA.error= 1;
+ }
+ return;
+ }
+
+ ds->dnaname= structname;
+}
+
+void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const char *propname)
+{
+ StructDefRNA *ds= DefRNA.structs.last;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_struct_sdna_from: only during preprocessing.\n");
+ return;
+ }
+
+ if(!ds->dnaname) {
+ fprintf(stderr, "RNA_def_struct_sdna_from: %s base struct must know DNA already.\n", structname);
+ return;
+ }
+
+ if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_struct_sdna_from: %s not found.\n", structname);
+ DefRNA.error= 1;
+ }
+ return;
+ }
+
+ ds->dnafromprop= propname;
+ ds->dnaname= structname;
+}
+
+void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
+{
+ if(prop->type != PROP_STRING) {
+ fprintf(stderr, "RNA_def_struct_name_property: %s.%s, must be a string property.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ else
+ srna->nameproperty= prop;
+}
+
+void RNA_def_struct_flag(StructRNA *srna, int flag)
+{
+ srna->flag= flag;
+}
+
+void RNA_def_struct_funcs(StructRNA *srna, const char *notify, const char *refine)
+{
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_struct_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ if(notify) srna->notify= (NotifyFunc)notify;
+ if(refine) srna->refine= (StructRefineFunc)refine;
+}
+
+
+void RNA_def_struct_identifier(StructRNA *srna, const char *identifier, const char *name)
+{
+ if(DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_struct_name_runtime: only at runtime.\n");
+ return;
+ }
+
+ srna->identifier= identifier;
+ srna->name= name;
+}
+
+/* Property Definition */
+
+PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, int subtype)
+{
+ StructDefRNA *ds;
+ PropertyDefRNA *dp= NULL;
+ PropertyRNA *prop;
+
+ if(DefRNA.preprocess) {
+ ds= DefRNA.structs.last;
+ dp= MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
+ rna_addtail(&ds->properties, dp);
+ }
+
+ prop= MEM_callocN(rna_property_type_sizeof(type), "PropertyRNA");
+
+ switch(type) {
+ case PROP_BOOLEAN:
+ break;
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+
+ iprop->hardmin= (subtype == PROP_UNSIGNED)? 0: INT_MIN;
+ iprop->hardmax= INT_MAX;
+
+ iprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
+ iprop->softmax= 10000;
+ iprop->step= 1;
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+
+ fprop->hardmin= (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
+ fprop->hardmax= FLT_MAX;
+
+ fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
+ fprop->softmax= 10000.0f;
+ fprop->step= 10;
+ fprop->precision= 3;
+ break;
+ }
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+
+ sprop->defaultvalue= "";
+ sprop->maxlength= 0;
+ break;
+ }
+ case PROP_ENUM:
+ case PROP_POINTER:
+ case PROP_COLLECTION:
+ break;
+ default:
+ fprintf(stderr, "RNA_def_property: %s.%s, invalid property type.\n", srna->identifier, identifier);
+ DefRNA.error= 1;
+ return NULL;
+ }
+
+ if(DefRNA.preprocess) {
+ dp->srna= srna;
+ dp->prop= prop;
+ }
+
+ prop->magic= RNA_MAGIC;
+ prop->identifier= identifier;
+ prop->type= type;
+ prop->subtype= subtype;
+ prop->name= identifier;
+ prop->description= "";
+
+ if(type == PROP_COLLECTION || type == PROP_POINTER)
+ prop->flag= PROP_NOT_EDITABLE|PROP_NOT_DRIVEABLE;
+
+ if(DefRNA.preprocess) {
+ switch(type) {
+ case PROP_BOOLEAN:
+ DefRNA.silent= 1;
+ RNA_def_property_boolean_sdna(prop, NULL, identifier, 0);
+ DefRNA.silent= 0;
+ break;
+ case PROP_INT: {
+ DefRNA.silent= 1;
+ RNA_def_property_int_sdna(prop, NULL, identifier);
+ DefRNA.silent= 0;
+ break;
+ }
+ case PROP_FLOAT: {
+ DefRNA.silent= 1;
+ RNA_def_property_float_sdna(prop, NULL, identifier);
+ DefRNA.silent= 0;
+ break;
+ }
+ case PROP_STRING: {
+ DefRNA.silent= 1;
+ RNA_def_property_string_sdna(prop, NULL, identifier);
+ DefRNA.silent= 0;
+ break;
+ }
+ case PROP_ENUM:
+ DefRNA.silent= 1;
+ RNA_def_property_enum_sdna(prop, NULL, identifier);
+ DefRNA.silent= 0;
+ break;
+ case PROP_POINTER:
+ DefRNA.silent= 1;
+ RNA_def_property_pointer_sdna(prop, NULL, identifier);
+ DefRNA.silent= 0;
+ break;
+ case PROP_COLLECTION:
+ DefRNA.silent= 1;
+ RNA_def_property_collection_sdna(prop, NULL, identifier, NULL);
+ DefRNA.silent= 0;
+ break;
+ }
+ }
+ else
+ prop->flag |= PROP_IDPROPERTY|PROP_RUNTIME;
+
+ rna_addtail(&srna->properties, prop);
+
+ return prop;
+}
+
+void RNA_def_property_flag(PropertyRNA *prop, int flag)
+{
+#if 0
+ StructRNA *srna;
+#endif
+
+ prop->flag |= flag;
+
+#if 0
+ if(prop->type != PROP_POINTER && prop->type != PROP_COLLECTION) {
+ if(flag & (PROP_EVALUATE_DEPENDENCY|PROP_INVERSE_EVALUATE_DEPENDENCY|PROP_RENDER_DEPENDENCY|PROP_INVERSE_RENDER_DEPENDENCY)) {
+ fprintf(stderr, "RNA_def_property_flag: %s.%s, only pointer and collection types can create dependencies.\n", ds->srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ }
+ }
+#endif
+}
+
+void RNA_def_property_array(PropertyRNA *prop, int arraylength)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_BOOLEAN:
+ case PROP_INT:
+ case PROP_FLOAT:
+ prop->arraylength= arraylength;
+ break;
+ default:
+ fprintf(stderr, "RNA_def_property_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
+{
+ prop->name= name;
+ prop->description= description;
+}
+
+void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ iprop->softmin= (int)min;
+ iprop->softmax= (int)max;
+ iprop->step= (int)step;
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ fprop->softmin= (float)min;
+ fprop->softmax= (float)max;
+ fprop->step= (float)step;
+ fprop->precision= (int)precision;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_ui_range: %s.%s, invalid type for ui range.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_range(PropertyRNA *prop, double min, double max)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ iprop->hardmin= (int)min;
+ iprop->hardmax= (int)max;
+ iprop->softmin= MAX2((int)min, iprop->hardmin);
+ iprop->softmax= MIN2((int)max, iprop->hardmax);
+ break;
+ }
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ fprop->hardmin= (float)min;
+ fprop->hardmax= (float)max;
+ fprop->softmin= MAX2((float)min, fprop->hardmin);
+ fprop->softmax= MIN2((float)max, fprop->hardmax);
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_range: %s.%s, invalid type for range.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_struct_type: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_POINTER: {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+ pprop->structtype = (StructRNA*)type;
+ break;
+ }
+ case PROP_COLLECTION: {
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ cprop->structtype = (StructRNA*)type;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
+{
+ StructRNA *srna= DefRNA.laststruct;
+ int i;
+
+ switch(prop->type) {
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ eprop->item= item;
+ eprop->totitem= 0;
+ for(i=0; item[i].identifier; i++)
+ eprop->totitem++;
+
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ sprop->maxlength= maxlength;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_string_maxlength: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ bprop->defaultvalue= value;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+ bprop->defaultarray= array;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_int_default(PropertyRNA *prop, int value)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ iprop->defaultvalue= value;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ iprop->defaultarray= array;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_float_default(PropertyRNA *prop, float value)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ fprop->defaultvalue= value;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+ fprop->defaultarray= array;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ sprop->defaultvalue= value;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_string_default: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_enum_default(PropertyRNA *prop, int value)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ switch(prop->type) {
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+ eprop->defaultvalue= value;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_enum_default: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+/* SDNA */
+
+static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ DNAStructMember smember;
+ StructDefRNA *ds= DefRNA.structs.last;
+ PropertyDefRNA *dp= ds->properties.last;
+
+ if(!structname)
+ structname= ds->dnaname;
+ if(!propname)
+ propname= prop->identifier;
+
+ if(!rna_find_sdna_member(DefRNA.sdna, structname, propname, &smember)) {
+ if(!DefRNA.silent) {
+ fprintf(stderr, "rna_def_property_sdna: %s.%s not found.\n", structname, propname);
+ DefRNA.error= 1;
+ }
+ return NULL;
+ }
+
+ if(smember.arraylength > 1)
+ prop->arraylength= smember.arraylength;
+ else
+ prop->arraylength= 0;
+
+ dp->dnastructname= structname;
+ dp->dnastructfromname= ds->dnafromname;
+ dp->dnastructfromprop= ds->dnafromprop;
+ dp->dnaname= propname;
+ dp->dnatype= smember.type;
+ dp->dnaarraylength= smember.arraylength;
+ dp->dnapointerlevel= smember.pointerlevel;
+
+ return dp;
+}
+
+void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit)
+{
+ PropertyDefRNA *dp;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_BOOLEAN) {
+ fprintf(stderr, "RNA_def_property_boolean_sdna: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp=rna_def_property_sdna(prop, structname, propname)))
+ dp->booleanbit= bit;
+}
+
+void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int booleanbit)
+{
+ StructDefRNA *ds;
+ PropertyDefRNA *dp;
+
+ RNA_def_property_boolean_sdna(prop, structname, propname, booleanbit);
+
+ if((ds=DefRNA.structs.last) && (dp=ds->properties.last))
+ dp->booleannegative= 1;
+}
+
+void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ PropertyDefRNA *dp;
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_INT) {
+ fprintf(stderr, "RNA_def_property_int_sdna: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp= rna_def_property_sdna(prop, structname, propname))) {
+ /* SDNA doesn't pass us unsigned unfortunately .. */
+ if(strcmp(dp->dnatype, "char") == 0) {
+ iprop->hardmin= iprop->softmin= CHAR_MIN;
+ iprop->hardmax= iprop->softmax= CHAR_MAX;
+ }
+ else if(strcmp(dp->dnatype, "short") == 0) {
+ iprop->hardmin= iprop->softmin= SHRT_MIN;
+ iprop->hardmax= iprop->softmax= SHRT_MAX;
+ }
+ else if(strcmp(dp->dnatype, "int") == 0) {
+ iprop->hardmin= INT_MIN;
+ iprop->hardmax= INT_MAX;
+
+ iprop->softmin= -10000; /* rather arbitrary .. */
+ iprop->softmax= 10000;
+ }
+
+ if(prop->subtype == PROP_UNSIGNED)
+ iprop->hardmin= iprop->softmin= 0;
+ }
+}
+
+void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_FLOAT) {
+ fprintf(stderr, "RNA_def_property_float_sdna: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ rna_def_property_sdna(prop, structname, propname);
+}
+
+void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ PropertyDefRNA *dp;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_ENUM) {
+ fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp=rna_def_property_sdna(prop, structname, propname))) {
+ if(prop->arraylength) {
+ prop->arraylength= 0;
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, array not supported for enum type.\n", structname, propname);
+ DefRNA.error= 1;
+ }
+ }
+ }
+}
+
+void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ StructDefRNA *ds;
+ PropertyDefRNA *dp;
+
+ RNA_def_property_enum_sdna(prop, structname, propname);
+
+ if((ds=DefRNA.structs.last) && (dp=ds->properties.last))
+ dp->enumbitflags= 1;
+}
+
+void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ PropertyDefRNA *dp;
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_STRING) {
+ fprintf(stderr, "RNA_def_property_string_sdna: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp=rna_def_property_sdna(prop, structname, propname))) {
+ if(prop->arraylength) {
+ sprop->maxlength= prop->arraylength;
+ prop->arraylength= 0;
+ }
+ }
+}
+
+void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
+{
+ PropertyDefRNA *dp;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_POINTER) {
+ fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp=rna_def_property_sdna(prop, structname, propname))) {
+ if(prop->arraylength) {
+ prop->arraylength= 0;
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, array not supported for pointer type.\n", structname, propname);
+ DefRNA.error= 1;
+ }
+ }
+ }
+}
+
+void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
+{
+ PropertyDefRNA *dp;
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ return;
+ }
+
+ if(prop->type != PROP_COLLECTION) {
+ fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, type is not collection.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ return;
+ }
+
+ if((dp=rna_def_property_sdna(prop, structname, propname))) {
+ if(prop->arraylength && !lengthpropname) {
+ prop->arraylength= 0;
+
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, array of collections not supported.\n", structname, propname);
+ DefRNA.error= 1;
+ }
+ }
+
+ if(strcmp(dp->dnatype, "ListBase") == 0) {
+ cprop->next= (PropCollectionNextFunc)"rna_iterator_listbase_next";
+ cprop->get= (PropCollectionGetFunc)"rna_iterator_listbase_get";
+ cprop->end= (PropCollectionEndFunc)"rna_iterator_listbase_end";
+ }
+ }
+
+ if(dp && lengthpropname) {
+ DNAStructMember smember;
+ StructDefRNA *ds= DefRNA.structs.last;
+
+ if(!structname)
+ structname= ds->dnaname;
+
+ if(lengthpropname[0] == 0 || rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember)) {
+ if(lengthpropname[0] == 0) {
+ dp->dnalengthfixed= prop->arraylength;
+ prop->arraylength= 0;
+ }
+ else {
+ dp->dnalengthstructname= structname;
+ dp->dnalengthname= lengthpropname;
+ }
+
+ cprop->next= (PropCollectionNextFunc)"rna_iterator_array_next";
+ cprop->end= (PropCollectionEndFunc)"rna_iterator_array_end";
+
+ if(dp->dnapointerlevel >= 2)
+ cprop->get= (PropCollectionGetFunc)"rna_iterator_array_dereference_get";
+ else
+ cprop->get= (PropCollectionGetFunc)"rna_iterator_array_get";
+ }
+ else {
+ if(!DefRNA.silent) {
+ fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s not found.\n", structname, lengthpropname);
+ DefRNA.error= 1;
+ }
+ }
+ }
+}
+
+/* Functions */
+
+void RNA_def_property_funcs(PropertyRNA *prop, const char *notify, const char *editable)
+{
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ if(notify) prop->notify= (NotifyFunc)notify;
+ if(editable) prop->editable= (EditableFunc)editable;
+}
+
+void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: {
+ BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
+
+ if(prop->arraylength) {
+ if(get) bprop->getarray= (PropBooleanArrayGetFunc)get;
+ if(set) bprop->setarray= (PropBooleanArraySetFunc)set;
+ }
+ else {
+ if(get) bprop->get= (PropBooleanGetFunc)get;
+ if(set) bprop->set= (PropBooleanSetFunc)set;
+ }
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_boolean_funcs: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_INT: {
+ IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+
+ if(prop->arraylength) {
+ if(get) iprop->getarray= (PropIntArrayGetFunc)get;
+ if(set) iprop->setarray= (PropIntArraySetFunc)set;
+ }
+ else {
+ if(get) iprop->get= (PropIntGetFunc)get;
+ if(set) iprop->set= (PropIntSetFunc)set;
+ }
+ if(range) iprop->range= (PropIntRangeFunc)range;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_int_funcs: %s.%s, type is not int.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_FLOAT: {
+ FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+
+ if(prop->arraylength) {
+ if(get) fprop->getarray= (PropFloatArrayGetFunc)get;
+ if(set) fprop->setarray= (PropFloatArraySetFunc)set;
+ }
+ else {
+ if(get) fprop->get= (PropFloatGetFunc)get;
+ if(set) fprop->set= (PropFloatSetFunc)set;
+ }
+ if(range) fprop->range= (PropFloatRangeFunc)range;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_float_funcs: %s.%s, type is not float.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_ENUM: {
+ EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+
+ if(get) eprop->get= (PropEnumGetFunc)get;
+ if(set) eprop->set= (PropEnumSetFunc)set;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_enum_funcs: %s.%s, type is not enum.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_STRING: {
+ StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+
+ if(get) sprop->get= (PropStringGetFunc)get;
+ if(length) sprop->length= (PropStringLengthFunc)length;
+ if(set) sprop->set= (PropStringSetFunc)set;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_string_funcs: %s.%s, type is not string.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *type, const char *set)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_POINTER: {
+ PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+
+ if(get) pprop->get= (PropPointerGetFunc)get;
+ if(type) pprop->type= (PropPointerTypeFunc)type;
+ if(set) pprop->set= (PropPointerSetFunc)set;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_pointer_funcs: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
+void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *type, const char *length, const char *lookupint, const char *lookupstring)
+{
+ StructRNA *srna= DefRNA.laststruct;
+
+ if(!DefRNA.preprocess) {
+ fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ return;
+ }
+
+ switch(prop->type) {
+ case PROP_COLLECTION: {
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+
+ if(begin) cprop->begin= (PropCollectionBeginFunc)begin;
+ if(next) cprop->next= (PropCollectionNextFunc)next;
+ if(end) cprop->end= (PropCollectionEndFunc)end;
+ if(get) cprop->get= (PropCollectionGetFunc)get;
+ if(type) cprop->type= (PropCollectionTypeFunc)type;
+ if(length) cprop->length= (PropCollectionLengthFunc)length;
+ if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint;
+ if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring;
+ break;
+ }
+ default:
+ fprintf(stderr, "RNA_def_property_collection_funcs: %s.%s, type is not collection.\n", srna->identifier, prop->identifier);
+ DefRNA.error= 1;
+ break;
+ }
+}
+
diff --git a/source/blender/makesrna/intern/rna_dependency.c b/source/blender/makesrna/intern/rna_dependency.c
new file mode 100644
index 00000000000..d867d2f7768
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_dependency.c
@@ -0,0 +1,92 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "DNA_scene_types.h"
+
+#include "RNA_access.h"
+#include "RNA_types.h"
+
+#if 0
+typedef struct RNAGenDeps {
+ void *udata;
+ PropDependencyCallback cb;
+} RNAGenDeps;
+
+static void rna_generate_deps(RNAGenDeps *gen, PointerRNA *ptr, PointerRNA *idptr)
+{
+ PropertyRNA *prop;
+ PointerRNA pptr;
+ CollectionPropertyIterator iter;
+
+ /* traverse recursively into ID struct properties, other
+ * pointers we potentially add as dependencies */
+
+ for(prop=ptr->type->properties.first; prop; prop=prop->next) {
+ if(prop->type == PROP_POINTER) {
+ RNA_property_pointer_get(ptr, prop, &pptr);
+
+ if(pptr.data && pptr.type) {
+ if(idptr && (pptr.type->flag & STRUCT_ID)) {
+ if(prop->flag & PROP_EVALUATE_DEPENDENCY)
+ gen->cb(gen->udata, ptr, &pptr);
+ else if(prop->flag & PROP_INVERSE_EVALUATE_DEPENDENCY)
+ gen->cb(gen->udata, ptr, &pptr);
+ }
+ else
+ rna_generate_deps(gen, &pptr, (idptr)? idptr: &pptr);
+ }
+ }
+ else if(prop->type == PROP_COLLECTION) {
+ RNA_property_collection_begin(ptr, prop, &iter);
+
+ while(iter.valid) {
+ RNA_property_collection_get(&pptr, prop, &iter);
+
+ if(pptr.data && pptr.type) {
+ if(idptr && (pptr.type->flag & STRUCT_ID)) {
+ if(prop->flag & PROP_EVALUATE_DEPENDENCY)
+ gen->cb(gen->udata, ptr, &pptr);
+ else if(prop->flag & PROP_INVERSE_EVALUATE_DEPENDENCY)
+ gen->cb(gen->udata, ptr, &pptr);
+ }
+ else
+ rna_generate_deps(gen, &pptr, (idptr)? idptr: &pptr);
+ }
+
+ RNA_property_collection_next(prop, &iter);
+ }
+
+ RNA_property_collection_end(prop, &iter);
+ }
+ }
+}
+
+void RNA_generate_dependencies(PointerRNA *ptr, void *udata, PropDependencyCallback cb)
+{
+ RNAGenDeps gen;
+
+ gen.udata= udata;
+ gen.cb= cb;
+
+ rna_generate_deps(&gen, ptr, NULL);
+}
+
+void RNA_test_dependencies_cb(void *udata, PointerRNA *from, PointerRNA *to)
+{
+ PropertyRNA *prop;
+ char name[256], nameto[256];
+
+ prop= from->type? from->type->nameproperty: NULL;
+ if(prop) RNA_property_string_get(prop, from, name);
+ else strcpy(name, "unknown");
+
+ prop= from->type? from->type->nameproperty: NULL;
+ if(prop) RNA_property_string_get(prop, to, nameto);
+ else strcpy(nameto, "unknown");
+
+ printf("%s (%s) -> %s (%s)\n", name, from->type->identifier, nameto, to->type->identifier);
+}
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
new file mode 100644
index 00000000000..54ac834466b
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -0,0 +1,71 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_group_types.h"
+
+#ifdef RNA_RUNTIME
+
+void *rna_Group_objects_get(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+
+ /* we are actually iterating a GroupObject list, so override get */
+ return ((GroupObject *)internal->link)->ob;
+}
+
+#else
+
+void RNA_def_group(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Group", "ID", "Group");
+
+ prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "dupli_ofs");
+ RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the center to use when instancing as DupliGroup.");
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
+
+ prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects.");
+ RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0, 0);
+
+ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
+ RNA_def_property_array(prop, 20);
+ RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this groups is instanced as a dupli.");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
new file mode 100644
index 00000000000..a48c2962b7a
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -0,0 +1,230 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Brecht Van Lommel
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_image_types.h"
+#include "DNA_scene_types.h"
+
+#include "BKE_image.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+static void rna_def_imageuser(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ImageUser", NULL, "ImageUser");
+
+ prop= RNA_def_property(srna, "auto_refresh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
+ RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes.");
+
+ /* animation */
+ prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
+ RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie.");
+
+ prop= RNA_def_property(srna, "frames", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, MAXFRAMEF);
+ RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use.");
+
+ prop= RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
+ RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation.");
+
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "sfra");
+ RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
+ RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie.");
+
+ prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "fie_ima");
+ RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF);
+ RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image).");
+
+ prop= RNA_def_property(srna, "layer", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* image_multi_cb */
+ RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image.");
+
+ prop= RNA_def_property(srna, "pass", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* image_multi_cb */
+ RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image.");
+}
+
+static void rna_def_image(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static const EnumPropertyItem prop_type_items[]= {
+ {IMA_TYPE_IMAGE, "IMAGE", "Image", ""},
+ {IMA_TYPE_MULTILAYER, "MULTILAYER", "Multilayer", ""},
+ {IMA_TYPE_UV_TEST, "UVTEST", "UV Test", ""},
+ //{IMA_TYPE_VERSE, "VERSE", "Verse", ""},
+ {IMA_TYPE_R_RESULT, "RENDERRESULT", "Render Result", ""},
+ {IMA_TYPE_COMPOSITE, "COMPOSITING", "Compositing", ""},
+ {0, NULL, NULL, NULL}};
+ static const EnumPropertyItem prop_source_items[]= {
+ {IMA_SRC_FILE, "FILE", "File", "Single image file"},
+ {IMA_SRC_SEQUENCE, "SEQUENCE", "Sequence", "Multiple image files, as a sequence"},
+ {IMA_SRC_MOVIE, "MOVIE", "Movie", "Movie file"},
+ {IMA_SRC_GENERATED, "GENERATED", "Generated", "Generated image"},
+ {IMA_SRC_VIEWER, "VIEWER", "Viewer", "Compositing node viewer"},
+ {0, NULL, NULL, NULL}};
+ static const EnumPropertyItem prop_generated_type_items[]= {
+ {0, "BLANK", "Blank", "Generate a blank image"},
+ {1, "UVTESTGRID", "UV Test Grid", "Generated grid to test UV mappings"},
+ {0, NULL, NULL, NULL}};
+ static const EnumPropertyItem prop_mapping_items[]= {
+ {0, "UV", "UV Coordinates", "Use UV coordinates for mapping the image"},
+ {IMA_REFLECT, "REFLECTION", "Reflection", "Use reflection mapping for mapping the image"},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Image", "ID", "Image");
+
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* imagechanged */
+ RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name.");
+
+ prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_source_items);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* imagechanged */
+ RNA_def_property_ui_text(prop, "Source", "Where the image comes from.");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* imagechanged */
+ RNA_def_property_ui_text(prop, "Type", "How to generate the image.");
+
+ prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
+ RNA_def_property_ui_text(prop, "Packed File", "");
+
+ /* booleans */
+ prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
+ RNA_def_property_ui_text(prop, "Fields", "Use fields of the image.");
+
+ prop= RNA_def_property(srna, "odd_fields", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_STD_FIELD);
+ RNA_def_property_ui_text(prop, "Odd Fields", "Standard field toggle.");
+
+ prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI);
+ RNA_def_property_ui_text(prop, "Anti-alias", "Toggles image anti-aliasing, only works with solid colors");
+
+ prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
+ RNA_def_property_ui_text(prop, "Premultiply", "Convert from key alpha to premultiplied alpha.");
+
+ /* generated image (image_generated_change_cb) */
+ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "gen_type");
+ RNA_def_property_enum_items(prop, prop_generated_type_items);
+ RNA_def_property_ui_text(prop, "Generated Type", "Generated image type.");
+
+ prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "gen_x");
+ RNA_def_property_range(prop, 1, 5000);
+ RNA_def_property_ui_text(prop, "Generated Width", "Generated image width.");
+
+ prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "gen_y");
+ RNA_def_property_range(prop, 1, 5000);
+ RNA_def_property_ui_text(prop, "Generated Height", "Generated image height.");
+
+ /* realtime properties */
+ prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, prop_mapping_items);
+ RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine.");
+
+ prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "aspx");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_range(prop, 0.1f, 5000.0f);
+ RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering.");
+
+ prop= RNA_def_property(srna, "animated", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* B_TWINANIM */
+ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
+ RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine.");
+
+ prop= RNA_def_property(srna, "animation_start", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "twsta");
+ RNA_def_property_range(prop, 0, 128);
+ RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture.");
+
+ prop= RNA_def_property(srna, "animation_end", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "twend");
+ RNA_def_property_range(prop, 0, 128);
+ RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture.");
+
+ prop= RNA_def_property(srna, "animation_speed", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "animspeed");
+ RNA_def_property_range(prop, 1.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second.");
+
+ prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* B_SIMAGETILE */
+ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
+ RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces).");
+
+ prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "xrep");
+ RNA_def_property_range(prop, 1, 16);
+ RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction.");
+
+ prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "yrep");
+ RNA_def_property_range(prop, 1, 16);
+ RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction.");
+
+ prop= RNA_def_property(srna, "clamp_x", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
+ RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally.");
+
+ prop= RNA_def_property(srna, "clamp_y", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
+ RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically.");
+}
+
+void RNA_def_image(BlenderRNA *brna)
+{
+ rna_def_image(brna);
+ rna_def_imageuser(brna);
+}
+
+#endif
+
+
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
new file mode 100644
index 00000000000..7ac44a34ed0
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -0,0 +1,193 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RNA_INTERNAL_H
+#define RNA_INTERNAL_H
+
+#include "rna_internal_types.h"
+
+#define RNA_MAGIC ((int)~0)
+
+struct IDProperty;
+struct SDNA;
+
+/* Data structures used during define */
+
+typedef struct PropertyDefRNA {
+ struct PropertyDefRNA *next, *prev;
+
+ struct StructRNA *srna;
+ struct PropertyRNA *prop;
+
+ /* struct */
+ const char *dnastructname;
+ const char *dnastructfromname;
+ const char *dnastructfromprop;
+
+ /* property */
+ const char *dnaname;
+ const char *dnatype;
+ int dnaarraylength;
+ int dnapointerlevel;
+
+ /* for finding length of array collections */
+ const char *dnalengthstructname;
+ const char *dnalengthname;
+ int dnalengthfixed;
+
+ int booleanbit, booleannegative;
+ int enumbitflags;
+} PropertyDefRNA;
+
+typedef struct StructDefRNA {
+ struct StructDefRNA *next, *prev;
+
+ struct StructRNA *srna;
+
+ const char *dnaname;
+
+ /* for derived structs to find data in some property */
+ const char *dnafromname;
+ const char *dnafromprop;
+
+ ListBase properties;
+} StructDefRNA;
+
+typedef struct AllocDefRNA {
+ struct AllocDefRNA *next, *prev;
+ void *mem;
+} AllocDefRNA;
+
+typedef struct BlenderDefRNA {
+ struct SDNA *sdna;
+ ListBase structs;
+ ListBase allocs;
+ struct StructRNA *laststruct;
+ int error, silent, preprocess;
+} BlenderDefRNA;
+
+extern BlenderDefRNA DefRNA;
+
+/* Define functions for all types */
+
+extern BlenderRNA BLENDER_RNA;
+
+void RNA_def_ID(struct BlenderRNA *brna);
+void RNA_def_armature(struct BlenderRNA *brna);
+void RNA_def_actuator(struct BlenderRNA *brna);
+void RNA_def_brush(struct BlenderRNA *brna);
+void RNA_def_brushclone(struct BlenderRNA *brna);
+void RNA_def_camera(struct BlenderRNA *brna);
+void RNA_def_color(struct BlenderRNA *brna);
+void RNA_def_constraint(struct BlenderRNA *brna);
+void RNA_def_controller(struct BlenderRNA *brna);
+void RNA_def_curve(struct BlenderRNA *brna);
+void RNA_def_gameproperty(struct BlenderRNA *brna);
+void RNA_def_group(struct BlenderRNA *brna);
+void RNA_def_image(struct BlenderRNA *brna);
+void RNA_def_ipo(struct BlenderRNA *brna);
+void RNA_def_key(struct BlenderRNA *brna);
+void RNA_def_lamp(struct BlenderRNA *brna);
+void RNA_def_lattice(struct BlenderRNA *brna);
+void RNA_def_main(struct BlenderRNA *brna);
+void RNA_def_material(struct BlenderRNA *brna);
+void RNA_def_mesh(struct BlenderRNA *brna);
+void RNA_def_meta(struct BlenderRNA *brna);
+void RNA_def_modifier(struct BlenderRNA *brna);
+void RNA_def_nodetree(struct BlenderRNA *brna);
+void RNA_def_object(struct BlenderRNA *brna);
+void RNA_def_packedfile(struct BlenderRNA *brna);
+void RNA_def_radio(struct BlenderRNA *brna);
+void RNA_def_rna(struct BlenderRNA *brna);
+void RNA_def_scene(struct BlenderRNA *brna);
+void RNA_def_screen(struct BlenderRNA *brna);
+void RNA_def_sensor(struct BlenderRNA *brna);
+void RNA_def_vfont(struct BlenderRNA *brna);
+void RNA_def_wm(struct BlenderRNA *brna);
+void RNA_def_world(struct BlenderRNA *brna);
+
+void rna_def_ipo_common(struct StructRNA *srna);
+void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
+
+/* ID Properties */
+
+extern StringPropertyRNA rna_IDProperty_string;
+extern IntPropertyRNA rna_IDProperty_int;
+extern IntPropertyRNA rna_IDProperty_intarray;
+extern FloatPropertyRNA rna_IDProperty_float;
+extern FloatPropertyRNA rna_IDProperty_floatarray;
+extern PointerPropertyRNA rna_IDProperty_group;
+extern FloatPropertyRNA rna_IDProperty_double;
+extern FloatPropertyRNA rna_IDProperty_doublearray;
+
+extern StructRNA RNA_IDProperty;
+extern StructRNA RNA_IDPropertyGroup;
+
+struct IDProperty *rna_idproperties_get(struct StructRNA *type, void *data, int create);
+struct IDProperty *rna_idproperty_check(struct PropertyRNA **prop, struct PointerRNA *ptr);
+
+/* Builtin Property Callbacks */
+
+void rna_builtin_properties_begin(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
+void rna_builtin_properties_next(struct CollectionPropertyIterator *iter);
+void *rna_builtin_properties_get(struct CollectionPropertyIterator *iter);
+void *rna_builtin_type_get(struct PointerRNA *ptr);
+
+/* Iterators */
+
+typedef int (*IteratorSkipFunc)(struct CollectionPropertyIterator *iter, void *data);
+
+typedef struct ListBaseIterator {
+ Link *link;
+ int flag;
+ IteratorSkipFunc skip;
+} ListBaseIterator;
+
+void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct ListBase *lb, IteratorSkipFunc skip);
+void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter);
+void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter);
+void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter);
+
+typedef struct ArrayIterator {
+ char *ptr;
+ char *endptr;
+ int itemsize;
+ IteratorSkipFunc skip;
+} ArrayIterator;
+
+void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip);
+void rna_iterator_array_next(struct CollectionPropertyIterator *iter);
+void *rna_iterator_array_get(struct CollectionPropertyIterator *iter);
+void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter);
+void rna_iterator_array_end(struct CollectionPropertyIterator *iter);
+
+/* Duplicated code since we can't link in blenlib */
+
+void rna_addtail(struct ListBase *listbase, void *vlink);
+void rna_freelinkN(struct ListBase *listbase, void *vlink);
+void rna_freelistN(struct ListBase *listbase);
+
+#endif /* RNA_INTERNAL_H */
+
+
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
new file mode 100644
index 00000000000..c878d33d87d
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -0,0 +1,246 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RNA_INTERNAL_TYPES
+#define RNA_INTERNAL_TYPES
+
+#include "DNA_listBase.h"
+
+struct BlenderRNA;
+struct StructRNA;
+struct PropertyRNA;
+struct PointerRNA;
+struct CollectionPropertyIterator;
+struct bContext;
+
+/* Function Callbacks */
+
+typedef void (*NotifyFunc)(struct bContext *C, struct PointerRNA *ptr);
+typedef int (*EditableFunc)(struct PointerRNA *ptr);
+typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr);
+
+typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr);
+typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value);
+typedef int (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int index);
+typedef void (*PropBooleanArraySetFunc)(struct PointerRNA *ptr, int index, int value);
+typedef int (*PropIntGetFunc)(struct PointerRNA *ptr);
+typedef void (*PropIntSetFunc)(struct PointerRNA *ptr, int value);
+typedef int (*PropIntArrayGetFunc)(struct PointerRNA *ptr, int index);
+typedef void (*PropIntArraySetFunc)(struct PointerRNA *ptr, int index, int value);
+typedef void (*PropIntRangeFunc)(struct PointerRNA *ptr, int *min, int *max);
+typedef float (*PropFloatGetFunc)(struct PointerRNA *ptr);
+typedef void (*PropFloatSetFunc)(struct PointerRNA *ptr, float value);
+typedef float (*PropFloatArrayGetFunc)(struct PointerRNA *ptr, int index);
+typedef void (*PropFloatArraySetFunc)(struct PointerRNA *ptr, int index, float value);
+typedef void (*PropFloatRangeFunc)(struct PointerRNA *ptr, float *min, float *max);
+typedef void (*PropStringGetFunc)(struct PointerRNA *ptr, char *value);
+typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr);
+typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value);
+typedef int (*PropEnumGetFunc)(struct PointerRNA *ptr);
+typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value);
+typedef void* (*PropPointerGetFunc)(struct PointerRNA *ptr);
+typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, void *value);
+typedef struct StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr);
+typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr);
+typedef void (*PropCollectionNextFunc)(struct CollectionPropertyIterator *iter);
+typedef void (*PropCollectionEndFunc)(struct CollectionPropertyIterator *iter);
+typedef void* (*PropCollectionGetFunc)(struct CollectionPropertyIterator *iter);
+typedef struct StructRNA* (*PropCollectionTypeFunc)(struct CollectionPropertyIterator *iter);
+typedef int (*PropCollectionLengthFunc)(struct PointerRNA *ptr);
+typedef void* (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, struct StructRNA **type);
+typedef void* (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, const char *key, struct StructRNA **type);
+
+struct PropertyRNA {
+ struct PropertyRNA *next, *prev;
+
+ /* magic bytes to distinguish with IDProperty */
+ int magic;
+
+ /* unique identifier */
+ const char *identifier;
+ /* various options */
+ int flag;
+
+ /* user readable name */
+ const char *name;
+ /* single line description, displayed in the tooltip for example */
+ const char *description;
+
+ /* property type as it appears to the outside */
+ PropertyType type;
+ /* subtype, 'interpretation' of the property */
+ PropertySubType subtype;
+ /* if an array this is > 0, specifying the length */
+ unsigned int arraylength;
+
+ /* callback for notifys on change */
+ NotifyFunc notify;
+
+ /* callback for testing if editable/evaluated */
+ EditableFunc editable;
+};
+
+/* Property Types */
+
+typedef struct BooleanPropertyRNA {
+ PropertyRNA property;
+
+ PropBooleanGetFunc get;
+ PropBooleanSetFunc set;
+
+ PropBooleanArrayGetFunc getarray;
+ PropBooleanArraySetFunc setarray;
+
+ int defaultvalue;
+ const int *defaultarray;
+} BooleanPropertyRNA;
+
+typedef struct IntPropertyRNA {
+ PropertyRNA property;
+
+ PropIntGetFunc get;
+ PropIntSetFunc set;
+
+ PropIntArrayGetFunc getarray;
+ PropIntArraySetFunc setarray;
+
+ PropIntRangeFunc range;
+
+ int softmin, softmax;
+ int hardmin, hardmax;
+ int step;
+
+ int defaultvalue;
+ const int *defaultarray;
+} IntPropertyRNA;
+
+typedef struct FloatPropertyRNA {
+ PropertyRNA property;
+
+ PropFloatGetFunc get;
+ PropFloatSetFunc set;
+
+ PropFloatArrayGetFunc getarray;
+ PropFloatArraySetFunc setarray;
+
+ PropFloatRangeFunc range;
+
+ float softmin, softmax;
+ float hardmin, hardmax;
+ float step;
+ int precision;
+
+ float defaultvalue;
+ const float *defaultarray;
+} FloatPropertyRNA;
+
+typedef struct StringPropertyRNA {
+ PropertyRNA property;
+
+ PropStringGetFunc get;
+ PropStringLengthFunc length;
+ PropStringSetFunc set;
+
+ int maxlength; /* includes string terminator! */
+
+ const char *defaultvalue;
+} StringPropertyRNA;
+
+typedef struct EnumPropertyRNA {
+ PropertyRNA property;
+
+ PropEnumGetFunc get;
+ PropEnumSetFunc set;
+
+ const EnumPropertyItem *item;
+ int totitem;
+
+ int defaultvalue;
+} EnumPropertyRNA;
+
+typedef struct PointerPropertyRNA {
+ PropertyRNA property;
+
+ PropPointerGetFunc get;
+ PropPointerSetFunc set;
+ PropPointerTypeFunc type; /* optional */
+
+ struct StructRNA *structtype;
+} PointerPropertyRNA;
+
+typedef struct CollectionPropertyRNA {
+ PropertyRNA property;
+
+ PropCollectionBeginFunc begin;
+ PropCollectionNextFunc next;
+ PropCollectionEndFunc end; /* optional */
+ PropCollectionGetFunc get;
+ PropCollectionTypeFunc type; /* optional */
+ PropCollectionLengthFunc length; /* optional */
+ PropCollectionLookupIntFunc lookupint; /* optional */
+ PropCollectionLookupStringFunc lookupstring; /* optional */
+
+ struct StructRNA *structtype;
+} CollectionPropertyRNA;
+
+struct StructRNA {
+ struct StructRNA *next, *prev;
+
+ /* unique identifier */
+ const char *identifier;
+ /* various options */
+ int flag;
+
+ /* user readable name */
+ const char *name;
+
+ /* property that defines the name */
+ PropertyRNA *nameproperty;
+
+ /* property to iterate over properties */
+ PropertyRNA *iteratorproperty;
+
+ /* struct this is derivedfrom */
+ struct StructRNA *from;
+
+ /* callback for notifys on change */
+ NotifyFunc notify;
+
+ /* function to give the more specific type */
+ StructRefineFunc refine;
+
+ /* properties of this struct */
+ ListBase properties;
+};
+
+/* Blender RNA
+ *
+ * Root RNA data structure that lists all struct types. */
+
+struct BlenderRNA {
+ ListBase structs;
+};
+
+#endif /* RNA_INTERNAL_TYPES */
+
diff --git a/source/blender/makesrna/intern/rna_ipo.c b/source/blender/makesrna/intern/rna_ipo.c
new file mode 100644
index 00000000000..f04c868a1da
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_ipo.c
@@ -0,0 +1,155 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_ipo_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void rna_def_ipodriver(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] = {
+ {IPO_DRIVER_TYPE_NORMAL, "NORMAL", "Normal", ""},
+ {IPO_DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "IpoDriver", NULL, "Ipo Driver");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Type", "Ipo Driver types.");
+
+ /* String values */
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "Bone name or scripting expression.");
+
+ /* Pointers */
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "ob");
+ RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Ipo Driver.");
+}
+
+void rna_def_ipocurve(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_mode_interpolation_items[] = {
+ {IPO_CONST, "CONSTANT", "Constant", ""},
+ {IPO_LIN, "LINEAR", "Linear", ""},
+ {IPO_BEZ, "BEZIER", "Bezier", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_mode_extend_items[] = {
+ {IPO_HORIZ, "CONSTANT", "Constant", ""},
+ {IPO_DIR, "EXTRAP", "Extrapolation", ""},
+ {IPO_CYCL, "CYCLIC", "Cyclic", ""},
+ {IPO_CYCLX, "CYCLICX", "Cyclic Extrapolation", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "IpoCurve", NULL, "Ipo Curve");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "ipo");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_mode_interpolation_items);
+ RNA_def_property_ui_text(prop, "Interpolation", "");
+
+ prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "extrap");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_mode_extend_items);
+ RNA_def_property_ui_text(prop, "Extrapolation", "");
+
+ /* Pointers */
+ prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "driver");
+ RNA_def_property_ui_text(prop, "Ipo Driver", "");
+}
+
+void rna_def_ipo(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_blocktype_items[] = {
+ {ID_OB, "OBJECT", "Object", ""},
+ {ID_MA, "MATERIAL", "Material", ""},
+ {ID_TE, "TEXTURE", "Texture", ""},
+ {ID_SEQ, "SEQUENCE", "Sequence", ""},
+ {ID_CU, "CURVE", "Curve", ""},
+ {ID_KE, "KEY", "Key", ""},
+ {ID_WO, "WORLD", "World", ""},
+ {ID_LA, "LAMP", "Lamp", ""},
+ {ID_CA, "CAMERA", "Camera", ""},
+ {ID_SO, "SOUND", "Sound", ""},
+ {ID_PO, "POSECHANNEL", "PoseChannel", ""},
+ {ID_CO, "CONSTRAINT", "Constraint", ""},
+ {ID_FLUIDSIM, "FLUIDSIM", "FluidSim", ""},
+ {ID_PA, "PARTICLES", "Particles", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Ipo", "ID", "Ipo");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "block_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "blocktype");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_blocktype_items);
+ RNA_def_property_ui_text(prop, "Block Type", "");
+
+ /* Boolean values */
+ prop= RNA_def_property(srna, "show_keys", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "showkey", 0);
+ RNA_def_property_ui_text(prop, "Show Keys", "Show Ipo Keys.");
+
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "muteipo", 0);
+ RNA_def_property_ui_text(prop, "Mute", "Mute this Ipo block.");
+
+ /* Collection */
+ prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "curve", NULL);
+ RNA_def_property_struct_type(prop, "IpoCurve");
+ RNA_def_property_ui_text(prop, "Curves", "");
+}
+
+void RNA_def_ipo(BlenderRNA *brna)
+{
+ rna_def_ipo(brna);
+ rna_def_ipocurve(brna);
+ rna_def_ipodriver(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
new file mode 100644
index 00000000000..5726ad93244
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -0,0 +1,350 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_ID.h"
+#include "DNA_curve_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_mesh_types.h"
+
+#ifdef RNA_RUNTIME
+
+static Key *rna_ShapeKey_find_key(ID *id)
+{
+ switch(GS(id->name)) {
+ case ID_CU: return ((Curve*)id)->key;
+ case ID_KE: return (Key*)id;
+ case ID_LT: return ((Lattice*)id)->key;
+ case ID_ME: return ((Mesh*)id)->key;
+ default: return NULL;
+ }
+}
+
+static void *rna_ShapeKey_relative_key_get(PointerRNA *ptr)
+{
+ Key *key= rna_ShapeKey_find_key(ptr->id.data);
+ KeyBlock *kb= (KeyBlock*)ptr->data, *kbrel;
+ int a;
+
+ if(key && kb->relative < key->totkey)
+ for(a=0, kbrel=key->block.first; kbrel; kbrel=kbrel->next, a++)
+ if(a == kb->relative)
+ return kbrel;
+
+ return NULL;
+}
+
+static float rna_ShapeKeyPoint_co_get(PointerRNA *ptr, int index)
+{
+ float *vec= (float*)ptr->data;
+ return vec[index];
+}
+
+static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, int index, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[index]= value;
+}
+
+static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr)
+{
+ float *vec= (float*)ptr->data;
+ return vec[3];
+}
+
+static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[3]= value;
+}
+
+static float rna_ShapeKeyBezierPoint_co_get(PointerRNA *ptr, int index)
+{
+ float *vec= (float*)ptr->data;
+ return vec[index+3];
+}
+
+static void rna_ShapeKeyBezierPoint_co_set(PointerRNA *ptr, int index, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[index+3]= value;
+}
+
+static float rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, int index)
+{
+ float *vec= (float*)ptr->data;
+ return vec[index];
+}
+
+static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, int index, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[index]= value;
+}
+
+static float rna_ShapeKeyBezierPoint_handle_2_co_get(PointerRNA *ptr, int index)
+{
+ float *vec= (float*)ptr->data;
+ return vec[6+index];
+}
+
+static void rna_ShapeKeyBezierPoint_handle_2_co_set(PointerRNA *ptr, int index, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[6+index]= value;
+}
+
+/*static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr)
+{
+ float *vec= (float*)ptr->data;
+ return vec[10];
+}
+
+static void rna_ShapeKeyBezierPoint_tilt_set(PointerRNA *ptr, float value)
+{
+ float *vec= (float*)ptr->data;
+ vec[10]= value;
+}*/
+
+static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Key *key= rna_ShapeKey_find_key(ptr->id.data);
+ KeyBlock *kb= (KeyBlock*)ptr->data;
+ Curve *cu;
+ Nurb *nu;
+ int tot= kb->totelem, size= key->elemsize;
+
+ if(GS(key->from->name) == ID_CU) {
+ cu= (Curve*)key->from;
+ nu= cu->nurb.first;
+
+ if(nu->bezt) {
+ tot /= 3;
+ size *= 3;
+ }
+ }
+
+ rna_iterator_array_begin(iter, (void*)kb->data, size, tot, NULL);
+}
+
+static int rna_ShapeKey_data_length(PointerRNA *ptr)
+{
+ Key *key= rna_ShapeKey_find_key(ptr->id.data);
+ KeyBlock *kb= (KeyBlock*)ptr->data;
+ Curve *cu;
+ Nurb *nu;
+ int tot= kb->totelem;
+
+ if(GS(key->from->name) == ID_CU) {
+ cu= (Curve*)key->from;
+ nu= cu->nurb.first;
+
+ if(nu->bezt)
+ tot /= 3;
+ }
+
+ return tot;
+}
+
+static StructRNA *rna_ShapeKey_data_type(CollectionPropertyIterator *iter)
+{
+ Key *key= rna_ShapeKey_find_key(iter->parent.id.data);
+ Curve *cu;
+ Nurb *nu;
+
+ if(GS(key->from->name) == ID_CU) {
+ cu= (Curve*)key->from;
+ nu= cu->nurb.first;
+
+ if(nu->bezt)
+ return &RNA_ShapeKeyBezierPoint;
+ else
+ return &RNA_ShapeKeyCurvePoint;
+ }
+ else
+ return &RNA_ShapeKeyPoint;
+}
+
+#else
+
+static void rna_def_keydata(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ShapeKeyPoint", NULL, "Shape Key Point");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL, "Shape Key Curve Point");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL);
+ RNA_def_property_ui_text(prop, "Tilt", "");
+
+ srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL, "Shape Key Bezier Point");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL);
+ RNA_def_property_ui_text(prop, "Handle 1 Location", "");
+
+ prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL);
+ RNA_def_property_ui_text(prop, "Handle 2 Location", "");
+
+ /* appears to be unused currently
+ prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL);
+ RNA_def_property_ui_text(prop, "Tilt", "");*/
+}
+
+static void rna_def_keyblock(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_keyblock_type_items[] = {
+ {KEY_LINEAR, "KEY_LINEAR", "Linear", ""},
+ {KEY_CARDINAL, "KEY_CARDINAL", "Cardinal", ""},
+ {KEY_BSPLINE, "KEY_BSPLINE", "BSpline", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "ShapeKey", NULL, "Shape Key");
+ RNA_def_struct_sdna(srna, "KeyBlock");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* keys need to be sorted to edit this */
+ prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_float_sdna(prop, NULL, "pos");
+ RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys.");
+
+ /* the current value isn't easily editable this way, it's linked to an IPO.
+ * these seem to be mostly the values that are being written to, not edited */
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_float_sdna(prop, NULL, "curval");
+ RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame.");
+
+ prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, prop_keyblock_type_items);
+ RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type.");
+
+ prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "vgroup");
+ RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape.");
+
+ prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "ShapeKey");
+ RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key.");
+ RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", NULL, NULL);
+
+ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE);
+ RNA_def_property_ui_text(prop, "Mute", "Mute this shape key.");
+
+ prop= RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "slidermin");
+ RNA_def_property_range(prop, -10.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider.");
+
+ prop= RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "slidermax");
+ RNA_def_property_range(prop, -10.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider.");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", 0, 0, 0, "rna_ShapeKey_data_type", "rna_ShapeKey_data_length", 0, 0);
+}
+
+static void rna_def_key(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Key", "ID", "Key");
+
+ prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_pointer_sdna(prop, NULL, "refkey");
+ RNA_def_property_ui_text(prop, "Reference Key", "");
+
+ prop= RNA_def_property(srna, "shape_keys", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "block", NULL);
+ RNA_def_property_struct_type(prop, "ShapeKey");
+ RNA_def_property_ui_text(prop, "Shape Keys", "");
+
+ rna_def_ipo_common(srna);
+
+ prop= RNA_def_property(srna, "from", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "From", "Datablock using these shape keys.");
+
+ prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE);
+ RNA_def_property_ui_text(prop, "Relative", "Makes shape keys relative.");
+
+ prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "slurph");
+ RNA_def_property_range(prop, -500, 500);
+ RNA_def_property_ui_text(prop, "Slurph", "Creates a delay in amount of frames in applying keypositions, first vertex goes first.");
+}
+
+void RNA_def_key(BlenderRNA *brna)
+{
+ rna_def_key(brna);
+ rna_def_keyblock(brna);
+ rna_def_keydata(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
new file mode 100644
index 00000000000..fd9067ebd24
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -0,0 +1,385 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_lamp_types.h"
+
+#ifdef RNA_RUNTIME
+
+static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
+{
+ Lamp *la= (Lamp*)ptr->data;
+
+ CLAMP(value, 512, 10240);
+ la->bufsize= value;
+ la->bufsize &= (~15); /* round to multiple of 16 */
+}
+
+
+#else
+
+void RNA_def_lamp(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] = {
+ {LA_LOCAL, "LOCAL", "Local", ""},
+ {LA_SUN, "SUN", "Sun", ""},
+ {LA_SPOT, "SPOT", "Spot", ""},
+ {LA_HEMI, "HEMI", "Hemi", ""},
+ {LA_AREA, "AREA", "Area", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_shadow_items[] = {
+ {0, "NOSHADOW", "No Shadow", ""},
+ {LA_SHAD_BUF, "BUFSHADOW", "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer."},
+ {LA_SHAD_RAY, "RAYSHADOW", "Ray Shadow", "Use ray tracing for shadow."},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_raysampmethod_items[] = {
+ {LA_SAMP_CONSTANT, "CONSTANT", "Constant", ""},
+ {LA_SAMP_HALTON, "HALTON", "Halton", ""},
+ {LA_SHAD_RAY, "LA_SAMP_HAMMERSLEY", "Hammersley", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_areashape_items[] = {
+ {LA_AREA_SQUARE, "SQUARE", "Square", ""},
+ {LA_AREA_RECT, "RECTANGLE", "Rectangle", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_shadbuftype_items[] = {
+ {LA_SHADBUF_REGULAR , "REGULAR", "Classical", "Use the Classic Buffer type"},
+ {LA_SHADBUF_IRREGULAR, "IRREGULAR", "Irregular", "Use the Irregular Shadow Buffer type."},
+ {LA_SHADBUF_HALFWAY, "HALFWAY", "Classic-Halfway", "Use the Classic-Halfway Buffer type."},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_shadbuffiltertype_items[] = {
+ {LA_SHADBUF_BOX , "BOX", "Box", "Use the Box filter"},
+ {LA_SHADBUF_TENT, "TENT", "Tent", "Use the Tent Filter."},
+ {LA_SHADBUF_GAUSS, "GAUSS", "Gauss", "Use the Gauss filter."},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_numbuffer_items[] = {
+ {1, "1BUFF", "1", "Sample 1 Shadow Buffer."},
+ {4, "4BUFF", "4", "Sample 4 Shadow Buffers."},
+ {9, "9BUFF", "9", "Sample 9 Shadow Buffers."},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_skycolorspace_items[] = {
+ {0, "SMPTE", "SMPTE", ""},
+ {1, "REC709", "REC709", ""},
+ {2, "CIE", "CIE", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_blendmode_items[] = {
+ {0, "MIX", "Mix", ""},
+ {1, "ADD", "Add", ""},
+ {2, "MULTIPLY", "Multiply", ""},
+ {3, "SUBTRACT", "Subtract", ""},
+ {4, "SCREEN", "Screen", ""},
+ {5, "DIVIDE", "Divide", ""},
+ {6, "DIFFERENCE", "Difference", ""},
+ {7, "DARKEN", "Darken", ""},
+ {8, "LIGHTEN", "Lighten", ""},
+ {9, "OVERLAY", "Overlay", ""},
+ {10, "DODGE", "Dodge", ""},
+ {11, "BURN", "Burn", ""},
+ {12, "HUE", "Hue", ""},
+ {13, "SATURATION", "Saturation", ""},
+ {14, "VALUE", "Value", ""},
+ {15, "COLOR", "Color", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_fallofftype_items[] = {
+ {LA_FALLOFF_CONSTANT, "CONSTANT", "Constant", ""},
+ {LA_FALLOFF_INVLINEAR, "INVLINEAR", "Inverse Linear", ""},
+ {LA_FALLOFF_INVSQUARE, "INVSQUARE", "Inverse Square", ""},
+ {LA_FALLOFF_CURVE, "CURVE", "Custom Curve", ""},
+ {LA_FALLOFF_SLIDERS, "SLIDERS", "Lin/Quad Weighted", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Lamp", "ID", "Lamp");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Type", "Type of Lamp.");
+
+ prop= RNA_def_property(srna, "sky_colorspace", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_skycolorspace_items);
+ RNA_def_property_ui_text(prop, "Sky Color Space", "");
+
+ prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
+ RNA_def_property_enum_items(prop, prop_blendmode_items);
+ RNA_def_property_ui_text(prop, "Sky Blend Type", "Blend type for how sky is combined with world sky");
+
+ prop= RNA_def_property(srna, "area_shape", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_areashape_items);
+ RNA_def_property_ui_text(prop, "Area Shape", "Shape of the Area lamp");
+
+ prop= RNA_def_property(srna, "ray_samp_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_raysampmethod_items);
+ RNA_def_property_ui_text(prop, "Ray Sample Method", "The Method in how rays are sampled");
+
+ prop= RNA_def_property(srna, "buffer_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "buftype");
+ RNA_def_property_enum_items(prop, prop_shadbuftype_items);
+ RNA_def_property_ui_text(prop, "Buffer Type", "Type of Shadow Buffer.");
+
+ prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "filtertype");
+ RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
+ RNA_def_property_ui_text(prop, "Filter Type", "Type of Shadow Buffer Filter.");
+
+ prop= RNA_def_property(srna, "buffers", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_numbuffer_items);
+ RNA_def_property_ui_text(prop, "Sample Buffers", "Number of Buffers to sample.");
+
+ prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* needs to be able to create curve mapping */
+ RNA_def_property_enum_items(prop, prop_fallofftype_items);
+ RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance.");
+
+ prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
+ RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
+
+ /* Number values */
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_range(prop, 0.0f, 9999.0f);
+ RNA_def_property_ui_text(prop, "Distance", "Distance that the lamp emits light.");
+
+ prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "att1");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation.");
+
+ prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "att2");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation.");
+
+ prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "spotblend");
+ RNA_def_property_range(prop, 0.0f ,1.0f);
+ RNA_def_property_ui_text(prop, "Spot Blend", "The softeness of the spotlight edge.");
+
+ prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "spotsize");
+ RNA_def_property_range(prop, 1.0f ,180.0f);
+ RNA_def_property_ui_text(prop, "Spot Size", "The angle of the spotlight beam in degrees.");
+
+ prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipsta");
+ RNA_def_property_range(prop, 0.0f, 9999.0f);
+ RNA_def_property_ui_text(prop, "Clip Start", "Distance that the buffer calculations start.");
+
+ prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "clipend");
+ RNA_def_property_range(prop, 0.0f, 9999.0f);
+ RNA_def_property_ui_text(prop, "Clip End", "Distance that the buffer calculations finish.");
+
+ prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_ui_text(prop, "Bias", "Shadow Map sampling bias.");
+
+ prop= RNA_def_property(srna, "soft", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Soft", "Size of shadow sampling area.");
+
+ prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "samp");
+ RNA_def_property_range(prop, 1,16);
+ RNA_def_property_ui_text(prop, "Samples", "Number of shadow map samples.");
+
+ prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits.");
+
+ prop= RNA_def_property(srna, "ray_samples", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "ray_samp");
+ RNA_def_property_range(prop, 1, 16);
+ RNA_def_property_ui_text(prop, "Ray Samples", "Amount of samples taken extra (samples x samples).");
+
+ prop= RNA_def_property(srna, "ray_sampy", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 1,16);
+ RNA_def_property_ui_text(prop, "Ray Samples Y", "Amount of samples taken extra (samples x samples).");
+
+ prop= RNA_def_property(srna, "area_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Area Size", "Size of the area of the Area Lamp.");
+
+ prop= RNA_def_property(srna, "area_sizey", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Area Size Y", "Size of the area of the Area Lamp.");
+
+ prop= RNA_def_property(srna, "adapt_thresh", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Adapt Threshold", "Threshold for Adaptive Sampling.");
+
+ prop= RNA_def_property(srna, "buffer_size", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "bufsize");
+ RNA_def_property_range(prop, 512, 10240);
+ RNA_def_property_ui_text(prop, "Buffer Size", "Sets the size of the shadow buffer to nearest multiple of 16");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
+
+ prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "haint");
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_ui_text(prop, "Halo Intensity", "Intensity of Spot Halo");
+
+ prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_ui_text(prop, "Hor. Bright", "horizon brightness");
+
+ prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Hor. Spread", "horizon Spread");
+
+ prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Sun Bright", "Sun Brightness");
+
+ prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Sun Size", "Sun Size");
+
+ prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Back Light", "Backscatter Light");
+
+ prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Sun Intens", "Sun Intensity");
+
+ prop= RNA_def_property(srna, "atm_turbidity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 30.0f);
+ RNA_def_property_ui_text(prop, "Turbidity", "Sky Tubidity");
+
+ prop= RNA_def_property(srna, "atm_inscattering_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Inscatter", "Scatter contribution factor");
+
+ prop= RNA_def_property(srna, "atm_extinction_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Extinction", "Extinction scattering contribution factor");
+
+ prop= RNA_def_property(srna, "atm_distance_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 500.0f);
+ RNA_def_property_ui_text(prop, "Atmos Distance", "Scale blender distance to real distance");
+
+ prop= RNA_def_property(srna, "sky_blend_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Sky Blend Factor", "Blend factor with sky");
+
+ prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_ui_text(prop, "Sky Exposure", "Exposure correction");
+
+
+ /*short sky_colorspace, pad4;*/
+
+ /* Colors */
+ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "r");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Color", "");
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "shdwr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Shadow Color", "");
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10.0f, 3.0f);
+
+ /* Booleans */
+ prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
+ RNA_def_property_ui_text(prop, "Autoclip Start", "Automatically Sets Clip start to the nearest pixel.");
+
+ prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
+ RNA_def_property_ui_text(prop, "Autoclip End", "Automatically Sets Clip end to the farthest away pixel.");
+
+ prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
+ RNA_def_property_ui_text(prop, "Umbra", "Emphasise parts in full shadow.");
+
+ prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
+ RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling.");
+
+ prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
+ RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling.");
+
+ prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
+ RNA_def_property_ui_text(prop, "sky", "Apply sun effect on sky");
+
+ prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
+ RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on Atmosphere");
+
+ /* mode */
+ prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
+ RNA_def_property_ui_text(prop, "Halo", "Lamp creates a halo.");
+
+ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
+ RNA_def_property_ui_text(prop, "Layer", "Lamp is only used on the Scene layer the lamp is on.");
+
+ prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
+ RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light.");
+
+ prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
+ RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights.");
+
+ prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
+ RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading.");
+
+ prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
+ RNA_def_property_ui_text(prop, "Only Shadow", "Lamp only creates shadows.");
+
+ prop= RNA_def_property(srna, "shadow", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_shadow_items);
+ RNA_def_property_ui_text(prop, "Shadow", "Method to compute lamp shadow.");
+
+ prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
+ RNA_def_property_ui_text(prop, "Sphere", "Sets square spotbundles.");
+
+ prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
+ RNA_def_property_ui_text(prop, "Square", "Sets light intensity to zero beyond lamp distance.");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
new file mode 100644
index 00000000000..1471d80e938
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -0,0 +1,92 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_lattice_types.h"
+#include "DNA_key_types.h"
+
+#ifdef RNA_RUNTIME
+#else
+
+void RNA_def_lattice(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_keyblock_type_items[] = {
+ {KEY_LINEAR, "KEY_LINEAR", "Linear", ""},
+ {KEY_CARDINAL, "KEY_CARDINAL", "Cardinal", ""},
+ {KEY_BSPLINE, "KEY_BSPLINE", "BSpline", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Lattice", "ID", "Lattice");
+
+ prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pntsu");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "U", "Points in U direction.");
+
+ prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pntsv");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "V", "Points in V direction.");
+
+ prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pntsw");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "W", "Points in W direction.");
+
+ prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "typeu");
+ RNA_def_property_enum_items(prop, prop_keyblock_type_items);
+ RNA_def_property_ui_text(prop, "Interpolation Type U", "");
+
+ prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "typev");
+ RNA_def_property_enum_items(prop, prop_keyblock_type_items);
+ RNA_def_property_ui_text(prop, "Interpolation Type V", "");
+
+ prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "typew");
+ RNA_def_property_enum_items(prop, prop_keyblock_type_items);
+ RNA_def_property_ui_text(prop, "Interpolation Type W", "");
+
+ prop= RNA_def_property(srna, "outside", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
+ RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices.");
+
+ rna_def_ipo_common(srna);
+
+ prop= RNA_def_property(srna, "key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Shape Keys", "");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
new file mode 100644
index 00000000000..b2ee9f4e12f
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -0,0 +1,272 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_main.h"
+
+/* all the list begin functions are added manually here, Main is not in SDNA */
+
+static void rna_Main_filename_get(PointerRNA *ptr, char *value)
+{
+ Main *bmain= (Main*)ptr->data;
+ BLI_strncpy(value, bmain->name, sizeof(bmain->name));
+}
+
+static int rna_Main_filename_length(PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ return strlen(bmain->name);
+}
+
+static void rna_Main_filename_set(PointerRNA *ptr, const char *value)
+{
+ Main *bmain= (Main*)ptr->data;
+ BLI_strncpy(bmain->name, value, sizeof(bmain->name));
+}
+
+static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->scene, NULL);
+}
+
+static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->object, NULL);
+}
+
+static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->lamp, NULL);
+}
+
+static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->library, NULL);
+}
+
+static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->mesh, NULL);
+}
+
+static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->curve, NULL);
+}
+
+static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->mball, NULL);
+}
+
+static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->mat, NULL);
+}
+
+static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->tex, NULL);
+}
+
+static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->image, NULL);
+}
+
+static void rna_Main_latt_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->latt, NULL);
+}
+
+static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
+}
+
+static void rna_Main_ipo_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->ipo, NULL);
+}
+
+static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->key, NULL);
+}
+
+static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->world, NULL);
+}
+
+static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->screen, NULL);
+}
+
+static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->script, NULL);
+}
+
+static void rna_Main_vfont_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->vfont, NULL);
+}
+
+static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->text, NULL);
+}
+
+static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->sound, NULL);
+}
+
+static void rna_Main_group_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->group, NULL);
+}
+
+static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->armature, NULL);
+}
+
+static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->action, NULL);
+}
+
+static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL);
+}
+
+static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->brush, NULL);
+}
+
+static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->particle, NULL);
+}
+
+static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Main *bmain= (Main*)ptr->data;
+ rna_iterator_listbase_begin(iter, &bmain->wm, NULL);
+}
+
+#else
+
+void RNA_def_main(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ const char *lists[][5]= {
+ {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks."},
+ {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."},
+ {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks."},
+ {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."},
+ {"nodetrees", "NodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks."},
+ {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks."},
+ {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks."},
+ {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks."},
+ {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks."},
+ {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks."},
+ {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks."},
+ {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks."},
+ {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks."},
+ {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."},
+ {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks."},
+ {"textures", "ID", "rna_Main_tex_begin", "Textures", "Texture datablocks."},
+ {"ipos", "Ipo", "rna_Main_ipo_begin", "Ipos", "Ipo datablocks."},
+ {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."},
+ {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks."},
+ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."},
+ {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks."},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks."},
+ {"texts", "ID", "rna_Main_text_begin", "Texts", "Text datablocks."},
+ {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks."},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."},
+ {"actions", "ID", "rna_Main_action_begin", "Actions", "Action datablocks."},
+ {"particles", "ID", "rna_Main_particle_begin", "Particles", "Particle datablocks."},
+ {NULL, NULL, NULL, NULL, NULL}};
+ int i;
+
+ srna= RNA_def_struct(brna, "Main", NULL, "Main");
+
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_maxlength(prop, 240);
+ RNA_def_property_string_funcs(prop, "rna_Main_filename_get", "rna_Main_filename_length", "rna_Main_filename_set");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file.");
+
+ for(i=0; lists[i][0]; i++)
+ {
+ prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, lists[i][1]);
+ RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]);
+ }
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
new file mode 100644
index 00000000000..3b91bd92c6b
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -0,0 +1,186 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Nathan Letwory
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_material_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_material(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_type_items[] = {
+ {MA_RGB, "RGB", "RGB", ""},
+ /* not used in blender yet
+ {MA_CMYK, "CMYK", "CMYK", ""},
+ {MA_YUV, "YUV", "YUV", ""}, */
+ {MA_HSV, "HSV", "HSV", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_fadeto_mir_items[] = {
+ {MA_RAYMIR_FADETOSKY, "RAYMIR_FADETOSKY", "Fade to sky color", ""},
+ {MA_RAYMIR_FADETOMAT, "RAYMIR_FADETOMAT", "Fade to material color", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_diff_shader_items[] = {
+ {MA_DIFF_LAMBERT, "DIFF_LAMBERT", "Lambert", ""},
+ {MA_DIFF_ORENNAYAR, "DIFF_ORENNAYAR", "Oren-Nayar", ""},
+ {MA_DIFF_TOON, "DIFF_TOON", "Toon", ""},
+ {MA_DIFF_MINNAERT, "DIFF_MINNAERT", "Minnaert", ""},
+ {MA_DIFF_FRESNEL, "DIFF_FRESNEL", "Fresnel", ""},
+ {0, NULL, NULL, NULL}};
+
+
+ srna= RNA_def_struct(brna, "Material", "ID", "Material");
+
+ prop= RNA_def_property(srna, "color_model", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "colormodel");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Color Model", "");
+
+ /* colors */
+ prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "r");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Diffuse Color", "");
+ RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "specr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Specular Color", "");
+ RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "mirr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Mirror Color", "");
+ RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "ambr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Ambient Color", "");
+ RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f);
+
+ prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Alpha", "");
+
+ /* diffuse shaders */
+
+ prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
+ RNA_def_property_enum_items(prop, prop_diff_shader_items);
+ RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
+
+ prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ref");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection.");
+
+ prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 3.14f);
+ RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness");
+
+ prop= RNA_def_property(srna, "params1_4", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "param");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_ui_text(prop, "Params 1-4", "Parameters used for diffuse and specular Toon, and diffuse Fresnel shaders. Check documentation for details.");
+
+ prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness.");
+
+ /* raytrace mirror */
+ prop= RNA_def_property(srna, "mode_ray_mirror", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */
+ RNA_def_property_ui_text(prop, "Ray Mirror Mode", "Toggle raytrace mirror.");
+
+ prop= RNA_def_property(srna, "ray_mirror", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror", "Sets the amount mirror reflection for raytrace.");
+
+ prop= RNA_def_property(srna, "ray_mirror_fresnel", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fresnel_mir");
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Fresnel", "Power of Fresnel for mirror reflection.");
+
+ prop= RNA_def_property(srna, "ray_mirror_fresnel_fac", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Fresnel Factor", "Blending factor for Fresnel.");
+
+ prop= RNA_def_property(srna, "ray_mirror_gloss", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Gloss", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
+
+ prop= RNA_def_property(srna, "ray_mirror_gloss_aniso", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Gloss Aniso", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent.");
+
+ prop= RNA_def_property(srna, "ray_mirror_gloss_samples", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "samp_gloss_mir");
+ RNA_def_property_range(prop, 0.0f, 1024.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Gloss Samples", "Number of cone samples averaged for blurry reflections.");
+
+ prop= RNA_def_property(srna, "ray_mirror_adapt_thresh", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped.");
+
+ prop= RNA_def_property(srna, "ray_mirror_depth", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ray_depth");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Depth", "Maximum allowed number of light inter-reflections.");
+
+ prop= RNA_def_property(srna, "ray_mirror_distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "dist_mir");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_ui_text(prop, "Ray Mirror Max Dist", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color.");
+
+ prop= RNA_def_property(srna, "ray_mirror_fadeto", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
+ RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
+ RNA_def_property_ui_text(prop, "Ray Mirror End Fade-out", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
+
+ /* nodetree */
+ prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Node Tree", "");
+}
+
+#endif
+
+
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
new file mode 100644
index 00000000000..cb17ec1a1ef
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -0,0 +1,983 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+
+#include "BKE_customdata.h"
+
+#ifdef RNA_RUNTIME
+
+/*static float rna_MVert_no_get(PointerRNA *ptr, int index)
+{
+ MVert *mvert= (MVert*)ptr->data;
+ return mvert->no[index]/32767.0f;
+}*/
+
+static float rna_MVert_bevel_weight_get(PointerRNA *ptr)
+{
+ MVert *mvert= (MVert*)ptr->data;
+ return mvert->bweight/255.0f;
+}
+
+static void rna_MVert_bevel_weight_set(PointerRNA *ptr, float value)
+{
+ MVert *mvert= (MVert*)ptr->data;
+ mvert->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MEdge_bevel_weight_get(PointerRNA *ptr)
+{
+ MEdge *medge= (MEdge*)ptr->data;
+ return medge->bweight/255.0f;
+}
+
+static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value)
+{
+ MEdge *medge= (MEdge*)ptr->data;
+ medge->bweight= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MEdge_crease_get(PointerRNA *ptr)
+{
+ MEdge *medge= (MEdge*)ptr->data;
+ return medge->crease/255.0f;
+}
+
+static void rna_MEdge_crease_set(PointerRNA *ptr, float value)
+{
+ MEdge *medge= (MEdge*)ptr->data;
+ medge->crease= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MCol_color1_get(PointerRNA *ptr, int index)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ return (&mcol[0].r)[index]/255.0f;
+}
+
+static void rna_MCol_color1_set(PointerRNA *ptr, int index, float value)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ (&mcol[0].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MCol_color2_get(PointerRNA *ptr, int index)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ return (&mcol[1].r)[index]/255.0f;
+}
+
+static void rna_MCol_color2_set(PointerRNA *ptr, int index, float value)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ (&mcol[1].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MCol_color3_get(PointerRNA *ptr, int index)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ return (&mcol[2].r)[index]/255.0f;
+}
+
+static void rna_MCol_color3_set(PointerRNA *ptr, int index, float value)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ (&mcol[2].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static float rna_MCol_color4_get(PointerRNA *ptr, int index)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ return (&mcol[2].r)[index]/255.0f;
+}
+
+static void rna_MCol_color4_set(PointerRNA *ptr, int index, float value)
+{
+ MCol *mcol= (MCol*)ptr->data;
+ (&mcol[3].r)[index]= (char)(CLAMPIS(value*255.0f, 0, 255));
+}
+
+static int rna_Mesh_texspace_editable(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ return (me->texflag & AUTOSPACE)? PROP_NOT_EDITABLE: 0;
+}
+
+static void rna_MVert_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+
+ if(me->dvert) {
+ MVert *mvert= (MVert*)ptr->data;
+ MDeformVert *dvert= me->dvert + (mvert-me->mvert);
+
+ rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, NULL);
+ }
+ else
+ rna_iterator_array_begin(iter, NULL, 0, 0, NULL);
+}
+
+static void rna_MMultires_level_range(PointerRNA *ptr, int *min, int *max)
+{
+ Multires *mr= (Multires*)ptr->data;
+ *min= 1;
+ *max= mr->level_count;
+}
+
+static void rna_MFace_mat_index_range(PointerRNA *ptr, int *min, int *max)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ *min= 0;
+ *max= me->totcol-1;
+}
+
+static int rna_CustomDataLayer_length(PointerRNA *ptr, int type)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer;
+ int i, length= 0;
+
+ for(layer=me->fdata.layers, i=0; i<me->fdata.totlayer; layer++, i++)
+ if(layer->type == type)
+ length++;
+
+ return length;
+}
+
+static int rna_CustomDataLayer_active_get(PointerRNA *ptr, int type, int render)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers;
+
+ if(render) return (n == CustomData_get_render_layer_index(&me->fdata, type));
+ else return (n == CustomData_get_active_layer_index(&me->fdata, type));
+}
+
+static void rna_CustomDataLayer_active_set(PointerRNA *ptr, int value, int type, int render)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers;
+
+ if(value == 0)
+ return;
+
+ if(render) CustomData_set_layer_render_index(&me->fdata, type, n);
+ else CustomData_set_layer_active_index(&me->fdata, type, n);
+}
+
+static int rna_uv_layer_check(CollectionPropertyIterator *iter, void *data)
+{
+ CustomDataLayer *layer= (CustomDataLayer*)data;
+ return (layer->type != CD_MTFACE);
+}
+
+static void rna_Mesh_uv_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_uv_layer_check);
+}
+
+static int rna_Mesh_uv_layers_length(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_length(ptr, CD_MTFACE);
+}
+
+static float rna_MTFace_uv1_get(PointerRNA *ptr, int index)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ return mtface->uv[0][index];
+}
+
+static void rna_MTFace_uv1_set(PointerRNA *ptr, int index, float value)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ mtface->uv[0][index]= value;
+}
+
+static float rna_MTFace_uv2_get(PointerRNA *ptr, int index)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ return mtface->uv[1][index];
+}
+
+static void rna_MTFace_uv2_set(PointerRNA *ptr, int index, float value)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ mtface->uv[1][index]= value;
+}
+
+static float rna_MTFace_uv3_get(PointerRNA *ptr, int index)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ return mtface->uv[2][index];
+}
+
+static void rna_MTFace_uv3_set(PointerRNA *ptr, int index, float value)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ mtface->uv[2][index]= value;
+}
+
+static float rna_MTFace_uv4_get(PointerRNA *ptr, int index)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ return mtface->uv[3][index];
+}
+
+static void rna_MTFace_uv4_set(PointerRNA *ptr, int index, float value)
+{
+ MTFace *mtface= (MTFace*)ptr->data;
+ mtface->uv[3][index]= value;
+}
+
+static void rna_MTFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), me->totface, NULL);
+}
+
+static int rna_MTFaceLayer_data_length(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->totface;
+}
+
+static int rna_MTFaceLayer_active_render_get(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_active_get(ptr, CD_MTFACE, 1);
+}
+
+static int rna_MTFaceLayer_active_get(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_active_get(ptr, CD_MTFACE, 0);
+}
+
+static void rna_MTFaceLayer_active_render_set(PointerRNA *ptr, int value)
+{
+ rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 1);
+}
+
+static void rna_MTFaceLayer_active_set(PointerRNA *ptr, int value)
+{
+ rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 0);
+}
+
+static int rna_vcol_layer_check(CollectionPropertyIterator *iter, void *data)
+{
+ CustomDataLayer *layer= (CustomDataLayer*)data;
+ return (layer->type != CD_MCOL);
+}
+
+static void rna_Mesh_vcol_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_vcol_layer_check);
+}
+
+static int rna_Mesh_vcol_layers_length(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_length(ptr, CD_MCOL);
+}
+
+static void rna_MColLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MCol)*4, me->totface, NULL);
+}
+
+static int rna_MColLayer_data_length(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->totface;
+}
+
+static int rna_MColLayer_active_render_get(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_active_get(ptr, CD_MCOL, 1);
+}
+
+static int rna_MColLayer_active_get(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_active_get(ptr, CD_MCOL, 0);
+}
+
+static void rna_MColLayer_active_render_set(PointerRNA *ptr, int value)
+{
+ rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 1);
+}
+
+static void rna_MColLayer_active_set(PointerRNA *ptr, int value)
+{
+ rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 0);
+}
+
+static void rna_MFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totface, NULL);
+}
+
+static int rna_MFloatPropertyLayer_data_length(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->totface;
+}
+
+static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data)
+{
+ CustomDataLayer *layer= (CustomDataLayer*)data;
+ return (layer->type != CD_PROP_FLT);
+}
+
+static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_float_layer_check);
+}
+
+static int rna_Mesh_float_layers_length(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_length(ptr, CD_PROP_FLT);
+}
+
+static int rna_int_layer_check(CollectionPropertyIterator *iter, void *data)
+{
+ CustomDataLayer *layer= (CustomDataLayer*)data;
+ return (layer->type != CD_PROP_INT);
+}
+
+static void rna_MIntPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totface, NULL);
+}
+
+static int rna_MIntPropertyLayer_data_length(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->totface;
+}
+
+static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_int_layer_check);
+}
+
+static int rna_Mesh_int_layers_length(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_length(ptr, CD_PROP_INT);
+}
+
+static int rna_string_layer_check(CollectionPropertyIterator *iter, void *data)
+{
+ CustomDataLayer *layer= (CustomDataLayer*)data;
+ return (layer->type != CD_PROP_STR);
+}
+
+static void rna_MStringPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ CustomDataLayer *layer= (CustomDataLayer*)ptr->data;
+ rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totface, NULL);
+}
+
+static int rna_MStringPropertyLayer_data_length(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->totface;
+}
+
+static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_string_layer_check);
+}
+
+static int rna_Mesh_string_layers_length(PointerRNA *ptr)
+{
+ return rna_CustomDataLayer_length(ptr, CD_PROP_STR);
+}
+
+#else
+
+static void rna_def_mvert_group(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MVertGroup", NULL, "Mesh Vertex Group");
+ RNA_def_struct_sdna(srna, "MDeformWeight");
+
+ /* we can't point to actual group, it is in the object and so
+ * there is no unique group to point to, hence the index */
+ prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "def_nr");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Group Index", "");
+
+ prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Weight", "Vertex Weight");
+}
+
+static void rna_def_mvert(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MVert", NULL, "Mesh Vertex");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ /*prop= RNA_def_property(srna, "no", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_funcs(prop, "rna_MVert_no_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);*/
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
+ RNA_def_property_ui_text(prop, "Selected", "");
+
+ prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
+ RNA_def_property_ui_text(prop, "Hidden", "");
+
+ prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_MVert_bevel_weight_get", "rna_MVert_bevel_weight_set", NULL);
+ RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option");
+
+ prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_funcs(prop, "rna_MVert_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0);
+ RNA_def_property_struct_type(prop, "MVertGroup");
+ RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of");
+}
+
+static void rna_def_medge(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MEdge", NULL, "Mesh Edge");
+
+ prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "v1");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
+
+ prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL);
+ RNA_def_property_ui_text(prop, "Crease", "Weight used by the Subsurf modifier for creasing");
+
+ prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_MEdge_bevel_weight_get", "rna_MEdge_bevel_weight_set", NULL);
+ RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier");
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
+ RNA_def_property_ui_text(prop, "Selected", "");
+
+ prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
+ RNA_def_property_ui_text(prop, "Hidden", "");
+
+ prop= RNA_def_property(srna, "seam", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM);
+ RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping");
+
+ prop= RNA_def_property(srna, "sharp", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP);
+ RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
+}
+
+static void rna_def_mface(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MFace", NULL, "Mesh Face");
+
+ prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "v1");
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Vertices", "Vertex indices");
+
+ prop= RNA_def_property(srna, "mat_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "mat_nr");
+ RNA_def_property_ui_text(prop, "Material Index", "");
+ RNA_def_property_range(prop, 0, MAXMAT-1);
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MFace_mat_index_range");
+
+ prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL);
+ RNA_def_property_ui_text(prop, "Selected", "");
+
+ prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE);
+ RNA_def_property_ui_text(prop, "Hidden", "");
+
+ prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH);
+ RNA_def_property_ui_text(prop, "Smooth", "");
+}
+
+static void rna_def_mtface(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static const EnumPropertyItem transp_items[]= {
+ {TF_SOLID, "OPAQUE", "Opaque", "Render color of textured face as color"},
+ {TF_ADD, "ADD", "Add", "Render face transparent and add color of face"},
+ {TF_ALPHA, "ALPHA", "Alpha", "Render polygon transparent, depending on alpha channel of the texture"},
+ {TF_CLIP, "CLIPALPHA", "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MTFace", NULL, "Mesh Texture Face");
+
+ /* prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "tpage");
+ RNA_def_property_ui_text(prop, "Image", ""); */
+
+ prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX);
+ RNA_def_property_ui_text(prop, "Tex", "Render face with texture");
+
+ prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TILES);
+ RNA_def_property_ui_text(prop, "Tiles", "Use tilemode for face");
+
+ prop= RNA_def_property(srna, "light", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT);
+ RNA_def_property_ui_text(prop, "Light", "Use light for face");
+
+ prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE);
+ RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
+
+ prop= RNA_def_property(srna, "collision", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC);
+ RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection");
+
+ prop= RNA_def_property(srna, "shared", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL);
+ RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared");
+
+ prop= RNA_def_property(srna, "twoside", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE);
+ RNA_def_property_ui_text(prop, "Twoside", "Render face twosided");
+
+ prop= RNA_def_property(srna, "obcolor", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL);
+ RNA_def_property_ui_text(prop, "ObColor", "Use ObColor instead of vertex colors");
+
+ prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD);
+ RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard");
+
+ prop= RNA_def_property(srna, "billboard", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2);
+ RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint");
+
+ prop= RNA_def_property(srna, "shadow", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW);
+ RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow");
+
+ prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT);
+ RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face");
+
+ prop= RNA_def_property(srna, "alphasort", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT);
+ RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
+
+ prop= RNA_def_property(srna, "transp", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, transp_items);
+ RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode");
+
+ prop= RNA_def_property(srna, "uv_selected", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "UV Selected", "");
+
+ prop= RNA_def_property(srna, "uv_pinned", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1);
+ RNA_def_property_array(prop, 4);
+ RNA_def_property_ui_text(prop, "UV Pinned", "");
+
+ prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_funcs(prop, "rna_MTFace_uv1_get", "rna_MTFace_uv1_set", NULL);
+ RNA_def_property_ui_text(prop, "UV 1", "");
+
+ prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_funcs(prop, "rna_MTFace_uv2_get", "rna_MTFace_uv2_set", NULL);
+ RNA_def_property_ui_text(prop, "UV 2", "");
+
+ prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_funcs(prop, "rna_MTFace_uv3_get", "rna_MTFace_uv3_set", NULL);
+ RNA_def_property_ui_text(prop, "UV 3", "");
+
+ prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_funcs(prop, "rna_MTFace_uv4_get", "rna_MTFace_uv4_set", NULL);
+ RNA_def_property_ui_text(prop, "UV 4", "");
+
+ srna= RNA_def_struct(brna, "MTFaceLayer", NULL, "Mesh Texture Face Layer");
+ RNA_def_struct_sdna(srna, "CustomDataLayer");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_MTFaceLayer_active_get", "rna_MTFaceLayer_active_set");
+ RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
+
+ prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
+ RNA_def_property_boolean_funcs(prop, "rna_MTFaceLayer_active_render_get", "rna_MTFaceLayer_active_render_set");
+ RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MTFace");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_MTFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MTFaceLayer_data_length", 0, 0);
+}
+
+static void rna_def_msticky(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MSticky", NULL, "Mesh Vertex Sticky Texture Coordinate");
+
+ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location");
+}
+
+static void rna_def_mcol(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MCol", NULL, "Mesh Vertex Color");
+
+ prop= RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_MCol_color1_get", "rna_MCol_color1_set", NULL);
+ RNA_def_property_ui_text(prop, "Color 1", "");
+
+ prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_MCol_color2_get", "rna_MCol_color2_set", NULL);
+ RNA_def_property_ui_text(prop, "Color 2", "");
+
+ prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_MCol_color3_get", "rna_MCol_color3_set", NULL);
+ RNA_def_property_ui_text(prop, "Color 3", "");
+
+ prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_float_funcs(prop, "rna_MCol_color4_get", "rna_MCol_color4_set", NULL);
+ RNA_def_property_ui_text(prop, "Color 4", "");
+
+ srna= RNA_def_struct(brna, "MColLayer", NULL, "Mesh Vertex Color Layer");
+ RNA_def_struct_sdna(srna, "CustomDataLayer");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_MColLayer_active_get", "rna_MColLayer_active_set");
+ RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
+
+ prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
+ RNA_def_property_boolean_funcs(prop, "rna_MColLayer_active_render_get", "rna_MColLayer_active_render_set");
+ RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MCol");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_MColLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MColLayer_data_length", 0, 0);
+}
+
+static void rna_def_mproperties(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ /* Float */
+ srna= RNA_def_struct(brna, "MFloatProperty", NULL, "Mesh Float Property");
+
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "f");
+ RNA_def_property_ui_text(prop, "Value", "");
+
+ srna= RNA_def_struct(brna, "MFloatPropertyLayer", NULL, "Mesh Float Property Layer");
+ RNA_def_struct_sdna(srna, "CustomDataLayer");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MFloatProperty");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_MFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MFloatPropertyLayer_data_length", 0, 0);
+
+ /* Int */
+ srna= RNA_def_struct(brna, "MIntProperty", NULL, "Mesh Int Property");
+
+ prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "i");
+ RNA_def_property_ui_text(prop, "Value", "");
+
+ srna= RNA_def_struct(brna, "MIntPropertyLayer", NULL, "Mesh Int Property Layer");
+ RNA_def_struct_sdna(srna, "CustomDataLayer");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MIntProperty");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_MIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MIntPropertyLayer_data_length", 0, 0);
+
+ /* String */
+ srna= RNA_def_struct(brna, "MStringProperty", NULL, "Mesh String Property");
+
+ prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "s");
+ RNA_def_property_ui_text(prop, "Value", "");
+
+ srna= RNA_def_struct(brna, "MStringPropertyLayer", NULL, "Mesh String Property Layer");
+ RNA_def_struct_sdna(srna, "CustomDataLayer");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_ui_text(prop, "Name", "");
+
+ prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MStringProperty");
+ RNA_def_property_ui_text(prop, "Data", "");
+ RNA_def_property_collection_funcs(prop, "rna_MStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_MStringPropertyLayer_data_length", 0, 0);
+}
+
+static void rna_def_mmultires(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MMultires", NULL, "Mesh Multires");
+ RNA_def_struct_sdna(srna, "Multires");
+
+ prop= RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "newlvl");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MMultires_level_range");
+ RNA_def_property_ui_text(prop, "Level", "");
+
+ prop= RNA_def_property(srna, "edge_level", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "edgelvl");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MMultires_level_range");
+ RNA_def_property_ui_text(prop, "Edge Level", "");
+
+ prop= RNA_def_property(srna, "pin_level", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pinlvl");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MMultires_level_range");
+ RNA_def_property_ui_text(prop, "Pin Level", "Set level to apply modifiers to during render");
+
+ prop= RNA_def_property(srna, "render_level", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "renderlvl");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MMultires_level_range");
+ RNA_def_property_ui_text(prop, "Render Level", "Set level to render");
+}
+
+void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
+{
+ PropertyRNA *prop;
+
+ /* texture space */
+ prop= RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
+ RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+
+ prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "loc");
+ RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location");
+ RNA_def_property_funcs(prop, NULL, texspace_editable);
+
+ prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "size");
+ RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
+ RNA_def_property_funcs(prop, NULL, texspace_editable);
+
+ /* not supported yet
+ prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_ROTATION);
+ RNA_def_property_float(prop, NULL, "rot");
+ RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
+ RNA_def_property_funcs(prop, NULL, texspace_editable);*/
+
+ /* materials */
+ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
+ RNA_def_property_struct_type(prop, "Material");
+ RNA_def_property_ui_text(prop, "Materials", "");
+}
+
+void rna_def_ipo_common(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by this datablock.");
+}
+
+static void rna_def_mesh(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Mesh", "ID", "Mesh");
+
+ prop= RNA_def_property(srna, "verts", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert");
+ RNA_def_property_struct_type(prop, "MVert");
+ RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh");
+
+ prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge");
+ RNA_def_property_struct_type(prop, "MEdge");
+ RNA_def_property_ui_text(prop, "Edges", "Edges of the mesh");
+
+ prop= RNA_def_property(srna, "faces", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "mface", "totface");
+ RNA_def_property_struct_type(prop, "MFace");
+ RNA_def_property_ui_text(prop, "Faces", "Faces of the mesh");
+
+ prop= RNA_def_property(srna, "sticky", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "msticky", "totvert");
+ RNA_def_property_struct_type(prop, "MSticky");
+ RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates");
+
+ prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0);
+ RNA_def_property_struct_type(prop, "MTFaceLayer");
+ RNA_def_property_ui_text(prop, "UV Layers", "");
+
+ prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0);
+ RNA_def_property_struct_type(prop, "MColLayer");
+ RNA_def_property_ui_text(prop, "Vertex Color Layers", "");
+
+ prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0);
+ RNA_def_property_struct_type(prop, "MFloatPropertyLayer");
+ RNA_def_property_ui_text(prop, "Float Property Layers", "");
+
+ prop= RNA_def_property(srna, "int_layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0);
+ RNA_def_property_struct_type(prop, "MIntPropertyLayer");
+ RNA_def_property_ui_text(prop, "Int Property Layers", "");
+
+ prop= RNA_def_property(srna, "string_layers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0);
+ RNA_def_property_struct_type(prop, "MStringPropertyLayer");
+ RNA_def_property_ui_text(prop, "String Property Layers", "");
+
+ prop= RNA_def_property(srna, "autosmooth", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
+ RNA_def_property_ui_text(prop, "Auto Smooth", "Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render");
+
+ prop= RNA_def_property(srna, "autosmooth_angle", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "smoothresh");
+ RNA_def_property_range(prop, 1, 80);
+ RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
+
+ prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ME_NOPUNOFLIP);
+ RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render");
+
+ prop= RNA_def_property(srna, "double_sided", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED);
+ RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting");
+
+ prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
+ RNA_def_property_ui_text(prop, "Texture Space Mesh", "Derive texture coordinates from another mesh");
+
+ prop= RNA_def_property(srna, "multires", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "mr");
+ RNA_def_property_ui_text(prop, "Multires", "");
+
+ prop= RNA_def_property(srna, "key", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Shape Keys", "");
+
+ rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
+ rna_def_ipo_common(srna);
+}
+
+void RNA_def_mesh(BlenderRNA *brna)
+{
+ rna_def_mesh(brna);
+ rna_def_mvert(brna);
+ rna_def_mvert_group(brna);
+ rna_def_medge(brna);
+ rna_def_mface(brna);
+ rna_def_mtface(brna);
+ rna_def_msticky(brna);
+ rna_def_mcol(brna);
+ rna_def_mproperties(brna);
+ rna_def_mmultires(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
new file mode 100644
index 00000000000..9b88c80d0d4
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -0,0 +1,150 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_meta_types.h"
+
+#ifdef RNA_RUNTIME
+
+static int rna_Meta_texspace_editable(PointerRNA *ptr)
+{
+ MetaBall *mb= (MetaBall*)ptr->data;
+ return (mb->texflag & AUTOSPACE)? PROP_NOT_EDITABLE: 0;
+}
+
+#else
+
+void rna_def_metaelement(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] = {
+ {MB_BALL, "BALL", "Ball", ""},
+ {MB_TUBE, "TUBE", "Tube", ""},
+ {MB_PLANE, "PLANE", "Plane", ""},
+ {MB_ELIPSOID, "ELLIPSOID", "Ellipsoid", ""}, // NOTE: typo at original definition!
+ {MB_CUBE, "CUBE", "Cube", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MetaElement", NULL, "Meta Element");
+ RNA_def_struct_sdna(srna, "MetaElem");
+
+ /* enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Type", "Metaball types.");
+
+ /* number values */
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "x");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
+ RNA_def_property_float_sdna(prop, NULL, "quat");
+ RNA_def_property_ui_text(prop, "Rotation", "");
+
+ prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED);
+ RNA_def_property_float_sdna(prop, NULL, "rad");
+ RNA_def_property_ui_text(prop, "Radius", "");
+
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "expx");
+ RNA_def_property_range(prop, 0.0f, 20.0f);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Size", "Size of element, use of components depends on element type.");
+
+ prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "s");
+ RNA_def_property_range(prop, 0.0f, 10.0f);
+ RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the element to fill.");
+
+ /* flags */
+ prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE);
+ RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one.");
+
+ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE);
+ RNA_def_property_ui_text(prop, "Hide", "Hide element.");
+}
+
+void rna_def_metaball(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_update_items[] = {
+ {MB_UPDATE_ALWAYS, "UPDATE_ALWAYS", "Always", "While editing, update metaball always."},
+ {MB_UPDATE_HALFRES, "HALFRES", "Half Resolution", "While editing, update metaball in half resolution."},
+ {MB_UPDATE_FAST, "FAST", "Fast", "While editing, update metaball without polygonization."},
+ {MB_UPDATE_NEVER, "NEVER", "Never", "While editing, don't update metaball at all."},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MetaBall", "ID", "MetaBall");
+
+ prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "elems", NULL);
+ RNA_def_property_struct_type(prop, "MetaElement");
+ RNA_def_property_ui_text(prop, "Elements", "Meta elements.");
+
+ /* enums */
+ prop= RNA_def_property(srna, "flag", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_update_items);
+ RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior.");
+
+ /* number values */
+ prop= RNA_def_property(srna, "wire_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "wiresize");
+ RNA_def_property_range(prop, 0.050f, 1.0f);
+ RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport.");
+
+ prop= RNA_def_property(srna, "render_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "rendersize");
+ RNA_def_property_range(prop, 0.050f, 1.0f);
+ RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering.");
+
+ prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "thresh");
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_ui_text(prop, "Threshold", "Influence of meta elements.");
+
+ /* materials, textures */
+ rna_def_texmat_common(srna, "rna_Meta_texspace_editable");
+ rna_def_ipo_common(srna);
+}
+
+void RNA_def_meta(BlenderRNA *brna)
+{
+ rna_def_metaelement(brna);
+ rna_def_metaball(brna);
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
new file mode 100644
index 00000000000..c3a2274101f
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -0,0 +1,117 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_modifier_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_modifier(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem type_items[] ={
+ {eModifierType_Subsurf, "SUBSURF", "Subsurf", ""},
+ {eModifierType_Lattice, "LATTICE", "Lattice", ""},
+ {eModifierType_Curve, "CURVE", "Curve", ""},
+ {eModifierType_Build, "BUILD", "Build", ""},
+ {eModifierType_Mirror, "MIRROR", "Mirror", ""},
+ {eModifierType_Decimate, "DECIMATE", "Decimate", ""},
+ {eModifierType_Wave, "WAVE", "Wave", ""},
+ {eModifierType_Armature, "ARMATURE", "Armature", ""},
+ {eModifierType_Hook, "HOOK", "Hook", ""},
+ {eModifierType_Softbody, "SOFTBODY", "Softbody", ""},
+ {eModifierType_Boolean, "BOOLEAN", "Boolean", ""},
+ {eModifierType_Array, "ARRAY", "Array", ""},
+ {eModifierType_EdgeSplit, "EDGESPLIT", "EdgeSplit", ""},
+ {eModifierType_Displace, "DISPLACE", "Displace", ""},
+ {eModifierType_UVProject, "UVPROJECT", "UVProject", ""},
+ {eModifierType_Smooth, "SMOOTH", "Smooth", ""},
+ {eModifierType_Cast, "CAST", "Cast", ""},
+ {eModifierType_MeshDeform, "MESHDEFORM", "MeshDeform", ""},
+ {eModifierType_ParticleSystem, "PARTICLESYSTEM", "Particle System", ""},
+ {eModifierType_ParticleInstance, "PARTICLEINSTANCE", "Particle Instance", ""},
+ {eModifierType_Explode, "EXPLODE", "Explode", ""},
+ {eModifierType_Cloth, "CLOTH", "Cloth", ""},
+ {eModifierType_Collision, "COLLISION", "Collision", ""},
+ {eModifierType_Bevel, "BEVEL", "Bevel", ""},
+ {eModifierType_Shrinkwrap, "SHRINKWRAP", "Shrinkwrap", ""},
+ {eModifierType_Fluidsim, "FLUIDSIM", "Fluidsim", ""},
+ {eModifierType_Mask, "MASK", "Mask", ""},
+ {eModifierType_SimpleDeform, "SIMPLEDEFORM", "SimpleDeform", ""},
+ {0, NULL, NULL, NULL}};
+
+ /* data */
+ srna= RNA_def_struct(brna, "Modifier", NULL , "Object Modifier");
+ RNA_def_struct_sdna(srna, "ModifierData");
+
+ /* strings */
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* enums */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+ /* flags */
+ prop= RNA_def_property(srna, "realtime", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
+ RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier.");
+
+ prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
+ RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering.");
+
+ prop= RNA_def_property(srna, "editmode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
+ RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode.");
+
+ prop= RNA_def_property(srna, "on_cage", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage);
+ RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage.");
+
+ prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
+ RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface.");
+
+ /* TODO: expose "virtual" and "disable temporary" enum items? */
+
+ /* pointers */
+ /* TODO: expose error? */
+}
+
+#endif
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
new file mode 100644
index 00000000000..a4b13b7639b
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -0,0 +1,63 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Nathan Letwory
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_node_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_nodetree(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "NodeTree", "ID", "Node Tree");
+ RNA_def_struct_sdna(srna, "bNodeTree");
+
+ prop= RNA_def_property(srna, "Nodes", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "nodes", NULL);
+ RNA_def_property_struct_type(prop, "Node");
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Nodes", "");
+
+ srna= RNA_def_struct(brna, "Node", NULL, "Node");
+ RNA_def_struct_sdna(srna, "bNode");
+
+ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_float_sdna(prop, NULL, "locx");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_range(prop, -1000.0f, 1000.0f);
+ RNA_def_property_ui_text(prop, "Location", "");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
new file mode 100644
index 00000000000..430ae57d87a
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -0,0 +1,95 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_object_types.h"
+#include "DNA_property_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_object(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Object", "ID", "Object");
+
+ prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_ui_text(prop, "Data", "Object data.");
+
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Parent", "Parent Object");
+
+ prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
+
+ prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Location", "");
+
+ //prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_ROTATION);
+ //RNA_def_property_ui_text(prop, "Rotation", "");
+ prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Rotation", "");
+
+ prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Scale", "");
+
+ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Constraint");
+ RNA_def_property_ui_text(prop, "Constraints", "");
+
+ prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Modifier");
+ RNA_def_property_ui_text(prop, "Modifiers", "");
+
+ prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Sensor");
+ RNA_def_property_ui_text(prop, "Sensors", "");
+
+ prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Controller");
+ RNA_def_property_ui_text(prop, "Controllers", "");
+
+ prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Actuator");
+ RNA_def_property_ui_text(prop, "Actuators", "");
+
+ prop= RNA_def_property(srna, "game_properties", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);
+ RNA_def_property_struct_type(prop, "GameProperty");
+ RNA_def_property_ui_text(prop, "Game Properties", "Game engine properties.");
+}
+
+#endif
+
diff --git a/source/blender/include/BIF_editoops.h b/source/blender/makesrna/intern/rna_packedfile.c
index 5012a07320a..0bbdd5bfd8c 100644
--- a/source/blender/include/BIF_editoops.h
+++ b/source/blender/makesrna/intern/rna_packedfile.c
@@ -17,28 +17,35 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation (2008).
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BIF_EDITOOPS_H
-#define BIF_EDITOOPS_H
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_packedFile_types.h"
+
+#ifdef RNA_RUNTIME
+#else
+
+void RNA_def_packedfile(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "PackedFile", NULL, "Packed File");
+
+ prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Size", "Size of Packed File.");
-void borderselect_oops(void);
-void deselect_all_area_oops(void);
-void mouse_select_oops(void);
-void select_backlinked_oops(void);
-void select_linked_oops(void);
-void set_select_flag_oops(void);
-void swap_select_all_oops(void);
-void transform_oops(int mode, int context);
+}
-void clever_numbuts_oops(void);
#endif
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c
new file mode 100644
index 00000000000..626bf0bf43d
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_property.c
@@ -0,0 +1,153 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_property_types.h"
+
+#ifdef RNA_RUNTIME
+
+static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
+{
+ bProperty *property= (bProperty*)ptr->data;
+
+ switch(property->type){
+ case PROP_BOOL:
+ return &RNA_GameBooleanProperty;
+ case PROP_INT:
+ return &RNA_GameIntProperty;
+ case PROP_FLOAT:
+ return &RNA_GameFloatProperty;
+ case PROP_STRING:
+ return &RNA_GameStringProperty;
+ case PROP_TIME:
+ return &RNA_GameTimeProperty;
+ default:
+ return &RNA_GameProperty;
+ }
+}
+
+/* for both float and timer */
+static float rna_GameFloatProperty_value_get(PointerRNA *ptr)
+{
+ bProperty *prop= (bProperty*)(ptr->data);
+ return *(float*)(&prop->data);
+}
+
+static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value)
+{
+ bProperty *prop= (bProperty*)(ptr->data);
+ CLAMP(value, -10000.0f, 10000.0f);
+ *(float*)(&prop->data)= value;
+}
+
+#else
+
+void RNA_def_gameproperty(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem gameproperty_type_items[] ={
+ {PROP_BOOL, "BOOL", "Boolean", ""},
+ {PROP_INT, "INT", "Integer", ""},
+ {PROP_FLOAT, "FLOAT", "Float", ""},
+ {PROP_STRING, "STRING", "String", ""},
+ {PROP_TIME, "TIME", "Time", ""},
+ {0, NULL, NULL, NULL}};
+
+ /* Base Struct for GameProperty */
+ srna= RNA_def_struct(brna, "GameProperty", NULL , "Game Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+ RNA_def_struct_funcs(srna, NULL, "rna_GameProperty_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* must be unique */
+ RNA_def_property_ui_text(prop, "Name", "Available as as GameObject attributes in the game engines python api");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, gameproperty_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+ prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG);
+ RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property.");
+
+ /* GameBooleanProperty */
+ srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty" , "Game Boolean Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+
+ prop= RNA_def_property(srna, "boolean_value", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "data", 1);
+ RNA_def_property_ui_text(prop, "Value", "Property value.");
+
+ /* GameIntProperty */
+ srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty" , "Game Integer Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+
+ prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "data");
+ RNA_def_property_ui_text(prop, "Value", "Property value.");
+ RNA_def_property_range(prop, -10000, 10000);
+
+ /* GameFloatProperty */
+ srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty" , "Game Float Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "data");
+ RNA_def_property_ui_text(prop, "Value", "Property value.");
+ RNA_def_property_range(prop, -10000, 10000);
+ RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
+
+ /* GameTimerProperty */
+ srna= RNA_def_struct(brna, "GameTimeProperty", "GameProperty" , "Game Time Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+
+ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "data");
+ RNA_def_property_ui_text(prop, "Value", "Property value.");
+ RNA_def_property_range(prop, -10000, 10000);
+ RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
+
+ /* GameStringProperty */
+ srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty" , "Game String Property");
+ RNA_def_struct_sdna(srna, "bProperty");
+
+ prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "poin");
+ RNA_def_property_string_maxlength(prop, MAX_PROPSTRING);
+ RNA_def_property_ui_text(prop, "Value", "Property value.");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_radio.c b/source/blender/makesrna/intern/rna_radio.c
new file mode 100644
index 00000000000..31398b5fa4e
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_radio.c
@@ -0,0 +1,139 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_radio_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_radio(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_drawtype_items[] = {
+ {RAD_WIREFRAME, "WIREFRAME", "Wireframe", "Enables Wireframe draw mode"},
+ {RAD_SOLID, "SOLID", "Solid", "Enables Solid draw mode"},
+ {RAD_GOURAUD, "GOURAUD", "Gouraud", "Enables Gouraud draw mode"},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Radiosity", NULL, "Radiosity");
+ RNA_def_struct_sdna(srna, "Radio");
+
+ /* Enums */
+ prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "drawtype");
+ RNA_def_property_enum_items(prop, prop_drawtype_items);
+ RNA_def_property_ui_text(prop, "Draw Mode", "Radiosity draw modes.");
+
+ /* Number values */
+ prop= RNA_def_property(srna, "hemi_resolution", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "hemires");
+ RNA_def_property_range(prop, 100, 1000);
+ RNA_def_property_ui_text(prop, "Hemi Resolution", "Sets the size of a hemicube.");
+
+ prop= RNA_def_property(srna, "max_iterations", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "maxiter");
+ RNA_def_property_range(prop, 0, 10000);
+ RNA_def_property_ui_text(prop, "Max Iterations", "Limits the maximum number of radiosity rounds.");
+
+ prop= RNA_def_property(srna, "multiplier", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "radfac");
+ RNA_def_property_range(prop, 0.001f, 250.0f);
+ RNA_def_property_ui_text(prop, "Multiplier", "Multiplies the energy values.");
+
+ prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "gamma");
+ RNA_def_property_range(prop, 0.2f, 10.0f);
+ RNA_def_property_ui_text(prop, "Gamma", "Changes the contrast of the energy values.");
+
+ prop= RNA_def_property(srna, "convergence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "convergence");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Convergence", "Sets the lower threshold of unshot energy.");
+
+ prop= RNA_def_property(srna, "element_max", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "elma");
+ RNA_def_property_range(prop, 1, 500);
+ RNA_def_property_ui_text(prop, "Element Max", "Sets maximum size of an element");
+
+ prop= RNA_def_property(srna, "element_min", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "elmi");
+ RNA_def_property_range(prop, 1, 100);
+ RNA_def_property_ui_text(prop, "Element Min", "Sets minimum size of an element");
+
+ prop= RNA_def_property(srna, "patch_max", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pama");
+ RNA_def_property_range(prop, 10, 1000);
+ RNA_def_property_ui_text(prop, "Patch Max", "Sets maximum size of a patch.");
+
+ prop= RNA_def_property(srna, "patch_min", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pami");
+ RNA_def_property_range(prop, 10, 1000);
+ RNA_def_property_ui_text(prop, "Patch Min", "Sets minimum size of a patch.");
+
+ prop= RNA_def_property(srna, "subshoot_patch", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "subshootp");
+ RNA_def_property_range(prop, 0, 10);
+ RNA_def_property_ui_text(prop, "SubShoot Patch", "Sets the number of times the environment is tested to detect pathes.");
+
+ prop= RNA_def_property(srna, "subshoot_element", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "subshoote");
+ RNA_def_property_range(prop, 0, 10);
+ RNA_def_property_ui_text(prop, "SubShoot Element", "Sets the number of times the environment is tested to detect elements.");
+
+ prop= RNA_def_property(srna, "max_elements", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "maxnode");
+ RNA_def_property_range(prop, 1, 250000);
+ RNA_def_property_ui_text(prop, "Max Elements", "Sets the maximum allowed number of elements.");
+
+ prop= RNA_def_property(srna, "max_subdiv_shoot", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "maxsublamp");
+ RNA_def_property_range(prop, 1, 250);
+ RNA_def_property_ui_text(prop, "Max Subdiv Shoot", "Sets the maximum number of initial shoot patches that are evaluated");
+
+ prop= RNA_def_property(srna, "remove_doubles_limit", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "nodelim");
+ RNA_def_property_range(prop, 0, 50);
+ RNA_def_property_ui_text(prop, "Remove Doubles Limit", "Sets the range for removing doubles");
+
+ /* flag */
+ prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWLIMITS);
+ RNA_def_property_ui_text(prop, "Show Limits", "Draws patch and element limits");
+
+ prop= RNA_def_property(srna, "show_z", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWZ);
+ RNA_def_property_ui_text(prop, "Show Z", "Draws limits differently");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
new file mode 100644
index 00000000000..064f22d1508
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -0,0 +1,602 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#ifdef RNA_RUNTIME
+
+/* Struct */
+
+static void rna_Struct_identifier_get(PointerRNA *ptr, char *value)
+{
+ strcpy(value, ((StructRNA*)ptr->data)->identifier);
+}
+
+static int rna_Struct_identifier_length(PointerRNA *ptr)
+{
+ return strlen(((StructRNA*)ptr->data)->identifier);
+}
+
+static void rna_Struct_name_get(PointerRNA *ptr, char *value)
+{
+ strcpy(value, ((StructRNA*)ptr->data)->name);
+}
+
+static int rna_Struct_name_length(PointerRNA *ptr)
+{
+ return strlen(((StructRNA*)ptr->data)->name);
+}
+
+static void *rna_Struct_name_property_get(PointerRNA *ptr)
+{
+ return ((StructRNA*)ptr->data)->nameproperty;
+}
+
+static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
+{
+ IDProperty *idprop= (IDProperty*)data;
+ PropertyRNA *prop;
+
+ for(prop= iter->parent.type->properties.first; prop; prop=prop->next)
+ if(strcmp(prop->identifier, idprop->name) == 0)
+ return 1;
+
+ return 0;
+}
+
+static int rna_property_builtin(CollectionPropertyIterator *iter, void *data)
+{
+ PropertyRNA *prop= (PropertyRNA*)data;
+ return (prop->flag & PROP_BUILTIN);
+}
+
+static void rna_Struct_properties_next(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+ IDProperty *group;
+
+ if(internal->flag) {
+ /* id properties */
+ rna_iterator_listbase_next(iter);
+ }
+ else {
+ /* regular properties */
+ rna_iterator_listbase_next(iter);
+
+ /* try id properties */
+ if(!iter->valid) {
+ group= rna_idproperties_get(iter->parent.type, iter->parent.data, 0);
+
+ if(group) {
+ rna_iterator_listbase_end(iter);
+ rna_iterator_listbase_begin(iter, &group->data.group, rna_idproperty_known);
+ internal= iter->internal;
+ internal->flag= 1;
+ }
+ }
+ }
+}
+
+static void rna_Struct_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ rna_iterator_listbase_begin(iter, &((StructRNA*)ptr->data)->properties, rna_property_builtin);
+}
+
+static void *rna_Struct_properties_get(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+
+ /* we return either PropertyRNA* or IDProperty*, the rna_access.c
+ * functions can handle both as PropertyRNA* with some tricks */
+ return internal->link;
+}
+
+void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ PointerRNA newptr;
+
+ /* we create a new with the type as the data */
+ newptr.type= &RNA_Struct;
+ newptr.data= ptr->type;
+
+ if(ptr->type->flag & STRUCT_ID) {
+ newptr.id.type= ptr->type;
+ newptr.id.data= ptr->data;
+ }
+ else {
+ newptr.id.type= NULL;
+ newptr.id.data= NULL;
+ }
+
+ rna_Struct_properties_begin(iter, &newptr);
+}
+
+void rna_builtin_properties_next(CollectionPropertyIterator *iter)
+{
+ rna_Struct_properties_next(iter);
+}
+
+void *rna_builtin_properties_get(CollectionPropertyIterator *iter)
+{
+ return rna_Struct_properties_get(iter);
+}
+
+void *rna_builtin_type_get(PointerRNA *ptr)
+{
+ return ptr->type;
+}
+
+/* Property */
+
+static StructRNA *rna_Property_refine(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+
+ rna_idproperty_check(&prop, ptr); /* XXX ptr? */
+
+ switch(prop->type) {
+ case PROP_BOOLEAN: return &RNA_BooleanProperty;
+ case PROP_INT: return &RNA_IntProperty;
+ case PROP_FLOAT: return &RNA_FloatProperty;
+ case PROP_STRING: return &RNA_StringProperty;
+ case PROP_ENUM: return &RNA_EnumProperty;
+ case PROP_POINTER: return &RNA_PointerProperty;
+ case PROP_COLLECTION: return &RNA_CollectionProperty;
+ default: return &RNA_Property;
+ }
+}
+
+static void rna_Property_identifier_get(PointerRNA *ptr, char *value)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ strcpy(value, ((PropertyRNA*)prop)->identifier);
+}
+
+static int rna_Property_identifier_length(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return strlen(prop->identifier);
+}
+
+static void rna_Property_name_get(PointerRNA *ptr, char *value)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ strcpy(value, prop->name);
+}
+
+static int rna_Property_name_length(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return strlen(prop->name);
+}
+
+static void rna_Property_description_get(PointerRNA *ptr, char *value)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ strcpy(value, prop->description);
+}
+
+static int rna_Property_description_length(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return strlen(prop->description);
+}
+
+static int rna_Property_type_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return prop->type;
+}
+
+static int rna_Property_subtype_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return prop->subtype;
+}
+
+static int rna_Property_array_length_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return prop->arraylength;
+}
+
+static int rna_IntProperty_hard_min_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((IntPropertyRNA*)prop)->hardmin;
+}
+
+static int rna_IntProperty_hard_max_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((IntPropertyRNA*)prop)->hardmax;
+}
+
+static int rna_IntProperty_soft_min_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((IntPropertyRNA*)prop)->softmin;
+}
+
+static int rna_IntProperty_soft_max_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((IntPropertyRNA*)prop)->softmax;
+}
+
+static int rna_IntProperty_step_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((IntPropertyRNA*)prop)->step;
+}
+
+static float rna_FloatProperty_hard_min_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->hardmin;
+}
+
+static float rna_FloatProperty_hard_max_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->hardmax;
+}
+
+static float rna_FloatProperty_soft_min_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->softmin;
+}
+
+static float rna_FloatProperty_soft_max_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->softmax;
+}
+
+static float rna_FloatProperty_step_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->step;
+}
+
+static int rna_FloatProperty_precision_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((FloatPropertyRNA*)prop)->precision;
+}
+
+static int rna_StringProperty_max_length_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((StringPropertyRNA*)prop)->maxlength;
+}
+
+static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ EnumPropertyRNA *eprop;
+
+ rna_idproperty_check(&prop, ptr);
+ eprop= (EnumPropertyRNA*)prop;
+
+ rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, NULL);
+}
+
+static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value)
+{
+ strcpy(value, ((EnumPropertyItem*)ptr->data)->identifier);
+}
+
+static int rna_EnumPropertyItem_identifier_length(PointerRNA *ptr)
+{
+ return strlen(((EnumPropertyItem*)ptr->data)->identifier);
+}
+
+static void rna_EnumPropertyItem_name_get(PointerRNA *ptr, char *value)
+{
+ strcpy(value, ((EnumPropertyItem*)ptr->data)->name);
+}
+
+static int rna_EnumPropertyItem_name_length(PointerRNA *ptr)
+{
+ return strlen(((EnumPropertyItem*)ptr->data)->name);
+}
+
+static int rna_EnumPropertyItem_value_get(PointerRNA *ptr)
+{
+ return ((EnumPropertyItem*)ptr->data)->value;
+}
+
+static void *rna_PointerProperty_fixed_type_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((PointerPropertyRNA*)prop)->structtype;
+}
+
+static void *rna_CollectionProperty_fixed_type_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+ rna_idproperty_check(&prop, ptr);
+ return ((CollectionPropertyRNA*)prop)->structtype;
+}
+
+#else
+
+static void rna_def_struct(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Struct", NULL, "Struct Definition");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Struct_name_get", "rna_Struct_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Human readable name.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Struct_identifier_get", "rna_Struct_identifier_length", NULL);
+ RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting.");
+
+ prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "StringProperty");
+ RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Name Property", "Property that gives the name of the struct.");
+
+ prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "Property");
+ RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Properties", "Properties in the struct.");
+}
+
+static void rna_def_property(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem type_items[] = {
+ {PROP_BOOLEAN, "BOOLEAN", "Boolean", ""},
+ {PROP_INT, "INT", "Integer", ""},
+ {PROP_FLOAT, "FLOAT", "Float", ""},
+ {PROP_STRING, "STRING", "String", ""},
+ {PROP_ENUM, "ENUM", "Enumeration", ""},
+ {PROP_POINTER, "POINTER", "Pointer", ""},
+ {PROP_COLLECTION, "COLLECTION", "Collection", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem subtype_items[] = {
+ {PROP_NONE, "NONE", "None", ""},
+ {PROP_UNSIGNED, "UNSIGNED", "Unsigned Number", ""},
+ {PROP_FILEPATH, "FILEPATH", "File Path", ""},
+ {PROP_COLOR, "COLOR", "Color", ""},
+ {PROP_VECTOR, "VECTOR", "Vector", ""},
+ {PROP_MATRIX, "MATRIX", "Matrix", ""},
+ {PROP_ROTATION, "ROTATION", "Rotation", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Property", NULL, "Property Definition");
+ RNA_def_struct_funcs(srna, NULL, "rna_Property_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Property_name_get", "rna_Property_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Human readable name.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Property_identifier_get", "rna_Property_identifier_length", NULL);
+ RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting.");
+
+ prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_Property_description_get", "rna_Property_description_length", NULL);
+ RNA_def_property_ui_text(prop, "Description", "Description of the property for tooltips.");
+
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, type_items);
+ RNA_def_property_enum_funcs(prop, "rna_Property_type_get", NULL);
+ RNA_def_property_ui_text(prop, "Type", "Data type of the property.");
+
+ prop= RNA_def_property(srna, "subtype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, subtype_items);
+ RNA_def_property_enum_funcs(prop, "rna_Property_subtype_get", NULL);
+ RNA_def_property_ui_text(prop, "Subtype", "Semantic interpretation of the property.");
+}
+
+static void rna_def_number_property(StructRNA *srna, PropertyType type)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "array_length", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_Property_array_length_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Array Length", "Maximum length of the array, 0 means unlimited.");
+
+ if(type == PROP_BOOLEAN)
+ return;
+
+ prop= RNA_def_property(srna, "hard_min", type, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_min_get", NULL, NULL);
+ else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_min_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Hard Minimum", "Minimum value used by buttons.");
+
+ prop= RNA_def_property(srna, "hard_max", type, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_hard_max_get", NULL, NULL);
+ else RNA_def_property_float_funcs(prop, "rna_FloatProperty_hard_max_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Hard Maximum", "Maximum value used by buttons.");
+
+ prop= RNA_def_property(srna, "soft_min", type, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_min_get", NULL, NULL);
+ else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_min_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Soft Minimum", "Minimum value used by buttons.");
+
+ prop= RNA_def_property(srna, "soft_max", type, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_soft_max_get", NULL, NULL);
+ else RNA_def_property_float_funcs(prop, "rna_FloatProperty_soft_max_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Soft Maximum", "Maximum value used by buttons.");
+
+ prop= RNA_def_property(srna, "step", type, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ if(type == PROP_INT) RNA_def_property_int_funcs(prop, "rna_IntProperty_step_get", NULL, NULL);
+ else RNA_def_property_float_funcs(prop, "rna_FloatProperty_step_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Step", "Step size used by number buttons, for floats 1/100th of the step size.");
+
+ if(type == PROP_FLOAT) {
+ prop= RNA_def_property(srna, "precision", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_FloatProperty_precision_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Precision", "Number of digits after the dot used by buttons.");
+ }
+}
+
+static void rna_def_string_property(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "max_length", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_StringProperty_max_length_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Maximum Length", "Maximum length of the string, 0 means unlimited.");
+}
+
+static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "items", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "EnumPropertyItem");
+ RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Items", "Possible values for the property.");
+
+ srna= RNA_def_struct(brna, "EnumPropertyItem", NULL, "Enum Item Definition");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL);
+ RNA_def_property_ui_text(prop, "Name", "Human readable name.");
+ RNA_def_struct_name_property(srna, prop);
+
+ prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL);
+ RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting.");
+
+ prop= RNA_def_property(srna, "value", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_EnumPropertyItem_value_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Value", "Value of the item.");
+}
+
+static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
+{
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "fixed_type", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "Struct");
+ if(type == PROP_POINTER)
+ RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL);
+ else
+ RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Pointer Type", "Fixed pointer type, empty if variable type.");
+}
+
+void RNA_def_rna(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ /* Struct*/
+ rna_def_struct(brna);
+
+ /* Property */
+ rna_def_property(brna);
+
+ /* BooleanProperty */
+ srna= RNA_def_struct(brna, "BooleanProperty", "Property", "Boolean Definition");
+ rna_def_number_property(srna, PROP_BOOLEAN);
+
+ /* IntProperty */
+ srna= RNA_def_struct(brna, "IntProperty", "Property", "Int Definition");
+ rna_def_number_property(srna, PROP_INT);
+
+ /* FloatProperty */
+ srna= RNA_def_struct(brna, "FloatProperty", "Property", "Float Definition");
+ rna_def_number_property(srna, PROP_FLOAT);
+
+ /* StringProperty */
+ srna= RNA_def_struct(brna, "StringProperty", "Property", "String Definition");
+ rna_def_string_property(srna);
+
+ /* EnumProperty */
+ srna= RNA_def_struct(brna, "EnumProperty", "Property", "Enum Definition");
+ rna_def_enum_property(brna, srna);
+
+ /* PointerProperty */
+ srna= RNA_def_struct(brna, "PointerProperty", "Property", "Pointer Definition");
+ rna_def_pointer_property(srna, PROP_POINTER);
+
+ /* CollectionProperty */
+ srna= RNA_def_struct(brna, "CollectionProperty", "Property", "Collection Definition");
+ rna_def_pointer_property(srna, PROP_COLLECTION);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
new file mode 100644
index 00000000000..6b300772144
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -0,0 +1,153 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+#include "BKE_global.h"
+
+void *rna_Scene_objects_get(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+
+ /* we are actually iterating a Base list, so override get */
+ return ((Base*)internal->link)->object;
+}
+
+static void rna_Scene_layer_set(PointerRNA *ptr, int index, int value)
+{
+ Scene *scene= (Scene*)ptr->data;
+
+ if(value) scene->lay |= (1<<index);
+ else {
+ scene->lay &= ~(1<<index);
+ if(scene->lay == 0)
+ scene->lay |= (1<<index);
+ }
+}
+
+static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
+{
+ Scene *data= (Scene*)ptr->data;
+ CLAMP(value, 1, data->r.efra);
+ data->r.sfra= value;
+}
+
+static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
+{
+ Scene *data= (Scene*)ptr->data;
+ CLAMP(value, data->r.sfra, MAXFRAME);
+ data->r.efra= value;
+}
+
+#else
+
+void RNA_def_scene(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_mode_items[] ={
+ {PROP_SMOOTH, "SMOOTH", "Smooth", ""},
+ {PROP_SPHERE, "SPHERE", "Sphere", ""},
+ {PROP_ROOT, "ROOT", "Root", ""},
+ {PROP_SHARP, "SHARP", "Sharp", ""},
+ {PROP_LIN, "LINEAR", "Linear", ""},
+ {PROP_CONST, "CONSTANT", "Constant", ""},
+ {PROP_RANDOM, "RANDOM", "Random", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem unwrapper_items[] = {
+ {0, "CONFORMAL", "Conformal", ""},
+ {1, "ANGLEBASED", "Angle Based", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Scene", "ID", "Scene");
+
+ prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Active Camera", "Active camera used for rendering the scene.");
+
+ prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_VECTOR);
+ RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location.");
+ RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
+
+ prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_ui_text(prop, "Objects", "");
+ RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0);
+
+ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
+ RNA_def_property_array(prop, 20);
+ RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene.");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
+
+ prop= RNA_def_property(srna, "prop_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_mode_items);
+ RNA_def_property_ui_text(prop, "Proportional Mode", "Proportional editing mode.");
+
+ prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+ RNA_def_property_int_sdna(prop, NULL, "r.cfra");
+ RNA_def_property_range(prop, MINFRAME, MAXFRAME);
+ RNA_def_property_ui_text(prop, "Current Frame", "");
+
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+ RNA_def_property_int_sdna(prop, NULL, "r.sfra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "Start Frame", "");
+
+ prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+ RNA_def_property_int_sdna(prop, NULL, "r.efra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "End Frame", "");
+
+ prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
+ RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping.");
+
+ prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper");
+ RNA_def_property_enum_items(prop, unwrapper_items);
+ RNA_def_property_ui_text(prop, "Unwrapper", "Unwrap algorithm used by the Unwrap tool.");
+
+ prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree.");
+
+ prop= RNA_def_property(srna, "radiosity", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "radio");
+ RNA_def_property_ui_text(prop, "Radiosity", "");
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
new file mode 100644
index 00000000000..ea62458654a
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -0,0 +1,203 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008), Nathan Letwory
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_screen_types.h"
+#include "DNA_scene_types.h"
+
+#ifdef RNA_RUNTIME
+
+
+static void *rna_Screen_scene_get(PointerRNA *ptr)
+{
+ bScreen *sc= (bScreen*)ptr->data;
+ return sc->scene;
+}
+
+static void rna_Screen_verts_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ bScreen *scr= (bScreen*)ptr->data;
+ rna_iterator_listbase_begin(iter, &scr->vertbase, NULL);
+}
+
+static void rna_Screen_edges_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ bScreen *scr= (bScreen*)ptr->data;
+ rna_iterator_listbase_begin(iter, &scr->edgebase, NULL);
+}
+
+static void rna_Screen_areas_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ bScreen *scr= (bScreen*)ptr->data;
+ rna_iterator_listbase_begin(iter, &scr->areabase, NULL);
+}
+
+#else
+
+static void RNA_def_vectypes(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna= RNA_def_struct(brna, "vec2s", NULL, "vec2s");
+ RNA_def_struct_sdna(srna, "vec2s");
+}
+
+static void RNA_def_scrvert(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ScrVert", NULL, "Screen Vertex");
+ RNA_def_struct_sdna(srna, "ScrVert");
+
+ prop= RNA_def_property(srna, "Location", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Location", "Screen Vert Location");
+}
+
+static void RNA_def_scredge(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ScrEdge", NULL, "Screen Edge");
+ RNA_def_struct_sdna(srna, "ScrEdge");
+
+ prop= RNA_def_property(srna, "start", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v1->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Edge Start", "Screen Edge Start");
+
+ prop= RNA_def_property(srna, "end", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v2->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Edge End", "Screen Edge End");
+}
+
+static void RNA_def_scrarea(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ScrArea", NULL, "Area");
+ RNA_def_struct_sdna(srna, "ScrArea");
+
+ prop= RNA_def_property(srna, "v1", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v1->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Area v1", "Screen Area v1");
+
+ prop= RNA_def_property(srna, "v2", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v2->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Area v2", "Screen Area v2");
+
+ prop= RNA_def_property(srna, "v3", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v3->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Area v3", "Screen Area v3");
+
+ prop= RNA_def_property(srna, "v4", PROP_INT, PROP_VECTOR);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_int_sdna(prop, NULL, "v4->vec.x");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Area v4", "Screen Area v4");
+}
+
+static void RNA_def_panel(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna= RNA_def_struct(brna, "Panel", NULL, "Panel");
+ RNA_def_struct_sdna(srna, "Panel");
+}
+
+static void RNA_def_region(BlenderRNA *brna)
+{
+ StructRNA *srna;
+
+ srna= RNA_def_struct(brna, "Region", NULL, "Area Region");
+ RNA_def_struct_sdna(srna, "ARegion");
+}
+
+static void RNA_def_bscreen(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Screen", "ID", "Screen");
+ RNA_def_struct_sdna(srna, "bScreen");
+
+ prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "Scene");
+ RNA_def_property_pointer_funcs(prop, "rna_Screen_scene_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Scene", "Active scene.");
+
+ prop= RNA_def_property(srna, "vertbase", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "ScrVert");
+ RNA_def_property_collection_funcs(prop, "rna_Screen_verts_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Verts", "All Screen Verts");
+
+ prop= RNA_def_property(srna, "edgebase", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "ScrEdge");
+ RNA_def_property_collection_funcs(prop, "rna_Screen_edges_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Edges", "All Screen Edges");
+
+ prop= RNA_def_property(srna, "areabase", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_struct_type(prop, "ScrArea");
+ RNA_def_property_collection_funcs(prop, "rna_Screen_areas_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Areas", "All Screen Areas");
+}
+
+void RNA_def_screen(BlenderRNA *brna)
+{
+ RNA_def_bscreen(brna);
+ RNA_def_vectypes(brna);
+ RNA_def_scrvert(brna);
+ RNA_def_scredge(brna);
+ RNA_def_scrarea(brna);
+ RNA_def_panel(brna);
+ RNA_def_region(brna);
+}
+
+#endif
+
+
diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c
new file mode 100644
index 00000000000..30e32338db7
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -0,0 +1,528 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_sensor_types.h"
+
+#ifdef RNA_RUNTIME
+
+static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
+{
+ bSensor *sensor= (bSensor*)ptr->data;
+
+ switch(sensor->type) {
+ case SENS_ALWAYS:
+ return &RNA_AlwaysSensor;
+ case SENS_TOUCH:
+ return &RNA_TouchSensor;
+ case SENS_NEAR:
+ return &RNA_NearSensor;
+ case SENS_KEYBOARD:
+ return &RNA_KeyboardSensor;
+ case SENS_PROPERTY:
+ return &RNA_PropertySensor;
+ case SENS_MOUSE:
+ return &RNA_MouseSensor;
+ case SENS_COLLISION:
+ return &RNA_CollisionSensor;
+ case SENS_RADAR:
+ return &RNA_RadarSensor;
+ case SENS_RANDOM:
+ return &RNA_RandomSensor;
+ case SENS_RAY:
+ return &RNA_RaySensor;
+ case SENS_MESSAGE:
+ return &RNA_MessageSensor;
+ case SENS_JOYSTICK:
+ return &RNA_JoystickSensor;
+ case SENS_ACTUATOR:
+ return &RNA_ActuatorSensor;
+ case SENS_DELAY:
+ return &RNA_DelaySensor;
+ default:
+ return &RNA_Sensor;
+ }
+}
+
+#else
+
+void rna_def_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem sensor_type_items[] ={
+ {SENS_ALWAYS, "ALWAYS", "Always", ""},
+ {SENS_TOUCH, "TOUCH", "Touch", ""},
+ {SENS_NEAR, "NEAR", "Near", ""},
+ {SENS_KEYBOARD, "KEYBOARD", "Keyboard", ""},
+ {SENS_PROPERTY, "PROPERTY", "Property", ""},
+ {SENS_MOUSE, "MOUSE", "Mouse", ""},
+ {SENS_COLLISION, "COLLISION", "Collision", ""},
+ {SENS_RADAR, "RADAR", "Radar", ""},
+ {SENS_RANDOM, "RANDOM", "Random", ""},
+ {SENS_RAY, "RAY", "Ray", ""},
+ {SENS_MESSAGE, "MESSAGE", "Message", ""},
+ {SENS_JOYSTICK, "JOYSTICK", "joystick", ""},
+ {SENS_ACTUATOR, "ACTUATOR", "Actuator", ""},
+ {SENS_DELAY, "DELAY", "Delay", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "Sensor", NULL, "Sensor");
+ RNA_def_struct_sdna(srna, "bSensor");
+ RNA_def_struct_funcs(srna, NULL, "rna_Sensor_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "Sensor name.");
+ RNA_def_struct_name_property(srna, prop);
+
+ /* type is not editable, would need to do proper data free/alloc */
+ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_enum_items(prop, sensor_type_items);
+ RNA_def_property_ui_text(prop, "Type", "");
+
+ prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor.");
+
+ prop= RNA_def_property(srna, "level", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition).");
+
+ prop= RNA_def_property(srna, "pulse_true_level", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT);
+ RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode).");
+
+ prop= RNA_def_property(srna, "pulse_false_level", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE);
+ RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode).");
+
+ prop= RNA_def_property(srna, "freq", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay).");
+ RNA_def_property_range(prop, 0, 10000);
+}
+
+void rna_def_always_sensor(BlenderRNA *brna)
+{
+ RNA_def_struct(brna, "AlwaysSensor", "Sensor", "Always Sensor");
+}
+
+void rna_def_near_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "NearSensor", "Sensor" , "Near Sensor");
+ RNA_def_struct_sdna_from(srna, "bNearSensor", "data");
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property.");
+
+ prop= RNA_def_property(srna, "distance", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "dist");
+ RNA_def_property_ui_text(prop, "Distance", "Trigger distance.");
+ RNA_def_property_range(prop, 0, 10000);
+
+ prop= RNA_def_property(srna, "reset_distance", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resetdist");
+ RNA_def_property_ui_text(prop, "Reset Distance", "");
+ RNA_def_property_range(prop, 0, 10000);
+}
+
+void rna_def_mouse_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem mouse_event_items[] ={
+ {BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", "Left Button", ""},
+ {BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", "Middle Button", ""},
+ {BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", "Right Button", ""},
+ {BL_SENS_MOUSE_WHEEL_UP, "WHEELUP", "Wheel Up", ""},
+ {BL_SENS_MOUSE_WHEEL_DOWN, "WHEELDOWN", "Wheel Down", ""},
+ {BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", "Movement", ""},
+ {BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", "Mouse Over", ""},
+ {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", "Mouse Over Any", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MouseSensor", "Sensor", "Mouse Sensor");
+ RNA_def_struct_sdna_from(srna, "bMouseSensor", "data");
+
+ prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, mouse_event_items);
+ RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on.");
+}
+
+void rna_def_touch_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "TouchSensor", "Sensor", "Touch Sensor");
+ RNA_def_struct_sdna_from(srna, "bTouchSensor", "data");
+
+ prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "ma");
+ RNA_def_property_ui_text(prop, "Material", "Only look for floors with this material.");
+}
+
+void rna_def_keyboard_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "KeyboardSensor", "Sensor", "Keyboard Sensor");
+ RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data");
+
+ prop= RNA_def_property(srna, "key", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* need better range or enum check */
+ RNA_def_property_ui_text(prop, "Key", "Input key code.");
+ RNA_def_property_range(prop, 0, 255);
+
+ prop= RNA_def_property(srna, "modifier_key", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* need better range or enum check */
+ RNA_def_property_int_sdna(prop, NULL, "qual");
+ RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code.");
+ RNA_def_property_range(prop, 0, 255);
+
+ prop= RNA_def_property(srna, "second_modifier_key", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* need better range or enum check */
+ RNA_def_property_int_sdna(prop, NULL, "qual2");
+ RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code.");
+ RNA_def_property_range(prop, 0, 255);
+
+ prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "targetName");
+ RNA_def_property_ui_text(prop, "Target", "Property that indicates whether to log keystrokes as a string.");
+
+ prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "toggleName");
+ RNA_def_property_ui_text(prop, "Log", "Property that receive the keystrokes in case a string is logged.");
+
+ prop= RNA_def_property(srna, "all_keys", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "type", 1);
+ RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke.");
+}
+
+void rna_def_property_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] ={
+ {SENS_PROP_EQUAL, "PROPEQUAL", "Equal", ""},
+ {SENS_PROP_NEQUAL, "PROPNEQUAL", "Not Equal", ""},
+ {SENS_PROP_INTERVAL, "PROPINTERVAL", "Interval", ""},
+ {SENS_PROP_CHANGED, "PROPCHANGED", "Changed", ""},
+ /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", "Expression", ""}, NOT_USED_IN_UI */
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "PropertySensor", "Sensor", "Property Sensor");
+ RNA_def_struct_sdna_from(srna, "bPropertySensor", "data");
+
+ prop= RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation.");
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Property", "");
+
+ prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "value");
+ RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal or Not Equal types.");
+
+ prop= RNA_def_property(srna, "min_value", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "value");
+ RNA_def_property_ui_text(prop, "Minimum Value", "Specify minimum value in Interval type.");
+
+ prop= RNA_def_property(srna, "max_value", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "maxvalue");
+ RNA_def_property_ui_text(prop, "Maximum Value", "Specify maximum value in Interval type.");
+}
+
+void rna_def_actuator_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "ActuatorSensor", "Sensor", "Actuator Sensor");
+ RNA_def_struct_sdna_from(srna, "bActuatorSensor", "data");
+
+ prop= RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected.");
+}
+
+void rna_def_delay_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "DelaySensor", "Sensor", "Delay Sensor");
+ RNA_def_struct_sdna_from(srna, "bDelaySensor", "data");
+
+ prop= RNA_def_property(srna, "delay", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second).");
+ RNA_def_property_range(prop, 0, 5000);
+
+ prop= RNA_def_property(srna, "duration", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger.");
+ RNA_def_property_range(prop, 0, 5000);
+
+ prop= RNA_def_property(srna, "repeat", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT);
+ RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics.");
+}
+
+void rna_def_collision_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem prop_type_items[] ={
+ {0, "PROPERTY", "Property", ""},
+ {1, "MATERIAL", "Material", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "CollisionSensor", "Sensor", "Collision Sensor");
+ RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data");
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Property Name", "Only look for Objects with this property.");
+
+ prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "materialName");
+ RNA_def_property_ui_text(prop, "Material Name", "Only look for Objects with this material.");
+
+ prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property.");
+}
+
+void rna_def_radar_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem axis_items[] ={
+ {SENS_RAY_X_AXIS, "XAXIS", "+X axis", ""},
+ {SENS_RAY_Y_AXIS, "YAXIS", "+Y axis", ""},
+ {SENS_RAY_Z_AXIS, "ZAXIS", "+Z axis", ""},
+ {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", "-X axis", ""},
+ {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", "-Y axis", ""},
+ {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", "-Z axis", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "RadarSensor", "Sensor", "Radar Sensor");
+ RNA_def_struct_sdna_from(srna, "bRadarSensor", "data");
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property.");
+
+ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, axis_items);
+ RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the radar cone is cast.");
+
+ prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.0, 179.9);
+ RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone.");
+
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "range");
+ RNA_def_property_range(prop, 0.0, 10000.0);
+ RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone.");
+}
+
+void rna_def_random_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "RandomSensor", "Sensor", "Random Sensor");
+ RNA_def_struct_sdna_from(srna, "bRandomSensor", "data");
+
+ prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 1000);
+ RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator. (Choose 0 for not random).");
+}
+
+void rna_def_ray_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ static EnumPropertyItem axis_items[] ={
+ {SENS_RAY_X_AXIS, "XAXIS", "+X axis", ""},
+ {SENS_RAY_Y_AXIS, "YAXIS", "+Y axis", ""},
+ {SENS_RAY_Z_AXIS, "ZAXIS", "+Z axis", ""},
+ {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", "-X axis", ""},
+ {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", "-Y axis", ""},
+ {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", "-Z axis", ""},
+ {0, NULL, NULL, NULL}};
+ static EnumPropertyItem prop_type_items[] ={
+ {0, "PROPERTY", "Property", ""},
+ {1, "MATERIAL", "Material", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "RaySensor", "Sensor", "Ray Sensor");
+ RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
+
+ prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "propname");
+ RNA_def_property_ui_text(prop, "Property", "Only look for Objects with this property.");
+
+ prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "matname");
+ RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material.");
+
+ prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, prop_type_items);
+ RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property.");
+
+ prop= RNA_def_property(srna, "x_ray_mode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
+ RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property).");
+
+ prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.01, 10000.0);
+ RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance.");
+
+ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "axisflag");
+ RNA_def_property_enum_items(prop, axis_items);
+ RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast.");
+}
+
+void rna_def_message_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MessageSensor", "Sensor", "Message Sensor");
+ RNA_def_struct_sdna_from(srna, "bMessageSensor", "data");
+
+ prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty for all.");
+}
+
+void rna_def_joystick_sensor(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem event_type_items[] ={
+ {SENS_JOY_BUTTON, "BUTTON", "Button", ""},
+ {SENS_JOY_AXIS, "AXIS", "Axis", ""},
+ {SENS_JOY_HAT, "HAT", "Hat", ""},
+ {0, NULL, NULL, NULL}};
+
+ static EnumPropertyItem axis_direction_items[] ={
+ {SENS_JOY_X_AXIS, "RIGHTAXIS", "Right Axis", ""},
+ {SENS_JOY_Y_AXIS, "UPAXIS", "Up Axis", ""},
+ {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", "Left Axis", ""},
+ {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", "Down Axis", ""},
+ {0, NULL, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "JoystickSensor", "Sensor", "Joystick Sensor");
+ RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data");
+
+ prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "joyindex");
+ RNA_def_property_ui_text(prop, "Joystick Index", "Specify which joystick to use.");
+ RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1);
+
+ prop= RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, event_type_items);
+ RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on.");
+
+ prop= RNA_def_property(srna, "all_events", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT);
+ RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joysticks current type (axis/button/hat).");
+
+ /* Button */
+ prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "button");
+ RNA_def_property_ui_text(prop, "Button Number", "Specify which button to use.");
+ RNA_def_property_range(prop, 0, 18);
+
+ /* Axis */
+ prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "axis");
+ RNA_def_property_ui_text(prop, "Axis Number", "Specify which axis pair to use, 1 is useually the main direction input.");
+ RNA_def_property_range(prop, 1, 2);
+
+ prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "precision");
+ RNA_def_property_ui_text(prop, "Axis Threshold", "Specify the precision of the axis.");
+ RNA_def_property_range(prop, 0, 32768);
+
+ prop= RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "axisf");
+ RNA_def_property_enum_items(prop, axis_direction_items);
+ RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis.");
+
+ /* Hat */
+ prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "hat");
+ RNA_def_property_ui_text(prop, "Hat Number", "Specify which hat to use.");
+ RNA_def_property_range(prop, 1, 2);
+
+ prop= RNA_def_property(srna, "hat_direction", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "hatf");
+ RNA_def_property_ui_text(prop, "Hat Direction", "Specify hat direction.");
+ RNA_def_property_range(prop, 0, 12);
+}
+
+void RNA_def_sensor(BlenderRNA *brna)
+{
+ rna_def_sensor(brna);
+
+ rna_def_always_sensor(brna);
+ rna_def_near_sensor(brna);
+ rna_def_mouse_sensor(brna);
+ rna_def_touch_sensor(brna);
+ rna_def_keyboard_sensor(brna);
+ rna_def_property_sensor(brna);
+ rna_def_actuator_sensor(brna);
+ rna_def_delay_sensor(brna);
+ rna_def_collision_sensor(brna);
+ rna_def_radar_sensor(brna);
+ rna_def_random_sensor(brna);
+ rna_def_ray_sensor(brna);
+ rna_def_message_sensor(brna);
+ rna_def_joystick_sensor(brna);
+}
+
+#endif
+
diff --git a/source/blender/python/api2_2x/Font.h b/source/blender/makesrna/intern/rna_vfont.c
index ad6198f3b77..3dbf6858c50 100644
--- a/source/blender/python/api2_2x/Font.h
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -1,4 +1,4 @@
-/*
+/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -17,34 +17,41 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
+ * Contributor(s): Blender Foundation (2008), Juho Vepsäläinen
*
* ***** END GPL LICENSE BLOCK *****
-*/
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
-#ifndef EXPP_FONT_H
-#define EXPP_FONT_H
+#include "rna_internal.h"
-#include <Python.h>
#include "DNA_vfont_types.h"
-extern PyTypeObject Font_Type;
+#ifdef RNA_RUNTIME
-typedef struct {
- PyObject_HEAD /* required py macro */
- VFont * font; /* libdata must be second */
-} BPy_Font;
+#else
-/*------------------------------visible prototypes----------------------*/
-PyObject *Font_CreatePyObject( struct VFont * font );
-struct VFont *Font_FromPyObject( PyObject * py_obj );
-PyObject *Font_Init( void );
+void RNA_def_vfont(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "VectorFont", "ID", "Vector Font");
+ RNA_def_struct_sdna(srna, "VFont");
-#endif
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_ui_text(prop, "Filename", "");
+
+ prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
+ RNA_def_property_ui_text(prop, "Packed File", "");
+}
+#endif
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
new file mode 100644
index 00000000000..0361cff164c
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -0,0 +1,93 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_windowmanager_types.h"
+
+#ifdef RNA_RUNTIME
+
+static StructRNA *rna_Operator_refine(PointerRNA *ptr)
+{
+ wmOperator *op= (wmOperator*)ptr->data;
+ return op->type->srna;
+}
+
+static void rna_Operator_name_get(PointerRNA *ptr, char *value)
+{
+ wmOperator *op= (wmOperator*)ptr->data;
+ strcpy(value, op->type->name);
+}
+
+static int rna_Operator_name_length(PointerRNA *ptr)
+{
+ wmOperator *op= (wmOperator*)ptr->data;
+ return strlen(op->type->name);
+}
+
+#else
+
+static void rna_def_operator(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Operator", NULL, "Operator");
+ RNA_def_struct_sdna(srna, "wmOperator");
+ RNA_def_struct_funcs(srna, NULL, "rna_Operator_refine");
+
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+ RNA_def_property_ui_text(prop, "Name", "Operator name.");
+ RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL);
+
+ RNA_def_struct_name_property(srna, prop);
+}
+
+static void rna_def_windowmanager(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "WindowManager", "ID", "Window Manager");
+ RNA_def_struct_sdna(srna, "wmWindowManager");
+
+ prop= RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Operator");
+ RNA_def_property_ui_text(prop, "Operators", "Operator registry.");
+}
+
+void RNA_def_wm(BlenderRNA *brna)
+{
+ rna_def_operator(brna);
+ rna_def_windowmanager(brna);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
new file mode 100644
index 00000000000..6e41b8768b5
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -0,0 +1,111 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Blender Foundation (2008).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_world_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_world(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+/*
+ float horr, horg, horb, hork;
+ float zenr, zeng, zenb, zenk;
+ float ambr, ambg, ambb, ambk;
+
+ static EnumPropertyItem gameproperty_types_items[] ={
+ {PROP_BOOL, "BOOL", "Boolean", ""},
+ {PROP_INT, "INT", "Integer", ""},
+ {PROP_FLOAT, "FLOAT", "Float", ""},
+ {PROP_STRING, "STRING", "String", ""},
+ {PROP_TIME, "TIME", "Time", ""},
+ {0, NULL, NULL, NULL}};
+*/
+ srna= RNA_def_struct(brna, "World", "ID" , "World");
+
+ rna_def_ipo_common(srna);
+
+/*
+ prop= RNA_def_property(srna, "mtex", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "MTex");
+ RNA_def_property_ui_text(prop, "MTex", "MTex associated with this world setting.");
+*/
+
+ /* colors */
+ prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "horr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon.");
+
+ prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "zenr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith.");
+
+ prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_float_sdna(prop, NULL, "ambr");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Ambient Color", "");
+
+ /* exp, range */
+ prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "exp");
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light.");
+
+ prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "range");
+ RNA_def_property_range(prop, 0.2, 5.0);
+ RNA_def_property_ui_text(prop, "Range", "The color amount that will be mapped on color 1.0.");
+
+ /* sky type */
+ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
+ RNA_def_property_ui_text(prop, "Blend Sky", "Renders background with natural progression from horizon to zenith.");
+
+ prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
+ RNA_def_property_ui_text(prop, "Paper Sky", "Flattens blend or texture coordinates.");
+
+ prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
+ RNA_def_property_ui_text(prop, "Real Sky", "Renders background with a real horizon.");
+}
+
+#endif
+
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index cf83804b999..7daf32361de 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -23,10 +23,10 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c)
+FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c intern/TEX_nodes/*.c)
SET(INC
- . ../../../intern/guardedalloc ../include ../blenlib ../makesdna
+ . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna
../python ../render/extern/include ../../../intern/decimation/extern
../imbuf ../avi ../../../intern/elbeem/extern
../../../intern/iksolver/extern ../blenloader ../quicktime
diff --git a/source/blender/nodes/Makefile b/source/blender/nodes/Makefile
index 39d85d26fef..400064f24b8 100644
--- a/source/blender/nodes/Makefile
+++ b/source/blender/nodes/Makefile
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# The Original Code is Copyright (C) Blender Foundation.
# All rights reserved.
#
# The Original Code is: all of this file.
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index 91ca6cd8c81..5104bcd0046 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -7,7 +7,7 @@ sources += env.Glob('intern/SHD_nodes/*.c')
sources += env.Glob('intern/TEX_nodes/*.c')
incs = '. ./intern '
-incs += '#/intern/guardedalloc ../include ../blenlib ../makesdna'
+incs += '#/intern/guardedalloc ../editors/include ../blenlib ../makesdna'
incs += ' ../render/extern/include '
incs += ' ../imbuf ../avi '
incs += ' ../blenloader'
@@ -48,4 +48,4 @@ if env['WITH_BF_QUICKTIME']:
defs += ' WITH_CCGSUBSURF '
-env.BlenderLib ( libname = 'nodes', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['core','player'], priority = [65, 20] )
+env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['core','player'], priority = [80, 15] )
diff --git a/source/blender/nodes/TEX_node.h b/source/blender/nodes/TEX_node.h
index 6be2123b96d..40cb65eacce 100644
--- a/source/blender/nodes/TEX_node.h
+++ b/source/blender/nodes/TEX_node.h
@@ -52,6 +52,8 @@ extern bNodeType tex_node_curve_rgb;
extern bNodeType tex_node_curve_time;
extern bNodeType tex_node_invert;
extern bNodeType tex_node_hue_sat;
+extern bNodeType tex_node_coord;
+extern bNodeType tex_node_distance;
extern bNodeType tex_node_rotate;
extern bNodeType tex_node_translate;
diff --git a/source/blender/nodes/intern/CMP_nodes/Makefile b/source/blender/nodes/intern/CMP_nodes/Makefile
index 8a8d323ac5b..b70b591a588 100644
--- a/source/blender/nodes/intern/CMP_nodes/Makefile
+++ b/source/blender/nodes/intern/CMP_nodes/Makefile
@@ -39,7 +39,7 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../include
+CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I$(NAN_GLEW)/include
diff --git a/source/blender/nodes/intern/CMP_util.h b/source/blender/nodes/intern/CMP_util.h
index e111632a195..19e41f5c118 100644
--- a/source/blender/nodes/intern/CMP_util.h
+++ b/source/blender/nodes/intern/CMP_util.h
@@ -37,19 +37,14 @@
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h" /* qdn: defocus node, need camera info */
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_ID.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -65,17 +60,6 @@
#include "../CMP_node.h"
#include "node_util.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -84,18 +68,10 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
/* *************************** operations support *************************** */
/* general signal that's in output sockets, and goes over the wires */
diff --git a/source/blender/nodes/intern/Makefile b/source/blender/nodes/intern/Makefile
index 6167cf6bc72..7c9a67b6cc5 100644
--- a/source/blender/nodes/intern/Makefile
+++ b/source/blender/nodes/intern/Makefile
@@ -39,9 +39,12 @@ CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../include
+CPPFLAGS += -I../../editors/include
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../gpu
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
+
+DIRS = SHD_nodes CMP_nodes
+include nan_subdirs.mk
diff --git a/source/blender/nodes/intern/SHD_nodes/Makefile b/source/blender/nodes/intern/SHD_nodes/Makefile
index ae3cae029d2..1369d346fc6 100644
--- a/source/blender/nodes/intern/SHD_nodes/Makefile
+++ b/source/blender/nodes/intern/SHD_nodes/Makefile
@@ -41,7 +41,7 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../include
+CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I../../../gpu
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
index 2065ac2ed33..4fcfe3a789a 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
@@ -37,14 +37,19 @@
#include "BKE_text.h"
#include "BKE_utildefines.h"
+// XXX
+#if 0
#ifndef DISABLE_PYTHON
#include "api2_2x/Node.h"
#include "api2_2x/gen_utils.h"
#include "BPY_extern.h"
#endif
+#endif
#include "../SHD_util.h"
+// XXX
+#if 0
static void node_dynamic_setup(bNode *node);
static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out);
static void node_dynamic_free_storage_cb(bNode *node);
@@ -761,4 +766,10 @@ bNodeType node_dynamic_typeinfo = {
/* id */ NULL
};
+#else
+
+bNodeType node_dynamic_typeinfo = {NULL};
+
+#endif
+
diff --git a/source/blender/nodes/intern/SHD_util.h b/source/blender/nodes/intern/SHD_util.h
index eda985529c1..a6fe5f4e9cc 100644
--- a/source/blender/nodes/intern/SHD_util.h
+++ b/source/blender/nodes/intern/SHD_util.h
@@ -31,23 +31,19 @@
#define SHD_NODE_UTIL_H_
#include <math.h>
+#include <float.h>
#include <string.h>
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_ID.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -62,17 +58,6 @@
#include "../SHD_node.h"
#include "node_util.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -81,20 +66,11 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "GPU_material.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-
/* ********* exec data struct, remains internal *********** */
typedef struct ShaderCallData {
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
new file mode 100644
index 00000000000..da487c190af
--- /dev/null
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
@@ -0,0 +1,66 @@
+/**
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Mathias Panzenböck (panzi) <grosser.meister.morti@gmx.net>.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "../TEX_util.h"
+
+static bNodeSocketType outputs[]= {
+ { SOCK_VECTOR, 0, "Coordinates", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },
+ { -1, 0, "" }
+};
+
+static void vectorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+{
+ out[0] = coord[0];
+ out[1] = coord[1];
+ out[2] = coord[2];
+}
+
+static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+{
+ tex_output(node, in, out[0], &vectorfn);
+
+ tex_do_preview(node, out[0], data);
+}
+
+bNodeType tex_node_coord= {
+ /* *next,*prev */ NULL, NULL,
+ /* type code */ TEX_NODE_COORD,
+ /* name */ "Coordinates",
+ /* width+range */ 120, 110, 160,
+ /* class+opts */ NODE_CLASS_INPUT, NODE_OPTIONS,
+ /* input sock */ NULL,
+ /* output sock */ outputs,
+ /* storage */ "node_coord",
+ /* execfunc */ exec,
+ /* butfunc */ NULL,
+ /* initfunc */ NULL,
+ /* freestoragefunc */ NULL,
+ /* copystoragefunc */ NULL,
+ /* id */ NULL
+};
+
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
new file mode 100644
index 00000000000..ff9ec4db76b
--- /dev/null
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
@@ -0,0 +1,79 @@
+/**
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Mathias Panzenböck (panzi) <grosser.meister.morti@gmx.net>.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include "BLI_arithb.h"
+#include "../TEX_util.h"
+
+static bNodeSocketType inputs[]= {
+ { SOCK_VECTOR, 1, "Coordinate 1", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },
+ { SOCK_VECTOR, 1, "Coordinate 2", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },
+ { -1, 0, "" }
+};
+
+static bNodeSocketType outputs[]= {
+ { SOCK_VALUE, 0, "Value", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f },
+ { -1, 0, "" }
+};
+
+static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
+{
+ float coord1[3], coord2[3];
+ float x, y, z;
+
+ tex_input_vec(coord1, in[0], coord, thread);
+ tex_input_vec(coord2, in[1], coord, thread);
+
+ *out = VecLenf(coord2, coord1);
+}
+
+static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+{
+ tex_output(node, in, out[0], &valuefn);
+
+ tex_do_preview(node, out[0], data);
+}
+
+bNodeType tex_node_distance= {
+ /* *next,*prev */ NULL, NULL,
+ /* type code */ TEX_NODE_DISTANCE,
+ /* name */ "Distance",
+ /* width+range */ 120, 110, 160,
+ /* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
+ /* input sock */ inputs,
+ /* output sock */ outputs,
+ /* storage */ "node_distance",
+ /* execfunc */ exec,
+ /* butfunc */ NULL,
+ /* initfunc */ NULL,
+ /* freestoragefunc */ NULL,
+ /* copystoragefunc */ NULL,
+ /* id */ NULL
+};
+
+
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index 10fe3bab26c..562072328a8 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -46,25 +46,32 @@ void tex_call_delegate(TexDelegate *dg, float *out, float *coord, short thread)
dg->fn(out, coord, dg->node, dg->in, thread);
}
-void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread)
+void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread)
{
TexDelegate *dg = in->data;
if(dg) {
- tex_call_delegate(dg, out, coord, thread);
+ tex_call_delegate(dg, in->vec, coord, thread);
- if(in->hasoutput && in->sockettype == SOCK_VALUE) {
- out[1] = out[2] = out[0];
- out[3] = 1;
- }
- }
- else {
- QUATCOPY(out, in->vec);
+ if(in->hasoutput && in->sockettype == SOCK_VALUE)
+ in->vec[1] = in->vec[2] = in->vec[0];
}
+ memcpy(out, in->vec, sz * sizeof(float));
+}
+
+void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread)
+{
+ tex_input(out, 3, in, coord, thread);
}
void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread)
{
- tex_input_vec(out, in, coord, thread);
+ tex_input(out, 4, in, coord, thread);
+
+ if(in->hasoutput && in->sockettype == SOCK_VALUE)
+ {
+ out[1] = out[2] = out[0];
+ out[3] = 1;
+ }
if(in->hasoutput && in->sockettype == SOCK_VECTOR) {
out[0] = out[0] * .5f + .5f;
@@ -83,8 +90,8 @@ float tex_input_value(bNodeStack *in, float *coord, short thread)
static void init_preview(bNode *node)
{
- int xsize = node->prvr.xmax - node->prvr.xmin;
- int ysize = node->prvr.ymax - node->prvr.ymin;
+ int xsize = (int)(node->prvr.xmax - node->prvr.xmin);
+ int ysize = (int)(node->prvr.ymax - node->prvr.ymin);
if(xsize == 0) {
xsize = PREV_RES;
diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h
index 69cf20794c9..9203b950364 100644
--- a/source/blender/nodes/intern/TEX_util.h
+++ b/source/blender/nodes/intern/TEX_util.h
@@ -34,7 +34,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
#include "DNA_ipo_types.h"
#include "DNA_ID.h"
@@ -43,10 +42,7 @@
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index aac3c51b97e..1761ce14ed6 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -1,5 +1,5 @@
/*
- * $Id$
+ * $Id: BPY_extern.h 12334 2007-10-21 23:00:29Z aligorith $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
deleted file mode 100644
index 331f72021f2..00000000000
--- a/source/blender/python/BPY_interface.c
+++ /dev/null
@@ -1,3024 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Stephen Swaney,
- * Chris Keith, Chris Want, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <Python.h>
-
-#include "compile.h" /* for the PyCodeObject */
-#include "eval.h" /* for PyEval_EvalCode */
-#include "BLI_blenlib.h" /* for BLI_last_slash() */
-#include "BIF_interface.h" /* for pupmenu() */
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BKE_action.h" /* for get_pose_channel() */
-#include "BKE_library.h"
-#include "BKE_object.h" /* during_scriptlink() */
-#include "BKE_text.h"
-#include "BKE_constraint.h" /* for bConstraintOb */
-#include "BKE_idprop.h"
-
-#include "DNA_curve_types.h" /* for struct IpoDriver */
-#include "DNA_ID.h" /* ipo driver */
-#include "DNA_object_types.h" /* ipo driver */
-#include "DNA_constraint_types.h" /* for pyconstraint */
-
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h" /* for U.pythondir */
-#include "MEM_guardedalloc.h"
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#include "DNA_space_types.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_armature.h"
-#include "BKE_depsgraph.h"
-#include "api2_2x/EXPP_interface.h"
-#include "api2_2x/constant.h"
-#include "api2_2x/gen_utils.h"
-#include "api2_2x/gen_library.h" /* GetPyObjectFromID */
-#include "api2_2x/BGL.h"
-#include "api2_2x/Blender.h"
-#include "api2_2x/Camera.h"
-#include "api2_2x/Draw.h"
-#include "api2_2x/Object.h"
-#include "api2_2x/Registry.h"
-#include "api2_2x/Pose.h"
-#include "api2_2x/bpy.h" /* for the new "bpy" module */
-
-/*these next two are for pyconstraints*/
-#include "api2_2x/IDProp.h"
-#include "api2_2x/matrix.h"
-
-/* for scriptlinks */
-#include "DNA_lamp_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_world_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_material_types.h"
-
-/* bpy_registryDict is declared in api2_2x/Registry.h and defined
- * in api2_2x/Registry.c
- * This Python dictionary will be used to store data that scripts
- * choose to preserve after they are executed, so user changes can be
- * restored next time the script is used. Check the Blender.Registry module.
- */
-/*#include "api2_2x/Registry.h" */
-
-/* for pydrivers (ipo drivers defined by one-line Python expressions) */
-PyObject *bpy_pydriver_Dict = NULL;
-PyObject *bpy_orig_syspath_List = NULL;
-
-
-/*
- * set up a weakref list for Armatures
- * creates list in __main__ module dict
- */
-
-static int setup_armature_weakrefs()
-{
- PyObject *maindict;
- PyObject *main_module;
- char *list_name = ARM_WEAKREF_LIST_NAME;
-
- main_module = PyImport_AddModule( "__main__");
- if(main_module){
- PyObject *weakreflink;
- maindict= PyModule_GetDict(main_module);
-
- /* check if there is already a dict entry for the armature weakrefs,
- * and delete if so before making another one */
-
- weakreflink= PyDict_GetItemString(maindict,list_name);
- if( weakreflink != NULL ) {
- PyDict_DelItemString(maindict,list_name);
- Py_XDECREF( weakreflink );
- }
-
- if (PyDict_SetItemString(maindict,
- list_name,
- PyList_New(0)) == -1){
- printf("Oops - setup_armature_weakrefs()\n");
-
- return 0;
- }
- }
- return 1;
-}
-
-/* Declares the modules and their initialization functions
- * These are TOP-LEVEL modules e.g. import `module` - there is no
- * support for packages here e.g. import `package.module` */
-
-static struct _inittab BPy_Inittab_Modules[] = {
- {"Blender", M_Blender_Init},
- {"bpy", m_bpy_init},
- {NULL, NULL}
-};
-
-/*************************************************************************
-* Structure definitions
-**************************************************************************/
-#define FILENAME_LENGTH 24
-
-typedef struct _ScriptError {
- char filename[FILENAME_LENGTH];
- int lineno;
-} ScriptError;
-
-/****************************************************************************
-* Global variables
-****************************************************************************/
-ScriptError g_script_error;
-
-/***************************************************************************
-* Function prototypes
-***************************************************************************/
-static PyObject *RunPython( Text * text, PyObject * globaldict );
-static PyObject *CreateGlobalDictionary( void );
-static void ReleaseGlobalDictionary( PyObject * dict );
-static void DoAllScriptsFromList( ListBase * list, short event );
-static PyObject *importText( char *name );
-static void init_ourImport( void );
-static void init_ourReload( void );
-static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * kw);
-
-
-static void BPY_Err_Handle( char *script_name );
-static PyObject *traceback_getFilename( PyObject * tb );
-
-/****************************************************************************
-* Description: This function will start the interpreter and load all modules
-* as well as search for a python installation.
-****************************************************************************/
-void BPY_start_python( int argc, char **argv )
-{
- PyThreadState *py_tstate = NULL;
- static int argc_copy = 0;
- static char **argv_copy = NULL;
- int first_time = argc;
-
- /* we keep a copy of the values of argc and argv so that the game engine
- * can call BPY_start_python(0, NULL) whenever a game ends, without having
- * to know argc and argv there (in source/blender/src/space.c) */
- if( first_time ) {
- argc_copy = argc;
- argv_copy = argv;
- }
-
- //stuff for Registry module
- bpy_registryDict = PyDict_New( );/* check comment at start of this file */
- if( !bpy_registryDict )
- printf( "Warning: Couldn't create the Registry Python Dictionary!" );
- Py_SetProgramName( "blender" );
-
- /* Py_Initialize() will attempt to import the site module and
- * print an error if not found. See init_syspath() for the
- * rest of our init msgs.
- */
-
- /* print Python version
- * Py_GetVersion() returns a ptr to a static string "9.9.9 (aaaa..."
- */
- {
- int count = 3; /* a nice default for major.minor. example 2.5 */
- const char *version = Py_GetVersion();
- /* we know a blank is there somewhere! */
- char *blank_ptr = strchr( version, ' ');
- if(blank_ptr)
- count = blank_ptr - version;
-
- printf( "Compiled with Python version %.*s.\n", count, version );
- }
-
-
- //Initialize the TOP-LEVEL modules
- PyImport_ExtendInittab(BPy_Inittab_Modules);
-
- //Start the interpreter
- Py_Initialize( );
-
- PySys_SetArgv( argc_copy, argv_copy );
- /* Initialize thread support (also acquires lock) */
- PyEval_InitThreads();
-
- //Overrides __import__
- init_ourImport( );
- init_ourReload( );
-
- //init a global dictionary
- g_blenderdict = NULL;
-
- //Look for a python installation
- init_syspath( first_time ); /* not first_time: some msgs are suppressed */
- py_tstate = PyGILState_GetThisThreadState();
- PyEval_ReleaseThread(py_tstate);
-
- return;
-}
-
-/*****************************************************************************/
-/* Description: This function will terminate the Python interpreter */
-/*****************************************************************************/
-void BPY_end_python( void )
-{
- Script *script = NULL;
- Script *next_script = NULL;
-
- PyGILState_Ensure(); /* finalizing, no need to grab the state */
-
- if( bpy_registryDict ) {
- Py_DECREF( bpy_registryDict );
- bpy_registryDict = NULL;
- }
-
- if( bpy_pydriver_Dict ) {
- Py_DECREF( bpy_pydriver_Dict );
- bpy_pydriver_Dict = NULL;
- }
-
- if( bpy_orig_syspath_List ) {
- Py_DECREF( bpy_orig_syspath_List );
- bpy_orig_syspath_List = NULL;
- }
-
- /* Freeing all scripts here prevents problems with the order in which
- * Python is finalized and G.main is freed in exit_usiblender() */
- for (script = G.main->script.first; script; script = next_script) {
- next_script = script->id.next;
- free_libblock( &G.main->script, script );
- }
-
- Py_Finalize( );
-
- BPyMenu_RemoveAllEntries( ); /* freeing bpymenu mem */
-
- /* a script might've opened a .blend file but didn't close it, so: */
- EXPP_Library_Close( );
-
- return;
-}
-
-void syspath_append( char *dirname )
-{
- PyObject *mod_sys= NULL, *dict= NULL, *path= NULL, *dir= NULL;
- short ok=1;
-
- mod_sys = PyImport_ImportModule( "sys" ); /* new ref */
-
- if (mod_sys) {
- dict = PyModule_GetDict( mod_sys ); /* borrowed ref */
- path = PyDict_GetItemString( dict, "path" ); /* borrowed ref */
- if ( !PyList_Check( path ) ) {
- ok = 0;
- }
- } else {
- /* cant get the sys module */
- /* PyErr_Clear(); is called below */
- ok = 0;
- }
-
- dir = PyString_FromString( dirname );
-
- if (ok && PySequence_Contains(path, dir)==0) { /* Only add if we need to */
- if (PyList_Append( path, dir ) != 0) /* decref below */
- ok = 0; /* append failed */
- }
-
- if( (ok==0) || PyErr_Occurred( ) )
- fprintf(stderr, "Warning: could import or build sys.path\n" );
-
- PyErr_Clear();
- Py_DECREF( dir );
- Py_XDECREF( mod_sys );
-}
-
-void init_syspath( int first_time )
-{
- PyObject *mod, *d;
- char *progname;
- char execdir[FILE_MAXDIR]; /*defines from DNA_space_types.h */
-
- int n;
-
- mod = PyImport_ImportModule( "Blender.sys" );
-
- if( mod ) {
- d = PyModule_GetDict( mod );
- EXPP_dict_set_item_str( d, "progname", PyString_FromString( bprogname ) );
- Py_DECREF( mod );
- } else {
- printf( "Warning: could not set Blender.sys\n" );
- PyErr_Clear();
- }
-
- progname = BLI_last_slash( bprogname ); /* looks for the last dir separator */
-
- n = progname - bprogname;
- if( n > 0 ) {
- strncpy( execdir, bprogname, n );
- if( execdir[n - 1] == '.' )
- n--; /*fix for when run as ./blender */
- execdir[n] = '\0';
-
- syspath_append( execdir ); /* append to module search path */
- } else {
- printf( "Warning: could not determine argv[0] path\n" );
- }
-
- /*
- attempt to import 'site' module as a check for valid
- python install found.
- */
-
- printf("Checking for installed Python... "); /* appears after msg "Compiled with Python 2.x" */
- mod = PyImport_ImportModule( "site" ); /* new ref */
-
- if( mod ) {
- printf("got it!\n");
- Py_DECREF( mod );
- } else { /* import 'site' failed */
- PyErr_Clear( );
- if( first_time ) {
- printf( "No installed Python found.\n" );
- printf( "Only built-in modules are available. Some scripts may not run.\n" );
- printf( "Continuing happily.\n" );
- }
- }
-
-
- /*
- * initialize the sys module
- * set sys.executable to the Blender exe
- */
-
- mod = PyImport_ImportModule( "sys" ); /* new ref */
-
- if( mod ) {
- d = PyModule_GetDict( mod ); /* borrowed ref */
- EXPP_dict_set_item_str( d, "executable", Py_BuildValue( "s", bprogname ) );
-
- if (bpy_orig_syspath_List == NULL) {
- /* backup the original sys.path to rebuild later */
- PyObject *syspath = PyDict_GetItemString( d, "path" ); /* borrowed ref */
- if (bpy_orig_syspath_List) { /* This should never happen but just incase, be nice */
- Py_DECREF(bpy_orig_syspath_List);
- }
- bpy_orig_syspath_List = PyList_GetSlice(syspath, 0, PyList_Size(syspath));
- }
-
- Py_DECREF( mod );
- } else{
- PyErr_Clear( );
- printf("Warning: import of sys module failed\n");
- }
-}
-
-void BPY_rebuild_syspath( void )
-{
- PyObject *mod, *dict, *syspath;
- char dirpath[FILE_MAX];
- char *sdir = NULL;
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- mod = PyImport_ImportModule( "sys" );
- if (!mod) {
- printf("Warning: could not import python sys module. some modules may not import.\n");
- PyErr_Clear( );
- PyGILState_Release(gilstate);
- return;
- }
-
- if (!bpy_orig_syspath_List) { /* should never happen */
- printf("Warning: cant refresh python path, bpy_orig_syspath_List is NULL\n");
- Py_DECREF(mod);
- PyGILState_Release(gilstate);
- return;
- }
-
- dict = PyModule_GetDict( mod ); /* borrowed ref */
-
- /* Reset sys.path */
- syspath = PyDict_GetItemString( dict, "path" ); /* borrowed ref */
- PyList_SetSlice(syspath, 0, PyList_Size(syspath), bpy_orig_syspath_List);
-
- if(U.pythondir[0] != '\0' ) {
- char modpath[FILE_MAX];
- int upyslen = strlen(U.pythondir);
- BLI_strncpy(dirpath, U.pythondir, FILE_MAX);
-
- /* check if user pydir ends with a slash and, if so, remove the slash
- * (for eventual implementations of c library's stat function that might
- * not like it) */
-#ifdef WIN32
- if (upyslen > 3) {
-#else
- if (upyslen > 1) {
-#endif
- if (dirpath[upyslen-1] == '\\' || dirpath[upyslen-1] == '/') {
- dirpath[upyslen-1] = '\0';
- }
- }
-
- BLI_convertstringcode(dirpath, G.sce);
- syspath_append(dirpath); /* append to module search path */
- BLI_join_dirfile( modpath, dirpath, "bpymodules" );
- if (BLI_exists(modpath)) syspath_append(modpath);
- }
-
- sdir = bpy_gethome(1);
- if (sdir) {
- syspath_append(sdir);
- BLI_make_file_string("/", dirpath, sdir, "bpymodules");
- if (BLI_exists(dirpath)) syspath_append(dirpath);
- }
-
- Py_DECREF(mod);
- PyGILState_Release(gilstate);
-}
-
-int BPY_path_update( void )
-{
- BPyMenu_RemoveAllEntries(); /* free old data */
- BPY_rebuild_syspath();
- if (BPyMenu_Init(1) == -1) { /* re-eval scripts registration in menus */
- return 0;
- }
- return 1;
-}
-
-/****************************************************************************
-* Description: This function finishes Python initialization in Blender.
-
-Because U.pythondir (user defined dir for scripts) isn't
-initialized when BPY_start_Python needs to be executed, we
-postpone adding U.pythondir to sys.path and also BPyMenus
-(mechanism to register scripts in Blender menus) for when
-that dir info is available.
-****************************************************************************/
-void BPY_post_start_python( void )
-{
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- BPY_rebuild_syspath();
- BPyMenu_Init( 0 ); /* get dynamic menus (registered scripts) data */
-
- PyGILState_Release(gilstate);
-}
-
-/****************************************************************************
-* Description: This function will return the linenumber on which an error
-* has occurred in the Python script.
-****************************************************************************/
-int BPY_Err_getLinenumber( void )
-{
- return g_script_error.lineno;
-}
-
-/*****************************************************************************/
-/* Description: This function will return the filename of the python script. */
-/*****************************************************************************/
-const char *BPY_Err_getFilename( void )
-{
- return g_script_error.filename;
-}
-
-/*****************************************************************************/
-/* Description: Return PyString filename from a traceback object */
-/*****************************************************************************/
-static PyObject *traceback_getFilename( PyObject * tb )
-{
- PyObject *v = NULL;
-
-/* co_filename is in f_code, which is in tb_frame, which is in tb */
-
- v = PyObject_GetAttrString( tb, "tb_frame" );
- if (v) {
- Py_DECREF( v );
- v = PyObject_GetAttrString( v, "f_code" );
- if (v) {
- Py_DECREF( v );
- v = PyObject_GetAttrString( v, "co_filename" );
- }
- }
-
- if (v) return v;
- else return PyString_FromString("unknown");
-}
-
-static void BPY_Err_Clear(void)
-{
- /* Added in 2.48a, the last_traceback can reference Objects for example, increasing
- * their user count. Not to mention holding references to wrapped data.
- * This is especially bad when the PyObject for the wrapped data is free'd, after blender
- * has alredy dealocated the pointer */
- PySys_SetObject( "last_traceback", Py_None);
-
- PyErr_Clear();
-}
-/****************************************************************************
-* Description: Blender Python error handler. This catches the error and
-* stores filename and line number in a global
-*****************************************************************************/
-static void BPY_Err_Handle( char *script_name )
-{
- PyObject *exception, *err, *tb, *v;
-
- if( !script_name ) {
- printf( "Error: script has NULL name\n" );
- BPY_Err_Clear();
- return;
- }
-
- PyErr_Fetch( &exception, &err, &tb );
-
- if (!script_name) script_name = "untitled";
- //if( !exception && !tb ) {
- // printf( "FATAL: spurious exception\n" );
- // return;
- //}
-
- strcpy( g_script_error.filename, script_name );
-
- if( exception
- && PyErr_GivenExceptionMatches( exception, PyExc_SyntaxError ) ) {
- /* no traceback available when SyntaxError */
- PyErr_NormalizeException( &exception, &err, &tb );
- PyErr_Restore( exception, err, tb ); /* takes away reference! */
- PyErr_Print( );
- v = PyObject_GetAttrString( err, "lineno" );
- if( v ) {
- g_script_error.lineno = PyInt_AsLong( v );
- Py_DECREF( v );
- } else {
- g_script_error.lineno = -1;
- }
- /* this avoids an abort in Python 2.3's garbage collecting:
- PyErr_Clear() */
- BPY_Err_Clear(); /* Calls PyErr_Clear as well */
- return;
- } else {
- PyErr_NormalizeException( &exception, &err, &tb );
- PyErr_Restore( exception, err, tb ); /* takes away reference! */
- PyErr_Print( );
- tb = PySys_GetObject( "last_traceback" );
-
- if( !tb ) {
- printf( "\nCan't get traceback\n" );
- BPY_Err_Clear(); /* incase there is still some data hanging about */
- return;
- }
-
- Py_INCREF( tb );
-
-/* From old bpython BPY_main.c:
- * 'check traceback objects and look for last traceback in the
- * same text file. This is used to jump to the line of where the
- * error occured. "If the error occured in another text file or module,
- * the last frame in the current file is adressed."'
- */
-
- for(;;) {
- v = PyObject_GetAttrString( tb, "tb_next" );
-
- if( !v || v == Py_None ||
- strcmp(PyString_AsString(traceback_getFilename(v)), script_name)) {
- break;
- }
-
- Py_DECREF( tb );
- tb = v;
- }
-
- v = PyObject_GetAttrString( tb, "tb_lineno" );
- if (v) {
- g_script_error.lineno = PyInt_AsLong(v);
- Py_DECREF(v);
- }
- v = traceback_getFilename( tb );
- if (v) {
- strncpy( g_script_error.filename, PyString_AsString( v ),
- FILENAME_LENGTH );
- Py_DECREF(v);
- }
- Py_DECREF( tb );
- }
-
- BPY_Err_Clear();
- return;
-}
-
-/****************************************************************************
-* Description: This function executes the script passed by st.
-* Notes: It is called by blender/src/drawtext.c when a Blender user
-* presses ALT+PKEY in the script's text window.
-*****************************************************************************/
-int BPY_txt_do_python_Text( struct Text *text )
-{
- PyObject *py_dict, *py_result;
- BPy_constant *info;
- char textname[24];
- Script *script = G.main->script.first;
- PyGILState_STATE gilstate;
-
- if( !text )
- return 0;
-
- /* check if this text is already running */
- while( script ) {
- if( !strcmp( script->id.name + 2, text->id.name + 2 ) ) {
- /* if this text is already a running script,
- * just move to it: */
- if (!G.background) {
- SpaceScript *sc;
- newspace( curarea, SPACE_SCRIPT );
- sc = curarea->spacedata.first;
- sc->script = script;
- return 1;
- }
- }
- script = script->id.next;
- }
-
- /* Create a new script structure and initialize it: */
- script = alloc_libblock( &G.main->script, ID_SCRIPT, text->id.name+2 );
-
- if( !script ) {
- printf( "couldn't allocate memory for Script struct!" );
- return 0;
- }
-
- /* if in the script Blender.Load(blendfile) is not the last command,
- * an error after it will call BPY_Err_Handle below, but the text struct
- * will have been deallocated already, so we need to copy its name here.
- */
- BLI_strncpy( textname, text->id.name+2, 21 );
-
- script->id.us = 1;
- script->flags = SCRIPT_RUNNING;
- script->py_draw = NULL;
- script->py_event = NULL;
- script->py_button = NULL;
- script->py_browsercallback = NULL;
- strncpy(script->scriptname, text->id.name+2, sizeof(script->scriptname));
- gilstate = PyGILState_Ensure();
-
- py_dict = CreateGlobalDictionary( );
-
- if( !setup_armature_weakrefs()){
- printf("Oops - weakref dict\n");
- PyGILState_Release(gilstate);
- return 0;
- }
-
- script->py_globaldict = py_dict;
-
- info = ( BPy_constant * ) PyConstant_New( );
- if( info ) {
- PyConstant_Insert( info, "name",
- PyString_FromString( script->id.name + 2 ) );
- Py_INCREF( Py_None );
- PyConstant_Insert( info, "arg", Py_None );
- EXPP_dict_set_item_str( py_dict, "__script__",
- ( PyObject * ) info );
- }
-
- py_result = RunPython( text, py_dict ); /* Run the script */
-
- if( !py_result ) { /* Failed execution of the script */
-
- BPY_Err_Handle( textname );
- ReleaseGlobalDictionary( py_dict );
- script->py_globaldict = NULL;
- free_libblock( &G.main->script, script );
- PyGILState_Release(gilstate);
- return 0;
- } else {
- Py_DECREF( py_result );
- script->flags &= ~SCRIPT_RUNNING;
- if( !script->flags ) {
- ReleaseGlobalDictionary( py_dict );
- script->py_globaldict = NULL;
- free_libblock( &G.main->script, script );
- }
- }
-
- PyGILState_Release(gilstate);
-
- return 1; /* normal return */
-}
-
-/****************************************************************************
-* Description: Called from command line to run a Python script
-* automatically. The script can be a file or a Blender Text in the current
-* .blend.
-****************************************************************************/
-void BPY_run_python_script( const char *fn )
-{
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- Text *text = NULL;
- int is_blender_text = 0;
-
- BLI_strncpy(filename, fn, FILE_MAXDIR + FILE_MAXFILE);
-
- if (!BLI_exists(filename))
- BLI_convertstringcwd(filename);
-
- if (!BLI_exists(filename)) { /* if there's no such filename ... */
- /* try an already existing Blender Text.
- * use 'fn' rather then filename for this since were looking for
- * internal text
- */
- text = G.main->text.first;
-
- while (text) {
- if (!strcmp(fn, text->id.name + 2)) break;
- text = text->id.next;
- }
-
- if (text == NULL) {
- printf("\nError: no such file or Blender text -- %s.\n", fn);
- return;
- }
- else is_blender_text = 1; /* fn is already a Blender Text */
- }
-
- else {
- /* use filename here since we know it exists,
- * 'fn' may have been a relative path
- */
- text = add_text(filename);
-
- if (text == NULL) {
- printf("\nError in BPY_run_python_script:\n"
- "couldn't create Blender text from \"%s\"\n", filename);
- /* Chris: On Windows if I continue I just get a segmentation
- * violation. To get a baseline file I exit here. */
- exit(2);
- /* return; */
- }
- }
-
- if (BPY_txt_do_python_Text(text) != 1) {
- printf("\nError executing Python script from command-line:\n"
- "%s (at line %d).\n", fn, BPY_Err_getLinenumber());
- }
-
- if (!is_blender_text) {
- /* We can't simply free the text, since the script might have called
- * Blender.Load() to load a new .blend, freeing previous data.
- * So we check if the pointer is still valid. */
- if (BLI_findindex(&G.main->text, text) != -1) {
- free_libblock(&G.main->text, text);
- }
- }
-}
-
-int BPY_run_script(Script *script)
-{
- PyObject *py_dict, *py_res, *pyarg;
- Text *text = NULL;
- BPy_constant *info;
-
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- if (!BLI_exists(script->scriptname)) {
- /* The file dosnt exist, maybe this blend file was made on some other persons computer? */
- char fname[FILE_MAX];
- char fpath[FILE_MAX];
- char ftmp[FILE_MAX];
- char *bpyhome = bpy_gethome(1);
-
- if (bpyhome) {
- BLI_strncpy(ftmp, script->scriptname, sizeof(ftmp));
- BLI_split_dirfile_basic(ftmp, NULL, fname); /* get the filename only - fname */
- BLI_strncpy(fpath, bpy_gethome(1), sizeof(fpath));
- BLI_add_slash(fpath);
- strcat(fpath, fname);
-
- if (BLI_exists(fpath)) {
- strncpy(script->scriptname, fpath, sizeof(script->scriptname));
- } else {
- bpyhome = NULL; /* a bit dodgy, this is so the line below runs */
- }
- }
-
- if (bpyhome == NULL && U.pythondir[0]) {
- BLI_make_file_string("/", fpath, U.pythondir, fname);
- if (BLI_exists(fpath)) {
- strncpy(script->scriptname, fpath, sizeof(script->scriptname));
- }
- }
-
- /* cant find the file?, fallback to text block */
- if (!BLI_exists(script->scriptname)) {
- for (text=G.main->text.first; text; text=text->id.next) {
- if (strcmp(script->scriptname, text->id.name+2)==0) {
- break;
- }
- }
- }
- }
- if (text) {
- Py_INCREF( Py_None );
- pyarg = Py_None;
- } else {
- if (!BLI_exists(script->scriptname)) {
- printf( "Script does not exit %s\n", script->scriptname );
- free_libblock( &G.main->script, script );
- PyGILState_Release(gilstate);
- return 0;
- }
-
- if( script->scriptarg[0] == '\0' ) { /* no submenus */
- Py_INCREF( Py_None );
- pyarg = Py_None;
- } else {
- pyarg = PyString_FromString( script->scriptarg );
- }
- }
-
- script->id.us = 1;
- script->flags = SCRIPT_RUNNING;
- script->py_draw = NULL;
- script->py_event = NULL;
- script->py_button = NULL;
- script->py_browsercallback = NULL;
-
- py_dict = CreateGlobalDictionary( );
-
- script->py_globaldict = py_dict;
-
- if( !setup_armature_weakrefs()){
- printf("Oops - weakref dict\n");
- free_libblock( &G.main->script, script );
- ReleaseGlobalDictionary( py_dict );
- PyGILState_Release(gilstate);
- return 0;
- }
-
- info = ( BPy_constant * ) PyConstant_New( );
- if( info ) {
- PyConstant_Insert( info, "name",
- PyString_FromString( script->id.name + 2 ) );
- PyConstant_Insert( info, "arg", pyarg );
- EXPP_dict_set_item_str( py_dict, "__script__",
- ( PyObject * ) info );
- }
-
- if (text) {
- py_res = RunPython( text, py_dict );
- } else {
- char pystring[sizeof(script->scriptname) + 15];
- sprintf(pystring, "execfile(r'%s')", script->scriptname);
- py_res = PyRun_String( pystring, Py_file_input, py_dict, py_dict );
- }
-
- if( !py_res ) { /* Failed execution of the script */
- /* Previously we used PyRun_File to run directly the code on a FILE
- * object, but as written in the Python/C API Ref Manual, chapter 2,
- * 'FILE structs for different C libraries can be different and
- * incompatible'.
- * So now we load the script file data to a buffer */
- BPY_Err_Handle( script->id.name + 2 );
- ReleaseGlobalDictionary( py_dict );
- script->py_globaldict = NULL;
- free_libblock( &G.main->script, script );
- error_pyscript( );
-
- PyGILState_Release(gilstate);
- return 0;
- } else {
- Py_DECREF( py_res );
- script->flags &= ~SCRIPT_RUNNING;
-
- if( !script->flags ) {
- ReleaseGlobalDictionary( py_dict );
- script->py_globaldict = NULL;
- free_libblock( &G.main->script, script );
-
- /* special case: called from the menu in the Scripts window
- * we have to change sc->script pointer, since it'll be freed here.*/
- if (!G.background) {
- if( curarea->spacetype == SPACE_SCRIPT ) {
- SpaceScript *sc = curarea->spacedata.first;
- sc->script = G.main->script.first; /* can be null, which is ok ... */
- /* ... meaning no other script is running right now. */
- }
- }
-
- }
- }
-
- PyGILState_Release(gilstate);
- return 1;
-}
-
-/****************************************************************************
-* Description: This function executes the script chosen from a menu.
-* Notes: It is called by the ui code in src/header_???.c when a user
-* clicks on a menu entry that refers to a script.
-* Scripts are searched in the BPyMenuTable, using the given
-* menutype and event values to know which one was chosen.
-*****************************************************************************/
-int BPY_menu_do_python( short menutype, int event )
-{
- BPyMenu *pym;
- pym = BPyMenu_GetEntry( menutype, ( short ) event );
- return BPY_menu_invoke( pym, menutype );
-}
-
-/****************************************************************************
-* Description: This function executes the script by its shortcut.
-* Notes: It is called by the ui code in src/???.c when a user presses an
-* unassigned key combination. Scripts are searched in the BPyMenuTable,
-* using the given menutype and event values to know which one to invoke.
-*****************************************************************************/
-int BPY_menu_do_shortcut( short menutype, unsigned short key, unsigned short qual )
-{
- BPyMenu *pym;
- pym = BPyMenu_GetEntry( menutype, 0 );
-
- while ( pym ) {
- if ( pym->key && pym->key == key && pym->qual == qual ) {
- return BPY_menu_invoke( pym, menutype );
- }
- pym = pym->next;
- }
-
- return 0;
-}
-
-/****************************************************************************
-* Description: This function executes the script described by a menu item.
-*****************************************************************************/
-int BPY_menu_invoke( BPyMenu *pym, short menutype )
-{
- char *argstr = NULL;
- BPySubMenu *pysm;
- char scriptname[21];
- Script *script = NULL;
- int ret, len;
- PyGILState_STATE gilstate;
- char filestr[FILE_MAX];
-
- if( !pym )
- return 0;
-
- gilstate = PyGILState_Ensure();
-
- if( pym->version > G.version )
- notice( "Version mismatch: script was written for Blender %d. "
- "It may fail with yours: %d.", pym->version,
- G.version );
-
-/* if there are submenus, let the user choose one from a pupmenu that we
- * create here.*/
- pysm = pym->submenus;
- if( pysm ) {
- char *pupstr;
- int arg;
-
- pupstr = BPyMenu_CreatePupmenuStr( pym, menutype );
-
- if( pupstr ) {
- arg = pupmenu( pupstr );
- MEM_freeN( pupstr );
-
- if( arg >= 0 ) {
- while( arg-- )
- pysm = pysm->next;
- argstr = pysm->arg;
- } else {
- PyGILState_Release(gilstate);
- return 0;
- }
- }
- }
-
- if( pym->dir ) { /* script is in U.pythondir */
- char upythondir[FILE_MAX];
-
- /* dirs in Blender can be "//", which has a special meaning */
- BLI_strncpy(upythondir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upythondir, G.sce); /* if so, this expands it */
- BLI_make_file_string( "/", filestr, upythondir, pym->filename );
- }
- else { /* script is in default scripts dir */
- char *scriptsdir = bpy_gethome(1);
-
- if (!scriptsdir) {
- printf("Error loading script: can't find default scripts dir!");
- PyGILState_Release(gilstate);
- return 0;
- }
-
- BLI_make_file_string( "/", filestr, scriptsdir, pym->filename );
- }
-
- BLI_strncpy(scriptname, pym->name, 21);
- len = strlen(scriptname) - 1;
- /* by convention, scripts that open the file browser or have submenus
- * display '...'. Here we remove them from the datablock name */
- while ((len > 0) && scriptname[len] == '.') {
- scriptname[len] = '\0';
- len--;
- }
-
- /* Create a new script structure and initialize it: */
- script = alloc_libblock( &G.main->script, ID_SCRIPT, scriptname );
-
- if( !script ) {
- printf( "couldn't allocate memory for Script struct!" );
- PyGILState_Release(gilstate);
- return 0;
- }
-
- /* let's find a proper area for an eventual script gui:
- * (still experimenting here, need definition on which win
- * each group will be put to code this properly) */
- switch ( menutype ) {
-
- case PYMENU_IMPORT: /* first 4 were handled in header_info.c */
- case PYMENU_EXPORT:
- case PYMENU_HELP:
- case PYMENU_RENDER:
- case PYMENU_WIZARDS:
- case PYMENU_SCRIPTTEMPLATE:
- case PYMENU_TEXTPLUGIN:
- case PYMENU_MESHFACEKEY:
- break;
-
- default:
- if( curarea->spacetype != SPACE_SCRIPT ) {
- ScrArea *sa = NULL;
-
- sa = find_biggest_area_of_type( SPACE_BUTS );
- if( sa ) {
- if( ( 1.5 * sa->winx ) < sa->winy )
- sa = NULL; /* too narrow? */
- }
-
- if( !sa )
- sa = find_biggest_area_of_type( SPACE_SCRIPT );
- if( !sa )
- sa = find_biggest_area_of_type( SPACE_TEXT );
- if( !sa )
- sa = find_biggest_area_of_type( SPACE_IMAGE ); /* group UV */
- if( !sa )
- sa = find_biggest_area_of_type( SPACE_VIEW3D );
-
- if( !sa )
- sa = find_biggest_area( );
-
- areawinset( sa->win );
- }
- break;
- }
-
- strncpy(script->scriptname, filestr, sizeof(script->scriptname));
- if (argstr!=NULL && argstr[0] != '\0')
- strncpy(script->scriptarg, argstr, sizeof(script->scriptarg));
-
- ret = BPY_run_script(script);
-
- return 1; /* normal return */
-}
-
-/*****************************************************************************
-* Description:
-* Notes:
-*****************************************************************************/
-void BPY_free_compiled_text( struct Text *text )
-{
- if( text->compiled ) {
- Py_DECREF( ( PyObject * ) text->compiled );
- text->compiled = NULL;
- }
-}
-
-/*****************************************************************************
-* Description: This function frees a finished (flags == 0) script.
-*****************************************************************************/
-void BPY_free_finished_script( Script * script )
-{
- PyGILState_STATE gilstate;
-
- if( !script )
- return;
-
- gilstate = PyGILState_Ensure();
-
- if( PyErr_Occurred( ) ) { /* if script ended after filesel */
- PyErr_Print( ); /* eventual errors are handled now */
- error_pyscript( );
- }
-
- PyGILState_Release(gilstate);
-
- free_libblock( &G.main->script, script );
- return;
-}
-
-static void unlink_script( Script * script )
-{ /* copied from unlink_text in drawtext.c */
- bScreen *scr;
- ScrArea *area;
- SpaceLink *sl;
-
- for( scr = G.main->screen.first; scr; scr = scr->id.next ) {
- for( area = scr->areabase.first; area; area = area->next ) {
- for( sl = area->spacedata.first; sl; sl = sl->next ) {
- if( sl->spacetype == SPACE_SCRIPT ) {
- SpaceScript *sc = ( SpaceScript * ) sl;
-
- if( sc->script == script ) {
- sc->script = NULL;
-
- if( sc == area->spacedata.first ) {
- scrarea_queue_redraw( area );
- }
-
- if (sc->but_refs) {
- BPy_Set_DrawButtonsList(sc->but_refs);
- BPy_Free_DrawButtonsList();
- sc->but_refs = NULL;
- }
- }
- }
- }
- }
- }
-}
-
-/* This is called from free_libblock( &G.main->script, script ); */
-void BPY_clear_script( Script * script )
-{
- PyObject *dict;
- PyGILState_STATE gilstate;
-
- if( !script )
- return;
-
- gilstate = PyGILState_Ensure();
-
- if (!Py_IsInitialized()) {
- printf("\nError: trying to free script data after finalizing Python!");
- printf("\nScript name: %s\n", script->id.name+2);
- PyGILState_Release(gilstate);
- return;
- }
-
- Py_XDECREF( ( PyObject * ) script->py_draw );
- Py_XDECREF( ( PyObject * ) script->py_event );
- Py_XDECREF( ( PyObject * ) script->py_button );
- Py_XDECREF( ( PyObject * ) script->py_browsercallback );
- script->py_draw = NULL;
- script->py_event = NULL;
- script->py_button = NULL;
- script->py_browsercallback = NULL;
- script->scriptname[0] = '\0';
- script->scriptarg[0] = '\0';
-
- dict = script->py_globaldict;
-
- if( dict ) {
- PyDict_Clear( dict );
- Py_DECREF( dict ); /* Release dictionary. */
- script->py_globaldict = NULL;
- }
-
- PyGILState_Release(gilstate);
-
- unlink_script( script );
-}
-
-/* PyDrivers */
-
-/* PyDrivers are Ipo Drivers governed by expressions written in Python.
- * Expressions here are one-liners that evaluate to a float value. */
-
-/* For faster execution we keep a special dictionary for pydrivers, with
- * the needed modules and aliases. */
-static int bpy_pydriver_create_dict(void)
-{
- PyObject *d, *mod;
-
- if (bpy_pydriver_Dict) return -1;
-
- d = PyDict_New();
- if (!d) return -1;
-
- bpy_pydriver_Dict = d;
-
- /* import some modules: builtins, Blender, math, Blender.noise */
-
- PyDict_SetItemString(d, "__builtins__", PyEval_GetBuiltins());
-
- mod = PyImport_ImportModule("Blender");
- if (mod) {
- PyDict_SetItemString(d, "Blender", mod);
- PyDict_SetItemString(d, "b", mod);
- Py_DECREF(mod);
- } else {
- PyErr_Clear();
- }
-
- mod = PyImport_ImportModule("math");
- if (mod) {
- PyDict_Merge(d, PyModule_GetDict(mod), 0); /* 0 - dont overwrite existing values */
-
- /* Only keep for backwards compat! - just import all math into root, they are standard */
- PyDict_SetItemString(d, "math", mod);
- PyDict_SetItemString(d, "m", mod);
- Py_DECREF(mod);
- }
-
- mod = PyImport_ImportModule("Blender.Noise");
- if (mod) {
- PyDict_SetItemString(d, "noise", mod);
- PyDict_SetItemString(d, "n", mod);
- Py_DECREF(mod);
- } else {
- PyErr_Clear();
- }
-
- /* If there's a Blender text called pydrivers.py, import it.
- * Users can add their own functions to this module. */
- if (G.f&G_DOSCRIPTLINKS) {
- mod = importText("pydrivers"); /* can also use PyImport_Import() */
- if (mod) {
- PyDict_SetItemString(d, "pydrivers", mod);
- PyDict_SetItemString(d, "p", mod);
- Py_DECREF(mod);
- } else {
- PyErr_Clear();
- }
- }
- /* short aliases for some Get() functions: */
-
- /* ob(obname) == Blender.Object.Get(obname) */
- mod = PyImport_ImportModule("Blender.Object");
- if (mod) {
- PyObject *fcn = PyObject_GetAttrString(mod, "Get");
- Py_DECREF(mod);
- if (fcn) {
- PyDict_SetItemString(d, "ob", fcn);
- Py_DECREF(fcn);
- }
- } else {
- PyErr_Clear();
- }
-
- /* TODO - change these */
- /* me(meshname) == Blender.Mesh.Get(meshname) */
- mod = PyImport_ImportModule("Blender.Mesh");
- if (mod) {
- PyObject *fcn = PyObject_GetAttrString(mod, "Get");
- Py_DECREF(mod);
- if (fcn) {
- PyDict_SetItemString(d, "me", fcn);
- Py_DECREF(fcn);
- }
- } else {
- PyErr_Clear();
- }
-
- /* ma(matname) == Blender.Material.Get(matname) */
- mod = PyImport_ImportModule("Blender.Material");
- if (mod) {
- PyObject *fcn = PyObject_GetAttrString(mod, "Get");
- Py_DECREF(mod);
- if (fcn) {
- PyDict_SetItemString(d, "ma", fcn);
- Py_DECREF(fcn);
- }
- } else {
- PyErr_Clear();
- }
-
- return 0;
-}
-
-/* error return function for BPY_eval_pydriver */
-static float pydriver_error(IpoDriver *driver) {
-
- if (bpy_pydriver_oblist)
- bpy_pydriver_freeList();
-
- if (bpy_pydriver_Dict) { /* free the global dict used by pydrivers */
- PyDict_Clear(bpy_pydriver_Dict);
- Py_DECREF(bpy_pydriver_Dict);
- bpy_pydriver_Dict = NULL;
- }
-
- driver->flag |= IPO_DRIVER_FLAG_INVALID; /* py expression failed */
-
- if (driver->ob)
- fprintf(stderr, "\nError in Ipo Driver: Object %s\nThis is the failed Python expression:\n'%s'\n\n", driver->ob->id.name+2, driver->name);
- else
- fprintf(stderr, "\nError in Ipo Driver: No Object\nThis is the failed Python expression:\n'%s'\n\n", driver->name);
-
- PyErr_Print();
-
- return 0.0f;
-}
-
-
-/********PyConstraints*********/
-
-/* This function checks whether a text-buffer is a PyConstraint candidate.
- * It uses simple text parsing that could be easily confused!
- */
-int BPY_is_pyconstraint(Text *text)
-{
- TextLine *tline = text->lines.first;
-
- if (tline && (tline->len > 10)) {
- char *line = tline->line;
-
- /* Expected format: #BPYCONSTRAINT
- * The actual checks are forgiving, so slight variations also work. */
- if (line && line[0] == '#' && strstr(line, "BPYCONSTRAINT")) return 1;
- }
- return 0;
-}
-
-/* This function frees links from pyconstraints to a given text-buffer.
- * Used when a text-buffer is unlinked!
- */
-void BPY_free_pyconstraint_links(Text *text)
-{
- Object *ob;
- bConstraint *con;
- short update;
-
- /*check all pyconstraints*/
- for (ob=G.main->object.first; ob; ob=ob->id.next) {
- update = 0;
- if(ob->type==OB_ARMATURE && ob->pose) {
- bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- for (con = pchan->constraints.first; con; con=con->next) {
- if (con->type==CONSTRAINT_TYPE_PYTHON) {
- bPythonConstraint *data = con->data;
- if (data->text==text) data->text = NULL;
- update = 1;
-
- }
- }
- }
- }
- for (con = ob->constraints.first; con; con=con->next) {
- if (con->type==CONSTRAINT_TYPE_PYTHON) {
- bPythonConstraint *data = con->data;
- if (data->text==text) data->text = NULL;
- update = 1;
- }
- }
-
- if (update) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
-}
-
-/* This function is called to update PyConstraint data so that it is compatible with the script.
- * Some of the allocating/freeing of memory for constraint targets occurs here, espcially
- * if the number of targets changes.
- */
-void BPY_pyconstraint_update(Object *owner, bConstraint *con)
-{
- bPythonConstraint *data= con->data;
-
- if (data->text) {
- /* script does exist. it is assumed that this is a valid pyconstraint script */
- PyObject *globals;
- PyObject *retval, *gval;
- PyGILState_STATE gilstate;
- int num, i;
-
- /* clear the relevant flags first */
- data->flag = 0;
-
- gilstate = PyGILState_Ensure();
-
- /* populate globals dictionary */
- globals = CreateGlobalDictionary();
- retval = RunPython(data->text, globals);
-
- if (retval == NULL) {
- BPY_Err_Handle(data->text->id.name);
- ReleaseGlobalDictionary(globals);
- data->flag |= PYCON_SCRIPTERROR;
- PyGILState_Release(gilstate);
- return;
- }
-
- Py_XDECREF(retval);
- retval = NULL;
-
- /* try to find NUM_TARGETS */
- gval = PyDict_GetItemString(globals, "NUM_TARGETS");
- if ( (gval) && (num= PyInt_AsLong(gval)) ) {
- /* NUM_TARGETS is defined... and non-zero */
- bConstraintTarget *ct;
-
- /* check if it is valid (just make sure it is not negative)
- * TODO: PyInt_AsLong may return -1 as sign of invalid input...
- */
- num = abs(num);
- data->flag |= PYCON_USETARGETS;
-
- /* check if the number of targets has changed */
- if (num < data->tarnum) {
- /* free a few targets */
- num= data->tarnum - num;
- for (i = 0; i < num; i++, data->tarnum--) {
- ct= data->targets.last;
- BLI_freelinkN(&data->targets, ct);
- }
- }
- else if (num > data->tarnum) {
- /* add a few targets */
- num = num - data->tarnum;
- for (i = 0; i < num; i++, data->tarnum++) {
- ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
- BLI_addtail(&data->targets, ct);
- }
- }
-
- /* validate targets */
- con->flag &= ~CONSTRAINT_DISABLE;
- for (ct= data->targets.first; ct; ct= ct->next) {
- if (!exist_object(ct->tar)) {
- ct->tar = NULL;
- con->flag |= CONSTRAINT_DISABLE;
- break;
- }
-
- if ((ct->tar == owner) && (ct->subtarget[0] != 0)) {
- if (get_named_bone(get_armature(owner), ct->subtarget) == NULL) {
- con->flag |= CONSTRAINT_DISABLE;
- break;
- }
- }
- }
-
- /* clear globals */
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
- else {
- /* NUM_TARGETS is not defined or equals 0 */
- ReleaseGlobalDictionary(globals);
-
- /* free all targets */
- BLI_freelistN(&data->targets);
- data->tarnum = 0;
- data->flag &= ~PYCON_USETARGETS;
-
- PyGILState_Release(gilstate);
-
- return;
- }
- }
- else {
- /* no script, so clear any settings/data now */
- data->tarnum = 0;
- data->flag = 0;
- con->flag &= ~CONSTRAINT_DISABLE;
-
- BLI_freelistN(&data->targets);
-
- /* supposedly this should still leave the base struct... */
- IDP_FreeProperty(data->prop);
- }
-}
-
-/* PyConstraints Evaluation Function (only called from evaluate_constraint)
- * This function is responsible for modifying the ownermat that it is passed.
- */
-void BPY_pyconstraint_eval(bPythonConstraint *con, bConstraintOb *cob, ListBase *targets)
-{
- PyObject *srcmat, *tarmat, *tarmats, *idprop;
- PyObject *globals;
- PyObject *gval;
- PyObject *pyargs, *retval;
- bConstraintTarget *ct;
- MatrixObject *retmat;
- int row, col, index;
- PyGILState_STATE gilstate;
-
- if (!con->text) return;
- if (con->flag & PYCON_SCRIPTERROR) return;
-
- gilstate = PyGILState_Ensure();
-
- globals = CreateGlobalDictionary();
-
- /* wrap blender-data as PyObjects for evaluation
- * - we expose the owner's matrix as pymatrix
- * - id-properties are wrapped using the id-properties pyapi
- * - targets are presented as a list of matrices
- */
- srcmat = newMatrixObject((float *)cob->matrix, 4, 4, Py_NEW);
- idprop = BPy_Wrap_IDProperty(NULL, con->prop, NULL);
-
- tarmats= PyList_New(con->tarnum);
- for (ct=targets->first, index=0; ct; ct=ct->next, index++) {
- tarmat = newMatrixObject((float *)ct->matrix, 4, 4, Py_NEW);
- PyList_SET_ITEM(tarmats, index, tarmat);
- }
-
- if (!setup_armature_weakrefs()) {
- fprintf(stderr, "Oops - weakref dict setup\n");
- PyGILState_Release(gilstate);
-
- return;
- }
-
- retval = RunPython(con->text, globals);
-
- if (retval == NULL) {
- BPY_Err_Handle(con->text->id.name);
- con->flag |= PYCON_SCRIPTERROR;
-
- /* free temp objects */
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (retval) {Py_XDECREF( retval );}
- retval = NULL;
-
- gval = PyDict_GetItemString(globals, "doConstraint");
- if (!gval) {
- printf("ERROR: no doConstraint function in constraint!\n");
-
- /* free temp objects */
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- /* Now for the fun part! Try and find the functions we need. */
- if (PyFunction_Check(gval)) {
- pyargs = Py_BuildValue("OOO", srcmat, tarmats, idprop);
- retval = PyObject_CallObject(gval, pyargs);
- Py_XDECREF(pyargs);
- }
- else {
- printf("ERROR: doConstraint is supposed to be a function!\n");
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (!retval) {
- BPY_Err_Handle(con->text->id.name);
- con->flag |= PYCON_SCRIPTERROR;
-
- /* free temp objects */
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
-
- if (!PyObject_TypeCheck(retval, &matrix_Type)) {
- printf("Error in PyConstraint - doConstraint: Function not returning a matrix!\n");
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
- Py_XDECREF(retval);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- retmat = (MatrixObject *)retval;
- if (retmat->rowSize != 4 || retmat->colSize != 4) {
- printf("Error in PyConstraint - doConstraint: Matrix returned is the wrong size!\n");
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
- Py_XDECREF(retval);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- /* this is the reverse of code taken from newMatrix() */
- for(row = 0; row < 4; row++) {
- for(col = 0; col < 4; col++) {
- cob->matrix[row][col] = retmat->contigPtr[row*4+col];
- }
- }
-
- /* free temp objects */
- Py_XDECREF(idprop);
- Py_XDECREF(srcmat);
- Py_XDECREF(tarmats);
- Py_XDECREF(retval);
-
- /* clear globals */
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-}
-
-/* This evaluates the target matrix for each target the PyConstraint uses.
- * NOTE: it only does one target at a time!
- */
-void BPY_pyconstraint_target(bPythonConstraint *con, bConstraintTarget *ct)
-{
- PyObject *tar, *subtar;
- PyObject *tarmat, *idprop;
- PyObject *globals;
- PyObject *gval;
- PyObject *pyargs, *retval;
- MatrixObject *retmat;
- int row, col;
- PyGILState_STATE gilstate;
-
- if (!con->text) return;
- if (con->flag & PYCON_SCRIPTERROR) return;
- if (!ct) return;
-
- gilstate = PyGILState_Ensure();
-
- globals = CreateGlobalDictionary();
-
- tar = Object_CreatePyObject(ct->tar);
- if ((ct->tar) && (ct->tar->type==OB_ARMATURE)) {
- bPoseChannel *pchan;
- pchan = get_pose_channel(ct->tar->pose, ct->subtarget);
- subtar = PyPoseBone_FromPosechannel(pchan);
- }
- else
- subtar = PyString_FromString(ct->subtarget);
-
- tarmat = newMatrixObject((float *)ct->matrix, 4, 4, Py_NEW);
- idprop = BPy_Wrap_IDProperty( NULL, con->prop, NULL);
-
- if (!setup_armature_weakrefs()) {
- fprintf(stderr, "Oops - weakref dict setup\n");
- PyGILState_Release(gilstate);
- return;
- }
-
- retval = RunPython(con->text, globals);
-
- if (retval == NULL) {
- BPY_Err_Handle(con->text->id.name);
- con->flag |= PYCON_SCRIPTERROR;
-
- /* free temp objects */
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- Py_XDECREF(retval);
- retval = NULL;
-
- /* try to find doTarget function to set the target matrix */
- gval = PyDict_GetItemString(globals, "doTarget");
- if (!gval) {
- /* free temp objects */
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- /* Now for the fun part! Try and find the functions we need.*/
- if (PyFunction_Check(gval)) {
- pyargs = Py_BuildValue("OOOO", tar, subtar, tarmat, idprop);
- retval = PyObject_CallObject(gval, pyargs);
- Py_XDECREF(pyargs);
- }
- else {
- printf("ERROR: doTarget is supposed to be a function!\n");
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (!retval) {
- BPY_Err_Handle(con->text->id.name);
- con->flag |= PYCON_SCRIPTERROR;
-
-
- /* free temp objects */
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (!PyObject_TypeCheck(retval, &matrix_Type)) {
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
- Py_XDECREF(retval);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- retmat = (MatrixObject *)retval;
- if (retmat->rowSize != 4 || retmat->colSize != 4) {
- printf("Error in PyConstraint - doTarget: Matrix returned is the wrong size!\n");
- con->flag |= PYCON_SCRIPTERROR;
-
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
- Py_XDECREF(retval);
-
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- /* this is the reverse of code taken from newMatrix() */
- for(row = 0; row < 4; row++) {
- for(col = 0; col < 4; col++) {
- ct->matrix[row][col] = retmat->contigPtr[row*4+col];
- }
- }
-
- /* free temp objects */
- Py_XDECREF(tar);
- Py_XDECREF(subtar);
- Py_XDECREF(idprop);
- Py_XDECREF(tarmat);
- Py_XDECREF(retval);
-
- /* clear globals */
- ReleaseGlobalDictionary(globals);
-
- PyGILState_Release(gilstate);
-}
-
-/* This draws+handles the user-defined interface for editing pyconstraints idprops */
-void BPY_pyconstraint_settings(void *arg1, void *arg2)
-{
- bPythonConstraint *con= (bPythonConstraint *)arg1;
- PyObject *idprop;
- PyObject *globals;
- PyObject *gval;
- PyObject *retval;
- PyGILState_STATE gilstate;
-
- if (!con->text) return;
- if (con->flag & PYCON_SCRIPTERROR) return;
-
- gilstate = PyGILState_Ensure();
-
- globals = CreateGlobalDictionary();
-
- idprop = BPy_Wrap_IDProperty( NULL, con->prop, NULL);
-
- retval = RunPython(con->text, globals);
-
- if (retval == NULL) {
- BPY_Err_Handle(con->text->id.name);
- ReleaseGlobalDictionary(globals);
- con->flag |= PYCON_SCRIPTERROR;
-
- /* free temp objects */
- Py_XDECREF(idprop);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (retval) {Py_XDECREF( retval );}
- retval = NULL;
-
- gval = PyDict_GetItemString(globals, "getSettings");
- if (!gval) {
- printf("ERROR: no getSettings function in constraint!\n");
-
- /* free temp objects */
- ReleaseGlobalDictionary( globals );
- Py_XDECREF(idprop);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- /* Now for the fun part! Try and find the functions we need. */
- if (PyFunction_Check(gval)) {
- retval = PyObject_CallFunction(gval, "O", idprop);
- }
- else {
- printf("ERROR: getSettings is supposed to be a function!\n");
- ReleaseGlobalDictionary( globals );
-
- Py_XDECREF(idprop);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (!retval) {
- BPY_Err_Handle(con->text->id.name);
- con->flag |= PYCON_SCRIPTERROR;
-
- /* free temp objects */
- ReleaseGlobalDictionary(globals);
- Py_XDECREF(idprop);
-
- PyGILState_Release(gilstate);
-
- return;
- }
- else {
- /* clear globals */
- ReleaseGlobalDictionary(globals);
-
- /* free temp objects */
- Py_XDECREF(idprop);
- Py_DECREF(retval);
-
- PyGILState_Release(gilstate);
-
- return;
- }
-}
-
-/* Update function, it gets rid of pydrivers global dictionary, forcing
- * BPY_pydriver_eval to recreate it. This function is used to force
- * reloading the Blender text module "pydrivers.py", if available, so
- * updates in it reach pydriver evaluation. */
-void BPY_pydriver_update(void)
-{
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- if (bpy_pydriver_Dict) { /* free the global dict used by pydrivers */
- PyDict_Clear(bpy_pydriver_Dict);
- Py_DECREF(bpy_pydriver_Dict);
- bpy_pydriver_Dict = NULL;
- }
-
- PyGILState_Release(gilstate);
-
- return;
-}
-
-/* for depsgraph.c, runs py expr once to collect all refs. made
- * to objects (self refs. to the object that owns the py driver
- * are not allowed). */
-struct Object **BPY_pydriver_get_objects(IpoDriver *driver)
-{
- /*if (!driver || !driver->ob || driver->name[0] == '\0')
- return NULL;*/
-
- /*PyErr_Clear();*/
-
- /* clear the flag that marks invalid python expressions */
- driver->flag &= ~IPO_DRIVER_FLAG_INVALID;
-
- /* tell we're running a pydriver, so Get() functions know they need
- * to add the requested obj to our list */
- bpy_pydriver_running(1);
-
- /* append driver owner object as the 1st ob in the list;
- * we put it there to make sure it is not itself referenced in
- * its pydriver expression */
- bpy_pydriver_appendToList(driver->ob);
-
- /* this will append any other ob referenced in expr (driver->name)
- * or set the driver's error flag if driver's py expression fails */
- BPY_pydriver_eval(driver);
-
- bpy_pydriver_running(0); /* ok, we're done */
-
- return bpy_pydriver_obArrayFromList(); /* NULL if eval failed */
-}
-
-/* This evals py driver expressions, 'expr' is a Python expression that
- * should evaluate to a float number, which is returned. */
-float BPY_pydriver_eval(IpoDriver *driver)
-{
- char *expr = NULL;
- PyObject *retval, *bpy_ob = NULL;
- float result = 0.0f; /* default return */
- int setitem_retval;
- PyGILState_STATE gilstate;
-
- if (!driver || (G.f&G_DOSCRIPTLINKS)==0) return result;
-
- expr = driver->name; /* the py expression to be evaluated */
- if (!expr || expr[0]=='\0') return result;
-
- gilstate = PyGILState_Ensure();
-
- if (!bpy_pydriver_Dict) {
- if (bpy_pydriver_create_dict() != 0) {
- fprintf(stderr, "Pydriver error: couldn't create Python dictionary");
- PyGILState_Release(gilstate);
- return result;
- }
- }
-
- if (driver->ob)
- bpy_ob = Object_CreatePyObject(driver->ob);
-
- if (!bpy_ob) {
- Py_INCREF(Py_None);
- bpy_ob = Py_None;
- }
-
- setitem_retval = EXPP_dict_set_item_str(bpy_pydriver_Dict, "self", bpy_ob);
-
- if( !setup_armature_weakrefs()){
- fprintf( stderr, "Oops - weakref dict setup\n");
- PyGILState_Release(gilstate);
- return result;
- }
-
- retval = PyRun_String(expr, Py_eval_input, bpy_pydriver_Dict,
- bpy_pydriver_Dict);
-
- if (retval == NULL) {
- result = pydriver_error(driver);
- PyGILState_Release(gilstate);
- return result;
- }
-
- result = ( float )PyFloat_AsDouble( retval );
- Py_DECREF(retval);
-
- if (result == -1 && PyErr_Occurred()) {
- result = pydriver_error(driver);
- PyGILState_Release(gilstate);
- return result;
- }
-
- /* remove 'self', since this dict is also used by py buttons */
- if (setitem_retval == 0) PyDict_DelItemString(bpy_pydriver_Dict, "self");
-
- /* all fine, make sure the "invalid expression" flag is cleared */
- driver->flag &= ~IPO_DRIVER_FLAG_INVALID;
-
- PyGILState_Release(gilstate);
-
- return result;
-}
-
-/* Button Python Evaluation */
-
-/* Python evaluation for gui buttons:
- * users can write any valid Python expression (that evals to an int or float)
- * inside Blender's gui number buttons and have them evaluated to their
- * actual int or float value.
- *
- * The global dict used for pydrivers is also used here, so all imported
- * modules for pydrivers (including the pydrivers.py Blender text) are
- * available for button py eval, too. */
-
-static int bpy_button_eval_error(char *expr) {
-
- if (bpy_pydriver_oblist)
- bpy_pydriver_freeList();
-
- if (bpy_pydriver_Dict) { /* free the persistent global dict */
- /* it's the same dict used by pydrivers */
- PyDict_Clear(bpy_pydriver_Dict);
- Py_DECREF(bpy_pydriver_Dict);
- bpy_pydriver_Dict = NULL;
- }
-
- fprintf(stderr, "\nError in button evaluation:\nThis is the failed Python expression:\n'%s'\n\n", expr);
-
- PyErr_Print();
-
- return -1;
-}
-
-int BPY_button_eval(char *expr, double *value)
-{
- PyObject *retval, *floatval;
- PyGILState_STATE gilstate;
- int ret;
-
- if (!value || !expr || expr[0]=='\0') return -1;
-
- *value = 0.0; /* default value */
-
- gilstate = PyGILState_Ensure();
-
- if (!bpy_pydriver_Dict) {
- if (bpy_pydriver_create_dict() != 0) {
- fprintf(stderr,
- "Button Python Eval error: couldn't create Python dictionary \n");
- PyGILState_Release(gilstate);
- return -1;
- }
- }
-
-
- if( !setup_armature_weakrefs()){
- fprintf(stderr, "Oops - weakref dict\n");
- PyGILState_Release(gilstate);
- return -1;
- }
-
- retval = PyRun_String(expr, Py_eval_input, bpy_pydriver_Dict,
- bpy_pydriver_Dict);
-
- if (retval == NULL) {
- ret = bpy_button_eval_error(expr);
- PyGILState_Release(gilstate);
- return ret;
- }
- else {
- floatval = PyNumber_Float(retval);
- Py_DECREF(retval);
- }
-
- if (floatval == NULL) {
- ret = bpy_button_eval_error(expr);
- PyGILState_Release(gilstate);
- return ret;
- } else {
- *value = (float)PyFloat_AsDouble(floatval);
- Py_DECREF(floatval);
- }
-
- PyGILState_Release(gilstate);
-
- return 0; /* successful exit */
-}
-
-
-/*****************************************************************************/
-/* ScriptLinks */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Description: */
-/* Notes: Not implemented yet */
-/*****************************************************************************/
-void BPY_clear_bad_scriptlinks( struct Text *byebye )
-{
-/*
- BPY_clear_bad_scriptlist(getObjectList(), byebye);
- BPY_clear_bad_scriptlist(getLampList(), byebye);
- BPY_clear_bad_scriptlist(getCameraList(), byebye);
- BPY_clear_bad_scriptlist(getMaterialList(), byebye);
- BPY_clear_bad_scriptlist(getWorldList(), byebye);
- BPY_clear_bad_scriptlink(&scene_getCurrent()->id, byebye);
-
- allqueue(REDRAWBUTSSCRIPT, 0);
-*/
- return;
-}
-
-/*****************************************************************************
-* Description: Loop through all scripts of a list of object types, and
-* execute these scripts.
-* For the scene, only the current active scene the scripts are
-* executed (if any).
-*****************************************************************************/
-void BPY_do_all_scripts( short event, short anim )
-{
- /* during stills rendering we disable FRAMECHANGED events */
- static char disable_frame_changed = 0;
-
- if ((event == SCRIPT_FRAMECHANGED) && disable_frame_changed)
- return;
-
- DoAllScriptsFromList( &( G.main->object ), event );
- DoAllScriptsFromList( &( G.main->lamp ), event );
- DoAllScriptsFromList( &( G.main->camera ), event );
- DoAllScriptsFromList( &( G.main->mat ), event );
- DoAllScriptsFromList( &( G.main->world ), event );
-
- BPY_do_pyscript( &( G.scene->id ), event );
-
- /* Don't allow the Python Interpreter to release the GIL on
- * its own, to guarantee PyNodes work properly. For Blender this
- * is currently the best default behavior.
- * The following code in C is equivalent in Python to:
- * "import sys; sys.setcheckinterval(sys.maxint)" */
- if (event == SCRIPT_RENDER) {
- _Py_CheckInterval = PyInt_GetMax();
- if (!anim)
- disable_frame_changed = 1;
- }
- else if (event == SCRIPT_POSTRENDER) {
- _Py_CheckInterval = 100; /* Python default */
- disable_frame_changed = 0;
- }
-
- return;
-}
-
-/*****************************************************************************
-* Description: Execute a Python script when an event occurs. The following
-* events are possible: frame changed, load script and redraw.
-* Only events happening to one of the following object types
-* are handled: Object, Lamp, Camera, Material, World and
-* Scene.
-*****************************************************************************/
-
-static ScriptLink *ID_getScriptlink( ID * id )
-{
- switch ( MAKE_ID2( id->name[0], id->name[1] ) ) {
- case ID_OB:
- return &( ( Object * ) id )->scriptlink;
- case ID_LA:
- return &( ( Lamp * ) id )->scriptlink;
- case ID_CA:
- return &( ( Camera * ) id )->scriptlink;
- case ID_MA:
- return &( ( Material * ) id )->scriptlink;
- case ID_WO:
- return &( ( World * ) id )->scriptlink;
- case ID_SCE:
- return &( ( Scene * ) id )->scriptlink;
- default:
- return NULL;
- }
-}
-
-int BPY_has_onload_script( void )
-{
- ScriptLink *slink = &G.scene->scriptlink;
- int i;
-
- if( !slink || !slink->totscript )
- return 0;
-
- for( i = 0; i < slink->totscript; i++ ) {
- if( ( slink->flag[i] == SCRIPT_ONLOAD )
- && ( slink->scripts[i] != NULL ) )
- return 1;
- }
-
- return 0;
-}
-
-void BPY_do_pyscript( ID * id, short event )
-{
- ScriptLink *scriptlink;
-
- if( !id ) return;
-
- scriptlink = ID_getScriptlink( id );
-
- if( scriptlink && scriptlink->totscript ) {
- PyObject *value;
- PyObject *dict;
- PyObject *ret;
- int index, during_slink = during_scriptlink( );
- PyGILState_STATE gilstate;
-
- /* invalid scriptlinks (new .blend was just loaded), return */
- if( during_slink < 0 )
- return;
-
- gilstate = PyGILState_Ensure();
-
- if( !setup_armature_weakrefs()){
- printf("Oops - weakref dict, this is a bug\n");
- PyGILState_Release(gilstate);
- return;
- }
-
- value = GetPyObjectFromID( id );
- if( !value){
- printf("Oops - could not get a valid python object for Blender.link, this is a bug\n");
- PyGILState_Release(gilstate);
- return;
- }
-
- /* tell we're running a scriptlink. The sum also tells if this
- * script is running nested inside another. Blender.Load needs
- * this info to avoid trouble with invalid slink pointers. */
- during_slink++;
- disable_where_scriptlink( (short)during_slink );
-
- /* set globals in Blender module to identify scriptlink */
- PyDict_SetItemString( g_blenderdict, "bylink", Py_True);
- EXPP_dict_set_item_str( g_blenderdict, "link", value );
- EXPP_dict_set_item_str( g_blenderdict, "event",
- PyString_FromString( event_to_name
- ( event ) ) );
- if (event == SCRIPT_POSTRENDER) event = SCRIPT_RENDER;
-
- for( index = 0; index < scriptlink->totscript; index++ ) {
- if( ( scriptlink->flag[index] == event ) &&
- ( scriptlink->scripts[index] != NULL ) ) {
- dict = CreateGlobalDictionary( );
- ret = RunPython( ( Text * ) scriptlink->
- scripts[index], dict );
- ReleaseGlobalDictionary( dict );
-
- if( !ret ) {
- /* Failed execution of the script */
- BPY_Err_Handle( scriptlink->
- scripts[index]->name +
- 2 );
- //BPY_end_python ();
- //BPY_start_python ();
- } else {
- Py_DECREF( ret );
- }
- /* If a scriptlink has just loaded a new .blend file, the
- * scriptlink pointer became invalid (see api2_2x/Blender.c),
- * so we stop here. */
- if( during_scriptlink( ) == -1 ) {
- during_slink = 1;
- break;
- }
- }
- }
-
- disable_where_scriptlink( (short)(during_slink - 1) );
-
- /* cleanup bylink flag and clear link so PyObject
- * can be released
- */
- PyDict_SetItemString(g_blenderdict, "bylink", Py_False);
- PyDict_SetItemString( g_blenderdict, "link", Py_None );
- EXPP_dict_set_item_str( g_blenderdict, "event", PyString_FromString( "" ) );
-
- PyGILState_Release(gilstate);
- }
-}
-
-
-/* SPACE HANDLERS */
-
-/* These are special script links that can be assigned to ScrArea's to
- * (EVENT type) receive events sent to a given space (and use or ignore them) or
- * (DRAW type) be called after the space is drawn, to draw anything on top of
- * the space area. */
-
-/* How to add space handlers to other spaces:
- * - add the space event defines to DNA_scriptlink_types.h, as done for
- * 3d view: SPACEHANDLER_VIEW3D_EVENT, for example;
- * - add the new defines to Blender.SpaceHandler dictionary in Blender.c;
- * - check space.c for how to call the event handlers;
- * - check drawview.c for how to call the draw handlers;
- * - check header_view3d.c for how to add the "Space Handler Scripts" menu.
- * Note: DRAW handlers should be called with 'event = 0', chech drawview.c */
-
-int BPY_has_spacehandler(Text *text, ScrArea *sa)
-{
- ScriptLink *slink;
- int index;
-
- if (!sa || !text) return 0;
-
- slink = &sa->scriptlink;
-
- for (index = 0; index < slink->totscript; index++) {
- if (slink->scripts[index] && (slink->scripts[index] == (ID *)text))
- return 1;
- }
-
- return 0;
-}
-
-int BPY_is_spacehandler(Text *text, char spacetype)
-{
- TextLine *tline = text->lines.first;
- unsigned short type = 0;
-
- if (tline && (tline->len > 10)) {
- char *line = tline->line;
-
- /* Expected format: # SPACEHANDLER.SPACE.TYPE
- * Ex: # SPACEHANDLER.VIEW3D.DRAW
- * The actual checks are forgiving, so slight variations also work. */
- if (line && line[0] == '#' && strstr(line, "HANDLER")) {
- line++; /* skip '#' */
-
- /* only done for 3D View right now, trivial to add for others: */
- switch (spacetype) {
- case SPACE_VIEW3D:
- if (strstr(line, "3D")) { /* VIEW3D, 3DVIEW */
- if (strstr(line, "DRAW")) type = SPACEHANDLER_VIEW3D_DRAW;
- else if (strstr(line, "EVENT")) type = SPACEHANDLER_VIEW3D_EVENT;
- }
- break;
- }
- }
- }
- return type; /* 0 if not a space handler */
-}
-
-int BPY_del_spacehandler(Text *text, ScrArea *sa)
-{
- ScriptLink *slink;
- int i, j;
-
- if (!sa || !text) return -1;
-
- slink = &sa->scriptlink;
- if (slink->totscript < 1) return -1;
-
- for (i = 0; i < slink->totscript; i++) {
- if (text == (Text *)slink->scripts[i]) {
-
- for (j = i; j < slink->totscript - 1; j++) {
- slink->flag[j] = slink->flag[j+1];
- slink->scripts[j] = slink->scripts[j+1];
- }
- slink->totscript--;
- /* like done in buttons_script.c we just free memory
- * if all slinks have been removed -- less fragmentation,
- * these should be quite small arrays */
- if (slink->totscript == 0) {
- if (slink->scripts) MEM_freeN(slink->scripts);
- if (slink->flag) MEM_freeN(slink->flag);
- break;
- }
- }
- }
- return 0;
-}
-
-int BPY_add_spacehandler(Text *text, ScrArea *sa, char spacetype)
-{
- unsigned short handlertype;
-
- if (!sa || !text) return -1;
-
- handlertype = (unsigned short)BPY_is_spacehandler(text, spacetype);
-
- if (handlertype) {
- ScriptLink *slink = &sa->scriptlink;
- void *stmp, *ftmp;
- unsigned short space_event = SPACEHANDLER_VIEW3D_EVENT;
-
- /* extend slink */
-
- stmp= slink->scripts;
- slink->scripts= MEM_mallocN(sizeof(ID*)*(slink->totscript+1),
- "spacehandlerscripts");
-
- ftmp= slink->flag;
- slink->flag= MEM_mallocN(sizeof(short*)*(slink->totscript+1),
- "spacehandlerflags");
-
- if (slink->totscript) {
- memcpy(slink->scripts, stmp, sizeof(ID*)*(slink->totscript));
- MEM_freeN(stmp);
-
- memcpy(slink->flag, ftmp, sizeof(short)*(slink->totscript));
- MEM_freeN(ftmp);
- }
-
- switch (spacetype) {
- case SPACE_VIEW3D:
- if (handlertype == 1) space_event = SPACEHANDLER_VIEW3D_EVENT;
- else space_event = SPACEHANDLER_VIEW3D_DRAW;
- break;
- default:
- break;
- }
-
- slink->scripts[slink->totscript] = (ID *)text;
- slink->flag[slink->totscript]= space_event;
-
- slink->totscript++;
- slink->actscript = slink->totscript;
-
- }
- return 0;
-}
-
-int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
- short eventValue, unsigned short space_event )
-{
- ScriptLink *scriptlink;
- int retval = 0;
- PyGILState_STATE gilstate;
-
- if (!sa || !(G.f & G_DOSCRIPTLINKS)) return 0;
-
- scriptlink = &sa->scriptlink;
-
- if (scriptlink->totscript > 0) {
- PyObject *dict;
- PyObject *ret;
- int index, during_slink = during_scriptlink();
-
- /* invalid scriptlinks (new .blend was just loaded), return */
- if (during_slink < 0) return 0;
-
- /* tell we're running a scriptlink. The sum also tells if this script
- * is running nested inside another. Blender.Load needs this info to
- * avoid trouble with invalid slink pointers.
- * Update (test): allow EVENT space handlers to call file/image selectors,
- * still disabled for DRAW space handlers: */
- if (event == 0) { /* event = 0: DRAW space handler */
- during_slink++;
- disable_where_scriptlink( (short)during_slink );
- }
-
- gilstate = PyGILState_Ensure();
-
- if( !setup_armature_weakrefs()){
- printf("Oops - weakref dict, this is a bug\n");
- PyGILState_Release(gilstate);
- return 0;
- }
-
- /* set globals in Blender module to identify space handler scriptlink */
- PyDict_SetItemString(g_blenderdict, "bylink", Py_True);
- /* unlike normal scriptlinks, here Blender.link is int (space event type) */
- EXPP_dict_set_item_str(g_blenderdict, "link", PyInt_FromLong(space_event));
- /* note: DRAW space_events set event and val to 0 */
- EXPP_dict_set_item_str(g_blenderdict, "event", PyInt_FromLong(event));
- EXPP_dict_set_item_str(g_blenderdict, "eventValue", PyInt_FromLong(eventValue));
- /* now run all assigned space handlers for this space and space_event */
- for( index = 0; index < scriptlink->totscript; index++ ) {
-
- /* for DRAW handlers: */
- if (event == 0) {
- glPushAttrib(GL_ALL_ATTRIB_BITS);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- }
-
- if( ( scriptlink->flag[index] == space_event ) &&
- ( scriptlink->scripts[index] != NULL ) ) {
- dict = CreateGlobalDictionary();
- ret = RunPython( ( Text * ) scriptlink->scripts[index], dict );
- ReleaseGlobalDictionary( dict );
-
- if (!ret) { /* Failed execution of the script */
- BPY_Err_Handle( scriptlink->scripts[index]->name+2 );
- } else {
- Py_DECREF(ret);
-
- /* an EVENT type (event != 0) script can either accept an event or
- * ignore it:
- * if the script sets Blender.event to None it accepted it;
- * otherwise the space's event handling callback that called us
- * can go on processing the event */
- if (event && (PyDict_GetItemString(g_blenderdict,"event") == Py_None))
- retval = 1; /* event was swallowed */
- }
-
- /* If a scriptlink has just loaded a new .blend file, the
- * scriptlink pointer became invalid (see api2_2x/Blender.c),
- * so we stop here. */
- if( during_scriptlink( ) == -1 ) {
- during_slink = 1;
- if (event == 0) glPopAttrib();
- break;
- }
- }
-
- /* for DRAW handlers: */
- if (event == 0) {
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glPopAttrib();
- disable_where_scriptlink( (short)(during_slink - 1) );
- }
-
- }
-
- PyDict_SetItemString(g_blenderdict, "bylink", Py_False);
- PyDict_SetItemString(g_blenderdict, "link", Py_None );
- EXPP_dict_set_item_str(g_blenderdict, "event", PyString_FromString(""));
-
- PyGILState_Release(gilstate);
- }
-
- /* retval:
- * space_event is of type EVENT:
- * 0 - event was returned,
- * 1 - event was processed;
- * space_event is of type DRAW:
- * 0 always */
-
- return retval;
-}
-
-/*****************************************************************************
-* Description:
-* Notes:
-*****************************************************************************/
-void BPY_free_scriptlink( struct ScriptLink *slink )
-{
- if( slink->totscript ) {
- if( slink->flag ) {
- MEM_freeN( slink->flag );
- slink->flag= NULL;
- }
- if( slink->scripts ) {
- MEM_freeN( slink->scripts );
- slink->scripts= NULL;
- }
- }
-
- return;
-}
-
-static int CheckAllSpaceHandlers(Text *text)
-{
- bScreen *screen;
- ScrArea *sa;
- ScriptLink *slink;
- int fixed = 0;
-
- for (screen = G.main->screen.first; screen; screen = screen->id.next) {
- for (sa = screen->areabase.first; sa; sa = sa->next) {
- slink = &sa->scriptlink;
- if (!slink->totscript) continue;
- if (BPY_del_spacehandler(text, sa) == 0) fixed++;
- }
- }
- return fixed;
-}
-
-static int CheckAllScriptsFromList( ListBase * list, Text * text )
-{
- ID *id;
- ScriptLink *scriptlink;
- int index;
- int fixed = 0;
-
- id = list->first;
-
- while( id != NULL ) {
- scriptlink = ID_getScriptlink( id );
- if( scriptlink && scriptlink->totscript ) {
- for( index = 0; index < scriptlink->totscript; index++) {
- if ((Text *)scriptlink->scripts[index] == text) {
- scriptlink->scripts[index] = NULL;
- fixed++;
- }
- }
- }
- id = id->next;
- }
-
- return fixed;
-}
-
-/* When a Text is deleted, we need to unlink it from eventual scriptlinks */
-int BPY_check_all_scriptlinks( Text * text )
-{
- int fixed = 0;
- fixed += CheckAllScriptsFromList( &( G.main->object ), text );
- fixed += CheckAllScriptsFromList( &( G.main->lamp ), text );
- fixed += CheckAllScriptsFromList( &( G.main->camera ), text );
- fixed += CheckAllScriptsFromList( &( G.main->mat ), text );
- fixed += CheckAllScriptsFromList( &( G.main->world ), text );
- fixed += CheckAllScriptsFromList( &( G.main->scene ), text );
- fixed += CheckAllSpaceHandlers(text);
-
- return fixed;
-}
-
-/*****************************************************************************
-* Description:
-* Notes:
-*****************************************************************************/
-void BPY_copy_scriptlink( struct ScriptLink *scriptlink )
-{
- void *tmp;
-
- if( scriptlink->totscript ) {
-
- tmp = scriptlink->scripts;
- scriptlink->scripts =
- MEM_mallocN( sizeof( ID * ) * scriptlink->totscript,
- "scriptlistL" );
- memcpy( scriptlink->scripts, tmp,
- sizeof( ID * ) * scriptlink->totscript );
-
- tmp = scriptlink->flag;
- scriptlink->flag =
- MEM_mallocN( sizeof( short ) * scriptlink->totscript,
- "scriptlistF" );
- memcpy( scriptlink->flag, tmp,
- sizeof( short ) * scriptlink->totscript );
- }
-
- return;
-}
-
-/****************************************************************************
-* Description:
-* Notes: Not implemented yet
-*****************************************************************************/
-int BPY_call_importloader( char *name )
-{ /* XXX Should this function go away from Blender? */
- printf( "In BPY_call_importloader(name=%s)\n", name );
- return ( 0 );
-}
-
-/*****************************************************************************
-* Private functions
-*****************************************************************************/
-
-/*****************************************************************************
-* Description: This function executes the python script passed by text.
-* The Python dictionary containing global variables needs to
-* be passed in globaldict.
-* NOTE: Make sure BPY_Err_Handle() runs if this returns NULL
-* otherwise pointers can be left in sys.last_traceback that become invalid.
-*****************************************************************************/
-static PyObject *RunPython( Text * text, PyObject * globaldict )
-{
- char *buf = NULL;
-
-/* The script text is compiled to Python bytecode and saved at text->compiled
- * to speed-up execution if the user executes the script multiple times */
-
- if( !text->compiled ) { /* if it wasn't already compiled, do it now */
- buf = txt_to_buf( text );
-
- text->compiled =
- Py_CompileString( buf, text->id.name+2, Py_file_input );
-
- MEM_freeN( buf );
-
- if( PyErr_Occurred( ) ) {
- BPY_free_compiled_text( text );
- return NULL;
- }
-
- }
-
- return PyEval_EvalCode( text->compiled, globaldict, globaldict );
-}
-
-/*****************************************************************************
-* Description: This function creates a new Python dictionary object.
-*****************************************************************************/
-static PyObject *CreateGlobalDictionary( void )
-{
- PyObject *dict = PyDict_New( );
-
- PyDict_SetItemString( dict, "__builtins__", PyEval_GetBuiltins( ) );
- EXPP_dict_set_item_str( dict, "__name__",
- PyString_FromString( "__main__" ) );
-
- return dict;
-}
-
-/*****************************************************************************
-* Description: This function deletes a given Python dictionary object.
-*****************************************************************************/
-static void ReleaseGlobalDictionary( PyObject * dict )
-{
- PyDict_Clear( dict );
- Py_DECREF( dict ); /* Release dictionary. */
-
- return;
-}
-
-/***************************************************************************
-* Description: This function runs all scripts (if any) present in the
-* list argument. The event by which the function has been
-* called, is passed in the event argument.
-*****************************************************************************/
-static void DoAllScriptsFromList( ListBase * list, short event )
-{
- ID *id;
-
- id = list->first;
-
- while( id != NULL ) {
- BPY_do_pyscript( id, event );
- id = id->next;
- }
-
- return;
-}
-
-static PyObject *importText( char *name )
-{
- Text *text;
- char txtname[22]; /* 21+NULL */
- char *buf = NULL;
- int namelen = strlen( name );
-
- if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */
-
- memcpy( txtname, name, namelen );
- memcpy( &txtname[namelen], ".py", 4 );
-
- for(text = G.main->text.first; text; text = text->id.next) {
- if( !strcmp( txtname, text->id.name+2 ) )
- break;
- }
-
- if( !text )
- return NULL;
-
- if( !text->compiled ) {
- buf = txt_to_buf( text );
- text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input );
- MEM_freeN( buf );
-
- if( PyErr_Occurred( ) ) {
- PyErr_Print( );
- BPY_free_compiled_text( text );
- return NULL;
- }
- }
-
- return PyImport_ExecCodeModule( name, text->compiled );
-}
-
-static PyMethodDef bimport[] = {
- {"blimport", blender_import, METH_KEYWORDS, "our own import"}
-};
-
-static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * kw)
-{
- PyObject *exception, *err, *tb;
- char *name;
- PyObject *globals = NULL, *locals = NULL, *fromlist = NULL;
- PyObject *m;
-
- //PyObject_Print(args, stderr, 0);
-#if (PY_VERSION_HEX >= 0x02060000)
- int dummy_val; /* what does this do?*/
- static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
-
- if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bimport", kwlist,
- &name, &globals, &locals, &fromlist, &dummy_val) )
- return NULL;
-#else
- static char *kwlist[] = {"name", "globals", "locals", "fromlist", 0};
-
- if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOO:bimport", kwlist,
- &name, &globals, &locals, &fromlist ) )
- return NULL;
-#endif
- m = PyImport_ImportModuleEx( name, globals, locals, fromlist );
-
- if( m )
- return m;
- else
- PyErr_Fetch( &exception, &err, &tb ); /*restore for probable later use */
-
- m = importText( name );
- if( m ) { /* found module, ignore above exception */
- PyErr_Clear( );
- Py_XDECREF( exception );
- Py_XDECREF( err );
- Py_XDECREF( tb );
- printf( "imported from text buffer...\n" );
- } else {
- PyErr_Restore( exception, err, tb );
- }
- return m;
-}
-
-static void init_ourImport( void )
-{
- PyObject *m, *d;
- PyObject *import = PyCFunction_New( bimport, NULL );
-
- m = PyImport_AddModule( "__builtin__" );
- d = PyModule_GetDict( m );
-
- EXPP_dict_set_item_str( d, "__import__", import );
-}
-
-/*
- * find in-memory module and recompile
- */
-
-static PyObject *reimportText( PyObject *module )
-{
- Text *text;
- char *txtname;
- char *name;
- char *buf = NULL;
-
- /* get name, filename from the module itself */
-
- txtname = PyModule_GetFilename( module );
- name = PyModule_GetName( module );
- if( !txtname || !name)
- return NULL;
-
- /* look up the text object */
- text = ( Text * ) & ( G.main->text.first );
- while( text ) {
- if( !strcmp( txtname, text->id.name+2 ) )
- break;
- text = text->id.next;
- }
-
- /* uh-oh.... didn't find it */
- if( !text )
- return NULL;
-
- /* if previously compiled, free the object */
- /* (can't see how could be NULL, but check just in case) */
- if( text->compiled ){
- Py_DECREF( (PyObject *)text->compiled );
- }
-
- /* compile the buffer */
- buf = txt_to_buf( text );
- text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input );
- MEM_freeN( buf );
-
- /* if compile failed.... return this error */
- if( PyErr_Occurred( ) ) {
- PyErr_Print( );
- BPY_free_compiled_text( text );
- return NULL;
- }
-
- /* make into a module */
- return PyImport_ExecCodeModule( name, text->compiled );
-}
-
-/*
- * our reload() module, to handle reloading in-memory scripts
- */
-
-static PyObject *blender_reload( PyObject * self, PyObject * args )
-{
- PyObject *exception, *err, *tb;
- PyObject *module = NULL;
- PyObject *newmodule = NULL;
-
- /* check for a module arg */
- if( !PyArg_ParseTuple( args, "O:breload", &module ) )
- return NULL;
-
- /* try reimporting from file */
- newmodule = PyImport_ReloadModule( module );
- if( newmodule )
- return newmodule;
-
- /* no file, try importing from memory */
- PyErr_Fetch( &exception, &err, &tb ); /*restore for probable later use */
-
- newmodule = reimportText( module );
- if( newmodule ) { /* found module, ignore above exception */
- PyErr_Clear( );
- Py_XDECREF( exception );
- Py_XDECREF( err );
- Py_XDECREF( tb );
- } else
- PyErr_Restore( exception, err, tb );
-
- return newmodule;
-}
-
-static PyMethodDef breload[] = {
- {"blreload", blender_reload, METH_VARARGS, "our own reload"}
-};
-
-static void init_ourReload( void )
-{
- PyObject *m, *d;
- PyObject *reload = PyCFunction_New( breload, NULL );
-
- m = PyImport_AddModule( "__builtin__" );
- d = PyModule_GetDict( m );
- EXPP_dict_set_item_str( d, "reload", reload );
-}
-
-
-void BPY_scripts_clear_pyobjects( void )
-{
- Script *script;
- for (script=G.main->script.first; script; script=script->id.next) {
- Py_XDECREF((PyObject *)script->py_draw);
- Py_XDECREF((PyObject *)script->py_event);
- Py_XDECREF((PyObject *)script->py_button);
- Py_XDECREF((PyObject *)script->py_browsercallback);
- Py_XDECREF((PyObject *)script->py_globaldict);
- SCRIPT_SET_NULL(script)
- }
-}
-void error_pyscript( void )
-{
- error("Python script error: check console");
-}
diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c
deleted file mode 100644
index 9e7abc44657..00000000000
--- a/source/blender/python/BPY_menus.c
+++ /dev/null
@@ -1,1166 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Michael Reimpell
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/*
- *This is the main file responsible for having bpython scripts accessible
- * from Blender menus. To know more, please start with its header file.
- */
-
-#include "BPY_menus.h"
-
-#include <Python.h>
-#ifndef WIN32
- #include <dirent.h>
-#else
- #include "BLI_winstuff.h"
-#endif
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BIF_keyval.h"
-#include "BLI_blenlib.h"
-#include "MEM_guardedalloc.h"
-#include "DNA_userdef_types.h" /* for U.pythondir */
-#include "api2_2x/EXPP_interface.h" /* for bpy_gethome() */
-
-#define BPYMENU_DATAFILE "Bpymenus"
-#define MAX_DIR_DEPTH 4 /* max depth for traversing scripts dirs */
-#define MAX_DIR_NUMBER 30 /* max number of dirs in scripts dirs trees */
-
-static int DEBUG;
-static int Dir_Depth;
-static int Dirs_Number;
-
-/* BPyMenuTable holds all registered pymenus, as linked lists for each menu
- * where they can appear (see PYMENUHOOKS enum in BPY_menus.h).
-*/
-BPyMenu *BPyMenuTable[PYMENU_TOTAL];
-
-static int bpymenu_group_atoi( char *str )
-{
- if( !strcmp( str, "Export" ) )
- return PYMENU_EXPORT;
- else if( !strcmp( str, "Import" ) )
- return PYMENU_IMPORT;
- else if( !strcmp( str, "Help" ) )
- return PYMENU_HELP;
- else if( !strcmp( str, "HelpWebsites" ) )
- return PYMENU_HELPWEBSITES;
- else if( !strcmp( str, "HelpSystem" ) )
- return PYMENU_HELPSYSTEM;
- else if( !strcmp( str, "Render" ) )
- return PYMENU_RENDER;
- else if( !strcmp( str, "System" ) )
- return PYMENU_SYSTEM;
- else if( !strcmp( str, "Object" ) )
- return PYMENU_OBJECT;
- else if( !strcmp( str, "Mesh" ) )
- return PYMENU_MESH;
- else if( !strncmp( str, "Theme", 5 ) )
- return PYMENU_THEMES;
- else if( !strcmp( str, "Add" ) )
- return PYMENU_ADD;
- else if( !strcmp( str, "Wizards" ) )
- return PYMENU_WIZARDS;
- else if( !strcmp( str, "Animation" ) )
- return PYMENU_ANIMATION;
- else if( !strcmp( str, "Materials" ) )
- return PYMENU_MATERIALS;
- else if( !strcmp( str, "UV" ) )
- return PYMENU_UV;
- else if( !strcmp( str, "Image" ) )
- return PYMENU_IMAGE;
- else if( !strcmp( str, "FaceSelect" ) )
- return PYMENU_FACESELECT;
- else if( !strcmp( str, "WeightPaint" ) )
- return PYMENU_WEIGHTPAINT;
- else if( !strcmp( str, "VertexPaint" ) )
- return PYMENU_VERTEXPAINT;
- else if( !strcmp( str, "UVCalculation" ) )
- return PYMENU_UVCALCULATION;
- else if( !strcmp( str, "Armature" ) )
- return PYMENU_ARMATURE;
- else if( !strcmp( str, "ScriptTemplate" ) )
- return PYMENU_SCRIPTTEMPLATE;
- else if( !strcmp( str, "TextPlugin" ) )
- return PYMENU_TEXTPLUGIN;
- else if( !strcmp( str, "MeshFaceKey" ) )
- return PYMENU_MESHFACEKEY;
- else if( !strcmp( str, "AddMesh" ) )
- return PYMENU_ADDMESH;
- /* "Misc" or an inexistent group name: use misc */
- else
- return PYMENU_MISC;
-}
-
-char *BPyMenu_group_itoa( short menugroup )
-{
- switch ( menugroup ) {
- case PYMENU_EXPORT:
- return "Export";
- break;
- case PYMENU_IMPORT:
- return "Import";
- break;
- case PYMENU_ADD:
- return "Add";
- break;
- case PYMENU_HELP:
- return "Help";
- break;
- case PYMENU_HELPWEBSITES:
- return "HelpWebsites";
- break;
- case PYMENU_HELPSYSTEM:
- return "HelpSystem";
- break;
- case PYMENU_RENDER:
- return "Render";
- break;
- case PYMENU_SYSTEM:
- return "System";
- break;
- case PYMENU_OBJECT:
- return "Object";
- break;
- case PYMENU_MESH:
- return "Mesh";
- break;
- case PYMENU_THEMES:
- return "Themes";
- break;
- case PYMENU_WIZARDS:
- return "Wizards";
- break;
- case PYMENU_ANIMATION:
- return "Animation";
- break;
- case PYMENU_MATERIALS:
- return "Materials";
- break;
- case PYMENU_UV:
- return "UV";
- break;
- case PYMENU_IMAGE:
- return "Image";
- break;
- case PYMENU_FACESELECT:
- return "FaceSelect";
- break;
- case PYMENU_WEIGHTPAINT:
- return "WeightPaint";
- break;
- case PYMENU_VERTEXPAINT:
- return "VertexPaint";
- break;
- case PYMENU_UVCALCULATION:
- return "UVCalculation";
- break;
- case PYMENU_ARMATURE:
- return "Armature";
- break;
- case PYMENU_SCRIPTTEMPLATE:
- return "ScriptTemplate";
- break;
- case PYMENU_TEXTPLUGIN:
- return "TextPlugin";
- break;
- case PYMENU_MESHFACEKEY:
- return "MeshFaceKey";
- break;
- case PYMENU_ADDMESH:
- return "AddMesh";
- break;
- case PYMENU_MISC:
- return "Misc";
- break;
- }
- return NULL;
-}
-
-/* BPyMenu_CreatePupmenuStr:
- * build and return a meaninful string to be used by pupmenu(). The
- * string is made of a bpymenu name as title and its submenus as possible
- * choices for the user.
-*/
-char *BPyMenu_CreatePupmenuStr( BPyMenu * pym, short menugroup )
-{
- BPySubMenu *pysm = pym->submenus;
- char str[1024], str2[100];
- int i = 0, rlen;
-
- if( !pym || !pysm )
- return NULL;
-
- str[0] = '\0';
-
- PyOS_snprintf( str2, sizeof( str2 ), "%s: %s%%t",
- BPyMenu_group_itoa( menugroup ), pym->name );
- strcat( str, str2 );
-
- while( pysm ) {
- PyOS_snprintf( str2, sizeof( str2 ), "|%s%%x%d", pysm->name,
- i );
- rlen = sizeof( str ) - strlen( str );
- strncat( str, str2, rlen );
- i++;
- pysm = pysm->next;
- }
-
- return BLI_strdup( str );
-}
-
-static void bpymenu_RemoveAllSubEntries( BPySubMenu * smenu )
-{
- BPySubMenu *tmp;
-
- while( smenu ) {
- tmp = smenu->next;
- if( smenu->name )
- MEM_freeN( smenu->name );
- if( smenu->arg )
- MEM_freeN( smenu->arg );
- MEM_freeN( smenu );
- smenu = tmp;
- }
- return;
-}
-
-void BPyMenu_RemoveAllEntries( void )
-{
- BPyMenu *tmp, *pymenu;
- int i;
-
- for( i = 0; i < PYMENU_TOTAL; i++ ) {
- pymenu = BPyMenuTable[i];
- while( pymenu ) {
- tmp = pymenu->next;
- if( pymenu->name )
- MEM_freeN( pymenu->name );
- if( pymenu->filename )
- MEM_freeN( pymenu->filename );
- if( pymenu->tooltip )
- MEM_freeN( pymenu->tooltip );
- if( pymenu->submenus )
- bpymenu_RemoveAllSubEntries( pymenu->
- submenus );
- MEM_freeN( pymenu );
- pymenu = tmp;
- }
- BPyMenuTable[i] = NULL;
- }
-
- Dirs_Number = 0;
- Dir_Depth = 0;
-
- return;
-}
-
-static BPyMenu *bpymenu_FindEntry( short group, char *name )
-{
- BPyMenu *pymenu;
-
- if( ( group < 0 ) || ( group >= PYMENU_TOTAL ) )
- return NULL;
-
- pymenu = BPyMenuTable[group];
-
- while( pymenu ) {
- if( !strcmp( pymenu->name, name ) )
- return pymenu;
- pymenu = pymenu->next;
- }
-
- return NULL;
-}
-
-/* BPyMenu_GetEntry:
- * given a group and a position, return the entry in that position from
- * that group.
-*/
-BPyMenu *BPyMenu_GetEntry( short group, short pos )
-{
- BPyMenu *pym = NULL;
-
- if( ( group < 0 ) || ( group >= PYMENU_TOTAL ) )
- return NULL;
-
- pym = BPyMenuTable[group];
-
- while( pos-- ) {
- if( pym )
- pym = pym->next;
- else
- break;
- }
-
- return pym; /* found entry or NULL */
-}
-
-static void bpymenu_set_tooltip( BPyMenu * pymenu, char *tip )
-{
- if( !pymenu )
- return;
-
- if( pymenu->tooltip )
- MEM_freeN( pymenu->tooltip );
- pymenu->tooltip = BLI_strdup( tip );
-
- return;
-}
-
-static void bpymenu_set_shortcut( BPyMenu * pymenu, char *combi )
-{
- unsigned short key, qual;
-
- if( !pymenu )
- return;
-
- if (!decode_key_string(combi, &key, &qual)) {
- return; /* TODO: Print some error */
- }
-
- pymenu->key = key;
- pymenu->qual = qual;
-
- return;
-}
-
-/* bpymenu_AddEntry:
- * try to find an existing pymenu entry with the given type and name;
- * if found, update it with new info, otherwise create a new one and fill it.
- */
-static BPyMenu *bpymenu_AddEntry( short group, short version, char *name,
- char *fname, int is_userdir, char *tooltip )
-{
- BPyMenu *menu, *next = NULL, **iter;
- int nameclash = 0;
-
- if( ( group < 0 ) || ( group >= PYMENU_TOTAL ) )
- return NULL;
- if( !name || !fname )
- return NULL;
-
- menu = bpymenu_FindEntry( group, name ); /* already exists? */
-
- /* if a menu with this name already exists in the same group:
- * - if one script is in the default dir and the other in U.pythondir,
- * accept and let the new one override the other.
- * - otherwise, report the error and return NULL. */
- if( menu ) {
- if( menu->dir < is_userdir ) { /* new one is in U.pythondir */
- nameclash = 1;
- if( menu->name )
- MEM_freeN( menu->name );
- if( menu->filename )
- MEM_freeN( menu->filename );
- if( menu->tooltip )
- MEM_freeN( menu->tooltip );
- if( menu->submenus )
- bpymenu_RemoveAllSubEntries( menu->submenus );
- next = menu->next;
- } else { /* they are in the same dir */
- if (DEBUG) {
- fprintf(stderr, "\n\
-Warning: script %s's menu name is already in use.\n\
-Edit the script and change its \n\
-Name: '%s'\n\
-field, please.\n\
-Note: if you really want to have two scripts for the same menu with\n\
-the same name, keep one in the default dir and the other in\n\
-the user defined dir (only the later will be registered).\n", fname, name);
- }
- return NULL;
- }
- } else
- menu = MEM_mallocN( sizeof( BPyMenu ), "pymenu" );
-
- if( !menu )
- return NULL;
-
- menu->name = BLI_strdup( name );
- menu->version = version;
- menu->filename = BLI_strdup( fname );
- menu->tooltip = NULL;
- if( tooltip )
- menu->tooltip = BLI_strdup( tooltip );
- menu->dir = is_userdir;
- menu->submenus = NULL;
- menu->next = next; /* non-NULL if menu already existed */
-
- if( nameclash )
- return menu; /* no need to place it, it's already at the list */
- else { /* insert the new entry in its correct position at the table */
- BPyMenu *prev = NULL;
- char *s = NULL;
-
- iter = &BPyMenuTable[group];
- while( *iter ) {
- s = ( *iter )->name;
- if( s )
- if( strcmp( menu->name, s ) < 0 )
- break; /* sort by names */
- prev = *iter;
- iter = &( ( *iter )->next );
- }
-
- if( *iter ) { /* prepend */
- menu->next = *iter;
- if( prev )
- prev->next = menu;
- else
- BPyMenuTable[group] = menu; /* is first entry */
- } else
- *iter = menu; /* append */
- }
-
- return menu;
-}
-
-/* bpymenu_AddSubEntry:
- * add a submenu to an existing python menu.
- */
-static int bpymenu_AddSubEntry( BPyMenu * mentry, char *name, char *arg )
-{
- BPySubMenu *smenu, **iter;
-
- smenu = MEM_mallocN( sizeof( BPySubMenu ), "pysubmenu" );
- if( !smenu )
- return -1;
-
- smenu->name = BLI_strdup( name );
- smenu->arg = BLI_strdup( arg );
- smenu->next = NULL;
-
- if( !smenu->name || !smenu->arg )
- return -1;
-
- iter = &( mentry->submenus );
- while( *iter )
- iter = &( ( *iter )->next );
-
- *iter = smenu;
-
- return 0;
-}
-
-/* bpymenu_CreateFromFile:
- * parse the bpymenus data file where Python menu data is stored;
- * based on this data, create and fill the pymenu structs.
- */
-static int bpymenu_CreateFromFile( void )
-{
- FILE *fp;
- char line[255], w1[255], w2[255], tooltip[255], *tip;
- char upythondir[FILE_MAX];
- char *homedir = NULL;
- int parsing, version, w2_len, is_userdir;
- short group;
- BPyMenu *pymenu = NULL;
-
- /* init global bpymenu table (it is a list of pointers to struct BPyMenus
- * for each available cathegory: import, export, etc.) */
- for( group = 0; group < PYMENU_TOTAL; group++ )
- BPyMenuTable[group] = NULL;
-
- /* let's try to open the file with bpymenu data */
- homedir = bpy_gethome(0);
- if (!homedir) {
- if( DEBUG )
- fprintf(stderr,
- "BPyMenus error: couldn't open config file Bpymenus: no home dir.\n");
- return -1;
- }
-
- BLI_make_file_string( "/", line, homedir, BPYMENU_DATAFILE );
-
- fp = fopen( line, "rb" );
-
- if( !fp ) {
- if( DEBUG )
- fprintf(stderr, "BPyMenus error: couldn't open config file %s.\n", line );
- return -1;
- }
-
- fgets( line, 255, fp ); /* header */
-
- /* check if the U.pythondir we saved at the file is different from the
- * current one. If so, return to force updating from dirs */
- w1[0] = '\0';
- fscanf( fp, "# User defined scripts dir: %[^\n]\n", w1 );
-
- BLI_strncpy(upythondir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upythondir, G.sce);
-
- if( strcmp( w1, upythondir ) != 0 )
- return -1;
-
- w1[0] = '\0';
-
- while( fgets( line, 255, fp ) ) { /* parsing file lines */
-
- switch ( line[0] ) { /* check first char */
- case '#': /* comment */
- continue;
- break;
- case '\n':
- continue;
- break;
- default:
- parsing = sscanf( line, "%s {\n", w1 ); /* menu group */
- break;
- }
-
- if( parsing == 1 ) { /* got menu group string */
- group = (short)bpymenu_group_atoi( w1 );
- if( group < 0 && DEBUG ) { /* invalid type */
- fprintf(stderr,
- "BPyMenus error parsing config file: wrong group: %s,\n\
-will use 'Misc'.\n", w1 );
- }
- } else
- continue;
-
- for(;;) {
- tip = NULL; /* optional tooltip */
- fgets( line, 255, fp );
- if( line[0] == '}' )
- break;
- else if( line[0] == '\n' )
- continue;
- else if( line[0] == '\'' ) { /* menu entry */
-/* parsing =
- sscanf( line,
- "'%[^']' %d %s %d '%[^']'\n",
- w1, &version, w2, &is_userdir,
- tooltip );
-*/
- /* previously filenames with spaces were not supported;
- * this adds support for that w/o breaking the existing
- * few, exotic scripts that parse the Bpymenus file */
- parsing = sscanf( line,
- "'%[^']' %d %[^'\n] '%[^']'\n",
- w1, &version, w2, tooltip );
- if( parsing <= 0 ) { /* invalid line, get rid of it */
- fgets( line, 255, fp );
- } else if( parsing == 4 )
- tip = tooltip; /* has tooltip */
-
- w2_len = strlen(w2);
- if( w2[w2_len-1] == ' ') {
- w2[w2_len-1] = '\0';
- w2_len -= 1;
- }
- if( w2[w2_len-1] == '1') is_userdir = 1;
- else is_userdir = 0;
- w2[w2_len-2] = '\0';
-
- pymenu = bpymenu_AddEntry( group,
- ( short ) version,
- w1, w2, is_userdir,
- tip );
- if( !pymenu ) {
- puts( "BPyMenus error: couldn't create bpymenu entry.\n" );
- fclose( fp );
- return -1;
- }
- } else if( line[0] == '|' && line[1] == '_' ) { /* menu sub-entry */
- if( !pymenu )
- continue; /* no menu yet, skip this line */
- sscanf( line, "|_%[^:]: %s\n", w1, w2 );
- bpymenu_AddSubEntry( pymenu, w1, w2 );
- }
- }
- }
-
- fclose( fp );
- return 0;
-}
-
-/* bpymenu_WriteDataFile:
- * writes the registered scripts info to the user's home dir, for faster
- * access when the scripts dir hasn't changed.
-*/
-static void bpymenu_WriteDataFile( void )
-{
- BPyMenu *pymenu;
- BPySubMenu *smenu;
- FILE *fp;
- char fname[FILE_MAXDIR], *homedir;
- int i;
-
- homedir = bpy_gethome(0);
-
- if (!homedir) {
- if( DEBUG )
- fprintf(stderr,
- "BPyMenus error: couldn't write Bpymenus file: no home dir.\n\n");
- return;
- }
-
- BLI_make_file_string( "/", fname, homedir, BPYMENU_DATAFILE );
-
- fp = fopen( fname, "w" );
- if( !fp ) {
- if( DEBUG )
- fprintf(stderr, "BPyMenus error: couldn't write %s file.\n\n",
- fname );
- return;
- }
-
- fprintf( fp,
- "# Blender: registered menu entries for bpython scripts\n" );
-
- if (U.pythondir[0] != '\0' &&
- strcmp(U.pythondir, "/") != 0 && strcmp(U.pythondir, "//") != 0)
- {
- char upythondir[FILE_MAX];
-
- BLI_strncpy(upythondir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upythondir, G.sce);
- fprintf( fp, "# User defined scripts dir: %s\n", upythondir );
- }
-
- for( i = 0; i < PYMENU_TOTAL; i++ ) {
- pymenu = BPyMenuTable[i];
- if( !pymenu )
- continue;
- fprintf( fp, "\n%s {\n", BPyMenu_group_itoa( (short)i ) );
- while( pymenu ) {
- fprintf( fp, "'%s' %d %s %d", pymenu->name,
- pymenu->version, pymenu->filename,
- pymenu->dir );
- if( pymenu->tooltip )
- fprintf( fp, " '%s'\n", pymenu->tooltip );
- else
- fprintf( fp, "\n" );
- smenu = pymenu->submenus;
- while( smenu ) {
- fprintf( fp, "|_%s: %s\n", smenu->name,
- smenu->arg );
- smenu = smenu->next;
- }
- pymenu = pymenu->next;
- }
- fprintf( fp, "}\n" );
- }
-
- fclose( fp );
- return;
-}
-
-/* BPyMenu_PrintAllEntries:
- * useful for debugging.
- */
-void BPyMenu_PrintAllEntries( void )
-{
- BPyMenu *pymenu;
- BPySubMenu *smenu;
- int i;
-
- printf( "# Blender: registered menu entries for bpython scripts\n" );
-
- for( i = 0; i < PYMENU_TOTAL; i++ ) {
- pymenu = BPyMenuTable[i];
- printf( "\n%s {\n", BPyMenu_group_itoa( (short)i ) );
- while( pymenu ) {
- printf( "'%s' %d %s %d", pymenu->name, pymenu->version,
- pymenu->filename, pymenu->dir );
- if( pymenu->tooltip )
- printf( " '%s'\n", pymenu->tooltip );
- else
- printf( "\n" );
- smenu = pymenu->submenus;
- while( smenu ) {
- printf( "|_%s: %s\n", smenu->name,
- smenu->arg );
- smenu = smenu->next;
- }
- pymenu = pymenu->next;
- }
- printf( "}\n" );
- }
-}
-
-/* bpymenu_ParseFile:
- * parse a given .py file looking for a proper header.
- *
- * The first line of the script must be '#!BPY'.
- * The header registration lines must appear between the first pair of
- * '\"\"\"' and follow this order (the single-quotes are part of
- * the format):
- *
- * # \"\"\"<br>
- * # Name: 'script name for the menu'
- * # Blender: <code>short int</code> (minimal Blender version)
- * # Group: 'group name' (defines menu)
- * # Submenu: 'submenu name' related_1word_arg
- * # Shortcut: Modifier+Key (optional shortcut combination for supported groups)
- * # Tooltip: 'tooltip for the menu'
- * # \"\"\"
- *
- * Notes:
- *
- * - Commenting out header lines with "#" is optional, but recommended.
- * - There may be more than one submenu line, or none:
- * submenus and the tooltip are optional;
- * - The Blender version is the same number reported by
- * Blender.Get('version') in BPython or G.version in C;
- * - Line length must be less than 99.
- */
-static int bpymenu_ParseFile(FILE *file, char *fname, int is_userdir)
-{
- char line[100];
- char head[100];
- char middle[100];
- char tail[100];
- int matches;
- int parser_state;
-
- char script_name[100];
- int script_version = 1;
- int script_group;
-
- BPyMenu *scriptMenu = NULL;
-
- if (file != NULL) {
- parser_state = 1; /* state of parser, 0 to terminate */
-
- while ((parser_state != 0) && (fgets(line, 100, file) != NULL)) {
-
- switch (parser_state) {
-
- case 1: /* !BPY */
- if (strncmp(line, "#!BPY", 5) == 0) {
- parser_state++;
- } else {
- parser_state = 0;
- }
- break;
-
- case 2: /* \"\"\" */
- if ((strstr(line, "\"\"\""))) {
- parser_state++;
- }
- break;
-
- case 3: /* Name: 'script name for the menu' */
- matches = sscanf(line, "%[^']'%[^']'%c", head, script_name, tail);
- if ((matches == 3) && (strstr(head, "Name:") != NULL)) {
- parser_state++;
- } else {
- if (DEBUG)
- fprintf(stderr, "BPyMenus error: Wrong 'Name' line: %s\n", fname);
- parser_state = 0;
- }
- break;
-
- case 4: /* Blender: <short int> */
- matches = sscanf(line, "%[^1234567890]%i%c", head, &script_version,
- tail);
- if (matches == 3) {
- parser_state++;
- } else {
- if (DEBUG)
- fprintf(stderr,"BPyMenus error: Wrong 'Blender' line: %s\n",fname);
- parser_state = 0;
- }
- break;
-
- case 5: /* Group: 'group name' */
- matches = sscanf(line, "%[^']'%[^']'%c", head, middle, tail);
- if ((matches == 3) && (strstr(head, "Group:") != NULL)) {
- script_group = bpymenu_group_atoi(middle);
- if (script_group < 0) {
- if (DEBUG)
- fprintf(stderr, "BPyMenus error: Unknown group \"%s\": %s\n",
- middle, fname);
- parser_state = 0;
- }
-
- else { /* register script */
- scriptMenu = bpymenu_AddEntry((short)script_group,
- (short int)script_version, script_name, fname, is_userdir,NULL);
- if (scriptMenu == NULL) {
- if (DEBUG)
- fprintf(stderr,
- "BPyMenus error: Couldn't create entry for: %s\n", fname);
- parser_state = 0;
- } else {
- parser_state++;
- }
- }
-
- } else {
- if (DEBUG)
- fprintf(stderr, "BPyMenus error: Wrong 'Group' line: %s\n",fname);
- parser_state = 0;
- }
- break;
-
- case 6: /* optional elements */
- /* Submenu: 'submenu name' related_1word_arg */
- matches = sscanf(line, "%[^']'%[^']'%s\n", head, middle, tail);
- if ((matches == 3) && (strstr(head, "Submenu:") != NULL)) {
- bpymenu_AddSubEntry(scriptMenu, middle, tail);
- } else {
- /* Shortcut: 'key+combination' */
- matches = sscanf(line, "%[^']'%[^']'%c", head, middle, tail);
- if ((matches == 3) && (strstr(head, "Shortcut:") != NULL)) {
- bpymenu_set_shortcut(scriptMenu, middle);
- } else {
- /* Tooltip: 'tooltip for the menu */
- matches = sscanf(line, "%[^']'%[^']'%c", head, middle, tail);
- if ((matches == 3) && ((strstr(head, "Tooltip:") != NULL) ||
- (strstr(head, "Tip:") != NULL))) {
- bpymenu_set_tooltip(scriptMenu, middle);
- }
- parser_state = 0;
- }
- }
- break;
-
- default:
- parser_state = 0;
- break;
- }
- }
- }
-
- else { /* shouldn't happen, it's checked in bpymenus_ParseDir */
- if (DEBUG)
- fprintf(stderr, "BPyMenus error: Couldn't open %s.\n", fname);
- return -1;
- }
-
- return 0;
-}
-
-/* bpymenu_ParseDir:
- * recursively scans folders looking for scripts to register.
- *
- * This function scans the scripts directory looking for .py files with the
- * right header and menu info.
- * - is_userdir defines if the script is in the default scripts dir or the
- * user defined one (U.pythondir: is_userdir == 1);
- * - parentdir is the parent dir name to store as part of the script filename,
- * if we're down a subdir.
- * Speed is important.
- */
-static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir )
-{
- DIR *dir;
- FILE *file = NULL;
- struct dirent *de;
- struct stat status;
- char *file_extension;
- char path[FILE_MAX];
- char subdir[FILE_MAX];
- char *s = NULL;
-
- dir = opendir(dirname);
-
- if (dir != NULL) {
- while ((de = readdir(dir)) != NULL) {
-
- /* skip files and dirs starting with '.' or 'bpy' */
- if ((de->d_name[0] == '.') || !strncmp(de->d_name, "bpy", 3)) {
- continue;
- }
-
- BLI_make_file_string("/", path, dirname, de->d_name);
-
- if (stat(path, &status) != 0) {
- if (DEBUG)
- fprintf(stderr, "stat %s failed: %s\n", path, strerror(errno));
- }
-
- if (S_ISREG(status.st_mode)) { /* is file */
-
- file_extension = strstr(de->d_name, ".py");
-
- if (file_extension && *(file_extension + 3) == '\0') {
- file = fopen(path, "rb");
-
- if (file) {
- s = de->d_name;
- if (parentdir) {
- /* Join parentdir and de->d_name */
- BLI_join_dirfile(subdir, parentdir, de->d_name);
-
- s = subdir;
- }
- bpymenu_ParseFile(file, s, is_userdir);
- fclose(file);
- }
-
- else {
- if (DEBUG)
- fprintf(stderr, "BPyMenus error: Couldn't open %s.\n", path);
- }
- }
- }
-
- else if (S_ISDIR(status.st_mode)) { /* is subdir */
- Dirs_Number++;
- Dir_Depth++;
- if (Dirs_Number > MAX_DIR_NUMBER) {
- if (DEBUG) {
- fprintf(stderr, "BPyMenus error: too many subdirs.\n");
- }
- closedir(dir);
- return -1;
- }
- else if (Dir_Depth > MAX_DIR_DEPTH) {
- if (DEBUG)
- fprintf(stderr,
- "BPyMenus error: max depth reached traversing dir tree.\n");
- closedir(dir);
- return -1;
- }
- s = de->d_name;
- if (parentdir) {
- /* Join parentdir and de->d_name */
- BLI_join_dirfile(subdir, parentdir, de->d_name);
- s = subdir;
- }
- if (bpymenu_ParseDir(path, s, is_userdir) == -1) {
- closedir(dir);
- return -1;
- }
- Dir_Depth--;
- }
-
- }
- closedir(dir);
- }
-
- else { /* open directory stream failed */
- if (DEBUG)
- fprintf(stderr, "opendir %s failed: %s\n", dirname, strerror(errno));
- return -1;
- }
-
- return 0;
-}
-
-static int bpymenu_GetStatMTime( const char *name, int is_file, time_t * mtime )
-{
- struct stat st;
- int result;
-
-#ifdef WIN32
- if (is_file) {
- result = stat( name, &st );
- } else {
- /* needed for win32 only, remove trailing slash */
- char name_stat[FILE_MAX];
- BLI_strncpy(name_stat, name, FILE_MAX);
- BLI_del_slash(name_stat);
- result = stat( name_stat, &st );
- }
-#else
- result = stat( name, &st );
-#endif
-
- if( result == -1 )
- return -1;
-
- if( is_file ) {
- if( !S_ISREG( st.st_mode ) )
- return -2;
- } else if( !S_ISDIR( st.st_mode ) )
- return -2;
-
- *mtime = st.st_mtime;
-
- return 0;
-}
-
-/* BPyMenu_Init:
- * import the bpython menus data to Blender, either from:
- * - the BPYMENU_DATAFILE file (?/.blender/Bpymenus) or
- * - the scripts dir(s), case newer than the datafile (then update the file).
- * then fill the bpymenu table with this data.
- * if param usedir != 0, then the data is recreated from the dir(s) anyway.
-*/
-int BPyMenu_Init( int usedir )
-{
- char fname[FILE_MAXDIR];
- char dirname[FILE_MAX];
- char upythondir[FILE_MAX];
- char *upydir = U.pythondir, *sdir = NULL;
- time_t time_dir1 = 0, time_dir2 = 0, time_file = 0;
- int stat_dir1 = 0, stat_dir2 = 0, stat_file = 0;
- int i;
-
- DEBUG = G.f & G_DEBUG; /* is Blender in debug mode (started with -d) ? */
-
- /* init global bpymenu table (it is a list of pointers to struct BPyMenus
- * for each available group: import, export, etc.) */
- for( i = 0; i < PYMENU_TOTAL; i++ )
- BPyMenuTable[i] = NULL;
-
- if( DEBUG )
- fprintf(stdout, "\nRegistering scripts in Blender menus ...\n\n" );
-
- if( U.pythondir[0] == '\0') {
- upydir = NULL;
- }
- else if (strcmp(U.pythondir, "/") == 0 || strcmp(U.pythondir, "//") == 0) {
- /* these are not accepted to prevent possible slight slowdowns on startup;
- * they should not be used as user defined scripts dir, anyway, also from
- * speed considerations, since they'd not be dedicated scripts dirs */
- if (DEBUG) fprintf(stderr,
- "BPyMenus: invalid user defined Python scripts dir: \"/\" or \"//\".\n");
- upydir = NULL;
- }
- else {
- BLI_strncpy(upythondir, upydir, FILE_MAX);
- BLI_convertstringcode(upythondir, G.sce);
- }
-
- sdir = bpy_gethome(1);
-
- if (sdir) {
- BLI_strncpy(dirname, sdir, FILE_MAX);
- stat_dir1 = bpymenu_GetStatMTime( dirname, 0, &time_dir1 );
-
- if( stat_dir1 < 0 ) {
- time_dir1 = 0;
- if( DEBUG ) {
- fprintf(stderr,
- "\nDefault scripts dir: %s:\n%s\n", dirname, strerror(errno));
- if( upydir )
- fprintf(stdout,
- "Getting scripts menu data from user defined dir: %s.\n",
- upythondir );
- }
- }
- }
- else stat_dir1 = -1;
-
- if( upydir ) {
- stat_dir2 = bpymenu_GetStatMTime( upythondir, 0, &time_dir2 );
-
- if( stat_dir2 < 0 ) {
- time_dir2 = 0;
- upydir = NULL;
- if( DEBUG )
- fprintf(stderr, "\nUser defined scripts dir: %s:\n%s.\n",
- upythondir, strerror( errno ) );
- if( stat_dir1 < 0 ) {
- if( DEBUG )
- fprintf(stderr, "\
-To have scripts in menus, please add them to the default scripts dir:\n\
-%s\n\
-and / or go to 'Info window -> File Paths tab' and set a valid path for\n\
-the user defined Python scripts dir.\n", dirname );
- return -1;
- }
- }
- }
- else stat_dir2 = -1;
-
- if( ( stat_dir1 < 0 ) && ( stat_dir2 < 0 ) ) {
- if( DEBUG ) {
- fprintf(stderr, "\nCannot register scripts in menus, no scripts dir"
- " available.\nExpected default dir at: %s \n", dirname );
- }
- return -1;
- }
-
- if (usedir) stat_file = -1;
- else { /* if we're not forced to use the dir */
- char *homedir = bpy_gethome(0);
-
- if (homedir) {
- BLI_make_file_string( "/", fname, homedir, BPYMENU_DATAFILE );
- stat_file = bpymenu_GetStatMTime( fname, 1, &time_file );
- if( stat_file < 0 )
- time_file = 0;
-
- /* comparing dates */
-
- if((stat_file == 0)
- && (time_file > time_dir1) && (time_file > time_dir2))
- { /* file is newer */
- stat_file = bpymenu_CreateFromFile( ); /* -1 if an error occurred */
- if( !stat_file && DEBUG )
- fprintf(stdout,
- "Getting menu data for scripts from file:\n%s\n\n", fname );
- }
- else stat_file = -1;
- }
- else stat_file = -1; /* -1 to use dirs: didn't use file or it was corrupted */
- }
-
- if( stat_file == -1 ) { /* use dirs */
- if( DEBUG ) {
- fprintf(stdout,
- "Getting menu data for scripts from dir(s):\ndefault: %s\n", dirname );
- if( upydir )
- fprintf(stdout, "user defined: %s\n", upythondir );
- fprintf(stdout, "\n");
- }
- if( stat_dir1 == 0 ) {
- i = bpymenu_ParseDir( dirname, NULL, 0 );
- if (i == -1 && DEBUG)
- fprintf(stderr, "Default scripts dir does not seem valid.\n\n");
- }
- if( stat_dir2 == 0 ) {
- BLI_strncpy(dirname, U.pythondir, FILE_MAX);
- BLI_convertstringcode(dirname, G.sce);
- i = bpymenu_ParseDir( dirname, NULL, 1 );
- if (i == -1 && DEBUG)
- fprintf(stderr, "User defined scripts dir does not seem valid.\n\n");
- }
-
- /* check if we got any data */
- for( i = 0; i < PYMENU_TOTAL; i++ )
- if( BPyMenuTable[i] )
- break;
-
- /* if we got, recreate the file */
- if( i < PYMENU_TOTAL )
- bpymenu_WriteDataFile( );
- else if( DEBUG ) {
- fprintf(stderr, "\n\
-Warning: Registering scripts in menus -- no info found.\n\
-Either your scripts dirs have no .py scripts or the scripts\n\
-don't have a header with registration data.\n\
-Default scripts dir is:\n\
-%s\n", dirname );
- if( upydir )
- fprintf(stderr, "User defined scripts dir is: %s\n",
- upythondir );
- }
- }
-
- return 0;
-}
diff --git a/source/blender/python/BPY_menus.h b/source/blender/python/BPY_menus.h
deleted file mode 100644
index 576d7b8dcd6..00000000000
--- a/source/blender/python/BPY_menus.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Matt Ebb
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef BPY_MENUS_H
-#define BPY_MENUS_H
-
-/* This header exposes BPyMenu related public declarations. The implementation
- * adds 'dynamic' menus to Blender, letting scripts register themselves in any
- * of a few pre-defined (trivial to upgrade) places in menus. These places or
- * slots are called groups here (Import, Export, etc). This is how it works:
- * - scripts at dirs user pref U.pythondir and .blender/scripts/ are scanned
- * for registration info.
- * - this data is also saved to a Bpymenus file at the user's .blender/ dir and
- * only re-created when the scripts folder gets modified.
- * - on start-up Blender uses this info to fill a table, which is used to
- * create the menu entries when they are needed (see header_info.c or
- * header_script.c, under source/blender/src/, for examples).
-*/
-
-/* These two structs hold py menu/submenu info.
- * BPyMenu holds a script's name (as should appear in the menu) and filename,
- * plus an optional list of submenus. Each submenu is related to a string
- * (arg) that the script can get from the __script__ pydict, to know which
- * submenu was chosen. */
-
-typedef struct BPySubMenu {
- char *name;
- char *arg;
- struct BPySubMenu *next;
-} BPySubMenu;
-
-typedef struct BPyMenu {
- char *name;
- char *filename;
- char *tooltip;
- unsigned short key, qual; /* Registered shortcut key */
- short version; /* Blender version */
- int dir; /* 0: default, 1: U.pythondir */
- struct BPySubMenu *submenus;
- struct BPyMenu *next;
-} BPyMenu;
-
-/* Scripts can be added to only a few pre-defined places in menus, like
- * File->Import, File->Export, etc. (for speed and better control).
- * To make a new menu 'slot' available for scripts:
- * - add an entry to the enum below, before PYMENU_TOTAL, of course;
- * - update the bpymenu_group_atoi() and BPyMenu_group_itoa() functions in
- * BPY_menus.c;
- * - add the necessary code to the header_***.c file in
- * source/blender/src/, like done in header_info.c for import/export;
-*/
-typedef enum {
- PYMENU_ADD,/* creates new objects */
- PYMENU_ANIMATION,
- PYMENU_EXPORT,
- PYMENU_IMPORT,
- PYMENU_MATERIALS,
- PYMENU_MESH,
- PYMENU_MISC,
- PYMENU_OBJECT,
- PYMENU_RENDER,/* exporters to external renderers */
- PYMENU_SYSTEM,
- PYMENU_THEMES,
- PYMENU_UV,/* UV editing tools, to go in UV/Image editor space, 'UV' menu */
- PYMENU_IMAGE,/* Image editing tools, to go in UV/Image editor space, 'Image' menu */
- PYMENU_WIZARDS,/* complex 'app' scripts */
-
- /* entries put after Wizards don't appear at the Scripts win->Scripts menu;
- * see define right below */
-
- PYMENU_FACESELECT,
- PYMENU_WEIGHTPAINT,
- PYMENU_VERTEXPAINT,
- PYMENU_UVCALCULATION,
- PYMENU_ARMATURE,
- PYMENU_SCRIPTTEMPLATE,
- PYMENU_TEXTPLUGIN,
- PYMENU_HELP,/*Main Help menu items - prob best to leave for 'official' ones*/
- PYMENU_HELPSYSTEM,/* Resources, troubleshooting, system tools */
- PYMENU_HELPWEBSITES,/* Help -> Websites submenu */
- PYMENU_MESHFACEKEY, /* face key in mesh editmode */
- PYMENU_ADDMESH, /* adds mesh */
- PYMENU_TOTAL
-} PYMENUHOOKS;
-
-#define PYMENU_SCRIPTS_MENU_TOTAL (PYMENU_WIZARDS + 1)
-
-/* BPyMenuTable holds all registered pymenus, as linked lists for each menu
- * where they can appear (see PYMENUHOOKS enum above).
-*/
-extern BPyMenu *BPyMenuTable[]; /* defined in BPY_menus.c */
-
-/* public functions: */
-int BPyMenu_Init( int usedir );
-void BPyMenu_RemoveAllEntries( void );
-void BPyMenu_PrintAllEntries( void );
-char *BPyMenu_CreatePupmenuStr( BPyMenu * pym, short group );
-char *BPyMenu_group_itoa( short group );
-struct BPyMenu *BPyMenu_GetEntry( short group, short pos );
-
-#endif /* BPY_MENUS_H */
diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt
index 63a1e67236e..c4a7c905e20 100644
--- a/source/blender/python/CMakeLists.txt
+++ b/source/blender/python/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -24,35 +23,41 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC api2_2x/*.c)
-SET(SRC ${SRC}
- BPY_interface.c
- BPY_menus.c
-)
+FILE(GLOB SRC intern/*.c)
SET(INC
- api2_2x ../blenkernel ../blenlib ../blenloader
- ../render/extern/include ../radiosity/extern/include
- ../makesdna ../../../intern/guardedalloc ../../../intern/bmfont ../imbuf ../include
- ${PYTHON_INC} ../../../extern/glew/include ../gpu
+ . ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna
+ ../blenkernel ../editors/include ${PYTHON_INC}
)
-IF(WITH_QUICKTIME)
- SET(INC ${INC} ${QUICKTIME_INC})
- ADD_DEFINITIONS(-DWITH_QUICKTIME)
-ENDIF(WITH_QUICKTIME)
+IF(WITH_VERSE)
+ ADD_DEFINITIONS(-DWITH_VERSE)
+ SET(INC ${INC} ${VERSE_INC})
+ENDIF(WITH_VERSE)
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
+IF(WITH_QUICKTIME)
+ SET(INC ${INC} ${QUICKTIME_INC})
+ ADD_DEFINITIONS(-DWITH_QUICKTIME)
+ENDIF(WITH_QUICKTIME)
+
IF(WITH_FFMPEG)
+ SET(INC ${INC} ${FFMPEG_INC})
ADD_DEFINITIONS(-DWITH_FFMPEG)
ENDIF(WITH_FFMPEG)
-IF(BF_BUILDINFO)
- ADD_DEFINITIONS(-DNAN_BUILDINFO)
-ENDIF(BF_BUILDINFO)
+ADD_DEFINITIONS(-DWITH_CCGSUBSURF)
+
+BLENDERLIB(bf_python "${SRC}" "${INC}")
+
+IF(WITH_VERSE)
+ ADD_DEPENDENCIES(bf_nodes mkprot verse)
+ENDIF(WITH_VERSE)
+
+IF(WITH_INTERNATIONAL)
+ ADD_DEFINITIONS(-DWITH_FREETYPE2)
+ENDIF(WITH_INTERNATIONAL)
-BLENDERLIB_NOLIST(blender_python "${SRC}" "${INC}")
-#env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )
diff --git a/source/blender/python/Makefile b/source/blender/python/Makefile
index cad5db59dd1..c830fbb3ccf 100644
--- a/source/blender/python/Makefile
+++ b/source/blender/python/Makefile
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile 14444 2008-04-16 22:40:48Z hos $
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# The Original Code is Copyright (C) Blender Foundation.
# All rights reserved.
#
# The Original Code is: all of this file.
@@ -29,6 +29,6 @@
# Bounces make to subdirectories.
SOURCEDIR = source/blender/python
-DIRS = api2_2x
+DIRS = intern
include nan_subdirs.mk
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript
index 670041a6504..6190ed5c0ec 100644
--- a/source/blender/python/SConscript
+++ b/source/blender/python/SConscript
@@ -1,30 +1,16 @@
#!/usr/bin/python
Import ('env')
-sources = env.Glob('*.c') + env.Glob('api2_2x/*.c')
+sources = env.Glob('intern/*.c')
-incs = 'api2_2x ../blenkernel ../nodes ../blenlib ../blenloader'
-incs += ' ../render/extern/include ../radiosity/extern/include'
-incs += ' ../makesdna #intern/guardedalloc #intern/bmfont ../imbuf ../include'
-incs += ' #extern/glew/include ../gpu'
+incs = '. ../editors/include ../makesdna ../makesrna ../blenlib ../blenkernel ../nodes'
+incs += ' ../imbuf ../blenloader ../render/extern/include'
+incs += ' #intern/guardedalloc #intern/memutil'
incs += ' ' + env['BF_PYTHON_INC']
-incs += ' ' + env['BF_OPENGL_INC']
defs = []
-if env['OURPLATFORM'] in ('win32-mingw') and env['BF_DEBUG']:
- defs.append('Py_TRACE_REFS')
-
-if env['WITH_BF_QUICKTIME']:
- incs += ' ' + env['BF_QUICKTIME_INC']
- defs.append('WITH_QUICKTIME')
-
-if env['WITH_BF_OPENEXR']:
- defs.append('WITH_OPENEXR')
-if env['WITH_BF_FFMPEG']:
- defs.append('WITH_FFMPEG')
-
-if env['BF_BUILDINFO']:
- defs.append('NAN_BUILDINFO')
+if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc') and env['BF_DEBUG']:
+ defs.append('Py_TRACE_REFS')
-env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )
+env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','intern'], priority = [33,43])
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
deleted file mode 100644
index 99a4398ec89..00000000000
--- a/source/blender/python/api2_2x/Armature.c
+++ /dev/null
@@ -1,1489 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <stddef.h>
-
-#include "Armature.h" //This must come first
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_armature.h"
-#include "BKE_library.h"
-#include "BKE_depsgraph.h"
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "MEM_guardedalloc.h"
-#include "Bone.h"
-#include "NLA.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "DNA_object_types.h" //This must come before BIF_editarmature.h...
-#include "BIF_editarmature.h"
-
-//------------------EXTERNAL PROTOTYPES--------------------
-extern void make_boneList(ListBase* list, ListBase *bones, EditBone *parent);
-extern void editbones_to_armature (ListBase *list, Object *ob);
-
-//------------------------ERROR CODES---------------------------------
-//This is here just to make me happy and to have more consistant error strings :)
-static const char sBoneDictError[] = "ArmatureType.bones - Error: ";
-static const char sBoneDictBadArgs[] = "ArmatureType.bones - Bad Arguments: ";
-static const char sArmatureError[] = "ArmatureType - Error: ";
-static const char sArmatureBadArgs[] = "ArmatureType - Bad Arguments: ";
-static const char sModuleError[] = "Blender.Armature - Error: ";
-static const char sModuleBadArgs[] = "Blender.Armature - Bad Arguments: ";
-
-static PyObject * arm_weakref_callback_weakref_dealloc(PyObject *self, PyObject *weakref);
-/* python callable */
-static PyObject * arm_weakref_callback_weakref_dealloc__pyfunc;
-
-//################## BonesDict_Type (internal) ########################
-/*This is an internal psuedo-dictionary type that allows for manipulation
-* of bones inside of an armature. It is a subobject of armature.
-* i.e. Armature.bones['key']*/
-//#####################################################################
-
-//------------------METHOD IMPLEMENTATIONS-----------------------------
-//------------------------Armature.bones.items()
-//Returns a list of key:value pairs like dict.items()
-static PyObject* BonesDict_items(BPy_BonesDict *self)
-{
- if (self->editmode_flag){
- return PyDict_Items(self->editbonesMap);
- }else{
- return PyDict_Items(self->bonesMap);
- }
-}
-//------------------------Armature.bones.keys()
-//Returns a list of keys like dict.keys()
-static PyObject* BonesDict_keys(BPy_BonesDict *self)
-{
- if (self->editmode_flag){
- return PyDict_Keys(self->editbonesMap);
- }else{
- return PyDict_Keys(self->bonesMap);
- }
-}
-//------------------------Armature.bones.values()
-//Returns a list of values like dict.values()
-static PyObject* BonesDict_values(BPy_BonesDict *self)
-{
- if (self->editmode_flag){
- return PyDict_Values(self->editbonesMap);
- }else{
- return PyDict_Values(self->bonesMap);
- }
-}
-//------------------ATTRIBUTE IMPLEMENTATION---------------------------
-//------------------TYPE_OBECT IMPLEMENTATION-----------------------
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_BonesDict_doc[] = "This is an internal subobject of armature\
-designed to act as a Py_Bone dictionary.";
-
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_BonesDict_methods[] = {
- {"items", (PyCFunction) BonesDict_items, METH_NOARGS,
- "() - Returns the key:value pairs from the dictionary"},
- {"keys", (PyCFunction) BonesDict_keys, METH_NOARGS,
- "() - Returns the keys the dictionary"},
- {"values", (PyCFunction) BonesDict_values, METH_NOARGS,
- "() - Returns the values from the dictionary"},
- {NULL, NULL, 0, NULL}
-};
-//-----------------(internal)
-static int BoneMapping_Init(PyObject *dictionary, ListBase *bones){
- Bone *bone = NULL;
- PyObject *py_bone = NULL;
-
- for (bone = bones->first; bone; bone = bone->next){
- py_bone = PyBone_FromBone(bone);
- if (!py_bone)
- return -1;
-
- if(PyDict_SetItemString(dictionary, bone->name, py_bone) == -1) {
- /* unlikely but possible */
- Py_DECREF(py_bone);
- return -1;
- }
-
- Py_DECREF(py_bone);
- if (bone->childbase.first)
- BoneMapping_Init(dictionary, &bone->childbase);
- }
- return 0;
-}
-//-----------------(internal)
-static int EditBoneMapping_Init(PyObject *dictionary, ListBase *editbones){
- EditBone *editbone = NULL;
- PyObject *py_editbone = NULL;
-
- for (editbone = editbones->first; editbone; editbone = editbone->next){
- py_editbone = PyEditBone_FromEditBone(editbone);
- if (!py_editbone)
- return -1;
-
- if(PyDict_SetItemString(dictionary, editbone->name, py_editbone) == -1) {
- Py_DECREF(py_editbone);
- return -1;
- }
- Py_DECREF(py_editbone);
- }
- return 0;
-}
-//----------------- BonesDict_InitBones
-static int BonesDict_InitBones(BPy_BonesDict *self)
-{
- PyDict_Clear(self->bonesMap);
- if (BoneMapping_Init(self->bonesMap, self->bones) == -1)
- return 0;
- return 1;
-}
-//----------------- BonesDict_InitEditBones
-static int BonesDict_InitEditBones(BPy_BonesDict *self)
-{
- PyDict_Clear(self->editbonesMap);
- if (EditBoneMapping_Init(self->editbonesMap, &self->editbones) == -1)
- return 0;
- return 1;
-}
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *BonesDict_repr(BPy_BonesDict *self)
-{
- char str[2048];
- PyObject *key, *value;
- Py_ssize_t pos = 0;
- char *p = str;
- char *keys, *vals;
-
- p += sprintf(str, "[Bone Dict: {");
-
- if (self->editmode_flag){
- while (PyDict_Next(self->editbonesMap, &pos, &key, &value)) {
- keys = PyString_AsString(key);
- vals = PyString_AsString(value->ob_type->tp_repr(value));
- if( strlen(str) + strlen(keys) + strlen(vals) < sizeof(str)-20 )
- p += sprintf(p, "%s : %s, ", keys, vals );
- else {
- p += sprintf(p, "...." );
- break;
- }
- }
- }else{
- while (PyDict_Next(self->bonesMap, &pos, &key, &value)) {
- keys = PyString_AsString(key);
- vals = PyString_AsString(value->ob_type->tp_repr(value));
- if( strlen(str) + strlen(keys) + strlen(vals) < sizeof(str)-20 )
- p += sprintf(p, "%s : %s, ", keys, vals );
- else {
- p += sprintf(p, "...." );
- break;
- }
- }
- }
- sprintf(p, "}]");
- return PyString_FromString(str);
-}
-
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-static void BonesDict_dealloc(BPy_BonesDict * self)
-{
- Py_DECREF(self->bonesMap);
- Py_DECREF(self->editbonesMap);
- BLI_freelistN(&self->editbones);
- PyObject_DEL( self );
- return;
-}
-//------------------------mp_length
-//This gets the size of the dictionary
-static int BonesDict_len(BPy_BonesDict *self)
-{
- if (self->editmode_flag){
- return BLI_countlist(&self->editbones);
- }else{
- return BLI_countlist(self->bones);
- }
-}
-//-----------------------mp_subscript
-//This defines getting a bone from the dictionary - x = Bones['key']
-static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
-{
- PyObject *value = NULL;
-
- if (self->editmode_flag){
- value = PyDict_GetItem(self->editbonesMap, key);
- }else{
- value = PyDict_GetItem(self->bonesMap, key);
- }
- if(value == NULL){ /* item not found in dict. throw exception */
- char* key_str = PyString_AsString( key );
-
- if (key_str==NULL) {
- return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
- } else {
- char buffer[128];
- PyOS_snprintf( buffer, sizeof(buffer), "bone %s not found", key_str);
- return EXPP_ReturnPyObjError(PyExc_KeyError, buffer );
- }
- }
- return EXPP_incr_ret(value);
-}
-//-----------------------mp_ass_subscript
-//This does dict assignment - Bones['key'] = value
-static int BonesDict_SetItem(BPy_BonesDict *self, PyObject *key, PyObject *value)
-{
- BPy_EditBone *editbone_for_deletion;
- struct EditBone *editbone = NULL;
- char *key_str = PyString_AsString(key);
-
- if (!self->editmode_flag)
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sBoneDictBadArgs, "You must call makeEditable() first");
-
- if (!key_str)
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sBoneDictBadArgs, "The key must be the name of an editbone");
-
- if (value && !EditBoneObject_Check(value))
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sBoneDictBadArgs, "Can only assign editbones as values");
-
- //parse value for assignment
- if (value){ /* we know this must be an editbone from the above check */
- //create a new editbone
- editbone = MEM_callocN(sizeof(EditBone), "eBone");
- BLI_strncpy(editbone->name, key_str, 32);
- unique_editbone_name(NULL, editbone->name);
- editbone->dist = ((BPy_EditBone*)value)->dist;
- editbone->ease1 = ((BPy_EditBone*)value)->ease1;
- editbone->ease2 = ((BPy_EditBone*)value)->ease2;
- editbone->flag = ((BPy_EditBone*)value)->flag;
- editbone->parent = ((BPy_EditBone*)value)->parent;
- editbone->rad_head = ((BPy_EditBone*)value)->rad_head;
- editbone->rad_tail = ((BPy_EditBone*)value)->rad_tail;
- editbone->roll = ((BPy_EditBone*)value)->roll;
- editbone->segments = ((BPy_EditBone*)value)->segments;
- editbone->weight = ((BPy_EditBone*)value)->weight;
- editbone->xwidth = ((BPy_EditBone*)value)->xwidth;
- editbone->zwidth = ((BPy_EditBone*)value)->zwidth;
- VECCOPY(editbone->head, ((BPy_EditBone*)value)->head);
- VECCOPY(editbone->tail, ((BPy_EditBone*)value)->tail);
- editbone->layer= ((BPy_EditBone*)value)->layer;
-
- //set object pointer
- ((BPy_EditBone*)value)->editbone = editbone;
-
- //fix the bone's head position if flags indicate that it is 'connected'
- if (editbone->flag & BONE_CONNECTED){
- if(!editbone->parent){
- ((BPy_EditBone*)value)->editbone = NULL;
- MEM_freeN(editbone);
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sBoneDictBadArgs, "The 'connected' flag is set but the bone has no parent!");
- }else{
- VECCOPY(editbone->head, editbone->parent->tail);
- }
- }
-
- //set in editbonelist
- BLI_addtail(&self->editbones, editbone);
-
- //set the new editbone in the mapping
- if(PyDict_SetItemString(self->editbonesMap, key_str, value) == -1){
- ((BPy_EditBone*)value)->editbone = NULL;
- BLI_freelinkN(&self->editbones, editbone);
- return EXPP_intError(PyExc_RuntimeError, "%s%s",
- sBoneDictError, "Unable to access dictionary!");
- }
- }else {
- //they are trying to delete the bone using 'del'
- editbone_for_deletion = (BPy_EditBone*)PyDict_GetItem(self->editbonesMap, key);
-
- if (!editbone_for_deletion)
- return EXPP_intError(PyExc_KeyError, "%s%s%s%s",
- sBoneDictError, "The key: ", key_str, " is not present in this dictionary!");
-
- /*first kill the datastruct then remove the item from the dict
- and wait for GC to pick it up.
- We have to delete the datastruct here because the tp_dealloc
- doesn't handle it*/
-
- /*this is ugly but you have to set the parent to NULL for else
- editbones_to_armature will crash looking for this bone*/
- for (editbone = self->editbones.first; editbone; editbone = editbone->next){
- if (editbone->parent == editbone_for_deletion->editbone) {
- editbone->parent = NULL;
- /* remove the connected flag or else the 'root' ball
- * doesn't get drawn */
- editbone->flag &= ~BONE_CONNECTED;
- }
- }
- BLI_freelinkN(&self->editbones, editbone_for_deletion->editbone);
- if(PyDict_DelItem(self->editbonesMap, key) == -1)
- return EXPP_intError(PyExc_RuntimeError, "%s%s",
- sBoneDictError, "Unable to access dictionary!");
- }
- return 0;
-}
-//------------------TYPE_OBJECT DEFINITION--------------------------
-//Mapping Protocol
-static PyMappingMethods BonesDict_MapMethods = {
- (inquiry) BonesDict_len, //mp_length
- (binaryfunc)BonesDict_GetItem, //mp_subscript
- (objobjargproc)BonesDict_SetItem, //mp_ass_subscript
-};
-//BonesDict TypeObject
-PyTypeObject BonesDict_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "BonesDict", //tp_name
- sizeof(BPy_BonesDict), //tp_basicsize
- 0, //tp_itemsize
- (destructor)BonesDict_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
- (reprfunc) BonesDict_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- &BonesDict_MapMethods, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_BonesDict_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_BonesDict_methods, //tp_methods
- 0, //tp_members
- 0, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//-----------------------PyBonesDict_FromPyArmature
-static PyObject *PyBonesDict_FromPyArmature(BPy_Armature *py_armature)
-{
- BPy_BonesDict *py_BonesDict = (BPy_BonesDict *)PyObject_NEW( BPy_BonesDict, &BonesDict_Type );
- if (!py_BonesDict)
- goto RuntimeError;
-
- py_BonesDict->bones = NULL;
- py_BonesDict->editbones.first = py_BonesDict->editbones.last = NULL;
-
- //create internal dictionaries
- py_BonesDict->bonesMap = PyDict_New();
- py_BonesDict->editbonesMap = PyDict_New();
- if (!py_BonesDict->bonesMap || !py_BonesDict->editbonesMap)
- goto RuntimeError;
-
- //set listbase pointer
- py_BonesDict->bones = &py_armature->armature->bonebase;
-
- //now that everything is setup - init the mappings
- if (!BonesDict_InitBones(py_BonesDict))
- goto RuntimeError;
- if (!BonesDict_InitEditBones(py_BonesDict))
- goto RuntimeError;
-
- //set editmode flag
- py_BonesDict->editmode_flag = 0;
-
- return (PyObject*)py_BonesDict;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s",
- sBoneDictError, "Failed to create class");
-}
-
-//######################### Armature_Type #############################
-/*This type represents a thin wrapper around bArmature data types
-* internal to blender. It contains the psuedo-dictionary BonesDict
-* as an assistant in manipulating it's own bone collection*/
-//#################################################################
-
-//------------------METHOD IMPLEMENTATION------------------------------
-//------------------------Armature.makeEditable()
-static PyObject *Armature_makeEditable(BPy_Armature *self)
-{
- if (self->armature->flag & ARM_EDITMODE)
- goto AttributeError;
-
- make_boneList(&self->Bones->editbones, self->Bones->bones, NULL);
- if (!BonesDict_InitEditBones(self->Bones))
- return NULL;
- self->Bones->editmode_flag = 1;
- return EXPP_incr_ret(Py_None);
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "The armature cannot be placed manually in editmode before you call makeEditable()!");
-}
-
-//------------------------Armature.update()
-//This is a bit ugly because you need an object link to do this
-static PyObject *Armature_update(BPy_Armature *self)
-{
- Object *obj = NULL;
-
- for (obj = G.main->object.first; obj; obj = obj->id.next){
- if (obj->data == self->armature)
- break;
- }
- if (obj){
- editbones_to_armature (&self->Bones->editbones, obj);
- if (!BonesDict_InitBones(self->Bones))
- return NULL;
- self->Bones->editmode_flag = 0;
- BLI_freelistN(&self->Bones->editbones);
- }else{
- goto AttributeError;
-
- }
- return EXPP_incr_ret(Py_None);
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "The armature must be linked to an object before you can save changes!");
-}
-
-//------------------------Armature.__copy__()
-static PyObject *Armature_copy(BPy_Armature *self)
-{
- PyObject *py_armature = NULL;
- bArmature *bl_armature;
- bl_armature= copy_armature(self->armature);
- bl_armature->id.us= 0;
- py_armature= Armature_CreatePyObject( bl_armature );
- return py_armature;
-}
-
-//------------------ATTRIBUTE IMPLEMENTATION---------------------------
-//------------------------Armature.autoIK (getter)
-static PyObject *Armature_getAutoIK(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_AUTO_IK)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.autoIK (setter)
-static int Armature_setAutoIK(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_AUTO_IK;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_AUTO_IK;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.layers (getter)
-static PyObject *Armature_getLayers(BPy_Armature *self, void *closure)
-{
- int layers, bit = 0, val = 0;
- PyObject *item = NULL, *laylist = PyList_New( 0 );
-
- if( !laylist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create pylist!" );
-
- layers = self->armature->layer;
-
- while( bit < 20 ) {
- val = 1 << bit;
- if( layers & val ) {
- item = Py_BuildValue( "i", bit + 1 );
- PyList_Append( laylist, item );
- Py_DECREF( item );
- }
- bit++;
- }
- return laylist;
-}
-//------------------------Armature.layer (setter)
-static int Armature_setLayers(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyList_Check(value)){
- int layers = 0, len_list = 0;
- int val;
- PyObject *item = NULL;
-
- len_list = PyList_Size(value);
-
- if( len_list == 0 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "list can't be empty, at least one layer must be set" );
-
- while( len_list ) {
- --len_list;
- item = PyList_GetItem( value, len_list );
- if( !PyInt_Check( item ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "list must contain only integer numbers" );
-
- val = ( int ) PyInt_AsLong( item );
- if( val < 1 || val > 20 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "layer values must be in the range [1, 20]" );
-
- layers |= 1 << ( val - 1 );
- }
-
- /* update any bases pointing to our object */
- self->armature->layer = (short)layers;
-
- return 0;
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of integers" );
-}
-
-//------------------------Armature.mirrorEdit (getter)
-static PyObject *Armature_getMirrorEdit(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_MIRROR_EDIT)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.mirrorEdit (setter)
-static int Armature_setMirrorEdit(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_MIRROR_EDIT;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_MIRROR_EDIT;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.drawType (getter)
-static PyObject *Armature_getDrawType(BPy_Armature *self, void *closure)
-{
- if (self->armature->drawtype == ARM_OCTA){
- return EXPP_GetModuleConstant("Blender.Armature", "OCTAHEDRON") ;
- }else if (self->armature->drawtype == ARM_LINE){
- return EXPP_GetModuleConstant("Blender.Armature", "STICK") ;
- }else if (self->armature->drawtype == ARM_B_BONE){
- return EXPP_GetModuleConstant("Blender.Armature", "BBONE") ;
- }else if (self->armature->drawtype == ARM_ENVELOPE){
- return EXPP_GetModuleConstant("Blender.Armature", "ENVELOPE") ;
- }else{
- goto RuntimeError;
- }
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sArmatureError, "drawType: ", "Internal failure!");
-}
-//------------------------Armature.drawType (setter)
-static int Armature_setDrawType(BPy_Armature *self, PyObject *value, void *closure)
-{
- PyObject *val = NULL, *name = NULL;
- long numeric_value;
-
- if(value){
- if(BPy_Constant_Check(value)){
- name = PyDict_GetItemString(((BPy_constant*)value)->dict, "name");
- if (!STREQ2(PyString_AsString(name), "OCTAHEDRON", "STICK") &&
- !STREQ2(PyString_AsString(name), "BBONE", "ENVELOPE"))
- goto ValueError;
- val = PyDict_GetItemString(((BPy_constant*)value)->dict, "value");
- if (PyInt_Check(val)){
- numeric_value = PyInt_AS_LONG(val);
- self->armature->drawtype = (int)numeric_value;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects module constant");
-
-ValueError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Argument must be the constant OCTAHEDRON, STICK, BBONE, or ENVELOPE");
-}
-//------------------------Armature.ghostStep (getter)
-static PyObject *Armature_getStep(BPy_Armature *self, void *closure)
-{
- return PyInt_FromLong((long)self->armature->ghostsize);
-}
-//------------------------Armature.ghostStep (setter)
-static int Armature_setStep(BPy_Armature *self, PyObject *value, void *closure)
-{
- long numerical_value;
-
- if(value){
- if(PyInt_Check(value)){
- numerical_value = PyInt_AS_LONG(value);
- if (numerical_value > 20.0f || numerical_value < 1.0f)
- goto ValueError;
- self->armature->ghostsize = (short)numerical_value;
- return 0;
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects Integer");
-
-ValueError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Argument must fall within 1-20");
-}
-//------------------------Armature.ghost (getter)
-static PyObject *Armature_getGhost(BPy_Armature *self, void *closure)
-{
- return PyInt_FromLong((long)self->armature->ghostep);
-}
-//------------------------Armature.ghost (setter)
-static int Armature_setGhost(BPy_Armature *self, PyObject *value, void *closure)
-{
- long numerical_value;
-
- if(value){
- if(PyInt_Check(value)){
- numerical_value = PyInt_AS_LONG(value);
- if (numerical_value > 30.0f || numerical_value < 0.0f)
- goto ValueError;
- self->armature->ghostep = (short)numerical_value;
- return 0;
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects Integer");
-
-ValueError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Argument must fall within 0-30");
-}
-//------------------------Armature.drawNames (getter)
-static PyObject *Armature_getDrawNames(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_DRAWNAMES)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.drawNames (setter)
-static int Armature_setDrawNames(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_DRAWNAMES;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_DRAWNAMES;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.drawAxes (getter)
-static PyObject *Armature_getDrawAxes(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_DRAWAXES)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.drawAxes (setter)
-static int Armature_setDrawAxes(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_DRAWAXES;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_DRAWAXES;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.delayDeform (getter)
-static PyObject *Armature_getDelayDeform(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_DELAYDEFORM)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.delayDeform (setter)
-static int Armature_setDelayDeform(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_DELAYDEFORM;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_DELAYDEFORM;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.restPosition (getter)
-static PyObject *Armature_getRestPosition(BPy_Armature *self, void *closure)
-{
- if (self->armature->flag & ARM_RESTPOS)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.restPosition (setter)
-static int Armature_setRestPosition(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->flag |= ARM_RESTPOS;
- return 0;
- }else if (value == Py_False){
- self->armature->flag &= ~ARM_RESTPOS;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.envelopes (getter)
-static PyObject *Armature_getEnvelopes(BPy_Armature *self, void *closure)
-{
- if (self->armature->deformflag & ARM_DEF_ENVELOPE)
- return EXPP_incr_ret(Py_True);
- else
- return EXPP_incr_ret(Py_False);
-}
-//------------------------Armature.envelopes (setter)
-static int Armature_setEnvelopes(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->deformflag |= ARM_DEF_ENVELOPE;
- return 0;
- }else if (value == Py_False){
- self->armature->deformflag &= ~ARM_DEF_ENVELOPE;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-//------------------------Armature.vertexGroups (getter)
-static PyObject *Armature_getVertexGroups(BPy_Armature *self, void *closure)
-{
- if (self->armature->deformflag & ARM_DEF_VGROUP)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-//------------------------Armature.vertexGroups (setter)
-static int Armature_setVertexGroups(BPy_Armature *self, PyObject *value, void *closure)
-{
- if(value){
- if(PyBool_Check(value)){
- if (value == Py_True){
- self->armature->deformflag |= ARM_DEF_VGROUP;
- return 0;
- }else if (value == Py_False){
- self->armature->deformflag &= ~ARM_DEF_VGROUP;
- return 0;
- }
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects True or False");
-}
-
-//------------------------Armature.bones (getter)
-//Gets the name of the armature
-static PyObject *Armature_getBoneDict(BPy_Armature *self, void *closure)
-{
- return EXPP_incr_ret((PyObject*)self->Bones);
-}
-//------------------------Armature.bones (setter)
-//Sets the name of the armature
-/*TODO*/
-/*Copy Bones through x = y*/
-static int Armature_setBoneDict(BPy_Armature *self, PyObject *value, void *closure)
-{
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureError, "You are not allowed to change the .Bones attribute");
-}
-
-//------------------------Armature.layerMask (get)
-static PyObject *Armature_getLayerMask(BPy_Armature *self)
-{
- /* do this extra stuff because the short's bits can be negative values */
- unsigned short laymask = 0;
- laymask |= self->armature->layer;
- return PyInt_FromLong((int)laymask);
-}
-//------------------------Armature.layerMask (set)
-static int Armature_setLayerMask(BPy_Armature *self, PyObject *value)
-{
- int laymask;
- if (!PyInt_Check(value)) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected an integer (bitmask) as argument" );
- }
-
- laymask = PyInt_AsLong(value);
-
- if (laymask <= 0 || laymask > (1<<16) - 1)
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "bitmask must have from 1 up to 16 bits set");
-
- self->armature->layer = 0;
- self->armature->layer |= laymask;
-
- return 0;
-}
-
-//------------------TYPE_OBECT IMPLEMENTATION--------------------------
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_Armature_doc[] = "This object wraps a Blender Armature object.";
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_Armature_methods[] = {
- {"makeEditable", (PyCFunction) Armature_makeEditable, METH_NOARGS,
- "() - Unlocks the ability to modify armature bones"},
- {"update", (PyCFunction) Armature_update, METH_NOARGS,
- "() - Rebuilds the armature based on changes to bones since the last call to makeEditable"},
- {"__copy__", (PyCFunction) Armature_copy, METH_NOARGS,
- "() - Return a copy of the armature."},
- {"copy", (PyCFunction) Armature_copy, METH_NOARGS,
- "() - Return a copy of the armature."},
- {NULL, NULL, 0, NULL}
-};
-//------------------------tp_getset
-//This contains methods for attributes that require checking
-static PyGetSetDef BPy_Armature_getset[] = {
- GENERIC_LIB_GETSETATTR,
- {"bones", (getter)Armature_getBoneDict, (setter)Armature_setBoneDict,
- "The armature's Bone dictionary", NULL},
- {"vertexGroups", (getter)Armature_getVertexGroups, (setter)Armature_setVertexGroups,
- "Enable/Disable vertex group defined deformation", NULL},
- {"envelopes", (getter)Armature_getEnvelopes, (setter)Armature_setEnvelopes,
- "Enable/Disable bone envelope defined deformation", NULL},
- {"restPosition", (getter)Armature_getRestPosition, (setter)Armature_setRestPosition,
- "Show armature rest position - disables posing", NULL},
- {"delayDeform", (getter)Armature_getDelayDeform, (setter)Armature_setDelayDeform,
- "Don't deform children when manipulating bones in pose mode", NULL},
- {"drawAxes", (getter)Armature_getDrawAxes, (setter)Armature_setDrawAxes,
- "Enable/Disable drawing the bone axes", NULL},
- {"drawNames", (getter)Armature_getDrawNames, (setter)Armature_setDrawNames,
- "Enable/Disable drawing the bone names", NULL},
- {"ghost", (getter)Armature_getGhost, (setter)Armature_setGhost,
- "Draw a number of ghosts around the current frame for current Action", NULL},
- {"ghostStep", (getter)Armature_getStep, (setter)Armature_setStep,
- "The number of frames between ghost instances", NULL},
- {"drawType", (getter)Armature_getDrawType, (setter)Armature_setDrawType,
- "The type of drawing currently applied to the armature", NULL},
- {"mirrorEdit", (getter)Armature_getMirrorEdit, (setter)Armature_setMirrorEdit,
- "Enable/Disable X-axis mirrored editing", NULL},
- {"autoIK", (getter)Armature_getAutoIK, (setter)Armature_setAutoIK,
- "Adds temporal IK chains while grabbing bones", NULL},
- {"layers", (getter)Armature_getLayers, (setter)Armature_setLayers,
- "List of layers for the armature", NULL},
- {"layerMask", (getter)Armature_getLayerMask, (setter)Armature_setLayerMask,
- "Layer bitmask", NULL },
- {NULL, NULL, NULL, NULL, NULL}
-};
-//------------------------tp_new
-//This methods creates a new object (note it does not initialize it - only the building)
-//This can be called through python by myObject.__new__() however, tp_init is not called
-static PyObject *Armature_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- BPy_Armature *py_armature = NULL;
- bArmature *bl_armature;
-
- bl_armature = add_armature("Armature");
- if(bl_armature) {
- bl_armature->id.us = 0; // return count to 0 - add_armature() inc'd it
-
- py_armature = (BPy_Armature*)type->tp_alloc(type, 0); //*new*
- if (py_armature == NULL)
- goto RuntimeError;
-
- py_armature->armature = bl_armature;
-
- //create armature.bones
- py_armature->Bones = (BPy_BonesDict*)PyBonesDict_FromPyArmature(py_armature);
- if (!py_armature->Bones)
- goto RuntimeError;
-
- } else {
- goto RuntimeError;
- }
- return (PyObject*)py_armature;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sArmatureError, " __new__: ", "couldn't create Armature Data in Blender");
-}
-//------------------------tp_init
-//This methods does initialization of the new object
-//This method will get called in python by 'myObject(argument, keyword=value)'
-//tp_new will be automatically called before this
-static int Armature_init(BPy_Armature *self, PyObject *args, PyObject *kwds)
-{
- char buf[21];
- char *name = "myArmature";
- static char *kwlist[] = {"name", NULL};
-
- if(!PyArg_ParseTupleAndKeywords(args, kwds, "|s", kwlist, &name)){
- goto AttributeError;
- }
-
- //rename the armature if a name is supplied
- if(!BLI_streq(name, "myArmature")){
- PyOS_snprintf(buf, sizeof(buf), "%s", name);
- rename_id(&self->armature->id, buf);
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sArmatureBadArgs, " __init__: ", "Expects string(name)");
-}
-
-
-/*****************************************************************************/
-/* Function: Armature_compare */
-/* Description: This is a callback function for the BPy_Armature type. It */
-/* compares two Armature_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Object struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Armature_compare( BPy_Armature * a, BPy_Armature * b )
-{
- return ( a->armature == b->armature ) ? 0 : -1;
-}
-
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *Armature_repr(BPy_Armature *self)
-{
- return PyString_FromFormat( "[Armature: \"%s\"]", self->armature->id.name + 2 ); //*new*
-}
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-///tp_dealloc
-static void Armature_dealloc(BPy_Armature * self)
-{
- if (self->weaklist != NULL)
- PyObject_ClearWeakRefs((PyObject *) self); /* this causes the weakref dealloc func to be called */
-
- Py_DECREF(self->Bones);
- PyObject_DEL( self );
-}
-//------------------TYPE_OBECT DEFINITION--------------------------
-PyTypeObject Armature_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "Armature", //tp_name
- sizeof(BPy_Armature), //tp_basicsize
- 0, //tp_itemsize
- (destructor)Armature_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- (cmpfunc) Armature_compare, //tp_compare
- (reprfunc) Armature_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- 0, //tp_as_mapping
- ( hashfunc ) GenericLib_hash, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT| Py_TPFLAGS_HAVE_WEAKREFS, //tp_flags
- BPy_Armature_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- offsetof(BPy_Armature, weaklist), //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_Armature_methods, //tp_methods
- 0, //tp_members
- BPy_Armature_getset, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- (initproc)Armature_init, //tp_init
- 0, //tp_alloc
- (newfunc)Armature_new, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-
-//-------------------MODULE METHODS IMPLEMENTATION------------------------
-//----------------Blender.Armature.Get()
-/* This function will return a Py_Armature when a single string is passed
-* or else it will return a {key:value} dictionary when mutliple strings are passed
-* or it will return a {key:value} dictionary of all armatures when nothing is passed */
-static PyObject *M_Armature_Get(PyObject * self, PyObject * args)
-{
- PyObject *seq = NULL, *item = NULL, *dict = NULL, *py_armature = NULL;
- char *name = "", buffer[24];
- int size = 0, i;
- void *data;
-
- //GET ARGUMENTS - () ('s') ('s',..) (['s',..]) are exceptable
- size = PySequence_Length(args);
- if (size == 1) {
- seq = PySequence_GetItem(args, 0); //*new*
- if (!seq)
- goto RuntimeError;
- if(!PyString_Check(seq)){
- if (PySequence_Check(seq)) {
- size = PySequence_Length(seq);
- } else {
- Py_DECREF(seq);
- goto AttributeError;
- }
- }
- } else {
- seq = EXPP_incr_ret(args); //*take ownership*
- }
- //'seq' should be a list, empty tuple or string - check list for strings
- if(!PyString_Check(seq)){
- for(i = 0; i < size; i++){
- item = PySequence_GetItem(seq, i); //*new*
- if (!item) {
- Py_DECREF(seq);
- goto RuntimeError;
- }
- if(!PyString_Check(item)){
- EXPP_decr2(item, seq);
- goto AttributeError;
- }
- Py_DECREF(item);
- }
- }
-
- //GET ARMATURES
- if(size != 1){
- dict = PyDict_New(); //*new*
- if(!dict){
- Py_DECREF(seq);
- goto RuntimeError;
- }
- if(size == 0){ //GET ALL ARMATURES
- data = G.main->armature.first; //get the first data ID from the armature library
- while (data){
- py_armature = Armature_CreatePyObject(data); //*new*
- if (!py_armature) {
- EXPP_decr2(seq, dict);
- return NULL; /* error is set from Armature_CreatePyObject */
- }
- sprintf(buffer, "%s", ((bArmature*)data)->id.name +2);
- if(PyDict_SetItemString(dict, buffer, py_armature) == -1){ //add to dictionary
- EXPP_decr3(seq, dict, py_armature);
- goto RuntimeError;
- }
- Py_DECREF(py_armature);
- data = ((ID*)data)->next;
- }
- Py_DECREF(seq);
- }else{ //GET ARMATURE LIST
- for (i = 0; i < size; i++) {
- item = PySequence_GetItem(seq, i); //*new*
- name = PyString_AsString(item);
- Py_DECREF(item);
- data = find_id("AR", name); //get data from library
- if (data != NULL){
- py_armature = Armature_CreatePyObject(data); //*new*
- if (!py_armature) {
- EXPP_decr2(seq, dict);
- return NULL; /* error is set from Armature_CreatePyObject */
- }
-
- if(PyDict_SetItemString(dict, name, py_armature) == -1){ //add to dictionary
- EXPP_decr3(seq, dict, py_armature);
- goto RuntimeError;
- }
- Py_DECREF(py_armature);
- }else{
- if(PyDict_SetItemString(dict, name, Py_None) == -1){ //add to dictionary
- EXPP_decr2(seq, dict);
- goto RuntimeError;
- }
- Py_DECREF(Py_None);
- }
- }
- Py_DECREF(seq);
- }
- return dict;
- }else{ //GET SINGLE ARMATURE
- if(!PyString_Check(seq)){ //This handles the bizarre case where (['s']) is passed
- item = PySequence_GetItem(seq, 0); //*new*
- name = PyString_AsString(item);
- Py_DECREF(item);
- }else{
- name = PyString_AsString(seq);
- }
- Py_DECREF(seq);
- data = find_id("AR", name); //get data from library
- if (data != NULL){
- return Armature_CreatePyObject(data); //*new*
- }else{
- char buffer[128];
- PyOS_snprintf( buffer, sizeof(buffer),
- "Armature \"%s\" not found", name);
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- buffer );
- }
- }
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sModuleError, "Get(): ", "Internal Error Ocurred");
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sModuleBadArgs, "Get(): ", "- Expects (optional) string sequence");
-}
-
-
-//----------------Blender.Armature.New()
-static PyObject *M_Armature_New(PyObject * self, PyObject * args)
-{
- char *name = "Armature";
- struct bArmature *armature;
- BPy_Armature *obj;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or a string as argument" );
-
- armature= add_armature(name);
- armature->id.us = 0;
- obj = (BPy_Armature *)Armature_CreatePyObject(armature); /*new*/
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->armature = armature;
- return (PyObject *)obj;
-}
-
-//-------------------MODULE METHODS DEFINITION-----------------------------
-
-static char M_Armature_Get_doc[] = "(name) - return the armature with the name 'name', \
- returns None if not found.\n If 'name' is not specified, it returns a list of all \
- armatures in the\ncurrent scene.";
-
-static char M_Armature_New_doc[] = "(name) - return a new armature object.";
-
-struct PyMethodDef M_Armature_methods[] = {
- {"Get", M_Armature_Get, METH_VARARGS, M_Armature_Get_doc},
- {"New", M_Armature_New, METH_VARARGS, M_Armature_New_doc},
- {NULL, NULL, 0, NULL}
-};
-//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
-//------------------------Armature_RebuildEditbones (internal)
-PyObject * Armature_RebuildEditbones(PyObject *pyarmature)
-{
- return Armature_makeEditable((BPy_Armature*)pyarmature);
-}
-
-//------------------------Armature_RebuildBones (internal)
-PyObject *Armature_RebuildBones(PyObject *pyarmature)
-{
- return Armature_update((BPy_Armature*)pyarmature);
-}
-
-/* internal func to remove weakref from weakref list */
-static PyObject * arm_weakref_callback_weakref_dealloc(PyObject *self, PyObject *weakref)
-{
- char *list_name = ARM_WEAKREF_LIST_NAME;
- PyObject *maindict = NULL, *armlist = NULL;
- int i;
-
- maindict= PyModule_GetDict(PyImport_AddModule( "__main__"));
- armlist = PyDict_GetItemString(maindict, list_name);
- if( !armlist){
- printf("Oops - update_armature_weakrefs()\n");
- Py_RETURN_NONE;
- }
-
- i = PySequence_Index(armlist, weakref);
- if (i==-1) {
- printf("callback weakref internal error, weakref not in list\n\tthis should never happen.\n");
- Py_RETURN_NONE;
- }
- PySequence_DelItem(armlist, i);
- Py_RETURN_NONE;
-}
-
-/*-----------------(internal)
- * Converts a bArmature to a PyArmature */
-
-PyObject *Armature_CreatePyObject(struct bArmature *armature)
-{
- BPy_Armature *py_armature = NULL;
- PyObject *maindict = NULL, *weakref = NULL;
- PyObject *armlist = NULL; /* list of armature weak refs */
- char *list_name = ARM_WEAKREF_LIST_NAME;
- int i;
-
- //put a weakreference in __main__
- maindict= PyModule_GetDict(PyImport_AddModule( "__main__"));
-
- armlist = PyDict_GetItemString(maindict, list_name);
- if(!armlist) {
- printf("Oops - can't get the armature weakref list\n");
- goto RuntimeError;
- }
-
- /* see if we alredy have it */
- for (i=0; i< PyList_Size(armlist); i++) {
- py_armature = (BPy_Armature *)PyWeakref_GetObject(PyList_GET_ITEM(armlist, i));
- if (BPy_Armature_Check(py_armature) && py_armature->armature == armature) {
- Py_INCREF(py_armature);
- /*printf("reusing armature\n");*/
- return (PyObject *)py_armature;
- }
- }
-
-
- /*create armature type*/
- py_armature = PyObject_NEW( BPy_Armature, &Armature_Type );
-
- if (!py_armature){
- printf("Oops - can't create py armature\n");
- goto RuntimeError;
- }
-
- py_armature->armature = armature;
- py_armature->weaklist = NULL; //init the weaklist
-
- //create armature.bones
- py_armature->Bones = (BPy_BonesDict*)PyBonesDict_FromPyArmature(py_armature);
- if (!py_armature->Bones){
- printf("Oops - creating armature.bones\n");
- goto RuntimeError;
- }
-
- weakref = PyWeakref_NewRef((PyObject*)py_armature, arm_weakref_callback_weakref_dealloc__pyfunc);
- if (PyList_Append(armlist, weakref) == -1){
- printf("Oops - list-append failed\n");
- goto RuntimeError;
- }
- Py_DECREF(weakref);
-
- return (PyObject *) py_armature;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sModuleError, "Armature_CreatePyObject: ", "Internal Error Ocurred");
-}
-//-----------------(internal)
-//Converts a PyArmature to a bArmature
-struct bArmature *PyArmature_AsArmature(BPy_Armature *py_armature)
-{
- return (py_armature->armature);
-}
-
-struct bArmature *Armature_FromPyObject( PyObject * py_obj )
-{
- return PyArmature_AsArmature((BPy_Armature*)py_obj);
-}
-
-/* internal use only */
-static PyMethodDef bpy_arm_weakref_callback_weakref_dealloc[] = {
- {"arm_weakref_callback_weakref_dealloc", arm_weakref_callback_weakref_dealloc, METH_O, ""}
-};
-
-//-------------------MODULE INITIALIZATION--------------------------------
-PyObject *Armature_Init(void)
-{
- PyObject *module, *dict;
-
- //Initializes TypeObject.ob_type
- if (PyType_Ready(&Armature_Type) < 0 || PyType_Ready(&BonesDict_Type) < 0 ||
- PyType_Ready(&EditBone_Type) < 0 || PyType_Ready(&Bone_Type) < 0) {
- return EXPP_incr_ret(Py_None);
- }
-
- /* Weakref management - used for callbacks so we can
- * tell when a callback has been removed that a UI button referenced */
- arm_weakref_callback_weakref_dealloc__pyfunc = PyCFunction_New(bpy_arm_weakref_callback_weakref_dealloc, NULL);
-
-
- //Register the module
- module = Py_InitModule3("Blender.Armature", M_Armature_methods,
- "The Blender Armature module");
-
- //Add TYPEOBJECTS to the module
- PyModule_AddObject(module, "Armature",
- EXPP_incr_ret((PyObject *)&Armature_Type)); //*steals*
- PyModule_AddObject(module, "Bone",
- EXPP_incr_ret((PyObject *)&Bone_Type)); //*steals*
- PyModule_AddObject(module, "Editbone",
- EXPP_incr_ret((PyObject *)&EditBone_Type)); //*steals*
-
- //Add CONSTANTS to the module
- PyModule_AddObject(module, "CONNECTED",
- PyConstant_NewInt("CONNECTED", BONE_CONNECTED));
- PyModule_AddObject(module, "HINGE",
- PyConstant_NewInt("HINGE", BONE_HINGE));
- PyModule_AddObject(module, "NO_DEFORM",
- PyConstant_NewInt("NO_DEFORM", BONE_NO_DEFORM));
- PyModule_AddObject(module, "MULTIPLY",
- PyConstant_NewInt("MULTIPLY", BONE_MULT_VG_ENV));
- PyModule_AddObject(module, "HIDDEN_EDIT",
- PyConstant_NewInt("HIDDEN_EDIT", BONE_HIDDEN_A));
- PyModule_AddObject(module, "ROOT_SELECTED",
- PyConstant_NewInt("ROOT_SELECTED", BONE_ROOTSEL));
- PyModule_AddObject(module, "BONE_SELECTED",
- PyConstant_NewInt("BONE_SELECTED", BONE_SELECTED));
- PyModule_AddObject(module, "TIP_SELECTED",
- PyConstant_NewInt("TIP_SELECTED", BONE_TIPSEL));
- PyModule_AddObject(module, "LOCKED_EDIT",
- PyConstant_NewInt("LOCKED_EDIT", BONE_EDITMODE_LOCKED));
-
- PyModule_AddObject(module, "OCTAHEDRON",
- PyConstant_NewInt("OCTAHEDRON", ARM_OCTA));
- PyModule_AddObject(module, "STICK",
- PyConstant_NewInt("STICK", ARM_LINE));
- PyModule_AddObject(module, "BBONE",
- PyConstant_NewInt("BBONE", ARM_B_BONE));
- PyModule_AddObject(module, "ENVELOPE",
- PyConstant_NewInt("ENVELOPE", ARM_ENVELOPE));
-
- //Add SUBMODULES to the module
- dict = PyModule_GetDict( module ); //borrowed
- PyDict_SetItemString(dict, "NLA", NLA_Init()); //creates a *new* module
-
- return module;
-}
diff --git a/source/blender/python/api2_2x/Armature.h b/source/blender/python/api2_2x/Armature.h
deleted file mode 100644
index 5a769122453..00000000000
--- a/source/blender/python/api2_2x/Armature.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_ARMATURE_H
-#define EXPP_ARMATURE_H
-
-#include <Python.h>
-#include "DNA_armature_types.h"
-
-//-------------------TYPE CHECKS---------------------------------
-#define BPy_Armature_Check(v) ((v)->ob_type == &Armature_Type)
-#define BPy_BonesDict_Check(v) ((v)->ob_type == &BonesDict_Type)
-//-------------------MODULE INIT---------------------------------
-PyObject *Armature_Init( void );
-//-------------------TYPEOBJECT----------------------------------
-extern PyTypeObject Armature_Type;
-extern PyTypeObject BonesDict_Type;
-//-------------------STRUCT DEFINITION---------------------------
-typedef struct {
- PyObject_HEAD
- PyObject *bonesMap; //wrapper for bones
- PyObject *editbonesMap; //wrapper for editbones
- ListBase *bones; //pointer to armature->bonebase
- ListBase editbones; //allocated list of EditBones
- short editmode_flag; //1 = in , 0 = not in
-} BPy_BonesDict;
-
-typedef struct {
- PyObject_HEAD
- struct bArmature * armature;
- BPy_BonesDict *Bones; //BPy_BonesDict
- PyObject *weaklist;
-} BPy_Armature;
-
-//-------------------VISIBLE PROTOTYPES-------------------------
-PyObject *Armature_CreatePyObject(struct bArmature *armature);
-struct bArmature *PyArmature_AsArmature(BPy_Armature *py_armature);
-PyObject * Armature_RebuildEditbones(PyObject *pyarmature);
-PyObject *Armature_RebuildBones(PyObject *pyarmature);
-
-struct bArmature *Armature_FromPyObject( PyObject * py_obj );
-
-#endif
diff --git a/source/blender/python/api2_2x/BGL.c b/source/blender/python/api2_2x/BGL.c
deleted file mode 100644
index 2503a66250b..00000000000
--- a/source/blender/python/api2_2x/BGL.c
+++ /dev/null
@@ -1,1588 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* This file is the Blender.BGL part of opy_draw.c, from the old
- * bpython/intern dir, with minor changes to adapt it to the new Python
- * implementation. The BGL submodule "wraps" OpenGL functions and constants,
- * allowing script writers to make OpenGL calls in their Python scripts. */
-
-#include "BGL.h" /*This must come first */
-
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-
-static int type_size( int type );
-static Buffer *make_buffer( int type, int ndimensions, int *dimensions );
-
-static char Method_Buffer_doc[] =
- "(type, dimensions, [template]) - Create a new Buffer object\n\n\
-(type) - The format to store data in\n\
-(dimensions) - An int or sequence specifying the dimensions of the buffer\n\
-[template] - A sequence of matching dimensions to the buffer to be created\n\
- which will be used to initialize the Buffer.\n\n\
-If a template is not passed in all fields will be initialized to 0.\n\n\
-The type should be one of GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE.\n\
-If the dimensions are specified as an int a linear buffer will be\n\
-created. If a sequence is passed for the dimensions the buffer\n\
-will have len(sequence) dimensions, where the size for each dimension\n\
-is determined by the value in the sequence at that index.\n\n\
-For example, passing [100, 100] will create a 2 dimensional\n\
-square buffer. Passing [16, 16, 32] will create a 3 dimensional\n\
-buffer which is twice as deep as it is wide or high.";
-
-static PyObject *Method_Buffer( PyObject * self, PyObject * args );
-
-/* Buffer sequence methods */
-
-static int Buffer_len( PyObject * self );
-static PyObject *Buffer_item( PyObject * self, int i );
-static PyObject *Buffer_slice( PyObject * self, int begin, int end );
-static int Buffer_ass_item( PyObject * self, int i, PyObject * v );
-static int Buffer_ass_slice( PyObject * self, int begin, int end,
- PyObject * seq );
-
-static PySequenceMethods Buffer_SeqMethods = {
- ( inquiry ) Buffer_len, /*sq_length */
- ( binaryfunc ) 0, /*sq_concat */
- ( intargfunc ) 0, /*sq_repeat */
- ( intargfunc ) Buffer_item, /*sq_item */
- ( intintargfunc ) Buffer_slice, /*sq_slice */
- ( intobjargproc ) Buffer_ass_item, /*sq_ass_item */
- ( intintobjargproc ) Buffer_ass_slice, /*sq_ass_slice */
-};
-
-static void Buffer_dealloc( PyObject * self );
-static PyObject *Buffer_tolist( PyObject * self );
-static PyObject *Buffer_dimensions( PyObject * self );
-static PyObject *Buffer_getattr( PyObject * self, char *name );
-static PyObject *Buffer_repr( PyObject * self );
-
-PyTypeObject buffer_Type = {
- PyObject_HEAD_INIT( NULL ) /* required python macro */
- 0, /*ob_size */
- "buffer", /*tp_name */
- sizeof( Buffer ), /*tp_basicsize */
- 0, /*tp_itemsize */
- ( destructor ) Buffer_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) Buffer_getattr, /*tp_getattr */
- ( setattrfunc ) 0, /*tp_setattr */
- ( cmpfunc ) 0, /*tp_compare */
- ( reprfunc ) Buffer_repr, /*tp_repr */
- 0, /*tp_as_number */
- &Buffer_SeqMethods, /*tp_as_sequence */
-};
-
-/* #ifndef __APPLE__ */
-
-#define BGL_Wrap(nargs, funcname, ret, arg_list) \
-static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\
- arg_def##nargs arg_list; \
- ret_def_##ret; \
- if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\
- ret_set_##ret gl##funcname (arg_var##nargs arg_list);\
- ret_ret_##ret; \
-}
-
-#define BGLU_Wrap(nargs, funcname, ret, arg_list) \
-static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\
- arg_def##nargs arg_list; \
- ret_def_##ret; \
- if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\
- ret_set_##ret glu##funcname (arg_var##nargs arg_list);\
- ret_ret_##ret; \
-}
-
-/* #endif */
-
-PyObject *BGL_Init( void );
-
-/********/
-static int type_size(int type)
-{
- switch (type) {
- case GL_BYTE:
- return sizeof(char);
- case GL_SHORT:
- return sizeof(short);
- case GL_INT:
- return sizeof(int);
- case GL_FLOAT:
- return sizeof(float);
- case GL_DOUBLE:
- return sizeof(double);
- }
- return -1;
-}
-
-static Buffer *make_buffer(int type, int ndimensions, int *dimensions)
-{
- Buffer *buffer;
- void *buf= NULL;
- int i, size, length;
-
- length= 1;
- for (i=0; i<ndimensions; i++)
- length*= dimensions[i];
-
- size= type_size(type);
-
- buf= MEM_mallocN(length*size, "Buffer buffer");
-
- buffer= (Buffer *) PyObject_NEW(Buffer, &buffer_Type);
- buffer->parent= NULL;
- buffer->ndimensions= ndimensions;
- buffer->dimensions= dimensions;
- buffer->type= type;
- buffer->buf.asvoid= buf;
-
- for (i= 0; i<length; i++) {
- if (type==GL_BYTE)
- buffer->buf.asbyte[i]= 0;
- else if (type==GL_SHORT)
- buffer->buf.asshort[i]= 0;
- else if (type==GL_INT)
- buffer->buf.asint[i]= 0;
- else if (type==GL_FLOAT)
- buffer->buf.asfloat[i]= 0.0f;
- else if (type==GL_DOUBLE)
- buffer->buf.asdouble[i]= 0.0;
- }
- return buffer;
-}
-
-static PyObject *Method_Buffer (PyObject *self, PyObject *args)
-{
- PyObject *length_ob= NULL, *template= NULL;
- Buffer *buffer;
-
- int i, type;
- int *dimensions = 0, ndimensions = 0;
-
- if (!PyArg_ParseTuple(args, "iO|O", &type, &length_ob, &template))
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "expected an int and one or two PyObjects");
-
- if (type!=GL_BYTE && type!=GL_SHORT && type!=GL_INT && type!=GL_FLOAT && type!=GL_DOUBLE) {
- PyErr_SetString(PyExc_AttributeError, "type");
- return NULL;
- }
-
- if (PyNumber_Check(length_ob)) {
- ndimensions= 1;
- dimensions= MEM_mallocN(ndimensions*sizeof(int), "Buffer dimensions");
- dimensions[0]= PyInt_AsLong(length_ob);
- } else if (PySequence_Check(length_ob)) {
- ndimensions= PySequence_Length(length_ob);
- dimensions= MEM_mallocN(ndimensions*sizeof(int), "Buffer dimensions");
- for (i=0; i<ndimensions; i++) {
- PyObject *ob= PySequence_GetItem(length_ob, i);
-
- if (!PyNumber_Check(ob)) dimensions[i]= 1;
- else dimensions[i]= PyInt_AsLong(ob);
- Py_DECREF(ob);
- }
- }
-
- buffer= make_buffer(type, ndimensions, dimensions);
- if (template && ndimensions) {
- if (Buffer_ass_slice((PyObject *) buffer, 0, dimensions[0], template)) {
- Py_DECREF(buffer);
- return NULL;
- }
- }
-
- return (PyObject *) buffer;
-}
-
-/*@ Buffer sequence methods */
-
-static int Buffer_len(PyObject *self)
-{
- Buffer *buf= (Buffer *) self;
- return buf->dimensions[0];
-}
-
-static PyObject *Buffer_item(PyObject *self, int i)
-{
- Buffer *buf= (Buffer *) self;
-
- if (i >= buf->dimensions[0]) {
- PyErr_SetString(PyExc_IndexError, "array index out of range");
- return NULL;
- }
-
- if (buf->ndimensions==1) {
- switch (buf->type) {
- case GL_BYTE: return Py_BuildValue("b", buf->buf.asbyte[i]);
- case GL_SHORT: return Py_BuildValue("h", buf->buf.asshort[i]);
- case GL_INT: return Py_BuildValue("i", buf->buf.asint[i]);
- case GL_FLOAT: return PyFloat_FromDouble(buf->buf.asfloat[i]);
- case GL_DOUBLE: return Py_BuildValue("d", buf->buf.asdouble[i]);
- }
- } else {
- Buffer *newbuf;
- int j, length, size;
-
- length= 1;
- for (j=1; j<buf->ndimensions; j++) {
- length*= buf->dimensions[j];
- }
- size= type_size(buf->type);
-
- newbuf= (Buffer *) PyObject_NEW(Buffer, &buffer_Type);
-
- Py_INCREF(self);
- newbuf->parent= self;
-
- newbuf->ndimensions= buf->ndimensions-1;
- newbuf->type= buf->type;
- newbuf->buf.asvoid= buf->buf.asbyte + i*length*size;
- newbuf->dimensions= MEM_mallocN(newbuf->ndimensions*sizeof(int),
- "Buffer dimensions");
- memcpy(newbuf->dimensions, buf->dimensions+1,
- newbuf->ndimensions*sizeof(int));
-
- return (PyObject *) newbuf;
- }
-
- return NULL;
-}
-
-static PyObject *Buffer_slice(PyObject *self, int begin, int end)
-{
- Buffer *buf= (Buffer *) self;
- PyObject *list;
- int count;
-
- if (begin<0) begin= 0;
- if (end>buf->dimensions[0])
- end= buf->dimensions[0];
- if (begin>end) begin= end;
-
- list= PyList_New(end-begin);
-
- for (count= begin; count<end; count++)
- PyList_SetItem(list, count-begin, Buffer_item(self, count));
-
- return list;
-}
-
-static int Buffer_ass_item(PyObject *self, int i, PyObject *v)
-{
- Buffer *buf= (Buffer *) self;
-
- if (i >= buf->dimensions[0]) {
- PyErr_SetString(PyExc_IndexError, "array assignment index out of range");
- return -1;
- }
-
- if (buf->ndimensions!=1) {
- PyObject *row= Buffer_item(self, i);
- int ret;
-
- if (!row) return -1;
- ret= Buffer_ass_slice(row, 0, buf->dimensions[1], v);
- Py_DECREF(row);
- return ret;
- }
-
- if (buf->type==GL_BYTE) {
- if (!PyArg_Parse(v, "b;Coordinates must be ints", &buf->buf.asbyte[i]))
- return -1;
- } else if (buf->type==GL_SHORT) {
- if (!PyArg_Parse(v, "h;Coordinates must be ints", &buf->buf.asshort[i]))
- return -1;
-
- } else if (buf->type==GL_INT) {
- if (!PyArg_Parse(v, "i;Coordinates must be ints", &buf->buf.asint[i]))
- return -1;
- } else if (buf->type==GL_FLOAT) {
- if (!PyArg_Parse(v, "f;Coordinates must be floats", &buf->buf.asfloat[i]))
- return -1;
- } else if (buf->type==GL_DOUBLE) {
- if (!PyArg_Parse(v, "d;Coordinates must be floats", &buf->buf.asdouble[i]))
- return -1;
- }
- return 0;
-}
-
-static int Buffer_ass_slice(PyObject *self, int begin, int end, PyObject *seq)
-{
- Buffer *buf= (Buffer *) self;
- PyObject *item;
- int count, err=0;
-
- if (begin<0) begin= 0;
- if (end>buf->dimensions[0]) end= buf->dimensions[0];
- if (begin>end) begin= end;
-
- if (!PySequence_Check(seq)) {
- PyErr_SetString(PyExc_TypeError,
- "illegal argument type for built-in operation");
- return -1;
- }
-
- if (PySequence_Length(seq)!=(end-begin)) {
- PyErr_SetString(PyExc_TypeError, "size mismatch in assignment");
- return -1;
- }
-
- for (count= begin; count<end; count++) {
- item= PySequence_GetItem(seq, count-begin);
- err= Buffer_ass_item(self, count, item);
- Py_DECREF(item);
- if (err) break;
- }
- return err;
-}
-
-static void Buffer_dealloc(PyObject *self)
-{
- Buffer *buf = (Buffer *)self;
-
- if (buf->parent) Py_DECREF (buf->parent);
- else MEM_freeN (buf->buf.asvoid);
-
- MEM_freeN (buf->dimensions);
-
- PyObject_DEL (self);
-}
-
-static PyObject *Buffer_tolist(PyObject *self)
-{
- int i, len= ((Buffer *)self)->dimensions[0];
- PyObject *list= PyList_New(len);
-
- for (i=0; i<len; i++) {
- PyList_SetItem(list, i, Buffer_item(self, i));
- }
-
- return list;
-}
-
-static PyObject *Buffer_dimensions(PyObject *self)
-{
- Buffer *buffer= (Buffer *) self;
- PyObject *list= PyList_New(buffer->ndimensions);
- int i;
-
- for (i= 0; i<buffer->ndimensions; i++) {
- PyList_SetItem(list, i, PyInt_FromLong(buffer->dimensions[i]));
- }
-
- return list;
-}
-
-static PyObject *Buffer_getattr(PyObject *self, char *name)
-{
- if (strcmp(name, "list")==0) return Buffer_tolist(self);
- else if (strcmp(name, "dimensions")==0) return Buffer_dimensions(self);
-
- PyErr_SetString(PyExc_AttributeError, name);
- return NULL;
-}
-
-static PyObject *Buffer_repr(PyObject *self)
-{
- PyObject *list= Buffer_tolist(self);
- PyObject *repr= PyObject_Repr(list);
- Py_DECREF(list);
-
- return repr;
-}
-
-
-BGL_Wrap(2, Accum, void, (GLenum, GLfloat))
-BGL_Wrap(2, AlphaFunc, void, (GLenum, GLclampf))
-BGL_Wrap(3, AreTexturesResident, GLboolean, (GLsizei, GLuintP, GLbooleanP))
-BGL_Wrap(1, Begin, void, (GLenum))
-BGL_Wrap(2, BindTexture, void, (GLenum, GLuint))
-BGL_Wrap(7, Bitmap, void, (GLsizei, GLsizei, GLfloat,
- GLfloat, GLfloat, GLfloat, GLubyteP))
-BGL_Wrap(2, BlendFunc, void, (GLenum, GLenum))
-BGL_Wrap(1, CallList, void, (GLuint))
-BGL_Wrap(3, CallLists, void, (GLsizei, GLenum, GLvoidP))
-BGL_Wrap(1, Clear, void, (GLbitfield))
-BGL_Wrap(4, ClearAccum, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(4, ClearColor, void, (GLclampf, GLclampf, GLclampf, GLclampf))
-BGL_Wrap(1, ClearDepth, void, (GLclampd))
-BGL_Wrap(1, ClearIndex, void, (GLfloat))
-BGL_Wrap(1, ClearStencil, void, (GLint))
-BGL_Wrap(2, ClipPlane, void, (GLenum, GLdoubleP))
-BGL_Wrap(3, Color3b, void, (GLbyte, GLbyte, GLbyte))
-BGL_Wrap(1, Color3bv, void, (GLbyteP))
-BGL_Wrap(3, Color3d, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, Color3dv, void, (GLdoubleP))
-BGL_Wrap(3, Color3f, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, Color3fv, void, (GLfloatP))
-BGL_Wrap(3, Color3i, void, (GLint, GLint, GLint))
-BGL_Wrap(1, Color3iv, void, (GLintP))
-BGL_Wrap(3, Color3s, void, (GLshort, GLshort, GLshort))
-BGL_Wrap(1, Color3sv, void, (GLshortP))
-BGL_Wrap(3, Color3ub, void, (GLubyte, GLubyte, GLubyte))
-BGL_Wrap(1, Color3ubv, void, (GLubyteP))
-BGL_Wrap(3, Color3ui, void, (GLuint, GLuint, GLuint))
-BGL_Wrap(1, Color3uiv, void, (GLuintP))
-BGL_Wrap(3, Color3us, void, (GLushort, GLushort, GLushort))
-BGL_Wrap(1, Color3usv, void, (GLushortP))
-BGL_Wrap(4, Color4b, void, (GLbyte, GLbyte, GLbyte, GLbyte))
-BGL_Wrap(1, Color4bv, void, (GLbyteP))
-BGL_Wrap(4, Color4d, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, Color4dv, void, (GLdoubleP))
-BGL_Wrap(4, Color4f, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, Color4fv, void, (GLfloatP))
-BGL_Wrap(4, Color4i, void, (GLint, GLint, GLint, GLint))
-BGL_Wrap(1, Color4iv, void, (GLintP))
-BGL_Wrap(4, Color4s, void, (GLshort, GLshort, GLshort, GLshort))
-BGL_Wrap(1, Color4sv, void, (GLshortP))
-BGL_Wrap(4, Color4ub, void, (GLubyte, GLubyte, GLubyte, GLubyte))
-BGL_Wrap(1, Color4ubv, void, (GLubyteP))
-BGL_Wrap(4, Color4ui, void, (GLuint, GLuint, GLuint, GLuint))
-BGL_Wrap(1, Color4uiv, void, (GLuintP))
-BGL_Wrap(4, Color4us, void, (GLushort, GLushort, GLushort, GLushort))
-BGL_Wrap(1, Color4usv, void, (GLushortP))
-BGL_Wrap(4, ColorMask, void, (GLboolean, GLboolean, GLboolean, GLboolean))
-BGL_Wrap(2, ColorMaterial, void, (GLenum, GLenum))
-BGL_Wrap(5, CopyPixels, void, (GLint, GLint, GLsizei, GLsizei, GLenum))
-BGL_Wrap(1, CullFace, void, (GLenum))
-BGL_Wrap(2, DeleteLists, void, (GLuint, GLsizei))
-BGL_Wrap(2, DeleteTextures, void, (GLsizei, GLuintP))
-BGL_Wrap(1, DepthFunc, void, (GLenum))
-BGL_Wrap(1, DepthMask, void, (GLboolean))
-BGL_Wrap(2, DepthRange, void, (GLclampd, GLclampd))
-BGL_Wrap(1, Disable, void, (GLenum))
-BGL_Wrap(1, DrawBuffer, void, (GLenum))
-BGL_Wrap(5, DrawPixels, void, (GLsizei, GLsizei, GLenum, GLenum, GLvoidP))
-BGL_Wrap(1, EdgeFlag, void, (GLboolean))
-BGL_Wrap(1, EdgeFlagv, void, (GLbooleanP))
-BGL_Wrap(1, Enable, void, (GLenum))
-BGL_Wrap(1, End, void, (void))
-BGL_Wrap(1, EndList, void, (void))
-BGL_Wrap(1, EvalCoord1d, void, (GLdouble))
-BGL_Wrap(1, EvalCoord1dv, void, (GLdoubleP))
-BGL_Wrap(1, EvalCoord1f, void, (GLfloat))
-BGL_Wrap(1, EvalCoord1fv, void, (GLfloatP))
-BGL_Wrap(2, EvalCoord2d, void, (GLdouble, GLdouble))
-BGL_Wrap(1, EvalCoord2dv, void, (GLdoubleP))
-BGL_Wrap(2, EvalCoord2f, void, (GLfloat, GLfloat))
-BGL_Wrap(1, EvalCoord2fv, void, (GLfloatP))
-BGL_Wrap(3, EvalMesh1, void, (GLenum, GLint, GLint))
-BGL_Wrap(5, EvalMesh2, void, (GLenum, GLint, GLint, GLint, GLint))
-BGL_Wrap(1, EvalPoint1, void, (GLint))
-BGL_Wrap(2, EvalPoint2, void, (GLint, GLint))
-BGL_Wrap(3, FeedbackBuffer, void, (GLsizei, GLenum, GLfloatP))
-BGL_Wrap(1, Finish, void, (void))
-BGL_Wrap(1, Flush, void, (void))
-BGL_Wrap(2, Fogf, void, (GLenum, GLfloat))
-BGL_Wrap(2, Fogfv, void, (GLenum, GLfloatP))
-BGL_Wrap(2, Fogi, void, (GLenum, GLint))
-BGL_Wrap(2, Fogiv, void, (GLenum, GLintP))
-BGL_Wrap(1, FrontFace, void, (GLenum))
-BGL_Wrap(6, Frustum, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, GenLists, GLuint, (GLsizei))
-BGL_Wrap(2, GenTextures, void, (GLsizei, GLuintP))
-BGL_Wrap(2, GetBooleanv, void, (GLenum, GLbooleanP))
-BGL_Wrap(2, GetClipPlane, void, (GLenum, GLdoubleP))
-BGL_Wrap(2, GetDoublev, void, (GLenum, GLdoubleP))
-BGL_Wrap(1, GetError, GLenum, (void))
-BGL_Wrap(2, GetFloatv, void, (GLenum, GLfloatP))
-BGL_Wrap(2, GetIntegerv, void, (GLenum, GLintP))
-BGL_Wrap(3, GetLightfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetLightiv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(3, GetMapdv, void, (GLenum, GLenum, GLdoubleP))
-BGL_Wrap(3, GetMapfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetMapiv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(3, GetMaterialfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetMaterialiv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(2, GetPixelMapfv, void, (GLenum, GLfloatP))
-BGL_Wrap(2, GetPixelMapuiv, void, (GLenum, GLuintP))
-BGL_Wrap(2, GetPixelMapusv, void, (GLenum, GLushortP))
-BGL_Wrap(1, GetPolygonStipple,void, (GLubyteP))
-BGL_Wrap(1, GetString, GLstring, (GLenum))
-BGL_Wrap(3, GetTexEnvfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetTexEnviv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(3, GetTexGendv, void, (GLenum, GLenum, GLdoubleP))
-BGL_Wrap(3, GetTexGenfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetTexGeniv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(5, GetTexImage, void, (GLenum, GLint, GLenum, GLenum, GLvoidP))
-BGL_Wrap(4, GetTexLevelParameterfv, void, (GLenum, GLint, GLenum, GLfloatP))
-BGL_Wrap(4, GetTexLevelParameteriv, void, (GLenum, GLint, GLenum, GLintP))
-BGL_Wrap(3, GetTexParameterfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, GetTexParameteriv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(2, Hint, void, (GLenum, GLenum))
-BGL_Wrap(1, IndexMask, void, (GLuint))
-BGL_Wrap(1, Indexd, void, (GLdouble))
-BGL_Wrap(1, Indexdv, void, (GLdoubleP))
-BGL_Wrap(1, Indexf, void, (GLfloat))
-BGL_Wrap(1, Indexfv, void, (GLfloatP))
-BGL_Wrap(1, Indexi, void, (GLint))
-BGL_Wrap(1, Indexiv, void, (GLintP))
-BGL_Wrap(1, Indexs, void, (GLshort))
-BGL_Wrap(1, Indexsv, void, (GLshortP))
-BGL_Wrap(1, InitNames, void, (void))
-BGL_Wrap(1, IsEnabled, GLboolean, (GLenum))
-BGL_Wrap(1, IsList, GLboolean, (GLuint))
-BGL_Wrap(1, IsTexture, GLboolean, (GLuint))
-BGL_Wrap(2, LightModelf, void, (GLenum, GLfloat))
-BGL_Wrap(2, LightModelfv, void, (GLenum, GLfloatP))
-BGL_Wrap(2, LightModeli, void, (GLenum, GLint))
-BGL_Wrap(2, LightModeliv, void, (GLenum, GLintP))
-BGL_Wrap(3, Lightf, void, (GLenum, GLenum, GLfloat))
-BGL_Wrap(3, Lightfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, Lighti, void, (GLenum, GLenum, GLint))
-BGL_Wrap(3, Lightiv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(2, LineStipple, void, (GLint, GLushort))
-BGL_Wrap(1, LineWidth, void, (GLfloat))
-BGL_Wrap(1, ListBase, void, (GLuint))
-BGL_Wrap(1, LoadIdentity, void, (void))
-BGL_Wrap(1, LoadMatrixd, void, (GLdoubleP))
-BGL_Wrap(1, LoadMatrixf, void, (GLfloatP))
-BGL_Wrap(1, LoadName, void, (GLuint))
-BGL_Wrap(1, LogicOp, void, (GLenum))
-BGL_Wrap(6, Map1d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdoubleP))
-BGL_Wrap(6, Map1f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloatP))
-BGL_Wrap(10, Map2d, void, (GLenum, GLdouble, GLdouble,
- GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP))
-BGL_Wrap(10, Map2f, void, (GLenum, GLfloat, GLfloat,
- GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP))
-BGL_Wrap(3, MapGrid1d, void, (GLint, GLdouble, GLdouble))
-BGL_Wrap(3, MapGrid1f, void, (GLint, GLfloat, GLfloat))
-BGL_Wrap(6, MapGrid2d, void, (GLint, GLdouble, GLdouble,
- GLint, GLdouble, GLdouble))
-BGL_Wrap(6, MapGrid2f, void, (GLint, GLfloat, GLfloat,
- GLint, GLfloat, GLfloat))
-BGL_Wrap(3, Materialf, void, (GLenum, GLenum, GLfloat))
-BGL_Wrap(3, Materialfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, Materiali, void, (GLenum, GLenum, GLint))
-BGL_Wrap(3, Materialiv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(1, MatrixMode, void, (GLenum))
-BGL_Wrap(1, MultMatrixd, void, (GLdoubleP))
-BGL_Wrap(1, MultMatrixf, void, (GLfloatP))
-BGL_Wrap(2, NewList, void, (GLuint, GLenum))
-BGL_Wrap(3, Normal3b, void, (GLbyte, GLbyte, GLbyte))
-BGL_Wrap(1, Normal3bv, void, (GLbyteP))
-BGL_Wrap(3, Normal3d, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, Normal3dv, void, (GLdoubleP))
-BGL_Wrap(3, Normal3f, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, Normal3fv, void, (GLfloatP))
-BGL_Wrap(3, Normal3i, void, (GLint, GLint, GLint))
-BGL_Wrap(1, Normal3iv, void, (GLintP))
-BGL_Wrap(3, Normal3s, void, (GLshort, GLshort, GLshort))
-BGL_Wrap(1, Normal3sv, void, (GLshortP))
-BGL_Wrap(6, Ortho, void, (GLdouble, GLdouble,
- GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, PassThrough, void, (GLfloat))
-BGL_Wrap(3, PixelMapfv, void, (GLenum, GLint, GLfloatP))
-BGL_Wrap(3, PixelMapuiv, void, (GLenum, GLint, GLuintP))
-BGL_Wrap(3, PixelMapusv, void, (GLenum, GLint, GLushortP))
-BGL_Wrap(2, PixelStoref, void, (GLenum, GLfloat))
-BGL_Wrap(2, PixelStorei, void, (GLenum, GLint))
-BGL_Wrap(2, PixelTransferf, void, (GLenum, GLfloat))
-BGL_Wrap(2, PixelTransferi, void, (GLenum, GLint))
-BGL_Wrap(2, PixelZoom, void, (GLfloat, GLfloat))
-BGL_Wrap(1, PointSize, void, (GLfloat))
-BGL_Wrap(2, PolygonMode, void, (GLenum, GLenum))
-BGL_Wrap(2, PolygonOffset, void, (GLfloat, GLfloat))
-BGL_Wrap(1, PolygonStipple, void, (GLubyteP))
-BGL_Wrap(1, PopAttrib, void, (void))
-BGL_Wrap(1, PopClientAttrib, void, (void))
-BGL_Wrap(1, PopMatrix, void, (void))
-BGL_Wrap(1, PopName, void, (void))
-BGL_Wrap(3, PrioritizeTextures, void, (GLsizei, GLuintP, GLclampfP))
-BGL_Wrap(1, PushAttrib, void, (GLbitfield))
-BGL_Wrap(1, PushClientAttrib, void, (GLbitfield))
-BGL_Wrap(1, PushMatrix, void, (void))
-BGL_Wrap(1, PushName, void, (GLuint))
-BGL_Wrap(2, RasterPos2d, void, (GLdouble, GLdouble))
-BGL_Wrap(1, RasterPos2dv, void, (GLdoubleP))
-BGL_Wrap(2, RasterPos2f, void, (GLfloat, GLfloat))
-BGL_Wrap(1, RasterPos2fv, void, (GLfloatP))
-BGL_Wrap(2, RasterPos2i, void, (GLint, GLint))
-BGL_Wrap(1, RasterPos2iv, void, (GLintP))
-BGL_Wrap(2, RasterPos2s, void, (GLshort, GLshort))
-BGL_Wrap(1, RasterPos2sv, void, (GLshortP))
-BGL_Wrap(3, RasterPos3d, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, RasterPos3dv, void, (GLdoubleP))
-BGL_Wrap(3, RasterPos3f, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, RasterPos3fv, void, (GLfloatP))
-BGL_Wrap(3, RasterPos3i, void, (GLint, GLint, GLint))
-BGL_Wrap(1, RasterPos3iv, void, (GLintP))
-BGL_Wrap(3, RasterPos3s, void, (GLshort, GLshort, GLshort))
-BGL_Wrap(1, RasterPos3sv, void, (GLshortP))
-BGL_Wrap(4, RasterPos4d, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, RasterPos4dv, void, (GLdoubleP))
-BGL_Wrap(4, RasterPos4f, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, RasterPos4fv, void, (GLfloatP))
-BGL_Wrap(4, RasterPos4i, void, (GLint, GLint, GLint, GLint))
-BGL_Wrap(1, RasterPos4iv, void, (GLintP))
-BGL_Wrap(4, RasterPos4s, void, (GLshort, GLshort, GLshort, GLshort))
-BGL_Wrap(1, RasterPos4sv, void, (GLshortP))
-BGL_Wrap(1, ReadBuffer, void, (GLenum))
-BGL_Wrap(7, ReadPixels, void, (GLint, GLint, GLsizei,
- GLsizei, GLenum, GLenum, GLvoidP))
-BGL_Wrap(4, Rectd, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(2, Rectdv, void, (GLdoubleP, GLdoubleP))
-BGL_Wrap(4, Rectf, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(2, Rectfv, void, (GLfloatP, GLfloatP))
-BGL_Wrap(4, Recti, void, (GLint, GLint, GLint, GLint))
-BGL_Wrap(2, Rectiv, void, (GLintP, GLintP))
-BGL_Wrap(4, Rects, void, (GLshort, GLshort, GLshort, GLshort))
-BGL_Wrap(2, Rectsv, void, (GLshortP, GLshortP))
-BGL_Wrap(1, RenderMode, GLint, (GLenum))
-BGL_Wrap(4, Rotated, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(4, Rotatef, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(3, Scaled, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(3, Scalef, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(4, Scissor, void, (GLint, GLint, GLsizei, GLsizei))
-BGL_Wrap(2, SelectBuffer, void, (GLsizei, GLuintP))
-BGL_Wrap(1, ShadeModel, void, (GLenum))
-BGL_Wrap(3, StencilFunc, void, (GLenum, GLint, GLuint))
-BGL_Wrap(1, StencilMask, void, (GLuint))
-BGL_Wrap(3, StencilOp, void, (GLenum, GLenum, GLenum))
-BGL_Wrap(1, TexCoord1d, void, (GLdouble))
-BGL_Wrap(1, TexCoord1dv, void, (GLdoubleP))
-BGL_Wrap(1, TexCoord1f, void, (GLfloat))
-BGL_Wrap(1, TexCoord1fv, void, (GLfloatP))
-BGL_Wrap(1, TexCoord1i, void, (GLint))
-BGL_Wrap(1, TexCoord1iv, void, (GLintP))
-BGL_Wrap(1, TexCoord1s, void, (GLshort))
-BGL_Wrap(1, TexCoord1sv, void, (GLshortP))
-BGL_Wrap(2, TexCoord2d, void, (GLdouble, GLdouble))
-BGL_Wrap(1, TexCoord2dv, void, (GLdoubleP))
-BGL_Wrap(2, TexCoord2f, void, (GLfloat, GLfloat))
-BGL_Wrap(1, TexCoord2fv, void, (GLfloatP))
-BGL_Wrap(2, TexCoord2i, void, (GLint, GLint))
-BGL_Wrap(1, TexCoord2iv, void, (GLintP))
-BGL_Wrap(2, TexCoord2s, void, (GLshort, GLshort))
-BGL_Wrap(1, TexCoord2sv, void, (GLshortP))
-BGL_Wrap(3, TexCoord3d, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, TexCoord3dv, void, (GLdoubleP))
-BGL_Wrap(3, TexCoord3f, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, TexCoord3fv, void, (GLfloatP))
-BGL_Wrap(3, TexCoord3i, void, (GLint, GLint, GLint))
-BGL_Wrap(1, TexCoord3iv, void, (GLintP))
-BGL_Wrap(3, TexCoord3s, void, (GLshort, GLshort, GLshort))
-BGL_Wrap(1, TexCoord3sv, void, (GLshortP))
-BGL_Wrap(4, TexCoord4d, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, TexCoord4dv, void, (GLdoubleP))
-BGL_Wrap(4, TexCoord4f, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, TexCoord4fv, void, (GLfloatP))
-BGL_Wrap(4, TexCoord4i, void, (GLint, GLint, GLint, GLint))
-BGL_Wrap(1, TexCoord4iv, void, (GLintP))
-BGL_Wrap(4, TexCoord4s, void, (GLshort, GLshort, GLshort, GLshort))
-BGL_Wrap(1, TexCoord4sv, void, (GLshortP))
-BGL_Wrap(3, TexEnvf, void, (GLenum, GLenum, GLfloat))
-BGL_Wrap(3, TexEnvfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, TexEnvi, void, (GLenum, GLenum, GLint))
-BGL_Wrap(3, TexEnviv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(3, TexGend, void, (GLenum, GLenum, GLdouble))
-BGL_Wrap(3, TexGendv, void, (GLenum, GLenum, GLdoubleP))
-BGL_Wrap(3, TexGenf, void, (GLenum, GLenum, GLfloat))
-BGL_Wrap(3, TexGenfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, TexGeni, void, (GLenum, GLenum, GLint))
-BGL_Wrap(3, TexGeniv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(8, TexImage1D, void, (GLenum, GLint, GLint,
- GLsizei, GLint, GLenum, GLenum, GLvoidP))
-BGL_Wrap(9, TexImage2D, void, (GLenum, GLint, GLint,
- GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP))
-BGL_Wrap(3, TexParameterf, void, (GLenum, GLenum, GLfloat))
-BGL_Wrap(3, TexParameterfv, void, (GLenum, GLenum, GLfloatP))
-BGL_Wrap(3, TexParameteri, void, (GLenum, GLenum, GLint))
-BGL_Wrap(3, TexParameteriv, void, (GLenum, GLenum, GLintP))
-BGL_Wrap(3, Translated, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(3, Translatef, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(2, Vertex2d, void, (GLdouble, GLdouble))
-BGL_Wrap(1, Vertex2dv, void, (GLdoubleP))
-BGL_Wrap(2, Vertex2f, void, (GLfloat, GLfloat))
-BGL_Wrap(1, Vertex2fv, void, (GLfloatP))
-BGL_Wrap(2, Vertex2i, void, (GLint, GLint))
-BGL_Wrap(1, Vertex2iv, void, (GLintP))
-BGL_Wrap(2, Vertex2s, void, (GLshort, GLshort))
-BGL_Wrap(1, Vertex2sv, void, (GLshortP))
-BGL_Wrap(3, Vertex3d, void, (GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, Vertex3dv, void, (GLdoubleP))
-BGL_Wrap(3, Vertex3f, void, (GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, Vertex3fv, void, (GLfloatP))
-BGL_Wrap(3, Vertex3i, void, (GLint, GLint, GLint))
-BGL_Wrap(1, Vertex3iv, void, (GLintP))
-BGL_Wrap(3, Vertex3s, void, (GLshort, GLshort, GLshort))
-BGL_Wrap(1, Vertex3sv, void, (GLshortP))
-BGL_Wrap(4, Vertex4d, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGL_Wrap(1, Vertex4dv, void, (GLdoubleP))
-BGL_Wrap(4, Vertex4f, void, (GLfloat, GLfloat, GLfloat, GLfloat))
-BGL_Wrap(1, Vertex4fv, void, (GLfloatP))
-BGL_Wrap(4, Vertex4i, void, (GLint, GLint, GLint, GLint))
-BGL_Wrap(1, Vertex4iv, void, (GLintP))
-BGL_Wrap(4, Vertex4s, void, (GLshort, GLshort, GLshort, GLshort))
-BGL_Wrap(1, Vertex4sv, void, (GLshortP))
-BGL_Wrap(4, Viewport, void, (GLint, GLint, GLsizei, GLsizei))
-BGLU_Wrap(4, Perspective, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(9, LookAt, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(4, Ortho2D, void, (GLdouble, GLdouble, GLdouble, GLdouble))
-BGLU_Wrap(5, PickMatrix, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLintP))
-BGLU_Wrap(9, Project, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
-BGLU_Wrap(9, UnProject, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP))
-
-#undef MethodDef
-#define MethodDef(func) {"gl"#func, Method_##func, METH_VARARGS, "no string"}
-#define MethodDefu(func) {"glu"#func, Method_##func, METH_VARARGS, "no string"}
-/* So that MethodDef(Accum) becomes:
- * {"glAccum", Method_Accumfunc, METH_VARARGS} */
-
-static struct PyMethodDef BGL_methods[] = {
- {"Buffer", Method_Buffer, METH_VARARGS, Method_Buffer_doc},
-
-/* #ifndef __APPLE__ */
- MethodDef(Accum),
- MethodDef(AlphaFunc),
- MethodDef(AreTexturesResident),
- MethodDef(Begin),
- MethodDef(BindTexture),
- MethodDef(Bitmap),
- MethodDef(BlendFunc),
- MethodDef(CallList),
- MethodDef(CallLists),
- MethodDef(Clear),
- MethodDef(ClearAccum),
- MethodDef(ClearColor),
- MethodDef(ClearDepth),
- MethodDef(ClearIndex),
- MethodDef(ClearStencil),
- MethodDef(ClipPlane),
- MethodDef(Color3b),
- MethodDef(Color3bv),
- MethodDef(Color3d),
- MethodDef(Color3dv),
- MethodDef(Color3f),
- MethodDef(Color3fv),
- MethodDef(Color3i),
- MethodDef(Color3iv),
- MethodDef(Color3s),
- MethodDef(Color3sv),
- MethodDef(Color3ub),
- MethodDef(Color3ubv),
- MethodDef(Color3ui),
- MethodDef(Color3uiv),
- MethodDef(Color3us),
- MethodDef(Color3usv),
- MethodDef(Color4b),
- MethodDef(Color4bv),
- MethodDef(Color4d),
- MethodDef(Color4dv),
- MethodDef(Color4f),
- MethodDef(Color4fv),
- MethodDef(Color4i),
- MethodDef(Color4iv),
- MethodDef(Color4s),
- MethodDef(Color4sv),
- MethodDef(Color4ub),
- MethodDef(Color4ubv),
- MethodDef(Color4ui),
- MethodDef(Color4uiv),
- MethodDef(Color4us),
- MethodDef(Color4usv),
- MethodDef(ColorMask),
- MethodDef(ColorMaterial),
- MethodDef(CopyPixels),
- MethodDef(CullFace),
- MethodDef(DeleteLists),
- MethodDef(DeleteTextures),
- MethodDef(DepthFunc),
- MethodDef(DepthMask),
- MethodDef(DepthRange),
- MethodDef(Disable),
- MethodDef(DrawBuffer),
- MethodDef(DrawPixels),
- MethodDef(EdgeFlag),
- MethodDef(EdgeFlagv),
- MethodDef(Enable),
- MethodDef(End),
- MethodDef(EndList),
- MethodDef(EvalCoord1d),
- MethodDef(EvalCoord1dv),
- MethodDef(EvalCoord1f),
- MethodDef(EvalCoord1fv),
- MethodDef(EvalCoord2d),
- MethodDef(EvalCoord2dv),
- MethodDef(EvalCoord2f),
- MethodDef(EvalCoord2fv),
- MethodDef(EvalMesh1),
- MethodDef(EvalMesh2),
- MethodDef(EvalPoint1),
- MethodDef(EvalPoint2),
- MethodDef(FeedbackBuffer),
- MethodDef(Finish),
- MethodDef(Flush),
- MethodDef(Fogf),
- MethodDef(Fogfv),
- MethodDef(Fogi),
- MethodDef(Fogiv),
- MethodDef(FrontFace),
- MethodDef(Frustum),
- MethodDef(GenLists),
- MethodDef(GenTextures),
- MethodDef(GetBooleanv),
- MethodDef(GetClipPlane),
- MethodDef(GetDoublev),
- MethodDef(GetError),
- MethodDef(GetFloatv),
- MethodDef(GetIntegerv),
- MethodDef(GetLightfv),
- MethodDef(GetLightiv),
- MethodDef(GetMapdv),
- MethodDef(GetMapfv),
- MethodDef(GetMapiv),
- MethodDef(GetMaterialfv),
- MethodDef(GetMaterialiv),
- MethodDef(GetPixelMapfv),
- MethodDef(GetPixelMapuiv),
- MethodDef(GetPixelMapusv),
- MethodDef(GetPolygonStipple),
- MethodDef(GetString),
- MethodDef(GetTexEnvfv),
- MethodDef(GetTexEnviv),
- MethodDef(GetTexGendv),
- MethodDef(GetTexGenfv),
- MethodDef(GetTexGeniv),
- MethodDef(GetTexImage),
- MethodDef(GetTexLevelParameterfv),
- MethodDef(GetTexLevelParameteriv),
- MethodDef(GetTexParameterfv),
- MethodDef(GetTexParameteriv),
- MethodDef(Hint),
- MethodDef(IndexMask),
- MethodDef(Indexd),
- MethodDef(Indexdv),
- MethodDef(Indexf),
- MethodDef(Indexfv),
- MethodDef(Indexi),
- MethodDef(Indexiv),
- MethodDef(Indexs),
- MethodDef(Indexsv),
- MethodDef(InitNames),
- MethodDef(IsEnabled),
- MethodDef(IsList),
- MethodDef(IsTexture),
- MethodDef(LightModelf),
- MethodDef(LightModelfv),
- MethodDef(LightModeli),
- MethodDef(LightModeliv),
- MethodDef(Lightf),
- MethodDef(Lightfv),
- MethodDef(Lighti),
- MethodDef(Lightiv),
- MethodDef(LineStipple),
- MethodDef(LineWidth),
- MethodDef(ListBase),
- MethodDef(LoadIdentity),
- MethodDef(LoadMatrixd),
- MethodDef(LoadMatrixf),
- MethodDef(LoadName),
- MethodDef(LogicOp),
- MethodDef(Map1d),
- MethodDef(Map1f),
- MethodDef(Map2d),
- MethodDef(Map2f),
- MethodDef(MapGrid1d),
- MethodDef(MapGrid1f),
- MethodDef(MapGrid2d),
- MethodDef(MapGrid2f),
- MethodDef(Materialf),
- MethodDef(Materialfv),
- MethodDef(Materiali),
- MethodDef(Materialiv),
- MethodDef(MatrixMode),
- MethodDef(MultMatrixd),
- MethodDef(MultMatrixf),
- MethodDef(NewList),
- MethodDef(Normal3b),
- MethodDef(Normal3bv),
- MethodDef(Normal3d),
- MethodDef(Normal3dv),
- MethodDef(Normal3f),
- MethodDef(Normal3fv),
- MethodDef(Normal3i),
- MethodDef(Normal3iv),
- MethodDef(Normal3s),
- MethodDef(Normal3sv),
- MethodDef(Ortho),
- MethodDef(PassThrough),
- MethodDef(PixelMapfv),
- MethodDef(PixelMapuiv),
- MethodDef(PixelMapusv),
- MethodDef(PixelStoref),
- MethodDef(PixelStorei),
- MethodDef(PixelTransferf),
- MethodDef(PixelTransferi),
- MethodDef(PixelZoom),
- MethodDef(PointSize),
- MethodDef(PolygonMode),
- MethodDef(PolygonOffset),
- MethodDef(PolygonStipple),
- MethodDef(PopAttrib),
- MethodDef(PopClientAttrib),
- MethodDef(PopMatrix),
- MethodDef(PopName),
- MethodDef(PrioritizeTextures),
- MethodDef(PushAttrib),
- MethodDef(PushClientAttrib),
- MethodDef(PushMatrix),
- MethodDef(PushName),
- MethodDef(RasterPos2d),
- MethodDef(RasterPos2dv),
- MethodDef(RasterPos2f),
- MethodDef(RasterPos2fv),
- MethodDef(RasterPos2i),
- MethodDef(RasterPos2iv),
- MethodDef(RasterPos2s),
- MethodDef(RasterPos2sv),
- MethodDef(RasterPos3d),
- MethodDef(RasterPos3dv),
- MethodDef(RasterPos3f),
- MethodDef(RasterPos3fv),
- MethodDef(RasterPos3i),
- MethodDef(RasterPos3iv),
- MethodDef(RasterPos3s),
- MethodDef(RasterPos3sv),
- MethodDef(RasterPos4d),
- MethodDef(RasterPos4dv),
- MethodDef(RasterPos4f),
- MethodDef(RasterPos4fv),
- MethodDef(RasterPos4i),
- MethodDef(RasterPos4iv),
- MethodDef(RasterPos4s),
- MethodDef(RasterPos4sv),
- MethodDef(ReadBuffer),
- MethodDef(ReadPixels),
- MethodDef(Rectd),
- MethodDef(Rectdv),
- MethodDef(Rectf),
- MethodDef(Rectfv),
- MethodDef(Recti),
- MethodDef(Rectiv),
- MethodDef(Rects),
- MethodDef(Rectsv),
- MethodDef(RenderMode),
- MethodDef(Rotated),
- MethodDef(Rotatef),
- MethodDef(Scaled),
- MethodDef(Scalef),
- MethodDef(Scissor),
- MethodDef(SelectBuffer),
- MethodDef(ShadeModel),
- MethodDef(StencilFunc),
- MethodDef(StencilMask),
- MethodDef(StencilOp),
- MethodDef(TexCoord1d),
- MethodDef(TexCoord1dv),
- MethodDef(TexCoord1f),
- MethodDef(TexCoord1fv),
- MethodDef(TexCoord1i),
- MethodDef(TexCoord1iv),
- MethodDef(TexCoord1s),
- MethodDef(TexCoord1sv),
- MethodDef(TexCoord2d),
- MethodDef(TexCoord2dv),
- MethodDef(TexCoord2f),
- MethodDef(TexCoord2fv),
- MethodDef(TexCoord2i),
- MethodDef(TexCoord2iv),
- MethodDef(TexCoord2s),
- MethodDef(TexCoord2sv),
- MethodDef(TexCoord3d),
- MethodDef(TexCoord3dv),
- MethodDef(TexCoord3f),
- MethodDef(TexCoord3fv),
- MethodDef(TexCoord3i),
- MethodDef(TexCoord3iv),
- MethodDef(TexCoord3s),
- MethodDef(TexCoord3sv),
- MethodDef(TexCoord4d),
- MethodDef(TexCoord4dv),
- MethodDef(TexCoord4f),
- MethodDef(TexCoord4fv),
- MethodDef(TexCoord4i),
- MethodDef(TexCoord4iv),
- MethodDef(TexCoord4s),
- MethodDef(TexCoord4sv),
- MethodDef(TexEnvf),
- MethodDef(TexEnvfv),
- MethodDef(TexEnvi),
- MethodDef(TexEnviv),
- MethodDef(TexGend),
- MethodDef(TexGendv),
- MethodDef(TexGenf),
- MethodDef(TexGenfv),
- MethodDef(TexGeni),
- MethodDef(TexGeniv),
- MethodDef(TexImage1D),
- MethodDef(TexImage2D),
- MethodDef(TexParameterf),
- MethodDef(TexParameterfv),
- MethodDef(TexParameteri),
- MethodDef(TexParameteriv),
- MethodDef(Translated),
- MethodDef(Translatef),
- MethodDef(Vertex2d),
- MethodDef(Vertex2dv),
- MethodDef(Vertex2f),
- MethodDef(Vertex2fv),
- MethodDef(Vertex2i),
- MethodDef(Vertex2iv),
- MethodDef(Vertex2s),
- MethodDef(Vertex2sv),
- MethodDef(Vertex3d),
- MethodDef(Vertex3dv),
- MethodDef(Vertex3f),
- MethodDef(Vertex3fv),
- MethodDef(Vertex3i),
- MethodDef(Vertex3iv),
- MethodDef(Vertex3s),
- MethodDef(Vertex3sv),
- MethodDef(Vertex4d),
- MethodDef(Vertex4dv),
- MethodDef(Vertex4f),
- MethodDef(Vertex4fv),
- MethodDef(Vertex4i),
- MethodDef(Vertex4iv),
- MethodDef(Vertex4s),
- MethodDef(Vertex4sv),
- MethodDef(Viewport),
- MethodDefu(Perspective),
- MethodDefu(LookAt),
- MethodDefu(Ortho2D),
- MethodDefu(PickMatrix),
- MethodDefu(Project),
- MethodDefu(UnProject),
-/* #endif */
- {NULL, NULL, 0, NULL}
-};
-
-PyObject *BGL_Init(void)
-{
- PyObject *mod= Py_InitModule("Blender.BGL", BGL_methods);
- PyObject *dict= PyModule_GetDict(mod);
-
- if( PyType_Ready( &buffer_Type) < 0)
- Py_RETURN_NONE;
-
-#define EXPP_ADDCONST(x) EXPP_dict_set_item_str(dict, #x, PyInt_FromLong((int)x))
-
-/* So, for example:
- * EXPP_ADDCONST(GL_CURRENT_BIT) becomes
- * EXPP_dict_set_item_str(dict, "GL_CURRENT_BIT", PyInt_FromLong(GL_CURRENT_BIT)) */
-
- EXPP_ADDCONST(GL_CURRENT_BIT);
- EXPP_ADDCONST(GL_POINT_BIT);
- EXPP_ADDCONST(GL_LINE_BIT);
- EXPP_ADDCONST(GL_POLYGON_BIT);
- EXPP_ADDCONST(GL_POLYGON_STIPPLE_BIT);
- EXPP_ADDCONST(GL_PIXEL_MODE_BIT);
- EXPP_ADDCONST(GL_LIGHTING_BIT);
- EXPP_ADDCONST(GL_FOG_BIT);
- EXPP_ADDCONST(GL_DEPTH_BUFFER_BIT);
- EXPP_ADDCONST(GL_ACCUM_BUFFER_BIT);
- EXPP_ADDCONST(GL_STENCIL_BUFFER_BIT);
- EXPP_ADDCONST(GL_VIEWPORT_BIT);
- EXPP_ADDCONST(GL_TRANSFORM_BIT);
- EXPP_ADDCONST(GL_ENABLE_BIT);
- EXPP_ADDCONST(GL_COLOR_BUFFER_BIT);
- EXPP_ADDCONST(GL_HINT_BIT);
- EXPP_ADDCONST(GL_EVAL_BIT);
- EXPP_ADDCONST(GL_LIST_BIT);
- EXPP_ADDCONST(GL_TEXTURE_BIT);
- EXPP_ADDCONST(GL_SCISSOR_BIT);
- EXPP_ADDCONST(GL_ALL_ATTRIB_BITS);
- EXPP_ADDCONST(GL_CLIENT_ALL_ATTRIB_BITS);
-
- EXPP_ADDCONST(GL_FALSE);
- EXPP_ADDCONST(GL_TRUE);
-
- EXPP_ADDCONST(GL_POINTS);
- EXPP_ADDCONST(GL_LINES);
- EXPP_ADDCONST(GL_LINE_LOOP);
- EXPP_ADDCONST(GL_LINE_STRIP);
- EXPP_ADDCONST(GL_TRIANGLES);
- EXPP_ADDCONST(GL_TRIANGLE_STRIP);
- EXPP_ADDCONST(GL_TRIANGLE_FAN);
- EXPP_ADDCONST(GL_QUADS);
- EXPP_ADDCONST(GL_QUAD_STRIP);
- EXPP_ADDCONST(GL_POLYGON);
-
- EXPP_ADDCONST(GL_ACCUM);
- EXPP_ADDCONST(GL_LOAD);
- EXPP_ADDCONST(GL_RETURN);
- EXPP_ADDCONST(GL_MULT);
- EXPP_ADDCONST(GL_ADD);
-
- EXPP_ADDCONST(GL_NEVER);
- EXPP_ADDCONST(GL_LESS);
- EXPP_ADDCONST(GL_EQUAL);
- EXPP_ADDCONST(GL_LEQUAL);
- EXPP_ADDCONST(GL_GREATER);
- EXPP_ADDCONST(GL_NOTEQUAL);
- EXPP_ADDCONST(GL_GEQUAL);
- EXPP_ADDCONST(GL_ALWAYS);
-
- EXPP_ADDCONST(GL_ZERO);
- EXPP_ADDCONST(GL_ONE);
- EXPP_ADDCONST(GL_SRC_COLOR);
- EXPP_ADDCONST(GL_ONE_MINUS_SRC_COLOR);
- EXPP_ADDCONST(GL_SRC_ALPHA);
- EXPP_ADDCONST(GL_ONE_MINUS_SRC_ALPHA);
- EXPP_ADDCONST(GL_DST_ALPHA);
- EXPP_ADDCONST(GL_ONE_MINUS_DST_ALPHA);
-
- EXPP_ADDCONST(GL_DST_COLOR);
- EXPP_ADDCONST(GL_ONE_MINUS_DST_COLOR);
- EXPP_ADDCONST(GL_SRC_ALPHA_SATURATE);
-
- EXPP_ADDCONST(GL_NONE);
- EXPP_ADDCONST(GL_FRONT_LEFT);
- EXPP_ADDCONST(GL_FRONT_RIGHT);
- EXPP_ADDCONST(GL_BACK_LEFT);
- EXPP_ADDCONST(GL_BACK_RIGHT);
- EXPP_ADDCONST(GL_FRONT);
- EXPP_ADDCONST(GL_BACK);
- EXPP_ADDCONST(GL_LEFT);
- EXPP_ADDCONST(GL_RIGHT);
- EXPP_ADDCONST(GL_FRONT_AND_BACK);
- EXPP_ADDCONST(GL_AUX0);
- EXPP_ADDCONST(GL_AUX1);
- EXPP_ADDCONST(GL_AUX2);
- EXPP_ADDCONST(GL_AUX3);
-
- EXPP_ADDCONST(GL_NO_ERROR);
- EXPP_ADDCONST(GL_INVALID_ENUM);
- EXPP_ADDCONST(GL_INVALID_VALUE);
- EXPP_ADDCONST(GL_INVALID_OPERATION);
- EXPP_ADDCONST(GL_STACK_OVERFLOW);
- EXPP_ADDCONST(GL_STACK_UNDERFLOW);
- EXPP_ADDCONST(GL_OUT_OF_MEMORY);
-
- EXPP_ADDCONST(GL_2D);
- EXPP_ADDCONST(GL_3D);
- EXPP_ADDCONST(GL_3D_COLOR);
- EXPP_ADDCONST(GL_3D_COLOR_TEXTURE);
- EXPP_ADDCONST(GL_4D_COLOR_TEXTURE);
-
- EXPP_ADDCONST(GL_PASS_THROUGH_TOKEN);
- EXPP_ADDCONST(GL_POINT_TOKEN);
- EXPP_ADDCONST(GL_LINE_TOKEN);
- EXPP_ADDCONST(GL_POLYGON_TOKEN);
- EXPP_ADDCONST(GL_BITMAP_TOKEN);
- EXPP_ADDCONST(GL_DRAW_PIXEL_TOKEN);
- EXPP_ADDCONST(GL_COPY_PIXEL_TOKEN);
- EXPP_ADDCONST(GL_LINE_RESET_TOKEN);
-
- EXPP_ADDCONST(GL_EXP);
- EXPP_ADDCONST(GL_EXP2);
-
- EXPP_ADDCONST(GL_CW);
- EXPP_ADDCONST(GL_CCW);
-
- EXPP_ADDCONST(GL_COEFF);
- EXPP_ADDCONST(GL_ORDER);
- EXPP_ADDCONST(GL_DOMAIN);
-
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_I);
- EXPP_ADDCONST(GL_PIXEL_MAP_S_TO_S);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_R);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_G);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_B);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_A);
- EXPP_ADDCONST(GL_PIXEL_MAP_R_TO_R);
- EXPP_ADDCONST(GL_PIXEL_MAP_G_TO_G);
- EXPP_ADDCONST(GL_PIXEL_MAP_B_TO_B);
- EXPP_ADDCONST(GL_PIXEL_MAP_A_TO_A);
-
- EXPP_ADDCONST(GL_CURRENT_COLOR);
- EXPP_ADDCONST(GL_CURRENT_INDEX);
- EXPP_ADDCONST(GL_CURRENT_NORMAL);
- EXPP_ADDCONST(GL_CURRENT_TEXTURE_COORDS);
- EXPP_ADDCONST(GL_CURRENT_RASTER_COLOR);
- EXPP_ADDCONST(GL_CURRENT_RASTER_INDEX);
- EXPP_ADDCONST(GL_CURRENT_RASTER_TEXTURE_COORDS);
- EXPP_ADDCONST(GL_CURRENT_RASTER_POSITION);
- EXPP_ADDCONST(GL_CURRENT_RASTER_POSITION_VALID);
- EXPP_ADDCONST(GL_CURRENT_RASTER_DISTANCE);
- EXPP_ADDCONST(GL_POINT_SMOOTH);
- EXPP_ADDCONST(GL_POINT_SIZE);
- EXPP_ADDCONST(GL_POINT_SIZE_RANGE);
- EXPP_ADDCONST(GL_POINT_SIZE_GRANULARITY);
- EXPP_ADDCONST(GL_LINE_SMOOTH);
- EXPP_ADDCONST(GL_LINE_WIDTH);
- EXPP_ADDCONST(GL_LINE_WIDTH_RANGE);
- EXPP_ADDCONST(GL_LINE_WIDTH_GRANULARITY);
- EXPP_ADDCONST(GL_LINE_STIPPLE);
- EXPP_ADDCONST(GL_LINE_STIPPLE_PATTERN);
- EXPP_ADDCONST(GL_LINE_STIPPLE_REPEAT);
- EXPP_ADDCONST(GL_LIST_MODE);
- EXPP_ADDCONST(GL_MAX_LIST_NESTING);
- EXPP_ADDCONST(GL_LIST_BASE);
- EXPP_ADDCONST(GL_LIST_INDEX);
- EXPP_ADDCONST(GL_POLYGON_MODE);
- EXPP_ADDCONST(GL_POLYGON_SMOOTH);
- EXPP_ADDCONST(GL_POLYGON_STIPPLE);
- EXPP_ADDCONST(GL_EDGE_FLAG);
- EXPP_ADDCONST(GL_CULL_FACE);
- EXPP_ADDCONST(GL_CULL_FACE_MODE);
- EXPP_ADDCONST(GL_FRONT_FACE);
- EXPP_ADDCONST(GL_LIGHTING);
- EXPP_ADDCONST(GL_LIGHT_MODEL_LOCAL_VIEWER);
- EXPP_ADDCONST(GL_LIGHT_MODEL_TWO_SIDE);
- EXPP_ADDCONST(GL_LIGHT_MODEL_AMBIENT);
- EXPP_ADDCONST(GL_SHADE_MODEL);
- EXPP_ADDCONST(GL_COLOR_MATERIAL_FACE);
- EXPP_ADDCONST(GL_COLOR_MATERIAL_PARAMETER);
- EXPP_ADDCONST(GL_COLOR_MATERIAL);
- EXPP_ADDCONST(GL_FOG);
- EXPP_ADDCONST(GL_FOG_INDEX);
- EXPP_ADDCONST(GL_FOG_DENSITY);
- EXPP_ADDCONST(GL_FOG_START);
- EXPP_ADDCONST(GL_FOG_END);
- EXPP_ADDCONST(GL_FOG_MODE);
- EXPP_ADDCONST(GL_FOG_COLOR);
- EXPP_ADDCONST(GL_DEPTH_RANGE);
- EXPP_ADDCONST(GL_DEPTH_TEST);
- EXPP_ADDCONST(GL_DEPTH_WRITEMASK);
- EXPP_ADDCONST(GL_DEPTH_CLEAR_VALUE);
- EXPP_ADDCONST(GL_DEPTH_FUNC);
- EXPP_ADDCONST(GL_ACCUM_CLEAR_VALUE);
- EXPP_ADDCONST(GL_STENCIL_TEST);
- EXPP_ADDCONST(GL_STENCIL_CLEAR_VALUE);
- EXPP_ADDCONST(GL_STENCIL_FUNC);
- EXPP_ADDCONST(GL_STENCIL_VALUE_MASK);
- EXPP_ADDCONST(GL_STENCIL_FAIL);
- EXPP_ADDCONST(GL_STENCIL_PASS_DEPTH_FAIL);
- EXPP_ADDCONST(GL_STENCIL_PASS_DEPTH_PASS);
- EXPP_ADDCONST(GL_STENCIL_REF);
- EXPP_ADDCONST(GL_STENCIL_WRITEMASK);
- EXPP_ADDCONST(GL_MATRIX_MODE);
- EXPP_ADDCONST(GL_NORMALIZE);
- EXPP_ADDCONST(GL_VIEWPORT);
- EXPP_ADDCONST(GL_MODELVIEW_STACK_DEPTH);
- EXPP_ADDCONST(GL_PROJECTION_STACK_DEPTH);
- EXPP_ADDCONST(GL_TEXTURE_STACK_DEPTH);
- EXPP_ADDCONST(GL_MODELVIEW_MATRIX);
- EXPP_ADDCONST(GL_PROJECTION_MATRIX);
- EXPP_ADDCONST(GL_TEXTURE_MATRIX);
- EXPP_ADDCONST(GL_ATTRIB_STACK_DEPTH);
- EXPP_ADDCONST(GL_ALPHA_TEST);
- EXPP_ADDCONST(GL_ALPHA_TEST_FUNC);
- EXPP_ADDCONST(GL_ALPHA_TEST_REF);
- EXPP_ADDCONST(GL_DITHER);
- EXPP_ADDCONST(GL_BLEND_DST);
- EXPP_ADDCONST(GL_BLEND_SRC);
- EXPP_ADDCONST(GL_BLEND);
- EXPP_ADDCONST(GL_LOGIC_OP_MODE);
- EXPP_ADDCONST(GL_LOGIC_OP);
- EXPP_ADDCONST(GL_AUX_BUFFERS);
- EXPP_ADDCONST(GL_DRAW_BUFFER);
- EXPP_ADDCONST(GL_READ_BUFFER);
- EXPP_ADDCONST(GL_SCISSOR_BOX);
- EXPP_ADDCONST(GL_SCISSOR_TEST);
- EXPP_ADDCONST(GL_INDEX_CLEAR_VALUE);
- EXPP_ADDCONST(GL_INDEX_WRITEMASK);
- EXPP_ADDCONST(GL_COLOR_CLEAR_VALUE);
- EXPP_ADDCONST(GL_COLOR_WRITEMASK);
- EXPP_ADDCONST(GL_INDEX_MODE);
- EXPP_ADDCONST(GL_RGBA_MODE);
- EXPP_ADDCONST(GL_DOUBLEBUFFER);
- EXPP_ADDCONST(GL_STEREO);
- EXPP_ADDCONST(GL_RENDER_MODE);
- EXPP_ADDCONST(GL_PERSPECTIVE_CORRECTION_HINT);
- EXPP_ADDCONST(GL_POINT_SMOOTH_HINT);
- EXPP_ADDCONST(GL_LINE_SMOOTH_HINT);
- EXPP_ADDCONST(GL_POLYGON_SMOOTH_HINT);
- EXPP_ADDCONST(GL_FOG_HINT);
- EXPP_ADDCONST(GL_TEXTURE_GEN_S);
- EXPP_ADDCONST(GL_TEXTURE_GEN_T);
- EXPP_ADDCONST(GL_TEXTURE_GEN_R);
- EXPP_ADDCONST(GL_TEXTURE_GEN_Q);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_I_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_S_TO_S_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_R_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_G_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_B_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_A_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_R_TO_R_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_G_TO_G_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_B_TO_B_SIZE);
- EXPP_ADDCONST(GL_PIXEL_MAP_A_TO_A_SIZE);
- EXPP_ADDCONST(GL_UNPACK_SWAP_BYTES);
- EXPP_ADDCONST(GL_UNPACK_LSB_FIRST);
- EXPP_ADDCONST(GL_UNPACK_ROW_LENGTH);
- EXPP_ADDCONST(GL_UNPACK_SKIP_ROWS);
- EXPP_ADDCONST(GL_UNPACK_SKIP_PIXELS);
- EXPP_ADDCONST(GL_UNPACK_ALIGNMENT);
- EXPP_ADDCONST(GL_PACK_SWAP_BYTES);
- EXPP_ADDCONST(GL_PACK_LSB_FIRST);
- EXPP_ADDCONST(GL_PACK_ROW_LENGTH);
- EXPP_ADDCONST(GL_PACK_SKIP_ROWS);
- EXPP_ADDCONST(GL_PACK_SKIP_PIXELS);
- EXPP_ADDCONST(GL_PACK_ALIGNMENT);
- EXPP_ADDCONST(GL_MAP_COLOR);
- EXPP_ADDCONST(GL_MAP_STENCIL);
- EXPP_ADDCONST(GL_INDEX_SHIFT);
- EXPP_ADDCONST(GL_INDEX_OFFSET);
- EXPP_ADDCONST(GL_RED_SCALE);
- EXPP_ADDCONST(GL_RED_BIAS);
- EXPP_ADDCONST(GL_ZOOM_X);
- EXPP_ADDCONST(GL_ZOOM_Y);
- EXPP_ADDCONST(GL_GREEN_SCALE);
- EXPP_ADDCONST(GL_GREEN_BIAS);
- EXPP_ADDCONST(GL_BLUE_SCALE);
- EXPP_ADDCONST(GL_BLUE_BIAS);
- EXPP_ADDCONST(GL_ALPHA_SCALE);
- EXPP_ADDCONST(GL_ALPHA_BIAS);
- EXPP_ADDCONST(GL_DEPTH_SCALE);
- EXPP_ADDCONST(GL_DEPTH_BIAS);
- EXPP_ADDCONST(GL_MAX_EVAL_ORDER);
- EXPP_ADDCONST(GL_MAX_LIGHTS);
- EXPP_ADDCONST(GL_MAX_CLIP_PLANES);
- EXPP_ADDCONST(GL_MAX_TEXTURE_SIZE);
- EXPP_ADDCONST(GL_MAX_PIXEL_MAP_TABLE);
- EXPP_ADDCONST(GL_MAX_ATTRIB_STACK_DEPTH);
- EXPP_ADDCONST(GL_MAX_MODELVIEW_STACK_DEPTH);
- EXPP_ADDCONST(GL_MAX_NAME_STACK_DEPTH);
- EXPP_ADDCONST(GL_MAX_PROJECTION_STACK_DEPTH);
- EXPP_ADDCONST(GL_MAX_TEXTURE_STACK_DEPTH);
- EXPP_ADDCONST(GL_MAX_VIEWPORT_DIMS);
- EXPP_ADDCONST(GL_SUBPIXEL_BITS);
- EXPP_ADDCONST(GL_INDEX_BITS);
- EXPP_ADDCONST(GL_RED_BITS);
- EXPP_ADDCONST(GL_GREEN_BITS);
- EXPP_ADDCONST(GL_BLUE_BITS);
- EXPP_ADDCONST(GL_ALPHA_BITS);
- EXPP_ADDCONST(GL_DEPTH_BITS);
- EXPP_ADDCONST(GL_STENCIL_BITS);
- EXPP_ADDCONST(GL_ACCUM_RED_BITS);
- EXPP_ADDCONST(GL_ACCUM_GREEN_BITS);
- EXPP_ADDCONST(GL_ACCUM_BLUE_BITS);
- EXPP_ADDCONST(GL_ACCUM_ALPHA_BITS);
- EXPP_ADDCONST(GL_NAME_STACK_DEPTH);
- EXPP_ADDCONST(GL_AUTO_NORMAL);
- EXPP_ADDCONST(GL_MAP1_COLOR_4);
- EXPP_ADDCONST(GL_MAP1_INDEX);
- EXPP_ADDCONST(GL_MAP1_NORMAL);
- EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_1);
- EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_2);
- EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_3);
- EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_4);
- EXPP_ADDCONST(GL_MAP1_VERTEX_3);
- EXPP_ADDCONST(GL_MAP1_VERTEX_4);
- EXPP_ADDCONST(GL_MAP2_COLOR_4);
- EXPP_ADDCONST(GL_MAP2_INDEX);
- EXPP_ADDCONST(GL_MAP2_NORMAL);
- EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_1);
- EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_2);
- EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_3);
- EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_4);
- EXPP_ADDCONST(GL_MAP2_VERTEX_3);
- EXPP_ADDCONST(GL_MAP2_VERTEX_4);
- EXPP_ADDCONST(GL_MAP1_GRID_DOMAIN);
- EXPP_ADDCONST(GL_MAP1_GRID_SEGMENTS);
- EXPP_ADDCONST(GL_MAP2_GRID_DOMAIN);
- EXPP_ADDCONST(GL_MAP2_GRID_SEGMENTS);
- EXPP_ADDCONST(GL_TEXTURE_1D);
- EXPP_ADDCONST(GL_TEXTURE_2D);
-
- EXPP_ADDCONST(GL_TEXTURE_WIDTH);
- EXPP_ADDCONST(GL_TEXTURE_HEIGHT);
- EXPP_ADDCONST(GL_TEXTURE_COMPONENTS);
- EXPP_ADDCONST(GL_TEXTURE_BORDER_COLOR);
- EXPP_ADDCONST(GL_TEXTURE_BORDER);
-
- EXPP_ADDCONST(GL_DONT_CARE);
- EXPP_ADDCONST(GL_FASTEST);
- EXPP_ADDCONST(GL_NICEST);
-
- EXPP_ADDCONST(GL_AMBIENT);
- EXPP_ADDCONST(GL_DIFFUSE);
- EXPP_ADDCONST(GL_SPECULAR);
- EXPP_ADDCONST(GL_POSITION);
- EXPP_ADDCONST(GL_SPOT_DIRECTION);
- EXPP_ADDCONST(GL_SPOT_EXPONENT);
- EXPP_ADDCONST(GL_SPOT_CUTOFF);
- EXPP_ADDCONST(GL_CONSTANT_ATTENUATION);
- EXPP_ADDCONST(GL_LINEAR_ATTENUATION);
- EXPP_ADDCONST(GL_QUADRATIC_ATTENUATION);
-
- EXPP_ADDCONST(GL_COMPILE);
- EXPP_ADDCONST(GL_COMPILE_AND_EXECUTE);
-
- EXPP_ADDCONST(GL_BYTE);
- EXPP_ADDCONST(GL_UNSIGNED_BYTE);
- EXPP_ADDCONST(GL_SHORT);
- EXPP_ADDCONST(GL_UNSIGNED_SHORT);
- EXPP_ADDCONST(GL_INT);
- EXPP_ADDCONST(GL_UNSIGNED_INT);
- EXPP_ADDCONST(GL_FLOAT);
- EXPP_ADDCONST(GL_DOUBLE);
- EXPP_ADDCONST(GL_2_BYTES);
- EXPP_ADDCONST(GL_3_BYTES);
- EXPP_ADDCONST(GL_4_BYTES);
-
- EXPP_ADDCONST(GL_CLEAR);
- EXPP_ADDCONST(GL_AND);
- EXPP_ADDCONST(GL_AND_REVERSE);
- EXPP_ADDCONST(GL_COPY);
- EXPP_ADDCONST(GL_AND_INVERTED);
- EXPP_ADDCONST(GL_NOOP);
- EXPP_ADDCONST(GL_XOR);
- EXPP_ADDCONST(GL_OR);
- EXPP_ADDCONST(GL_NOR);
- EXPP_ADDCONST(GL_EQUIV);
- EXPP_ADDCONST(GL_INVERT);
- EXPP_ADDCONST(GL_OR_REVERSE);
- EXPP_ADDCONST(GL_COPY_INVERTED);
- EXPP_ADDCONST(GL_OR_INVERTED);
- EXPP_ADDCONST(GL_NAND);
- EXPP_ADDCONST(GL_SET);
-
- EXPP_ADDCONST(GL_EMISSION);
- EXPP_ADDCONST(GL_SHININESS);
- EXPP_ADDCONST(GL_AMBIENT_AND_DIFFUSE);
- EXPP_ADDCONST(GL_COLOR_INDEXES);
-
- EXPP_ADDCONST(GL_MODELVIEW);
- EXPP_ADDCONST(GL_PROJECTION);
- EXPP_ADDCONST(GL_TEXTURE);
-
- EXPP_ADDCONST(GL_COLOR);
- EXPP_ADDCONST(GL_DEPTH);
- EXPP_ADDCONST(GL_STENCIL);
-
- EXPP_ADDCONST(GL_COLOR_INDEX);
- EXPP_ADDCONST(GL_STENCIL_INDEX);
- EXPP_ADDCONST(GL_DEPTH_COMPONENT);
- EXPP_ADDCONST(GL_RED);
- EXPP_ADDCONST(GL_GREEN);
- EXPP_ADDCONST(GL_BLUE);
- EXPP_ADDCONST(GL_ALPHA);
- EXPP_ADDCONST(GL_RGB);
- EXPP_ADDCONST(GL_RGBA);
- EXPP_ADDCONST(GL_LUMINANCE);
- EXPP_ADDCONST(GL_LUMINANCE_ALPHA);
-
- EXPP_ADDCONST(GL_BITMAP);
-
- EXPP_ADDCONST(GL_POINT);
- EXPP_ADDCONST(GL_LINE);
- EXPP_ADDCONST(GL_FILL);
-
- EXPP_ADDCONST(GL_RENDER);
- EXPP_ADDCONST(GL_FEEDBACK);
- EXPP_ADDCONST(GL_SELECT);
-
- EXPP_ADDCONST(GL_FLAT);
- EXPP_ADDCONST(GL_SMOOTH);
-
- EXPP_ADDCONST(GL_KEEP);
- EXPP_ADDCONST(GL_REPLACE);
- EXPP_ADDCONST(GL_INCR);
- EXPP_ADDCONST(GL_DECR);
-
- EXPP_ADDCONST(GL_VENDOR);
- EXPP_ADDCONST(GL_RENDERER);
- EXPP_ADDCONST(GL_VERSION);
- EXPP_ADDCONST(GL_EXTENSIONS);
-
- EXPP_ADDCONST(GL_S);
- EXPP_ADDCONST(GL_T);
- EXPP_ADDCONST(GL_R);
- EXPP_ADDCONST(GL_Q);
-
- EXPP_ADDCONST(GL_MODULATE);
- EXPP_ADDCONST(GL_DECAL);
-
- EXPP_ADDCONST(GL_TEXTURE_ENV_MODE);
- EXPP_ADDCONST(GL_TEXTURE_ENV_COLOR);
-
- EXPP_ADDCONST(GL_TEXTURE_ENV);
-
- EXPP_ADDCONST(GL_EYE_LINEAR);
- EXPP_ADDCONST(GL_OBJECT_LINEAR);
- EXPP_ADDCONST(GL_SPHERE_MAP);
-
- EXPP_ADDCONST(GL_TEXTURE_GEN_MODE);
- EXPP_ADDCONST(GL_OBJECT_PLANE);
- EXPP_ADDCONST(GL_EYE_PLANE);
-
- EXPP_ADDCONST(GL_NEAREST);
- EXPP_ADDCONST(GL_LINEAR);
-
- EXPP_ADDCONST(GL_NEAREST_MIPMAP_NEAREST);
- EXPP_ADDCONST(GL_LINEAR_MIPMAP_NEAREST);
- EXPP_ADDCONST(GL_NEAREST_MIPMAP_LINEAR);
- EXPP_ADDCONST(GL_LINEAR_MIPMAP_LINEAR);
-
- EXPP_ADDCONST(GL_TEXTURE_MAG_FILTER);
- EXPP_ADDCONST(GL_TEXTURE_MIN_FILTER);
- EXPP_ADDCONST(GL_TEXTURE_WRAP_S);
- EXPP_ADDCONST(GL_TEXTURE_WRAP_T);
-
- EXPP_ADDCONST(GL_CLAMP);
- EXPP_ADDCONST(GL_REPEAT);
-
- EXPP_ADDCONST(GL_CLIP_PLANE0);
- EXPP_ADDCONST(GL_CLIP_PLANE1);
- EXPP_ADDCONST(GL_CLIP_PLANE2);
- EXPP_ADDCONST(GL_CLIP_PLANE3);
- EXPP_ADDCONST(GL_CLIP_PLANE4);
- EXPP_ADDCONST(GL_CLIP_PLANE5);
-
- EXPP_ADDCONST(GL_LIGHT0);
- EXPP_ADDCONST(GL_LIGHT1);
- EXPP_ADDCONST(GL_LIGHT2);
- EXPP_ADDCONST(GL_LIGHT3);
- EXPP_ADDCONST(GL_LIGHT4);
- EXPP_ADDCONST(GL_LIGHT5);
- EXPP_ADDCONST(GL_LIGHT6);
- EXPP_ADDCONST(GL_LIGHT7);
-
- EXPP_ADDCONST(GL_POLYGON_OFFSET_UNITS);
- EXPP_ADDCONST(GL_POLYGON_OFFSET_POINT);
- EXPP_ADDCONST(GL_POLYGON_OFFSET_LINE);
- EXPP_ADDCONST(GL_POLYGON_OFFSET_FILL);
- EXPP_ADDCONST(GL_POLYGON_OFFSET_FACTOR);
-
- EXPP_ADDCONST(GL_TEXTURE_PRIORITY);
- EXPP_ADDCONST(GL_TEXTURE_RESIDENT);
- EXPP_ADDCONST(GL_TEXTURE_BINDING_1D);
- EXPP_ADDCONST(GL_TEXTURE_BINDING_2D);
-
- return mod;
-}
-
diff --git a/source/blender/python/api2_2x/BGL.h b/source/blender/python/api2_2x/BGL.h
deleted file mode 100644
index 461f5bc9372..00000000000
--- a/source/blender/python/api2_2x/BGL.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* This is the Blender.BGL part of opy_draw.c, from the old bpython/intern
- * dir, with minor changes to adapt it to the new Python implementation.
- * The BGL submodule "wraps" OpenGL functions and constants, allowing script
- * writers to make OpenGL calls in their Python scripts for Blender. The
- * more important original comments are marked with an @ symbol. */
-
-#ifndef EXPP_BGL_H
-#define EXPP_BGL_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <Python.h>
-#include "BIF_gl.h"
-
-
-/*@ Buffer Object */
-/*@ For Python access to OpenGL functions requiring a pointer. */
-
-typedef struct _Buffer {
- PyObject_VAR_HEAD
- PyObject * parent;
-
- int type; /* GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT */
- int ndimensions;
- int *dimensions;
-
- union {
- char *asbyte;
- short *asshort;
- int *asint;
- float *asfloat;
- double *asdouble;
-
- void *asvoid;
- } buf;
-} Buffer;
-
-
-/*@ By golly George! It looks like fancy pants macro time!!! */
-
-/*
-#define int_str "i"
-#define int_var(number) bgl_int##number
-#define int_ref(number) &bgl_int##number
-#define int_def(number) int int_var(number)
-
-#define float_str "f"
-#define float_var(number) bgl_float##number
-#define float_ref(number) &bgl_float##number
-#define float_def(number) float float_var(number)
-*/
-
-/* TYPE_str is the string to pass to Py_ArgParse (for the format) */
-/* TYPE_var is the name to pass to the GL function */
-/* TYPE_ref is the pointer to pass to Py_ArgParse (to store in) */
-/* TYPE_def is the C initialization of the variable */
-
-#define void_str ""
-#define void_var(num)
-#define void_ref(num) &bgl_var##num
-#define void_def(num) char bgl_var##num
-
-#define buffer_str "O!"
-#define buffer_var(number) (bgl_buffer##number)->buf.asvoid
-#define buffer_ref(number) &buffer_Type, &bgl_buffer##number
-#define buffer_def(number) Buffer *bgl_buffer##number
-
-/* GL Pointer fields, handled by buffer type */
-/* GLdoubleP, GLfloatP, GLintP, GLuintP, GLshortP */
-
-#define GLbooleanP_str "O!"
-#define GLbooleanP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLbooleanP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLbooleanP_def(number) Buffer *bgl_buffer##number
-
-#define GLbyteP_str "O!"
-#define GLbyteP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLbyteP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLbyteP_def(number) Buffer *bgl_buffer##number
-
-#define GLubyteP_str "O!"
-#define GLubyteP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLubyteP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLubyteP_def(number) Buffer *bgl_buffer##number
-
-#define GLintP_str "O!"
-#define GLintP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLintP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLintP_def(number) Buffer *bgl_buffer##number
-
-#define GLuintP_str "O!"
-#define GLuintP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLuintP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLuintP_def(number) Buffer *bgl_buffer##number
-
-#define GLshortP_str "O!"
-#define GLshortP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLshortP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLshortP_def(number) Buffer *bgl_buffer##number
-
-#define GLushortP_str "O!"
-#define GLushortP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLushortP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLushortP_def(number) Buffer *bgl_buffer##number
-
-#define GLfloatP_str "O!"
-#define GLfloatP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLfloatP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLfloatP_def(number) Buffer *bgl_buffer##number
-
-#define GLdoubleP_str "O!"
-#define GLdoubleP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLdoubleP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLdoubleP_def(number) Buffer *bgl_buffer##number
-
-#define GLclampfP_str "O!"
-#define GLclampfP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLclampfP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLclampfP_def(number) Buffer *bgl_buffer##number
-
-#define GLvoidP_str "O!"
-#define GLvoidP_var(number) (bgl_buffer##number)->buf.asvoid
-#define GLvoidP_ref(number) &buffer_Type, &bgl_buffer##number
-#define GLvoidP_def(number) Buffer *bgl_buffer##number
-
-#define buffer_str "O!"
-#define buffer_var(number) (bgl_buffer##number)->buf.asvoid
-#define buffer_ref(number) &buffer_Type, &bgl_buffer##number
-#define buffer_def(number) Buffer *bgl_buffer##number
-
-/*@The standard GL typedefs are used as prototypes, we can't
- * use the GL type directly because Py_ArgParse expects normal
- * C types.
- *
- * Py_ArgParse doesn't grok writing into unsigned variables,
- * so we use signed everything (even stuff that should be unsigned.
- */
-
-/* typedef unsigned int GLenum; */
-#define GLenum_str "i"
-#define GLenum_var(num) bgl_var##num
-#define GLenum_ref(num) &bgl_var##num
-#define GLenum_def(num) /* unsigned */ int GLenum_var(num)
-
-/* typedef unsigned int GLboolean; */
-#define GLboolean_str "b"
-#define GLboolean_var(num) bgl_var##num
-#define GLboolean_ref(num) &bgl_var##num
-#define GLboolean_def(num) /* unsigned */ char GLboolean_var(num)
-
-/* typedef unsigned int GLbitfield; */
-#define GLbitfield_str "i"
-#define GLbitfield_var(num) bgl_var##num
-#define GLbitfield_ref(num) &bgl_var##num
-#define GLbitfield_def(num) /* unsigned */ int GLbitfield_var(num)
-
-/* typedef signed char GLbyte; */
-#define GLbyte_str "b"
-#define GLbyte_var(num) bgl_var##num
-#define GLbyte_ref(num) &bgl_var##num
-#define GLbyte_def(num) signed char GLbyte_var(num)
-
-/* typedef short GLshort; */
-#define GLshort_str "h"
-#define GLshort_var(num) bgl_var##num
-#define GLshort_ref(num) &bgl_var##num
-#define GLshort_def(num) short GLshort_var(num)
-
-/* typedef int GLint; */
-#define GLint_str "i"
-#define GLint_var(num) bgl_var##num
-#define GLint_ref(num) &bgl_var##num
-#define GLint_def(num) int GLint_var(num)
-
-/* typedef int GLsizei; */
-#define GLsizei_str "i"
-#define GLsizei_var(num) bgl_var##num
-#define GLsizei_ref(num) &bgl_var##num
-#define GLsizei_def(num) int GLsizei_var(num)
-
-/* typedef unsigned char GLubyte; */
-#define GLubyte_str "b"
-#define GLubyte_var(num) bgl_var##num
-#define GLubyte_ref(num) &bgl_var##num
-#define GLubyte_def(num) /* unsigned */ char GLubyte_var(num)
-
-/* typedef unsigned short GLushort; */
-#define GLushort_str "h"
-#define GLushort_var(num) bgl_var##num
-#define GLushort_ref(num) &bgl_var##num
-#define GLushort_def(num) /* unsigned */ short GLushort_var(num)
-
-/* typedef unsigned int GLuint; */
-#define GLuint_str "i"
-#define GLuint_var(num) bgl_var##num
-#define GLuint_ref(num) &bgl_var##num
-#define GLuint_def(num) /* unsigned */ int GLuint_var(num)
-
-/* typedef float GLfloat; */
-#define GLfloat_str "f"
-#define GLfloat_var(num) bgl_var##num
-#define GLfloat_ref(num) &bgl_var##num
-#define GLfloat_def(num) float GLfloat_var(num)
-
-/* typedef float GLclampf; */
-#define GLclampf_str "f"
-#define GLclampf_var(num) bgl_var##num
-#define GLclampf_ref(num) &bgl_var##num
-#define GLclampf_def(num) float GLclampf_var(num)
-
-/* typedef double GLdouble; */
-#define GLdouble_str "d"
-#define GLdouble_var(num) bgl_var##num
-#define GLdouble_ref(num) &bgl_var##num
-#define GLdouble_def(num) double GLdouble_var(num)
-
-/* typedef double GLclampd; */
-#define GLclampd_str "d"
-#define GLclampd_var(num) bgl_var##num
-#define GLclampd_ref(num) &bgl_var##num
-#define GLclampd_def(num) double GLclampd_var(num)
-
-/* typedef void GLvoid; */
-/* #define GLvoid_str "" */
-/* #define GLvoid_var(num) bgl_var##num */
-/* #define GLvoid_ref(num) &bgl_var##num */
-/* #define GLvoid_def(num) char bgl_var##num */
-
-#define arg_def1(a1) a1##_def(1)
-#define arg_def2(a1, a2) arg_def1(a1); a2##_def(2)
-#define arg_def3(a1, a2, a3) arg_def2(a1, a2); a3##_def(3)
-#define arg_def4(a1, a2, a3, a4) arg_def3(a1, a2, a3); a4##_def(4)
-#define arg_def5(a1, a2, a3, a4, a5) arg_def4(a1, a2, a3, a4); a5##_def(5)
-#define arg_def6(a1, a2, a3, a4, a5, a6)arg_def5(a1, a2, a3, a4, a5); a6##_def(6)
-#define arg_def7(a1, a2, a3, a4, a5, a6, a7)arg_def6(a1, a2, a3, a4, a5, a6); a7##_def(7)
-#define arg_def8(a1, a2, a3, a4, a5, a6, a7, a8)arg_def7(a1, a2, a3, a4, a5, a6, a7); a8##_def(8)
-#define arg_def9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_def8(a1, a2, a3, a4, a5, a6, a7, a8); a9##_def(9)
-#define arg_def10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_def9(a1, a2, a3, a4, a5, a6, a7, a8, a9); a10##_def(10)
-
-#define arg_var1(a1) a1##_var(1)
-#define arg_var2(a1, a2) arg_var1(a1), a2##_var(2)
-#define arg_var3(a1, a2, a3) arg_var2(a1, a2), a3##_var(3)
-#define arg_var4(a1, a2, a3, a4) arg_var3(a1, a2, a3), a4##_var(4)
-#define arg_var5(a1, a2, a3, a4, a5) arg_var4(a1, a2, a3, a4), a5##_var(5)
-#define arg_var6(a1, a2, a3, a4, a5, a6)arg_var5(a1, a2, a3, a4, a5), a6##_var(6)
-#define arg_var7(a1, a2, a3, a4, a5, a6, a7)arg_var6(a1, a2, a3, a4, a5, a6), a7##_var(7)
-#define arg_var8(a1, a2, a3, a4, a5, a6, a7, a8)arg_var7(a1, a2, a3, a4, a5, a6, a7), a8##_var(8)
-#define arg_var9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_var8(a1, a2, a3, a4, a5, a6, a7, a8), a9##_var(9)
-#define arg_var10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_var9(a1, a2, a3, a4, a5, a6, a7, a8, a9), a10##_var(10)
-
-#define arg_ref1(a1) a1##_ref(1)
-#define arg_ref2(a1, a2) arg_ref1(a1), a2##_ref(2)
-#define arg_ref3(a1, a2, a3) arg_ref2(a1, a2), a3##_ref(3)
-#define arg_ref4(a1, a2, a3, a4) arg_ref3(a1, a2, a3), a4##_ref(4)
-#define arg_ref5(a1, a2, a3, a4, a5) arg_ref4(a1, a2, a3, a4), a5##_ref(5)
-#define arg_ref6(a1, a2, a3, a4, a5, a6)arg_ref5(a1, a2, a3, a4, a5), a6##_ref(6)
-#define arg_ref7(a1, a2, a3, a4, a5, a6, a7)arg_ref6(a1, a2, a3, a4, a5, a6), a7##_ref(7)
-#define arg_ref8(a1, a2, a3, a4, a5, a6, a7, a8)arg_ref7(a1, a2, a3, a4, a5, a6, a7), a8##_ref(8)
-#define arg_ref9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_ref8(a1, a2, a3, a4, a5, a6, a7, a8), a9##_ref(9)
-#define arg_ref10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_ref9(a1, a2, a3, a4, a5, a6, a7, a8, a9), a10##_ref(10)
-
-#define arg_str1(a1) a1##_str
-#define arg_str2(a1, a2) arg_str1(a1) a2##_str
-#define arg_str3(a1, a2, a3) arg_str2(a1, a2) a3##_str
-#define arg_str4(a1, a2, a3, a4) arg_str3(a1, a2, a3) a4##_str
-#define arg_str5(a1, a2, a3, a4, a5) arg_str4(a1, a2, a3, a4) a5##_str
-#define arg_str6(a1, a2, a3, a4, a5, a6)arg_str5(a1, a2, a3, a4, a5) a6##_str
-#define arg_str7(a1, a2, a3, a4, a5, a6, a7)arg_str6(a1, a2, a3, a4, a5, a6) a7##_str
-#define arg_str8(a1, a2, a3, a4, a5, a6, a7, a8)arg_str7(a1, a2, a3, a4, a5, a6, a7) a8##_str
-#define arg_str9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_str8(a1, a2, a3, a4, a5, a6, a7, a8) a9##_str
-#define arg_str10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_str9(a1, a2, a3, a4, a5, a6, a7, a8, a9) a10##_str
-
-#define ret_def_void
-#define ret_set_void
-#define ret_ret_void return EXPP_incr_ret(Py_None)
-
-#define ret_def_GLint int ret_int
-#define ret_set_GLint ret_int=
-#define ret_ret_GLint return PyInt_FromLong(ret_int);
-
-#define ret_def_GLuint unsigned int ret_uint
-#define ret_set_GLuint ret_uint=
-#define ret_ret_GLuint return PyInt_FromLong((long) ret_uint);
-
-#define ret_def_GLenum unsigned int ret_uint
-#define ret_set_GLenum ret_uint=
-#define ret_ret_GLenum return PyInt_FromLong((long) ret_uint);
-
-#define ret_def_GLboolean unsigned char ret_bool
-#define ret_set_GLboolean ret_bool=
-#define ret_ret_GLboolean return PyInt_FromLong((long) ret_bool);
-
-#define ret_def_GLstring const unsigned char *ret_str;
-#define ret_set_GLstring ret_str=
-
-#define ret_ret_GLstring \
- if (ret_str) {\
- return PyString_FromString(ret_str);\
- } else {\
- PyErr_SetString(PyExc_AttributeError, "could not get opengl string");\
- return NULL;\
- }
-
-#endif /* EXPP_BGL_H */
diff --git a/source/blender/python/api2_2x/BezTriple.c b/source/blender/python/api2_2x/BezTriple.c
deleted file mode 100644
index 9e57994d2da..00000000000
--- a/source/blender/python/api2_2x/BezTriple.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot RIP 2005,
- * Stephen Swaney, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "BezTriple.h" /*This must come first */
-#include "DNA_ipo_types.h"
-
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-
-
-/***************************************************************************
- Python API function prototypes for the BezTriple module.
-***************************************************************************/
-static PyObject *M_BezTriple_New( PyObject * self, PyObject * args );
-static PyObject *M_BezTriple_Get( PyObject * self, PyObject * args );
-
-/*************************************
- Doc strings for the BezTriple module
-*************************************/
-
-static char M_BezTriple_doc[] = "The Blender BezTriple module\n";
-
-/****************************************************************************
- Python BPy_BezTriple instance methods declarations:
-****************************************************************************/
-static PyObject *BezTriple_oldsetPoints( BPy_BezTriple * self, PyObject * args );
-static int BezTriple_setPoints( BPy_BezTriple * self, PyObject * args );
-static PyObject *BezTriple_getPoints( BPy_BezTriple * self );
-static PyObject *BezTriple_getTriple( BPy_BezTriple * self );
-
-/****************************************************************************
- Python method structure definition for Blender.BezTriple module:
-****************************************************************************/
-
-struct PyMethodDef M_BezTriple_methods[] = {
- {"New", ( PyCFunction ) M_BezTriple_New, METH_VARARGS | METH_KEYWORDS,
- 0},
-/* {"New", ( PyCFunction ) M_BezTriple_New, METH_O, 0}, */
- {"Get", M_BezTriple_Get, METH_VARARGS, 0},
- {"get", M_BezTriple_Get, METH_VARARGS, 0},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_BezTriple methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_BezTriple_methods[] = {
- /* name, method, flags, doc */
- {"setPoints", ( PyCFunction ) BezTriple_oldsetPoints, METH_VARARGS,
- "(str) - Change BezTriple point coordinates"},
- {"getPoints", ( PyCFunction ) BezTriple_getPoints, METH_NOARGS,
- "() - return BezTriple knot point x and y coordinates"},
- {"getTriple", ( PyCFunction ) BezTriple_getTriple, METH_NOARGS,
- "() - return list of 3 floating point triplets. order is H1, knot, H2"},
- {NULL, NULL, 0, NULL}
-};
-
-/****************************************************************************
- Function: M_BezTriple_New
- Python equivalent: Blender.BezTriple.New
-****************************************************************************/
-
-static PyObject *M_BezTriple_New( PyObject* self, PyObject * args )
-{
- float numbuf[9];
- PyObject* in_args = NULL;
- int length;
-
- /* accept list, tuple, or 3 or 9 args (which better be floats) */
-
- length = PyTuple_Size( args );
- if( length == 3 || length == 9 )
- in_args = args;
- else if( !PyArg_ParseTuple( args, "|O", &in_args) )
- goto TypeError;
-
- if( !in_args ) {
- numbuf[0] = 0.0f; numbuf[1] = 0.0f; numbuf[2] = 0.0f;
- numbuf[3] = 0.0f; numbuf[4] = 0.0f; numbuf[5] = 0.0f;
- numbuf[6] = 0.0f; numbuf[7] = 0.0f; numbuf[8] = 0.0f;
- } else {
- int i, length;
- if( !PySequence_Check( in_args ) )
- goto TypeError;
-
- length = PySequence_Length( in_args );
- if( length != 9 && length != 3 )
- goto TypeError;
-
- for( i = 0; i < length; i++ ) {
- PyObject *item, *pyfloat;
- item = PySequence_ITEM( in_args, i);
- if( !item )
- goto TypeError;
- pyfloat = PyNumber_Float( item );
- Py_DECREF( item );
- if( !pyfloat )
- goto TypeError;
- numbuf[i] = ( float )PyFloat_AS_DOUBLE( pyfloat );
- Py_DECREF( pyfloat );
- }
-
- if( length == 3 ) {
- numbuf[3] = numbuf[0]; numbuf[6] = numbuf[0];
- numbuf[4] = numbuf[1]; numbuf[7] = numbuf[1];
- numbuf[5] = numbuf[2]; numbuf[8] = numbuf[2];
- }
- }
-
- return newBezTriple( numbuf );
-
-TypeError:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected sequence of 3 or 9 floats or nothing" );
-}
-
-/****************************************************************************
- Function: M_BezTriple_Get
- Python equivalent: Blender.BezTriple.Get
- Description: Receives a string and returns the ipo data obj
- whose name matches the string. If no argument is
- passed in, a list of all ipo data names in the
- current scene is returned.
-****************************************************************************/
-static PyObject *M_BezTriple_Get( PyObject * self, PyObject * args )
-{
- return 0;
-}
-
-/****************************************************************************
- Function: BezTriple_dealloc
- Description: This is a callback function for the BPy_BezTriple type. It is
- the destructor function.
-****************************************************************************/
-static void BezTriple_dealloc( BPy_BezTriple * self )
-{
- if( self->own_memory)
- MEM_freeN( self->beztriple );
-
- PyObject_DEL( self );
-}
-
-/*
- * BezTriple_getTriple
- *
- * Get the coordinate data for a BezTriple. Returns a list of 3 points.
- * List order is handle1, knot, handle2. each point consists of a list
- * of x,y,z float values.
- */
-
-static PyObject *BezTriple_getTriple( BPy_BezTriple * self )
-{
- BezTriple *bezt = self->beztriple;
- return Py_BuildValue( "[[fff][fff][fff]]",
- bezt->vec[0][0], bezt->vec[0][1], bezt->vec[0][2],
- bezt->vec[1][0], bezt->vec[1][1], bezt->vec[1][2],
- bezt->vec[2][0], bezt->vec[2][1], bezt->vec[2][2] );
-}
-
-/*
- * BezTriple_setTriple
- *
- * Set the cordinate data for a BezTriple. Takes a sequence of 3 points,
- * of the same format at BezTriple_getTriple.
- */
-
-static int BezTriple_setTriple( BPy_BezTriple * self, PyObject * args )
-{
- int i, j;
- struct BezTriple *bezt = self->beztriple;
- float vec[3][3];
-
- if( !PySequence_Check( args ) || PySequence_Size( args ) != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected three sequences of three floats" );
-
- for( i = 0; i < 3; i++ ) {
- PyObject *obj1 = PySequence_ITEM( args, i );
- if( !PySequence_Check( obj1 ) || PySequence_Size( obj1 ) != 3 ) {
- Py_DECREF( obj1 );
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected three sequences of three floats" );
- }
- for( j = 0; j < 3; j++ ) {
- PyObject *obj2 = PySequence_ITEM( obj1, j );
- PyObject *num = PyNumber_Float( obj2 );
- Py_DECREF( obj2 );
-
- if( !num ) {
- Py_DECREF( obj1 );
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected float parameter" );
- }
- vec[i][j] = ( float )PyFloat_AsDouble( num );
- Py_DECREF( num );
- }
- Py_DECREF( obj1 );
- }
-
- for( i = 0; i < 3; i++ )
- for( j = 0; j < 3; j++ )
- bezt->vec[i][j] = vec[i][j];
-
- return 0;
-}
-
-/*
- * BezTriple_getPoint
- *
- * Get the coordinate data for a BezTriple. Returns the control point,
- * as a list of x,y float values.
- */
-
-static PyObject *BezTriple_getPoints( BPy_BezTriple * self )
-{
- BezTriple *bezt = self->beztriple;
- return Py_BuildValue( "[ff]", bezt->vec[1][0], bezt->vec[1][1] );
-}
-
-/*
- * BezTriple_setPoint
- *
- * Set the coordinate data for a BezTriple. Accepts the x,y for the control
- * point and builds handle values based on control point.
- */
-
-static int BezTriple_setPoints( BPy_BezTriple * self, PyObject * args )
-{
- int i;
- struct BezTriple *bezt = self->beztriple;
- float vec[2];
-
- if( !PySequence_Check( args ) || PySequence_Size( args ) != 2 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected sequence of two floats" );
-
- for( i = 0; i < 2; i++ ) {
- PyObject *obj = PySequence_ITEM( args, i );
- PyObject *num = PyNumber_Float( obj );
- Py_DECREF( obj );
-
- if( !num )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected float parameter" );
- vec[i] = ( float )PyFloat_AsDouble( num );
- Py_DECREF( num );
- }
-
- for( i = 0; i < 2; i++ ) {
- bezt->vec[0][i] = vec[i] - 1;
- bezt->vec[1][i] = vec[i];
- bezt->vec[2][i] = vec[i] + 1;
- }
-
- /* experimental fussing with handles - ipo.c: calchandles_ipocurve */
- if( bezt->vec[0][0] > bezt->vec[1][0] )
- bezt->vec[0][0] = bezt->vec[1][0];
-
- if( bezt->vec[2][0] < bezt->vec[1][0] )
- bezt->vec[2][0] = bezt->vec[1][0];
-
- return 0;
-}
-
-static PyObject *BezTriple_getTilt( BPy_BezTriple * self )
-{
- return PyFloat_FromDouble( self->beztriple->alfa );
-}
-
-static int BezTriple_setTilt( BPy_BezTriple * self, PyObject *value )
-{
- PyObject *num = PyNumber_Float( value );
-
- if( !num )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected a float" );
-
- self->beztriple->alfa = (float)PyFloat_AsDouble( num );
- Py_DECREF( num );
- return 0;
-}
-
-static PyObject *BezTriple_getWeight( BPy_BezTriple * self )
-{
- return PyFloat_FromDouble( self->beztriple->weight );
-}
-
-static int BezTriple_setWeight( BPy_BezTriple * self, PyObject *value )
-{
- PyObject *num = PyNumber_Float( value );
-
- if( !num )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected a float" );
-
- self->beztriple->weight = (float)PyFloat_AsDouble( num );
- Py_DECREF( num );
- return 0;
-}
-
-static PyObject *BezTriple_getRadius( BPy_BezTriple * self )
-{
- return PyFloat_FromDouble( self->beztriple->radius );
-}
-
-static int BezTriple_setRadius( BPy_BezTriple * self, PyObject *value )
-{
- PyObject *num = PyNumber_Float( value );
-
- if( !num )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected a float" );
-
- self->beztriple->radius = (float)PyFloat_AsDouble( num );
- Py_DECREF( num );
- return 0;
-}
-
-static PyObject *BezTriple_getHide( BPy_BezTriple * self )
-{
- return PyInt_FromLong( self->beztriple->hide == IPO_BEZ );
-}
-
-static int BezTriple_setHide( BPy_BezTriple * self, PyObject *value )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->beztriple->hide = IPO_BEZ;
- else
- self->beztriple->hide = 0;
- return 0;
-}
-
-static PyObject *BezTriple_getSelects( BPy_BezTriple * self )
-{
- BezTriple *bezt = self->beztriple;
-
- return Py_BuildValue( "[iii]", bezt->f1, bezt->f2, bezt->f3 );
-}
-
-static int BezTriple_setSelects( BPy_BezTriple * self, PyObject *args )
-{
- struct BezTriple *bezt = self->beztriple;
- PyObject *ob1, *ob2, *ob3;
- int param1, param2, param3;
-
- /* only accept a sequence of three booleans */
-
- if( !PySequence_Check( args ) || PySequence_Size( args ) != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected sequence of three integers" );
-
- ob1 = PySequence_ITEM( args, 0 );
- ob2 = PySequence_ITEM( args, 1 );
- ob3 = PySequence_ITEM( args, 2 );
-
- param1 = PyObject_IsTrue( ob1 );
- param2 = PyObject_IsTrue( ob2 );
- param3 = PyObject_IsTrue( ob3 );
-
- if (param1==-1 || param2==-1 || param3==-1)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of 3 items: True/False or 0/1" );
-
- /* assign the selects */
- bezt->f1 = (char)param1;
- bezt->f2 = (char)param2;
- bezt->f3 = (char)param3;
-
- Py_DECREF( ob1 );
- Py_DECREF( ob2 );
- Py_DECREF( ob3 );
- return 0;
-}
-
-static PyObject *BezTriple_getHandles( BPy_BezTriple * self )
-{
- BezTriple *bezt = self->beztriple;
-
- return Py_BuildValue( "[ii]", bezt->h1, bezt->h2 );
-}
-
-static int BezTriple_setHandles( BPy_BezTriple * self, PyObject *args )
-{
- struct BezTriple *bezt = self->beztriple;
- PyObject *ob1, *ob2;
- short h1, h2;
-
- /* only accept a sequence of two ints */
-
- if( !PySequence_Check( args ) || PySequence_Size( args ) != 2 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected sequence of two integers" );
-
- ob1 = PySequence_ITEM( args, 0 );
- ob2 = PySequence_ITEM( args, 1 );
-
- if( !PyInt_Check( ob1 ) || !PyInt_Check( ob2 ) ) {
- Py_DECREF( ob1 );
- Py_DECREF( ob2 );
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected sequence of two integers" );
- }
-
- h1 = ( short ) PyInt_AsLong( ob1 );
- h2 = ( short ) PyInt_AsLong( ob2 );
- Py_DECREF( ob1 );
- Py_DECREF( ob2 );
-
- if( h1 < HD_FREE || h2 < HD_FREE ||
- h1 > HD_AUTO_ANIM || h2 > HD_AUTO_ANIM )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected int in range [0,4]" );
-
- /* assign the handles */
-
- bezt->h1 = h1;
- bezt->h2 = h2;
-
- return 0;
-}
-
-/*
- * Python BezTriple attributes get/set structure
- */
-
-static PyGetSetDef BPy_BezTriple_getseters[] = {
- {"pt",
- (getter)BezTriple_getPoints, (setter)BezTriple_setPoints,
- "point knot values",
- NULL},
- {"vec",
- (getter)BezTriple_getTriple, (setter)BezTriple_setTriple,
- "point handle and knot values",
- NULL},
- {"tilt",
- (getter)BezTriple_getTilt, (setter)BezTriple_setTilt,
- "point tilt",
- NULL},
- {"hide",
- (getter)BezTriple_getHide, (setter)BezTriple_setHide,
- "point hide status",
- NULL},
- {"selects",
- (getter)BezTriple_getSelects, (setter)BezTriple_setSelects,
- "point select statuses",
- NULL},
- {"handleTypes",
- (getter)BezTriple_getHandles, (setter)BezTriple_setHandles,
- "point handle types",
- NULL},
- {"weight",
- (getter)BezTriple_getWeight, (setter)BezTriple_setWeight,
- "point weight",
- NULL},
- {"radius",
- (getter)BezTriple_getRadius, (setter)BezTriple_setRadius,
- "point radius",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Function: BezTriple_repr */
-/* Description: This is a callback function for the BPy_BezTriple type. It */
-/* builds a meaninful string to represent BezTriple objects. */
-/*****************************************************************************/
-static PyObject *BezTriple_repr( BPy_BezTriple * self )
-{
- char str[512];
- sprintf( str,
- "[BezTriple [%.6f, %.6f, %.6f] [%.6f, %.6f, %.6f] [%.6f, %.6f, %.6f]\n",
- self->beztriple->vec[0][0], self->beztriple->vec[0][1], self->beztriple->vec[0][2],
- self->beztriple->vec[1][0], self->beztriple->vec[1][1], self->beztriple->vec[1][2],
- self->beztriple->vec[2][0], self->beztriple->vec[2][1], self->beztriple->vec[2][2]);
- return PyString_FromString( str );
-}
-
-/************************************************************************
- *
- * Python BezTriple_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject BezTriple_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "BezTriple", /* char *tp_name; */
- sizeof( BPy_BezTriple ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) BezTriple_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) BezTriple_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_BezTriple_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_BezTriple_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *M_BezTriple_HandleDict( void )
-{
- PyObject *HM = PyConstant_New( );
-
- if( HM ) {
- BPy_constant *d = ( BPy_constant * ) HM;
-
- PyConstant_Insert( d, "FREE", PyInt_FromLong( HD_FREE ) );
- PyConstant_Insert( d, "AUTO", PyInt_FromLong( HD_AUTO ) );
- PyConstant_Insert( d, "VECT", PyInt_FromLong( HD_VECT ) );
- PyConstant_Insert( d, "ALIGN", PyInt_FromLong( HD_ALIGN ) );
- PyConstant_Insert( d, "AUTOANIM", PyInt_FromLong( HD_AUTO_ANIM ) );
- }
- return HM;
-}
-
-/*
- BezTriple_Init
-*/
-
-PyObject *BezTriple_Init( void )
-{
- PyObject *submodule;
- PyObject *HandleTypes = M_BezTriple_HandleDict( );
-
- if( PyType_Ready( &BezTriple_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.BezTriple",
- M_BezTriple_methods,
- M_BezTriple_doc );
- if( HandleTypes )
- PyModule_AddObject( submodule, "HandleTypes", HandleTypes );
-
-
- return submodule;
-}
-
-/* Three Python BezTriple_Type helper functions needed by the Object module: */
-
-/****************************************************************************
- Function: BezTriple_CreatePyObject
- Description: This function will create a new BPy_BezTriple from an existing
- Blender ipo structure.
-****************************************************************************/
-PyObject *BezTriple_CreatePyObject( BezTriple * bzt )
-{
- BPy_BezTriple *pybeztriple;
-
- pybeztriple =
- ( BPy_BezTriple * ) PyObject_NEW( BPy_BezTriple, &BezTriple_Type );
-
- if( !pybeztriple )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_BezTriple object" );
-
- pybeztriple->beztriple = bzt;
- pybeztriple->own_memory = 0;
-
- return ( PyObject * ) pybeztriple;
-}
-
-
-/*****************************************************************************/
-/* Function: BezTriple_FromPyObject */
-/* Description: This function returns the Blender beztriple from the given */
-/* PyObject. */
-/*****************************************************************************/
-BezTriple *BezTriple_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_BezTriple * ) pyobj )->beztriple;
-}
-
-
-/*
- Create a new BezTriple
- input args is a sequence - either 3 or 9 floats
-*/
-
-PyObject *newBezTriple( float *numbuf )
-{
- int i, j, num;
- PyObject *pyobj = NULL;
- BezTriple *bzt = NULL;
-
- /* create our own beztriple data */
- bzt = MEM_callocN( sizeof( BezTriple ), "new bpytriple");
-
- /* check malloc */
- if( !bzt )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MEM_callocN failed");
-
- /* copy the data */
- num = 0;
- for( i = 0; i < 3; i++ ) {
- for( j = 0; j < 3; j++) {
- bzt->vec[i][j] = numbuf[num++];
- }
- }
- bzt->h1 = HD_ALIGN;
- bzt->h2 = HD_ALIGN;
- bzt->radius = 1.0;
-
- /* wrap it */
- pyobj = BezTriple_CreatePyObject( bzt );
-
- /* we own it. must free later */
- ( ( BPy_BezTriple * )pyobj)->own_memory = 1;
-
- return pyobj;
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *BezTriple_oldsetPoints( BPy_BezTriple * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)BezTriple_setPoints );
-}
diff --git a/source/blender/python/api2_2x/BezTriple.h b/source/blender/python/api2_2x/BezTriple.h
deleted file mode 100644
index 3bf27d6e1b2..00000000000
--- a/source/blender/python/api2_2x/BezTriple.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BEZTRIPLE_H
-#define EXPP_BEZTRIPLE_H
-
-#include <Python.h>
-#include "DNA_curve_types.h"
-
-extern PyTypeObject BezTriple_Type;
-
-/* type check macro */
-#define BPy_BezTriple_Check(o) \
- ( (o)->ob_type == &BezTriple_Type)
-
-/****************************************************************************
- Python BPy_BezTriple structure definition:
-****************************************************************************/
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- BezTriple * beztriple;
- int own_memory; /* true == we own this memory and must delete. */
-} BPy_BezTriple;
-
-/*
- * prototypes
- */
-
-PyObject *BezTriple_CreatePyObject( BezTriple * bzt );
-BezTriple *BezTriple_FromPyObject( PyObject * pyobj );
-PyObject *newBezTriple( float *args );
-PyObject *BezTriple_Init( void );
-
-#endif /* EXPP_BEZTRIPLE_H */
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c
deleted file mode 100644
index 47e7bcb2007..00000000000
--- a/source/blender/python/api2_2x/Blender.c
+++ /dev/null
@@ -1,1112 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Joseph Gilbert,
- * Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-struct ID; /*keep me up here */
-
-#include "Blender.h" /*This must come first */
-
-/* for open, close in Blender_Load */
-#include <fcntl.h>
-#include "BDR_editobject.h" /* exit_editmode() */
-#include "GPU_draw.h" /* GPU_set_mipmap() */
-#include "BIF_usiblender.h"
-#include "BLI_blenlib.h"
-#include "BLI_bpath.h"
-#include "BLO_writefile.h"
-#include "BKE_blender.h"
-#include "BKE_exotic.h"
-#include "BKE_global.h"
-#include "BKE_packedFile.h"
-#include "BKE_utildefines.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_text.h"
-#include "BKE_ipo.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BIF_space.h"
-#include "DNA_space_types.h" /* script struct */
-#include "BSE_headerbuttons.h"
-#include "DNA_screen_types.h" /* for SPACE_VIEW3D */
-#include "DNA_userdef_types.h"
-#include "DNA_packedFile_types.h"
-#include "EXPP_interface.h" /* for bpy_gethome() */
-#include "gen_utils.h"
-#include "modules.h"
-#include "constant.h"
-#include "../BPY_extern.h" /* BPY_txt_do_python_Text */
-#include "../BPY_menus.h" /* to update menus */
-#include "Armature.h"
-#include "BezTriple.h"
-#include "Camera.h"
-#include "Constraint.h"
-#include "Curve.h"
-#include "CurNurb.h"
-#include "Draw.h"
-#include "Effect.h"
-#include "Ipo.h"
-#include "Ipocurve.h"
-#include "IDProp.h"
-#include "Key.h"
-#include "Lamp.h"
-#include "Lattice.h"
-#include "Library.h"
-#include "Mathutils.h"
-#include "Geometry.h"
-#include "Mesh.h"
-#include "Metaball.h"
-#include "Modifier.h"
-#include "NMesh.h"
-#include "Node.h"
-#include "Object.h"
-#include "Group.h"
-#include "Registry.h"
-#include "Scene.h"
-#include "Sound.h"
-#include "SurfNurb.h"
-#include "Sys.h"
-#include "Text.h"
-#include "Texture.h"
-#include "Window.h"
-#include "World.h"
-#include "Types.h"
-#include "Particle.h"
-
-/**********************************************************/
-/* Python API function prototypes for the Blender module. */
-/**********************************************************/
-static PyObject *Blender_Set( PyObject * self, PyObject * args );
-static PyObject *Blender_Get( PyObject * self, PyObject * value );
-static PyObject *Blender_Redraw( PyObject * self, PyObject * args );
-static PyObject *Blender_Quit( PyObject * self );
-static PyObject *Blender_Load( PyObject * self, PyObject * args );
-static PyObject *Blender_Save( PyObject * self, PyObject * args );
-static PyObject *Blender_Run( PyObject * self, PyObject * value );
-static PyObject *Blender_ShowHelp( PyObject * self, PyObject * script );
-static PyObject *Blender_UpdateMenus( PyObject * self);
-static PyObject *Blender_PackAll( PyObject * self);
-static PyObject *Blender_UnpackAll( PyObject * self, PyObject * value);
-static PyObject *Blender_CountPackedFiles( PyObject * self );
-static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *keywds );
-static PyObject *Blender_SaveUndoState( PyObject * self, PyObject *args );
-extern PyObject *Text3d_Init( void ); /* missing in some include */
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.__doc__ */
-/*****************************************************************************/
-static char Blender_Set_doc[] =
- "(request, data) - Update settings in Blender\n\
-\n\
-(request) A string identifying the setting to change\n\
- 'curframe' - Sets the current frame using the number in data";
-
-static char Blender_Get_doc[] = "(request) - Retrieve settings from Blender\n\
-\n\
-(request) A string indentifying the data to be returned\n\
- 'curframe' - Returns the current animation frame\n\
- 'curtime' - Returns the current animation time\n\
- 'staframe' - Returns the start frame of the animation\n\
- 'endframe' - Returns the end frame of the animation\n\
- 'filename' - Returns the name of the last file read or written\n\
- 'homedir' - Returns Blender's home dir\n\
- 'datadir' - Returns the dir where scripts can save their data, if available\n\
- 'scriptsdir' - Returns the main dir where scripts are kept, if available\n\
- 'uscriptsdir' - Returns the user defined dir for scripts, if available\n\
- 'version' - Returns the Blender version number";
-
-static char Blender_Redraw_doc[] = "() - Redraw all 3D windows";
-
-static char Blender_Quit_doc[] =
- "() - Quit Blender. The current data is saved as 'quit.blend' before leaving.";
-
-static char Blender_Load_doc[] = "(filename) - Load the given file.\n\
-Supported formats:\n\
-Blender, DXF, Inventor 1.0 ASCII, VRML 1.0 asc, STL, Videoscape, radiogour.\n\
-\n\
-Notes:\n\
-1 - () - an empty argument loads the default .B.blend file;\n\
-2 - if the substring '.B.blend' occurs inside 'filename', the default\n\
-.B.blend file is loaded;\n\
-3 - If a Blender file is loaded the script ends immediately.\n\
-4 - The current data is always preserved as an autosave file, for safety;\n\
-5 - This function only works if the script where it's executed is the\n\
-only one running at the moment.";
-
-static char Blender_Save_doc[] =
- "(filename) - Save data to a file based on the filename's extension.\n\
-Supported are: Blender's .blend and the builtin exporters:\n\
-VRML 1.0 (.wrl), Videoscape (.obj), DXF (.dxf) and STL (.stl)\n\
-(filename) - A filename with one of the supported extensions.\n\
-Note 1: 'filename' should not contain the substring \".B.blend\" in it.\n\
-Note 2: only .blend raises an error if file wasn't saved.\n\
-\tYou can use Blender.sys.exists(filename) to make sure the file was saved\n\
-\twhen writing to one of the other formats.";
-
-static char Blender_Run_doc[] =
- "(script) - Run the given Python script.\n\
-(script) - the path to a file or the name of an available Blender Text.";
-
-static char Blender_ShowHelp_doc[] =
-"(script) - Show help for the given Python script.\n\
- This will try to open the 'Scripts Help Browser' script, so to have\n\
-any help displayed the passed 'script' must be properly documented\n\
-with the expected strings (check API ref docs or any bundled script\n\
-for examples).\n\n\
-(script) - the filename of a script in the default or user defined\n\
- scripts dir (no need to supply the full path name).";
-
-static char Blender_UpdateMenus_doc[] =
- "() - Update the menus where scripts are registered. Only needed for\n\
-scripts that save other new scripts in the default or user defined folders.";
-
-static char Blender_PackAll_doc[] =
-"() - Pack all files.\n\
-All files will packed into the blend file.";
-static char Blender_UnpackAll_doc[] =
-"(mode) - Unpack files.\n\
-All files will be unpacked using specified mode.\n\n\
-(mode) - the unpack mode.";
-
-static char Blender_CountPackedFiles_doc[] =
-"() - Returns the number of packed files.";
-
-static char Blender_GetPaths_doc[] =
-"() - Returns a list of paths used in this blend file.";
-
-static char Blender_SaveUndoState_doc[] =
-"(s) - Push an undo with blenders current state.";
-
-/*****************************************************************************/
-/* Python method structure definition. */
-/*****************************************************************************/
-static struct PyMethodDef Blender_methods[] = {
- {"Set", Blender_Set, METH_VARARGS, Blender_Set_doc},
- {"Get", Blender_Get, METH_O, Blender_Get_doc},
- {"Redraw", Blender_Redraw, METH_VARARGS, Blender_Redraw_doc},
- {"Quit", ( PyCFunction ) Blender_Quit, METH_NOARGS, Blender_Quit_doc},
- {"Load", Blender_Load, METH_VARARGS, Blender_Load_doc},
- {"Save", Blender_Save, METH_VARARGS, Blender_Save_doc},
- {"Run", Blender_Run, METH_O, Blender_Run_doc},
- {"ShowHelp", Blender_ShowHelp, METH_O, Blender_ShowHelp_doc},
- {"CountPackedFiles", ( PyCFunction ) Blender_CountPackedFiles, METH_NOARGS, Blender_CountPackedFiles_doc},
- {"GetPaths", ( PyCFunction ) Blender_GetPaths, METH_VARARGS|METH_KEYWORDS, Blender_GetPaths_doc},
- {"PackAll", ( PyCFunction ) Blender_PackAll, METH_NOARGS, Blender_PackAll_doc},
- {"UnpackAll", Blender_UnpackAll, METH_O, Blender_UnpackAll_doc},
- {"UpdateMenus", ( PyCFunction ) Blender_UpdateMenus, METH_NOARGS, Blender_UpdateMenus_doc},
- {"SaveUndoState", Blender_SaveUndoState, METH_VARARGS, Blender_SaveUndoState_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Global variables */
-/*****************************************************************************/
-PyObject *g_blenderdict;
-
-/*****************************************************************************/
-/* Function: Blender_Set */
-/* Python equivalent: Blender.Set */
-/*****************************************************************************/
-static PyObject *Blender_Set( PyObject * self, PyObject * args )
-{
- char *name, *dir = NULL;
- PyObject *arg;
-
- if( !PyArg_ParseTuple( args, "sO", &name, &arg ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected 2 args, where the first is always a string" );
-
- if( StringEqual( name, "curframe" ) ) {
- if( !PyInt_Check( arg ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected an integer" );
-
- G.scene->r.cfra = (int)PyInt_AsLong( arg ) ;
- CLAMP(G.scene->r.cfra, 1, MAXFRAME);
-
- /* update all objects, so python scripts can export all objects
- in a scene without worrying about the view layers */
- scene_update_for_newframe(G.scene, (1<<20) - 1);
-
- } else if (StringEqual( name , "uscriptsdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.pythondir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "yfexportdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.yfexportdir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "fontsdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.fontdir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "texturesdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.textudir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "texpluginsdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.plugtexdir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "seqpluginsdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.plugseqdir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "renderdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.renderdir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "soundsdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.sounddir, dir, FILE_MAXDIR);
- } else if (StringEqual( name , "tempdir" ) ) {
- if ( !PyArg_Parse( arg , "s" , &dir ))
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
- BLI_strncpy(U.tempdir, dir, FILE_MAXDIR);
- BLI_where_is_temp( btempdir, 1 );
- } else if (StringEqual( name , "compressfile" ) ) {
- int value = PyObject_IsTrue( arg );
-
- if (value==-1)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected an integer" );
-
- if (value)
- U.flag |= USER_FILECOMPRESS;
- else
- U.flag &= ~USER_FILECOMPRESS;
- } else if (StringEqual( name , "mipmap" ) ) {
- int value = PyObject_IsTrue( arg );
-
- if (value==-1)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected an integer" );
-
- if (value)
- U.gameflags &= ~USER_DISABLE_MIPMAP;
- else
- U.gameflags |= USER_DISABLE_MIPMAP;
-
- GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
- } else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value given is not a blender setting" ) );
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Blender_Get */
-/* Python equivalent: Blender.Get */
-/*****************************************************************************/
-static PyObject *Blender_Get( PyObject * self, PyObject * value )
-{
- PyObject *ret = NULL;
- char *str = PyString_AsString(value);
-
- if( !str )
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected string argument");
-
- if( StringEqual( str, "curframe" ) )
- ret = PyInt_FromLong( G.scene->r.cfra );
- else if( StringEqual( str, "curtime" ) )
- ret = PyFloat_FromDouble( frame_to_float( G.scene->r.cfra ) );
- else if( StringEqual( str, "rt" ) )
- ret = PyInt_FromLong( (long)frame_to_float( G.rt ) );
- else if( StringEqual( str, "staframe" ) )
- ret = PyInt_FromLong( G.scene->r.sfra );
- else if( StringEqual( str, "endframe" ) )
- ret = PyInt_FromLong( G.scene->r.efra );
- else if( StringEqual( str, "filename" ) ) {
- if (!G.relbase_valid)
- ret = PyString_FromString("");
- else
- ret = PyString_FromString(G.sce);
- }
- else if( StringEqual( str, "homedir" ) ) {
- char *hdir = bpy_gethome(0);
- if( hdir && BLI_exists( hdir ))
- ret = PyString_FromString( hdir );
- else
- ret = EXPP_incr_ret( Py_None );
- }
- else if( StringEqual( str, "datadir" ) ) {
- char datadir[FILE_MAXDIR];
- char *sdir = bpy_gethome(1);
-
- if (sdir) {
- BLI_make_file_string( "/", datadir, sdir, "bpydata" );
- if( BLI_exists( datadir ) )
- ret = PyString_FromString( datadir );
- }
- if (!ret) ret = EXPP_incr_ret( Py_None );
- }
- else if(StringEqual(str, "udatadir")) {
- if (U.pythondir[0] != '\0') {
- char upydir[FILE_MAX];
-
- BLI_strncpy(upydir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upydir, G.sce);
-
- if (BLI_exists(upydir)) {
- char udatadir[FILE_MAXDIR];
-
- BLI_make_file_string("/", udatadir, upydir, "bpydata");
-
- if (BLI_exists(udatadir))
- ret = PyString_FromString(udatadir);
- }
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- else if( StringEqual( str, "scriptsdir" ) ) {
- char *sdir = bpy_gethome(1);
-
- if (sdir)
- ret = PyString_FromString(sdir);
- else
- ret = EXPP_incr_ret( Py_None );
- }
- else if( StringEqual( str, "uscriptsdir" ) ) {
- if (U.pythondir[0] != '\0') {
- char upydir[FILE_MAX];
-
- BLI_strncpy(upydir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upydir, G.sce);
-
- if( BLI_exists( upydir ) )
- ret = PyString_FromString( upydir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* USER PREFS: */
- else if( StringEqual( str, "yfexportdir" ) ) {
- if (U.yfexportdir[0] != '\0') {
- char yfexportdir[FILE_MAX];
-
- BLI_strncpy(yfexportdir, U.yfexportdir, FILE_MAX);
- BLI_convertstringcode(yfexportdir, G.sce);
-
- if( BLI_exists( yfexportdir ) )
- ret = PyString_FromString( yfexportdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* fontsdir */
- else if( StringEqual( str, "fontsdir" ) ) {
- if (U.fontdir[0] != '\0') {
- char fontdir[FILE_MAX];
-
- BLI_strncpy(fontdir, U.fontdir, FILE_MAX);
- BLI_convertstringcode(fontdir, G.sce);
-
- if( BLI_exists( fontdir ) )
- ret = PyString_FromString( fontdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* texturesdir */
- else if( StringEqual( str, "texturesdir" ) ) {
- if (U.textudir[0] != '\0') {
- char textudir[FILE_MAX];
-
- BLI_strncpy(textudir, U.textudir, FILE_MAX);
- BLI_convertstringcode(textudir, G.sce);
-
- if( BLI_exists( textudir ) )
- ret = PyString_FromString( textudir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* texpluginsdir */
- else if( StringEqual( str, "texpluginsdir" ) ) {
- if (U.plugtexdir[0] != '\0') {
- char plugtexdir[FILE_MAX];
-
- BLI_strncpy(plugtexdir, U.plugtexdir, FILE_MAX);
- BLI_convertstringcode(plugtexdir, G.sce);
-
- if( BLI_exists( plugtexdir ) )
- ret = PyString_FromString( plugtexdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* seqpluginsdir */
- else if( StringEqual( str, "seqpluginsdir" ) ) {
- if (U.plugseqdir[0] != '\0') {
- char plugseqdir[FILE_MAX];
-
- BLI_strncpy(plugseqdir, U.plugseqdir, FILE_MAX);
- BLI_convertstringcode(plugseqdir, G.sce);
-
- if( BLI_exists( plugseqdir ) )
- ret = PyString_FromString( plugseqdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* renderdir */
- else if( StringEqual( str, "renderdir" ) ) {
- if (U.renderdir[0] != '\0') {
- char renderdir[FILE_MAX];
-
- BLI_strncpy(renderdir, U.renderdir, FILE_MAX);
- BLI_convertstringcode(renderdir, G.sce);
-
- if( BLI_exists( renderdir ) )
- ret = PyString_FromString( renderdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* soundsdir */
- else if( StringEqual( str, "soundsdir" ) ) {
- if (U.sounddir[0] != '\0') {
- char sounddir[FILE_MAX];
-
- BLI_strncpy(sounddir, U.sounddir, FILE_MAX);
- BLI_convertstringcode(sounddir, G.sce);
-
- if( BLI_exists( sounddir ) )
- ret = PyString_FromString( sounddir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* tempdir */
- else if( StringEqual( str, "tempdir" ) ) {
- if (U.tempdir[0] != '\0') {
- char tempdir[FILE_MAX];
-
- BLI_strncpy(tempdir, U.tempdir, FILE_MAX);
- BLI_convertstringcode(tempdir, G.sce);
-
- if( BLI_exists( tempdir ) )
- ret = PyString_FromString( tempdir );
- }
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* icondir */
- else if( StringEqual( str, "icondir" ) ) {
-
- char icondirstr[FILE_MAXDIR];
-
- #ifdef WIN32
- BLI_make_file_string("/", icondirstr, BLI_gethome(), "icons");
- #else
- BLI_make_file_string("/", icondirstr, BLI_gethome(), ".blender/icons");
- #endif
-
- if( BLI_exists( icondirstr ) )
- ret = PyString_FromString( icondirstr );
-
- if (!ret) ret = EXPP_incr_ret(Py_None);
- }
- /* According to the old file (opy_blender.c), the following if
- statement is a quick hack and needs some clean up. */
- else if( StringEqual( str, "vrmloptions" ) ) {
- ret = PyDict_New( );
-
- EXPP_dict_set_item_str( ret, "twoside",
- PyInt_FromLong( U.vrmlflag & USER_VRML_TWOSIDED ) );
-
- EXPP_dict_set_item_str( ret, "layers",
- PyInt_FromLong( U.vrmlflag & USER_VRML_LAYERS ) );
-
- EXPP_dict_set_item_str( ret, "autoscale",
- PyInt_FromLong( U.vrmlflag & USER_VRML_AUTOSCALE ) );
-
- } /* End 'quick hack' part. */
- else if(StringEqual( str, "version" ))
- ret = PyInt_FromLong( G.version );
- else if(StringEqual( str, "buildinfo" )) {
-#ifdef NAN_BUILDINFO
- char buffer[1024];
- extern char * build_date;
- extern char * build_time;
- extern char * build_rev;
- extern char * build_platform;
- extern char * build_type;
-
- sprintf(buffer, "Built on %s %s, Rev-%s Version %s %s", build_date, build_time, build_rev, build_platform, build_type);
- ret = PyString_FromString( buffer );
-#else
- ret = PyString_FromString( "No Build Info" );
-#endif
- }
- else if(StringEqual( str, "compressfile" ))
- ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15 );
- else if(StringEqual( str, "mipmap" ))
- ret = PyInt_FromLong( (U.gameflags & USER_DISABLE_MIPMAP)!=0 );
- else if(StringEqual( str, "add_view_align" ))
- ret = PyInt_FromLong( ((U.flag & USER_ADD_VIEWALIGNED)!=0) );
- else if(StringEqual( str, "add_editmode" ))
- ret = PyInt_FromLong( ((U.flag & USER_ADD_EDITMODE)!=0) );
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown attribute" );
-
- if (ret) return ret;
- else
- return EXPP_ReturnPyObjError (PyExc_MemoryError,
- "could not create the PyObject!");
-}
-
-/*****************************************************************************/
-/* Function: Blender_Redraw */
-/* Python equivalent: Blender.Redraw */
-/*****************************************************************************/
-static PyObject *Blender_Redraw( PyObject * self, PyObject * args )
-{
- return M_Window_Redraw( self, args );
-}
-
-/*****************************************************************************/
-/* Function: Blender_Quit */
-/* Python equivalent: Blender.Quit */
-/*****************************************************************************/
-static PyObject *Blender_Quit( PyObject * self )
-{
- BIF_write_autosave( ); /* save the current data first */
-
- exit_usiblender( ); /* renames last autosave to quit.blend */
-
- Py_RETURN_NONE;
-}
-
-/**
- * Blender.Load
- * loads Blender's .blend, DXF, radiogour(?), STL, Videoscape,
- * Inventor 1.0 ASCII, VRML 1.0 asc.
- */
-static PyObject *Blender_Load( PyObject * self, PyObject * args )
-{
- char *fname = NULL;
- int keep_oldfname = 0;
- Script *script = NULL;
- char str[32], name[FILE_MAXDIR];
- int file, is_blend_file = 0;
-
- if( !PyArg_ParseTuple( args, "|si", &fname, &keep_oldfname ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected filename and optional int or nothing as arguments" );
-
- if( fname ) {
- if( strlen( fname ) > FILE_MAXDIR ) /* G.main->name's max length */
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "filename too long!" );
- else if( !BLI_exists( fname ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "requested file doesn't exist!" );
-
- if( keep_oldfname )
- BLI_strncpy( name, G.sce, FILE_MAXDIR );
- }
-
- /* We won't let a new .blend file be loaded if there are still other
- * scripts running, since loading a new file will close and remove them. */
-
- if( G.main->script.first != G.main->script.last )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "there are other scripts running at the Scripts win, close them first!" );
-
- if( fname ) {
- file = open( fname, O_BINARY | O_RDONLY );
-
- if( file <= 0 ) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot open file!" );
- } else {
- read( file, str, 31 );
- close( file );
-
- if( strncmp( str, "BLEN", 4 ) == 0 )
- is_blend_file = 1;
- }
- } else
- is_blend_file = 1; /* no arg given means default: .B.blend */
-
- if( is_blend_file ) {
-
- int during_slink = during_scriptlink( );
-
- /* when loading a .blend file from a scriptlink, the scriptlink pointer
- * in BPY_do_pyscript becomes invalid during a loop. Inform it here.
- * Also do not allow a nested scriptlink (called from inside another)
- * to load .blend files, to avoid nasty problems. */
- if( during_slink >= 1 ) {
- if( during_slink == 1 )
- disable_where_scriptlink( -1 );
- else {
- return EXPP_ReturnPyObjError
- ( PyExc_EnvironmentError,
- "Blender.Load: cannot load .blend files from a nested scriptlink." );
- }
- }
-
- /* trick: mark the script so that its script struct won't be freed after
- * the script is executed (to avoid a double free warning on exit): */
- script = G.main->script.first;
- if( script )
- script->flags |= SCRIPT_GUI;
-
- BIF_write_autosave( ); /* for safety let's preserve the current data */
- }
-
- if( G.obedit )
- exit_editmode(EM_FREEDATA);
-
- if (G.background) { /* background mode */
- if (is_blend_file)
- BKE_read_file(fname, NULL);
- else {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "only .blend files can be loaded from command line,\n\
- other file types require interactive mode.");
- }
- }
- else { /* interactive mode */
- /* for safety, any filename with .B.blend is considered the default one.
- * It doesn't seem necessary to compare file attributes (like st_ino and
- * st_dev, according to the glibc info pages) to find out if the given
- * filename, that may have been given with a twisted misgiving path, is the
- * default one for sure. Taking any .B.blend file as the default is good
- * enough here. Note: the default file requires extra clean-up done by
- * BIF_read_homefile: freeing the user theme data. */
- if( !fname || ( strstr( fname, ".B.blend" ) && is_blend_file ) )
- BIF_read_homefile(0);
- else
- BIF_read_file( fname );
-
- if( fname && keep_oldfname ) {
- /*BLI_strncpy(G.main->name, name, FILE_MAXDIR); */
- BLI_strncpy( G.sce, name, FILE_MAXDIR );
- }
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Blender_Save( PyObject * self, PyObject * args )
-{
- char *fname = NULL;
- int overwrite = 0, len = 0;
- char *error = NULL;
- Library *li;
-
- if( !PyArg_ParseTuple( args, "s|i", &fname, &overwrite ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected filename and optional int (overwrite flag) as arguments" );
-
- for( li = G.main->library.first; li; li = li->id.next ) {
- if( li->parent==NULL && BLI_streq( li->name, fname ) ) {
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "cannot overwrite used library" );
- }
- }
-
- /* for safety, any filename with .B.blend is considered the default one
- * and not accepted here. */
- if( strstr( fname, ".B.blend" ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "filename can't contain the substring \".B.blend\" in it." );
-
- len = strlen( fname );
-
- if( len > FILE_MAXDIR + FILE_MAXFILE )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "filename is too long!" );
- else if( BLI_exists( fname ) && !overwrite )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "file already exists and overwrite flag was not given." );
-
- disable_where_script( 1 ); /* to avoid error popups in the write_* functions */
-
- if( BLI_testextensie( fname, ".blend" ) ) {
- int writeflags;
- if( G.fileflags & G_AUTOPACK )
- packAll( );
-
- writeflags= G.fileflags & ~G_FILE_COMPRESS;
- if(U.flag & USER_FILECOMPRESS)
- writeflags |= G_FILE_COMPRESS;
-
- if( !BLO_write_file( fname, writeflags, &error ) ) {
- disable_where_script( 0 );
- return EXPP_ReturnPyObjError( PyExc_SystemError,
- error );
- }
- } else if( BLI_testextensie( fname, ".dxf" ) )
- write_dxf( fname );
- else if( BLI_testextensie( fname, ".stl" ) )
- write_stl( fname );
- else if( BLI_testextensie( fname, ".wrl" ) )
- write_vrml( fname );
- else if( BLI_testextensie( fname, ".obj" ) )
- write_videoscape( fname );
- else {
- disable_where_script( 0 );
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown file extension." );
- }
-
- disable_where_script( 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Blender_ShowHelp(PyObject *self, PyObject *script)
-{
- char hspath[FILE_MAXDIR + FILE_MAXFILE]; /* path to help_browser.py */
- char *sdir = bpy_gethome(1);
- PyObject *rkeyd = NULL, *arglist = NULL;
-
- if (!PyString_Check(script))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected a script filename as argument");
-
- /* first we try to find the help_browser script */
-
- if (sdir) BLI_make_file_string("/", hspath, sdir, "help_browser.py");
-
- if (!sdir || (!BLI_exists(hspath) && (U.pythondir[0] != '\0'))) {
- char upydir[FILE_MAX];
-
- BLI_strncpy(upydir, U.pythondir, FILE_MAX);
- BLI_convertstringcode(upydir, G.sce);
- BLI_make_file_string("/", hspath, upydir, "help_browser.py");
-
- if (!BLI_exists(hspath))
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't find script help_browser.py");
- }
-
- /* now we store the passed script in the registry dict and call the
- * help_browser to show help info for it */
- rkeyd = PyDict_New();
- if (!rkeyd)
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "can't create py dictionary!");
-
- /* note: don't use EXPP_dict_set_item_str for 'script', which is an
- * argument to the function we're in and so shouldn't be decref'ed: */
- PyDict_SetItemString(rkeyd, "script", script);
-
- EXPP_dict_set_item_str(bpy_registryDict, "__help_browser", rkeyd);
-
- arglist = Py_BuildValue("s", hspath);
- Blender_Run(self, arglist);
- Py_DECREF(arglist);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Blender_Run(PyObject *self, PyObject *value)
-{
- char *fname = PyString_AsString(value);
- Text *text = NULL;
- int is_blender_text = 0;
- Script *script = NULL;
-
- if (!fname)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected a filename or a Blender Text name as argument");
-
- if (!BLI_exists(fname)) { /* if there's no such filename ... */
- text = G.main->text.first; /* try an already existing Blender Text */
-
- while (text) {
- if (!strcmp(fname, text->id.name + 2)) break;
- text = text->id.next;
- }
-
- if (!text) {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "no such file or Blender text");
- }
- else is_blender_text = 1; /* fn is already a Blender Text */
- }
-
- else {
- text = add_text(fname);
-
- if (!text) {
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "couldn't create Blender Text from given file");
- }
- }
-
- /* (this is messy, check Draw.c's Method_Register and Window.c's file
- * selector for more info)
- * - caller script is the one that called this Blender_Run function;
- * - called script is the argument to this function: fname;
- * To mark scripts whose global dicts can't be freed right after
- * the script execution (or better, 'first pass', since these scripts
- * leave callbacks for gui or file/image selectors) we flag them. But to
- * get a pointer to them we need to check which one is currently
- * running (if none we're already at a spacescript). To make sure only
- * the called script will have the SCRIPT_RUNNING flag on, we unset it
- * for the caller script here: */
- script = G.main->script.first;
- while (script) {
- if (script->flags & SCRIPT_RUNNING) break;
- script = script->id.next;
- }
-
- if (script) script->flags &= ~SCRIPT_RUNNING; /* unset */
-
- BPY_txt_do_python_Text(text); /* call new script */
-
- if (script) script->flags |= SCRIPT_RUNNING; /* set */
-
- if (!is_blender_text) {
-
- /* nice to remember the original filename, so the script can run on reload */
- if (script) {
- strncpy(script->scriptname, fname, sizeof(script->scriptname));
- script->scriptarg[0] = '\0';
- }
- free_libblock(&G.main->text, text);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject * Blender_UpdateMenus( PyObject * self )
-{
-
- BPyMenu_RemoveAllEntries();
-
- if (BPyMenu_Init(1) == -1)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "invalid scripts dir");
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Blender_PackAll */
-/* Python equivalent: Blender.PackAll */
-/*****************************************************************************/
-static PyObject *Blender_PackAll( PyObject * self)
-{
- packAll();
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Blender_UnpackAll */
-/* Python equivalent: Blender.UnpackAll */
-/*****************************************************************************/
-static PyObject *Blender_UnpackAll( PyObject * self, PyObject *value)
-{
- int mode = PyInt_AsLong(value);
-
- if (mode==-1)
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected an int Blender.UnpackModes");
- unpackAll(mode);
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Blender_CountPackedFiles */
-/* Python equivalent: Blender.CountPackedFiles */
-/*****************************************************************************/
-static PyObject *Blender_CountPackedFiles( PyObject * self )
-{
- int nfiles = countPackedFiles();
- return PyInt_FromLong( nfiles );
-}
-
-/*****************************************************************************/
-/* Function: Blender_GetPaths */
-/* Python equivalent: Blender.GetPaths */
-/*****************************************************************************/
-static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *keywds )
-{
- struct BPathIterator bpi;
- PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */
- /* be sure there is low chance of the path being too short */
- char filepath_expanded[FILE_MAXDIR*2];
- char *lib;
-
- int absolute = 0;
- static char *kwlist[] = {"absolute", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "|i", kwlist, &absolute ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected nothing or one bool (0 or 1) as argument" );
-
- BLI_bpathIterator_init(&bpi);
-
- while (!BLI_bpathIterator_isDone(&bpi)) {
-
- /* build the list */
- if (absolute) {
- BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
- } else {
- lib = BLI_bpathIterator_getLib( &bpi );
- if ( lib && ( strcmp(lib, G.sce) ) ) { /* relative path to the library is NOT the same as our blendfile path, return an absolute path */
- BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
- } else {
- BLI_bpathIterator_getPath( &bpi, filepath_expanded );
- }
- }
- st = PyString_FromString(filepath_expanded);
-
- PyList_Append(list, st);
- Py_DECREF(st);
-
- BLI_bpathIterator_step(&bpi);
- }
- BLI_bpathIterator_free(&bpi);
- return list;
-}
-
-static PyObject *Blender_SaveUndoState( PyObject * self, PyObject *args )
-{
- char *str;
- if ( !PyArg_ParseTuple( args , "s" , &str ))
- return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a string" );
- BIF_undo_push(str);
- Py_RETURN_NONE;
-}
-
-static PyObject *Blender_UnpackModesDict( void )
-{
- PyObject *UnpackModes = PyConstant_New( );
- if( UnpackModes ) {
- BPy_constant *d = ( BPy_constant * ) UnpackModes;
- PyConstant_Insert( d, "EQUAL", PyInt_FromLong((long)PF_EQUAL) );
- PyConstant_Insert( d, "DIFFERS",PyInt_FromLong((long)PF_DIFFERS) );
- PyConstant_Insert( d, "NOFILE", PyInt_FromLong((long)PF_NOFILE) );
- PyConstant_Insert( d, "WRITE_ORIGINAL", PyInt_FromLong((long)PF_WRITE_ORIGINAL) );
- PyConstant_Insert( d, "WRITE_LOCAL", PyInt_FromLong((long)PF_WRITE_LOCAL) );
- PyConstant_Insert( d, "USE_LOCAL", PyInt_FromLong((long)PF_USE_LOCAL) );
- PyConstant_Insert( d, "USE_ORIGINAL", PyInt_FromLong((long)PF_USE_ORIGINAL) );
- PyConstant_Insert( d, "KEEP", PyInt_FromLong((long)PF_KEEP) );
- PyConstant_Insert( d, "NOOP", PyInt_FromLong((long)PF_NOOP) );
- PyConstant_Insert( d, "ASK", PyInt_FromLong((long)PF_EQUAL) );
- }
- return UnpackModes;
-}
-
-/*****************************************************************************/
-/* Function: initBlender */
-/*****************************************************************************/
-
-void M_Blender_Init(void)
-{
- PyObject *module;
- PyObject *dict, *smode, *SpaceHandlers, *UnpackModes;
-
- /* G.scene should only aver be NULL if blender is executed in
- background mode, not loading a blend file and executing a python script eg.
- blender -P somescript.py -b
- The if below solves the segfaults that happen when python runs and
- G.scene is NULL */
- if(G.background && G.main->scene.first==NULL) {
- Scene *sce= add_scene("1");
- /*set_scene(sce);*/ /* causes a crash */
- G.scene= sce;
- }
-
- module = Py_InitModule3("Blender", Blender_methods,
- "The main Blender module");
-
- types_InitAll(); /* set all our pytypes to &PyType_Type */
-
- /* constants for packed files*/
- UnpackModes = Blender_UnpackModesDict( );
- if( UnpackModes )
- PyModule_AddObject( module, "UnpackModes", UnpackModes );
-
- SpaceHandlers = PyConstant_New();
- if (SpaceHandlers) {
- BPy_constant *d = (BPy_constant *)SpaceHandlers;
-
- PyConstant_Insert(d,"VIEW3D_EVENT",PyInt_FromLong(SPACEHANDLER_VIEW3D_EVENT));
- PyConstant_Insert(d,"VIEW3D_DRAW", PyInt_FromLong(SPACEHANDLER_VIEW3D_DRAW));
-
- PyModule_AddObject(module, "SpaceHandlers", SpaceHandlers);
- }
-
- if (G.background)
- smode = PyString_FromString("background");
- else
- smode = PyString_FromString("interactive");
-
- dict = PyModule_GetDict(module);
- g_blenderdict = dict;
-
- PyModule_AddIntConstant(module, "TRUE", 1);
- PyModule_AddIntConstant( module, "FALSE", 0 );
-
- EXPP_dict_set_item_str(dict, "bylink", EXPP_incr_ret_False());
- PyDict_SetItemString(dict, "link", Py_None);
- EXPP_dict_set_item_str(dict, "event", PyString_FromString(""));
- EXPP_dict_set_item_str(dict, "mode", smode);
-
- PyDict_SetItemString(dict, "Armature", Armature_Init());
- PyDict_SetItemString(dict, "BezTriple", BezTriple_Init());
- PyDict_SetItemString(dict, "BGL", BGL_Init());
- PyDict_SetItemString(dict, "CurNurb", CurNurb_Init());
- PyDict_SetItemString(dict, "Constraint", Constraint_Init());
- PyDict_SetItemString(dict, "Curve", Curve_Init());
- PyDict_SetItemString(dict, "Camera", Camera_Init());
- PyDict_SetItemString(dict, "Draw", Draw_Init());
- PyDict_SetItemString(dict, "Effect", Effect_Init());
- PyDict_SetItemString(dict, "Ipo", Ipo_Init());
- PyDict_SetItemString(dict, "IpoCurve", IpoCurve_Init());
- PyDict_SetItemString(dict, "Image", Image_Init());
- PyDict_SetItemString(dict, "Key", Key_Init());
- PyDict_SetItemString(dict, "Lamp", Lamp_Init());
- PyDict_SetItemString(dict, "Lattice", Lattice_Init());
- PyDict_SetItemString(dict, "Library", oldLibrary_Init());
- PyDict_SetItemString(dict, "Material", Material_Init());
- PyDict_SetItemString(dict, "Mesh", Mesh_Init());
- PyDict_SetItemString(dict, "Metaball", Metaball_Init());
- PyDict_SetItemString(dict, "Mathutils", Mathutils_Init("Blender.Mathutils"));
- PyDict_SetItemString(dict, "Geometry", Geometry_Init());
- PyDict_SetItemString(dict, "Modifier", Modifier_Init());
- PyDict_SetItemString(dict, "NMesh", NMesh_Init());
- PyDict_SetItemString(dict, "Node", Node_Init());
- PyDict_SetItemString(dict, "Noise", Noise_Init());
- PyDict_SetItemString(dict, "Object", Object_Init());
- PyDict_SetItemString(dict, "Particle", ParticleSys_Init());
- PyDict_SetItemString(dict, "Group", Group_Init());
- PyDict_SetItemString(dict, "Registry", Registry_Init());
- PyDict_SetItemString(dict, "Scene", Scene_Init());
- PyDict_SetItemString(dict, "Sound", Sound_Init());
- PyDict_SetItemString(dict, "SurfNurb", SurfNurb_Init());
- PyDict_SetItemString(dict, "sys", sys_Init());
- PyDict_SetItemString(dict, "Types", Types_Init());
- PyDict_SetItemString(dict, "Text", Text_Init());
- PyDict_SetItemString(dict, "Text3d", Text3d_Init());
- PyDict_SetItemString(dict, "Texture", Texture_Init());
- PyDict_SetItemString(dict, "Window", Window_Init());
- PyDict_SetItemString(dict, "World", World_Init());
-
-}
diff --git a/source/blender/python/api2_2x/Blender.h b/source/blender/python/api2_2x/Blender.h
deleted file mode 100644
index ffd1eb274c4..00000000000
--- a/source/blender/python/api2_2x/Blender.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BLENDER_H
-#define EXPP_BLENDER_H
-
-#include <Python.h>
-
-extern PyObject *g_blenderdict;
-void M_Blender_Init( void );
-
-#endif /* EXPP_BLENDER_H */
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c
deleted file mode 100644
index 948eb007803..00000000000
--- a/source/blender/python/api2_2x/Bone.c
+++ /dev/null
@@ -1,1430 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Bone.h"
-#include "vector.h"
-#include "matrix.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BKE_utildefines.h"
-#include "gen_utils.h"
-#include "BKE_armature.h"
-#include "Mathutils.h"
-#include "BKE_library.h"
-
-//these must come in this order
-#include "DNA_object_types.h" //1
-#include "BIF_editarmature.h" //2
-
-//------------------------ERROR CODES---------------------------------
-//This is here just to make me happy and to have more consistant error strings :)
-static const char sEditBoneError[] = "EditBone - Error: ";
-// static const char sEditBoneBadArgs[] = "EditBone - Bad Arguments: ";
-static const char sBoneError[] = "Bone - Error: ";
-// static const char sBoneBadArgs[] = "Bone - Bad Arguments: ";
-
-//----------------------(internal)
-//gets the bone->roll (which is a localspace roll) and puts it in parentspace
-//(which is the 'roll' value the user sees)
-static double boneRoll_ToArmatureSpace(struct Bone *bone)
-{
- float head[3], tail[3], delta[3];
- float premat[3][3], postmat[3][3];
- float imat[3][3], difmat[3][3];
- double roll = 0.0f;
-
- VECCOPY(head, bone->arm_head);
- VECCOPY(tail, bone->arm_tail);
- VECSUB (delta, tail, head);
- vec_roll_to_mat3(delta, 0.0f, postmat);
- Mat3CpyMat4(premat, bone->arm_mat);
- Mat3Inv(imat, postmat);
- Mat3MulMat3(difmat, imat, premat);
-
- roll = atan2(difmat[2][0], difmat[2][2]);
- if (difmat[0][0] < 0.0){
- roll += M_PI;
- }
- return roll; //result is in radians
-}
-
-//################## EditBone_Type ########################
-/*This type is a wrapper for a tempory bone. This is an 'unparented' bone
-*object. The armature->bonebase will be calculated from these temporary
-*python tracked objects.*/
-//####################################################
-
-//------------------METHOD IMPLEMENTATIONS-----------------------------
-//-------------------------EditBone.hasParent()
-static PyObject *EditBone_hasParent(BPy_EditBone *self)
-{
- if (self->editbone){
- if (self->editbone->parent)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
- }else{
- goto AttributeError;
- }
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".hasParent: ", "EditBone must be added to the armature first");
-}
-//-------------------------EditBone.clearParent()
-static PyObject *EditBone_clearParent(BPy_EditBone *self)
-{
- if (self->editbone){
- if (self->editbone->parent)
- self->editbone->parent = NULL;
- Py_RETURN_NONE;
- }else{
- goto AttributeError;
- }
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".clearParent: ", "EditBone must be added to the armature first");
-}
-//------------------ATTRIBUTE IMPLEMENTATION---------------------------
-//------------------------EditBone.name (get)
-static PyObject *EditBone_getName(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- return PyString_FromString(self->editbone->name);
- else
- return PyString_FromString(self->name);
-}
-//------------------------EditBone.name (set)
-//check for char[] overflow here...
-static int EditBone_setName(BPy_EditBone *self, PyObject *value, void *closure)
-{
- char *name = "";
-
- if (!PyArg_Parse(value, "s", &name))
- goto AttributeError;
-
- if (self->editbone)
- BLI_strncpy(self->editbone->name, name, 32);
- else
- BLI_strncpy(self->name, name, 32);
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".name: ", "expects a string");
-}
-//------------------------EditBone.roll (get)
-static PyObject *EditBone_getRoll(BPy_EditBone *self, void *closure)
-{
- if (self->editbone){
- return PyFloat_FromDouble((self->editbone->roll * (180/Py_PI)));
- }else{
- return PyFloat_FromDouble((self->roll * (180/Py_PI)));
- }
-}
-//------------------------EditBone.roll (set)
-static int EditBone_setRoll(BPy_EditBone *self, PyObject *value, void *closure)
-{
- float roll = 0.0f;
-
- if (!PyArg_Parse(value, "f", &roll))
- goto AttributeError;
-
- if (self->editbone){
- self->editbone->roll = (float)(roll * (Py_PI/180));
- }else{
- self->roll = (float)(roll * (Py_PI/180));
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".roll: ", "expects a float");
-}
-//------------------------EditBone.head (get)
-static PyObject *EditBone_getHead(BPy_EditBone *self, void *closure)
-{
- if (self->editbone){
- return newVectorObject(self->editbone->head, 3, Py_WRAP);
- }else{
- return newVectorObject(self->head, 3, Py_NEW);
- }
-}
-//------------------------EditBone.head (set)
-static int EditBone_setHead(BPy_EditBone *self, PyObject *value, void *closure)
-{
- VectorObject *vec = NULL;
- int x;
-
- if (!PyArg_Parse(value, "O!", &vector_Type, &vec))
- goto AttributeError;
- if (vec->size != 3)
- goto AttributeError2;
-
- if (self->editbone){
- for (x = 0; x < 3; x++){
- self->editbone->head[x] = vec->vec[x];
- }
- }else{
- for (x = 0; x < 3; x++){
- self->head[x] = vec->vec[x];
- }
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".head: ", "expects a Vector Object");
-
-AttributeError2:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".head: ", "Vector Object needs to be (x,y,z)");
-}
-//------------------------EditBone.tail (get)
-static PyObject *EditBone_getTail(BPy_EditBone *self, void *closure)
-{
- if (self->editbone){
- return newVectorObject(self->editbone->tail, 3, Py_WRAP);
- }else{
- return newVectorObject(self->tail, 3, Py_NEW);
- }
-}
-//------------------------EditBone.tail (set)
-static int EditBone_setTail(BPy_EditBone *self, PyObject *value, void *closure)
-{
- VectorObject *vec = NULL;
- int x;
-
- if (!PyArg_Parse(value, "O!", &vector_Type, &vec))
- goto AttributeError;
- if (vec->size != 3)
- goto AttributeError2;
-
- if (self->editbone){
- for (x = 0; x < 3; x++){
- self->editbone->tail[x] = vec->vec[x];
- }
- }else{
- for (x = 0; x < 3; x++){
- self->tail[x] = vec->vec[x];
- }
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".tail: ", "expects a Vector Object");
-
-AttributeError2:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".tail: ", "Vector Object needs to be (x,y,z)");
-}
-//------------------------EditBone.weight (get)
-static PyObject *EditBone_getWeight(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- return PyFloat_FromDouble(self->editbone->weight);
- else
- return PyFloat_FromDouble(self->weight);
-}
-//------------------------EditBone.weight (set)
-static int EditBone_setWeight(BPy_EditBone *self, PyObject *value, void *closure)
-{
- float weight;
-
- if (!PyArg_Parse(value, "f", &weight))
- goto AttributeError;
- CLAMP(weight, 0.0f, 1000.0f);
-
- if (self->editbone)
- self->editbone->weight = weight;
- else
- self->weight = weight;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".weight: ", "expects a float");
-}
-//------------------------EditBone.deform_dist (get)
-static PyObject *EditBone_getDeform_dist(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- return PyFloat_FromDouble(self->editbone->dist);
- else
- return PyFloat_FromDouble(self->dist);
-}
-//------------------------EditBone.deform_dist (set)
-static int EditBone_setDeform_dist(BPy_EditBone *self, PyObject *value, void *closure)
-{
- float deform;
-
- if (!PyArg_Parse(value, "f", &deform))
- goto AttributeError;
- CLAMP(deform, 0.0f, 1000.0f);
-
- if (self->editbone)
- self->editbone->dist = deform;
- else
- self->dist = deform;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".deform_dist: ", "expects a float");
-}
-//------------------------EditBone.subdivisions (get)
-static PyObject *EditBone_getSubdivisions(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- return PyInt_FromLong(self->editbone->segments);
- else
- return PyInt_FromLong(self->segments);
-}
-//------------------------EditBone.subdivisions (set)
-static int EditBone_setSubdivisions(BPy_EditBone *self, PyObject *value, void *closure)
-{
- int segs;
-
- if (!PyArg_Parse(value, "i", &segs))
- goto AttributeError;
- CLAMP(segs, 1, 32);
-
- if (self->editbone)
- self->editbone->segments = (short)segs;
- else
- self->segments = (short)segs;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".subdivisions: ", "expects a integer");
-}
-//------------------------EditBone.options (get)
-static PyObject *EditBone_getOptions(BPy_EditBone *self, void *closure)
-{
- PyObject *list = NULL;
-
- list = PyList_New(0);
- if (!list)
- goto RuntimeError;
-
- if(self->editbone){
- if(self->editbone->flag & BONE_CONNECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "CONNECTED")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_HINGE)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HINGE")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_NO_DEFORM)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "NO_DEFORM")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_MULT_VG_ENV)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "MULTIPLY")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_HIDDEN_A)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HIDDEN_EDIT")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_ROOTSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "ROOT_SELECTED")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_SELECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "BONE_SELECTED")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_TIPSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1)
- goto RuntimeError;
- if(self->editbone->flag & BONE_EDITMODE_LOCKED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1)
- goto RuntimeError;
- }else{
- if(self->flag & BONE_CONNECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "CONNECTED")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_HINGE)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HINGE")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_NO_DEFORM)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "NO_DEFORM")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_MULT_VG_ENV)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "MULTIPLY")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_HIDDEN_A)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HIDDEN_EDIT")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_ROOTSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "ROOT_SELECTED")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_SELECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "BONE_SELECTED")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_TIPSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1)
- goto RuntimeError;
- if(self->flag & BONE_EDITMODE_LOCKED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "LOCKED_EDIT")) == -1)
- goto RuntimeError;
- }
-
- return list;
-
-RuntimeError:
- Py_XDECREF( list );
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sEditBoneError, ".options: ", "Internal failure!");
-}
-//----------------------(internal) EditBone_CheckValidConstant
-static int EditBone_CheckValidConstant(PyObject *constant)
-{
- PyObject *name = NULL;
-
- if (constant){
- if (BPy_Constant_Check(constant)){
- name = PyDict_GetItemString(((BPy_constant*)constant)->dict, "name");
- if (!name)
- return 0;
- if (!STREQ3(PyString_AsString(name), "CONNECTED", "HINGE", "NO_DEFORM") &&
- !STREQ3(PyString_AsString(name), "ROOT_SELECTED", "BONE_SELECTED", "TIP_SELECTED") &&
- !STREQ3(PyString_AsString(name), "MULTIPLY", "HIDDEN_EDIT", "LOCKED_EDIT"))
- return 0;
- else
- return 1;
- }else{
- return 0;
- }
- }else{
- return 0;
- }
-}
-
-//------------------------EditBone.options (set)
-static int EditBone_setOptions(BPy_EditBone *self, PyObject *value, void *closure)
-{
- int length, numeric_value, new_flag = 0, x;
- PyObject *val = NULL, *index = NULL;
-
- if (PyList_Check(value)){
- length = PyList_Size(value);
- for (x = 0; x < length; x++){
- index = PyList_GetItem(value, x);
- if (!EditBone_CheckValidConstant(index))
- goto AttributeError2;
- val = PyDict_GetItemString(((BPy_constant*)index)->dict, "value");
- if (PyInt_Check(val)){
- numeric_value = (int)PyInt_AS_LONG(val);
- new_flag |= numeric_value;
- }else{
- goto AttributeError2;
- }
- }
-
- //set the options
- if(self->editbone){
- //make sure the 'connected' property is set up correctly
- if (new_flag & BONE_CONNECTED) {
- if(!self->editbone->parent)
- goto AttributeError3;
- else
- VECCOPY(self->editbone->head, self->editbone->parent->tail);
- }
- self->editbone->flag = new_flag;
- }else{
- self->flag = new_flag;
- }
- return 0;
- }else if (BPy_Constant_Check(value)){
- if (!EditBone_CheckValidConstant(value))
- goto AttributeError2;
- val = PyDict_GetItemString(((BPy_constant*)value)->dict, "value");
- if (PyInt_Check(val)){
- numeric_value = (int)PyInt_AS_LONG(val);
-
- if(self->editbone){
- //make sure the 'connected' property is set up correctly
- if (numeric_value & BONE_CONNECTED) {
- if(!self->editbone->parent)
- goto AttributeError3;
- else
- VECCOPY(self->editbone->head, self->editbone->parent->tail);
- }
- self->editbone->flag = numeric_value;
- }else{
- self->flag = numeric_value;
- }
- return 0;
- }else{
- goto AttributeError2;
- }
- }else{
- goto AttributeError1;
- }
-
-AttributeError1:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".options: ", "Expects a constant or list of constants");
-AttributeError2:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".options: ", "Please use a constant defined in the Armature module");
-AttributeError3:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".options: ", "You can't connect to parent because no parent is set");
-}
-//------------------------EditBone.parent (get)
-static PyObject *EditBone_getParent(BPy_EditBone *self, void *closure)
-{
- if (self->editbone){
- if (self->editbone->parent)
- return PyEditBone_FromEditBone(self->editbone->parent);
- else
- Py_RETURN_NONE;
- }else{
- Py_RETURN_NONE; //not in the list yet can't have a parent
- }
-}
-//------------------------EditBone.parent (set)
-static int EditBone_setParent(BPy_EditBone *self, PyObject *value, void *closure)
-{
- BPy_EditBone *parent = NULL;
-
- if (!PyArg_Parse(value, "O!", &EditBone_Type, &parent))
- goto AttributeError;
-
- if (!parent->editbone)
- goto AttributeError2;
-
- if (self->editbone){
- self->editbone->parent = parent->editbone;
- }else{
- self->parent = parent->editbone;
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".parent: ", "expects a EditBone Object");
-AttributeError2:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".parent: ", "This object is not in the armature's bone list!");
-}
-//------------------------EditBone.matrix (get)
-static PyObject *EditBone_getMatrix(BPy_EditBone *self, void *closure)
-{
- float boneMatrix[3][3];
- float axis[3];
-
- if (self->editbone){
- VECSUB(axis, self->editbone->tail, self->editbone->head);
- vec_roll_to_mat3(axis, self->editbone->roll, boneMatrix);
- }else{
- VECSUB(axis, self->tail, self->head);
- vec_roll_to_mat3(axis, self->roll, boneMatrix);
- }
-
- return newMatrixObject((float*)boneMatrix, 3, 3, Py_NEW);
-}
-//------------------------EditBone.matrix (set)
-static int EditBone_setMatrix(BPy_EditBone *self, PyObject *value, void *closure)
-{
- PyObject *matrix;
- float roll, length, vec[3], axis[3], mat3[3][3];
-
- if (!PyArg_Parse(value, "O!", &matrix_Type, &matrix))
- goto AttributeError;
-
- //make sure we have the right sizes
- if (((MatrixObject*)matrix)->rowSize != 3 && ((MatrixObject*)matrix)->colSize != 3){
- if(((MatrixObject*)matrix)->rowSize != 4 && ((MatrixObject*)matrix)->colSize != 4){
- goto AttributeError;
- }
- }
-
- /*vec will be a normalized directional vector
- * together with the length of the old bone vec*length = the new vector*/
- /*The default rotation is 0,1,0 on the Y axis (see mat3_to_vec_roll)*/
- if (((MatrixObject*)matrix)->rowSize == 4){
- Mat3CpyMat4(mat3, ((float (*)[4])*((MatrixObject*)matrix)->matrix));
- }else{
- Mat3CpyMat3(mat3, ((float (*)[3])*((MatrixObject*)matrix)->matrix));
- }
- mat3_to_vec_roll(mat3, vec, &roll);
-
- //if a 4x4 matrix was passed we'll translate the vector otherwise not
- if (self->editbone){
- self->editbone->roll = roll;
- VecSubf(axis, self->editbone->tail, self->editbone->head);
- length = VecLength(axis);
- VecMulf(vec, length);
- if (((MatrixObject*)matrix)->rowSize == 4)
- VecCopyf(self->editbone->head, ((MatrixObject*)matrix)->matrix[3]);
- VecAddf(self->editbone->tail, self->editbone->head, vec);
- return 0;
- }else{
- self->roll = roll;
- VecSubf(axis, self->tail, self->head);
- length = VecLength(axis);
- VecMulf(vec, length);
- if (((MatrixObject*)matrix)->rowSize == 4)
- VecCopyf(self->head, ((MatrixObject*)matrix)->matrix[3]);
- VecAddf(self->tail, self->head, vec);
- return 0;
- }
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".matrix: ", "expects a 3x3 or 4x4 Matrix Object");
-}
-//------------------------Bone.length (get)
-static PyObject *EditBone_getLength(BPy_EditBone *self, void *closure)
-{
- float delta[3];
- double dot = 0.0f;
- int x;
-
- if (self->editbone){
- VECSUB(delta, self->editbone->tail, self->editbone->head);
- for(x = 0; x < 3; x++){
- dot += (delta[x] * delta[x]);
- }
- return PyFloat_FromDouble(sqrt(dot));
- }else{
- VECSUB(delta, self->tail, self->head);
- for(x = 0; x < 3; x++){
- dot += (delta[x] * delta[x]);
- }
- return PyFloat_FromDouble(sqrt(dot));
- }
-}
-//------------------------Bone.length (set)
-static int EditBone_setLength(BPy_EditBone *self, PyObject *value, void *closure)
-{
- printf("Sorry this isn't implemented yet.... :/");
- return 1;
-}
-
-
-//------------------------Bone.headRadius (get)
-static PyObject *EditBone_getHeadRadius(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- if (self->editbone->parent && self->editbone->flag & BONE_CONNECTED)
- return PyFloat_FromDouble(self->editbone->parent->rad_tail);
- else
- return PyFloat_FromDouble(self->editbone->rad_head);
- else
- if (self->parent && self->flag & BONE_CONNECTED)
- return PyFloat_FromDouble(self->parent->rad_tail);
- else
- return PyFloat_FromDouble(self->rad_head);
-}
-//------------------------Bone.headRadius (set)
-static int EditBone_setHeadRadius(BPy_EditBone *self, PyObject *value, void *closure)
-{
- float radius;
- if (!PyArg_Parse(value, "f", &radius))
- goto AttributeError;
- CLAMP(radius, 0.0f, 10000.0f);
-
- if (self->editbone)
- if (self->editbone->parent && self->editbone->flag & BONE_CONNECTED)
- self->editbone->parent->rad_tail= radius;
- else
- self->editbone->rad_head= radius;
- else
- if (self->parent && self->flag & BONE_CONNECTED)
- self->parent->rad_tail= radius;
- else
- self->rad_head= radius;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".headRadius: ", "expects a float");
-}
-
-
-//------------------------Bone.tailRadius (get)
-static PyObject *EditBone_getTailRadius(BPy_EditBone *self, void *closure)
-{
- if (self->editbone)
- return PyFloat_FromDouble(self->editbone->rad_tail);
- else
- return PyFloat_FromDouble(self->rad_tail);
-}
-//------------------------Bone.tailRadius (set)
-static int EditBone_setTailRadius(BPy_EditBone *self, PyObject *value, void *closure)
-{
- float radius;
- if (!PyArg_Parse(value, "f", &radius))
- goto AttributeError;
- CLAMP(radius, 0.0f, 10000.0f);
-
- if (self->editbone)
- self->editbone->rad_tail = radius;
- else
- self->rad_tail = radius;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".tailRadius: ", "expects a float");
-}
-
-//------------------------Bone.layerMask (get)
-static PyObject *EditBone_getLayerMask(BPy_EditBone *self)
-{
- /* do this extra stuff because the short's bits can be negative values */
- unsigned short laymask = 0;
- if (self->editbone) laymask |= self->editbone->layer;
- else laymask |= self->layer;
- return PyInt_FromLong((int)laymask);
-}
-//------------------------Bone.layerMask (set)
-static int EditBone_setLayerMask(BPy_EditBone *self, PyObject *value)
-{
- int laymask;
- if (!PyInt_Check(value)) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected an integer (bitmask) as argument" );
- }
-
- laymask = PyInt_AsLong(value);
-
- if (laymask <= 0 || laymask > (1<<16) - 1)
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "bitmask must have from 1 up to 16 bits set");
-
- if (self->editbone) {
- self->editbone->layer = 0;
- self->editbone->layer |= laymask;
- } else {
- self->layer = 0;
- self->layer |= laymask;
- }
-
- return 0;
-}
-
-//------------------TYPE_OBECT IMPLEMENTATION--------------------------
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_EditBone_methods[] = {
- {"hasParent", (PyCFunction) EditBone_hasParent, METH_NOARGS,
- "() - True/False - Bone has a parent"},
- {"clearParent", (PyCFunction) EditBone_clearParent, METH_NOARGS,
- "() - sets the parent to None"},
- {NULL, NULL, 0, NULL}
-};
-///------------------------tp_getset
-//This contains methods for attributes that require checking
-static PyGetSetDef BPy_EditBone_getset[] = {
- {"name", (getter)EditBone_getName, (setter)EditBone_setName,
- "The name of the bone", NULL},
- {"roll", (getter)EditBone_getRoll, (setter)EditBone_setRoll,
- "The roll (or rotation around the axis) of the bone", NULL},
- {"head", (getter)EditBone_getHead, (setter)EditBone_setHead,
- "The start point of the bone", NULL},
- {"tail", (getter)EditBone_getTail, (setter)EditBone_setTail,
- "The end point of the bone", NULL},
- {"matrix", (getter)EditBone_getMatrix, (setter)EditBone_setMatrix,
- "The matrix of the bone", NULL},
- {"weight", (getter)EditBone_getWeight, (setter)EditBone_setWeight,
- "The weight of the bone in relation to a parented mesh", NULL},
- {"deformDist", (getter)EditBone_getDeform_dist, (setter)EditBone_setDeform_dist,
- "The distance at which deformation has effect", NULL},
- {"subdivisions", (getter)EditBone_getSubdivisions, (setter)EditBone_setSubdivisions,
- "The number of subdivisions (for B-Bones)", NULL},
- {"options", (getter)EditBone_getOptions, (setter)EditBone_setOptions,
- "The options effective on this bone", NULL},
- {"parent", (getter)EditBone_getParent, (setter)EditBone_setParent,
- "The parent bone of this bone", NULL},
- {"length", (getter)EditBone_getLength, (setter)EditBone_setLength,
- "The length of this bone", NULL},
- {"tailRadius", (getter)EditBone_getTailRadius, (setter)EditBone_setTailRadius,
- "Set the radius of this bones tip", NULL},
- {"headRadius", (getter)EditBone_getHeadRadius, (setter)EditBone_setHeadRadius,
- "Set the radius of this bones head", NULL},
- {"layerMask", (getter)EditBone_getLayerMask, (setter)EditBone_setLayerMask,
- "Layer bitmask", NULL },
- {NULL, NULL, NULL, NULL,NULL}
-};
-
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *EditBone_repr(BPy_EditBone *self)
-{
- if (self->editbone)
- return PyString_FromFormat( "[EditBone \"%s\"]", self->editbone->name );
- else
- return PyString_FromFormat( "[EditBone \"%s\"]", self->name );
-}
-
-static int EditBone_compare( BPy_EditBone * a, BPy_EditBone * b )
-{
- /* if they are not wrapped, then they cant be the same */
- if (a->editbone==NULL && b->editbone==NULL) return -1;
- return ( a->editbone == b->editbone ) ? 0 : -1;
-}
-
-
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_EditBone_doc[] = "This is an internal subobject of armature\
-designed to act as a wrapper for an 'edit bone'.";
-
-//------------------------tp_new
-//This methods creates a new object (note it does not initialize it - only the building)
-static PyObject *EditBone_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- char *name = "myEditBone";
- BPy_EditBone *py_editBone = NULL;
- float head[3], tail[3];
-
- py_editBone = (BPy_EditBone*)type->tp_alloc(type, 0); //new
- if (py_editBone == NULL)
- goto RuntimeError;
-
- //this pointer will be set when this bone is placed in ListBase
- //otherwise this will act as a py_object
- py_editBone->editbone = NULL;
-
- unique_editbone_name(NULL, name);
- BLI_strncpy(py_editBone->name, name, 32);
- py_editBone->parent = NULL;
- py_editBone->weight= 1.0f;
- py_editBone->dist= 0.25f;
- py_editBone->xwidth= 0.1f;
- py_editBone->zwidth= 0.1f;
- py_editBone->ease1= 1.0f;
- py_editBone->ease2= 1.0f;
- py_editBone->rad_head= 0.10f;
- py_editBone->rad_tail= 0.05f;
- py_editBone->segments= 1;
- py_editBone->layer= 1;
- py_editBone->flag = 0;
- py_editBone->roll = 0.0f;
-
- head[0] = head[1] = head[2] = 0.0f;
- tail[1] = tail[2] = 0.0f;
- tail[0] = 1.0f;
- VECCOPY(py_editBone->head, head);
- VECCOPY(py_editBone->tail, tail);
-
- return (PyObject*)py_editBone;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sEditBoneError, " __new__: ", "Internal Error");
-}
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-//the struct EditBone pointer will be handled by the BPy_BonesDict class
-static void EditBone_dealloc(BPy_EditBone * self)
-{
- EditBone_Type.tp_free(self);
- return;
-}
-//------------------TYPE_OBECT DEFINITION--------------------------
-PyTypeObject EditBone_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "EditBone", //tp_name
- sizeof(BPy_EditBone), //tp_basicsize
- 0, //tp_itemsize
- (destructor)EditBone_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- (cmpfunc)EditBone_compare, //tp_compare
- (reprfunc)EditBone_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_EditBone_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_EditBone_methods, //tp_methods
- 0, //tp_members
- BPy_EditBone_getset, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- (newfunc)EditBone_new, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-
-//------------------METHOD IMPLEMENTATIONS--------------------------------
-//------------------------(internal) PyBone_ChildrenAsList
-static int PyBone_ChildrenAsList(PyObject *list, ListBase *bones){
- Bone *bone = NULL;
- PyObject *py_bone = NULL;
-
- for (bone = bones->first; bone; bone = bone->next){
- py_bone = PyBone_FromBone(bone);
- if (py_bone == NULL)
- return 0;
-
- if(PyList_Append(list, py_bone) == -1){
- return 0;
- }
- Py_DECREF(py_bone);
- if (bone->childbase.first)
- if (!PyBone_ChildrenAsList(list, &bone->childbase))
- return 0;
- }
- return 1;
-}
-//-------------------------Bone.hasParent()
-static PyObject *Bone_hasParent(BPy_Bone *self)
-{
- if (self->bone->parent)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-//-------------------------Bone.hasChildren()
-static PyObject *Bone_hasChildren(BPy_Bone *self)
-{
- if (self->bone->childbase.first)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-//-------------------------Bone.getAllChildren()
-static PyObject *Bone_getAllChildren(BPy_Bone *self)
-{
- PyObject *list = PyList_New(0);
- if (!self->bone->childbase.first) {
- /* do nothing */
- } else if (!PyBone_ChildrenAsList(list, &self->bone->childbase)) {
- Py_XDECREF(list);
- EXPP_objError(PyExc_RuntimeError, "%s%s",
- sBoneError, "Internal error trying to wrap blender bones!");
- }
- return list;
-}
-
-//------------------ATTRIBUTE IMPLEMENTATIONS-----------------------------
-//------------------------Bone.name (get)
-static PyObject *Bone_getName(BPy_Bone *self, void *closure)
-{
- return PyString_FromString(self->bone->name);
-}
-//------------------------Bone.name (set)
-//check for char[] overflow here...
-static int Bone_setName(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.roll (get)
-static PyObject *Bone_getRoll(BPy_Bone *self, void *closure)
-{
- return Py_BuildValue("{s:f, s:f}",
- "BONESPACE", self->bone->roll * (180/Py_PI),
- "ARMATURESPACE", boneRoll_ToArmatureSpace(self->bone) * (180/Py_PI));
-}
-//------------------------Bone.roll (set)
-static int Bone_setRoll(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.head (get)
-static PyObject *Bone_getHead(BPy_Bone *self, void *closure)
-{
- PyObject *val1 = newVectorObject(self->bone->head, 3, Py_WRAP);
- PyObject *val2 = newVectorObject(self->bone->arm_head, 3, Py_WRAP);
- PyObject *ret = Py_BuildValue(
- "{s:O, s:O}", "BONESPACE", val1, "ARMATURESPACE", val2);
-
- Py_DECREF(val1);
- Py_DECREF(val2);
- return ret;
-}
-//------------------------Bone.head (set)
-static int Bone_setHead(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.tail (get)
-static PyObject *Bone_getTail(BPy_Bone *self, void *closure)
-{
- PyObject *val1 = newVectorObject(self->bone->tail, 3, Py_WRAP);
- PyObject *val2 = newVectorObject(self->bone->arm_tail, 3, Py_WRAP);
- PyObject *ret = Py_BuildValue("{s:O, s:O}",
- "BONESPACE", val1, "ARMATURESPACE", val2);
-
- Py_DECREF(val1);
- Py_DECREF(val2);
- return ret;
-}
-//------------------------Bone.tail (set)
-static int Bone_setTail(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.weight (get)
-static PyObject *Bone_getWeight(BPy_Bone *self, void *closure)
-{
- return PyFloat_FromDouble(self->bone->weight);
-}
-//------------------------Bone.weight (set)
-static int Bone_setWeight(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.deform_dist (get)
-static PyObject *Bone_getDeform_dist(BPy_Bone *self, void *closure)
-{
- return PyFloat_FromDouble(self->bone->dist);
-}
-//------------------------Bone.deform_dist (set)
-static int Bone_setDeform_dist(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.subdivisions (get)
-static PyObject *Bone_getSubdivisions(BPy_Bone *self, void *closure)
-{
- return PyInt_FromLong(self->bone->segments);
-}
-//------------------------Bone.subdivisions (set)
-static int Bone_setSubdivisions(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.connected (get)
-static PyObject *Bone_getOptions(BPy_Bone *self, void *closure)
-{
- PyObject *list = NULL;
-
- list = PyList_New(0);
- if (list == NULL)
- goto RuntimeError;
-
- if(self->bone->flag & BONE_CONNECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "CONNECTED")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_HINGE)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HINGE")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_NO_DEFORM)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "NO_DEFORM")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_MULT_VG_ENV)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "MULTIPLY")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_HIDDEN_A)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "HIDDEN_EDIT")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_ROOTSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "ROOT_SELECTED")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_SELECTED)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "BONE_SELECTED")) == -1)
- goto RuntimeError;
- if(self->bone->flag & BONE_TIPSEL)
- if (PyList_Append(list,
- EXPP_GetModuleConstant("Blender.Armature", "TIP_SELECTED")) == -1)
- goto RuntimeError;
-
- return list;
-
-RuntimeError:
- Py_XDECREF(list);
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sBoneError, "getOptions(): ", "Internal failure!");
-}
-//------------------------Bone.connected (set)
-static int Bone_setOptions(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.parent (get)
-static PyObject *Bone_getParent(BPy_Bone *self, void *closure)
-{
- if (self->bone->parent)
- return PyBone_FromBone(self->bone->parent);
- else
- Py_RETURN_NONE;
-}
-//------------------------Bone.parent (set)
-static int Bone_setParent(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.children (get)
-static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
-{
- PyObject *list = PyList_New(0);
- Bone *bone = NULL;
- PyObject *py_bone = NULL;
-
- if (self->bone->childbase.first){
- for (bone = self->bone->childbase.first; bone; bone = bone->next){
- py_bone = PyBone_FromBone(bone);
- if (py_bone == NULL)
- goto RuntimeError;
- if (PyList_Append(list, py_bone) == -1)
- goto RuntimeError;
- Py_DECREF(py_bone);
- }
- }
- return list;
-
-RuntimeError:
- Py_XDECREF(list);
- Py_XDECREF(py_bone);
- return EXPP_objError(PyExc_RuntimeError, "%s%s",
- sBoneError, "Internal error trying to wrap blender bones!");
-}
-//------------------------Bone.children (set)
-static int Bone_setChildren(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.matrix (get)
-static PyObject *Bone_getMatrix(BPy_Bone *self, void *closure)
-{
- PyObject *val1 = newMatrixObject((float*)self->bone->bone_mat, 3,3, Py_WRAP);
- PyObject *val2 = newMatrixObject((float*)self->bone->arm_mat, 4,4, Py_WRAP);
- PyObject *ret = Py_BuildValue("{s:O, s:O}",
- "BONESPACE", val1, "ARMATURESPACE", val2);
- Py_DECREF(val1);
- Py_DECREF(val2);
- return ret;
-
-
-}
-//------------------------Bone.matrix (set)
-static int Bone_setMatrix(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-//------------------------Bone.length (get)
-static PyObject *Bone_getLength(BPy_Bone *self, void *closure)
-{
- return PyFloat_FromDouble(self->bone->length);
-}
-//------------------------Bone.length (set)
-static int Bone_setLength(BPy_Bone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_ValueError, "%s%s",
- sBoneError, "You must first call .makeEditable() to edit the armature");
-}
-
-//------------------------Bone.headRadius (get)
-static PyObject *Bone_getHeadRadius(BPy_Bone *self, void *closure)
-{
-
- if (self->bone->parent && self->bone->flag & BONE_CONNECTED)
- return PyFloat_FromDouble(self->bone->parent->rad_tail);
- else
- return PyFloat_FromDouble(self->bone->rad_head);
-}
-//------------------------Bone.headRadius (set)
-static int Bone_setHeadRadius(BPy_Bone *self, PyObject *value, void *closure)
-{
- float radius;
- if (!PyArg_Parse(value, "f", &radius))
- goto AttributeError;
- CLAMP(radius, 0.0f, 10000.0f);
-
- if (self->bone->parent && self->bone->flag & BONE_CONNECTED)
- self->bone->parent->rad_tail= radius;
- else
- self->bone->rad_head= radius;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".headRadius: ", "expects a float");
-}
-
-//------------------------Bone.tailRadius (get)
-static PyObject *Bone_getTailRadius(BPy_Bone *self, void *closure)
-{
- return PyFloat_FromDouble(self->bone->rad_tail);
-}
-
-//------------------------Bone.headRadius (set)
-static int Bone_setTailRadius(BPy_Bone *self, PyObject *value, void *closure)
-{
- float radius;
- if (!PyArg_Parse(value, "f", &radius))
- goto AttributeError;
- CLAMP(radius, 0.0f, 10000.0f);
- self->bone->rad_tail= radius;
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sEditBoneError, ".headRadius: ", "expects a float");
-}
-
-//------------------------Bone.layerMask (get)
-static PyObject *Bone_getLayerMask(BPy_Bone *self)
-{
- /* do this extra stuff because the short's bits can be negative values */
- unsigned short laymask = 0;
- laymask |= self->bone->layer;
- return PyInt_FromLong((int)laymask);
-}
-//------------------------Bone.layerMask (set)
-static int Bone_setLayerMask(BPy_Bone *self, PyObject *value)
-{
- int laymask;
- if (!PyInt_Check(value)) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected an integer (bitmask) as argument" );
- }
-
- laymask = PyInt_AsLong(value);
-
- if (laymask <= 0 || laymask > (1<<16) - 1)
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "bitmask must have from 1 up to 16 bits set");
-
- self->bone->layer = 0;
- self->bone->layer |= laymask;
-
- return 0;
-}
-
-//------------------TYPE_OBECT IMPLEMENTATION--------------------------
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_Bone_methods[] = {
- {"hasParent", (PyCFunction) Bone_hasParent, METH_NOARGS,
- "() - True/False - Bone has a parent"},
- {"hasChildren", (PyCFunction) Bone_hasChildren, METH_NOARGS,
- "() - True/False - Bone has 1 or more children"},
- {"getAllChildren", (PyCFunction) Bone_getAllChildren, METH_NOARGS,
- "() - All the children for this bone - including children's children"},
- {NULL, NULL, 0, NULL}
-};
-//------------------------tp_getset
-//This contains methods for attributes that require checking
-static PyGetSetDef BPy_Bone_getset[] = {
- {"name", (getter)Bone_getName, (setter)Bone_setName,
- "The name of the bone", NULL},
- {"roll", (getter)Bone_getRoll, (setter)Bone_setRoll,
- "The roll (or rotation around the axis) of the bone", NULL},
- {"head", (getter)Bone_getHead, (setter)Bone_setHead,
- "The start point of the bone", NULL},
- {"tail", (getter)Bone_getTail, (setter)Bone_setTail,
- "The end point of the bone", NULL},
- {"matrix", (getter)Bone_getMatrix, (setter)Bone_setMatrix,
- "The matrix of the bone", NULL},
- {"weight", (getter)Bone_getWeight, (setter)Bone_setWeight,
- "The weight of the bone in relation to a parented mesh", NULL},
- {"deform_dist", (getter)Bone_getDeform_dist, (setter)Bone_setDeform_dist,
- "The distance at which deformation has effect", NULL},
- {"subdivisions", (getter)Bone_getSubdivisions, (setter)Bone_setSubdivisions,
- "The number of subdivisions (for B-Bones)", NULL},
- {"options", (getter)Bone_getOptions, (setter)Bone_setOptions,
- "The options effective on this bone", NULL},
- {"parent", (getter)Bone_getParent, (setter)Bone_setParent,
- "The parent bone of this bone", NULL},
- {"children", (getter)Bone_getChildren, (setter)Bone_setChildren,
- "The child bones of this bone", NULL},
- {"length", (getter)Bone_getLength, (setter)Bone_setLength,
- "The length of this bone", NULL},
- {"tailRadius", (getter)Bone_getTailRadius, (setter)Bone_setTailRadius,
- "Set the radius of this bones tip", NULL},
- {"headRadius", (getter)Bone_getHeadRadius, (setter)Bone_setHeadRadius,
- "Set the radius of this bones head", NULL},
- {"layerMask", (getter)Bone_getLayerMask, (setter)Bone_setLayerMask,
- "Layer bitmask", NULL },
- {NULL, NULL, NULL, NULL,NULL}
-};
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *Bone_repr(BPy_Bone *self)
-{
- return PyString_FromFormat( "[Bone \"%s\"]", self->bone->name );
-}
-static int Bone_compare( BPy_Bone * a, BPy_Bone * b )
-{
- return ( a->bone == b->bone ) ? 0 : -1;
-}
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-static void Bone_dealloc(BPy_Bone * self)
-{
- Bone_Type.tp_free(self);
- return;
-}
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_Bone_doc[] = "This object wraps a Blender Boneobject.\n\
- This object is a subobject of the Armature object.";
-
-//------------------TYPE_OBECT DEFINITION--------------------------
-PyTypeObject Bone_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "Bone", //tp_name
- sizeof(BPy_Bone), //tp_basicsize
- 0, //tp_itemsize
- (destructor)Bone_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- (cmpfunc) Bone_compare, //tp_compare
- (reprfunc) Bone_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_Bone_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_Bone_methods, //tp_methods
- 0, //tp_members
- BPy_Bone_getset, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
-//-----------------(internal)
-//Converts a struct EditBone to a BPy_EditBone
-PyObject *PyEditBone_FromEditBone(struct EditBone *editbone)
-{
- BPy_EditBone *py_editbone = NULL;
-
- py_editbone = (BPy_EditBone*)EditBone_Type.tp_alloc(&EditBone_Type, 0); //*new*
- if (!py_editbone)
- goto RuntimeError;
-
- py_editbone->editbone = editbone;
-
- return (PyObject *) py_editbone;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sEditBoneError, "PyEditBone_FromEditBone: ", "Internal Error Ocurred");
-}
-//-----------------(internal)
-//Converts a struct Bone to a BPy_Bone
-PyObject *PyBone_FromBone(struct Bone *bone)
-{
- BPy_Bone *py_Bone = ( BPy_Bone * ) PyObject_NEW( BPy_Bone, &Bone_Type );
-
- py_Bone->bone = bone;
-
- return (PyObject *) py_Bone;
-}
-//-----------------(internal)
-//Converts a PyBone to a bBone
-struct Bone *PyBone_AsBone(BPy_Bone *py_Bone)
-{
- return (py_Bone->bone);
-}
diff --git a/source/blender/python/api2_2x/Bone.h b/source/blender/python/api2_2x/Bone.h
deleted file mode 100644
index 4ae25165025..00000000000
--- a/source/blender/python/api2_2x/Bone.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BONE_H
-#define EXPP_BONE_H
-
-#include <Python.h>
-#include "DNA_armature_types.h"
-
-/*-------------------TYPE CHECKS---------------------------------*/
-#define BoneObject_Check(v) ((v)->ob_type == &Bone_Type)
-#define EditBoneObject_Check(v) ((v)->ob_type == &EditBone_Type)
-/*-------------------TYPEOBJECT----------------------------------*/
-extern PyTypeObject EditBone_Type;
-extern PyTypeObject Bone_Type;
-/*-------------------STRUCT DEFINITION----------------------------*/
-
-typedef struct {
- PyObject_HEAD
- Bone * bone;
-} BPy_Bone;
-
-typedef struct {
- PyObject_HEAD
- struct EditBone *editbone;
- struct EditBone *parent;
- char name[32];
- float roll;
- float head[3];
- float tail[3];
- int flag;
- float dist;
- float weight;
- float xwidth;
- float zwidth;
- float ease1;
- float ease2;
- float rad_head;
- float rad_tail;
- short segments;
- short layer;
-} BPy_EditBone;
-/*-------------------VISIBLE PROTOTYPES-------------------------*/
-PyObject *PyBone_FromBone(struct Bone *bone);
-struct Bone *PyBone_AsBone(BPy_Bone *py_Bone);
-PyObject *PyEditBone_FromBone(Bone *bone);
-PyObject *PyEditBone_FromEditBone(struct EditBone *editbone);
-
-#endif
diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c
deleted file mode 100644
index af93a1130cb..00000000000
--- a/source/blender/python/api2_2x/Camera.c
+++ /dev/null
@@ -1,1060 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Johnny Matthews, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Camera.h" /*This must come first */
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_library.h"
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h" /* for M_PI */
-#include "DNA_userdef_types.h"
-#include "BSE_editipo.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "mydevice.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "Ipo.h"
-
-
-#define IPOKEY_LENS 0
-#define IPOKEY_CLIPPING 1
-
-
-
-enum cam_consts {
- EXPP_CAM_ATTR_LENS = 0,
- EXPP_CAM_ATTR_ANGLE,
- EXPP_CAM_ATTR_DOFDIST,
- EXPP_CAM_ATTR_CLIPEND,
- EXPP_CAM_ATTR_CLIPSTART,
- EXPP_CAM_ATTR_SCALE,
- EXPP_CAM_ATTR_DRAWSIZE,
- EXPP_CAM_ATTR_SHIFTX,
- EXPP_CAM_ATTR_SHIFTY,
- EXPP_CAM_ATTR_ALPHA,
-};
-
-/*****************************************************************************/
-/* Python API function prototypes for the Camera module. */
-/*****************************************************************************/
-static PyObject *M_Camera_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_Camera_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Camera.__doc__ */
-/*****************************************************************************/
-static char M_Camera_doc[] = "The Blender Camera module\n\
-\n\
-This module provides access to **Camera Data** objects in Blender\n\
-\n\
-Example::\n\
-\n\
- from Blender import Camera, Object, Scene\n\
- c = Camera.New('ortho') # create new ortho camera data\n\
- c.scale = 6.0 # set scale value\n\
- scn = Scene.GetCurrent() # get current Scene\n\
- ob = scn.objects.new(c) # Make an object from this data in the scene\n\
- cur.setCurrentCamera(ob) # make this camera the active";
-
-static char M_Camera_New_doc[] =
- "Camera.New (type = 'persp', name = 'CamData'):\n\
- Return a new Camera Data object with the given type and name.";
-
-static char M_Camera_Get_doc[] = "Camera.Get (name = None):\n\
- Return the camera data with the given 'name', None if not found, or\n\
- Return a list with all Camera Data objects in the current scene,\n\
- if no argument was given.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Camera module: */
-/*****************************************************************************/
-struct PyMethodDef M_Camera_methods[] = {
- {"New", ( PyCFunction ) M_Camera_New, METH_VARARGS | METH_KEYWORDS,
- M_Camera_New_doc},
- {"Get", M_Camera_Get, METH_VARARGS, M_Camera_Get_doc},
- {"get", M_Camera_Get, METH_VARARGS, M_Camera_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Camera methods declarations: */
-/*****************************************************************************/
-static PyObject *Camera_oldgetType( BPy_Camera * self );
-static PyObject *Camera_oldgetMode( BPy_Camera * self );
-static PyObject *Camera_oldgetLens( BPy_Camera * self );
-static PyObject *Camera_oldgetClipStart( BPy_Camera * self );
-static PyObject *Camera_oldgetClipEnd( BPy_Camera * self );
-static PyObject *Camera_oldgetDrawSize( BPy_Camera * self );
-static PyObject *Camera_oldgetScale( BPy_Camera * self );
-static PyObject *Camera_getIpo( BPy_Camera * self );
-static int Camera_setIpo( BPy_Camera * self, PyObject * value );
-static PyObject *Camera_oldsetIpo( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetType( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetMode( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetLens( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetClipStart( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetClipEnd( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetDrawSize( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldsetScale( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldgetScriptLinks( BPy_Camera * self, PyObject * value );
-static PyObject *Camera_addScriptLink( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_oldclearIpo( BPy_Camera * self );
-static PyObject *Camera_clearScriptLinks( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args );
-static PyObject *Camera_copy( BPy_Camera * self );
-
-
-/*****************************************************************************/
-/* Python BPy_Camera methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Camera_methods[] = {
- /* name, method, flags, doc */
- {"getIpo", ( PyCFunction ) Camera_getIpo, METH_NOARGS,
- "() - Return Camera Data Ipo"},
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Camera Data name"},
- {"getType", ( PyCFunction ) Camera_oldgetType, METH_NOARGS,
- "() - Return Camera type - 'persp':0, 'ortho':1"},
- {"getMode", ( PyCFunction ) Camera_oldgetMode, METH_NOARGS,
- "() - Return Camera mode flags (or'ed value) -\n"
- " 'showLimits':1, 'showMist':2"},
- {"getLens", ( PyCFunction ) Camera_oldgetLens, METH_NOARGS,
- "() - Return *perspective* Camera lens value"},
- {"getScale", ( PyCFunction ) Camera_oldgetScale, METH_NOARGS,
- "() - Return *ortho* Camera scale value"},
- {"getClipStart", ( PyCFunction ) Camera_oldgetClipStart, METH_NOARGS,
- "() - Return Camera clip start value"},
- {"getClipEnd", ( PyCFunction ) Camera_oldgetClipEnd, METH_NOARGS,
- "() - Return Camera clip end value"},
- {"getDrawSize", ( PyCFunction ) Camera_oldgetDrawSize, METH_NOARGS,
- "() - Return Camera draw size value"},
- {"setIpo", ( PyCFunction ) Camera_oldsetIpo, METH_VARARGS,
- "(Blender Ipo) - Set Camera Ipo"},
- {"clearIpo", ( PyCFunction ) Camera_oldclearIpo, METH_NOARGS,
- "() - Unlink Ipo from this Camera."},
- {"insertIpoKey", ( PyCFunction ) Camera_insertIpoKey, METH_VARARGS,
- "( Camera IPO type ) - Inserts a key into IPO"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(s) - Set Camera Data name"},
- {"setType", ( PyCFunction ) Camera_oldsetType, METH_O,
- "(s) - Set Camera type, which can be 'persp' or 'ortho'"},
- {"setMode", ( PyCFunction ) Camera_oldsetMode, METH_VARARGS,
- "(<s<,s>>) - Set Camera mode flag(s): 'showLimits' and 'showMist'"},
- {"setLens", ( PyCFunction ) Camera_oldsetLens, METH_O,
- "(f) - Set *perpective* Camera lens value"},
- {"setScale", ( PyCFunction ) Camera_oldsetScale, METH_O,
- "(f) - Set *ortho* Camera scale value"},
- {"setClipStart", ( PyCFunction ) Camera_oldsetClipStart, METH_O,
- "(f) - Set Camera clip start value"},
- {"setClipEnd", ( PyCFunction ) Camera_oldsetClipEnd, METH_O,
- "(f) - Set Camera clip end value"},
- {"setDrawSize", ( PyCFunction ) Camera_oldsetDrawSize, METH_O,
- "(f) - Set Camera draw size value"},
- {"getScriptLinks", ( PyCFunction ) Camera_oldgetScriptLinks, METH_O,
- "(eventname) - Get a list of this camera's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) Camera_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new camera scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) Camera_clearScriptLinks,
- METH_NOARGS,
- "() - Delete all scriptlinks from this camera.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this camera."},
- {"__copy__", ( PyCFunction ) Camera_copy, METH_NOARGS,
- "() - Return a copy of the camera."},
- {"copy", ( PyCFunction ) Camera_copy, METH_NOARGS,
- "() - Return a copy of the camera."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Camera_Type callback function prototypes: */
-/*****************************************************************************/
-static int Camera_compare( BPy_Camera * a, BPy_Camera * b );
-static PyObject *Camera_repr( BPy_Camera * self );
-
-static PyObject *M_Camera_New( PyObject * self, PyObject * args,
- PyObject * kwords )
-{
- char *type_str = "persp"; /* "persp" is type 0, "ortho" is type 1 */
- char *name_str = "Camera";
- static char *kwlist[] = { "type_str", "name_str", NULL };
- PyObject *pycam; /* for Camera Data object wrapper in Python */
- Camera *blcam; /* for actual Camera Data we create in Blender */
-
- /* Parse the arguments passed in by the Python interpreter */
- if( !PyArg_ParseTupleAndKeywords( args, kwords, "|ss", kwlist,
- &type_str, &name_str ) )
- /* We expected string(s) (or nothing) as argument, but we didn't get that. */
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected zero, one or two strings as arguments" );
-
- blcam = add_camera( name_str ); /* first create the Camera Data in Blender */
-
- if( blcam ) /* now create the wrapper obj in Python */
- pycam = Camera_CreatePyObject( blcam );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Camera Data in Blender" );
-
- /* let's return user count to zero, because ... */
- blcam->id.us = 0; /* ... add_camera() incref'ed it */
- /* XXX XXX Do this in other modules, too */
-
- if( pycam == NULL )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Camera PyObject" );
-
- if( strcmp( type_str, "persp" ) == 0 )
- /* default, no need to set, so */
- /*blcam->type = (short)EXPP_CAM_TYPE_PERSP */
- ;
- /* we comment this line */
- else if( strcmp( type_str, "ortho" ) == 0 )
- blcam->type = ( short ) EXPP_CAM_TYPE_ORTHO;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown camera type" );
-
- return pycam;
-}
-
-static PyObject *M_Camera_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Camera *cam_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" );
-
- cam_iter = G.main->camera.first;
-
- if( name ) { /* (name) - Search camera by name */
-
- PyObject *wanted_cam = NULL;
-
- while( cam_iter && !wanted_cam ) {
-
- if( strcmp( name, cam_iter->id.name + 2 ) == 0 ) {
- wanted_cam = Camera_CreatePyObject( cam_iter );
- break;
- }
-
- cam_iter = cam_iter->id.next;
- }
-
- if( !wanted_cam ) { /* Requested camera doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Camera \"%s\" not found", name );
- return EXPP_ReturnPyObjError( PyExc_NameError,
- error_msg );
- }
-
- return wanted_cam;
- }
-
- else { /* () - return a list of wrappers for all cameras in the scene */
- int index = 0;
- PyObject *cam_pylist, *pyobj;
-
- cam_pylist =
- PyList_New( BLI_countlist( &( G.main->camera ) ) );
-
- if( !cam_pylist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- while( cam_iter ) {
- pyobj = Camera_CreatePyObject( cam_iter );
-
- if( !pyobj ) {
- Py_DECREF(cam_pylist);
- return EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Camera PyObject" );
- }
- PyList_SET_ITEM( cam_pylist, index, pyobj );
-
- cam_iter = cam_iter->id.next;
- index++;
- }
-
- return cam_pylist;
- }
-}
-
-PyObject *Camera_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Camera_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Camera",
- M_Camera_methods, M_Camera_doc );
-
- PyModule_AddIntConstant( submodule, "LENS", IPOKEY_LENS );
- PyModule_AddIntConstant( submodule, "CLIPPING", IPOKEY_CLIPPING );
-
- return submodule;
-}
-
-/* Three Python Camera_Type helper functions needed by the Object module: */
-
-PyObject *Camera_CreatePyObject( Camera * cam )
-{
- BPy_Camera *pycam;
-
- pycam = ( BPy_Camera * ) PyObject_NEW( BPy_Camera, &Camera_Type );
-
- if( !pycam )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Camera PyObject" );
-
- pycam->camera = cam;
- return ( PyObject * ) pycam;
-}
-
-Camera *Camera_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Camera * ) pyobj )->camera;
-}
-
-/*****************************************************************************/
-/* Python BPy_Camera methods: */
-/*****************************************************************************/
-
-static PyObject *Camera_oldgetType( BPy_Camera * self )
-{
- return PyInt_FromLong( self->camera->type );
-}
-
-static PyObject *Camera_oldgetMode( BPy_Camera * self )
-{
- return PyInt_FromLong( self->camera->flag );
-}
-
-static PyObject *Camera_oldgetLens( BPy_Camera * self )
-{
- return PyFloat_FromDouble( self->camera->lens );
-}
-
-static PyObject *Camera_oldgetScale( BPy_Camera * self )
-{
- return PyFloat_FromDouble( self->camera->ortho_scale );
-}
-
-static PyObject *Camera_oldgetClipStart( BPy_Camera * self )
-{
- return PyFloat_FromDouble( self->camera->clipsta );
-}
-
-static PyObject *Camera_oldgetClipEnd( BPy_Camera * self )
-{
- return PyFloat_FromDouble( self->camera->clipend );
-}
-
-static PyObject *Camera_oldgetDrawSize( BPy_Camera * self )
-{
- return PyFloat_FromDouble( self->camera->drawsize );
-}
-
-
-
-static PyObject *Camera_oldsetIpo( BPy_Camera * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Camera_setIpo );
-}
-
-static PyObject *Camera_oldclearIpo( BPy_Camera * self )
-{
- Camera *cam = self->camera;
- Ipo *ipo = ( Ipo * ) cam->ipo;
-
- if( ipo ) {
- ID *id = &ipo->id;
- if( id->us > 0 )
- id->us--;
- cam->ipo = NULL;
-
- return EXPP_incr_ret_True();
- }
-
- return EXPP_incr_ret_False(); /* no ipo found */
-}
-
-static PyObject *Camera_oldsetType( BPy_Camera * self, PyObject * value )
-{
- char *type = PyString_AsString(value);
-
- if(!value)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( strcmp( type, "persp" ) == 0 )
- self->camera->type = ( short ) EXPP_CAM_TYPE_PERSP;
- else if( strcmp( type, "ortho" ) == 0 )
- self->camera->type = ( short ) EXPP_CAM_TYPE_ORTHO;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown camera type" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetMode( BPy_Camera * self, PyObject * args )
-{
- char *mode_str1 = NULL, *mode_str2 = NULL;
- short flag = 0;
-
- if( !PyArg_ParseTuple( args, "|ss", &mode_str1, &mode_str2 ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected one or two strings as arguments" );
-
- if( mode_str1 != NULL ) {
- if( strcmp( mode_str1, "showLimits" ) == 0 )
- flag |= ( short ) EXPP_CAM_MODE_SHOWLIMITS;
- else if( strcmp( mode_str1, "showMist" ) == 0 )
- flag |= ( short ) EXPP_CAM_MODE_SHOWMIST;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "first argument is an unknown camera flag" );
-
- if( mode_str2 != NULL ) {
- if( strcmp( mode_str2, "showLimits" ) == 0 )
- flag |= ( short ) EXPP_CAM_MODE_SHOWLIMITS;
- else if( strcmp( mode_str2, "showMist" ) == 0 )
- flag |= ( short ) EXPP_CAM_MODE_SHOWMIST;
- else
- return EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "second argument is an unknown camera flag" );
- }
- }
-
- self->camera->flag = flag;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetLens( BPy_Camera * self, PyObject * value )
-{
- float param = PyFloat_AsDouble(value);
-
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->camera->lens = EXPP_ClampFloat( param,
- EXPP_CAM_LENS_MIN,
- EXPP_CAM_LENS_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetScale( BPy_Camera * self, PyObject * value )
-{
- float param = PyFloat_AsDouble(value);
-
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->camera->ortho_scale = EXPP_ClampFloat( param,
- EXPP_CAM_SCALE_MIN,
- EXPP_CAM_SCALE_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetClipStart( BPy_Camera * self, PyObject * value )
-{
- float param = PyFloat_AsDouble(value);
-
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->camera->clipsta = EXPP_ClampFloat( param,
- EXPP_CAM_CLIPSTART_MIN,
- EXPP_CAM_CLIPSTART_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetClipEnd( BPy_Camera * self, PyObject * value )
-{
- float param = PyFloat_AsDouble(value);
-
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->camera->clipend = EXPP_ClampFloat( param,
- EXPP_CAM_CLIPEND_MIN,
- EXPP_CAM_CLIPEND_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Camera_oldsetDrawSize( BPy_Camera * self, PyObject * value )
-{
- float param = PyFloat_AsDouble(value);
-
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->camera->drawsize = EXPP_ClampFloat( param,
- EXPP_CAM_DRAWSIZE_MIN,
- EXPP_CAM_DRAWSIZE_MAX );
-
- Py_RETURN_NONE;
-}
-
-/* cam.addScriptLink */
-static PyObject *Camera_addScriptLink( BPy_Camera * self, PyObject * args )
-{
- Camera *cam = self->camera;
- ScriptLink *slink = NULL;
-
- slink = &( cam )->scriptlink;
-
- return EXPP_addScriptLink( slink, args, 0 );
-}
-
-/* cam.clearScriptLinks */
-static PyObject *Camera_clearScriptLinks( BPy_Camera * self, PyObject * args )
-{
- Camera *cam = self->camera;
- ScriptLink *slink = NULL;
-
- slink = &( cam )->scriptlink;
-
- return EXPP_clearScriptLinks( slink, args );
-}
-
-/* cam.getScriptLinks */
-static PyObject *Camera_oldgetScriptLinks( BPy_Camera * self, PyObject * value )
-{
- Camera *cam = self->camera;
- ScriptLink *slink = NULL;
- PyObject *ret = NULL;
-
- slink = &( cam )->scriptlink;
-
- ret = EXPP_getScriptLinks( slink, value, 0 );
-
- if( ret )
- return ret;
- else
- return NULL;
-}
-
-/* cam.__copy__ */
-static PyObject *Camera_copy( BPy_Camera * self )
-{
- PyObject *pycam; /* for Camera Data object wrapper in Python */
- Camera *blcam; /* for actual Camera Data we create in Blender */
-
- blcam = copy_camera( self->camera ); /* first create the Camera Data in Blender */
-
- if( blcam ) /* now create the wrapper obj in Python */
- pycam = Camera_CreatePyObject( blcam );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Camera Data in Blender" );
-
- /* let's return user count to zero, because ... */
- blcam->id.us = 0; /* ... copy_camera() incref'ed it */
- /* XXX XXX Do this in other modules, too */
-
- if( pycam == NULL )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Camera PyObject" );
-
- return pycam;
-}
-
-static PyObject *Camera_getType( BPy_Camera * self )
-{
- if (self->camera->type == EXPP_CAM_TYPE_PERSP)
- return PyString_FromString("persp");
- else /* must be EXPP_CAM_TYPE_ORTHO */
- return PyString_FromString("ortho");
-}
-
-static int Camera_setType( BPy_Camera * self, PyObject * value )
-{
- char *type = NULL;
- type = PyString_AsString(value);
-
- if (!type)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected a string" );
- if (strcmp("persp", type)==0) {
- self->camera->type = EXPP_CAM_TYPE_PERSP;
- return 0;
- } else if (strcmp("ortho", type)==0) {
- self->camera->type = EXPP_CAM_TYPE_ORTHO;
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected a string \"ortho\" or \"persp\"" );
-}
-
-
-
-static PyObject *Camera_getMode( BPy_Camera * self )
-{
- return PyInt_FromLong(self->camera->flag);
-}
-
-static int Camera_setMode( BPy_Camera * self, PyObject * value )
-{
- unsigned int flag = 0;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an integer (bitmask) as argument" );
-
- flag = ( unsigned int )PyInt_AS_LONG( value );
-
- self->camera->flag = flag;
- return 0;
-}
-
-static PyObject *Camera_getIpo( BPy_Camera * self )
-{
- struct Ipo *ipo = self->camera->ipo;
-
- if( ipo )
- return Ipo_CreatePyObject( ipo );
- Py_RETURN_NONE;
-}
-
-static int Camera_setIpo( BPy_Camera * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->camera->ipo, 0, 1, ID_IP, ID_CA);
-}
-
-/*
- * get floating point attributes
- */
-
-static PyObject *getFloatAttr( BPy_Camera *self, void *type )
-{
- float param;
- struct Camera *cam= self->camera;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CAM_ATTR_LENS:
- param = cam->lens;
- break;
- case EXPP_CAM_ATTR_ANGLE:
- param = 360.0f * atan(16.0f/cam->lens) / M_PI;
- break;
- case EXPP_CAM_ATTR_DOFDIST:
- param = cam->YF_dofdist;
- break;
- case EXPP_CAM_ATTR_CLIPSTART:
- param = cam->clipsta;
- break;
- case EXPP_CAM_ATTR_CLIPEND:
- param = cam->clipend;
- break;
- case EXPP_CAM_ATTR_DRAWSIZE:
- param = cam->drawsize;
- break;
- case EXPP_CAM_ATTR_SCALE:
- param = cam->ortho_scale;
- break;
- case EXPP_CAM_ATTR_ALPHA:
- param = cam->passepartalpha;
- break;
- case EXPP_CAM_ATTR_SHIFTX:
- param = cam->shiftx;
- break;
- case EXPP_CAM_ATTR_SHIFTY:
- param = cam->shifty;
- break;
-
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getFloatAttr" );
- }
-
- return PyFloat_FromDouble( param );
-}
-
-
-
-/*
- * set floating point attributes which require clamping
- */
-
-static int setFloatAttrClamp( BPy_Camera *self, PyObject *value, void *type )
-{
- float *param;
- struct Camera *cam = self->camera;
- float min, max;
- int ret;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CAM_ATTR_LENS:
- min = 1.0;
- max = 250.0;
- param = &cam->lens;
- break;
- case EXPP_CAM_ATTR_ANGLE:
- min = 7.323871;
- max = 172.847331;
- param = &cam->lens;
- break;
- case EXPP_CAM_ATTR_DOFDIST:
- min = 0.0;
- max = 5000.0;
- param = &cam->YF_dofdist;
- break;
- case EXPP_CAM_ATTR_CLIPSTART:
- min = 0.0;
- max = 100.0;
- param = &cam->clipsta;
- break;
- case EXPP_CAM_ATTR_CLIPEND:
- min = 1.0;
- max = 5000.0;
- param = &cam->clipend;
- break;
- case EXPP_CAM_ATTR_DRAWSIZE:
- min = 0.1f;
- max = 10.0;
- param = &cam->drawsize;
- break;
- case EXPP_CAM_ATTR_SCALE:
- min = 0.01f;
- max = 1000.0;
- param = &cam->ortho_scale;
- break;
- case EXPP_CAM_ATTR_ALPHA:
- min = 0.0;
- max = 1.0;
- param = &cam->passepartalpha;
- break;
- case EXPP_CAM_ATTR_SHIFTX:
- min = -2.0;
- max = 2.0;
- param = &cam->shiftx;
- break;
- case EXPP_CAM_ATTR_SHIFTY:
- min = -2.0;
- max = 2.0;
- param = &cam->shifty;
- break;
-
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloatAttrClamp" );
- }
-
- ret = EXPP_setFloatClamped( value, param, min, max );
-
- if (ret==0) {
- if (GET_INT_FROM_POINTER(type) == EXPP_CAM_ATTR_ANGLE) {
- cam->lens = 16.0f / tan(M_PI*cam->lens/360.0f);
- }
- }
- return ret;
-}
-
-
-/*
- * get floating point attributes
- */
-
-static PyObject *getFlagAttr( BPy_Camera *self, void *type )
-{
- if (self->camera->flag & GET_INT_FROM_POINTER(type))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-/*
- * set floating point attributes which require clamping
- */
-
-static int setFlagAttr( BPy_Camera *self, PyObject *value, void *type )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param)
- self->camera->flag |= GET_INT_FROM_POINTER(type);
- else
- self->camera->flag &= ~GET_INT_FROM_POINTER(type);
- return 0;
-}
-
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Camera_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"type",
- (getter)Camera_getType, (setter)Camera_setType,
- "camera type \"persp\" or \"ortho\"",
- NULL},
- {"mode",
- (getter)Camera_getMode, (setter)Camera_setMode,
- "Cameras mode",
- NULL},
- {"ipo",
- (getter)Camera_getIpo, (setter)Camera_setIpo,
- "Cameras ipo",
- NULL},
-
- /* float settings */
- {"lens",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "lens angle for perspective cameras",
- (void *)EXPP_CAM_ATTR_LENS},
- {"angle",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "lens angle for perspective cameras",
- (void *)EXPP_CAM_ATTR_ANGLE},
-
- {"scale",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "scale for ortho cameras",
- (void *)EXPP_CAM_ATTR_SCALE},
- {"clipStart",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the cameras clip start",
- (void *)EXPP_CAM_ATTR_CLIPSTART},
- {"clipEnd",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the cameras clip end",
- (void *)EXPP_CAM_ATTR_CLIPEND},
- {"shiftX",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the cameras X perspective shift",
- (void *)EXPP_CAM_ATTR_SHIFTX},
- {"shiftY",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the cameras Y perspective shift",
- (void *)EXPP_CAM_ATTR_SHIFTY},
- {"dofDist",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "cameras dof distance",
- (void *)EXPP_CAM_ATTR_DOFDIST},
- {"drawSize",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the cameras display size",
- (void *)EXPP_CAM_ATTR_DRAWSIZE},
- {"alpha",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "passepart alpha value for display",
- (void *)EXPP_CAM_ATTR_ALPHA},
-
- /* flags - use flags as defined in DNA_camera_types.h */
- {"drawLimits",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the draw limits display flag",
- (void *)CAM_SHOWLIMITS},
- {"drawMist",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the draw mist display flag",
- (void *)CAM_SHOWMIST},
- {"drawName",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the draw name display flag",
- (void *)CAM_SHOWNAME},
- {"drawTileSafe",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the tile safe display flag",
- (void *)CAM_SHOWTITLESAFE},
- {"drawPassepartout",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the passPartOut display flag",
- (void *)CAM_SHOWPASSEPARTOUT},
- {"angleToggle",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "toggle the camera input unit flag",
- (void *)CAM_ANGLETOGGLE},
- {NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*****************************************************************************/
-/* Python Camera_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Camera_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Camera", /* char *tp_name; */
- sizeof( BPy_Camera ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Camera_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Camera_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Camera_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Camera_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-static int Camera_compare( BPy_Camera * a, BPy_Camera * b )
-{
- Camera *pa = a->camera, *pb = b->camera;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static PyObject *Camera_repr( BPy_Camera * self )
-{
- return PyString_FromFormat( "[Camera \"%s\"]",
- self->camera->id.name + 2 );
-}
-
-/*
- * Camera_insertIpoKey()
- * inserts Camera IPO key for LENS and CLIPPING
- */
-
-static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args )
-{
- int key = 0, flag = 0;
-
- if( !PyArg_ParseTuple( args, "i", &( key ) ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument" ) );
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- if (key == IPOKEY_LENS){
- insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, flag);
- }
- else if (key == IPOKEY_CLIPPING){
- insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, flag);
- insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, flag);
- }
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- Py_RETURN_NONE;
-}
diff --git a/source/blender/python/api2_2x/Camera.h b/source/blender/python/api2_2x/Camera.h
deleted file mode 100644
index 4751300c58c..00000000000
--- a/source/blender/python/api2_2x/Camera.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_CAMERA_H
-#define EXPP_CAMERA_H
-
-#include <Python.h>
-#include "DNA_camera_types.h"
-
-extern PyTypeObject Camera_Type;
-
-#define BPy_Camera_Check(v) \
- ((v)->ob_type == &Camera_Type) /* for type checking */
-
-/* Python BPy_Camera structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- Camera * camera;
-
-} BPy_Camera;
-
-/*****************************************************************************/
-/* Python BPy_Camera defaults: */
-/*****************************************************************************/
-
-/* Camera types */
-
-#define EXPP_CAM_TYPE_PERSP 0
-#define EXPP_CAM_TYPE_ORTHO 1
-
-/* Camera mode flags */
-
-#define EXPP_CAM_MODE_SHOWLIMITS 1
-#define EXPP_CAM_MODE_SHOWMIST 2
-
-/* Camera MIN, MAX values */
-
-#define EXPP_CAM_LENS_MIN 1.0
-#define EXPP_CAM_LENS_MAX 250.0
-#define EXPP_CAM_SCALE_MIN 0.01f
-#define EXPP_CAM_SCALE_MAX 1000.0
-#define EXPP_CAM_CLIPSTART_MIN 0.0
-#define EXPP_CAM_CLIPSTART_MAX 100.0
-#define EXPP_CAM_CLIPEND_MIN 1.0
-#define EXPP_CAM_CLIPEND_MAX 5000.0
-#define EXPP_CAM_DRAWSIZE_MIN 0.1f
-#define EXPP_CAM_DRAWSIZE_MAX 10.0
-
-PyObject *Camera_Init( void );
-PyObject *Camera_CreatePyObject( Camera * cam );
-Camera *Camera_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_CAMERA_H */
diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c
deleted file mode 100644
index b0b9aa04a08..00000000000
--- a/source/blender/python/api2_2x/Constraint.c
+++ /dev/null
@@ -1,2906 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Ken Hughes, Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Constraint.h" /*This must come first*/
-
-#include "DNA_armature_types.h"
-#include "DNA_object_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_text_types.h"
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BLI_blenlib.h"
-#include "BIF_editconstraint.h"
-#include "BIF_keyframing.h"
-#include "BIF_poseobject.h"
-#include "BSE_editipo.h"
-#include "MEM_guardedalloc.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "IDProp.h"
-#include "Object.h"
-#include "NLA.h"
-#include "Text.h"
-#include "gen_utils.h"
-
-enum constraint_constants {
- EXPP_CONSTR_XROT = 0,
- EXPP_CONSTR_YROT = 1,
- EXPP_CONSTR_ZROT = 2,
- EXPP_CONSTR_XSIZE = 10,
- EXPP_CONSTR_YSIZE = 11,
- EXPP_CONSTR_ZSIZE = 12,
- EXPP_CONSTR_XLOC = 20,
- EXPP_CONSTR_YLOC = 21,
- EXPP_CONSTR_ZLOC = 22,
-
- EXPP_CONSTR_MAXX = TRACK_X,
- EXPP_CONSTR_MAXY = TRACK_Y,
- EXPP_CONSTR_MAXZ = TRACK_Z,
- EXPP_CONSTR_MINX = TRACK_nX,
- EXPP_CONSTR_MINY = TRACK_nY,
- EXPP_CONSTR_MINZ = TRACK_nZ,
-
- EXPP_CONSTR_TARGET = 100,
- EXPP_CONSTR_STRETCH,
- EXPP_CONSTR_ITERATIONS,
- EXPP_CONSTR_BONE,
- EXPP_CONSTR_CHAINLEN,
- EXPP_CONSTR_POSWEIGHT,
- EXPP_CONSTR_ROTWEIGHT,
- EXPP_CONSTR_ROTATE,
- EXPP_CONSTR_USETIP,
-
- EXPP_CONSTR_ACTION,
- EXPP_CONSTR_START,
- EXPP_CONSTR_END,
- EXPP_CONSTR_MIN,
- EXPP_CONSTR_MAX,
- EXPP_CONSTR_KEYON,
-
- EXPP_CONSTR_TRACK,
- EXPP_CONSTR_UP,
-
- EXPP_CONSTR_RESTLENGTH,
- EXPP_CONSTR_VOLVARIATION,
- EXPP_CONSTR_VOLUMEMODE,
- EXPP_CONSTR_PLANE,
-
- EXPP_CONSTR_FOLLOW,
- EXPP_CONSTR_OFFSET,
- EXPP_CONSTR_FORWARD,
-
- EXPP_CONSTR_LOCK,
-
- EXPP_CONSTR_MINMAX,
- EXPP_CONSTR_STICKY,
-
- EXPP_CONSTR_COPY,
- EXPP_CONSTR_LIMIT,
- EXPP_CONSTR_CLAMP,
-
- EXPP_CONSTR_MODE,
-
- EXPP_CONSTR_LIMXMIN = LIMIT_XMIN,
- EXPP_CONSTR_LIMXMAX = LIMIT_XMAX,
- EXPP_CONSTR_LIMYMIN = LIMIT_YMIN,
- EXPP_CONSTR_LIMYMAX = LIMIT_YMAX,
- EXPP_CONSTR_LIMZMIN = LIMIT_ZMIN,
- EXPP_CONSTR_LIMZMAX = LIMIT_ZMAX,
-
- EXPP_CONSTR_LIMXROT = LIMIT_XROT,
- EXPP_CONSTR_LIMYROT = LIMIT_YROT,
- EXPP_CONSTR_LIMZROT = LIMIT_ZROT,
-
- EXPP_CONSTR_CLAMPCYCLIC,
-
- EXPP_CONSTR_XMIN,
- EXPP_CONSTR_XMAX,
- EXPP_CONSTR_YMIN,
- EXPP_CONSTR_YMAX,
- EXPP_CONSTR_ZMIN,
- EXPP_CONSTR_ZMAX,
-
- EXPP_CONSTR_SCRIPT,
- EXPP_CONSTR_PROPS,
-
- EXPP_CONSTR_FROM,
- EXPP_CONSTR_TO,
- EXPP_CONSTR_EXPO,
- EXPP_CONSTR_FROMMINX,
- EXPP_CONSTR_FROMMAXX,
- EXPP_CONSTR_FROMMINY,
- EXPP_CONSTR_FROMMAXY,
- EXPP_CONSTR_FROMMINZ,
- EXPP_CONSTR_FROMMAXZ,
- EXPP_CONSTR_TOMINX,
- EXPP_CONSTR_TOMAXX,
- EXPP_CONSTR_TOMINY,
- EXPP_CONSTR_TOMAXY,
- EXPP_CONSTR_TOMINZ,
- EXPP_CONSTR_TOMAXZ,
- EXPP_CONSTR_MAPX,
- EXPP_CONSTR_MAPY,
- EXPP_CONSTR_MAPZ,
-
- EXPP_CONSTR_OWNSPACE,
- EXPP_CONSTR_TARSPACE,
-
- EXPP_CONSTR_RB_TYPE,
- EXPP_CONSTR_RB_BALL,
- EXPP_CONSTR_RB_HINGE,
- EXPP_CONSTR_RB_GENERIC6DOF,
- EXPP_CONSTR_RB_VEHICLE,
- EXPP_CONSTR_RB_PIVX,
- EXPP_CONSTR_RB_PIVY,
- EXPP_CONSTR_RB_PIVZ,
- EXPP_CONSTR_RB_AXX,
- EXPP_CONSTR_RB_AXY,
- EXPP_CONSTR_RB_AXZ,
- EXPP_CONSTR_RB_MINLIMIT0,
- EXPP_CONSTR_RB_MINLIMIT1,
- EXPP_CONSTR_RB_MINLIMIT2,
- EXPP_CONSTR_RB_MINLIMIT3,
- EXPP_CONSTR_RB_MINLIMIT4,
- EXPP_CONSTR_RB_MINLIMIT5,
- EXPP_CONSTR_RB_MAXLIMIT0,
- EXPP_CONSTR_RB_MAXLIMIT1,
- EXPP_CONSTR_RB_MAXLIMIT2,
- EXPP_CONSTR_RB_MAXLIMIT3,
- EXPP_CONSTR_RB_MAXLIMIT4,
- EXPP_CONSTR_RB_MAXLIMIT5,
- EXPP_CONSTR_RB_EXTRAFZ,
- EXPP_CONSTR_RB_FLAG,
-
-};
-
-/*****************************************************************************/
-/* Python BPy_Constraint methods declarations: */
-/*****************************************************************************/
-static PyObject *Constraint_getName( BPy_Constraint * self );
-static int Constraint_setName( BPy_Constraint * self, PyObject *arg );
-static PyObject *Constraint_getType( BPy_Constraint * self );
-static PyObject *Constraint_getInfluence( BPy_Constraint * self );
-static int Constraint_setInfluence( BPy_Constraint * self, PyObject * arg );
-
-static PyObject *Constraint_insertKey( BPy_Constraint * self, PyObject * arg );
-
-static PyObject *Constraint_getData( BPy_Constraint * self, PyObject * key );
-static int Constraint_setData( BPy_Constraint * self, PyObject * key,
- PyObject * value );
-
-/*****************************************************************************/
-/* Python BPy_Constraint methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Constraint_methods[] = {
- /* name, method, flags, doc */
- {"insertKey", ( PyCFunction ) Constraint_insertKey, METH_O,
- "Insert influence keyframe for constraint"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Constraint attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Constraint_getseters[] = {
- {"name",
- (getter)Constraint_getName, (setter)Constraint_setName,
- "Constraint name", NULL},
- {"type",
- (getter)Constraint_getType, (setter)NULL,
- "Constraint type (read only)", NULL},
- {"influence",
- (getter)Constraint_getInfluence, (setter)Constraint_setInfluence,
- "Constraint influence", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Constraint_Type Mapping Methods table: */
-/*****************************************************************************/
-static PyMappingMethods Constraint_as_mapping = {
- NULL, /* mp_length */
- ( binaryfunc ) Constraint_getData, /* mp_subscript */
- ( objobjargproc ) Constraint_setData, /* mp_ass_subscript */
-};
-
-/*****************************************************************************/
-/* Python Constraint_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *Constraint_repr( BPy_Constraint * self );
-static int Constraint_compare( BPy_Constraint * a, BPy_Constraint * b );
-
-/*****************************************************************************/
-/* Python Constraint_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Constraint_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Constraint", /* char *tp_name; */
- sizeof( BPy_Constraint ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Constraint_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Constraint_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &Constraint_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Constraint_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Constraint_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Python BPy_Constraint methods: */
-/*****************************************************************************/
-
-/*
- * return the name of this constraint
- */
-
-static PyObject *Constraint_getName( BPy_Constraint * self )
-{
- if( !self->con )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- return PyString_FromString( self->con->name );
-}
-
-/*
- * set the name of this constraint
- */
-
-static int Constraint_setName( BPy_Constraint * self, PyObject * attr )
-{
- char *name = PyString_AsString( attr );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
-
- if( !self->con )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- BLI_strncpy( self->con->name, name, sizeof( self->con->name ) );
-
- return 0;
-}
-
-/*
- * return the influence of this constraint
- */
-
-static PyObject *Constraint_getInfluence( BPy_Constraint * self )
-{
- if( !self->con )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- return PyFloat_FromDouble( (double)self->con->enforce );
-}
-
-/*
- * set the influence of this constraint
- */
-
-static int Constraint_setInfluence( BPy_Constraint * self, PyObject * value )
-{
- if( !self->con )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->con->enforce, 0.0, 1.0 );
-}
-
-/*
- * return the type of this constraint
- */
-
-static PyObject *Constraint_getType( BPy_Constraint * self )
-{
- if( !self->con )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- return PyInt_FromLong( self->con->type );
-}
-
-/*
- * add keyframe for influence
- base on code in add_influence_key_to_constraint_func()
- */
-static PyObject *Constraint_insertKey( BPy_Constraint * self, PyObject * value )
-{
- bConstraint *con = self->con;
- Object *ob = self->obj;
- bPoseChannel *pchan = self->pchan;
- IpoCurve *icu;
- float cfra = (float)PyFloat_AsDouble(value);
- char actname[32] = "";
-
- if( !self->con )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- /* get frame for inserting key */
- if( PyFloat_Check(value) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a float argument" );
-
- /* find actname for locating that action-channel that a constraint channel should be added to */
- if (ob) {
- if (pchan) {
- /* actname is the name of the pchan that this constraint belongs to */
- BLI_strncpy(actname, pchan->name, 32);
- }
- else {
- /* hardcoded achan name -> "Object" (this may change in future) */
- strcpy(actname, "Object");
- }
- }
- else {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "constraint doesn't belong to anything" );
- }
- icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE, 1);
-
- if (!icu)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot get a curve from this IPO, may be using libdata" );
-
- if( ob->action )
- insert_vert_icu( icu, get_action_frame(ob, cfra), con->enforce, 0);
- else
- insert_vert_icu( icu, cfra, con->enforce, 0);
-
- Py_RETURN_NONE;
-}
-
-/******************************************************************************/
-/* Constraint Space Conversion get/set procedures */
-/* - These are called before/instead of individual constraint */
-/* get/set procedures when OWNERSPACE or TARGETSPACE are chosen */
-/* - They are only called from Constraint_g/setData */
-/******************************************************************************/
-
-static PyObject *constspace_getter( BPy_Constraint * self, int type )
-{
- bConstraint *con= (bConstraint *)(self->con);
-
- /* depends on type being asked for
- * NOTE: not all constraints support all space types
- */
- if (type == EXPP_CONSTR_OWNSPACE) {
- switch (con->type) {
- /* all of these support this... */
- case CONSTRAINT_TYPE_PYTHON:
- case CONSTRAINT_TYPE_LOCLIKE:
- case CONSTRAINT_TYPE_ROTLIKE:
- case CONSTRAINT_TYPE_SIZELIKE:
- case CONSTRAINT_TYPE_TRACKTO:
- case CONSTRAINT_TYPE_LOCLIMIT:
- case CONSTRAINT_TYPE_ROTLIMIT:
- case CONSTRAINT_TYPE_SIZELIMIT:
- case CONSTRAINT_TYPE_TRANSFORM:
- return PyInt_FromLong( (long)con->ownspace );
- }
- }
- else if (type == EXPP_CONSTR_TARSPACE) {
- switch (con->type) {
- /* all of these support this... */
- case CONSTRAINT_TYPE_PYTHON:
- case CONSTRAINT_TYPE_ACTION:
- case CONSTRAINT_TYPE_LOCLIKE:
- case CONSTRAINT_TYPE_ROTLIKE:
- case CONSTRAINT_TYPE_SIZELIKE:
- case CONSTRAINT_TYPE_TRACKTO:
- case CONSTRAINT_TYPE_TRANSFORM:
- {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- bConstraintTarget *ct;
- PyObject *tlist=NULL, *val;
-
- if (cti) {
- /* change space of targets */
- if (cti->get_constraint_targets) {
- ListBase targets = {NULL, NULL};
- int num_tars=0, i=0;
-
- /* get targets, and create py-list for use temporarily */
- num_tars= cti->get_constraint_targets(con, &targets);
- if (num_tars) {
- tlist= PyList_New(num_tars);
-
- for (ct=targets.first; ct; ct=ct->next, i++) {
- val= PyInt_FromLong((long)ct->space);
- PyList_SET_ITEM(tlist, i, val);
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 1);
- }
- }
-
- return tlist;
- }
- }
- }
-
- /* raise error if failed */
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
-}
-
-static int constspace_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bConstraint *con= (bConstraint *)(self->con);
-
- /* depends on type being asked for
- * NOTE: not all constraints support all space types
- */
- if (type == EXPP_CONSTR_OWNSPACE) {
- switch (con->type) {
- /* all of these support this... */
- case CONSTRAINT_TYPE_PYTHON:
- case CONSTRAINT_TYPE_LOCLIKE:
- case CONSTRAINT_TYPE_ROTLIKE:
- case CONSTRAINT_TYPE_SIZELIKE:
- case CONSTRAINT_TYPE_TRACKTO:
- case CONSTRAINT_TYPE_LOCLIMIT:
- case CONSTRAINT_TYPE_ROTLIMIT:
- case CONSTRAINT_TYPE_SIZELIMIT:
- case CONSTRAINT_TYPE_TRANSFORM:
- {
- /* only copy depending on ownertype */
- if (self->pchan) {
- return EXPP_setIValueClamped( value, &con->ownspace,
- CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_PARLOCAL, 'h' );
- }
- else {
- return EXPP_setIValueClamped( value, &con->ownspace,
- CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL, 'h' );
- }
- }
- break;
- }
- }
- else if (type == EXPP_CONSTR_TARSPACE) {
- switch (con->type) {
- /* all of these support this... */
- case CONSTRAINT_TYPE_PYTHON:
- case CONSTRAINT_TYPE_ACTION:
- case CONSTRAINT_TYPE_LOCLIKE:
- case CONSTRAINT_TYPE_ROTLIKE:
- case CONSTRAINT_TYPE_SIZELIKE:
- case CONSTRAINT_TYPE_TRACKTO:
- case CONSTRAINT_TYPE_TRANSFORM:
- {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- bConstraintTarget *ct;
- int ok= 0;
-
- if (cti) {
- /* change space of targets */
- if (cti->get_constraint_targets) {
- ListBase targets = {NULL, NULL};
- int num_tars=0, i=0;
-
- /* get targets, and extract values from the given list */
- num_tars= cti->get_constraint_targets(con, &targets);
- if (num_tars) {
- if ((PySequence_Check(value) == 0) || (PySequence_Size(value) != num_tars)) {
- char errorstr[64];
- sprintf(errorstr, "expected sequence of %d integer(s)", num_tars);
- return EXPP_ReturnIntError(PyExc_TypeError, errorstr);
- }
-
- for (ct=targets.first; ct; ct=ct->next, i++) {
- if (ct->tar && ct->subtarget[0]) {
- PyObject *val= PySequence_ITEM(value, i);
-
- ok += EXPP_setIValueClamped(val, &ct->space,
- CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_PARLOCAL, 'h' );
-
- Py_DECREF(val);
- }
- else if (ct->tar) {
- PyObject *val= PySequence_ITEM(value, i);
-
- ok += EXPP_setIValueClamped(val, &ct->space,
- CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL, 'h' );
-
- Py_DECREF(val);
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
-
- return ok;
- }
- break;
- }
- }
-
- /* raise error if failed */
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
-}
-
-/*****************************************************************************/
-/* Specific constraint get/set procedures */
-/*****************************************************************************/
-
-static PyObject *kinematic_getter( BPy_Constraint * self, int type )
-{
- bKinematicConstraint *con = (bKinematicConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_STRETCH:
- return PyBool_FromLong( (long)( con->flag & CONSTRAINT_IK_STRETCH ) ) ;
- case EXPP_CONSTR_ITERATIONS:
- return PyInt_FromLong( (long)con->iterations );
- case EXPP_CONSTR_CHAINLEN:
- return PyInt_FromLong( (long)con->rootbone );
- case EXPP_CONSTR_POSWEIGHT:
- return PyFloat_FromDouble( (double)con->weight );
- case EXPP_CONSTR_ROTWEIGHT:
- return PyFloat_FromDouble( (double)con->orientweight );
- case EXPP_CONSTR_ROTATE:
- return PyBool_FromLong( (long)( con->flag & CONSTRAINT_IK_ROT ) ) ;
- case EXPP_CONSTR_USETIP:
- return PyBool_FromLong( (long)( con->flag & CONSTRAINT_IK_TIP ) ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int kinematic_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bKinematicConstraint *con = (bKinematicConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_STRETCH:
- return EXPP_setBitfield( value, &con->flag, CONSTRAINT_IK_STRETCH, 'h' );
- case EXPP_CONSTR_ITERATIONS:
- return EXPP_setIValueClamped( value, &con->iterations, 1, 10000, 'h' );
- case EXPP_CONSTR_CHAINLEN:
- return EXPP_setIValueClamped( value, &con->rootbone, 0, 255, 'i' );
- case EXPP_CONSTR_POSWEIGHT:
- return EXPP_setFloatClamped( value, &con->weight, 0.01f, 1.0 );
- case EXPP_CONSTR_ROTWEIGHT:
- return EXPP_setFloatClamped( value, &con->orientweight, 0.01f, 1.0 );
- case EXPP_CONSTR_ROTATE:
- return EXPP_setBitfield( value, &con->flag, CONSTRAINT_IK_ROT, 'h' );
- case EXPP_CONSTR_USETIP:
- return EXPP_setBitfield( value, &con->flag, CONSTRAINT_IK_TIP, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *action_getter( BPy_Constraint * self, int type )
-{
- bActionConstraint *con = (bActionConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_ACTION:
- return Action_CreatePyObject( con->act );
- case EXPP_CONSTR_START:
- return PyInt_FromLong( (long)con->start );
- case EXPP_CONSTR_END:
- return PyInt_FromLong( (long)con->end );
- case EXPP_CONSTR_MIN:
- return PyFloat_FromDouble( (double)con->min );
- case EXPP_CONSTR_MAX:
- return PyFloat_FromDouble( (double)con->max );
- case EXPP_CONSTR_KEYON:
- return PyInt_FromLong( (long)con->type );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int action_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bActionConstraint *con = (bActionConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_ACTION: {
- bAction *act = (( BPy_Action * )value)->action;
- if( !BPy_Action_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy action argument" );
- con->act = act;
- return 0;
- }
- case EXPP_CONSTR_START:
- return EXPP_setIValueClamped( value, &con->start, 1, MAXFRAME, 'h' );
- case EXPP_CONSTR_END:
- return EXPP_setIValueClamped( value, &con->end, 1, MAXFRAME, 'h' );
- case EXPP_CONSTR_MIN:
- if (con->type < 10)
- return EXPP_setFloatClamped( value, &con->min, -180.0, 180.0 );
- else if (con->type < 20)
- return EXPP_setFloatClamped( value, &con->min, 0.0001, 1000.0 );
- else
- return EXPP_setFloatClamped( value, &con->min, -1000.0, 1000.0 );
- case EXPP_CONSTR_MAX:
- if (con->type < 10)
- return EXPP_setFloatClamped( value, &con->max, -180.0, 180.0 );
- else if (con->type < 20)
- return EXPP_setFloatClamped( value, &con->max, 0.0001, 1000.0 );
- else
- return EXPP_setFloatClamped( value, &con->max, -1000.0, 1000.0 );
- case EXPP_CONSTR_KEYON:
- return EXPP_setIValueRange( value, &con->type,
- EXPP_CONSTR_XROT, EXPP_CONSTR_ZLOC, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *trackto_getter( BPy_Constraint * self, int type )
-{
- bTrackToConstraint *con = (bTrackToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_TRACK:
- return PyInt_FromLong( (long)con->reserved1 );
- case EXPP_CONSTR_UP:
- return PyInt_FromLong( (long)con->reserved2 );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int trackto_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bTrackToConstraint *con = (bTrackToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_TRACK:
- return EXPP_setIValueRange( value, &con->reserved1,
- TRACK_X, TRACK_nZ, 'i' );
- case EXPP_CONSTR_UP:
- return EXPP_setIValueRange( value, &con->reserved2,
- UP_X, UP_Z, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *stretchto_getter( BPy_Constraint * self, int type )
-{
- bStretchToConstraint *con = (bStretchToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_RESTLENGTH:
- return PyFloat_FromDouble( (double)con->orglength );
- case EXPP_CONSTR_VOLVARIATION:
- return PyFloat_FromDouble( (double)con->bulge );
- case EXPP_CONSTR_VOLUMEMODE:
- return PyInt_FromLong( (long)con->volmode );
- case EXPP_CONSTR_PLANE:
- return PyInt_FromLong( (long)con->plane );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int stretchto_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bStretchToConstraint *con = (bStretchToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_RESTLENGTH:
- return EXPP_setFloatClamped( value, &con->orglength, 0.0, 100.0 );
- case EXPP_CONSTR_VOLVARIATION:
- return EXPP_setFloatClamped( value, &con->bulge, 0.0, 100.0 );
- case EXPP_CONSTR_VOLUMEMODE:
- return EXPP_setIValueRange( value, &con->volmode,
- VOLUME_XZ, NO_VOLUME, 'h' );
- case EXPP_CONSTR_PLANE: {
- int status, oldcode = con->plane;
- status = EXPP_setIValueRange( value, &con->plane,
- PLANE_X, PLANE_Z, 'h' );
- if( !status && con->plane == PLANE_Y ) {
- con->plane = oldcode;
- return EXPP_ReturnIntError( PyExc_ValueError,
- "value must be either PLANEX or PLANEZ" );
- }
- return status;
- }
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *distlimit_getter( BPy_Constraint * self, int type )
-{
- bDistLimitConstraint *con = (bDistLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_RESTLENGTH:
- return PyFloat_FromDouble( (double)con->dist );
- case EXPP_CONSTR_MODE:
- return PyInt_FromLong( (long)con->mode );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int distlimit_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bDistLimitConstraint *con = (bDistLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_RESTLENGTH:
- return EXPP_setFloatClamped( value, &con->dist, 0.0, 100.0 );
- case EXPP_CONSTR_MODE:
- return EXPP_setIValueRange( value, &con->mode, LIMITDIST_INSIDE, LIMITDIST_ONSURFACE, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *followpath_getter( BPy_Constraint * self, int type )
-{
- bFollowPathConstraint *con = (bFollowPathConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_FOLLOW:
- return PyBool_FromLong( (long)( con->followflag & SELECT ) );
- case EXPP_CONSTR_OFFSET:
- return PyFloat_FromDouble( (double)con->offset );
- case EXPP_CONSTR_FORWARD:
- return PyInt_FromLong( (long)con->trackflag );
- case EXPP_CONSTR_UP:
- return PyInt_FromLong( (long)con->upflag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int followpath_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bFollowPathConstraint *con = (bFollowPathConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_FOLLOW:
- return EXPP_setBitfield( value, &con->followflag, SELECT, 'i' );
- case EXPP_CONSTR_OFFSET:
- return EXPP_setFloatClamped( value, &con->offset,
- -MAXFRAMEF, MAXFRAMEF );
- case EXPP_CONSTR_FORWARD:
- return EXPP_setIValueRange( value, &con->trackflag,
- TRACK_X, TRACK_nZ, 'i' );
- case EXPP_CONSTR_UP:
- return EXPP_setIValueRange( value, &con->upflag,
- UP_X, UP_Z, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *clampto_getter( BPy_Constraint * self, int type )
-{
- bClampToConstraint *con = (bClampToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_CLAMP:
- return PyInt_FromLong( (long)con->flag );
- case EXPP_CONSTR_CLAMPCYCLIC:
- return PyBool_FromLong( (long)(con->flag2 & CLAMPTO_CYCLIC) );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int clampto_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bClampToConstraint *con = (bClampToConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_CLAMP:
- return EXPP_setIValueRange( value, &con->flag,
- CLAMPTO_AUTO, CLAMPTO_Z, 'i' );
- case EXPP_CONSTR_CLAMPCYCLIC:
- return EXPP_setBitfield( value, &con->flag2, CLAMPTO_CYCLIC, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-static PyObject *locktrack_getter( BPy_Constraint * self, int type )
-{
- bLockTrackConstraint *con = (bLockTrackConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_TRACK:
- return PyInt_FromLong( (long)con->trackflag );
- case EXPP_CONSTR_LOCK:
- return PyInt_FromLong( (long)con->lockflag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int locktrack_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bLockTrackConstraint *con = (bLockTrackConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_TRACK:
- return EXPP_setIValueRange( value, &con->trackflag,
- TRACK_X, TRACK_nZ, 'i' );
- case EXPP_CONSTR_LOCK:
- return EXPP_setIValueRange( value, &con->lockflag,
- LOCK_X, LOCK_Z, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *floor_getter( BPy_Constraint * self, int type )
-{
- bMinMaxConstraint *con = (bMinMaxConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_MINMAX:
- return PyInt_FromLong( (long)con->minmaxflag );
- case EXPP_CONSTR_OFFSET:
- return PyFloat_FromDouble( (double)con->offset );
- case EXPP_CONSTR_STICKY:
- return PyBool_FromLong( (long)( con->flag & MINMAX_STICKY ) ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int floor_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bMinMaxConstraint *con = (bMinMaxConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_MINMAX:
- return EXPP_setIValueRange( value, &con->minmaxflag,
- EXPP_CONSTR_MAXX, EXPP_CONSTR_MINZ, 'i' );
- case EXPP_CONSTR_OFFSET:
- return EXPP_setFloatClamped( value, &con->offset, -100.0, 100.0 );
- case EXPP_CONSTR_STICKY:
- return EXPP_setBitfield( value, &con->flag, MINMAX_STICKY, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *locatelike_getter( BPy_Constraint * self, int type )
-{
- bLocateLikeConstraint *con = (bLocateLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_COPY:
- return PyInt_FromLong( (long)con->flag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int locatelike_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bLocateLikeConstraint *con = (bLocateLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_COPY:
- return EXPP_setIValueRange( value, &con->flag,
- 0, LOCLIKE_X | LOCLIKE_Y | LOCLIKE_Z | LOCLIKE_X_INVERT | LOCLIKE_Y_INVERT | LOCLIKE_Z_INVERT, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *rotatelike_getter( BPy_Constraint * self, int type )
-{
- bRotateLikeConstraint *con = (bRotateLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_COPY:
- return PyInt_FromLong( (long)con->flag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int rotatelike_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bRotateLikeConstraint *con = (bRotateLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_COPY:
- return EXPP_setIValueRange( value, &con->flag,
- 0, ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z | ROTLIKE_X_INVERT | ROTLIKE_Y_INVERT | ROTLIKE_Z_INVERT, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *sizelike_getter( BPy_Constraint * self, int type )
-{
- bSizeLikeConstraint *con = (bSizeLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_COPY:
- return PyInt_FromLong( (long)con->flag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int sizelike_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bSizeLikeConstraint *con = (bSizeLikeConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_COPY:
- return EXPP_setIValueRange( value, &con->flag,
- 0, SIZELIKE_X | SIZELIKE_Y | SIZELIKE_Z, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *loclimit_getter( BPy_Constraint * self, int type)
-{
- bLocLimitConstraint *con = (bLocLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return PyInt_FromLong( (long)con->flag );
- case EXPP_CONSTR_XMIN:
- return PyFloat_FromDouble( (double)con->xmin );
- case EXPP_CONSTR_XMAX:
- return PyFloat_FromDouble( (double)con->xmax );
- case EXPP_CONSTR_YMIN:
- return PyFloat_FromDouble( (double)con->ymin );
- case EXPP_CONSTR_YMAX:
- return PyFloat_FromDouble( (double)con->ymax );
- case EXPP_CONSTR_ZMIN:
- return PyFloat_FromDouble( (double)con->zmin );
- case EXPP_CONSTR_ZMAX:
- return PyFloat_FromDouble( (double)con->zmax );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int loclimit_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bLocLimitConstraint *con = (bLocLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return EXPP_setIValueRange( value, &con->flag, 0,
- LIMIT_XMIN | LIMIT_XMAX | LIMIT_YMIN | LIMIT_YMAX | LIMIT_ZMIN | LIMIT_ZMAX , 'i' );
- case EXPP_CONSTR_XMIN:
- return EXPP_setFloatClamped( value, &con->xmin, -1000.0, 1000.0 );
- case EXPP_CONSTR_XMAX:
- return EXPP_setFloatClamped( value, &con->xmax, -1000.0, 1000.0 );
- case EXPP_CONSTR_YMIN:
- return EXPP_setFloatClamped( value, &con->ymin, -1000.0, 1000.0 );
- case EXPP_CONSTR_YMAX:
- return EXPP_setFloatClamped( value, &con->ymax, -1000.0, 1000.0 );
- case EXPP_CONSTR_ZMIN:
- return EXPP_setFloatClamped( value, &con->zmin, -1000.0, 1000.0 );
- case EXPP_CONSTR_ZMAX:
- return EXPP_setFloatClamped( value, &con->zmax, -1000.0, 1000.0 );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *rotlimit_getter( BPy_Constraint * self, int type )
-{
- bRotLimitConstraint *con = (bRotLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return PyInt_FromLong( (long)con->flag );
- case EXPP_CONSTR_XMIN:
- return PyFloat_FromDouble( (double)con->xmin );
- case EXPP_CONSTR_XMAX:
- return PyFloat_FromDouble( (double)con->xmax );
- case EXPP_CONSTR_YMIN:
- return PyFloat_FromDouble( (double)con->ymin );
- case EXPP_CONSTR_YMAX:
- return PyFloat_FromDouble( (double)con->ymax );
- case EXPP_CONSTR_ZMIN:
- return PyFloat_FromDouble( (double)con->zmin );
- case EXPP_CONSTR_ZMAX:
- return PyFloat_FromDouble( (double)con->zmax );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int rotlimit_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bRotLimitConstraint *con = (bRotLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return EXPP_setIValueRange( value, &con->flag, 0,
- LIMIT_XROT | LIMIT_YROT | LIMIT_ZROT, 'i' );
- case EXPP_CONSTR_XMIN:
- return EXPP_setFloatClamped( value, &con->xmin, -360.0, 360.0 );
- case EXPP_CONSTR_XMAX:
- return EXPP_setFloatClamped( value, &con->xmax, -360.0, 360.0 );
- case EXPP_CONSTR_YMIN:
- return EXPP_setFloatClamped( value, &con->ymin, -360.0, 360.0 );
- case EXPP_CONSTR_YMAX:
- return EXPP_setFloatClamped( value, &con->ymax, -360.0, 360.0 );
- case EXPP_CONSTR_ZMIN:
- return EXPP_setFloatClamped( value, &con->zmin, -360.0, 360.0 );
- case EXPP_CONSTR_ZMAX:
- return EXPP_setFloatClamped( value, &con->zmax, -360.0, 360.0 );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *sizelimit_getter( BPy_Constraint * self, int type)
-{
- bSizeLimitConstraint *con = (bSizeLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return PyInt_FromLong( (long)con->flag );
- case EXPP_CONSTR_XMIN:
- return PyFloat_FromDouble( (double)con->xmin );
- case EXPP_CONSTR_XMAX:
- return PyFloat_FromDouble( (double)con->xmax );
- case EXPP_CONSTR_YMIN:
- return PyFloat_FromDouble( (double)con->ymin );
- case EXPP_CONSTR_YMAX:
- return PyFloat_FromDouble( (double)con->ymax );
- case EXPP_CONSTR_ZMIN:
- return PyFloat_FromDouble( (double)con->zmin );
- case EXPP_CONSTR_ZMAX:
- return PyFloat_FromDouble( (double)con->zmax );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int sizelimit_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bSizeLimitConstraint *con = (bSizeLimitConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_LIMIT:
- return EXPP_setIValueRange( value, &con->flag, 0,
- LIMIT_XMIN | LIMIT_XMAX | LIMIT_YMIN | LIMIT_YMAX | LIMIT_ZMIN | LIMIT_ZMAX, 'i' );
- case EXPP_CONSTR_XMIN:
- return EXPP_setFloatClamped( value, &con->xmin, -1000.0, 1000.0 );
- case EXPP_CONSTR_XMAX:
- return EXPP_setFloatClamped( value, &con->xmax, -1000.0, 1000.0 );
- case EXPP_CONSTR_YMIN:
- return EXPP_setFloatClamped( value, &con->ymin, -1000.0, 1000.0 );
- case EXPP_CONSTR_YMAX:
- return EXPP_setFloatClamped( value, &con->ymax, -1000.0, 1000.0 );
- case EXPP_CONSTR_ZMIN:
- return EXPP_setFloatClamped( value, &con->zmin, -1000.0, 1000.0 );
- case EXPP_CONSTR_ZMAX:
- return EXPP_setFloatClamped( value, &con->zmax, -1000.0, 1000.0 );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *script_getter( BPy_Constraint * self, int type )
-{
- bPythonConstraint *con = (bPythonConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- case EXPP_CONSTR_BONE:
- {
- bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_PYTHON);
- bConstraintTarget *ct;
- PyObject *tlist=NULL, *val;
-
- if (cti) {
- /* change space of targets */
- if (cti->get_constraint_targets) {
- ListBase targets = {NULL, NULL};
- int num_tars=0, i=0;
-
- /* get targets, and create py-list for use temporarily */
- num_tars= cti->get_constraint_targets(self->con, &targets);
- if (num_tars) {
- tlist= PyList_New(num_tars);
-
- for (ct=targets.first; ct; ct=ct->next, i++) {
- if (type == EXPP_CONSTR_BONE)
- val= PyString_FromString(ct->subtarget);
- else
- val= Object_CreatePyObject(ct->tar);
- PyList_SET_ITEM(tlist, i, val);
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(self->con, &targets, 1);
- }
- }
-
- return tlist;
- }
- case EXPP_CONSTR_SCRIPT:
- return Text_CreatePyObject( con->text );
- case EXPP_CONSTR_PROPS:
- return BPy_Wrap_IDProperty( NULL, con->prop, NULL);
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int script_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bPythonConstraint *con = (bPythonConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- case EXPP_CONSTR_BONE:
- {
- bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_PYTHON);
- bConstraintTarget *ct;
- int ok= 0;
-
- if (cti) {
- /* change space of targets */
- if (cti->get_constraint_targets) {
- ListBase targets = {NULL, NULL};
- int num_tars=0, i=0;
-
- /* get targets, and extract values from the given list */
- num_tars= cti->get_constraint_targets(self->con, &targets);
- if (num_tars) {
- if ((PySequence_Check(value) == 0) || (PySequence_Size(value) != num_tars)) {
- char errorstr[64];
- sprintf(errorstr, "expected sequence of %d integer(s)", num_tars);
- return EXPP_ReturnIntError(PyExc_TypeError, errorstr);
- }
-
- for (ct=targets.first; ct; ct=ct->next, i++) {
- PyObject *val= PySequence_ITEM(value, i);
-
- if (type == EXPP_CONSTR_BONE) {
- char *name = PyString_AsString(val);
-
- if (name == NULL) {
- // hrm... should we break here instead?
- ok = EXPP_ReturnIntError(PyExc_TypeError,
- "expected string arg as member of list");
- Py_DECREF(val);
-
- break;
- }
-
- BLI_strncpy(ct->subtarget, name, sizeof(ct->subtarget));
- }
- else {
- Object *obj = (( BPy_Object * )val)->object;
-
- if ( !BPy_Object_Check(value) ) {
- // hrm... should we break here instead?
- ok = EXPP_ReturnIntError(PyExc_TypeError,
- "expected BPy object argument as member of list");
- Py_DECREF(val);
-
- break;
- }
-
- ct->tar = obj;
- }
-
- Py_DECREF(val);
- }
- }
-
- /* only flush changes to real constraints if all were successful */
- if ((cti->flush_constraint_targets) && (ok == 0))
- cti->flush_constraint_targets(self->con, &targets, 0);
- }
- }
-
- return ok;
- }
- break;
- case EXPP_CONSTR_SCRIPT: {
- Text *text = (( BPy_Text * )value)->text;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy text argument" );
- con->text = text;
- return 0;
- }
- case EXPP_CONSTR_PROPS:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "setting ID-Properties of PyConstraints this way is not supported" );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-
-static PyObject *rigidbody_getter( BPy_Constraint * self, int type)
-{
- bRigidBodyJointConstraint *con = (bRigidBodyJointConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_RB_PIVX:
- return PyFloat_FromDouble( (double)con->pivX );
- case EXPP_CONSTR_RB_PIVY:
- return PyFloat_FromDouble( (double)con->pivY );
- case EXPP_CONSTR_RB_PIVZ:
- return PyFloat_FromDouble( (double)con->pivZ );
- case EXPP_CONSTR_RB_AXX:
- return PyFloat_FromDouble( (double)con->axX );
- case EXPP_CONSTR_RB_AXY:
- return PyFloat_FromDouble( (double)con->axY );
- case EXPP_CONSTR_RB_AXZ:
- return PyFloat_FromDouble( (double)con->axZ );
- case EXPP_CONSTR_RB_MINLIMIT0:
- return PyFloat_FromDouble( (double)con->minLimit[0] );
- case EXPP_CONSTR_RB_MINLIMIT1:
- return PyFloat_FromDouble( (double)con->minLimit[1] );
- case EXPP_CONSTR_RB_MINLIMIT2:
- return PyFloat_FromDouble( (double)con->minLimit[2] );
- case EXPP_CONSTR_RB_MINLIMIT3:
- return PyFloat_FromDouble( (double)con->minLimit[3] );
- case EXPP_CONSTR_RB_MINLIMIT4:
- return PyFloat_FromDouble( (double)con->minLimit[4] );
- case EXPP_CONSTR_RB_MINLIMIT5:
- return PyFloat_FromDouble( (double)con->minLimit[5] );
- case EXPP_CONSTR_RB_MAXLIMIT0:
- return PyFloat_FromDouble( (double)con->maxLimit[0] );
- case EXPP_CONSTR_RB_MAXLIMIT1:
- return PyFloat_FromDouble( (double)con->maxLimit[1] );
- case EXPP_CONSTR_RB_MAXLIMIT2:
- return PyFloat_FromDouble( (double)con->maxLimit[2] );
- case EXPP_CONSTR_RB_MAXLIMIT3:
- return PyFloat_FromDouble( (double)con->maxLimit[3] );
- case EXPP_CONSTR_RB_MAXLIMIT4:
- return PyFloat_FromDouble( (double)con->maxLimit[4] );
- case EXPP_CONSTR_RB_MAXLIMIT5:
- return PyFloat_FromDouble( (double)con->maxLimit[5] );
- case EXPP_CONSTR_RB_EXTRAFZ:
- return PyFloat_FromDouble( (double)con->extraFz );
- case EXPP_CONSTR_LIMIT:
- return PyInt_FromLong( (int)con->flag );
-
- case EXPP_CONSTR_RB_TYPE:
- return PyInt_FromLong( (int)con->type );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-
-static int rigidbody_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bRigidBodyJointConstraint *con = (bRigidBodyJointConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_RB_PIVX:
- return EXPP_setFloatClamped( value, &con->pivX , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_PIVY:
- return EXPP_setFloatClamped( value, &con->pivY , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_PIVZ:
- return EXPP_setFloatClamped( value, &con->pivZ , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_AXX:
- return EXPP_setFloatClamped( value, &con->axX , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_AXY:
- return EXPP_setFloatClamped( value, &con->axY , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_AXZ:
- return EXPP_setFloatClamped( value, &con->axZ , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT0:
- return EXPP_setFloatClamped( value, &con->minLimit[0] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT1:
- return EXPP_setFloatClamped( value, &con->minLimit[1] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT2:
- return EXPP_setFloatClamped( value, &con->minLimit[2] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT3:
- return EXPP_setFloatClamped( value, &con->minLimit[3] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT4:
- return EXPP_setFloatClamped( value, &con->minLimit[4] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MINLIMIT5:
- return EXPP_setFloatClamped( value, &con->minLimit[5] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT0:
- return EXPP_setFloatClamped( value, &con->maxLimit[0] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT1:
- return EXPP_setFloatClamped( value, &con->maxLimit[1] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT2:
- return EXPP_setFloatClamped( value, &con->maxLimit[2] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT3:
- return EXPP_setFloatClamped( value, &con->maxLimit[3] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT4:
- return EXPP_setFloatClamped( value, &con->maxLimit[4] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_MAXLIMIT5:
- return EXPP_setFloatClamped( value, &con->maxLimit[5] , -1000.0, 1000.0 );
- case EXPP_CONSTR_RB_EXTRAFZ:
- return EXPP_setFloatClamped( value, &con->extraFz , -1000.0, 1000.0 );
- case EXPP_CONSTR_LIMIT:
- return EXPP_setIValueRange( value, &con->flag, 0,
- LIMIT_XMIN | LIMIT_XMAX | LIMIT_YMIN | LIMIT_YMAX | LIMIT_ZMIN | LIMIT_ZMAX, 'i' );
- case EXPP_CONSTR_RB_TYPE:
- return EXPP_setIValueRange( value, &con->type, 0,
- EXPP_CONSTR_RB_BALL | EXPP_CONSTR_RB_HINGE | EXPP_CONSTR_RB_GENERIC6DOF | EXPP_CONSTR_RB_VEHICLE, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *childof_getter( BPy_Constraint * self, int type )
-{
- bChildOfConstraint *con = (bChildOfConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_COPY:
- return PyInt_FromLong( (long)con->flag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int childof_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bChildOfConstraint *con = (bChildOfConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_COPY:
- return EXPP_setIValueRange( value, &con->flag,
- 0, CHILDOF_LOCX| CHILDOF_LOCY | CHILDOF_LOCZ | CHILDOF_ROTX | CHILDOF_ROTY | CHILDOF_ROTZ |
- CHILDOF_SIZEX |CHILDOF_SIZEY| CHILDOF_SIZEZ, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *transf_getter( BPy_Constraint * self, int type )
-{
- bTransformConstraint *con = (bTransformConstraint *)(self->con->data);
-
- switch( type ) {
- case EXPP_CONSTR_TARGET:
- return Object_CreatePyObject( con->tar );
- case EXPP_CONSTR_BONE:
- return PyString_FromString( con->subtarget );
- case EXPP_CONSTR_FROM:
- return PyInt_FromLong( (long)con->from );
- case EXPP_CONSTR_TO:
- return PyInt_FromLong( (long)con->to );
- case EXPP_CONSTR_MAPX:
- return PyInt_FromLong( (long)con->map[0] );
- case EXPP_CONSTR_MAPY:
- return PyInt_FromLong( (long)con->map[1] );
- case EXPP_CONSTR_MAPZ:
- return PyInt_FromLong( (long)con->map[2] );
- case EXPP_CONSTR_FROMMINX:
- return PyFloat_FromDouble( (double)con->from_min[0] );
- case EXPP_CONSTR_FROMMAXX:
- return PyFloat_FromDouble( (double)con->from_max[0] );
- case EXPP_CONSTR_FROMMINY:
- return PyFloat_FromDouble( (double)con->from_min[1] );
- case EXPP_CONSTR_FROMMAXY:
- return PyFloat_FromDouble( (double)con->from_max[1] );
- case EXPP_CONSTR_FROMMINZ:
- return PyFloat_FromDouble( (double)con->from_min[2] );
- case EXPP_CONSTR_FROMMAXZ:
- return PyFloat_FromDouble( (double)con->from_max[2] );
- case EXPP_CONSTR_TOMINX:
- return PyFloat_FromDouble( (double)con->to_min[0] );
- case EXPP_CONSTR_TOMAXX:
- return PyFloat_FromDouble( (double)con->to_max[0] );
- case EXPP_CONSTR_TOMINY:
- return PyFloat_FromDouble( (double)con->to_min[1] );
- case EXPP_CONSTR_TOMAXY:
- return PyFloat_FromDouble( (double)con->to_max[1] );
- case EXPP_CONSTR_TOMINZ:
- return PyFloat_FromDouble( (double)con->to_min[2] );
- case EXPP_CONSTR_TOMAXZ:
- return PyFloat_FromDouble( (double)con->to_max[2] );
- case EXPP_CONSTR_EXPO:
- return PyBool_FromLong( (long)con->expo );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int transf_setter( BPy_Constraint *self, int type, PyObject *value )
-{
- bTransformConstraint *con = (bTransformConstraint *)(self->con->data);
- float fmin, fmax, tmin, tmax;
-
- if (con->from == 2) {
- fmin = 0.0001;
- fmax = 1000.0;
- }
- else if (con->from == 1) {
- fmin = -360.0;
- fmax = 360.0;
- }
- else {
- fmin = -1000.0;
- fmax = 1000.0;
- }
-
- if (con->to == 2) {
- tmin = 0.0001;
- tmax = 1000.0;
- }
- else if (con->to == 1) {
- tmin = -360.0;
- tmax = 360.0;
- }
- else {
- tmin = -1000.0;
- tmax = 1000.0;
- }
-
- switch( type ) {
- case EXPP_CONSTR_TARGET: {
- Object *obj = (( BPy_Object * )value)->object;
- if( !BPy_Object_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected BPy object argument" );
- con->tar = obj;
- return 0;
- }
- case EXPP_CONSTR_BONE: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
-
- BLI_strncpy( con->subtarget, name, sizeof( con->subtarget ) );
-
- return 0;
- }
- case EXPP_CONSTR_FROM:
- return EXPP_setIValueClamped( value, &con->from, 0, 3, 'h' );
- case EXPP_CONSTR_TO:
- return EXPP_setIValueClamped( value, &con->to, 0, 3, 'h' );
- case EXPP_CONSTR_MAPX:
- return EXPP_setIValueClamped( value, &con->map[0], 0, 3, 'h' );
- case EXPP_CONSTR_MAPY:
- return EXPP_setIValueClamped( value, &con->map[1], 0, 3, 'h' );
- case EXPP_CONSTR_MAPZ:
- return EXPP_setIValueClamped( value, &con->map[2], 0, 3, 'h' );
- case EXPP_CONSTR_FROMMINX:
- return EXPP_setFloatClamped( value, &con->from_min[0], fmin, fmax );
- case EXPP_CONSTR_FROMMAXX:
- return EXPP_setFloatClamped( value, &con->from_max[0], fmin, fmax );
- case EXPP_CONSTR_FROMMINY:
- return EXPP_setFloatClamped( value, &con->from_min[1], fmin, fmax );
- case EXPP_CONSTR_FROMMAXY:
- return EXPP_setFloatClamped( value, &con->from_max[1], fmin, fmax );
- case EXPP_CONSTR_FROMMINZ:
- return EXPP_setFloatClamped( value, &con->from_min[2], fmin, fmax );
- case EXPP_CONSTR_FROMMAXZ:
- return EXPP_setFloatClamped( value, &con->from_max[2], fmin, fmax );
- case EXPP_CONSTR_TOMINX:
- return EXPP_setFloatClamped( value, &con->to_min[0], tmin, tmax );
- case EXPP_CONSTR_TOMAXX:
- return EXPP_setFloatClamped( value, &con->to_max[0], tmin, tmax );
- case EXPP_CONSTR_TOMINY:
- return EXPP_setFloatClamped( value, &con->to_min[1], tmin, tmax );
- case EXPP_CONSTR_TOMAXY:
- return EXPP_setFloatClamped( value, &con->to_max[1], tmin, tmax );
- case EXPP_CONSTR_TOMINZ:
- return EXPP_setFloatClamped( value, &con->to_min[2], tmin, tmax );
- case EXPP_CONSTR_TOMAXZ:
- return EXPP_setFloatClamped( value, &con->to_max[2], tmin, tmax );
- case EXPP_CONSTR_EXPO:
- return EXPP_setBitfield( value, &con->expo, 1, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-/*
- * get data from a constraint
- */
-
-static PyObject *Constraint_getData( BPy_Constraint * self, PyObject * key )
-{
- int setting;
-
- if( !PyInt_Check( key ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int arg" );
-
- if( !self->con )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- setting = PyInt_AsLong( key );
-
- /* bypass doing settings of individual constraints, if we're just doing
- * constraint space access-stuff
- */
- if ((setting==EXPP_CONSTR_OWNSPACE) || (setting==EXPP_CONSTR_TARSPACE)) {
- return constspace_getter( self, setting );
- }
- switch( self->con->type ) {
- case CONSTRAINT_TYPE_NULL:
- Py_RETURN_NONE;
- case CONSTRAINT_TYPE_TRACKTO:
- return trackto_getter( self, setting );
- case CONSTRAINT_TYPE_KINEMATIC:
- return kinematic_getter( self, setting );
- case CONSTRAINT_TYPE_FOLLOWPATH:
- return followpath_getter( self, setting );
- case CONSTRAINT_TYPE_ACTION:
- return action_getter( self, setting );
- case CONSTRAINT_TYPE_LOCKTRACK:
- return locktrack_getter( self, setting );
- case CONSTRAINT_TYPE_STRETCHTO:
- return stretchto_getter( self, setting );
- case CONSTRAINT_TYPE_MINMAX:
- return floor_getter( self, setting );
- case CONSTRAINT_TYPE_LOCLIKE:
- return locatelike_getter( self, setting );
- case CONSTRAINT_TYPE_ROTLIKE:
- return rotatelike_getter( self, setting );
- case CONSTRAINT_TYPE_SIZELIKE:
- return sizelike_getter( self, setting );
- case CONSTRAINT_TYPE_ROTLIMIT:
- return rotlimit_getter( self, setting );
- case CONSTRAINT_TYPE_LOCLIMIT:
- return loclimit_getter( self, setting );
- case CONSTRAINT_TYPE_SIZELIMIT:
- return sizelimit_getter( self, setting );
- case CONSTRAINT_TYPE_DISTLIMIT:
- return distlimit_getter( self, setting );
- case CONSTRAINT_TYPE_RIGIDBODYJOINT:
- return rigidbody_getter( self, setting );
- case CONSTRAINT_TYPE_CLAMPTO:
- return clampto_getter( self, setting );
- case CONSTRAINT_TYPE_PYTHON:
- return script_getter( self, setting );
- case CONSTRAINT_TYPE_CHILDOF:
- return childof_getter( self, setting );
- case CONSTRAINT_TYPE_TRANSFORM:
- return transf_getter( self, setting );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "unknown constraint type" );
- }
-}
-
-static int Constraint_setData( BPy_Constraint * self, PyObject * key,
- PyObject * arg )
-{
- int key_int, result;
-
- if( !PyNumber_Check( key ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int arg" );
- if( !self->con )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- key_int = PyInt_AsLong( key );
-
- /* bypass doing settings of individual constraints, if we're just doing
- * constraint space access-stuff
- */
- if ((key_int==EXPP_CONSTR_OWNSPACE) || (key_int==EXPP_CONSTR_TARSPACE)) {
- result = constspace_setter( self, key_int, arg );
- }
- else {
- switch( self->con->type ) {
- case CONSTRAINT_TYPE_KINEMATIC:
- result = kinematic_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_ACTION:
- result = action_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_TRACKTO:
- result = trackto_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_STRETCHTO:
- result = stretchto_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_FOLLOWPATH:
- result = followpath_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_LOCKTRACK:
- result = locktrack_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_MINMAX:
- result = floor_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_LOCLIKE:
- result = locatelike_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_ROTLIKE:
- result = rotatelike_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_SIZELIKE:
- result = sizelike_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_ROTLIMIT:
- result = rotlimit_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_LOCLIMIT:
- result = loclimit_setter( self, key_int, arg );
- break;
- case CONSTRAINT_TYPE_SIZELIMIT:
- result = sizelimit_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_DISTLIMIT:
- result = distlimit_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_RIGIDBODYJOINT:
- result = rigidbody_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_CLAMPTO:
- result = clampto_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_PYTHON:
- result = script_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_CHILDOF:
- result = childof_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_TRANSFORM:
- result = transf_setter( self, key_int, arg);
- break;
- case CONSTRAINT_TYPE_NULL:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "unsupported constraint setting" );
- }
- }
- if( !result && self->pchan )
- update_pose_constraint_flags( self->obj->pose );
- return result;
-}
-
-/*****************************************************************************/
-/* Function: Constraint_compare */
-/* Description: This compares 2 constraint python types, == or != only. */
-/*****************************************************************************/
-static int Constraint_compare( BPy_Constraint * a, BPy_Constraint * b )
-{
- return ( a->con == b->con ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Constraint_repr */
-/* Description: This is a callback function for the BPy_Constraint type. It */
-/* builds a meaningful string to represent constraint objects. */
-/*****************************************************************************/
-
-static PyObject *Constraint_repr( BPy_Constraint * self )
-{
- bConstraintTypeInfo *cti;
-
- if (!self->con)
- return PyString_FromString("[Constraint - Removed]");
- else
- cti= constraint_get_typeinfo(self->con);
-
- if (cti) {
- return PyString_FromFormat("[Constraint \"%s\", Type \"%s\"]",
- self->con->name, cti->name);
- }
- else {
- return PyString_FromString("[Constraint \"%s\", Type \"Unknown\"]");
- }
-}
-
-/* Three Python Constraint_Type helper functions needed by the Object module: */
-
-/*****************************************************************************/
-/* Function: Constraint_CreatePyObject */
-/* Description: This function will create a new BPy_Constraint from an */
-/* existing Blender constraint structure. */
-/*****************************************************************************/
-PyObject *Constraint_CreatePyObject( bPoseChannel *pchan, Object *obj,
- bConstraint *con )
-{
- BPy_Constraint *pycon;
- pycon = ( BPy_Constraint * ) PyObject_NEW( BPy_Constraint,
- &Constraint_Type );
- if( !pycon )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Constraint object" );
-
- pycon->con = con;
-
- /* one of these two will be NULL */
- pycon->obj = obj;
- pycon->pchan = pchan;
- return ( PyObject * ) pycon;
-}
-
-/*****************************************************************************/
-/* Function: Constraint_FromPyObject */
-/* Description: This function returns the Blender constraint from the given */
-/* PyObject. */
-/*****************************************************************************/
-bConstraint *Constraint_FromPyObject( BPy_Constraint * self )
-{
- return self->con;
-}
-
-/*****************************************************************************/
-/* Constraint Sequence wrapper */
-/*****************************************************************************/
-
-/*
- * Initialize the interator
- */
-
-static PyObject *ConstraintSeq_getIter( BPy_ConstraintSeq * self )
-{
- if( self->pchan )
- self->iter = (bConstraint *)self->pchan->constraints.first;
- else
- self->iter = (bConstraint *)self->obj->constraints.first;
- return EXPP_incr_ret ( (PyObject *) self );
-}
-
-/*
- * Get the next Constraint
- */
-
-static PyObject *ConstraintSeq_nextIter( BPy_ConstraintSeq * self )
-{
- bConstraint *this = self->iter;
- if( this ) {
- self->iter = this->next;
- return Constraint_CreatePyObject( self->pchan, self->obj, this );
- }
-
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/* return the number of constraints */
-
-static int ConstraintSeq_length( BPy_ConstraintSeq * self )
-{
- return BLI_countlist( self->pchan ?
- &self->pchan->constraints : &self->obj->constraints );
-}
-
-/* return a constraint */
-
-static PyObject *ConstraintSeq_item( BPy_ConstraintSeq * self, int i )
-{
- bConstraint *con = NULL;
-
- /* if index is negative, start counting from the end of the list */
- if( i < 0 )
- i += ConstraintSeq_length( self );
-
- /* skip through the list until we get the constraint or end of list */
-
- if( self->pchan )
- con = self->pchan->constraints.first;
- else
- con = self->obj->constraints.first;
-
- while( i && con ) {
- --i;
- con = con->next;
- }
-
- if( con )
- return Constraint_CreatePyObject( self->pchan, self->obj, con );
- else
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-}
-
-/*****************************************************************************/
-/* Python BPy_ConstraintSeq sequence table: */
-/*****************************************************************************/
-static PySequenceMethods ConstraintSeq_as_sequence = {
- ( inquiry ) ConstraintSeq_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) ConstraintSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- ( binaryfunc ) 0, /* sq_inplace_concat */
- ( intargfunc ) 0, /* sq_inplace_repeat */
-};
-
-/*
- * helper function to check for a valid constraint argument
- */
-
-static bConstraint *locate_constr( BPy_ConstraintSeq *self, BPy_Constraint * value )
-{
- bConstraint *con;
-
- /* check that argument is a modifier */
- if (!BPy_Constraint_Check(value))
- return (bConstraint *)EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a constraint as an argument" );
-
- /* check whether constraint has been removed */
- if( !value->con )
- return (bConstraint *)EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This constraint has been removed!" );
-
- /* verify the constraint is still exists in the stack */
- if( self->pchan )
- con = self->pchan->constraints.first;
- else
- con = self->obj->constraints.first;
- while( con && con != value->con )
- con = con->next;
-
- /* if we didn't find it, exception */
- if( !con )
- return (bConstraint *)EXPP_ReturnPyObjError( PyExc_AttributeError,
- "This constraint is no longer in the object's stack" );
-
- return con;
-}
-
-
-/* create a new constraint at the end of the list */
-
-static PyObject *ConstraintSeq_append( BPy_ConstraintSeq *self, PyObject *value )
-{
- int type = (int)PyInt_AsLong(value);
- bConstraint *con;
-
- /* type 0 is CONSTRAINT_TYPE_NULL, should we be able to add one of these?
- * if the value is not an int it will be -1 */
- if( type < CONSTRAINT_TYPE_NULL || type > CONSTRAINT_TYPE_RIGIDBODYJOINT )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "arg not in int or out of range" );
-
- con = add_new_constraint( type );
- if( self->pchan ) {
- BLI_addtail( &self->pchan->constraints, con );
- update_pose_constraint_flags( self->obj->pose );
- }
- else
- BLI_addtail( &self->obj->constraints, con );
-
- return Constraint_CreatePyObject( self->pchan, self->obj, con );
-}
-
-/* move the constraint up in the stack */
-
-static PyObject *ConstraintSeq_moveUp( BPy_ConstraintSeq *self, BPy_Constraint *value )
-{
- bConstraint *con = locate_constr( self, value );
-
- /* if we can't locate the constraint, return (exception already set) */
- if( !con )
- return (PyObject *)NULL;
-
- const_moveUp( self->obj, con );
- Py_RETURN_NONE;
-}
-
-/* move the constraint down in the stack */
-
-static PyObject *ConstraintSeq_moveDown( BPy_ConstraintSeq *self, BPy_Constraint *value )
-{
- bConstraint *con = locate_constr( self, value );
-
- /* if we can't locate the constraint, return (exception already set) */
- if( !con )
- return (PyObject *)NULL;
-
- const_moveDown( self->obj, con );
- Py_RETURN_NONE;
-}
-
-/* remove an existing constraint */
-
-static PyObject *ConstraintSeq_remove( BPy_ConstraintSeq *self, BPy_Constraint *value )
-{
- bConstraint *con = locate_constr(self, value);
- bPoseChannel *active= NULL;
-
- /* if we can't locate the constraint, return (exception already set) */
- if (!con)
- return (PyObject *)NULL;
-
- /* check if we need to set temporary 'active' flag for pchan */
- if (self->pchan) {
- active= get_active_posechannel(self->obj);
-
- if (active != self->pchan) {
- if (active) active->bone->flag &= ~BONE_ACTIVE;
- self->pchan->bone->flag |= BONE_ACTIVE;
- }
- }
-
- /* del_constr_func() frees constraint + its data */
- del_constr_func( self->obj, con );
-
- /* reset active pchan (if applicable) */
- if (self->pchan && self->pchan!=active) {
- if (active) active->bone->flag |= BONE_ACTIVE;
- self->pchan->bone->flag &= ~BONE_ACTIVE;
- }
-
- /* erase the link to the constraint */
- value->con = NULL;
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: ConstraintSeq_dealloc */
-/* Description: This is a callback function for the BPy_ConstraintSeq type. */
-/* It destroys data when the object is deleted. */
-/*****************************************************************************/
-static void ConstraintSeq_dealloc( BPy_Constraint * self )
-{
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Python BPy_ConstraintSeq methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_ConstraintSeq_methods[] = {
- /* name, method, flags, doc */
- {"append", ( PyCFunction ) ConstraintSeq_append, METH_O,
- "(type) - add a new constraint, where type is the constraint type"},
- {"remove", ( PyCFunction ) ConstraintSeq_remove, METH_O,
- "(con) - remove an existing constraint, where con is a constraint from this object."},
- {"moveUp", ( PyCFunction ) ConstraintSeq_moveUp, METH_O,
- "(con) - Move constraint up in stack"},
- {"moveDown", ( PyCFunction ) ConstraintSeq_moveDown, METH_O,
- "(con) - Move constraint down in stack"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python ConstraintSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject ConstraintSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Constraints", /* char *tp_name; */
- sizeof( BPy_ConstraintSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) ConstraintSeq_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &ConstraintSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc )ConstraintSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc )ConstraintSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_ConstraintSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: PoseConstraintSeq_CreatePyObject */
-/* Description: This function will create a new BPy_ConstraintSeq from an */
-/* existing ListBase structure. */
-/*****************************************************************************/
-PyObject *PoseConstraintSeq_CreatePyObject( bPoseChannel *pchan )
-{
- BPy_ConstraintSeq *pyseq;
- Object *ob;
-
- for( ob = G.main->object.first; ob; ob = ob->id.next ) {
- if( ob->type == OB_ARMATURE ) {
- bPoseChannel *p = ob->pose->chanbase.first;
- while( p ) {
- if( p == pchan ) {
- pyseq = ( BPy_ConstraintSeq * ) PyObject_NEW(
- BPy_ConstraintSeq, &ConstraintSeq_Type );
- if( !pyseq )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_ConstraintSeq object" );
- pyseq->pchan = pchan;
- pyseq->obj = ob;
- return ( PyObject * ) pyseq;
- } else
- p = p->next;
- }
- }
- }
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't find ANY armature with the pose!" );
-
-}
-
-/*****************************************************************************/
-/* Function: ObConstraintSeq_CreatePyObject */
-/* Description: This function will create a new BPy_ConstraintSeq from an */
-/* existing ListBase structure. */
-/*****************************************************************************/
-PyObject *ObConstraintSeq_CreatePyObject( Object *obj )
-{
- BPy_ConstraintSeq *pyseq;
- pyseq = ( BPy_ConstraintSeq * ) PyObject_NEW( BPy_ConstraintSeq,
- &ConstraintSeq_Type );
- if( !pyseq )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_ConstraintSeq object" );
- pyseq->obj = obj;
- pyseq->pchan = NULL;
- return ( PyObject * ) pyseq;
-}
-
-static PyObject *M_Constraint_TypeDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "NULL",
- PyInt_FromLong( CONSTRAINT_TYPE_NULL ) );
- PyConstant_Insert( d, "TRACKTO",
- PyInt_FromLong( CONSTRAINT_TYPE_TRACKTO ) );
- PyConstant_Insert( d, "IKSOLVER",
- PyInt_FromLong( CONSTRAINT_TYPE_KINEMATIC ) );
- PyConstant_Insert( d, "FOLLOWPATH",
- PyInt_FromLong( CONSTRAINT_TYPE_FOLLOWPATH ) );
- PyConstant_Insert( d, "COPYROT",
- PyInt_FromLong( CONSTRAINT_TYPE_ROTLIKE ) );
- PyConstant_Insert( d, "COPYLOC",
- PyInt_FromLong( CONSTRAINT_TYPE_LOCLIKE ) );
- PyConstant_Insert( d, "COPYSIZE",
- PyInt_FromLong( CONSTRAINT_TYPE_SIZELIKE ) );
- PyConstant_Insert( d, "ACTION",
- PyInt_FromLong( CONSTRAINT_TYPE_ACTION ) );
- PyConstant_Insert( d, "LOCKTRACK",
- PyInt_FromLong( CONSTRAINT_TYPE_LOCKTRACK ) );
- PyConstant_Insert( d, "STRETCHTO",
- PyInt_FromLong( CONSTRAINT_TYPE_STRETCHTO ) );
- PyConstant_Insert( d, "FLOOR",
- PyInt_FromLong( CONSTRAINT_TYPE_MINMAX ) );
- PyConstant_Insert( d, "LIMITLOC",
- PyInt_FromLong( CONSTRAINT_TYPE_LOCLIMIT ) );
- PyConstant_Insert( d, "LIMITROT",
- PyInt_FromLong( CONSTRAINT_TYPE_ROTLIMIT ) );
- PyConstant_Insert( d, "LIMITSIZE",
- PyInt_FromLong( CONSTRAINT_TYPE_SIZELIMIT ) );
- PyConstant_Insert( d, "LIMITDIST",
- PyInt_FromLong( CONSTRAINT_TYPE_DISTLIMIT ) );
- PyConstant_Insert( d, "RIGIDBODYJOINT",
- PyInt_FromLong( CONSTRAINT_TYPE_RIGIDBODYJOINT ) );
- PyConstant_Insert( d, "CLAMPTO",
- PyInt_FromLong( CONSTRAINT_TYPE_CLAMPTO ) );
- PyConstant_Insert( d, "PYTHON",
- PyInt_FromLong( CONSTRAINT_TYPE_PYTHON ) );
- PyConstant_Insert( d, "CHILDOF",
- PyInt_FromLong( CONSTRAINT_TYPE_CHILDOF ) );
- PyConstant_Insert( d, "TRANSFORM",
- PyInt_FromLong( CONSTRAINT_TYPE_TRANSFORM ) );
- }
- return S;
-}
-
-static PyObject *M_Constraint_SettingsDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "XROT",
- PyInt_FromLong( EXPP_CONSTR_XROT ) );
- PyConstant_Insert( d, "YROT",
- PyInt_FromLong( EXPP_CONSTR_YROT ) );
- PyConstant_Insert( d, "ZROT",
- PyInt_FromLong( EXPP_CONSTR_ZROT ) );
- PyConstant_Insert( d, "XSIZE",
- PyInt_FromLong( EXPP_CONSTR_XSIZE ) );
- PyConstant_Insert( d, "YSIZE",
- PyInt_FromLong( EXPP_CONSTR_YSIZE ) );
- PyConstant_Insert( d, "ZSIZE",
- PyInt_FromLong( EXPP_CONSTR_ZSIZE ) );
- PyConstant_Insert( d, "XLOC",
- PyInt_FromLong( EXPP_CONSTR_XLOC ) );
- PyConstant_Insert( d, "YLOC",
- PyInt_FromLong( EXPP_CONSTR_YLOC ) );
- PyConstant_Insert( d, "ZLOC",
- PyInt_FromLong( EXPP_CONSTR_ZLOC ) );
-
- PyConstant_Insert( d, "UPX",
- PyInt_FromLong( UP_X ) );
- PyConstant_Insert( d, "UPY",
- PyInt_FromLong( UP_Y ) );
- PyConstant_Insert( d, "UPZ",
- PyInt_FromLong( UP_Z ) );
-
- PyConstant_Insert( d, "TRACKX",
- PyInt_FromLong( TRACK_X ) );
- PyConstant_Insert( d, "TRACKY",
- PyInt_FromLong( TRACK_Y ) );
- PyConstant_Insert( d, "TRACKZ",
- PyInt_FromLong( TRACK_Z ) );
- PyConstant_Insert( d, "TRACKNEGX",
- PyInt_FromLong( TRACK_nX ) );
- PyConstant_Insert( d, "TRACKNEGY",
- PyInt_FromLong( TRACK_nY ) );
- PyConstant_Insert( d, "TRACKNEGZ",
- PyInt_FromLong( TRACK_nZ ) );
-
- PyConstant_Insert( d, "VOLUMEXZ",
- PyInt_FromLong( VOLUME_XZ ) );
- PyConstant_Insert( d, "VOLUMEX",
- PyInt_FromLong( VOLUME_X ) );
- PyConstant_Insert( d, "VOLUMEZ",
- PyInt_FromLong( VOLUME_Z ) );
- PyConstant_Insert( d, "VOLUMENONE",
- PyInt_FromLong( NO_VOLUME ) );
-
- PyConstant_Insert( d, "PLANEX",
- PyInt_FromLong( PLANE_X ) );
- PyConstant_Insert( d, "PLANEY",
- PyInt_FromLong( PLANE_Y ) );
- PyConstant_Insert( d, "PLANEZ",
- PyInt_FromLong( PLANE_Z ) );
-
- PyConstant_Insert( d, "LOCKX",
- PyInt_FromLong( LOCK_X ) );
- PyConstant_Insert( d, "LOCKY",
- PyInt_FromLong( LOCK_Y ) );
- PyConstant_Insert( d, "LOCKZ",
- PyInt_FromLong( LOCK_Z ) );
-
- PyConstant_Insert( d, "MAXX",
- PyInt_FromLong( EXPP_CONSTR_MAXX ) );
- PyConstant_Insert( d, "MAXY",
- PyInt_FromLong( EXPP_CONSTR_MAXY ) );
- PyConstant_Insert( d, "MAXZ",
- PyInt_FromLong( EXPP_CONSTR_MAXZ ) );
- PyConstant_Insert( d, "MINX",
- PyInt_FromLong( EXPP_CONSTR_MINX ) );
- PyConstant_Insert( d, "MINY",
- PyInt_FromLong( EXPP_CONSTR_MINY ) );
- PyConstant_Insert( d, "MINZ",
- PyInt_FromLong( EXPP_CONSTR_MINZ ) );
-
- PyConstant_Insert( d, "COPYX",
- PyInt_FromLong( LOCLIKE_X ) );
- PyConstant_Insert( d, "COPYY",
- PyInt_FromLong( LOCLIKE_Y ) );
- PyConstant_Insert( d, "COPYZ",
- PyInt_FromLong( LOCLIKE_Z ) );
- PyConstant_Insert( d, "COPYXINVERT",
- PyInt_FromLong( LOCLIKE_X_INVERT ) );
- PyConstant_Insert( d, "COPYYINVERT",
- PyInt_FromLong( LOCLIKE_Y_INVERT ) );
- PyConstant_Insert( d, "COPYZINVERT",
- PyInt_FromLong( LOCLIKE_Z_INVERT ) );
-
- PyConstant_Insert( d, "PARLOCX",
- PyInt_FromLong( CHILDOF_LOCX ) );
- PyConstant_Insert( d, "PARLOCY",
- PyInt_FromLong( CHILDOF_LOCY ) );
- PyConstant_Insert( d, "PARLOCZ",
- PyInt_FromLong( CHILDOF_LOCZ ) );
- PyConstant_Insert( d, "PARROTX",
- PyInt_FromLong( CHILDOF_ROTX ) );
- PyConstant_Insert( d, "PARROTY",
- PyInt_FromLong( CHILDOF_ROTY ) );
- PyConstant_Insert( d, "PARROTZ",
- PyInt_FromLong( CHILDOF_ROTZ ) );
- PyConstant_Insert( d, "PARSIZEX",
- PyInt_FromLong( CHILDOF_LOCX ) );
- PyConstant_Insert( d, "PARSIZEY",
- PyInt_FromLong( CHILDOF_SIZEY ) );
- PyConstant_Insert( d, "PARSIZEZ",
- PyInt_FromLong( CHILDOF_SIZEZ ) );
-
- PyConstant_Insert( d, "CLAMPAUTO",
- PyInt_FromLong( CLAMPTO_AUTO ) );
- PyConstant_Insert( d, "CLAMPX",
- PyInt_FromLong( CLAMPTO_X ) );
- PyConstant_Insert( d, "CLAMPY",
- PyInt_FromLong( CLAMPTO_Y ) );
- PyConstant_Insert( d, "CLAMPZ",
- PyInt_FromLong( CLAMPTO_Z ) );
- PyConstant_Insert( d, "CLAMPCYCLIC",
- PyInt_FromLong( EXPP_CONSTR_CLAMPCYCLIC ));
-
- PyConstant_Insert( d, "TARGET",
- PyInt_FromLong( EXPP_CONSTR_TARGET ) );
- PyConstant_Insert( d, "STRETCH",
- PyInt_FromLong( EXPP_CONSTR_STRETCH ) );
- PyConstant_Insert( d, "ITERATIONS",
- PyInt_FromLong( EXPP_CONSTR_ITERATIONS ) );
- PyConstant_Insert( d, "BONE",
- PyInt_FromLong( EXPP_CONSTR_BONE ) );
- PyConstant_Insert( d, "CHAINLEN",
- PyInt_FromLong( EXPP_CONSTR_CHAINLEN ) );
- PyConstant_Insert( d, "POSWEIGHT",
- PyInt_FromLong( EXPP_CONSTR_POSWEIGHT ) );
- PyConstant_Insert( d, "ROTWEIGHT",
- PyInt_FromLong( EXPP_CONSTR_ROTWEIGHT ) );
- PyConstant_Insert( d, "ROTATE",
- PyInt_FromLong( EXPP_CONSTR_ROTATE ) );
- PyConstant_Insert( d, "USETIP",
- PyInt_FromLong( EXPP_CONSTR_USETIP ) );
-
- PyConstant_Insert( d, "ACTION",
- PyInt_FromLong( EXPP_CONSTR_ACTION ) );
- PyConstant_Insert( d, "START",
- PyInt_FromLong( EXPP_CONSTR_START ) );
- PyConstant_Insert( d, "END",
- PyInt_FromLong( EXPP_CONSTR_END ) );
- PyConstant_Insert( d, "MIN",
- PyInt_FromLong( EXPP_CONSTR_MIN ) );
- PyConstant_Insert( d, "MAX",
- PyInt_FromLong( EXPP_CONSTR_MAX ) );
- PyConstant_Insert( d, "KEYON",
- PyInt_FromLong( EXPP_CONSTR_KEYON ) );
-
- PyConstant_Insert( d, "TRACK",
- PyInt_FromLong( EXPP_CONSTR_TRACK ) );
- PyConstant_Insert( d, "UP",
- PyInt_FromLong( EXPP_CONSTR_UP ) );
-
- PyConstant_Insert( d, "RESTLENGTH",
- PyInt_FromLong( EXPP_CONSTR_RESTLENGTH ) );
- PyConstant_Insert( d, "VOLVARIATION",
- PyInt_FromLong( EXPP_CONSTR_VOLVARIATION ) );
- PyConstant_Insert( d, "VOLUMEMODE",
- PyInt_FromLong( EXPP_CONSTR_VOLUMEMODE ) );
- PyConstant_Insert( d, "PLANE",
- PyInt_FromLong( EXPP_CONSTR_PLANE ) );
-
- PyConstant_Insert( d, "FOLLOW",
- PyInt_FromLong( EXPP_CONSTR_FOLLOW ) );
- PyConstant_Insert( d, "OFFSET",
- PyInt_FromLong( EXPP_CONSTR_OFFSET ) );
- PyConstant_Insert( d, "FORWARD",
- PyInt_FromLong( EXPP_CONSTR_FORWARD ) );
-
- PyConstant_Insert( d, "LOCK",
- PyInt_FromLong( EXPP_CONSTR_LOCK ) );
-
- PyConstant_Insert( d, "LIMITMODE",
- PyInt_FromLong( EXPP_CONSTR_MODE ) );
- PyConstant_Insert( d, "LIMIT_INSIDE",
- PyInt_FromLong( LIMITDIST_INSIDE ) );
- PyConstant_Insert( d, "LIMIT_OUTSIDE",
- PyInt_FromLong( LIMITDIST_OUTSIDE ) );
- PyConstant_Insert( d, "LIMIT_ONSURFACE",
- PyInt_FromLong( LIMITDIST_ONSURFACE ) );
-
- PyConstant_Insert( d, "COPY",
- PyInt_FromLong( EXPP_CONSTR_COPY ) );
- PyConstant_Insert( d, "LIMIT",
- PyInt_FromLong( EXPP_CONSTR_LIMIT ) );
- PyConstant_Insert( d, "CLAMP",
- PyInt_FromLong( EXPP_CONSTR_CLAMP ) );
-
- PyConstant_Insert( d, "LIMIT_XMIN",
- PyInt_FromLong( EXPP_CONSTR_LIMXMIN ) );
- PyConstant_Insert( d, "LIMIT_XMAX",
- PyInt_FromLong( EXPP_CONSTR_LIMXMAX ) );
- PyConstant_Insert( d, "LIMIT_YMIN",
- PyInt_FromLong( EXPP_CONSTR_LIMYMIN ) );
- PyConstant_Insert( d, "LIMIT_YMAX",
- PyInt_FromLong( EXPP_CONSTR_LIMYMAX ) );
- PyConstant_Insert( d, "LIMIT_ZMIN",
- PyInt_FromLong( EXPP_CONSTR_LIMZMIN ) );
- PyConstant_Insert( d, "LIMIT_ZMAX",
- PyInt_FromLong( EXPP_CONSTR_LIMZMAX ) );
-
- PyConstant_Insert( d, "LIMIT_XROT",
- PyInt_FromLong( EXPP_CONSTR_LIMXROT ) );
- PyConstant_Insert( d, "LIMIT_YROT",
- PyInt_FromLong( EXPP_CONSTR_LIMYROT ) );
- PyConstant_Insert( d, "LIMIT_ZROT",
- PyInt_FromLong( EXPP_CONSTR_LIMZROT ) );
-
- PyConstant_Insert( d, "XMIN",
- PyInt_FromLong( EXPP_CONSTR_XMIN ) );
- PyConstant_Insert( d, "XMAX",
- PyInt_FromLong( EXPP_CONSTR_XMAX ) );
- PyConstant_Insert( d, "YMIN",
- PyInt_FromLong( EXPP_CONSTR_YMIN ) );
- PyConstant_Insert( d, "YMAX",
- PyInt_FromLong( EXPP_CONSTR_YMAX ) );
- PyConstant_Insert( d, "ZMIN",
- PyInt_FromLong( EXPP_CONSTR_ZMIN ) );
- PyConstant_Insert( d, "ZMAX",
- PyInt_FromLong( EXPP_CONSTR_ZMAX ) );
-
- PyConstant_Insert( d, "SCRIPT",
- PyInt_FromLong( EXPP_CONSTR_SCRIPT ) );
- PyConstant_Insert( d, "PROPERTIES",
- PyInt_FromLong( EXPP_CONSTR_PROPS ) );
-
- PyConstant_Insert( d, "FROM",
- PyInt_FromLong( EXPP_CONSTR_FROM ) );
- PyConstant_Insert( d, "TO",
- PyInt_FromLong( EXPP_CONSTR_TO ) );
- PyConstant_Insert( d, "EXTRAPOLATE",
- PyInt_FromLong( EXPP_CONSTR_EXPO ) );
- PyConstant_Insert( d, "MAPX",
- PyInt_FromLong( EXPP_CONSTR_MAPX ) );
- PyConstant_Insert( d, "MAPY",
- PyInt_FromLong( EXPP_CONSTR_MAPY ) );
- PyConstant_Insert( d, "MAPZ",
- PyInt_FromLong( EXPP_CONSTR_MAPZ ) );
- PyConstant_Insert( d, "FROM_MINX",
- PyInt_FromLong( EXPP_CONSTR_FROMMINX ) );
- PyConstant_Insert( d, "FROM_MAXX",
- PyInt_FromLong( EXPP_CONSTR_FROMMAXX ) );
- PyConstant_Insert( d, "FROM_MINY",
- PyInt_FromLong( EXPP_CONSTR_FROMMINY ) );
- PyConstant_Insert( d, "FROM_MAXY",
- PyInt_FromLong( EXPP_CONSTR_FROMMAXY ) );
- PyConstant_Insert( d, "FROM_MINZ",
- PyInt_FromLong( EXPP_CONSTR_FROMMINZ ) );
- PyConstant_Insert( d, "FROM_MAXZ",
- PyInt_FromLong( EXPP_CONSTR_FROMMAXZ ) );
- PyConstant_Insert( d, "TO_MINX",
- PyInt_FromLong( EXPP_CONSTR_TOMINX ) );
- PyConstant_Insert( d, "TO_MAXX",
- PyInt_FromLong( EXPP_CONSTR_TOMAXX ) );
- PyConstant_Insert( d, "TO_MINY",
- PyInt_FromLong( EXPP_CONSTR_TOMINY ) );
- PyConstant_Insert( d, "TO_MAXY",
- PyInt_FromLong( EXPP_CONSTR_TOMAXY ) );
- PyConstant_Insert( d, "TO_MINZ",
- PyInt_FromLong( EXPP_CONSTR_TOMINZ ) );
- PyConstant_Insert( d, "TO_MAXZ",
- PyInt_FromLong( EXPP_CONSTR_TOMAXZ ) );
-
- PyConstant_Insert( d, "LOC",
- PyInt_FromLong( 0 ) );
- PyConstant_Insert( d, "ROT",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( d, "SCALE",
- PyInt_FromLong( 2 ) );
-
- PyConstant_Insert( d, "CONSTR_RB_TYPE",
- PyInt_FromLong( EXPP_CONSTR_RB_TYPE ) );
- PyConstant_Insert( d, "CONSTR_RB_BALL",
- PyInt_FromLong( EXPP_CONSTR_RB_BALL ) );
- PyConstant_Insert( d, "CONSTR_RB_HINGE",
- PyInt_FromLong( EXPP_CONSTR_RB_HINGE ) );
- PyConstant_Insert( d, "CONSTR_RB_GENERIC6DOF",
- PyInt_FromLong( EXPP_CONSTR_RB_GENERIC6DOF ) );
- PyConstant_Insert( d, "CONSTR_RB_VEHICLE",
- PyInt_FromLong( EXPP_CONSTR_RB_VEHICLE ) );
- PyConstant_Insert( d, "CONSTR_RB_PIVX",
- PyInt_FromLong( EXPP_CONSTR_RB_PIVX ) );
- PyConstant_Insert( d, "CONSTR_RB_PIVY",
- PyInt_FromLong( EXPP_CONSTR_RB_PIVY ) );
- PyConstant_Insert( d, "CONSTR_RB_PIVZ",
- PyInt_FromLong( EXPP_CONSTR_RB_PIVZ ) );
- PyConstant_Insert( d, "CONSTR_RB_AXX",
- PyInt_FromLong( EXPP_CONSTR_RB_AXX ) );
- PyConstant_Insert( d, "CONSTR_RB_AXY",
- PyInt_FromLong( EXPP_CONSTR_RB_AXY ) );
- PyConstant_Insert( d, "CONSTR_RB_AXZ",
- PyInt_FromLong( EXPP_CONSTR_RB_AXZ ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT0",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT0 ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT1",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT1 ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT2",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT2 ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT3",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT3 ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT4",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT4 ) );
- PyConstant_Insert( d, "CONSTR_RB_MINLIMIT5",
- PyInt_FromLong( EXPP_CONSTR_RB_MINLIMIT5 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT0",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT0 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT1",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT1 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT2",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT2 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT3",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT3 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT4",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT4 ) );
- PyConstant_Insert( d, "CONSTR_RB_MAXLIMIT5",
- PyInt_FromLong( EXPP_CONSTR_RB_MAXLIMIT5 ) );
- PyConstant_Insert( d, "CONSTR_RB_EXTRAFZ",
- PyInt_FromLong( EXPP_CONSTR_RB_EXTRAFZ ) );
- PyConstant_Insert( d, "CONSTR_RB_FLAG",
- PyInt_FromLong( EXPP_CONSTR_RB_FLAG ) );
-
-
- PyConstant_Insert( d, "OWNERSPACE",
- PyInt_FromLong( EXPP_CONSTR_OWNSPACE ) );
- PyConstant_Insert( d, "TARGETSPACE",
- PyInt_FromLong( EXPP_CONSTR_TARSPACE ) );
-
- PyConstant_Insert( d, "SPACE_WORLD",
- PyInt_FromLong( CONSTRAINT_SPACE_WORLD) );
- PyConstant_Insert( d, "SPACE_LOCAL",
- PyInt_FromLong( CONSTRAINT_SPACE_LOCAL ) );
- PyConstant_Insert( d, "SPACE_POSE",
- PyInt_FromLong( CONSTRAINT_SPACE_POSE) );
- PyConstant_Insert( d, "SPACE_PARLOCAL",
- PyInt_FromLong( CONSTRAINT_SPACE_PARLOCAL ) );
- }
- return S;
-}
-
-/*****************************************************************************/
-/* Function: Constraint_Init */
-/*****************************************************************************/
-PyObject *Constraint_Init( void )
-{
- PyObject *submodule;
- PyObject *TypeDict = M_Constraint_TypeDict( );
- PyObject *SettingsDict = M_Constraint_SettingsDict( );
-
- if( PyType_Ready( &ConstraintSeq_Type ) < 0
- || PyType_Ready( &Constraint_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Constraint", NULL,
- "Constraint module for accessing and creating constraint data" );
-
- if( TypeDict )
- PyModule_AddObject( submodule, "Type", TypeDict );
-
- if( SettingsDict )
- PyModule_AddObject( submodule, "Settings", SettingsDict );
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Constraint.h b/source/blender/python/api2_2x/Constraint.h
deleted file mode 100644
index 2dae344c0be..00000000000
--- a/source/blender/python/api2_2x/Constraint.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_CONSTRAINT_H
-#define EXPP_CONSTRAINT_H
-
-#include <Python.h>
-#include "DNA_object_types.h"
-#include "DNA_action_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_listBase.h"
-
-/*****************************************************************************/
-/* Python BPy_Modifier structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required macro */
- Object *obj; /* "parent" object */
- bPoseChannel *pchan;/* "parent" pose channel */
- /* if con this is null, the constraint has been removed and we need to
- * raise an error when its data is accessed */
- bConstraint *con;
-} BPy_Constraint;
-
-extern PyTypeObject Constraint_Type;
-
-#define BPy_Constraint_Check(v) ((v)->ob_type == &Constraint_Type) /* for type checking */
-typedef struct {
- PyObject_HEAD /* required macro */
- Object *obj; /* "parent" object */
- bPoseChannel *pchan;/* "parent" pose channel */
- bConstraint *iter;
-} BPy_ConstraintSeq;
-
-/*
- * prototypes
- */
-
-PyObject *Constraint_Init( void );
-PyObject *Constraint_CreatePyObject( bPoseChannel *pchan, Object *obj,
- bConstraint *con );
-bConstraint *Constraint_FromPyObject( BPy_Constraint * obj );
-
-PyObject *PoseConstraintSeq_CreatePyObject( bPoseChannel *pchan );
-PyObject *ObConstraintSeq_CreatePyObject( Object *obj );
-
-#endif /* EXPP_CONSTRAINT_H */
diff --git a/source/blender/python/api2_2x/CurNurb.c b/source/blender/python/api2_2x/CurNurb.c
deleted file mode 100644
index 63a1dccbc50..00000000000
--- a/source/blender/python/api2_2x/CurNurb.c
+++ /dev/null
@@ -1,1146 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Stephen Swaney, Campbell Barton, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "CurNurb.h" /*This must come first */
-
-#include "BKE_curve.h"
-#include "BDR_editcurve.h" /* for convertspline */
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-#include "BezTriple.h"
-
-#include "BKE_utildefines.h"
-
-/* Only for ME_SMOOTH */
-#include "DNA_meshdata_types.h"
-
-/*
- * forward declarations go here
- */
-
-static PyObject *M_CurNurb_New( PyObject * self, PyObject * args );
-static PyObject *CurNurb_oldsetMatIndex( BPy_CurNurb * self, PyObject * args );
-static int CurNurb_setMatIndex( BPy_CurNurb * self, PyObject * args );
-static PyObject *CurNurb_getMatIndex( BPy_CurNurb * self );
-static PyObject *CurNurb_getFlagU( BPy_CurNurb * self );
-static PyObject *CurNurb_oldsetFlagU( BPy_CurNurb * self, PyObject * args );
-static int CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args );
-static PyObject *CurNurb_getFlagV( BPy_CurNurb * self );
-static PyObject *CurNurb_oldsetFlagV( BPy_CurNurb * self, PyObject * args );
-static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args );
-static PyObject *CurNurb_getOrderU( BPy_CurNurb * self );
-static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args );
-static PyObject *CurNurb_getType( BPy_CurNurb * self );
-static PyObject *CurNurb_oldsetType( BPy_CurNurb * self, PyObject * args );
-static int CurNurb_setType( BPy_CurNurb * self, PyObject * args );
-static PyObject *CurNurb_getKnotsU( BPy_CurNurb * self );
-static PyObject *CurNurb_getKnotsV( BPy_CurNurb * self );
-static PyObject *CurNurb_getPoints( BPy_CurNurb * self );
-/* static PyObject* CurNurb_setXXX( BPy_CurNurb* self, PyObject* args ); */
-static int CurNurb_setPoint( BPy_CurNurb * self, int index, PyObject * ob );
-static int CurNurb_length( PyInstanceObject * inst );
-static PyObject *CurNurb_getIter( BPy_CurNurb * self );
-static PyObject *CurNurb_iterNext( BPy_CurNurb * self );
-PyObject *CurNurb_append( BPy_CurNurb * self, PyObject * value );
-
-static PyObject *CurNurb_isNurb( BPy_CurNurb * self );
-static PyObject *CurNurb_isCyclic( BPy_CurNurb * self );
-static PyObject *CurNurb_dump( BPy_CurNurb * self );
-static PyObject *CurNurb_switchDirection( BPy_CurNurb * self );
-static PyObject *CurNurb_recalc( BPy_CurNurb * self );
-static PyObject *CurNurb_getFlagBits( BPy_CurNurb * self, void *type );
-static int CurNurb_setFlagBits( BPy_CurNurb * self, PyObject *value, void *type );
-char M_CurNurb_doc[] = "CurNurb";
-
-
-/*
- CurNurb_Type callback function prototypes:
-*/
-
-static int CurNurb_compare( BPy_CurNurb * a, BPy_CurNurb * b );
-static PyObject *CurNurb_repr( BPy_CurNurb * self );
-
-/*
- table of module methods
- these are the equivalent of class or static methods.
- you do not need an object instance to call one.
-
-*/
-
-static PyMethodDef M_CurNurb_methods[] = {
-/* name, method, flags, doc_string */
- {"New", ( PyCFunction ) M_CurNurb_New, METH_VARARGS | METH_KEYWORDS,
- " () - doc string"},
-/* {"Get", (PyCFunction) M_CurNurb_method, METH_NOARGS, " () - doc string"}, */
-/* {"method", (PyCFunction) M_CurNurb_method, METH_NOARGS, " () - doc string"}, */
-
- {NULL, NULL, 0, NULL}
-};
-
-
-
-/*
- * method table
- * table of instance methods
- * these methods are invoked on an instance of the type.
-*/
-
-static PyMethodDef BPy_CurNurb_methods[] = {
-/* name, method, flags, doc */
-/* {"method", (PyCFunction) CurNurb_method, METH_NOARGS, " () - doc string"} */
- {"setMatIndex", ( PyCFunction ) CurNurb_oldsetMatIndex, METH_VARARGS,
- "( index ) - set index into materials list"},
- {"getMatIndex", ( PyCFunction ) CurNurb_getMatIndex, METH_NOARGS,
- "( ) - get current material index"},
- {"setFlagU", ( PyCFunction ) CurNurb_oldsetFlagU, METH_VARARGS,
- "( index ) - set flagU and recalculate the knots (0: uniform, 1: endpoints, 2: bezier)"},
- {"getFlagU", ( PyCFunction ) CurNurb_getFlagU, METH_NOARGS,
- "( ) - get flagU of the knots"},
- {"setFlagV", ( PyCFunction ) CurNurb_oldsetFlagV, METH_VARARGS,
- "( index ) - set flagV and recalculate the knots (0: uniform, 1: endpoints, 2: bezier)"},
- {"getFlagV", ( PyCFunction ) CurNurb_getFlagV, METH_NOARGS,
- "( ) - get flagV of the knots"},
- {"setType", ( PyCFunction ) CurNurb_oldsetType, METH_VARARGS,
- "( type ) - change the type of the curve (Poly: 0, Bezier: 1, NURBS: 4)"},
- {"getType", ( PyCFunction ) CurNurb_getType, METH_NOARGS,
- "( ) - get the type of the curve (Poly: 0, Bezier: 1, NURBS: 4)"},
- {"append", ( PyCFunction ) CurNurb_append, METH_O,
- "( point ) - add a new point. arg is BezTriple or list of x,y,z,w floats"},
- {"isNurb", ( PyCFunction ) CurNurb_isNurb, METH_NOARGS,
- "( ) - boolean function tests if this spline is type nurb or bezier"},
- {"isCyclic", ( PyCFunction ) CurNurb_isCyclic, METH_NOARGS,
- "( ) - boolean function tests if this spline is cyclic (closed) or not (open)"},
- {"dump", ( PyCFunction ) CurNurb_dump, METH_NOARGS,
- "( ) - dumps Nurb data)"},
- {"switchDirection", ( PyCFunction ) CurNurb_switchDirection, METH_NOARGS,
- "( ) - swaps curve beginning and end)"},
- {"recalc", ( PyCFunction ) CurNurb_recalc, METH_NOARGS,
- "( ) - recalc Nurb data)"},
- {NULL, NULL, 0, NULL}
-};
-
-/*
- * methods for CurNurb as sequece
- */
-
-static PySequenceMethods CurNurb_as_sequence = {
- ( inquiry ) CurNurb_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) CurNurb_getPoint, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) CurNurb_setPoint, /* sq_ass_item */
- 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- 0,
- 0
-};
-
-static PyGetSetDef BPy_CurNurb_getseters[] = {
- {"mat_index",
- (getter)CurNurb_getMatIndex, (setter)CurNurb_setMatIndex,
- "CurNurb's material index",
- NULL},
- {"points",
- (getter)CurNurb_getPoints, (setter)NULL,
- "The number of curve points",
- NULL},
- {"flagU",
- (getter)CurNurb_getFlagU, (setter)CurNurb_setFlagU,
- "The knot type in the U direction",
- NULL},
- {"flagV",
- (getter)CurNurb_getFlagV, (setter)CurNurb_setFlagV,
- "The knot type in the V direction",
- NULL},
- {"orderU",
- (getter)CurNurb_getOrderU, (setter)CurNurb_setOrderU,
- "order setting for U direction", NULL},
- {"type",
- (getter)CurNurb_getType, (setter)CurNurb_setType,
- "The curve type (poly: bezier, or NURBS)",
- NULL},
- {"knotsU",
- (getter)CurNurb_getKnotsU, (setter)NULL,
- "The The knot vector in the U direction",
- NULL},
- {"knotsV",
- (getter)CurNurb_getKnotsV, (setter)NULL,
- "The The knot vector in the V direction",
- NULL},
- {"smooth",
- (getter)CurNurb_getFlagBits, (setter)CurNurb_setFlagBits,
- "The smooth bool setting",
- (void *)ME_SMOOTH},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*
- Object Type definition
- full blown 2.3 struct
- if you are having trouble building with an earlier version of python,
- this is why.
-*/
-
-PyTypeObject CurNurb_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "CurNurb", /* char *tp_name; */
- sizeof( CurNurb_Type ), /* int tp_basicsize, */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) CurNurb_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) CurNurb_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- 0, /* PyNumberMethods *tp_as_number; */
- &CurNurb_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- 0, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- 0, /* hashfunc tp_hash; */
- 0, /* ternaryfunc tp_call; */
- 0, /* reprfunc tp_str; */
- 0, /* getattrofunc tp_getattro; */
- 0, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- 0, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- 0, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- 0, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- 0, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- 0, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) CurNurb_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) CurNurb_iterNext, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_CurNurb_methods, /* struct PyMethodDef *tp_methods; */
- 0, /* struct PyMemberDef *tp_members; */
- BPy_CurNurb_getseters, /* struct PyGetSetDef *tp_getset; */
- 0, /* struct _typeobject *tp_base; */
- 0, /* PyObject *tp_dict; */
- 0, /* descrgetfunc tp_descr_get; */
- 0, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- 0, /* initproc tp_init; */
- 0, /* allocfunc tp_alloc; */
- 0, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- 0, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- 0, /* inquiry tp_is_gc; */
- 0, /* PyObject *tp_bases; */
- /* method resolution order */
- 0, /* PyObject *tp_mro; */
- 0, /* PyObject *tp_cache; */
- 0, /* PyObject *tp_subclasses; */
- 0, /* PyObject *tp_weaklist; */
- 0
-};
-
-/*
- compare
- in this case, we consider two CurNurbs equal, if they point to the same
- blender data.
-*/
-
-static int CurNurb_compare( BPy_CurNurb * a, BPy_CurNurb * b )
-{
- Nurb *pa = a->nurb;
- Nurb *pb = b->nurb;
-
- return ( pa == pb ) ? 0 : -1;
-}
-
-
-/*
- factory method to create a BPy_CurNurb from a Blender Nurb
-*/
-
-PyObject *CurNurb_CreatePyObject( Nurb * blen_nurb )
-{
- BPy_CurNurb *pyNurb;
-
- pyNurb = ( BPy_CurNurb * ) PyObject_NEW( BPy_CurNurb, &CurNurb_Type );
-
- if( !pyNurb )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "could not create BPy_CurNurb PyObject" );
-
- pyNurb->nurb = blen_nurb;
- return ( PyObject * ) pyNurb;
-}
-
-
-/*
- * CurNurb_repr
- */
-static PyObject *CurNurb_repr( BPy_CurNurb * self )
-{ /* used by 'repr' */
-
- return PyString_FromFormat( "[CurNurb \"%d\"]", self->nurb->type );
-}
-
-/* XXX Can't this be simply removed? */
-static PyObject *M_CurNurb_New( PyObject * self, PyObject * args )
-{
- return ( PyObject * ) 0;
-
-}
-
-/*
- * Curve.getType
- */
-static PyObject *CurNurb_getType( BPy_CurNurb * self )
-{
- /* type is on 3 first bits only */
- return PyInt_FromLong( self->nurb->type & 7 );
-}
-
-/*
- * Curve.setType
- *
- * Convert the curve using Blender's convertspline fonction
- */
-static int CurNurb_setType( BPy_CurNurb * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- short value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( short )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
-
- /* parameter value checking */
- if (value != CU_POLY && value != CU_BEZIER && value != CU_NURBS)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected integer argument" );
-
- /* convert and raise error if impossible */
- if (convertspline(value, self->nurb))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Conversion Impossible" );
-
- return 0;
-}
-
-/*
- * CurNurb_getKnotsU
- *
- * returns curve's knotsU in a tuple. Empty tuple is returned if curve
- * isn't Nurbs or it doesn't have knots in U
- */
-
-static PyObject *CurNurb_getKnotsU( BPy_CurNurb * self )
-{
- if(self->nurb->knotsu) {
- int len = KNOTSU(self->nurb);
- int i;
- PyObject *knotsu = PyTuple_New(len);
- if( !knotsu )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get CurNurb.knotsU attribute" );
-
- for(i = 0; i < len; ++i)
- PyTuple_SetItem(knotsu, i,
- PyFloat_FromDouble(self->nurb->knotsu[i]));
-
- return knotsu;
- }
- return PyTuple_New(0);
-}
-
-/*
- * CurNurb_getKnotsV
- *
- * returns curve's knotsV in a tuple. Empty tuple is returned if curve doesn't have knots in V
- */
-
-static PyObject *CurNurb_getKnotsV( BPy_CurNurb * self )
-{
- if(self->nurb->knotsv) {
- int len = KNOTSV(self->nurb);
- int i;
- PyObject *knotsv = PyTuple_New(len);
- if( !knotsv )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get CurNurb.knotsV index" );
-
- for(i = 0; i < len; ++i)
- PyTuple_SetItem(knotsv, i,
- PyFloat_FromDouble(self->nurb->knotsv[i] ));
-
- return knotsv;
- }
- return PyTuple_New(0);
-}
-
-static PyObject *CurNurb_getPoints( BPy_CurNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->pntsu );
-}
-
-static PyObject *CurNurb_getFlagBits( BPy_CurNurb * self, void *type )
-{
- return EXPP_getBitfield( (void *)&self->nurb->flag,
- GET_INT_FROM_POINTER(type), 'h' );
-}
-
-static int CurNurb_setFlagBits( BPy_CurNurb * self, PyObject *value,
- void *type )
-{
- return EXPP_setBitfield( value, (void *)&self->nurb->flag,
- GET_INT_FROM_POINTER(type), 'h' );
-}
-
-/*
- * CurNurb_append( point )
- * append a new point to a nurb curve.
- * arg is BezTriple or list of xyzw floats
- */
-
-PyObject *CurNurb_append( BPy_CurNurb * self, PyObject * value )
-{
- return CurNurb_appendPointToNurb( self->nurb, value );
-}
-
-
-/*
- * CurNurb_appendPointToNurb
- * this is a non-bpy utility func to add a point to a given nurb.
- * notice the first arg is Nurb*.
- */
-
-PyObject *CurNurb_appendPointToNurb( Nurb * nurb, PyObject * value )
-{
-
- int i;
- int size;
- int npoints = nurb->pntsu;
-
- /*
- do we have a list of four floats or a BezTriple?
- */
-
- /* if curve is empty, adjust type depending on input type */
- if (nurb->bezt==NULL && nurb->bp==NULL) {
- if (BPy_BezTriple_Check( value ))
- nurb->type |= CU_BEZIER;
- else if (PySequence_Check( value ))
- nurb->type |= CU_NURBS;
- else
- return( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected a BezTriple or a Sequence of 4 (or 5) floats" ) );
- }
-
-
-
- if ((nurb->type & 7)==CU_BEZIER) {
- BezTriple *tmp;
-
- if( !BPy_BezTriple_Check( value ) )
- return( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected a BezTriple\n" ) );
-
-/* printf("\ndbg: got a BezTriple\n"); */
- tmp = nurb->bezt; /* save old points */
- nurb->bezt =
- ( BezTriple * ) MEM_mallocN( sizeof( BezTriple ) *
- ( npoints + 1 ),
- "CurNurb_append2" );
-
- if( !nurb->bezt )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError, "allocation failed" ) );
-
- /* copy old points to new */
- if( tmp ) {
- memmove( nurb->bezt, tmp, sizeof( BezTriple ) * npoints );
- MEM_freeN( tmp );
- }
-
- nurb->pntsu++;
- /* add new point to end of list */
- memcpy( nurb->bezt + npoints,
- BezTriple_FromPyObject( value ), sizeof( BezTriple ) );
-
- }
- else if( PySequence_Check( value ) ) {
- size = PySequence_Size( value );
-/* printf("\ndbg: got a sequence of size %d\n", size ); */
- if( size == 4 || size == 5 || size == 6) {
- BPoint *tmp;
-
- tmp = nurb->bp; /* save old pts */
-
- nurb->bp =
- ( BPoint * ) MEM_mallocN( sizeof( BPoint ) *
- ( npoints + 1 ),
- "CurNurb_append1" );
- if( !nurb->bp )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "allocation failed" ) );
-
- memmove( nurb->bp, tmp, sizeof( BPoint ) * npoints );
- if( tmp )
- MEM_freeN( tmp );
-
- ++nurb->pntsu;
- /* initialize new BPoint from old */
- memcpy( nurb->bp + npoints, nurb->bp,
- sizeof( BPoint ) );
-
- for( i = 0; i < 4; ++i ) {
- PyObject *item = PySequence_GetItem( value, i );
-
- if (item == NULL)
- return NULL;
-
-
- nurb->bp[npoints].vec[i] = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
-
- if (size >= 5) {
- PyObject *item = PySequence_GetItem( value, 4 );
-
- if (item == NULL)
- return NULL;
-
- nurb->bp[npoints].alfa = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
- else {
- nurb->bp[npoints].alfa = 0.0f;
- }
-
- if (size == 6) {
- PyObject *item = PySequence_GetItem( value, 5 );
-
- if (item == NULL)
- return NULL;
-
- nurb->bp[npoints].radius = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
- else {
- nurb->bp[npoints].radius = 1.0f;
- }
-
- nurb->bp[npoints].weight = 0.0; /* softbody weight TODO - add access to this, is zero elsewhere but through blender is 1.0 by default */
-
- makeknots( nurb, 1, nurb->flagu >> 1 );
-
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of 4 or 6 floats" );
- }
-
- } else {
- /* bail with error */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of 4 to 6 floats" );
-
- }
-
- Py_RETURN_NONE;
-}
-
-
-/*
- * CurNurb_setMatIndex
- *
- * set index into material list
- */
-
-static int CurNurb_setMatIndex( BPy_CurNurb * self, PyObject * args )
-{
- printf ("%d\n", self->nurb->mat_nr);
- return EXPP_setIValueRange( args, &self->nurb->mat_nr, 0, 15, 'h' );
-}
-
-/*
- * CurNurb_getMatIndex
- *
- * returns index into material list
- */
-
-static PyObject *CurNurb_getMatIndex( BPy_CurNurb * self )
-{
- PyObject *index = PyInt_FromLong( ( long ) self->nurb->mat_nr );
-
- if( index )
- return index;
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get material index" );
-}
-
-/*
- * CurNurb_getFlagU
- *
- * returns curve's flagu
- */
-
-static PyObject *CurNurb_getFlagU( BPy_CurNurb * self )
-{
- PyObject *flagu = PyInt_FromLong( ( long ) self->nurb->flagu );
-
- if( flagu )
- return flagu;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get CurNurb.flagu index" ) );
-}
-
-/*
- * CurNurb_setFlagU
- *
- * set curve's flagu and recalculate the knots
- *
- * Possible values: 0 - uniform, 2 - endpoints, 4 - bezier
- * bit 0 controls CU_CYCLIC
- */
-
-static int CurNurb_setFlagU( BPy_CurNurb * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- short value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( short )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
-
- if( value < 0 || value > 5 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected integer argument in range [0,5]" );
-
- if( self->nurb->flagu != value ) {
- self->nurb->flagu = (short)value;
- makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
- }
-
- return 0;
-}
-
-/*
- * CurNurb_getFlagV
- *
- * returns curve's flagu
- */
-
-static PyObject *CurNurb_getFlagV( BPy_CurNurb * self )
-{
- PyObject *flagv = PyInt_FromLong( ( long ) self->nurb->flagv );
-
- if( flagv )
- return flagv;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get CurNurb.flagv" ) );
-}
-
-/*
- * CurNurb_setFlagV
- *
- * set curve's flagu and recalculate the knots
- *
- * Possible values: 0 - uniform, 1 - endpoints, 2 - bezier
- */
-
-static int CurNurb_setFlagV( BPy_CurNurb * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- short value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( short )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
-
- if( value < 0 || value > 5 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected integer argument in range [0,5]" );
-
- if( self->nurb->flagv != value ) {
- self->nurb->flagv = (short)value;
- makeknots( self->nurb, 2, self->nurb->flagv >> 1 );
- }
-
- return 0;
-}
-
-static PyObject *CurNurb_getOrderU( BPy_CurNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->orderu );
-}
-
-static int CurNurb_setOrderU( BPy_CurNurb * self, PyObject * args )
-{
- int order;
-
- args = PyNumber_Int( args );
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- order = ( int )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- if( order < 2 ) order = 2;
- else if( order > 6 ) order = 6;
-
- if( self->nurb->pntsu < order )
- order = self->nurb->pntsu;
-
- self->nurb->orderu = (short)order;
- makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
-
- return 0;
-}
-
-/*
- * CurNurb_getIter
- *
- * create an iterator for our CurNurb.
- * this iterator returns the points for this CurNurb.
- */
-
-static PyObject *CurNurb_getIter( BPy_CurNurb * self )
-{
- self->bp = self->nurb->bp;
- self->bezt = self->nurb->bezt;
- self->atEnd = 0;
- self->nextPoint = 0;
-
- /* set exhausted flag if both bp and bezt are zero */
- if( ( !self->bp ) && ( !self->bezt ) )
- self->atEnd = 1;
-
- Py_INCREF( self );
- return ( PyObject * ) self;
-}
-
-
-static PyObject *CurNurb_iterNext( BPy_CurNurb * self )
-{
- PyObject *po; /* return value */
- Nurb *pnurb = self->nurb;
- int npoints = pnurb->pntsu;
-
- /* are we at end already? */
- if( self->atEnd )
- return ( EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" ) );
-
- if( self->nextPoint < npoints ) {
-
- po = CurNurb_pointAtIndex( self->nurb, self->nextPoint );
- self->nextPoint++;
-
- return po;
-
- } else {
- self->atEnd = 1; /* set flag true */
- }
-
- return ( EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" ) );
-}
-
-
-
-/*
- * CurNurb_isNurb()
- * test whether spline nurb or bezier
- */
-
-static PyObject *CurNurb_isNurb( BPy_CurNurb * self )
-{
- /* NOTE: a Nurb has bp and bezt pointers
- * depending on type.
- * It is possible both are NULL if no points exist.
- * in that case, we return False
- */
-
- if( self->nurb->bp ) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
-}
-
-/*
- * CurNurb_isCyclic()
- * test whether spline cyclic (closed) or not (open)
- */
-
-static PyObject *CurNurb_isCyclic( BPy_CurNurb * self )
-{
- /* supposing that the flagu is always set */
-
- if( self->nurb->flagu & CU_CYCLIC ) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
-}
-
-/*
- * CurNurb_length
- * returns the number of points in a Nurb
- * this is a tp_as_sequence method, not a regular instance method.
- */
-
-static int CurNurb_length( PyInstanceObject * inst )
-{
- Nurb *nurb;
- int len;
-
- if( BPy_CurNurb_Check( ( PyObject * ) inst ) ) {
- nurb = ( ( BPy_CurNurb * ) inst )->nurb;
- len = nurb->pntsu;
- return len;
- }
-
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "arg is not a BPy_CurNurb" );
-}
-
-/*
- * CurNurb_getPoint
- * returns the Nth point in a Nurb
- * this is one of the tp_as_sequence methods, hence the int N argument.
- * it is called via the [] operator, not as a usual instance method.
- */
-
-PyObject *CurNurb_getPoint( BPy_CurNurb * self, int index )
-{
- Nurb *myNurb;
-
- int npoints;
-
- /* for convenince */
- myNurb = self->nurb;
- npoints = myNurb->pntsu;
-
- /* DELETED: bail if index < 0 */
- /* actually, this check is not needed since python treats */
- /* negative indices as starting from the right end of a sequence */
- /*
- THAT IS WRONG, when passing a negative index, python adjusts it to be positive
- BUT it can still overflow in the negatives if the index is too small.
- For example, list[-6] when list contains 5 items means index = -1 in here.
- (theeth)
- */
-
- /* bail if no Nurbs in Curve */
- if( npoints == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "no points in this CurNurb" ) );
-
- /* check index limits */
- if( index >= npoints || index < 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" ) );
-
- return CurNurb_pointAtIndex( myNurb, index );
-}
-
-/*
- * CurNurb_setPoint
- * modifies the Nth point in a Nurb
- * this is one of the tp_as_sequence methods, hence the int N argument.
- * it is called via the [] = operator, not as a usual instance method.
- */
-static int CurNurb_setPoint( BPy_CurNurb * self, int index, PyObject * pyOb )
-{
- Nurb *nurb = self->nurb;
- int size;
-
- /* check index limits */
- if( index < 0 || index >= nurb->pntsu )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array assignment index out of range" );
-
-
- /* branch by curve type */
- if ((nurb->type & 7)==CU_BEZIER) { /* BEZIER */
- /* check parameter type */
- if( !BPy_BezTriple_Check( pyOb ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a BezTriple" );
-
- /* copy bezier in array */
- memcpy( nurb->bezt + index,
- BezTriple_FromPyObject( pyOb ), sizeof( BezTriple ) );
-
- return 0; /* finished correctly */
- }
- else { /* NURBS or POLY */
- int i;
-
- /* check parameter type */
- if (!PySequence_Check( pyOb ))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of 4 (or optionally 5 if the curve is 3D) floats" );
-
- size = PySequence_Size( pyOb );
-
- /* check sequence size */
- if( size != 4 && size != 5 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of 4 (or optionally 5 if the curve is 3D) floats" );
-
- /* copy x, y, z, w */
- for( i = 0; i < 4; ++i ) {
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return -1;
-
- nurb->bp[index].vec[i] = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
-
- if (size == 5) { /* set tilt, if present */
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return -1;
-
- nurb->bp[index].alfa = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
- else { /* if not, set default */
- nurb->bp[index].alfa = 0.0f;
- }
-
- return 0; /* finished correctly */
- }
-}
-
-
-/*
- * this is an internal routine. not callable directly from python
- */
-
-PyObject *CurNurb_pointAtIndex( Nurb * nurb, int index )
-{
- PyObject *pyo;
-
- if( nurb->bp ) { /* we have a nurb curve */
- int i;
-
- /* add Tilt only if curve is 3D */
- if (nurb->flag & CU_3D)
- pyo = PyList_New( 5 );
- else
- pyo = PyList_New( 4 );
-
- for( i = 0; i < 4; i++ ) {
- PyList_SetItem( pyo, i,
- PyFloat_FromDouble( nurb->bp[index].vec[i] ) );
- }
-
- /* add Tilt only if curve is 3D */
- if (nurb->flag & CU_3D)
- PyList_SetItem( pyo, 4, PyFloat_FromDouble( nurb->bp[index].alfa ) );
-
- } else if( nurb->bezt ) { /* we have a bezier */
- /* if an error occurs, we just pass it on */
- pyo = BezTriple_CreatePyObject( &( nurb->bezt[index] ) );
-
- } else /* something is horribly wrong */
- /* neither bp or bezt is set && pntsu != 0 */
- return EXPP_ReturnPyObjError( PyExc_SystemError,
- "inconsistant structure found" );
-
- return pyo;
-}
-
-/*
- dump nurb
-*/
-
-PyObject *CurNurb_dump( BPy_CurNurb * self )
-{
- BPoint *bp = NULL;
- BezTriple *bezt = NULL;
- Nurb *nurb = self->nurb;
- int npoints = 0;
-
- if( !self->nurb )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "no Nurb in this CurNurb");
-
- printf(" type: %d, mat_nr: %d hide: %d flag: %d",
- nurb->type, nurb->mat_nr, nurb->hide, nurb->flag);
- printf("\n pntsu: %d, pntsv: %d, resolu: %d resolv: %d",
- nurb->pntsu, nurb->pntsv, nurb->resolu, nurb->resolv );
- printf("\n orderu: %d orderv: %d", nurb->orderu, nurb->orderv );
- printf("\n flagu: %d flagv: %d",
- nurb->flagu, nurb->flagv );
-
- npoints = nurb->pntsu;
-
- if( nurb->bp ) { /* we have a BPoint */
- int n;
- for( n = 0, bp = nurb->bp;
- n < npoints;
- n++, bp++ )
- {
- /* vec[4] */
- printf( "\ncoords[%d]: ", n);
- {
- int i;
- for( i = 0; i < 4; i++){
- printf("%10.3f ", bp->vec[i] );
- }
- }
-
- /* alfa, s[2] */
- printf("\n alpha: %5.2f", bp->alfa);
- /* f1, hide */
- printf(" f1 %d hide %d", bp->f1, bp->hide );
- printf("\n");
- }
- }
- else { /* we have a BezTriple */
- int n;
- for( n = 0, bezt = nurb->bezt;
- n < npoints;
- n++, bezt++ )
- {
- int i, j;
- printf("\npoint %d: ", n);
- for( i = 0; i < 3; i++ ) {
- printf("\nvec[%i] ",i );
- for( j = 0; j < 3; j++ ) {
- printf(" %5.2f ", bezt->vec[i][j] );
- }
- }
-
-
- }
- printf("\n");
- }
-
- Py_RETURN_NONE;
-}
-
-/*
- recalc nurb
-*/
-
-static PyObject *CurNurb_recalc( BPy_CurNurb * self )
-{
- calchandlesNurb ( self->nurb );
- Py_RETURN_NONE;
-}
-
-PyObject *CurNurb_switchDirection( BPy_CurNurb * self )
-{
- if( !self->nurb )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "no Nurb in this CurNurb");
-
- switchdirectionNurb( self->nurb );
-
- Py_RETURN_NONE;
-}
-
-PyObject *CurNurb_Init( void )
-{
- if( PyType_Ready( &CurNurb_Type ) < 0)
- return NULL;
-
- return Py_InitModule3( "Blender.CurNurb", M_CurNurb_methods,
- M_CurNurb_doc );
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *CurNurb_oldsetType( BPy_CurNurb * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)CurNurb_setType );
-}
-
-static PyObject *CurNurb_oldsetMatIndex( BPy_CurNurb * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)CurNurb_setMatIndex );
-}
-
-static PyObject *CurNurb_oldsetFlagU( BPy_CurNurb * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)CurNurb_setFlagU );
-}
-
-static PyObject *CurNurb_oldsetFlagV( BPy_CurNurb * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)CurNurb_setFlagV );
-}
diff --git a/source/blender/python/api2_2x/CurNurb.h b/source/blender/python/api2_2x/CurNurb.h
deleted file mode 100644
index 17254036563..00000000000
--- a/source/blender/python/api2_2x/CurNurb.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EXPP_NURB_H
-#define EXPP_NURB_H
-
-#include <Python.h>
-#include "DNA_curve_types.h"
-
-extern PyTypeObject CurNurb_Type;
-
-#define BPy_CurNurb_Check(v) ((v)->ob_type == &CurNurb_Type) /* for type checking */
-
-/* Python BPy_CurNurb structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- Nurb * nurb; /* pointer to Blender data */
-
- /* iterator stuff */
- /* internal ptrs to point data. do not free */
- BPoint *bp;
- BezTriple *bezt;
- int atEnd; /* iter exhausted flag */
- int nextPoint;
-
-} BPy_CurNurb;
-
-
-/*
- * prototypes
- */
-
-PyObject *CurNurb_Init( void );
-PyObject *CurNurb_CreatePyObject( Nurb * bzt );
-Nurb *CurNurb_FromPyObject( PyObject * pyobj );
-
-PyObject *CurNurb_getPoint( BPy_CurNurb * self, int index );
-PyObject *CurNurb_pointAtIndex( Nurb * nurb, int index );
-
-PyObject *CurNurb_appendPointToNurb( Nurb * nurb, PyObject * args );
-
-#endif /* EXPP_NURB_H */
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c
deleted file mode 100644
index d1abde19de9..00000000000
--- a/source/blender/python/api2_2x/Curve.c
+++ /dev/null
@@ -1,1695 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Curve.h" /*This must come first*/
-
-#include "BLI_blenlib.h"
-#include "BKE_main.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_curve.h"
-#include "BKE_material.h"
-#include "MEM_guardedalloc.h" /* because we wil be mallocing memory */
-#include "CurNurb.h"
-#include "SurfNurb.h"
-#include "Material.h"
-#include "Object.h"
-#include "Key.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "mydevice.h"
-
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Curve.__doc__ */
-/*****************************************************************************/
-
-char M_Curve_doc[] = "The Blender Curve module\n\n\
-This module provides access to **Curve Data** in Blender.\n\
-Functions :\n\
- New(opt name) : creates a new curve object with the given name (optional)\n\
- Get(name) : retreives a curve with the given name (mandatory)\n\
- get(name) : same as Get. Kept for compatibility reasons";
-char M_Curve_New_doc[] = "";
-char M_Curve_Get_doc[] = "xxx";
-
-
-
-/*****************************************************************************/
-/* Python API function prototypes for the Curve module. */
-/*****************************************************************************/
-static PyObject *M_Curve_New( PyObject * self, PyObject * args );
-static PyObject *M_Curve_Get( PyObject * self, PyObject * args );
-
-
-/*****************************************************************************/
-/* Python BPy_Curve instance methods declarations: */
-/*****************************************************************************/
-
-static PyObject *Curve_getPathLen( BPy_Curve * self );
-static PyObject *Curve_setPathLen( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getTotcol( BPy_Curve * self );
-static PyObject *Curve_setTotcol( BPy_Curve * self, PyObject * args );
-#if 0
-PyObject *Curve_getResolu( BPy_Curve * self );
-PyObject *Curve_setResolu( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getResolv( BPy_Curve * self );
-PyObject *Curve_setResolv( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getWidth( BPy_Curve * self );
-PyObject *Curve_setWidth( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt1( BPy_Curve * self );
-PyObject *Curve_setExt1( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt2( BPy_Curve * self );
-PyObject *Curve_setExt2( BPy_Curve * self, PyObject * args );
-#endif
-static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getLoc( BPy_Curve * self );
-static PyObject *Curve_setLoc( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getRot( BPy_Curve * self );
-static PyObject *Curve_setRot( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getSize( BPy_Curve * self );
-static PyObject *Curve_setSize( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_getNumCurves( BPy_Curve * self );
-static PyObject *Curve_getKey( BPy_Curve * self );
-static PyObject *Curve_isNurb( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_isCyclic( BPy_Curve * self, PyObject * args);
-static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args );
-
-static PyObject *Curve_appendPoint( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * args );
-
-static PyObject *Curve_getMaterials( BPy_Curve * self );
-
-static PyObject *Curve_getBevOb( BPy_Curve * self );
-static PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args );
-
-static PyObject *Curve_getTaperOb( BPy_Curve * self );
-static PyObject *Curve_setTaperOb( BPy_Curve * self, PyObject * args );
-static PyObject *Curve_copy( BPy_Curve * self );
-
-static PyObject *Curve_getIter( BPy_Curve * self );
-static PyObject *Curve_iterNext( BPy_Curve * self );
-
-PyObject *Curve_getNurb( BPy_Curve * self, int n );
-static int Curve_setNurb( BPy_Curve * self, int n, PyObject * value );
-static int Curve_length( PyInstanceObject * inst );
-
-
-struct chartrans *text_to_curve( Object * ob, int mode );
-/*****************************************************************************/
-/* Python BPy_Curve methods: */
-/* gives access to */
-/* name, pathlen totcol flag bevresol */
-/* resolu resolv width ext1 ext2 */
-/* controlpoint loc rot size */
-/* numpts */
-/*****************************************************************************/
-
-
-PyObject *Curve_getName( BPy_Curve * self )
-{
- return PyString_FromString( self->curve->id.name + 2 );
-}
-
-static int Curve_newsetName( BPy_Curve * self, PyObject * args )
-{
- char *name;
-
- name = PyString_AsString( args );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- rename_id( &self->curve->id, name ); /* proper way in Blender */
- Curve_update( self );
-
- return 0;
-}
-
-static PyObject *Curve_getPathLen( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->pathlen );
-}
-
-
-static int Curve_newsetPathLen( BPy_Curve * self, PyObject * args )
-{
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- num = PyNumber_Int( args );
- self->curve->pathlen = (short)PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- return 0;
-}
-
-static PyObject *Curve_getTotcol( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->totcol );
-}
-
-
-PyObject *Curve_getMode( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->flag );
-}
-
-
-static int Curve_newsetMode( BPy_Curve * self, PyObject * args )
-{
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- num = PyNumber_Int( args );
- self->curve->flag = (short)PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- return 0;
-}
-
-PyObject *Curve_getBevresol( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->bevresol );
-}
-
-static int Curve_newsetBevresol( BPy_Curve * self, PyObject * args )
-{
- short value;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- num = PyNumber_Int( args );
- value = (short)PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- if( value > 10 || value < 0 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 0 and 10" );
-
- self->curve->bevresol = value;
- return 0;
-}
-
-
-PyObject *Curve_getResolu( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->resolu );
-}
-
-
-static int Curve_newsetResolu( BPy_Curve * self, PyObject * args )
-{
- short value;
- Nurb *nu;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- num = PyNumber_Int( args );
- value = (short)PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- if( value > 128 || value < 1 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 1 and 128" );
-
- self->curve->resolu = value;
- /* propagate the change through all the curves */
- for( nu = self->curve->nurb.first; nu; nu = nu->next )
- nu->resolu = value;
-
- return 0;
-}
-
-PyObject *Curve_getResolv( BPy_Curve * self )
-{
- return PyInt_FromLong( ( long ) self->curve->resolv );
-}
-
-static int Curve_newsetResolv( BPy_Curve * self, PyObject * args )
-{
- short value;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- num = PyNumber_Int( args );
- value = (short)PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- if(value > 128 || value < 1)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 1 and 128" );
- self->curve->resolv = value;
-
- return 0;
-}
-
-PyObject *Curve_getWidth( BPy_Curve * self )
-{
- return PyFloat_FromDouble( ( double ) self->curve->width );
-}
-
-
-static int Curve_newsetWidth( BPy_Curve * self, PyObject * args )
-{
- float value;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- num = PyNumber_Float( args );
- value = (float)PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
-
- if(value > 2.0f || value < 0.0f)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 2.0 and 0.0" );
- self->curve->width = value;
-
- return 0;
-}
-
-
-PyObject *Curve_getExt1( BPy_Curve * self )
-{
- return PyFloat_FromDouble( ( double ) self->curve->ext1 );
-}
-
-
-static int Curve_newsetExt1( BPy_Curve * self, PyObject * args )
-{
- float value;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- num = PyNumber_Float( args );
- value = (float)PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
-
- if(value > 100.0f || value < 0.0f)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 0.0 and 100.0" );
- self->curve->ext1 = value;
-
- return 0;
-}
-
-PyObject *Curve_getExt2( BPy_Curve * self )
-{
- return PyFloat_FromDouble( ( double ) self->curve->ext2 );
-}
-
-
-static int Curve_newsetExt2( BPy_Curve * self, PyObject * args )
-{
- float value;
- PyObject *num;
-
- if( !PyNumber_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- num = PyNumber_Float( args );
- value = (float)PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
-
- if(value > 2.0f || value < 0.0f)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are between 0.0 and 2.0" );
- self->curve->ext2 = value;
-
- return 0;
-}
-
-/*
- * Curve_setControlPoint
- * this function sets an EXISTING control point.
- * it does NOT add a new one.
- */
-
-static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args )
-{
- PyObject *listargs = 0;
- Nurb *ptrnurb = self->curve->nurb.first;
- int numcourbe = 0, numpoint = 0, i, j;
-
- if( !ptrnurb )
- Py_RETURN_NONE;
-
- if( ptrnurb->bp )
- if( !PyArg_ParseTuple
- ( args, "iiO", &numcourbe, &numpoint, &listargs ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int, int, list arguments" ) );
- if( ptrnurb->bezt )
- if( !PyArg_ParseTuple
- ( args, "iiO", &numcourbe, &numpoint, &listargs ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int, int, list arguments" ) );
-
- for( i = 0; i < numcourbe; i++ )
- ptrnurb = ptrnurb->next;
-
- if( ptrnurb->bp )
- for( i = 0; i < 4; i++ )
- ptrnurb->bp[numpoint].vec[i] =
- (float)PyFloat_AsDouble( PyList_GetItem ( listargs, i ) );
-
- if( ptrnurb->bezt )
- for( i = 0; i < 3; i++ )
- for( j = 0; j < 3; j++ )
- ptrnurb->bezt[numpoint].vec[i][j] =
- (float)PyFloat_AsDouble( PyList_GetItem
- ( listargs,
- i * 3 + j ) );
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args )
-{
- PyObject *liste;
- PyObject *item;
-
- Nurb *ptrnurb;
- int i, j;
- /* input args: requested curve and point number on curve */
- int numcourbe, numpoint;
-
- if( !PyArg_ParseTuple( args, "ii", &numcourbe, &numpoint ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int int arguments" ) );
- if( ( numcourbe < 0 ) || ( numpoint < 0 ) )
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "arguments must be non-negative" ) );
-
- /* if no nurbs in this curve obj */
- if( !self->curve->nurb.first )
- return PyList_New( 0 );
-
- /* walk the list of nurbs to find requested numcourbe */
- ptrnurb = self->curve->nurb.first;
- for( i = 0; i < numcourbe; i++ ) {
- ptrnurb = ptrnurb->next;
- if( !ptrnurb ) /* if zero, we ran just ran out of curves */
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve index out of range" ) );
- }
-
- /* check numpoint param against pntsu */
- if( numpoint >= ptrnurb->pntsu )
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "point index out of range" ) );
-
- liste = PyList_New( 0 );
- if( ptrnurb->bp ) { /* if we are a nurb curve, you get 4 values */
- for( i = 0; i < 4; i++ ) {
- item = PyFloat_FromDouble( ptrnurb->bp[numpoint].vec[i] );
- PyList_Append( liste, item );
- Py_DECREF(item);
- }
- } else if( ptrnurb->bezt ) { /* if we are a bezier, you get 9 values */
- for( i = 0; i < 3; i++ )
- for( j = 0; j < 3; j++ ) {
- item = PyFloat_FromDouble( ptrnurb->bezt[numpoint].vec[i][j] );
- PyList_Append( liste, item );
- Py_DECREF(item);
- }
- }
-
- return liste;
-}
-
-static PyObject *Curve_getLoc( BPy_Curve * self )
-{
- return Py_BuildValue( "[f,f,f]", self->curve->loc[0],
- self->curve->loc[1], self->curve->loc[2] );
-}
-
-static int Curve_newsetLoc( BPy_Curve * self, PyObject * args )
-{
- float loc[3];
- int i;
-
- if( ( !PyList_Check( args ) && !PyTuple_Check( args ) ) ||
- PySequence_Size( args ) != 3 ) {
-TypeError:
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of three floats" );
- }
-
- for( i = 0; i < 3; i++ ) {
- PyObject *item = PySequence_GetItem( args, i );
- PyObject *num = PyNumber_Float( item );
- Py_DECREF( item );
- if( !num )
- goto TypeError;
- loc[i] = PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
- }
- memcpy( self->curve->loc, loc, sizeof( loc ) );
-
- return 0;
-}
-
-static PyObject *Curve_getRot( BPy_Curve * self )
-{
- return Py_BuildValue( "[f,f,f]", self->curve->rot[0],
- self->curve->rot[1], self->curve->rot[2] );
-}
-
-static int Curve_newsetRot( BPy_Curve * self, PyObject * args )
-{
- float rot[3];
- int i;
-
- if( ( !PyList_Check( args ) && !PyTuple_Check( args ) ) ||
- PySequence_Size( args ) != 3 ) {
-TypeError:
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of three floats" );
- }
-
- for( i = 0; i < 3; i++ ) {
- PyObject *item = PySequence_GetItem( args, i );
- PyObject *num = PyNumber_Float( item );
- Py_DECREF( item );
- if( !num )
- goto TypeError;
- rot[i] = PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
- }
- memcpy( self->curve->rot, rot, sizeof( rot ) );
-
- return 0;
-}
-
-static PyObject *Curve_getSize( BPy_Curve * self )
-{
- return Py_BuildValue( "[f,f,f]", self->curve->size[0],
- self->curve->size[1], self->curve->size[2] );
-}
-
-static int Curve_newsetSize( BPy_Curve * self, PyObject * args )
-{
- float size[3];
- int i;
-
- if( ( !PyList_Check( args ) && !PyTuple_Check( args ) ) ||
- PySequence_Size( args ) != 3 ) {
-TypeError:
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of three floats" );
- }
-
- for( i = 0; i < 3; i++ ) {
- PyObject *item = PySequence_GetItem( args, i );
- PyObject *num = PyNumber_Float( item );
- Py_DECREF( item );
- if( !num )
- goto TypeError;
- size[i] = PyFloat_AS_DOUBLE( num );
- Py_DECREF( num );
- }
- memcpy( self->curve->size, size, sizeof( size ) );
-
- return 0;
-}
-
-/*
- * Count the number of splines in a Curve Object
- * int getNumCurves()
- */
-
-static PyObject *Curve_getNumCurves( BPy_Curve * self )
-{
- Nurb *ptrnurb;
- PyObject *ret_val;
- int num_curves = 0; /* start with no splines */
-
- /* get curve */
- ptrnurb = self->curve->nurb.first;
- if( ptrnurb ) { /* we have some nurbs in this curve */
- for(;;) {
- ++num_curves;
- ptrnurb = ptrnurb->next;
- if( !ptrnurb ) /* no more curves */
- break;
- }
- }
-
- ret_val = PyInt_FromLong( ( long ) num_curves );
-
- if( ret_val )
- return ret_val;
-
- /* oops! */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get number of curves" );
-}
-
-/*
- * get the key object linked to this curve
- */
-
-static PyObject *Curve_getKey( BPy_Curve * self )
-{
- PyObject *keyObj;
-
- if (self->curve->key)
- keyObj = Key_CreatePyObject(self->curve->key);
- else keyObj = EXPP_incr_ret(Py_None);
-
- return keyObj;
-}
-
-/*
- * count the number of points in a given spline
- * int getNumPoints( curve_num=0 )
- *
- */
-
-static PyObject *Curve_getNumPoints( BPy_Curve * self, PyObject * args )
-{
- Nurb *ptrnurb;
- PyObject *ret_val;
- int curve_num = 0; /* default spline number */
- int i;
-
- /* parse input arg */
- if( !PyArg_ParseTuple( args, "|i", &curve_num ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
-
- /* check arg - must be non-negative */
- if( curve_num < 0 )
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "argument must be non-negative" ) );
-
-
- /* walk the list of curves looking for our curve */
- ptrnurb = self->curve->nurb.first;
- if( !ptrnurb ) { /* no splines in this Curve */
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no splines in this Curve" ) );
- }
-
- for( i = 0; i < curve_num; i++ ) {
- ptrnurb = ptrnurb->next;
- if( !ptrnurb ) /* if zero, we ran just ran out of curves */
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve index out of range" ) );
- }
-
- /* pntsu is the number of points in curve */
- ret_val = PyInt_FromLong( ( long ) ptrnurb->pntsu );
-
- if( ret_val )
- return ret_val;
-
- /* oops! */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get number of points for curve" );
-}
-
-/*
- * Test whether a given spline of a Curve is a nurb
- * as opposed to a bezier
- * int isNurb( curve_num=0 )
- */
-
-static PyObject *Curve_isNurb( BPy_Curve * self, PyObject * args )
-{
- int curve_num = 0; /* default value */
- int is_nurb;
- Nurb *ptrnurb;
- PyObject *ret_val;
- int i;
-
- /* parse and check input args */
- if( !PyArg_ParseTuple( args, "|i", &curve_num ) ) {
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
- }
- if( curve_num < 0 ) {
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve number must be non-negative" ) );
- }
-
- ptrnurb = self->curve->nurb.first;
-
- if( !ptrnurb ) /* no splines in this curve */
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no splines in this Curve" ) );
-
- for( i = 0; i < curve_num; i++ ) {
- ptrnurb = ptrnurb->next;
- if( !ptrnurb ) /* if zero, we ran just ran out of curves */
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve index out of range" ) );
- }
-
- /* right now, there are only two curve types, nurb and bezier. */
- is_nurb = ptrnurb->bp ? 1 : 0;
-
- ret_val = PyInt_FromLong( ( long ) is_nurb );
- if( ret_val )
- return ret_val;
-
- /* oops */
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get curve type" ) );
-}
-
-/* trying to make a check for closedness (cyclic), following on isNurb (above)
- copy-pasting done by antont@kyperjokki.fi */
-
-static PyObject *Curve_isCyclic( BPy_Curve * self, PyObject * args )
-{
- int curve_num = 0; /* default value */
- /* unused:*/
- /* int is_cyclic;
- * PyObject *ret_val;*/
- Nurb *ptrnurb;
- int i;
-
- /* parse and check input args */
- if( !PyArg_ParseTuple( args, "|i", &curve_num ) ) {
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
- }
- if( curve_num < 0 ) {
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve number must be non-negative" ) );
- }
-
- ptrnurb = self->curve->nurb.first;
-
- if( !ptrnurb ) /* no splines in this curve */
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no splines in this Curve" ) );
-
- for( i = 0; i < curve_num; i++ ) {
- ptrnurb = ptrnurb->next;
- if( !ptrnurb ) /* if zero, we ran just ran out of curves */
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "curve index out of range" ) );
- }
-
- if( ptrnurb->flagu & CU_CYCLIC ){
- return EXPP_incr_ret_True();
- } else {
- return EXPP_incr_ret_False();
- }
-}
-
-
-/*
- * Curve_appendPoint( numcurve, new_point )
- * append a new point to indicated spline
- */
-
-static PyObject *Curve_appendPoint( BPy_Curve * self, PyObject * args )
-{
- int i;
- int nurb_num; /* index of curve we append to */
- PyObject *coord_args; /* coords for new point */
- Nurb *nurb = self->curve->nurb.first; /* first nurb in Curve */
-
-/* fixme - need to malloc new Nurb */
- if( !nurb )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, "no nurbs in this Curve" ) );
-
- if( !PyArg_ParseTuple( args, "iO", &nurb_num, &coord_args ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int, coords as arguments" ) );
-
- /*
- chase down the list of Nurbs looking for our curve.
- */
- for( i = 0; i < nurb_num; i++ ) {
- nurb = nurb->next;
- if( !nurb ) /* we ran off end of list */
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "curve index out of range" );
- }
- return CurNurb_appendPointToNurb( nurb, coord_args );
-}
-
-
-/****
- appendNurb( new_point )
- create a new nurb in the Curve and add the point param to it.
- returns a refernce to the newly created nurb.
-*****/
-
-static PyObject *Curve_appendNurb( BPy_Curve * self, PyObject * value )
-{
- Nurb *new_nurb;
- /* malloc new nurb */
- new_nurb = ( Nurb * ) MEM_callocN( sizeof( Nurb ), "appendNurb" );
- if( !new_nurb )
- return EXPP_ReturnPyObjError
- ( PyExc_MemoryError, "unable to malloc Nurb" );
-
- if( CurNurb_appendPointToNurb( new_nurb, value ) ) {
- new_nurb->resolu = self->curve->resolu;
- new_nurb->resolv = self->curve->resolv;
- new_nurb->hide = 0;
- new_nurb->flag = 1;
-
-
- if( new_nurb->bezt ) { /* do setup for bezt */
- new_nurb->type = CU_BEZIER;
- new_nurb->bezt->h1 = HD_ALIGN;
- new_nurb->bezt->h2 = HD_ALIGN;
- new_nurb->bezt->f1 = SELECT;
- new_nurb->bezt->f2 = SELECT;
- new_nurb->bezt->f3 = SELECT;
- new_nurb->bezt->hide = 0;
- new_nurb->bezt->radius = 1.0;
- /* calchandlesNurb( new_nurb ); */
- } else { /* set up bp */
- new_nurb->pntsv = 1;
- new_nurb->type = CU_NURBS;
- new_nurb->orderu = 4;
- new_nurb->flagu = 0;
- new_nurb->flagv = 0;
- new_nurb->bp->f1 = 0;
- new_nurb->bp->hide = 0;
- new_nurb->bp->radius = 1.0;
- new_nurb->knotsu = 0;
- /*makenots( new_nurb, 1, new_nurb->flagu >> 1); */
- }
- BLI_addtail( &self->curve->nurb, new_nurb);
-
- } else {
- freeNurb( new_nurb );
- return NULL; /* with PyErr already set */
- }
-
- return CurNurb_CreatePyObject( new_nurb );
-}
-
-
-/*
- * Curve_update( )
- * method to update display list for a Curve.
- * used. after messing with control points
- */
-
-PyObject *Curve_update( BPy_Curve * self )
-{
- Nurb *nu = self->curve->nurb.first;
-
- /* recalculate handles for each curve: calchandlesNurb() will make
- * sure curves are bezier first */
- while( nu ) {
- calchandlesNurb ( nu );
- nu = nu->next;
- }
-
- Object_updateDag( (void*) self->curve );
-
- Py_RETURN_NONE;
-}
-
-/*
- * Curve_getMaterials
- *
- */
-
-static PyObject *Curve_getMaterials( BPy_Curve * self )
-{
- return EXPP_PyList_fromMaterialList( self->curve->mat,
- self->curve->totcol, 1 );
-}
-
-static int Curve_setMaterials( BPy_Curve *self, PyObject * value )
-{
- Material **matlist;
- int len;
-
- if( !PySequence_Check( value ) ||
- !EXPP_check_sequence_consistency( value, &Material_Type ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "sequence should only contain materials or None)" );
-
- len = PySequence_Size( value );
- if( len > 16 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "list can't have more than 16 materials" );
-
- /* free old material list (if it exists) and adjust user counts */
- if( self->curve->mat ) {
- Curve *cur = self->curve;
- int i;
- for( i = cur->totcol; i-- > 0; )
- if( cur->mat[i] )
- cur->mat[i]->id.us--;
- MEM_freeN( cur->mat );
- }
-
- /* build the new material list, increment user count, store it */
-
- matlist = EXPP_newMaterialList_fromPyList( value );
- EXPP_incr_mats_us( matlist, len );
- self->curve->mat = matlist;
- self->curve->totcol = (short)len;
-
-/**@ This is another ugly fix due to the weird material handling of blender.
- * it makes sure that object material lists get updated (by their length)
- * according to their data material lists, otherwise blender crashes.
- * It just stupidly runs through all objects...BAD BAD BAD.
- */
-
- test_object_materials( ( ID * ) self->curve );
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: Curve_getBevOb */
-/* Description: Get the bevel object assign to the curve. */
-/*****************************************************************************/
-static PyObject *Curve_getBevOb( BPy_Curve * self)
-{
- if( self->curve->bevobj ) {
- return Object_CreatePyObject( self->curve->bevobj );
- }
-
- return EXPP_incr_ret( Py_None );
-}
-
-/*****************************************************************************/
-/* Function: Curve_newsetBevOb */
-/* Description: Assign a bevel object to the curve. */
-/*****************************************************************************/
-static int Curve_newsetBevOb( BPy_Curve * self, PyObject * args )
-{
-
- if (BPy_Object_Check( args ) && ((BPy_Object *)args)->object->data == self->curve )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Can't bevel an object to itself" );
-
- return GenericLib_assignData(args, (void **) &self->curve->bevobj, 0, 0, ID_OB, OB_CURVE);
-}
-
-/*****************************************************************************/
-/* Function: Curve_getTaperOb */
-/* Description: Get the taper object assign to the curve. */
-/*****************************************************************************/
-
-static PyObject *Curve_getTaperOb( BPy_Curve * self)
-{
- if( self->curve->taperobj )
- return Object_CreatePyObject( self->curve->taperobj );
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Curve_newsetTaperOb */
-/* Description: Assign a taper object to the curve. */
-/*****************************************************************************/
-
-static int Curve_newsetTaperOb( BPy_Curve * self, PyObject * args )
-{
- if (BPy_Object_Check( args ) && ((BPy_Object *)args)->object->data == self->curve )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Can't taper an object to itself" );
-
- return GenericLib_assignData(args, (void **) &self->curve->taperobj, 0, 0, ID_OB, OB_CURVE);
-}
-
-/*****************************************************************************/
-/* Function: Curve_copy */
-/* Description: Return a copy of this curve data. */
-/*****************************************************************************/
-
-PyObject *Curve_copy( BPy_Curve * self )
-{
- BPy_Curve *pycurve; /* for Curve Data object wrapper in Python */
- Curve *blcurve = 0; /* for actual Curve Data we create in Blender */
-
- /* copies the data */
- blcurve = copy_curve( self->curve ); /* first create the Curve Data in Blender */
-
- if( blcurve == NULL ) /* bail out if add_curve() failed */
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "couldn't create Curve Data in Blender" ) );
-
- /* return user count to zero because add_curve() inc'd it */
- blcurve->id.us = 0;
-
- /* create python wrapper obj */
- pycurve = ( BPy_Curve * ) PyObject_NEW( BPy_Curve, &Curve_Type );
-
- if( pycurve == NULL )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Curve Data object" ) );
-
- pycurve->curve = blcurve; /* link Python curve wrapper to Blender Curve */
- return ( PyObject * ) pycurve;
-}
-
-
-/*
- * Curve_getIter
- *
- * create an iterator for our Curve.
- * this iterator returns the Nurbs for this Curve.
- * the iter_pointer always points to the next available item or null
- */
-
-static PyObject *Curve_getIter( BPy_Curve * self )
-{
- self->iter_pointer = self->curve->nurb.first;
-
- Py_INCREF( self );
- return ( PyObject * ) self;
-
-}
-
-
-/*
- * Curve_iterNext
- * get the next item.
- * iter_pointer always points to the next available element
- * or NULL if at the end of the list.
- */
-
-static PyObject *Curve_iterNext( BPy_Curve * self )
-{
- Nurb *pnurb;
-
- if( self->iter_pointer ) {
- pnurb = self->iter_pointer;
- self->iter_pointer = pnurb->next; /* advance iterator */
- if( (pnurb->type & 7) == CU_BEZIER || pnurb->pntsv <= 1 )
- return CurNurb_CreatePyObject( pnurb ); /* make a bpy_curnurb */
- else
- return SurfNurb_CreatePyObject( pnurb ); /* make a bpy_surfnurb */
- }
-
- /* if iter_pointer was null, we are at end */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/* tp_sequence methods */
-
-/*
- * Curve_length
- * returns the number of curves in a Curve
- * this is a tp_as_sequence method, not a regular instance method.
- */
-
-static int Curve_length( PyInstanceObject * inst )
-{
- if( BPy_Curve_Check( ( PyObject * ) inst ) )
- return ( ( int ) PyInt_AsLong
- ( Curve_getNumCurves( ( BPy_Curve * ) inst ) ) );
-
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "arg is not a BPy_Curve" );
-
-}
-
-/*
- * Curve_getNurb
- * returns the Nth nurb in a Curve.
- * this is one of the tp_as_sequence methods, hence the int N argument.
- * it is called via the [] operator, not as a usual instance method.
- */
-
-PyObject *Curve_getNurb( BPy_Curve * self, int n )
-{
- Nurb *pNurb;
- int i;
-
- /* bail if index < 0 */
- if( n < 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "index less than 0" ) );
- /* bail if no Nurbs in Curve */
- if( self->curve->nurb.first == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "no Nurbs in this Curve" ) );
- /* set pointer to nth Nurb */
- for( pNurb = self->curve->nurb.first, i = 0;
- pNurb != 0 && i < n; pNurb = pNurb->next, ++i )
- /**/;
-
- if( !pNurb ) /* we came to the end of the list */
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" ) );
-
- /* until there is a Surface BPyType, distinquish between a curve and a
- * surface based on whether it's a Bezier and the v size */
- if( (pNurb->type & 7) == CU_BEZIER || pNurb->pntsv <= 1 )
- return CurNurb_CreatePyObject( pNurb ); /* make a bpy_curnurb */
- else
- return SurfNurb_CreatePyObject( pNurb ); /* make a bpy_surfnurb */
-
-}
-
-/*
- * Curve_setNurb
- * In this case only remove the item, we could allow adding later.
- */
-static int Curve_setNurb( BPy_Curve * self, int n, PyObject * value )
-{
- Nurb *pNurb;
- int i;
-
- /* bail if index < 0 */
- if( n < 0 )
- return ( EXPP_ReturnIntError( PyExc_IndexError,
- "index less than 0" ) );
- /* bail if no Nurbs in Curve */
- if( self->curve->nurb.first == 0 )
- return ( EXPP_ReturnIntError( PyExc_IndexError,
- "no Nurbs in this Curve" ) );
- /* set pointer to nth Nurb */
- for( pNurb = self->curve->nurb.first, i = 0;
- pNurb != 0 && i < n; pNurb = pNurb->next, ++i )
- /**/;
-
- if( !pNurb ) /* we came to the end of the list */
- return ( EXPP_ReturnIntError( PyExc_IndexError,
- "index out of range" ) );
-
- if (value) {
- return ( EXPP_ReturnIntError( PyExc_RuntimeError,
- "assigning curves is not yet supported" ) );
- } else {
- BLI_remlink(&self->curve->nurb, pNurb);
- freeNurb(pNurb);
- }
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: Curve_compare */
-/* Description: This compares 2 curve python types, == or != only. */
-/*****************************************************************************/
-static int Curve_compare( BPy_Curve * a, BPy_Curve * b )
-{
- return ( a->curve == b->curve ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Curve_repr */
-/* Description: This is a callback function for the BPy_Curve type. It */
-/* builds a meaninful string to represent curve objects. */
-/*****************************************************************************/
-static PyObject *Curve_repr( BPy_Curve * self )
-{ /* used by 'repr' */
-
- return PyString_FromFormat( "[Curve \"%s\"]",
- self->curve->id.name + 2 );
-}
-
-/* attributes for curves */
-
-static PyGetSetDef Curve_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"pathlen",
- (getter)Curve_getPathLen, (setter)Curve_newsetPathLen,
- "The path length, used to set the number of frames for an animation (not the physical length)",
- NULL},
- {"totcol",
- (getter)Curve_getTotcol, (setter)NULL,
- "The maximum number of linked materials",
- NULL},
- {"flag",
- (getter)Curve_getMode, (setter)Curve_newsetMode,
- "The flag bitmask",
- NULL},
- {"bevresol",
- (getter)Curve_getBevresol, (setter)Curve_newsetBevresol,
- "The bevel resolution",
- NULL},
- {"resolu",
- (getter)Curve_getResolu, (setter)Curve_newsetResolu,
- "The resolution in U direction",
- NULL},
- {"resolv",
- (getter)Curve_getResolv, (setter)Curve_newsetResolv,
- "The resolution in V direction",
- NULL},
- {"width",
- (getter)Curve_getWidth, (setter)Curve_newsetWidth,
- "The curve width",
- NULL},
- {"ext1",
- (getter)Curve_getExt1, (setter)Curve_newsetExt1,
- "The extent1 value (for bevels)",
- NULL},
- {"ext2",
- (getter)Curve_getExt2, (setter)Curve_newsetExt2,
- "The extent2 value (for bevels)",
- NULL},
- {"loc",
- (getter)Curve_getLoc, (setter)Curve_newsetLoc,
- "The data location (from the center)",
- NULL},
- {"rot",
- (getter)Curve_getRot, (setter)Curve_newsetRot,
- "The data rotation (from the center)",
- NULL},
- {"size",
- (getter)Curve_getSize, (setter)Curve_newsetSize,
- "The data size (from the center)",
- NULL},
- {"bevob",
- (getter)Curve_getBevOb, (setter)Curve_newsetBevOb,
- "The bevel object",
- NULL},
- {"taperob",
- (getter)Curve_getTaperOb, (setter)Curve_newsetTaperOb,
- "The taper object",
- NULL},
- {"key",
- (getter)Curve_getKey, (setter)NULL,
- "The shape key for the curve (if any)",
- NULL},
- {"materials",
- (getter)Curve_getMaterials, (setter)Curve_setMaterials,
- "The materials associated with the curve",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-
-};
-
-/*****************************************************************************/
-/* Function: M_Curve_New */
-/* Python equivalent: Blender.Curve.New */
-/*****************************************************************************/
-static PyObject *M_Curve_New( PyObject * self, PyObject * args )
-{
- char *name = "Curve";
- BPy_Curve *pycurve; /* for Curve Data object wrapper in Python */
- Curve *blcurve = 0; /* for actual Curve Data we create in Blender */
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected string argument or no argument" ) );
-
- blcurve = add_curve( name, OB_CURVE ); /* first create the Curve Data in Blender */
-
- if( blcurve == NULL ) /* bail out if add_curve() failed */
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "couldn't create Curve Data in Blender" ) );
-
- /* return user count to zero because add_curve() inc'd it */
- blcurve->id.us = 0;
- /* create python wrapper obj */
- pycurve = ( BPy_Curve * ) PyObject_NEW( BPy_Curve, &Curve_Type );
-
- if( pycurve == NULL )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Curve Data object" ) );
-
- pycurve->curve = blcurve; /* link Python curve wrapper to Blender Curve */
-
- return ( PyObject * ) pycurve;
-}
-
-/*****************************************************************************/
-/* Function: M_Curve_Get */
-/* Python equivalent: Blender.Curve.Get */
-/*****************************************************************************/
-static PyObject *M_Curve_Get( PyObject * self, PyObject * args )
-{
-
- char *name = NULL;
- Curve *curv_iter;
- BPy_Curve *wanted_curv;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) ) /* expects nothing or a string */
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" ) );
- if( name ) { /*a name has been given */
- /* Use the name to search for the curve requested */
- wanted_curv = NULL;
- curv_iter = G.main->curve.first;
-
- while( ( curv_iter ) && ( wanted_curv == NULL ) ) {
-
- if( strcmp( name, curv_iter->id.name + 2 ) == 0 ) {
- wanted_curv = ( BPy_Curve * )
- PyObject_NEW( BPy_Curve, &Curve_Type );
- if( wanted_curv )
- wanted_curv->curve = curv_iter;
- }
-
- curv_iter = curv_iter->id.next;
- }
-
- if( wanted_curv == NULL ) { /* Requested curve doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Curve \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
-
- return ( PyObject * ) wanted_curv;
- } /* end of if(name) */
- else {
- /* no name has been given; return a list of all curves by name. */
- PyObject *curvlist;
-
- curv_iter = G.main->curve.first;
- curvlist = PyList_New( 0 );
-
- if( curvlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( curv_iter ) {
- BPy_Curve *found_cur =
- ( BPy_Curve * ) PyObject_NEW( BPy_Curve,
- &Curve_Type );
- found_cur->curve = curv_iter;
- PyList_Append( curvlist, ( PyObject * ) found_cur );
- Py_DECREF(found_cur);
- curv_iter = curv_iter->id.next;
- }
-
- return ( curvlist );
- } /* end of else */
-}
-
-/*****************************************************************************/
-/* Python method definitions for Blender.Curve module: */
-/*****************************************************************************/
-struct PyMethodDef M_Curve_methods[] = {
- {"New", ( PyCFunction ) M_Curve_New, METH_VARARGS, M_Curve_New_doc},
- {"Get", M_Curve_Get, METH_VARARGS, M_Curve_Get_doc},
- {"get", M_Curve_Get, METH_VARARGS, M_Curve_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Python BPy_Curve instance methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Curve_methods[] = {
- {"getName", ( PyCFunction ) Curve_getName,
- METH_NOARGS, "() - Return Curve Data name"},
- {"setName", ( PyCFunction ) Curve_setName,
- METH_VARARGS, "() - Sets Curve Data name"},
- {"getPathLen", ( PyCFunction ) Curve_getPathLen,
- METH_NOARGS, "() - Return Curve path length"},
- {"setPathLen", ( PyCFunction ) Curve_setPathLen,
- METH_VARARGS, "(int) - Sets Curve path length"},
- {"getTotcol", ( PyCFunction ) Curve_getTotcol,
- METH_NOARGS, "() - Return the number of materials of the curve"},
- {"setTotcol", ( PyCFunction ) Curve_setTotcol,
- METH_VARARGS, "(int) - Sets the number of materials of the curve"},
- {"getFlag", ( PyCFunction ) Curve_getMode,
- METH_NOARGS, "() - Return flag (see the doc for semantic)"},
- {"setFlag", ( PyCFunction ) Curve_setMode,
- METH_VARARGS, "(int) - Sets flag (see the doc for semantic)"},
- {"getBevresol", ( PyCFunction ) Curve_getBevresol,
- METH_NOARGS, "() - Return bevel resolution"},
- {"setBevresol", ( PyCFunction ) Curve_setBevresol,
- METH_VARARGS, "(int) - Sets bevel resolution"},
- {"getResolu", ( PyCFunction ) Curve_getResolu,
- METH_NOARGS, "() - Return U resolution"},
- {"setResolu", ( PyCFunction ) Curve_setResolu,
- METH_VARARGS, "(int) - Sets U resolution"},
- {"getResolv", ( PyCFunction ) Curve_getResolv,
- METH_NOARGS, "() - Return V resolution"},
- {"setResolv", ( PyCFunction ) Curve_setResolv,
- METH_VARARGS, "(int) - Sets V resolution"},
- {"getWidth", ( PyCFunction ) Curve_getWidth,
- METH_NOARGS, "() - Return curve width"},
- {"setWidth", ( PyCFunction ) Curve_setWidth,
- METH_VARARGS, "(int) - Sets curve width"},
- {"getExt1", ( PyCFunction ) Curve_getExt1,
- METH_NOARGS, "() - Returns extent 1 of the bevel"},
- {"setExt1", ( PyCFunction ) Curve_setExt1,
- METH_VARARGS, "(int) - Sets extent 1 of the bevel"},
- {"getExt2", ( PyCFunction ) Curve_getExt2,
- METH_NOARGS, "() - Return extent 2 of the bevel "},
- {"setExt2", ( PyCFunction ) Curve_setExt2,
- METH_VARARGS, "(int) - Sets extent 2 of the bevel "},
- {"getControlPoint", ( PyCFunction ) Curve_getControlPoint,
- METH_VARARGS, "(int numcurve,int numpoint) -\
-Gets a control point.Depending upon the curve type, returne a list of 4 or 9 floats"},
- {"setControlPoint", ( PyCFunction ) Curve_setControlPoint,
- METH_VARARGS, "(int numcurve,int numpoint,float x,float y,float z,\
-float w)(nurbs) or (int numcurve,int numpoint,float x1,...,x9(bezier)\
-Sets a control point "},
- {"getLoc", ( PyCFunction ) Curve_getLoc,
- METH_NOARGS, "() - Gets Location of the curve (a 3-tuple) "},
- {"setLoc", ( PyCFunction ) Curve_setLoc,
- METH_VARARGS, "(3-tuple) - Sets Location "},
- {"getRot", ( PyCFunction ) Curve_getRot,
- METH_NOARGS, "() - Gets curve rotation"},
- {"setRot", ( PyCFunction ) Curve_setRot,
- METH_VARARGS, "(3-tuple) - Sets curve rotation"},
- {"getSize", ( PyCFunction ) Curve_getSize,
- METH_NOARGS, "() - Gets curve size"},
- {"setSize", ( PyCFunction ) Curve_setSize,
- METH_VARARGS, "(3-tuple) - Sets curve size"},
- {"getNumCurves", ( PyCFunction ) Curve_getNumCurves,
- METH_NOARGS, "() - Gets number of curves in Curve"},
- {"getKey", ( PyCFunction ) Curve_getKey,
- METH_NOARGS, "() - Gets curve key"},
- {"isNurb", ( PyCFunction ) Curve_isNurb,
- METH_VARARGS,
- "(nothing or integer) - returns 1 if curve is type Nurb, O otherwise."},
- {"isCyclic", ( PyCFunction ) Curve_isCyclic,
- METH_VARARGS, "( nothing or integer ) - returns true if curve is cyclic (closed), false otherwise."},
- {"getNumPoints", ( PyCFunction ) Curve_getNumPoints,
- METH_VARARGS,
- "(nothing or integer) - returns the number of points of the specified curve"},
- {"appendPoint", ( PyCFunction ) Curve_appendPoint, METH_VARARGS,
- "( int numcurve, list of coordinates) - adds a new point to end of curve"},
- {"appendNurb", ( PyCFunction ) Curve_appendNurb, METH_O,
- "( new_nurb ) - adds a new nurb to the Curve"},
- {"update", ( PyCFunction ) Curve_update, METH_NOARGS,
- "( ) - updates display lists after changes to Curve"},
- {"getMaterials", ( PyCFunction ) Curve_getMaterials, METH_NOARGS,
- "() - returns list of materials assigned to this Curve"},
- {"getBevOb", ( PyCFunction ) Curve_getBevOb, METH_NOARGS,
- "() - returns Bevel Object assigned to this Curve"},
- {"setBevOb", ( PyCFunction ) Curve_setBevOb, METH_VARARGS,
- "() - assign a Bevel Object to this Curve"},
- {"getTaperOb", ( PyCFunction ) Curve_getTaperOb, METH_NOARGS,
- "() - returns Taper Object assigned to this Curve"},
- {"setTaperOb", ( PyCFunction ) Curve_setTaperOb, METH_VARARGS,
- "() - assign a Taper Object to this Curve"},
- {"__copy__", ( PyCFunction ) Curve_copy, METH_NOARGS,
- "() - make a copy of this curve data"},
- {"copy", ( PyCFunction ) Curve_copy, METH_NOARGS,
- "() - make a copy of this curve data"},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Python Curve_Type callback function prototypes: */
-/*****************************************************************************/
-static int Curve_compare( BPy_Curve * a, BPy_Curve * b );
-static PyObject *Curve_repr( BPy_Curve * msh );
-
-static PySequenceMethods Curve_as_sequence = {
- ( inquiry ) Curve_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) Curve_getNurb, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) Curve_setNurb, /* sq_ass_item - only so you can do del curve[i] */
- 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- 0,
- 0
-};
-
-/*****************************************************************************/
-/* Python Curve_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Curve_Type = {
- PyObject_HEAD_INIT( NULL ) /* required macro */
- 0, /* ob_size */
- "Curve", /* tp_name */
- sizeof( BPy_Curve ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) NULL, /* tp_getattr */
- ( setattrfunc ) NULL, /* tp_setattr */
- ( cmpfunc ) Curve_compare, /* tp_compare */
- ( reprfunc ) Curve_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &Curve_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) Curve_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) Curve_iterNext, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Curve_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- Curve_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*****************************************************************************/
-/* Function: Curve_Init */
-/*****************************************************************************/
-PyObject *Curve_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Curve_Type) < 0) /* set exception. -1 is failure */
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Curve", M_Curve_methods,
- M_Curve_doc );
- return ( submodule );
-}
-
-
-/*
- * Curve_CreatePyObject
- * constructor to build a py object from blender data
- */
-
-PyObject *Curve_CreatePyObject( struct Curve * curve )
-{
- BPy_Curve *blen_object;
-
- blen_object = ( BPy_Curve * ) PyObject_NEW( BPy_Curve, &Curve_Type );
-
- if( blen_object == NULL ) {
- return ( NULL );
- }
- blen_object->curve = curve;
- return ( ( PyObject * ) blen_object );
-
-}
-
-struct Curve *Curve_FromPyObject( PyObject * py_obj )
-{
- BPy_Curve *blen_obj;
-
- blen_obj = ( BPy_Curve * ) py_obj;
- return ( blen_obj->curve );
-
-}
-
-/* #####DEPRECATED###### */
-
-PyObject *Curve_setName( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Curve_newsetName );
-}
-
-static PyObject *Curve_setPathLen( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetPathLen );
-}
-
-static PyObject *Curve_setTotcol( BPy_Curve * self, PyObject * args )
-{
- if( !PyArg_ParseTuple( args, "i", &( self->curve->totcol ) ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
- Py_RETURN_NONE;
-}
-
-PyObject *Curve_setMode( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetMode );
-}
-
-PyObject *Curve_setBevresol( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetBevresol);
-}
-
-PyObject *Curve_setResolu( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetResolu );
-}
-
-PyObject *Curve_setResolv( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetResolv );
-}
-
-PyObject *Curve_setWidth( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetWidth );
-}
-
-PyObject *Curve_setExt1( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetExt1 );
-}
-
-PyObject *Curve_setExt2( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetExt2 );
-}
-
-static PyObject *Curve_setLoc( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetLoc );
-}
-
-static PyObject *Curve_setRot( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetRot );
-}
-
-static PyObject *Curve_setSize( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetSize );
-}
-
-PyObject *Curve_setBevOb( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetBevOb );
-}
-
-PyObject *Curve_setTaperOb( BPy_Curve * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Curve_newsetTaperOb );
-}
-
diff --git a/source/blender/python/api2_2x/Curve.h b/source/blender/python/api2_2x/Curve.h
deleted file mode 100644
index 9d736669d29..00000000000
--- a/source/blender/python/api2_2x/Curve.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_CURVE_H
-#define EXPP_CURVE_H
-
-#include <Python.h>
-#include "DNA_curve_types.h"
-
-extern PyTypeObject Curve_Type;
-
-#define BPy_Curve_Check(v) ((v)->ob_type==&Curve_Type)
-
-/* Python BPy_Curve structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- Curve * curve; /* libdata must be second */
- /* pointer for iterator: does not point to owned memory */
- Nurb *iter_pointer;
-} BPy_Curve;
-
-
-/*
- * protoypes
- */
-
-PyObject *Curve_Init( void );
-PyObject *Curve_CreatePyObject( struct Curve * curve );
-struct Curve *Curve_FromPyObject( PyObject * py_obj );
-PyObject *Curve_update( BPy_Curve * self );
-
-PyObject *Curve_getName( BPy_Curve * self );
-PyObject *Curve_setName( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getMode( BPy_Curve * self );
-PyObject *Curve_setMode( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getBevresol( BPy_Curve * self );
-PyObject *Curve_setBevresol( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getResolu( BPy_Curve * self );
-PyObject *Curve_setResolu( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getResolv( BPy_Curve * self );
-PyObject *Curve_setResolv( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt1( BPy_Curve * self );
-PyObject *Curve_setExt1( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getExt2( BPy_Curve * self );
-PyObject *Curve_setExt2( BPy_Curve * self, PyObject * args );
-PyObject *Curve_getWidth( BPy_Curve * self );
-PyObject *Curve_setWidth( BPy_Curve * self, PyObject * args );
-
-#endif /* EXPP_CURVE_H */
diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c
deleted file mode 100644
index c238fe5601c..00000000000
--- a/source/blender/python/api2_2x/Draw.c
+++ /dev/null
@@ -1,2455 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Campbell Barton, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* This file is the Blender.Draw part of opy_draw.c, from the old
- * bpython/intern dir, with minor changes to adapt it to the new Python
- * implementation. Non-trivial original comments are marked with an
- * @ symbol at their beginning. */
-
-#include "Draw.h" /*This must come first*/
-
-#include "BLI_blenlib.h"
-#include "MEM_guardedalloc.h"
-#include "BMF_Api.h"
-#include "DNA_screen_types.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_object.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-#include "BIF_gl.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-#include "DNA_space_types.h" /* script struct */
-#include "Image.h" /* for accessing Blender.Image objects */
-#include "IMB_imbuf_types.h" /* for the IB_rect define */
-#include "interface.h"
-#include "mydevice.h" /*@ for all the event constants */
-#include "gen_utils.h"
-#include "Window.h"
-#include "../BPY_extern.h"
-
-/* used so we can get G.scene->r.cfra for getting the
-current image frame, some images change frame if they are a sequence */
-#include "DNA_scene_types.h"
-
-/* these delimit the free range for button events */
-#define EXPP_BUTTON_EVENTS_OFFSET 1001
-#define EXPP_BUTTON_EVENTS_MIN 0
-#define EXPP_BUTTON_EVENTS_MAX 15382 /* 16384 - 1 - OFFSET */
-
-#define ButtonObject_Check(v) ((v)->ob_type == &Button_Type)
-
-#define UI_METHOD_ERRORCHECK \
- if (check_button_event(&event) == -1)\
- return EXPP_ReturnPyObjError( PyExc_AttributeError,\
- "button event argument must be in the range [0, 16382]");\
- if (callback && !PyCallable_Check(callback))\
- return EXPP_ReturnPyObjError( PyExc_ValueError,\
- "callback is not a python function");\
-
-/* pointer to main dictionary defined in Blender.c */
-extern PyObject *g_blenderdict;
-
-/*@ hack to flag that window redraw has happened inside slider callback: */
-int EXPP_disable_force_draw = 0;
-
-/* forward declarations for internal functions */
-static void Button_dealloc( PyObject * self );
-static PyObject *Button_getattr( PyObject * self, char *name );
-static PyObject *Button_repr( PyObject * self );
-static PyObject *Button_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type);
-static int Button_setattr( PyObject * self, char *name, PyObject * v );
-
-static Button *newbutton( void );
-
-/* GUI interface routines */
-
-static void exit_pydraw( SpaceScript * sc, short error );
-static void exec_callback( SpaceScript * sc, PyObject * callback,
- PyObject * args );
-static void spacescript_do_pywin_buttons( SpaceScript * sc,
- unsigned short event );
-
-static PyObject *Method_Exit( PyObject * self );
-static PyObject *Method_Register( PyObject * self, PyObject * args );
-static PyObject *Method_Redraw( PyObject * self, PyObject * args );
-static PyObject *Method_Draw( PyObject * self );
-static PyObject *Method_Create( PyObject * self, PyObject * args );
-static PyObject *Method_UIBlock( PyObject * self, PyObject * args );
-
-static PyObject *Method_Button( PyObject * self, PyObject * args );
-static PyObject *Method_Menu( PyObject * self, PyObject * args );
-static PyObject *Method_Toggle( PyObject * self, PyObject * args );
-static PyObject *Method_Slider( PyObject * self, PyObject * args );
-static PyObject *Method_Scrollbar( PyObject * self, PyObject * args );
-static PyObject *Method_ColorPicker( PyObject * self, PyObject * args );
-static PyObject *Method_Normal( PyObject * self, PyObject * args );
-static PyObject *Method_Number( PyObject * self, PyObject * args );
-static PyObject *Method_String( PyObject * self, PyObject * args );
-static PyObject *Method_GetStringWidth( PyObject * self, PyObject * args );
-static PyObject *Method_Text( PyObject * self, PyObject * args );
-static PyObject *Method_Label( PyObject * self, PyObject * args );
-/* by Campbell: */
-static PyObject *Method_PupMenu( PyObject * self, PyObject * args );
-static PyObject *Method_PupTreeMenu( PyObject * self, PyObject * args );
-static PyObject *Method_PupIntInput( PyObject * self, PyObject * args );
-static PyObject *Method_PupFloatInput( PyObject * self, PyObject * args );
-static PyObject *Method_PupStrInput( PyObject * self, PyObject * args );
-static PyObject *Method_BeginAlign( PyObject * self, PyObject * args );
-static PyObject *Method_EndAlign( PyObject * self, PyObject * args );
-/* next by Jonathan Merritt (lancelet): */
-static PyObject *Method_Image( PyObject * self, PyObject * args);
-/* CLEVER NUMBUT */
-static PyObject *Method_PupBlock( PyObject * self, PyObject * args );
-
-static uiBlock *Get_uiBlock( void );
-
-static void py_slider_update( void *butv, void *data2_unused );
-
-/* hack to get 1 block for the UIBlock, only ever 1 at a time */
-static uiBlock *uiblock=NULL;
-
-static char Draw_doc[] = "The Blender.Draw submodule";
-
-static char Method_UIBlock_doc[] = "(drawfunc, mouse_exit) - Popup dialog where buttons can be drawn (expemental)";
-
-static char Method_Register_doc[] =
- "(draw, event, button) - Register callbacks for windowing\n\n\
-(draw) A function to draw the screen, taking no arguments\n\
-(event) A function to handle events, taking 2 arguments (evt, val)\n\
- (evt) The event number\n\
- (val) The value modifier (for key and mouse press/release)\n\
-(button) A function to handle button events, taking 1 argument (evt)\n\
- (evt) The button number\n\n\
-A None object can be passed if a callback is unused.";
-
-
-static char Method_Redraw_doc[] = "([after]) - Queue a redraw event\n\n\
-[after=0] Determines whether the redraw is processed before\n\
-or after other input events.\n\n\
-Redraw events are buffered so that regardless of how many events\n\
-are queued the window only receives one redraw event.";
-
-static char Method_Draw_doc[] = "() - Force an immediate redraw\n\n\
-Forced redraws are not buffered, in other words the window is redrawn\n\
-exactly once for everytime this function is called.";
-
-
-static char Method_Create_doc[] =
- "(value) - Create a default Button object\n\n\
- (value) - The value to store in the button\n\n\
- Valid values are ints, floats, and strings";
-
-static char Method_Button_doc[] =
- "(name, event, x, y, width, height, [tooltip]) - Create a new Button \
-(push) button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-[tooltip=] The button's tooltip\n\n\
-This function can be called as Button() or PushButton().";
-
-static char Method_BeginAlign_doc[] =
- "Buttons after this function will draw aligned (button layout only)";
-
-static char Method_EndAlign_doc[] =
- "Use after BeginAlign() to stop aligning the buttons (button layout only).";
-
-static char Method_Menu_doc[] =
- "(name, event, x, y, width, height, default, [tooltip]) - Create a new Menu \
-button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(default) The number of the option to be selected by default\n\
-[tooltip=" "] The button's tooltip\n\n\
-The menu options are specified through the name of the\n\
-button. Options are followed by a format code and separated\n\
-by the '|' (pipe) character.\n\
-Valid format codes are\n\
- %t - The option should be used as the title\n\
- %xN - The option should set the integer N in the button value.";
-
-static char Method_Toggle_doc[] =
- "(name, event, x, y, width, height, default, [tooltip]) - Create a new Toggle \
-button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(default) An integer (0 or 1) specifying the default state\n\
-[tooltip=] The button's tooltip";
-
-
-static char Method_Slider_doc[] =
- "(name, event, x, y, width, height, initial, min, max, [update, tooltip]) - \
-Create a new Slider button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(initial, min, max) Three values (int or float) specifying the initial \
- and limit values.\n\
-[update=1] A value controlling whether the slider will emit events as it \
-is edited.\n\
- A non-zero value (default) enables the events. A zero value supresses them.\n\
-[tooltip=] The button's tooltip";
-
-
-static char Method_Scrollbar_doc[] =
- "(event, x, y, width, height, initial, min, max, [update, tooltip]) - Create a \
-new Scrollbar\n\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(initial, min, max) Three values (int or float) specifying the initial and limit values.\n\
-[update=1] A value controlling whether the slider will emit events as it is edited.\n\
- A non-zero value (default) enables the events. A zero value supresses them.\n\
-[tooltip=] The button's tooltip";
-
-static char Method_ColorPicker_doc[] =
- "(event, x, y, width, height, initial, [tooltip]) - Create a new Button \
-Color picker button\n\n\
-(event) The event number to pass to the button event function when the color changes\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(initial) 3-Float tuple of the color (values between 0 and 1)\
-[tooltip=] The button's tooltip";
-
-static char Method_Normal_doc[] =
- "(event, x, y, width, height, initial, [tooltip]) - Create a new Button \
-Normal button (a sphere that you can roll to change the normal)\n\n\
-(event) The event number to pass to the button event function when the color changes\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height - non square will gave odd results\n\
-(initial) 3-Float tuple of the normal vector (values between -1 and 1)\
-[tooltip=] The button's tooltip";
-
-static char Method_Number_doc[] =
- "(name, event, x, y, width, height, initial, min, max, [tooltip], [callback], [clickstep], [precision]) - Create a \
-new Number button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(initial, min, max) Three values (int or float) specifying the initial and \
-limit values.\n\
-[tooltip=] The button's tooltip\n\
-[callback=] The button's callback\n\
-[clickstep=] Click step for the button\n\
-[precision=] How many decimal places to maintain, if not given, it is calculated depending on range, otherwise 1,2,3 or 4. Larger values are clamped to 4";
-
-static char Method_String_doc[] =
- "(name, event, x, y, width, height, initial, length, [tooltip]) - Create a \
-new String button\n\n\
-(name) A string to display on the button\n\
-(event) The event number to pass to the button event function when activated\n\
-(x, y) The lower left coordinate of the button\n\
-(width, height) The button width and height\n\
-(initial) The string to display initially\n\
-(length) The maximum input length\n\
-[tooltip=] The button's tooltip";
-
-static char Method_GetStringWidth_doc[] =
- "(text, font = 'normal') - Return the width in pixels of the given string\n\
-(font) The font size: 'large','normal' (default), 'normalfix', 'small' or 'tiny'.";
-
-static char Method_Text_doc[] =
- "(text, font = 'normal') - Draw text onscreen\n\n\
-(text) The text to draw\n\
-(font) The font size: 'large','normal' (default), 'normalfix', 'small' or 'tiny'.\n\n\
-This function returns the width of the drawn string.";
-
-static char Method_Label_doc[] =
- "(text, x, y, w, h, tip, callback) - Draw a text label onscreen\n\n\
-(text) The text to draw\n\
-(x, y, w, h) The lower left coordinate of the lable, width and height";
-
-static char Method_PupMenu_doc[] =
- "(string, maxrow = None) - Display a pop-up menu at the screen.\n\
-The contents of the pop-up are specified through the 'string' argument,\n\
-like with Draw.Menu.\n\
-'maxrow' is an optional int to control how many rows the pop-up should have.\n\
-Options are followed by a format code and separated\n\
-by the '|' (pipe) character.\n\
-Valid format codes are\n\
- %t - The option should be used as the title\n\
- %xN - The option should set the integer N in the button value.\n\n\
-Ex: Draw.PupMenu('OK?%t|QUIT BLENDER') # should be familiar ...";
-
-static char Method_PupTreeMenu_doc[] =
-"each item in the menu list should be - (str, event), separator - None or submenu - (str, [...]).";
-
-static char Method_PupIntInput_doc[] =
- "(text, default, min, max) - Display an int pop-up input.\n\
-(text) - text string to display on the button;\n\
-(default, min, max) - the default, min and max int values for the button;\n\
-Return the user input value or None on user exit";
-
-static char Method_PupFloatInput_doc[] =
- "(text, default, min, max, clickStep, floatLen) - Display a float pop-up input.\n\
-(text) - text string to display on the button;\n\
-(default, min, max) - the default, min and max float values for the button;\n\
-(clickStep) - float increment/decrement for each click on the button arrows;\n\
-(floatLen) - an integer defining the precision (number of decimal places) of \n\
-the float value show.\n\
-Return the user input value or None on user exit";
-
-static char Method_Image_doc[] =
- "(image, x, y, zoomx = 1.0, zoomy = 1.0, [clipx, clipy, clipw, cliph])) \n\
- - Draw an image.\n\
-(image) - Blender.Image to draw.\n\
-(x, y) - floats specifying the location of the image.\n\
-(zoomx, zoomy) - float zoom factors in horizontal and vertical directions.\n\
-(clipx, clipy, clipw, cliph) - integers specifying a clipping rectangle within the original image.";
-
-static char Method_PupStrInput_doc[] =
- "(text, default, max = 20) - Display a float pop-up input.\n\
-(text) - text string to display on the button;\n\
-(default) - the initial string to display (truncated to 'max' chars);\n\
-(max = 20) - The maximum number of chars the user can input;\n\
-Return the user input value or None on user exit";
-
-static char Method_PupBlock_doc[] =
- "(title, sequence) - Display a pop-up block.\n\
-(title) - The title of the block.\n\
-(sequence) - A sequence defining what the block contains. \
-The order of the list is the order of appearance, from top down.\n\
-Possible format for sequence items:\n\
-[value is an object created with Create]\n\
-\ttext: Defines a label in the block\n\
-\t(text, value, tooltip = ''): Defines a toggle button \n\
-\t(text, value, min, max, tooltip = ''): Defines a num or string button \n\
-\t\t\tdepending on the value.\n\
-\t\tFor string, max is the maximum length of the text and min is unused.\n\
-Return 1 if the pop-up is confirmed, 0 otherwise. \n\
-Warning: On cancel, the value objects are brought back to there previous values, \
-\texcept for string values which will still contain the modified values.\n";
-
-static char Method_Exit_doc[] = "() - Exit the windowing interface";
-
-/*This is needed for button callbacks. Any button that uses a callback gets added to this list.
- On the C side of drawing begin, this list should be cleared.
- Each entry is a tuple of the form (button, callback py object)
-*/
-PyObject *M_Button_List = NULL;
-
-static struct PyMethodDef Draw_methods[] = {
- {"Create", (PyCFunction)Method_Create, METH_VARARGS, Method_Create_doc},
- {"UIBlock", (PyCFunction)Method_UIBlock, METH_VARARGS, Method_UIBlock_doc},
- {"Button", (PyCFunction)Method_Button, METH_VARARGS, Method_Button_doc},
- {"Toggle", (PyCFunction)Method_Toggle, METH_VARARGS, Method_Toggle_doc},
- {"Menu", (PyCFunction)Method_Menu, METH_VARARGS, Method_Menu_doc},
- {"Slider", (PyCFunction)Method_Slider, METH_VARARGS, Method_Slider_doc},
- {"Scrollbar", (PyCFunction)Method_Scrollbar, METH_VARARGS, Method_Scrollbar_doc},
- {"ColorPicker", (PyCFunction)Method_ColorPicker, METH_VARARGS, Method_ColorPicker_doc},
- {"Normal", (PyCFunction)Method_Normal, METH_VARARGS, Method_Normal_doc},
- {"Number", (PyCFunction)Method_Number, METH_VARARGS, Method_Number_doc},
- {"String", (PyCFunction)Method_String, METH_VARARGS, Method_String_doc},
- {"GetStringWidth", (PyCFunction)Method_GetStringWidth, METH_VARARGS, Method_GetStringWidth_doc},
- {"Text", (PyCFunction)Method_Text, METH_VARARGS, Method_Text_doc},
- {"Label", (PyCFunction)Method_Label, METH_VARARGS, Method_Label_doc},
- {"PupMenu", (PyCFunction)Method_PupMenu, METH_VARARGS, Method_PupMenu_doc},
- {"PupTreeMenu", (PyCFunction)Method_PupTreeMenu, METH_VARARGS, Method_PupTreeMenu_doc},
- {"PupIntInput", (PyCFunction)Method_PupIntInput, METH_VARARGS, Method_PupIntInput_doc},
- {"PupFloatInput", (PyCFunction)Method_PupFloatInput, METH_VARARGS, Method_PupFloatInput_doc},
- {"PupStrInput", (PyCFunction)Method_PupStrInput, METH_VARARGS, Method_PupStrInput_doc},
- {"PupBlock", (PyCFunction)Method_PupBlock, METH_VARARGS, Method_PupBlock_doc},
- {"Image", (PyCFunction)Method_Image, METH_VARARGS, Method_Image_doc},
- {"Exit", (PyCFunction)Method_Exit, METH_NOARGS, Method_Exit_doc},
- {"Redraw", (PyCFunction)Method_Redraw, METH_VARARGS, Method_Redraw_doc},
- {"Draw", (PyCFunction)Method_Draw, METH_NOARGS, Method_Draw_doc},
- {"Register", (PyCFunction)Method_Register, METH_VARARGS, Method_Register_doc},
- {"PushButton", (PyCFunction)Method_Button, METH_VARARGS, Method_Button_doc},
- {"BeginAlign", (PyCFunction)Method_BeginAlign, METH_VARARGS, Method_BeginAlign_doc},
- {"EndAlign", (PyCFunction)Method_EndAlign, METH_VARARGS, Method_EndAlign_doc},
- {NULL, NULL, 0, NULL}
-};
-
-PyTypeObject Button_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /*ob_size */
- "Button", /*tp_name */
- sizeof( Button ), /*tp_basicsize */
- 0, /*tp_itemsize */
- ( destructor ) Button_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) Button_getattr, /*tp_getattr */
- ( setattrfunc ) Button_setattr, /*tp_setattr */
- NULL, /*tp_cmp */
- ( reprfunc ) Button_repr, /*tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- (richcmpfunc)Button_richcmpr, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static void Button_dealloc( PyObject * self )
-{
- Button *but = ( Button * ) self;
-
- if( but->type == BSTRING_TYPE ) {
- if( but->val.asstr )
- MEM_freeN( but->val.asstr );
- }
-
- PyObject_DEL( self );
-}
-
-static PyObject *Button_getattr( PyObject * self, char *name )
-{
- Button *but = ( Button * ) self;
-
- if( strcmp( name, "val" ) == 0 ) {
- if( but->type == BINT_TYPE )
- return PyInt_FromLong( but->val.asint );
- else if( but->type == BFLOAT_TYPE )
- return PyFloat_FromDouble( but->val.asfloat );
- else if( but->type == BSTRING_TYPE )
- return PyString_FromString( but->val.asstr );
- else if( but->type == BVECTOR_TYPE )
- return Py_BuildValue( "fff", but->val.asvec[0], but->val.asvec[1], but->val.asvec[2] );
- }
-
- PyErr_SetString( PyExc_AttributeError, name );
- return NULL;
-}
-
-static int Button_setattr( PyObject * self, char *name, PyObject * v )
-{
- Button *but = ( Button * ) self;
-
- if( strcmp( name, "val" ) == 0 ) {
- if( but->type == BINT_TYPE && PyNumber_Check(v) ) {
- PyObject *pyVal = PyNumber_Int( v );
- if (pyVal) {
- but->val.asint = (int)PyInt_AS_LONG( pyVal );
- Py_DECREF(pyVal);
- return 0;
- }
- }
- else if( but->type == BFLOAT_TYPE && PyNumber_Check(v) ) {
- PyObject *pyVal = PyNumber_Float( v );
- if (pyVal) {
- but->val.asfloat = (float)PyFloat_AS_DOUBLE( pyVal );
- Py_DECREF(pyVal);
- return 0;
- }
- }
- else if( but->type == BVECTOR_TYPE ) {
- if ( PyArg_ParseTuple( v, "fff", but->val.asvec, but->val.asvec+1, but->val.asvec+2 ) )
- return 0;
- }
- else if( but->type == BSTRING_TYPE && PyString_Check(v) ) {
- char *newstr = PyString_AsString(v);
- size_t newlen = strlen(newstr);
-
- if (newlen+1> UI_MAX_DRAW_STR)
- return EXPP_ReturnIntError( PyExc_ValueError, "Error: button string length exceeded max limit (399 chars).");
-
- /* if the length of the new string is the same as */
- /* the old one, just copy, else delete and realloc. */
- if( but->slen == newlen ) {
- BLI_strncpy( but->val.asstr, newstr,
- but->slen + 1 );
-
- return 0;
-
- } else {
- MEM_freeN( but->val.asstr );
- but->slen = newlen;
- but->val.asstr =
- MEM_mallocN( but->slen + 1,
- "button setattr" );
- BLI_strncpy( but->val.asstr, newstr,
- but->slen + 1 );
-
- return 0;
- }
- }
- } else {
- /*
- * Accessing the wrong attribute.
- */
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
- }
-
- /*
- * Correct attribute but value is incompatible with current button value.
- */
- return EXPP_ReturnIntError( PyExc_ValueError, "value incompatible with current button type" );
-}
-
-static PyObject *Button_repr( PyObject * self )
-{
- return PyObject_Repr( Button_getattr( self, "val" ) );
-}
-
-static PyObject *Button_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
-{
- PyObject *ret, *valA=NULL, *valB=NULL;
- if (ButtonObject_Check(objectA))
- objectA = valA = Button_getattr( objectA, "val" );
- if (ButtonObject_Check(objectB))
- objectB = valB = Button_getattr( objectB, "val" );
- ret = PyObject_RichCompare(objectA, objectB, comparison_type);
- Py_XDECREF(valA); /* Button_getattr created with 1 ref, we dont care about them now */
- Py_XDECREF(valB);
- return ret;
-}
-
-
-static Button *newbutton( void )
-{
- Button *but = NULL;
-
- but = ( Button * ) PyObject_NEW( Button, &Button_Type );
- but->tooltip[0] = 0; /*NULL-terminate tooltip string*/
- but->tooltip[255] = 0; /*necassary to insure we always have a NULL-terminated string, as
- according to the docs strncpy doesn't do this for us.*/
- return but;
-}
-
-/* GUI interface routines */
-
-static void exit_pydraw( SpaceScript * sc, short err )
-{
- Script *script = NULL;
-
- if( !sc || !sc->script )
- return;
-
- script = sc->script;
-
- if( err ) {
- PyErr_Print( );
- script->flags = 0; /* mark script struct for deletion */
- SCRIPT_SET_NULL(script);
- script->scriptname[0] = '\0';
- script->scriptarg[0] = '\0';
- error_pyscript();
- scrarea_queue_redraw( sc->area );
- }
-
- BPy_Set_DrawButtonsList(sc->but_refs);
- BPy_Free_DrawButtonsList(); /*clear all temp button references*/
- sc->but_refs = NULL;
-
- Py_XDECREF( ( PyObject * ) script->py_draw );
- Py_XDECREF( ( PyObject * ) script->py_event );
- Py_XDECREF( ( PyObject * ) script->py_button );
-
- script->py_draw = script->py_event = script->py_button = NULL;
-}
-
-static void exec_callback( SpaceScript * sc, PyObject * callback,
- PyObject * args )
-{
- PyObject *result = PyObject_CallObject( callback, args );
-
- if( result == NULL && sc->script ) { /* errors in the script */
-
- if( sc->script->lastspace == SPACE_TEXT ) { /*if it can be an ALT+P script */
- Text *text = G.main->text.first;
-
- while( text ) { /* find it and free its compiled code */
-
- if( !strcmp
- ( text->id.name + 2,
- sc->script->id.name + 2 ) ) {
- BPY_free_compiled_text( text );
- break;
- }
-
- text = text->id.next;
- }
- }
- exit_pydraw( sc, 1 );
- }
-
- Py_XDECREF( result );
- Py_DECREF( args );
-}
-
-/* BPY_spacescript_do_pywin_draw, the static spacescript_do_pywin_buttons and
- * BPY_spacescript_do_pywin_event are the three functions responsible for
- * calling the draw, buttons and event callbacks registered with Draw.Register
- * (see Method_Register below). They are called (only the two BPY_ ones)
- * from blender/src/drawscript.c */
-
-void BPY_spacescript_do_pywin_draw( SpaceScript * sc )
-{
- uiBlock *block;
- char butblock[20];
- Script *script = sc->script;
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- sprintf( butblock, "win %d", curarea->win );
- block = uiNewBlock( &curarea->uiblocks, butblock, UI_EMBOSSX,
- UI_HELV, curarea->win );
-
- if( script->py_draw ) {
- if (sc->but_refs) {
- BPy_Set_DrawButtonsList(sc->but_refs);
- BPy_Free_DrawButtonsList(); /*clear all temp button references*/
- }
- sc->but_refs = PyList_New(0);
- BPy_Set_DrawButtonsList(sc->but_refs);
-
- glPushAttrib( GL_ALL_ATTRIB_BITS );
- exec_callback( sc, script->py_draw, Py_BuildValue( "()" ) );
- glPopAttrib( );
- } else {
- glClearColor( 0.4375, 0.4375, 0.4375, 0.0 );
- glClear( GL_COLOR_BUFFER_BIT );
- }
-
- uiDrawBlock( block );
-
- curarea->win_swap = WIN_BACK_OK;
-
- PyGILState_Release(gilstate);
-}
-
-static void spacescript_do_pywin_buttons( SpaceScript * sc,
- unsigned short event )
-{
- if( sc->script->py_button )
- exec_callback( sc, sc->script->py_button,
- Py_BuildValue( "(i)", event ) );
-}
-
-void BPY_spacescript_do_pywin_event( SpaceScript * sc, unsigned short event,
- short val, char ascii )
-{
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- if( event == QKEY && G.qual & ( LR_ALTKEY | LR_CTRLKEY ) ) {
- /* finish script: user pressed ALT+Q or CONTROL+Q */
- Script *script = sc->script;
-
- exit_pydraw( sc, 0 );
-
- script->flags &= ~SCRIPT_GUI; /* we're done with this script */
-
- PyGILState_Release(gilstate);
-
- return;
- }
-
- if (val) {
-
- if (uiDoBlocks( &curarea->uiblocks, event, 1 ) != UI_NOTHING) event = 0;
-
- if (event == UI_BUT_EVENT) {
- /* check that event is in free range for script button events;
- * read the comment before check_button_event() below to understand */
- if (val >= EXPP_BUTTON_EVENTS_OFFSET && val < 0x4000)
- spacescript_do_pywin_buttons(sc, val - EXPP_BUTTON_EVENTS_OFFSET);
-
- PyGILState_Release(gilstate);
-
- return;
- }
- }
-
- /* We use the "event" main module var, used by scriptlinks, to pass the ascii
- * value to event callbacks (gui/event/button callbacks are not allowed
- * inside scriptlinks, so this is ok) */
- if( sc->script->py_event ) {
- int pass_ascii = 0;
- if (ascii > 31 && ascii != 127) {
- pass_ascii = 1;
- EXPP_dict_set_item_str(g_blenderdict, "event",
- PyInt_FromLong((long)ascii));
- }
- exec_callback( sc, sc->script->py_event,
- Py_BuildValue( "(ii)", event, val ) );
- if (pass_ascii)
- EXPP_dict_set_item_str(g_blenderdict, "event",
- PyString_FromString(""));
- }
-
- PyGILState_Release(gilstate);
-}
-
-static void exec_but_callback(void *pyobj, void *data)
-{
- PyObject *result;
- PyObject *pyvalue = NULL;
- uiBut *but = (uiBut *)data;
- PyObject *arg;
- PyObject *callback = (PyObject *)pyobj;
-
- double value = ui_get_but_val(but);
-
- if (callback==NULL || callback == Py_None)
- return;
-
- /* Button types support
- case MENU:
- case TEX:
- case TOG:
- case NUMSLI:
- case NUM:
- case COL:
- case BUT_NORMAL:
- case BUT */
- switch (but->type) {
- case TEX:
- /*printf("TEX\n");*/
- pyvalue = PyString_FromString( (char *)but->poin );
- break;
- case NUM:
- case NUMSLI:
- case TOG:
- case MENU:
- if (but->pointype==FLO) {
- /*printf("FLO\n");*/
- pyvalue = PyFloat_FromDouble( (float)value );
- } else if (but->pointype==INT) {
- /*printf("INT\n");*/
- pyvalue = PyInt_FromLong( (int)value );
- } else if (but->pointype==SHO) {
- /*printf("SHO\n");*/
- pyvalue = PyInt_FromLong( (short)value );
- }
- break;
- case COL:
- case BUT_NORMAL:
- {
- float vec[3];
- VECCOPY(vec, (float *)but->poin);
- pyvalue = Py_BuildValue("(fff)", vec[0], vec[1], vec[2]);
- break;
- }
- case BUT:
- pyvalue = Py_None;
- Py_INCREF(pyvalue);
- break;
- default:
- pyvalue = Py_None;
- Py_INCREF(pyvalue);
- printf("Error, no button type matched.");
- }
-
- arg = PyTuple_New( 2 );
- if (uiblock==NULL)
- PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval - EXPP_BUTTON_EVENTS_OFFSET) );
- else
- PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval) );
-
- PyTuple_SetItem( arg, 1, pyvalue );
-
- result = PyObject_CallObject( callback, arg );
- Py_DECREF(arg);
-
- if (!result) {
- Py_DECREF(pyvalue);
- PyErr_Print( );
- error_pyscript( );
- }
- Py_XDECREF( result );
-}
-
-/*note that this function populates the drawbutton ref lists.*/
-static void set_pycallback(uiBut *ubut, PyObject *callback, Button *but)
-{
- PyObject *tuple;
- if (!callback || !PyCallable_Check(callback)) {
- if (M_Button_List && but) {
- PyList_Append(M_Button_List, (PyObject*)but);
- }
- return;
- }
-
- if (M_Button_List) {
- if (but) tuple = PyTuple_New(2);
- else tuple = PyTuple_New(1);
-
- /*the tuple API mandates this*/
- Py_XINCREF(callback);
- Py_XINCREF(but); /*this checks for NULL*/
-
- PyTuple_SET_ITEM(tuple, 0, callback);
- if (but) PyTuple_SET_ITEM(tuple, 1, (PyObject*)but);
-
- PyList_Append(M_Button_List, tuple);
- Py_DECREF(tuple); /*we have to do this to aovid double references.*/
-
- uiButSetFunc(ubut, exec_but_callback, callback, ubut);
- }
-}
-
-void BPy_Set_DrawButtonsList(void *list)
-{
- M_Button_List = list;
-}
-
-/*this MUST be called after doing UI stuff.*/
-void BPy_Free_DrawButtonsList(void)
-{
- /*Clear the list.*/
- if (M_Button_List) {
- PyGILState_STATE gilstate = {0};
- int py_is_on = Py_IsInitialized();
-
- if (py_is_on) gilstate = PyGILState_Ensure();
-
- PyList_SetSlice(M_Button_List, 0, PyList_Size(M_Button_List), NULL);
- Py_DECREF(M_Button_List);
- M_Button_List = NULL;
-
- if (py_is_on) PyGILState_Release(gilstate);
- }
-}
-
-static PyObject *Method_Exit( PyObject * self )
-{
- SpaceScript *sc;
- Script *script;
-
- /* if users call Draw.Exit when we are already out of the SPACE_SCRIPT, we
- * simply return, for compatibility */
- if( curarea->spacetype == SPACE_SCRIPT )
- sc = curarea->spacedata.first;
- else
- Py_RETURN_NONE;
-
- exit_pydraw( sc, 0 );
-
- script = sc->script;
-
- /* remove our lock to the current namespace */
- script->flags &= ~SCRIPT_GUI;
- script->scriptname[0] = '\0';
- script->scriptarg[0] = '\0';
-
- Py_RETURN_NONE;
-}
-
-/* Method_Register (Draw.Register) registers callbacks for drawing, events
- * and gui button events, so a script can continue executing after the
- * interpreter reached its end and returned control to Blender. Everytime
- * the SPACE_SCRIPT window with this script is redrawn, the registered
- * callbacks are executed. */
-static PyObject *Method_Register( PyObject * self, PyObject * args )
-{
- PyObject *newdrawc = NULL, *neweventc = NULL, *newbuttonc = NULL;
- SpaceScript *sc;
- Script *script;
- int startspace = 0;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Register() in background mode." );
- }
-
- if( !PyArg_ParseTuple
- ( args, "O|OO", &newdrawc, &neweventc, &newbuttonc ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or three PyObjects" );
-
- if( !PyCallable_Check( newdrawc ) )
- newdrawc = NULL;
- if( !PyCallable_Check( neweventc ) )
- neweventc = NULL;
- if( !PyCallable_Check( newbuttonc ) )
- newbuttonc = NULL;
-
- if( !( newdrawc || neweventc || newbuttonc ) )
- Py_RETURN_NONE;
-
- startspace = curarea->spacetype;
-
- /* first make sure the current area is of type SPACE_SCRIPT */
- if( startspace != SPACE_SCRIPT )
- newspace( curarea, SPACE_SCRIPT );
-
- sc = curarea->spacedata.first;
-
- /* There are two kinds of scripts:
- * a) those that simply run, finish and return control to Blender;
- * b) those that do like 'a)' above but leave callbacks for drawing,
- * events and button events, with this Method_Register (Draw.Register
- * in Python). These callbacks are called by scriptspaces (Scripts windows).
- *
- * We need to flag scripts that leave callbacks so their namespaces are
- * not deleted when they 'finish' execution, because the callbacks will
- * still need the namespace.
- */
-
- /* Let's see if this is a new script */
- script = G.main->script.first;
- while (script) {
- if (script->flags & SCRIPT_RUNNING) break;
- script = script->id.next;
- }
-
- if( !script ) {
- /* not new, it's a left callback calling Register again */
- script = sc->script;
- if( !script ) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Draw.Register can't be used inside script links" );
- }
- }
- else sc->script = script;
-
- /* Now we have the right script and can set a lock so its namespace can't be
- * deleted for as long as we need it */
- script->flags |= SCRIPT_GUI;
-
- /* save the last space so we can go back to it upon finishing */
- if( !script->lastspace )
- script->lastspace = startspace;
-
- /* clean the old callbacks */
- exit_pydraw( sc, 0 );
-
- /* prepare the new ones and insert them */
- Py_XINCREF( newdrawc );
- Py_XINCREF( neweventc );
- Py_XINCREF( newbuttonc );
-
- script->py_draw = newdrawc;
- script->py_event = neweventc;
- script->py_button = newbuttonc;
-
- scrarea_queue_redraw( sc->area );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_Redraw( PyObject * self, PyObject * args )
-{
- int after = 0;
-
- if (G.background) {
- Py_RETURN_NONE;
- }
-
- if( !PyArg_ParseTuple( args, "|i", &after ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (or nothing)" );
-
- if( after )
- addafterqueue( curarea->win, REDRAW, 1 );
- else
- scrarea_queue_winredraw( curarea );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_Draw( PyObject * self )
-{
- if (G.background) {
- Py_RETURN_NONE;
- }
-
- /*@ If forced drawing is disable queue a redraw event instead */
- if( EXPP_disable_force_draw ) {
- scrarea_queue_winredraw( curarea );
- Py_RETURN_NONE;
- }
-
- scrarea_do_windraw( curarea );
-
- screen_swapbuffers( );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_Create( PyObject * self, PyObject * args )
-{
- Button *but = NULL;
- PyObject *val;
- char *newstr;
-
- but = newbutton();
- /* If this function dosnt sucseed this will need to be deallocated,
- * make sure the type is NOT BSTRING_TYPE before deallocing -1 is ok.
- * so we dont dealloc with an uninitialized value wich would be bad! */
- if ( PyArg_ParseTuple( args, "fff", but->val.asvec, but->val.asvec+1, but->val.asvec+2 ) ) {
- but->type = BVECTOR_TYPE;
-
- } else if ( PyArg_ParseTuple( args, "O!", &PyFloat_Type, &val ) ) {
- but->val.asfloat = (float)PyFloat_AS_DOUBLE(val);
- but->type = BFLOAT_TYPE;
-
- } else if ( PyArg_ParseTuple( args, "O!", &PyInt_Type, &val ) ) {
- but->val.asint = (int)PyInt_AS_LONG(val);
- but->type = BINT_TYPE;
-
- } else if ( PyArg_ParseTuple( args, "s#", &newstr, &but->slen ) ) {
- if (but->slen + 1 > UI_MAX_DRAW_STR) {
- but->type = -1;
- Py_DECREF((PyObject *)but); /* will remove */
- but = NULL;
- PyErr_SetString( PyExc_TypeError, "string is longer then 399 chars");
- } else {
- but->type = BSTRING_TYPE;
- but->val.asstr = MEM_mallocN( but->slen + 1, "button string" );
- BLI_strncpy( but->val.asstr, newstr, but->slen+1 );
- }
-
- } else {
- but->type = -1;
- Py_DECREF((PyObject *)but); /* will remove */
- but = NULL;
- PyErr_SetString( PyExc_TypeError, "expected string, float, int or 3-float tuple argument" );
- }
-
- if (but != NULL) {
- PyErr_Clear();
- }
-
- return (PyObject*) but;
-}
-
-
-static PyObject *Method_UIBlock( PyObject * self, PyObject * args )
-{
- PyObject *val = NULL;
- PyObject *result = NULL;
- ListBase listb= {NULL, NULL};
- int mouse_exit = 1;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.UIBlock() in background mode." );
- }
-
- if ( !PyArg_ParseTuple( args, "O|i", &val, &mouse_exit ) || !PyCallable_Check( val ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected 1 python function and an optional int" );
-
- if (uiblock)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot run more then 1 UIBlock at a time" );
-
- BPy_Set_DrawButtonsList(PyList_New(0));
-
- mywinset(G.curscreen->mainwin);
- uiblock= uiNewBlock(&listb, "numbuts", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
-
- uiBlockSetFlag(uiblock, UI_BLOCK_LOOP|UI_BLOCK_REDRAW);
- result = PyObject_CallObject( val, NULL );
-
- if (!result) {
- PyErr_Print( );
- error_pyscript( );
- } else {
- /* copied from do_clever_numbuts in toolbox.c */
-
- /* Clear all events so tooltips work, this is not ideal and
- only needed because calls from the menu still have some events
- left over when do_clever_numbuts is called.
- Calls from keyshortcuts do not have this problem.*/
- ScrArea *sa;
- BWinEvent temp_bevt;
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->win) {
- while( bwin_qread( sa->win, &temp_bevt ) ) {}
- }
- if(sa->headwin) {
- while( bwin_qread( sa->headwin, &temp_bevt ) ) {}
- }
- }
- /* Done clearing events */
-
- uiBoundsBlock(uiblock, 5);
- uiDoBlocks(&listb, 0, mouse_exit);
- }
- uiFreeBlocks(&listb);
- uiblock = NULL;
- BPy_Free_DrawButtonsList(); /*clear all temp button references*/
-
- Py_XDECREF( result );
- Py_RETURN_NONE;
-}
-
-#if 0 /* not used yet */
-static void Set_uiBlock(uiBlock *block)
-{
- uiblock = block;
-}
-#endif
-
-static uiBlock *Get_uiBlock( void )
-{
- char butblock[32];
- /* Global, used now for UIBlock */
- if (uiblock) {
- return uiblock;
- }
- /* Local */
- sprintf( butblock, "win %d", curarea->win );
-
- return uiGetBlock( butblock, curarea );
-}
-
-
-/* We restrict the acceptable event numbers to a proper "free" range
- * according to other spaces in Blender.
- * winqread***space() (space events callbacks) use short for events
- * (called 'val' there) and we also translate by EXPP_BUTTON_EVENTS_OFFSET
- * to get rid of unwanted events (check BPY_do_pywin_events above for
- * explanation). This function takes care of that and proper checking: */
-static int check_button_event(int *event) {
- if ((*event < EXPP_BUTTON_EVENTS_MIN) ||
- (*event > EXPP_BUTTON_EVENTS_MAX)) {
- return -1;
- }
- if (uiblock==NULL) /* For UIBlock we need non offset UI elements */
- *event += EXPP_BUTTON_EVENTS_OFFSET;
- return 0;
-}
-
-static PyObject *Method_BeginAlign( PyObject * self, PyObject * args )
-{
- uiBlock *block = Get_uiBlock( );
-
- if (block)
- uiBlockBeginAlign(block);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_EndAlign( PyObject * self, PyObject * args )
-{
- uiBlock *block = Get_uiBlock( );
-
- if (block)
- uiBlockEndAlign(block);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_Button( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *name, *tip = NULL;
- int event;
- int x, y, w, h;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Button() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiii|sO", &name, &event,
- &x, &y, &w, &h, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, five ints and optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut = uiDefBut( block, BUT, event, name, (short)x, (short)y, (short)w, (short)h, 0, 0, 0, 0, 0, tip );
- set_pycallback(ubut, callback, NULL);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *Method_Menu( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *name, *tip = NULL;
- int event, def;
- int x, y, w, h;
- Button *but;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Menu() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiiii|sO", &name, &event,
- &x, &y, &w, &h, &def, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, six ints and optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- but = newbutton( );
- but->type = BINT_TYPE;
- but->val.asint = def;
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut = uiDefButI( block, MENU, event, name, (short)x, (short)y, (short)w, (short)h,
- &but->val.asint, 0, 0, 0, 0, but->tooltip );
- set_pycallback(ubut, callback, but);
- }
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_Toggle( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *name, *tip = NULL;
- int event;
- int x, y, w, h, def;
- Button *but;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Toggle() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiiii|sO", &name, &event,
- &x, &y, &w, &h, &def, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, six ints and optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- but = newbutton( );
- but->type = BINT_TYPE;
- but->val.asint = def;
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut = uiDefButI( block, TOG, event, name, (short)x, (short)y, (short)w, (short)h,
- &but->val.asint, 0, 0, 0, 0, but->tooltip );
- set_pycallback(ubut, callback, but);
- }
- return ( PyObject * ) but;
-}
-
-/*@DO NOT TOUCH THIS FUNCTION !
- Redrawing a slider inside its own callback routine is actually forbidden
- with the current toolkit architecture (button routines are not reentrant).
- But it works anyway.
- XXX This is condemned to be dinosource in future - it's a hack.
- */
-
-static void py_slider_update( void *butv, void *data2_unused )
-{
- uiBut *but = butv;
- PyObject *ref = Py_BuildValue( "(i)", SPACE_VIEW3D );
- PyObject *ret = NULL;
-
- EXPP_disable_force_draw = 1;
- /*@ Disable forced drawing, otherwise the button object which
- * is still being used might be deleted */
-
- curarea->win_swap = WIN_BACK_OK;
- /* removed global uiFrontBuf (contact ton when this goes wrong here) */
-
- disable_where_script( 1 );
-
- spacescript_do_pywin_buttons( curarea->spacedata.first,
- (unsigned short)uiButGetRetVal( but ) - EXPP_BUTTON_EVENTS_OFFSET );
-
- /* XXX useless right now, investigate better before a bcon 5 */
- ret = M_Window_Redraw( 0, ref );
-
- Py_XDECREF(ref);
- Py_XDECREF(ret);
-
- disable_where_script( 0 );
-
- EXPP_disable_force_draw = 0;
-}
-
-static PyObject *Method_Slider( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *name, *tip = NULL;
- int event;
- int x, y, w, h, realtime = 1;
- Button *but;
- PyObject *mino, *maxo, *inio;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Sider() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiiiOOO|isO", &name, &event,
- &x, &y, &w, &h, &inio, &mino, &maxo, &realtime,
- &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, five ints, three PyObjects\n\
- and optionally int, string and callback arguments" );
-
- if(realtime && uiblock)
- realtime = 0; /* realtime dosnt work with UIBlock */
-
- UI_METHOD_ERRORCHECK;
-
- but = newbutton( );
-
- if( PyFloat_Check( inio ) ) {
- float ini, min, max;
-
- ini = (float)PyFloat_AsDouble( inio );
- min = (float)PyFloat_AsDouble( mino );
- max = (float)PyFloat_AsDouble( maxo );
-
- but->type = BFLOAT_TYPE;
- but->val.asfloat = ini;
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut;
- ubut = uiDefButF( block, NUMSLI, event, name, (short)x, (short)y, (short)w,
- (short)h, &but->val.asfloat, min, max, 0, 0,
- but->tooltip );
- if( realtime )
- uiButSetFunc( ubut, py_slider_update, ubut, NULL );
- else
- set_pycallback(ubut, callback, but);
- }
- } else {
- int ini, min, max;
-
- ini = PyInt_AsLong( inio );
- min = PyInt_AsLong( mino );
- max = PyInt_AsLong( maxo );
-
- but->type = BINT_TYPE;
- but->val.asint = ini;
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut;
- ubut = uiDefButI( block, NUMSLI, event, name, (short)x, (short)y, (short)w,
- (short)h, &but->val.asint, (float)min, (float)max, 0, 0,
- but->tooltip );
- if( realtime )
- uiButSetFunc( ubut, py_slider_update, ubut, NULL );
- else
- set_pycallback(ubut, callback, but);
- }
- }
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_Scrollbar( PyObject * self, PyObject * args )
-{
- char *tip = NULL;
- uiBlock *block;
- int event;
- int x, y, w, h, realtime = 1;
- Button *but;
- PyObject *mino, *maxo, *inio;
- float ini, min, max;
- uiBut *ubut;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Scrollbar() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "iiiiiOOO|isO", &event, &x, &y, &w, &h,
- &inio, &mino, &maxo, &realtime, &tip ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected five ints, three PyObjects and optionally\n\
-another int and string as arguments" );
-
- if( !PyNumber_Check( inio ) || !PyNumber_Check( inio )
- || !PyNumber_Check( inio ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected numbers for initial, min, and max" );
-
- if (check_button_event(&event) == -1)
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "button event argument must be in the range [0, 16382]");
-
- but = newbutton( );
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- if( PyFloat_Check( inio ) )
- but->type = BFLOAT_TYPE;
- else
- but->type = BINT_TYPE;
-
- ini = (float)PyFloat_AsDouble( inio );
- min = (float)PyFloat_AsDouble( mino );
- max = (float)PyFloat_AsDouble( maxo );
-
- block = Get_uiBlock( );
-
- if( block ) {
- if( but->type == BFLOAT_TYPE ) {
- but->val.asfloat = ini;
- ubut = uiDefButF( block, SCROLL, event, "", (short)x, (short)y, (short)w, (short)h,
- &but->val.asfloat, min, max, 0, 0, but->tooltip );
- if( realtime )
- uiButSetFunc( ubut, py_slider_update, ubut, NULL );
- } else {
- but->val.asint = (int)ini;
- ubut = uiDefButI( block, SCROLL, event, "", (short)x, (short)y, (short)w, (short)h,
- &but->val.asint, min, max, 0, 0, but->tooltip );
- if( realtime )
- uiButSetFunc( ubut, py_slider_update, ubut, NULL );
- }
- }
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_ColorPicker( PyObject * self, PyObject * args )
-{
- char USAGE_ERROR[] = "expected a 3-float tuple of values between 0 and 1";
- Button *but;
- PyObject *inio;
- uiBlock *block;
- char *tip = NULL;
- float col[3];
- int event;
- short x, y, w, h;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.ColorPicker() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "ihhhhO!|sO", &event,
- &x, &y, &w, &h, &PyTuple_Type, &inio, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected five ints, one tuple and optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- if ( !PyArg_ParseTuple( inio, "fff", col, col+1, col+2 ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError, USAGE_ERROR);
-
- if ( col[0] < 0 || col[0] > 1
- || col[1] < 0 || col[1] > 1
- || col[2] < 0 || col[2] > 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError, USAGE_ERROR);
-
- if ( EXPP_check_sequence_consistency( inio, &PyFloat_Type ) != 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError, USAGE_ERROR);
-
- but = newbutton();
-
- but->type = BVECTOR_TYPE;
- but->val.asvec[0] = col[0];
- but->val.asvec[1] = col[1];
- but->val.asvec[2] = col[2];
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut;
- ubut = uiDefButF( block, COL, event, "", x, y, w, h, but->val.asvec, 0, 0, 0, 0, but->tooltip);
- set_pycallback(ubut, callback, but);
- }
-
- return ( PyObject * ) but;
-}
-
-
-
-static PyObject *Method_Normal( PyObject * self, PyObject * args )
-{
- char USAGE_ERROR[] = "expected a 3-float tuple of values between -1 and 1";
- Button *but;
- PyObject *inio;
- uiBlock *block;
- char *tip = NULL;
- float nor[3];
- int event;
- short x, y, w, h;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Normal() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "ihhhhO!|sO", &event,
- &x, &y, &w, &h, &PyTuple_Type, &inio, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected five ints, one tuple and optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- if ( !PyArg_ParseTuple( inio, "fff", nor, nor+1, nor+2 ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError, USAGE_ERROR);
-
- if ( EXPP_check_sequence_consistency( inio, &PyFloat_Type ) != 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError, USAGE_ERROR);
-
- but = newbutton();
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- but->type = BVECTOR_TYPE;
- but->val.asvec[0] = nor[0];
- but->val.asvec[1] = nor[1];
- but->val.asvec[2] = nor[2];
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut;
- ubut = uiDefButF( block, BUT_NORMAL, event, "", x, y, w, h, but->val.asvec, 0.0f, 1.0f, 0, 0, but->tooltip);
- set_pycallback(ubut, callback, but);
- }
-
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_Number( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *name, *tip = NULL;
- int event;
- int x, y, w, h;
- Button *but;
- PyObject *mino, *maxo, *inio;
- PyObject *callback=NULL;
- PyObject *a1=NULL;
- PyObject *a2=NULL;
- uiBut *ubut= NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Number() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiiiOOO|sOOO", &name, &event,
- &x, &y, &w, &h, &inio, &mino, &maxo, &tip, &callback, &a1, &a2 ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, five ints, three PyObjects and\n\
- optionally string, callback, range and precision arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- if ( !PyNumber_Check(inio) || !PyNumber_Check(mino) ||
- !PyNumber_Check(maxo) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected ints or floats for the initial, min and max values" );
- }
-
- but = newbutton( );
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
- block = Get_uiBlock( );
-
- if( PyFloat_Check( inio ) ) {
- float ini, min, max, range, precission=0;
-
- ini = (float)PyFloat_AsDouble( inio );
- min = (float)PyFloat_AsDouble( mino );
- max = (float)PyFloat_AsDouble( maxo );
-
- if(a1 && PyNumber_Check(a1)) {
- if(PyFloat_Check(a1))
- range= (float)PyFloat_AsDouble(a1);
- else
- range= (float)PyInt_AsLong(a1);
- } else {
- range= (float)fabs(max-min); /* Click step will be a 10th of the range. */
- if (!range) range= 1.0f; /* avoid any odd errors */
- }
-
- if(a2 && PyNumber_Check(a2)) {
- if(PyFloat_Check(a2))
- precission= (float)PyFloat_AsDouble(a2);
- else
- precission= (float)PyInt_AsLong(a2);
- } else {
- /* set the precission to display*/
- if (range>=1000.0f) precission=1.0f;
- else if (range>=100.0f) precission=2.0f;
- else if (range>=10.0f) precission=3.0f;
- else precission=4.0f;
-
- range *= 10;
- }
-
- but->type = BFLOAT_TYPE;
- but->val.asfloat = ini;
-
-
- if( block )
- ubut= uiDefButF( block, NUM, event, name, (short)x, (short)y, (short)w, (short)h,
- &but->val.asfloat, min, max, range, precission, but->tooltip );
- } else {
- int ini, min, max;
-
- ini = PyInt_AsLong( inio );
- min = PyInt_AsLong( mino );
- max = PyInt_AsLong( maxo );
-
- but->type = BINT_TYPE;
- but->val.asint = ini;
-
- if( block )
- ubut= uiDefButI( block, NUM, event, name, (short)x, (short)y, (short)w, (short)h,
- &but->val.asint, (float)min, (float)max, 0, 0, but->tooltip );
- }
-
- if (ubut) set_pycallback(ubut, callback, but);
-
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_String( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *info_arg = NULL, *tip = NULL, *newstr = NULL;
- char *info_str = NULL, *info_str0 = " ";
- int event;
- int x, y, w, h, len, real_len = 0;
- Button *but;
- PyObject *callback=NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.String() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiiiisi|sO", &info_arg, &event,
- &x, &y, &w, &h, &newstr, &len, &tip, &callback ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string, five ints, a string, an int and\n\
- optionally string and callback arguments" );
-
- UI_METHOD_ERRORCHECK;
-
- if (len > (UI_MAX_DRAW_STR - 1))
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "The maximum length of a string is 399, your value is too high.");
-
- real_len = strlen(newstr);
- if (real_len > len) real_len = len;
-
- but = newbutton( );
- but->type = BSTRING_TYPE;
- but->slen = len;
- but->val.asstr = MEM_mallocN( len + 1, "pybutton str" );
- if (tip) strncpy(but->tooltip, tip, BPY_MAX_TOOLTIP);
-
- BLI_strncpy( but->val.asstr, newstr, len + 1); /* adds '\0' */
- but->val.asstr[real_len] = '\0';
-
- if (info_arg[0] == '\0') info_str = info_str0;
- else info_str = info_arg;
-
- block = Get_uiBlock( );
- if( block ) {
- uiBut *ubut = uiDefBut( block, TEX, event, info_str, (short)x, (short)y, (short)w, (short)h,
- but->val.asstr, 0, (float)len, 0, 0, but->tooltip );
- set_pycallback(ubut, callback, but);
- }
- return ( PyObject * ) but;
-}
-
-static PyObject *Method_GetStringWidth( PyObject * self, PyObject * args )
-{
- char *text;
- char *font_str = "normal";
- struct BMF_Font *font;
- PyObject *width;
-
- if( !PyArg_ParseTuple( args, "s|s", &text, &font_str ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or two string arguments" );
-
- if( !strcmp( font_str, "normal" ) )
- font = ( &G )->font;
- else if( !strcmp( font_str, "normalfix" ) )
- font = BMF_GetFont(BMF_kScreen12);
- else if( !strcmp( font_str, "large" ) )
- font = BMF_GetFont(BMF_kScreen15);
- else if( !strcmp( font_str, "small" ) )
- font = ( &G )->fonts;
- else if( !strcmp( font_str, "tiny" ) )
- font = ( &G )->fontss;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "\"font\" must be: 'large','normal' (default), 'normalfix', 'small' or 'tiny'." );
-
- width = PyInt_FromLong( BMF_GetStringWidth( font, text ) );
-
- if( !width )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyInt" );
-
- return width;
-}
-
-static PyObject *Method_Text( PyObject * self, PyObject * args )
-{
- char *text;
- char *font_str = NULL;
- struct BMF_Font *font;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Text() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "s|s", &text, &font_str ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or two string arguments" );
-
- if( !font_str )
- font = ( &G )->font;
- else if( !strcmp( font_str, "large" ) )
- font = BMF_GetFont(BMF_kScreen15);
- else if( !strcmp( font_str, "normalfix" ) )
- font = BMF_GetFont(BMF_kScreen12);
- else if( !strcmp( font_str, "normal" ) )
- font = ( &G )->font;
- else if( !strcmp( font_str, "small" ) )
- font = ( &G )->fonts;
- else if( !strcmp( font_str, "tiny" ) )
- font = ( &G )->fontss;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "\"font\" must be: 'large','normal' (default), 'normalfix', 'small' or 'tiny'." );
-
- BMF_DrawString( font, text );
-
- return PyInt_FromLong( BMF_GetStringWidth( font, text ) );
-}
-
-static PyObject *Method_Label( PyObject * self, PyObject * args )
-{
- uiBlock *block;
- char *text;
- int x, y, w, h;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Label() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "siiii", &text, &x, &y, &w, &h ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string and four ints" );
-
- block = Get_uiBlock( );
- uiDefBut(block, LABEL, 0, text, x, y, w, h, 0, 0, 0, 0, 0, "");
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Method_PupMenu( PyObject * self, PyObject * args )
-{
- char *text;
- int maxrow = -1;
- PyObject *ret;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupMenu() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "s|i", &text, &maxrow ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string and optionally an int as arguments" );
-
- if( maxrow >= 0 )
- ret = PyInt_FromLong( pupmenu_col( text, maxrow ) );
- else
- ret = PyInt_FromLong( pupmenu( text ) );
-
- if( ret )
- return ret;
-
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create a PyInt" );
-}
-
-static int current_menu_ret;
-static void toolbox_event(void *arg, int event)
-{
- current_menu_ret = event;
-}
-
-static TBitem * menu_from_pylist( PyObject * current_menu, ListBase *storage )
-{
- TBitem *tbarray, *tbitem;
- Link *link;
- PyObject *item, *submenu;
- int size, i;
-
- char *menutext;
- int event;
-
- size = PyList_Size( current_menu );
-
- link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(size+1), "python menu");
-
- if (link==NULL) {
- PyErr_SetString( PyExc_MemoryError, "Could not allocate enough memory for the menu" );
- BLI_freelistN(storage);
- return NULL;
- }
-
- BLI_addtail(storage, link);
-
- tbarray = tbitem = (TBitem *)(link+1);
-
- for (i=0; i<size; i++, tbitem++) {
- /* need to get these in */
- item = PyList_GET_ITEM( current_menu, i);
-
- if (item == Py_None) {
- tbitem->name = "SEPR";
- } else if( PyArg_ParseTuple( item, "si", &menutext, &event ) ) {
- tbitem->name = menutext;
- tbitem->retval = event;
- //current_menu_index
- } else if( PyArg_ParseTuple( item, "sO!", &menutext, &PyList_Type, &submenu ) ) {
- PyErr_Clear(); /* from PyArg_ParseTuple above */
- tbitem->name = menutext;
- tbitem->poin = menu_from_pylist(submenu, storage);
- if (tbitem->poin == NULL) {
- BLI_freelistN(storage);
- return NULL; /* error should be set */
- }
- } else {
- PyErr_Clear(); /* from PyArg_ParseTuple above */
-
- PyErr_SetString( PyExc_TypeError, "Expected a list of name,event tuples, None, or lists for submenus" );
- BLI_freelistN(storage);
- return NULL;
- }
- }
- tbitem->icon= -1; /* end signal */
- tbitem->name= "";
- tbitem->retval= 0;
- tbitem->poin= toolbox_event;
-
- return tbarray;
-}
-
-static PyObject *Method_PupTreeMenu( PyObject * self, PyObject * args )
-{
- PyObject * current_menu;
- ListBase storage = {NULL, NULL};
- TBitem *tb;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupMenuTree() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "O!", &PyList_Type, &current_menu ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected a list" );
-
- mywinset(G.curscreen->mainwin); // we go to screenspace
-
- tb = menu_from_pylist(current_menu, &storage);
-
- if (!tb) {
- /* Error is set */
- return NULL;
- }
-
- current_menu_ret = -1;
- toolbox_generic(tb);
-
- /* free all dynamic entries... */
- BLI_freelistN(&storage);
-
- mywinset(curarea->win);
- return PyInt_FromLong( current_menu_ret ); /* current_menu_ret is set by toolbox_event callback */
-}
-
-static PyObject *Method_PupIntInput( PyObject * self, PyObject * args )
-{
- char *text = NULL;
- int min = 0, max = 1;
- short var = 0;
- PyObject *ret = NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupIntInput() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "s|hii", &text, &var, &min, &max ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1 string and 3 int arguments" );
-
- if( button( &var, (short)min, (short)max, text ) == 0 ) {
- Py_INCREF( Py_None );
- return Py_None;
- }
- ret = PyInt_FromLong( var );
- if( ret )
- return ret;
-
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create a PyInt" );
-}
-
-static PyObject *Method_PupFloatInput( PyObject * self, PyObject * args )
-{
- char *text = NULL;
- float min = 0, max = 1, var = 0, a1 = 10, a2 = 2;
- PyObject *ret = NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupFloatInput() in background mode." );
- }
-
- if( !PyArg_ParseTuple
- ( args, "s|fffff", &text, &var, &min, &max, &a1, &a2 ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1 string and 5 float arguments" );
-
- if( fbutton( &var, min, max, a1, a2, text ) == 0 ) {
- Py_INCREF( Py_None );
- return Py_None;
- }
- ret = PyFloat_FromDouble( var );
- if( ret )
- return ret;
-
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create a PyFloat" );
-}
-
-static PyObject *Method_PupStrInput( PyObject * self, PyObject * args )
-{
- char *text = NULL, *textMsg = NULL;
- char tmp[101];
- char max = 20;
- PyObject *ret = NULL;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupStrInput() in background mode." );
- }
-
- if( !PyArg_ParseTuple( args, "ss|b", &textMsg, &text, &max ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 strings and 1 int" );
-
- if( ( max <= 0 ) || ( max > 100 ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "max string length value must be in the range [1, 100]." );
-
- /* copying the text string handles both cases:
- * max < strlen(text) (by truncating) and
- * max > strlen(text) (by expanding to strlen(tmp)) */
- BLI_strncpy( tmp, text, max + 1 );
-
- if( sbutton( tmp, 0, max, textMsg ) == 0 ) {
- Py_INCREF( Py_None );
- return Py_None;
- }
-
- ret = PyString_FromString( tmp );
-
- if( ret )
- return ret;
-
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create a PyString" );
-}
-
-static PyObject *Method_PupBlock( PyObject * self, PyObject * args )
-{
- PyObject *pyList, *pyItem;
- float min, max;
- int len, i;
- char *title;
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.PupBlock() in background mode." );
- }
-
- if (!PyArg_ParseTuple( args, "sO", &title, &pyList ) || !PySequence_Check( pyList ))
- return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a string and a sequence" );
-
-
- len = PySequence_Length(pyList);
-
- if (len == 0)
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string and a non-empty sequence." );
-
- if (len > 120) /* LIMIT DEFINED IN toolbox.c */
- return EXPP_ReturnPyObjError( PyExc_ValueError, "sequence cannot have more than 120 elements" );
-
- for ( i=0 ; i<len ; i++ ) {
- PyObject *pyMin = NULL, *pyMax = NULL;
- PyObject *f1, *f2;
- Button *but = NULL;
- int tlen;
- char *text, *tip = NULL;
-
- pyItem = PySequence_GetItem( pyList, i );
- if (!pyItem)
- return NULL;
-
- if (PyString_Check( pyItem )) {
- tlen = -2; /* single string for label, giving it a special len for later */
- }
- else if (PyTuple_Check( pyItem )) {
- /* tuple for other button, get the length for later */
- tlen = PyTuple_Size( pyItem );
- }
- else {
- /* Neither a string or a tuple, error */
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string or a tuple containing 2 to 5 values." );
- }
-
- switch (tlen) {
- case -2: /* LABEL */
- text = PyString_AsString( pyItem );
- add_numbut(i, LABEL, text, 0, 0, NULL, NULL);
- break;
- case 2: /* TOGGLE (no tooltip) */
- case 3: /* TOGGLE */
- if (!PyArg_ParseTuple( pyItem, "sO!|s", &text, &Button_Type, &but, &tip )) {
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a tuple containing a string, a Button object and optionally a string for toggles" );
- }
-
- if (but->type != BINT_TYPE) {
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "Button object for toggles should hold an integer" );
- }
-
- add_numbut(i, TOG|INT, text, 0, 0, &but->val.asint, tip);
- break;
- case 4: /* TEX and NUM (no tooltip) */
- case 5: /* TEX and NUM */
- if (!PyArg_ParseTuple( pyItem, "sO!OO|s", &text, &Button_Type, &but, &pyMin, &pyMax, &tip )) {
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a tuple containing a string, a Button object, two numerical values and optionally a string for Text and Num buttons" );
- }
-
- f1 = PyNumber_Float(pyMin);
- f2 = PyNumber_Float(pyMax);
-
- if (!f1 || !f2) {
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a tuple containing a string, a Button object, two numerical values and optionally a string for Text and Num buttons" );
- }
-
- min = (float)PyFloat_AS_DOUBLE(f1);
- max = (float)PyFloat_AS_DOUBLE(f2);
- Py_DECREF( f1 );
- Py_DECREF( f2 );
-
- switch ( but->type ) {
- case BINT_TYPE:
- add_numbut(i, NUM|INT, text, min, max, &but->val.asint, tip);
- break;
- case BFLOAT_TYPE:
- add_numbut(i, NUM|FLO, text, min, max, &but->val.asfloat, tip);
- break;
- case BSTRING_TYPE:
- if (max+1>UI_MAX_DRAW_STR) {
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "length of a string buttons must be less then 400" );
- }
- max = (float)floor(max);
-
- if (max > but->slen) {
- int old_len = but->slen;
- char *old_str = but->val.asstr;
- but->slen = (int)max;
- but->val.asstr = MEM_callocN( but->slen + 1, "button pupblock");
- BLI_strncpy( but->val.asstr, old_str, old_len + 1 );
- MEM_freeN(old_str);
- }
-
- add_numbut(i, TEX, text, 0.0f, max, but->val.asstr, tip);
- }
-
- break;
- default:
- Py_DECREF( pyItem );
- return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string or a tuple containing 2 to 5 values." );
- }
- Py_DECREF( pyItem );
- }
-
- if (do_clever_numbuts(title, len, REDRAW))
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-
-/*****************************************************************************
- * Function: Method_Image *
- * Python equivalent: Blender.Draw.Image *
- * *
- * @author Jonathan Merritt <j.merritt@pgrad.unimelb.edu.au> *
- ****************************************************************************/
-static PyObject *Method_Image( PyObject * self, PyObject * args )
-{
- PyObject *pyObjImage;
- BPy_Image *py_img;
- Image *image;
- ImBuf *ibuf;
- float originX, originY;
- float zoomX = 1.0, zoomY = 1.0;
- int clipX = 0, clipY = 0, clipW = -1, clipH = -1;
- /*GLfloat scissorBox[4];*/
-
- if (G.background) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Can't run Draw.Image() in background mode." );
- }
-
- /* parse the arguments passed-in from Python */
- if( !PyArg_ParseTuple( args, "O!ff|ffiiii", &Image_Type, &pyObjImage,
- &originX, &originY, &zoomX, &zoomY,
- &clipX, &clipY, &clipW, &clipH ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a Blender.Image and 2 floats, and " \
- "optionally 2 floats and 4 ints as arguments" );
- /* check that the zoom factors are valid */
- if( ( zoomX < 0.0 ) || ( zoomY < 0.0 ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "invalid zoom factors - they must be > 0.0" );
- if ((zoomX == 0.0 ) || ( zoomY == 0.0 )) {
- /* sometimes python doubles can be converted from small values to a zero float, in this case just dont draw */
- Py_RETURN_NONE;
- }
-
-
- /* fetch a C Image pointer from the passed-in Python object */
- py_img = ( BPy_Image * ) pyObjImage;
- image = py_img->image;
- ibuf = BKE_image_get_ibuf( image, NULL );
-
- if( !ibuf ) /* if failed to load the image */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
- if( !ibuf->rect ) /* no float yet */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Image has no byte rect" );
-
- /* Update the time tag of the image */
- tag_image_time(image);
-
- /* set up a valid clipping rectangle. if no clip rectangle was
- * given, this results in inclusion of the entire image. otherwise,
- * the clipping is just checked against the bounds of the image.
- * if clipW or clipH are less than zero then they include as much of
- * the image as they can. */
- clipX = EXPP_ClampInt( clipX, 0, ibuf->x );
- clipY = EXPP_ClampInt( clipY, 0, ibuf->y );
- if( ( clipW < 0 ) || ( clipX+clipW > ibuf->x ) )
- clipW = ibuf->x - clipX;
- if( ( clipH < 0 ) || ( clipY+clipH > ibuf->y ) )
- clipH = ibuf->y - clipY;
-
- /* -- we are "Go" to Draw! -- */
-
- /* set the raster position.
- *
- * If the raster position is negative, then using glRasterPos2i()
- * directly would cause it to be clipped. Instead, we first establish
- * a valid raster position within the clipping rectangle of the
- * window and then use glBitmap() with a NULL image pointer to offset
- * it to the true position we require. To pick an initial valid
- * raster position within the viewport, we query the clipping rectangle
- * and use its lower-left pixel.
- *
- * This particular technique is documented in the glRasterPos() man
- * page, although I haven't seen it used elsewhere in Blender.
- */
-
- /* update (W): to fix a bug where images wouldn't get drawn if the bottom
- * left corner of the Scripts win were above a given height or to the right
- * of a given width, the code below is being commented out. It should not
- * be needed anyway, because spaces in Blender are projected to lie inside
- * their areas, see src/drawscript.c for example. Note: the
- * glaRasterPosSafe2i function in src/glutil.c does use the commented out
- * technique, but with 0,0 instead of scissorBox. This function can be
- * a little optimized, based on glaDrawPixelsSafe in that same fine, but
- * we're too close to release 2.37 right now. */
- /*
- glGetFloatv( GL_SCISSOR_BOX, scissorBox );
- glRasterPos2i( scissorBox[0], scissorBox[1] );
- glBitmap( 0, 0, 0.0, 0.0,
- originX-scissorBox[0], originY-scissorBox[1], NULL );
- */
-
- /* update (cont.): using these two lines instead:
- * (based on glaRasterPosSafe2i, but Ken Hughes deserves credit
- * for suggesting this exact fix in the bug tracker) */
- glRasterPos2i(0, 0);
- glBitmap( 0, 0, 0.0, 0.0, originX, originY, NULL );
-
- /* set the zoom */
- glPixelZoom( zoomX, zoomY );
-
- /* set the width of the image (ROW_LENGTH), and the offset to the
- * clip origin within the image in x (SKIP_PIXELS) and
- * y (SKIP_ROWS) */
- glPixelStorei( GL_UNPACK_ROW_LENGTH, ibuf->x );
- glPixelStorei( GL_UNPACK_SKIP_PIXELS, clipX );
- glPixelStorei( GL_UNPACK_SKIP_ROWS, clipY );
-
- /* draw the image */
- glDrawPixels( clipW, clipH, GL_RGBA, GL_UNSIGNED_BYTE,
- ibuf->rect );
-
- /* restore the defaults for some parameters (we could also use a
- * glPushClientAttrib() and glPopClientAttrib() pair). */
- glPixelZoom( 1.0, 1.0 );
- glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
- glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
- glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
-
- Py_RETURN_NONE;
-
-}
-
-PyObject *Draw_Init( void )
-{
- PyObject *submodule, *dict;
-
- if( PyType_Ready( &Button_Type) < 0)
- Py_RETURN_NONE;
-
- submodule = Py_InitModule3( "Blender.Draw", Draw_methods, Draw_doc );
-
- dict = PyModule_GetDict( submodule );
-
-#define EXPP_ADDCONST(x) \
- EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(x))
-
- /* So, for example:
- * EXPP_ADDCONST(LEFTMOUSE) becomes
- * EXPP_dict_set_item_str(dict, "LEFTMOUSE", PyInt_FromLong(LEFTMOUSE))
- */
-
- EXPP_ADDCONST( LEFTMOUSE );
- EXPP_ADDCONST( MIDDLEMOUSE );
- EXPP_ADDCONST( RIGHTMOUSE );
- EXPP_ADDCONST( WHEELUPMOUSE );
- EXPP_ADDCONST( WHEELDOWNMOUSE );
- EXPP_ADDCONST( MOUSEX );
- EXPP_ADDCONST( MOUSEY );
- EXPP_ADDCONST( TIMER0 );
- EXPP_ADDCONST( TIMER1 );
- EXPP_ADDCONST( TIMER2 );
- EXPP_ADDCONST( TIMER3 );
- EXPP_ADDCONST( KEYBD );
- EXPP_ADDCONST( RAWKEYBD );
- EXPP_ADDCONST( REDRAW );
- EXPP_ADDCONST( INPUTCHANGE );
- EXPP_ADDCONST( QFULL );
- EXPP_ADDCONST( WINFREEZE );
- EXPP_ADDCONST( WINTHAW );
- EXPP_ADDCONST( WINCLOSE );
- EXPP_ADDCONST( WINQUIT );
-#ifndef IRISGL
- EXPP_ADDCONST( Q_FIRSTTIME );
-#endif
- EXPP_ADDCONST( AKEY );
- EXPP_ADDCONST( BKEY );
- EXPP_ADDCONST( CKEY );
- EXPP_ADDCONST( DKEY );
- EXPP_ADDCONST( EKEY );
- EXPP_ADDCONST( FKEY );
- EXPP_ADDCONST( GKEY );
- EXPP_ADDCONST( HKEY );
- EXPP_ADDCONST( IKEY );
- EXPP_ADDCONST( JKEY );
- EXPP_ADDCONST( KKEY );
- EXPP_ADDCONST( LKEY );
- EXPP_ADDCONST( MKEY );
- EXPP_ADDCONST( NKEY );
- EXPP_ADDCONST( OKEY );
- EXPP_ADDCONST( PKEY );
- EXPP_ADDCONST( QKEY );
- EXPP_ADDCONST( RKEY );
- EXPP_ADDCONST( SKEY );
- EXPP_ADDCONST( TKEY );
- EXPP_ADDCONST( UKEY );
- EXPP_ADDCONST( VKEY );
- EXPP_ADDCONST( WKEY );
- EXPP_ADDCONST( XKEY );
- EXPP_ADDCONST( YKEY );
- EXPP_ADDCONST( ZKEY );
- EXPP_ADDCONST( ZEROKEY );
- EXPP_ADDCONST( ONEKEY );
- EXPP_ADDCONST( TWOKEY );
- EXPP_ADDCONST( THREEKEY );
- EXPP_ADDCONST( FOURKEY );
- EXPP_ADDCONST( FIVEKEY );
- EXPP_ADDCONST( SIXKEY );
- EXPP_ADDCONST( SEVENKEY );
- EXPP_ADDCONST( EIGHTKEY );
- EXPP_ADDCONST( NINEKEY );
- EXPP_ADDCONST( CAPSLOCKKEY );
- EXPP_ADDCONST( LEFTCTRLKEY );
- EXPP_ADDCONST( LEFTALTKEY );
- EXPP_ADDCONST( RIGHTALTKEY );
- EXPP_ADDCONST( RIGHTCTRLKEY );
- EXPP_ADDCONST( RIGHTSHIFTKEY );
- EXPP_ADDCONST( LEFTSHIFTKEY );
- EXPP_ADDCONST( ESCKEY );
- EXPP_ADDCONST( TABKEY );
- EXPP_ADDCONST( RETKEY );
- EXPP_ADDCONST( SPACEKEY );
- EXPP_ADDCONST( LINEFEEDKEY );
- EXPP_ADDCONST( BACKSPACEKEY );
- EXPP_ADDCONST( DELKEY );
- EXPP_ADDCONST( SEMICOLONKEY );
- EXPP_ADDCONST( PERIODKEY );
- EXPP_ADDCONST( COMMAKEY );
- EXPP_ADDCONST( QUOTEKEY );
- EXPP_ADDCONST( ACCENTGRAVEKEY );
- EXPP_ADDCONST( MINUSKEY );
- EXPP_ADDCONST( SLASHKEY );
- EXPP_ADDCONST( BACKSLASHKEY );
- EXPP_ADDCONST( EQUALKEY );
- EXPP_ADDCONST( LEFTBRACKETKEY );
- EXPP_ADDCONST( RIGHTBRACKETKEY );
- EXPP_ADDCONST( LEFTARROWKEY );
- EXPP_ADDCONST( DOWNARROWKEY );
- EXPP_ADDCONST( RIGHTARROWKEY );
- EXPP_ADDCONST( UPARROWKEY );
- EXPP_ADDCONST( PAD2 );
- EXPP_ADDCONST( PAD4 );
- EXPP_ADDCONST( PAD6 );
- EXPP_ADDCONST( PAD8 );
- EXPP_ADDCONST( PAD1 );
- EXPP_ADDCONST( PAD3 );
- EXPP_ADDCONST( PAD5 );
- EXPP_ADDCONST( PAD7 );
- EXPP_ADDCONST( PAD9 );
- EXPP_ADDCONST( PADPERIOD );
- EXPP_ADDCONST( PADSLASHKEY );
- EXPP_ADDCONST( PADASTERKEY );
- EXPP_ADDCONST( PAD0 );
- EXPP_ADDCONST( PADMINUS );
- EXPP_ADDCONST( PADENTER );
- EXPP_ADDCONST( PADPLUSKEY );
- EXPP_ADDCONST( F1KEY );
- EXPP_ADDCONST( F2KEY );
- EXPP_ADDCONST( F3KEY );
- EXPP_ADDCONST( F4KEY );
- EXPP_ADDCONST( F5KEY );
- EXPP_ADDCONST( F6KEY );
- EXPP_ADDCONST( F7KEY );
- EXPP_ADDCONST( F8KEY );
- EXPP_ADDCONST( F9KEY );
- EXPP_ADDCONST( F10KEY );
- EXPP_ADDCONST( F11KEY );
- EXPP_ADDCONST( F12KEY );
- EXPP_ADDCONST( PAUSEKEY );
- EXPP_ADDCONST( INSERTKEY );
- EXPP_ADDCONST( HOMEKEY );
- EXPP_ADDCONST( PAGEUPKEY );
- EXPP_ADDCONST( PAGEDOWNKEY );
- EXPP_ADDCONST( ENDKEY );
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Draw.h b/source/blender/python/api2_2x/Draw.h
deleted file mode 100644
index 561cd88952c..00000000000
--- a/source/blender/python/api2_2x/Draw.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* The code in Draw.[ch] and BGL.[ch] comes from opy_draw.c in the old
- * bpython/intern dir, with minor modifications to suit the current
- * implementation. Important original comments are marked with an @ symbol. */
-
-#ifndef EXPP_DRAW_H_
-#define EXPP_DRAW_H_
-
-#include <Python.h>
-#include "DNA_space_types.h"
-#include "DNA_text_types.h"
-
-void initDraw( void );
-
-/*
- * Button Object stuct
- */
-
-typedef struct _Button {
- PyObject_VAR_HEAD /* required Py Macro */
- int type; /*@ 1 == int, 2 == float, 3 == string */
- unsigned int slen; /*@ length of string (if type == 3) */
- union {
- int asint;
- float asfloat;
- char *asstr;
- float asvec[3];
- } val;
- char tooltip[256];
-} Button;
-
-#define BPY_MAX_TOOLTIP 255
-
-#define BINT_TYPE 1
-#define BFLOAT_TYPE 2
-#define BSTRING_TYPE 3
-#define BVECTOR_TYPE 4
-
-/*
- * these are declared in ../BPY_extern.h
-*/
-
-PyObject *M_Draw_Init( void );
-PyObject *Draw_Init( void );
-
-#endif /* EXPP_DRAW_H */
diff --git a/source/blender/python/api2_2x/EXPP_interface.c b/source/blender/python/api2_2x/EXPP_interface.c
deleted file mode 100644
index 71f52c3e48c..00000000000
--- a/source/blender/python/api2_2x/EXPP_interface.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <Python.h>
-
-#include "EXPP_interface.h"
-#include "BLI_blenlib.h"
-#include "MEM_guardedalloc.h"
-#include "BLI_linklist.h" /* linked list: LinkNode struct and functions */
-#include "DNA_object_types.h"
-#include "DNA_space_types.h" /* for FILE_MAXDIR, FILE_MAXFILE */
-#include "Blender.h"
-
-extern char bprogname[]; /* argv[0] from creator.c */
-
-/* this makes sure BLI_gethome() returns a path with '.blender' appended
- * Besides, this function now either returns userhome/.blender (if it exists)
- * or blenderInstallDir/.blender/ otherwise (can also be cvs dir).
- * If append_scriptsdir is non NULL, "scripts/" is appended to the dir, to
- * get the path to the scripts folder ("release/scripts/" if cvs dir).
- * Finally, if all else fails BLI_gethome() is returned
- * (or NULL if append_scriptdir != 0).
-*/
-char *bpy_gethome(int append_scriptsdir)
-{
- static char homedir[FILE_MAXDIR];
- static char scriptsdir[FILE_MAXDIR];
- char tmpdir[FILE_MAXDIR];
- char bprogdir[FILE_MAXDIR];
- char *s;
- int i;
-
- if (append_scriptsdir) {
- if (scriptsdir[0] != '\0')
- return scriptsdir;
- }
- else if (homedir[0] != '\0')
- return homedir;
-
- /* BLI_gethome() can return NULL if env vars are not set */
- s = BLI_gethome();
-
- if( !s ) /* bail if no $HOME */
- {
- printf("$HOME is NOT set\n");
- return NULL;
- }
-
- if( strstr( s, ".blender" ) )
- PyOS_snprintf( homedir, FILE_MAXDIR, s );
- else
- BLI_make_file_string( "/", homedir, s, ".blender" );
-
- /* if userhome/.blender/ exists, return it */
- if( BLI_exists( homedir ) ) {
- if (append_scriptsdir) {
- BLI_make_file_string("/", scriptsdir, homedir, "scripts");
- if (BLI_exists (scriptsdir)) return scriptsdir;
- }
- else return homedir;
- }
- else homedir[0] = '\0';
-
- /* if either:
- * no homedir was found or
- * append_scriptsdir = 1 but there's no scripts/ inside homedir,
- * use argv[0] (bprogname) to get .blender/ in
- * Blender's installation dir */
- s = BLI_last_slash( bprogname );
-
- i = s - bprogname + 1;
-
- PyOS_snprintf( bprogdir, i, "%s", bprogname );
-
- /* using tmpdir to preserve homedir (if) found above:
- * the ideal is to have a home dir with scripts dir inside
- * it, but if that isn't available, it's possible to
- * have a 'broken' home dir somewhere and a scripts dir in the
- * cvs sources */
- BLI_make_file_string( "/", tmpdir, bprogdir, ".blender" );
-
- if (BLI_exists(tmpdir)) {
- if (append_scriptsdir) {
- BLI_make_file_string("/", scriptsdir, tmpdir, "scripts");
- if (BLI_exists(scriptsdir)) {
- PyOS_snprintf(homedir, FILE_MAXDIR, "%s", tmpdir);
- return scriptsdir;
- }
- else {
- homedir[0] = '\0';
- scriptsdir[0] = '\0';
- }
- }
- else return homedir;
- }
-
- /* last try for scripts dir: blender in cvs dir, scripts/ inside release/: */
- if (append_scriptsdir) {
- BLI_make_file_string("/", scriptsdir, bprogdir, "release/scripts");
- if (BLI_exists(scriptsdir)) return scriptsdir;
- else scriptsdir[0] = '\0';
- }
-
- return NULL;
-}
-
-/* PyDrivers */
-
-/*
- * Pydrivers are Blender Ipo Drivers defined by Python expressions.
- * We need to tell DAG about objects used in these expressions, so we
- * eval each expression to collect the ob refs. in it.
- */
-
-/* these are checked for example in Object.c: M_Object_Get (Object.Get())
- * to collect the refs. */
-static int pydriver_running = 0;
-
-int bpy_during_pydriver(void)
-{
- return pydriver_running;
-}
-
-void bpy_pydriver_running(int state)
-{
- pydriver_running = state;
-}
-
-/* Obj references are collected in this extern linked list: */
-LinkNode *bpy_pydriver_oblist = NULL;
-
-void bpy_pydriver_freeList(void)
-{
- BLI_linklist_free(bpy_pydriver_oblist, NULL);
- bpy_pydriver_oblist = NULL;
-}
-
-void bpy_pydriver_appendToList(struct Object *ob)
-{
- LinkNode *ln = bpy_pydriver_oblist;
-
- /* check that the expression is not referencing its owner object */
-
-/* XXX COMMENTED OUT TO TEST IF WE REALLY NEED TO IMPOSE THIS RESTRICTION
- if (ln && ln->link) {
- if (ob == (Object *)ln->link) {
- PyErr_SetString(PyExc_AttributeError,
- "Python driver expression can't reference its own object");
- return;
- }
- else
- ln = ln->next;
- }
-*/
- while (ln) { /* is ob already in list? ... */
- if (ob == (Object *)ln->link)
- break;
- ln = ln->next;
- }
-
- if (!ln) /* ... not yet, append it */
- BLI_linklist_append(&bpy_pydriver_oblist, (void *)ob);
-
- return;
-}
-
-/* Get an array from our linked list of objs referenced in the
- * current pydriver. The first node in the list is discarded,
- * since it is the actual pydriver owner, which shouldn't be
- * passed to the depsgraph (no self references). */
-struct Object **bpy_pydriver_obArrayFromList(void)
-{
- Object **obarray = NULL;
-
- if (bpy_pydriver_oblist) {
- int i;
- short len = BLI_linklist_length(bpy_pydriver_oblist);
-
- if (len > 1) {
-
- obarray = (Object **)MEM_mallocN(sizeof(Object*)*len,
- "pydriver array");
-
- if (obarray) {
- LinkNode *ln = bpy_pydriver_oblist;
- ln = ln->next; /* skip first ob, which is the pydriver owner */
-
- for (i = 0; i < len-1; i++) {
- obarray[i] = (Object *)ln->link;
- ln = ln->next;
- }
-
- obarray[len-1] = NULL; /* NULL-terminated array */
- }
- }
- bpy_pydriver_freeList();
- }
-
- return obarray;
-}
-
diff --git a/source/blender/python/api2_2x/EXPP_interface.h b/source/blender/python/api2_2x/EXPP_interface.h
deleted file mode 100644
index 6dc01244401..00000000000
--- a/source/blender/python/api2_2x/EXPP_interface.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_INTERFACE_H
-#define EXPP_INTERFACE_H
-
-struct Object;
-struct Script;
-struct LinkNode;
-
-extern struct LinkNode *bpy_pydriver_oblist;
-
-void initBlenderApi2_2x( void );
-char *bpy_gethome( int append_scriptsdir );
-void discardFromBDict( char *key );
-void EXPP_Library_Close( void ); /* in Library.c, used by BPY_end_python */
-
-/* PyDrivers */
-
-void bpy_pydriver_freeList(void);
-void bpy_pydriver_appendToList(struct Object *ob);
-struct Object **bpy_pydriver_obArrayFromList(void);
-
-int bpy_during_pydriver(void);
-void bpy_pydriver_running(int state);
-
-#endif /* EXPP_INTERFACE_H */
diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c
deleted file mode 100644
index 4d3dce741fc..00000000000
--- a/source/blender/python/api2_2x/Effect.c
+++ /dev/null
@@ -1,1319 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Jean-Michel Soler, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#include "Effect.h" /*This must come first */
-
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h" /* for G.scene->r.cfra */
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_effect.h"
-#include "BKE_object.h"
-#include "BKE_deform.h"
-#include "BKE_scene.h" /* for G.scene->r.cfra */
-#include "BKE_ipo.h" /* frame_to_float() */
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-#include "blendef.h"
-#include "vector.h"
-#include "MTC_matrixops.h"
-
-#define EXPP_EFFECT_STA_MIN -250.0f
-#define EXPP_EFFECT_END_MIN 1.0f
-#define EXPP_EFFECT_LIFETIME_MIN 1.0f
-#define EXPP_EFFECT_NORMFAC_MIN -2.0f
-#define EXPP_EFFECT_NORMFAC_MAX 2.0f
-#define EXPP_EFFECT_OBFAC_MIN -1.0f
-#define EXPP_EFFECT_OBFAC_MAX 1.0f
-#define EXPP_EFFECT_RANDFAC_MIN 0.0f
-#define EXPP_EFFECT_RANDFAC_MAX 2.0f
-#define EXPP_EFFECT_TEXFAC_MIN 0.0f
-#define EXPP_EFFECT_TEXFAC_MAX 2.0f
-#define EXPP_EFFECT_RANDLIFE_MIN 0.0f
-#define EXPP_EFFECT_RANDLIFE_MAX 2.0f
-#define EXPP_EFFECT_NABLA_MIN 0.0001f
-#define EXPP_EFFECT_NABLA_MAX 1.0f
-#define EXPP_EFFECT_VECTSIZE_MIN 0.0f
-#define EXPP_EFFECT_VECTSIZE_MAX 1.0f
-#define EXPP_EFFECT_TOTPART_MIN 1.0f
-#define EXPP_EFFECT_TOTPART_MAX 100000.0f
-#define EXPP_EFFECT_FORCE_MIN -1.0f
-#define EXPP_EFFECT_FORCE_MAX 1.0f
-#define EXPP_EFFECT_MULT_MIN 0.0f
-#define EXPP_EFFECT_MULT_MAX 1.0f
-#define EXPP_EFFECT_LIFE_MIN 1.0f
-#define EXPP_EFFECT_DEFVEC_MIN -1.0f
-#define EXPP_EFFECT_DEFVEC_MAX 1.0f
-#define EXPP_EFFECT_DAMP_MIN 0.0f
-#define EXPP_EFFECT_DAMP_MAX 1.0f
-
-#define EXPP_EFFECT_TOTKEY_MIN 1
-#define EXPP_EFFECT_TOTKEY_MAX 100
-#define EXPP_EFFECT_SEED_MIN 0
-#define EXPP_EFFECT_SEED_MAX 255
-#define EXPP_EFFECT_CHILD_MIN 1
-#define EXPP_EFFECT_CHILD_MAX 600
-#define EXPP_EFFECT_CHILDMAT_MIN 1
-#define EXPP_EFFECT_CHILDMAT_MAX 16
-#define EXPP_EFFECT_JITTER_MIN 0
-#define EXPP_EFFECT_JITTER_MAX 200
-#define EXPP_EFFECT_DISPMAT_MIN 1
-#define EXPP_EFFECT_DISPMAT_MAX 16
-#define EXPP_EFFECT_TIMETEX_MIN 1
-#define EXPP_EFFECT_TIMETEX_MAX 10
-#define EXPP_EFFECT_SPEEDTEX_MIN 1
-#define EXPP_EFFECT_SPEEDTEX_MAX 10
-#define EXPP_EFFECT_TEXMAP_MIN 1
-#define EXPP_EFFECT_TEXMAP_MAX 3
-
-#define EXPP_EFFECT_SPEEDTYPE_INTENSITY 0
-#define EXPP_EFFECT_SPEEDTYPE_RGB 1
-#define EXPP_EFFECT_SPEEDTYPE_GRADIENT 2
-
-#define EXPP_EFFECT_STATICSTEP_MIN 1
-#define EXPP_EFFECT_STATICSTEP_MAX 100
-#define EXPP_EFFECT_DISP_MIN 0
-#define EXPP_EFFECT_DISP_MAX 100
-
-/*****************************************************************************/
-/* Python API function prototypes for the Blender module. */
-/*****************************************************************************/
-static PyObject *M_Effect_New( PyObject * self, PyObject * args );
-static PyObject *M_Effect_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* Python BPy_Effect methods declarations: */
-/*****************************************************************************/
-static PyObject *Effect_getType( BPy_Effect * self );
-static int Effect_setType( void );
-static PyObject *Effect_getStype( BPy_Effect * self );
-static int Effect_setStype( BPy_Effect * self, PyObject * args );
-static PyObject *Effect_getFlag( BPy_Effect * self );
-static int Effect_setFlag( BPy_Effect * self, PyObject * args );
-static PyObject *Effect_getSta( BPy_Effect * self );
-static int Effect_setSta( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getEnd( BPy_Effect * self );
-static int Effect_setEnd( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getLifetime( BPy_Effect * self );
-static int Effect_setLifetime( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getNormfac( BPy_Effect * self );
-static int Effect_setNormfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getObfac( BPy_Effect * self );
-static int Effect_setObfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getRandfac( BPy_Effect * self );
-static int Effect_setRandfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getTexfac( BPy_Effect * self );
-static int Effect_setTexfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getRandlife( BPy_Effect * self );
-static int Effect_setRandlife( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getNabla( BPy_Effect * self );
-static int Effect_setNabla( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getVectsize( BPy_Effect * self );
-static int Effect_setVectsize( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getTotpart( BPy_Effect * self );
-static int Effect_setTotpart( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getTotkey( BPy_Effect * self );
-static int Effect_setTotkey( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getSeed( BPy_Effect * self );
-static int Effect_setSeed( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getForce( BPy_Effect * self );
-static int Effect_setForce( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getMult( BPy_Effect * self );
-static int Effect_setMult( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getLife( BPy_Effect * self );
-static int Effect_setLife( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getChildMat( BPy_Effect * self );
-static int Effect_setChildMat( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getChild( BPy_Effect * self );
-static int Effect_setChild( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getDefvec( BPy_Effect * self );
-static int Effect_setDefvec( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getJitter( BPy_Effect * self );
-static int Effect_setJitter( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getDispMat( BPy_Effect * self );
-static int Effect_setDispMat( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getEmissionTex( BPy_Effect * self );
-static int Effect_setEmissionTex( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getForceTex( BPy_Effect * self );
-static int Effect_setForceTex( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getDamping( BPy_Effect * self );
-static int Effect_setDamping( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getSpeedType( BPy_Effect * self );
-static int Effect_setSpeedType( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getVertGroup( BPy_Effect * self );
-static int Effect_setVertGroup( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getSpeedVertGroup( BPy_Effect * self );
-static int Effect_setSpeedVertGroup( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_getStaticStep( BPy_Effect * self );
-static int Effect_setStaticStep( BPy_Effect * self , PyObject * a);
-static PyObject *Effect_getDisp( BPy_Effect * self );
-static int Effect_setDisp( BPy_Effect * self , PyObject * a);
-static PyObject *Effect_getParticlesLoc( BPy_Effect * self );
-
-static PyObject *Effect_oldsetType( void );
-static PyObject *Effect_oldsetStype( BPy_Effect * self, PyObject * args );
-static PyObject *Effect_oldsetFlag( BPy_Effect * self, PyObject * args );
-static PyObject *Effect_oldsetSta( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetEnd( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetLifetime( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetNormfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetObfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetRandfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetTexfac( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetRandlife( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetNabla( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetVectsize( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetTotpart( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetTotkey( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetSeed( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetForce( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetMult( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetLife( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetMat( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetChild( BPy_Effect * self, PyObject * a );
-static PyObject *Effect_oldsetDefvec( BPy_Effect * self, PyObject * a );
-
-/*****************************************************************************/
-/* Python Effect_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *Effect_repr( void );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Particle.__doc__ */
-/*****************************************************************************/
-static char M_Particle_doc[] = "The Blender Effect module\n\n\
-This module provides access to **Object Data** in Blender.\n\
-Functions :\n\
- New(name) : creates a new part object and adds it to the given mesh object \n\
- Get(name) : retreives a particle with the given name (mandatory)\n\
- get(name) : same as Get. Kept for compatibility reasons.\n";
-static char M_Effect_New_doc[] = "New(name) : creates a new part object and adds it to the given mesh object\n";
-static char M_Effect_Get_doc[] = "xxx";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Particle module: */
-/*****************************************************************************/
-static struct PyMethodDef M_Particle_methods[] = {
- {"New", ( PyCFunction ) M_Effect_New, METH_VARARGS, M_Effect_New_doc},
- {"Get", M_Effect_Get, METH_VARARGS, M_Effect_Get_doc},
- {"get", M_Effect_Get, METH_VARARGS, M_Effect_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Effect methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Effect_methods[] = {
- {"getType", ( PyCFunction ) Effect_getType,
- METH_NOARGS, "() - Return Effect type"},
- {"setType", ( PyCFunction ) Effect_oldsetType,
- METH_VARARGS, "() - Set Effect type"},
- {"getStype", ( PyCFunction ) Effect_getStype,
- METH_NOARGS, "() - Return Effect stype"},
- {"setStype", ( PyCFunction ) Effect_oldsetStype,
- METH_VARARGS, "() - Set Effect stype"},
- {"getFlag", ( PyCFunction ) Effect_getFlag,
- METH_NOARGS, "() - Return Effect flag"},
- {"setFlag", ( PyCFunction ) Effect_oldsetFlag,
- METH_VARARGS, "() - Set Effect flag"},
- {"getStartTime", ( PyCFunction ) Effect_getSta,
- METH_NOARGS, "()-Return particle start time"},
- {"setStartTime", ( PyCFunction ) Effect_oldsetSta, METH_VARARGS,
- "()- Sets particle start time"},
- {"getEndTime", ( PyCFunction ) Effect_getEnd,
- METH_NOARGS, "()-Return particle end time"},
- {"setEndTime", ( PyCFunction ) Effect_oldsetEnd, METH_VARARGS,
- "()- Sets particle end time"},
- {"getLifetime", ( PyCFunction ) Effect_getLifetime,
- METH_NOARGS, "()-Return particle life time"},
- {"setLifetime", ( PyCFunction ) Effect_oldsetLifetime, METH_VARARGS,
- "()- Sets particle life time "},
- {"getNormfac", ( PyCFunction ) Effect_getNormfac,
- METH_NOARGS, "()-Return particle life time"},
- {"setNormfac", ( PyCFunction ) Effect_oldsetNormfac, METH_VARARGS,
- "()- Sets particle life time "},
- {"getObfac", ( PyCFunction ) Effect_getObfac,
- METH_NOARGS, "()-Return particle life time"},
- {"setObfac", ( PyCFunction ) Effect_oldsetObfac, METH_VARARGS,
- "()- Sets particle life time "},
- {"getRandfac", ( PyCFunction ) Effect_getRandfac,
- METH_NOARGS, "()-Return particle life time"},
- {"setRandfac", ( PyCFunction ) Effect_oldsetRandfac, METH_VARARGS,
- "()- Sets particle life time "},
- {"getTexfac", ( PyCFunction ) Effect_getTexfac,
- METH_NOARGS, "()-Return particle life time"},
- {"setTexfac", ( PyCFunction ) Effect_oldsetTexfac, METH_VARARGS,
- "()- Sets particle life time "},
- {"getRandlife", ( PyCFunction ) Effect_getRandlife,
- METH_NOARGS, "()-Return particle life time"},
- {"setRandlife", ( PyCFunction ) Effect_oldsetRandlife, METH_VARARGS,
- "()- Sets particle life time "},
- {"getNabla", ( PyCFunction ) Effect_getNabla,
- METH_NOARGS, "()-Return particle life time"},
- {"setNabla", ( PyCFunction ) Effect_oldsetNabla, METH_VARARGS,
- "()- Sets particle life time "},
- {"getVectsize", ( PyCFunction ) Effect_getVectsize,
- METH_NOARGS, "()-Return particle life time"},
- {"setVectsize", ( PyCFunction ) Effect_oldsetVectsize, METH_VARARGS,
- "()- Sets particle life time "},
- {"getTotpart", ( PyCFunction ) Effect_getTotpart,
- METH_NOARGS, "()-Return particle life time"},
- {"setTotpart", ( PyCFunction ) Effect_oldsetTotpart, METH_VARARGS,
- "()- Sets particle life time "},
- {"getTotkey", ( PyCFunction ) Effect_getTotkey,
- METH_NOARGS, "()-Return the number of key positions."},
- {"setTotkey", ( PyCFunction ) Effect_oldsetTotkey, METH_VARARGS,
- "()-Set the number of key positions. "},
- {"getSeed", ( PyCFunction ) Effect_getSeed,
- METH_NOARGS, "()-Return particle life time"},
- {"setSeed", ( PyCFunction ) Effect_oldsetSeed, METH_VARARGS,
- "()- Sets particle life time "},
- {"getForce", ( PyCFunction ) Effect_getForce,
- METH_NOARGS, "()-Return particle life time"},
- {"setForce", ( PyCFunction ) Effect_oldsetForce, METH_VARARGS,
- "()- Sets particle life time "},
- {"getMult", ( PyCFunction ) Effect_getMult,
- METH_NOARGS, "()-Return particle life time"},
- {"setMult", ( PyCFunction ) Effect_oldsetMult, METH_VARARGS,
- "()- Sets particle life time "},
- {"getLife", ( PyCFunction ) Effect_getLife,
- METH_NOARGS, "()-Return particle life time"},
- {"setLife", ( PyCFunction ) Effect_oldsetLife, METH_VARARGS,
- "()- Sets particle life time "},
- {"getMat", ( PyCFunction ) Effect_getChildMat,
- METH_NOARGS, "()-Return particle life time"},
- {"setMat", ( PyCFunction ) Effect_oldsetMat, METH_VARARGS,
- "()- Sets particle life time "},
- {"getChild", ( PyCFunction ) Effect_getChild,
- METH_NOARGS, "()-Return particle life time"},
- {"setChild", ( PyCFunction ) Effect_oldsetChild, METH_VARARGS,
- "()- Sets particle life time "},
- {"getDefvec", ( PyCFunction ) Effect_getDefvec,
- METH_NOARGS, "()-Return particle life time"},
- {"setDefvec", ( PyCFunction ) Effect_oldsetDefvec, METH_VARARGS,
- "()- Sets particle life time "},
- {"getParticlesLoc", ( PyCFunction ) Effect_getParticlesLoc, METH_NOARGS,
- "()- Sets particle life time "},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Effect attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Effect_getseters[] = {
- {"flag",
- (getter)Effect_getFlag, (setter)Effect_setFlag,
- "The particle flag bitfield",
- NULL},
- {"stype",
- (getter)Effect_getStype, (setter)Effect_setStype,
- "The particle stype bitfield",
- NULL},
- {"disp",
- (getter)Effect_getDisp, (setter)Effect_setDisp,
- "The particle display value",
- NULL},
- {"staticStep",
- (getter)Effect_getStaticStep, (setter)Effect_setStaticStep,
- "The particle static step value",
- NULL},
- {"type",
- (getter)Effect_getType, (setter)Effect_setType,
- "The effect's type (deprecated)",
- NULL},
- {"child",
- (getter)Effect_getChild, (setter)Effect_setChild,
- "The number of children of a particle that multiply itself",
- NULL},
- {"childMat",
- (getter)Effect_getChildMat, (setter)Effect_setChildMat,
- "Specify the material used for the particles",
- NULL},
- {"damping",
- (getter)Effect_getDamping, (setter)Effect_setDamping,
- "The damping factor",
- NULL},
- {"defvec",
- (getter)Effect_getDefvec, (setter)Effect_setDefvec,
- "The axes of a force, determined by the texture",
- NULL},
- {"dispMat",
- (getter)Effect_getDispMat, (setter)Effect_setDispMat,
- "The material used for the particles",
- NULL},
- {"emissionTex",
- (getter)Effect_getEmissionTex, (setter)Effect_setEmissionTex,
- "The texture used for texture emission",
- NULL},
- {"end",
- (getter)Effect_getEnd, (setter)Effect_setEnd,
- "The endframe for the effect",
- NULL},
- {"force",
- (getter)Effect_getForce, (setter)Effect_setForce,
- "The axes of a continues force",
- NULL},
- {"forceTex",
- (getter)Effect_getForceTex, (setter)Effect_setForceTex,
- "The texture used for force",
- NULL},
- {"jitter",
- (getter)Effect_getJitter, (setter)Effect_setJitter,
- "Jitter table distribution: maximum particles per face",
- NULL},
- {"life",
- (getter)Effect_getLife, (setter)Effect_setLife,
- "The life span of the next generation of particles",
- NULL},
- {"lifetime",
- (getter)Effect_getLifetime, (setter)Effect_setLifetime,
- "The life span of the particles",
- NULL},
- {"mult",
- (getter)Effect_getMult, (setter)Effect_setMult,
- "The probabilities that a \"dying\" particle spawns a new one",
- NULL},
- {"nabla",
- (getter)Effect_getNabla, (setter)Effect_setNabla,
- "The dimension of the area for gradient calculation",
- NULL},
- {"normfac",
- (getter)Effect_getNormfac, (setter)Effect_setNormfac,
- "Particle's starting speed (from the mesh)",
- NULL},
- {"obfac",
- (getter)Effect_getObfac, (setter)Effect_setObfac,
- "Particle's starting speed (from the object)",
- NULL},
- {"randfac",
- (getter)Effect_getRandfac, (setter)Effect_setRandfac,
- "The random variation for the starting speed",
- NULL},
- {"randlife",
- (getter)Effect_getRandlife, (setter)Effect_setRandlife,
- "The random variation for a particle's life",
- NULL},
- {"seed",
- (getter)Effect_getSeed, (setter)Effect_setSeed,
- "The seed for random variations",
- NULL},
- {"speedType",
- (getter)Effect_getSpeedType, (setter)Effect_setSpeedType,
- "Controls which texture property affects particle speeds",
- NULL},
- {"speedVGroup",
- (getter)Effect_getSpeedVertGroup, (setter)Effect_setSpeedVertGroup,
- "Vertex group for speed control",
- NULL},
- {"sta",
- (getter)Effect_getSta, (setter)Effect_setSta,
- "The startframe for the effect",
- NULL},
- {"texfac",
- (getter)Effect_getTexfac, (setter)Effect_setTexfac,
- "Particle's starting speed (from the texture)",
- NULL},
- {"totpart",
- (getter)Effect_getTotpart, (setter)Effect_setTotpart,
- "The total number of particles",
- NULL},
- {"totkey",
- (getter)Effect_getTotkey, (setter)Effect_setTotkey,
- "The total number of key positions",
- NULL},
- {"vectsize",
- (getter)Effect_getVectsize, (setter)Effect_setVectsize,
- "The speed for particle's rotation direction",
- NULL},
- {"vGroup",
- (getter)Effect_getVertGroup, (setter)Effect_setVertGroup,
- "Vertex group for emitted particles",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Effect_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Effect_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Effect", /* char *tp_name; */
- sizeof( BPy_Effect ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) Effect_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Effect_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Effect_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Effect module: */
-/*****************************************************************************/
-
-struct PyMethodDef M_Effect_methods[] = {
- {"New", ( PyCFunction ) M_Effect_New, METH_VARARGS, NULL},
- {"Get", M_Effect_Get, METH_VARARGS, NULL},
- {"get", M_Effect_Get, METH_VARARGS, NULL},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Function: M_Effect_New */
-/* Python equivalent: Blender.Effect.New */
-/*****************************************************************************/
-PyObject *M_Effect_New( PyObject * self, PyObject * args )
-{
- printf("warning, static particles api removed\n");
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/*****************************************************************************/
-/* Function: M_Effect_Get */
-/* Python equivalent: Blender.Effect.Get */
-/*****************************************************************************/
-PyObject *M_Effect_Get( PyObject * self, PyObject * args )
-{
- printf("warning, static particles api removed\n");
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/* create the Blender.Effect.Flags constant dict */
-
-static PyObject *Effect_FlagsDict( void )
-{
- PyObject *Flags = PyConstant_New( );
-
- if( Flags ) {
- //BPy_constant *c = ( BPy_constant * ) Flags;
- /* removed */
- }
- return Flags;
-}
-
-static PyObject *Effect_SpeedTypeDict( void )
-{
- PyObject *Type = PyConstant_New( );
-
- if( Type ) {
- BPy_constant *c = ( BPy_constant * ) Type;
-
- PyConstant_Insert( c, "INTENSITY",
- PyInt_FromLong( EXPP_EFFECT_SPEEDTYPE_INTENSITY ) );
- PyConstant_Insert( c, "RGB",
- PyInt_FromLong( EXPP_EFFECT_SPEEDTYPE_RGB ) );
- PyConstant_Insert( c, "GRADIENT",
- PyInt_FromLong( EXPP_EFFECT_SPEEDTYPE_GRADIENT ) );
- }
- return Type;
-}
-
-/*****************************************************************************/
-/* Function: Effect_Init */
-/*****************************************************************************/
-
-PyObject *Effect_Init( void )
-{
- PyObject *submodule, *dict;
- PyObject *particle;
- PyObject *Flags;
- PyObject *Types;
-
- if( PyType_Ready( &Effect_Type ) < 0)
- return NULL;
-
- Flags = Effect_FlagsDict( );
- Types = Effect_SpeedTypeDict( );
-
- submodule = Py_InitModule3( "Blender.Effect", M_Effect_methods, 0 );
- if( Flags )
- PyModule_AddObject( submodule, "Flags", Flags );
- if( Types )
- PyModule_AddObject( submodule, "SpeedTypes", Types );
-
- particle = Py_InitModule3( "Blender.Particle", M_Particle_methods,
- M_Particle_doc );
-
- dict = PyModule_GetDict( submodule );
-
- PyDict_SetItemString( dict, "Particle", particle );
- return ( submodule );
-}
-
-/*****************************************************************************/
-/* Python BPy_Effect methods: */
-/*****************************************************************************/
-
-static PyObject *Effect_getType( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long ) self->effect->type );
-}
-
-/* does nothing since there is only one type of effect */
-
-static int Effect_setType( void )
-{
- return 0;
-}
-
-static int Effect_setStype( BPy_Effect * self, PyObject * args )
-{
- short param;
- if( !PyArg_Parse( args, "h", &param ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int as argument" );
- self->effect->stype = param;
- return 0;
-}
-
-static PyObject *Effect_getStype( BPy_Effect * self )
-{
- return PyInt_FromLong( (long)( self->effect->stype ) );
-}
-
-static PyObject *Effect_getFlag( BPy_Effect * self )
-{
- return PyInt_FromLong( (long)( self->effect->flag ^ PAF_OFACE ) );
-}
-
-static int Effect_setFlag( BPy_Effect * self, PyObject * args )
-{
- short param;
- static short bitmask = PAF_BSPLINE | PAF_STATIC | PAF_FACE | PAF_ANIMATED |
- PAF_UNBORN | PAF_OFACE | PAF_SHOWE | PAF_TRAND | PAF_EDISTR | PAF_DIED;
-
- if( !PyArg_Parse( args, "h", &param ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int as argument" );
-
- /* we don't allow users to change the select bit at this time */
- param &= ~EFF_SELECT;
-
- if ( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- /* the sense of "Verts" is inverted (clear is enabled) */
- param ^= PAF_OFACE;
-
- /* leave select bit alone, and add in the others */
- self->effect->flag &= EFF_SELECT;
- self->effect->flag |= param;
- return 0;
-}
-
-static PyObject *Effect_getSta( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->sta );
-}
-
-static int Effect_setSta( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->sta,
- EXPP_EFFECT_STA_MIN, MAXFRAMEF );
-}
-
-static PyObject *Effect_getEnd( BPy_Effect * self )
-{
- return PyFloat_FromDouble( ((PartEff *) self->effect)->end );
-}
-
-static int Effect_setEnd( BPy_Effect * self, PyObject * args )
-{
- float val;
-
- if( !PyArg_Parse( args, "f", &val ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected float argument" );
-
- self->effect->end = EXPP_ClampFloat( val,
- EXPP_EFFECT_END_MIN, MAXFRAMEF );
- return 0;
-}
-
-static PyObject *Effect_getLifetime( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->lifetime );
-}
-
-static int Effect_setLifetime( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->lifetime,
- EXPP_EFFECT_LIFETIME_MIN, MAXFRAMEF );
-}
-
-static PyObject *Effect_getNormfac( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->normfac );
-}
-
-static int Effect_setNormfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->normfac,
- EXPP_EFFECT_NORMFAC_MIN, EXPP_EFFECT_NORMFAC_MAX );
-}
-
-static PyObject *Effect_getObfac( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->obfac );
-}
-
-static int Effect_setObfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->obfac,
- EXPP_EFFECT_OBFAC_MIN, EXPP_EFFECT_OBFAC_MAX );
-}
-
-static PyObject *Effect_getRandfac( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->randfac );
-}
-
-static int Effect_setRandfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->randfac,
- EXPP_EFFECT_RANDFAC_MIN, EXPP_EFFECT_RANDFAC_MAX );
-}
-
-static PyObject *Effect_getTexfac( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->texfac );
-}
-
-static int Effect_setTexfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->texfac,
- EXPP_EFFECT_TEXFAC_MIN, EXPP_EFFECT_TEXFAC_MAX );
-}
-
-static PyObject *Effect_getRandlife( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->randlife );
-}
-
-static int Effect_setRandlife( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->randlife,
- EXPP_EFFECT_RANDLIFE_MIN, EXPP_EFFECT_RANDLIFE_MAX );
-}
-
-static PyObject *Effect_getNabla( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->nabla );
-}
-
-static int Effect_setNabla( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->nabla,
- EXPP_EFFECT_NABLA_MIN, EXPP_EFFECT_NABLA_MAX );
-}
-
-static PyObject *Effect_getVectsize( BPy_Effect * self )
-{
- return PyFloat_FromDouble( self->effect->vectsize );
-}
-
-static int Effect_setVectsize( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->vectsize,
- EXPP_EFFECT_VECTSIZE_MIN, EXPP_EFFECT_VECTSIZE_MAX );
-}
-
-static PyObject *Effect_getTotpart( BPy_Effect * self )
-{
- return PyInt_FromLong( self->effect->totpart );
-}
-
-static int Effect_setTotpart( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->totpart,
- (int)EXPP_EFFECT_TOTPART_MIN, (int)EXPP_EFFECT_TOTPART_MAX, 'i' );
-}
-
-static PyObject *Effect_getTotkey( BPy_Effect * self )
-{
- return PyInt_FromLong( self->effect->totkey );
-}
-
-static int Effect_setTotkey( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->totkey,
- EXPP_EFFECT_TOTKEY_MIN, EXPP_EFFECT_TOTKEY_MAX, 'i' );
-}
-
-static PyObject *Effect_getSeed( BPy_Effect * self )
-{
- return PyInt_FromLong( self->effect->seed );
-}
-
-static int Effect_setSeed( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->seed,
- EXPP_EFFECT_SEED_MIN, EXPP_EFFECT_SEED_MAX, 'i' );
-}
-
-static PyObject *Effect_getForce( BPy_Effect * self )
-{
- return Py_BuildValue( "(f,f,f)", self->effect->force[0],
- self->effect->force[1], self->effect->force[2] );
-}
-
-static int Effect_setForce( BPy_Effect * self, PyObject * args )
-{
- float val[3];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "fff", &val[0], &val[1], &val[2] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of three float arguments" );
- for( i = 0; i < 3; ++i )
- self->effect->force[i] = EXPP_ClampFloat( val[i],
- EXPP_EFFECT_FORCE_MIN, EXPP_EFFECT_FORCE_MAX );
- return 0;
-}
-
-static PyObject *Effect_getMult( BPy_Effect * self )
-{
- return Py_BuildValue( "(f,f,f,f)", self->effect->mult[0],
- self->effect->mult[1], self->effect->mult[2],
- self->effect->mult[3] );
-}
-
-static int Effect_setMult( BPy_Effect * self, PyObject * args )
-{
- float val[4];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "ffff", &val[0], &val[1], &val[2], &val[3] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of four float arguments" );
- for( i = 0; i < 4; ++i )
- self->effect->mult[i] = EXPP_ClampFloat( val[i],
- EXPP_EFFECT_MULT_MIN, EXPP_EFFECT_MULT_MAX );
- return 0;
-}
-
-static PyObject *Effect_getLife( BPy_Effect * self )
-{
- return Py_BuildValue( "(f,f,f,f)", self->effect->life[0],
- self->effect->life[1], self->effect->life[2],
- self->effect->life[3] );
-}
-
-static int Effect_setLife( BPy_Effect * self, PyObject * args )
-{
- float val[4];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "ffff", &val[0], &val[1], &val[2], &val[3] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of four float arguments" );
- for( i = 0; i < 4; ++i )
- self->effect->life[i] = EXPP_ClampFloat( val[i],
- EXPP_EFFECT_LIFE_MIN, MAXFRAMEF );
- return 0;
-}
-
-static PyObject *Effect_getChild( BPy_Effect * self )
-{
- return Py_BuildValue( "(h,h,h,h)", self->effect->child[0],
- self->effect->child[1], self->effect->child[2],
- self->effect->child[3] );
-}
-
-
-static int Effect_setChild( BPy_Effect * self, PyObject * args )
-{
- short val[4];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "hhhh", &val[0], &val[1], &val[2], &val[3] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of four int argument" );
- for( i = 0; i < 4; ++i )
- self->effect->child[i] = (short)EXPP_ClampInt( val[i],
- EXPP_EFFECT_CHILD_MIN, EXPP_EFFECT_CHILD_MAX );
- return 0;
-}
-
-static PyObject *Effect_getChildMat( BPy_Effect * self )
-{
- return Py_BuildValue( "(h,h,h,h)", self->effect->mat[0],
- self->effect->mat[1], self->effect->mat[2],
- self->effect->mat[3] );
-}
-
-static int Effect_setChildMat( BPy_Effect * self, PyObject * args )
-{
- short val[4];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "hhhh", &val[0], &val[1], &val[2], &val[3] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of four int argument" );
- for( i = 0; i < 4; ++i )
- self->effect->mat[i] = (short)EXPP_ClampInt( val[i],
- EXPP_EFFECT_CHILDMAT_MIN, EXPP_EFFECT_CHILDMAT_MAX );
- return 0;
-}
-
-static PyObject *Effect_getDefvec( BPy_Effect * self )
-{
- return Py_BuildValue( "(f,f,f)", self->effect->defvec[0],
- self->effect->defvec[1], self->effect->defvec[2] );
-}
-
-static int Effect_setDefvec( BPy_Effect * self, PyObject * args )
-{
- float val[3];
- int i;
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GetItem( args, 0 );
-
- if( !PyArg_ParseTuple( args, "fff", &val[0], &val[1], &val[2] ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a tuple of three float arguments" );
-
- for( i = 0; i < 3; ++i )
- self->effect->defvec[i] = EXPP_ClampFloat( val[i],
- EXPP_EFFECT_DEFVEC_MIN, EXPP_EFFECT_DEFVEC_MAX );
- return 0;
-}
-
-static PyObject *Effect_getJitter( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->userjit );
-}
-
-static int Effect_setJitter( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->userjit,
- EXPP_EFFECT_JITTER_MIN, EXPP_EFFECT_JITTER_MAX, 'h' );
-}
-
-static PyObject *Effect_getDispMat( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->omat );
-}
-
-static int Effect_setDispMat( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->omat,
- EXPP_EFFECT_DISPMAT_MIN, EXPP_EFFECT_DISPMAT_MAX, 'h' );
-}
-
-static PyObject *Effect_getEmissionTex( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->timetex );
-}
-
-static int Effect_setEmissionTex( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->timetex,
- EXPP_EFFECT_TIMETEX_MIN, EXPP_EFFECT_TIMETEX_MAX, 'h' );
-}
-
-static PyObject *Effect_getForceTex( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->speedtex );
-}
-
-static int Effect_setForceTex( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueClamped( args, &self->effect->speedtex,
- EXPP_EFFECT_SPEEDTEX_MIN, EXPP_EFFECT_SPEEDTEX_MAX, 'h' );
-}
-
-static PyObject *Effect_getSpeedType( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->texmap );
-}
-
-static int Effect_setSpeedType( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueRange( args, &self->effect->texmap,
- EXPP_EFFECT_SPEEDTYPE_INTENSITY, EXPP_EFFECT_SPEEDTYPE_GRADIENT,
- 'h' );
-}
-
-static PyObject *Effect_getDamping( BPy_Effect * self )
-{
- return PyFloat_FromDouble( ( double )self->effect->damp );
-}
-
-static int Effect_setDamping( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setFloatClamped( args, &self->effect->damp,
- EXPP_EFFECT_DAMP_MIN, EXPP_EFFECT_DAMP_MAX );
-}
-
-static PyObject *Effect_getVertGroup( BPy_Effect * self )
-{
- return PyString_FromString( self->effect->vgroupname );
-}
-
-
-static int Effect_setVertGroup( BPy_Effect * self, PyObject * value )
-{
- char *name;
- bDeformGroup *dg;
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- PyOS_snprintf( self->effect->vgroupname,
- sizeof( self->effect->vgroupname )-1, "%s", name );
-
- dg = get_named_vertexgroup( self->object, self->effect->vgroupname );
- if( dg )
- self->effect->vertgroup = (short)get_defgroup_num( self->object, dg )+1;
- else
- self->effect->vertgroup = 0;
-
- return 0;
-}
-
-static PyObject *Effect_getSpeedVertGroup( BPy_Effect * self )
-{
- return PyString_FromString( self->effect->vgroupname_v );
-}
-
-static int Effect_setSpeedVertGroup( BPy_Effect * self, PyObject * value )
-{
- char *name;
- bDeformGroup *dg;
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- PyOS_snprintf( self->effect->vgroupname_v,
- sizeof( self->effect->vgroupname_v )-1, "%s", name );
-
- dg = get_named_vertexgroup( self->object, self->effect->vgroupname_v );
- if( dg )
- self->effect->vertgroup_v = (short)get_defgroup_num( self->object, dg )+1;
- else
- self->effect->vertgroup_v = 0;
-
- return 0;
-}
-
-/*****************************************************************************/
-/* attribute: getDisp */
-/* Description: the current value of the display number button */
-/* Data: self effect */
-/* Return: integer value between 0 and 100 */
-/*****************************************************************************/
-static PyObject *Effect_getDisp( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->disp );
-}
-
-static int Effect_setDisp( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setIValueRange( args, &self->effect->disp,
- EXPP_EFFECT_DISP_MIN, EXPP_EFFECT_DISP_MAX, 'h' );
-}
-
-/*****************************************************************************/
-/* attribute: getStep */
-/* Description: the current value of the Step number button */
-/* Data: self effect */
-/* Return: integer value between 1 and 100 */
-/*****************************************************************************/
-static PyObject *Effect_getStaticStep( BPy_Effect * self )
-{
- return PyInt_FromLong( ( long )self->effect->staticstep );
-}
-
-static int Effect_setStaticStep( BPy_Effect * self , PyObject * args )
-{
- return EXPP_setIValueRange( args, &self->effect->staticstep,
- EXPP_EFFECT_STATICSTEP_MIN, EXPP_EFFECT_STATICSTEP_MAX,
- 'h' );
-}
-
-/*****************************************************************************/
-/* Method: getParticlesLoc */
-/* Python equivalent: effect.getParticlesLoc */
-/* Description: Get the current location of each particle */
-/* and return a list of 3D vectors */
-/* or a list of ists of two 3D vectors */
-/* if effect.vect has any sense */
-/* Data: notihng get the current time from G.scene */
-/* Return: One python list of 3D vector */
-/*****************************************************************************/
-static PyObject *Effect_getParticlesLoc( BPy_Effect * self )
-{
- return PyList_New( 0 );
-}
-
-/*****************************************************************************/
-/* Function: Effect_repr */
-/* Description: This is a callback function for the BPy_Effect type. It */
-/* builds a meaninful string to represent effcte objects. */
-/*****************************************************************************/
-
-static PyObject *Effect_repr( void )
-{
- return PyString_FromString( "Particle" );
-}
-
-/*****************************************************************************/
-/* These are needed by Object.c */
-/*****************************************************************************/
-PyObject *EffectCreatePyObject( Effect * effect, Object *ob )
-{
- BPy_Effect *blen_object;
-
- blen_object =
- ( BPy_Effect * ) PyObject_NEW( BPy_Effect, &Effect_Type );
-
- if( blen_object )
- blen_object->effect = (PartEff *)effect;
- blen_object->object = ob;
-
- return ( PyObject * ) blen_object;
-}
-
-int EffectCheckPyObject( PyObject * py_obj )
-{
- return ( py_obj->ob_type == &Effect_Type );
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *Effect_oldsetChild( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setChild );
-}
-
-static PyObject *Effect_oldsetDefvec( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setDefvec );
-}
-
-static PyObject *Effect_oldsetForce( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setForce );
-}
-
-static PyObject *Effect_oldsetMat( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setChildMat );
-}
-
-static PyObject *Effect_oldsetEnd( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setEnd );
-}
-
-static PyObject *Effect_oldsetLife( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setLife );
-}
-
-static PyObject *Effect_oldsetLifetime( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setLifetime );
-}
-
-static PyObject *Effect_oldsetMult( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Effect_setMult );
-}
-
-static PyObject *Effect_oldsetNabla( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setNabla );
-}
-
-static PyObject *Effect_oldsetNormfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setNormfac );
-}
-
-static PyObject *Effect_oldsetObfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setObfac );
-}
-
-static PyObject *Effect_oldsetRandfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setRandfac );
-}
-
-static PyObject *Effect_oldsetRandlife( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setRandlife );
-}
-
-static PyObject *Effect_oldsetSeed( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setSeed );
-}
-
-static PyObject *Effect_oldsetSta( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setSta );
-}
-
-static PyObject *Effect_oldsetTexfac( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setTexfac );
-}
-
-static PyObject *Effect_oldsetTotkey( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setTotkey );
-}
-
-static PyObject *Effect_oldsetTotpart( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setTotpart );
-}
-
-static PyObject *Effect_oldsetVectsize( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setVectsize );
-}
-
-static PyObject *Effect_oldsetFlag( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setFlag );
-}
-
-static PyObject *Effect_oldsetStype( BPy_Effect * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Effect_setStype );
-}
-
-static PyObject *Effect_oldsetType( void )
-{
- return EXPP_incr_ret( Py_None );
-}
diff --git a/source/blender/python/api2_2x/Effect.h b/source/blender/python/api2_2x/Effect.h
deleted file mode 100644
index 8e6a67fe460..00000000000
--- a/source/blender/python/api2_2x/Effect.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_EFFECT_H
-#define EXPP_EFFECT_H
-
-#include <Python.h>
-#include "DNA_effect_types.h"
-#include "DNA_object_types.h"
-
-extern PyTypeObject Effect_Type;
-
-#define BPy_Effect_Check(v) ((v)->ob_type==&Effect_Type)
-
-/* Python BPy_Effect structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- PartEff * effect;
- Object * object;
-} BPy_Effect;
-
-/*****************************************************************************/
-/* Python Effect_Type helpder function prototypes: */
-/*****************************************************************************/
-PyObject *Effect_Init( void );
-int EffectCheckPyObject( PyObject * py_obj );
-PyObject *EffectCreatePyObject( Effect * eff, Object * ob );
-
-#endif /* EXPP_EFFECT_H */
diff --git a/source/blender/python/api2_2x/Font.c b/source/blender/python/api2_2x/Font.c
deleted file mode 100644
index a8c7435f68b..00000000000
--- a/source/blender/python/api2_2x/Font.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Font.h" /*This must come first*/
-
-#include "DNA_packedFile_types.h"
-#include "BKE_packedFile.h"
-#include "BKE_global.h"
-#include "BKE_library.h" /* for rename_id() */
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "BKE_main.h" /* so we can access G.main->vfont.first */
-#include "DNA_space_types.h" /* for FILE_MAXDIR only */
-
-extern PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * args );
-
-/*--------------------Python API function prototypes for the Font module----*/
-static PyObject *M_Font_Load( PyObject * self, PyObject * value );
-static PyObject *M_Font_Get( PyObject * self, PyObject * args );
-
-/*------------------------Python API Doc strings for the Font module--------*/
-char M_Font_doc[] = "The Blender Font module\n\n\
-This module provides control over **Font Data** objects in Blender.\n\n\
-Example::\n\n\
- from Blender import Text3d.Font\n\
- l = Text3d.Font.Load('/usr/share/fonts/verdata.ttf')\n";
-char M_Font_Get_doc[] = "(name) - return an existing font called 'name'\
-when no argument is given it returns a list of blenders fonts.";
-char M_Font_Load_doc[] =
- "(filename) - return font from file filename as Font Object, \
-returns None if not found.\n";
-
-/*----- Python method structure definition for Blender.Text3d.Font module---*/
-struct PyMethodDef M_Font_methods[] = {
- {"Get", ( PyCFunction ) M_Font_Get, METH_VARARGS, M_Font_Get_doc},
- {"Load", ( PyCFunction ) M_Font_Load, METH_O, M_Font_Load_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*--------------- Python BPy_Font methods declarations:-------------------*/
-static PyObject *Font_pack( BPy_Font * self );
-static PyObject *Font_unpack( BPy_Font * self, PyObject * args );
-
-/*--------------- Python BPy_Font methods table:--------------------------*/
-static PyMethodDef BPy_Font_methods[] = {
- {"pack", ( PyCFunction ) Font_pack, METH_NOARGS,
- "() - pack this Font"},
- {"unpack", ( PyCFunction ) Font_unpack, METH_O,
- "(mode) - unpack this packed font"},
- {NULL, NULL, 0, NULL}
-};
-
-/*--------------- Python TypeFont callback function prototypes----------*/
-static int Font_compare( BPy_Font * a1, BPy_Font * a2 );
-static PyObject *Font_repr( BPy_Font * font );
-
-
-/*--------------- Python Font Module methods------------------------*/
-
-/*--------------- Blender.Text3d.Font.Get()-----------------------*/
-static PyObject *M_Font_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- VFont *vfont_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- vfont_iter = G.main->vfont.first;
-
- if( name ) { /* (name) - Search font by name */
-
- BPy_Font *wanted_vfont = NULL;
-
- while(vfont_iter) {
- if( strcmp( name, vfont_iter->id.name + 2 ) == 0 ) {
- wanted_vfont =
- ( BPy_Font * )
- Font_CreatePyObject( vfont_iter );
- break;
- }
- vfont_iter = vfont_iter->id.next;
- }
-
- if( wanted_vfont == NULL ) { /* Requested font doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Font \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_vfont;
- }
-
- else { /* () - return a list of all fonts in the scene */
- int index = 0;
- PyObject *vfontlist, *pyobj;
-
- vfontlist = PyList_New( BLI_countlist( &( G.main->vfont ) ) );
-
- if( vfontlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create font list" ) );
-
- while( vfont_iter ) {
- pyobj = Font_CreatePyObject( vfont_iter );
-
- if( !pyobj ) {
- Py_DECREF(vfontlist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Object" ) );
- }
- PyList_SET_ITEM( vfontlist, index, pyobj );
-
- vfont_iter = vfont_iter->id.next;
- index++;
- }
-
- return vfontlist;
- }
-}
-
-
-/*--------------- Blender.Text3d.Font.New()-----------------------*/
-PyObject *M_Font_Load( PyObject * self, PyObject * value )
-{
- char *filename_str = PyString_AsString(value);
- BPy_Font *py_font = NULL; /* for Font Data object wrapper in Python */
-
- if( !value )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string or empty argument" ) );
-
- /*create python font*/
- if( !S_ISDIR(BLI_exist(filename_str)) ) {
- py_font= (BPy_Font *) M_Text3d_LoadFont (self, value);
- }
- else
- Py_RETURN_NONE;
- return ( PyObject * ) py_font;
-}
-
-/*--------------- Python BPy_Font getsetattr funcs ---------------------*/
-
-
-/*--------------- BPy_Font.filename-------------------------------------*/
-static PyObject *Font_getFilename( BPy_Font * self )
-{
- return PyString_FromString( self->font->name );
-}
-
-static int Font_setFilename( BPy_Font * self, PyObject * value )
-{
- char *name = NULL;
-
- /* max len is FILE_MAXDIR = 160 chars like done in DNA_image_types.h */
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- PyOS_snprintf( self->font->name, FILE_MAXDIR * sizeof( char ), "%s",
- name );
-
- return 0;
-}
-
-/*--------------- BPy_Font.pack()---------------------------------*/
-static PyObject *Font_pack( BPy_Font * self )
-{
- if( !self->font->packedfile )
- self->font->packedfile = newPackedFile(self->font->name);
- Py_RETURN_NONE;
-}
-
-/*--------------- BPy_Font.unpack()---------------------------------*/
-static PyObject *Font_unpack( BPy_Font * self, PyObject * value )
-{
- int mode= PyInt_AsLong(value);
- VFont *font= self->font;
-
- if( mode==-1 )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected int argument from Blender.UnpackModes" ) );
-
- if (font->packedfile)
- if (unpackVFont(font, mode) == RET_ERROR)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error unpacking font" );
-
- Py_RETURN_NONE;
-}
-
-/*--------------- BPy_Font.packed---------------------------------*/
-static PyObject *Font_getPacked( BPy_Font * self )
-{
- if (G.fileflags & G_AUTOPACK)
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Font_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"filename",
- (getter)Font_getFilename, (setter)Font_setFilename,
- "Font filepath",
- NULL},
- {"packed",
- (getter)Font_getPacked, (setter)NULL,
- "Packed status",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python TypeFont structure definition: */
-/*****************************************************************************/
-PyTypeObject Font_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Font", /* char *tp_name; */
- sizeof( BPy_Font ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Font_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Font_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Font_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Font_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-
-
-
-/*--------------- Font Module Init-----------------------------*/
-PyObject *Font_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Font_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Text3d.Font",
- M_Font_methods, M_Font_doc );
-
- return ( submodule );
-}
-
-/*--------------- Font module internal callbacks-----------------*/
-/*---------------BPy_Font internal callbacks/methods-------------*/
-
-/*--------------- repr---------------------------------------------*/
-static PyObject *Font_repr( BPy_Font * self )
-{
- if( self->font )
- return PyString_FromFormat( "[Font \"%s\"]",
- self->font->id.name+2 );
- else
- return PyString_FromString( "[Font - no data]" );
-}
-
-/*--------------- compare------------------------------------------*/
-static int Font_compare( BPy_Font * a, BPy_Font * b )
-{
- return ( a->font == b->font ) ? 0 : -1;
-}
-
-/*--------------- Font_CreatePyObject---------------------------------*/
-PyObject *Font_CreatePyObject( struct VFont * font )
-{
- BPy_Font *blen_font;
-
- blen_font = ( BPy_Font * ) PyObject_NEW( BPy_Font, &Font_Type );
-
- blen_font->font = font;
-
- return ( ( PyObject * ) blen_font );
-}
-
-/*--------------- Font_FromPyObject---------------------------------*/
-struct VFont *Font_FromPyObject( PyObject * py_obj )
-{
- BPy_Font *blen_obj;
-
- blen_obj = ( BPy_Font * ) py_obj;
- if( !( ( BPy_Font * ) py_obj )->font ) { /*test to see if linked to text3d*/
- //use python vars
- return NULL;
- } else {
- return ( blen_obj->font );
- }
-}
-
-
-
diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c
deleted file mode 100644
index 89c63870d59..00000000000
--- a/source/blender/python/api2_2x/Geometry.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Geometry.h"
-
-/* - Not needed for now though other geometry functions will probably need them
-#include "BLI_arithb.h"
-#include "BKE_utildefines.h"
-*/
-
-/* Used for PolyFill */
-#include "BKE_displist.h"
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-
-/* needed for EXPP_ReturnPyObjError and EXPP_check_sequence_consistency */
-#include "gen_utils.h"
-
-#include "BKE_utildefines.h"
-#include "BLI_boxpack2d.h"
-#include "BLI_arithb.h"
-
-#define SWAP_FLOAT(a,b,tmp) tmp=a; a=b; b=tmp
-#define eul 0.000001
-
-/*-- forward declarations -- */
-static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq );
-static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args );
-static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args );
-static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args );
-static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args );
-static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * args );
-
-
-/*-------------------------DOC STRINGS ---------------------------*/
-static char M_Geometry_doc[] = "The Blender Geometry module\n\n";
-static char M_Geometry_PolyFill_doc[] = "(veclist_list) - takes a list of polylines (each point a vector) and returns the point indicies for a polyline filled with triangles";
-static char M_Geometry_LineIntersect2D_doc[] = "(lineA_p1, lineA_p2, lineB_p1, lineB_p2) - takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None";
-static char M_Geometry_ClosestPointOnLine_doc[] = "(pt, line_p1, line_p2) - takes a point and a line and returns a (Vector, Bool) for the point on the line, and the bool so you can know if the point was between the 2 points";
-static char M_Geometry_PointInTriangle2D_doc[] = "(pt, tri_p1, tri_p2, tri_p3) - takes 4 vectors, one is the point and the next 3 define the triangle, only the x and y are used from the vectors";
-static char M_Geometry_PointInQuad2D_doc[] = "(pt, quad_p1, quad_p2, quad_p3, quad_p4) - takes 5 vectors, one is the point and the next 4 define the quad, only the x and y are used from the vectors";
-static char M_Geometry_BoxPack2D_doc[] = "";
-/*-----------------------METHOD DEFINITIONS ----------------------*/
-struct PyMethodDef M_Geometry_methods[] = {
- {"PolyFill", ( PyCFunction ) M_Geometry_PolyFill, METH_O, M_Geometry_PolyFill_doc},
- {"LineIntersect2D", ( PyCFunction ) M_Geometry_LineIntersect2D, METH_VARARGS, M_Geometry_LineIntersect2D_doc},
- {"ClosestPointOnLine", ( PyCFunction ) M_Geometry_ClosestPointOnLine, METH_VARARGS, M_Geometry_ClosestPointOnLine_doc},
- {"PointInTriangle2D", ( PyCFunction ) M_Geometry_PointInTriangle2D, METH_VARARGS, M_Geometry_PointInTriangle2D_doc},
- {"PointInQuad2D", ( PyCFunction ) M_Geometry_PointInQuad2D, METH_VARARGS, M_Geometry_PointInQuad2D_doc},
- {"BoxPack2D", ( PyCFunction ) M_Geometry_BoxPack2D, METH_O, M_Geometry_BoxPack2D_doc},
- {NULL, NULL, 0, NULL}
-};
-/*----------------------------MODULE INIT-------------------------*/
-PyObject *Geometry_Init(void)
-{
- PyObject *submodule;
-
- submodule = Py_InitModule3("Blender.Geometry",
- M_Geometry_methods, M_Geometry_doc);
- return (submodule);
-}
-
-/*----------------------------------Geometry.PolyFill() -------------------*/
-/* PolyFill function, uses Blenders scanfill to fill multiple poly lines */
-static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq )
-{
- PyObject *tri_list; /*return this list of tri's */
- PyObject *polyLine, *polyVec;
- int i, len_polylines, len_polypoints;
-
- /* display listbase */
- ListBase dispbase={NULL, NULL};
- DispList *dl;
- float *fp; /*pointer to the array of malloced dl->verts to set the points from the vectors */
- int index, *dl_face, totpoints=0;
-
-
- dispbase.first= dispbase.last= NULL;
-
-
- if(!PySequence_Check(polyLineSeq)) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of poly lines" );
- }
-
- len_polylines = PySequence_Size( polyLineSeq );
-
- for( i = 0; i < len_polylines; ++i ) {
- polyLine= PySequence_GetItem( polyLineSeq, i );
- if (!PySequence_Check(polyLine)) {
- freedisplist(&dispbase);
- Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "One or more of the polylines is not a sequence of Mathutils.Vector's" );
- }
-
- len_polypoints= PySequence_Size( polyLine );
- if (len_polypoints>0) { /* dont bother adding edges as polylines */
- if (EXPP_check_sequence_consistency( polyLine, &vector_Type ) != 1) {
- freedisplist(&dispbase);
- Py_DECREF(polyLine);
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "A point in one of the polylines is not a Mathutils.Vector type" );
- }
-
- dl= MEM_callocN(sizeof(DispList), "poly disp");
- BLI_addtail(&dispbase, dl);
- dl->type= DL_INDEX3;
- dl->nr= len_polypoints;
- dl->type= DL_POLY;
- dl->parts= 1; /* no faces, 1 edge loop */
- dl->col= 0; /* no material */
- dl->verts= fp= MEM_callocN( sizeof(float)*3*len_polypoints, "dl verts");
- dl->index= MEM_callocN(sizeof(int)*3*len_polypoints, "dl index");
-
- for( index = 0; index<len_polypoints; ++index, fp+=3) {
- polyVec= PySequence_GetItem( polyLine, index );
-
- fp[0] = ((VectorObject *)polyVec)->vec[0];
- fp[1] = ((VectorObject *)polyVec)->vec[1];
- if( ((VectorObject *)polyVec)->size > 2 )
- fp[2] = ((VectorObject *)polyVec)->vec[2];
- else
- fp[2]= 0.0f; /* if its a 2d vector then set the z to be zero */
-
- totpoints++;
- Py_DECREF(polyVec);
- }
- }
- Py_DECREF(polyLine);
- }
-
- if (totpoints) {
- /* now make the list to return */
- filldisplist(&dispbase, &dispbase);
-
- /* The faces are stored in a new DisplayList
- thats added to the head of the listbase */
- dl= dispbase.first;
-
- tri_list= PyList_New(dl->parts);
- if( !tri_list ) {
- freedisplist(&dispbase);
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Geometry.PolyFill failed to make a new list" );
- }
-
- index= 0;
- dl_face= dl->index;
- while(index < dl->parts) {
- PyList_SetItem(tri_list, index, Py_BuildValue("iii", dl_face[0], dl_face[1], dl_face[2]) );
- dl_face+= 3;
- index++;
- }
- freedisplist(&dispbase);
- } else {
- /* no points, do this so scripts dont barf */
- tri_list= PyList_New(0);
- }
-
- return tri_list;
-}
-
-
-static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args )
-{
- VectorObject *line_a1, *line_a2, *line_b1, *line_b2;
- float a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2];
- if( !PyArg_ParseTuple ( args, "O!O!O!O!",
- &vector_Type, &line_a1,
- &vector_Type, &line_a2,
- &vector_Type, &line_b1,
- &vector_Type, &line_b2)
- )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 4 vector types\n" ) );
-
- a1x= line_a1->vec[0];
- a1y= line_a1->vec[1];
- a2x= line_a2->vec[0];
- a2y= line_a2->vec[1];
-
- b1x= line_b1->vec[0];
- b1y= line_b1->vec[1];
- b2x= line_b2->vec[0];
- b2y= line_b2->vec[1];
-
- if((MIN2(a1x, a2x) > MAX2(b1x, b2x)) ||
- (MAX2(a1x, a2x) < MIN2(b1x, b2x)) ||
- (MIN2(a1y, a2y) > MAX2(b1y, b2y)) ||
- (MAX2(a1y, a2y) < MIN2(b1y, b2y)) ) {
- Py_RETURN_NONE;
- }
- /* Make sure the hoz/vert line comes first. */
- if (fabs(b1x - b2x) < eul || fabs(b1y - b2y) < eul) {
- SWAP_FLOAT(a1x, b1x, xi); /*abuse xi*/
- SWAP_FLOAT(a1y, b1y, xi);
- SWAP_FLOAT(a2x, b2x, xi);
- SWAP_FLOAT(a2y, b2y, xi);
- }
-
- if (fabs(a1x-a2x) < eul) { /* verticle line */
- if (fabs(b1x-b2x) < eul){ /*verticle second line */
- Py_RETURN_NONE; /* 2 verticle lines dont intersect. */
- }
- else if (fabs(b1y-b2y) < eul) {
- /*X of vert, Y of hoz. no calculation needed */
- newvec[0]= a1x;
- newvec[1]= b1y;
- return newVectorObject(newvec, 2, Py_NEW);
- }
-
- yi = (float)(((b1y / fabs(b1x - b2x)) * fabs(b2x - a1x)) + ((b2y / fabs(b1x - b2x)) * fabs(b1x - a1x)));
-
- if (yi > MAX2(a1y, a2y)) {/* New point above seg1's vert line */
- Py_RETURN_NONE;
- } else if (yi < MIN2(a1y, a2y)) { /* New point below seg1's vert line */
- Py_RETURN_NONE;
- }
- newvec[0]= a1x;
- newvec[1]= yi;
- return newVectorObject(newvec, 2, Py_NEW);
- } else if (fabs(a2y-a1y) < eul) { /* hoz line1 */
- if (fabs(b2y-b1y) < eul) { /*hoz line2*/
- Py_RETURN_NONE; /*2 hoz lines dont intersect*/
- }
-
- /* Can skip vert line check for seg 2 since its covered above. */
- xi = (float)(((b1x / fabs(b1y - b2y)) * fabs(b2y - a1y)) + ((b2x / fabs(b1y - b2y)) * fabs(b1y - a1y)));
- if (xi > MAX2(a1x, a2x)) { /* New point right of hoz line1's */
- Py_RETURN_NONE;
- } else if (xi < MIN2(a1x, a2x)) { /*New point left of seg1's hoz line */
- Py_RETURN_NONE;
- }
- newvec[0]= xi;
- newvec[1]= a1y;
- return newVectorObject(newvec, 2, Py_NEW);
- }
-
- b1 = (a2y-a1y)/(a2x-a1x);
- b2 = (b2y-b1y)/(b2x-b1x);
- a1 = a1y-b1*a1x;
- a2 = b1y-b2*b1x;
-
- if (b1 - b2 == 0.0) {
- Py_RETURN_NONE;
- }
-
- xi = - (a1-a2)/(b1-b2);
- yi = a1+b1*xi;
- if ((a1x-xi)*(xi-a2x) >= 0 && (b1x-xi)*(xi-b2x) >= 0 && (a1y-yi)*(yi-a2y) >= 0 && (b1y-yi)*(yi-b2y)>=0) {
- newvec[0]= xi;
- newvec[1]= yi;
- return newVectorObject(newvec, 2, Py_NEW);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args )
-{
- VectorObject *pt, *line_1, *line_2;
- float pt_in[3], pt_out[3], l1[3], l2[3];
- float lambda;
- PyObject *ret;
-
- if( !PyArg_ParseTuple ( args, "O!O!O!",
- &vector_Type, &pt,
- &vector_Type, &line_1,
- &vector_Type, &line_2)
- )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 3 vector types\n" ) );
-
- /* accept 2d verts */
- if (pt->size==3) { VECCOPY(pt_in, pt->vec);}
- else { pt_in[2]=0.0; VECCOPY2D(pt_in, pt->vec) }
-
- if (line_1->size==3) { VECCOPY(l1, line_1->vec);}
- else { l1[2]=0.0; VECCOPY2D(l1, line_1->vec) }
-
- if (line_2->size==3) { VECCOPY(l2, line_2->vec);}
- else { l2[2]=0.0; VECCOPY2D(l2, line_2->vec) }
-
- /* do the calculation */
- lambda = lambda_cp_line_ex(pt_in, l1, l2, pt_out);
-
- ret = PyTuple_New(2);
- PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW) );
- PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble(lambda) );
- return ret;
-}
-
-static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args )
-{
- VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3;
-
- if( !PyArg_ParseTuple ( args, "O!O!O!O!",
- &vector_Type, &pt_vec,
- &vector_Type, &tri_p1,
- &vector_Type, &tri_p2,
- &vector_Type, &tri_p3)
- )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 4 vector types\n" ) );
-
- return PyInt_FromLong(IsectPT2Df(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec));
-}
-
-static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args )
-{
- VectorObject *pt_vec, *quad_p1, *quad_p2, *quad_p3, *quad_p4;
-
- if( !PyArg_ParseTuple ( args, "O!O!O!O!O!",
- &vector_Type, &pt_vec,
- &vector_Type, &quad_p1,
- &vector_Type, &quad_p2,
- &vector_Type, &quad_p3,
- &vector_Type, &quad_p4)
- )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 5 vector types\n" ) );
-
- return PyInt_FromLong(IsectPQ2Df(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec));
-}
-
-static int boxPack_FromPyObject(PyObject * value, boxPack **boxarray )
-{
- int len, i;
- PyObject *list_item, *item_1, *item_2;
- boxPack *box;
-
-
- /* Error checking must alredy be done */
- if( !PyList_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "can only back a list of [x,y,x,w]" );
-
- len = PyList_Size( value );
-
- (*boxarray) = MEM_mallocN( len*sizeof(boxPack), "boxPack box");
-
-
- for( i = 0; i < len; i++ ) {
- list_item = PyList_GET_ITEM( value, i );
- if( !PyList_Check( list_item ) || PyList_Size( list_item ) < 4 ) {
- MEM_freeN(*boxarray);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "can only back a list of [x,y,x,w]" );
- }
-
- box = (*boxarray)+i;
-
- item_1 = PyList_GET_ITEM(list_item, 2);
- item_2 = PyList_GET_ITEM(list_item, 3);
-
- if (!PyNumber_Check(item_1) || !PyNumber_Check(item_2)) {
- MEM_freeN(*boxarray);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "can only back a list of 2d boxes [x,y,x,w]" );
- }
-
- box->w = (float)PyFloat_AsDouble( item_1 );
- box->h = (float)PyFloat_AsDouble( item_2 );
- box->index = i;
- /* verts will be added later */
- }
- return 0;
-}
-
-static void boxPack_ToPyObject(PyObject * value, boxPack **boxarray)
-{
- int len, i;
- PyObject *list_item;
- boxPack *box;
-
- len = PyList_Size( value );
-
- for( i = 0; i < len; i++ ) {
- box = (*boxarray)+i;
- list_item = PyList_GET_ITEM( value, box->index );
- PyList_SET_ITEM( list_item, 0, PyFloat_FromDouble( box->x ));
- PyList_SET_ITEM( list_item, 1, PyFloat_FromDouble( box->y ));
- }
- MEM_freeN(*boxarray);
-}
-
-
-static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist )
-{
- boxPack *boxarray = NULL;
- float tot_width, tot_height;
- int len;
- int error;
-
- if(!PyList_Check(boxlist))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of boxes [[x,y,w,h], ... ]" );
-
- len = PyList_Size( boxlist );
-
- if (!len)
- return Py_BuildValue( "ff", 0.0, 0.0);
-
- error = boxPack_FromPyObject(boxlist, &boxarray);
- if (error!=0) return NULL;
-
- /* Non Python function */
- boxPack2D(boxarray, len, &tot_width, &tot_height);
-
- boxPack_ToPyObject(boxlist, &boxarray);
-
- return Py_BuildValue( "ff", tot_width, tot_height);
-}
diff --git a/source/blender/python/api2_2x/Geometry.h b/source/blender/python/api2_2x/Geometry.h
deleted file mode 100644
index d7de9561078..00000000000
--- a/source/blender/python/api2_2x/Geometry.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-/*Include this file for access to vector, quat, matrix, euler, etc...*/
-
-#ifndef EXPP_Geometry_H
-#define EXPP_Geometry_H
-
-#include <Python.h>
-#include "vector.h"
-
-PyObject *Geometry_Init( void );
-
-#endif /* EXPP_Geometry_H */
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c
deleted file mode 100644
index 0998053e7e1..00000000000
--- a/source/blender/python/api2_2x/Group.c
+++ /dev/null
@@ -1,841 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Group.h" /* This must come first */
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_group_types.h"
-#include "DNA_scene_types.h" /* for Base */
-
-#include "BKE_mesh.h"
-#include "BKE_library.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-#include "BKE_group.h"
-
-#include "BLI_blenlib.h"
-
-#include "blendef.h"
-#include "Object.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "vector.h"
-
-/* checks for the group being removed */
-#define GROUP_DEL_CHECK_PY(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Group has been removed" ) )
-#define GROUP_DEL_CHECK_INT(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Group has been removed" ) )
-
-/*****************************************************************************/
-/* Python API function prototypes for the Blender module. */
-/*****************************************************************************/
-static PyObject *M_Group_New( PyObject * self, PyObject * args );
-static PyObject *M_Group_Get( PyObject * self, PyObject * args );
-static PyObject *M_Group_Unlink( PyObject * self, BPy_Group * pygrp );
-
-/* internal */
-static PyObject *GroupObSeq_CreatePyObject( BPy_Group *self, GroupObject *iter );
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Object module: */
-/*****************************************************************************/
-struct PyMethodDef M_Group_methods[] = {
- {"New", ( PyCFunction ) M_Group_New, METH_VARARGS,
- "(name) Add a new empty group"},
- {"Get", ( PyCFunction ) M_Group_Get, METH_VARARGS,
-"(name) - return the group with the name 'name',\
-returns None if notfound.\nIf 'name' is not specified, it returns a list of all groups."},
- {"Unlink", ( PyCFunction ) M_Group_Unlink, METH_O,
- "(group) - Unlink (delete) this group from Blender."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Group methods table: */
-/*****************************************************************************/
-static PyObject *BPy_Group_copy( BPy_Group * self );
-
-static PyMethodDef BPy_Group_methods[] = {
- /* name, method, flags, doc */
- {"__copy__", ( PyCFunction ) BPy_Group_copy, METH_VARARGS,
- "() - Return a copy of the group containing the same objects."},
- {"copy", ( PyCFunction ) BPy_Group_copy, METH_VARARGS,
- "() - Return a copy of the group containing the same objects."},
- {NULL, NULL, 0, NULL}
-};
-
-
-static PyObject *BPy_Group_copy( BPy_Group * self )
-{
- BPy_Group *py_group; /* for Group Data object wrapper in Python */
- struct Group *bl_group;
- GroupObject *group_ob, *group_ob_new; /* Group object, copied and added to the groups */
-
- GROUP_DEL_CHECK_PY(self);
-
- bl_group= add_group( self->group->id.name + 2 );
-
- if( bl_group ) /* now create the wrapper grp in Python */
- py_group = ( BPy_Group * ) Group_CreatePyObject( bl_group );
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Group Data in Blender" ) );
-
- bl_group->id.us = 1;
-
- /* Now add the objects to the group */
- group_ob= self->group->gobject.first;
- while(group_ob) {
- /* save time by not using */
- group_ob_new= MEM_callocN(sizeof(GroupObject), "groupobject");
- group_ob_new->ob= group_ob->ob;
- BLI_addtail( &bl_group->gobject, group_ob_new);
- group_ob= group_ob->next;
- }
-
- return ( PyObject * ) py_group;
-
-}
-
-
-/************************************************************************
- *
- * Python BPy_Object attributes
- *
- ************************************************************************/
-static PyObject *Group_getObjects( BPy_Group * self )
-{
- return GroupObSeq_CreatePyObject(self, NULL);
-}
-
-
-static void add_to_group_wraper(Group *group, Object *ob) {
- Base *base;
- add_to_group(group, ob);
-
- if (!(ob->flag & OB_FROMGROUP)) { /* do this to avoid a listbase lookup */
- ob->flag |= OB_FROMGROUP;
-
- base= object_in_scene(ob, G.scene);
- if (base)
- base->flag |= OB_FROMGROUP;
- }
-}
-
-/* only for internal use Blender.Group.Get("MyGroup").objects= []*/
-static int Group_setObjects( BPy_Group * self, PyObject * args )
-{
- int i, list_size;
- Group *group;
- Object *blen_ob;
- group= self->group;
-
- GROUP_DEL_CHECK_INT(self);
-
- if( PyList_Check( args ) ) {
- if( EXPP_check_sequence_consistency( args, &Object_Type ) != 1)
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of objects" ) );
-
- /* remove all from the list and add the new items */
- free_group(group); /* unlink all objects from this group, keep the group */
- list_size= PyList_Size( args );
- for( i = 0; i < list_size; i++ ) {
- blen_ob= ((BPy_Object *)PyList_GET_ITEM( args, i ))->object;
- add_to_group_wraper(group, blen_ob);
- }
- } else if (PyIter_Check(args)) {
- PyObject *iterator = PyObject_GetIter(args);
- PyObject *item;
- if (iterator == NULL) {
- Py_DECREF(iterator);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of objects, This iterator cannot be used." );
- }
- free_group(group); /* unlink all objects from this group, keep the group */
- item = PyIter_Next(iterator);
- while (item) {
- if ( PyObject_TypeCheck(item, &Object_Type) ) {
- blen_ob= ((BPy_Object *)item)->object;
- add_to_group_wraper(group, blen_ob);
- }
- Py_DECREF(item);
- item = PyIter_Next(iterator);
- }
-
- Py_DECREF(iterator);
-
- if (PyErr_Occurred()) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "An unknown error occured while adding iterator objects to the group.\nThe group has been modified." );
- }
-
- } else
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list or sequence of objects" );
- return 0;
-}
-
-static PyObject *Group_getDupliOfs( BPy_Group * self )
-{
- GROUP_DEL_CHECK_PY(self);
- return newVectorObject( self->group->dupli_ofs, 3, Py_WRAP );
-}
-
-static int Group_setDupliOfs( BPy_Group * self, PyObject * value )
-{
- VectorObject *bpy_vec;
- GROUP_DEL_CHECK_INT(self);
- if (!VectorObject_Check(value))
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected a vector" ) );
-
- bpy_vec = (VectorObject *)value;
-
- if (bpy_vec->size != 3)
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "can only assign a 3D vector" ) );
-
- self->group->dupli_ofs[0] = bpy_vec->vec[0];
- self->group->dupli_ofs[1] = bpy_vec->vec[1];
- self->group->dupli_ofs[2] = bpy_vec->vec[2];
- return 0;
-}
-
-
-/*****************************************************************************/
-/* PythonTypeObject callback function prototypes */
-/*****************************************************************************/
-static PyObject *Group_repr( BPy_Group * obj );
-static int Group_compare( BPy_Group * a, BPy_Group * b );
-
-/*****************************************************************************/
-/* Python BPy_Group getsetattr funcs: */
-/*****************************************************************************/
-static int Group_setLayers( BPy_Group * self, PyObject * value )
-{
- unsigned int laymask = 0;
-
- GROUP_DEL_CHECK_INT(self);
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an integer (bitmask) as argument" );
-
- laymask = ( unsigned int )PyInt_AS_LONG( value );
-
- if( laymask <= 0 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "layer value cannot be zero or below" );
-
- self->group->layer= laymask & ((1<<20) - 1);
-
- return 0;
-}
-
-static PyObject *Group_getLayers( BPy_Group * self )
-{
- return PyInt_FromLong( self->group->layer );
-}
-
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Group_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"layers",
- (getter)Group_getLayers, (setter)Group_setLayers,
- "layer mask for this group",
- NULL},
- {"objects",
- (getter)Group_getObjects, (setter)Group_setObjects,
- "objects in this group",
- NULL},
- {"dupliOffset",
- (getter)Group_getDupliOfs, (setter)Group_setDupliOfs,
- "offset to use when instancing this group as a DupliGroup",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python TypeGroup structure definition: */
-/*****************************************************************************/
-PyTypeObject Group_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Group", /* char *tp_name; */
- sizeof( BPy_Group ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Group_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Group_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Group_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Group_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-
-
-/*****************************************************************************/
-/* Function: M_Group_New */
-/* Python equivalent: Blender.Group.New */
-/*****************************************************************************/
-PyObject *M_Group_New( PyObject * self, PyObject * args )
-{
- char *name = "Group";
- BPy_Group *py_group; /* for Group Data object wrapper in Python */
- struct Group *bl_group;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "string expected as argument or nothing" );
-
- bl_group= add_group( name );
-
- if( bl_group ) /* now create the wrapper grp in Python */
- py_group = ( BPy_Group * ) Group_CreatePyObject( bl_group );
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Group Data in Blender" ) );
-
- bl_group->id.us = 1;
-
- return ( PyObject * ) py_group;
-}
-
-/*****************************************************************************/
-/* Function: M_Group_Get */
-/* Python equivalent: Blender.Group.Get */
-/*****************************************************************************/
-static PyObject *M_Group_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Group *group_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- group_iter = G.main->group.first;
-
- if( name ) { /* (name) - Search group by name */
-
- BPy_Group *wanted_group = NULL;
-
- while( ( group_iter ) && ( wanted_group == NULL ) ) {
-
- if( strcmp( name, group_iter->id.name + 2 ) == 0 )
- wanted_group =
- ( BPy_Group * )
- Group_CreatePyObject( group_iter );
-
- group_iter = group_iter->id.next;
- }
-
- if( wanted_group == NULL ) { /* Requested group doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Group \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_group;
- }
-
- else { /* () - return a list of all groups in the scene */
- int index = 0;
- PyObject *grouplist, *pyobj;
-
- grouplist = PyList_New( BLI_countlist( &( G.main->group ) ) );
-
- if( grouplist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create group list" ) );
-
- while( group_iter ) {
- pyobj = Group_CreatePyObject( group_iter );
-
- if( !pyobj ) {
- Py_DECREF(grouplist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Object" ) );
- }
- PyList_SET_ITEM( grouplist, index, pyobj );
-
- group_iter = group_iter->id.next;
- index++;
- }
-
- return grouplist;
- }
-}
-
-
-/*****************************************************************************/
-/* Function: M_Group_Unlink */
-/* Python equivalent: Blender.Group.Unlink */
-/*****************************************************************************/
-static PyObject *M_Group_Unlink( PyObject * self, BPy_Group * pygrp )
-{
- Group *group;
- if( !BPy_Group_Check(pygrp) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a group" ) );
-
- GROUP_DEL_CHECK_PY(pygrp);
-
- group= pygrp->group;
-
- pygrp->group= NULL;
- free_group(group);
- unlink_group(group);
- group->id.us= 0;
- free_libblock( &G.main->group, group );
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************/
-/* Function: initObject */
-/*****************************************************************************/
-PyObject *Group_Init( void )
-{
- PyObject *submodule;
- if( PyType_Ready( &Group_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &GroupObSeq_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Group", M_Group_methods,
- "The Blender Group module\n\n\
-This module provides access to **Group Data** in Blender.\n" );
-
- /*Add SUBMODULES to the module*/
- /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); //creates a *new* module*/
- return submodule;
-}
-
-
-/*****************************************************************************/
-/* Function: Group_CreatePyObject */
-/* Description: This function will create a new BlenObject from an existing */
-/* Object structure. */
-/*****************************************************************************/
-PyObject *Group_CreatePyObject( struct Group * grp )
-{
- BPy_Group *pygrp;
-
- if( !grp )
- Py_RETURN_NONE;
-
- pygrp =
- ( BPy_Group * ) PyObject_NEW( BPy_Group, &Group_Type );
-
- if( pygrp == NULL ) {
- return ( NULL );
- }
- pygrp->group = grp;
- return ( ( PyObject * ) pygrp );
-}
-
-/*****************************************************************************/
-/* Function: Group_FromPyObject */
-/* Description: This function returns the Blender group from the given */
-/* PyObject. */
-/*****************************************************************************/
-Group *Group_FromPyObject( PyObject * py_grp )
-{
- BPy_Group *blen_grp;
-
- blen_grp = ( BPy_Group * ) py_grp;
- return ( blen_grp->group );
-}
-
-/*****************************************************************************/
-/* Function: Group_compare */
-/* Description: This is a callback function for the BPy_Group type. It */
-/* compares two Group_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Object struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Group_compare( BPy_Group * a, BPy_Group * b )
-{
- Group *pa = a->group, *pb = b->group;
- return ( pa == pb ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Group_repr */
-/* Description: This is a callback function for the BPy_Group type. It */
-/* builds a meaninful string to represent object objects. */
-/*****************************************************************************/
-static PyObject *Group_repr( BPy_Group * self )
-{
- if (!self->group)
- return PyString_FromString( "[Group - Removed]" );
-
- return PyString_FromFormat( "[Group \"%s\"]",
- self->group->id.name + 2 );
-}
-
-
-/************************************************************************
- *
- * GroupOb sequence
- *
- ************************************************************************/
-/*
- * create a thin GroupOb object
- */
-
-static PyObject *GroupObSeq_CreatePyObject( BPy_Group *self, GroupObject *iter )
-{
- BPy_GroupObSeq *seq = PyObject_NEW( BPy_GroupObSeq, &GroupObSeq_Type);
- seq->bpygroup = self; Py_INCREF(self);
- seq->iter= iter;
- return (PyObject *)seq;
-}
-
-
-static int GroupObSeq_len( BPy_GroupObSeq * self )
-{
- GROUP_DEL_CHECK_INT(self->bpygroup);
- return BLI_countlist( &( self->bpygroup->group->gobject ) );
-}
-
-/*
- * retrive a single GroupOb from somewhere in the GroupObex list
- */
-
-static PyObject *GroupObSeq_item( BPy_GroupObSeq * self, int i )
-{
- Group *group= self->bpygroup->group;
- int index=0;
- PyObject *bpy_obj;
- GroupObject *gob;
-
- GROUP_DEL_CHECK_PY(self->bpygroup);
-
- for (gob= group->gobject.first; gob && i!=index; gob= gob->next, index++) {}
-
- if (!(gob))
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- bpy_obj = Object_CreatePyObject( gob->ob );
-
- if( !bpy_obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- return (PyObject *)bpy_obj;
-
-}
-
-static PySequenceMethods GroupObSeq_as_sequence = {
- ( inquiry ) GroupObSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) GroupObSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-/************************************************************************
- *
- * Python GroupObSeq_Type iterator (iterates over GroupObjects)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *GroupObSeq_getIter( BPy_GroupObSeq * self )
-{
- GROUP_DEL_CHECK_PY(self->bpygroup);
-
- if (!self->iter) {
- self->iter = self->bpygroup->group->gobject.first;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return GroupObSeq_CreatePyObject(self->bpygroup, self->bpygroup->group->gobject.first);
- }
-}
-
-/*
- * Return next GroupOb.
- */
-
-static PyObject *GroupObSeq_nextIter( BPy_GroupObSeq * self )
-{
- PyObject *object;
- if( !(self->iter) || !(self->bpygroup->group) ) {
- self->iter = NULL; /* so we can add objects again */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object= Object_CreatePyObject( self->iter->ob );
- self->iter= self->iter->next;
- return object;
-}
-
-
-static PyObject *GroupObSeq_link( BPy_GroupObSeq * self, BPy_Object *value )
-{
- Object *blen_ob;
-
- GROUP_DEL_CHECK_PY(self->bpygroup);
-
- if( !BPy_Object_Check(value) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a python object as an argument" ) );
-
- /*
- if (self->iter != NULL)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Cannot modify group objects while iterating" );
- */
-
- blen_ob = value->object;
-
- add_to_group_wraper(self->bpygroup->group, blen_ob); /* this checks so as not to add the object into the group twice*/
-
- Py_RETURN_NONE;
-}
-
-static PyObject *GroupObSeq_unlink( BPy_GroupObSeq * self, BPy_Object *value )
-{
- Object *blen_ob;
- Base *base= NULL;
-
- GROUP_DEL_CHECK_PY(self->bpygroup);
-
- if( !BPy_Object_Check(value) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a python object as an argument" ) );
-
- blen_ob = value->object;
-
-
-
- rem_from_group(self->bpygroup->group, blen_ob);
-
- if(find_group(blen_ob, NULL)==NULL) {
- blen_ob->flag &= ~OB_FROMGROUP;
-
- base= object_in_scene(blen_ob, G.scene);
- if (base)
- base->flag &= ~OB_FROMGROUP;
- }
- Py_RETURN_NONE;
-}
-
-static struct PyMethodDef BPy_GroupObSeq_methods[] = {
- {"link", (PyCFunction)GroupObSeq_link, METH_O,
- "make the object a part of this group"},
- {"unlink", (PyCFunction)GroupObSeq_unlink, METH_O,
- "unlink an object from this group"},
- {NULL, NULL, 0, NULL}
-};
-
-/************************************************************************
- *
- * Python GroupObSeq_Type standard operations
- *
- ************************************************************************/
-
-static void GroupObSeq_dealloc( BPy_GroupObSeq * self )
-{
- Py_DECREF(self->bpygroup);
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Python GroupObSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject GroupObSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender GroupObSeq", /* char *tp_name; */
- sizeof( BPy_GroupObSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) GroupObSeq_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &GroupObSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) GroupObSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) GroupObSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_GroupObSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/Group.h b/source/blender/python/api2_2x/Group.h
deleted file mode 100644
index d3275951b2c..00000000000
--- a/source/blender/python/api2_2x/Group.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_GROUP_H
-#define EXPP_GROUP_H
-
-#include <Python.h>
-#include "DNA_group_types.h"
-
-/* The Group PyTypeObject defined in Group.c */
-extern PyTypeObject Group_Type;
-extern PyTypeObject GroupObSeq_Type;
-
-#define BPy_Group_Check(v) ((v)->ob_type == &Group_Type)
-#define BPy_GroupObSeq_Check(v) ((v)->ob_type == &GroupObSeq_Type)
-
-/*****************************************************************************/
-/* Python BPy_Group structure definition. */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- struct Group *group;
-} BPy_Group;
-
-
-/* Group object sequence, iterate on the groups object listbase*/
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- BPy_Group *bpygroup; /* link to the python group so we can know if its been removed */
- GroupObject *iter; /* so we can iterate over the objects */
-} BPy_GroupObSeq;
-
-PyObject *Group_Init( void );
-PyObject *Group_CreatePyObject( struct Group *group );
-Group *Group_FromPyObject( PyObject * py_obj );
-
-#endif /* EXPP_GROUP_H */
diff --git a/source/blender/python/api2_2x/IDProp.c b/source/blender/python/api2_2x/IDProp.c
deleted file mode 100644
index 07269e54c7c..00000000000
--- a/source/blender/python/api2_2x/IDProp.c
+++ /dev/null
@@ -1,965 +0,0 @@
-/**
- * $Id: IDProp.c
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Eagar
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "DNA_ID.h"
-
-#include "BKE_idprop.h"
-
-#include "IDProp.h"
-#include "gen_utils.h"
-
-#include "MEM_guardedalloc.h"
-
-#define BSTR_EQ(a, b) (*(a) == *(b) && !strcmp(a, b))
-
-/*** Function to wrap ID properties ***/
-PyObject *BPy_Wrap_IDProperty(ID *id, IDProperty *prop, IDProperty *parent);
-
-extern PyTypeObject IDArray_Type;
-extern PyTypeObject IDGroup_Iter_Type;
-
-/*********************** ID Property Main Wrapper Stuff ***************/
-
-PyObject *IDGroup_repr( BPy_IDProperty *self )
-{
- return PyString_FromString( "(ID Property)" );
-}
-
-extern PyTypeObject IDGroup_Type;
-
-PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
-{
- switch ( prop->type ) {
- case IDP_STRING:
- return PyString_FromString( prop->data.pointer );
- case IDP_INT:
- return PyInt_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, &IDGroup_Type);
- if (!group)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- group->id = id;
- group->prop = prop;
- return (PyObject*) group;
- }
- case IDP_ARRAY:
- {
- BPy_IDProperty *array = PyObject_New(BPy_IDProperty, &IDArray_Type);
- if (!array)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- array->id = id;
- array->prop = prop;
- return (PyObject*) array;
- }
- }
- Py_RETURN_NONE;
-}
-
-int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
-{
- switch (prop->type) {
- case IDP_STRING:
- {
- char *st;
- if (!PyString_Check(value))
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a string!");
-
- st = PyString_AsString(value);
- IDP_ResizeArray(prop, strlen(st)+1);
- strcpy(prop->data.pointer, st);
- return 0;
- }
-
- case IDP_INT:
- {
- int ivalue;
- if (!PyNumber_Check(value))
- return EXPP_ReturnIntError(PyExc_TypeError, "expected an int!");
- value = PyNumber_Int(value);
- if (!value)
- return EXPP_ReturnIntError(PyExc_TypeError, "expected an int!");
- ivalue = (int) PyInt_AsLong(value);
- prop->data.val = ivalue;
- Py_XDECREF(value);
- break;
- }
- case IDP_FLOAT:
- {
- float fvalue;
- if (!PyNumber_Check(value))
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
- value = PyNumber_Float(value);
- if (!value)
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
- fvalue = (float) PyFloat_AsDouble(value);
- *(float*)&self->prop->data.val = fvalue;
- Py_XDECREF(value);
- break;
- }
- case IDP_DOUBLE:
- {
- double dvalue;
- if (!PyNumber_Check(value))
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
- value = PyNumber_Float(value);
- if (!value)
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a float!");
- dvalue = (float) PyFloat_AsDouble(value);
- *(double*)&self->prop->data.val = dvalue;
- Py_XDECREF(value);
- break;
- }
- default:
- return EXPP_ReturnIntError(PyExc_AttributeError, "attempt to set read-only attribute!");
- }
- return 0;
-}
-
-PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *bleh)
-{
- return PyString_FromString(self->prop->name);
-}
-
-static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *bleh)
-{
- char *st;
- if (!PyString_Check(value))
- return EXPP_ReturnIntError(PyExc_TypeError, "expected a string!");
-
- st = PyString_AsString(value);
- if (strlen(st) >= MAX_IDPROP_NAME)
- return EXPP_ReturnIntError(PyExc_TypeError, "string length cannot exceed 31 characters!");
-
- strcpy(self->prop->name, st);
- return 0;
-}
-
-static PyObject *BPy_IDGroup_GetType(BPy_IDProperty *self)
-{
- return PyInt_FromLong((long)self->prop->type);
-}
-
-static PyGetSetDef BPy_IDGroup_getseters[] = {
- {"name",
- (getter)BPy_IDGroup_GetName, (setter)BPy_IDGroup_SetName,
- "The name of this Group.",
- NULL},
- {NULL, NULL, NULL, NULL, NULL}
-};
-
-static int BPy_IDGroup_Map_Len(BPy_IDProperty *self)
-{
- if (self->prop->type != IDP_GROUP)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "len() of unsized object");
-
- return self->prop->len;
-}
-
-static PyObject *BPy_IDGroup_Map_GetItem(BPy_IDProperty *self, PyObject *item)
-{
- IDProperty *loop;
- char *st;
-
- if (self->prop->type != IDP_GROUP)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsubscriptable object");
-
- if (!PyString_Check(item))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "only strings are allowed as keys of ID properties");
-
- st = PyString_AsString(item);
- for (loop=self->prop->data.group.first; loop; loop=loop->next) {
- if (BSTR_EQ(loop->name, st)) return BPy_IDGroup_WrapData(self->id, loop);
- }
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "key not in subgroup dict");
-}
-
-/*returns NULL on success, error string on failure*/
-static char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObject *ob)
-{
- IDProperty *prop = NULL;
- IDPropertyTemplate val = {0};
-
- if (PyFloat_Check(ob)) {
- val.d = PyFloat_AsDouble(ob);
- prop = IDP_New(IDP_DOUBLE, val, name);
- } else if (PyInt_Check(ob)) {
- val.i = (int) PyInt_AsLong(ob);
- prop = IDP_New(IDP_INT, val, name);
- } else if (PyString_Check(ob)) {
- val.str = PyString_AsString(ob);
- prop = IDP_New(IDP_STRING, val, name);
- } else if (PySequence_Check(ob)) {
- PyObject *item;
- int i;
-
- /*validate sequence and derive type.
- we assume IDP_INT unless we hit a float
- number; then we assume it's */
- val.array.type = IDP_INT;
- val.array.len = PySequence_Length(ob);
- for (i=0; i<val.array.len; i++) {
- item = PySequence_GetItem(ob, i);
- if (PyFloat_Check(item)) val.array.type = IDP_DOUBLE;
- else if (!PyInt_Check(item)) return "only floats and ints are allowed in ID property arrays";
- Py_XDECREF(item);
- }
-
- prop = IDP_New(IDP_ARRAY, val, name);
- for (i=0; i<val.array.len; i++) {
- item = PySequence_GetItem(ob, i);
- if (val.array.type == IDP_INT) {
- item = PyNumber_Int(item);
- ((int*)prop->data.pointer)[i] = (int)PyInt_AsLong(item);
- } else {
- item = PyNumber_Float(item);
- ((double*)prop->data.pointer)[i] = (float)PyFloat_AsDouble(item);
- }
- Py_XDECREF(item);
- }
- } else if (PyMapping_Check(ob)) {
- PyObject *keys, *vals, *key, *pval;
- int i, len;
- /*yay! we get into recursive stuff now!*/
- keys = PyMapping_Keys(ob);
- vals = PyMapping_Values(ob);
-
- /*we allocate the group first; if we hit any invalid data,
- we can delete it easily enough.*/
- prop = IDP_New(IDP_GROUP, val, name);
- len = PyMapping_Length(ob);
- for (i=0; i<len; i++) {
- key = PySequence_GetItem(keys, i);
- pval = PySequence_GetItem(vals, i);
- if (!PyString_Check(key)) {
- IDP_FreeProperty(prop);
- MEM_freeN(prop);
- Py_XDECREF(keys);
- Py_XDECREF(vals);
- Py_XDECREF(key);
- Py_XDECREF(pval);
- return "invalid element in subgroup dict template!";
- }
- if (BPy_IDProperty_Map_ValidateAndCreate(PyString_AsString(key), prop, pval)) {
- IDP_FreeProperty(prop);
- MEM_freeN(prop);
- Py_XDECREF(keys);
- Py_XDECREF(vals);
- Py_XDECREF(key);
- Py_XDECREF(pval);
- return "invalid element in subgroup dict template!";
- }
- Py_XDECREF(key);
- Py_XDECREF(pval);
- }
- Py_XDECREF(keys);
- Py_XDECREF(vals);
- } else return "invalid property value";
-
- IDP_ReplaceInGroup(group, prop);
- return NULL;
-}
-
-static int BPy_IDGroup_Map_SetItem(BPy_IDProperty *self, PyObject *key, PyObject *val)
-{
- char *err;
-
- if (self->prop->type != IDP_GROUP)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "unsubscriptable object");
-
- if (!PyString_Check(key))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "only strings are allowed as subgroup keys" );
-
- if (val == NULL) {
- IDProperty *pkey = IDP_GetPropertyFromGroup(self->prop, PyString_AsString(key));
- if (pkey) {
- IDP_RemFromGroup(self->prop, pkey);
- IDP_FreeProperty(pkey);
- MEM_freeN(pkey);
- return 0;
- } else return EXPP_ReturnIntError( PyExc_RuntimeError, "property not found in group" );
- }
-
- err = BPy_IDProperty_Map_ValidateAndCreate(PyString_AsString(key), self->prop, val);
- if (err) return EXPP_ReturnIntError( PyExc_RuntimeError, err );
-
- return 0;
-}
-
-static PyObject *BPy_IDGroup_SpawnIterator(BPy_IDProperty *self)
-{
- BPy_IDGroup_Iter *iter = PyObject_New(BPy_IDGroup_Iter, &IDGroup_Iter_Type);
-
- if (!iter)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
- iter->group = self;
- iter->mode = IDPROP_ITER_KEYS;
- iter->cur = self->prop->data.group.first;
- Py_XINCREF(iter);
- return (PyObject*) iter;
-}
-
-static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
-{
- switch (prop->type) {
- case IDP_STRING:
- return PyString_FromString(prop->data.pointer);
- break;
- case IDP_FLOAT:
- return PyFloat_FromDouble(*((float*)&prop->data.val));
- break;
- case IDP_DOUBLE:
- return PyFloat_FromDouble(*((double*)&prop->data.val));
- break;
- case IDP_INT:
- return PyInt_FromLong( (long)prop->data.val );
- break;
- case IDP_ARRAY:
- {
- PyObject *seq = PyList_New(prop->len);
- int i;
-
- if (!seq)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- for (i=0; i<prop->len; i++) {
- if (prop->subtype == IDP_FLOAT) {
- PyList_SetItem(seq, i,
- PyFloat_FromDouble(((float*)prop->data.pointer)[i]));
- } else if (prop->subtype == IDP_DOUBLE) {
- PyList_SetItem(seq, i,
- PyFloat_FromDouble(((double*)prop->data.pointer)[i]));
- } else { PyList_SetItem(seq, i,
- PyInt_FromLong(((int*)prop->data.pointer)[i]));
- }
- }
- return seq;
- }
- case IDP_GROUP:
- {
- PyObject *dict = PyDict_New(), *wrap;
- IDProperty *loop;
-
- if (!dict)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyDict_New() failed" );
-
- for (loop=prop->data.group.first; loop; loop=loop->next) {
- wrap = BPy_IDGroup_MapDataToPy(loop);
- if (!wrap)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "BPy_IDGroup_MapDataToPy() failed" );
-
- PyDict_SetItemString(dict, loop->name, wrap);
- }
- return dict;
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "eek!! a property exists with a bad type code!!!" );
-}
-
-static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value)
-{
- IDProperty *loop;
- PyObject *pyform;
- char *name = PyString_AsString(value);
-
- if (!name) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "pop expected at least 1 argument, got 0" );
- }
-
- for (loop=self->prop->data.group.first; loop; loop=loop->next) {
- if (BSTR_EQ(loop->name, name)) {
- pyform = BPy_IDGroup_MapDataToPy(loop);
-
- if (!pyform)
- /*ok something bad happened with the pyobject,
- so don't remove the prop from the group. if pyform is
- NULL, then it already should have raised an exception.*/
- return NULL;
-
- IDP_RemFromGroup(self->prop, loop);
- return pyform;
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "item not in group" );
-}
-
-static PyObject *BPy_IDGroup_IterItems(BPy_IDProperty *self)
-{
- BPy_IDGroup_Iter *iter = PyObject_New(BPy_IDGroup_Iter, &IDGroup_Iter_Type);
-
- if (!iter)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- iter->group = self;
- iter->mode = IDPROP_ITER_ITEMS;
- iter->cur = self->prop->data.group.first;
- Py_XINCREF(iter);
- return (PyObject*) iter;
-}
-
-static PyObject *BPy_IDGroup_GetKeys(BPy_IDProperty *self)
-{
- PyObject *seq = PyList_New(self->prop->len);
- IDProperty *loop;
- int i, j;
-
- if (!seq)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- for (i=0, loop=self->prop->data.group.first; loop; loop=loop->next, i++)
- PyList_SetItem(seq, i, PyString_FromString(loop->name));
-
- if (i != self->prop->len) {
- printf("ID Property Error found and corrected in BPy_IDGroup_GetKeys!\n");
-
- /*fill rest of list with valid references to None*/
- for (j=i; j<self->prop->len; j++) {
- Py_INCREF(Py_None);
- PyList_SetItem(seq, j, Py_None);
- }
-
- /*set correct group length*/
- self->prop->len = i;
-
- /*free the list*/
- Py_DECREF(seq);
-
- /*call self again*/
- return BPy_IDGroup_GetKeys(self);
- }
-
- return seq;
-}
-
-static PyObject *BPy_IDGroup_GetValues(BPy_IDProperty *self)
-{
- PyObject *seq = PyList_New(self->prop->len);
- IDProperty *loop;
- int i, j;
-
- if (!seq)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- for (i=0, loop=self->prop->data.group.first; loop; loop=loop->next, i++) {
- PyList_SetItem(seq, i, BPy_IDGroup_WrapData(self->id, loop));
- }
-
- if (i != self->prop->len) {
- printf("ID Property Error found and corrected in BPy_IDGroup_GetValues!\n");
-
- /*fill rest of list with valid references to None*/
- for (j=i; j<self->prop->len; j++) {
- Py_INCREF(Py_None);
- PyList_SetItem(seq, j, Py_None);
- }
-
- /*set correct group length*/
- self->prop->len = i;
-
- /*free the old list*/
- Py_DECREF(seq);
-
- /*call self again*/
- return BPy_IDGroup_GetValues(self);
- }
-
- return seq;
-}
-
-static PyObject *BPy_IDGroup_HasKey(BPy_IDProperty *self, PyObject *value)
-{
- IDProperty *loop;
- char *name = PyString_AsString(value);
-
- if (!name)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string");
-
- for (loop=self->prop->data.group.first; loop; loop=loop->next) {
- if (BSTR_EQ(loop->name, name)) Py_RETURN_TRUE;
- }
-
- Py_RETURN_FALSE;
-}
-
-static PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *vars)
-{
- PyObject *pyob, *pkey, *pval;
- Py_ssize_t i=0;
-
- if (PySequence_Size(vars) != 1)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object derived from dict.");
-
- pyob = PyTuple_GET_ITEM(vars, 0);
- if (!PyDict_Check(pyob))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object derived from dict.");
-
- while (PyDict_Next(pyob, &i, &pkey, &pval)) {
- BPy_IDGroup_Map_SetItem(self, pkey, pval);
- if (PyErr_Occurred()) return NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *BPy_IDGroup_ConvertToPy(BPy_IDProperty *self)
-{
- return BPy_IDGroup_MapDataToPy(self->prop);
-}
-
-static struct PyMethodDef BPy_IDGroup_methods[] = {
- {"pop", (PyCFunction)BPy_IDGroup_Pop, METH_O,
- "pop an item from the group; raises KeyError if the item doesn't exist."},
- {"iteritems", (PyCFunction)BPy_IDGroup_IterItems, METH_NOARGS,
- "iterate through the items in the dict; behaves like dictionary method iteritems."},
- {"keys", (PyCFunction)BPy_IDGroup_GetKeys, METH_NOARGS,
- "get the keys associated with this group as a list of strings."},
- {"values", (PyCFunction)BPy_IDGroup_GetValues, METH_NOARGS,
- "get the values associated with this group."},
- {"has_key", (PyCFunction)BPy_IDGroup_HasKey, METH_O,
- "returns true if the group contains a key, false if not."},
- {"update", (PyCFunction)BPy_IDGroup_Update, METH_VARARGS,
- "updates the values in the group with the values of another or a dict."},
- {"convert_to_pyobject", (PyCFunction)BPy_IDGroup_ConvertToPy, METH_NOARGS,
- "return a purely python version of the group."},
- {0, NULL, 0, NULL}
-};
-
-PyMappingMethods BPy_IDGroup_Mapping = {
- (inquiry)BPy_IDGroup_Map_Len, /*inquiry mp_length */
- (binaryfunc)BPy_IDGroup_Map_GetItem, /*binaryfunc mp_subscript */
- (objobjargproc)BPy_IDGroup_Map_SetItem, /*objobjargproc mp_ass_subscript */
-};
-
-PyTypeObject IDGroup_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender IDProperty", /* char *tp_name; */
- sizeof( BPy_IDProperty ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) IDGroup_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- (getiterfunc)BPy_IDGroup_SpawnIterator, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_IDGroup_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- 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, &IDGroup_Type);
-
- if (!wrap)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- wrap->prop = prop;
- wrap->parent = parent;
- wrap->id = id;
- //wrap->destroy = 0;
- return (PyObject*) wrap;
-}
-
-
-/********Array Wrapper********/
-
-static PyObject *IDArray_repr(BPy_IDArray *self)
-{
- return PyString_FromString("(ID Array)");
-}
-
-
-static PyObject *BPy_IDArray_GetType(BPy_IDArray *self)
-{
- return PyInt_FromLong( (long)self->prop->subtype );
-}
-
-static PyObject *BPy_IDArray_GetLen(BPy_IDArray *self)
-{
- return PyInt_FromLong( (long)self->prop->len );
-}
-
-static PyGetSetDef BPy_IDArray_getseters[] = {
- {"len",
- (getter)BPy_IDArray_GetLen, (setter)NULL,
- "The length of the array, can also be gotten with len(array).",
- NULL},
- {"type",
- (getter)BPy_IDArray_GetType, (setter)NULL,
- "The type of the data in the array, is an ant.",
- NULL},
- {NULL, NULL, NULL, NULL, NULL},
-};
-
-static int BPy_IDArray_Len(BPy_IDArray *self)
-{
- return self->prop->len;
-}
-
-static PyObject *BPy_IDArray_GetItem(BPy_IDArray *self, int index)
-{
- if (index < 0 || index >= self->prop->len)
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range!");
-
- switch (self->prop->subtype) {
- case IDP_FLOAT:
- return PyFloat_FromDouble( (double)(((float*)self->prop->data.pointer)[index]));
- break;
- case IDP_DOUBLE:
- return PyFloat_FromDouble( (((double*)self->prop->data.pointer)[index]));
- break;
- case IDP_INT:
- return PyInt_FromLong( (long)((int*)self->prop->data.pointer)[index] );
- break;
- }
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "invalid/corrupt array type!");
-}
-
-static int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *val)
-{
- int i;
- float f;
- double d;
-
- if (index < 0 || index >= self->prop->len)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "index out of range!");
-
- switch (self->prop->subtype) {
- case IDP_FLOAT:
- if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float");
- val = PyNumber_Float(val);
- if (!val) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float");
-
- f = (float) PyFloat_AsDouble(val);
- ((float*)self->prop->data.pointer)[index] = f;
- Py_XDECREF(val);
- break;
- case IDP_DOUBLE:
- if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float");
- val = PyNumber_Float(val);
- if (!val) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float");
-
- d = (double) PyFloat_AsDouble(val);
- ((double*)self->prop->data.pointer)[index] = d;
- Py_XDECREF(val);
- break;
- case IDP_INT:
- if (!PyNumber_Check(val)) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int");
- val = PyNumber_Int(val);
- if (!val) return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int");
-
- i = (int) PyInt_AsLong(val);
- ((int*)self->prop->data.pointer)[index] = i;
- Py_XDECREF(val);
- break;
- }
- return 0;
-}
-
-static PySequenceMethods BPy_IDArray_Seq = {
- (inquiry) BPy_IDArray_Len, /* inquiry sq_length */
- 0, /* binaryfunc sq_concat */
- 0, /* intargfunc sq_repeat */
- (intargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */
- 0, /* intintargfunc sq_slice */
- (intobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */
- 0, /* intintobjargproc sq_ass_slice */
- 0, /* objobjproc sq_contains */
- /* Added in release 2.0 */
- 0, /* binaryfunc sq_inplace_concat */
- 0, /* intargfunc sq_inplace_repeat */
-};
-
-PyTypeObject IDArray_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender IDArray", /* char *tp_name; */
- sizeof( BPy_IDArray ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) IDArray_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_IDArray_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*********** ID Property Group iterator ********/
-
-static PyObject *IDGroup_Iter_iterself(PyObject *self)
-{
- Py_XINCREF(self);
- return self;
-}
-
-static PyObject *IDGroup_Iter_repr(BPy_IDGroup_Iter *self)
-{
- return PyString_FromString("(ID Property Group)");
-}
-
-static PyObject *BPy_Group_Iter_Next(BPy_IDGroup_Iter *self)
-{
- IDProperty *cur=NULL;
- PyObject *tmpval;
- PyObject *ret;
-
- if (self->cur) {
- cur = self->cur;
- self->cur = self->cur->next;
- if (self->mode == IDPROP_ITER_ITEMS) {
- tmpval = BPy_IDGroup_WrapData(self->group->id, cur);
- ret = Py_BuildValue("[s, O]", cur->name, tmpval);
- Py_DECREF(tmpval);
- return ret;
- } else {
- return PyString_FromString(cur->name);
- }
- } else {
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-}
-
-PyTypeObject IDGroup_Iter_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender IDGroup_Iter", /* char *tp_name; */
- sizeof( BPy_IDGroup_Iter ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) IDGroup_Iter_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- IDGroup_Iter_iterself, /* getiterfunc tp_iter; */
- (iternextfunc) BPy_Group_Iter_Next, /* iternextfunc tp_iternext; */
-};
-
-void IDProp_Init_Types(void)
-{
- PyType_Ready( &IDGroup_Type );
- PyType_Ready( &IDGroup_Iter_Type );
- PyType_Ready( &IDArray_Type );
-}
diff --git a/source/blender/python/api2_2x/IDProp.h b/source/blender/python/api2_2x/IDProp.h
deleted file mode 100644
index 9316a01680b..00000000000
--- a/source/blender/python/api2_2x/IDProp.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * $Id: IDProp.h
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Eagar
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <Python.h>
-
-struct ID;
-struct IDProperty;
-struct BPy_IDGroup_Iter;
-
-typedef struct BPy_IDProperty {
- PyObject_VAR_HEAD
- struct ID *id;
- struct IDProperty *prop, *parent;
- PyObject *data_wrap;
-} BPy_IDProperty;
-
-typedef struct BPy_IDArray {
- PyObject_VAR_HEAD
- struct ID *id;
- struct IDProperty *prop;
-} BPy_IDArray;
-
-typedef struct BPy_IDGroup_Iter {
- PyObject_VAR_HEAD
- BPy_IDProperty *group;
- struct IDProperty *cur;
- int mode;
-} BPy_IDGroup_Iter;
-
-PyObject *BPy_Wrap_IDProperty(struct ID *id, struct IDProperty *prop, struct IDProperty *parent);
-void IDProp_Init_Types(void);
-
-#define IDPROP_ITER_KEYS 0
-#define IDPROP_ITER_ITEMS 1
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
deleted file mode 100644
index dc15e008209..00000000000
--- a/source/blender/python/api2_2x/Image.c
+++ /dev/null
@@ -1,1475 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Campbell Barton, Joilnen B. Leite,
- * Austin Benesh
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-#include "Image.h" /*This must come first */
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_image.h"
-#include "BKE_idprop.h"
-#include "BKE_utildefines.h"
-#include "BIF_drawimage.h"
-#include "BLI_blenlib.h"
-#include "DNA_space_types.h" /* FILE_MAXDIR = 160 */
-#include "IMB_imbuf_types.h" /* for the IB_rect define */
-#include "BIF_gl.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "BKE_packedFile.h"
-#include "DNA_packedFile_types.h"
-#include "BKE_icons.h"
-#include "IMB_imbuf.h"
-#include "IDProp.h"
-#include "GPU_draw.h"
-
-/* used so we can get G.scene->r.cfra for getting the
-current image frame, some images change frame if they are a sequence */
-#include "DNA_scene_types.h"
-
-/*****************************************************************************/
-/* Python BPy_Image defaults: */
-/*****************************************************************************/
-#define EXPP_IMAGE_REP 1
-#define EXPP_IMAGE_REP_MIN 1
-#define EXPP_IMAGE_REP_MAX 16
-
-
-enum img_consts {
- EXPP_IMAGE_ATTR_XREP = 0,
- EXPP_IMAGE_ATTR_YREP,
- EXPP_IMAGE_ATTR_START,
- EXPP_IMAGE_ATTR_END,
- EXPP_IMAGE_ATTR_SPEED,
- EXPP_IMAGE_ATTR_BINDCODE,
- EXPP_IMAGE_ATTR_SOURCE,
-};
-
-/************************/
-/*** The Image Module ***/
-/************************/
-
-/*****************************************************************************/
-/* Python API function prototypes for the Image module. */
-/*****************************************************************************/
-static PyObject *M_Image_New( PyObject * self, PyObject * args );
-static PyObject *M_Image_Get( PyObject * self, PyObject * args );
-static PyObject *M_Image_GetCurrent( PyObject * self );
-static PyObject *M_Image_Load( PyObject * self, PyObject * value );
-
-
-/*****************************************************************************/
-/* Python BPy_Image methods declarations: */
-/*****************************************************************************/
-static PyObject *Image_getFilename( BPy_Image * self );
-static PyObject *Image_getSize( BPy_Image * self );
-static PyObject *Image_getDepth( BPy_Image * self );
-static PyObject *Image_getXRep( BPy_Image * self );
-static PyObject *Image_getYRep( BPy_Image * self );
-static PyObject *Image_getBindCode( BPy_Image * self );
-static PyObject *Image_getStart( BPy_Image * self );
-static PyObject *Image_getEnd( BPy_Image * self );
-static PyObject *Image_getSpeed( BPy_Image * self );
-static int Image_setFilename( BPy_Image * self, PyObject * args );
-static PyObject *Image_oldsetFilename( BPy_Image * self, PyObject * args );
-static PyObject *Image_setXRep( BPy_Image * self, PyObject * value );
-static PyObject *Image_setYRep( BPy_Image * self, PyObject * value );
-static PyObject *Image_setStart( BPy_Image * self, PyObject * args );
-static PyObject *Image_setEnd( BPy_Image * self, PyObject * args );
-static PyObject *Image_setSpeed( BPy_Image * self, PyObject * args );
-static PyObject *Image_reload( BPy_Image * self );
-static PyObject *Image_updateDisplay( BPy_Image * self );
-static PyObject *Image_glLoad( BPy_Image * self );
-static PyObject *Image_glFree( BPy_Image * self );
-static PyObject *Image_getPixelF( BPy_Image * self, PyObject * args );
-static PyObject *Image_getPixelHDR( BPy_Image * self, PyObject * args );
-static PyObject *Image_getPixelI( BPy_Image * self, PyObject * args );
-static PyObject *Image_setPixelF( BPy_Image * self, PyObject * args );
-static PyObject *Image_setPixelHDR( BPy_Image * self, PyObject * args );
-static PyObject *Image_setPixelI( BPy_Image * self, PyObject * args );
-static PyObject *Image_getMaxXY( BPy_Image * self );
-static PyObject *Image_getMinXY( BPy_Image * self );
-static PyObject *Image_save( BPy_Image * self );
-static PyObject *Image_unpack( BPy_Image * self, PyObject * value );
-static PyObject *Image_pack( BPy_Image * self );
-static PyObject *Image_makeCurrent( BPy_Image * self );
-
-
-/*****************************************************************************/
-/* Python BPy_Image methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Image_methods[] = {
- /* name, method, flags, doc */
- {"getPixelF", ( PyCFunction ) Image_getPixelF, METH_VARARGS,
- "(int, int) - Get pixel color as floats returns [r,g,b,a]"},
- {"getPixelHDR", ( PyCFunction ) Image_getPixelHDR, METH_VARARGS,
- "(int, int) - Get pixel color as floats returns [r,g,b,a]"},
- {"getPixelI", ( PyCFunction ) Image_getPixelI, METH_VARARGS,
- "(int, int) - Get pixel color as ints 0-255 returns [r,g,b,a]"},
- {"setPixelF", ( PyCFunction ) Image_setPixelF, METH_VARARGS,
- "(int, int, [f r,f g,f b,f a]) - Set pixel color using floats"},
- {"setPixelHDR", ( PyCFunction ) Image_setPixelHDR, METH_VARARGS,
- "(int, int, [f r,f g,f b,f a]) - Set pixel color using floats"},
- {"setPixelI", ( PyCFunction ) Image_setPixelI, METH_VARARGS,
- "(int, int, [i r, i g, i b, i a]) - Set pixel color using ints 0-255"},
- {"getMaxXY", ( PyCFunction ) Image_getMaxXY, METH_NOARGS,
- "() - Get maximum x & y coordinates of current image as [x, y]"},
- {"getMinXY", ( PyCFunction ) Image_getMinXY, METH_NOARGS,
- "() - Get minimun x & y coordinates of image as [x, y]"},
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Image object name"},
- {"getFilename", ( PyCFunction ) Image_getFilename, METH_NOARGS,
- "() - Return Image object filename"},
- {"getSize", ( PyCFunction ) Image_getSize, METH_NOARGS,
- "() - Return Image object [width, height] dimension in pixels"},
- {"getDepth", ( PyCFunction ) Image_getDepth, METH_NOARGS,
- "() - Return Image object pixel depth"},
- {"getXRep", ( PyCFunction ) Image_getXRep, METH_NOARGS,
- "() - Return Image object x repetition value"},
- {"getYRep", ( PyCFunction ) Image_getYRep, METH_NOARGS,
- "() - Return Image object y repetition value"},
- {"getStart", ( PyCFunction ) Image_getStart, METH_NOARGS,
- "() - Return Image object start frame."},
- {"getEnd", ( PyCFunction ) Image_getEnd, METH_NOARGS,
- "() - Return Image object end frame."},
- {"getSpeed", ( PyCFunction ) Image_getSpeed, METH_NOARGS,
- "() - Return Image object speed (fps)."},
- {"getBindCode", ( PyCFunction ) Image_getBindCode, METH_NOARGS,
- "() - Return Image object's bind code value"},
- {"reload", ( PyCFunction ) Image_reload, METH_NOARGS,
- "() - Reload the image from the filesystem"},
- {"updateDisplay", ( PyCFunction ) Image_updateDisplay, METH_NOARGS,
- "() - Update the display image from the floating point buffer (if it exists)"},
- {"glLoad", ( PyCFunction ) Image_glLoad, METH_NOARGS,
- "() - Load the image data in OpenGL texture memory.\n\
- The bindcode (int) is returned."},
- {"glFree", ( PyCFunction ) Image_glFree, METH_NOARGS,
- "() - Free the image data from OpenGL texture memory only,\n\
- see also image.glLoad()."},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - Change Image object name"},
- {"setFilename", ( PyCFunction ) Image_oldsetFilename, METH_VARARGS,
- "(str) - Change Image file name"},
- {"setXRep", ( PyCFunction ) Image_setXRep, METH_O,
- "(int) - Change Image object x repetition value"},
- {"setYRep", ( PyCFunction ) Image_setYRep, METH_O,
- "(int) - Change Image object y repetition value"},
- {"setStart", ( PyCFunction ) Image_setStart, METH_VARARGS,
- "(int) - Change Image object animation start value"},
- {"setEnd", ( PyCFunction ) Image_setEnd, METH_VARARGS,
- "(int) - Change Image object animation end value"},
- {"setSpeed", ( PyCFunction ) Image_setSpeed, METH_VARARGS,
- "(int) - Change Image object animation speed (fps)"},
- {"save", ( PyCFunction ) Image_save, METH_NOARGS,
- "() - Write image buffer to file"},
- {"unpack", ( PyCFunction ) Image_unpack, METH_O,
- "(int) - Unpack image. Uses the values defined in Blender.UnpackModes."},
- {"pack", ( PyCFunction ) Image_pack, METH_NOARGS,
- "() - Pack the image"},
- {"makeCurrent", ( PyCFunction ) Image_makeCurrent, METH_NOARGS,
- "() - Make this the currently displayed image"},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Image.__doc__ */
-/*****************************************************************************/
-static char M_Image_doc[] = "The Blender Image module\n\n";
-
-static char M_Image_New_doc[] =
- "(name, width, height, depth) - all args are optional, return a new Image object";
-
-static char M_Image_Get_doc[] =
- "(name) - return the image with the name 'name', \
-returns None if not found.\n If 'name' is not specified, \
-it returns a list of all images in the\ncurrent scene.";
-
-static char M_Image_GetCurrent_doc[] =
- "() - return the current image, from last active the uv/image view, \
-returns None no image is in the view.\n";
-
-static char M_Image_Load_doc[] =
- "(filename) - return image from file filename as Image Object, \
-returns None if not found.\n";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Image module: */
-/*****************************************************************************/
-struct PyMethodDef M_Image_methods[] = {
- {"New", M_Image_New, METH_VARARGS, M_Image_New_doc},
- {"Get", M_Image_Get, METH_VARARGS, M_Image_Get_doc},
- {"GetCurrent", ( PyCFunction ) M_Image_GetCurrent, METH_NOARGS, M_Image_GetCurrent_doc},
- {"get", M_Image_Get, METH_VARARGS, M_Image_Get_doc},
- {"Load", M_Image_Load, METH_O, M_Image_Load_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Function: M_Image_New */
-/* Python equivalent: Blender.Image.New */
-/*****************************************************************************/
-static PyObject *M_Image_New( PyObject * self, PyObject * args)
-{
- int width, height, depth;
- char *name;
- float color[] = {0, 0, 0, 1};
- Image *image;
- if( !PyArg_ParseTuple( args, "siii", &name, &width, &height, &depth ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1 string and 3 ints" ) );
- if (width > 5000 || height > 5000 || width < 1 || height < 1)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Image width and height must be between 1 and 5000" ) );
- image = BKE_add_image_size(width, height, name, depth==128 ? 1 : 0, 0, color);
- if( !image )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyObject Image_Type" ) );
-
- /* reset usage count, since BKE_add_image_size() incremented it */
- /* image->id.us--; */
- /* Strange, new images have a user count of one???, otherwise it messes up */
-
- return Image_CreatePyObject( image );
-}
-
-
-
-/*****************************************************************************/
-/* Function: M_Image_Get */
-/* Python equivalent: Blender.Image.Get */
-/* Description: Receives a string and returns the image object */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all image names in the */
-/* current scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Image_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Image *img_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- img_iter = G.main->image.first;
-
- if( name ) { /* (name) - Search image by name */
-
- BPy_Image *wanted_image = NULL;
-
- while( ( img_iter ) && ( wanted_image == NULL ) ) {
- if( strcmp( name, img_iter->id.name + 2 ) == 0 ) {
- wanted_image = ( BPy_Image * )
- PyObject_NEW( BPy_Image, &Image_Type );
- if( wanted_image )
- wanted_image->image = img_iter;
- }
- img_iter = img_iter->id.next;
- }
-
- if( wanted_image == NULL ) { /* Requested image doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Image \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_image;
- }
-
- else { /* () - return a list of all images in the scene */
- int index = 0;
- PyObject *img_list, *pyobj;
-
- img_list = PyList_New( BLI_countlist( &( G.main->image ) ) );
-
- if( img_list == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( img_iter ) {
- pyobj = Image_CreatePyObject( img_iter );
-
- PyList_SET_ITEM( img_list, index, pyobj );
-
- img_iter = img_iter->id.next;
- index++;
- }
-
- return ( img_list );
- }
-}
-
-
-
-/*****************************************************************************/
-/* Function: M_Image_GetCurrent*/
-/* Python equivalent: Blender.Image.GetCurrent */
-/* Description: Returns the active current (G.sima) */
-/* This will be the image last under the mouse cursor */
-/* None if there is no Image. */
-/*****************************************************************************/
-static PyObject *M_Image_GetCurrent( PyObject * self )
-{
- if (!G.sima || !G.sima->image) {
- Py_RETURN_NONE;
- }
- what_image( G.sima ); /* make sure image data exists */
- return Image_CreatePyObject( G.sima->image );
-}
-
-
-/*****************************************************************************/
-/* Function: M_Image_Load */
-/* Python equivalent: Blender.Image.Load */
-/* Description: Receives a string and returns the image object */
-/* whose filename matches the string. */
-/*****************************************************************************/
-static PyObject *M_Image_Load( PyObject * self, PyObject * value )
-{
- char *fname = PyString_AsString(value);
- Image *img_ptr;
- BPy_Image *image;
-
- if( !value )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" ) );
-
- image = ( BPy_Image * ) PyObject_NEW( BPy_Image, &Image_Type );
-
- if( !image )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyObject Image_Type" ) );
-
- img_ptr = BKE_add_image_file( fname );
- if( !img_ptr )
- return ( EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load image" ) );
-
- /* force a load the image buffers*/
- BKE_image_get_ibuf(img_ptr, NULL);
-
- image->image = img_ptr;
-
- return ( PyObject * ) image;
-}
-
-
-/**
- * getPixelHDR( x, y )
- * returns float list of pixel colors in rgba order.
- * returned values are floats , in the full range of the float image source.
- */
-
-static PyObject *Image_getPixelHDR( BPy_Image * self, PyObject * args )
-{
-
- PyObject *attr;
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int pixel_size = 4; /* each pixel is 4 x 32 bit float */
- int i;
-
- if( !PyArg_ParseTuple( args, "ii", &x, &y ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers" );
-
- if( !ibuf || (!ibuf->rect_float && !ibuf->rect)) /* loading didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of range" );
-
- /*
- assumption: from looking at source, skipx is often not set,
- so we calc ourselves
- */
-
- attr = PyList_New(4);
-
- if (!attr)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't allocate memory for color list" );
-
- index = ( x + y * ibuf->x ) * pixel_size;
-
- /* if a float buffer exists, use it, otherwise convert the 8bpc buffer to float values */
- if (ibuf->rect_float) {
- float *pixelf; /* image data */
-
- pixelf = ibuf->rect_float;
- for (i=0; i<4; i++) {
- PyList_SetItem( attr, i, PyFloat_FromDouble( (double)pixelf[index+i] ) );
- }
- } else {
- char *pixelc; /* image data */
-
- pixelc = ( char * ) ibuf->rect;
- for (i=0; i<4; i++) {
- PyList_SetItem( attr, i, PyFloat_FromDouble( ( ( double ) pixelc[index+i] ) / 255.0 ));
- }
- }
- return attr;
-}
-
-/**
- * getPixelI( x, y )
- * returns integer list of pixel colors in rgba order.
- * returned values are ints normalized to 0-255.
- * blender images are all 4x8 bit at the moment apr-2005
- */
-
-static PyObject *Image_getPixelI( BPy_Image * self, PyObject * args )
-{
- PyObject *attr = PyList_New(4);
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- char *pixel; /* image data */
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int pixel_size = 4; /* each pixel is 4 x 8-bits packed in unsigned int */
- int i;
-
- if (!attr)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't allocate memory for color list" );
-
- if( !PyArg_ParseTuple( args, "ii", &x, &y ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers" );
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of range" );
-
- /*
- assumption: from looking at source, skipx is often not set,
- so we calc ourselves
- */
-
- index = ( x + y * ibuf->x ) * pixel_size;
- pixel = ( char * ) ibuf->rect;
-
- for (i=0; i<4; i++) {
- PyList_SetItem( attr, i, PyInt_FromLong( pixel[index+i] ));
- }
- return attr;
-}
-
-
-/**
- * getPixelF( x, y )
- * returns float list of pixel colors in rgba order.
- * returned values are floats normalized to 0.0 - 1.0.
- * blender images are all 4x8 bit at the moment apr-2005
- */
-
-static PyObject *Image_getPixelF( BPy_Image * self, PyObject * args )
-{
-
- PyObject *attr;
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- char *pixel; /* image data */
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int pixel_size = 4; /* each pixel is 4 x 8-bits packed in unsigned int */
- int i;
-
- if( !PyArg_ParseTuple( args, "ii", &x, &y ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers" );
-
- if( !ibuf || !ibuf->rect ) /* loading didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of range" );
-
- /*
- assumption: from looking at source, skipx is often not set,
- so we calc ourselves
- */
-
- attr = PyList_New(4);
-
- if (!attr)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't allocate memory for color list" );
-
- index = ( x + y * ibuf->x ) * pixel_size;
-
- pixel = ( char * ) ibuf->rect;
- for (i=0; i<4; i++) {
- PyList_SetItem( attr, i, PyFloat_FromDouble( ( ( double ) pixel[index+i] ) / 255.0 ));
- }
- return attr;
-}
-
-/* set pixel as floats */
-
-static PyObject *Image_setPixelHDR( BPy_Image * self, PyObject * args )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- float *pixel; /* image data */
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int pixel_size = 4; /* each pixel is 4 x 32 bit float */
- float p[4];
-
- if( !PyArg_ParseTuple
- ( args, "ii(ffff)", &x, &y, &p[0], &p[1], &p[2], &p[3] ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers and an array of 4 floats" );
-
- if( !ibuf ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of range" );
-
- /* if no float buffer already exists, add it */
- if (!ibuf->rect_float) imb_addrectfloatImBuf(ibuf);
-
- index = ( x + y * ibuf->x ) * pixel_size;
-
- pixel = ibuf->rect_float + index;
-
- QUATCOPY(pixel, p);
-
- ibuf->userflags |= IB_BITMAPDIRTY;
- Py_RETURN_NONE;
-}
-
-
-/* set pixel as ints */
-
-static PyObject *Image_setPixelI( BPy_Image * self, PyObject * args )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- char *pixel; /* image data */
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int a = 0;
- int pixel_size = 4; /* each pixel is 4 x 8-bits packed in unsigned int */
- int p[4];
-
- if( !PyArg_ParseTuple
- ( args, "ii(iiii)", &x, &y, &p[0], &p[1], &p[2], &p[3] ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers and an list of 4 ints" );
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of range" );
-
- for( a = 0; a < 4; a++ ) {
- if( p[a] > 255 || p[a] < 0 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "r, g, b, or a is out of range" );
- }
-
- /*
- assumption: from looking at source, skipx is often not set,
- so we calc ourselves
- */
-
- index = ( x + y * ibuf->x ) * pixel_size;
-
- pixel = ( char * ) ibuf->rect;
-
- pixel[index] = ( char ) p[0];
- pixel[index + 1] = ( char ) p[1];
- pixel[index + 2] = ( char ) p[2];
- pixel[index + 3] = ( char ) p[3];
-
- ibuf->userflags |= IB_BITMAPDIRTY;
- Py_RETURN_NONE;
-}
-
-/* set pixel as floats */
-
-static PyObject *Image_setPixelF( BPy_Image * self, PyObject * args )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- char *pixel; /* image data */
- int index; /* offset into image data */
- int x = 0;
- int y = 0;
- int a = 0;
- int pixel_size = 4; /* each pixel is 4 x 8-bits packed in unsigned int */
- float p[4];
-
- if( !PyArg_ParseTuple
- ( args, "ii(ffff)", &x, &y, &p[0], &p[1], &p[2], &p[3] ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 integers and an array of 4 floats" );
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if( ibuf->type == 1 ) /* bitplane image */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unsupported bitplane image format" );
-
- if( x > ( ibuf->x - 1 )
- || y > ( ibuf->y - 1 )
- || x < ibuf->xorig || y < ibuf->yorig )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "x or y is out of ruange" );
-
- for( a = 0; a < 4; a++ ) {
- if( p[a] > 1.0 || p[a] < 0.0 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "r, g, b, or a is out of range" );
- }
-
-
- /*
- assumption: from looking at source, skipx is often not set,
- so we calc ourselves
- */
-
- index = ( x + y * ibuf->x ) * pixel_size;
-
- pixel = ( char * ) ibuf->rect;
-
- pixel[index] = ( char ) ( p[0] * 255.0 );
- pixel[index + 1] = ( char ) ( p[1] * 255.0 );
- pixel[index + 2] = ( char ) ( p[2] * 255.0 );
- pixel[index + 3] = ( char ) ( p[3] * 255.0 );
-
- ibuf->userflags |= IB_BITMAPDIRTY;
- Py_RETURN_NONE;
-}
-
-/* get max extent of image */
-
-static PyObject *Image_getMaxXY( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- return Py_BuildValue( "[i,i]", ibuf->x, ibuf->y );
-}
-
-
-/* get min extent of image */
-
-static PyObject *Image_getMinXY( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- return Py_BuildValue( "[i,i]", ibuf->xorig, ibuf->yorig );
-}
-
-/* unpack image */
-
-static PyObject *Image_unpack( BPy_Image * self, PyObject * value )
-{
- Image *image = self->image;
- int mode = (int)PyInt_AsLong(value);
-
- /*get the absolute path */
- if( mode==-1 )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1 integer from Blender.UnpackModes" );
-
- if (image->packedfile==NULL)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "image not packed" );
-
- if (unpackImage(image, mode) == RET_ERROR)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error unpacking image" );
- Py_RETURN_NONE;
-}
-
-/* pack image */
-
-static PyObject *Image_pack( BPy_Image * self )
-{
- Image *image = self->image;
- ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
-
- if( !ibuf || !ibuf->rect ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- if (image->packedfile ) { /* RePack? */
- if (ibuf->userflags & IB_BITMAPDIRTY)
- BKE_image_memorypack(image);
- } else { /* Pack for the first time */
- if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- BKE_image_memorypack(image);
- else
- image->packedfile = newPackedFile(image->name);
- }
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Image_makeCurrent( BPy_Image * self )
-{
-#if 0 /* add back in when bpy becomes "official" */
- static char warning = 1;
- if( warning ) {
- printf("image.makeCurrent() deprecated!\n\t use 'bpy.images.active = image instead'\n");
- --warning;
- }
-#endif
-
- if (!G.sima)
- Py_RETURN_FALSE;
-
- G.sima->image= self->image;
- Py_RETURN_TRUE;
-}
-
-
-/* save image to file */
-
-static PyObject *Image_save( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if(!ibuf)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not save image (no image buffer)" );
-
- /* If this is a packed file, write using writePackedFile
- * because IMB_saveiff wont save to a file */
- if (self->image->packedfile) {
- if (writePackedFile(self->image->name, self->image->packedfile, 0) != RET_OK) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not save image (writing image from packedfile failed)" );
- }
- } else if (!IMB_saveiff( ibuf, self->image->name, ibuf->flags))
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not save image (writing the image buffer failed)" );
-
- Py_RETURN_NONE; /* normal return, image saved */
-}
-
-static PyObject *M_Image_SourceDict( void )
-{
- PyObject *Dict = PyConstant_New( );
- if( Dict ) {
- BPy_constant *d = ( BPy_constant * ) Dict;
- PyConstant_Insert(d, "STILL", PyInt_FromLong(IMA_SRC_FILE));
- PyConstant_Insert(d, "MOVIE", PyInt_FromLong(IMA_SRC_MOVIE));
- PyConstant_Insert(d, "SEQUENCE", PyInt_FromLong(IMA_SRC_SEQUENCE));
- PyConstant_Insert(d, "GENERATED", PyInt_FromLong(IMA_SRC_GENERATED));
- }
- return Dict;
-}
-
-/*****************************************************************************/
-/* Function: Image_Init */
-/*****************************************************************************/
-PyObject *Image_Init( void )
-{
- PyObject *submodule;
- PyObject *Sources = M_Image_SourceDict( );
-
- if( PyType_Ready( &Image_Type ) < 0 )
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Image", M_Image_methods,
- M_Image_doc );
-
- if( Sources )
- PyModule_AddObject( submodule, "Sources", Sources );
-
- return submodule;
-}
-
-/*****************************************************************************/
-/* Python Image_Type callback function prototypes: */
-/*****************************************************************************/
-static int Image_compare( BPy_Image * a, BPy_Image * b );
-static PyObject *Image_repr( BPy_Image * self );
-
-/*****************************************************************************/
-/* Function: Image_CreatePyObject */
-/* Description: This function will create a new BPy_Image from an existing */
-/* Blender image structure. */
-/*****************************************************************************/
-PyObject *Image_CreatePyObject( Image * image )
-{
- BPy_Image *py_img;
- py_img = ( BPy_Image * ) PyObject_NEW( BPy_Image, &Image_Type );
-
- if( !py_img )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Image object" );
-
- py_img->image = image;
- return ( PyObject * ) py_img;
-}
-
-/*****************************************************************************/
-/* Function: Image_FromPyObject */
-/* Description: Returns the Blender Image associated with this object */
-/*****************************************************************************/
-Image *Image_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Image * ) pyobj )->image;
-}
-
-static PyObject *Image_getFilename( BPy_Image * self )
-{
- return PyString_FromString( self->image->name );
-}
-
-static PyObject *Image_getSize( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
- PyObject *attr;
-
- if( !ibuf ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- attr = PyList_New(2);
-
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Image.size attribute" );
-
- PyList_SetItem( attr, 0, PyInt_FromLong(ibuf->x));
- PyList_SetItem( attr, 1, PyInt_FromLong(ibuf->y));
- return attr;
-}
-
-static PyObject *Image_getDepth( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if( !ibuf ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
- if (ibuf->rect_float) {
- return PyInt_FromLong( (long)128 );
- } else {
- return PyInt_FromLong( (long)ibuf->depth );
- }
-}
-
-
-static PyObject *Image_getXRep( BPy_Image * self )
-{
- return PyInt_FromLong( self->image->xrep );
-}
-
-static PyObject *Image_getYRep( BPy_Image * self )
-{
- return PyInt_FromLong( self->image->yrep );
-}
-
-static PyObject *Image_getStart( BPy_Image * self )
-{
- return PyInt_FromLong( self->image->twsta );
-}
-
-static PyObject *Image_getEnd( BPy_Image * self )
-{
- return PyInt_FromLong( self->image->twend );
-}
-
-static PyObject *Image_getSpeed( BPy_Image * self )
-{
- return PyInt_FromLong( self->image->animspeed );
-}
-
-static PyObject *Image_getBindCode( BPy_Image * self )
-{
- return PyLong_FromUnsignedLong( self->image->bindcode );
-}
-
-static PyObject *Image_reload( BPy_Image * self )
-{
- Image *image = self->image;
-
- BKE_image_signal(image, NULL, IMA_SIGNAL_RELOAD);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Image_updateDisplay( BPy_Image * self )
-{
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if( !ibuf ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- IMB_rect_from_float(ibuf);
-
- Py_RETURN_NONE;
-}
-
-
-
-static PyObject *Image_glFree( BPy_Image * self )
-{
- Image *image = self->image;
-
- GPU_free_image( image );
- /* remove the nocollect flag, image is available for garbage collection again */
- image->flag &= ~IMA_NOCOLLECT;
- Py_RETURN_NONE;
-}
-
-static PyObject *Image_glLoad( BPy_Image * self )
-{
- Image *image = self->image;
- unsigned int *bind = &image->bindcode;
-
- if( *bind == 0 ) {
- ImBuf *ibuf= BKE_image_get_ibuf(self->image, NULL);
-
- if( !ibuf ) /* didn't work */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't load image data in Blender" );
-
- glGenTextures( 1, ( GLuint * ) bind );
- glBindTexture( GL_TEXTURE_2D, *bind );
-
- gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGBA, ibuf->x,
- ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE,
- ibuf->rect );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_NEAREST );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
- GL_LINEAR );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
-
- glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x,
- ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE,
- ibuf->rect );
-
- /* raise the nocollect flag,
- image is not available for garbage collection
- (python GL might use it directly)
- */
- image->flag |= IMA_NOCOLLECT;
- }
-
- return PyLong_FromUnsignedLong( image->bindcode );
-}
-
-static int Image_setFilename( BPy_Image * self, PyObject * value )
-{
- char *name;
-
- name = PyString_AsString(value);
-
- if( !name )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected a string argument" ) );
-
- /* max len is FILE_MAXDIR == 160, FILE_MAXFILE == 80 chars like done in DNA_image_types.h */
- if( strlen(name) >= FILE_MAXDIR + FILE_MAXFILE )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "string argument is limited to 240 chars at most" ) );
-
- strcpy( self->image->name, name );
- return 0;
-}
-
-static PyObject *Image_oldsetFilename( BPy_Image * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Image_setFilename );
-}
-
-static PyObject *Image_setXRep( BPy_Image * self, PyObject * value )
-{
- short param = (short)PyInt_AsLong(value);
-
- if( param !=-1 && param >= EXPP_IMAGE_REP_MIN && param <= EXPP_IMAGE_REP_MAX)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument in [1,16]" ) );
-
- self->image->xrep = param;
- Py_RETURN_NONE;
-}
-
-static PyObject *Image_setYRep( BPy_Image * self, PyObject * value )
-{
- short param = (short)PyInt_AsLong(value);
-
- if( param !=-1 && param >= EXPP_IMAGE_REP_MIN && param <= EXPP_IMAGE_REP_MAX)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument in [1,16]" ) );
-
- self->image->yrep = param;
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Image_setStart( BPy_Image * self, PyObject * args )
-{
- short value;
-
- if( !PyArg_ParseTuple( args, "h", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument in [0,128]" ) );
-
- if( value >= 0 && value <= 128 )
- self->image->twsta = value;
- else
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int argument in [0,128]" ) );
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Image_setEnd( BPy_Image * self, PyObject * args )
-{
- short value;
-
- if( !PyArg_ParseTuple( args, "h", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument in [0,128]" ) );
-
- if( value >= 0 && value <= 128 )
- self->image->twend = value;
- else
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int argument in [0,128]" ) );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Image_setSpeed( BPy_Image * self, PyObject * args )
-{
- short value;
-
- if( !PyArg_ParseTuple( args, "h", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument in [0,128]" ) );
-
- if( value >= 1 && value <= 100 )
- self->image->animspeed = value;
- else
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int argument in [0,128]" ) );
-
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************/
-/* Function: Image_compare */
-/* Description: This is a callback function for the BPy_Image type. It */
-/* compares two Image_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Image struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Image_compare( BPy_Image * a, BPy_Image * b )
-{
- return ( a->image == b->image ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Image_repr */
-/* Description: This is a callback function for the BPy_Image type. It */
-/* builds a meaninful string to represent image objects. */
-/*****************************************************************************/
-static PyObject *Image_repr( BPy_Image * self )
-{
- return PyString_FromFormat( "[Image \"%s\"]",
- self->image->id.name + 2 );
-}
-
-static PyObject *Image_getPacked(BPy_Image *self, void *closure)
-{
- if (self->image->packedfile)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static PyObject *Image_hasData(BPy_Image *self, void *closure)
-{
- if (self->image->ibufs.first)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static PyObject *Image_getFlag(BPy_Image *self, void *flag)
-{
- if (self->image->flag & GET_INT_FROM_POINTER(flag))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-
-}
-
-static PyObject *Image_getFlagTpage(BPy_Image *self, void *flag)
-{
- if (self->image->tpageflag & GET_INT_FROM_POINTER(flag))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-
-}
-
-static int Image_setSource( BPy_Image *self, PyObject *args)
-{
- PyObject* integer = PyNumber_Int( args );
- short value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( short )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
-
- if( value < IMA_SRC_FILE || value > IMA_SRC_GENERATED )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected integer argument in range 1-4" );
-
- self->image->source = value;
- return 0;
-}
-
-static int Image_setFlag(BPy_Image *self, PyObject *value, void *flag)
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if ( param )
- self->image->flag |= GET_INT_FROM_POINTER(flag);
- else
- self->image->flag &= ~GET_INT_FROM_POINTER(flag);
- return 0;
-}
-
-static int Image_setFlagTpage(BPy_Image *self, PyObject *value, void *flag)
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if ( param )
- self->image->tpageflag |= GET_INT_FROM_POINTER(flag);
- else
- self->image->tpageflag &= ~GET_INT_FROM_POINTER(flag);
- return 0;
-}
-
-/*
- * get integer attributes
- */
-static PyObject *getIntAttr( BPy_Image *self, void *type )
-{
- int param;
- struct Image *image = self->image;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_IMAGE_ATTR_XREP:
- param = image->xrep;
- break;
- case EXPP_IMAGE_ATTR_YREP:
- param = image->xrep;
- break;
- case EXPP_IMAGE_ATTR_START:
- param = image->twsta;
- break;
- case EXPP_IMAGE_ATTR_END:
- param = image->twend;
- break;
- case EXPP_IMAGE_ATTR_SPEED:
- param = image->animspeed;
- break;
- case EXPP_IMAGE_ATTR_BINDCODE:
- param = image->bindcode;
- break;
- case EXPP_IMAGE_ATTR_SOURCE:
- param = image->source;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getIntAttr" );
- }
-
- return PyInt_FromLong( param );
-}
-
-
-/*
- * set integer attributes which require clamping
- */
-
-static int setIntAttrClamp( BPy_Image *self, PyObject *value, void *type )
-{
- void *param;
- struct Image *image = self->image;
- int min, max, size;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_IMAGE_ATTR_XREP:
- min = EXPP_IMAGE_REP_MIN;
- max = EXPP_IMAGE_REP_MAX;
- size = 'h';
- param = (void *)&image->xrep;
- break;
- case EXPP_IMAGE_ATTR_YREP:
- min = EXPP_IMAGE_REP_MIN;
- max = EXPP_IMAGE_REP_MAX;
- size = 'h';
- param = (void *)&image->yrep;
- break;
- case EXPP_IMAGE_ATTR_START:
- min = 0;
- max = 128;
- size = 'h';
- param = (void *)&image->twsta;
- break;
- case EXPP_IMAGE_ATTR_END:
- min = 0;
- max = 128;
- size = 'h';
- param = (void *)&image->twend;
- break;
- case EXPP_IMAGE_ATTR_SPEED:
- min = 0;
- max = 100;
- size = 'h';
- param = (void *)&image->animspeed;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setIntAttrClamp");
- }
- return EXPP_setIValueClamped( value, param, min, max, size );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Image_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"filename", (getter)Image_getFilename, (setter)Image_setFilename,
- "image path", NULL},
- /* readonly */
- {"depth", (getter)Image_getDepth, (setter)NULL,
- "image depth", NULL},
- {"size", (getter)Image_getSize, (setter)NULL,
- "image size", NULL},
- {"packed", (getter)Image_getPacked, (setter)NULL,
- "image packed state", NULL },
- {"has_data", (getter)Image_hasData, (setter)NULL,
- "is image data loaded", NULL },
- /* ints */
- {"xrep", (getter)getIntAttr, (setter)setIntAttrClamp,
- "image xrep", (void *)EXPP_IMAGE_ATTR_XREP },
- {"yrep", (getter)getIntAttr, (setter)setIntAttrClamp,
- "image yrep", (void *)EXPP_IMAGE_ATTR_YREP },
- {"start", (getter)getIntAttr, (setter)setIntAttrClamp,
- "image start frame", (void *)EXPP_IMAGE_ATTR_START },
- {"end", (getter)getIntAttr, (setter)setIntAttrClamp,
- "image end frame", (void *)EXPP_IMAGE_ATTR_END },
- {"speed", (getter)getIntAttr, (setter)setIntAttrClamp,
- "image end frame", (void *)EXPP_IMAGE_ATTR_SPEED },
- {"bindcode", (getter)getIntAttr, (setter)NULL,
- "openGL bindcode", (void *)EXPP_IMAGE_ATTR_BINDCODE },
- {"source", (getter)getIntAttr, (setter)Image_setSource,
- "image source type", (void *)EXPP_IMAGE_ATTR_SOURCE },
- /* flags */
- {"fields", (getter)Image_getFlag, (setter)Image_setFlag,
- "image fields toggle", (void *)IMA_FIELDS },
- {"fields_odd", (getter)Image_getFlag, (setter)Image_setFlag,
- "image odd fields toggle", (void *)IMA_STD_FIELD },
- {"antialias", (getter)Image_getFlag, (setter)Image_setFlag,
- "image antialiasing toggle", (void *)IMA_ANTIALI },
- {"premul", (getter)Image_getFlag, (setter)Image_setFlag,
- "image premultiply alpha toggle", (void *)IMA_DO_PREMUL },
- {"reflect", (getter)Image_getFlag, (setter)Image_setFlag,
- "image reflect toggle", (void *)IMA_REFLECT },
- {"clampX", (getter)Image_getFlagTpage, (setter)Image_setFlagTpage,
- "disable tiling on the X axis", (void *)IMA_CLAMP_U },
- {"clampY", (getter)Image_getFlagTpage, (setter)Image_setFlagTpage,
- "disable tiling on the Y axis", (void *)IMA_CLAMP_V },
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*****************************************************************************/
-/* Python Image_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Image_Type = {
- PyObject_HEAD_INIT( NULL ) /* required macro. ( no comma needed ) */
- 0, /* ob_size */
- "Blender Image", /* tp_name */
- sizeof( BPy_Image ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Image_compare, /* tp_compare */
- ( reprfunc ) Image_repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Image_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Image_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/Image.h b/source/blender/python/api2_2x/Image.h
deleted file mode 100644
index c8c424ec2f2..00000000000
--- a/source/blender/python/api2_2x/Image.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Alex Mole
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_IMAGE_H
-#define EXPP_IMAGE_H
-
-#include <Python.h>
-#include "DNA_image_types.h"
-
-
-/*****************************************************************************/
-/* Python BPy_Image structure definition */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- Image * image; /* libdata must be second */
-
-} BPy_Image;
-
-extern PyTypeObject Image_Type; /* The Image PyType Object */
-
-#define BPy_Image_Check(v) ((v)->ob_type == &Image_Type) /*for type checking */
-
-/*****************************************************************************/
-/* Module Blender.Image - public functions */
-/*****************************************************************************/
-PyObject *Image_Init( void );
-PyObject *Image_CreatePyObject( Image * image );
-Image *Image_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_IMAGE_H */
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
deleted file mode 100644
index e6c67534a36..00000000000
--- a/source/blender/python/api2_2x/Ipo.c
+++ /dev/null
@@ -1,1838 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot RIP 2005, Nathan Letwory,
- * Stephen Swaney, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Ipo.h" /*This must come first*/
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_object.h"
-#include "BKE_ipo.h"
-#include "BLI_blenlib.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "BSE_editipo.h"
-#include "MEM_guardedalloc.h"
-#include "DNA_key_types.h"
-#include "mydevice.h"
-#include "Ipocurve.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-extern int ob_ar[];
-extern int la_ar[];
-extern int ma_ar[];
-extern int ac_ar[];
-extern int cam_ar[];
-extern int co_ar[];
-extern int cu_ar[];
-extern int seq_ar[];
-extern int te_ar[];
-extern int wo_ar[];
-
-PyObject *submodule;
-
-/*****************************************************************************/
-/* Python API function prototypes for the Ipo module. */
-/*****************************************************************************/
-static PyObject *M_Ipo_New( PyObject * self, PyObject * args );
-static PyObject *M_Ipo_Get( PyObject * self, PyObject * args );
-static PyObject *M_Ipo_Recalc( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Ipo.__doc__ */
-/*****************************************************************************/
-char M_Ipo_doc[] = "";
-char M_Ipo_New_doc[] = "";
-char M_Ipo_Get_doc[] = "";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Ipo module: */
-/*****************************************************************************/
-
-struct PyMethodDef M_Ipo_methods[] = {
- {"New", ( PyCFunction ) M_Ipo_New, METH_VARARGS | METH_KEYWORDS,
- M_Ipo_New_doc},
- {"Get", M_Ipo_Get, METH_VARARGS, M_Ipo_Get_doc},
- {"get", M_Ipo_Get, METH_VARARGS, M_Ipo_Get_doc},
- {"Recalc", M_Ipo_Recalc, METH_O, M_Ipo_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Ipo methods declarations: */
-/*****************************************************************************/
-static PyObject *Ipo_getBlocktype( BPy_Ipo * self );
-static PyObject *Ipo_oldsetBlocktype( BPy_Ipo * self, PyObject * args );
-static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getRctf( BPy_Ipo * self );
-static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args );
-static int Ipo_setRctf( BPy_Ipo * self, PyObject * args );
-
-static PyObject *Ipo_getCurve( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getCurves( BPy_Ipo * self );
-static PyObject *Ipo_getCurveNames( BPy_Ipo * self );
-static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * value );
-static PyObject *Ipo_delCurve( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getNcurves( BPy_Ipo * self );
-static PyObject *Ipo_getNBezPoints( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getCurvecurval( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_EvaluateCurveOn( BPy_Ipo * self, PyObject * args );
-
-static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args );
-static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args );
-
-static PyObject *Ipo_getChannel( BPy_Ipo * self );
-static PyObject *Ipo_copy( BPy_Ipo * self );
-static int Ipo_setChannel( BPy_Ipo * self, PyObject * args );
-
-static int Ipo_length( BPy_Ipo * inst );
-static PyObject *Ipo_getIpoCurveByName( BPy_Ipo * self, PyObject * key );
-static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key,
- PyObject * value );
-static int Ipo_contains( BPy_Ipo * self, PyObject * key );
-
-/*****************************************************************************/
-/* Python BPy_Ipo methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Ipo_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Ipo Data name"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - Change Ipo Data name"},
- {"getBlocktype", ( PyCFunction ) Ipo_getBlocktype, METH_NOARGS,
- "() - Return Ipo blocktype"},
- {"setBlocktype", ( PyCFunction ) Ipo_oldsetBlocktype, METH_VARARGS,
- "(str) - Change Ipo blocktype"},
- {"getRctf", ( PyCFunction ) Ipo_getRctf, METH_NOARGS,
- "() - Return Ipo rctf"},
- {"setRctf", ( PyCFunction ) Ipo_oldsetRctf, METH_VARARGS,
- "(flt,flt,flt,flt) - Change Ipo rctf"},
- {"addCurve", ( PyCFunction ) Ipo_addCurve, METH_O,
- "() - Add a curve to Ipo"},
- {"delCurve", ( PyCFunction ) Ipo_delCurve, METH_VARARGS,
- "(str) - Delete curve from Ipo"},
- {"getNcurves", ( PyCFunction ) Ipo_getNcurves, METH_NOARGS,
- "() - Return number of Ipo curves"},
- {"getCurves", ( PyCFunction ) Ipo_getCurves, METH_NOARGS,
- "() - Return list of all defined Ipo curves"},
- {"getCurve", ( PyCFunction ) Ipo_getCurve, METH_VARARGS,
- "(str|int) - Returns specified Ipo curve"},
- {"getNBezPoints", ( PyCFunction ) Ipo_getNBezPoints, METH_VARARGS,
- "(int) - Return number of Bez points on an Ipo curve"},
- {"delBezPoint", ( PyCFunction ) Ipo_DeleteBezPoints, METH_VARARGS,
- "(int) - deprecated: use ipocurve.delBezier()"},
- {"getCurveBP", ( PyCFunction ) Ipo_getCurveBP, METH_VARARGS,
- "() - unsupported"},
- {"EvaluateCurveOn", ( PyCFunction ) Ipo_EvaluateCurveOn, METH_VARARGS,
- "(int,flt) - deprecated: see ipocurve.evaluate()"},
- {"getCurveCurval", ( PyCFunction ) Ipo_getCurvecurval, METH_VARARGS,
- "(int) - deprecated: see ipocurve.evaluate()"},
- {"getCurveBeztriple", ( PyCFunction ) Ipo_getCurveBeztriple, METH_VARARGS,
- "(int,int) - deprecated: see ipocurve.bezierPoints[]"},
- {"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple, METH_VARARGS,
- "(int,int,list) - set a BezTriple"},
-
- {"__copy__", ( PyCFunction ) Ipo_copy, METH_NOARGS,
- "() - copy the ipo"},
- {"copy", ( PyCFunction ) Ipo_copy, METH_NOARGS,
- "() - copy the ipo"},
-
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Ipo attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Ipo_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"curves",
- (getter)Ipo_getCurves, (setter)NULL,
- "Ipo curves",
- NULL},
- {"curveConsts",
- (getter)Ipo_getCurveNames, (setter)NULL,
- "Ipo curve constants (values depend on Ipo type)",
- NULL},
- {"channel",
- (getter)Ipo_getChannel, (setter)Ipo_setChannel,
- "Ipo texture channel (world, lamp, material Ipos only)",
- NULL},
-
- {"blocktype",
- (getter)Ipo_getBlocktype, (setter)NULL,
- "Ipo block type",
- NULL},
- {"rctf",
- (getter)Ipo_getRctf, (setter)Ipo_setRctf,
- "Ipo type",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Ipo_Type Mapping Methods table: */
-/*****************************************************************************/
-static PyMappingMethods Ipo_as_mapping = {
- ( inquiry ) Ipo_length, /* mp_length */
- ( binaryfunc ) Ipo_getIpoCurveByName, /* mp_subscript */
- ( objobjargproc ) Ipo_setIpoCurveByName, /* mp_ass_subscript */
-};
-
-static PySequenceMethods Ipo_as_sequence = {
- ( inquiry ) 0, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) 0, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- ( objobjproc ) Ipo_contains, /* sq_contains */
- ( binaryfunc ) 0, /* sq_inplace_concat */
- ( intargfunc ) 0, /* sq_inplace_repeat */
-};
-
-/*****************************************************************************/
-/* Python Ipo_Type callback function prototypes: */
-/*****************************************************************************/
-/*static int IpoPrint (BPy_Ipo *self, FILE *fp, int flags);*/
-static int Ipo_compare( BPy_Ipo * a, BPy_Ipo * b );
-static PyObject *Ipo_repr( BPy_Ipo * self );
-static PyObject *Ipo_getIter( BPy_Ipo * self );
-static PyObject *Ipo_nextIter( BPy_Ipo * self );
-
-/* #define CURVEATTRS */ /* uncomment to enable curves as Ipo attributes */
-
-#ifdef CURVEATTRS
-static PyGetSetDef BPy_Ipocurve_getseter = {
- "noname",
- (getter)NULL, (setter)NULL,
- "Ipo curve name",
- NULL
-};
-
-void generate_curveattrs( PyObject* dict, int blocktype )
-{
- typedef char * (*namefunc)(int, ... );
- namefunc lookup_name;
- int size;
- int *vals = NULL;
- char name[32];
- PyObject*desc;
-
- switch ( blocktype ) {
- case ID_OB:
- lookup_name = (namefunc)getname_ob_ei;
- vals = ob_ar;
- size = OB_TOTIPO;
- break;
- case ID_MA:
- lookup_name = (namefunc)getname_mat_ei;
- vals = ma_ar;
- size = MA_TOTIPO;
- break;
- case ID_CA:
- lookup_name = (namefunc)getname_cam_ei;
- vals = cam_ar;
- size = CAM_TOTIPO;
- break;
- case ID_LA:
- lookup_name = (namefunc)getname_la_ei;
- vals = la_ar;
- size = LA_TOTIPO;
- break;
- case ID_TE:
- lookup_name = (namefunc)getname_tex_ei;
- vals = te_ar;
- size = TE_TOTIPO;
- break;
- case ID_WO:
- lookup_name = (namefunc)getname_world_ei;
- vals = wo_ar;
- size = WO_TOTIPO;
- break;
- case ID_PO:
- lookup_name = (namefunc)getname_ac_ei;
- vals = ac_ar;
- size = AC_TOTIPO;
- break;
- case ID_CO:
- lookup_name = (namefunc)getname_co_ei;
- vals = co_ar;
- size = CO_TOTIPO;
- break;
- case ID_CU:
- lookup_name = (namefunc)getname_cu_ei;
- vals = cu_ar;
- size = CU_TOTIPO;
- break;
- case ID_SEQ:
- lookup_name = (namefunc)getname_seq_ei;
- vals = seq_ar;
- size = SEQ_TOTIPO;
- break;
- }
-
- desc = PyDescr_NewGetSet( &Ipo_Type, &BPy_Ipocurve_getseter );
- while( size-- ) {
- strcpy( name, lookup_name( *vals ) );
- *name = tolower( *name );
- PyDict_SetItemString( dict, name, desc );
- ++vals;
- }
- Py_DECREF( desc );
-}
-
-static short lookup_curve_name( char *, int , int );
-
-static PyObject *getattro( PyObject *self, PyObject *value )
-{
- char *name = PyString_AS_STRING( value );
- Ipo *ipo = ((BPy_Ipo *)self)->ipo;
- int adrcode;
- IpoCurve *icu;
-
- if( !strcmp(name, "__class__") )
- return PyObject_GenericGetAttr( self, value );
-
- if( !strcmp(name, "__dict__") ) /* no effect */
- {
- PyObject *dict;
- dict = PyDict_Copy( self->ob_type->tp_dict );
- generate_curveattrs( dict, ipo->blocktype );
- return dict;
- }
-
- adrcode = lookup_curve_name( name, ipo->blocktype,
- ((BPy_Ipo *)self)->mtex );
-
- if( adrcode != -1 ) {
- for( icu = ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == adrcode )
- return IpoCurve_CreatePyObject( icu );
- Py_RETURN_NONE;
- }
-
- return PyObject_GenericGetAttr( self, value );
-}
-#endif
-
-/*****************************************************************************/
-/* Python Ipo_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Ipo_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Ipo", /* char *tp_name; */
- sizeof( BPy_Ipo ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Ipo_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Ipo_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &Ipo_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- &Ipo_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
-#ifdef CURVEATTRS
- (getattrofunc)getattro,
-#else
- NULL, /* getattrofunc tp_getattro; */
-#endif
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) Ipo_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) Ipo_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Ipo_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Ipo_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* internal utility routines */
-/*****************************************************************************/
-
-/*
- * Search through list of known Ipocurves for a particular name.
- *
- * str: name of curve we are searching for
- * blocktype: type of Ipo
- * channel: texture channel number, for World/Lamp/Material curves
- *
- * returns the adrcode for the named curve if it exists, -1 otherwise
- */
-
-/* this is needed since getname_ob_ei() is different from the rest */
-
-typedef char * (*namefunc)(int, ... );
-
-static short lookup_curve_name( char *str, int blocktype, int channel )
-{
- namefunc lookup_name;
- int *adrcodes = NULL;
- int size = 0;
-
- /* make sure channel type is ignored when it should be */
- if( blocktype != ID_WO && blocktype != ID_LA && blocktype != ID_MA )
- channel = -1;
-
- switch ( blocktype ) {
- case ID_OB:
- lookup_name = (namefunc)getname_ob_ei;
- adrcodes = ob_ar;
- size = OB_TOTIPO;
- break;
- case ID_MA:
- lookup_name = (namefunc)getname_mat_ei;
- adrcodes = ma_ar;
- size = MA_TOTIPO;
- break;
- case ID_CA:
- lookup_name = (namefunc)getname_cam_ei;
- adrcodes = cam_ar;
- size = CAM_TOTIPO;
- break;
- case ID_LA:
- lookup_name = (namefunc)getname_la_ei;
- adrcodes = la_ar;
- size = LA_TOTIPO;
- break;
- case ID_TE:
- lookup_name = (namefunc)getname_tex_ei;
- adrcodes = te_ar;
- size = TE_TOTIPO;
- break;
- case ID_WO:
- lookup_name = (namefunc)getname_world_ei;
- adrcodes = wo_ar;
- size = WO_TOTIPO;
- break;
- case ID_PO:
- lookup_name = (namefunc)getname_ac_ei;
- adrcodes = ac_ar;
- size = AC_TOTIPO;
- break;
- case ID_CO:
- lookup_name = (namefunc)getname_co_ei;
- adrcodes = co_ar;
- size = CO_TOTIPO;
- break;
- case ID_CU:
- lookup_name = (namefunc)getname_cu_ei;
- adrcodes = cu_ar;
- size = CU_TOTIPO;
- break;
- case ID_SEQ:
- lookup_name = (namefunc)getname_seq_ei;
- adrcodes = seq_ar;
- size = SEQ_TOTIPO;
- break;
- case ID_KE: /* shouldn't happen */
- default:
- return -1;
- }
-
- while ( size-- ) {
- char *name = lookup_name ( *adrcodes );
-
- /* if not a texture channel, just return the adrcode */
- if( !strcmp( str, name ) ) {
- if( channel == -1 || *adrcodes < MA_MAP1 )
- return (short)*adrcodes;
-
- /* otherwise adjust adrcode to include current channel */
- else {
- int param = (short)*adrcodes & ~MA_MAP1;
- param |= texchannel_to_adrcode( channel );
- return (short)param;
- }
- }
- ++adrcodes;
- }
- return -1;
-}
-
-static short lookup_curve_key( char *str, Ipo *ipo )
-{
- Key *keyiter;
-
- /* find the ipo in the keylist */
- for( keyiter = G.main->key.first; keyiter; keyiter = keyiter->id.next ) {
- if( keyiter->ipo == ipo ) {
- KeyBlock *block = keyiter->block.first;
-
- /* look for a matching string, get the adrcode */
- for( block = keyiter->block.first; block; block = block->next )
- if( !strcmp( str, block->name ) )
- return block->adrcode;
-
- /* no match; no addr code */
- return -1;
- }
- }
-
- /* error if the ipo isn't in the list */
- return -2;
-}
-
-/*
- * Search through list of known Ipocurves for a particular adrcode.
- *
- * code: adrcode of curve we are searching for
- * blocktype: type of Ipo
- * channel: texture channel number, for World/Lamp/Material curves
- *
- * returns the adrcode for the named curve if it exists, -1 otherwise
- */
-
-static short lookup_curve_adrcode( int code, int blocktype, int channel )
-{
- int *adrcodes = NULL;
- int size = 0;
-
- switch ( blocktype ) {
- case ID_OB:
- adrcodes = ob_ar;
- size = OB_TOTIPO;
- break;
- case ID_MA:
- adrcodes = ma_ar;
- size = MA_TOTIPO;
- break;
- case ID_CA:
- adrcodes = cam_ar;
- size = CAM_TOTIPO;
- break;
- case ID_LA:
- adrcodes = la_ar;
- size = LA_TOTIPO;
- break;
- case ID_TE:
- adrcodes = te_ar;
- size = TE_TOTIPO;
- break;
- case ID_WO:
- adrcodes = wo_ar;
- size = WO_TOTIPO;
- break;
- case ID_PO:
- adrcodes = ac_ar;
- size = AC_TOTIPO;
- break;
- case ID_CO:
- adrcodes = co_ar;
- size = CO_TOTIPO;
- break;
- case ID_CU:
- adrcodes = cu_ar;
- size = CU_TOTIPO;
- break;
- case ID_SEQ:
- adrcodes = seq_ar;
- size = SEQ_TOTIPO;
- break;
- case ID_KE:
- default:
- return -1;
- }
-
- while ( size-- ) {
- if( *adrcodes == code ) {
-
- /* if not a texture channel, just return the adrcode */
- if( channel == -1 || *adrcodes < MA_MAP1 )
- return (short)*adrcodes;
-
- /* otherwise adjust adrcode to include current channel */
- else {
- int param = *adrcodes & ~MA_MAP1;
- param |= texchannel_to_adrcode( channel );
- return (short)param;
- }
- }
- ++adrcodes;
- }
- return -1;
-}
-
-/*
- * Delete an IpoCurve from an Ipo
- */
-
-static void del_ipocurve( Ipo * ipo, IpoCurve * icu ) {
- BLI_remlink( &( ipo->curve ), icu );
- if( icu->bezt )
- MEM_freeN( icu->bezt );
- if( icu->driver )
- MEM_freeN( icu->driver );
- MEM_freeN( icu );
-
- /* have to do this to avoid crashes in the IPO window */
- allspace( REMAKEIPO, 0 );
- EXPP_allqueue( REDRAWIPO, 0 );
-}
-
-/*****************************************************************************/
-/* Python BPy_Ipo functions: */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Function: M_Ipo_New */
-/* Python equivalent: Blender.Ipo.New */
-/*****************************************************************************/
-
-static PyObject *M_Ipo_New( PyObject * self_unused, PyObject * args )
-{
- char *name = NULL, *code = NULL;
- int idcode = -1;
- Ipo *blipo;
-
- if( !PyArg_ParseTuple( args, "ss", &code, &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two string arguments" );
-
- if( !strcmp( code, "Object" ) )
- idcode = ID_OB;
- else if( !strcmp( code, "Camera" ) )
- idcode = ID_CA;
- else if( !strcmp( code, "World" ) )
- idcode = ID_WO;
- else if( !strcmp( code, "Material" ) )
- idcode = ID_MA;
- else if( !strcmp( code, "Texture" ) )
- idcode = ID_TE;
- else if( !strcmp( code, "Lamp" ) )
- idcode = ID_LA;
- else if( !strcmp( code, "Action" ) )
- idcode = ID_PO;
- else if( !strcmp( code, "Constraint" ) )
- idcode = ID_CO;
- else if( !strcmp( code, "Sequence" ) )
- idcode = ID_SEQ;
- else if( !strcmp( code, "Curve" ) )
- idcode = ID_CU;
- else if( !strcmp( code, "Key" ) )
- idcode = ID_KE;
- else return EXPP_ReturnPyObjError( PyExc_ValueError,
- "unknown Ipo code" );
-
- blipo = add_ipo( name, idcode );
-
- if( blipo ) {
- /* return user count to zero because add_ipo() inc'd it */
- blipo->id.us = 0;
- /* create python wrapper obj */
- return Ipo_CreatePyObject( blipo );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Ipo Data in Blender" );
-}
-
-/*****************************************************************************/
-/* Function: M_Ipo_Get */
-/* Python equivalent: Blender.Ipo.Get */
-/* Description: Receives a string and returns the ipo data obj */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all ipo data names in the */
-/* current scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Ipo_Get( PyObject * self_unused, PyObject * args )
-{
- char *name = NULL;
- Ipo *ipo_iter;
- PyObject *ipolist, *pyobj;
- char error_msg[64];
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- ipo_iter = G.main->ipo.first;
-
- if( name ) { /* (name) - Search ipo by name */
- while( ipo_iter ) {
- if( !strcmp( name, ipo_iter->id.name + 2 ) ) {
- return Ipo_CreatePyObject( ipo_iter );
- }
- ipo_iter = ipo_iter->id.next;
- }
-
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Ipo \"%s\" not found", name );
- return EXPP_ReturnPyObjError( PyExc_NameError, error_msg );
- }
-
- else { /* () - return a list with all ipos in the scene */
- int index = 0;
-
- ipolist = PyList_New( BLI_countlist( &( G.main->ipo ) ) );
-
- if( !ipolist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- while( ipo_iter ) {
- pyobj = Ipo_CreatePyObject( ipo_iter );
-
- if( !pyobj )
- return NULL;
-
- PyList_SET_ITEM( ipolist, index, pyobj );
-
- ipo_iter = ipo_iter->id.next;
- index++;
- }
-
- return ipolist;
- }
-}
-
-/*
- * This should probably be deprecated too? Or else documented in epydocs.
- * Seems very similar to Ipocurve.recalc().
- */
-
-/*****************************************************************************/
-/* Function: M_Ipo_Recalc */
-/* Python equivalent: Blender.Ipo.Recalc */
-/* Description: Receives (presumably) an IpoCurve object and */
-/* updates the curve after changes to control points. */
-/*****************************************************************************/
-static PyObject *M_Ipo_Recalc( PyObject * self_unused, PyObject * value )
-{
- if( !BPy_IpoCurve_Check(value) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Ipo curve argument" );
-
- testhandles_ipocurve( IpoCurve_FromPyObject( value ) );
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python BPy_Ipo methods: */
-/*****************************************************************************/
-static PyObject *Ipo_getBlocktype( BPy_Ipo * self )
-{
- return PyInt_FromLong( self->ipo->blocktype );
-}
-
-static int Ipo_setBlocktype( BPy_Ipo * self, PyObject * args )
-{
- if( !PyInt_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- self->ipo->blocktype = (short)PyInt_AS_LONG( args );
-
- return 0;
-}
-
-static PyObject *Ipo_getRctf( BPy_Ipo * self )
-{
- PyObject *l = PyList_New( 4 );
- PyList_SET_ITEM( l, 0, PyFloat_FromDouble( self->ipo->cur.xmin ) );
- PyList_SET_ITEM( l, 1, PyFloat_FromDouble( self->ipo->cur.xmax ) );
- PyList_SET_ITEM( l, 2, PyFloat_FromDouble( self->ipo->cur.ymin ) );
- PyList_SET_ITEM( l, 3, PyFloat_FromDouble( self->ipo->cur.ymax ) );
- return l;
-}
-
-static int Ipo_setRctf( BPy_Ipo * self, PyObject * args )
-{
- float v[4];
-
- if( !PyArg_ParseTuple( args, "ffff", v, v + 1, v + 2, v + 3 ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a tuple of 4 floats" );
-
- self->ipo->cur.xmin = v[0];
- self->ipo->cur.xmax = v[1];
- self->ipo->cur.ymin = v[2];
- self->ipo->cur.ymax = v[3];
-
- return 0;
-}
-
-/*
- * Get total number of Ipo curves for this Ipo. NOTE: this function
- * returns all curves for Ipos which have texture channels, unlike
- * Ipo_length().
- */
-
-static PyObject *Ipo_getNcurves( BPy_Ipo * self )
-{
- IpoCurve *icu;
- int i = 0;
-
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- i++;
- }
-
- return PyInt_FromLong( (long)i );
-}
-
-/*
- Function: Ipo_addCurve
- Bpy: Blender.Ipo.addCurve( 'curname')
-
- add a new curve to an existing IPO.
- example:
- ipo = Blender.Ipo.New('Object','ObIpo')
- cu = ipo.addCurve('LocX')
-*/
-
-static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * value )
-{
- short param; /* numeric curve name constant */
- char *cur_name = PyString_AsString(value); /* input arg: curve name */
- Ipo *ipo = 0;
- IpoCurve *icu = 0;
- Link *link;
-
- if( !cur_name )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected string argument" ) );
-
-
- /* chase down the ipo list looking for ours */
- link = G.main->ipo.first;
-
- while( link ) {
- ipo = ( Ipo * ) link;
- if( ipo == self->ipo )
- break;
- link = link->next;
- }
-
- if( !link )
- return EXPP_ReturnPyObjError
- ( PyExc_RuntimeError, "Ipo not found" );
-
- /*
- * Check if the input arg curve name is valid depending on the block
- * type, and set param to numeric value. Invalid names will return
- * param = -1.
- */
-
- if( ipo->blocktype != ID_KE ) {
- param = lookup_curve_name( cur_name, ipo->blocktype, self->mtex );
- } else {
- param = lookup_curve_key( cur_name, ipo );
- if( param == -2 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unable to find matching key data for Ipo" );
- }
-
- if( param == -1 )
- return EXPP_ReturnPyObjError( PyExc_NameError,
- "curve name is not valid" );
-
- /* see if the curve already exists */
- for( icu = ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == param )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Ipo curve already exists" );
-
- /* create the new ipo curve */
- icu = MEM_callocN( sizeof(IpoCurve), "Python added ipocurve");
- icu->blocktype = ipo->blocktype;
- icu->adrcode = param;
- icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
- set_icu_vars( icu );
- BLI_addtail( &(ipo->curve), icu);
-
- allspace( REMAKEIPO, 0 );
- EXPP_allqueue( REDRAWIPO, 0 );
-
- /* create a bpy wrapper for the new ipo curve */
- return IpoCurve_CreatePyObject( icu );
-}
-
-/*
- Function: Ipo_delCurve
- Bpy: Blender.Ipo.delCurve(curtype)
-
- delete an existing curve from IPO.
- example:
- ipo = Blender.Ipo.New('Object','ObIpo')
- cu = ipo.delCurve('LocX')
-*/
-
-static PyObject *Ipo_delCurve( BPy_Ipo * self, PyObject * value )
-{
- IpoCurve *icu;
- char *strname = PyString_AsString(value);
-
- if( !strname )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- if( !strcmp( strname, getIpoCurveName( icu ) ) ) {
- del_ipocurve( self->ipo, icu );
- Py_RETURN_NONE;
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_ValueError, "IpoCurve not found" );
-}
-/*
- */
-
-static PyObject *Ipo_getCurve( BPy_Ipo * self, PyObject * args )
-{
- IpoCurve *icu = NULL;
- short adrcode;
- PyObject *value = NULL;
-
- if( !PyArg_ParseTuple( args, "|O", &value ) )
- goto typeError;
-
- /* if no name give, get all the Ipocurves */
- if( !value )
- return Ipo_getCurves( self );
-
- /* if arg is a string or int, look up the adrcode */
- if( PyString_Check( value ) ) {
- char *str = PyString_AsString( value );
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- if( !strcmp( str, getIpoCurveName( icu ) ) )
- return IpoCurve_CreatePyObject( icu );
- }
- Py_RETURN_NONE;
- }
- else if( PyInt_Check( value ) ) {
- adrcode = ( short )PyInt_AsLong( value );
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- if( icu->adrcode == adrcode )
- return IpoCurve_CreatePyObject( icu );
- }
- Py_RETURN_NONE;
- }
-
-typeError:
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected string or int argument" );
-}
-
-static PyObject *Ipo_getCurves( BPy_Ipo * self )
-{
- PyObject *attr = PyList_New( 0 ), *pyipo;
- IpoCurve *icu;
-
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- pyipo = IpoCurve_CreatePyObject( icu );
- PyList_Append( attr, pyipo );
- Py_DECREF(pyipo);
- }
- return attr;
-}
-
-/*
- * return a list of valid curve name constants for the Ipo
- */
-
-static PyObject *Ipo_getCurveNames( BPy_Ipo * self )
-{
- namefunc lookup_name;
- int size;
- int *vals = NULL;
- char name[32];
- PyObject *attr = Py_None;
-
- /* determine what type of Ipo we are */
-
- switch ( self->ipo->blocktype ) {
- case ID_OB:
- lookup_name = (namefunc)getname_ob_ei;
- vals = ob_ar;
- size = OB_TOTIPO;
- strcpy( name, "OB_" );
- break;
- case ID_MA:
- lookup_name = (namefunc)getname_mat_ei;
- vals = ma_ar;
- size = MA_TOTIPO;
- strcpy( name, "MA_" );
- break;
- case ID_CA:
- lookup_name = (namefunc)getname_cam_ei;
- vals = cam_ar;
- size = CAM_TOTIPO;
- strcpy( name, "CA_" );
- break;
- case ID_LA:
- lookup_name = (namefunc)getname_la_ei;
- vals = la_ar;
- size = LA_TOTIPO;
- strcpy( name, "LA_" );
- break;
- case ID_TE:
- lookup_name = (namefunc)getname_tex_ei;
- vals = te_ar;
- size = TE_TOTIPO;
- strcpy( name, "TE_" );
- break;
- case ID_WO:
- lookup_name = (namefunc)getname_world_ei;
- vals = wo_ar;
- size = WO_TOTIPO;
- strcpy( name, "WO_" );
- break;
- case ID_PO:
- lookup_name = (namefunc)getname_ac_ei;
- vals = ac_ar;
- size = AC_TOTIPO;
- strcpy( name, "PO_" );
- break;
- case ID_CO:
- lookup_name = (namefunc)getname_co_ei;
- vals = co_ar;
- size = CO_TOTIPO;
- strcpy( name, "CO_" );
- break;
- case ID_CU:
- lookup_name = (namefunc)getname_cu_ei;
- vals = cu_ar;
- size = CU_TOTIPO;
- strcpy( name, "CU_" );
- break;
- case ID_SEQ:
- lookup_name = (namefunc)getname_seq_ei;
- vals = seq_ar;
- size = SEQ_TOTIPO;
- strcpy( name, "SQ_" );
- break;
- case ID_KE:
- {
- Key *key;
-
- /* find the ipo in the keylist */
- for( key = G.main->key.first; key; key = key->id.next ) {
- if( key->ipo == self->ipo ) {
- PyObject *tmpstr;
- KeyBlock *block = key->block.first;
- attr = PyList_New( 0 );
-
- /* add each name to the list */
- for( block = key->block.first; block; block = block->next ) {
- tmpstr = PyString_FromString( block->name );
- PyList_Append( attr, tmpstr);
- Py_DECREF(tmpstr);
- }
- return attr;
- }
- }
-
- /* error if the ipo isn't in the list */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unable to find matching key data for Ipo" );
- }
- default:
- Py_DECREF( attr );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unknown Ipo type" );
- }
-
- /*
- * go through the list of adrcodes to find names, then add to dictionary
- * with string as key and adrcode as value
- */
-
- attr = PyConstant_New();
-
- while( size-- ) {
- char *ptr = name+3;
- strcpy( name+3, lookup_name( *vals ) );
- while( *ptr ) {
- *ptr = (char)toupper( *ptr );
- ++ptr;
- }
- PyConstant_Insert( (BPy_constant *)attr, name,
- PyInt_FromLong( *vals ) );
- ++vals;
- }
- return attr;
-}
-
-static void generate_curveconsts( PyObject* module )
-{
- namefunc lookup_name = NULL;
- int size = 0;
- int *vals = NULL;
- char name[32];
-
- unsigned int i = 0;
- static short curvelist[] = {
- ID_OB, ID_MA, ID_CA, ID_LA, ID_TE, ID_WO, ID_PO, ID_CO, ID_CU, ID_SEQ
- };
-
- for( i = 0; i < sizeof(curvelist)/sizeof(short); ++i ) {
- switch ( curvelist[i] ) {
- case ID_OB:
- lookup_name = (namefunc)getname_ob_ei;
- vals = ob_ar;
- size = OB_TOTIPO;
- strcpy( name, "OB_" );
- break;
- case ID_MA:
- lookup_name = (namefunc)getname_mat_ei;
- vals = ma_ar;
- size = MA_TOTIPO;
- strcpy( name, "MA_" );
- break;
- case ID_CA:
- lookup_name = (namefunc)getname_cam_ei;
- vals = cam_ar;
- size = CAM_TOTIPO;
- strcpy( name, "CA_" );
- break;
- case ID_LA:
- lookup_name = (namefunc)getname_la_ei;
- vals = la_ar;
- size = LA_TOTIPO;
- strcpy( name, "LA_" );
- break;
- case ID_TE:
- lookup_name = (namefunc)getname_tex_ei;
- vals = te_ar;
- size = TE_TOTIPO;
- strcpy( name, "TE_" );
- break;
- case ID_WO:
- lookup_name = (namefunc)getname_world_ei;
- vals = wo_ar;
- size = WO_TOTIPO;
- strcpy( name, "WO_" );
- break;
- case ID_PO:
- lookup_name = (namefunc)getname_ac_ei;
- vals = ac_ar;
- size = AC_TOTIPO;
- strcpy( name, "PO_" );
- break;
- case ID_CO:
- lookup_name = (namefunc)getname_co_ei;
- vals = co_ar;
- size = CO_TOTIPO;
- strcpy( name, "CO_" );
- break;
- case ID_CU:
- lookup_name = (namefunc)getname_cu_ei;
- vals = cu_ar;
- size = CU_TOTIPO;
- strcpy( name, "CU_" );
- break;
- case ID_SEQ:
- lookup_name = (namefunc)getname_seq_ei;
- vals = seq_ar;
- size = SEQ_TOTIPO;
- strcpy( name, "SQ_" );
- break;
- }
-
- while( size-- ) {
- char *ptr = name+3;
- strcpy( name+3, lookup_name( *vals ) );
- while( *ptr ) {
- *ptr = (char)toupper( *ptr );
- ++ptr;
- }
- PyModule_AddIntConstant( module, name, *vals );
- ++vals;
- }
- }
-}
-
-
-/*
- * get the current texture channel number, if defined
- */
-
-static PyObject *Ipo_getChannel( BPy_Ipo * self )
-{
- if( self->mtex != -1 )
- return PyInt_FromLong( (long)self->mtex );
- Py_RETURN_NONE;
-}
-
-/*
- * set the current texture channel number, if defined
- */
-
-static int Ipo_setChannel( BPy_Ipo * self, PyObject * value )
-{
- if( self->mtex != -1 )
- return EXPP_setIValueRange( value, &self->mtex, 0, 9, 'h' );
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: Ipo_compare */
-/* Description: This compares 2 ipo python types, == or != only. */
-/*****************************************************************************/
-static int Ipo_compare( BPy_Ipo * a, BPy_Ipo * b )
-{
- return ( a->ipo == b->ipo ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Ipo_repr */
-/* Description: This is a callback function for the BPy_Ipo type. It */
-/* builds a meaningful string to represent ipo objects. */
-/*****************************************************************************/
-static PyObject *Ipo_repr( BPy_Ipo * self )
-{
- char *param;
-
- switch ( self->ipo->blocktype ) {
- case ID_OB:
- param = "Object"; break;
- case ID_CA:
- param = "Camera"; break;
- case ID_LA:
- param = "Lamp"; break;
- case ID_TE:
- param = "Texture"; break;
- case ID_WO:
- param = "World"; break;
- case ID_MA:
- param = "Material"; break;
- case ID_PO:
- param = "Action"; break;
- case ID_CO:
- param = "Constriant"; break;
- case ID_CU:
- param = "Curve"; break;
- case ID_SEQ:
- param = "Sequence"; break;
- case ID_KE:
- param = "Key"; break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unknown Ipo type" );
- }
- return PyString_FromFormat( "[Ipo \"%s\" (%s)]", self->ipo->id.name + 2,
- param );
-}
-
-/* Three Python Ipo_Type helper functions needed by the Object module: */
-
-/*****************************************************************************/
-/* Function: Ipo_CreatePyObject */
-/* Description: This function will create a new BPy_Ipo from an existing */
-/* Blender ipo structure. */
-/*****************************************************************************/
-PyObject *Ipo_CreatePyObject( Ipo * ipo )
-{
- BPy_Ipo *pyipo;
- pyipo = ( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, &Ipo_Type );
- if( !pyipo )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Ipo object" );
- pyipo->ipo = ipo;
- pyipo->iter = 0;
- if( pyipo->ipo->blocktype == ID_WO || pyipo->ipo->blocktype == ID_LA ||
- pyipo->ipo->blocktype == ID_MA )
- pyipo->mtex = 0;
- else
- pyipo->mtex = -1;
- return ( PyObject * ) pyipo;
-}
-
-/*****************************************************************************/
-/* Function: Ipo_FromPyObject */
-/* Description: This function returns the Blender ipo from the given */
-/* PyObject. */
-/*****************************************************************************/
-Ipo *Ipo_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Ipo * ) pyobj )->ipo;
-}
-
-/*****************************************************************************/
-/* Function: Ipo_length */
-/* Description: This function counts the number of curves accessible for the */
-/* PyObject. */
-/*****************************************************************************/
-static int Ipo_length( BPy_Ipo * self )
-{
- IpoCurve *icu;
- int len = 0;
-
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- if( self->mtex == -1 || icu->adrcode < MA_MAP1 ||
- icu->adrcode & texchannel_to_adrcode( self->mtex ) )
- ++len;
- }
- return len;
-}
-
-/*
- * "mapping" operator getter: return an IpoCurve it we can find it
- */
-
-static PyObject *Ipo_getIpoCurveByName( BPy_Ipo * self, PyObject * key )
-{
- IpoCurve *icu = NULL;
- int adrcode;
-
- /* if Ipo is not ShapeKey and arg is an int, look up the adrcode */
- if( self->ipo->blocktype != ID_KE && PyNumber_Check( key ) )
- adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
- self->ipo->blocktype, self->mtex );
- /* if Ipo is ShapeKey and arg is string, look up the adrcode */
- else if( self->ipo->blocktype == ID_KE && PyString_Check( key ) ) {
- adrcode = lookup_curve_key( PyString_AS_STRING( key ), self->ipo );
- if( adrcode == -2 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unable to find matching key data for Ipo" );
- }
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int or string key" );
-
- /* if no adrcode found, value error */
- if( adrcode == -1 )
- return EXPP_ReturnPyObjError( PyExc_KeyError, "invalid curve key" );
-
- /* search for a matching adrcode */
- for( icu = self->ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == adrcode )
- return IpoCurve_CreatePyObject( icu );
-
- /* no curve found */
- Py_RETURN_NONE;
-}
-
-/*
- * "mapping" operator setter: create or delete an IpoCurve it we can find it
- */
-
-static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key,
- PyObject * arg )
-{
- IpoCurve *icu;
- Ipo *ipo = self->ipo;
- short adrcode;
-
- /* "del ipo[const]" will send NULL here; give an error */
- if( !arg )
- return EXPP_ReturnIntError( PyExc_NotImplementedError,
- "del operator not supported" );
-
- /* "del ipo[const]" will send NULL here; give an error */
- if( self->ipo->blocktype == ID_KE )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "creation or deletion of Shape Keys not supported" );
-
- /* check for int argument */
- if( !PyNumber_Check( key ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected int key" );
-
- /* look up the key, return error if not found */
- adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
- self->ipo->blocktype, self->mtex );
-
- if( adrcode == -1 )
- return EXPP_ReturnIntError( PyExc_KeyError,
- "invalid curve specified" );
-
- /* if arg is None, delete the curve */
- if( arg == Py_None ) {
- for( icu = self->ipo->curve.first; icu; icu = icu->next ) {
- if( icu->adrcode == adrcode ) {
- del_ipocurve( ipo, icu );
- return 0;
- }
- }
-
- return EXPP_ReturnIntError( PyExc_ValueError, "IpoCurve not found" );
- } else {
-
- /* create the new ipo curve */
- float time, curval;
- PyObject *tmp, *flt=NULL, *val=NULL;
-
- /* error if not a sequence or sequence with other than 2 values */
- if( PySequence_Size( arg ) != 2 )
- goto AttrError;
-
- /* get the time and curval */
- tmp = PySequence_ITEM( arg, 0 );
- flt = PyNumber_Float( tmp );
- Py_DECREF( tmp );
- tmp = PySequence_ITEM( arg, 1 );
- val = PyNumber_Float( tmp );
- Py_DECREF( tmp );
-
- if( !flt || !val )
- goto AttrError;
-
- time = (float)PyFloat_AS_DOUBLE( flt );
- curval = (float)PyFloat_AS_DOUBLE( val );
- Py_DECREF( flt );
- Py_DECREF( val );
-
- /* if curve already exist, delete the original */
- for( icu = ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == adrcode ) {
- del_ipocurve( ipo, icu );
- break;
- }
-
- /* create the new curve, then add the key */
- icu = MEM_callocN( sizeof(IpoCurve), "Python added ipocurve");
- icu->blocktype = ipo->blocktype;
- icu->adrcode = adrcode;
- icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
- set_icu_vars( icu );
- BLI_addtail( &(ipo->curve), icu);
- insert_vert_icu( icu, time, curval, 0);
-
- allspace( REMAKEIPO, 0 );
- EXPP_allqueue( REDRAWIPO, 0 );
-
- return 0;
-
-AttrError:
- Py_XDECREF( val );
- Py_XDECREF( flt );
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected sequence of two floats" );
- }
-}
-
-/*
- * sequence __contains__ method (implements "x in ipo")
- */
-
-static int Ipo_contains( BPy_Ipo *self, PyObject *key )
-{
- IpoCurve *icu = NULL;
- int adrcode;
-
- /* take a Ipo curve name: key must be a int */
-
- if( self->ipo->blocktype != ID_KE && PyNumber_Check( key ) ) {
- adrcode = lookup_curve_adrcode( PyInt_AsLong( key ),
- self->ipo->blocktype, self->mtex );
-
- /* if we found an adrcode for the key, search the ipo's curve */
- if( adrcode != -1 ) {
- for( icu = self->ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == adrcode )
- return 1;
- }
- } else if( self->ipo->blocktype == ID_KE && PyString_Check( key ) ) {
- adrcode = lookup_curve_key( PyString_AS_STRING( key ), self->ipo );
-
- /* if we found an adrcode for the key, search the ipo's curve */
- if( adrcode >= 0 ) {
- for( icu = self->ipo->curve.first; icu; icu = icu->next )
- if( icu->adrcode == adrcode )
- return 1;
- }
- }
-
- /* no curve found */
- return 0;
-}
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *Ipo_getIter( BPy_Ipo * self )
-{
- /* return a new IPO object if we are looping on the existing one
- This allows nested loops */
- if (self->iter==0) {
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return Ipo_CreatePyObject(self->ipo);
- }
-}
-
-/*
- * Get the next Ipo curve
- */
-
-static PyObject *Ipo_nextIter( BPy_Ipo * self )
-{
- int i;
- IpoCurve *icu = self->ipo->curve.first;
-
- ++self->iter;
-
- /*
- * count curves only if
- * (a) Ipo has no texture channels
- * (b) Ipo has texture channels, but curve is not that type
- * (c) Ipo has texture channels, and curve is that type, and it is
- * in the active texture channel
- */
- for( i = 0; icu; icu = icu->next ) {
- if( self->mtex == -1 || icu->adrcode < MA_MAP1 ||
- icu->adrcode & texchannel_to_adrcode( self->mtex ) ) {
- ++i;
-
- /* if indices match, return the curve */
- if( i == self->iter )
- return IpoCurve_CreatePyObject( icu );
- }
- }
-
- self->iter = 0; /* allow iter use again */
- /* ran out of curves */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/*****************************************************************************/
-/* Function: Ipo_Init */
-/*****************************************************************************/
-PyObject *Ipo_Init( void )
-{
- /* PyObject *submodule; */
-
- if( PyType_Ready( &Ipo_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Ipo", M_Ipo_methods, M_Ipo_doc );
- generate_curveconsts( submodule );
-
- return submodule;
-}
-
-/*
- * The following methods should be deprecated when there are equivalent
- * methods in Ipocurve (if there aren't already).
- */
-
-static PyObject *Ipo_getNBezPoints( BPy_Ipo * self, PyObject * args )
-{
- int num = 0;
- IpoCurve *icu = NULL;
-
- if( !PyArg_ParseTuple( args, "i", &num ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- icu = self->ipo->curve.first;
- while( icu && num > 0 ) {
- icu = icu->next;
- --num;
- }
-
- if( num < 0 || !icu )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" );
-
- return PyInt_FromLong( icu->totvert );
-}
-
-static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args )
-{
- int num = 0, i = 0;
- IpoCurve *icu = 0;
- if( !PyArg_ParseTuple( args, "i", &num ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected int argument" ) );
- icu = self->ipo->curve.first;
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "No IPO curve" ) );
- for( i = 0; i < num; i++ ) {
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "Bad curve number" ) );
- icu = icu->next;
-
- }
- icu->totvert--;
- return ( PyInt_FromLong( icu->totvert ) );
-}
-
-/*
- * Ipo_getCurveBP()
- * this method is UNSUPPORTED.
- * Calling this method throws a TypeError Exception.
- *
- * it looks like the original intent was to return the first point
- * of a BPoint Ipo curve. However, BPoint ipos are not currently
- * implemented.
- */
-
-static PyObject *Ipo_getCurveBP( BPy_Ipo * self_unused, PyObject * args_unused )
-{
- return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
- "bpoint ipos are not supported" );
-}
-
-static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args )
-{
- struct BezTriple *ptrbt;
- int num = 0, pos, i, j;
- IpoCurve *icu;
- PyObject *l, *pyfloat;
-
- if( !PyArg_ParseTuple( args, "ii", &num, &pos ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected int argument" ) );
- icu = self->ipo->curve.first;
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "No IPO curve" ) );
- for( i = 0; i < num; i++ ) {
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "Bad ipo number" ) );
- icu = icu->next;
- }
- if( pos >= icu->totvert )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Bad bezt number" );
-
- ptrbt = icu->bezt + pos;
- if( !ptrbt )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "No bez triple" );
-
- l = PyList_New( 0 );
- for( i = 0; i < 3; i++ ) {
- for( j = 0; j < 3; j++ ) {
- pyfloat = PyFloat_FromDouble( ptrbt->vec[i][j] );
- PyList_Append( l, pyfloat );
- Py_DECREF(pyfloat);
- }
- }
- return l;
-}
-
-static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args )
-{
- struct BezTriple *ptrbt;
- int num = 0, pos, i;
- IpoCurve *icu;
- PyObject *listargs = 0;
-
- if( !PyArg_ParseTuple( args, "iiO", &num, &pos, &listargs ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int int object argument" ) );
- if( !PyTuple_Check( listargs ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "3rd arg should be a tuple" ) );
- icu = self->ipo->curve.first;
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "No IPO curve" ) );
- for( i = 0; i < num; i++ ) {
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "Bad ipo number" ) );
- icu = icu->next;
- }
- if( pos >= icu->totvert )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Bad bezt number" );
-
- ptrbt = icu->bezt + pos;
- if( !ptrbt )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "No bez triple" );
-
- for( i = 0; i < 9; i++ ) {
- PyObject *xx = PyTuple_GetItem( listargs, i );
- ptrbt->vec[i / 3][i % 3] = (float)PyFloat_AsDouble( xx );
- }
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/* Ipo.__copy__ */
-static PyObject *Ipo_copy( BPy_Ipo * self )
-{
- Ipo *ipo = copy_ipo(self->ipo );
- ipo->id.us = 0;
- return Ipo_CreatePyObject(ipo);
-}
-
-static PyObject *Ipo_EvaluateCurveOn( BPy_Ipo * self, PyObject * args )
-{
- int num = 0, i;
- IpoCurve *icu;
- float time = 0;
-
- if( !PyArg_ParseTuple( args, "if", &num, &time ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected int argument" ) );
-
- icu = self->ipo->curve.first;
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "No IPO curve" ) );
-
- for( i = 0; i < num; i++ ) {
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "Bad ipo number" ) );
- icu = icu->next;
-
- }
- return PyFloat_FromDouble( eval_icu( icu, time ) );
-}
-
-static PyObject *Ipo_getCurvecurval( BPy_Ipo * self, PyObject * args )
-{
- int numcurve = 0, i;
- IpoCurve *icu;
- char *stringname = 0, *str1 = 0;
-
- icu = self->ipo->curve.first;
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "No IPO curve" ) );
-
- if( PyNumber_Check( PyTuple_GetItem( args, 0 ) ) ) /* args is an integer */
- {
- if( !PyArg_ParseTuple( args, "i", &numcurve ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int or string argument" ) );
- for( i = 0; i < numcurve; i++ ) {
- if( !icu )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "Bad ipo number" ) );
- icu = icu->next;
- }
- }
-
- else /* args is a string */
- {
- if( !PyArg_ParseTuple( args, "s", &stringname ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected int or string argument" ) );
- while( icu ) {
- str1 = getIpoCurveName( icu );
- if( !strcmp( str1, stringname ) )
- break;
- icu = icu->next;
- }
- }
-
- if( icu )
- return PyFloat_FromDouble( icu->curval );
- Py_RETURN_NONE;
-}
-
-/*
- * The following methods should be deprecated when methods are pruned out.
- */
-
-static PyObject *Ipo_oldsetRctf( BPy_Ipo * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Ipo_setRctf );
-}
-
-static PyObject *Ipo_oldsetBlocktype( BPy_Ipo * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Ipo_setBlocktype );
-}
diff --git a/source/blender/python/api2_2x/Ipo.h b/source/blender/python/api2_2x/Ipo.h
deleted file mode 100644
index bc581a8f051..00000000000
--- a/source/blender/python/api2_2x/Ipo.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_IPO_H
-#define EXPP_IPO_H
-
-#include <Python.h>
-#include "DNA_ipo_types.h"
-
-/*****************************************************************************/
-/* Python BPy_Ipo structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required macro */
- Ipo * ipo; /* libdata must be second */
- short iter;
- short mtex;
-} BPy_Ipo;
-
-extern PyTypeObject Ipo_Type;
-
-#define BPy_Ipo_Check(v) ((v)->ob_type == &Ipo_Type) /* for type checking */
-
-
-/*
- * prototypes
- */
-
-PyObject *Ipo_Init( void );
-PyObject *Ipo_CreatePyObject( struct Ipo *ipo );
-Ipo *Ipo_FromPyObject( PyObject * py_obj );
-
-
-#endif /* EXPP_IPO_H */
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
deleted file mode 100644
index 5dfb52f2733..00000000000
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ /dev/null
@@ -1,1106 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Nathan Letwory, Ken Hughes, Johnny Matthews
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Ipocurve.h" /*This must come first*/
-
-#include "Object.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_depsgraph.h"
-#include "BKE_ipo.h"
-#include "BKE_utildefines.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "BSE_editipo.h"
-#include "MEM_guardedalloc.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_scene_types.h"
-#include "BezTriple.h"
-#include "gen_utils.h"
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.IpoCurve.__doc__ */
-/*****************************************************************************/
-char M_IpoCurve_doc[] = "";
-char M_IpoCurve_New_doc[] = "";
-char M_IpoCurve_Get_doc[] = "";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.IpoCurve module: */
-/*****************************************************************************/
-
-struct PyMethodDef M_IpoCurve_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python C_IpoCurve methods declarations: */
-/*****************************************************************************/
-static PyObject *IpoCurve_getName( C_IpoCurve * self );
-static PyObject *IpoCurve_Recalc( C_IpoCurve * self );
-static PyObject *IpoCurve_append( C_IpoCurve * self, PyObject * value );
-static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject * value );
-static PyObject *IpoCurve_delBezier( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_setInterpolation( C_IpoCurve * self,
- PyObject * value );
-static PyObject *IpoCurve_getInterpolation( C_IpoCurve * self );
-static PyObject *IpoCurve_newgetInterp( C_IpoCurve * self );
-static int IpoCurve_newsetInterp( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_setExtrapolation( C_IpoCurve * self,
- PyObject * value );
-static PyObject *IpoCurve_getExtrapolation( C_IpoCurve * self );
-static PyObject *IpoCurve_newgetExtend( C_IpoCurve * self );
-static int IpoCurve_newsetExtend( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getPoints( C_IpoCurve * self );
-static PyObject *IpoCurve_clean( C_IpoCurve * self, PyObject *value );
-static PyObject *IpoCurve_evaluate( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getDriver( C_IpoCurve * self );
-static int IpoCurve_setDriver( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getDriverObject( C_IpoCurve * self);
-static int IpoCurve_setDriverObject( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getDriverChannel( C_IpoCurve * self);
-static int IpoCurve_setDriverChannel( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getDriverExpression( C_IpoCurve * self);
-static PyObject *IpoCurve_getFlag( C_IpoCurve * self, void *type);
-static int IpoCurve_setFlag( C_IpoCurve * self, PyObject *value, void *type);
-
-static int IpoCurve_setDriverExpression( C_IpoCurve * self, PyObject * args );
-static PyObject *IpoCurve_getCurval( C_IpoCurve * self, PyObject * args );
-static int IpoCurve_setCurval( C_IpoCurve * self, PyObject * key,
- PyObject * value );
-
-/*****************************************************************************/
-/* Python C_IpoCurve methods table: */
-/*****************************************************************************/
-static PyMethodDef C_IpoCurve_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) IpoCurve_getName, METH_NOARGS,
- "() - Return IpoCurve name"},
- {"Recalc", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
- "() - deprecated method. use recalc() instead"},
- {"recalc", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
- "() - Recomputes the curve after changes"},
- {"update", ( PyCFunction ) IpoCurve_Recalc, METH_NOARGS,
- "() - deprecated method: use recalc method instead."},
- {"append", ( PyCFunction ) IpoCurve_append, METH_O,
- "(coordlist) - Adds a Bezier point to a curve"},
- {"addBezier", ( PyCFunction ) IpoCurve_addBezier, METH_O,
- "() - deprecated method. use append() instead"},
- {"delBezier", ( PyCFunction ) IpoCurve_delBezier, METH_VARARGS,
- "() - deprecated method. use \"del icu[index]\" instead"},
- {"setInterpolation", ( PyCFunction ) IpoCurve_setInterpolation,
- METH_O, "(str) - Sets the interpolation type of the curve"},
- {"getInterpolation", ( PyCFunction ) IpoCurve_getInterpolation,
- METH_NOARGS, "() - Gets the interpolation type of the curve"},
- {"setExtrapolation", ( PyCFunction ) IpoCurve_setExtrapolation,
- METH_O, "(str) - Sets the extend mode of the curve"},
- {"getExtrapolation", ( PyCFunction ) IpoCurve_getExtrapolation,
- METH_NOARGS, "() - Gets the extend mode of the curve"},
- {"getPoints", ( PyCFunction ) IpoCurve_getPoints, METH_NOARGS,
- "() - Returns list of all bezTriples of the curve"},
- {"evaluate", ( PyCFunction ) IpoCurve_evaluate, METH_VARARGS,
- "(float) - Evaluate curve at given time"},
- {"clean", ( PyCFunction ) IpoCurve_clean, METH_VARARGS,
- "(float) - Clean BezTriples using the given threshold value"},
- {NULL, NULL, 0, NULL}
-};
-
-/*
- * IpoCurve methods
- */
-
-static PyGetSetDef C_IpoCurve_getseters[] = {
- {"name",
- (getter)IpoCurve_getName, (setter)NULL,
- "the IpoCurve name",
- NULL},
- {"bezierPoints",
- (getter)IpoCurve_getPoints, (setter)NULL,
- "list of all bezTriples of the curve",
- NULL},
- {"driver",
- (getter)IpoCurve_getDriver, (setter)IpoCurve_setDriver,
- "The status of the driver 1-object, 2-py expression, 0-off",
- NULL},
- {"driverObject",
- (getter)IpoCurve_getDriverObject, (setter)IpoCurve_setDriverObject,
- "The object used to drive the IpoCurve",
- NULL},
- {"driverChannel",
- (getter)IpoCurve_getDriverChannel, (setter)IpoCurve_setDriverChannel,
- "The channel on the driver object used to drive the IpoCurve",
- NULL},
- {"driverExpression",
- (getter)IpoCurve_getDriverExpression, (setter)IpoCurve_setDriverExpression,
- "The python expression on the driver used to drive the IpoCurve",
- NULL},
- {"interpolation",
- (getter)IpoCurve_newgetInterp, (setter)IpoCurve_newsetInterp,
- "The interpolation mode of the curve",
- NULL},
- {"extend",
- (getter)IpoCurve_newgetExtend, (setter)IpoCurve_newsetExtend,
- "The extend mode of the curve",
- NULL},
-
- {"sel",
- (getter)IpoCurve_getFlag, (setter)IpoCurve_setFlag,
- "the selection state of the curve",
- (void *)IPO_SELECT},
-
- {NULL,NULL,NULL,NULL,NULL}
-};
-
-/*****************************************************************************/
-/* Python IpoCurve_Type Mapping Methods table: */
-/*****************************************************************************/
-
-static PyMappingMethods IpoCurve_as_mapping = {
- ( inquiry ) 0, /* mp_length */
- ( binaryfunc ) IpoCurve_getCurval, /* mp_subscript */
- ( objobjargproc ) IpoCurve_setCurval, /* mp_ass_subscript */
-};
-
-/*****************************************************************************/
-/* Python IpoCurve_Type callback function prototypes: */
-/*****************************************************************************/
-static int IpoCurve_compare( C_IpoCurve * a, C_IpoCurve * b );
-static PyObject *IpoCurve_repr( C_IpoCurve * self );
-
-/*****************************************************************************/
-/* Python IpoCurve_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject IpoCurve_Type = {
- PyObject_HEAD_INIT( NULL ) /* required macro */
- 0, /* ob_size */
- "IpoCurve", /* tp_name */
- sizeof( C_IpoCurve ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) NULL, /* tp_getattr */
- ( setattrfunc ) NULL, /* tp_setattr */
- ( cmpfunc ) IpoCurve_compare, /* tp_compare */
- ( reprfunc ) IpoCurve_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &IpoCurve_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- C_IpoCurve_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- C_IpoCurve_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* local utility functions */
-/*****************************************************************************/
-
-/*
- * Keys are handled differently than other Ipos, so go through contortions
- * to find their names.
- */
-
-static char *get_key_curvename( IpoCurve *ipocurve )
-{
- Key *key_iter;
- char *empty = "";
-
- /* search for keys with an Ipo */
-
- for( key_iter = G.main->key.first; key_iter; key_iter=key_iter->id.next) {
- if( key_iter->ipo ) {
- IpoCurve *icu = key_iter->ipo->curve.first;
- /* search curves for a match */
- while( icu ) {
- if( icu == ipocurve ) {
- KeyBlock *block = key_iter->block.first;
- /* search for matching adrcode */
- while( block ) {
- if( block->adrcode == ipocurve->adrcode )
- return block->name;
- block = block->next;
- }
- }
- icu = icu->next;
- }
- }
- }
-
- /* shouldn't get here unless deleted in UI while BPy object alive */
- return empty;
-}
-
-/*
- * internal bpy func to get Ipo Curve Name, used by Ipo.c and
- * KX_BlenderSceneConverter.cpp.
- *
- * We are returning a pointer to string constants so there are
- * no issues with who owns pointers.
- */
-
-char *getIpoCurveName( IpoCurve * icu )
-{
- switch ( icu->blocktype ) {
- case ID_MA:
- return getname_mat_ei( icu->adrcode );
- case ID_WO:
- return getname_world_ei( icu->adrcode );
- case ID_CA:
- return getname_cam_ei( icu->adrcode );
- case ID_OB:
- return getname_ob_ei( icu->adrcode, 1 );
- /* solve: what if EffX/Y/Z are wanted? */
- case ID_TE:
- return getname_tex_ei( icu->adrcode );
- case ID_LA:
- return getname_la_ei( icu->adrcode );
- case ID_PO:
- return getname_ac_ei( icu->adrcode );
- case ID_CU:
- return getname_cu_ei( icu->adrcode );
- case ID_KE:
- /* return "Key"; */
- /* ipo curves have no names... that was only meant for drawing the buttons... (ton) */
- return get_key_curvename( icu );
- case ID_SEQ:
- return getname_seq_ei( icu->adrcode );
- case ID_CO:
- return getname_co_ei( icu->adrcode );
- }
- return NULL;
-}
-
-/*
- * delete a bezTriple from a curve
- */
-
-static void del_beztriple( IpoCurve *icu, int index )
-{
- int npoints = icu->totvert - 1;
- BezTriple * tmp = icu->bezt;
-
- /*
- * if delete empties list, then delete it, otherwise copy the remaining
- * points to a new list
- */
-
- if( !npoints ) {
- icu->bezt = NULL;
- } else {
- icu->bezt =
- MEM_mallocN( sizeof( BezTriple ) * npoints, "bezt" );
- if( index > 0 )
- memmove( icu->bezt, tmp, index * sizeof( BezTriple ) );
- if( index < npoints )
- memmove( icu->bezt + index, tmp + index + 1,
- ( npoints - index ) * sizeof( BezTriple ) );
- }
-
- /* free old list, adjust vertex count */
- MEM_freeN( tmp );
- icu->totvert--;
-
- /* call calchandles_* instead of testhandles_* */
- /* I'm not sure this is a complete solution but since we do not */
- /* deal with curve handles right now, it seems ok */
- calchandles_ipocurve( icu );
-}
-
-/*****************************************************************************/
-/* Python C_IpoCurve methods: */
-/*****************************************************************************/
-
-static PyObject *IpoCurve_setInterpolation( C_IpoCurve * self,
- PyObject * value )
-{
- char *interpolationtype = PyString_AsString(value);
- short id;
-
- if( !interpolationtype )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( !strcmp( interpolationtype, "Bezier" ) )
- id = IPO_BEZ;
- else if( !strcmp( interpolationtype, "Constant" ) )
- id = IPO_CONST;
- else if( !strcmp( interpolationtype, "Linear" ) )
- id = IPO_LIN;
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "bad interpolation type" );
-
- self->ipocurve->ipo = id;
- Py_RETURN_NONE;
-}
-
-static PyObject *IpoCurve_getInterpolation( C_IpoCurve * self )
-{
- char *str = 0;
- IpoCurve *icu = self->ipocurve;
-
- switch( icu->ipo ) {
- case IPO_BEZ:
- str = "Bezier";
- break;
- case IPO_CONST:
- str = "Constant";
- break;
- case IPO_LIN:
- str = "Linear";
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "unknown interpolation type" );
- }
-
- return PyString_FromString( str );
-}
-
-static PyObject * IpoCurve_setExtrapolation( C_IpoCurve * self,
- PyObject * value )
-{
- char *extrapolationtype = PyString_AsString(value);
- short id;
-
- if( !extrapolationtype )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( !strcmp( extrapolationtype, "Constant" ) )
- id = 0;
- else if( !strcmp( extrapolationtype, "Extrapolation" ) )
- id = 1;
- else if( !strcmp( extrapolationtype, "Cyclic" ) )
- id = 2;
- else if( !strcmp( extrapolationtype, "Cyclic_extrapolation" ) )
- id = 3;
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "bad interpolation type" );
-
- self->ipocurve->extrap = id;
- Py_RETURN_NONE;
-}
-
-static PyObject *IpoCurve_getExtrapolation( C_IpoCurve * self )
-{
- char *str;
- IpoCurve *icu = self->ipocurve;
-
- switch( icu->extrap ) {
- case 0:
- str = "Constant";
- break;
- case 1:
- str = "Extrapolation";
- break;
- case 2:
- str = "Cyclic";
- break;
- case 3:
- str = "Cyclic_extrapolation";
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "bad extrapolation type" );
- }
-
- return PyString_FromString( str );
-}
-
-/*
- * append a new BezTriple to curve
- */
-
-static PyObject *IpoCurve_append( C_IpoCurve * self, PyObject * value )
-{
- float x, y;
- IpoCurve *icu = self->ipocurve;
-
- /* if args is a already a beztriple, tack onto end of list */
- if( BPy_BezTriple_Check ( value ) ) {
- BPy_BezTriple *bobj = (BPy_BezTriple *)value;
-
- BezTriple *newb = MEM_callocN( (icu->totvert+1)*sizeof(BezTriple),
- "BPyBeztriple" );
- if( icu->bezt ) {
- memcpy( newb, icu->bezt, ( icu->totvert )*sizeof( BezTriple ) );
- MEM_freeN( icu->bezt );
- }
- icu->bezt = newb;
- memcpy( &icu->bezt[icu->totvert], bobj->beztriple,
- sizeof( BezTriple ) );
- icu->totvert++;
- calchandles_ipocurve( icu );
-
- /* otherwise try to get two floats and add to list */
- } else {
- PyObject *xobj, *yobj;
- xobj = PyNumber_Float( PyTuple_GetItem( value, 0 ) );
- yobj = PyNumber_Float( PyTuple_GetItem( value, 1 ) );
-
- if( !xobj || !yobj )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected tuple of floats" );
-
- x = (float)PyFloat_AsDouble( xobj );
- Py_DECREF( xobj );
- y = (float)PyFloat_AsDouble( yobj );
- Py_DECREF( yobj );
- insert_vert_icu( icu, x, y, 0);
- }
-
- Py_RETURN_NONE;
-}
-
-/*
- Function: IpoCurve_delBezier
- Bpy: Blender.Ipocurve.delBezier(0)
-
- Delete an BezTriple from an IPO curve.
- example:
- ipo = Blender.Ipo.Get('ObIpo')
- cu = ipo.getCurve('LocX')
- cu.delBezier(0)
-*/
-
-static PyObject *IpoCurve_delBezier( C_IpoCurve * self, PyObject * args )
-{
- int index;
-
- if( !PyArg_ParseTuple( args, "i", &index ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- /* if index is negative, count from end of list */
- if( index < 0 )
- index += self->ipocurve->totvert;
- /* check range of index */
- if( index < 0 || index > self->ipocurve->totvert - 1 )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index outside of list" );
-
- del_beztriple( self->ipocurve, index );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *IpoCurve_Recalc( C_IpoCurve * self )
-{
- IpoCurve *icu = self->ipocurve;
-
- /* testhandles_ipocurve (icu); */
- /* call calchandles_* instead of testhandles_* */
- /* I'm not sure this is a complete solution but since we do not */
- /* deal with curve handles right now, it seems ok */
- calchandles_ipocurve( icu );
- sort_time_ipocurve( icu );
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-static PyObject *IpoCurve_getName( C_IpoCurve * self )
-{
- switch ( self->ipocurve->blocktype ) {
- case ID_OB:
- return PyString_FromString( getname_ob_ei( self->ipocurve->adrcode, 1 ) ); /* solve: what if EffX/Y/Z are wanted? */
- case ID_TE:
- return PyString_FromString( getname_tex_ei
- ( self->ipocurve->adrcode ) );
- case ID_LA:
- return PyString_FromString( getname_la_ei
- ( self->ipocurve->adrcode ) );
- case ID_MA:
- return PyString_FromString( getname_mat_ei
- ( self->ipocurve->adrcode ) );
- case ID_CA:
- return PyString_FromString( getname_cam_ei
- ( self->ipocurve->adrcode ) );
- case ID_WO:
- return PyString_FromString( getname_world_ei
- ( self->ipocurve->adrcode ) );
- case ID_PO:
- return PyString_FromString( getname_ac_ei
- ( self->ipocurve->adrcode ) );
- case ID_CU:
- return PyString_FromString( getname_cu_ei
- ( self->ipocurve->adrcode ) );
- case ID_KE:
- return PyString_FromString( get_key_curvename( self->ipocurve ) );
- case ID_SEQ:
- return PyString_FromString( getname_seq_ei
- ( self->ipocurve->adrcode ) );
- case ID_CO:
- return PyString_FromString( getname_co_ei
- ( self->ipocurve->adrcode ) );
- default:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "This function doesn't support this ipocurve type yet" );
- }
-}
-
-static PyObject *IpoCurve_getPoints( C_IpoCurve * self )
-{
- BezTriple *bezt;
- PyObject *po;
- int i;
- PyObject *list = PyList_New( self->ipocurve->totvert );
-
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyList_New() failed" );
-
- for( bezt = self->ipocurve->bezt, i = 0;
- i < self->ipocurve->totvert; i++, bezt++ ) {
- po = BezTriple_CreatePyObject( bezt );
- if( !po ) {
- Py_DECREF( list );
- return NULL; /* This is okay since the error is alredy set */
- }
- PyList_SET_ITEM( list, i, po );
- }
- return list;
-}
-
-/*****************************************************************************/
-/* Function: IpoCurve_compare */
-/* Description: This compares 2 python types, == or != only. */
-/*****************************************************************************/
-static int IpoCurve_compare( C_IpoCurve * a, C_IpoCurve * b )
-{
- return ( a->ipocurve == b->ipocurve ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: IpoCurve_repr */
-/* Description: This is a callback function for the C_IpoCurve type. It */
-/* builds a meaningful string to represent ipocurve objects. */
-/*****************************************************************************/
-static PyObject *IpoCurve_repr( C_IpoCurve * self )
-{
- return PyString_FromFormat( "[IpoCurve \"%s\"]",
- getIpoCurveName( self->ipocurve ) );
-}
-
-/* Three Python IpoCurve_Type helper functions needed by the Object module: */
-
-/*****************************************************************************/
-/* Function: IpoCurve_CreatePyObject */
-/* Description: This function will create a new C_IpoCurve from an existing */
-/* Blender ipo structure. */
-/*****************************************************************************/
-PyObject *IpoCurve_CreatePyObject( IpoCurve * icu )
-{
- C_IpoCurve *pyipo;
-
- pyipo = ( C_IpoCurve * ) PyObject_NEW( C_IpoCurve, &IpoCurve_Type );
-
- if( !pyipo )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create C_IpoCurve object" );
-
- pyipo->ipocurve = icu;
-
- return ( PyObject * ) pyipo;
-}
-
-/*****************************************************************************/
-/* Function: IpoCurve_FromPyObject */
-/* Description: This function returns the Blender ipo from the given */
-/* PyObject. */
-/*****************************************************************************/
-IpoCurve *IpoCurve_FromPyObject( PyObject * pyobj )
-{
- return ( ( C_IpoCurve * ) pyobj )->ipocurve;
-}
-
-/*
- * get the value of an Ipocurve at a particular time
- */
-
-static PyObject *IpoCurve_getCurval( C_IpoCurve * self, PyObject * args )
-{
- float time;
- PyObject *pyfloat = PyNumber_Float( args );
-
- if( !pyfloat )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
- time = ( float )PyFloat_AS_DOUBLE( pyfloat );
- Py_DECREF( pyfloat );
-
- return PyFloat_FromDouble( ( double ) eval_icu( self->ipocurve, time ) );
-}
-
-/*
- * set the value of an Ipocurve at a particular time
- */
-
-static int IpoCurve_setCurval( C_IpoCurve * self, PyObject * key,
- PyObject * value )
-{
- float time, curval;
- PyObject *pyfloat;
-
- /* make sure time, curval are both floats */
-
- pyfloat = PyNumber_Float( key );
- if( !pyfloat )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float key" );
- time = ( float )PyFloat_AS_DOUBLE( pyfloat );
- Py_DECREF( pyfloat );
-
- pyfloat = PyNumber_Float( value );
- if( !pyfloat )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
- curval = ( float )PyFloat_AS_DOUBLE( pyfloat );
- Py_DECREF( pyfloat );
-
- /* insert a key at the specified time */
-
- insert_vert_icu( self->ipocurve, time, curval, 0);
- allspace(REMAKEIPO, 0);
- return 0;
-}
-
-/***************************************************************************/
-/* Function: IpoCurve_evaluate( time ) */
-/* Description: Evaluates IPO curve at the given time. */
-/***************************************************************************/
-
-static PyObject *IpoCurve_evaluate( C_IpoCurve * self, PyObject * args )
-{
- float time = 0;
- double eval = 0;
-
- /* expecting float */
- if( !PyArg_ParseTuple( args, "f", &time ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected float argument" ) );
-
- eval = ( double ) eval_icu( self->ipocurve, time );
-
- return PyFloat_FromDouble( eval );
-
-}
-
-/***************************************************************************/
-/* Function: IpoCurve_clean( thresh ) */
-/* Description: Cleans IPO curve with the (optional) threshold. */
-/***************************************************************************/
-static PyObject *IpoCurve_clean( C_IpoCurve * self, PyObject * args )
-{
- float thresh, othresh;
-
- thresh= othresh= G.scene->toolsettings->clean_thresh;
-
- /* expecting float */
- if( !PyArg_ParseTuple( args, "|f", &thresh ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected float argument" ) );
-
- /* set IPO-cleaning threshold based on value provided by user (temporarily) */
- G.scene->toolsettings->clean_thresh= thresh;
- clean_ipo_curve( self->ipocurve );
- G.scene->toolsettings->clean_thresh= othresh;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *IpoCurve_getDriver( C_IpoCurve * self )
-{
- if( !self->ipocurve->driver )
- return PyInt_FromLong( 0 );
- else {
- if (self->ipocurve->driver->type == IPO_DRIVER_TYPE_NORMAL)
- return PyInt_FromLong( 1 );
- if (self->ipocurve->driver->type == IPO_DRIVER_TYPE_PYTHON)
- return PyInt_FromLong( 2 );
- }
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unknown driver type, internal error" );
-
-}
-
-/*
- sets the driver to
- 0: disabled
- 1: enabled (object)
- 2: enabled (python expression)
-*/
-static int IpoCurve_setDriver( C_IpoCurve * self, PyObject * args )
-{
- IpoCurve *ipo = self->ipocurve;
- int type;
- if( !PyInt_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument 0 or 1 " );
-
- type = PyInt_AS_LONG( args );
-
- if (type < 0 || type > 2)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected int argument 0, 1 or 2" );
-
- if (type==0) { /* disable driver */
- if( ipo->driver ) {
- MEM_freeN( ipo->driver );
- ipo->driver = NULL;
- }
- } else {
- if( !ipo->driver ) { /*add driver if its not there */
- ipo->driver = MEM_callocN( sizeof(IpoDriver), "ipo driver" );
- ipo->driver->blocktype = ID_OB;
- ipo->driver->adrcode = OB_LOC_X;
- }
-
- if (type==1 && ipo->driver->type != IPO_DRIVER_TYPE_NORMAL) {
- ipo->driver->type = IPO_DRIVER_TYPE_NORMAL;
- ipo->driver->ob = NULL;
- ipo->driver->flag &= ~IPO_DRIVER_FLAG_INVALID;
-
- } else if (type==2 && ipo->driver->type != IPO_DRIVER_TYPE_PYTHON) {
- ipo->driver->type = IPO_DRIVER_TYPE_PYTHON;
- /* we should probably set ipo->driver->ob, but theres no way to do it properly */
- ipo->driver->ob = NULL;
- }
- }
-
- return 0;
-}
-
-static PyObject *IpoCurve_getDriverObject( C_IpoCurve * self )
-{
- IpoCurve *ipo = self->ipocurve;
-
- if( ipo->driver )
- return Object_CreatePyObject( ipo->driver->ob );
-
- Py_RETURN_NONE;
-}
-
-static int IpoCurve_setDriverObject( C_IpoCurve * self, PyObject * arg )
-{
- IpoCurve *ipo = self->ipocurve;
-
- if( !ipo->driver )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This IpoCurve does not have an active driver" );
-
- if(!BPy_Object_Check(arg) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "expected an object argument" );
- ipo->driver->ob = ((BPy_Object *)arg)->object;
-
- DAG_scene_sort(G.scene);
-
- return 0;
-}
-
-static PyObject *IpoCurve_getDriverChannel( C_IpoCurve * self )
-{
- if( !self->ipocurve->driver )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This IpoCurve does not have an active driver" );
-
- return PyInt_FromLong( self->ipocurve->driver->adrcode );
-}
-
-static int IpoCurve_setDriverChannel( C_IpoCurve * self, PyObject * args )
-{
- IpoCurve *ipo = self->ipocurve;
- short param;
-
- if( !ipo->driver )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This IpoCurve does not have an active driver" );
-
- if( !PyInt_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- param = (short)PyInt_AS_LONG ( args );
- if( ( param >= OB_LOC_X && param <= OB_LOC_Z )
- || ( param >= OB_ROT_X && param <= OB_ROT_Z )
- || ( param >= OB_SIZE_X && param <= OB_SIZE_Z ) ) {
- ipo->driver->adrcode = (short)PyInt_AS_LONG ( args );
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_ValueError, "invalid int argument" );
-}
-
-static PyObject *IpoCurve_getDriverExpression( C_IpoCurve * self )
-{
- IpoCurve *ipo = self->ipocurve;
-
- if( ipo->driver && ipo->driver->type == IPO_DRIVER_TYPE_PYTHON )
- return PyString_FromString( ipo->driver->name );
-
- Py_RETURN_NONE;
-}
-
-static int IpoCurve_setDriverExpression( C_IpoCurve * self, PyObject * arg )
-{
- IpoCurve *ipo = self->ipocurve;
- char *exp; /* python expression */
-
- if( !ipo->driver )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This IpoCurve does not have an active driver" );
-
- if (ipo->driver->type != IPO_DRIVER_TYPE_PYTHON)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This IpoCurve is not a python expression set the driver attribute to 2" );
-
- if(!PyString_Check(arg) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "expected a string argument" );
-
- exp = PyString_AsString(arg);
- if (strlen(exp)>127)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "string is too long, use 127 characters or less" );
-
- strcpy(ipo->driver->name, exp);
- return 0;
-}
-
-static PyObject *M_IpoCurve_ExtendDict( void )
-{
- PyObject *EM = PyConstant_New( );
-
- if( EM ) {
- BPy_constant *d = ( BPy_constant * ) EM;
-
- PyConstant_Insert( d, "CONST", PyInt_FromLong( IPO_HORIZ ) );
- PyConstant_Insert( d, "EXTRAP", PyInt_FromLong( IPO_DIR ) );
- PyConstant_Insert( d, "CYCLIC", PyInt_FromLong( IPO_CYCL ) );
- PyConstant_Insert( d, "CYCLIC_EXTRAP", PyInt_FromLong( IPO_CYCLX ) );
- }
- return EM;
-}
-
-static PyObject *M_IpoCurve_InterpDict( void )
-{
- PyObject *IM = PyConstant_New( );
-
- if( IM ) {
- BPy_constant *d = ( BPy_constant * ) IM;
-
- PyConstant_Insert( d, "CONST", PyInt_FromLong( IPO_CONST ) );
- PyConstant_Insert( d, "LINEAR", PyInt_FromLong( IPO_LIN ) );
- PyConstant_Insert( d, "BEZIER", PyInt_FromLong( IPO_BEZ ) );
- }
- return IM;
-}
-
-/*****************************************************************************/
-/* Function: IpoCurve_Init */
-/*****************************************************************************/
-PyObject *IpoCurve_Init( void )
-{
- PyObject *submodule;
- PyObject *ExtendTypes = M_IpoCurve_ExtendDict( );
- PyObject *InterpTypes = M_IpoCurve_InterpDict( );
-
- if( PyType_Ready( &IpoCurve_Type ) < 0)
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.IpoCurve", M_IpoCurve_methods,
- M_IpoCurve_doc );
-
- PyModule_AddIntConstant( submodule, "LOC_X", OB_LOC_X );
- PyModule_AddIntConstant( submodule, "LOC_Y", OB_LOC_Y );
- PyModule_AddIntConstant( submodule, "LOC_Z", OB_LOC_Z );
- PyModule_AddIntConstant( submodule, "ROT_X", OB_ROT_X );
- PyModule_AddIntConstant( submodule, "ROT_Y", OB_ROT_Y );
- PyModule_AddIntConstant( submodule, "ROT_Z", OB_ROT_Z );
- PyModule_AddIntConstant( submodule, "SIZE_X", OB_SIZE_X );
- PyModule_AddIntConstant( submodule, "SIZE_Y", OB_SIZE_Y );
- PyModule_AddIntConstant( submodule, "SIZE_Z", OB_SIZE_Z );
-
- if( ExtendTypes )
- PyModule_AddObject( submodule, "ExtendTypes", ExtendTypes );
- if( InterpTypes )
- PyModule_AddObject( submodule, "InterpTypes", InterpTypes );
-
- return submodule;
-}
-
-/*
- */
-
-static PyObject *IpoCurve_newgetInterp( C_IpoCurve * self )
-{
- return PyInt_FromLong( self->ipocurve->ipo );
-}
-
-static int IpoCurve_newsetInterp( C_IpoCurve * self, PyObject * value )
-{
- return EXPP_setIValueRange( value, &self->ipocurve->ipo,
- IPO_CONST, IPO_BEZ, 'h' );
-}
-
-static PyObject *IpoCurve_newgetExtend( C_IpoCurve * self )
-{
- return PyInt_FromLong( self->ipocurve->extrap );
-}
-
-static int IpoCurve_newsetExtend( C_IpoCurve * self, PyObject * value )
-{
- return EXPP_setIValueRange( value, &self->ipocurve->extrap,
- IPO_HORIZ, IPO_CYCLX, 'h' );
-}
-
-static PyObject *IpoCurve_getFlag( C_IpoCurve * self, void *type )
-{
- if (self->ipocurve->flag & GET_INT_FROM_POINTER(type))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int IpoCurve_setFlag( C_IpoCurve * self, PyObject *value, void *type )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param)
- self->ipocurve->flag |= GET_INT_FROM_POINTER(type);
- else
- self->ipocurve->flag &= ~GET_INT_FROM_POINTER(type);
-
- return 0;
-}
-
-
-/* #####DEPRECATED###### */
-
-static PyObject *IpoCurve_addBezier( C_IpoCurve * self, PyObject * value )
-{
- float x, y;
- int npoints;
- IpoCurve *icu;
- BezTriple *bzt, *tmp;
- static char name[10] = "mlml";
- if( !PyArg_ParseTuple( value, "ff", &x, &y ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected a tuple of 2 floats" ) );
-
- icu = self->ipocurve;
- npoints = icu->totvert;
- tmp = icu->bezt;
- icu->bezt = MEM_mallocN( sizeof( BezTriple ) * ( npoints + 1 ), name );
- if( tmp ) {
- memmove( icu->bezt, tmp, sizeof( BezTriple ) * npoints );
- MEM_freeN( tmp );
- }
- memmove( icu->bezt + npoints, icu->bezt, sizeof( BezTriple ) );
- icu->totvert++;
- bzt = icu->bezt + npoints;
- bzt->vec[0][0] = x - 1;
- bzt->vec[1][0] = x;
- bzt->vec[2][0] = x + 1;
- bzt->vec[0][1] = y - 1;
- bzt->vec[1][1] = y;
- bzt->vec[2][1] = y + 1;
- /* set handle type to Auto */
- bzt->h1 = HD_AUTO;
- bzt->h2 = HD_AUTO;
-
- Py_RETURN_NONE;
-}
diff --git a/source/blender/python/api2_2x/Ipocurve.h b/source/blender/python/api2_2x/Ipocurve.h
deleted file mode 100644
index 6f474d4d167..00000000000
--- a/source/blender/python/api2_2x/Ipocurve.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_IPOCURVE_H
-#define EXPP_IPOCURVE_H
-
-#include <Python.h>
-#include "DNA_ipo_types.h" /* declaration of IpoCurve */
-
-/*****************************************************************************/
-/* Python C_IpoCurve structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required macro */
- IpoCurve * ipocurve;
- char wrapped;
-} C_IpoCurve;
-
-extern PyTypeObject IpoCurve_Type;
-
-#define BPy_IpoCurve_Check(v) ((v)->ob_type == &IpoCurve_Type) /* for type checking */
-
-PyObject *IpoCurve_Init( void );
-PyObject *IpoCurve_CreatePyObject( IpoCurve * ipo );
-IpoCurve *IpoCurve_FromPyObject( PyObject * pyobj );
-char *getIpoCurveName( IpoCurve * icu );
-
-
-#endif /* EXPP_IPOCURVE_H */
diff --git a/source/blender/python/api2_2x/Key.c b/source/blender/python/api2_2x/Key.c
deleted file mode 100644
index 856dabdde74..00000000000
--- a/source/blender/python/api2_2x/Key.c
+++ /dev/null
@@ -1,678 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Pontus Lidman, Johnny Matthews, Ken Hughes,
- * Michael Reimpell
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Key.h" /*This must come first*/
-#include "vector.h"
-
-#include "DNA_scene_types.h"
-
-#include <BLI_blenlib.h>
-#include <BKE_global.h>
-#include <BKE_main.h>
-#include <BKE_curve.h>
-#include <BKE_library.h>
-#include <BKE_utildefines.h>
-#include "BIF_space.h"
-
-#include "Ipocurve.h"
-#include "NMesh.h" /* we create NMesh.NMVert objects */
-#include "Ipo.h"
-#include "BezTriple.h"
-
-#include "BSE_editipo.h"
-#include "mydevice.h"
-#include "BKE_depsgraph.h"
-#include "blendef.h"
-#include "constant.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#define KEY_TYPE_MESH 0
-#define KEY_TYPE_CURVE 1
-#define KEY_TYPE_LATTICE 2
-
-static int Key_compare( BPy_Key * a, BPy_Key * b );
-static PyObject *Key_repr( BPy_Key * self );
-static void Key_dealloc( BPy_Key * self );
-
-static PyObject *Key_getBlocks( BPy_Key * self );
-static PyObject *Key_getType( BPy_Key * self );
-static PyObject *Key_getRelative( BPy_Key * self );
-static PyObject *Key_getIpo( BPy_Key * self );
-static int Key_setIpo( BPy_Key * self, PyObject * args );
-static PyObject *Key_getValue( BPy_Key * self );
-static int Key_setRelative( BPy_Key * self, PyObject * value );
-
-static struct PyMethodDef Key_methods[] = {
- { "getBlocks", (PyCFunction) Key_getBlocks, METH_NOARGS, "Get key blocks" },
- { "getIpo", (PyCFunction) Key_getIpo, METH_NOARGS, "Get key Ipo" },
- { 0, 0, 0, 0 }
-};
-
-static PyGetSetDef BPy_Key_getsetters[] = {
- {"type",(getter)Key_getType, (setter)NULL,
- "Key Type",NULL},
- {"value",(getter)Key_getValue, (setter)NULL,
- "Key value",NULL},
- {"ipo",(getter)Key_getIpo, (setter)Key_setIpo,
- "Ipo linked to key",NULL},
- {"blocks",(getter)Key_getBlocks, (setter)NULL,
- "Blocks linked to the key",NULL},
- {"relative",(getter)Key_getRelative, (setter)Key_setRelative,
- "Non-zero is key is relative",NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-static PyObject *KeyBlock_getData( PyObject * self );
-static PyObject *KeyBlock_getCurval( BPy_KeyBlock * self );
-static PyObject *KeyBlock_getName( BPy_KeyBlock * self );
-static PyObject *KeyBlock_getPos( BPy_KeyBlock * self );
-static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self );
-static PyObject *KeyBlock_getSlidermax( BPy_KeyBlock * self );
-static PyObject *KeyBlock_getVgroup( BPy_KeyBlock * self );
-
-static int KeyBlock_setName( BPy_KeyBlock *, PyObject * args );
-static int KeyBlock_setVgroup( BPy_KeyBlock *, PyObject * args );
-static int KeyBlock_setSlidermin( BPy_KeyBlock *, PyObject * args );
-static int KeyBlock_setSlidermax( BPy_KeyBlock *, PyObject * args );
-
-static void KeyBlock_dealloc( BPy_KeyBlock * self );
-static int KeyBlock_compare( BPy_KeyBlock * a, BPy_KeyBlock * b );
-static PyObject *KeyBlock_repr( BPy_KeyBlock * self );
-
-static struct PyMethodDef KeyBlock_methods[] = {
- { "getData", (PyCFunction) KeyBlock_getData, METH_NOARGS,
- "Get keyblock data" },
- { 0, 0, 0, 0 }
-};
-
-static PyGetSetDef BPy_KeyBlock_getsetters[] = {
- {"curval",(getter)KeyBlock_getCurval, (setter)NULL,
- "Current value of the corresponding IpoCurve",NULL},
- {"name",(getter)KeyBlock_getName, (setter)KeyBlock_setName,
- "Keyblock Name",NULL},
- {"pos",(getter)KeyBlock_getPos, (setter)NULL,
- "Keyblock Pos",NULL},
- {"slidermin",(getter)KeyBlock_getSlidermin, (setter)KeyBlock_setSlidermin,
- "Keyblock Slider Minimum",NULL},
- {"slidermax",(getter)KeyBlock_getSlidermax, (setter)KeyBlock_setSlidermax,
- "Keyblock Slider Maximum",NULL},
- {"vgroup",(getter)KeyBlock_getVgroup, (setter)KeyBlock_setVgroup,
- "Keyblock VGroup",NULL},
- {"data",(getter)KeyBlock_getData, (setter)NULL,
- "Keyblock VGroup",NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-PyTypeObject Key_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /*ob_size */
- "Blender Key", /*tp_name */
- sizeof( BPy_Key ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) Key_dealloc,/* destructor tp_dealloc; */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) 0, /*tp_getattr */
- ( setattrfunc ) 0, /*tp_setattr */
- ( cmpfunc) Key_compare, /*tp_compare*/
- ( reprfunc ) Key_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- Key_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Key_getsetters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-PyTypeObject KeyBlock_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /*ob_size */
- "Blender KeyBlock", /*tp_name */
- sizeof( BPy_KeyBlock ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) KeyBlock_dealloc,/* destructor tp_dealloc; */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) 0, /*tp_getattr */
- ( setattrfunc ) 0, /*tp_setattr */
- ( cmpfunc) KeyBlock_compare, /*tp_compare*/
- ( reprfunc ) KeyBlock_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- KeyBlock_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_KeyBlock_getsetters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-PyObject *Key_CreatePyObject( Key * blenkey )
-{
- BPy_Key *bpykey = PyObject_NEW( BPy_Key, &Key_Type );
- /* blenkey may be NULL so be careful */
- bpykey->key = blenkey;
- return ( PyObject * ) bpykey;
-}
-
-static void Key_dealloc( BPy_Key * self )
-{
- PyObject_DEL( self );
-}
-
-static int Key_compare( BPy_Key * a, BPy_Key * b )
-{
- return ( a->key == b->key ) ? 0 : -1;
-}
-
-static PyObject *Key_repr( BPy_Key * self )
-{
- return PyString_FromFormat( "[Key \"%s\"]", self->key->id.name + 2 );
-}
-
-static PyObject *Key_getIpo( BPy_Key * self )
-{
- if (self->key->ipo)
- return Ipo_CreatePyObject( self->key->ipo );
- Py_RETURN_NONE;
-}
-
-static int Key_setIpo( BPy_Key * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->key->ipo, 0, 1, ID_IP, ID_KE);
-}
-
-static PyObject *Key_getRelative( BPy_Key * self )
-{
- if( self->key->type == KEY_RELATIVE )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Key_setRelative( BPy_Key * self, PyObject * value )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->key->type = KEY_RELATIVE;
- else
- self->key->type = KEY_NORMAL;
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-
- return 0;
-}
-
-static PyObject *Key_getType( BPy_Key * self )
-{
- int idcode;
- int type = -1;
-
- idcode = GS( self->key->from->name );
-
- switch( idcode ) {
- case ID_ME:
- type = KEY_TYPE_MESH;
- break;
- case ID_CU:
- type = KEY_TYPE_CURVE;
- break;
- case ID_LT:
- type = KEY_TYPE_LATTICE;
- break;
- }
-
- return PyInt_FromLong( type );
-}
-
-static PyObject *Key_getBlocks( BPy_Key * self )
-{
- Key *key = self->key;
- KeyBlock *kb;
- int i=0;
- PyObject *l = PyList_New( BLI_countlist( &(key->block)) );
-
- for (kb = key->block.first; kb; kb = kb->next, i++)
- PyList_SET_ITEM( l, i, KeyBlock_CreatePyObject( kb, key ) );
-
- return l;
-}
-
-static PyObject *Key_getValue( BPy_Key * self )
-{
- BPy_Key *k = ( BPy_Key * ) self;
-
- return PyFloat_FromDouble( k->key->curval );
-}
-
-/* ------------ Key Block Functions -------------- */
-PyObject *KeyBlock_CreatePyObject( KeyBlock * keyblock, Key *parentKey )
-{
- BPy_KeyBlock *bpykb = PyObject_NEW( BPy_KeyBlock, &KeyBlock_Type );
- bpykb->key = parentKey;
- bpykb->keyblock = keyblock; /* keyblock maye be NULL, thats ok */
- return ( PyObject * ) bpykb;
-}
-
-static PyObject *KeyBlock_getCurval( BPy_KeyBlock * self ) {
- return PyFloat_FromDouble( self->keyblock->curval );
-}
-
-static PyObject *KeyBlock_getName( BPy_KeyBlock * self ) {
- return PyString_FromString(self->keyblock->name);
-}
-
-static PyObject *KeyBlock_getPos( BPy_KeyBlock * self ){
- return PyFloat_FromDouble( self->keyblock->pos );
-}
-
-static PyObject *KeyBlock_getSlidermin( BPy_KeyBlock * self ){
- return PyFloat_FromDouble( self->keyblock->slidermin );
-}
-
-static PyObject *KeyBlock_getSlidermax( BPy_KeyBlock * self ){
- return PyFloat_FromDouble( self->keyblock->slidermax );
-}
-
-static PyObject *KeyBlock_getVgroup( BPy_KeyBlock * self ){
- return PyString_FromString(self->keyblock->vgroup);
-}
-
-static int KeyBlock_setName( BPy_KeyBlock * self, PyObject * args ){
- char* text = NULL;
-
- text = PyString_AsString ( args );
- if( !text )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
- strncpy( self->keyblock->name, text , 32);
-
- return 0;
-}
-
-static int KeyBlock_setVgroup( BPy_KeyBlock * self, PyObject * args ){
- char* text = NULL;
-
- text = PyString_AsString ( args );
- if( !text )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
- strncpy( self->keyblock->vgroup, text , 32);
-
- return 0;
-}
-static int KeyBlock_setSlidermin( BPy_KeyBlock * self, PyObject * args ){
- return EXPP_setFloatClamped ( args, &self->keyblock->slidermin,
- -10.0f,
- 10.0f );
-}
-static int KeyBlock_setSlidermax( BPy_KeyBlock * self, PyObject * args ){
- return EXPP_setFloatClamped ( args, &self->keyblock->slidermax,
- -10.0f,
- 10.0f );
-}
-
-static void KeyBlock_dealloc( BPy_KeyBlock * self )
-{
- PyObject_DEL( self );
-}
-
-static int KeyBlock_compare( BPy_KeyBlock * a, BPy_KeyBlock * b )
-{
- return ( a->keyblock == b->keyblock ) ? 0 : -1;
-}
-
-static PyObject *KeyBlock_repr( BPy_KeyBlock * self )
-{
- return PyString_FromFormat( "[KeyBlock \"%s\"]", self->keyblock->name );
-}
-
-
-static Curve *find_curve( Key *key )
-{
- Curve *cu;
-
- if( !key )
- return NULL;
-
- for( cu = G.main->curve.first; cu; cu = cu->id.next ) {
- if( cu->key == key )
- break;
- }
- return cu;
-}
-
-static PyObject *KeyBlock_getData( PyObject * self )
-{
- /* If this is a mesh key, data is an array of MVert coords.
- If lattice, data is an array of BPoint coords
- If curve, data is an array of BezTriple or BPoint */
-
- char *datap;
- int datasize;
- int idcode;
- int i;
- Curve *cu;
- Nurb* nu;
- PyObject *l;
- BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
- Key *key = kb->key;
-
- if( !kb->keyblock->data ) {
- Py_RETURN_NONE;
- }
-
- l = PyList_New( kb->keyblock->totelem );
- if( !l )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyList_New() failed" );
-
- idcode = GS( key->from->name );
-
- switch(idcode) {
- case ID_ME:
-
- for (i=0, datap = kb->keyblock->data; i<kb->keyblock->totelem; i++) {
- PyObject *vec = newVectorObject((float*)datap, 3, Py_WRAP);
-
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyList_SetItem(l, i, vec);
- datap += kb->key->elemsize;
- }
- break;
-
- case ID_CU:
- cu = find_curve ( key );
- if( !cu )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "key is no linked to any curve!" );
- datasize = count_curveverts(&cu->nurb);
- nu = cu->nurb.first;
- if( nu->bezt ) {
- datasize /= 3;
- Py_DECREF (l);
- l = PyList_New( datasize );
- for( i = 0, datap = kb->keyblock->data; i < datasize;
- i++, datap += sizeof(float)*3*4) {
- PyObject *tuple = PyTuple_New(4), *vec;
- float *vecs = (float*)datap;
-
- if (!tuple) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyTuple_New() failed!" );
-
- vec = newVectorObject(vecs, 3, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "Could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyTuple_SET_ITEM( tuple, 0, vec);
-
- vecs += 3;
- vec = newVectorObject(vecs, 3, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "Could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyTuple_SET_ITEM( tuple, 1, vec);
-
- vecs += 3;
- vec = newVectorObject(vecs, 3, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "Could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyTuple_SET_ITEM( tuple, 2, vec);
-
- /*tilts*/
- vecs += 3;
- vec = newVectorObject(vecs, 3, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "Could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyTuple_SET_ITEM( tuple, 3, vec);
-
- PyList_SetItem( l, i, tuple );
- }
- } else {
- for( i = 0, datap = kb->keyblock->data; i < datasize;
- i++, datap += kb->key->elemsize ) {
- PyObject *vec = newVectorObject((float*)datap, 4, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyList_SetItem( l, i, vec );
- }
- }
- break;
-
- case ID_LT:
- for( i = 0, datap = kb->keyblock->data; i < kb->keyblock->totelem;
- i++, datap += kb->key->elemsize ) {
- PyObject *vec = newVectorObject((float*)datap, 3, Py_WRAP);
- if (!vec) return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "Could not allocate memory for Blender.Mathutils.Vector wrapper!" );
-
- PyList_SetItem( l, i, vec );
- }
- break;
- }
-
- return l;
-}
-
-static PyObject *M_Key_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Key *key_iter;
- char error_msg[64];
- int i;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- if ( name ) {
- for (key_iter = G.main->key.first; key_iter;
- key_iter=key_iter->id.next) {
- if (strcmp ( key_iter->id.name + 2, name ) == 0 ) {
- return Key_CreatePyObject( key_iter );
- }
- }
-
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Key \"%s\" not found", name );
- return EXPP_ReturnPyObjError ( PyExc_NameError, error_msg );
-
- } else {
-
- PyObject *keylist;
-
- keylist = PyList_New( BLI_countlist( &( G.main->key ) ) );
-
- for ( i=0, key_iter = G.main->key.first; key_iter;
- key_iter=key_iter->id.next, i++ ) {
- PyList_SetItem(keylist, i, Key_CreatePyObject(key_iter));
- }
- return keylist;
- }
-}
-
-struct PyMethodDef M_Key_methods[] = {
- {"Get", M_Key_Get, METH_VARARGS, "Get a key or all key names"},
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *M_Key_TypesDict( void )
-{
- PyObject *T = PyConstant_New( );
-
- if( T ) {
- BPy_constant *d = ( BPy_constant * ) T;
-
- PyConstant_Insert( d, "MESH", PyInt_FromLong( KEY_TYPE_MESH ) );
- PyConstant_Insert( d, "CURVE", PyInt_FromLong( KEY_TYPE_CURVE ) );
- PyConstant_Insert( d, "LATTICE", PyInt_FromLong( KEY_TYPE_LATTICE ) );
- }
-
- return T;
-}
-
-PyObject *Key_Init( void )
-{
- PyObject *submodule;
- PyObject *Types = NULL;
-
- if( PyType_Ready( &Key_Type ) < 0 || PyType_Ready( &KeyBlock_Type ) < 0 )
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Key", M_Key_methods, "Key module" );
-
- Types = M_Key_TypesDict( );
- if( Types )
- PyModule_AddObject( submodule, "Types", Types );
-
- return submodule;
-}
-
diff --git a/source/blender/python/api2_2x/Key.h b/source/blender/python/api2_2x/Key.h
deleted file mode 100644
index f4950c5e96f..00000000000
--- a/source/blender/python/api2_2x/Key.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Pontus Lidman
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EXPP_KEY_H
-#define EXPP_KEY_H
-
-#include "Python.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <DNA_key_types.h>
-#include <DNA_curve_types.h>
-
-extern PyTypeObject Key_Type;
-extern PyTypeObject KeyBlock_Type;
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- Key * key; /* libdata must be second */
- /* Object *object;*/ /* for vertex grouping info, since it's stored on the object */
- /*PyObject *keyBlock;*/
- /*PyObject *ipo;*/
-} BPy_Key;
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- Key *key;
- KeyBlock * keyblock;
- /* Object *object;*/ /* for vertex grouping info, since it's stored on the object */
-} BPy_KeyBlock;
-
-PyObject *Key_CreatePyObject( Key * k );
-PyObject *KeyBlock_CreatePyObject( KeyBlock * k, Key *parentKey );
-
-PyObject *Key_Init( void );
-
-#endif /* EXPP_KEY_H */
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c
deleted file mode 100644
index 799833d4ee0..00000000000
--- a/source/blender/python/api2_2x/Lamp.c
+++ /dev/null
@@ -1,1728 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Nathan Letwory, Stephen Swaney,
- * Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Lamp.h" /*This must come first*/
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_library.h"
-#include "BKE_texture.h"
-#include "BLI_blenlib.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "BSE_editipo.h"
-#include "mydevice.h"
-#include "Ipo.h"
-#include "MTex.h"
-#include "constant.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "BKE_utildefines.h"
-#include "DNA_userdef_types.h"
-#include "MEM_guardedalloc.h"
-
-/*****************************************************************************/
-/* Python BPy_Lamp defaults: */
-/*****************************************************************************/
-
-/* Lamp types */
-
-/* NOTE:
- these are the same values as LA_* from DNA_lamp_types.h
- is there some reason we are not simply using those #defines?
- s. swaney 8-oct-2004
-*/
-
-#define EXPP_LAMP_TYPE_LAMP 0
-#define EXPP_LAMP_TYPE_SUN 1
-#define EXPP_LAMP_TYPE_SPOT 2
-#define EXPP_LAMP_TYPE_HEMI 3
-#define EXPP_LAMP_TYPE_AREA 4
-#define EXPP_LAMP_TYPE_YF_PHOTON 5
-/*
- define a constant to keep magic numbers out of the code
- this value should be equal to the last EXPP_LAMP_TYPE_*
-*/
-#define EXPP_LAMP_TYPE_MAX 5
-
-/* Lamp mode flags */
-
-#define EXPP_LAMP_MODE_SHADOWS 1
-#define EXPP_LAMP_MODE_HALO 2
-#define EXPP_LAMP_MODE_LAYER 4
-#define EXPP_LAMP_MODE_QUAD 8
-#define EXPP_LAMP_MODE_NEGATIVE 16
-#define EXPP_LAMP_MODE_ONLYSHADOW 32
-#define EXPP_LAMP_MODE_SPHERE 64
-#define EXPP_LAMP_MODE_SQUARE 128
-#define EXPP_LAMP_MODE_TEXTURE 256
-#define EXPP_LAMP_MODE_OSATEX 512
-#define EXPP_LAMP_MODE_DEEPSHADOW 1024
-#define EXPP_LAMP_MODE_NODIFFUSE 2048
-#define EXPP_LAMP_MODE_NOSPECULAR 4096
-#define EXPP_LAMP_MODE_SHAD_RAY 8192
-#define EXPP_LAMP_MODE_LAYER_SHADOW 32768
-
-/* Lamp MIN, MAX values */
-
-#define EXPP_LAMP_SAMPLES_MIN 1
-#define EXPP_LAMP_SAMPLES_MAX 16
-#define EXPP_LAMP_BUFFERSIZE_MIN 512
-#define EXPP_LAMP_BUFFERSIZE_MAX 5120
-#define EXPP_LAMP_ENERGY_MIN 0.0
-#define EXPP_LAMP_ENERGY_MAX 10.0
-#define EXPP_LAMP_DIST_MIN 0.1f
-#define EXPP_LAMP_DIST_MAX 5000.0
-#define EXPP_LAMP_SPOTSIZE_MIN 1.0
-#define EXPP_LAMP_SPOTSIZE_MAX 180.0
-#define EXPP_LAMP_SPOTBLEND_MIN 0.00
-#define EXPP_LAMP_SPOTBLEND_MAX 1.00
-#define EXPP_LAMP_CLIPSTART_MIN 0.1f
-#define EXPP_LAMP_CLIPSTART_MAX 1000.0
-#define EXPP_LAMP_CLIPEND_MIN 1.0
-#define EXPP_LAMP_CLIPEND_MAX 5000.0
-#define EXPP_LAMP_BIAS_MIN 0.01f
-#define EXPP_LAMP_BIAS_MAX 5.00
-#define EXPP_LAMP_SOFTNESS_MIN 1.0
-#define EXPP_LAMP_SOFTNESS_MAX 100.0
-#define EXPP_LAMP_HALOINT_MIN 0.0
-#define EXPP_LAMP_HALOINT_MAX 5.0
-#define EXPP_LAMP_HALOSTEP_MIN 0
-#define EXPP_LAMP_HALOSTEP_MAX 12
-#define EXPP_LAMP_QUAD1_MIN 0.0
-#define EXPP_LAMP_QUAD1_MAX 1.0
-#define EXPP_LAMP_QUAD2_MIN 0.0
-#define EXPP_LAMP_QUAD2_MAX 1.0
-#define EXPP_LAMP_COL_MIN 0.0
-#define EXPP_LAMP_COL_MAX 1.0
-#define EXPP_LAMP_FALLOFF_MIN LA_FALLOFF_CONSTANT
-#define EXPP_LAMP_FALLOFF_MAX LA_FALLOFF_SLIDERS
-
-/* Raytracing settings */
-#define EXPP_LAMP_RAYSAMPLES_MIN 1
-#define EXPP_LAMP_RAYSAMPLES_MAX 16
-#define EXPP_LAMP_AREASIZE_MIN 0.01f
-#define EXPP_LAMP_AREASIZE_MAX 100.0f
-
-/* Lamp_setComponent() keys for which color to get/set */
-#define EXPP_LAMP_COMP_R 0x00
-#define EXPP_LAMP_COMP_G 0x01
-#define EXPP_LAMP_COMP_B 0x02
-
-#define IPOKEY_RGB 0
-#define IPOKEY_ENERGY 1
-#define IPOKEY_SPOTSIZE 2
-#define IPOKEY_OFFSET 3
-#define IPOKEY_SIZE 4
-
-/*****************************************************************************/
-/* Python API function prototypes for the Lamp module. */
-/*****************************************************************************/
-static PyObject *M_Lamp_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_Lamp_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Lamp.__doc__ */
-/*****************************************************************************/
-static char M_Lamp_doc[] = "The Blender Lamp module\n\n\
-This module provides control over **Lamp Data** objects in Blender.\n\n\
-Example::\n\n\
- from Blender import Lamp\n\
- l = Lamp.New('Spot') # create new 'Spot' lamp data\n\
- l.setMode('square', 'shadow') # set these two lamp mode flags\n\
- ob = Object.New('Lamp') # create new lamp object\n\
- ob.link(l) # link lamp obj with lamp data\n";
-
-static char M_Lamp_New_doc[] = "Lamp.New (type = 'Lamp', name = 'LampData'):\n\
- Return a new Lamp Data object with the given type and name.";
-
-static char M_Lamp_Get_doc[] = "Lamp.Get (name = None):\n\
- Return the Lamp Data with the given name, None if not found, or\n\
- Return a list with all Lamp Data objects in the current scene,\n\
- if no argument was given.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Lamp module: */
-/*****************************************************************************/
-struct PyMethodDef M_Lamp_methods[] = {
- {"New", ( PyCFunction ) M_Lamp_New, METH_VARARGS | METH_KEYWORDS,
- M_Lamp_New_doc},
- {"Get", M_Lamp_Get, METH_VARARGS, M_Lamp_Get_doc},
- {"get", M_Lamp_Get, METH_VARARGS, M_Lamp_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Lamp methods declarations: */
-/*****************************************************************************/
-static PyObject *Lamp_getType( BPy_Lamp * self );
-static PyObject *Lamp_getTypesConst( void );
-static PyObject *Lamp_getMode( BPy_Lamp * self );
-static PyObject *Lamp_getModesConst( void );
-static PyObject *Lamp_getSamples( BPy_Lamp * self );
-static PyObject *Lamp_getRaySamplesX( BPy_Lamp * self );
-static PyObject *Lamp_getRaySamplesY( BPy_Lamp * self );
-static PyObject *Lamp_getAreaSizeX( BPy_Lamp * self );
-static PyObject *Lamp_getAreaSizeY( BPy_Lamp * self );
-static PyObject *Lamp_getBufferSize( BPy_Lamp * self );
-static PyObject *Lamp_getHaloStep( BPy_Lamp * self );
-static PyObject *Lamp_getEnergy( BPy_Lamp * self );
-static PyObject *Lamp_getDist( BPy_Lamp * self );
-static PyObject *Lamp_getSpotSize( BPy_Lamp * self );
-static PyObject *Lamp_getSpotBlend( BPy_Lamp * self );
-static PyObject *Lamp_getClipStart( BPy_Lamp * self );
-static PyObject *Lamp_getClipEnd( BPy_Lamp * self );
-static PyObject *Lamp_getBias( BPy_Lamp * self );
-static PyObject *Lamp_getSoftness( BPy_Lamp * self );
-static PyObject *Lamp_getHaloInt( BPy_Lamp * self );
-static PyObject *Lamp_getQuad1( BPy_Lamp * self );
-static PyObject *Lamp_getQuad2( BPy_Lamp * self );
-static PyObject *Lamp_getCol( BPy_Lamp * self );
-static PyObject *Lamp_getIpo( BPy_Lamp * self );
-static PyObject *Lamp_getComponent( BPy_Lamp * self, void * closure );
-static PyObject *Lamp_getTextures( BPy_Lamp * self );
-static PyObject *Lamp_clearIpo( BPy_Lamp * self );
-static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetIpo( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value );
-static PyObject *Lamp_oldsetMode( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetSamples( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetRaySamplesX( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetRaySamplesY( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetAreaSizeX( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetAreaSizeY( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetBufferSize( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetHaloStep( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetEnergy( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetDist( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetSpotSize( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetSpotBlend( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetClipStart( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetClipEnd( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetBias( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetSoftness( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetHaloInt( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetQuad1( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetQuad2( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_oldsetCol( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_copy( BPy_Lamp * self );
-static int Lamp_setIpo( BPy_Lamp * self, PyObject * args );
-static int Lamp_setType( BPy_Lamp * self, PyObject * args );
-static int Lamp_setMode( BPy_Lamp * self, PyObject * args );
-static int Lamp_setSamples( BPy_Lamp * self, PyObject * args );
-static int Lamp_setRaySamplesX( BPy_Lamp * self, PyObject * args );
-static int Lamp_setRaySamplesY( BPy_Lamp * self, PyObject * args );
-static int Lamp_setAreaSizeX( BPy_Lamp * self, PyObject * args );
-static int Lamp_setAreaSizeY( BPy_Lamp * self, PyObject * args );
-static int Lamp_setBufferSize( BPy_Lamp * self, PyObject * args );
-static int Lamp_setHaloStep( BPy_Lamp * self, PyObject * args );
-static int Lamp_setEnergy( BPy_Lamp * self, PyObject * args );
-static int Lamp_setDist( BPy_Lamp * self, PyObject * args );
-static int Lamp_setSpotSize( BPy_Lamp * self, PyObject * args );
-static int Lamp_setSpotBlend( BPy_Lamp * self, PyObject * args );
-static int Lamp_setClipStart( BPy_Lamp * self, PyObject * args );
-static int Lamp_setClipEnd( BPy_Lamp * self, PyObject * args );
-static int Lamp_setBias( BPy_Lamp * self, PyObject * args );
-static int Lamp_setSoftness( BPy_Lamp * self, PyObject * args );
-static int Lamp_setHaloInt( BPy_Lamp * self, PyObject * args );
-static int Lamp_setQuad1( BPy_Lamp * self, PyObject * args );
-static int Lamp_setQuad2( BPy_Lamp * self, PyObject * args );
-static int Lamp_setCol( BPy_Lamp * self, PyObject * args );
-static int Lamp_setTextures( BPy_Lamp * self, PyObject * value );
-static PyObject *Lamp_getScriptLinks( BPy_Lamp * self, PyObject * value );
-static PyObject *Lamp_addScriptLink( BPy_Lamp * self, PyObject * args );
-static PyObject *Lamp_clearScriptLinks( BPy_Lamp * self, PyObject * args );
-static int Lamp_setComponent( BPy_Lamp * self, PyObject * value, void * closure );
-static PyObject *Lamp_getFalloffType( BPy_Lamp * self );
-static int Lamp_setFalloffType( BPy_Lamp * self, PyObject * value );
-
-/*****************************************************************************/
-/* Python BPy_Lamp methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Lamp_methods[] = {
- /* name, method, flags, doc */
-
- {"getType", ( PyCFunction ) Lamp_getType, METH_NOARGS,
- "() - return Lamp type - 'Lamp':0, 'Sun':1, 'Spot':2, 'Hemi':3, 'Area':4, 'Photon':5"},
- {"getMode", ( PyCFunction ) Lamp_getMode, METH_NOARGS,
- "() - return Lamp mode flags (or'ed value)"},
- {"getSamples", ( PyCFunction ) Lamp_getSamples, METH_NOARGS,
- "() - return Lamp samples value"},
- {"getRaySamplesX", ( PyCFunction ) Lamp_getRaySamplesX, METH_NOARGS,
- "() - return Lamp raytracing samples on the X axis"},
- {"getRaySamplesY", ( PyCFunction ) Lamp_getRaySamplesY, METH_NOARGS,
- "() - return Lamp raytracing samples on the Y axis"},
- {"getAreaSizeX", ( PyCFunction ) Lamp_getAreaSizeX, METH_NOARGS,
- "() - return Lamp area size on the X axis"},
- {"getAreaSizeY", ( PyCFunction ) Lamp_getAreaSizeY, METH_NOARGS,
- "() - return Lamp area size on the Y axis"},
- {"getBufferSize", ( PyCFunction ) Lamp_getBufferSize, METH_NOARGS,
- "() - return Lamp buffer size value"},
- {"getHaloStep", ( PyCFunction ) Lamp_getHaloStep, METH_NOARGS,
- "() - return Lamp halo step value"},
- {"getEnergy", ( PyCFunction ) Lamp_getEnergy, METH_NOARGS,
- "() - return Lamp energy value"},
- {"getDist", ( PyCFunction ) Lamp_getDist, METH_NOARGS,
- "() - return Lamp clipping distance value"},
- {"getSpotSize", ( PyCFunction ) Lamp_getSpotSize, METH_NOARGS,
- "() - return Lamp spot size value"},
- {"getSpotBlend", ( PyCFunction ) Lamp_getSpotBlend, METH_NOARGS,
- "() - return Lamp spot blend value"},
- {"getClipStart", ( PyCFunction ) Lamp_getClipStart, METH_NOARGS,
- "() - return Lamp clip start value"},
- {"getClipEnd", ( PyCFunction ) Lamp_getClipEnd, METH_NOARGS,
- "() - return Lamp clip end value"},
- {"getBias", ( PyCFunction ) Lamp_getBias, METH_NOARGS,
- "() - return Lamp bias value"},
- {"getSoftness", ( PyCFunction ) Lamp_getSoftness, METH_NOARGS,
- "() - return Lamp softness value"},
- {"getHaloInt", ( PyCFunction ) Lamp_getHaloInt, METH_NOARGS,
- "() - return Lamp halo intensity value"},
- {"getQuad1", ( PyCFunction ) Lamp_getQuad1, METH_NOARGS,
- "() - return light intensity value #1 for a Quad Lamp"},
- {"getQuad2", ( PyCFunction ) Lamp_getQuad2, METH_NOARGS,
- "() - return light intensity value #2 for a Quad Lamp"},
- {"getCol", ( PyCFunction ) Lamp_getCol, METH_NOARGS,
- "() - return light rgb color triplet"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - rename Lamp"},
- {"setType", ( PyCFunction ) Lamp_oldsetType, METH_O,
- "(str) - change Lamp type, which can be 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', 'Photon'"},
- {"setMode", ( PyCFunction ) Lamp_oldsetMode, METH_VARARGS,
- "([up to eight str's]) - Set Lamp mode flag(s)"},
- {"setSamples", ( PyCFunction ) Lamp_oldsetSamples, METH_VARARGS,
- "(int) - change Lamp samples value"},
- {"setRaySamplesX", ( PyCFunction ) Lamp_oldsetRaySamplesX, METH_VARARGS,
- "(int) - change Lamp ray X samples value in [1,16]"},
- {"setRaySamplesY", ( PyCFunction ) Lamp_oldsetRaySamplesY, METH_VARARGS,
- "(int) - change Lamp ray Y samples value in [1,16]"},
- {"setAreaSizeX", ( PyCFunction ) Lamp_oldsetAreaSizeX, METH_VARARGS,
- "(float) - change Lamp ray X size for area lamps, value in [0.01, 100.0]"},
- {"setAreaSizeY", ( PyCFunction ) Lamp_oldsetAreaSizeY, METH_VARARGS,
- "(float) - change Lamp ray Y size for area lamps, value in [0.01, 100.0]"},
- {"setBufferSize", ( PyCFunction ) Lamp_oldsetBufferSize, METH_VARARGS,
- "(int) - change Lamp buffer size value"},
- {"setHaloStep", ( PyCFunction ) Lamp_oldsetHaloStep, METH_VARARGS,
- "(int) - change Lamp halo step value"},
- {"setEnergy", ( PyCFunction ) Lamp_oldsetEnergy, METH_VARARGS,
- "(float) - change Lamp energy value"},
- {"setDist", ( PyCFunction ) Lamp_oldsetDist, METH_VARARGS,
- "(float) - change Lamp clipping distance value"},
- {"setSpotSize", ( PyCFunction ) Lamp_oldsetSpotSize, METH_VARARGS,
- "(float) - change Lamp spot size value"},
- {"setSpotBlend", ( PyCFunction ) Lamp_oldsetSpotBlend, METH_VARARGS,
- "(float) - change Lamp spot blend value"},
- {"setClipStart", ( PyCFunction ) Lamp_oldsetClipStart, METH_VARARGS,
- "(float) - change Lamp clip start value"},
- {"setClipEnd", ( PyCFunction ) Lamp_oldsetClipEnd, METH_VARARGS,
- "(float) - change Lamp clip end value"},
- {"setBias", ( PyCFunction ) Lamp_oldsetBias, METH_VARARGS,
- "(float) - change Lamp draw size value"},
- {"setSoftness", ( PyCFunction ) Lamp_oldsetSoftness, METH_VARARGS,
- "(float) - change Lamp softness value"},
- {"setHaloInt", ( PyCFunction ) Lamp_oldsetHaloInt, METH_VARARGS,
- "(float) - change Lamp halo intensity value"},
- {"setQuad1", ( PyCFunction ) Lamp_oldsetQuad1, METH_VARARGS,
- "(float) - change light intensity value #1 for a Quad Lamp"},
- {"setQuad2", ( PyCFunction ) Lamp_oldsetQuad2, METH_VARARGS,
- "(float) - change light intensity value #2 for a Quad Lamp"},
- {"setCol", ( PyCFunction ) Lamp_oldsetCol, METH_VARARGS,
- "(f,f,f) or ([f,f,f]) - change light's rgb color triplet"},
- {"getScriptLinks", ( PyCFunction ) Lamp_getScriptLinks, METH_O,
- "(eventname) - Get a list of this lamp's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) Lamp_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new lamp scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) Lamp_clearScriptLinks,
- METH_VARARGS,
- "() - Delete all scriptlinks from this lamp.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this lamp."},
- {"getIpo", ( PyCFunction ) Lamp_getIpo, METH_NOARGS,
- "() - get IPO for this lamp"},
- {"clearIpo", ( PyCFunction ) Lamp_clearIpo, METH_NOARGS,
- "() - unlink the IPO for this lamp"},
- {"setIpo", ( PyCFunction ) Lamp_oldsetIpo, METH_VARARGS,
- "( lamp-ipo ) - link an IPO to this lamp"},
- {"insertIpoKey", ( PyCFunction ) Lamp_insertIpoKey, METH_VARARGS,
- "( Lamp IPO type ) - Inserts a key into IPO"},
- {"__copy__", ( PyCFunction ) Lamp_copy, METH_NOARGS,
- "() - Makes a copy of this lamp."},
- {"copy", ( PyCFunction ) Lamp_copy, METH_NOARGS,
- "() - Makes a copy of this lamp."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Lamp_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"bias",
- (getter)Lamp_getBias, (setter)Lamp_setBias,
- "Lamp shadow map sampling bias",
- NULL},
- {"bufferSize",
- (getter)Lamp_getBufferSize, (setter)Lamp_setBufferSize,
- "Lamp shadow buffer size",
- NULL},
- {"clipEnd",
- (getter)Lamp_getClipEnd, (setter)Lamp_setClipEnd,
- "Lamp shadow map clip end",
- NULL},
- {"clipStart",
- (getter)Lamp_getClipStart, (setter)Lamp_setClipStart,
- "Lamp shadow map clip start",
- NULL},
- {"col",
- (getter)Lamp_getCol, (setter)Lamp_setCol,
- "Lamp RGB color triplet",
- NULL},
- {"dist",
- (getter)Lamp_getDist, (setter)Lamp_setDist,
- "Lamp clipping distance",
- NULL},
- {"energy",
- (getter)Lamp_getEnergy, (setter)Lamp_setEnergy,
- "Lamp light intensity",
- NULL},
- {"haloInt",
- (getter)Lamp_getHaloInt, (setter)Lamp_setHaloInt,
- "Lamp spotlight halo intensity",
- NULL},
- {"haloStep",
- (getter)Lamp_getHaloStep, (setter)Lamp_setHaloStep,
- "Lamp volumetric halo sampling frequency",
- NULL},
- {"ipo",
- (getter)Lamp_getIpo, (setter)Lamp_setIpo,
- "Lamp Ipo",
- NULL},
- {"mode",
- (getter)Lamp_getMode, (setter)Lamp_setMode,
- "Lamp mode bitmask",
- NULL},
- {"quad1",
- (getter)Lamp_getQuad1, (setter)Lamp_setQuad1,
- "Quad lamp linear distance attenuation",
- NULL},
- {"quad2",
- (getter)Lamp_getQuad2, (setter)Lamp_setQuad2,
- "Quad lamp quadratic distance attenuation",
- NULL},
- {"samples",
- (getter)Lamp_getSamples, (setter)Lamp_setSamples,
- "Lamp shadow map samples",
- NULL},
- {"raySamplesX",
- (getter)Lamp_getRaySamplesX, (setter)Lamp_setRaySamplesX,
- "Lamp raytracing samples on the X axis",
- NULL},
- {"raySamplesY",
- (getter)Lamp_getRaySamplesY, (setter)Lamp_setRaySamplesY,
- "Lamp raytracing samples on the Y axis",
- NULL},
- {"areaSizeX",
- (getter)Lamp_getAreaSizeX, (setter)Lamp_setAreaSizeX,
- "Lamp X size for an arealamp",
- NULL},
- {"areaSizeY",
- (getter)Lamp_getAreaSizeY, (setter)Lamp_setAreaSizeY,
- "Lamp Y size for an arealamp",
- NULL},
- {"softness",
- (getter)Lamp_getSoftness, (setter)Lamp_setSoftness,
- "Lamp shadow sample area size",
- NULL},
- {"spotBlend",
- (getter)Lamp_getSpotBlend, (setter)Lamp_setSpotBlend,
- "Lamp spotlight edge softness",
- NULL},
- {"spotSize",
- (getter)Lamp_getSpotSize, (setter)Lamp_setSpotSize,
- "Lamp spotlight beam angle (in degrees)",
- NULL},
- {"type",
- (getter)Lamp_getType, (setter)Lamp_setType,
- "Lamp type",
- NULL},
- {"falloffType",
- (getter)Lamp_getFalloffType, (setter)Lamp_setFalloffType,
- "Lamp falloff type",
- NULL},
- {"R",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color red component",
- (void *)EXPP_LAMP_COMP_R},
- {"r",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color red component",
- (void *)EXPP_LAMP_COMP_R},
- {"G",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color green component",
- (void *)EXPP_LAMP_COMP_G},
- {"g",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color green component",
- (void *)EXPP_LAMP_COMP_G},
- {"B",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color blue component",
- (void *)EXPP_LAMP_COMP_B},
- {"b",
- (getter)Lamp_getComponent, (setter)Lamp_setComponent,
- "Lamp color blue component",
- (void *)EXPP_LAMP_COMP_B},
- {"textures",
- (getter)Lamp_getTextures, (setter)Lamp_setTextures,
- "The Lamp's texture list as a tuple",
- NULL},
- {"Modes",
- (getter)Lamp_getModesConst, (setter)NULL,
- "Dictionary of values for 'mode' attribute",
- NULL},
- {"Types",
- (getter)Lamp_getTypesConst, (setter)NULL,
- "Dictionary of values for 'type' attribute",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python TypeLamp callback function prototypes: */
-/*****************************************************************************/
-static void Lamp_dealloc( BPy_Lamp * lamp );
-static int Lamp_compare( BPy_Lamp * a, BPy_Lamp * b );
-static PyObject *Lamp_repr( BPy_Lamp * lamp );
-
-/*****************************************************************************/
-/* Python TypeLamp structure definition: */
-/*****************************************************************************/
-PyTypeObject Lamp_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Lamp", /* char *tp_name; */
- sizeof( BPy_Lamp ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Lamp_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Lamp_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Lamp_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Lamp_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Lamp_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: M_Lamp_New */
-/* Python equivalent: Blender.Lamp.New */
-/*****************************************************************************/
-static PyObject *M_Lamp_New( PyObject * self, PyObject * args,
- PyObject * keywords )
-{
- char *type_str = "Lamp";
- char *name_str = "Lamp";
- static char *kwlist[] = { "type_str", "name_str", NULL };
- BPy_Lamp *py_lamp; /* for Lamp Data object wrapper in Python */
- Lamp *bl_lamp; /* for actual Lamp Data we create in Blender */
-
- if( !PyArg_ParseTupleAndKeywords( args, keywords, "|ss", kwlist,
- &type_str, &name_str ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string(s) or empty argument" ) );
-
- bl_lamp = add_lamp( name_str ); /* first create in Blender */
-
- if( bl_lamp ) /* now create the wrapper obj in Python */
- py_lamp = ( BPy_Lamp * ) Lamp_CreatePyObject( bl_lamp );
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Lamp Data in Blender" ) );
-
- /* let's return user count to zero, because ... */
- bl_lamp->id.us = 0; /* ... add_lamp() incref'ed it */
-
- if( py_lamp == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Lamp Data object" ) );
-
- if( strcmp( type_str, "Lamp" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_LAMP;
- else if( strcmp( type_str, "Sun" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_SUN;
- else if( strcmp( type_str, "Spot" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_SPOT;
- else if( strcmp( type_str, "Hemi" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_HEMI;
- else if( strcmp( type_str, "Area" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_AREA;
- else if( strcmp( type_str, "Photon" ) == 0 )
- bl_lamp->type = ( short ) EXPP_LAMP_TYPE_YF_PHOTON;
- else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown lamp type" ) );
-
- return ( PyObject * ) py_lamp;
-}
-
-/*****************************************************************************/
-/* Function: M_Lamp_Get */
-/* Python equivalent: Blender.Lamp.Get */
-/* Description: Receives a string and returns the lamp data obj */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all lamp data names in the */
-/* current scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Lamp_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Lamp *lamp_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- lamp_iter = G.main->lamp.first;
-
- if( name ) { /* (name) - Search lamp by name */
-
- BPy_Lamp *wanted_lamp = NULL;
-
- while( ( lamp_iter ) && ( wanted_lamp == NULL ) ) {
-
- if( strcmp( name, lamp_iter->id.name + 2 ) == 0 )
- wanted_lamp =
- ( BPy_Lamp * )
- Lamp_CreatePyObject( lamp_iter );
-
- lamp_iter = lamp_iter->id.next;
- }
-
- if( wanted_lamp == NULL ) { /* Requested lamp doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Lamp \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_lamp;
- }
-
- else { /* () - return a list of all lamps in the scene */
- int index = 0;
- PyObject *lamplist, *pyobj;
-
- lamplist = PyList_New( BLI_countlist( &( G.main->lamp ) ) );
-
- if( lamplist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( lamp_iter ) {
- pyobj = Lamp_CreatePyObject( lamp_iter );
-
- if( !pyobj ) {
- Py_DECREF(lamplist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create PyLamp" ) );
- }
-
- PyList_SET_ITEM( lamplist, index, pyobj );
-
- lamp_iter = lamp_iter->id.next;
- index++;
- }
-
- return lamplist;
- }
-}
-
-static PyObject *Lamp_TypesDict( void )
-{ /* create the Blender.Lamp.Types constant dict */
- PyObject *Types = PyConstant_New( );
-
- if( Types ) {
- BPy_constant *c = ( BPy_constant * ) Types;
-
- PyConstant_Insert( c, "Lamp",
- PyInt_FromLong( EXPP_LAMP_TYPE_LAMP ) );
- PyConstant_Insert( c, "Sun",
- PyInt_FromLong( EXPP_LAMP_TYPE_SUN ) );
- PyConstant_Insert( c, "Spot",
- PyInt_FromLong( EXPP_LAMP_TYPE_SPOT ) );
- PyConstant_Insert( c, "Hemi",
- PyInt_FromLong( EXPP_LAMP_TYPE_HEMI ) );
- PyConstant_Insert( c, "Area",
- PyInt_FromLong( EXPP_LAMP_TYPE_AREA ) );
- PyConstant_Insert( c, "Photon",
- PyInt_FromLong( EXPP_LAMP_TYPE_YF_PHOTON ) );
- }
-
- return Types;
-}
-
-static PyObject *Lamp_ModesDict( void )
-{ /* create the Blender.Lamp.Modes constant dict */
- PyObject *Modes = PyConstant_New( );
-
- if( Modes ) {
- BPy_constant *c = ( BPy_constant * ) Modes;
-
- PyConstant_Insert( c, "Shadows",
- PyInt_FromLong( EXPP_LAMP_MODE_SHADOWS ) );
- PyConstant_Insert( c, "Halo",
- PyInt_FromLong( EXPP_LAMP_MODE_HALO ) );
- PyConstant_Insert( c, "Layer",
- PyInt_FromLong( EXPP_LAMP_MODE_LAYER ) );
- PyConstant_Insert( c, "Quad",
- PyInt_FromLong( EXPP_LAMP_MODE_QUAD ) );
- PyConstant_Insert( c, "Negative",
- PyInt_FromLong( EXPP_LAMP_MODE_NEGATIVE ) );
- PyConstant_Insert( c, "Sphere",
- PyInt_FromLong( EXPP_LAMP_MODE_SPHERE ) );
- PyConstant_Insert( c, "Square",
- PyInt_FromLong( EXPP_LAMP_MODE_SQUARE ) );
- PyConstant_Insert( c, "OnlyShadow",
- PyInt_FromLong( EXPP_LAMP_MODE_ONLYSHADOW ) );
- PyConstant_Insert( c, "NoDiffuse",
- PyInt_FromLong( EXPP_LAMP_MODE_NODIFFUSE ) );
- PyConstant_Insert( c, "NoSpecular",
- PyInt_FromLong( EXPP_LAMP_MODE_NOSPECULAR ) );
- PyConstant_Insert( c, "RayShadow",
- PyInt_FromLong( EXPP_LAMP_MODE_SHAD_RAY ) );
- PyConstant_Insert( c, "LayerShadow",
- PyInt_FromLong( EXPP_LAMP_MODE_LAYER_SHADOW ) );
- }
-
- return Modes;
-}
-
-static PyObject *Lamp_FalloffsDict( void )
-{ /* create the Blender.Lamp.Modes constant dict */
- PyObject *Falloffs = PyConstant_New( );
-
- if( Falloffs ) {
- BPy_constant *c = ( BPy_constant * ) Falloffs;
-
- PyConstant_Insert( c, "CONSTANT",
- PyInt_FromLong( LA_FALLOFF_CONSTANT ) );
- PyConstant_Insert( c, "INVLINEAR",
- PyInt_FromLong( LA_FALLOFF_INVLINEAR ) );
- PyConstant_Insert( c, "INVSQUARE",
- PyInt_FromLong( LA_FALLOFF_INVSQUARE ) );
- PyConstant_Insert( c, "CUSTOM",
- PyInt_FromLong( LA_FALLOFF_CURVE ) );
- PyConstant_Insert( c, "LINQUAD",
- PyInt_FromLong( LA_FALLOFF_SLIDERS ) );
- }
-
- return Falloffs;
-}
-
-/*****************************************************************************/
-/* Function: Lamp_Init */
-/*****************************************************************************/
-/* Needed by the Blender module, to register the Blender.Lamp submodule */
-PyObject *Lamp_Init( void )
-{
- PyObject *submodule, *Types, *Modes, *Falloffs;
-
- if( PyType_Ready( &Lamp_Type ) < 0)
- return NULL;
-
- Types = Lamp_TypesDict( );
- Modes = Lamp_ModesDict( );
- Falloffs = Lamp_FalloffsDict( );
-
- submodule =
- Py_InitModule3( "Blender.Lamp", M_Lamp_methods, M_Lamp_doc );
-
- if( Types )
- PyModule_AddObject( submodule, "Types", Types );
- if( Modes )
- PyModule_AddObject( submodule, "Modes", Modes );
- if( Falloffs )
- PyModule_AddObject( submodule, "Falloffs", Falloffs );
-
- PyModule_AddIntConstant( submodule, "RGB", IPOKEY_RGB );
- PyModule_AddIntConstant( submodule, "ENERGY", IPOKEY_ENERGY );
- PyModule_AddIntConstant( submodule, "SPOTSIZE", IPOKEY_SPOTSIZE );
- PyModule_AddIntConstant( submodule, "OFFSET", IPOKEY_OFFSET );
- PyModule_AddIntConstant( submodule, "SIZE", IPOKEY_SIZE );
-
- return submodule;
-}
-
-/* Three Python Lamp_Type helper functions needed by the Object module: */
-
-/*****************************************************************************/
-/* Function: Lamp_CreatePyObject */
-/* Description: This function will create a new BPy_Lamp from an existing */
-/* Blender lamp structure. */
-/*****************************************************************************/
-PyObject *Lamp_CreatePyObject( Lamp * lamp )
-{
- BPy_Lamp *pylamp;
- float *rgb[3];
-
- pylamp = ( BPy_Lamp * ) PyObject_NEW( BPy_Lamp, &Lamp_Type );
-
- if( !pylamp )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Lamp object" );
-
- pylamp->lamp = lamp;
-
- rgb[0] = &lamp->r;
- rgb[1] = &lamp->g;
- rgb[2] = &lamp->b;
-
- pylamp->color = ( BPy_rgbTuple * ) rgbTuple_New( rgb );
- Py_INCREF(pylamp->color);
-
- return ( PyObject * ) pylamp;
-}
-
-/*****************************************************************************/
-/* Function: Lamp_FromPyObject */
-/* Description: This function returns the Blender lamp from the given */
-/* PyObject. */
-/*****************************************************************************/
-Lamp *Lamp_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Lamp * ) pyobj )->lamp;
-}
-
-/*****************************************************************************/
-/* Python BPy_Lamp methods: */
-/*****************************************************************************/
-
-/* Lamp.__copy__ */
-static PyObject *Lamp_copy( BPy_Lamp * self )
-{
- Lamp *lamp = copy_lamp(self->lamp );
- lamp->id.us = 0;
- return Lamp_CreatePyObject(lamp);
-}
-
-static PyObject *Lamp_getType( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->type );
-}
-
-static PyObject *Lamp_getMode( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->mode );
-}
-
-static PyObject *Lamp_getSamples( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->samp );
-}
-
-static PyObject *Lamp_getRaySamplesX( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->ray_samp );
-}
-
-static PyObject *Lamp_getRaySamplesY( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->ray_sampy );
-}
-
-static PyObject *Lamp_getAreaSizeX( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->area_size );
-}
-
-static PyObject *Lamp_getAreaSizeY( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->area_sizey );
-}
-
-static PyObject *Lamp_getBufferSize( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->bufsize );
-}
-
-static PyObject *Lamp_getHaloStep( BPy_Lamp * self )
-{
- return PyInt_FromLong( self->lamp->shadhalostep );
-}
-
-static PyObject *Lamp_getEnergy( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->energy );
-}
-
-static PyObject *Lamp_getDist( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->dist );
-}
-
-static PyObject *Lamp_getSpotSize( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->spotsize );
-}
-
-static PyObject *Lamp_getSpotBlend( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->spotblend );
-}
-
-static PyObject *Lamp_getClipStart( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->clipsta );
-}
-
-static PyObject *Lamp_getClipEnd( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->clipend );
-}
-
-static PyObject *Lamp_getBias( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->bias );
-}
-
-static PyObject *Lamp_getSoftness( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->soft );
-}
-
-static PyObject *Lamp_getHaloInt( BPy_Lamp * self )
-{
- return PyFloat_FromDouble( self->lamp->haint );
-}
-
-static PyObject *Lamp_getQuad1( BPy_Lamp * self )
-{ /* should we complain if Lamp is not of type Quad? */
- return PyFloat_FromDouble( self->lamp->att1 );
-}
-
-static PyObject *Lamp_getQuad2( BPy_Lamp * self )
-{ /* should we complain if Lamp is not of type Quad? */
- return PyFloat_FromDouble( self->lamp->att2 );
-}
-
-static PyObject *Lamp_getCol( BPy_Lamp * self )
-{
- return rgbTuple_getCol( self->color );
-}
-
-static PyObject *Lamp_getFalloffType( BPy_Lamp * self )
-{
- return PyInt_FromLong( (int)self->lamp->falloff_type );
-}
-
-static int Lamp_setType( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueRange ( value, &self->lamp->type,
- 0, EXPP_LAMP_TYPE_MAX, 'h' );
-}
-
-static int Lamp_setMode( BPy_Lamp * self, PyObject * value )
-{
- int param;
- static int bitmask = EXPP_LAMP_MODE_SHADOWS
- | EXPP_LAMP_MODE_HALO
- | EXPP_LAMP_MODE_LAYER
- | EXPP_LAMP_MODE_QUAD
- | EXPP_LAMP_MODE_NEGATIVE
- | EXPP_LAMP_MODE_ONLYSHADOW
- | EXPP_LAMP_MODE_SPHERE
- | EXPP_LAMP_MODE_SQUARE
- | EXPP_LAMP_MODE_NODIFFUSE
- | EXPP_LAMP_MODE_NOSPECULAR
- | EXPP_LAMP_MODE_SHAD_RAY
- | EXPP_LAMP_MODE_LAYER_SHADOW;
-
- if( !PyInt_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = PyInt_AS_LONG ( value );
-
- if ( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- self->lamp->mode = param;
-
- return 0;
-}
-
-static int Lamp_setSamples( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->lamp->samp,
- EXPP_LAMP_SAMPLES_MIN,
- EXPP_LAMP_SAMPLES_MAX, 'h' );
-}
-
-
-static int Lamp_setRaySamplesX( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->lamp->ray_samp,
- EXPP_LAMP_RAYSAMPLES_MIN,
- EXPP_LAMP_RAYSAMPLES_MAX, 'h' );
-}
-
-static int Lamp_setRaySamplesY( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->lamp->ray_sampy,
- EXPP_LAMP_RAYSAMPLES_MIN,
- EXPP_LAMP_RAYSAMPLES_MAX, 'h' );
-}
-
-static int Lamp_setAreaSizeX( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->area_size,
- EXPP_LAMP_AREASIZE_MIN,
- EXPP_LAMP_AREASIZE_MAX );
-}
-
-static int Lamp_setAreaSizeY( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->area_sizey,
- EXPP_LAMP_AREASIZE_MIN,
- EXPP_LAMP_AREASIZE_MAX );
-}
-
-static int Lamp_setBufferSize( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->lamp->bufsize,
- EXPP_LAMP_BUFFERSIZE_MIN,
- EXPP_LAMP_BUFFERSIZE_MAX, 'h' );
-}
-
-static int Lamp_setHaloStep( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->lamp->shadhalostep,
- EXPP_LAMP_HALOSTEP_MIN,
- EXPP_LAMP_HALOSTEP_MAX, 'h' );
-}
-
-static int Lamp_setEnergy( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->energy,
- EXPP_LAMP_ENERGY_MIN,
- EXPP_LAMP_ENERGY_MAX );
-}
-
-static int Lamp_setDist( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->dist,
- EXPP_LAMP_DIST_MIN,
- EXPP_LAMP_DIST_MAX );
-}
-
-static int Lamp_setSpotSize( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->spotsize,
- EXPP_LAMP_SPOTSIZE_MIN,
- EXPP_LAMP_SPOTSIZE_MAX );
-}
-
-static int Lamp_setSpotBlend( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->spotblend,
- EXPP_LAMP_SPOTBLEND_MIN,
- EXPP_LAMP_SPOTBLEND_MAX );
-}
-
-static int Lamp_setClipStart( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->clipsta,
- EXPP_LAMP_CLIPSTART_MIN,
- EXPP_LAMP_CLIPSTART_MAX );
-}
-
-static int Lamp_setClipEnd( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->clipend,
- EXPP_LAMP_CLIPEND_MIN,
- EXPP_LAMP_CLIPEND_MAX );
-}
-
-static int Lamp_setBias( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->bias,
- EXPP_LAMP_BIAS_MIN,
- EXPP_LAMP_BIAS_MAX );
-}
-
-static int Lamp_setSoftness( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->soft,
- EXPP_LAMP_SOFTNESS_MIN,
- EXPP_LAMP_SOFTNESS_MAX );
-}
-
-static int Lamp_setHaloInt( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->haint,
- EXPP_LAMP_HALOINT_MIN,
- EXPP_LAMP_HALOINT_MAX );
-}
-
-static int Lamp_setQuad1( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->att1,
- EXPP_LAMP_QUAD1_MIN,
- EXPP_LAMP_QUAD1_MAX );
-}
-
-static int Lamp_setQuad2( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->lamp->att2,
- EXPP_LAMP_QUAD2_MIN,
- EXPP_LAMP_QUAD2_MAX );
-}
-
-static int Lamp_setFalloffType( BPy_Lamp * self, PyObject * value )
-{
- return EXPP_setIValueRange ( value, &self->lamp->falloff_type,
- EXPP_LAMP_FALLOFF_MIN, EXPP_LAMP_FALLOFF_MAX, 'h' );
-}
-
-
-static PyObject *Lamp_getComponent( BPy_Lamp * self, void * closure )
-{
- switch ( GET_INT_FROM_POINTER(closure) ) {
- case EXPP_LAMP_COMP_R:
- return PyFloat_FromDouble( self->lamp->r );
- case EXPP_LAMP_COMP_G:
- return PyFloat_FromDouble( self->lamp->g );
- case EXPP_LAMP_COMP_B:
- return PyFloat_FromDouble( self->lamp->b );
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unknown color component specified" );
- }
-}
-
-static int Lamp_setComponent( BPy_Lamp * self, PyObject * value,
- void * closure )
-{
- float color;
-
- if( !PyNumber_Check ( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument in [0.0,1.0]" );
-
- color = (float)PyFloat_AsDouble( value );
- color = EXPP_ClampFloat( color, EXPP_LAMP_COL_MIN, EXPP_LAMP_COL_MAX );
-
- switch ( GET_INT_FROM_POINTER(closure) ) {
- case EXPP_LAMP_COMP_R:
- self->lamp->r = color;
- return 0;
- case EXPP_LAMP_COMP_G:
- self->lamp->g = color;
- return 0;
- case EXPP_LAMP_COMP_B:
- self->lamp->b = color;
- return 0;
- }
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "unknown color component specified" );
-}
-
-static int Lamp_setCol( BPy_Lamp * self, PyObject * args )
-{
- return rgbTuple_setCol( self->color, args );
-}
-
-/* lamp.addScriptLink */
-static PyObject *Lamp_addScriptLink( BPy_Lamp * self, PyObject * args )
-{
- Lamp *lamp = self->lamp;
- ScriptLink *slink = NULL;
-
- slink = &( lamp )->scriptlink;
-
- return EXPP_addScriptLink( slink, args, 0 );
-}
-
-/* lamp.clearScriptLinks */
-static PyObject *Lamp_clearScriptLinks( BPy_Lamp * self, PyObject * args )
-{
- Lamp *lamp = self->lamp;
- ScriptLink *slink = NULL;
-
- slink = &( lamp )->scriptlink;
-
- return EXPP_clearScriptLinks( slink, args );
-}
-
-/* mat.getScriptLinks */
-static PyObject *Lamp_getScriptLinks( BPy_Lamp * self, PyObject * value )
-{
- Lamp *lamp = self->lamp;
- ScriptLink *slink = NULL;
- PyObject *ret = NULL;
-
- slink = &( lamp )->scriptlink;
-
- ret = EXPP_getScriptLinks( slink, value, 0 );
-
- if( ret )
- return ret;
- else
- return NULL;
-}
-
-/*****************************************************************************/
-/* Function: Lamp_dealloc */
-/* Description: This is a callback function for the BPy_Lamp type. It is */
-/* the destructor function. */
-/*****************************************************************************/
-static void Lamp_dealloc( BPy_Lamp * self )
-{
- Py_DECREF( self->color );
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Function: Lamp_compare */
-/* Description: This is a callback function for the BPy_Lamp type. It */
-/* compares two Lamp_Type objects. Only the "==" and "!=" */
-/* comparisons are meaningful. Returns 0 for equality and -1 */
-/* if they don't point to the same Blender Lamp struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Lamp_compare( BPy_Lamp * a, BPy_Lamp * b )
-{
- return ( a->lamp == b->lamp ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Lamp_repr */
-/* Description: This is a callback function for the BPy_Lamp type. It */
-/* builds a meaninful string to represent lamp objects. */
-/*****************************************************************************/
-static PyObject *Lamp_repr( BPy_Lamp * self )
-{
- return PyString_FromFormat( "[Lamp \"%s\"]", self->lamp->id.name + 2 );
-}
-
-static PyObject *Lamp_getIpo( BPy_Lamp * self )
-{
- struct Ipo *ipo = self->lamp->ipo;
-
- if( !ipo )
- Py_RETURN_NONE;
-
- return Ipo_CreatePyObject( ipo );
-}
-
-/*
- * this should accept a Py_None argument and just delete the Ipo link
- * (as Lamp_clearIpo() does)
- */
-
-static int Lamp_setIpo( BPy_Lamp * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->lamp->ipo, 0, 1, ID_IP, ID_LA);
-}
-
-/*
- * Lamp_insertIpoKey()
- * inserts Lamp IPO key for RGB,ENERGY,SPOTSIZE,OFFSET,SIZE
- */
-
-static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args )
-{
- int key = 0, flag = 0, map;
-
- if( !PyArg_ParseTuple( args, "i", &( key ) ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument" ) );
-
- map = texchannel_to_adrcode(self->lamp->texact);
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- if (key == IPOKEY_RGB ) {
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, LA_COL_R, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_G, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_B, flag);
- }
- if (key == IPOKEY_ENERGY ) {
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_ENERGY, flag);
- }
- if (key == IPOKEY_SPOTSIZE ) {
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_SPOTSI, flag);
- }
- if (key == IPOKEY_OFFSET ) {
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_X, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Y, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Z, flag);
- }
- if (key == IPOKEY_SIZE ) {
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_X, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Y, flag);
- insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Z, flag);
- }
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lamp_getModesConst( void )
-{
- return Py_BuildValue
- ( "{s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h,s:h}",
- "Shadows", EXPP_LAMP_MODE_SHADOWS, "Halo",
- EXPP_LAMP_MODE_HALO, "Layer", EXPP_LAMP_MODE_LAYER,
- "Quad", EXPP_LAMP_MODE_QUAD, "Negative",
- EXPP_LAMP_MODE_NEGATIVE, "OnlyShadow",
- EXPP_LAMP_MODE_ONLYSHADOW, "Sphere",
- EXPP_LAMP_MODE_SPHERE, "Square",
- EXPP_LAMP_MODE_SQUARE, "NoDiffuse",
- EXPP_LAMP_MODE_NODIFFUSE, "NoSpecular",
- EXPP_LAMP_MODE_NOSPECULAR, "RayShadow",
- EXPP_LAMP_MODE_SHAD_RAY, "LayerShadow",
- EXPP_LAMP_MODE_LAYER_SHADOW);
-}
-
-static PyObject *Lamp_getTypesConst( void )
-{
- return Py_BuildValue( "{s:h,s:h,s:h,s:h,s:h,s:h}",
- "Lamp", EXPP_LAMP_TYPE_LAMP,
- "Sun", EXPP_LAMP_TYPE_SUN,
- "Spot", EXPP_LAMP_TYPE_SPOT,
- "Hemi", EXPP_LAMP_TYPE_HEMI,
- "Area", EXPP_LAMP_TYPE_AREA,
- "Photon", EXPP_LAMP_TYPE_YF_PHOTON );
-}
-
-static PyObject *Lamp_getTextures( BPy_Lamp * self )
-{
- int i;
- PyObject *tuple;
-
- /* build a texture list */
- tuple = PyTuple_New( MAX_MTEX );
- if( !tuple )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyTuple" );
-
- for( i = 0; i < MAX_MTEX; ++i ) {
- struct MTex *mtex = self->lamp->mtex[i];
- if( mtex ) {
- PyTuple_SET_ITEM( tuple, i, MTex_CreatePyObject( mtex, ID_LA ) );
- } else {
- Py_INCREF( Py_None );
- PyTuple_SET_ITEM( tuple, i, Py_None );
- }
- }
-
- return tuple;
-}
-
-static int Lamp_setTextures( BPy_Lamp * self, PyObject * value )
-{
- int i;
-
- if( !PyList_Check( value ) && !PyTuple_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list of integers" );
-
- /* don't allow more than MAX_MTEX items */
- if( PySequence_Size(value) > MAX_MTEX )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "size of sequence greater than number of allowed textures" );
-
- /* get a fast sequence; in Python 2.5, this just return the original
- * list or tuple and INCREFs it, so we must DECREF */
- value = PySequence_Fast( value, "" );
-
- /* check the list for valid entries */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- if( item == Py_None || ( BPy_MTex_Check( item ) &&
- ((BPy_MTex *)item)->type == ID_LA ) ) {
- continue;
- } else {
- Py_DECREF(value);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list containing lamp MTex objects and NONE" );
- }
- }
-
- /* for each MTex object, copy to this structure */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->lamp->mtex[i];
- if( item != Py_None ) {
- BPy_MTex *obj = (BPy_MTex *)item;
-
- /* if MTex is already at this location, just skip it */
- if( obj->mtex == mtex ) continue;
-
- /* create a new entry if needed, otherwise update reference count
- * for texture that is being replaced */
- if( !mtex )
- mtex = self->lamp->mtex[i] = add_mtex( );
- else
- mtex->tex->id.us--;
-
- /* copy the data */
- mtex->tex = obj->mtex->tex;
- id_us_plus( &mtex->tex->id );
- mtex->texco = obj->mtex->texco;
- mtex->mapto = obj->mtex->mapto;
- }
- }
-
- /* now go back and free any entries now marked as None */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->lamp->mtex[i];
- if( item == Py_None && mtex ) {
- mtex->tex->id.us--;
- MEM_freeN( mtex );
- self->lamp->mtex[i] = NULL;
- }
- }
-
- Py_DECREF(value);
- return 0;
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *Lamp_oldsetSamples( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setSamples );
-}
-
-static PyObject *Lamp_oldsetRaySamplesX( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setRaySamplesX );
-}
-
-static PyObject *Lamp_oldsetRaySamplesY( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setRaySamplesY );
-}
-
-static PyObject *Lamp_oldsetAreaSizeX( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setAreaSizeX );
-}
-
-static PyObject *Lamp_oldsetAreaSizeY( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setAreaSizeY );
-}
-
-static PyObject *Lamp_oldsetBufferSize( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setBufferSize );
-}
-
-static PyObject *Lamp_oldsetHaloStep( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setHaloStep );
-}
-
-static PyObject *Lamp_oldsetEnergy( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setEnergy );
-}
-
-static PyObject *Lamp_oldsetDist( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setDist );
-}
-
-static PyObject *Lamp_oldsetSpotSize( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setSpotSize );
-}
-
-static PyObject *Lamp_oldsetSpotBlend( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setSpotBlend );
-}
-
-static PyObject *Lamp_oldsetClipStart( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setClipStart );
-}
-
-static PyObject *Lamp_oldsetClipEnd( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setClipEnd );
-}
-
-static PyObject *Lamp_oldsetBias( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setBias );
-}
-
-static PyObject *Lamp_oldsetSoftness( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setSoftness );
-}
-
-static PyObject *Lamp_oldsetHaloInt( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setHaloInt );
-}
-
-static PyObject *Lamp_oldsetQuad1( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setQuad1 );
-}
-
-static PyObject *Lamp_oldsetQuad2( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setQuad2 );
-}
-
-static PyObject *Lamp_oldsetIpo( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setIpo );
-}
-
-static PyObject *Lamp_oldsetCol( BPy_Lamp * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Lamp_setCol );
-}
-
-/*
- * the "not-well-behaved" methods which require more processing than
- * just the simple wrapper
- */
-
-/*
- * clearIpo() returns True/False depending on whether lamp has an Ipo
- */
-
-static PyObject *Lamp_clearIpo( BPy_Lamp * self )
-{
- /* if Ipo defined, delete it and return true */
-
- if( self->lamp->ipo ) {
- PyObject *value = Py_BuildValue( "(O)", Py_None );
- EXPP_setterWrapper ( (void *)self, value, (setter)Lamp_setIpo );
- Py_DECREF ( value );
- return EXPP_incr_ret_True();
- }
- return EXPP_incr_ret_False(); /* no ipo found */
-}
-
-/*
- * setType() accepts a string while mode setter takes an integer
- */
-
-static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value )
-{
- char *type = PyString_AsString(value);
- PyObject *arg, *error;
-
- /* parse string argument */
- if( !type )
- return EXPP_ReturnPyObjError ( PyExc_TypeError,
- "expected string argument" );
-
- /* check for valid arguments, set type accordingly */
-
- if( !strcmp( type, "Lamp" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_LAMP;
- else if( !strcmp( type, "Sun" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_SUN;
- else if( !strcmp( type, "Spot" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_SPOT;
- else if( !strcmp( type, "Hemi" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_HEMI;
- else if( !strcmp( type, "Area" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_AREA;
- else if( !strcmp( type, "Photon" ) )
- self->lamp->type = ( short ) EXPP_LAMP_TYPE_YF_PHOTON;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown lamp type" );
-
- /* build tuple, call wrapper */
-
- arg = Py_BuildValue( "(i)", self->lamp->type );
- error = EXPP_setterWrapper ( (void *)self, arg, (setter)Lamp_setType );
- Py_DECREF ( arg );
- return error;
-}
-
-/*
- * setMode() accepts up to ten strings while mode setter takes an integer
- */
-
-static PyObject *Lamp_oldsetMode( BPy_Lamp * self, PyObject * args )
-{
- short i, flag = 0;
- PyObject *error, *value;
- char *name;
-
- /* check that we're passed a tuple of no more than 10 args*/
-
- if ( !PyTuple_Check( args ) || PyTuple_Size( args ) > 10 )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected up to 10 string arguments" );
-
- /* check each argument for type, find its value */
-
- for ( i = (short)PyTuple_Size( args ); i-- ; ) {
- name = PyString_AsString ( PyTuple_GET_ITEM( args, i ) );
- if( !name )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected string argument" );
-
- if( !strcmp( name, "Shadows" ) )
- flag |= ( short ) EXPP_LAMP_MODE_SHADOWS;
- else if( !strcmp( name, "Halo" ) )
- flag |= ( short ) EXPP_LAMP_MODE_HALO;
- else if( !strcmp( name, "Layer" ) )
- flag |= ( short ) EXPP_LAMP_MODE_LAYER;
- else if( !strcmp( name, "Quad" ) )
- flag |= ( short ) EXPP_LAMP_MODE_QUAD;
- else if( !strcmp( name, "Negative" ) )
- flag |= ( short ) EXPP_LAMP_MODE_NEGATIVE;
- else if( !strcmp( name, "OnlyShadow" ) )
- flag |= ( short ) EXPP_LAMP_MODE_ONLYSHADOW;
- else if( !strcmp( name, "Sphere" ) )
- flag |= ( short ) EXPP_LAMP_MODE_SPHERE;
- else if( !strcmp( name, "Square" ) )
- flag |= ( short ) EXPP_LAMP_MODE_SQUARE;
- else if( !strcmp( name, "NoDiffuse" ) )
- flag |= ( short ) EXPP_LAMP_MODE_NODIFFUSE;
- else if( !strcmp( name, "NoSpecular" ) )
- flag |= ( short ) EXPP_LAMP_MODE_NOSPECULAR;
- else if( !strcmp( name, "RayShadow" ) )
- flag |= ( short ) EXPP_LAMP_MODE_SHAD_RAY;
- else if( !strcmp( name, "LayerShadow" ) )
- flag |= ( short ) EXPP_LAMP_MODE_LAYER_SHADOW;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown lamp flag argument" );
- }
-
- /* build tuple, call wrapper */
-
- value = Py_BuildValue( "(i)", flag );
- error = EXPP_setterWrapper ( (void *)self, value, (setter)Lamp_setMode );
- Py_DECREF ( value );
- return error;
-}
-
diff --git a/source/blender/python/api2_2x/Lamp.h b/source/blender/python/api2_2x/Lamp.h
deleted file mode 100644
index 0f2dbfdb704..00000000000
--- a/source/blender/python/api2_2x/Lamp.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Nathan Letwory
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_LAMP_H
-#define EXPP_LAMP_H
-
-#include <Python.h>
-#include "DNA_lamp_types.h"
-#include "rgbTuple.h"
-
-extern PyTypeObject Lamp_Type;
-
-#define BPy_Lamp_Check(v) \
- ((v)->ob_type == &Lamp_Type) /* for type checking */
-
-/* Python BPy_Lamp structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- Lamp * lamp; /* libdata must be second */
- BPy_rgbTuple *color;
-} BPy_Lamp;
-
-
-/*
- * prototypes
- */
-
-PyObject *Lamp_Init( void );
-PyObject *Lamp_CreatePyObject( struct Lamp *lamp );
-Lamp *Lamp_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_LAMP_H */
diff --git a/source/blender/python/api2_2x/Lattice.c b/source/blender/python/api2_2x/Lattice.c
deleted file mode 100644
index 99ae5a5656a..00000000000
--- a/source/blender/python/api2_2x/Lattice.c
+++ /dev/null
@@ -1,810 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Lattice.h" /*This must come first*/
-
-#include "BKE_utildefines.h"
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_lattice.h"
-#include "BLI_blenlib.h"
-#include "DNA_object_types.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_scene_types.h"
-#include "BIF_editkey.h"
-#include "BIF_editdeform.h"
-#include "BIF_space.h"
-#include "blendef.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "Key.h"
-
-/*****************************************************************************/
-/* Python API function prototypes for the Lattice module. */
-/*****************************************************************************/
-static PyObject *M_Lattice_New( PyObject * self, PyObject * args );
-static PyObject *M_Lattice_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* Lattice Module strings */
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Lattice.__doc__ */
-/*****************************************************************************/
-static char M_Lattice_doc[] = "The Blender Lattice module\n\n";
-
-static char M_Lattice_New_doc[] = "() - return a new Lattice object";
-
-static char M_Lattice_Get_doc[] = "() - get a Lattice from blender";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Lattice module: */
-/*****************************************************************************/
-struct PyMethodDef M_Lattice_methods[] = {
- {"New", ( PyCFunction ) M_Lattice_New, METH_VARARGS,
- M_Lattice_New_doc},
- {"Get", ( PyCFunction ) M_Lattice_Get, METH_VARARGS,
- M_Lattice_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Lattice Strings */
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Lattice.__doc__ */
-/*****************************************************************************/
-static char Lattice_getName_doc[] = "() - Return Lattice Object name";
-
-static char Lattice_setName_doc[] = "(str) - Change Lattice Object name";
-
-static char Lattice_setPartitions_doc[] =
- "(str) - Set the number of Partitions in x,y,z";
-
-static char Lattice_getPartitions_doc[] =
- "(str) - Get the number of Partitions in x,y,z";
-
-static char Lattice_getKey_doc[] =
- "() - Get the Key object attached to this Lattice";
-
-static char Lattice_setKeyTypes_doc[] =
- "(str) - Set the key types for x,y,z dimensions";
-
-static char Lattice_getKeyTypes_doc[] =
- "(str) - Get the key types for x,y,z dimensions";
-
-static char Lattice_setMode_doc[] = "(str) - Make an outside or grid lattice";
-
-static char Lattice_getMode_doc[] = "(str) - Get lattice mode type";
-
-static char Lattice_setPoint_doc[] =
- "(str) - Set the coordinates of a point on the lattice";
-
-static char Lattice_getPoint_doc[] =
- "(str) - Get the coordinates of a point on the lattice";
-
-static char Lattice_insertKey_doc[] =
- "(str) - Set a new key for the lattice at specified frame";
-
-static char Lattice_copy_doc[] =
- "() - Return a copy of the lattice.";
-
-//***************************************************************************
-// Function: Lattice_CreatePyObject
-//***************************************************************************
-PyObject *Lattice_CreatePyObject( Lattice * lt )
-{
- BPy_Lattice *pyLat;
-
- pyLat = ( BPy_Lattice * ) PyObject_NEW( BPy_Lattice, &Lattice_Type );
-
- if( !pyLat )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Lattice PyObject" );
-
- pyLat->lattice = lt;
-
- return ( PyObject * ) pyLat;
-}
-
-//***************************************************************************
-// Function: Lattice_FromPyObject
-//***************************************************************************
-
-Lattice *Lattice_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Lattice * ) pyobj )->lattice;
-}
-
-//***************************************************************************
-// Function: M_Lattice_New
-// Python equivalent: Blender.Lattice.New
-//***************************************************************************
-static PyObject *M_Lattice_New( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Lattice *bl_Lattice; // blender Lattice object
- PyObject *py_Lattice; // python wrapper
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string and int arguments (or nothing)" );
-
- bl_Lattice = add_lattice( "Lattice" );
-
- if( bl_Lattice ) {
- bl_Lattice->id.us = 0;
- py_Lattice = Lattice_CreatePyObject( bl_Lattice );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Lattice Object in Blender" );
- if( !py_Lattice )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Lattice Object wrapper" );
-
- if( name )
- rename_id( &bl_Lattice->id, name );
-
- return py_Lattice;
-}
-
-//***************************************************************************
-// Function: M_Lattice_Get
-// Python equivalent: Blender.Lattice.Get
-//***************************************************************************
-static PyObject *M_Lattice_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Lattice *lat_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- lat_iter = G.main->latt.first;
-
- if( name ) { /* (name) - Search Lattice by name */
-
- PyObject *wanted_lat = NULL;
-
- while( ( lat_iter ) && ( wanted_lat == NULL ) ) {
- if( strcmp( name, lat_iter->id.name + 2 ) == 0 ) {
- wanted_lat =
- Lattice_CreatePyObject( lat_iter );
- }
-
- lat_iter = lat_iter->id.next;
- }
-
- if( wanted_lat == NULL ) { /* Requested Lattice doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Lattice \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return wanted_lat;
- }
-
- else { /* () - return a list of all Lattices in the scene */
- int index = 0;
- PyObject *latlist, *pyobj;
-
- latlist = PyList_New( BLI_countlist( &( G.main->latt ) ) );
-
- if( latlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( lat_iter ) {
- pyobj = Lattice_CreatePyObject( lat_iter );
-
- if( !pyobj ) {
- Py_DECREF(latlist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create PyString" ) );
- }
- PyList_SET_ITEM( latlist, index, pyobj );
-
- lat_iter = lat_iter->id.next;
- index++;
- }
-
- return ( latlist );
- }
-}
-
-//***************************************************************************
-// Function: Lattice_Init
-//***************************************************************************
-PyObject *Lattice_Init( void )
-{
- PyObject *mod;
- PyObject *dict;
-
- if( PyType_Ready( &Lattice_Type ) < 0 )
- return NULL;
-
- mod = Py_InitModule3( "Blender.Lattice", M_Lattice_methods,
- M_Lattice_doc );
-
- dict = PyModule_GetDict( mod );
-
- //Module dictionary
-#define EXPP_ADDCONST(x) EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(LT_##x))
- EXPP_ADDCONST( GRID );
- EXPP_ADDCONST( OUTSIDE );
-
-#undef EXPP_ADDCONST
-#define EXPP_ADDCONST(x) EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(KEY_##x))
- EXPP_ADDCONST( LINEAR );
- EXPP_ADDCONST( CARDINAL );
- EXPP_ADDCONST( BSPLINE );
-
- return ( mod );
-}
-
-static PyObject *Lattice_setPartitions( BPy_Lattice * self, PyObject * args )
-{
- int x = 0;
- int y = 0;
- int z = 0;
- Lattice *bl_Lattice;
-
- if( !PyArg_ParseTuple( args, "iii", &x, &y, &z ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int,int,int argument" ) );
-
- bl_Lattice = self->lattice;
-
- if( x < 2 || y < 2 || z < 2 )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "partition values must be 2 or greater" ) );
-
- resizelattice(bl_Lattice, x, y, z, NULL);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_getPartitions( BPy_Lattice * self )
-{
- Lattice *bl_Lattice;
- bl_Lattice = self->lattice;
-
- return Py_BuildValue( "[i,i,i]", ( int ) bl_Lattice->pntsu,
- ( int ) bl_Lattice->pntsv,
- ( int ) bl_Lattice->pntsw );
-}
-
-static PyObject *Lattice_getKey( BPy_Lattice * self )
-{
- Key *key = self->lattice->key;
-
- if (key)
- return Key_CreatePyObject(key);
- else
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_getKeyTypes( BPy_Lattice * self )
-{
- Lattice *bl_Lattice;
- char *linear = "linear";
- char *cardinal = "cardinal";
- char *bspline = "bspline";
- char *s_x = NULL, *s_y = NULL, *s_z = NULL;
-
- bl_Lattice = self->lattice;
-
- if( ( bl_Lattice->typeu ) == KEY_LINEAR )
- s_x = linear;
- else if( ( bl_Lattice->typeu ) == KEY_CARDINAL )
- s_x = cardinal;
- else if( ( bl_Lattice->typeu ) == KEY_BSPLINE )
- s_x = bspline;
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "bad key type..." );
-
- if( ( bl_Lattice->typev ) == KEY_LINEAR )
- s_y = linear;
- else if( ( bl_Lattice->typev ) == KEY_CARDINAL )
- s_y = cardinal;
- else if( ( bl_Lattice->typev ) == KEY_BSPLINE )
- s_y = bspline;
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "bad key type..." );
-
- if( ( bl_Lattice->typew ) == KEY_LINEAR )
- s_z = linear;
- else if( ( bl_Lattice->typew ) == KEY_CARDINAL )
- s_z = cardinal;
- else if( ( bl_Lattice->typew ) == KEY_BSPLINE )
- s_z = bspline;
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "bad key type..." );
-
- /* we made sure no s_[xyz] is NULL */
- return Py_BuildValue( "[s,s,s]", s_x, s_y, s_z );
-}
-
-static PyObject *Lattice_setKeyTypes( BPy_Lattice * self, PyObject * args )
-{
- int x;
- int y;
- int z;
- Lattice *bl_Lattice;
-
- if( !PyArg_ParseTuple( args, "iii", &x, &y, &z ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int,int,int argument" ) );
-
- bl_Lattice = self->lattice;
-
- if( x == KEY_LINEAR )
- bl_Lattice->typeu = KEY_LINEAR;
- else if( x == KEY_CARDINAL )
- bl_Lattice->typeu = KEY_CARDINAL;
- else if( x == KEY_BSPLINE )
- bl_Lattice->typeu = KEY_BSPLINE;
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "type must be LINEAR, CARDINAL OR BSPLINE" );
-
- if( y == KEY_LINEAR )
- bl_Lattice->typev = KEY_LINEAR;
- else if( y == KEY_CARDINAL )
- bl_Lattice->typev = KEY_CARDINAL;
- else if( y == KEY_BSPLINE )
- bl_Lattice->typev = KEY_BSPLINE;
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "type must be LINEAR, CARDINAL OR BSPLINE" );
-
- if( z == KEY_LINEAR )
- bl_Lattice->typew = KEY_LINEAR;
- else if( z == KEY_CARDINAL )
- bl_Lattice->typew = KEY_CARDINAL;
- else if( z == KEY_BSPLINE )
- bl_Lattice->typew = KEY_BSPLINE;
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "type must be LINEAR, CARDINAL OR BSPLINE" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_setMode( BPy_Lattice * self, PyObject * args )
-{
- short type;
- Lattice *bl_Lattice;
- bl_Lattice = self->lattice;
-
- if( !PyArg_ParseTuple( args, "h", &type ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
-
- if( type == LT_GRID )
- bl_Lattice->flag = LT_GRID;
- else if( type == LT_OUTSIDE ) {
- bl_Lattice->flag = LT_OUTSIDE + LT_GRID;
- outside_lattice( bl_Lattice );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "type must be either GRID or OUTSIDE" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_getMode(BPy_Lattice * self)
-{
- if( self->lattice->flag == 1 )
- return PyString_FromString( "Grid" );
- else if( self->lattice->flag == 3 )
- return PyString_FromString( "Outside" );
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_setPoint( BPy_Lattice * self, PyObject * args )
-{
- BPoint *bp, *bpoint;
- short size;
- Lattice *bl_Lattice;
- int index, x;
- float tempInt;
- PyObject *listObject;
-
- if( !PyArg_ParseTuple
- ( args, "iO!", &index, &PyList_Type, &listObject ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected int & list argument" ) );
-
- if( !PyList_Check( listObject ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "2nd parameter should be a python list" ) );
-
- if( !( PyList_Size( listObject ) == 3 ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Please pass 3 parameters in the list [x,y,z]" ) );
-
- //init
- bp = 0;
- bl_Lattice = self->lattice;
-
- //get bpoints
- bp = bl_Lattice->def;
-
- if( bp == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no lattice points!" ) );
-
- //calculate size of lattice
- size = bl_Lattice->pntsu * bl_Lattice->pntsv * bl_Lattice->pntsw;
-
- if( index < 0 || index > size )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "index outside of lattice size!" ) );
-
- //get the bpoint
- while( index ) {
- index--;
- bp++;
- }
- bpoint = bp;
-
- for( x = 0; x < PyList_Size( listObject ); x++ ) {
- if( !
- ( PyArg_Parse
- ( ( PyList_GetItem( listObject, x ) ), "f",
- &tempInt ) ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
- bpoint->vec[x] = tempInt;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_getPoint( BPy_Lattice * self, PyObject * args )
-{
- BPoint *bp, *bpoint;
- short size;
- Lattice *bl_Lattice;
- int index;
-
- if( !PyArg_ParseTuple( args, "i", &index ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
-
- //init
- bp = 0;
- bl_Lattice = self->lattice;
-
- //get bpoints
- bp = bl_Lattice->def;
-
- if( bp == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no lattice points!" ) );
-
- //calculate size of lattice
- size = bl_Lattice->pntsu * bl_Lattice->pntsv * bl_Lattice->pntsw;
-
- if( index < 0 || index > size )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "index outside of lattice size!" ) );
-
- //get the bpoint
- while( index ) {
- index--;
- bp++;
- }
- bpoint = bp;
-
- if( bpoint == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "bpoint does not exist" ) );
-
- return Py_BuildValue( "[f,f,f]", bp->vec[0], bp->vec[1], bp->vec[2] );
-}
-
-static PyObject *Lattice_insertKey( BPy_Lattice * self, PyObject * args )
-{
- Lattice *lt;
- int frame = -1, oldfra = -1;
-
- if( !PyArg_ParseTuple( args, "i", &frame ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
-
- lt = self->lattice;
-
- //set the current frame
- if( frame > 0 ) {
- frame = EXPP_ClampInt( frame, 1, MAXFRAME );
- oldfra = G.scene->r.cfra;
- G.scene->r.cfra = (int)frame;
- }
-// else just use current frame, then
-// return (EXPP_ReturnPyObjError (PyExc_RuntimeError,
-// "frame value has to be greater than 0"));
-
- //insert a keybock for the lattice (1=relative)
- insert_lattkey( lt , 1);
- allspace(REMAKEIPO, 0);
-
- if( frame > 0 )
- G.scene->r.cfra = (int)oldfra;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Lattice_copy( BPy_Lattice * self )
-{
- Lattice *bl_Lattice; // blender Lattice object
- PyObject *py_Lattice; // python wrapper
-
- bl_Lattice = copy_lattice( self->lattice );
- bl_Lattice->id.us = 0;
-
- if( bl_Lattice )
- py_Lattice = Lattice_CreatePyObject( bl_Lattice );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Lattice Object in Blender" );
- if( !py_Lattice )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Lattice Object wrapper" );
-
- return py_Lattice;
-}
-
-static int Lattice_compare( BPy_Lattice * a, BPy_Lattice * b )
-{
- return ( a->lattice == b->lattice ) ? 0 : -1;
-}
-
-
-//***************************************************************************
-// Function: Lattice_repr
-// Description: This is a callback function for the BPy_Lattice type. It
-// builds a meaninful string to represent Lattice objects.
-//***************************************************************************
-static PyObject *Lattice_repr( BPy_Lattice * self )
-{
- if( self->lattice )
- return PyString_FromFormat( "[Lattice \"%s\"]",
- self->lattice->id.name + 2 );
- else
- return PyString_FromString( "[Lattice <deleted>]" );
-}
-
-/*****************************************************************************/
-/* Python BPy_Lattice methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Lattice_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- Lattice_getName_doc},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- Lattice_setName_doc},
- {"setPartitions", ( PyCFunction ) Lattice_setPartitions, METH_VARARGS,
- Lattice_setPartitions_doc},
- {"getPartitions", ( PyCFunction ) Lattice_getPartitions, METH_NOARGS,
- Lattice_getPartitions_doc},
- {"getKey", ( PyCFunction ) Lattice_getKey, METH_NOARGS,
- Lattice_getKey_doc},
- {"setKeyTypes", ( PyCFunction ) Lattice_setKeyTypes, METH_VARARGS,
- Lattice_setKeyTypes_doc},
- {"getKeyTypes", ( PyCFunction ) Lattice_getKeyTypes, METH_NOARGS,
- Lattice_getKeyTypes_doc},
- {"setMode", ( PyCFunction ) Lattice_setMode, METH_VARARGS,
- Lattice_setMode_doc},
- {"getMode", ( PyCFunction ) Lattice_getMode, METH_NOARGS,
- Lattice_getMode_doc},
- {"setPoint", ( PyCFunction ) Lattice_setPoint, METH_VARARGS,
- Lattice_setPoint_doc},
- {"getPoint", ( PyCFunction ) Lattice_getPoint, METH_VARARGS,
- Lattice_getPoint_doc},
- {"insertKey", ( PyCFunction ) Lattice_insertKey, METH_VARARGS,
- Lattice_insertKey_doc},
- {"__copy__", ( PyCFunction ) Lattice_copy, METH_NOARGS,
- Lattice_copy_doc},
- {"copy", ( PyCFunction ) Lattice_copy, METH_NOARGS,
- Lattice_copy_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python attributes get/set functions: */
-/*****************************************************************************/
-static PyObject *Lattice_getWidth(BPy_Lattice * self)
-{
- return PyInt_FromLong( self->lattice->pntsu );
-}
-static PyObject *Lattice_getHeight(BPy_Lattice * self)
-{
- return PyInt_FromLong( self->lattice->pntsv );
-}
-static PyObject *Lattice_getDepth(BPy_Lattice * self)
-{
- return PyInt_FromLong( self->lattice->pntsw );
-}
-static PyObject *Lattice_getLatSize(BPy_Lattice * self)
-{
- return PyInt_FromLong(
- self->lattice->pntsu * self->lattice->pntsv * self->lattice->pntsw );
-}
-
-
-static PyObject *Lattice_getAxisType(BPy_Lattice * self, void * type)
-{
- char interp_type = 0;
- switch ( GET_INT_FROM_POINTER(type) ) {
- case 0:
- interp_type = self->lattice->typeu;
- break;
- case 1:
- interp_type = self->lattice->typev;
- break;
- case 2:
- interp_type = self->lattice->typew;
- break;
- }
-
- switch (interp_type) {
- case 0:
- return PyString_FromString( "Linear" );
- case 1:
- return PyString_FromString( "Cardinal" );
- case 2:
- return PyString_FromString( "Bspline" );
- }
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Lattice_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"width", (getter)Lattice_getWidth, (setter)NULL,
- "lattice U subdivision ", NULL},
- {"height", (getter)Lattice_getHeight, (setter)NULL,
- "lattice V subdivision", NULL},
- {"depth", (getter)Lattice_getDepth, (setter)NULL,
- "lattice W subdivision", NULL},
- {"latSize", (getter)Lattice_getLatSize, (setter)NULL,
- "lattice W subdivision", NULL},
-
- {"widthType", (getter)Lattice_getAxisType, NULL,
- "lattice U interpolation type", (void *)0},
- {"heightType", (getter)Lattice_getAxisType, NULL,
- "lattice V interpolation type", (void *)1},
- {"depthType", (getter)Lattice_getAxisType, NULL,
- "lattice W interpolation type", (void *)2},
-
- {"key", (getter)Lattice_getKey, NULL,
- "lattice key", NULL},
- {"mode", (getter)Lattice_getMode, NULL,
- "lattice key", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Lattice_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Lattice_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Lattice", /* tp_name */
- sizeof( BPy_Lattice ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Lattice_compare, /* tp_compare */
- ( reprfunc ) Lattice_repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Lattice_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Lattice_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/Lattice.h b/source/blender/python/api2_2x/Lattice.h
deleted file mode 100644
index 64a53ba7484..00000000000
--- a/source/blender/python/api2_2x/Lattice.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_Lattice_H
-#define EXPP_Lattice_H
-
-#include <Python.h>
-#include "DNA_lattice_types.h"
-
-/* The Group PyTypeObject defined in Lattice.c */
-extern PyTypeObject Lattice_Type;
-
-#define BPy_Lattice_Check(v) ((v)->ob_type == &Lattice_Type)
-
-/*****************************************************************************/
-/* Python BPy_Lattice structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- Lattice * lattice; /* libdata must be second */
-} BPy_Lattice;
-
-/*
- * prototypes
- */
-
-PyObject *Lattice_Init( void );
-PyObject *Lattice_CreatePyObject( Lattice * lt );
-Lattice *Lattice_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_LATTICE_H */
diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c
deleted file mode 100644
index 468263c4208..00000000000
--- a/source/blender/python/api2_2x/Library.c
+++ /dev/null
@@ -1,1316 +0,0 @@
-/**
- * $Id$
- *
- * Blender.Library BPython module implementation.
- * This submodule has functions to append data from .blend files.
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Campbell Barton, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/************************************************************/
-/* Original library module code */
-/************************************************************/
-
-#include <Python.h>
-
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h" /* for line linked */
-#include "BKE_library.h" /* for all_local */
-#include "BKE_font.h" /* for text_to_curve */
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BLI_blenlib.h"
-#include "BLO_readfile.h"
-#include "BLI_linklist.h"
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-
-/**
- * Global variables.
- */
-static BlendHandle *bpy_openlib = NULL; /* ptr to the open .blend file */
-static char *bpy_openlibname = NULL; /* its pathname */
-static int bpy_relative= 0;
-
-/**
- * Function prototypes for the Library submodule.
- */
-static PyObject *M_Library_Open( PyObject * self, PyObject * args );
-static PyObject *M_Library_Close( PyObject * self );
-static PyObject *M_Library_GetName( PyObject * self );
-static PyObject *M_Library_Update( PyObject * self );
-static PyObject *M_Library_Datablocks( PyObject * self, PyObject * value );
-static PyObject *oldM_Library_Load( PyObject * self, PyObject * args );
-static PyObject *M_Library_LinkableGroups( PyObject * self );
-static PyObject *M_Library_LinkedLibs( PyObject * self );
-
-PyObject *Library_Init( void );
-void EXPP_Library_Close( void );
-
-/**
- * Module doc strings.
- */
-static char M_Library_doc[] = "The Blender.Library submodule:\n\n\
-This module gives access to .blend files, using them as libraries of\n\
-data that can be loaded into the current scene in Blender.";
-
-static char Library_Open_doc[] =
- "(filename) - Open the given .blend file for access to its objects.\n\
-If another library file is still open, it's closed automatically.";
-
-static char Library_Close_doc[] =
- "() - Close the currently open library file, if any.";
-
-static char Library_GetName_doc[] =
- "() - Get the filename of the currently open library file, if any.";
-
-static char Library_Datablocks_doc[] =
- "(datablock) - List all datablocks of the given type in the currently\n\
-open library file.\n\
-(datablock) - datablock name as a string: Object, Mesh, etc.";
-
-static char Library_Load_doc[] =
- "(name, datablock [,update = 1]) - Append object 'name' of type 'datablock'\n\
-from the open library file to the current scene.\n\
-(name) - (str) the name of the object.\n\
-(datablock) - (str) the datablock of the object.\n\
-(update = 1) - (int) if non-zero, all display lists are recalculated and the\n\
-links are updated. This is slow, set it to zero if you have more than one\n\
-object to load, then call Library.Update() after loading them all.";
-
-static char Library_Update_doc[] =
- "() - Update the current scene, linking all loaded library objects and\n\
-remaking all display lists. This is slow, call it only once after loading\n\
-all objects (load each of them with update = 0:\n\
-Library.Load(name, datablock, 0), or the update will be automatic, repeated\n\
-for each loaded object.";
-
-static char Library_LinkableGroups_doc[] =
- "() - Get all linkable groups from the open .blend library file.";
-
-static char Library_LinkedLibs_doc[] =
- "() - Get all libs used in the the open .blend file.";
-
-/**
- * Python method structure definition for Blender.Library submodule.
- */
-struct PyMethodDef oldM_Library_methods[] = {
- {"Open", M_Library_Open, METH_O, Library_Open_doc},
- {"Close", ( PyCFunction ) M_Library_Close, METH_NOARGS,
- Library_Close_doc},
- {"GetName", ( PyCFunction ) M_Library_GetName, METH_NOARGS,
- Library_GetName_doc},
- {"Update", ( PyCFunction ) M_Library_Update, METH_NOARGS,
- Library_Update_doc},
- {"Datablocks", M_Library_Datablocks, METH_O,
- Library_Datablocks_doc},
- {"Load", oldM_Library_Load, METH_VARARGS, Library_Load_doc},
- {"LinkableGroups", ( PyCFunction ) M_Library_LinkableGroups,
- METH_NOARGS, Library_LinkableGroups_doc},
- {"LinkedLibs", ( PyCFunction ) M_Library_LinkedLibs,
- METH_NOARGS, Library_LinkedLibs_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/* Submodule Python functions: */
-
-/**
- * Open a new .blend file.
- * Only one can be open at a time, so this function also closes
- * the previously opened file, if any.
- */
-static PyObject *M_Library_Open( PyObject * self, PyObject * value )
-{
- char *fname = PyString_AsString(value);
- char filename[FILE_MAXDIR+FILE_MAXFILE];
- char fname1[FILE_MAXDIR+FILE_MAXFILE];
-
- int len = 0;
-
- bpy_relative= 0; /* assume non relative each time we load */
-
- if( !fname ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a .blend filename" );
- }
-
- if( bpy_openlib ) {
- M_Library_Close( self );
- Py_DECREF( Py_None ); /* incref'ed by above function */
- }
-
- /* copy the name to make it absolute so BLO_blendhandle_from_file doesn't complain */
- BLI_strncpy(fname1, fname, sizeof(fname1));
- BLI_convertstringcode(fname1, G.sce); /* make absolute */
-
- /* G.sce = last file loaded, save for UI and restore after opening file */
- BLI_strncpy(filename, G.sce, sizeof(filename));
- bpy_openlib = BLO_blendhandle_from_file( fname1 );
- BLI_strncpy(G.sce, filename, sizeof(filename));
-
- if( !bpy_openlib )
- return EXPP_ReturnPyObjError( PyExc_IOError, "file not found" );
-
- /* "//someblend.blend" enables relative paths */
- if (sizeof(fname) > 2 && fname[0] == '/' && fname[1] == '/')
- bpy_relative= 1; /* global that makes the library relative on loading */
-
- len = strlen( fname1 ) + 1; /* +1 for terminating '\0' */
-
- bpy_openlibname = MEM_mallocN( len, "bpy_openlibname" );
-
- if( bpy_openlibname )
- PyOS_snprintf( bpy_openlibname, len, "%s", fname1 );
-
- Py_RETURN_TRUE;
-}
-
-/**
- * Close the current .blend file, if any.
- */
-static PyObject *M_Library_Close( PyObject * self )
-{
- if( bpy_openlib ) {
- BLO_blendhandle_close( bpy_openlib );
- bpy_openlib = NULL;
- }
-
- if( bpy_openlibname ) {
- MEM_freeN( bpy_openlibname );
- bpy_openlibname = NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/**
- * helper function for 'atexit' clean-ups, used by BPY_end_python,
- * declared in EXPP_interface.h.
- */
-void EXPP_Library_Close( void )
-{
- if( bpy_openlib ) {
- BLO_blendhandle_close( bpy_openlib );
- bpy_openlib = NULL;
- }
-
- if( bpy_openlibname ) {
- MEM_freeN( bpy_openlibname );
- bpy_openlibname = NULL;
- }
-}
-
-/**
- * Get the filename of the currently open library file, if any.
- */
-static PyObject *M_Library_GetName( PyObject * self )
-{
- if( bpy_openlib && bpy_openlibname )
- return Py_BuildValue( "s", bpy_openlibname );
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/**
- * Return a list with all items of a given datablock type
- * (like 'Object', 'Mesh', etc.) in the open library file.
- */
-static PyObject *M_Library_Datablocks( PyObject * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
- int blocktype = 0;
- LinkNode *l = NULL, *names = NULL;
- PyObject *list = NULL;
-
- if( !bpy_openlib ) {
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "no library file: open one first with Blender.Lib_Open(filename)" );
- }
-
- if( !name ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string (datablock type) as argument." );
- }
-
- blocktype = ( int ) BLO_idcode_from_name( name );
-
- if( !blocktype ) {
- return EXPP_ReturnPyObjError( PyExc_NameError,
- "no such Blender datablock type" );
- }
-
- names = BLO_blendhandle_get_datablock_names( bpy_openlib, blocktype );
-
- if( names ) {
- int counter = 0;
- list = PyList_New( BLI_linklist_length( names ) );
- for( l = names; l; l = l->next ) {
- PyList_SET_ITEM( list, counter,
- PyString_FromString( ( char * ) l->link ) );
- counter++;
- }
- BLI_linklist_free( names, free ); /* free linklist *and* each node's data */
- } else {
- list = PyList_New( 0 );
- }
-
- return list;
-}
-
-/**
- * Return a list with the names of all linkable groups in the
- * open library file.
- */
-static PyObject *M_Library_LinkableGroups( PyObject * self )
-{
- LinkNode *l = NULL, *names = NULL;
- PyObject *list = NULL;
-
- if( !bpy_openlib ) {
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "no library file: open one first with Blender.Lib_Open(filename)" );
- }
-
- names = BLO_blendhandle_get_linkable_groups( bpy_openlib );
- list = PyList_New( BLI_linklist_length( names ) );
-
- if( names ) {
- int counter = 0;
-
- for( l = names; l; l = l->next ) {
- PyList_SET_ITEM( list, counter, PyString_FromString( ( char * ) l->link ) );
- counter++;
- }
- BLI_linklist_free( names, free ); /* free linklist *and* each node's data */
- return list;
- }
- return list;
-}
-
-/**
- * Return a list with the names of all externally linked libs used in the current Blend file
- */
-static PyObject *M_Library_LinkedLibs( PyObject * self )
-{
- int counter = 0;
- Library *li;
- PyObject *list;
-
- list = PyList_New( BLI_countlist( &( G.main->library ) ) );
- for (li= G.main->library.first; li; li= li->id.next) {
- PyList_SET_ITEM( list, counter, PyString_FromString( li->name ));
- counter++;
- }
- return list;
-}
-
-/**
- * Load (append) a given datablock of a given datablock type
- * to the current scene.
- */
-static PyObject *oldM_Library_Load( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- char *base = NULL;
- int update = 1;
- int blocktype = 0;
- int linked = 0;
-
-
- if( !bpy_openlib ) {
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "no library file: you need to open one, first." );
- }
-
- if( !PyArg_ParseTuple( args, "ss|ii", &name, &base, &update, &linked ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two strings as arguments." );
- }
-
- blocktype = ( int ) BLO_idcode_from_name( base );
-
- if( !blocktype )
- return EXPP_ReturnPyObjError( PyExc_NameError,
- "no such Blender datablock type" );
-
- if (linked)
- BLO_script_library_append( &bpy_openlib, bpy_openlibname, name, blocktype, FILE_LINK, G.scene);
- else
- BLO_script_library_append( &bpy_openlib, bpy_openlibname, name, blocktype, 0, G.scene);
-
- /*
- NOTE: BLO_script_library_append() can close the library if there is
- an endian issue. if this happened, reopen for the next call.
- */
- if ( !bpy_openlib )
- bpy_openlib = BLO_blendhandle_from_file( bpy_openlibname );
-
- if( update ) {
- M_Library_Update( self );
- Py_DECREF( Py_None ); /* incref'ed by above function */
- }
-
- if( bpy_relative ) {
- /* and now find the latest append lib file */
- Library *lib = G.main->library.first;
- while( lib ) {
- if( strcmp( bpy_openlibname, lib->name ) == 0 ) {
-
- /* use the full path, this could have been read by other library even */
- BLI_strncpy(lib->name, lib->filename, sizeof(lib->name));
-
- /* uses current .blend file as reference */
- BLI_makestringcode(G.sce, lib->name);
- break;
- }
- lib = lib->id.next;
- }
-
- }
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/**
- * Update all links and remake displists.
- */
-static PyObject *M_Library_Update( PyObject * self )
-{ /* code adapted from do_library_append in src/filesel.c: */
- Library *lib = NULL;
-
- /* Displist code that was here is obsolete... depending on what
- * this function is supposed to do (it should technically be unnecessary)
- * can be replaced with depgraph calls - zr
- */
-
- if( bpy_openlibname ) {
- strcpy( G.lib, bpy_openlibname );
-
- /* and now find the latest append lib file */
- lib = G.main->library.first;
- while( lib ) {
- if( strcmp( bpy_openlibname, lib->name ) == 0 )
- break;
- lib = lib->id.next;
- }
- all_local( lib, 0 );
- }
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/**
- * Initialize the Blender.Library submodule.
- * Called by Blender_Init in Blender.c .
- * @return the registered submodule.
- */
-PyObject *oldLibrary_Init( void )
-{
- PyObject *submod;
-
- submod = Py_InitModule3( "Blender.Library", oldM_Library_methods,
- M_Library_doc );
-
- return submod;
-}
-
-/************************************************************/
-/* New library (LibData) module code */
-/************************************************************/
-
-#include "Library.h"
-
-/* if this module supercedes the old library module, include these instead */
-#if 0
-#include "BLI_blenlib.h"
-#include "MEM_guardedalloc.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h" /* for line linked */
-#include "BKE_library.h" /* for all_local */
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BLO_readfile.h"
-#include "BLI_linklist.h"
-
-#include "Object.h"
-#include "gen_utils.h"
-#endif
-
-#include "gen_library.h"
-
-/* Helper function */
-
-/*
- * Try to open a library, set Python exceptions as necessary if not
- * successful. On success, return a valid handle; othewise return NULL.
- */
-
-static BlendHandle *open_library( char *filename, char *longFilename )
-{
- char globalFilename[FILE_MAX];
- BlendHandle *openlib = NULL;
-
- /* get complete file name if necessary */
- BLI_strncpy( longFilename, filename, FILE_MAX );
- BLI_convertstringcode( longFilename, G.sce );
-
- /* throw exceptions for wrong file type, cyclic reference */
- if( !BLO_has_bfile_extension(longFilename) ) {
- PyErr_SetString( PyExc_ValueError, "file not a library" );
- return NULL;
- }
- if( BLI_streq(G.main->name, longFilename) ) {
- PyErr_SetString( PyExc_ValueError,
- "cannot use current file as library" );
- return NULL;
- }
-
- /* G.sce = last file loaded, save for UI and restore after opening file */
- BLI_strncpy(globalFilename, G.sce, sizeof(globalFilename));
- openlib = BLO_blendhandle_from_file( longFilename );
- BLI_strncpy(G.sce, globalFilename, sizeof(globalFilename));
-
- /* if failed, set that exception code too */
- if( !openlib )
- PyErr_SetString( PyExc_IOError, "library not found" );
-
- return openlib;
-}
-
-/*
- * Create a specific type of LibraryData object. These are used for
- * .append() and .link() access, for iterators, and (for Blender Objects)
- * for defining "pseudo objects" for scene linking.
- */
-
-static PyObject *CreatePyObject_LibData( int idtype, int kind,
- void *name, void *iter, char *filename, int rel )
-{
- BPy_LibraryData *seq = PyObject_NEW( BPy_LibraryData, &LibraryData_Type);
- seq->iter = iter; /* the name list (for iterators) */
- seq->type = idtype; /* the Blender ID type */
- seq->rel = rel; /* relative or absolute library */
- seq->kind = kind; /* used by Blender Objects */
- seq->name = name; /* object name, iterator name list, or NULL */
- /* save the library name */
- BLI_strncpy( seq->filename, filename, strlen(filename)+1 );
- return (PyObject *)seq;
-}
-
-/*
- * Link/append data to the current .blend file, or create a pseudo object
- * which can be linked/appended to a scene.
- */
-
-static PyObject *lib_link_or_append( BPy_LibraryData *self, PyObject * value,
- int mode )
-{
- char *name = PyString_AsString(value);
-
- /* get the name of the data used wants to append */
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string" );
-
- /*
- * For everything except objects, just add to Blender's DB. For objects,
- * create an APPEND or LINK "pseudo object" for the Scene module.
- */
- if( self->type != ID_OB )
- return LibraryData_importLibData( self, name, 0, NULL );
- else {
- /*
- * If this is already a pseudo object, throw an exception: re-linking
- * or re-appending is not allowed
- */
- if( self->kind != OTHER )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "object has already been marked for append or link" );
-
- /* otherwise, create a pseudo object ready for appending or linking */
-
- return CreatePyObject_LibData( ID_OB, mode,
- BLI_strdupn( name, strlen( name ) ), NULL, self->filename,
- self->rel );
- }
-}
-
-/*
- * Perform the actual link or append operation. This procedure is also
- * called externally from the Scene module using a "pseudo Object" so we
- * can be sure objects get linked to a scene.
- */
-
-PyObject *LibraryData_importLibData( BPy_LibraryData *self, char *name,
- int mode, Scene *scene )
-{
- char longFilename[FILE_MAX];
- BlendHandle *openlib;
- Library *lib;
- LinkNode *names, *ptr;
- ID *id;
- ListBase *lb;
- char newName[32];
-
- /* try to open the library */
- openlib = open_library( self->filename, longFilename );
- if( !openlib )
- return NULL;
-
- /* fix any /foo/../foo/ */
- BLI_cleanup_file(NULL, longFilename);
-
- /* find all datablocks for the specified type */
- names = BLO_blendhandle_get_datablock_names ( openlib, self->type );
-
- /* now check for a match to the user-specified name */
- for( ptr = names; ptr; ptr = ptr->next )
- if( strcmp( ptr->link, name ) == 0 ) break;
- BLI_linklist_free( names, free );
-
- /* if no match, throw exception */
- if( !ptr ) {
- BLO_blendhandle_close( openlib );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "library does not contain specified item" );
- }
-
- /*
- * Figure out what the datablock will be named after it's imported. If
- * it's a link, nothing to do. If it's an append, find what it might
- * be renamed to.
- */
-
- if( mode != FILE_LINK ) {
- flag_all_listbases_ids(LIB_APPEND_TAG, 1);
-
- /* see what new block will be called */
- strncpy( newName, name, strlen(name)+1 );
- check_for_dupid( wich_libbase(G.main, self->type), NULL, newName );
- }
-
- /* import from the libary */
- BLO_script_library_append( &openlib, longFilename, name, self->type,
- mode | self->rel, scene );
-
- /*
- * locate the library. If this is an append, make the data local. If it
- * is link, we need the library for later
- */
- for( lib = G.main->library.first; lib; lib = lib->id.next )
- if( strcmp( longFilename, lib->filename ) == 0) {
- if( mode != FILE_LINK ) {
- all_local( lib, 1 );
- /* important we unset, otherwise these object wont
- * link into other scenes from this blend file */
- flag_all_listbases_ids(LIB_APPEND_TAG, 0);
- }
- break;
- }
-
- /* done with library; close it */
- BLO_blendhandle_close( openlib );
-
- /* this should not happen, but just in case */
- if( !lib )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not library" );
-
- /* find the base for this type */
- lb = wich_libbase( G.main, self->type );
-
- /*
- * Check for linked data matching the name first. Even if we are trying
- * to append, if the data has already been linked we need to return it
- * (it won't be appended from the library).
- */
- for( id = lb->first; id; id = id->next ) {
- if( id->lib == lib && id->name[2]==name[0] &&
- strcmp(id->name+2, name)==0 )
- return GetPyObjectFromID( id );
- }
-
- /*
- * If we didn't find it, and we're appending, then try searching for the
- * new datablock, possibly under a new name.
- */
- if( mode != FILE_LINK )
- for( id = lb->first; id; id = id->next ) {
- if( id->lib == NULL && id->name[2]==newName[0] &&
- strcmp(id->name+2, newName)==0 )
- return GetPyObjectFromID( id );
- }
-
- /* if we get here, something's really wrong */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not find data after reading from library" );
-}
-
-/************************************************************
- * Python LibraryData_Type getseters
- ************************************************************/
-
-/* .append(): make a local copy of the library's data (except for objects) */
-
-static PyObject *LibraryData_getAppend( BPy_LibraryData *self, PyObject * value)
-{
- return lib_link_or_append( self, value, OBJECT_IS_APPEND );
-}
-
-/* .link(): make a link to the library's data (except for objects) */
-
-static PyObject *LibraryData_getLink( BPy_LibraryData *self, PyObject * value)
-{
- return lib_link_or_append( self, value, OBJECT_IS_LINK );
-}
-
-/************************************************************************
- * Python LibraryData_Type iterator
- ************************************************************************/
-
-/* Create and initialize the interator indices */
-
-static PyObject *LibraryData_getIter( BPy_LibraryData * self )
-{
- char longFilename[FILE_MAX];
- BlendHandle *openlib;
- LinkNode *names;
-
- /* try to open library */
- openlib = open_library( self->filename, longFilename );
-
- /* if failed, return exception */
- if( !openlib )
- return NULL;
-
- /* find all datablocks for the specified type */
- names = BLO_blendhandle_get_datablock_names ( openlib, self->type );
-
- /* close library*/
- BLO_blendhandle_close( openlib );
-
- /* build an iterator object for the name list */
- return CreatePyObject_LibData( self->type, OTHER, names,
- names, self->filename, self->rel );
-}
-
-/* Return next name. */
-
-static PyObject *LibraryData_nextIter( BPy_LibraryData * self )
-{
- LinkNode *ptr = (LinkNode *)self->iter;
- PyObject *ob;
-
- /* if at the end of list, clean up */
- if( !ptr ) {
- /* If name list is still allocated, free storage. This check is
- * necessary since iter.next() can technically be called repeatedly */
- if( self->name ) {
- BLI_linklist_free( (LinkNode *)self->name, free );
- self->name = NULL;
- }
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- /* otherwise, return the next name in the list */
- ob = PyString_FromString( ptr->link );
- ptr = ptr->next;
- self->iter = ptr;
- return ob;
-}
-
-/************************************************************************
- * Python LibraryData_type methods structure
- ************************************************************************/
-
-static struct PyMethodDef BPy_LibraryData_methods[] = {
- {"append", (PyCFunction)LibraryData_getAppend, METH_O,
- "(str) - create new data from library"},
- {"link", (PyCFunction)LibraryData_getLink, METH_O,
- "(str) - link data from library"},
- {NULL, NULL, 0, NULL}
-};
-
-/* Deallocate object and its data */
-
-static void LibraryData_dealloc( BPy_LibraryData * self )
-{
- if( self->name )
- MEM_freeN( self->name );
-
- PyObject_DEL( self );
-}
-
-/* Display representation of what Library Data is wrapping */
-
-static PyObject *LibraryData_repr( BPy_LibraryData * self )
-{
- char *linkstate = "";
- char *str;
-
- switch (self->type) {
- case ID_OB:
- /* objects can be lib data or pseudo objects */
- switch( self->kind ) {
- case OBJECT_IS_APPEND :
- linkstate = ", appended";
- break;
- case OBJECT_IS_LINK :
- linkstate = ", linked";
- break;
- default:
- break;
- }
- str = "Object";
- break;
- case ID_SCE:
- str = "Scene";
- break;
- case ID_ME:
- str = "Mesh";
- break;
- case ID_CU:
- str = "Curve";
- break;
- case ID_MB:
- str = "Metaball";
- break;
- case ID_MA:
- str = "Material";
- break;
- case ID_TE:
- str = "Texture";
- break;
- case ID_IM:
- str = "Image";
- break;
- case ID_LT:
- str = "Lattice";
- break;
- case ID_LA:
- str = "Lamp";
- break;
- case ID_CA:
- str = "Camera";
- break;
- case ID_IP:
- str = "Ipo";
- break;
- case ID_WO:
- str = "World";
- break;
- case ID_VF:
- str = "Font";
- break;
- case ID_TXT:
- str = "Text";
- break;
- case ID_SO:
- str = "Sound";
- break;
- case ID_GR:
- str = "Group";
- break;
- case ID_AR:
- str = "Armature";
- break;
- case ID_AC:
- str = "Action";
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unsupported ID type" );
- }
-
- return PyString_FromFormat( "[Library Data (%s%s)]", str, linkstate );
-}
-
-PyTypeObject LibraryData_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender LibData", /* char *tp_name; */
- sizeof( BPy_LibraryData ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) LibraryData_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) LibraryData_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- (getiterfunc)LibraryData_getIter, /* getiterfunc tp_iter; */
- (iternextfunc)LibraryData_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_LibraryData_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*
- * Create a LibraryData object for a specific type of Blender Group (ID_OB,
- * ID_MA, etc). These can then be used to link or append the data.
- */
-
-static PyObject *LibraryData_CreatePyObject( BPy_Library *self, void *mode )
-{
- return CreatePyObject_LibData( GET_INT_FROM_POINTER(mode), OTHER, NULL, NULL,
- self->filename, self->rel);
-}
-
-/************************************************************
- * Python Library_Type getseters
- ************************************************************/
-
-/*
- * Return the library's filename.
- */
-
-static PyObject *Library_getFilename( BPy_Library * self )
-{
- return PyString_FromString( self->filename );
-}
-
-/*
- * Set/change the library's filename.
- */
-
-static int Library_setFilename( BPy_Library * self, PyObject * args )
-{
- char *filename = PyString_AsString( args );
- if( !filename )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected a string" );
-
- BLI_strncpy( self->filename, filename, sizeof(self->filename) );
- return 0;
-}
-
-/*
- * Return the library's name. The format depends on whether the library is
- * accessed as relative or absolute.
- */
-
-static PyObject *Library_getName( BPy_Library * self )
-{
- Library *lib;
- BlendHandle *openlib;
- char longFilename[FILE_MAX];
-
- /* try to open the library */
- openlib = open_library( self->filename, longFilename );
- if( openlib ) {
- BLO_blendhandle_close( openlib );
- /* remove any /../ or /./ junk */
- BLI_cleanup_file(NULL, longFilename);
-
- /* search the loaded libraries for a match */
- for( lib = G.main->library.first; lib; lib = lib->id.next )
- if( strcmp( longFilename, lib->filename ) == 0) {
- return PyString_FromString( lib->name );
- }
-
- /* library not found in memory */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "library not loaded" );
- }
- /* could not load library */
- return EXPP_ReturnPyObjError( PyExc_IOError, "library not found" );
-}
-
-
-/************************************************************************
- * Python Library_type attributes get/set structure
- ************************************************************************/
-
-static PyGetSetDef Library_getseters[] = {
- {"filename",
- (getter)Library_getFilename, (setter)Library_setFilename,
- "library filename",
- NULL},
- {"name",
- (getter)Library_getName, (setter)NULL,
- "library name (as used by Blender)",
- NULL},
- {"objects",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "objects from the library",
- (void *)ID_OB},
- {"scenes",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "scenes from the library",
- (void *)ID_SCE},
- {"meshes",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "meshes from the library",
- (void *)ID_ME},
- {"curves",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "curves from the library",
- (void *)ID_CU},
- {"metaballs",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "metaballs from the library",
- (void *)ID_MB},
- {"lattices",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "lattices from the library",
- (void *)ID_LT},
- {"lamps",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "lamps from the library",
- (void *)ID_LA},
- {"cameras",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "cameras from the library",
- (void *)ID_CA},
- {"materials",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "objects from the library",
- (void *)ID_MA},
- {"textures",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "textures from the library",
- (void *)ID_TE},
- {"images",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "images from the library",
- (void *)ID_IM},
- {"ipos",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "ipos from the library",
- (void *)ID_IP},
- {"worlds",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "worlds from the library",
- (void *)ID_WO},
- {"fonts",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "fonts from the library",
- (void *)ID_VF},
- {"texts",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "texts from the library",
- (void *)ID_TXT},
- {"groups",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "groups from the library",
- (void *)ID_GR},
- {"sounds",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "sounds from the library",
- (void *)ID_SO},
- {"actions",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "actions from the library",
- (void *)ID_AC},
- {"armatures",
- (getter)LibraryData_CreatePyObject, (setter)NULL,
- "armatures from the library",
- (void *)ID_AR},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*
- * Define a new library and create a library object. We don't actually test
- * if the library is valid here since we have to do it when the file is
- * actually accessed later.
- */
-
-static PyObject *M_Library_Load(PyObject *self, PyObject * args)
-{
- char *filename = NULL;
- PyObject *relative = NULL;
- BPy_Library *lib;
-
- if( !PyArg_ParseTuple( args, "s|O", &filename, &relative ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected strings and optional bool as arguments." );
-
- /* try to create a new object */
- lib = (BPy_Library *)PyObject_NEW( BPy_Library, &Library_Type );
- if( !lib )
- return NULL;
-
- /* save relative flag value */
- if( relative && PyObject_IsTrue(relative) )
- lib->rel = FILE_STRINGCODE;
- else
- lib->rel = 0;
-
- /* assign the library filename for future use, then return */
- BLI_strncpy( lib->filename, filename, sizeof(lib->filename) );
-
- return (PyObject *)lib;
-}
-
-static PyObject *M_Library_GetPaths(PyObject *self, PyObject * args)
-{
- PyObject *list;
- PyObject *name;
- int type=0;
- Library *lib;
-
- if( !PyArg_ParseTuple( args, "|i", &type ) || type < 0 || type > 2 ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int between 0 and 2." );
- }
-
- list = PyList_New(0);
-
- for(lib= G.main->library.first; lib; lib= lib->id.next) {
- if (type==0) {
- /* any type is ok */
- } else if (type==1 && lib->parent == 0) {
- /* only direct linked */
- } else if (type==2 && lib->parent != 0) {
- /* only indirect */
- } else {
- continue; /* incompatible type */
- }
-
- name = PyString_FromString(lib->name);
- PyList_Append(list, name);
- Py_DECREF(name);
- }
- return list;
-}
-
-static PyObject *M_Library_ReplacePath(PyObject *self, PyObject * args)
-{
- char *name_from, *name_to;
- Library *lib;
-
- if( !PyArg_ParseTuple( args, "ss", &name_from, &name_to )) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected the name of a library path" );
- }
-
- for(lib= G.main->library.first; lib; lib= lib->id.next) {
- if (strcmp(lib->name, name_from)==0) {
- if (lib->parent) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "path is indirectly linked, cannot be changed." );
- }
-
- if (strlen(name_to) > sizeof(lib->name)) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "string length too long, cannot set path." );
- }
-
- strcpy(lib->name, name_to);
- Py_RETURN_NONE;
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "path given does not exist as a library" );
-}
-
-
-
-static struct PyMethodDef M_Library_methods[] = {
- {"load", (PyCFunction)M_Library_Load, METH_VARARGS,
- "(string) - declare a .blend file for use as a library"},
- {"paths", (PyCFunction)M_Library_GetPaths, METH_VARARGS,
- "(type) - return a list of library paths, type 0 for all, 1 only direct links, 2 only indirect links"},
- {"replace", (PyCFunction)M_Library_ReplacePath, METH_VARARGS,
- "(from, to) - replace the path of an existing, directly linked library."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Library_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Library_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Library", /* char *tp_name; */
- sizeof( BPy_Library ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- Library_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*
- * Library module initialization
- */
-
-static char M_newLibrary_doc[] = "The Blender.lib submodule";
-
-PyObject *Library_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Library_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &LibraryData_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.lib", M_Library_methods,
- M_newLibrary_doc );
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Library.h b/source/blender/python/api2_2x/Library.h
deleted file mode 100644
index b75e61d55ff..00000000000
--- a/source/blender/python/api2_2x/Library.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_LIBRARY_H
-#define EXPP_LIBRARY_H
-
-#include <Python.h>
-#include "DNA_scene_types.h"
-#include "BLI_linklist.h"
-
-#include "blendef.h"
-
-/*****************************************************************************/
-/* Python BPy_Library structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- int rel;
-} BPy_Library;
-
-typedef struct {
- PyObject_HEAD
- LinkNode *iter;
- int type;
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- char *name;
- int rel;
- enum {
- OBJECT_IS_LINK,
- OBJECT_IS_APPEND,
- OTHER
- } kind;
-} BPy_LibraryData;
-
-extern PyTypeObject Library_Type;
-extern PyTypeObject LibraryData_Type;
-
-#define BPy_LibraryData_Check(v) ((v)->ob_type == &LibraryData_Type)
-#define BPy_Library_Check(v) ((v)->ob_type == &Library_Type)
-
-/*****************************************************************************/
-/* Module Blender.Library - public functions */
-/*****************************************************************************/
-PyObject *Library_Init( void );
-PyObject *oldLibrary_Init( void );
-
-PyObject *LibraryData_importLibData( BPy_LibraryData *self, char *name,
- int mode, Scene *scene );
-
-#endif /* EXPP_LIBRARY_H */
diff --git a/source/blender/python/api2_2x/MTex.c b/source/blender/python/api2_2x/MTex.c
deleted file mode 100644
index 4db9715a465..00000000000
--- a/source/blender/python/api2_2x/MTex.c
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Alex Mole, Yehoshua Sapir, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "MTex.h" /*This must come first*/
-
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
-#include "Texture.h"
-#include "Object.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "DNA_material_types.h"
-#include "DNA_world_types.h"
-
-/*****************************************************************************/
-/* Python BPy_MTex methods declarations: */
-/*****************************************************************************/
-static PyObject *MTex_setTexMethod( BPy_MTex * self, PyObject * args );
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Texture.MTex module: */
-/*****************************************************************************/
-struct PyMethodDef M_MTex_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_MTex methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_MTex_methods[] = {
- /* name, method, flags, doc */
- {"setTex", ( PyCFunction ) MTex_setTexMethod, METH_VARARGS,
- "(i) - Set MTex Texture"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python MTex_Type callback function prototypes: */
-/*****************************************************************************/
-static int MTex_compare( BPy_MTex * a, BPy_MTex * b );
-static PyObject *MTex_repr( BPy_MTex * self );
-
-#define MTEXGET(x) \
- static PyObject *MTex_get##x( BPy_MTex *self, void *closure );
-#define MTEXSET(x) \
- static int MTex_set##x( BPy_MTex *self, PyObject *value, void *closure);
-#define MTEXGETSET(x) \
- MTEXGET(x) \
- MTEXSET(x)
-
-MTEXGETSET(Tex)
-MTEXGETSET(TexCo)
-MTEXGETSET(Object)
-MTEXGETSET(UVLayer)
-MTEXGETSET(MapTo)
-MTEXGETSET(Col)
-MTEXGETSET(DVar)
-MTEXGETSET(BlendMode)
-MTEXGETSET(ColFac)
-MTEXGETSET(NorFac)
-MTEXGETSET(VarFac)
-MTEXGETSET(DispFac)
-MTEXGETSET(WarpFac)
-MTEXGETSET(Ofs)
-MTEXGETSET(Size)
-MTEXGETSET(Mapping)
-MTEXGETSET(Flag)
-MTEXGETSET(ProjX)
-MTEXGETSET(ProjY)
-MTEXGETSET(ProjZ)
-MTEXGETSET(MapToFlag)
-MTEXGETSET(WorldMapToFlag)
-
-/*****************************************************************************/
-/* Python get/set methods table */
-/*****************************************************************************/
-
-static PyGetSetDef MTex_getseters[] = {
- { "tex", (getter) MTex_getTex, (setter) MTex_setTex,
- "Texture whose mapping this MTex describes", NULL },
- { "texco", (getter) MTex_getTexCo, (setter) MTex_setTexCo,
- "Texture coordinate space (UV, Global, etc.)", NULL },
- { "object", (getter) MTex_getObject, (setter) MTex_setObject,
- "Object whose space to use when texco is Object", NULL },
- { "uvlayer", (getter) MTex_getUVLayer, (setter) MTex_setUVLayer,
- "Name of the UV layer to use", NULL },
- { "mapto", (getter) MTex_getMapTo, (setter) MTex_setMapTo,
- "What values the texture affects", NULL },
- { "col", (getter) MTex_getCol, (setter) MTex_setCol,
- "Color that the texture blends with", NULL },
- { "dvar", (getter) MTex_getDVar, (setter) MTex_setDVar,
- "Value that the texture blends with when not blending colors", NULL },
- { "blendmode", (getter) MTex_getBlendMode, (setter) MTex_setBlendMode,
- "Texture blending mode", NULL },
- { "colfac", (getter) MTex_getColFac, (setter) MTex_setColFac,
- "Factor by which texture affects color", NULL },
- { "norfac", (getter) MTex_getNorFac, (setter) MTex_setNorFac,
- "Factor by which texture affects normal", NULL },
- { "varfac", (getter) MTex_getVarFac, (setter) MTex_setVarFac,
- "Factor by which texture affects most variables", NULL },
- { "dispfac", (getter) MTex_getDispFac, (setter) MTex_setDispFac,
- "Factor by which texture affects displacement", NULL },
- { "warpfac", (getter) MTex_getWarpFac, (setter) MTex_setWarpFac,
- "Factor by which texture affects warp", NULL },
- { "ofs", (getter) MTex_getOfs, (setter) MTex_setOfs,
- "Offset to adjust texture space", NULL },
- { "size", (getter) MTex_getSize, (setter) MTex_setSize,
- "Size to scale texture space", NULL },
- { "mapping", (getter) MTex_getMapping, (setter) MTex_setMapping,
- "Mapping of texture coordinates (flat, cube, etc.)", NULL },
- { "stencil", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Stencil mode", (void*) MTEX_STENCIL },
- { "neg", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Negate texture values mode", (void*) MTEX_NEGATIVE },
- { "noRGB", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Convert texture RGB values to intensity values",
- (void*) MTEX_RGBTOINT },
- { "correctNor", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Correct normal mapping for Texture space and Object space",
- (void*) MTEX_VIEWSPACE },
- { "fromDupli", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent",
- (void*) MTEX_DUPLI_MAPTO },
- { "fromOrig", (getter) MTex_getFlag, (setter) MTex_setFlag,
- "Dupli's derive their object coordinates from the original objects transformation",
- (void*) MTEX_OB_DUPLI_ORIG },
- { "xproj", (getter) MTex_getProjX, (setter) MTex_setProjX,
- "Projection of X axis to Texture space", NULL },
- { "yproj", (getter) MTex_getProjY, (setter) MTex_setProjY,
- "Projection of Y axis to Texture space", NULL },
- { "zproj", (getter) MTex_getProjZ, (setter) MTex_setProjZ,
- "Projection of Z axis to Texture space", NULL },
-
- /* MapTo for Material and Lamp MTex */
-
- { "mtCol", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to color", (void*) MAP_COL },
-
- /* MapTo for Material MTex */
-
- { "mtNor", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to normals", (void*) MAP_NORM },
- { "mtCsp", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to specularity color", (void*) MAP_COLSPEC },
- { "mtCmir", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to mirror color", (void*) MAP_COLMIR },
- { "mtRef", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to reflectivity", (void*) MAP_REF },
- { "mtSpec", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to specularity", (void*) MAP_SPEC },
- { "mtEmit", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to emit value", (void*) MAP_EMIT },
- { "mtAlpha", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to alpha value", (void*) MAP_ALPHA },
- { "mtHard", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to hardness", (void*) MAP_HAR },
- { "mtRayMir", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to RayMir value", (void*) MAP_RAYMIRR },
- { "mtTranslu", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to translucency", (void*) MAP_TRANSLU },
- { "mtAmb", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to ambient value", (void*) MAP_AMB },
- { "mtDisp", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to displacement", (void*) MAP_DISPLACE },
- { "mtWarp", (getter) MTex_getMapToFlag, (setter) MTex_setMapToFlag,
- "How texture maps to warp", (void*) MAP_WARP },
-
- /* MapTo for World MTex */
-
- { "mtBlend", (getter) MTex_getWorldMapToFlag, (setter) MTex_setWorldMapToFlag,
- "Texture affects color progression of background", (void*) WOMAP_BLEND },
- { "mtHoriz", (getter) MTex_getWorldMapToFlag, (setter) MTex_setWorldMapToFlag,
- "Texture affects color of the horizon", (void*) WOMAP_HORIZ },
- { "mtZenUp", (getter) MTex_getWorldMapToFlag, (setter) MTex_setWorldMapToFlag,
- "Texture affects color of the zenith above", (void*) WOMAP_ZENUP },
- { "mtZenDown", (getter) MTex_getWorldMapToFlag, (setter) MTex_setWorldMapToFlag,
- "Texture affects color of the zenith below", (void*) WOMAP_ZENDOWN },
-
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-
-
-/*****************************************************************************/
-/* Python MTex_Type structure definition: */
-/*****************************************************************************/
-
-PyTypeObject MTex_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender MTex", /* tp_name */
- sizeof( BPy_MTex ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- ( cmpfunc ) MTex_compare, /* tp_compare */
- ( reprfunc ) MTex_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0,
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- BPy_MTex_methods, /* tp_methods */
- 0, /* tp_members */
- MTex_getseters, /* struct PyGetSetDef *tp_getset; */
- 0, /* struct _typeobject *tp_base; */
- 0, /* PyObject *tp_dict; */
- 0, /* descrgetfunc tp_descr_get; */
- 0, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- 0, /* initproc tp_init; */
- 0, /* allocfunc tp_alloc; */
- 0, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- 0, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- 0, /* inquiry tp_is_gc; */
- 0, /* PyObject *tp_bases; */
- /* method resolution order */
- 0, /* PyObject *tp_mro; */
- 0, /* PyObject *tp_cache; */
- 0, /* PyObject *tp_subclasses; */
- 0, /* PyObject *tp_weaklist; */
- 0
-};
-
-
-PyObject *MTex_Init( void )
-{
- PyObject *submodule;
-/* PyObject *dict; */
-
- /* call PyType_Ready() to init dictionaries & such */
- if( PyType_Ready( &MTex_Type) < 0)
- Py_RETURN_NONE;
-
- submodule = Py_InitModule( "Blender.Texture.MTex", M_MTex_methods );
-
- return submodule;
-}
-
-PyObject *MTex_CreatePyObject( MTex * mtex, unsigned short type )
-{
- BPy_MTex *pymtex;
-
- pymtex = ( BPy_MTex * ) PyObject_NEW( BPy_MTex, &MTex_Type );
- if( !pymtex )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_MTex PyObject" );
-
- pymtex->mtex = mtex;
- pymtex->type = type;
- return ( PyObject * ) pymtex;
-}
-
-MTex *MTex_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_MTex * ) pyobj )->mtex;
-}
-
-/*****************************************************************************/
-/* Python BPy_MTex methods: */
-/*****************************************************************************/
-
-static PyObject *MTex_setTexMethod( BPy_MTex * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)MTex_setTex );
-}
-
-static int MTex_compare( BPy_MTex * a, BPy_MTex * b )
-{
- return ( a->mtex == b->mtex ) ? 0 : -1;
-}
-
-static PyObject *MTex_repr( BPy_MTex * self )
-{
- if( self->type == ID_MA )
- return PyString_FromFormat( "[MTex (Material)]" );
- else if( self->type == ID_LA )
- return PyString_FromFormat( "[MTex (Lamp)]" );
- else
- return PyString_FromFormat( "[MTex (World)]" );
-}
-
-
-/*****************************************************************************/
-/* Python BPy_MTex get and set functions: */
-/*****************************************************************************/
-
-static PyObject *MTex_getTex( BPy_MTex *self, void *closure )
-{
- if( self->mtex->tex )
- return Texture_CreatePyObject( self->mtex->tex );
- else
- Py_RETURN_NONE;
-}
-
-static int MTex_setTex( BPy_MTex *self, PyObject *value, void *closure)
-{
- return GenericLib_assignData(value, (void **) &self->mtex->tex, 0, 1, ID_TE, 0);
-}
-
-static PyObject *MTex_getTexCo( BPy_MTex *self, void *closure )
-{
- return PyInt_FromLong( self->mtex->texco );
-}
-
-static int MTex_setTexCo( BPy_MTex *self, PyObject *value, void *closure)
-{
- int texco;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be a member of Texture.TexCo dictionary" );
-
- texco = PyInt_AsLong( value ) ;
-
- switch ( self->type ) {
- case ID_MA :
- if( texco != TEXCO_ORCO && texco != TEXCO_REFL &&
- texco != TEXCO_NORM && texco != TEXCO_GLOB &&
- texco != TEXCO_UV && texco != TEXCO_OBJECT &&
- texco != TEXCO_STRESS && texco != TEXCO_TANGENT &&
- texco != TEXCO_WINDOW && texco != TEXCO_VIEW &&
- texco != TEXCO_STICKY )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.TexCo dictionary" );
- break;
- case ID_LA :
- if( texco != TEXCO_VIEW && texco != TEXCO_GLOB &&
- texco != TEXCO_OBJECT )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.TexCo dictionary" );
- break;
- default: /* ID_WO */
- if( texco != TEXCO_VIEW && texco != TEXCO_GLOB &&
- texco != TEXCO_ANGMAP && texco != TEXCO_OBJECT &&
- texco != TEXCO_H_SPHEREMAP && texco != TEXCO_H_TUBEMAP )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.TexCo dictionary" );
- break;
- }
-
- self->mtex->texco = (short)texco;
-
- return 0;
-}
-
-static PyObject *MTex_getObject( BPy_MTex *self, void *closure )
-{
- if( self->mtex->object )
- return Object_CreatePyObject( self->mtex->object );
- else
- Py_RETURN_NONE;
-}
-
-static int MTex_setObject( BPy_MTex *self, PyObject *value, void *closure)
-{
- return GenericLib_assignData(value, (void **) &self->mtex->object, 0, 1, ID_OB, 0);
-}
-
-static PyObject *MTex_getUVLayer( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a Material MTex object" );
-
- return PyString_FromString(self->mtex->uvname);
-}
-
-static int MTex_setUVLayer( BPy_MTex *self, PyObject *value, void *closure)
-{
- if ( !PyString_Check(value) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string value" );
- BLI_strncpy(self->mtex->uvname, PyString_AsString(value), 31);
- return 0;
-}
-
-static PyObject *MTex_getMapTo( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a Material MTex object" );
-
- return PyInt_FromLong( self->mtex->mapto );
-}
-
-static int MTex_setMapTo( BPy_MTex *self, PyObject *value, void *closure)
-{
- int mapto;
-
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int" );
-
- mapto = PyInt_AsLong( value );
-
- /* This method is deprecated anyway. */
- if ( mapto < 0 || mapto > 16383 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a sum of values from Texture.MapTo dictionary" );
-
- self->mtex->mapto = (short)mapto;
-
- return 0;
-}
-
-static PyObject *MTex_getCol( BPy_MTex *self, void *closure )
-{
- return Py_BuildValue( "(f,f,f)", self->mtex->r, self->mtex->g,
- self->mtex->b );
-}
-
-static int MTex_setCol( BPy_MTex *self, PyObject *value, void *closure)
-{
- float rgb[3];
- int i;
-
- if( !PyArg_ParseTuple( value, "fff", &rgb[0], &rgb[1], &rgb[2] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 3 floats" );
-
- for( i = 0; i < 3; ++i )
- if( rgb[i] < 0 || rgb[i] > 1 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "values must be in range [0,1]" );
-
- self->mtex->r = rgb[0];
- self->mtex->g = rgb[1];
- self->mtex->b = rgb[2];
-
- return 0;
-}
-
-static PyObject *MTex_getDVar( BPy_MTex *self, void *closure )
-{
- return PyFloat_FromDouble(self->mtex->def_var);
-}
-
-static int MTex_setDVar( BPy_MTex *self, PyObject *value, void *closure)
-{
- float f;
-
- if ( !PyFloat_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float" );
-
- f = (float)PyFloat_AsDouble(value);
-
- if (f < 0 || f > 1)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "values must be in range [0,1]" );
-
- self->mtex->def_var = f;
-
- return 0;
-}
-
-static PyObject *MTex_getBlendMode( BPy_MTex *self, void *closure )
-{
- return PyInt_FromLong(self->mtex->blendtype);
-}
-
-static int MTex_setBlendMode( BPy_MTex *self, PyObject *value, void *closure)
-{
- int n;
-
- if ( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be member of Texture.BlendModes dictionary" );
-
- n = PyInt_AsLong(value);
-
- if (n < 0 || n > 8)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be member of Texture.BlendModes dictionary" );
-
- self->mtex->blendtype = (short)n;
-
- return 0;
-}
-
-static PyObject *MTex_getColFac( BPy_MTex *self, void *closure )
-{
- return PyFloat_FromDouble(self->mtex->colfac);
-}
-
-static int MTex_setColFac( BPy_MTex *self, PyObject *value, void *closure)
-{
- return EXPP_setFloatRange( value, &self->mtex->colfac, 0.0f, 1.0f );
-}
-
-static PyObject *MTex_getNorFac( BPy_MTex *self, void *closure )
-{
- if( self->type == ID_LA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material or world MTex object" );
-
- return PyFloat_FromDouble(self->mtex->norfac);
-}
-
-static int MTex_setNorFac( BPy_MTex *self, PyObject *value, void *closure)
-{
- switch( self->type )
- {
- case ID_WO:
- return EXPP_setFloatRange( value, &self->mtex->norfac, 0.0f, 1.0f );
- case ID_MA:
- return EXPP_setFloatRange( value, &self->mtex->norfac, 0.0f, 25.0f );
- default:
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material or world MTex object" );
- }
-}
-
-static PyObject *MTex_getVarFac( BPy_MTex *self, void *closure )
-{
- if( self->type == ID_LA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material or world MTex object" );
-
- return PyFloat_FromDouble(self->mtex->varfac);
-}
-
-static int MTex_setVarFac( BPy_MTex *self, PyObject *value, void *closure)
-{
- if( self->type == ID_LA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material or world MTex object" );
-
- return EXPP_setFloatRange( value, &self->mtex->varfac, 0.0f, 1.0f );
-}
-
-static PyObject *MTex_getDispFac( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyFloat_FromDouble(self->mtex->dispfac);
-}
-
-static int MTex_setDispFac( BPy_MTex *self, PyObject *value, void *closure)
-{
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return EXPP_setFloatRange( value, &self->mtex->dispfac, 0.0f, 1.0f );
-}
-
-static PyObject *MTex_getWarpFac( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyFloat_FromDouble(self->mtex->warpfac);
-}
-
-static int MTex_setWarpFac( BPy_MTex *self, PyObject *value, void *closure)
-{
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return EXPP_setFloatRange( value, &self->mtex->warpfac, 0.0f, 1.0f );
-}
-
-static PyObject *MTex_getOfs( BPy_MTex *self, void *closure )
-{
- return Py_BuildValue( "(f,f,f)", self->mtex->ofs[0], self->mtex->ofs[1],
- self->mtex->ofs[2] );
-}
-
-static int MTex_setOfs( BPy_MTex *self, PyObject *value, void *closure)
-{
- float f[3];
- int i;
- float max;
-
- if( !PyArg_ParseTuple( value, "fff", &f[0], &f[1], &f[2] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 3 floats" );
-
- if( self->type == ID_MA )
- max = 10.0f;
- else
- max = 20.0f;
-
- for( i = 0; i < 3; ++i )
- if( f[i] < -max || f[i] > max ) {
- char errstr[64];
- sprintf( errstr, "values must be in range [-%6.0f,%6.0f]",
- max, max );
- return EXPP_ReturnIntError( PyExc_ValueError, errstr );
- }
-
- self->mtex->ofs[0] = f[0];
- self->mtex->ofs[1] = f[1];
- self->mtex->ofs[2] = f[2];
-
- return 0;
-}
-
-static PyObject *MTex_getSize( BPy_MTex *self, void *closure )
-{
- return Py_BuildValue( "(f,f,f)", self->mtex->size[0], self->mtex->size[1],
- self->mtex->size[2] );
-}
-
-static int MTex_setSize( BPy_MTex *self, PyObject *value, void *closure)
-{
- float f[3];
- int i;
-
- if( !PyArg_ParseTuple( value, "fff", &f[0], &f[1], &f[2] ) )
-
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 3 floats" );
-
- for( i = 0; i < 3; ++i )
- if( f[i] < -100 || f[i] > 100 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "values must be in range [-100,100]" );
-
- self->mtex->size[0] = f[0];
- self->mtex->size[1] = f[1];
- self->mtex->size[2] = f[2];
-
- return 0;
-}
-
-static PyObject *MTex_getMapping( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyInt_FromLong( self->mtex->mapping );
-}
-
-static int MTex_setMapping( BPy_MTex *self, PyObject *value, void *closure)
-{
- int n;
-
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
-
- if ( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be member of Texture.Mappings dictionary" );
-
- n = PyInt_AsLong(value);
-
-/* if (n != MTEX_FLAT && n != MTEX_TUBE && n != MTEX_CUBE &&
- n != MTEX_SPHERE) */
- if (n < 0 || n > 3) {
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be member of Texture.Mappings dictionary" );
- }
-
- self->mtex->mapping = (char)n;
-
- return 0;
-}
-
-static PyObject *MTex_getFlag( BPy_MTex *self, void *closure )
-{
- int flag = GET_INT_FROM_POINTER(closure);
-
- if( self->type != ID_MA &&
- flag & ( MTEX_VIEWSPACE | MTEX_DUPLI_MAPTO | MTEX_OB_DUPLI_ORIG ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "attribute only vaild for material MTex object" );
-
- return PyBool_FromLong( self->mtex->texflag & flag );
-}
-
-static int MTex_setFlag( BPy_MTex *self, PyObject *value, void *closure)
-{
- int flag = GET_INT_FROM_POINTER(closure);
-
- if( self->type != ID_MA &&
- flag & ( MTEX_VIEWSPACE | MTEX_DUPLI_MAPTO | MTEX_OB_DUPLI_ORIG ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute only vaild for material MTex object" );
-
- if ( !PyBool_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a bool");
-
- if ( value == Py_True )
- self->mtex->texflag |= flag;
- else
- self->mtex->texflag &= ~flag;
-
- return 0;
-}
-
-static PyObject *MTex_getProjX( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyInt_FromLong( self->mtex->projx );
-}
-
-static int MTex_setProjX( BPy_MTex *self, PyObject *value, void *closure)
-{
- int proj;
-
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- if( !PyInt_Check( value ) ) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be a member of Texture.Proj dictionary" );
- }
-
- proj = PyInt_AsLong( value ) ;
-
- /* valid values are from PROJ_N to PROJ_Z = 0 to 3 */
- if (proj < 0 || proj > 3)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.Proj dictionary" );
-
- self->mtex->projx = (char)proj;
-
- return 0;
-}
-
-static PyObject *MTex_getProjY( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyInt_FromLong( self->mtex->projy );
-}
-
-static int MTex_setProjY( BPy_MTex *self, PyObject *value, void *closure )
-{
- int proj;
-
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- if( !PyInt_Check( value ) ) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be a member of Texture.Proj dictionary" );
- }
-
- proj = PyInt_AsLong( value ) ;
-
- /* valid values are from PROJ_N to PROJ_Z = 0 to 3 */
- if (proj < 0 || proj > 3)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.Proj dictionary" );
-
- self->mtex->projy = (char)proj;
-
- return 0;
-}
-
-static PyObject *MTex_getProjZ( BPy_MTex *self, void *closure )
-{
- if( self->type != ID_MA )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a material MTex object" );
-
- return PyInt_FromLong( self->mtex->projz );
-}
-
-static int MTex_setProjZ( BPy_MTex *self, PyObject *value, void *closure)
-{
- int proj;
-
- if( self->type != ID_MA )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "not a material MTex object" );
-
- if( !PyInt_Check( value ) ) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Value must be a member of Texture.Proj dictionary" );
- }
-
- proj = PyInt_AsLong( value ) ;
-
- /* valid values are from PROJ_N to PROJ_Z = 0 to 3 */
- if (proj < 0 || proj > 3)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Value must be a member of Texture.Proj dictionary" );
-
- self->mtex->projz = (char)proj;
-
- return 0;
-}
-
-static PyObject *MTex_getMapToFlag( BPy_MTex *self, void *closure )
-{
- int flag = GET_INT_FROM_POINTER(closure);
-
- if( self->type == ID_LA && flag != MAP_COL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "attribute not available for a lamp MTex" );
-
- if ( self->mtex->mapto & flag )
- return PyInt_FromLong( ( self->mtex->maptoneg & flag ) ? -1 : 1 );
- else
- return PyInt_FromLong( 0 );
-}
-
-static PyObject *MTex_getWorldMapToFlag( BPy_MTex *self, void *closure )
-{
- int flag = GET_INT_FROM_POINTER(closure);
-
- if( self->type != ID_WO )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "not a world MTex object" );
-
- return PyInt_FromLong( (long)( (self->mtex->mapto & flag) != 0 ) );
-}
-
-static int MTex_setMapToFlag( BPy_MTex *self, PyObject *value, void *closure)
-{
- int flag = GET_INT_FROM_POINTER(closure);
- int intVal;
-
- if( self->type == ID_LA && flag != MAP_COL )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute not available for a lamp MTex" );
-
- if ( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int");
-
- intVal = PyInt_AsLong( value ) ;
-
- if( flag & ( MAP_COL | MAP_COLSPEC | MAP_COLMIR | MAP_WARP ) ) {
- if (intVal < 0 || intVal > 1) {
- return EXPP_ReturnIntError( PyExc_ValueError,
- "value for that mapping must be 0 or 1" );
- }
- } else {
- if (intVal < -1 || intVal > 1) {
- return EXPP_ReturnIntError( PyExc_ValueError,
- "value for that mapping must be -1, 0 or 1" );
- }
- }
-
- switch (intVal)
- {
- case 0:
- self->mtex->mapto &= ~flag;
- self->mtex->maptoneg &= ~flag;
- break;
-
- case 1:
- self->mtex->mapto |= flag;
- self->mtex->maptoneg &= ~flag;
- break;
-
- case -1:
- self->mtex->mapto |= flag;
- self->mtex->maptoneg |= flag;
- break;
- }
-
- return 0;
-}
-
-static int MTex_setWorldMapToFlag( BPy_MTex *self, PyObject *value, void *closure)
-{
- int flag = GET_INT_FROM_POINTER(closure);
-
- if( self->type != ID_WO )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute only available for a world MTex" );
-
- if ( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int");
-
- switch( PyInt_AsLong( value ) ) {
- case 0:
- self->mtex->mapto &= ~flag;
- break;
- case 1:
- self->mtex->mapto |= flag;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_ValueError,
- "value for mapping must be 0 or 1" );
- }
-
- return 0;
-}
-
diff --git a/source/blender/python/api2_2x/MTex.h b/source/blender/python/api2_2x/MTex.h
deleted file mode 100644
index b6c98a40d2e..00000000000
--- a/source/blender/python/api2_2x/MTex.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Alex Mole
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_MTEX_H
-#define EXPP_MTEX_H
-
-#include <Python.h>
-#include "DNA_texture_types.h"
-
-
-/*****************************************************************************/
-/* Python BPy_MTex structure definition */
-/*****************************************************************************/
-
-#define MATERIAL_MTEX_TYPE 1
-#define WORLD_MTEX_TYPE 2
-#define LAMP_MTEX_TYPE 3
-
-typedef struct {
- PyObject_HEAD
- MTex * mtex;
- unsigned short type;
-} BPy_MTex;
-
-extern PyTypeObject MTex_Type;
-
-#define BPy_MTex_Check(v) ((v)->ob_type == &MTex_Type)
-
-/*****************************************************************************/
-/* Module Blender.Texture.MTex - public functions */
-/*****************************************************************************/
-
-PyObject *MTex_Init( void );
-PyObject *MTex_CreatePyObject( struct MTex *obj, unsigned short type );
-MTex *MTex_FromPyObject( PyObject * py_obj );
-
-
-#endif /* EXPP_MTEX_H */
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c
deleted file mode 100644
index cb2c81aba6e..00000000000
--- a/source/blender/python/api2_2x/Material.c
+++ /dev/null
@@ -1,3479 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Michel Selten, Alex Mole,
- * Alexander Szakaly, Campbell Barton, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Material.h" /*This must come first*/
-
-#include "DNA_space_types.h"
-#include "DNA_material_types.h"
-#include "DNA_userdef_types.h"
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_material.h"
-#include "BKE_texture.h"
-#include "BKE_node.h"
-#include "BKE_idprop.h"
-#include "BKE_utildefines.h" /* for CLAMP */
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-#include "BSE_editipo.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "mydevice.h"
-#include "constant.h"
-#include "MTex.h"
-#include "Texture.h"
-#include "Ipo.h"
-#include "Group.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "IDProp.h"
-
-/*****************************************************************************/
-/* Python BPy_Material defaults: */
-/*****************************************************************************/
-/* Material MIN, MAX values */
-#define EXPP_MAT_ADD_MIN 0.0f
-#define EXPP_MAT_ADD_MAX 1.0f
-#define EXPP_MAT_ALPHA_MIN 0.0f
-#define EXPP_MAT_ALPHA_MAX 1.0f
-#define EXPP_MAT_AMB_MIN 0.0f
-#define EXPP_MAT_AMB_MAX 1.0f
-#define EXPP_MAT_COL_MIN 0.0f /* min/max for all ... */
-#define EXPP_MAT_COL_MAX 1.0f /* ... color triplets */
-#define EXPP_MAT_EMIT_MIN 0.0f
-#define EXPP_MAT_EMIT_MAX 1.0f
-#define EXPP_MAT_REF_MIN 0.0f
-#define EXPP_MAT_REF_MAX 1.0f
-#define EXPP_MAT_SPEC_MIN 0.0f
-#define EXPP_MAT_SPEC_MAX 2.0f
-#define EXPP_MAT_SPECTRA_MIN 0.0f
-#define EXPP_MAT_SPECTRA_MAX 1.0f
-
-/* Shader specific settings */
-
-#define EXPP_MAT_ROUGHNESS_MIN 0.0f
-#define EXPP_MAT_ROUGHNESS_MAX 3.140f
-#define EXPP_MAT_SPECSIZE_MIN 0.0f
-#define EXPP_MAT_SPECSIZE_MAX 1.530f
-#define EXPP_MAT_DIFFUSESIZE_MIN 0.0f
-#define EXPP_MAT_DIFFUSESIZE_MAX 3.140f
-#define EXPP_MAT_SPECSMOOTH_MIN 0.0f
-#define EXPP_MAT_SPECSMOOTH_MAX 1.0f
-#define EXPP_MAT_DIFFUSESMOOTH_MIN 0.0f
-#define EXPP_MAT_DIFFUSESMOOTH_MAX 1.0f
-#define EXPP_MAT_DIFFUSE_DARKNESS_MIN 0.0f
-#define EXPP_MAT_DIFFUSE_DARKNESS_MAX 2.0f
-#define EXPP_MAT_REFRACINDEX_MIN 1.0f
-#define EXPP_MAT_REFRACINDEX_MAX 10.0f
-#define EXPP_MAT_RMS_MIN 0.0f
-#define EXPP_MAT_RMS_MAX 0.4f
-/* End shader settings */
-
-#define EXPP_MAT_ZOFFS_MIN 0.0
-#define EXPP_MAT_ZOFFS_MAX 10.0
-#define EXPP_MAT_HALOSIZE_MIN 0.0
-#define EXPP_MAT_HALOSIZE_MAX 100.0
-#define EXPP_MAT_FLARESIZE_MIN 0.1f
-#define EXPP_MAT_FLARESIZE_MAX 25.0
-#define EXPP_MAT_FLAREBOOST_MIN 0.1f
-#define EXPP_MAT_FLAREBOOST_MAX 10.0
-#define EXPP_MAT_SUBSIZE_MIN 0.1f
-#define EXPP_MAT_SUBSIZE_MAX 25.0
-
-#define EXPP_MAT_HARD_MIN 1
-#define EXPP_MAT_HARD_MAX 511 /* 127 with MODE HALO ON */
-#define EXPP_MAT_HALOSEED_MIN 0
-#define EXPP_MAT_HALOSEED_MAX 255
-#define EXPP_MAT_NFLARES_MIN 1
-#define EXPP_MAT_NFLARES_MAX 32
-#define EXPP_MAT_FLARESEED_MIN 0
-#define EXPP_MAT_FLARESEED_MAX 255
-#define EXPP_MAT_NSTARS_MIN 3
-#define EXPP_MAT_NSTARS_MAX 50
-#define EXPP_MAT_NLINES_MIN 0
-#define EXPP_MAT_NLINES_MAX 250
-#define EXPP_MAT_NRINGS_MIN 0
-#define EXPP_MAT_NRINGS_MAX 24
-
-#define EXPP_MAT_RAYMIRR_MIN 0.0
-#define EXPP_MAT_RAYMIRR_MAX 1.0
-#define EXPP_MAT_MIRRDEPTH_MIN 0
-#define EXPP_MAT_MIRRDEPTH_MAX 10
-#define EXPP_MAT_FRESNELMIRR_MIN 0.0
-#define EXPP_MAT_FRESNELMIRR_MAX 5.0
-#define EXPP_MAT_FRESNELMIRRFAC_MIN 1.0
-#define EXPP_MAT_FRESNELMIRRFAC_MAX 5.0
-#define EXPP_MAT_RAYMIRRGLOSS_MIN 0.0
-#define EXPP_MAT_RAYMIRRGLOSS_MAX 1.0
-#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN 0
-#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX 1024
-#define EXPP_MAT_RAYTRANSPGLOSS_MIN 0.0
-#define EXPP_MAT_RAYTRANSPGLOSS_MAX 1.0
-#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN 0
-#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 1024
-#define EXPP_MAT_FILTER_MIN 0.0
-#define EXPP_MAT_FILTER_MAX 1.0
-#define EXPP_MAT_TRANSLUCENCY_MIN 0.0
-#define EXPP_MAT_TRANSLUCENCY_MAX 1.0
-#define EXPP_MAT_ZOFFS_MIN 0.0
-#define EXPP_MAT_ZOFFS_MAX 10.0
-#define EXPP_MAT_IOR_MIN 1.0
-#define EXPP_MAT_IOR_MAX 3.0
-#define EXPP_MAT_TRANSDEPTH_MIN 0
-#define EXPP_MAT_TRANSDEPTH_MAX 10
-#define EXPP_MAT_FRESNELTRANS_MIN 0.0
-#define EXPP_MAT_FRESNELTRANS_MAX 5.0
-#define EXPP_MAT_FRESNELTRANSFAC_MIN 1.0
-#define EXPP_MAT_FRESNELTRANSFAC_MAX 5.0
-#define EXPP_MAT_SPECTRANS_MIN 0.0
-#define EXPP_MAT_SPECTRANS_MAX 1.0
-#define EXPP_MAT_MIRRTRANSADD_MIN 0.0
-#define EXPP_MAT_MIRRTRANSADD_MAX 1.0
-#define EXPP_MAT_COLORBAND_FACTOR_MIN 0.0
-#define EXPP_MAT_COLORBAND_FACTOR_MAX 1.0
-
-/* closure values for getColorComponent()/setColorComponent() */
-
-#define EXPP_MAT_COMP_R 0
-#define EXPP_MAT_COMP_G 1
-#define EXPP_MAT_COMP_B 2
-#define EXPP_MAT_COMP_SPECR 3
-#define EXPP_MAT_COMP_SPECG 4
-#define EXPP_MAT_COMP_SPECB 5
-#define EXPP_MAT_COMP_MIRR 6
-#define EXPP_MAT_COMP_MIRG 7
-#define EXPP_MAT_COMP_MIRB 8
-#define EXPP_MAT_COMP_SSSR 9
-#define EXPP_MAT_COMP_SSSG 10
-#define EXPP_MAT_COMP_SSSB 11
-
-
-#define IPOKEY_RGB 0
-#define IPOKEY_ALPHA 1
-#define IPOKEY_HALOSIZE 2
-#define IPOKEY_MODE 3
-#define IPOKEY_ALLCOLOR 10
-#define IPOKEY_ALLMIRROR 14
-#define IPOKEY_OFS 12
-#define IPOKEY_SIZE 13
-#define IPOKEY_ALLMAPPING 11
-
-/* SSS Settings */
-#define EXPP_MAT_SSS_SCALE_MIN 0.001
-#define EXPP_MAT_SSS_SCALE_MAX 1000.0
-#define EXPP_MAT_SSS_RADIUS_MIN 0.0
-#define EXPP_MAT_SSS_RADIUS_MAX 10000.0
-#define EXPP_MAT_SSS_IOR_MIN 0.1
-#define EXPP_MAT_SSS_IOR_MAX 2.0
-#define EXPP_MAT_SSS_ERROR_MIN 0.0
-#define EXPP_MAT_SSS_ERROR_MAX 1.0
-#define EXPP_MAT_SSS_FRONT_MIN 0.0
-#define EXPP_MAT_SSS_FRONT_MAX 2.0
-#define EXPP_MAT_SSS_BACK_MIN 0.0
-#define EXPP_MAT_SSS_BACK_MAX 10.0
-
-
-/*****************************************************************************/
-/* Python API function prototypes for the Material module. */
-/*****************************************************************************/
-static PyObject *M_Material_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_Material_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. In */
-/* Python these will be written to the console when doing a */
-/* Blender.Material.__doc__ */
-/*****************************************************************************/
-static char M_Material_doc[] = "The Blender Material module";
-
-static char M_Material_New_doc[] =
- "(name) - return a new material called 'name'\n\
-() - return a new material called 'Mat'";
-
-static char M_Material_Get_doc[] =
- "(name) - return the material called 'name', None if not found.\n\
-() - return a list of all materials in the current scene.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Material module: */
-/*****************************************************************************/
-struct PyMethodDef M_Material_methods[] = {
- {"New", ( PyCFunction ) M_Material_New, METH_VARARGS | METH_KEYWORDS,
- M_Material_New_doc},
- {"Get", M_Material_Get, METH_VARARGS, M_Material_Get_doc},
- {"get", M_Material_Get, METH_VARARGS, M_Material_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Function: M_Material_New */
-/* Python equivalent: Blender.Material.New */
-/*****************************************************************************/
-static PyObject *M_Material_New( PyObject * self, PyObject * args,
- PyObject * keywords )
-{
- char *name = "Mat";
- static char *kwlist[] = { "name", NULL };
- BPy_Material *pymat; /* for Material Data object wrapper in Python */
- Material *blmat; /* for actual Material Data we create in Blender */
- char buf[21];
-
- if( !PyArg_ParseTupleAndKeywords
- ( args, keywords, "|s", kwlist, &name ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected string or nothing as argument" ) );
-
- if( strcmp( name, "Mat" ) != 0 ) /* use gave us a name ? */
- PyOS_snprintf( buf, sizeof( buf ), "%s", name );
-
- blmat = add_material( name ); /* first create the Material Data in Blender */
-
- if( blmat ) /* now create the wrapper obj in Python */
- pymat = ( BPy_Material * ) Material_CreatePyObject( blmat );
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Material Data in Blender" ) );
-
- blmat->id.us = 0; /* was incref'ed by add_material() above */
-
- if( pymat == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Material Data object" ) );
-
- return ( PyObject * ) pymat;
-}
-
-/*****************************************************************************/
-/* Function: M_Material_Get */
-/* Python equivalent: Blender.Material.Get */
-/* Description: Receives a string and returns the material whose */
-/* name matches the string. If no argument is */
-/* passed in, a list with all materials in the */
-/* current scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Material_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Material *mat_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- if( name ) { /* (name) - Search material by name */
-
- mat_iter = ( Material * ) GetIdFromList( &( G.main->mat ), name );
-
- if( mat_iter == NULL ) { /* Requested material doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Material \"%s\" not found", name );
- return EXPP_ReturnPyObjError( PyExc_NameError,
- error_msg );
- }
-
- return Material_CreatePyObject( mat_iter );
- }
-
- else { /* () - return a list with all materials in the scene */
- int index = 0;
- PyObject *matlist, *pyobj;
-
- matlist = PyList_New( BLI_countlist( &( G.main->mat ) ) );
-
- if( !matlist )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- mat_iter = G.main->mat.first;
- while( mat_iter ) {
- pyobj = Material_CreatePyObject( mat_iter );
-
- if( !pyobj ) {
- Py_DECREF(matlist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create PyObject" ) );
- }
- PyList_SET_ITEM( matlist, index, pyobj );
-
- mat_iter = mat_iter->id.next;
- index++;
- }
-
- return matlist;
- }
-}
-
-static PyObject *Material_ModesDict( void )
-{
- PyObject *Modes = PyConstant_New( );
-
- if( Modes ) {
- BPy_constant *c = ( BPy_constant * ) Modes;
-
- PyConstant_Insert(c, "TRACEABLE", PyInt_FromLong(MA_TRACEBLE));
- PyConstant_Insert(c, "SHADOW", PyInt_FromLong(MA_SHADOW));
- PyConstant_Insert(c, "SHADOWBUF", PyInt_FromLong(MA_SHADBUF));
- PyConstant_Insert(c, "TANGENTSTR", PyInt_FromLong(MA_TANGENT_STR));
- PyConstant_Insert(c, "FULLOSA", PyInt_FromLong(MA_FULL_OSA));
- PyConstant_Insert(c, "RAYBIAS", PyInt_FromLong(MA_RAYBIAS));
- PyConstant_Insert(c, "TRANSPSHADOW", PyInt_FromLong(MA_SHADOW_TRA));
- PyConstant_Insert(c, "RAMPCOL", PyInt_FromLong(MA_RAMP_COL));
- PyConstant_Insert(c, "RAMPSPEC", PyInt_FromLong(MA_RAMP_SPEC));
- PyConstant_Insert(c, "SHADELESS", PyInt_FromLong(MA_SHLESS));
- PyConstant_Insert(c, "WIRE", PyInt_FromLong(MA_WIRE));
- PyConstant_Insert(c, "VCOL_LIGHT", PyInt_FromLong(MA_VERTEXCOL));
- PyConstant_Insert(c, "HALO", PyInt_FromLong(MA_HALO));
- PyConstant_Insert(c, "ZTRANSP", PyInt_FromLong(MA_ZTRA));
- PyConstant_Insert(c, "VCOL_PAINT", PyInt_FromLong(MA_VERTEXCOLP));
- PyConstant_Insert(c, "ZINVERT", PyInt_FromLong(MA_ZINV));
- PyConstant_Insert(c, "HALORINGS", PyInt_FromLong(MA_HALO_RINGS));
- PyConstant_Insert(c, "ENV", PyInt_FromLong(MA_ENV));
- PyConstant_Insert(c, "HALOLINES", PyInt_FromLong(MA_HALO_LINES));
- PyConstant_Insert(c, "ONLYSHADOW", PyInt_FromLong(MA_ONLYSHADOW));
- PyConstant_Insert(c, "HALOXALPHA", PyInt_FromLong(MA_HALO_XALPHA));
- PyConstant_Insert(c, "HALOSTAR", PyInt_FromLong(MA_STAR));
- PyConstant_Insert(c, "TEXFACE", PyInt_FromLong(MA_FACETEXTURE));
- PyConstant_Insert(c, "HALOTEX", PyInt_FromLong(MA_HALOTEX));
- PyConstant_Insert(c, "HALOPUNO", PyInt_FromLong(MA_HALOPUNO));
- PyConstant_Insert(c, "NOMIST", PyInt_FromLong(MA_NOMIST));
- PyConstant_Insert(c, "HALOSHADE", PyInt_FromLong(MA_HALO_SHADE));
- PyConstant_Insert(c, "HALOFLARE", PyInt_FromLong(MA_HALO_FLARE));
- PyConstant_Insert(c, "RADIO", PyInt_FromLong(MA_RADIO));
- PyConstant_Insert(c, "RAYMIRROR", PyInt_FromLong(MA_RAYMIRROR));
- PyConstant_Insert(c, "ZTRA", PyInt_FromLong(MA_ZTRA));
- PyConstant_Insert(c, "RAYTRANSP", PyInt_FromLong(MA_RAYTRANSP));
- PyConstant_Insert(c, "TANGENT_V", PyInt_FromLong(MA_TANGENT_V));
- PyConstant_Insert(c, "NMAP_TS", PyInt_FromLong(MA_NORMAP_TANG));
- PyConstant_Insert(c, "GROUP_EXCLUSIVE", PyInt_FromLong(MA_GROUP_NOLAY));
- PyConstant_Insert(c, "TEXFACE_ALPHA", PyInt_FromLong(MA_FACETEXTURE_ALPHA));
-
- }
-
- return Modes;
-}
-
-
-static PyObject *Material_ShadersDict( void )
-{
- PyObject *Shaders = PyConstant_New( );
-
- if( Shaders ) {
- BPy_constant *c = ( BPy_constant * ) Shaders;
-
- PyConstant_Insert(c, "DIFFUSE_LAMBERT", PyInt_FromLong(MA_DIFF_LAMBERT));
- PyConstant_Insert(c, "DIFFUSE_ORENNAYAR", PyInt_FromLong(MA_DIFF_ORENNAYAR));
- PyConstant_Insert(c, "DIFFUSE_TOON", PyInt_FromLong(MA_DIFF_TOON));
- PyConstant_Insert(c, "DIFFUSE_MINNAERT", PyInt_FromLong(MA_DIFF_MINNAERT));
- PyConstant_Insert(c, "SPEC_COOKTORR", PyInt_FromLong(MA_SPEC_COOKTORR));
- PyConstant_Insert(c, "SPEC_PHONG", PyInt_FromLong(MA_SPEC_PHONG));
- PyConstant_Insert(c, "SPEC_BLINN", PyInt_FromLong(MA_SPEC_BLINN));
- PyConstant_Insert(c, "SPEC_TOON", PyInt_FromLong(MA_SPEC_TOON));
- PyConstant_Insert(c, "SPEC_WARDISO", PyInt_FromLong(MA_SPEC_WARDISO));
-
- }
-
- return Shaders;
-}
-
-static PyObject *Material_ColorRampMethodsDict( void )
-{
- PyObject *Methods = PyConstant_New( );
- if( Methods ) {
- BPy_constant *c = (BPy_constant * ) Methods;
-
- PyConstant_Insert(c, "BLEND", PyInt_FromLong(MA_RAMP_BLEND));
- PyConstant_Insert(c, "MIX", PyInt_FromLong(MA_RAMP_BLEND)); /* This one is added to solve confusion between Blend-Mix name. */
- PyConstant_Insert(c, "ADD", PyInt_FromLong(MA_RAMP_ADD));
- PyConstant_Insert(c, "MULT", PyInt_FromLong(MA_RAMP_MULT));
- PyConstant_Insert(c, "SUB", PyInt_FromLong(MA_RAMP_SUB));
- PyConstant_Insert(c, "SCREEN", PyInt_FromLong(MA_RAMP_SCREEN));
- PyConstant_Insert(c, "DIV", PyInt_FromLong(MA_RAMP_DIV));
- PyConstant_Insert(c, "DIFF", PyInt_FromLong(MA_RAMP_DIFF));
- PyConstant_Insert(c, "DARK", PyInt_FromLong(MA_RAMP_DARK));
- PyConstant_Insert(c, "LIGHT", PyInt_FromLong(MA_RAMP_LIGHT));
- PyConstant_Insert(c, "OVERLAY", PyInt_FromLong(MA_RAMP_OVERLAY));
- PyConstant_Insert(c, "DODGE", PyInt_FromLong(MA_RAMP_DODGE));
- PyConstant_Insert(c, "BURN", PyInt_FromLong(MA_RAMP_BURN));
- PyConstant_Insert(c, "HUE", PyInt_FromLong(MA_RAMP_HUE));
- PyConstant_Insert(c, "SAT", PyInt_FromLong(MA_RAMP_SAT));
- PyConstant_Insert(c, "VAL", PyInt_FromLong(MA_RAMP_VAL));
- PyConstant_Insert(c, "COLOR", PyInt_FromLong(MA_RAMP_COLOR));
-
- }
- return Methods;
-}
-
-static PyObject *Material_ColorRampInputDict( void )
-{
- PyObject *Inputs = PyConstant_New( );
- if( Inputs ) {
- BPy_constant *c = (BPy_constant * ) Inputs;
-
- PyConstant_Insert(c, "SHADER", PyInt_FromLong(MA_RAMP_IN_SHADER));
- PyConstant_Insert(c, "ENERGY", PyInt_FromLong(MA_RAMP_IN_ENERGY));
- PyConstant_Insert(c, "NORMAL", PyInt_FromLong(MA_RAMP_IN_NOR));
- PyConstant_Insert(c, "RESULT", PyInt_FromLong(MA_RAMP_IN_RESULT));
- }
- return Inputs;
-}
-
-/*****************************************************************************/
-/* Function: Material_Init */
-/*****************************************************************************/
-PyObject *Material_Init( void )
-{
- PyObject *submodule, *Modes, *Shaders, *ColorbandInput, *ColorbandMethod;
-
- if( PyType_Ready( &Material_Type ) < 0)
- return NULL;
-
- Modes = Material_ModesDict( );
- Shaders = Material_ShadersDict( );
- ColorbandMethod = Material_ColorRampMethodsDict( );
- ColorbandInput = Material_ColorRampInputDict( );
-
- submodule = Py_InitModule3( "Blender.Material",
- M_Material_methods, M_Material_doc );
-
- if( Modes )
- PyModule_AddObject( submodule, "Modes", Modes );
- if( Shaders )
- PyModule_AddObject( submodule, "Shaders", Shaders );
- if( ColorbandMethod )
- PyModule_AddObject( submodule, "ColorbandMethod", ColorbandMethod );
- if( ColorbandInput )
- PyModule_AddObject( submodule, "ColorbandInput", ColorbandInput );
-
- PyModule_AddIntConstant( submodule, "RGB", IPOKEY_RGB );
- PyModule_AddIntConstant( submodule, "ALPHA", IPOKEY_ALPHA );
- PyModule_AddIntConstant( submodule, "HALOSIZE", IPOKEY_HALOSIZE );
- PyModule_AddIntConstant( submodule, "MODE", IPOKEY_MODE );
- PyModule_AddIntConstant( submodule, "ALLCOLOR", IPOKEY_ALLCOLOR );
- PyModule_AddIntConstant( submodule, "ALLMIRROR", IPOKEY_ALLMIRROR );
- PyModule_AddIntConstant( submodule, "OFS", IPOKEY_OFS );
- PyModule_AddIntConstant( submodule, "SIZE", IPOKEY_SIZE );
- PyModule_AddIntConstant( submodule, "ALLMAPPING", IPOKEY_ALLMAPPING );
-
- return ( submodule );
-}
-
-/***************************/
-/*** The Material PyType ***/
-/***************************/
-
-static PyObject *Matr_oldsetAdd( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetAlpha( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetAmb( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetEmit( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFilter( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFlareBoost( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFlareSeed( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFlareSize( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFresnelMirr( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFresnelMirrFac( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFresnelTrans( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetFresnelTransFac( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetHaloSeed( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetHaloSize( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetHardness( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetIOR( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetNFlares( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetNLines( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetNRings( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetNStars( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRayMirr( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetMirrDepth( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRef( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpec( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpecTransp( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSubSize( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetTransDepth( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetZOffset( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetIpo( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRGBCol( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpecCol( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpecShader( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetMirCol( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetDiffuseShader( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRoughness( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpecSize( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetDiffuseSize( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetSpecSmooth( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetDiffuseSmooth( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetDiffuseDarkness( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRefracIndex( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetRms( BPy_Material * self, PyObject * args );
-static PyObject *Matr_oldsetTranslucency( BPy_Material * self, PyObject * args );
-
-static int Material_setIpo( BPy_Material * self, PyObject * value );
-
-static int Material_setMode( BPy_Material * self, PyObject * value );
-static int Material_setRGBCol( BPy_Material * self, PyObject * value );
-static int Material_setSpecCol( BPy_Material * self, PyObject * value );
-static int Material_setMirCol( BPy_Material * self, PyObject * value );
-static int Material_setSssCol( BPy_Material * self, PyObject * value );
-static int Material_setColorComponent( BPy_Material * self, PyObject * value,
- void * closure );
-static int Material_setAmb( BPy_Material * self, PyObject * value );
-static int Material_setEmit( BPy_Material * self, PyObject * value );
-static int Material_setSpecTransp( BPy_Material * self, PyObject * value );
-static int Material_setAlpha( BPy_Material * self, PyObject * value );
-static int Material_setShadAlpha( BPy_Material * self, PyObject * value );
-static int Material_setRef( BPy_Material * self, PyObject * value );
-static int Material_setSpec( BPy_Material * self, PyObject * value );
-static int Material_setZOffset( BPy_Material * self, PyObject * value );
-static int Material_setLightGroup( BPy_Material * self, PyObject * value );
-static int Material_setAdd( BPy_Material * self, PyObject * value );
-static int Material_setHaloSize( BPy_Material * self, PyObject * value );
-static int Material_setFlareSize( BPy_Material * self, PyObject * value );
-static int Material_setFlareBoost( BPy_Material * self, PyObject * value );
-static int Material_setSubSize( BPy_Material * self, PyObject * value );
-static int Material_setHaloSeed( BPy_Material * self, PyObject * value );
-static int Material_setFlareSeed( BPy_Material * self, PyObject * value );
-static int Material_setHardness( BPy_Material * self, PyObject * value );
-static int Material_setNFlares( BPy_Material * self, PyObject * value );
-static int Material_setNStars( BPy_Material * self, PyObject * value );
-static int Material_setNLines( BPy_Material * self, PyObject * value );
-static int Material_setNRings( BPy_Material * self, PyObject * value );
-static int Material_setRayMirr( BPy_Material * self, PyObject * value );
-static int Material_setMirrDepth( BPy_Material * self, PyObject * value );
-static int Material_setFresnelMirr( BPy_Material * self, PyObject * value );
-static int Material_setFresnelMirrFac( BPy_Material * self, PyObject * value );
-static int Material_setIOR( BPy_Material * self, PyObject * value );
-static int Material_setTransDepth( BPy_Material * self, PyObject * value );
-static int Material_setFresnelTrans( BPy_Material * self, PyObject * value );
-static int Material_setFresnelTransFac( BPy_Material * self, PyObject * value );
-static int Material_setGlossMirr( BPy_Material * self, PyObject * value );
-static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value );
-static int Material_setGlossTrans( BPy_Material * self, PyObject * value );
-static int Material_setGlossTransSamples( BPy_Material * self, PyObject * value );
-static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value );
-static int Material_setRigidBodyRestitution( BPy_Material * self, PyObject * value );
-
-static int Material_setSpecShader( BPy_Material * self, PyObject * value );
-static int Material_setDiffuseShader( BPy_Material * self, PyObject * value );
-static int Material_setRoughness( BPy_Material * self, PyObject * value );
-static int Material_setSpecSize( BPy_Material * self, PyObject * value );
-static int Material_setDiffuseSize( BPy_Material * self, PyObject * value );
-static int Material_setSpecSmooth( BPy_Material * self, PyObject * value );
-static int Material_setDiffuseSmooth( BPy_Material * self, PyObject * value );
-static int Material_setDiffuseDarkness( BPy_Material * self, PyObject * value );
-static int Material_setRefracIndex( BPy_Material * self, PyObject * value );
-static int Material_setRms( BPy_Material * self, PyObject * value );
-static int Material_setFilter( BPy_Material * self, PyObject * value );
-static int Material_setTranslucency( BPy_Material * self, PyObject * value );
-
-static int Material_setSssEnable( BPy_Material * self, PyObject * value );
-static int Material_setSssScale( BPy_Material * self, PyObject * value );
-static int Material_setSssRadius( BPy_Material * self, PyObject * value, void * type );
-static int Material_setSssIOR( BPy_Material * self, PyObject * value );
-static int Material_setSssError( BPy_Material * self, PyObject * value );
-static int Material_setSssColorBlend( BPy_Material * self, PyObject * value );
-static int Material_setSssTexScatter( BPy_Material * self, PyObject * value );
-static int Material_setSssFront( BPy_Material * self, PyObject * value );
-static int Material_setSssBack( BPy_Material * self, PyObject * value );
-static int Material_setSssBack( BPy_Material * self, PyObject * value );
-static int Material_setTexChannel( BPy_Material * self, PyObject * value );
-static int Material_setTextures( BPy_Material * self, PyObject * value );
-
-static PyObject *Material_getColorComponent( BPy_Material * self,
- void * closure );
-
-/*static int Material_setSeptex( BPy_Material * self, PyObject * value );
- static PyObject *Material_getSeptex( BPy_Material * self );*/
-
-/*****************************************************************************/
-/* Python BPy_Material methods declarations: */
-/*****************************************************************************/
-static PyObject *Material_getIpo( BPy_Material * self );
-static PyObject *Material_getMode( BPy_Material * self );
-static PyObject *Material_getRGBCol( BPy_Material * self );
-/*static PyObject *Material_getAmbCol(BPy_Material *self);*/
-static PyObject *Material_getSpecCol( BPy_Material * self );
-static PyObject *Material_getMirCol( BPy_Material * self );
-static PyObject *Material_getSssCol( BPy_Material * self );
-static PyObject *Material_getAmb( BPy_Material * self );
-static PyObject *Material_getEmit( BPy_Material * self );
-static PyObject *Material_getAlpha( BPy_Material * self );
-static PyObject *Material_getShadAlpha( BPy_Material * self );
-static PyObject *Material_getRef( BPy_Material * self );
-static PyObject *Material_getSpec( BPy_Material * self );
-static PyObject *Material_getSpecTransp( BPy_Material * self );
-static PyObject *Material_getAdd( BPy_Material * self );
-static PyObject *Material_getZOffset( BPy_Material * self );
-static PyObject *Material_getLightGroup( BPy_Material * self );
-static PyObject *Material_getHaloSize( BPy_Material * self );
-static PyObject *Material_getHaloSeed( BPy_Material * self );
-static PyObject *Material_getFlareSize( BPy_Material * self );
-static PyObject *Material_getFlareSeed( BPy_Material * self );
-static PyObject *Material_getFlareBoost( BPy_Material * self );
-static PyObject *Material_getSubSize( BPy_Material * self );
-static PyObject *Material_getHardness( BPy_Material * self );
-static PyObject *Material_getNFlares( BPy_Material * self );
-static PyObject *Material_getNStars( BPy_Material * self );
-static PyObject *Material_getNLines( BPy_Material * self );
-static PyObject *Material_getNRings( BPy_Material * self );
-/* Shader settings */
-static PyObject *Material_getSpecShader( BPy_Material * self );
-static PyObject *Material_getDiffuseShader( BPy_Material * self );
-static PyObject *Material_getRoughness( BPy_Material * self );
-static PyObject *Material_getSpecSize( BPy_Material * self );
-static PyObject *Material_getDiffuseSize( BPy_Material * self );
-static PyObject *Material_getSpecSmooth( BPy_Material * self );
-static PyObject *Material_getDiffuseSmooth( BPy_Material * self );
-static PyObject *Material_getDiffuseDarkness( BPy_Material * self );
-static PyObject *Material_getRefracIndex( BPy_Material * self );
-static PyObject *Material_getRms( BPy_Material * self );
-
-static PyObject *Material_getRayMirr( BPy_Material * self );
-static PyObject *Material_getMirrDepth( BPy_Material * self );
-static PyObject *Material_getFresnelMirr( BPy_Material * self );
-static PyObject *Material_getFresnelMirrFac( BPy_Material * self );
-static PyObject *Material_getIOR( BPy_Material * self );
-static PyObject *Material_getTransDepth( BPy_Material * self );
-static PyObject *Material_getFresnelTrans( BPy_Material * self );
-static PyObject *Material_getFresnelTransFac( BPy_Material * self );
-static PyObject *Material_getGlossMirr( BPy_Material * self );
-static PyObject *Material_getGlossMirrSamples( BPy_Material * self );
-static PyObject *Material_getGlossTrans( BPy_Material * self );
-static PyObject *Material_getGlossTransSamples( BPy_Material * self );
-static PyObject *Material_getRigidBodyFriction( BPy_Material * self );
-static PyObject *Material_getRigidBodyRestitution( BPy_Material * self );
-
-static PyObject *Material_getSssEnable( BPy_Material * self );
-static PyObject *Material_getSssScale( BPy_Material * self );
-static PyObject *Material_getSssRadius( BPy_Material * self, void * type );
-static PyObject *Material_getSssIOR( BPy_Material * self );
-static PyObject *Material_getSssError( BPy_Material * self );
-static PyObject *Material_getSssColorBlend( BPy_Material * self );
-static PyObject *Material_getSssTexScatter( BPy_Material * self );
-static PyObject *Material_getSssFront( BPy_Material * self );
-static PyObject *Material_getSssBack( BPy_Material * self );
-static PyObject *Material_getSssBack( BPy_Material * self );
-
-static PyObject *Material_getFilter( BPy_Material * self );
-static PyObject *Material_getTranslucency( BPy_Material * self );
-static PyObject *Material_getTextures( BPy_Material * self );
-static PyObject *Material_getTexChannel( BPy_Material * self );
-static PyObject *Material_clearIpo( BPy_Material * self );
-
-static PyObject *Material_setTexture( BPy_Material * self, PyObject * args );
-static PyObject *Material_clearTexture( BPy_Material * self, PyObject * value );
-
-static PyObject *Material_getScriptLinks(BPy_Material *self, PyObject * value );
-static PyObject *Material_addScriptLink(BPy_Material * self, PyObject * args );
-static PyObject *Material_clearScriptLinks(BPy_Material *self, PyObject *args);
-
-static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args );
-static PyObject *Material_getColorband( BPy_Material * self, void * type);
-static int Material_setColorband( BPy_Material * self, PyObject * value, void * type);
-static PyObject *Material_copy( BPy_Material * self );
-static PyObject *Material_freeNodes( BPy_Material * self );
-
-static PyObject *Material_getColorbandDiffuseFactor( BPy_Material * self );
-static PyObject *Material_getColorbandSpecularFactor( BPy_Material * self );
-static int Material_setColorbandDiffuseFactor ( BPy_Material * self, PyObject * value );
-static int Material_setColorbandSpecularFactor ( BPy_Material * self, PyObject * value );
-static PyObject *Material_getColorbandDiffuseMethod( BPy_Material * self );
-static PyObject *Material_getColorbandSpecularMethod ( BPy_Material * self );
-static int Material_setColorbandDiffuseMethod ( BPy_Material * self, PyObject * value);
-static int Material_setColorbandSpecularMethod ( BPy_Material * self, PyObject * value);
-static PyObject *Material_getColorbandDiffuseInput( BPy_Material * self );
-static PyObject *Material_getColorbandSpecularInput( BPy_Material * self );
-static int Material_setColorbandDiffuseInput ( BPy_Material * self, PyObject * value);
-static int Material_setColorbandSpecularInput ( BPy_Material * self, PyObject * value);
-
-
-
-/*****************************************************************************/
-/* Python BPy_Material methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Material_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Material's name"},
- {"getIpo", ( PyCFunction ) Material_getIpo, METH_NOARGS,
- "() - Return Material's ipo or None if not found"},
- {"getMode", ( PyCFunction ) Material_getMode, METH_NOARGS,
- "() - Return Material's mode flags"},
- {"getRGBCol", ( PyCFunction ) Material_getRGBCol, METH_NOARGS,
- "() - Return Material's rgb color triplet"},
-/* {"getAmbCol", (PyCFunction)Material_getAmbCol, METH_NOARGS,
- "() - Return Material's ambient color"},*/
- {"getSpecCol", ( PyCFunction ) Material_getSpecCol, METH_NOARGS,
- "() - Return Material's specular color"},
- {"getMirCol", ( PyCFunction ) Material_getMirCol, METH_NOARGS,
- "() - Return Material's mirror color"},
- {"getAmb", ( PyCFunction ) Material_getAmb, METH_NOARGS,
- "() - Return Material's ambient color blend factor"},
- {"getEmit", ( PyCFunction ) Material_getEmit, METH_NOARGS,
- "() - Return Material's emitting light intensity"},
- {"getAlpha", ( PyCFunction ) Material_getAlpha, METH_NOARGS,
- "() - Return Material's alpha (transparency) value"},
- {"getRef", ( PyCFunction ) Material_getRef, METH_NOARGS,
- "() - Return Material's reflectivity"},
- {"getSpec", ( PyCFunction ) Material_getSpec, METH_NOARGS,
- "() - Return Material's specularity"},
- /* Shader specific settings */
- {"getSpecShader", ( PyCFunction ) Material_getSpecShader, METH_NOARGS,
- "() - Returns Material's specular shader" },
- {"getDiffuseShader", ( PyCFunction ) Material_getDiffuseShader, METH_NOARGS,
- "() - Returns Material's diffuse shader" },
- {"getRoughness", ( PyCFunction ) Material_getRoughness, METH_NOARGS,
- "() - Returns Material's Roughness (applies to the \"Oren Nayar\" Diffuse Shader only)" },
- {"getSpecSize", ( PyCFunction ) Material_getSpecSize, METH_NOARGS,
- "() - Returns Material's size of specular area (applies to the \"Toon\" Specular Shader only)" },
- {"getDiffuseSize", ( PyCFunction ) Material_getDiffuseSize, METH_NOARGS,
- "() - Returns Material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)" },
- {"getSpecSmooth", ( PyCFunction ) Material_getSpecSmooth, METH_NOARGS,
- "() - Returns Material's smoothing of specular area (applies to the \"Toon\" Diffuse Shader only)" },
- {"getDiffuseSmooth", ( PyCFunction ) Material_getDiffuseSmooth, METH_NOARGS,
- "() - Returns Material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)" },
- {"getDiffuseDarkness", ( PyCFunction ) Material_getDiffuseDarkness, METH_NOARGS,
- "() - Returns Material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)" },
- {"getRefracIndex", ( PyCFunction ) Material_getRefracIndex, METH_NOARGS,
- "() - Returns Material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)" },
- {"getRms", ( PyCFunction ) Material_getRms, METH_NOARGS,
- "() - Returns Material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)" },
- /* End shader settings */
- {"getSpecTransp", ( PyCFunction ) Material_getSpecTransp, METH_NOARGS,
- "() - Return Material's specular transparency"},
- {"getAdd", ( PyCFunction ) Material_getAdd, METH_NOARGS,
- "() - Return Material's glow factor"},
- {"getZOffset", ( PyCFunction ) Material_getZOffset, METH_NOARGS,
- "() - Return Material's artificial offset for faces"},
- {"getHaloSize", ( PyCFunction ) Material_getHaloSize, METH_NOARGS,
- "() - Return Material's halo size"},
- {"getHaloSeed", ( PyCFunction ) Material_getHaloSeed, METH_NOARGS,
- "() - Return Material's seed for random ring dimension and line "
- "location in halos"},
- {"getFlareSize", ( PyCFunction ) Material_getFlareSize, METH_NOARGS,
- "() - Return Material's (flare size)/(halo size) factor"},
- {"getFlareSeed", ( PyCFunction ) Material_getFlareSeed, METH_NOARGS,
- "() - Return Material's flare offset in the seed table"},
- {"getFlareBoost", ( PyCFunction ) Material_getFlareBoost, METH_NOARGS,
- "() - Return Material's flare boost"},
- {"getSubSize", ( PyCFunction ) Material_getSubSize, METH_NOARGS,
- "() - Return Material's dimension of subflare, dots and circles"},
- {"getHardness", ( PyCFunction ) Material_getHardness, METH_NOARGS,
- "() - Return Material's specular hardness"},
- {"getNFlares", ( PyCFunction ) Material_getNFlares, METH_NOARGS,
- "() - Return Material's number of flares in halo"},
- {"getNStars", ( PyCFunction ) Material_getNStars, METH_NOARGS,
- "() - Return Material's number of points in the halo stars"},
- {"getNLines", ( PyCFunction ) Material_getNLines, METH_NOARGS,
- "() - Return Material's number of lines in halo"},
- {"getNRings", ( PyCFunction ) Material_getNRings, METH_NOARGS,
- "() - Return Material's number of rings in halo"},
- {"getRayMirr", ( PyCFunction ) Material_getRayMirr, METH_NOARGS,
- "() - Return mount mirror"},
- {"getMirrDepth", ( PyCFunction ) Material_getMirrDepth, METH_NOARGS,
- "() - Return amount mirror depth"},
- {"getFresnelMirr", ( PyCFunction ) Material_getFresnelMirr, METH_NOARGS,
- "() - Return fresnel power for refractions"},
- {"getFresnelMirrFac", ( PyCFunction ) Material_getFresnelMirrFac, METH_NOARGS,
- "() - Return fresnel power for refractions factor"},
- {"getRayTransGloss", ( PyCFunction ) Material_getGlossTrans, METH_NOARGS,
- "() - Return amount refraction glossiness"},
- {"getRayTransGlossSamples", ( PyCFunction ) Material_getGlossTransSamples, METH_NOARGS,
- "() - Return number of sampels for transparent glossiness"},
- {"getRayMirrGlossSamples", ( PyCFunction ) Material_getGlossMirrSamples, METH_NOARGS,
- "() - Return number of sampels for mirror glossiness"},
- {"getFilter", ( PyCFunction ) Material_getFilter, METH_NOARGS,
- "() - Return the amount of filtering when transparent raytrace is enabled"},
- {"getTranslucency", ( PyCFunction ) Material_getTranslucency, METH_NOARGS,
- "() - Return the Translucency, the amount of diffuse shading of the back side"},
- {"getIOR", ( PyCFunction ) Material_getIOR, METH_NOARGS,
- "() - Return IOR"},
- {"getTransDepth", ( PyCFunction ) Material_getTransDepth, METH_NOARGS,
- "() - Return amount inter-refractions"},
- {"getFresnelTrans", ( PyCFunction ) Material_getFresnelTrans, METH_NOARGS,
- "() - Return fresnel power for refractions"},
- {"getFresnelTransFac", ( PyCFunction ) Material_getFresnelTransFac, METH_NOARGS,
- "() - Return fresnel power for refractions factor"},
-
- {"getTextures", ( PyCFunction ) Material_getTextures, METH_NOARGS,
- "() - Return Material's texture list as a tuple"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(s) - Change Material's name"},
- {"setIpo", ( PyCFunction ) Matr_oldsetIpo, METH_VARARGS,
- "(Blender Ipo) - Change Material's Ipo"},
- {"clearIpo", ( PyCFunction ) Material_clearIpo, METH_NOARGS,
- "(Blender Ipo) - Unlink Ipo from this Material"},
- {"insertIpoKey", ( PyCFunction ) Material_insertIpoKey, METH_VARARGS,
- "(Material Ipo Constant) - Insert IPO Key at current frame"},
- {"setMode", ( PyCFunction ) Matr_oldsetMode, METH_VARARGS,
- "([s[,s]]) - Set Material's mode flag(s)"},
- {"setRGBCol", ( PyCFunction ) Matr_oldsetRGBCol, METH_VARARGS,
- "(f,f,f or [f,f,f]) - Set Material's rgb color triplet"},
-/* {"setAmbCol", (PyCFunction)Matr_oldsetAmbCol, METH_VARARGS,
- "(f,f,f or [f,f,f]) - Set Material's ambient color"},*/
- {"setSpecCol", ( PyCFunction ) Matr_oldsetSpecCol, METH_VARARGS,
- "(f,f,f or [f,f,f]) - Set Material's specular color"},
-
- /* Shader spesific settings */
- {"setSpecShader", ( PyCFunction ) Matr_oldsetSpecShader, METH_VARARGS,
- "(i) - Set the Material's specular shader" },
- {"setDiffuseShader", ( PyCFunction ) Matr_oldsetDiffuseShader, METH_VARARGS,
- "(i) - Set the Material's diffuse shader" },
- {"setRoughness", ( PyCFunction ) Matr_oldsetRoughness, METH_VARARGS,
- "(f) - Set the Material's Roughness (applies to the \"Oren Nayar\" Diffuse Shader only)" },
- {"setSpecSize", ( PyCFunction ) Matr_oldsetSpecSize, METH_VARARGS,
- "(f) - Set the Material's size of specular area (applies to the \"Toon\" Specular Shader only)" },
- {"setDiffuseSize", ( PyCFunction ) Matr_oldsetDiffuseSize, METH_VARARGS,
- "(f) - Set the Material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)" },
- {"setSpecSmooth", ( PyCFunction ) Matr_oldsetSpecSmooth, METH_VARARGS,
- "(f) - Set the Material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)" },
- {"setDiffuseSmooth", ( PyCFunction ) Matr_oldsetDiffuseSmooth, METH_VARARGS,
- "(f) - Set the Material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)" },
- {"setDiffuseDarkness", ( PyCFunction ) Matr_oldsetDiffuseDarkness, METH_VARARGS,
- "(f) - Set the Material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)" },
- {"setRefracIndex", ( PyCFunction ) Matr_oldsetRefracIndex, METH_VARARGS,
- "(f) - Set the Material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)" },
- {"setRms", ( PyCFunction ) Matr_oldsetRms, METH_VARARGS,
- "(f) - Set the Material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)" },
- /* End shader settings */
-
- {"setMirCol", ( PyCFunction ) Matr_oldsetMirCol, METH_VARARGS,
- "(f,f,f or [f,f,f]) - Set Material's mirror color"},
- {"setAmb", ( PyCFunction ) Matr_oldsetAmb, METH_VARARGS,
- "(f) - Set how much the Material's color is affected"
- " by \nthe global ambient colors - [0.0, 1.0]"},
- {"setEmit", ( PyCFunction ) Matr_oldsetEmit, METH_VARARGS,
- "(f) - Set Material's emitting light intensity - [0.0, 1.0]"},
- {"setAlpha", ( PyCFunction ) Matr_oldsetAlpha, METH_VARARGS,
- "(f) - Set Material's alpha (transparency) - [0.0, 1.0]"},
- {"setRef", ( PyCFunction ) Matr_oldsetRef, METH_VARARGS,
- "(f) - Set Material's reflectivity - [0.0, 1.0]"},
- {"setSpec", ( PyCFunction ) Matr_oldsetSpec, METH_VARARGS,
- "(f) - Set Material's specularity - [0.0, 2.0]"},
- {"setSpecTransp", ( PyCFunction ) Matr_oldsetSpecTransp, METH_VARARGS,
- "(f) - Set Material's specular transparency - [0.0, 1.0]"},
- {"setAdd", ( PyCFunction ) Matr_oldsetAdd, METH_VARARGS,
- "(f) - Set Material's glow factor - [0.0, 1.0]"},
- {"setZOffset", ( PyCFunction ) Matr_oldsetZOffset, METH_VARARGS,
- "(f) - Set Material's artificial offset - [0.0, 10.0]"},
- {"setHaloSize", ( PyCFunction ) Matr_oldsetHaloSize, METH_VARARGS,
- "(f) - Set Material's halo size - [0.0, 100.0]"},
- {"setHaloSeed", ( PyCFunction ) Matr_oldsetHaloSeed, METH_VARARGS,
- "(i) - Set Material's halo seed - [0, 255]"},
- {"setFlareSize", ( PyCFunction ) Matr_oldsetFlareSize, METH_VARARGS,
- "(f) - Set Material's factor: (flare size)/(halo size) - [0.1, 25.0]"},
- {"setFlareSeed", ( PyCFunction ) Matr_oldsetFlareSeed, METH_VARARGS,
- "(i) - Set Material's flare seed - [0, 255]"},
- {"setFlareBoost", ( PyCFunction ) Matr_oldsetFlareBoost, METH_VARARGS,
- "(f) - Set Material's flare boost - [0.1, 10.0]"},
- {"setSubSize", ( PyCFunction ) Matr_oldsetSubSize, METH_VARARGS,
- "(f) - Set Material's dimension of subflare,"
- " dots and circles - [0.1, 25.0]"},
- {"setHardness", ( PyCFunction ) Matr_oldsetHardness, METH_VARARGS,
- "(i) - Set Material's hardness - [1, 255 (127 if halo mode is ON)]"},
- {"setNFlares", ( PyCFunction ) Matr_oldsetNFlares, METH_VARARGS,
- "(i) - Set Material's number of flares in halo - [1, 32]"},
- {"setNStars", ( PyCFunction ) Matr_oldsetNStars, METH_VARARGS,
- "(i) - Set Material's number of stars in halo - [3, 50]"},
- {"setNLines", ( PyCFunction ) Matr_oldsetNLines, METH_VARARGS,
- "(i) - Set Material's number of lines in halo - [0, 250]"},
- {"setNRings", ( PyCFunction ) Matr_oldsetNRings, METH_VARARGS,
- "(i) - Set Material's number of rings in halo - [0, 24]"},
- {"setRayMirr", ( PyCFunction ) Matr_oldsetRayMirr, METH_VARARGS,
- "(f) - Set amount mirror - [0.0, 1.0]"},
- {"setMirrDepth", ( PyCFunction ) Matr_oldsetMirrDepth, METH_VARARGS,
- "(i) - Set amount inter-reflections - [0, 10]"},
- {"setFresnelMirr", ( PyCFunction ) Matr_oldsetFresnelMirr, METH_VARARGS,
- "(f) - Set fresnel power for mirror - [0.0, 5.0]"},
- {"setFresnelMirrFac", ( PyCFunction ) Matr_oldsetFresnelMirrFac, METH_VARARGS,
- "(f) - Set blend fac for mirror fresnel - [1.0, 5.0]"},
- {"setRayTransGloss", ( PyCFunction ) Material_setGlossTrans, METH_VARARGS,
- "(f) - Set amount refraction glossiness - [0.0, 1.0]"},
- {"setRayTransGlossSamples", ( PyCFunction ) Material_setGlossTransSamples, METH_VARARGS,
- "(i) - Set number transparent gloss samples - [1, 1024]"},
- {"setRayMirrGlossSamples", ( PyCFunction ) Material_setGlossMirrSamples, METH_VARARGS,
- "(i) - Set number mirror gloss samples - [1, 1024]"},
- {"setFilter", ( PyCFunction ) Matr_oldsetFilter, METH_VARARGS,
- "(f) - Set the amount of filtering when transparent raytrace is enabled"},
- {"setTranslucency", ( PyCFunction ) Matr_oldsetTranslucency, METH_VARARGS,
- "(f) - Set the Translucency, the amount of diffuse shading of the back side"},
- {"setIOR", ( PyCFunction ) Matr_oldsetIOR, METH_VARARGS,
- "(f) - Set IOR - [1.0, 3.0]"},
- {"setTransDepth", ( PyCFunction ) Matr_oldsetTransDepth, METH_VARARGS,
- "(i) - Set amount inter-refractions - [0, 10]"},
- {"setFresnelTrans", ( PyCFunction ) Matr_oldsetFresnelTrans, METH_VARARGS,
- "(f) - Set fresnel power for refractions - [0.0, 5.0]"},
- {"setFresnelTransFac", ( PyCFunction ) Matr_oldsetFresnelTransFac, METH_VARARGS,
- "(f) - Set fresnel power for refractions factor- [0.0, 5.0]"},
- {"setTexture", ( PyCFunction ) Material_setTexture, METH_VARARGS,
- "(n,tex,texco=0,mapto=0) - Set numbered texture to tex"},
- {"clearTexture", ( PyCFunction ) Material_clearTexture, METH_O,
- "(n) - Remove texture from numbered slot"},
- {"getScriptLinks", ( PyCFunction ) Material_getScriptLinks, METH_O,
- "(eventname) - Get a list of this material's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) Material_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new material scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) Material_clearScriptLinks, METH_VARARGS,
- "() - Delete all scriptlinks from this material.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this material."},
- {"__copy__", ( PyCFunction ) Material_copy, METH_NOARGS,
- "() - Return a copy of the material."},
- {"copy", ( PyCFunction ) Material_copy, METH_NOARGS,
- "() - Return a copy of the material."},
- {"freeNodes", ( PyCFunction ) Material_freeNodes, METH_NOARGS,
- "() - Free this materials nodes."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-
-static PyGetSetDef BPy_Material_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"add",
- (getter)Material_getAdd, (setter)Material_setAdd,
- "Strength of the add effect",
- NULL},
- {"alpha",
- (getter)Material_getAlpha, (setter)Material_setAlpha,
- "Alpha setting ",
- NULL},
- {"shadAlpha",
- (getter)Material_getShadAlpha, (setter)Material_setShadAlpha,
- "Shadow Alpha setting",
- NULL},
- {"amb",
- (getter)Material_getAmb, (setter)Material_setAmb,
- "Amount of global ambient color material receives",
- NULL},
- {"diffuseDarkness",
- (getter)Material_getDiffuseDarkness, (setter)Material_setDiffuseDarkness,
- "Material's diffuse darkness (\"Minnaert\" diffuse shader only)",
- NULL},
- {"diffuseShader",
- (getter)Material_getDiffuseShader, (setter)Material_setDiffuseShader,
- "Diffuse shader type",
- NULL},
- {"diffuseSize",
- (getter)Material_getDiffuseSize, (setter)Material_setDiffuseSize,
- "Material's diffuse area size (\"Toon\" diffuse shader only)",
- NULL},
- {"diffuseSmooth",
- (getter)Material_getDiffuseSmooth, (setter)Material_setDiffuseSmooth,
- "Material's diffuse area smoothing (\"Toon\" diffuse shader only)",
- NULL},
- {"emit",
- (getter)Material_getEmit, (setter)Material_setEmit,
- "Amount of light the material emits",
- NULL},
- {"filter",
- (getter)Material_getFilter, (setter)Material_setFilter,
- "Amount of filtering when transparent raytrace is enabled",
- NULL},
- {"flareBoost",
- (getter)Material_getFlareBoost, (setter)Material_setFlareBoost,
- "Flare's extra strength",
- NULL},
- {"flareSeed",
- (getter)Material_getFlareSeed, (setter)Material_setFlareSeed,
- "Offset in the flare seed table",
- NULL},
- {"flareSize",
- (getter)Material_getFlareSize, (setter)Material_setFlareSize,
- "Ratio of flare size to halo size",
- NULL},
- {"fresnelDepth",
- (getter)Material_getFresnelMirr, (setter)Material_setFresnelMirr,
- "Power of Fresnel for mirror reflection",
- NULL},
- {"fresnelDepthFac",
- (getter)Material_getFresnelMirrFac, (setter)Material_setFresnelMirrFac,
- "Blending factor for Fresnel mirror",
- NULL},
- {"fresnelTrans",
- (getter)Material_getFresnelTrans, (setter)Material_setFresnelTrans,
- "Power of Fresnel for transparency",
- NULL},
- {"fresnelTransFac",
- (getter)Material_getFresnelTransFac, (setter)Material_setFresnelTransFac,
- "Blending factor for Fresnel transparency",
- NULL},
- {"rbFriction",
- (getter)Material_getRigidBodyFriction, (setter)Material_setRigidBodyFriction,
- "Rigid Body Friction coefficient",
- NULL},
- {"rbRestitution",
- (getter)Material_getRigidBodyRestitution, (setter)Material_setRigidBodyRestitution,
- "Rigid Body Restitution coefficient",
- NULL},
-
- {"haloSeed",
- (getter)Material_getHaloSeed, (setter)Material_setHaloSeed,
- "Randomizes halo ring dimension and line location",
- NULL},
- {"haloSize",
- (getter)Material_getHaloSize, (setter)Material_setHaloSize,
- "Dimension of the halo",
- NULL},
- {"hard",
- (getter)Material_getHardness, (setter)Material_setHardness,
- "Specularity hardness",
- NULL},
- {"IOR",
- (getter)Material_getIOR, (setter)Material_setIOR,
- "Angular index of refraction for raytrace",
- NULL},
- {"ipo",
- (getter)Material_getIpo, (setter)Material_setIpo,
- "Material Ipo data",
- NULL},
- {"mirCol",
- (getter)Material_getMirCol, (setter)Material_setMirCol,
- "Mirror RGB color triplet",
- NULL},
- {"mirR",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Mirror color red component",
- (void *) EXPP_MAT_COMP_MIRR },
- {"mirG",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Mirror color green component",
- (void *) EXPP_MAT_COMP_MIRG },
- {"mirB",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Mirror color blue component",
- (void *) EXPP_MAT_COMP_MIRB },
- {"sssCol",
- (getter)Material_getSssCol, (setter)Material_setSssCol,
- "Sss RGB color triplet",
- NULL},
- {"sssR",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "SSS color red component",
- (void *) EXPP_MAT_COMP_SSSR },
- {"sssG",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "SSS color green component",
- (void *) EXPP_MAT_COMP_SSSG },
- {"sssB",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "SSS color blue component",
- (void *) EXPP_MAT_COMP_SSSB },
- {"mode",
- (getter)Material_getMode, (setter)Material_setMode,
- "Material mode bitmask",
- NULL},
- {"nFlares",
- (getter)Material_getNFlares, (setter)Material_setNFlares,
- "Number of subflares with halo",
- NULL},
- {"nLines",
- (getter)Material_getNLines, (setter)Material_setNLines,
- "Number of star-shaped lines with halo",
- NULL},
- {"nRings",
- (getter)Material_getNRings, (setter)Material_setNRings,
- "Number of rings with halo",
- NULL},
- {"nStars",
- (getter)Material_getNStars, (setter)Material_setNStars,
- "Number of star points with halo",
- NULL},
- {"rayMirr",
- (getter)Material_getRayMirr, (setter)Material_setRayMirr,
- "Mirror reflection amount for raytrace",
- NULL},
- {"rayMirrDepth",
- (getter)Material_getMirrDepth, (setter)Material_setMirrDepth,
- "Amount of raytrace inter-reflections",
- NULL},
- {"ref",
- (getter)Material_getRef, (setter)Material_setRef,
- "Amount of reflections (for shader)",
- NULL},
- {"refracIndex",
- (getter)Material_getRefracIndex, (setter)Material_setRefracIndex,
- "Material's Index of Refraction (applies to the \"Blinn\" Specular Shader only",
- NULL},
- {"glossMir",
- (getter)Material_getGlossMirr, (setter)Material_setGlossMirr,
- "Reflection glossiness",
- NULL},
- {"sampGlossMir",
- (getter)Material_getGlossMirrSamples, (setter)Material_setGlossMirrSamples,
- "Reflection glossiness",
- NULL},
- {"glossTra",
- (getter)Material_getGlossTrans, (setter)Material_setGlossTrans,
- "Refraction glossiness",
- NULL},
- {"sampGlossTra",
- (getter)Material_getGlossMirrSamples, (setter)Material_setGlossMirrSamples,
- "Refraction glossiness",
- NULL},
- {"rgbCol",
- (getter)Material_getRGBCol, (setter)Material_setRGBCol,
- "Diffuse RGB color triplet",
- NULL},
- {"rms",
- (getter)Material_getRms, (setter)Material_setRms,
- "Material's surface slope standard deviation (\"WardIso\" specular shader only)",
- NULL},
- {"roughness",
- (getter)Material_getRoughness, (setter)Material_setRoughness,
- "Material's roughness (\"Oren Nayar\" diffuse shader only)",
- NULL},
- {"spec",
- (getter)Material_getSpec, (setter)Material_setSpec,
- "Degree of specularity",
- NULL},
- {"specCol",
- (getter)Material_getSpecCol, (setter)Material_setSpecCol,
- "Specular RGB color triplet",
- NULL},
- {"specR",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Specular color red component",
- (void *) EXPP_MAT_COMP_SPECR },
- {"specG",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Specular color green component",
- (void *) EXPP_MAT_COMP_SPECG },
- {"specB",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Specular color blue component",
- (void *) EXPP_MAT_COMP_SPECB },
- {"specTransp",
- (getter)Material_getSpecTransp, (setter)Material_setSpecTransp,
- "Makes specular areas opaque on transparent materials",
- NULL},
- {"specShader",
- (getter)Material_getSpecShader, (setter)Material_setSpecShader,
- "Specular shader type",
- NULL},
- {"specSize",
- (getter)Material_getSpecSize, (setter)Material_setSpecSize,
- "Material's specular area size (\"Toon\" specular shader only)",
- NULL},
- {"specSmooth",
- (getter)Material_getSpecSmooth, (setter)Material_setSpecSmooth,
- "Sets the smoothness of specular toon area",
- NULL},
- {"subSize",
- (getter)Material_getSubSize, (setter)Material_setSubSize,
- "Dimension of subflares, dots and circles",
- NULL},
- {"transDepth",
- (getter)Material_getTransDepth, (setter)Material_setTransDepth,
- "Amount of refractions for raytrace",
- NULL},
- {"translucency",
- (getter)Material_getTranslucency, (setter)Material_setTranslucency,
- "Amount of diffuse shading of the back side",
- NULL},
- {"zOffset",
- (getter)Material_getZOffset, (setter)Material_setZOffset,
- "Artificial offset in the Z buffer (for Ztransp option)",
- NULL},
- {"lightGroup",
- (getter)Material_getLightGroup, (setter)Material_setLightGroup,
- "The light group for this material",
- NULL},
- {"enabledTextures",
- (getter)Material_getTexChannel, (setter)Material_setTexChannel,
- "Enabled texture channels for this material",
- NULL},
- {"R",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Diffuse color red component",
- (void *) EXPP_MAT_COMP_R },
- {"G",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Diffuse color green component",
- (void *) EXPP_MAT_COMP_G },
- {"B",
- (getter)Material_getColorComponent, (setter)Material_setColorComponent,
- "Diffuse color blue component",
- (void *) EXPP_MAT_COMP_B },
- {"colorbandDiffuse",
- (getter)Material_getColorband, (setter)Material_setColorband,
- "The diffuse colorband for this material",
- (void *) 0},
- {"colorbandSpecular",
- (getter)Material_getColorband, (setter)Material_setColorband,
- "The specular colorband for this material",
- (void *) 1},
- {"textures",
- (getter)Material_getTextures, (setter)Material_setTextures,
- "The Material's texture list as a tuple",
- NULL},
- {"colorbandSpecularFactor",
- (getter)Material_getColorbandSpecularFactor, (setter)Material_setColorbandSpecularFactor,
- "The specular colorband factor for this material",
- NULL},
- {"colorbandSpecularMethod",
- (getter)Material_getColorbandSpecularMethod, (setter)Material_setColorbandSpecularMethod,
- "The specular colorband method for this material",
- NULL},
- {"colorbandSpecularInput",
- (getter)Material_getColorbandSpecularInput, (setter)Material_setColorbandSpecularInput,
- "The specular colorband input for this material",
- NULL},
- {"colorbandDiffuseFactor",
- (getter)Material_getColorbandDiffuseFactor, (setter)Material_setColorbandDiffuseFactor,
- "The diffuse colorband factor for this material",
- NULL},
- {"colorbandDiffuseMethod",
- (getter)Material_getColorbandDiffuseMethod, (setter)Material_setColorbandDiffuseMethod,
- "The diffuse colorband method for this material",
- NULL},
- {"colorbandDiffuseInput",
- (getter)Material_getColorbandDiffuseInput, (setter)Material_setColorbandDiffuseInput,
- "The diffuse colorband input for this material",
- NULL},
-
- /* SSS settings */
- {"enableSSS",
- (getter)Material_getSssEnable, (setter)Material_setSssEnable,
- "if true, SSS will be rendered for this material",
- NULL},
- {"sssScale",
- (getter)Material_getSssScale, (setter)Material_setSssScale,
- "object scale for sss",
- NULL},
- {"sssRadiusRed",
- (getter)Material_getSssRadius, (setter)Material_setSssRadius,
- "Mean red scattering path length",
- (void *) 0},
- {"sssRadiusGreen",
- (getter)Material_getSssRadius, (setter)Material_setSssRadius,
- "Mean red scattering path length",
- (void *) 1},
- {"sssRadiusBlue",
- (getter)Material_getSssRadius, (setter)Material_setSssRadius,
- "Mean red scattering path length",
- (void *) 2},
- {"sssIOR",
- (getter)Material_getSssIOR, (setter)Material_setSssIOR,
- "index of refraction",
- NULL},
- {"sssError",
- (getter)Material_getSssError, (setter)Material_setSssError,
- "Error",
- NULL},
- {"sssColorBlend",
- (getter)Material_getSssColorBlend, (setter)Material_setSssColorBlend,
- "Blend factor for SSS Colors",
- NULL},
- {"sssTextureScatter",
- (getter)Material_getSssTexScatter, (setter)Material_setSssTexScatter,
- "Texture scattering factor",
- NULL},
- {"sssFront",
- (getter)Material_getSssFront, (setter)Material_setSssFront,
- "Front scattering weight",
- NULL},
- {"sssBack",
- (getter)Material_getSssBack, (setter)Material_setSssBack,
- "Back scattering weight",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Material_Type callback function prototypes: */
-/*****************************************************************************/
-static void Material_dealloc( BPy_Material * self );
-static int Material_compare( BPy_Material * a, BPy_Material * b);
-static PyObject *Material_repr( BPy_Material * self );
-
-/*****************************************************************************/
-/* Python Material_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Material_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Material", /* char *tp_name; */
- sizeof( BPy_Material ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Material_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Material_compare,/* cmpfunc tp_compare; */
- ( reprfunc ) Material_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Material_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Material_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: Material_dealloc */
-/* Description: This is a callback function for the BPy_Material type. It is */
-/* the destructor function. */
-/*****************************************************************************/
-static void Material_dealloc( BPy_Material * self )
-{
- Py_DECREF( self->col );
- Py_DECREF( self->amb );
- Py_DECREF( self->spec );
- Py_DECREF( self->mir );
- Py_DECREF( self->sss );
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Function: Material_CreatePyObject */
-/* Description: Create a new BPy_Material from an existing */
-/* Blender material structure. */
-/*****************************************************************************/
-PyObject *Material_CreatePyObject( struct Material *mat )
-{
- BPy_Material *pymat;
- float *col[3], *amb[3], *spec[3], *mir[3], *sss[3];
-
- pymat = ( BPy_Material * ) PyObject_NEW( BPy_Material,
- &Material_Type );
-
- if( !pymat )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Material object" );
-
- pymat->material = mat;
-
- col[0] = &mat->r;
- col[1] = &mat->g;
- col[2] = &mat->b;
-
- amb[0] = &mat->ambr;
- amb[1] = &mat->ambg;
- amb[2] = &mat->ambb;
-
- spec[0] = &mat->specr;
- spec[1] = &mat->specg;
- spec[2] = &mat->specb;
-
- mir[0] = &mat->mirr;
- mir[1] = &mat->mirg;
- mir[2] = &mat->mirb;
-
- sss[0] = &mat->sss_col[0];
- sss[1] = &mat->sss_col[1];
- sss[2] = &mat->sss_col[2];
-
- pymat->col = ( BPy_rgbTuple * ) rgbTuple_New( col );
- pymat->amb = ( BPy_rgbTuple * ) rgbTuple_New( amb );
- pymat->spec = ( BPy_rgbTuple * ) rgbTuple_New( spec );
- pymat->mir = ( BPy_rgbTuple * ) rgbTuple_New( mir );
- pymat->sss = ( BPy_rgbTuple * ) rgbTuple_New( sss );
-
- return ( PyObject * ) pymat;
-}
-
-/*****************************************************************************/
-/* Function: Material_FromPyObject */
-/* Description: This function returns the Blender material from the given */
-/* PyObject. */
-/*****************************************************************************/
-Material *Material_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Material * ) pyobj )->material;
-}
-
-static PyObject *Material_getIpo( BPy_Material * self )
-{
- Ipo *ipo = self->material->ipo;
-
- if( !ipo )
- Py_RETURN_NONE;
-
- return Ipo_CreatePyObject( ipo );
-}
-
-static PyObject *Material_getMode( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->mode );
-}
-
-static PyObject *Material_getRGBCol( BPy_Material * self )
-{
- return rgbTuple_getCol( self->col );
-}
-
-/*
-static PyObject *Material_getAmbCol(BPy_Material *self)
-{
- return rgbTuple_getCol(self->amb);
-}
-*/
-static PyObject *Material_getSpecCol( BPy_Material * self )
-{
- return rgbTuple_getCol( self->spec );
-}
-
-static PyObject *Material_getMirCol( BPy_Material * self )
-{
- return rgbTuple_getCol( self->mir );
-}
-
-static PyObject *Material_getSssCol( BPy_Material * self )
-{
- return rgbTuple_getCol( self->sss );
-}
-
-static PyObject *Material_getSpecShader( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->spec_shader );
-}
-
-static PyObject *Material_getDiffuseShader( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->diff_shader );
-}
-
-static PyObject *Material_getRoughness( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->roughness );
-}
-
-static PyObject *Material_getSpecSize( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->param[2] );
-}
-
-static PyObject *Material_getDiffuseSize( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->param[0] );
-}
-
-static PyObject *Material_getSpecSmooth( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->param[3] );
-}
-
-static PyObject *Material_getDiffuseSmooth( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->param[1] );
-}
-
-static PyObject *Material_getDiffuseDarkness( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->darkness );
-}
-
-static PyObject *Material_getRefracIndex( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->refrac );
-}
-
-static PyObject *Material_getRms( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->rms );
-}
-
-static PyObject *Material_getAmb( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->amb );
-}
-
-static PyObject *Material_getEmit( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->emit );
-}
-
-static PyObject *Material_getAlpha( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->alpha );
-}
-
-static PyObject *Material_getShadAlpha( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->shad_alpha );
-}
-
-static PyObject *Material_getRef( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->ref );
-}
-
-static PyObject *Material_getSpec( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->spec );
-}
-
-static PyObject *Material_getSpecTransp( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->spectra );
-}
-
-static PyObject *Material_getAdd( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->add );
-}
-
-static PyObject *Material_getZOffset( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->zoffs );
-}
-
-static PyObject *Material_getLightGroup( BPy_Material * self )
-{
- return Group_CreatePyObject( self->material->group );
-}
-
-static PyObject *Material_getTexChannel( BPy_Material * self )
-{
- int i;
- short mask = 1;
- PyObject *list = PyList_New(0);
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyList_New() failed" );
-
- for( i = 0, mask = 1; i < MAX_MTEX ; ++i, mask <<= 1 ) {
- if( self->material->mtex[i] && (mask & self->material->septex) == 0 ) {
- PyObject * val = PyInt_FromLong(i);
- if( !val ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyInt_FromLong() failed" );
- }
- if( PyList_Append( list, val ) < 0 ) {
- Py_DECREF( val );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_Append() failed" );
- }
- Py_DECREF( val );
- }
- }
-
- return list;
-}
-
-static PyObject *Material_getHaloSize( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->hasize );
-}
-
-static PyObject *Material_getFlareSize( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->flaresize );
-}
-
-static PyObject *Material_getFlareBoost( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->flareboost );
-}
-
-static PyObject *Material_getSubSize( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->subsize );
-}
-
-static PyObject *Material_getHaloSeed( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->seed1 );
-}
-
-static PyObject *Material_getFlareSeed( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->seed2 );
-}
-
-static PyObject *Material_getHardness( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->har );
-}
-
-static PyObject *Material_getNFlares( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->flarec );
-}
-
-static PyObject *Material_getNStars( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->starc );
-}
-
-static PyObject *Material_getNLines( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->linec );
-}
-
-static PyObject *Material_getNRings( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->ringc );
-}
-
-static PyObject *Material_getRayMirr( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->ray_mirror );
-}
-
-static PyObject *Material_getMirrDepth( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->ray_depth );
-}
-
-static PyObject *Material_getFresnelMirr( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->fresnel_mir );
-}
-
-static PyObject *Material_getFresnelMirrFac( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->fresnel_mir_i );
-}
-
-static PyObject *Material_getFilter( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->filter );
-}
-
-static PyObject *Material_getTranslucency( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->translucency );
-}
-
-static PyObject *Material_getIOR( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->ang );
-}
-
-static PyObject *Material_getTransDepth( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->ray_depth_tra );
-}
-
-static PyObject *Material_getFresnelTrans( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->fresnel_tra );
-}
-
-static PyObject *Material_getFresnelTransFac( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->fresnel_tra_i );
-}
-
-static PyObject *Material_getGlossMirr( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->gloss_mir );
-}
-
-static PyObject *Material_getGlossMirrSamples( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->samp_gloss_mir );
-}
-
-static PyObject *Material_getGlossTrans( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->gloss_tra );
-}
-
-static PyObject *Material_getGlossTransSamples( BPy_Material * self )
-{
- return PyInt_FromLong( ( long ) self->material->samp_gloss_tra );
-}
-
-static PyObject* Material_getRigidBodyFriction( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->friction );
-}
-
-static PyObject* Material_getRigidBodyRestitution( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->reflect );
-}
-
-/* SSS */
-static PyObject* Material_getSssEnable( BPy_Material * self )
-{
- return EXPP_getBitfield( &self->material->sss_flag, MA_DIFF_SSS, 'h' );
-}
-
-static PyObject* Material_getSssScale( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_scale );
-}
-
-static PyObject* Material_getSssRadius( BPy_Material * self, void * type )
-{
- return PyFloat_FromDouble( ( double ) (self->material->sss_radius[GET_INT_FROM_POINTER(type)]) );
-}
-
-static PyObject* Material_getSssIOR( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_ior);
-}
-
-static PyObject* Material_getSssError( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_error);
-}
-
-static PyObject* Material_getSssColorBlend( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_colfac);
-}
-
-static PyObject* Material_getSssTexScatter( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_texfac);
-}
-
-static PyObject* Material_getSssFront( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_front);
-}
-
-static PyObject* Material_getSssBack( BPy_Material * self )
-{
- return PyFloat_FromDouble( ( double ) self->material->sss_back);
-}
-
-static PyObject *Material_getTextures( BPy_Material * self )
-{
- int i;
- PyObject *tuple;
-
- /* build a texture list */
- tuple = PyTuple_New( MAX_MTEX );
- if( !tuple )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyTuple" );
-
- for( i = 0; i < MAX_MTEX; ++i ) {
- struct MTex *mtex = self->material->mtex[i];
- if( mtex ) {
- PyTuple_SET_ITEM( tuple, i, MTex_CreatePyObject( mtex, ID_MA ) );
- } else {
- Py_INCREF( Py_None );
- PyTuple_SET_ITEM( tuple, i, Py_None );
- }
- }
-
- return tuple;
-}
-
-/*
- * this should accept a Py_None argument and just delete the Ipo link
- * (as Lamp_clearIpo() does)
- */
-
-static int Material_setIpo( BPy_Material * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->material->ipo, 0, 1, ID_IP, ID_MA);
-}
-
-
-/*
- * Material_insertIpoKey( key )
- * inserts Material IPO key at current frame
- */
-
-static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args )
-{
- int key = 0, flag = 0, map;
-
- if( !PyArg_ParseTuple( args, "i", &( key ) ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument" ) );
-
- map = texchannel_to_adrcode(self->material->texact);
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- if(key==IPOKEY_RGB || key==IPOKEY_ALLCOLOR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_R, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_G, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_B, flag);
- }
- if(key==IPOKEY_ALPHA || key==IPOKEY_ALLCOLOR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ALPHA, flag);
- }
- if(key==IPOKEY_HALOSIZE || key==IPOKEY_ALLCOLOR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HASIZE, flag);
- }
- if(key==IPOKEY_MODE || key==IPOKEY_ALLCOLOR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, flag);
- }
- if(key==IPOKEY_ALLCOLOR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_R, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_G, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_B, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_REF, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_EMIT, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_AMB, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HARD, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_TRANSLU, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ADD, flag);
- }
- if(key==IPOKEY_ALLMIRROR) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_RAYM, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIR, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIRI, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRA, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRAI, flag);
- }
- if(key==IPOKEY_OFS || key==IPOKEY_ALLMAPPING) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_X, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Y, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Z, flag);
- }
- if(key==IPOKEY_SIZE || key==IPOKEY_ALLMAPPING) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_X, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Y, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Z, flag);
- }
- if(key==IPOKEY_ALLMAPPING) {
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_R, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_G, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_B, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DVAR, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_COLF, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_NORF, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_VARF, flag);
- insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DISP, flag);
- }
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- Py_RETURN_NONE;
-}
-
-static int Material_setMode( BPy_Material * self, PyObject * value )
-{
- int param;
-
- if( !PyInt_Check( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%08x", MA_MODE_MASK );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = PyInt_AS_LONG ( value );
-
- if ( ( param & MA_MODE_MASK ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- self->material->mode &= ( MA_RAMP_COL | MA_RAMP_SPEC );
- self->material->mode |= param & ~( MA_RAMP_COL | MA_RAMP_SPEC );
-
- return 0;
-}
-
-static int Material_setRGBCol( BPy_Material * self, PyObject * value )
-{
- return rgbTuple_setCol( self->col, value );
-}
-
-/*
-static PyObject *Material_setAmbCol (BPy_Material *self, PyObject * value )
-{
- return rgbTuple_setCol(self->amb, value);
-}
-*/
-
-static int Material_setSpecCol( BPy_Material * self, PyObject * value )
-{
- return rgbTuple_setCol( self->spec, value );
-}
-
-static int Material_setMirCol( BPy_Material * self, PyObject * value )
-{
- return rgbTuple_setCol( self->mir, value );
-}
-
-static int Material_setSssCol( BPy_Material * self, PyObject * value )
-{
- return rgbTuple_setCol( self->sss, value );
-}
-
-static int Material_setColorComponent( BPy_Material * self, PyObject * value,
- void * closure )
-{
- float param;
-
- if( !PyNumber_Check ( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument in [0.0,1.0]" );
-
- param = (float)PyFloat_AsDouble( value );
- param = EXPP_ClampFloat( param, EXPP_MAT_COL_MIN, EXPP_MAT_COL_MAX );
-
- switch ( GET_INT_FROM_POINTER(closure) ) {
- case EXPP_MAT_COMP_R:
- self->material->r = param;
- return 0;
- case EXPP_MAT_COMP_G:
- self->material->g = param;
- return 0;
- case EXPP_MAT_COMP_B:
- self->material->b = param;
- return 0;
- case EXPP_MAT_COMP_SPECR:
- self->material->specr = param;
- return 0;
- case EXPP_MAT_COMP_SPECG:
- self->material->specg = param;
- return 0;
- case EXPP_MAT_COMP_SPECB:
- self->material->specb = param;
- return 0;
- case EXPP_MAT_COMP_MIRR:
- self->material->mirr = param;
- return 0;
- case EXPP_MAT_COMP_MIRG:
- self->material->mirg = param;
- return 0;
- case EXPP_MAT_COMP_MIRB:
- self->material->mirb = param;
- return 0;
- case EXPP_MAT_COMP_SSSR:
- self->material->sss_col[0] = param;
- return 0;
- case EXPP_MAT_COMP_SSSG:
- self->material->sss_col[1] = param;
- return 0;
- case EXPP_MAT_COMP_SSSB:
- self->material->sss_col[2] = param;
- return 0;
- }
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "unknown color component specified" );
-}
-
-/*#define setFloatWrapper(val, min, max) {return EXPP_setFloatClamped ( value, &self->material->#val, #min, #max}*/
-
-static int Material_setAmb( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->amb,
- EXPP_MAT_AMB_MIN,
- EXPP_MAT_AMB_MAX );
-}
-
-static int Material_setEmit( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->emit,
- EXPP_MAT_EMIT_MIN,
- EXPP_MAT_EMIT_MAX );
-}
-
-static int Material_setSpecTransp( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->spectra,
- EXPP_MAT_SPECTRA_MIN,
- EXPP_MAT_SPECTRA_MAX );
-}
-
-static int Material_setAlpha( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->alpha,
- EXPP_MAT_ALPHA_MIN,
- EXPP_MAT_ALPHA_MAX );
-}
-
-static int Material_setShadAlpha( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->shad_alpha,
- EXPP_MAT_ALPHA_MIN,
- EXPP_MAT_ALPHA_MAX );
-}
-
-static int Material_setRef( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->ref,
- EXPP_MAT_REF_MIN,
- EXPP_MAT_REF_MAX );
-}
-
-static int Material_setSpec( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->spec,
- EXPP_MAT_SPEC_MIN,
- EXPP_MAT_SPEC_MAX );
-}
-
-static int Material_setZOffset( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->zoffs,
- EXPP_MAT_ZOFFS_MIN,
- EXPP_MAT_ZOFFS_MAX );
-}
-
-static int Material_setLightGroup( BPy_Material * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->material->group, NULL, 1, ID_GR, 0);
-}
-
-static int Material_setTexChannel( BPy_Material * self, PyObject * value )
-{
- int i, mask;
- short septex = 0;
- int result = 1;
-
- /* fail if input is not a standard sequence */
- if( !PyList_Check( value ) && !PyTuple_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list of integers" );
-
- /* get a fast sequence; in Python 2.5, this just return the original
- * list or tuple and INCREFs it, so we must DECREF */
- value = PySequence_Fast( value, "" );
-
- /* set the disable bit for each existing texture */
- for( i= 0, mask= 1; i < MAX_MTEX; ++i, mask <<= 1 )
- if( self->material->mtex[i] != NULL )
- septex |= mask;
-
- /* check the list, and build new septex value */
- for( i= PySequence_Size(value)-1; i >= 0; --i ) {
- long ival;
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- if( !PyInt_Check( item ) ) {
- PyErr_SetString ( PyExc_TypeError,
- "expected tuple or list of integers" );
- goto exit;
- }
- ival= PyInt_AsLong( item );
- if(ival < 0 || ival > MAX_MTEX) {
- PyErr_SetString( PyExc_ValueError,
- "channel value out of range" );
- goto exit;
- }
- ival&= (1<<MAX_MTEX)-1;
- if( self->material->mtex[(int)ival] == NULL ) {
- PyErr_SetString( PyExc_ValueError,
- "channels must have a texture assigned" );
- goto exit;
- }
- septex&= ~(1<<ival);
- }
- self->material->septex= septex;
- result = 0;
-
-exit:
- Py_DECREF(value);
- return result;
-}
-
-static int Material_setAdd( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->add,
- EXPP_MAT_ADD_MIN,
- EXPP_MAT_ADD_MAX );
-}
-
-static int Material_setHaloSize( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->hasize,
- EXPP_MAT_HALOSIZE_MIN,
- EXPP_MAT_HALOSIZE_MAX );
-}
-
-static int Material_setFlareSize( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->flaresize,
- EXPP_MAT_FLARESIZE_MIN,
- EXPP_MAT_FLARESIZE_MAX );
-}
-
-static int Material_setFlareBoost( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->flareboost,
- EXPP_MAT_FLAREBOOST_MIN,
- EXPP_MAT_FLAREBOOST_MAX );
-}
-
-static int Material_setSubSize( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->subsize,
- EXPP_MAT_SUBSIZE_MIN,
- EXPP_MAT_SUBSIZE_MAX );
-}
-
-static int Material_setHaloSeed( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->seed1,
- EXPP_MAT_HALOSEED_MIN,
- EXPP_MAT_HALOSEED_MAX, 'b' );
-}
-
-static int Material_setFlareSeed( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->seed2,
- EXPP_MAT_FLARESEED_MIN,
- EXPP_MAT_FLARESEED_MAX, 'b' );
-}
-
-static int Material_setHardness( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->har,
- EXPP_MAT_HARD_MIN,
- EXPP_MAT_HARD_MAX, 'h' );
-}
-
-static int Material_setNFlares( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->flarec,
- EXPP_MAT_NFLARES_MIN,
- EXPP_MAT_NFLARES_MAX, 'h' );
-}
-
-static int Material_setNStars( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->starc,
- EXPP_MAT_NSTARS_MIN,
- EXPP_MAT_NSTARS_MAX, 'h' );
-}
-
-static int Material_setNLines( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->linec,
- EXPP_MAT_NLINES_MIN,
- EXPP_MAT_NLINES_MAX, 'h' );
-}
-
-static int Material_setNRings( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->ringc,
- EXPP_MAT_NRINGS_MIN,
- EXPP_MAT_NRINGS_MAX, 'h' );
-}
-
-static int Material_setRayMirr( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->ray_mirror,
- EXPP_MAT_RAYMIRR_MIN,
- EXPP_MAT_RAYMIRR_MAX );
-}
-
-static int Material_setMirrDepth( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->ray_depth,
- EXPP_MAT_MIRRDEPTH_MIN,
- EXPP_MAT_MIRRDEPTH_MAX, 'h' );
-}
-
-static int Material_setFresnelMirr( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->fresnel_mir,
- EXPP_MAT_FRESNELMIRR_MIN,
- EXPP_MAT_FRESNELMIRR_MAX );
-}
-
-static int Material_setFresnelMirrFac( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->fresnel_mir_i,
- EXPP_MAT_FRESNELMIRRFAC_MIN,
- EXPP_MAT_FRESNELMIRRFAC_MAX );
-}
-
-static int Material_setIOR( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->ang,
- EXPP_MAT_IOR_MIN,
- EXPP_MAT_IOR_MAX );
-}
-
-static int Material_setTransDepth( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->ray_depth_tra,
- EXPP_MAT_TRANSDEPTH_MIN,
- EXPP_MAT_TRANSDEPTH_MAX, 'h' );
-}
-
-static int Material_setFresnelTrans( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->fresnel_tra,
- EXPP_MAT_FRESNELTRANS_MIN,
- EXPP_MAT_FRESNELTRANS_MAX );
-}
-
-static int Material_setFresnelTransFac( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->fresnel_tra_i,
- EXPP_MAT_FRESNELTRANSFAC_MIN,
- EXPP_MAT_FRESNELTRANSFAC_MAX );
-}
-
-static int Material_setGlossMirr( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->gloss_mir,
- EXPP_MAT_RAYMIRRGLOSS_MIN,
- EXPP_MAT_RAYMIRRGLOSS_MAX );
-}
-
-static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->samp_gloss_mir,
- EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN,
- EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX, 'h' );
-}
-
-static int Material_setGlossTrans( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->gloss_tra,
- EXPP_MAT_RAYTRANSPGLOSS_MIN,
- EXPP_MAT_RAYTRANSPGLOSS_MAX );
-}
-
-static int Material_setGlossTransSamples( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->material->samp_gloss_tra,
- EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN,
- EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX, 'h' );
-}
-
-static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->friction,
- 0.f,
- 100.f );
-}
-
-static int Material_setRigidBodyRestitution( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->reflect,
- 0.f,
- 1.f );
-}
-
-
-
-
-static int Material_setSpecShader( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueRange( value, &self->material->spec_shader,
- MA_SPEC_COOKTORR,
- MA_SPEC_WARDISO, 'h' );
-}
-
-static int Material_setDiffuseShader( BPy_Material * self, PyObject * value )
-{
- return EXPP_setIValueRange( value, &self->material->diff_shader,
- MA_DIFF_LAMBERT,
- MA_DIFF_MINNAERT, 'h' );
-}
-
-static int Material_setRoughness( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->roughness,
- EXPP_MAT_ROUGHNESS_MIN,
- EXPP_MAT_ROUGHNESS_MAX );
-}
-
-static int Material_setSpecSize( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->param[2],
- EXPP_MAT_SPECSIZE_MIN,
- EXPP_MAT_SPECSIZE_MAX );
-}
-
-static int Material_setDiffuseSize( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->param[0],
- EXPP_MAT_DIFFUSESIZE_MIN,
- EXPP_MAT_DIFFUSESIZE_MAX );
-}
-
-static int Material_setSpecSmooth( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->param[3],
- EXPP_MAT_SPECSMOOTH_MIN,
- EXPP_MAT_SPECSMOOTH_MAX );
-}
-
-static int Material_setDiffuseSmooth( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->param[1],
- EXPP_MAT_DIFFUSESMOOTH_MIN,
- EXPP_MAT_DIFFUSESMOOTH_MAX );
-}
-
-static int Material_setDiffuseDarkness( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->darkness,
- EXPP_MAT_DIFFUSE_DARKNESS_MIN,
- EXPP_MAT_DIFFUSE_DARKNESS_MAX );
-}
-
-static int Material_setRefracIndex( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->refrac,
- EXPP_MAT_REFRACINDEX_MIN,
- EXPP_MAT_REFRACINDEX_MAX );
-}
-
-static int Material_setRms( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->rms,
- EXPP_MAT_RMS_MIN,
- EXPP_MAT_RMS_MAX );
-}
-
-static int Material_setFilter( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->filter,
- EXPP_MAT_FILTER_MIN,
- EXPP_MAT_FILTER_MAX );
-}
-
-static int Material_setTranslucency( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->translucency,
- EXPP_MAT_TRANSLUCENCY_MIN,
- EXPP_MAT_TRANSLUCENCY_MAX );
-}
-
-/* SSS */
-static int Material_setSssEnable( BPy_Material * self, PyObject * value )
-{
- return EXPP_setBitfield( value, &self->material->sss_flag, MA_DIFF_SSS, 'h' );
-}
-
-static int Material_setSssScale( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_scale,
- EXPP_MAT_SSS_SCALE_MIN,
- EXPP_MAT_SSS_SCALE_MAX);
-}
-
-static int Material_setSssRadius( BPy_Material * self, PyObject * value, void *type )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_radius[GET_INT_FROM_POINTER(type)],
- EXPP_MAT_SSS_RADIUS_MIN,
- EXPP_MAT_SSS_RADIUS_MAX);
-}
-
-static int Material_setSssIOR( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_ior,
- EXPP_MAT_SSS_IOR_MIN,
- EXPP_MAT_SSS_IOR_MAX);
-}
-
-static int Material_setSssError( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_error,
- EXPP_MAT_SSS_IOR_MIN,
- EXPP_MAT_SSS_IOR_MAX);
-}
-
-static int Material_setSssColorBlend( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_colfac,
- 0.0,
- 1.0);
-}
-
-static int Material_setSssTexScatter( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_texfac,
- 0.0,
- 1.0);
-}
-
-static int Material_setSssFront( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_front,
- EXPP_MAT_SSS_FRONT_MIN,
- EXPP_MAT_SSS_FRONT_MAX);
-}
-
-static int Material_setSssBack( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->material->sss_back,
- EXPP_MAT_SSS_BACK_MIN,
- EXPP_MAT_SSS_BACK_MAX);
-}
-
-static PyObject *Material_setTexture( BPy_Material * self, PyObject * args )
-{
- int texnum;
- PyObject *pytex;
- Tex *bltex;
- int texco = TEXCO_ORCO, mapto = MAP_COL;
-
- if( !PyArg_ParseTuple( args, "iO!|ii", &texnum, &Texture_Type, &pytex,
- &texco, &mapto ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int in [0,17] and Texture" );
- if( ( texnum < 0 ) || ( texnum >= MAX_MTEX ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int in [0,17] and Texture" );
-
- bltex = Texture_FromPyObject( pytex );
-
- if( !self->material->mtex[texnum] ) {
- /* there isn't an mtex for this slot so we need to make one */
- self->material->mtex[texnum] = add_mtex( );
- } else {
- /* we already had a texture here so deal with the old one first */
- self->material->mtex[texnum]->tex->id.us--;
- }
-
- self->material->mtex[texnum]->tex = bltex;
- id_us_plus( &bltex->id );
- self->material->mtex[texnum]->texco = (short)texco;
- self->material->mtex[texnum]->mapto = (short)mapto;
-
- Py_RETURN_NONE;
-}
-
-static int Material_setTextures( BPy_Material * self, PyObject * value )
-{
- int i;
-
- if( !PyList_Check( value ) && !PyTuple_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list of integers" );
-
- /* don't allow more than MAX_MTEX items */
- if( PySequence_Size(value) > MAX_MTEX )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "size of sequence greater than number of allowed textures" );
-
- /* get a fast sequence; in Python 2.5, this just return the original
- * list or tuple and INCREFs it, so we must DECREF */
- value = PySequence_Fast( value, "" );
-
- /* check the list for valid entries */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- if( item == Py_None || ( BPy_MTex_Check( item ) &&
- ((BPy_MTex *)item)->type == ID_MA ) ) {
- continue;
- } else {
- Py_DECREF(value);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list containing material MTex objects and NONE" );
- }
- }
-
- /* for each MTex object, copy to this structure */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->material->mtex[i];
- if( item != Py_None ) {
- BPy_MTex *obj = (BPy_MTex *)item;
-
- /* if MTex is already at this location, just skip it */
- if( obj->mtex == mtex ) continue;
-
- /* create a new entry if needed, otherwise update reference count
- * for texture that is being replaced */
- if( !mtex )
- mtex = self->material->mtex[i] = add_mtex( );
- else
- mtex->tex->id.us--;
-
- /* copy the data */
- mtex->tex = obj->mtex->tex;
- id_us_plus( &mtex->tex->id );
- mtex->texco = obj->mtex->texco;
- mtex->mapto = obj->mtex->mapto;
- }
- }
-
- /* now go back and free any entries now marked as None */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->material->mtex[i];
- if( item == Py_None && mtex ) {
- mtex->tex->id.us--;
- MEM_freeN( mtex );
- self->material->mtex[i] = NULL;
- }
- }
-
- Py_DECREF(value);
- return 0;
-}
-
-static PyObject *Material_clearTexture( BPy_Material * self, PyObject * value )
-{
- int texnum = (int)PyInt_AsLong(value);
- struct MTex *mtex;
- /* non ints will be -1 */
- if( ( texnum < 0 ) || ( texnum >= MAX_MTEX ) ) {
- char errstr[64];
- sprintf( errstr, "expected int in [0,%d]", MAX_MTEX );
- return EXPP_ReturnPyObjError( PyExc_TypeError, errstr );
- }
-
- mtex = self->material->mtex[texnum];
- if( mtex ) {
- if( mtex->tex )
- mtex->tex->id.us--;
- MEM_freeN( mtex );
- self->material->mtex[texnum] = NULL;
- }
-
- Py_RETURN_NONE;
-}
-
-/* mat.addScriptLink */
-static PyObject *Material_addScriptLink( BPy_Material * self, PyObject * args )
-{
- Material *mat = self->material;
- ScriptLink *slink = NULL;
-
- slink = &( mat )->scriptlink;
-
- return EXPP_addScriptLink( slink, args, 0 );
-}
-
-/* mat.clearScriptLinks */
-static PyObject *Material_clearScriptLinks(BPy_Material *self, PyObject *args )
-{
- Material *mat = self->material;
- ScriptLink *slink = NULL;
-
- slink = &( mat )->scriptlink;
-
- return EXPP_clearScriptLinks( slink, args );
-}
-
-/* mat.getScriptLinks */
-static PyObject *Material_getScriptLinks( BPy_Material * self,
- PyObject * value )
-{
- Material *mat = self->material;
- ScriptLink *slink = NULL;
- PyObject *ret = NULL;
-
- slink = &( mat )->scriptlink;
-
- /* can't this just return? EXP_getScriptLinks() returns a PyObject*
- * or NULL anyway */
-
- ret = EXPP_getScriptLinks( slink, value, 0 );
-
- if( ret )
- return ret;
- else
- return NULL;
-}
-
-/* mat.__copy__ */
-static PyObject *Material_copy( BPy_Material * self )
-{
- BPy_Material *pymat; /* for Material Data object wrapper in Python */
- Material *blmat; /* for actual Material Data we create in Blender */
-
- blmat = copy_material( self->material ); /* first copy the Material Data in Blender */
-
- if( blmat ) /* now create the wrapper obj in Python */
- pymat = ( BPy_Material * ) Material_CreatePyObject( blmat );
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Material Data in Blender" ) );
-
- blmat->id.us = 0; /* was incref'ed by add_material() above */
-
- if( pymat == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Material Data object" ) );
-
- return ( PyObject * ) pymat;
-}
-
-/* mat.freeNodes() */
-static PyObject *Material_freeNodes( BPy_Material * self )
-{
- if (self->material->nodetree) {
- if(self->material->nodetree) {
- ntreeFreeTree(self->material->nodetree);
- MEM_freeN(self->material->nodetree);
- }
- self->material->nodetree = NULL;
- self->material->use_nodes = 0;
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
-}
-
-/* mat_a==mat_b or mat_a!=mat_b*/
-static int Material_compare( BPy_Material * a, BPy_Material * b )
-{
- return ( a->material == b->material) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Material_repr */
-/* Description: This is a callback function for the BPy_Material type. It */
-/* builds a meaninful string to represent material objects. */
-/*****************************************************************************/
-static PyObject *Material_repr( BPy_Material * self )
-{
- return PyString_FromFormat( "[Material \"%s\"]",
- self->material->id.name + 2 );
-}
-
-/*****************************************************************************/
-/* These functions are used here and in in Texture.c */
-/*****************************************************************************/
-PyObject *EXPP_PyList_fromColorband( ColorBand *coba )
-{
- short i;
- PyObject *cbls;
- PyObject *colls;
-
- if (!coba)
- return PyList_New( 0 );
-
- cbls = PyList_New( coba->tot );
-
- for (i=0; i < coba->tot; i++) {
- colls = PyList_New( 5 );
- PyList_SET_ITEM( colls, 0, PyFloat_FromDouble(coba->data[i].r) );
- PyList_SET_ITEM( colls, 1, PyFloat_FromDouble(coba->data[i].g) );
- PyList_SET_ITEM( colls, 2, PyFloat_FromDouble(coba->data[i].b) );
- PyList_SET_ITEM( colls, 3, PyFloat_FromDouble(coba->data[i].a) );
- PyList_SET_ITEM( colls, 4, PyFloat_FromDouble(coba->data[i].pos) );
- PyList_SET_ITEM(cbls, i, colls);
- }
- return cbls;
-}
-
-/* make sure you coba is not none before calling this */
-int EXPP_Colorband_fromPyList( ColorBand **coba, PyObject * value )
-{
- short totcol, i;
- PyObject *colseq;
- PyObject *pyflt;
- float f;
-
- if ( !PySequence_Check( value ) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "Colorband must be a sequence" ) );
-
- totcol = PySequence_Size(value);
- if ( totcol > 31)
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "Colorband must be between 1 and 31 in length" ) );
-
- if (totcol==0) {
- MEM_freeN(*coba);
- *coba = NULL;
- return 0;
- }
-
- if (!*coba)
- *coba = MEM_callocN( sizeof(ColorBand), "colorband");
-
- for (i=0; i<totcol; i++) {
- colseq = PySequence_GetItem( value, i );
- if ( !PySequence_Check( colseq ) || PySequence_Size( colseq ) != 5) {
- Py_DECREF ( colseq );
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "Colorband colors must be sequences of 5 floats" ) );
- }
- for (i=0; i<5; i++) {
- pyflt = PySequence_GetItem( colseq, i );
- if (!PyNumber_Check(pyflt)) {
- Py_DECREF ( pyflt );
- Py_DECREF ( colseq );
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "Colorband colors must be sequences of 5 floats" ) );
- }
- Py_DECREF ( pyflt );
- }
- Py_DECREF ( colseq );
- }
-
- /* ok, continue - should check for 5 floats, will ignore non floats for now */
- (*coba)->tot = totcol;
- for (i=0; i<totcol; i++) {
- colseq = PySequence_GetItem( value, i );
-
- pyflt = PySequence_GetItem( colseq, 0 );
- f = (float)PyFloat_AsDouble( pyflt );
- CLAMP(f, 0.0, 1.0);
- (*coba)->data[i].r = f;
- Py_DECREF ( pyflt );
-
- pyflt = PySequence_GetItem( colseq, 1 );
- f = (float)PyFloat_AsDouble( pyflt );
- CLAMP(f, 0.0, 1.0);
- (*coba)->data[i].g = f;
- Py_DECREF ( pyflt );
-
- pyflt = PySequence_GetItem( colseq, 2 );
- f = (float)PyFloat_AsDouble( pyflt );
- CLAMP(f, 0.0, 1.0);
- (*coba)->data[i].b = f;
- Py_DECREF ( pyflt );
-
- pyflt = PySequence_GetItem( colseq, 3 );
- f = (float)PyFloat_AsDouble( pyflt );
- CLAMP(f, 0.0, 1.0);
- (*coba)->data[i].a = f;
- Py_DECREF ( pyflt );
-
- pyflt = PySequence_GetItem( colseq, 4 );
- f = (float)PyFloat_AsDouble( pyflt );
- CLAMP(f, 0.0, 1.0);
- (*coba)->data[i].pos = f;
- Py_DECREF ( pyflt );
-
- Py_DECREF ( colseq );
- }
- return 0;
-}
-
-
-/*****************************************************************************/
-/* These functions are used in NMesh.c and Object.c */
-/*****************************************************************************/
-PyObject *EXPP_PyList_fromMaterialList( Material ** matlist, int len, int all )
-{
- PyObject *list;
- int i;
-
- list = PyList_New( 0 );
- if( !matlist )
- return list;
-
- for( i = 0; i < len; i++ ) {
- Material *mat = matlist[i];
- PyObject *ob;
-
- if( mat ) {
- ob = Material_CreatePyObject( mat );
- PyList_Append( list, ob );
- Py_DECREF( ob ); /* because Append increfs */
- } else if( all ) { /* return NULL mats (empty slots) as Py_None */
- PyList_Append( list, Py_None );
- }
- }
-
- return list;
-}
-
-Material **EXPP_newMaterialList_fromPyList( PyObject * list )
-{
- int i, len;
- BPy_Material *pymat = 0;
- Material *mat;
- Material **matlist;
-
- len = PySequence_Length( list );
- if( len > 16 )
- len = 16;
- else if( len <= 0 )
- return NULL;
-
- matlist = EXPP_newMaterialList( len );
-
- for( i = 0; i < len; i++ ) {
-
- pymat = ( BPy_Material * ) PySequence_GetItem( list, i );
-
- if( BPy_Material_Check( ( PyObject * ) pymat ) ) {
- mat = pymat->material;
- matlist[i] = mat;
- } else if( ( PyObject * ) pymat == Py_None ) {
- matlist[i] = NULL;
- } else { /* error; illegal type in material list */
- Py_DECREF( pymat );
- MEM_freeN( matlist );
- return NULL;
- }
-
- Py_DECREF( pymat );
- }
-
- return matlist;
-}
-
-Material **EXPP_newMaterialList( int len )
-{
- Material **matlist =
- ( Material ** ) MEM_mallocN( len * sizeof( Material * ),
- "MaterialList" );
-
- return matlist;
-}
-
-int EXPP_releaseMaterialList( Material ** matlist, int len )
-{
- int i;
- Material *mat;
-
- if( ( len < 0 ) || ( len > MAXMAT ) ) {
- printf( "illegal matindex!\n" );
- return 0;
- }
-
- for( i = 0; i < len; i++ ) {
- mat = matlist[i];
- if( mat ) {
- if( ( ( ID * ) mat )->us > 0 )
- ( ( ID * ) mat )->us--;
- else
- printf( "FATAL: material usage=0: %s",
- ( ( ID * ) mat )->name );
- }
- }
- MEM_freeN( matlist );
-
- return 1;
-}
-
-/** expands pointer array of length 'oldsize' to length 'newsize'.
- * A pointer to the (void *) array must be passed as first argument
- * The array pointer content can be NULL, in this case a new array of length
- * 'newsize' is created.
- */
-
-static int expandPtrArray( void **p, int oldsize, int newsize )
-{
- void *newarray;
-
- if( newsize < oldsize ) {
- return 0;
- }
- newarray = MEM_callocN( sizeof( void * ) * newsize, "PtrArray" );
- if( *p ) {
- memcpy( newarray, *p, sizeof( void * ) * oldsize );
- MEM_freeN( *p );
- }
- *p = newarray;
- return 1;
-}
-
-int EXPP_synchronizeMaterialLists( Object * object )
-{
- Material ***p_dataMaterials = give_matarar( object );
- short *nmaterials = give_totcolp( object );
- int result = 0;
-
- if( object->totcol > *nmaterials ) {
- /* More object mats than data mats */
- result = expandPtrArray( ( void * ) p_dataMaterials,
- *nmaterials, object->totcol );
- *nmaterials = object->totcol;
- } else {
- if( object->totcol < *nmaterials ) {
- /* More data mats than object mats */
- result = expandPtrArray( ( void * ) &object->mat,
- object->totcol, *nmaterials );
- object->totcol = (char)*nmaterials;
- }
- } /* else no synchronization needed, they are of equal length */
-
- return result; /* 1 if changed, 0 otherwise */
-}
-
-void EXPP_incr_mats_us( Material ** matlist, int len )
-{
- int i;
- Material *mat;
-
- if( len <= 0 )
- return;
-
- for( i = 0; i < len; i++ ) {
- mat = matlist[i];
- if( mat )
- mat->id.us++;
- }
-
- return;
-}
-
-static PyObject *Material_getColorComponent( BPy_Material * self,
- void * closure )
-{
- switch ( GET_INT_FROM_POINTER(closure) ) {
- case EXPP_MAT_COMP_R:
- return PyFloat_FromDouble( ( double ) self->material->r );
- case EXPP_MAT_COMP_G:
- return PyFloat_FromDouble( ( double ) self->material->g );
- case EXPP_MAT_COMP_B:
- return PyFloat_FromDouble( ( double ) self->material->b );
- case EXPP_MAT_COMP_SPECR:
- return PyFloat_FromDouble( ( double ) self->material->specr );
- case EXPP_MAT_COMP_SPECG:
- return PyFloat_FromDouble( ( double ) self->material->specg );
- case EXPP_MAT_COMP_SPECB:
- return PyFloat_FromDouble( ( double ) self->material->specb );
- case EXPP_MAT_COMP_MIRR:
- return PyFloat_FromDouble( ( double ) self->material->mirr );
- case EXPP_MAT_COMP_MIRG:
- return PyFloat_FromDouble( ( double ) self->material->mirg );
- case EXPP_MAT_COMP_MIRB:
- return PyFloat_FromDouble( ( double ) self->material->mirb );
- case EXPP_MAT_COMP_SSSR:
- return PyFloat_FromDouble( ( double ) self->material->sss_col[0] );
- case EXPP_MAT_COMP_SSSG:
- return PyFloat_FromDouble( ( double ) self->material->sss_col[1] );
- case EXPP_MAT_COMP_SSSB:
- return PyFloat_FromDouble( ( double ) self->material->sss_col[2] );
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unknown color component specified" );
- }
-}
-
-static PyObject *Material_getColorband( BPy_Material * self, void * type)
-{
- switch( (long)type ) {
- case 0: /* these are backwards, but that how it works */
- return EXPP_PyList_fromColorband( self->material->ramp_col );
- case 1:
- return EXPP_PyList_fromColorband( self->material->ramp_spec );
- }
- Py_RETURN_NONE;
-}
-
-static int Material_setColorband( BPy_Material * self, PyObject * value, void * type)
-{
- switch( (long)type ) {
- case 0: /* these are backwards, but that how it works */
- return EXPP_Colorband_fromPyList( &self->material->ramp_col, value );
- case 1:
- return EXPP_Colorband_fromPyList( &self->material->ramp_spec, value );
- }
- return 0;
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *Matr_oldsetAdd( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setAdd );
-}
-
-static PyObject *Matr_oldsetAlpha( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setAlpha );
-}
-
-static PyObject *Matr_oldsetAmb( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setAmb );
-}
-
-static PyObject *Matr_oldsetDiffuseDarkness( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setDiffuseDarkness );
-}
-
-static PyObject *Matr_oldsetDiffuseShader( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setDiffuseShader );
-}
-
-static PyObject *Matr_oldsetDiffuseSize( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setDiffuseSize );
-}
-
-static PyObject *Matr_oldsetDiffuseSmooth( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setDiffuseSmooth );
-}
-
-static PyObject *Matr_oldsetEmit( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setEmit );
-}
-
-static PyObject *Matr_oldsetFilter( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFilter );
-}
-
-static PyObject *Matr_oldsetFlareBoost( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFlareBoost );
-}
-
-static PyObject *Matr_oldsetFlareSeed( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFlareSeed );
-}
-
-static PyObject *Matr_oldsetFlareSize( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFlareSize );
-}
-
-static PyObject *Matr_oldsetFresnelMirr( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFresnelMirr );
-}
-
-static PyObject *Matr_oldsetFresnelMirrFac( BPy_Material * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFresnelMirrFac );
-}
-
-static PyObject *Matr_oldsetFresnelTrans( BPy_Material * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFresnelTrans );
-}
-
-static PyObject *Matr_oldsetFresnelTransFac( BPy_Material * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setFresnelTransFac );
-}
-
-static PyObject *Matr_oldsetHaloSeed( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setHaloSeed );
-}
-
-static PyObject *Matr_oldsetHaloSize( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setHaloSize );
-}
-
-static PyObject *Matr_oldsetHardness( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setHardness );
-}
-
-static PyObject *Matr_oldsetIOR( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setIOR );
-}
-
-static PyObject *Matr_oldsetNFlares( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setNFlares );
-}
-
-static PyObject *Matr_oldsetNLines( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setNLines );
-}
-
-static PyObject *Matr_oldsetNRings( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setNRings );
-}
-
-static PyObject *Matr_oldsetNStars( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setNStars );
-}
-
-static PyObject *Matr_oldsetRayMirr( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setRayMirr );
-}
-
-static PyObject *Matr_oldsetRoughness( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setRoughness );
-}
-
-static PyObject *Matr_oldsetMirrDepth( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setMirrDepth );
-}
-
-static PyObject *Matr_oldsetRef( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setRef );
-}
-
-static PyObject *Matr_oldsetRefracIndex( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setRefracIndex );
-}
-
-static PyObject *Matr_oldsetRms( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setRms );
-}
-
-static PyObject *Matr_oldsetSpec( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSpec );
-}
-
-static PyObject *Matr_oldsetSpecShader( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSpecShader );
-}
-
-static PyObject *Matr_oldsetSpecSize( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSpecSize );
-}
-
-static PyObject *Matr_oldsetSpecSmooth( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSpecSmooth );
-}
-
-static PyObject *Matr_oldsetSpecTransp( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSpecTransp );
-}
-
-static PyObject *Matr_oldsetSubSize( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setSubSize );
-}
-
-static PyObject *Matr_oldsetTranslucency( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setTranslucency );
-}
-
-static PyObject *Matr_oldsetTransDepth( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setTransDepth );
-}
-
-static PyObject *Matr_oldsetZOffset( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setZOffset );
-}
-
-static PyObject *Matr_oldsetRGBCol( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Material_setRGBCol );
-}
-
-static PyObject *Matr_oldsetSpecCol( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Material_setSpecCol );
-}
-
-static PyObject *Matr_oldsetMirCol( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Material_setMirCol );
-}
-
-
-/* Possible modes are traceable, shadow, shadeless, wire, vcolLight,
- * vcolPaint, halo, ztransp, zinvert, haloRings, env, haloLines,
- * onlyShadow, xalpha, star, faceTexture, haloTex, haloPuno, noMist,
- * haloShaded, haloFlare */
-
-static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args )
-{
- unsigned int i, flag = 0, ok = 0;
- PyObject *value, *error;
- char *m[28] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL
- };
-
- /*
- * check for a single integer argument; do a quick check for now
- * that the value is not larger than double the highest flag bit
- */
-
- if ( (PySequence_Size( args ) == 1)
- && PyInt_Check ( PyTuple_GET_ITEM ( args , 0 ) )
- && PyArg_ParseTuple( args, "i", &flag )
- && (flag & MA_MODE_MASK ) == flag ) {
- ok = 1;
-
- /*
- * check for either an empty argument list, or up to 28 strings
- */
-
- } else if( PyArg_ParseTuple( args, "|ssssssssssssssssssssssssssss",
- &m[0], &m[1], &m[2], &m[3], &m[4], &m[5], &m[6],
- &m[7], &m[8], &m[9], &m[10], &m[11], &m[12],
- &m[13], &m[14], &m[15], &m[16], &m[17], &m[18],
- &m[19], &m[20], &m[21], &m[22], &m[23], &m[24],
- &m[25], &m[26], &m[27] ) ) {
- for( i = 0; i < 28; i++ ) {
- if( m[i] == NULL )
- break;
- if( strcmp( m[i], "Traceable" ) == 0 )
- flag |= MA_TRACEBLE;
- else if( strcmp( m[i], "Shadow" ) == 0 )
- flag |= MA_SHADOW;
- else if( strcmp( m[i], "Shadeless" ) == 0 )
- flag |= MA_SHLESS;
- else if( strcmp( m[i], "Wire" ) == 0 )
- flag |= MA_WIRE;
- else if( strcmp( m[i], "VColLight" ) == 0 )
- flag |= MA_VERTEXCOL;
- else if( strcmp( m[i], "VColPaint" ) == 0 )
- flag |= MA_VERTEXCOLP;
- else if( strcmp( m[i], "Halo" ) == 0 )
- flag |= MA_HALO;
- else if( strcmp( m[i], "ZTransp" ) == 0 )
- flag |= MA_ZTRA;
- else if( strcmp( m[i], "ZInvert" ) == 0 )
- flag |= MA_ZINV;
- else if( strcmp( m[i], "HaloRings" ) == 0 )
- flag |= MA_HALO_RINGS;
- else if( strcmp( m[i], "HaloLines" ) == 0 )
- flag |= MA_HALO_LINES;
- else if( strcmp( m[i], "OnlyShadow" ) == 0 )
- flag |= MA_ONLYSHADOW;
- else if( strcmp( m[i], "HaloXAlpha" ) == 0 )
- flag |= MA_HALO_XALPHA;
- else if( strcmp( m[i], "HaloStar" ) == 0 )
- flag |= MA_STAR;
- else if( strcmp( m[i], "TexFace" ) == 0 )
- flag |= MA_FACETEXTURE;
- else if( strcmp( m[i], "HaloTex" ) == 0 )
- flag |= MA_HALOTEX;
- else if( strcmp( m[i], "HaloPuno" ) == 0 )
- flag |= MA_HALOPUNO;
- else if( strcmp( m[i], "NoMist" ) == 0 )
- flag |= MA_NOMIST;
- else if( strcmp( m[i], "HaloShaded" ) == 0 )
- flag |= MA_HALO_SHADE;
- else if( strcmp( m[i], "HaloFlare" ) == 0 )
- flag |= MA_HALO_FLARE;
- else if( strcmp( m[i], "Radio" ) == 0 )
- flag |= MA_RADIO;
- /* ** Mirror ** */
- else if( strcmp( m[i], "RayMirr" ) == 0 )
- flag |= MA_RAYMIRROR;
- else if( strcmp( m[i], "ZTransp" ) == 0 )
- flag |= MA_ZTRA;
- else if( strcmp( m[i], "RayTransp" ) == 0 )
- flag |= MA_RAYTRANSP;
- else if( strcmp( m[i], "OnlyShadow" ) == 0 )
- flag |= MA_ONLYSHADOW;
- else if( strcmp( m[i], "NoMist" ) == 0 )
- flag |= MA_NOMIST;
- else if( strcmp( m[i], "Env" ) == 0 )
- flag |= MA_ENV;
- else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown Material mode argument" ) );
- }
- ok = 1;
- }
-
- /* if neither input method worked, then throw an exception */
-
- if ( ok == 0 )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected nothing, an integer or up to 22 string argument(s)" ) );
- /* build tuple, call wrapper */
-
- value = Py_BuildValue("(i)", flag);
- error = EXPP_setterWrapper( (void *)self, value, (setter)Material_setMode );
- Py_DECREF ( value );
- return error;
-}
-
-static PyObject *Matr_oldsetIpo( BPy_Material * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Material_setIpo );
-}
-
-/*
- * clearIpo() returns True/False depending on whether material has an Ipo
- */
-
-static PyObject *Material_clearIpo( BPy_Material * self )
-{
- /* if Ipo defined, delete it and return true */
-
- if( self->material->ipo ) {
- PyObject *value = Py_BuildValue( "(O)", Py_None );
- EXPP_setterWrapper( (void *)self, value, (setter)Material_setIpo );
- Py_DECREF ( value );
- return EXPP_incr_ret_True();
- }
- return EXPP_incr_ret_False(); /* no ipo found */
-}
-
-/* RampCol Factor */
-
-static PyObject *Material_getColorbandDiffuseFactor( BPy_Material * self )
-{
- return PyFloat_FromDouble( (double) self->material->rampfac_col);
-}
-
-static PyObject *Material_getColorbandSpecularFactor( BPy_Material * self )
-{
- return PyFloat_FromDouble( (double) self->material->rampfac_spec);
-}
-
-static int Material_setColorbandDiffuseFactor ( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped(value, &self->material->rampfac_col,
- EXPP_MAT_COLORBAND_FACTOR_MIN, EXPP_MAT_COLORBAND_FACTOR_MAX);
-}
-
-static int Material_setColorbandSpecularFactor ( BPy_Material * self, PyObject * value )
-{
- return EXPP_setFloatClamped(value, &self->material->rampfac_spec,
- EXPP_MAT_COLORBAND_FACTOR_MIN, EXPP_MAT_COLORBAND_FACTOR_MAX);
-}
-
-/* RampCol Method */
-
-static PyObject *Material_getColorbandDiffuseMethod( BPy_Material * self )
-{
- return PyInt_FromLong( (long) self->material->rampblend_col);
-}
-
-static PyObject *Material_getColorbandSpecularMethod ( BPy_Material * self )
-{
- return PyInt_FromLong( (long) self->material->rampblend_spec);
-}
-
-static int Material_setColorbandDiffuseMethod ( BPy_Material * self, PyObject * value)
-{
- return EXPP_setIValueClamped(value, &self->material->rampblend_col,
- MA_RAMP_BLEND, MA_RAMP_COLOR, 'b');
-}
-
-static int Material_setColorbandSpecularMethod ( BPy_Material * self, PyObject * value)
-{
- return EXPP_setIValueClamped(value, &self->material->rampblend_spec,
- MA_RAMP_BLEND, MA_RAMP_COLOR, 'b');
-}
-
-/* RampCol Input */
-
-static PyObject *Material_getColorbandDiffuseInput( BPy_Material * self )
-{
- return PyInt_FromLong( (long) self->material->rampin_col);
-}
-
-static PyObject *Material_getColorbandSpecularInput( BPy_Material * self )
-{
- return PyInt_FromLong( (long) self->material->rampin_spec);
-}
-
-static int Material_setColorbandDiffuseInput ( BPy_Material * self, PyObject * value)
-{
- return EXPP_setIValueClamped(value, &self->material->rampin_col,
- MA_RAMP_IN_SHADER, MA_RAMP_IN_RESULT, 'b');
-}
-
-static int Material_setColorbandSpecularInput ( BPy_Material * self, PyObject * value)
-{
- return EXPP_setIValueClamped(value, &self->material->rampin_spec,
- MA_RAMP_IN_SHADER, MA_RAMP_IN_RESULT, 'b');
-}
-
diff --git a/source/blender/python/api2_2x/Material.h b/source/blender/python/api2_2x/Material.h
deleted file mode 100644
index ec7fd0ad995..00000000000
--- a/source/blender/python/api2_2x/Material.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_MATERIAL_H
-#define EXPP_MATERIAL_H
-
-#include <Python.h>
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h" /* colorband */
-#include "rgbTuple.h"
-
-/*****************************************************************************/
-/* Python BPy_Material structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- Material * material; /* libdata must be second */
- BPy_rgbTuple *col, *amb, *spec, *mir, *sss;
-} BPy_Material;
-
-extern PyTypeObject Material_Type; /* The Material PyType Object */
-
-#define BPy_Material_Check(v) \
- ((v)->ob_type == &Material_Type) /* for type checking */
-
-/*****************************************************************************/
-/* Module Blender.Material - public functions */
-/*****************************************************************************/
-PyObject *M_Material_Init( void );
-
-PyObject *Material_Init( void );
-PyObject *Material_CreatePyObject( Material * mat );
-Material *Material_FromPyObject( PyObject * pyobj );
-
-/* colorband tp_getseters */
-PyObject *EXPP_PyList_fromColorband( ColorBand *coba );
-int EXPP_Colorband_fromPyList( ColorBand **coba, PyObject * value );
-
-/* Some functions needed by NMesh, Curve and friends */
-PyObject *EXPP_PyList_fromMaterialList( Material ** matlist, int len,
- int all );
-Material **EXPP_newMaterialList_fromPyList( PyObject * list );
-Material **EXPP_newMaterialList( int len );
-void EXPP_incr_mats_us( Material ** matlist, int len );
-int EXPP_synchronizeMaterialLists( Object * object );
-int EXPP_releaseMaterialList( Material ** matlist, int len );
-
-#endif /* EXPP_MATERIAL_H */
diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c
deleted file mode 100644
index f0b51285376..00000000000
--- a/source/blender/python/api2_2x/Mathutils.c
+++ /dev/null
@@ -1,1759 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mathutils.h"
-
-#include "BLI_arithb.h"
-#include "PIL_time.h"
-#include "BLI_rand.h"
-#include "BKE_utildefines.h"
-
-#include "gen_utils.h"
-
-//-------------------------DOC STRINGS ---------------------------
-static char M_Mathutils_doc[] = "The Blender Mathutils module\n\n";
-static char M_Mathutils_Vector_doc[] = "() - create a new vector object from a list of floats";
-static char M_Mathutils_Matrix_doc[] = "() - create a new matrix object from a list of floats";
-static char M_Mathutils_Quaternion_doc[] = "() - create a quaternion from a list or an axis of rotation and an angle";
-static char M_Mathutils_Euler_doc[] = "() - create and return a new euler object";
-static char M_Mathutils_Rand_doc[] = "() - return a random number";
-static char M_Mathutils_CrossVecs_doc[] = "() - returns a vector perpedicular to the 2 vectors crossed";
-static char M_Mathutils_CopyVec_doc[] = "() - create a copy of vector";
-static char M_Mathutils_DotVecs_doc[] = "() - return the dot product of two vectors";
-static char M_Mathutils_AngleBetweenVecs_doc[] = "() - returns the angle between two vectors in degrees";
-static char M_Mathutils_MidpointVecs_doc[] = "() - return the vector to the midpoint between two vectors";
-static char M_Mathutils_MatMultVec_doc[] = "() - multiplies a matrix by a column vector";
-static char M_Mathutils_VecMultMat_doc[] = "() - multiplies a row vector by a matrix";
-static char M_Mathutils_ProjectVecs_doc[] = "() - returns the projection vector from the projection of vecA onto vecB";
-static char M_Mathutils_RotationMatrix_doc[] = "() - construct a rotation matrix from an angle and axis of rotation";
-static char M_Mathutils_ScaleMatrix_doc[] = "() - construct a scaling matrix from a scaling factor";
-static char M_Mathutils_OrthoProjectionMatrix_doc[] = "() - construct a orthographic projection matrix from a selected plane";
-static char M_Mathutils_ShearMatrix_doc[] = "() - construct a shearing matrix from a plane of shear and a shear factor";
-static char M_Mathutils_CopyMat_doc[] = "() - create a copy of a matrix";
-static char M_Mathutils_TranslationMatrix_doc[] = "(vec) - create a translation matrix from a vector";
-static char M_Mathutils_CopyQuat_doc[] = "() - copy quatB to quatA";
-static char M_Mathutils_CopyEuler_doc[] = "() - copy eulB to eultA";
-static char M_Mathutils_CrossQuats_doc[] = "() - return the mutliplication of two quaternions";
-static char M_Mathutils_DotQuats_doc[] = "() - return the dot product of two quaternions";
-static char M_Mathutils_Slerp_doc[] = "() - returns the interpolation between two quaternions";
-static char M_Mathutils_DifferenceQuats_doc[] = "() - return the angular displacment difference between two quats";
-static char M_Mathutils_RotateEuler_doc[] = "() - rotate euler by an axis and angle";
-static char M_Mathutils_Intersect_doc[] = "(v1, v2, v3, ray, orig, clip=1) - returns the intersection between a ray and a triangle, if possible, returns None otherwise";
-static char M_Mathutils_TriangleArea_doc[] = "(v1, v2, v3) - returns the area size of the 2D or 3D triangle defined";
-static char M_Mathutils_TriangleNormal_doc[] = "(v1, v2, v3) - returns the normal of the 3D triangle defined";
-static char M_Mathutils_QuadNormal_doc[] = "(v1, v2, v3, v4) - returns the normal of the 3D quad defined";
-static char M_Mathutils_LineIntersect_doc[] = "(v1, v2, v3, v4) - returns a tuple with the points on each line respectively closest to the other";
-static char M_Mathutils_Point_doc[] = "Creates a 2d or 3d point object";
-//-----------------------METHOD DEFINITIONS ----------------------
-struct PyMethodDef M_Mathutils_methods[] = {
- {"Rand", (PyCFunction) M_Mathutils_Rand, METH_VARARGS, M_Mathutils_Rand_doc},
- {"Vector", (PyCFunction) M_Mathutils_Vector, METH_VARARGS, M_Mathutils_Vector_doc},
- {"CrossVecs", (PyCFunction) M_Mathutils_CrossVecs, METH_VARARGS, M_Mathutils_CrossVecs_doc},
- {"DotVecs", (PyCFunction) M_Mathutils_DotVecs, METH_VARARGS, M_Mathutils_DotVecs_doc},
- {"AngleBetweenVecs", (PyCFunction) M_Mathutils_AngleBetweenVecs, METH_VARARGS, M_Mathutils_AngleBetweenVecs_doc},
- {"MidpointVecs", (PyCFunction) M_Mathutils_MidpointVecs, METH_VARARGS, M_Mathutils_MidpointVecs_doc},
- {"VecMultMat", (PyCFunction) M_Mathutils_VecMultMat, METH_VARARGS, M_Mathutils_VecMultMat_doc},
- {"ProjectVecs", (PyCFunction) M_Mathutils_ProjectVecs, METH_VARARGS, M_Mathutils_ProjectVecs_doc},
- {"CopyVec", (PyCFunction) M_Mathutils_CopyVec, METH_VARARGS, M_Mathutils_CopyVec_doc},
- {"Matrix", (PyCFunction) M_Mathutils_Matrix, METH_VARARGS, M_Mathutils_Matrix_doc},
- {"RotationMatrix", (PyCFunction) M_Mathutils_RotationMatrix, METH_VARARGS, M_Mathutils_RotationMatrix_doc},
- {"ScaleMatrix", (PyCFunction) M_Mathutils_ScaleMatrix, METH_VARARGS, M_Mathutils_ScaleMatrix_doc},
- {"ShearMatrix", (PyCFunction) M_Mathutils_ShearMatrix, METH_VARARGS, M_Mathutils_ShearMatrix_doc},
- {"TranslationMatrix", (PyCFunction) M_Mathutils_TranslationMatrix, METH_O, M_Mathutils_TranslationMatrix_doc},
- {"CopyMat", (PyCFunction) M_Mathutils_CopyMat, METH_VARARGS, M_Mathutils_CopyMat_doc},
- {"OrthoProjectionMatrix", (PyCFunction) M_Mathutils_OrthoProjectionMatrix, METH_VARARGS, M_Mathutils_OrthoProjectionMatrix_doc},
- {"MatMultVec", (PyCFunction) M_Mathutils_MatMultVec, METH_VARARGS, M_Mathutils_MatMultVec_doc},
- {"Quaternion", (PyCFunction) M_Mathutils_Quaternion, METH_VARARGS, M_Mathutils_Quaternion_doc},
- {"CopyQuat", (PyCFunction) M_Mathutils_CopyQuat, METH_VARARGS, M_Mathutils_CopyQuat_doc},
- {"CrossQuats", (PyCFunction) M_Mathutils_CrossQuats, METH_VARARGS, M_Mathutils_CrossQuats_doc},
- {"DotQuats", (PyCFunction) M_Mathutils_DotQuats, METH_VARARGS, M_Mathutils_DotQuats_doc},
- {"DifferenceQuats", (PyCFunction) M_Mathutils_DifferenceQuats, METH_VARARGS,M_Mathutils_DifferenceQuats_doc},
- {"Slerp", (PyCFunction) M_Mathutils_Slerp, METH_VARARGS, M_Mathutils_Slerp_doc},
- {"Euler", (PyCFunction) M_Mathutils_Euler, METH_VARARGS, M_Mathutils_Euler_doc},
- {"CopyEuler", (PyCFunction) M_Mathutils_CopyEuler, METH_VARARGS, M_Mathutils_CopyEuler_doc},
- {"RotateEuler", (PyCFunction) M_Mathutils_RotateEuler, METH_VARARGS, M_Mathutils_RotateEuler_doc},
- {"Intersect", ( PyCFunction ) M_Mathutils_Intersect, METH_VARARGS, M_Mathutils_Intersect_doc},
- {"TriangleArea", ( PyCFunction ) M_Mathutils_TriangleArea, METH_VARARGS, M_Mathutils_TriangleArea_doc},
- {"TriangleNormal", ( PyCFunction ) M_Mathutils_TriangleNormal, METH_VARARGS, M_Mathutils_TriangleNormal_doc},
- {"QuadNormal", ( PyCFunction ) M_Mathutils_QuadNormal, METH_VARARGS, M_Mathutils_QuadNormal_doc},
- {"LineIntersect", ( PyCFunction ) M_Mathutils_LineIntersect, METH_VARARGS, M_Mathutils_LineIntersect_doc},
- {"Point", (PyCFunction) M_Mathutils_Point, METH_VARARGS, M_Mathutils_Point_doc},
- {NULL, NULL, 0, NULL}
-};
-/*----------------------------MODULE INIT-------------------------*/
-/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */
-PyObject *Mathutils_Init(const char *from)
-{
- PyObject *submodule;
-
- //seed the generator for the rand function
- BLI_srand((unsigned int) (PIL_check_seconds_timer() *
- 0x7FFFFFFF));
-
- /* needed for getseters */
- if( PyType_Ready( &vector_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &matrix_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &euler_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &quaternion_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
- return (submodule);
-}
-//-----------------------------METHODS----------------------------
-//----------------column_vector_multiplication (internal)---------
-//COLUMN VECTOR Multiplication (Matrix X Vector)
-// [1][2][3] [a]
-// [4][5][6] * [b]
-// [7][8][9] [c]
-//vector/matrix multiplication IS NOT COMMUTATIVE!!!!
-PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec)
-{
- float vecNew[4], vecCopy[4];
- double dot = 0.0f;
- int x, y, z = 0;
-
- if(mat->rowSize != vec->size){
- if(mat->rowSize == 4 && vec->size != 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "matrix * vector: matrix row size and vector size must be the same");
- }else{
- vecCopy[3] = 1.0f;
- }
- }
-
- for(x = 0; x < vec->size; x++){
- vecCopy[x] = vec->vec[x];
- }
-
- for(x = 0; x < mat->rowSize; x++) {
- for(y = 0; y < mat->colSize; y++) {
- dot += mat->matrix[x][y] * vecCopy[y];
- }
- vecNew[z++] = (float)dot;
- dot = 0.0f;
- }
- return newVectorObject(vecNew, vec->size, Py_NEW);
-}
-//This is a helper for point/matrix translation
-
-PyObject *column_point_multiplication(MatrixObject * mat, PointObject* pt)
-{
- float ptNew[4], ptCopy[4];
- double dot = 0.0f;
- int x, y, z = 0;
-
- if(mat->rowSize != pt->size){
- if(mat->rowSize == 4 && pt->size != 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "matrix * point: matrix row size and point size must be the same\n");
- }else{
- ptCopy[3] = 0.0f;
- }
- }
-
- for(x = 0; x < pt->size; x++){
- ptCopy[x] = pt->coord[x];
- }
-
- for(x = 0; x < mat->rowSize; x++) {
- for(y = 0; y < mat->colSize; y++) {
- dot += mat->matrix[x][y] * ptCopy[y];
- }
- ptNew[z++] = (float)dot;
- dot = 0.0f;
- }
- return newPointObject(ptNew, pt->size, Py_NEW);
-}
-//-----------------row_vector_multiplication (internal)-----------
-//ROW VECTOR Multiplication - Vector X Matrix
-//[x][y][z] * [1][2][3]
-// [4][5][6]
-// [7][8][9]
-//vector/matrix multiplication IS NOT COMMUTATIVE!!!!
-PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat)
-{
- float vecNew[4], vecCopy[4];
- double dot = 0.0f;
- int x, y, z = 0, vec_size = vec->size;
-
- if(mat->colSize != vec_size){
- if(mat->rowSize == 4 && vec_size != 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "vector * matrix: matrix column size and the vector size must be the same");
- }else{
- vecCopy[3] = 1.0f;
- }
- }
-
- for(x = 0; x < vec_size; x++){
- vecCopy[x] = vec->vec[x];
- }
-
- //muliplication
- for(x = 0; x < mat->colSize; x++) {
- for(y = 0; y < mat->rowSize; y++) {
- dot += mat->matrix[y][x] * vecCopy[y];
- }
- vecNew[z++] = (float)dot;
- dot = 0.0f;
- }
- return newVectorObject(vecNew, vec_size, Py_NEW);
-}
-//This is a helper for the point class
-PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat)
-{
- float ptNew[4], ptCopy[4];
- double dot = 0.0f;
- int x, y, z = 0, size;
-
- if(mat->colSize != pt->size){
- if(mat->rowSize == 4 && pt->size != 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "point * matrix: matrix column size and the point size must be the same\n");
- }else{
- ptCopy[3] = 0.0f;
- }
- }
- size = pt->size;
- for(x = 0; x < pt->size; x++){
- ptCopy[x] = pt->coord[x];
- }
-
- //muliplication
- for(x = 0; x < mat->colSize; x++) {
- for(y = 0; y < mat->rowSize; y++) {
- dot += mat->matrix[y][x] * ptCopy[y];
- }
- ptNew[z++] = (float)dot;
- dot = 0.0f;
- }
- return newPointObject(ptNew, size, Py_NEW);
-}
-//-----------------quat_rotation (internal)-----------
-//This function multiplies a vector/point * quat or vice versa
-//to rotate the point/vector by the quaternion
-//arguments should all be 3D
-PyObject *quat_rotation(PyObject *arg1, PyObject *arg2)
-{
- float rot[3];
- QuaternionObject *quat = NULL;
- VectorObject *vec = NULL;
- PointObject *pt = NULL;
-
- if(QuaternionObject_Check(arg1)){
- quat = (QuaternionObject*)arg1;
- if(VectorObject_Check(arg2)){
- vec = (VectorObject*)arg2;
- rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] -
- 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] +
- 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] -
- quat->quat[3]*quat->quat[3]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[0];
- rot[1] = 2*quat->quat[1]*quat->quat[2]*vec->vec[0] + quat->quat[2]*quat->quat[2]*vec->vec[1] +
- 2*quat->quat[3]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[3]*vec->vec[0] -
- quat->quat[3]*quat->quat[3]*vec->vec[1] + quat->quat[0]*quat->quat[0]*vec->vec[1] -
- 2*quat->quat[1]*quat->quat[0]*vec->vec[2] - quat->quat[1]*quat->quat[1]*vec->vec[1];
- rot[2] = 2*quat->quat[1]*quat->quat[3]*vec->vec[0] + 2*quat->quat[2]*quat->quat[3]*vec->vec[1] +
- quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] -
- quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] -
- quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2];
- return newVectorObject(rot, 3, Py_NEW);
- }else if(PointObject_Check(arg2)){
- pt = (PointObject*)arg2;
- rot[0] = quat->quat[0]*quat->quat[0]*pt->coord[0] + 2*quat->quat[2]*quat->quat[0]*pt->coord[2] -
- 2*quat->quat[3]*quat->quat[0]*pt->coord[1] + quat->quat[1]*quat->quat[1]*pt->coord[0] +
- 2*quat->quat[2]*quat->quat[1]*pt->coord[1] + 2*quat->quat[3]*quat->quat[1]*pt->coord[2] -
- quat->quat[3]*quat->quat[3]*pt->coord[0] - quat->quat[2]*quat->quat[2]*pt->coord[0];
- rot[1] = 2*quat->quat[1]*quat->quat[2]*pt->coord[0] + quat->quat[2]*quat->quat[2]*pt->coord[1] +
- 2*quat->quat[3]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[3]*pt->coord[0] -
- quat->quat[3]*quat->quat[3]*pt->coord[1] + quat->quat[0]*quat->quat[0]*pt->coord[1] -
- 2*quat->quat[1]*quat->quat[0]*pt->coord[2] - quat->quat[1]*quat->quat[1]*pt->coord[1];
- rot[2] = 2*quat->quat[1]*quat->quat[3]*pt->coord[0] + 2*quat->quat[2]*quat->quat[3]*pt->coord[1] +
- quat->quat[3]*quat->quat[3]*pt->coord[2] - 2*quat->quat[0]*quat->quat[2]*pt->coord[0] -
- quat->quat[2]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[1]*pt->coord[1] -
- quat->quat[1]*quat->quat[1]*pt->coord[2] + quat->quat[0]*quat->quat[0]*pt->coord[2];
- return newPointObject(rot, 3, Py_NEW);
- }
- }else if(VectorObject_Check(arg1)){
- vec = (VectorObject*)arg1;
- if(QuaternionObject_Check(arg2)){
- quat = (QuaternionObject*)arg2;
- rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] -
- 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] +
- 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] -
- quat->quat[3]*quat->quat[3]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[0];
- rot[1] = 2*quat->quat[1]*quat->quat[2]*vec->vec[0] + quat->quat[2]*quat->quat[2]*vec->vec[1] +
- 2*quat->quat[3]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[3]*vec->vec[0] -
- quat->quat[3]*quat->quat[3]*vec->vec[1] + quat->quat[0]*quat->quat[0]*vec->vec[1] -
- 2*quat->quat[1]*quat->quat[0]*vec->vec[2] - quat->quat[1]*quat->quat[1]*vec->vec[1];
- rot[2] = 2*quat->quat[1]*quat->quat[3]*vec->vec[0] + 2*quat->quat[2]*quat->quat[3]*vec->vec[1] +
- quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] -
- quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] -
- quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2];
- return newVectorObject(rot, 3, Py_NEW);
- }
- }else if(PointObject_Check(arg1)){
- pt = (PointObject*)arg1;
- if(QuaternionObject_Check(arg2)){
- quat = (QuaternionObject*)arg2;
- rot[0] = quat->quat[0]*quat->quat[0]*pt->coord[0] + 2*quat->quat[2]*quat->quat[0]*pt->coord[2] -
- 2*quat->quat[3]*quat->quat[0]*pt->coord[1] + quat->quat[1]*quat->quat[1]*pt->coord[0] +
- 2*quat->quat[2]*quat->quat[1]*pt->coord[1] + 2*quat->quat[3]*quat->quat[1]*pt->coord[2] -
- quat->quat[3]*quat->quat[3]*pt->coord[0] - quat->quat[2]*quat->quat[2]*pt->coord[0];
- rot[1] = 2*quat->quat[1]*quat->quat[2]*pt->coord[0] + quat->quat[2]*quat->quat[2]*pt->coord[1] +
- 2*quat->quat[3]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[3]*pt->coord[0] -
- quat->quat[3]*quat->quat[3]*pt->coord[1] + quat->quat[0]*quat->quat[0]*pt->coord[1] -
- 2*quat->quat[1]*quat->quat[0]*pt->coord[2] - quat->quat[1]*quat->quat[1]*pt->coord[1];
- rot[2] = 2*quat->quat[1]*quat->quat[3]*pt->coord[0] + 2*quat->quat[2]*quat->quat[3]*pt->coord[1] +
- quat->quat[3]*quat->quat[3]*pt->coord[2] - 2*quat->quat[0]*quat->quat[2]*pt->coord[0] -
- quat->quat[2]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[1]*pt->coord[1] -
- quat->quat[1]*quat->quat[1]*pt->coord[2] + quat->quat[0]*quat->quat[0]*pt->coord[2];
- return newPointObject(rot, 3, Py_NEW);
- }
- }
-
- return (EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "quat_rotation(internal): internal problem rotating vector/point\n"));
-}
-
-//----------------------------------Mathutils.Rand() --------------------
-//returns a random number between a high and low value
-PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args)
-{
- float high, low, range;
- double rand;
- //initializers
- high = 1.0;
- low = 0.0;
-
- if(!PyArg_ParseTuple(args, "|ff", &low, &high))
- return (EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Rand(): expected nothing or optional (float, float)\n"));
-
- if((high < low) || (high < 0 && low > 0))
- return (EXPP_ReturnPyObjError(PyExc_ValueError,
- "Mathutils.Rand(): high value should be larger than low value\n"));
-
- //get the random number 0 - 1
- rand = BLI_drand();
-
- //set it to range
- range = high - low;
- rand = rand * range;
- rand = rand + low;
-
- return PyFloat_FromDouble(rand);
-}
-//----------------------------------VECTOR FUNCTIONS---------------------
-//----------------------------------Mathutils.Vector() ------------------
-// Supports 2D, 3D, and 4D vector objects both int and float values
-// accepted. Mixed float and int values accepted. Ints are parsed to float
-PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args)
-{
- PyObject *listObject = NULL;
- int size, i;
- float vec[4];
- PyObject *v, *f;
-
- size = PySequence_Length(args);
- if (size == 1) {
- listObject = PySequence_GetItem(args, 0);
- if (PySequence_Check(listObject)) {
- size = PySequence_Length(listObject);
- } else { // Single argument was not a sequence
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n");
- }
- } else if (size == 0) {
- //returns a new empty 3d vector
- return newVectorObject(NULL, 3, Py_NEW);
- } else {
- listObject = EXPP_incr_ret(args);
- }
-
- if (size<2 || size>4) { // Invalid vector size
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n");
- }
-
- for (i=0; i<size; i++) {
- v=PySequence_GetItem(listObject, i);
- if (v==NULL) { // Failed to read sequence
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n");
- }
-
- f=PyNumber_Float(v);
- if(f==NULL) { // parsed item not a number
- Py_DECREF(v);
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n");
- }
-
- vec[i]=(float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,v);
- }
- Py_DECREF(listObject);
- return newVectorObject(vec, size, Py_NEW);
-}
-//----------------------------------Mathutils.CrossVecs() ---------------
-//finds perpendicular vector - only 3D is supported
-PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args)
-{
- PyObject *vecCross = NULL;
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.CrossVecs(): expects (2) 3D vector objects\n");
- if(vec1->size != 3 || vec2->size != 3)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.CrossVecs(): expects (2) 3D vector objects\n");
-
- vecCross = newVectorObject(NULL, 3, Py_NEW);
- Crossf(((VectorObject*)vecCross)->vec, vec1->vec, vec2->vec);
- return vecCross;
-}
-//----------------------------------Mathutils.DotVec() -------------------
-//calculates the dot product of two vectors
-PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args)
-{
- VectorObject *vec1 = NULL, *vec2 = NULL;
- double dot = 0.0f;
- int x;
-
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.DotVecs(): expects (2) vector objects of the same size\n");
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.DotVecs(): expects (2) vector objects of the same size\n");
-
- for(x = 0; x < vec1->size; x++) {
- dot += vec1->vec[x] * vec2->vec[x];
- }
- return PyFloat_FromDouble(dot);
-}
-//----------------------------------Mathutils.AngleBetweenVecs() ---------
-//calculates the angle between 2 vectors
-PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args)
-{
- VectorObject *vec1 = NULL, *vec2 = NULL;
- double dot = 0.0f, angleRads, test_v1 = 0.0f, test_v2 = 0.0f;
- int x, size;
-
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2))
- goto AttributeError1; //not vectors
- if(vec1->size != vec2->size)
- goto AttributeError1; //bad sizes
-
- //since size is the same....
- size = vec1->size;
-
- for(x = 0; x < size; x++) {
- test_v1 += vec1->vec[x] * vec1->vec[x];
- test_v2 += vec2->vec[x] * vec2->vec[x];
- }
- if (!test_v1 || !test_v2){
- goto AttributeError2; //zero-length vector
- }
-
- //dot product
- for(x = 0; x < size; x++) {
- dot += vec1->vec[x] * vec2->vec[x];
- }
- dot /= (sqrt(test_v1) * sqrt(test_v2));
-
- angleRads = (double)saacos(dot);
-
- return PyFloat_FromDouble(angleRads * (180/ Py_PI));
-
-AttributeError1:
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.AngleBetweenVecs(): expects (2) VECTOR objects of the same size\n");
-
-AttributeError2:
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.AngleBetweenVecs(): zero length vectors are not acceptable arguments\n");
-}
-//----------------------------------Mathutils.MidpointVecs() -------------
-//calculates the midpoint between 2 vectors
-PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args)
-{
- VectorObject *vec1 = NULL, *vec2 = NULL;
- float vec[4];
- int x;
-
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n");
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n");
-
- for(x = 0; x < vec1->size; x++) {
- vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]);
- }
- return newVectorObject(vec, vec1->size, Py_NEW);
-}
-//----------------------------------Mathutils.ProjectVecs() -------------
-//projects vector 1 onto vector 2
-PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args)
-{
- VectorObject *vec1 = NULL, *vec2 = NULL;
- float vec[4];
- double dot = 0.0f, dot2 = 0.0f;
- int x, size;
-
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n");
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n");
-
- //since they are the same size...
- size = vec1->size;
-
- //get dot products
- for(x = 0; x < size; x++) {
- dot += vec1->vec[x] * vec2->vec[x];
- dot2 += vec2->vec[x] * vec2->vec[x];
- }
- //projection
- dot /= dot2;
- for(x = 0; x < size; x++) {
- vec[x] = (float)(dot * vec2->vec[x]);
- }
- return newVectorObject(vec, size, Py_NEW);
-}
-//----------------------------------MATRIX FUNCTIONS--------------------
-//----------------------------------Mathutils.Matrix() -----------------
-//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc.
-//create a new matrix type
-PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args)
-{
- PyObject *listObject = NULL;
- PyObject *argObject, *m, *s, *f;
- MatrixObject *mat;
- int argSize, seqSize = 0, i, j;
- float matrix[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};
-
- argSize = PySequence_Length(args);
- if(argSize > 4){ //bad arg nums
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
- } else if (argSize == 0) { //return empty 4D matrix
- return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW);
- }else if (argSize == 1){
- //copy constructor for matrix objects
- argObject = PySequence_GetItem(args, 0);
- if(MatrixObject_Check(argObject)){
- mat = (MatrixObject*)argObject;
-
- argSize = mat->rowSize; //rows
- seqSize = mat->colSize; //col
- for(i = 0; i < (seqSize * argSize); i++){
- matrix[i] = mat->contigPtr[i];
- }
- }
- Py_DECREF(argObject);
- }else{ //2-4 arguments (all seqs? all same size?)
- for(i =0; i < argSize; i++){
- argObject = PySequence_GetItem(args, i);
- if (PySequence_Check(argObject)) { //seq?
- if(seqSize){ //0 at first
- if(PySequence_Length(argObject) != seqSize){ //seq size not same
- Py_DECREF(argObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
- }
- }
- seqSize = PySequence_Length(argObject);
- }else{ //arg not a sequence
- Py_XDECREF(argObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
- }
- Py_DECREF(argObject);
- }
- //all is well... let's continue parsing
- listObject = args;
- for (i = 0; i < argSize; i++){
- m = PySequence_GetItem(listObject, i);
- if (m == NULL) { // Failed to read sequence
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Matrix(): failed to parse arguments...\n");
- }
-
- for (j = 0; j < seqSize; j++) {
- s = PySequence_GetItem(m, j);
- if (s == NULL) { // Failed to read sequence
- Py_DECREF(m);
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Matrix(): failed to parse arguments...\n");
- }
-
- f = PyNumber_Float(s);
- if(f == NULL) { // parsed item is not a number
- EXPP_decr2(m,s);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
- }
-
- matrix[(seqSize*i)+j]=(float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,s);
- }
- Py_DECREF(m);
- }
- }
- return newMatrixObject(matrix, argSize, seqSize, Py_NEW);
-}
-//----------------------------------Mathutils.RotationMatrix() ----------
-//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc.
-//creates a rotation matrix
-PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args)
-{
- VectorObject *vec = NULL;
- char *axis = NULL;
- int matSize;
- float angle = 0.0f, norm = 0.0f, cosAngle = 0.0f, sinAngle = 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};
-
- if(!PyArg_ParseTuple
- (args, "fi|sO!", &angle, &matSize, &axis, &vector_Type, &vec)) {
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "Mathutils.RotationMatrix(): expected float int and optional string and vector\n");
- }
-
- /* Clamp to -360:360 */
- while (angle<-360.0f)
- angle+=360.0;
- while (angle>360.0f)
- angle-=360.0;
-
- if(matSize != 2 && matSize != 3 && matSize != 4)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");
- if(matSize == 2 && (axis != NULL || vec != NULL))
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n");
- if((matSize == 3 || matSize == 4) && axis == NULL)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n");
- if(axis) {
- if(((strcmp(axis, "r") == 0) ||
- (strcmp(axis, "R") == 0)) && vec == NULL)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): please define the arbitrary axis of rotation\n");
- }
- if(vec) {
- if(vec->size != 3)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): the arbitrary axis must be a 3D vector\n");
- }
- //convert to radians
- angle = angle * (float) (Py_PI / 180);
- if(axis == NULL && matSize == 2) {
- //2D rotation matrix
- mat[0] = (float) cos (angle);
- mat[1] = (float) sin (angle);
- mat[2] = -((float) sin(angle));
- mat[3] = (float) cos(angle);
- } else if((strcmp(axis, "x") == 0) || (strcmp(axis, "X") == 0)) {
- //rotation around X
- mat[0] = 1.0f;
- mat[4] = (float) cos(angle);
- mat[5] = (float) sin(angle);
- mat[7] = -((float) sin(angle));
- mat[8] = (float) cos(angle);
- } else if((strcmp(axis, "y") == 0) || (strcmp(axis, "Y") == 0)) {
- //rotation around Y
- mat[0] = (float) cos(angle);
- mat[2] = -((float) sin(angle));
- mat[4] = 1.0f;
- mat[6] = (float) sin(angle);
- mat[8] = (float) cos(angle);
- } else if((strcmp(axis, "z") == 0) || (strcmp(axis, "Z") == 0)) {
- //rotation around Z
- mat[0] = (float) cos(angle);
- mat[1] = (float) sin(angle);
- mat[3] = -((float) sin(angle));
- mat[4] = (float) cos(angle);
- mat[8] = 1.0f;
- } else if((strcmp(axis, "r") == 0) || (strcmp(axis, "R") == 0)) {
- //arbitrary rotation
- //normalize arbitrary axis
- norm = (float) sqrt(vec->vec[0] * vec->vec[0] +
- vec->vec[1] * vec->vec[1] +
- vec->vec[2] * vec->vec[2]);
- vec->vec[0] /= norm;
- vec->vec[1] /= norm;
- vec->vec[2] /= norm;
-
- if (isnan(vec->vec[0]) || isnan(vec->vec[1]) || isnan(vec->vec[2])) {
- /* zero length vector, return an identity matrix, could also return an error */
- mat[0]= mat[4] = mat[8] = 1.0f;
- } else {
- /* create matrix */
- cosAngle = (float) cos(angle);
- sinAngle = (float) sin(angle);
- mat[0] = ((vec->vec[0] * vec->vec[0]) * (1 - cosAngle)) +
- cosAngle;
- mat[1] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) +
- (vec->vec[2] * sinAngle);
- mat[2] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) -
- (vec->vec[1] * sinAngle);
- mat[3] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) -
- (vec->vec[2] * sinAngle);
- mat[4] = ((vec->vec[1] * vec->vec[1]) * (1 - cosAngle)) +
- cosAngle;
- mat[5] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) +
- (vec->vec[0] * sinAngle);
- mat[6] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) +
- (vec->vec[1] * sinAngle);
- mat[7] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) -
- (vec->vec[0] * sinAngle);
- mat[8] = ((vec->vec[2] * vec->vec[2]) * (1 - cosAngle)) +
- cosAngle;
- }
- } else {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.RotationMatrix(): unrecognizable axis of rotation type - expected x,y,z or r\n");
- }
- if(matSize == 4) {
- //resize matrix
- mat[10] = mat[8];
- mat[9] = mat[7];
- mat[8] = mat[6];
- mat[7] = 0.0f;
- mat[6] = mat[5];
- mat[5] = mat[4];
- mat[4] = mat[3];
- mat[3] = 0.0f;
- }
- //pass to matrix creation
- return newMatrixObject(mat, matSize, matSize, Py_NEW);
-}
-//----------------------------------Mathutils.TranslationMatrix() -------
-//creates a translation matrix
-PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec)
-{
- 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(!VectorObject_Check(vec)) {
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.TranslationMatrix(): expected vector\n");
- }
- if(vec->size != 3 && vec->size != 4) {
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.TranslationMatrix(): vector must be 3D or 4D\n");
- }
- //create a identity matrix and add translation
- Mat4One((float(*)[4]) mat);
- mat[12] = vec->vec[0];
- mat[13] = vec->vec[1];
- mat[14] = vec->vec[2];
-
- return newMatrixObject(mat, 4, 4, Py_NEW);
-}
-//----------------------------------Mathutils.ScaleMatrix() -------------
-//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc.
-//creates a scaling matrix
-PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args)
-{
- VectorObject *vec = NULL;
- float norm = 0.0f, factor;
- int matSize, x;
- 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(!PyArg_ParseTuple
- (args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) {
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.ScaleMatrix(): expected float int and optional vector\n");
- }
- if(matSize != 2 && matSize != 3 && matSize != 4)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");
- if(vec) {
- if(vec->size > 2 && matSize == 2)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n");
- }
- if(vec == NULL) { //scaling along axis
- if(matSize == 2) {
- mat[0] = factor;
- mat[3] = factor;
- } else {
- mat[0] = factor;
- mat[4] = factor;
- mat[8] = factor;
- }
- } else { //scaling in arbitrary direction
- //normalize arbitrary axis
- for(x = 0; x < vec->size; x++) {
- norm += vec->vec[x] * vec->vec[x];
- }
- norm = (float) sqrt(norm);
- for(x = 0; x < vec->size; x++) {
- vec->vec[x] /= norm;
- }
- if(matSize == 2) {
- mat[0] = 1 +((factor - 1) *(vec->vec[0] * vec->vec[0]));
- mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1]));
- mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[1]));
- mat[3] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1]));
- } else {
- mat[0] = 1 + ((factor - 1) *(vec->vec[0] * vec->vec[0]));
- mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1]));
- mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[2]));
- mat[3] =((factor - 1) *(vec->vec[0] * vec->vec[1]));
- mat[4] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1]));
- mat[5] =((factor - 1) *(vec->vec[1] * vec->vec[2]));
- mat[6] =((factor - 1) *(vec->vec[0] * vec->vec[2]));
- mat[7] =((factor - 1) *(vec->vec[1] * vec->vec[2]));
- mat[8] = 1 + ((factor - 1) *(vec->vec[2] * vec->vec[2]));
- }
- }
- if(matSize == 4) {
- //resize matrix
- mat[10] = mat[8];
- mat[9] = mat[7];
- mat[8] = mat[6];
- mat[7] = 0.0f;
- mat[6] = mat[5];
- mat[5] = mat[4];
- mat[4] = mat[3];
- mat[3] = 0.0f;
- }
- //pass to matrix creation
- return newMatrixObject(mat, matSize, matSize, Py_NEW);
-}
-//----------------------------------Mathutils.OrthoProjectionMatrix() ---
-//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc.
-//creates an ortho projection matrix
-PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args)
-{
- VectorObject *vec = NULL;
- char *plane;
- int matSize, x;
- float norm = 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};
-
- if(!PyArg_ParseTuple
- (args, "si|O!", &plane, &matSize, &vector_Type, &vec)) {
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n");
- }
- if(matSize != 2 && matSize != 3 && matSize != 4)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");
- if(vec) {
- if(vec->size > 2 && matSize == 2)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n");
- }
- if(vec == NULL) { //ortho projection onto cardinal plane
- if(((strcmp(plane, "x") == 0)
- || (strcmp(plane, "X") == 0)) && matSize == 2) {
- mat[0] = 1.0f;
- } else if(((strcmp(plane, "y") == 0)
- || (strcmp(plane, "Y") == 0))
- && matSize == 2) {
- mat[3] = 1.0f;
- } else if(((strcmp(plane, "xy") == 0)
- || (strcmp(plane, "XY") == 0))
- && matSize > 2) {
- mat[0] = 1.0f;
- mat[4] = 1.0f;
- } else if(((strcmp(plane, "xz") == 0)
- || (strcmp(plane, "XZ") == 0))
- && matSize > 2) {
- mat[0] = 1.0f;
- mat[8] = 1.0f;
- } else if(((strcmp(plane, "yz") == 0)
- || (strcmp(plane, "YZ") == 0))
- && matSize > 2) {
- mat[4] = 1.0f;
- mat[8] = 1.0f;
- } else {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: x, y, xy, xz, yz\n");
- }
- } else { //arbitrary plane
- //normalize arbitrary axis
- for(x = 0; x < vec->size; x++) {
- norm += vec->vec[x] * vec->vec[x];
- }
- norm = (float) sqrt(norm);
- for(x = 0; x < vec->size; x++) {
- vec->vec[x] /= norm;
- }
- if(((strcmp(plane, "r") == 0)
- || (strcmp(plane, "R") == 0)) && matSize == 2) {
- mat[0] = 1 - (vec->vec[0] * vec->vec[0]);
- mat[1] = -(vec->vec[0] * vec->vec[1]);
- mat[2] = -(vec->vec[0] * vec->vec[1]);
- mat[3] = 1 - (vec->vec[1] * vec->vec[1]);
- } else if(((strcmp(plane, "r") == 0)
- || (strcmp(plane, "R") == 0))
- && matSize > 2) {
- mat[0] = 1 - (vec->vec[0] * vec->vec[0]);
- mat[1] = -(vec->vec[0] * vec->vec[1]);
- mat[2] = -(vec->vec[0] * vec->vec[2]);
- mat[3] = -(vec->vec[0] * vec->vec[1]);
- mat[4] = 1 - (vec->vec[1] * vec->vec[1]);
- mat[5] = -(vec->vec[1] * vec->vec[2]);
- mat[6] = -(vec->vec[0] * vec->vec[2]);
- mat[7] = -(vec->vec[1] * vec->vec[2]);
- mat[8] = 1 - (vec->vec[2] * vec->vec[2]);
- } else {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n");
- }
- }
- if(matSize == 4) {
- //resize matrix
- mat[10] = mat[8];
- mat[9] = mat[7];
- mat[8] = mat[6];
- mat[7] = 0.0f;
- mat[6] = mat[5];
- mat[5] = mat[4];
- mat[4] = mat[3];
- mat[3] = 0.0f;
- }
- //pass to matrix creation
- return newMatrixObject(mat, matSize, matSize, Py_NEW);
-}
-//----------------------------------Mathutils.ShearMatrix() -------------
-//creates a shear matrix
-PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args)
-{
- int matSize;
- char *plane;
- float factor;
- 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(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) {
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.ShearMatrix(): expected string float and int\n");
- }
- if(matSize != 2 && matSize != 3 && matSize != 4)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n");
-
- if(((strcmp(plane, "x") == 0) || (strcmp(plane, "X") == 0))
- && matSize == 2) {
- mat[0] = 1.0f;
- mat[2] = factor;
- mat[3] = 1.0f;
- } else if(((strcmp(plane, "y") == 0)
- || (strcmp(plane, "Y") == 0)) && matSize == 2) {
- mat[0] = 1.0f;
- mat[1] = factor;
- mat[3] = 1.0f;
- } else if(((strcmp(plane, "xy") == 0)
- || (strcmp(plane, "XY") == 0)) && matSize > 2) {
- mat[0] = 1.0f;
- mat[4] = 1.0f;
- mat[6] = factor;
- mat[7] = factor;
- } else if(((strcmp(plane, "xz") == 0)
- || (strcmp(plane, "XZ") == 0)) && matSize > 2) {
- mat[0] = 1.0f;
- mat[3] = factor;
- mat[4] = 1.0f;
- mat[5] = factor;
- mat[8] = 1.0f;
- } else if(((strcmp(plane, "yz") == 0)
- || (strcmp(plane, "YZ") == 0)) && matSize > 2) {
- mat[0] = 1.0f;
- mat[1] = factor;
- mat[2] = factor;
- mat[4] = 1.0f;
- mat[8] = 1.0f;
- } else {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n");
- }
- if(matSize == 4) {
- //resize matrix
- mat[10] = mat[8];
- mat[9] = mat[7];
- mat[8] = mat[6];
- mat[7] = 0.0f;
- mat[6] = mat[5];
- mat[5] = mat[4];
- mat[4] = mat[3];
- mat[3] = 0.0f;
- }
- //pass to matrix creation
- return newMatrixObject(mat, matSize, matSize, Py_NEW);
-}
-//----------------------------------QUATERNION FUNCTIONS-----------------
-//----------------------------------Mathutils.Quaternion() --------------
-PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args)
-{
- PyObject *listObject = NULL, *n, *q, *f;
- int size, i;
- float quat[4];
- double norm = 0.0f, angle = 0.0f;
-
- size = PySequence_Length(args);
- if (size == 1 || size == 2) { //seq?
- listObject = PySequence_GetItem(args, 0);
- if (PySequence_Check(listObject)) {
- size = PySequence_Length(listObject);
- if ((size == 4 && PySequence_Length(args) !=1) ||
- (size == 3 && PySequence_Length(args) !=2) || (size >4 || size < 3)) {
- // invalid args/size
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- if(size == 3){ //get angle in axis/angle
- n = PyNumber_Float(PySequence_GetItem(args, 1));
- if(n == NULL) { // parsed item not a number or getItem fail
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- angle = PyFloat_AS_DOUBLE(n);
- Py_DECREF(n);
- }
- }else{
- listObject = PySequence_GetItem(args, 1);
- if (size>1 && PySequence_Check(listObject)) {
- size = PySequence_Length(listObject);
- if (size != 3) {
- // invalid args/size
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- n = PyNumber_Float(PySequence_GetItem(args, 0));
- if(n == NULL) { // parsed item not a number or getItem fail
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- angle = PyFloat_AS_DOUBLE(n);
- Py_DECREF(n);
- } else { // argument was not a sequence
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- }
- } else if (size == 0) { //returns a new empty quat
- return newQuaternionObject(NULL, Py_NEW);
- } else {
- listObject = EXPP_incr_ret(args);
- }
-
- if (size == 3) { // invalid quat size
- if(PySequence_Length(args) != 2){
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- }else{
- if(size != 4){
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
- }
-
- for (i=0; i<size; i++) { //parse
- q = PySequence_GetItem(listObject, i);
- if (q == NULL) { // Failed to read sequence
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
-
- f = PyNumber_Float(q);
- if(f == NULL) { // parsed item not a number
- EXPP_decr2(q, listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n");
- }
-
- quat[i] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f, q);
- }
- if(size == 3){ //calculate the quat based on axis/angle
- norm = sqrt(quat[0] * quat[0] + quat[1] * quat[1] + quat[2] * quat[2]);
- quat[0] /= (float)norm;
- quat[1] /= (float)norm;
- quat[2] /= (float)norm;
-
- angle = angle * (Py_PI / 180);
- quat[3] =(float) (sin(angle/ 2.0f)) * quat[2];
- quat[2] =(float) (sin(angle/ 2.0f)) * quat[1];
- quat[1] =(float) (sin(angle/ 2.0f)) * quat[0];
- quat[0] =(float) (cos(angle/ 2.0f));
- }
-
- Py_DECREF(listObject);
- return newQuaternionObject(quat, Py_NEW);
-}
-//----------------------------------Mathutils.CrossQuats() ----------------
-//quaternion multiplication - associate not commutative
-PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args)
-{
- QuaternionObject *quatU = NULL, *quatV = NULL;
- float quat[4];
-
- if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU,
- &quaternion_Type, &quatV))
- return EXPP_ReturnPyObjError(PyExc_TypeError,"Mathutils.CrossQuats(): expected Quaternion types");
- QuatMul(quat, quatU->quat, quatV->quat);
-
- return newQuaternionObject(quat, Py_NEW);
-}
-//----------------------------------Mathutils.DotQuats() ----------------
-//returns the dot product of 2 quaternions
-PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args)
-{
- QuaternionObject *quatU = NULL, *quatV = NULL;
- double dot = 0.0f;
- int x;
-
- if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU,
- &quaternion_Type, &quatV))
- return EXPP_ReturnPyObjError(PyExc_TypeError, "Mathutils.DotQuats(): expected Quaternion types");
-
- for(x = 0; x < 4; x++) {
- dot += quatU->quat[x] * quatV->quat[x];
- }
- return PyFloat_FromDouble(dot);
-}
-//----------------------------------Mathutils.DifferenceQuats() ---------
-//returns the difference between 2 quaternions
-PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args)
-{
- QuaternionObject *quatU = NULL, *quatV = NULL;
- float quat[4], tempQuat[4];
- double dot = 0.0f;
- int x;
-
- if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type,
- &quatU, &quaternion_Type, &quatV))
- return EXPP_ReturnPyObjError(PyExc_TypeError, "Mathutils.DifferenceQuats(): expected Quaternion types");
-
- tempQuat[0] = quatU->quat[0];
- tempQuat[1] = -quatU->quat[1];
- tempQuat[2] = -quatU->quat[2];
- tempQuat[3] = -quatU->quat[3];
-
- dot = sqrt(tempQuat[0] * tempQuat[0] + tempQuat[1] * tempQuat[1] +
- tempQuat[2] * tempQuat[2] + tempQuat[3] * tempQuat[3]);
-
- for(x = 0; x < 4; x++) {
- tempQuat[x] /= (float)(dot * dot);
- }
- QuatMul(quat, tempQuat, quatV->quat);
- return newQuaternionObject(quat, Py_NEW);
-}
-//----------------------------------Mathutils.Slerp() ------------------
-//attemps to interpolate 2 quaternions and return the result
-PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args)
-{
- QuaternionObject *quatU = NULL, *quatV = NULL;
- float quat[4], quat_u[4], quat_v[4], param;
- double x, y, dot, sinT, angle, IsinT;
- int z;
-
- if(!PyArg_ParseTuple(args, "O!O!f", &quaternion_Type,
- &quatU, &quaternion_Type, &quatV, &param))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Slerp(): expected Quaternion types and float");
-
- if(param > 1.0f || param < 0.0f)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Slerp(): interpolation factor must be between 0.0 and 1.0");
-
- //copy quats
- for(z = 0; z < 4; z++){
- quat_u[z] = quatU->quat[z];
- quat_v[z] = quatV->quat[z];
- }
-
- //dot product
- dot = quat_u[0] * quat_v[0] + quat_u[1] * quat_v[1] +
- quat_u[2] * quat_v[2] + quat_u[3] * quat_v[3];
-
- //if negative negate a quat (shortest arc)
- if(dot < 0.0f) {
- quat_v[0] = -quat_v[0];
- quat_v[1] = -quat_v[1];
- quat_v[2] = -quat_v[2];
- quat_v[3] = -quat_v[3];
- dot = -dot;
- }
- if(dot > .99999f) { //very close
- x = 1.0f - param;
- y = param;
- } else {
- //calculate sin of angle
- sinT = sqrt(1.0f - (dot * dot));
- //calculate angle
- angle = atan2(sinT, dot);
- //caluculate inverse of sin(theta)
- IsinT = 1.0f / sinT;
- x = sin((1.0f - param) * angle) * IsinT;
- y = sin(param * angle) * IsinT;
- }
- //interpolate
- quat[0] = (float)(quat_u[0] * x + quat_v[0] * y);
- quat[1] = (float)(quat_u[1] * x + quat_v[1] * y);
- quat[2] = (float)(quat_u[2] * x + quat_v[2] * y);
- quat[3] = (float)(quat_u[3] * x + quat_v[3] * y);
-
- return newQuaternionObject(quat, Py_NEW);
-}
-//----------------------------------EULER FUNCTIONS----------------------
-//----------------------------------Mathutils.Euler() -------------------
-//makes a new euler for you to play with
-PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args)
-{
-
- PyObject *listObject = NULL;
- int size, i;
- float eul[3];
- PyObject *e, *f;
-
- size = PySequence_Length(args);
- if (size == 1) {
- listObject = PySequence_GetItem(args, 0);
- if (PySequence_Check(listObject)) {
- size = PySequence_Length(listObject);
- } else { // Single argument was not a sequence
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Euler(): 3d numeric sequence expected\n");
- }
- } else if (size == 0) {
- //returns a new empty 3d euler
- return newEulerObject(NULL, Py_NEW);
- } else {
- listObject = EXPP_incr_ret(args);
- }
-
- if (size != 3) { // Invalid euler size
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Euler(): 3d numeric sequence expected\n");
- }
-
- for (i=0; i<size; i++) {
- e = PySequence_GetItem(listObject, i);
- if (e == NULL) { // Failed to read sequence
- Py_DECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Euler(): 3d numeric sequence expected\n");
- }
-
- f = PyNumber_Float(e);
- if(f == NULL) { // parsed item not a number
- EXPP_decr2(e, listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Euler(): 3d numeric sequence expected\n");
- }
-
- eul[i]=(float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,e);
- }
- Py_DECREF(listObject);
- return newEulerObject(eul, Py_NEW);
-}
-//----------------------------------POINT FUNCTIONS---------------------
-//----------------------------------Mathutils.Point() ------------------
-PyObject *M_Mathutils_Point(PyObject * self, PyObject * args)
-{
- PyObject *listObject = NULL;
- int size, i;
- float point[3];
- PyObject *v, *f;
-
- size = PySequence_Length(args);
- if (size == 1) {
- listObject = PySequence_GetItem(args, 0);
- if (PySequence_Check(listObject)) {
- size = PySequence_Length(listObject);
- } else { // Single argument was not a sequence
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n");
- }
- } else if (size == 0) {
- //returns a new empty 3d point
- return newPointObject(NULL, 3, Py_NEW);
- } else {
- listObject = EXPP_incr_ret(args);
- }
-
- if (size<2 || size>3) { // Invalid vector size
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n");
- }
-
- for (i=0; i<size; i++) {
- v=PySequence_GetItem(listObject, i);
- if (v==NULL) { // Failed to read sequence
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n");
- }
-
- f=PyNumber_Float(v);
- if(f==NULL) { // parsed item not a number
- Py_DECREF(v);
- Py_XDECREF(listObject);
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n");
- }
-
- point[i]=(float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,v);
- }
- Py_DECREF(listObject);
- return newPointObject(point, size, Py_NEW);
-}
-//---------------------------------INTERSECTION FUNCTIONS--------------------
-//----------------------------------Mathutils.Intersect() -------------------
-PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args )
-{
- VectorObject *ray, *ray_off, *vec1, *vec2, *vec3;
- float dir[3], orig[3], v1[3], v2[3], v3[3], e1[3], e2[3], pvec[3], tvec[3], qvec[3];
- float det, inv_det, u, v, t;
- int clip = 1;
-
- if( !PyArg_ParseTuple
- ( args, "O!O!O!O!O!|i", &vector_Type, &vec1, &vector_Type, &vec2
- , &vector_Type, &vec3, &vector_Type, &ray, &vector_Type, &ray_off , &clip) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 5 vector types\n" ) );
- if( vec1->size != 3 || vec2->size != 3 || vec3->size != 3 ||
- ray->size != 3 || ray_off->size != 3)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "only 3D vectors for all parameters\n" ) );
-
- VECCOPY(v1, vec1->vec);
- VECCOPY(v2, vec2->vec);
- VECCOPY(v3, vec3->vec);
-
- VECCOPY(dir, ray->vec);
- Normalize(dir);
-
- VECCOPY(orig, ray_off->vec);
-
- /* find vectors for two edges sharing v1 */
- VecSubf(e1, v2, v1);
- VecSubf(e2, v3, v1);
-
- /* begin calculating determinant - also used to calculated U parameter */
- Crossf(pvec, dir, e2);
-
- /* if determinant is near zero, ray lies in plane of triangle */
- det = Inpf(e1, pvec);
-
- if (det > -0.000001 && det < 0.000001) {
- return EXPP_incr_ret( Py_None );
- }
-
- inv_det = 1.0f / det;
-
- /* calculate distance from v1 to ray origin */
- VecSubf(tvec, orig, v1);
-
- /* calculate U parameter and test bounds */
- u = Inpf(tvec, pvec) * inv_det;
- if (clip && (u < 0.0f || u > 1.0f)) {
- return EXPP_incr_ret( Py_None );
- }
-
- /* prepare to test the V parameter */
- Crossf(qvec, tvec, e1);
-
- /* calculate V parameter and test bounds */
- v = Inpf(dir, qvec) * inv_det;
-
- if (clip && (v < 0.0f || u + v > 1.0f)) {
- return EXPP_incr_ret( Py_None );
- }
-
- /* calculate t, ray intersects triangle */
- t = Inpf(e2, qvec) * inv_det;
-
- VecMulf(dir, t);
- VecAddf(pvec, orig, dir);
-
- return newVectorObject(pvec, 3, Py_NEW);
-}
-//----------------------------------Mathutils.LineIntersect() -------------------
-/* Line-Line intersection using algorithm from mathworld.wolfram.com */
-PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args )
-{
- PyObject * tuple;
- 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!", &vector_Type, &vec1, &vector_Type, &vec2
- , &vector_Type, &vec3, &vector_Type, &vec4 ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 4 vector types\n" ) );
- if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec2->size)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "vectors must be of the same size\n" ) );
-
- if( vec1->size == 3 || vec1->size == 2) {
- int result;
-
- if (vec1->size == 3) {
- VECCOPY(v1, vec1->vec);
- VECCOPY(v2, vec2->vec);
- VECCOPY(v3, vec3->vec);
- VECCOPY(v4, vec4->vec);
- }
- else {
- v1[0] = vec1->vec[0];
- v1[1] = vec1->vec[1];
- v1[2] = 0.0f;
-
- v2[0] = vec2->vec[0];
- v2[1] = vec2->vec[1];
- v2[2] = 0.0f;
-
- v3[0] = vec3->vec[0];
- v3[1] = vec3->vec[1];
- v3[2] = 0.0f;
-
- v4[0] = vec4->vec[0];
- v4[1] = vec4->vec[1];
- v4[2] = 0.0f;
- }
-
- result = LineIntersectLine(v1, v2, v3, v4, i1, i2);
-
- if (result == 0) {
- /* colinear */
- return EXPP_incr_ret( Py_None );
- }
- else {
- tuple = PyTuple_New( 2 );
- PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) );
- PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) );
- return tuple;
- }
- }
- else {
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "2D/3D vectors only\n" ) );
- }
-}
-
-
-
-//---------------------------------NORMALS FUNCTIONS--------------------
-//----------------------------------Mathutils.QuadNormal() -------------------
-PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args )
-{
- VectorObject *vec1;
- VectorObject *vec2;
- VectorObject *vec3;
- VectorObject *vec4;
- float v1[3], v2[3], v3[3], v4[3], e1[3], e2[3], n1[3], n2[3];
-
- if( !PyArg_ParseTuple
- ( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2
- , &vector_Type, &vec3, &vector_Type, &vec4 ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 4 vector types\n" ) );
- if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size)
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "vectors must be of the same size\n" ) );
- if( vec1->size != 3 )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "only 3D vectors\n" ) );
-
- VECCOPY(v1, vec1->vec);
- VECCOPY(v2, vec2->vec);
- VECCOPY(v3, vec3->vec);
- VECCOPY(v4, vec4->vec);
-
- /* find vectors for two edges sharing v2 */
- VecSubf(e1, v1, v2);
- VecSubf(e2, v3, v2);
-
- Crossf(n1, e2, e1);
- Normalize(n1);
-
- /* find vectors for two edges sharing v4 */
- VecSubf(e1, v3, v4);
- VecSubf(e2, v1, v4);
-
- Crossf(n2, e2, e1);
- Normalize(n2);
-
- /* adding and averaging the normals of both triangles */
- VecAddf(n1, n2, n1);
- Normalize(n1);
-
- return newVectorObject(n1, 3, Py_NEW);
-}
-
-//----------------------------Mathutils.TriangleNormal() -------------------
-PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args )
-{
- VectorObject *vec1, *vec2, *vec3;
- float v1[3], v2[3], v3[3], e1[3], e2[3], n[3];
-
- if( !PyArg_ParseTuple
- ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2
- , &vector_Type, &vec3 ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 3 vector types\n" ) );
- if( vec1->size != vec2->size || vec1->size != vec3->size )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "vectors must be of the same size\n" ) );
- if( vec1->size != 3 )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "only 3D vectors\n" ) );
-
- VECCOPY(v1, vec1->vec);
- VECCOPY(v2, vec2->vec);
- VECCOPY(v3, vec3->vec);
-
- /* find vectors for two edges sharing v2 */
- VecSubf(e1, v1, v2);
- VecSubf(e2, v3, v2);
-
- Crossf(n, e2, e1);
- Normalize(n);
-
- return newVectorObject(n, 3, Py_NEW);
-}
-
-//--------------------------------- AREA FUNCTIONS--------------------
-//----------------------------------Mathutils.TriangleArea() -------------------
-PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args )
-{
- VectorObject *vec1, *vec2, *vec3;
- float v1[3], v2[3], v3[3];
-
- if( !PyArg_ParseTuple
- ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2
- , &vector_Type, &vec3 ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected 3 vector types\n" ) );
- if( vec1->size != vec2->size || vec1->size != vec3->size )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "vectors must be of the same size\n" ) );
-
- if (vec1->size == 3) {
- VECCOPY(v1, vec1->vec);
- VECCOPY(v2, vec2->vec);
- VECCOPY(v3, vec3->vec);
-
- return PyFloat_FromDouble( AreaT3Dfl(v1, v2, v3) );
- }
- else if (vec1->size == 2) {
- v1[0] = vec1->vec[0];
- v1[1] = vec1->vec[1];
-
- v2[0] = vec2->vec[0];
- v2[1] = vec2->vec[1];
-
- v3[0] = vec3->vec[0];
- v3[1] = vec3->vec[1];
-
- return PyFloat_FromDouble( AreaF2Dfl(v1, v2, v3) );
- }
- else {
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "only 2D,3D vectors are supported\n" ) );
- }
-}
-//#############################DEPRECATED################################
-//#######################################################################
-//----------------------------------Mathutils.CopyMat() -----------------
-//copies a matrix into a new matrix
-PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args)
-{
- PyObject *matrix = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.CopyMat(): deprecated :use Mathutils.Matrix() to copy matrices\n");
- --warning;
- }
-
- matrix = M_Mathutils_Matrix(self, args);
- if(matrix == NULL)
- return NULL; //error string already set if we get here
- else
- return matrix;
-}
-//----------------------------------Mathutils.CopyVec() -----------------
-//makes a new vector that is a copy of the input
-PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args)
-{
- PyObject *vec = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.CopyVec(): Deprecated: use Mathutils.Vector() to copy vectors\n");
- --warning;
- }
-
- vec = M_Mathutils_Vector(self, args);
- if(vec == NULL)
- return NULL; //error string already set if we get here
- else
- return vec;
-}
-//----------------------------------Mathutils.CopyQuat() --------------
-//Copies a quaternion to a new quat
-PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args)
-{
- PyObject *quat = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.CopyQuat(): Deprecated: use Mathutils.Quaternion() to copy vectors\n");
- --warning;
- }
-
- quat = M_Mathutils_Quaternion(self, args);
- if(quat == NULL)
- return NULL; //error string already set if we get here
- else
- return quat;
-}
-//----------------------------------Mathutils.CopyEuler() ---------------
-//copies a euler to a new euler
-PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args)
-{
- PyObject *eul = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.CopyEuler(): deprecated:use Mathutils.Euler() to copy vectors\n");
- --warning;
- }
-
- eul = M_Mathutils_Euler(self, args);
- if(eul == NULL)
- return NULL; //error string already set if we get here
- else
- return eul;
-}
-//----------------------------------Mathutils.RotateEuler() ------------
-//rotates a euler a certain amount and returns the result
-//should return a unique euler rotation (i.e. no 720 degree pitches :)
-PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args)
-{
- EulerObject *Eul = NULL;
- float angle;
- char *axis;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.RotateEuler(): Deprecated:use Euler.rotate() to rotate a euler\n");
- --warning;
- }
-
- if(!PyArg_ParseTuple(args, "O!fs", &euler_Type, &Eul, &angle, &axis))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.RotateEuler(): expected euler type & float & string");
-
- Euler_Rotate(Eul, Py_BuildValue("fs", angle, axis));
- Py_RETURN_NONE;
-}
-//----------------------------------Mathutils.MatMultVec() --------------
-//COLUMN VECTOR Multiplication (Matrix X Vector)
-PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args)
-{
- MatrixObject *mat = NULL;
- VectorObject *vec = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.MatMultVec(): Deprecated: use matrix * vec to perform column vector multiplication\n");
- --warning;
- }
-
- //get pyObjects
- if(!PyArg_ParseTuple(args, "O!O!", &matrix_Type, &mat, &vector_Type, &vec))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.MatMultVec(): MatMultVec() expects a matrix and a vector object - in that order\n");
-
- return column_vector_multiplication(mat, vec);
-}
-//----------------------------------Mathutils.VecMultMat() ---------------
-//ROW VECTOR Multiplication - Vector X Matrix
-PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args)
-{
- MatrixObject *mat = NULL;
- VectorObject *vec = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("Mathutils.VecMultMat(): Deprecated: use vec * matrix to perform row vector multiplication\n");
- --warning;
- }
-
- //get pyObjects
- if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec, &matrix_Type, &mat))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Mathutils.VecMultMat(): VecMultMat() expects a vector and matrix object - in that order\n");
-
- return row_vector_multiplication(vec, mat);
-}
-//#######################################################################
-//#############################DEPRECATED################################
diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h
deleted file mode 100644
index 0db83216178..00000000000
--- a/source/blender/python/api2_2x/Mathutils.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-//Include this file for access to vector, quat, matrix, euler, etc...
-
-#ifndef EXPP_Mathutils_H
-#define EXPP_Mathutils_H
-
-#include <Python.h>
-#include "vector.h"
-#include "matrix.h"
-#include "quat.h"
-#include "euler.h"
-#include "point.h"
-
-PyObject *Mathutils_Init( const char * from );
-PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat);
-PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec);
-PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat);
-PyObject *column_point_multiplication(MatrixObject * mat, PointObject* pt);
-PyObject *quat_rotation(PyObject *arg1, PyObject *arg2);
-
-PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * value);
-PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args );
-PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args );
-PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args );
-PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args );
-PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args );
-PyObject *M_Mathutils_Point(PyObject * self, PyObject * args);
-//DEPRECATED
-PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args);
-PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args);
-
-#endif /* EXPP_Mathutils_H */
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c
deleted file mode 100644
index 32ddb464c88..00000000000
--- a/source/blender/python/api2_2x/Mesh.c
+++ /dev/null
@@ -1,8880 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender, partially based on NMesh.c API.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mesh.h" /*This must come first*/
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_key_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_space_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-
-#include "BDR_editface.h" /* make_tfaces */
-#include "BDR_vpaint.h"
-#include "BDR_editobject.h"
-
-#include "BIF_editdeform.h"
-#include "BIF_editkey.h" /* insert_meshkey */
-#include "BIF_space.h" /* REMAKEIPO - insert_meshkey */
-#include "BIF_editview.h"
-#include "BIF_editmesh.h"
-#include "BIF_meshtools.h"
-
-#include "BKE_customdata.h"
-#include "BKE_deform.h"
-#include "BKE_displist.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
-#include "BKE_main.h"
-#include "BKE_multires.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_object.h"
-#include "BKE_mball.h"
-#include "BKE_utildefines.h"
-#include "BKE_depsgraph.h"
-#include "BSE_edit.h" /* for countall(); */
-#include "BKE_curve.h" /* for copy_curve(); */
-#include "BKE_modifier.h" /* for modifier_new(), modifier_copyData(); */
-#include "BKE_idprop.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_memarena.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "butspace.h" /* for mesh tools */
-#include "Object.h"
-#include "Key.h"
-#include "Image.h"
-#include "Material.h"
-#include "Mathutils.h"
-#include "IDProp.h"
-#include "meshPrimitive.h"
-#include "constant.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "multires.h"
-
-/* EXPP Mesh defines */
-
-#define MESH_SMOOTHRESH 30
-#define MESH_SMOOTHRESH_MIN 1
-#define MESH_SMOOTHRESH_MAX 80
-#define MESH_SUBDIV 1
-#define MESH_SUBDIV_MIN 0
-#define MESH_SUBDIV_MAX 6
-
-#define MESH_HASFACEUV 0
-#define MESH_HASMCOL 1
-#define MESH_HASVERTUV 2
-#define MESH_HASMULTIRES 3
-
-#define MESH_MULTIRES_LEVEL 0
-#define MESH_MULTIRES_EDGE 1
-#define MESH_MULTIRES_PIN 2
-#define MESH_MULTIRES_RENDER 3
-
-#define MESH_TOOL_TOSPHERE 0
-#define MESH_TOOL_VERTEXSMOOTH 1
-#define MESH_TOOL_FLIPNORM 2
-#define MESH_TOOL_SUBDIV 3
-#define MESH_TOOL_REMDOUB 4
-#define MESH_TOOL_FILL 5
-#define MESH_TOOL_RECALCNORM 6
-#define MESH_TOOL_TRI2QUAD 7
-#define MESH_TOOL_QUAD2TRI 8
-
-static PyObject *MVertSeq_CreatePyObject( Mesh * mesh );
-static PyObject *MFaceSeq_CreatePyObject( Mesh * mesh );
-static PyObject *MEdgeSeq_CreatePyObject( Mesh * mesh );
-static PyObject *MFace_CreatePyObject( Mesh * mesh, int i );
-static PyObject *MEdge_CreatePyObject( Mesh * mesh, int i );
-
-#define MFACE_VERT_BADRANGE_CHECK(me, face) ((int)face->v1 >= me->totvert || (int)face->v2 >= me->totvert || (int)face->v3 >= me->totvert || (int)face->v4 >= me->totvert)
-#define MEDGE_VERT_BADRANGE_CHECK(me, edge) ((int)edge->v1 >= me->totvert || (int)edge->v2 >= me->totvert)
-
-/************************************************************************
- *
- * internal utilities
- *
- ************************************************************************/
-
-/*
- * internal structures used for sorting edges and faces
- */
-
-typedef struct SrchEdges {
- unsigned int v[2]; /* indices for verts */
- unsigned char swap; /* non-zero if verts swapped */
- unsigned int index; /* index in original param list of this edge */
- /* (will be used by findEdges) */
-} SrchEdges;
-
-typedef struct SrchFaces {
- unsigned int v[4]; /* indices for verts */
- unsigned int index; /* index in original param list of this edge */
- unsigned char order; /* order of original verts, bitpacked */
-} SrchFaces;
-
-typedef struct FaceEdges {
- unsigned int v[2]; /* search key (vert indices) */
- unsigned int index; /* location in edge list */
- unsigned char sel; /* selection state */
-} FaceEdges;
-
-/*
- * compare edges by vertex indices
- */
-
-static int medge_comp( const void *va, const void *vb )
-{
- const unsigned int *a = ((SrchEdges *)va)->v;
- const unsigned int *b = ((SrchEdges *)vb)->v;
-
- /* compare first index for differences */
-
- if (a[0] < b[0]) return -1;
- else if (a[0] > b[0]) return 1;
-
- /* if first indices equal, compare second index for differences */
-
- else if (a[1] < b[1]) return -1;
- else return (a[1] > b[1]);
-}
-
-/*
- * compare edges by insert list indices
- */
-
-static int medge_index_comp( const void *va, const void *vb )
-{
- const SrchEdges *a = (SrchEdges *)va;
- const SrchEdges *b = (SrchEdges *)vb;
-
- /* compare list indices for differences */
-
- if (a->index < b->index) return -1;
- else return (a->index > b->index);
-}
-
-
-/*
- * compare faces by vertex indices
- */
-
-static int mface_comp( const void *va, const void *vb )
-{
- const SrchFaces *a = va;
- const SrchFaces *b = vb;
- int i;
-
- /* compare indices, first to last, for differences */
- for( i = 0; i < 4; ++i ) {
- if( a->v[i] < b->v[i] )
- return -1;
- if( a->v[i] > b->v[i] )
- return 1;
- }
-
- /*
- * don't think this needs be done; if order is different then either
- * (a) the face is good, just reversed or has a different starting
- * vertex, or (b) face is bad (for 4 verts) and there's a "twist"
- */
-
-#if 0
- /* if all the same verts, compare their order */
- if( a->order < b->order )
- return -1;
- if( a->order > b->order )
- return 1;
-#endif
-
- return 0;
-}
-
-/*
- * compare faces by insert list indices
- */
-
-static int mface_index_comp( const void *va, const void *vb )
-{
- const SrchFaces *a = va;
- const SrchFaces *b = vb;
-
- /* compare indices, first to last, for differences */
- if( a->index < b->index )
- return -1;
- if( a->index > b->index )
- return 1;
- return 0;
-}
-
-/*
- * compare edges by vertex indices
- */
-
-static int faceedge_comp( const void *va, const void *vb )
-{
- const unsigned int *a = ((FaceEdges *)va)->v;
- const unsigned int *b = ((FaceEdges *)vb)->v;
-
- /* compare first index for differences */
-
- if (a[0] < b[0]) return -1;
- else if (a[0] > b[0]) return 1;
-
- /* if first indices equal, compare second index for differences */
-
- else if (a[1] < b[1]) return -1;
- else return (a[1] > b[1]);
-}
-
-/*
- * update the DAG for all objects linked to this mesh
- */
-
-static void mesh_update( Mesh * mesh )
-{
- Object_updateDag( (void *) mesh );
-}
-
-/*
- * delete vertices from mesh, then delete edges/keys/faces which used those
- * vertices
- *
- * Deletion is done by "smart compaction"; groups of verts/edges/faces which
- * remain in the list are copied to new list instead of one at a time. Since
- * Blender has no realloc we would have to copy things anyway, so there's no
- * point trying to fill empty entries with data from the end of the lists.
- *
- * vert_table is a lookup table for mapping old verts to new verts (after the
- * vextex list has deleted vertices removed). Each entry contains the
- * vertex's new index.
- */
-
-static void delete_verts( Mesh *mesh, unsigned int *vert_table, int to_delete )
-{
- /*
- * (1) allocate vertex table (initialize contents to 0)
- * (2) mark each vertex being deleted in vertex table (= UINT_MAX)
- * (3) update remaining table entries with "new" vertex index (after
- * compaction)
- * (4) allocate new vertex list
- * (5) do "smart copy" of vertices from old to new
- * * each moved vertex is entered into vertex table: if vertex i is
- * moving to index j in new list
- * vert_table[i] = j;
- * (6) if keys, do "smart copy" of keys
- * (7) process edge list
- * update vert index
- * delete edges which delete verts
- * (7) allocate new edge list
- * (8) do "smart copy" of edges
- * (9) allocate new face list
- * (10) do "smart copy" of face
- */
-
- unsigned int *tmpvert;
- CustomData vdata;
- int i, count, state, dstindex, totvert;
-
- totvert = mesh->totvert - to_delete;
- CustomData_copy( &mesh->vdata, &vdata, CD_MASK_MESH, CD_CALLOC, totvert );
-
- /*
- * do "smart compaction" of the table; find and copy groups of vertices
- * which are not being deleted
- */
-
- dstindex = 0;
- tmpvert = vert_table;
- count = 0;
- state = 1;
- for( i = 0; i < mesh->totvert; ++i, ++tmpvert ) {
- switch( state ) {
- case 0: /* skipping verts */
- if( *tmpvert == UINT_MAX ) {
- ++count;
- } else {
- count = 1;
- state = 1;
- }
- break;
- case 1: /* gathering verts */
- if( *tmpvert != UINT_MAX ) {
- ++count;
- } else {
- if( count ) {
- CustomData_copy_data( &mesh->vdata, &vdata, i-count,
- dstindex, count );
- dstindex += count;
- }
- count = 1;
- state = 0;
- }
- }
- }
-
- /* if we were gathering verts at the end of the loop, copy those */
- if( state && count )
- CustomData_copy_data( &mesh->vdata, &vdata, i-count, dstindex, count );
-
- /* delete old vertex list, install the new one, update vertex count */
- CustomData_free( &mesh->vdata, mesh->totvert );
- mesh->vdata = vdata;
- mesh->totvert = totvert;
- mesh_update_customdata_pointers( mesh );
-}
-
-static void delete_edges( Mesh *mesh, unsigned int *vert_table, int to_delete )
-{
- int i;
- MEdge *tmpedge;
-
- /* if not given, then mark and count edges to be deleted */
- if( !to_delete ) {
- tmpedge = mesh->medge;
- for( i = mesh->totedge; i-- ; ++tmpedge )
- if( vert_table[tmpedge->v1] == UINT_MAX ||
- vert_table[tmpedge->v2] == UINT_MAX ) {
- tmpedge->v1 = UINT_MAX;
- ++to_delete;
- }
- }
-
- /* if there are edges to delete, handle it */
- if( to_delete ) {
- CustomData edata;
- int count, state, dstindex, totedge;
-
- /* allocate new edge list and populate */
- totedge = mesh->totedge - to_delete;
- CustomData_copy( &mesh->edata, &edata, CD_MASK_MESH, CD_CALLOC, totedge);
-
- /*
- * do "smart compaction" of the edges; find and copy groups of edges
- * which are not being deleted
- */
-
- dstindex = 0;
- tmpedge = mesh->medge;
- count = 0;
- state = 1;
- for( i = 0; i < mesh->totedge; ++i, ++tmpedge ) {
- switch( state ) {
- case 0: /* skipping edges */
- if( tmpedge->v1 == UINT_MAX ) {
- ++count;
- } else {
- count = 1;
- state = 1;
- }
- break;
- case 1: /* gathering edges */
- if( tmpedge->v1 != UINT_MAX ) {
- ++count;
- } else {
- if( count ) {
- CustomData_copy_data( &mesh->edata, &edata, i-count,
- dstindex, count );
- dstindex += count;
- }
- count = 1;
- state = 0;
- }
- }
- /* if edge is good, update vertex indices */
- }
-
- /* copy any pending good edges */
- if( state && count )
- CustomData_copy_data( &mesh->edata, &edata, i-count, dstindex,
- count );
-
- /* delete old edge list, install the new one, update vertex count */
- CustomData_free( &mesh->edata, mesh->totedge );
- mesh->edata = edata;
- mesh->totedge = totedge;
- mesh_update_customdata_pointers( mesh );
- }
-
- /* if vertices were deleted, update edge's vertices */
- if( vert_table ) {
- tmpedge = mesh->medge;
- for( i = mesh->totedge; i--; ++tmpedge ) {
- tmpedge->v1 = vert_table[tmpedge->v1];
- tmpedge->v2 = vert_table[tmpedge->v2];
- }
- }
-}
-
-/*
-* Since all faces must have 3 or 4 verts, we can't have v3 or v4 be zero.
-* If that happens during the deletion, we have to shuffle the vertices
-* around; otherwise it can cause an Eeekadoodle or worse. If there are
-* texture faces as well, they have to be shuffled as well.
-*
-* (code borrowed from test_index_face() in mesh.c, but since we know the
-* faces already have correct number of vertices, this is a little faster)
-*/
-
-static void eeek_fix( MFace *mface, int len4 )
-{
- /* if 4 verts, then neither v3 nor v4 can be zero */
- if( len4 ) {
- if( !mface->v3 || !mface->v4 ) {
- SWAP( int, mface->v1, mface->v3 );
- SWAP( int, mface->v2, mface->v4 );
- }
- } else if( !mface->v3 ) {
- /* if 2 verts, then just v3 cannot be zero (v4 MUST be zero) */
- SWAP( int, mface->v1, mface->v2 );
- SWAP( int, mface->v2, mface->v3 );
- }
-}
-
-static void delete_faces( Mesh *mesh, unsigned int *vert_table, int to_delete )
-{
- int i;
- MFace *tmpface;
-
- /* if there are faces to delete, handle it */
- if( to_delete ) {
- CustomData fdata;
- int count, state, dstindex, totface;
-
- totface = mesh->totface - to_delete;
- CustomData_copy( &mesh->fdata, &fdata, CD_MASK_MESH, CD_CALLOC, totface );
-
- /*
- * do "smart compaction" of the faces; find and copy groups of faces
- * which are not being deleted
- */
-
- dstindex = 0;
- tmpface = mesh->mface;
-
- count = 0;
- state = 1;
- for( i = 0; i < mesh->totface; ++i ) {
- switch( state ) {
- case 0: /* skipping faces */
- if( tmpface->v1 == UINT_MAX ) {
- ++count;
- } else {
- count = 1;
- state = 1;
- }
- break;
- case 1: /* gathering faces */
- if( tmpface->v1 != UINT_MAX ) {
- ++count;
- } else {
- if( count ) {
- CustomData_copy_data( &mesh->fdata, &fdata, i-count,
- dstindex, count );
- dstindex += count;
- }
- count = 1;
- state = 0;
- }
- }
- ++tmpface;
- }
-
- /* if we were gathering faces at the end of the loop, copy those */
- if ( state && count )
- CustomData_copy_data( &mesh->fdata, &fdata, i-count, dstindex,
- count );
-
- /* delete old face list, install the new one, update face count */
-
- CustomData_free( &mesh->fdata, mesh->totface );
- mesh->fdata = fdata;
- mesh->totface = totface;
- mesh_update_customdata_pointers( mesh );
- }
-
- /* if vertices were deleted, update face's vertices */
- if( vert_table ) {
- tmpface = mesh->mface;
-
- for( i = 0; i<mesh->totface; ++i, ++tmpface ) {
- int len4 = tmpface->v4;
- tmpface->v1 = vert_table[tmpface->v1];
- tmpface->v2 = vert_table[tmpface->v2];
- tmpface->v3 = vert_table[tmpface->v3];
- if(len4)
- tmpface->v4 = vert_table[tmpface->v4];
- else
- tmpface->v4 = 0;
-
- test_index_face( tmpface, &mesh->fdata, i, len4? 4: 3);
- }
- }
-}
-
-/*
- * fill up vertex lookup table with old-to-new mappings
- *
- * returns the number of vertices marked for deletion
- */
-
-static unsigned int make_vertex_table( unsigned int *vert_table, int count )
-{
- int i;
- unsigned int *tmpvert = vert_table;
- unsigned int to_delete = 0;
- unsigned int new_index = 0;
-
- /* fill the lookup table with old->new index mappings */
- for( i = count; i; --i, ++tmpvert ) {
- if( *tmpvert == UINT_MAX ) {
- ++to_delete;
- } else {
- *tmpvert = new_index;
- ++new_index;
- }
- }
- return to_delete;
-}
-
-
-/************************************************************************
- *
- * Color attributes
- *
- ************************************************************************/
-
-/*
- * get a color attribute
- */
-
-static PyObject *MCol_getAttr( BPy_MCol * self, void *type )
-{
- unsigned char param;
-
- switch( (long)type ) {
- case 'R': /* these are backwards, but that how it works */
- param = self->color->b;
- break;
- case 'G':
- param = self->color->g;
- break;
- case 'B': /* these are backwards, but that how it works */
- param = self->color->r;
- break;
- case 'A':
- param = self->color->a;
- break;
- default:
- {
- char errstr[1024];
- sprintf( errstr, "undefined type '%d' in MCol_getAttr",
- (int)((long)type & 0xff));
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, errstr );
- }
- }
-
- return PyInt_FromLong( param );
-}
-
-/*
- * set a color attribute
- */
-
-static int MCol_setAttr( BPy_MCol * self, PyObject * value, void * type )
-{
- unsigned char *param;
-
- switch( (long)type ) {
- case 'R': /* these are backwards, but that how it works */
- param = (unsigned char *)&self->color->b;
- break;
- case 'G':
- param = (unsigned char *)&self->color->g;
- break;
- case 'B': /* these are backwards, but that how it works */
- param = (unsigned char *)&self->color->r;
- break;
- case 'A':
- param = (unsigned char *)&self->color->a;
- break;
- default:
- {
- char errstr[1024];
- sprintf( errstr, "undefined type '%d' in MCol_setAttr",
- (int)((long)type & 0xff));
- return EXPP_ReturnIntError( PyExc_RuntimeError, errstr );
- }
- }
-
- return EXPP_setIValueClamped( value, param, 0, 255, 'b' );
-}
-
-/************************************************************************
- *
- * Python MCol_Type attributes get/set structure
- *
- ************************************************************************/
-
-static PyGetSetDef BPy_MCol_getseters[] = {
- {"r",
- (getter)MCol_getAttr, (setter)MCol_setAttr,
- "red component",
- (void *)'R'},
- {"g",
- (getter)MCol_getAttr, (setter)MCol_setAttr,
- "green component",
- (void *)'G'},
- {"b",
- (getter)MCol_getAttr, (setter)MCol_setAttr,
- "blue component",
- (void *)'B'},
- {"a",
- (getter)MCol_getAttr, (setter)MCol_setAttr,
- "alpha component",
- (void *)'A'},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*----------------------------object[]---------------------------
- sequence accessor (get)*/
-static PyObject *MCol_item(BPy_MCol * self, int i)
-{
- unsigned char param;
- switch (i) {
- case 0:
- param = self->color->b;
- break;
- case 1:
- param = self->color->g;
- break;
- case 2:
- param = self->color->r;
- break;
- case 3:
- param = self->color->a;
- break;
- default:
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "vector[index] = x: assignment index out of range\n");
- }
-
- return PyInt_FromLong( param );
-}
-
-/*----------------------------object[]-------------------------
- sequence accessor (set)*/
-static int MCol_ass_item(BPy_MCol * self, int i, PyObject * value)
-{
- unsigned char *param;
-
- switch (i) {
- case 0:
- param = (unsigned char *)&self->color->b; /* reversed? why */
- break;
- case 1:
- param = (unsigned char *)&self->color->g;
- break;
- case 2:
- param = (unsigned char *)&self->color->r; /* reversed? why */
- break;
- case 3:
- param = (unsigned char *)&self->color->a;
- break;
- default:
- {
- return EXPP_ReturnIntError( PyExc_RuntimeError, "Index out of range" );
- }
- }
- return EXPP_setIValueClamped( value, param, 0, 255, 'b' );
-}
-
-/************************************************************************
- *
- * Python MCol_Type methods
- *
- ************************************************************************/
-
-static PyObject *MCol_repr( BPy_MCol * self )
-{
- return PyString_FromFormat( "[MCol %d %d %d %d]",
- (int)self->color->b, (int)self->color->g,
- (int)self->color->r, (int)self->color->a );
-}
-
-/*-----------------PROTCOL DECLARATIONS--------------------------*/
-static PySequenceMethods MCol_SeqMethods = {
- (inquiry) NULL, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (intargfunc) NULL, /* sq_repeat */
- (intargfunc) MCol_item, /* sq_item */
- (intintargfunc) NULL, /* sq_slice */
- (intobjargproc) MCol_ass_item, /* sq_ass_item */
- (intintobjargproc) NULL, /* sq_ass_slice */
-};
-
-/************************************************************************
- *
- * Python MCol_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject MCol_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MCol", /* char *tp_name; */
- sizeof( BPy_MCol ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) MCol_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MCol_SeqMethods, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MCol_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *MCol_CreatePyObject( MCol * color )
-{
- BPy_MCol *obj = PyObject_NEW( BPy_MCol, &MCol_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->color = color;
- return (PyObject *)obj;
-}
-
-/************************************************************************
- *
- * BPy_MVert attributes
- *
- ************************************************************************/
-
-static MVert * MVert_get_pointer( BPy_MVert * self )
-{
- if( BPy_MVert_Check( self ) ) {
- if( self->index >= ((Mesh *)self->data)->totvert )
- return (MVert *)EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MVert is no longer valid" );
- return &((Mesh *)self->data)->mvert[self->index];
- }
- else
- return (MVert *)self->data;
-}
-
-/*
- * get a vertex's coordinate
- */
-
-static PyObject *MVert_getCoord( BPy_MVert * self )
-{
- MVert *v;
-
- v = MVert_get_pointer( self );
- if( !v )
- return NULL;
-
- return newVectorObject( v->co, 3, Py_WRAP );
-}
-
-/*
- * set a vertex's coordinate
- */
-
-static int MVert_setCoord( BPy_MVert * self, VectorObject * value )
-{
- int i;
- MVert *v;
-
- v = MVert_get_pointer( self );
- if( !v )
- return -1;
-
- if( !VectorObject_Check( value ) || value->size != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected vector argument of size 3" );
-
- for( i=0; i<3 ; ++i)
- v->co[i] = value->vec[i];
-
- return 0;
-}
-
-/*
- * get a vertex's index
- */
-
-static PyObject *MVert_getIndex( BPy_MVert * self )
-{
- if( self->index >= ((Mesh *)self->data)->totvert )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MVert is no longer valid" );
-
- return PyInt_FromLong( self->index );
-}
-
-
-/*
- * get a verts's hidden state
- */
-
-static PyObject *MVert_getMFlagBits( BPy_MVert * self, void * type )
-{
- MVert *v;
-
- v = MVert_get_pointer( self );
- if (!v)
- return NULL; /* error is set */
-
- return EXPP_getBitfield( &v->flag, (int)((long)type & 0xff), 'b' );
-}
-
-
-/*
- * set a verts's hidden state
- */
-
-static int MVert_setMFlagBits( BPy_MVert * self, PyObject * value,
- void * type )
-{
- MVert *v;
-
- v = MVert_get_pointer( self );
-
- if (!v)
- return -1; /* error is set */
-
- return EXPP_setBitfield( value, &v->flag,
- (int)((long)type & 0xff), 'b' );
-}
-
-
-/*
- * get a vertex's normal
- */
-
-static PyObject *MVert_getNormal( BPy_MVert * self )
-{
- float no[3];
- int i;
- MVert *v;
-
- v = MVert_get_pointer( self );
- if( !v )
- return NULL; /* error set */
-
- for( i = 0; i < 3; ++i )
- no[i] = (float)(v->no[i] / 32767.0);
- return newVectorObject( no, 3, Py_NEW );
-}
-
-/*
- * set a vertex's normal
- */
-
-static int MVert_setNormal( BPy_MVert * self, VectorObject * value )
-{
- int i;
- MVert *v;
- float normal[3];
-
- v = MVert_get_pointer( self );
- if( !v )
- return -1; /* error set */
-
- if( !VectorObject_Check( value ) || value->size != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected vector argument of size 3" );
-
-
- for( i=0; i<3 ; ++i)
- normal[i] = value->vec[i];
-
- Normalize(normal);
-
- for( i=0; i<3 ; ++i)
- v->no[i] = (short)(normal[i]*32767.0);
-
- return 0;
-}
-
-
-/*
- * get a vertex's select status
- */
-
-static PyObject *MVert_getSel( BPy_MVert *self )
-{
- MVert *v;
-
- v = MVert_get_pointer( self );
- if( !v )
- return NULL; /* error is set */
-
- return EXPP_getBitfield( &v->flag, SELECT, 'b' );
-}
-
-/*
- * set a vertex's select status
- */
-
-static int MVert_setSel( BPy_MVert *self, PyObject *value )
-{
- MVert *v = MVert_get_pointer( self );
- Mesh *me = (Mesh *)self->data;
- if (!v)
- return -1; /* error is set */
-
- /*
- * if vertex exists and setting status is OK, delete select storage
- * of the edges and faces as well
- */
-
- if( v && !EXPP_setBitfield( value, &v->flag, SELECT, 'b' ) ) {
- if( me && me->mselect ) {
- MEM_freeN( me->mselect );
- me->mselect = NULL;
- }
- return 0;
- }
- return -1;
-}
-
-/*
- * get a vertex's UV coordinates
- */
-
-static PyObject *MVert_getUVco( BPy_MVert *self )
-{
- Mesh *me = (Mesh *)self->data;
-
- if( !me->msticky )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh has no 'sticky' coordinates" );
-
- if( self->index >= ((Mesh *)self->data)->totvert )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MVert is no longer valid" );
-
- return newVectorObject( me->msticky[self->index].co, 2, Py_WRAP );
-}
-
-/*
- * set a vertex's UV coordinates
- */
-
-static int MVert_setUVco( BPy_MVert *self, PyObject *value )
-{
- float uvco[3] = {0.0, 0.0};
- Mesh *me = (Mesh *)self->data;
- struct MSticky *v;
- int i;
-
- /*
- * at least for now, don't allow creation of sticky coordinates if they
- * don't already exist
- */
-
- if( !me->msticky )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "mesh has no 'sticky' coordinates" );
-
- if( self->index >= ((Mesh *)self->data)->totvert )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "MVert is no longer valid" );
-
- if( VectorObject_Check( value ) ) {
- VectorObject *vect = (VectorObject *)value;
- if( vect->size != 2 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected 2D vector" );
- for( i = 0; i < vect->size; ++i )
- uvco[i] = vect->vec[i];
- } else if( !PyArg_ParseTuple( value, "ff",
- &uvco[0], &uvco[1] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected 2D vector" );
-
- v = &me->msticky[self->index];
-
- for( i = 0; i < 2; ++i )
- v->co[i] = uvco[i];
-
- return 0;
-}
-
-/************************************************************************
- *
- * Python MVert_Type attributes get/set structure
- *
- ************************************************************************/
-
-static PyGetSetDef BPy_MVert_getseters[] = {
- {"co",
- (getter)MVert_getCoord, (setter)MVert_setCoord,
- "vertex's coordinate",
- NULL},
- {"index",
- (getter)MVert_getIndex, (setter)NULL,
- "vertex's index",
- NULL},
- {"no",
- (getter)MVert_getNormal, (setter)MVert_setNormal,
- "vertex's normal",
- NULL},
- {"sel",
- (getter)MVert_getSel, (setter)MVert_setSel,
- "vertex's select status",
- NULL},
- {"hide",
- (getter)MVert_getMFlagBits, (setter)MVert_setMFlagBits,
- "vert hidden in edit mode",
- (void *)ME_HIDE},
- {"uvco",
- (getter)MVert_getUVco, (setter)MVert_setUVco,
- "vertex's UV coordinates",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-static PyGetSetDef BPy_PVert_getseters[] = {
- {"co",
- (getter)MVert_getCoord, (setter)MVert_setCoord,
- "vertex's coordinate",
- NULL},
- {"no",
- (getter)MVert_getNormal, (setter)MVert_setNormal,
- "vertex's normal",
- NULL},
- {"sel",
- (getter)MVert_getSel, (setter)MVert_setSel,
- "vertex's select status",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/************************************************************************
- *
- * Python MVert_Type standard operations
- *
- ************************************************************************/
-
-static void MVert_dealloc( BPy_MVert * self )
-{
- if( BPy_PVert_Check( self ) ) /* free memory of thick objects */
- MEM_freeN ( self->data );
-
- PyObject_DEL( self );
-}
-
-static int MVert_compare( BPy_MVert * a, BPy_MVert * b )
-{
- return( a->data == b->data && a->index == b->index ) ? 0 : -1;
-}
-
-static PyObject *MVert_repr( BPy_MVert * self )
-{
- char format[512];
- char index[24];
- MVert *v;
-
- v = MVert_get_pointer( self );
- if( !v )
- return NULL;
-
- if( BPy_MVert_Check( self ) )
- sprintf( index, "%d", self->index );
- else
- BLI_strncpy( index, "(None)", 24 );
-
- sprintf( format, "[MVert (%f %f %f) (%f %f %f) %s]",
- v->co[0], v->co[1], v->co[2], (float)(v->no[0] / 32767.0),
- (float)(v->no[1] / 32767.0), (float)(v->no[2] / 32767.0),
- index );
-
- return PyString_FromString( format );
-}
-
-static long MVert_hash( BPy_MVert *self )
-{
- return (long)self->index;
-}
-
-static PyObject *Mesh_addPropLayer_internal(Mesh *mesh, CustomData *data, int tot, PyObject *args)
-{
- char *name=NULL;
- int type = -1;
-
- if( !PyArg_ParseTuple( args, "si", &name, &type) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string and an int" );
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31");
- if((type != CD_PROP_FLT) && (type != CD_PROP_INT) && (type != CD_PROP_STR))
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, unknown layer type");
- if (name)
- CustomData_add_layer_named(data, type, CD_DEFAULT, NULL,tot,name);
-
- mesh_update_customdata_pointers(mesh);
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_removePropLayer_internal(Mesh *mesh, CustomData *data, int tot,PyObject *value)
-{
- CustomDataLayer *layer;
- char *name=PyString_AsString(value);
- int i;
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- i = CustomData_get_named_layer_index(data, CD_PROP_FLT, name);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_INT, name);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_STR, name);
- if (i==-1)
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "No matching layers to remove" );
- layer = &data->layers[i];
- CustomData_free_layer(data, layer->type, tot, i);
- mesh_update_customdata_pointers(mesh);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_renamePropLayer_internal(Mesh *mesh, CustomData *data, PyObject *args)
-{
- CustomDataLayer *layer;
- int i;
- char *name_from, *name_to;
-
- if( !PyArg_ParseTuple( args, "ss", &name_from, &name_to ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 strings" );
-
- if (strlen(name_from)>31 || strlen(name_to)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- i = CustomData_get_named_layer_index(data, CD_PROP_FLT, name_from);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_INT, name_from);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_STR, name_from);
- if(i == -1)
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "No matching layers to rename" );
-
- layer = &data->layers[i];
-
- strcpy(layer->name, name_to); /* we alredy know the string sizes are under 32 */
- CustomData_set_layer_unique_name(data, i);
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_propList_internal(CustomData *data)
-{
- CustomDataLayer *layer;
- PyObject *list = PyList_New( 0 ), *item;
- int i;
- for(i=0; i<data->totlayer; i++) {
- layer = &data->layers[i];
- if( (layer->type == CD_PROP_FLT) || (layer->type == CD_PROP_INT) || (layer->type == CD_PROP_STR)) {
- item = PyString_FromString(layer->name);
- PyList_Append( list, item );
- Py_DECREF(item);
- }
- }
- return list;
-}
-
-static PyObject *Mesh_getProperty_internal(CustomData *data, int eindex, PyObject *value)
-{
- CustomDataLayer *layer;
- char *name=PyString_AsString(value);
- int i;
- MFloatProperty *pf;
- MIntProperty *pi;
- MStringProperty *ps;
-
- if(!name)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an string argument" );
-
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- i = CustomData_get_named_layer_index(data, CD_PROP_FLT, name);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_INT, name);
- if(i == -1) i = CustomData_get_named_layer_index(data, CD_PROP_STR, name);
- if(i == -1)
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "No matching layers" );
-
- layer = &data->layers[i];
-
- if(layer->type == CD_PROP_FLT){
- pf = layer->data;
- return PyFloat_FromDouble(pf[eindex].f);
- }
- else if(layer->type == CD_PROP_INT){
- pi = layer->data;
- return PyInt_FromLong(pi[eindex].i);
-
- }
- else if(layer->type == CD_PROP_STR){
- ps = layer->data;
- return PyString_FromString(ps[eindex].s);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_setProperty_internal(CustomData *data, int eindex, PyObject *args)
-{
- CustomDataLayer *layer;
- int i = 0, index, type = -1;
- float f = 0.0f;
- char *s=NULL, *name=NULL;
- MFloatProperty *pf;
- MIntProperty *pi;
- MStringProperty *ps;
- PyObject *val;
-
- if(PyArg_ParseTuple(args, "sO", &name, &val)){
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- if(PyInt_Check(val)){
- type = CD_PROP_INT;
- i = (int)PyInt_AS_LONG(val);
- }
- else if(PyFloat_Check(val)){
- type = CD_PROP_FLT;
- f = (float)PyFloat_AsDouble(val);
- }
- else if(PyString_Check(val)){
- type = CD_PROP_STR;
- s = PyString_AsString(val);
- }
- else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an name plus either float/int/string" );
-
- }
-
- index = CustomData_get_named_layer_index(data, type, name);
- if(index == -1)
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "No matching layers or type mismatch" );
-
- layer = &data->layers[index];
-
- if(type==CD_PROP_STR){
- if (strlen(s)>255){
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum string length is 255");
- }
- else{
- ps = layer->data;
- strcpy(ps[eindex].s,s);
- }
- }
- else if(type==CD_PROP_FLT){
- pf = layer->data;
- pf[eindex].f = f;
- }
- else{
- pi = layer->data;
- pi[eindex].i = i;
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *MVert_getProp( BPy_MVert *self, PyObject *args)
-{
- if( BPy_MVert_Check( self ) ){
- Mesh *me = (Mesh *)self->data;
- if(self->index >= me->totvert)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, MVert is no longer valid part of mesh!");
- else
- return Mesh_getProperty_internal(&(me->vdata), self->index, args);
- }
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, Vertex not part of a mesh!");
-}
-
-static PyObject *MVert_setProp( BPy_MVert *self, PyObject *args)
-{
- if( BPy_MVert_Check( self ) ){
- Mesh *me = (Mesh *)self->data;
- if(self->index >= me->totvert)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, MVert is no longer valid part of mesh!");
- else
- return Mesh_setProperty_internal(&(me->vdata), self->index, args);
- }
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, Vertex not part of a mesh!");
-}
-
-static struct PyMethodDef BPy_MVert_methods[] = {
- {"getProperty", (PyCFunction)MVert_getProp, METH_O,
- "get property indicated by name"},
- {"setProperty", (PyCFunction)MVert_setProp, METH_VARARGS,
- "set property indicated by name"},
- {NULL, NULL, 0, NULL}
-};
-
-
-/************************************************************************
- *
- * Python MVert_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject MVert_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MVert", /* char *tp_name; */
- sizeof( BPy_MVert ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) MVert_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) MVert_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) MVert_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) MVert_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MVert_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MVert_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/************************************************************************
- *
- * Python PVert_Type standard operations
- *
- ************************************************************************/
-
-static int PVert_compare( BPy_MVert * a, BPy_MVert * b )
-{
- return( a->data == b->data ) ? 0 : -1;
-}
-
-/************************************************************************
- *
- * Python PVert_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject PVert_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender PVert", /* char *tp_name; */
- sizeof( BPy_MVert ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) MVert_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) PVert_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) MVert_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) MVert_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_PVert_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*
- * create 'thin' or 'thick' MVert objects
- *
- * there are two types of objects; thin (wrappers for mesh vertex) and thick
- * (not contains in mesh). Thin objects are MVert_Type and thick are
- * PVert_Type. For thin objects, data is a pointer to a Mesh and index
- * is the vertex's index in mesh->mvert. For thick objects, data is a
- * pointer to an MVert; index is unused.
- */
-
-/*
- * create a thin MVert object
- */
-
-static PyObject *MVert_CreatePyObject( Mesh *mesh, int i )
-{
- BPy_MVert *obj = (BPy_MVert *)PyObject_NEW( BPy_MVert, &MVert_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->index = i;
- obj->data = mesh;
- return (PyObject *)obj;
-}
-
-/*
- * create a thick MVert object
- */
-
-static PyObject *PVert_CreatePyObject( MVert *vert )
-{
- MVert *newvert;
- BPy_MVert *obj = (BPy_MVert *)PyObject_NEW( BPy_MVert, &PVert_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- newvert = (MVert *)MEM_callocN( sizeof( MVert ), "MVert" );
- if( !newvert )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MEM_callocN() failed" );
-
- memcpy( newvert, vert, sizeof( MVert ) );
- obj->data = newvert;
- return (PyObject *)obj;
-}
-
-/************************************************************************
- *
- * Vertex sequence
- *
- ************************************************************************/
-
-static int MVertSeq_len( BPy_MVertSeq * self )
-{
- return self->mesh->totvert;
-}
-
-/*
- * retrive a single MVert from somewhere in the vertex list
- */
-
-static PyObject *MVertSeq_item( BPy_MVertSeq * self, int i )
-{
- if( i < 0 || i >= self->mesh->totvert )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return MVert_CreatePyObject( self->mesh, i );
-}
-
-/*
- * retrieve a slice of the vertex list (as a Python list)
- *
- * Python is nice enough to handle negative indices for us: if the user
- * specifies -1, Python will pass us len()-1. So we can just check for
- * indices in the range 0:len()-1. Of course, we should never actually
- * return the high index, but up to one less.
- */
-
-static PyObject *MVertSeq_slice( BPy_MVertSeq *self, int low, int high )
-{
- PyObject *list;
- int i;
-
- /*
- * Python list slice operator returns empty list when asked for a slice
- * outside the list, or if indices are reversed (low > high). Clamp
- * our input to do the same.
- */
-
- if( low < 0 ) low = 0;
- if( high > self->mesh->totvert ) high = self->mesh->totvert;
- if( low > high ) low = high;
-
- list = PyList_New( high-low );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /*
- * return Py_NEW copies of requested vertices
- */
-
- for( i = low; i < high; ++i )
- PyList_SET_ITEM( list, i-low,
- PVert_CreatePyObject( (void *)&self->mesh->mvert[i] ) );
- return list;
-}
-
-/*
- * assign a single MVert to somewhere in the vertex list
- */
-
-static int MVertSeq_assign_item( BPy_MVertSeq * self, int i,
- BPy_MVert *v )
-{
- MVert *dst = &self->mesh->mvert[i];
- MVert *src;
-
- if( !v )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "del() not supported" );
-
- if( i < 0 || i >= self->mesh->totvert )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array index out of range" );
-
- if( BPy_MVert_Check( v ) )
- src = &((Mesh *)v->data)->mvert[v->index];
- else
- src = (MVert *)v->data;
-
- memcpy( dst, src, sizeof(MVert) );
- /* mesh_update( self->mesh );*/
- return 0;
-}
-
-static int MVertSeq_assign_slice( BPy_MVertSeq *self, int low, int high,
- PyObject *args )
-{
- int len, i;
-
- if( !PyList_Check( args ) )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "can only assign lists of MVerts" );
-
- len = PyList_Size( args );
-
- /*
- * Python list slice assign operator allows for changing the size of the
- * destination list, by replacement and appending....
- *
- * >>> l=[1,2,3,4]
- * >>> m=[11,12,13,14]
- * >>> l[5:7]=m
- * >>> print l
- * [1, 2, 3, 4, 11, 12, 13, 14]
- * >>> l=[1,2,3,4]
- * >>> l[2:3]=m
- * >>> print l
- * [1, 2, 11, 12, 13, 14, 4]
- *
- * We don't want the size of the list to change (at least not at time
- * point in development) so we are a little more strict:
- * - low and high indices must be in range [0:len()]
- * - high-low == PyList_Size(v)
- */
-
- if( low < 0 || high > self->mesh->totvert || low > high )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "invalid slice range" );
-
- if( high-low != len )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "slice range and input list sizes must be equal" );
-
- for( i = low; i < high; ++i )
- {
- BPy_MVert *v = (BPy_MVert *)PyList_GET_ITEM( args, i-low );
- MVert *dst = &self->mesh->mvert[i];
- MVert *src;
-
- if( BPy_MVert_Check( v ) )
- src = &((Mesh *)v->data)->mvert[v->index];
- else
- src = (MVert *)v->data;
-
- memcpy( dst, src, sizeof(MVert) );
- }
- /* mesh_update( self->mesh );*/
- return 0;
-}
-
-static PySequenceMethods MVertSeq_as_sequence = {
- ( inquiry ) MVertSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) MVertSeq_item, /* sq_item */
- ( intintargfunc ) MVertSeq_slice, /* sq_slice */
- ( intobjargproc ) MVertSeq_assign_item, /* sq_ass_item */
- ( intintobjargproc ) MVertSeq_assign_slice, /* sq_ass_slice */
- 0,0,0,
-};
-
-/************************************************************************
- *
- * Python MVertSeq_Type iterator (iterates over vertices)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *MVertSeq_getIter( BPy_MVertSeq * self )
-{
- if (self->iter==-1) { /* iteration for this pyobject is not yet used, just return self */
- self->iter = 0;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- /* were alredy using this as an iterator, make a copy to loop on */
- BPy_MVertSeq *seq = (BPy_MVertSeq *)MVertSeq_CreatePyObject(self->mesh);
- seq->iter = 0;
- return (PyObject *)seq;
- }
-}
-
-/*
- * Return next MVert.
- */
-
-static PyObject *MVertSeq_nextIter( BPy_MVertSeq * self )
-{
- if( self->iter == self->mesh->totvert ) {
- self->iter= -1; /* allow it to be used as an iterator again without creating a new BPy_MVertSeq */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- return MVert_CreatePyObject( self->mesh, self->iter++ );
-}
-
-/************************************************************************
- *
- * Python MVertSeq_Type methods
- *
- ************************************************************************/
-
-static PyObject *MVertSeq_extend( BPy_MVertSeq * self, PyObject *args )
-{
- int len, newlen;
- int i,j;
- PyObject *tmp;
- MVert *newvert, *tmpvert;
- Mesh *mesh = self->mesh;
- CustomData vdata;
- /* make sure we get a sequence of tuples of something */
-
- switch( PySequence_Size( args ) ) {
- case 1: /* better be a list or a tuple */
- tmp = PyTuple_GET_ITEM( args, 0 );
- if( !VectorObject_Check ( tmp ) ) {
- if( !PySequence_Check ( tmp ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence triplets" );
- else if( !PySequence_Size ( tmp ) ) {
- Py_RETURN_NONE;
- }
- args = tmp;
- }
- Py_INCREF( args ); /* so we can safely DECREF later */
- break;
- case 3:
- tmp = PyTuple_GET_ITEM( args, 0 );
- /* if first item is not a number, it's wrong */
- if( !PyNumber_Check( tmp ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence triplets" );
-
- /* otherwise, put into a new tuple */
- args = Py_BuildValue( "((OOO))", tmp,
- PyTuple_GET_ITEM( args, 1 ), PyTuple_GET_ITEM( args, 2 ) );
- if( !args )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Py_BuildValue() failed" );
- break;
-
- default: /* anything else is definitely wrong */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence triplets" );
- }
-
- /* if no verts given, return quietly */
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_DECREF ( args );
- Py_RETURN_NONE;
- }
-
- /* create custom vertex data arrays and copy existing vertices into it */
-
- newlen = mesh->totvert + len;
- CustomData_copy( &mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, newlen );
- CustomData_copy_data( &mesh->vdata, &vdata, 0, 0, mesh->totvert );
-
- if ( !CustomData_has_layer( &vdata, CD_MVERT ) )
- CustomData_add_layer( &vdata, CD_MVERT, CD_CALLOC, NULL, newlen );
-
- newvert = CustomData_get_layer( &vdata, CD_MVERT );
-
- /* scan the input list and insert the new vertices */
-
- tmpvert = &newvert[mesh->totvert];
- for( i = 0; i < len; ++i ) {
- float co[3];
- tmp = PySequence_GetItem( args, i );
- if( VectorObject_Check( tmp ) ) {
- if( ((VectorObject *)tmp)->size != 3 ) {
- CustomData_free( &vdata, newlen );
- Py_DECREF ( tmp );
- Py_DECREF ( args );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected vector of size 3" );
- }
- for( j = 0; j < 3; ++j )
- co[j] = ((VectorObject *)tmp)->vec[j];
- } else if( PySequence_Check( tmp ) ) {
- int ok=1;
- PyObject *flt;
- if( PySequence_Size( tmp ) != 3 )
- ok = 0;
- else
- for( j = 0; ok && j < 3; ++j ) {
- flt = PySequence_ITEM( tmp, j );
- if( !PyNumber_Check ( flt ) )
- ok = 0;
- else
- co[j] = (float)PyFloat_AsDouble( flt );
- Py_DECREF( flt );
- }
-
- if( !ok ) {
- CustomData_free( &vdata, newlen );
- Py_DECREF ( args );
- Py_DECREF ( tmp );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected sequence triplet of floats" );
- }
- } else {
- CustomData_free( &vdata, newlen );
- Py_DECREF ( args );
- Py_DECREF ( tmp );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected sequence triplet of floats" );
- }
-
- Py_DECREF ( tmp );
-
- /* add the coordinate to the new list */
- memcpy( tmpvert->co, co, sizeof(co) );
-
- tmpvert->flag |= SELECT;
- /* TODO: anything else which needs to be done when we add a vert? */
- /* probably not: NMesh's newvert() doesn't */
- ++tmpvert;
- }
-
- CustomData_free( &mesh->vdata, mesh->totvert );
- mesh->vdata = vdata;
- mesh_update_customdata_pointers( mesh );
-
- /*
- * if there are keys, have to fix those lists up
- */
-
- if( mesh->key ) {
- KeyBlock *currkey = mesh->key->block.first;
- float *fp, *newkey;
-
- while( currkey ) {
-
- /* create key list, copy existing data if any */
- newkey = MEM_callocN(mesh->key->elemsize*newlen, "keydata");
- if( currkey->data ) {
- memcpy( newkey, currkey->data,
- mesh->totvert*mesh->key->elemsize );
- MEM_freeN( currkey->data );
- currkey->data = newkey;
- }
-
- /* add data for new vertices */
- fp = (float *)((char *)currkey->data +
- (mesh->key->elemsize*mesh->totvert));
- tmpvert = mesh->mvert + mesh->totvert;
- for( i = newlen - mesh->totvert; i > 0; --i ) {
- VECCOPY(fp, tmpvert->co);
- fp += 3;
- tmpvert++;
- }
- currkey->totelem = newlen;
- currkey = currkey->next;
- }
- }
-
- /* set final vertex list size */
- mesh->totvert = newlen;
-
- mesh_update( mesh );
-
- Py_DECREF ( args );
- Py_RETURN_NONE;
-}
-
-static PyObject *MVertSeq_delete( BPy_MVertSeq * self, PyObject *args )
-{
- unsigned int *vert_table;
- int vert_delete, face_count;
- int i;
- Mesh *mesh = self->mesh;
- MFace *tmpface;
-
- /*
- * if input tuple contains a single sequence, use it as input instead;
- * otherwise use the sequence as-is and check later that it contains
- * one or more integers or MVerts
- */
- if( PySequence_Size( args ) == 1 ) {
- PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
- if( PySequence_Check( tmp ) )
- args = tmp;
- }
-
- /* if sequence is empty, do nothing */
- if( PySequence_Size( args ) == 0 ) {
- Py_RETURN_NONE;
- }
-
- /* allocate vertex lookup table */
- vert_table = (unsigned int *)MEM_callocN(
- mesh->totvert*sizeof( unsigned int ), "vert_table" );
-
- /* get the indices of vertices to be removed */
- for( i = PySequence_Size( args ); i--; ) {
- PyObject *tmp = PySequence_GetItem( args, i );
- int index;
- if( BPy_MVert_Check( tmp ) ) {
- if( (void *)self->mesh != ((BPy_MVert*)tmp)->data ) {
- MEM_freeN( vert_table );
- Py_DECREF( tmp );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "MVert belongs to a different mesh" );
- }
- index = ((BPy_MVert*)tmp)->index;
- } else if( PyInt_Check( tmp ) ) {
- index = PyInt_AsLong ( tmp );
- } else {
- MEM_freeN( vert_table );
- Py_DECREF( tmp );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of ints or MVerts" );
- }
- Py_DECREF( tmp );
- if( index < 0 || index >= mesh->totvert ) {
- MEM_freeN( vert_table );
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
- }
- vert_table[index] = UINT_MAX;
- }
-
- /* delete things, then clean up and return */
-
- vert_delete = make_vertex_table( vert_table, mesh->totvert );
- if( vert_delete )
- delete_verts( mesh, vert_table, vert_delete );
-
- /* calculate edges to delete, fix vertex indices */
- delete_edges( mesh, vert_table, 0 );
-
- /*
- * find number of faces which contain any of the deleted vertices,
- * and mark them, then delete them
- */
- tmpface = mesh->mface;
- face_count=0;
- for( i = mesh->totface; i--; ++tmpface ) {
- if( vert_table[tmpface->v1] == UINT_MAX ||
- vert_table[tmpface->v2] == UINT_MAX ||
- vert_table[tmpface->v3] == UINT_MAX ||
- ( tmpface->v4 && vert_table[tmpface->v4] == UINT_MAX ) ) {
- tmpface->v1 = UINT_MAX;
- ++face_count;
- }
- }
- delete_faces( mesh, vert_table, face_count );
-
- /* clean up and exit */
- MEM_freeN( vert_table );
- mesh_update ( mesh );
- Py_RETURN_NONE;
-}
-
-static PyObject *MVertSeq_selected( BPy_MVertSeq * self )
-{
- int i, count;
- Mesh *mesh = self->mesh;
- MVert *tmpvert;
- PyObject *list;
-
- /* first count selected edges (quicker than appending to PyList?) */
- count = 0;
- tmpvert = mesh->mvert;
- for( i = 0; i < mesh->totvert; ++i, ++tmpvert )
- if( tmpvert->flag & SELECT )
- ++count;
-
- list = PyList_New( count );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /* next, insert selected edges into list */
- count = 0;
- tmpvert = mesh->mvert;
- for( i = 0; i < mesh->totvert; ++i, ++tmpvert ) {
- if( tmpvert->flag & SELECT ) {
- PyObject *tmp = PyInt_FromLong( i );
- if( !tmp ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- PyList_SET_ITEM( list, count, tmp );
- ++count;
- }
- }
- return list;
-}
-static PyObject *MVertSeq_add_layertype(BPy_MVertSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_addPropLayer_internal(me, &(me->vdata), me->totvert, args);
-}
-static PyObject *MVertSeq_del_layertype(BPy_MVertSeq *self, PyObject *value)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_removePropLayer_internal(me, &(me->vdata), me->totvert, value);
-}
-static PyObject *MVertSeq_rename_layertype(BPy_MVertSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_renamePropLayer_internal(me,&(me->vdata),args);
-}
-static PyObject *MVertSeq_PropertyList(BPy_MVertSeq *self)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_propList_internal(&(me->vdata));
-}
-static PyObject *M_Mesh_PropertiesTypeDict(void)
-{
- PyObject *Types = PyConstant_New( );
- if(Types) {
- BPy_constant *d = (BPy_constant *) Types;
- PyConstant_Insert(d, "FLOAT", PyInt_FromLong(CD_PROP_FLT));
- PyConstant_Insert(d, "INT" , PyInt_FromLong(CD_PROP_INT));
- PyConstant_Insert(d, "STRING", PyInt_FromLong(CD_PROP_STR));
- }
- return Types;
-}
-
-static struct PyMethodDef BPy_MVertSeq_methods[] = {
- {"extend", (PyCFunction)MVertSeq_extend, METH_VARARGS,
- "add vertices to mesh"},
- {"delete", (PyCFunction)MVertSeq_delete, METH_VARARGS,
- "delete vertices from mesh"},
- {"selected", (PyCFunction)MVertSeq_selected, METH_NOARGS,
- "returns a list containing indices of selected vertices"},
- {"addPropertyLayer",(PyCFunction)MVertSeq_add_layertype, METH_VARARGS,
- "add a new property layer"},
- {"removePropertyLayer",(PyCFunction)MVertSeq_del_layertype, METH_O,
- "removes a property layer"},
- {"renamePropertyLayer",(PyCFunction)MVertSeq_rename_layertype, METH_VARARGS,
- "renames an existing property layer"},
- {NULL, NULL, 0, NULL}
-};
-
-static PyGetSetDef BPy_MVertSeq_getseters[] = {
- {"properties",
- (getter)MVertSeq_PropertyList, (setter)NULL,
- "vertex property layers, read only",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-
-/************************************************************************
- *
- * Python MVertSeq_Type standard operations
- *
- ************************************************************************/
-
-/*****************************************************************************/
-/* Python MVertSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject MVertSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MVertSeq", /* char *tp_name; */
- sizeof( BPy_MVertSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MVertSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) MVertSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) MVertSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MVertSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MVertSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/************************************************************************
- *
- * Edge attributes
- *
- ************************************************************************/
-
-static MEdge * MEdge_get_pointer( BPy_MEdge * self )
-{
- if( self->index >= self->mesh->totedge )
- return (MEdge *)EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MEdge is no longer valid" );
- return &self->mesh->medge[self->index];
-}
-
-/*
- * get an edge's crease value
- */
-
-static PyObject *MEdge_getCrease( BPy_MEdge * self )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL;
-
- return PyInt_FromLong( edge->crease );
-}
-
-/*
- * set an edge's crease value
- */
-
-static int MEdge_setCrease( BPy_MEdge * self, PyObject * value )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return -1;
-
- return EXPP_setIValueClamped( value, &edge->crease, 0, 255, 'b' );
-}
-
-/*
- * get an edge's flag
- */
-
-static PyObject *MEdge_getFlag( BPy_MEdge * self )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL;
-
- return PyInt_FromLong( edge->flag );
-}
-
-/*
- * set an edge's flag
- */
-
-static int MEdge_setFlag( BPy_MEdge * self, PyObject * value )
-{
- short param;
- static short bitmask = SELECT
- | ME_EDGEDRAW
- | ME_SEAM
- | ME_FGON
- | ME_HIDE
- | ME_EDGERENDER
- | ME_LOOSEEDGE
- | ME_SEAM_LAST
- | ME_SHARP;
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return -1;
-
- if( !PyInt_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = (short)PyInt_AS_LONG ( value );
-
- if ( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- edge->flag = param;
-
- return 0;
-}
-
-/*
- * get an edge's first vertex
- */
-
-static PyObject *MEdge_getV1( BPy_MEdge * self )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL;
-
- return MVert_CreatePyObject( self->mesh, edge->v1 );
-}
-
-/*
- * set an edge's first vertex
- */
-
-static int MEdge_setV1( BPy_MEdge * self, BPy_MVert * value )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return -1;
- if( !BPy_MVert_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected an MVert" );
-
- edge->v1 = value->index;
- return 0;
-}
-
-/*
- * get an edge's second vertex
- */
-
-static PyObject *MEdge_getV2( BPy_MEdge * self )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL; /* error is set */
- /* if v2 is out of range, the python mvert will complain, no need to check here */
- return MVert_CreatePyObject( self->mesh, edge->v2 );
-}
-
-/*
- * set an edge's second vertex
- */
-
-static int MEdge_setV2( BPy_MEdge * self, BPy_MVert * value )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return -1; /* error is set */
- if( !BPy_MVert_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected an MVert" );
-
- if ( edge->v1 == value->index )
- return EXPP_ReturnIntError( PyExc_ValueError, "an edge cant use the same vertex for each end" );
-
- edge->v2 = value->index;
- return 0;
-}
-
-/*
- * get an edge's index
- */
-
-static PyObject *MEdge_getIndex( BPy_MEdge * self )
-{
- if( !MEdge_get_pointer( self ) )
- return NULL; /* error is set */
-
- return PyInt_FromLong( self->index );
-}
-
-/*
- * get an edge's flag
- */
-
-static PyObject *MEdge_getMFlagBits( BPy_MEdge * self, void * type )
-{
- MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL; /* error is set */
-
- return EXPP_getBitfield( &edge->flag, (int)((long)type & 0xff), 'b' );
-}
-
-/*
- * get an edge's length
- */
-
-static PyObject *MEdge_getLength( BPy_MEdge * self )
-{
- MEdge *edge = MEdge_get_pointer( self );
- double dot = 0.0f;
- float tmpf;
- int i;
- float *v1, *v2;
-
- if (!edge)
- return NULL; /* error is set */
-
- if MEDGE_VERT_BADRANGE_CHECK(self->mesh, edge)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "This edge uses removed vert(s)" );
-
- /* get the 2 edges vert locations */
- v1= (&((Mesh *)self->mesh)->mvert[edge->v1])->co;
- v2= (&((Mesh *)self->mesh)->mvert[edge->v2])->co;
-
- if( !edge )
- return NULL;
-
- for( i = 0; i < 3; i++ ) {
- tmpf = v1[i] - v2[i];
- dot += tmpf*tmpf;
- }
- return PyFloat_FromDouble( sqrt( dot ) );
-}
-
-/*
- * get an key for using in a dictionary or set key
- */
-
-static PyObject *MEdge_getKey( BPy_MEdge * self )
-{
- PyObject *attr;
- MEdge *edge = MEdge_get_pointer( self );
- if (!edge)
- return NULL; /* error is set */
-
- attr = PyTuple_New( 2 );
- if (edge->v1 > edge->v2) {
- PyTuple_SET_ITEM( attr, 0, PyInt_FromLong(edge->v2) );
- PyTuple_SET_ITEM( attr, 1, PyInt_FromLong(edge->v1) );
- } else {
- PyTuple_SET_ITEM( attr, 0, PyInt_FromLong(edge->v1) );
- PyTuple_SET_ITEM( attr, 1, PyInt_FromLong(edge->v2) );
- }
- return attr;
-}
-
-/*
- * set an edge's select state
- */
-
-static int MEdge_setSel( BPy_MEdge * self,PyObject * value,
- void * type_unused )
-{
- MEdge *edge = MEdge_get_pointer( self );
- int param = PyObject_IsTrue( value );
- Mesh *me = self->mesh;
-
- if( !edge )
- return -1;
-
- if MEDGE_VERT_BADRANGE_CHECK(me, edge)
- return EXPP_ReturnIntError( PyExc_RuntimeError, "This edge uses removed vert(s)" );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param ) {
- edge->flag |= SELECT;
- me->mvert[edge->v1].flag |= SELECT;
- me->mvert[edge->v2].flag |= SELECT;
- }
- else {
- edge->flag &= ~SELECT;
- me->mvert[edge->v1].flag &= ~SELECT;
- me->mvert[edge->v2].flag &= ~SELECT;
- }
-
- if( self->mesh->mselect ) {
- MEM_freeN( self->mesh->mselect );
- self->mesh->mselect = NULL;
- }
-
- return 0;
-}
-
-/************************************************************************
- *
- * Python MEdge_Type attributes get/set structure
- *
- ************************************************************************/
-
-static PyGetSetDef BPy_MEdge_getseters[] = {
- {"crease",
- (getter)MEdge_getCrease, (setter)MEdge_setCrease,
- "edge's crease value",
- NULL},
- {"flag",
- (getter)MEdge_getFlag, (setter)MEdge_setFlag,
- "edge's flags",
- NULL},
- {"v1",
- (getter)MEdge_getV1, (setter)MEdge_setV1,
- "edge's first vertex",
- NULL},
- {"v2",
- (getter)MEdge_getV2, (setter)MEdge_setV2,
- "edge's second vertex",
- NULL},
- {"index",
- (getter)MEdge_getIndex, (setter)NULL,
- "edge's index",
- NULL},
- {"sel",
- (getter)MEdge_getMFlagBits, (setter)MEdge_setSel,
- "edge selected in edit mode",
- (void *)SELECT},
- {"length",
- (getter)MEdge_getLength, (setter)NULL,
- "edge's length, read only",
- NULL},
- {"key",
- (getter)MEdge_getKey, (setter)NULL,
- "edge's key for using with sets or dictionaries, read only",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/************************************************************************
- *
- * Python MEdge_Type iterator (iterates over vertices)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *MEdge_getIter( BPy_MEdge * self )
-{
- if (self->iter==-1) { /* not alredy used to iterator on, just use self */
- self->iter = 0;
- return EXPP_incr_ret ( (PyObject *) self );
- } else { /* alredy being iterated on, return a copy */
- BPy_MEdge *seq = (BPy_MEdge *)MEdge_CreatePyObject(self->mesh, self->index);
- seq->iter = 0;
- return (PyObject *)seq;
- }
-}
-
-/*
- * Return next MVert. Throw an exception after the second vertex.
- */
-
-static PyObject *MEdge_nextIter( BPy_MEdge * self )
-{
- if( self->iter == 2 ) {
- self->iter = -1;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- self->iter++;
- if( self->iter == 1 )
- return MEdge_getV1( self );
- else
- return MEdge_getV2( self );
-}
-
-/************************************************************************
- *
- * Python MEdge_Type standard operations
- *
- ************************************************************************/
-
-static int MEdge_compare( BPy_MEdge * a, BPy_MEdge * b )
-{
- return( a->mesh == b->mesh && a->index == b->index ) ? 0 : -1;
-}
-
-static PyObject *MEdge_repr( BPy_MEdge * self )
-{
- struct MEdge *edge = MEdge_get_pointer( self );
-
- if( !edge )
- return NULL;
-
- return PyString_FromFormat( "[MEdge (%d %d) %d %d]",
- (int)edge->v1, (int)edge->v2, (int)edge->crease,
- (int)self->index );
-}
-
-static long MEdge_hash( BPy_MEdge *self )
-{
- return (long)self->index;
-}
-static PyObject *MEdge_getProp( BPy_MEdge *self, PyObject *args)
-{
- Mesh *me = (Mesh *)self->mesh;
- return Mesh_getProperty_internal(&(me->edata), self->index, args);
-}
-
-static PyObject *MEdge_setProp( BPy_MEdge *self, PyObject *args)
-{
- Mesh *me = (Mesh *)self->mesh;
- return Mesh_setProperty_internal(&(me->edata), self->index, args);
-}
-
-static struct PyMethodDef BPy_MEdge_methods[] = {
- {"getProperty", (PyCFunction)MEdge_getProp, METH_O,
- "get property indicated by name"},
- {"setProperty", (PyCFunction)MEdge_setProp, METH_VARARGS,
- "set property indicated by name"},
- {NULL, NULL, 0, NULL}
-};
-/************************************************************************
- *
- * Python MEdge_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject MEdge_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MEdge", /* char *tp_name; */
- sizeof( BPy_MEdge ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) MEdge_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) MEdge_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) MEdge_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) MEdge_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) MEdge_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MEdge_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MEdge_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *MEdge_CreatePyObject( Mesh * mesh, int i )
-{
- BPy_MEdge *obj = PyObject_NEW( BPy_MEdge, &MEdge_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->mesh = mesh;
- obj->index = i;
- obj->iter = -1;
- return (PyObject *)obj;
-}
-
-/************************************************************************
- *
- * Edge sequence
- *
- ************************************************************************/
-
-static int MEdgeSeq_len( BPy_MEdgeSeq * self )
-{
- return self->mesh->totedge;
-}
-
-static PyObject *MEdgeSeq_item( BPy_MEdgeSeq * self, int i )
-{
- if( i < 0 || i >= self->mesh->totedge )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return MEdge_CreatePyObject( self->mesh, i );
-}
-
-
-static PySequenceMethods MEdgeSeq_as_sequence = {
- ( inquiry ) MEdgeSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) MEdgeSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-/************************************************************************
- *
- * Python MEdgeSeq_Type iterator (iterates over edges)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *MEdgeSeq_getIter( BPy_MEdgeSeq * self )
-{
- if (self->iter==-1) { /* iteration for this pyobject is not yet used, just return self */
- self->iter = 0;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- BPy_MEdgeSeq *seq = (BPy_MEdgeSeq *)MEdgeSeq_CreatePyObject(self->mesh);
- seq->iter = 0;
- return (PyObject *)seq;
- }
-}
-
-/*
- * Return next MEdge.
- */
-
-static PyObject *MEdgeSeq_nextIter( BPy_MEdgeSeq * self )
-{
- if( self->iter == self->mesh->totedge ) {
- self->iter= -1;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- return MEdge_CreatePyObject( self->mesh, self->iter++ );
-}
-
-/************************************************************************
- *
- * Python MEdgeSeq_Type methods
- *
- ************************************************************************/
-
-/*
- * Create edges from tuples of vertices. Duplicate new edges, or
- * edges which already exist,
- */
-
-static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args )
-{
- int len, nverts;
- int i, j, ok;
- int new_edge_count, good_edges;
- SrchEdges *oldpair, *newpair, *tmppair, *tmppair2;
- PyObject *tmp;
- BPy_MVert *e[4];
- MEdge *tmpedge;
- Mesh *mesh = self->mesh;
-
- /* make sure we get a tuple of sequences of something */
- switch( PySequence_Size( args ) ) {
- case 1:
- /* if a sequence... */
- tmp = PyTuple_GET_ITEM( args, 0 );
- if( PySequence_Check( tmp ) ) {
- PyObject *tmp2;
-
- /* ignore empty sequences */
- if( !PySequence_Size( tmp ) ) {
- Py_RETURN_NONE;
- }
-
- /* if another sequence, use it */
- tmp2 = PySequence_ITEM( tmp, 0 );
- if( PySequence_Check( tmp2 ) )
- args = tmp;
- Py_INCREF( args );
- Py_DECREF( tmp2 );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- break;
- case 2:
- case 3:
- case 4: /* two to four args may be individual verts */
- tmp = PyTuple_GET_ITEM( args, 0 );
- /*
- * if first item isn't a sequence, then assume it's a bunch of MVerts
- * and wrap inside a tuple
- */
- if( !PySequence_Check( tmp ) ) {
- args = Py_BuildValue( "(O)", args );
- if( !args )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Py_BuildValue() failed" );
- /*
- * otherwise, assume it already a bunch of sequences so use as-is
- */
- } else {
- Py_INCREF( args ); /* so we can safely DECREF later */
- }
- break;
- default: /* anything else is definitely wrong */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- }
-
- /* make sure there is something to add */
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_DECREF ( args );
- Py_RETURN_NONE;
- }
-
- /* verify the param list and get a total count of number of edges */
- new_edge_count = 0;
- for( i = 0; i < len; ++i ) {
- tmp = PySequence_GetItem( args, i );
-
- /* not a tuple of MVerts... error */
- if( !PySequence_Check( tmp ) ) {
- Py_DECREF( tmp );
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected sequence of MVert sequences" );
- }
-
- /* not the right number of MVerts... error */
- nverts = PySequence_Size( tmp );
- if( nverts < 2 || nverts > 4 ) {
- Py_DECREF( tmp );
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected 2 to 4 MVerts per sequence" );
- }
-
- if( EXPP_check_sequence_consistency( tmp, &MVert_Type ) == 1 ) {
-
- /* get MVerts, check they're from this mesh */
- ok = 1;
- for( j = 0; ok && j < nverts; ++j ) {
- e[0] = (BPy_MVert *)PySequence_GetItem( tmp, j );
- if( (void *)e[0]->data != (void *)self->mesh )
- ok = 0;
- Py_DECREF( e[0] );
- }
- Py_DECREF( tmp );
-
- /* not MVerts from another mesh ... error */
- if( !ok ) {
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "vertices are from a different mesh" );
- }
- } else {
- ok = 0;
- for( j = 0; ok == 0 && j < nverts; ++j ) {
- PyObject *item = PySequence_ITEM( tmp, j );
- if( !PyInt_Check( item ) )
- ok = 1;
- else {
- int index = PyInt_AsLong ( item );
- if( index < 0 || index >= self->mesh->totvert )
- ok = 2;
- }
- Py_DECREF( item );
- }
- Py_DECREF( tmp );
-
- /* not ints or outside of vertex list ... error */
- if( ok ) {
- Py_DECREF( args );
- if( ok == 1 )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an integer index" );
- else
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "index out of range" );
- }
- }
-
- if( nverts == 2 )
- ++new_edge_count; /* if only two vert, then add only edge */
- else
- new_edge_count += nverts; /* otherwise, one edge per vert */
- }
-
- /* OK, commit to allocating the search structures */
- newpair = (SrchEdges *)MEM_callocN( sizeof(SrchEdges)*new_edge_count,
- "MEdgePairs" );
-
- /* scan the input list and build the new edge pair list */
- len = PySequence_Size( args );
- tmppair = newpair;
- new_edge_count = 0;
- for( i = 0; i < len; ++i ) {
- int edge_count;
- int eedges[4];
- tmp = PySequence_GetItem( args, i );
- nverts = PySequence_Size( tmp );
-
- /* get new references for the vertices */
- for(j = 0; j < nverts; ++j ) {
- PyObject *item = PySequence_ITEM( tmp, j );
- if( BPy_MVert_Check( item ) ) {
- eedges[j] = ((BPy_MVert *)item)->index;
- } else {
- eedges[j] = PyInt_AsLong ( item );
- }
- Py_DECREF( item );
- }
- Py_DECREF( tmp );
-
- if( nverts == 2 )
- edge_count = 1; /* again, two verts give just one edge */
- else
- edge_count = nverts;
-
- /* now add the edges to the search list */
- for( j = 0; j < edge_count; ++j ) {
- int k = j+1;
- if( k == nverts ) /* final edge */
- k = 0;
-
- /* sort verts into search list, skip if two are the same */
- if( eedges[j] != eedges[k] ) {
- if( eedges[j] < eedges[k] ) {
- tmppair->v[0] = eedges[j];
- tmppair->v[1] = eedges[k];
- tmppair->swap = 0;
- } else {
- tmppair->v[0] = eedges[k];
- tmppair->v[1] = eedges[j];
- tmppair->swap = 1;
- }
- tmppair->index = new_edge_count;
- ++new_edge_count;
- tmppair++;
- }
- }
-
- }
-
- /* sort the new edge pairs */
- qsort( newpair, new_edge_count, sizeof(SrchEdges), medge_comp );
-
- /*
- * find duplicates in the new list and mark. if it's a duplicate,
- * then mark by setting second vert index to 0 (a real edge won't have
- * second vert index of 0 since verts are sorted)
- */
-
- good_edges = new_edge_count; /* all edges are good at this point */
-
- tmppair = newpair; /* "last good edge" */
- tmppair2 = &tmppair[1]; /* "current candidate edge" */
- for( i = 0; i < new_edge_count; ++i ) {
- if( tmppair->v[0] != tmppair2->v[0] ||
- tmppair->v[1] != tmppair2->v[1] )
- tmppair = tmppair2; /* last != current, so current == last */
- else {
- tmppair2->v[1] = 0; /* last == current, so mark as duplicate */
- --good_edges; /* one less good edge */
- }
- tmppair2++;
- }
-
- /* if mesh has edges, see if any of the new edges are already in it */
- if( mesh->totedge ) {
- oldpair = (SrchEdges *)MEM_callocN( sizeof(SrchEdges)*mesh->totedge,
- "MEdgePairs" );
-
- /*
- * build a search list of new edges (don't need to update "swap"
- * field, since we're not creating edges here)
- */
- tmppair = oldpair;
- tmpedge = mesh->medge;
- for( i = 0; i < mesh->totedge; ++i ) {
- if( tmpedge->v1 < tmpedge->v2 ) {
- tmppair->v[0] = tmpedge->v1;
- tmppair->v[1] = tmpedge->v2;
- } else {
- tmppair->v[0] = tmpedge->v2;
- tmppair->v[1] = tmpedge->v1;
- }
- ++tmpedge;
- ++tmppair;
- }
-
- /* sort the old edge pairs */
- qsort( oldpair, mesh->totedge, sizeof(SrchEdges), medge_comp );
-
- /* eliminate new edges already in the mesh */
- tmppair = newpair;
- for( i = new_edge_count; i-- ; ) {
- if( tmppair->v[1] ) {
- if( bsearch( tmppair, oldpair, mesh->totedge,
- sizeof(SrchEdges), medge_comp ) ) {
- tmppair->v[1] = 0; /* mark as duplicate */
- --good_edges;
- }
- }
- tmppair++;
- }
- MEM_freeN( oldpair );
- }
-
- /* if any new edges are left, add to list */
- if( good_edges ) {
- CustomData edata;
- int totedge = mesh->totedge+good_edges;
-
- /* create custom edge data arrays and copy existing edges into it */
- CustomData_copy( &mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge );
- CustomData_copy_data( &mesh->edata, &edata, 0, 0, mesh->totedge );
-
- if ( !CustomData_has_layer( &edata, CD_MEDGE ) )
- CustomData_add_layer( &edata, CD_MEDGE, CD_CALLOC, NULL, totedge );
-
- /* replace old with new data */
- CustomData_free( &mesh->edata, mesh->totedge );
- mesh->edata = edata;
- mesh_update_customdata_pointers( mesh );
-
- /* resort edges into original order */
- qsort( newpair, new_edge_count, sizeof(SrchEdges), medge_index_comp );
-
- /* point to the first edge we're going to add */
- tmpedge = &mesh->medge[mesh->totedge];
- tmppair = newpair;
-
- /* as we find a good edge, add it */
- while( good_edges ) {
- if( tmppair->v[1] ) { /* not marked as duplicate ! */
- if( !tmppair->swap ) {
- tmpedge->v1 = tmppair->v[0];
- tmpedge->v2 = tmppair->v[1];
- } else {
- tmpedge->v1 = tmppair->v[1];
- tmpedge->v2 = tmppair->v[0];
- }
- tmpedge->flag = ME_EDGEDRAW | ME_EDGERENDER | SELECT;
- mesh->totedge++;
- --good_edges;
- ++tmpedge;
- }
- tmppair++;
- }
- }
-
- /* clean up and leave */
- mesh_update( mesh );
- MEM_freeN( newpair );
- Py_DECREF ( args );
- Py_RETURN_NONE;
-}
-
-static PyObject *MEdgeSeq_delete( BPy_MEdgeSeq * self, PyObject *args )
-{
- Mesh *mesh = self->mesh;
- MEdge *srcedge;
- MFace *srcface;
- unsigned int *vert_table, *del_table, *edge_table;
- int i, len;
- int face_count, edge_count, vert_count;
-
- /*
- * if input tuple contains a single sequence, use it as input instead;
- * otherwise use the sequence as-is and check later that it contains
- * one or more integers or MVerts
- */
- if( PySequence_Size( args ) == 1 ) {
- PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
- if( PySequence_Check( tmp ) )
- args = tmp;
- }
-
- /* if sequence is empty, do nothing */
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_RETURN_NONE;
- }
-
- edge_table = (unsigned int *)MEM_callocN( len*sizeof( unsigned int ),
- "edge_table" );
-
- /* get the indices of edges to be removed */
- for( i = len; i--; ) {
- PyObject *tmp = PySequence_GetItem( args, i );
- if( BPy_MEdge_Check( tmp ) )
- edge_table[i] = ((BPy_MEdge *)tmp)->index;
- else if( PyInt_Check( tmp ) )
- edge_table[i] = PyInt_AsLong ( tmp );
- else {
- MEM_freeN( edge_table );
- Py_DECREF( tmp );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of ints or MEdges" );
- }
- Py_DECREF( tmp );
-
- /* if index out-of-range, throw exception */
- if( edge_table[i] >= (unsigned int)mesh->totedge ) {
- MEM_freeN( edge_table );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "array index out of range" );
- }
- }
-
- /*
- * build two tables: first table marks vertices which belong to an edge
- * which is being deleted
- */
- del_table = (unsigned int *)MEM_callocN(
- mesh->totvert*sizeof( unsigned int ), "vert_table" );
-
- /*
- * Borrow a trick from editmesh code: for each edge to be deleted, mark
- * its vertices as well. Then go through face list and look for two
- * consecutive marked vertices.
- */
-
- /* mark each edge that's to be deleted */
- srcedge = mesh->medge;
- for( i = len; i--; ) {
- unsigned int idx = edge_table[i];
- del_table[srcedge[idx].v1] = UINT_MAX;
- del_table[srcedge[idx].v2] = UINT_MAX;
- srcedge[idx].v1 = UINT_MAX;
- }
-
- /*
- * second table is used for vertices which become orphaned (belong to no
- * edges) and need to be deleted; it's also the normal lookup table for
- * old->new vertex indices
- */
-
- vert_table = (unsigned int *)MEM_mallocN(
- mesh->totvert*sizeof( unsigned int ), "vert_table" );
-
- /* assume all edges will be deleted (fills with UINT_MAX) */
- memset( vert_table, UCHAR_MAX, mesh->totvert*sizeof( unsigned int ) );
-
- /* unmark vertices of each "good" edge; count each "bad" edge */
- edge_count = 0;
- for( i = mesh->totedge; i--; ++srcedge )
- if( srcedge->v1 != UINT_MAX )
- vert_table[srcedge->v1] = vert_table[srcedge->v2] = 0;
- else
- ++edge_count;
-
- /*
- * find faces which no longer have all edges
- */
-
- face_count = 0;
- srcface = mesh->mface;
- for( i = 0; i < mesh->totface; ++i, ++srcface ) {
- int len = srcface->v4 ? 4 : 3;
- unsigned int id[4];
- int del;
-
- id[0] = del_table[srcface->v1];
- id[1] = del_table[srcface->v2];
- id[2] = del_table[srcface->v3];
- id[3] = del_table[srcface->v4];
-
- del = ( id[0] == UINT_MAX && id[1] == UINT_MAX ) ||
- ( id[1] == UINT_MAX && id[2] == UINT_MAX );
- if( !del ) {
- if( len == 3 )
- del = ( id[2] == UINT_MAX && id[0] == UINT_MAX );
- else
- del = ( id[2] == UINT_MAX && id[3] == UINT_MAX ) ||
- ( id[3] == UINT_MAX && id[0] == UINT_MAX );
- }
- if( del ) {
- srcface->v1 = UINT_MAX;
- ++face_count;
- }
- }
-
- /* fix the vertex lookup table, if any verts to delete, do so now */
- vert_count = make_vertex_table( vert_table, mesh->totvert );
- if( vert_count )
- delete_verts( mesh, vert_table, vert_count );
-
- /* delete faces which have a deleted edge */
- delete_faces( mesh, vert_table, face_count );
-
- /* now delete the edges themselves */
- delete_edges( mesh, vert_table, edge_count );
-
- /* clean up and return */
- MEM_freeN( del_table );
- MEM_freeN( vert_table );
- MEM_freeN( edge_table );
- mesh_update ( mesh );
- Py_RETURN_NONE;
-}
-
-static PyObject *MEdgeSeq_collapse( BPy_MEdgeSeq * self, PyObject *args )
-{
- MEdge *srcedge;
- unsigned int *edge_table;
- float (*vert_list)[3];
- int i, len;
- Base *base, *basact;
- Mesh *mesh = self->mesh;
- Object *object = NULL;
- PyObject *tmp;
-
- /*
- * when using removedoublesflag(), we need to switch to editmode, so
- * nobody else can be using it
- */
-
- if( G.obedit )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't use collapse() while in edit mode" );
-
- /* make sure we get a tuple of sequences of something */
- switch( PySequence_Size( args ) ) {
- case 1:
- /* if a sequence... */
- tmp = PyTuple_GET_ITEM( args, 0 );
- if( PySequence_Check( tmp ) ) {
- PyObject *tmp2;
-
- /* ignore empty sequences */
- if( !PySequence_Size( tmp ) ) {
- Py_RETURN_NONE;
- }
-
- /* if another sequence, use it */
- tmp2 = PySequence_ITEM( tmp, 0 );
- if( PySequence_Check( tmp2 ) )
- args = tmp;
- Py_INCREF( args );
- Py_DECREF( tmp2 );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- break;
- case 2: /* two args may be individual edges/verts */
- tmp = PyTuple_GET_ITEM( args, 0 );
- /*
- * if first item isn't a sequence, then assume it's a bunch of MVerts
- * and wrap inside a tuple
- */
- if( !PySequence_Check( tmp ) ) {
- args = Py_BuildValue( "(O)", args );
- if( !args )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Py_BuildValue() failed" );
- /*
- * otherwise, assume it already a bunch of sequences so use as-is
- */
- } else {
- Py_INCREF( args ); /* so we can safely DECREF later */
- }
- break;
- default: /* anything else is definitely wrong */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- }
-
- /* if sequence is empty, do nothing */
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_RETURN_NONE;
- }
-
- /* allocate table of edge indices and new vertex values */
-
- edge_table = (unsigned int *)MEM_callocN( len*sizeof( unsigned int ),
- "edge_table" );
- vert_list = (float (*)[3])MEM_callocN( 3*len*sizeof( float ),
- "vert_list" );
-
- /* get the indices of edges to be collapsed and new vert locations */
- for( i = len; i--; ) {
- PyObject *tmp1;
- PyObject *tmp2;
-
- tmp = PySequence_GetItem( args, i );
-
- /* if item isn't sequence of size 2, error */
- if( !PySequence_Check( tmp ) || PySequence_Size( tmp ) != 2 ) {
- MEM_freeN( edge_table );
- MEM_freeN( vert_list );
- Py_DECREF( tmp );
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of (MEdges, vector)" );
- }
-
- /* if items aren't a MEdge/int and vector, error */
- tmp1 = PySequence_GetItem( tmp, 0 );
- tmp2 = PySequence_GetItem( tmp, 1 );
- Py_DECREF( tmp );
- if( !(BPy_MEdge_Check( tmp1 ) || PyInt_Check( tmp1 )) ||
- !VectorObject_Check ( tmp2 ) ) {
- MEM_freeN( edge_table );
- MEM_freeN( vert_list );
- Py_DECREF( tmp1 );
- Py_DECREF( tmp2 );
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of (MEdges, vector)" );
- }
-
- /* store edge index, new vertex location */
- if( PyInt_Check( tmp1 ) )
- edge_table[i] = PyInt_AsLong ( tmp1 );
- else
- edge_table[i] = ((BPy_MEdge *)tmp1)->index;
- memcpy( vert_list[i], ((VectorObject *)tmp2)->vec,
- 3*sizeof( float ) );
- Py_DECREF( tmp1 );
- Py_DECREF( tmp2 );
-
- /* if index out-of-range, throw exception */
- if( edge_table[i] >= (unsigned int)mesh->totedge ) {
- MEM_freeN( edge_table );
- MEM_freeN( vert_list );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "edge index out of range" );
- }
- }
-
- /*
- * simple algorithm:
- * (1) deselect all verts
- * (2) for each edge
- * (2a) replace both verts with the new vert
- * (2b) select both verts
- * (3) call removedoublesflag()
- */
-
- /* (1) deselect all verts */
- for( i = mesh->totvert; i--; )
- mesh->mvert[i].flag &= ~SELECT;
-
- /* (2) replace edge's verts and select them */
- for( i = len; i--; ) {
- srcedge = &mesh->medge[edge_table[i]];
- memcpy( &mesh->mvert[srcedge->v1].co, vert_list[i], 3*sizeof( float ) );
- memcpy( &mesh->mvert[srcedge->v2].co, vert_list[i], 3*sizeof( float ) );
- mesh->mvert[srcedge->v1].flag |= SELECT;
- mesh->mvert[srcedge->v2].flag |= SELECT;
- }
-
- /* (3) call removedoublesflag() */
- for( base = FIRSTBASE; base; base = base->next ) {
- if( base->object->type == OB_MESH &&
- base->object->data == self->mesh ) {
- object = base->object;
- break;
- }
- }
-
- basact = BASACT;
- BASACT = base;
-
- removedoublesflag( 1, 0, 0.0 );
- /* make mesh's object active, enter mesh edit mode */
- G.obedit = object;
-
- /* exit edit mode, free edit mesh */
- load_editMesh();
- free_editMesh(G.editMesh);
-
- BASACT = basact;
-
- /* clean up and exit */
- Py_DECREF( args );
- MEM_freeN( vert_list );
- MEM_freeN( edge_table );
- mesh_update ( mesh );
- Py_RETURN_NONE;
-}
-
-
-static PyObject *MEdgeSeq_selected( BPy_MEdgeSeq * self )
-{
- int i, count;
- Mesh *mesh = self->mesh;
- MEdge *tmpedge;
- PyObject *list;
-
- /* first count selected edges (quicker than appending to PyList?) */
- count = 0;
- tmpedge = mesh->medge;
- for( i = 0; i < mesh->totedge; ++i, ++tmpedge )
- if( (mesh->mvert[tmpedge->v1].flag & SELECT) &&
- (mesh->mvert[tmpedge->v2].flag & SELECT) )
- ++count;
-
- list = PyList_New( count );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /* next, insert selected edges into list */
- count = 0;
- tmpedge = mesh->medge;
- for( i = 0; i < mesh->totedge; ++i, ++tmpedge ) {
- if( (mesh->mvert[tmpedge->v1].flag & SELECT) &&
- (mesh->mvert[tmpedge->v2].flag & SELECT) ) {
- PyObject *tmp = PyInt_FromLong( i );
- if( !tmp ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- PyList_SET_ITEM( list, count, tmp );
- ++count;
- }
- }
- return list;
-}
-
-static PyObject *MEdgeSeq_add_layertype(BPy_MEdgeSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_addPropLayer_internal(me, &(me->edata), me->totedge, args);
-}
-static PyObject *MEdgeSeq_del_layertype(BPy_MEdgeSeq *self, PyObject *value)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_removePropLayer_internal(me, &(me->edata), me->totedge, value);
-}
-static PyObject *MEdgeSeq_rename_layertype(BPy_MEdgeSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_renamePropLayer_internal(me,&(me->edata),args);
-}
-static PyObject *MEdgeSeq_PropertyList(BPy_MEdgeSeq *self)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_propList_internal(&(me->edata));
-}
-
-
-static struct PyMethodDef BPy_MEdgeSeq_methods[] = {
- {"extend", (PyCFunction)MEdgeSeq_extend, METH_VARARGS,
- "add edges to mesh"},
- {"delete", (PyCFunction)MEdgeSeq_delete, METH_VARARGS,
- "delete edges from mesh"},
- {"selected", (PyCFunction)MEdgeSeq_selected, METH_NOARGS,
- "returns a list containing indices of selected edges"},
- {"collapse", (PyCFunction)MEdgeSeq_collapse, METH_VARARGS,
- "collapse one or more edges to a vertex"},
- {"addPropertyLayer",(PyCFunction)MEdgeSeq_add_layertype, METH_VARARGS,
- "add a new property layer"},
- {"removePropertyLayer",(PyCFunction)MEdgeSeq_del_layertype, METH_O,
- "removes a property layer"},
- {"renamePropertyLayer",(PyCFunction)MEdgeSeq_rename_layertype, METH_VARARGS,
- "renames an existing property layer"},
-
- {NULL, NULL, 0, NULL}
-};
-static PyGetSetDef BPy_MEdgeSeq_getseters[] = {
- {"properties",
- (getter)MEdgeSeq_PropertyList, (setter)NULL,
- "edge property layers, read only",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/************************************************************************
- *
- * Python MEdgeSeq_Type standard operators
- *
- ************************************************************************/
-
-/*****************************************************************************/
-/* Python MEdgeSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject MEdgeSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MEdgeSeq", /* char *tp_name; */
- sizeof( BPy_MEdgeSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MEdgeSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) MEdgeSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) MEdgeSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MEdgeSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MEdgeSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/************************************************************************
- *
- * Face attributes
- *
- ************************************************************************/
-
-static MFace * MFace_get_pointer( BPy_MFace * self )
-{
- if( self->index >= self->mesh->totface )
- return (MFace *)EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "MFace is no longer valid" );
- return &self->mesh->mface[self->index];
-}
-
-/*
- * get a face's vertices
- */
-
-static PyObject *MFace_getVerts( BPy_MFace * self )
-{
- PyObject *attr;
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL;
-
- attr = PyTuple_New( face->v4 ? 4 : 3 );
-
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyTuple_New() failed" );
-
- PyTuple_SetItem( attr, 0, MVert_CreatePyObject( self->mesh, face->v1 ) );
- PyTuple_SetItem( attr, 1, MVert_CreatePyObject( self->mesh, face->v2 ) );
- PyTuple_SetItem( attr, 2, MVert_CreatePyObject( self->mesh, face->v3 ) );
- if( face->v4 )
- PyTuple_SetItem( attr, 3, MVert_CreatePyObject( self->mesh,
- face->v4 ) );
-
- return attr;
-}
-
-/*
- * set a face's vertices
- */
-
-static int MFace_setVerts( BPy_MFace * self, PyObject * args )
-{
- BPy_MVert *v1, *v2, *v3, *v4 = NULL;
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return -1;
-
- if( !PyArg_ParseTuple ( args, "O!O!O!|O!", &MVert_Type, &v1,
- &MVert_Type, &v2, &MVert_Type, &v3, &MVert_Type, &v4 ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 3 or 4 MVerts" );
-
- if( v1->index == v2->index ||
- v1->index == v3->index ||
- v2->index == v3->index )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "cannot assign 2 or move verts that are the same" );
-
- if(v4 && ( v1->index == v4->index ||
- v2->index == v4->index ||
- v3->index == v4->index ))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "cannot assign 2 or move verts that are the same" );
-
- if( v1->index >= self->mesh->totvert ||
- v2->index >= self->mesh->totvert ||
- v3->index >= self->mesh->totvert ||
- (v4 &&( v4->index >= self->mesh->totvert)))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "cannot assign verts that have been removed" );
-
- face->v1 = v1->index;
- face->v2 = v2->index;
- face->v3 = v3->index;
- if( v4 )
- face->v4 = v4->index;
- return 0;
-}
-
-/*
- * get face's material index
- */
-
-static PyObject *MFace_getMat( BPy_MFace * self )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL;
-
- return PyInt_FromLong( face->mat_nr );
-}
-
-/*
- * set face's material index
- */
-
-static int MFace_setMat( BPy_MFace * self, PyObject * value )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return -1; /* error is set */
-
- return EXPP_setIValueRange( value, &face->mat_nr, 0, 15, 'b' );
-}
-
-/*
- * get a face's index
- */
-
-static PyObject *MFace_getIndex( BPy_MFace * self )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL; /* error is set */
-
- return PyInt_FromLong( self->index );
-}
-
-/*
- * get face's normal index
- */
-
-static PyObject *MFace_getNormal( BPy_MFace * self )
-{
- float *vert[4];
- float no[3];
- MFace *face = MFace_get_pointer( self );
-
- Mesh *me = self->mesh;
-
- if( !face )
- return NULL; /* error is set */
-
- if MFACE_VERT_BADRANGE_CHECK(me, face)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "one or more MFace vertices are no longer valid" );
-
- vert[0] = me->mvert[face->v1].co;
- vert[1] = me->mvert[face->v2].co;
- vert[2] = me->mvert[face->v3].co;
- if( face->v4 ) {
- vert[3] = me->mvert[face->v4].co;
- CalcNormFloat4( vert[0], vert[1], vert[2], vert[3], no );
- } else
- CalcNormFloat( vert[0], vert[1], vert[2], no );
-
- return newVectorObject( no, 3, Py_NEW );
-}
-
-/*
- * get face's center location
- */
-
-static PyObject *MFace_getCent( BPy_MFace * self )
-{
- float *vert[4];
- float cent[3]= {0,0,0};
- int i=3, j, k;
- Mesh *me = self->mesh;
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL; /* error is set */
-
-
- if MFACE_VERT_BADRANGE_CHECK(me, face)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "one or more MFace vertices are no longer valid" );
-
- vert[0] = me->mvert[face->v1].co;
- vert[1] = me->mvert[face->v2].co;
- vert[2] = me->mvert[face->v3].co;
- if( face->v4 ) {
- vert[3] = me->mvert[face->v4].co;
- i=4;
- }
-
- for (j=0;j<i;j++) {
- for (k=0;k<3;k++) {
- cent[k]+=vert[j][k];
- }
- }
-
- for (j=0;j<3;j++) {
- cent[j]=cent[j]/i;
- }
- return newVectorObject( cent, 3, Py_NEW );
-}
-
-/*
- * get face's area
- */
-static PyObject *MFace_getArea( BPy_MFace * self )
-{
- float *v1,*v2,*v3,*v4;
- MFace *face = MFace_get_pointer( self );
- Mesh *me = self->mesh;
-
- if( !face )
- return NULL; /* error is set */
-
- if MFACE_VERT_BADRANGE_CHECK(me, face)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "one or more MFace vertices are no longer valid" );
-
- v1 = me->mvert[face->v1].co;
- v2 = me->mvert[face->v2].co;
- v3 = me->mvert[face->v3].co;
-
- if( face->v4 ) {
- v4 = me->mvert[face->v4].co;
- return PyFloat_FromDouble( AreaQ3Dfl(v1, v2, v3, v4));
- } else
- return PyFloat_FromDouble( AreaT3Dfl(v1, v2, v3));
-}
-
-/*
- * get one of a face's mface flag bits
- */
-
-static PyObject *MFace_getMFlagBits( BPy_MFace * self, void * type )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL; /* error is set */
-
- return EXPP_getBitfield( &face->flag, (int)((long)type & 0xff), 'b' );
-}
-
-/*
- * set one of a face's mface flag bits
- */
-
-static int MFace_setMFlagBits( BPy_MFace * self, PyObject * value,
- void * type )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return -1; /* error is set */
-
- return EXPP_setBitfield( value, &face->flag,
- (int)((long)type & 0xff), 'b' );
-}
-
-static int MFace_setSelect( BPy_MFace * self, PyObject * value,
- void * type_unused )
-{
- MFace *face = MFace_get_pointer( self );
- int param = PyObject_IsTrue( value );
- Mesh *me;
-
- if( !face )
- return -1; /* error is set */
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- me = self->mesh;
- if( param ) {
- face->flag |= ME_FACE_SEL;
- me->mvert[face->v1].flag |= SELECT;
- me->mvert[face->v2].flag |= SELECT;
- me->mvert[face->v3].flag |= SELECT;
- if( face->v4 )
- me->mvert[face->v4].flag |= SELECT;
- }
- else {
- face->flag &= ~ME_FACE_SEL;
- me->mvert[face->v1].flag &= ~SELECT;
- me->mvert[face->v2].flag &= ~SELECT;
- me->mvert[face->v3].flag &= ~SELECT;
- if( face->v4 )
- me->mvert[face->v4].flag &= ~SELECT;
- }
-
- if( self->mesh->mselect ) {
- MEM_freeN( self->mesh->mselect );
- self->mesh->mselect = NULL;
- }
-
- return 0;
-}
-
-/*
- * get face's texture image
- */
-
-static PyObject *MFace_getImage( BPy_MFace *self )
-{
- MTFace *face;
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- face = &self->mesh->mtface[self->index];
-
- if( face->tpage )
- return Image_CreatePyObject( face->tpage );
- else
- Py_RETURN_NONE;
-}
-
-/*
- * change or clear face's texture image
- */
-
-static int MFace_setImage( BPy_MFace *self, PyObject *value )
-{
- MTFace *face;
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- if( value && value != Py_None && !BPy_Image_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected image object or None" );
-
- if( !self->mesh->mtface )
-#if 0
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-#else
- make_tfaces( self->mesh );
-#endif
-
- face = &self->mesh->mtface[self->index];
-
- if( value == NULL || value == Py_None )
- face->tpage = NULL; /* should memory be freed? */
- else {
- face->tpage = ( ( BPy_Image * ) value )->image;
- face->mode |= TF_TEX;
- }
-
- return 0;
-}
-
-#define MFACE_FLAG_BITMASK ( TF_SELECT | TF_SEL1 | \
- TF_SEL2 | TF_SEL3 | TF_SEL4 | TF_HIDE )
-
-/*
-* get face's texture flag
-*/
-
-static PyObject *MFace_getFlag( BPy_MFace *self )
-{
- int flag;
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- flag = self->mesh->mtface[self->index].flag & MFACE_FLAG_BITMASK;
-
- /* so old scripts still work */
- if (self->index == self->mesh->act_face)
- flag |= TF_ACTIVE;
-
- return PyInt_FromLong( (long)( flag ) );
-}
-
-/*
- * set face's texture flag
- */
-
-static int MFace_setFlag( BPy_MFace *self, PyObject *value )
-{
- int param;
-
- if( !self->mesh->mtface )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- if( !PyInt_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", MFACE_FLAG_BITMASK );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = PyInt_AS_LONG ( value );
-
- /* only one face can be active, so don't allow that here */
- if( param & TF_ACTIVE )
- param &= ~TF_ACTIVE;
-
- if( ( param & MFACE_FLAG_BITMASK ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- /* merge active setting with other new params */
- param |= (self->mesh->mtface[self->index].flag);
- self->mesh->mtface[self->index].flag = (char)param;
-
- return 0;
-}
-
-/*
- * get face's texture mode
- */
-
-static PyObject *MFace_getMode( BPy_MFace *self )
-{
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- return PyInt_FromLong( self->mesh->mtface[self->index].mode );
-}
-
-/*
- * set face's texture mode
- */
-
-static int MFace_setMode( BPy_MFace *self, PyObject *value )
-{
- int param;
- static short bitmask = TF_DYNAMIC
- | TF_ALPHASORT
- | TF_TEX
- | TF_SHAREDVERT
- | TF_LIGHT
- | TF_SHAREDCOL
- | TF_TILES
- | TF_BILLBOARD
- | TF_TWOSIDE
- | TF_INVISIBLE
- | TF_OBCOL
- | TF_BILLBOARD2
- | TF_SHADOW
- | TF_BMFONT;
-
- if( !self->mesh->mtface )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- if( !PyInt_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = PyInt_AS_LONG ( value );
-
- if( param == 0xffff ) /* if param is ALL, set everything but HALO */
- param = bitmask ^ TF_BILLBOARD;
- else if( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- /* Blender UI doesn't allow these on at the same time */
-
- if( ( param & (TF_BILLBOARD | TF_BILLBOARD2) ) ==
- (TF_BILLBOARD | TF_BILLBOARD2) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "HALO and BILLBOARD cannot be enabled simultaneously" );
-
- self->mesh->mtface[self->index].mode = (short)param;
-
- return 0;
-}
-
-/*
- * get face's texture transparency setting
- */
-
-static PyObject *MFace_getTransp( BPy_MFace *self )
-{
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- return PyInt_FromLong( self->mesh->mtface[self->index].transp );
-}
-
-/*
- * set face's texture transparency setting
- */
-
-static int MFace_setTransp( BPy_MFace *self, PyObject *value )
-{
- if( !self->mesh->mtface )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- return EXPP_setIValueRange( value,
- &self->mesh->mtface[self->index].transp, TF_SOLID, TF_CLIP, 'b' );
-}
-
-/*
- * get a face's texture UV coord values
- */
-
-static PyObject *MFace_getUV( BPy_MFace * self )
-{
- MTFace *face;
- PyObject *attr;
- int length, i;
-
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- face = &self->mesh->mtface[self->index];
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
- attr = PyTuple_New( length );
-
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyTuple_New() failed" );
-
- for( i=0; i<length; ++i ) {
- PyObject *vector = newVectorObject( face->uv[i], 2, Py_WRAP );
- if( !vector )
- return NULL;
- PyTuple_SetItem( attr, i, vector );
- }
-
- return attr;
-}
-
-/*
- * set a face's texture UV coord values
- */
-
-static int MFace_setUV( BPy_MFace * self, PyObject * value )
-{
- MTFace *face;
- int length, i;
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- if( !PySequence_Check( value ) ||
- EXPP_check_sequence_consistency( value, &vector_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected sequence of vectors" );
-
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
- if( length != PySequence_Size( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "size of vertex and UV sequences differ" );
-
- if( !self->mesh->mtface )
-#if 0
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-#else
- make_tfaces( self->mesh );
-#endif
-
- face = &self->mesh->mtface[self->index];
- for( i=0; i<length; ++i ) {
- VectorObject *vector = (VectorObject *)PySequence_ITEM( value, i );
- face->uv[i][0] = vector->vec[0];
- face->uv[i][1] = vector->vec[1];
- Py_DECREF( vector );
- }
- return 0;
-}
-
-/*
- * get a face's texture UV coord select state
- */
-
-static PyObject *MFace_getUVSel( BPy_MFace * self )
-{
- MTFace *face;
- PyObject *attr;
- int length, i, mask;
-
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- face = &self->mesh->mtface[self->index];
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
- attr = PyTuple_New( length );
-
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyTuple_New() failed" );
-
- /* get coord select state, one bit at a time */
- mask = TF_SEL1;
- for( i=0; i<length; ++i, mask <<= 1 ) {
- PyObject *value = PyInt_FromLong( face->flag & mask ? 1 : 0 );
- if( !value ) {
- Py_DECREF( attr );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- PyTuple_SetItem( attr, i, value );
- }
-
- return attr;
-}
-
-/*
- * set a face's texture UV coord select state
- */
-
-static int MFace_setUVSel( BPy_MFace * self, PyObject * value )
-{
- MTFace *face;
- int length, i, mask;
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- if( !PySequence_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a tuple of integers" );
-
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
- if( length != PySequence_Size( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "size of vertex and UV lists differ" );
-
- if( !self->mesh->mtface )
-#if 0
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-#else
- make_tfaces( self->mesh );
-#endif
-
- /* set coord select state, one bit at a time */
- face = &self->mesh->mtface[self->index];
- mask = TF_SEL1;
- for( i=0; i<length; ++i, mask <<= 1 ) {
- PyObject *tmp = PySequence_GetItem( value, i ); /* adds a reference, remove below */
- if( !PyInt_Check( tmp ) ) {
- Py_DECREF(tmp);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a tuple of integers" );
- }
- if( PyInt_AsLong( tmp ) )
- face->flag |= mask;
- else
- face->flag &= ~mask;
- Py_DECREF(tmp);
- }
- return 0;
-}
-
-/*
- * get a face's vertex colors. note that if mesh->mtfaces is defined, then
- * it takes precedent over mesh->mcol
- */
-
-static PyObject *MFace_getCol( BPy_MFace * self )
-{
- PyObject *attr;
- int length, i;
- MCol * mcol;
-
- /* if there's no mesh color vectors or texture faces, nothing to do */
-
- if( !self->mesh->mcol )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no vertex colors" );
-
- if( !MFace_get_pointer( self ) )
- return NULL;
-
- mcol = &self->mesh->mcol[self->index*4];
-
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
- attr = PyTuple_New( length );
-
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyTuple_New() failed" );
-
- for( i=0; i<length; ++i ) {
- PyObject *color = MCol_CreatePyObject( &mcol[i] );
- if( !color )
- return NULL;
- PyTuple_SetItem( attr, i, color );
- }
-
- return attr;
-}
-
-/*
- * set a face's vertex colors
- */
-
-static int MFace_setCol( BPy_MFace * self, PyObject *value )
-{
- int length, i;
- MCol * mcol;
-
- /* if there's no mesh color vectors or texture faces, nothing to do */
-
- if( !self->mesh->mcol )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no vertex colors" );
-
- if( !MFace_get_pointer( self ) )
- return -1;
-
- mcol = &self->mesh->mcol[self->index*4];
-
- length = self->mesh->mface[self->index].v4 ? 4 : 3;
-
- if( !PyList_Check( value ) && !PyTuple_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of MCols" );
-
- if( EXPP_check_sequence_consistency( value, &MCol_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a sequence of MCols" );
-
- if( PySequence_Size( value ) != length )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "incorrect number of colors for this face" );
-
- for( i=0; i<length; ++i ) {
- BPy_MCol *obj = (BPy_MCol *)PySequence_ITEM( value, i );
- mcol[i].r = obj->color->r;
- mcol[i].g = obj->color->g;
- mcol[i].b = obj->color->b;
- mcol[i].a = obj->color->a;
- Py_DECREF( obj );
- }
- return 0;
-}
-
-
-/*
- * get edge keys for using in a dictionary or set key
- */
-
-static PyObject *MFace_getEdgeKeys( BPy_MFace * self )
-{
- MFace *face = MFace_get_pointer( self );
- PyObject *attr, *edpair;
-
- if (!face)
- return NULL; /* error set */
-
- if (face->v4) {
- attr = PyTuple_New( 4 );
- edpair = PyTuple_New( 2 );
- if (face->v1 > face->v2) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v2) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v1) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v1) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v2) );
- }
- PyTuple_SET_ITEM( attr, 0, edpair );
-
- edpair = PyTuple_New( 2 );
- if (face->v2 > face->v3) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v3) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v2) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v2) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v3) );
- }
- PyTuple_SET_ITEM( attr, 1, edpair );
-
- edpair = PyTuple_New( 2 );
- if (face->v3 > face->v4) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v4) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v3) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v3) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v4) );
- }
- PyTuple_SET_ITEM( attr, 2, edpair );
-
- edpair = PyTuple_New( 2 );
- if (face->v4 > face->v1) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v1) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v4) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v4) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v1) );
- }
- PyTuple_SET_ITEM( attr, 3, edpair );
-
- } else {
-
- attr = PyTuple_New( 3 );
- edpair = PyTuple_New( 2 );
- if (face->v1 > face->v2) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v2) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v1) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v1) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v2) );
- }
- PyTuple_SET_ITEM( attr, 0, edpair );
-
- edpair = PyTuple_New( 2 );
- if (face->v2 > face->v3) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v3) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v2) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v2) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v3) );
- }
- PyTuple_SET_ITEM( attr, 1, edpair );
-
- edpair = PyTuple_New( 2 );
- if (face->v3 > face->v1) {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v1) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v3) );
- } else {
- PyTuple_SET_ITEM( edpair, 0, PyInt_FromLong(face->v3) );
- PyTuple_SET_ITEM( edpair, 1, PyInt_FromLong(face->v1) );
- }
- PyTuple_SET_ITEM( attr, 2, edpair );
- }
-
- return attr;
-}
-
-
-/************************************************************************
- *
- * Python MFace_Type attributes get/set structure
- *
- ************************************************************************/
-
-static PyGetSetDef BPy_MFace_getseters[] = {
- {"verts",
- (getter)MFace_getVerts, (setter)MFace_setVerts,
- "face's vertices",
- NULL},
- {"v",
- (getter)MFace_getVerts, (setter)MFace_setVerts,
- "deprecated: see 'verts'",
- NULL},
- {"mat",
- (getter)MFace_getMat, (setter)MFace_setMat,
- "face's material index",
- NULL},
- {"index",
- (getter)MFace_getIndex, (setter)NULL,
- "face's index",
- NULL},
- {"no",
- (getter)MFace_getNormal, (setter)NULL,
- "face's normal",
- NULL},
- {"cent",
- (getter)MFace_getCent, (setter)NULL,
- "face's center",
- NULL},
- {"area",
- (getter)MFace_getArea, (setter)NULL,
- "face's 3D area",
- NULL},
-
- {"hide",
- (getter)MFace_getMFlagBits, (setter)MFace_setMFlagBits,
- "face hidden in edit mode",
- (void *)ME_HIDE},
- {"sel",
- (getter)MFace_getMFlagBits, (setter)MFace_setSelect,
- "face selected in edit mode",
- (void *)ME_FACE_SEL},
- {"smooth",
- (getter)MFace_getMFlagBits, (setter)MFace_setMFlagBits,
- "face smooth enabled",
- (void *)ME_SMOOTH},
-
- /* attributes for texture faces (mostly, I think) */
-
- {"col",
- (getter)MFace_getCol, (setter)MFace_setCol,
- "face's vertex colors",
- NULL},
- {"flag",
- (getter)MFace_getFlag, (setter)MFace_setFlag,
- "flags associated with texture faces",
- NULL},
- {"image",
- (getter)MFace_getImage, (setter)MFace_setImage,
- "image associated with texture faces",
- NULL},
- {"mode",
- (getter)MFace_getMode, (setter)MFace_setMode,
- "modes associated with texture faces",
- NULL},
- {"transp",
- (getter)MFace_getTransp, (setter)MFace_setTransp,
- "transparency of texture faces",
- NULL},
- {"uv",
- (getter)MFace_getUV, (setter)MFace_setUV,
- "face's UV coordinates",
- NULL},
- {"uvSel",
- (getter)MFace_getUVSel, (setter)MFace_setUVSel,
- "face's UV coordinates select status",
- NULL},
- {"edge_keys",
- (getter)MFace_getEdgeKeys, (setter)NULL,
- "for each edge this face uses return an ordered tuple edge pair that can be used as a key in a dictionary or set",
- NULL},
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/************************************************************************
- *
- * Python MFace_Type iterator (iterates over vertices)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *MFace_getIter( BPy_MFace * self )
-{
- if (self->iter==-1) {
- self->iter = 0;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- BPy_MFace *seq= (BPy_MFace *)MFace_CreatePyObject(self->mesh, self->index);
- seq->iter = 0;
- return (PyObject *) seq;
- }
-}
-
-/*
- * Return next MVert. Throw an exception after the final vertex.
- */
-
-static PyObject *MFace_nextIter( BPy_MFace * self )
-{
- struct MFace *face = &self->mesh->mface[self->index];
- int len = self->mesh->mface[self->index].v4 ? 4 : 3;
-
- if( self->iter == len ) {
- self->iter = -1;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- ++self->iter;
- switch ( self->iter ) {
- case 1:
- return MVert_CreatePyObject( self->mesh, face->v1 );
- case 2:
- return MVert_CreatePyObject( self->mesh, face->v2 );
- case 3:
- return MVert_CreatePyObject( self->mesh, face->v3 );
- default :
- return MVert_CreatePyObject( self->mesh, face->v4 );
- }
-}
-
-/************************************************************************
- *
- * Python MFace_Type methods
- *
- ************************************************************************/
-
-/************************************************************************
- *
- * Python MFace_Type standard operations
- *
- ************************************************************************/
-static int MFace_compare( BPy_MFace * a, BPy_MFace * b )
-{
- return( a->mesh == b->mesh && a->index == b->index ) ? 0 : -1;
-}
-
-static PyObject *MFace_repr( BPy_MFace* self )
-{
- MFace *face = MFace_get_pointer( self );
-
- if( !face )
- return NULL;
-
- if( face->v4 )
- return PyString_FromFormat( "[MFace (%d %d %d %d) %d]",
- (int)face->v1, (int)face->v2,
- (int)face->v3, (int)face->v4, (int)self->index );
- else
- return PyString_FromFormat( "[MFace (%d %d %d) %d]",
- (int)face->v1, (int)face->v2,
- (int)face->v3, (int)self->index );
-}
-
-static long MFace_hash( BPy_MFace *self )
-{
- return (long)self->index;
-}
-
-static int MFace_len( BPy_MFace * self )
-{
- if( self->index >= self->mesh->totface )
- return 0;
- return self->mesh->mface[self->index].v4 ? 4 : 3;
-}
-
-static PySequenceMethods MFace_as_sequence = {
- ( inquiry ) MFace_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) 0, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-static PyObject *MFace_getProp( BPy_MFace *self, PyObject *args)
-{
- Mesh *me = (Mesh *)self->mesh;
- MFace *face = MFace_get_pointer( self );
- if( !face )
- return NULL;
- mesh_update_customdata_pointers(me); //!
- return Mesh_getProperty_internal(&(me->fdata), self->index, args);
-}
-
-static PyObject *MFace_setProp( BPy_MFace *self, PyObject *args)
-{
- Mesh *me = (Mesh *)self->mesh;
- PyObject *obj;
- MFace *face = MFace_get_pointer( self );
- if( !face )
- return NULL; /* error set */
-
- obj = Mesh_setProperty_internal(&(me->fdata), self->index, args);
- mesh_update_customdata_pointers(me); //!
- return obj;
-}
-
-static struct PyMethodDef BPy_MFace_methods[] = {
- {"getProperty", (PyCFunction)MFace_getProp, METH_O,
- "get property indicated by name"},
- {"setProperty", (PyCFunction)MFace_setProp, METH_VARARGS,
- "set property indicated by name"},
- {NULL, NULL, 0, NULL}
-};
-/************************************************************************
- *
- * Python MFace_Type structure definition
- *
- ************************************************************************/
-
-PyTypeObject MFace_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MFace", /* char *tp_name; */
- sizeof( BPy_MFace ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) MFace_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) MFace_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MFace_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) MFace_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) MFace_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) MFace_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MFace_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MFace_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *MFace_CreatePyObject( Mesh * mesh, int i )
-{
- BPy_MFace *obj = PyObject_NEW( BPy_MFace, &MFace_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->mesh = mesh;
- obj->index = i;
- obj->iter= -1;
- return (PyObject *)obj;
-}
-
-/************************************************************************
- *
- * Face sequence
- *
- ************************************************************************/
-
-static int MFaceSeq_len( BPy_MFaceSeq * self )
-{
- return self->mesh->totface;
-}
-
-static PyObject *MFaceSeq_item( BPy_MFaceSeq * self, int i )
-{
- if( i < 0 || i >= self->mesh->totface )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return MFace_CreatePyObject( self->mesh, i );
-}
-
-static PySequenceMethods MFaceSeq_as_sequence = {
- ( inquiry ) MFaceSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) MFaceSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-/************************************************************************
- *
- * Python MFaceSeq_Type iterator (iterates over faces)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *MFaceSeq_getIter( BPy_MFaceSeq * self )
-{
- if (self->iter==-1) {
- self->iter = 0;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- BPy_MFaceSeq *seq = (BPy_MFaceSeq *)MFaceSeq_CreatePyObject(self->mesh);
- seq->iter = 0;
- return (PyObject *)seq;
- }
-}
-
-/*
- * Return next MFace.
- */
-
-static PyObject *MFaceSeq_nextIter( BPy_MFaceSeq * self )
-{
- if( self->iter == self->mesh->totface ) {
- self->iter= -1; /* not being used in a seq */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
- return MFace_CreatePyObject( self->mesh, self->iter++ );
-}
-
-/************************************************************************
- *
- * Python MFaceSeq_Type methods
- *
- ************************************************************************/
-
-static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args,
- PyObject *keywds )
-{
- /*
- * (a) check input for valid edge objects, faces which consist of
- * only three or four edges
- * (b) check input to be sure edges form a closed face (each edge
- * contains verts in two other different edges?)
- *
- * (1) build list of new faces; remove duplicates
- * * use existing "v4=0 rule" for 3-vert faces
- * (2) build list of existing faces for searching
- * (3) from new face list, remove existing faces:
- */
-
- int len, nverts;
- int i, j, k, new_face_count;
- int good_faces;
- SrchFaces *oldpair, *newpair, *tmppair, *tmppair2;
- PyObject *tmp;
- MFace *tmpface;
- Mesh *mesh = self->mesh;
- int ignore_dups = 0;
- PyObject *return_list = NULL;
- char flag = ME_FACE_SEL;
-
- /* before we try to add faces, add edges; if it fails; exit */
-
- tmp = MEdgeSeq_extend( self, args );
- if( !tmp )
- return NULL;
- Py_DECREF( tmp );
-
- /* process any keyword arguments */
- if( keywds ) {
- PyObject *res = PyDict_GetItemString( keywds, "ignoreDups" );
- if( res ) {
- ignore_dups = PyObject_IsTrue( res );
- if (ignore_dups==-1) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "keyword argument \"ignoreDups\" expected True/False or 0/1" );
- }
- }
- res = PyDict_GetItemString( keywds, "indexList" );
- if (res) {
- switch( PyObject_IsTrue( res ) ) {
- case 0:
- break;
- case -1:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "keyword argument \"indexList\" expected True/False or 0/1" );
- default:
- return_list = PyList_New( 0 );
- }
- }
-
- res = PyDict_GetItemString( keywds, "smooth" );
- if (res) {
- switch( PyObject_IsTrue( res ) ) {
- case 0:
- break;
- case -1:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "keyword argument \"smooth\" expected True/False or 0/1" );
- default:
- flag |= ME_SMOOTH;
-
- }
- }
- }
-
- /* make sure we get a tuple of sequences of something */
-
- switch( PySequence_Size( args ) ) {
- case 1: /* better be a sequence or a tuple */
- /* if a sequence... */
- tmp = PyTuple_GET_ITEM( args, 0 );
- if( PySequence_Check( tmp ) ) {
- PyObject *tmp2;
-
- /* ignore empty sequences */
- if( !PySequence_Size( tmp ) ) {
- Py_RETURN_NONE;
- }
-
- /* if another sequence, use it */
- tmp2 = PySequence_ITEM( tmp, 0 );
- if( PySequence_Check( tmp2 ) )
- args = tmp;
- Py_INCREF( args );
- Py_DECREF( tmp2 );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- break;
- case 2:
- case 3:
- case 4: /* two to four args may be individual verts */
- tmp = PyTuple_GET_ITEM( args, 0 );
- /*
- * if first item isn't a sequence, then assume it's a bunch of MVerts
- * and wrap inside a tuple
- */
- if( !PySequence_Check( tmp ) ) {
- args = Py_BuildValue( "(O)", args );
- if( !args )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Py_BuildValue() failed" );
- /*
- * otherwise, assume it already a bunch of sequences so use as-is
- */
- } else {
- Py_INCREF( args ); /* so we can safely DECREF later */
- }
- break;
- default: /* anything else is definitely wrong */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of sequence pairs" );
- }
-
- /* if nothing to add, just exit */
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_DECREF( args );
- Py_RETURN_NONE;
- }
-
- /*
- * Since we call MEdgeSeq_extend first, we already know the input list
- * is valid. Here we just need to count the total number of faces.
- */
-
- new_face_count = 0;
- for( i = 0; i < len; ++i ) {
- tmp = PySequence_ITEM( args, i );
- nverts = PySequence_Size( tmp );
- if( return_list || nverts != 2 )
- ++new_face_count; /* new faces must have 3 or 4 verts */
- Py_DECREF( tmp );
- }
-
- /* OK, commit to allocating the search structures */
- newpair = (SrchFaces *)MEM_callocN( sizeof(SrchFaces)*new_face_count,
- "MFacePairs" );
-
- /* scan the input list and build the new face pair list */
- len = PySequence_Size( args );
- tmppair = newpair;
-
- for( i = 0; i < len; ++i ) {
- MFace tmpface;
- unsigned int vert[4]={0,0,0,0};
- unsigned char order[4]={0,1,2,3};
- tmp = PySequence_GetItem( args, i );
- nverts = PySequence_Size( tmp );
-
- if( nverts == 2 ) { /* again, ignore 2-vert tuples */
- if( return_list ) /* if returning indices, mark as deleted */
- tmppair->v[1] = 0;
- Py_DECREF( tmp );
- continue;
- }
-
- /*
- * get the face's vertices' indexes
- */
-
- for( j = 0; j < nverts; ++j ) {
- PyObject *item = PySequence_ITEM( tmp, j );
- if( BPy_MVert_Check( item ) )
- vert[j] = ((BPy_MVert *)item)->index;
- else
- vert[j] = PyInt_AsLong( item );
- Py_DECREF( item );
- }
- Py_DECREF( tmp );
- tmpface.v1 = vert[0];
- tmpface.v2 = vert[1];
- tmpface.v3 = vert[2];
- tmpface.v4 = vert[3];
-
- /*
- * go through some contortions to guarantee the third and fourth
- * vertices are not index 0
- */
- eeek_fix( &tmpface, nverts == 4 );
- vert[0] = tmpface.v1;
- vert[1] = tmpface.v2;
- vert[2] = tmpface.v3;
- if( nverts == 3 )
- vert[3] = tmppair->v[3] = 0;
- else
- vert[3] = tmpface.v4;
-
- /*
- * sort the verts before placing in pair list. the order of
- * vertices in the face is very important, so keep track of
- * the original order
- */
-
- for( j = nverts-1; j >= 0; --j ) {
- for( k = 0; k < j; ++k ) {
- if( vert[k] > vert[k+1] ) {
- SWAP( int, vert[k], vert[k+1] );
- SWAP( char, order[k], order[k+1] );
- } else if( vert[k] == vert[k+1] ) {
- break;
- }
- }
- if( k < j )
- break;
- tmppair->v[j] = vert[j];
- }
- if( j >= 0 ) { /* a duplicate vertex found */
- if( return_list ) { /* if returning index list */
- tmppair->v[1] = 0; /* mark as deleted */
- } else {
- --new_face_count; /* otherwise skip */
- continue;
- }
- }
- tmppair->index = i;
-
- /* pack order into a byte */
- tmppair->order = order[0]|(order[1]<<2)|(order[2]<<4)|(order[3]<<6);
- ++tmppair;
- }
-
- /*
- * find duplicates in the new list and mark. if it's a duplicate,
- * then mark by setting second vert index to 0 (a real edge won't have
- * second vert index of 0 since verts are sorted)
- */
-
- good_faces = new_face_count; /* assume all faces good to start */
-
- tmppair = newpair; /* "last good edge" */
- tmppair2 = &tmppair[1]; /* "current candidate edge" */
- if( !ignore_dups ) {
-
- /* sort the new face pairs */
- qsort( newpair, new_face_count, sizeof(SrchFaces), mface_comp );
-
- for( i = 0; i < new_face_count; ++i ) {
- if( mface_comp( tmppair, tmppair2 ) )
- tmppair = tmppair2; /* last != current, so current == last */
- else {
- tmppair2->v[1] = 0; /* last == current, so mark as duplicate */
- --good_faces; /* one less good face */
- }
- tmppair2++;
- }
- }
-
- /* if mesh has faces, see if any of the new faces are already in it */
- if( mesh->totface && !ignore_dups ) {
- oldpair = (SrchFaces *)MEM_callocN( sizeof(SrchFaces)*mesh->totface,
- "MFacePairs" );
-
- tmppair = oldpair;
- tmpface = mesh->mface;
- for( i = 0; i < mesh->totface; ++i ) {
- unsigned char order[4]={0,1,2,3};
- int verts[4];
- verts[0]=tmpface->v1;
- verts[1]=tmpface->v2;
- verts[2]=tmpface->v3;
- verts[3]=tmpface->v4;
-
- len = ( tmpface->v4 ) ? 3 : 2;
- tmppair->v[3] = 0; /* for triangular faces */
-
- /* sort the verts before placing in pair list here too */
- for( j = len; j >= 0; --j ) {
- for( k = 0; k < j; ++k )
- if( verts[k] > verts[k+1] ) {
- SWAP( int, verts[k], verts[k+1] );
- SWAP( unsigned char, order[k], order[k+1] );
- }
- tmppair->v[j] = verts[j];
- }
-
- /* pack order into a byte */
- tmppair->order = order[0]|(order[1]<<2)|(order[2]<<4)|(order[3]<<6);
- ++tmppair;
- ++tmpface;
- }
-
- /* sort the old face pairs */
- qsort( oldpair, mesh->totface, sizeof(SrchFaces), mface_comp );
-
- /* eliminate new faces already in the mesh */
- tmppair = newpair;
- for( i = good_faces; i ; ) {
- if( tmppair->v[1] ) {
- if( bsearch( tmppair, oldpair, mesh->totface,
- sizeof(SrchFaces), mface_comp ) ) {
- tmppair->v[1] = 0; /* mark as duplicate */
- --good_faces;
- }
- --i;
- }
- tmppair++;
- }
- MEM_freeN( oldpair );
- }
-
- /* if any new faces are left, add to list */
- if( good_faces || return_list ) {
- int totface = mesh->totface+good_faces; /* new face count */
- CustomData fdata;
-
- CustomData_copy( &mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface );
- CustomData_copy_data( &mesh->fdata, &fdata, 0, 0, mesh->totface );
-
- if ( !CustomData_has_layer( &fdata, CD_MFACE ) )
- CustomData_add_layer( &fdata, CD_MFACE, CD_CALLOC, NULL, totface );
-
- CustomData_free( &mesh->fdata, mesh->totface );
- mesh->fdata = fdata;
- mesh_update_customdata_pointers( mesh );
-
- /* sort the faces back into their original input list order */
- if( !ignore_dups )
- qsort( newpair, new_face_count, sizeof(SrchFaces),
- mface_index_comp );
-
-
- /* point to the first face we're going to add */
- tmpface = &mesh->mface[mesh->totface];
- tmppair = newpair;
-
- if( return_list )
- good_faces = new_face_count; /* assume all faces good to start */
-
- /* as we find a good face, add it */
- while ( good_faces ) {
- if( tmppair->v[1] ) {
- int i;
- unsigned int index[4];
- unsigned char order = tmppair->order;
-
- /* unpack the order of the vertices */
- for( i = 0; i < 4; ++i ) {
- index[(order & 0x03)] = i;
- order >>= 2;
- }
-
- /* now place vertices in the proper order */
- tmpface->v1 = tmppair->v[index[0]];
- tmpface->v2 = tmppair->v[index[1]];
- tmpface->v3 = tmppair->v[index[2]];
- tmpface->v4 = tmppair->v[index[3]];
-
- tmpface->flag = flag;
-
- if( return_list ) {
- tmp = PyInt_FromLong( mesh->totface );
- PyList_Append( return_list, tmp );
- Py_DECREF(tmp);
- }
- mesh->totface++;
- ++tmpface;
- --good_faces;
- } else if( return_list ) {
- PyList_Append( return_list, Py_None );
- --good_faces;
- }
- tmppair++;
- }
- }
-
- /* clean up and leave */
- mesh_update( mesh );
- Py_DECREF ( args );
- MEM_freeN( newpair );
-
- if( return_list )
- return return_list;
- else
- Py_RETURN_NONE;
-}
-
-struct fourEdges
-{
- FaceEdges *v[4];
-};
-
-static PyObject *MFaceSeq_delete( BPy_MFaceSeq * self, PyObject *args )
-{
- unsigned int *face_table;
- int i, len;
- Mesh *mesh = self->mesh;
- MFace *tmpface;
- int face_count;
- int edge_also = 0;
-
- /* check for valid inputs */
-
- if( PySequence_Size( args ) != 2 ||
- !PyArg_ParseTuple( args, "iO", &edge_also, &args ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int and a sequence of ints or MFaces" );
-
- if( !PyList_Check( args ) && !PyTuple_Check( args ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int and a sequence of ints or MFaces" );
-
- /* see how many args we need to parse */
- len = PySequence_Size( args );
- if( len < 1 )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "sequence must contain at least one int or MFace" );
-
- face_table = MEM_callocN( len*sizeof( unsigned int ),
- "face_table" );
-
- /* get the indices of faces to be removed */
- for( i = len; i--; ) {
- PyObject *tmp = PySequence_GetItem( args, i );
- if( BPy_MFace_Check( tmp ) )
- face_table[i] = ((BPy_MFace *)tmp)->index;
- else if( PyInt_Check( tmp ) )
- face_table[i] = PyInt_AsLong( tmp );
- else {
- MEM_freeN( face_table );
- Py_DECREF( tmp );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of ints or MFaces" );
- }
- Py_DECREF( tmp );
-
- /* if index out-of-range, throw exception */
- if( face_table[i] >= (unsigned int)mesh->totface ) {
- MEM_freeN( face_table );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "array index out of range" );
- }
- }
-
- if( edge_also ) {
- /*
- * long version
- *
- * (1) build sorted table of all edges
- * (2) construct face->edge lookup table for all faces
- * face->e1 = mesh->medge[i]
- * (3) (delete sorted table)
- * (4) mark all edges as live
- * (5) mark all edges for deleted faces as dead
- * (6) mark all edges for remaining faces as live
- * (7) delete all dead edges
- * (8) (delete face lookup table)
- *
- */
-
- FaceEdges *edge_table, *tmp_et;
- MEdge *tmpedge;
- FaceEdges **face_edges;
- FaceEdges **tmp_fe;
- struct fourEdges *fface;
- int edge_count;
-
- edge_table = MEM_mallocN( mesh->totedge*sizeof( FaceEdges ),
- "edge_table" );
-
- tmpedge = mesh->medge;
- tmp_et = edge_table;
-
- for( i = 0; i < mesh->totedge; ++i ) {
- if( tmpedge->v1 < tmpedge->v2 ) {
- tmp_et->v[0] = tmpedge->v1;
- tmp_et->v[1] = tmpedge->v2;
- } else {
- tmp_et->v[0] = tmpedge->v2;
- tmp_et->v[1] = tmpedge->v1;
- }
- tmp_et->index = i;
- tmp_et->sel = 1; /* select each edge */
- ++tmpedge;
- ++tmp_et;
- }
-
- /* sort the edge pairs */
- qsort( edge_table, mesh->totedge, sizeof(FaceEdges), faceedge_comp );
-
- /* build face translation table, lookup edges */
- face_edges = MEM_callocN( 4*sizeof(FaceEdges*)*mesh->totface,
- "face_edges" );
-
- tmp_fe = face_edges;
- tmpface = mesh->mface;
- for( i = mesh->totface; i--; ++tmpface ) {
- FaceEdges *ptrs[4];
- unsigned int verts[4];
- int j,k;
- FaceEdges target;
- int len=tmpface->v4 ? 4 : 3;
-
- ptrs[3] = NULL;
- verts[0] = tmpface->v1;
- verts[1] = tmpface->v2;
- verts[2] = tmpface->v3;
- if( len == 4 )
- verts[3] = tmpface->v4;
- for( j = 0; j < len; ++j ) {
- k = (j+1) % len;
- if( verts[j] < verts[k] ) {
- target.v[0] = verts[j];
- target.v[1] = verts[k];
- } else {
- target.v[0] = verts[k];
- target.v[1] = verts[j];
- }
- ptrs[j] = bsearch( &target, edge_table, mesh->totedge,
- sizeof(FaceEdges), faceedge_comp );
- }
- for( j = 0; j < 4; ++j, ++tmp_fe )
- *tmp_fe = ptrs[j];
- }
-
- /* for each face, deselect each edge */
- tmpface = mesh->mface;
- face_count = 0;
- for( i = len; i--; ) {
- if( tmpface[face_table[i]].v1 != UINT_MAX ) {
- fface = (void *)face_edges;
- fface += face_table[i];
- fface->v[0]->sel = 0;
- fface->v[1]->sel = 0;
- fface->v[2]->sel = 0;
- if( fface->v[3] )
- fface->v[3]->sel = 0;
- tmpface[face_table[i]].v1 = UINT_MAX;
- ++face_count;
- }
- }
-
- /* for each remaining face, select all edges */
- tmpface = mesh->mface;
- fface = (struct fourEdges *)face_edges;
- for( i = mesh->totface; i--; ++tmpface, ++fface ) {
- if( tmpface->v1 != UINT_MAX ) {
- fface->v[0]->sel = 1;
- fface->v[1]->sel = 1;
- fface->v[2]->sel = 1;
- if( fface->v[3] )
- fface->v[3]->sel = 1;
- }
- }
- /* now mark the selected edges for deletion */
-
- edge_count = 0;
- for( i = 0; i < mesh->totedge; ++i ) {
- if( !edge_table[i].sel ) {
- mesh->medge[edge_table[i].index].v1 = UINT_MAX;
- ++edge_count;
- }
- }
-
- if( edge_count )
- delete_edges( mesh, NULL, edge_count );
-
- MEM_freeN( face_edges );
- MEM_freeN( edge_table );
- } else {
- /* mark faces to delete */
- tmpface = mesh->mface;
- face_count = 0;
- for( i = len; i--; )
- if( tmpface[face_table[i]].v1 != UINT_MAX ) {
- tmpface[face_table[i]].v1 = UINT_MAX;
- ++face_count;
- }
- }
-
- /* delete faces which have a deleted edge */
- delete_faces( mesh, NULL, face_count );
-
- /* clean up and return */
- MEM_freeN( face_table );
- mesh_update ( mesh );
- Py_RETURN_NONE;
-}
-
-/* copied from meshtools.c - should make generic? */
-static void permutate(void *list, int num, int size, int *index)
-{
- void *buf;
- int len;
- int i;
-
- len = num * size;
-
- buf = MEM_mallocN(len, "permutate");
- memcpy(buf, list, len);
-
- for (i = 0; i < num; i++) {
- memcpy((char *)list + (i * size), (char *)buf + (index[i] * size), size);
- }
- MEM_freeN(buf);
-}
-
-/* this wrapps list sorting then applies back to the mesh */
-static PyObject *MFaceSeq_sort( BPy_MEdgeSeq * self, PyObject *args,
- PyObject *keywds )
-{
- PyObject *ret, *sort_func, *newargs;
-
- Mesh *mesh = self->mesh;
- PyObject *sorting_list;
- CustomDataLayer *layer;
- int i, *index;
-
- /* get a list for internal use */
- sorting_list = PySequence_List( (PyObject *)self );
- if( !sorting_list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /* create index list */
- index = (int *) MEM_mallocN(sizeof(int) * mesh->totface, "sort faces");
- if (!index)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "faces.sort(...) failed to allocate memory" );
-
- newargs = EXPP_PyTuple_New_Prepend(args, sorting_list);
- sort_func = PyObject_GetAttrString( ((PyObject *)&PyList_Type), "sort");
-
- ret = PyObject_Call(sort_func, newargs, keywds);
-
- Py_DECREF(newargs);
- Py_DECREF(sort_func);
-
- if (ret) {
- /* copy the faces indicies to index */
- for (i = 0; i < mesh->totface; i++)
- index[i] = ((BPy_MFace *)PyList_GET_ITEM(sorting_list, i))->index;
-
- for(i = 0; i < mesh->fdata.totlayer; i++) {
- layer = &mesh->fdata.layers[i];
- permutate(layer->data, mesh->totface, CustomData_sizeof(layer->type), index);
- }
- }
- Py_DECREF(sorting_list);
- MEM_freeN(index);
- return ret;
-}
-
-static PyObject *MFaceSeq_selected( BPy_MFaceSeq * self )
-{
- int i, count;
- Mesh *mesh = self->mesh;
- MFace *tmpface;
- PyObject *list;
-
- /* first count selected faces (quicker than appending to PyList?) */
- count = 0;
- tmpface = mesh->mface;
- for( i = 0; i < mesh->totface; ++i, ++tmpface )
- if( tmpface->flag & ME_FACE_SEL )
- ++count;
-
- list = PyList_New( count );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /* next, insert selected faces into list */
- count = 0;
- tmpface = mesh->mface;
- for( i = 0; i < mesh->totface; ++i, ++tmpface ) {
- if( tmpface->flag & ME_FACE_SEL ) {
- PyObject *tmp = PyInt_FromLong( i );
- if( !tmp ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- PyList_SET_ITEM( list, count, tmp );
- ++count;
- }
- }
- return list;
-}
-
-static PyObject *MFaceSeq_add_layertype(BPy_MFaceSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_addPropLayer_internal(me, &(me->fdata), me->totface, args);
-}
-static PyObject *MFaceSeq_del_layertype(BPy_MFaceSeq *self, PyObject *value)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_removePropLayer_internal(me, &(me->fdata), me->totface, value);
-}
-static PyObject *MFaceSeq_rename_layertype(BPy_MFaceSeq *self, PyObject *args)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_renamePropLayer_internal(me,&(me->fdata),args);
-}
-static PyObject *MFaceSeq_PropertyList(BPy_MFaceSeq *self)
-{
- Mesh *me = (Mesh*)self->mesh;
- return Mesh_propList_internal(&(me->fdata));
-}
-
-static struct PyMethodDef BPy_MFaceSeq_methods[] = {
- {"extend", (PyCFunction)MFaceSeq_extend, METH_VARARGS|METH_KEYWORDS,
- "add faces to mesh"},
- {"delete", (PyCFunction)MFaceSeq_delete, METH_VARARGS,
- "delete faces from mesh"},
- {"sort", (PyCFunction)MFaceSeq_sort, METH_VARARGS|METH_KEYWORDS,
- "sort the faces using list sorts syntax"},
- {"selected", (PyCFunction)MFaceSeq_selected, METH_NOARGS,
- "returns a list containing indices of selected faces"},
- {"addPropertyLayer",(PyCFunction)MFaceSeq_add_layertype, METH_VARARGS,
- "add a new property layer"},
- {"removePropertyLayer",(PyCFunction)MFaceSeq_del_layertype, METH_O,
- "removes a property layer"},
- {"renamePropertyLayer",(PyCFunction)MFaceSeq_rename_layertype, METH_VARARGS,
- "renames an existing property layer"},
- {NULL, NULL, 0, NULL}
-};
-static PyGetSetDef BPy_MFaceSeq_getseters[] = {
- {"properties",
- (getter)MFaceSeq_PropertyList, (setter)NULL,
- "vertex property layers, read only",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/************************************************************************
- *
- * Python MFaceSeq_Type standard operations
- *
- ************************************************************************/
-
-/*****************************************************************************/
-/* Python MFaceSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject MFaceSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MFaceSeq", /* char *tp_name; */
- sizeof( BPy_MFaceSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MFaceSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc )MFaceSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc )MFaceSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MFaceSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_MFaceSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/************************************************************************
- *
- * Python BPy_Mesh methods
- *
- ************************************************************************/
-
-static PyObject *Mesh_calcNormals( BPy_Mesh * self )
-{
- Mesh *mesh = self->mesh;
-
- mesh_calc_normals( mesh->mvert, mesh->totvert, mesh->mface,
- mesh->totface, NULL );
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_vertexShade( BPy_Mesh * self )
-{
- Base *base = FIRSTBASE;
-
- if( G.obedit )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't shade vertices while in edit mode" );
-
- while( base ) {
- if( base->object->type == OB_MESH &&
- base->object->data == self->mesh ) {
- base->flag |= SELECT;
- set_active_base( base );
- make_vertexcol(1);
- countall();
- Py_RETURN_NONE;
- }
- base = base->next;
- }
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "object not found in baselist!" );
-}
-
-/*
- * force display list update
- */
-
-static PyObject *Mesh_Update( BPy_Mesh * self, PyObject *args, PyObject *kwd )
-{
-
- char *blockname= NULL;
- static char *kwlist[] = {"key", NULL};
-
- if( !PyArg_ParseTupleAndKeywords(args, kwd, "|s", kwlist, &blockname) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected nothing or the name of a shapeKey");
-
- if (blockname) {
- Mesh *me = self->mesh;
- MVert *mv = me->mvert;
- Key *key= me->key;
- KeyBlock *kb;
- float (*co)[3];
- int i;
-
- if (!key)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Cannot update the key for this mesh, it has no shape keys");
-
- for (kb = key->block.first; kb; kb=kb->next)
- if (strcmp(blockname, kb->name)==0)
- break;
-
- if (!kb)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "This requested key to update does not exist");
-
- for(i=0, co= kb->data; i<me->totvert; i++, mv++, co++)
- VECCOPY(*co, mv->co);
- } else {
- /* Normal operation */
- mesh_update( self->mesh );
- }
- Py_RETURN_NONE;
-}
-
-/*
- * search for a single edge in mesh's edge list
- */
-
-static PyObject *Mesh_findEdge( BPy_Mesh * self, PyObject *args )
-{
- int i;
- unsigned int v1, v2;
- PyObject *tmp;
- MEdge *edge = self->mesh->medge;
-
- if( EXPP_check_sequence_consistency( args, &MVert_Type ) == 1 &&
- PySequence_Size( args ) == 2 ) {
- tmp = PyTuple_GET_ITEM( args, 0 );
- v1 = ((BPy_MVert *)tmp)->index;
- tmp = PyTuple_GET_ITEM( args, 1 );
- v2 = ((BPy_MVert *)tmp)->index;
- } else if( PyArg_ParseTuple( args, "ii", &v1, &v2 ) ) {
- if( (int)v1 >= self->mesh->totvert || (int)v2 >= self->mesh->totvert )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "expected tuple of two ints or MVerts" );
-
- for( i = 0; i < self->mesh->totedge; ++i ) {
- if( ( edge->v1 == v1 && edge->v2 == v2 )
- || ( edge->v1 == v2 && edge->v2 == v1 ) ) {
- tmp = PyInt_FromLong( i );
- if( tmp )
- return tmp;
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- ++edge;
- }
- Py_RETURN_NONE;
-}
-
-/*
- * search for a group of edges in mesh's edge list
- */
-
-static PyObject *Mesh_findEdges( PyObject * self, PyObject *args )
-{
- int len;
- int i;
- SrchEdges *oldpair, *tmppair, target, *result;
- PyObject *list, *tmp;
- BPy_MVert *v1, *v2;
- unsigned int index1, index2;
- MEdge *tmpedge;
- Mesh *mesh = ((BPy_Mesh *)self)->mesh;
-
- /* if no edges, nothing to do */
-
- if( !mesh->totedge )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "mesh has no edges" );
-
- /* make sure we get a sequence of tuples of something */
-
- tmp = PyTuple_GET_ITEM( args, 0 );
- switch( PySequence_Size ( args ) ) {
- case 1: /* better be a list or a tuple */
- if( !PySequence_Check ( tmp ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of tuple int or MVert pairs" );
- args = tmp;
- Py_INCREF( args ); /* so we can safely DECREF later */
- break;
- case 2: /* take any two args and put into a tuple */
- if( PyTuple_Check( tmp ) )
- Py_INCREF( args ); /* if first arg is a tuple, assume both are */
- else {
- args = Py_BuildValue( "((OO))", tmp, PyTuple_GET_ITEM( args, 1 ) );
- if( !args )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Py_BuildValue() failed" );
- }
- break;
- default: /* anything else is definitely wrong */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of tuple pairs" );
- }
-
- len = PySequence_Size( args );
- if( len == 0 ) {
- Py_DECREF( args );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected at least one tuple" );
- }
-
- /* if a single edge, handle the simpler way */
- if( len == 1 ) {
- PyObject *result;
- tmp = PySequence_GetItem( args, 0 );
- result = Mesh_findEdge( (BPy_Mesh *)self, tmp );
- Py_DECREF( tmp );
- Py_DECREF( args );
- return result;
- }
-
- /* build a list of all edges so we can search */
- oldpair = (SrchEdges *)MEM_callocN( sizeof(SrchEdges)*mesh->totedge,
- "MEdgePairs" );
-
- tmppair = oldpair;
- tmpedge = mesh->medge;
- for( i = 0; i < mesh->totedge; ++i ) {
- if( tmpedge->v1 < tmpedge->v2 ) {
- tmppair->v[0] = tmpedge->v1;
- tmppair->v[1] = tmpedge->v2;
- } else {
- tmppair->v[0] = tmpedge->v2;
- tmppair->v[1] = tmpedge->v1;
- }
- tmppair->index = i;
- ++tmpedge;
- ++tmppair;
- }
-
- /* sort the old edge pairs */
- qsort( oldpair, mesh->totedge, sizeof(SrchEdges), medge_comp );
-
- list = PyList_New( len );
- if( !len )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- /* scan the input list, find vert pairs, then search the edge list */
-
- for( i = 0; i < len; ++i ) {
- tmp = PySequence_GetItem( args, i );
- if( !PyTuple_Check( tmp ) || PyTuple_Size( tmp ) != 2 ) {
- MEM_freeN( oldpair );
- Py_DECREF( tmp );
- Py_DECREF( args );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected tuple pair" );
- }
-
- /* get objects, check that they are both MVerts of this mesh */
- v1 = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 0 );
- v2 = (BPy_MVert *)PyTuple_GET_ITEM( tmp, 1 );
- Py_DECREF ( tmp );
- if( BPy_MVert_Check( v1 ) && BPy_MVert_Check( v2 ) ) {
- if( v1->data != (void *)mesh || v2->data != (void *)mesh ) {
- MEM_freeN( oldpair );
- Py_DECREF( args );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "one or both MVerts do not belong to this mesh" );
- }
- index1 = v1->index;
- index2 = v2->index;
- } else if( PyInt_Check( v1 ) && PyInt_Check( v2 ) ) {
- index1 = PyInt_AsLong( (PyObject *)v1 );
- index2 = PyInt_AsLong( (PyObject *)v2 );
- if( (int)index1 >= mesh->totvert
- || (int)index2 >= mesh->totvert ) {
- MEM_freeN( oldpair );
- Py_DECREF( args );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" );
- }
- } else {
- MEM_freeN( oldpair );
- Py_DECREF( args );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected tuple to contain MVerts" );
- }
-
- /* sort verts into order */
- if( index1 < index2 ) {
- target.v[0] = index1;
- target.v[1] = index2;
- } else {
- target.v[0] = index2;
- target.v[1] = index1;
- }
-
- /* search edge list for a match; result is index or None */
- result = bsearch( &target, oldpair, mesh->totedge,
- sizeof(SrchEdges), medge_comp );
- if( result )
- tmp = PyInt_FromLong( result->index );
- else
- tmp = EXPP_incr_ret( Py_None );
- if( !tmp ) {
- MEM_freeN( oldpair );
- Py_DECREF( args );
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- }
- PyList_SET_ITEM( list, i, tmp );
- }
-
- MEM_freeN( oldpair );
- Py_DECREF ( args );
- return list;
-}
-
-/*
- * replace mesh data with mesh data from another object
- */
-
-
-static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args )
-{
- Object *ob = NULL;
- PyObject *object_arg;
- ID tmpid;
- Mesh *tmpmesh;
- Curve *tmpcu = NULL;
- DerivedMesh *dm;
- Object *tmpobj = NULL;
- int cage = 0, render = 0, i;
-
- if( !PyArg_ParseTuple( args, "O|ii", &object_arg, &cage, &render ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected object or string and optional integer arguments" );
-
- if ( PyString_Check( object_arg ) ) {
- char *name;
- name = PyString_AsString ( object_arg );
- ob = ( Object * ) GetIdFromList( &( G.main->object ), name );
- if( !ob )
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
- } else if ( BPy_Object_Check(object_arg) ) {
- ob = (( BPy_Object * ) object_arg)->object;
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected object or string and optional integer arguments" );
- }
-
- if( cage != 0 && cage != 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "cage value must be 0 or 1" );
-
-
-
- /* perform the mesh extraction based on type */
- switch (ob->type) {
- case OB_FONT:
- case OB_CURVE:
- case OB_SURF:
- /* copies object and modifiers (but not the data) */
- tmpobj= copy_object( ob );
- tmpcu = (Curve *)tmpobj->data;
- tmpcu->id.us--;
-
- /* if getting the original caged mesh, delete object modifiers */
- if( cage )
- object_free_modifiers(tmpobj);
-
- /* copies the data */
- tmpobj->data = copy_curve( (Curve *) ob->data );
-
-#if 0
- /* copy_curve() sets disp.first null, so currently not need */
- {
- Curve *cu;
- cu = (Curve *)tmpobj->data;
- if( cu->disp.first )
- MEM_freeN( cu->disp.first );
- cu->disp.first = NULL;
- }
-
-#endif
-
- /* get updated display list, and convert to a mesh */
- makeDispListCurveTypes( tmpobj, 0 );
- nurbs_to_mesh( tmpobj );
-
- /* nurbs_to_mesh changes the type tp a mesh, check it worked */
- if (tmpobj->type != OB_MESH) {
- free_libblock_us( &G.main->object, tmpobj );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cant convert curve to mesh. Does the curve have any segments?" );
- }
- tmpmesh = tmpobj->data;
- free_libblock_us( &G.main->object, tmpobj );
- break;
- case OB_MBALL:
- /* metaballs don't have modifiers, so just convert to mesh */
- ob = find_basis_mball( ob );
- tmpmesh = add_mesh("Mesh");
- mball_to_mesh( &ob->disp, tmpmesh );
-
- break;
- case OB_MESH:
- /* copies object and modifiers (but not the data) */
- if (cage) {
- /* copies the data */
- tmpmesh = copy_mesh( ob->data );
- /* if not getting the original caged mesh, get final derived mesh */
- } else {
- /* Make a dummy mesh, saves copying */
-
- /* Write the display mesh into the dummy mesh */
- if (render)
- dm = mesh_create_derived_render( ob, CD_MASK_MESH );
- else
- dm = mesh_create_derived_view( ob, CD_MASK_MESH );
-
- tmpmesh = add_mesh( "Mesh" );
- DM_to_mesh( dm, tmpmesh );
- dm->release( dm );
- }
-
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Object does not have geometry data" );
- }
-
- /* free mesh data in the original */
- free_mesh( self->mesh );
- /* save a copy of our ID, dup the temporary mesh, restore the ID */
- tmpid = self->mesh->id;
- memcpy( self->mesh, tmpmesh, sizeof( Mesh ) );
- self->mesh->id = tmpid;
-
- /* if mesh has keys, make sure they point back to this mesh */
- if( self->mesh->key )
- self->mesh->key->from = (ID *)self->mesh;
-
-
-
- /* Copy materials to new object */
- switch (ob->type) {
- case OB_SURF:
- self->mesh->totcol = tmpcu->totcol;
-
- /* free old material list (if it exists) and adjust user counts */
- if( tmpcu->mat ) {
- for( i = tmpcu->totcol; i-- > 0; ) {
-
- /* are we an object material or data based? */
- if (ob->colbits & 1<<i) {
- self->mesh->mat[i] = ob->mat[i];
- ob->mat[i]->id.us++;
- tmpmesh->mat[i]->id.us--;
- } else {
- self->mesh->mat[i] = tmpcu->mat[i];
- if (self->mesh->mat[i]) {
- tmpmesh->mat[i]->id.us++;
- }
- }
- }
- }
- break;
-
-#if 0
- /* Crashes when assigning the new material, not sure why */
- case OB_MBALL:
- tmpmb = (MetaBall *)ob->data;
- self->mesh->totcol = tmpmb->totcol;
-
- /* free old material list (if it exists) and adjust user counts */
- if( tmpmb->mat ) {
- for( i = tmpmb->totcol; i-- > 0; ) {
- self->mesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
- if (self->mesh->mat[i]) {
- tmpmb->mat[i]->id.us++;
- }
- }
- }
- break;
-#endif
-
- case OB_MESH:
- if (!cage) {
- Mesh *origmesh= ob->data;
- self->mesh->flag= origmesh->flag;
- self->mesh->mat = MEM_dupallocN(origmesh->mat);
- self->mesh->totcol = origmesh->totcol;
- self->mesh->smoothresh= origmesh->smoothresh;
- if( origmesh->mat ) {
- for( i = origmesh->totcol; i-- > 0; ) {
- /* are we an object material or data based? */
- if (ob->colbits & 1<<i)
- self->mesh->mat[i] = ob->mat[i];
- else
- self->mesh->mat[i] = origmesh->mat[i];
- if (self->mesh->mat[i])
- self->mesh->mat[i]->id.us++;
- }
- }
- }
- break;
- } /* end copy materials */
-
-
-
- /* remove the temporary mesh */
- BLI_remlink( &G.main->mesh, tmpmesh );
- MEM_freeN( tmpmesh );
-
- /* make sure materials get updated in objects */
- test_object_materials( ( ID * ) self->mesh );
-
- mesh_update( self->mesh );
- Py_RETURN_NONE;
-}
-
-/*
- * apply a transform to the mesh's vertices
- *
- * WARNING: unlike NMesh, this method ALWAYS changes the original mesh
- */
-
-static PyObject *Mesh_transform( BPy_Mesh *self, PyObject *args, PyObject *kwd )
-{
- Mesh *mesh = self->mesh;
- MVert *mvert;
- /*PyObject *pymat = NULL;*/
- MatrixObject *bpymat=NULL;
- int i, recalc_normals = 0, selected_only = 0;
-
- static char *kwlist[] = {"matrix", "recalc_normals", "selected_only", NULL};
-
- if( !PyArg_ParseTupleAndKeywords(args, kwd, "|O!ii", kwlist,
- &matrix_Type, &bpymat, &recalc_normals, &selected_only) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "matrix must be a 4x4 transformation matrix\n"
- "for example as returned by object.matrixWorld\n"
- "and optionaly keyword bools, recalc_normals and selected_only\n");
- }
-
- if (!bpymat)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "the first argument must be a matrix or\n"
- "matrix passed as a keyword argument\n");
-
-
- /*bpymat = ( MatrixObject * ) pymat;*/
-
- if( bpymat->colSize != 4 || bpymat->rowSize != 4 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "matrix must be a 4x4 transformation matrix\n"
- "for example as returned by object.getMatrix()" );
-
- /* loop through all the verts and transform by the supplied matrix */
- mvert = mesh->mvert;
- if (selected_only) {
- for( i = 0; i < mesh->totvert; i++, mvert++ ) {
- if (mvert->flag & SELECT) {
- Mat4MulVecfl( (float(*)[4])*bpymat->matrix, mvert->co );
- }
- }
- } else {
- for( i = 0; i < mesh->totvert; i++, mvert++ ) {
- Mat4MulVecfl( (float(*)[4])*bpymat->matrix, mvert->co );
- }
- }
-
- if( recalc_normals ) {
- /* loop through all the verts and transform normals by the inverse
- * of the transpose of the supplied matrix */
- float invmat[4][4], vec[3], nx, ny, nz;
-
- /*
- * we only need to invert a 3x3 submatrix, because the 4th component of
- * affine vectors is 0, but Mat4Invert reports non invertible matrices
- */
-
- if (!Mat4Invert((float(*)[4])*invmat, (float(*)[4])*bpymat->matrix))
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "given matrix is not invertible");
-
- /*
- * since normal is stored as shorts, convert to float
- */
-
- mvert = mesh->mvert;
- for( i = 0; i < mesh->totvert; i++, mvert++ ) {
- nx= vec[0] = (float)(mvert->no[0] / 32767.0);
- ny= vec[1] = (float)(mvert->no[1] / 32767.0);
- nz= vec[2] = (float)(mvert->no[2] / 32767.0);
- vec[0] = nx*invmat[0][0] + ny*invmat[0][1] + nz*invmat[0][2];
- vec[1] = nx*invmat[1][0] + ny*invmat[1][1] + nz*invmat[1][2];
- vec[2] = nx*invmat[2][0] + ny*invmat[2][1] + nz*invmat[2][2];
- Normalize( vec );
- mvert->no[0] = (short)(vec[0] * 32767.0);
- mvert->no[1] = (short)(vec[1] * 32767.0);
- mvert->no[2] = (short)(vec[2] * 32767.0);
- }
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_addVertGroup( PyObject * self, PyObject * value )
-{
- char *groupStr = PyString_AsString(value);
- struct Object *object;
-
- if( !groupStr )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- object = ( ( BPy_Mesh * ) self )->object;
-
- if( object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh not linked to an object" );
-
- /* add_defgroup_name clamps the name to 32, make sure that dosnt change */
- add_defgroup_name( object, groupStr );
-
- EXPP_allqueue( REDRAWBUTSALL, 1 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_removeVertGroup( PyObject * self, PyObject * value )
-{
- char *groupStr = PyString_AsString(value);
- struct Object *object;
- int nIndex;
- bDeformGroup *pGroup;
-
- if( G.obedit )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't use removeVertGroup() while in edit mode" );
-
- if( !groupStr )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( ( ( BPy_Mesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- object = ( ( BPy_Mesh * ) self )->object;
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
- nIndex++;
- object->actdef = (unsigned short)nIndex;
-
- del_defgroup_in_object_mode( object );
-
- EXPP_allqueue( REDRAWBUTSALL, 1 );
-
- Py_RETURN_NONE;
-}
-
-extern void add_vert_defnr( Object * ob, int def_nr, int vertnum, float weight,
- int assignmode );
-extern void remove_vert_def_nr (Object *ob, int def_nr, int vertnum);
-
-static PyObject *Mesh_assignVertsToGroup( BPy_Mesh * self, PyObject * args )
-{
- char *groupStr;
- int nIndex;
- bDeformGroup *pGroup;
- PyObject *listObject;
- int tempInt;
- int x;
- int assignmode = WEIGHT_REPLACE;
- float weight = 1.0;
- Object *object = self->object;
- Mesh *mesh = self->mesh;
-
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first" );
-
- if( ((Mesh *)object->data) != mesh )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object no longer linked to this mesh" );
-
- if( !PyArg_ParseTuple ( args, "sO!fi", &groupStr, &PyList_Type,
- &listObject, &weight, &assignmode) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string, list, float, int arguments" );
- }
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
-
-
- if( assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD &&
- assignmode != WEIGHT_SUBTRACT )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad assignment mode" );
-
- /* makes a set of dVerts corresponding to the mVerts */
- if( !mesh->dvert )
- create_dverts( &mesh->id );
-
- /* loop list adding verts to group */
- for( x = 0; x < PyList_Size( listObject ); x++ ) {
- if( !PyArg_Parse ( PyList_GetItem( listObject, x ), "i", &tempInt ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
-
- if( tempInt < 0 || tempInt >= mesh->totvert )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
-
- add_vert_defnr( object, nIndex, tempInt, weight, assignmode );
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_removeVertsFromGroup( BPy_Mesh * self, PyObject * args )
-{
- /* not passing a list will remove all verts from group */
-
- char *groupStr;
- int nIndex;
- Object *object;
- Mesh *mesh;
- bDeformGroup *pGroup;
- PyObject *listObject = NULL;
- int tempInt;
- int i;
-
- object = self->object;
- mesh = self->mesh;
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first" );
-
- if( ((Mesh *)object->data) != mesh )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object no longer linked to this mesh" );
-
- if( !PyArg_ParseTuple
- ( args, "s|O!", &groupStr, &PyList_Type, &listObject ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string and optional list argument" );
-
- if( !mesh->dvert )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "this mesh contains no deform vertices" );
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "no deform groups assigned to mesh" );
-
- /* get out of edit mode */
-
- if( G.obedit ) {
- load_editMesh();
- free_editMesh(G.editMesh);
- G.obedit = NULL;
- }
-
- if( !listObject ) /* no list given */
- for( i = 0; i < mesh->totvert; i++ )
- remove_vert_def_nr( object, nIndex, i );
- else /* loop list removing verts to group */
- for( i = 0; i < PyList_Size( listObject ); i++ ) {
- if( !PyArg_Parse( PyList_GetItem( listObject, i ), "i", &tempInt ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
-
- if( tempInt < 0 || tempInt >= mesh->totvert )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
-
- remove_vert_def_nr( object, nIndex, tempInt );
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_getVertsFromGroup( BPy_Mesh* self, PyObject * args )
-{
- /*
- * not passing a list will return all verts from group
- * passing indecies not part of the group will not return data in pyList
- * can be used as a index/group check for a vertex
- */
-
- char *groupStr;
- int nIndex;
- bDeformGroup *pGroup;
- MDeformVert *dvert;
- int i, k, count;
- PyObject *vertexList;
- Object *object;
- Mesh *mesh;
-
- int num = 0;
- int weightRet = 0;
- PyObject *listObject = NULL;
-
- object = self->object;
- mesh = self->mesh;
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first" );
-
- if( ((Mesh *)object->data) != mesh )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object no longer linked to this mesh" );
-
- if( !PyArg_ParseTuple( args, "s|iO!", &groupStr, &weightRet,
- &PyList_Type, &listObject ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string and optional int and list arguments" );
-
- if( weightRet < 0 || weightRet > 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "return weights flag must be 0 or 1" );
-
- if( !mesh->dvert )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "this mesh contains no deform vertices" );
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( !pGroup )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
-
- count = 0;
-
- if( !listObject ) { /* do entire group */
- vertexList = PyList_New( mesh->totvert );
- if( !vertexList )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "getVertsFromGroup: can't create pylist!" );
-
- dvert = mesh->dvert;
- for( num = 0; num < mesh->totvert; num++, ++dvert ) {
- for( i = 0; i < dvert->totweight; i++ ) {
- if( dvert->dw[i].def_nr == nIndex ) {
- PyObject *attr;
- if( weightRet )
- attr = Py_BuildValue( "(i,f)", num,
- dvert->dw[i].weight );
- else
- attr = PyInt_FromLong ( num );
- PyList_SetItem( vertexList, count, attr );
- count++;
- }
- }
- }
-
- if (count < mesh->totvert)
- PyList_SetSlice(vertexList, count, mesh->totvert, NULL);
-
- } else { /* do individual vertices */
- int listObjectLen = PyList_Size( listObject );
-
- vertexList = PyList_New( listObjectLen );
- for( i = 0; i < listObjectLen; i++ ) {
- PyObject *attr = NULL;
-
- num = PyInt_AsLong( PyList_GetItem( listObject, i ) );
- if (num == -1) {/* -1 is an error AND an invalid range, we dont care which */
- Py_DECREF(vertexList);
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
- }
-
- if( num < 0 || num >= mesh->totvert ) {
- Py_DECREF(vertexList);
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
- }
- dvert = mesh->dvert + num;
- for( k = 0; k < dvert->totweight; k++ ) {
- if( dvert->dw[k].def_nr == nIndex ) {
- if( weightRet )
- attr = Py_BuildValue( "(i,f)", num,
- dvert->dw[k].weight );
- else
- attr = PyInt_FromLong ( num );
- PyList_SetItem( vertexList, count, attr );
- count++;
- }
- }
- }
- if (count < listObjectLen)
- PyList_SetSlice(vertexList, count, listObjectLen, NULL);
- }
-
- return vertexList;
-}
-
-static PyObject *Mesh_renameVertGroup( BPy_Mesh * self, PyObject * args )
-{
- char *oldGr = NULL;
- char *newGr = NULL;
- bDeformGroup *defGroup;
- Object *object;
- Mesh *mesh;
-
- object = self->object;
- mesh = self->mesh;
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first" );
-
- if( ((Mesh *)object->data) != mesh )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object no longer linked to this mesh" );
-
- if( !PyArg_ParseTuple( args, "ss", &oldGr, &newGr ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two string arguments" );
-
- defGroup = get_named_vertexgroup( object, oldGr );
- if( !defGroup )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't find the vertex group" );
-
- PyOS_snprintf( defGroup->name, 32, newGr );
- unique_vertexgroup_name( defGroup, object );
-
- Py_RETURN_NONE;
-}
-
-
-
-
-static PyObject *Mesh_getVertGroupNames( BPy_Mesh * self )
-{
- bDeformGroup *defGroup;
- PyObject *list;
- Object *obj = self->object;
- Mesh *mesh = self->mesh;
- int count;
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first" );
-
- if( ((Mesh *)obj->data) != mesh )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object no longer linked to this mesh" );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- count = 0;
- for( defGroup = obj->defbase.first; defGroup; defGroup = defGroup->next )
- ++count;
-
- list = PyList_New( count );
- count = 0;
- for( defGroup = obj->defbase.first; defGroup; defGroup = defGroup->next )
- PyList_SET_ITEM( list, count++,
- PyString_FromString( defGroup->name ) );
-
- return list;
-}
-
-static PyObject *Mesh_getVertexInfluences( BPy_Mesh * self, PyObject * args )
-{
- int index;
- PyObject *influence_list = NULL;
- Object *object = self->object;
- Mesh *me = self->mesh;
-
- /* Get a reference to the mesh object wrapped in here. */
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- /* Parse the parameters: only on integer (vertex index) */
- if( !PyArg_ParseTuple( args, "i", &index ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (index of the vertex)" );
-
- /* check for valid index */
- if( index < 0 || index >= me->totvert )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "vertex index out of range" );
-
- influence_list = PyList_New( 0 );
-
- /* Proceed only if we have vertex deformation information */
- if( me->dvert ) {
- int i;
- MDeformWeight *sweight = NULL;
-
- /* Number of bones influencing the vertex */
- int totinfluences = me->dvert[index].totweight;
-
- /* Get the reference of the first weight structure */
- sweight = me->dvert[index].dw;
-
- /* Build the list only with weights and names of the influent bones */
- for( i = 0; i < totinfluences; i++, sweight++ ) {
- bDeformGroup *defgroup = BLI_findlink( &object->defbase,
- sweight->def_nr );
- if( defgroup )
- PyList_Append( influence_list, Py_BuildValue( "[sf]",
- defgroup->name, sweight->weight ) );
- }
- }
-
- return influence_list;
-}
-
-static PyObject *Mesh_removeAllKeys( BPy_Mesh * self )
-{
- Mesh *mesh = self->mesh;
-
- if( !mesh || !mesh->key )
- Py_RETURN_FALSE;
-
- mesh->key->id.us--;
- mesh->key = NULL;
-
- Py_RETURN_TRUE;
-}
-
-
-static PyObject *Mesh_insertKey( BPy_Mesh * self, PyObject * args )
-{
- Mesh *mesh = self->mesh;
- int fra = -1, oldfra = -1;
- char *type = NULL;
- short typenum;
-
- if (mesh->mr)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Shape Keys cannot be added to meshes with multires" );
-
- if( !PyArg_ParseTuple( args, "|is", &fra, &type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int and optionally a string as arguments" );
-
- if( !type || !strcmp( type, "relative" ) )
- typenum = 1;
- else if( !strcmp( type, "absolute" ) )
- typenum = 2;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "if given, type should be 'relative' or 'absolute'" );
-
- if( fra > 0 ) {
- fra = EXPP_ClampInt( fra, 1, MAXFRAME );
- oldfra = G.scene->r.cfra;
- G.scene->r.cfra = fra;
- }
-
- insert_meshkey( mesh, typenum );
- allspace(REMAKEIPO, 0);
-
- if( fra > 0 )
- G.scene->r.cfra = oldfra;
-
- Py_RETURN_NONE;
-}
-
-
-
-
-/* Custom Data Layers */
-
-static PyObject * Mesh_addCustomLayer_internal(Mesh *me, PyObject * args, int type)
-{
- char *name = NULL;
- CustomData *data = &me->fdata;
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string or nothing" );
-
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- if (name)
- CustomData_add_layer_named(data, type, CD_DEFAULT,
- NULL, me->totface, name);
- else
- CustomData_add_layer(data, type, CD_DEFAULT,
- NULL, me->totface);
- mesh_update_customdata_pointers(me);
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_addUVLayer( BPy_Mesh * self, PyObject * args )
-{
- return Mesh_addCustomLayer_internal(self->mesh, args, CD_MTFACE);
-}
-
-static PyObject *Mesh_addColorLayer( BPy_Mesh * self, PyObject * args )
-{
- return Mesh_addCustomLayer_internal(self->mesh, args, CD_MCOL);
-}
-
-static PyObject *Mesh_removeLayer_internal( BPy_Mesh * self, PyObject * value, int type )
-{
- Mesh *me = self->mesh;
- CustomData *data = &me->fdata;
- char *name = PyString_AsString(value);
- int i;
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if (strlen(name)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- i = CustomData_get_named_layer_index(data, type, name);
-
- if (i==-1)
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "No matching layers to remove" );
-
- CustomData_free_layer(data, type, me->totface, i);
- mesh_update_customdata_pointers(me);
-
- /* No more Color or UV layers left ?
- switch modes if this is the active object */
- if (!CustomData_has_layer(data, type)) {
- if (me == get_mesh(OBACT)) {
- if(type == CD_MCOL && (G.f & G_VERTEXPAINT))
- G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */
- if(type == CD_MTFACE && (G.f & G_FACESELECT))
- G.f |= ~G_FACESELECT; /* get out of faceselect mode */
- }
- }
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Mesh_removeUVLayer( BPy_Mesh * self, PyObject * value )
-{
- return Mesh_removeLayer_internal(self, value, CD_MTFACE);
-}
-
-static PyObject *Mesh_removeColorLayer( BPy_Mesh * self, PyObject * value )
-{
- return Mesh_removeLayer_internal(self, value, CD_MCOL);
-}
-
-
-static PyObject *Mesh_renameLayer_internal( BPy_Mesh * self, PyObject * args, int type )
-{
- CustomData *data;
- CustomDataLayer *layer;
- Mesh *mesh = self->mesh;
- int i;
- char *name_from, *name_to;
-
- data = &mesh->fdata;
-
- if( !PyArg_ParseTuple( args, "ss", &name_from, &name_to ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 2 strings" );
-
- if (strlen(name_from)>31 || strlen(name_to)>31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "error, maximum name length is 31" );
-
- i = CustomData_get_named_layer_index(data, type, name_from);
-
- if (i==-1)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "layer name was not found" );
-
- layer = &data->layers[i];
- strcpy(layer->name, name_to); /* we alredy know the string sizes are under 32 */
- CustomData_set_layer_unique_name(data, i);
- Py_RETURN_NONE;
-}
-
-static PyObject *Mesh_renameUVLayer( BPy_Mesh * self, PyObject * args )
-{
- return Mesh_renameLayer_internal( self, args, CD_MTFACE );
-}
-
-static PyObject *Mesh_renameColorLayer( BPy_Mesh * self, PyObject * args )
-{
- return Mesh_renameLayer_internal( self, args, CD_MCOL );
-}
-
-
-static PyObject *Mesh_getLayerNames_internal( BPy_Mesh * self, int type )
-{
- CustomData *data;
- CustomDataLayer *layer;
- PyObject *str, *list = PyList_New( 0 );
- Mesh *mesh = self->mesh;
- int i;
- data = &mesh->fdata;
-
- /* see if there is a duplicate */
- for(i=0; i<data->totlayer; i++) {
- layer = &data->layers[i];
- if(layer->type == type) {
- str = PyString_FromString(layer->name);
- PyList_Append( list, str );
- Py_DECREF(str);
- }
- }
- return list;
-}
-
-static PyObject *Mesh_getUVLayerNames( BPy_Mesh * self )
-{
- return Mesh_getLayerNames_internal(self, CD_MTFACE);
-}
-
-static PyObject *Mesh_getColorLayerNames( BPy_Mesh * self )
-{
- return Mesh_getLayerNames_internal(self, CD_MCOL);
-}
-/* used by activeUVLayer and activeColorLayer attrs */
-static PyObject *Mesh_getActiveLayer( BPy_Mesh * self, void *type )
-{
- CustomData *data = &self->mesh->fdata;
- int layer_type = GET_INT_FROM_POINTER(type);
- int i;
- if (layer_type < 0) { /* hack, if negative, its the renderlayer.*/
- layer_type = -layer_type;
- i = CustomData_get_render_layer_index(data, layer_type);
- } else {
- i = CustomData_get_active_layer_index(data, layer_type);
- }
- if (i == -1) /* so -1 is for no active layer 0+ for an active layer */
- Py_RETURN_NONE;
- else {
- return PyString_FromString( data->layers[i].name);
- }
-}
-
-static int Mesh_setActiveLayer( BPy_Mesh * self, PyObject * value, void *type )
-{
- CustomData *data = &self->mesh->fdata;
- char *name;
- int i,ok,n,layer_type = GET_INT_FROM_POINTER(type), render=0;
-
- if( !PyString_Check( value ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected a string argument" );
-
- if (layer_type<0) {
- layer_type = -layer_type;
- render = 1;
- }
-
- name = PyString_AsString( value );
- ok = 0;
- n = 0;
- for(i=0; i < data->totlayer; ++i) {
- if(data->layers[i].type == layer_type) {
- if (strcmp(data->layers[i].name, name)==0) {
- ok = 1;
- break;
- }
- n++;
- }
- }
-
- if (!ok)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "layer name does not exist" );
- if (render) {
- CustomData_set_layer_render(data, layer_type, n);
- } else {
- CustomData_set_layer_active(data, layer_type, n);
- mesh_update_customdata_pointers(self->mesh);
- }
- return 0;
-}
-
-
-/* multires */
-static PyObject *Mesh_getMultiresLevelCount( BPy_Mesh * self )
-{
- int i;
- if (!self->mesh->mr)
- i=0;
- else
- i= self->mesh->mr->level_count;
-
- return PyInt_FromLong(i);
-}
-
-
-static PyObject *Mesh_getMultires( BPy_Mesh * self, void *type )
-{
- int i=0;
- if (self->mesh->mr) {
- switch (GET_INT_FROM_POINTER(type)) {
- case MESH_MULTIRES_LEVEL:
- i = self->mesh->mr->newlvl;
- break;
- case MESH_MULTIRES_EDGE:
- i = self->mesh->mr->edgelvl;
- break;
- case MESH_MULTIRES_PIN:
- i = self->mesh->mr->pinlvl;
- break;
- case MESH_MULTIRES_RENDER:
- i = self->mesh->mr->renderlvl;
- break;
- }
- }
-
- return PyInt_FromLong(i);
-}
-
-static int Mesh_setMultires( BPy_Mesh * self, PyObject *value, void *type )
-{
- int i;
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- if (!self->object)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- if (!self->mesh->mr)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "the mesh has no multires data" );
-
- if (!self->mesh->mr->level_count)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "multires data has no levels added" );
-
- i = PyInt_AsLong(value);
-
- if (i<1||i>self->mesh->mr->level_count)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "value out of range" );
-
- switch (GET_INT_FROM_POINTER(type)) {
- case MESH_MULTIRES_LEVEL:
- self->mesh->mr->newlvl = i;
- multires_set_level_cb(self->object, self->mesh);
- break;
- case MESH_MULTIRES_EDGE:
- self->mesh->mr->edgelvl = i;
- multires_edge_level_update(self->object, self->mesh);
- break;
- case MESH_MULTIRES_PIN:
- self->mesh->mr->pinlvl = i;
- break;
- case MESH_MULTIRES_RENDER:
- self->mesh->mr->renderlvl = i;
- break;
- }
-
- return 0;
-}
-
-static PyObject *Mesh_addMultiresLevel( BPy_Mesh * self, PyObject * args )
-{
- char typenum;
- int i, levels = 1;
- char *type = NULL;
- if( G.obedit )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't add multires level while in edit mode" );
- if( !PyArg_ParseTuple( args, "|is", &levels, &type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int and optionally a string as arguments" );
- if( !type || !strcmp( type, "catmull-clark" ) )
- typenum = 0;
- else if( !strcmp( type, "simple" ) )
- typenum = 1;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "if given, type should be 'catmull-clark' or 'simple'" );
- if (!self->mesh->mr)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "the mesh has no multires data" );
- for( i = 0; i < levels; i++ ) {
- multires_add_level(self->object, self->mesh, typenum);
- };
- multires_update_levels(self->mesh, 0);
- multires_level_to_editmesh(self->object, self->mesh, 0);
- multires_finish_mesh_update(self->object);
- Py_RETURN_NONE;
-}
-
-/* end multires */
-
-
-static PyObject *Mesh_Tools( BPy_Mesh * self, int type, void **args )
-{
- Base *base;
- int result;
- Object *object = NULL;
- PyObject *attr = NULL;
-
- /* if already in edit mode, exit */
-
- if( G.obedit )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't use mesh tools while in edit mode" );
-
- for( base = FIRSTBASE; base; base = base->next ) {
- if( base->object->type == OB_MESH &&
- base->object->data == self->mesh ) {
- object = base->object;
- break;
- }
- }
- if( !object )
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't find an object for the mesh" );
-
- if( object->type != OB_MESH )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Object specified is not a mesh." );
-
- /* make mesh's object active, enter mesh edit mode */
- G.obedit = object;
- make_editMesh();
-
- /* apply operation, then exit edit mode */
- switch( type ) {
- case MESH_TOOL_TOSPHERE:
- vertices_to_sphere();
- break;
- case MESH_TOOL_VERTEXSMOOTH:
- vertexsmooth();
- break;
- case MESH_TOOL_FLIPNORM:
- /* would be simple to rewrite this to not use edit mesh */
- /* see flipface() */
- flip_editnormals();
- break;
- case MESH_TOOL_SUBDIV:
- esubdivideflag( 1, 0.0, *((int *)args[0]), 1, 0 );
- break;
- case MESH_TOOL_REMDOUB:
- result = removedoublesflag( 1, 0, *((float *)args[0]) );
-
- attr = PyInt_FromLong( result );
- if( !attr )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyInt_FromLong() failed" );
- break;
- case MESH_TOOL_FILL:
- fill_mesh();
- break;
- case MESH_TOOL_RECALCNORM:
- righthandfaces( *((int *)args[0]) );
- break;
- case MESH_TOOL_TRI2QUAD:
- join_triangles();
- break;
- case MESH_TOOL_QUAD2TRI:
- convert_to_triface( *((int *)args[0]) );
- break;
- }
-
- /* exit edit mode, free edit mesh */
- load_editMesh();
- free_editMesh(G.editMesh);
-
- if(G.f & G_FACESELECT)
- EXPP_allqueue( REDRAWIMAGE, 0 );
- if(G.f & G_WEIGHTPAINT)
- mesh_octree_table(G.obedit, NULL, 'e');
- G.obedit = NULL;
-
- DAG_object_flush_update(G.scene, object, OB_RECALC_DATA);
-
- if( attr )
- return attr;
-
- Py_RETURN_NONE;
-}
-
-/*
- * "Subdivide" function
- */
-
-static PyObject *Mesh_subdivide( BPy_Mesh * self, PyObject * args )
-{
- int beauty = 0;
- void *params = &beauty;
-
- if( !PyArg_ParseTuple( args, "|i", &beauty ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int argument" );
-
- return Mesh_Tools( self, MESH_TOOL_SUBDIV, &params );
-}
-
-/*
- * "Smooth" function
- */
-
-static PyObject *Mesh_smooth( BPy_Mesh * self )
-{
- return Mesh_Tools( self, MESH_TOOL_VERTEXSMOOTH, NULL );
-}
-
-/*
- * "Remove doubles" function
- */
-
-static PyObject *Mesh_removeDoubles( BPy_Mesh * self, PyObject *args )
-{
- float limit;
- void *params = &limit;
-
- if( !PyArg_ParseTuple( args, "f", &limit ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- limit = EXPP_ClampFloat( limit, 0.0f, 1.0f );
-
- return Mesh_Tools( self, MESH_TOOL_REMDOUB, &params );
-}
-
-/*
- * "recalc normals" function
- */
-
-static PyObject *Mesh_recalcNormals( BPy_Mesh * self, PyObject *args )
-{
- int direction = 0;
- void *params = &direction;
-
- if( !PyArg_ParseTuple( args, "|i", &direction ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int in range [0,1]" );
-
- if( direction < 0 || direction > 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int in range [0,1]" );
-
- /* righthandfaces(1) = outward, righthandfaces(2) = inward */
- ++direction;
-
- return Mesh_Tools( self, MESH_TOOL_RECALCNORM, &params );
-}
-
-/*
- * "Quads to Triangles" function
- */
-
-static PyObject *Mesh_quad2tri( BPy_Mesh * self, PyObject *args )
-{
- int kind = 0;
- void *params = &kind;
-
- if( !PyArg_ParseTuple( args, "|i", &kind ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int in range [0,1]" );
-
- if( kind < 0 || kind > 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int in range [0,1]" );
-
- return Mesh_Tools( self, MESH_TOOL_QUAD2TRI, &params );
-}
-
-/*
- * "Triangles to Quads" function
- */
-
-static PyObject *Mesh_tri2quad( BPy_Mesh * self )
-{
- return Mesh_Tools( self, MESH_TOOL_TRI2QUAD, NULL );
-}
-
-/*
- * "Flip normals" function
- */
-
-static PyObject *Mesh_flipNormals( BPy_Mesh * self )
-{
- return Mesh_Tools( self, MESH_TOOL_FLIPNORM, NULL );
-}
-
-/*
- * "To sphere" function
- */
-
-static PyObject *Mesh_toSphere( BPy_Mesh * self )
-{
- return Mesh_Tools( self, MESH_TOOL_TOSPHERE, NULL );
-}
-
-/*
- * "Fill" (scan fill) function
- */
-
-static PyObject *Mesh_fill( BPy_Mesh * self )
-{
- return Mesh_Tools( self, MESH_TOOL_FILL, NULL );
-}
-
-
-/*
- * "pointInside" function
- */
-/* Warning - this is ordered - need to test both orders to be sure */
-#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
-#define POINT_IN_TRI(p0,p1,p2,p3) ((SIDE_OF_LINE(p1,p2,p0)>=0) && (SIDE_OF_LINE(p2,p3,p0)>=0) && (SIDE_OF_LINE(p3,p1,p0)>=0))
-static short pointInside_internal(float *vec, float *v1, float *v2, float *v3 )
-{
- float z,w1,w2,w3,wtot;
-
-
- if (vec[2] > MAX3(v1[2], v2[2], v3[2]))
- return 0;
-
- /* need to test both orders */
- if (!POINT_IN_TRI(vec, v1,v2,v3) && !POINT_IN_TRI(vec, v3,v2,v1))
- return 0;
-
- w1= AreaF2Dfl(vec, v2, v3);
- w2= AreaF2Dfl(v1, vec, v3);
- w3= AreaF2Dfl(v1, v2, vec);
- wtot = w1+w2+w3;
- w1/=wtot; w2/=wtot; w3/=wtot;
- z =((v1[2] * w1) +
- (v2[2] * w2) +
- (v3[2] * w3));
-
- /* only return true if the face is above vec*/
- if (vec[2] < z )
- return 1;
-
- return 0;
-}
-
-static PyObject *Mesh_pointInside( BPy_Mesh * self, PyObject * args, PyObject *kwd )
-{
- Mesh *mesh = self->mesh;
- MFace *mf = mesh->mface;
- MVert *mvert = mesh->mvert;
- int i;
- int isect_count=0;
- int selected_only = 0;
- VectorObject *vec;
- static char *kwlist[] = {"point", "selected_only", NULL};
-
- if( !PyArg_ParseTupleAndKeywords(args, kwd, "|O!i", kwlist,
- &vector_Type, &vec, &selected_only) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a vector and an optional bool argument");
- }
-
- if(vec->size < 3)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Mesh.pointInside(vec) expects a 3D vector object\n");
-
- for( i = 0; i < mesh->totface; mf++, i++ ) {
- if (!selected_only || mf->flag & ME_FACE_SEL) {
- if (pointInside_internal(vec->vec, mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co)) {
- isect_count++;
- } else if (mf->v4 && pointInside_internal(vec->vec,mvert[mf->v1].co, mvert[mf->v3].co, mvert[mf->v4].co)) {
-
- isect_count++;
- }
- }
- }
-
- if (isect_count % 2)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-
-/* This is a bit nasty, Blenders tangents are computed for rendering, and this isnt compatible with a normal Mesh
- * so we have to rewrite parts of it here, make sure these stay in sync */
-
-static PyObject *Mesh_getTangents( BPy_Mesh * self )
-{
- /* python stuff */
- PyObject *py_tanlist;
- PyObject *py_tuple;
-
-
- PyObject *py_vector;
-#if 0 /* BI-TANGENT */
- PyObject *py_bivector;
- PyObject *py_pair;
-
- float no[3];
-#endif
- /* mesh vars */
- Mesh *mesh = self->mesh;
- MTFace *tf = mesh->mtface;
- MFace *mf = mesh->mface;
- MVert *v1, *v2, *v3, *v4;
- int mf_vi[4];
-
- /* See convertblender.c */
- float *uv1, *uv2, *uv3, *uv4;
- float fno[3];
- float tang[3];
- float uv[4][2];
- float *vtang;
-
- float (*orco)[3] = NULL;
-
- MemArena *arena= NULL;
- VertexTangent **vtangents= NULL;
- int i, j, len;
-
-
- if(!mesh->mtface) {
- if (!self->object)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "cannot get tangents when there are not UV's, or the mesh has no link to an object");
-
- orco = (float(*)[3])get_mesh_orco_verts(self->object);
-
- if (!orco)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "cannot get orco's for this objects tangents");
- }
-
- /* vertex normals */
- arena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
- BLI_memarena_use_calloc(arena);
- vtangents= MEM_callocN(sizeof(VertexTangent*)*mesh->totvert, "VertexTangent");
-
- for( i = 0, tf = mesh->mtface, mf = mesh->mface; i < mesh->totface; mf++, tf++, i++ ) {
- v1 = &mesh->mvert[mf->v1];
- v2 = &mesh->mvert[mf->v2];
- v3 = &mesh->mvert[mf->v3];
- if (mf->v4) {
- v4 = &mesh->mvert[mf->v4];
-
- CalcNormFloat4( v1->co, v2->co, v3->co, v4->co, fno );
- } else {
- v4 = NULL;
- CalcNormFloat( v1->co, v2->co, v3->co, fno );
- }
-
- if(mesh->mtface) {
- uv1= tf->uv[0];
- uv2= tf->uv[1];
- uv3= tf->uv[2];
- uv4= tf->uv[3];
- } else {
- uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
- spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
- spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
- if(v4)
- spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
- }
-
- tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v2], tang, uv2);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3);
-
- if (mf->v4) {
- v4 = &mesh->mvert[mf->v4];
-
- tangent_from_uv(uv1, uv3, uv4, v1->co, v3->co, v4->co, fno, tang);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v1], tang, uv1);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v3], tang, uv3);
- sum_or_add_vertex_tangent(arena, &vtangents[mf->v4], tang, uv4);
- }
- }
-
-
- py_tanlist = PyList_New(mesh->totface);
-
- for( i = 0, tf = mesh->mtface, mf = mesh->mface; i < mesh->totface; mf++, tf++, i++ ) {
-
- len = mf->v4 ? 4 : 3;
-
- if(mesh->mtface) {
- uv1= tf->uv[0];
- uv2= tf->uv[1];
- uv3= tf->uv[2];
- uv4= tf->uv[3];
- } else {
- uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
- spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
- spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
- if(len==4)
- spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
- }
-
- mf_vi[0] = mf->v1;
- mf_vi[1] = mf->v2;
- mf_vi[2] = mf->v3;
- mf_vi[3] = mf->v4;
-
-#if 0 /* BI-TANGENT */
- /* now calculate the bitangent */
- if (mf->flag & ME_SMOOTH) {
- no[0] = (float)(mesh->mvert[mf_vi[j]]->no[0] / 32767.0);
- no[1] = (float)(mesh->mvert[mf_vi[j]]->no[1] / 32767.0);
- no[2] = (float)(mesh->mvert[mf_vi[j]]->no[2] / 32767.0);
- } else {
- /* calc face normal */
- if (len==4) CalcNormFloat4( mesh->mvert[0]->co, mesh->mvert[1]->co, mesh->mvert[2]->co, mesh->mvert[3]->co, no );
- else CalcNormFloat4( mesh->mvert[0]->co, mesh->mvert[1]->co, mesh->mvert[2]->co, no );
- }
-#endif
-
- py_tuple = PyTuple_New( len );
-
- for (j=0; j<len; j++) {
- vtang= find_vertex_tangent(vtangents[mf_vi[j]], mesh->mtface ? tf->uv[j] : uv[j]); /* mf_vi[j] == mf->v1, uv[j] == tf->uv[0] */
-
- py_vector = newVectorObject( vtang, 3, Py_NEW );
- Normalize(((VectorObject *)py_vector)->vec);
-
-#if 0 /* BI-TANGENT */
- py_pair = PyTuple_New( 2 );
- PyTuple_SetItem( py_pair, 0, py_vector );
- PyTuple_SetItem( py_pair, 1, py_bivector );
-
- /* qdn: tangent space */
- /* copied from texture.c */
- float B[3], tv[3];
- Crossf(B, shi->vn, shi->nmaptang); /* bitangent */
- /* transform norvec from tangent space to object surface in camera space */
- tv[0] = texres.nor[0]*shi->nmaptang[0] + texres.nor[1]*B[0] + texres.nor[2]*shi->vn[0];
- tv[1] = texres.nor[0]*shi->nmaptang[1] + texres.nor[1]*B[1] + texres.nor[2]*shi->vn[1];
- tv[2] = texres.nor[0]*shi->nmaptang[2] + texres.nor[1]*B[2] + texres.nor[2]*shi->vn[2];
- shi->vn[0]= facm*shi->vn[0] + fact*tv[0];
- shi->vn[1]= facm*shi->vn[1] + fact*tv[1];
- shi->vn[2]= facm*shi->vn[2] + fact*tv[2];
- PyTuple_SetItem( py_tuple, j, py_pair );
-#else
- PyTuple_SetItem( py_tuple, j, py_vector );
-#endif
- }
-
- PyList_SetItem( py_tanlist, i, py_tuple );
- }
-
- BLI_memarena_free(arena);
- if (orco) MEM_freeN( orco );
- MEM_freeN( vtangents );
-
- return py_tanlist;
-}
-
-/*
- * "__copy__" return a copy of the mesh
- */
-
-static PyObject *Mesh_copy( BPy_Mesh * self )
-{
- BPy_Mesh *obj;
-
- obj = (BPy_Mesh *)PyObject_NEW( BPy_Mesh, &Mesh_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- obj->mesh = copy_mesh( self->mesh );
- obj->mesh->id.us= 0;
- obj->object = NULL;
- obj->new = 1;
- return (PyObject *)obj;
-}
-
-
-static struct PyMethodDef BPy_Mesh_methods[] = {
- {"calcNormals", (PyCFunction)Mesh_calcNormals, METH_NOARGS,
- "all recalculate vertex normals"},
- {"vertexShade", (PyCFunction)Mesh_vertexShade, METH_VARARGS,
- "color vertices based on the current lighting setup"},
- {"findEdges", (PyCFunction)Mesh_findEdges, METH_VARARGS,
- "find indices of an multiple edges in the mesh"},
- {"getFromObject", (PyCFunction)Mesh_getFromObject, METH_VARARGS,
- "Get a mesh by name"},
- {"update", (PyCFunction)Mesh_Update, METH_VARARGS | METH_KEYWORDS,
- "Update display lists after changes to mesh"},
- {"transform", (PyCFunction)Mesh_transform, METH_VARARGS | METH_KEYWORDS,
- "Applies a transformation matrix to mesh's vertices"},
- {"addVertGroup", (PyCFunction)Mesh_addVertGroup, METH_O,
- "Assign vertex group name to the object linked to the mesh"},
- {"removeVertGroup", (PyCFunction)Mesh_removeVertGroup, METH_O,
- "Delete vertex group name from the object linked to the mesh"},
- {"assignVertsToGroup", (PyCFunction)Mesh_assignVertsToGroup, METH_VARARGS,
- "Assigns vertices to a vertex group"},
- {"removeVertsFromGroup", (PyCFunction)Mesh_removeVertsFromGroup, METH_VARARGS,
- "Removes vertices from a vertex group"},
- {"getVertsFromGroup", (PyCFunction)Mesh_getVertsFromGroup, METH_VARARGS,
- "Get index and optional weight for vertices in vertex group"},
- {"renameVertGroup", (PyCFunction)Mesh_renameVertGroup, METH_VARARGS,
- "Rename an existing vertex group"},
- {"getVertGroupNames", (PyCFunction)Mesh_getVertGroupNames, METH_NOARGS,
- "Get names of vertex groups"},
- {"getVertexInfluences", (PyCFunction)Mesh_getVertexInfluences, METH_VARARGS,
- "Get list of the influences of bones for a given mesh vertex"},
- /* Shape Keys */
- {"removeAllKeys", (PyCFunction)Mesh_removeAllKeys, METH_NOARGS,
- "Remove all the shape keys from a mesh"},
- {"insertKey", (PyCFunction)Mesh_insertKey, METH_VARARGS,
- "(frame = None, type = 'relative') - inserts a Mesh key at the given frame"},
- /* Mesh tools */
- {"smooth", (PyCFunction)Mesh_smooth, METH_NOARGS,
- "Flattens angle of selected faces (experimental)"},
- {"flipNormals", (PyCFunction)Mesh_flipNormals, METH_NOARGS,
- "Toggles the direction of selected face's normals (experimental)"},
- {"toSphere", (PyCFunction)Mesh_toSphere, METH_NOARGS,
- "Moves selected vertices outward in a spherical shape (experimental)"},
- {"fill", (PyCFunction)Mesh_fill, METH_NOARGS,
- "Scan fill a closed edge loop (experimental)"},
- {"triangleToQuad", (PyCFunction)Mesh_tri2quad, METH_VARARGS,
- "Convert selected triangles to quads (experimental)"},
- {"quadToTriangle", (PyCFunction)Mesh_quad2tri, METH_VARARGS,
- "Convert selected quads to triangles (experimental)"},
- {"subdivide", (PyCFunction)Mesh_subdivide, METH_VARARGS,
- "Subdivide selected edges in a mesh (experimental)"},
- {"remDoubles", (PyCFunction)Mesh_removeDoubles, METH_VARARGS,
- "Removes duplicates from selected vertices (experimental)"},
- {"recalcNormals", (PyCFunction)Mesh_recalcNormals, METH_VARARGS,
- "Recalculates inside or outside normals (experimental)"},
- {"pointInside", (PyCFunction)Mesh_pointInside, METH_VARARGS|METH_KEYWORDS,
- "Recalculates inside or outside normals (experimental)"},
- {"getTangents", (PyCFunction)Mesh_getTangents, METH_VARARGS|METH_KEYWORDS,
- "Return a list of face tangents"},
-
- /* mesh custom data layers */
- {"addUVLayer", (PyCFunction)Mesh_addUVLayer, METH_VARARGS,
- "adds a UV layer to this mesh"},
- {"addColorLayer", (PyCFunction)Mesh_addColorLayer, METH_VARARGS,
- "adds a color layer to this mesh "},
- {"removeUVLayer", (PyCFunction)Mesh_removeUVLayer, METH_O,
- "removes a UV layer to this mesh"},
- {"removeColorLayer", (PyCFunction)Mesh_removeColorLayer, METH_O,
- "removes a color layer to this mesh"},
- {"getUVLayerNames", (PyCFunction)Mesh_getUVLayerNames, METH_NOARGS,
- "Get names of UV layers"},
- {"getColorLayerNames", (PyCFunction)Mesh_getColorLayerNames, METH_NOARGS,
- "Get names of Color layers"},
- {"renameUVLayer", (PyCFunction)Mesh_renameUVLayer, METH_VARARGS,
- "Rename a UV Layer"},
- {"renameColorLayer", (PyCFunction)Mesh_renameColorLayer, METH_VARARGS,
- "Rename a Color Layer"},
- /* mesh multires */
- {"addMultiresLevel", (PyCFunction)Mesh_addMultiresLevel, METH_VARARGS,
- "(levels=1, type='catmull-clark') - adds multires levels of given type"},
-
- /* python standard class functions */
- {"__copy__", (PyCFunction)Mesh_copy, METH_NOARGS,
- "Return a copy of the mesh"},
- {"copy", (PyCFunction)Mesh_copy, METH_NOARGS,
- "Return a copy of the mesh"},
- {NULL, NULL, 0, NULL}
-};
-
-/************************************************************************
- *
- * Python BPy_Mesh attributes
- *
- ************************************************************************/
-
-static PyObject *MVertSeq_CreatePyObject( Mesh * mesh )
-{
-
- BPy_MVertSeq *obj = PyObject_NEW( BPy_MVertSeq, &MVertSeq_Type);
- obj->mesh = mesh;
-
- /*
- an iter of -1 means this seq has not been used as an iterator yet
- once it is, then any other calls on getIter will return a new copy of BPy_MVertSeq
- This means you can loop do nested loops with the same iterator without worrying about
- the iter variable being used twice and messing up the loops.
- */
- obj->iter = -1;
- return (PyObject *)obj;
-}
-
-static PyObject *Mesh_getVerts( BPy_Mesh * self )
-{
- return MVertSeq_CreatePyObject(self->mesh);
-}
-
-static int Mesh_setVerts( BPy_Mesh * self, PyObject * args )
-{
- MVert *dst;
- MVert *src;
- int i;
-
- /* special case if None: delete the mesh */
- if( args == NULL || args == Py_None ) {
- Mesh *me = self->mesh;
- free_mesh( me );
- me->mvert = NULL; me->medge = NULL; me->mface = NULL;
- me->mtface = NULL; me->dvert = NULL; me->mcol = NULL;
- me->msticky = NULL; me->mat = NULL; me->bb = NULL; me->mselect = NULL;
- me->totvert = me->totedge = me->totface = me->totcol = 0;
- mesh_update( me );
- return 0;
- }
-
- if( PyList_Check( args ) ) {
- if( EXPP_check_sequence_consistency( args, &MVert_Type ) != 1 &&
- EXPP_check_sequence_consistency( args, &PVert_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of MVerts" );
-
- if( PyList_Size( args ) != self->mesh->totvert )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "list must have the same number of vertices as the mesh" );
-
- dst = self->mesh->mvert;
- for( i = 0; i < PyList_Size( args ); ++i ) {
- BPy_MVert *v = (BPy_MVert *)PyList_GET_ITEM( args, i );
-
- if( BPy_MVert_Check( v ) )
- src = &((Mesh *)v->data)->mvert[v->index];
- else
- src = (MVert *)v->data;
-
- memcpy( dst, src, sizeof(MVert) );
- ++dst;
- }
- } else if( args->ob_type == &MVertSeq_Type ) {
- Mesh *mesh = ( (BPy_MVertSeq *) args)->mesh;
-
- if( mesh->totvert != self->mesh->totvert )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "vertex sequences must have the same number of vertices" );
-
- memcpy( self->mesh->mvert, mesh->mvert, mesh->totvert*sizeof(MVert) );
- } else
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list or sequence of MVerts" );
- return 0;
-}
-
-static PyObject *MEdgeSeq_CreatePyObject( Mesh *mesh )
-{
- BPy_MEdgeSeq *obj = PyObject_NEW( BPy_MEdgeSeq, &MEdgeSeq_Type);
- obj->mesh = mesh;
- obj->iter = -1; /* iterator not yet used */
- return (PyObject *)obj;
-}
-
-static PyObject *Mesh_getEdges( BPy_Mesh * self )
-{
- return MEdgeSeq_CreatePyObject(self->mesh);
-}
-
-static PyObject *MFaceSeq_CreatePyObject( Mesh * mesh )
-{
- BPy_MFaceSeq *obj= PyObject_NEW( BPy_MFaceSeq, &MFaceSeq_Type);
- obj->mesh = mesh;
- obj->iter = -1; /* iterator not yet used */
- return (PyObject *)obj;
-}
-
-static PyObject *Mesh_getFaces( BPy_Mesh * self )
-{
- return MFaceSeq_CreatePyObject( self->mesh );
-}
-
-static PyObject *Mesh_getMaterials( BPy_Mesh *self )
-{
- return EXPP_PyList_fromMaterialList( self->mesh->mat,
- self->mesh->totcol, 1 );
-}
-
-static int Mesh_setMaterials( BPy_Mesh *self, PyObject * value )
-{
- Material **matlist;
- int len;
-
- if( !PySequence_Check( value ) ||
- !EXPP_check_sequence_consistency( value, &Material_Type ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "list should only contain materials or None)" );
-
- len = PyList_Size( value );
- if( len > 16 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "list can't have more than 16 materials" );
-
- /* free old material list (if it exists) and adjust user counts */
- if( self->mesh->mat ) {
- Mesh *me = self->mesh;
- int i;
- for( i = me->totcol; i-- > 0; )
- if( me->mat[i] )
- me->mat[i]->id.us--;
- MEM_freeN( me->mat );
- }
-
- /* build the new material list, increment user count, store it */
-
- matlist = EXPP_newMaterialList_fromPyList( value );
- EXPP_incr_mats_us( matlist, len );
- self->mesh->mat = matlist;
- self->mesh->totcol = (short)len;
-
-/**@ This is another ugly fix due to the weird material handling of blender.
- * it makes sure that object material lists get updated (by their length)
- * according to their data material lists, otherwise blender crashes.
- * It just stupidly runs through all objects...BAD BAD BAD.
- */
-
- test_object_materials( ( ID * ) self->mesh );
-
- return 0;
-}
-
-static PyObject *Mesh_getMaxSmoothAngle( BPy_Mesh * self )
-{
- return PyInt_FromLong( self->mesh->smoothresh );
-}
-
-static int Mesh_setMaxSmoothAngle( BPy_Mesh *self, PyObject *value )
-{
- return EXPP_setIValueClamped( value, &self->mesh->smoothresh,
- MESH_SMOOTHRESH_MIN,
- MESH_SMOOTHRESH_MAX, 'h' );
-}
-
-static PyObject *Mesh_getSubDivLevels( BPy_Mesh * self )
-{
- return Py_BuildValue( "(h,h)",
- self->mesh->subdiv, self->mesh->subdivr );
-}
-
-static int Mesh_setSubDivLevels( BPy_Mesh *self, PyObject *value )
-{
- int subdiv[2];
- int i;
- PyObject *tmp;
-
- if( !PyTuple_Check( value ) || PyTuple_Size( value ) != 2 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected (int, int) as argument" );
-
- for( i = 0; i < 2; i++ ) {
- tmp = PyTuple_GET_ITEM( value, i );
- if( !PyInt_Check( tmp ) )
- return EXPP_ReturnIntError ( PyExc_TypeError,
- "expected a list [int, int] as argument" );
- subdiv[i] = EXPP_ClampInt( PyInt_AsLong( tmp ),
- MESH_SUBDIV_MIN,
- MESH_SUBDIV_MAX );
- }
-
- self->mesh->subdiv = (short)subdiv[0];
- self->mesh->subdivr = (short)subdiv[1];
- return 0;
-}
-
-static PyObject *Mesh_getFlag( BPy_Mesh * self, void *type )
-{
- switch( (long)type ) {
- case MESH_HASFACEUV:
- return self->mesh->mtface ? EXPP_incr_ret_True() :
- EXPP_incr_ret_False();
- case MESH_HASMCOL:
- return self->mesh->mcol ? EXPP_incr_ret_True() :
- EXPP_incr_ret_False();
- case MESH_HASVERTUV:
- return self->mesh->msticky ? EXPP_incr_ret_True() :
- EXPP_incr_ret_False();
- case MESH_HASMULTIRES:
- return self->mesh->mr ? EXPP_incr_ret_True() :
- EXPP_incr_ret_False();
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get attribute" );
- }
-}
-
-static int Mesh_setFlag( BPy_Mesh * self, PyObject *value, void *type )
-{
- int param;
- Mesh *mesh = self->mesh;
-
- param = PyObject_IsTrue( value );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- /* sticky is independent of faceUV and vertUV */
-
- switch( (long)type ) {
- case MESH_HASFACEUV:
- if( !param ) {
- if( mesh->mtface ) {
- CustomData_free_layers( &mesh->fdata, CD_MTFACE, mesh->totface );
- mesh->mtface = NULL;
- }
- } else if( !mesh->mtface ) {
- if( !mesh->totface )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "mesh has no faces" );
- make_tfaces( mesh );
- }
- return 0;
- case MESH_HASMCOL:
- if( !param ) {
- if( mesh->mcol ) {
- CustomData_free_layers( &mesh->fdata, CD_MCOL, mesh->totface );
- mesh->mcol = NULL;
- }
- } else if( !mesh->mcol ) {
- /* TODO: mesh_create_shadedColors */
- mesh->mcol = CustomData_add_layer( &mesh->fdata, CD_MCOL,
- CD_DEFAULT, NULL, mesh->totface );
- }
- return 0;
- case MESH_HASVERTUV:
- if( !param ) {
- if( mesh->msticky ) {
- CustomData_free_layer_active( &mesh->vdata, CD_MSTICKY, mesh->totvert );
- mesh->msticky = NULL;
- }
- } else {
- if( !mesh->msticky ) {
- mesh->msticky = CustomData_add_layer( &mesh->vdata, CD_MSTICKY,
- CD_CALLOC, NULL, mesh->totvert );
- memset( mesh->msticky, 255, mesh->totvert*sizeof( MSticky ) );
- /* TODO: rework RE_make_sticky() so we can calculate */
- }
- }
- return 0;
- case MESH_HASMULTIRES:
- if (!self->object)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- if( !param ) {
- if ( mesh->mr ) {
- multires_delete(self->object, mesh);
- }
- } else {
- if ( !mesh->mr ) {
- if (mesh->key)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "Cannot enable multires for a mesh with shape keys" );
- multires_make(self->object, mesh);
- }
- }
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "couldn't get attribute" );
- }
-}
-
-static PyObject *Mesh_getMode( BPy_Mesh * self )
-{
- return PyInt_FromLong( self->mesh->flag );
-}
-
-static int Mesh_setMode( BPy_Mesh *self, PyObject *value )
-{
- short param;
- static short bitmask = ME_ISDONE | ME_NOPUNOFLIP | ME_TWOSIDED |
- ME_UVEFFECT | ME_VCOLEFFECT | ME_AUTOSMOOTH | ME_SMESH |
- ME_SUBSURF | ME_OPT_EDGES;
-
- if( !PyInt_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", bitmask );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = (short)PyInt_AS_LONG ( value );
-
- if( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- self->mesh->flag = param;
-
- return 0;
-}
-
-static PyObject *Mesh_getKey( BPy_Mesh * self )
-{
- if( self->mesh->key )
- return Key_CreatePyObject(self->mesh->key);
- else
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Mesh_getActiveFace( BPy_Mesh * self )
-{
- /* not needed but keep incase exceptions make use of it */
- if( !self->mesh->mtface )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "face has no texture values" );
-
- if (self->mesh->act_face != -1 && self->mesh->act_face <= self->mesh->totface)
- return PyInt_FromLong( self->mesh->act_face );
-
- Py_RETURN_NONE;
-}
-
-static int Mesh_setActiveFace( BPy_Mesh * self, PyObject * value )
-{
- int param;
-
- /* if no texture faces, error */
-
- if( !self->mesh->mtface )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "face has no texture values" );
-
- /* if param isn't an int, error */
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int argument" );
-
- /* check for a valid index */
-
- param = PyInt_AsLong( value );
- if( param < 0 || param > self->mesh->totface )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "face index out of range" );
-
- self->mesh->act_face = param;
- return 0;
-}
-
-static PyObject *Mesh_getActiveGroup( BPy_Mesh * self )
-{
- bDeformGroup *defGroup;
- Object *object = self->object;
-
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- if( object->actdef ) {
- defGroup = BLI_findlink( &object->defbase, object->actdef-1 );
- return PyString_FromString( defGroup->name );
- }
-
- Py_RETURN_NONE;
-}
-
-static int Mesh_setActiveGroup( BPy_Mesh * self, PyObject * arg )
-{
- char *name;
- int tmp;
- Object *object = self->object;
-
- if( !object )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- if( !PyString_Check( arg ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected a string argument" );
-
- name = PyString_AsString( arg );
- tmp = object->actdef;
- vertexgroup_select_by_name( object, name );
- if( !object->actdef ) {
- object->actdef = tmp;
- return EXPP_ReturnIntError( PyExc_ValueError,
- "vertex group not found" );
- }
-
- return 0;
-}
-
-static PyObject *Mesh_getTexMesh( BPy_Mesh * self )
-{
- Mesh *texme= self->mesh->texcomesh;
-
- if (texme)
- return Mesh_CreatePyObject( texme, NULL );
- else
- Py_RETURN_NONE;
-}
-
-static int Mesh_setTexMesh( BPy_Mesh * self, PyObject * value )
-{
- int ret = GenericLib_assignData(value, (void **) &self->mesh->texcomesh, 0, 1, ID_ME, 0);
-
- if (ret==0 && value!=Py_None) /*This must be a mesh type*/
- (( BPy_Mesh * ) value)->new= 0;
-
- return ret;
-}
-
-static int Mesh_setSel( BPy_Mesh * self, PyObject * value )
-{
- int i, param = PyObject_IsTrue( value );
- Mesh *me = self->mesh;
- MVert *mvert = me->mvert;
- MEdge *medge = me->medge;
- MFace *mface = me->mface;
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param ) {
- for( i = 0; i < me->totvert; ++mvert, ++i )
- mvert->flag |= SELECT;
- for( i = 0; i < me->totedge; ++medge, ++i )
- medge->flag |= SELECT;
- for( i = 0; i < me->totface; ++mface, ++i )
- mface->flag |= ME_FACE_SEL;
- } else {
- for( i = 0; i < me->totvert; ++mvert, ++i )
- mvert->flag &= ~SELECT;
- for( i = 0; i < me->totedge; ++medge, ++i )
- medge->flag &= ~SELECT;
- for( i = 0; i < me->totface; ++mface, ++i )
- mface->flag &= ~ME_FACE_SEL;
- }
-
- return 0;
-}
-
-static int Mesh_setHide( BPy_Mesh * self, PyObject * value )
-{
- int i, param = PyObject_IsTrue( value );
- Mesh *me = self->mesh;
- MVert *mvert = me->mvert;
- MEdge *medge = me->medge;
- MFace *mface = me->mface;
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param ) {
- for( i = 0; i < me->totvert; ++mvert, ++i )
- mvert->flag |= ME_HIDE;
- for( i = 0; i < me->totedge; ++medge, ++i )
- medge->flag |= ME_HIDE;
- for( i = 0; i < me->totface; ++mface, ++i )
- mface->flag |= ME_HIDE;
- } else {
- for( i = 0; i < me->totvert; ++mvert, ++i )
- mvert->flag &= ~ME_HIDE;
- for( i = 0; i < me->totedge; ++medge, ++i )
- medge->flag &= ~ME_HIDE;
- for( i = 0; i < me->totface; ++mface, ++i )
- mface->flag &= ~ME_HIDE;
- }
-
- return 0;
-}
-
-/************************************************************************
- *
- * Python Mesh_Type standard operations
- *
- ************************************************************************/
-
-static void Mesh_dealloc( BPy_Mesh * self )
-{
- Mesh *mesh = self->mesh;
-
- /* if the mesh is new and has no users, delete it */
- if( self->new && !mesh->id.us )
- free_libblock( &G.main->mesh, mesh );
-
- PyObject_DEL( self );
-}
-
-static int Mesh_compare( BPy_Mesh * a, BPy_Mesh * b )
-{
- return ( a->mesh == b->mesh ) ? 0 : -1;
-}
-
-static PyObject *Mesh_repr( BPy_Mesh * self )
-{
- return PyString_FromFormat( "[Mesh \"%s\"]",
- self->mesh->id.name + 2 );
-}
-
-/*****************************************************************************/
-/* Python Mesh_Type attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Mesh_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"verts",
- (getter)Mesh_getVerts, (setter)Mesh_setVerts,
- "The mesh's vertices (MVert)",
- NULL},
- {"edges",
- (getter)Mesh_getEdges, (setter)NULL,
- "The mesh's edge data (MEdge)",
- NULL},
- {"faces",
- (getter)Mesh_getFaces, (setter)NULL,
- "The mesh's face data (MFace)",
- NULL},
- {"materials",
- (getter)Mesh_getMaterials, (setter)Mesh_setMaterials,
- "List of the mesh's materials",
- NULL},
- {"degr",
- (getter)Mesh_getMaxSmoothAngle, (setter)Mesh_setMaxSmoothAngle,
- "The max angle for auto smoothing",
- NULL},
- {"maxSmoothAngle",
- (getter)Mesh_getMaxSmoothAngle, (setter)Mesh_setMaxSmoothAngle,
- "deprecated: see 'degr'",
- NULL},
- {"subDivLevels",
- (getter)Mesh_getSubDivLevels, (setter)Mesh_setSubDivLevels,
- "The display and rendering subdivision levels",
- NULL},
- {"mode",
- (getter)Mesh_getMode, (setter)Mesh_setMode,
- "The mesh's mode bitfield",
- NULL},
- {"key",
- (getter)Mesh_getKey, (setter)NULL,
- "The mesh's key",
- NULL},
- {"faceUV",
- (getter)Mesh_getFlag, (setter)Mesh_setFlag,
- "UV-mapped textured faces enabled",
- (void *)MESH_HASFACEUV},
- {"vertexColors",
- (getter)Mesh_getFlag, (setter)Mesh_setFlag,
- "Vertex colors for the mesh enabled",
- (void *)MESH_HASMCOL},
- {"vertexUV",
- (getter)Mesh_getFlag, (setter)Mesh_setFlag,
- "'Sticky' flag for per vertex UV coordinates enabled",
- (void *)MESH_HASVERTUV},
- {"multires",
- (getter)Mesh_getFlag, (setter)Mesh_setFlag,
- "'Sticky' flag for per vertex UV coordinates enabled",
- (void *)MESH_HASMULTIRES},
- {"activeFace",
- (getter)Mesh_getActiveFace, (setter)Mesh_setActiveFace,
- "Index of the mesh's active texture face (in UV editor)",
- NULL},
- {"activeGroup",
- (getter)Mesh_getActiveGroup, (setter)Mesh_setActiveGroup,
- "Active group for the mesh",
- NULL},
-
- /* uv layers */
- {"activeColorLayer",
- (getter)Mesh_getActiveLayer, (setter)Mesh_setActiveLayer,
- "Name of the active UV layer",
- (void *)CD_MCOL},
- {"activeUVLayer",
- (getter)Mesh_getActiveLayer, (setter)Mesh_setActiveLayer,
- "Name of the active vertex color layer",
- (void *)CD_MTFACE},
- /* hack flip CD_MCOL so it uses the render setting */
- {"renderColorLayer",
- (getter)Mesh_getActiveLayer, (setter)Mesh_setActiveLayer,
- "Name of the render UV layer",
- (void *)-CD_MCOL},
- {"renderUVLayer",
- (getter)Mesh_getActiveLayer, (setter)Mesh_setActiveLayer,
- "Name of the render vertex color layer",
- (void *)-CD_MTFACE},
-
-
-
- /* Multires */
- {"multiresLevelCount",
- (getter)Mesh_getMultiresLevelCount, (setter)NULL,
- "The total number of multires levels",
- NULL},
- {"multiresDrawLevel",
- (getter)Mesh_getMultires, (setter)Mesh_setMultires,
- "The current multires display level",
- (void *)MESH_MULTIRES_LEVEL},
- {"multiresEdgeLevel",
- (getter)Mesh_getMultires, (setter)Mesh_setMultires,
- "The current multires edge level",
- (void *)MESH_MULTIRES_EDGE},
- {"multiresPinLevel",
- (getter)Mesh_getMultires, (setter)Mesh_setMultires,
- "The current multires pin level",
- (void *)MESH_MULTIRES_PIN},
- {"multiresRenderLevel",
- (getter)Mesh_getMultires, (setter)Mesh_setMultires,
- "The current multires render level",
- (void *)MESH_MULTIRES_RENDER},
-
- {"texMesh",
- (getter)Mesh_getTexMesh, (setter)Mesh_setTexMesh,
- "The meshes tex mesh proxy texture coord mesh",
- NULL},
- {"sel",
- (getter)NULL, (setter)Mesh_setSel,
- "Select/deselect all verts, edges, faces in the mesh",
- NULL},
- {"hide",
- (getter)NULL, (setter)Mesh_setHide,
- "Hide/unhide all verts, edges, faces in the mesh",
- NULL},
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Mesh_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Mesh_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Mesh", /* char *tp_name; */
- sizeof( BPy_Mesh ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Mesh_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Mesh_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Mesh_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Mesh_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Mesh_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*
- * get one or all mesh data objects
- */
-
-static PyObject *M_Mesh_Get( PyObject * self_unused, PyObject * args )
-{
- char *name = NULL;
- Mesh *mesh = NULL;
- BPy_Mesh* obj;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected zero or one string arguments" );
-
- if( name ) {
- mesh = ( Mesh * ) GetIdFromList( &( G.main->mesh ), name );
-
- if( !mesh ) {
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Mesh \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
- return Mesh_CreatePyObject( mesh, NULL );
- } else { /* () - return a list with all meshes in the scene */
- PyObject *meshlist;
- Link *link;
- int index = 0;
-
- meshlist = PyList_New( BLI_countlist( &( G.main->mesh ) ) );
-
- if( !meshlist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- link = G.main->mesh.first;
- index = 0;
- while( link ) {
- obj = ( BPy_Mesh * ) Mesh_CreatePyObject( ( Mesh * )link, NULL );
- PyList_SetItem( meshlist, index, ( PyObject * ) obj );
- index++;
- link = link->next;
- }
- return meshlist;
- }
-}
-
-/*
- * create a new mesh data object
- */
-
-static PyObject *M_Mesh_New( PyObject * self_unused, PyObject * args )
-{
- char *name = "Mesh";
- Mesh *mesh;
- BPy_Mesh *obj;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or a string as argument" );
-
- obj = (BPy_Mesh *)PyObject_NEW( BPy_Mesh, &Mesh_Type );
-
- if( !obj )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyObject_New() failed" );
-
- mesh = add_mesh(name); /* doesn't return NULL now, but might someday */
-
- if( !mesh ) {
- Py_DECREF ( obj );
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "FATAL: could not create mesh object" );
- }
-
- /* Bound box set to null needed because a new mesh is initialized
- with a bounding box of -1 -1 -1 -1 -1 -1
- if its not set to null the bounding box is not re-calculated
- when ob.getBoundBox() is called.*/
- MEM_freeN(mesh->bb);
- mesh->bb= NULL;
-
- mesh->id.us = 0;
-
- obj->mesh = mesh;
- obj->object = NULL;
- obj->new = 1;
- return (PyObject *)obj;
-}
-
-/*
- * creates a new MVert for users to manipulate
- */
-
-static PyObject *M_Mesh_MVert( PyObject * self_unused, PyObject * args )
-{
- int i;
- MVert vert;
-
- /* initialize the new vert's data */
- memset( &vert, 0, sizeof( MVert ) );
-
- /*
- * accept either a 3D vector or tuple of three floats
- */
-
- if( PyTuple_Size ( args ) == 1 ) {
- PyObject *tmp = PyTuple_GET_ITEM( args, 0 );
- if( !VectorObject_Check( tmp ) || ((VectorObject *)tmp)->size != 3 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected three floats or vector of size 3" );
- for( i = 0; i < 3; ++i )
- vert.co[i] = ((VectorObject *)tmp)->vec[i];
- } else if( !PyArg_ParseTuple ( args, "fff",
- &vert.co[0], &vert.co[1], &vert.co[2] ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected three floats or vector of size 3" );
-
- /* make a new MVert from the data */
- return PVert_CreatePyObject( &vert );
-}
-
-static PyObject *M_Mesh_Modes( PyObject * self_unused, PyObject * args )
-{
- int modes = 0;
-
- if( !G.scene ) {
- Py_RETURN_NONE;
- }
-
- if( !PyArg_ParseTuple( args, "|i", &modes ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional int as argument" );
-
- if( modes > ( SCE_SELECT_VERTEX | SCE_SELECT_EDGE | SCE_SELECT_FACE ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "value out of range" );
-
- if( modes > 0 )
- G.scene->selectmode = (short)modes;
-
- return PyInt_FromLong( G.scene->selectmode );
-}
-
-static struct PyMethodDef M_Mesh_methods[] = {
- {"New", (PyCFunction)M_Mesh_New, METH_VARARGS,
- "Create a new mesh"},
- {"Get", (PyCFunction)M_Mesh_Get, METH_VARARGS,
- "Get a mesh by name"},
- {"MVert", (PyCFunction)M_Mesh_MVert, METH_VARARGS,
- "Create a new MVert"},
- {"Mode", (PyCFunction)M_Mesh_Modes, METH_VARARGS,
- "Get/set edit selection mode(s)"},
- {NULL, NULL, 0, NULL},
-};
-
-static PyObject *M_Mesh_ModesDict( void )
-{
- PyObject *Modes = PyConstant_New( );
-
- if( Modes ) {
- BPy_constant *d = ( BPy_constant * ) Modes;
-
- PyConstant_Insert( d, "NOVNORMALSFLIP",
- PyInt_FromLong( ME_NOPUNOFLIP ) );
- PyConstant_Insert( d, "TWOSIDED", PyInt_FromLong( ME_TWOSIDED ) );
- PyConstant_Insert( d, "AUTOSMOOTH",
- PyInt_FromLong( ME_AUTOSMOOTH ) );
- }
-
- return Modes;
-}
-
-/* Set constants for face drawing mode -- see drawmesh.c */
-
-static PyObject *M_Mesh_FaceModesDict( void )
-{
- PyObject *FM = PyConstant_New( );
-
- if( FM ) {
- BPy_constant *d = ( BPy_constant * ) FM;
-
- PyConstant_Insert( d, "BILLBOARD", PyInt_FromLong( TF_BILLBOARD2 ) );
- PyConstant_Insert( d, "ALL", PyInt_FromLong( 0xffff ) );
- PyConstant_Insert( d, "HALO", PyInt_FromLong( TF_BILLBOARD ) );
- PyConstant_Insert( d, "DYNAMIC", PyInt_FromLong( TF_DYNAMIC ) );
- PyConstant_Insert( d, "ALPHASORT", PyInt_FromLong( TF_ALPHASORT ) );
- PyConstant_Insert( d, "INVISIBLE", PyInt_FromLong( TF_INVISIBLE ) );
- PyConstant_Insert( d, "LIGHT", PyInt_FromLong( TF_LIGHT ) );
- PyConstant_Insert( d, "OBCOL", PyInt_FromLong( TF_OBCOL ) );
- PyConstant_Insert( d, "SHADOW", PyInt_FromLong( TF_SHADOW ) );
- PyConstant_Insert( d, "TEXT", PyInt_FromLong( TF_BMFONT ) );
- PyConstant_Insert( d, "SHAREDVERT", PyInt_FromLong( TF_SHAREDVERT ) );
- PyConstant_Insert( d, "SHAREDCOL", PyInt_FromLong( TF_SHAREDCOL ) );
- PyConstant_Insert( d, "TEX", PyInt_FromLong( TF_TEX ) );
- PyConstant_Insert( d, "TILES", PyInt_FromLong( TF_TILES ) );
- PyConstant_Insert( d, "TWOSIDE", PyInt_FromLong( TF_TWOSIDE ) );
- }
-
- return FM;
-}
-
-static PyObject *M_Mesh_FaceFlagsDict( void )
-{
- PyObject *FF = PyConstant_New( );
-
- if( FF ) {
- BPy_constant *d = ( BPy_constant * ) FF;
-
- PyConstant_Insert( d, "SELECT", PyInt_FromLong( TF_SELECT ) );
- PyConstant_Insert( d, "HIDE", PyInt_FromLong( TF_HIDE ) );
- PyConstant_Insert( d, "ACTIVE", PyInt_FromLong( TF_ACTIVE ) ); /* deprecated */
- }
-
- return FF;
-}
-
-static PyObject *M_Mesh_FaceTranspModesDict( void )
-{
- PyObject *FTM = PyConstant_New( );
-
- if( FTM ) {
- BPy_constant *d = ( BPy_constant * ) FTM;
-
- PyConstant_Insert( d, "SOLID", PyInt_FromLong( TF_SOLID ) );
- PyConstant_Insert( d, "ADD", PyInt_FromLong( TF_ADD ) );
- PyConstant_Insert( d, "ALPHA", PyInt_FromLong( TF_ALPHA ) );
- PyConstant_Insert( d, "SUB", PyInt_FromLong( TF_SUB ) );
- PyConstant_Insert( d, "CLIP", PyInt_FromLong( TF_CLIP ) );
- }
-
- return FTM;
-}
-
-static PyObject *M_Mesh_EdgeFlagsDict( void )
-{
- PyObject *EF = PyConstant_New( );
-
- if( EF ) {
- BPy_constant *d = ( BPy_constant * ) EF;
-
- PyConstant_Insert(d, "SELECT", PyInt_FromLong( SELECT ) );
- PyConstant_Insert(d, "EDGEDRAW", PyInt_FromLong( ME_EDGEDRAW ) );
- PyConstant_Insert(d, "EDGERENDER", PyInt_FromLong( ME_EDGERENDER ) );
- PyConstant_Insert(d, "SEAM", PyInt_FromLong( ME_SEAM ) );
- PyConstant_Insert(d, "FGON", PyInt_FromLong( ME_FGON ) );
- PyConstant_Insert(d, "LOOSE", PyInt_FromLong( ME_LOOSEEDGE ) );
- PyConstant_Insert(d, "SHARP", PyInt_FromLong( ME_SHARP ) );
- }
-
- return EF;
-}
-
-static PyObject *M_Mesh_VertAssignDict( void )
-{
- PyObject *Vert = PyConstant_New( );
- if( Vert ) {
- BPy_constant *d = ( BPy_constant * ) Vert;
- PyConstant_Insert(d, "ADD", PyInt_FromLong(WEIGHT_ADD));
- PyConstant_Insert(d, "REPLACE", PyInt_FromLong(WEIGHT_REPLACE));
- PyConstant_Insert(d, "SUBTRACT", PyInt_FromLong(WEIGHT_SUBTRACT));
- }
- return Vert;
-}
-
-
-static PyObject *M_Mesh_SelectModeDict( void )
-{
- PyObject *Mode = PyConstant_New( );
- if( Mode ) {
- BPy_constant *d = ( BPy_constant * ) Mode;
- PyConstant_Insert(d, "VERTEX", PyInt_FromLong(SCE_SELECT_VERTEX));
- PyConstant_Insert(d, "EDGE", PyInt_FromLong(SCE_SELECT_EDGE));
- PyConstant_Insert(d, "FACE", PyInt_FromLong(SCE_SELECT_FACE));
- }
- return Mode;
-}
-
-static char M_Mesh_doc[] = "The Blender.Mesh submodule";
-
-PyObject *Mesh_Init( void )
-{
- PyObject *submodule;
-
- PyObject *Modes = M_Mesh_ModesDict( );
- PyObject *FaceFlags = M_Mesh_FaceFlagsDict( );
- PyObject *FaceModes = M_Mesh_FaceModesDict( );
- PyObject *FaceTranspModes = M_Mesh_FaceTranspModesDict( );
- PyObject *EdgeFlags = M_Mesh_EdgeFlagsDict( );
- PyObject *AssignModes = M_Mesh_VertAssignDict( );
- PyObject *SelectModes = M_Mesh_SelectModeDict( );
- PyObject *PropertyTypes = M_Mesh_PropertiesTypeDict( );
-
- if( PyType_Ready( &MCol_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MVert_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &PVert_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MVertSeq_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MEdge_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MEdgeSeq_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MFace_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MFaceSeq_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &Mesh_Type ) < 0 )
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Mesh", M_Mesh_methods, M_Mesh_doc );
- PyDict_SetItemString( PyModule_GetDict( submodule ),
- "Primitives", MeshPrimitives_Init( ) );
-
- if( Modes )
- PyModule_AddObject( submodule, "Modes", Modes );
- if( FaceFlags )
- PyModule_AddObject( submodule, "FaceFlags", FaceFlags );
- if( FaceModes )
- PyModule_AddObject( submodule, "FaceModes", FaceModes );
- if( FaceTranspModes )
- PyModule_AddObject( submodule, "FaceTranspModes",
- FaceTranspModes );
- if( EdgeFlags )
- PyModule_AddObject( submodule, "EdgeFlags", EdgeFlags );
- if( AssignModes )
- PyModule_AddObject( submodule, "AssignModes", AssignModes );
- if( SelectModes )
- PyModule_AddObject( submodule, "SelectModes", SelectModes );
- if( PropertyTypes )
- PyModule_AddObject( submodule, "PropertyTypes", PropertyTypes );
-
-
-
- return submodule;
-}
-
-/* These are needed by Object.c */
-
-PyObject *Mesh_CreatePyObject( Mesh * me, Object *obj )
-{
- BPy_Mesh *nmesh = PyObject_NEW( BPy_Mesh, &Mesh_Type );
-
- if( !nmesh )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Mesh object" );
-
- nmesh->mesh = me;
- nmesh->object = obj;
- nmesh->new = 0;
- G.totmesh++;
-
- return ( PyObject * ) nmesh;
-}
-
-
-Mesh *Mesh_FromPyObject( PyObject * pyobj, Object *obj )
-{
- BPy_Mesh *blen_obj;
-
- blen_obj = ( BPy_Mesh * ) pyobj;
- if (obj)
- blen_obj->object = obj;
-
- return blen_obj->mesh;
-
-}
diff --git a/source/blender/python/api2_2x/Mesh.h b/source/blender/python/api2_2x/Mesh.h
deleted file mode 100644
index fd03d4f3bd2..00000000000
--- a/source/blender/python/api2_2x/Mesh.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* Most of this file comes from opy_nmesh.[ch] in the old bpython dir */
-
-#ifndef EXPP_MESH_H
-#define EXPP_MESH_H
-
-#include <Python.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "Material.h"
-#include "Image.h"
-
-/* EXPP PyType Objects */
-extern PyTypeObject Mesh_Type;
-extern PyTypeObject MVert_Type;
-extern PyTypeObject PVert_Type;
-extern PyTypeObject MVertSeq_Type;
-extern PyTypeObject MEdge_Type;
-extern PyTypeObject MFace_Type;
-extern PyTypeObject MCol_Type;
-
-struct BPy_Object;
-
-/* Type checking for EXPP PyTypes */
-#define BPy_Mesh_Check(v) ((v)->ob_type == &Mesh_Type)
-#define BPy_MFace_Check(v) ((v)->ob_type == &MFace_Type)
-#define BPy_MEdge_Check(v) ((v)->ob_type == &MEdge_Type)
-#define BPy_MVert_Check(v) ((v)->ob_type == &MVert_Type)
-#define BPy_PVert_Check(v) ((v)->ob_type == &PVert_Type)
-#define BPy_MCol_Check(v) ((v)->ob_type == &MCol_Type)
-
-/* Typedefs for the new types */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- MCol *color;
-} BPy_MCol; /* a Mesh color: [r,g,b,a] */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- void * data; /* points to a Mesh or an MVert */
- int index;
-} BPy_MVert; /* a Mesh vertex */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Mesh * mesh;
- int iter;
-} BPy_MVertSeq; /* a Mesh vertex sequence */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Mesh *mesh; /* points to a Mesh */
- int index;
- short iter; /* char because it can only ever be between -1 and 2 */
-} BPy_MEdge; /* a Mesh edge */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Mesh * mesh;
- int iter;
-} BPy_MEdgeSeq; /* a Mesh edge sequence */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Mesh * mesh;
- int index;
- short iter; /* char because it can only ever be between -1 and 4 */
-} BPy_MFace; /* a Mesh face */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Mesh * mesh;
- int iter;
-} BPy_MFaceSeq; /* a Mesh face sequence */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- Mesh *mesh;
- Object *object;
- char new; /* was mesh created or already existed? */
-} BPy_Mesh;
-
-/* PROTOS */
-
-PyObject *Mesh_Init( void );
-PyObject *Mesh_CreatePyObject( Mesh * me, Object *obj );
-Mesh *Mesh_FromPyObject( PyObject * pyobj, Object *obj );
-
-#endif /* EXPP_MESH_H */
diff --git a/source/blender/python/api2_2x/Metaball.c b/source/blender/python/api2_2x/Metaball.c
deleted file mode 100644
index 9cc5aac3d77..00000000000
--- a/source/blender/python/api2_2x/Metaball.c
+++ /dev/null
@@ -1,1186 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Metaball.h" /*This must come first*/
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_mball.h"
-#include "BKE_library.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h" /* for quat normal */
-#include "DNA_object_types.h"
-#include "Mathutils.h"
-#include "Material.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-/* for dealing with materials */
-#include "MEM_guardedalloc.h"
-#include "BKE_material.h"
-
-/* checks for the metaelement being removed */
-#define METAELEM_DEL_CHECK_PY(bpy_meta_elem) if (!(bpy_meta_elem->metaelem)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Metaball has been removed" ) );
-#define METAELEM_DEL_CHECK_INT(bpy_meta_elem) if (!(bpy_meta_elem->metaelem)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Metaball has been removed" ) );
-
-/*****************************************************************************/
-/* Python API function prototypes for the Metaball module. */
-/*****************************************************************************/
-static PyObject *M_Metaball_New( PyObject * self, PyObject * args );
-static PyObject *M_Metaball_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Metaball.__doc__ */
-/*****************************************************************************/
-static char M_Metaball_doc[] =
- "The Blender Metaball module\n\n\nMetaballs are primitive shapes\
- such as balls, pipes, boxes and planes,\
- that can join each other to create smooth,\
- organic volumes\n. The shapes themseves are called\
- 'Metaelements' and can be accessed from the Metaball module.";
-
-static char M_Metaball_New_doc[] = "Creates new metaball object data";
-
-static char M_Metaball_Get_doc[] = "Retreives an existing metaball object data";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Metaball module: */
-/*****************************************************************************/
-struct PyMethodDef M_Metaball_methods[] = {
- {"New", M_Metaball_New, METH_VARARGS, M_Metaball_New_doc},
- {"Get", M_Metaball_Get, METH_VARARGS, M_Metaball_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *M_MetaElem_TypesDict( void )
-{
- PyObject *Types = PyConstant_New( );
-
- if( Types ) {
- BPy_constant *d = ( BPy_constant * ) Types;
-
- PyConstant_Insert( d, "BALL", PyInt_FromLong( MB_BALL ) );
- /* PyConstant_Insert( d, "TUBEX", PyInt_FromLong( MB_TUBEX ) ); - DEPRICATED */
- /* PyConstant_Insert( d, "TUBEY", PyInt_FromLong( MB_TUBEY ) ); - DEPRICATED */
- /* PyConstant_Insert( d, "TUBEZ", PyInt_FromLong( MB_TUBEZ ) ); - DEPRICATED */
- PyConstant_Insert( d, "TUBE", PyInt_FromLong( MB_TUBE ) );
- PyConstant_Insert( d, "PLANE", PyInt_FromLong( MB_PLANE ) );
- PyConstant_Insert( d, "ELIPSOID",PyInt_FromLong( MB_ELIPSOID ) );
- PyConstant_Insert( d, "CUBE", PyInt_FromLong( MB_CUBE ) );
- }
-
- return Types;
-}
-
-static PyObject *M_MetaElem_UpdateDict( void )
-{
- PyObject *Update = PyConstant_New( );
-
- if( Update ) {
- BPy_constant *d = ( BPy_constant * ) Update;
- PyConstant_Insert( d, "ALWAYS", PyInt_FromLong( MB_UPDATE_ALWAYS ) );
- PyConstant_Insert( d, "HALFRES",PyInt_FromLong( MB_UPDATE_HALFRES ) );
- PyConstant_Insert( d, "FAST", PyInt_FromLong( MB_UPDATE_FAST ) );
- PyConstant_Insert( d, "NEVER", PyInt_FromLong( MB_UPDATE_NEVER ) );
- }
-
- return Update;
-}
-
-/*****************************************************************************/
-/* Python BPy_Metaball methods declarations: */
-/*****************************************************************************/
-static PyObject *Metaball_getElements( BPy_Metaball * self );
-static PyObject *Metaball_getMaterials( BPy_Metaball * self );
-static int Metaball_setMaterials( BPy_Metaball * self, PyObject * value );
-static PyObject *Metaball_getWiresize( BPy_Metaball * self );
-static int Metaball_setWiresize( BPy_Metaball * self, PyObject * value );
-static PyObject *Metaball_getRendersize( BPy_Metaball * self );
-static int Metaball_setRendersize( BPy_Metaball * self, PyObject * value);
-static PyObject *Metaball_getThresh( BPy_Metaball * self );
-static int Metaball_setThresh( BPy_Metaball * self, PyObject * args );
-static PyObject *Metaball_getUpdate( BPy_Metaball * self );
-static int Metaball_setUpdate( BPy_Metaball * self, PyObject * args );
-static PyObject *Metaball_copy( BPy_Metaball * self );
-
-/*****************************************************************************/
-/* Python BPy_Metaball methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Metaball_methods[] = {
- /* name, method, flags, doc */
- {"__copy__", ( PyCFunction ) Metaball_copy,
- METH_NOARGS, "() - Return a copy of this metaball"},
- {"copy", ( PyCFunction ) Metaball_copy,
- METH_NOARGS, "() - Return a copy of this metaball"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Metaelem methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Metaelem_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Metaball_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *Metaball_repr( BPy_Metaball * self );
-static int Metaball_compare( BPy_Metaball * a, BPy_Metaball * b );
-
-/*****************************************************************************/
-/* Python Metaelem_Type callback function prototypes: */
-/*****************************************************************************/
-static void Metaelem_dealloc( BPy_Metaelem * self );
-static PyObject *Metaelem_repr( BPy_Metaelem * self );
-static int Metaelem_compare( BPy_Metaelem * a, BPy_Metaelem * b );
-
-static PyObject *Metaelem_getType( BPy_Metaelem *self );
-static int Metaelem_setType( BPy_Metaelem * self, PyObject * args );
-static PyObject *Metaelem_getCoord( BPy_Metaelem * self );
-static int Metaelem_setCoord( BPy_Metaelem * self, VectorObject * value );
-static PyObject *Metaelem_getDims( BPy_Metaelem * self );
-static int Metaelem_setDims( BPy_Metaelem * self, VectorObject * value );
-static PyObject *Metaelem_getQuat( BPy_Metaelem * self );
-static int Metaelem_setQuat( BPy_Metaelem * self, QuaternionObject * value );
-static PyObject *Metaelem_getStiffness( BPy_Metaelem * self );
-static int Metaelem_setStiffness( BPy_Metaelem * self, PyObject * value );
-static PyObject *Metaelem_getRadius( BPy_Metaelem * self );
-static int Metaelem_setRadius( BPy_Metaelem * self, PyObject * value );
-
-static PyObject *Metaelem_getMFlagBits( BPy_Metaelem * self, void * type );
-static int Metaelem_setMFlagBits( BPy_Metaelem * self, PyObject * value, void * type );
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Metaball_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"materials",
- (getter)Metaball_getMaterials, (setter)Metaball_setMaterials,
- "Number of metaball users",
- NULL},
- {"elements",
- (getter)Metaball_getElements, (setter)NULL,
- "Elements in this metaball",
- NULL},
- {"wiresize",
- (getter)Metaball_getWiresize, (setter)Metaball_setWiresize,
- "The density to draw the metaball in the 3D view",
- NULL},
- {"rendersize",
- (getter)Metaball_getRendersize, (setter)Metaball_setRendersize,
- "The density to render wire",
- NULL},
- {"thresh",
- (getter)Metaball_getThresh, (setter)Metaball_setThresh,
- "The density to render wire",
- NULL},
- {"update",
- (getter)Metaball_getUpdate, (setter)Metaball_setUpdate,
- "The setting for updating this metaball data",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*****************************************************************************/
-/* Python TypeMetaball structure definition: */
-/*****************************************************************************/
-PyTypeObject Metaball_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Metaball", /* char *tp_name; */
- sizeof( BPy_Metaball ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Metaball_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Metaball_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Metaball_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Metaball_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-static PyGetSetDef BPy_Metaelem_getseters[] = {
- {"type",
- (getter)Metaelem_getType, (setter)Metaelem_setType,
- "Metaelem Type",
- NULL},
- {"co",
- (getter)Metaelem_getCoord, (setter)Metaelem_setCoord,
- "Metaelem Location",
- NULL},
- {"quat",
- (getter)Metaelem_getQuat, (setter)Metaelem_setQuat,
- "Metaelem Rotation Quat",
- NULL},
- {"dims",
- (getter)Metaelem_getDims, (setter)Metaelem_setDims,
- "Metaelem Dimensions",
- NULL},
- {"stiffness",
- (getter)Metaelem_getStiffness, (setter)Metaelem_setStiffness,
- "MetaElem stiffness",
- NULL},
- {"radius",
- (getter)Metaelem_getRadius, (setter)Metaelem_setRadius,
- "The radius of the MetaElem",
- NULL},
- {"negative",
- (getter)Metaelem_getMFlagBits, (setter)Metaelem_setMFlagBits,
- "The density to render wire",
- (void *)MB_NEGATIVE},
- {"hide",
- (getter)Metaelem_getMFlagBits, (setter)Metaelem_setMFlagBits,
- "The density to render wire",
- (void *)MB_HIDE},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*****************************************************************************/
-/* Python TypeMetaelem structure definition: */
-/*****************************************************************************/
-PyTypeObject Metaelem_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Metaelem", /* char *tp_name; */
- sizeof( BPy_Metaelem ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Metaelem_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Metaelem_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Metaelem_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Metaelem_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Metaelem_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*****************************************************************************/
-/* Function: M_Metaball_New */
-/* Python equivalent: Blender.Metaball.New */
-/*****************************************************************************/
-static PyObject *M_Metaball_New( PyObject * self, PyObject * args )
-{
- char *name = 0;
- BPy_Metaball *pymball; /* for Data object wrapper in Python */
- MetaBall *blmball; /* for actual Data we create in Blender */
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Metaball.New() - expected string argument (or nothing)" ) );
-
- /* first create the MetaBall Data in Blender */
- if (name)
- blmball = add_mball( name );
- else
- blmball = add_mball( "Meta" );
-
- if( blmball ) {
- /* return user count to zero since add_mball() incref'ed it */
- blmball->id.us = 0;
- /* now create the wrapper obj in Python */
- pymball =
- ( BPy_Metaball * ) PyObject_NEW( BPy_Metaball,
- &Metaball_Type );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Metaball.New() - couldn't create data in Blender" ) );
-
- if( pymball == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create MetaBall Data object" ) );
-
- pymball->metaball = blmball;
- /*link Python mballer wrapper to Blender MetaBall */
-
- return ( PyObject * ) pymball;
-}
-
-
-/*****************************************************************************/
-/* Function: M_Metaball_Get */
-/* Python equivalent: Blender.Metaball.Get */
-/* Description: Receives a string and returns the metaball data obj */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all metaball data names in the */
-/* current scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Metaball_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- MetaBall *mball_iter = NULL;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Metaball.Get() - expected string argument (or nothing)" ) );
-
- if( name ) { /* (name) - Search mball by name */
- mball_iter = ( MetaBall * ) GetIdFromList( &( G.main->mball ), name );
-
- if (!mball_iter) {
- char error_msg[128];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Metaball.Get(\"%s\") - not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
- return Metaball_CreatePyObject(mball_iter);
-
- } else { /* () - return a list of all mballs in the scene */
-
- PyObject *mballlist = PyList_New( BLI_countlist( &( G.main->mball ) ) );
- int index=0;
-
- if( mballlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "MetaBall.Get() - couldn't create PyList" ) );
-
- mball_iter = G.main->mball.first;
- while( mball_iter ) {
- PyList_SetItem( mballlist, index, Metaball_CreatePyObject(mball_iter) );
- index++;
- mball_iter = mball_iter->id.next;
- }
- return mballlist;
- }
-
-}
-
-
-/*****************************************************************************/
-/* Function: initObject */
-/*****************************************************************************/
-PyObject *Metaball_Init( void )
-{
- PyObject *submodule;
- PyObject *Types= M_MetaElem_TypesDict( );
- PyObject *Update= M_MetaElem_UpdateDict( );
-
- if( PyType_Ready( &Metaball_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &Metaelem_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &MetaElemSeq_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Metaball", M_Metaball_methods, M_Metaball_doc);
-
- if( Types )
- PyModule_AddObject( submodule, "Types", Types );
- PyModule_AddObject( submodule, "Update", Update );
-
- /*Add SUBMODULES to the module*/
- /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); */ /*creates a *new* module*/
- return submodule;
-}
-
-MetaBall *Metaball_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Metaball * ) pyobj )->metaball;
-}
-
-static PyObject *Metaball_getMaterials( BPy_Metaball *self )
-{
- return EXPP_PyList_fromMaterialList( self->metaball->mat,
- self->metaball->totcol, 1 );
-}
-static int Metaball_setMaterials( BPy_Metaball *self, PyObject * value )
-{
- Material **matlist;
- int len;
-
- if( !PySequence_Check( value ) ||
- !EXPP_check_sequence_consistency( value, &Material_Type ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.materials - list should only contain materials or None)" );
-
- len = PyList_Size( value );
- if( len > 16 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.materials - list can't have more than 16 materials" );
-
- /* free old material list (if it exists) and adjust user counts */
- if( self->metaball->mat ) {
- MetaBall *mb = self->metaball;
- int i;
- for( i = mb->totcol; i-- > 0; )
- if( mb->mat[i] )
- mb->mat[i]->id.us--;
- MEM_freeN( mb->mat );
- }
-
- /* build the new material list, increment user count, store it */
-
- matlist = EXPP_newMaterialList_fromPyList( value );
- EXPP_incr_mats_us( matlist, len );
- self->metaball->mat = matlist;
- self->metaball->totcol = (short)len;
-
-/**@ This is another ugly fix due to the weird material handling of blender.
- * it makes sure that object material lists get updated (by their length)
- * according to their data material lists, otherwise blender crashes.
- * It just stupidly runs through all objects...BAD BAD BAD.
- */
-
- test_object_materials( ( ID * ) self->metaball );
-
- return 0;
-}
-
-static PyObject *Metaball_getWiresize( BPy_Metaball * self )
-{
- return PyFloat_FromDouble( self->metaball->wiresize );
-}
-
-static int Metaball_setWiresize( BPy_Metaball * self, PyObject * value )
-{
- float param;
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.wiresize - expected float argument" );
-
- param = (float)PyFloat_AsDouble( value );
-
- self->metaball->wiresize = EXPP_ClampFloat(param, 0.05f, 1.0);
- return 0;
-
-}
-static PyObject *Metaball_getRendersize( BPy_Metaball * self )
-{
- return PyFloat_FromDouble( self->metaball->rendersize );
-}
-
-static int Metaball_setRendersize( BPy_Metaball * self, PyObject * value )
-{
-
- float param;
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.rendersize - expected float argument" );
-
- param = (float)PyFloat_AsDouble( value );
-
- self->metaball->rendersize = EXPP_ClampFloat(param, 0.05f, 1.0);
- return 0;
-}
-
-static PyObject *Metaball_getThresh( BPy_Metaball * self )
-{
- return PyFloat_FromDouble( self->metaball->thresh );
-}
-
-static int Metaball_setThresh( BPy_Metaball * self, PyObject * value )
-{
-
- float param;
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.thresh - expected float argument" );
-
- param = (float)PyFloat_AsDouble( value );
-
- self->metaball->thresh = EXPP_ClampFloat(param, 0.0, 5.0);
- return 0;
-}
-
-static PyObject *Metaball_getUpdate( BPy_Metaball * self )
-{
- return PyInt_FromLong( (long)self->metaball->flag );
-}
-
-static int Metaball_setUpdate( BPy_Metaball * self, PyObject * value )
-{
-
- int param;
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaball.update - expected an int argument" );
-
- param = (int)PyInt_AS_LONG( value );
-
- self->metaball->flag = EXPP_ClampInt( param, 0, 3 );
- return 0;
-}
-
-static PyObject *Metaball_copy( BPy_Metaball * self )
-{
- BPy_Metaball *pymball; /* for Data object wrapper in Python */
- MetaBall *blmball; /* for actual Data we create in Blender */
-
- blmball = copy_mball( self->metaball ); /* first create the MetaBall Data in Blender */
-
- if( blmball ) {
- /* return user count to zero since add_mball() incref'ed it */
- blmball->id.us = 0;
- /* now create the wrapper obj in Python */
- pymball =
- ( BPy_Metaball * ) PyObject_NEW( BPy_Metaball,
- &Metaball_Type );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "metaball.__copy__() - couldn't create data in Blender" ) );
-
- if( pymball == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "metaball.__copy__() - couldn't create data in Blender" ) );
-
- pymball->metaball = blmball;
-
- return ( PyObject * ) pymball;
-}
-
-
-/* These are needed by Object.c */
-PyObject *Metaball_CreatePyObject( MetaBall * mball)
-{
- BPy_Metaball *py_mball= PyObject_NEW( BPy_Metaball, &Metaball_Type );
-
- if( !py_mball )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Metaball object" );
-
- py_mball->metaball= mball;
-
- return ( PyObject * ) py_mball;
-}
-
-
-static PyObject *MetaElemSeq_CreatePyObject(BPy_Metaball *self, MetaElem *iter)
-{
- BPy_MetaElemSeq *seq = PyObject_NEW( BPy_MetaElemSeq, &MetaElemSeq_Type);
- seq->bpymetaball = self; Py_INCREF(self);
- seq->iter= iter;
- return (PyObject *)seq;
-}
-
-/*
- * Element, get an instance of the iterator.
- */
-static PyObject *Metaball_getElements( BPy_Metaball * self )
-{
- return MetaElemSeq_CreatePyObject(self, NULL);
-}
-
-/*
- * Metaelem dealloc - free from memory
- */
-/* This is a callback function for the BPy_Metaelem type. It is */
-static void Metaelem_dealloc( BPy_Metaelem * self )
-{
- self->metaelem= NULL; /* so any references to the same bpyobject will raise an error */
- PyObject_DEL( self );
-}
-
-/*
- * elem.type - int to set the shape of the element
- */
-static PyObject *Metaelem_getType( BPy_Metaelem *self )
-{
- METAELEM_DEL_CHECK_PY(self);
-
- return PyInt_FromLong( self->metaelem->type );
-}
-static int Metaelem_setType( BPy_Metaelem * self, PyObject * value )
-{
- int type;
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.type - expected an integer (bitmask) as argument" );
-
- METAELEM_DEL_CHECK_INT(self);
-
- type = PyInt_AS_LONG( value );
-
- if( (type < 0) || ( type > ( MB_BALL | MB_TUBEX | MB_TUBEY | MB_TUBEZ | MB_TUBE | MB_PLANE | MB_ELIPSOID | MB_CUBE ) ))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "metaelem.type - value out of range" );
-
- self->metaelem->type= type;
- return 0;
-}
-
-/*
- * elem.co - non wrapped vector representing location
- */
-static PyObject *Metaelem_getCoord( BPy_Metaelem * self )
-{
- float co[3];
-
- METAELEM_DEL_CHECK_PY(self);
-
- co[0]= self->metaelem->x;
- co[1]= self->metaelem->y;
- co[2]= self->metaelem->z;
-
- return newVectorObject( co, 3, Py_NEW );
-}
-static int Metaelem_setCoord( BPy_Metaelem * self, VectorObject * value )
-{
-
- if( !VectorObject_Check( value ) || value->size != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.co - expected vector argument of size 3" );
-
- METAELEM_DEL_CHECK_INT(self);
-
- self->metaelem->x= value->vec[0];
- self->metaelem->y= value->vec[1];
- self->metaelem->z= value->vec[2];
- return 0;
-}
-
-/*
- * elem.dims - non wrapped vector representing the xyz dimensions
- * only effects some element types
- */
-static PyObject *Metaelem_getDims( BPy_Metaelem * self )
-{
- float co[3];
- METAELEM_DEL_CHECK_PY(self);
-
- co[0]= self->metaelem->expx;
- co[1]= self->metaelem->expy;
- co[2]= self->metaelem->expz;
- return newVectorObject( co, 3, Py_NEW );
-}
-static int Metaelem_setDims( BPy_Metaelem * self, VectorObject * value )
-{
- if( !VectorObject_Check( value ) || value->size != 3 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.dims - expected vector argument of size 3" );
-
- METAELEM_DEL_CHECK_INT(self);
-
- self->metaelem->expx= EXPP_ClampFloat(value->vec[0], 0.0, 20.0);
- self->metaelem->expy= EXPP_ClampFloat(value->vec[1], 0.0, 20.0);
- self->metaelem->expz= EXPP_ClampFloat(value->vec[2], 0.0, 20.0);
- return 0;
-}
-
-/*
- * elem.quat - non wrapped quat representing the rotation
- * only effects some element types - a rotated ball has no effect for eg.
- */
-static PyObject *Metaelem_getQuat( BPy_Metaelem * self )
-{
- METAELEM_DEL_CHECK_PY(self);
- return newQuaternionObject(self->metaelem->quat, Py_NEW);
-}
-static int Metaelem_setQuat( BPy_Metaelem * self, QuaternionObject * value )
-{
- int i;
- if( !QuaternionObject_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.quat - expected quat argument" );
-
- METAELEM_DEL_CHECK_INT(self);
-
- for (i = 0; i < 4; i++)
- self->metaelem->quat[i]= value->quat[i];
-
- /* need to normalize or metaball drawing can go into an infinate loop */
- NormalQuat(self->metaelem->quat);
-
- return 0;
-}
-
-/*
- * elem.hide and elem.sel - get/set true false
- */
-static PyObject *Metaelem_getMFlagBits( BPy_Metaelem * self, void * type )
-{
- METAELEM_DEL_CHECK_PY(self);
- return EXPP_getBitfield( &(self->metaelem->flag), (int)((long)type ), 'h' );
-}
-static int Metaelem_setMFlagBits( BPy_Metaelem * self, PyObject * value,
- void * type )
-{
- METAELEM_DEL_CHECK_INT(self);
- return EXPP_setBitfield( value, &(self->metaelem->flag),
- (int)((long)type), 'h' );
-}
-
-/*
- * elem.stiffness - floating point, the volume of this element.
- */
-static PyObject *Metaelem_getStiffness( BPy_Metaelem *self )
-{
- METAELEM_DEL_CHECK_PY(self);
- return PyFloat_FromDouble( self->metaelem->s );
-}
-static int Metaelem_setStiffness( BPy_Metaelem *self, PyObject *value)
-{
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.stiffness - expected float argument" );
-
- self->metaelem->s = EXPP_ClampFloat((float)PyFloat_AsDouble( value ), 0.0, 10.0);
- return 0;
-}
-
-/*
- * elem.radius- floating point, the size if the element
- */
-static PyObject *Metaelem_getRadius( BPy_Metaelem *self )
-{
- METAELEM_DEL_CHECK_PY(self);
- return PyFloat_FromDouble( self->metaelem->rad );
-}
-static int Metaelem_setRadius( BPy_Metaelem *self, PyObject *value)
-{
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "metaelem.radius - expected float argument" );
-
- self->metaelem->rad = /* is 5000 too small? */
- EXPP_ClampFloat((float)PyFloat_AsDouble( value ), 0.0, 5000.0);
-
- return 0;
-}
-
-
-/*
- * callback functions for comparison.
- * It compares two Metaball_Type objects. Only the "==" and "!="
- * comparisons are meaninful. Returns 0 for equality and -1 if
- * they don't point to the same Blender struct.
- * In Python it becomes 1 if they are equal, 0 otherwise.
- */
-static int Metaball_compare( BPy_Metaball * a, BPy_Metaball * b )
-{
- MetaBall *pa = a->metaball, *pb = b->metaball;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static int MetaElemSeq_compare( BPy_MetaElemSeq * a, BPy_MetaElemSeq * b )
-{
- MetaBall *pa = a->bpymetaball->metaball, *pb = b->bpymetaball->metaball;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static int Metaelem_compare( BPy_Metaelem * a, BPy_Metaelem * b )
-{
- MetaElem *pa = a->metaelem, *pb = b->metaelem;
- return ( pa == pb ) ? 0 : -1;
-}
-
-/*
- * repr function
- * callback functions building meaninful string to representations
- */
-static PyObject *Metaball_repr( BPy_Metaball * self )
-{
- return PyString_FromFormat( "[Metaball \"%s\"]",
- self->metaball->id.name + 2 );
-}
-
-static PyObject *Metaelem_repr( BPy_Metaelem * self )
-{
- return PyString_FromString( "Metaelem" );
-}
-
-static PyObject *MetaElemSeq_repr( BPy_MetaElemSeq * self )
-{
- return PyString_FromFormat( "[Metaball Iterator \"%s\"]",
- self->bpymetaball->metaball->id.name + 2 );
-}
-
-
-
-/*
- * MeteElem Seq sequence
- */
-
-static PyObject *MetaElem_CreatePyObject( MetaElem *metaelem )
-{
- BPy_Metaelem *elem= PyObject_NEW( BPy_Metaelem, &Metaelem_Type);
- elem->metaelem = metaelem; Py_INCREF(elem);
- return (PyObject *)elem;
-}
-
-static int MetaElemSeq_len( BPy_MetaElemSeq * self )
-{
- return BLI_countlist( &( self->bpymetaball->metaball->elems ) );
-}
-
-
-static PySequenceMethods MetaElemSeq_as_sequence = {
- ( inquiry ) MetaElemSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) 0, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-/************************************************************************
- *
- * Python MetaElemSeq_Type iterator (iterates over Metaballs)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator
- */
-
-static PyObject *MetaElemSeq_getIter( BPy_MetaElemSeq * self )
-{
- if (!self->iter) { /* not alredy looping on this data, */
- self->iter = self->bpymetaball->metaball->elems.first;
- return EXPP_incr_ret ( (PyObject *) self );
- } else
- return MetaElemSeq_CreatePyObject(self->bpymetaball, self->bpymetaball->metaball->elems.first);
-}
-
-/*
- * Return next MetaElem.
- */
-
-static PyObject *MetaElemSeq_nextIter( BPy_MetaElemSeq * self )
-{
- PyObject *object;
- if( !(self->iter) || !(self->bpymetaball->metaball) ) {
- self->iter= NULL;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object= MetaElem_CreatePyObject( self->iter );
- self->iter= self->iter->next;
- return object;
-}
-
-/*
- * Adds and returns a new metaelement,
- * no args are taken so the returned metaball must be modified after adding.
- * Accessed as mball.elements.add() where mball is a python metaball data type.
- */
-static PyObject *MetaElemSeq_add( BPy_MetaElemSeq * self )
-{
- MetaElem *ml;
-
- ml = MEM_callocN( sizeof( MetaElem ), "metaelem" );
- BLI_addhead( &( self->bpymetaball->metaball->elems ), ml );
- ml->x = 0;
- ml->y = 0;
- ml->z = 0;
- ml->quat[0]= 1.0;
- ml->quat[1]= 0.0;
- ml->quat[2]= 0.0;
- ml->quat[3]= 0.0;
- ml->rad = 2;
- ml->s = 2.0;
- ml->flag = SELECT;
- ml->type = 0;
- ml->expx = 1;
- ml->expy = 1;
- ml->expz = 1;
- ml->type = MB_BALL;
-
- return MetaElem_CreatePyObject(ml);
-}
-
-
-/*
- * removes a metaelement if it is a part of the metaball,
- * no args are taken so the returned metaball must be modified after adding.
- * Accessed as mball.elements.add() where mball is a python metaball data type.
- */
-static PyObject *MetaElemSeq_remove( BPy_MetaElemSeq * self, BPy_Metaelem *elem )
-{
- MetaElem *ml_iter, *ml_py;
-
- if( !BPy_Metaelem_Check(elem) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "elements.remove(metaelem) - expected a Metaball element" );
-
- METAELEM_DEL_CHECK_PY(elem);
-
- ml_py= elem->metaelem;
-
- for (ml_iter= self->bpymetaball->metaball->elems.first; ml_iter; ml_iter= ml_iter->next) {
- if (ml_py == ml_iter) {
- elem->metaelem= NULL;
- BLI_freelinkN( &(self->bpymetaball->metaball->elems), ml_py);
- Py_RETURN_NONE;
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "elements.remove(elem): elem not in meta elements" );
-
-}
-
-static struct PyMethodDef BPy_MetaElemSeq_methods[] = {
- {"add", (PyCFunction)MetaElemSeq_add, METH_NOARGS,
- "add metaelem to metaball data"},
- {"remove", (PyCFunction)MetaElemSeq_remove, METH_O,
- "remove element from metaball data"},
- {NULL, NULL, 0, NULL}
-};
-
-/************************************************************************
- *
- * Python MetaElemSeq_Type standard operations
- *
- ************************************************************************/
-
-static void MetaElemSeq_dealloc( BPy_MetaElemSeq * self )
-{
- Py_DECREF(self->bpymetaball);
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Python MetaElemSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject MetaElemSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender MetaElemSeq", /* char *tp_name; */
- sizeof( BPy_MetaElemSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) MetaElemSeq_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) MetaElemSeq_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) MetaElemSeq_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &MetaElemSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) MetaElemSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) MetaElemSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_MetaElemSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
diff --git a/source/blender/python/api2_2x/Metaball.h b/source/blender/python/api2_2x/Metaball.h
deleted file mode 100644
index 7abb3532071..00000000000
--- a/source/blender/python/api2_2x/Metaball.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EXPP_METABALL_H
-#define EXPP_METABALL_H
-
-#include <Python.h>
-#include "DNA_meta_types.h"
-
-
-extern PyTypeObject Metaball_Type;
-
-#define BPy_Metaball_Check(v) ((v)->ob_type==&Metaball_Type)
-
-
-/* Python BPy_Metaball structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- MetaBall * metaball; /* libdata must be second */
-} BPy_Metaball;
-
-
-extern PyTypeObject Metaelem_Type;
-
-#define BPy_Metaelem_Check(v) ((v)->ob_type==&Metaelem_Type)
-
-/* Python BPy_Metaelem structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- MetaElem * metaelem;
-} BPy_Metaelem;
-
-extern PyTypeObject MetaElemSeq_Type;
-
-#define BPy_MetaElemSeq_Check(v) ((v)->ob_type==&MetaElemSeq_Type)
-
-/* Python BPy_MetaElemSeq structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- BPy_Metaball *bpymetaball; /* link to the python group so we can know if its been removed */
- MetaElem * iter; /* so we can iterate over the objects */
-} BPy_MetaElemSeq;
-
-/*
- * prototypes
- */
-
-PyObject *Metaball_Init( void );
-PyObject *Metaball_CreatePyObject( MetaBall * mball );
-MetaBall *Metaball_FromPyObject( PyObject * py_obj );
-
-#endif /* EXPP_METABALL_H */
diff --git a/source/blender/python/api2_2x/Modifier.c b/source/blender/python/api2_2x/Modifier.c
deleted file mode 100644
index 3bef0eead09..00000000000
--- a/source/blender/python/api2_2x/Modifier.c
+++ /dev/null
@@ -1,1748 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Ken Hughes, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* TODO, accessing a modifier sequence of a deleted object will crash blender at the moment, not sure how to fix this. */
-
-
-#include "Modifier.h" /*This must come first*/
-
-#include "DNA_object_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_vec_types.h"
-
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_modifier.h"
-#include "BKE_library.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "MEM_guardedalloc.h"
-#include "BDR_editobject.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "Object.h"
-#include "Texture.h"
-#include "Mathutils.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-/* checks for the scene being removed */
-#define MODIFIER_DEL_CHECK_PY(bpy_modifier) if (!(bpy_modifier->md)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Modifier has been removed" ) )
-#define MODIFIER_DEL_CHECK_INT(bpy_modifier) if (!(bpy_modifier->md)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Modifier has been removed" ) )
-
-enum mod_constants {
- /*Apply to all modifiers*/
- EXPP_MOD_RENDER = 0,
- EXPP_MOD_REALTIME,
- EXPP_MOD_EDITMODE,
- EXPP_MOD_ONCAGE,
-
- /*GENERIC*/
- EXPP_MOD_OBJECT, /*ARMATURE, LATTICE, CURVE, BOOLEAN, ARRAY*/
- EXPP_MOD_VERTGROUP, /*ARMATURE, LATTICE, CURVE, SMOOTH, CAST*/
- EXPP_MOD_LIMIT, /*ARRAY, MIRROR*/
- EXPP_MOD_FLAG, /*MIRROR, WAVE*/
- EXPP_MOD_COUNT, /*DECIMATOR, ARRAY*/
- EXPP_MOD_LENGTH, /*BUILD, ARRAY*/
- EXPP_MOD_FACTOR, /*SMOOTH, CAST*/
- EXPP_MOD_ENABLE_X, /*SMOOTH, CAST*/
- EXPP_MOD_ENABLE_Y, /*SMOOTH, CAST*/
- EXPP_MOD_ENABLE_Z, /*SMOOTH, CAST*/
- EXPP_MOD_TYPES, /*SUBSURF, CAST*/
-
- /*SUBSURF SPECIFIC*/
- EXPP_MOD_LEVELS,
- EXPP_MOD_RENDLEVELS,
- EXPP_MOD_OPTIMAL,
- EXPP_MOD_UV,
-
- /*ARMATURE SPECIFIC*/
- EXPP_MOD_VGROUPS,
- EXPP_MOD_ENVELOPES,
- EXPP_MOD_QUATERNION,
- EXPP_MOD_B_BONE_REST,
- EXPP_MOD_INVERT_VERTGROUP,
- EXPP_MOD_MULTIMODIFIER,
-
- /*ARRAY SPECIFIC*/
- EXPP_MOD_OBJECT_OFFSET,
- EXPP_MOD_OBJECT_CURVE,
- EXPP_MOD_OFFSET_VEC,
- EXPP_MOD_SCALE_VEC,
- EXPP_MOD_MERGE_DIST,
-
- /*BUILD SPECIFIC*/
- EXPP_MOD_START,
- EXPP_MOD_SEED,
- EXPP_MOD_RANDOMIZE,
-
- /*MIRROR SPECIFIC*/
- EXPP_MOD_AXIS_X,
- EXPP_MOD_AXIS_Y,
- EXPP_MOD_AXIS_Z,
-
- /*DECIMATE SPECIFIC*/
- EXPP_MOD_RATIO,
-
- /*WAVE SPECIFIC*/
- EXPP_MOD_STARTX,
- EXPP_MOD_STARTY,
- EXPP_MOD_HEIGHT,
- EXPP_MOD_WIDTH,
- EXPP_MOD_NARROW,
- EXPP_MOD_SPEED,
- EXPP_MOD_DAMP,
- EXPP_MOD_LIFETIME,
- EXPP_MOD_TIMEOFFS,
-
- /*BOOLEAN SPECIFIC*/
- EXPP_MOD_OPERATION,
-
- /*EDGE SPLIT SPECIFIC */
- EXPP_MOD_EDGESPLIT_ANGLE,
- EXPP_MOD_EDGESPLIT_FROM_ANGLE,
- EXPP_MOD_EDGESPLIT_FROM_SHARP,
-
- /* DISPLACE */
- EXPP_MOD_UVLAYER,
- EXPP_MOD_MID_LEVEL,
- EXPP_MOD_STRENGTH,
- EXPP_MOD_TEXTURE,
- EXPP_MOD_MAPPING,
- EXPP_MOD_DIRECTION,
-
- /* SMOOTH */
- EXPP_MOD_REPEAT,
-
- /* CAST */
- EXPP_MOD_RADIUS,
- EXPP_MOD_SIZE,
- EXPP_MOD_USE_OB_TRANSFORM,
- EXPP_MOD_SIZE_FROM_RADIUS
-
- /* yet to be implemented */
- /* EXPP_MOD_HOOK_,*/
- /* , */
-};
-
-/*****************************************************************************/
-/* Python BPy_Modifier methods declarations: */
-/*****************************************************************************/
-static PyObject *Modifier_getName( BPy_Modifier * self );
-static int Modifier_setName( BPy_Modifier * self, PyObject *arg );
-static PyObject *Modifier_getType( BPy_Modifier * self );
-static PyObject *Modifier_reset( BPy_Modifier * self );
-
-static PyObject *Modifier_getData( BPy_Modifier * self, PyObject * key );
-static int Modifier_setData( BPy_Modifier * self, PyObject * key,
- PyObject * value );
-
-/*****************************************************************************/
-/* Python BPy_Modifier methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Modifier_methods[] = {
- /* name, method, flags, doc */
- {"reset", (PyCFunction)Modifier_reset, METH_NOARGS,
- "resets a hook modifier location"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Modifier attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Modifier_getseters[] = {
- {"name",
- (getter)Modifier_getName, (setter)Modifier_setName,
- "Modifier name", NULL},
- {"type",
- (getter)Modifier_getType, (setter)NULL,
- "Modifier type (read only)", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Modifier_Type Mapping Methods table: */
-/*****************************************************************************/
-static PyMappingMethods Modifier_as_mapping = {
- NULL, /* mp_length */
- ( binaryfunc ) Modifier_getData, /* mp_subscript */
- ( objobjargproc ) Modifier_setData, /* mp_ass_subscript */
-};
-
-/*****************************************************************************/
-/* Python Modifier_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *Modifier_repr( BPy_Modifier * self );
-
-/*****************************************************************************/
-/* Python Modifier_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Modifier_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Modifier", /* char *tp_name; */
- sizeof( BPy_Modifier ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) Modifier_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &Modifier_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Modifier_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Modifier_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Python BPy_Modifier methods: */
-/*****************************************************************************/
-
-/*
- * return the name of this modifier
- */
-
-static PyObject *Modifier_getName( BPy_Modifier * self )
-{
- MODIFIER_DEL_CHECK_PY(self);
- return PyString_FromString( self->md->name );
-}
-
-/*
- * set the name of this modifier
- */
-
-static int Modifier_setName( BPy_Modifier * self, PyObject * attr )
-{
- char *name = PyString_AsString( attr );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
-
- MODIFIER_DEL_CHECK_INT(self);
-
- BLI_strncpy( self->md->name, name, sizeof( self->md->name ) );
-
- return 0;
-}
-
-/*
- * return the type of this modifier
- */
-
-static PyObject *Modifier_getType( BPy_Modifier * self )
-{
- MODIFIER_DEL_CHECK_PY(self);
-
- return PyInt_FromLong( self->md->type );
-}
-
-static PyObject *subsurf_getter( BPy_Modifier * self, int type )
-{
- SubsurfModifierData *md = ( SubsurfModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TYPES:
- return PyInt_FromLong( ( long )md->subdivType );
- case EXPP_MOD_LEVELS:
- return PyInt_FromLong( ( long )md->levels );
- case EXPP_MOD_RENDLEVELS:
- return PyInt_FromLong( ( long )md->renderLevels );
- case EXPP_MOD_OPTIMAL:
- return PyBool_FromLong( ( long )
- ( md->flags & eSubsurfModifierFlag_ControlEdges ) ) ;
- case EXPP_MOD_UV:
- return PyBool_FromLong( ( long )
- ( md->flags & eSubsurfModifierFlag_SubsurfUv ) ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "key not found" );
- }
-}
-
-static int subsurf_setter( BPy_Modifier * self, int type,
- PyObject *value )
-{
- SubsurfModifierData *md = (SubsurfModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TYPES:
- return EXPP_setIValueRange( value, &md->subdivType, 0, 1, 'h' );
- case EXPP_MOD_LEVELS:
- return EXPP_setIValueClamped( value, &md->levels, 1, 6, 'h' );
- case EXPP_MOD_RENDLEVELS:
- return EXPP_setIValueClamped( value, &md->renderLevels, 1, 6, 'h' );
- case EXPP_MOD_OPTIMAL:
- return EXPP_setBitfield( value, &md->flags,
- eSubsurfModifierFlag_ControlEdges, 'h' );
- case EXPP_MOD_UV:
- return EXPP_setBitfield( value, &md->flags,
- eSubsurfModifierFlag_SubsurfUv, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *armature_getter( BPy_Modifier * self, int type )
-{
- ArmatureModifierData *md = (ArmatureModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return Object_CreatePyObject( md->object );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->defgrp_name ) ;
- case EXPP_MOD_VGROUPS:
- return EXPP_getBitfield( &md->deformflag, ARM_DEF_VGROUP, 'h' );
- case EXPP_MOD_ENVELOPES:
- return EXPP_getBitfield( &md->deformflag, ARM_DEF_ENVELOPE, 'h' );
- case EXPP_MOD_QUATERNION:
- return EXPP_getBitfield( &md->deformflag, ARM_DEF_QUATERNION, 'h' );
- case EXPP_MOD_B_BONE_REST:
- return EXPP_getBitfield( &md->deformflag, ARM_DEF_B_BONE_REST, 'h' );
- case EXPP_MOD_INVERT_VERTGROUP:
- return EXPP_getBitfield( &md->deformflag, ARM_DEF_INVERT_VGROUP, 'h' );
- case EXPP_MOD_MULTIMODIFIER:
- return EXPP_getBitfield( &md->multi, 1, 'h' );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
- return 0;
-}
-
-static int armature_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- ArmatureModifierData *md = (ArmatureModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return GenericLib_assignData(value, (void **) &md->object, 0, 0, ID_OB, OB_ARMATURE);
- case EXPP_MOD_VERTGROUP: {
- char *defgrp_name = PyString_AsString( value );
- if( !defgrp_name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
- BLI_strncpy( md->defgrp_name, defgrp_name, sizeof( md->defgrp_name ) );
- break;
- }
- case EXPP_MOD_VGROUPS:
- return EXPP_setBitfield( value, &md->deformflag, ARM_DEF_VGROUP, 'h' );
- case EXPP_MOD_ENVELOPES:
- return EXPP_setBitfield( value, &md->deformflag, ARM_DEF_ENVELOPE, 'h' );
- case EXPP_MOD_QUATERNION:
- return EXPP_setBitfield( value, &md->deformflag, ARM_DEF_QUATERNION, 'h' );
- case EXPP_MOD_B_BONE_REST:
- return EXPP_setBitfield( value, &md->deformflag, ARM_DEF_B_BONE_REST, 'h' );
- case EXPP_MOD_INVERT_VERTGROUP:
- return EXPP_setBitfield( value, &md->deformflag, ARM_DEF_INVERT_VGROUP, 'h' );
- case EXPP_MOD_MULTIMODIFIER:
- return EXPP_setBitfield( value, &md->multi, 1, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
- return 0;
-}
-
-static PyObject *lattice_getter( BPy_Modifier * self, int type )
-{
- LatticeModifierData *md = (LatticeModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return Object_CreatePyObject( md->object );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->name ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int lattice_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- LatticeModifierData *md = (LatticeModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return GenericLib_assignData(value, (void **) &md->object, (void **) &self->object, 0, ID_OB, OB_LATTICE);
- case EXPP_MOD_VERTGROUP: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
- BLI_strncpy( md->name, name, sizeof( md->name ) );
- break;
- }
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
- return 0;
-}
-
-static PyObject *curve_getter( BPy_Modifier * self, int type )
-{
- CurveModifierData *md = (CurveModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return Object_CreatePyObject( md->object );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->name ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int curve_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- CurveModifierData *md = (CurveModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_OBJECT:
- return GenericLib_assignData(value, (void **) &md->object, (void **) &self->object, 0, ID_OB, OB_CURVE);
- case EXPP_MOD_VERTGROUP: {
- char *name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string arg" );
- BLI_strncpy( md->name, name, sizeof( md->name ) );
- break;
- }
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
- return 0;
-}
-
-static PyObject *build_getter( BPy_Modifier * self, int type )
-{
- BuildModifierData *md = (BuildModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_START:
- return PyFloat_FromDouble( ( float )md->start );
- case EXPP_MOD_LENGTH:
- return PyFloat_FromDouble( ( float )md->length );
- case EXPP_MOD_SEED:
- return PyInt_FromLong( ( long )md->seed );
- case EXPP_MOD_RANDOMIZE:
- return PyBool_FromLong( ( long )md->randomize ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int build_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- BuildModifierData *md = (BuildModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_START:
- return EXPP_setFloatClamped( value, &md->start, 1.0, MAXFRAMEF );
- case EXPP_MOD_LENGTH:
- return EXPP_setFloatClamped( value, &md->length, 1.0, MAXFRAMEF );
- case EXPP_MOD_SEED:
- return EXPP_setIValueClamped( value, &md->seed, 1, MAXFRAME, 'i' );
- case EXPP_MOD_RANDOMIZE:
- return EXPP_setBitfield( value, &md->randomize, 1, 'i' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *mirror_getter( BPy_Modifier * self, int type )
-{
- MirrorModifierData *md = (MirrorModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_LIMIT:
- return PyFloat_FromDouble( (double)md->tolerance );
- case EXPP_MOD_FLAG:
- return PyBool_FromLong( (long)( md->flag & MOD_MIR_CLIPPING ) ) ;
- case EXPP_MOD_AXIS_X:
- return PyBool_FromLong( ( long )
- ( md->flag & MOD_MIR_AXIS_X ) ) ;
- case EXPP_MOD_AXIS_Y:
- return PyBool_FromLong( ( long )
- ( md->flag & MOD_MIR_AXIS_Y ) ) ;
- case EXPP_MOD_AXIS_Z:
- return PyBool_FromLong( ( long )
- ( md->flag & MOD_MIR_AXIS_Z ) ) ;
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int mirror_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- MirrorModifierData *md = (MirrorModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_LIMIT:
- return EXPP_setFloatClamped( value, &md->tolerance, 0.0, 1.0 );
- case EXPP_MOD_FLAG:
- return EXPP_setBitfield( value, &md->flag, MOD_MIR_CLIPPING, 'i' );
- case EXPP_MOD_AXIS_X:
- return EXPP_setBitfield( value, &md->flag, MOD_MIR_AXIS_X, 'h' );
- case EXPP_MOD_AXIS_Y:
- return EXPP_setBitfield( value, &md->flag, MOD_MIR_AXIS_Y, 'h' );
- case EXPP_MOD_AXIS_Z:
- return EXPP_setBitfield( value, &md->flag, MOD_MIR_AXIS_Z, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *decimate_getter( BPy_Modifier * self, int type )
-{
- DecimateModifierData *md = (DecimateModifierData *)(self->md);
-
- if( type == EXPP_MOD_RATIO )
- return PyFloat_FromDouble( (double)md->percent );
- else if( type == EXPP_MOD_COUNT )
- return PyInt_FromLong( (long)md->faceCount );
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
-}
-
-static int decimate_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- DecimateModifierData *md = (DecimateModifierData *)(self->md);
-
- if( type == EXPP_MOD_RATIO )
- return EXPP_setFloatClamped( value, &md->percent, 0.0, 1.0 );
- else if( type == EXPP_MOD_COUNT )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "value is read-only" );
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
-}
-
-static PyObject *smooth_getter( BPy_Modifier * self, int type )
-{
- SmoothModifierData *md = (SmoothModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_FACTOR:
- return PyFloat_FromDouble( (double)md->fac );
- case EXPP_MOD_REPEAT:
- return PyInt_FromLong( (long)md->repeat );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->defgrp_name ) ;
- case EXPP_MOD_ENABLE_X:
- return EXPP_getBitfield( &md->flag, MOD_SMOOTH_X, 'h' );
- case EXPP_MOD_ENABLE_Y:
- return EXPP_getBitfield( &md->flag, MOD_SMOOTH_Y, 'h' );
- case EXPP_MOD_ENABLE_Z:
- return EXPP_getBitfield( &md->flag, MOD_SMOOTH_Z, 'h' );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int smooth_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- SmoothModifierData *md = (SmoothModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_FACTOR:
- return EXPP_setFloatClamped( value, &md->fac, -10.0, 10.0 );
- case EXPP_MOD_REPEAT:
- return EXPP_setIValueRange( value, &md->repeat, 0, 30, 'h' );
- case EXPP_MOD_VERTGROUP: {
- char *name = PyString_AsString( value );
- if( !name ) return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
- BLI_strncpy( md->defgrp_name, name, sizeof( md->defgrp_name ) );
- return 0;
- }
- case EXPP_MOD_ENABLE_X:
- return EXPP_setBitfield( value, &md->flag, MOD_SMOOTH_X, 'h' );
- case EXPP_MOD_ENABLE_Y:
- return EXPP_setBitfield( value, &md->flag, MOD_SMOOTH_Y, 'h' );
- case EXPP_MOD_ENABLE_Z:
- return EXPP_setBitfield( value, &md->flag, MOD_SMOOTH_Z, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *cast_getter( BPy_Modifier * self, int type )
-{
- CastModifierData *md = (CastModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TYPES:
- return PyInt_FromLong( (long)md->type );
- case EXPP_MOD_FACTOR:
- return PyFloat_FromDouble( (double)md->fac );
- case EXPP_MOD_RADIUS:
- return PyFloat_FromDouble( (double)md->radius );
- case EXPP_MOD_SIZE:
- return PyFloat_FromDouble( (double)md->size );
- case EXPP_MOD_OBJECT:
- return Object_CreatePyObject( md->object );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->defgrp_name ) ;
- case EXPP_MOD_ENABLE_X:
- return EXPP_getBitfield( &md->flag, MOD_CAST_X, 'h' );
- case EXPP_MOD_ENABLE_Y:
- return EXPP_getBitfield( &md->flag, MOD_CAST_Y, 'h' );
- case EXPP_MOD_ENABLE_Z:
- return EXPP_getBitfield( &md->flag, MOD_CAST_Z, 'h' );
- case EXPP_MOD_USE_OB_TRANSFORM:
- return EXPP_getBitfield( &md->flag, MOD_CAST_USE_OB_TRANSFORM, 'h' );
- case EXPP_MOD_SIZE_FROM_RADIUS:
- return EXPP_getBitfield( &md->flag, MOD_CAST_SIZE_FROM_RADIUS, 'h' );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int cast_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- CastModifierData *md = (CastModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TYPES:
- return EXPP_setIValueRange( value, &md->type, 0, MOD_CAST_TYPE_CUBOID, 'h' );
- case EXPP_MOD_FACTOR:
- return EXPP_setFloatClamped( value, &md->fac, -10.0, 10.0 );
- case EXPP_MOD_RADIUS:
- return EXPP_setFloatClamped( value, &md->radius, 0.0, 100.0 );
- case EXPP_MOD_SIZE:
- return EXPP_setFloatClamped( value, &md->size, 0.0, 100.0 );
- case EXPP_MOD_OBJECT: {
- Object *ob_new=NULL;
- if (value == Py_None) {
- md->object = NULL;
- } else if (BPy_Object_Check( value )) {
- ob_new = ((( BPy_Object * )value)->object);
- md->object = ob_new;
- } else {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Expected an Object or None value" );
- }
- return 0;
- }
- case EXPP_MOD_VERTGROUP: {
- char *name = PyString_AsString( value );
- if( !name ) return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
- BLI_strncpy( md->defgrp_name, name, sizeof( md->defgrp_name ) );
- return 0;
- }
- case EXPP_MOD_ENABLE_X:
- return EXPP_setBitfield( value, &md->flag, MOD_CAST_X, 'h' );
- case EXPP_MOD_ENABLE_Y:
- return EXPP_setBitfield( value, &md->flag, MOD_CAST_Y, 'h' );
- case EXPP_MOD_ENABLE_Z:
- return EXPP_setBitfield( value, &md->flag, MOD_CAST_Z, 'h' );
- case EXPP_MOD_USE_OB_TRANSFORM:
- return EXPP_setBitfield( value, &md->flag, MOD_CAST_USE_OB_TRANSFORM, 'h' );
- case EXPP_MOD_SIZE_FROM_RADIUS:
- return EXPP_setBitfield( value, &md->flag, MOD_CAST_SIZE_FROM_RADIUS, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *wave_getter( BPy_Modifier * self, int type )
-{
- WaveModifierData *md = (WaveModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_STARTX:
- return PyFloat_FromDouble( (double)md->startx );
- case EXPP_MOD_STARTY:
- return PyFloat_FromDouble( (double)md->starty );
- case EXPP_MOD_HEIGHT:
- return PyFloat_FromDouble( (double)md->height );
- case EXPP_MOD_WIDTH:
- return PyFloat_FromDouble( (double)md->width );
- case EXPP_MOD_NARROW:
- return PyFloat_FromDouble( (double)md->narrow );
- case EXPP_MOD_SPEED:
- return PyFloat_FromDouble( (double)md->speed );
- case EXPP_MOD_DAMP:
- return PyFloat_FromDouble( (double)md->damp );
- case EXPP_MOD_LIFETIME:
- return PyFloat_FromDouble( (double)md->lifetime );
- case EXPP_MOD_TIMEOFFS:
- return PyFloat_FromDouble( (double)md->timeoffs );
- case EXPP_MOD_FLAG:
- return PyInt_FromLong( (long)md->flag );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int wave_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- WaveModifierData *md = (WaveModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_STARTX:
- return EXPP_setFloatClamped( value, &md->startx, -100.0, 100.0 );
- case EXPP_MOD_STARTY:
- return EXPP_setFloatClamped( value, &md->starty, -100.0, 100.0 );
- case EXPP_MOD_HEIGHT:
- return EXPP_setFloatClamped( value, &md->height, -2.0, 2.0 );
- case EXPP_MOD_WIDTH:
- return EXPP_setFloatClamped( value, &md->width, 0.0, 5.0 );
- case EXPP_MOD_NARROW:
- return EXPP_setFloatClamped( value, &md->width, 0.0, 5.0 );
- case EXPP_MOD_SPEED:
- return EXPP_setFloatClamped( value, &md->speed, -2.0, 2.0 );
- case EXPP_MOD_DAMP:
- return EXPP_setFloatClamped( value, &md->damp, -MAXFRAMEF, MAXFRAMEF );
- case EXPP_MOD_LIFETIME:
- return EXPP_setFloatClamped( value, &md->lifetime, -MAXFRAMEF, MAXFRAMEF );
- case EXPP_MOD_TIMEOFFS:
- return EXPP_setFloatClamped( value, &md->timeoffs, -MAXFRAMEF, MAXFRAMEF );
- case EXPP_MOD_FLAG:
- return EXPP_setIValueRange( value, &md->flag, 0,
- MOD_WAVE_X | MOD_WAVE_Y | MOD_WAVE_CYCL, 'h' );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *array_getter( BPy_Modifier * self, int type )
-{
- ArrayModifierData *md = (ArrayModifierData *)(self->md);
-
- if( type == EXPP_MOD_OBJECT_OFFSET )
- return Object_CreatePyObject( md->offset_ob );
- else if( type == EXPP_MOD_OBJECT_CURVE )
- return Object_CreatePyObject( md->curve_ob );
- else if( type == EXPP_MOD_COUNT )
- return PyInt_FromLong( (long)md->count );
- else if( type == EXPP_MOD_LENGTH )
- return PyFloat_FromDouble( md->length );
- else if( type == EXPP_MOD_MERGE_DIST )
- return PyFloat_FromDouble( md->merge_dist );
- else if( type == EXPP_MOD_OFFSET_VEC)
- return newVectorObject( md->offset, 3, Py_NEW );
- else if( type == EXPP_MOD_SCALE_VEC)
- return newVectorObject( md->scale, 3, Py_NEW );
-
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
-}
-
-static int array_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- ArrayModifierData *md = (ArrayModifierData *)(self->md);
- switch( type ) {
- case EXPP_MOD_OBJECT_OFFSET:
- return GenericLib_assignData(value, (void **) &md->offset_ob, (void **) &self->object, 0, ID_OB, 0);
- case EXPP_MOD_OBJECT_CURVE:
- return GenericLib_assignData(value, (void **) &md->curve_ob, 0, 0, ID_OB, OB_CURVE);
- case EXPP_MOD_COUNT:
- return EXPP_setIValueClamped( value, &md->count, 1, 1000, 'i' );
- case EXPP_MOD_LENGTH:
- return EXPP_setFloatClamped( value, &md->length, 0.0, 1000.0 );
- case EXPP_MOD_MERGE_DIST:
- return EXPP_setFloatClamped( value, &md->merge_dist, 0.0, 1000.0 );
- case EXPP_MOD_OFFSET_VEC:
- return EXPP_setVec3Clamped( value, md->offset, -10000.0, 10000.0 );
- case EXPP_MOD_SCALE_VEC:
- return EXPP_setVec3Clamped( value, md->scale, -10000.0, 10000.0 );
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *boolean_getter( BPy_Modifier * self, int type )
-{
- BooleanModifierData *md = (BooleanModifierData *)(self->md);
-
- if( type == EXPP_MOD_OBJECT )
- return Object_CreatePyObject( md->object );
- else if( type == EXPP_MOD_OPERATION )
- return PyInt_FromLong( ( long )md->operation ) ;
-
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
-}
-
-static int boolean_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- BooleanModifierData *md = (BooleanModifierData *)(self->md);
-
- if( type == EXPP_MOD_OBJECT )
- return GenericLib_assignData(value, (void **) &md->object, (void **) &self->object, 0, ID_OB, OB_MESH);
- else if( type == EXPP_MOD_OPERATION )
- return EXPP_setIValueRange( value, &md->operation,
- eBooleanModifierOp_Intersect, eBooleanModifierOp_Difference,
- 'h' );
-
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
-}
-
-
-static PyObject *edgesplit_getter( BPy_Modifier * self, int type )
-{
- EdgeSplitModifierData *md = (EdgeSplitModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_EDGESPLIT_ANGLE:
- return PyFloat_FromDouble( (double)md->split_angle );
- case EXPP_MOD_EDGESPLIT_FROM_ANGLE:
- return PyBool_FromLong( ( long )
- ( md->flags & MOD_EDGESPLIT_FROMANGLE ) ) ;
- case EXPP_MOD_EDGESPLIT_FROM_SHARP:
- return PyBool_FromLong( ( long )
- ( md->flags & MOD_EDGESPLIT_FROMFLAG ) ) ;
-
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int edgesplit_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- EdgeSplitModifierData *md = (EdgeSplitModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_EDGESPLIT_ANGLE:
- return EXPP_setFloatClamped( value, &md->split_angle, 0.0, 180.0 );
- case EXPP_MOD_EDGESPLIT_FROM_ANGLE:
- return EXPP_setBitfield( value, &md->flags,
- MOD_EDGESPLIT_FROMANGLE, 'h' );
- case EXPP_MOD_EDGESPLIT_FROM_SHARP:
- return EXPP_setBitfield( value, &md->flags,
- MOD_EDGESPLIT_FROMFLAG, 'h' );
-
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-static PyObject *displace_getter( BPy_Modifier * self, int type )
-{
- DisplaceModifierData *md = (DisplaceModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TEXTURE:
- if (md->texture) Texture_CreatePyObject( md->texture );
- else Py_RETURN_NONE;
- case EXPP_MOD_STRENGTH:
- return PyFloat_FromDouble( (double)md->strength );
- case EXPP_MOD_DIRECTION:
- PyInt_FromLong( md->direction );
- case EXPP_MOD_VERTGROUP:
- return PyString_FromString( md->defgrp_name ) ;
- case EXPP_MOD_MID_LEVEL:
- return PyFloat_FromDouble( (double)md->midlevel );
- case EXPP_MOD_MAPPING:
- PyInt_FromLong( md->texmapping );
- case EXPP_MOD_OBJECT:
- return Object_CreatePyObject( md->map_object );
- case EXPP_MOD_UVLAYER:
- return PyString_FromString( md->uvlayer_name );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int displace_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- DisplaceModifierData *md = (DisplaceModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TEXTURE:
- return GenericLib_assignData(value, (void **) &md->texture, 0, 1, ID_TE, 0);
- case EXPP_MOD_STRENGTH:
- return EXPP_setFloatClamped( value, &md->strength, -1000.0, 1000.0 );
-
- case EXPP_MOD_DIRECTION:
- return EXPP_setIValueClamped( value, &md->direction,
- MOD_DISP_DIR_X, MOD_DISP_DIR_RGB_XYZ, 'i' );
-
- case EXPP_MOD_VERTGROUP: {
- char *name = PyString_AsString( value );
- if( !name ) return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
- BLI_strncpy( md->defgrp_name, name, sizeof( md->defgrp_name ) );
- return 0;
- }
- case EXPP_MOD_MID_LEVEL:
- return EXPP_setFloatClamped( value, &md->midlevel, 0.0, 1.0 );
-
- case EXPP_MOD_MAPPING:
- return EXPP_setIValueClamped( value, &md->texmapping,
- MOD_DISP_MAP_LOCAL, MOD_DISP_MAP_UV, 'i' );
-
- case EXPP_MOD_OBJECT: {
- Object *ob_new=NULL;
- if (value == Py_None) {
- md->map_object = NULL;
- } else if (BPy_Object_Check( value )) {
- ob_new = ((( BPy_Object * )value)->object);
- md->map_object = ob_new;
- } else {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Expected an Object or None value" );
- }
- return 0;
- }
-
- case EXPP_MOD_UVLAYER: {
- char *name = PyString_AsString( value );
- if( !name ) return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
- BLI_strncpy( md->uvlayer_name, name, sizeof( md->uvlayer_name ) );
- return 0;
- }
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-}
-
-
-/* static PyObject *uvproject_getter( BPy_Modifier * self, int type )
-{
- DisplaceModifierData *md = (DisplaceModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_MID_LEVEL:
- return PyFloat_FromDouble( (double)md->midlevel );
- default:
- return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
- }
-}
-
-static int uvproject_setter( BPy_Modifier *self, int type, PyObject *value )
-{
- DisplaceModifierData *md = (DisplaceModifierData *)(self->md);
-
- switch( type ) {
- case EXPP_MOD_TEXTURE:
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
- }
-} */
-
-
-/*
- * get data from a modifier
- */
-
-static PyObject *Modifier_getData( BPy_Modifier * self, PyObject * key )
-{
- int setting;
-
- if( !PyInt_Check( key ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int arg as stored in Blender.Modifier.Settings" );
-
- MODIFIER_DEL_CHECK_PY(self);
-
- setting = PyInt_AsLong( key );
- switch( setting ) {
- case EXPP_MOD_RENDER:
- return EXPP_getBitfield( &self->md->mode, eModifierMode_Render, 'h' );
- case EXPP_MOD_REALTIME:
- return EXPP_getBitfield( &self->md->mode, eModifierMode_Realtime, 'h' );
- case EXPP_MOD_EDITMODE:
- return EXPP_getBitfield( &self->md->mode, eModifierMode_Editmode, 'h' );
- case EXPP_MOD_ONCAGE:
- return EXPP_getBitfield( &self->md->mode, eModifierMode_OnCage, 'h' );
- default:
- switch( self->md->type ) {
- case eModifierType_Subsurf:
- return subsurf_getter( self, setting );
- case eModifierType_Armature:
- return armature_getter( self, setting );
- case eModifierType_Lattice:
- return lattice_getter( self, setting );
- case eModifierType_Curve:
- return curve_getter( self, setting );
- case eModifierType_Build:
- return build_getter( self, setting );
- case eModifierType_Mirror:
- return mirror_getter( self, setting );
- case eModifierType_Decimate:
- return decimate_getter( self, setting );
- case eModifierType_Smooth:
- return smooth_getter( self, setting );
- case eModifierType_Cast:
- return cast_getter( self, setting );
- case eModifierType_Wave:
- return wave_getter( self, setting );
- case eModifierType_Boolean:
- return boolean_getter( self, setting );
- case eModifierType_Array:
- return array_getter( self, setting );
- case eModifierType_EdgeSplit:
- return edgesplit_getter( self, setting );
- case eModifierType_Displace:
- return displace_getter( self, setting );
- /*case eModifierType_UVProject:
- return uvproject_getter( self, setting );*/
- case eModifierType_Hook:
- case eModifierType_Softbody:
- case eModifierType_None:
- Py_RETURN_NONE;
- }
- }
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "unknown key or modifier type" );
-}
-
-static int Modifier_setData( BPy_Modifier * self, PyObject * key,
- PyObject * arg )
-{
- int key_int;
-
- if( !PyNumber_Check( key ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int arg as stored in Blender.Modifier.Settings" );
-
- MODIFIER_DEL_CHECK_INT(self);
-
- key_int = PyInt_AsLong( key );
-
- /* Chach for standard modifier settings */
- switch( key_int ) {
- case EXPP_MOD_RENDER:
- return EXPP_setBitfield( arg, &self->md->mode,
- eModifierMode_Render, 'h' );
- case EXPP_MOD_REALTIME:
- return EXPP_setBitfield( arg, &self->md->mode,
- eModifierMode_Realtime, 'h' );
- case EXPP_MOD_EDITMODE:
- return EXPP_setBitfield( arg, &self->md->mode,
- eModifierMode_Editmode, 'h' );
- case EXPP_MOD_ONCAGE:
- return EXPP_setBitfield( arg, &self->md->mode,
- eModifierMode_OnCage, 'h' );
- }
-
- switch( self->md->type ) {
- case eModifierType_Subsurf:
- return subsurf_setter( self, key_int, arg );
- case eModifierType_Armature:
- return armature_setter( self, key_int, arg );
- case eModifierType_Lattice:
- return lattice_setter( self, key_int, arg );
- case eModifierType_Curve:
- return curve_setter( self, key_int, arg );
- case eModifierType_Build:
- return build_setter( self, key_int, arg );
- case eModifierType_Mirror:
- return mirror_setter( self, key_int, arg );
- case eModifierType_Array:
- return array_setter( self, key_int, arg );
- case eModifierType_Decimate:
- return decimate_setter( self, key_int, arg );
- case eModifierType_Smooth:
- return smooth_setter( self, key_int, arg );
- case eModifierType_Cast:
- return cast_setter( self, key_int, arg );
- case eModifierType_Wave:
- return wave_setter( self, key_int, arg );
- case eModifierType_Boolean:
- return boolean_setter( self, key_int, arg );
- case eModifierType_EdgeSplit:
- return edgesplit_setter( self, key_int, arg );
- case eModifierType_Displace:
- return displace_setter( self, key_int, arg );
- /*case eModifierType_UVProject:
- return uvproject_setter( self, key_int, arg );*/
- case eModifierType_Hook:
- case eModifierType_Softbody:
- case eModifierType_None:
- return 0;
- }
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "unsupported modifier setting" );
-}
-
-
-static PyObject *Modifier_reset( BPy_Modifier * self )
-{
- Object *ob = self->object;
- ModifierData *md = self->md;
- HookModifierData *hmd = (HookModifierData*) md;
-
- MODIFIER_DEL_CHECK_PY(self);
-
- if (md->type != eModifierType_Hook)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "can only reset hooks" );
-
- if (hmd->object) {
- Mat4Invert(hmd->object->imat, hmd->object->obmat);
- Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
- }
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Modifier_repr */
-/* Description: This is a callback function for the BPy_Modifier type. It */
-/* builds a meaningful string to represent modifier objects. */
-/*****************************************************************************/
-static PyObject *Modifier_repr( BPy_Modifier * self )
-{
- ModifierTypeInfo *mti;
- if (self->md==NULL)
- return PyString_FromString( "[Modifier - Removed");
-
- mti= modifierType_getInfo(self->md->type);
- return PyString_FromFormat( "[Modifier \"%s\", Type \"%s\"]", self->md->name, mti->name );
-}
-
-/* Three Python Modifier_Type helper functions needed by the Object module: */
-
-/*****************************************************************************/
-/* Function: Modifier_CreatePyObject */
-/* Description: This function will create a new BPy_Modifier from an */
-/* existing Blender modifier structure. */
-/*****************************************************************************/
-PyObject *Modifier_CreatePyObject( Object *ob, ModifierData * md )
-{
- BPy_Modifier *pymod;
- pymod = ( BPy_Modifier * ) PyObject_NEW( BPy_Modifier, &Modifier_Type );
- if( !pymod )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Modifier object" );
- pymod->md = md;
- pymod->object = ob;
- return ( PyObject * ) pymod;
-}
-
-/*****************************************************************************/
-/* Function: Modifier_FromPyObject */
-/* Description: This function returns the Blender modifier from the given */
-/* PyObject. */
-/*****************************************************************************/
-ModifierData *Modifier_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Modifier * ) pyobj )->md;
-}
-
-/*****************************************************************************/
-/* Modifier Sequence wrapper */
-/*****************************************************************************/
-
-/*
- * Initialize the interator
- */
-
-static PyObject *ModSeq_getIter( BPy_ModSeq * self )
-{
- if (!self->iter) {
- self->iter = (ModifierData *)self->object->modifiers.first;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return ModSeq_CreatePyObject(self->object, (ModifierData *)self->object->modifiers.first);
- }
-}
-
-/*
- * Get the next Modifier
- */
-
-static PyObject *ModSeq_nextIter( BPy_ModSeq * self )
-{
- ModifierData *iter = self->iter;
- if( iter ) {
- self->iter = iter->next;
- return Modifier_CreatePyObject( self->object, iter );
- }
-
- self->iter= NULL; /* mark as not iterating */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/* return the number of modifiers */
-
-static int ModSeq_length( BPy_ModSeq * self )
-{
- return BLI_countlist( &self->object->modifiers );
-}
-
-/* return a modifier */
-
-static PyObject *ModSeq_item( BPy_ModSeq * self, int i )
-{
- ModifierData *md = NULL;
-
- /* if index is negative, start counting from the end of the list */
- if( i < 0 )
- i += ModSeq_length( self );
-
- /* skip through the list until we get the modifier or end of list */
-
- for( md = self->object->modifiers.first; i && md; --i ) md = md->next;
-
- if( md )
- return Modifier_CreatePyObject( self->object, md );
- else
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-}
-
-/*****************************************************************************/
-/* Python BPy_ModSeq sequence table: */
-/*****************************************************************************/
-static PySequenceMethods ModSeq_as_sequence = {
- ( inquiry ) ModSeq_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) ModSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- ( binaryfunc ) 0, /* sq_inplace_concat */
- ( intargfunc ) 0, /* sq_inplace_repeat */
-};
-
-/*
- * helper function to check for a valid modifier argument
- */
-
-static ModifierData *locate_modifier( BPy_ModSeq *self, BPy_Modifier * value )
-{
- ModifierData *md;
-
- /* check that argument is a modifier */
- if( !BPy_Modifier_Check(value) )
- return (ModifierData *)EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an modifier as an argument" );
-
- /* check whether modifier has been removed */
- if( !value->md )
- return (ModifierData *)EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This modifier has been removed!" );
-
- /* find the modifier in the object's list */
- for( md = self->object->modifiers.first; md; md = md->next )
- if( md == value->md )
- return md;
-
- /* return exception if we can't find the modifier */
- return (ModifierData *)EXPP_ReturnPyObjError( PyExc_AttributeError,
- "This modifier is not in the object's stack" );
-}
-
-/* create a new modifier at the end of the list */
-
-static PyObject *ModSeq_append( BPy_ModSeq *self, PyObject *value )
-{
- int type = PyInt_AsLong(value);
-
- /* type 0 is eModifierType_None, should we be able to add one of these? */
- if( type <= 0 || type >= NUM_MODIFIER_TYPES )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Not an int or argument out of range, expected an int from Blender.Modifier.Type" );
-
- BLI_addtail( &self->object->modifiers, modifier_new( type ) );
- return Modifier_CreatePyObject( self->object, self->object->modifiers.last );
-}
-
-/* remove an existing modifier */
-
-static PyObject *ModSeq_remove( BPy_ModSeq *self, BPy_Modifier *value )
-{
- ModifierData *md = locate_modifier( self, value );
-
- /* if we can't locate the modifier, return (exception already set) */
- if( !md )
- return (PyObject *)NULL;
-
- /* do the actual removal */
- BLI_remlink( &self->object->modifiers, md );
- modifier_free( md );
-
- /* erase the link to the modifier */
- value->md = NULL;
-
- Py_RETURN_NONE;
-}
-
-/* move the modifier up in the stack */
-
-static PyObject *ModSeq_moveUp( BPy_ModSeq * self, BPy_Modifier * value )
-{
- ModifierData *md = locate_modifier( self, value );
-
- /* if we can't locate the modifier, return (exception already set) */
- if( !md )
- return (PyObject *)NULL;
-
- if( mod_moveUp( self->object, md ) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot move above a modifier requiring original data" );
-
- Py_RETURN_NONE;
-}
-
-/* move the modifier down in the stack */
-
-static PyObject *ModSeq_moveDown( BPy_ModSeq * self, BPy_Modifier *value )
-{
- ModifierData *md = locate_modifier( self, value );
-
- /* if we can't locate the modifier, return (exception already set) */
- if( !md )
- return (PyObject *)NULL;
-
- if( mod_moveDown( self->object, md ) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot move beyond a non-deforming modifier" );
-
- Py_RETURN_NONE;
-}
-
-
-/* quick hack for ZanQdo: add new hook modifier for selected verts */
-static PyObject *ModSeq_ZanQdoHack(BPy_ModSeq *self)
-{
- /* this should add the hook (assumes that modifier stack is on same ob!) */
- if ((self) && (G.obedit) && (self->object==G.obedit)) {
- add_hook(1);
- }
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python BPy_ModSeq methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_ModSeq_methods[] = {
- /* name, method, flags, doc */
- {"append", ( PyCFunction ) ModSeq_append, METH_O,
- "(type) - add a new modifier, where type is the type of modifier"},
- {"remove", ( PyCFunction ) ModSeq_remove, METH_O,
- "(modifier) - remove an existing modifier, where modifier is a modifier from this object."},
- {"moveUp", ( PyCFunction ) ModSeq_moveUp, METH_O,
- "(modifier) - Move a modifier up in stack"},
- {"moveDown", ( PyCFunction ) ModSeq_moveDown, METH_O,
- "(modifier) - Move a modifier down in stack"},
- {"ZanQdoHack", (PyCFunction)ModSeq_ZanQdoHack, METH_NOARGS,
- "while in editmode, adds a hook for the selected verts (adds new modifier, and deselects object)"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python ModSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject ModSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Modifiers", /* char *tp_name; */
- sizeof( BPy_ModSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &ModSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc )ModSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc )ModSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_ModSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: ModSeq_CreatePyObject */
-/* Description: This function will create a new BPy_ModSeq from an */
-/* existing ListBase structure. */
-/*****************************************************************************/
-PyObject *ModSeq_CreatePyObject( Object *ob, ModifierData *iter )
-{
- BPy_ModSeq *pymod;
- pymod = ( BPy_ModSeq * ) PyObject_NEW( BPy_ModSeq, &ModSeq_Type );
- if( !pymod )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_ModSeq object" );
- pymod->object = ob;
- pymod->iter = iter;
- return ( PyObject * ) pymod;
-}
-
-static PyObject *M_Modifier_TypeDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
-
- PyConstant_Insert( d, "SUBSURF",
- PyInt_FromLong( eModifierType_Subsurf ) );
- PyConstant_Insert( d, "ARMATURE",
- PyInt_FromLong( eModifierType_Armature ) );
- PyConstant_Insert( d, "LATTICE",
- PyInt_FromLong( eModifierType_Lattice ) );
- PyConstant_Insert( d, "CURVE",
- PyInt_FromLong( eModifierType_Curve ) );
- PyConstant_Insert( d, "BUILD",
- PyInt_FromLong( eModifierType_Build ) );
- PyConstant_Insert( d, "MIRROR",
- PyInt_FromLong( eModifierType_Mirror ) );
- PyConstant_Insert( d, "DECIMATE",
- PyInt_FromLong( eModifierType_Decimate ) );
- PyConstant_Insert( d, "WAVE",
- PyInt_FromLong( eModifierType_Wave ) );
- PyConstant_Insert( d, "BOOLEAN",
- PyInt_FromLong( eModifierType_Boolean ) );
- PyConstant_Insert( d, "ARRAY",
- PyInt_FromLong( eModifierType_Array ) );
- PyConstant_Insert( d, "EDGESPLIT",
- PyInt_FromLong( eModifierType_EdgeSplit ) );
- PyConstant_Insert( d, "SMOOTH",
- PyInt_FromLong( eModifierType_Smooth ) );
- PyConstant_Insert( d, "CAST",
- PyInt_FromLong( eModifierType_Cast ) );
- PyConstant_Insert( d, "DISPLACE",
- PyInt_FromLong( eModifierType_Displace ) );
- }
- return S;
-}
-
-
-static PyObject *M_Modifier_SettingsDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
-
-/*
-# The lines below are a python script that uses the enum variables to create
-# the lines below
-# START PYSCRIPT
-st='''
- EXPP_MOD_RENDER = 0,
- EXPP_MOD_REALTIME,
- EXPP_MOD_EDITMODE,
- etc.. copy from above
-'''
-
-base= '''
- PyConstant_Insert( d, "%s",
- PyInt_FromLong( EXPP_MOD_%s ) );
-'''
-for var in st.replace(',','').split('\n'):
-
- var= var.split()
- if not var: continue
- var= var[0]
- if (not var) or var.startswith('/'): continue
-
- var='_'.join(var.split('_')[2:])
- print base % (var, var),
-# END PYSCRIPT
-*/
-
- /*Auto generated from the above script*/
- PyConstant_Insert( d, "RENDER",
- PyInt_FromLong( EXPP_MOD_RENDER ) );
- PyConstant_Insert( d, "REALTIME",
- PyInt_FromLong( EXPP_MOD_REALTIME ) );
- PyConstant_Insert( d, "EDITMODE",
- PyInt_FromLong( EXPP_MOD_EDITMODE ) );
- PyConstant_Insert( d, "ONCAGE",
- PyInt_FromLong( EXPP_MOD_ONCAGE ) );
- PyConstant_Insert( d, "OBJECT",
- PyInt_FromLong( EXPP_MOD_OBJECT ) );
- PyConstant_Insert( d, "VERTGROUP",
- PyInt_FromLong( EXPP_MOD_VERTGROUP ) );
- PyConstant_Insert( d, "LIMIT",
- PyInt_FromLong( EXPP_MOD_LIMIT ) );
- PyConstant_Insert( d, "FLAG",
- PyInt_FromLong( EXPP_MOD_FLAG ) );
- PyConstant_Insert( d, "COUNT",
- PyInt_FromLong( EXPP_MOD_COUNT ) );
- PyConstant_Insert( d, "LENGTH",
- PyInt_FromLong( EXPP_MOD_LENGTH ) );
- PyConstant_Insert( d, "FACTOR",
- PyInt_FromLong( EXPP_MOD_FACTOR ) );
- PyConstant_Insert( d, "ENABLE_X",
- PyInt_FromLong( EXPP_MOD_ENABLE_X ) );
- PyConstant_Insert( d, "ENABLE_Y",
- PyInt_FromLong( EXPP_MOD_ENABLE_Y ) );
- PyConstant_Insert( d, "ENABLE_Z",
- PyInt_FromLong( EXPP_MOD_ENABLE_Z ) );
- PyConstant_Insert( d, "TYPES",
- PyInt_FromLong( EXPP_MOD_TYPES ) );
- PyConstant_Insert( d, "LEVELS",
- PyInt_FromLong( EXPP_MOD_LEVELS ) );
- PyConstant_Insert( d, "RENDLEVELS",
- PyInt_FromLong( EXPP_MOD_RENDLEVELS ) );
- PyConstant_Insert( d, "OPTIMAL",
- PyInt_FromLong( EXPP_MOD_OPTIMAL ) );
- PyConstant_Insert( d, "UV",
- PyInt_FromLong( EXPP_MOD_UV ) );
- PyConstant_Insert( d, "VGROUPS",
- PyInt_FromLong( EXPP_MOD_VGROUPS ) );
- PyConstant_Insert( d, "ENVELOPES",
- PyInt_FromLong( EXPP_MOD_ENVELOPES ) );
- PyConstant_Insert( d, "QUATERNION",
- PyInt_FromLong( EXPP_MOD_QUATERNION ) );
- PyConstant_Insert( d, "B_BONE_REST",
- PyInt_FromLong( EXPP_MOD_B_BONE_REST ) );
- PyConstant_Insert( d, "INVERT_VERTGROUP",
- PyInt_FromLong( EXPP_MOD_INVERT_VERTGROUP ) );
- PyConstant_Insert( d, "MULTIMODIFIER",
- PyInt_FromLong( EXPP_MOD_MULTIMODIFIER ) );
- PyConstant_Insert( d, "OBJECT_OFFSET",
- PyInt_FromLong( EXPP_MOD_OBJECT_OFFSET ) );
- PyConstant_Insert( d, "OBJECT_CURVE",
- PyInt_FromLong( EXPP_MOD_OBJECT_CURVE ) );
- PyConstant_Insert( d, "OFFSET_VEC",
- PyInt_FromLong( EXPP_MOD_OFFSET_VEC ) );
- PyConstant_Insert( d, "SCALE_VEC",
- PyInt_FromLong( EXPP_MOD_SCALE_VEC ) );
- PyConstant_Insert( d, "MERGE_DIST",
- PyInt_FromLong( EXPP_MOD_MERGE_DIST ) );
- PyConstant_Insert( d, "START",
- PyInt_FromLong( EXPP_MOD_START ) );
- PyConstant_Insert( d, "SEED",
- PyInt_FromLong( EXPP_MOD_SEED ) );
- PyConstant_Insert( d, "RANDOMIZE",
- PyInt_FromLong( EXPP_MOD_RANDOMIZE ) );
- PyConstant_Insert( d, "AXIS_X",
- PyInt_FromLong( EXPP_MOD_AXIS_X ) );
- PyConstant_Insert( d, "AXIS_Y",
- PyInt_FromLong( EXPP_MOD_AXIS_Y ) );
- PyConstant_Insert( d, "AXIS_Z",
- PyInt_FromLong( EXPP_MOD_AXIS_Z ) );
- PyConstant_Insert( d, "RATIO",
- PyInt_FromLong( EXPP_MOD_RATIO ) );
- PyConstant_Insert( d, "STARTX",
- PyInt_FromLong( EXPP_MOD_STARTX ) );
- PyConstant_Insert( d, "STARTY",
- PyInt_FromLong( EXPP_MOD_STARTY ) );
- PyConstant_Insert( d, "HEIGHT",
- PyInt_FromLong( EXPP_MOD_HEIGHT ) );
- PyConstant_Insert( d, "WIDTH",
- PyInt_FromLong( EXPP_MOD_WIDTH ) );
- PyConstant_Insert( d, "NARROW",
- PyInt_FromLong( EXPP_MOD_NARROW ) );
- PyConstant_Insert( d, "SPEED",
- PyInt_FromLong( EXPP_MOD_SPEED ) );
- PyConstant_Insert( d, "DAMP",
- PyInt_FromLong( EXPP_MOD_DAMP ) );
- PyConstant_Insert( d, "LIFETIME",
- PyInt_FromLong( EXPP_MOD_LIFETIME ) );
- PyConstant_Insert( d, "TIMEOFFS",
- PyInt_FromLong( EXPP_MOD_TIMEOFFS ) );
- PyConstant_Insert( d, "OPERATION",
- PyInt_FromLong( EXPP_MOD_OPERATION ) );
- PyConstant_Insert( d, "EDGESPLIT_ANGLE",
- PyInt_FromLong( EXPP_MOD_EDGESPLIT_ANGLE ) );
- PyConstant_Insert( d, "EDGESPLIT_FROM_ANGLE",
- PyInt_FromLong( EXPP_MOD_EDGESPLIT_FROM_ANGLE ) );
- PyConstant_Insert( d, "EDGESPLIT_FROM_SHARP",
- PyInt_FromLong( EXPP_MOD_EDGESPLIT_FROM_SHARP ) );
- PyConstant_Insert( d, "UVLAYER",
- PyInt_FromLong( EXPP_MOD_UVLAYER ) );
- PyConstant_Insert( d, "MID_LEVEL",
- PyInt_FromLong( EXPP_MOD_MID_LEVEL ) );
- PyConstant_Insert( d, "STRENGTH",
- PyInt_FromLong( EXPP_MOD_STRENGTH ) );
- PyConstant_Insert( d, "TEXTURE",
- PyInt_FromLong( EXPP_MOD_TEXTURE ) );
- PyConstant_Insert( d, "MAPPING",
- PyInt_FromLong( EXPP_MOD_MAPPING ) );
- PyConstant_Insert( d, "DIRECTION",
- PyInt_FromLong( EXPP_MOD_DIRECTION ) );
- PyConstant_Insert( d, "REPEAT",
- PyInt_FromLong( EXPP_MOD_REPEAT ) );
- PyConstant_Insert( d, "RADIUS",
- PyInt_FromLong( EXPP_MOD_RADIUS ) );
- PyConstant_Insert( d, "SIZE",
- PyInt_FromLong( EXPP_MOD_SIZE ) );
- PyConstant_Insert( d, "USE_OB_TRANSFORM",
- PyInt_FromLong( EXPP_MOD_USE_OB_TRANSFORM ) );
- PyConstant_Insert( d, "SIZE_FROM_RADIUS",
- PyInt_FromLong( EXPP_MOD_SIZE_FROM_RADIUS ) );
- /*End Auto generated code*/
- }
- return S;
-}
-
-/*****************************************************************************/
-/* Function: Modifier_Init */
-/*****************************************************************************/
-PyObject *Modifier_Init( void )
-{
- PyObject *submodule;
- PyObject *TypeDict = M_Modifier_TypeDict( );
- PyObject *SettingsDict = M_Modifier_SettingsDict( );
-
- if( PyType_Ready( &ModSeq_Type ) < 0 ||
- PyType_Ready( &Modifier_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Modifier", NULL,
- "Modifer module for accessing and creating object modifier data" );
-
- if( TypeDict ) {
- PyModule_AddObject( submodule, "Type", TypeDict ); /* deprecated */
- /* since PyModule_AddObject() steals a reference, we need to
- incref TypeDict to use it again */
- Py_INCREF( TypeDict);
- PyModule_AddObject( submodule, "Types", TypeDict );
- }
-
- if( SettingsDict )
- PyModule_AddObject( submodule, "Settings", SettingsDict );
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Modifier.h b/source/blender/python/api2_2x/Modifier.h
deleted file mode 100644
index bf5f7a7818d..00000000000
--- a/source/blender/python/api2_2x/Modifier.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_MODIFIER_H
-#define EXPP_MODIFIER_H
-
-#include <Python.h>
-#include "DNA_object_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_listBase.h"
-
-/*****************************************************************************/
-/* Python BPy_Modifier and BPy_ModSeq structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required macro */
- Object *object;
- ModifierData *iter;
-} BPy_ModSeq;
-
-typedef struct {
- PyObject_HEAD /* required macro */
- Object *object;
- /* if md this is null, the modifier has been removed and we need to raise
- an error when its data is accessed */
- ModifierData *md;
-} BPy_Modifier;
-
-extern PyTypeObject ModSeq_Type;
-extern PyTypeObject Modifier_Type;
-#define BPy_ModSeq_Check(v) ((v)->ob_type == &ModSeq_Type)
-#define BPy_Modifier_Check(v) ((v)->ob_type == &Modifier_Type)
-
-/*
- * prototypes
- */
-
-PyObject *Modifier_Init( void );
-PyObject *ModSeq_CreatePyObject( Object *obj, ModifierData *iter );
-PyObject *Modifier_CreatePyObject( Object *obj, ModifierData *md );
-ModifierData *Modifier_FromPyObject( PyObject * py_obj );
-
-#endif /* EXPP_MODIFIER_H */
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
deleted file mode 100644
index 18eef7c1a2f..00000000000
--- a/source/blender/python/api2_2x/NLA.c
+++ /dev/null
@@ -1,1592 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "NLA.h" /*This must come first*/
-
-#include "DNA_curve_types.h"
-#include "DNA_scene_types.h"
-#include "BKE_action.h"
-#include "BKE_nla.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-#include "BLI_blenlib.h"
-#include "Object.h"
-#include "Ipo.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "blendef.h"
-#include "MEM_guardedalloc.h"
-
-#define ACTSTRIP_STRIDEAXIS_X 0
-#define ACTSTRIP_STRIDEAXIS_Y 1
-#define ACTSTRIP_STRIDEAXIS_Z 2
-
-/*****************************************************************************/
-/* Python API function prototypes for the NLA module. */
-/*****************************************************************************/
-static PyObject *M_NLA_NewAction( PyObject * self, PyObject * args );
-static PyObject *M_NLA_CopyAction( PyObject * self, PyObject * args );
-static PyObject *M_NLA_GetActions( PyObject * self );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Armature.NLA.__doc__ */
-/*****************************************************************************/
-char M_NLA_doc[] =
- "The Blender NLA module -This module provides control over Armature keyframing in Blender.";
-char M_NLA_NewAction_doc[] =
- "(name) - Create new action for linking to an object.";
-char M_NLA_CopyAction_doc[] = "(name) - Copy action and return copy.";
-char M_NLA_GetActions_doc[] = "(name) - Returns a dictionary of actions.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Armature.NLA module: */
-/*****************************************************************************/
-struct PyMethodDef M_NLA_methods[] = {
- {"NewAction", ( PyCFunction ) M_NLA_NewAction, METH_VARARGS,
- M_NLA_NewAction_doc},
- {"CopyAction", ( PyCFunction ) M_NLA_CopyAction, METH_VARARGS,
- M_NLA_CopyAction_doc},
- {"GetActions", ( PyCFunction ) M_NLA_GetActions, METH_NOARGS,
- M_NLA_GetActions_doc},
- {NULL, NULL, 0, NULL}
-};
-/*****************************************************************************/
-/* Python BPy_Action methods declarations: */
-/*****************************************************************************/
-static PyObject *Action_setActive( BPy_Action * self, PyObject * args );
-static PyObject *Action_getFrameNumbers(BPy_Action *self);
-static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * value );
-static PyObject *Action_getChannelNames( BPy_Action * self );
-static PyObject *Action_renameChannel( BPy_Action * self, PyObject * args );
-static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * value );
-static PyObject *Action_removeChannel( BPy_Action * self, PyObject * value );
-static PyObject *Action_getAllChannelIpos( BPy_Action * self );
-
-/*****************************************************************************/
-/* Python BPy_Action methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Action_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - return Action name"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - rename Action"},
- {"setActive", ( PyCFunction ) Action_setActive, METH_VARARGS,
- "(str) -set this action as the active action for an object"},
- {"getFrameNumbers", (PyCFunction) Action_getFrameNumbers, METH_NOARGS,
- "() - get the frame numbers at which keys have been inserted"},
- {"getChannelIpo", ( PyCFunction ) Action_getChannelIpo, METH_O,
- "(str) -get the Ipo from a named action channel in this action"},
- {"getChannelNames", ( PyCFunction ) Action_getChannelNames, METH_NOARGS,
- "() -get the channel names for this action"},
- {"renameChannel", ( PyCFunction ) Action_renameChannel, METH_VARARGS,
- "(from, to) -rename the channel from string to string"},
- {"verifyChannel", ( PyCFunction ) Action_verifyChannel, METH_O,
- "(str) -verify the channel in this action"},
- {"removeChannel", ( PyCFunction ) Action_removeChannel, METH_O,
- "(str) -remove the channel from the action"},
- {"getAllChannelIpos", ( PyCFunction ) Action_getAllChannelIpos,
- METH_NOARGS,
- "() - Return a dict of (name:ipo)-keys containing each channel in the object's action"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python TypeAction callback function prototypes: */
-/*****************************************************************************/
-static int Action_compare( BPy_Action * a, BPy_Action * b );
-static PyObject *Action_repr( BPy_Action * bone );
-
-/*-------------------------------------------------------------------------*/
-static PyObject *M_NLA_NewAction( PyObject * self_unused, PyObject * args )
-{
- char *name_str = "DefaultAction";
- BPy_Action *py_action = NULL; /* for Action Data object wrapper in Python */
- bAction *bl_action = NULL; /* for actual Action Data we create in Blender */
-
- if( !PyArg_ParseTuple( args, "|s", &name_str ) ) {
- EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string or nothing" );
- return NULL;
- }
- /* Create new action globally */
- bl_action = alloc_libblock( &G.main->action, ID_AC, name_str );
- bl_action->id.flag |= LIB_FAKEUSER; /* no need to assign a user because alloc_libblock alredy assigns one */
-
-
- /* now create the wrapper obj in Python */
- if( bl_action )
- py_action =
- ( BPy_Action * ) PyObject_NEW( BPy_Action,
- &Action_Type );
- else {
- EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Action Data in Blender" );
- return NULL;
- }
-
- if( py_action == NULL ) {
- EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Action Data object" );
- return NULL;
- }
-
- py_action->action = bl_action; /* link Python action wrapper with Blender Action */
-
- Py_INCREF( py_action );
- return ( PyObject * ) py_action;
-}
-
-static PyObject *M_NLA_CopyAction( PyObject * self_unused, PyObject * args )
-{
- BPy_Action *py_action = NULL;
- bAction *copyAction = NULL;
-
- if( !PyArg_ParseTuple( args, "O!", &Action_Type, &py_action ) ) {
- EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected python action type" );
- return NULL;
- }
- copyAction = copy_action( py_action->action );
- return Action_CreatePyObject( copyAction );
-}
-
-static PyObject *M_NLA_GetActions( PyObject * self_unused )
-{
- PyObject *dict = PyDict_New( );
- bAction *action = NULL;
-
- for( action = G.main->action.first; action; action = action->id.next ) {
- PyObject *py_action = Action_CreatePyObject( action );
- if( py_action ) {
- /* Insert dict entry using the bone name as key */
- if( PyDict_SetItemString
- ( dict, action->id.name + 2, py_action ) != 0 ) {
- Py_DECREF( py_action );
- Py_DECREF( dict );
-
- return EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "NLA_GetActions: couldn't set dict item" );
- }
- Py_DECREF( py_action );
- } else {
- Py_DECREF( dict );
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "NLA_GetActions: could not create Action object" ) );
- }
- }
- return dict;
-}
-
-static PyObject *Action_getFrameNumbers(BPy_Action *self)
-{
- bActionChannel *achan = NULL;
- IpoCurve *icu = NULL;
- BezTriple *bezt = NULL;
- int verts;
- PyObject *py_list = NULL;
-
- py_list = PyList_New(0);
- for(achan = self->action->chanbase.first; achan; achan = achan->next){
- if (achan->ipo) {
- for (icu = achan->ipo->curve.first; icu; icu = icu->next){
- bezt= icu->bezt;
- if(bezt) {
- verts = icu->totvert;
- while(verts--) {
- PyObject *value;
- value = PyInt_FromLong((int)bezt->vec[1][0]);
- if ( PySequence_Contains(py_list, value) == 0){
- PyList_Append(py_list, value);
- }
- Py_DECREF(value);
- bezt++;
- }
- }
- }
- }
- }
- PyList_Sort(py_list);
- return EXPP_incr_ret(py_list);
-}
-
-static PyObject *Action_setActive( BPy_Action * self, PyObject * args )
-{
- BPy_Object *object;
-
- if( !self->action )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get attribute from a NULL action" );
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &object ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected python object argument" );
-
- if( object->object->type != OB_ARMATURE )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object not of type armature" );
-
- /* if object is already attached to an action, decrement user count */
- if( object->object->action )
- --object->object->action->id.us;
-
- /* set the active action to object */
- object->object->action = self->action;
- ++object->object->action->id.us;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Action_getChannelIpo( BPy_Action * self, PyObject * value )
-{
- char *chanName = PyString_AsString(value);
- bActionChannel *chan;
-
- if( !chanName )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "string expected" );
-
- chan = get_action_channel( self->action, chanName );
- if( !chan )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "no channel with that name" );
-
- if( !chan->ipo ) {
- Py_RETURN_NONE;
- }
-
- return Ipo_CreatePyObject( chan->ipo );
-}
-
-static PyObject *Action_getChannelNames( BPy_Action * self )
-{
- PyObject *list = PyList_New( BLI_countlist(&(self->action->chanbase)) );
- bActionChannel *chan = NULL;
- int index=0;
- for( chan = self->action->chanbase.first; chan; chan = chan->next ) {
- PyList_SetItem( list, index, PyString_FromString(chan->name) );
- index++;
- }
- return list;
-}
-
-static PyObject *Action_renameChannel( BPy_Action * self, PyObject * args )
-{
- char *chanFrom, *chanTo;
- bActionChannel *chan;
-
- if( !PyArg_ParseTuple( args, "ss", &chanFrom, &chanTo ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "2 strings expected" );
-
- chan = get_action_channel( self->action, chanFrom );
- if( !chan )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "no channel with that name" );
- if (strlen(chanTo) > 31)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "new name greater then 31 characters long" );
-
- if (get_action_channel( self->action, chanTo ))
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "channel target name alredy exists" );
-
- strcpy(chan->name, chanTo);
-
- Py_RETURN_NONE;
-}
-
-/*----------------------------------------------------------------------*/
-static PyObject *Action_verifyChannel( BPy_Action * self, PyObject * value )
-{
- char *chanName = PyString_AsString(value);
- bActionChannel *chan;
-
- if( !self->action )
- ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create channel for a NULL action" ) );
-
- if( !chanName )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string argument" ) );
-
- chan = verify_action_channel(self->action, chanName);
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Action_removeChannel( BPy_Action * self, PyObject * value )
-{
- char *chanName = PyString_AsString(value);
- bActionChannel *chan;
-
- if( !chanName )
- return (EXPP_ReturnPyObjError( PyExc_AttributeError,
- "string expected" ));
-
-
- chan = get_action_channel( self->action, chanName );
- if( chan == NULL ) {
- EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no channel with that name..." );
- return NULL;
- }
- /*release ipo*/
- if( chan->ipo )
- chan->ipo->id.us--;
-
- /*remove channel*/
- BLI_freelinkN( &self->action->chanbase, chan );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Action_getAllChannelIpos( BPy_Action * self )
-{
- PyObject *dict = PyDict_New( );
- bActionChannel *chan = NULL;
-
- for( chan = self->action->chanbase.first; chan; chan = chan->next ) {
- PyObject *ipo_attr;
- if( chan->ipo )
- ipo_attr = Ipo_CreatePyObject( chan->ipo );
- else {
- ipo_attr = Py_None;
- Py_INCREF( ipo_attr );
- }
- if( ipo_attr ) {
- /* Insert dict entry using the bone name as key*/
- if( PyDict_SetItemString( dict, chan->name, ipo_attr )
- != 0 ) {
- Py_DECREF( ipo_attr );
- Py_DECREF( dict );
-
- return EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "Action_getAllChannelIpos: couldn't set dict item" );
- }
- Py_DECREF( ipo_attr );
- } else {
- Py_DECREF( dict );
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Action_getAllChannelIpos: could not create Ipo object" ) );
- }
- }
- return dict;
-}
-
-/*----------------------------------------------------------------------*/
-static int Action_compare( BPy_Action * a, BPy_Action * b )
-{
- return ( a->action == b->action ) ? 0 : -1;
-}
-
-/*----------------------------------------------------------------------*/
-static PyObject *Action_repr( BPy_Action * self )
-{
- if( self->action )
- return PyString_FromFormat( "[Action \"%s\"]",
- self->action->id.name + 2 );
- else
- return PyString_FromString( "NULL" );
-}
-
-/*----------------------------------------------------------------------*/
-PyObject *Action_CreatePyObject( struct bAction * act )
-{
- BPy_Action *blen_action;
-
- if(!act) Py_RETURN_NONE;
-
- blen_action =
- ( BPy_Action * ) PyObject_NEW( BPy_Action, &Action_Type );
-
- if( !blen_action) {
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError, "failure to create object!" ) );
- }
- blen_action->action = act;
- return ( ( PyObject * ) blen_action );
-}
-
-/*----------------------------------------------------------------------*/
-struct bAction *Action_FromPyObject( PyObject * py_obj )
-{
- BPy_Action *blen_obj;
-
- blen_obj = ( BPy_Action * ) py_obj;
- return ( blen_obj->action );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Action_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python TypeAction structure definition: */
-/*****************************************************************************/
-PyTypeObject Action_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Action", /* tp_name */
- sizeof( BPy_Action ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- NULL, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Action_compare, /* tp_compare */
- ( reprfunc ) Action_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Action_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Action_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-/*****************************************************************************/
-/* ActionStrip wrapper */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Python BPy_ActionStrip attributes: */
-/*****************************************************************************/
-
-/*
- * return the action for the action strip
- */
-
-static PyObject *ActionStrip_getAction( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return Action_CreatePyObject( self->strip->act );
-}
-
-/*
- * return the start frame of the action strip
- */
-
-static PyObject *ActionStrip_getStripStart( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->start );
-}
-
-/*
- * set the start frame of the action strip
- */
-
-static int ActionStrip_setStripStart( BPy_ActionStrip * self, PyObject * value )
-{
- int retval;
-
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- retval = EXPP_setFloatClamped( value, &self->strip->start,
- -1000.0, self->strip->end-1 );
- if( !retval ) {
- float max = self->strip->end - self->strip->start;
- if( self->strip->blendin > max )
- self->strip->blendin = max;
- if( self->strip->blendout > max )
- self->strip->blendout = max;
- }
- return retval;
-}
-
-/*
- * return the ending frame of the action strip
- */
-
-static PyObject *ActionStrip_getStripEnd( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->end );
-}
-
-/*
- * set the ending frame of the action strip
- */
-
-static int ActionStrip_setStripEnd( BPy_ActionStrip * self, PyObject * value )
-{
- int retval;
-
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- retval = EXPP_setFloatClamped( value, &self->strip->end,
- self->strip->start+1, MAXFRAMEF );
- if( !retval ) {
- float max = self->strip->end - self->strip->start;
- if( self->strip->blendin > max )
- self->strip->blendin = max;
- if( self->strip->blendout > max )
- self->strip->blendout = max;
- }
- return retval;
-}
-
-/*
- * return the start frame of the action
- */
-
-static PyObject *ActionStrip_getActionStart( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->actstart );
-}
-
-/*
- * set the start frame of the action
- */
-
-static int ActionStrip_setActionStart( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->actstart,
- -1000.0, self->strip->actend-1 );
-}
-
-/*
- * return the ending frame of the action
- */
-
-static PyObject *ActionStrip_getActionEnd( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->actend );
-}
-
-/*
- * set the ending frame of the action
- */
-
-static int ActionStrip_setActionEnd( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->actend,
- self->strip->actstart+1, MAXFRAMEF );
-}
-
-/*
- * return the repeat value of the action strip
- */
-
-static PyObject *ActionStrip_getRepeat( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->repeat );
-}
-
-/*
- * set the repeat value of the action strip
- */
-
-static int ActionStrip_setRepeat( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->repeat,
- 0.001f, 1000.0f );
-}
-
-/*
- * return the blend in of the action strip
- */
-
-static PyObject *ActionStrip_getBlendIn( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->blendin );
-}
-
-/*
- * set the blend in value of the action strip
- */
-
-static int ActionStrip_setBlendIn( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->blendin,
- 0.0, self->strip->end - self->strip->start );
-}
-
-/*
- * return the blend out of the action strip
- */
-
-static PyObject *ActionStrip_getBlendOut( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( self->strip->blendout );
-}
-
-/*
- * set the blend out value of the action strip
- */
-
-static int ActionStrip_setBlendOut( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->blendout,
- 0.0, self->strip->end - self->strip->start );
-}
-
-/*
- * return the blend mode of the action strip
- */
-
-static PyObject *ActionStrip_getBlendMode( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyInt_FromLong( (long)self->strip->mode ) ;
-}
-
-/*
- * set the blend mode value of the action strip
- */
-
-static int ActionStrip_setBlendMode( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setIValueRange( value, &self->strip->mode,
- 0, ACTSTRIPMODE_ADD, 'h' );
-}
-
-/*
- * return the flag settings of the action strip
- */
-
-#define ACTIONSTRIP_MASK (ACTSTRIP_SELECT | ACTSTRIP_USESTRIDE \
- | ACTSTRIP_HOLDLASTFRAME | ACTSTRIP_ACTIVE | ACTSTRIP_LOCK_ACTION \
- | ACTSTRIP_MUTE | ACTSTRIP_CYCLIC_USEX | ACTSTRIP_CYCLIC_USEY | ACTSTRIP_CYCLIC_USEZ | ACTSTRIP_AUTO_BLENDS)
-
-static PyObject *ActionStrip_getFlag( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyInt_FromLong( (long)( self->strip->flag & ACTIONSTRIP_MASK ) ) ;
-}
-
-/*
- * set the flag settings out value of the action strip
- */
-
-static int ActionStrip_setFlag( BPy_ActionStrip * self, PyObject * arg )
-{
- PyObject *num = PyNumber_Int( arg );
- int value;
-
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
- if( !num )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
- value = PyInt_AS_LONG( num );
- Py_DECREF( num );
-
- if( ( value & ACTIONSTRIP_MASK ) != value ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%04x", ACTIONSTRIP_MASK );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- self->strip->flag = (short)value;
- return 0;
-}
-
-/*
- * return the stride axis of the action strip
- */
-
-static PyObject *ActionStrip_getStrideAxis( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyInt_FromLong( (long)self->strip->stride_axis ) ;
-}
-
-/*
- * set the stride axis of the action strip
- */
-
-static int ActionStrip_setStrideAxis( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setIValueRange( value, &self->strip->stride_axis,
- ACTSTRIP_STRIDEAXIS_X, ACTSTRIP_STRIDEAXIS_Z, 'h' );
-}
-
-/*
- * return the stride length of the action strip
- */
-
-static PyObject *ActionStrip_getStrideLength( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyFloat_FromDouble( (double)self->strip->stridelen ) ;
-}
-
-/*
- * set the stride length of the action strip
- */
-
-static int ActionStrip_setStrideLength( BPy_ActionStrip * self, PyObject * value )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return EXPP_setFloatClamped( value, &self->strip->stridelen,
- 0.0001f, 1000.0 );
-}
-
-/*
- * return the stride bone name
- */
-
-static PyObject *ActionStrip_getStrideBone( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- return PyString_FromString( self->strip->stridechannel );
-}
-
-static PyObject *ActionStrip_getGroupTarget( BPy_ActionStrip * self )
-{
- if( !self->strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- if (self->strip->object) {
- return Object_CreatePyObject( self->strip->object );
- } else {
- Py_RETURN_NONE;
- }
-}
-
-/*
- * set the stride bone name
- */
-
-static int ActionStrip_setStrideBone( BPy_ActionStrip * self, PyObject * attr )
-{
- char *name = PyString_AsString( attr );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected string arg" );
-
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- BLI_strncpy( self->strip->stridechannel, name, 32 );
-
- return 0;
-}
-
-static int ActionStrip_setGroupTarget( BPy_ActionStrip * self, PyObject * args )
-{
- if( !self->strip )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- if( (PyObject *)args == Py_None )
- self->strip->object = NULL;
- else if( BPy_Object_Check( args ) )
- self->strip->object = ((BPy_Object *)args)->object;
- else
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an object or None" );
- return 0;
-}
-
-/*****************************************************************************/
-/* Python BPy_Constraint attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_ActionStrip_getseters[] = {
- {"action",
- (getter)ActionStrip_getAction, (setter)NULL,
- "Action associated with the strip", NULL},
- {"stripStart",
- (getter)ActionStrip_getStripStart, (setter)ActionStrip_setStripStart,
- "Starting frame of the strip", NULL},
- {"stripEnd",
- (getter)ActionStrip_getStripEnd, (setter)ActionStrip_setStripEnd,
- "Ending frame of the strip", NULL},
- {"actionStart",
- (getter)ActionStrip_getActionStart, (setter)ActionStrip_setActionStart,
- "Starting frame of the action", NULL},
- {"actionEnd",
- (getter)ActionStrip_getActionEnd, (setter)ActionStrip_setActionEnd,
- "Ending frame of the action", NULL},
- {"repeat",
- (getter)ActionStrip_getRepeat, (setter)ActionStrip_setRepeat,
- "The number of times to repeat the action range", NULL},
- {"blendIn",
- (getter)ActionStrip_getBlendIn, (setter)ActionStrip_setBlendIn,
- "Number of frames of motion blending", NULL},
- {"blendOut",
- (getter)ActionStrip_getBlendOut, (setter)ActionStrip_setBlendOut,
- "Number of frames of ease-out", NULL},
- {"mode",
- (getter)ActionStrip_getBlendMode, (setter)ActionStrip_setBlendMode,
- "Setting of blending mode", NULL},
- {"flag",
- (getter)ActionStrip_getFlag, (setter)ActionStrip_setFlag,
- "Setting of blending flags", NULL},
- {"strideAxis",
- (getter)ActionStrip_getStrideAxis, (setter)ActionStrip_setStrideAxis,
- "Dominant axis for stride bone", NULL},
- {"strideLength",
- (getter)ActionStrip_getStrideLength, (setter)ActionStrip_setStrideLength,
- "Distance covered by one complete cycle of the action", NULL},
- {"strideBone",
- (getter)ActionStrip_getStrideBone, (setter)ActionStrip_setStrideBone,
- "Name of Bone used for stride", NULL},
- {"groupTarget",
- (getter)ActionStrip_getGroupTarget, (setter)ActionStrip_setGroupTarget,
- "Name of target armature within group", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python BPy_ActionStrip methods: */
-/*****************************************************************************/
-
-/*
- * restore the values of ActionStart and ActionEnd to their defaults
- */
-
-static PyObject *ActionStrip_resetLimits( BPy_ActionStrip *self )
-{
- bActionStrip *strip = self->strip;
-
- if( !strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- calc_action_range( strip->act, &strip->actstart, &strip->actend, 1 );
-
- Py_RETURN_NONE;
-}
-
-/*
- * reset the strip size
- */
-
-static PyObject *ActionStrip_resetStripSize( BPy_ActionStrip *self )
-{
- float mapping;
- bActionStrip *strip = self->strip;
-
- if( !strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- mapping = (strip->actend - strip->actstart) / (strip->end - strip->start);
- strip->end = strip->start + mapping*(strip->end - strip->start);
-
- Py_RETURN_NONE;
-}
-
-/*
- * snap to start and end to nearest frames
- */
-
-static PyObject *ActionStrip_snapToFrame( BPy_ActionStrip *self )
-{
- bActionStrip *strip = self->strip;
-
- if( !strip )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
-
- strip->start= (float)floor(strip->start+0.5);
- strip->end= (float)floor(strip->end+0.5);
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python BPy_ActionStrip methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_ActionStrip_methods[] = {
- /* name, method, flags, doc */
- {"resetActionLimits", ( PyCFunction ) ActionStrip_resetLimits, METH_NOARGS,
- "Restores the values of ActionStart and ActionEnd to their defaults"},
- {"resetStripSize", ( PyCFunction ) ActionStrip_resetStripSize, METH_NOARGS,
- "Resets the Action Strip size to its creation values"},
- {"snapToFrame", ( PyCFunction ) ActionStrip_snapToFrame, METH_NOARGS,
- "Snaps the ends of the action strip to the nearest whole numbered frame"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python ActionStrip_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject ActionStrip_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.ActionStrip", /* char *tp_name; */
- sizeof( BPy_ActionStrip ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_ActionStrip_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_ActionStrip_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *M_ActionStrip_FlagsDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "SELECT", PyInt_FromLong( ACTSTRIP_SELECT ) );
- PyConstant_Insert( d, "STRIDE_PATH", PyInt_FromLong( ACTSTRIP_USESTRIDE ) );
- PyConstant_Insert( d, "HOLD", PyInt_FromLong( ACTSTRIP_HOLDLASTFRAME ) );
- PyConstant_Insert( d, "ACTIVE", PyInt_FromLong( ACTSTRIP_ACTIVE ) );
- PyConstant_Insert( d, "LOCK_ACTION", PyInt_FromLong( ACTSTRIP_LOCK_ACTION ) );
- PyConstant_Insert( d, "MUTE", PyInt_FromLong( ACTSTRIP_MUTE ) );
- PyConstant_Insert( d, "USEX", PyInt_FromLong( ACTSTRIP_CYCLIC_USEX ) );
- PyConstant_Insert( d, "USEY", PyInt_FromLong( ACTSTRIP_CYCLIC_USEY ) );
- PyConstant_Insert( d, "USEZ", PyInt_FromLong( ACTSTRIP_CYCLIC_USEZ ) );
- PyConstant_Insert( d, "AUTO_BLEND", PyInt_FromLong( ACTSTRIP_AUTO_BLENDS ) );
- }
- return S;
-}
-
-static PyObject *M_ActionStrip_AxisDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "STRIDEAXIS_X",
- PyInt_FromLong( ACTSTRIP_STRIDEAXIS_X ) );
- PyConstant_Insert( d, "STRIDEAXIS_Y",
- PyInt_FromLong( ACTSTRIP_STRIDEAXIS_Y ) );
- PyConstant_Insert( d, "STRIDEAXIS_Z",
- PyInt_FromLong( ACTSTRIP_STRIDEAXIS_Z ) );
- }
- return S;
-}
-
-static PyObject *M_ActionStrip_ModeDict( void )
-{
- PyObject *S = PyConstant_New( );
-
- if( S ) {
- BPy_constant *d = ( BPy_constant * ) S;
- PyConstant_Insert( d, "MODE_ADD",
- PyInt_FromLong( ACTSTRIPMODE_ADD ) );
- }
- return S;
-}
-
-PyObject *ActionStrip_CreatePyObject( struct bActionStrip *strip )
-{
- BPy_ActionStrip *pyobj;
- pyobj = ( BPy_ActionStrip * ) PyObject_NEW( BPy_ActionStrip,
- &ActionStrip_Type );
- if( !pyobj )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_ActionStrip object" );
- pyobj->strip = strip;
- return ( PyObject * ) pyobj;
-}
-
-/*****************************************************************************/
-/* ActionStrip Sequence wrapper */
-/*****************************************************************************/
-
-/*
- * Initialize the iterator
- */
-
-static PyObject *ActionStrips_getIter( BPy_ActionStrips * self )
-{
- self->iter = (bActionStrip *)self->ob->nlastrips.first;
- return EXPP_incr_ret ( (PyObject *) self );
-}
-
-/*
- * Get the next action strip
- */
-
-static PyObject *ActionStrips_nextIter( BPy_ActionStrips * self )
-{
- bActionStrip *strip = self->iter;
- if( strip ) {
- self->iter = strip->next;
- return ActionStrip_CreatePyObject( strip );
- }
-
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/* return the number of action strips */
-
-static int ActionStrips_length( BPy_ActionStrips * self )
-{
- return BLI_countlist( &self->ob->nlastrips );
-}
-
-/* return an action strip */
-
-static PyObject *ActionStrips_item( BPy_ActionStrips * self, int i )
-{
- bActionStrip *strip = NULL;
-
- /* if index is negative, start counting from the end of the list */
- if( i < 0 )
- i += ActionStrips_length( self );
-
- /* skip through the list until we get the strip or end of list */
-
- strip = self->ob->nlastrips.first;
-
- while( i && strip ) {
- --i;
- strip = strip->next;
- }
-
- if( strip )
- return ActionStrip_CreatePyObject( strip );
- else
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-}
-
-/*****************************************************************************/
-/* Python BPy_ActionStrips sequence table: */
-/*****************************************************************************/
-static PySequenceMethods ActionStrips_as_sequence = {
- ( inquiry ) ActionStrips_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) ActionStrips_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- ( binaryfunc ) 0, /* sq_inplace_concat */
- ( intargfunc ) 0, /* sq_inplace_repeat */
-};
-
-
-/*****************************************************************************/
-/* Python BPy_ActionStrip methods: */
-/*****************************************************************************/
-
-/*
- * helper function to check for a valid action strip argument
- */
-
-static bActionStrip *locate_strip( BPy_ActionStrips *self,
- PyObject *args, BPy_ActionStrip **stripobj )
-{
- bActionStrip *strip = NULL;
- BPy_ActionStrip *pyobj;
-
- /* check that argument is a constraint */
- if( !PyArg_ParseTuple( args, "O!", &ActionStrip_Type, &pyobj ) ) {
- EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an action strip as an argument" );
- return NULL;
- }
-
- if( !pyobj->strip ) {
- EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This strip has been removed!" );
- return NULL;
- }
-
- /* if caller needs the object, return it */
- if( stripobj )
- *stripobj = pyobj;
-
- /* find the action strip in the NLA */
- for( strip = self->ob->nlastrips.first; strip; strip = strip->next )
- if( strip == pyobj->strip )
- return strip;
-
- /* return exception if we can't find the strip */
- EXPP_ReturnPyObjError( PyExc_AttributeError,
- "action strip does not belong to this object" );
- return NULL;
-}
-
-/*
- * remove an action strip from the NLA
- */
-
-static PyObject *ActionStrips_remove( BPy_ActionStrips *self, PyObject * args )
-{
- BPy_ActionStrip *pyobj;
- bActionStrip *strip = locate_strip( self, args, &pyobj );
-
- /* return exception if we can't find the strip */
- if( !strip )
- return (PyObject *)NULL;
-
- /* do the actual removal */
- free_actionstrip(strip);
- BLI_remlink(&self->ob->nlastrips, strip);
- MEM_freeN(strip);
-
- pyobj->strip = NULL;
- Py_RETURN_NONE;
-}
-
-/*
- * move an action strip up in the strip list
- */
-
-static PyObject *ActionStrips_moveUp( BPy_ActionStrips *self, PyObject * args )
-{
- bActionStrip *strip = locate_strip( self, args, NULL );
-
- /* return exception if we can't find the strip */
- if( !strip )
- return (PyObject *)NULL;
-
- /* if strip is not already the first, move it up */
- if( strip != self->ob->nlastrips.first ) {
- BLI_remlink(&self->ob->nlastrips, strip);
- BLI_insertlink(&self->ob->nlastrips, strip->prev->prev, strip);
- }
-
- Py_RETURN_NONE;
-}
-
-/*
- * move an action strip down in the strip list
- */
-
-static PyObject *ActionStrips_moveDown( BPy_ActionStrips *self, PyObject * args )
-{
- bActionStrip *strip = locate_strip( self, args, NULL );
-
- /* return exception if we can't find the strip */
- if( !strip )
- return (PyObject *)NULL;
-
- /* if strip is not already the last, move it down */
- if( strip != self->ob->nlastrips.last ) {
- BLI_remlink(&self->ob->nlastrips, strip);
- BLI_insertlink(&self->ob->nlastrips, strip->next, strip);
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *ActionStrips_append( BPy_ActionStrips *self, PyObject * args )
-{
- BPy_Action *pyobj;
- Object *ob;
- bActionStrip *strip;
- bAction *act;
-
- /* check that argument is an action */
- if( !PyArg_ParseTuple( args, "O!", &Action_Type, &pyobj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an action as an argument" );
-
- ob = self->ob;
- act = pyobj->action;
-
- /* Initialize the new action block */
- strip = MEM_callocN( sizeof(bActionStrip), "bActionStrip" );
-
- strip->act = act;
- calc_action_range( strip->act, &strip->actstart, &strip->actend, 1 );
- strip->start = (float)G.scene->r.cfra;
- strip->end = strip->start + ( strip->actend - strip->actstart );
- /* simple prevention of zero strips */
- if( strip->start > strip->end-2 )
- strip->end = strip->start+100;
-
- strip->flag = ACTSTRIP_LOCK_ACTION;
- find_stridechannel(ob, strip);
-
- if(ob->nlastrips.first == NULL)
- ob->nlaflag |= OB_NLA_OVERRIDE;
-
- strip->repeat = 1.0;
- strip->scale = 1.0;
- act->id.us++;
-
- BLI_addtail(&ob->nlastrips, strip);
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python BPy_ActionStrips methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_ActionStrips_methods[] = {
- /* name, method, flags, doc */
- {"append", ( PyCFunction ) ActionStrips_append, METH_VARARGS,
- "(action) - append a new actionstrip using existing action"},
- {"remove", ( PyCFunction ) ActionStrips_remove, METH_VARARGS,
- "(strip) - remove an existing strip from this actionstrips"},
- {"moveUp", ( PyCFunction ) ActionStrips_moveUp, METH_VARARGS,
- "(strip) - move an existing strip up in the actionstrips"},
- {"moveDown", ( PyCFunction ) ActionStrips_moveDown, METH_VARARGS,
- "(strip) - move an existing strip down in the actionstrips"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python ActionStrips_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject ActionStrips_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.ActionStrips", /* char *tp_name; */
- sizeof( BPy_ActionStrips ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &ActionStrips_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc )ActionStrips_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc )ActionStrips_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_ActionStrips_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-PyObject *ActionStrips_CreatePyObject( Object *ob )
-{
- BPy_ActionStrips *pyseq;
- pyseq = ( BPy_ActionStrips * ) PyObject_NEW( BPy_ActionStrips,
- &ActionStrips_Type );
- if( !pyseq )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_ActionStrips object" );
- pyseq->ob = ob;
- return ( PyObject * ) pyseq;
-}
-
-/*****************************************************************************/
-/* Function: NLA_Init */
-/*****************************************************************************/
-PyObject *NLA_Init( void )
-{
- PyObject *FlagsDict = M_ActionStrip_FlagsDict( );
- PyObject *AxisDict = M_ActionStrip_AxisDict( );
- PyObject *ModeDict = M_ActionStrip_ModeDict( );
- PyObject *submodule;
-
- if( PyType_Ready( &Action_Type ) < 0
- || PyType_Ready( &ActionStrip_Type ) < 0
- || PyType_Ready( &ActionStrips_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Armature.NLA",
- M_NLA_methods, M_NLA_doc );
-
- if( FlagsDict )
- PyModule_AddObject( submodule, "Flags", FlagsDict );
- if( AxisDict )
- PyModule_AddObject( submodule, "StrideAxes", AxisDict );
- if( ModeDict )
- PyModule_AddObject( submodule, "Modes", ModeDict );
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/NLA.h b/source/blender/python/api2_2x/NLA.h
deleted file mode 100644
index f4fd8761cf1..00000000000
--- a/source/blender/python/api2_2x/NLA.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_NLA_H
-#define EXPP_NLA_H
-
-#include <Python.h>
-#include "DNA_action_types.h"
-#include "DNA_nla_types.h"
-
-struct Object;
-
-/** NLA module initialization function. */
-PyObject *NLA_Init( void );
-
-extern PyTypeObject Action_Type;
-extern PyTypeObject ActionStrip_Type;
-extern PyTypeObject ActionStrips_Type;
-
-/** Python BPy_NLA structure definition. */
-typedef struct {
- PyObject_HEAD
- bAction * action; /* libdata must be second */
-} BPy_Action;
-
-typedef struct {
- PyObject_HEAD
- bActionStrip * strip;
-} BPy_ActionStrip;
-
-typedef struct {
- PyObject_HEAD
- struct Object * ob;
- struct bActionStrip *iter;
-} BPy_ActionStrips;
-
-/* Type checking for EXPP PyTypes */
-#define BPy_Action_Check(v) ((v)->ob_type == &Action_Type)
-#define BPy_ActionStrip_Check(v) ((v)->ob_type == &ActionStrip_Type)
-#define BPy_ActionStrips_Check(v) ((v)->ob_type == &ActionStrips_Type)
-
-PyObject *Action_CreatePyObject( struct bAction *action );
-bAction *Action_FromPyObject( PyObject * py_obj );
-
-PyObject *ActionStrip_CreatePyObject( struct bActionStrip *strip );
-PyObject *ActionStrips_CreatePyObject( struct Object *ob );
-
-#endif
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c
deleted file mode 100644
index 2e82c55155f..00000000000
--- a/source/blender/python/api2_2x/NMesh.c
+++ /dev/null
@@ -1,4166 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender, but it borrows all the old NMesh code.
- *
- * Contributor(s): Willian P. Germano, Jordi Rovira i Bonet, Joseph Gilbert,
- * Bala Gi, Alexander Szakaly, Stephane Soppera, Campbell Barton, Ken Hughes,
- * Daniel Dunbar.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "NMesh.h" /*This must come first*/
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_key_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_curve_types.h"
-
-#include "BDR_editface.h" /* make_tfaces */
-#include "BDR_vpaint.h"
-#include "BDR_editobject.h"
-
-#include "BIF_editdeform.h"
-#include "BIF_editkey.h" /* insert_meshkey */
-#include "BIF_editview.h"
-#include "BIF_space.h"
-
-#include "BKE_customdata.h"
-#include "BKE_deform.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_object.h"
-#include "BKE_mball.h"
-#include "BKE_utildefines.h"
-#include "BKE_depsgraph.h"
-#include "BKE_idprop.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "Object.h"
-#include "Key.h"
-#include "Mathutils.h"
-#include "IDProp.h"
-#include "constant.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-extern void countall(void);
-
-/* EXPP Mesh defines */
-
-#define NMESH_FRAME_MAX 30000
-#define NMESH_SMOOTHRESH 30
-#define NMESH_SMOOTHRESH_MIN 1
-#define NMESH_SMOOTHRESH_MAX 80
-#define NMESH_SUBDIV 1
-#define NMESH_SUBDIV_MIN 0
-#define NMESH_SUBDIV_MAX 6
-
-static int unlink_existingMeshData( Mesh * mesh );
-static int convert_NMeshToMesh( Mesh *mesh, BPy_NMesh *nmesh );
-static void check_dverts(Mesh *me, int old_totverts);
-static PyObject *NMesh_printDebug( PyObject * self );
-static PyObject *NMesh_addEdge( PyObject * self, PyObject * args );
-static PyObject *NMesh_findEdge( PyObject * self, PyObject * args );
-static PyObject *NMesh_removeEdge( PyObject * self, PyObject * args );
-static PyObject *NMesh_addFace( PyObject * self, PyObject * args );
-static PyObject *NMesh_removeFace( PyObject * self, PyObject * args );
-static PyObject *NMesh_addVertGroup( PyObject * self, PyObject * args );
-static PyObject *NMesh_removeVertGroup( PyObject * self, PyObject * args );
-static PyObject *NMesh_assignVertsToGroup( PyObject * self, PyObject * args );
-static PyObject *NMesh_removeVertsFromGroup( PyObject * self,PyObject * args );
-static PyObject *NMesh_getVertsFromGroup( PyObject * self, PyObject * args );
-static PyObject *NMesh_renameVertGroup( PyObject * self, PyObject * args );
-static PyObject *NMesh_getVertGroupNames( PyObject * self );
-static PyObject *NMesh_transform (PyObject *self, PyObject *args);
-
-static char NMesh_printDebug_doc[] =
- "print debug info about the mesh.";
-
-static char NMesh_getKey_doc[] =
- "get the Key object linked to this mesh";
-
-static char NMesh_addEdge_doc[] =
- "create an edge between two vertices.\n\
-If an edge already exists between those vertices, it is returned.\n\
-(In Blender, only zero or one edge can link two vertices.)\n\
-Created edge is automatically added to edges list.";
-
-static char NMesh_findEdge_doc[] =
- "find an edge between two vertices.";
-
-static char NMesh_removeEdge_doc[] =
- "remove an edge between two vertices.\n\
-All faces using this edge are removed from faces list.";
-
-static char NMesh_addFace_doc[] =
- "add a face to face list and add to edge list (if edge data exists) necessary edges.";
-
-static char NMesh_removeFace_doc[] =
- "remove a face for face list and remove edges no more used by any other face (if \
-edge data exists).";
-
-static char NMesh_addVertGroup_doc[] =
- "add a named and empty vertex(deform) Group to a mesh that has been linked\n\
-to an object. ";
-
-static char NMesh_removeVertGroup_doc[] =
- "remove a named vertex(deform) Group from a mesh that has been linked\n\
-to an object. Will remove all verts assigned to group.";
-
-static char NMesh_assignVertsToGroup_doc[] =
- "Adds an array (a python list) of vertex points (by index) to a named\n\
-vertex group. The list will have an associated wieght assigned to them.\n\
-The weight represents the amount of influence this group has over these\n\
-vertex points. Weights should be in the range of 0.0 - 1.0.\n\
-The assignmode can be either 'add', 'subtract', or 'replace'. If this vertex\n\
-is not assigned to the group 'add' creates a new association with the weight\n\
-specified, otherwise the weight given is added to the current weight of the\n\
-vertex.\n\
-'subtract' will attempt to subtract the weight passed from a vertex already\n\
-associated with a group, else it does nothing. 'replace' attempts to replace\n\
-the weight with the new weight value for an already associated vertex/group,\n\
-else it does nothing. The mesh must have all it's vertex points set before\n\
-attempting to assign any vertex points to a vertex group.";
-
-static char NMesh_removeVertsFromGroup_doc[] =
- "Remove an array (a python list) of vertex points from a named group in a\n\
-mesh that has been linked to an object. If no list is given this will remove\n\
-all vertex point associations with the group passed";
-
-static char NMesh_getVertsFromGroup_doc[] =
- "By passing a python list of vertex indices and a named group, this will\n\
-return a python list representing the indeces that are a part of this vertex.\n\
-group. If no association was found for the index passed nothing will be\n\
-return for the index. An optional flag will also return the weights as well";
-
-static char NMesh_renameVertGroup_doc[] = "Renames a vertex group";
-
-static char NMesh_getVertGroupNames_doc[] =
- "Returns a list of all the vertex group names";
-
-static char M_NMesh_doc[] = "The Blender.NMesh submodule";
-
-static char M_NMesh_Col_doc[] = "([r, g, b, a]) - Get a new mesh color\n\n\
-[r=255, g=255, b=255, a=255] Specify the color components";
-
-static char M_NMesh_Face_doc[] =
- "(vertexlist = None) - Get a new face, and pass optional vertex list";
-
-static char NMFace_append_doc[] =
- "(vert) - appends Vertex 'vert' to face vertex list";
-
-static char M_NMesh_Vert_doc[] = "([x, y, z]) - Get a new vertex\n\n\
-[x, y, z] Specify new coordinates";
-
-static char NMesh_getMaterials_doc[] =
- "(i = -1) - Get this mesh's list of materials.\n\
-(i = -1) - int: determines the list's contents:\n\
--1: return the current list, possibly modified by the script (default);\n\
- 0: get a fresh list from the Blender mesh -- modifications not included,\n\
- unless the script called mesh.update() first;\n\
- 1: like 0, but does not ignore empty slots, returns them as 'None'.";
-
-static char NMesh_setMaterials_doc[] =
- "(matlist) - Set this mesh's list of materials. This method makes sure\n\
-the passed matlist is valid (can only include up to 16 materials and None's).";
-
-static char NMesh_addMaterial_doc[] =
- "(material) - add a new Blender Material 'material' to this Mesh's materials\n\
-list.";
-
-static char NMesh_insertKey_doc[] =
- "(frame = None, type = 'relative') - inserts a Mesh key at the given frame\n\
-if called without arguments, it inserts the key at the current Scene frame.\n\
-(type) - 'relative' or 'absolute'. Only relevant on the first call to this\n\
-function for each nmesh.";
-
-static char NMesh_removeAllKeys_doc[] =
- "() - removes all keys from this mesh\n\
-returns True if successful or False if this NMesh wasn't linked to a real\n\
-Blender Mesh yet or the Mesh had no keys";
-
-static char NMesh_getSelectedFaces_doc[] =
- "(flag = None) - returns list of selected Faces\n\
-If flag = 1, return indices instead";
-
-static char NMesh_getActiveFace_doc[] =
- "returns the index of the active face ";
-
-static char NMesh_hasVertexUV_doc[] =
- "(flag = None) - returns 1 if Mesh has per vertex UVs ('Sticky')\n\
-The optional argument sets the Sticky flag";
-
-static char NMesh_hasFaceUV_doc[] =
- "(flag = None) - returns 1 if Mesh has textured faces\n\
-The optional argument sets the textured faces flag";
-
-static char NMesh_hasVertexColours_doc[] =
- "(flag = None) - returns 1 if Mesh has vertex colors.\n\
-The optional argument sets the vertex color flag";
-
-static char NMesh_getVertexInfluences_doc[] =
- "Return a list of the influences of bones in the vertex \n\
-specified by index. The list contains pairs with the \n\
-bone name and the weight.";
-
-static char NMesh_update_doc[] =
-"(recalc_normals = 0, store_edges = 0, vertex_shade = 0) - Updates the Mesh.\n\
-Optional arguments: if given and nonzero:\n\
-'recalc_normals': normal vectors are recalculated;\n\
-'store_edges': edges data is stored.\n\
-'vertex_shade': vertex colors are added based on the current lamp setup.";
-
-static char NMesh_getMode_doc[] =
- "() - get the mode flags of this nmesh as an or'ed int value.";
-
-static char NMesh_setMode_doc[] =
- "(int or none to 5 strings) - set the mode flags of this nmesh.\n\
-() - unset all flags.";
-
-static char NMesh_getMaxSmoothAngle_doc[] =
- "() - get the max smooth angle for mesh auto smoothing.";
-
-static char NMesh_setMaxSmoothAngle_doc[] =
- "(int) - set the max smooth angle for mesh auto smoothing in the range\n\
-[1,80] in degrees.";
-
-static char NMesh_getSubDivLevels_doc[] =
- "() - get the subdivision levels for display and rendering: [display, render]";
-
-static char NMesh_setSubDivLevels_doc[] =
- "([int, int]) - set the subdivision levels for [display, render] -- they are\n\
-clamped to the range [0,6].";
-
-static char M_NMesh_New_doc[] =
- "() - returns a new, empty NMesh mesh object\n";
-
-static char M_NMesh_GetRaw_doc[] = "([name]) - Get a raw mesh from Blender\n\n\
-[name] Name of the mesh to be returned\n\n\
-If name is not specified a new empty mesh is\n\
-returned, otherwise Blender returns an existing\n\
-mesh.";
-
-static char M_NMesh_GetNames_doc[] = "\
-() - Get a list with the names of all available meshes in Blender\n\n\
-Any of these names can be passed to NMesh.GetRaw() for the actual mesh data.";
-
-static char M_NMesh_GetRawFromObject_doc[] =
- "(name) - Get the raw mesh used by a Blender object\n\n\
-(name) Name of the object to get the mesh from\n\n\
-This returns the mesh as used by the object, which\n\
-means it contains all deformations and modifications.";
-
-static char M_NMesh_PutRaw_doc[] =
- "(mesh, name = None, recalc_normals = 1, store_edges = 0]) -\n\
-Return a raw mesh to Blender\n\n\
-(mesh) The NMesh object to store\n\
-[name] The mesh to replace\n\
-[recalc_normals = 1] Flag to control vertex normal recalculation\n\
-[store_edges=0] Store edges data in the blender mesh\n\
-If the name of a mesh to replace is not given a new\n\
-object is created and returned.";
-
-static char NMesh_transform_doc[] =
-"(matrix, recalc_normals = 0) - Transform the mesh by the supplied 4x4 matrix\n\
-if recalc_normals is True, vertex normals are transformed along with \n\
-vertex coordinatess.\n";
-
-
-void mesh_update( Mesh * mesh, Object * ob )
-{
- if (ob) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else {
- ob = G.main->object.first;
- while (ob) {
- if (ob->data == mesh) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- break;
- }
- ob = ob->id.next;
- }
- }
-}
-
-/*
- * before trying to convert NMesh data back to mesh, verify that the
- * lists contain the right type of data
- */
-
-static int check_NMeshLists( BPy_NMesh *nmesh )
-{
- int i;
-
- if( !PySequence_Check( nmesh->verts ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh verts are not a sequence" );
- if( !PySequence_Check( nmesh->edges ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh edges are not a sequence" );
- if( !PySequence_Check( nmesh->faces ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh faces are not a sequence" );
- if( !PySequence_Check( nmesh->materials ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh materials are not a sequence" );
-
- if( EXPP_check_sequence_consistency( nmesh->verts, &NMVert_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh vertices must be NMVerts" );
- if( EXPP_check_sequence_consistency( nmesh->edges, &NMEdge_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh edges must be NMEdges" );
- if( EXPP_check_sequence_consistency( nmesh->faces, &NMFace_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh faces must be NMFaces" );
- for( i = 0 ; i < PySequence_Length(nmesh->faces); ++i ) {
- int j, err=0;
- PyObject *col, *v, *uv;
- BPy_NMFace *face=(BPy_NMFace *)PySequence_GetItem(nmesh->faces, i);
-
- col = face->col;
- uv = face->uv;
- v = face->v;
- Py_DECREF( face );
- if( EXPP_check_sequence_consistency( face->col, &NMCol_Type ) != 1 ) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh face col must be NMCols" );
- }
- if( EXPP_check_sequence_consistency( face->v, &NMVert_Type ) != 1 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh face v must be NMVerts" );
-
- for( j = 0 ; !err && j < PySequence_Length( face->uv ); ++j ) {
- PyObject *uv = PySequence_GetItem( face->uv, j);
- if( PySequence_Check(uv) && PySequence_Length(uv) == 2 ) {
- PyObject *p1 = PySequence_GetItem(uv, 0);
- PyObject *p2 = PySequence_GetItem(uv, 1);
- if( !PyNumber_Check(p1) || !PyNumber_Check(p2) )
- err = 1;
- Py_DECREF( p1 );
- Py_DECREF( p2 );
- }
- else {
- err = 1;
- }
-
- Py_DECREF( uv );
- }
- if( err )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "nmesh face uv must contain sequence of 2 floats" );
- }
- return 0;
-}
-
-
-/*****************************/
-/* Mesh Color Object */
-/*****************************/
-
-static void NMCol_dealloc( PyObject * self )
-{
- PyObject_DEL( self );
-}
-
-static BPy_NMCol *newcol( char r, char g, char b, char a )
-{
- BPy_NMCol *mc = ( BPy_NMCol * ) PyObject_NEW( BPy_NMCol, &NMCol_Type );
-
- mc->r = r;
- mc->g = g;
- mc->b = b;
- mc->a = a;
-
- return mc;
-}
-
-static PyObject *M_NMesh_Col( PyObject * self, PyObject * args )
-{
- char r = 255, g = 255, b = 255, a = 255;
-
- if( PyArg_ParseTuple( args, "|bbbb", &r, &g, &b, &a ) )
- return ( PyObject * ) newcol( r, g, b, a );
-
- return NULL;
-}
-
-static PyObject *NMCol_getattr( PyObject * self, char *name )
-{
- BPy_NMCol *mc = ( BPy_NMCol * ) self;
-
- if( strcmp( name, "r" ) == 0 )
- return Py_BuildValue( "i", mc->r );
- else if( strcmp( name, "g" ) == 0 )
- return Py_BuildValue( "i", mc->g );
- else if( strcmp( name, "b" ) == 0 )
- return Py_BuildValue( "i", mc->b );
- else if( strcmp( name, "a" ) == 0 )
- return Py_BuildValue( "i", mc->a );
- else if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s,s]", "r", "g", "b", "a" );
-
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-}
-
-static int NMCol_setattr( PyObject * self, char *name, PyObject * v )
-{
- BPy_NMCol *mc = ( BPy_NMCol * ) self;
- char ival;
-
- if( !PyArg_Parse( v, "b", &ival ) )
- return -1;
-
- ival = ( char ) EXPP_ClampInt( ival, 0, 255 );
-
- if( strcmp( name, "r" ) == 0 )
- mc->r = (unsigned char)ival;
- else if( strcmp( name, "g" ) == 0 )
- mc->g = (unsigned char)ival;
- else if( strcmp( name, "b" ) == 0 )
- mc->b = (unsigned char)ival;
- else if( strcmp( name, "a" ) == 0 )
- mc->a = (unsigned char)ival;
- else
- return -1;
-
- return 0;
-}
-
-static PyObject *NMCol_repr( BPy_NMCol * self )
-{
- static char s[256];
- sprintf( s, "[NMCol - <%d, %d, %d, %d>]", self->r, self->g, self->b,
- self->a );
- return Py_BuildValue( "s", s );
-}
-
-PyTypeObject NMCol_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /* ob_size */
- "Blender NMCol", /* tp_name */
- sizeof( BPy_NMCol ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) NMCol_dealloc, /* tp_dealloc */
- ( printfunc ) 0, /* tp_print */
- ( getattrfunc ) NMCol_getattr, /* tp_getattr */
- ( setattrfunc ) NMCol_setattr, /* tp_setattr */
- 0, /* tp_compare */
- ( reprfunc ) NMCol_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* up to tp_del to avoid a warning */
-};
-
-/*****************************/
-/* NMesh Python Object */
-/*****************************/
-static void NMFace_dealloc( PyObject * self )
-{
- BPy_NMFace *mf = ( BPy_NMFace * ) self;
-
- Py_DECREF( mf->v );
- Py_DECREF( mf->uv );
- Py_DECREF( mf->col );
-
- PyObject_DEL( self );
-}
-
-static PyObject *new_NMFace( PyObject * vertexlist )
-{
- BPy_NMFace *mf = PyObject_NEW( BPy_NMFace, &NMFace_Type );
- PyObject *vlcopy;
-
- if( vertexlist ) { /* create a copy of the given vertex list */
- PyObject *item;
- int i, len = PyList_Size( vertexlist );
-
- vlcopy = PyList_New( len );
-
- if( !vlcopy ) {
- Py_DECREF(mf);
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
- }
- for( i = 0; i < len; i++ ) {
- item = PySequence_GetItem( vertexlist, i ); /* PySequence increfs */
-
- if( item )
- PyList_SET_ITEM( vlcopy, i, item );
- else {
- Py_DECREF(mf);
- Py_DECREF(vlcopy);
- return EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "couldn't get vertex from a PyList" );
- }
- }
- } else /* create an empty vertex list */
- vlcopy = PyList_New( 0 );
-
- mf->v = vlcopy;
- mf->uv = PyList_New( 0 );
- mf->image = NULL;
- mf->mode = TF_DYNAMIC + TF_TEX;
- mf->flag = TF_SELECT;
- mf->transp = TF_SOLID;
- mf->col = PyList_New( 0 );
-
- mf->mf_flag = 0;
- mf->mat_nr = 0;
- mf->orig_index = -1;
-
- return ( PyObject * ) mf;
-}
-
-static PyObject *M_NMesh_Face( PyObject * self, PyObject * args )
-{
- PyObject *vertlist = NULL;
-
- if( !PyArg_ParseTuple( args, "|O!", &PyList_Type, &vertlist ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of vertices or nothing as argument" );
-
-/* if (!vertlist) vertlist = PyList_New(0); */
-
- return new_NMFace( vertlist );
-}
-
-static PyObject *NMFace_append( PyObject * self, PyObject * args )
-{
- PyObject *vert;
- BPy_NMFace *f = ( BPy_NMFace * ) self;
-
- if( !PyArg_ParseTuple( args, "O!", &NMVert_Type, &vert ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an NMVert object" );
-
- PyList_Append( f->v, vert );
-
- Py_RETURN_NONE;
-}
-
-#undef MethodDef
-#define MethodDef(func) {#func, NMFace_##func, METH_VARARGS, NMFace_##func##_doc}
-
-static struct PyMethodDef NMFace_methods[] = {
- MethodDef( append ),
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *NMFace_getattr( PyObject * self, char *name )
-{
- BPy_NMFace *mf = ( BPy_NMFace * ) self;
-
- if( strcmp( name, "v" ) == 0 )
- return Py_BuildValue( "O", mf->v );
- else if( strcmp( name, "col" ) == 0 )
- return Py_BuildValue( "O", mf->col );
- else if( strcmp( name, "mat" ) == 0 ) // emulation XXX
- return Py_BuildValue( "i", mf->mat_nr );
- else if( strcmp( name, "materialIndex" ) == 0 )
- return Py_BuildValue( "i", mf->mat_nr );
- else if( strcmp( name, "smooth" ) == 0 )
- return Py_BuildValue( "i", (mf->mf_flag & ME_SMOOTH) ? 1:0 );
- else if( strcmp( name, "sel" ) == 0 )
- return Py_BuildValue( "i", (mf->mf_flag & ME_FACE_SEL) ? 1:0 );
- else if( strcmp( name, "hide" ) == 0 )
- return Py_BuildValue( "i", (mf->mf_flag & ME_HIDE) ? 1:0 );
-
- else if( strcmp( name, "image" ) == 0 ) {
- if( mf->image )
- return Image_CreatePyObject( mf->image );
- else
- Py_RETURN_NONE;
- }
-
- else if( strcmp( name, "mode" ) == 0 )
- return Py_BuildValue( "i", mf->mode );
- else if( strcmp( name, "flag" ) == 0 )
- return Py_BuildValue( "i", mf->flag );
- else if( strcmp( name, "transp" ) == 0 )
- return Py_BuildValue( "i", mf->transp );
- else if( strcmp( name, "uv" ) == 0 )
- return Py_BuildValue( "O", mf->uv );
-
- else if( ( strcmp( name, "normal" ) == 0 )
- || ( strcmp( name, "no" ) == 0 ) ) {
-
- if( EXPP_check_sequence_consistency( mf->v, &NMVert_Type ) ==
- 1 ) {
-
- float fNormal[3] = { 0.0, 0.0, 0.0 };
- float *vco[4] = { NULL, NULL, NULL, NULL };
- int nSize = PyList_Size( mf->v );
- int loop;
-
- if( nSize != 3 && nSize != 4 )
- return EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "face must contain either 3 or 4 verts" );
-
- for( loop = 0; loop < nSize; loop++ ) {
- BPy_NMVert *v =
- ( BPy_NMVert * ) PyList_GetItem( mf->v,
- loop );
- vco[loop] = ( float * ) v->co;
- }
-
- if( nSize == 4 )
- CalcNormFloat4( vco[0], vco[1], vco[2], vco[3],
- fNormal );
- else
- CalcNormFloat( vco[0], vco[1], vco[2],
- fNormal );
-
- return Py_BuildValue( "[f,f,f]", fNormal[0],
- fNormal[1], fNormal[2] );
- } else // EXPP_check_sequence_consistency failed
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "this face does not contain a series of NMVerts" );
- }
-
- else if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s,s,s,s]",
- "v", "col", "mat", "materialIndex",
- "smooth", "image", "mode", "flag",
- "transp", "uv", "normal", "sel", "hide");
- return Py_FindMethod( NMFace_methods, ( PyObject * ) self, name );
-}
-
-static int NMFace_setattr( PyObject * self, char *name, PyObject * v )
-{
- BPy_NMFace *mf = ( BPy_NMFace * ) self;
- short ival;
- char cval;
-
- if( strcmp( name, "v" ) == 0 ) {
-
- if( PySequence_Check( v ) ) {
- Py_DECREF( mf->v );
- mf->v = EXPP_incr_ret( v );
-
- return 0;
- }
- } else if( strcmp( name, "col" ) == 0 ) {
-
- if( PySequence_Check( v ) ) {
- Py_DECREF( mf->col );
- mf->col = EXPP_incr_ret( v );
-
- return 0;
- }
- } else if( !strcmp( name, "mat" ) || !strcmp( name, "materialIndex" ) ) {
- PyArg_Parse( v, "b", &cval );
- mf->mat_nr = cval;
-
- return 0;
- } else if( strcmp( name, "smooth" ) == 0 ) {
- PyArg_Parse( v, "h", &ival );
- if (ival) mf->mf_flag |= ME_SMOOTH;
- else mf->mf_flag &= ~ME_SMOOTH;
-
- return 0;
- } else if( strcmp( name, "sel" ) == 0 ) {
- PyArg_Parse( v, "h", &ival );
- if (ival) mf->mf_flag |= ME_FACE_SEL;
- else mf->mf_flag &= ~ME_FACE_SEL;
-
- return 0;
- } else if( strcmp( name, "hide" ) == 0 ) {
- PyArg_Parse( v, "h", &ival );
- if (ival) mf->mf_flag |= ME_HIDE;
- else mf->mf_flag &= ~ME_HIDE;
-
- return 0;
-
- } else if( strcmp( name, "uv" ) == 0 ) {
-
- if( PySequence_Check( v ) ) {
- Py_DECREF( mf->uv );
- mf->uv = EXPP_incr_ret( v );
-
- return 0;
- }
- } else if( strcmp( name, "flag" ) == 0 ) {
- PyArg_Parse( v, "h", &ival );
- mf->flag = ival;
-
- return 0;
- } else if( strcmp( name, "mode" ) == 0 ) {
- PyArg_Parse( v, "h", &ival );
- mf->mode = ival;
-
- return 0;
- } else if( strcmp( name, "transp" ) == 0 ) {
- PyArg_Parse( v, "b", &cval );
- mf->transp = cval;
-
- return 0;
- } else if( strcmp( name, "image" ) == 0 ) {
- PyObject *pyimg;
- if( !PyArg_Parse( v, "O!", &Image_Type, &pyimg ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected image object" );
-
- if( pyimg == Py_None ) {
- mf->image = NULL;
-
- return 0;
- }
-
- mf->image = ( ( BPy_Image * ) pyimg )->image;
-
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-}
-
-static PyObject *NMFace_repr( PyObject * self )
-{
- return PyString_FromString( "[NMFace]" );
-}
-
-static int NMFace_len( BPy_NMFace * self )
-{
- return PySequence_Length( self->v );
-}
-
-static PyObject *NMFace_item( BPy_NMFace * self, int i )
-{
- return PySequence_GetItem( self->v, i ); // new ref
-}
-
-static PyObject *NMFace_slice( BPy_NMFace * self, int begin, int end )
-{
- return PyList_GetSlice( self->v, begin, end ); // new ref
-}
-
-static PySequenceMethods NMFace_SeqMethods = {
- ( inquiry ) NMFace_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) NMFace_item, /* sq_item */
- ( intintargfunc ) NMFace_slice, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-PyTypeObject NMFace_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /*ob_size */
- "Blender NMFace", /*tp_name */
- sizeof( BPy_NMFace ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) NMFace_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) NMFace_getattr, /*tp_getattr */
- ( setattrfunc ) NMFace_setattr, /*tp_setattr */
- 0, /*tp_compare */
- ( reprfunc ) NMFace_repr, /*tp_repr */
- 0, /*tp_as_number */
- &NMFace_SeqMethods, /*tp_as_sequence */
- 0, /*tp_as_mapping */
- 0, /*tp_hash */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* up to tp_del to avoid a warning */
-};
-
-static BPy_NMVert *newvert( float *co )
-{
- BPy_NMVert *mv = PyObject_NEW( BPy_NMVert, &NMVert_Type );
-
- mv->co[0] = co[0];
- mv->co[1] = co[1];
- mv->co[2] = co[2];
-
- mv->no[0] = mv->no[1] = mv->no[2] = 0.0;
- mv->uvco[0] = mv->uvco[1] = mv->uvco[2] = 0.0;
- mv->flag = 0;
-
- return mv;
-}
-
-static PyObject *M_NMesh_Vert( PyObject * self, PyObject * args )
-{
- float co[3] = { 0.0, 0.0, 0.0 };
-
- if( !PyArg_ParseTuple( args, "|fff", &co[0], &co[1], &co[2] ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected three floats (or nothing) as arguments" );
-
- return ( PyObject * ) newvert( co );
-}
-
-static void NMVert_dealloc( PyObject * self )
-{
- PyObject_DEL( self );
-}
-
-static PyObject *NMVert_getattr( PyObject * self, char *name )
-{
- BPy_NMVert *mv = ( BPy_NMVert * ) self;
-
- if( !strcmp( name, "co" ) || !strcmp( name, "loc" ) )
- return newVectorObject(mv->co,3,Py_WRAP);
-
- else if( strcmp( name, "no" ) == 0 )
- return newVectorObject(mv->no,3,Py_WRAP);
- else if( strcmp( name, "uvco" ) == 0 )
- return newVectorObject(mv->uvco,3,Py_WRAP);
- else if( strcmp( name, "index" ) == 0 )
- return PyInt_FromLong( mv->index );
- else if( strcmp( name, "sel" ) == 0 )
- return PyInt_FromLong( mv->flag & 1 );
- else if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s,s,s]", "co", "no", "uvco",
- "index", "sel" );
-
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-}
-
-static int NMVert_setattr( PyObject * self, char *name, PyObject * v )
-{
- BPy_NMVert *mv = ( BPy_NMVert * ) self;
- int i;
-
- if( strcmp( name, "index" ) == 0 ) {
- PyArg_Parse( v, "i", &i );
- mv->index = i;
- return 0;
- } else if( strcmp( name, "sel" ) == 0 ) {
- PyArg_Parse( v, "i", &i );
- mv->flag = i ? 1 : 0;
- return 0;
- } else if( strcmp( name, "uvco" ) == 0 ) {
-
- if( !PyArg_ParseTuple( v, "ff|f",
- &( mv->uvco[0] ), &( mv->uvco[1] ),
- &( mv->uvco[2] ) ) )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "Vector tuple or triple expected" );
-
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-}
-
-static int NMVert_len( BPy_NMVert * self )
-{
- return 3;
-}
-
-static PyObject *NMVert_item( BPy_NMVert * self, int i )
-{
- if( i < 0 || i >= 3 )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return Py_BuildValue( "f", self->co[i] );
-}
-
-static PyObject *NMVert_slice( BPy_NMVert * self, int begin, int end )
-{
- PyObject *list;
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 3 )
- end = 3;
- if( begin > end )
- begin = end;
-
- list = PyList_New( end - begin );
-
- for( count = begin; count < end; count++ )
- PyList_SetItem( list, count - begin,
- PyFloat_FromDouble( self->co[count] ) );
-
- return list;
-}
-
-static int NMVert_ass_item( BPy_NMVert * self, int i, PyObject * ob )
-{
- if( i < 0 || i >= 3 )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array assignment index out of range" );
-
- if( !PyNumber_Check( ob ) )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "NMVert member must be a number" );
-
- self->co[i] = (float)PyFloat_AsDouble( ob );
-
- return 0;
-}
-
-static int NMVert_ass_slice( BPy_NMVert * self, int begin, int end,
- PyObject * seq )
-{
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 3 )
- end = 3;
- if( begin > end )
- begin = end;
-
- if( !PySequence_Check( seq ) )
- EXPP_ReturnIntError( PyExc_TypeError,
- "illegal argument type for built-in operation" );
-
- if( PySequence_Length( seq ) != ( end - begin ) )
- EXPP_ReturnIntError( PyExc_TypeError,
- "size mismatch in slice assignment" );
-
- for( count = begin; count < end; count++ ) {
- PyObject *ob = PySequence_GetItem( seq, count );
-
- if( !PyArg_Parse( ob, "f", &self->co[count] ) ) {
- Py_DECREF( ob );
- return -1;
- }
-
- Py_DECREF( ob );
- }
-
- return 0;
-}
-
-static PySequenceMethods NMVert_SeqMethods = {
- ( inquiry ) NMVert_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) NMVert_item, /* sq_item */
- ( intintargfunc ) NMVert_slice, /* sq_slice */
- ( intobjargproc ) NMVert_ass_item, /* sq_ass_item */
- ( intintobjargproc ) NMVert_ass_slice, /* sq_ass_slice */
- 0,0,0,
-};
-
-PyTypeObject NMVert_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /*ob_size */
- "Blender NMVert", /*tp_name */
- sizeof( BPy_NMVert ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) NMVert_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) NMVert_getattr, /*tp_getattr */
- ( setattrfunc ) NMVert_setattr, /*tp_setattr */
- 0, /*tp_compare */
- ( reprfunc ) 0, /*tp_repr */
- 0, /*tp_as_number */
- &NMVert_SeqMethods, /*tp_as_sequence */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_del */
-};
-
-
-/*****************************
- * NMEdge
- *****************************/
-
-static BPy_NMEdge *new_NMEdge( BPy_NMVert * v1, BPy_NMVert * v2, char crease, short flag)
-{
- BPy_NMEdge *edge=NULL;
-
- if (!v1 || !v2) return NULL;
- if (!BPy_NMVert_Check(v1) || !BPy_NMVert_Check(v2)) return NULL;
-
- edge = PyObject_NEW( BPy_NMEdge, &NMEdge_Type );
-
- edge->v1=EXPP_incr_ret((PyObject*)v1);
- edge->v2=EXPP_incr_ret((PyObject*)v2);
- edge->flag=flag;
- edge->crease=crease;
-
- return edge;
-}
-
-static void NMEdge_dealloc( PyObject * self )
-{
- BPy_NMEdge *edge=(BPy_NMEdge *)self;
-
- Py_DECREF(edge->v1);
- Py_DECREF(edge->v2);
-
- PyObject_DEL(self);
-}
-
-static PyObject *NMEdge_getattr( PyObject * self, char *name )
-{
- BPy_NMEdge *edge=(BPy_NMEdge *)self;
-
- if ( strcmp( name, "v1" ) == 0 )
- return EXPP_incr_ret( edge->v1 );
- else if ( strcmp( name, "v2" ) == 0 )
- return EXPP_incr_ret( edge->v2 );
- else if ( strcmp( name, "flag" ) == 0 )
- return PyInt_FromLong( edge->flag );
- else if ( strcmp( name, "crease" ) == 0 )
- return PyInt_FromLong( edge->crease );
- else if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s,s]",
- "v1", "v2", "flag", "crease" );
-
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-}
-
-static int NMEdge_setattr( PyObject * self, char *name, PyObject * v )
-{
- BPy_NMEdge *edge=(BPy_NMEdge *)self;
-
- if ( strcmp( name, "flag" ) == 0 )
- {
- short flag=0;
- if( !PyInt_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- flag = ( short ) PyInt_AsLong( v );
-
- edge->flag = flag;
-
- return 0;
- }
- else if ( strcmp( name, "crease" ) == 0 )
- {
- char crease=0;
- if( !PyInt_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- crease = ( char ) PyInt_AsLong( v );
-
- edge->crease = crease;
-
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-}
-
-PyTypeObject NMEdge_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /*ob_size */
- "Blender NMEdge", /*tp_name */
- sizeof( BPy_NMEdge ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) NMEdge_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) NMEdge_getattr, /*tp_getattr */
- ( setattrfunc ) NMEdge_setattr, /*tp_setattr */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,
-};
-
-static void NMesh_dealloc( PyObject * self )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
-
- CustomData_free( &me->fdata, me->totfdata );
-
- Py_DECREF( me->name );
- Py_DECREF( me->verts );
- Py_DECREF( me->faces );
- Py_DECREF( me->materials );
- Py_DECREF( me->edges );
-
- PyObject_DEL( self );
-}
-
-static PyObject *NMesh_getMaterials( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nm = ( BPy_NMesh * ) self;
- PyObject *list = NULL;
- Mesh *me = nm->mesh;
- int all = -1;
-
- if( !PyArg_ParseTuple( args, "|i", &all ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int (bool) as argument" );
-
- if( all >= 0 ) {
- if (!me)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "meshes obtained with GetRawFromObject don't support this option");
-
- list = EXPP_PyList_fromMaterialList( me->mat, me->totcol,
- all );
- Py_DECREF( nm->materials ); /* update nmesh.materials attribute */
- nm->materials = EXPP_incr_ret( list );
- } else
- list = EXPP_incr_ret( nm->materials );
-
- return list;
-}
-
-static PyObject *NMesh_setMaterials( PyObject * self, PyObject * args )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
- PyObject *pymats = NULL;
-
- if( !PyArg_ParseTuple( args, "O!", &PyList_Type, &pymats ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of materials (None's also accepted) as argument" );
-
- if( !EXPP_check_sequence_consistency( pymats, &Material_Type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "list should only contain materials (None's also accepted)" );
-
- if( PyList_Size( pymats ) > 16 )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "list can't have more than 16 materials" );
-
- Py_DECREF( me->materials );
- me->materials = EXPP_incr_ret( pymats );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_addMaterial( PyObject * self, PyObject * args )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
- BPy_Material *pymat;
- Material *mat;
- PyObject *iter;
- int i, len = 0;
-
- if( !PyArg_ParseTuple( args, "O!", &Material_Type, &pymat ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Blender Material PyObject" );
-
- mat = pymat->material;
- len = PyList_Size( me->materials );
-
- if( len >= 16 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "object data material lists can't have more than 16 materials" );
-
- for( i = 0; i < len; i++ ) {
- iter = PyList_GetItem( me->materials, i );
- if( mat == Material_FromPyObject( iter ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "material already in the list" );
- }
-
- PyList_Append( me->materials, ( PyObject * ) pymat );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getKey( BPy_NMesh * self )
-{
- PyObject *keyobj;
-
- if( self->mesh->key )
- keyobj = Key_CreatePyObject(self->mesh->key);
- else
- keyobj = EXPP_incr_ret(Py_None);
-
- return keyobj;
-}
-
-static PyObject *NMesh_removeAllKeys( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nm = ( BPy_NMesh * ) self;
- Mesh *me = nm->mesh;
-
- if( !PyArg_ParseTuple( args, "" ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "this function expects no arguments" );
-
- if( !me || !me->key )
- return EXPP_incr_ret_False();
-
- me->key->id.us--;
- me->key = 0;
-
- return EXPP_incr_ret_True();
-}
-
-static PyObject *NMesh_insertKey( PyObject * self, PyObject * args )
-{
- int fra = -1, oldfra = -1;
- char *type = NULL;
- short typenum;
- BPy_NMesh *nm = ( BPy_NMesh * ) self;
- Mesh *mesh = nm->mesh;
-
- if( !PyArg_ParseTuple( args, "|is", &fra, &type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int and optionally a string as arguments" );
-
- if( !type || !strcmp( type, "relative" ) )
- typenum = 1;
- else if( !strcmp( type, "absolute" ) )
- typenum = 2;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "if given, type should be 'relative' or 'absolute'" );
-
- if( fra > 0 ) {
- fra = EXPP_ClampInt( fra, 1, NMESH_FRAME_MAX );
- oldfra = G.scene->r.cfra;
- G.scene->r.cfra = (int)fra;
- }
-
- if( !mesh )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "update this NMesh first with its .update() method" );
-
- insert_meshkey( mesh, typenum );
- allspace(REMAKEIPO, 0);
-
- if( fra > 0 )
- G.scene->r.cfra = (int)oldfra;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getSelectedFaces( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nm = ( BPy_NMesh * ) self;
- Mesh *me = nm->mesh;
- int i, totfaces, flag = 0;
- PyObject *l, *pyval;
-
- if( !PyArg_ParseTuple( args, "|i", &flag ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected int argument (or nothing)" );
-
- l = PyList_New( 0 );
- if( me == NULL || me->mface == NULL)
- return l;
-
- /* make sure not to write more faces then we have */
- totfaces= MIN2(me->totface, PySequence_Length(nm->faces));
-
- if( flag ) {
- for( i = 0; i < totfaces; i++ ) {
- if( me->mface[i].flag & ME_FACE_SEL ) {
- pyval = PyInt_FromLong( i );
- PyList_Append( l, pyval );
- Py_DECREF(pyval);
- }
- }
- } else {
- for( i = 0; i < totfaces; i++ ) {
- if( me->mface[i].flag & ME_FACE_SEL )
- PyList_Append( l, PyList_GetItem( nm->faces, i ) );
- }
- }
- return l;
-}
-
-static PyObject *NMesh_getActiveFace( PyObject * self )
-{
- if( ( ( BPy_NMesh * ) self )->sel_face < 0 )
- Py_RETURN_NONE;
-
- return Py_BuildValue( "i", ( ( BPy_NMesh * ) self )->sel_face );
-}
-
-static PyObject *NMesh_hasVertexUV( PyObject * self, PyObject * args )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
- int flag = -1;
-
- if( !PyArg_ParseTuple( args, "|i", &flag ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (or nothing)" );
-
- switch ( flag ) {
- case 0:
- me->flags &= ~NMESH_HASVERTUV;
- break;
- case 1:
- me->flags |= NMESH_HASVERTUV;
- break;
- default:
- break;
- }
-
- if( me->flags & NMESH_HASVERTUV )
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-static PyObject *NMesh_hasFaceUV( PyObject * self, PyObject * args )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
- int flag = -1;
-
- if( !PyArg_ParseTuple( args, "|i", &flag ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (or nothing)" );
-
- switch ( flag ) {
- case 0:
- me->flags &= ~NMESH_HASFACEUV;
- break;
- case 1:
- me->flags |= NMESH_HASFACEUV;
- break;
- default:
- break;
- }
-
- if( me->flags & NMESH_HASFACEUV )
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-static PyObject *NMesh_hasVertexColours( PyObject * self, PyObject * args )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
- int flag = -1;
-
- if( !PyArg_ParseTuple( args, "|i", &flag ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (or nothing)" );
-
- switch ( flag ) {
- case 0:
- me->flags &= ~NMESH_HASMCOL;
- break;
- case 1:
- me->flags |= NMESH_HASMCOL;
- break;
- default:
- break;
- }
-
- if( me->flags & NMESH_HASMCOL )
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-static PyObject *NMesh_update( PyObject *self, PyObject *a, PyObject *kwd )
-{
- BPy_NMesh *nmesh = ( BPy_NMesh * ) self;
- Mesh *mesh = nmesh->mesh;
- int recalc_normals = 0, store_edges = 0, vertex_shade = 0;
- static char *kwlist[] = {"recalc_normals", "store_edges",
- "vertex_shade", NULL};
- int needs_redraw = 1;
- int old_totvert = 0;
-
- if (!PyArg_ParseTupleAndKeywords(a, kwd, "|iii", kwlist, &recalc_normals,
- &store_edges, &vertex_shade ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected nothing or one to three bool(s) (0 or 1) as argument" );
-
- if( check_NMeshLists( nmesh ) )
- return NULL;
-
- if( mesh ) {
- old_totvert = mesh->totvert;
- unlink_existingMeshData( mesh );
- if( !convert_NMeshToMesh( mesh, nmesh ) )
- return NULL;
- if (mesh->dvert) check_dverts(mesh, old_totvert);
- } else {
- mesh = Mesh_fromNMesh( nmesh );
- /* if mesh is NULL, there was an error */
- if( !mesh )
- return NULL;
- nmesh->mesh = mesh;
- }
-
- if( recalc_normals )
- mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL);
-
- mesh_update( mesh, nmesh->object );
-
- nmesh_updateMaterials( nmesh );
-
- if( nmesh->name && nmesh->name != Py_None )
- new_id( &( G.main->mesh ), &mesh->id,
- PyString_AsString( nmesh->name ) );
-
- if (vertex_shade) {
- Base *base = FIRSTBASE;
-
- if (!nmesh->object)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "link this mesh to an object first with ob.link(mesh)" );
-
- if (G.obedit)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "can't shade vertices while in edit mode" );
-
- while (base) {
- if (base->object == nmesh->object) {
- base->flag |= SELECT;
- nmesh->object->flag = (short)base->flag;
- set_active_base (base);
- needs_redraw = 0; /* already done in make_vertexcol */
- break;
- }
- base = base->next;
- }
-
- /* recalculate the derived mesh before trying to use it */
- makeDerivedMesh(nmesh->object, CD_MASK_BAREMESH);
- make_vertexcol(1);
-
- countall();
- }
-
- if( !during_script( ) && needs_redraw)
- EXPP_allqueue( REDRAWVIEW3D, 0 );
-
- return PyInt_FromLong( 1 );
-}
-
-/** Implementation of the python method getVertexInfluence for an NMesh object.
- * This method returns a list of pairs (string,float) with bone names and
- * influences that this vertex receives.
- * @author Jordi Rovira i Bonet
- */
-
-static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
-{
- int index;
- PyObject *influence_list = NULL;
- Object *object = ( ( BPy_NMesh * ) self )->object;
- Mesh *me = ( ( BPy_NMesh * ) self )->mesh;
-
- /* Get a reference to the mesh object wrapped in here. */
- if( !me )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "unlinked nmesh: call its .update() method first" );
-
- if( !object )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- /* Parse the parameters: only on integer (vertex index) */
- if( !PyArg_ParseTuple( args, "i", &index ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument (index of the vertex)" );
-
- /* check for valid index */
- if( index < 0 || index >= me->totvert )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "vertex index out of range" );
-
- influence_list = PyList_New( 0 );
-
- /* Proceed only if we have vertex deformation information */
- if( me->dvert ) {
- int i;
- MDeformWeight *sweight = NULL;
-
- /* Number of bones influencing the vertex */
- int totinfluences = me->dvert[index].totweight;
-
- /* Get the reference of the first weight structure */
- sweight = me->dvert[index].dw;
-
- /* Build the list only with weights and names of the influent bones */
- for( i = 0; i < totinfluences; i++, sweight++ ) {
- bDeformGroup *defgroup = (bDeformGroup *) BLI_findlink( &object->defbase,
- sweight->def_nr );
- if( defgroup )
- PyList_Append( influence_list, Py_BuildValue( "[sf]",
- defgroup->name, sweight->weight ) );
- }
- }
-
- return influence_list;
-}
-
-Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh )
-{
- Mesh *mesh = NULL;
-
- mesh = add_mesh( "Mesh" );
-
- if( !mesh ) {
- PyErr_SetString( PyExc_RuntimeError,
- "FATAL: could not create mesh object" );
- return NULL;
- }
-
- mesh->id.us = 0; /* no user yet */
- G.totmesh++;
-
- if( !convert_NMeshToMesh( mesh, nmesh ) )
- return NULL;
-
- return mesh;
-}
-
-static PyObject *NMesh_getMaxSmoothAngle( BPy_NMesh * self )
-{
- return PyInt_FromLong( self->smoothresh );
-}
-
-static PyObject *NMesh_setMaxSmoothAngle( PyObject * self, PyObject * args )
-{
- short value = 0;
- BPy_NMesh *nmesh = ( BPy_NMesh * ) self;
-
- if( !PyArg_ParseTuple( args, "h", &value ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected an int in [1, 80] as argument" );
-
- nmesh->smoothresh =
- ( short ) EXPP_ClampInt( value, NMESH_SMOOTHRESH_MIN,
- NMESH_SMOOTHRESH_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getSubDivLevels( BPy_NMesh * self )
-{
- return Py_BuildValue( "[h,h]", self->subdiv[0], self->subdiv[1] );
-}
-
-static PyObject *NMesh_setSubDivLevels( PyObject * self, PyObject * args )
-{
- short display = 0, render = 0;
- BPy_NMesh *nmesh = ( BPy_NMesh * ) self;
-
- if( !PyArg_ParseTuple( args, "(hh)", &display, &render ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a sequence [int, int] as argument" );
-
- nmesh->subdiv[0] =
- ( short ) EXPP_ClampInt( display, NMESH_SUBDIV_MIN,
- NMESH_SUBDIV_MAX );
-
- nmesh->subdiv[1] =
- ( short ) EXPP_ClampInt( render, NMESH_SUBDIV_MIN,
- NMESH_SUBDIV_MAX );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getMode( BPy_NMesh * self )
-{
- return PyInt_FromLong( self->mode );
-}
-
-static PyObject *NMesh_setMode( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nmesh = ( BPy_NMesh * ) self;
- PyObject *arg1 = NULL;
- char *m[5] = { NULL, NULL, NULL, NULL, NULL };
- short i, mode = 0;
-
- if( !PyArg_ParseTuple ( args, "|Ossss", &arg1, &m[1], &m[2], &m[3], &m[4] ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected an int or from none to 5 strings as argument(s)" );
-
- if (arg1) {
- if (PyInt_Check(arg1)) {
- mode = (short)PyInt_AsLong(arg1);
- }
- else if (PyString_Check(arg1)) {
- m[0] = PyString_AsString(arg1);
- for( i = 0; i < 5; i++ ) {
- if( !m[i] ) break;
- else if( strcmp( m[i], "NoVNormalsFlip" ) == 0 )
- mode |= ME_NOPUNOFLIP;
- else if( strcmp( m[i], "TwoSided" ) == 0 )
- mode |= ME_TWOSIDED;
- else if( strcmp( m[i], "AutoSmooth" ) == 0 )
- mode |= ME_AUTOSMOOTH;
- else if( m[i][0] == '\0' )
- mode = 0;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown NMesh mode" );
- }
- }
- else return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected an int or from none to 5 strings as argument(s)" );
- }
-
- nmesh->mode = mode;
-
- Py_RETURN_NONE;
-}
-
-/* METH_VARARGS: function(PyObject *self, PyObject *args) */
-#undef MethodDef
-#define MethodDef(func) {#func, NMesh_##func, METH_VARARGS, NMesh_##func##_doc}
-
-static struct PyMethodDef NMesh_methods[] = {
- MethodDef( addEdge ),
- MethodDef( findEdge ),
- MethodDef( removeEdge ),
- MethodDef( addFace ),
- MethodDef( removeFace ),
- MethodDef( addVertGroup ),
- MethodDef( removeVertGroup ),
- MethodDef( assignVertsToGroup ),
- MethodDef( removeVertsFromGroup ),
- MethodDef( getVertsFromGroup ),
- MethodDef( renameVertGroup ),
- MethodDef( hasVertexColours ),
- MethodDef( hasFaceUV ),
- MethodDef( hasVertexUV ),
- MethodDef( getSelectedFaces ),
- MethodDef( getVertexInfluences ),
- MethodDef( getMaterials ),
- MethodDef( setMaterials ),
- MethodDef( addMaterial ),
- MethodDef( insertKey ),
- MethodDef( removeAllKeys ),
- MethodDef( setMode ),
- MethodDef( setMaxSmoothAngle ),
- MethodDef( setSubDivLevels ),
- MethodDef( transform ),
-
-/* METH_NOARGS: function(PyObject *self) */
-#undef MethodDef
-#define MethodDef(func) {#func, (PyCFunction)NMesh_##func, METH_NOARGS,\
- NMesh_##func##_doc}
-
- MethodDef( printDebug ),
- MethodDef( getVertGroupNames ),
- MethodDef( getActiveFace ),
- MethodDef( getKey ),
- MethodDef( getMode ),
- MethodDef( getMaxSmoothAngle ),
- MethodDef( getSubDivLevels ),
-
-/* METH_VARARGS | METH_KEYWORDS:
- * function(PyObject *self, PyObject *args, PyObject *keywords) */
-#undef MethodDef
-#define MethodDef(func) {#func, (PyCFunction)NMesh_##func,\
- METH_VARARGS | METH_KEYWORDS, NMesh_##func##_doc}
-
- MethodDef( update ),
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *NMesh_getattr( PyObject * self, char *name )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
-
- if( strcmp( name, "name" ) == 0 )
- return EXPP_incr_ret( me->name );
-
- else if ( strcmp( name, "properties" ) == 0 )
- return BPy_Wrap_IDProperty( (ID*)me->mesh, IDP_GetProperties((ID*)me->mesh, 1), NULL );
-
- else if( strcmp( name, "mode" ) == 0 )
- return PyInt_FromLong( me->mode );
-
- else if( strcmp( name, "block_type" ) == 0 ) /* for compatibility */
- return PyString_FromString( "NMesh" );
-
- else if( strcmp( name, "materials" ) == 0 )
- return EXPP_incr_ret( me->materials );
-
- else if( strcmp( name, "verts" ) == 0 )
- return EXPP_incr_ret( me->verts );
-
- else if( strcmp( name, "maxSmoothAngle" ) == 0 )
- return PyInt_FromLong( me->smoothresh );
-
- else if( strcmp( name, "subDivLevels" ) == 0 )
- return Py_BuildValue( "[h,h]", me->subdiv[0], me->subdiv[1] );
-
- else if( strcmp( name, "users" ) == 0 ) {
- if( me->mesh ) {
- return PyInt_FromLong( me->mesh->id.us );
- } else { /* it's a free mesh: */
- return Py_BuildValue( "i", 0 );
- }
- }
- else if (strcmp( name, "key") == 0)
- return NMesh_getKey((BPy_NMesh*)self);
-
- else if( strcmp( name, "faces" ) == 0 )
- return EXPP_incr_ret( me->faces );
-
- else if( strcmp( name, "edges" ) == 0 )
- {
- return EXPP_incr_ret( me->edges );
- }
- else if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s,s]",
- "name", "materials", "verts", "users",
- "faces", "maxSmoothAngle",
- "subdivLevels", "edges", "key" );
-
- return Py_FindMethod( NMesh_methods, ( PyObject * ) self, name );
-}
-
-static int NMesh_setattr( PyObject * self, char *name, PyObject * v )
-{
- BPy_NMesh *me = ( BPy_NMesh * ) self;
-
- if( !strcmp( name, "name" ) ) {
-
- if( !PyString_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- Py_DECREF( me->name );
- me->name = EXPP_incr_ret( v );
- }
-
- else if( !strcmp( name, "mode" ) ) {
- short mode;
-
- if( !PyInt_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- mode = ( short ) PyInt_AsLong( v );
- if( mode >= 0 )
- me->mode = mode;
- else
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected positive int argument" );
- }
-
- else if( !strcmp( name, "verts" ) || !strcmp( name, "faces" ) ||
- !strcmp( name, "materials" ) ) {
-
- if( PySequence_Check( v ) ) {
-
- if( strcmp( name, "materials" ) == 0 ) {
- Py_DECREF( me->materials );
- me->materials = EXPP_incr_ret( v );
- } else if( strcmp( name, "verts" ) == 0 ) {
- Py_DECREF( me->verts );
- me->verts = EXPP_incr_ret( v );
- } else {
- Py_DECREF( me->faces );
- me->faces = EXPP_incr_ret( v );
- }
- }
-
- else
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list" );
- }
-
- else if( !strcmp( name, "maxSmoothAngle" ) ) {
- short smoothresh = 0;
-
- if( !PyInt_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- smoothresh = ( short ) PyInt_AsLong( v );
-
- me->smoothresh =
- (short)EXPP_ClampInt( smoothresh, NMESH_SMOOTHRESH_MIN,
- NMESH_SMOOTHRESH_MAX );
- }
-
- else if( !strcmp( name, "subDivLevels" ) ) {
- int subdiv[2] = { 0, 0 };
- int i;
- PyObject *tmp;
-
- if( !PySequence_Check( v ) || ( PySequence_Length( v ) != 2 ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list [int, int] as argument" );
-
- for( i = 0; i < 2; i++ ) {
- tmp = PySequence_GetItem( v, i );
- if( tmp ) {
- if( !PyInt_Check( tmp ) ) {
- Py_DECREF( tmp );
- return EXPP_ReturnIntError
- ( PyExc_TypeError,
- "expected a list [int, int] as argument" );
- }
-
- subdiv[i] = PyInt_AsLong( tmp );
- me->subdiv[i] =
- ( short ) EXPP_ClampInt( subdiv[i],
- NMESH_SUBDIV_MIN,
- NMESH_SUBDIV_MAX );
- Py_DECREF( tmp );
- } else
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "couldn't retrieve subdiv values from list" );
- }
- }
- else if( strcmp( name, "edges" ) == 0 )
- {
- if (PySequence_Check(v))
- {
- Py_DECREF(me->edges);
- me->edges = EXPP_incr_ret( v );
- }
- }
- else
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-
- return 0;
-}
-
-PyTypeObject NMesh_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /*ob_size */
- "Blender NMesh", /*tp_name */
- sizeof( BPy_NMesh ), /*tp_basicsize */
- 0, /*tp_itemsize */
- /* methods */
- ( destructor ) NMesh_dealloc, /*tp_dealloc */
- ( printfunc ) 0, /*tp_print */
- ( getattrfunc ) NMesh_getattr, /*tp_getattr */
- ( setattrfunc ) NMesh_setattr, /*tp_setattr */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-static BPy_NMFace *nmface_from_data( BPy_NMesh * mesh, int vidxs[4],
- char mat_nr, char flag, MTFace * tface, MCol * col, int orig_index )
-{
- BPy_NMFace *newf = PyObject_NEW( BPy_NMFace, &NMFace_Type );
- int i, len;
-
- if( vidxs[3] )
- len = 4;
- else
- len = 3;
-
- newf->v = PyList_New( len );
-
- for( i = 0; i < len; i++ )
- PyList_SetItem( newf->v, i,
- EXPP_incr_ret( PyList_GetItem
- ( mesh->verts, vidxs[i] ) ) );
-
- if( tface ) {
- newf->uv = PyList_New( len ); // per-face UV coordinates
-
- for( i = 0; i < len; i++ ) {
- PyList_SetItem( newf->uv, i,
- Py_BuildValue( "(ff)", tface->uv[i][0],
- tface->uv[i][1] ) );
- }
-
- if( tface->tpage ) /* pointer to image per face: */
- newf->image = ( Image * ) tface->tpage;
- else
- newf->image = NULL;
-
- newf->mode = tface->mode; /* draw mode */
- newf->flag = tface->flag; /* select flag */
- newf->transp = tface->transp; /* transparency flag */
- } else {
- newf->mode = TF_DYNAMIC; /* just to initialize it to something meaninful, */
- /* since without tfaces there are no tface->mode's, obviously. */
- newf->image = NULL;
- newf->uv = PyList_New( 0 );
- }
-
- newf->mat_nr = mat_nr;
- newf->mf_flag = flag; /* MFace flag */
- newf->orig_index = orig_index;
-
- if( col ) {
- newf->col = PyList_New( 4 );
- for( i = 0; i < 4; i++, col++ ) {
- PyList_SetItem( newf->col, i,
- ( PyObject * ) newcol( col->b, col->g,
- col->r,
- col->a ) );
- }
- } else
- newf->col = PyList_New( 0 );
-
- return newf;
-}
-
-static BPy_NMEdge *nmedge_from_index( BPy_NMesh * mesh, int v0idx, int v1idx)
-{
- BPy_NMVert *v1=(BPy_NMVert *)PyList_GetItem( mesh->verts, v0idx);
- BPy_NMVert *v2=(BPy_NMVert *)PyList_GetItem( mesh->verts, v1idx);
- return new_NMEdge(v1, v2, (char)0.0, 0);
-}
-
-static BPy_NMEdge *nmedge_from_data( BPy_NMesh * mesh, MEdge *edge )
-{
- BPy_NMVert *v1=(BPy_NMVert *)PyList_GetItem( mesh->verts, edge->v1 );
- BPy_NMVert *v2=(BPy_NMVert *)PyList_GetItem( mesh->verts, edge->v2 );
- return new_NMEdge(v1, v2, edge->crease, edge->flag);
-}
-
-static BPy_NMVert *nmvert_from_data( MVert * vert, MSticky * st, float *co,
- int idx, char flag )
-{
- BPy_NMVert *mv = PyObject_NEW( BPy_NMVert, &NMVert_Type );
-
- mv->co[0] = co[0];
- mv->co[1] = co[1];
- mv->co[2] = co[2];
-
- mv->no[0] = (float)(vert->no[0] / 32767.0);
- mv->no[1] = (float)(vert->no[1] / 32767.0);
- mv->no[2] = (float)(vert->no[2] / 32767.0);
-
- if( st ) {
- mv->uvco[0] = st->co[0];
- mv->uvco[1] = st->co[1];
- mv->uvco[2] = 0.0;
-
- } else
- mv->uvco[0] = mv->uvco[1] = mv->uvco[2] = 0.0;
-
- mv->index = idx;
- mv->flag = flag & 1;
-
- return mv;
-}
-
-static int get_active_faceindex( Mesh * me )
-{
- if( me == NULL )
- return -1;
-
- if (me->act_face != -1 && me->act_face < me->totface)
- return me->act_face;
- return -1;
-}
-
-static BPy_NMVert *nmvert_from_float(float *co, float *no, int idx) {
- BPy_NMVert *mv;
-
- mv = PyObject_NEW( BPy_NMVert, &NMVert_Type );
-
- mv->index = idx;
-
- mv->co[0] = co[0];
- mv->co[1] = co[1];
- mv->co[2] = co[2];
-
- mv->no[0] = no[0];
- mv->no[1] = no[1];
- mv->no[2] = no[2];
-
- mv->uvco[0] = mv->uvco[1] = mv->uvco[2] = 0.0;
-
- mv->flag = 0;
-
- return mv;
-}
-
-static BPy_NMFace *nmface_from_index( BPy_NMesh * mesh, int vidxs[4], char mat_nr )
-{
- BPy_NMFace *newf = PyObject_NEW( BPy_NMFace, &NMFace_Type );
- int i, len;
-
- if( vidxs[3] )
- len = 4;
- else if( vidxs[2] )
- len = 3;
- else
- len = 2;
-
- newf->v = PyList_New( len );
-
- for( i = 0; i < len; i++ )
- PyList_SetItem( newf->v, i,
- EXPP_incr_ret( PyList_GetItem
- ( mesh->verts, vidxs[i] ) ) );
-
- newf->mode = TF_DYNAMIC; /* just to initialize it to something meaninful, */
- /* since without tfaces there are no tface->mode's, obviously. */
- newf->image = NULL;
- newf->uv = PyList_New( 0 );
-
- newf->mat_nr = mat_nr;
- newf->mf_flag = 0;
- newf->orig_index = -1;
-
- newf->col = PyList_New( 0 );
-
- return newf;
-}
-
-/* RATHER EVIL FUNCTION BORROWED FROM fix_faceindices IN editmesh.c */
-static void correctFaceIndex(int vidx[4])
-{
- if (vidx[3]) {
- if (vidx[1] == 0) {
- vidx[1] = vidx[2];
- vidx[2] = vidx[3];
- vidx[3] = vidx[0];
- vidx[0] = 0;
- }
- if (vidx[2] == 0) {
- int t = vidx[1];
- vidx[2] = vidx[0];
- vidx[1] = vidx[3];
- vidx[3] = t;
- vidx[0] = 0;
- }
- if (vidx[3] == 0) {
- vidx[3] = vidx[2];
- vidx[2] = vidx[1];
- vidx[1] = vidx[0];
- vidx[0] = 0;
- }
- }
- else if (vidx[1] == 0) {
- vidx[1] = vidx[2];
- vidx[2] = vidx[0];
- vidx[0] = 0;
- }
- else if (vidx[2] == 0) {
- vidx[2] = vidx[1];
- vidx[1] = vidx[0];
- vidx[0] = 0;
- }
-}
-
-/*
- CREATES A NMESH FROM DISPLIST DATA. INSPIRED BY THE FUNCTIONS CALLED WHEN
- CONVERTING OBJECTS TO MESH.
- */
-static PyObject *new_NMesh_displist(ListBase *lb, Object *ob)
-{
- BPy_NMesh *me;
- DispList *dl;
- float *data, *ndata;
- float normal[3] = {1, 0, 0};
- int vidx[4];
- int parts, p1, p2, p3, p4, a, b, one_normal=0, ioffset=0;
- int *index;
-
- /* Note: This routine does not create new edges for the faces
- * it adds... should be fixed for consistency.
- */
-
- if (ob->type == OB_CURVE || ob->type == OB_FONT)
- one_normal = 1;
-
- me = PyObject_NEW( BPy_NMesh, &NMesh_Type );
- me->name = EXPP_incr_ret( Py_None );
- me->flags = 0;
- me->mode = ME_TWOSIDED; /* default for new meshes */
- me->subdiv[0] = NMESH_SUBDIV;
- me->subdiv[1] = NMESH_SUBDIV;
- me->smoothresh = NMESH_SMOOTHRESH;
- me->edges = PyList_New( 0 );
-
- me->object = ob;
- me->materials = EXPP_PyList_fromMaterialList( ob->mat, ob->totcol, 0 );
-
- me->verts = PyList_New( 0 );
- me->faces = PyList_New( 0 );
-
- memset(&me->fdata, 0, sizeof(me->fdata));
- me->totfdata = 0;
-
- dl= lb->first;
- while(dl) {
- parts= dl->parts;
- index= dl->index;
- data= dl->verts;
- ndata= dl->nors;
-
- switch(dl->type) {
- case DL_SEGM:
- for(a=0; a<dl->parts*dl->nr; a++, data+=3) {
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, normal, a));
- }
-
- vidx[2] = vidx[3] = 0;
-
- for(a=0; a<dl->parts; a++) {
- for(b=1; b<dl->nr; b++) {
- int v0 = ioffset + a * dl->nr + b-1;
- int v1 = ioffset + a * dl->nr + b;
- PyList_Append(me->edges, ( PyObject * ) nmedge_from_index(me, v0, v1));
- }
- }
- ioffset += dl->parts * dl->nr;
- break;
- case DL_POLY:
- for(a=0; a<dl->parts*dl->nr; a++, data+=3) {
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, normal, a));
- }
-
- vidx[2] = vidx[3] = 0;
-
- for(a=0; a<dl->parts; a++) {
- for(b=0; b<dl->nr; b++) {
- int v1, v0 = ioffset + a * dl->nr + b;
- if(b==dl->nr-1) v1 = ioffset + a * dl->nr;
- else v1= ioffset + a * dl->nr + b+1;
- PyList_Append(me->edges, ( PyObject * ) nmedge_from_index(me, v0, v1));
- }
- }
- ioffset += dl->parts * dl->nr;
- break;
- case DL_SURF:
- for(a=0; a<dl->parts*dl->nr; a++, data+=3, ndata+=3) {
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, ndata, a));
- }
-
- for(a=0; a<dl->parts; a++) {
-
- if (surfindex_displist(dl, a, &b, &p1, &p2, &p3, &p4)==0)
- break;
-
- for(; b<dl->nr; b++) {
- vidx[0] = p2 + ioffset;
- vidx[1] = p1 + ioffset;
- vidx[2] = p3 + ioffset;
- vidx[3] = p4 + ioffset;
- correctFaceIndex(vidx);
-
- PyList_Append(me->faces, ( PyObject * ) nmface_from_index(me, vidx, (char)dl->col));
-
- p2 = p1;
- p4 = p3;
- p1++;
- p3++;
- }
- }
- ioffset += dl->parts * dl->nr;
- break;
-
- case DL_INDEX3:
- if (one_normal)
- for(a=0; a<dl->nr; a++, data+=3)
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, ndata, a));
- else
- for(a=0; a<dl->nr; a++, data+=3, ndata+=3)
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, ndata, a));
-
- while(parts--) {
- vidx[0] = index[0] + ioffset;
- vidx[1] = index[1] + ioffset;
- vidx[2] = index[2] + ioffset;
- vidx[3] = 0;
- correctFaceIndex(vidx);
-
- PyList_Append(me->faces, ( PyObject * ) nmface_from_index(me, vidx, (char)dl->col));
- index+= 3;
- }
- ioffset += dl->nr;
-
- break;
-
- case DL_INDEX4:
- for(a=0; a<dl->nr; a++, data+=3, ndata+=3) {
- PyList_Append(me->verts, ( PyObject * ) nmvert_from_float(data, ndata, a));
- }
-
- while(parts--) {
- vidx[0] = index[0] + ioffset;
- vidx[1] = index[1] + ioffset;
- vidx[2] = index[2] + ioffset;
- vidx[3] = index[3] + ioffset;
- correctFaceIndex(vidx);
-
- PyList_Append(me->faces, ( PyObject * ) nmface_from_index(me, vidx, (char)dl->col));
- index+= 4;
- }
- ioffset += dl->nr;
- break;
- }
- dl= dl->next;
- }
-
- return ( PyObject * ) me;
-}
-
-static PyObject *new_NMesh_internal( Mesh * oldmesh,
- DerivedMesh *dm )
-{
- BPy_NMesh *me = PyObject_NEW( BPy_NMesh, &NMesh_Type );
- me->flags = 0;
- me->mode = ME_TWOSIDED; /* default for new meshes */
- me->subdiv[0] = NMESH_SUBDIV;
- me->subdiv[1] = NMESH_SUBDIV;
- me->smoothresh = NMESH_SMOOTHRESH;
-
- me->object = NULL; /* not linked to any object yet */
-
- if( !oldmesh ) {
- me->name = EXPP_incr_ret( Py_None );
- me->materials = PyList_New( 0 );
- me->verts = PyList_New( 0 );
- me->edges = PyList_New( 0 );
- me->faces = PyList_New( 0 );
- me->mesh = 0;
- memset(&me->fdata, 0, sizeof(me->fdata));
- me->totfdata = 0;
- } else {
- MVert *mverts;
- MSticky *msticky;
- MFace *mfaces;
- MTFace *tfaces;
- MCol *mcols;
- MEdge *medges;
- CustomData *fdata;
- int i, totvert, totface, totedge;
-
- me->name = PyString_FromString( oldmesh->id.name + 2 );
- me->mesh = oldmesh;
- me->mode = oldmesh->flag; /* yes, we save the mesh flags in nmesh->mode */
- me->subdiv[0] = oldmesh->subdiv;
- me->subdiv[1] = oldmesh->subdivr;
- me->smoothresh = oldmesh->smoothresh;
-
- me->sel_face = get_active_faceindex( oldmesh );
-
- if( dm ) {
- msticky = NULL;
- mverts = dm->getVertArray(dm);
- mfaces = dm->getFaceArray(dm);
- tfaces = dm->getFaceDataArray(dm, CD_MTFACE);
- mcols = dm->getFaceDataArray(dm, CD_MCOL);
- medges = dm->getEdgeArray(dm);
- fdata = &dm->faceData;
-
- totvert = dm->getNumVerts(dm);
- totedge = dm->getNumEdges(dm);
- totface = dm->getNumFaces(dm);;
- } else {
- msticky = oldmesh->msticky;
- mverts = oldmesh->mvert;
- mfaces = oldmesh->mface;
- tfaces = oldmesh->mtface;
- mcols = oldmesh->mcol;
- medges = oldmesh->medge;
- fdata = &oldmesh->fdata;
-
- totvert = oldmesh->totvert;
- totface = oldmesh->totface;
- totedge = oldmesh->totedge;
- }
-
- /* copy non active mcol and mtface layers, these can't be edited
- but will be preserved */
- CustomData_copy( fdata, &me->fdata, CD_MASK_MCOL|CD_MASK_MTFACE,
- CD_DUPLICATE, totface );
- me->totfdata = totface;
-
- if( msticky )
- me->flags |= NMESH_HASVERTUV;
- if( tfaces )
- me->flags |= NMESH_HASFACEUV;
- if( mcols )
- me->flags |= NMESH_HASMCOL;
-
- me->verts = PyList_New( totvert );
-
- for( i = 0; i < totvert; i++ ) {
- MVert *oldmv = &mverts[i];
- MSticky *oldst = msticky ? &msticky[i] : NULL;
-
- PyList_SetItem( me->verts, i,
- ( PyObject * ) nmvert_from_data( oldmv,
- oldst,
- oldmv->co,
- i,
- oldmv->flag ) );
- }
-
- me->faces = PyList_New( totface );
- for( i = 0; i < totface; i++ ) {
- MTFace *oldtf = tfaces ? &tfaces[i] : NULL;
- MCol *oldmc = mcols ? &mcols[i * 4] : NULL;
- MFace *oldmf = &mfaces[i];
- int vidxs[4];
- vidxs[0] = oldmf->v1;
- vidxs[1] = oldmf->v2;
- vidxs[2] = oldmf->v3;
- vidxs[3] = oldmf->v4;
-
- PyList_SetItem( me->faces, i,
- ( PyObject * ) nmface_from_data( me,
- vidxs,
- oldmf->
- mat_nr,
- oldmf->
- flag,
- oldtf,
- oldmc,
- i) );
- }
-
- me->edges = PyList_New( totedge );
- for( i = 0; i < totedge; i++ )
- {
- MEdge *edge = &medges[i];
- PyList_SetItem( me->edges, i, (PyObject*)nmedge_from_data ( me, edge ) );
- }
-
- me->materials = EXPP_PyList_fromMaterialList( oldmesh->mat, oldmesh->totcol, 0 );
- }
-
- return ( PyObject * ) me;
-}
-
-PyObject *new_NMesh( Mesh * oldmesh )
-{
- return new_NMesh_internal( oldmesh, NULL );
-}
-
-static PyObject *M_NMesh_New( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- PyObject *ret = NULL;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or a string as argument" );
-
- ret = new_NMesh( NULL );
-
- if( ret && name ) {
- BPy_NMesh *nmesh = ( BPy_NMesh * ) ret;
- Py_DECREF( nmesh->name );
- nmesh->name = PyString_FromString( name );
- }
-
- return ret;
-}
-
-static PyObject *M_NMesh_GetRaw( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Mesh *oldmesh = NULL;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" );
-
- if( name ) {
- oldmesh = ( Mesh * ) GetIdFromList( &( G.main->mesh ), name );
-
- if( !oldmesh )
- return EXPP_incr_ret( Py_None );
- }
-
- return new_NMesh( oldmesh );
-}
-
-static PyObject *M_NMesh_GetNames(PyObject *self)
-{
- PyObject *names = PyList_New(0), *tmpstr;
- Mesh *me = G.main->mesh.first;
-
- while (me) {
- tmpstr = PyString_FromString(me->id.name+2);
- PyList_Append(names, tmpstr);
- Py_DECREF(tmpstr);
- me = me->id.next;
- }
-
- return names;
-}
-
-/* Note: NMesh.GetRawFromObject gets the display list mesh from Blender:
- * the vertices are already transformed / deformed. */
-static PyObject *M_NMesh_GetRawFromObject( PyObject * self, PyObject * args )
-{
- Object *ob;
- PyObject *nmesh;
- ListBase *lb=0;
- DispList *dl;
- char *name;
-
- if( !PyArg_ParseTuple( args, "s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- ob = ( Object * ) GetIdFromList( &( G.main->object ), name );
-
- if( !ob )
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-
-
- switch (ob->type) {
- case OB_MBALL:
- if( is_basis_mball(ob)) {
- lb= &ob->disp;
- if(lb->first==0) makeDispListMBall(ob);
- nmesh = new_NMesh_displist(lb, ob);
- }
- else {
- return EXPP_ReturnPyObjError( PyExc_AttributeError, "Object does not have geometry data" );
- }
- break;
- case OB_FONT:
- case OB_CURVE:
- {
- Curve *cu= ob->data;
-
- lb= &cu->disp;
- if(lb->first==0) makeDispListCurveTypes(ob, 0);
-
- dl= lb->first;
- if(dl==0)
- return EXPP_ReturnPyObjError( PyExc_AttributeError, "Object does not have geometry data" );
-
- if(dl->nors==0) addnormalsDispList(ob, lb);
-
- nmesh = new_NMesh_displist(lb, ob);
- }
- break;
- case OB_SURF:
-
- lb= &((Curve *)ob->data)->disp;
- if(lb->first==0) makeDispListCurveTypes(ob, 0);
-
- dl= lb->first;
- if(dl==0)
- return EXPP_ReturnPyObjError( PyExc_AttributeError, "Object does not have geometry data" );
-
- if(dl->nors==0) addnormalsDispList(ob, lb);
- nmesh = new_NMesh_displist(lb, ob);
-
- break;
- case OB_MESH:
- {
- CustomDataMask dataMask = CD_MASK_BAREMESH | CD_MASK_MTFACE
- | CD_MASK_MCOL;
- DerivedMesh *dm = mesh_create_derived_render( ob, dataMask );
- nmesh = new_NMesh_internal( ob->data, dm );
- dm->release(dm);
- }
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_AttributeError, "Object does not have geometry data" );
- }
-
-/* @hack: to mark that (deformed) mesh is readonly, so the update function
- * will not try to write it. */
-
- ( ( BPy_NMesh * ) nmesh )->mesh = 0;
-
- return nmesh;
-}
-
-static void mvert_from_data( MVert * mv, MSticky * st, BPy_NMVert * from )
-{
- mv->co[0] = from->co[0];
- mv->co[1] = from->co[1];
- mv->co[2] = from->co[2];
-
- mv->no[0] = (short)(from->no[0] * 32767.0);
- mv->no[1] = (short)(from->no[1] * 32767.0);
- mv->no[2] = (short)(from->no[2] * 32767.0);
-
- mv->flag = ( from->flag & 1 );
- mv->mat_nr = 0;
-
- if( st ) {
- st->co[0] = from->uvco[0];
- st->co[1] = from->uvco[1];
- }
-}
-
-static int assignFaceUV( MTFace * tf, BPy_NMFace * nmface )
-{
- PyObject *fuv, *tmp;
- int i;
- int len;
-
- fuv = nmface->uv;
- /* if no UV info, allows things to proceed as normal */
- if( PySequence_Length( fuv ) == 0 ) {
- tf->uv[0][0] = 0.0f; tf->uv[0][1] = 1.0f;
- tf->uv[1][0] = 0.0f; tf->uv[1][1] = 0.0f;
- tf->uv[2][0] = 1.0f; tf->uv[2][1] = 0.0f;
- tf->uv[3][1] = 1.0f; tf->uv[3][1] = 1.0f;
- return 1;
- }
-
- /* if there are too many uv coordinates, only take the first 4 */
- len = PySequence_Length( fuv );
- if( len > 4 )
- len = 4;
-
- /* fuv = [(u_1, v_1), ... (u_n, v_n)] */
- for( i = 0; i < len; i++ ) {
- tmp = PySequence_GetItem( fuv, i ); /* stolen reference ! */
- if( !PyArg_ParseTuple
- ( tmp, "ff", &( tf->uv[i][0] ), &( tf->uv[i][1] ) ) ) {
- PyErr_SetString ( PyExc_TypeError,
- "expected tuple of two floats for uv" );
- Py_DECREF( tmp );
- return 0;
- }
- Py_DECREF( tmp );
- }
- if( nmface->image ) { /* image assigned ? */
- tf->tpage = ( void * ) nmface->image;
- } else
- tf->tpage = 0;
-
- tf->mode = nmface->mode; /* copy mode */
- tf->flag = (char)nmface->flag; /* copy flag */
- tf->transp = nmface->transp; /* copy transp flag */
-
- return 1;
-}
-
-static int mface_from_data( MFace * mf, CustomData *fdata, int findex,
- BPy_NMFace * from )
-{
- BPy_NMVert *nmv;
- MTFace *tf = CustomData_get(fdata, findex, CD_MTFACE);
- MCol *col = CustomData_get(fdata, findex, CD_MCOL);
-
- int numverts = PyList_Size( from->v );
- if( numverts != 3 && numverts != 4 ) { /* face can only have three or four verts */
- PyErr_SetString ( PyExc_RuntimeError,
- "faces must have at 3 or 4 vertices" );
- return 0;
- }
-
- nmv = ( BPy_NMVert * ) PyList_GetItem( from->v, 0 );
- if( BPy_NMVert_Check( nmv ) && nmv->index != -1 )
- mf->v1 = nmv->index;
- else
- return -1;
-
- nmv = ( BPy_NMVert * ) PyList_GetItem( from->v, 1 );
- if( BPy_NMVert_Check( nmv ) && nmv->index != -1 )
- mf->v2 = nmv->index;
- else
- return -1;
-
- nmv = ( BPy_NMVert * ) PyList_GetItem( from->v, 2 );
- if( BPy_NMVert_Check( nmv ) && nmv->index != -1 )
- mf->v3 = nmv->index;
- else
- return -1;
-
- if( numverts == 4 ) {
- nmv = ( BPy_NMVert * ) PyList_GetItem( from->v, 3 );
- if( BPy_NMVert_Check( nmv ) && nmv->index != -1 )
- mf->v4 = nmv->index;
- else
- return -1;
- }
-
- if( tf )
- if( !assignFaceUV( tf, from ) )
- return 0;
-
- mf->mat_nr = from->mat_nr;
- mf->flag = from->mf_flag;
-
- if( col ) {
- int i, len = PySequence_Length( from->col );
-
- if( len > 4 )
- len = 4;
-
- for( i = 0; i < len; i++, col++ ) {
- BPy_NMCol *mc =
- ( BPy_NMCol * ) PySequence_GetItem( from->col,
- i );
- if( !BPy_NMCol_Check( mc ) ) {
- Py_DECREF( mc );
- continue;
- }
-
- col->b = mc->r;
- col->g = mc->g;
- col->r = mc->b;
- col->a = mc->a;
-
- Py_DECREF( mc );
- }
- }
-
- test_index_face(mf, fdata, findex, numverts);
-
- return 1;
-}
-
-/* check for a valid UV sequence */
-static int check_validFaceUV( BPy_NMesh * nmesh )
-{
- PyObject *faces;
- BPy_NMFace *nmface;
- int i, n;
-
- faces = nmesh->faces;
- for( i = 0; i < PySequence_Length( faces ); i++ ) {
- nmface = ( BPy_NMFace * ) PyList_GetItem( faces, i );
- n = PySequence_Length( nmface->uv );
- if( n != PySequence_Length( nmface->v ) ) {
- if( n > 0 )
- printf( "Warning: different length of vertex and UV coordinate " "list in face!\n" );
- return 0;
- }
- }
- return 1;
-}
-
-/* this is a copy of unlink_mesh in mesh.c, because ... */
-static void EXPP_unlink_mesh( Mesh * me )
-{
- int a;
-
- if( me == 0 )
- return;
-
- for( a = 0; a < me->totcol; a++ ) {
- if( me->mat[a] )
- me->mat[a]->id.us--;
- me->mat[a] = 0;
- }
-
-/* ... here we want to preserve mesh keys */
-/* if users want to get rid of them, they can use mesh.removeAllKeys() */
-/*
- if(me->key) me->key->id.us--;
- me->key= 0;
-*/
- if( me->texcomesh )
- me->texcomesh = 0;
-
- me->totcol = 0;
-}
-
-static int unlink_existingMeshData( Mesh * mesh )
-{
- MDeformVert *dvert= NULL;
-
- EXPP_unlink_mesh( mesh );
-
- if(mesh->dvert) {
- /* we don't want to remove dvert here, check_dverts still needs it */
- dvert= mesh->dvert;
- CustomData_set_layer( &mesh->vdata, CD_MDEFORMVERT, NULL );
- }
-
- CustomData_free( &mesh->vdata, mesh->totvert );
- CustomData_free( &mesh->edata, mesh->totedge );
- CustomData_free( &mesh->fdata, mesh->totface );
- mesh_update_customdata_pointers( mesh );
-
- if(dvert)
- mesh->dvert= CustomData_add_layer( &mesh->vdata, CD_MDEFORMVERT,
- CD_ASSIGN, dvert, mesh->totvert );
-
- mesh->totedge = 0;
-
- if( mesh->mat ) {
- MEM_freeN( mesh->mat );
- mesh->mat = NULL;
- }
-
- return 1;
-}
-
-Material **nmesh_updateMaterials( BPy_NMesh * nmesh )
-{
- Material **matlist;
- Mesh *mesh = nmesh->mesh;
- int len = PyList_Size( nmesh->materials );
-
- if( !mesh ) {
- printf( "FATAL INTERNAL ERROR: illegal call to updateMaterials()\n" );
- return 0;
- }
-
- if( len > 0 ) {
- if (len>16) len = 16;
- matlist = EXPP_newMaterialList_fromPyList( nmesh->materials );
- EXPP_incr_mats_us( matlist, len );
-
- if( mesh->mat )
- MEM_freeN( mesh->mat );
-
- mesh->mat = matlist;
-
- } else {
- matlist = 0;
- }
- mesh->totcol = (short)len;
-
-/**@ This is another ugly fix due to the weird material handling of blender.
- * it makes sure that object material lists get updated (by their length)
- * according to their data material lists, otherwise blender crashes.
- * It just stupidly runs through all objects...BAD BAD BAD.
- */
- test_object_materials( ( ID * ) mesh );
-
- return matlist;
-}
-
-PyObject *NMesh_assignMaterials_toObject( BPy_NMesh * nmesh, Object * ob )
-{
- BPy_Material *pymat;
- Material *ma;
- int i;
- short old_matmask;
- Mesh *mesh = nmesh->mesh;
- int nmats; /* number of mats == len(nmesh->materials) */
-
- old_matmask = ob->colbits; /*@ HACK: save previous colbits */
- ob->colbits = 0; /* make assign_material work on mesh linked material */
-
- nmats = PyList_Size( nmesh->materials );
-
- if( nmats > 0 && !mesh->mat ) {
- ob->totcol = (char)nmats;
- mesh->totcol = (short)nmats;
- mesh->mat =
- MEM_callocN( sizeof( void * ) * nmats, "bpy_memats" );
-
- if( ob->mat )
- MEM_freeN( ob->mat );
- ob->mat =
- MEM_callocN( sizeof( void * ) * nmats, "bpy_obmats" );
- }
-
- for( i = 0; i < nmats; i++ ) {
- pymat = ( BPy_Material * ) PySequence_GetItem( nmesh->
- materials, i );
-
- if( BPy_Material_Check( ( PyObject * ) pymat ) ) {
- ma = pymat->material;
- assign_material( ob, ma, i + 1 ); /*@ XXX don't use this function anymore */
- } else {
- Py_DECREF( pymat );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Material type in attribute list 'materials'!" );
- }
-
- Py_DECREF( pymat );
- }
-
- ob->colbits = old_matmask; /*@ HACK */
-
- ob->actcol = 1;
- Py_RETURN_NONE;
-}
-
-static void fill_medge_from_nmesh(Mesh * mesh, BPy_NMesh * nmesh)
-{
- int i,j;
- MEdge *faces_edges=NULL;
- int tot_faces_edges=0;
- int tot_valid_faces_edges=0;
- int nmeshtotedges=PyList_Size(nmesh->edges);
- int tot_valid_nmedges=0;
- BPy_NMEdge **valid_nmedges=NULL;
-
- valid_nmedges=MEM_callocN(nmeshtotedges*sizeof(BPy_NMEdge *), "make BPy_NMEdge");
-
- /* First compute the list of edges that exists because faces exists */
- make_edges(mesh, 0); /* 0 = draw all edges */
-
- faces_edges=mesh->medge;
- tot_faces_edges=mesh->totedge;
- tot_valid_faces_edges=tot_faces_edges;
-
- mesh->medge= CustomData_set_layer(&mesh->edata, CD_MEDGE, NULL);
- CustomData_free_layer_active(&mesh->edata, CD_MEDGE, mesh->totedge);
- mesh->totedge = 0;
-
- /* Flag each edge in faces_edges that is already in nmesh->edges list.
- * Flaging an edge means MEdge v1=v2=0.
- * Each time an edge is flagged, tot_valid_faces_edges is decremented.
- *
- * Also store in valid_nmedges pointers to each valid NMEdge in nmesh->edges.
- * An invalid NMEdge is an edge that has a vertex that is not in the vertices
- * list. Ie its index is -1.
- * Each time an valid NMEdge is flagged, tot_valid_nmedges is incremented.
- */
- for( i = 0; i < nmeshtotedges; ++i )
- {
- int v1idx,v2idx;
- BPy_NMEdge *edge=( BPy_NMEdge *) PyList_GetItem(nmesh->edges, i);
- BPy_NMVert *v=(BPy_NMVert *)edge->v1;
- v1idx=v->index;
- v=(BPy_NMVert *)edge->v2;
- v2idx=v->index;
- if (-1 == v1idx || -1 == v2idx) continue;
- valid_nmedges[tot_valid_nmedges]=edge;
- ++tot_valid_nmedges;
- for( j = 0; j < tot_faces_edges; j++ )
- {
- MEdge *me=faces_edges+j;
- if ( ((int)me->v1==v1idx && (int)me->v2==v2idx) ||
- ((int)me->v1==v2idx && (int)me->v2==v1idx) )
- {
- me->v1=0; me->v2=0;
- --tot_valid_faces_edges;
- }
- }
- }
-
- /* tot_valid_faces_edges < 0 causes a sigsegv crash, so we
- * clamp to prevent it
- * (this is related to faces (correctly) requiring at least 3 verts now,
- * which can break old scripts -- maybe we should also warn about the
- * 'broken' mesh the user created, but for now, until we investigate
- * better, this should do) */
- if (tot_valid_faces_edges < 0) tot_valid_faces_edges = 0;
-
- /* Now we have the total count of valid edges */
- mesh->totedge=tot_valid_nmedges+tot_valid_faces_edges;
- mesh->medge= CustomData_add_layer( &mesh->edata, CD_MEDGE, CD_CALLOC, NULL,
- mesh->totedge );
-
- for ( i = 0; i < tot_valid_nmedges; ++i )
- {
- BPy_NMEdge *edge=valid_nmedges[i];
- MEdge *medge=mesh->medge+i;
- int v1=((BPy_NMVert *)edge->v1)->index;
- int v2=((BPy_NMVert *)edge->v2)->index;
- medge->v1=v1;
- medge->v2=v2;
- medge->flag=edge->flag;
- medge->crease=edge->crease;
- }
- for ( i = 0, j = tot_valid_nmedges; i < tot_faces_edges; ++i )
- {
- MEdge *edge=faces_edges+i;
- if (edge->v1!=0 || edge->v2!=0) // valid edge
- {
- MEdge *medge=mesh->medge+j;
- medge->v1=edge->v1;
- medge->v2=edge->v2;
- medge->flag=ME_EDGEDRAW|ME_EDGERENDER;
- medge->crease=0;
- ++j;
- }
- }
-
- MEM_freeN( valid_nmedges );
- MEM_freeN( faces_edges );
-}
-
-/* this should ensure meshes don't end up with wrongly sized
- * me->dvert arrays, which can cause hangs; it's not ideal,
- * it's better to wrap dverts in NMesh, but it should do for now
- * since there are also methods in NMesh to edit dverts in the actual
- * mesh in Blender and anyway this is memory friendly */
-static void check_dverts(Mesh *me, int old_totvert)
-{
- int totvert = me->totvert;
-
- /* if vert count didn't change or there are no dverts, all is fine */
- if ((totvert == old_totvert) || (!me->dvert)) return;
- /* if all verts have been deleted, free old dverts */
- else if (totvert == 0) {
- CustomData_free_layer_active( &me->vdata, CD_MDEFORMVERT, old_totvert );
- me->dvert= NULL;
- }
- else {
- /* verts added or removed, make new me->dvert */
- MDeformVert *mdv = MEM_callocN( sizeof(MDeformVert)*totvert, "mdv" );
- copy_dverts( mdv, me->dvert, MIN2( old_totvert, totvert ) );
- free_dverts( me->dvert, old_totvert );
- me->dvert= CustomData_set_layer( &me->vdata, CD_MDEFORMVERT, mdv );
- }
-}
-
-static void check_mtface_mcols( BPy_NMesh *nmesh, Mesh *mesh )
-{
- int i;
-
- /* copy non-active mcol and mtface layers based on original index */
- CustomData_merge( &nmesh->fdata, &mesh->fdata, CD_MASK_MCOL|CD_MASK_MTFACE,
- CD_DEFAULT, mesh->totface );
-
- for( i = 0; i < mesh->totface; i++ ) {
- BPy_NMFace *mf =
- ( BPy_NMFace * ) PySequence_GetItem( nmesh->faces, i );
-
- if ( mf->orig_index != -1 )
- CustomData_copy_data( &nmesh->fdata, &mesh->fdata, mf->orig_index,
- i, 1 );
-
- Py_DECREF( mf );
- }
-
- /* add new layers if needed */
- if( ( nmesh->flags & NMESH_HASMCOL ) &&
- !CustomData_has_layer( &mesh->fdata, CD_MCOL ) ) {
- mesh->mcol = CustomData_add_layer( &mesh->fdata, CD_MCOL,
- CD_DEFAULT, NULL, mesh->totface );
- }
-
- if( ( nmesh->flags & NMESH_HASFACEUV ) || check_validFaceUV( nmesh ) ) {
- if ( !CustomData_has_layer( &mesh->fdata, CD_MTFACE) )
- make_tfaces( mesh );
- nmesh->flags |= NMESH_HASFACEUV;
- }
- else
- CustomData_free_layers( &mesh->fdata, CD_MTFACE, mesh->totface );
-
- /* active uvs and colors from NMFace will be written in mface_from_data */
-}
-
-static int convert_NMeshToMesh( Mesh * mesh, BPy_NMesh * nmesh)
-{
- MFace *newmf;
- MVert *newmv;
- MSticky *newst;
- int nmeshtotedges;
- int badfaces;
- int i, j, ok;
-
- /* Minor note: we used 'mode' because 'flag' was already used internally
- * by nmesh */
- mesh->flag = nmesh->mode;
- mesh->smoothresh = nmesh->smoothresh;
- mesh->subdiv = nmesh->subdiv[0];
- mesh->subdivr = nmesh->subdiv[1];
-
- /*@ material assignment moved to PutRaw */
- mesh->totvert = PySequence_Length( nmesh->verts );
- if( mesh->totvert ) {
- if( nmesh->flags & NMESH_HASVERTUV )
- mesh->msticky = CustomData_add_layer( &mesh->vdata, CD_MSTICKY,
- CD_CALLOC, NULL, mesh->totvert );
-
- mesh->mvert = CustomData_add_layer( &mesh->vdata, CD_MVERT, CD_CALLOC,
- NULL, mesh->totvert );
- }
-
- if( mesh->totvert )
- mesh->totface = PySequence_Length( nmesh->faces );
- else
- mesh->totface = 0;
-
- if( mesh->totface ) {
- check_mtface_mcols( nmesh, mesh );
-
- mesh->mface = CustomData_add_layer( &mesh->fdata, CD_MFACE, CD_CALLOC,
- NULL, mesh->totface );
- }
-
- mesh_update_customdata_pointers( mesh );
-
- /*@ This stuff here is to tag all the vertices referenced
- * by faces, then untag the vertices which are actually
- * in the vert list. Any vertices untagged will be ignored
- * by the mface_from_data function. It comes from my
- * screwed up decision to not make faces only store the
- * index. - Zr
- */
- for( i = 0; i < mesh->totface; i++ ) {
- BPy_NMFace *mf =
- ( BPy_NMFace * ) PySequence_GetItem( nmesh->faces, i );
-
- j = PySequence_Length( mf->v );
- while( j-- ) {
- BPy_NMVert *mv =
- ( BPy_NMVert * ) PySequence_GetItem( mf->v,
- j );
- if( BPy_NMVert_Check( mv ) )
- mv->index = -1;
- Py_DECREF( mv );
- }
-
- Py_DECREF( mf );
- }
- /* do the same for edges if there is edge data */
- nmeshtotedges=PyList_Size(nmesh->edges);
- for( i = 0; i < nmeshtotedges; ++i )
- {
- BPy_NMEdge *edge=( BPy_NMEdge *) PyList_GetItem(nmesh->edges, i);
- BPy_NMVert *v=(BPy_NMVert *)edge->v1;
- v->index=-1;
- v=(BPy_NMVert *)edge->v2;
- v->index=-1;
- }
-
- for( i = 0; i < mesh->totvert; i++ ) {
- BPy_NMVert *mv =
- ( BPy_NMVert * ) PySequence_GetItem( nmesh->verts, i );
- mv->index = i;
- Py_DECREF( mv );
- }
-
- newmv = mesh->mvert;
- newst = mesh->msticky;
- for( i = 0; i < mesh->totvert; i++ ) {
- PyObject *mv = PySequence_GetItem( nmesh->verts, i );
- mvert_from_data( newmv, newst, ( BPy_NMVert * ) mv );
- Py_DECREF( mv );
-
- newmv++;
- if( newst )
- newst++;
- }
-
- newmf = mesh->mface;
- badfaces = 0;
- for( i = 0; i < mesh->totface; i++ ) {
- PyObject *mf = PySequence_GetItem( nmesh->faces, i );
- ok = mface_from_data( newmf, &mesh->fdata, i, ( BPy_NMFace * ) mf );
- Py_DECREF( mf );
- if( ok == 0)
- return 0;
- else if ( ok == -1 )
- ++badfaces;
- else
- newmf++;
- }
- mesh->totface -= badfaces;
-
- /* Always do this to ensure no loose edges in faces */
- fill_medge_from_nmesh(mesh, nmesh);
-
- return 1;
-}
-
-static PyObject *M_NMesh_PutRaw( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Mesh *mesh = NULL;
- Object *ob = NULL;
- BPy_NMesh *nmesh;
- int recalc_normals = 1;
- int store_edges = 0;
- int old_totvert = 0;
-
- if( !PyArg_ParseTuple( args, "O!|sii",
- &NMesh_Type, &nmesh, &name, &recalc_normals, &store_edges ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected an NMesh object and optionally also a string and two ints" );
-
- if( check_NMeshLists( nmesh ) )
- return NULL;
-
- if( name )
- mesh = ( Mesh * ) GetIdFromList( &( G.main->mesh ), name );
-
- if( !mesh || mesh->id.us == 0 ) {
- ob = add_object( OB_MESH );
- if( !ob ) {
- PyErr_SetString( PyExc_RuntimeError,
- "Fatal: could not create mesh object" );
- return 0;
- }
-
- if( !mesh )
- mesh = ( Mesh * ) ob->data;
- else
- set_mesh( ob, mesh ); // also does id.us++
-
- nmesh->object = ob; // linking so vgrouping methods know which obj to work on
- }
-
- if( name )
- new_id( &( G.main->mesh ), &mesh->id, name );
- else if( nmesh->name && nmesh->name != Py_None )
- new_id( &( G.main->mesh ), &mesh->id,
- PyString_AsString( nmesh->name ) );
-
- old_totvert = mesh->totvert;
-
- unlink_existingMeshData( mesh );
- if( !convert_NMeshToMesh( mesh, nmesh ) )
- return NULL;
- nmesh->mesh = mesh;
-
- if (mesh->dvert) check_dverts(mesh, old_totvert);
-
- if( recalc_normals )
- mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL);
-
- mesh_update( mesh, nmesh->object );
-
- if( !during_script( ) )
- EXPP_allqueue( REDRAWVIEW3D, 0 );
-
- if (ob && G.obedit) { /* prevents a crash when a new object is created */
- exit_editmode(EM_FREEDATA);
- enter_editmode(0);
- }
-
- // @OK...this requires some explanation:
- // Materials can be assigned two ways:
- // a) to the object data (in this case, the mesh)
- // b) to the Object
- //
- // Case a) is wanted, if Mesh data should be shared among objects,
- // as well as its materials (up to 16)
- // Case b) is wanted, when Mesh data should be shared, but not the
- // materials. For example, you want several checker boards sharing their
- // mesh data, but having different colors. So you would assign material
- // index 0 to all even, index 1 to all odd faces and bind the materials
- // to the Object instead (MaterialButtons: [OB] "link materials to object")
- //
- // This feature implies that pointers to materials can be stored in
- // an object or a mesh. The number of total materials MUST be
- // synchronized (ob->totcol <-> mesh->totcol). We avoid the dangerous
- // direct access by calling blenderkernel/material.c:assign_material().
-
- // The flags setting the material binding is found in ob->colbits, where
- // each bit indicates the binding PER MATERIAL
-
- if( ob ) { // we created a new object
- NMesh_assignMaterials_toObject( nmesh, ob );
- EXPP_synchronizeMaterialLists( ob );
- return Object_CreatePyObject( ob );
- } else {
- mesh->mat =
- EXPP_newMaterialList_fromPyList( nmesh->materials );
- EXPP_incr_mats_us( mesh->mat,
- PyList_Size( nmesh->materials ) );
- Py_RETURN_NONE;
- }
-
-}
-
-#undef MethodDef
-#define MethodDef(func) \
- {#func, M_NMesh_##func, METH_VARARGS, M_NMesh_##func##_doc}
-
-static struct PyMethodDef M_NMesh_methods[] = {
- MethodDef( Col ),
- MethodDef( Vert ),
- MethodDef( Face ),
- MethodDef( New ),
- MethodDef( GetRaw ),
- MethodDef( GetRawFromObject ),
- MethodDef( PutRaw ),
- {"GetNames", (PyCFunction)M_NMesh_GetNames, METH_NOARGS,
- M_NMesh_GetNames_doc},
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *M_NMesh_Modes( void )
-{
- PyObject *Modes = PyConstant_New( );
-
- if( Modes ) {
- BPy_constant *d = ( BPy_constant * ) Modes;
-
- PyConstant_Insert( d, "NOVNORMALSFLIP",
- PyInt_FromLong
- ( ME_NOPUNOFLIP ) );
- PyConstant_Insert( d, "TWOSIDED",
- PyInt_FromLong( ME_TWOSIDED ) );
- PyConstant_Insert( d, "AUTOSMOOTH",
- PyInt_FromLong
- ( ME_AUTOSMOOTH ) );
- }
-
- return Modes;
-}
-
-#undef EXPP_ADDCONST
-#define EXPP_ADDCONST(dict, name) \
- PyConstant_Insert(dict, #name, PyInt_FromLong(TF_##name))
-/* Set constants for face drawing mode -- see drawmesh.c */
-
-static PyObject *M_NMesh_FaceModesDict( void )
-{
- PyObject *FM = PyConstant_New( );
-
- if( FM ) {
- BPy_constant *d = ( BPy_constant * ) FM;
-
- PyConstant_Insert( d, "BILLBOARD",
- PyInt_FromLong( TF_BILLBOARD2 ) );
- PyConstant_Insert( d, "ALL", PyInt_FromLong( 0x7fff ) );
- PyConstant_Insert( d, "HALO", PyInt_FromLong( TF_BILLBOARD ) );
- PyConstant_Insert( d, "DYNAMIC", PyInt_FromLong( TF_DYNAMIC ) );
- PyConstant_Insert( d, "INVISIBLE", PyInt_FromLong( TF_INVISIBLE ) );
- PyConstant_Insert( d, "LIGHT", PyInt_FromLong( TF_LIGHT ) );
- PyConstant_Insert( d, "OBCOL", PyInt_FromLong( TF_OBCOL ) );
- PyConstant_Insert( d, "SHADOW", PyInt_FromLong( TF_SHADOW ) );
- PyConstant_Insert( d, "TEXT", PyInt_FromLong( TF_BMFONT ) );
- PyConstant_Insert( d, "SHAREDVERT", PyInt_FromLong( TF_SHAREDVERT ) );
- PyConstant_Insert( d, "SHAREDCOL", PyInt_FromLong( TF_SHAREDCOL ) );
- PyConstant_Insert( d, "TEX", PyInt_FromLong( TF_TEX ) );
- PyConstant_Insert( d, "TILES", PyInt_FromLong( TF_TILES ) );
- PyConstant_Insert( d, "TWOSIDE", PyInt_FromLong( TF_TWOSIDE ) );
- }
-
- return FM;
-}
-
-static PyObject *M_NMesh_FaceFlagsDict( void )
-{
- PyObject *FF = PyConstant_New( );
-
- if( FF ) {
- BPy_constant *d = ( BPy_constant * ) FF;
-
- EXPP_ADDCONST( d, SELECT );
- EXPP_ADDCONST( d, HIDE );
- EXPP_ADDCONST( d, ACTIVE );
- }
-
- return FF;
-}
-
-static PyObject *M_NMesh_FaceTranspModesDict( void )
-{
- PyObject *FTM = PyConstant_New( );
-
- if( FTM ) {
- BPy_constant *d = ( BPy_constant * ) FTM;
-
- EXPP_ADDCONST( d, SOLID );
- EXPP_ADDCONST( d, ADD );
- EXPP_ADDCONST( d, ALPHA );
- EXPP_ADDCONST( d, SUB );
- }
-
- return FTM;
-}
-
-static PyObject *M_NMesh_EdgeFlagsDict( void )
-{
- PyObject *EF = PyConstant_New( );
-
- if( EF ) {
- BPy_constant *d = ( BPy_constant * ) EF;
-
- PyConstant_Insert(d, "SELECT", PyInt_FromLong(1));
- PyConstant_Insert(d, "EDGEDRAW", PyInt_FromLong(ME_EDGEDRAW));
- PyConstant_Insert(d, "EDGERENDER", PyInt_FromLong(ME_EDGERENDER));
- PyConstant_Insert(d, "SEAM", PyInt_FromLong(ME_SEAM));
- PyConstant_Insert(d, "FGON", PyInt_FromLong(ME_FGON));
- }
-
- return EF;
-}
-
-PyObject *NMesh_Init( void )
-{
- PyObject *submodule;
-
- PyObject *Modes = M_NMesh_Modes( );
- PyObject *FaceFlags = M_NMesh_FaceFlagsDict( );
- PyObject *FaceModes = M_NMesh_FaceModesDict( );
- PyObject *FaceTranspModes = M_NMesh_FaceTranspModesDict( );
- PyObject *EdgeFlags = M_NMesh_EdgeFlagsDict( );
-
- NMCol_Type.ob_type = &PyType_Type;
- NMFace_Type.ob_type = &PyType_Type;
- NMVert_Type.ob_type = &PyType_Type;
- NMesh_Type.ob_type = &PyType_Type;
-
- submodule =
- Py_InitModule3( "Blender.NMesh", M_NMesh_methods,
- M_NMesh_doc );
-
- if( Modes )
- PyModule_AddObject( submodule, "Modes", Modes );
- if( FaceFlags )
- PyModule_AddObject( submodule, "FaceFlags", FaceFlags );
- if( FaceModes )
- PyModule_AddObject( submodule, "FaceModes", FaceModes );
- if( FaceTranspModes )
- PyModule_AddObject( submodule, "FaceTranspModes",
- FaceTranspModes );
- if( EdgeFlags )
- PyModule_AddObject( submodule, "EdgeFlags", EdgeFlags );
-
- return submodule;
-}
-
-/* These are needed by Object.c */
-
-PyObject *NMesh_CreatePyObject( Mesh * me, Object * ob )
-{
- BPy_NMesh *nmesh = ( BPy_NMesh * ) new_NMesh( me );
-
- if( nmesh )
- nmesh->object = ob; /* linking nmesh and object for vgrouping methods */
-
- return ( PyObject * ) nmesh;
-}
-
-int NMesh_CheckPyObject( PyObject * pyobj )
-{
- return ( pyobj->ob_type == &NMesh_Type );
-}
-
-Mesh *NMesh_FromPyObject( PyObject * pyobj, Object * ob )
-{
- if( pyobj->ob_type == &NMesh_Type ) {
- Mesh *mesh;
- BPy_NMesh *nmesh = ( BPy_NMesh * ) pyobj;
-
- if( nmesh->mesh ) {
- mesh = nmesh->mesh;
- } else {
- mesh = Mesh_fromNMesh( nmesh );
- if( !mesh ) /* NULL means an PyError */
- return NULL;
-
- nmesh->mesh = mesh;
-
- nmesh->object = ob; /* linking for vgrouping methods */
- if( nmesh->name && nmesh->name != Py_None )
- new_id( &( G.main->mesh ), &mesh->id,
- PyString_AsString( nmesh->name ) );
- mesh_update( mesh, nmesh->object );
- nmesh_updateMaterials( nmesh );
- }
- return mesh;
- }
-
- PyErr_SetString( PyExc_AttributeError,
- "link argument type is not supported " );
- return NULL;
-}
-
-#define POINTER_CROSS_EQ(a1, a2, b1, b2) (((a1)==(b1) && (a2)==(b2)) || ((a1)==(b2) && (a2)==(b1)))
-
-static PyObject *findEdge( BPy_NMesh *nmesh, BPy_NMVert *v1, BPy_NMVert *v2, int create)
-{
- int i;
-
- for ( i = 0; i < PyList_Size(nmesh->edges); ++i )
- {
- BPy_NMEdge *edge=(BPy_NMEdge*)PyList_GetItem( nmesh->edges, i );
- if (!BPy_NMEdge_Check(edge)) continue;
- if ( POINTER_CROSS_EQ((BPy_NMVert*)edge->v1, (BPy_NMVert*)edge->v2, v1, v2) )
- {
- return EXPP_incr_ret((PyObject*)edge);
- }
- }
-
- /* if this line is reached, edge has not been found */
- if (create)
- {
- PyObject *newEdge=(PyObject *)new_NMEdge(v1, v2, 0, ME_EDGEDRAW|ME_EDGERENDER);
- PyList_Append(nmesh->edges, newEdge);
- return newEdge;
- }
- else
- Py_RETURN_NONE;
-}
-
-static void removeEdge( BPy_NMesh *nmesh, BPy_NMVert *v1, BPy_NMVert *v2, int ununsedOnly)
-{
- int i,j;
- BPy_NMEdge *edge=NULL;
- int edgeUsedByFace=0;
- int totedge=PyList_Size(nmesh->edges);
-
- /* find the edge in the edge list */
- for ( i = 0; i < totedge; ++i )
- {
- edge=(BPy_NMEdge*)PyList_GetItem( nmesh->edges, i );
- if (!BPy_NMEdge_Check(edge)) continue;
- if ( POINTER_CROSS_EQ((BPy_NMVert*)edge->v1, (BPy_NMVert*)edge->v2, v1, v2) )
- {
- break;
- }
- }
-
- if (i==totedge || !edge) // edge not found
- return;
-
- for ( j = PyList_Size(nmesh->faces)-1; j >= 0 ; --j )
- {
- BPy_NMFace *face=(BPy_NMFace *)PyList_GetItem(nmesh->faces, j);
- int k, del_face=0;
- int totv;
- if (!BPy_NMFace_Check(face)) continue;
- totv=PyList_Size(face->v);
- if (totv<2) continue;
- for ( k = 0; k < totv && !del_face; ++k )
- {
- BPy_NMVert *fe_v1=(BPy_NMVert *)PyList_GetItem(face->v, k ? k-1 : totv-1);
- BPy_NMVert *fe_v2=(BPy_NMVert *)PyList_GetItem(face->v, k);
- if ( POINTER_CROSS_EQ(v1, v2, fe_v1, fe_v2) )
- {
- edgeUsedByFace=1;
- del_face=1;
- }
- }
- if (del_face && !ununsedOnly)
- {
- PySequence_DelItem(nmesh->faces, j);
- }
- }
-
- if (!ununsedOnly || (ununsedOnly && !edgeUsedByFace) )
- PySequence_DelItem(nmesh->edges, PySequence_Index(nmesh->edges, (PyObject*)edge));
-}
-
-
-static PyObject *NMesh_addEdge( PyObject * self, PyObject * args )
-{
- BPy_NMesh *bmesh=(BPy_NMesh *)self;
- BPy_NMVert *v1=NULL, *v2=NULL;
-
- if (!PyArg_ParseTuple
- ( args, "O!O!", &NMVert_Type, &v1, &NMVert_Type, &v2 ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected NMVert, NMVert" );
- }
-
- if (v1==v2)
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "vertices must be different" );
-
- return findEdge(bmesh, v1, v2, 1);
-}
-
-static PyObject *NMesh_findEdge( PyObject * self, PyObject * args )
-{
- BPy_NMesh *bmesh=(BPy_NMesh *)self;
- BPy_NMVert *v1=NULL, *v2=NULL;
-
- if (!PyArg_ParseTuple
- ( args, "O!O!", &NMVert_Type, &v1, &NMVert_Type, &v2 ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected NMVert, NMVert" );
- }
-
- if (v1==v2)
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "vertices must be different" );
-
- return findEdge(bmesh, v1, v2, 0);
-}
-
-static PyObject *NMesh_removeEdge( PyObject * self, PyObject * args )
-{
- BPy_NMesh *bmesh=(BPy_NMesh *)self;
- BPy_NMVert *v1=NULL, *v2=NULL;
-
- if (!PyArg_ParseTuple
- ( args, "O!O!", &NMVert_Type, &v1, &NMVert_Type, &v2 ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected NMVert, NMVert" );
- }
-
- if (v1==v2)
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "vertices must be different" );
- removeEdge(bmesh, v1, v2, 0);
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *NMesh_addFace( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nmesh=(BPy_NMesh *)self;
-
- BPy_NMFace *face;
- int totv=0;
-
- if (!PyArg_ParseTuple
- ( args, "O!", &NMFace_Type, &face ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected NMFace argument" );
- }
-
- totv=PyList_Size(face->v);
-
- /*
- * Before edges data exists, having faces with two vertices was
- * the only way of storing edges not attached to any face.
- */
- if (totv!=2)
- PyList_Append(nmesh->faces, (PyObject*)face);
-
- if (totv>=2)
- {
- /* when totv==2, there is only one edge, when totv==3 there is three edges
- * and when totv==4 there is four edges.
- * that's why in the following line totv==2 is a special case */
- PyObject *edges = PyList_New((totv==2) ? 1 : totv);
- if (totv==2)
- {
- BPy_NMVert *fe_v1=(BPy_NMVert *)PyList_GetItem(face->v, 0);
- BPy_NMVert *fe_v2=(BPy_NMVert *)PyList_GetItem(face->v, 1);
- BPy_NMEdge *edge=(BPy_NMEdge *)findEdge(nmesh, fe_v1, fe_v2, 1);
- PyList_SetItem(edges, 0, (PyObject*)edge); // PyList_SetItem steals the reference
- }
- else
- {
- int k;
- for ( k = 0; k < totv; ++k )
- {
- BPy_NMVert *fe_v1=(BPy_NMVert *)PyList_GetItem(face->v, k ? k-1 : totv-1);
- BPy_NMVert *fe_v2=(BPy_NMVert *)PyList_GetItem(face->v, k);
- BPy_NMEdge *edge=(BPy_NMEdge *)findEdge(nmesh, fe_v1, fe_v2, 1);
- PyList_SetItem(edges, k, (PyObject*)edge); // PyList_SetItem steals the reference
- }
- }
- return edges;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_removeFace( PyObject * self, PyObject * args )
-{
- BPy_NMesh *nmesh=(BPy_NMesh *)self;
-
- BPy_NMFace *face;
- int totv=0;
-
- if (!PyArg_ParseTuple
- ( args, "O!", &NMFace_Type, &face ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected NMFace argument" );
- }
-
- totv=PyList_Size(face->v);
-
- {
- int index=PySequence_Index(nmesh->faces, (PyObject*)face);
- if (index>=0)
- PySequence_DelItem(nmesh->faces, index);
- }
-
- if (totv>=2)
- {
- /* when totv==2, there is only one edge, when totv==3 there is three edges
- * and when totv==4 there is four edges.
- * that's why in the following line totv==2 is a special case */
- if (totv==2)
- {
- BPy_NMVert *fe_v1=(BPy_NMVert *)PyList_GetItem(face->v, 0);
- BPy_NMVert *fe_v2=(BPy_NMVert *)PyList_GetItem(face->v, 1);
- removeEdge(nmesh, fe_v1, fe_v2, 1);
- }
- else
- {
- int k;
- for ( k = 0; k < totv; ++k )
- {
- BPy_NMVert *fe_v1=(BPy_NMVert *)PyList_GetItem(face->v, k ? k-1 : totv-1);
- BPy_NMVert *fe_v2=(BPy_NMVert *)PyList_GetItem(face->v, k);
- removeEdge(nmesh, fe_v1, fe_v2, 1);
- }
- }
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_printDebug( PyObject * self )
-{
- BPy_NMesh *bmesh=(BPy_NMesh *)self;
-
- Mesh *mesh=bmesh->mesh;
-
- printf("**Vertices\n");
- {
- int i;
- for (i=0; i<mesh->totvert; ++i)
- {
- MVert *v=mesh->mvert+i;
- double x=v->co[0];
- double y=v->co[1];
- double z=v->co[2];
- printf(" %2d : %.3f %.3f %.3f\n", i, x, y, z);
- }
- }
-
- printf("**Edges\n");
- {
- int i;
- for (i=0; i<mesh->totedge; ++i)
- {
- MEdge *e=mesh->medge+i;
- int v1 = e->v1;
- int v2 = e->v2;
- int flag = e->flag;
- printf(" %2d : %2d %2d flag=%d\n", i, v1, v2, flag);
- }
- }
-
- printf("**Faces\n");
- {
- int i;
- for (i=0; i<mesh->totface; ++i)
- {
- MFace *e=((MFace*)(mesh->mface))+i;
- int v1 = e->v1;
- int v2 = e->v2;
- int v3 = e->v3;
- int v4 = e->v4;
- printf(" %2d : %2d %2d %2d %2d\n", i, v1, v2, v3, v4);
- }
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_addVertGroup( PyObject * self, PyObject * args )
-{
- char *groupStr;
- struct Object *object;
- PyObject *tempStr;
-
- if( !PyArg_ParseTuple( args, "s", &groupStr ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( ( ( BPy_NMesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- object = ( ( BPy_NMesh * ) self )->object;
-
- //get clamped name
- tempStr = PyString_FromStringAndSize( groupStr, 32 );
- groupStr = PyString_AsString( tempStr );
-
- add_defgroup_name( object, groupStr );
-
- EXPP_allqueue( REDRAWBUTSALL, 1 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_removeVertGroup( PyObject * self, PyObject * args )
-{
- char *groupStr;
- struct Object *object;
- int nIndex;
- bDeformGroup *pGroup;
-
- if( !PyArg_ParseTuple( args, "s", &groupStr ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( ( ( BPy_NMesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- object = ( ( BPy_NMesh * ) self )->object;
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
- nIndex++;
- object->actdef = (unsigned short)nIndex;
-
- del_defgroup( object );
-
- EXPP_allqueue( REDRAWBUTSALL, 1 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_assignVertsToGroup( PyObject * self, PyObject * args )
-{
- //listObject is an integer list of vertex indices to add to group
- //groupStr = group name
- //weight is a float defining the weight this group has on this vertex
- //assignmode = "replace", "add", "subtract"
- // replace weight - add addition weight to vertex for this group
- // - remove group influence from this vertex
- //the function will not like it if your in editmode...
-
- char *groupStr;
- char *assignmodeStr = NULL;
- int nIndex;
- int assignmode;
- float weight = 1.0;
- struct Object *object;
- bDeformGroup *pGroup;
- PyObject *listObject;
- int tempInt;
- int x;
-
- if( ( ( BPy_NMesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- if( !PyArg_ParseTuple
- ( args, "sO!fs", &groupStr, &PyList_Type, &listObject, &weight,
- &assignmodeStr ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string, list, float, string arguments" );
- }
-
- object = ( ( BPy_NMesh * ) self )->object;
-
- if( object->data == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object contains no data..." );
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
-
- if( assignmodeStr == NULL )
- assignmode = 1; /* default */
- else if( STREQ( assignmodeStr, "replace" ) )
- assignmode = 1;
- else if( STREQ( assignmodeStr, "add" ) )
- assignmode = 2;
- else if( STREQ( assignmodeStr, "subtract" ) )
- assignmode = 3;
- else
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad assignment mode" );
-
- //makes a set of dVerts corresponding to the mVerts
- if( !( ( Mesh * ) object->data )->dvert ) {
- create_dverts( object->data );
- }
- //loop list adding verts to group
- for( x = 0; x < PyList_Size( listObject ); x++ ) {
- if( !
- ( PyArg_Parse
- ( ( PyList_GetItem( listObject, x ) ), "i",
- &tempInt ) ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
- }
-
- if( tempInt < 0
- || tempInt >= ( ( Mesh * ) object->data )->totvert ) {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
- }
-
- add_vert_defnr( object, nIndex, tempInt, weight, assignmode );
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_removeVertsFromGroup( PyObject * self, PyObject * args )
-{
- //not passing a list will remove all verts from group
-
- char *groupStr;
- int nIndex;
- struct Object *object;
- bDeformGroup *pGroup;
- PyObject *listObject;
- int tempInt;
- int x, argc;
-
- /* argc is the number of parameters passed in: 1 (no list given) or 2: */
- argc = PyObject_Length( args );
-
- if( !PyArg_ParseTuple
- ( args, "s|O!", &groupStr, &PyList_Type, &listObject ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string and optional list argument" );
-
- if( ( ( BPy_NMesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- object = ( ( BPy_NMesh * ) self )->object;
-
- if( object->data == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object contains no data..." );
-
- if( ( !( ( Mesh * ) object->data )->dvert ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "this mesh contains no deform vertices...'" );
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
-
- if( argc == 1 ) { /* no list given */
- //enter editmode
- if( ( G.obedit == 0 ) ) {
- //set current object
- BASACT->object = object;
- G.obedit = BASACT->object;
- }
- //set current vertex group
- nIndex++;
- object->actdef = (unsigned short)nIndex;
-
- //clear all dVerts in active group
- remove_verts_defgroup( 1 );
-
- //exit editmode
- G.obedit = 0;
- } else {
- if( G.obedit != 0 ) //remove_vert_def_nr doesn't like it if your in editmode
- G.obedit = 0;
-
- //loop list adding verts to group
- for( x = 0; x < PyList_Size( listObject ); x++ ) {
- if( !
- ( PyArg_Parse
- ( ( PyList_GetItem( listObject, x ) ), "i",
- &tempInt ) ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
-
- if( tempInt < 0
- || tempInt >=
- ( ( Mesh * ) object->data )->totvert )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
-
- remove_vert_def_nr( object, nIndex, tempInt );
- }
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getVertsFromGroup( PyObject * self, PyObject * args )
-{
- //not passing a list will return all verts from group
- //passing indecies not part of the group will not return data in pyList
- //can be used as a index/group check for a vertex
-
- char *groupStr;
- int nIndex;
- int weightRet;
- struct Object *object;
- bDeformGroup *pGroup;
- MVert *mvert;
- MDeformVert *dvert;
- float weight;
- int i, k, l1, l2, count;
- int num = 0;
- PyObject *tempVertexList = NULL;
- PyObject *vertexList;
- PyObject *listObject;
- int tempInt;
- int x;
-
- listObject = Py_None; //can't use NULL macro because compiler thinks
- //it's a 0 and we need to check 0 index vertex pos
- l1 = FALSE;
- l2 = FALSE;
- weightRet = 0;
-
- if( !PyArg_ParseTuple( args, "s|iO!", &groupStr, &weightRet,
- &PyList_Type, &listObject ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string and optional int and list arguments" );
-
- if( weightRet < 0 || weightRet > 1 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "return weights flag must be 0 or 1..." );
-
- if( ( ( BPy_NMesh * ) self )->object == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "mesh must be linked to an object first..." );
-
- object = ( ( BPy_NMesh * ) self )->object;
-
- if( object->data == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object contains no data..." );
-
- if( ( !( ( Mesh * ) object->data )->dvert ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "this mesh contains no deform vertices...'" );
-
- pGroup = get_named_vertexgroup( object, groupStr );
- if( pGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "group does not exist!" );
-
- nIndex = get_defgroup_num( object, pGroup );
- if( nIndex == -1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no deform groups assigned to mesh" );
-
- //temporary list
- tempVertexList = PyList_New( ( ( Mesh * ) object->data )->totvert );
- if( tempVertexList == NULL )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "getVertsFromGroup: can't create pylist!" );
-
- count = 0;
-
- if( listObject == Py_None ) //do entire group
- {
- for( k = 0; k < ( ( Mesh * ) object->data )->totvert; k++ ) {
- dvert = ( ( Mesh * ) object->data )->dvert + k;
-
- for( i = 0; i < dvert->totweight; i++ ) {
- if( dvert->dw[i].def_nr == nIndex ) {
- mvert = ( ( Mesh * ) object->data )->
- mvert + k;
- weight = dvert->dw[i].weight;
- //printf("index =%3d weight:%10f\n", k, weight);
-
- if( weightRet == 1 )
- PyList_SetItem( tempVertexList,
- count,
- Py_BuildValue
- ( "(i,f)", k,
- weight ) );
- else if( weightRet == 0 )
- PyList_SetItem( tempVertexList,
- count,
- Py_BuildValue
- ( "i", k ) );
-
- count++;
- }
- }
- }
- } else //do single vertex
- {
- //loop list adding verts to group
- for( x = 0; x < PyList_Size( listObject ); x++ ) {
- if( !
- ( PyArg_Parse
- ( ( PyList_GetItem( listObject, x ) ), "i",
- &tempInt ) ) ) {
- Py_DECREF(tempVertexList);
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list integer not parseable" );
- }
- if( tempInt < 0
- || tempInt >=
- ( ( Mesh * ) object->data )->totvert ) {
- Py_DECREF(tempVertexList);
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "bad vertex index in list" );
- }
- num = tempInt;
- dvert = ( ( Mesh * ) object->data )->dvert + num;
- for( i = 0; i < dvert->totweight; i++ ) {
- l1 = TRUE;
- if( dvert->dw[i].def_nr == nIndex ) {
- l2 = TRUE;
- mvert = ( ( Mesh * ) object->data )->
- mvert + num;
-
- weight = dvert->dw[i].weight;
- //printf("index =%3d weight:%10f\n", num, weight);
-
- if( weightRet == 1 ) {
- PyList_SetItem( tempVertexList,
- count,
- Py_BuildValue
- ( "(i,f)", num,
- weight ) );
- } else if( weightRet == 0 )
- PyList_SetItem( tempVertexList,
- count,
- Py_BuildValue
- ( "i", num ) );
-
- count++;
- }
- if( l2 == FALSE )
- printf( "vertex at index %d is not part of passed group...\n", tempInt );
- }
- if( l1 == FALSE )
- printf( "vertex at index %d is not assigned to a vertex group...\n", tempInt );
-
- l1 = l2 = FALSE; //reset flags
- }
- }
- //only return what we need
- vertexList = PyList_GetSlice( tempVertexList, 0, count );
-
- Py_DECREF( tempVertexList );
-
- return ( vertexList );
-}
-
-static PyObject *NMesh_renameVertGroup( PyObject * self, PyObject * args )
-{
- char *oldGr = NULL;
- char *newGr = NULL;
- bDeformGroup *defGroup = NULL;
- /*PyObject *tempStr; */
-
-
- if( !( ( BPy_NMesh * ) self )->object )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- if( !PyArg_ParseTuple( args, "ss", &oldGr, &newGr ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected string & string argument" );
-
- defGroup =
- get_named_vertexgroup( ( ( BPy_NMesh * ) self )->object,
- oldGr );
- if( defGroup == NULL )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Couldn't find the expected vertex group" );
-
- PyOS_snprintf( defGroup->name, 32, newGr );
- unique_vertexgroup_name( defGroup, ( ( BPy_NMesh * ) self )->object );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *NMesh_getVertGroupNames( PyObject * self )
-{
- bDeformGroup *defGroup;
- PyObject *list, *tmpstr;
-
- if( !( ( BPy_NMesh * ) self )->object )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This mesh must be linked to an object" );
-
- list = PyList_New( 0 );
- for( defGroup = ( ( ( BPy_NMesh * ) self )->object )->defbase.first;
- defGroup; defGroup = defGroup->next ) {
-
- tmpstr = PyString_FromString( defGroup->name );
- if( PyList_Append( list, tmpstr) < 0 ) {
- Py_XDECREF(list);
- Py_XDECREF(tmpstr);
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Couldn't add item to list" );
- }
- Py_XDECREF(tmpstr);
- }
-
- return list;
-}
-
-static PyObject *NMesh_transform (PyObject *self, PyObject *args)
-{
- BPy_NMesh *nmesh = ( BPy_NMesh * ) self;
- BPy_NMVert *mv;
- PyObject *ob1 = NULL;
- MatrixObject *mat;
- float vx, vy, vz;
- int i, recalc_normals = 0;
-
- if( !PyArg_ParseTuple( args, "O!|i", &matrix_Type, &ob1, &recalc_normals ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected matrix and optionally an int as arguments" ) );
-
- mat = ( MatrixObject * ) ob1;
-
- if( mat->colSize != 4 || mat->rowSize != 4 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "matrix must be a 4x4 transformation matrix\n"
- "for example as returned by object.getMatrix()" ) );
-
- /* loop through all the verts and transform locations by the supplied
- * matrix */
- for( i = 0; i < PySequence_Length(nmesh->verts); i++ ) {
- mv = ( BPy_NMVert * ) PySequence_GetItem( nmesh->verts, i );
- vx = mv->co[0];
- vy = mv->co[1];
- vz = mv->co[2];
-
- /* Mat4MulVecfl(mat->matrix, mv->co); */
- mv->co[0] = vx*mat->matrix[0][0] + vy*mat->matrix[1][0] +
- vz*mat->matrix[2][0] + mat->matrix[3][0];
- mv->co[1] = vx*mat->matrix[0][1] + vy*mat->matrix[1][1] +
- vz*mat->matrix[2][1] + mat->matrix[3][1];
- mv->co[2] = vx*mat->matrix[0][2] + vy*mat->matrix[1][2] +
- vz*mat->matrix[2][2] + mat->matrix[3][2];
-
- Py_DECREF(mv);
- }
-
- if ( recalc_normals ) {
- /* loop through all the verts and transform normals by the inverse
- * of the transpose of the supplied matrix */
- float invmat[4][4];
-
- /* we only need to invert a 3x3 submatrix, because the 4th component of
- * affine vectors is 0, but Mat4Invert reports non invertible matrices */
- if (!Mat4Invert((float(*)[4])*invmat, (float(*)[4])*mat->matrix))
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "given matrix is not invertible");
-
- for( i = 0; i < PySequence_Length(nmesh->verts); i++ ) {
- mv = ( BPy_NMVert * ) PySequence_GetItem( nmesh->verts, i );
- vx = mv->no[0];
- vy = mv->no[1];
- vz = mv->no[2];
- mv->no[0] = vx*invmat[0][0] + vy*invmat[0][1] + vz*invmat[0][2];
- mv->no[1] = vx*invmat[1][0] + vy*invmat[1][1] + vz*invmat[1][2];
- mv->no[2] = vx*invmat[2][0] + vy*invmat[2][1] + vz*invmat[2][2];
- Normalize(mv->no);
- Py_DECREF(mv);
- }
- }
-
- /* should we alternatively return a list of changed verts (and preserve
- * the original ones) ? */
- Py_RETURN_NONE;
-}
diff --git a/source/blender/python/api2_2x/NMesh.h b/source/blender/python/api2_2x/NMesh.h
deleted file mode 100644
index 0186d6a52b2..00000000000
--- a/source/blender/python/api2_2x/NMesh.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Jordi Rovira i Bonnet, Joseph Gilbert.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* Most of this file comes from opy_nmesh.[ch] in the old bpython dir */
-
-#ifndef EXPP_NMESH_H
-#define EXPP_NMESH_H
-
-#include <Python.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_customdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "Material.h"
-#include "Image.h"
-
-/* EXPP PyType Objects */
-extern PyTypeObject NMesh_Type;
-extern PyTypeObject NMFace_Type;
-extern PyTypeObject NMVert_Type;
-extern PyTypeObject NMCol_Type;
-extern PyTypeObject NMEdge_Type;
-
-
-struct BPy_Object;
-
-/* These are from blender/src/editdeform.c, should be declared elsewhere,
- * maybe in BIF_editdeform.h, after proper testing of vgrouping methods XXX */
-
-extern void add_vert_defnr( Object * ob, int def_nr, int vertnum, float weight,
- int assignmode );
-extern void remove_vert_def_nr( Object * ob, int def_nr, int vertnum );
-
-
-
-/* Type checking for EXPP PyTypes */
-#define BPy_NMesh_Check(v) ((v)->ob_type == &NMesh_Type)
-#define BPy_NMFace_Check(v) ((v)->ob_type == &NMFace_Type)
-#define BPy_NMVert_Check(v) ((v)->ob_type == &NMVert_Type)
-#define BPy_NMCol_Check(v) ((v)->ob_type == &NMCol_Type)
-#define BPy_NMEdge_Check(v) ((v)->ob_type == &NMEdge_Type)
-
-/* Typedefs for the new types */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- unsigned char r, g, b, a;
-
-} BPy_NMCol; /* an NMesh color: [r,g,b,a] */
-
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- float co[3];
- float no[3];
- float uvco[3];
- int index;
- char flag; /* see MVert flag in DNA_meshdata_types */
-
-} BPy_NMVert; /* an NMesh vertex */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- PyObject * v;
- PyObject *uv;
- PyObject *col;
- short mode;
- short flag; /* tface->flag */
- unsigned char transp;
- Image *image;
- char mat_nr, mf_flag /* was char smooth */;
- int orig_index;
-
-} BPy_NMFace; /* an NMesh face */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- PyObject *v1;
- PyObject *v2;
- char crease;
- short flag;
-} BPy_NMEdge; /* an NMesh edge */
-
-typedef struct {
- PyObject_HEAD /* required python macro */
- Mesh * mesh; /* libdata must be second */
- Object *object; /* for vertex grouping info, since it's stored on the object */
- PyObject *name;
- PyObject *materials;
- PyObject *verts;
- PyObject *faces;
- PyObject *edges;
- int sel_face; /*@ XXX remove */
- short smoothresh; /* max AutoSmooth angle */
- short subdiv[2]; /* SubDiv Levels: display and rendering */
- short mode; /* see the EXPP_NMESH_* defines in the beginning of this file */
- char flags;
-
-#define NMESH_HASMCOL (1<<0)
-#define NMESH_HASVERTUV (1<<1)
-#define NMESH_HASFACEUV (1<<2)
-
- /* stores original data that is not accesible through NMesh, but that we
- still want to preserve, indexed by orig_index in NMFace */
- CustomData fdata;
- int totfdata;
-
-} BPy_NMesh;
-
-/* PROTOS */
-
-PyObject *NMesh_Init( void );
-PyObject *NMesh_CreatePyObject( Mesh * me, Object * ob );
-Mesh *NMesh_FromPyObject( PyObject * pyobj, Object * ob );
-
-void mesh_update( Mesh * mesh , Object * ob );
-PyObject *new_NMesh( Mesh * oldmesh );
-Mesh *Mesh_fromNMesh( BPy_NMesh * nmesh );
-PyObject *NMesh_assignMaterials_toObject( BPy_NMesh * nmesh, Object * ob );
-Material **nmesh_updateMaterials( BPy_NMesh * nmesh );
-Material **newMaterialList_fromPyList( PyObject * list );
-
-
-#endif /* EXPP_NMESH_H */
diff --git a/source/blender/python/api2_2x/Node.c b/source/blender/python/api2_2x/Node.c
deleted file mode 100644
index 792b2331508..00000000000
--- a/source/blender/python/api2_2x/Node.c
+++ /dev/null
@@ -1,1673 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006, Blender Foundation
- * All rights reserved.
- *
- * Original code is this file
- *
- * Contributor(s): Nathan Letwory
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Node.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_utildefines.h"
-
-#include "DNA_material_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-#include "vector.h"
-
-static PyObject *Node_repr( BPy_Node * self );
-static int Node_compare(BPy_Node *a, BPy_Node *b);
-static PyObject *ShadeInput_repr( BPy_ShadeInput * self );
-static int ShadeInput_compare(BPy_ShadeInput *a, BPy_ShadeInput *b);
-static BPy_ShadeInput *ShadeInput_CreatePyObject(ShadeInput *shi);
-
-/* node socket type */
-
-static PyObject *NodeSocket_getName(BPy_NodeSocket *self, void *unused)
-{
- return PyString_FromString(self->name);
-}
-
-static int NodeSocket_setName(BPy_NodeSocket *self, PyObject *value, void *unused)
-{
- char *name = NULL;
-
- if (!PyString_Check(value))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a string" );
-
- name = PyString_AsString(value);
-
- if (!name)
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "couldn't convert value to string!");
-
- BLI_strncpy(self->name, name, NODE_MAXSTR);
-
- return 0;
-}
-
-static PyObject *NodeSocket_getVal(BPy_NodeSocket *self, void *unused)
-{
- PyObject *pyret = NULL;
-
- if (self->type == SOCK_VALUE) {
- pyret = PyFloat_FromDouble(self->val[0]);
- }
- else { /* VECTOR or RGBA */
- pyret = newVectorObject(self->val, self->type, Py_NEW);
-
- if (!pyret)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "couldn't create vector object!");
- }
-
- return pyret;
-}
-
-static int NodeSocket_setVal(BPy_NodeSocket *self, PyObject *value, void *unused)
-{
- int error = 0;
-
- if (PySequence_Check(value)) {
- PyObject *item, *fpyval;
- int i, len;
-
- len = PySequence_Size(value);
-
- if (len == 3 || len == 4) {
- for (i = 0; i < len; i++) {
- item = PySequence_GetItem(value, i);
- fpyval = PyNumber_Float(item);
- if (!fpyval) {
- Py_DECREF(item);
- error = 1;
- break;
- }
- self->val[i] = (float)PyFloat_AsDouble(fpyval);
- Py_DECREF(item);
- Py_DECREF(fpyval);
- }
- if (len == 3)
- self->type = SOCK_VECTOR;
- else /* len == 4 */
- self->type = SOCK_RGBA;
- }
- else error = 1;
- }
- else if (VectorObject_Check(value)) {
- VectorObject *vecOb = (VectorObject *)value;
- short vlen = vecOb->size;
-
- if (vlen == 3 || vlen == 4) {
- VECCOPY(self->val, vecOb->vec); /* copies 3 values */
- if (vlen == 3)
- self->type = SOCK_VECTOR;
- else {
- self->val[3] = vecOb->vec[3];
- self->type = SOCK_RGBA;
- }
- }
- else error = 1;
- }
- else if (PyNumber_Check(value)) {
- self->val[0] = (float)PyFloat_AsDouble(value);
- self->type = SOCK_VALUE;
- }
- else error = 1;
-
- if (error)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float or a sequence (or vector) of 3 or 4 floats" );
- return 0;
-}
-
-static PyObject *NodeSocket_getMin(BPy_NodeSocket *self, void *unused)
-{
- return PyFloat_FromDouble(self->min);
-}
-
-static int NodeSocket_setMin(BPy_NodeSocket *self, PyObject *value, void *unused)
-{
- PyObject *pyval = PyNumber_Float(value);
-
- if (!pyval)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float number" );
-
- self->min = (float)PyFloat_AsDouble(pyval);
- Py_DECREF(pyval);
-
- return 0;
-}
-
-static PyObject *NodeSocket_getMax(BPy_NodeSocket *self, void *unused)
-{
- return PyFloat_FromDouble(self->max);
-}
-
-static int NodeSocket_setMax(BPy_NodeSocket *self, PyObject *value, void *unused)
-{
- PyObject *pyval = PyNumber_Float(value);
-
- if (!pyval)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a float number" );
-
- self->max = (float)PyFloat_AsDouble(pyval);
- Py_DECREF(pyval);
-
- return 0;
-}
-
-static PyGetSetDef NodeSocket_getseters[] = {
- {"name", (getter)NodeSocket_getName, (setter)NodeSocket_setName,
- "This socket's name", NULL},
- {"val", (getter)NodeSocket_getVal, (setter)NodeSocket_setVal,
- "This socket's data value(s)", NULL},
- {"min", (getter)NodeSocket_getMin, (setter)NodeSocket_setMin,
- "This socket's min possible value (lower range limit)", NULL},
- {"max", (getter)NodeSocket_getMax, (setter)NodeSocket_setMax,
- "This socket's max possible value (upper range limit)", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-static void NodeSocket_dealloc(BPy_NodeSocket *self)
-{
- self->ob_type->tp_free((PyObject *)self);
-}
-
-static PyObject *NodeSocket_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyObject *pysocket = type->tp_alloc(type, 0);
-
- if (!pysocket)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError, "couldn't create socket type!");
-
- return pysocket;
-}
-
-static int NodeSocket_init(BPy_NodeSocket *self, PyObject *args, PyObject *kwargs)
-{
- char *name = NULL;
- float min = 0.0f, max = 1.0f;
- PyObject *val = NULL;
- static char *kwlist[] = {"name", "val", "min", "max", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Off", kwlist, &name, &val, &min, &max)){
- return EXPP_ReturnIntError(PyExc_AttributeError, "expected a string and optionally:\n1) a float or a sequence (or vector) of 3 or 4 floats and\n2) two floats");
- }
-
- BLI_strncpy(self->name, name, NODE_MAXSTR);
-
- self->min = min;
- self->max = max;
-
- if (val)
- return NodeSocket_setVal(self, val, NULL);
- /* else */
- self->type = SOCK_VALUE;
- self->val[0] = 0.0f;
-
- return 0;
-}
-
-static PyObject *NodeSocket_copy(BPy_NodeSocket *self)
-{
- BPy_NodeSocket *copied;
-
- copied = (BPy_NodeSocket*)NodeSocket_new(&NodeSocket_Type, NULL, NULL);
-
- if (!copied) return NULL; /* error already set in NodeSocket_new */
-
- BLI_strncpy(copied->name, self->name, NODE_MAXSTR);
- copied->min = self->min;
- copied->max = self->max;
- copied->type = self->type;
- memcpy(copied->val, self->val, 4*sizeof(float));
-
- return (PyObject *)copied;
-}
-
-static PyMethodDef BPy_NodeSocket_methods[] = {
- {"__copy__", ( PyCFunction ) NodeSocket_copy, METH_NOARGS,
- "() - Makes a copy of this node socket."},
- {"copy", ( PyCFunction ) NodeSocket_copy, METH_NOARGS,
- "() - Makes a copy of this node socket."},
- {NULL, NULL, 0, NULL}
-};
-
-PyTypeObject NodeSocket_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.Socket", /* char *tp_name; */
- sizeof( BPy_NodeSocket ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- (destructor)NodeSocket_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/input buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- 0, //( getiterfunc) MVertSeq_getIter, /* getiterfunc tp_iter; */
- 0, //( iternextfunc ) MVertSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_NodeSocket_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NodeSocket_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- (initproc)NodeSocket_init, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NodeSocket_new, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/**
- * Take the descriptions from tuple and create sockets for those in socks
- * socks is a socketstack from a bNodeTypeInfo
- */
-static int pysockets_to_blendersockets(PyObject *tuple, bNodeSocketType **socks, int stage, int limit) {
- int len = 0, a = 0, pos = 0, retval = 0;
- short stype;
- BPy_NodeSocket *pysock;
- bNodeSocketType *nsocks = NULL;
-
- if (BTST2(stage, NODE_DYNAMIC_READY, NODE_DYNAMIC_ADDEXIST))
- return 0; /* already has sockets */
-
- len = PyTuple_Size(tuple);
-
- if (len >= MAX_SOCKET) {
- char error_msg[70];
- PyOS_snprintf(error_msg, sizeof(error_msg),
- "limit exceeded: each node can't have more than %d i/o sockets", MAX_SOCKET - 1);
- PyErr_SetString(PyExc_AttributeError, error_msg);
- len = 0;
- retval = -1;
- }
-
- nsocks = MEM_callocN(sizeof(bNodeSocketType)*(len+1), "bNodeSocketType in Node.c");
-
- for (pos = 0, a = 0; pos< len; pos++, a++) {
- pysock = (BPy_NodeSocket *)PyTuple_GetItem(tuple, pos);/*borrowed*/
-
- if (!BPy_NodeSocket_Check(pysock)) {
- PyErr_SetString(PyExc_AttributeError, "expected a sequence of node sockets");
- retval = -1;
- break;
- }
-
- stype = pysock->type;
-
- nsocks[a].type = stype;
- nsocks[a].limit = limit;
-
- nsocks[a].name = BLI_strdupn(pysock->name, NODE_MAXSTR);
-
- nsocks[a].min = pysock->min;
- nsocks[a].max = pysock->max;
-
- if (stype > SOCK_VALUE) {
- float *vec = pysock->val;
-
- nsocks[a].val1 = vec[0];
- nsocks[a].val2 = vec[1];
- nsocks[a].val3 = vec[2];
-
- if (stype == SOCK_RGBA)
- nsocks[a].val4 = vec[3];
- }
- else /* SOCK_VALUE */
- nsocks[a].val1 = pysock->val[0];
- }
-
- nsocks[a].type = -1;
-
- *socks = nsocks;
-
- return retval;
-}
-
-static void NodeSocketLists_dealloc(BPy_NodeSocketLists *self)
-{
- Py_DECREF(self->input);
- Py_DECREF(self->output);
- self->ob_type->tp_free((PyObject *)self);
-}
-
-static PyObject *Map_socketdef_getter(BPy_NodeSocketLists *self, void *closure)
-{
- PyObject *sockets = NULL;
-
- switch (GET_INT_FROM_POINTER(closure)) {
- case 'I': /* inputs */
- Py_INCREF(self->input);
- sockets = self->input;
- break;
- case 'O': /* outputs */
- Py_INCREF(self->output);
- sockets = self->output;
- break;
- default:
- fprintf(stderr, "DEBUG pynodes: wrong option in Map_socketdef_getter\n");
- Py_INCREF(Py_None);
- sockets = Py_None;
- break;
- }
-
- return sockets;
-}
-
-static int Map_socketdef(BPy_NodeSocketLists *self, PyObject *args, void *closure)
-{
- bNode *node = NULL;
- PyObject *tuple = NULL;
- int ret = 0;
-
- node = self->node;
-
- if(!node) {
- fprintf(stderr,"DEBUG pynodes: No bNode in BPy_Node (Map_socketdef)\n");
- return 0;
- }
-
- if(BTST2(node->custom1, NODE_DYNAMIC_READY, NODE_DYNAMIC_ADDEXIST))
- return 0;
-
- switch(GET_INT_FROM_POINTER(closure)) {
- case 'I':
- if (args) {
- if(PySequence_Check(args)) {
- tuple = PySequence_Tuple(args);
- ret = pysockets_to_blendersockets(tuple,
- &(node->typeinfo->inputs), node->custom1, 1);
- Py_DECREF(self->input);
- self->input = tuple;
- } else {
- return(EXPP_ReturnIntError( PyExc_AttributeError, "INPUT must be a List of Lists or Tuples"));
- }
- }
- break;
- case 'O':
- if (args) {
- if(PyList_Check(args)) {
- tuple = PySequence_Tuple(args);
- ret = pysockets_to_blendersockets(tuple,
- &(node->typeinfo->outputs), node->custom1, 0);
- Py_DECREF(self->output);
- self->output = tuple;
- } else {
- return(EXPP_ReturnIntError( PyExc_AttributeError, "OUTPUT must be a List of Lists or Tuples"));
- }
- }
- break;
- default:
- fprintf(stderr,"DEBUG pynodes: got no list in Map_socketdef\n");
- break;
- }
-
- if (ret == -1) {
- node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ERROR);
- }
-
- return 0;
-}
-
-static PyGetSetDef NodeSocketLists_getseters[] = {
- {"input", (getter)Map_socketdef_getter, (setter)Map_socketdef,
- "Set this node's input sockets (list of lists or tuples)",
- (void *)'I'},
- {"i" /*alias*/, (getter)Map_socketdef_getter, (setter)Map_socketdef,
- "Set this node's input sockets (list of lists or tuples)",
- (void *)'I'},
- {"output", (getter)Map_socketdef_getter, (setter)Map_socketdef,
- "Set this node's output sockets (list of lists or tuples)",
- (void *)'O'},
- {"o" /*alias*/, (getter)Map_socketdef_getter, (setter)Map_socketdef,
- "Set this node's output sockets (list of lists or tuples)",
- (void *)'O'},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-PyTypeObject NodeSocketLists_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.SocketLists", /* char *tp_name; */
- sizeof( BPy_NodeSocketLists ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- (destructor)NodeSocketLists_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/input buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- 0, //( getiterfunc) MVertSeq_getIter, /* getiterfunc tp_iter; */
- 0, //( iternextfunc ) MVertSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- 0, //BPy_MVertSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NodeSocketLists_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-BPy_NodeSocketLists *Node_CreateSocketLists(bNode *node) {
- BPy_NodeSocketLists *socklists = PyObject_NEW(BPy_NodeSocketLists, &NodeSocketLists_Type);
- socklists->node = node;
- socklists->input = PyList_New(0);
- socklists->output = PyList_New(0);
- return socklists;
-}
-
-/***************************************/
-
-static int Sockinmap_len ( BPy_SockMap * self) {
- bNode *node = self->node;
- bNodeType *tinfo;
- int a = 0;
-
- if (!node) return 0;
-
- tinfo = node->typeinfo;
-
- if (BNTST(node->custom1, NODE_DYNAMIC_READY)) return 0;
-
- if (tinfo && tinfo->inputs) {
- while(self->node->typeinfo->inputs[a].type!=-1)
- a++;
- }
- return a;
-}
-
-static int sockinmap_has_key( BPy_SockMap *self, char *strkey) {
- bNode *node = self->node;
- bNodeType *tinfo;
- int a = 0;
-
- if (!node || !strkey) return -1;
-
- tinfo = node->typeinfo;
-
- if(tinfo && tinfo->inputs){
- while(self->node->typeinfo->inputs[a].type!=-1) {
- if(BLI_strcaseeq(self->node->typeinfo->inputs[a].name, strkey)) {
- return a;
- }
- a++;
- }
- }
- return -1;
-}
-
-PyObject *Sockinmap_subscript(BPy_SockMap *self, PyObject *pyidx) {
- int idx;
-
- if (!self->node)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError, "no access to Blender node data!");
-
- if (PyString_Check(pyidx)) {
- idx = sockinmap_has_key(self, PyString_AsString(pyidx));
- }
- else if(PyInt_Check(pyidx)) {
- int len = Sockinmap_len(self);
- idx = (int)PyInt_AsLong(pyidx);
- if (idx < 0 || idx >= len)
- return EXPP_ReturnPyObjError(PyExc_IndexError, "index out of range");
- }
- else if (PySlice_Check(pyidx)) {
- return EXPP_ReturnPyObjError(PyExc_ValueError, "slices not implemented");
- } else {
- return EXPP_ReturnPyObjError(PyExc_IndexError, "index must be an int or a string");
- }
-
- if(idx<0) { /* we're not as nice as Python */
- return EXPP_ReturnPyObjError(PyExc_IndexError, "invalid socket index");
- }
-
- switch(self->node->typeinfo->inputs[idx].type) {
- case SOCK_VALUE:
- return Py_BuildValue("f", self->stack[idx]->vec[0]);
- break;
- case SOCK_VECTOR:
- return Py_BuildValue("(fff)", self->stack[idx]->vec[0], self->stack[idx]->vec[1], self->stack[idx]->vec[2]);
- break;
- case SOCK_RGBA:
- /* otherwise RGBA tuple */
- return Py_BuildValue("(ffff)", self->stack[idx]->vec[0], self->stack[idx]->vec[1], self->stack[idx]->vec[2], self->stack[idx]->vec[3]);
- break;
- default:
- break;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Sockinmap_getAttr(BPy_SockMap *self, char *attr)
-{
- PyObject *pyob = NULL;
- int idx;
-
- idx = sockinmap_has_key(self, attr);
-
- if (idx < 0)
- return EXPP_ReturnPyObjError(PyExc_AttributeError, "unknown input socket name");
-
- switch(self->node->typeinfo->inputs[idx].type) {
- case SOCK_VALUE:
- pyob = Py_BuildValue("f", self->stack[idx]->vec[0]);
- break;
- case SOCK_VECTOR:
- pyob = Py_BuildValue("(fff)", self->stack[idx]->vec[0], self->stack[idx]->vec[1], self->stack[idx]->vec[2]);
- break;
- case SOCK_RGBA:
- pyob = Py_BuildValue("(ffff)", self->stack[idx]->vec[0], self->stack[idx]->vec[1], self->stack[idx]->vec[2], self->stack[idx]->vec[3]);
- break;
- default:
- break;
- }
-
- return pyob;
-}
-
-/* read only */
-static PyMappingMethods Sockinmap_as_mapping = {
- ( inquiry ) Sockinmap_len, /* mp_length */
- ( binaryfunc ) Sockinmap_subscript, /* mp_subscript */
- ( objobjargproc ) 0 /* mp_ass_subscript */
-};
-
-PyTypeObject SockInMap_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.InputSockets", /* char *tp_name; */
- sizeof( BPy_SockMap ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- (getattrfunc) Sockinmap_getAttr,/* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &Sockinmap_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- 0, //( getiterfunc) MVertSeq_getIter, /* getiterfunc tp_iter; */
- 0, //( iternextfunc ) MVertSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- 0, //BPy_MVertSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static int Sockoutmap_len ( BPy_SockMap * self) {
- bNode *node = self->node;
- bNodeType *tinfo;
- int a = 0;
-
- if (!node) return 0;
-
- tinfo = node->typeinfo;
-
- if (tinfo && tinfo->outputs) {
- while(self->node->typeinfo->outputs[a].type!=-1)
- a++;
- }
- return a;
-}
-
-static int sockoutmap_has_key(BPy_SockMap *self, char *strkey) {
- bNode *node = self->node;
- bNodeType *tinfo;
- int a = 0;
-
- if (!node) return -1;
-
- tinfo = node->typeinfo;
-
- if(tinfo && tinfo->outputs){
- while(self->node->typeinfo->outputs[a].type!=-1) {
- if(BLI_strcaseeq(self->node->typeinfo->outputs[a].name, strkey)) {
- return a;
- }
- a++;
- }
- }
- return -1;
-}
-
-static int Sockoutmap_assign_subscript(BPy_SockMap *self, PyObject *pyidx, PyObject *value) {
- int i, idx, len, type, wanted_len = 0;
- PyObject *val;
- PyObject *items[4];
-
- if (!self->node)
- return EXPP_ReturnIntError(PyExc_RuntimeError, "no access to Blender node data!");
-
- if (PyInt_Check(pyidx)) {
- idx = (int)PyInt_AsLong(pyidx);
- if (idx < 0 || idx >= Sockoutmap_len(self))
- return EXPP_ReturnIntError(PyExc_IndexError, "index out of range");
- }
- else if (PyString_Check(pyidx)) {
- idx = sockoutmap_has_key(self, PyString_AsString(pyidx));
- }
- else if (PySlice_Check(pyidx)) {
- return EXPP_ReturnIntError(PyExc_ValueError, "slices not yet implemented");
- } else {
- return EXPP_ReturnIntError(PyExc_IndexError, "index must be a positive int or a string");
- }
-
- if (idx < 0)
- return EXPP_ReturnIntError(PyExc_IndexError, "index must be a positive int or a string");
-
- type = self->node->typeinfo->outputs[idx].type;
-
- if (type == SOCK_VALUE) {
- val = PyNumber_Float(value);
- if (!val)
- return EXPP_ReturnIntError(PyExc_AttributeError, "expected a float value");
- self->stack[idx]->vec[0] = (float)PyFloat_AsDouble(val);
- Py_DECREF(val);
- }
- else {
- val = PySequence_Fast(value, "expected a numeric tuple or list");
- if (!val) return -1;
-
- len = PySequence_Fast_GET_SIZE(val);
-
- if (type == SOCK_VECTOR) {
- wanted_len = 3;
- } else { /* SOCK_RGBA */
- wanted_len = 4;
- }
-
- if (len != wanted_len) {
- Py_DECREF(val);
- PyErr_SetString(PyExc_AttributeError, "wrong number of items in list or tuple");
- fprintf(stderr, "\nExpected %d numeric values, got %d.", wanted_len, len);
- return -1;
- }
-
- for (i = 0; i < len; i++) {
- items[i] = PySequence_Fast_GET_ITEM(val, i); /* borrowed */
- if (!PyNumber_Check(items[i])) {
- Py_DECREF(val);
- return EXPP_ReturnIntError(PyExc_AttributeError, "expected a *numeric* tuple or list");
- }
- }
-
- self->stack[idx]->vec[0] = (float)PyFloat_AsDouble(items[0]);
- self->stack[idx]->vec[1] = (float)PyFloat_AsDouble(items[1]);
- self->stack[idx]->vec[2] = (float)PyFloat_AsDouble(items[2]);
-
- if (type == SOCK_RGBA)
- self->stack[idx]->vec[3] = (float)PyFloat_AsDouble(items[3]);
-
- Py_DECREF(val);
- }
-
- return 0;
-}
-
-static int sockoutmap_set_attr(bNodeStack **stack, short type, short idx, PyObject *value)
-{
- PyObject *val;
- PyObject *items[4];
- int i;
- short len, wanted_len;
-
- if (!stack || !stack[idx]) return 0; /* no MaterialNode */
-
- if (type == SOCK_VALUE) {
- val = PyNumber_Float(value);
- if (!val)
- return EXPP_ReturnIntError(PyExc_AttributeError, "expected a float value");
- stack[idx]->vec[0] = (float)PyFloat_AsDouble(val);
- Py_DECREF(val);
- }
- else {
- val = PySequence_Fast(value, "expected a numeric tuple or list");
- if (!val) return -1;
-
- len = PySequence_Fast_GET_SIZE(val);
-
- if (type == SOCK_VECTOR) {
- wanted_len = 3;
- } else { /* SOCK_RGBA */
- wanted_len = 4;
- }
-
- if (len != wanted_len) {
- Py_DECREF(val);
- PyErr_SetString(PyExc_AttributeError, "wrong number of items in list or tuple");
- fprintf(stderr, "\nExpected %d numeric values, got %d.", wanted_len, len);
- return -1;
- }
-
- for (i = 0; i < len; i++) {
- items[i] = PySequence_Fast_GET_ITEM(val, i); /* borrowed */
- if (!PyNumber_Check(items[i])) {
- Py_DECREF(val);
- return EXPP_ReturnIntError(PyExc_AttributeError, "expected a *numeric* tuple or list");
- }
- }
-
- stack[idx]->vec[0] = (float)PyFloat_AsDouble(items[0]);
- stack[idx]->vec[1] = (float)PyFloat_AsDouble(items[1]);
- stack[idx]->vec[2] = (float)PyFloat_AsDouble(items[2]);
-
- if (type == SOCK_RGBA)
- stack[idx]->vec[3] = (float)PyFloat_AsDouble(items[3]);
-
- Py_DECREF(val);
- }
-
- return 0;
-}
-
-static int Sockoutmap_setAttr(BPy_SockMap *self, char *name, PyObject *value) {
- short idx, type;
-
- if (!self->node)
- return EXPP_ReturnIntError(PyExc_RuntimeError, "no access to Blender node data!");
-
- idx = sockoutmap_has_key(self, name);
-
- if (idx < 0)
- return EXPP_ReturnIntError(PyExc_AttributeError, "unknown output socket name");
-
- type = self->node->typeinfo->outputs[idx].type;
-
- return sockoutmap_set_attr(self->stack, type, idx, value);
-}
-/* write only */
-static PyMappingMethods Sockoutmap_as_mapping = {
- ( inquiry ) Sockoutmap_len, /* mp_length */
- ( binaryfunc ) 0, /* mp_subscript */
- ( objobjargproc ) Sockoutmap_assign_subscript /* mp_ass_subscript */
-};
-
-PyTypeObject SockOutMap_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.OutputSockets", /* char *tp_name; */
- sizeof( BPy_SockMap ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- (setattrfunc) Sockoutmap_setAttr,/* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- NULL, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &Sockoutmap_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- 0, //( getiterfunc) MVertSeq_getIter, /* getiterfunc tp_iter; */
- 0, //( iternextfunc ) MVertSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- 0, //BPy_MVertSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-static BPy_SockMap *Node_CreateInputMap(bNode *node, bNodeStack **stack) {
- BPy_SockMap *map = PyObject_NEW(BPy_SockMap, &SockInMap_Type);
- map->node = node;
- map->stack = stack;
- return map;
-}
-
-static PyObject *Node_GetInputMap(BPy_Node *self) {
- BPy_SockMap *inmap = Node_CreateInputMap(self->node, self->in);
- return (PyObject *)(inmap);
-}
-
-#define SURFACEVIEWVECTOR 0
-#define VIEWNORMAL 1
-#define SURFACENORMAL 2
-#define GLOBALTEXTURE 3
-#define TEXTURE 4
-#define PIXEL 5
-#define COLOR 6
-#define SPECULAR_COLOR 7
-#define MIRROR_COLOR 8
-#define AMBIENT_COLOR 9
-#define AMBIENT 10
-#define EMIT 11
-#define DISPLACE 12
-#define STRAND 13
-#define STRESS 14
-#define TANGENT 15
-#define SURFACE_D 30
-#define TEXTURE_D 31
-#define GLOBALTEXTURE_D 32
-#define REFLECTION_D 33
-#define NORMAL_D 34
-#define STICKY_D 35
-#define REFRACT_D 36
-#define STRAND_D 37
-
-/* MACRO time: defining shi getters */
-
-/* a couple checks that we can redefine to nothing for a tiny performance
- * gain */
-
-#define SHI_CHECK_SHI\
- if (!self->shi)\
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,\
- "no shade input data!");
-
-#define SHI_CHECK_OB\
- if (!ob)\
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,\
- "couldn't create vector object!");
-
-/* for shi getters: */
-
-#define SHI_GETATTR_f(name, var)\
-static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
-{\
- PyObject *ob = NULL;\
-\
- SHI_CHECK_SHI\
-\
- ob = PyFloat_FromDouble((double)(self->shi->var));\
-\
- SHI_CHECK_OB\
-\
- return ob;\
-}
-
-#define SHI_GETATTR_fvec(name, var, len)\
-static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
-{\
- PyObject *ob = NULL;\
-\
- SHI_CHECK_SHI\
-\
- ob = newVectorObject(self->shi->var, len, Py_NEW);\
-\
- SHI_CHECK_OB\
-\
- return ob;\
-}
-
-#define SHI_GETATTR_2fvec(name, v1, v2, len)\
-static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
-{\
- PyObject *ob = NULL;\
- PyObject *tuple = NULL;\
-\
- SHI_CHECK_SHI\
-\
- tuple = PyTuple_New(2);\
-\
- ob = newVectorObject(self->shi->v1, len, Py_NEW);\
- PyTuple_SET_ITEM(tuple, 0, ob);\
-\
- ob = newVectorObject(self->shi->v2, len, Py_NEW);\
- PyTuple_SET_ITEM(tuple, 1, ob);\
-\
- return tuple;\
-}
-
-#define SHI_GETATTR_3f(name, v1, v2, v3)\
-static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
-{\
- PyObject *ob = NULL;\
- float vec[3];\
-\
- SHI_CHECK_SHI\
-\
- vec[0] = self->shi->v1;\
- vec[1] = self->shi->v2;\
- vec[2] = self->shi->v3;\
-\
- ob = newVectorObject(vec, 3, Py_NEW);\
-\
- SHI_CHECK_OB\
-\
- return ob;\
-}
-
-/* float */
-
-SHI_GETATTR_f(Ambient, amb);
-SHI_GETATTR_f(Emit, emit);
-SHI_GETATTR_f(Strand, strandco);
-SHI_GETATTR_f(Stress, stress);
-
-/* 3 float vars */
-
-SHI_GETATTR_3f(Color, r, g, b)
-SHI_GETATTR_3f(ColorSpecular, specr, specg, specb)
-SHI_GETATTR_3f(ColorMirror, mirr, mirg, mirb)
-SHI_GETATTR_3f(ColorAmbient, ambr, ambg, ambb)
-
-/* float vector */
-
-SHI_GETATTR_fvec(SurfaceViewVector, view, 3)
-SHI_GETATTR_fvec(SurfaceNormal, facenor, 3)
-SHI_GETATTR_fvec(ViewNormal, vn, 3)
-SHI_GETATTR_fvec(TextureGlobal, gl, 3)
-SHI_GETATTR_fvec(Texture, lo, 3)
-SHI_GETATTR_fvec(Displace, displace, 3)
-SHI_GETATTR_fvec(Tangent, tang, 3)
-
-/* two float vectors */
-
-SHI_GETATTR_2fvec(SurfaceD, dxco, dyco, 3)
-SHI_GETATTR_2fvec(TextureD, dxlo, dylo, 3)
-SHI_GETATTR_2fvec(TextureGlobalD, dxgl, dygl, 3)
-SHI_GETATTR_2fvec(ReflectionD, dxref, dyref, 3)
-SHI_GETATTR_2fvec(NormalD, dxno, dyno, 3)
-SHI_GETATTR_2fvec(StickyD, dxsticky, dysticky, 3)
-SHI_GETATTR_2fvec(RefractD, dxrefract, dyrefract, 3)
-
-/* single cases (for now), not macros: */
-
-static PyObject *ShadeInput_getPixel(BPy_ShadeInput *self, void *unused)
-{
- PyObject *ob = NULL;
-
- SHI_CHECK_SHI
-
- ob = Py_BuildValue("(ii)", self->shi->xs, self->shi->ys);
-
- SHI_CHECK_OB
-
- return ob;
-}
-
-static PyObject *ShadeInput_getStrandD(BPy_ShadeInput *self, void *unused)
-{
- PyObject *ob = NULL;
- float vec[2];
-
- SHI_CHECK_SHI
-
- vec[0] = self->shi->dxstrand;
- vec[1] = self->shi->dystrand;
-
- ob = newVectorObject(vec, 2, Py_NEW);
-
- SHI_CHECK_OB
-
- return ob;
-}
-
-static BPy_SockMap *Node_CreateOutputMap(bNode *node, bNodeStack **stack) {
- BPy_SockMap *map = PyObject_NEW(BPy_SockMap, &SockOutMap_Type);
- map->node = node;
- map->stack = stack;
- return map;
-}
-
-static PyObject *Node_GetOutputMap(BPy_Node *self) {
- BPy_SockMap *outmap = Node_CreateOutputMap(self->node, self->out);
- return (PyObject *)outmap;
-}
-
-static PyObject *Node_GetShi(BPy_Node *self) {
- BPy_ShadeInput *shi = ShadeInput_CreatePyObject(self->shi);
- return (PyObject *)shi;
-}
-
-static PyObject *node_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- PyObject *self;
- self = type->tp_alloc(type, 1);
- return self;
-}
-
-static int node_init(BPy_Node *self, PyObject *args, PyObject *kwds)
-{
- return 0;
-}
-
-static PyGetSetDef BPy_Node_getseters[] = {
- {"input",
- (getter)Node_GetInputMap, (setter)NULL,
- "Get the input sockets mapping (dictionary)",
- NULL},
- {"i", /* alias */
- (getter)Node_GetInputMap, (setter)NULL,
- "Get the input sockets mapping (dictionary)",
- NULL},
- {"output",
- (getter)Node_GetOutputMap, (setter)NULL,
- "Get the output sockets mapping (dictionary)",
- NULL},
- {"o", /* alias */
- (getter)Node_GetOutputMap, (setter)NULL,
- "Get the output sockets mapping (dictionary)",
- NULL},
- {"shi",
- (getter)Node_GetShi, (setter)NULL,
- "Get the Shade Input data (ShadeInput)",
- NULL},
- {"s", /* alias */
- (getter)Node_GetShi, (setter)NULL,
- "Get the Shade Input data (ShadeInput)",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-static PyGetSetDef BPy_ShadeInput_getseters[] = {
- {"texture",
- (getter)ShadeInput_getTexture, (setter)NULL,
- "Get the current texture coordinate (3-vector)", NULL},
- {"textureGlobal",
- (getter)ShadeInput_getTextureGlobal, (setter)NULL,
- "Get the current global texture coordinate (3-vector)", NULL},
- {"surfaceNormal",
- (getter)ShadeInput_getSurfaceNormal, (setter)NULL,
- "Get the current surface normal (3-vector)", NULL},
- {"viewNormal",
- (getter)ShadeInput_getViewNormal, (setter)NULL,
- "Get the current view normal (3-vector)", NULL},
- {"surfaceViewVector",
- (getter)ShadeInput_getSurfaceViewVector, (setter)NULL,
- "Get the vector pointing to the viewpoint from the point being shaded (3-vector)", NULL},
- {"pixel",
- (getter)ShadeInput_getPixel, (setter)NULL,
- "Get the x,y-coordinate for the pixel rendered (3-vector)", NULL},
- {"color",
- (getter)ShadeInput_getColor, (setter)NULL,
- "Get the color for the point being shaded (3-vector)", NULL},
- {"specularColor",
- (getter)ShadeInput_getColorSpecular, (setter)NULL,
- "Get the specular color for the point being shaded (3-vector)", NULL},
- {"mirrorColor",
- (getter)ShadeInput_getColorMirror, (setter)NULL,
- "Get the mirror color for the point being shaded (3-vector)", NULL},
- {"ambientColor",
- (getter)ShadeInput_getColorAmbient, (setter)NULL,
- "Get the ambient color for the point being shaded (3-vector)", NULL},
- {"ambient",
- (getter)ShadeInput_getAmbient, (setter)NULL,
- "Get the ambient factor for the point being shaded (float)", NULL},
- {"emit",
- (getter)ShadeInput_getEmit, (setter)NULL,
- "Get the emit factor for the point being shaded (float)", NULL},
- {"displace",
- (getter)ShadeInput_getDisplace, (setter)NULL,
- "Get the displace vector for the point being shaded (3-vector)", NULL},
- {"strand",
- (getter)ShadeInput_getStrand, (setter)NULL,
- "Get the strand factor(float)", NULL},
- {"stress",
- (getter)ShadeInput_getStress, (setter)NULL,
- "Get the stress factor(float)", NULL},
- {"tangent",
- (getter)ShadeInput_getTangent, (setter)NULL,
- "Get the tangent vector (3-vector)", NULL},
- {"surfaceD",
- (getter)ShadeInput_getSurfaceD, (setter)NULL,
- "Get the surface d (tuple with pair of 3-vectors)", NULL},
- {"textureD",
- (getter)ShadeInput_getTextureD, (setter)NULL,
- "Get the texture d (tuple with pair of 3-vectors)", NULL},
- {"textureGlobalD",
- (getter)ShadeInput_getTextureGlobalD, (setter)NULL,
- "Get the global texture d (tuple with pair of 3-vectors)", NULL},
- {"reflectionD",
- (getter)ShadeInput_getReflectionD, (setter)NULL,
- "Get the reflection d (tuple with pair of 3-vectors)", NULL},
- {"normalD",
- (getter)ShadeInput_getNormalD, (setter)NULL,
- "Get the normal d (tuple with pair of 3-vectors)", NULL},
- {"stickyD",
- (getter)ShadeInput_getStickyD, (setter)NULL,
- "Get the sticky d (tuple with pair of 3-vectors)", NULL},
- {"refractD",
- (getter)ShadeInput_getRefractD, (setter)NULL,
- "Get the refract d (tuple with pair of 3-vectors)", NULL},
- {"strandD",
- (getter)ShadeInput_getStrandD, (setter)NULL,
- "Get the strand d (2-vector)", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-PyTypeObject Node_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.Scripted", /* char *tp_name; */
- sizeof( BPy_Node ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL /*( getattrfunc ) PyObject_GenericGetAttr*/, /* getattrfunc tp_getattr; */
- NULL /*( setattrfunc ) PyObject_GenericSetAttr*/, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Node_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Node_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /*BPy_Node_methods,*/ /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Node_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- (initproc)node_init, /* initproc tp_init; */
- /*PyType_GenericAlloc*/NULL, /* allocfunc tp_alloc; */
- node_new, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-PyTypeObject ShadeInput_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender.Node.ShadeInput", /* char *tp_name; */
- sizeof( BPy_ShadeInput ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) ShadeInput_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) ShadeInput_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /*BPy_Node_methods,*/ /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_ShadeInput_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/* Initialise Node module */
-PyObject *Node_Init(void)
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Node_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &ShadeInput_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &NodeSocket_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &NodeSocketLists_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &SockInMap_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &SockOutMap_Type ) < 0 )
- return NULL;
- submodule = Py_InitModule3( "Blender.Node", NULL, "");
-
- PyModule_AddIntConstant(submodule, "VALUE", SOCK_VALUE);
- PyModule_AddIntConstant(submodule, "RGBA", SOCK_RGBA);
- PyModule_AddIntConstant(submodule, "VECTOR", SOCK_VECTOR);
-
- Py_INCREF(&NodeSocket_Type);
- PyModule_AddObject(submodule, "Socket", (PyObject *)&NodeSocket_Type);
-
- Py_INCREF(&Node_Type);
- PyModule_AddObject(submodule, "Scripted", (PyObject *)&Node_Type);
-
- return submodule;
-}
-
-static int Node_compare(BPy_Node *a, BPy_Node *b)
-{
- bNode *pa = a->node, *pb = b->node;
- return (pa == pb) ? 0 : -1;
-}
-
-static PyObject *Node_repr(BPy_Node *self)
-{
- return PyString_FromFormat( "[Node \"%s\"]",
- self->node ? self->node->id->name+2 : "empty node");
-}
-
-BPy_Node *Node_CreatePyObject(bNode *node)
-{
- BPy_Node *pynode;
-
- pynode = (BPy_Node *)PyObject_NEW(BPy_Node, &Node_Type);
- if(!pynode) {
- fprintf(stderr,"Couldn't create BPy_Node object\n");
- return (BPy_Node *)(EXPP_ReturnPyObjError(PyExc_MemoryError, "couldn't create BPy_Node object"));
- }
-
- pynode->node = node;
-
- return pynode;
-}
-
-int pytype_is_pynode(PyObject *pyob)
-{
- return PyObject_TypeCheck(pyob, &Node_Type);
-}
-
-void InitNode(BPy_Node *self, bNode *node) {
- self->node = node;
-}
-
-bNode *Node_FromPyObject(PyObject *pyobj)
-{
- return ((BPy_Node *)pyobj)->node;
-}
-
-void Node_SetStack(BPy_Node *self, bNodeStack **stack, int type)
-{
- if(type == NODE_INPUTSTACK) {
- self->in = stack;
- } else if(type == NODE_OUTPUTSTACK) {
- self->out = stack;
- }
-}
-
-void Node_SetShi(BPy_Node *self, ShadeInput *shi)
-{
- self->shi = shi;
-}
-
-/*********************/
-
-static int ShadeInput_compare(BPy_ShadeInput *a, BPy_ShadeInput *b)
-{
- ShadeInput *pa = a->shi, *pb = b->shi;
- return (pa == pb) ? 0 : -1;
-}
-
-static PyObject *ShadeInput_repr(BPy_ShadeInput *self)
-{
- return PyString_FromFormat( "[ShadeInput at \"%p\"]", self);
-}
-
-BPy_ShadeInput *ShadeInput_CreatePyObject(ShadeInput *shi)
-{
- BPy_ShadeInput *pyshi;
-
- pyshi = (BPy_ShadeInput *)PyObject_NEW(BPy_ShadeInput, &ShadeInput_Type);
- if(!pyshi) {
- fprintf(stderr,"Couldn't create BPy_ShadeInput object\n");
- return (BPy_ShadeInput *)(EXPP_ReturnPyObjError(PyExc_MemoryError, "couldn't create BPy_ShadeInput object"));
- }
-
- pyshi->shi = shi;
-
- return pyshi;
-}
-
diff --git a/source/blender/python/api2_2x/Node.h b/source/blender/python/api2_2x/Node.h
deleted file mode 100644
index 3bf2151af7c..00000000000
--- a/source/blender/python/api2_2x/Node.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006, Blender Foundation
- * All rights reserved.
- *
- * Original code is this file
- *
- * Contributor(s): Nathan Letwory
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef __NODE_H__
-#define __NODE_H__
-
-#include <Python.h>
-#include "DNA_node_types.h"
-#include "BKE_node.h"
-
-#include "RE_shader_ext.h" /* <- ShadeInput Shaderesult TexResult */
-
-extern PyTypeObject Node_Type;
-extern PyTypeObject NodeSocket_Type;
-extern PyTypeObject NodeSocketLists_Type;
-extern PyTypeObject ShadeInput_Type;
-
-#define BPy_Node_Check(v) \
- ((v)->ob_type == &Node_Type)
-
-#define BPy_NodeSocket_Check(v) \
- ((v)->ob_type == &NodeSocket_Type)
-
-#define BPy_NodeSocketLists_Check(v) \
- ((v)->ob_type == &NodeSocketLists_Type)
-
-#define BPy_ShadeInput_Check(v) \
- ((v)->ob_type == &ShadeInput_Type)
-
-typedef struct BPy_ShadeInput {
- PyObject_HEAD
- ShadeInput *shi;
-} BPy_ShadeInput;
-
-typedef struct {
- PyObject_VAR_HEAD
- bNode* node;
- bNodeStack **stack;
-} BPy_SockMap;
-
-typedef struct {
- PyObject_HEAD
- bNode *node;
- PyObject *input;
- PyObject *output;
-} BPy_NodeSocketLists;
-
-typedef struct BPy_Node {
- PyObject_HEAD
- bNode *node;
- bNodeStack **in;
- bNodeStack **out;
- ShadeInput *shi;
-} BPy_Node;
-
-typedef struct BPy_NodeSocket {
- PyObject_HEAD
- char name[NODE_MAXSTR];
- float min;
- float max;
- float val[4];
- short type; /* VALUE, VECTOR or RGBA */
-} BPy_NodeSocket;
-
-extern PyObject *Node_Init(void);
-extern void InitNode(BPy_Node *self, bNode *node);
-extern BPy_Node *Node_CreatePyObject(bNode *node);
-extern BPy_NodeSocketLists *Node_CreateSocketLists(bNode *node);
-extern void Node_SetStack(BPy_Node *self, bNodeStack **stack, int type);
-extern void Node_SetShi(BPy_Node *self, ShadeInput *shi);
-extern int pytype_is_pynode(PyObject *pyob);
-
-#define NODE_INPUTSTACK 0
-#define NODE_OUTPUTSTACK 1
-
-#endif /* __NODE_H__*/
-
diff --git a/source/blender/python/api2_2x/Noise.c b/source/blender/python/api2_2x/Noise.c
deleted file mode 100644
index 430534b120a..00000000000
--- a/source/blender/python/api2_2x/Noise.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/**
- * $Id$
- *
- * Blender.Noise BPython module implementation.
- * This submodule has functions to generate noise of various types.
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): eeshlo
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/************************/
-/* Blender Noise Module */
-/************************/
-
-#include <Python.h>
-
-#include "BLI_blenlib.h"
-#include "DNA_texture_types.h"
-#include "constant.h"
-
-/*-----------------------------------------*/
-/* 'mersenne twister' random number generator */
-
-/*
- A C-program for MT19937, with initialization improved 2002/2/10.
- Coded by Takuji Nishimura and Makoto Matsumoto.
- This is a faster version by taking Shawn Cokus's optimization,
- Matthe Bellew's simplification, Isaku Wada's real version.
-
- Before using, initialize the state by using init_genrand(seed)
- or init_by_array(init_key, key_length).
-
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. The names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
- Any feedback is very welcome.
- http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
- email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
-*/
-
-/* Period parameters */
-#define N 624
-#define M 397
-#define MATRIX_A 0x9908b0dfUL /* constant vector a */
-#define UMASK 0x80000000UL /* most significant w-r bits */
-#define LMASK 0x7fffffffUL /* least significant r bits */
-#define MIXBITS(u,v) ( ((u) & UMASK) | ((v) & LMASK) )
-#define TWIST(u,v) ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
-
-static unsigned long state[N]; /* the array for the state vector */
-static int left = 1;
-static int initf = 0;
-static unsigned long *next;
-
-PyObject *Noise_Init(void);
-
-/* initializes state[N] with a seed */
-static void init_genrand( unsigned long s )
-{
- int j;
- state[0] = s & 0xffffffffUL;
- for( j = 1; j < N; j++ ) {
- state[j] =
- ( 1812433253UL *
- ( state[j - 1] ^ ( state[j - 1] >> 30 ) ) + j );
- /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
- /* In the previous versions, MSBs of the seed affect */
- /* only MSBs of the array state[]. */
- /* 2002/01/09 modified by Makoto Matsumoto */
- state[j] &= 0xffffffffUL; /* for >32 bit machines */
- }
- left = 1;
- initf = 1;
-}
-
-static void next_state( void )
-{
- unsigned long *p = state;
- int j;
-
- /* if init_genrand() has not been called, */
- /* a default initial seed is used */
- if( initf == 0 )
- init_genrand( 5489UL );
-
- left = N;
- next = state;
-
- for( j = N - M + 1; --j; p++ )
- *p = p[M] ^ TWIST( p[0], p[1] );
-
- for( j = M; --j; p++ )
- *p = p[M - N] ^ TWIST( p[0], p[1] );
-
- *p = p[M - N] ^ TWIST( p[0], state[0] );
-}
-
-/*------------------------------------------------------------*/
-
-static void setRndSeed( int seed )
-{
- if( seed == 0 )
- init_genrand( time( NULL ) );
- else
- init_genrand( seed );
-}
-
-/* float number in range [0, 1) using the mersenne twister rng */
-static float frand( )
-{
- unsigned long y;
-
- if( --left == 0 )
- next_state( );
- y = *next++;
-
- /* Tempering */
- y ^= ( y >> 11 );
- y ^= ( y << 7 ) & 0x9d2c5680UL;
- y ^= ( y << 15 ) & 0xefc60000UL;
- y ^= ( y >> 18 );
-
- return ( float ) y / 4294967296.f;
-}
-
-/*------------------------------------------------------------*/
-
-/* returns random unit vector */
-static void randuvec( float v[3] )
-{
- float r;
- v[2] = 2.f * frand( ) - 1.f;
- if( ( r = 1.f - v[2] * v[2] ) > 0.f ) {
- float a = (float)(6.283185307f * frand( ));
- r = (float)sqrt( r );
- v[0] = (float)(r * cos( a ));
- v[1] = (float)(r * sin( a ));
- } else
- v[2] = 1.f;
-}
-
-static PyObject *Noise_random( PyObject * self )
-{
- return Py_BuildValue( "f", frand( ) );
-}
-
-static PyObject *Noise_randuvec( PyObject * self )
-{
- float v[3] = {0.0f, 0.0f, 0.0f};
- randuvec( v );
- return Py_BuildValue( "[fff]", v[0], v[1], v[2] );
-}
-
-/*---------------------------------------------------------------------*/
-
-/* Random seed init. Only used for MT random() & randuvec() */
-
-static PyObject *Noise_setRandomSeed( PyObject * self, PyObject * args )
-{
- int s;
- if( !PyArg_ParseTuple( args, "i", &s ) )
- return NULL;
- setRndSeed( s );
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* General noise */
-
-static PyObject *Noise_noise( PyObject * self, PyObject * args )
-{
- float x, y, z;
- int nb = 1;
- if( !PyArg_ParseTuple( args, "(fff)|i", &x, &y, &z, &nb ) )
- return NULL;
-
- return PyFloat_FromDouble(
- (double)(2.0 * BLI_gNoise( 1.0, x, y, z, 0, nb ) - 1.0) );
-}
-
-/*-------------------------------------------------------------------------*/
-
-/* General Vector noise */
-
-static void vNoise( float x, float y, float z, int nb, float v[3] )
-{
- /* Simply evaluate noise at 3 different positions */
- v[0] = (float)(2.0 * BLI_gNoise( 1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
- nb ) - 1.0);
- v[1] = (float)(2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0);
- v[2] = (float)(2.0 * BLI_gNoise( 1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
- nb ) - 1.0);
-}
-
-static PyObject *Noise_vNoise( PyObject * self, PyObject * args )
-{
- float x, y, z, v[3];
- int nb = 1;
- if( !PyArg_ParseTuple( args, "(fff)|i", &x, &y, &z, &nb ) )
- return NULL;
- vNoise( x, y, z, nb, v );
- return Py_BuildValue( "[fff]", v[0], v[1], v[2] );
-}
-
-/*---------------------------------------------------------------------------*/
-
-/* General turbulence */
-
-static float turb( float x, float y, float z, int oct, int hard, int nb,
- float ampscale, float freqscale )
-{
- float amp, out, t;
- int i;
- amp = 1.f;
- out = (float)(2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0);
- if( hard )
- out = (float)fabs( out );
- for( i = 1; i < oct; i++ ) {
- amp *= ampscale;
- x *= freqscale;
- y *= freqscale;
- z *= freqscale;
- t = (float)(amp * ( 2.0 * BLI_gNoise( 1.f, x, y, z, 0, nb ) - 1.0 ));
- if( hard )
- t = (float)fabs( t );
- out += t;
- }
- return out;
-}
-
-static PyObject *Noise_turbulence( PyObject * self, PyObject * args )
-{
- float x, y, z;
- int oct, hd, nb = 1;
- float as = 0.5, fs = 2.0;
- if( !PyArg_ParseTuple
- ( args, "(fff)ii|iff", &x, &y, &z, &oct, &hd, &nb, &as, &fs ) )
- return NULL;
- return PyFloat_FromDouble( (double)turb( x, y, z, oct, hd, nb, as, fs ) );
-}
-
-/*--------------------------------------------------------------------------*/
-
-/* 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 amp, t[3];
- int i;
- amp = 1.f;
- vNoise( 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] );
- }
- for( i = 1; i < oct; i++ ) {
- amp *= ampscale;
- x *= freqscale;
- y *= freqscale;
- z *= freqscale;
- vNoise( 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] );
- }
- v[0] += amp * t[0];
- v[1] += amp * t[1];
- v[2] += amp * t[2];
- }
-}
-
-static PyObject *Noise_vTurbulence( PyObject * self, PyObject * args )
-{
- float x, y, z, v[3];
- int oct, hd, nb = 1;
- float as = 0.5, fs = 2.0;
- if( !PyArg_ParseTuple
- ( args, "(fff)ii|iff", &x, &y, &z, &oct, &hd, &nb, &as, &fs ) )
- return NULL;
- vTurb( x, y, z, oct, hd, nb, as, fs, v );
- return Py_BuildValue( "[fff]", v[0], v[1], v[2] );
-}
-
-/*---------------------------------------------------------------------*/
-
-/* F. Kenton Musgrave's fractal functions */
-
-static PyObject *Noise_fBm( PyObject * self, PyObject * args )
-{
- float x, y, z, H, lac, oct;
- int nb = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)fff|i", &x, &y, &z, &H, &lac, &oct, &nb ) )
- return NULL;
- return PyFloat_FromDouble( (double)mg_fBm( x, y, z, H, lac, oct, nb ) );
-}
-
-/*------------------------------------------------------------------------*/
-
-static PyObject *Noise_multiFractal( PyObject * self, PyObject * args )
-{
- float x, y, z, H, lac, oct;
- int nb = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)fff|i", &x, &y, &z, &H, &lac, &oct, &nb ) )
- return NULL;
- return PyFloat_FromDouble( (double)mg_MultiFractal( x, y, z, H, lac, oct, nb ) );
-}
-
-/*------------------------------------------------------------------------*/
-
-static PyObject *Noise_vlNoise( PyObject * self, PyObject * args )
-{
- float x, y, z, d;
- int nt1 = 1, nt2 = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)f|ii", &x, &y, &z, &d, &nt1, &nt2 ) )
- return NULL;
- return PyFloat_FromDouble( (double)mg_VLNoise( x, y, z, d, nt1, nt2 ) );
-}
-
-/*-------------------------------------------------------------------------*/
-
-static PyObject *Noise_heteroTerrain( PyObject * self, PyObject * args )
-{
- float x, y, z, H, lac, oct, ofs;
- int nb = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)ffff|i", &x, &y, &z, &H, &lac, &oct, &ofs, &nb ) )
- return NULL;
-
- return PyFloat_FromDouble(
- (double)mg_HeteroTerrain( x, y, z, H, lac, oct, ofs, nb ) );
-}
-
-/*-------------------------------------------------------------------------*/
-
-static PyObject *Noise_hybridMFractal( PyObject * self, PyObject * args )
-{
- float x, y, z, H, lac, oct, ofs, gn;
- int nb = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)fffff|i", &x, &y, &z, &H, &lac, &oct, &ofs, &gn,
- &nb ) )
- return NULL;
-
- return PyFloat_FromDouble(
- (double)mg_HybridMultiFractal( x, y, z, H, lac, oct, ofs, gn, nb) );
-}
-
-/*------------------------------------------------------------------------*/
-
-static PyObject *Noise_ridgedMFractal( PyObject * self, PyObject * args )
-{
- float x, y, z, H, lac, oct, ofs, gn;
- int nb = 1;
- if( !PyArg_ParseTuple
- ( args, "(fff)fffff|i", &x, &y, &z, &H, &lac, &oct, &ofs, &gn,
- &nb ) )
- return NULL;
- return PyFloat_FromDouble(
- (double)mg_RidgedMultiFractal( x, y, z, H, lac, oct, ofs, gn, nb) );
-}
-
-/*-------------------------------------------------------------------------*/
-
-static PyObject *Noise_voronoi( PyObject * self, PyObject * args )
-{
- float x, y, z, da[4], pa[12];
- int dtype = 0;
- float me = 2.5; /* default minkovsky exponent */
- if( !PyArg_ParseTuple( args, "(fff)|if", &x, &y, &z, &dtype, &me ) )
- return NULL;
- voronoi( x, y, z, da, pa, me, dtype );
- return Py_BuildValue( "[[ffff][[fff][fff][fff][fff]]]",
- da[0], da[1], da[2], da[3],
- pa[0], pa[1], pa[2],
- pa[3], pa[4], pa[5],
- pa[6], pa[7], pa[8], pa[9], pa[10], pa[11] );
-}
-
-/*-------------------------------------------------------------------------*/
-
-static PyObject *Noise_cellNoise( PyObject * self, PyObject * args )
-{
- float x, y, z;
- if( !PyArg_ParseTuple( args, "(fff)", &x, &y, &z ) )
- return NULL;
- return Py_BuildValue( "f", cellNoise( x, y, z ) );
-}
-
-/*--------------------------------------------------------------------------*/
-
-static PyObject *Noise_cellNoiseV( PyObject * self, PyObject * args )
-{
- float x, y, z, ca[3];
- if( !PyArg_ParseTuple( args, "(fff)", &x, &y, &z ) )
- return NULL;
- cellNoiseV( x, y, z, ca );
- return Py_BuildValue( "[fff]", ca[0], ca[1], ca[2] );
-}
-
-/*--------------------------------------------------------------------------*/
-/* For all other Blender modules, this stuff seems to be put in a header file.
- This doesn't seem really appropriate to me, so I just put it here, feel free to change it.
- In the original module I actually kept the docs stings with the functions themselves,
- but I grouped them here so that it can easily be moved to a header if anyone thinks that is necessary. */
-
-static char random__doc__[] = "() No arguments.\n\n\
-Returns a random floating point number in the range [0, 1)";
-
-static char randuvec__doc__[] =
- "() No arguments.\n\nReturns a random unit vector (3-float list).";
-
-static char setRandomSeed__doc__[] = "(seed value)\n\n\
-Initializes random number generator.\n\
-if seed is zero, the current time will be used instead.";
-
-static char noise__doc__[] = "((x,y,z) tuple, [noisetype])\n\n\
-Returns general noise of the optional specified type.\n\
-Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes.";
-
-static char vNoise__doc__[] = "((x,y,z) tuple, [noisetype])\n\n\
-Returns noise vector (3-float list) of the optional specified type.\
-Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes.";
-
-static char turbulence__doc__[] =
- "((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
-Returns general turbulence value using the optional specified noisebasis function.\n\
-octaves (integer) is the number of noise values added.\n\
-hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned value always positive).\n\
-Optional arguments:\n\
-noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\
-ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\
-freqscale sets the frequency scale factor, 2.0 by default.";
-
-static char vTurbulence__doc__[] =
- "((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
-Returns general turbulence vector (3-float list) using the optional specified noisebasis function.\n\
-octaves (integer) is the number of noise values added.\n\
-hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned vector always positive).\n\
-Optional arguments:\n\
-noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\
-ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\
-freqscale sets the frequency scale factor, 2.0 by default.";
-
-static char fBm__doc__[] =
- "((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
-Returns Fractal Brownian Motion noise value(fBm).\n\
-H is the fractal increment parameter.\n\
-lacunarity is the gap between successive frequencies.\n\
-octaves is the number of frequencies in the fBm.\n\
-Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
-
-static char multiFractal__doc__[] =
- "((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
-Returns Multifractal noise value.\n\
-H determines the highest fractal dimension.\n\
-lacunarity is gap between successive frequencies.\n\
-octaves is the number of frequencies in the fBm.\n\
-Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
-
-static char vlNoise__doc__[] =
- "((x,y,z) tuple, distortion, [noisetype1], [noisetype2])\n\n\
-Returns Variable Lacunarity Noise value, a distorted variety of noise.\n\
-distortion sets the amount of distortion.\n\
-Optional arguments noisetype1 and noisetype2 set the noisetype to distort and the noisetype used for the distortion respectively.\n\
-See NoiseTypes, both are STDPERLIN by default.";
-
-static char heteroTerrain__doc__[] =
- "((x,y,z) tuple, H, lacunarity, octaves, offset, [noisebasis])\n\n\
-returns Heterogeneous Terrain value\n\
-H determines the fractal dimension of the roughest areas.\n\
-lacunarity is the gap between successive frequencies.\n\
-octaves is the number of frequencies in the fBm.\n\
-offset raises the terrain from 'sea level'.\n\
-Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
-
-static char hybridMFractal__doc__[] =
- "((x,y,z) tuple, H, lacunarity, octaves, offset, gain, [noisebasis])\n\n\
-returns Hybrid Multifractal value.\n\
-H determines the fractal dimension of the roughest areas.\n\
-lacunarity is the gap between successive frequencies.\n\
-octaves is the number of frequencies in the fBm.\n\
-offset raises the terrain from 'sea level'.\n\
-gain scales the values.\n\
-Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
-
-static char ridgedMFractal__doc__[] =
- "((x,y,z) tuple, H, lacunarity, octaves, offset, gain [noisebasis])\n\n\
-returns Ridged Multifractal value.\n\
-H determines the fractal dimension of the roughest areas.\n\
-lacunarity is the gap between successive frequencies.\n\
-octaves is the number of frequencies in the fBm.\n\
-offset raises the terrain from 'sea level'.\n\
-gain scales the values.\n\
-Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
-
-static char voronoi__doc__[] =
- "((x,y,z) tuple, distance_metric, [exponent])\n\n\
-returns a list, containing a list of distances in order of closest feature,\n\
-and a list containing the positions of the four closest features\n\
-Optional arguments:\n\
-distance_metric: see DistanceMetrics, default is DISTANCE\n\
-exponent is only used with MINKOVSKY, default is 2.5.";
-
-static char cellNoise__doc__[] = "((x,y,z) tuple)\n\n\
-returns cellnoise float value.";
-
-static char cellNoiseV__doc__[] = "((x,y,z) tuple)\n\n\
-returns cellnoise vector/point/color (3-float list).";
-
-static char Noise__doc__[] = "Blender Noise and Turbulence Module\n\n\
-This module can be used to generate noise of various types.\n\
-This can be used for terrain generation, to create textures,\n\
-make animations more 'animated', object deformation, etc.\n\
-As an example, this code segment when scriptlinked to a framechanged event,\n\
-will make the camera sway randomly about, by changing parameters this can\n\
-look like anything from an earthquake to a very nervous or maybe even drunk cameraman...\n\
-(the camera needs an ipo with at least one Loc & Rot key for this to work!):\n\
-\n\
-\tfrom Blender import Get, Scene, Noise\n\
-\n\
-\t####################################################\n\
-\t# This controls jitter speed\n\
-\tsl = 0.025\n\
-\t# This controls the amount of position jitter\n\
-\tsp = 0.1\n\
-\t# This controls the amount of rotation jitter\n\
-\tsr = 0.25\n\
-\t####################################################\n\
-\n\
-\ttime = Get('curtime')\n\
-\tob = Scene.GetCurrent().getCurrentCamera()\n\
-\tps = (sl*time, sl*time, sl*time)\n\
-\t# To add jitter only when the camera moves, use this next line instead\n\
-\t#ps = (sl*ob.LocX, sl*ob.LocY, sl*ob.LocZ)\n\
-\trv = Noise.vTurbulence(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN)\n\
-\tob.dloc = (sp*rv[0], sp*rv[1], sp*rv[2])\n\
-\tob.drot = (sr*rv[0], sr*rv[1], sr*rv[2])\n\
-\n";
-
-/* Just in case, declarations for a header file */
-/*
-static PyObject *Noise_random(PyObject *self);
-static PyObject *Noise_randuvec(PyObject *self);
-static PyObject *Noise_setRandomSeed(PyObject *self, PyObject *args);
-static PyObject *Noise_noise(PyObject *self, PyObject *args);
-static PyObject *Noise_vNoise(PyObject *self, PyObject *args);
-static PyObject *Noise_turbulence(PyObject *self, PyObject *args);
-static PyObject *Noise_vTurbulence(PyObject *self, PyObject *args);
-static PyObject *Noise_fBm(PyObject *self, PyObject *args);
-static PyObject *Noise_multiFractal(PyObject *self, PyObject *args);
-static PyObject *Noise_vlNoise(PyObject *self, PyObject *args);
-static PyObject *Noise_heteroTerrain(PyObject *self, PyObject *args);
-static PyObject *Noise_hybridMFractal(PyObject *self, PyObject *args);
-static PyObject *Noise_ridgedMFractal(PyObject *self, PyObject *args);
-static PyObject *Noise_voronoi(PyObject *self, PyObject *args);
-static PyObject *Noise_cellNoise(PyObject *self, PyObject *args);
-static PyObject *Noise_cellNoiseV(PyObject *self, PyObject *args);
-*/
-
-static PyMethodDef NoiseMethods[] = {
- {"setRandomSeed", ( PyCFunction ) Noise_setRandomSeed, METH_VARARGS,
- setRandomSeed__doc__},
- {"random", ( PyCFunction ) Noise_random, METH_NOARGS, random__doc__},
- {"randuvec", ( PyCFunction ) Noise_randuvec, METH_NOARGS,
- randuvec__doc__},
- {"noise", ( PyCFunction ) Noise_noise, METH_VARARGS, noise__doc__},
- {"vNoise", ( PyCFunction ) Noise_vNoise, METH_VARARGS, vNoise__doc__},
- {"turbulence", ( PyCFunction ) Noise_turbulence, METH_VARARGS,
- turbulence__doc__},
- {"vTurbulence", ( PyCFunction ) Noise_vTurbulence, METH_VARARGS,
- vTurbulence__doc__},
- {"fBm", ( PyCFunction ) Noise_fBm, METH_VARARGS, fBm__doc__},
- {"multiFractal", ( PyCFunction ) Noise_multiFractal, METH_VARARGS,
- multiFractal__doc__},
- {"vlNoise", ( PyCFunction ) Noise_vlNoise, METH_VARARGS,
- vlNoise__doc__},
- {"heteroTerrain", ( PyCFunction ) Noise_heteroTerrain, METH_VARARGS,
- heteroTerrain__doc__},
- {"hybridMFractal", ( PyCFunction ) Noise_hybridMFractal, METH_VARARGS,
- hybridMFractal__doc__},
- {"ridgedMFractal", ( PyCFunction ) Noise_ridgedMFractal, METH_VARARGS,
- ridgedMFractal__doc__},
- {"voronoi", ( PyCFunction ) Noise_voronoi, METH_VARARGS,
- voronoi__doc__},
- {"cellNoise", ( PyCFunction ) Noise_cellNoise, METH_VARARGS,
- cellNoise__doc__},
- {"cellNoiseV", ( PyCFunction ) Noise_cellNoiseV, METH_VARARGS,
- cellNoiseV__doc__},
- {NULL, NULL, 0, NULL}
-};
-
-/*----------------------------------------------------------------------*/
-
-PyObject *Noise_Init(void)
-{
- PyObject *NoiseTypes, *DistanceMetrics,
- *md =
- Py_InitModule3( "Blender.Noise", NoiseMethods, Noise__doc__ );
-
- /* use current time as seed for random number generator by default */
- setRndSeed( 0 );
-
- /* Constant noisetype dictionary */
- NoiseTypes = PyConstant_New( );
- if( NoiseTypes ) {
- BPy_constant *nt = ( BPy_constant * ) NoiseTypes;
- PyConstant_Insert( nt, "BLENDER",
- PyInt_FromLong( TEX_BLENDER ) );
- PyConstant_Insert( nt, "STDPERLIN",
- PyInt_FromLong( TEX_STDPERLIN ) );
- PyConstant_Insert( nt, "NEWPERLIN",
- PyInt_FromLong( TEX_NEWPERLIN ) );
- PyConstant_Insert( nt, "VORONOI_F1",
- PyInt_FromLong( TEX_VORONOI_F1 ) );
- PyConstant_Insert( nt, "VORONOI_F2",
- PyInt_FromLong( TEX_VORONOI_F2 ) );
- PyConstant_Insert( nt, "VORONOI_F3",
- PyInt_FromLong( TEX_VORONOI_F3 ) );
- PyConstant_Insert( nt, "VORONOI_F4",
- PyInt_FromLong( TEX_VORONOI_F4 ) );
- PyConstant_Insert( nt, "VORONOI_F2F1",
- PyInt_FromLong( TEX_VORONOI_F2F1 ) );
- PyConstant_Insert( nt, "VORONOI_CRACKLE",
- PyInt_FromLong( TEX_VORONOI_CRACKLE ) );
- PyConstant_Insert( nt, "CELLNOISE",
- PyInt_FromLong( TEX_CELLNOISE ) );
- PyModule_AddObject( md, "NoiseTypes", NoiseTypes );
- }
-
- /* Constant distance metric dictionary for voronoi */
- DistanceMetrics = PyConstant_New( );
- if( DistanceMetrics ) {
- BPy_constant *dm = ( BPy_constant * ) DistanceMetrics;
- PyConstant_Insert( dm, "DISTANCE",
- PyInt_FromLong( TEX_DISTANCE ) );
- PyConstant_Insert( dm, "DISTANCE_SQUARED",
- PyInt_FromLong( TEX_DISTANCE_SQUARED ) );
- PyConstant_Insert( dm, "MANHATTAN",
- PyInt_FromLong( TEX_MANHATTAN ) );
- PyConstant_Insert( dm, "CHEBYCHEV",
- PyInt_FromLong( TEX_CHEBYCHEV ) );
- PyConstant_Insert( dm, "MINKOVSKY_HALF",
- PyInt_FromLong( TEX_MINKOVSKY_HALF ) );
- PyConstant_Insert( dm, "MINKOVSKY_FOUR",
- PyInt_FromLong( TEX_MINKOVSKY_FOUR ) );
- PyConstant_Insert( dm, "MINKOVSKY",
- PyInt_FromLong( TEX_MINKOVSKY ) );
- PyModule_AddObject( md, "DistanceMetrics", DistanceMetrics );
- }
-
- return md;
-}
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
deleted file mode 100644
index 1282b9bd82c..00000000000
--- a/source/blender/python/api2_2x/Object.c
+++ /dev/null
@@ -1,6313 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- *
- * The Object module provides generic access to Objects of various types via
- * the Python interface.
- *
- *
- * Contributor(s): Michel Selten, Willian Germano, Jacques Guignot,
- * Joseph Gilbert, Stephen Swaney, Bala Gi, Campbell Barton, Johnny Matthews,
- * Ken Hughes, Alex Mole, Jean-Michel Soler, Cedric Paille
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-struct SpaceIpo;
-struct rctf;
-
-#include "Object.h" /*This must come first */
-
-#include "DNA_object_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_object_force.h"
-#include "DNA_userdef_types.h"
-#include "DNA_key_types.h" /* for pinShape and activeShape */
-
-#include "BKE_action.h"
-#include "BKE_anim.h" /* used for dupli-objects */
-#include "BKE_depsgraph.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_property.h"
-#include "BKE_mball.h"
-#include "BKE_softbody.h"
-#include "BKE_utildefines.h"
-#include "BKE_armature.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_library.h"
-#include "BKE_object.h"
-#include "BKE_curve.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-#include "BKE_nla.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_idprop.h"
-#include "BKE_object.h"
-#include "BKE_key.h" /* for setting the activeShape */
-#include "BKE_displist.h"
-#include "BKE_pointcache.h"
-#include "BKE_particle.h"
-
-#include "BSE_editipo.h"
-#include "BSE_edit.h"
-
-#include "BIF_space.h"
-#include "BIF_editview.h"
-#include "BIF_drawscene.h"
-#include "BIF_meshtools.h"
-#include "BIF_editarmature.h"
-#include "BIF_editaction.h"
-#include "BIF_editnla.h"
-#include "BIF_keyframing.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_drawobject.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "Scene.h"
-#include "Mathutils.h"
-#include "Mesh.h"
-#include "NMesh.h"
-#include "Curve.h"
-#include "Ipo.h"
-#include "Armature.h"
-#include "Pose.h"
-#include "Camera.h"
-#include "Lamp.h"
-#include "Lattice.h"
-#include "Text.h"
-#include "Text3d.h"
-#include "Metaball.h"
-#include "Draw.h"
-#include "NLA.h"
-#include "logic.h"
-#include "Effect.h"
-#include "Group.h"
-#include "Modifier.h"
-#include "Constraint.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "EXPP_interface.h"
-#include "BIF_editkey.h"
-#include "IDProp.h"
-#include "Particle.h"
-
-/* Defines for insertIpoKey */
-
-#define IPOKEY_LOC 0
-#define IPOKEY_ROT 1
-#define IPOKEY_SIZE 2
-#define IPOKEY_LOCROT 3
-#define IPOKEY_LOCROTSIZE 4
-#define IPOKEY_PI_STRENGTH 5
-#define IPOKEY_PI_FALLOFF 6
-#define IPOKEY_PI_MAXDIST 7 /*Not Ready Yet*/
-#define IPOKEY_PI_SURFACEDAMP 8
-#define IPOKEY_PI_RANDOMDAMP 9
-#define IPOKEY_PI_PERM 10
-#define IPOKEY_LAYER 19
-
-#define PFIELD_FORCE 1
-#define PFIELD_VORTEX 2
-#define PFIELD_MAGNET 3
-#define PFIELD_WIND 4
-
-enum obj_consts {
- EXPP_OBJ_ATTR_LOC_X = 0,
- EXPP_OBJ_ATTR_LOC_Y,
- EXPP_OBJ_ATTR_LOC_Z,
- EXPP_OBJ_ATTR_DLOC_X,
- EXPP_OBJ_ATTR_DLOC_Y,
- EXPP_OBJ_ATTR_DLOC_Z,
- EXPP_OBJ_ATTR_ROT_X,
- EXPP_OBJ_ATTR_ROT_Y,
- EXPP_OBJ_ATTR_ROT_Z,
- EXPP_OBJ_ATTR_DROT_X,
- EXPP_OBJ_ATTR_DROT_Y,
- EXPP_OBJ_ATTR_DROT_Z,
- EXPP_OBJ_ATTR_SIZE_X,
- EXPP_OBJ_ATTR_SIZE_Y,
- EXPP_OBJ_ATTR_SIZE_Z,
- EXPP_OBJ_ATTR_DSIZE_X,
- EXPP_OBJ_ATTR_DSIZE_Y,
- EXPP_OBJ_ATTR_DSIZE_Z,
- EXPP_OBJ_ATTR_LOC,
- EXPP_OBJ_ATTR_DLOC,
- EXPP_OBJ_ATTR_DROT,
- EXPP_OBJ_ATTR_SIZE,
- EXPP_OBJ_ATTR_DSIZE,
- EXPP_OBJ_ATTR_LAYERMASK,
- EXPP_OBJ_ATTR_COLBITS,
- EXPP_OBJ_ATTR_DRAWMODE,
- EXPP_OBJ_ATTR_DRAWTYPE,
- EXPP_OBJ_ATTR_DUPON,
- EXPP_OBJ_ATTR_DUPOFF,
- EXPP_OBJ_ATTR_DUPSTA,
- EXPP_OBJ_ATTR_DUPEND,
- EXPP_OBJ_ATTR_DUPFACESCALEFAC,
- EXPP_OBJ_ATTR_TIMEOFFSET,
- EXPP_OBJ_ATTR_DRAWSIZE,
- EXPP_OBJ_ATTR_PARENT_TYPE,
- EXPP_OBJ_ATTR_PASSINDEX,
- EXPP_OBJ_ATTR_ACT_MATERIAL,
- EXPP_OBJ_ATTR_ACT_SHAPE,
-
- EXPP_OBJ_ATTR_PI_SURFACEDAMP, /* these need to stay together */
- EXPP_OBJ_ATTR_PI_RANDOMDAMP, /* and in order */
- EXPP_OBJ_ATTR_PI_PERM,
- EXPP_OBJ_ATTR_PI_STRENGTH,
- EXPP_OBJ_ATTR_PI_FALLOFF,
- EXPP_OBJ_ATTR_PI_MAXDIST,
- EXPP_OBJ_ATTR_PI_SBDAMP,
- EXPP_OBJ_ATTR_PI_SBIFACETHICK,
- EXPP_OBJ_ATTR_PI_SBOFACETHICK,
-
- EXPP_OBJ_ATTR_SB_NODEMASS, /* these need to stay together */
- EXPP_OBJ_ATTR_SB_GRAV, /* and in order */
- EXPP_OBJ_ATTR_SB_MEDIAFRICT,
- EXPP_OBJ_ATTR_SB_RKLIMIT,
- EXPP_OBJ_ATTR_SB_PHYSICSSPEED,
- EXPP_OBJ_ATTR_SB_GOALSPRING,
- EXPP_OBJ_ATTR_SB_GOALFRICT,
- EXPP_OBJ_ATTR_SB_MINGOAL,
- EXPP_OBJ_ATTR_SB_MAXGOAL,
- EXPP_OBJ_ATTR_SB_DEFGOAL,
- EXPP_OBJ_ATTR_SB_INSPRING,
- EXPP_OBJ_ATTR_SB_INFRICT,
-
- EXPP_OBJ_ATTR_EMPTY_DRAWTYPE
-};
-
-#define EXPP_OBJECT_DRAWSIZEMIN 0.01f
-#define EXPP_OBJECT_DRAWSIZEMAX 10.0f
-
-/* clamping and range values for particle interaction settings */
-#define EXPP_OBJECT_PIDAMP_MIN 0.0f
-#define EXPP_OBJECT_PIDAMP_MAX 1.0f
-#define EXPP_OBJECT_PIRDAMP_MIN 0.0f
-#define EXPP_OBJECT_PIRDAMP_MAX 1.0f
-#define EXPP_OBJECT_PIPERM_MIN 0.0f
-#define EXPP_OBJECT_PIPERM_MAX 1.0f
-#define EXPP_OBJECT_PISTRENGTH_MIN 0.0f
-#define EXPP_OBJECT_PISTRENGTH_MAX 1000.0f
-#define EXPP_OBJECT_PIPOWER_MIN 0.0f
-#define EXPP_OBJECT_PIPOWER_MAX 10.0f
-#define EXPP_OBJECT_PIMAXDIST_MIN 0.0f
-#define EXPP_OBJECT_PIMAXDIST_MAX 1000.0f
-#define EXPP_OBJECT_PISBDAMP_MIN 0.0f
-#define EXPP_OBJECT_PISBDAMP_MAX 1.0f
-#define EXPP_OBJECT_PISBIFTMIN 0.001f
-#define EXPP_OBJECT_PISBIFTMAX 1.0f
-#define EXPP_OBJECT_PISBOFTMIN 0.001f
-#define EXPP_OBJECT_PISBOFTMAX 1.0f
-
-/* clamping and range values for softbody settings */
-#define EXPP_OBJECT_SBMASS_MIN 0.0f
-#define EXPP_OBJECT_SBMASS_MAX 50.0f
-#define EXPP_OBJECT_SBGRAVITY_MIN 0.0f
-#define EXPP_OBJECT_SBGRAVITY_MAX 10.0f
-#define EXPP_OBJECT_SBFRICTION_MIN 0.0f
-#define EXPP_OBJECT_SBFRICTION_MAX 10.0f
-#define EXPP_OBJECT_SBSPEED_MIN 0.01f
-#define EXPP_OBJECT_SBSPEED_MAX 100.0f
-#define EXPP_OBJECT_SBERRORLIMIT_MIN 0.01f
-#define EXPP_OBJECT_SBERRORLIMIT_MAX 1.0f
-#define EXPP_OBJECT_SBGOALSPRING_MIN 0.0f
-#define EXPP_OBJECT_SBGOALSPRING_MAX 0.999f
-#define EXPP_OBJECT_SBGOALFRICT_MIN 0.0f
-#define EXPP_OBJECT_SBGOALFRICT_MAX 10.0f
-#define EXPP_OBJECT_SBMINGOAL_MIN 0.0f
-#define EXPP_OBJECT_SBMINGOAL_MAX 1.0f
-#define EXPP_OBJECT_SBMAXGOAL_MIN 0.0f
-#define EXPP_OBJECT_SBMAXGOAL_MAX 1.0f
-#define EXPP_OBJECT_SBINSPRING_MIN 0.0f
-#define EXPP_OBJECT_SBINSPRING_MAX 0.999f
-#define EXPP_OBJECT_SBINFRICT_MIN 0.0f
-#define EXPP_OBJECT_SBINFRICT_MAX 10.0f
-#define EXPP_OBJECT_SBDEFGOAL_MIN 0.0f
-#define EXPP_OBJECT_SBDEFGOAL_MAX 1.0f
-#define EXPP_OBJECT_SBNODEMASSMIN 0.001f
-#define EXPP_OBJECT_SBNODEMASSMAX 50.0f
-#define EXPP_OBJECT_SBGRAVMIN 0.0f
-#define EXPP_OBJECT_SBGRAVMAX 10.0f
-#define EXPP_OBJECT_SBMEDIAFRICTMIN 0.0f
-#define EXPP_OBJECT_SBMEDIAFRICTMAX 10.0f
-#define EXPP_OBJECT_SBRKLIMITMIN 0.01f
-#define EXPP_OBJECT_SBRKLIMITMAX 1.0f
-#define EXPP_OBJECT_SBPHYSICSSPEEDMIN 0.01f
-#define EXPP_OBJECT_SBPHYSICSSPEEDMAX 100.0f
-#define EXPP_OBJECT_SBGOALSPRINGMIN 0.0f
-#define EXPP_OBJECT_SBGOALSPRINGMAX 0.999f
-#define EXPP_OBJECT_SBGOALFRICTMIN 0.0f
-#define EXPP_OBJECT_SBGOALFRICTMAX 10.0f
-#define EXPP_OBJECT_SBMINGOALMIN 0.0f
-#define EXPP_OBJECT_SBMINGOALMAX 1.0f
-#define EXPP_OBJECT_SBMAXGOALMIN 0.0f
-#define EXPP_OBJECT_SBMAXGOALMAX 1.0f
-#define EXPP_OBJECT_SBDEFGOALMIN 0.0f
-#define EXPP_OBJECT_SBDEFGOALMAX 1.0f
-#define EXPP_OBJECT_SBINSPRINGMIN 0.0f
-#define EXPP_OBJECT_SBINSPRINGMAX 0.999f
-#define EXPP_OBJECT_SBINFRICTMIN 0.0f
-#define EXPP_OBJECT_SBINFRICTMAX 10.0f
-#define EXPP_OBJECT_DUPFACESCALEFACMIN 0.001f
-#define EXPP_OBJECT_DUPFACESCALEFACMAX 10000.0f
-
-/*****************************************************************************/
-/* Python API function prototypes for the Blender module. */
-/*****************************************************************************/
-static PyObject *M_Object_New( PyObject * self, PyObject * args );
-PyObject *M_Object_Get( PyObject * self, PyObject * args );
-static PyObject *M_Object_GetSelected( PyObject * self );
-static PyObject *M_Object_Duplicate( PyObject * self, PyObject * args, PyObject *kwd);
-
-/* HELPER FUNCTION FOR PARENTING */
-static PyObject *internal_makeParent(Object *parent, PyObject *py_child, int partype, int noninverse, int fast, int v1, int v2, int v3, char *bonename);
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Object.__doc__ */
-/*****************************************************************************/
-static char M_Object_doc[] = "The Blender Object module\n\n\
-This module provides access to **Object Data** in Blender.\n";
-
-static char M_Object_New_doc[] =
- "(type) - Add a new object of type 'type' in the current scene";
-
-static char M_Object_Get_doc[] =
- "(name) - return the object with the name 'name', returns None if not\
- found.\n\
- If 'name' is not specified, it returns a list of all objects in the\n\
- current scene.";
-
-static char M_Object_GetSelected_doc[] =
- "() - Returns a list of selected Objects in the active layer(s)\n\
-The active object is the first in the list, if visible";
-
-static char M_Object_Duplicate_doc[] =
- "(linked) - Duplicate all selected, visible objects in the current scene";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Object module: */
-/*****************************************************************************/
-struct PyMethodDef M_Object_methods[] = {
- {"New", ( PyCFunction ) M_Object_New, METH_VARARGS,
- M_Object_New_doc},
- {"Get", ( PyCFunction ) M_Object_Get, METH_VARARGS,
- M_Object_Get_doc},
- {"GetSelected", ( PyCFunction ) M_Object_GetSelected, METH_NOARGS,
- M_Object_GetSelected_doc},
- {"Duplicate", ( PyCFunction ) M_Object_Duplicate, METH_VARARGS | METH_KEYWORDS,
- M_Object_Duplicate_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Python BPy_Object methods declarations: */
-/*****************************************************************************/
-static int setupSB(Object* ob); /*Make sure Softbody Pointer is initialized */
-static int setupPI(Object* ob);
-
-static PyObject *Object_getParticleSys( BPy_Object * self );
-static PyObject *Object_addVertexGroupsFromArmature( BPy_Object * self, PyObject * args);
-static PyObject *Object_newParticleSys( BPy_Object * self, PyObject * args );
-static PyObject *Object_buildParts( BPy_Object * self );
-static PyObject *Object_clearIpo( BPy_Object * self );
-static PyObject *Object_clrParent( BPy_Object * self, PyObject * args );
-static PyObject *Object_clearTrack( BPy_Object * self, PyObject * args );
-static PyObject *Object_getData(BPy_Object *self, PyObject *args, PyObject *kwd);
-static PyObject *Object_getDeltaLocation( BPy_Object * self );
-static PyObject *Object_getDrawMode( BPy_Object * self );
-static PyObject *Object_getDrawType( BPy_Object * self );
-static PyObject *Object_GetEuler( BPy_Object * self, PyObject * args );
-static PyObject *Object_getInverseMatrix( BPy_Object * self );
-static PyObject *Object_getIpo( BPy_Object * self );
-static PyObject *Object_getLocation( BPy_Object * self, PyObject * args );
-static PyObject *Object_getMaterials( BPy_Object * self, PyObject * args );
-static PyObject *Object_getMatrix( BPy_Object * self, PyObject * args );
-static PyObject *Object_getParent( BPy_Object * self );
-static PyObject *Object_getParentBoneName( BPy_Object * self );
-static int Object_setParentBoneName( BPy_Object * self, PyObject * value );
-static PyObject *Object_getParentVertexIndex( BPy_Object * self );
-static int Object_setParentVertexIndex( BPy_Object * self, PyObject * value );
-static PyObject *Object_getSize( BPy_Object * self, PyObject * args );
-static PyObject *Object_getTimeOffset( BPy_Object * self );
-static PyObject *Object_getTracked( BPy_Object * self );
-static PyObject *Object_getType( BPy_Object * self );
-static PyObject *Object_getBoundBox( BPy_Object * self, PyObject *args );
-static PyObject *Object_getBoundBox_noargs( BPy_Object * self );
-static PyObject *Object_getAction( BPy_Object * self );
-static PyObject *Object_getPose( BPy_Object * self );
-static PyObject *Object_evaluatePose( BPy_Object * self, PyObject *args );
-static PyObject *Object_getSelected( BPy_Object * self );
-static PyObject *Object_makeDisplayList( BPy_Object * self );
-static PyObject *Object_link( BPy_Object * self, PyObject * args );
-static PyObject *Object_makeParent( BPy_Object * self, PyObject * args );
-static PyObject *Object_join( BPy_Object * self, PyObject * args );
-static PyObject *Object_makeParentDeform( BPy_Object * self, PyObject * args );
-static PyObject *Object_makeParentVertex( BPy_Object * self, PyObject * args );
-static PyObject *Object_makeParentBone( BPy_Object * self, PyObject * args );
-static PyObject *Object_materialUsage( void );
-static PyObject *Object_getDupliObjects ( BPy_Object * self);
-static PyObject *Object_getEffects( BPy_Object * self );
-static PyObject *Object_setDeltaLocation( BPy_Object * self, PyObject * args );
-static PyObject *Object_SetDrawMode( BPy_Object * self, PyObject * args );
-static PyObject *Object_SetDrawType( BPy_Object * self, PyObject * args );
-static PyObject *Object_SetEuler( BPy_Object * self, PyObject * args );
-static PyObject *Object_SetMatrix( BPy_Object * self, PyObject * args );
-static PyObject *Object_SetIpo( BPy_Object * self, PyObject * args );
-static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args );
-static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args );
-static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args );
-static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self, PyObject * args );
-static PyObject *Object_setLocation( BPy_Object * self, PyObject * args );
-static PyObject *Object_setMaterials( BPy_Object * self, PyObject * args );
-static PyObject *Object_setSize( BPy_Object * self, PyObject * args );
-static PyObject *Object_setTimeOffset( BPy_Object * self, PyObject * args );
-static PyObject *Object_makeTrack( BPy_Object * self, PyObject * args );
-static PyObject *Object_shareFrom( BPy_Object * self, PyObject * args );
-static PyObject *Object_Select( BPy_Object * self, PyObject * args );
-static PyObject *Object_getAllProperties( BPy_Object * self );
-static PyObject *Object_addProperty( BPy_Object * self, PyObject * args );
-static PyObject *Object_removeProperty( BPy_Object * self, PyObject * args );
-static PyObject *Object_getProperty( BPy_Object * self, PyObject * args );
-static PyObject *Object_removeAllProperties( BPy_Object * self );
-static PyObject *Object_copyAllPropertiesTo( BPy_Object * self,
- PyObject * args );
-static PyObject *Object_getScriptLinks( BPy_Object * self, PyObject * value );
-static PyObject *Object_addScriptLink( BPy_Object * self, PyObject * args );
-static PyObject *Object_clearScriptLinks( BPy_Object * self, PyObject *args );
-static PyObject *Object_getPIStrength( BPy_Object * self );
-static PyObject *Object_setPIStrength( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIFalloff( BPy_Object * self );
-static PyObject *Object_setPIFalloff( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIMaxDist( BPy_Object * self );
-static PyObject *Object_setPIMaxDist( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIUseMaxDist( BPy_Object * self );
-static PyObject *Object_SetPIUseMaxDist( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIType( BPy_Object * self );
-static PyObject *Object_SetPIType( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIPerm( BPy_Object * self );
-static PyObject *Object_SetPIPerm( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIRandomDamp( BPy_Object * self );
-static PyObject *Object_setPIRandomDamp( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPISurfaceDamp( BPy_Object * self );
-static PyObject *Object_SetPISurfaceDamp( BPy_Object * self, PyObject * args );
-static PyObject *Object_getPIDeflection( BPy_Object * self );
-static PyObject *Object_SetPIDeflection( BPy_Object * self, PyObject * args );
-
-static int Object_setRBMass( BPy_Object * self, PyObject * args );
-static int Object_setRBFlags( BPy_Object * self, PyObject * args );
-static int Object_setRBShapeBoundType( BPy_Object * self, PyObject * args );
-
-static PyObject *Object_getSBMass( BPy_Object * self );
-static PyObject *Object_setSBMass( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBGravity( BPy_Object * self );
-static PyObject *Object_setSBGravity( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBFriction( BPy_Object * self );
-static PyObject *Object_setSBFriction( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBErrorLimit( BPy_Object * self );
-static PyObject *Object_setSBErrorLimit( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBGoalSpring( BPy_Object * self );
-static PyObject *Object_setSBGoalSpring( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBGoalFriction( BPy_Object * self );
-static PyObject *Object_setSBGoalFriction( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBMinGoal( BPy_Object * self );
-static PyObject *Object_setSBMinGoal( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBMaxGoal( BPy_Object * self );
-static PyObject *Object_setSBMaxGoal( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBInnerSpring( BPy_Object * self );
-static PyObject *Object_setSBInnerSpring( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBInnerSpringFriction( BPy_Object * self );
-static PyObject *Object_setSBInnerSpringFriction( BPy_Object * self, PyObject * args );
-
-static PyObject *Object_isSB( BPy_Object * self );
-static PyObject *Object_getSBDefaultGoal( BPy_Object * self );
-static PyObject *Object_setSBDefaultGoal( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBUseGoal( BPy_Object * self );
-static PyObject *Object_SetSBUseGoal( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBUseEdges( BPy_Object * self );
-static PyObject *Object_SetSBUseEdges( BPy_Object * self, PyObject * args );
-static PyObject *Object_getSBStiffQuads( BPy_Object * self );
-static PyObject *Object_SetSBStiffQuads( BPy_Object * self, PyObject * args );
-static PyObject *Object_insertShapeKey(BPy_Object * self);
-static PyObject *Object_copyNLA( BPy_Object * self, PyObject * args );
-static PyObject *Object_convertActionToStrip( BPy_Object * self );
-static PyObject *Object_copy(BPy_Object * self); /* __copy__ */
-static PyObject *Object_trackAxis(BPy_Object * self);
-static PyObject *Object_upAxis(BPy_Object * self);
-
-/*****************************************************************************/
-/* Python BPy_Object methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Object_methods[] = {
- /* name, method, flags, doc */
- {"getParticleSystems", ( PyCFunction ) Object_getParticleSys, METH_NOARGS,
- "Return a list of particle systems"},
- {"newParticleSystem", ( PyCFunction ) Object_newParticleSys, METH_VARARGS,
- "Create and link a new particle system"},
- {"addVertexGroupsFromArmature" , ( PyCFunction ) Object_addVertexGroupsFromArmature, METH_VARARGS,
- "Add vertex groups from armature using the bone heat method"},
- {"buildParts", ( PyCFunction ) Object_buildParts, METH_NOARGS,
- "Recalcs particle system (if any), (depricated, will always return an empty list in version 2.46)"},
- {"getIpo", ( PyCFunction ) Object_getIpo, METH_NOARGS,
- "Returns the ipo of this object (if any) "},
- {"clrParent", ( PyCFunction ) Object_clrParent, METH_VARARGS,
- "Clears parent object. Optionally specify:\n\
-mode\n\tnonzero: Keep object transform\nfast\n\t>0: Don't update scene \
-hierarchy (faster)"},
- {"clearTrack", ( PyCFunction ) Object_clearTrack, METH_VARARGS,
- "Make this object not track another anymore. Optionally specify:\n\
-mode\n\t2: Keep object transform\nfast\n\t>0: Don't update scene \
-hierarchy (faster)"},
- {"getData", ( PyCFunction ) Object_getData, METH_VARARGS | METH_KEYWORDS,
- "(name_only = 0, mesh = 0) - Returns the datablock object containing the object's \
-data, e.g. Mesh.\n\
-If 'name_only' is nonzero or True, only the name of the datablock is returned"},
- {"getDeltaLocation", ( PyCFunction ) Object_getDeltaLocation,
- METH_NOARGS,
- "Returns the object's delta location (x, y, z)"},
- {"getDrawMode", ( PyCFunction ) Object_getDrawMode, METH_NOARGS,
- "Returns the object draw modes"},
- {"getDrawType", ( PyCFunction ) Object_getDrawType, METH_NOARGS,
- "Returns the object draw type"},
- {"getAction", ( PyCFunction ) Object_getAction, METH_NOARGS,
- "Returns the active action for this object"},
- {"evaluatePose", ( PyCFunction ) Object_evaluatePose, METH_VARARGS,
- "(framenum) - Updates the pose to a certain frame number when the Object is\
- bound to an Action"},
- {"getPose", ( PyCFunction ) Object_getPose, METH_NOARGS,
- "() - returns the pose from an object if it exists, else None"},
- {"isSelected", ( PyCFunction ) Object_getSelected, METH_NOARGS,
- "Return a 1 or 0 depending on whether the object is selected"},
- {"getEuler", ( PyCFunction ) Object_GetEuler, METH_VARARGS,
- "(space = 'localspace' / 'worldspace') - Returns the object's rotation as Euler rotation vector\n\
-(rotX, rotY, rotZ)"},
- {"getInverseMatrix", ( PyCFunction ) Object_getInverseMatrix,
- METH_NOARGS,
- "Returns the object's inverse matrix"},
- {"getLocation", ( PyCFunction ) Object_getLocation, METH_VARARGS,
- "(space = 'localspace' / 'worldspace') - Returns the object's location (x, y, z)\n\
-"},
- {"getMaterials", ( PyCFunction ) Object_getMaterials, METH_VARARGS,
- "(i = 0) - Returns list of materials assigned to the object.\n\
-if i is nonzero, empty slots are not ignored: they are returned as None's."},
- {"getMatrix", ( PyCFunction ) Object_getMatrix, METH_VARARGS,
- "(str = 'worldspace') - Returns the object matrix.\n\
-(str = 'worldspace') - the desired matrix: worldspace (default), localspace\n\
-or old_worldspace.\n\
-\n\
-'old_worldspace' was the only behavior before Blender 2.34. With it the\n\
-matrix is not updated for changes made by the script itself\n\
-(like obj.LocX = 10) until a redraw happens, either called by the script or\n\
-automatic when the script finishes."},
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "Returns the name of the object"},
- {"getParent", ( PyCFunction ) Object_getParent, METH_NOARGS,
- "Returns the object's parent object"},
- {"getParentBoneName", ( PyCFunction ) Object_getParentBoneName, METH_NOARGS,
- "Returns None, or the 'sub-name' of the parent (eg. Bone name)"},
- {"getSize", ( PyCFunction ) Object_getSize, METH_VARARGS,
- "(space = 'localspace' / 'worldspace') - Returns the object's size (x, y, z)"},
- {"getTimeOffset", ( PyCFunction ) Object_getTimeOffset, METH_NOARGS,
- "Returns the object's time offset"},
- {"getTracked", ( PyCFunction ) Object_getTracked, METH_NOARGS,
- "Returns the object's tracked object"},
- {"getType", ( PyCFunction ) Object_getType, METH_NOARGS,
- "Returns type of string of Object"},
-/* Particle Interaction */
-
- {"getPIStrength", ( PyCFunction ) Object_getPIStrength, METH_NOARGS,
- "Returns Particle Interaction Strength"},
- {"setPIStrength", ( PyCFunction ) Object_setPIStrength, METH_VARARGS,
- "Sets Particle Interaction Strength"},
- {"getPIFalloff", ( PyCFunction ) Object_getPIFalloff, METH_NOARGS,
- "Returns Particle Interaction Falloff"},
- {"setPIFalloff", ( PyCFunction ) Object_setPIFalloff, METH_VARARGS,
- "Sets Particle Interaction Falloff"},
- {"getPIMaxDist", ( PyCFunction ) Object_getPIMaxDist, METH_NOARGS,
- "Returns Particle Interaction Max Distance"},
- {"setPIMaxDist", ( PyCFunction ) Object_setPIMaxDist, METH_VARARGS,
- "Sets Particle Interaction Max Distance"},
- {"getPIUseMaxDist", ( PyCFunction ) Object_getPIUseMaxDist, METH_NOARGS,
- "Returns bool for Use Max Distace in Particle Interaction "},
- {"setPIUseMaxDist", ( PyCFunction ) Object_SetPIUseMaxDist, METH_VARARGS,
- "Sets if Max Distance should be used in Particle Interaction"},
- {"getPIType", ( PyCFunction ) Object_getPIType, METH_NOARGS,
- "Returns Particle Interaction Type"},
- {"setPIType", ( PyCFunction ) Object_SetPIType, METH_VARARGS,
- "sets Particle Interaction Type"},
- {"getPIPerm", ( PyCFunction ) Object_getPIPerm, METH_NOARGS,
- "Returns Particle Interaction Permiability"},
- {"setPIPerm", ( PyCFunction ) Object_SetPIPerm, METH_VARARGS,
- "Sets Particle Interaction Permiability"},
- {"getPISurfaceDamp", ( PyCFunction ) Object_getPISurfaceDamp, METH_NOARGS,
- "Returns Particle Interaction Surface Damping"},
- {"setPISurfaceDamp", ( PyCFunction ) Object_SetPISurfaceDamp, METH_VARARGS,
- "Sets Particle Interaction Surface Damping"},
- {"getPIRandomDamp", ( PyCFunction ) Object_getPIRandomDamp, METH_NOARGS,
- "Returns Particle Interaction Random Damping"},
- {"setPIRandomDamp", ( PyCFunction ) Object_setPIRandomDamp, METH_VARARGS,
- "Sets Particle Interaction Random Damping"},
- {"getPIDeflection", ( PyCFunction ) Object_getPIDeflection, METH_NOARGS,
- "Returns Particle Interaction Deflection"},
- {"setPIDeflection", ( PyCFunction ) Object_SetPIDeflection, METH_VARARGS,
- "Sets Particle Interaction Deflection"},
-
-/* Softbody */
-
- {"isSB", ( PyCFunction ) Object_isSB, METH_NOARGS,
- "True if object is a soft body"},
- {"getSBMass", ( PyCFunction ) Object_getSBMass, METH_NOARGS,
- "Returns SB Mass"},
- {"setSBMass", ( PyCFunction ) Object_setSBMass, METH_VARARGS,
- "Sets SB Mass"},
- {"getSBGravity", ( PyCFunction ) Object_getSBGravity, METH_NOARGS,
- "Returns SB Gravity"},
- {"setSBGravity", ( PyCFunction ) Object_setSBGravity, METH_VARARGS,
- "Sets SB Gravity"},
- {"getSBFriction", ( PyCFunction ) Object_getSBFriction, METH_NOARGS,
- "Returns SB Friction"},
- {"setSBFriction", ( PyCFunction ) Object_setSBFriction, METH_VARARGS,
- "Sets SB Friction"},
- {"getSBErrorLimit", ( PyCFunction ) Object_getSBErrorLimit, METH_NOARGS,
- "Returns SB ErrorLimit"},
- {"setSBErrorLimit", ( PyCFunction ) Object_setSBErrorLimit, METH_VARARGS,
- "Sets SB ErrorLimit"},
- {"getSBGoalSpring", ( PyCFunction ) Object_getSBGoalSpring, METH_NOARGS,
- "Returns SB GoalSpring"},
- {"setSBGoalSpring", ( PyCFunction ) Object_setSBGoalSpring, METH_VARARGS,
- "Sets SB GoalSpring"},
- {"getSBGoalFriction", ( PyCFunction ) Object_getSBGoalFriction, METH_NOARGS,
- "Returns SB GoalFriction"},
- {"setSBGoalFriction", ( PyCFunction ) Object_setSBGoalFriction, METH_VARARGS,
- "Sets SB GoalFriction"},
- {"getSBMinGoal", ( PyCFunction ) Object_getSBMinGoal, METH_NOARGS,
- "Returns SB MinGoal"},
- {"setSBMinGoal", ( PyCFunction ) Object_setSBMinGoal, METH_VARARGS,
- "Sets SB MinGoal "},
- {"getSBMaxGoal", ( PyCFunction ) Object_getSBMaxGoal, METH_NOARGS,
- "Returns SB MaxGoal"},
- {"setSBMaxGoal", ( PyCFunction ) Object_setSBMaxGoal, METH_VARARGS,
- "Sets SB MaxGoal"},
- {"getSBInnerSpring", ( PyCFunction ) Object_getSBInnerSpring, METH_NOARGS,
- "Returns SB InnerSpring"},
- {"setSBInnerSpring", ( PyCFunction ) Object_setSBInnerSpring, METH_VARARGS,
- "Sets SB InnerSpring"},
- {"getSBInnerSpringFriction", ( PyCFunction ) Object_getSBInnerSpringFriction, METH_NOARGS,
- "Returns SB InnerSpringFriction"},
- {"setSBInnerSpringFriction", ( PyCFunction ) Object_setSBInnerSpringFriction, METH_VARARGS,
- "Sets SB InnerSpringFriction"},
- {"getSBDefaultGoal", ( PyCFunction ) Object_getSBDefaultGoal, METH_NOARGS,
- "Returns SB DefaultGoal"},
- {"setSBDefaultGoal", ( PyCFunction ) Object_setSBDefaultGoal, METH_VARARGS,
- "Sets SB DefaultGoal"},
- {"getSBUseGoal", ( PyCFunction ) Object_getSBUseGoal, METH_NOARGS,
- "Returns SB UseGoal"},
- {"setSBUseGoal", ( PyCFunction ) Object_SetSBUseGoal, METH_VARARGS,
- "Sets SB UseGoal"},
- {"getSBUseEdges", ( PyCFunction ) Object_getSBUseEdges, METH_NOARGS,
- "Returns SB UseEdges"},
- {"setSBUseEdges", ( PyCFunction ) Object_SetSBUseEdges, METH_VARARGS,
- "Sets SB UseEdges"},
- {"getSBStiffQuads", ( PyCFunction ) Object_getSBStiffQuads, METH_NOARGS,
- "Returns SB StiffQuads"},
- {"setSBStiffQuads", ( PyCFunction ) Object_SetSBStiffQuads, METH_VARARGS,
- "Sets SB StiffQuads"},
- {"getBoundBox", ( PyCFunction ) Object_getBoundBox, METH_VARARGS,
- "Returns the object's bounding box"},
- {"makeDisplayList", ( PyCFunction ) Object_makeDisplayList, METH_NOARGS,
- "Update this object's Display List. Some changes like turning\n\
-'SubSurf' on for a mesh need this method (followed by a Redraw) to\n\
-show the changes on the 3d window."},
- {"link", ( PyCFunction ) Object_link, METH_VARARGS,
- "Links Object with data provided in the argument. The data must\n\
-match the Object's type, so you cannot link a Lamp to a Mesh type object."},
- {"makeParent", ( PyCFunction ) Object_makeParent, METH_VARARGS,
- "Makes the object the parent of the objects provided in the\n\
-argument which must be a list of valid Objects. Optional extra arguments:\n\
-mode:\n\t0: make parent with inverse\n\t1: without inverse\n\
-fast:\n\t0: update scene hierarchy automatically\n\t\
-don't update scene hierarchy (faster). In this case, you must\n\t\
-explicitly update the Scene hierarchy."},
- {"join", ( PyCFunction ) Object_join, METH_VARARGS,
- "(object_list) - Joins the objects in object list of the same type, into this object."},
- {"makeParentDeform", ( PyCFunction ) Object_makeParentDeform, METH_VARARGS,
- "Makes the object the deformation parent of the objects provided in the \n\
-argument which must be a list of valid Objects. Optional extra arguments:\n\
-mode:\n\t0: make parent with inverse\n\t1: without inverse\n\
-fast:\n\t0: update scene hierarchy automatically\n\t\
-don't update scene hierarchy (faster). In this case, you must\n\t\
-explicitly update the Scene hierarchy."},
- {"makeParentVertex", ( PyCFunction ) Object_makeParentVertex, METH_VARARGS,
- "Makes the object the vertex parent of the objects provided in the \n\
-argument which must be a list of valid Objects. \n\
-The second argument is a tuple of 1 or 3 positive integers which corresponds \
-to the index of the vertex you are parenting to.\n\
-Optional extra arguments:\n\
-mode:\n\t0: make parent with inverse\n\t1: without inverse\n\
-fast:\n\t0: update scene hierarchy automatically\n\t\
-don't update scene hierarchy (faster). In this case, you must\n\t\
-explicitly update the Scene hierarchy."},
- {"makeParentBone", ( PyCFunction ) Object_makeParentBone, METH_VARARGS,
- "Makes this armature objects bone, the parent of the objects provided in the \n\
-argument which must be a list of valid Objects. Optional extra arguments:\n\
-mode:\n\t0: make parent with inverse\n\t1: without inverse\n\
-fast:\n\t0: update scene hierarchy automatically\n\t\
-don't update scene hierarchy (faster). In this case, you must\n\t\
-explicitely update the Scene hierarchy."},
-
- {"materialUsage", ( PyCFunction ) Object_materialUsage, METH_NOARGS,
- "Determines the way the material is used and returns status.\n\
-Possible arguments (provide as strings):\n\
-\tData: Materials assigned to the object's data are shown. (default)\n\
-\tObject: Materials assigned to the object are shown."},
- {"setDeltaLocation", ( PyCFunction ) Object_setDeltaLocation,
- METH_VARARGS,
- "Sets the object's delta location which must be a vector triple."},
- {"setDrawMode", ( PyCFunction ) Object_SetDrawMode, METH_VARARGS,
- "Sets the object's drawing mode. The argument can be a sum of:\n\
-2: axis\n4: texspace\n8: drawname\n16: drawimage\n32: drawwire\n64: drawxray\n128: drawtransp"},
- {"setDrawType", ( PyCFunction ) Object_SetDrawType, METH_VARARGS,
- "Sets the object's drawing type. The argument must be one of:\n\
-1: Bounding box\n2: Wire\n3: Solid\n4: Shaded\n5: Textured"},
- {"setEuler", ( PyCFunction ) Object_SetEuler, METH_VARARGS,
- "Set the object's rotation according to the specified Euler\n\
-angles. The argument must be a vector triple"},
- {"setMatrix", ( PyCFunction ) Object_SetMatrix, METH_VARARGS,
- "Set and apply a new local matrix for the object"},
- {"setLocation", ( PyCFunction ) Object_setLocation, METH_VARARGS,
- "Set the object's location. The first argument must be a vector\n\
-triple."},
- {"setMaterials", ( PyCFunction ) Object_setMaterials, METH_VARARGS,
- "Sets materials. The argument must be a list of valid material\n\
-objects."},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "Sets the name of the object"},
- {"setSize", ( PyCFunction ) Object_setSize, METH_VARARGS,
- "Set the object's size. The first argument must be a vector\n\
-triple."},
- {"setTimeOffset", ( PyCFunction ) Object_setTimeOffset, METH_VARARGS,
- "Set the object's time offset."},
- {"makeTrack", ( PyCFunction ) Object_makeTrack, METH_VARARGS,
- "(trackedobj, fast = 0) - Make this object track another.\n\
- (trackedobj) - the object that will be tracked.\n\
- (fast = 0) - if 0: update the scene hierarchy automatically. If you\n\
- set 'fast' to a nonzero value, don't forget to update the scene yourself\n\
- (see scene.update())."},
- {"shareFrom", ( PyCFunction ) Object_shareFrom, METH_VARARGS,
- "Link data of self with object specified in the argument. This\n\
-works only if self and the object specified are of the same type."},
- {"select", ( PyCFunction ) Object_Select, METH_VARARGS,
- "( 1 or 0 ) - Set the selected state of the object.\n\
- 1 is selected, 0 not selected "},
- {"setIpo", ( PyCFunction ) Object_SetIpo, METH_VARARGS,
- "(Blender Ipo) - Sets the object's ipo"},
- {"clearIpo", ( PyCFunction ) Object_clearIpo, METH_NOARGS,
- "() - Unlink ipo from this object"},
-
- {"insertIpoKey", ( PyCFunction ) Object_insertIpoKey, METH_VARARGS,
- "( Object IPO type ) - Inserts a key into IPO"},
- {"insertPoseKey", ( PyCFunction ) Object_insertPoseKey, METH_VARARGS,
- "( Object Pose type ) - Inserts a key into Action"},
- {"insertCurrentPoseKey", ( PyCFunction ) Object_insertCurrentPoseKey, METH_VARARGS,
- "( Object Pose type ) - Inserts a key into Action based on current pose"},
- {"setConstraintInfluenceForBone", ( PyCFunction ) Object_setConstraintInfluenceForBone, METH_VARARGS,
- "( ) - sets a constraint influence for a certain bone in this (armature)object."},
- {"copyNLA", ( PyCFunction ) Object_copyNLA, METH_VARARGS,
- "( ) - copies all NLA strips from another object to this object."},
- {"convertActionToStrip", ( PyCFunction ) Object_convertActionToStrip, METH_NOARGS,
- "( ) - copies all NLA strips from another object to this object."},
- {"getAllProperties", ( PyCFunction ) Object_getAllProperties, METH_NOARGS,
- "() - Get all the properties from this object"},
- {"addProperty", ( PyCFunction ) Object_addProperty, METH_VARARGS,
- "() - Add a property to this object"},
- {"removeProperty", ( PyCFunction ) Object_removeProperty, METH_VARARGS,
- "() - Remove a property from this object"},
- {"getProperty", ( PyCFunction ) Object_getProperty, METH_VARARGS,
- "() - Get a property from this object by name"},
- {"removeAllProperties", ( PyCFunction ) Object_removeAllProperties,
- METH_NOARGS,
- "() - removeAll a properties from this object"},
- {"copyAllPropertiesTo", ( PyCFunction ) Object_copyAllPropertiesTo,
- METH_VARARGS,
- "() - copy all properties from this object to another object"},
- {"getScriptLinks", ( PyCFunction ) Object_getScriptLinks, METH_O,
- "(eventname) - Get a list of this object's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) Object_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new object scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) Object_clearScriptLinks,
- METH_VARARGS,
- "() - Delete all scriptlinks from this object.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."},
- {"insertShapeKey", ( PyCFunction ) Object_insertShapeKey, METH_NOARGS,
- "() - Insert a Shape Key in the current object"},
- {"__copy__", ( PyCFunction ) Object_copy, METH_NOARGS,
- "() - Return a copy of this object."},
- {"copy", ( PyCFunction ) Object_copy, METH_NOARGS,
- "() - Return a copy of this object."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* PythonTypeObject callback function prototypes */
-/*****************************************************************************/
-static void Object_dealloc( BPy_Object * obj );
-static PyObject *Object_repr( BPy_Object * obj );
-static int Object_compare( BPy_Object * a, BPy_Object * b );
-
-/*****************************************************************************/
-/* Function: M_Object_New */
-/* Python equivalent: Blender.Object.New */
-/*****************************************************************************/
-
-/*
- * Note: if this method is called without later linking object data to it,
- * errors can be caused elsewhere in Blender. Future versions of the API
- * will designate obdata as a parameter to this method to prevent this, and
- * eventually this method will be deprecated.
- *
- * When we can guarantee that objects will always have valid obdata,
- * unlink_object() should be edited to remove checks for NULL pointers and
- * debugging messages.
- */
-
-PyObject *M_Object_New( PyObject * self_unused, PyObject * args )
-{
- struct Object *object;
- int type;
- char *str_type;
- char *name = NULL;
- PyObject *py_object;
- BPy_Object *blen_object;
-
- if( !PyArg_ParseTuple( args, "s|s", &str_type, &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "string expected as argument" );
-
- if( strcmp( str_type, "Armature" ) == 0 )
- type = OB_ARMATURE;
- else if( strcmp( str_type, "Camera" ) == 0 )
- type = OB_CAMERA;
- else if( strcmp( str_type, "Curve" ) == 0 )
- type = OB_CURVE;
- else if (strcmp (str_type, "Text") == 0)
- type = OB_FONT;
- else if( strcmp( str_type, "Lamp" ) == 0 )
- type = OB_LAMP;
- else if( strcmp( str_type, "Lattice" ) == 0 )
- type = OB_LATTICE;
- else if( strcmp( str_type, "Mball" ) == 0 )
- type = OB_MBALL;
- else if( strcmp( str_type, "Mesh" ) == 0 )
- type = OB_MESH;
- else if( strcmp( str_type, "Surf" ) == 0 )
- type = OB_SURF;
-/* else if (strcmp (str_type, "Wave") == 0) type = OB_WAVE; */
- else if( strcmp( str_type, "Empty" ) == 0 )
- type = OB_EMPTY;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Unknown type specified" );
-
- /* Create a new object. */
- if( name == NULL ) {
- /* No name is specified, set the name to the type of the object. */
- name = str_type;
- }
- object = add_only_object(type, name);
-
- object->flag = 0;
- object->lay = 1; /* Layer, by default visible*/
- object->data = NULL;
-
- /* user count is incremented in Object_CreatePyObject */
- object->id.us = 0;
-
- /* Create a Python object from it. */
- py_object = Object_CreatePyObject( object );
- blen_object = (BPy_Object *)py_object;
-
- /* store the real object type in the PyObject, treat this as an Empty
- * until it has some obdata */
- blen_object->realtype = object->type;
- object->type = OB_EMPTY;
-
- return py_object;
-}
-
-/*****************************************************************************/
-/* Function: M_Object_Get */
-/* Python equivalent: Blender.Object.Get */
-/*****************************************************************************/
-PyObject *M_Object_Get( PyObject * self_unused, PyObject * args )
-{
- struct Object *object;
- PyObject *blen_object;
- char *name = NULL;
-
- PyArg_ParseTuple( args, "|s", &name );
-
- if( name != NULL ) {
- object = ( Object * ) GetIdFromList( &( G.main->object ), name );
-
- /* No object exists with the name specified in the argument name. */
- if( !object ){
- char buffer[128];
- PyOS_snprintf( buffer, sizeof(buffer),
- "object \"%s\" not found", name);
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- buffer );
- }
-
- /* objects used in pydriver expressions need this */
- if (bpy_during_pydriver())
- bpy_pydriver_appendToList(object);
-
- return Object_CreatePyObject( object );
- } else {
- /* No argument has been given. Return a list of all objects. */
- PyObject *obj_list;
- Link *link;
- int index;
-
- /* do not allow Get() (w/o arguments) inside pydriver, otherwise
- * we'd have to update all objects in the DAG */
- if (bpy_during_pydriver())
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Object.Get requires an argument when used in pydrivers" );
-
- obj_list = PyList_New( BLI_countlist( &( G.main->object ) ) );
-
- if( !obj_list )
- return EXPP_ReturnPyObjError( PyExc_SystemError,
- "List creation failed." );
-
- link = G.main->object.first;
- index = 0;
- while( link ) {
- object = ( Object * ) link;
- blen_object = Object_CreatePyObject( object );
- if( !blen_object ) {
- Py_DECREF( obj_list );
- Py_RETURN_NONE;
- }
- PyList_SetItem( obj_list, index, blen_object );
- index++;
- link = link->next;
- }
- return obj_list;
- }
-}
-
-/*****************************************************************************/
-/* Function: M_Object_GetSelected */
-/* Python equivalent: Blender.Object.GetSelected */
-/*****************************************************************************/
-static PyObject *M_Object_GetSelected( PyObject * self_unused )
-{
- PyObject *blen_object;
- PyObject *list;
- Base *base_iter;
-
- list = PyList_New( 0 );
-
- if( G.vd == NULL ) {
- /* No 3d view has been initialized yet, simply return an empty list */
- return list;
- }
-
- if( ( G.scene->basact ) &&
- ( ( G.scene->basact->flag & SELECT ) &&
- ( G.scene->basact->lay & G.vd->lay ) ) ) {
-
- /* Active object is first in the list. */
- blen_object = Object_CreatePyObject( G.scene->basact->object );
- if( !blen_object ) {
- Py_DECREF( list );
- Py_RETURN_NONE;
- }
- PyList_Append( list, blen_object );
- Py_DECREF( blen_object );
- }
-
- base_iter = G.scene->base.first;
- while( base_iter ) {
- if( ( ( base_iter->flag & SELECT ) &&
- ( base_iter->lay & G.vd->lay ) ) &&
- ( base_iter != G.scene->basact ) ) {
-
- blen_object = Object_CreatePyObject( base_iter->object );
- if( blen_object ) {
- PyList_Append( list, blen_object );
- Py_DECREF( blen_object );
- }
- }
- base_iter = base_iter->next;
- }
- return list;
-}
-
-
-/*****************************************************************************/
-/* Function: M_Object_Duplicate */
-/* Python equivalent: Blender.Object.Duplicate */
-/*****************************************************************************/
-static PyObject *M_Object_Duplicate( PyObject * self_unused,
- PyObject * args, PyObject *kwd )
-{
- int dupflag= 0; /* this a flag, passed to adduplicate() and used instead of U.dupflag sp python can set what is duplicated */
-
- /* the following variables are bools, if set true they will modify the dupflag to pass to adduplicate() */
- int mesh_dupe = 0;
- int surface_dupe = 0;
- int curve_dupe = 0;
- int text_dupe = 0;
- int metaball_dupe = 0;
- int armature_dupe = 0;
- int lamp_dupe = 0;
- int material_dupe = 0;
- int texture_dupe = 0;
- int ipo_dupe = 0;
-
- static char *kwlist[] = {"mesh", "surface", "curve",
- "text", "metaball", "armature", "lamp", "material", "texture", "ipo", NULL};
-
- /* duplicating in background causes segfaults */
- if( G.background == 1 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot duplicate objects in background mode" );
-
-
- if (!PyArg_ParseTupleAndKeywords(args, kwd, "|iiiiiiiiii", kwlist,
- &mesh_dupe, &surface_dupe, &curve_dupe, &text_dupe, &metaball_dupe,
- &armature_dupe, &lamp_dupe, &material_dupe, &texture_dupe, &ipo_dupe))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or bool keywords 'mesh', 'surface', 'curve', 'text', 'metaball', 'armature', 'lamp' 'material', 'texture' and 'ipo' as arguments" );
-
- /* USER_DUP_ACT for actions is not supported in the UI so dont support it here */
- if (mesh_dupe) dupflag |= USER_DUP_MESH;
- if (surface_dupe) dupflag |= USER_DUP_SURF;
- if (curve_dupe) dupflag |= USER_DUP_CURVE;
- if (text_dupe) dupflag |= USER_DUP_FONT;
- if (metaball_dupe) dupflag |= USER_DUP_MBALL;
- if (armature_dupe) dupflag |= USER_DUP_ARM;
- if (lamp_dupe) dupflag |= USER_DUP_LAMP;
- if (material_dupe) dupflag |= USER_DUP_MAT;
- if (texture_dupe) dupflag |= USER_DUP_TEX;
- if (ipo_dupe) dupflag |= USER_DUP_IPO;
- adduplicate(2, dupflag); /* 2 is a mode with no transform and no redraw, Duplicate the current selection, context sensitive */
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Python BPy_Object methods: */
-/*****************************************************************************/
-
-PyObject *Object_getParticleSys( BPy_Object * self ){
- PyObject *list;
- ParticleSystem *psys= NULL;
- Object *ob = self->object;
- int i= 0;
-
- list = PyList_New( BLI_countlist( &ob->particlesystem ) );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyList_New() failed" );
-
- for( psys=ob->particlesystem.first; psys; psys=psys->next )
- PyList_SET_ITEM( list, i++, ParticleSys_CreatePyObject( psys, ob ) );
-
- return list;
-}
-
-PyObject *Object_newParticleSys( BPy_Object * self, PyObject * args ) {
- ParticleSystem *psys = 0;
- ParticleSystem *rpsys = 0;
- ModifierData *md;
- ParticleSystemModifierData *psmd;
- Object *ob = self->object;
- char *name = NULL;
- ID *id;
- int nr;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string or nothing" );
-
- if( name ) {
- for( id= G.main->particle.first; id; id= id->next ) {
- if( !strcmp( name, id->name + 2 ) )
- break;
- }
- if( !id )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "specified particle system not found" );
- else
- id->us++;
- } else
- id = (ID *)psys_new_settings("PSys", G.main);
-
- psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add();
- psys->flag |= PSYS_ENABLED;
- BLI_addtail(&ob->particlesystem,psys);
-
- md = modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
- psmd = (ParticleSystemModifierData*) md;
- psmd->psys=psys;
- BLI_addtail(&ob->modifiers, md);
-
- psys->part=(ParticleSettings*)id;
- psys->totpart=0;
- psys->flag=PSYS_ENABLED|PSYS_CURRENT;
- psys->cfra=bsystem_time(ob,(float)G.scene->r.cfra+1,0.0);
- rpsys = psys;
-
- /* check need for dupliobjects */
-
- nr=0;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- ob->transflag |= OB_DUPLIPARTS;
- else
- ob->transflag &= ~OB_DUPLIPARTS;
-
- BIF_undo_push("Browse Particle System");
-
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- return ParticleSys_CreatePyObject(rpsys,ob);
-}
-
-/*****************************************************************************/
-/* attribute: addVertexGroupsFromArmature */
-/* Description: evaluate and add vertex groups to the current object */
-/* for each bone of the selected armature */
-/* Data: self Object, Bpy armature */
-/* Return: nothing */
-/*****************************************************************************/
-static PyObject *Object_addVertexGroupsFromArmature( BPy_Object * self, PyObject * args)
-{
-
- Object *ob = self->object;
- BPy_Object *arm;
-
- if( ob->type != OB_MESH )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Only useable on Mesh type Objects" );
-
- if( G.obedit != NULL)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Not useable when inside edit mode" );
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "O!",&Object_Type, &arm ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "An armature object is expected." );
-
- if( arm->object->type != OB_ARMATURE )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "An armature object is expected." );
-
- add_verts_to_dgroups(ob, arm->object, 1, 0);
- ob->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_buildParts( BPy_Object * self )
-{
- /* This is now handles by modifiers */
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_clearIpo( BPy_Object * self )
-{
- Object *ob = self->object;
- Ipo *ipo = ( Ipo * ) ob->ipo;
-
- if( ipo ) {
- ID *id = &ipo->id;
- if( id->us > 0 )
- id->us--;
- ob->ipo = NULL;
-
- Py_RETURN_TRUE;
- }
-
- Py_RETURN_FALSE; /* no ipo found */
-}
-
-static PyObject *Object_clrParent( BPy_Object * self, PyObject * args )
-{
- int mode = 0;
- int fast = 0;
-
- if( !PyArg_ParseTuple( args, "|ii", &mode, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or two optional integers as arguments" );
-
- /* Remove the link only, the object is still in the scene. */
- self->object->parent = NULL;
-
- if( mode == 2 ) {
- /* Keep transform */
- apply_obmat( self->object );
- }
-
- if( !fast )
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_clearTrack( BPy_Object * self, PyObject * args )
-{
- int mode = 0;
- int fast = 0;
-
- if( !PyArg_ParseTuple( args, "|ii", &mode, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or two optional integers as arguments" );
-
- /* Remove the link only, the object is still in the scene. */
- self->object->track = NULL;
-
- if( mode ) {
- /* Keep transform */
- apply_obmat( self->object );
- }
-
- if( !fast )
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-/* adds object data to a Blender object, if object->data = NULL */
-int EXPP_add_obdata( struct Object *object )
-{
- if( object->data != NULL )
- return -1;
-
- switch ( object->type ) {
- case OB_ARMATURE:
- /* TODO: Do we need to add something to G? (see the OB_LAMP case) */
- object->data = add_armature( "Armature" );
- break;
- case OB_CAMERA:
- /* TODO: Do we need to add something to G? (see the OB_LAMP case) */
- object->data = add_camera( "Camera" );
- break;
- case OB_CURVE:
- object->data = add_curve( "Curve", OB_CURVE );
- G.totcurve++;
- break;
- case OB_LAMP:
- object->data = add_lamp( "Lamp" );
- G.totlamp++;
- break;
- case OB_MESH:
- object->data = add_mesh( "Mesh" );
- G.totmesh++;
- break;
- case OB_LATTICE:
- object->data = ( void * ) add_lattice( "Lattice" );
- object->dt = OB_WIRE;
- break;
- case OB_MBALL:
- object->data = add_mball( "Meta" );
- break;
-
- /* TODO the following types will be supported later,
- be sure to update Scene_link when new types are supported
- case OB_SURF:
- object->data = add_curve(OB_SURF);
- G.totcurve++;
- break;
- case OB_FONT:
- object->data = add_curve(OB_FONT);
- break;
- case OB_WAVE:
- object->data = add_wave();
- break;
- */
- default:
- break;
- }
-
- if( !object->data )
- return -1;
-
- return 0;
-}
-
-static PyObject *Object_getDeltaLocation( BPy_Object * self )
-{
- return Py_BuildValue( "fff", self->object->dloc[0],
- self->object->dloc[1], self->object->dloc[2] );
-}
-
-static PyObject *Object_getAction( BPy_Object * self )
-{
- if( self->object->action )
- return Action_CreatePyObject( self->object->action );
- Py_RETURN_NONE;
-}
-
-static int Object_setAction( BPy_Object * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->object->action, 0, 1, ID_AC, 0);
-}
-
-static PyObject *Object_evaluatePose(BPy_Object *self, PyObject *args)
-{
- int frame = 1;
- if( !PyArg_ParseTuple( args, "i", &frame ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- frame = EXPP_ClampInt(frame, MINFRAME, MAXFRAME);
- G.scene->r.cfra = frame;
- do_all_pose_actions(self->object);
- where_is_pose (self->object);
-
- Py_RETURN_NONE;
-}
-
-static PyObject * Object_getPose(BPy_Object *self)
-{
- /*if there is no pose will return PyNone*/
- return PyPose_FromPose(self->object->pose, self->object->id.name+2);
-}
-
-static PyObject *Object_getSelected( BPy_Object * self )
-{
- Base *base;
-
- base = FIRSTBASE;
- while( base ) {
- if( base->object == self->object ) {
- if( base->flag & SELECT ) {
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
- }
- base = base->next;
- }
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not find object's selection state" );
-}
-
-static int Object_setSelect( BPy_Object * self, PyObject * value )
-{
- Base *base;
- int param = PyObject_IsTrue( value );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- base = FIRSTBASE;
- while( base ) {
- if( base->object == self->object ) {
- if( param ) {
- base->flag |= SELECT;
- self->object->flag = (short)base->flag;
- set_active_base( base );
- } else {
- base->flag &= ~SELECT;
- self->object->flag = (short)base->flag;
- }
- break;
- }
- base = base->next;
- }
- if (base) { /* was the object selected? */
- countall( );
- }
- return 0;
-}
-
-static PyObject *Object_GetEuler( BPy_Object * self, PyObject * args )
-{
- char *space = "localspace"; /* default to local */
- float eul[3];
-
- if( !PyArg_ParseTuple( args, "|s", &space ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string or nothing" );
-
- if( BLI_streq( space, "worldspace" ) ) { /* Worldspace matrix */
- float mat3[3][3];
- disable_where_script( 1 );
- where_is_object( self->object );
- Mat3CpyMat4(mat3, self->object->obmat);
- Mat3ToEul(mat3, eul);
- disable_where_script( 0 );
- } else if( BLI_streq( space, "localspace" ) ) { /* Localspace matrix */
- eul[0] = self->object->rot[0];
- eul[1] = self->object->rot[1];
- eul[2] = self->object->rot[2];
- } else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected either nothing, 'localspace' (default) or 'worldspace'" );
- }
-
- return ( PyObject * ) newEulerObject( eul, Py_NEW );
-}
-
-static PyObject *Object_getInverseMatrix( BPy_Object * self )
-{
- MatrixObject *inverse =
- ( MatrixObject * ) newMatrixObject( NULL, 4, 4, Py_NEW );
- Mat4Invert( (float ( * )[4])*inverse->matrix, self->object->obmat );
-
- return ( ( PyObject * ) inverse );
-}
-
-static PyObject *Object_getIpo( BPy_Object * self )
-{
- struct Ipo *ipo = self->object->ipo;
-
- if( ipo )
- return Ipo_CreatePyObject( ipo );
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getLocation( BPy_Object * self, PyObject * args )
-{
- char *space = "localspace"; /* default to local */
- PyObject *attr;
- if( !PyArg_ParseTuple( args, "|s", &space ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string or nothing" );
-
- if( BLI_streq( space, "worldspace" ) ) { /* Worldspace matrix */
- disable_where_script( 1 );
- where_is_object( self->object );
-
- attr = Py_BuildValue( "fff",
- self->object->obmat[3][0],
- self->object->obmat[3][1],
- self->object->obmat[3][2] );
-
- disable_where_script( 0 );
- } else if( BLI_streq( space, "localspace" ) ) { /* Localspace matrix */
- attr = Py_BuildValue( "fff",
- self->object->loc[0],
- self->object->loc[1],
- self->object->loc[2] );
- } else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected either nothing, 'localspace' (default) or 'worldspace'" );
- }
-
- return attr;
-}
-
-static PyObject *Object_getMaterials( BPy_Object * self, PyObject * args )
-{
- int all = 0;
-
- if( !PyArg_ParseTuple( args, "|i", &all ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int or nothing" );
-
- return EXPP_PyList_fromMaterialList( self->object->mat,
- self->object->totcol, all );
-}
-
-static PyObject *Object_getParent( BPy_Object * self )
-{
- return Object_CreatePyObject( self->object->parent );
-}
-
-static PyObject *Object_getParentBoneName( BPy_Object * self )
-{
- if( self->object->parent && self->object->parent->type==OB_ARMATURE && self->object->parsubstr[0] != '\0' )
- return PyString_FromString( self->object->parsubstr );
- Py_RETURN_NONE;
-}
-
-static int Object_setParentBoneName( BPy_Object * self, PyObject *value )
-{
- char *bonename;
-
- if (!PyString_Check(value))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an int or nothing" );
-
- if (
- self->object->parent &&
- self->object->parent->type == OB_ARMATURE &&
- self->object->partype == PARBONE
- ) {/* its all good */} else
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "can only set the parent bone name for objects that already have a bone parent" );
-
- bonename = PyString_AsString(value);
-
- if (!get_named_bone(self->object->parent->data, bonename))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "cannot parent to this bone: invalid bone name" );
-
- strcpy(self->object->parsubstr, bonename);
- DAG_scene_sort( G.scene );
- return 0;
-}
-
-static PyObject *Object_getParentVertexIndex( BPy_Object * self )
-{
- PyObject *pyls = NULL;
-
- if( self->object->parent) {
- if (self->object->partype==PARVERT1) {
- pyls = PyList_New(1);
- PyList_SET_ITEM( pyls, 0, PyInt_FromLong( self->object->par1 ));
- return pyls;
- } else if (self->object->partype==PARVERT3) {
- pyls = PyList_New(3);
- PyList_SET_ITEM( pyls, 0, PyInt_FromLong( self->object->par1 ));
- PyList_SET_ITEM( pyls, 1, PyInt_FromLong( self->object->par2 ));
- PyList_SET_ITEM( pyls, 2, PyInt_FromLong( self->object->par3 ));
- return pyls;
- }
- }
- return PyList_New(0);
-}
-
-static int Object_setParentVertexIndex( BPy_Object * self, PyObject *value )
-{
- PyObject *item;
- int val[3] = {0,0,0};
- if( !self->object->parent) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This object has no vertex parent, cant set the vertex parent indicies" );
- }
- if (self->object->partype==PARVERT1) {
- if (PySequence_Length(value) != 1)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "Vertex parented to 1 vertex, can only assign a sequence with 1 vertex parent index" );
- item = PySequence_GetItem(value, 0);
- if (item) {
- val[0] = PyInt_AsLong(item);
- Py_DECREF(item);
- }
- } else if (self->object->partype==PARVERT3) {
- int i;
- if (PySequence_Length(value) != 3)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "Vertex parented to 3 verts, can only assign a sequence with 3 verts parent index" );
-
- for (i=0; i<3; i++) {
- item = PySequence_GetItem(value, i);
- if (item) {
- val[i] = PyInt_AsLong(item);
- Py_DECREF(item);
- }
- }
- } else {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This object has no vertex parent, cant set the vertex parent indicies" );
- }
-
- if (PyErr_Occurred()) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This object has no vertex parent, cant set the vertex parent indicies" );
- } else {
- if (self->object->partype==PARVERT1) {
- if (val[0] < 0) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "vertex index less then zero" );
- }
-
- self->object->par1 = val[0];
- } else if (self->object->partype==PARVERT3) {
- if (val[0]==val[1] || val[0]==val[2] || val[1]==val[2]) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "duplicate indicies in vertex parent assignment" );
- }
- if (val[0] < 0 || val[1] < 0 || val[2] < 0) {
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "vertex index less then zero" );
- }
-
- self->object->par1 = val[0];
- self->object->par2 = val[1];
- self->object->par3 = val[2];
- }
- }
-
- return 0;
-}
-
-
-static PyObject *Object_getSize( BPy_Object * self, PyObject * args )
-{
- char *space = "localspace"; /* default to local */
- PyObject *attr;
- if( !PyArg_ParseTuple( args, "|s", &space ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string or nothing" );
-
- if( BLI_streq( space, "worldspace" ) ) { /* Worldspace matrix */
- float rot[3];
- float mat[3][3], imat[3][3], tmat[3][3];
- disable_where_script( 1 );
- where_is_object( self->object );
-
- Mat3CpyMat4(mat, self->object->obmat);
-
- /* functionality copied from editobject.c apply_obmat */
- Mat3ToEul(mat, rot);
- EulToMat3(rot, tmat);
- Mat3Inv(imat, tmat);
- Mat3MulMat3(tmat, imat, mat);
-
- attr = Py_BuildValue( "fff",
- tmat[0][0],
- tmat[1][1],
- tmat[2][2] );
- disable_where_script( 0 );
- } else if( BLI_streq( space, "localspace" ) ) { /* Localspace matrix */
- attr = Py_BuildValue( "fff",
- self->object->size[0],
- self->object->size[1],
- self->object->size[2] );
- } else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected either nothing, 'localspace' (default) or 'worldspace'" );
- }
- return attr;
-}
-
-static PyObject *Object_getTimeOffset( BPy_Object * self )
-{
- return PyFloat_FromDouble ( (double) self->object->sf );
-}
-
-static PyObject *Object_getTracked( BPy_Object * self )
-{
- return Object_CreatePyObject( self->object->track );
-}
-
-static PyObject *Object_getType( BPy_Object * self )
-{
- char *str;
- int type = self->object->type;
-
- /* if object not yet linked to data, return the stored type */
- if( self->realtype != OB_EMPTY )
- type = self->realtype;
-
- switch ( type ) {
- case OB_ARMATURE:
- str = "Armature";
- break;
- case OB_CAMERA:
- str = "Camera";
- break;
- case OB_CURVE:
- str = "Curve";
- break;
- case OB_EMPTY:
- str = "Empty";
- break;
- case OB_FONT:
- str = "Text";
- break;
- case OB_LAMP:
- str = "Lamp";
- break;
- case OB_LATTICE:
- str = "Lattice";
- break;
- case OB_MBALL:
- str = "MBall";
- break;
- case OB_MESH:
- str = "Mesh";
- break;
- case OB_SURF:
- str = "Surf";
- break;
- case OB_WAVE:
- str = "Wave";
- break;
- default:
- str = "unknown";
- break;
- }
-
- return PyString_FromString( str );
-}
-
-static PyObject *Object_getBoundBox( BPy_Object * self, PyObject *args )
-{
- float *vec = NULL;
- PyObject *vector, *bbox;
- int worldspace = 1;
-
- if( !PyArg_ParseTuple( args, "|i", &worldspace ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int or nothing" );
-
- if( !self->object->data )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "This object isn't linked to any object data (mesh, curve, etc) yet" );
-
- if( !self->object->bb ) { /* if no ob bbox, we look in obdata */
- Curve *curve;
- switch ( self->object->type ) {
- case OB_MESH:
- vec = (float*) mesh_get_bb(self->object)->vec;
- break;
- case OB_CURVE:
- case OB_FONT:
- case OB_SURF:
- curve = self->object->data;
- if( !curve->bb )
- tex_space_curve( curve );
- vec = ( float * ) curve->bb->vec;
- break;
- default:
- Py_RETURN_NONE;
- }
- } else { /* the ob bbox exists */
- vec = ( float * ) self->object->bb->vec;
- }
-
-
- { /* transform our obdata bbox by the obmat.
- the obmat is 4x4 homogeneous coords matrix.
- each bbox coord is xyz, so we make it homogenous
- by padding it with w=1.0 and doing the matrix mult.
- afterwards we divide by w to get back to xyz.
- */
- /* printmatrix4( "obmat", self->object->obmat); */
-
- float tmpvec[4]; /* tmp vector for homogenous coords math */
- int i;
- float *from;
-
- bbox = PyList_New( 8 );
- if( !bbox )
- return EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create pylist" );
- for( i = 0, from = vec; i < 8; i++, from += 3 ) {
- memcpy( tmpvec, from, 3 * sizeof( float ) );
- tmpvec[3] = 1.0f; /* set w coord */
-
- if (worldspace) {
- Mat4MulVec4fl( self->object->obmat, tmpvec );
- /* divide x,y,z by w */
- tmpvec[0] /= tmpvec[3];
- tmpvec[1] /= tmpvec[3];
- tmpvec[2] /= tmpvec[3];
-
-#if 0
- { /* debug print stuff */
- int i;
-
- printf( "\nobj bbox transformed\n" );
- for( i = 0; i < 4; ++i )
- printf( "%f ", tmpvec[i] );
-
- printf( "\n" );
- }
-#endif
- }
- /* because our bounding box is calculated and
- does not have its own memory,
- we must create vectors that allocate space */
-
- vector = newVectorObject( NULL, 3, Py_NEW);
- memcpy( ( ( VectorObject * ) vector )->vec,
- tmpvec, 3 * sizeof( float ) );
- PyList_SET_ITEM( bbox, i, vector );
- }
- }
-
- return bbox;
-}
-
-static PyObject *Object_getBoundBox_noargs( BPy_Object * self )
-{
- return Object_getBoundBox(self, PyTuple_New(0));
-}
-
-static PyObject *Object_makeDisplayList( BPy_Object * self )
-{
- Object *ob = self->object;
-
- if( ob->type == OB_FONT ) {
- Curve *cu = ob->data;
- freedisplist( &cu->disp );
- text_to_curve( ob, 0 );
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_link( BPy_Object * self, PyObject * args )
-{
- PyObject *py_data;
- ID *id;
- ID *oldid;
- int obj_id;
- void *data = NULL;
- int ok;
-
- if( !PyArg_ParseTuple( args, "O", &py_data ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object as argument" );
-
- if( BPy_Armature_Check( py_data ) )
- data = ( void * ) PyArmature_AsArmature((BPy_Armature*)py_data);
- else if( BPy_Camera_Check( py_data ) )
- data = ( void * ) Camera_FromPyObject( py_data );
- else if( BPy_Lamp_Check( py_data ) )
- data = ( void * ) Lamp_FromPyObject( py_data );
- else if( BPy_Curve_Check( py_data ) )
- data = ( void * ) Curve_FromPyObject( py_data );
- else if( BPy_NMesh_Check( py_data ) ) {
- data = ( void * ) NMesh_FromPyObject( py_data, self->object );
- if( !data ) /* NULL means there is already an error */
- return NULL;
- } else if( BPy_Mesh_Check( py_data ) )
- data = ( void * ) Mesh_FromPyObject( py_data, self->object );
- else if( BPy_Lattice_Check( py_data ) )
- data = ( void * ) Lattice_FromPyObject( py_data );
- else if( BPy_Metaball_Check( py_data ) )
- data = ( void * ) Metaball_FromPyObject( py_data );
- else if( BPy_Text3d_Check( py_data ) )
- data = ( void * ) Text3d_FromPyObject( py_data );
-
- /* have we set data to something good? */
- if( !data )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "link argument type is not supported " );
-
- oldid = ( ID * ) self->object->data;
- id = ( ID * ) data;
- obj_id = MAKE_ID2( id->name[0], id->name[1] );
-
- /* if the object object has not been linked to real data before, we
- * can now let it assume its real type */
- if( self->realtype != OB_EMPTY ) {
- self->object->type = self->realtype;
- self->realtype = OB_EMPTY;
- }
-
- ok = 1;
- switch ( obj_id ) {
- case ID_AR:
- if( self->object->type != OB_ARMATURE ) {
- ok = 0;
- }
- break;
- case ID_CA:
- if( self->object->type != OB_CAMERA ) {
- ok = 0;
- }
- break;
- case ID_LA:
- if( self->object->type != OB_LAMP ) {
- ok = 0;
- }
- break;
- case ID_ME:
- if( self->object->type != OB_MESH ) {
- ok = 0;
- }
- break;
- case ID_CU:
- if( self->object->type != OB_CURVE && self->object->type != OB_FONT ) {
- ok = 0;
- }
- break;
- case ID_LT:
- if( self->object->type != OB_LATTICE ) {
- ok = 0;
- }
- break;
- case ID_MB:
- if( self->object->type != OB_MBALL ) {
- ok = 0;
- }
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Linking this object type is not supported" );
- }
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "The 'link' object is incompatible with the base object" );
- self->object->data = data;
-
- /* creates the curve for the text object */
- if (self->object->type == OB_FONT) {
- text_to_curve(self->object, 0);
- } else if (self->object->type == OB_ARMATURE) {
- armature_rebuild_pose(self->object, (bArmature *)data);
- }
- id_us_plus( id );
- if( oldid ) {
- if( oldid->us > 0 ) {
- oldid->us--;
- } else {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "old object reference count below 0" );
- }
- }
-
- /* make sure data and object materials are consistent */
- test_object_materials( id );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_makeParentVertex( BPy_Object * self, PyObject * args )
-{
- PyObject *list;
- PyObject *vlist;
- PyObject *py_child;
- PyObject *ret_val;
- Object *parent;
- int noninverse = 0;
- int fast = 0;
- int partype;
- int v1, v2=0, v3=0;
- int i;
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "OO|ii", &list, &vlist, &noninverse, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects, a tuple of integers and one or two integers as arguments" );
-
- if( !PySequence_Check( list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects" );
-
- if (!PyTuple_Check( vlist ))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a tuple of integers" );
-
- switch( PyTuple_Size( vlist ) ) {
- case 1:
- if( !PyArg_ParseTuple( vlist, "i", &v1 ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a tuple of 1 or 3 integers" );
-
- if ( v1 < 0 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "indices must be strictly positive" );
-
- partype = PARVERT1;
- break;
- case 3:
- if( !PyArg_ParseTuple( vlist, "iii", &v1, &v2, &v3 ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a tuple of 1 or 3 integers" );
-
- if ( v1 < 0 || v2 < 0 || v3 < 0)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "indices must be strictly positive" );
- partype = PARVERT3;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a tuple of 1 or 3 integers" );
- }
-
- parent = ( Object * ) self->object;
-
- if (!ELEM3(parent->type, OB_MESH, OB_CURVE, OB_SURF))
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Parent Vertex only applies to curve, mesh or surface objects" );
-
- if (parent->id.us == 0)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "object must be linked to a scene before it can become a parent");
-
- /* Check if the PyObject passed in list is a Blender object. */
- for( i = 0; i < PySequence_Length( list ); i++ ) {
- py_child = PySequence_GetItem( list, i );
-
- ret_val = internal_makeParent(parent, py_child, partype, noninverse, fast, v1, v2, v3, NULL);
- Py_DECREF (py_child);
-
- if (ret_val)
- Py_DECREF(ret_val);
- else {
- if (!fast) /* need to sort when interrupting in the middle of the list */
- DAG_scene_sort( G.scene );
- return NULL; /* error has been set already */
- }
- }
-
- if (!fast) /* otherwise, only sort at the end */
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_makeParentDeform( BPy_Object * self, PyObject * args )
-{
- PyObject *list;
- PyObject *py_child;
- PyObject *ret_val;
- Object *parent;
- int noninverse = 0;
- int fast = 0;
- int i;
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "O|ii", &list, &noninverse, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects and one or two integers as arguments" );
-
- if( !PySequence_Check( list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects" );
-
- parent = ( Object * ) self->object;
-
- if (parent->type != OB_CURVE && parent->type != OB_ARMATURE)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Parent Deform only applies to curve or armature objects" );
-
- if (parent->id.us == 0)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "object must be linked to a scene before it can become a parent");
-
- /* Check if the PyObject passed in list is a Blender object. */
- for( i = 0; i < PySequence_Length( list ); i++ ) {
- py_child = PySequence_GetItem( list, i );
-
- ret_val = internal_makeParent(parent, py_child, PARSKEL, noninverse, fast, 0, 0, 0, NULL);
- Py_DECREF (py_child);
-
- if (ret_val)
- Py_DECREF(ret_val);
- else {
- if (!fast) /* need to sort when interupting in the middle of the list */
- DAG_scene_sort( G.scene );
- return NULL; /* error has been set already */
- }
- }
-
- if (!fast) /* otherwise, only sort at the end */
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Object_makeParentBone( BPy_Object * self, PyObject * args )
-{
- char *bonename;
- PyObject *list;
- PyObject *py_child;
- PyObject *ret_val;
- Object *parent;
- int noninverse = 0;
- int fast = 0;
- int i;
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "Os|ii", &list, &bonename, &noninverse, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects, bonename and optionally two integers as arguments" );
-
- parent = ( Object * ) self->object;
-
- if (parent->type != OB_ARMATURE)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Parent Bone only applies to armature objects" );
-
- if (parent->id.us == 0)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "object must be linked to a scene before it can become a parent");
-
- if (!parent->data)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "object must be linked to armature data");
-
- if (!get_named_bone(parent->data, bonename))
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Parent Bone Name is not in the armature" );
-
- /* Check if the PyObject passed in list is a Blender object. */
- for( i = 0; i < PySequence_Length( list ); i++ ) {
- py_child = PySequence_GetItem( list, i );
-
- ret_val = internal_makeParent(parent, py_child, PARBONE, noninverse, fast, 0, 0, 0, bonename);
- Py_DECREF (py_child);
-
- if (ret_val)
- Py_DECREF(ret_val);
- else {
- if (!fast) /* need to sort when interupting in the middle of the list */
- DAG_scene_sort( G.scene );
- return NULL; /* error has been set already */
- }
- }
-
- if (!fast) /* otherwise, only sort at the end */
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Object_makeParent( BPy_Object * self, PyObject * args )
-{
- PyObject *list;
- PyObject *py_child;
- PyObject *ret_val;
- Object *parent;
- int noninverse = 0;
- int fast = 0;
- int i;
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "O|ii", &list, &noninverse, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects and one or two integers as arguments" );
-
- if( !PySequence_Check( list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects" );
-
- parent = ( Object * ) self->object;
-
- if (parent->id.us == 0)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "object must be linked to a scene before it can become a parent");
-
- /* Check if the PyObject passed in list is a Blender object. */
- for( i = 0; i < PySequence_Length( list ); i++ ) {
- py_child = PySequence_GetItem( list, i );
-
- ret_val = internal_makeParent(parent, py_child, PAROBJECT, noninverse, fast, 0, 0, 0, NULL);
- Py_DECREF (py_child);
-
- if (ret_val)
- Py_DECREF(ret_val);
- else {
- if (!fast) /* need to sort when interupting in the middle of the list */
- DAG_scene_sort( G.scene );
- return NULL; /* error has been set already */
- }
- }
-
- if (!fast) /* otherwise, only sort at the end */
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_join( BPy_Object * self, PyObject * args )
-{
- PyObject *list;
- PyObject *py_child;
- Object *parent;
- Object *child;
- Scene *temp_scene;
- Scene *orig_scene;
- Base *temp_base;
- short type;
- int i, ok=0, ret_value=0, list_length=0;
-
- /* joining in background causes segfaults */
- if( G.background == 1 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot join objects in background mode" );
-
- /* Check if the arguments passed to makeParent are valid. */
- if( !PyArg_ParseTuple( args, "O", &list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects" );
-
- if( !PySequence_Check( list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects" );
-
- list_length = PySequence_Length( list ); /* if there are no objects to join then exit silently */
-
- if( !list_length ) {
- Py_RETURN_NONE;
- }
-
- parent = ( Object * ) self->object;
- type = parent->type;
-
- /* Only these object types are sypported */
- if( type!=OB_MESH && type!=OB_CURVE && type!=OB_SURF && type!=OB_ARMATURE )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Base object is not a type Blender can join" );
-
- if( !object_in_scene( parent, G.scene ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object must be in the current scene" );
-
- /* exit editmode so join can be done */
- if( G.obedit )
- exit_editmode( EM_FREEDATA );
-
- temp_scene = add_scene( "Scene" ); /* make the new scene */
- temp_scene->lay= 1; /* first layer on */
-
- /* TODO: use EXPP_check_sequence_consistency here */
-
- /* Check if the PyObject passed in list is a Blender object. */
- for( i = 0; i < list_length; i++ ) {
- py_child = PySequence_GetItem( list, i );
- if( !BPy_Object_Check( py_child ) ) {
- /* Cleanup */
- free_libblock( &G.main->scene, temp_scene );
- Py_DECREF( py_child );
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list of objects, one or more of the list items is not a Blender Object." );
- } else {
- /* List item is an object, is it the same type? */
- child = ( Object * ) Object_FromPyObject( py_child );
- Py_DECREF( py_child );
- if( parent->type == child->type ) {
- if( !object_in_scene( child, G.scene ) ) {
- free_libblock( &G.main->scene, temp_scene );
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object must be in the current scene" );
- }
-
- ok =1;
- /* Add a new base, then link the base to the temp_scene */
- temp_base = MEM_callocN( sizeof( Base ), "pynewbase" );
- /* we know these types are the same, link to the temp scene
- * for joining */
- temp_base->object = child; /* link object to the new base */
- temp_base->flag |= SELECT;
- temp_base->lay = 1; /*1 layer on */
-
- BLI_addhead( &temp_scene->base, temp_base ); /* finally, link new base to scene */
- child->id.us += 1; /*Would usually increase user count but in this case it's ok not to */
-
- /*DAG_object_flush_update(temp_scene, temp_base->object, OB_RECALC_DATA);*/
- }
- }
- }
-
- orig_scene = G.scene; /* backup our scene */
-
- /* Add the main object into the temp_scene */
- temp_base = MEM_callocN( sizeof( Base ), "pynewbase" );
- temp_base->object = parent; /* link object to the new base */
- temp_base->flag |= SELECT;
- temp_base->lay = 1; /*1 layer on */
- BLI_addhead( &temp_scene->base, temp_base ); /* finally, link new base to scene */
- parent->id.us += 1;
-
- /* all objects in the scene, set it active and the active object */
- set_scene( temp_scene );
- set_active_base( temp_base );
-
- /* Do the joining now we know everythings OK. */
- if(type == OB_MESH)
- ret_value = join_mesh();
- else if(type == OB_CURVE)
- ret_value = join_curve(OB_CURVE);
- else if(type == OB_SURF)
- ret_value = join_curve(OB_SURF);
- else if(type == OB_ARMATURE)
- ret_value = join_armature();
-
- /* May use this for correcting object user counts later on */
- /*
- if (!ret_value) {
- temp_base = temp_scene->base.first;
- while( base ) {
- object = base->object;
- object->id.us +=1
- base = base->next;
- }
- }*/
-
- /* remove old scene */
- set_scene( orig_scene );
- free_libblock( &G.main->scene, temp_scene );
-
- /* no objects were of the correct type, return None */
- if (!ok) {
- Py_RETURN_NONE;
- }
-
- /* If the join failed then raise an error */
- if (!ret_value)
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
-"Blender failed to join the objects, this is not a script error.\n\
-Please add exception handling to your script with a RuntimeError exception\n\
-letting the user know that their data could not be joined." ) );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *internal_makeParent(Object *parent, PyObject *py_child,
- int partype, /* parenting type */
- int noninverse, int fast, /* parenting arguments */
- int v1, int v2, int v3, /* for vertex parent */
- char *bonename) /* for bone parents - assume the name is already checked to be a valid bone name*/
-{
- Object *child = NULL;
-
- if( BPy_Object_Check( py_child ) )
- child = ( Object * ) Object_FromPyObject( py_child );
-
- if( child == NULL )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Object Type expected" );
-
- if( test_parent_loop( parent, child ) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "parenting loop detected - parenting failed" );
-
- if (partype == PARSKEL && child->type != OB_MESH)
- child->partype = PAROBJECT;
- else
- child->partype = (short)partype;
-
- if (partype == PARVERT3) {
- child->par1 = v1;
- child->par2 = v2;
- child->par3 = v3;
- }
- else if (partype == PARVERT1) {
- child->par1 = v1;
- } else if (partype == PARBONE) {
- strcpy( child->parsubstr, bonename );
- }
-
-
-
- child->parent = parent;
- /* py_obj_child = (BPy_Object *) py_child; */
- if( noninverse == 1 ) {
- Mat4One(child->parentinv);
- /* Parent inverse = unity */
- child->loc[0] = 0.0;
- child->loc[1] = 0.0;
- child->loc[2] = 0.0;
- } else {
- what_does_parent( child );
- Mat4Invert( child->parentinv, workob.obmat );
- clear_workob();
- }
-
- if( !fast )
- child->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_materialUsage( void )
-{
- return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
- "materialUsage: not yet implemented" );
-}
-
-static PyObject *Object_setDeltaLocation( BPy_Object * self, PyObject * args )
-{
- float dloc1;
- float dloc2;
- float dloc3;
- int status;
-
- if( PyObject_Length( args ) == 3 )
- status = PyArg_ParseTuple( args, "fff", &dloc1, &dloc2,
- &dloc3 );
- else
- status = PyArg_ParseTuple( args, "(fff)", &dloc1, &dloc2,
- &dloc3 );
-
- if( !status )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected sequence argument of 3 floats" );
-
- self->object->dloc[0] = dloc1;
- self->object->dloc[1] = dloc2;
- self->object->dloc[2] = dloc3;
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-#define DTX_MASK ( OB_AXIS | OB_TEXSPACE | OB_DRAWNAME | \
- OB_DRAWIMAGE | OB_DRAWWIRE | OB_DRAWXRAY | OB_DRAWTRANSP )
-
-static PyObject *Object_getDrawMode( BPy_Object * self )
-{
- return PyInt_FromLong( (long)(self->object->dtx & DTX_MASK) );
-}
-
-static int Object_setDrawMode( BPy_Object * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- int value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( int )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
- if( value & ~DTX_MASK )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "undefined bit(s) set in bitfield" );
-
- self->object->dtx = value;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static PyObject *Object_getDrawType( BPy_Object * self )
-{
- return PyInt_FromLong( (long)self->object->dt );
-}
-
-static int Object_setDrawType( BPy_Object * self, PyObject * value )
-{
- /* since we mess with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- return EXPP_setIValueRange( value, &self->object->dt,
- OB_BOUNDBOX, OB_TEXTURE, 'b' );
-}
-
-static int Object_setEmptyShape( BPy_Object * self, PyObject * value )
-{
- return EXPP_setIValueRange( value, &self->object->empty_drawtype,
- OB_ARROWS, OB_EMPTY_CONE, 'b' );
-}
-
-static int Object_setEuler( BPy_Object * self, PyObject * args )
-{
- float rot1, rot2, rot3;
- int status = 0; /* failure */
-
- if( PyTuple_Check( args ) && PyTuple_Size( args ) == 1 )
- args = PyTuple_GET_ITEM( args, 0 );
-
- if( EulerObject_Check( args ) ) {
- rot1 = ( ( EulerObject * ) args )->eul[0];
- rot2 = ( ( EulerObject * ) args )->eul[1];
- rot3 = ( ( EulerObject * ) args )->eul[2];
- status = 1;
- } else if( PySequence_Check( args ) && PySequence_Size( args ) == 3 ) {
- if( PyList_Check( args ) )
- args = PySequence_Tuple( args );
- else
- Py_INCREF( args );
- status = PyArg_ParseTuple( args, "fff", &rot1, &rot2, &rot3 );
- Py_DECREF( args );
- }
-
- if( !status )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected euler or sequence of 3 floats" );
-
- self->object->rot[0] = rot1;
- self->object->rot[1] = rot2;
- self->object->rot[2] = rot3;
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static int Object_setMatrix( BPy_Object * self, MatrixObject * mat )
-#if 0
-{
- int x, y;
-
- if( !MatrixObject_Check( mat ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected matrix object as argument" );
-
- if( mat->rowSize == 4 && mat->colSize == 4 ) {
- for( x = 0; x < 4; x++ ) {
- for( y = 0; y < 4; y++ ) {
- self->object->obmat[x][y] = mat->matrix[x][y];
- }
- }
- } else if( mat->rowSize == 3 && mat->colSize == 3 ) {
- for( x = 0; x < 3; x++ ) {
- for( y = 0; y < 3; y++ ) {
- self->object->obmat[x][y] = mat->matrix[x][y];
- }
- }
- /* if a 3x3 matrix, clear the fourth row/column */
- for( x = 0; x < 3; x++ )
- self->object->obmat[x][3] = self->object->obmat[3][x] = 0.0;
- self->object->obmat[3][3] = 1.0;
- } else
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected 3x3 or 4x4 matrix" );
-
- apply_obmat( self->object );
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-#endif
-{
- int x, y;
- float matrix[4][4]; /* for the result */
- float invmat[4][4]; /* for the result */
-
- if( !MatrixObject_Check( mat ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected matrix object as argument" );
-
- if( mat->rowSize == 4 && mat->colSize == 4 ) {
- for( x = 0; x < 4; x++ ) {
- for( y = 0; y < 4; y++ ) {
- matrix[x][y] = mat->matrix[x][y];
- }
- }
- } else if( mat->rowSize == 3 && mat->colSize == 3 ) {
- for( x = 0; x < 3; x++ ) {
- for( y = 0; y < 3; y++ ) {
- matrix[x][y] = mat->matrix[x][y];
- }
- }
- /* if a 3x3 matrix, clear the fourth row/column */
- for( x = 0; x < 3; x++ )
- matrix[x][3] = matrix[3][x] = 0.0;
- matrix[3][3] = 1.0;
- } else
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected 3x3 or 4x4 matrix" );
-
- /* localspace matrix is truly relative to the parent, but parameters
- * stored in object are relative to parentinv matrix. Undo the parent
- * inverse part before updating obmat and calling apply_obmat() */
- if( self->object->parent ) {
- Mat4Invert( invmat, self->object->parentinv );
- Mat4MulMat4( self->object->obmat, matrix, invmat );
- } else
- Mat4CpyMat4( self->object->obmat, matrix );
-
- apply_obmat( self->object );
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-
-/*
- * Object_insertIpoKey()
- * inserts Object IPO key for LOC, ROT, SIZE, LOCROT, LOCROTSIZE, or LAYER
- * Note it also inserts actions!
- */
-
-static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args )
-{
- Object *ob= self->object;
- int key = 0, flag = 0;
- char *actname= NULL;
-
- if( !PyArg_ParseTuple( args, "i", &key ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- if(ob->ipoflag & OB_ACTION_OB)
- actname= "Object";
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- if (key == IPOKEY_LOC || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_X, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Y, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Z, flag);
- }
- if (key == IPOKEY_ROT || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_X, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Y, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Z, flag);
- }
- if (key == IPOKEY_SIZE || key == IPOKEY_LOCROTSIZE ){
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_X, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y, flag);
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z, flag);
- }
- if (key == IPOKEY_LAYER ){
- insertkey((ID *)ob, ID_OB, actname, NULL,OB_LAY, flag);
- }
-
- if (key == IPOKEY_PI_STRENGTH ){
- insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR, flag);
- } else if (key == IPOKEY_PI_FALLOFF ){
- insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FFALL, flag);
- } else if (key == IPOKEY_PI_SURFACEDAMP ){
- insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_SDAMP, flag);
- } else if (key == IPOKEY_PI_RANDOMDAMP ){
- insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_RDAMP, flag);
- } else if (key == IPOKEY_PI_PERM ){
- insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_PERM, flag);
- }
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- Py_RETURN_NONE;
-}
-
-/*
- * Object_insertPoseKey()
- * inserts a Action Pose key from a given pose (sourceaction, frame) to the
- * active action to a given framenum
- */
-
-static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args )
-{
- Object *ob= self->object;
- BPy_Action *sourceact;
- char *chanName;
- int actframe;
- int flag=0;
-
-
- /* for doing the time trick, similar to editaction bake_action_with_client() */
- int oldframe;
- int curframe;
-
- if( !PyArg_ParseTuple( args, "O!sii", &Action_Type, &sourceact,
- &chanName, &actframe, &curframe ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expects an action to copy poses from, a string for chan/bone name, an int argument for frame to extract from the action and finally another int for the frame where to put the new key in the active object.action" );
-
- extract_pose_from_action(ob->pose, sourceact->action, (float)actframe);
-
- oldframe = G.scene->r.cfra;
- G.scene->r.cfra = curframe;
-
- /* XXX: must check chanName actually exists, otherwise segfaults! */
- //achan = get_action_channel(sourceact->action, chanName);
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, flag);
-
- G.scene->r.cfra = oldframe;
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- /* restore, but now with the new action in place */
- /*extract_pose_from_action(ob->pose, ob->action, G.scene->r.cfra);
- where_is_pose(ob);*/
-
- EXPP_allqueue(REDRAWACTION, 1);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args )
-{
- Object *ob= self->object;
- int flag = 0;
- char *chanName;
-
- /* for doing the time trick, similar to editaction bake_action_with_client() */
- int oldframe;
- int curframe;
-
- if( !PyArg_ParseTuple( args, "si", &chanName, &curframe ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected chan/bone name, and a time (int) argument" );
-
- oldframe = G.scene->r.cfra;
- G.scene->r.cfra = curframe;
-
- /* XXX: must check chanName actually exists, otherwise segfaults! */
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, flag);
- insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, flag);
-
- G.scene->r.cfra = oldframe;
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- /* restore */
- extract_pose_from_action(ob->pose, ob->action, (float)G.scene->r.cfra);
- where_is_pose(ob);
-
- EXPP_allqueue(REDRAWACTION, 1);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self,
- PyObject * args )
-{
- char *boneName, *constName;
- float influence;
- IpoCurve *icu;
-
- if( !PyArg_ParseTuple( args, "ssf", &boneName, &constName, &influence ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expects bonename, constraintname, influenceval" );
-
- icu = verify_ipocurve((ID *)self->object, ID_CO, boneName, constName, NULL,
- CO_ENFORCE, 1);
-
- if (!icu)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot get a curve from this IPO, may be using libdata" );
-
- insert_vert_icu(icu, (float)CFRA, influence, 0);
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_copyNLA( BPy_Object * self, PyObject * args ) {
- BPy_Object *bpy_fromob;
-
- if( !PyArg_ParseTuple( args, "O", &bpy_fromob ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "requires a Blender Object to copy NLA strips from." );
- copy_nlastrips(&self->object->nlastrips, &bpy_fromob->object->nlastrips);
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-/*Now that BPY has a Strip type, return the created strip.*/
-static PyObject *Object_convertActionToStrip( BPy_Object * self )
-{
- bActionStrip *strip = convert_action_to_strip( self->object );
- return ActionStrip_CreatePyObject( strip );
-}
-
-static PyObject *Object_setLocation( BPy_Object * self, PyObject * args )
-{
- float loc1;
- float loc2;
- float loc3;
- int status;
-
- if( PyObject_Length( args ) == 3 )
- status = PyArg_ParseTuple( args, "fff", &loc1, &loc2, &loc3 );
- else
- status = PyArg_ParseTuple( args, "(fff)", &loc1, &loc2,
- &loc3 );
-
- if( !status )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected list argument of 3 floats" );
-
- self->object->loc[0] = loc1;
- self->object->loc[1] = loc2;
- self->object->loc[2] = loc3;
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
- DAG_object_flush_update(G.scene, self->object, OB_RECALC_DATA);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_setMaterials( BPy_Object * self, PyObject * args )
-{
- PyObject *list;
- int len;
- int i;
- Material **matlist = NULL;
-
- if (!self->object->data)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "object must be linked to object data (e.g. to a mesh) first" );
-
- if( !PyArg_ParseTuple( args, "O!", &PyList_Type, &list ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a list (of materials or None) as argument" );
-
- len = PyList_Size(list);
-
- /* Object_getMaterials can return '[]' (zero-length list), so that must
- * also be accepted by this method for
- * ob2.setMaterials(ob1.getMaterials()) to always work.
- * In other words, list can be '[]' and so len can be zero. */
- if (len > 0) {
- if( len > MAXMAT )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "list must have from 1 up to 16 materials" );
-
- matlist = EXPP_newMaterialList_fromPyList( list );
- if( !matlist )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "material list must be a list of valid materials!" );
- }
-
- if( self->object->mat )
- EXPP_releaseMaterialList( self->object->mat, self->object->totcol );
-
- /* Increase the user count on all materials */
- for( i = 0; i < len; i++ ) {
- if( matlist[i] )
- id_us_plus( ( ID * ) matlist[i] );
- }
- self->object->mat = matlist;
- self->object->totcol = (char)len;
- self->object->actcol = (char)len;
-
- switch ( self->object->type ) {
- case OB_CURVE: /* fall through */
- case OB_FONT: /* fall through */
- case OB_MESH: /* fall through */
- case OB_MBALL: /* fall through */
- case OB_SURF:
- EXPP_synchronizeMaterialLists( self->object );
- break;
- default:
- break;
- }
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_setSize( BPy_Object * self, PyObject * args )
-{
- float sizex;
- float sizey;
- float sizez;
- int status;
-
- if( PyObject_Length( args ) == 3 )
- status = PyArg_ParseTuple( args, "fff", &sizex, &sizey,
- &sizez );
- else
- status = PyArg_ParseTuple( args, "(fff)", &sizex, &sizey,
- &sizez );
-
- if( !status )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected list argument of 3 floats" );
-
- self->object->size[0] = sizex;
- self->object->size[1] = sizey;
- self->object->size[2] = sizez;
-
- /* since we have messed with object, we need to flag for DAG recalc */
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_makeTrack( BPy_Object * self, PyObject * args )
-{
- BPy_Object *tracked = NULL;
- Object *ob = self->object;
- int fast = 0;
-
- if( !PyArg_ParseTuple( args, "O!|i", &Object_Type, &tracked, &fast ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object and optionally also an int as arguments." );
-
- ob->track = tracked->object;
-
- if( !fast )
- DAG_scene_sort( G.scene );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_shareFrom( BPy_Object * self, PyObject * args )
-{
- BPy_Object *object;
- ID *id;
- ID *oldid;
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &object ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object argument" );
-
- if( !object->object->data )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Object argument has no data linked yet or is an empty" );
-
- if( self->object->type != object->object->type &&
- self->realtype != object->object->type)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "objects are not of same data type" );
-
- switch ( object->object->type ) {
- case OB_MESH:
- case OB_LAMP:
- case OB_CAMERA: /* we can probably add the other types, too */
- case OB_ARMATURE:
- case OB_CURVE:
- case OB_SURF:
- case OB_LATTICE:
-
- /* if this object had no data, we need to enable the realtype */
- if (self->object->type == OB_EMPTY) {
- self->object->type= self->realtype;
- self->realtype = OB_EMPTY;
- }
-
- oldid = ( ID * ) self->object->data;
- id = ( ID * ) object->object->data;
- self->object->data = object->object->data;
-
- if( self->object->type == OB_MESH && id ) {
- self->object->totcol = 0;
- EXPP_synchronizeMaterialLists( self->object );
- }
-
- id_us_plus( id );
- if( oldid ) {
- if( oldid->us > 0 ) {
- oldid->us--;
- } else {
- return EXPP_ReturnPyObjError ( PyExc_RuntimeError,
- "old object reference count below 0" );
- }
- }
-
- Py_RETURN_NONE;
- default:
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "object type not supported" );
- }
-}
-
-static PyObject *Object_getAllProperties( BPy_Object * self )
-{
- PyObject *prop_list, *pyval;
- bProperty *prop = NULL;
-
- prop_list = PyList_New( 0 );
-
- prop = self->object->prop.first;
- while( prop ) {
- pyval = Property_CreatePyObject( prop );
- PyList_Append( prop_list, pyval );
- Py_DECREF(pyval);
- prop = prop->next;
- }
- return prop_list;
-}
-
-static PyObject *Object_getProperty( BPy_Object * self, PyObject * args )
-{
- char *prop_name = NULL;
- bProperty *prop = NULL;
-
- if( !PyArg_ParseTuple( args, "s", &prop_name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string" );
-
- prop = get_ob_property( self->object, prop_name );
- if( prop )
- return Property_CreatePyObject( prop );
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't find the property" );
-}
-
-static PyObject *Object_addProperty( BPy_Object * self, PyObject * args )
-{
- bProperty *prop = NULL;
- char *prop_name = NULL;
- PyObject *prop_data = Py_None;
- char *prop_type = NULL;
- short type = -1;
- BPy_Property *py_prop = NULL;
- int argslen = PyTuple_Size( args );
-
- if( argslen == 3 || argslen == 2 ) {
- if( !PyArg_ParseTuple( args, "sO|s", &prop_name, &prop_data,
- &prop_type ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expecting string, data, and optional string" );
- }
- } else if( argslen == 1 ) {
- if( !PyArg_ParseTuple( args, "O!", &property_Type, &py_prop ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expecting a Property" );
-
- if( py_prop->property != NULL )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Property is already added to an object" );
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1,2 or 3 arguments" );
- }
-
- /*parse property type*/
- if( !py_prop ) {
- if( prop_type ) {
- if( BLI_streq( prop_type, "BOOL" ) )
- type = PROP_BOOL;
- else if( BLI_streq( prop_type, "INT" ) )
- type = PROP_INT;
- else if( BLI_streq( prop_type, "FLOAT" ) )
- type = PROP_FLOAT;
- else if( BLI_streq( prop_type, "TIME" ) )
- type = PROP_TIME;
- else if( BLI_streq( prop_type, "STRING" ) )
- type = PROP_STRING;
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "BOOL, INT, FLOAT, TIME or STRING expected" );
- } else {
- /*use the default*/
- if( PyInt_Check( prop_data ) )
- type = PROP_INT;
- else if( PyFloat_Check( prop_data ) )
- type = PROP_FLOAT;
- else if( PyString_Check( prop_data ) )
- type = PROP_STRING;
- }
- } else {
- type = py_prop->type;
- }
-
- /*initialize a new bProperty of the specified type*/
- prop = new_property( type );
-
- /*parse data*/
- if( !py_prop ) {
- BLI_strncpy( prop->name, prop_name, 32 );
- if( PyInt_Check( prop_data ) ) {
- *( ( int * ) &prop->data ) =
- ( int ) PyInt_AsLong( prop_data );
- } else if( PyFloat_Check( prop_data ) ) {
- *( ( float * ) &prop->data ) =
- ( float ) PyFloat_AsDouble( prop_data );
- } else if( PyString_Check( prop_data ) ) {
- BLI_strncpy( prop->poin,
- PyString_AsString( prop_data ),
- MAX_PROPSTRING );
- }
- } else {
- py_prop->property = prop;
-
- /* this should never be able to happen is we just assigned a valid
- * proper to py_prop->property */
-
- if( !updateProperyData( py_prop ) ) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Could not update property data" );
- }
- }
-
- /*add to property listbase for the object*/
- BLI_addtail( &self->object->prop, prop );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_removeProperty( BPy_Object * self, PyObject * args )
-{
- char *prop_name = NULL;
- BPy_Property *py_prop = NULL;
- bProperty *prop = NULL;
-
- /* we accept either a property stringname or actual object */
- if( PyTuple_Size( args ) == 1 ) {
- PyObject *prop = PyTuple_GET_ITEM( args, 0 );
- if( BPy_Property_Check( prop ) )
- py_prop = (BPy_Property *)prop;
- else
- prop_name = PyString_AsString( prop );
- }
- if( !py_prop && !prop_name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a Property or a string" );
-
- /*remove the link, free the data, and update the py struct*/
- if( py_prop ) {
- BLI_remlink( &self->object->prop, py_prop->property );
- if( updatePyProperty( py_prop ) ) {
- free_property( py_prop->property );
- py_prop->property = NULL;
- }
- } else {
- prop = get_ob_property( self->object, prop_name );
- if( prop ) {
- BLI_remlink( &self->object->prop, prop );
- free_property( prop );
- }
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_removeAllProperties( BPy_Object * self )
-{
- free_properties( &self->object->prop );
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_copyAllPropertiesTo( BPy_Object * self,
- PyObject * args )
-{
- PyObject *dest;
- Object *dest_ob;
- bProperty *prop = NULL;
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &dest ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an Object" );
-
- if (dest == (PyObject *)self) {
- Py_RETURN_NONE;
- }
- dest_ob = ( ( BPy_Object * ) dest )->object;
-
- /*make a copy of all its properties*/
- prop = self->object->prop.first;
- while( prop ) {
- set_ob_property( dest_ob, prop );
- prop = prop->next;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_addScriptLink( BPy_Object * self, PyObject * args )
-{
- Object *obj = self->object;
- ScriptLink *slink = &obj->scriptlink;
- return EXPP_addScriptLink( slink, args, 0 );
-}
-
-static PyObject *Object_clearScriptLinks( BPy_Object * self, PyObject * args )
-{
- Object *obj = self->object;
- ScriptLink *slink = &obj->scriptlink;
- return EXPP_clearScriptLinks( slink, args );
-}
-
-static PyObject *Object_getScriptLinks( BPy_Object * self, PyObject * value )
-{
- Object *obj = self->object;
- ScriptLink *slink = &obj->scriptlink;
- return EXPP_getScriptLinks( slink, value, 0 );
-}
-
-static PyObject *Object_getNLAflagBits ( BPy_Object * self )
-{
- if (self->object->nlaflag & OB_NLA_OVERRIDE)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setNLAflagBits ( BPy_Object * self, PyObject * value )
-{
- int param;
-
- param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param)
- self->object->nlaflag |= OB_NLA_OVERRIDE;
- else
- self->object->nlaflag &= ~OB_NLA_OVERRIDE;
-
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static PyObject *Object_getDupliObjects( BPy_Object * self )
-{
- Object *ob= self->object;
-
- if(ob->transflag & OB_DUPLI) {
- /* before make duplis, update particle for current frame */
- /* TODO, build particles for particle dupli's */
- if(ob->type!=OB_MBALL) {
- PyObject *list;
- DupliObject *dupob;
- int index;
- ListBase *duplilist = object_duplilist(G.scene, ob);
-
- list = PyList_New( BLI_countlist(duplilist) );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "PyList_New() failed" );
-
- for(dupob= duplilist->first, index=0; dupob; dupob= dupob->next, index++) {
- PyObject *pair;
- pair = PyTuple_New( 2 );
-
- PyTuple_SET_ITEM( pair, 0, Object_CreatePyObject(dupob->ob) );
- PyTuple_SET_ITEM( pair, 1, newMatrixObject((float*)dupob->mat,4,4,Py_NEW) );
- PyList_SET_ITEM( list, index, pair);
- }
- free_object_duplilist(duplilist);
- return list;
- }
- }
- return PyList_New( 0 );
-}
-
-static PyObject *Object_getDupliGroup( BPy_Object * self )
-{
- Object *ob= self->object;
-
- if( ob->dup_group )
- return Group_CreatePyObject( ob->dup_group );
-
- Py_RETURN_NONE;
-}
-
-static int Object_setDupliGroup( BPy_Object * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->object->dup_group, 0, 1, ID_GR, 0);
-}
-
-static PyObject *Object_getEffects( BPy_Object * self )
-{
- return PyList_New( 0 );
-}
-
-static PyObject *Object_getActionStrips( BPy_Object * self )
-{
- return ActionStrips_CreatePyObject( self->object );
-}
-
-static PyObject *Object_getConstraints( BPy_Object * self )
-{
- return ObConstraintSeq_CreatePyObject( self->object );
-}
-
-static PyObject *Object_getModifiers( BPy_Object * self )
-{
- return ModSeq_CreatePyObject( self->object, NULL );
-}
-
-static int Object_setModifiers( BPy_Object * self, PyObject * value )
-{
- BPy_ModSeq *pymodseq;
- ModifierData *md;
-
- if (!BPy_ModSeq_Check(value))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "can only assign another objects modifiers" );
-
- pymodseq = ( BPy_ModSeq * ) value;
-
- if (self->object->type != pymodseq->object->type)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "can only assign modifiers between objects of the same type" );
-
- if (self->object == pymodseq->object)
- return 0;
-
- object_free_modifiers(self->object);
- for (md=pymodseq->object->modifiers.first; md; md=md->next) {
- if (md->type!=eModifierType_Hook) {
- ModifierData *nmd = modifier_new(md->type);
- modifier_copyData(md, nmd);
- BLI_addtail(&self->object->modifiers, nmd);
- }
- }
-
- DAG_object_flush_update(G.scene, self->object, OB_RECALC_DATA);
- return 0;
-}
-
-static PyObject *Object_insertShapeKey(BPy_Object * self)
-{
- insert_shapekey(self->object);
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getColor( BPy_Object *self, void *type )
-{
- return Py_BuildValue( "(ffff)", self->object->col[0], self->object->col[1], self->object->col[2], self->object->col[3] );
-}
-
-static int Object_setColor( BPy_Object *self, PyObject *value )
-{
- int i;
- float color[4];
- struct Object *object = self->object;
-
- value = PySequence_Tuple( value );
-
- if( !value || !PyArg_ParseTuple( value, "ffff", &color[0], &color[1], &color[2], &color[3] ) ) {
- Py_XDECREF( value );
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list or tuple of 3 floats" );
- }
-
- Py_DECREF( value );
-
- for( i = 0; i < 4; ++i ) {
- object->col[i] = MAX2(MIN2(color[i], 1.0), 0);
- }
- return 0;
-}
-
-/* __copy__() */
-static PyObject *Object_copy(BPy_Object * self)
-{
- /* copy_object never returns NULL */
- struct Object *object= copy_object( self->object );
- object->id.us= 0; /*is 1 by default, not sure why */
-
- /* Create a Python object from it. */
- return Object_CreatePyObject( object );
-}
-
-/*****************************************************************************/
-/* Function: Object_CreatePyObject */
-/* Description: This function will create a new BlenObject from an existing */
-/* Object structure. */
-/*****************************************************************************/
-PyObject *Object_CreatePyObject( struct Object * obj )
-{
- BPy_Object *blen_object;
-
- if( !obj ) Py_RETURN_NONE;
-
- blen_object =
- ( BPy_Object * ) PyObject_NEW( BPy_Object, &Object_Type );
-
- if( blen_object == NULL ) {
- return ( NULL );
- }
- blen_object->object = obj;
- blen_object->realtype = OB_EMPTY;
- obj->id.us++;
- return ( ( PyObject * ) blen_object );
-}
-
-/*****************************************************************************/
-/* Function: Object_FromPyObject */
-/* Description: This function returns the Blender object from the given */
-/* PyObject. */
-/*****************************************************************************/
-struct Object *Object_FromPyObject( PyObject * py_obj )
-{
- BPy_Object *blen_obj;
-
- blen_obj = ( BPy_Object * ) py_obj;
- return ( blen_obj->object );
-}
-
-/*****************************************************************************/
-/* Function: Object_dealloc */
-/* Description: This is a callback function for the BlenObject type. It is */
-/* the destructor function. */
-/*****************************************************************************/
-static void Object_dealloc( BPy_Object * self )
-{
- if( self->realtype != OB_EMPTY )
- free_libblock_us( &G.main->object, self->object );
- else
- self->object->id.us--;
-
-#if 0 /* this will adjust the ID and if zero delete the object */
- free_libblock_us( &G.main->object, self->object );
-#endif
- PyObject_DEL( self );
-}
-
-/*****************************************************************************/
-/* Function: Object_compare */
-/* Description: This is a callback function for the BPy_Object type. It */
-/* compares two Object_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Object struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Object_compare( BPy_Object * a, BPy_Object * b )
-{
- return ( a->object == b->object ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Object_repr */
-/* Description: This is a callback function for the BPy_Object type. It */
-/* builds a meaninful string to represent object objects. */
-/*****************************************************************************/
-static PyObject *Object_repr( BPy_Object * self )
-{
- return PyString_FromFormat( "[Object \"%s\"]",
- self->object->id.name + 2 );
-}
-
-/* Particle Deflection functions */
-
-static PyObject *Object_getPIDeflection( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyBool_FromLong( ( long ) self->object->pd->deflect );
-}
-
-static int Object_setPIDeflection( BPy_Object * self, PyObject * value )
-{
- int param;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected true/false argument" );
-
- self->object->pd->deflect = (short)param;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static PyObject *Object_getPIType( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyInt_FromLong( ( long )self->object->pd->forcefield );
-}
-
-static int Object_setPIType( BPy_Object * self, PyObject * value )
-{
- int status;
- int oldforcefield;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- oldforcefield = self->object->pd->forcefield;
- status = EXPP_setIValueRange( value, &self->object->pd->forcefield,
- PFIELD_FORCE, PFIELD_GUIDE, 'h' );
-
- /*
- * if value was set successfully but is PFIELD_MAGNET, restore the old
- * value and throw exception
- */
- if( !status ) {
- if ( self->object->pd->forcefield == PFIELD_MAGNET ) {
- self->object->pd->forcefield = oldforcefield;
- return EXPP_ReturnIntError( PyExc_ValueError,
- "PFIELD_MAGNET not supported" );
- }
- self->object->recalc |= OB_RECALC_OB;
- }
- return status;
-}
-
-static PyObject *Object_getPIUseMaxDist( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyBool_FromLong( ( long )self->object->pd->flag );
-}
-
-static int Object_setPIUseMaxDist( BPy_Object * self, PyObject * value )
-{
- int param;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected true/false argument" );
-
- self->object->pd->flag = (short)param;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-/* RIGIDBODY FUNCTIONS */
-
-static PyObject *Object_getRBMass( BPy_Object * self )
-{
- return PyFloat_FromDouble( (double)self->object->mass );
-}
-
-static int Object_setRBMass( BPy_Object * self, PyObject * args )
-{
- float value;
- PyObject* flt = PyNumber_Float( args );
-
- if( !flt )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
- value = (float)PyFloat_AS_DOUBLE( flt );
- Py_DECREF( flt );
-
- if( value < 0.0f )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are non-negative, 0.0 or more" );
-
- self->object->mass = value;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-/* this is too low level, possible to add helper methods */
-
-#define GAMEFLAG_MASK ( OB_COLLISION | OB_DYNAMIC | OB_CHILD | OB_ACTOR | OB_DO_FH | \
- OB_ROT_FH | OB_ANISOTROPIC_FRICTION | OB_GHOST | OB_RIGID_BODY | OB_SOFT_BODY | \
- OB_BOUNDS | OB_COLLISION_RESPONSE | OB_SECTOR | OB_PROP | \
- OB_MAINACTOR )
-
-static PyObject *Object_getRBFlags( BPy_Object * self )
-{
- return PyInt_FromLong( (long)( self->object->gameflag & GAMEFLAG_MASK ) );
-}
-
-static int Object_setRBFlags( BPy_Object * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- int value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( int )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
- if( value & ~GAMEFLAG_MASK )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "undefined bit(s) set in bitfield" );
-
- self->object->gameflag = value;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static PyObject *Object_getRBShapeBoundType( BPy_Object * self )
-{
- return PyInt_FromLong( (long)self->object->boundtype );
-}
-
-static int Object_setRBShapeBoundType( BPy_Object * self, PyObject * args )
-{
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setIValueRange( args, &self->object->boundtype,
- 0, OB_BOUND_DYN_MESH, 'h' );
-}
-
-/* SOFTBODY FUNCTIONS */
-
-PyObject *Object_isSB(BPy_Object *self)
-{
- if( self->object->soft )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static PyObject *Object_getSBUseGoal( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( self->object->softflag & OB_SB_GOAL )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setSBUseGoal( BPy_Object * self, PyObject * value )
-{
- int setting = PyObject_IsTrue( value );
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( setting == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected true/false argument" );
-
- if( setting )
- self->object->softflag |= OB_SB_GOAL;
- else
- self->object->softflag &= ~OB_SB_GOAL;
-
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-static PyObject *Object_getSBUseEdges( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( self->object->softflag & OB_SB_EDGES )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setSBUseEdges( BPy_Object * self, PyObject * value )
-{
- int setting = PyObject_IsTrue( value );
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( setting == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected true/false argument" );
-
- if( setting )
- self->object->softflag |= OB_SB_EDGES;
- else
- self->object->softflag &= ~OB_SB_EDGES;
-
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-static PyObject *Object_getSBStiffQuads( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( self->object->softflag & OB_SB_QUADS )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setSBStiffQuads( BPy_Object * self, PyObject * value )
-{
- int setting = PyObject_IsTrue( value );
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( setting == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected true/false argument" );
-
- if( setting )
- self->object->softflag |= OB_SB_QUADS;
- else
- self->object->softflag &= ~OB_SB_QUADS;
-
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-static int setupSB( Object* ob )
-{
- ob->soft= sbNew();
- ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
-
- if( !ob->soft )
- return 0;
- /* all this is initialized in sbNew() */
-#if 0
- ob->soft->mediafrict = 0.5f;
- ob->soft->nodemass = 1.0f;
- ob->soft->grav = 0.0f;
- ob->soft->rklimit = 0.1f;
-
- ob->soft->goalspring = 0.5f;
- ob->soft->goalfrict = 0.0f;
- ob->soft->mingoal = 0.0f;
- ob->soft->maxgoal = 1.0f;
- ob->soft->defgoal = 0.7f;
-
- ob->soft->inspring = 0.5f;
- ob->soft->infrict = 0.5f;
-#endif
- return 1;
-}
-
-static int setupPI( Object* ob )
-{
- if( ob->pd==NULL ) {
- ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
- /* and if needed, init here */
- }
-
- if( !ob->pd )
- return 0;
-
- ob->pd->deflect =0;
- ob->pd->forcefield =0;
- ob->pd->flag =0;
- ob->pd->pdef_damp =0;
- ob->pd->pdef_rdamp =0;
- ob->pd->pdef_perm =0;
- ob->pd->f_strength =0;
- ob->pd->f_power =0;
- ob->pd->maxdist =0;
- return 1;
-}
-
-/*
- * scan list of Objects looking for matching obdata.
- * if found, set OB_RECALC_DATA flag.
- * call this from a bpy type update() method.
- */
-
-void Object_updateDag( void *data )
-{
- Object *ob;
-
- if( !data )
- return;
-
- for( ob = G.main->object.first; ob; ob= ob->id.next ){
- if( ob->data == data ) {
- ob->recalc |= OB_RECALC_DATA;
- }
- }
-}
-
-/*
- * utilities routines for handling generic getters and setters
- */
-
-/*
- * get integer attributes
- */
-
-static PyObject *getIntAttr( BPy_Object *self, void *type )
-{
- int param;
- struct Object *object = self->object;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_LAYERMASK:
- param = object->lay;
- break;
- case EXPP_OBJ_ATTR_COLBITS:
- param = object->colbits;
- if( param < 0 ) param += 65536;
- break;
- case EXPP_OBJ_ATTR_DRAWMODE:
- param = object->dtx;
- break;
- case EXPP_OBJ_ATTR_DRAWTYPE:
- param = object->dt;
- break;
- case EXPP_OBJ_ATTR_EMPTY_DRAWTYPE:
- param = object->empty_drawtype;
- break;
- case EXPP_OBJ_ATTR_PARENT_TYPE:
- param = object->partype;
- break;
- case EXPP_OBJ_ATTR_DUPON:
- param = object->dupon;
- break;
- case EXPP_OBJ_ATTR_DUPOFF:
- param = object->dupoff;
- break;
- case EXPP_OBJ_ATTR_DUPSTA:
- param = object->dupsta;
- break;
- case EXPP_OBJ_ATTR_DUPEND:
- param = object->dupend;
- break;
- case EXPP_OBJ_ATTR_PASSINDEX:
- param = object->index;
- break;
- case EXPP_OBJ_ATTR_ACT_MATERIAL:
- param = object->actcol;
- break;
- case EXPP_OBJ_ATTR_ACT_SHAPE:
- param = object->shapenr;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getIntAttr" );
- }
-
- return PyInt_FromLong( param );
-}
-
-/*
- * set integer attributes which require clamping
- */
-
-static int setIntAttrClamp( BPy_Object *self, PyObject *value, void *type )
-{
- void *param;
- struct Object *object = self->object;
- int min, max, size;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_DUPON:
- min = 1;
- max = 1500;
- size = 'H'; /* in case max is later made > 32767 */
- param = (void *)&object->dupon;
- break;
- case EXPP_OBJ_ATTR_DUPOFF:
- min = 0;
- max = 1500;
- size = 'H'; /* in case max is later made > 32767 */
- param = (void *)&object->dupoff;
- break;
- case EXPP_OBJ_ATTR_DUPSTA:
- min = 1;
- max = 32767;
- size = 'H'; /* in case max is later made > 32767 */
- param = (void *)&object->dupsta;
- break;
- case EXPP_OBJ_ATTR_DUPEND:
- min = 1;
- max = 32767;
- size = 'H'; /* in case max is later made > 32767 */
- param = (void *)&object->dupend;
- break;
- case EXPP_OBJ_ATTR_PASSINDEX:
- min = 0;
- max = 1000;
- size = 'H'; /* in case max is later made > 32767 */
- param = (void *)&object->index;
- break;
- case EXPP_OBJ_ATTR_ACT_MATERIAL:
- min = 1;
- max = object->totcol;
- size = 'b'; /* in case max is later made > 128 */
- param = (void *)&object->actcol;
- break;
- case EXPP_OBJ_ATTR_ACT_SHAPE:
- {
- Key *key= ob_get_key(object);
- KeyBlock *kb;
- min = 1;
- max = 0;
- if (key) {
- max= 1;
- for (kb = key->block.first; kb; kb=kb->next, max++);
- }
- size = 'h'; /* in case max is later made > 128 */
- param = (void *)&object->shapenr;
- break;
- }
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setIntAttrClamp");
- }
-
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setIValueClamped( value, param, min, max, size );
-}
-
-/*
- * set integer attributes which require range checking
- */
-
-static int setIntAttrRange( BPy_Object *self, PyObject *value, void *type )
-{
- void *param;
- struct Object *object = self->object;
- int min, max, size;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- /* these parameters require clamping */
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_COLBITS:
- min = 0;
- max = 0xffff;
- size = 'H';
- param = (void *)&object->colbits;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setIntAttrRange" );
- }
-
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setIValueRange( value, param, min, max, size );
-}
-
-/*
- * get floating point attributes
- */
-
-static PyObject *getFloatAttr( BPy_Object *self, void *type )
-{
- float param;
- struct Object *object = self->object;
-
- if( GET_INT_FROM_POINTER(type) >= EXPP_OBJ_ATTR_PI_SURFACEDAMP &&
- GET_INT_FROM_POINTER(type) <= EXPP_OBJ_ATTR_PI_SBOFACETHICK ) {
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
- }
- else if( GET_INT_FROM_POINTER(type) >= EXPP_OBJ_ATTR_SB_NODEMASS &&
- GET_INT_FROM_POINTER(type) <= EXPP_OBJ_ATTR_SB_INFRICT ) {
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
- }
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_LOC_X:
- param = object->loc[0];
- break;
- case EXPP_OBJ_ATTR_LOC_Y:
- param = object->loc[1];
- break;
- case EXPP_OBJ_ATTR_LOC_Z:
- param = object->loc[2];
- break;
- case EXPP_OBJ_ATTR_DLOC_X:
- param = object->dloc[0];
- break;
- case EXPP_OBJ_ATTR_DLOC_Y:
- param = object->dloc[1];
- break;
- case EXPP_OBJ_ATTR_DLOC_Z:
- param = object->dloc[2];
- break;
- case EXPP_OBJ_ATTR_ROT_X:
- param = object->rot[0];
- break;
- case EXPP_OBJ_ATTR_ROT_Y:
- param = object->rot[1];
- break;
- case EXPP_OBJ_ATTR_ROT_Z:
- param = object->rot[2];
- break;
- case EXPP_OBJ_ATTR_DROT_X:
- param = object->drot[0];
- break;
- case EXPP_OBJ_ATTR_DROT_Y:
- param = object->drot[1];
- break;
- case EXPP_OBJ_ATTR_DROT_Z:
- param = object->drot[2];
- break;
- case EXPP_OBJ_ATTR_SIZE_X:
- param = object->size[0];
- break;
- case EXPP_OBJ_ATTR_SIZE_Y:
- param = object->size[1];
- break;
- case EXPP_OBJ_ATTR_SIZE_Z:
- param = object->size[2];
- break;
- case EXPP_OBJ_ATTR_DSIZE_X:
- param = object->dsize[0];
- break;
- case EXPP_OBJ_ATTR_DSIZE_Y:
- param = object->dsize[1];
- break;
- case EXPP_OBJ_ATTR_DSIZE_Z:
- param = object->dsize[2];
- break;
- case EXPP_OBJ_ATTR_TIMEOFFSET:
- param = object->sf;
- break;
- case EXPP_OBJ_ATTR_DRAWSIZE:
- param = object->empty_drawsize;
- break;
- case EXPP_OBJ_ATTR_PI_SURFACEDAMP:
- param = object->pd->pdef_perm;
- break;
- case EXPP_OBJ_ATTR_PI_RANDOMDAMP:
- param = object->pd->pdef_rdamp;
- break;
- case EXPP_OBJ_ATTR_PI_PERM:
- param = object->pd->pdef_perm;
- break;
- case EXPP_OBJ_ATTR_PI_STRENGTH:
- param = object->pd->f_strength;
- break;
- case EXPP_OBJ_ATTR_PI_FALLOFF:
- param = object->pd->f_power;
- break;
- case EXPP_OBJ_ATTR_PI_MAXDIST:
- param = object->pd->maxdist;
- break;
- case EXPP_OBJ_ATTR_PI_SBDAMP:
- param = object->pd->pdef_sbdamp;
- break;
- case EXPP_OBJ_ATTR_PI_SBIFACETHICK:
- param = object->pd->pdef_sbift;
- break;
- case EXPP_OBJ_ATTR_PI_SBOFACETHICK:
- param = object->pd->pdef_sboft;
- break;
- case EXPP_OBJ_ATTR_SB_NODEMASS:
- param = self->object->soft->nodemass;
- break;
- case EXPP_OBJ_ATTR_SB_GRAV:
- param = self->object->soft->grav;
- break;
- case EXPP_OBJ_ATTR_SB_MEDIAFRICT:
- param = self->object->soft->mediafrict;
- break;
- case EXPP_OBJ_ATTR_SB_RKLIMIT:
- param = object->soft->rklimit;
- break;
- case EXPP_OBJ_ATTR_SB_PHYSICSSPEED:
- param = object->soft->physics_speed;
- break;
- case EXPP_OBJ_ATTR_SB_GOALSPRING:
- param = object->soft->goalspring;
- break;
- case EXPP_OBJ_ATTR_SB_GOALFRICT:
- param = object->soft->goalfrict;
- break;
- case EXPP_OBJ_ATTR_SB_MINGOAL:
- param = object->soft->mingoal;
- break;
- case EXPP_OBJ_ATTR_SB_MAXGOAL:
- param = object->soft->maxgoal;
- break;
- case EXPP_OBJ_ATTR_SB_DEFGOAL:
- param = object->soft->defgoal;
- break;
- case EXPP_OBJ_ATTR_SB_INSPRING:
- param = object->soft->inspring;
- break;
- case EXPP_OBJ_ATTR_SB_INFRICT:
- param = object->soft->infrict;
- break;
- case EXPP_OBJ_ATTR_DUPFACESCALEFAC:
- param = object->dupfacesca;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getFloatAttr" );
- }
-
- return PyFloat_FromDouble( param );
-}
-
-/*
- * set floating point attributes which require clamping
- */
-
-static int setFloatAttrClamp( BPy_Object *self, PyObject *value, void *type )
-{
- float *param;
- struct Object *object = self->object;
- float min, max;
-
- if( GET_INT_FROM_POINTER(type) >= EXPP_OBJ_ATTR_PI_SURFACEDAMP &&
- GET_INT_FROM_POINTER(type) <= EXPP_OBJ_ATTR_PI_SBOFACETHICK ) {
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
- }
- else if( GET_INT_FROM_POINTER(type) >= EXPP_OBJ_ATTR_SB_NODEMASS &&
- GET_INT_FROM_POINTER(type) <= EXPP_OBJ_ATTR_SB_INFRICT ) {
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "softbody could not be accessed" );
- }
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_DRAWSIZE:
- min = EXPP_OBJECT_DRAWSIZEMIN;
- max = EXPP_OBJECT_DRAWSIZEMAX;
- param = &object->empty_drawsize;
- break;
- case EXPP_OBJ_ATTR_TIMEOFFSET:
- min = -MAXFRAMEF;
- max = MAXFRAMEF;
- param = &object->sf;
- break;
- case EXPP_OBJ_ATTR_PI_SURFACEDAMP:
- min = EXPP_OBJECT_PIDAMP_MIN;
- max = EXPP_OBJECT_PIDAMP_MAX;
- param = &object->pd->pdef_perm;
- break;
- case EXPP_OBJ_ATTR_PI_RANDOMDAMP:
- min = EXPP_OBJECT_PIRDAMP_MIN;
- max = EXPP_OBJECT_PIRDAMP_MAX;
- param = &object->pd->pdef_rdamp;
- break;
- case EXPP_OBJ_ATTR_PI_PERM:
- min = EXPP_OBJECT_PIPERM_MIN;
- max = EXPP_OBJECT_PIPERM_MAX;
- param = &object->pd->pdef_perm;
- break;
- case EXPP_OBJ_ATTR_PI_STRENGTH:
- min = EXPP_OBJECT_PISTRENGTH_MIN;
- max = EXPP_OBJECT_PISTRENGTH_MAX;
- param = &object->pd->f_strength;
- break;
- case EXPP_OBJ_ATTR_PI_FALLOFF:
- min = EXPP_OBJECT_PIPOWER_MIN;
- max = EXPP_OBJECT_PIPOWER_MAX;
- param = &object->pd->f_power;
- break;
- case EXPP_OBJ_ATTR_PI_MAXDIST:
- min = EXPP_OBJECT_PIMAXDIST_MIN;
- max = EXPP_OBJECT_PIMAXDIST_MAX;
- param = &object->pd->maxdist;
- break;
- case EXPP_OBJ_ATTR_PI_SBDAMP:
- min = EXPP_OBJECT_PISBDAMP_MIN;
- max = EXPP_OBJECT_PISBDAMP_MAX;
- param = &object->pd->pdef_sbdamp;
- break;
- case EXPP_OBJ_ATTR_PI_SBIFACETHICK:
- min = EXPP_OBJECT_PISBIFTMIN;
- max = EXPP_OBJECT_PISBIFTMAX;
- param = &object->pd->pdef_sbift;
- break;
- case EXPP_OBJ_ATTR_PI_SBOFACETHICK:
- min = EXPP_OBJECT_PISBOFTMIN;
- max = EXPP_OBJECT_PISBOFTMAX;
- param = &object->pd->pdef_sboft;
- break;
- case EXPP_OBJ_ATTR_SB_NODEMASS:
- min = EXPP_OBJECT_SBNODEMASSMIN;
- max = EXPP_OBJECT_SBNODEMASSMAX;
- param = &self->object->soft->nodemass;
- break;
- case EXPP_OBJ_ATTR_SB_GRAV:
- min = EXPP_OBJECT_SBGRAVMIN;
- max = EXPP_OBJECT_SBGRAVMAX;
- param = &self->object->soft->grav;
- break;
- case EXPP_OBJ_ATTR_SB_MEDIAFRICT:
- min = EXPP_OBJECT_SBMEDIAFRICTMIN;
- max = EXPP_OBJECT_SBMEDIAFRICTMAX;
- param = &self->object->soft->mediafrict;
- break;
- case EXPP_OBJ_ATTR_SB_RKLIMIT:
- min = EXPP_OBJECT_SBRKLIMITMIN;
- max = EXPP_OBJECT_SBRKLIMITMAX;
- param = &self->object->soft->rklimit;
- break;
- case EXPP_OBJ_ATTR_SB_PHYSICSSPEED:
- min = EXPP_OBJECT_SBPHYSICSSPEEDMIN;
- max = EXPP_OBJECT_SBPHYSICSSPEEDMAX;
- param = &self->object->soft->physics_speed;
- break;
- case EXPP_OBJ_ATTR_SB_GOALSPRING:
- min = EXPP_OBJECT_SBGOALSPRINGMIN;
- max = EXPP_OBJECT_SBGOALSPRINGMAX;
- param = &self->object->soft->goalspring;
- break;
- case EXPP_OBJ_ATTR_SB_GOALFRICT:
- min = EXPP_OBJECT_SBGOALFRICTMIN;
- max = EXPP_OBJECT_SBGOALFRICTMAX;
- param = &self->object->soft->goalfrict;
- break;
- case EXPP_OBJ_ATTR_SB_MINGOAL:
- min = EXPP_OBJECT_SBMINGOALMIN;
- max = EXPP_OBJECT_SBMINGOALMAX;
- param = &self->object->soft->mingoal;
- break;
- case EXPP_OBJ_ATTR_SB_MAXGOAL:
- min = EXPP_OBJECT_SBMAXGOALMIN;
- max = EXPP_OBJECT_SBMAXGOALMAX;
- param = &self->object->soft->maxgoal;
- break;
- case EXPP_OBJ_ATTR_SB_DEFGOAL:
- min = EXPP_OBJECT_SBDEFGOALMIN;
- max = EXPP_OBJECT_SBDEFGOALMAX;
- param = &self->object->soft->defgoal;
- break;
- case EXPP_OBJ_ATTR_SB_INSPRING:
- min = EXPP_OBJECT_SBINSPRINGMIN;
- max = EXPP_OBJECT_SBINSPRINGMAX;
- param = &self->object->soft->inspring;
- break;
- case EXPP_OBJ_ATTR_SB_INFRICT:
- min = EXPP_OBJECT_SBINFRICTMIN;
- max = EXPP_OBJECT_SBINFRICTMAX;
- param = &self->object->soft->infrict;
- break;
- case EXPP_OBJ_ATTR_DUPFACESCALEFAC:
- min = EXPP_OBJECT_DUPFACESCALEFACMIN;
- max = EXPP_OBJECT_DUPFACESCALEFACMAX;
- param = &self->object->dupfacesca;
- break;
-
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloatAttrClamp" );
- }
-
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setFloatClamped( value, param, min, max );
-}
-
-/*
- * set floating point attributes
- */
-
-static int setFloatAttr( BPy_Object *self, PyObject *value, void *type )
-{
- float param;
- struct Object *object = self->object;
-
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- param = (float)PyFloat_AsDouble( value );
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_LOC_X:
- object->loc[0] = param;
- break;
- case EXPP_OBJ_ATTR_LOC_Y:
- object->loc[1] = param;
- break;
- case EXPP_OBJ_ATTR_LOC_Z:
- object->loc[2] = param;
- break;
- case EXPP_OBJ_ATTR_DLOC_X:
- object->dloc[0] = param;
- break;
- case EXPP_OBJ_ATTR_DLOC_Y:
- object->dloc[1] = param;
- break;
- case EXPP_OBJ_ATTR_DLOC_Z:
- object->dloc[2] = param;
- break;
- case EXPP_OBJ_ATTR_ROT_X:
- object->rot[0] = param;
- break;
- case EXPP_OBJ_ATTR_ROT_Y:
- object->rot[1] = param;
- break;
- case EXPP_OBJ_ATTR_ROT_Z:
- object->rot[2] = param;
- break;
- case EXPP_OBJ_ATTR_DROT_X:
- object->drot[0] = param;
- break;
- case EXPP_OBJ_ATTR_DROT_Y:
- object->drot[1] = param;
- break;
- case EXPP_OBJ_ATTR_DROT_Z:
- object->drot[2] = param;
- break;
- case EXPP_OBJ_ATTR_SIZE_X:
- object->size[0] = param;
- break;
- case EXPP_OBJ_ATTR_SIZE_Y:
- object->size[1] = param;
- break;
- case EXPP_OBJ_ATTR_SIZE_Z:
- object->size[2] = param;
- break;
- case EXPP_OBJ_ATTR_DSIZE_X:
- object->dsize[0] = param;
- break;
- case EXPP_OBJ_ATTR_DSIZE_Y:
- object->dsize[1] = param;
- break;
- case EXPP_OBJ_ATTR_DSIZE_Z:
- object->dsize[2] = param;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloatAttr " );
- }
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-/*
- * get 3-tuple floating point attributes
- */
-
-static PyObject *getFloat3Attr( BPy_Object *self, void *type )
-{
- float *param;
- struct Object *object = self->object;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_LOC:
- param = object->loc;
- break;
- case EXPP_OBJ_ATTR_DLOC:
- param = object->dloc;
- break;
- case EXPP_OBJ_ATTR_DROT:
- param = object->drot;
- break;
- case EXPP_OBJ_ATTR_SIZE:
- param = object->size;
- break;
- case EXPP_OBJ_ATTR_DSIZE:
- param = object->dsize;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getFloat3Attr" );
- }
-
- return Py_BuildValue( "(fff)", param[0], param[1], param[2] );
-}
-
-/*
- * set 3-tuple floating point attributes
- */
-
-static int setFloat3Attr( BPy_Object *self, PyObject *value, void *type )
-{
- int i;
- float *dst, param[3];
- struct Object *object = self->object;
-
- value = PySequence_Tuple( value );
-
- if( !value || !PyArg_ParseTuple( value, "fff", &param[0], &param[1], &param[2] ) ) {
- Py_XDECREF( value );
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list or tuple of 3 floats" );
- }
-
- Py_DECREF( value );
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_OBJ_ATTR_LOC:
- dst = object->loc;
- break;
- case EXPP_OBJ_ATTR_DLOC:
- dst = object->dloc;
- break;
- case EXPP_OBJ_ATTR_DROT:
- dst = object->drot;
- break;
- case EXPP_OBJ_ATTR_SIZE:
- dst = object->size;
- break;
- case EXPP_OBJ_ATTR_DSIZE:
- dst = object->dsize;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloat3Attr" );
- }
-
- for( i = 0; i < 3; ++i )
- dst[i] = param[i];
-
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-/*****************************************************************************/
-/* BPy_Object methods and attribute handlers */
-/*****************************************************************************/
-
-static PyObject *Object_getShapeFlag( BPy_Object *self, void *type )
-{
- if (self->object->shapeflag & GET_INT_FROM_POINTER(type))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setShapeFlag( BPy_Object *self, PyObject *value,
- void *type )
-{
- if (PyObject_IsTrue(value) )
- self->object->shapeflag |= GET_INT_FROM_POINTER(type);
- else
- self->object->shapeflag &= ~GET_INT_FROM_POINTER(type);
-
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-static PyObject *Object_getRestricted( BPy_Object *self, void *type )
-{
- if (self->object->restrictflag & GET_INT_FROM_POINTER(type))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int Object_setRestricted( BPy_Object *self, PyObject *value,
- void *type )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if ( param )
- self->object->restrictflag |= GET_INT_FROM_POINTER(type);
- else
- self->object->restrictflag &= ~GET_INT_FROM_POINTER(type);
-
- return 0;
-}
-
-static PyObject *Object_getDrawModeBits( BPy_Object *self, void *type )
-{
- return EXPP_getBitfield( (void *)&self->object->dtx, GET_INT_FROM_POINTER(type), 'b' );
-}
-
-static int Object_setDrawModeBits( BPy_Object *self, PyObject *value,
- void *type )
-{
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setBitfield( value, (void *)&self->object->dtx,
- GET_INT_FROM_POINTER(type), 'b' );
-}
-
-static PyObject *Object_getTransflagBits( BPy_Object *self, void *type )
-{
- return EXPP_getBitfield( (void *)&self->object->transflag,
- GET_INT_FROM_POINTER(type), 'h' );
-}
-
-static int Object_setTransflagBits( BPy_Object *self, PyObject *value,
- void *type )
-{
- self->object->recalc |= OB_RECALC_OB;
- return EXPP_setBitfield( value, (void *)&self->object->transflag,
- GET_INT_FROM_POINTER(type), 'h' );
-}
-
-static PyObject *Object_getLayers( BPy_Object * self )
-{
- int layers, bit;
- PyObject *laylist = PyList_New( 0 );
-
- if( !laylist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "PyList_New() failed" );
-
- layers = self->object->lay & 0xfffff; /* get layer bitmask */
-
- /*
- * starting with the first layer, and until there are no more layers,
- * find which layers are visible
- */
-
- for( bit = 1; layers; ++bit ) {
- if( layers & 1 ) { /* if layer is visible, add to list */
- PyObject *item = PyInt_FromLong( bit );
- PyList_Append( laylist, item );
- Py_DECREF( item );
- }
- layers >>= 1; /* go to the next layer */
- }
- return laylist;
-}
-
-/*
- * usage note: caller of this func needs to do a Blender.Redraw(-1)
- * to update and redraw the interface
- */
-
-static int Object_setLayers( BPy_Object * self, PyObject *value )
-{
- int layers = 0, val, i, len_list, local;
- Base *base;
-
- if( !PyList_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of integers in the range [1, 20]" );
-
- len_list = PyList_Size( value );
-
- /* build a bitmask, check for values outside of range */
-
- for( i = 0; i < len_list; i++ ) {
- PyObject* integer = PyNumber_Int( PyList_GetItem( value, i ) );
- val = PyInt_AsLong( integer );
- Py_XDECREF( integer );
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "list must contain only integer numbers" );
- if( val < 1 || val > 20 )
- return EXPP_ReturnIntError ( PyExc_ValueError,
- "layer values must be in the range [1, 20]" );
- layers |= 1 << ( val - 1 );
- }
-
- /* do this, to ensure layers are set for objects not in current scene */
- self->object->lay= layers;
-
- /* update any bases pointing to our object */
- base = FIRSTBASE; /* first base in current scene */
- while( base ) {
- if( base->object == self->object ) {
- base->lay &= 0xFFF00000;
- local = base->lay;
- base->lay = local | layers;
- self->object->lay = base->lay;
- break;
- }
- base = base->next;
- }
-
- /* these to calls here are overkill! (ton) */
- if (base) { /* The object was found? */
- countall();
- DAG_scene_sort( G.scene );
- }
- return 0;
-}
-
-static int Object_setLayersMask( BPy_Object *self, PyObject *value )
-{
- int layers = 0, local;
- Base *base;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an integer (bitmask) as argument" );
-
- layers = PyInt_AS_LONG( value );
-
- /* make sure some bits are set, and only those bits are set */
-
- if( !( layers & 0xFFFFF ) || ( layers & 0xFFF00000 ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "bitmask must have between 1 and 20 bits set" );
-
- /* update any bases pointing to our object */
-
- base = FIRSTBASE; /* first base in current scene */
- while( base ) {
- if( base->object == self->object ) {
- base->lay &= 0xFFF00000;
- local = base->lay;
- base->lay = local | layers;
- self->object->lay = base->lay;
- break;
- }
- base = base->next;
- }
- if (base) { /* The object was found? */
- countall();
- DAG_scene_sort( G.scene );
- }
- return 0;
-}
-
-/*
- * this should accept a Py_None argument and just delete the Ipo link
- * (as Object_clearIpo() does)
- */
-
-static int Object_setIpo( BPy_Object * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->object->ipo, 0, 1, ID_IP, ID_OB);
-}
-
-static int Object_setTracked( BPy_Object * self, PyObject * value )
-{
- int ret;
- ret = GenericLib_assignData(value, (void **) &self->object->track, 0, 0, ID_OB, 0);
- if (ret==0) {
- self->object->recalc |= OB_RECALC_OB;
- DAG_scene_sort( G.scene );
- }
- return ret;
-}
-
-/* Localspace matrix */
-
-static PyObject *Object_getMatrixLocal( BPy_Object * self )
-{
- if( self->object->parent ) {
- float matrix[4][4]; /* for the result */
- float invmat[4][4]; /* for inverse of parent's matrix */
-
- Mat4Invert(invmat, self->object->parent->obmat );
- Mat4MulMat4(matrix, self->object->obmat, invmat);
- return newMatrixObject((float*)matrix,4,4,Py_NEW);
- } else { /* no parent, so return world space matrix */
- disable_where_script( 1 );
- where_is_object( self->object );
- disable_where_script( 0 );
- return newMatrixObject((float*)self->object->obmat,4,4,Py_WRAP);
- }
-}
-
-/* Worldspace matrix */
-
-static PyObject *Object_getMatrixWorld( BPy_Object * self )
-{
- disable_where_script( 1 );
- where_is_object( self->object );
- disable_where_script( 0 );
- return newMatrixObject((float*)self->object->obmat,4,4,Py_WRAP);
-}
-
-/* Parent Inverse matrix */
-
-static PyObject *Object_getMatrixParentInverse( BPy_Object * self )
-{
- return newMatrixObject((float*)self->object->parentinv,4,4,Py_WRAP);
-}
-
-/*
- * Old behavior, prior to Blender 2.34, where eventual changes made by the
- * script itself were not taken into account until a redraw happened, either
- * called by the script or upon its exit.
- */
-
-static PyObject *Object_getMatrixOldWorld( BPy_Object * self )
-{
- return newMatrixObject((float*)self->object->obmat,4,4,Py_WRAP);
-}
-
-/*
- * get one of three different matrix representations
- */
-
-static PyObject *Object_getMatrix( BPy_Object * self, PyObject * args )
-{
- char *space = "worldspace"; /* default to world */
- char *errstr = "expected nothing, 'worldspace' (default), 'localspace' or 'old_worldspace'";
-
- if( !PyArg_ParseTuple( args, "|s", &space ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError, errstr );
-
- if( BLI_streq( space, "worldspace" ) )
- return Object_getMatrixWorld( self );
- else if( BLI_streq( space, "localspace" ) )
- return Object_getMatrixLocal( self );
- else if( BLI_streq( space, "old_worldspace" ) )
- return Object_getMatrixOldWorld( self );
- else
- return EXPP_ReturnPyObjError( PyExc_ValueError, errstr );
-}
-
-static PyObject *get_obj_data( BPy_Object *self, int mesh )
-{
- Object *object = self->object;
- PyObject *data_object = NULL;
-
- switch ( object->type ) {
- case OB_ARMATURE:
- data_object = Armature_CreatePyObject( object->data );
- break;
- case OB_CAMERA:
- data_object = Camera_CreatePyObject( object->data );
- break;
- case OB_CURVE:
- case OB_SURF:
- data_object = Curve_CreatePyObject( object->data );
- break;
- case ID_IM:
- data_object = Image_CreatePyObject( object->data );
- break;
- case ID_IP:
- data_object = Ipo_CreatePyObject( object->data );
- break;
- case OB_LAMP:
- data_object = Lamp_CreatePyObject( object->data );
- break;
- case OB_LATTICE:
- data_object = Lattice_CreatePyObject( object->data );
- break;
- case ID_MA:
- break;
- case OB_MESH:
- if( !mesh ) /* get as NMesh (default) */
- data_object = NMesh_CreatePyObject( object->data, object );
- else /* else get as Mesh */
- data_object = Mesh_CreatePyObject( object->data, object );
- break;
- case OB_MBALL:
- data_object = Metaball_CreatePyObject( object->data );
- break;
- case ID_OB:
- data_object = Object_CreatePyObject( object->data );
- break;
- case ID_SCE:
- break;
- case OB_FONT:
- data_object = Text3d_CreatePyObject( object->data );
- break;
- case ID_WO:
- break;
- default:
- break;
- }
-
- if( data_object )
- return data_object;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getData( BPy_Object *self, PyObject *args,
- PyObject *kwd )
-{
- Object *object = self->object;
- int name_only = 0;
- int mesh = 0; /* default mesh type = NMesh */
- static char *kwlist[] = {"name_only", "mesh", NULL};
-
- if( !PyArg_ParseTupleAndKeywords(args, kwd, "|ii", kwlist,
- &name_only, &mesh) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or bool keywords 'name_only' or 'mesh' as argument" );
-
- /* if there's no obdata, try to create it */
- if( object->data == NULL ) {
- int tmptype = object->type; /* save current type */
-
- /* if we have no data and are faking an empty, set the type */
- if( self->realtype != OB_EMPTY )
- object->type = self->realtype;
-
- if( EXPP_add_obdata( object ) != 0 ) { /* couldn't create obdata */
- object->type = tmptype; /* restore previous type */
- Py_RETURN_NONE;
- }
-
- /* if we set data successfully, clear the fake type */
- self->realtype = OB_EMPTY;
- }
-
- /* user wants only the name of the data object */
- if( name_only ) {
- ID *id = object->data;
- return PyString_FromString( id->name+2 );
- }
-
- return get_obj_data( self, mesh );
-}
-
-static PyObject *Object_getEuler( BPy_Object * self )
-{
- return ( PyObject * ) newEulerObject( self->object->rot, Py_WRAP );
-}
-
-#define PROTFLAGS_MASK ( OB_LOCK_LOCX | OB_LOCK_LOCY | OB_LOCK_LOCZ | \
- OB_LOCK_ROTX | OB_LOCK_ROTY | OB_LOCK_ROTZ | \
- OB_LOCK_SCALEX | OB_LOCK_SCALEY | OB_LOCK_SCALEZ )
-
-static PyObject *Object_getProtectFlags( BPy_Object * self )
-{
- return PyInt_FromLong( (long)(self->object->protectflag & PROTFLAGS_MASK) );
-}
-
-static int Object_setProtectFlags( BPy_Object * self, PyObject * args )
-{
- PyObject* integer = PyNumber_Int( args );
- short value;
-
- if( !integer )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- value = ( short )PyInt_AS_LONG( integer );
- Py_DECREF( integer );
- if( value & ~PROTFLAGS_MASK )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "undefined bit(s) set in bitfield" );
-
- self->object->protectflag = value;
- self->object->recalc |= OB_RECALC_OB;
- return 0;
-}
-
-static PyObject *Object_getRBRadius( BPy_Object * self )
-{
- return PyFloat_FromDouble( (double) self->object->inertia );
-}
-
-static int Object_setRBRadius( BPy_Object * self, PyObject * args )
-{
- float value;
- PyObject* flt = PyNumber_Float( args );
-
- if( !flt )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
- value = (float)PyFloat_AS_DOUBLE( flt );
- Py_DECREF( flt );
-
- if( value < 0.0f )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "acceptable values are non-negative, 0.0 or more" );
-
- self->object->inertia = value;
- self->object->recalc |= OB_RECALC_OB;
-
- return 0;
-}
-
-static PyObject *Object_getRBHalfExtents( BPy_Object * self )
-{
- float center[3], extents[3];
-
- get_local_bounds( self->object, center, extents );
- return Py_BuildValue( "[fff]", extents[0], extents[1], extents[2] );
-}
-
-static PyGetSetDef BPy_Object_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"LocX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The X location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_LOC_X},
- {"LocY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Y location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_LOC_Y},
- {"LocZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Z location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_LOC_Z},
- {"dLocX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta X location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_DLOC_X},
- {"dLocY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Y location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_DLOC_Y},
- {"dLocZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Z location coordinate of the object",
- (void *)EXPP_OBJ_ATTR_DLOC_Z},
- {"RotX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The X rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_ROT_X},
- {"RotY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Y rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_ROT_Y},
- {"RotZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Z rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_ROT_Z},
- {"dRotX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta X rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_DROT_X},
- {"dRotY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Y rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_DROT_Y},
- {"dRotZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Z rotation angle (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_DROT_Z},
- {"SizeX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The X size of the object",
- (void *)EXPP_OBJ_ATTR_SIZE_X},
- {"SizeY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Y size of the object",
- (void *)EXPP_OBJ_ATTR_SIZE_Y},
- {"SizeZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The Z size of the object",
- (void *)EXPP_OBJ_ATTR_SIZE_Z},
- {"dSizeX",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta X size of the object",
- (void *)EXPP_OBJ_ATTR_DSIZE_X},
- {"dSizeY",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Y size of the object",
- (void *)EXPP_OBJ_ATTR_DSIZE_Y},
- {"dSizeZ",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "The delta Z size of the object",
- (void *)EXPP_OBJ_ATTR_DSIZE_Z},
-
- {"loc",
- (getter)getFloat3Attr, (setter)setFloat3Attr,
- "The (X,Y,Z) location coordinates of the object",
- (void *)EXPP_OBJ_ATTR_LOC},
- {"dloc",
- (getter)getFloat3Attr, (setter)setFloat3Attr,
- "The delta (X,Y,Z) location coordinates of the object",
- (void *)EXPP_OBJ_ATTR_DLOC},
- {"rot",
- (getter)Object_getEuler, (setter)Object_setEuler,
- "The (X,Y,Z) rotation angles (in degrees) of the object",
- NULL},
- {"drot",
- (getter)getFloat3Attr, (setter)setFloat3Attr,
- "The delta (X,Y,Z) rotation angles (in radians) of the object",
- (void *)EXPP_OBJ_ATTR_DROT},
- {"size",
- (getter)getFloat3Attr, (setter)setFloat3Attr,
- "The (X,Y,Z) size of the object",
- (void *)EXPP_OBJ_ATTR_SIZE},
- {"dsize",
- (getter)getFloat3Attr, (setter)setFloat3Attr,
- "The delta (X,Y,Z) size of the object",
- (void *)EXPP_OBJ_ATTR_DSIZE},
- {"Layer",
- (getter)getIntAttr, (setter)Object_setLayersMask,
- "The object layers (bitfield)",
- (void *)EXPP_OBJ_ATTR_LAYERMASK},
- {"Layers",
- (getter)getIntAttr, (setter)Object_setLayersMask,
- "The object layers (bitfield)",
- (void *)EXPP_OBJ_ATTR_LAYERMASK},
- {"layers",
- (getter)Object_getLayers, (setter)Object_setLayers,
- "The object layers (list of ints)",
- NULL},
- {"ipo",
- (getter)Object_getIpo, (setter)Object_setIpo,
- "Object's Ipo data",
- NULL},
- {"colbits",
- (getter)getIntAttr, (setter)setIntAttrRange,
- "The Material usage bitfield",
- (void *)EXPP_OBJ_ATTR_COLBITS},
- {"drawMode",
- (getter)getIntAttr, (setter)Object_setDrawMode,
- "The object's drawing mode bitfield",
- (void *)EXPP_OBJ_ATTR_DRAWMODE},
- {"drawType",
- (getter)getIntAttr, (setter)Object_setDrawType,
- "The object's drawing type",
- (void *)EXPP_OBJ_ATTR_DRAWTYPE},
- {"emptyShape",
- (getter)getIntAttr, (setter)Object_setEmptyShape,
- "The empty's drawing shape",
- (void *)EXPP_OBJ_ATTR_EMPTY_DRAWTYPE},
- {"parentType",
- (getter)getIntAttr, (setter)NULL,
- "The object's parent type",
- (void *)EXPP_OBJ_ATTR_PARENT_TYPE},
- {"DupOn",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "DupOn setting (for DupliFrames)",
- (void *)EXPP_OBJ_ATTR_DUPON},
- {"DupOff",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "DupOff setting (for DupliFrames)",
- (void *)EXPP_OBJ_ATTR_DUPOFF},
- {"DupSta",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "Starting frame (for DupliFrames)",
- (void *)EXPP_OBJ_ATTR_DUPSTA},
- {"DupEnd",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "Ending frame (for DupliFrames)",
- (void *)EXPP_OBJ_ATTR_DUPEND},
- {"passIndex",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "Index for object masks in the compositor",
- (void *)EXPP_OBJ_ATTR_PASSINDEX},
- {"activeMaterial",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "Index for the active material (displayed in the material panel)",
- (void *)EXPP_OBJ_ATTR_ACT_MATERIAL},
- {"mat",
- (getter)Object_getMatrixWorld, (setter)NULL,
- "worldspace matrix: absolute, takes vertex parents, tracking and Ipos into account",
- NULL},
- {"matrix",
- (getter)Object_getMatrixWorld, (setter)NULL,
- "worldspace matrix: absolute, takes vertex parents, tracking and Ipos into account",
- NULL},
- {"matrixWorld",
- (getter)Object_getMatrixWorld, (setter)NULL,
- "worldspace matrix: absolute, takes vertex parents, tracking and Ipos into account",
- NULL},
- {"matrixLocal",
- (getter)Object_getMatrixLocal, (setter)Object_setMatrix,
- "localspace matrix: relative to the object's parent",
- NULL},
- {"matrixParentInverse",
- (getter)Object_getMatrixParentInverse, (setter)NULL,
- "parents inverse matrix: parents localspace inverted matrix",
- NULL},
- {"matrixOldWorld",
- (getter)Object_getMatrixOldWorld, (setter)NULL,
- "old-type worldspace matrix (prior to Blender 2.34)",
- NULL},
- {"data",
- (getter)get_obj_data, (setter)NULL,
- "The Datablock object linked to this object",
- NULL},
- {"sel",
- (getter)Object_getSelected, (setter)Object_setSelect,
- "The object's selection state",
- NULL},
- {"parent",
- (getter)Object_getParent, (setter)NULL,
- "The object's parent object (if parented)",
- NULL},
- {"parentbonename",
- (getter)Object_getParentBoneName, (setter)Object_setParentBoneName,
- "The object's parent object's sub name",
- NULL},
- {"parentVertexIndex",
- (getter)Object_getParentVertexIndex, (setter)Object_setParentVertexIndex,
- "Indicies used for vertex parents",
- NULL},
- {"track",
- (getter)Object_getTracked, (setter)Object_setTracked,
- "The object's tracked object",
- NULL},
- {"timeOffset",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "The time offset of the object's animation",
- (void *)EXPP_OBJ_ATTR_TIMEOFFSET},
- {"type",
- (getter)Object_getType, (setter)NULL,
- "The object's type",
- NULL},
- {"boundingBox",
- (getter)Object_getBoundBox_noargs, (setter)NULL,
- "The bounding box of this object",
- NULL},
- {"action",
- (getter)Object_getAction, (setter)Object_setAction,
- "The action associated with this object (if defined)",
- NULL},
- {"game_properties",
- (getter)Object_getAllProperties, (setter)NULL,
- "The object's properties",
- NULL},
-
- {"piFalloff",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "The particle interaction falloff power",
- (void *)EXPP_OBJ_ATTR_PI_FALLOFF},
- {"piMaxDist",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Max distance for the particle interaction field to work",
- (void *)EXPP_OBJ_ATTR_PI_MAXDIST},
- {"piPermeability",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Probability that a particle will pass through the mesh",
- (void *)EXPP_OBJ_ATTR_PI_PERM},
- {"piRandomDamp",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Random variation of particle interaction damping",
- (void *)EXPP_OBJ_ATTR_PI_RANDOMDAMP},
- {"piStrength",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Particle interaction force field strength",
- (void *)EXPP_OBJ_ATTR_PI_STRENGTH},
- {"piSurfaceDamp",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Amount of damping during particle collision",
- (void *)EXPP_OBJ_ATTR_PI_SURFACEDAMP},
- {"piSoftbodyDamp",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Damping factor for softbody deflection",
- (void *)EXPP_OBJ_ATTR_PI_SBDAMP},
- {"piSoftbodyIThick",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Inner face thickness for softbody deflection",
- (void *)EXPP_OBJ_ATTR_PI_SBIFACETHICK},
- {"piSoftbodyOThick",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Outer face thickness for softbody deflection",
- (void *)EXPP_OBJ_ATTR_PI_SBOFACETHICK},
-
- {"piDeflection",
- (getter)Object_getPIDeflection, (setter)Object_setPIDeflection,
- "Deflects particles based on collision",
- NULL},
- {"piType",
- (getter)Object_getPIType, (setter)Object_setPIType,
- "Type of particle interaction (force field, wind, etc)",
- NULL},
- {"piUseMaxDist",
- (getter)Object_getPIUseMaxDist, (setter)Object_setPIUseMaxDist,
- "Use a maximum distance for the field to work",
- NULL},
-
- {"sbMass",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody point mass (heavier is slower)",
- (void *)EXPP_OBJ_ATTR_SB_NODEMASS},
- {"sbGrav",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Apply gravitation to softbody point movement",
- (void *)EXPP_OBJ_ATTR_SB_GRAV},
- {"sbFriction",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "General media friction for softbody point movements",
- (void *)EXPP_OBJ_ATTR_SB_MEDIAFRICT},
- {"sbSpeed",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Tweak timing for physics to control softbody frequency and speed",
- (void *)EXPP_OBJ_ATTR_SB_MEDIAFRICT},
- {"sbErrorLimit",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody Runge-Kutta ODE solver error limit (low values give more precision)",
- (void *)EXPP_OBJ_ATTR_SB_RKLIMIT},
- {"sbGoalSpring",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody goal (vertex target position) spring stiffness",
- (void *)EXPP_OBJ_ATTR_SB_GOALSPRING},
- {"sbGoalFriction",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody goal (vertex target position) friction",
- (void *)EXPP_OBJ_ATTR_SB_GOALFRICT},
- {"sbMinGoal",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody goal minimum (vertex group weights scaled to match this range)",
- (void *)EXPP_OBJ_ATTR_SB_MINGOAL},
- {"sbMaxGoal",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody goal maximum (vertex group weights scaled to match this range)",
- (void *)EXPP_OBJ_ATTR_SB_MAXGOAL},
- {"sbDefaultGoal",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Default softbody goal value, when no vertex group used",
- (void *)EXPP_OBJ_ATTR_SB_DEFGOAL},
- {"sbInnerSpring",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody edge spring stiffness",
- (void *)EXPP_OBJ_ATTR_SB_INSPRING},
- {"sbInnerSpringFrict",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "Softbody edge spring friction",
- (void *)EXPP_OBJ_ATTR_SB_INFRICT},
- {"isSoftBody",
- (getter)Object_isSB, (setter)NULL,
- "True if object is a soft body",
- NULL},
- {"sbUseGoal",
- (getter)Object_getSBUseGoal, (setter)Object_setSBUseGoal,
- "Softbody forces for vertices to stick to animated position enabled",
- NULL},
- {"sbUseEdges",
- (getter)Object_getSBUseEdges, (setter)Object_setSBUseEdges,
- "Softbody use edges as springs enabled",
- NULL},
- {"sbStiffQuads",
- (getter)Object_getSBStiffQuads, (setter)Object_setSBStiffQuads,
- "Softbody adds diagonal springs on 4-gons enabled",
- NULL},
-
- {"axis",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Display of active object's center and axis enabled",
- (void *)OB_AXIS},
- {"texSpace",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Display of active object's texture space enabled",
- (void *)OB_TEXSPACE},
- {"nameMode",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Display of active object's name enabled",
- (void *)OB_DRAWNAME},
- {"wireMode",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Add the active object's wireframe over solid drawing enabled",
- (void *)OB_DRAWWIRE},
- {"xRay",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Draw the active object in front of others enabled",
- (void *)OB_DRAWXRAY},
- {"transp",
- (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
- "Transparent materials for the active object (mesh only) enabled",
- (void *)OB_DRAWTRANSP},
- {"color",
- (getter)Object_getColor, (setter)Object_setColor,
- "Object color used by the game engine and optionally for materials",
- NULL},
- {"enableNLAOverride",
- (getter)Object_getNLAflagBits, (setter)Object_setNLAflagBits,
- "Toggles Action-NLA based animation",
- (void *)OB_NLA_OVERRIDE},
-
- {"enableDupVerts",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Duplicate child objects on all vertices",
- (void *)OB_DUPLIVERTS},
- {"enableDupFaces",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Duplicate child objects on all faces",
- (void *)OB_DUPLIFACES},
- {"enableDupFacesScale",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Use face scale to scale all dupliFaces",
- (void *)OB_DUPLIFACES_SCALE},
- {"dupFacesScaleFac",
- (getter)getFloatAttr, (setter)setFloatAttr,
- "Use face scale to scale all dupliFaces",
- (void *)EXPP_OBJ_ATTR_DUPFACESCALEFAC},
- {"enableDupFrames",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Make copy of object for every frame",
- (void *)OB_DUPLIFRAMES},
- {"enableDupGroup",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Enable group instancing",
- (void *)OB_DUPLIGROUP},
- {"enableDupRot",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Rotate dupli according to vertex normal",
- (void *)OB_DUPLIROT},
- {"enableDupNoSpeed",
- (getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
- "Set dupliframes to still, regardless of frame",
- (void *)OB_DUPLINOSPEED},
- {"DupObjects",
- (getter)Object_getDupliObjects, (setter)NULL,
- "Get a list of tuple pairs (object, matrix), for getting dupli objects",
- NULL},
- {"DupGroup",
- (getter)Object_getDupliGroup, (setter)Object_setDupliGroup,
- "Get a list of tuples for object duplicated by dupliframe",
- NULL},
-
- {"effects",
- (getter)Object_getEffects, (setter)NULL,
- "The list of particle effects associated with the object, (depricated, will always return an empty list in version 2.46)",
- NULL},
- {"actionStrips",
- (getter)Object_getActionStrips, (setter)NULL,
- "The action strips associated with the object",
- NULL},
- {"constraints",
- (getter)Object_getConstraints, (setter)NULL,
- "The constraints associated with the object",
- NULL},
- {"modifiers",
- (getter)Object_getModifiers, (setter)Object_setModifiers,
- "The modifiers associated with the object",
- NULL},
- {"protectFlags",
- (getter)Object_getProtectFlags, (setter)Object_setProtectFlags,
- "The \"transform locking\" bitfield for the object",
- NULL},
- {"drawSize",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "The size to display the Empty",
- (void *)EXPP_OBJ_ATTR_DRAWSIZE},
-
- {"rbFlags",
- (getter)Object_getRBFlags, (setter)Object_setRBFlags,
- "Rigid body flags",
- NULL},
- {"rbMass",
- (getter)Object_getRBMass, (setter)Object_setRBMass,
- "Rigid body object mass",
- NULL},
- {"rbRadius",
- (getter)Object_getRBRadius, (setter)Object_setRBRadius,
- "Rigid body bounding sphere size",
- NULL},
- {"rbShapeBoundType",
- (getter)Object_getRBShapeBoundType, (setter)Object_setRBShapeBoundType,
- "Rigid body physics bounds object type",
- NULL},
- {"rbHalfExtents",
- (getter)Object_getRBHalfExtents, (setter)NULL,
- "Rigid body physics bounds object type",
- NULL},
- {"trackAxis",
- (getter)Object_trackAxis, (setter)NULL,
- "track axis 'x' | 'y' | 'z' | '-x' | '-y' | '-z' (string. readonly)",
- NULL},
- {"upAxis",
- (getter)Object_upAxis, (setter)NULL,
- "up axis 'x' | 'y' | 'z' (string. readonly)",
- NULL},
- {"restrictDisplay",
- (getter)Object_getRestricted, (setter)Object_setRestricted,
- "Toggle object restrictions",
- (void *)OB_RESTRICT_VIEW},
- {"restrictSelect",
- (getter)Object_getRestricted, (setter)Object_setRestricted,
- "Toggle object restrictions",
- (void *)OB_RESTRICT_SELECT},
- {"restrictRender",
- (getter)Object_getRestricted, (setter)Object_setRestricted,
- "Toggle object restrictions",
- (void *)OB_RESTRICT_RENDER},
-
- {"pinShape",
- (getter)Object_getShapeFlag, (setter)Object_setShapeFlag,
- "Set the state for pinning this object",
- (void *)OB_SHAPE_LOCK},
- {"activeShape",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "set the index for the active shape key",
- (void *)EXPP_OBJ_ATTR_ACT_SHAPE},
-
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Object_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Object_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Object", /* char *tp_name; */
- sizeof( BPy_Object ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Object_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Object_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Object_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Object_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Object_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-static PyObject *M_Object_DrawModesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "AXIS", PyInt_FromLong( OB_AXIS ) );
- PyConstant_Insert( d, "TEXSPACE", PyInt_FromLong( OB_TEXSPACE ) );
- PyConstant_Insert( d, "NAME", PyInt_FromLong( OB_DRAWNAME ) );
- PyConstant_Insert( d, "WIRE", PyInt_FromLong( OB_DRAWWIRE ) );
- PyConstant_Insert( d, "XRAY", PyInt_FromLong( OB_DRAWXRAY ) );
- PyConstant_Insert( d, "TRANSP", PyInt_FromLong( OB_DRAWTRANSP ) );
- }
- return M;
-}
-
-static PyObject *M_Object_DrawTypesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "BOUNDBOX", PyInt_FromLong( OB_BOUNDBOX ) );
- PyConstant_Insert( d, "WIRE", PyInt_FromLong( OB_WIRE ) );
- PyConstant_Insert( d, "SOLID", PyInt_FromLong( OB_SOLID ) );
- PyConstant_Insert( d, "SHADED", PyInt_FromLong( OB_SHADED ) );
- }
- return M;
-}
-
-static PyObject *M_Object_ParentTypesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "OBJECT", PyInt_FromLong( PAROBJECT ) );
- PyConstant_Insert( d, "CURVE", PyInt_FromLong( PARCURVE ) );
-
- /* 2.43 was released as LATTICE as PARKEY, my bad,
- lattice uses PARSKEL also - Campbell */
- PyConstant_Insert( d, "LATTICE", PyInt_FromLong( PARSKEL ) );
-
- PyConstant_Insert( d, "ARMATURE", PyInt_FromLong( PARSKEL ) );
- PyConstant_Insert( d, "VERT1", PyInt_FromLong( PARVERT1 ) );
- PyConstant_Insert( d, "VERT3", PyInt_FromLong( PARVERT3 ) );
- PyConstant_Insert( d, "BONE", PyInt_FromLong( PARBONE ) );
- }
- return M;
-}
-
-static PyObject *M_Object_PITypesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "NONE", PyInt_FromLong( 0 ) );
- PyConstant_Insert( d, "FORCE", PyInt_FromLong( PFIELD_FORCE ) );
- PyConstant_Insert( d, "VORTEX", PyInt_FromLong( PFIELD_VORTEX ) );
- PyConstant_Insert( d, "WIND", PyInt_FromLong( PFIELD_WIND ) );
- PyConstant_Insert( d, "GUIDE", PyInt_FromLong( PFIELD_GUIDE ) );
- }
- return M;
-}
-
-static PyObject *M_Object_ProtectDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "LOCX", PyInt_FromLong( OB_LOCK_LOCX ) );
- PyConstant_Insert( d, "LOCY", PyInt_FromLong( OB_LOCK_LOCY ) );
- PyConstant_Insert( d, "LOCZ", PyInt_FromLong( OB_LOCK_LOCZ ) );
- PyConstant_Insert( d, "LOC", PyInt_FromLong( OB_LOCK_LOC ) );
- PyConstant_Insert( d, "ROTX", PyInt_FromLong( OB_LOCK_ROTX ) );
- PyConstant_Insert( d, "ROTY", PyInt_FromLong( OB_LOCK_ROTY ) );
- PyConstant_Insert( d, "ROTZ", PyInt_FromLong( OB_LOCK_ROTZ ) );
- PyConstant_Insert( d, "ROT",
- PyInt_FromLong( OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ ) );
- PyConstant_Insert( d, "SCALEX", PyInt_FromLong( OB_LOCK_SCALEX ) );
- PyConstant_Insert( d, "SCALEY", PyInt_FromLong( OB_LOCK_SCALEY ) );
- PyConstant_Insert( d, "SCALEZ", PyInt_FromLong( OB_LOCK_SCALEZ ) );
- PyConstant_Insert( d, "SCALE",
- PyInt_FromLong( OB_LOCK_SCALEX|OB_LOCK_SCALEY|OB_LOCK_SCALEZ ) );
- }
- return M;
-}
-
-static PyObject *M_Object_RBFlagsDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "COLLISION", PyInt_FromLong( OB_COLLISION ) );
- PyConstant_Insert( d, "DYNAMIC", PyInt_FromLong( OB_DYNAMIC ) );
- PyConstant_Insert( d, "CHILD", PyInt_FromLong( OB_CHILD ) );
- PyConstant_Insert( d, "ACTOR", PyInt_FromLong( OB_ACTOR ) );
- PyConstant_Insert( d, "USEFH", PyInt_FromLong( OB_DO_FH ) );
- PyConstant_Insert( d, "ROTFH", PyInt_FromLong( OB_ROT_FH ) );
- PyConstant_Insert( d, "ANISOTROPIC",
- PyInt_FromLong( OB_ANISOTROPIC_FRICTION ) );
- PyConstant_Insert( d, "GHOST", PyInt_FromLong( OB_GHOST ) );
- PyConstant_Insert( d, "RIGIDBODY", PyInt_FromLong( OB_RIGID_BODY ) );
- PyConstant_Insert( d, "SOFTBODY", PyInt_FromLong( OB_SOFT_BODY ) );
- PyConstant_Insert( d, "BOUNDS", PyInt_FromLong( OB_BOUNDS ) );
- PyConstant_Insert( d, "COLLISION_RESPONSE",
- PyInt_FromLong( OB_COLLISION_RESPONSE ) );
- PyConstant_Insert( d, "SECTOR", PyInt_FromLong( OB_SECTOR ) );
- PyConstant_Insert( d, "PROP", PyInt_FromLong( OB_PROP ) );
- PyConstant_Insert( d, "MAINACTOR", PyInt_FromLong( OB_MAINACTOR ) );
- }
- return M;
-}
-
-static PyObject *M_Object_RBShapeBoundDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "BOX", PyInt_FromLong( OB_BOUND_BOX ) );
- PyConstant_Insert( d, "SPHERE", PyInt_FromLong( OB_BOUND_SPHERE ) );
- PyConstant_Insert( d, "CYLINDER", PyInt_FromLong( OB_BOUND_CYLINDER ) );
- PyConstant_Insert( d, "CONE", PyInt_FromLong( OB_BOUND_CONE ) );
- PyConstant_Insert( d, "POLYHEDERON", PyInt_FromLong( OB_BOUND_POLYH ) );
- }
- return M;
-}
-
-static PyObject *M_Object_IpoKeyTypesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "LOC", PyInt_FromLong( IPOKEY_LOC ) );
- PyConstant_Insert( d, "ROT", PyInt_FromLong( IPOKEY_ROT ) );
- PyConstant_Insert( d, "SIZE", PyInt_FromLong( IPOKEY_SIZE ) );
- PyConstant_Insert( d, "LOCROT", PyInt_FromLong( IPOKEY_LOCROT ) );
- PyConstant_Insert( d, "LOCROTSIZE", PyInt_FromLong( IPOKEY_LOCROTSIZE ) );
- PyConstant_Insert( d, "LAYER", PyInt_FromLong( IPOKEY_LAYER ) );
-
- PyConstant_Insert( d, "PI_STRENGTH", PyInt_FromLong( IPOKEY_PI_STRENGTH ) );
- PyConstant_Insert( d, "PI_FALLOFF", PyInt_FromLong( IPOKEY_PI_FALLOFF ) );
- PyConstant_Insert( d, "PI_SURFACEDAMP", PyInt_FromLong( IPOKEY_PI_SURFACEDAMP ) );
- PyConstant_Insert( d, "PI_RANDOMDAMP", PyInt_FromLong( IPOKEY_PI_RANDOMDAMP ) );
- PyConstant_Insert( d, "PI_PERM", PyInt_FromLong( IPOKEY_PI_PERM ) );
- }
- return M;
-}
-
-static PyObject *M_Object_EmptyShapesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "ARROWS", PyInt_FromLong( OB_ARROWS ) );
- PyConstant_Insert( d, "AXES", PyInt_FromLong( OB_PLAINAXES ) );
- PyConstant_Insert( d, "CIRCLE", PyInt_FromLong( OB_CIRCLE ) );
- PyConstant_Insert( d, "ARROW", PyInt_FromLong( OB_SINGLE_ARROW ) );
- PyConstant_Insert( d, "CUBE", PyInt_FromLong( OB_CUBE ) );
- PyConstant_Insert( d, "SPHERE", PyInt_FromLong( OB_EMPTY_SPHERE ) );
- PyConstant_Insert( d, "CONE", PyInt_FromLong( OB_EMPTY_CONE ) );
- }
- return M;
-}
-
-
-/*****************************************************************************/
-/* Function: initObject */
-/*****************************************************************************/
-PyObject *Object_Init( void )
-{
- PyObject *module, *dict;
- PyObject *DrawModesDict = M_Object_DrawModesDict( );
- PyObject *DrawTypesDict = M_Object_DrawTypesDict( );
- PyObject *ParentTypesDict = M_Object_ParentTypesDict( );
- PyObject *ProtectDict = M_Object_ProtectDict( );
- PyObject *PITypesDict = M_Object_PITypesDict( );
- PyObject *RBFlagsDict = M_Object_RBFlagsDict( );
- PyObject *RBShapesDict = M_Object_RBShapeBoundDict( );
- PyObject *IpoKeyTypesDict = M_Object_IpoKeyTypesDict( );
- PyObject *EmptyShapesDict = M_Object_EmptyShapesDict( );
-
- PyType_Ready( &Object_Type ) ;
-
- module = Py_InitModule3( "Blender.Object", M_Object_methods,
- M_Object_doc );
-
-
- /* We Should Remove these!!!! */
- PyModule_AddIntConstant( module, "LOC", IPOKEY_LOC );
- PyModule_AddIntConstant( module, "ROT", IPOKEY_ROT );
- PyModule_AddIntConstant( module, "SIZE", IPOKEY_SIZE );
- PyModule_AddIntConstant( module, "LOCROT", IPOKEY_LOCROT );
- PyModule_AddIntConstant( module, "LOCROTSIZE", IPOKEY_LOCROTSIZE );
- PyModule_AddIntConstant( module, "LAYER", IPOKEY_LAYER );
-
- PyModule_AddIntConstant( module, "PI_STRENGTH", IPOKEY_PI_STRENGTH );
- PyModule_AddIntConstant( module, "PI_FALLOFF", IPOKEY_PI_FALLOFF );
- PyModule_AddIntConstant( module, "PI_SURFACEDAMP", IPOKEY_PI_SURFACEDAMP );
- PyModule_AddIntConstant( module, "PI_RANDOMDAMP", IPOKEY_PI_RANDOMDAMP );
- PyModule_AddIntConstant( module, "PI_PERM", IPOKEY_PI_PERM );
-
- PyModule_AddIntConstant( module, "NONE",0 );
- PyModule_AddIntConstant( module, "FORCE",PFIELD_FORCE );
- PyModule_AddIntConstant( module, "VORTEX",PFIELD_VORTEX );
- PyModule_AddIntConstant( module, "MAGNET",PFIELD_MAGNET );
- PyModule_AddIntConstant( module, "WIND",PFIELD_WIND );
- /* Only keeping above so as not to break compat */
-
-
- if( DrawModesDict )
- PyModule_AddObject( module, "DrawModes", DrawModesDict );
- if( DrawTypesDict )
- PyModule_AddObject( module, "DrawTypes", DrawTypesDict );
- if( ParentTypesDict )
- PyModule_AddObject( module, "ParentTypes", ParentTypesDict );
- if( PITypesDict )
- PyModule_AddObject( module, "PITypes", PITypesDict );
- if( ProtectDict )
- PyModule_AddObject( module, "ProtectFlags", ProtectDict );
- if( RBFlagsDict )
- PyModule_AddObject( module, "RBFlags", RBFlagsDict );
- if( RBShapesDict )
- PyModule_AddObject( module, "RBShapes", RBShapesDict );
- if( IpoKeyTypesDict )
- PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict );
- if( EmptyShapesDict )
- PyModule_AddObject( module, "EmptyShapes", EmptyShapesDict );
-
- /*Add SUBMODULES to the module*/
- dict = PyModule_GetDict( module ); /*borrowed*/
- PyDict_SetItemString(dict, "Pose", Pose_Init()); /*creates a *new* module*/
- /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); */ /*creates a *new* module*/
-
- return ( module );
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *Object_SetIpo( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Object_setIpo );
-}
-
-static PyObject *Object_Select( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Object_setSelect );
-}
-
-static PyObject *Object_SetDrawMode( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setDrawMode );
-}
-
-static PyObject *Object_SetDrawType( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setDrawType );
-}
-
-static PyObject *Object_SetMatrix( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setMatrix );
-}
-
-static PyObject *Object_SetEuler( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)Object_setEuler );
-}
-
-static PyObject *Object_setTimeOffset( BPy_Object * self, PyObject * args )
-{
- float newTimeOffset;
-
- if( !PyArg_ParseTuple( args, "f", &newTimeOffset ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a float as argument" );
-
- self->object->sf = newTimeOffset;
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-
-/*************************************************************************/
-/* particle defection methods */
-/*************************************************************************/
-
-static PyObject *Object_SetPIDeflection( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setPIDeflection );
-}
-
-static PyObject *Object_SetPIType( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setPIType );
-}
-
-static PyObject *Object_SetPIUseMaxDist( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setPIUseMaxDist );
-}
-
-static PyObject *Object_getPISurfaceDamp( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->pd->pdef_damp );
-}
-
-static PyObject *Object_SetPISurfaceDamp( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return NULL;
-
- self->object->pd->pdef_damp = EXPP_ClampFloat( value,
- EXPP_OBJECT_PIDAMP_MIN, EXPP_OBJECT_PIDAMP_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getPIPerm( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
- return PyFloat_FromDouble ( (double) self->object->pd->pdef_perm );
-}
-
-static PyObject *Object_SetPIPerm( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return NULL;
-
- self->object->pd->pdef_perm = EXPP_ClampFloat( value,
- EXPP_OBJECT_PIPERM_MIN, EXPP_OBJECT_PIPERM_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getPIStrength( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->pd->f_strength );
-}
-
-static PyObject *Object_setPIStrength( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->pd->f_strength = EXPP_ClampFloat( value,
- EXPP_OBJECT_PISTRENGTH_MIN, EXPP_OBJECT_PISTRENGTH_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getPIFalloff( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->pd->f_power );
-}
-
-static PyObject *Object_setPIFalloff( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->pd->f_power = EXPP_ClampFloat( value,
- EXPP_OBJECT_PIPOWER_MIN, EXPP_OBJECT_PIPOWER_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getPIMaxDist( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->pd->maxdist );
-}
-
-static PyObject *Object_setPIMaxDist( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->pd->maxdist = EXPP_ClampFloat( value,
- EXPP_OBJECT_PIMAXDIST_MIN, EXPP_OBJECT_PIMAXDIST_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getPIRandomDamp( BPy_Object * self )
-{
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->pd->pdef_rdamp );
-}
-
-static PyObject *Object_setPIRandomDamp( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->pd && !setupPI(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "particle deflection could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return NULL;
-
- self->object->pd->pdef_rdamp = EXPP_ClampFloat( value,
- EXPP_OBJECT_PIRDAMP_MIN, EXPP_OBJECT_PIRDAMP_MAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-/*************************************************************************/
-/* softbody methods */
-/*************************************************************************/
-
-static PyObject *Object_getSBMass( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->nodemass );
-}
-
-static PyObject *Object_setSBMass( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->nodemass = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBNODEMASSMIN, EXPP_OBJECT_SBNODEMASSMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBGravity( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->grav );
-}
-
-static PyObject *Object_setSBGravity( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->grav = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBGRAVMIN, EXPP_OBJECT_SBGRAVMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBFriction( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->mediafrict );
-}
-
-static PyObject *Object_setSBFriction( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->mediafrict = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBMEDIAFRICTMIN, EXPP_OBJECT_SBMEDIAFRICTMAX );
- self->object->recalc |= OB_RECALC_OB;
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBErrorLimit( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->rklimit );
-}
-
-static PyObject *Object_setSBErrorLimit( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->rklimit = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBRKLIMITMIN, EXPP_OBJECT_SBRKLIMITMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBGoalSpring( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->goalspring );
-}
-
-static PyObject *Object_setSBGoalSpring( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->goalspring = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBGOALSPRINGMIN, EXPP_OBJECT_SBGOALSPRINGMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBGoalFriction( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->goalfrict );
-}
-
-static PyObject *Object_setSBGoalFriction( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->goalfrict = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBGOALFRICTMIN, EXPP_OBJECT_SBGOALFRICTMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBMinGoal( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->mingoal );
-}
-
-static PyObject *Object_setSBMinGoal( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->mingoal = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBMINGOALMIN, EXPP_OBJECT_SBMINGOALMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBMaxGoal( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->maxgoal );
-}
-
-static PyObject *Object_setSBMaxGoal( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->maxgoal = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBMAXGOALMIN, EXPP_OBJECT_SBMAXGOALMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBDefaultGoal( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->defgoal );
-}
-
-static PyObject *Object_setSBDefaultGoal( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->defgoal = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBDEFGOALMIN, EXPP_OBJECT_SBDEFGOALMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBInnerSpring( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->inspring );
-}
-
-static PyObject *Object_setSBInnerSpring( BPy_Object * self, PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->inspring = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBINSPRINGMIN, EXPP_OBJECT_SBINSPRINGMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_getSBInnerSpringFriction( BPy_Object * self )
-{
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- return PyFloat_FromDouble( ( double ) self->object->soft->infrict );
-}
-
-static PyObject *Object_setSBInnerSpringFriction( BPy_Object * self,
- PyObject * args )
-{
- float value;
-
- if( !self->object->soft && !setupSB(self->object) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "softbody could not be accessed" );
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- self->object->soft->infrict = EXPP_ClampFloat( value,
- EXPP_OBJECT_SBINFRICTMIN, EXPP_OBJECT_SBINFRICTMAX );
- self->object->recalc |= OB_RECALC_OB;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Object_SetSBUseGoal( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setSBUseGoal );
-}
-
-static PyObject *Object_SetSBUseEdges( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setSBUseEdges );
-}
-
-static PyObject *Object_SetSBStiffQuads( BPy_Object * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Object_setSBStiffQuads );
-}
-
-static PyObject *Object_trackAxis( BPy_Object * self )
-{
- Object* ob;
- char ctr[3];
-
- memset( ctr, 0, sizeof(ctr));
- ob = self->object;
-
- switch(ob->trackflag){
- case(0):
- ctr[0] = 'X';
- break;
- case(1):
- ctr[0] = 'Y';
- break;
- case(2):
- ctr[0] = 'Z';
- break;
- case(3):
- ctr[0] = '-';
- ctr[1] = 'X';
- break;
- case(4):
- ctr[0] = '-';
- ctr[1] = 'Y';
- break;
- case(5):
- ctr[0] = '-';
- ctr[1] = 'Z';
- break;
- default:
- break;
- }
-
- return PyString_FromString(ctr);
-}
-
-static PyObject *Object_upAxis( BPy_Object * self )
-{
- Object* ob;
- char cup[2];
-
- memset( cup, 0, sizeof(cup));
- ob = self->object;
-
- switch(ob->upflag){
- case(0):
- cup[0] = 'X';
- break;
- case(1):
- cup[0] = 'Y';
- break;
- case(2):
- cup[0] = 'Z';
- break;
- default:
- break;
- }
-
- return PyString_FromString(cup);
-}
diff --git a/source/blender/python/api2_2x/Object.h b/source/blender/python/api2_2x/Object.h
deleted file mode 100644
index a4bb42b1b5c..00000000000
--- a/source/blender/python/api2_2x/Object.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_OBJECT_H
-#define EXPP_OBJECT_H
-
-#include <Python.h>
-#include "DNA_object_types.h"
-
-/* The Object PyType Object defined in Object.c */
-extern PyTypeObject Object_Type;
-
-#define BPy_Object_Check(v) \
- ((v)->ob_type == &Object_Type) /* for type checking */
-
-/*****************************************************************************/
-/* Python BPy_Object structure definition. */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- struct Object *object; /* libdata must be second */
- short realtype;
-} BPy_Object;
-
-PyObject *Object_Init( void );
-PyObject *Object_CreatePyObject( struct Object *obj );
-Object *Object_FromPyObject( PyObject * py_obj );
-
-void Object_updateDag( void *data );
-
-int EXPP_add_obdata( struct Object *object );
-
-#endif /* EXPP_OBJECT_H */
diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c
deleted file mode 100644
index bbdc3942fc7..00000000000
--- a/source/blender/python/api2_2x/Particle.c
+++ /dev/null
@@ -1,2012 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s):
- * Original version: Jacques Guignot, Jean-Michel Soler
- * Rewrite : Cedric Paille, Stephen Swaney, Joilnen Leite
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Particle.h"
-#include "gen_utils.h"
-#include "BKE_object.h"
-#include "BKE_main.h"
-#include "BKE_particle.h"
-#include "BKE_global.h"
-#include "BKE_depsgraph.h"
-#include "BKE_modifier.h"
-#include "BKE_material.h"
-#include "BKE_utildefines.h"
-#include "BKE_pointcache.h"
-#include "BKE_DerivedMesh.h"
-#include "BIF_editparticle.h"
-#include "BIF_space.h"
-#include "blendef.h"
-#include "DNA_modifier_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_material_types.h"
-#include "BLI_blenlib.h"
-#include "mydevice.h"
-#include "Object.h"
-#include "Material.h"
-
-#include "MEM_guardedalloc.h"
-
-
-
-/* Type Methods */
-static PyObject *M_ParticleSys_New( PyObject * self, PyObject * args );
-static PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args );
-
-/* Particle Methods */
-static PyObject *Part_freeEdit( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args );
-static int Part_setSeed( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getSeed( BPy_PartSys * self );
-static int Part_setType( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getType( BPy_PartSys * self );
-static int Part_setResol( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getResol( BPy_PartSys * self );
-static int Part_setStart( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getStart( BPy_PartSys * self );
-static int Part_setEnd( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getEnd( BPy_PartSys * self );
-static int Part_setEditable( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getEditable( BPy_PartSys * self );
-static int Part_setAmount( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getAmount( BPy_PartSys * self );
-static int Part_setMultiReact( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getMultiReact( BPy_PartSys * self );
-static int Part_setReactShape( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getReactShape( BPy_PartSys * self );
-static int Part_setSegments( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getSegments( BPy_PartSys * self );
-static int Part_setLife( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getLife( BPy_PartSys * self );
-static int Part_setRandLife( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getRandLife( BPy_PartSys * self );
-static int Part_set2d( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_get2d( BPy_PartSys * self );
-static int Part_setMaxVel( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getMaxVel( BPy_PartSys * self );
-static int Part_setAvVel( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getAvVel( BPy_PartSys * self );
-static int Part_setLatAcc( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getLatAcc( BPy_PartSys * self );
-static int Part_setMaxTan( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getMaxTan( BPy_PartSys * self );
-static int Part_setGroundZ( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getGroundZ( BPy_PartSys * self );
-static int Part_setOb( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getOb( BPy_PartSys * self );
-static PyObject *Part_getRandEmission( BPy_PartSys * self );
-static int Part_setRandEmission( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getRandEmission( BPy_PartSys * self );
-static int Part_setParticleDist( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getParticleDist( BPy_PartSys * self );
-static int Part_setEvenDist( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getEvenDist( BPy_PartSys * self );
-static int Part_setDist( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getDist( BPy_PartSys * self );
-static int Part_setParticleDisp( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getParticleDisp( BPy_PartSys * self );
-static int Part_setJitterAmount( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getJitterAmount( BPy_PartSys * self );
-static int Part_setPF( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getPF( BPy_PartSys * self );
-static int Part_setInvert( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getInvert( BPy_PartSys * self );
-static int Part_setTargetOb( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getTargetOb( BPy_PartSys * self );
-static int Part_setTargetPsys( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getTargetPsys( BPy_PartSys * self );
-static int Part_setRenderObject( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getRenderObject( BPy_PartSys * self );
-static int Part_setStep( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getStep( BPy_PartSys * self );
-static int Part_setRenderStep( BPy_PartSys * self, PyObject * args );
-static PyObject *Part_getRenderStep( BPy_PartSys * self );
-static PyObject *Part_getDupOb( BPy_PartSys * self );
-static PyObject *Part_getDrawAs( BPy_PartSys * self );
-static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args );
-
-/*****************************************************************************/
-/* Python Effect_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *ParticleSys_repr( BPy_PartSys * self );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Particle.__doc__ */
-/*****************************************************************************/
-static char M_ParticleSys_doc[] = "The Blender Effect module\n\n\
-This module provides access to **Object Data** in Blender.\n\
-Functions :\n\
- Get(name) : retreives particle system (as list) with the given name\n";
-static char M_ParticleSys_Get_doc[] = "xxx";
-static char M_ParticleSys_New_doc[] = "xxx";
-
-/*****************************************************************************/
-/* Python BPy_ParticleSys methods table: */
-/*****************************************************************************/
-
-static PyMethodDef BPy_ParticleSys_methods[] = {
- {"freeEdit", ( PyCFunction ) Part_freeEdit,
- METH_NOARGS, "() - Free from edit mode"},
- {"getLoc", ( PyCFunction ) Part_GetLoc,
- METH_VARARGS, "() - Get particles location"},
- {"getRot", ( PyCFunction ) Part_GetRot,
- METH_VARARGS, "() - Get particles rotations (list of 4 floats quaternion)"},
- {"getMat", ( PyCFunction ) Part_GetMat,
- METH_NOARGS, "() - Get particles material"},
- {"getSize", ( PyCFunction ) Part_GetSize,
- METH_VARARGS, "() - Get particles size in a list"},
- {"getAge", ( PyCFunction ) Part_GetAge,
- METH_VARARGS, "() - Get particles life in a list"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_ParticleSys attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_ParticleSys_getseters[] = {
-/* Extras */
- {"seed",
- (getter)Part_getSeed, (setter)Part_setSeed,
- "Set an offset in the random table",
- NULL},
- /* basics */
- {"type",
- (getter)Part_getType, (setter)Part_setType,
- "Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] )",
- NULL},
- {"resolutionGrid",
- (getter)Part_getResol, (setter)Part_setResol,
- "The resolution of the particle grid",
- NULL},
- {"startFrame",
- (getter)Part_getStart, (setter)Part_setStart,
- "Frame # to start emitting particles",
- NULL},
- {"endFrame",
- (getter)Part_getEnd, (setter)Part_setEnd,
- "Frame # to stop emitting particles",
- NULL},
- {"editable",
- (getter)Part_getEditable, (setter)Part_setEditable,
- "Finalize hair to enable editing in particle mode",
- NULL},
- {"amount",
- (getter)Part_getAmount, (setter)Part_setAmount,
- "The total number of particles",
- NULL},
- {"multireact",
- (getter)Part_getMultiReact, (setter)Part_setMultiReact,
- "React multiple times ( Paricle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] )",
- NULL},
- {"reactshape",
- (getter)Part_getReactShape, (setter)Part_setReactShape,
- "Power of reaction strength dependence on distance to target",
- NULL},
- {"hairSegments",
- (getter)Part_getSegments, (setter)Part_setSegments,
- "Amount of hair segments",
- NULL},
- {"lifetime",
- (getter)Part_getLife, (setter)Part_setLife,
- "Specify the life span of the particles",
- NULL},
- {"randlife",
- (getter)Part_getRandLife, (setter)Part_setRandLife,
- "Give the particle life a random variation",
- NULL},
- {"randemission",
- (getter)Part_getRandEmission, (setter)Part_setRandEmission,
- "Give the particle life a random variation",
- NULL},
- {"particleDistribution",
- (getter)Part_getParticleDist, (setter)Part_setParticleDist,
- "Where to emit particles from Paricle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] )",
- NULL},
- {"evenDistribution",
- (getter)Part_getEvenDist, (setter)Part_setEvenDist,
- "Use even distribution from faces based on face areas or edge lengths",
- NULL},
- {"distribution",
- (getter)Part_getDist, (setter)Part_setDist,
- "How to distribute particles on selected element Paricle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] )",
- NULL},
- {"jitterAmount",
- (getter)Part_getJitterAmount, (setter)Part_setJitterAmount,
- "Amount of jitter applied to the sampling",
- NULL},
- {"pf",
- (getter)Part_getPF, (setter)Part_setPF,
- "Emission locations / face (0 = automatic)",
- NULL},
- {"invert",
- (getter)Part_getInvert, (setter)Part_setInvert,
- "Invert what is considered object and what is not.",
- NULL},
- {"targetObject",
- (getter)Part_getTargetOb, (setter)Part_setTargetOb,
- "The object that has the target particle system (empty if same object)",
- NULL},
- {"targetpsys",
- (getter)Part_getTargetPsys, (setter)Part_setTargetPsys,
- "The target particle system number in the object",
- NULL},
-/* Physics */
- {"2d",
- (getter)Part_get2d, (setter)Part_set2d,
- "Constrain boids to a surface",
- NULL},
- {"maxvel",
- (getter)Part_getMaxVel, (setter)Part_setMaxVel,
- "Maximum velocity",
- NULL},
- {"avvel",
- (getter)Part_getAvVel, (setter)Part_setAvVel,
- "The usual speed % of max velocity",
- NULL},
- {"latacc",
- (getter)Part_getLatAcc, (setter)Part_setLatAcc,
- "Lateral acceleration % of max velocity",
- NULL},
- {"tanacc",
- (getter)Part_getMaxTan, (setter)Part_setMaxTan,
- "Tangential acceleration % of max velocity",
- NULL},
- {"groundz",
- (getter)Part_getGroundZ, (setter)Part_setGroundZ,
- "Default Z value",
- NULL},
- {"object",
- (getter)Part_getOb, (setter)Part_setOb,
- "Constrain boids to object's surface",
- NULL},
-/* Visualisation */
- {"renderEmitter",
- (getter)Part_getRenderObject, (setter)Part_setRenderObject,
- "Render emitter object",
- NULL},
- {"displayPercentage",
- (getter)Part_getParticleDisp, (setter)Part_setParticleDisp,
- "Particle display percentage",
- NULL},
- {"hairDisplayStep",
- (getter)Part_getStep, (setter)Part_setStep,
- "How many steps paths are drawn with (power of 2)",
- NULL},
- {"hairRenderStep",
- (getter)Part_getRenderStep, (setter)Part_setRenderStep,
- "How many steps paths are rendered with (power of 2)",
- NULL},
- {"duplicateObject",
- (getter)Part_getDupOb, NULL,
- "Get the duplicate ob",
- NULL},
- {"drawAs",
- (getter)Part_getDrawAs, NULL,
- "Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ] )",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Particle module: */
-/*****************************************************************************/
-static struct PyMethodDef M_ParticleSys_methods[] = {
- {"New", ( PyCFunction ) M_ParticleSys_New, METH_VARARGS, M_ParticleSys_New_doc},
- {"Get", M_ParticleSys_Get, METH_VARARGS, M_ParticleSys_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python ParticleSys_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject ParticleSys_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender ParticleSys", /* char *tp_name; */
- sizeof( BPy_PartSys ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) ParticleSys_repr,/* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_ParticleSys_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_ParticleSys_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: PARTICLESYS_repr */
-/* Description: This is a callback function for the BPy_PartSys type. It */
-/* builds a meaningful string to represent effect objects. */
-/*****************************************************************************/
-
-static PyObject *ParticleSys_repr( BPy_PartSys * self )
-{
- return PyString_FromFormat( "ParticleSys \"%s\"",
- self->psys->part->id.name+2 );
-}
-
-/*****************************************************************************/
-/* Function : P_sys_FromPyObject */
-/*****************************************************************************/
-
-struct ParticleSystem *P_sys_FromPyObject( BPy_PartSys * py_obj )
-{
- BPy_PartSys *blen_obj;
-
- blen_obj = ( BPy_PartSys * ) py_obj;
- return ( blen_obj->psys );
-}
-
-/*****************************************************************************/
-/* Function : ParticleSysCreatePyObject */
-/*****************************************************************************/
-PyObject *ParticleSys_CreatePyObject( ParticleSystem * psystem, Object *ob )
-{
- BPy_PartSys *blen_object;
-
- blen_object =
- ( BPy_PartSys * ) PyObject_NEW( BPy_PartSys, &ParticleSys_Type );
-
- if( blen_object )
- blen_object->psys = (ParticleSystem *)psystem;
-
- blen_object->object = ob;
-
- return ( PyObject * ) blen_object;
-}
-
-
-PyObject *M_ParticleSys_New( PyObject * self, PyObject * args ){
- ParticleSystem *psys = 0;
- ParticleSystem *rpsys = 0;
- ModifierData *md;
- ParticleSystemModifierData *psmd;
- Object *ob = NULL;
- char *name = NULL;
- ID *id;
- int nr;
-
- if( !PyArg_ParseTuple( args, "s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- for( ob = G.main->object.first; ob; ob = ob->id.next )
- if( !strcmp( name, ob->id.name + 2 ) )
- break;
-
- if( !ob )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object does not exist" );
-
- id = (ID *)psys_new_settings("PSys", G.main);
-
- psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add();
- psys->flag |= PSYS_ENABLED;
- BLI_addtail(&ob->particlesystem,psys);
-
- md = modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
- psmd = (ParticleSystemModifierData*) md;
- psmd->psys=psys;
- BLI_addtail(&ob->modifiers, md);
-
- psys->part=(ParticleSettings*)id;
- psys->totpart=0;
- psys->flag=PSYS_ENABLED|PSYS_CURRENT;
- psys->cfra=bsystem_time(ob,(float)G.scene->r.cfra+1,0.0);
- rpsys = psys;
-
- /* check need for dupliobjects */
-
- nr=0;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- ob->transflag |= OB_DUPLIPARTS;
- else
- ob->transflag &= ~OB_DUPLIPARTS;
-
- BIF_undo_push("Browse Particle System");
-
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- return ParticleSys_CreatePyObject(rpsys,ob);
-}
-
-
-/*
-
-Get( name ) returns named particle sys or list of all
-throws NameError if name not found
-
-*/
-
-PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args )
-{
-#if 1
- return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
- "Particle.Get() not implemented" );
-#else
- ParticleSettings *psys_iter;
- char *name = NULL;
-
- ParticleSystem *blparticlesys = 0;
- Object *ob;
-
- PyObject *partsyslist,*current;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- psys_iter = G.main->particle.first; /* initialize our iterator */
-
- if( name ) { /* find psys by name */
-
- PyObject *wanted_obj = NULL;
-
- while( psys_iter && ! wanted_obj ){
- if( !strcmp( name, psys_iter->id.name + 2)){
- printf("** found %s\n", psys_iter->id.name+2);
- //wanted_obj = ParticleSys_CreatePyObject( psys_iter );
- break;
- }
- psys_iter = psys_iter->id.next;
- }
-
- if( !wanted_obj){ /* requested object not found */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Particle System '%s' not found", name);
- return EXPP_ReturnPyObjError( PyExc_NameError, error_msg );
- }
-
- return wanted_obj;
-
- }else { /* no arg - return a list of bpy objs all P. systems */
-
- PyObject *pylist;
- int index = 0;
-
- pylist = PyList_New( BLI_countlist( &G.main->particle ));
- printf("** list is %d long\n", PyList_Size( pylist));
- if( ! pylist ){
- return EXPP_ReturnPyObjError(
- PyExc_MemoryError,
- "could not create ParticleSystem list");
- }
-
- while( psys_iter ){
- pyobj = ParticleSystem_CreatePyObject( psys_iter);
- if( !pyobj){
- Py_DECREF( pylist );
- return EXPP_ReturnPyObjError(
- PyExc_MemoryError,
- "could not create ParticleSystem PyObject");
- }
- PyList_SET_ITEM( pylist, index, pyobj);
- printf("name is %s\n", psys_iter->id.name+2);
- psys_iter = psys_iter->id.next;
- index++;
- }
-
- return pylist;
-
- }
-
- for( ob = G.main->particlesystem.first; ob; ob = ob->id.next )
- if( !strcmp( name, ob->id.name + 2 ) )
- break;
-
- if( !ob )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "object does not exist" );
-
- blparticlesys = ob->particlesystem.first;
-
-
- partsyslist = PyList_New( 0 );
-
- if (!blparticlesys)
- return partsyslist;
-
- current = ParticleSys_CreatePyObject( blparticlesys, ob );
- PyList_Append(partsyslist,current);
-
-
- while((blparticlesys = blparticlesys->next)){
- current = ParticleSys_CreatePyObject( blparticlesys, ob );
- PyList_Append(partsyslist,current);
- }
-
- return partsyslist;
-#endif
-}
-
-
-/*****************************************************************************/
-/* Function: ParticleSys_Init */
-/*****************************************************************************/
-
-/* create the Blender.Particle.Type constant dict */
-
-static PyObject *Particle_TypeDict( void )
-{
- PyObject *Types = PyConstant_New( );
-
- if( Types ) {
- BPy_constant *c = ( BPy_constant * ) Types;
-
- PyConstant_Insert( c, "HAIR",
- PyInt_FromLong( 2 ) );
- PyConstant_Insert( c, "REACTOR",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( c, "EMITTER",
- PyInt_FromLong( 0 ) );
- }
- return Types;
-}
-
-/* create the Blender.Particle.Distribution constant dict */
-
-static PyObject *Particle_DistrDict( void )
-{
- PyObject *Distr = PyConstant_New( );
-
- if( Distr ) {
- BPy_constant *c = ( BPy_constant * ) Distr;
-
- PyConstant_Insert( c, "GRID",
- PyInt_FromLong( 2 ) );
- PyConstant_Insert( c, "RANDOM",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( c, "JITTERED",
- PyInt_FromLong( 0 ) );
- }
- return Distr;
-}
-
-/* create the Blender.Particle.EmitFrom constant dict */
-
-static PyObject *Particle_EmitFrom( void )
-{
- PyObject *EmitFrom = PyConstant_New( );
-
- if( EmitFrom ) {
- BPy_constant *c = ( BPy_constant * ) EmitFrom;
-
- PyConstant_Insert( c, "VERTS",
- PyInt_FromLong( 0 ) );
- PyConstant_Insert( c, "FACES",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( c, "VOLUME",
- PyInt_FromLong( 2 ) );
- PyConstant_Insert( c, "PARTICLE",
- PyInt_FromLong( 3 ) );
- }
- return EmitFrom;
-}
-
-/* create the Blender.Particle.Collision constant dict */
-
-static PyObject *Particle_ReactOnDict( void )
-{
- PyObject *ReactOn = PyConstant_New( );
-
- if( ReactOn ) {
- BPy_constant *c = ( BPy_constant * ) ReactOn;
-
- PyConstant_Insert( c, "NEAR",
- PyInt_FromLong( 2 ) );
- PyConstant_Insert( c, "COLLISION",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( c, "DEATH",
- PyInt_FromLong( 0 ) );
- }
- return ReactOn;
-}
-
-static PyObject *Particle_DrawAs( void )
-{
- PyObject *DrawAs = PyConstant_New( );
-
- if( DrawAs ) {
- BPy_constant *c = ( BPy_constant * ) DrawAs;
-
- PyConstant_Insert( c, "NONE",
- PyInt_FromLong( 0 ) );
- PyConstant_Insert( c, "POINT",
- PyInt_FromLong( 1 ) );
- PyConstant_Insert( c, "CIRCLE",
- PyInt_FromLong( 2 ) );
- PyConstant_Insert( c, "CROSS",
- PyInt_FromLong( 3 ) );
- PyConstant_Insert( c, "AXIS",
- PyInt_FromLong( 4 ) );
- PyConstant_Insert( c, "LINE",
- PyInt_FromLong( 5 ) );
- PyConstant_Insert( c, "PATH",
- PyInt_FromLong( 6 ) );
- PyConstant_Insert( c, "OBJECT",
- PyInt_FromLong( 7 ) );
- PyConstant_Insert( c, "GROUP",
- PyInt_FromLong( 8 ) );
- PyConstant_Insert( c, "BILLBOARD",
- PyInt_FromLong( 9 ) );
- }
- return DrawAs;
-}
-
-void Particle_Recalc(BPy_PartSys* self,int child){
- psys_flush_settings(self->psys->part,0,child );
-}
-
-void Particle_RecalcPsys_distr(BPy_PartSys* self,int child){
- psys_flush_settings(self->psys->part,PSYS_DISTR,child);
-}
-
-PyObject *ParticleSys_Init( void ){
- PyObject *submodule;
- PyObject *Types;
- PyObject *React;
- PyObject *EmitFrom;
- PyObject *Dist;
- PyObject *DrawAs;
-
- if( PyType_Ready( &ParticleSys_Type ) < 0)
- return NULL;
-
- Types = Particle_TypeDict ();
- React = Particle_ReactOnDict();
- EmitFrom = Particle_EmitFrom();
- DrawAs = Particle_DrawAs();
- Dist = Particle_DistrDict();
-
- submodule = Py_InitModule3( "Blender.Particle",
- M_ParticleSys_methods, M_ParticleSys_doc );
-
- if( Types )
- PyModule_AddObject( submodule, "TYPE", Types );
- if( React )
- PyModule_AddObject( submodule, "REACTON", React );
- if( EmitFrom )
- PyModule_AddObject( submodule, "EMITFROM", EmitFrom );
- if( Dist )
- PyModule_AddObject( submodule, "DISTRIBUTION", Dist );
- if( DrawAs )
- PyModule_AddObject( submodule, "DRAWAS", DrawAs );
-
- return ( submodule );
-}
-
-static PyObject *Part_freeEdit( BPy_PartSys * self, PyObject * args ){
-
- if(self->psys->flag & PSYS_EDITED){
- if(self->psys->edit)
- PE_free_particle_edit(self->psys);
-
- self->psys->flag &= ~PSYS_EDITED;
- self->psys->recalc |= PSYS_RECALC_HAIR;
-
- DAG_object_flush_update(G.scene, self->object, OB_RECALC_DATA);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args )
-{
- ParticleSystem *psys = 0L;
- Object *ob = 0L;
- PyObject *partlist,*seglist=0L;
- ParticleCacheKey **cache,*path;
- PyObject* loc = 0L;
- ParticleKey state;
- DerivedMesh* dm;
- float cfra;
- int i,j,k;
- float vm[4][4],wm[4][4];
- int childexists = 0;
- int all = 0;
- int id = 0;
-
- cfra = bsystem_time(ob,(float)CFRA,0.0);
-
- if( !PyArg_ParseTuple( args, "|ii", &all,&id ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two optional integers as arguments" );
-
- psys = self->psys;
- ob = self->object;
-
- if (!ob || !psys)
- Py_RETURN_NONE;
-
- G.rendering = 1;
-
- /* Just to create a valid rendering context */
- psys_render_set(ob,psys,vm,wm,0,0,0);
-
- dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
- dm->release(dm);
-
- if ( !psys_check_enabled(ob,psys) ){
- G.rendering = 0;
- psys_render_restore(ob,psys);
- Particle_Recalc(self,1);
- Py_RETURN_NONE;
- }
-
- partlist = PyList_New( 0 );
- if( !partlist ){
- PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" );
- goto error;
- }
-
- if (psys->part->type == PART_HAIR){
- cache = psys->pathcache;
-
- if ( ((self->psys->part->draw & PART_DRAW_PARENT) && (self->psys->part->childtype != 0)) || (self->psys->part->childtype == 0) ){
-
- for(i = 0; i < psys->totpart; i++){
- seglist = PyList_New( 0 );
- if (!seglist){
- PyErr_SetString( PyExc_MemoryError,
- "PyList_New() failed" );
- goto error;
- }
-
- path=cache[i];
- k = path->steps+1;
- for( j = 0; j < k ; j++, path++){
- loc = Py_BuildValue("(fff)",(double)path->co[0],
- (double)path->co[1], (double)path->co[2]);
-
- if (!loc){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
-
- if ( (PyList_Append(seglist,loc) < 0) ){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(loc); /* PyList_Append increfs */
- loc = NULL;
- }
-
- if ( PyList_Append(partlist,seglist) < 0 ){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(seglist); /* PyList_Append increfs */
- seglist = NULL;
- }
- }
-
- cache=psys->childcache;
-
- for(i = 0; i < psys->totchild; i++){
- seglist = PyList_New( 0 );
- if (!seglist){
- PyErr_SetString( PyExc_MemoryError,
- "PyList_New() failed" );
- goto error;
- }
-
- path=cache[i];
- k = path->steps+1;
- for( j = 0; j < k ; j++, path++ ){
- loc = Py_BuildValue("(fff)",(double)path->co[0],
- (double)path->co[1], (double)path->co[2]);
-
- if (!loc){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
-
- if ( PyList_Append(seglist,loc) < 0){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(loc);/* PyList_Append increfs */
- loc = NULL;
- }
-
- if ( PyList_Append(partlist,seglist) < 0){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(seglist); /* PyList_Append increfs */
- seglist = NULL;
- }
- } else {
- int init;
- char *fmt = NULL;
-
- if(id)
- fmt = "(fffi)";
- else
- fmt = "(fff)";
-
- if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
- childexists = 1;
-
- for (i = 0; i < psys->totpart + psys->totchild; i++){
- if (childexists && (i < psys->totpart))
- continue;
-
- state.time = cfra;
- if(psys_get_particle_state(ob,psys,i,&state,0)==0)
- init = 0;
- else
- init = 1;
-
- if (init){
- loc = Py_BuildValue(fmt,(double)state.co[0],
- (double)state.co[1], (double)state.co[2],i);
-
- if (!loc){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
-
- if ( PyList_Append(partlist,loc) < 0 ){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(loc);
- loc = NULL;
- } else {
- if ( all && PyList_Append(partlist,Py_None) < 0 ){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- }
- }
- }
-
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return partlist;
-
-error:
- Py_XDECREF(partlist);
- Py_XDECREF(seglist);
- Py_XDECREF(loc);
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return NULL;
-}
-
-static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args )
-{
- ParticleSystem *psys = 0L;
- Object *ob = 0L;
- PyObject *partlist = 0L;
- PyObject* loc = 0L;
- ParticleKey state;
- DerivedMesh* dm;
- float vm[4][4],wm[4][4];
- int i;
- int childexists = 0;
- int all = 0;
- int id = 0;
- char *fmt = NULL;
-
- float cfra=bsystem_time(ob,(float)CFRA,0.0);
-
- if( !PyArg_ParseTuple( args, "|ii", &all, &id ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two optional integers as arguments" );
-
- psys = self->psys;
- ob = self->object;
-
- if (!ob || !psys)
- Py_RETURN_NONE;
-
- G.rendering = 1;
-
- /* Just to create a valid rendering context */
- psys_render_set(ob,psys,vm,wm,0,0,0);
-
- dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
- dm->release(dm);
-
- if ( !psys_check_enabled(ob,psys) ){
- G.rendering = 0;
- psys_render_restore(ob,psys);
- Particle_Recalc(self,1);
- Py_RETURN_NONE;
- }
-
- if (psys->part->type != PART_HAIR){
- partlist = PyList_New( 0 );
-
- if( !partlist ){
- PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" );
- goto error;
- }
-
- if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
- childexists = 1;
-
- if(id)
- fmt = "(ffffi)";
- else
- fmt = "(ffff)";
-
- for (i = 0; i < psys->totpart + psys->totchild; i++){
- if (childexists && (i < psys->totpart))
- continue;
-
- state.time = cfra;
- if(psys_get_particle_state(ob,psys,i,&state,0)==0){
- if ( all && PyList_Append(partlist,Py_None) < 0){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- } else {
- loc = Py_BuildValue(fmt,(double)state.rot[0], (double)state.rot[1],
- (double)state.rot[2], (double)state.rot[3], i);
-
- if (!loc){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
- if (PyList_Append(partlist,loc) < 0){
- PyErr_SetString ( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(loc); /* PyList_Append increfs */
- loc = NULL;
- }
- }
- } else {
- partlist = EXPP_incr_ret( Py_None );
- }
-
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return partlist;
-
-error:
- Py_XDECREF(partlist);
- Py_XDECREF(loc);
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return NULL;
-}
-
-static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args )
-{
- ParticleKey state;
- ParticleSystem *psys = 0L;
- ParticleData *data;
- Object *ob = 0L;
- PyObject *partlist,*tuple=0L;
- DerivedMesh* dm;
- float vm[4][4],wm[4][4];
- float size;
- int i;
- int childexists = 0;
- int all = 0;
- int id = 0;
- char *fmt = NULL;
-
- float cfra=bsystem_time(ob,(float)CFRA,0.0);
-
- if( !PyArg_ParseTuple( args, "|ii", &all, &id ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two optional integers as arguments" );
-
- psys = self->psys;
- ob = self->object;
-
- if (!ob || !psys)
- Py_RETURN_NONE;
-
- G.rendering = 1;
-
- /* Just to create a valid rendering context */
- psys_render_set(ob,psys,vm,wm,0,0,0);
-
- dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
- dm->release(dm);
- data = self->psys->particles;
-
- if ( !psys_check_enabled(ob,psys) ){
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- Py_RETURN_NONE;
- }
-
- partlist = PyList_New( 0 );
-
- if( !partlist ){
- PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" );
- goto error;
- }
-
- if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
- childexists = 1;
-
- if(id)
- fmt = "(fi)";
- else
- fmt = "f";
-
- for (i = 0; i < psys->totpart + psys->totchild; i++, data++){
- if (psys->part->type != PART_HAIR){
- if (childexists && (i < psys->totpart))
- continue;
-
- if ( !all ){
- state.time = cfra;
- if(psys_get_particle_state(ob,psys,i,&state,0)==0)
- continue;
- }
-
- if (i < psys->totpart){
- size = data->size;
- } else {
- ChildParticle *cpa= &psys->child[i-psys->totpart];
- size = psys_get_child_size(psys,cpa,cfra,0);
- }
-
- tuple = Py_BuildValue(fmt,(double)size,i);
-
- if (!tuple){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
-
- if (PyList_Append(partlist,tuple) < 0){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(tuple);
- tuple = NULL;
- }
- }
-
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return partlist;
-
-error:
- Py_XDECREF(partlist);
- Py_XDECREF(tuple);
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return NULL;
-}
-
-
-static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args )
-{
- ParticleKey state;
- ParticleSystem *psys = 0L;
- ParticleData *data;
- Object *ob = 0L;
- PyObject *partlist,*tuple=0L;
- DerivedMesh* dm;
- float vm[4][4],wm[4][4];
- float life;
- int i;
- int childexists = 0;
- int all = 0;
- int id = 0;
- char *fmt = NULL;
-
- float cfra=bsystem_time(ob,(float)CFRA,0.0);
-
- if( !PyArg_ParseTuple( args, "|ii", &all, &id ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two optional integers as arguments" );
-
- psys = self->psys;
- ob = self->object;
-
- if (!ob || !psys)
- Py_RETURN_NONE;
-
- G.rendering = 1;
-
- /* Just to create a valid rendering context */
- psys_render_set(ob,psys,vm,wm,0,0,0);
-
- dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
- dm->release(dm);
- data = self->psys->particles;
-
- if ( !psys_check_enabled(ob,psys) ){
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Py_RETURN_NONE;
- }
-
- partlist = PyList_New( 0 );
- if( !partlist ){
- PyErr_SetString( PyExc_MemoryError, "PyList_New() failed" );
- goto error;
- }
-
- if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
- childexists = 1;
-
- if(id)
- fmt = "(fi)";
- else
- fmt = "f";
-
- for (i = 0; i < psys->totpart + psys->totchild; i++, data++){
- if (psys->part->type != PART_HAIR){
-
- if (childexists && (i < psys->totpart))
- continue;
-
- if ( !all ){
- state.time = cfra;
- if(psys_get_particle_state(ob,psys,i,&state,0)==0)
- continue;
- }
-
- if (i < psys->totpart){
- life = (cfra-data->time)/data->lifetime;
- } else {
- ChildParticle *cpa= &psys->child[i-psys->totpart];
- life = psys_get_child_time(psys,cpa,cfra);
- }
-
- tuple = Py_BuildValue(fmt,(double)life,i);
-
- if (!tuple){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't build tuple" );
- goto error;
- }
-
- if (PyList_Append(partlist,tuple) < 0){
- PyErr_SetString( PyExc_RuntimeError,
- "Couldn't append item to PyList" );
- goto error;
- }
- Py_DECREF(tuple);
- tuple = NULL;
- }
- }
-
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return partlist;
-
-error:
- Py_XDECREF(partlist);
- Py_XDECREF(tuple);
- psys_render_restore(ob,psys);
- G.rendering = 0;
- Particle_Recalc(self,1);
- return NULL;
-}
-
-
-static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ){
- Material *ma;
- PyObject* mat = 0L;
- ma = give_current_material(self->object,self->psys->part->omat);
- if(!ma)
- Py_RETURN_NONE;
-
- mat = Material_CreatePyObject(ma);
- return mat;
-}
-
-
-/*****************************************************************************/
-/* Function: Set/Get Seed */
-/*****************************************************************************/
-
-static int Part_setSeed( BPy_PartSys * self, PyObject * args )
-{
- return EXPP_setIValueRange( args, &self->psys->seed,
- 0, 255, 'i' );
-}
-
-static PyObject *Part_getSeed( BPy_PartSys * self )
-{
- return PyInt_FromLong( (long)( self->psys->seed ) );
-}
-
-static int Part_setType( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->type,
- 0, 2, 'h' );
-
- psys_flush_settings( self->psys->part, PSYS_TYPE, 1 );
-
- return res;
-}
-
-static PyObject *Part_getType( BPy_PartSys * self )
-{
- return PyInt_FromLong( (short)( self->psys->part->type ) );
-}
-
-static int Part_setResol( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->grid_res,
- 0, 100, 'i' );
-
- psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 );
-
- return res;
-}
-
-static PyObject *Part_getResol( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((int)( self->psys->part->grid_res )) );
-}
-
-static int Part_setStart( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->sta,
- 0.0f, 100000.0f );
-
- psys_flush_settings(self->psys->part,PSYS_INIT,1);
-
- return res;
-}
-
-static PyObject *Part_getStart( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( (float)( self->psys->part->sta ) );
-}
-
-static int Part_setEnd( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->end,
- 0.0f, 100000.0f );
-
- psys_flush_settings(self->psys->part,PSYS_INIT,1);
-
- return res;
-}
-
-static PyObject *Part_getEnd( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( (long)( self->psys->part->end ) );
-}
-
-static int Part_setEditable( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if(!number){
- if(self->psys->edit)
- PE_free_particle_edit(self->psys);
-
- self->psys->flag &= ~PSYS_EDITED;
- self->psys->recalc |= PSYS_RECALC_HAIR;
-
- DAG_object_flush_update(G.scene, self->object, OB_RECALC_DATA);
- }
- else
- {
- self->psys->flag |= PSYS_EDITED;
- if(G.f & G_PARTICLEEDIT)
- PE_create_particle_edit(self->object, self->psys);
- }
-
- return 0;
-}
-
-static PyObject *Part_getEditable( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->flag & PSYS_EDITED )) > 0 );
-}
-
-static int Part_setAmount( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->totpart,
- 0, 100000, 'i' );
-
- psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 );
-
- return res;
-}
-
-static PyObject *Part_getAmount( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((int)( self->psys->part->totpart )) );
-}
-
-static int Part_setMultiReact( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
-
- if (number){
- self->psys->part->flag |= PART_REACT_MULTIPLE;
- }else{
- self->psys->part->flag &= ~PART_REACT_MULTIPLE;
- }
-
- Particle_Recalc(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getMultiReact( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->flag & PART_REACT_MULTIPLE )) > 0 );
-}
-
-static int Part_setReactShape( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->reactshape,
- 0.0f, 10.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getReactShape( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->reactshape )) );
-}
-
-static int Part_setSegments( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->hair_step,
- 2, 50, 'h' );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getSegments( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->hair_step )) );
-}
-
-static int Part_setLife( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->lifetime,
- 1.0f, MAXFRAMEF );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getLife( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->lifetime )) );
-}
-
-static int Part_setRandLife( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->randlife,
- 0.0f, 2.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getRandLife( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->randlife )) );
-}
-
-static int Part_set2d( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" );
-
- number = PyInt_AS_LONG( args );
-
- if (number){
- self->psys->part->flag |= PART_BOIDS_2D;
- }else{
- self->psys->part->flag &= ~PART_BOIDS_2D;
- }
-
- Particle_Recalc(self,1);
-
- return 0;
-}
-
-static PyObject *Part_get2d( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->flag & PART_BOIDS_2D )) > 0 );
-}
-
-static int Part_setMaxVel( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->max_vel,
- 0.0f, 200.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getMaxVel( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->max_vel )) );
-}
-
-static int Part_setAvVel( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->average_vel,
- 0.0f, 1.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getAvVel( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->average_vel )) );
-}
-
-static int Part_setLatAcc( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->max_lat_acc,
- 0.0f, 1.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getLatAcc( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->max_lat_acc )) );
-}
-
-static int Part_setMaxTan( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->max_tan_acc,
- 0.0f, 1.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getMaxTan( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->max_tan_acc )) );
-}
-
-static int Part_setGroundZ( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->groundz,
- -100.0f, 100.0f );
-
- Particle_Recalc(self,1);
-
- return res;
-}
-
-static PyObject *Part_getGroundZ( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->groundz )) );
-}
-
-static int Part_setOb( BPy_PartSys * self, PyObject * args )
-{
- Object *obj;
- if( !BPy_Object_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected object argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- obj = Object_FromPyObject(args);
-
- self->psys->keyed_ob = obj;
-
- return 0;
-}
-
-static PyObject *Part_getOb( BPy_PartSys * self )
-{
- Object * obj;
- obj = self->psys->keyed_ob;
- if (!obj)
- Py_RETURN_NONE;
-
- return Object_CreatePyObject( obj );
-}
-
-static int Part_setRandEmission( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number){
- self->psys->part->flag |= PART_TRAND;
- }else{
- self->psys->part->flag &= ~PART_TRAND;
- }
-
- Particle_RecalcPsys_distr(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getRandEmission( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->flag & PART_TRAND )) > 0 );
-}
-
-static int Part_setParticleDist( BPy_PartSys * self, PyObject * args )
-{
- int number;
- char errstr[128];
-
- if( !PyInt_Check( args ) ) {
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number < 0 || number > 3){
- sprintf ( errstr, "expected int argument between 0 - 3" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- self->psys->part->from = (short)number;
-
- Particle_RecalcPsys_distr(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getParticleDist( BPy_PartSys * self )
-{
- return PyInt_FromLong( (long)( self->psys->part->from ) );
-}
-
-static int Part_setEvenDist( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number){
- self->psys->part->flag |= PART_EDISTR;
- }else{
- self->psys->part->flag &= ~PART_EDISTR;
- }
-
- Particle_RecalcPsys_distr(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getEvenDist( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->flag & PART_EDISTR )) > 0 );
-}
-
-static int Part_setDist( BPy_PartSys * self, PyObject * args )
-{
- int number;
- char errstr[128];
-
- if( !PyInt_Check( args ) ) {
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number < 0 || number > 2){
- sprintf ( errstr, "expected int argument between 0 - 2" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- self->psys->part->distr = (short)number;
-
- Particle_RecalcPsys_distr(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getDist( BPy_PartSys * self )
-{
- return PyInt_FromLong( (long)( self->psys->part->distr ) );
-}
-
-static int Part_setJitterAmount( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setFloatRange( args, &self->psys->part->jitfac,
- 0.0f, 2.0f );
-
- Particle_RecalcPsys_distr(self,1);
-
- return res;
-}
-
-static PyObject *Part_getJitterAmount( BPy_PartSys * self )
-{
- return PyFloat_FromDouble( ((double)( self->psys->part->jitfac )) );
-}
-
-
-
-static int Part_setPF( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->userjit,
- 0, 1000, 'i' );
-
- Particle_RecalcPsys_distr(self,1);
-
- return res;
-}
-
-static PyObject *Part_getPF( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((short)( self->psys->part->userjit )) );
-}
-
-static int Part_setInvert( BPy_PartSys * self, PyObject * args )
-{
- int number;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number){
- self->psys->part->flag |= PART_GRID_INVERT;
- }else{
- self->psys->part->flag &= ~PART_GRID_INVERT;
- }
-
- Particle_RecalcPsys_distr(self,1);
-
- return 0;
-}
-
-static PyObject *Part_getInvert( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->flag & PART_GRID_INVERT )) > 0 );
-}
-
-static int Part_setTargetOb( BPy_PartSys * self, PyObject * args )
-{
- Object *obj;
- if( !BPy_Object_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected object argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- obj = Object_FromPyObject(args);
-
- self->psys->target_ob = obj;
-
- return 0;
-}
-
-static PyObject *Part_getTargetOb( BPy_PartSys * self )
-{
- Object * obj;
- obj = self->psys->target_ob;
- if (!obj)
- Py_RETURN_NONE;
-
- return Object_CreatePyObject( obj );
-}
-
-
-
-PyObject *Part_getDupOb( BPy_PartSys * self )
-{
- Object * obj;
- obj = self->psys->part->dup_ob;
- if (!obj)
- Py_RETURN_NONE;
-
- return Object_CreatePyObject( obj );
-}
-
-static int Part_setTargetPsys( BPy_PartSys * self, PyObject * args ){
- int tottpsys;
- int res;
- Object *tob=0;
- ParticleSystem *psys = self->psys;
- Object *ob;
-
- ob = self->object;
-
- if(psys->target_ob)
- tob=psys->target_ob;
- else
- tob=ob;
-
- tottpsys = BLI_countlist(&tob->particlesystem);
-
- res = EXPP_setIValueRange( args, &self->psys->target_psys, 0, tottpsys, 'h' );
-
- if( ( psys = psys_get_current(ob) ) ){
- if(psys->keyed_ob==ob || psys->target_ob==ob){
- if(psys->keyed_ob==ob)
- psys->keyed_ob=NULL;
- else
- psys->target_ob=NULL;
- }
- else{
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
-
- return res;
-}
-
-static PyObject *Part_getTargetPsys( BPy_PartSys * self ){
- return PyInt_FromLong( (short)( self->psys->target_psys ) );
-}
-
-static int Part_setRenderObject( BPy_PartSys * self, PyObject * args )
-{
- int number,nr;
- ParticleSystem *psys = 0L;
-
- if( !PyInt_Check( args ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument" );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( args );
-
- if (number){
- self->psys->part->draw |= PART_DRAW_EMITTER;
- }else{
- self->psys->part->draw &= ~PART_DRAW_EMITTER;
- }
-
- /* check need for dupliobjects */
- nr=0;
- for(psys=self->object->particlesystem.first; psys; psys=psys->next){
- if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- self->object->transflag |= OB_DUPLIPARTS;
- else
- self->object->transflag &= ~OB_DUPLIPARTS;
-
- return 0;
-}
-
-static PyObject *Part_getRenderObject( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((long)( self->psys->part->draw & PART_DRAW_EMITTER )) > 0 );
-}
-
-static int Part_setParticleDisp( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->disp,
- 0, 100, 'i' );
-
- Particle_Recalc(self,0);
-
-
- return res;
-}
-
-static PyObject *Part_getParticleDisp( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((short)( self->psys->part->disp )) );
-}
-
-static int Part_setStep( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->draw_step,
- 0, 7, 'i' );
-
- Particle_Recalc(self,1);
-
-
- return res;
-}
-
-static PyObject *Part_getStep( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((short)( self->psys->part->draw_step )) );
-}
-
-static int Part_setRenderStep( BPy_PartSys * self, PyObject * args )
-{
- int res = EXPP_setIValueRange( args, &self->psys->part->ren_step,
- 0, 7, 'i' );
-
- /*Particle_Recalc(self,1);*/
-
-
- return res;
-}
-
-static PyObject *Part_getRenderStep( BPy_PartSys * self )
-{
- return PyInt_FromLong( ((short)( self->psys->part->ren_step )) );
-}
-
-static PyObject *Part_getDrawAs( BPy_PartSys * self )
-{
- return PyInt_FromLong( (long)( self->psys->part->draw_as ) );
-}
diff --git a/source/blender/python/api2_2x/Particle.h b/source/blender/python/api2_2x/Particle.h
deleted file mode 100644
index 416e3a99bea..00000000000
--- a/source/blender/python/api2_2x/Particle.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Cedric Paille
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_PARTICLESYS_H
-#define EXPP_PARTICLESYS_H
-
-#include <Python.h>
-#include "DNA_particle_types.h"
-#include "DNA_object_types.h"
-
-extern PyTypeObject ParticleSys_Type;
-
-#define BPy_ParticleSys_Check(v) \
- ((v)->ob_type == &ParticleSys_Type) /* for type checking */
-
-/* Python BPy_Effect structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- ParticleSystem *psys;
- Object *object; /* fixeme: if this points back to the parent object,it is wrong */
-} BPy_PartSys;
-
-PyObject *ParticleSys_Init( void );
-PyObject *ParticleSys_CreatePyObject( ParticleSystem * psystem, Object *ob );
-
-
-#endif /* EXPP_EFFECT_H */
diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c
deleted file mode 100644
index 06d736f2cb6..00000000000
--- a/source/blender/python/api2_2x/Pose.c
+++ /dev/null
@@ -1,1394 +0,0 @@
-/*
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Pose.h"
-
-
-#include "mydevice.h"
-#include "BKE_armature.h"
-#include "BKE_main.h"
-#include "BKE_global.h"
-#include "BKE_action.h"
-#include "BKE_utildefines.h"
-#include "BIF_editaction.h"
-#include "BIF_space.h"
-#include "BIF_poseobject.h"
-#include "BKE_depsgraph.h"
-#include "DNA_object_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h" //1 - this order
-#include "BSE_editipo.h" //2
-#include "BIF_keyframing.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "Mathutils.h"
-#include "Object.h"
-#include "Constraint.h"
-#include "NLA.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "DNA_armature_types.h" /*used for pose bone select*/
-
-#include "MEM_guardedalloc.h"
-
-extern void chan_calc_mat(bPoseChannel *chan);
-
-//------------------------ERROR CODES---------------------------------
-//This is here just to make me happy and to have more consistant error strings :)
-static const char sPoseError[] = "Pose - Error: ";
-//static const char sPoseBadArgs[] = "Pose - Bad Arguments: ";
-static const char sPoseBoneError[] = "PoseBone - Error: ";
-//static const char sPoseBoneBadArgs[] = "PoseBone - Bad Arguments: ";
-static const char sPoseBonesDictError[] = "PoseBone - Error: ";
-//static const char sPoseBonesDictBadArgs[] = "PoseBone - Bad Arguments: ";
-
-//################## PoseBonesDict_Type (internal) ########################
-/*This is an internal psuedo-dictionary type that allows for manipulation
-* of posechannels inside of a pose structure. It is a subobject of pose.
-* i.e. Pose.bones['key']*/
-//################################################################
-
-//------------------METHOD IMPLEMENTATIONS-----------------------------
-//------------------------Pose.bones.items()
-//Returns a list of key:value pairs like dict.items()
-static PyObject* PoseBonesDict_items(BPy_PoseBonesDict *self)
-{
- return PyDict_Items(self->bonesMap);
-}
-//------------------------Pose.bones.keys()
-//Returns a list of keys like dict.keys()
-static PyObject* PoseBonesDict_keys(BPy_PoseBonesDict *self)
-{
- return PyDict_Keys(self->bonesMap);
-}
-//------------------------Armature.bones.values()
-//Returns a list of values like dict.values()
-static PyObject* PoseBonesDict_values(BPy_PoseBonesDict *self)
-{
- return PyDict_Values(self->bonesMap);
-}
-//------------------ATTRIBUTE IMPLEMENTATION---------------------------
-//------------------TYPE_OBECT IMPLEMENTATION-----------------------
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_PoseBonesDict_doc[] = "This is an internal subobject of pose\
-designed to act as a Py_PoseBone dictionary.";
-
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_PoseBonesDict_methods[] = {
- {"items", (PyCFunction) PoseBonesDict_items, METH_NOARGS,
- "() - Returns the key:value pairs from the dictionary"},
- {"keys", (PyCFunction) PoseBonesDict_keys, METH_NOARGS,
- "() - Returns the keys the dictionary"},
- {"values", (PyCFunction) PoseBonesDict_values, METH_NOARGS,
- "() - Returns the values from the dictionary"},
- {NULL, NULL, 0, NULL}
-};
-//-----------------(internal)
-static int PoseBoneMapping_Init(PyObject *dictionary, ListBase *posechannels){
- bPoseChannel *pchan = NULL;
- PyObject *py_posechannel = NULL;
-
- for (pchan = posechannels->first; pchan; pchan = pchan->next){
- py_posechannel = PyPoseBone_FromPosechannel(pchan);
- if (!py_posechannel)
- return -1;
-
- if(PyDict_SetItemString(dictionary,
- pchan->name, py_posechannel) == -1){
- return -1;
- }
- Py_DECREF(py_posechannel);
- }
- return 0;
-}
-
-//----------------- BonesDict_InitBones
-static int PoseBonesDict_InitBones(BPy_PoseBonesDict *self)
-{
- PyDict_Clear(self->bonesMap);
- if (PoseBoneMapping_Init(self->bonesMap, self->bones) == -1)
- return 0;
- return 1;
-}
-
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *PoseBonesDict_repr(BPy_PoseBonesDict *self)
-{
- char buffer[128], *str;
- PyObject *key, *value;
- Py_ssize_t pos = 0;
-
- /* probably a bit of overkill but better then crashing */
- str = MEM_mallocN( 64 + ( PyDict_Size( self->bonesMap ) * 128), "PoseBonesDict_repr" );
- str[0] = '\0';
-
- sprintf(buffer, "[Pose Bone Dict: {");
- strcat(str,buffer);
- while (PyDict_Next(self->bonesMap, &pos, &key, &value)) {
- sprintf(buffer, "%s : %s, ", PyString_AsString(key),
- PyString_AsString(value->ob_type->tp_repr(value)));
- strcat(str,buffer);
- }
- sprintf(buffer, "}]\n");
- strcat(str,buffer);
-
- MEM_freeN( str );
-
- return PyString_FromString(str);
-}
-
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-static void PoseBonesDict_dealloc(BPy_PoseBonesDict * self)
-{
- Py_DECREF(self->bonesMap);
- PoseBonesDict_Type.tp_free(self);
- return;
-}
-//------------------------mp_length
-//This gets the size of the dictionary
-static int PoseBonesDict_len(BPy_PoseBonesDict *self)
-{
- return BLI_countlist(self->bones);
-}
-//-----------------------mp_subscript
-//This defines getting a bone from the dictionary - x = Bones['key']
-static PyObject *PoseBonesDict_GetItem(BPy_PoseBonesDict *self, PyObject* key)
-{
- PyObject *value = NULL;
-
- value = PyDict_GetItem(self->bonesMap, key);
- if(value == NULL)
- Py_RETURN_NONE;
-
- return EXPP_incr_ret(value);
-}
-//------------------TYPE_OBECT DEFINITION--------------------------
-//Mapping Protocol
-static PyMappingMethods PoseBonesDict_MapMethods = {
- (inquiry) PoseBonesDict_len, //mp_length
- (binaryfunc)PoseBonesDict_GetItem, //mp_subscript
- 0, //mp_ass_subscript
-};
-//PoseBonesDict TypeObject
-PyTypeObject PoseBonesDict_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "PoseBonesDict", //tp_name
- sizeof(BPy_PoseBonesDict), //tp_basicsize
- 0, //tp_itemsize
- (destructor)PoseBonesDict_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
- (reprfunc) PoseBonesDict_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- &PoseBonesDict_MapMethods, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_PoseBonesDict_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_PoseBonesDict_methods, //tp_methods
- 0, //tp_members
- 0, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//-----------------------PyPoseBonesDict_FromPyPose
-static PyObject *PyPoseBonesDict_FromPyPose(BPy_Pose *py_pose)
-{
- BPy_PoseBonesDict *py_posebonesdict = NULL;
-
- //create py object
- py_posebonesdict = (BPy_PoseBonesDict *)PoseBonesDict_Type.tp_alloc(&PoseBonesDict_Type, 0);
- if (!py_posebonesdict)
- goto RuntimeError;
-
- //create internal dictionaries
- py_posebonesdict->bonesMap = PyDict_New();
- if (!py_posebonesdict->bonesMap)
- goto RuntimeError;
-
- //set listbase pointer
- py_posebonesdict->bones = &py_pose->pose->chanbase;
-
- //now that everything is setup - init the mappings
- if (!PoseBonesDict_InitBones(py_posebonesdict))
- goto RuntimeError;
-
- return (PyObject*)py_posebonesdict;
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s",
- sPoseBonesDictError, "Failed to create class");
-}
-
-//################## Pose_Type ##########################
-/*This type is a wrapper for a pose*/
-//####################################################
-//------------------METHOD IMPLEMENTATIONS------------------------------
-static PyObject *Pose_update(BPy_Pose *self)
-{
- Object *daddy = NULL;
-
- self->pose->flag |= POSE_RECALC;
-
- for (daddy = G.main->object.first; daddy; daddy = daddy->id.next){
- if (daddy->pose == self->pose){
- break;
- }
- }
-
- if(daddy)
- where_is_pose(daddy);
-
- Py_RETURN_NONE;
-}
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_Pose_methods[] = {
- {"update", (PyCFunction) Pose_update, METH_NOARGS,
- "() - Rebuilds the pose with new values"},
- {NULL, NULL, 0, NULL}
-};
-//------------------ATTRIBUTE IMPLEMENTATIONS---------------------------
-//------------------------Pose.bones (getter)
-//Gets the bones attribute
-static PyObject *Pose_getBoneDict(BPy_Pose *self, void *closure)
-{
- return EXPP_incr_ret((PyObject*)self->Bones);
-}
-//------------------------Pose.bones (setter)
-//Sets the bones attribute
-static int Pose_setBoneDict(BPy_Pose *self, PyObject *value, void *closure)
-{
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sPoseError, "You are not allowed to change the .bones attribute");
-}
-//------------------TYPE_OBECT IMPLEMENTATION---------------------------
-//------------------------tp_getset
-//This contains methods for attributes that require checking
-static PyGetSetDef BPy_Pose_getset[] = {
- {"bones", (getter)Pose_getBoneDict, (setter)Pose_setBoneDict,
- "The pose's Bone dictionary", NULL},
- {NULL, NULL, NULL, NULL, NULL}
-};
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-static void Pose_dealloc(BPy_Pose *self)
-{
- Py_DECREF(self->Bones);
- Pose_Type.tp_free(self);
- return;
-}
-//------------------------tp_cmp
-//This compares 2 pose types
-static int Pose_compare(BPy_Pose *a, BPy_Pose *b )
-{
- return ( a->pose== b->pose ) ? 0 : -1;
-}
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *Pose_repr(BPy_Pose *self)
-{
- return PyString_FromFormat( "[Pose \"%s\"]", self->name);
-}
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_Pose_doc[] = "This object wraps a Blender Pose object.";
-
-//------------------TYPE_OBECT DEFINITION--------------------------
-PyTypeObject Pose_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "Pose", //tp_name
- sizeof(BPy_Pose), //tp_basicsize
- 0, //tp_itemsize
- (destructor)Pose_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- (cmpfunc)Pose_compare, //tp_compare
- (reprfunc)Pose_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_Pose_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_Pose_methods, //tp_methods
- 0, //tp_members
- BPy_Pose_getset, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//################## PoseBone_Type #####################
-/*This type is a wrapper for a posechannel*/
-//####################################################
-//------------------METHOD IMPLEMENTATIONS------------------------------
-//------------------------------PoseBone.insertKey()
-static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args)
-{
- PyObject *parent_object = NULL;
- PyObject *constants = NULL, *item = NULL;
- int frame = 1, oldframe, length, x, numeric_value = 0, oldflag, no_ipo_update = 0, flag = 0;
- bPoseChannel *pchan = NULL;
-
-
- if (!PyArg_ParseTuple(args, "O!i|Oi", &Object_Type, &parent_object, &frame, &constants, &no_ipo_update ))
- goto AttributeError;
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (no_ipo_update) flag |= INSERTKEY_FAST;
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- //verify that this pchannel is part of the object->pose
- for (pchan = ((BPy_Object*)parent_object)->object->pose->chanbase.first;
- pchan; pchan = pchan->next){
- if (pchan == self->posechannel)
- break;
- }
- if (!pchan)
- goto AttributeError2;
-
- //verify that there is an action bound to this object
- if (!((BPy_Object*)parent_object)->object->action){
- goto AttributeError5;
- }
-
- oldflag = self->posechannel->flag;
- self->posechannel->flag = 0;
- //set the flags for this posechannel
- if (constants){
- if(PySequence_Check(constants)){
- length = PySequence_Length(constants);
- for (x = 0; x < length; x++){
- item = PySequence_GetItem(constants, x);
- if (item == EXPP_GetModuleConstant("Blender.Object.Pose", "ROT")){
- numeric_value |= POSE_ROT;
- }else if (item == EXPP_GetModuleConstant("Blender.Object.Pose", "LOC")){
- numeric_value |= POSE_LOC;
- }else if (item == EXPP_GetModuleConstant("Blender.Object.Pose", "SIZE")){
- numeric_value |= POSE_SIZE;
- }else{
- Py_DECREF(item);
- self->posechannel->flag = (short)oldflag;
- goto AttributeError4;
- }
- Py_DECREF(item);
- }
- self->posechannel->flag = (short)numeric_value;
- }else if (BPy_Constant_Check(constants)){
- if (constants == EXPP_GetModuleConstant("Blender.Object.Pose", "ROT")){
- numeric_value |= POSE_ROT;
- }else if (constants == EXPP_GetModuleConstant("Blender.Object.Pose", "LOC")){
- numeric_value |= POSE_LOC;
- }else if (constants == EXPP_GetModuleConstant("Blender.Object.Pose", "SIZE")){
- numeric_value |= POSE_SIZE;
- }else{
- self->posechannel->flag = (short)oldflag;
- goto AttributeError4;
- }
- self->posechannel->flag = (short)numeric_value;
- }else{
- goto AttributeError3;
- }
- }else{ //nothing passed so set them all
- self->posechannel->flag |= POSE_ROT;
- self->posechannel->flag |= POSE_LOC;
- self->posechannel->flag |= POSE_SIZE;
- }
-
- //set the frame we want insertion on
- oldframe = G.scene->r.cfra;
- G.scene->r.cfra = frame;
-
- //add the action channel if it's not there
- verify_action_channel(((BPy_Object*)parent_object)->object->action,
- self->posechannel->name);
-
- //insert the pose keys
- if (self->posechannel->flag & POSE_ROT){
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_QUAT_X, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_QUAT_W, flag);
- }
- if (self->posechannel->flag & POSE_LOC){
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_LOC_X, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_LOC_Y, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_LOC_Z, flag);
- }
- if (self->posechannel->flag & POSE_SIZE){
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_SIZE_X, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, flag);
- insertkey(&((BPy_Object*)parent_object)->object->id,
- ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, flag);
- }
-
- //flip the frame back
- G.scene->r.cfra = oldframe;
-
- //update the IPOs
- if (no_ipo_update==0)
- remake_action_ipos (((BPy_Object*)parent_object)->object->action);
-
- Py_RETURN_NONE;
-
-AttributeError:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".insertKey: ", "expects an Object, int, (optional) constants");
-AttributeError2:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".insertKey: ", "wrong object detected. \
- Use the object this pose came from");
-AttributeError3:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".insertKey: ", "Expects a constant or list of constants");
-AttributeError4:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".insertKey: ", "Please use a constant defined in the Pose module");
-AttributeError5:
- return EXPP_objError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".insertKey: ", "You must set up and link an Action to this object first");
-}
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_PoseBone_methods[] = {
- {"insertKey", (PyCFunction) PoseBone_insertKey, METH_VARARGS,
- "() - insert a key for this pose into an action"},
- {NULL, NULL, 0, NULL}
-};
-//------------------ATTRIBUTE IMPLEMENTATIONS---------------------------
-//------------------------PoseBone.name (getter)
-//Gets the name attribute
-static PyObject *PoseBone_getName(BPy_PoseBone *self, void *closure)
-{
- return PyString_FromString(self->posechannel->name);
-}
-//------------------------PoseBone.name (setter)
-//Sets the name attribute
-static int PoseBone_setName(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- char *name = "";
-
- if (!PyArg_Parse(value, "s", &name))
- goto AttributeError;
-
- BLI_strncpy(self->posechannel->name, name, 32);
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".name: ", "expects a string");
-}
-//------------------------PoseBone.loc (getter)
-//Gets the loc attribute
-static PyObject *PoseBone_getLoc(BPy_PoseBone *self, void *closure)
-{
- return newVectorObject(self->posechannel->loc, 3, Py_WRAP);
-}
-//------------------------PoseBone.loc (setter)
-//Sets the loc attribute
-static int PoseBone_setLoc(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- VectorObject *vec = NULL;
- int x;
-
- if (!PyArg_Parse(value, "O!", &vector_Type, &vec))
- goto AttributeError;
- if (vec->size != 3)
- goto AttributeError;
-
- for (x = 0; x < 3; x++){
- self->posechannel->loc[x] = vec->vec[x];
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".loc: ", "expects a 3d vector object");
-}
-//------------------------PoseBone.size (getter)
-//Gets the size attribute
-static PyObject *PoseBone_getSize(BPy_PoseBone *self, void *closure)
-{
- return newVectorObject(self->posechannel->size, 3, Py_WRAP);
-}
-//------------------------PoseBone.size (setter)
-//Sets the size attribute
-static int PoseBone_setSize(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- VectorObject *vec = NULL;
- int x;
-
- if (!PyArg_Parse(value, "O!", &vector_Type, &vec))
- goto AttributeError;
- if (vec->size != 3)
- goto AttributeError;
-
- for (x = 0; x < 3; x++){
- self->posechannel->size[x] = vec->vec[x];
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".size: ", "expects a 3d vector object");
-}
-//------------------------PoseBone.quat (getter)
-//Gets the quat attribute
-static PyObject *PoseBone_getQuat(BPy_PoseBone *self, void *closure)
-{
- return newQuaternionObject(self->posechannel->quat, Py_WRAP);
-}
-//------------------------PoseBone.quat (setter)
-//Sets the quat attribute
-static int PoseBone_setQuat(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- QuaternionObject *quat = NULL;
- int x;
-
- if (!PyArg_Parse(value, "O!", &quaternion_Type, &quat))
- goto AttributeError;
-
- for (x = 0; x < 4; x++){
- self->posechannel->quat[x] = quat->quat[x];
- }
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".quat: ", "expects a quaternion object");
-}
-//------------------------PoseBone.localMatrix (getter)
-//Gets the chan_mat
-static PyObject *PoseBone_getLocalMatrix(BPy_PoseBone *self, void *closure)
-{
- return newMatrixObject((float*)self->posechannel->chan_mat, 4, 4, Py_WRAP);
-}
-//------------------------PoseBone.localMatrix (setter)
-//Sets the chan_mat
-static int PoseBone_setLocalMatrix(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- MatrixObject *matrix = NULL;
- float size[3], quat[4], loc[3];
- float mat3[3][3], mat4[4][4];
- int matsize = 0;
-
- if (!PyArg_Parse(value, "O!", &matrix_Type, &matrix))
- goto AttributeError;
-
- if (matrix->rowSize == 3 && matrix->colSize == 3){
- matsize = 3;
- Mat3CpyMat3(mat3, (float(*)[3])*matrix->matrix);
- }else if (matrix->rowSize == 4 && matrix->colSize == 4){
- matsize = 4;
- Mat4CpyMat4(mat4, (float(*)[4])*matrix->matrix);
- }
-
- if (matsize != 3 && matsize != 4){
- goto AttributeError;
- }
-
- //get size and rotation
- if (matsize == 3){
- Mat3ToSize(mat3, size);
- Mat3Ortho(mat3);
- Mat3ToQuat(mat3, quat);
- }else if (matsize == 4){
- Mat4ToSize(mat4, size);
- Mat4Ortho(mat4);
- Mat4ToQuat(mat4, quat);
- }
-
- //get loc
- if (matsize == 4) {
- VECCOPY(loc, matrix->matrix[3]);
- }
- else {
- loc[0]= loc[1]= loc[2]= 0.0f;
- }
-
- //copy new attributes
- VECCOPY(self->posechannel->size, size);
- QUATCOPY(self->posechannel->quat, quat);
- if (matsize == 4){
- VECCOPY(self->posechannel->loc, loc);
- }
-
- //rebuild matrix
- chan_calc_mat(self->posechannel);
- return 0;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".localMatrix: ", "expects a 3x3 or 4x4 matrix object");
-}
-//------------------------PoseBone.poseMatrix (getter)
-//Gets the pose_mat
-static PyObject *PoseBone_getPoseMatrix(BPy_PoseBone *self, void *closure)
-{
- return newMatrixObject((float*)self->posechannel->pose_mat, 4, 4, Py_WRAP);
-}
-//------------------------PoseBone.poseMatrix (setter)
-//Sets the pose_mat
-static int PoseBone_setPoseMatrix(BPy_PoseBone *self, MatrixObject *value, void *closure)
-{
- float delta_mat[4][4], quat[4]; /* rotation */
- float size[4]; /* size only */
-
- if( !MatrixObject_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected matrix object as argument" );
-
- if( value->colSize != 4 || value->rowSize != 4 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "matrix must be a 4x4 transformation matrix\n"
- "for example as returned by object.matrixWorld" );
-
- /* get bone-space cursor matrix and extract location */
- armature_mat_pose_to_bone(self->posechannel, (float (*)[4]) *value->matrix, delta_mat);
-
- /* Visual Location */
- VECCOPY(self->posechannel->loc, delta_mat[3]);
-
- /* Visual Size */
- Mat4ToSize(delta_mat, size);
- VECCOPY(self->posechannel->size, size);
-
- /* Visual Rotation */
- Mat4ToQuat(delta_mat, quat);
- QUATCOPY(self->posechannel->quat, quat);
-
- return 0;
-}
-//------------------------PoseBone.constraints (getter)
-//Gets the constraints sequence
-static PyObject *PoseBone_getConstraints(BPy_PoseBone *self, void *closure)
-{
- return PoseConstraintSeq_CreatePyObject( self->posechannel );
-}
-//------------------------PoseBone.limitmin (getter)
-//Gets the pose bone limitmin value
-static PyObject *PoseBone_getLimitMin(BPy_PoseBone *self, void *closure)
-{
- float mylimitmin[3];
- Object *obj = NULL;
-
- obj = Object_FromPoseChannel(self->posechannel);
- if (obj==NULL){
- return EXPP_ReturnPyObjError(PyExc_AttributeError, "Bone data is not found");
- }
- mylimitmin[0]=0.0f;
- mylimitmin[1]=0.0f;
- mylimitmin[2]=0.0f;
- if(pose_channel_in_IK_chain(obj, self->posechannel)){
- if ((self->posechannel->ikflag & BONE_IK_NO_XDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_XLIMIT)) {
- mylimitmin[0] = self->posechannel->limitmin[0];
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_YDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_YLIMIT)) {
- mylimitmin[1] = self->posechannel->limitmin[1];
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_ZDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_ZLIMIT)) {
- mylimitmin[2] = self->posechannel->limitmin[2];
- }
- }
- }
- return newVectorObject(mylimitmin, 3, Py_NEW);
-}
-//------------------------PoseBone.limitmin (setter)
-//Sets the pose bone limitmin value
-static int PoseBone_setLimitMin(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- float newlimitmin[3];
- int x;
- Object *obj = NULL;
- if(!PySequence_Check(value)){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Argument is not a sequence");
- }
- if (PySequence_Size(value) !=3){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Argument size must be 3");
- }
- newlimitmin[0]=0.0f;
- newlimitmin[1]=0.0f;
- newlimitmin[2]=0.0f;
- for (x = 0; x<3;x++){
- PyObject *item;
- item = PySequence_GetItem(value, x); //new reference
- if (PyFloat_Check(item)){
- newlimitmin[x] = (float)PyFloat_AsDouble(item);
- }else if (PyInt_Check(item)){
- newlimitmin[x] = (float)PyInt_AsLong(item);
- }
- Py_DECREF(item);
- }
- obj = Object_FromPoseChannel(self->posechannel);
- if (obj==NULL){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Bone data is not found");
- }
- if(!pose_channel_in_IK_chain(obj, self->posechannel)){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Bone is not part of an IK chain");
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_XDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_XLIMIT)) {
- self->posechannel->limitmin[0] = EXPP_ClampFloat(newlimitmin[0], -180.0f, 0.0f);
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_YDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_YLIMIT)) {
- self->posechannel->limitmin[1] = EXPP_ClampFloat(newlimitmin[1], -180.0f, 0.0f);
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_ZDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_ZLIMIT)) {
- self->posechannel->limitmin[2] = EXPP_ClampFloat(newlimitmin[2], -180.0f, 0.0f);
- }
- }
- DAG_object_flush_update(G.scene, obj, OB_RECALC_DATA);
- return 0;
-}
-
-//------------------------PoseBone.limitmax (getter)
-//Gets the pose bone limitmax value
-static PyObject *PoseBone_getLimitMax(BPy_PoseBone *self, void *closure)
-{
- float mylimitmax[3];
- Object *obj = NULL;
-
- obj = Object_FromPoseChannel(self->posechannel);
- if (obj==NULL){
- return EXPP_ReturnPyObjError(PyExc_AttributeError, "Bone data is not found");
- }
- mylimitmax[0]=0.0f;
- mylimitmax[1]=0.0f;
- mylimitmax[2]=0.0f;
- if(pose_channel_in_IK_chain(obj, self->posechannel)){
- if ((self->posechannel->ikflag & BONE_IK_NO_XDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_XLIMIT)) {
- mylimitmax[0] = self->posechannel->limitmax[0];
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_YDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_YLIMIT)) {
- mylimitmax[1] = self->posechannel->limitmax[1];
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_ZDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_ZLIMIT)) {
- mylimitmax[2] = self->posechannel->limitmax[2];
- }
- }
- }
- return newVectorObject(mylimitmax, 3, Py_NEW);
-}
-//------------------------PoseBone.limitmax (setter)
-//Sets the pose bone limitmax value
-static int PoseBone_setLimitMax(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- float newlimitmax[3];
- int x;
- Object *obj = NULL;
- if(!PySequence_Check(value)){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Argument is not a sequence");
- }
- if (PySequence_Size(value) !=3){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Argument size must be 3");
- }
- newlimitmax[0]=0.0f;
- newlimitmax[1]=0.0f;
- newlimitmax[2]=0.0f;
- for (x = 0; x<3;x++){
- PyObject *item;
- item = PySequence_GetItem(value, x); //new reference
- if (PyFloat_Check(item)){
- newlimitmax[x] = (float)PyFloat_AsDouble(item);
- }else if (PyInt_Check(item)){
- newlimitmax[x] = (float)PyInt_AsLong(item);
- }
- Py_DECREF(item);
- }
- obj = Object_FromPoseChannel(self->posechannel);
- if (obj==NULL){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Bone data is not found");
- }
- if(!pose_channel_in_IK_chain(obj, self->posechannel)){
- return EXPP_ReturnIntError(PyExc_AttributeError, "Bone is not part of an IK chain");
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_XDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_XLIMIT)) {
- self->posechannel->limitmax[0] = EXPP_ClampFloat(newlimitmax[0], 0.0f, 180.0f);
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_YDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_YLIMIT)) {
- self->posechannel->limitmax[1] = EXPP_ClampFloat(newlimitmax[1], 0.0f, 180.0f);
- }
- }
- if ((self->posechannel->ikflag & BONE_IK_NO_ZDOF)==0) {
- if ((self->posechannel->ikflag & BONE_IK_ZLIMIT)) {
- self->posechannel->limitmax[2] = EXPP_ClampFloat(newlimitmax[2], 0.0f, 180.0f);
- }
- }
- DAG_object_flush_update(G.scene, obj, OB_RECALC_DATA);
- return 0;
-}
-//------------------------PoseBone.head (getter)
-//Gets the pose head position
-static PyObject *PoseBone_getHead(BPy_PoseBone *self, void *closure)
-{
- return newVectorObject(self->posechannel->pose_head, 3, Py_NEW);
-}
-//------------------------PoseBone.head (setter)
-//Sets the pose head position
-static int PoseBone_setHead(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".head: ", "not able to set this property");
-}
-//------------------------PoseBone.tail (getter)
-//Gets the pose tail position
-static PyObject *PoseBone_getTail(BPy_PoseBone *self, void *closure)
-{
- return newVectorObject(self->posechannel->pose_tail, 3, Py_NEW);
-}
-//------------------------PoseBone.tail (setter)
-//Sets the pose tail position
-static int PoseBone_setTail(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- return EXPP_intError(PyExc_AttributeError, "%s%s%s",
- sPoseBoneError, ".tail: ", "not able to set this property");
-}
-//------------------------PoseBone.sel (getter)
-//Gets the pose bones selection
-static PyObject *PoseBone_getSelect(BPy_PoseBone *self, void *closure)
-{
- if (self->posechannel->bone->flag & BONE_SELECTED)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-//------------------------PoseBone.sel (setter)
-//Sets the pose bones selection
-static int PoseBone_setSelect(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if ( param )
- self->posechannel->bone->flag |= BONE_SELECTED;
- else
- self->posechannel->bone->flag &= ~(BONE_SELECTED | BONE_ACTIVE);
- return 0;
-}
-
-
-//------------------------PoseBone.parent (getter)
-//Gets the bones parent if any
-static PyObject *PoseBone_getParent(BPy_PoseBone *self, void *closure)
-{
- if (self->posechannel->parent)
- return PyPoseBone_FromPosechannel(self->posechannel->parent);
- else
- Py_RETURN_NONE;
-}
-
-//------------------------PoseBone.displayObject (getter)
-//Gets the pose bones object used for display
-static PyObject *PoseBone_getDisplayObject(BPy_PoseBone *self, void *closure)
-{
- if (self->posechannel->custom)
- return Object_CreatePyObject(self->posechannel->custom);
- else
- Py_RETURN_NONE;
-}
-
-//------------------------PoseBone.displayObject (setter)
-//Sets the pose bones object used for display
-static int PoseBone_setDisplayObject(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- return GenericLib_assignData(value, (void **) &self->posechannel->custom, 0, 0, ID_OB, 0);
-}
-
-//------------------------PoseBone.hasIK (getter)
-//Returns True/False if the bone has IK's
-static PyObject *PoseBone_hasIK(BPy_PoseBone *self, void *closure)
-{
- Object *obj = NULL;
-
- obj = Object_FromPoseChannel(self->posechannel);
- if (obj==NULL)
- Py_RETURN_FALSE;
-
- if( pose_channel_in_IK_chain(obj, self->posechannel) )
- Py_RETURN_TRUE;
-
- Py_RETURN_FALSE;
-}
-
-//------------------------PoseBone.stretch (getter)
-//Gets the pose bones IK Stretch value
-static PyObject *PoseBone_getStretch(BPy_PoseBone *self, void *closure)
-{
- return PyFloat_FromDouble( self->posechannel->ikstretch );
-}
-
-//------------------------PoseBone.stretch (setter)
-//Sets the pose bones IK Stretch value
-static int PoseBone_setStretch(BPy_PoseBone *self, PyObject *value, void *closure)
-{
- float ikstretch;
-
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- ikstretch = (float)PyFloat_AsDouble(value);
- if (ikstretch<0) ikstretch = 0.0;
- if (ikstretch>1) ikstretch = 1.0;
- self->posechannel->ikstretch = ikstretch;
- return 0;
-}
-
-//------------------------PoseBone.stiffX/Y/Z (getter)
-//Gets the pose bones IK stiffness
-static PyObject *PoseBone_getStiff(BPy_PoseBone *self, void *axis)
-{
- return PyFloat_FromDouble( self->posechannel->stiffness[GET_INT_FROM_POINTER(axis)] );
-}
-
-//------------------------PoseBone.stiffX/Y/Z (setter)
-//Sets the pose bones IK stiffness
-static int PoseBone_setStiff(BPy_PoseBone *self, PyObject *value, void *axis)
-{
- float stiff;
-
- if( !PyNumber_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- stiff = (float)PyFloat_AsDouble(value);
- if (stiff<0) stiff = 0;
- if (stiff>0.990) stiff = 0.990f;
- self->posechannel->stiffness[GET_INT_FROM_POINTER(axis)] = stiff;
- return 0;
-}
-
-//------------------------PoseBone.* (getter)
-//Gets the pose bones flag
-/*
-static PyObject *PoseBone_getFlag(BPy_PoseBone *self, void *flag)
-{
- if (self->posechannel->flag & (int)flag)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-
-}
-*/
-
-//------------------------PoseBone.* (setter)
-//Gets the pose bones flag
-/*
-static int PoseBone_setFlag(BPy_PoseBone *self, PyObject *value, void *flag)
-{
- if ( PyObject_IsTrue(value) )
- self->posechannel->flag |= (int)flag;
- else
- self->posechannel->flag &= ~(int)flag;
- return 0;
-}
-*/
-
-//------------------------PoseBone.* (getter)
-//Gets the pose bones ikflag
-static PyObject *PoseBone_getIKFlag(BPy_PoseBone *self, void *flag)
-{
- if (self->posechannel->ikflag & GET_INT_FROM_POINTER(flag))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-
-}
-
-//------------------------PoseBone.* (setter)
-//Sets the pose bones ikflag
-static int PoseBone_setIKFlag(BPy_PoseBone *self, PyObject *value, void *flag)
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if ( param )
- self->posechannel->ikflag |= GET_INT_FROM_POINTER(flag);
- else
- self->posechannel->ikflag &= ~GET_INT_FROM_POINTER(flag);
- return 0;
-}
-
-//------------------------Bone.layerMask (get)
-static PyObject *PoseBone_getLayerMask(BPy_PoseBone *self)
-{
- /* do this extra stuff because the short's bits can be negative values */
- unsigned short laymask = 0;
- laymask |= self->posechannel->bone->layer;
- return PyInt_FromLong((int)laymask);
-}
-//------------------------Bone.layerMask (set)
-static int PoseBone_setLayerMask(BPy_PoseBone *self, PyObject *value)
-{
- int laymask;
- if (!PyInt_Check(value)) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected an integer (bitmask) as argument" );
- }
-
- laymask = PyInt_AsLong(value);
-
- if (laymask <= 0 || laymask > (1<<16) - 1)
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "bitmask must have from 1 up to 16 bits set");
-
- self->posechannel->bone->layer = 0;
- self->posechannel->bone->layer |= laymask;
-
- return 0;
-}
-
-//------------------TYPE_OBECT IMPLEMENTATION---------------------------
-//------------------------tp_getset
-//This contains methods for attributes that require checking
-static PyGetSetDef BPy_PoseBone_getset[] = {
- {"name", (getter)PoseBone_getName, (setter)PoseBone_setName,
- "The pose bone's name", NULL},
- {"loc", (getter)PoseBone_getLoc, (setter)PoseBone_setLoc,
- "The pose bone's change in location as a vector", NULL},
- {"size", (getter)PoseBone_getSize, (setter)PoseBone_setSize,
- "The pose bone's change in size as a vector", NULL},
- {"quat", (getter)PoseBone_getQuat, (setter)PoseBone_setQuat,
- "The pose bone's change in rotation as a quat", NULL},
- {"localMatrix", (getter)PoseBone_getLocalMatrix, (setter)PoseBone_setLocalMatrix,
- "The pose bone's change matrix built from the quat, loc, and size", NULL},
- {"poseMatrix", (getter)PoseBone_getPoseMatrix, (setter)PoseBone_setPoseMatrix,
- "The pose bone's matrix", NULL},
- {"head", (getter)PoseBone_getHead, (setter)PoseBone_setHead,
- "The pose bone's head positon", NULL},
- {"tail", (getter)PoseBone_getTail, (setter)PoseBone_setTail,
- "The pose bone's tail positon", NULL},
- {"sel", (getter)PoseBone_getSelect, (setter)PoseBone_setSelect,
- "The pose selection state", NULL},
- {"limitMin", (getter)PoseBone_getLimitMin, (setter)PoseBone_setLimitMin,
- "The pose bone dof min", NULL},
- {"limitMax", (getter)PoseBone_getLimitMax, (setter)PoseBone_setLimitMax,
- "The pose bone dof max", NULL},
- {"constraints", (getter)PoseBone_getConstraints, (setter)NULL,
- "The list of contraints that pertain to this pose bone", NULL},
- {"parent", (getter)PoseBone_getParent, (setter)NULL,
- "The bones parent (read only for posebones)", NULL},
- {"displayObject", (getter)PoseBone_getDisplayObject, (setter)PoseBone_setDisplayObject,
- "The poseMode object to draw in place of this bone", NULL},
-
- {"hasIK", (getter)PoseBone_hasIK, (setter)NULL,
- "True if the pose bone has IK (readonly)", NULL },
-
- {"stretch", (getter)PoseBone_getStretch, (setter)PoseBone_setStretch,
- "Stretch the bone to the IK Target", NULL },
-
- {"stiffX", (getter)PoseBone_getStiff, (setter)PoseBone_setStiff,
- "bones stiffness on the X axis", (void *)0 },
- {"stiffY", (getter)PoseBone_getStiff, (setter)PoseBone_setStiff,
- "bones stiffness on the Y axis", (void *)1 },
- {"stiffZ", (getter)PoseBone_getStiff, (setter)PoseBone_setStiff,
- "bones stiffness on the Z axis", (void *)2 },
-
- {"limitX", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "limit rotation over X axis when part of an IK", (void *)BONE_IK_XLIMIT },
- {"limitY", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "limit rotation over Y axis when part of an IK", (void *)BONE_IK_YLIMIT },
- {"limitZ", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "limit rotation over Z axis when part of an IK", (void *)BONE_IK_ZLIMIT },
-
- {"lockXRot", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "disable X DoF when part of an IK", (void *)BONE_IK_NO_XDOF },
- {"lockYRot", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "disable Y DoF when part of an IK", (void *)BONE_IK_NO_YDOF },
- {"lockZRot", (getter)PoseBone_getIKFlag, (setter)PoseBone_setIKFlag,
- "disable Z DoF when part of an IK", (void *)BONE_IK_NO_ZDOF },
- {"layerMask", (getter)PoseBone_getLayerMask, (setter)PoseBone_setLayerMask,
- "Layer bitmask", NULL },
- {NULL, NULL, NULL, NULL, NULL}
-};
-//------------------------tp_dealloc
-//This tells how to 'tear-down' our object when ref count hits 0
-static void PoseBone_dealloc(BPy_PoseBone *self)
-{
- PoseBone_Type.tp_free(self);
- return;
-}
-//------------------------tp_repr
-//This is the string representation of the object
-static PyObject *PoseBone_repr(BPy_PoseBone *self)
-{
- return PyString_FromFormat( "[PoseBone \"%s\"]", self->posechannel->name);
-}
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_PoseBone_doc[] = "This object wraps a Blender PoseBone object.";
-
-//------------------TYPE_OBECT DEFINITION--------------------------
-PyTypeObject PoseBone_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "PoseBone", //tp_name
- sizeof(BPy_PoseBone), //tp_basicsize
- 0, //tp_itemsize
- (destructor)PoseBone_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
- (reprfunc)PoseBone_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_PoseBone_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_PoseBone_methods, //tp_methods
- 0, //tp_members
- BPy_PoseBone_getset, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//-------------------MODULE METHODS IMPLEMENTATION------------------------
-//-------------------MODULE METHODS DEFINITION-----------------------------
-struct PyMethodDef M_Pose_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-//-------------------MODULE INITIALIZATION--------------------------------
-PyObject *Pose_Init(void)
-{
- PyObject *module;
-
- //Initializes TypeObject.ob_type
- if (PyType_Ready(&Pose_Type) < 0 || PyType_Ready(&PoseBone_Type) < 0 ||
- PyType_Ready(&PoseBonesDict_Type) < 0) {
- Py_RETURN_NONE;
- }
-
- //Register the module
- module = Py_InitModule3("Blender.Object.Pose", M_Pose_methods,
- "The Blender Pose module");
-
- //Add TYPEOBJECTS to the module
- PyModule_AddObject(module, "Pose",
- EXPP_incr_ret((PyObject *)&Pose_Type)); //*steals*
- PyModule_AddObject(module, "PoseBone",
- EXPP_incr_ret((PyObject *)&PoseBone_Type)); //*steals*
-
- //Add CONSTANTS to the module
- PyModule_AddObject(module, "ROT",
- PyConstant_NewInt("ROT", POSE_ROT));
- PyModule_AddObject(module, "LOC",
- PyConstant_NewInt("LOC", POSE_LOC));
- PyModule_AddObject(module, "SIZE",
- PyConstant_NewInt("SIZE", POSE_SIZE));
-
- return module;
-}
-//------------------VISIBLE PROTOTYPE IMPLEMENTATION-----------------------
-//------------------------------PyPose_FromPose (internal)
-//Returns a PyPose from a bPose - return PyNone if bPose is NULL
-PyObject *PyPose_FromPose(bPose *pose, char *name)
-{
- BPy_Pose *py_pose = NULL;
-
- if (pose){
- py_pose = (BPy_Pose*)Pose_Type.tp_alloc(&Pose_Type, 0);
- if (!py_pose)
- goto RuntimeError;
-
- py_pose->pose = pose;
- BLI_strncpy(py_pose->name, name, 24);
-
- //create armature.bones
- py_pose->Bones = (BPy_PoseBonesDict*)PyPoseBonesDict_FromPyPose(py_pose);
- if (!py_pose->Bones)
- goto RuntimeError;
-
- return (PyObject*)py_pose;
- }else{
- Py_RETURN_NONE;
- }
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sPoseError, "PyPose_FromPose: ", "Internal Error Ocurred");
-}
-//------------------------------PyPoseBone_FromPosechannel (internal)
-//Returns a PyPoseBone from a bPoseChannel - return PyNone if bPoseChannel is NULL
-PyObject *PyPoseBone_FromPosechannel(bPoseChannel *pchan)
-{
- BPy_PoseBone *py_posechannel = NULL;
-
- if (pchan){
- py_posechannel = (BPy_PoseBone*)PoseBone_Type.tp_alloc(&PoseBone_Type, 0);
- if (!py_posechannel)
- goto RuntimeError;
- py_posechannel->posechannel = pchan;
- return (PyObject*)py_posechannel;
- }else{
- Py_RETURN_NONE;
- }
-
-RuntimeError:
- return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
- sPoseBoneError, "PyPoseBone_FromPosechannel: ", "Internal Error Ocurred");
-}
-//------------------------------Object_FromPoseChannel (internal)
-//An ugly method for determining where the pchan chame from
-Object *Object_FromPoseChannel(bPoseChannel *curr_pchan)
-{
- int success = 0;
- Object *obj = NULL;
- bPoseChannel *pchan = NULL;
- for(obj = G.main->object.first; obj; obj = obj->id.next){
- if (obj->pose){
- for (pchan = obj->pose->chanbase.first; pchan; pchan = pchan->next){
- if (curr_pchan == pchan){
- success = 1;
- break;
- }
- }
- if (success)
- break;
- }
- }
- return obj;
-}
diff --git a/source/blender/python/api2_2x/Pose.h b/source/blender/python/api2_2x/Pose.h
deleted file mode 100644
index f94b82662cb..00000000000
--- a/source/blender/python/api2_2x/Pose.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_POSE_H
-#define EXPP_POSE_H
-
-#include <Python.h>
-#include "DNA_action_types.h"
-#include "DNA_object_types.h"
-
-//-------------------TYPE CHECKS---------------------------------
-#define BPy_Pose_Check(v) ((v)->ob_type == &Pose_Type)
-#define BPy_PoseBone_Check(v) ((v)->ob_type == &PoseBone_Type)
-#define BPy_PoseBonesDict_Check(v) ((v)->ob_type == &PoseBonesDict_Type)
-//-------------------TYPEOBJECT----------------------------------
-extern PyTypeObject Pose_Type;
-extern PyTypeObject PoseBone_Type;
-extern PyTypeObject PoseBonesDict_Type;
-//-------------------STRUCT DEFINITION----------------------------
-typedef struct {
- PyObject_HEAD
- PyObject *bonesMap;
- ListBase *bones;
-} BPy_PoseBonesDict;
-
-typedef struct {
- PyObject_HEAD
- bPose *pose;
- char name[24]; //because poses have not names :(
- BPy_PoseBonesDict *Bones;
-} BPy_Pose;
-
-typedef struct {
- PyObject_HEAD
- bPoseChannel *posechannel;
-
-} BPy_PoseBone;
-
-//-------------------VISIBLE PROTOTYPES-------------------------
-PyObject *Pose_Init(void);
-PyObject *PyPose_FromPose(bPose *pose, char *name);
-PyObject *PyPoseBone_FromPosechannel(bPoseChannel *pchan);
-Object *Object_FromPoseChannel(bPoseChannel *curr_pchan);
-#endif
diff --git a/source/blender/python/api2_2x/Registry.c b/source/blender/python/api2_2x/Registry.c
deleted file mode 100644
index ea0d7170e03..00000000000
--- a/source/blender/python/api2_2x/Registry.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Registry.h" /*This must come first */
-
-#include "BKE_global.h"
-#include "gen_utils.h"
-
-
-/* the Registry dictionary */
-PyObject *bpy_registryDict = NULL;
-
-/*****************************************************************************/
-/* Python API function prototypes for the Registry module. */
-/*****************************************************************************/
-static PyObject *M_Registry_Keys( PyObject * self );
-static PyObject *M_Registry_GetKey( PyObject * self, PyObject * args );
-static PyObject *M_Registry_SetKey( PyObject * self, PyObject * args );
-static PyObject *M_Registry_RemoveKey( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Registry.__doc__ */
-/*****************************************************************************/
-char M_Registry_doc[] =
- "The Blender Registry module (persistent data cache)\n\n\
- Use this module to store configuration data that a script can reload\n\
- when it is executed again.\n";
-
-char M_Registry_Keys_doc[] =
- "() - Get all keys in the Registry dictionary.\n\n\
- Each key references another dict with saved data from a specific script.\n";
-
-char M_Registry_GetKey_doc[] =
- "(name, disk = False) - Get an entry (a dict) from the Registry dictionary\n\
- (name) - a string that references a specific script;\n\
- (disk = False) - search on the user (if available) or default scripts config\n\
-data dir.\n";
-
-char M_Registry_SetKey_doc[] =
- "(key, dict, disk = False) - Store an entry in the Registry dictionary.\n\
- If an entry with the same 'key' already exists, it is substituted.\n\
- (key) - the string to use as a key for the dict being saved.\n\
- (dict) - a dictionary with the data to be stored.\n\
- (disk = False) - also write data as a config file inside the user (if\n\
-available) or default scripts config data dir.\n";
-
-char M_Registry_RemoveKey_doc[] =
- "(key, disk = False) - Remove the dict with key 'key' from the Registry.\n\
- (key) - the name of the key to delete;\n\
- (disk = False) - if True the respective config file is also deleted.\n";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Registry module: */
-/*****************************************************************************/
-struct PyMethodDef M_Registry_methods[] = {
- {"Keys", ( PyCFunction ) M_Registry_Keys, METH_VARARGS,
- M_Registry_Keys_doc},
- {"GetKey", M_Registry_GetKey, METH_VARARGS, M_Registry_GetKey_doc},
- {"SetKey", M_Registry_SetKey, METH_VARARGS, M_Registry_SetKey_doc},
- {"RemoveKey", M_Registry_RemoveKey, METH_VARARGS,
- M_Registry_RemoveKey_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Function: M_Registry_Keys */
-/* Python equivalent: Blender.Registry.Keys */
-/*****************************************************************************/
-PyObject *M_Registry_Keys( PyObject * self )
-{
- PyObject *pydict = NULL;
-
- if( !bpy_registryDict )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "No Registry dictionary found!" );
-
- pydict = PyDict_Keys( bpy_registryDict );
-
- if( !pydict )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Registry_Keys: couldn't get keys" );
-
- return pydict;
-}
-
-/*****************************************************************************/
-/* Function: M_Registry_GetKey */
-/* Python equivalent: Blender.Registry.GetKey */
-/*****************************************************************************/
-static PyObject *M_Registry_GetKey( PyObject * self, PyObject * args )
-{
- PyObject *pyentry = NULL;
- PyObject *pydict = NULL;
- int disk = 0;
-
- if( !bpy_registryDict )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "No Registry dictionary found!" );
-
- if( !PyArg_ParseTuple( args, "O!|i", &PyString_Type, &pyentry, &disk ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a string and optionally a bool" );
-
- pydict = PyDict_GetItem( bpy_registryDict, pyentry ); /* borrowed ... */
-
- if (!pydict) {
- if (disk > 0) {
- /* try to get data from disk */
- char buf[256];
- PyOS_snprintf(buf, sizeof(buf),
- "import Blender, BPyRegistry; BPyRegistry.LoadConfigData('%s')",
- PyString_AsString(pyentry));
- if (!PyRun_SimpleString(buf))
- pydict = PyDict_GetItem(bpy_registryDict, pyentry);
- else PyErr_Clear();
- }
-
- if (!pydict) /* no need to return a KeyError, since without doubt */
- pydict = Py_None; /* Py_None means no key (all valid keys are dicts) */
- }
-
- return EXPP_incr_ret (pydict); /* ... so we incref it */
-}
-
-/*****************************************************************************/
-/* Function: M_Registry_SetKey */
-/* Python equivalent: Blender.Registry.SetKey */
-/*****************************************************************************/
-static PyObject *M_Registry_SetKey( PyObject * self, PyObject * args )
-{
- PyObject *pystr = NULL;
- PyObject *pydict = NULL;
- int disk = 0;
-
- if( !bpy_registryDict )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "No Registry dictionary found!" );
-
- if( !PyArg_ParseTuple( args, "O!O!|i",
- &PyString_Type, &pystr, &PyDict_Type,
- &pydict, &disk ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a string and a dictionary" );
-
- if( PyDict_SetItem( bpy_registryDict, pystr, pydict ) ) /* 0 on success */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Registry_SetKey: couldn't update the Registry dict" );
-
- if (disk) {
- /* try to save data to disk */
- char buf[256];
- PyOS_snprintf(buf, sizeof(buf),
- "import Blender, BPyRegistry; BPyRegistry.SaveConfigData('%s')",
- PyString_AsString(pystr));
- if (PyRun_SimpleString(buf) != 0) {
- PyErr_Clear();
- if (G.f & G_DEBUG)
- fprintf(stderr, "\nCan't save script configuration data!\n");
- }
- }
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/*****************************************************************************/
-/* Function: M_Registry_RemoveKey */
-/* Python equivalent: Blender.Registry.RemoveKey */
-/*****************************************************************************/
-static PyObject *M_Registry_RemoveKey( PyObject * self, PyObject * args )
-{
- PyObject *pystr = NULL;
- int disk = 0;
-
- if( !bpy_registryDict )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "No Registry dictionary found!" );
-
- if( !PyArg_ParseTuple( args, "O!|i", &PyString_Type, &pystr, &disk ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a string and optionally a bool" );
-
- if( PyDict_DelItem( bpy_registryDict, pystr ) ) /* returns 0 on success */
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "no such key in the Registry" );
- else if (disk) {
- /* try to delete from disk too */
- char buf[256];
- PyOS_snprintf(buf, sizeof(buf),
- "import Blender, BPyRegistry; BPyRegistry.RemoveConfigData('%s')",
- PyString_AsString(pystr));
- if (PyRun_SimpleString(buf) != 0) {
- PyErr_Clear();
- if (G.f & G_DEBUG)
- fprintf(stderr, "\nCan't remove script configuration data file!\n");
- }
- }
-
- Py_INCREF( Py_None );
- return Py_None;
-}
-
-/*****************************************************************************/
-/* Function: Registry_Init */
-/*****************************************************************************/
-PyObject *Registry_Init( void )
-{
- PyObject *submodule;
-
- submodule = Py_InitModule3( "Blender.Registry", M_Registry_methods,
- M_Registry_doc );
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Registry.h b/source/blender/python/api2_2x/Registry.h
deleted file mode 100644
index 4a1fc55a36a..00000000000
--- a/source/blender/python/api2_2x/Registry.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* This submodule was introduced as a way to preserve configured data in
- * scripts. A very simple idea: the script writer saves this data in a dict
- * and registers this dict in the "Registry" dict. This way we can discard
- * the global interpreter dictionary after a script is executed, since the
- * data meant to be kept was copied to the Registry elsewhere. The current
- * implementation is naive: scripts can deliberately mess with data saved by
- * other scripts. This is so new script versions can delete older entries, if
- * they need to. XXX Or should we block this? */
-
-#ifndef EXPP_REGISTRY_H
-#define EXPP_REGISTRY_H
-
-#include <Python.h>
-
-extern PyObject *bpy_registryDict;
-PyObject *Registry_Init( void );
-
-#endif /* EXPP_REGISTRY_H */
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
deleted file mode 100644
index 8a2be2391a4..00000000000
--- a/source/blender/python/api2_2x/Scene.c
+++ /dev/null
@@ -1,1873 +0,0 @@
-/*
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Jacques Guignot, Joseph Gilbert,
- * Campbell Barton, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-struct View3D;
-
-#include "Scene.h" /*This must come first */
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "MEM_guardedalloc.h" /* for MEM_callocN */
-#include "DNA_space_types.h" /* SPACE_VIEW3D, SPACE_SEQ */
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h" /* U.userdefs */
-#include "DNA_object_types.h" /* SceneObSeq_new */
-#include "BKE_armature.h"
-#include "BKE_depsgraph.h"
-#include "BKE_library.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_font.h"
-#include "BKE_idprop.h"
-#include "BLI_blenlib.h" /* only for SceneObSeq_new */
-#include "BSE_drawview.h" /* for play_anim */
-#include "BSE_headerbuttons.h" /* for copy_scene */
-#include "BSE_sequence.h" /* to clear_scene_in_allseqs */
-#include "BSE_node.h" /* to clear_scene_in_nodes */
-#include "BIF_drawscene.h" /* for set_scene */
-#include "BIF_space.h" /* for copy_view3d_lock() */
-#include "BIF_screen.h" /* curarea */
-#include "BDR_editobject.h" /* free_and_unlink_base() */
-#include "mydevice.h" /* for #define REDRAW */
-#include "DNA_view3d_types.h"
-
-/* python types */
-#include "Object.h"
-#include "Camera.h"
-/* only for SceneObSeq_new */
-#include "BKE_material.h"
-#include "BLI_arithb.h"
-#include "Armature.h"
-#include "Lamp.h"
-#include "Curve.h"
-#include "NMesh.h"
-#include "Mesh.h"
-#include "World.h"
-#include "Lattice.h"
-#include "Metaball.h"
-#include "IDProp.h"
-#include "Text3d.h"
-#include "Library.h"
-
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "sceneRender.h"
-#include "sceneRadio.h"
-#include "sceneTimeLine.h"
-#include "sceneSequence.h"
-
-
-#include "BKE_utildefines.h" /* vec copy */
-#include "vector.h"
-
-PyObject *M_Object_Get( PyObject * self, PyObject * args ); /* from Object.c */
-
-/* checks for the scene being removed */
-#define SCENE_DEL_CHECK_PY(bpy_scene) if (!(bpy_scene->scene)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Scene has been removed" ) )
-#define SCENE_DEL_CHECK_INT(bpy_scene) if (!(bpy_scene->scene)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Scene has been removed" ) )
-
-
-enum obj_consts {
- EXPP_OBSEQ_NORMAL = 0,
- EXPP_OBSEQ_SELECTED,
- EXPP_OBSEQ_CONTEXT
-};
-
-
-/*-----------------------Python API function prototypes for the Scene module--*/
-static PyObject *M_Scene_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_Scene_Get( PyObject * self, PyObject * args );
-static PyObject *M_Scene_GetCurrent( PyObject * self );
-static PyObject *M_Scene_getCurrent_deprecated( PyObject * self );
-static PyObject *M_Scene_Unlink( PyObject * self, PyObject * arg );
-/*-----------------------Scene module doc strings-----------------------------*/
-static char M_Scene_doc[] = "The Blender.Scene submodule";
-static char M_Scene_New_doc[] =
- "(name = 'Scene') - Create a new Scene called 'name' in Blender.";
-static char M_Scene_Get_doc[] =
- "(name = None) - Return the scene called 'name'. If 'name' is None, return a list with all Scenes.";
-static char M_Scene_GetCurrent_doc[] =
- "() - Return the currently active Scene in Blender.";
-static char M_Scene_Unlink_doc[] =
- "(scene) - Unlink (delete) scene 'Scene' from Blender. (scene) is of type Blender scene.";
-/*----------------------Scene module method def----------------------------*/
-struct PyMethodDef M_Scene_methods[] = {
- {"New", ( PyCFunction ) M_Scene_New, METH_VARARGS | METH_KEYWORDS,
- M_Scene_New_doc},
- {"Get", M_Scene_Get, METH_VARARGS, M_Scene_Get_doc},
- {"get", M_Scene_Get, METH_VARARGS, M_Scene_Get_doc},
- {"GetCurrent", ( PyCFunction ) M_Scene_GetCurrent,
- METH_NOARGS, M_Scene_GetCurrent_doc},
- {"getCurrent", ( PyCFunction ) M_Scene_getCurrent_deprecated,
- METH_NOARGS, M_Scene_GetCurrent_doc},
- {"Unlink", M_Scene_Unlink, METH_VARARGS, M_Scene_Unlink_doc},
- {"unlink", M_Scene_Unlink, METH_VARARGS, M_Scene_Unlink_doc},
- {NULL, NULL, 0, NULL}
-};
-/*-----------------------BPy_Scene method declarations--------------------*/
-static PyObject *Scene_getLayerList( BPy_Scene * self );
-static PyObject *Scene_oldsetLayers( BPy_Scene * self, PyObject * arg );
-static PyObject *Scene_copy( BPy_Scene * self, PyObject * arg );
-static PyObject *Scene_makeCurrent( BPy_Scene * self );
-static PyObject *Scene_update( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_link( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_unlink( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_getChildren( BPy_Scene * self );
-static PyObject *Scene_getActiveObject(BPy_Scene *self);
-static PyObject *Scene_getCurrentCamera( BPy_Scene * self );
-static PyObject *Scene_setCurrentCamera( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_getRenderingContext( BPy_Scene * self );
-static PyObject *Scene_getRadiosityContext( BPy_Scene * self );
-static PyObject *Scene_getScriptLinks( BPy_Scene * self, PyObject * value );
-static PyObject *Scene_getSequence( BPy_Scene * self );
-static PyObject *Scene_addScriptLink( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_clearScriptLinks( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_play( BPy_Scene * self, PyObject * args );
-static PyObject *Scene_getTimeLine( BPy_Scene * self );
-
-
-/*internal*/
-static int Scene_compare( BPy_Scene * a, BPy_Scene * b );
-static PyObject *Scene_repr( BPy_Scene * self );
-
-/*object seq*/
-static PyObject *SceneObSeq_CreatePyObject( BPy_Scene *self, Base *iter, int mode);
-
-/*-----------------------BPy_Scene method def------------------------------*/
-static PyMethodDef BPy_Scene_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Scene name"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - Change Scene name"},
- {"getLayers", ( PyCFunction ) Scene_getLayerList, METH_NOARGS,
- "() - Return a list of layers int indices which are set in this scene "},
- {"setLayers", ( PyCFunction ) Scene_oldsetLayers, METH_VARARGS,
- "(layers) - Change layers which are set in this scene\n"
- "(layers) - list of integers in the range [1, 20]."},
- {"copy", ( PyCFunction ) Scene_copy, METH_VARARGS,
- "(duplicate_objects = 1) - Return a copy of this scene\n"
- "The optional argument duplicate_objects defines how the scene\n"
- "children are duplicated:\n\t0: Link Objects\n\t1: Link Object Data"
- "\n\t2: Full copy\n"},
- {"makeCurrent", ( PyCFunction ) Scene_makeCurrent, METH_NOARGS,
- "() - Make self the current scene"},
- {"update", ( PyCFunction ) Scene_update, METH_VARARGS,
- "(full = 0) - Update scene self.\n"
- "full = 0: sort the base list of objects."
- "full = 1: full update -- also regroups, does ipos, keys"},
- {"link", ( PyCFunction ) Scene_link, METH_VARARGS,
- "(obj) - Link Object obj to this scene"},
- {"unlink", ( PyCFunction ) Scene_unlink, METH_VARARGS,
- "(obj) - Unlink Object obj from this scene"},
- {"getChildren", ( PyCFunction ) Scene_getChildren, METH_NOARGS,
- "() - Return list of all objects linked to this scene"},
- {"getActiveObject", (PyCFunction)Scene_getActiveObject, METH_NOARGS,
- "() - Return this scene's active object"},
- {"getCurrentCamera", ( PyCFunction ) Scene_getCurrentCamera,
- METH_NOARGS,
- "() - Return current active Camera"},
- {"getScriptLinks", ( PyCFunction ) Scene_getScriptLinks, METH_O,
- "(eventname) - Get a list of this scene's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, OnLoad, OnSave, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) Scene_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new scene scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, OnLoad, OnSave, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) Scene_clearScriptLinks,
- METH_VARARGS,
- "() - Delete all scriptlinks from this scene.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this scene."},
- {"setCurrentCamera", ( PyCFunction ) Scene_setCurrentCamera,
- METH_VARARGS,
- "() - Set the currently active Camera"},
- {"getRenderingContext", ( PyCFunction ) Scene_getRenderingContext,
- METH_NOARGS,
- "() - Get the rendering context for the scene and return it as a BPy_RenderData"},
- {"getRadiosityContext", ( PyCFunction ) Scene_getRadiosityContext,
- METH_NOARGS,
- "() - Get the radiosity context for this scene."},
- {"play", ( PyCFunction ) Scene_play, METH_VARARGS,
- "(mode = 0, win = VIEW3D) - Play realtime animation in Blender"
- " (not rendered).\n"
- "(mode) - int:\n"
- "\t0 - keep playing in biggest given 'win';\n"
- "\t1 - keep playing in all 'win', VIEW3D and SEQ windows;\n"
- "\t2 - play once in biggest given 'win';\n"
- "\t3 - play once in all 'win', VIEW3D and SEQ windows.\n"
- "(win) - int: see Blender.Window.Types. Only these are meaningful here:"
- "VIEW3D, SEQ, IPO, ACTION, NLA, SOUND. But others are also accepted, "
- "since they can be used just as an interruptible timer. If 'win' is not"
- "available or invalid, VIEW3D is tried, then any bigger window."
- "Returns 0 for normal exit or 1 when canceled by user input."},
- {"getTimeLine", ( PyCFunction ) Scene_getTimeLine, METH_NOARGS,
- "() - Get time line of this Scene"},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Python BPy_Scene getsetattr funcs: */
-/*****************************************************************************/
-static PyObject *Scene_getLayerMask( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
- return PyInt_FromLong( self->scene->lay & ((1<<20)-1) );
-}
-
-static int Scene_setLayerMask( BPy_Scene * self, PyObject * value )
-{
- int laymask = 0;
-
- SCENE_DEL_CHECK_INT(self);
-
- if (!PyInt_Check(value)) {
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected an integer (bitmask) as argument" );
- }
-
- laymask = PyInt_AsLong(value);
-
- if (laymask <= 0 || laymask > (1<<20) - 1) /* binary: 1111 1111 1111 1111 1111 */
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "bitmask must have from 1 up to 20 bits set");
-
- self->scene->lay = laymask;
- /* if this is the current scene then apply the scene layers value
- * to the view layers value: */
- if (G.vd && (self->scene == G.scene)) {
- int val, bit = 0;
- G.vd->lay = laymask;
-
- while( bit < 20 ) {
- val = 1 << bit;
- if( laymask & val ) {
- G.vd->layact = val;
- break;
- }
- bit++;
- }
- }
-
- return 0;
-}
-
-static PyObject *Scene_getLayerList( BPy_Scene * self )
-{
- PyObject *laylist, *item;
- int layers, bit = 0, val = 0;
-
- SCENE_DEL_CHECK_PY(self);
-
- laylist = PyList_New( 0 );
-
- if( !laylist )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create pylist!" ) );
-
- layers = self->scene->lay;
-
- while( bit < 20 ) {
- val = 1 << bit;
- if( layers & val ) {
- item = Py_BuildValue( "i", bit + 1 );
- PyList_Append( laylist, item );
- Py_DECREF( item );
- }
- bit++;
- }
- return laylist;
-}
-
-static int Scene_setLayerList( BPy_Scene * self, PyObject * value )
-{
- PyObject *item = NULL;
- int layers = 0, val, i, len_list;
-
- SCENE_DEL_CHECK_INT(self);
-
- if( !PySequence_Check( value ) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of integers in the range [1, 20]" ) );
-
- len_list = PySequence_Size(value);
-
- if (len_list == 0)
- return ( EXPP_ReturnIntError( PyExc_AttributeError,
- "list can't be empty, at least one layer must be set" ) );
-
- for( i = 0; i < len_list; i++ ) {
- item = PySequence_GetItem( value, i );
-
- if( !PyInt_Check( item ) ) {
- Py_DECREF( item );
- return EXPP_ReturnIntError
- ( PyExc_AttributeError,
- "list must contain only integer numbers" );
- }
-
- val = ( int ) PyInt_AsLong( item );
- if( val < 1 || val > 20 )
- return EXPP_ReturnIntError
- ( PyExc_AttributeError,
- "layer values must be in the range [1, 20]" );
-
- layers |= 1 << ( val - 1 );
- }
- self->scene->lay = layers;
-
- if (G.vd && (self->scene == G.scene)) {
- int bit = 0;
- G.vd->lay = layers;
-
- while( bit < 20 ) {
- val = 1 << bit;
- if( layers & val ) {
- G.vd->layact = val;
- break;
- }
- bit++;
- }
- }
-
- return 0;
-}
-
-static PyObject *Scene_getWorld( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
-
- if (!self->scene->world)
- Py_RETURN_NONE;
- return World_CreatePyObject(self->scene->world);
-}
-
-static int Scene_setWorld( BPy_Scene * self, PyObject * value )
-{
- SCENE_DEL_CHECK_INT(self);
- return GenericLib_assignData(value, (void **) &self->scene->world, NULL, 1, ID_WO, 0);
-}
-
-/* accessed from scn.objects */
-static PyObject *Scene_getObjects( BPy_Scene *self)
-{
- SCENE_DEL_CHECK_PY(self);
- return SceneObSeq_CreatePyObject(self, NULL, 0);
-}
-
-static PyObject *Scene_getCursor( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
- return newVectorObject( self->scene->cursor, 3, Py_WRAP );
-}
-
-static int Scene_setCursor( BPy_Scene * self, PyObject * value )
-{
- VectorObject *bpy_vec;
- SCENE_DEL_CHECK_INT(self);
- if (!VectorObject_Check(value))
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected a vector" ) );
-
- bpy_vec = (VectorObject *)value;
-
- if (bpy_vec->size != 3)
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "can only assign a 3D vector" ) );
-
- VECCOPY(self->scene->cursor, bpy_vec->vec);
- return 0;
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Scene_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"Layers",
- (getter)Scene_getLayerMask, (setter)Scene_setLayerMask,
- "Scene layer bitmask",
- NULL},
- {"layers",
- (getter)Scene_getLayerList, (setter)Scene_setLayerList,
- "Scene layer list",
- NULL},
- {"world",
- (getter)Scene_getWorld, (setter)Scene_setWorld,
- "Scene layer bitmask",
- NULL},
- {"cursor",
- (getter)Scene_getCursor, (setter)Scene_setCursor,
- "Scene layer bitmask",
- NULL},
- {"timeline",
- (getter)Scene_getTimeLine, (setter)NULL,
- "Scenes timeline (read only)",
- NULL},
- {"render",
- (getter)Scene_getRenderingContext, (setter)NULL,
- "Scenes rendering context (read only)",
- NULL},
- {"radiosity",
- (getter)Scene_getRadiosityContext, (setter)NULL,
- "Scenes radiosity context (read only)",
- NULL},
- {"sequence",
- (getter)Scene_getSequence, (setter)NULL,
- "Scene sequencer data (read only)",
- NULL},
-
- {"objects",
- (getter)Scene_getObjects, (setter)NULL,
- "Scene object iterator",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-
-/*-----------------------BPy_Scene method def------------------------------*/
-PyTypeObject Scene_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Scene", /* tp_name */
- sizeof( BPy_Scene ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Scene_compare, /* tp_compare */
- ( reprfunc ) Scene_repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Scene_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Scene_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*-----------------------Scene module Init())-----------------------------*/
-PyObject *Scene_Init( void )
-{
-
- PyObject *submodule;
- PyObject *dict;
-
- if( PyType_Ready( &Scene_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &SceneObSeq_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Scene", M_Scene_methods, M_Scene_doc );
-
- dict = PyModule_GetDict( submodule );
- PyDict_SetItemString( dict, "Render", Render_Init( ) );
- PyDict_SetItemString( dict, "Radio", Radio_Init( ) );
- PyDict_SetItemString( dict, "Sequence", Sequence_Init( ) );
- PyDict_SetItemString( dict, "TimeLine", TimeLine_Init( ) );
-
- return submodule;
-}
-
-/*-----------------------compare----------------------------------------*/
-static int Scene_compare( BPy_Scene * a, BPy_Scene * b )
-{
- return ( a->scene == b->scene ) ? 0 : -1;
-}
-
-/*----------------------repr--------------------------------------------*/
-static PyObject *Scene_repr( BPy_Scene * self )
-{
- if( !(self->scene) )
- return PyString_FromString( "[Scene - Removed]");
- else
- return PyString_FromFormat( "[Scene \"%s\"]",
- self->scene->id.name + 2 );
-}
-
-/*-----------------------CreatePyObject---------------------------------*/
-PyObject *Scene_CreatePyObject( Scene * scene )
-{
- BPy_Scene *pyscene;
-
- pyscene = ( BPy_Scene * ) PyObject_NEW( BPy_Scene, &Scene_Type );
-
- if( !pyscene )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Scene object" );
-
- pyscene->scene = scene;
-
- return ( PyObject * ) pyscene;
-}
-
-/*-----------------------FromPyObject-----------------------------------*/
-static Scene *Scene_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Scene * ) pyobj )->scene;
-}
-
-/*-----------------------Scene module function defintions---------------*/
-/*-----------------------Scene.New()------------------------------------*/
-static PyObject *M_Scene_New( PyObject * self, PyObject * args,
- PyObject * kword )
-{
- char *name = "Scene";
- char *kw[] = { "name", NULL };
- PyObject *pyscene; /* for the Scene object wrapper in Python */
- Scene *blscene; /* for the actual Scene we create in Blender */
-
- if( !PyArg_ParseTupleAndKeywords( args, kword, "|s", kw, &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a string or an empty argument list" ) );
-
- blscene = add_scene( name ); /* first create the Scene in Blender */
-
- if( blscene ) {
- /* normally, for most objects, we set the user count to zero here.
- * Scene is different than most objs since it is the container
- * for all the others. Since add_scene() has already set
- * the user count to one, we leave it alone.
- */
-
- /* now create the wrapper obj in Python */
- pyscene = Scene_CreatePyObject( blscene );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Scene obj in Blender" ) );
-
- if( pyscene == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Scene PyObject" ) );
-
- return pyscene;
-}
-
-/*-----------------------Scene.Get()------------------------------------*/
-static PyObject *M_Scene_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Scene *scene_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- scene_iter = G.main->scene.first;
-
- if( name ) { /* (name) - Search scene by name */
-
- PyObject *wanted_scene = NULL;
-
- for(;scene_iter; scene_iter = scene_iter->id.next) {
- if( strcmp( name, scene_iter->id.name + 2 ) == 0 ) {
- wanted_scene = Scene_CreatePyObject( scene_iter );
- break;
- }
- }
-
- if( wanted_scene == NULL ) { /* Requested scene doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Scene \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return wanted_scene;
- }
-
- else { /* () - return a list with wrappers for all scenes in Blender */
- int index = 0;
- PyObject *sce_pylist, *pyobj;
-
- sce_pylist = PyList_New( BLI_countlist( &( G.main->scene ) ) );
-
- if( sce_pylist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- for(; scene_iter; scene_iter = scene_iter->id.next, index++) {
- pyobj = Scene_CreatePyObject( scene_iter );
-
- if( !pyobj ) {
- Py_DECREF(sce_pylist);
- return NULL; /* Scene_CreatePyObject sets an error */
- }
- PyList_SET_ITEM( sce_pylist, index, pyobj );
- }
-
- return sce_pylist;
- }
-}
-
-/*-----------------------Scene.GetCurrent()------------------------------*/
-static PyObject *M_Scene_GetCurrent( PyObject * self )
-{
- return Scene_CreatePyObject( ( Scene * ) G.scene );
-}
-
-static PyObject *M_Scene_getCurrent_deprecated( PyObject * self )
-{
- static char warning = 1;
- if( warning ) {
- printf("Blender.Scene.getCurrent() is deprecated,\n\tuse Blender.Scene.GetCurrent() instead.\n");
- --warning;
- }
-
- return Scene_CreatePyObject( ( Scene * ) G.scene );
-}
-
-
-/*-----------------------Scene.Unlink()----------------------------------*/
-static PyObject *M_Scene_Unlink( PyObject * self, PyObject * args )
-{
- PyObject *pyobj;
- BPy_Scene *pyscn;
- Scene *scene, *sce;
- bScreen *sc;
-
- if( !PyArg_ParseTuple( args, "O!", &Scene_Type, &pyobj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Scene PyType object" );
-
- pyscn = (BPy_Scene *)pyobj;
- scene = pyscn->scene;
-
- SCENE_DEL_CHECK_PY(pyscn);
-
- if( scene == G.scene )
- return EXPP_ReturnPyObjError( PyExc_SystemError,
- "current Scene cannot be removed!" );
-
- /* Copied from header_info.c */
-
- /* check all sets */
- for (sce= G.main->scene.first; sce; sce= sce->id.next) {
- if(sce->set == scene) sce->set= 0;
- }
-
- /* check all sequences */
- clear_scene_in_allseqs(scene);
-
- /* check render layer nodes in other scenes */
- clear_scene_in_nodes(scene);
-
- for (sc= G.main->screen.first; sc; sc= sc->id.next ) {
- if(sc->scene == scene) sc->scene= G.scene;
- }
-
- free_libblock( &G.main->scene, scene );
-
- pyscn->scene= NULL;
- Py_RETURN_NONE;
-}
-
-/* DEPRECATE ME !!! */
-/*-----------------------BPy_Scene function defintions-------------------*/
-
-/*-----------------------Scene.setLayers()---------------------------------*/
-static PyObject *Scene_oldsetLayers( BPy_Scene * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Scene_setLayerList );
-}
-/* END DEPRECATE CODE */
-
-
-/*-----------------------Scene.copy()------------------------------------*/
-static PyObject *Scene_copy( BPy_Scene * self, PyObject * args )
-{
- short dup_objs = 2;
- Scene *scene = self->scene;
-
- SCENE_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "|h", &dup_objs ) || dup_objs < 0 || dup_objs > 2)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int in [0,2] or nothing as argument" );
-
- return Scene_CreatePyObject( copy_scene( scene, dup_objs+1 ) );
-}
-
-/*-----------------------Scene.makeCurrent()-----------------------------*/
-static PyObject *Scene_makeCurrent( BPy_Scene * self )
-{
- Scene *scene = self->scene;
-#if 0 /* add back in when bpy becomes "official" */
- static char warning = 1;
- if( warning ) {
- printf("scene.makeCurrent() deprecated!\n\tuse bpy.scenes.active = scene instead\n");
- --warning;
- }
-#endif
-
- SCENE_DEL_CHECK_PY(self);
-
- if( scene && scene != G.scene) {
- set_scene( scene );
- scene_update_for_newframe(scene, scene->lay);
- }
-
- Py_RETURN_NONE;
-}
-
-/*-----------------------Scene.update()----------------------------------*/
-static PyObject *Scene_update( BPy_Scene * self, PyObject * args )
-{
- Scene *scene = self->scene;
- int full = 0;
-
- SCENE_DEL_CHECK_PY(self);
- if( !PyArg_ParseTuple( args, "|i", &full ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or int (0 or 1) argument" );
-
-/* Under certain circunstances, DAG_scene_sort *here* can crash Blender.
- * A "RuntimeError: max recursion limit" happens when a scriptlink
- * on frame change has scene.update(1).
- * Investigate better how to avoid this. */
- if( !full )
- DAG_scene_sort( scene );
-
- else if( full == 1 ) {
- int enablescripts = G.f & G_DOSCRIPTLINKS;
-
- /*Disable scriptlinks to prevent firing off newframe scriptlink
- events.*/
- G.f &= ~G_DOSCRIPTLINKS;
- set_scene_bg( scene );
- scene_update_for_newframe( scene, scene->lay );
-
- /*re-enabled scriptlinks if necassary.*/
- if (enablescripts) G.f |= G_DOSCRIPTLINKS;
- } else
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "in method scene.update(full), full should be:\n"
- "0: to only sort scene elements (old behavior); or\n"
- "1: for a full update (regroups, does ipos, keys, etc.)" );
-
- Py_RETURN_NONE;
-}
-
-/*-----------------------Scene.link()------------------------------------*/
-static PyObject *Scene_link( BPy_Scene * self, PyObject * args )
-{
- Scene *scene = self->scene;
- BPy_Object *bpy_obj;
- Object *object = NULL;
- static char warning = 1;
-
- if( warning ) {
- printf("scene.link(ob) deprecated!\n\tuse scene.objects.link(ob) instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &bpy_obj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Object argument" );
-
-
- /*return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Could not create data on demand for this object type!" );*/
-
- object = bpy_obj->object;
-
- /* Object.c's EXPP_add_obdata does not support these objects */
- if (!object->data && (object->type == OB_SURF || object->type == OB_FONT || object->type == OB_WAVE )) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Object has no data and new data cant be automaticaly created for Surf, Text or Wave type objects!" );
- } else {
- /* Ok, all is fine, let's try to link it */
- Base *base;
-
- /* We need to link the object to a 'Base', then link this base
- * to the scene. See DNA_scene_types.h ... */
-
- /* First, check if the object isn't already in the scene */
- base = object_in_scene( object, scene );
- /* if base is not NULL ... */
- if( base ) /* ... the object is already in one of the Scene Bases */
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "object already in scene!" );
-
- /* not linked, go get mem for a new base object */
-
- base = MEM_callocN( sizeof( Base ), "pynewbase" );
-
- if( !base )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't allocate new Base for object" );
-
- /* if the object has not yet been linked to object data, then
- * set the real type before we try creating data */
-
- if( bpy_obj->realtype != OB_EMPTY ) {
- object->type = bpy_obj->realtype;
- bpy_obj->realtype = OB_EMPTY;
- }
-
- /* check if this object has obdata, case not, try to create it */
-
- if( !object->data && ( object->type != OB_EMPTY ) )
- EXPP_add_obdata( object ); /* returns -1 on error, defined in Object.c */
-
- base->object = object; /* link object to the new base */
- base->lay = object->lay;
- base->flag = object->flag;
-
- object->id.us += 1; /* incref the object user count in Blender */
-
- BLI_addhead( &scene->base, base ); /* finally, link new base to scene */
- }
-
- Py_RETURN_NONE;
-}
-
-/*-----------------------Scene.unlink()----------------------------------*/
-static PyObject *Scene_unlink( BPy_Scene * self, PyObject * args )
-{
- BPy_Object *bpy_obj = NULL;
- Scene *scene = self->scene;
- Base *base;
- static char warning = 1;
-
- if( warning ) {
- printf("scene.unlink(ob) deprecated!\n\tuse scene.objects.unlink(ob) instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &bpy_obj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Object as argument" );
-
- /* is the object really in the scene? */
- base = object_in_scene( bpy_obj->object, scene );
-
- if( base ) { /* if it is, remove it */
- if (scene->basact==base)
- scene->basact= NULL; /* in case the object was selected */
-
- free_and_unlink_base_from_scene( scene, base );
- Py_RETURN_TRUE;
- }
- else
- Py_RETURN_FALSE;
-}
-
-/*-----------------------Scene.getChildren()-----------------------------*/
-static PyObject *Scene_getChildren( BPy_Scene * self )
-{
- Scene *scene = self->scene;
- PyObject *pylist;
- PyObject *bpy_obj;
- Object *object;
- Base *base;
- static char warning = 1;
-
- if( warning ) {
- printf("scene.getChildren() deprecated!\n\tuse scene.objects instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
-
- pylist = PyList_New( 0 );
-
- base = scene->base.first;
-
- while( base ) {
- object = base->object;
-
- bpy_obj = Object_CreatePyObject( object );
-
- if( !bpy_obj ) {
- Py_DECREF(pylist);
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create new object wrapper" );
- }
- PyList_Append( pylist, bpy_obj );
- Py_DECREF( bpy_obj ); /* PyList_Append incref'ed it */
-
- base = base->next;
- }
-
- return pylist;
-}
-
-/*-----------------------Scene.getActiveObject()------------------------*/
-static PyObject *Scene_getActiveObject(BPy_Scene *self)
-{
- Scene *scene = self->scene;
- PyObject *pyob;
- Object *ob;
- static char warning = 1;
-
- if( warning ) {
- printf("scene.getActiveObject() deprecated!\n\tuse scene.objects.active instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
-
- ob = ((scene->basact) ? (scene->basact->object) : 0);
-
- if (ob) {
- pyob = Object_CreatePyObject( ob );
-
- if (!pyob)
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "couldn't create new object wrapper!");
-
- return pyob;
- }
-
- Py_RETURN_NONE; /* no active object */
-}
-
-/*-----------------------Scene.getCurrentCamera()------------------------*/
-static PyObject *Scene_getCurrentCamera( BPy_Scene * self )
-{
- static char warning = 1;
-
- if( warning ) {
- printf("scene.getCurrentCamera() deprecated!\n\tuse scene.objects.camera instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
- /* None is ok */
- return Object_CreatePyObject( self->scene->camera );
-}
-
-/*-----------------------Scene.setCurrentCamera()------------------------*/
-static PyObject *Scene_setCurrentCamera( BPy_Scene * self, PyObject * args )
-{
- Object *object;
- BPy_Object *cam_obj;
- Scene *scene = self->scene;
- static char warning = 1;
-
- if( warning ) {
- printf("scene.setCurrentCamera(ob) deprecated!\n\tSet scene.objects.camera = ob instead\n");
- --warning;
- }
-
- SCENE_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &cam_obj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Camera Object as argument" );
-
- object = cam_obj->object;
- if( object->type != OB_CAMERA )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expected Camera Object as argument" );
-
- scene->camera = object; /* set the current Camera */
-
- /* if this is the current scene, update its window now */
- if( !G.background && scene == G.scene ) /* Traced a crash to redrawing while in background mode -Campbell */
- copy_view3d_lock( REDRAW );
-
-/* XXX copy_view3d_lock(REDRAW) prints "bad call to addqueue: 0 (18, 1)".
- * The same happens in bpython. */
-
- Py_RETURN_NONE;
-}
-
-/*-----------------------Scene.getRenderingContext()---------------------*/
-static PyObject *Scene_getRenderingContext( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
- return RenderData_CreatePyObject( self->scene );
-}
-
-static PyObject *Scene_getRadiosityContext( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
- return Radio_CreatePyObject( self->scene );
-}
-
-static PyObject *Scene_getSequence( BPy_Scene * self )
-{
- SCENE_DEL_CHECK_PY(self);
- return SceneSeq_CreatePyObject( self->scene, NULL );
-}
-
-/* scene.addScriptLink */
-static PyObject *Scene_addScriptLink( BPy_Scene * self, PyObject * args )
-{
- Scene *scene = self->scene;
- ScriptLink *slink = NULL;
-
- SCENE_DEL_CHECK_PY(self);
-
- slink = &( scene )->scriptlink;
-
- return EXPP_addScriptLink( slink, args, 1 );
-}
-
-/* scene.clearScriptLinks */
-static PyObject *Scene_clearScriptLinks( BPy_Scene * self, PyObject * args )
-{
- Scene *scene = self->scene;
- ScriptLink *slink = NULL;
-
- SCENE_DEL_CHECK_PY(self);
-
- slink = &( scene )->scriptlink;
-
- return EXPP_clearScriptLinks( slink, args );
-}
-
-/* scene.getScriptLinks */
-static PyObject *Scene_getScriptLinks( BPy_Scene * self, PyObject * value )
-{
- Scene *scene = self->scene;
- ScriptLink *slink = NULL;
- PyObject *ret = NULL;
-
- SCENE_DEL_CHECK_PY(self);
-
- slink = &( scene )->scriptlink;
-
- ret = EXPP_getScriptLinks( slink, value, 1 );
-
- if( ret )
- return ret;
- else
- return NULL;
-}
-
-static PyObject *Scene_play( BPy_Scene * self, PyObject * args )
-{
- int mode = 0, win = SPACE_VIEW3D;
- PyObject *ret = NULL;
- ScrArea *sa = NULL, *oldsa = curarea;
-
- SCENE_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "|ii", &mode, &win ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing, or or two ints as arguments." );
-
- if( mode < 0 || mode > 3 )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "mode should be in range [0, 3]." );
-
- switch ( win ) {
- case SPACE_VIEW3D:
- case SPACE_SEQ:
- case SPACE_IPO:
- case SPACE_ACTION:
- case SPACE_NLA:
- case SPACE_SOUND:
- case SPACE_BUTS: /* from here they don't 'play', but ... */
- case SPACE_TEXT: /* ... might be used as a timer. */
- case SPACE_SCRIPT:
- case SPACE_OOPS:
- case SPACE_IMAGE:
- case SPACE_IMASEL:
- case SPACE_INFO:
- case SPACE_FILE:
- break;
- default:
- win = SPACE_VIEW3D;
- }
-
- /* we have to move to a proper win */
- sa = find_biggest_area_of_type( win );
- if( !sa && win != SPACE_VIEW3D )
- sa = find_biggest_area_of_type( SPACE_VIEW3D );
-
- if( !sa )
- sa = find_biggest_area( );
-
- if( sa )
- areawinset( sa->win );
-
- /* play_anim returns 0 for normal exit or 1 if user canceled it */
- ret = PyInt_FromLong( (long)play_anim( mode ) );
-
- if( sa )
- areawinset( oldsa->win );
-
- return ret;
-}
-
-static PyObject *Scene_getTimeLine( BPy_Scene *self )
-{
- BPy_TimeLine *tm;
-
- SCENE_DEL_CHECK_PY(self);
-
- tm= (BPy_TimeLine *) PyObject_NEW (BPy_TimeLine, &TimeLine_Type);
- if (!tm)
- return EXPP_ReturnPyObjError (PyExc_MemoryError,
- "couldn't create BPy_TimeLine object");
- tm->marker_list= &(self->scene->markers);
- tm->sfra= (int) self->scene->r.sfra;
- tm->efra= (int) self->scene->r.efra;
-
- return (PyObject *)tm;
-}
-
-/************************************************************************
- *
- * Object Sequence
- *
- ************************************************************************/
-/*
- * create a thin wrapper for the scenes objects
- */
-
-/* accessed from scn.objects.selected or scn.objects.context */
-static PyObject *SceneObSeq_getObjects( BPy_SceneObSeq *self, void *mode)
-{
- SCENE_DEL_CHECK_PY(self->bpyscene);
- return SceneObSeq_CreatePyObject(self->bpyscene, NULL, (int)((long)mode));
-}
-
-static int SceneObSeq_setObjects( BPy_SceneObSeq *self, PyObject *value, void *_mode_)
-{
- /*
- ONLY SUPPORTS scn.objects.selected and scn.objects.context
- cannot assign to scn.objects yet!!!
- */
- PyObject *item;
- Scene *scene= self->bpyscene->scene;
- Object *blen_ob;
- Base *base;
- int size, mode = GET_INT_FROM_POINTER(_mode_);
-
- SCENE_DEL_CHECK_INT(self->bpyscene);
-
- /* scn.objects.selected = scn.objects - shortcut to select all */
- if (BPy_SceneObSeq_Check(value)) {
- BPy_SceneObSeq *bpy_sceneseq = (BPy_SceneObSeq *)value;
- if (self->bpyscene->scene != bpy_sceneseq->bpyscene->scene)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Cannot assign a SceneObSeq type from another scene" );
- if (bpy_sceneseq->mode != EXPP_OBSEQ_NORMAL)
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Can only assign scn.objects to scn.objects.context or scn.objects.selected" );
-
- for (base= scene->base.first; base; base= base->next) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
-
- if (mode==EXPP_OBSEQ_CONTEXT && G.vd) {
- base->object->lay= base->lay= G.vd->lay;
- }
- }
- return 0;
- }
-
- if (!PySequence_Check(value))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "Error, must assign a sequence of objects to scn.objects.selected" );
-
- /* for context and selected, just deselect, dont remove */
- for (base= scene->base.first; base; base= base->next) {
- base->flag &= ~SELECT;
- base->object->flag &= ~SELECT;
- }
-
- size = PySequence_Length(value);
- while (size) {
- size--;
- item = PySequence_GetItem(value, size);
- if ( PyObject_TypeCheck(item, &Object_Type) ) {
- blen_ob= ((BPy_Object *)item)->object;
- base = object_in_scene( blen_ob, scene );
- if (base) {
- blen_ob->flag |= SELECT;
- base->flag |= SELECT;
- if (mode==EXPP_OBSEQ_CONTEXT && G.vd) {
- blen_ob->restrictflag &= ~OB_RESTRICT_VIEW;
- blen_ob->lay= base->lay= G.vd->lay;
- }
- }
- }
- Py_DECREF(item);
- }
- return 0;
-}
-
-
-static PyObject *SceneObSeq_CreatePyObject( BPy_Scene *self, Base *iter, int mode )
-{
- BPy_SceneObSeq *seq = PyObject_NEW( BPy_SceneObSeq, &SceneObSeq_Type);
- seq->bpyscene = self; Py_INCREF(self);
- seq->iter = iter;
- seq->mode = mode;
- return (PyObject *)seq;
-}
-
-static int SceneObSeq_len( BPy_SceneObSeq * self )
-{
- Scene *scene= self->bpyscene->scene;
- SCENE_DEL_CHECK_INT(self->bpyscene);
-
- if (self->mode == EXPP_OBSEQ_NORMAL)
- return BLI_countlist( &( scene->base ) );
- else if (self->mode == EXPP_OBSEQ_SELECTED) {
- int len=0;
- Base *base;
- for (base= scene->base.first; base; base= base->next) {
- if (base->flag & SELECT) {
- len++;
- }
- }
- return len;
- } else if (self->mode == EXPP_OBSEQ_CONTEXT) {
- int len=0;
- Base *base;
-
- if( G.vd == NULL ) /* No 3d view has been initialized yet, simply return an empty list */
- return 0;
-
- for (base= scene->base.first; base; base= base->next) {
- if TESTBASE(base) {
- len++;
- }
- }
- return len;
- }
- /*should never run this */
- return 0;
-}
-
-/*
- * retrive a single Object from somewhere in the Object list
- */
-
-static PyObject *SceneObSeq_item( BPy_SceneObSeq * self, int i )
-{
- int index=0;
- Base *base= NULL;
- Scene *scene= self->bpyscene->scene;
-
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- /* objects */
- if (self->mode==EXPP_OBSEQ_NORMAL)
- for (base= scene->base.first; base && i!=index; base= base->next, index++) {}
- /* selected */
- else if (self->mode==EXPP_OBSEQ_SELECTED) {
- for (base= scene->base.first; base; base= base->next) {
- if (base->flag & SELECT) {
- if (i==index) {
- break;
- } else {
- index++;
- }
- }
- }
- }
- /* context */
- else if (self->mode==EXPP_OBSEQ_CONTEXT) {
- if (G.vd) {
- for (base= scene->base.first; base; base= base->next) {
- if (TESTBASE(base)) {
- if (i==index) {
- break;
- } else {
- index++;
- }
- }
- }
- }
- }
-
- if (!(base))
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return Object_CreatePyObject( base->object );
-}
-
-static PySequenceMethods SceneObSeq_as_sequence = {
- ( inquiry ) SceneObSeq_len, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) SceneObSeq_item, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) 0, /* sq_ass_item */
- ( intintobjargproc ) 0, /* sq_ass_slice */
- 0,0,0,
-};
-
-
-/************************************************************************
- *
- * Python SceneObSeq_Type iterator (iterates over GroupObjects)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *SceneObSeq_getIter( BPy_SceneObSeq * self )
-{
- /* we need to get the first base, but for selected context we may need to advance
- to the first selected or first conext base */
- Base *base= self->bpyscene->scene->base.first;
-
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- if (self->mode==EXPP_OBSEQ_SELECTED)
- while (base && !(base->flag & SELECT))
- base= base->next;
- else if (self->mode==EXPP_OBSEQ_CONTEXT) {
- if (!G.vd)
- base= NULL; /* will never iterate if we have no */
- else
- while (base && !TESTBASE(base))
- base= base->next;
- }
- /* create a new iterator if were alredy using this one */
- if (self->iter==NULL) {
- self->iter = base;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return SceneObSeq_CreatePyObject(self->bpyscene, base, self->mode);
- }
-}
-
-/*
- * Return next SceneOb.
- */
-
-static PyObject *SceneObSeq_nextIter( BPy_SceneObSeq * self )
-{
- PyObject *object;
- Base *base;
- if( !(self->iter) || !(self->bpyscene->scene) ) {
- self->iter= NULL;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object= Object_CreatePyObject( self->iter->object );
- base= self->iter->next;
-
- if (self->mode==EXPP_OBSEQ_SELECTED)
- while (base && !(base->flag & SELECT))
- base= base->next;
- else if (self->mode==EXPP_OBSEQ_CONTEXT) {
- if (!G.vd)
- base= NULL; /* will never iterate if we have no */
- else
- while (base && !TESTBASE(base))
- base= base->next;
- }
- self->iter= base;
- return object;
-}
-
-
-static PyObject *SceneObSeq_link( BPy_SceneObSeq * self, PyObject *pyobj )
-{
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- /* this shold eventually replace Scene_link */
- if (self->mode != EXPP_OBSEQ_NORMAL)
- return (EXPP_ReturnPyObjError( PyExc_TypeError,
- "Cannot link to objects.selection or objects.context!" ));
-
- /*
- if (self->iter != NULL)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Cannot modify scene objects while iterating" );
- */
-
- if( PyTuple_Size(pyobj) == 1 ) {
- BPy_LibraryData *seq = ( BPy_LibraryData * )PyTuple_GET_ITEM( pyobj, 0 );
- if( BPy_LibraryData_Check( seq ) )
- return LibraryData_importLibData( seq, seq->name,
- ( seq->kind == OBJECT_IS_LINK ? FILE_LINK : 0 ),
- self->bpyscene->scene );
- }
- return Scene_link(self->bpyscene, pyobj);
-}
-
-/* This is buggy with new object data not already linked to an object, for now use the above code */
-static PyObject *SceneObSeq_new( BPy_SceneObSeq * self, PyObject *args )
-{
-
- void *data = NULL;
- char *name = NULL;
- char *desc = NULL;
- short type = OB_EMPTY;
- struct Object *object;
- Base *base;
- PyObject *py_data;
- Scene *scene= self->bpyscene->scene;
-
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- if (self->mode != EXPP_OBSEQ_NORMAL)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Cannot add new to objects.selection or objects.context!" );
-
- if( !PyArg_ParseTuple( args, "O|s", &py_data, &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "scene.objects.new(obdata) - expected obdata to be\n\ta python obdata type or the string 'Empty'" );
-
- if( BPy_Armature_Check( py_data ) ) {
- data = ( void * ) Armature_FromPyObject( py_data );
- type = OB_ARMATURE;
- } else if( BPy_Camera_Check( py_data ) ) {
- data = ( void * ) Camera_FromPyObject( py_data );
- type = OB_CAMERA;
- } else if( BPy_Lamp_Check( py_data ) ) {
- data = ( void * ) Lamp_FromPyObject( py_data );
- type = OB_LAMP;
- } else if( BPy_Curve_Check( py_data ) ) {
- data = ( void * ) Curve_FromPyObject( py_data );
- type = OB_CURVE;
- } else if( BPy_NMesh_Check( py_data ) ) {
- data = ( void * ) NMesh_FromPyObject( py_data, NULL );
- type = OB_MESH;
- if( !data ) /* NULL means there is already an error */
- return NULL;
- } else if( BPy_Mesh_Check( py_data ) ) {
- data = ( void * ) Mesh_FromPyObject( py_data, NULL );
- type = OB_MESH;
- } else if( BPy_Lattice_Check( py_data ) ) {
- data = ( void * ) Lattice_FromPyObject( py_data );
- type = OB_LATTICE;
- } else if( BPy_Metaball_Check( py_data ) ) {
- data = ( void * ) Metaball_FromPyObject( py_data );
- type = OB_MBALL;
- } else if( BPy_Text3d_Check( py_data ) ) {
- data = ( void * ) Text3d_FromPyObject( py_data );
- type = OB_FONT;
- } else if( ( desc = PyString_AsString( (PyObject *)py_data ) ) != NULL ) {
- if( !strcmp( desc, "Empty" ) ) {
- type = OB_EMPTY;
- data = NULL;
- } else
- goto typeError;
- } else {
-typeError:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an object and optionally a string as arguments" );
- }
-
- if (!name) {
- if (type == OB_EMPTY)
- name = "Empty";
- else
- name = ((ID *)data)->name + 2;
- }
-
- object = add_only_object(type, name);
-
- if( data ) {
- object->data = data;
- id_us_plus((ID *)data);
- }
-
- object->flag = SELECT;
-
- /* creates the curve for the text object */
- if (type == OB_FONT) {
- text_to_curve(object, 0);
- } else if (object->type == OB_ARMATURE) {
- armature_rebuild_pose(object, (bArmature *)data);
- }
-
- /* link to scene */
- base = MEM_callocN( sizeof( Base ), "pynewbase" );
-
- if( !base )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't allocate new Base for object" );
-
- base->object = object; /* link object to the new base */
-
- if (scene == G.scene && G.vd) {
- if (G.vd->localview) {
- object->lay= G.vd->layact + G.vd->lay;
- } else {
- object->lay= G.vd->layact;
- }
- } else {
- base->lay= object->lay = scene->lay & ((1<<20)-1); /* Layer, by default visible*/
- }
-
- base->lay= object->lay;
-
- base->flag = SELECT;
- object->id.us = 1; /* we will exist once in this scene */
-
- BLI_addhead( &(scene->base), base ); /* finally, link new base to scene */
-
- /* make sure data and object materials are consistent */
- test_object_materials( (ID *)object->data );
-
- /* so we can deal with vertex groups */
- if (type == OB_MESH)
- ((BPy_Mesh *)py_data)->object = object;
-
- return Object_CreatePyObject( object );
-
-}
-
-static PyObject *SceneObSeq_unlink( BPy_SceneObSeq * self, PyObject *args )
-{
- PyObject *pyobj;
- Object *blen_ob;
- Scene *scene;
- Base *base= NULL;
-
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- if (self->mode != EXPP_OBSEQ_NORMAL)
- return (EXPP_ReturnPyObjError( PyExc_TypeError,
- "Cannot add new to objects.selection or objects.context!" ));
-
- if( !PyArg_ParseTuple( args, "O!", &Object_Type, &pyobj ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a python object as an argument" ) );
-
- blen_ob = ( ( BPy_Object * ) pyobj )->object;
-
- scene = self->bpyscene->scene;
-
- /* is the object really in the scene? */
- base = object_in_scene( blen_ob, scene);
- if( base ) { /* if it is, remove it */
- if (scene->basact==base)
- scene->basact= NULL; /* in case the object was selected */
- free_and_unlink_base_from_scene(scene, base);
- Py_RETURN_TRUE;
- }
- Py_RETURN_FALSE;
-}
-
-static PyObject *SceneObSeq_getActive(BPy_SceneObSeq *self)
-{
- Base *base;
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- if (self->mode!=EXPP_OBSEQ_NORMAL)
- return (EXPP_ReturnPyObjError( PyExc_TypeError,
- "cannot get active from objects.selected or objects.context" ));
-
- base= self->bpyscene->scene->basact;
- if (!base)
- Py_RETURN_NONE;
-
- return Object_CreatePyObject( base->object );
-}
-
-static int SceneObSeq_setActive(BPy_SceneObSeq *self, PyObject *value)
-{
- Base *base;
-
- SCENE_DEL_CHECK_INT(self->bpyscene);
-
- if (self->mode!=EXPP_OBSEQ_NORMAL)
- return (EXPP_ReturnIntError( PyExc_TypeError,
- "cannot set active from objects.selected or objects.context" ));
-
- if (value==Py_None) {
- self->bpyscene->scene->basact= NULL;
- return 0;
- }
-
- if (!BPy_Object_Check(value))
- return (EXPP_ReturnIntError( PyExc_ValueError,
- "Object or None types can only be assigned to active!" ));
-
- base = object_in_scene( ((BPy_Object *)value)->object, self->bpyscene->scene );
-
- if (!base)
- return (EXPP_ReturnIntError( PyExc_ValueError,
- "cannot assign an active object outside the scene." ));
-
- self->bpyscene->scene->basact= base;
- return 0;
-}
-
-static PyObject *SceneObSeq_getCamera(BPy_SceneObSeq *self)
-{
- SCENE_DEL_CHECK_PY(self->bpyscene);
-
- if (self->mode!=EXPP_OBSEQ_NORMAL)
- return (EXPP_ReturnPyObjError( PyExc_TypeError,
- "cannot get camera from objects.selected or objects.context" ));
-
- return Object_CreatePyObject( self->bpyscene->scene->camera );
-}
-
-static int SceneObSeq_setCamera(BPy_SceneObSeq *self, PyObject *value)
-{
- int ret;
-
- SCENE_DEL_CHECK_INT(self->bpyscene);
- if (self->mode!=EXPP_OBSEQ_NORMAL)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "cannot set camera from objects.selected or objects.context" );
-
- ret = GenericLib_assignData(value, (void **) &self->bpyscene->scene->camera, 0, 0, ID_OB, 0);
-
- /* if this is the current scene, update its window now */
- if( ret == 0 && !G.background && self->bpyscene->scene == G.scene ) /* Traced a crash to redrawing while in background mode -Campbell */
- copy_view3d_lock( REDRAW );
-
-/* XXX copy_view3d_lock(REDRAW) prints "bad call to addqueue: 0 (18, 1)".
- * The same happens in bpython. */
-
- return ret;
-}
-
-
-static struct PyMethodDef BPy_SceneObSeq_methods[] = {
- {"link", (PyCFunction)SceneObSeq_link, METH_VARARGS,
- "link object to this scene"},
- {"new", (PyCFunction)SceneObSeq_new, METH_VARARGS,
- "Create a new object in this scene from the obdata given and return a new object"},
- {"unlink", (PyCFunction)SceneObSeq_unlink, METH_VARARGS,
- "unlinks the object from the scene"},
- {NULL, NULL, 0, NULL}
-};
-
-/************************************************************************
- *
- * Python SceneObSeq_Type standard operations
- *
- ************************************************************************/
-
-static void SceneObSeq_dealloc( BPy_SceneObSeq * self )
-{
- Py_DECREF(self->bpyscene);
- PyObject_DEL( self );
-}
-
-static int SceneObSeq_compare( BPy_SceneObSeq * a, BPy_SceneObSeq * b )
-{
- return ( a->bpyscene->scene == b->bpyscene->scene && a->mode == b->mode) ? 0 : -1;
-}
-
-/*
- * repr function
- * callback functions building meaninful string to representations
- */
-static PyObject *SceneObSeq_repr( BPy_SceneObSeq * self )
-{
- if( !(self->bpyscene->scene) )
- return PyString_FromFormat( "[Scene ObjectSeq Removed]" );
- else if (self->mode==EXPP_OBSEQ_SELECTED)
- return PyString_FromFormat( "[Scene ObjectSeq Selected \"%s\"]",
- self->bpyscene->scene->id.name + 2 );
- else if (self->mode==EXPP_OBSEQ_CONTEXT)
- return PyString_FromFormat( "[Scene ObjectSeq Context \"%s\"]",
- self->bpyscene->scene->id.name + 2 );
-
- /*self->mode==0*/
- return PyString_FromFormat( "[Scene ObjectSeq \"%s\"]",
- self->bpyscene->scene->id.name + 2 );
-}
-
-static PyGetSetDef SceneObSeq_getseters[] = {
- {"selected",
- (getter)SceneObSeq_getObjects, (setter)SceneObSeq_setObjects,
- "sequence of selected objects",
- (void *)EXPP_OBSEQ_SELECTED},
- {"context",
- (getter)SceneObSeq_getObjects, (setter)SceneObSeq_setObjects,
- "sequence of user context objects",
- (void *)EXPP_OBSEQ_CONTEXT},
- {"active",
- (getter)SceneObSeq_getActive, (setter)SceneObSeq_setActive,
- "active object",
- NULL},
- {"camera",
- (getter)SceneObSeq_getCamera, (setter)SceneObSeq_setCamera,
- "camera object",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python SceneObSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject SceneObSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender SceneObSeq", /* char *tp_name; */
- sizeof( BPy_SceneObSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) SceneObSeq_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) SceneObSeq_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) SceneObSeq_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &SceneObSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) SceneObSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) SceneObSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_SceneObSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- SceneObSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/Scene.h b/source/blender/python/api2_2x/Scene.h
deleted file mode 100644
index 19b3b488b31..00000000000
--- a/source/blender/python/api2_2x/Scene.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_SCENE_H
-#define EXPP_SCENE_H
-
-#include <Python.h>
-#include "DNA_scene_types.h"
-
-/* The Scene PyType Object defined in Scene.c */
-extern PyTypeObject Scene_Type;
-extern PyTypeObject SceneObSeq_Type;
-
-#define BPy_Scene_Check(v) \
- ((v)->ob_type == &Scene_Type)
-#define BPy_SceneObSeq_Check(v) \
- ((v)->ob_type == &SceneObSeq_Type)
-
-/*---------------------------Python BPy_Scene structure definition----------*/
-typedef struct {
- PyObject_HEAD
- Scene * scene; /* libdata must be second */
-} BPy_Scene;
-/*---------------------------Python BPy_Scene visible prototypes-----------*/
-/* Python Scene_Type helper functions needed by Blender (the Init function) and Object modules. */
-
-
-/* Scene object sequence, iterate on the scene object listbase*/
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- BPy_Scene *bpyscene; /* link to the python scene so we can know if its been removed */
- Base *iter; /* so we can iterate over the objects */
- int mode; /*0:all objects, 1:selected objects, 2:user context*/
-} BPy_SceneObSeq;
-
-
-PyObject *Scene_Init( void );
-PyObject *Scene_CreatePyObject( Scene * scene );
-/*Scene *Scene_FromPyObject( PyObject * pyobj );*/ /* not used yet */
-
-#endif /* EXPP_SCENE_H */
diff --git a/source/blender/python/api2_2x/Sound.c b/source/blender/python/api2_2x/Sound.c
deleted file mode 100644
index 962790b6ce2..00000000000
--- a/source/blender/python/api2_2x/Sound.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Chris Keith
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Sound.h" /*This must come first*/
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BLI_blenlib.h"
-#include "BKE_sound.h"
-#include "BKE_library.h"
-#include "BIF_editsound.h"
-#include "BKE_packedFile.h"
-#include "mydevice.h" /* redraw defines */
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "DNA_space_types.h" /* for FILE_MAXDIR only */
-
-/*****************************************************************************/
-/* Python BPy_Sound defaults: */
-/*****************************************************************************/
-
-#define EXPP_SND_volume_MIN 0.0
-#define EXPP_SND_volume_MAX 1.0
-#define EXPP_SND_pitch_MIN -12.0
-#define EXPP_SND_pitch_MAX 12.0
-#define EXPP_SND_attenuation_MIN 0.0
-#define EXPP_SND_attenuation_MAX 5.0
-
-/*****************************************************************************/
-/* Python API function prototypes for the Sound module. */
-/*****************************************************************************/
-static PyObject *M_Sound_Get( PyObject * self, PyObject * args );
-static PyObject *M_Sound_Load( PyObject * self, PyObject * value );
-
-/************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Sound.__doc__ */
-/************************************************************************/
-static char M_Sound_doc[] = "The Blender Sound module\n\n";
-
-static char M_Sound_Get_doc[] =
- "(name) - return the sound with the name 'name', \
-returns None if not found.\n If 'name' is not specified, \
-it returns a list of all sounds in the\ncurrent scene.";
-
-static char M_Sound_Load_doc[] =
- "(filename) - return sound from file filename as a Sound Object,\n\
-returns None if not found.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Sound module: */
-/*****************************************************************************/
-struct PyMethodDef M_Sound_methods[] = {
- {"Get", M_Sound_Get, METH_VARARGS, M_Sound_Get_doc},
- {"Load", M_Sound_Load, METH_O, M_Sound_Load_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Sound_Type callback function prototypes: */
-/*****************************************************************************/
-static int Sound_compare( BPy_Sound * a, BPy_Sound * b );
-static PyObject *Sound_repr( BPy_Sound * self );
-
-#define SOUND_FLOAT_METHODS(funcname, varname) \
-static PyObject *Sound_get ## funcname(BPy_Sound *self) { \
- return PyFloat_FromDouble(self->sound->varname); \
-} \
-static PyObject *Sound_set ## funcname(BPy_Sound *self, PyObject *args) { \
- float f = 0; \
- if (!PyArg_ParseTuple(args, "f", &f)) \
- return (EXPP_ReturnPyObjError (PyExc_TypeError, \
- "expected float argument")); \
- self->sound->varname = EXPP_ClampFloat(f, \
- EXPP_SND_##varname##_MIN, EXPP_SND_##varname##_MAX); \
- Py_RETURN_NONE; \
-}
-
-#define SOUND_FLOAT_METHOD_FUNCS(varname) \
-{"get"#varname, (PyCFunction)Sound_get ## varname, METH_NOARGS, \
-"() - Return Sound object "#varname}, \
-{"set"#varname, (PyCFunction)Sound_set ## varname, METH_VARARGS, \
-"(float) - Change Sound object "#varname},
-
-
-/*****************************************************************************/
-/* Python BPy_Sound methods declarations: */
-/*****************************************************************************/
-static PyObject *Sound_getName( BPy_Sound * self );
-static PyObject *Sound_getFilename( BPy_Sound * self );
-static PyObject *Sound_setName( BPy_Sound * self, PyObject * args );
-static int Sound_setFilename( BPy_Sound * self, PyObject * args );
-static PyObject *Sound_oldsetFilename( BPy_Sound * self, PyObject * args );
-static PyObject *Sound_setCurrent( BPy_Sound * self );
-static PyObject *Sound_play( BPy_Sound * self );
-static PyObject *Sound_unpack( BPy_Sound * self, PyObject * args);
-static PyObject *Sound_pack( BPy_Sound * self );
-/*static PyObject *Sound_reload ( BPy_Sound * self );*/
-SOUND_FLOAT_METHODS( Volume, volume )
-SOUND_FLOAT_METHODS( Attenuation, attenuation )
-SOUND_FLOAT_METHODS( Pitch, pitch )
-/* these can't be set via interface, removed for now */
-/*
-SOUND_FLOAT_METHODS( Panning, panning )
-SOUND_FLOAT_METHODS( MinGain, min_gain )
-SOUND_FLOAT_METHODS( MaxGain, max_gain )
-SOUND_FLOAT_METHODS( Distance, distance )
-*/
-
-/*****************************************************************************/
-/* Python BPy_Sound methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Sound_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) Sound_getName, METH_NOARGS,
- "() - Return Sound object name"},
- {"getFilename", ( PyCFunction ) Sound_getFilename, METH_NOARGS,
- "() - Return Sound object filename"},
- {"setName", ( PyCFunction ) Sound_setName, METH_VARARGS,
- "(name) - Set Sound object name"},
- {"setFilename", ( PyCFunction ) Sound_oldsetFilename, METH_VARARGS,
- "(filename) - Set Sound object filename"},
- {"setCurrent", ( PyCFunction ) Sound_setCurrent, METH_NOARGS,
- "() - make this the active sound in the sound buttons win (also redraws)"},
- {"play", ( PyCFunction ) Sound_play, METH_NOARGS,
- "() - play this sound"},
- {"unpack", ( PyCFunction ) Sound_unpack, METH_VARARGS,
- "(int) - Unpack sound. Uses one of the values defined in Blender.UnpackModes."},
- {"pack", ( PyCFunction ) Sound_pack, METH_NOARGS,
- "() Pack the sound"},
-/*
- {"reload", ( PyCFunction ) Sound_setCurrent, METH_NOARGS,
- "() - reload this Sound object's sample.\n\
- This is only useful if the original sound file has changed."},
-*/
- SOUND_FLOAT_METHOD_FUNCS( Volume )
- SOUND_FLOAT_METHOD_FUNCS( Attenuation )
- SOUND_FLOAT_METHOD_FUNCS( Pitch )
- /*
- SOUND_FLOAT_METHOD_FUNCS( Panning )
- SOUND_FLOAT_METHOD_FUNCS( MinGain )
- SOUND_FLOAT_METHOD_FUNCS( MaxGain )
- SOUND_FLOAT_METHOD_FUNCS( Distance )
- */
- {NULL, NULL, 0, NULL}
-};
-
-/* NOTE: these were copied and modified from image.h. To Be Done TBD:
- * macro-ize them, or C++ templates eventually?
- */
-/****************************************************************************/
-/* Function: M_Sound_Get */
-/* Python equivalent: Blender.Sound.Get */
-/* Description: Receives a string and returns the Sound object */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all Sound names in the */
-/* current scene is returned. */
-/****************************************************************************/
-static PyObject *M_Sound_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- bSound *snd_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- snd_iter = G.main->sound.first;
-
- if( name ) { /* (name) - Search Sound by name */
-
- BPy_Sound *wanted_Sound = NULL;
-
- while( ( snd_iter ) && ( wanted_Sound == NULL ) ) {
- if( strcmp( name, snd_iter->id.name + 2 ) == 0 ) {
- wanted_Sound =
- ( BPy_Sound * )
- PyObject_NEW( BPy_Sound, &Sound_Type );
- if( wanted_Sound ) {
- wanted_Sound->sound = snd_iter;
- break;
- }
- }
- snd_iter = snd_iter->id.next;
- }
-
- if( wanted_Sound == NULL ) { /* Requested Sound doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Sound \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_Sound;
- }
-
- else { /* () - return a list of all Sounds in the scene */
- int index = 0;
- PyObject *snd_list, *pyobj;
-
- snd_list = PyList_New( BLI_countlist( &( G.main->sound ) ) );
-
- if( snd_list == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( snd_iter ) {
- pyobj = Sound_CreatePyObject( snd_iter );
-
- if( !pyobj ) {
- Py_DECREF(snd_list);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create PyObject" ) );
- }
- PyList_SET_ITEM( snd_list, index, pyobj );
-
- snd_iter = snd_iter->id.next;
- index++;
- }
-
- return ( snd_list );
- }
-}
-
-/*****************************************************************************/
-/* Function: M_Sound_Load */
-/* Python equivalent: Blender.Sound.Load */
-/* Description: Receives a string and returns the Sound object */
-/* whose filename matches the string. */
-/*****************************************************************************/
-static PyObject *M_Sound_Load( PyObject * self, PyObject * value )
-{
- char *fname = PyString_AsString(value);
- bSound *snd_ptr;
- BPy_Sound *snd;
-
- if( !fname )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" ) );
-
- snd = ( BPy_Sound * ) PyObject_NEW( BPy_Sound, &Sound_Type );
-
- if( !snd )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyObject Sound_Type" ) );
-
- snd_ptr = sound_new_sound( fname );
-
- if( snd_ptr ) {
- if( G.ssound ) {
- G.ssound->sound = snd_ptr;
- }
- }
-
- if( !snd_ptr )
- return ( EXPP_ReturnPyObjError( PyExc_IOError,
- "not a valid sound sample" ) );
-
- snd->sound = snd_ptr;
-
- return ( PyObject * ) snd;
-}
-
-/*****************************************************************************/
-/* Function: Sound_Init */
-/*****************************************************************************/
-PyObject *Sound_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &Sound_Type ) < 0 )
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Sound", M_Sound_methods,
- M_Sound_doc );
-
- return ( submodule );
-}
-
-/************************/
-/*** The Sound PyType ***/
-/************************/
-
-
-/*****************************************************************************/
-/* Function: Sound_CreatePyObject */
-/* Description: This function will create a new BPy_Sound from an existing */
-/* Blender Sound structure. */
-/*****************************************************************************/
-PyObject *Sound_CreatePyObject( bSound * snd )
-{
- BPy_Sound *py_snd;
-
- py_snd = ( BPy_Sound * ) PyObject_NEW( BPy_Sound, &Sound_Type );
-
- if( !py_snd )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Sound object" );
-
- py_snd->sound = snd;
-
- return ( PyObject * ) py_snd;
-}
-
-/*****************************************************************************/
-/* Function: Sound_FromPyObject */
-/* Description: Returns the Blender Sound associated with this object */
-/*****************************************************************************/
-bSound *Sound_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Sound * ) pyobj )->sound;
-}
-
-/*****************************************************************************/
-/* Python BPy_Sound methods: */
-/*****************************************************************************/
-static PyObject *Sound_getName( BPy_Sound * self )
-{
- return PyString_FromString( self->sound->id.name + 2 );
-}
-
-static PyObject *Sound_getFilename( BPy_Sound * self )
-{
- return PyString_FromString( self->sound->name );
-}
-
-static PyObject *Sound_getPacked( BPy_Sound * self )
-{
- if (!sound_sample_is_null(self->sound)) {
- bSample *sample = sound_find_sample(self->sound);
- if (sample->packedfile)
- Py_RETURN_TRUE;
- }
- Py_RETURN_FALSE;
-}
-
-static PyObject *Sound_setName( BPy_Sound * self, PyObject * args )
-{
- char *name;
-
- if( !PyArg_ParseTuple( args, "s", &name ) ) {
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a String as argument" ) );
- }
-
- rename_id( &self->sound->id, name );
-
- Py_RETURN_NONE;
-}
-
-static int Sound_setFilename( BPy_Sound * self, PyObject * value )
-{
- char *name;
-
- /* max len is FILE_MAXDIR = 160 chars like in DNA_image_types.h */
- name = PyString_AsString(value);
- if (!name || strlen(name) > FILE_MAXDIR)
- return ( EXPP_ReturnIntError( PyExc_ValueError,
- "string argument is limited to 160 chars at most" ) );
-
- strcpy( self->sound->name, name );
- return 0;
-}
-
-static PyObject *Sound_oldsetFilename( BPy_Sound * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)Sound_setFilename );
-}
-
-
-static PyObject *Sound_play( BPy_Sound * self )
-{
- sound_play_sound( self->sound );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Sound_setCurrent( BPy_Sound * self )
-{
- bSound *snd_ptr = self->sound;
-
- if( snd_ptr ) {
- if( G.ssound ) {
- G.ssound->sound = snd_ptr;
- }
- }
-
- EXPP_allqueue( REDRAWSOUND, 0 );
- EXPP_allqueue( REDRAWBUTSLOGIC, 0 );
-
- Py_RETURN_NONE;
-}
-
-/* unpack sound */
-
-static PyObject *Sound_unpack( BPy_Sound * self, PyObject * args )
-{
- bSound *sound = self->sound;
- int mode;
- if( !PyArg_ParseTuple( args, "i", &mode ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an integer from Blender.UnpackModes" );
-
- if (!sound_sample_is_null(sound)) {
- bSample *sample = sound_find_sample(sound);
- if (sample->packedfile) {
- if (unpackSample(sample, mode) == RET_ERROR)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error unpacking sound");
- }
- } else {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "sound has no samples" );
- }
- Py_RETURN_NONE;
-}
-
-/* pack sound */
-
-static PyObject *Sound_pack( BPy_Sound * self )
-{
- bSound *sound = self->sound;
- if (!sound_sample_is_null(sound))
- {
- bSample *sample = sound_find_sample(sound);
- if (sample->packedfile )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "sound alredy packed" );
- sound_set_packedfile(sample, newPackedFile(sample->name));
- }
- else
- {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "sound has no samples" );
- }
- Py_RETURN_NONE;
-}
-
-/*
-static PyObject *Sound_reload( BPy_Sound * self)
-{
- sound_free_sample();
-
- if (sound->snd_sound) {
- SND_RemoveSound(ghSoundScene, sound->snd_sound);
- sound->snd_sound = NULL;
- }
-
- Py_RETURN_NONE;
-}
-*/
-
-
-
-/*****************************************************************************/
-/* Function: Sound_compare */
-/* Description: This is a callback function for the BPy_Sound type. It */
-/* compares two Sound_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Sound struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Sound_compare( BPy_Sound * a, BPy_Sound * b )
-{
- return ( a->sound == b->sound ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Sound_repr */
-/* Description: This is a callback function for the BPy_Sound type. It */
-/* builds a meaninful string to represent Sound objects. */
-/*****************************************************************************/
-static PyObject *Sound_repr( BPy_Sound * self )
-{
- return PyString_FromFormat( "[Sound \"%s\"]",
- self->sound->id.name + 2 );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Sound_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"filename", (getter)Sound_getFilename, (setter)Sound_setFilename,
- "text filename", NULL},
- {"packed", (getter)Sound_getPacked, (setter)NULL,
- "text filename", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-
-/*****************************************************************************/
-/* Python Sound_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Sound_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Sound", /* tp_name */
- sizeof( BPy_Sound ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Sound_compare, /* tp_compare */
- ( reprfunc ) Sound_repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Sound_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Sound_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
diff --git a/source/blender/python/api2_2x/Sound.h b/source/blender/python/api2_2x/Sound.h
deleted file mode 100644
index 56487bde5b1..00000000000
--- a/source/blender/python/api2_2x/Sound.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Chris Keith
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_SOUND_H
-#define EXPP_SOUND_H
-
-#include <Python.h>
-#include "DNA_sound_types.h"
-
-#define BPy_Sound_Check(v) ((v)->ob_type == &Sound_Type)
-extern PyTypeObject Sound_Type;
-
-/*****************************************************************************/
-/* Python BPy_Sound structure definition */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD
- bSound * sound;
-} BPy_Sound;
-
-/*****************************************************************************/
-/* Module Blender.Sound - public functions */
-/*****************************************************************************/
-PyObject *Sound_Init( void );
-PyObject *Sound_CreatePyObject( bSound * sound );
-bSound *Sound_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_SOUND_H */
diff --git a/source/blender/python/api2_2x/SurfNurb.c b/source/blender/python/api2_2x/SurfNurb.c
deleted file mode 100644
index 65bd04de14d..00000000000
--- a/source/blender/python/api2_2x/SurfNurb.c
+++ /dev/null
@@ -1,917 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "SurfNurb.h" /*This must come first */
-
-#include "BKE_curve.h"
-#include "BDR_editcurve.h" /* for convertspline */
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "BezTriple.h"
-
-/*
- * forward declarations go here
- */
-
-static int SurfNurb_setPoint( BPy_SurfNurb * self, int index, PyObject * ob );
-static int SurfNurb_length( PyInstanceObject * inst );
-static PyObject *SurfNurb_getIter( BPy_SurfNurb * self );
-static PyObject *SurfNurb_iterNext( BPy_SurfNurb * self );
-static PyObject *SurfNurb_getKnotsU( BPy_SurfNurb * self );
-static PyObject *SurfNurb_getKnotsV( BPy_SurfNurb * self );
-PyObject *SurfNurb_append( BPy_SurfNurb * self, PyObject * args );
-
-char M_SurfNurb_doc[] = "SurfNurb";
-
-/*
- table of module methods
- these are the equivalent of class or static methods.
- you do not need an object instance to call one.
-*/
-
-static PyMethodDef M_SurfNurb_methods[] = {
-/* name, method, flags, doc_string */
-/* {"Get", (PyCFunction) M_SurfNurb_method, METH_NOARGS, " () - doc string"}, */
-/* {"method", (PyCFunction) M_SurfNurb_method, METH_NOARGS, " () - doc string"}, */
-
- {NULL, NULL, 0, NULL}
-};
-
-/*
- * method table
- * table of instance methods
- * these methods are invoked on an instance of the type.
-*/
-
-static PyMethodDef BPy_SurfNurb_methods[] = {
-# if 0
- {"append", ( PyCFunction ) SurfNurb_append, METH_VARARGS,
- "( point ) - add a new point. arg is BezTriple or list of x,y,z,w floats"},
-#endif
- {NULL, NULL, 0, NULL}
-};
-
-/*
- * SurfNurb_appendPointToNurb
- * this is a non-bpy utility func to add a point to a given nurb.
- * notice the first arg is Nurb*.
- */
-
-#if 0
-static PyObject *SurfNurb_appendPointToNurb( Nurb * nurb, PyObject * args )
-{
-
- int i;
- int size;
- PyObject *pyOb;
- int npoints = nurb->pntsu;
-
- /*
- do we have a list of four floats or a BezTriple?
- */
- if( !PyArg_ParseTuple( args, "O", &pyOb ))
- return EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "Internal error parsing arguments" );
-
-
-
- /* if curve is empty, adjust type depending on input type */
- if (nurb->bezt==NULL && nurb->bp==NULL) {
- if (BPy_BezTriple_Check( pyOb ))
- nurb->type |= CU_BEZIER;
- else if (PySequence_Check( pyOb ))
- nurb->type |= CU_NURBS;
- else
- return( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected a BezTriple or a Sequence of 4 (or 5) floats" ) );
- }
-
-
-
- if ((nurb->type & 7)==CU_BEZIER) {
- BezTriple *tmp;
-
- if( !BPy_BezTriple_Check( pyOb ) )
- return( EXPP_ReturnPyObjError( PyExc_TypeError,
- "Expected a BezTriple\n" ) );
-
-/* printf("\ndbg: got a BezTriple\n"); */
- tmp = nurb->bezt; /* save old points */
- nurb->bezt =
- ( BezTriple * ) MEM_mallocN( sizeof( BezTriple ) *
- ( npoints + 1 ),
- "SurfNurb_append2" );
-
- if( !nurb->bezt )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError, "allocation failed" ) );
-
- /* copy old points to new */
- if( tmp ) {
- memmove( nurb->bezt, tmp, sizeof( BezTriple ) * npoints );
- MEM_freeN( tmp );
- }
-
- nurb->pntsu++;
- /* add new point to end of list */
- memcpy( nurb->bezt + npoints,
- BezTriple_FromPyObject( pyOb ), sizeof( BezTriple ) );
-
- }
- else if( PySequence_Check( pyOb ) ) {
- size = PySequence_Size( pyOb );
-/* printf("\ndbg: got a sequence of size %d\n", size ); */
- if( size == 4 || size == 5 ) {
- BPoint *tmp;
-
- tmp = nurb->bp; /* save old pts */
-
- nurb->bp =
- ( BPoint * ) MEM_mallocN( sizeof( BPoint ) *
- ( npoints + 1 ),
- "SurfNurb_append1" );
- if( !nurb->bp )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "allocation failed" ) );
-
- memmove( nurb->bp, tmp, sizeof( BPoint ) * npoints );
- if( tmp )
- MEM_freeN( tmp );
-
- ++nurb->pntsu;
- /* initialize new BPoint from old */
- memcpy( nurb->bp + npoints, nurb->bp,
- sizeof( BPoint ) );
-
- for( i = 0; i < 4; ++i ) {
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return NULL;
-
-
- nurb->bp[npoints].vec[i] = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
-
- if (size == 5) {
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return NULL;
-
- nurb->bp[npoints].alfa = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
- else {
- nurb->bp[npoints].alfa = 0.0f;
- }
-
- makeknots( nurb, 1, nurb->flagu >> 1 );
-
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of 4 or 5 floats" );
- }
-
- } else {
- /* bail with error */
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a sequence of 4 or 5 floats" );
-
- }
-
- return ( EXPP_incr_ret( Py_None ) );
-}
-
-/*
- * SurfNurb_append( point )
- * append a new point to a nurb curve.
- * arg is BezTriple or list of xyzw floats
- */
-
-PyObject *SurfNurb_append( BPy_SurfNurb * self, PyObject * args )
-{
- Nurb *nurb = self->nurb;
-
- return SurfNurb_appendPointToNurb( nurb, args );
-}
-#endif
-
-#if 0
-/*
- * SurfNurb_getMatIndex
- *
- * returns index into material list
- */
-
-static PyObject *SurfNurb_getMatIndex( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->mat_nr );
-}
-
-/*
- * SurfNurb_setMatIndex
- *
- * set index into material list
- */
-
-static int SurfNurb_setMatIndex( BPy_SurfNurb * self, PyObject * args )
-{
- args = PyNumber_Int( args );
-
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- /* fixme: some range checking would be nice! */
- /* can't do range checking without knowing the "parent" curve! */
- self->nurb->mat_nr = ( short )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- return 0;
-}
-#endif
-
-/*
- * SurfNurb_getPointsU
- *
- * returns number of control points in U direction
- */
-
-static PyObject *SurfNurb_getPointsU( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->pntsu );
-}
-
-/*
- * SurfNurb_getPointsV
- *
- * returns number of control points in V direction
- */
-
-static PyObject *SurfNurb_getPointsV( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->pntsv );
-}
-
-/*
- * SurfNurb_getFlagU
- *
- * returns curve's flagu
- */
-
-static PyObject *SurfNurb_getFlagU( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) (self->nurb->flagu >> 1) );
-}
-
-/*
- * SurfNurb_setFlagU
- *
- * set curve's flagu and recalculate the knots
- *
- * Possible values: 0 - uniform, 2 - endpoints, 4 - bezier
- * bit 0 controls CU_CYCLIC
- */
-
-static int SurfNurb_setFlagU( BPy_SurfNurb * self, PyObject * args )
-{
- int flagu;
-
- args = PyNumber_Int( args );
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- flagu = ( int )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- if( flagu < 0 || flagu > 2 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected integer argument in range [0,2]" );
-
- flagu = (flagu << 1) | (self->nurb->flagu & CU_CYCLIC);
- if( self->nurb->flagu != flagu ) {
- self->nurb->flagu = (short)flagu;
- makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
- }
-
- return 0;
-}
-
-/*
- * SurfNurb_getFlagV
- *
- * returns curve's flagu
- */
-
-static PyObject *SurfNurb_getFlagV( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) (self->nurb->flagv >> 1) );
-}
-
-/*
- * SurfNurb_setFlagV
- *
- * set curve's flagu and recalculate the knots
- *
- * Possible values: 0 - uniform, 1 - endpoints, 2 - bezier
- */
-
-static int SurfNurb_setFlagV( BPy_SurfNurb * self, PyObject * args )
-{
- int flagv;
-
- args = PyNumber_Int( args );
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- flagv = ( int )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- if( flagv < 0 || flagv > 2 )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "expected integer argument in range [0,2]" );
-
- flagv = (flagv << 1) | (self->nurb->flagv & CU_CYCLIC);
- if( self->nurb->flagv != flagv ) {
- self->nurb->flagv = (short)flagv;
- makeknots( self->nurb, 2, self->nurb->flagv >> 1 );
- }
-
- return 0;
-}
-
-/*
- * SurfNurb_getOrder
- *
- * returns curve's order
- */
-
-static PyObject *SurfNurb_getOrderU( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->orderu );
-}
-
-static int SurfNurb_setOrderU( BPy_SurfNurb * self, PyObject * args )
-{
- int order;
-
- args = PyNumber_Int( args );
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- order = ( int )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- if( order < 2 ) order = 2;
- else if( order > 6 ) order = 6;
-
- if( self->nurb->pntsu < order )
- order = self->nurb->pntsu;
-
- self->nurb->orderu = (short)order;
- makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
-
- return 0;
-}
-
-static PyObject *SurfNurb_getOrderV( BPy_SurfNurb * self )
-{
- return PyInt_FromLong( ( long ) self->nurb->orderv );
-}
-
-static int SurfNurb_setOrderV( BPy_SurfNurb * self, PyObject * args )
-{
- int order;
-
- args = PyNumber_Int( args );
- if( !args )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- order = ( int )PyInt_AS_LONG( args );
- Py_DECREF( args );
-
- if( order < 2 ) order = 2;
- else if( order > 6 ) order = 6;
-
- if( self->nurb->pntsv < order )
- order = self->nurb->pntsv;
-
- self->nurb->orderv = (short)order;
- makeknots( self->nurb, 2, self->nurb->flagv >> 1 );
- return 0;
-}
-
-/*
- * SurfNurb_getCyclic()
- * test whether surface is cyclic (closed) or not (open)
- */
-
-static PyObject *SurfNurb_getCyclicU( BPy_SurfNurb * self )
-{
- if( self->nurb->flagu & CU_CYCLIC )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static PyObject *SurfNurb_getCyclicV( BPy_SurfNurb * self )
-{
- if( self->nurb->flagv & CU_CYCLIC )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static int SurfNurb_setCyclicU( BPy_SurfNurb * self, PyObject * value )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->nurb->flagu |= CU_CYCLIC;
- else
- self->nurb->flagu &= ~CU_CYCLIC;
- makeknots( self->nurb, 1, self->nurb->flagu >> 1 );
- return 0;
-}
-
-static int SurfNurb_setCyclicV( BPy_SurfNurb * self, PyObject * value )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->nurb->flagv |= CU_CYCLIC;
- else
- self->nurb->flagv &= ~CU_CYCLIC;
- makeknots( self->nurb, 2, self->nurb->flagu >> 1 );
- return 0;
-}
-
-/*
- * SurfNurb_getKnotsU
- *
- * Returns surface's knotsU in a tuple. Empty tuple is returned if
- * surface isn't Nurbs or it doesn't have knots in U
- */
-
-static PyObject *SurfNurb_getKnotsU( BPy_SurfNurb * self )
-{
- if(self->nurb->knotsu) {
- int len = KNOTSU(self->nurb);
- int i;
- PyObject *knotsu = PyTuple_New(len);
- if( !knotsu )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get SurfNurb.knotsU attribute" );
-
- for(i = 0; i < len; ++i)
- PyTuple_SetItem(knotsu, i,
- PyFloat_FromDouble(self->nurb->knotsu[i]));
-
- return knotsu;
- }
- return PyTuple_New(0);
-}
-
-/*
- * SurfNurb_getKnotsV
- *
- * Returns surface's knotsV in a tuple. Empty tuple is returned if
- * curve doesn't have knots in V
- */
-
-static PyObject *SurfNurb_getKnotsV( BPy_SurfNurb * self )
-{
- if(self->nurb->knotsv) {
- int len = KNOTSV(self->nurb);
- int i;
- PyObject *knotsv = PyTuple_New(len);
- if( !knotsv )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "could not get SurfNurb.knotsV index" );
-
- for(i = 0; i < len; ++i)
- PyTuple_SetItem(knotsv, i,
- PyFloat_FromDouble(self->nurb->knotsv[i] ));
-
- return knotsv;
- }
- return PyTuple_New(0);
-}
-
-
-/*
- * SurfNurb_getIter
- *
- * create an iterator for our SurfNurb.
- * this iterator returns the points for this SurfNurb.
- */
-
-static PyObject *SurfNurb_getIter( BPy_SurfNurb * self )
-{
- self->bp = self->nurb->bp;
- self->bezt = self->nurb->bezt;
- self->nextPoint = 0;
-
- Py_INCREF( self );
- return ( PyObject * ) self;
-}
-
-static PyObject *SurfNurb_iterNext( BPy_SurfNurb * self )
-{
- Nurb *pnurb = self->nurb;
- int npoints = pnurb->pntsu * pnurb->pntsv;
-
- if( self->bp && self->nextPoint < npoints )
- return SurfNurb_pointAtIndex( self->nurb, self->nextPoint++ );
- else
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
-}
-
-/*
- * SurfNurb_length
- * returns the number of points in a Nurb
- * this is a tp_as_sequence method, not a regular instance method.
- */
-
-static int SurfNurb_length( PyInstanceObject * inst )
-{
- Nurb *nurb;
-
- if( BPy_SurfNurb_Check( ( PyObject * ) inst ) ) {
- nurb = ( ( BPy_SurfNurb * ) inst )->nurb;
- return (int)(nurb->pntsu * nurb->pntsu);
- }
-
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "arg is not a BPy_SurfNurb" );
-}
-
-
-/*
- * SurfNurb_getPoint
- * returns the Nth point in a Nurb
- * this is one of the tp_as_sequence methods, hence the int N argument.
- * it is called via the [] operator, not as a usual instance method.
- */
-
-PyObject *SurfNurb_getPoint( BPy_SurfNurb * self, int index )
-{
- Nurb *myNurb;
-
- int npoints;
-
- /* for convenince */
- myNurb = self->nurb;
- npoints = myNurb->pntsu * myNurb->pntsv;
-
- /* bail if no Nurbs in Curve */
- if( npoints == 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "no points in this SurfNurb" ) );
-
- /* check index limits */
- if( index >= npoints || index < 0 )
- return ( EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" ) );
-
- return SurfNurb_pointAtIndex( myNurb, index );
-}
-
-/*
- * SurfNurb_setPoint
- * modifies the Nth point in a Nurb
- * this is one of the tp_as_sequence methods, hence the int N argument.
- * it is called via the [] = operator, not as a usual instance method.
- */
-static int SurfNurb_setPoint( BPy_SurfNurb * self, int index, PyObject * pyOb )
-{
- Nurb *nurb = self->nurb;
- int size;
-
- /* check index limits */
- if( index < 0 || index >= nurb->pntsu * nurb->pntsv )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array assignment index out of range\n" );
-
- /* branch by curve type */
-#if 0
- if ((nurb->type & 7)==CU_BEZIER) { /* BEZIER */
- /* check parameter type */
- if( !BPy_BezTriple_Check( pyOb ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a BezTriple\n" );
-
- /* copy bezier in array */
- memcpy( nurb->bezt + index,
- BezTriple_FromPyObject( pyOb ), sizeof( BezTriple ) );
-
- return 0; /* finished correctly */
- }
- else
-#endif
- { /* NURBS or POLY */
- int i;
-
- /* check parameter type */
- if (!PySequence_Check( pyOb ))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of 4 (or optionaly 5 if the curve is 3D) floats\n" );
-
- size = PySequence_Size( pyOb );
-
- /* check sequence size */
- if( size != 4 && size != 5 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a list of 4 (or optionaly 5 if the curve is 3D) floats\n" );
-
- /* copy x, y, z, w */
- for( i = 0; i < 4; ++i ) {
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return -1;
-
- nurb->bp[index].vec[i] = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
-
- if (size == 5) { /* set tilt, if present */
- PyObject *item = PySequence_GetItem( pyOb, i );
-
- if (item == NULL)
- return -1;
-
- nurb->bp[index].alfa = ( float ) PyFloat_AsDouble( item );
- Py_DECREF( item );
- }
- else { /* if not, set default */
- nurb->bp[index].alfa = 0.0f;
- }
-
- return 0; /* finished correctly */
- }
-}
-
-
-/*
- * this is an internal routine. not callable directly from python
- */
-
-PyObject *SurfNurb_pointAtIndex( Nurb * nurb, int index )
-{
- PyObject *pyo;
-
- if( nurb->bp ) { /* we have a nurb curve */
- int i;
-
- /* add Tilt only if curve is 3D */
- if (nurb->flag & CU_3D)
- pyo = PyList_New( 5 );
- else
- pyo = PyList_New( 4 );
-
- for( i = 0; i < 4; i++ ) {
- PyList_SetItem( pyo, i,
- PyFloat_FromDouble( nurb->bp[index].
- vec[i] ) );
- }
-
- /* add Tilt only if curve is 3D */
- if (nurb->flag & CU_3D)
- PyList_SetItem( pyo, 4, PyFloat_FromDouble( nurb->bp[index].alfa ) );
- return pyo;
-
- } else /* something is horribly wrong */
- return EXPP_ReturnPyObjError( PyExc_SystemError,
- "non-NURB surface found" );
-}
-
-/*
- * methods for SurfNurb as sequence
- */
-
-static PySequenceMethods SurfNurb_as_sequence = {
- ( inquiry ) SurfNurb_length, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) SurfNurb_getPoint, /* sq_item */
- ( intintargfunc ) 0, /* sq_slice */
- ( intobjargproc ) SurfNurb_setPoint, /* sq_ass_item */
- 0, /* sq_ass_slice */
- ( objobjproc ) 0, /* sq_contains */
- 0,
- 0
-};
-
-static PyGetSetDef BPy_SurfNurb_getseters[] = {
-#if 0
- {"matIndex",
- (getter)SurfNurb_getMatIndex, (setter)SurfNurb_setMatIndex,
- "material index", NULL},
-#endif
- {"pointsU",
- (getter)SurfNurb_getPointsU, (setter)NULL,
- "number of control points in U direction", NULL},
- {"pointsV",
- (getter)SurfNurb_getPointsV, (setter)NULL,
- "number of control points in V direction", NULL},
- {"flagU",
- (getter)SurfNurb_getFlagU, (setter)SurfNurb_setFlagU,
- "knot flag for U direction", NULL},
- {"flagV",
- (getter)SurfNurb_getFlagV, (setter)SurfNurb_setFlagV,
- "knot flag for V direction", NULL},
- {"cyclicU",
- (getter)SurfNurb_getCyclicU, (setter)SurfNurb_setCyclicU,
- "cyclic setting for U direction", NULL},
- {"cyclicV",
- (getter)SurfNurb_getCyclicV, (setter)SurfNurb_setCyclicV,
- "cyclic setting for V direction", NULL},
- {"orderU",
- (getter)SurfNurb_getOrderU, (setter)SurfNurb_setOrderU,
- "order setting for U direction", NULL},
- {"orderV",
- (getter)SurfNurb_getOrderV, (setter)SurfNurb_setOrderV,
- "order setting for V direction", NULL},
- {"knotsU",
- (getter)SurfNurb_getKnotsU, (setter)NULL,
- "The The knot vector in the U direction",
- NULL},
- {"knotsV",
- (getter)SurfNurb_getKnotsV, (setter)NULL,
- "The The knot vector in the V direction",
- NULL},
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*
- * compare
- * in this case, we consider two SurfNurbs equal, if they point to the same
- * blender data.
-*/
-static int SurfNurb_compare( BPy_SurfNurb * a, BPy_SurfNurb * b )
-{
- return ( a->nurb == b->nurb ) ? 0 : -1;
-}
-
-/*
- * SurfNurb_repr
- */
-static PyObject *SurfNurb_repr( BPy_SurfNurb * self )
-{
- return PyString_FromFormat( "[SurfNurb \"%d\"]", self->nurb->type );
-}
-
-/*****************************************************************************/
-/* Python SurfNurb_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject SurfNurb_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "SurfNurb", /* char *tp_name; */
- sizeof( BPy_SurfNurb ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) SurfNurb_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) SurfNurb_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &SurfNurb_as_sequence, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) SurfNurb_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) SurfNurb_iterNext, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_SurfNurb_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_SurfNurb_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*
- factory method to create a BPy_SurfNurb from a Blender Nurb
-*/
-
-PyObject *SurfNurb_CreatePyObject( Nurb * blen_nurb )
-{
- BPy_SurfNurb *pyNurb;
-
- pyNurb = ( BPy_SurfNurb * ) PyObject_NEW( BPy_SurfNurb, &SurfNurb_Type );
-
- if( !pyNurb )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "could not create BPy_SurfNurb PyObject" );
-
- pyNurb->nurb = blen_nurb;
- return ( PyObject * ) pyNurb;
-}
-
-
-PyObject *SurfNurb_Init( void )
-{
- PyType_Ready( &SurfNurb_Type );
- return Py_InitModule3( "Blender.SurfNurb", M_SurfNurb_methods,
- M_SurfNurb_doc );
-}
-
diff --git a/source/blender/python/api2_2x/SurfNurb.h b/source/blender/python/api2_2x/SurfNurb.h
deleted file mode 100644
index 8438df0b7b2..00000000000
--- a/source/blender/python/api2_2x/SurfNurb.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EXPP_SURFNURB_H
-#define EXPP_SURFNURB_H
-
-#include <Python.h>
-#include "DNA_curve_types.h"
-
-extern PyTypeObject SurfNurb_Type;
-
-#define BPy_SurfNurb_Check(v) ((v)->ob_type == &SurfNurb_Type) /* for type checking */
-
-/* Python BPy_SurfNurb structure definition */
-typedef struct {
- PyObject_HEAD
- Nurb * nurb;
-
- /* iterator stuff */
- /* internal ptrs to point data. do not free */
- BPoint *bp;
- BezTriple *bezt;
- int atEnd; /* iter exhausted flag */
- int nextPoint;
-
-} BPy_SurfNurb;
-
-
-/*
- * prototypes
- */
-
-PyObject *SurfNurb_Init( void );
-PyObject *SurfNurb_CreatePyObject( Nurb * bzt );
-Nurb *SurfNurb_FromPyObject( PyObject * pyobj );
-
-PyObject *SurfNurb_getPoint( BPy_SurfNurb * self, int index );
-PyObject *SurfNurb_pointAtIndex( Nurb * nurb, int index );
-
-#endif /* EXPP_SURFNURB_H */
diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c
deleted file mode 100644
index 16d879c3032..00000000000
--- a/source/blender/python/api2_2x/Sys.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Sys.h" /*This must come first*/
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BLI_blenlib.h"
-#include "DNA_scene_types.h" /* G.scene-"r.cfra */
-#include "PIL_time.h"
-#include "gen_utils.h"
-
-#ifdef WIN32
-#define DIRSEP '\\'
-#define DIRSEP_STR "\\"
-#else
-#define DIRSEP '/'
-#define DIRSEP_STR "/"
-#endif
-
-
-/*****************************************************************************/
-/* Python API function prototypes for the sys module. */
-/*****************************************************************************/
-static PyObject *M_sys_basename( PyObject * self, PyObject * value );
-static PyObject *M_sys_dirname( PyObject * self, PyObject * value );
-static PyObject *M_sys_join( PyObject * self, PyObject * args );
-static PyObject *M_sys_splitext( PyObject * self, PyObject * value );
-static PyObject *M_sys_makename( PyObject * self, PyObject * args,
- PyObject * kw );
-static PyObject *M_sys_exists( PyObject * self, PyObject * value );
-static PyObject *M_sys_time( PyObject * self );
-static PyObject *M_sys_sleep( PyObject * self, PyObject * args );
-static PyObject *M_sys_expandpath( PyObject *self, PyObject *value);
-static PyObject *M_sys_cleanpath( PyObject *self, PyObject *value);
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.sys.__doc__ */
-/*****************************************************************************/
-static char M_sys_doc[] = "The Blender.sys submodule\n\
-\n\
-This is a minimal system module to supply simple functionality available\n\
-in the default Python module os.";
-
-static char M_sys_basename_doc[] =
- "(path) - Split 'path' in dir and filename.\n\
-Return the filename.";
-
-static char M_sys_dirname_doc[] =
- "(path) - Split 'path' in dir and filename.\n\
-Return the dir.";
-
-static char M_sys_join_doc[] =
- "(dir, file) - Join dir and file to form a full filename.\n\
-Return the filename.";
-
-static char M_sys_splitext_doc[] =
- "(path) - Split 'path' in root and extension:\n\
-/this/that/file.ext -> ('/this/that/file','.ext').\n\
-Return the pair (root, extension).";
-
-static char M_sys_makename_doc[] =
- "(path = Blender.Get('filename'), ext = \"\", strip = 0) -\n\
-Strip dir and extension from path, leaving only a name, then append 'ext'\n\
-to it (if given) and return the resulting string.\n\n\
-(path) - string: a pathname -- Blender.Get('filename') if 'path' isn't given;\n\
-(ext = \"\") - string: the extension to append.\n\
-(strip = 0) - int: strip dirname from 'path' if given and non-zero.\n\
-Ex: makename('/path/to/file/myfile.foo','-01.abc') returns 'myfile-01.abc'\n\
-Ex: makename(ext='.txt') returns 'untitled.txt' if Blender.Get('filename')\n\
-returns a path to the file 'untitled.blend'";
-
-static char M_sys_time_doc[] =
- "() - Return a float representing time elapsed in seconds.\n\
-Each successive call is garanteed to return values greater than or\n\
-equal to the previous call.";
-
-static char M_sys_sleep_doc[] =
- "(milliseconds = 10) - Sleep for the specified time.\n\
-(milliseconds = 10) - the amount of time in milliseconds to sleep.\n\
-This function can be necessary in tight 'get event' loops.";
-
-static char M_sys_exists_doc[] =
- "(path) - Check if the given pathname exists.\n\
-The return value is as follows:\n\
-\t 0: path doesn't exist;\n\
-\t 1: path is an existing filename;\n\
-\t 2: path is an existing dirname;\n\
-\t-1: path exists but is neither a regular file nor a dir.";
-
-static char M_sys_expandpath_doc[] =
-"(path) - Expand this Blender internal path to a proper file system path.\n\
-(path) - the string path to convert.\n\n\
-Note: internally Blender paths can contain two special character sequences:\n\
-- '//' (at start) for base path directory (the current .blend's dir path);\n\
-- '#' characters in the filename will be replaced by the frame number.\n\n\
-This function expands these to their actual content, returning a valid path.\n\
-If the special chars are not found in the given path, it is simply returned.";
-
-static char M_sys_cleanpath_doc[] =
-"(path) - Removes parts of a path that are not needed paths such as '../foo/../bar/' and '//./././'";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.sys module: */
-/*****************************************************************************/
-struct PyMethodDef M_sys_methods[] = {
- {"basename", M_sys_basename, METH_O, M_sys_basename_doc},
- {"dirname", M_sys_dirname, METH_O, M_sys_dirname_doc},
- {"join", M_sys_join, METH_VARARGS, M_sys_join_doc},
- {"splitext", M_sys_splitext, METH_O, M_sys_splitext_doc},
- {"makename", ( PyCFunction ) M_sys_makename,
- METH_VARARGS | METH_KEYWORDS,
- M_sys_makename_doc},
- {"exists", M_sys_exists, METH_O, M_sys_exists_doc},
- {"sleep", M_sys_sleep, METH_VARARGS, M_sys_sleep_doc},
- {"time", ( PyCFunction ) M_sys_time, METH_NOARGS, M_sys_time_doc},
- {"expandpath", M_sys_expandpath, METH_O, M_sys_expandpath_doc},
- {"cleanpath", M_sys_cleanpath, METH_O, M_sys_cleanpath_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/* Module Functions */
-
-PyObject *sys_Init( void )
-{
- PyObject *submodule, *dict;
-
- submodule = Py_InitModule3( "Blender.sys", M_sys_methods, M_sys_doc );
-
- dict = PyModule_GetDict( submodule );
-
- EXPP_dict_set_item_str( dict, "dirsep", PyString_FromString(DIRSEP_STR) );
- EXPP_dict_set_item_str( dict, "sep", PyString_FromString(DIRSEP_STR) );
-
- return submodule;
-}
-
-static PyObject *M_sys_basename( PyObject * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
- char *p, basename[FILE_MAXDIR + FILE_MAXFILE];
- int n, len;
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- len = strlen( name );
-
-#ifdef WIN32
- p = MAX2(strrchr( name, '/' ), strrchr( name, '\\' ));
-#else
- p = strrchr( name, DIRSEP );
-#endif
-
- if( p ) {
- n = name + len - p - 1; /* - 1 because we don't want the sep */
-
- if( n > FILE_MAXDIR + FILE_MAXFILE )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "path too long" );
-
- BLI_strncpy( basename, p + 1, n + 1 );
- return PyString_FromString( basename );
- }
-
- return PyString_FromString( name );
-}
-
-static PyObject *M_sys_dirname( PyObject * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
- char *p, dirname[FILE_MAXDIR + FILE_MAXFILE];
- int n;
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
-#ifdef WIN32
- p = MAX2(strrchr( name, '/' ), strrchr( name, '\\' ));
-#else
- p = strrchr( name, DIRSEP );
-#endif
-
- if( p ) {
- n = p - name;
-
- if( n > FILE_MAXDIR + FILE_MAXFILE )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "path too long" );
-
- BLI_strncpy( dirname, name, n + 1 );
- return PyString_FromString( dirname );
- }
-
- return PyString_FromString( "." );
-}
-
-static PyObject *M_sys_join( PyObject * self, PyObject * args )
-{
- char *name = NULL, *path = NULL;
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- int pathlen = 0, namelen = 0;
-
- if( !PyArg_ParseTuple( args, "ss", &path, &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- pathlen = strlen( path ) + 1;
- namelen = strlen( name ) + 1; /* + 1 to account for '\0' for BLI_strncpy */
-
- if( pathlen + namelen > FILE_MAXDIR + FILE_MAXFILE - 1 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "filename is too long." );
-
- BLI_strncpy( filename, path, pathlen );
-
- if( filename[pathlen - 2] != DIRSEP ) {
- filename[pathlen - 1] = DIRSEP;
- pathlen += 1;
- }
-
- BLI_strncpy( filename + pathlen - 1, name, namelen );
-
- return PyString_FromString( filename );
-}
-
-static PyObject *M_sys_splitext( PyObject * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
- char *dot, *p, path[FILE_MAXDIR + FILE_MAXFILE], ext[FILE_MAXDIR + FILE_MAXFILE];
- int n, len;
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- len = strlen( name );
- dot = strrchr( name, '.' );
-
- if( !dot )
- return Py_BuildValue( "ss", name, "" );
-
- p = strrchr( name, DIRSEP );
-
- if( p ) {
- if( p > dot )
- return Py_BuildValue( "ss", name, "" );
- }
-
- n = name + len - dot;
-
- /* loong extensions are supported -- foolish, but Python's os.path.splitext
- * supports them, so ... */
-
- if( n >= FILE_MAXDIR + FILE_MAXFILE || ( len - n ) >= FILE_MAXDIR + FILE_MAXFILE )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, "path too long" );
-
- BLI_strncpy( ext, dot, n + 1 );
- BLI_strncpy( path, name, dot - name + 1 );
-
- return Py_BuildValue( "ss", path, ext );
-}
-
-static PyObject *M_sys_makename( PyObject * self, PyObject * args,
- PyObject * kw )
-{
- char *path = G.sce, *ext = NULL;
- int strip = 0;
- static char *kwlist[] = { "path", "ext", "strip", NULL };
- char *dot = NULL, *p = NULL, basename[FILE_MAXDIR + FILE_MAXFILE];
- int n, len, lenext = 0;
-
- if( !PyArg_ParseTupleAndKeywords( args, kw, "|ssi", kwlist,
- &path, &ext, &strip ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected one or two strings and an int (or nothing) as arguments" );
-
- len = strlen( path ) + 1; /* + 1 to consider ending '\0' */
- if( ext )
- lenext = strlen( ext ) + 1;
-
- if( ( len + lenext ) > FILE_MAXDIR + FILE_MAXFILE )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "path too long" );
-
- p = strrchr( path, DIRSEP );
-
- if( p && strip ) {
- n = path + len - p;
- BLI_strncpy( basename, p + 1, n ); /* + 1 to skip the sep */
- } else
- BLI_strncpy( basename, path, len );
-
- dot = strrchr( basename, '.' );
-
- /* now the extension: always remove the one in basename */
- if( dot || ext ) {
- if( !ext )
- basename[dot - basename] = '\0';
- else { /* if user gave an ext, append it */
-
- if( dot )
- n = dot - basename;
- else
- n = strlen( basename );
-
- BLI_strncpy( basename + n, ext, lenext );
- }
- }
-
- return PyString_FromString( basename );
-}
-
-static PyObject *M_sys_time( PyObject * self )
-{
- return PyFloat_FromDouble( PIL_check_seconds_timer( ) );
-}
-
-static PyObject *M_sys_sleep( PyObject * self, PyObject * args )
-{
- int millisecs = 10;
-
- if( !PyArg_ParseTuple( args, "|i", &millisecs ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- PIL_sleep_ms( millisecs );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *M_sys_exists( PyObject * self, PyObject * value )
-{
- char *fname = PyString_AsString(value);
-
- int mode = 0, i = -1;
-
- if( !fname )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string (pathname) argument" );
-
- mode = BLI_exist(fname);
-
- if( mode == 0 )
- i = 0;
- else if( S_ISREG( mode ) )
- i = 1;
- else if( S_ISDIR( mode ) )
- i = 2;
- /* i stays as -1 if path exists but is neither a regular file nor a dir */
-
- return PyInt_FromLong(i);
-}
-
-static PyObject *M_sys_expandpath( PyObject * self, PyObject * value )
-{
- char *path = PyString_AsString(value);
- char expanded[FILE_MAXDIR + FILE_MAXFILE];
-
- if (!path)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- BLI_strncpy(expanded, path, FILE_MAXDIR + FILE_MAXFILE);
- BLI_convertstringcode(expanded, G.sce);
- BLI_convertstringframe(expanded, G.scene->r.cfra);
-
- return PyString_FromString(expanded);
-}
-
-static PyObject *M_sys_cleanpath( PyObject * self, PyObject * value )
-{
- char *path = PyString_AsString(value);
- char cleaned[FILE_MAXDIR + FILE_MAXFILE];
- int trailing_slash = 0, last;
- if (!path)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
- last = strlen(path)-1;
- if ((last >= 0) && ((path[last]=='/') || (path[last]=='\\'))) {
- trailing_slash = 1;
- }
- BLI_strncpy(cleaned, path, FILE_MAXDIR + FILE_MAXFILE);
- BLI_cleanup_file(NULL, cleaned);
-
- if (trailing_slash) {
- BLI_add_slash(cleaned);
- }
-
- return PyString_FromString(cleaned);
-}
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c
deleted file mode 100644
index c8b96fbd97e..00000000000
--- a/source/blender/python/api2_2x/Text.c
+++ /dev/null
@@ -1,932 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Text.h" /*This must come first*/
-
-#include "BKE_library.h"
-#include "BKE_sca.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BIF_drawtext.h"
-#include "BIF_screen.h"
-#include "BKE_text.h"
-#include "BKE_suggestions.h"
-#include "BLI_blenlib.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "MEM_guardedalloc.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "../BPY_extern.h"
-
-#define EXPP_TEXT_MODE_FOLLOW TXT_FOLLOW
-
-/* checks for the group being removed */
-#define TEXT_DEL_CHECK_PY(bpy_text) if (!(bpy_text->text)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Text has been removed" ) )
-#define TEXT_DEL_CHECK_INT(bpy_text) if (!(bpy_text->text)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Text has been removed" ) )
-
-/*****************************************************************************/
-/* Python API function prototypes for the Text module. */
-/*****************************************************************************/
-static PyObject *M_Text_New( PyObject * self, PyObject * args);
-static PyObject *M_Text_Get( PyObject * self, PyObject * args );
-static PyObject *M_Text_Load( PyObject * self, PyObject * value );
-static PyObject *M_Text_unlink( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Text.__doc__ */
-/*****************************************************************************/
-static char M_Text_doc[] = "The Blender Text module\n\n";
-
-static char M_Text_New_doc[] = "() - return a new Text object";
-
-static char M_Text_Get_doc[] = "(name) - return the Text with name 'name', \
-returns None if not found.\n If 'name' is not specified, \
-it returns a list of all Texts in the\ncurrent scene.";
-
-static char M_Text_Load_doc[] =
- "(filename) - return text from file filename as a Text Object, \
-returns None if not found.\n";
-
-static char M_Text_unlink_doc[] =
- "(text) - remove Text object 'text' from Blender";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Text module: */
-/*****************************************************************************/
-struct PyMethodDef M_Text_methods[] = {
- {"New", M_Text_New, METH_VARARGS, M_Text_New_doc},
- {"Get", M_Text_Get, METH_VARARGS, M_Text_Get_doc},
- {"get", M_Text_Get, METH_VARARGS, M_Text_Get_doc},
- {"Load", M_Text_Load, METH_O, M_Text_Load_doc},
- {"unlink", M_Text_unlink, METH_VARARGS, M_Text_unlink_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-/*****************************************************************************/
-/* Python BPy_Text methods declarations: */
-/*****************************************************************************/
-static PyObject *Text_getFilename( BPy_Text * self );
-static PyObject *Text_getNLines( BPy_Text * self );
-static PyObject *Text_clear( BPy_Text * self );
-static PyObject *Text_reset( BPy_Text * self );
-static PyObject *Text_readline( BPy_Text * self );
-static PyObject *Text_write( BPy_Text * self, PyObject * value );
-static PyObject *Text_insert( BPy_Text * self, PyObject * value );
-static PyObject *Text_delete( BPy_Text * self, PyObject * value );
-static PyObject *Text_set( BPy_Text * self, PyObject * args );
-static PyObject *Text_asLines( BPy_Text * self, PyObject * args );
-static PyObject *Text_getCursorPos( BPy_Text * self );
-static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args );
-static PyObject *Text_getSelectPos( BPy_Text * self );
-static PyObject *Text_setSelectPos( BPy_Text * self, PyObject * args );
-static PyObject *Text_markSelection( BPy_Text * self, PyObject * args );
-static PyObject *Text_suggest( BPy_Text * self, PyObject * args );
-static PyObject *Text_showDocs( BPy_Text * self, PyObject * args );
-
-static void text_reset_internal( BPy_Text * self ); /* internal func */
-
-/*****************************************************************************/
-/* Python BPy_Text methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Text_methods[] = {
- /* name, method, flags, doc */
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Text Object name"},
- {"getFilename", ( PyCFunction ) Text_getFilename, METH_VARARGS,
- "() - Return Text Object filename"},
- {"getNLines", ( PyCFunction ) Text_getNLines, METH_VARARGS,
- "() - Return number of lines in text buffer"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(str) - Change Text Object name"},
- {"clear", ( PyCFunction ) Text_clear, METH_NOARGS,
- "() - Clear Text buffer"},
- {"reset", ( PyCFunction ) Text_reset, METH_NOARGS,
- "() - Moves the IO pointer back to the start of the Text buffer for reading"},
- {"readline", ( PyCFunction ) Text_readline, METH_NOARGS,
- "() - Reads a line of text from the buffer and returns it incrementing the internal IO pointer."},
- {"write", ( PyCFunction ) Text_write, METH_O,
- "(line) - Append string 'str' to Text buffer"},
- {"insert", ( PyCFunction ) Text_insert, METH_O,
- "(line) - Insert string 'str' to Text buffer at cursor location"},
- {"delete", ( PyCFunction ) Text_delete, METH_O,
- "(chars) - Deletes a number of characters to the left (chars<0) or right (chars>0)"},
- {"set", ( PyCFunction ) Text_set, METH_VARARGS,
- "(name, val) - Set attribute 'name' to value 'val'"},
- {"asLines", ( PyCFunction ) Text_asLines, METH_VARARGS,
- "(start=0, end=nlines) - Return text buffer as a list of lines between start and end"},
- {"getCursorPos", ( PyCFunction ) Text_getCursorPos, METH_NOARGS,
- "() - Return cursor position as (row, col) tuple"},
- {"setCursorPos", ( PyCFunction ) Text_setCursorPos, METH_VARARGS,
- "(row, col) - Set the cursor position to (row, col)"},
- {"getSelectPos", ( PyCFunction ) Text_getSelectPos, METH_NOARGS,
- "() - Return the selection cursor position as (row, col) tuple"},
- {"setSelectPos", ( PyCFunction ) Text_setSelectPos, METH_VARARGS,
- "(row, col) - Set the selection cursor position to (row, col)"},
- {"markSelection", ( PyCFunction ) Text_markSelection, METH_VARARGS,
- "(group, (r, g, b), flags) - Places a marker over the current selection. Group: number > 0, flags: TMARK_TEMP, TMARK_EDITALL, etc."},
- {"suggest", ( PyCFunction ) Text_suggest, METH_VARARGS,
- "(list, prefix='') - Presents a list of suggestions. List is of strings, or tuples. Tuples must be of the form (name, type) where type is one of 'm', 'v', 'f', 'k' for module, variable, function and keyword respectively or '?' for other types"},
- {"showDocs", ( PyCFunction ) Text_showDocs, METH_VARARGS,
- "(docs) - Documentation string"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Text_Type callback function prototypes: */
-/*****************************************************************************/
-static int Text_compare( BPy_Text * a, BPy_Text * b );
-static PyObject *Text_repr( BPy_Text * self );
-
-/*****************************************************************************/
-/* Function: M_Text_New */
-/* Python equivalent: Blender.Text.New */
-/*****************************************************************************/
-static PyObject *M_Text_New( PyObject * self, PyObject * args)
-{
- char *name = "Text";
- int follow = 0;
- Text *bl_text; /* blender text object */
- PyObject *py_text; /* python wrapper */
-
- if( !PyArg_ParseTuple( args, "|si", &name, &follow ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string and int arguments (or nothing)" );
-
- bl_text = add_empty_text( name );
-
- if( bl_text ) {
- /* do not set user count because Text is already linked */
-
- /* create python wrapper obj */
- py_text = Text_CreatePyObject( bl_text );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Text Object in Blender" );
- if( !py_text )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Text Object wrapper" );
-
- if( follow )
- bl_text->flags |= EXPP_TEXT_MODE_FOLLOW;
-
- return py_text;
-}
-
-/*****************************************************************************/
-/* Function: M_Text_Get */
-/* Python equivalent: Blender.Text.Get */
-/* Description: Receives a string and returns the text object */
-/* whose name matches the string. If no argument is */
-/* passed in, a list of all text names in the current */
-/* scene is returned. */
-/*****************************************************************************/
-static PyObject *M_Text_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Text *txt_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- txt_iter = G.main->text.first;
-
- if( name ) { /* (name) - Search text by name */
-
- PyObject *wanted_txt = NULL;
-
- while( ( txt_iter ) && ( wanted_txt == NULL ) ) {
-
- if( strcmp( name, txt_iter->id.name + 2 ) == 0 ) {
- wanted_txt = Text_CreatePyObject( txt_iter );
- }
-
- txt_iter = txt_iter->id.next;
- }
-
- if( wanted_txt == NULL ) { /* Requested text doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Text \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return wanted_txt;
- }
-
- else { /* () - return a list of all texts in the scene */
- int index = 0;
- PyObject *txtlist, *pyobj;
-
- txtlist = PyList_New( BLI_countlist( &( G.main->text ) ) );
-
- if( txtlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( txt_iter ) {
- pyobj = Text_CreatePyObject( txt_iter );
-
- if( !pyobj ) {
- Py_DECREF(txtlist);
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create PyString" ) );
- }
- PyList_SET_ITEM( txtlist, index, pyobj );
-
- txt_iter = txt_iter->id.next;
- index++;
- }
-
- return ( txtlist );
- }
-}
-
-/*****************************************************************************/
-/* Function: M_Text_Load */
-/* Python equivalent: Blender.Text.Load */
-/* Description: Receives a filename and returns the text object */
-/* created from the corresponding file. */
-/*****************************************************************************/
-static PyObject *M_Text_Load( PyObject * self, PyObject * value )
-{
- char *fname = PyString_AsString(value);
- char fpath[FILE_MAXDIR + FILE_MAXFILE];
- Text *txt_ptr = NULL;
- unsigned int maxlen = FILE_MAXDIR + FILE_MAXFILE;
-
- if( !fname )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" ) );
-
- if (strlen(fname) > (maxlen - 1))
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "text filename too long");
- else if (!BLI_exists(fname))
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "text file not found");
-
- BLI_strncpy(fpath, fname, maxlen);
-
- txt_ptr = add_text( fpath );
- if( !txt_ptr )
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load text" );
-
- return Text_CreatePyObject(txt_ptr);
-}
-
-/*****************************************************************************/
-/* Function: M_Text_unlink */
-/* Python equivalent: Blender.Text.unlink */
-/* Description: Removes the given Text object from Blender */
-/*****************************************************************************/
-static PyObject *M_Text_unlink( PyObject * self, PyObject * args )
-{
- BPy_Text *textobj;
- Text *text;
-
- if( !PyArg_ParseTuple( args, "O!", &Text_Type, &textobj ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a Text object as argument" );
-
- text = ( ( BPy_Text * ) textobj )->text;
-
- if( !text )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "this text was already unlinked!" );
-
- BPY_clear_bad_scriptlinks( text );
- BPY_free_pyconstraint_links( text );
- free_text_controllers( text );
- unlink_text( text );
-
- free_libblock( &G.main->text, text );
-
- ( ( BPy_Text * ) textobj )->text = NULL;
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Text_Init */
-/*****************************************************************************/
-PyObject *Text_Init( void )
-{
- PyObject *submodule, *dict;
-
- if( PyType_Ready( &Text_Type ) < 0 )
- return NULL;
-
- submodule =
- Py_InitModule3( "Blender.Text", M_Text_methods, M_Text_doc );
-
- dict = PyModule_GetDict( submodule );
-
-#define EXPP_ADDCONST(x) \
- EXPP_dict_set_item_str(dict, #x, PyInt_FromLong(x))
-
- /* So, for example:
- * EXPP_ADDCONST(LEFTMOUSE) becomes
- * EXPP_dict_set_item_str(dict, "LEFTMOUSE", PyInt_FromLong(LEFTMOUSE))
- */
-
- EXPP_ADDCONST( TMARK_TEMP );
- EXPP_ADDCONST( TMARK_EDITALL );
-
- return ( submodule );
-}
-
-/*****************************************************************************/
-/* Function: Text_CreatePyObject */
-/*****************************************************************************/
-PyObject *Text_CreatePyObject( Text * txt )
-{
- BPy_Text *pytxt;
-
- pytxt = ( BPy_Text * ) PyObject_NEW( BPy_Text, &Text_Type );
-
- if( !pytxt )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Text PyObject" );
-
- pytxt->text = txt;
- text_reset_internal(pytxt);
-
- return ( PyObject * ) pytxt;
-}
-
-/*****************************************************************************/
-/* Python BPy_Text methods: */
-/*****************************************************************************/
-static PyObject *Text_getFilename( BPy_Text * self )
-{
- TEXT_DEL_CHECK_PY(self);
- if( self->text->name )
- return PyString_FromString( self->text->name );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_getNLines( BPy_Text * self )
-{ /* text->nlines isn't updated in Blender (?) */
- int nlines = 0;
- TextLine *line;
-
- TEXT_DEL_CHECK_PY(self);
-
- line = self->text->lines.first;
-
- while( line ) { /* so we have to count them ourselves */
- line = line->next;
- nlines++;
- }
-
- self->text->nlines = nlines; /* and update Blender, too (should we?) */
-
- return PyInt_FromLong( nlines );
-}
-
-static PyObject *Text_clear( BPy_Text * self)
-{
- int oldstate;
-
- TEXT_DEL_CHECK_PY(self);
-
- oldstate = txt_get_undostate( );
- txt_set_undostate( 1 );
- txt_sel_all( self->text );
- txt_cut_sel( self->text );
- txt_set_undostate( oldstate );
-
- Py_RETURN_NONE;
-}
-
-static void text_reset_internal( BPy_Text * self )
-{
- self->iol = NULL;
- self->ioc = -1;
-}
-
-static PyObject *Text_reset( BPy_Text * self )
-{
- text_reset_internal(self);
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_readline( BPy_Text * self )
-{
- PyObject *tmpstr;
-
- TEXT_DEL_CHECK_PY(self);
-
- /* Reset */
- if (!self->iol && self->ioc == -1) {
- self->iol = self->text->lines.first;
- self->ioc = 0;
- }
-
- if (!self->iol) {
- PyErr_SetString( PyExc_StopIteration, "End of buffer reached" );
- return PyString_FromString( "" );
- }
-
- if (self->ioc > self->iol->len) {
- self->iol = NULL;
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Line length exceeded, text may have changed while reading" );
- }
-
- tmpstr = PyString_FromString( self->iol->line + self->ioc );
- if (self->iol->next)
- PyString_ConcatAndDel( &tmpstr, PyString_FromString("\n") );
-
- self->iol = self->iol->next;
- self->ioc = 0;
-
- return tmpstr;
-}
-
-static PyObject *Text_write( BPy_Text * self, PyObject * value )
-{
- char *str = PyString_AsString(value);
- int oldstate;
-
- if( !str )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- TEXT_DEL_CHECK_PY(self);
-
- oldstate = txt_get_undostate( );
- txt_insert_buf( self->text, str );
- txt_move_eof( self->text, 0 );
- txt_set_undostate( oldstate );
-
- text_reset_internal( self );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_insert( BPy_Text * self, PyObject * value )
-{
- char *str = PyString_AsString(value);
- int oldstate;
-
- if( !str )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- TEXT_DEL_CHECK_PY(self);
-
- oldstate = txt_get_undostate( );
- txt_insert_buf( self->text, str );
- txt_set_undostate( oldstate );
-
- text_reset_internal( self );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_delete( BPy_Text * self, PyObject * value )
-{
- int num = PyInt_AsLong(value);
- int oldstate;
-
- TEXT_DEL_CHECK_PY(self);
-
- /* zero num is invalid and -1 is an error value */
- if( !num || (num==-1 && PyErr_Occurred()))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected non-zero int argument" );
-
- oldstate = txt_get_undostate( );
- while (num<0) {
- txt_backspace_char(self->text);
- num++;
- }
- while (num>0) {
- txt_delete_char(self->text);
- num--;
- }
- txt_set_undostate( oldstate );
-
- text_reset_internal( self );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_set( BPy_Text * self, PyObject * args )
-{
- int ival;
- char *attr;
-
- TEXT_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "si", &attr, &ival ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string and an int as arguments" );
-
- if( strcmp( "follow_cursor", attr ) == 0 ) {
- if( ival )
- self->text->flags |= EXPP_TEXT_MODE_FOLLOW;
- else
- self->text->flags &= EXPP_TEXT_MODE_FOLLOW;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_asLines( BPy_Text * self, PyObject * args )
-{
- TextLine *line;
- PyObject *list, *tmpstr;
- int start=0, end=-1, i;
-
- TEXT_DEL_CHECK_PY(self);
-
- if( !PyArg_ParseTuple( args, "|ii", &start, &end ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected upto two optional ints as arguments" );
-
- if (start<0)
- start=0;
-
- line = self->text->lines.first;
- for (i = 0; i < start && line->next; i++)
- line= line->next;
-
- list = PyList_New( 0 );
-
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- while( line && (i < end || end == -1) ) {
- tmpstr = PyString_FromString( line->line );
- PyList_Append( list, tmpstr );
- Py_DECREF(tmpstr);
- line = line->next;
- i++;
- }
-
- return list;
-}
-
-static PyObject *Text_getCursorPos( BPy_Text * self )
-{
- Text *text;
- TextLine *linep;
- int row, col;
-
- TEXT_DEL_CHECK_PY(self);
-
- text = self->text;
-
- for (row=0,linep=text->lines.first; linep!=text->curl; linep=linep->next)
- row++;
- col= text->curc;
-
- return Py_BuildValue( "ii", row, col );
-}
-
-static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args )
-{
- int row, col;
- SpaceText *st;
-
- TEXT_DEL_CHECK_PY(self);
-
- if (!PyArg_ParseTuple(args, "ii", &row, &col))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected two ints as arguments.");
- if (row<0) row=0;
- if (col<0) col=0;
-
- txt_move_to(self->text, row, col, 0);
-
- if (curarea->spacetype == SPACE_TEXT && (st=curarea->spacedata.first))
- pop_space_text(st);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_getSelectPos( BPy_Text * self )
-{
- Text *text;
- TextLine *linep;
- int row, col;
-
- TEXT_DEL_CHECK_PY(self);
-
- text = self->text;
-
- for (row=0,linep=text->lines.first; linep!=text->sell; linep=linep->next)
- row++;
- col= text->selc;
-
- return Py_BuildValue( "ii", row, col );
-}
-
-static PyObject *Text_setSelectPos( BPy_Text * self, PyObject * args )
-{
- int row, col;
- SpaceText *st;
-
- TEXT_DEL_CHECK_PY(self);
-
- if (!PyArg_ParseTuple(args, "ii", &row, &col))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected two ints as arguments.");
- if (row<0) row=0;
- if (col<0) col=0;
-
- txt_move_to(self->text, row, col, 1);
-
- if (curarea->spacetype == SPACE_TEXT && (st=curarea->spacedata.first))
- pop_space_text(st);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_markSelection( BPy_Text * self, PyObject * args )
-{
- int group = 0, flags = 0,r, g, b;
- Text *text;
- char color[4];
-
- TEXT_DEL_CHECK_PY(self);
-
- text = self->text;
-
- if (!PyArg_ParseTuple(args, "i(iii)i", &group, &r, &g, &b, &flags))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected int, 3-tuple of ints and int as arguments.");
-
- if (text->curl != text->sell)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Cannot mark multi-line selection.");
-
- color[0] = (char) (r&0xFF);
- color[1] = (char) (g&0xFF);
- color[2] = (char) (b&0xFF);
- color[3] = 255;
-
- group &= 0xFFFF;
-
- txt_add_marker(text, text->curl, text->curc, text->selc, color, group, flags);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_suggest( BPy_Text * self, PyObject * args )
-{
- PyObject *item = NULL, *tup1 = NULL, *tup2 = NULL;
- PyObject *list = NULL;
- int list_len, i;
- char *prefix = NULL, *name, type;
- SpaceText *st;
-
- TEXT_DEL_CHECK_PY(self);
-
- /* Parse args for a list of strings/tuples */
- if (!PyArg_ParseTuple(args, "O!|s", &PyList_Type, &list, &prefix))
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expected list of strings or tuples followed by an optional string");
-
- if (curarea->spacetype != SPACE_TEXT)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Active space type is not text");
-
- st = curarea->spacedata.first;
- if (!st || !st->text)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Active text area has no Text object");
-
- texttool_suggest_clear();
- texttool_text_set_active(st->text);
- list_len = PyList_Size(list);
-
- for (i = 0; i < list_len; i++) {
- item = PyList_GetItem(list, i);
-
- if (PyString_Check(item)) {
- name = PyString_AsString(item);
- type = '?';
- } else if (PyTuple_Check(item) && PyTuple_GET_SIZE(item) == 2) {
- tup1 = PyTuple_GetItem(item, 0);
- tup2 = PyTuple_GetItem(item, 1);
- if (PyString_Check(tup1) && PyString_Check(tup2)) {
- name = PyString_AsString(tup1);
- type = PyString_AsString(tup2)[0];
- } else
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "list must contain tuples of two strings only: (name, type)" );
- } else
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "list must contain only individual strings or tuples of size 2" );
-
- if (!strlen(name) || (type!='m' && type!='v' && type!='f' && type!='k' && type!='?'))
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "names must be non-empty and types in ['m', 'v', 'f', 'k', '?']" );
-
- texttool_suggest_add(name, type);
- }
- if (!prefix)
- prefix = "";
- texttool_suggest_prefix(prefix);
- scrarea_queue_redraw(curarea);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text_showDocs( BPy_Text * self, PyObject * args )
-{
- char *docs;
- SpaceText *st;
-
- TEXT_DEL_CHECK_PY(self);
-
- if (!PyArg_ParseTuple(args, "s", &docs))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string as argument" );
-
- if (curarea->spacetype != SPACE_TEXT)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Active space type is not text");
-
- st = curarea->spacedata.first;
- if (!st || !st->text)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "Active text area has no Text object");
-
- texttool_text_set_active(st->text);
- texttool_docs_show(docs);
- scrarea_queue_redraw(curarea);
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: Text_compare */
-/* Description: This is a callback function for the BPy_Text type. It */
-/* compares two Text_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Text struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Text_compare( BPy_Text * a, BPy_Text * b )
-{
- return ( a->text == b->text ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Text_repr */
-/* Description: This is a callback function for the BPy_Text type. It */
-/* builds a meaninful string to represent text objects. */
-/*****************************************************************************/
-static PyObject *Text_repr( BPy_Text * self )
-{
- if( self->text )
- return PyString_FromFormat( "[Text \"%s\"]",
- self->text->id.name + 2 );
- else
- return PyString_FromString( "[Text <deleted>]" );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set functions: */
-/*****************************************************************************/
-static PyObject *Text_getMode(BPy_Text * self)
-{
- TEXT_DEL_CHECK_PY(self);
- return PyInt_FromLong( self->text->flags );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Text_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"filename", (getter)Text_getFilename, (setter)NULL,
- "text filename", NULL},
- {"mode", (getter)Text_getMode, (setter)NULL,
- "text mode flag", NULL},
- {"nlines", (getter)Text_getNLines, (setter)NULL,
- "number of lines", NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Text_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Text_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Text", /* tp_name */
- sizeof( BPy_Text ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- NULL, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Text_compare, /* tp_compare */
- ( reprfunc ) Text_repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Text_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Text_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/Text.h b/source/blender/python/api2_2x/Text.h
deleted file mode 100644
index 73943ddb9cd..00000000000
--- a/source/blender/python/api2_2x/Text.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_TEXT_H
-#define EXPP_TEXT_H
-
-#include <Python.h>
-#include "DNA_text_types.h"
-
-extern PyTypeObject Text_Type;
-
-/* Type checking for EXPP PyTypes */
-#define BPy_Text_Check(v) ((v)->ob_type == &Text_Type)
-
-typedef struct {
- PyObject_HEAD
- Text * text; /* libdata must be second */
- TextLine * iol; /* current line being read or NULL if reset */
- int ioc; /* character offset in line being read */
-} BPy_Text;
-
-PyObject *Text_Init( void );
-PyObject *Text_CreatePyObject( Text * txt );
-
-#endif /* EXPP_TEXT_H */
diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c
deleted file mode 100644
index 202195cdcb4..00000000000
--- a/source/blender/python/api2_2x/Text3d.c
+++ /dev/null
@@ -1,1250 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
- * Johnny Matthews
- * Campbell BArton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Text3d.h" /*This must come first*/
-
-#include "DNA_object_types.h"
-#include "MEM_guardedalloc.h"
-#include "BKE_curve.h"
-#include "BKE_library.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-#include "BIF_editfont.h" /* do_textedit() */
-#include "Curve.h"
-#include "constant.h"
-#include "Font.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-
-enum t3d_consts {
- EXPP_T3D_ATTR_FRAME_WIDTH = 0,
- EXPP_T3D_ATTR_FRAME_HEIGHT,
- EXPP_T3D_ATTR_FRAME_X,
- EXPP_T3D_ATTR_FRAME_Y
-};
-
-
-/*no prototypes declared in header files - external linkage outside of python*/
-extern VFont *get_builtin_font(void);
-extern void freedisplist(struct ListBase *lb);
-extern VFont *give_vfontpointer(int);
-extern VFont *exist_vfont(char *str);
-extern VFont *load_vfont(char *name);
-extern int BLI_exist(char *name);
-
-/*****************************************************************************/
-/* Python API function prototypes for the Text3D module. */
-/*****************************************************************************/
-static PyObject *M_Text3d_New( PyObject * self, PyObject * args );
-static PyObject *M_Text3d_Get( PyObject * self, PyObject * args );
-PyObject *M_Text3d_LoadFont (PyObject * self, PyObject * args );
-
-/*****************************************************************************
- * Python callback function prototypes for the Text3D module.
- *****************************************************************************/
-static PyObject *return_ModuleConstant( char *constant_name);
-static PyObject *generate_ModuleIntConstant(char *name, int value);
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Text3d module: */
-/*****************************************************************************/
-struct PyMethodDef M_Text3d_methods[] = {
- {"New", ( PyCFunction ) M_Text3d_New, METH_VARARGS, NULL},
- {"Get", ( PyCFunction ) M_Text3d_Get, METH_VARARGS, NULL},
- {"LoadFont", ( PyCFunction ) M_Text3d_LoadFont, METH_O, NULL},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Text3d_Type callback function prototypes: */
-/*****************************************************************************/
-/* int Text3dPrint (BPy_Text3d *msh, FILE *fp, int flags); */
-
-
-static PyObject *Text3d_repr( BPy_Text3d * self );
-static int Text3d_compare( BPy_Text3d * a, BPy_Text3d * b );
-
-/*****************************************************************************/
-/* Python BPy_Text3d methods declarations: */
-/*****************************************************************************/
-/*PyObject *Text3d_getType(BPy_Text3d *self);*/
-static PyObject *Text3d_getName( BPy_Text3d * self );
-static PyObject *Text3d_setName( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_setText( BPy_Text3d * self, PyObject * value );
-static PyObject *Text3d_getText( BPy_Text3d * self );
-static PyObject *Text3d_getDrawMode( BPy_Text3d * self );
-static PyObject *Text3d_setDrawMode( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getUVorco( BPy_Text3d * self );
-static PyObject *Text3d_setUVorco( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getBevelAmount( BPy_Text3d * self );
-static PyObject *Text3d_setBevelAmount( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getDefaultResolution( BPy_Text3d * self );
-static PyObject *Text3d_setDefaultResolution( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getWidth( BPy_Text3d * self );
-static PyObject *Text3d_setWidth( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getExtrudeDepth( BPy_Text3d * self );
-static PyObject *Text3d_setExtrudeDepth( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getExtrudeBevelDepth( BPy_Text3d * self );
-static PyObject *Text3d_setExtrudeBevelDepth( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getShear( BPy_Text3d * self );
-static PyObject *Text3d_setShear( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getSize( BPy_Text3d * self );
-static PyObject *Text3d_setSize( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getLineSeparation( BPy_Text3d * self );
-static PyObject *Text3d_setLineSeparation( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getSpacing( BPy_Text3d * self );
-static PyObject *Text3d_setSpacing( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getXoffset( BPy_Text3d * self );
-static PyObject *Text3d_setXoffset( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getYoffset( BPy_Text3d * self );
-static PyObject *Text3d_setYoffset( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getAlignment( BPy_Text3d * self );
-static PyObject *Text3d_setAlignment( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getFont( BPy_Text3d * self );
-static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value );
-static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args );
-static PyObject *Text3d_addFrame( BPy_Text3d * self );
-static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args );
-
-
-/*****************************************************************************/
-/* Python BPy_Text3d methods table: */
-/*****************************************************************************/
-char M_Text3D_doc[] = "The Blender Text3D module\n\n\
- This module provides control over Text Curve objects in Blender.\n";
-
-static PyMethodDef BPy_Text3d_methods[] = {
- {"getName", ( PyCFunction ) Text3d_getName,
- METH_NOARGS, "() - Return Text3d Data name"},
- {"setName", ( PyCFunction ) Text3d_setName,
- METH_VARARGS, "() - Sets Text3d Data name"},
- {"setText", ( PyCFunction ) Text3d_setText,
- METH_O, "() - Sets Text3d Data"},
- {"getText", ( PyCFunction ) Text3d_getText,
- METH_NOARGS, "() - Gets Text3d Data"},
- {"getDrawMode", ( PyCFunction ) Text3d_getDrawMode,
- METH_NOARGS, "() - Return the font drawing mode"},
- {"setDrawMode", ( PyCFunction ) Text3d_setDrawMode,
- METH_VARARGS, "(int) - Set the font drawing mode"},
- {"getUVorco", ( PyCFunction ) Text3d_getUVorco,
- METH_NOARGS, "() - Return wether UV coords are used for Texture mapping"},
- {"setUVorco", ( PyCFunction ) Text3d_setUVorco,
- METH_VARARGS, "() - Set the font to use UV coords for Texture mapping"},
- {"getBevelAmount", ( PyCFunction ) Text3d_getBevelAmount,
- METH_NOARGS, "() - Return bevel resolution"},
- {"setBevelAmount", ( PyCFunction ) Text3d_setBevelAmount,
- METH_VARARGS, "() - Sets bevel resolution"},
- {"getDefaultResolution", ( PyCFunction ) Text3d_getDefaultResolution,
- METH_NOARGS, "() - Return Default text resolution"},
- {"setDefaultResolution", ( PyCFunction ) Text3d_setDefaultResolution,
- METH_VARARGS, "() - Sets Default text Resolution"},
- {"getWidth", ( PyCFunction ) Text3d_getWidth,
- METH_NOARGS, "() - Return curve width"},
- {"setWidth", ( PyCFunction ) Text3d_setWidth,
- METH_VARARGS, "(int) - Sets curve width"},
- {"getExtrudeDepth", ( PyCFunction ) Text3d_getExtrudeDepth,
- METH_NOARGS, "() - Gets Text3d ExtrudeDepth"},
- {"setExtrudeDepth", ( PyCFunction ) Text3d_setExtrudeDepth,
- METH_VARARGS, "() - Sets Text3d ExtrudeDepth"},
- {"getExtrudeBevelDepth", ( PyCFunction ) Text3d_getExtrudeBevelDepth,
- METH_NOARGS, "() - Gets Text3d ExtrudeBevelDepth"},
- {"setExtrudeBevelDepth", ( PyCFunction ) Text3d_setExtrudeBevelDepth,
- METH_VARARGS, "() - Sets Text3d ExtrudeBevelDepth"},
- {"getShear", ( PyCFunction ) Text3d_getShear,
- METH_NOARGS, "() - Gets Text3d Shear Data"},
- {"setShear", ( PyCFunction ) Text3d_setShear,
- METH_VARARGS, "() - Sets Text3d Shear Data"},
- {"getSize", ( PyCFunction ) Text3d_getSize,
- METH_NOARGS, "() - Gets Text3d Size Data"},
- {"setSize", ( PyCFunction ) Text3d_setSize,
- METH_VARARGS, "() - Sets Text3d Size Data"},
- {"getLineSeparation", ( PyCFunction ) Text3d_getLineSeparation,
- METH_NOARGS, "() - Gets Text3d LineSeparation Data"},
- {"setLineSeparation", ( PyCFunction ) Text3d_setLineSeparation,
- METH_VARARGS, "() - Sets Text3d LineSeparation Data"},
- {"getSpacing", ( PyCFunction ) Text3d_getSpacing,
- METH_NOARGS, "() - Gets Text3d letter spacing"},
- {"setSpacing", ( PyCFunction ) Text3d_setSpacing,
- METH_VARARGS, "() - Sets Text3d letter spacing"},
- {"getXoffset", ( PyCFunction ) Text3d_getXoffset,
- METH_NOARGS, "() - Gets Text3d Xoffset Data"},
- {"setXoffset", ( PyCFunction ) Text3d_setXoffset,
- METH_VARARGS, "() - Sets Text3d Xoffset Data"},
- {"getYoffset", ( PyCFunction ) Text3d_getYoffset,
- METH_NOARGS, "() - Gets Text3d Yoffset Data"},
- {"setYoffset", ( PyCFunction ) Text3d_setYoffset,
- METH_VARARGS, "() - Sets Text3d Yoffset Data"},
- {"getAlignment", ( PyCFunction ) Text3d_getAlignment,
- METH_NOARGS, "() - Gets Text3d Alignment Data"},
- {"setAlignment", ( PyCFunction ) Text3d_setAlignment,
- METH_VARARGS, "() - Sets Text3d Alignment Data"},
- {"getFont", ( PyCFunction ) Text3d_getFont,
- METH_NOARGS, "() - Gets font list for Text3d"},
- {"setFont", ( PyCFunction ) Text3d_setFont,
- METH_VARARGS, "() - Sets font for Text3d"},
- {"getMaterial", ( PyCFunction ) Text3d_getMaterial,
- METH_O, "() - Gets font list for Text3d"},
- {"setMaterial", ( PyCFunction ) Text3d_setMaterial,
- METH_VARARGS, "() - Sets font for Text3d"},
- {"addFrame", ( PyCFunction ) Text3d_addFrame,
- METH_NOARGS, "() - adds a new text frame"},
- {"removeFrame", ( PyCFunction ) Text3d_removeFrame,
- METH_VARARGS, "(index) - remove this frame"},
- {NULL, NULL, 0, NULL}
-};
-
-
-static PyObject *Text3d_getTotalFrames( BPy_Text3d * self )
-{
- return PyInt_FromLong( (long)(self->curve->totbox ) );
-}
-
-static PyObject *Text3d_getActiveFrame( BPy_Text3d * self )
-{
- return PyInt_FromLong( (long)(self->curve->actbox-1) );
-}
-
-static int Text3d_setActiveFrame( BPy_Text3d * self, PyObject * value )
-{
- struct Curve *curve= self->curve;
- PyObject* frame_int = PyNumber_Int( value );
- int index;
-
-
- if( !frame_int )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer argument" );
-
- index = ( int )PyInt_AS_LONG( frame_int );
- index ++;
- if (index < 1 || index > curve->totbox)
- return EXPP_ReturnIntError( PyExc_IndexError,
- "index out of range" );
-
- curve->actbox = index;
-
- return 0;
-}
-
-
-static PyObject *getFloatAttr( BPy_Text3d *self, void *type )
-{
- float param;
- struct Curve *curve= self->curve;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_T3D_ATTR_FRAME_WIDTH:
- param = curve->tb[curve->actbox-1].w;
- break;
- case EXPP_T3D_ATTR_FRAME_HEIGHT:
- param = curve->tb[curve->actbox-1].h;
- break;
- case EXPP_T3D_ATTR_FRAME_X:
- param = curve->tb[curve->actbox-1].x;
- break;
- case EXPP_T3D_ATTR_FRAME_Y:
- param = curve->tb[curve->actbox-1].y;
- break;
-
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getFloatAttr" );
- }
- return PyFloat_FromDouble( param );
-}
-
-static int setFloatAttrClamp( BPy_Text3d *self, PyObject *value, void *type )
-{
- float *param;
- struct Curve *curve= self->curve;
- float min, max;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_T3D_ATTR_FRAME_WIDTH:
- min = 0.0;
- max = 50.0;
- param = &(curve->tb[curve->actbox-1].w);
- break;
- case EXPP_T3D_ATTR_FRAME_HEIGHT:
- min = 0.0;
- max = 50.0;
- param = &(curve->tb[curve->actbox-1].h);
- break;
- case EXPP_T3D_ATTR_FRAME_X:
- min = 0.0;
- max = 50.0;
- param = &(curve->tb[curve->actbox-1].x);
- break;
- case EXPP_T3D_ATTR_FRAME_Y:
- min = 0.0;
- max = 50.0;
- param = &(curve->tb[curve->actbox-1].y);
- break;
-
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloatAttrClamp" );
- }
-
- return EXPP_setFloatClamped( value, param, min, max );
-}
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Text3d_getseters[] = {
- GENERIC_LIB_GETSETATTR, /* didnt have any attributes, at least lets have the standard ID attrs */
- {"activeFrame",
- (getter)Text3d_getActiveFrame, (setter)Text3d_setActiveFrame,
- "the index of the active text frame",
- NULL},
- {"totalFrames",
- (getter)Text3d_getTotalFrames, (setter)NULL,
- "the total number of text frames",
- NULL},
-
- {"frameWidth",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the width of the active text frame",
- (void *)EXPP_T3D_ATTR_FRAME_WIDTH},
- {"frameHeight",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the height of the active text frame",
- (void *)EXPP_T3D_ATTR_FRAME_HEIGHT},
- {"frameX",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the X position of the active text frame",
- (void *)EXPP_T3D_ATTR_FRAME_X},
- {"frameY",
- (getter)getFloatAttr, (setter)setFloatAttrClamp,
- "the Y position of the active text frame",
- (void *)EXPP_T3D_ATTR_FRAME_Y},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Text3d_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Text3d_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Text3d", /* tp_name */
- sizeof( BPy_Text3d ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- NULL, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) Text3d_compare, /* tp_compare */
- ( reprfunc ) Text3d_repr, /* tp_repr */
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Text3d_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Text3d_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*
- * Text3d_update( )
- * method to update display list for a Curve.
- */
-static PyObject *Text3d_update( BPy_Text3d * self )
-{
- freedisplist( &self->curve->disp );
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: M_Text3d_New */
-/* Python equivalent: Blender.Text3d.New */
-/*****************************************************************************/
-
-PyObject *M_Text3d_New( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- BPy_Text3d *pytext3d; /* for Curve Data object wrapper in Python */
- Text3d *bltext3d = 0; /* for actual Curve Data we create in Blender */
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected string argument or no argument" ) );
-
- bltext3d = add_curve( "Text", OB_FONT ); /* first create the Curve Data in Blender */
- bltext3d->vfont= get_builtin_font();
- bltext3d->vfont->id.us++;
- bltext3d->str= MEM_mallocN(12, "str");
- strcpy(bltext3d->str, "Text");
- bltext3d->pos= 4;
-
- bltext3d->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo");
- bltext3d->totbox= bltext3d->actbox= 1;
- bltext3d->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
- bltext3d->tb[0].w = bltext3d->tb[0].h = 0.0;
-
- if( bltext3d == NULL ) /* bail out if add_curve() failed */
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "couldn't create Curve Data in Blender" ) );
-
- /* return user count to zero because add_curve() inc'd it */
- bltext3d->id.us = 0;
- /* create python wrapper obj */
- pytext3d = ( BPy_Text3d * ) PyObject_NEW( BPy_Text3d, &Text3d_Type );
-
- if( pytext3d == NULL )
- return ( EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Curve Data object" ) );
-
- pytext3d->curve = bltext3d; /* link Python curve wrapper to Blender Curve */
- if( name )
- rename_id( &bltext3d->id, name );
-
- Text3d_update ( pytext3d );
- return ( PyObject * ) pytext3d;
-}
-
-PyObject *M_Text3d_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Text3d *curv_iter;
- BPy_Text3d *wanted_curv;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) ) /* expects nothing or a string */
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string argument" ) );
- if( name ) { /*a name has been given */
- /* Use the name to search for the curve requested */
- wanted_curv = NULL;
- curv_iter = G.main->curve.first;
-
- while( ( curv_iter ) && ( wanted_curv == NULL ) ) {
-
- if( strcmp( name, curv_iter->id.name + 2 ) == 0 ) {
- wanted_curv = ( BPy_Text3d * )
- PyObject_NEW( BPy_Text3d, &Text3d_Type );
- if( wanted_curv )
- wanted_curv->curve = curv_iter;
- }
-
- curv_iter = curv_iter->id.next;
- }
-
- if( wanted_curv == NULL ) { /* Requested curve doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Curve \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) wanted_curv;
- } /* end of if(name) */
- else {
- /* no name has been given; return a list of all curves by name. */
- PyObject *curvlist;
-
- curv_iter = G.main->curve.first;
- curvlist = PyList_New( 0 );
-
- if( curvlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( curv_iter && curv_iter->vfont ) {
- BPy_Text3d *found_text3d =
- ( BPy_Text3d * ) PyObject_NEW( BPy_Text3d,
- &Text3d_Type );
- found_text3d->curve = curv_iter;
- PyList_Append( curvlist, ( PyObject * ) found_text3d );
- Py_DECREF(found_text3d);
- curv_iter = curv_iter->id.next;
- }
- return ( curvlist );
- }
-}
-
-static PyObject *generate_ModuleIntConstant(char *name, int value)
-{
- PyObject *constant = PyConstant_New();
-
- PyConstant_Insert((BPy_constant*)constant,
- "value", PyInt_FromLong(value));
- PyConstant_Insert((BPy_constant*)constant,
- "name", PyString_FromString(name));
-
- Py_INCREF(constant);
- return constant;
-}
-
-PyObject *Text3d_Init( void )
-{
- //module
- PyObject *submodule, *dict;
-
- //add module...
- if( PyType_Ready( &Text3d_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Text3d", M_Text3d_methods,
- M_Text3D_doc);
-
- //add constants to module...
- PyModule_AddObject( submodule, "LEFT",
- generate_ModuleIntConstant("Text3d.LEFT", CU_LEFT));
- PyModule_AddObject( submodule, "MIDDLE",
- generate_ModuleIntConstant("Text3d.MIDDLE", CU_MIDDLE));
- PyModule_AddObject( submodule, "RIGHT",
- generate_ModuleIntConstant("Text3d.RIGHT", CU_RIGHT));
- PyModule_AddObject( submodule, "FLUSH",
- generate_ModuleIntConstant("Text3d.FLUSH", CU_FLUSH));
- PyModule_AddObject( submodule, "JUSTIFY",
- generate_ModuleIntConstant("Text3d.JUSTIFY", CU_JUSTIFY));
- PyModule_AddObject( submodule, "DRAW3D",
- generate_ModuleIntConstant("Text3d.DRAW3D", CU_3D));
- PyModule_AddObject( submodule, "DRAWFRONT",
- generate_ModuleIntConstant("Text3d.DRAWFRONT", CU_FRONT));
- PyModule_AddObject( submodule, "DRAWBACK",
- generate_ModuleIntConstant("Text3d.DRAWBACK", CU_BACK));
- PyModule_AddObject( submodule, "UVORCO",
- generate_ModuleIntConstant("Text3d.UVORCO", CU_UV_ORCO));
- dict = PyModule_GetDict( submodule );
- PyDict_SetItemString( dict, "Font", Font_Init( ) );
- return ( submodule );
-}
-
-/****************************************************************************
- * Function: Text3d_repr
- * Description: Callback function for the BPy_Text3d type to It
- * build a meaninful string to represent Text3d objects.
- *
- ***************************************************************************/
-
-static PyObject *Text3d_repr( BPy_Text3d * self )
-{
- /* skip over CU in idname. CUTEXT */
- return PyString_FromFormat( "[Text3d \"%s\"]",
- self->curve->id.name + 2 );
-}
-
-/****************************************************************************
- * Function: Text3d_compare
- * Description: Callback function for the BPy_Text3d type to Compare 2 types
- *
- ***************************************************************************/
-
-/* mat_a==mat_b or mat_a!=mat_b*/
-static int Text3d_compare( BPy_Text3d * a, BPy_Text3d * b )
-{
- return ( a->curve == b->curve) ? 0 : -1;
-}
-
-struct Text3d *Text3d_FromPyObject( PyObject * py_obj )
-{
- BPy_Text3d *blen_obj;
-
- blen_obj = ( BPy_Text3d * ) py_obj;
- return ((struct Text3d*) blen_obj->curve );
-}
-
-static PyObject *return_ModuleConstant( char *constant_name){
-
- PyObject *module = NULL, *dict = NULL, *constant = NULL;;
-
- module = PyImport_AddModule("Blender.Text3d");
- if(!module){ //null = error returning module
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error encountered with returning module constant..." ) );
- }
- dict = PyModule_GetDict(module); //never fails
-
- constant = PyDict_GetItemString(dict, constant_name);
- if(!constant){ //null = key not found
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error encountered with returning module constant..." ) );
- }
-
- return EXPP_incr_ret( constant );
-}
-
-static PyObject *Text3d_getName( BPy_Text3d * self )
-{
- return Curve_getName( (BPy_Curve*)self );
-}
-
-static PyObject *Text3d_setName( BPy_Text3d * self, PyObject * args )
-{
- return Curve_setName( (BPy_Curve*)self,args );
-}
-
-static PyObject *Text3d_setText( BPy_Text3d * self, PyObject * value )
-{
- char *text = PyString_AsString(value);
-
- if( !text )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string argument" );
-
- /*
- * If the text is currently being edited, then we have to put the
- * text into the edit buffer.
- */
-
- if( G.obedit && G.obedit->data == self->curve ) {
- short qual = G.qual;
- G.qual = 0; /* save key qualifier, then clear it */
- self->curve->pos = self->curve->len = 0;
- while ( *text )
- do_textedit( 0, 0, *text++ );
- G.qual = qual;
- } else {
- short len = (short)strlen(text);
- MEM_freeN( self->curve->str );
- self->curve->str = MEM_callocN( len+sizeof(wchar_t), "str" );
- strcpy( self->curve->str, text );
- self->curve->pos = len;
- self->curve->len = len;
-
- if( self->curve->strinfo )
- MEM_freeN( self->curve->strinfo );
- /* don't know why this is +4, just duplicating load_editText() */
- self->curve->strinfo = MEM_callocN( (len+4) *sizeof(CharInfo),
- "strinfo");
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getText( BPy_Text3d * self )
-{
- if( self->curve->str )
- return PyString_FromString( self->curve->str );
-
- Py_RETURN_NONE;
-}
-
-static PyObject* Text3d_getDrawMode(BPy_Text3d* self)
-{
- PyObject *tuple = NULL;
- int size = 0, pos = 0;
-
- //get the tuple size
- if(self->curve->flag & CU_3D)
- size++;
- if (self->curve->flag & CU_FRONT)
- size++;
- if (self->curve->flag & CU_BACK)
- size++;
-
- //generate tuple
- tuple = PyTuple_New(size);
-
- //load tuple
- if(self->curve->flag & CU_3D){
- PyTuple_SET_ITEM( tuple, pos, return_ModuleConstant("DRAW3D"));
- pos++;
- }
- if (self->curve->flag & CU_FRONT){
- PyTuple_SET_ITEM( tuple, pos, return_ModuleConstant("DRAWFRONT"));
- pos++;
- }
- if (self->curve->flag & CU_BACK){
- PyTuple_SET_ITEM( tuple, pos, return_ModuleConstant("DRAWBACK"));
- pos++;
- }
-
- return tuple;
-}
-
-static PyObject* Text3d_setDrawMode(BPy_Text3d* self,PyObject* args)
-{
- PyObject *listObject = NULL;
- int size, i;
- short temp;
-
- size = PySequence_Length(args);
- if ( size == 1 ) {
- listObject = PySequence_GetItem(args, 0);
- if ( PySequence_Check(listObject) ) {
- size = PySequence_Length(listObject);
- }else{ //not a sequence but maybe a single constant
- Py_INCREF(args);
- listObject = args;
- }
- } else { //a list of objects (non-sequence)
- Py_INCREF(args);
- listObject = args;
- }
- if ( size > 3 || size < 1 ) {
- //bad number of arguments
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "too many parameters - expects 1 - 3 constants" ) );
- }
- //clear bits
- temp = self->curve->flag; //in case of failure
- if(self->curve->flag & CU_3D)
- self->curve->flag &= ~CU_3D;
- if(self->curve->flag & CU_FRONT)
- self->curve->flag &= ~CU_FRONT;
- if(self->curve->flag & CU_BACK)
- self->curve->flag &= ~CU_BACK;
-
- //parse and set bits
- for (i = 0; i < size; i++) {
- PyObject *v;
- int value;
-
- v = PySequence_GetItem(listObject, i);
- if (v == NULL) { //unable to return item - null = failure
- Py_DECREF(listObject);
- self->curve->flag = temp;
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unable to parse list" ) );
- }
- if( !BPy_Constant_Check(v)){
- Py_DECREF(listObject);
- Py_DECREF(v);
- self->curve->flag = temp;
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "bad argument types - expects module constants" ) );
- }
- value = PyInt_AS_LONG(PyDict_GetItemString(
- ((BPy_constant*)v)->dict, "value"));
- self->curve->flag |= (short)value;
- Py_DECREF(v);
- }
- Py_DECREF(listObject);
- Py_RETURN_NONE;
-}
-
-static PyObject* Text3d_getUVorco(BPy_Text3d* self)
-{
- if(self->curve->flag & CU_UV_ORCO)
- return EXPP_incr_ret_True();
- else
- return EXPP_incr_ret_False();
-}
-
-static PyObject* Text3d_setUVorco(BPy_Text3d* self,PyObject* args)
-{
- int flag;
-
- if( !PyArg_ParseTuple( args, "i", &flag ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" );
-
- if( flag < 0 || flag > 1 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" );
-
- if( flag )
- self->curve->flag |= CU_UV_ORCO;
- else
- self->curve->flag &= ~CU_UV_ORCO;
-
- Py_RETURN_NONE;
-}
-
-static PyObject* Text3d_getBevelAmount(BPy_Text3d* self)
-{
- return Curve_getBevresol((BPy_Curve*)self);
-}
-
-static PyObject* Text3d_setBevelAmount(BPy_Text3d* self,PyObject* args)
-{
- return Curve_setBevresol((BPy_Curve*)self,args);
-}
-
-static PyObject *Text3d_getDefaultResolution( BPy_Text3d * self )
-{
- return Curve_getResolu( (BPy_Curve*)self );
-}
-
-static PyObject *Text3d_setDefaultResolution( BPy_Text3d * self, PyObject * args )
-{
- return Curve_setResolu( (BPy_Curve*)self,args );
-}
-
-static PyObject *Text3d_getWidth( BPy_Text3d * self )
-{
- return Curve_getWidth( (BPy_Curve*)self );
-}
-
-static PyObject *Text3d_setWidth( BPy_Text3d * self, PyObject * args )
-{
- return Curve_setWidth( (BPy_Curve*)self,args );
-}
-
-static PyObject *Text3d_getExtrudeDepth( BPy_Text3d * self )
-{
- return Curve_getExt1( (BPy_Curve*)self );
-}
-
-static PyObject *Text3d_setExtrudeDepth( BPy_Text3d * self, PyObject * args )
-{
- return Curve_setExt1( (BPy_Curve*)self,args );
-}
-
-static PyObject *Text3d_getExtrudeBevelDepth( BPy_Text3d * self )
-{
- return Curve_getExt2( (BPy_Curve*)self );
-}
-
-static PyObject *Text3d_setExtrudeBevelDepth( BPy_Text3d * self, PyObject * args )
-{
- return Curve_setExt2( (BPy_Curve*)self,args );
-}
-
-static PyObject *Text3d_getShear( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->shear );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.shear attribute" ) );
-}
-
-static PyObject *Text3d_setShear( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 1.0f || value < -1.0f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 1.0 and -1.0" ) );
- self->curve->shear = value;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getSize( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->fsize );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.fsize attribute" ) );
-}
-
-static PyObject *Text3d_setSize( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 10.0f || value < 0.1f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 10.0 and 0.1" ) );
- self->curve->fsize = value;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getLineSeparation( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->linedist );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.linedist attribute" ) );
-}
-
-static PyObject *Text3d_setLineSeparation( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 10.0f || value < 0.0f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 10.0 and 0.0" ) );
- self->curve->linedist = value;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getSpacing( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->spacing );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.spacing attribute" ) );
-}
-
-static PyObject *Text3d_setSpacing( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 10.0f || value < 0.0f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 10.0 and 0.0" ) );
- self->curve->spacing = value;
-
- Py_RETURN_NONE;
-}
-static PyObject *Text3d_getXoffset( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->xof );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.xof attribute" ) );
-}
-
-static PyObject *Text3d_setXoffset( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 50.0f || value < -50.0f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 50.0 and -50.0" ) );
- self->curve->xof = value;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getYoffset( BPy_Text3d * self )
-{
- PyObject *attr = PyFloat_FromDouble( (double) self->curve->yof );
-
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.yof attribute" ) );
-}
-
-static PyObject *Text3d_setYoffset( BPy_Text3d * self, PyObject * args )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected float argument" ) );
-
- if(value > 50.0f || value < -50.0f)
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "acceptable values are between 50.0 and -50.0" ) );
- self->curve->yof = value;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_getAlignment( BPy_Text3d * self )
-{
- if(self->curve->spacemode == CU_LEFT){
- return return_ModuleConstant("LEFT");
- }else if (self->curve->spacemode == CU_MIDDLE){
- return return_ModuleConstant("MIDDLE");
- }else if (self->curve->spacemode == CU_RIGHT){
- return return_ModuleConstant("RIGHT");
- }else if (self->curve->spacemode == CU_FLUSH){
- return return_ModuleConstant("FLUSH");
- }else if (self->curve->spacemode == CU_JUSTIFY){
- return return_ModuleConstant("JUSTIFY");
- }
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Curve.spacemode attribute" ) );
-}
-
-static PyObject *Text3d_setAlignment( BPy_Text3d * self, PyObject * args )
-{
- BPy_constant *constant;
- int value;
-
- if( !PyArg_ParseTuple( args, "O!", &constant_Type, &constant ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected module constant" ) );
-
- value = PyInt_AS_LONG(PyDict_GetItemString(constant->dict, "value"));
- self->curve->spacemode = (short)value;
-
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************
- * Function: Text3d_CreatePyObject
- * Description: This function will create a new BPy_Text3d from an existing
- * Blender structure.
- *****************************************************************************/
-
-PyObject *Text3d_CreatePyObject( Text3d * text3d )
-{
- BPy_Text3d *pytext3d;
-
- pytext3d = ( BPy_Text3d * ) PyObject_NEW( BPy_Text3d, &Text3d_Type );
-
- if( !pytext3d )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Text3d object" );
-
- pytext3d->curve = text3d;
-
- return ( PyObject * ) pytext3d;
-}
-
-static PyObject *Text3d_getFont( BPy_Text3d * self )
-{
- if (self->curve)
- return Font_CreatePyObject (self->curve->vfont);
- else
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args )
-{
- BPy_Font *pyobj= NULL;
- VFont *vf; //, *vfont;
- if( !PyArg_ParseTuple( args, "|O!",&Font_Type, &pyobj) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string" );
- if( !pyobj ) {
- // pyobj= M_Text3d_LoadFont (self, Py_BuildValue("(s)", "<builtin>"));
- self->curve->vfont= get_builtin_font ();
- Py_RETURN_NONE;
- }
- vf= exist_vfont(pyobj->font->name);
- if (vf) {
- id_us_plus((ID *)vf);
- self->curve->vfont->id.us--;
- self->curve->vfont= vf;
- }
- else {
- vf= load_vfont (pyobj->font->name);
- if (vf) {
- id_us_plus((ID *)vf);
- self->curve->vfont->id.us--;
- self->curve->vfont= vf;
- }
- }
- Py_RETURN_NONE;
-}
-
-/* todo, add style access, will be almost exact copy of these 2 */
-static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value )
-{
- int index = PyInt_AsLong( value );
- if (index == -1 && PyErr_Occurred())
- return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a character index" );
-
- if (index < 0)
- index = self->curve->len + index;
-
- if ( index < 0 || index >= self->curve->len )
- return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" );
-
- return PyInt_FromLong( self->curve->strinfo[index].mat_nr );
-}
-
-static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args )
-{
- int index, mat_nr;
- if( !PyArg_ParseTuple( args, "ii",&index, &mat_nr) )
- return NULL; /* Python error is ok */
-
- if (index < 0)
- index = self->curve->len + index;
-
- if ( index < 0 || index >= self->curve->len )
- return EXPP_ReturnPyObjError( PyExc_IndexError, "character index out of range" );
-
- if (mat_nr < 0)
- mat_nr = self->curve->totcol + mat_nr;
-
- if ( mat_nr < 0 || mat_nr >= self->curve->totcol )
- return EXPP_ReturnPyObjError( PyExc_IndexError, "material index out of range" );
-
- self->curve->strinfo[index].mat_nr = mat_nr;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_addFrame( BPy_Text3d * self )
-{
- Curve *cu = self->curve;
-
- if (cu->totbox >= 256)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "limited to 256 frames" );
-
- cu->totbox++;
- cu->tb[cu->totbox-1]= cu->tb[cu->totbox-2];
- Py_RETURN_NONE;
-}
-
-static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args )
-{
- Curve *cu = self->curve;
- int index, i;
-
- if (cu->totbox == 1)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot remove the last frame" );
-
- index = cu->totbox-1;
-
- if( !PyArg_ParseTuple( args, "|i", &index ) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "expected an int" );
-
- if (index < 0 || index >= cu->totbox )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "index out of range" );
-
- for (i = index; i < cu->totbox; i++) cu->tb[i]= cu->tb[i+1];
- cu->totbox--;
- cu->actbox--;
- Py_RETURN_NONE;
-}
-
-
-PyObject *M_Text3d_LoadFont( PyObject * self, PyObject * value )
-{
- char *fontfile= PyString_AsString(value);
- FILE *file= NULL;
- VFont *vf= NULL;
-
- if( !fontfile )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a string" );
- vf= exist_vfont(fontfile);
- if( vf )
- return Font_CreatePyObject( vf );
- /* No use for that -- lukep
- else
- vf= NULL;
- */
- file= fopen( fontfile, "r");
-
- if( file || !strcmp (fontfile, "<builtin>") ) {
- load_vfont( fontfile );
- if(file) fclose( file );
- vf = exist_vfont( fontfile );
- if(vf)
- return Font_CreatePyObject( vf );
- Py_RETURN_NONE;
- }
-
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "string isn't filename or fontpath" );
-}
-
diff --git a/source/blender/python/api2_2x/Text3d.h b/source/blender/python/api2_2x/Text3d.h
deleted file mode 100644
index c887a6ebbfb..00000000000
--- a/source/blender/python/api2_2x/Text3d.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_TEXT3D_H
-#define EXPP_TEXT3D_H
-
-#include <Python.h>
-#include "DNA_curve_types.h"
-
-extern PyTypeObject Text3d_Type;
-
-#define BPy_Text3d_Check(v) ((v)->ob_type==&Text3d_Type)
-typedef Curve Text3d;
-
-/*prototypes*/
-PyObject *Text3d_Init( void );
-struct Text3d *Text3d_FromPyObject( PyObject * py_obj );
-PyObject *Text3d_CreatePyObject( Text3d* text3d );
-
-/* Python BPy_Text3d structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- Text3d * curve;
-} BPy_Text3d;
-
-#endif /* EXPP_TEXT3D_H */
-
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c
deleted file mode 100644
index 51e1c389528..00000000000
--- a/source/blender/python/api2_2x/Texture.c
+++ /dev/null
@@ -1,2569 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Alex Mole, Nathan Letwory, Joilnen B. Leite, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-#include "Texture.h" /*This must come first*/
-
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_idprop.h"
-#include "BKE_library.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_blenlib.h"
-
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-
-#include "MTex.h"
-#include "Image.h"
-#include "Ipo.h"
-#include "IDProp.h"
-#include "constant.h"
-#include "blendef.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "vector.h" /* for Texture_evaluate(vec) */
-#include "Material.h" /* for EXPP_Colorband_fromPyList and EXPP_PyList_fromColorband */
-#include "RE_shader_ext.h"
-
-/*****************************************************************************/
-/* Blender.Texture constants */
-/*****************************************************************************/
-#define EXPP_TEX_TYPE_NONE 0
-
-#define EXPP_TEX_TYPE_MIN EXPP_TEX_TYPE_NONE
-#define EXPP_TEX_TYPE_MAX TEX_DISTNOISE
-
-#define EXPP_TEX_ANIMFRAME_MIN 0
-#define EXPP_TEX_ANIMFRAME_MAX ((int)MAXFRAMEF)
-#define EXPP_TEX_ANIMLEN_MIN 0
-#define EXPP_TEX_ANIMLEN_MAX ((int)(MAXFRAMEF)/2)
-#define EXPP_TEX_ANIMMONSTART_MIN 0
-#define EXPP_TEX_ANIMMONSTART_MAX ((int)MAXFRAMEF)
-#define EXPP_TEX_ANIMMONDUR_MIN 0
-#define EXPP_TEX_ANIMMONDUR_MAX 250
-#define EXPP_TEX_ANIMOFFSET_MIN -((int)MAXFRAMEF)
-#define EXPP_TEX_ANIMOFFSET_MAX ((int)MAXFRAMEF)
-#define EXPP_TEX_ANIMSTART_MIN 1
-#define EXPP_TEX_ANIMSTART_MAX ((int)MAXFRAMEF)
-#define EXPP_TEX_FIEIMA_MIN 1
-#define EXPP_TEX_FIEIMA_MAX 200
-#define EXPP_TEX_NOISEDEPTH_MIN 0
-#define EXPP_TEX_NOISEDEPTH_MAX 6
-/* max depth is different for magic type textures */
-#define EXPP_TEX_NOISEDEPTH_MAX_MAGIC 10
-#define EXPP_TEX_REPEAT_MIN 1
-#define EXPP_TEX_REPEAT_MAX 512
-
-#define EXPP_TEX_FILTERSIZE_MIN 0.1f
-#define EXPP_TEX_FILTERSIZE_MAX 25.0f
-#define EXPP_TEX_NOISESIZE_MIN 0.0001f
-#define EXPP_TEX_NOISESIZE_MAX 2.0f
-#define EXPP_TEX_BRIGHTNESS_MIN 0.0f
-#define EXPP_TEX_BRIGHTNESS_MAX 2.0f
-#define EXPP_TEX_CONTRAST_MIN 0.01f
-#define EXPP_TEX_CONTRAST_MAX 5.0f
-#define EXPP_TEX_CROP_MIN -10.0f
-#define EXPP_TEX_CROP_MAX 10.0f
-#define EXPP_TEX_RGBCOL_MIN 0.0f
-#define EXPP_TEX_RGBCOL_MAX 2.0f
-#define EXPP_TEX_TURBULENCE_MIN 0.0f
-#define EXPP_TEX_TURBULENCE_MAX 200.0f
-#define EXPP_TEX_MH_G_MIN 0.0001f
-#define EXPP_TEX_MH_G_MAX 2.0f
-#define EXPP_TEX_LACUNARITY_MIN 0.0f
-#define EXPP_TEX_LACUNARITY_MAX 6.0f
-#define EXPP_TEX_OCTS_MIN 0.0f
-#define EXPP_TEX_OCTS_MAX 8.0f
-#define EXPP_TEX_OFST_MIN 0.0f
-#define EXPP_TEX_OFST_MAX 6.0f
-#define EXPP_TEX_GAIN_MIN 0.0f
-#define EXPP_TEX_GAIN_MAX 6.0f
-#define EXPP_TEX_ISCALE_MIN 0.0f
-#define EXPP_TEX_ISCALE_MAX 10.0f
-#define EXPP_TEX_EXP_MIN 0.010f
-#define EXPP_TEX_EXP_MAX 10.0f
-#define EXPP_TEX_WEIGHT1_MIN -2.0f
-#define EXPP_TEX_WEIGHT1_MAX 2.0f
-#define EXPP_TEX_WEIGHT2_MIN -2.0f
-#define EXPP_TEX_WEIGHT2_MAX 2.0f
-#define EXPP_TEX_WEIGHT3_MIN -2.0f
-#define EXPP_TEX_WEIGHT3_MAX 2.0f
-#define EXPP_TEX_WEIGHT4_MIN -2.0f
-#define EXPP_TEX_WEIGHT4_MAX 2.0f
-#define EXPP_TEX_DISTAMNT_MIN 0.0f
-#define EXPP_TEX_DISTAMNT_MAX 10.0f
-
-/* i can't find these defined anywhere- they're just taken from looking at */
-/* the button creation code in source/blender/src/buttons_shading.c */
-/* cloud stype */
-#define EXPP_TEX_STYPE_CLD_DEFAULT 0
-#define EXPP_TEX_STYPE_CLD_COLOR 1
-/* wood stype */
-#define EXPP_TEX_STYPE_WOD_BANDS 0
-#define EXPP_TEX_STYPE_WOD_RINGS 1
-#define EXPP_TEX_STYPE_WOD_BANDNOISE 2
-#define EXPP_TEX_STYPE_WOD_RINGNOISE 3
-/* magic stype */
-#define EXPP_TEX_STYPE_MAG_DEFAULT 0
-/* marble stype */
-#define EXPP_TEX_STYPE_MBL_SOFT 0
-#define EXPP_TEX_STYPE_MBL_SHARP 1
-#define EXPP_TEX_STYPE_MBL_SHARPER 2
-/* blend stype */
-#define EXPP_TEX_STYPE_BLN_LIN 0
-#define EXPP_TEX_STYPE_BLN_QUAD 1
-#define EXPP_TEX_STYPE_BLN_EASE 2
-#define EXPP_TEX_STYPE_BLN_DIAG 3
-#define EXPP_TEX_STYPE_BLN_SPHERE 4
-#define EXPP_TEX_STYPE_BLN_HALO 5
-/* stucci stype */
-#define EXPP_TEX_STYPE_STC_PLASTIC 0
-#define EXPP_TEX_STYPE_STC_WALLIN 1
-#define EXPP_TEX_STYPE_STC_WALLOUT 2
-/* noise stype */
-#define EXPP_TEX_STYPE_NSE_DEFAULT 0
-/* image stype */
-#define EXPP_TEX_STYPE_IMG_DEFAULT 0
-/* plug-in stype */
-#define EXPP_TEX_STYPE_PLG_DEFAULT 0
-/* envmap stype */
-#define EXPP_TEX_STYPE_ENV_STATIC 0
-#define EXPP_TEX_STYPE_ENV_ANIM 1
-#define EXPP_TEX_STYPE_ENV_LOAD 2
-/* musgrave stype */
-#define EXPP_TEX_STYPE_MUS_MFRACTAL 0
-#define EXPP_TEX_STYPE_MUS_RIDGEDMF 1
-#define EXPP_TEX_STYPE_MUS_HYBRIDMF 2
-#define EXPP_TEX_STYPE_MUS_FBM 3
-#define EXPP_TEX_STYPE_MUS_HTERRAIN 4
-/* voronoi stype */
-#define EXPP_TEX_STYPE_VN_INT 0
-#define EXPP_TEX_STYPE_VN_COL1 1
-#define EXPP_TEX_STYPE_VN_COL2 2
-#define EXPP_TEX_STYPE_VN_COL3 3
-
-#define EXPP_TEX_EXTEND_MIN TEX_EXTEND
-#define EXPP_TEX_EXTEND_MAX TEX_CHECKER
-
-#define EXPP_TEX_NOISE_SINE 0
-#define EXPP_TEX_NOISE_SAW 1
-#define EXPP_TEX_NOISE_TRI 2
-#define EXPP_TEX_NOISEBASIS2 0xffff
-
-/****************************************************************************/
-/* Texture String->Int maps */
-/****************************************************************************/
-
-static const EXPP_map_pair tex_type_map[] = {
- {"None", EXPP_TEX_TYPE_NONE},
- {"Clouds", TEX_CLOUDS},
- {"Wood", TEX_WOOD},
- {"Marble", TEX_MARBLE},
- {"Magic", TEX_MAGIC},
- {"Blend", TEX_BLEND},
- {"Stucci", TEX_STUCCI},
- {"Noise", TEX_NOISE},
- {"Image", TEX_IMAGE},
- {"Plugin", TEX_PLUGIN},
- {"EnvMap", TEX_ENVMAP},
- {"Musgrave", TEX_MUSGRAVE},
- {"Voronoi", TEX_VORONOI},
- {"DistortedNoise", TEX_DISTNOISE},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_flag_map[] = {
-/* NOTE "CheckerOdd" and "CheckerEven" are new */
- {"ColorBand", TEX_COLORBAND },
- {"FlipBlend", TEX_FLIPBLEND},
- {"NegAlpha", TEX_NEGALPHA},
- {"CheckerOdd",TEX_CHECKER_ODD},
- {"CheckerEven",TEX_CHECKER_EVEN},
- {"PreviewAlpha",TEX_PRV_ALPHA},
- {"RepeatXMirror",TEX_REPEAT_XMIR},
- {"RepeatYMirror",TEX_REPEAT_YMIR},
- {NULL, 0}
-};
-
-/* NOTE: flags moved to image... */
-static const EXPP_map_pair tex_imageflag_map[] = {
- {"InterPol", TEX_INTERPOL},
- {"UseAlpha", TEX_USEALPHA},
- {"MipMap", TEX_MIPMAP},
- {"Rot90", TEX_IMAROT},
- {"CalcAlpha", TEX_CALCALPHA},
- {"NormalMap", TEX_NORMALMAP},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_extend_map[] = {
- {"Extend", TEX_EXTEND},
- {"Clip", TEX_CLIP},
- {"ClipCube", TEX_CLIPCUBE},
- {"Repeat", TEX_REPEAT},
-/* NOTE "Checker" is new */
- {"Checker", TEX_CHECKER},
- {NULL, 0}
-};
-
-/* array of maps for stype */
-static const EXPP_map_pair tex_stype_default_map[] = {
- {"Default", 0},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_clouds_map[] = {
- {"Default", 0},
- {"CloudDefault", EXPP_TEX_STYPE_CLD_DEFAULT},
- {"CloudColor", EXPP_TEX_STYPE_CLD_COLOR},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_wood_map[] = {
- {"Default", 0},
- {"WoodBands", EXPP_TEX_STYPE_WOD_BANDS},
- {"WoodRings", EXPP_TEX_STYPE_WOD_RINGS},
- {"WoodBandNoise", EXPP_TEX_STYPE_WOD_BANDNOISE},
- {"WoodRingNoise", EXPP_TEX_STYPE_WOD_RINGNOISE},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_marble_map[] = {
- {"Default", 0},
- {"MarbleSoft", EXPP_TEX_STYPE_MBL_SOFT},
- {"MarbleSharp", EXPP_TEX_STYPE_MBL_SHARP},
- {"MarbleSharper", EXPP_TEX_STYPE_MBL_SHARPER},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_blend_map[] = {
- {"Default", 0},
- {"BlendLin", EXPP_TEX_STYPE_BLN_LIN},
- {"BlendQuad", EXPP_TEX_STYPE_BLN_QUAD},
- {"BlendEase", EXPP_TEX_STYPE_BLN_EASE},
- {"BlendDiag", EXPP_TEX_STYPE_BLN_DIAG},
- {"BlendSphere", EXPP_TEX_STYPE_BLN_SPHERE},
- {"BlendHalo", EXPP_TEX_STYPE_BLN_HALO},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_stucci_map[] = {
- {"Default", 0},
- {"StucciPlastic", EXPP_TEX_STYPE_STC_PLASTIC},
- {"StucciWallIn", EXPP_TEX_STYPE_STC_WALLIN},
- {"StucciWallOut", EXPP_TEX_STYPE_STC_WALLOUT},
- {NULL, 0}
-};
-static const EXPP_map_pair tex_stype_envmap_map[] = {
- {"Default", 0},
- {"EnvmapStatic", EXPP_TEX_STYPE_ENV_STATIC},
- {"EnvmapAnim", EXPP_TEX_STYPE_ENV_ANIM},
- {"EnvmapLoad", EXPP_TEX_STYPE_ENV_LOAD},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_stype_musg_map[] = {
- {"Default", 0},
- {"MultiFractal", EXPP_TEX_STYPE_MUS_MFRACTAL},
- {"HeteroTerrain", EXPP_TEX_STYPE_MUS_HTERRAIN},
- {"RidgedMultiFractal", EXPP_TEX_STYPE_MUS_RIDGEDMF},
- {"HybridMultiFractal", EXPP_TEX_STYPE_MUS_HYBRIDMF},
- {"fBM", EXPP_TEX_STYPE_MUS_FBM},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_stype_distortednoise_map[] = {
- {"Default", 0},
- {"BlenderOriginal", TEX_BLENDER},
- {"OriginalPerlin", TEX_STDPERLIN},
- {"ImprovedPerlin", TEX_NEWPERLIN},
- {"VoronoiF1", TEX_VORONOI_F1},
- {"VoronoiF2", TEX_VORONOI_F2},
- {"VoronoiF3", TEX_VORONOI_F3},
- {"VoronoiF4", TEX_VORONOI_F4},
- {"VoronoiF2-F1", TEX_VORONOI_F2F1},
- {"VoronoiCrackle", TEX_VORONOI_CRACKLE},
- {"CellNoise", TEX_CELLNOISE},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_stype_voronoi_map[] = {
- {"Default", 0},
- {"Int", EXPP_TEX_STYPE_VN_INT},
- {"Col1", EXPP_TEX_STYPE_VN_COL1},
- {"Col2", EXPP_TEX_STYPE_VN_COL2},
- {"Col3", EXPP_TEX_STYPE_VN_COL3},
- {NULL, 0}
-};
-
-static const EXPP_map_pair tex_distance_voronoi_map[] = {
- {"Default", 0},
- {"Distance", TEX_DISTANCE},
- {"DistanceSquared", TEX_DISTANCE_SQUARED},
- {"Manhattan", TEX_MANHATTAN},
- {"Chebychev", TEX_CHEBYCHEV},
- {"MinkovskyHalf", TEX_MINKOVSKY_HALF},
- {"MinkovskyFour", TEX_MINKOVSKY_FOUR},
- {"Minkovsky", TEX_MINKOVSKY},
- {NULL, 0}
-};
-
-static const EXPP_map_pair *tex_stype_map[] = {
- tex_stype_default_map, /* none */
- tex_stype_clouds_map,
- tex_stype_wood_map,
- tex_stype_marble_map,
- tex_stype_default_map, /* magic */
- tex_stype_blend_map,
- tex_stype_stucci_map,
- tex_stype_default_map, /* noise */
- tex_stype_default_map, /* image */
- tex_stype_default_map, /* plugin */
- tex_stype_envmap_map,
- tex_stype_musg_map, /* musgrave */
- tex_stype_voronoi_map, /* voronoi */
- tex_stype_distortednoise_map, /* distorted noise */
- tex_distance_voronoi_map
-};
-
-/*****************************************************************************/
-/* Python API function prototypes for the Texture module. */
-/*****************************************************************************/
-static PyObject *M_Texture_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_Texture_Get( PyObject * self, PyObject * args );
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Texture.__doc__ */
-/*****************************************************************************/
-static char M_Texture_doc[] = "The Blender Texture module\n\
-\n\
-This module provides access to **Texture** objects in Blender\n";
-
-static char M_Texture_New_doc[] = "Texture.New (name = 'Tex'):\n\
- Return a new Texture object with the given type and name.";
-
-static char M_Texture_Get_doc[] = "Texture.Get (name = None):\n\
- Return the texture with the given 'name', None if not found, or\n\
- Return a list with all texture objects in the current scene,\n\
- if no argument was given.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Texture module: */
-/*****************************************************************************/
-struct PyMethodDef M_Texture_methods[] = {
- {"New", ( PyCFunction ) M_Texture_New, METH_VARARGS | METH_KEYWORDS,
- M_Texture_New_doc},
- {"Get", M_Texture_Get, METH_VARARGS, M_Texture_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python BPy_Texture methods declarations: */
-/*****************************************************************************/
-#define GETFUNC(name) static PyObject *Texture_##name(BPy_Texture *self)
-#define OLDSETFUNC(name) static PyObject *Texture_old##name(BPy_Texture *self, \
- PyObject *args)
-#define SETFUNC(name) static int Texture_##name(BPy_Texture *self, \
- PyObject *value)
-#if 0
-GETFUNC( getExtend );
-GETFUNC( getImage );
-GETFUNC( getType );
-GETFUNC( getSType );
-GETFUNC( clearIpo );
-GETFUNC( getAnimMontage );
-GETFUNC( getAnimLength );
-SETFUNC( setAnimLength );
-SETFUNC( setAnimMontage );
-#endif
-
-GETFUNC( oldgetSType );
-GETFUNC( oldgetType );
-
-GETFUNC( clearIpo );
-GETFUNC( getAnimFrames );
-GETFUNC( getAnimOffset );
-GETFUNC( getAnimStart );
-GETFUNC( getBrightness );
-GETFUNC( getContrast );
-GETFUNC( getCrop );
-GETFUNC( getDistAmnt );
-GETFUNC( getDistMetric );
-GETFUNC( getExp );
-GETFUNC( getExtend );
-GETFUNC( getIntExtend );
-GETFUNC( getFieldsPerImage );
-GETFUNC( getFilterSize );
-GETFUNC( getFlags );
-GETFUNC( getHFracDim );
-GETFUNC( getImage );
-GETFUNC( getIpo );
-GETFUNC( getIScale );
-GETFUNC( getLacunarity );
-GETFUNC( getNoiseBasis );
-GETFUNC( getNoiseDepth );
-GETFUNC( getNoiseSize );
-GETFUNC( getNoiseType );
-GETFUNC( getOcts );
-GETFUNC( getOffset );
-GETFUNC( getGain );
-GETFUNC( getRepeat );
-GETFUNC( getRGBCol );
-GETFUNC( getSType );
-GETFUNC( getTurbulence );
-GETFUNC( getType );
-GETFUNC( getWeight1 );
-GETFUNC( getWeight2 );
-GETFUNC( getWeight3 );
-GETFUNC( getWeight4 );
-#if 0
-/* not defined */
-GETFUNC( getUsers );
-#endif
-
-OLDSETFUNC( setDistMetric );
-OLDSETFUNC( setDistNoise ); /* special case used for ".noisebasis = ... */
-OLDSETFUNC( setExtend );
-OLDSETFUNC( setFlags );
-OLDSETFUNC( setImage );
-OLDSETFUNC( setImageFlags );
-OLDSETFUNC( setIpo );
-OLDSETFUNC( setNoiseBasis );
-OLDSETFUNC( setSType );
-OLDSETFUNC( setType );
-
-SETFUNC( setAnimFrames );
-SETFUNC( setAnimOffset );
-SETFUNC( setAnimStart );
-SETFUNC( setBrightness );
-SETFUNC( setContrast );
-SETFUNC( setCrop );
-SETFUNC( setDistAmnt );
-SETFUNC( setDistMetric );
-SETFUNC( setExp );
-SETFUNC( setIntExtend );
-SETFUNC( setFieldsPerImage );
-SETFUNC( setFilterSize );
-SETFUNC( setFlags );
-SETFUNC( setHFracDim );
-SETFUNC( setImage );
-SETFUNC( setIpo );
-SETFUNC( setIScale );
-SETFUNC( setLacunarity );
-SETFUNC( setNoiseBasis );
-SETFUNC( setNoiseDepth );
-SETFUNC( setNoiseSize );
-SETFUNC( setNoiseType );
-SETFUNC( setOcts );
-SETFUNC( setOffset );
-SETFUNC( setGain );
-SETFUNC( setRepeat );
-SETFUNC( setRGBCol );
-SETFUNC( setSType );
-SETFUNC( setTurbulence );
-SETFUNC( setType );
-SETFUNC( setWeight1 );
-SETFUNC( setWeight2 );
-SETFUNC( setWeight3 );
-SETFUNC( setWeight4 );
-
-static PyObject *Texture_getImageFlags( BPy_Texture *self, void *type );
-static PyObject *Texture_getIUserFlags( BPy_Texture *self, void *type );
-static PyObject *Texture_getIUserCyclic( BPy_Texture *self );
-static PyObject *Texture_getNoiseBasis2( BPy_Texture *self, void *type );
-static int Texture_setImageFlags( BPy_Texture *self, PyObject *args,
- void *type );
-static int Texture_setIUserFlags( BPy_Texture *self, PyObject *args,
- void *type );
-static int Texture_setIUserCyclic( BPy_Texture *self, PyObject *args );
-static int Texture_setNoiseBasis2( BPy_Texture *self, PyObject *args,
- void *type );
-
-static PyObject *Texture_getColorband( BPy_Texture * self);
-int Texture_setColorband( BPy_Texture * self, PyObject * value);
-static PyObject *Texture_evaluate( BPy_Texture *self, PyObject *value );
-static PyObject *Texture_copy( BPy_Texture *self );
-
-/*****************************************************************************/
-/* Python BPy_Texture methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_Texture_methods[] = {
- /* name, method, flags, doc */
- {"getExtend", ( PyCFunction ) Texture_getExtend, METH_NOARGS,
- "() - Return Texture extend mode"},
- {"getImage", ( PyCFunction ) Texture_getImage, METH_NOARGS,
- "() - Return Texture Image"},
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return Texture name"},
- {"getSType", ( PyCFunction ) Texture_oldgetSType, METH_NOARGS,
- "() - Return Texture stype as string"},
- {"getType", ( PyCFunction ) Texture_oldgetType, METH_NOARGS,
- "() - Return Texture type as string"},
- {"getIpo", ( PyCFunction ) Texture_getIpo, METH_NOARGS,
- "() - Return Texture Ipo"},
- {"setIpo", ( PyCFunction ) Texture_oldsetIpo, METH_VARARGS,
- "(Blender Ipo) - Set Texture Ipo"},
- {"clearIpo", ( PyCFunction ) Texture_clearIpo, METH_NOARGS,
- "() - Unlink Ipo from this Texture."},
- {"setExtend", ( PyCFunction ) Texture_oldsetExtend, METH_VARARGS,
- "(s) - Set Texture extend mode"},
- {"setFlags", ( PyCFunction ) Texture_oldsetFlags, METH_VARARGS,
- "(f1,f2,f3,f4,f5) - Set Texture flags"},
- {"setImage", ( PyCFunction ) Texture_oldsetImage, METH_VARARGS,
- "(Blender Image) - Set Texture Image"},
- {"setImageFlags", ( PyCFunction ) Texture_oldsetImageFlags, METH_VARARGS,
- "(s,s,s,s,...) - Set Texture image flags"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "(s) - Set Texture name"},
- {"setSType", ( PyCFunction ) Texture_oldsetSType, METH_VARARGS,
- "(s) - Set Texture stype"},
- {"setType", ( PyCFunction ) Texture_oldsetType, METH_VARARGS,
- "(s) - Set Texture type"},
- {"setNoiseBasis", ( PyCFunction ) Texture_oldsetNoiseBasis, METH_VARARGS,
- "(s) - Set Noise basis"},
- {"setDistNoise", ( PyCFunction ) Texture_oldsetDistNoise, METH_VARARGS,
- "(s) - Set Dist Noise"},
- {"setDistMetric", ( PyCFunction ) Texture_oldsetDistMetric, METH_VARARGS,
- "(s) - Set Dist Metric"},
- {"evaluate", ( PyCFunction ) Texture_evaluate, METH_O,
- "(vector) - evaluate the texture at this position"},
- {"__copy__", ( PyCFunction ) Texture_copy, METH_NOARGS,
- "() - return a copy of the the texture"},
- {"copy", ( PyCFunction ) Texture_copy, METH_NOARGS,
- "() - return a copy of the the texture"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python Texture_Type attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Texture_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"animFrames",
- (getter)Texture_getAnimFrames, (setter)Texture_setAnimFrames,
- "Number of frames of a movie to use",
- NULL},
-#if 0
- {"animLength",
- (getter)Texture_getAnimLength, (setter)Texture_setAnimLength,
- "Number of frames of a movie to use (0 for all)",
- NULL},
- {"animMontage",
- (getter)Texture_getAnimMontage, (setter)Texture_setAnimMontage,
- "Montage mode, start frames and durations",
- NULL},
-#endif
- {"animOffset",
- (getter)Texture_getAnimOffset, (setter)Texture_setAnimOffset,
- "Offsets the number of the first movie frame to use",
- NULL},
- {"animStart",
- (getter)Texture_getAnimStart, (setter)Texture_setAnimStart,
- "Starting frame of the movie to use",
- NULL},
- {"brightness",
- (getter)Texture_getBrightness, (setter)Texture_setBrightness,
- "Changes the brightness of a texture's color",
- NULL},
- {"contrast",
- (getter)Texture_getContrast, (setter)Texture_setContrast,
- "Changes the contrast of a texture's color",
- NULL},
- {"crop",
- (getter)Texture_getCrop, (setter)Texture_setCrop,
- "Sets the cropping extents (for image textures)",
- NULL},
- {"distAmnt",
- (getter)Texture_getDistAmnt, (setter)Texture_setDistAmnt,
- "Amount of distortion (for distorted noise textures)",
- NULL},
- {"distMetric",
- (getter)Texture_getDistMetric, (setter)Texture_setDistMetric,
- "The distance metric (for Voronoi textures)",
- NULL},
- {"exp",
- (getter)Texture_getExp, (setter)Texture_setExp,
- "Minkovsky exponent (for Minkovsky Voronoi textures)",
- NULL},
- {"extend",
- (getter)Texture_getIntExtend, (setter)Texture_setIntExtend,
- "Texture's 'Extend' mode (for image textures)",
- NULL},
- {"fieldsPerImage",
- (getter)Texture_getFieldsPerImage, (setter)Texture_setFieldsPerImage,
- "Number of fields per rendered frame",
- NULL},
- {"filterSize",
- (getter)Texture_getFilterSize, (setter)Texture_setFilterSize,
- "The filter size (for image and envmap textures)",
- NULL},
- {"flags",
- (getter)Texture_getFlags, (setter)Texture_setFlags,
- "Texture's 'Flag' bits",
- NULL},
- {"hFracDim",
- (getter)Texture_getHFracDim, (setter)Texture_setHFracDim,
- "Highest fractional dimension (for Musgrave textures)",
- NULL},
- {"imageFlags",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Texture's 'ImageFlags' bits",
- NULL},
- {"image",
- (getter)Texture_getImage, (setter)Texture_setImage,
- "Texture's image object",
- NULL},
- {"ipo",
- (getter)Texture_getIpo, (setter)Texture_setIpo,
- "Texture Ipo data",
- NULL},
- {"iScale",
- (getter)Texture_getIScale, (setter)Texture_setIScale,
- "Intensity output scale (for Musgrave and Voronoi textures)",
- NULL},
- {"lacunarity",
- (getter)Texture_getLacunarity, (setter)Texture_setLacunarity,
- "Gap between succesive frequencies (for Musgrave textures)",
- NULL},
- {"offset",
- (getter)Texture_getOffset, (setter)Texture_setOffset,
- "Fractal offset (for Musgrave textures)",
- NULL},
- {"gain",
- (getter)Texture_getGain, (setter)Texture_setGain,
- "Gain multiplier (for Musgrave textures)",
- NULL},
- {"noiseBasis",
- (getter)Texture_getNoiseBasis, (setter)Texture_setNoiseBasis,
- "Noise basis type (wood, stucci, marble, clouds, Musgrave, distorted noise)",
- NULL},
- {"noiseBasis2",
- (getter)Texture_getNoiseBasis2, (setter)Texture_setNoiseBasis2,
- "Additional noise basis type (wood, marble, distorted noise)",
- (void *)EXPP_TEX_NOISEBASIS2},
- {"noiseDepth",
- (getter)Texture_getNoiseDepth, (setter)Texture_setNoiseDepth,
- "Noise depth (magic, marble, clouds)",
- NULL},
- {"noiseSize",
- (getter)Texture_getNoiseSize, (setter)Texture_setNoiseSize,
- "Noise size (wood, stucci, marble, clouds, Musgrave, distorted noise, Voronoi)",
- NULL},
-/* NOTE for API rewrite: should use dict constants instead of strings */
- {"noiseType",
- (getter)Texture_getNoiseType, (setter)Texture_setNoiseType,
- "Noise type (for wood, stucci, marble, clouds textures)",
- NULL},
- {"octs",
- (getter)Texture_getOcts, (setter)Texture_setOcts,
- "Number of frequencies (for Musgrave textures)",
- NULL},
- {"repeat",
- (getter)Texture_getRepeat, (setter)Texture_setRepeat,
- "Repetition multiplier (for image textures)",
- NULL},
- {"rgbCol",
- (getter)Texture_getRGBCol, (setter)Texture_setRGBCol,
- "RGB color tuple",
- NULL},
- {"stype",
- (getter)Texture_getSType, (setter)Texture_setSType,
- "Texture's 'SType' mode",
- NULL},
- {"turbulence",
- (getter)Texture_getTurbulence, (setter)Texture_setTurbulence,
- "Turbulence (for magic, wood, stucci, marble textures)",
- NULL},
- {"type",
- (getter)Texture_getType, (setter)Texture_setType,
- "Texture's 'Type' mode",
- NULL},
- {"weight1",
- (getter)Texture_getWeight1, (setter)Texture_setWeight1,
- "Weight 1 (for Voronoi textures)",
- NULL},
- {"weight2",
- (getter)Texture_getWeight2, (setter)Texture_setWeight2,
- "Weight 2 (for Voronoi textures)",
- NULL},
- {"weight3",
- (getter)Texture_getWeight3, (setter)Texture_setWeight3,
- "Weight 3 (for Voronoi textures)",
- NULL},
- {"weight4",
- (getter)Texture_getWeight4, (setter)Texture_setWeight4,
- "Weight 4 (for Voronoi textures)",
- NULL},
- {"sine",
- (getter)Texture_getNoiseBasis2, (setter)Texture_setNoiseBasis2,
- "Produce bands using sine wave (marble, wood textures)",
- (void *)EXPP_TEX_NOISE_SINE},
- {"saw",
- (getter)Texture_getNoiseBasis2, (setter)Texture_setNoiseBasis2,
- "Produce bands using saw wave (marble, wood textures)",
- (void *)EXPP_TEX_NOISE_SAW},
- {"tri",
- (getter)Texture_getNoiseBasis2, (setter)Texture_setNoiseBasis2,
- "Produce bands using triangle wave (marble, wood textures)",
- (void *)EXPP_TEX_NOISE_TRI},
- {"interpol",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Interpolate image's pixels to fit texture mapping enabled ('ImageFlags')",
- (void *)TEX_INTERPOL},
- {"useAlpha",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Use of image's alpha channel enabled ('ImageFlags')",
- (void *)TEX_USEALPHA},
- {"calcAlpha",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Calculation of image's alpha channel enabled ('ImageFlags')",
- (void *)TEX_CALCALPHA},
- {"mipmap",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Mipmaps enabled ('ImageFlags')",
- (void *)TEX_MIPMAP},
- {"rot90",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "X/Y flip for rendering enabled ('ImageFlags')",
- (void *)TEX_IMAROT},
- {"autoRefresh",
- (getter)Texture_getIUserFlags, (setter)Texture_setIUserFlags,
- "Refresh image on frame changes enabled",
- (void *)IMA_ANIM_ALWAYS},
- {"cyclic",
- (getter)Texture_getIUserCyclic, (setter)Texture_setIUserCyclic,
- "Cycling of animated frames enabled",
- NULL},
-#if 0
- /* disabled, moved to image */
- {"fields",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Use of image's fields enabled ('ImageFlags')",
- (void *)TEX_FIELDS},
- {"movie",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Movie frames as images enabled ('ImageFlags')",
- (void *)TEX_ANIM5},
- {"anti",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Image anti-aliasing enabled ('ImageFlags')",
- (void *)TEX_ANTIALI},
- {"stField",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Standard field deinterlacing enabled ('ImageFlags')",
- (void *)TEX_STD_FIELD},
-#endif
- {"normalMap",
- (getter)Texture_getImageFlags, (setter)Texture_setImageFlags,
- "Use of image RGB values for normal mapping enabled ('ImageFlags')",
- (void *)TEX_NORMALMAP},
- {"colorband",
- (getter)Texture_getColorband, (setter)Texture_setColorband,
- "The colorband for this texture",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python Texture_Type callback function prototypes: */
-/*****************************************************************************/
-static int Texture_compare( BPy_Texture * a, BPy_Texture * b );
-static PyObject *Texture_repr( BPy_Texture * self );
-
-/*****************************************************************************/
-/* Python Texture_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject Texture_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Texture", /* char *tp_name; */
- sizeof( BPy_Texture ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Texture_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Texture_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Texture_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Texture_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-static PyObject *M_Texture_New( PyObject * self, PyObject * args,
- PyObject * kwords )
-{
- char *name_str = "Tex";
- static char *kwlist[] = { "name_str", NULL };
- PyObject *pytex; /* for Texture object wrapper in Python */
- Tex *bltex; /* for actual Tex we create in Blender */
-
- /* Parse the arguments passed in by the Python interpreter */
- if( !PyArg_ParseTupleAndKeywords
- ( args, kwords, "|s", kwlist, &name_str ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected zero, one or two strings as arguments" );
-
- bltex = add_texture( name_str ); /* first create the texture in Blender */
-
- if( bltex ) /* now create the wrapper obj in Python */
- pytex = Texture_CreatePyObject( bltex );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Texture in Blender" );
-
- /* let's return user count to zero, because add_texture() incref'd it */
- bltex->id.us = 0;
-
- if( pytex == NULL )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create Tex PyObject" );
-
- return pytex;
-}
-
-static PyObject *M_Texture_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- Tex *tex_iter;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" );
-
- tex_iter = G.main->tex.first;
-
- if( name ) { /* (name) - Search for texture by name */
-
- PyObject *wanted_tex = NULL;
-
- while( tex_iter ) {
- if( STREQ( name, tex_iter->id.name + 2 ) ) {
- wanted_tex =
- Texture_CreatePyObject( tex_iter );
- break;
- }
-
- tex_iter = tex_iter->id.next;
- }
-
- if( !wanted_tex ) { /* Requested texture doesn't exist */
- char error_msg[64];
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "Texture \"%s\" not found", name );
- return EXPP_ReturnPyObjError( PyExc_NameError,
- error_msg );
- }
-
- return wanted_tex;
- }
-
- else { /* () - return a list of wrappers for all textures in the scene */
- int index = 0;
- PyObject *tex_pylist, *pyobj;
-
- tex_pylist = PyList_New( BLI_countlist( &( G.main->tex ) ) );
- if( !tex_pylist )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- while( tex_iter ) {
- pyobj = Texture_CreatePyObject( tex_iter );
- if( !pyobj ) {
- Py_DECREF(tex_pylist);
- return EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Texture PyObject" );
- }
- PyList_SET_ITEM( tex_pylist, index, pyobj );
-
- tex_iter = tex_iter->id.next;
- index++;
- }
-
- return tex_pylist;
- }
-}
-
-static int Texture_compare( BPy_Texture * a, BPy_Texture * b )
-{
- return ( a->texture == b->texture ) ? 0 : -1;
-}
-
-static PyObject *Texture_repr( BPy_Texture * self )
-{
- return PyString_FromFormat( "[Texture \"%s\"]",
- self->texture->id.name + 2 );
-}
-
-static PyObject *M_Texture_TypesDict( void )
-{
- PyObject *Types = PyConstant_New( );
- if( Types ) {
- BPy_constant *d = ( BPy_constant * ) Types;
- PyConstant_Insert(d, "NONE", PyInt_FromLong(EXPP_TEX_TYPE_NONE));
- PyConstant_Insert(d, "CLOUDS", PyInt_FromLong(TEX_CLOUDS));
- PyConstant_Insert(d, "WOOD", PyInt_FromLong(TEX_WOOD));
- PyConstant_Insert(d, "MARBLE", PyInt_FromLong(TEX_MARBLE));
- PyConstant_Insert(d, "MAGIC", PyInt_FromLong(TEX_MAGIC));
- PyConstant_Insert(d, "BLEND", PyInt_FromLong(TEX_BLEND));
- PyConstant_Insert(d, "STUCCI", PyInt_FromLong(TEX_STUCCI));
- PyConstant_Insert(d, "NOISE", PyInt_FromLong(TEX_NOISE));
- PyConstant_Insert(d, "IMAGE", PyInt_FromLong(TEX_IMAGE));
- PyConstant_Insert(d, "PLUGIN", PyInt_FromLong(TEX_PLUGIN));
- PyConstant_Insert(d, "ENVMAP", PyInt_FromLong(TEX_ENVMAP));
- PyConstant_Insert(d, "MUSGRAVE", PyInt_FromLong(TEX_MUSGRAVE));
- PyConstant_Insert(d, "VORONOI", PyInt_FromLong(TEX_VORONOI));
- PyConstant_Insert(d, "DISTNOISE", PyInt_FromLong(TEX_DISTNOISE));
- }
- return Types;
-}
-
-static PyObject *M_Texture_STypesDict( void )
-{
- PyObject *STypes = PyConstant_New( );
- if( STypes ) {
- BPy_constant *d = ( BPy_constant * ) STypes;
-
- PyConstant_Insert(d, "CLD_DEFAULT",
- PyInt_FromLong(EXPP_TEX_STYPE_CLD_DEFAULT));
- PyConstant_Insert(d, "CLD_COLOR",
- PyInt_FromLong(EXPP_TEX_STYPE_CLD_COLOR));
- PyConstant_Insert(d, "WOD_BANDS",
- PyInt_FromLong(EXPP_TEX_STYPE_WOD_BANDS));
- PyConstant_Insert(d, "WOD_RINGS",
- PyInt_FromLong(EXPP_TEX_STYPE_WOD_RINGS));
- PyConstant_Insert(d, "WOD_BANDNOISE",
- PyInt_FromLong(EXPP_TEX_STYPE_WOD_BANDNOISE));
- PyConstant_Insert(d, "WOD_RINGNOISE",
- PyInt_FromLong(EXPP_TEX_STYPE_WOD_RINGNOISE));
- PyConstant_Insert(d, "MAG_DEFAULT",
- PyInt_FromLong(EXPP_TEX_STYPE_MAG_DEFAULT));
- PyConstant_Insert(d, "MBL_SOFT",
- PyInt_FromLong(EXPP_TEX_STYPE_MBL_SOFT));
- PyConstant_Insert(d, "MBL_SHARP",
- PyInt_FromLong(EXPP_TEX_STYPE_MBL_SHARP));
- PyConstant_Insert(d, "MBL_SHARPER",
- PyInt_FromLong(EXPP_TEX_STYPE_MBL_SHARPER));
- PyConstant_Insert(d, "BLN_LIN",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_LIN));
- PyConstant_Insert(d, "BLN_QUAD",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_QUAD));
- PyConstant_Insert(d, "BLN_EASE",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_EASE));
- PyConstant_Insert(d, "BLN_DIAG",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_DIAG));
- PyConstant_Insert(d, "BLN_SPHERE",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_SPHERE));
- PyConstant_Insert(d, "BLN_HALO",
- PyInt_FromLong(EXPP_TEX_STYPE_BLN_HALO));
- PyConstant_Insert(d, "STC_PLASTIC",
- PyInt_FromLong(EXPP_TEX_STYPE_STC_PLASTIC));
- PyConstant_Insert(d, "STC_WALLIN",
- PyInt_FromLong(EXPP_TEX_STYPE_STC_WALLIN));
- PyConstant_Insert(d, "STC_WALLOUT",
- PyInt_FromLong(EXPP_TEX_STYPE_STC_WALLOUT));
- PyConstant_Insert(d, "NSE_DEFAULT",
- PyInt_FromLong(EXPP_TEX_STYPE_NSE_DEFAULT));
- PyConstant_Insert(d, "IMG_DEFAULT",
- PyInt_FromLong(EXPP_TEX_STYPE_IMG_DEFAULT));
- PyConstant_Insert(d, "PLG_DEFAULT",
- PyInt_FromLong(EXPP_TEX_STYPE_PLG_DEFAULT));
- PyConstant_Insert(d, "ENV_STATIC",
- PyInt_FromLong(EXPP_TEX_STYPE_ENV_STATIC));
- PyConstant_Insert(d, "ENV_ANIM",
- PyInt_FromLong(EXPP_TEX_STYPE_ENV_ANIM));
- PyConstant_Insert(d, "ENV_LOAD",
- PyInt_FromLong(EXPP_TEX_STYPE_ENV_LOAD));
- PyConstant_Insert(d, "MUS_MFRACTAL",
- PyInt_FromLong(EXPP_TEX_STYPE_MUS_MFRACTAL));
- PyConstant_Insert(d, "MUS_RIDGEDMF",
- PyInt_FromLong(EXPP_TEX_STYPE_MUS_RIDGEDMF));
- PyConstant_Insert(d, "MUS_HYBRIDMF",
- PyInt_FromLong(EXPP_TEX_STYPE_MUS_HYBRIDMF));
- PyConstant_Insert(d, "MUS_FBM",
- PyInt_FromLong(EXPP_TEX_STYPE_MUS_FBM));
- PyConstant_Insert(d, "MUS_HTERRAIN",
- PyInt_FromLong(EXPP_TEX_STYPE_MUS_HTERRAIN));
- PyConstant_Insert(d, "DN_BLENDER",
- PyInt_FromLong(TEX_BLENDER));
- PyConstant_Insert(d, "DN_PERLIN",
- PyInt_FromLong(TEX_STDPERLIN));
- PyConstant_Insert(d, "DN_IMPROVEDPERLIN",
- PyInt_FromLong(TEX_NEWPERLIN));
- PyConstant_Insert(d, "DN_VORONOIF1",
- PyInt_FromLong(TEX_VORONOI_F1));
- PyConstant_Insert(d, "DN_VORONOIF2",
- PyInt_FromLong(TEX_VORONOI_F2));
- PyConstant_Insert(d, "DN_VORONOIF3",
- PyInt_FromLong(TEX_VORONOI_F3));
- PyConstant_Insert(d, "DN_VORONOIF4",
- PyInt_FromLong(TEX_VORONOI_F4));
- PyConstant_Insert(d, "DN_VORONOIF2F1",
- PyInt_FromLong(TEX_VORONOI_F2F1));
- PyConstant_Insert(d, "DN_VORONOICRACKLE",
- PyInt_FromLong(TEX_VORONOI_CRACKLE));
- PyConstant_Insert(d, "DN_CELLNOISE",
- PyInt_FromLong(TEX_CELLNOISE));
- PyConstant_Insert(d, "VN_INT",
- PyInt_FromLong(EXPP_TEX_STYPE_VN_INT));
- PyConstant_Insert(d, "VN_COL1",
- PyInt_FromLong(EXPP_TEX_STYPE_VN_COL1));
- PyConstant_Insert(d, "VN_COL2",
- PyInt_FromLong(EXPP_TEX_STYPE_VN_COL2));
- PyConstant_Insert(d, "VN_COL3",
- PyInt_FromLong(EXPP_TEX_STYPE_VN_COL3));
- PyConstant_Insert(d, "VN_TEX_DISTANCE",
- PyInt_FromLong(TEX_DISTANCE));
- PyConstant_Insert(d, "VN_TEX_DISTANCE_SQUARED",
- PyInt_FromLong(TEX_DISTANCE_SQUARED));
- PyConstant_Insert(d, "VN_TEX_MANHATTAN",
- PyInt_FromLong(TEX_MANHATTAN));
- PyConstant_Insert(d, "VN_TEX_CHEBYCHEV",
- PyInt_FromLong(TEX_CHEBYCHEV));
- PyConstant_Insert(d, "VN_TEX_MINKOVSKY_HALF",
- PyInt_FromLong(TEX_MINKOVSKY_HALF));
- PyConstant_Insert(d, "VN_TEX_MINKOVSKY_FOUR",
- PyInt_FromLong(TEX_MINKOVSKY_FOUR));
- PyConstant_Insert(d, "VN_TEX_MINKOVSKY",
- PyInt_FromLong(TEX_MINKOVSKY));
-
- }
- return STypes;
-}
-
-static PyObject *M_Texture_TexCoDict( void )
-{
- PyObject *TexCo = PyConstant_New( );
- if( TexCo ) {
- BPy_constant *d = ( BPy_constant * ) TexCo;
- PyConstant_Insert(d, "ORCO", PyInt_FromLong(TEXCO_ORCO));
- PyConstant_Insert(d, "REFL", PyInt_FromLong(TEXCO_REFL));
- PyConstant_Insert(d, "NOR", PyInt_FromLong(TEXCO_NORM));
- PyConstant_Insert(d, "GLOB", PyInt_FromLong(TEXCO_GLOB));
- PyConstant_Insert(d, "UV", PyInt_FromLong(TEXCO_UV));
- PyConstant_Insert(d, "OBJECT", PyInt_FromLong(TEXCO_OBJECT));
- PyConstant_Insert(d, "WIN", PyInt_FromLong(TEXCO_WINDOW));
- PyConstant_Insert(d, "VIEW", PyInt_FromLong(TEXCO_VIEW));
- PyConstant_Insert(d, "STICK", PyInt_FromLong(TEXCO_STICKY));
- PyConstant_Insert(d, "STRESS", PyInt_FromLong(TEXCO_STRESS));
- PyConstant_Insert(d, "TANGENT", PyInt_FromLong(TEXCO_TANGENT));
-
- /* World TexCo Settings */
- PyConstant_Insert(d, "ANGMAP", PyInt_FromLong(TEXCO_ANGMAP));
- PyConstant_Insert(d, "HSPHERE", PyInt_FromLong(TEXCO_H_SPHEREMAP));
- PyConstant_Insert(d, "HTUBE", PyInt_FromLong(TEXCO_H_TUBEMAP));
- }
- return TexCo;
-}
-
-static PyObject *M_Texture_MapToDict( void )
-{
- PyObject *MapTo = PyConstant_New( );
- if( MapTo ) {
- BPy_constant *d = ( BPy_constant * ) MapTo;
- PyConstant_Insert(d, "COL", PyInt_FromLong(MAP_COL));
- PyConstant_Insert(d, "NOR", PyInt_FromLong(MAP_NORM));
- PyConstant_Insert(d, "CSP", PyInt_FromLong(MAP_COLSPEC));
- PyConstant_Insert(d, "CMIR", PyInt_FromLong(MAP_COLMIR));
- PyConstant_Insert(d, "REF", PyInt_FromLong(MAP_REF));
- PyConstant_Insert(d, "SPEC", PyInt_FromLong(MAP_SPEC));
- PyConstant_Insert(d, "HARD", PyInt_FromLong(MAP_HAR));
- PyConstant_Insert(d, "ALPHA", PyInt_FromLong(MAP_ALPHA));
- PyConstant_Insert(d, "EMIT", PyInt_FromLong(MAP_EMIT));
- PyConstant_Insert(d, "RAYMIR", PyInt_FromLong(MAP_RAYMIRR));
- PyConstant_Insert(d, "AMB", PyInt_FromLong(MAP_AMB));
- PyConstant_Insert(d, "TRANSLU", PyInt_FromLong(MAP_TRANSLU));
- PyConstant_Insert(d, "DISP", PyInt_FromLong(MAP_DISPLACE));
- PyConstant_Insert(d, "WARP", PyInt_FromLong(MAP_WARP));
- }
- return MapTo;
-}
-
-static PyObject *M_Texture_FlagsDict( void )
-{
- PyObject *Flags = PyConstant_New( );
- if( Flags ) {
- BPy_constant *d = ( BPy_constant * ) Flags;
- PyConstant_Insert(d, "COLORBAND", PyInt_FromLong(TEX_COLORBAND));
- PyConstant_Insert(d, "FLIPBLEND", PyInt_FromLong(TEX_FLIPBLEND));
- PyConstant_Insert(d, "NEGALPHA", PyInt_FromLong(TEX_NEGALPHA));
- PyConstant_Insert(d, "CHECKER_ODD", PyInt_FromLong(TEX_CHECKER_ODD));
- PyConstant_Insert(d, "CHECKER_EVEN", PyInt_FromLong(TEX_CHECKER_EVEN));
- PyConstant_Insert(d, "PREVIEW_ALPHA", PyInt_FromLong(TEX_PRV_ALPHA));
- PyConstant_Insert(d, "REPEAT_XMIR", PyInt_FromLong(TEX_REPEAT_XMIR));
- PyConstant_Insert(d, "REPEAT_YMIR", PyInt_FromLong(TEX_REPEAT_YMIR));
- }
- return Flags;
-}
-
-static PyObject *M_Texture_ExtendModesDict( void )
-{
- PyObject *ExtendModes = PyConstant_New( );
- if( ExtendModes ) {
- BPy_constant *d = ( BPy_constant * ) ExtendModes;
- PyConstant_Insert(d, "EXTEND", PyInt_FromLong(TEX_EXTEND));
- PyConstant_Insert(d, "CLIP", PyInt_FromLong(TEX_CLIP));
- PyConstant_Insert(d, "CLIPCUBE", PyInt_FromLong(TEX_CLIPCUBE));
- PyConstant_Insert(d, "REPEAT", PyInt_FromLong(TEX_REPEAT));
- PyConstant_Insert(d, "CHECKER", PyInt_FromLong(TEX_CHECKER));
- }
- return ExtendModes;
-}
-
-static PyObject *M_Texture_ImageFlagsDict( void )
-{
- PyObject *ImageFlags = PyConstant_New( );
- if( ImageFlags ) {
- BPy_constant *d = ( BPy_constant * ) ImageFlags;
- PyConstant_Insert(d, "INTERPOL", PyInt_FromLong(TEX_INTERPOL));
- PyConstant_Insert(d, "USEALPHA", PyInt_FromLong(TEX_USEALPHA));
- PyConstant_Insert(d, "MIPMAP", PyInt_FromLong(TEX_MIPMAP));
- PyConstant_Insert(d, "ROT90", PyInt_FromLong(TEX_IMAROT));
- PyConstant_Insert(d, "CALCALPHA", PyInt_FromLong(TEX_CALCALPHA));
- PyConstant_Insert(d, "NORMALMAP", PyInt_FromLong(TEX_NORMALMAP));
- }
- return ImageFlags;
-}
-
-static PyObject *M_Texture_NoiseDict( void )
-{
- PyObject *Noise = PyConstant_New( );
- if( Noise ) {
- BPy_constant *d = ( BPy_constant * ) Noise;
- PyConstant_Insert(d, "SINE", PyInt_FromLong(EXPP_TEX_NOISE_SINE));
- PyConstant_Insert(d, "SAW", PyInt_FromLong(EXPP_TEX_NOISE_SAW));
- PyConstant_Insert(d, "TRI", PyInt_FromLong(EXPP_TEX_NOISE_TRI));
- PyConstant_Insert(d, "BLENDER", PyInt_FromLong(TEX_BLENDER));
- PyConstant_Insert(d, "PERLIN", PyInt_FromLong(TEX_STDPERLIN));
- PyConstant_Insert(d, "IMPROVEDPERLIN", PyInt_FromLong(TEX_NEWPERLIN));
- PyConstant_Insert(d, "VORONOIF1", PyInt_FromLong(TEX_VORONOI_F1));
- PyConstant_Insert(d, "VORONOIF2", PyInt_FromLong(TEX_VORONOI_F2));
- PyConstant_Insert(d, "VORONOIF3", PyInt_FromLong(TEX_VORONOI_F3));
- PyConstant_Insert(d, "VORONOIF4", PyInt_FromLong(TEX_VORONOI_F4));
- PyConstant_Insert(d, "VORONOIF2F1", PyInt_FromLong(TEX_VORONOI_F2F1));
- PyConstant_Insert(d, "VORONOICRACKLE",
- PyInt_FromLong(TEX_VORONOI_CRACKLE));
- PyConstant_Insert(d, "CELLNOISE", PyInt_FromLong(TEX_CELLNOISE));
- }
- return Noise;
-}
-
-static PyObject *M_Texture_BlendModesDict( void )
-{
- PyObject *BlendModes = PyConstant_New( );
- if( BlendModes ) {
- BPy_constant *d = ( BPy_constant * ) BlendModes;
- PyConstant_Insert(d, "MIX", PyInt_FromLong(MTEX_BLEND));
- PyConstant_Insert(d, "MULTIPLY", PyInt_FromLong(MTEX_MUL));
- PyConstant_Insert(d, "ADD", PyInt_FromLong(MTEX_ADD));
- PyConstant_Insert(d, "SUBTRACT", PyInt_FromLong(MTEX_SUB));
- PyConstant_Insert(d, "DIVIDE", PyInt_FromLong(MTEX_DIV));
- PyConstant_Insert(d, "DARKEN", PyInt_FromLong(MTEX_DARK));
- PyConstant_Insert(d, "DIFFERENCE", PyInt_FromLong(MTEX_DIFF));
- PyConstant_Insert(d, "LIGHTEN", PyInt_FromLong(MTEX_LIGHT));
- PyConstant_Insert(d, "SCREEN", PyInt_FromLong(MTEX_SCREEN));
- }
- return BlendModes;
-}
-
-static PyObject *M_Texture_MappingsDict( void )
-{
- PyObject *Mappings = PyConstant_New( );
- if( Mappings ) {
- BPy_constant *d = ( BPy_constant * ) Mappings;
- PyConstant_Insert(d, "FLAT", PyInt_FromLong(MTEX_FLAT));
- PyConstant_Insert(d, "CUBE", PyInt_FromLong(MTEX_CUBE));
- PyConstant_Insert(d, "TUBE", PyInt_FromLong(MTEX_TUBE));
- PyConstant_Insert(d, "SPHERE", PyInt_FromLong(MTEX_SPHERE));
- }
- return Mappings;
-}
-
-static PyObject *M_Texture_ProjDict( void )
-{
- PyObject *Proj = PyConstant_New( );
- if( Proj ) {
- BPy_constant *d = ( BPy_constant * ) Proj;
- PyConstant_Insert(d, "NONE", PyInt_FromLong(PROJ_N));
- PyConstant_Insert(d, "X", PyInt_FromLong(PROJ_X));
- PyConstant_Insert(d, "Y", PyInt_FromLong(PROJ_Y));
- PyConstant_Insert(d, "Z", PyInt_FromLong(PROJ_Z));
- }
- return Proj;
-}
-
-PyObject *Texture_Init( void )
-{
- PyObject *submodule;
- PyObject *dict;
-
- /* constants */
- PyObject *Types = M_Texture_TypesDict( );
- PyObject *STypes = M_Texture_STypesDict( );
- PyObject *TexCo = M_Texture_TexCoDict( );
- PyObject *MapTo = M_Texture_MapToDict( );
- PyObject *Flags = M_Texture_FlagsDict( );
- PyObject *ExtendModes = M_Texture_ExtendModesDict( );
- PyObject *ImageFlags = M_Texture_ImageFlagsDict( );
- PyObject *Noise = M_Texture_NoiseDict( );
- PyObject *BlendModes = M_Texture_BlendModesDict( );
- PyObject *Mappings = M_Texture_MappingsDict( );
- PyObject *Proj = M_Texture_ProjDict( );
-
- if( PyType_Ready( &Texture_Type ) < 0)
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Texture",
- M_Texture_methods, M_Texture_doc );
-
- if( Types )
- PyModule_AddObject( submodule, "Types", Types );
- if( STypes )
- PyModule_AddObject( submodule, "STypes", STypes );
- if( TexCo )
- PyModule_AddObject( submodule, "TexCo", TexCo );
- if( MapTo )
- PyModule_AddObject( submodule, "MapTo", MapTo );
- if( Flags )
- PyModule_AddObject( submodule, "Flags", Flags );
- if( ExtendModes )
- PyModule_AddObject( submodule, "ExtendModes", ExtendModes );
- if( ImageFlags )
- PyModule_AddObject( submodule, "ImageFlags", ImageFlags );
- if( Noise )
- PyModule_AddObject( submodule, "Noise", Noise );
- if ( BlendModes )
- PyModule_AddObject( submodule, "BlendModes", BlendModes );
- if ( Mappings )
- PyModule_AddObject( submodule, "Mappings", Mappings );
- if ( Proj )
- PyModule_AddObject( submodule, "Proj", Proj );
-
- /* Add the MTex submodule to this module */
- dict = PyModule_GetDict( submodule );
- PyDict_SetItemString( dict, "MTex", MTex_Init( ) );
-
- return submodule;
-}
-
-PyObject *Texture_CreatePyObject( Tex * tex )
-{
- BPy_Texture *pytex;
-
- pytex = ( BPy_Texture * ) PyObject_NEW( BPy_Texture, &Texture_Type );
- if( !pytex )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create BPy_Texture PyObject" );
-
- pytex->texture = tex;
- return ( PyObject * ) pytex;
-}
-
-Tex *Texture_FromPyObject( PyObject * pyobj )
-{
- return ( ( BPy_Texture * ) pyobj )->texture;
-}
-
-/*****************************************************************************/
-/* Python BPy_Texture methods: */
-/*****************************************************************************/
-
-static PyObject *Texture_getExtend( BPy_Texture * self )
-{
- const char *extend = NULL;
-
- if( EXPP_map_getStrVal
- ( tex_extend_map, self->texture->extend, &extend ) )
- return PyString_FromString( extend );
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "invalid internal extend mode" );
-}
-
-static PyObject *Texture_getImage( BPy_Texture * self )
-{
- /* we need this to be an IMAGE texture, and we must have an image */
- if( ( self->texture->type == TEX_IMAGE ||
- self->texture->type == TEX_ENVMAP )
- && self->texture->ima )
- return Image_CreatePyObject( self->texture->ima );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldgetSType( BPy_Texture * self )
-{
- const char *stype = NULL;
- int n_stype;
-
- if( self->texture->type == TEX_VORONOI )
- n_stype = self->texture->vn_coltype;
-#if 0
- else if( self->texture->type == TEX_MUSGRAVE )
- n_stype = self->texture->noisebasis;
-#endif
- else if( self->texture->type == TEX_ENVMAP )
- n_stype = self->texture->env->stype;
- else
- n_stype = self->texture->stype;
-
- if( EXPP_map_getStrVal( tex_stype_map[self->texture->type],
- n_stype, &stype ) )
- return PyString_FromString( stype );
-
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "invalid texture stype internally" );
-}
-
-static PyObject *Texture_oldgetType( BPy_Texture * self )
-{
- const char *type = NULL;
-
- if( EXPP_map_getStrVal( tex_type_map, self->texture->type, &type ) )
- return PyString_FromString( type );
-
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "invalid texture type internally" );
-}
-
-static int Texture_setAnimFrames( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->texture->iuser.frames,
- EXPP_TEX_ANIMFRAME_MIN,
- EXPP_TEX_ANIMFRAME_MAX, 'h' );
-}
-
-static int Texture_setIUserCyclic( BPy_Texture * self, PyObject * value )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->texture->iuser.cycl = 1;
- else
- self->texture->iuser.cycl = 0;
- return 0;
-}
-
-#if 0
-/* this was stupid to begin with! (ton) */
-static int Texture_setAnimLength( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->texture->len,
- EXPP_TEX_ANIMLEN_MIN,
- EXPP_TEX_ANIMLEN_MAX, 'h' );
-}
-
-/* this is too simple to keep supporting? disabled for time being (ton) */
-static int Texture_setAnimMontage( BPy_Texture * self, PyObject * value )
-{
- int fradur[4][2];
- int i;
-
- if( !PyArg_ParseTuple( value, "(ii)(ii)(ii)(ii)",
- &fradur[0][0], &fradur[0][1],
- &fradur[1][0], &fradur[1][1],
- &fradur[2][0], &fradur[2][1],
- &fradur[3][0], &fradur[3][1] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a tuple of tuples" );
-
- for( i = 0; i < 4; ++i ) {
- self->texture->fradur[i][0] =
- (short)EXPP_ClampInt ( fradur[i][0], EXPP_TEX_ANIMMONSTART_MIN,
- EXPP_TEX_ANIMMONSTART_MAX );
- self->texture->fradur[i][1] =
- (short)EXPP_ClampInt ( fradur[i][1], EXPP_TEX_ANIMMONDUR_MIN,
- EXPP_TEX_ANIMMONDUR_MAX );
- }
-
- return 0;
-}
-#endif
-
-static int Texture_setAnimOffset( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->texture->iuser.offset,
- EXPP_TEX_ANIMOFFSET_MIN,
- EXPP_TEX_ANIMOFFSET_MAX, 'h' );
-}
-
-static int Texture_setAnimStart( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->texture->iuser.sfra,
- EXPP_TEX_ANIMSTART_MIN,
- EXPP_TEX_ANIMSTART_MAX, 'h' );
-}
-
-static int Texture_setBrightness( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->bright,
- EXPP_TEX_BRIGHTNESS_MIN,
- EXPP_TEX_BRIGHTNESS_MAX );
-}
-
-static int Texture_setContrast( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->contrast,
- EXPP_TEX_CONTRAST_MIN,
- EXPP_TEX_CONTRAST_MAX );
-}
-
-static int Texture_setCrop( BPy_Texture * self, PyObject * value )
-{
- float crop[4];
-
- if( !PyArg_ParseTuple( value, "ffff",
- &crop[0], &crop[1], &crop[2], &crop[3] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 4 floats" );
-
- self->texture->cropxmin = EXPP_ClampFloat( crop[0], EXPP_TEX_CROP_MIN,
- EXPP_TEX_CROP_MAX );
- self->texture->cropymin = EXPP_ClampFloat( crop[1], EXPP_TEX_CROP_MIN,
- EXPP_TEX_CROP_MAX );
- self->texture->cropxmax = EXPP_ClampFloat( crop[2], EXPP_TEX_CROP_MIN,
- EXPP_TEX_CROP_MAX );
- self->texture->cropymax = EXPP_ClampFloat( crop[3], EXPP_TEX_CROP_MIN,
- EXPP_TEX_CROP_MAX );
-
- return 0;
-}
-
-static int Texture_setIntExtend( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setIValueRange ( value, &self->texture->extend,
- EXPP_TEX_EXTEND_MIN,
- EXPP_TEX_EXTEND_MAX, 'h' );
-}
-
-static int Texture_setFieldsPerImage( BPy_Texture * self,
- PyObject * value )
-{
- return EXPP_setIValueClamped ( value, &self->texture->iuser.fie_ima,
- EXPP_TEX_FIEIMA_MIN,
- EXPP_TEX_FIEIMA_MAX, 'h' );
-
-}
-
-static int Texture_setFilterSize( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->filtersize,
- EXPP_TEX_FILTERSIZE_MIN,
- EXPP_TEX_FILTERSIZE_MAX );
-}
-
-static int Texture_setFlags( BPy_Texture * self, PyObject * value )
-{
- int param;
-
- if( !PyInt_Check( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%08x", TEX_FLAG_MASK );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
- param = PyInt_AS_LONG ( value );
-
- if ( ( param & TEX_FLAG_MASK ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
-
- self->texture->flag = (short)param;
-
-#if 0
- /* if Colorband enabled, make sure we allocate memory for it */
-
- if ( ( param & TEX_COLORBAND ) && !self->texture->coba )
- self->texture->coba = add_colorband();
-#endif
-
- return 0;
-}
-
-static int Texture_setImage( BPy_Texture * self, PyObject * value )
-{
- Image *blimg = NULL;
-
- if ( value != Py_None && !BPy_Image_Check (value) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an Image or None" );
-
-
- if( self->texture->ima ) {
- self->texture->ima->id.us--;
- self->texture->ima = NULL;
- }
-
- if ( value == Py_None )
- return 0;
-
- blimg = Image_FromPyObject( value );
-
- self->texture->ima = blimg;
- self->texture->type = TEX_IMAGE;
- BKE_image_signal(blimg, &self->texture->iuser, IMA_SIGNAL_RELOAD );
- id_us_plus( &blimg->id );
-
- return 0;
-}
-
-static int Texture_setImageFlags( BPy_Texture * self, PyObject * value,
- void *type )
-{
- short param;
-
- /*
- * if type is non-zero, then attribute is "mipmap", "calcAlpha", etc.,
- * so set/clear the bit in the bitfield based on the type
- */
-
- if( GET_INT_FROM_POINTER(type) ) {
- int err;
- param = self->texture->imaflag;
- err = EXPP_setBitfield( value, &param, GET_INT_FROM_POINTER(type), 'h' );
- if( err )
- return err;
-
- /*
- * if type is zero, then attribute is "imageFlags", so check
- * value for a valid bitmap range.
- */
-
- } else {
- int bitmask = TEX_INTERPOL
- | TEX_USEALPHA
- | TEX_MIPMAP
- | TEX_IMAROT
- | TEX_CALCALPHA
- | TEX_NORMALMAP;
-
- if( !PyInt_Check( value ) ) {
- char errstr[128];
- sprintf ( errstr , "expected int bitmask of 0x%08x", bitmask );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- param = (short)PyInt_AS_LONG( value );
- if( ( param & bitmask ) != param )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid bit(s) set in mask" );
- }
-
- /* everything is OK; save the new flag setting */
-
- self->texture->imaflag = param;
- return 0;
-}
-
-static int Texture_setIUserFlags( BPy_Texture * self, PyObject * value,
- void *flag )
-{
- int param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if( param )
- self->texture->iuser.flag |= GET_INT_FROM_POINTER(flag);
- else
- self->texture->iuser.flag &= ~GET_INT_FROM_POINTER(flag);
- return 0;
-}
-
-static int Texture_setNoiseDepth( BPy_Texture * self, PyObject * value )
-{
- short max = EXPP_TEX_NOISEDEPTH_MAX;
-
- /* for whatever reason, magic texture has a different max value */
-
- if( self->texture->type == TEX_MAGIC )
- max = EXPP_TEX_NOISEDEPTH_MAX_MAGIC;
-
- return EXPP_setIValueClamped ( value, &self->texture->noisedepth,
- EXPP_TEX_NOISEDEPTH_MIN, max, 'h' );
-}
-
-static int Texture_setNoiseSize( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->noisesize,
- EXPP_TEX_NOISESIZE_MIN,
- EXPP_TEX_NOISESIZE_MAX );
-}
-
-static int Texture_setNoiseType( BPy_Texture * self, PyObject * value )
-{
- char *param;
-
- if( !PyString_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
- param = PyString_AS_STRING( value );
-
- if( STREQ( param, "soft" ) )
- self->texture->noisetype = TEX_NOISESOFT;
- else if( STREQ( param, "hard" ) )
- self->texture->noisetype = TEX_NOISEPERL;
- else
- return EXPP_ReturnIntError( PyExc_ValueError,
- "noise type must be 'soft' or 'hard'" );
-
- return 0;
-}
-
-static int Texture_setNoiseBasis( BPy_Texture * self, PyObject * value )
-{
- int param;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int (see 'Noise' constant dictionary)" );
-
- param = PyInt_AS_LONG ( value );
-
- if ( param < TEX_BLENDER
- || ( param > TEX_VORONOI_CRACKLE
- && param != TEX_CELLNOISE ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid noise type" );
-
- self->texture->noisebasis = (short)param;
- return 0;
-}
-
-static int Texture_setNoiseBasis2( BPy_Texture * self, PyObject * value,
- void *type )
-{
- /*
- * if type is EXPP_TEX_NOISEBASIS2, then this is the "noiseBasis2"
- * attribute, so check the range and set the whole value
- */
-
- if( GET_INT_FROM_POINTER(type) == EXPP_TEX_NOISEBASIS2 ) {
- int param;
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int (see 'Noise' constant dictionary)" );
-
- param = PyInt_AS_LONG ( value );
-
- if ( param < TEX_BLENDER
- || ( param > TEX_VORONOI_CRACKLE
- && param != TEX_CELLNOISE ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid noise type" );
-
- self->texture->noisebasis2 = (short)param;
-
- /*
- * for other type values, the attribute is "sine", "saw" or "tri",
- * so set the noise basis to the supplied type if value is 1
- */
-
- } else {
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int value of 1" );
-
- if( PyInt_AS_LONG ( value ) != 1 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected int value of 1" );
-
- self->texture->noisebasis2 = (short)GET_INT_FROM_POINTER(type);
- }
- return 0;
-}
-
-static int Texture_setRepeat( BPy_Texture * self, PyObject * args )
-{
- int repeat[2];
-
- if( !PyArg_ParseTuple( args, "ii", &repeat[0], &repeat[1] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 2 ints" );
-
- self->texture->xrepeat = (short)EXPP_ClampInt( repeat[0], EXPP_TEX_REPEAT_MIN,
- EXPP_TEX_REPEAT_MAX );
- self->texture->yrepeat = (short)EXPP_ClampInt( repeat[1], EXPP_TEX_REPEAT_MIN,
- EXPP_TEX_REPEAT_MAX );
-
- return 0;
-}
-
-static int Texture_setRGBCol( BPy_Texture * self, PyObject * args )
-{
- float rgb[3];
-
- if( !PyArg_ParseTuple( args, "fff", &rgb[0], &rgb[1], &rgb[2] ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple of 3 floats" );
-
- self->texture->rfac = EXPP_ClampFloat( rgb[0], EXPP_TEX_RGBCOL_MIN,
- EXPP_TEX_RGBCOL_MAX );
- self->texture->gfac = EXPP_ClampFloat( rgb[1], EXPP_TEX_RGBCOL_MIN,
- EXPP_TEX_RGBCOL_MAX );
- self->texture->bfac = EXPP_ClampFloat( rgb[2], EXPP_TEX_RGBCOL_MIN,
- EXPP_TEX_RGBCOL_MAX );
-
- return 0;
-}
-
-static int Texture_setSType( BPy_Texture * self, PyObject * value )
-{
- short param;
- const char *dummy = NULL;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- param = (short)PyInt_AS_LONG ( value );
-
- /* use the stype map to find out if this is a valid stype for this type *
- * note that this will allow CLD_COLOR when type is ENVMAP. there's not *
- * much that we can do about this though. */
- if( !EXPP_map_getStrVal
- ( tex_stype_map[self->texture->type], param, &dummy ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "invalid stype (for this type)" );
-
- if( self->texture->type == TEX_VORONOI )
- self->texture->vn_coltype = param;
-#if 0
- else if( self->texture->type == TEX_MUSGRAVE )
- self->texture->noisebasis = param;
-#endif
- else if( self->texture->type == TEX_ENVMAP )
- self->texture->env->stype = param;
- else
- self->texture->stype = param;
-
- return 0;
-}
-
-static int Texture_setTurbulence( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->turbul,
- EXPP_TEX_TURBULENCE_MIN,
- EXPP_TEX_TURBULENCE_MAX );
-}
-
-static int Texture_setHFracDim( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->mg_H,
- EXPP_TEX_MH_G_MIN,
- EXPP_TEX_MH_G_MAX );
-}
-
-static int Texture_setLacunarity( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->mg_lacunarity,
- EXPP_TEX_LACUNARITY_MIN,
- EXPP_TEX_LACUNARITY_MAX );
-}
-
-static int Texture_setOffset( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->mg_offset,
- EXPP_TEX_OFST_MIN,
- EXPP_TEX_OFST_MAX );
-}
-
-static int Texture_setGain( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->mg_gain,
- EXPP_TEX_GAIN_MIN,
- EXPP_TEX_GAIN_MAX );
-}
-
-static int Texture_setOcts( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->mg_octaves,
- EXPP_TEX_OCTS_MIN,
- EXPP_TEX_OCTS_MAX );
-}
-
-static int Texture_setIScale( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->ns_outscale,
- EXPP_TEX_ISCALE_MIN,
- EXPP_TEX_ISCALE_MAX );
-}
-
-static int Texture_setType( BPy_Texture * self, PyObject * value )
-{
- int err = EXPP_setIValueRange ( value, &self->texture->type,
- EXPP_TEX_TYPE_MIN,
- EXPP_TEX_TYPE_MAX, 'h' );
-
- /*
- * if we set the texture OK, and it's a environment map, and
- * there is no environment map yet, allocate one (code borrowed
- * from texture_panel_envmap() in source/blender/src/buttons_shading.c)
- */
-
- if( !err && self->texture->type == TEX_ENVMAP
- && !self->texture->env ) {
- self->texture->env = BKE_add_envmap();
- self->texture->env->object= OBACT;
- }
- return err;
-}
-
-static int Texture_setDistMetric( BPy_Texture * self, PyObject * value )
-{
-#if 0
- char *dist = NULL;
-
- if( !PyArg_ParseTuple( value, "s", &dist ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- /* can we really trust texture->type? */
- if( self->texture->type == TEX_VORONOI &&
- !EXPP_map_getShortVal( tex_stype_map[self->texture->type + 2],
- dist, &self->texture->vn_distm ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid dist metric type" );
-
- Py_RETURN_NONE;
-#else
- return EXPP_setIValueRange ( value, &self->texture->vn_distm,
- TEX_DISTANCE,
- TEX_MINKOVSKY, 'h' );
-#endif
-}
-
-static int Texture_setExp( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->vn_mexp,
- EXPP_TEX_EXP_MIN,
- EXPP_TEX_EXP_MAX );
-}
-
-static int Texture_setWeight1( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->vn_w1,
- EXPP_TEX_WEIGHT1_MIN,
- EXPP_TEX_WEIGHT1_MAX );
-}
-
-static int Texture_setWeight2( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->vn_w2,
- EXPP_TEX_WEIGHT2_MIN,
- EXPP_TEX_WEIGHT2_MAX );
-}
-
-static int Texture_setWeight3( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->vn_w3,
- EXPP_TEX_WEIGHT3_MIN,
- EXPP_TEX_WEIGHT3_MAX );
-}
-
-static int Texture_setWeight4( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->vn_w4,
- EXPP_TEX_WEIGHT4_MIN,
- EXPP_TEX_WEIGHT4_MAX );
-}
-
-static int Texture_setDistAmnt( BPy_Texture * self, PyObject * value )
-{
- return EXPP_setFloatClamped ( value, &self->texture->dist_amount,
- EXPP_TEX_DISTAMNT_MIN,
- EXPP_TEX_DISTAMNT_MAX );
-}
-
-static PyObject *Texture_getIpo( BPy_Texture * self )
-{
- struct Ipo *ipo = self->texture->ipo;
-
- if( !ipo )
- Py_RETURN_NONE;
-
- return Ipo_CreatePyObject( ipo );
-}
-
-/*
- * this should accept a Py_None argument and just delete the Ipo link
- * (as Texture_clearIpo() does)
- */
-
-static int Texture_setIpo( BPy_Texture * self, PyObject * value )
-{
- Ipo *ipo = NULL;
- Ipo *oldipo = self->texture->ipo;
- ID *id;
-
- /* if parameter is not None, check for valid Ipo */
-
- if ( value != Py_None ) {
- if ( !BPy_Ipo_Check( value ) )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "expected an Ipo object" );
-
- ipo = Ipo_FromPyObject( value );
-
- if( !ipo )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "null ipo!" );
-
- if( ipo->blocktype != ID_TE )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Ipo is not a texture data Ipo" );
- }
-
- /* if already linked to Ipo, delete link */
-
- if ( oldipo ) {
- id = &oldipo->id;
- if( id->us > 0 )
- id->us--;
- }
-
- /* assign new Ipo and increment user count, or set to NULL if deleting */
-
- self->texture->ipo = ipo;
- if ( ipo ) {
- id = &ipo->id;
- id_us_plus(id);
- }
-
- return 0;
-}
-
-static PyObject *Texture_getAnimFrames( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->iuser.frames );
-}
-
-static PyObject *Texture_getIUserCyclic( BPy_Texture *self )
-{
- if( self->texture->iuser.cycl )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-#if 0
-/* disabled. this option was too stupid! (ton) */
-static PyObject *Texture_getAnimLength( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->len );
-}
-
-static PyObject *Texture_getAnimMontage( BPy_Texture *self )
-{
- return Py_BuildValue( "((i,i),(i,i),(i,i),(i,i))",
- self->texture->fradur[0][0],
- self->texture->fradur[0][1],
- self->texture->fradur[1][0],
- self->texture->fradur[1][1],
- self->texture->fradur[2][0],
- self->texture->fradur[2][1],
- self->texture->fradur[3][0],
- self->texture->fradur[3][1] );
-}
-#endif
-
-static PyObject *Texture_getAnimOffset( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->iuser.offset );
-}
-
-static PyObject *Texture_getAnimStart( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->iuser.sfra );
-}
-
-static PyObject *Texture_getBrightness( BPy_Texture *self )
-{
- return PyFloat_FromDouble ( self->texture->bright );
-}
-
-static PyObject *Texture_getContrast( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->contrast );
-}
-
-static PyObject *Texture_getCrop( BPy_Texture *self )
-{
- return Py_BuildValue( "(f,f,f,f)",
- self->texture->cropxmin,
- self->texture->cropymin,
- self->texture->cropxmax,
- self->texture->cropymax );
-}
-
-static PyObject *Texture_getDistAmnt( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->dist_amount );
-}
-
-static PyObject *Texture_getDistMetric( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->vn_distm );
-}
-
-static PyObject *Texture_getExp( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->vn_mexp );
-}
-
-static PyObject *Texture_getIntExtend( BPy_Texture * self )
-{
- return PyInt_FromLong( self->texture->extend );
-}
-
-static PyObject *Texture_getFieldsPerImage( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->iuser.fie_ima );
-}
-
-static PyObject *Texture_getFilterSize( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->filtersize );
-}
-
-static PyObject *Texture_getFlags( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->flag );
-}
-
-static PyObject *Texture_getHFracDim( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->mg_H );
-}
-
-static PyObject *Texture_getImageFlags( BPy_Texture *self, void *type )
-{
- /* type == 0 means attribute "imageFlags"
- * other types means attribute "mipmap", "calcAlpha", etc
- */
-
- if( GET_INT_FROM_POINTER(type) )
- return EXPP_getBitfield( &self->texture->imaflag, GET_INT_FROM_POINTER(type), 'h' );
- else
- return PyInt_FromLong( self->texture->imaflag );
-}
-
-static PyObject *Texture_getIUserFlags( BPy_Texture *self, void *flag )
-{
- if( self->texture->iuser.flag & GET_INT_FROM_POINTER(flag) )
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-static PyObject *Texture_getIScale( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->ns_outscale );
-}
-
-static PyObject *Texture_getLacunarity( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->mg_lacunarity );
-}
-
-static PyObject *Texture_getNoiseBasis( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->noisebasis );
-}
-
-static PyObject *Texture_getNoiseBasis2( BPy_Texture *self, void *type )
-{
- /* type == EXPP_TEX_NOISEBASIS2 means attribute "noiseBasis2"
- * other types means attribute "sine", "saw", or "tri" attribute
- */
-
- if( GET_INT_FROM_POINTER(type) == EXPP_TEX_NOISEBASIS2 )
- return PyInt_FromLong( self->texture->noisebasis2 );
- else
- return PyInt_FromLong( ( self->texture->noisebasis2 == GET_INT_FROM_POINTER(type) ) ? 1 : 0 );
-}
-
-static PyObject *Texture_getNoiseDepth( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->noisedepth );
-}
-
-static PyObject *Texture_getNoiseSize( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->noisesize );
-}
-
-static PyObject *Texture_getNoiseType( BPy_Texture *self )
-{
- if ( self->texture->noisetype == TEX_NOISESOFT )
- return PyString_FromString( "soft" );
- else
- return PyString_FromString( "hard" );
-}
-
-static PyObject *Texture_getOcts( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->mg_octaves );
-}
-
-static PyObject *Texture_getOffset( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->mg_offset );
-}
-
-static PyObject *Texture_getGain( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->mg_gain );
-}
-
-static PyObject *Texture_getRepeat( BPy_Texture *self )
-{
- return Py_BuildValue( "(i,i)", self->texture->xrepeat,
- self->texture->yrepeat );
-}
-
-static PyObject *Texture_getRGBCol( BPy_Texture *self )
-{
- return Py_BuildValue( "(f,f,f)", self->texture->rfac,
- self->texture->gfac, self->texture->bfac );
-}
-
-static PyObject *Texture_getSType( BPy_Texture *self )
-{
- if( self->texture->type == TEX_VORONOI )
- return PyInt_FromLong( self->texture->vn_coltype );
-#if 0
- if( self->texture->type == TEX_MUSGRAVE )
- return PyInt_FromLong( self->texture->noisebasis );
-#endif
- if( self->texture->type == TEX_ENVMAP )
- return PyInt_FromLong( self->texture->env->stype );
-
- return PyInt_FromLong( self->texture->stype );
-}
-
-static PyObject *Texture_getTurbulence( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->turbul );
-}
-
-static PyObject *Texture_getType( BPy_Texture *self )
-{
- return PyInt_FromLong( self->texture->type );
-}
-
-static PyObject *Texture_getWeight1( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->vn_w1 );
-}
-
-static PyObject *Texture_getWeight2( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->vn_w2 );
-}
-
-static PyObject *Texture_getWeight3( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->vn_w3 );
-}
-
-static PyObject *Texture_getWeight4( BPy_Texture *self )
-{
- return PyFloat_FromDouble( self->texture->vn_w4 );
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *Texture_oldsetImage( BPy_Texture * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)Texture_setImage );
-}
-
-static PyObject *Texture_oldsetIpo( BPy_Texture * self, PyObject * args )
-{
- return EXPP_setterWrapper ( (void *)self, args, (setter)Texture_setIpo );
-}
-
-/*
- * clearIpo() returns True/False depending on whether material has an Ipo
- */
-
-static PyObject *Texture_clearIpo( BPy_Texture * self )
-{
- /* if Ipo defined, delete it and return true */
-
- if( self->texture->ipo ) {
- PyObject *value = Py_BuildValue( "(O)", Py_None );
- EXPP_setterWrapper( (void *)self, value, (setter)Texture_setIpo );
- Py_DECREF( value );
- return EXPP_incr_ret_True();
- }
- return EXPP_incr_ret_False(); /* no ipo found */
-}
-
-/*
- * these older setter methods take strings as parameters; check the list of
- * strings to figure out which bits to set, then call new attribute setters
- * using the wrapper.
- */
-
-static PyObject *Texture_oldsetFlags( BPy_Texture * self, PyObject * args )
-{
- unsigned int i, flag = 0;
- PyObject *value, *error;
-
- /* check that we're passed a tuple */
-
- if ( !PyTuple_Check( args ) )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected a tuple of string arguments" );
-
- /* check each argument for type, find its value */
-
- for ( i = PyTuple_Size( args ); i-- ; ) {
- short thisflag;
- char * name = PyString_AsString( PyTuple_GET_ITEM( args, i ) );
- if( !name )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected string argument" );
-
- if( !EXPP_map_getShortVal( tex_flag_map, name, &thisflag ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown Texture flag argument" ) );
-
- flag |= thisflag;
- }
-
- /* build tuple, call wrapper */
-
- value = Py_BuildValue( "(i)", flag );
- error = EXPP_setterWrapper( (void *)self, value, (setter)Texture_setFlags );
- Py_DECREF ( value );
- return error;
-}
-
-/*
- * Texture_oldsetType() and Texture_oldsetExtend()
- *
- * These older setter methods convert a string into an integer setting, so
- * doesn't make sense to try wrapping them.
- */
-
-static PyObject *Texture_oldsetType( BPy_Texture * self, PyObject * args )
-{
- char *type = NULL;
-
- if( !PyArg_ParseTuple( args, "s", &type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( !EXPP_map_getShortVal( tex_type_map, type, &self->texture->type ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid texture type" );
-
- /*
- * if we set the texture OK, and it's a environment map, and
- * there is no environment map yet, allocate one (code borrowed
- * from texture_panel_envmap() in source/blender/src/buttons_shading.c)
- */
-
- if( self->texture->type == TEX_ENVMAP
- && !self->texture->env ) {
- self->texture->env = BKE_add_envmap();
- self->texture->env->object= OBACT;
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldsetExtend( BPy_Texture * self, PyObject * args )
-{
- char *extend = NULL;
- if( !PyArg_ParseTuple( args, "s", &extend ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- if( !EXPP_map_getShortVal
- ( tex_extend_map, extend, &self->texture->extend ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid extend mode" );
-
- Py_RETURN_NONE;
-}
-
-/*
- * Texture_oldsetNoiseBasis(), Texture_oldsetDistNoise()
- * Texture_oldsetSType(), Texture_oldsetDistMetric(),
- * Texture_oldsetImageFlags()
- *
- * these old setter methods behave differently from the attribute
- * setters, so they are left unchanged.
- */
-
-static PyObject *Texture_oldsetNoiseBasis( BPy_Texture * self, PyObject * args )
-{
-/* NOTE: leave as-is: don't use setterWrapper */
- char *nbasis;
-
- if( !PyArg_ParseTuple( args, "s", &nbasis ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
- if( self->texture->type == TEX_MUSGRAVE &&
- EXPP_map_getShortVal( tex_stype_map[TEX_DISTNOISE],
- nbasis, &self->texture->noisebasis ) );
- else if( self->texture->type == TEX_DISTNOISE &&
- !EXPP_map_getShortVal( tex_stype_map[TEX_DISTNOISE],
- nbasis, &self->texture->noisebasis2 ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid noise basis" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldsetDistNoise( BPy_Texture * self, PyObject * args )
-{
-/* NOTE: leave as-is: don't use setterWrapper */
- char *nbasis;
-
- if( !PyArg_ParseTuple( args, "s", &nbasis ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
- if( self->texture->type == TEX_DISTNOISE &&
- !EXPP_map_getShortVal( tex_stype_map[TEX_DISTNOISE],
- nbasis, &self->texture->noisebasis ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid noise basis" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldsetSType( BPy_Texture * self, PyObject * args )
-{
- char *stype = NULL;
- if( !PyArg_ParseTuple( args, "s", &stype ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- /* can we really trust texture->type? */
- if( ( self->texture->type == TEX_VORONOI &&
- EXPP_map_getShortVal( tex_stype_map[self->texture->type],
- stype, &self->texture->vn_coltype ) ) );
-#if 0
- else if( ( self->texture->type == TEX_MUSGRAVE &&
- EXPP_map_getShortVal( tex_stype_map
- [TEX_DISTNOISE], stype,
- &self->texture->noisebasis ) ) );
-#endif
- else if( ( self->texture->type == TEX_ENVMAP &&
- EXPP_map_getShortVal( tex_stype_map[self->texture->type],
- stype, &self->texture->env->stype ) ) );
- else if( !EXPP_map_getShortVal
- ( tex_stype_map[self->texture->type], stype,
- &self->texture->stype ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid texture stype" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldsetDistMetric( BPy_Texture * self, PyObject * args )
-{
-/* NOTE: leave as-is: don't use setterWrapper */
- char *dist = NULL;
-
- if( !PyArg_ParseTuple( args, "s", &dist ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
- /* can we really trust texture->type? */
- if( self->texture->type == TEX_VORONOI &&
- !EXPP_map_getShortVal( tex_stype_map[self->texture->type + 2],
- dist, &self->texture->vn_distm ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid dist metric type" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_oldsetImageFlags( BPy_Texture * self, PyObject * args )
-{
- unsigned int i, flag = 0;
-
- /* check that we're passed a tuple of no more than 3 args*/
-
- if( !PyTuple_Check( args ) )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected tuple of string arguments" );
-
- /* check each argument for type, find its value */
-
- for( i = PyTuple_Size( args ); i-- ; ) {
- short thisflag;
- char * name = PyString_AsString( PyTuple_GET_ITEM( args, i ) );
- if( !name )
- return EXPP_ReturnPyObjError ( PyExc_AttributeError,
- "expected string argument" );
-
- if( !EXPP_map_getShortVal( tex_imageflag_map, name, &thisflag ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "unknown Texture image flag name" );
-
- flag |= thisflag;
- }
-
- self->texture->imaflag = (short)flag;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *Texture_getColorband( BPy_Texture * self)
-{
- return EXPP_PyList_fromColorband( self->texture->coba );
-}
-
-int Texture_setColorband( BPy_Texture * self, PyObject * value)
-{
- return EXPP_Colorband_fromPyList( &self->texture->coba, value );
-}
-
-static PyObject *Texture_evaluate( BPy_Texture * self, PyObject * value )
-{
- TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
- float vec[4];
- /* int rgbnor; dont use now */
-
- if (VectorObject_Check(value)) {
- if(((VectorObject *)value)->size < 3)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expects a 3D vector object or a tuple of 3 numbers");
-
- /* rgbnor = .. we don't need this now */
- multitex_ext(self->texture, ((VectorObject *)value)->vec, NULL, NULL, 1, &texres);
- } else {
- float vec_in[3];
- if (!PyTuple_Check(value) || PyTuple_Size(value) < 3)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expects a 3D vector object or a tuple of 3 numbers");
-
- vec_in[0] = PyFloat_AsDouble(PyTuple_GET_ITEM(value, 0));
- vec_in[1] = PyFloat_AsDouble(PyTuple_GET_ITEM(value, 1));
- vec_in[2] = PyFloat_AsDouble(PyTuple_GET_ITEM(value, 2));
- if (PyErr_Occurred())
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "expects a 3D vector object or a tuple of 3 numbers");
-
- multitex_ext(self->texture, vec_in, NULL, NULL, 1, &texres);
- }
- vec[0] = texres.tr;
- vec[1] = texres.tg;
- vec[2] = texres.tb;
- vec[3] = texres.tin;
-
- return newVectorObject(vec, 4, Py_NEW);
-}
-
-static PyObject *Texture_copy( BPy_Texture * self )
-{
- Tex *tex = copy_texture(self->texture );
- tex->id.us = 0;
- return Texture_CreatePyObject(tex);
-}
diff --git a/source/blender/python/api2_2x/Texture.h b/source/blender/python/api2_2x/Texture.h
deleted file mode 100644
index 1508007936b..00000000000
--- a/source/blender/python/api2_2x/Texture.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Alex Mole
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* based on Image.h */
-
-#ifndef EXPP_TEXTURE_H
-#define EXPP_TEXTURE_H
-
-#include <Python.h>
-#include "DNA_texture_types.h"
-
-/*****************************************************************************/
-/* Python BPy_Texture structure definition */
-/*****************************************************************************/
-
-typedef struct {
- PyObject_HEAD
- Tex * texture; /* libdata must be second */
-} BPy_Texture;
-
-extern PyTypeObject Texture_Type;
-
-#define BPy_Texture_Check(v) ((v)->ob_type == &Texture_Type)
-
-
-/*****************************************************************************/
-/* Module Blender.Texture - public functions */
-/*****************************************************************************/
-
-PyObject *Texture_Init( void );
-PyObject *Texture_CreatePyObject( struct Tex *tex );
-Tex *Texture_FromPyObject( PyObject * pyobj );
-
-
-#endif /* EXPP_TEXTURE_H */
diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c
deleted file mode 100644
index 10b968cacba..00000000000
--- a/source/blender/python/api2_2x/Types.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Alex Mole, Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "Types.h"
-#include "IDProp.h"
-#include "gen_utils.h"
-#include "BLI_blenlib.h"
-/*
- stuff pasted from the old Types.h
- is only need here now
-*/
-
-extern PyTypeObject IDGroup_Type, IDArray_Type;
-extern PyTypeObject Action_Type, Armature_Type;
-extern PyTypeObject Pose_Type;
-extern PyTypeObject BezTriple_Type, Bone_Type, Button_Type;
-extern PyTypeObject Camera_Type;
-extern PyTypeObject CurNurb_Type, SurfNurb_Type;
-extern PyTypeObject Curve_Type;
-extern PyTypeObject Effect_Type, Font_Type;
-extern PyTypeObject Image_Type, Ipo_Type, IpoCurve_Type;
-extern PyTypeObject Lamp_Type, Lattice_Type;
-extern PyTypeObject Material_Type, Metaball_Type, MTex_Type;
-extern PyTypeObject NMFace_Type, NMEdge_Type, NMVert_Type, NMCol_Type,
- NMesh_Type;
-extern PyTypeObject MFace_Type, MVert_Type, PVert_Type, MEdge_Type, MCol_Type,
- Mesh_Type;
-
-extern PyTypeObject Object_Type;
-extern PyTypeObject Group_Type;
-extern PyTypeObject Particle_Type;
-extern PyTypeObject Scene_Type, RenderData_Type;
-extern PyTypeObject Text_Type, Text3d_Type, Texture_Type;
-extern PyTypeObject World_Type;
-extern PyTypeObject property_Type;
-extern PyTypeObject buffer_Type, constant_Type, euler_Type;
-extern PyTypeObject matrix_Type, quaternion_Type, rgbTuple_Type, vector_Type;
-extern PyTypeObject point_Type;
-extern PyTypeObject Modifier_Type, ModSeq_Type;
-extern PyTypeObject EditBone_Type;
-extern PyTypeObject ThemeSpace_Type;
-extern PyTypeObject ThemeUI_Type;
-extern PyTypeObject TimeLine_Type;
-
-/* includes to get structs for CSizeof */
-#include "Armature.h"
-#include "Bone.h"
-#include "BezTriple.h"
-#include "Camera.h"
-#include "Constraint.h"
-#include "Curve.h"
-#include "CurNurb.h"
-#include "Draw.h"
-#include "Effect.h"
-#include "Ipo.h"
-#include "Ipocurve.h"
-#include "Key.h"
-#include "Lamp.h"
-#include "Lattice.h"
-#include "Library.h"
-#include "Mathutils.h"
-#include "Geometry.h"
-#include "Mesh.h"
-#include "Metaball.h"
-#include "Modifier.h"
-#include "NMesh.h"
-#include "Node.h"
-#include "Object.h"
-#include "Group.h"
-#include "Registry.h"
-#include "Scene.h"
-#include "Sound.h"
-#include "SurfNurb.h"
-#include "Sys.h"
-#include "Text.h"
-#include "Texture.h"
-#include "Window.h"
-#include "World.h"
-#include "Particle.h"
-
-char M_Types_doc[] = "The Blender Types module\n\n\
-This module is a dictionary of all Blender Python types";
-
-static PyObject *Types_CSizeof(PyObject * self, PyObject *o)
-{
- int ret = 0;
- if(o) {
- if((void *)o == (void *)&Action_Type) {
- ret = sizeof(struct bAction);
- } else if ((void *)o==(void *)&Armature_Type) {
- ret = sizeof(struct bArmature);
- } else if ((void *)o==(void *)&BezTriple_Type) {
- ret = sizeof(struct BezTriple);
- } else if ((void *)o==(void *)&Bone_Type) {
- ret = sizeof(struct Bone);
- } else if ((void *)o==(void *)&Camera_Type) {
- ret = sizeof(struct Camera);
- } else if ((void *)o==(void *)&CurNurb_Type) {
- ret = sizeof(struct Nurb);
- } else if ((void *)o==(void *)&Curve_Type) {
- ret = sizeof(struct Curve);
- } else if ((void *)o==(void *)&Group_Type) {
- ret = sizeof(struct Group);
- } else if ((void *)o==(void *)&IDGroup_Type) {
- ret = sizeof(struct IDProperty);
- } else if ((void *)o==(void *)&Image_Type) {
- ret = sizeof(struct Image);
- } else if ((void *)o==(void *)&Ipo_Type) {
- ret = sizeof(struct Ipo);
- } else if ((void *)o==(void *)&IpoCurve_Type) {
- ret = sizeof(struct IpoCurve);
- } else if ((void *)o==(void *)&Lamp_Type) {
- ret = sizeof(struct Lamp);
- } else if ((void *)o==(void *)&Lattice_Type) {
- ret = sizeof(struct Lattice);
- } else if ((void *)o==(void *)&MCol_Type) {
- ret = sizeof(struct MCol);
- } else if ((void *)o==(void *)&MEdge_Type) {
- ret = sizeof(struct MEdge);
- } else if ((void *)o==(void *)&MFace_Type) {
- ret = sizeof(struct MFace);
- } else if ((void *)o==(void *)&MTex_Type) {
- ret = sizeof(struct MTex);
- } else if ((void *)o==(void *)&MVert_Type) {
- ret = sizeof(struct MVert);
- } else if ((void *)o==(void *)&Material_Type) {
- ret = sizeof(struct Material);
- } else if ((void *)o==(void *)&Mesh_Type) {
- ret = sizeof(struct Mesh);
- } else if ((void *)o==(void *)&Metaball_Type) {
- ret = sizeof(struct MetaBall);
- } else if ((void *)o==(void *)&ModSeq_Type) {
- ret = sizeof(struct ModifierData);
- } else if ((void *)o==(void *)&Modifier_Type) {
- ret = sizeof(struct ModifierData);
- } else if ((void *)o==(void *)&Object_Type) {
- ret = sizeof(struct Object);
- } else if ((void *)o==(void *)&Pose_Type) {
- ret = sizeof(struct bPose);
- } else if ((void *)o==(void *)&RenderData_Type) {
- ret = sizeof(struct RenderData);
- } else if ((void *)o==(void *)&Scene_Type) {
- ret = sizeof(struct Scene);
- } else if ((void *)o==(void *)&SurfNurb_Type) {
- ret = sizeof(struct Nurb);
- } else if ((void *)o==(void *)&Text3d_Type) {
- ret = sizeof(struct Curve);
- } else if ((void *)o==(void *)&Text_Type) {
- ret = sizeof(struct Text);
- } else if ((void *)o==(void *)&Texture_Type) {
- ret = sizeof(struct Tex);
- } else {
- ret = -1;
- }
- }
-
- return PyInt_FromLong(ret);
-}
-
-struct PyMethodDef M_Types_methods[] = {
- {"CSizeof", Types_CSizeof, METH_O,
- "(type) - Returns sizeof of the underlying C structure of the given type"},
- {NULL, NULL, 0, NULL}
-};
-
-
-
-/* The internal types (lowercase first letter, like constant_Type) are only
- * set when some object initializes them. But unless we do it early, we get
- * some easy and unpredictable (varies with platform, even distro) ways to
- * crash Blender. Some modules also need this early up, so let's generalize
- * and init all our pytypes here.
- */
-
-void types_InitAll( void )
-{
- Action_Type.ob_type = &PyType_Type;
- Pose_Type.ob_type = &PyType_Type;
- Armature_Type.ob_type = &PyType_Type;
- BezTriple_Type.ob_type = &PyType_Type;
- Bone_Type.ob_type = &PyType_Type;
- Button_Type.ob_type = &PyType_Type;
- Camera_Type.ob_type = &PyType_Type;
- CurNurb_Type.ob_type = &PyType_Type;
- Curve_Type.ob_type = &PyType_Type;
- Effect_Type.ob_type = &PyType_Type;
- Image_Type.ob_type = &PyType_Type;
- Ipo_Type.ob_type = &PyType_Type;
- IpoCurve_Type.ob_type = &PyType_Type;
- Lamp_Type.ob_type = &PyType_Type;
- Lattice_Type.ob_type = &PyType_Type;
- Material_Type.ob_type = &PyType_Type;
- Metaball_Type.ob_type = &PyType_Type;
- MTex_Type.ob_type = &PyType_Type;
- NMCol_Type.ob_type = &PyType_Type;
- NMFace_Type.ob_type = &PyType_Type;
- NMEdge_Type.ob_type = &PyType_Type;
- NMVert_Type.ob_type = &PyType_Type;
- NMesh_Type.ob_type = &PyType_Type;
- MFace_Type.ob_type = &PyType_Type;
- MVert_Type.ob_type = &PyType_Type;
- PVert_Type.ob_type = &PyType_Type;
- MEdge_Type.ob_type = &PyType_Type;
- MCol_Type.ob_type = &PyType_Type;
- Mesh_Type.ob_type = &PyType_Type;
- Object_Type.ob_type = &PyType_Type;
- Group_Type.ob_type = &PyType_Type;
- RenderData_Type.ob_type = &PyType_Type;
- Scene_Type.ob_type = &PyType_Type;
- SurfNurb_Type.ob_type = &PyType_Type;
- Text_Type.ob_type = &PyType_Type;
- Text3d_Type.ob_type = &PyType_Type;
- Texture_Type.ob_type = &PyType_Type;
- //TimeLine_Type.ob_type = &PyType_Type;
- World_Type.ob_type = &PyType_Type;
- buffer_Type.ob_type = &PyType_Type;
- constant_Type.ob_type = &PyType_Type;
- euler_Type.ob_type = &PyType_Type;
- matrix_Type.ob_type = &PyType_Type;
- quaternion_Type.ob_type = &PyType_Type;
- PyType_Ready( &rgbTuple_Type );
- vector_Type.ob_type = &PyType_Type;
- property_Type.ob_type = &PyType_Type;
- point_Type.ob_type = &PyType_Type;
- PyType_Ready( &Modifier_Type );
- PyType_Ready( &ModSeq_Type );
- PyType_Ready( &EditBone_Type );
- PyType_Ready( &ThemeSpace_Type );
- PyType_Ready( &ThemeUI_Type );
- IDProp_Init_Types();
-}
-
-/*****************************************************************************/
-/* Function: Types_Init */
-/*****************************************************************************/
-PyObject *Types_Init( void )
-{
- PyObject *submodule, *dict;
-
- submodule =
- Py_InitModule3( "Blender.Types", M_Types_methods, M_Types_doc );
-
- dict = PyModule_GetDict( submodule );
-
- /* The Blender Object Type */
-
- PyDict_SetItemString( dict, "ObjectType",
- ( PyObject * ) &Object_Type );
-
- /* Blender Object Data Types */
-
- PyDict_SetItemString( dict, "GroupType",
- ( PyObject * ) &Group_Type );
-
- PyDict_SetItemString( dict, "SceneType", ( PyObject * ) &Scene_Type );
- PyDict_SetItemString( dict, "RenderDataType",
- ( PyObject * ) &RenderData_Type );
-
- PyDict_SetItemString( dict, "NMeshType", ( PyObject * ) &NMesh_Type );
- PyDict_SetItemString( dict, "NMFaceType",
- ( PyObject * ) &NMFace_Type );
- PyDict_SetItemString( dict, "NMVertType",
- ( PyObject * ) &NMVert_Type );
- PyDict_SetItemString( dict, "NMEdgeType",
- ( PyObject * ) &NMEdge_Type );
- PyDict_SetItemString( dict, "NMColType", ( PyObject * ) &NMCol_Type );
-
- PyDict_SetItemString( dict, "MeshType", ( PyObject * ) &Mesh_Type );
- PyDict_SetItemString( dict, "MFaceType",
- ( PyObject * ) &MFace_Type );
- PyDict_SetItemString( dict, "MEdgeType",
- ( PyObject * ) &MEdge_Type );
- PyDict_SetItemString( dict, "MVertType",
- ( PyObject * ) &MVert_Type );
- PyDict_SetItemString( dict, "PVertType",
- ( PyObject * ) &PVert_Type );
- PyDict_SetItemString( dict, "MColType", ( PyObject * ) &MCol_Type );
-
- PyDict_SetItemString( dict, "ArmatureType",
- ( PyObject * ) &Armature_Type );
- PyDict_SetItemString( dict, "BoneType", ( PyObject * ) &Bone_Type );
-
- PyDict_SetItemString( dict, "CurNurbType",
- ( PyObject * ) &CurNurb_Type );
- PyDict_SetItemString( dict, "SurfNurbType",
- ( PyObject * ) &SurfNurb_Type );
- PyDict_SetItemString( dict, "CurveType", ( PyObject * ) &Curve_Type );
-
- PyDict_SetItemString( dict, "IpoType", ( PyObject * ) &Ipo_Type );
- PyDict_SetItemString( dict, "IpoCurveType", ( PyObject * ) &IpoCurve_Type );
- PyDict_SetItemString( dict, "MetaballType",
- ( PyObject * ) &Metaball_Type );
-
- PyDict_SetItemString( dict, "CameraType",
- ( PyObject * ) &Camera_Type );
- PyDict_SetItemString( dict, "ImageType", ( PyObject * ) &Image_Type );
- PyDict_SetItemString( dict, "LampType", ( PyObject * ) &Lamp_Type );
- PyDict_SetItemString( dict, "TextType", ( PyObject * ) &Text_Type );
- PyDict_SetItemString( dict, "Text3dType", ( PyObject * ) &Text3d_Type );
- PyDict_SetItemString( dict, "MaterialType",
- ( PyObject * ) &Material_Type );
-
- PyDict_SetItemString( dict, "ButtonType",
- ( PyObject * ) &Button_Type );
-
- PyDict_SetItemString( dict, "LatticeType",
- ( PyObject * ) &Lattice_Type );
-
- PyDict_SetItemString( dict, "TextureType",
- ( PyObject * ) &Texture_Type );
- PyDict_SetItemString( dict, "MTexType", ( PyObject * ) &MTex_Type );
-
- /* External helper Types available to the main ones above */
-
- PyDict_SetItemString( dict, "vectorType",
- ( PyObject * ) &vector_Type );
- PyDict_SetItemString( dict, "bufferType",
- ( PyObject * ) &buffer_Type );
- PyDict_SetItemString( dict, "constantType",
- ( PyObject * ) &constant_Type );
- PyDict_SetItemString( dict, "rgbTupleType",
- ( PyObject * ) &rgbTuple_Type );
- PyDict_SetItemString( dict, "matrixType",
- ( PyObject * ) &matrix_Type );
- PyDict_SetItemString( dict, "eulerType", ( PyObject * ) &euler_Type );
- PyDict_SetItemString( dict, "quaternionType",
- ( PyObject * ) &quaternion_Type );
- PyDict_SetItemString( dict, "BezTripleType",
- ( PyObject * ) &BezTriple_Type );
- PyDict_SetItemString( dict, "ActionType",
- ( PyObject * ) &Action_Type );
- PyDict_SetItemString( dict, "PoseType",
- ( PyObject * ) &Pose_Type );
- PyDict_SetItemString( dict, "propertyType",
- ( PyObject * ) &property_Type );
- PyDict_SetItemString( dict, "pointType",
- ( PyObject * ) &point_Type );
- PyDict_SetItemString( dict, "ModifierType",
- ( PyObject * ) &Modifier_Type );
- PyDict_SetItemString( dict, "ModSeqType",
- ( PyObject * ) &ModSeq_Type );
- PyDict_SetItemString( dict, "EditBoneType",
- ( PyObject * ) &EditBone_Type);
- PyDict_SetItemString( dict, "ThemeSpaceType",
- ( PyObject * ) &ThemeSpace_Type);
- PyDict_SetItemString( dict, "ThemeUIType",
- ( PyObject * ) &ThemeUI_Type);
- PyDict_SetItemString( dict, "IDGroupType",
- ( PyObject * ) &IDGroup_Type);
- PyDict_SetItemString( dict, "IDArrayType",
- ( PyObject * ) &IDArray_Type);
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Types.h b/source/blender/python/api2_2x/Types.h
deleted file mode 100644
index 7ffb1c03f19..00000000000
--- a/source/blender/python/api2_2x/Types.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Alex Mole
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_TYPES_H
-#define EXPP_TYPES_H
-
-#include <Python.h>
-
-PyObject *Types_Init( void );
-void types_InitAll( void );
-
-#endif /* EXPP_TYPES_H */
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c
deleted file mode 100644
index 40f6d52d8da..00000000000
--- a/source/blender/python/api2_2x/Window.c
+++ /dev/null
@@ -1,1585 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Tom Musgrove, Michael Reimpell,
- * Yann Vernier, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <Python.h>
-
-#include "BDR_editobject.h" /* enter / leave editmode */
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_object.h" /* for during_script() and during_scriptlink() */
-#include "BKE_scene.h" /* scene_find_camera() */
-#include "BIF_mywindow.h"
-#include "BIF_imasel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_filesel.h"
-#include "BIF_editmesh.h" /* for undo_push_mesh() */
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_drawtext.h"
-#include "BIF_poseobject.h"
-#include "BIF_toolbox.h" /* for error() */
-#include "DNA_view3d_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_text_types.h"
-#include "DNA_object_types.h"
-#include "mydevice.h"
-#include "blendef.h" /* OBACT */
-#include "windowTheme.h"
-#include "Mathutils.h"
-#include "constant.h"
-#include "gen_utils.h"
-#include "Armature.h"
-
-/* Pivot Types
--0 for Bounding Box Center; \n\
--1 for 3D Cursor\n\
--2 for Individual Centers\n\
--3 for Median Point\n\
--4 for Active Object"; */
-
-#define PIVOT_BOUNDBOX 0
-#define PIVOT_CURSOR 1
-#define PIVOT_INDIVIDUAL 2
-#define PIVOT_MEDIAN 3
-#define PIVOT_ACTIVE 4
-
-/* See Draw.c */
-extern int EXPP_disable_force_draw;
-extern void setcameratoview3d(void);
-
-/*****************************************************************************/
-/* Python API function prototypes for the Window module. */
-/*****************************************************************************/
-PyObject *M_Window_Redraw( PyObject * self, PyObject * args );
-static PyObject *M_Window_RedrawAll( PyObject * self, PyObject * args );
-static PyObject *M_Window_QRedrawAll( PyObject * self, PyObject * args );
-static PyObject *M_Window_DrawProgressBar( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetCursorPos( PyObject * self );
-static PyObject *M_Window_SetCursorPos( PyObject * self, PyObject * args );
-static PyObject *M_Window_WaitCursor( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetViewVector( PyObject * self );
-static PyObject *M_Window_GetActiveLayer( PyObject * self );
-static PyObject *M_Window_SetActiveLayer( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetViewQuat( PyObject * self );
-static PyObject *M_Window_SetViewQuat( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetViewOffset( PyObject * self );
-static PyObject *M_Window_SetViewOffset( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetViewMatrix( PyObject * self );
-static PyObject *M_Window_GetPerspMatrix( PyObject * self );
-static PyObject *M_Window_FileSelector( PyObject * self, PyObject * args );
-static PyObject *M_Window_ImageSelector( PyObject * self, PyObject * args );
-static PyObject *M_Window_EditMode( PyObject * self, PyObject * args );
-static PyObject *M_Window_PoseMode( PyObject * self, PyObject * args );
-static PyObject *M_Window_ViewLayers( PyObject * self, PyObject * args );
-static PyObject *M_Window_CameraView( PyObject * self, PyObject * args );
-static PyObject *M_Window_QTest( PyObject * self );
-static PyObject *M_Window_QRead( PyObject * self );
-static PyObject *M_Window_QAdd( PyObject * self, PyObject * args );
-static PyObject *M_Window_QHandle( PyObject * self, PyObject * args );
-static PyObject *M_Window_TestBreak( PyObject * self );
-static PyObject *M_Window_GetMouseCoords( PyObject * self );
-static PyObject *M_Window_SetMouseCoords( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetMouseButtons( PyObject * self );
-static PyObject *M_Window_GetKeyQualifiers( PyObject * self );
-static PyObject *M_Window_SetKeyQualifiers( PyObject * self, PyObject * args );
-static PyObject *M_Window_GetAreaSize( PyObject * self );
-static PyObject *M_Window_GetAreaID( PyObject * self );
-static PyObject *M_Window_GetScreenSize( PyObject * self );
-static PyObject *M_Window_GetScreens( PyObject * self );
-static PyObject *M_Window_SetScreen( PyObject * self, PyObject * value );
-static PyObject *M_Window_GetScreenInfo( PyObject * self, PyObject * args,
- PyObject * kwords );
-static PyObject *M_Window_GetPivot( PyObject * self );
-static PyObject *M_Window_SetPivot( PyObject * self, PyObject * value );
-
-PyObject *Window_Init( void );
-
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.Window.__doc__ */
-/*****************************************************************************/
-static char M_Window_doc[] = "The Blender Window module\n\n";
-
-static char M_Window_Redraw_doc[] =
- "() - Force a redraw of a specific Window Type (see Window.Types)";
-
-static char M_Window_RedrawAll_doc[] = "() - Redraw all windows";
-
-static char M_Window_QRedrawAll_doc[] =
- "() - Redraw all windows by queue event";
-
-static char M_Window_FileSelector_doc[] =
- "(callback [, title, filename]) - Open a file selector window.\n\
-The selected file name is used as argument to a function callback f(name)\n\
-that you must provide. 'title' is optional and defaults to 'SELECT FILE'.\n\
-'filename' is optional and defaults to Blender.Get('filename').\n\n\
-Example:\n\n\
-import Blender\n\n\
-def my_function(filename):\n\
- print 'The selected file was: ', filename\n\n\
-Blender.Window.FileSelector(my_function, 'SAVE FILE')\n";
-
-static char M_Window_ImageSelector_doc[] =
- "(callback [, title, filename]) - Open an image selector window.\n\
-The selected file name is used as argument to a function callback f(name)\n\
-that you must provide. 'title' is optional and defaults to 'SELECT IMAGE'.\n\
-'filename' is optional and defaults to Blender.Get('filename').\n\n\
-Example:\n\n\
-import Blender\n\n\
-def my_function(filename):\n\
- print 'The selected image file was: ', filename\n\n\
-Blender.Window.ImageSelector(my_function, 'LOAD IMAGE')\n";
-
-static char M_Window_DrawProgressBar_doc[] =
- "(done, text) - Draw a progress bar.\n\
-'done' is a float value <= 1.0, 'text' contains info about what is\n\
-currently being done.";
-
-static char M_Window_GetCursorPos_doc[] =
- "() - Get the current 3d cursor position as a list of three floats.";
-
-static char M_Window_SetCursorPos_doc[] =
- "([f,f,f]) - Set the current 3d cursor position from a list of three floats.";
-
-static char M_Window_WaitCursor_doc[] =
- "(bool) - Set cursor to wait mode (nonzero bool) or normal mode (0).";
-
-static char M_Window_GetViewVector_doc[] =
- "() - Get the current 3d view vector as a list of three floats [x,y,z].";
-
-static char M_Window_GetActiveLayer_doc[] =
- "() - Get the current 3d views active layer where new objects are created.";
-
-static char M_Window_SetActiveLayer_doc[] =
- "(int) - Set the current 3d views active layer where new objects are created.";
-
-static char M_Window_GetViewMatrix_doc[] =
- "() - Get the current 3d view matrix.";
-
-static char M_Window_GetPerspMatrix_doc[] =
- "() - Get the current 3d Persp matrix.";
-
-static char M_Window_EditMode_doc[] =
- "() - Get the current status -- 0: not in edit mode; 1: in edit mode.\n\
-(status) - if 1: enter edit mode; if 0: leave edit mode.\n\
-Returns the current status. This function is mostly useful to leave\n\
-edit mode before applying changes to a mesh (otherwise the changes will\n\
-be lost) and then returning to it upon leaving.";
-static char M_Window_PoseMode_doc[] =
- "() - Get the current status -- 0: not in pose mode; 1: in edit mode";
-
-static char M_Window_ViewLayers_doc[] =
- "(layers = [], winid = None) - Get/set active layers in all 3d View windows.\n\
-() - Make no changes, only return currently visible layers.\n\
-(layers = []) - a list of integers, each in the range [1, 20].\n\
-(layers = [], winid = int) - layers as above, winid is an optional.\n\
-arg that makes the function only set layers for that view.\n\
-This function returns the currently visible layers as a list of ints.";
-
-static char M_Window_GetViewQuat_doc[] =
- "() - Get the current VIEW3D view quaternion values.";
-
-static char M_Window_SetViewQuat_doc[] =
- "(quat) - Set the current VIEW3D view quaternion values.\n\
-(quat) - [f,f,f,f] or f,f,f,f: the new float values.";
-
-static char M_Window_GetViewOffset_doc[] =
- "() - Get the current VIEW3D view offset values.";
-
-static char M_Window_SetViewOffset_doc[] =
- "(ofs) - Set the current VIEW3D view offset values.\n\
-(ofs) - [f,f,f] or f,f,f: the new float values.";
-
-static char M_Window_CameraView_doc[] =
- "(camtov3d = 0) - Set the current VIEW3D view to the active camera's view.\n\
-(camtov3d = 0) - bool: if nonzero it's the camera that gets positioned at the\n\
-current view, instead of the view being changed to that of the camera.\n\n\
-If no camera is the active object, the active camera for the current scene\n\
-is used.";
-
-static char M_Window_QTest_doc[] =
- "() - Check if there are pending events in the event queue.";
-
-static char M_Window_QRead_doc[] =
- "() - Get the next pending event from the event queue.\n\
-This function returns a list [event, val], where:\n\
-event - int: the key or mouse event (see Blender.Draw module);\n\
-val - int: if 1 it's a key or mouse button press, if 0 a release. For\n\
- mouse movement events 'val' returns the new coordinates in x or y.";
-
-static char M_Window_QAdd_doc[] =
- "(win, evt, val, after = 0) - Add an event to some window's event queue.\n\
-(win) - int: the win id, see Blender.Window.GetScreenInfo();\n\
-(evt) - int: the event number, see events in Blender.Draw;\n\
-(val) - bool: 1 for a key press, 0 for a release;\n\
-(after) - bool: if 1 the event is put after the current queue and added later.";
-
-static char M_Window_QHandle_doc[] =
- "(win) - Process all events for the given window (area) now.\n\
-(win) - int: the window id, see Blender.Window.GetScreenInfo().\n\n\
-See Blender.Window.QAdd() for how to send events to a particular window.";
-
-static char M_Window_TestBreak_doc[] =
- "() - Returns true if the user has pressed escape.";
-
-static char M_Window_GetMouseCoords_doc[] =
- "() - Get mouse pointer's current screen coordinates.";
-
-static char M_Window_SetMouseCoords_doc[] =
- "(x, y) - Set mouse pointer's current screen coordinates.\n\
-(x,y) - ints ([x, y] also accepted): the new x, y coordinates.";
-
-static char M_Window_GetMouseButtons_doc[] =
- "() - Get the current mouse button state (see Blender.Window.MButs dict).";
-
-static char M_Window_GetKeyQualifiers_doc[] =
- "() - Get the current qualifier keys state.\n\
-An int is returned: or'ed combination of values in Blender.Window.Qual's dict.";
-
-static char M_Window_SetKeyQualifiers_doc[] =
- "(qual) - Fake qualifier keys state.\n\
-(qual) - int: an or'ed combination of the values in Blender.Window.Qual dict.\n\
-Note: remember to reset to 0 after handling the related event (see QAdd()).";
-
-static char M_Window_GetAreaID_doc[] =
- "() - Get the current window's (area) ID.";
-
-static char M_Window_GetAreaSize_doc[] =
- "() - Get the current window's (area) size as [width, height].";
-
-static char M_Window_GetScreenSize_doc[] =
- "() - Get the screen's size as [width, height].";
-
-static char M_Window_GetScreens_doc[] =
- "() - Get a list with the names of all available screens.";
-
-static char M_Window_SetScreen_doc[] =
- "(name) - Set current screen to the one with the given 'name'.";
-
-static char M_Window_GetScreenInfo_doc[] =
- "(type = -1, rect = 'win', screen = None)\n\
-- Get info about the the areas in the current screen setup.\n\
-(type = -1) - int: the space type (Blender.Window.Types) to restrict the\n\
- results to, all if -1;\n\
-(rect = 'win') - str: the rectangle of interest. This defines if the corner\n\
- coordinates returned will refer to:\n\
- - the whole area: 'total';\n\
- - only the header: 'header';\n\
- - only the window content (default): 'win'.\n\
-(screen = None) - str: the screen name, current if not given.\n\n\
-A list of dictionaries (one for each area) is returned.\n\
-Each dictionary has keys:\n\
-'vertices': [xmin, ymin, xmax, ymax] area corners;\n\
-'win': window type, see Blender.Window.Types dict;\n\
-'id': area's id.";
-
-static char M_Window_SetPivot_doc[] =
- "(Pivot) - Set Pivot Mode for 3D Viewport:\n\
-Options are: \n\
--PivotTypes.BOUNDBOX for Bounding Box Center; \n\
--PivotTypes.CURSOR for 3D Cursor\n\
--PivotTypes.INDIVIDUAL for Individual Centers\n\
--PivotTypes.MEDIAN for Median Point\n\
--PivotTypes.ACTIVE for Active Object";
-
-static char M_Window_GetPivot_doc[] =
- "Return the pivot for the active 3d window";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Window module: */
-/*****************************************************************************/
-struct PyMethodDef M_Window_methods[] = {
- {"Redraw", M_Window_Redraw, METH_VARARGS, M_Window_Redraw_doc},
- {"RedrawAll", M_Window_RedrawAll, METH_VARARGS,
- M_Window_RedrawAll_doc},
- {"QRedrawAll", M_Window_QRedrawAll, METH_VARARGS,
- M_Window_QRedrawAll_doc},
- {"FileSelector", M_Window_FileSelector, METH_VARARGS,
- M_Window_FileSelector_doc},
- {"ImageSelector", ( PyCFunction ) M_Window_ImageSelector, METH_VARARGS,
- M_Window_ImageSelector_doc},
- {"DrawProgressBar", M_Window_DrawProgressBar, METH_VARARGS,
- M_Window_DrawProgressBar_doc},
- {"drawProgressBar", M_Window_DrawProgressBar, METH_VARARGS,
- M_Window_DrawProgressBar_doc},
- {"GetCursorPos", ( PyCFunction ) M_Window_GetCursorPos, METH_NOARGS,
- M_Window_GetCursorPos_doc},
- {"SetCursorPos", M_Window_SetCursorPos, METH_VARARGS,
- M_Window_SetCursorPos_doc},
- {"WaitCursor", M_Window_WaitCursor, METH_VARARGS,
- M_Window_WaitCursor_doc},
- {"GetViewVector", ( PyCFunction ) M_Window_GetViewVector, METH_NOARGS,
- M_Window_GetViewVector_doc},
- {"GetActiveLayer", ( PyCFunction ) M_Window_GetActiveLayer, METH_NOARGS,
- M_Window_GetActiveLayer_doc},
- {"SetActiveLayer", ( PyCFunction ) M_Window_SetActiveLayer, METH_VARARGS,
- M_Window_SetActiveLayer_doc},
- {"GetViewQuat", ( PyCFunction ) M_Window_GetViewQuat, METH_NOARGS,
- M_Window_GetViewQuat_doc},
- {"SetViewQuat", ( PyCFunction ) M_Window_SetViewQuat, METH_VARARGS,
- M_Window_SetViewQuat_doc},
- {"GetViewOffset", ( PyCFunction ) M_Window_GetViewOffset, METH_NOARGS,
- M_Window_GetViewOffset_doc},
- {"SetViewOffset", ( PyCFunction ) M_Window_SetViewOffset, METH_VARARGS,
- M_Window_SetViewOffset_doc},
- {"GetViewMatrix", ( PyCFunction ) M_Window_GetViewMatrix, METH_NOARGS,
- M_Window_GetViewMatrix_doc},
- {"GetPerspMatrix", ( PyCFunction ) M_Window_GetPerspMatrix, METH_NOARGS,
- M_Window_GetPerspMatrix_doc},
- {"EditMode", ( PyCFunction ) M_Window_EditMode, METH_VARARGS,
- M_Window_EditMode_doc},
- {"PoseMode", ( PyCFunction ) M_Window_PoseMode, METH_VARARGS,
- M_Window_PoseMode_doc},
- {"ViewLayers", ( PyCFunction ) M_Window_ViewLayers, METH_VARARGS,
- M_Window_ViewLayers_doc},
- /* typo, deprecate someday: */
- {"ViewLayer", ( PyCFunction ) M_Window_ViewLayers, METH_VARARGS,
- M_Window_ViewLayers_doc},
- {"CameraView", ( PyCFunction ) M_Window_CameraView, METH_VARARGS,
- M_Window_CameraView_doc},
- {"QTest", ( PyCFunction ) M_Window_QTest, METH_NOARGS,
- M_Window_QTest_doc},
- {"QRead", ( PyCFunction ) M_Window_QRead, METH_NOARGS,
- M_Window_QRead_doc},
- {"QAdd", ( PyCFunction ) M_Window_QAdd, METH_VARARGS,
- M_Window_QAdd_doc},
- {"QHandle", ( PyCFunction ) M_Window_QHandle, METH_VARARGS,
- M_Window_QHandle_doc},
- {"TestBreak", ( PyCFunction ) M_Window_TestBreak, METH_NOARGS,
- M_Window_TestBreak_doc},
- {"GetMouseCoords", ( PyCFunction ) M_Window_GetMouseCoords,
- METH_NOARGS,
- M_Window_GetMouseCoords_doc},
- {"SetMouseCoords", ( PyCFunction ) M_Window_SetMouseCoords,
- METH_VARARGS,
- M_Window_SetMouseCoords_doc},
- {"GetMouseButtons", ( PyCFunction ) M_Window_GetMouseButtons,
- METH_NOARGS,
- M_Window_GetMouseButtons_doc},
- {"GetKeyQualifiers", ( PyCFunction ) M_Window_GetKeyQualifiers,
- METH_NOARGS,
- M_Window_GetKeyQualifiers_doc},
- {"SetKeyQualifiers", ( PyCFunction ) M_Window_SetKeyQualifiers,
- METH_VARARGS,
- M_Window_SetKeyQualifiers_doc},
- {"GetAreaSize", ( PyCFunction ) M_Window_GetAreaSize, METH_NOARGS,
- M_Window_GetAreaSize_doc},
- {"GetAreaID", ( PyCFunction ) M_Window_GetAreaID, METH_NOARGS,
- M_Window_GetAreaID_doc},
- {"GetScreenSize", ( PyCFunction ) M_Window_GetScreenSize, METH_NOARGS,
- M_Window_GetScreenSize_doc},
- {"GetScreens", ( PyCFunction ) M_Window_GetScreens, METH_NOARGS,
- M_Window_GetScreens_doc},
- {"SetScreen", ( PyCFunction ) M_Window_SetScreen, METH_O,
- M_Window_SetScreen_doc},
- {"GetScreenInfo", ( PyCFunction ) M_Window_GetScreenInfo,
- METH_VARARGS | METH_KEYWORDS, M_Window_GetScreenInfo_doc},
- {"GetPivot", ( PyCFunction ) M_Window_GetPivot, METH_NOARGS,
- M_Window_GetPivot_doc},
- {"SetPivot", ( PyCFunction ) M_Window_SetPivot, METH_O,
- M_Window_SetPivot_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Function: M_Window_Redraw */
-/* Python equivalent: Blender.Window.Redraw */
-/*****************************************************************************/
-/* not static so py_slider_update in Draw.[ch] can use it */
-PyObject *M_Window_Redraw( PyObject * self, PyObject * args )
-{
- ScrArea *tempsa, *sa;
- int wintype = SPACE_VIEW3D;
- short redraw_all = 0;
-
- if( !PyArg_ParseTuple( args, "|i", &wintype ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument (or nothing)" ) );
-
- if( wintype < 0 )
- redraw_all = 1;
-
- if( !during_script( ) && !G.background ) {
- tempsa = curarea;
- sa = G.curscreen->areabase.first;
-
- while( sa ) {
-
- if( sa->spacetype == wintype || redraw_all ) {
- if (sa->spacetype == SPACE_SCRIPT && EXPP_disable_force_draw) {
- scrarea_queue_redraw(sa);
- }
- else {
- /* do not call fancy hacks here like pop_space_text(st); (ton) */
- scrarea_do_windraw( sa );
- if( sa->headwin ) scrarea_do_headdraw( sa );
- }
- }
- sa = sa->next;
- }
-
- if( curarea != tempsa )
- areawinset( tempsa->win );
-
- if( curarea ) { /* is null if Blender is in bg mode */
- if( curarea->headwin )
- scrarea_do_headdraw( curarea );
- screen_swapbuffers( );
- }
- }
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: M_Window_RedrawAll */
-/* Python equivalent: Blender.Window.RedrawAll */
-/*****************************************************************************/
-static PyObject *M_Window_RedrawAll( PyObject * self, PyObject * args )
-{
- PyObject *arg = Py_BuildValue( "(i)", -1 );
- PyObject *ret = M_Window_Redraw( self, arg );
- Py_DECREF(arg);
- return ret;
-}
-
-/*****************************************************************************/
-/* Function: M_Window_QRedrawAll */
-/* Python equivalent: Blender.Window.QRedrawAll */
-/*****************************************************************************/
-static PyObject *M_Window_QRedrawAll( PyObject * self, PyObject * args )
-{
- EXPP_allqueue( REDRAWALL, 0 );
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: M_Window_FileSelector */
-/* Python equivalent: Blender.Window.FileSelector */
-/*****************************************************************************/
-
-/* This is the callback to "activate_fileselect" below. It receives the
- * selected filename and (using it as argument) calls the Python callback
- * provided by the script writer and stored in EXPP_FS_PyCallback. */
-
-static void getSelectedFile( char *name )
-{
- PyObject *pycallback;
- PyObject *result;
- Script *script;
-
- /* let's find the script that owns this callback */
- script = G.main->script.first;
- while (script) {
- if (script->flags & SCRIPT_RUNNING) break;
- script = script->id.next;
- }
-
- if (!script) {
- if (curarea->spacetype == SPACE_SCRIPT) {
- SpaceScript *sc = curarea->spacedata.first;
- script = sc->script;
- }
- }
- /* If 'script' is null,
- * The script must have had an error and closed,
- * but the fileselector was left open, show an error and exit */
- if (!script) {
- error("Python script error: script quit, cannot run callback");
- return;
- }
-
-
- pycallback = script->py_browsercallback;
-
- if (pycallback) {
- PyGILState_STATE gilstate = PyGILState_Ensure();
-
- result = PyObject_CallFunction( pycallback, "s", name );
-
- if (!result) {
- if (G.f & G_DEBUG)
- fprintf(stderr, "BPy error: Callback call failed!\n");
- }
- else Py_DECREF(result);
-
-
-
- if (script->py_browsercallback == pycallback) {
- if (script->flags & SCRIPT_GUI) {
- script->py_browsercallback = NULL;
- } else {
- SCRIPT_SET_NULL(script);
- }
- }
-
- /* else another call to selector was made inside pycallback */
-
- Py_DECREF(pycallback);
-
- PyGILState_Release(gilstate);
- }
-
- return;
-}
-
-/* Use for file and image selector */
-static PyObject * FileAndImageSelector(PyObject * self, PyObject * args, int type)
-{
- char *title = (type==0 ? "SELECT FILE" : "SELECT IMAGE");
- char *filename = G.sce;
- SpaceScript *sc;
- Script *script = NULL;
- PyObject *pycallback = NULL;
- int startspace = 0;
-
- if (during_scriptlink())
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "script links can't call the file/image selector");
-
- if (G.background)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "the file/image selector is not available in background mode");
-
- if((!PyArg_ParseTuple( args, "O|ss", &pycallback, &title, &filename))
- || (!PyCallable_Check(pycallback)))
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "\nexpected a callback function (and optionally one or two strings) "
- "as argument(s)" );
-
-/* trick: we move to a spacescript because then the fileselector will properly
- * unset our SCRIPT_FILESEL flag when the user chooses a file or cancels the
- * selection. This is necessary because when a user cancels, the
- * getSelectedFile function above doesn't get called and so couldn't unset the
- * flag. */
- startspace = curarea->spacetype;
- if( startspace != SPACE_SCRIPT )
- newspace( curarea, SPACE_SCRIPT );
-
- sc = curarea->spacedata.first;
-
- /* let's find the script that called us */
- script = G.main->script.first;
- while (script) {
- if (script->flags & SCRIPT_RUNNING) break;
- script = script->id.next;
- }
-
- if( !script ) {
- /* if not running, then we were already on a SpaceScript space, executing
- * a registered callback -- aka: this script has a gui */
- script = sc->script; /* this is the right script */
- } else { /* still running, use the trick */
- script->lastspace = startspace;
- sc->script = script;
- }
-
- if (!script) {
- /* should never happen unless we are executed
- * from the BGE or somthing really strange like that */
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Could not allocate a screen for an unknown reason." );
- }
-
- Py_INCREF(pycallback);
-
- script->flags |= SCRIPT_FILESEL;
-
- /* clear any previous callback (nested calls to selector) */
- if (script->py_browsercallback) {
- Py_DECREF((PyObject *)script->py_browsercallback);
- }
- script->py_browsercallback = pycallback;
-
- /* if were not running a script GUI here alredy, then dont make this script persistant */
- if ((script->flags & SCRIPT_GUI)==0) {
- script->scriptname[0] = '\0';
- script->scriptarg[0] = '\0';
- }
- if (type==0) {
- activate_fileselect( FILE_BLENDER, title, filename, getSelectedFile );
- } else {
- activate_imageselect( FILE_BLENDER, title, filename, getSelectedFile );
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_FileSelector( PyObject * self, PyObject * args )
-{
- return FileAndImageSelector( self, args, 0 );
-}
-
-static PyObject *M_Window_ImageSelector( PyObject * self, PyObject * args )
-{
- return FileAndImageSelector( self, args, 1 );
-}
-
-/*****************************************************************************/
-/* Function: M_Window_DrawProgressBar */
-/* Python equivalent: Blender.Window.DrawProgressBar */
-/*****************************************************************************/
-static PyObject *M_Window_DrawProgressBar( PyObject * self, PyObject * args )
-{
- float done;
- char *info = NULL;
- int retval = 0;
- ScrArea *sa = curarea;
-
- if (G.background)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "the progress bar is not available in background mode");
-
- if( !PyArg_ParseTuple( args, "fs", &done, &info ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a float and a string as arguments" ) );
-
- retval = progress_bar( done, info );
-
- areawinset(sa->win);
-
- return Py_BuildValue( "i", retval );
-}
-
-/*****************************************************************************/
-/* Function: M_Window_GetCursorPos */
-/* Python equivalent: Blender.Window.GetCursorPos */
-/*****************************************************************************/
-static PyObject *M_Window_GetCursorPos( PyObject * self )
-{
- float *cursor = NULL;
- PyObject *pylist;
-
- if( G.vd && G.vd->localview )
- cursor = G.vd->cursor;
- else
- cursor = G.scene->cursor;
-
- pylist = Py_BuildValue( "[fff]", cursor[0], cursor[1], cursor[2] );
-
- if( !pylist )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "GetCursorPos: couldn't create pylist" ) );
-
- return pylist;
-}
-
-/*****************************************************************************/
-/* Function: M_Window_SetCursorPos */
-/* Python equivalent: Blender.Window.SetCursorPos */
-/*****************************************************************************/
-static PyObject *M_Window_SetCursorPos( PyObject * self, PyObject * args )
-{
- int ok = 0;
- float val[3];
-
- if( PyObject_Length( args ) == 3 )
- ok = PyArg_ParseTuple( args, "fff", &val[0], &val[1],
- &val[2] );
- else
- ok = PyArg_ParseTuple( args, "(fff)", &val[0], &val[1],
- &val[2] );
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected [f,f,f] or f,f,f as arguments" );
-
- if( G.vd && G.vd->localview ) {
- G.vd->cursor[0] = val[0];
- G.vd->cursor[1] = val[1];
- G.vd->cursor[2] = val[2];
- } else {
- G.scene->cursor[0] = val[0];
- G.scene->cursor[1] = val[1];
- G.scene->cursor[2] = val[2];
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_WaitCursor( PyObject * self, PyObject * args )
-{
- int bool;
-
- if( !PyArg_ParseTuple( args, "i", &bool ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected bool (0 or 1) or nothing as argument" );
-
- waitcursor( bool ); /* nonzero bool sets, zero unsets */
-
- Py_RETURN_NONE;
-}
-
-/*****************************************************************************/
-/* Function: M_Window_GetViewVector */
-/* Python equivalent: Blender.Window.GetViewVector */
-/*****************************************************************************/
-static PyObject *M_Window_GetViewVector( PyObject * self )
-{
- float *vec = NULL;
-
- if( !G.vd )
- Py_RETURN_NONE;
-
- vec = G.vd->viewinv[2];
-
- return Py_BuildValue( "[fff]", vec[0], vec[1], vec[2] );
-}
-
-/*****************************************************************************/
-/* Function: M_Window_GetActiveLayer */
-/* Python equivalent: Blender.Window.GetActiveLayer */
-/*****************************************************************************/
-static PyObject *M_Window_GetActiveLayer( PyObject * self )
-{
- if (!G.vd) {
- return PyInt_FromLong(0);
- } else {
- return PyInt_FromLong( G.vd->layact );
- }
-}
-
-static PyObject *M_Window_SetActiveLayer( PyObject * self, PyObject * args )
-{
- int layer, bit=1;
- if( !PyArg_ParseTuple( args, "i", &layer ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int" ) );
-
- if (!G.vd)
- Py_RETURN_FALSE;
-
- bit= 0;
- while(bit<32) {
- if(layer & (1<<bit)) {
- G.vd->layact= 1<<bit;
- G.vd->lay |= G.vd->layact;
-
- if (G.vd->scenelock) {
- G.scene->lay |= G.vd->layact;
- }
- bit = -1; /* no error */
- break;
- }
- bit++;
- }
-
- if (bit != -1)
- return ( EXPP_ReturnPyObjError( PyExc_ValueError,
- "The flag could not be used for the active layer" ) );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_GetViewQuat( PyObject * self )
-{
- float *vec = NULL;
-
- if( !G.vd )
- Py_RETURN_NONE;
-
- vec = G.vd->viewquat;
-
- return Py_BuildValue( "[ffff]", vec[0], vec[1], vec[2], vec[3] );
-}
-
-static PyObject *M_Window_SetViewQuat( PyObject * self, PyObject * args )
-{
- int ok = 0;
- float val[4];
-
- if( !G.vd )
- Py_RETURN_NONE;
-
- if( PyObject_Length( args ) == 4 )
- ok = PyArg_ParseTuple( args, "ffff", &val[0], &val[1], &val[2],
- &val[3] );
- else
- ok = PyArg_ParseTuple( args, "(ffff)", &val[0], &val[1],
- &val[2], &val[3] );
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected [f,f,f,f] or f,f,f,f as arguments" );
-
- G.vd->viewquat[0] = val[0];
- G.vd->viewquat[1] = val[1];
- G.vd->viewquat[2] = val[2];
- G.vd->viewquat[3] = val[3];
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_GetViewOffset( PyObject * self )
-{
- if( !G.vd )
- Py_RETURN_NONE;
- return Py_BuildValue( "[fff]", G.vd->ofs[0], G.vd->ofs[1], G.vd->ofs[2] );
-}
-
-static PyObject *M_Window_SetViewOffset( PyObject * self, PyObject * args )
-{
- int ok = 0;
- float val[3];
-
- if( !G.vd )
- Py_RETURN_NONE;
-
- if( PyObject_Length( args ) == 3 )
- ok = PyArg_ParseTuple( args, "fff", &val[0], &val[1],
- &val[2] );
- else
- ok = PyArg_ParseTuple( args, "(fff)", &val[0], &val[1],
- &val[2] );
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected [f,f,f] or f,f,f as arguments" );
-
- G.vd->ofs[0] = val[0];
- G.vd->ofs[1] = val[1];
- G.vd->ofs[2] = val[2];
-
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************/
-/* Function: M_Window_GetViewMatrix */
-/* Python equivalent: Blender.Window.GetViewMatrix */
-/*****************************************************************************/
-static PyObject *M_Window_GetViewMatrix( PyObject * self )
-{
- if( !G.vd )
- Py_RETURN_NONE;
-
- return newMatrixObject( ( float * ) G.vd->viewmat, 4, 4, Py_WRAP );
-}
-
-/*****************************************************************************/
-/* Function: M_Window_GetPerspMatrix */
-/* Python equivalent: Blender.Window.GetPerspMatrix */
-/*****************************************************************************/
-static PyObject *M_Window_GetPerspMatrix( PyObject * self )
-{
- if( !G.vd )
- Py_RETURN_NONE;
-
- return newMatrixObject( ( float * ) G.vd->persmat, 4, 4, Py_WRAP );
-}
-
-
-/* update_armature_weakrefs()
- * helper function used in M_Window_EditMode.
- * rebuilds list of Armature weakrefs in __main__
- */
-
-static int update_armature_weakrefs()
-{
- /* stuff for armature weak refs */
- char *list_name = ARM_WEAKREF_LIST_NAME;
- PyObject *maindict = NULL, *armlist = NULL;
- PyObject *pyarmature = NULL;
- int x;
-
- maindict= PyModule_GetDict(PyImport_AddModule( "__main__"));
- armlist = PyDict_GetItemString(maindict, list_name);
- if( !armlist){
- printf("Oops - update_armature_weakrefs()\n");
- return 0;
- }
-
- for (x = 0; x < PySequence_Size(armlist); x++){
- pyarmature = PyWeakref_GetObject(PySequence_GetItem( armlist, x));
- if (pyarmature != Py_None)
- Armature_RebuildEditbones(pyarmature);
- }
- return 1;
-}
-
-
-static PyObject *M_Window_EditMode( PyObject * self, PyObject * args )
-{
- short status = -1;
- char *undo_str = "From script";
- int undo_str_len = 11;
- int do_undo = 1;
-
- if( !PyArg_ParseTuple( args,
- "|hs#i", &status, &undo_str, &undo_str_len, &do_undo ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional int (bool), string and int (bool) as arguments" );
-
- if( status >= 0 ) {
- if( status ) {
- if( !G.obedit ){
-
- //update armatures
- if(! update_armature_weakrefs()){
- return EXPP_ReturnPyObjError(
- PyExc_RuntimeError,
- "internal error - update_armature_weakrefs");
- }
-
- //enter editmode
- enter_editmode(0);
- }
- } else if( G.obedit ) {
- if( undo_str_len > 63 )
- undo_str[63] = '\0'; /* 64 is max */
- BIF_undo_push( undo_str ); /* This checks user undo settings */
- exit_editmode( EM_FREEDATA );
-
- //update armatures
- if(! update_armature_weakrefs()){
- return EXPP_ReturnPyObjError(
- PyExc_RuntimeError,
- "internal error - update_armature_weakrefs");
- }
-
- }
- }
-
- return Py_BuildValue( "h", G.obedit ? 1 : 0 );
-}
-
-static PyObject *M_Window_PoseMode( PyObject * self, PyObject * args )
-{
- short status = -1;
- short is_posemode = 0;
- Base *base;
-
- if( !PyArg_ParseTuple( args, "|h", &status ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional int (bool) as argument" );
-
- if( status >= 0 ) {
- if( status ) {
- enter_posemode();
- } else if( G.obedit ) {
- exit_posemode();
- }
- }
-
- base= BASACT;
- if (base && base->object->flag & OB_POSEMODE) {
- is_posemode = 1;
- }
-
- return Py_BuildValue( "h", is_posemode );
-}
-
-static PyObject *M_Window_ViewLayers( PyObject * self, PyObject * args )
-{
- PyObject *item = NULL;
- PyObject *list = NULL, *resl = NULL;
- int val, i, bit = 0, layer = 0, len_list;
- short winid = -1;
-
- if( !G.scene ) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "can't get pointer to global scene" );
- }
-
- /* Pase Args, Nothing, One list, Or a list and an int */
- if (PyTuple_GET_SIZE(args)!=0) {
- if( !PyArg_ParseTuple ( args, "O!|h", &PyList_Type, &list, &winid) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "nothing or a list and optionaly a window ID argument" );
- }
- }
-
- if( list ) {
- len_list = PyList_Size(list);
-
- if (len_list == 0)
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "list can't be empty, at list one layer must be set" );
-
- for( i = 0; i < len_list; i++ ) {
- item = PyList_GetItem( list, i );
- if( !PyInt_Check( item ) )
- return EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "list must contain only integer numbers" );
-
- val = ( int ) PyInt_AsLong( item );
- if( val < 1 || val > 20 )
- return EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "layer values must be in the range [1, 20]" );
-
- layer |= 1 << ( val - 1 );
- }
-
- if (winid==-1) {
- /* set scene and viewport */
- G.scene->lay = layer;
- if (G.vd) {
- G.vd->lay = layer;
-
- while( bit < 20 ) {
- val = 1 << bit;
- if( layer & val ) {
- G.vd->layact = val;
- break;
- }
- bit++;
- }
- }
- } else {
- /* only set the windows layer */
- ScrArea *sa;
- SpaceLink *sl;
- View3D *vd;
-
- if (G.curscreen) { /* can never be too careful */
- for (sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if (winid == sa->win) {
-
- for (sl= sa->spacedata.first; sl; sl= sl->next)
- if(sl->spacetype==SPACE_VIEW3D)
- break;
-
- if (!sl)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "The window matching the winid has no 3d viewport" );
-
- vd= (View3D *) sl;
- vd->lay = layer;
-
- for(bit= 0; bit < 20; bit++) {
- val = 1 << bit;
- if( layer & val ) {
- vd->layact = val;
- break;
- }
- }
-
- winid = -1; /* so we know its done */
- break;
- }
- }
- if (winid!=-1)
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "The winid argument did not match any window" );
- }
- }
- }
-
- resl = PyList_New( 0 );
- if( !resl )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create pylist!" ) );
-
- layer = G.scene->lay;
-
- bit = 0;
- while( bit < 20 ) {
- val = 1 << bit;
- if( layer & val ) {
- item = Py_BuildValue( "i", bit + 1 );
- PyList_Append( resl, item );
- Py_DECREF( item );
- }
- bit++;
- }
-
- return resl;
-}
-
-static PyObject *M_Window_CameraView( PyObject * self, PyObject * args )
-{
- short camtov3d = 0;
-
- if( !PyArg_ParseTuple( args, "|i", &camtov3d ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int (from Window.Views) as argument" );
-
- if( !G.vd )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "this function can only be used after a 3d View has been initialized" );
-
- if( !G.vd->camera ) {
- if( BASACT && OBACT->type == OB_CAMERA )
- G.vd->camera = OBACT;
- else
- G.vd->camera = scene_find_camera( G.scene );
- handle_view3d_lock( );
- }
-
- G.vd->persp = 2;
- G.vd->view = 0;
-
- if( camtov3d )
- setcameratoview3d( );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_QTest( PyObject * self )
-{
- return Py_BuildValue( "h", qtest( ) );
-}
-
-static PyObject *M_Window_QRead( PyObject * self )
-{
- short val = 0;
- unsigned short event;
-
- if (G.background)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "QRead is not available in background mode");
-
- event = extern_qread( &val );
-
- return Py_BuildValue( "ii", event, val );
-}
-
-static PyObject *M_Window_QAdd( PyObject * self, PyObject * args )
-{
- short win;
- short evt; /* unsigned, we check below */
- short val;
- short after = 0;
-
- if (G.background)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "QAdd is not available in background mode");
-
- if( !PyArg_ParseTuple( args, "hhh|h", &win, &evt, &val, &after ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected three or four ints as arguments" );
-
- if( evt < 0 ) /* evt is unsigned short */
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "event value must be a positive int, check events in Blender.Draw" );
-
- if( after )
- addafterqueue( win, evt, val );
- else
- addqueue( win, evt, val );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_QHandle( PyObject * self, PyObject * args )
-{
- short win;
- ScrArea *sa;
- ScrArea *oldsa = NULL;
-
- if (G.background)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "QHandle is not available in background mode");
-
- if (!G.curscreen)
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "No screens available");
-
- if( !PyArg_ParseTuple( args, "h", &win ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected an int as argument" );
-
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next)
- if( sa->win == win )
- break;
-
- if( sa ) {
- BWinEvent evt;
- short do_redraw = 0;
-
- if( sa != curarea || sa->win != mywinget( ) ) {
- oldsa = curarea;
- areawinset( sa->win );
- set_g_activearea( sa );
- }
- while( bwin_qread( sa->win, &evt ) ) {
- if( evt.event == REDRAW ) {
- do_redraw = 1;
- } else if( evt.event == CHANGED ) {
- sa->win_swap = 0;
- do_redraw = 1;
- } else {
- scrarea_do_winhandle( sa, &evt );
- }
- }
- }
-
- if( oldsa ) {
- areawinset( oldsa->win );
- set_g_activearea( oldsa );
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_TestBreak( PyObject * self )
-{
- if (blender_test_break()) {
- G.afbreek= 0;
- Py_RETURN_TRUE;
- } else {
- Py_RETURN_FALSE;
- }
-}
-
-static PyObject *M_Window_GetMouseCoords( PyObject * self )
-{
- short mval[2] = {0, 0};
-
- if (!G.background)
- getmouse( mval );
-
- return Py_BuildValue( "hh", mval[0], mval[1] );
-}
-
-static PyObject *M_Window_SetMouseCoords( PyObject * self, PyObject * args )
-{
- int ok, x, y;
-
- if( !G.curscreen )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "no current screen to retrieve info from!" );
-
- x = G.curscreen->sizex / 2;
- y = G.curscreen->sizey / 2;
-
- if( PyObject_Length( args ) == 2 )
- ok = PyArg_ParseTuple( args, "hh", &x, &y );
- else
- ok = PyArg_ParseTuple( args, "|(hh)", &x, &y );
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected [i, i] or i,i as arguments (or nothing)." );
-
- warp_pointer( x, y );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_GetMouseButtons( PyObject * self )
-{
- return PyInt_FromLong(G.background ? 0 : (int)get_mbut() );
-}
-
-static PyObject *M_Window_GetKeyQualifiers( PyObject * self )
-{
- return PyInt_FromLong( (int)get_qual() );
-}
-
-static PyObject *M_Window_SetKeyQualifiers( PyObject * self, PyObject * args )
-{
- short qual = 0;
-
- if( !PyArg_ParseTuple( args, "|h", &qual ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int (or'ed flags) as argument" );
-
- if( qual < 0 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value must be a positive int, check Blender.Window.Qual" );
-
- G.qual = qual;
-
- return Py_BuildValue( "h", qual );
-}
-
-static PyObject *M_Window_GetAreaSize( PyObject * self )
-{
- ScrArea *sa = curarea;
-
- if( !sa )
- Py_RETURN_NONE;
-
- return Py_BuildValue( "hh", sa->winx, sa->winy );
-}
-
-static PyObject *M_Window_GetAreaID( PyObject * self )
-{
- ScrArea *sa = curarea;
-
- if( !sa )
- Py_RETURN_NONE;
-
- return Py_BuildValue( "h", sa->win );
-}
-
-static PyObject *M_Window_GetScreenSize( PyObject * self )
-{
- bScreen *scr = G.curscreen;
-
- if( !scr )
- Py_RETURN_NONE;
-
- return Py_BuildValue( "hh", scr->sizex, scr->sizey );
-}
-
-
-static PyObject *M_Window_SetScreen( PyObject * self, PyObject * value )
-{
- bScreen *scr = G.main->screen.first;
- char *name = PyString_AsString(value);
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string as argument" );
-
- while( scr ) {
- if( !strcmp( scr->id.name + 2, name ) ) {
- setscreen( scr );
- break;
- }
- scr = scr->id.next;
- }
-
- if( !scr )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no such screen, check Window.GetScreens() for valid names" );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_GetScreens( PyObject * self )
-{
- bScreen *scr = G.main->screen.first;
- PyObject *list = PyList_New( 0 );
- PyObject *str = NULL;
-
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create py list!" );
-
- while( scr ) {
- str = PyString_FromString( scr->id.name + 2 );
-
- if( !str ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create py string!" );
- }
-
- PyList_Append( list, str ); /* incref's str */
- Py_DECREF( str );
-
- scr = scr->id.next;
- }
-
- return list;
-}
-
-static PyObject *M_Window_GetScreenInfo( PyObject * self, PyObject * args,
- PyObject * kwords )
-{
- ScrArea *sa = G.curscreen->areabase.first;
- bScreen *scr = G.main->screen.first;
- PyObject *item, *list;
- rcti *rct;
- int type = -1;
- char *rect = "win";
- char *screen = "";
- static char *kwlist[] = { "type", "rect", "screen", NULL };
- int rctype = 0;
-
- if( !PyArg_ParseTupleAndKeywords( args, kwords, "|iss", kwlist, &type,
- &rect, &screen ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected nothing or an int and two strings as arguments" );
-
- if( !strcmp( rect, "win" ) )
- rctype = 0;
- else if( !strcmp( rect, "total" ) )
- rctype = 1;
- else if( !strcmp( rect, "header" ) )
- rctype = 2;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "requested invalid type for area rectangle coordinates." );
-
- list = PyList_New( 0 );
-
- if( screen && screen[0] != '\0' ) {
- while( scr ) {
- if( !strcmp( scr->id.name + 2, screen ) ) {
- sa = scr->areabase.first;
- break;
- }
- scr = scr->id.next;
- }
- }
-
- if( !scr ) {
- Py_DECREF( list );
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no such screen, see existing ones with Window.GetScreens." );
- }
-
- while( sa ) {
- if( type != -1 && sa->spacetype != type ) {
- sa = sa->next;
- continue;
- }
-
- switch ( rctype ) {
- case 0:
- rct = &sa->winrct;
- break;
- case 1:
- rct = &sa->totrct;
- break;
- case 2:
- default:
- rct = &sa->headrct;
- }
-
- item = Py_BuildValue( "{s:[h,h,h,h],s:h,s:h}",
- "vertices", rct->xmin, rct->ymin,
- rct->xmax, rct->ymax, "type",
- ( short ) sa->spacetype, "id",
- ( short ) sa->win );
- PyList_Append( list, item );
- Py_DECREF( item );
-
- sa = sa->next;
- }
-
- return list;
-}
-
-static PyObject *M_Window_GetPivot( PyObject * self )
-{
- if (G.vd) {
- return PyInt_FromLong( G.vd->around );
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Window_SetPivot( PyObject * self, PyObject * value)
-
-{
- short pivot;
- if (G.vd) {
- pivot = (short)PyInt_AsLong( value );
-
- if ( pivot > 4 || pivot < 0 )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "Expected a constant from Window.PivotTypes" );
-
- G.vd->around = pivot;
- }
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************/
-/* Function: Window_Init */
-/*****************************************************************************/
-PyObject *Window_Init( void )
-{
- PyObject *submodule, *Types, *Qual, *MButs, *PivotTypes, *dict;
-
- submodule =
- Py_InitModule3( "Blender.Window", M_Window_methods,
- M_Window_doc );
-
- dict = PyModule_GetDict( submodule );
- if( dict )
- PyDict_SetItemString( dict, "Theme", Theme_Init( ) );
-
- Types = PyConstant_New( );
- Qual = PyConstant_New( );
- MButs = PyConstant_New( );
- PivotTypes = PyConstant_New( );
-
- if( Types ) {
- BPy_constant *d = ( BPy_constant * ) Types;
-
- PyConstant_Insert( d, "VIEW3D", PyInt_FromLong( SPACE_VIEW3D ) );
- PyConstant_Insert( d, "IPO", PyInt_FromLong( SPACE_IPO ) );
- PyConstant_Insert( d, "OOPS", PyInt_FromLong( SPACE_OOPS ) );
- PyConstant_Insert( d, "BUTS", PyInt_FromLong( SPACE_BUTS ) );
- PyConstant_Insert( d, "FILE", PyInt_FromLong( SPACE_FILE ) );
- PyConstant_Insert( d, "IMAGE", PyInt_FromLong( SPACE_IMAGE ) );
- PyConstant_Insert( d, "INFO", PyInt_FromLong( SPACE_INFO ) );
- PyConstant_Insert( d, "SEQ", PyInt_FromLong( SPACE_SEQ ) );
- PyConstant_Insert( d, "IMASEL", PyInt_FromLong( SPACE_IMASEL ) );
- PyConstant_Insert( d, "SOUND", PyInt_FromLong( SPACE_SOUND ) );
- PyConstant_Insert( d, "ACTION", PyInt_FromLong( SPACE_ACTION ) );
- PyConstant_Insert( d, "TEXT", PyInt_FromLong( SPACE_TEXT ) );
- PyConstant_Insert( d, "NLA", PyInt_FromLong( SPACE_NLA ) );
- PyConstant_Insert( d, "SCRIPT", PyInt_FromLong( SPACE_SCRIPT ) );
- PyConstant_Insert( d, "TIME", PyInt_FromLong( SPACE_TIME ) );
- PyConstant_Insert( d, "NODE", PyInt_FromLong( SPACE_NODE ) );
-
- PyModule_AddObject( submodule, "Types", Types );
- }
-
- if( Qual ) {
- BPy_constant *d = ( BPy_constant * ) Qual;
-
- PyConstant_Insert( d, "LALT", PyInt_FromLong( L_ALTKEY ) );
- PyConstant_Insert( d, "RALT", PyInt_FromLong( R_ALTKEY ) );
- PyConstant_Insert( d, "ALT", PyInt_FromLong( LR_ALTKEY ) );
- PyConstant_Insert( d, "LCTRL", PyInt_FromLong( L_CTRLKEY ) );
- PyConstant_Insert( d, "RCTRL", PyInt_FromLong( R_CTRLKEY ) );
- PyConstant_Insert( d, "CTRL", PyInt_FromLong( LR_CTRLKEY ) );
- PyConstant_Insert( d, "LSHIFT", PyInt_FromLong( L_SHIFTKEY ) );
- PyConstant_Insert( d, "RSHIFT", PyInt_FromLong( R_SHIFTKEY ) );
- PyConstant_Insert( d, "SHIFT", PyInt_FromLong( LR_SHIFTKEY ) );
-
- PyModule_AddObject( submodule, "Qual", Qual );
- }
-
- if( MButs ) {
- BPy_constant *d = ( BPy_constant * ) MButs;
-
- PyConstant_Insert( d, "L", PyInt_FromLong( L_MOUSE ) );
- PyConstant_Insert( d, "M", PyInt_FromLong( M_MOUSE ) );
- PyConstant_Insert( d, "R", PyInt_FromLong( R_MOUSE ) );
-
- PyModule_AddObject( submodule, "MButs", MButs );
- }
-
- if( PivotTypes ) {
- BPy_constant *d = ( BPy_constant * ) PivotTypes;
-
- PyConstant_Insert(d, "BOUNDBOX", PyInt_FromLong( PIVOT_BOUNDBOX ) );
- PyConstant_Insert(d, "CURSOR", PyInt_FromLong( PIVOT_CURSOR ) );
- PyConstant_Insert(d, "MEDIAN", PyInt_FromLong( PIVOT_MEDIAN ) );
- PyConstant_Insert(d, "ACTIVE", PyInt_FromLong( PIVOT_ACTIVE ) );
- PyConstant_Insert(d, "INDIVIDUAL", PyInt_FromLong( PIVOT_INDIVIDUAL ) );
-
- PyModule_AddObject( submodule, "PivotTypes", PivotTypes );
- }
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/Window.h b/source/blender/python/api2_2x/Window.h
deleted file mode 100644
index 685464c9a56..00000000000
--- a/source/blender/python/api2_2x/Window.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * $Id:*
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* This file is useless now, CAN BE REMOVED. */
-
-#ifndef EXPP_WINDOW_H
-#define EXPP_WINDOW_H
-
-#include <Python.h>
-
-PyObject *Window_Init( void );
-PyObject *M_Window_Redraw( PyObject * self, PyObject * args );
-
-#endif /* EXPP_WINDOW_H */
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c
deleted file mode 100644
index 354d8cda0b7..00000000000
--- a/source/blender/python/api2_2x/World.c
+++ /dev/null
@@ -1,1138 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot, Johnny Matthews
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/**
- * \file World.c
- * \ingroup scripts
- * \brief Blender.World Module and World Data PyObject implementation.
- *
- * Note: Parameters between "<" and ">" are optional. But if one of them is
- * given, all preceding ones must be given, too. Of course, this only relates
- * to the Python functions and methods described here and only inside Python
- * code. [ This will go to another file later, probably the main exppython
- * doc file]. XXX Better: put optional args with their default value:
- * (self, name = "MyName")
- */
-
-#include "World.h" /*This must come first*/
-
-#include "DNA_scene_types.h" /* for G.scene */
-#include "DNA_userdef_types.h"
-#include "BKE_global.h"
-#include "BKE_world.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-#include "BKE_texture.h"
-#include "BLI_blenlib.h"
-#include "BSE_editipo.h"
-#include "BIF_keyframing.h"
-#include "BIF_space.h"
-#include "mydevice.h"
-#include "Ipo.h"
-#include "MTex.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-#include "MEM_guardedalloc.h"
-
-#define IPOKEY_ZENITH 0
-#define IPOKEY_HORIZON 1
-#define IPOKEY_MIST 2
-#define IPOKEY_STARS 3
-#define IPOKEY_OFFSET 4
-#define IPOKEY_SIZE 5
-/*****************************************************************************/
-/* Python BPy_World methods declarations: */
-/*****************************************************************************/
-static PyObject *World_getRange( BPy_World * self );
-static PyObject *World_setRange( BPy_World * self, PyObject * args );
-static PyObject *World_getIpo( BPy_World * self );
-static PyObject *World_oldsetIpo( BPy_World * self, PyObject * args );
-static int World_setIpo( BPy_World * self, PyObject * args );
-static PyObject *World_clearIpo( BPy_World * self );
-static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args );
-static PyObject *World_getMode( BPy_World * self );
-static PyObject *World_oldsetMode( BPy_World * self, PyObject * args );
-static int World_setMode( BPy_World * self, PyObject * args );
-static PyObject *World_getSkytype( BPy_World * self );
-static PyObject *World_oldsetSkytype( BPy_World * self, PyObject * args );
-static int World_setSkytype( BPy_World * self, PyObject * args );
-static PyObject *World_getMistype( BPy_World * self );
-static PyObject *World_oldsetMistype( BPy_World * self, PyObject * args );
-static int World_setMistype( BPy_World * self, PyObject * args );
-static PyObject *World_getHor( BPy_World * self );
-static PyObject *World_oldsetHor( BPy_World * self, PyObject * args );
-static int World_setHor( BPy_World * self, PyObject * args );
-static PyObject *World_getZen( BPy_World * self );
-static PyObject *World_oldsetZen( BPy_World * self, PyObject * args );
-static int World_setZen( BPy_World * self, PyObject * args );
-static PyObject *World_getAmb( BPy_World * self );
-static PyObject *World_oldsetAmb( BPy_World * self, PyObject * args );
-static int World_setAmb( BPy_World * self, PyObject * args );
-static PyObject *World_getStar( BPy_World * self );
-static PyObject *World_oldsetStar( BPy_World * self, PyObject * args );
-static int World_setStar( BPy_World * self, PyObject * args );
-static PyObject *World_getMist( BPy_World * self );
-static PyObject *World_oldsetMist( BPy_World * self, PyObject * args );
-static int World_setMist( BPy_World * self, PyObject * args );
-static PyObject *World_getScriptLinks( BPy_World * self, PyObject * value );
-static PyObject *World_addScriptLink( BPy_World * self, PyObject * args );
-static PyObject *World_clearScriptLinks( BPy_World * self, PyObject * args );
-static PyObject *World_setCurrent( BPy_World * self );
-static PyObject *World_getTextures( BPy_World * self );
-static int World_setTextures( BPy_World * self, PyObject * value );
-static PyObject *World_copy( BPy_World * self );
-
-
-/*****************************************************************************/
-/* Python API function prototypes for the World module. */
-/*****************************************************************************/
-static PyObject *M_World_New( PyObject * self, PyObject * args,
- PyObject * keywords );
-static PyObject *M_World_Get( PyObject * self, PyObject * args );
-static PyObject *M_World_GetCurrent( PyObject * self );
-
-
-/*****************************************************************************/
-/* Python World_Type callback function prototypes: */
-/*****************************************************************************/
-//static int World_Print (BPy_World *self, FILE *fp, int flags);
-static int World_Compare( BPy_World * a, BPy_World * b );
-static PyObject *World_Repr( BPy_World * self );
-
-
-
-/*****************************************************************************/
-/* The following string definitions are used for documentation strings. */
-/* In Python these will be written to the console when doing a */
-/* Blender.World.__doc__ */
-/*****************************************************************************/
-static char M_World_doc[] = "The Blender World module\n\n\
-This module provides access to **World Data** objects in Blender\n\n";
-
-static char M_World_New_doc[] = "() - return a new World object";
-
-static char M_World_Get_doc[] =
- "(name) - return the world with the name 'name', \
-returns None if not found.\n If 'name' is not specified, \
-it returns a list of all worlds in the\ncurrent scene.";
-static char M_World_GetCurrent_doc[] = "() - returns the current world, or \
-None if the Scene has no world";
-
-
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.World module: */
-/*****************************************************************************/
-struct PyMethodDef M_World_methods[] = {
- {"New", ( PyCFunction ) M_World_New, METH_VARARGS | METH_KEYWORDS,
- M_World_New_doc},
- {"Get", M_World_Get, METH_VARARGS, M_World_Get_doc},
- {"GetActive", ( PyCFunction ) M_World_GetCurrent, METH_NOARGS,
- M_World_GetCurrent_doc},
- {"GetCurrent", ( PyCFunction ) M_World_GetCurrent, METH_NOARGS,
- M_World_GetCurrent_doc},
- {"get", M_World_Get, METH_VARARGS, M_World_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-
-
-/*****************************************************************************/
-/* Python BPy_World methods table: */
-/*****************************************************************************/
-static PyMethodDef BPy_World_methods[] = {
- {"getRange", ( PyCFunction ) World_getRange, METH_NOARGS,
- "() - Return World Range"},
- {"setRange", ( PyCFunction ) World_setRange, METH_VARARGS,
- "() - Change this World's range"},
- {"getIpo", ( PyCFunction ) World_getIpo, METH_NOARGS,
- "() - Return World Ipo"},
- {"setIpo", ( PyCFunction ) World_oldsetIpo, METH_VARARGS,
- "() - Change this World's ipo"},
- {"clearIpo", ( PyCFunction ) World_clearIpo, METH_VARARGS,
- "() - Unlink Ipo from this World"},
- {"getName", ( PyCFunction ) GenericLib_getName, METH_NOARGS,
- "() - Return World Data name"},
- {"setName", ( PyCFunction ) GenericLib_setName_with_method, METH_VARARGS,
- "() - Set World Data name"},
- {"getMode", ( PyCFunction ) World_getMode, METH_NOARGS,
- "() - Return World Data mode"},
- {"setMode", ( PyCFunction ) World_oldsetMode, METH_VARARGS,
- "(i) - Set World Data mode"},
- {"getSkytype", ( PyCFunction ) World_getSkytype, METH_NOARGS,
- "() - Return World Data skytype"},
- {"setSkytype", ( PyCFunction ) World_oldsetSkytype, METH_VARARGS,
- "() - Return World Data skytype"},
- {"getMistype", ( PyCFunction ) World_getMistype, METH_NOARGS,
- "() - Return World Data mistype"},
- {"setMistype", ( PyCFunction ) World_oldsetMistype, METH_VARARGS,
- "() - Return World Data mistype"},
- {"getHor", ( PyCFunction ) World_getHor, METH_NOARGS,
- "() - Return World Data hor"},
- {"setHor", ( PyCFunction ) World_oldsetHor, METH_VARARGS,
- "() - Return World Data hor"},
- {"getZen", ( PyCFunction ) World_getZen, METH_NOARGS,
- "() - Return World Data zen"},
- {"setZen", ( PyCFunction ) World_oldsetZen, METH_VARARGS,
- "() - Return World Data zen"},
- {"getAmb", ( PyCFunction ) World_getAmb, METH_NOARGS,
- "() - Return World Data amb"},
- {"setAmb", ( PyCFunction ) World_oldsetAmb, METH_VARARGS,
- "() - Return World Data amb"},
- {"getStar", ( PyCFunction ) World_getStar, METH_NOARGS,
- "() - Return World Data star"},
- {"setStar", ( PyCFunction ) World_oldsetStar, METH_VARARGS,
- "() - Return World Data star"},
- {"getMist", ( PyCFunction ) World_getMist, METH_NOARGS,
- "() - Return World Data mist"},
- {"setMist", ( PyCFunction ) World_oldsetMist, METH_VARARGS,
- "() - Return World Data mist"},
- {"getScriptLinks", ( PyCFunction ) World_getScriptLinks, METH_O,
- "(eventname) - Get a list of this world's scriptlinks (Text names) "
- "of the given type\n"
- "(eventname) - string: FrameChanged, Redraw or Render."},
- {"addScriptLink", ( PyCFunction ) World_addScriptLink, METH_VARARGS,
- "(text, evt) - Add a new world scriptlink.\n"
- "(text) - string: an existing Blender Text name;\n"
- "(evt) string: FrameChanged, Redraw or Render."},
- {"clearScriptLinks", ( PyCFunction ) World_clearScriptLinks,
- METH_VARARGS,
- "() - Delete all scriptlinks from this world.\n"
- "([s1<,s2,s3...>]) - Delete specified scriptlinks from this world."},
- {"setCurrent", ( PyCFunction ) World_setCurrent, METH_NOARGS,
- "() - Makes this world the active world for the current scene."},
- {"makeActive", ( PyCFunction ) World_setCurrent, METH_NOARGS,
- "please use setCurrent instead, this alias will be removed."},
- {"insertIpoKey", ( PyCFunction ) World_insertIpoKey, METH_VARARGS,
- "( World IPO type ) - Inserts a key into the IPO"},
- {"__copy__", ( PyCFunction ) World_copy, METH_NOARGS,
- "() - Makes a copy of this world."},
- {"copy", ( PyCFunction ) World_copy, METH_NOARGS,
- "() - Makes a copy of this world."},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_World_getseters[] = {
- GENERIC_LIB_GETSETATTR,
- {"skytype", (getter)World_getSkytype, (setter)World_setSkytype,
- "sky settings as a list", NULL},
- {"mode", (getter)World_getMode, (setter)World_setMode,
- "world mode", NULL},
- {"mistype", (getter)World_getMistype, (setter)World_setMistype,
- "world mist type", NULL},
- {"hor", (getter)World_getHor, (setter)World_setHor,
- "world horizon color", NULL},
- {"amb", (getter)World_getAmb, (setter)World_setAmb,
- "world ambient color", NULL},
- {"mist", (getter)World_getMist, (setter)World_setMist,
- "world mist settings", NULL},
- {"ipo", (getter)World_getIpo, (setter)World_setIpo,
- "world ipo", NULL},
- {"textures", (getter)World_getTextures, (setter)World_setTextures,
- "The World's texture list as a tuple",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python World_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject World_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "World", /* tp_name */
- sizeof( BPy_World ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- NULL, /* tp_dealloc */
- 0, /* tp_print */
- NULL, /* tp_getattr */
- NULL, /* tp_setattr */
- ( cmpfunc ) World_Compare, /* tp_compare */
- ( reprfunc ) World_Repr, /* tp_repr */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- ( hashfunc ) GenericLib_hash, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_World_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_World_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/**
- * \defgroup World_Module Blender.World module functions
- *
- */
-
-/*@{*/
-
-/**
- * \brief Python module function: Blender.World.New()
- *
- * This is the .New() function of the Blender.World submodule. It creates
- * new World Data in Blender and returns its Python wrapper object. The
- * name parameter is mandatory.
- * \param <name> - string: The World Data name.
- * \return A new World PyObject.
- */
-
-static PyObject *M_World_New( PyObject * self, PyObject * args,
- PyObject * kwords )
-{
- char *name = NULL;
- BPy_World *pyworld;
- World *blworld;
-
- if( !PyArg_ParseTuple( args, "s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" ) );
-
-
- blworld = add_world( name );
-
- if( blworld ) {
- /* return user count to zero because add_world() inc'd it */
- blworld->id.us = 0;
- /* create python wrapper obj */
- pyworld =
- ( BPy_World * ) PyObject_NEW( BPy_World, &World_Type );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create World Data in Blender" ) );
-
- if( pyworld == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create World Data object" ) );
-
- pyworld->world = blworld;
-
- return ( PyObject * ) pyworld;
-}
-
-/**
- * \brief Python module function: Blender.World.Get()
- *
- * This is the .Get() function of the Blender.World submodule. It searches
- * the list of current World Data objects and returns a Python wrapper for
- * the one with the name provided by the user. If called with no arguments,
- * it returns a list of all current World Data object names in Blender.
- * \param <name> - string: The name of an existing Blender World Data object.
- * \return () - A list with the names of all current World Data objects;\n
- * \return (name) - A Python wrapper for the World Data called 'name'
- * in Blender.
- */
-
-static PyObject *M_World_Get( PyObject * self, PyObject * args )
-{
-
- char *name = NULL;
- World *world_iter;
- PyObject *worldlist;
- char error_msg[64];
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return ( EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" ) );
-
- if( name ) { /* (name) - Search world by name */
- world_iter = ( World * ) GetIdFromList( &( G.main->world ), name );
-
- if( world_iter == NULL ) { /* Requested world doesn't exist */
- PyOS_snprintf( error_msg, sizeof( error_msg ),
- "World \"%s\" not found", name );
- return ( EXPP_ReturnPyObjError
- ( PyExc_NameError, error_msg ) );
- }
-
- return ( PyObject * ) World_CreatePyObject(world_iter);
- }
-
- else { /* return a list of all worlds in the scene */
- world_iter = G.main->world.first;
- worldlist = PyList_New( 0 );
- if( worldlist == NULL )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" ) );
-
- while( world_iter ) {
- BPy_World *found_world =
- ( BPy_World * ) PyObject_NEW( BPy_World,
- &World_Type );
- found_world->world = world_iter;
- PyList_Append( worldlist, ( PyObject * ) found_world );
- Py_DECREF(found_world);
-
- world_iter = world_iter->id.next;
- }
- return ( worldlist );
- }
-
-}
-
-static PyObject *M_World_GetCurrent( PyObject * self )
-{
- BPy_World *w = NULL;
-#if 0 /* add back in when bpy becomes "official" */
- static char warning = 1;
- if( warning ) {
- printf("Blender.World.GetCurrent() deprecated!\n\tuse bpy.scenes.world instead\n");
- --warning;
- }
-#endif
-
- if( !G.scene->world )
- Py_RETURN_NONE;
-
- w = ( BPy_World * ) PyObject_NEW( BPy_World, &World_Type );
- w->world = G.scene->world;
- return ( PyObject * ) w;
-}
-
-/*@}*/
-
-/**
- * \brief Initializes the Blender.World submodule
- *
- * This function is used by Blender_Init() in Blender.c to register the
- * Blender.World submodule in the main Blender module.
- * \return PyObject*: The initialized submodule.
- */
-
-PyObject *World_Init( void )
-{
- PyObject *submodule;
-
- if( PyType_Ready( &World_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.World",
- M_World_methods, M_World_doc );
-
- PyModule_AddIntConstant( submodule, "ZENITH", IPOKEY_ZENITH );
- PyModule_AddIntConstant( submodule, "HORIZON", IPOKEY_HORIZON );
- PyModule_AddIntConstant( submodule, "MIST", IPOKEY_MIST );
- PyModule_AddIntConstant( submodule, "STARS", IPOKEY_STARS );
- PyModule_AddIntConstant( submodule, "OFFSET", IPOKEY_OFFSET );
- PyModule_AddIntConstant( submodule, "SIZE", IPOKEY_SIZE );
-
- return ( submodule );
-}
-
-/*****************************************************************************/
-/* Python BPy_World methods: */
-/*****************************************************************************/
-static PyObject *World_getRange( BPy_World * self )
-{
- return PyFloat_FromDouble( self->world->range );
-}
-
-static PyObject *World_setRange( BPy_World * self, PyObject * args )
-{
- float range = 0.f;
- if( !PyArg_ParseTuple( args, "f", &range ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError, "expected a float argument" ) );
- self->world->range = range;
- Py_RETURN_NONE;
-}
-
-
-static PyObject *World_getIpo( BPy_World * self )
-{
- struct Ipo *ipo = self->world->ipo;
-
- if( !ipo )
- Py_RETURN_NONE;
-
- return Ipo_CreatePyObject( ipo );
-}
-
-static int World_setIpo( BPy_World * self, PyObject * value )
-{
- return GenericLib_assignData(value, (void **) &self->world->ipo, 0, 1, ID_IP, ID_WO);
-}
-
-static PyObject *World_oldsetIpo( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setIpo );
-}
-
-static PyObject *World_clearIpo( BPy_World * self )
-{
- World *world = self->world;
- Ipo *ipo = ( Ipo * ) world->ipo;
-
- if( ipo ) {
- ID *id = &ipo->id;
- if( id->us > 0 )
- id->us--;
- world->ipo = NULL;
-
- return EXPP_incr_ret_True();
- }
-
- return EXPP_incr_ret_False(); /* no ipo found */
-}
-
-/**
- * \brief World PyMethod getSkytype
- *
- * \return int : The World Data skytype.
- */
-
-static PyObject *World_getSkytype( BPy_World * self )
-{
- return PyInt_FromLong( ( long ) self->world->skytype );
-}
-
-
-/**
- * \brief World PyMethod setSkytype
- *
- * \return int : The World Data skytype.
- */
-
-static int World_setSkytype( BPy_World * self, PyObject * value )
-{
- if( !PyInt_Check(value) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" ) );
- self->world->skytype = (short)PyInt_AsLong(value);
- return 0;
-}
-
-static PyObject *World_oldsetSkytype( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setSkytype );
-}
-
-
-/**
- * \brief World PyMethod getMode
- *
- * \return int : The World Data mode.
- */
-
-static PyObject *World_getMode( BPy_World * self )
-{
- return PyInt_FromLong( ( long ) self->world->mode );
-}
-
-
-/**
- * \brief World PyMethod setMode
- *
- * \return int : The World Data mode.
- */
-
-static int World_setMode( BPy_World * self, PyObject * value )
-{
- if( !PyInt_Check(value) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" ) );
- self->world->mode = (short)PyInt_AsLong(value);
- return 0;
-}
-
-static PyObject *World_oldsetMode( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setMode );
-}
-
-
-
-/**
- * \brief World PyMethod getMistype
- *
- * \return int : The World Data mistype.
- */
-
-static PyObject *World_getMistype( BPy_World * self )
-{
- return PyInt_FromLong( ( long ) self->world->mistype );
-}
-
-
-/**
- * \brief World PyMethod setMistype
- *
- * \return int : The World Data mistype.
- */
-
-static int World_setMistype( BPy_World * self, PyObject * value )
-{
- if( !PyInt_Check(value) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" ) );
- self->world->mistype = (short)PyInt_AsLong(value);
- return 0;
-}
-
-static PyObject *World_oldsetMistype( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setMistype );
-}
-
-
-
-static PyObject *World_getHor( BPy_World * self )
-{
- PyObject *attr = PyList_New( 3 );
- if( !attr )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create list" ) );
- PyList_SET_ITEM( attr, 0, PyFloat_FromDouble( self->world->horr ) );
- PyList_SET_ITEM( attr, 1, PyFloat_FromDouble( self->world->horg ) );
- PyList_SET_ITEM( attr, 2, PyFloat_FromDouble( self->world->horb ) );
- return attr;
-}
-
-
-static int World_setHor( BPy_World * self, PyObject * value )
-{
- if( !PyList_Check( value ) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected list argument" ) );
- if( PyList_Size( value ) != 3 )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "list size must be 3" ) );
- self->world->horr = (float)PyFloat_AsDouble( PyList_GetItem( value, 0 ) );
- self->world->horg = (float)PyFloat_AsDouble( PyList_GetItem( value, 1 ) );
- self->world->horb = (float)PyFloat_AsDouble( PyList_GetItem( value, 2 ) );
- return 0;
-}
-
-static PyObject *World_oldsetHor( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setHor );
-}
-
-static PyObject *World_getZen( BPy_World * self )
-{
- PyObject *attr = PyList_New( 3 );
- if( !attr )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create list" ) );
- PyList_SET_ITEM( attr, 0, PyFloat_FromDouble( self->world->zenr ) );
- PyList_SET_ITEM( attr, 1, PyFloat_FromDouble( self->world->zeng ) );
- PyList_SET_ITEM( attr, 2, PyFloat_FromDouble( self->world->zenb ) );
- return attr;
-}
-
-
-static int World_setZen( BPy_World * self, PyObject * value )
-{
- if( !PyList_Check( value ) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected list argument" ) );
- if( PyList_Size( value ) != 3 )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "list size must be 3" ) );
- self->world->zenr = (float)PyFloat_AsDouble( PyList_GetItem( value, 0 ) );
- self->world->zeng = (float)PyFloat_AsDouble( PyList_GetItem( value, 1 ) );
- self->world->zenb = (float)PyFloat_AsDouble( PyList_GetItem( value, 2 ) );
- return 0;
-}
-
-static PyObject *World_oldsetZen( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setZen );
-}
-
-
-static PyObject *World_getAmb( BPy_World * self )
-{
- PyObject *attr = PyList_New( 3 );
- if( !attr )
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create list" ) );
- PyList_SET_ITEM( attr, 0, PyFloat_FromDouble( self->world->ambr ) );
- PyList_SET_ITEM( attr, 1, PyFloat_FromDouble( self->world->ambg ) );
- PyList_SET_ITEM( attr, 2, PyFloat_FromDouble( self->world->ambb ) );
- return attr;
-}
-
-
-static int World_setAmb( BPy_World * self, PyObject * value )
-{
- if( !PyList_Check( value ) )
- return ( EXPP_ReturnIntError( PyExc_TypeError,
- "expected list argument" ) );
- if( PyList_Size( value ) != 3 )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "wrong list size" ) );
- self->world->ambr = (float)PyFloat_AsDouble( PyList_GetItem( value, 0 ) );
- self->world->ambg = (float)PyFloat_AsDouble( PyList_GetItem( value, 1 ) );
- self->world->ambb = (float)PyFloat_AsDouble( PyList_GetItem( value, 2 ) );
- return 0;
-}
-
-static PyObject *World_oldsetAmb( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setAmb );
-}
-
-static PyObject *World_getStar( BPy_World * self )
-{
- PyObject *attr = PyList_New( 7 );
- if( !attr )
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError, "couldn't create list" ) );
- PyList_SET_ITEM( attr, 0, PyFloat_FromDouble( self->world->starr ) );
- PyList_SET_ITEM( attr, 1, PyFloat_FromDouble( self->world->starg ) );
- PyList_SET_ITEM( attr, 2, PyFloat_FromDouble( self->world->starb ) );
- PyList_SET_ITEM( attr, 3, PyFloat_FromDouble( self->world->starsize ) );
- PyList_SET_ITEM( attr, 4, PyFloat_FromDouble( self->world->starmindist ) );
- PyList_SET_ITEM( attr, 5, PyFloat_FromDouble( self->world->stardist ) );
- PyList_SET_ITEM( attr, 6, PyFloat_FromDouble( self->world->starcolnoise ) );
- return attr;
-}
-
-
-static int World_setStar( BPy_World * self, PyObject * value )
-{
- if( !PyList_Check( value ) )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "expected list argument" ) );
- if( PyList_Size( value ) != 7 )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "wrong list size" ) );
- self->world->starr = (float)PyFloat_AsDouble( PyList_GetItem( value, 0 ) );
- self->world->starg = (float)PyFloat_AsDouble( PyList_GetItem( value, 1 ) );
- self->world->starb = (float)PyFloat_AsDouble( PyList_GetItem( value, 2 ) );
- self->world->starsize =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 3 ) );
- self->world->starmindist =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 4 ) );
- self->world->stardist =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 5 ) );
- self->world->starcolnoise =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 6 ) );
- return 0;
-}
-
-static PyObject *World_oldsetStar( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setStar );
-}
-
-
-static PyObject *World_getMist( BPy_World * self )
-{
- PyObject *attr = PyList_New( 4 );
- if( !attr )
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError, "couldn't create list" ) );
- PyList_SET_ITEM( attr, 0, PyFloat_FromDouble( self->world->misi ) );
- PyList_SET_ITEM( attr, 1, PyFloat_FromDouble( self->world->miststa ) );
- PyList_SET_ITEM( attr, 2, PyFloat_FromDouble( self->world->mistdist ) );
- PyList_SET_ITEM( attr, 3, PyFloat_FromDouble( self->world->misthi ) );
- return attr;
-}
-
-static int World_setMist( BPy_World * self, PyObject * value )
-{
- if( !PyList_Check( value ) )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "expected list argument" ) );
- if( PyList_Size( value ) != 4 )
- return ( EXPP_ReturnIntError
- ( PyExc_TypeError, "wrong list size" ) );
- self->world->misi = (float)PyFloat_AsDouble( PyList_GetItem( value, 0 ) );
- self->world->miststa =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 1 ) );
- self->world->mistdist =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 2 ) );
- self->world->misthi =
- (float)PyFloat_AsDouble( PyList_GetItem( value, 3 ) );
- return 0;
-}
-
-static PyObject *World_oldsetMist( BPy_World * self, PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)World_setMist );
-}
-
-
-/* world.addScriptLink */
-static PyObject *World_addScriptLink( BPy_World * self, PyObject * args )
-{
- World *world = self->world;
- ScriptLink *slink = NULL;
-
- slink = &( world )->scriptlink;
-
- return EXPP_addScriptLink( slink, args, 0 );
-}
-
-/* world.clearScriptLinks */
-static PyObject *World_clearScriptLinks( BPy_World * self, PyObject * args )
-{
- World *world = self->world;
- ScriptLink *slink = NULL;
-
- slink = &( world )->scriptlink;
-
- return EXPP_clearScriptLinks( slink, args );
-}
-
-/* world.getScriptLinks */
-static PyObject *World_getScriptLinks( BPy_World * self, PyObject * value )
-{
- World *world = self->world;
- ScriptLink *slink = NULL;
- PyObject *ret = NULL;
-
- slink = &( world )->scriptlink;
-
- ret = EXPP_getScriptLinks( slink, value, 0 );
-
- if( ret )
- return ret;
- else
- return NULL;
-}
-
-
-/* world.setCurrent */
-static PyObject *World_setCurrent( BPy_World * self )
-{
- World *world = self->world;
-#if 0 /* add back in when bpy becomes "official" */
- static char warning = 1;
- if( warning ) {
- printf("world.setCurrent() deprecated!\n\tuse bpy.scenes.world=world instead\n");
- --warning;
- }
-#endif
-
- /* If there is a world then it now has one less user */
- if( G.scene->world )
- G.scene->world->id.us--;
- world->id.us++;
- G.scene->world = world;
- Py_RETURN_NONE;
-}
-
-/* world.__copy__ */
-static PyObject *World_copy( BPy_World * self )
-{
- World *world = copy_world(self->world );
- world->id.us = 0;
- return World_CreatePyObject(world);
-}
-
-/**
- * \brief The World PyType compare function
- *
- * This function compares two given World PyObjects, returning 0 for equality
- * and -1 otherwise. In Python it becomes 1 if they are equal and 0 case not.
- * The comparison is done with their pointers to Blender World Data objects,
- * so any two wrappers pointing to the same Blender World Data will be
- * considered the same World PyObject. Currently, only the "==" and "!="
- * comparisons are meaninful -- the "<", "<=", ">" or ">=" are not.
- */
-
-static int World_Compare( BPy_World * a, BPy_World * b )
-{
- return ( a->world == b->world ) ? 0 : -1;
-}
-
-/**
- * \brief The World PyType print callback
- *
- * This function is called when the user tries to print a PyObject of type
- * World. It builds a string with the name of the wrapped Blender World.
- */
-
-/*
-static int World_Print(BPy_World *self, FILE *fp, int flags)
-{
- fprintf(fp, "[World \"%s\"]", self->world->id.name+2);
- return 0;
-}
-*/
-
-/**
- * \brief The World PyType repr callback
- *
- * This function is called when the statement "repr(myworld)" is executed in
- * Python. Repr gives a string representation of a PyObject.
- */
-
-static PyObject *World_Repr( BPy_World * self )
-{
- return PyString_FromFormat( "[World \"%s\"]",
- self->world->id.name + 2 );
-}
-
-/*@}*/
-/*
-static int World_compare (BPy_World *a, BPy_World *b)
-{
- World *pa = a->world, *pb = b->world;
- return (pa == pb) ? 0:-1;
-}
-*/
-PyObject *World_CreatePyObject( struct World * world )
-{
- BPy_World *blen_object;
-
- blen_object = ( BPy_World * ) PyObject_NEW( BPy_World, &World_Type );
-
- if( blen_object == NULL ) {
- return ( NULL );
- }
- blen_object->world = world;
- return ( ( PyObject * ) blen_object );
-}
-
-World *World_FromPyObject( PyObject * py_obj )
-{
- BPy_World *blen_obj;
-
- blen_obj = ( BPy_World * ) py_obj;
- return ( blen_obj->world );
-
-}
-
-/*
- * World_insertIpoKey()
- * inserts World IPO key for ZENITH,HORIZON,MIST,STARS,OFFSET,SIZE
- */
-
-static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args )
-{
- int key = 0, flag = 0, map;
-
- if( !PyArg_ParseTuple( args, "i", &( key ) ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument" ) );
-
- map = texchannel_to_adrcode(self->world->texact);
-
- /* flag should be initialised with the 'autokeying' flags like for normal keying */
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
-
- if(key == IPOKEY_ZENITH) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_R, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_G, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_B, flag);
- }
- if(key == IPOKEY_HORIZON) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_R, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_G, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_B, flag);
- }
- if(key == IPOKEY_MIST) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISI, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTDI, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTSTA, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTHI, flag);
- }
- if(key == IPOKEY_STARS) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_R, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_G, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_B, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARDIST, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARSIZE, flag);
- }
- if(key == IPOKEY_OFFSET) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_X, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Y, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Z, flag);
- }
- if(key == IPOKEY_SIZE) {
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_X, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Y, flag);
- insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Z, flag);
- }
-
- allspace(REMAKEIPO, 0);
- EXPP_allqueue(REDRAWIPO, 0);
- EXPP_allqueue(REDRAWVIEW3D, 0);
- EXPP_allqueue(REDRAWACTION, 0);
- EXPP_allqueue(REDRAWNLA, 0);
-
- Py_RETURN_NONE;
-}
-
-static PyObject *World_getTextures( BPy_World * self )
-{
- int i;
- PyObject *tuple;
-
- /* build a texture list */
- tuple = PyTuple_New( MAX_MTEX );
- if( !tuple )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyTuple" );
-
- for( i = 0; i < MAX_MTEX; ++i ) {
- struct MTex *mtex = self->world->mtex[i];
- if( mtex ) {
- PyTuple_SET_ITEM( tuple, i, MTex_CreatePyObject( mtex, ID_WO ) );
- } else {
- Py_INCREF( Py_None );
- PyTuple_SET_ITEM( tuple, i, Py_None );
- }
- }
-
- return tuple;
-}
-
-static int World_setTextures( BPy_World * self, PyObject * value )
-{
- int i;
-
- if( !PyList_Check( value ) && !PyTuple_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list of integers" );
-
- /* don't allow more than MAX_MTEX items */
- if( PySequence_Size(value) > MAX_MTEX )
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "size of sequence greater than number of allowed textures" );
-
- /* get a fast sequence; in Python 2.5, this just return the original
- * list or tuple and INCREFs it, so we must DECREF */
- value = PySequence_Fast( value, "" );
-
- /* check the list for valid entries */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- if( item == Py_None || ( BPy_MTex_Check( item ) &&
- ((BPy_MTex *)item)->type == ID_WO ) ) {
- continue;
- } else {
- Py_DECREF(value);
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected tuple or list containing world MTex objects and NONE" );
- }
- }
-
- /* for each MTex object, copy to this structure */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->world->mtex[i];
- if( item != Py_None ) {
- BPy_MTex *obj = (BPy_MTex *)item;
-
- /* if MTex is already at this location, just skip it */
- if( obj->mtex == mtex ) continue;
-
- /* create a new entry if needed, otherwise update reference count
- * for texture that is being replaced */
- if( !mtex )
- mtex = self->world->mtex[i] = add_mtex( );
- else
- mtex->tex->id.us--;
-
- /* copy the data */
- mtex->tex = obj->mtex->tex;
- id_us_plus( &mtex->tex->id );
- mtex->texco = obj->mtex->texco;
- mtex->mapto = obj->mtex->mapto;
- }
- }
-
- /* now go back and free any entries now marked as None */
- for( i= 0; i < PySequence_Size(value) ; ++i ) {
- PyObject *item = PySequence_Fast_GET_ITEM( value, i );
- struct MTex *mtex = self->world->mtex[i];
- if( item == Py_None && mtex ) {
- mtex->tex->id.us--;
- MEM_freeN( mtex );
- self->world->mtex[i] = NULL;
- }
- }
-
- Py_DECREF(value);
- return 0;
-}
diff --git a/source/blender/python/api2_2x/World.h b/source/blender/python/api2_2x/World.h
deleted file mode 100644
index 2ca51611a0f..00000000000
--- a/source/blender/python/api2_2x/World.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Jacques Guignot
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_WORLD_H
-#define EXPP_WORLD_H
-
-#include <Python.h>
-#include "DNA_world_types.h"
-
-#define BPy_World_Check(v) ((v)->ob_type==&World_Type)
-
-/* Python BPy_World structure definition */
-typedef struct {
- PyObject_HEAD /* required py macro */
- World * world; /* Libdata must be second */
-} BPy_World;
-
-extern PyTypeObject World_Type;
-
-/*****************************************************************************/
-/* Python World_Type helper functions needed by Blender (the Init function) */
-/* and Object modules. */
-/*****************************************************************************/
-
-PyObject *World_Init( void );
-PyObject *World_CreatePyObject( World * world );
-World *World_FromPyObject( PyObject * pyobj );
-
-#endif /* EXPP_WORLD_H */
diff --git a/source/blender/python/api2_2x/bpy.c b/source/blender/python/api2_2x/bpy.c
deleted file mode 100644
index 96f88a80cbd..00000000000
--- a/source/blender/python/api2_2x/bpy.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Joseph Gilbert,
- * Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* for open, close in Blender_Load */
-
-#include "BLI_blenlib.h"
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_scene.h"
-#include "BKE_main.h"
-
-#include "DNA_scene_types.h"
-
-#include "Types.h"
-#include "Library.h"
-
-#include "bpy.h"
-#include "bpy_data.h"
-#include "bpy_config.h"
-
-/*****************************************************************************/
-/* Global variables */
-/*****************************************************************************/
-PyObject *g_bpydict;
-
-/*****************************************************************************/
-/* Function: initBlender */
-/*****************************************************************************/
-
-void m_bpy_init(void)
-{
- PyObject *module;
- PyObject *dict;
-
- /* G.scene should only aver be NULL if blender is executed in
- background mode, not loading a blend file and executing a python script eg.
- blender -P somescript.py -b
- The if below solves the segfaults that happen when python runs and
- G.scene is NULL */
- if(G.background && G.main->scene.first==NULL) {
- Scene *sce= add_scene("1");
- /*set_scene(sce);*/ /* causes a crash */
- G.scene= sce;
- }
-
- module = Py_InitModule3("bpy", NULL, "The main bpy module");
-
- types_InitAll(); /* set all our pytypes to &PyType_Type */
-
- dict = PyModule_GetDict(module);
- g_bpydict = dict;
-
- PyModule_AddObject( module, "config", Config_CreatePyObject() );
- PyDict_SetItemString( dict, "data", Data_Init());
- PyDict_SetItemString( dict, "libraries", Library_Init( ) );
-
-}
diff --git a/source/blender/python/api2_2x/bpy.h b/source/blender/python/api2_2x/bpy.h
deleted file mode 100644
index 463537e1a0e..00000000000
--- a/source/blender/python/api2_2x/bpy.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BPYMOD_H
-#define EXPP_BPYMOD_H
-
-#include <Python.h>
-
-extern PyObject *g_bpydict;
-void m_bpy_init( void );
-
-#endif /* EXPP_BPYMOD_H */
diff --git a/source/blender/python/api2_2x/bpy_config.c b/source/blender/python/api2_2x/bpy_config.c
deleted file mode 100644
index 0e6f9741751..00000000000
--- a/source/blender/python/api2_2x/bpy_config.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-/* python types */
-#include "DNA_userdef_types.h"
-#include "../api2_2x/gen_utils.h"
-#include "bpy_config.h"
-#include "BKE_utildefines.h"
-
-enum conf_consts {
- /*string*/
- EXPP_CONF_ATTR_PATH_YF_EXPORT = 0,
- EXPP_CONF_ATTR_PATH_FONT,
- EXPP_CONF_ATTR_PATH_RENDER,
- EXPP_CONF_ATTR_PATH_TEXTURE,
- EXPP_CONF_ATTR_PATH_PYTHON,
- EXPP_CONF_ATTR_PATH_TEX_PLUGIN,
- EXPP_CONF_ATTR_PATH_SOUND,
- EXPP_CONF_ATTR_PATH_SEQ_PLUGIN,
- EXPP_CONF_ATTR_PATH_TEMP,
-
- /*int*/
- EXPP_CONF_ATTR_UNDOSTEPS,
- EXPP_CONF_ATTR_TEX_TIMEOUT,
- EXPP_CONF_ATTR_TEX_COLLECT_RATE,
- EXPP_CONF_ATTR_MEM_CACHE_LIMIT,
- EXPP_CONF_ATTR_FONT_SIZE
-};
-
-PyObject *Config_CreatePyObject( )
-{
- BPy_Config *conf = PyObject_NEW( BPy_Config, &Config_Type);
- return (PyObject *)conf;
-}
-
-/*
- * repr function
- * callback functions building meaninful string to representations
- */
-static PyObject *Config_repr( BPy_Config * self )
-{
- return PyString_FromFormat( "[Blender Configuration Data]");
-}
-
-
-/*-----------------------Config module Init())-----------------------------*/
-/* see Main.c */
-/*
-static struct PyMethodDef BPy_Config_methods[] = {
- {"new", (PyCFunction)MainSeq_new, METH_VARARGS,
- "(name) - Create a new object in this scene from the obdata given and return a new object"},
- {"load", (PyCFunction)MainSeq_load, METH_VARARGS,
- "(filename) - loads the given filename for image, font and sound types"},
- {"unlink", (PyCFunction)MainSeq_unlink, METH_VARARGS,
- "unlinks the object from the scene"},
- {NULL, NULL, 0, NULL}
-};*/
-
-/*
- * get integer attributes
- */
-static PyObject *getStrAttr( BPy_Config *self, void *type )
-{
- char *param = NULL;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CONF_ATTR_PATH_YF_EXPORT:
- param = U.yfexportdir;
- break;
- case EXPP_CONF_ATTR_PATH_FONT:
- param = U.fontdir;
- break;
- case EXPP_CONF_ATTR_PATH_RENDER:
- param = U.renderdir;
- break;
- case EXPP_CONF_ATTR_PATH_TEXTURE:
- param = U.textudir;
- break;
- case EXPP_CONF_ATTR_PATH_PYTHON:
- param = U.pythondir;
- break;
- case EXPP_CONF_ATTR_PATH_TEX_PLUGIN:
- param = U.plugtexdir;
- break;
- case EXPP_CONF_ATTR_PATH_SOUND:
- param = U.sounddir;
- break;
- case EXPP_CONF_ATTR_PATH_SEQ_PLUGIN:
- param = U.plugseqdir;
- break;
- case EXPP_CONF_ATTR_PATH_TEMP:
- param = U.tempdir;
- break;
-
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getStrAttr" );
- }
-
- return PyString_FromString( param );
-}
-
-/*
- * set integer attributes which require clamping
- */
-
-static int setStrAttr( BPy_Config *self, PyObject *value, void *type )
-{
- char *param;
- int len=160;
- char *str = PyString_AsString(value);
-
- if (!str)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "error, must assign a python string for setStrAttr");
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CONF_ATTR_PATH_YF_EXPORT:
- param = U.yfexportdir;
- break;
- case EXPP_CONF_ATTR_PATH_FONT:
- param = U.fontdir;
- break;
- case EXPP_CONF_ATTR_PATH_RENDER:
- param = U.renderdir;
- break;
- case EXPP_CONF_ATTR_PATH_TEXTURE:
- param = U.textudir;
- break;
- case EXPP_CONF_ATTR_PATH_PYTHON:
- param = U.pythondir;
- break;
- case EXPP_CONF_ATTR_PATH_TEX_PLUGIN:
- param = U.plugtexdir;
- break;
- case EXPP_CONF_ATTR_PATH_SOUND:
- param = U.sounddir;
- break;
- case EXPP_CONF_ATTR_PATH_SEQ_PLUGIN:
- param = U.plugseqdir;
- break;
- case EXPP_CONF_ATTR_PATH_TEMP:
- param = U.tempdir;
- break;
-
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setStrAttr");
- }
-
- strncpy(param, str, len);
- return 0;
-}
-
-
-/*
- * get integer attributes
- */
-
-static PyObject *getIntAttr( BPy_Config *self, void *type )
-{
- int param;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CONF_ATTR_UNDOSTEPS:
- param = (int)U.undosteps;
- break;
- case EXPP_CONF_ATTR_TEX_TIMEOUT:
- param = U.textimeout;
- break;
- case EXPP_CONF_ATTR_TEX_COLLECT_RATE:
- param = U.texcollectrate;
- break;
- case EXPP_CONF_ATTR_MEM_CACHE_LIMIT:
- param = U.memcachelimit;
- break;
- case EXPP_CONF_ATTR_FONT_SIZE:
- param = U.fontsize;
- break;
-
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getIntAttr" );
- }
-
- return PyInt_FromLong( param );
-}
-
-/*
- * set integer attributes which require clamping
- */
-
-static int setIntAttrClamp( BPy_Config *self, PyObject *value, void *type )
-{
- void *param;
- int min, max, size;
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_CONF_ATTR_UNDOSTEPS:
- min = 0;
- max = 64;
- size = 'h';
- param = (void *)&U.undosteps;
- break;
- case EXPP_CONF_ATTR_TEX_TIMEOUT:
- min = 1;
- max = 3600;
- size = 'i';
- param = (void *)&U.textimeout;
- break;
- case EXPP_CONF_ATTR_TEX_COLLECT_RATE:
- min = 1;
- max = 3600;
- size = 'i';
- param = (void *)&U.texcollectrate;
- break;
- case EXPP_CONF_ATTR_MEM_CACHE_LIMIT:
- min = 1;
- max = 1024;
- size = 'i';
- param = (void *)&U.memcachelimit;
- break;
- case EXPP_CONF_ATTR_FONT_SIZE:
- min = 8;
- max = 16;
- size = 'i';
- param = (void *)&U.fontsize;
- break;
-
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setIntAttrClamp");
- }
- return EXPP_setIValueClamped( value, param, min, max, size );
-}
-
-static PyGetSetDef Config_getseters[] = {
-
- /* ints & shorts */
- {"undoSteps",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "undo steps",
- (void *)EXPP_CONF_ATTR_UNDOSTEPS},
- {"textureTimeout",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "time for textures to stay in openGL memory",
- (void *)EXPP_CONF_ATTR_TEX_TIMEOUT},
- {"textureCollectRate",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "intervel for textures to be tagged as used",
- (void *)EXPP_CONF_ATTR_TEX_COLLECT_RATE},
- {"sequenceMemCacheLimit",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "maximum memory for the sequencer to use as cache",
- (void *)EXPP_CONF_ATTR_MEM_CACHE_LIMIT},
- {"fontSize",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "user interface font size",
- (void *)EXPP_CONF_ATTR_FONT_SIZE},
-
- /* Paths */
- {"yfExportDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "yafray export path",
- (void *)EXPP_CONF_ATTR_PATH_YF_EXPORT},
- {"fontDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "default font path",
- (void *)EXPP_CONF_ATTR_PATH_FONT},
- {"renderDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "default render path",
- (void *)EXPP_CONF_ATTR_PATH_RENDER},
- {"textureDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "default texture path",
- (void *)EXPP_CONF_ATTR_PATH_TEXTURE},
- {"userScriptsDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "user scripts path",
- (void *)EXPP_CONF_ATTR_PATH_PYTHON},
- {"texturePluginsDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "default texture plugins path",
- (void *)EXPP_CONF_ATTR_PATH_TEX_PLUGIN},
- {"soundDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "default sound path",
- (void *)EXPP_CONF_ATTR_PATH_SOUND},
- {"sequencePluginsDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "sequencer plugins path",
- (void *)EXPP_CONF_ATTR_PATH_SEQ_PLUGIN},
- {"tempDir",
- (getter)getStrAttr, (setter)setStrAttr,
- "temporary file path",
- (void *)EXPP_CONF_ATTR_PATH_TEMP},
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-/*
- * Python Config_Type structure definition
- */
-PyTypeObject Config_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Config", /* char *tp_name; */
- sizeof( BPy_Config ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- (reprfunc)Config_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /*BPy_Config_methods*/ /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- Config_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
diff --git a/source/blender/python/api2_2x/bpy_data.c b/source/blender/python/api2_2x/bpy_data.c
deleted file mode 100644
index d3499a79874..00000000000
--- a/source/blender/python/api2_2x/bpy_data.c
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "bpy_data.h"
-
-#include "MEM_guardedalloc.h" /* for MEM_callocN */
-#include "DNA_space_types.h" /* SPACE_VIEW3D, SPACE_SEQ */
-#include "DNA_scene_types.h"
-#include "DNA_object_types.h" /* LibBlockSeq_new */
-#include "DNA_texture_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_group_types.h"
-#include "DNA_world_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_text_types.h"
-#include "DNA_action_types.h"
-#include "DNA_meta_types.h"
-
-/* Use the add_* from BKE_* */
-#include "BKE_global.h"
-#include "BKE_utildefines.h" /* clamp */
-#include "BKE_armature.h"
-#include "BKE_ipo.h"
-#include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-#include "BKE_lattice.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_sca.h" /*free_text_controllers*/
-#include "BKE_font.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_curve.h"
-#include "BKE_material.h"
-#include "BKE_group.h"
-#include "BKE_text.h"
-#include "BKE_texture.h"
-#include "BKE_world.h"
-
-#include "BLI_blenlib.h" /* BLI_countlist */
-#include "BIF_drawscene.h" /* for set_scene */
-#include "BIF_screen.h" /* curarea */
-#include "BIF_drawimage.h" /* what image */
-#include "BIF_drawtext.h" /* unlink_text */
-#include "BIF_editsound.h" /* sound_new_sound */
-#include "BIF_editaction.h" /* add_empty_action */
-
-/* python types */
-#include "../BPY_extern.h" /* clearing scriptlinks */
-
-#include "gen_utils.h"
-#include "gen_library.h" /* generic ID functions */
-
-#include "Object.h"
-#include "Camera.h"
-#include "Armature.h"
-#include "Lamp.h"
-#include "Curve.h"
-#include "NMesh.h"
-#include "Mesh.h"
-#include "Lattice.h"
-#include "Metaball.h"
-#include "Text.h"
-#include "Text3d.h"
-#include "Font.h"
-#include "Group.h"
-#include "World.h"
-#include "Texture.h"
-#include "Ipo.h"
-#include "Text.h"
-#include "Sound.h"
-#include "NLA.h"
-#include "Scene.h"
-#include "Library.h"
-
-#include "bpy_config.h" /* config pydata */
-
-/* used only for texts.active */
-#include "BIF_screen.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-
-extern VFont *get_builtin_font(void);
-
-static PyObject *LibBlockSeq_CreatePyObject( Link *iter, int type )
-{
- BPy_LibBlockSeq *seq = PyObject_NEW( BPy_LibBlockSeq, &LibBlockSeq_Type);
- seq->iter = iter;
- seq->type = type;
- return (PyObject *)seq;
-}
-
-
-static int LibBlockSeq_len( BPy_LibBlockSeq * self )
-{
- ListBase *lb = wich_libbase(G.main, self->type);
- return BLI_countlist( lb );
-}
-
-static PyObject * LibBlockSeq_subscript(BPy_LibBlockSeq * self, PyObject *key)
-{
- char *name;
- char *lib= NULL;
- char use_lib = 0;
- ID *id;
-
- id = (ID *)wich_libbase(G.main, self->type)->first;
-
- if ( PyString_Check(key) ) {
- name = PyString_AsString ( key );
- } else if (PyTuple_Check(key) && (PyTuple_Size(key) == 2) ) {
- PyObject *pydata;
- use_lib = 1;
-
- /* Get the first arg */
- pydata = PyTuple_GET_ITEM(key, 0);
- if (!PyString_Check(pydata)) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "the data name must be a string" );
- }
-
- name = PyString_AsString ( pydata );
-
- /* Get the second arg */
- pydata = PyTuple_GET_ITEM(key, 1);
- if (pydata == Py_None) {
- lib = NULL; /* data must be local */
- } else if (PyString_Check(pydata)) {
- lib = PyString_AsString ( pydata );
- if (!strcmp( "", lib)) {
- lib = NULL; /* and empty string also means data must be local */
- }
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "the lib name must be a string or None" );
- }
- } else {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected the a name string or a tuple (lib, name)" );
- }
-
- for (; id; id = id->next) {
- if(!strcmp( name, id->name+2 )) {
- if (
- (!use_lib) || /* any data, local or external lib data */
- (use_lib && !lib && !id->lib) || /* only local */
- (lib && use_lib && id->lib && (!strcmp( id->lib->name, lib))) /* only external lib */
- )
- {
- return GetPyObjectFromID(id);
- }
- }
- }
- return ( EXPP_ReturnPyObjError
- ( PyExc_KeyError, "Requested data does not exist") );
-}
-
-static PyMappingMethods LibBlockSeq_as_mapping = {
- ( inquiry ) LibBlockSeq_len, /* mp_length */
- ( binaryfunc ) LibBlockSeq_subscript, /* mp_subscript */
- ( objobjargproc ) 0, /* mp_ass_subscript */
-};
-
-
-/************************************************************************
- *
- * Python LibBlockSeq_Type iterator (iterates over GroupObjects)
- *
- ************************************************************************/
-
-/*
- * Initialize the interator index
- */
-
-static PyObject *LibBlockSeq_getIter( BPy_LibBlockSeq * self )
-{
- /* we need to get the first base, but for selected context we may need to advance
- to the first selected or first conext base */
-
- ListBase *lb;
- Link *link;
- lb = wich_libbase(G.main, self->type);
-
- link = lb->first;
-
- /* create a new iterator if were alredy using this one */
- if (self->iter==NULL) {
- self->iter = link;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return LibBlockSeq_CreatePyObject(link, self->type);
- }
-}
-
-/*
- * Return next LibBlockSeq iter.
- */
-
-static PyObject *LibBlockSeq_nextIter( BPy_LibBlockSeq * self )
-{
- PyObject *object;
- Link *link;
- if( !(self->iter) ) {
- self->iter= NULL;
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object = GetPyObjectFromID((ID *)self->iter);
-
- link= self->iter->next;
- self->iter= link;
- return object;
-}
-
-static PyObject *LibBlockSeq_getActive(BPy_LibBlockSeq *self)
-{
- switch (self->type) {
- case ID_SCE:
- if ( !G.scene ) {
- Py_RETURN_NONE;
- } else {
- return Scene_CreatePyObject( ( Scene * ) G.scene );
- }
-
- break;
- case ID_IM:
- if (!G.sima || !G.sima->image) {
- Py_RETURN_NONE;
- } else {
- what_image( G.sima ); /* make sure image data exists */
- return Image_CreatePyObject( G.sima->image );
- }
- break;
- case ID_TXT: {
- SpaceText *st = NULL;
-
- if (curarea)
- st = curarea->spacedata.first;
-
- if (st==NULL || st->spacetype!=SPACE_TEXT || st->text==NULL) {
- Py_RETURN_NONE;
- } else {
- return Text_CreatePyObject( st->text );
- }
- }
- }
-
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Only Scene and Image types have the active attribute" );
-}
-
-static int LibBlockSeq_setActive(BPy_LibBlockSeq *self, PyObject *value)
-{
- switch (self->type) {
- case ID_SCE:
- if (!BPy_Scene_Check(value)) {
- return EXPP_ReturnIntError(PyExc_TypeError,
- "Must be a scene" );
- } else {
- BPy_Scene *bpydata;
- Scene *data;
-
- bpydata = (BPy_Scene *)value;
- data= bpydata->scene;
-
- if (!data)
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "This Scene has been removed" );
-
- if (data != G.scene) {
- set_scene( data );
- scene_update_for_newframe(data, data->lay);
- }
- }
- return 0;
-
- case ID_IM:
- if (!BPy_Image_Check(value)) {
- return EXPP_ReturnIntError(PyExc_TypeError,
- "Must be a scene" );
- } else {
- BPy_Image *bpydata;
- Image *data;
-
- if (!G.sima)
- return 0;
-
- bpydata = (BPy_Image *)value;
- data= bpydata->image;
-
- if (!data)
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "This Scene has been removed" );
-
- if (data != G.sima->image)
- G.sima->image= data;
- }
- return 0;
-
- case ID_TXT:
- if (!BPy_Text_Check(value)) {
- return EXPP_ReturnIntError(PyExc_TypeError,
- "Must be a text" );
- } else {
- SpaceText *st= NULL;
- Text *data = ((BPy_Text *)value)->text;
-
- if (curarea==NULL) {
- return 0;
- } else {
- st= curarea->spacedata.first;
- }
-
- if( !data )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This object isn't linked to a Blender Text Object" );
- if(st->spacetype!=SPACE_TEXT)
- return 0;
- st->text = data;
- }
- return 0;
- }
-
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Only Scene and Image types have the active attribute" );
-}
-
-static int LibBlockSeq_setTag(BPy_LibBlockSeq *self, PyObject *value)
-{
- ID *id;
- int param = PyObject_IsTrue( value );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- id = (ID *)wich_libbase(G.main, self->type)->first;
-
- if (param) {
- for (; id; id = id->next) {
- id->flag |= LIB_DOIT;
- }
- } else {
- for (; id; id = id->next) {
- id->flag &= ~LIB_DOIT;
- }
- }
-
- return 0;
-}
-
-
-/* New Data, internal functions */
-static Mesh *add_mesh__internal(char *name)
-{
- Mesh *mesh = add_mesh(name); /* doesn't return NULL now, but might someday */
-
- /* Bound box set to null needed because a new mesh is initialized
- with a bounding box of -1 -1 -1 -1 -1 -1
- if its not set to null the bounding box is not re-calculated
- when ob.getBoundBox() is called.*/
- MEM_freeN(mesh->bb);
- mesh->bb= NULL;
- return mesh;
-}
-
-/* used for new and load */
-PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
-{
- ID *id = NULL;
- char *name=NULL, *filename=NULL, *data_type=NULL;
- int img_width=256, img_height=256, img_depth=32;
- float color[] = {0, 0, 0, 1};
- short data_code = 0;
- int user_count = 0;
-
- /* Load from file */
- if ( ( self->type==ID_IM || self->type==ID_VF ||
- self->type==ID_SO || self->type==ID_TXT) &&
- ( PyTuple_Size( args ) < 3 ))
- {
- static char *kwlist[] = {"name", "filename", NULL};
-
- if(PyArg_ParseTupleAndKeywords(args, kwd, "|ss", kwlist, &name, &filename) && filename ) {
- PyObject *ret= NULL;
-
- if (strlen(filename) > FILE_MAXDIR + FILE_MAXFILE - 1)
- return ( EXPP_ReturnPyObjError( PyExc_IOError,
- "filename too long" ) );
-
- if (self->type == ID_IM) {
- Image *img = BKE_add_image_file( filename );
- if (!img)
- return ( EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load image" ) );
- ret = Image_CreatePyObject( img );
-
- } else if (self->type == ID_VF) {
- VFont *vf = load_vfont (filename);
- if (!vf)
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load font" );
- ret = Font_CreatePyObject(vf);
-
- } else if (self->type == ID_SO) {
- bSound *snd = sound_new_sound( filename );
- if (!snd)
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load sound" );
- ret = Sound_CreatePyObject(snd);
-
- } else if (self->type == ID_TXT) {
- Text *txt = NULL;
- txt = add_text( filename );
- if( !txt )
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't load text" );
- ret = Text_CreatePyObject(txt);
- }
-
- if (!ret)
- return EXPP_ReturnPyObjError( PyExc_IOError,
- "couldn't create pyobject on load, unknown error" );
- if (name) {
- rename_id( ((BPy_GenericLib *)ret)->id, name );
- }
- return ret;
- }
- }
-
- /* New Data */
- if (self->type == ID_IM) {
- /* Image, accepts width and height, depth */
- if( !PyArg_ParseTuple( args, "|siii", &name, &img_width, &img_height, &img_depth ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "one string and two ints expected as arguments" );
- CLAMP(img_width, 4, 5000);
- CLAMP(img_height, 4, 5000);
-
- } else if (self->type == ID_CU) {
- /* Curve, needs name and type strings */
- if( !PyArg_ParseTuple( args, "ss", &name, &data_type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "two strings expected as arguments" );
-
- if( !strcmp( data_type, "Curve" ) ) data_code = OB_CURVE;
- else if( !strcmp( data_type, "Text3d" ) ) data_code = OB_FONT;/*
- else if( !strcmp( data_type, "Surf" ) ) data_code = OB_SURF;*/
- else return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Second argument for Curve type incorrect\t\nmust be a string in (Curve or Text - Surf is not supported yet)" );
-
- } else if (self->type == ID_IP) {
- /* IPO, needs name and type strings */
- if( !PyArg_ParseTuple( args, "ss", &name, &data_type ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "two strings expected as arguments" );
-
- if( !strcmp( data_type, "Object" ) ) data_code = ID_OB;
- else if( !strcmp( data_type, "Camera" ) ) data_code = ID_CA;
- else if( !strcmp( data_type, "World" ) ) data_code = ID_WO;
- else if( !strcmp( data_type, "Material" ) ) data_code = ID_MA;
- else if( !strcmp( data_type, "Texture" ) ) data_code = ID_TE;
- else if( !strcmp( data_type, "Lamp" ) ) data_code = ID_LA;
- else if( !strcmp( data_type, "Action" ) ) data_code = ID_PO;
- else if( !strcmp( data_type, "Constraint" ) ) data_code = ID_CO;
- else if( !strcmp( data_type, "Sequence" ) ) data_code = ID_SEQ;
- else if( !strcmp( data_type, "Curve" ) ) data_code = ID_CU;
- else if( !strcmp( data_type, "Key" ) ) data_code = ID_KE;
- else return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Second argument for IPO type incorrect\t\nmust be a string in (Object, Camera, World, Material, Texture, Lamp, Action, Sequence, Curve, Key)" );
-
- } else {
- /* Other types only need the name */
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "new(name) - name must be a string argument" );
- }
-
- switch (self->type) {
- case ID_SCE:
- id = (ID *)add_scene( name?name:"Scene" );
- user_count = 1;
- break;
- case ID_OB:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Add objects through the scenes objects iterator" );
- case ID_ME:
- id = (ID *)add_mesh__internal( name?name:"Mesh" );
- break;
- case ID_CU:
- id = (ID *)add_curve( name?name:"Curve", data_code );
- if (data_code==OB_FONT) {
- Text3d *text3d = (Text3d *)id;
- text3d->vfont= get_builtin_font();
- text3d->vfont->id.us++;
- text3d->str= MEM_mallocN(sizeof(wchar_t), "str");
- text3d->str[0] = '\0';
- text3d->totbox= text3d->actbox= 1;
- text3d->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
- text3d->tb[0].w = text3d->tb[0].h = 0.0;
-
- } /*else { CURVE - Dont need to do anything } */
- break;
- case ID_MB:
- id = (ID *)add_mball( name?name:"MBall" );
- break;
- case ID_MA:
- id = (ID *)add_material( name?name:"Material" );
- break;
- case ID_TE:
- id = (ID *)add_texture( name?name:"Texture" );
- break;
- case ID_IM:
- {
- id = (ID *)BKE_add_image_size(img_width, img_height, name?name:"Image", img_depth==128 ? 1:0, 0, color);
- if( !id )
- return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyObject Image_Type" ) );
- /* new images have zero user count */
- break;
- }
- case ID_LT:
- id = (ID *)add_lattice( name?name:"Lattice" );
- break;
- case ID_LA:
- id = (ID *)add_lamp( name?name:"Lamp" );
- break;
- case ID_CA:
- id = (ID *)add_camera( name?name:"Camera" );
- break;
- case ID_IP:
- id = (ID *)add_ipo( name?name:"Ipo", data_code );
- break;
- case ID_WO:
- id = (ID *)add_world( name?name:"World" );
- break;
- case ID_VF:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Cannot create new fonts, use the new(name, filename) function to load from a file" );
- case ID_TXT:
- id = (ID *)add_empty_text( name?name:"Text" );
- user_count = 1;
- break;
- case ID_SO:
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Cannot create new sounds, use the new(name, filename) function to load from a file" );
- case ID_GR:
- id = (ID *)add_group( name?name:"Group" );
- user_count = 1;
- break;
- case ID_AR:
- id = (ID *)add_armature( name?name:"Armature" );
- break;
- case ID_AC:
- id = (ID *)add_empty_action( name?name:"Action" );
- user_count = 1;
- break;
- }
-
- if (!id)
- Py_RETURN_NONE;
-
- /* set some types user count to 1, otherwise zero */
- id->us = user_count;
-
- return GetPyObjectFromID(id);
-}
-
-
-static PyObject *LibBlockSeq_unlink(BPy_LibBlockSeq *self, PyObject * value)
-{
- switch (self->type) {
- case ID_SCE:
- if( !BPy_Scene_Check(value) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Scene object" );
- } else {
- Scene *data = ((BPy_Scene *)value)->scene;
-
- if (!data)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This Scene has been removed" );
-
- /* Run the removal code */
- free_libblock( &G.main->scene, data );
- ((BPy_Scene *)value)->scene = NULL;
- Py_RETURN_NONE;
- }
- case ID_GR:
- if( !BPy_Group_Check(value) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Group object" );
- } else {
- Group *data = ((BPy_Group *)value)->group;
-
- if (!data)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This Group has been removed already" );
-
- /* Run the removal code */
- free_group(data);
- unlink_group(data);
- data->id.us= 0;
- free_libblock( &G.main->group, data );
- ((BPy_Group *)value)->group = NULL;
-
- Py_RETURN_NONE;
- }
-
- case ID_TXT:
- if( !BPy_Text_Check(value) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected Text object" );
- } else {
- Text *data = ((BPy_Text *)value)->text;
-
- if (!data)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This Group has been removed already" );
-
- /* Run the removal code */
- BPY_clear_bad_scriptlinks( data );
- BPY_free_pyconstraint_links( data );
- free_text_controllers( data );
- unlink_text( data );
- free_libblock( &G.main->text, data );
- ((BPy_Text *)value)->text = NULL;
-
- Py_RETURN_NONE;
- }
- }
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Only types Scene, Group and Text can unlink" );
-}
-
-static int LibBlockSeq_compare( BPy_LibBlockSeq * a, BPy_LibBlockSeq * b )
-{
- return ( a->type == b->type) ? 0 : -1;
-}
-
-/*
- * repr function
- * callback functions building meaninful string to representations
- */
-static PyObject *LibBlockSeq_repr( BPy_LibBlockSeq * self )
-{
- return PyString_FromFormat( "[LibBlockSeq Iterator]");
-}
-
-static PyGetSetDef LibBlockSeq_getseters[] = {
- {"active",
- (getter)LibBlockSeq_getActive, (setter)LibBlockSeq_setActive,
- "active object",
- NULL},
- {"tag",
- (getter)NULL, (setter)LibBlockSeq_setTag,
- "tag all data in True or False (write only)",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-static struct PyMethodDef BPy_LibBlockSeq_methods[] = {
- {"new", (PyCFunction)LibBlockSeq_new, METH_VARARGS | METH_KEYWORDS,
- "(name) - Create a new object in this scene from the obdata given and return a new object"},
- {"unlink", (PyCFunction)LibBlockSeq_unlink, METH_O,
- "unlinks the object from the scene"},
- {NULL, NULL, 0, NULL}
-};
-
-/*****************************************************************************/
-/* Python LibBlockSeq_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject LibBlockSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender LibBlockSeq", /* char *tp_name; */
- sizeof( BPy_LibBlockSeq ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) LibBlockSeq_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) LibBlockSeq_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- &LibBlockSeq_as_mapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc) LibBlockSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) LibBlockSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_LibBlockSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- LibBlockSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*-----------------------------BPy module Init())-----------------------------*/
-
-PyObject * Data_Init( void )
-{
- PyObject *module;
-
- PyType_Ready( &LibBlockSeq_Type );
- PyType_Ready( &Config_Type );
-
- /*submodule = Py_InitModule3( "Blender.Main", NULL, M_Main_doc );*/
- module = Py_InitModule3( "bpy.data", NULL, "The bpy.data submodule" );
-
- /* Python Data Types */
- PyModule_AddObject( module, "scenes", LibBlockSeq_CreatePyObject(NULL, ID_SCE) );
- PyModule_AddObject( module, "objects", LibBlockSeq_CreatePyObject(NULL, ID_OB) );
- PyModule_AddObject( module, "meshes", LibBlockSeq_CreatePyObject(NULL, ID_ME) );
- PyModule_AddObject( module, "curves", LibBlockSeq_CreatePyObject(NULL, ID_CU) );
- PyModule_AddObject( module, "metaballs",LibBlockSeq_CreatePyObject(NULL, ID_MB) );
- PyModule_AddObject( module, "materials",LibBlockSeq_CreatePyObject(NULL, ID_MA) );
- PyModule_AddObject( module, "textures", LibBlockSeq_CreatePyObject(NULL, ID_TE) );
- PyModule_AddObject( module, "images", LibBlockSeq_CreatePyObject(NULL, ID_IM) );
- PyModule_AddObject( module, "lattices", LibBlockSeq_CreatePyObject(NULL, ID_LT) );
- PyModule_AddObject( module, "lamps", LibBlockSeq_CreatePyObject(NULL, ID_LA) );
- PyModule_AddObject( module, "cameras", LibBlockSeq_CreatePyObject(NULL, ID_CA) );
- PyModule_AddObject( module, "ipos", LibBlockSeq_CreatePyObject(NULL, ID_IP) );
- PyModule_AddObject( module, "worlds", LibBlockSeq_CreatePyObject(NULL, ID_WO) );
- PyModule_AddObject( module, "fonts", LibBlockSeq_CreatePyObject(NULL, ID_VF) );
- PyModule_AddObject( module, "texts", LibBlockSeq_CreatePyObject(NULL, ID_TXT) );
- PyModule_AddObject( module, "sounds", LibBlockSeq_CreatePyObject(NULL, ID_SO) );
- PyModule_AddObject( module, "groups", LibBlockSeq_CreatePyObject(NULL, ID_GR) );
- PyModule_AddObject( module, "armatures",LibBlockSeq_CreatePyObject(NULL, ID_AR) );
- PyModule_AddObject( module, "actions", LibBlockSeq_CreatePyObject(NULL, ID_AC) );
- return module;
-}
diff --git a/source/blender/python/api2_2x/bpy_data.h b/source/blender/python/api2_2x/bpy_data.h
deleted file mode 100644
index 5fef692a719..00000000000
--- a/source/blender/python/api2_2x/bpy_data.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BPYDATA_H
-#define EXPP_BPYDATA_H
-
-#include <Python.h>
-#include "DNA_listBase.h"
-
-/* The Main PyType Object defined in Main.c */
-extern PyTypeObject LibBlockSeq_Type;
-
-#define BPy_LibBlockSeq_Check(v) \
- ((v)->ob_type == &LibBlockSeq_Type)
-
-/* Main sequence, iterate on the libdatas listbase*/
-typedef struct {
- PyObject_VAR_HEAD /* required python macro */
- Link *iter; /* so we can iterate over the listbase */
-
- short type; /* store the ID type such as ID_ME */
-} BPy_LibBlockSeq;
-
-
-PyObject * Data_Init( void );
-
-#endif /* EXPP_BPYDATA_H */
diff --git a/source/blender/python/api2_2x/bpy_types.h b/source/blender/python/api2_2x/bpy_types.h
deleted file mode 100644
index 4e4d7b87d7c..00000000000
--- a/source/blender/python/api2_2x/bpy_types.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_bpy_types_h
-#define EXPP_bpy_types_h
-
-
-/*****************************************************************************/
-/* Camera Data */
-/*****************************************************************************/
-
-
-/*****************************************************************************/
-/* Lamp Data */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Ipo Data */
-/*****************************************************************************/
-
-
-
-/*****************************************************************************/
-/* Metaball Data */
-/*****************************************************************************/
-
-
-/*****************************************************************************/
-/* Metaelem Data */
-/*****************************************************************************/
-
-
-/*****************************************************************************/
-/* Effect Data */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Wave Data */
-/*****************************************************************************/
-
-
-/*****************************************************************************/
-/* Build Data */
-/*****************************************************************************/
-
-
-/*****************************************************************************/
-/* Particle Data */
-/*****************************************************************************/
-
-/*****************************************************************************/
-/* Curve Data */
-/*****************************************************************************/
-
-/**********
- CurNurb data
-***********/
-
-
-/*****************************************************************************/
-/* World Data */
-/*****************************************************************************/
-
-
-#endif /* EXPP_bpy_types_h */
diff --git a/source/blender/python/api2_2x/charRGBA.c b/source/blender/python/api2_2x/charRGBA.c
deleted file mode 100644
index 7c01c850b4d..00000000000
--- a/source/blender/python/api2_2x/charRGBA.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "charRGBA.h" /*This must come first */
-#include "gen_utils.h"
-
-/* This file is heavily based on the old bpython Constant object code in
- Blender */
-
-/*****************************************************************************/
-/* Python charRGBA_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *charRGBA_repr( BPy_charRGBA * self );
-
-static int charRGBALength( BPy_charRGBA * self );
-
-static PyObject *charRGBASubscript( BPy_charRGBA * self, PyObject * key );
-static int charRGBAAssSubscript( BPy_charRGBA * self, PyObject * who,
- PyObject * cares );
-
-static PyObject *charRGBAItem( BPy_charRGBA * self, int i );
-static int charRGBAAssItem( BPy_charRGBA * self, int i, PyObject * ob );
-static PyObject *charRGBASlice( BPy_charRGBA * self, int begin, int end );
-static int charRGBAAssSlice( BPy_charRGBA * self, int begin, int end,
- PyObject * seq );
-static PyObject *charRGBA_getColor( BPy_charRGBA * self, void * type);
-static int charRGBA_setColor( BPy_charRGBA * self, PyObject * value, void * type);
-
-/*****************************************************************************/
-/* Python charRGBA_Type Mapping Methods table: */
-/*****************************************************************************/
-static PyMappingMethods charRGBAAsMapping = {
- ( inquiry ) charRGBALength, /* mp_length */
- ( binaryfunc ) charRGBASubscript, /* mp_subscript */
- ( objobjargproc ) charRGBAAssSubscript, /* mp_ass_subscript */
-};
-
-/*****************************************************************************/
-/* Python charRGBA_Type Sequence Methods table: */
-/*****************************************************************************/
-static PySequenceMethods charRGBAAsSequence = {
- ( inquiry ) charRGBALength, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) charRGBAItem, /* sq_item */
- ( intintargfunc ) charRGBASlice, /* sq_slice */
- ( intobjargproc ) charRGBAAssItem, /* sq_ass_item */
- ( intintobjargproc ) charRGBAAssSlice, /* sq_ass_slice */
-};
-
-static PyGetSetDef charRGBA_getseters[] = {
- {"R",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the red component",
- (void *) 0},
- {"r",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the red component",
- (void *) 0},
- {"G",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the green component",
- (void *) 1},
- {"g",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the green component",
- (void *) 1},
- {"B",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the blue component",
- (void *) 2},
- {"b",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the blue component",
- (void *) 2},
- {"A",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the alpha component",
- (void *) 3},
- {"a",
- (getter)charRGBA_getColor, (setter)charRGBA_setColor,
- "the alpha component",
- (void *) 3},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python charRGBA_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject charRGBA_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "charRGBA", /* tp_name */
- sizeof( BPy_charRGBA ), /* tp_basicsize */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) charRGBA_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- &charRGBAAsSequence, /* PySequenceMethods *tp_as_sequence; */
- &charRGBAAsMapping, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- charRGBA_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/*****************************************************************************/
-/* Function: charRGBA_New */
-/*****************************************************************************/
-PyObject *charRGBA_New( char *rgba )
-{
- BPy_charRGBA *charRGBA = NULL;
-
- /*
- * When called the first time, charRGBA_Type.tp_dealloc will be NULL.
- * If that's the case, initialize the PyTypeObject. If the
- * initialization succeeds, then create a new object.
- */
-
- if( charRGBA_Type.tp_dealloc || PyType_Ready( &charRGBA_Type ) >= 0 ) {
- charRGBA = ( BPy_charRGBA * ) PyObject_NEW( BPy_charRGBA,
- &charRGBA_Type );
- }
-
- if( charRGBA == NULL )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create charRGBA object" );
-
- /* rgba is a pointer to the first item of a char[4] array */
- charRGBA->rgba[0] = &rgba[0];
- charRGBA->rgba[1] = &rgba[1];
- charRGBA->rgba[2] = &rgba[2];
- charRGBA->rgba[3] = &rgba[3];
-
- return ( PyObject * ) charRGBA;
-}
-
-/*****************************************************************************/
-/* Functions: charRGBA_getCol and charRGBA_setCol */
-/* Description: These functions get/set rgba color triplet values. The */
-/* get function returns a tuple, the set one accepts three */
-/* chars (separated or in a tuple) as arguments. */
-/*****************************************************************************/
-PyObject *charRGBA_getCol( BPy_charRGBA * self )
-{
- PyObject *list = PyList_New( 4 );
-
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- PyList_SET_ITEM( list, 0, PyInt_FromLong( *(self->rgba[0])) );
- PyList_SET_ITEM( list, 1, PyInt_FromLong( *(self->rgba[1])) );
- PyList_SET_ITEM( list, 2, PyInt_FromLong( *(self->rgba[2])) );
- PyList_SET_ITEM( list, 3, PyInt_FromLong( *(self->rgba[3])) );
- return list;
-}
-
-PyObject *charRGBA_setCol( BPy_charRGBA * self, PyObject * args )
-{
- int ok;
- char r = 0, g = 0, b = 0, a = 0;
-
- if( PyObject_Length( args ) == 4 )
- ok = PyArg_ParseTuple( args, "bbbb", &r, &g, &b, &a );
-
- else
- ok = PyArg_ParseTuple( args, "|(bbbb)", &r, &g, &b, &a );
-
- if( !ok )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1-byte ints [b,b,b,b] or b,b,b,b as arguments (or nothing)" );
-
- *( self->rgba[0] ) = (char)EXPP_ClampInt( r, 0, 255 );
- *( self->rgba[1] ) = (char)EXPP_ClampInt( g, 0, 255 );
- *( self->rgba[2] ) = (char)EXPP_ClampInt( b, 0, 255 );
- *( self->rgba[3] ) = (char)EXPP_ClampInt( a, 0, 255 );
-
- return EXPP_incr_ret( Py_None );
-}
-
-/* return color value for one of the components */
-
-static PyObject *charRGBA_getColor( BPy_charRGBA * self, void * type)
-{
- int index = ((long)type) & 3;
- return PyInt_FromLong ( *self->rgba[index] );
-}
-
-/* sets the color value of one of the components */
-
-static int charRGBA_setColor( BPy_charRGBA * self, PyObject * value,
- void * type)
-{
- int index = ((long)type) & 3;
- PyObject *num = PyNumber_Int( value );
-
- /* argument must be a number */
- if( !num )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected char argument" );
-
- /* clamp valut to 0..255 then assign */
- *self->rgba[index] = (char)EXPP_ClampInt( (int)PyInt_AS_LONG(value),
- 0, 255 );
- Py_DECREF( num );
- return 0;
-}
-
-/*****************************************************************************/
-/* Section: charRGBA as Mapping */
-/* These functions provide code to access charRGBA objects as */
-/* mappings. */
-/*****************************************************************************/
-static int charRGBALength( BPy_charRGBA * self )
-{
- return 4;
-}
-
-static PyObject *charRGBASubscript( BPy_charRGBA * self, PyObject * key )
-{
- char *name = NULL;
- int i;
-
- if( PyNumber_Check( key ) )
- return charRGBAItem( self, ( int ) PyInt_AsLong( key ) );
-
- if( !PyArg_ParseTuple( key, "s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int or string argument" );
-
- if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- i = 0;
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- i = 1;
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- i = 2;
- else if( !strcmp( name, "A" ) || !strcmp( name, "a" ) )
- i = 3;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-
- return PyInt_FromLong( (long)(*self->rgba[i]) );
-}
-
-static int charRGBAAssSubscript( BPy_charRGBA * self, PyObject * key,
- PyObject * v )
-{
- char *name = NULL;
- int i;
-
- if( !PyNumber_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "value to assign must be a number" );
-
- if( PyNumber_Check( key ) )
- return charRGBAAssItem( self, ( int ) PyInt_AsLong( key ), v );
-
- if( !PyArg_Parse( key, "s", &name ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int or string argument" );
-
- if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- i = 0;
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- i = 1;
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- i = 2;
- else if( !strcmp( name, "A" ) || !strcmp( name, "a" ) )
- i = 3;
- else
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-
- *( self->rgba[i] ) = (char)EXPP_ClampInt( PyInt_AsLong( v ), 0, 255 );
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Section: charRGBA as Sequence */
-/* These functions provide code to access charRGBA objects as */
-/* sequences. */
-/*****************************************************************************/
-static PyObject *charRGBAItem( BPy_charRGBA * self, int i )
-{
- if( i < 0 || i >= 4 )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return PyInt_FromLong( *(self->rgba[i]) );
-}
-
-static PyObject *charRGBASlice( BPy_charRGBA * self, int begin, int end )
-{
- PyObject *list;
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 4 )
- end = 4;
- if( begin > end )
- begin = end;
-
- list = PyList_New( end - begin );
-
- for( count = begin; count < end; count++ )
- PyList_SetItem( list, count - begin,
- PyInt_FromLong( *( self->rgba[count] ) ) );
-
- return list;
-}
-
-static int charRGBAAssItem( BPy_charRGBA * self, int i, PyObject * ob )
-{
- if( i < 0 || i >= 4 )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array assignment index out of range" );
-
- if( !PyNumber_Check( ob ) )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "color component must be a number" );
-
- *( self->rgba[i] ) = (char)EXPP_ClampInt( PyInt_AsLong( ob ), 0, 255 );
-
- return 0;
-}
-
-static int charRGBAAssSlice( BPy_charRGBA * self, int begin, int end,
- PyObject * seq )
-{
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 4 )
- end = 4;
- if( begin > end )
- begin = end;
-
- if( !PySequence_Check( seq ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "illegal argument type for built-in operation" );
-
- if( PySequence_Length( seq ) != ( end - begin ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "size mismatch in slice assignment" );
-
- for( count = begin; count < end; count++ ) {
- char value;
- PyObject *ob = PySequence_GetItem( seq, count );
-
- if( !PyArg_Parse( ob, "b", &value ) ) {
- Py_DECREF( ob );
- return -1;
- }
-
- *( self->rgba[count] ) = (char)EXPP_ClampInt( value, 0, 255 );
-
- Py_DECREF( ob );
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: charRGBA_repr */
-/* Description: This is a callback function for the BPy_charRGBA type. It */
-/* builds a meaninful string to represent charRGBA objects. */
-/*****************************************************************************/
-static PyObject *charRGBA_repr( BPy_charRGBA * self )
-{
- char r, g, b, a;
-
- r = *( self->rgba[0] );
- g = *( self->rgba[1] );
- b = *( self->rgba[2] );
- a = *( self->rgba[3] );
-
- return PyString_FromFormat( "[%d, %d, %d, %d]", r, g, b, a );
-}
diff --git a/source/blender/python/api2_2x/charRGBA.h b/source/blender/python/api2_2x/charRGBA.h
deleted file mode 100644
index 0a765dde5dd..00000000000
--- a/source/blender/python/api2_2x/charRGBA.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_charRGBA_H
-#define EXPP_charRGBA_H
-
-#include <Python.h>
-
-/* Objects of <type 'charRGBA'> are used inside other Blender Python
- * objects, so this header file must contain only 'public' declarations */
-/* there's also rgbTuple, for rgb floats and a color obj in NMesh, messy! */
-
-/* Python BPy_charRGBA structure definition: */
-
-typedef struct {
- PyObject_HEAD
- char *rgba[4]; /* array of four pointers to chars */
-
-} BPy_charRGBA;
-
-extern PyTypeObject charRGBA_Type;
-
-/*****************************************************************************/
-/* Python API function prototypes for the charRGBA helper module. */
-/*****************************************************************************/
-PyObject *charRGBA_New( char *rgba );
-PyObject *charRGBA_getCol( BPy_charRGBA * self );
-PyObject *charRGBA_setCol( BPy_charRGBA * self, PyObject * args );
-
-#endif /* EXPP_charRGBA_H */
diff --git a/source/blender/python/api2_2x/constant.c b/source/blender/python/api2_2x/constant.c
deleted file mode 100644
index 2bf1d189961..00000000000
--- a/source/blender/python/api2_2x/constant.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "constant.h" /*This must come first */
-
-#include "gen_utils.h"
-#include "BLI_blenlib.h"
-
-PyTypeObject constant_Type;
-
-//------------------METHOD IMPLEMENTATIONS-----------------------------
-//------------------------constant.items()
-//Returns a list of key:value pairs like dict.items()
-static PyObject* constant_items(BPy_constant *self)
-{
- return PyDict_Items(self->dict);
-}
-//------------------------constant.keys()
-//Returns a list of keys like dict.keys()
-static PyObject* constant_keys(BPy_constant *self)
-{
- return PyDict_Keys(self->dict);
-}
-//------------------------constant.values()
-//Returns a list of values like dict.values()
-static PyObject* constant_values(BPy_constant *self)
-{
- return PyDict_Values(self->dict);
-}
-//------------------ATTRIBUTE IMPLEMENTATION---------------------------
-//------------------TYPE_OBECT IMPLEMENTATION--------------------------
-//-----------------------(internal)
-//Creates a new constant object
-static PyObject *new_const(void)
-{
- BPy_constant *constant;
-
- constant = (BPy_constant *) PyObject_NEW(BPy_constant, &constant_Type);
- if(constant == NULL){
- return (EXPP_ReturnPyObjError(PyExc_MemoryError,
- "couldn't create constant object"));
- }
- if((constant->dict = PyDict_New()) == NULL){
- return (EXPP_ReturnPyObjError(PyExc_MemoryError,
- "couldn't create constant object's dictionary"));
- }
-
- return (PyObject *)constant;
-}
-//------------------------tp_doc
-//The __doc__ string for this object
-static char BPy_constant_doc[] = "This is an internal subobject of armature\
-designed to act as a Py_Bone dictionary.";
-
-//------------------------tp_methods
-//This contains a list of all methods the object contains
-static PyMethodDef BPy_constant_methods[] = {
- {"items", (PyCFunction) constant_items, METH_NOARGS,
- "() - Returns the key:value pairs from the dictionary"},
- {"keys", (PyCFunction) constant_keys, METH_NOARGS,
- "() - Returns the keys the dictionary"},
- {"values", (PyCFunction) constant_values, METH_NOARGS,
- "() - Returns the values from the dictionary"},
- {NULL, NULL, 0, NULL}
-};
-//------------------------mp_length
-static int constantLength(BPy_constant *self)
-{
- return 0;
-}
-//------------------------mp_subscript
-static PyObject *constantSubscript(BPy_constant *self, PyObject *key)
-{
- if(self->dict) {
- PyObject *v = PyDict_GetItem(self->dict, key);
- if(v) {
- return EXPP_incr_ret(v);
- }
- return EXPP_ReturnPyObjError( PyExc_KeyError,
- "key not found" );
- }
- return NULL;
-}
-//------------------------mp_ass_subscript
-static int constantAssSubscript(BPy_constant *self, PyObject *who, PyObject *cares)
-{
- return 0; /* no user assignments allowed */
-}
-//------------------------tp_getattro
-static PyObject *constant_getAttro(BPy_constant * self, PyObject *value)
-{
- if(self->dict) {
- PyObject *v;
- char *name = PyString_AS_STRING( value );
-
- if(!strcmp(name, "__members__"))
- return PyDict_Keys(self->dict);
-
-#if 0
- if(!strcmp(name, "__methods__") || !strcmp(name, "__dict__")) {
- return PyObject_GenericGetAttr( (PyObject *)self, value );
- }
-#endif
-
- v = PyDict_GetItemString(self->dict, name);
- if(v) {
- return EXPP_incr_ret(v); /* was a borrowed ref */
- }
- return PyObject_GenericGetAttr( (PyObject *)self, value );
- }
- return (EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "constant object lacks a dictionary"));
-}
-//------------------------tp_repr
-static PyObject *constant_repr(BPy_constant * self)
-{
- char str[4096];
- PyObject *key, *value, *tempstr;
- int pos = 0;
-
- BLI_strncpy(str,"[Constant: ",4096);
- tempstr = PyString_FromString("name");
- value = PyDict_GetItem( self->dict, tempstr );
- Py_DECREF(tempstr);
- if(value) {
- strcat(str, PyString_AsString(value));
- } else {
- short sep = 0;
- strcat(str,"{");
- while (PyDict_Next(self->dict, &pos, &key, &value)) {
- if( sep )
- strcat (str, ", ");
- else
- sep = 1;
- strcat (str, PyString_AsString(key));
- }
- strcat(str,"}");
- }
- strcat(str, "]");
- return PyString_FromString(str);
-}
-//------------------------tp_dealloc
-static void constant_dealloc(BPy_constant * self)
-{
- Py_DECREF(self->dict);
- PyObject_DEL(self);
-}
-
-//------------------TYPE_OBECT DEFINITION------------------------------
-static PyMappingMethods constantAsMapping = {
- (inquiry) constantLength, // mp_length
- (binaryfunc) constantSubscript, // mp_subscript
- (objobjargproc) constantAssSubscript, // mp_ass_subscript
-};
-
-PyTypeObject constant_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "Constant", //tp_name
- sizeof(BPy_constant), //tp_basicsize
- 0, //tp_itemsize
- (destructor)constant_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
- (reprfunc) constant_repr, //tp_repr
- 0, //tp_as_number
- 0, //tp_as_sequence
- &constantAsMapping, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- (getattrofunc)constant_getAttro, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- BPy_constant_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- 0, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- BPy_constant_methods, //tp_methods
- 0, //tp_members
- 0, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//------------------VISIBLE PROTOTYPE IMPLEMENTATION-------------------
-//Creates a default empty constant
-PyObject *PyConstant_New(void)
-{
- return new_const();
-}
-//Inserts a key:value pair into the constant and then returns 0/1
-int PyConstant_Insert(BPy_constant *self, char *name, PyObject *value)
-{
- PyType_Ready( &constant_Type );
- return EXPP_dict_set_item_str(self->dict, name, value);
-}
-//This is a helper function for generating constants......
-PyObject *PyConstant_NewInt(char *name, int value)
-{
- PyObject *constant = PyConstant_New();
-
- if (constant)
- {
- PyConstant_Insert((BPy_constant*)constant, "name", PyString_FromString(name));
- PyConstant_Insert((BPy_constant*)constant, "value", PyInt_FromLong(value));
- }
- return constant;
-}
-//This is a helper function for generating constants......
-PyObject *PyConstant_NewString(char *name, char *value)
-{
- PyObject *constant = PyConstant_New();
-
- if (constant)
- {
- PyConstant_Insert((BPy_constant*)constant, "name", PyString_FromString(name));
- PyConstant_Insert((BPy_constant*)constant, "value", PyString_FromString(value));
- }
- return constant;
-}
diff --git a/source/blender/python/api2_2x/constant.h b/source/blender/python/api2_2x/constant.h
deleted file mode 100644
index dc906a32fb8..00000000000
--- a/source/blender/python/api2_2x/constant.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano, Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_constant_H
-#define EXPP_constant_H
-
-#include <Python.h>
-
-/*-------------------TYPE CHECKS-------------------------------*/
-#define BPy_Constant_Check(v) ((v)->ob_type==&constant_Type)
-/*-------------------TYPEOBJECT--------------------------------*/
-extern PyTypeObject constant_Type;
-/*-------------------STRUCT DEFINITION-------------------------*/
-typedef struct {
- PyObject_HEAD
- PyObject * dict;
-} BPy_constant;
-/*-------------------VISIBLE PROTOTYPES-----------------------*/
-PyObject *PyConstant_New(void);
-int PyConstant_Insert(BPy_constant *self, char *name, PyObject *value);
-PyObject *PyConstant_NewInt(char *name, int value);
-PyObject *PyConstant_NewString(char *name, char *value);
-
-#endif /* EXPP_constant_H */
diff --git a/source/blender/python/api2_2x/doc/API_intro.py b/source/blender/python/api2_2x/doc/API_intro.py
deleted file mode 100644
index 192c9710ea2..00000000000
--- a/source/blender/python/api2_2x/doc/API_intro.py
+++ /dev/null
@@ -1,245 +0,0 @@
-# This is not a real module, it's simply an introductory text.
-
-"""
-The Blender Python API Reference
-================================
-
- for a full list of changes since 2.45 see U{http://wiki.blender.org/index.php/Release_Notes/Notes246/Python_API}
-
- Top Module:
- -----------
-
- - L{Blender}
- - L{bpy<Bpy>} (experimental)
-
- Submodules:
- -----------
- - L{Armature}
- - L{NLA}
- - L{Action<NLA.Action>}
- - L{BezTriple}
- - L{BGL}
- - L{Camera}
- - L{Curve}
- - L{Draw}
- - L{Effect}
- - L{Geometry}
- - L{Group}
- - L{Image}
- - L{Ipo}
- - L{IpoCurve}
- - L{Key}
- - L{Lamp}
- - L{Lattice}
- - L{Library}
- - L{Material}
- - L{Mathutils}
- - L{Mesh}
- - L{MeshPrimitives}
- - L{Metaball}
- - L{NMesh} (deprecated)
- - L{Noise}
- - L{Object}
- - L{Modifier}
- - L{Pose}
- - L{Constraint}
- - L{ActionStrips<NLA>}
- - L{Particle}
- - L{Registry}
- - L{Scene}
- - L{Radio}
- - L{Render}
- - L{Sound}
- - L{Text}
- - L{Text3d}
- - L{Font}
- - L{Texture}
- - L{TimeLine}
- - L{Types}
- - L{Window}
- - L{Theme}
- - L{World}
- - L{sys<Sys>}
-
- Additional information:
- -----------------------
- - L{API_related}:
- - Calling scripts from command line
- - Script links and space handlers
- - How to register scripts in menus
- - Recommended ways to document and support configuration options
-
-Introduction:
-=============
-
- This reference documents the Blender Python API, a growing collection of
- Python modules (libraries) that give access to part of the program's internal
- data and functions.
-
- Through scripting Blender can be extended in real-time via
- U{Python <www.python.org>}, an impressive high level, multi-paradigm, open
- source language. Newcomers are recommended to start with the tutorial that
- comes with it.
-
- This opens many interesting possibilities, ranging from automating repetitive
- tasks to adding new functionality to the program: procedural models,
- importers and exporters, even complex applications and so on. Blender itself
- comes with some scripts, but many others can be found in the Scripts & Plugins
- sections and forum posts at the Blender-related sites listed below.
-
-Scripting and Blender:
-======================
-
-These are the basic ways to execute scripts in Blender:
-
- 1. They can be loaded or typed as text files in the Text Editor window, then
- executed with ALT+P.
- 2. Via command line: C{blender -P <scriptname>} will start Blender and execute
- the given script. <scriptname> can be a filename in the user's file system or
- the name of a text saved in a .blend Blender file:
- 'blender myfile.blend -P textname'.
- 3. Via command line in I{background mode}: use the '-b' flag (the order is
- important): C{blender -b <blendfile> -P <scriptname>}. <blendfile> can be any
- .blend file, including the default .B.blend that is in Blender's home directory
- L{Blender.Get}('homedir'). In this mode no window will be opened and the
- program will leave as soon as the script finishes execution.
- 4. Properly registered scripts can be selected directly from the program's
- menus.
- 5. Scriptlinks: these are also loaded or typed in the Text Editor window and
- can be linked to objects, materials or scenes using the Scriptlink buttons
- tab. Script links get executed automatically when their events (ONLOAD,
- REDRAW, FRAMECHANGED) are triggered. Normal scripts can create (L{Text}) and
- link other scripts to objects and events, see L{Object.Object.addScriptLink},
- for example.
- 6. A script can call another script (that will run in its own context, with
- its own global dictionary) with the L{Blender.Run} module function.
-
-
-Interaction with users:
------------------------
-
- Scripts can:
- - simply run and exit;
- - pop messages, menus and small number and text input boxes;
- - draw graphical user interfaces (GUIs) with OpenGL calls and native
- program buttons, which stay there accepting user input like any other
- Blender window until the user closes them;
- - attach themselves to a space's event or drawing code (aka space handlers,
- L{check here<API_related>});
- - make changes to the 3D View (set visible layer(s), view point, etc);
- - grab the main input event queue and process (or pass to Blender) selected
- keyboard, mouse, redraw events -- not considered good practice, but still
- available for private use;
- - tell Blender to execute other scripts (see L{Blender.Run}());
- - use external Python libraries, if available.
-
- You can read the documentation for the L{Window}, L{Draw} and L{BGL} modules
- for more information and also check the Python site for external modules that
- might be useful to you. Note though that any imported module will become a
- requirement of your script, since Blender itself does not bundle external
- modules.
-
-Command line mode:
-------------------
-
- Python was embedded in Blender, so to access BPython modules you need to
- run scripts from the program itself: you can't import the Blender module
- into an external Python interpreter.
-
- On the other hand, for many tasks it's possible to control Blender via
- some automated process using scripts. Interested readers should learn about
- features like "OnLoad" script links, the "-b <blendfile>" (background mode)
- and "-P <script>" (run script) command line options and API calls like
- L{Blender.Save}, L{Blender.Load}, L{Blender.Quit} and the L{Library} and
- L{Render} modules.
-
- Note that command line scripts are run before Blender initializes its windows
- (and in '-b' mode no window will be initialized), so many functions that get
- or set window related attributes (like most in L{Window}) don't work here. If
- you need those, use an ONLOAD script link (see L{Scene.Scene.addScriptLink})
- instead -- it's also possible to use a command line script to write or set an
- ONLOAD script link. Check the L{Blender.mode} module var to know if Blender
- is being executed in "background" or "interactive" mode.
-
- L{Click here for command line and background mode examples<API_related>}.
-
-
-Demo mode:
-----------
-
- Blender has a demo mode, where once started it can work without user
- intervention, "showing itself off". Demos can render stills and animations,
- play rendered or real-time animations, calculate radiosity simulations and
- do many other nifty things. If you want to turn a .blend file into a demo,
- write a script to run the show and link it as a scene "OnLoad" scriptlink.
- The demo will then be played automatically whenever this .blend file is
- opened, B{unless Blender was started with the "-y" parameter}.
-
-The Game Engine API:
---------------------
-
- Blender has a game engine for users to create and play 3d games. This
- engine lets programmers add scripts to improve game AI, control, etc, making
- more complex interaction and tricks possible. The game engine API is
- separate from the Blender Python API this document references and you can
- find its own ref doc in the doc section of the main sites below.
-
-Blender Data Structures:
-------------------------
-
- Programs manipulate data structures. Blender python scripts are no exception.
- Blender uses an Object Oriented architecture. The BPython interface tries to
- present Blender objects and their attributes in the same way you see them
- through the User Interface (the GUI). One key to BPython programming is
- understanding the information presented in Blender's OOPS window where Blender
- objects and their relationships are displayed.
-
- Each Blender graphic element (Mesh, Lamp, Curve, etc.) is composed from two
- parts: an Object and ObData. The Object holds information about the position,
- rotation and size of the element. This is information that all elements have
- in common. The ObData holds information specific to that particular type of
- element.
-
- Each Object has a link to its associated ObData. A single ObData may be
- shared by many Objects. A graphic element also has a link to a list of
- Materials. By default, this list is associated with the ObData.
-
- All Blender objects have a unique name. However, the name is qualified by the
- type of the object. This means you can have a Lamp Object called Lamp.001
- (OB:Lamp.001) and a Lamp ObData called Lamp.001 (LA:Lamp.001).
-
- For a more in-depth look at Blender internals, and some understanding of why
- Blender works the way it does, see the U{Blender Architecture document
- <http://www.blender3d.org/cms/Blender_Architecture.336.0.html>}.
-
-
-A note to newbie script writers:
---------------------------------
-
- Interpreted languages are known to be much slower than compiled code, but for
- many applications the difference is negligible or acceptable. Also, with
- profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to
- identify slow areas and well thought optimizations, the speed can be
- I{considerably} improved in many cases. Try some of the best BPython scripts
- to get an idea of what can be done, you may be surprised.
-
-@author: The Blender Python Team
-@requires: Blender 2.46 or newer.
-@version: 2.46
-@see: U{www.blender.org<http://www.blender.org>}: documentation and forum
-@see: U{blenderartists.org<http://blenderartists.org>}: user forum
-@see: U{projects.blender.org<http://projects.blender.org>}
-@see: U{blender architecture<http://www.blender3d.org/cms/Blender_Architecture.336.0.html>}: blender architecture document
-@see: U{www.python.org<http://www.python.org>}
-@see: U{www.python.org/doc<http://www.python.org/doc>}
-@see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples.
-
-@note: the official version of this reference guide is only updated for each
- new Blender release. But you can build the current SVN
- version yourself: install epydoc, grab all files in the
- source/blender/python/api2_2x/doc/ folder of Blender's SVN and use the
- epy_docgen.sh script also found there to generate the html docs.
- Naturally you will also need a recent Blender binary to try the new
- features. If you prefer not to compile it yourself, there is a testing
- builds forum at U{blender.org<http://www.blender.org>}.
-"""
diff --git a/source/blender/python/api2_2x/doc/API_related.py b/source/blender/python/api2_2x/doc/API_related.py
deleted file mode 100644
index dcd2bdd1e60..00000000000
--- a/source/blender/python/api2_2x/doc/API_related.py
+++ /dev/null
@@ -1,571 +0,0 @@
-# This is not a real module, it's simply an introductory text.
-
-"""
-Blender Python related features
-===============================
-
- L{Back to Main Page<API_intro>}
-
-
-Introduction:
-=============
-
- This page describes special features available to BPython scripts:
-
- - Command line mode is accessible with the '-P' and '-b' Blender options.
- - Registration allows scripts to become available from some pre-defined menus
- in Blender, like Import, Export, Wizards and so on.
- - Script links are Blender Texts (scripts) executed when a particular event
- (redraws, .blend file loading, saving, frame changed, etc.) occurs. Now
- there are also "Space Handlers" to draw onto or get events from a given
- space (only 3D View now) in some window.
- - Proper documentation data is used by the 'Scripts Help Browser' script to
- show help information for any registered script. Your own GUI can use
- this facility with the L{Blender.ShowHelp} function.
- - Configuration is for data in your script that can be tweaked according to
- user taste or needs. Like documentation, this is another helper
- functionality -- you don't need to provide a GUI yourself to edit config
- data.
-
-
- Command line usage:
- ===================
-
- Specifying scripts:
- -------------------
-
- The '-P' option followed either by:
- - a script filename (full pathname if not in the same folder where you run
- the command);
- - the name of a Text in a .blend file (that must also be specified)
- will open Blender and immediately run the given script.
-
- Example::
-
- # open Blender and execute the given script:
- blender -P script.py
-
- Passing parameters:
- -------------------
-
- To pass parameters to the script you can:
- - write them to a file before running Blender, then make your script parse that file;
- - set environment variables and access them with the 'os' module:
-
- Examples with parameters being passed to the script via command line::
-
- # execute a command like:
-
- myvar=value blender -P script.py
-
- # and in script.py access myvar with os.getenv
- # (os.environ and os.setenv are also useful):
-
- # script.py:
- import os
- val = os.getenv('myvar')
-
- # To pass multiple parameters, simply write them in sequence,
- # separated by spaces:
-
- myvar1=value1 myvar2=value2 mystr="some string data" blender -P script.py
-
- Background mode:
- ----------------
-
- In '-b' mode no windows will be opened: the program will run as a command
- line tool able to render stills and animations and execute any working Python
- script with complete access to loaded .blend's file contents. Once the task
- is completed, the program will exit.
-
- Background mode examples::
-
- # Open Blender in background mode with file 'myfile.blend'
- # and run the script 'script.py':
-
- blender -b myfile.blend -P script.py
-
- # Note: a .blend file is always required. 'script.py' can be a file
- # in the file system or a Blender Text stored in 'myfile.blend'.
-
- # Let's assume 'script.py' has code to render the current frame;
- # this line will set the [s]tart and [e]nd (and so the current) frame to
- # frame 44 and call the script:
-
- blender -b myfile.blend -s 44 -e 44 -P script.py
-
- # Using now a script written to render animations, we set different
- # start and end frames and then execute this line:
-
- blender -b myfile.blend -s 1 -e 10 -P script.py
-
- # Note: we can also set frames and define if we want a single image or
- # an animation in the script body itself, naturally.
-
- The rendered pictures will be written to the default render folder, that can
- also be set via BPython (take a look at L{Render.RenderData}). Their
- names will be the equivalent frame number followed by the extension of the
- chosen image type: 0001.png, for example. To rename them to something else,
- coders can use the C{rename} function in the standard 'os' Python module.
-
- Reminder: if you just need to render, it's not necessary to have a script.
- Blender can create stills and animations with its own command line arguments.
- Example:
- - a single image at frame 44: blender -b myfile.blend -f 44
- - an animation from frame 1 to 10: blender -b myfile.blend -s 1 -e 10 -a
-
-
- Script links:
- =============
-
- Object script links:
- --------------------
-
- Users can link Blender Text scripts and objects to have the script
- code executed when specific events occur to the objects. For example, if a
- Camera has an script link set to "FrameChanged", the script will be executed
- whenever the current frame is changed. Links can either be manually added by
- users on the Buttons window -> Scripts tab or created by another script (see,
- for example, L{Object.addScriptLink<Object.Object.addScriptLink>}).
-
- These are the types which can be linked to scripts:
- - Camera Data;
- - Lamp Data;
- - Materials;
- - Objects;
- - Scenes;
- - Worlds.
-
- And these are the available event choices:
- - Redraw;
- - FrameChanged;
- - Render;
- - OnLoad (*);
- - OnSave (*).
-
- (*) only available for scenes
-
- There are three L{Blender} module variables that script link authors should
- be aware of:
- - B{bylink}: True if the script is running as a script link;
- - B{link}: the object the running script was linked to (None if this is
- not a script link);
- - B{event}: the event type, if the running script is being executed as a
- script link.
-
- Example::
- #script link
- import Blender
- if Blender.bylink: # we're running as a script link
- print "Event: %s for %s" % (Blender.event, Blender.link)
-
- B{Important note about "Render" events}:
-
- Each "Render" script link is executed twice: before rendering and after, for
- reverting changes and for possible clean up actions. Before rendering,
- 'Blender.event' will be "Render" and after rendering it will be "PostRender".
-
- Example::
- # render script link
- import Blender
- event = Blender.event
- if event == "Render":
- # prepare for rendering
- create_my_very_detailed_mesh_data()
- elif event == "PostRender":
- # done rendering, clean up
- delete_my_very_detailed_mesh_data()
-
- As suggested by the example above, this is especially useful for script links
- that need to generate data only useful while rendering, or in case they need
- to switch between two mesh data objects, one meant for realtime display and
- the other, more detailed, for renders.
-
- Space Handler script links:
- ---------------------------
-
- This is a new kind of script linked to spaces in a given window. Right now
- only the 3D View has the necessary hooks, but the plan is to add access to
- other types, too. Just to clarify naming conventions: in Blender, a screen
- is partitioned in windows (also called areas) and each window can show any
- space. Spaces are: 3D View, Text Editor, Scripts, Buttons, User Preferences,
- Oops, etc.
-
- Space handlers are texts in the Text Editor, like other script links, but they
- need to have a special header to be recognized -- B{I{the first line in the
- text file}} must inform:
- 1. that they are space handlers;
- 2. the space they belong to;
- 3. whether they are EVENT or DRAW handlers.
-
- Example header for a 3D View EVENT handler::
-
- # SPACEHANDLER.VIEW3D.EVENT
-
- Example header for a 3D View DRAW handler::
-
- # SPACEHANDLER.VIEW3D.DRAW
-
- Available space handlers can be toggled "on" or "off" in the space header's
- B{View->Space Handler Scripts} submenu, by the user.
-
- EVENT space handler scripts are called by that space's event handling callback
- in Blender. The script receives the event B{before} it is further processed
- by the program. An EVENT handler script should check Blender.event (compare
- it against L{Draw} events) and either:
- - process it (the script must set Blender.event to None then);
- - ignore it.
-
- Setting C{Blender.event = None} tells Blender not to go on processing itself
- the event, because it was grabbed by the script.
-
- Example::
-
- # SPACEHANDLER.VIEW3D.EVENT
-
- import Blender
- from Blender import Draw
- evt = Blender.event
- val = Blender.eventValue
- return_it = False
-
- if evt == Draw.LEFTMOUSE:
- print "Swallowing the left mouse button press"
- elif evt == Draw.AKEY:
- print "Swallowing an 'a' character"
- else:
- print "Let the 3D View itself process this event: %d with value %d" % (evt, val)
- return_it = True
-
- # if Blender should not process itself the passed event:
- if not return_it: Blender.event = None
-
- DRAW space handlers are called by that space's drawing callback in Blender.
- The script is called B{after} the space has been drawn.
-
- Two of the L{Blender} module variables related to script links assume
- different roles for space handlers:
- - B{bylink} is the same: True if the script is running as a script link;
- - B{link}: integer from the L{Blender}.SpaceHandlers constant dictionary,
- tells what space this handler belongs to and the handler's type
- (EVENT, DRAW);
- - B{event}:
- - EVENT handlers: an input event (check keys and mouse events in
- L{Draw}) to be processed or ignored;
- - DRAW handlers: 0 always;
- - B{eventValue}:
- - EVENT handlers: the event value, it indicates mouse button or key
- presses (since we don't pass releases) as 1 and mouse movements
- (Draw.MOUSE.X and Draw.MOUSE.Y) as the current x or y coordinate,
- for example;
- - DRAW handlers: 0 always.
-
- B{Guidelines (important)}:
- - EVENT handlers can access and change Blender objects just like any other
- script, but they should not draw to the screen, B{use a DRAW handler to do
- that}. Specifically: L{Draw.Image} and the L{BGL} drawing functions
- should not be used inside an EVENT handler.
- - DRAW handlers should leave the space in the same state it was before they
- were executed. OpenGL attributes and the modelview and projection matrices
- are automatically saved (pushed) before a DRAW handler runs and restored
- (popped) after it finishes, no need to worry about that. Draw handlers
- should not grab events;
- - If script handlers need to pass information to each other (for example an
- EVENT handler passing info to a DRAW handler), use the L{Registry} module.
- - in short: use the event handler to deal with events and the draw handler to
- draw and your script will be following the recommended practices for
- Blender code.
-
- Registering scripts:
- ====================
-
- To be registered a script needs two things:
- - to be either in the default scripts directory or in the user defined scripts
- path (see User Preferences window -> File Paths tab -> Python path);
- - to have a proper header.
-
- Try 'blender -d' to know where your default directory for scripts is, it will
- inform either the directory or the file with that info already parsed, which is
- in the same directory of the scripts folder.
-
- The header should be like this one (all double and single apostrophes below
- are required)::
- #!BPY
-
- # \"\"\"
- # Name: 'Script Name'
- # Blender: 233
- # Group: 'Export'
- # Submenu: 'All' all
- # Submenu: 'Selected' sel
- # Submenu: 'Configure (gui)' gui
- # Tooltip: 'Export to some format.'
- # \"\"\"
-
- where:
- - B{Name} is the string that will appear in the menu;
- - B{Blender} is the minimum program version required to run the script;
- - B{Group} defines where the script will be put, see all groups in the
- Scripts Window's header, menu "Scripts";
- - B{Submenu} adds optional submenus for further control;
- - B{Tooltip} is the (short) tooltip string for the menu entry.
-
- note:
- - all double and single apostrophes above are required;
- - you can "comment out" the header above, by starting lines with
- '#', like we did. This is not required (except for the first line, #!BPY,
- of course), but this way the header won't conflict with Python tools that
- you can use to generate documentation for your script code. Just
- remember to keep this header above any other line with triple
- double-quotes (\"\"\") in your script.
-
- Submenu lines are not required, use them if you want to provide extra
- options. To see which submenu the user chose, check the "__script__"
- dictionary in your code: __script__['arg'] has the defined keyword (the word
- after the submenu string name: all, sel or gui in the example above) of the
- chosen submenu. For example, if the user clicked on submenu 'Selected' above,
- __script__['arg'] will be "sel".
-
- If your script requires extra data or configuration files, there is a special
- folder where they can be saved: see 'datadir' in L{Blender.Get}.
-
-
- Documenting scripts:
- ====================
-
- The "Scripts Help Browser" script in the Help menu can parse special variables
- from registered scripts and display help information for users. For that,
- authors only need to add proper information to their scripts, after the
- registration header.
-
- The expected variables:
-
- - __bpydoc__ (or __doc__) (type: string):
- - The main help text. Write a first short paragraph explaining what the
- script does, then add the rest of the help text, leaving a blank line
- between each new paragraph. To force line breaks you can use <br> tags.
-
- - __author__ (type: string or list of strings):
- - Author name(s).
-
- - __version__ (type: string):
- - Script version. A good recommendation is using a version number followed
- by the date in the format YYYY/MM/DD: "1.0 2005/12/31".
-
- - __url__ (type: string or list of strings):
- - Internet links that are shown as buttons in the help screen. Clicking
- them opens the user's default browser at the specified location. The
- expected format for each url entry is e.g.
- "Author's site, http://www.somewhere.com". The first part, before the
- comma (','), is used as the button's tooltip. There are two preset
- options: "blender" and "blenderartists.org", which link to the Python forums at
- blender.org and blenderartists.org, respectively.
-
- - __email__ (optional, type: string or list of strings):
- - Equivalent to __url__, but opens the user's default email client. You
- can write the email as someone:somewhere*com and the help script will
- substitute accordingly: someone@somewhere.com. This is only a minor help
- to hide emails from spammers, since your script may be available at some
- site. "scripts" is the available preset, with the email address of the
- mailing list devoted to scripting in Blender, bf-scripts-dev@blender.org.
- You should only use this one if you are subscribed to the list:
- http://projects.blender.org/mailman/listinfo/bf-scripts-dev for more
- information.
-
- Example::
- __author__ = 'Mr. Author'
- __version__ = '1.0 2005/01/01'
- __url__ = ["Author's site, http://somewhere.com",
- "Support forum, http://somewhere.com/forum/", "blender", "blenderartists.org"]
- __email__ = ["Mr. Author, mrauthor:somewhere*com", "scripts"]
- __bpydoc__ = \"\"\"\\
- This script does this and that.
-
- Explaining better, this script helps you create ...
-
- You can write as many paragraphs as needed.
-
- Shortcuts:<br>
- Esc or Q: quit.<br>
- etc.
-
- Supported:<br>
- Meshes, metaballs.
-
- Known issues:<br>
- This is just an example, there's no actual script.
-
- Notes:<br>
- You can check scripts bundled with Blender to see more examples of how to
- add documentation to your own works.
- \"\"\"
-
- B{Note}: your own GUI or menu code can display documentation by calling the
- help browser with the L{Blender.ShowHelp} function.
-
- Configuring scripts:
- ====================
-
- The L{Blender.Registry<Registry>} module provides a simplified way to keep
- scripts configuration options in memory and also saved in config files.
- And with the "Scripts Config Editor" script in the System menu users can later
- view and edit the options easily.
-
- Let's first clarify what we mean by config options: they are simple data
- (bools, ints, floats, strings) used by programs to conform to user
- preferences. The buttons in Blender's User Preferences window are a good
- example.
-
- For example, a particular exporter might include:
- - SEPARATE_MATS = False: a bool variable (True / False) to determine if it
- should write materials to a separate file;
- - VERSION = 2: an int to define an specific version of the export format;
- - TEX_DIR = "/path/to/textures": a default texture dir to prepend to all
- exported texture filenames instead of their actual paths.
-
- The script needs to provide users a GUI to configure these options -- or else
- directly editing the source code would be the only way to change them. And to
- store changes made to the GUI so they can be reloaded any time the script is
- executed, programmers have to write and load their own config files (ideally at
- L{Blender.Get}('udatadir') or, if not available, L{Blender.Get}('datadir')).
-
- This section describes BPython facilities (based on the L{Registry} module and
- the config editor) that can take care of this in a simplified (and much
- recommended) way.
-
- Here's how it works::
-
- # sample_exporter.py
- import Blender
- from Blender import Registry
-
- # First define all config variables with their default values:
- SEPARATE_MATERIALS = True
- VERSION = True
- TEX_DIR = ''
- EXPORT_DIR = ''
-
- # Then define a function to update the Registry:
- def registry_update():
- # populate a dict with current config values:
- d = {
- 'SEPARATE_MATERIALS': SEPARATE_MATERIALS,
- 'VERSION': VERSION,
- 'TEX_DIR': TEX_DIR,
- 'EXPORT_DIR': EXPORT_DIR
- }
- # store the key (optional 3rd arg tells if
- # the data should also be written to a file):
- Registry.SetKey('sample_exporter', d, True)
-
- # (A good convention is to use the script name as Registry key)
-
- # Now we check if our key is available in the Registry or file system:
- regdict = Registry.GetKey('sample_exporter', True)
-
- # If this key already exists, update config variables with its values:
- if regdict:
- try:
- SEPARATE_MATERIALS = regdict['SEPARATE_MATERIALS']
- VERSION = regdict['VERSION']
- TEX_DIR = regdict['TEX_DIR']
- EXPORT_DIR = regdict['EXPORT_DIR']
-
- # if data was corrupted (or a new version of the script changed
- # (expanded, removed, renamed) the config vars and users may have
- # the old config file around):
- except: update_registry() # rewrite it
-
- else: # if the key doesn't exist yet, use our function to create it:
- update_registry()
-
- # ...
-
- Hint: nicer code than the simplistic example above can be written by keeping
- config var names in a list of strings and using the exec function.
-
- B{Note}: if your script's GUI lets users change config vars, call the
- registry_update() function in the button events callback to save the changes.
- On the other hand, you don't need to handle configuration
- in your own gui, it can be left for the 'Scripts Config Editor',
- which should have access to your script's config key as soon as the
- above code is executed once (as soon as SetKey is executed).
-
- B{Note} (limits for config vars): strings longer than 300 characters are
- clamped and the number of items in dictionaries, sequences and the config key
- itself is limited to 60.
-
-
- Scripts Configuration Editor:
- -----------------------------
-
- This script should be available from the System menu in the Scripts window.
- It provides a GUI to view and edit saved configuration data, both from the
- Registry dictionary in memory and the scripts config data dir. This is
- useful for all scripts with config vars, but especially for those without GUIs,
- like most importers and exporters, since this editor will provide one for them.
-
- The example above already gives a good idea of how the information can be
- prepared to be accessible from this editor, but there is more worth knowing:
-
- 1. String vars that end with '_dir' or '_file' (can be upper case, too) are
- recognized as input boxes for dirs or files and a 'browse' button is added to
- their right side, to call the file selector.
-
- 2. Both key names and configuration variables names starting with an
- underscore ('_') are ignored by the editor. Programmers can use this feature
- for any key or config var that is not meant to be configured by this editor.
-
- 3. The following information refers to extra config variables that may be
- added specifically to aid the configuration editor script. To clarify, in the
- example code above these variables (the string 'script' and the dictionaries
- 'tooltips' and 'limits') would appear along with SEPARATE_MATERIALS, VERSION,
- TEX_DIR and EXPORT_DIR, wherever they are written.
-
- Minor note: these names are case insensitive: tooltips, TOOLTIPS, etc. are all
- recognized.
-
- 3.1 The config editor will try to display a 'help' button for a key, to show
- documentation for the script that owns it. To find this "owner script", it
- will first look for a config variable called 'script', a string containing
- the name of the owner Python file (with or without '.py' extension)::
-
- script = 'sample_exporter.py'
-
- If there is no such variable, the editor will check if the file formed by the
- key name and the '.py' extension exists. If both alternatives fail, no help
- button will be displayed.
-
- 3.2 You can define tooltips for the buttons that the editor creates for your
- config data (string input, toggle, number sliders). Simply create a dict
- called 'tooltips', where config var names are keys and their tooltips,
- values::
-
- tooltips = {
- 'EXPORT_DIR': 'default folder where exported files should be saved',
- 'VERBOSE': 'print info and warning messages to the console',
- 'SEPARATE_MATERIALS': 'write materials to their own file'
- }
-
- 3.3 Int and float button sliders need min and max limits. This can be passed
- to the editor via a dict called 'limits' (ivar1, ivar2 and fvar are meant as
- extra config vars that might have been in the example code above)::
-
- limits = {'ivar1': [-10, 10], 'ivar2': [0, 100], 'fvar1': [-12.3, 15.4]}
-
- 4. The Config Editor itself maintains a Registry key called "General", with
- general options relevant to many scripts, like "verbose" to tell if the user
- wants messages printed to the console and "confirm overwrite", to know if
- a script should ask for confirmation before overwriting files (all exporters
- are recommended to access the General key and check this var -- L{sys.exists
- <Sys.exists>} tells if files or folders already exist).
-
- Hint: for actual examples, try the ac3d importer and exporter (it's enough to
- call them from the menus then cancel with ESC), as those have been updated to
- use this config system. After calling them their config data will be available
- in the Config Editor. We also recommend adding a section about config vars
- in your script's help info, as done in the ac3d ones.
-
- L{Back to Main Page<API_intro>}
- ===============================
-"""
diff --git a/source/blender/python/api2_2x/doc/Armature.py b/source/blender/python/api2_2x/doc/Armature.py
deleted file mode 100644
index 9aceb0105e3..00000000000
--- a/source/blender/python/api2_2x/doc/Armature.py
+++ /dev/null
@@ -1,381 +0,0 @@
-# Blender.Armature module and the Armature PyType object
-
-"""
-The Blender.Armature submodule.
-
-Armature
-========
-
-This module provides access to B{Armature} objects in Blender. These are
-"skeletons", used to deform and animate other objects -- meshes, for
-example.
-
-Example::
- import Blender
- from Blender import Armature
- from Blender.Mathutils import *
- #
- arms = Armature.Get()
- for arm in arms.values():
- arm.drawType = Armature.STICK #set the draw type
- arm.makeEditable() #enter editmode
-
- #generating new editbone
- eb = Armature.Editbone()
- eb.roll = 10
- eb.parent = arm.bones['Bone.003']
- eb.head = Vector(1,1,1)
- eb.tail = Vector(0,0,1)
- eb.options = [Armature.HINGE, Armature.CONNECTED]
-
- #add the bone
- arm.bones['myNewBone'] = eb
-
- #delete an old bone
- del arm.bones['Bone.002']
-
- arm.update() #save changes
-
- for bone in arm.bones.values():
- #print bone.matrix['ARMATURESPACE']
- print bone.parent, bone.name
- print bone.children, bone.name
- print bone.options, bone.name
-
-
-Example::
- # Adds empties for every bone in the selected armature, an example of getting worldspace locations for bones.
- from Blender import *
- def test_arm():
- scn= Scene.GetCurrent()
- arm_ob= scn.objects.active
-
- if not arm_ob or arm_ob.type != 'Armature':
- Draw.PupMenu('not an armature object')
- return
-
- # Deselect all
- for ob in scn.objects:
- if ob != arm_ob:
- ob.sel= 0
-
- arm_mat= arm_ob.matrixWorld
-
- arm_data= arm_ob.getData()
-
- bones= arm_data.bones.values()
- for bone in bones:
- bone_mat= bone.matrix['ARMATURESPACE']
- bone_mat_world= bone_mat*arm_mat
-
- ob_empty= scn.objects.new('Empty')
- ob_empty.setMatrix(bone_mat_world)
-
- test_arm()
-
-@var CONNECTED: Connect this bone to parent
-@type CONNECTED: Constant
-@var HINGE: Don't inherit rotation or scale from parent
-@type HINGE: Constant
-@var NO_DEFORM: If bone will not deform geometry
-@type NO_DEFORM: Constant
-@var MULTIPLY: Multiply bone with vertex group
-@type MULTIPLY: Constant
-@var HIDDEN_EDIT: Bone is hidden in editmode
-@type HIDDEN_EDIT: Constant
-@var ROOT_SELECTED: Root of the Bone is selected
-@type ROOT_SELECTED: Constant
-@var BONE_SELECTED: Bone is selected
-@type BONE_SELECTED: Constant
-@var TIP_SELECTED: Tip of the Bone is selected
-@type TIP_SELECTED: Constant
-@var LOCKED_EDIT: Prevents the bone from being transformed in editmode
-@type LOCKED_EDIT: Constant
-@var OCTAHEDRON: Bones drawn as octahedrons
-@type OCTAHEDRON: Constant
-@var STICK: Bones drawn as a line
-@type STICK: Constant
-@var BBONE: Bones draw as a segmented B-spline
-@type BBONE: Constant
-@var ENVELOPE: Bones draw as a stick with envelope influence
-@type ENVELOPE: Constant
-"""
-
-def Get (name = None):
- """
- Get the Armature object(s) from Blender.
- @type name: string, nothing, or list of strings
- @param name: The string name of an armature.
- @rtype: Blender Armature or a list of Blender Armatures
- @return: It depends on the I{name} parameter:
- - (name): The Armature object with the given I{name};
- - (name, name, ...): A list of Armature objects
- - (): A list with all Armature objects in the current scene.
- @warning: In versions 2.42 and earlier, a string argument for an armature
- that doesn't exist will return None. Later versions raise a Value error.
- """
-
-def New (name = None):
- """
- Return a new armature.
- @type name: string or nothing
- @param name: The string name of the new armature.
- @rtype: Blender Armature.
- @return: A new armature.
- """
-
-class Armature:
- """
- The Armature object
- ===================
- This object gives access to Armature-specific data in Blender.
- @ivar bones: A Dictionary of Bones (BonesDict) that make up this armature.
- @type bones: BonesDict Object
- @ivar vertexGroups: Whether vertex groups define deformation
- @type vertexGroups: Bool
- @ivar envelopes: Whether bone envelopes define deformation
- @type envelopes: Bool
- @ivar restPosition: Show rest position (no posing possible)
- @type restPosition: Bool
- @ivar delayDeform: Don't deform children when manipulating bones
- @type delayDeform: Bool
- @ivar drawAxes: Draw bone axes
- @type drawAxes: Bool
- @ivar drawNames: Draw bone names
- @type drawNames: Bool
- @ivar ghost: Draw ghosts around frame for current Action
- @type ghost: Bool
- @ivar ghostStep: Number of frames between ghosts
- @type ghostStep: Int
- @ivar drawType: The drawing type that is used to display the armature
- Acceptable values are:
- - Armature.OCTAHEDRON: bones drawn as octahedrons
- - Armature.STICK: bones drawn as sticks
- - Armature.BBONE: bones drawn as b-bones
- - Armature.ENVELOPE: bones drawn as sticks with envelopes
- @type drawType: Constant Object
- @ivar mirrorEdit: X-axis mirrored editing
- @type mirrorEdit: Bool
- @ivar autoIK: Adds temporary IK chains while grabbing bones
- @type autoIK: Bool
- @ivar layerMask: Layer bitmask
- Example::
- # set armature to layers 14 and 16
- armature.layerMask = (1<<13) + (1<<15)
- @type layerMask: Int
- """
-
- def __init__(name = 'myArmature'):
- """
- Initializer for the Armature TypeObject.
- Example::
- myNewArmature = Blender.Armature.Armature('AR_1')
- @param name: The name for the new armature
- @type name: string
- @return: New Armature Object
- @rtype: Armature Object
- """
-
- def makeEditable():
- """
- Put the armature into EditMode for editing purposes. (Enters Editmode)
- @warning: Using Window.Editmode() to switch the editmode manually will cause problems and possibly even crash Blender.
- @warning: This is only needed for operations such as adding and removing bones.
- @warning: Do access pose data until you have called update() or settings will be lost.
- @warning: The armature should not be in manual editmode
- prior to calling this method. The armature must be parented
- to an object prior to editing.
- @rtype: None
- """
-
- def update():
- """
- Save all changes and update the armature. (Leaves Editmode)
- @note: Must have called makeEditable() first.
- @rtype: None
- """
- def copy():
- """
- Return a copy of this armature.
- @rtype: Armature
- """
- def __copy__():
- """
- Return a copy of this armature.
- @rtype: Armature
- """
-
-import id_generics
-Armature.__doc__ += id_generics.attributes
-
-class BonesDict:
- """
- The BonesDict object
- ====================
- This object gives gives dictionary like access to the bones in an armature.
- It is internal to blender but is called as 'Armature.bones'
-
- Removing a bone:
- Example::
- del myArmature.bones['bone_name']
- Adding a bone:
- Example::
- myEditBone = Armature.Editbone()
- myArmature.bones['bone_name'] = myEditBone
- """
-
- def items():
- """
- Return the key, value pairs in this dictionary
- @rtype: string, BPy_bone
- @return: All strings, and py_bones in the armature (in that order)
- """
-
- def keys():
- """
- Return the keys in this dictionary
- @rtype: string
- @return: All strings representing the bone names
- """
-
- def values():
- """
- Return the values in this dictionary
- @rtype: BPy_bone
- @return: All BPy_bones in this dictionary
- """
-
-class Bone:
- """
- The Bone object
- ===============
- This object gives access to Bone-specific data in Blender. This object
- cannot be instantiated but is returned by BonesDict when the armature is not in editmode.
- @ivar name: The name of this Bone.
- @type name: String
- @ivar roll: This Bone's roll value.
- Keys are:
- - 'ARMATURESPACE' - this roll in relation to the armature
- - 'BONESPACE' - the roll in relation to itself
- @type roll: Dictionary
- @ivar head: This Bone's "head" ending position when in rest state.
- Keys are:
- - 'ARMATURESPACE' - this head position in relation to the armature
- - 'BONESPACE' - the head position in relation to itself.
- @type head: Dictionary
- @ivar tail: This Bone's "tail" ending position when in rest state.
- Keys are:
- - 'ARMATURESPACE' - this tail position in relation to the armature
- - 'BONESPACE' - the tail position in relation to itself
- @type tail: Dictionary
- @ivar matrix: This Bone's matrix. This cannot be set.
- Keys are:
- - 'ARMATURESPACE' - this matrix of the bone in relation to the armature
- - 'BONESPACE' - the matrix of the bone in relation to itself
- @type matrix: Matrix Object
- @ivar parent: The parent Bone.
- @type parent: Bone Object
- @ivar children: The children directly attached to this bone.
- @type children: List of Bone Objects
- @ivar weight: The bone's weight.
- @type weight: Float
- @ivar options: Various bone options which can be:
- - Armature.CONNECTED: IK to parent
- - Armature.HINGE: No parent rotation or scaling
- - Armature.NO_DEFORM: The bone does not deform geometry
- - Armature.MULTIPLY: Multiply vgroups by envelope
- - Armature.HIDDEN_EDIT: Hide bones in editmode
- - Armature.ROOT_SELECTED: Selection of root ball of bone
- - Armature.BONE_SELECTED: Selection of bone
- - Armature.TIP_SELECTED: Selection of tip ball of bone
- - Armature.LOCKED_EDIT: Prevents the bone from being transformed in editmode
- @type options: List of Constants
- @ivar subdivision: The number of bone subdivisions.
- @type subdivision: Int
- @ivar deformDist: The deform distance of the bone
- @type deformDist: Float
- @ivar length: The length of the bone. This cannot be set.
- @type length: Float
- @ivar headRadius: The radius of this bones head (used for envalope bones)
- @type headRadius: Float
- @ivar tailRadius: The radius of this bones head (used for envalope bones)
- @type tailRadius: Float
- @ivar layerMask: Layer bitmask
- Example::
- # set bone to layers 14 and 16
- bone.layerMask = (1<<13) + (1<<15)
- @type layerMask: Int
- """
-
- def hasParent():
- """
- Whether or not this bone has a parent
- @rtype: Bool
- """
-
- def hasChildren():
- """
- Whether or not this bone has children
- @rtype: Bool
- """
-
- def getAllChildren():
- """
- Gets all the children under this bone including the children's children.
- @rtype: List of Bone object
- @return: all bones under this one
- """
-
-class Editbone:
- """
- The Editbone Object
- ===================
- This object is a wrapper for editbone data and is used only in the manipulation
- of the armature in editmode.
- @ivar name: The name of this Bone.
- @type name: String
- @ivar roll: This Bone's roll value (armaturespace).
- @type roll: Float
- @ivar head: This Bone's "head" ending position when in rest state (armaturespace).
- @type head: Vector Object
- @ivar tail: This Bone's "tail" ending position when in rest state (armaturespace).
- @type tail: Vector Object
- @ivar matrix: This Bone's matrix. (armaturespace)
- @type matrix: Matrix Object
- @ivar parent: The parent Bone.
- @type parent: Editbone Object
- @ivar weight: The bone's weight.
- @type weight: Float
- @ivar options: Various bone options which can be:
- - Armature.CONNECTED: IK to parent
- - Armature.HINGE: No parent rotation or scaling
- - Armature.NO_DEFORM: The bone does not deform geometry
- - Armature.MULTIPLY: Multiply vgroups by envelope
- - Armature.HIDDEN_EDIT: Hide bones in editmode
- - Armature.ROOT_SELECTED: Selection of root ball of bone
- - Armature.BONE_SELECTED: Selection of bone
- - Armature.TIP_SELECTED: Selection of tip ball of bone
- @type options: List of Constants
- @ivar subdivision: The number of bone subdivisions.
- @type subdivision: Int
- @ivar deformDist: The deform distance of the bone
- @type deformDist: Float
- @ivar length: The length of the bone. This cannot be set.
- @type length: Float
- @ivar headRadius: The radius of this bones head (used for envalope bones)
- @type headRadius: Float
- @ivar tailRadius: The radius of this bones head (used for envalope bones)
- @type tailRadius: Float
- """
-
- def hasParent():
- """
- Whether or not this bone has a parent
- @rtype: Bool
- """
-
- def clearParent():
- """
- Set the parent to None
- @rtype: None
- """
diff --git a/source/blender/python/api2_2x/doc/BGL.py b/source/blender/python/api2_2x/doc/BGL.py
deleted file mode 100644
index 4a10de4a05c..00000000000
--- a/source/blender/python/api2_2x/doc/BGL.py
+++ /dev/null
@@ -1,1778 +0,0 @@
-# Blender.BGL module (OpenGL wrapper)
-
-"""
-The Blender.BGL submodule (the OpenGL wrapper).
-
-B{New}: some GLU functions: L{gluLookAt}, etc.
-
-The Blender.BGL submodule
-=========================
-
-This module wraps OpenGL constants and functions, making them available from
-within Blender Python.
-
-The complete list can be retrieved from the module itself, by listing its
-contents: dir(Blender.BGL). A simple search on the net can point to more
-than enough material to teach OpenGL programming, from books to many
-collections of tutorials.
-
-The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
-OpenGL}" and the online NeHe tutorials are two of the best resources.
-
-Example::
- import Blender
- from Blender.BGL import *
- from Blender import Draw
- R = G = B = 0
- A = 1
- title = "Testing BGL + Draw"
- instructions = "Use mouse buttons or wheel to change the background color."
- quitting = " Press ESC or q to quit."
- len1 = Draw.GetStringWidth(title)
- len2 = Draw.GetStringWidth(instructions + quitting)
- #
- def show_win():
- glClearColor(R,G,B,A) # define color used to clear buffers
- glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer
- glColor3f(0.35,0.18,0.92) # define default color
- glBegin(GL_POLYGON) # begin a vertex data list
- glVertex2i(165, 158)
- glVertex2i(252, 55)
- glVertex2i(104, 128)
- glEnd()
- glColor3f(0.4,0.4,0.4) # change default color
- glRecti(40, 96, 60+len1, 113)
- glColor3f(1,1,1)
- glRasterPos2i(50,100) # move cursor to x = 50, y = 100
- Draw.Text(title) # draw this text there
- glRasterPos2i(350,40) # move cursor again
- Draw.Text(instructions + quitting) # draw another msg
- glBegin(GL_LINE_LOOP) # begin a vertex-data list
- glVertex2i(46,92)
- glVertex2i(120,92)
- glVertex2i(120,115)
- glVertex2i(46,115)
- glEnd() # close this list
- #
- def ev(evt, val): # event callback for Draw.Register()
- global R,G,B,A # ... it handles input events
- if evt == Draw.ESCKEY or evt == Draw.QKEY:
- Draw.Exit() # this quits the script
- elif not val: return
- elif evt == Draw.LEFTMOUSE: R = 1 - R
- elif evt == Draw.MIDDLEMOUSE: G = 1 - G
- elif evt == Draw.RIGHTMOUSE: B = 1 - B
- elif evt == Draw.WHEELUPMOUSE:
- R += 0.1
- if R > 1: R = 1
- elif evt == Draw.WHEELDOWNMOUSE:
- R -= 0.1
- if R < 0: R = 0
- else:
- return # don't redraw if nothing changed
- Draw.Redraw(1) # make changes visible.
- #
- Draw.Register(show_win, ev, None) # start the main loop
-
-@note: you can use the L{Image} module and L{Image.Image} BPy object to load
- and set textures. See L{Image.Image.glLoad} and L{Image.Image.glFree},
- for example.
-@see: U{www.opengl.org}
-@see: U{nehe.gamedev.net}
-"""
-
-def glAccum(op, value):
- """
- Operate on the accumulation buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/accum.html}
-
- @type op: Enumerated constant
- @param op: The accumulation buffer operation.
- @type value: float
- @param value: a value used in the accumulation buffer operation.
- """
-
-def glAlphaFunc(func, ref):
- """
- Specify the alpha test function
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/alphafunc.html}
-
- @type func: Enumerated constant
- @param func: Specifies the alpha comparison function.
- @type ref: float
- @param ref: The reference value that incoming alpha values are compared to.
- Clamped between 0 and 1.
- """
-
-def glAreTexturesResident(n, textures, residences):
- """
- Determine if textures are loaded in texture memory
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/aretexturesresident.html}
-
- @type n: int
- @param n: Specifies the number of textures to be queried.
- @type textures: Buffer object I{type GL_INT}
- @param textures: Specifies an array containing the names of the textures to be queried
- @type residences: Buffer object I{type GL_INT}(boolean)
- @param residences: An array in which the texture residence status in returned.The residence status of a
- texture named by an element of textures is returned in the corresponding element of residences.
- """
-
-def glBegin(mode):
- """
- Delimit the vertices of a primitive or a group of like primatives
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies the primitive that will be create from vertices between glBegin and
- glEnd.
- """
-
-def glBindTexture(target, texture):
- """
- Bind a named texture to a texturing target
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bindtexture.html}
-
- @type target: Enumerated constant
- @param target: Specifies the target to which the texture is bound.
- @type texture: unsigned int
- @param texture: Specifies the name of a texture.
- """
-
-def glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap):
- """
- Draw a bitmap
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/bitmap.html}
-
- @type width, height: int
- @param width, height: Specify the pixel width and height of the bitmap image.
- @type xorig, yorig: float
- @param xorig, yorig: Specify the location of the origin in the bitmap image. The origin is measured
- from the lower left corner of the bitmap, with right and up being the positive axes.
- @type xmove, ymove: float
- @param xmove, ymove: Specify the x and y offsets to be added to the current raster position after
- the bitmap is drawn.
- @type bitmap: Buffer object I{type GL_BYTE}
- @param bitmap: Specifies the address of the bitmap image.
- """
-
-def glBlendFunc(sfactor, dfactor):
- """
- Specify pixel arithmetic
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/blendfunc.html}
-
- @type sfactor: Enumerated constant
- @param sfactor: Specifies how the red, green, blue, and alpha source blending factors are
- computed.
- @type dfactor: Enumerated constant
- @param dfactor: Specifies how the red, green, blue, and alpha destination blending factors are
- computed.
- """
-
-def glCallList(list):
- """
- Execute a display list
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllist.html}
-
- @type list: unsigned int
- @param list: Specifies the integer name of the display list to be executed.
- """
-
-def glCallLists(n, type, lists):
- """
- Execute a list of display lists
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/calllists.html}
-
- @type n: int
- @param n: Specifies the number of display lists to be executed.
- @type type: Enumerated constant
- @param type: Specifies the type of values in lists.
- @type lists: Buffer object
- @param lists: Specifies the address of an array of name offsets in the display list.
- The pointer type is void because the offsets can be bytes, shorts, ints, or floats,
- depending on the value of type.
- """
-
-def glClear(mask):
- """
- Clear buffers to preset values
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clear.html}
-
- @type mask: Enumerated constant(s)
- @param mask: Bitwise OR of masks that indicate the buffers to be cleared.
- """
-
-def glClearAccum(red, green, blue, alpha):
- """
- Specify clear values for the accumulation buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearaccum.html}
-
- @type red, green, blue, alpha: float
- @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
- accumulation buffer is cleared. The initial values are all 0.
- """
-
-def glClearColor(red, green, blue, alpha):
- """
- Specify clear values for the color buffers
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearcolor.html}
-
- @type red, green, blue, alpha: float
- @param red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
- color buffers are cleared. The initial values are all 0.
- """
-
-def glClearDepth(depth):
- """
- Specify the clear value for the depth buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cleardepth.html}
-
- @type depth: int
- @param depth: Specifies the depth value used when the depth buffer is cleared.
- The initial value is 1.
- """
-
-def glClearIndex(c):
- """
- Specify the clear value for the color index buffers
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearindex.html}
-
- @type c: float
- @param c: Specifies the index used when the color index buffers are cleared.
- The initial value is 0.
- """
-
-def glClearStencil(s):
- """
- Specify the clear value for the stencil buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clearstencil.html}
-
- @type s: int
- @param s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
- """
-
-def glClipPlane (plane, equation):
- """
- Specify a plane against which all geometry is clipped
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/clipplane.html}
-
- @type plane: Enumerated constant
- @param plane: Specifies which clipping plane is being positioned.
- @type equation: Buffer object I{type GL_FLOAT}(double)
- @param equation: Specifies the address of an array of four double- precision floating-point
- values. These values are interpreted as a plane equation.
- """
-
-def glColor (red, green, blue, alpha):
- """
- B{glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us,
- glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us,
- glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv,
- glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv,
- glColor4uiv, glColor4usv}
-
- Set a new color.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/color.html}
-
- @type red, green, blue, alpha: Depends on function prototype.
- @param red, green, blue: Specify new red, green, and blue values for the current color.
- @param alpha: Specifies a new alpha value for the current color. Included only in the
- four-argument glColor4 commands. (With '4' colors only)
- """
-
-def glColorMask(red, green, blue, alpha):
- """
- Enable and disable writing of frame buffer color components
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormask.html}
-
- @type red, green, blue, alpha: int (boolean)
- @param red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
- written into the frame buffer. The initial values are all GL_TRUE, indicating that the
- color components can be written.
- """
-
-def glColorMaterial(face, mode):
- """
- Cause a material color to track the current color
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html}
-
- @type face: Enumerated constant
- @param face: Specifies whether front, back, or both front and back material parameters should
- track the current color.
- @type mode: Enumerated constant
- @param mode: Specifies which of several material parameters track the current color.
- """
-
-def glCopyPixels(x, y, width, height, type):
- """
- Copy pixels in the frame buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/copypixels.html}
-
- @type x, y: int
- @param x, y: Specify the window coordinates of the lower left corner of the rectangular
- region of pixels to be copied.
- @type width, height: int
- @param width,height: Specify the dimensions of the rectangular region of pixels to be copied.
- Both must be non-negative.
- @type type: Enumerated constant
- @param type: Specifies whether color values, depth values, or stencil values are to be copied.
- """
-
-def glCullFace(mode):
- """
- Specify whether front- or back-facing facets can be culled
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/cullface.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies whether front- or back-facing facets are candidates for culling.
- """
-
-def glDeleteLists(list, range):
- """
- Delete a contiguous group of display lists
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletelists.html}
-
- @type list: unsigned int
- @param list: Specifies the integer name of the first display list to delete
- @type range: int
- @param range: Specifies the number of display lists to delete
- """
-
-def glDeleteTextures(n, textures):
- """
- Delete named textures
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/deletetextures.html}
-
- @type n: int
- @param n: Specifies the number of textures to be deleted
- @type textures: Buffer I{GL_INT}
- @param textures: Specifies an array of textures to be deleted
- """
-
-def glDepthFunc(func):
- """
- Specify the value used for depth buffer comparisons
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthfunc.html}
-
- @type func: Enumerated constant
- @param func: Specifies the depth comparison function.
- """
-
-def glDepthMask(flag):
- """
- Enable or disable writing into the depth buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthmask.html}
-
- @type flag: int (boolean)
- @param flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
- depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer
- writing is enabled.
- """
-
-def glDepthRange(zNear, zFar):
- """
- Specify mapping of depth values from normalized device coordinates to window coordinates
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/depthrange.html}
-
- @type zNear: int
- @param zNear: Specifies the mapping of the near clipping plane to window coordinates.
- The initial value is 0.
- @type zFar: int
- @param zFar: Specifies the mapping of the far clipping plane to window coordinates.
- The initial value is 1.
- """
-
-def glDisable(cap):
- """
- Disable server-side GL capabilities
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
-
- @type cap: Enumerated constant
- @param cap: Specifies a symbolic constant indicating a GL capability.
- """
-
-def glDrawBuffer(mode):
- """
- Specify which color buffers are to be drawn into
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawbuffer.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies up to four color buffers to be drawn into.
- """
-
-def glDrawPixels(width, height, format, type, pixels):
- """
- Write a block of pixels to the frame buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html}
-
- @type width, height: int
- @param width, height: Specify the dimensions of the pixel rectangle to be
- written into the frame buffer.
- @type format: Enumerated constant
- @param format: Specifies the format of the pixel data.
- @type type: Enumerated constant
- @param type: Specifies the data type for pixels.
- @type pixels: Buffer object
- @param pixels: Specifies a pointer to the pixel data.
- """
-
-def glEdgeFlag (flag):
- """
- B{glEdgeFlag, glEdgeFlagv}
-
- Flag edges as either boundary or non-boundary
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/edgeflag.html}
-
- @type flag: Depends of function prototype
- @param flag: Specifies the current edge flag value.The initial value is GL_TRUE.
- """
-
-def glEnable(cap):
- """
- Enable server-side GL capabilities
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/enable.html}
-
- @type cap: Enumerated constant
- @param cap: Specifies a symbolic constant indicating a GL capability.
- """
-
-def glEnd():
- """
- Delimit the vertices of a primitive or group of like primitives
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html}
- """
-
-def glEndList():
- """
- Create or replace a display list
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
- """
-
-def glEvalCoord (u,v):
- """
- B{glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv,
- glEvalCoord2dv, glEvalCoord2fv}
-
- Evaluate enabled one- and two-dimensional maps
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalcoord.html}
-
- @type u: Depends on function prototype.
- @param u: Specifies a value that is the domain coordinate u to the basis function defined
- in a previous glMap1 or glMap2 command. If the function prototype ends in 'v' then
- u specifies a pointer to an array containing either one or two domain coordinates. The first
- coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions.
- @type v: Depends on function prototype. (only with '2' prototypes)
- @param v: Specifies a value that is the domain coordinate v to the basis function defined
- in a previous glMap2 command. This argument is not present in a glEvalCoord1 command.
- """
-
-def glEvalMesh (mode, i1, i2):
- """
- B{glEvalMesh1 or glEvalMesh2}
-
- Compute a one- or two-dimensional grid of points or lines
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalmesh.html}
-
- @type mode: Enumerated constant
- @param mode: In glEvalMesh1, specifies whether to compute a one-dimensional
- mesh of points or lines.
- @type i1, i2: int
- @param i1, i2: Specify the first and last integer values for the grid domain variable i.
- """
-
-def glEvalPoint (i, j):
- """
- B{glEvalPoint1 and glEvalPoint2}
-
- Generate and evaluate a single point in a mesh
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/evalpoint.html}
-
- @type i: int
- @param i: Specifies the integer value for grid domain variable i.
- @type j: int (only with '2' prototypes)
- @param j: Specifies the integer value for grid domain variable j (glEvalPoint2 only).
- """
-
-def glFeedbackBuffer (size, type, buffer):
- """
- Controls feedback mode
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/feedbackbuffer.html}
-
- @type size: int
- @param size:Specifies the maximum number of values that can be written into buffer.
- @type type: Enumerated constant
- @param type:Specifies a symbolic constant that describes the information that
- will be returned for each vertex.
- @type buffer: Buffer object I{GL_FLOAT}
- @param buffer: Returns the feedback data.
- """
-
-def glFinish():
- """
- Block until all GL execution is complete
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/finish.html}
- """
-
-def glFlush():
- """
- Force Execution of GL commands in finite time
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/flush.html}
- """
-
-def glFog (pname, param):
- """
- B{glFogf, glFogi, glFogfv, glFogiv}
-
- Specify fog parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/fog.html}
-
- @type pname: Enumerated constant
- @param pname: Specifies a single-valued fog parameter. If the function prototype
- ends in 'v' specifies a fog parameter.
- @type param: Depends on function prototype.
- @param param: Specifies the value or values to be assigned to pname. GL_FOG_COLOR
- requires an array of four values. All other parameters accept an array containing
- only a single value.
- """
-
-def glFrontFace(mode):
- """
- Define front- and back-facing polygons
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies the orientation of front-facing polygons.
- """
-
-def glFrustum(left, right, bottom, top, zNear, zFar):
- """
- Multiply the current matrix by a perspective matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frustum.html}
-
- @type left, right: double (float)
- @param left, right: Specify the coordinates for the left and right vertical
- clipping planes.
- @type top, bottom: double (float)
- @param top, bottom: Specify the coordinates for the bottom and top horizontal
- clipping planes.
- @type zNear, zFar: double (float)
- @param zNear, zFar: Specify the distances to the near and far depth clipping planes.
- Both distances must be positive.
- """
-
-def glGenLists(range):
- """
- Generate a contiguous set of empty display lists
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/genlists.html}
-
- @type range: int
- @param range: Specifies the number of contiguous empty display lists to be generated.
- """
-
-def glGenTextures(n, textures):
- """
- Generate texture names
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html}
-
- @type n: int
- @param n: Specifies the number of textures name to be generated.
- @type textures: Buffer object I{type GL_INT}
- @param textures: Specifies an array in which the generated textures names are stored.
- """
-
-def glGet (pname, param):
- """
- B{glGetBooleanv, glGetfloatv, glGetFloatv, glGetIntegerv}
-
- Return the value or values of a selected parameter
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html}
-
- @type pname: Enumerated constant
- @param pname: Specifies the parameter value to be returned.
- @type param: Depends on function prototype.
- @param param: Returns the value or values of the specified parameter.
- """
-
-def glGetClipPlane(plane, equation):
- """
- Return the coefficients of the specified clipping plane
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getclipplane.html}
-
- @type plane: Enumerated constant
- @param plane: Specifies a clipping plane. The number of clipping planes depends on the
- implementation, but at least six clipping planes are supported. They are identified by
- symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES.
- @type equation: Buffer object I{type GL_FLOAT}
- @param equation: Returns four float (double)-precision values that are the coefficients of the
- plane equation of plane in eye coordinates. The initial value is (0, 0, 0, 0).
- """
-
-def glGetError():
- """
- Return error information
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/geterror.html}
- """
-
-def glGetLight (light, pname, params):
- """
- B{glGetLightfv and glGetLightiv}
-
- Return light source parameter values
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getlight.html}
-
- @type light: Enumerated constant
- @param light: Specifies a light source. The number of possible lights depends on the
- implementation, but at least eight lights are supported. They are identified by symbolic
- names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS.
- @type pname: Enumerated constant
- @param pname: Specifies a light source parameter for light.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the requested data.
- """
-
-def glGetMap (target, query, v):
- """
- B{glGetMapdv, glGetMapfv, glGetMapiv}
-
- Return evaluator parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmap.html}
-
- @type target: Enumerated constant
- @param target: Specifies the symbolic name of a map.
- @type query: Enumerated constant
- @param query: Specifies which parameter to return.
- @type v: Buffer object. Depends on function prototype.
- @param v: Returns the requested data.
- """
-
-def glGetMaterial (face, pname, params):
- """
- B{glGetMaterialfv, glGetMaterialiv}
-
- Return material parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getmaterial.html}
-
- @type face: Enumerated constant
- @param face: Specifies which of the two materials is being queried.
- representing the front and back materials, respectively.
- @type pname: Enumerated constant
- @param pname: Specifies the material parameter to return.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the requested data.
- """
-
-def glGetPixelMap (map, values):
- """
- B{glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv}
-
- Return the specified pixel map
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpixelmap.html}
-
- @type map: Enumerated constant
- @param map: Specifies the name of the pixel map to return.
- @type values: Buffer object. Depends on function prototype.
- @param values: Returns the pixel map contents.
- """
-
-def glGetPolygonStipple(mask):
- """
- Return the polygon stipple pattern
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getpolygonstipple.html}
-
- @type mask: Buffer object I{type GL_BYTE}
- @param mask: Returns the stipple pattern. The initial value is all 1's.
- """
-
-def glGetString(name):
- """
- Return a string describing the current GL connection
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html}
-
- @type name: Enumerated constant
- @param name: Specifies a symbolic constant.
-
- """
-
-def glGetTexEnv (target, pname, params):
- """
- B{glGetTexEnvfv, glGetTexEnviv}
-
- Return texture environment parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexenv.html}
-
- @type target: Enumerated constant
- @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of a texture environment parameter.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the requested data.
- """
-
-def glGetTexGen (coord, pname, params):
- """
- B{glGetTexGendv, glGetTexGenfv, glGetTexGeniv}
-
- Return texture coordinate generation parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexgen.html}
-
- @type coord: Enumerated constant
- @param coord: Specifies a texture coordinate.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of the value(s) to be returned.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the requested data.
- """
-
-def glGetTexImage(target, level, format, type, pixels):
- """
- Return a texture image
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getteximage.html}
-
- @type target: Enumerated constant
- @param target: Specifies which texture is to be obtained.
- @type level: int
- @param level: Specifies the level-of-detail number of the desired image.
- Level 0 is the base image level. Level n is the nth mipmap reduction image.
- @type format: Enumerated constant
- @param format: Specifies a pixel format for the returned data.
- @type type: Enumerated constant
- @param type: Specifies a pixel type for the returned data.
- @type pixels: Buffer object.
- @param pixels: Returns the texture image. Should be a pointer to an array of the
- type specified by type
- """
-
-def glGetTexLevelParameter (target, level, pname, params):
- """
- B{glGetTexLevelParameterfv, glGetTexLevelParameteriv}
-
- return texture parameter values for a specific level of detail
- @see: U{opengl.org/developers/documentation/man_pages/hardcopy/GL/html/gl/gettexlevelparameter.html}
-
- @type target: Enumerated constant
- @param target: Specifies the symbolic name of the target texture.
- @type level: int
- @param level: Specifies the level-of-detail number of the desired image.
- Level 0 is the base image level. Level n is the nth mipmap reduction image.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of a texture parameter.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the requested data.
- """
-
-def glGetTexParameter (target, pname, params):
- """
- B{glGetTexParameterfv, glGetTexParameteriv}
-
- Return texture parameter values
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gettexparameter.html}
-
- @type target: Enumerated constant
- @param target: Specifies the symbolic name of the target texture.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name the target texture.
- @type params: Buffer object. Depends on function prototype.
- @param params: Returns the texture parameters.
- """
-
-def glHint(target, mode):
- """
- Specify implementation-specific hints
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/hint.html}
-
- @type target: Enumerated constant
- @param target: Specifies a symbolic constant indicating the behavior to be
- controlled.
- @type mode: Enumerated constant
- @param mode: Specifies a symbolic constant indicating the desired behavior.
- """
-
-def glIndex (c):
- """
- B{glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv}
-
- Set the current color index
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/index_.html}
-
- @type c: Buffer object. Depends on function prototype.
- @param c: Specifies a pointer to a one element array that contains the new value for
- the current color index.
- """
-
-def glInitNames():
- """
- Initialize the name stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/initnames.html}
- """
-
-def glIsEnabled(cap):
- """
- Test whether a capability is enabled
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/isenabled.html}
-
- @type cap: Enumerated constant
- @param cap: Specifies a constant representing a GL capability.
- """
-
-def glIsList(list):
- """
- Determine if a name corresponds to a display-list
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/islist.html}
-
- @type list: unsigned int
- @param list: Specifies a potential display-list name.
- """
-
-def glIsTexture(texture):
- """
- Determine if a name corresponds to a texture
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/istexture.html}
-
- @type texture: unsigned int
- @param texture: Specifies a value that may be the name of a texture.
- """
-
-def glLight (light, pname, param):
- """
- B{glLightf,glLighti, glLightfv, glLightiv}
-
- Set the light source parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/light.html}
-
- @type light: Enumerated constant
- @param light: Specifies a light. The number of lights depends on the implementation,
- but at least eight lights are supported. They are identified by symbolic names of the
- form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS.
- @type pname: Enumerated constant
- @param pname: Specifies a single-valued light source parameter for light.
- @type param: Depends on function prototype.
- @param param: Specifies the value that parameter pname of light source light will be set to.
- If function prototype ends in 'v' specifies a pointer to the value or values that
- parameter pname of light source light will be set to.
- """
-
-def glLightModel (pname, param):
- """
- B{glLightModelf, glLightModeli, glLightModelfv, glLightModeliv}
-
- Set the lighting model parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/lightmodel.html}
-
- @type pname: Enumerated constant
- @param pname: Specifies a single-value light model parameter.
- @type param: Depends on function prototype.
- @param param: Specifies the value that param will be set to. If function prototype ends in 'v'
- specifies a pointer to the value or values that param will be set to.
- """
-
-def glLineStipple(factor, pattern):
- """
- Specify the line stipple pattern
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linestipple.html}
-
- @type factor: int
- @param factor: Specifies a multiplier for each bit in the line stipple pattern.
- If factor is 3, for example, each bit in the pattern is used three times before
- the next bit in the pattern is used. factor is clamped to the range [1, 256] and
- defaults to 1.
- @type pattern: unsigned short int
- @param pattern: Specifies a 16-bit integer whose bit pattern determines which fragments
- of a line will be drawn when the line is rasterized. Bit zero is used first; the default
- pattern is all 1's.
- """
-
-def glLineWidth(width):
- """
- Specify the width of rasterized lines.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/linewidth.html}
-
- @type width: float
- @param width: Specifies the width of rasterized lines. The initial value is 1.
- """
-
-def glListBase(base):
- """
- Set the display-list base for glCallLists
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/listbase.html}
-
- @type base: unsigned int
- @param base: Specifies an integer offset that will be added to glCallLists
- offsets to generate display-list names. The initial value is 0.
- """
-
-def glLoadIdentity():
- """
- Replace the current matrix with the identity matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadidentity.html}
- """
-
-def glLoadMatrix (m):
- """
- B{glLoadMatrixd, glLoadMatixf}
-
- Replace the current matrix with the specified matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadmatrix.html}
-
- @type m: Buffer object. Depends on function prototype.
- @param m: Specifies a pointer to 16 consecutive values, which are used as the elements
- of a 4x4 column-major matrix.
- """
-
-def glLoadName(name):
- """
- Load a name onto the name stack.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/loadname.html}
-
- @type name: unsigned int
- @param name: Specifies a name that will replace the top value on the name stack.
- """
-
-def glLogicOp(opcode):
- """
- Specify a logical pixel operation for color index rendering
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/logicop.html}
-
- @type opcode: Enumerated constant
- @param opcode: Specifies a symbolic constant that selects a logical operation.
- """
-
-def glMap1 (target, u1, u2, stride, order, points):
- """
- B{glMap1d, glMap1f}
-
- Define a one-dimensional evaluator
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map1.html}
-
- @type target: Enumerated constant
- @param target: Specifies the kind of values that are generated by the evaluator.
- @type u1, u2: Depends on function prototype.
- @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord1, to ^, t
- he variable that is evaluated by the equations specified by this command.
- @type stride: int
- @param stride: Specifies the number of floats or float (double)s between the beginning
- of one control point and the beginning of the next one in the data structure
- referenced in points. This allows control points to be embedded in arbitrary data
- structures. The only constraint is that the values for a particular control point must
- occupy contiguous memory locations.
- @type order: int
- @param order: Specifies the number of control points. Must be positive.
- @type points: Buffer object. Depends on function prototype.
- @param points: Specifies a pointer to the array of control points.
- """
-
-def glMap2 (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points):
- """
- B{glMap2d, glMap2f}
-
- Define a two-dimensional evaluator
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/map2.html}
-
- @type target: Enumerated constant
- @param target: Specifies the kind of values that are generated by the evaluator.
- @type u1, u2: Depends on function prototype.
- @param u1,u2: Specify a linear mapping of u, as presented to glEvalCoord2, to ^, t
- he variable that is evaluated by the equations specified by this command. Initially
- u1 is 0 and u2 is 1.
- @type ustride: int
- @param ustride: Specifies the number of floats or float (double)s between the beginning
- of control point R and the beginning of control point R ij, where i and j are the u
- and v control point indices, respectively. This allows control points to be embedded
- in arbitrary data structures. The only constraint is that the values for a particular
- control point must occupy contiguous memory locations. The initial value of ustride is 0.
- @type uorder: int
- @param uorder: Specifies the dimension of the control point array in the u axis.
- Must be positive. The initial value is 1.
- @type v1, v2: Depends on function prototype.
- @param v1, v2: Specify a linear mapping of v, as presented to glEvalCoord2, to ^,
- one of the two variables that are evaluated by the equations specified by this command.
- Initially, v1 is 0 and v2 is 1.
- @type vstride: int
- @param vstride: Specifies the number of floats or float (double)s between the beginning of control
- point R and the beginning of control point R ij, where i and j are the u and v control
- point(indices, respectively. This allows control points to be embedded in arbitrary data
- structures. The only constraint is that the values for a particular control point must
- occupy contiguous memory locations. The initial value of vstride is 0.
- @type vorder: int
- @param vorder: Specifies the dimension of the control point array in the v axis.
- Must be positive. The initial value is 1.
- @type points: Buffer object. Depends on function prototype.
- @param points: Specifies a pointer to the array of control points.
- """
-
-def glMapGrid (un, u1,u2 ,vn, v1, v2):
- """
- B{glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f}
-
- Define a one- or two-dimensional mesh
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/mapgrid.html}
-
- @type un: int
- @param un: Specifies the number of partitions in the grid range interval
- [u1, u2]. Must be positive.
- @type u1, u2: Depends on function prototype.
- @param u1, u2: Specify the mappings for integer grid domain values i=0 and i=un.
- @type vn: int
- @param vn: Specifies the number of partitions in the grid range interval [v1, v2]
- (glMapGrid2 only).
- @type v1, v2: Depends on function prototype.
- @param v1, v2: Specify the mappings for integer grid domain values j=0 and j=vn
- (glMapGrid2 only).
- """
-
-def glMaterial (face, pname, params):
- """
- Specify material parameters for the lighting model.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/material.html}
-
- @type face: Enumerated constant
- @param face: Specifies which face or faces are being updated. Must be one of:
- @type pname: Enumerated constant
- @param pname: Specifies the single-valued material parameter of the face
- or faces that is being updated. Must be GL_SHININESS.
- @type params: int
- @param params: Specifies the value that parameter GL_SHININESS will be set to.
- If function prototype ends in 'v' specifies a pointer to the value or values that
- pname will be set to.
- """
-
-def glMatrixMode(mode):
- """
- Specify which matrix is the current matrix.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/matrixmode.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies which matrix stack is the target for subsequent matrix operations.
- """
-
-def glMultMatrix (m):
- """
- B{glMultMatrixd, glMultMatrixf}
-
- Multiply the current matrix with the specified matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/multmatrix.html}
-
- @type m: Buffer object. Depends on function prototype.
- @param m: Points to 16 consecutive values that are used as the elements of a 4x4 column
- major matrix.
- """
-
-def glNewList(list, mode):
- """
- Create or replace a display list
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/newlist.html}
-
- @type list: unsigned int
- @param list: Specifies the display list name
- @type mode: Enumerated constant
- @param mode: Specifies the compilation mode.
- """
-
-def glNormal3 (nx, ny, nz, v):
- """
- B{Normal3b, Normal3bv, Normal3d, Normal3dv, Normal3f, Normal3fv, Normal3i, Normal3iv,
- Normal3s, Normal3sv}
-
- Set the current normal vector
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/normal.html}
-
- @type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
- @param nx, ny, nz: Specify the x, y, and z coordinates of the new current normal.
- The initial value of the current normal is the unit vector, (0, 0, 1).
- @type v: Buffer object. Depends on function prototype. ('v' prototypes)
- @param v: Specifies a pointer to an array of three elements: the x, y, and z coordinates
- of the new current normal.
- """
-
-def glOrtho(left, right, bottom, top, zNear, zFar):
- """
- Multiply the current matrix with an orthographic matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/ortho.html}
-
- @type left, right: double (float)
- @param left, right: Specify the coordinates for the left and
- right vertical clipping planes.
- @type bottom, top: double (float)
- @param bottom, top: Specify the coordinates for the bottom and top
- horizontal clipping planes.
- @type zNear, zFar: double (float)
- @param zNear, zFar: Specify the distances to the nearer and farther
- depth clipping planes. These values are negative if the plane is to be behind the viewer.
- """
-
-def glPassThrough(token):
- """
- Place a marker in the feedback buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/passthrough.html}
-
- @type token: float
- @param token: Specifies a marker value to be placed in the feedback
- buffer following a GL_PASS_THROUGH_TOKEN.
- """
-
-def glPixelMap (map, mapsize, values):
- """
- B{glPixelMapfv, glPixelMapuiv, glPixelMapusv}
-
- Set up pixel transfer maps
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelmap.html}
-
- @type map: Enumerated constant
- @param map: Specifies a symbolic map name.
- @type mapsize: int
- @param mapsize: Specifies the size of the map being defined.
- @type values: Buffer object. Depends on function prototype.
- @param values: Specifies an array of mapsize values.
- """
-
-def glPixelStore (pname, param):
- """
- B{glPixelStoref, glPixelStorei}
-
- Set pixel storage modes
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelstore.html}
-
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of the parameter to be set.
- Six values affect the packing of pixel data into memory.
- Six more affect the unpacking of pixel data from memory.
- @type param: Depends on function prototype.
- @param param: Specifies the value that pname is set to.
- """
-
-def glPixelTransfer (pname, param):
- """
- B{glPixelTransferf, glPixelTransferi}
-
- Set pixel transfer modes
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixeltransfer.html}
-
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of the pixel transfer parameter to be set.
- @type param: Depends on function prototype.
- @param param: Specifies the value that pname is set to.
- """
-
-def glPixelZoom(xfactor, yfactor):
- """
- Specify the pixel zoom factors
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pixelzoom.html}
-
- @type xfactor, yfactor: float
- @param xfactor, yfactor: Specify the x and y zoom factors for pixel write operations.
- """
-
-def glPointSize(size):
- """
- Specify the diameter of rasterized points
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pointsize.html}
-
- @type size: float
- @param size: Specifies the diameter of rasterized points. The initial value is 1.
- """
-
-def glPolygonMode(face, mode):
- """
- Select a polygon rasterization mode
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html}
-
- @type face: Enumerated constant
- @param face: Specifies the polygons that mode applies to.
- Must be GL_FRONT for front-facing polygons, GL_BACK for back- facing polygons,
- or GL_FRONT_AND_BACK for front- and back-facing polygons.
- @type mode: Enumerated constant
- @param mode: Specifies how polygons will be rasterized.
- The initial value is GL_FILL for both front- and back- facing polygons.
- """
-
-def glPolygonOffset(factor, units):
- """
- Set the scale and units used to calculate depth values
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonoffset.html}
-
- @type factor: float
- @param factor: Specifies a scale factor that is used to create a variable depth
- offset for each polygon. The initial value is 0.
- @type units: float
- @param units: Is multiplied by an implementation-specific value to create a constant
- depth offset. The initial value is 0.
- """
-
-def glPolygonStipple(mask):
- """
- Set the polygon stippling pattern
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonstipple.html}
-
- @type mask: Buffer object I{type GL_BYTE}
- @param mask: Specifies a pointer to a 32x32 stipple pattern that will be unpacked
- from memory in the same way that glDrawPixels unpacks pixels.
- """
-
-def glPopAttrib():
- """
- Pop the server attribute stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
- """
-
-def glPopClientAttrib():
- """
- Pop the client attribute stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html}
- """
-
-def glPopMatrix():
- """
- Pop the current matrix stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
- """
-
-def glPopName():
- """
- Pop the name stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
- """
-
-def glPrioritizeTextures(n, textures, priorities):
- """
- Set texture residence priority
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/prioritizetextures.html}
-
- @type n: int
- @param n:Specifies the number of textures to be prioritized.
- @type textures: Buffer I{type GL_INT}
- @param textures: Specifies an array containing the names of the textures to be prioritized.
- @type priorities: Buffer I{type GL_FLOAT}
- @param priorities: Specifies an array containing the texture priorities. A priority given
- in an element of priorities applies to the texture named by the corresponding element of textures.
- """
-
-def glPushAttrib(mask):
- """
- Push the server attribute stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html}
-
- @type mask: Enumerated constant(s)
- @param mask: Specifies a mask that indicates which attributes to save.
- """
-
-def glPushClientAttrib(mask):
- """
- Push the client attribute stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushclientattrib.html}
-
- @type mask: Enumerated constant(s)
- @param mask: Specifies a mask that indicates which attributes to save.
- """
-
-def glPushMatrix():
- """
- Push the current matrix stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushmatrix.html}
- """
-
-def glPushName(name):
- """
- Push the name stack
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushname.html}
-
- @type name: unsigned int
- @param name: Specifies a name that will be pushed onto the name stack.
- """
-
-def glRasterPos (x,y,z,w):
- """
- B{glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d,
- glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f,
- glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv,
- glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv,
- glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv}
-
- Specify the raster position for pixel operations
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rasterpos.html}
-
- @type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
- @param x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the
- raster position. If function prototype ends in 'v' specifies a pointer to an array of two,
- three, or four elements, specifying x, y, z, and w coordinates, respectively.
- @note:
- If you are drawing to the 3d view with a Scriptlink of a space handler
- the zoom level of the panels will scale the glRasterPos by the view matrix.
- so a X of 10 will not always offset 10 pixels as you would expect.
-
- To work around this get the scale value of the view matrix and use it to scale your pixel values.
-
- Workaround::
-
- import Blender
- from Blender.BGL import *
- xval, yval= 100, 40
- # Get the scale of the view matrix
- viewMatrix = Buffer(GL_FLOAT, 16)
- glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix)
- f = 1/viewMatrix[0]
- glRasterPos2f(xval*f, yval*f) # Instead of the usual glRasterPos2i(xval, yval)
- """
-
-def glReadBuffer(mode):
- """
- Select a color buffer source for pixels.
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readbuffer.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies a color buffer.
- """
-
-def glReadPixels(x, y, width, height, format, type, pixels):
- """
- Read a block of pixels from the frame buffer
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html}
-
- @type x, y: int
- @param x, y:Specify the window coordinates of the first pixel that is read
- from the frame buffer. This location is the lower left corner of a rectangular
- block of pixels.
- @type width, height: int
- @param width, height: Specify the dimensions of the pixel rectangle. width and
- height of one correspond to a single pixel.
- @type format: Enumerated constant
- @param format: Specifies the format of the pixel data.
- @type type: Enumerated constant
- @param type: Specifies the data type of the pixel data.
- @type pixels: Buffer object
- @param pixels: Returns the pixel data.
- """
-
-def glRect (x1,y1,x2,y2,v1,v2):
- """
- B{glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv}
-
- Draw a rectangle
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rect.html}
-
- @type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
- @param x1, y1: Specify one vertex of a rectangle
- @type x2, y2: Depends on function prototype. (for non 'v' prototypes only)
- @param x2, y2: Specify the opposite vertex of the rectangle
- @type v1, v2: Depends on function prototype. (for 'v' prototypes only)
- @param v1, v2: Specifies a pointer to one vertex of a rectangle and the pointer
- to the opposite vertex of the rectangle
- """
-
-def glRenderMode(mode):
- """
- Set rasterization mode
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rendermode.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies the rasterization mode.
- """
-
-def glRotate (angle, x, y, z):
- """
- B{glRotated, glRotatef}
-
- Multiply the current matrix by a rotation matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/rotate.html}
-
- @type angle: Depends on function prototype.
- @param angle: Specifies the angle of rotation in degrees.
- @type x, y, z: Depends on function prototype.
- @param x, y, z: Specify the x, y, and z coordinates of a vector respectively.
- """
-
-def glScale (x,y,z):
- """
- B{glScaled, glScalef}
-
- Multiply the current matrix by a general scaling matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scale.html}
-
- @type x, y, z: Depends on function prototype.
- @param x, y, z: Specify scale factors along the x, y, and z axes, respectively.
- """
-
-def glScissor(x,y,width,height):
- """
- Define the scissor box
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/scissor.html}
-
- @type x, y: int
- @param x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
- @type width, height: int
- @param width height: Specify the width and height of the scissor box. When a
- GL context is first attached to a window, width and height are set to the
- dimensions of that window.
- """
-
-def glSelectBuffer(size, buffer):
- """
- Establish a buffer for selection mode values
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/selectbuffer.html}
-
- @type size: int
- @param size: Specifies the size of buffer
- @type buffer: Buffer I{type GL_INT}
- @param buffer: Returns the selection data
- """
-
-def glShadeModel(mode):
- """
- Select flat or smooth shading
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/shademodel.html}
-
- @type mode: Enumerated constant
- @param mode: Specifies a symbolic value representing a shading technique.
- """
-
-def glStencilFuc(func, ref, mask):
- """
- Set function and reference value for stencil testing
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilfunc.html}
-
- @type func: Enumerated constant
- @param func:Specifies the test function.
- @type ref: int
- @param ref:Specifies the reference value for the stencil test. ref is clamped to
- the range [0,2n-1], where n is the number of bitplanes in the stencil buffer.
- The initial value is 0.
- @type mask: unsigned int
- @param mask:Specifies a mask that is ANDed with both the reference value and
- the stored stencil value when the test is done. The initial value is all 1's.
- """
-
-def glStencilMask(mask):
- """
- Control the writing of individual bits in the stencil planes
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilmask.html}
-
- @type mask: unsigned int
- @param mask: Specifies a bit mask to enable and disable writing of individual bits
- in the stencil planes. Initially, the mask is all 1's.
- """
-
-def glStencilOp(fail, zfail, zpass):
- """
- Set stencil test actions
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/stencilop.html}
-
- @type fail: Enumerated constant
- @param fail: Specifies the action to take when the stencil test fails.
- The initial value is GL_KEEP.
- @type zfail: Enumerated constant
- @param zfail: Specifies the stencil action when the stencil test passes, but the
- depth test fails. zfail accepts the same symbolic constants as fail.
- The initial value is GL_KEEP.
- @type zpass: Enumerated constant
- @param zpass: Specifies the stencil action when both the stencil test and the
- depth test pass, or when the stencil test passes and either there is no depth
- buffer or depth testing is not enabled. zpass accepts the same symbolic constants
- as fail. The initial value is GL_KEEP.
- """
-
-def glTexCoord (s,t,r,q,v):
- """
- B{glTexCoord1d, glTexCoord1f, glTexCoord1i, glTexCoord1s, glTexCoord2d, glTexCoord2f,
- glTexCoord2i, glTexCoord2s, glTexCoord3d, glTexCoord3f, glTexCoord3i, glTexCoord3s,
- glTexCoord4d, glTexCoord4f, glTexCoord4i, glTexCoord4s, glTexCoord1dv, glTexCoord1fv,
- glTexCoord1iv, glTexCoord1sv, glTexCoord2dv, glTexCoord2fv, glTexCoord2iv,
- glTexCoord2sv, glTexCoord3dv, glTexCoord3fv, glTexCoord3iv, glTexCoord3sv,
- glTexCoord4dv, glTexCoord4fv, glTexCoord4iv, glTexCoord4sv}
-
- Set the current texture coordinates
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texcoord.html}
-
- @type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
- @param s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are
- present in all forms of the command.
- @type v: Buffer object. Depends on function prototype. (for 'v' prototypes only)
- @param v: Specifies a pointer to an array of one, two, three, or four elements,
- which in turn specify the s, t, r, and q texture coordinates.
- """
-
-def glTexEnv (target, pname, param):
- """
- B{glTextEnvf, glTextEnvi, glTextEnvfv, glTextEnviv}
-
- Set texture environment parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texenv.html}
-
- @type target: Enumerated constant
- @param target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of a single-valued texture environment
- parameter. Must be GL_TEXTURE_ENV_MODE.
- @type param: Depends on function prototype.
- @param param: Specifies a single symbolic constant. If function prototype ends in 'v'
- specifies a pointer to a parameter array that contains either a single symbolic
- constant or an RGBA color
- """
-
-def glTexGen (coord, pname, param):
- """
- B{glTexGend, glTexGenf, glTexGeni, glTexGendv, glTexGenfv, glTexGeniv}
-
- Control the generation of texture coordinates
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texgen.html}
-
- @type coord: Enumerated constant
- @param coord: Specifies a texture coordinate.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of the texture- coordinate generation function.
- @type param: Depends on function prototype.
- @param param: Specifies a single-valued texture generation parameter.
- If function prototype ends in 'v' specifies a pointer to an array of texture
- generation parameters. If pname is GL_TEXTURE_GEN_MODE, then the array must
- contain a single symbolic constant. Otherwise, params holds the coefficients
- for the texture-coordinate generation function specified by pname.
- """
-
-def glTexImage1D(target, level, internalformat, width, border, format, type, pixels):
- """
- Specify a one-dimensional texture image
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage1d.html}
-
- @type target: Enumerated constant
- @param target: Specifies the target texture.
- @type level: int
- @param level: Specifies the level-of-detail number. Level 0 is the base image level.
- Level n is the nth mipmap reduction image.
- @type internalformat: int
- @param internalformat: Specifies the number of color components in the texture.
- @type width: int
- @param width: Specifies the width of the texture image. Must be 2n+2(border) for
- some integer n. All implementations support texture images that are at least 64
- texels wide. The height of the 1D texture image is 1.
- @type border: int
- @param border: Specifies the width of the border. Must be either 0 or 1.
- @type format: Enumerated constant
- @param format: Specifies the format of the pixel data.
- @type type: Enumerated constant
- @param type: Specifies the data type of the pixel data.
- @type pixels: Buffer object.
- @param pixels: Specifies a pointer to the image data in memory.
- """
-
-def glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels):
- """
- Specify a two-dimensional texture image
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html}
-
- @type target: Enumerated constant
- @param target: Specifies the target texture.
- @type level: int
- @param level: Specifies the level-of-detail number. Level 0 is the base image level.
- Level n is the nth mipmap reduction image.
- @type internalformat: int
- @param internalformat: Specifies the number of color components in the texture.
- @type width: int
- @param width: Specifies the width of the texture image. Must be 2n+2(border) for
- some integer n. All implementations support texture images that are at least 64
- texels wide.
- @type height: int
- @param height: Specifies the height of the texture image. Must be 2m+2(border) for
- some integer m. All implementations support texture images that are at least 64
- texels high.
- @type border: int
- @param border: Specifies the width of the border. Must be either 0 or 1.
- @type format: Enumerated constant
- @param format: Specifies the format of the pixel data.
- @type type: Enumerated constant
- @param type: Specifies the data type of the pixel data.
- @type pixels: Buffer object.
- @param pixels: Specifies a pointer to the image data in memory.
- """
-
-def glTexParameter (target, pname, param):
- """
- B{glTexParameterf, glTexParameteri, glTexParameterfv, glTexParameteriv}
-
- Set texture parameters
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/texparameter.html}
-
- @type target: Enumerated constant
- @param target: Specifies the target texture.
- @type pname: Enumerated constant
- @param pname: Specifies the symbolic name of a single-valued texture parameter.
- @type param: Depends on function prototype.
- @param param: Specifies the value of pname. If function prototype ends in 'v' specifies
- a pointer to an array where the value or values of pname are stored.
- """
-
-def glTranslate (x, y, z):
- """
- B{glTranslatef, glTranslated}
-
- Multiply the current matrix by a translation matrix
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/translate.html}
-
- @type x, y, z: Depends on function prototype.
- @param x, y, z: Specify the x, y, and z coordinates of a translation vector.
- """
-
-def glVertex (x,y,z,w,v):
- """
- B{glVertex2d, glVertex2f, glVertex2i, glVertex2s, glVertex3d, glVertex3f, glVertex3i,
- glVertex3s, glVertex4d, glVertex4f, glVertex4i, glVertex4s, glVertex2dv, glVertex2fv,
- glVertex2iv, glVertex2sv, glVertex3dv, glVertex3fv, glVertex3iv, glVertex3sv, glVertex4dv,
- glVertex4fv, glVertex4iv, glVertex4sv}
-
- Specify a vertex
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/vertex.html}
-
- @type x, y, z, w: Depends on function prototype (z and w for '3' and '4' prototypes only)
- @param x, y, z, w: Specify x, y, z, and w coordinates of a vertex. Not all parameters
- are present in all forms of the command.
- @type v: Buffer object. Depends of function prototype (for 'v' prototypes only)
- @param v: Specifies a pointer to an array of two, three, or four elements. The
- elements of a two-element array are x and y; of a three-element array, x, y, and z;
- and of a four-element array, x, y, z, and w.
- """
-
-def glViewport(x,y,width,height):
- """
- Set the viewport
- @see: U{www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/viewport.html}
-
- @type x, y: int
- @param x, y: Specify the lower left corner of the viewport rectangle,
- in pixels. The initial value is (0,0).
- @type width, height: int
- @param width, height: Specify the width and height of the viewport. When a GL context
- is first attached to a window, width and height are set to the dimensions of that window.
- """
-
-def gluPerspective(fovY, aspect, zNear, zFar):
- """
- Set up a perspective projection matrix.
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5577288}
-
- @type fovY: double
- @param fovY: Specifies the field of view angle, in degrees, in the y direction.
- @type aspect: double
- @param aspect: Specifies the aspect ratio that determines the field of view in the x direction.
- The aspect ratio is the ratio of x (width) to y (height).
- @type zNear: double
- @param zNear: Specifies the distance from the viewer to the near clipping plane (always positive).
- @type zFar: double
- @param zFar: Specifies the distance from the viewer to the far clipping plane (always positive).
- """
-
-def gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz):
- """
- Define a viewing transformation
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5573042}
-
- @type eyex, eyey, eyez: double
- @param eyex, eyey, eyez: Specifies the position of the eye point.
- @type centerx, centery, centerz: double
- @param centerx, centery, centerz: Specifies the position of the reference point.
- @type upx, upy, upz: double
- @param upx, upy, upz: Specifies the direction of the up vector.
- """
-
-def gluOrtho2D(left, right, bottom, top):
- """
- Define a 2-D orthographic projection matrix
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
-
- @type left, right: double
- @param left, right: Specify the coordinates for the left and right vertical clipping planes.
- @type bottom, top: double
- @param bottom, top: Specify the coordinates for the bottom and top horizontal clipping planes.
- """
-
-def gluPickMatrix(x, y, width, height, viewport):
- """
- Define a picking region
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
-
- @type x, y: double
- @param x, y: Specify the center of a picking region in window coordinates.
- @type width, height: double
- @param width, height: Specify the width and height, respectively, of the picking region in window coordinates.
- @type viewport: Buffer object. [int]
- @param viewport: Specifies the current viewport.
- """
-
-def gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, winx, winy, winz):
- """
- Map object coordinates to window coordinates.
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5578074}
-
- @type objx, objy, objz: double
- @param objx, objy, objz: Specify the object coordinates.
- @type modelMatrix: Buffer object. [double]
- @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
- @type projMatrix: Buffer object. [double]
- @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
- @type viewport: Buffer object. [int]
- @param viewport: Specifies the current viewport (as from a glGetIntegerv call).
- @type winx, winy, winz: Buffer object. [double]
- @param winx, winy, winz: Return the computed window coordinates.
- """
-
-def gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz):
- """
- Map object coordinates to window
- coordinates.
- @see: U{http://biology.ncsa.uiuc.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_RM/ch06.html#id5582204}
-
- @type winx, winy, winz: double
- @param winx, winy, winz: Specify the window coordinates to be mapped.
- @type modelMatrix: Buffer object. [double]
- @param modelMatrix: Specifies the current modelview matrix (as from a glGetDoublev call).
- @type projMatrix: Buffer object. [double]
- @param projMatrix: Specifies the current projection matrix (as from a glGetDoublev call).
- @type viewport: Buffer object. [int]
- @param viewport: Specifies the current viewport (as from a glGetIntegerv call).
- @type objx, objy, objz: Buffer object. [double]
- @param objx, objy, objz: Return the computed object coordinates.
- """
-
-class Buffer:
- """
- The Buffer object is simply a block of memory that is delineated and initialized by the
- user. Many OpenGL functions return data to a C-style pointer, however, because this
- is not possible in python the Buffer object can be used to this end. Wherever pointer
- notation is used in the OpenGL functions the Buffer object can be used in it's BGL
- wrapper. In some instances the Buffer object will need to be initialized with the template
- parameter, while in other instances the user will want to create just a blank buffer
- which will be zeroed by default.
-
- Example with Buffer::
- import Blender
- from Blender import BGL
- myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32])
- BGL.glGetPolygonStipple(myByteBuffer)
- print myByteBuffer.dimensions
- print myByteBuffer.list
- sliceBuffer = myByteBuffer[0:16]
- print sliceBuffer
-
- @ivar list: The contents of the Buffer.
- @ivar dimensions: The size of the Buffer.
- """
-
- def __init__(type, dimensions, template = None):
- """
- This will create a new Buffer object for use with other BGL OpenGL commands.
- Only the type of argument to store in the buffer and the dimensions of the buffer
- are necessary. Buffers are zeroed by default unless a template is supplied, in
- which case the buffer is initialized to the template.
-
- @type type: int
- @param type: The format to store data in. The type should be one of
- GL_BYTE, GL_SHORT, GL_INT, or GL_FLOAT.
- @type dimensions: An int or sequence object specifying the dimensions of the buffer.
- @param dimensions: If the dimensions are specified as an int a linear array will
- be created for the buffer. If a sequence is passed for the dimensions, the buffer
- becomes n-Dimensional, where n is equal to the number of parameters passed in the
- sequence. Example: [256,2] is a two- dimensional buffer while [256,256,4] creates
- a three- dimensional buffer. You can think of each additional dimension as a sub-item
- of the dimension to the left. i.e. [10,2] is a 10 element array each with 2 sub-items.
- [(0,0), (0,1), (1,0), (1,1), (2,0), ...] etc.
- @type template: A python sequence object (optional)
- @param template: A sequence of matching dimensions which will be used to initialize
- the Buffer. If a template is not passed in all fields will be initialized to 0.
- @rtype: Buffer object
- @return: The newly created buffer as a PyObject.
- """
diff --git a/source/blender/python/api2_2x/doc/BezTriple.py b/source/blender/python/api2_2x/doc/BezTriple.py
deleted file mode 100644
index eb12dd0051e..00000000000
--- a/source/blender/python/api2_2x/doc/BezTriple.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Blender.BezTriple module and the BezTriple PyType object
-
-"""
-The Blender.BezTriple submodule
-
-B{New}:
- - new attributes L{handleTypes<BezTriple.handleTypes>},
- L{selects<BezTriple.selects>} and L{weight<BezTriple.weight>}
-
-This module provides access to the BezTriple Data in Blender. It is used by
-CurNurb and IpoCurve objects.
-
-@type HandleTypes: readonly dictionary
-@var HandleTypes: The available BezTriple handle types.
- - FREE - handle has no constraints
- - AUTO - completely constrain handle based on knot position
- - VECT - constraint handle to line between current and neighboring knot
- - ALIGN - constrain handle to lie in a straight line with knot's other
- handle
- - AUTOANIM - constrain IPO handles to be horizontal on extremes
-"""
-
-def New (coords):
- """
- Create a new BezTriple object.
-
- @type coords: sequence of three or nine floats
- @param coords: the coordinate values for the new control point. If three
- floats are given, then the handle values are automatically generated.
- @rtype: BezTriple
- @return: a new BezTriple object
- """
-
-class BezTriple:
- """
- The BezTriple object
- ====================
- This object gives access to generic data from all BezTriple objects in
- Blender.
- @ivar pt : the [x,y] coordinates for knot point of this BezTriple. After
- changing coordinates of a Ipo curve, it is advisable to call
- L{IpoCurve.recalc()<IpoCurve.IpoCurve.recalc>} to update the curve.
- @type pt: list of two floats
- @ivar vec : a list of the 3 points [ handle, knot, handle ] that comprise a
- BezTriple, with each point composed of a list [x,y,z] of floats. The list
- looks like [ [H1x, H1y, H1z], [Px, Py, Pz], [H2x, H2y, H2z] ].
- Example::
- # where bt is of type BezTriple
- # and h1, p, and h2 are lists of 3 floats
- h1, p, h2 = bt.vec
- @type vec: list of points
- @ivar tilt: the tilt/alpha value for the point
- @type tilt: float
- @ivar radius: the radius of this point (used for tapering bevels)
- @type radius: float
- @ivar hide: the visibility status of the knot. B{Note}: true/nonzero means
- I{not} hidden. B{Note}: primarily intended for curves; not a good idea to
- hide IPO control points.
- @type hide: int
- @ivar handleTypes: the types of the point's two handles. See
- L{HandleTypes} for a complete description.
- @type handleTypes list of two ints
- @ivar selects: the select status for [handle, knot, handle]. True/nonzero
- if the point is selected.
- @type selects: list of three ints
- @ivar weight: the weight assigned to the control point. Useful for
- softbodies and possibly others.
- @type weight: float
- """
-
- def getPoints():
- """
- Returns the x,y coordinates of the Bezier knot point (B{deprecated}).
- See the L{BezTriple.pt} attribute.
- @rtype: list of floats
- @return: list of the x and y coordinates of the Bezier point.
- """
-
- def setPoints(newval):
- """
- Sets the x,y coordinates of the Bezier knot point (B{deprecated}).
- See the L{BezTriple.pt} attribute.
- @type newval: tuple of 2 floats
- @param newval: the x and y coordinates of the new Bezier point.
- @rtype: None
- @return: None
- """
-
- def getTriple():
- """
- Returns the x,y,z coordinates for each of the three points that make up
- a BezierTriple (B{deprecated}). See the L{BezTriple.vec} attribute.
- @rtype: list consisting of 3 lists of 3 floats
- @return: handle1, knot, handle2
- """
-
diff --git a/source/blender/python/api2_2x/doc/Blender.py b/source/blender/python/api2_2x/doc/Blender.py
deleted file mode 100644
index 8767df43ee1..00000000000
--- a/source/blender/python/api2_2x/doc/Blender.py
+++ /dev/null
@@ -1,260 +0,0 @@
-# The Blender Module
-
-# The module files in this folder are used to create the API documentation.
-# Doc system used: epydoc - http://epydoc.sf.net
-# pseudo command line (check the epy_docgen.sh file):
-# epydoc -o BPY_API_23x --url "http://www.blender.org" -t Blender.py \
-# -n "Blender" --no-private --no-frames Blender.py \
-# Types.py Scene.py Object.py [ ... etc]
-
-"""
-The main Blender module.
-
-B{New}: new var L{eventValue} for space handlers, L{Run}, L{UpdateMenus},
-new options to L{Get}, L{ShowHelp}, L{SpaceHandlers} dictionary.
-L{UnpackModes} dictionary.
-
-Blender
-=======
-
-@type bylink: bool
-@var bylink: True if the current script is being executed as a script link.
-@type link: Blender Object or None; integer (space handlers)
-@var link: for normal script links, 'link' points to the linked Object (can be
- a scene, object (mesh, camera, lamp), material or
- world). For space handler script links, 'link' is an integer from the
- Blender.L{SpaceHandlers} dictionary. For script not running as script
- links, 'link' is None.
-@type event: string or int
-@var event: this has three possible uses: script link type or events callback
- ascii value:
- - for normal script links it is a string representing the link type
- (OnLoad, FrameChanged, Redraw, etc.).
- - for EVENT space handler script links it is the passed event.
- - for normal L{GUI<Draw.Register>} scripts I{during the events callback},
- it holds the ascii value of the current event, if it is a valid one.
- Users interested in this should also check the builtin 'ord' and 'chr'
- Python functions.
-@type eventValue: int
-@var eventValue: used only for EVENT space handlers, it holds the event value:
- - for mouse button and key presses it's 1, for mouse movement
- (Draw.MOUSEX and Draw.MOUSEY) it has the new x or y coordinate, resp.
-@type mode: string
-@var mode: Blender's current mode:
- - 'interactive': normal mode, with an open window answering to user input;
- - 'background': Blender was started as 'C{blender -b <blender file>}' and
- will exit as soon as it finishes rendering or executing a script
- (ex: 'C{blender -b <blender file> -P <script>}'). Try 'C{blender -h}'
- for more detailed informations.
-@type UnpackModes: constant dictionary
-@var UnpackModes: dictionary with available unpack modes.
- - USE_LOCAL - use files in current directory (create when necessary)
- - WRITE_LOCAL - write files in current directory (overwrite when necessary)
- - USE_ORIGINAL - use files in original location (create when necessary)
- - WRITE_ORIGINAL - write files in original location (overwrite when necessary)
-@type SpaceHandlers: constant dictionary
-@var SpaceHandlers: dictionary with space handler types.
- - VIEW3D_EVENT;
- - VIEW3D_DRAW.
-"""
-
-def Set (request, data):
- """
- Update settings in Blender.
- @type request: string
- @param request: The setting to change:
- - 'curframe': the current animation frame
- - 'compressfile' : compress file writing a blend file (Use a boolean value True/False).
- - 'uscriptsdir': user scripts dir
- - 'yfexportdir': yafray temp xml storage dir
- - 'fontsdir': font dir
- - 'texturesdir': textures dir
- - 'seqpluginsdir': sequencer plugin dir
- - 'renderdir': default render output dir
- - 'soundsdir': sound dir
- - 'tempdir': temp file storage dir
- - 'mipmap' : Use mipmapping in the 3d view (Use a boolean value True/False).
- @type data: int or string
- @param data: The new value.
- """
-
-def Get (request):
- """
- Retrieve settings from Blender.
- @type request: string
- @param request: The setting data to be returned:
- - 'curframe': the current animation frame.
- - 'curtime' : the current animation time.
- - 'compressfile' : compress setting from the file menu, return 0 for false or 1 for true.
- - 'staframe': the start frame of the animation.
- - 'endframe': the end frame of the animation.
- - 'rt': the value of the 'rt' button for general debugging
- - 'filename': the name of the last file read or written.
- - 'homedir': Blender's home directory.
- - 'datadir' : the path to the dir where scripts should store and
- retrieve their data files, including saved configuration (can
- be None, if not found).
- - 'udatadir': the path to the user defined data dir. This may not be
- available (is None if not found), but users that define uscriptsdir
- have a place for their own scripts and script data that won't be
- erased when a new version of Blender is installed. For this reason
- we recommend scripts check this dir first and use it, if available.
- - 'scriptsdir': the path to the main dir where scripts are stored.
- - 'uscriptsdir': the path to the user defined dir for scripts. (*)
- - 'icondir': the path to blenders icon theme files.
- - 'yfexportdir': the path to the user defined dir for yafray export. (*)
- - 'fontsdir': the path to the user defined dir for fonts. (*)
- - 'texturesdir': the path to the user defined dir for textures. (*)
- - 'texpluginsdir': the path to the user defined dir for texture plugins. (*)
- - 'seqpluginsdir': the path to the user defined dir for sequence plugins. (*)
- - 'renderdir': the path to the user defined dir for render output. (*)
- - 'soundsdir': the path to the user defined dir for sound files. (*)
- - 'tempdir': the path to the user defined dir for storage of Blender
- temporary files. (*)
- - 'mipmap' : Use mipmapping in the 3d view. (*)
- - 'version' : the Blender version number.
- @note: (*) these can be set in Blender at the User Preferences window -> File
- Paths tab.
- @warn: this function returns None for requested dir paths that have not been
- set or do not exist in the user's file system.
- @return: The requested data or None if not found.
- """
-
-def GetPaths (absolute=0):
- """
- Returns a list of files this blend file uses: (libraries, images, sounds, fonts, sequencer movies).
- @type absolute: bool
- @param absolute: When true, the absolute paths of every file will be returned.
- @return: A list for paths (strings) that this blend file uses.
- """
-
-def Redraw ():
- """
- Redraw all 3D windows.
- """
-
-def Load (filename = None):
- """
- Load a Blender .blend file or any of the other supported file formats.
-
- Supported formats:
- - Blender's .blend;
- - DXF;
- - Open Inventor 1.0 ASCII;
- - Radiogour;
- - STL;
- - Videoscape;
- - VRML 1.0 asc.
-
- @type filename: string
- @param filename: the pathname to the desired file. If 'filename'
- isn't given or if it contains the substring '.B.blend', the default
- .B.blend file is loaded.
-
- @warn: loading a new .blend file removes the current data in Blender. For
- safety, this function saves the current data as an auto-save file in
- the temporary dir used by Blender before loading a new Blender file.
- @warn: after a call to Load(blendfile), current data in Blender is lost,
- including the Python dictionaries. Any posterior references in the
- script to previously defined data will generate a NameError. So it's
- better to put Blender.Load as the last executed command in the script,
- when this function is used to open .blend files.
- @warn: if in edit mode, this function leaves it, since Blender itself
- requires that.
- @note: for all types except .blend files, this function only works in
- interactive mode, not in background, following what Blender itself does.
- """
-
-def Save (filename, overwrite = 0):
- """
- Save a Blender .blend file with the current program data or export to
- one of the builtin file formats.
-
- Supported formats:
- - Blender (.blend);
- - DXF (.dxf);
- - STL (.stl);
- - Videoscape (.obj);
- - VRML 1.0 (.wrl).
-
- @type filename: string
- @param filename: the filename for the file to be written. It must have one
- of the supported extensions or an error will be returned.
- @type overwrite: int (bool)
- @param overwrite: if non-zero, file 'filename' will be overwritten if it
- already exists (can be checked with L{Blender.sys.exists<Sys.exists>}.
- By default existing files are not overwritten (an error is returned).
-
- @note: The substring ".B.blend" is not accepted inside 'filename'.
- @note: DXF, STL and Videoscape export only B{selected} meshes.
- """
-
-def Run (script):
- """
- Execute the given script.
- @type script: string
- @param script: the name of an available Blender Text (use L{Text.Get}() to
- get a complete list) or the full pathname to a Python script file in the
- system.
- @note: the script is executed in its own context -- with its own global
- dictionary -- as if it had been executed from the Text Editor or chosen
- from a menu.
- """
-
-def ShowHelp (script):
- """
- Show help for the given script. This is a time-saver ("code-saver") for
- scripts that need to feature a 'help' button in their GUIs or a 'help'
- submenu option. With proper documentation strings, calling this function is
- enough to present a screen with help information plus link and email buttons.
- @type script: string
- @param script: the filename of a registered Python script.
- @note: this function uses L{Run} and the "Scripts Help Browser" script. This
- means that it expects proper doc strings in the script to be able to show
- help for it (otherwise it offers to load the script source code as text).
- The necessary information about doc strings is L{given here<API_related>}.
- @note: 'script' doesn't need to be a full path name: "filename.py" is enough.
- Note, though, that this function only works for properly registered
- scripts (those that appear in menus).
- """
-
-def UpdateMenus ():
- """
- Update the menus that list registered scripts. This will scan the default
- and user defined (if available) folder(s) for scripts that have registration
- data and will make them accessible via menus.
- @note: only scripts that save other new scripts in the default or user
- defined folders need to call this function.
- """
-def UnpackAll (mode):
- """
- Unpack all files with specified mode.
- @param mode: The Mode for unpacking. Must be one of the modes in
- Blender.UnpackModes dictionary.
- @type mode: int
- """
-def PackAll ():
- """
- Pack all files.
- """
-
-def CountPackedFiles():
- """
- Returns the number of packed files.
- """
-
-def Quit ():
- """
- Exit from Blender immediately.
- @warn: the use of this function should obviously be avoided, it is available
- because there are some cases where it can be useful, like in automated
- tests. For safety, a "quit.blend" file is saved (normal Blender behavior
- upon exiting) when this function is called, so the data in Blender isn't
- lost.
- """
-def SaveUndoState (message):
- """
- Sets an undo at the current state.
- @param message: Message that appears in the undo menu
- @type message: string
- """
diff --git a/source/blender/python/api2_2x/doc/Blender_API.css b/source/blender/python/api2_2x/doc/Blender_API.css
deleted file mode 100644
index 22c00536282..00000000000
--- a/source/blender/python/api2_2x/doc/Blender_API.css
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Generated by CaScadeS, a stylesheet editor for Mozilla Composer */
-
- font { font-family: sans-serif ! important;
- }
-
- p { color: rgb(0, 0, 0);
- font-family: sans-serif;
- }
-
- pre { color: rgb(0, 0, 0);
- font-family: monospace;
- }
-
- a { font-family: sans-serif;
- color: rgb(0, 135, 0);
- font-weight: bold;
- }
-
- a:visited { font-family: sans-serif;
- color: rgb(102, 102, 102);
- }
-
- a:hover { font-family: sans-serif;
- color: rgb(184, 73, 0);
- }
-
- h1 { font-family: sans-serif;
- color: rgb(255, 102, 0);
- }
-
- h2 { font-family: sans-serif;
- color: rgb(255, 102, 0);
- }
-
- h3 { font-family: sans-serif;
- color: rgb(255, 102, 0);
- }
-
- table { color: rgb(0, 0, 0);
- opacity: 1;
- border-bottom-color: rgb(0, 102, 0);
- background-color: rgb(217, 216, 239);
- }
-
diff --git a/source/blender/python/api2_2x/doc/Bpy.py b/source/blender/python/api2_2x/doc/Bpy.py
deleted file mode 100644
index e5eb751cf04..00000000000
--- a/source/blender/python/api2_2x/doc/Bpy.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# bpy module and the bpy PyType object
-
-"""
-The bpy module.
-
-bpy
-===
-
- ATTENTION: This module is EXPERIMENTAL.
- Features documented here are subject to change.
-
- The bpy module is intended as a replacement for the Blender module.
- It will eventually provide the same features and functionality.
-
- This module uses a different model for the way data is accessed, added and removed. The various types such as groups, meshes, etc., are unchanged.
-
- At the moment it provides an alternative way to access data from python.
-
- Submodules:
- -----------
- - L{data<Bpy_data>}
- - L{libraries<LibData.Libraries>}
- - L{config<Bpy_config>}
-"""
-
diff --git a/source/blender/python/api2_2x/doc/Bpy_config.py b/source/blender/python/api2_2x/doc/Bpy_config.py
deleted file mode 100644
index ec3eb261c03..00000000000
--- a/source/blender/python/api2_2x/doc/Bpy_config.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# bpy module and the bpy PyType object
-
-"""
-bpy.config
-==========
-
-This module gives you direct access to blenders preferences.
-
-@var undoSteps: number of undo steps to store.
-@type undoSteps: int
-@var textureTimeout: free textures from openGL memory if unused after this time.
-@type textureTimeout: int
-@var textureCollectRate: tag textures as being used at this interval of time.
-@type textureCollectRate: int
-@var sequenceMemCacheLimit: how much memory to use for a sequencer cache.
-@type sequenceMemCacheLimit: int
-@var fontSize: display size for fonts in the user interface.
-@type fontSize: int
-@var yfExportDir: yafray export path.
-@type yfExportDir: string
-@var fontDir: default font path.
-@type fontDir: string
-@var renderDir: default render path.
-@type renderDir: string
-@var textureDir: default texture path.
-@type textureDir: string
-@var userScriptsDir: path for user scripts.
-@type userScriptsDir: string
-@var texturePluginsDir: default texture plugin path.
-@type texturePluginsDir: string
-@var soundDir: default sound path.
-@type soundDir: string
-@var sequencePluginsDir: default sequencer plugin path.
-@type sequencePluginsDir: string
-@var tempDir: path where temp files are saved.
-@type tempDir: string
-"""
-
diff --git a/source/blender/python/api2_2x/doc/Bpy_data.py b/source/blender/python/api2_2x/doc/Bpy_data.py
deleted file mode 100644
index e228db688d7..00000000000
--- a/source/blender/python/api2_2x/doc/Bpy_data.py
+++ /dev/null
@@ -1,281 +0,0 @@
-# bpy module and the bpy PyType object
-
-"""
-The bpy module.
-
-bpy.data (Generic Data Access)
-==============================
-
-Example::
-
- # apply the active image to the active mesh
- # this script has no error checking to keep it small and readable.
-
- sce= bpy.data.scenes.active
- ob_act = sce.objects.active # assuming we have an active, might be None
- me = ob_act.getData(mesh=1) # assuming a mesh type, could be any
- img = bpy.data.images.active # assuming we have an active image
-
- for f in me.faces:
- f.image = img
-
- Window.RedrawAll()
-
-Example::
-
- # make a new object from an existing mesh
- # and make it active
- scn= bpy.data.scenes.active
- me = bpy.data.meshes['mymesh']
- ob = sce.objects.new(me) # new object from the mesh
- sce.objects.active = ob
-
-Example::
- # print the names of any non local objects
- sce= bpy.data.scenes.active
- for ob in sce.objects:
- if ob.lib:
- print 'external object:', ob.name, ob.lib
-
-Example::
- # add an empty object at each vertex of the active mesh
- scn= bpy.data.scenes.active
- ob_act = sce.objects.active
- matrix = ob_act.matrixWorld
- me = ob_act.getData(mesh=1)
-
- for v in me.verts:
- ob = sce.objects.new('Empty')
- ob.loc = v.co * matrix # transform the vertex location by the objects matrix.
-
-
-Example::
- # load all the wave sound files in a directory
- import os
- sound_dir = '/home/me/soundfiles/'
- sounds_new = []
- for fname in os.listdir(sound_dir):
- if fname.lower().endswith('.wav'):
- try:
- snd = bpy.data.sounds.new(filename = sound_dir + fname)
- except:
- snd = None
-
- if snd:
- sounds_new.append(snd)
-
- # Print the sounds
- for snd in sounds_new:
- print snd
-
-Example::
- # apply a new image to each selected mesh object as a texface.
- width, height= 512, 512
- scn= bpy.data.scenes.active
-
- for ob in sce.objects.context:
- if not ob.lib and ob.type == 'Mesh': # object isn't from a library and is a mesh
- me = ob.getData(mesh=1)
- me.faceUV = True # add UV coords and textures if we don't have them.
-
- # Make an image named after the mesh
- img = bpy.data.images.new(me.name, width, height)
-
- for f in me.faces:
- f.image = img
-
- Window.RedrawAll()
-
-
-
-@var scenes: sequence for L{scene<Scene.Scene>} data
-@type scenes: L{libBlockSeq}
-@var objects: sequence for L{object<Object.Object>} data
-@type objects: L{libBlockSeq}
-@var meshes: sequence for L{mesh<Mesh.Mesh>} data
-@type meshes: L{libBlockSeq}
-@var curves: sequence for L{curve<Curve.Curve>} data, used to store Curve, Surface and Text3d data.
-@type curves: L{libBlockSeq}
-@var metaballs: sequence for L{metaball<Metaball.Metaball>} data
-@type metaballs: L{libBlockSeq}
-@var materials: sequence for L{material<Material.Material>} data
-@type materials: L{libBlockSeq}
-@var textures: sequence for L{texture<Texture.Texture>} data
-@type textures: L{libBlockSeq}
-@var images: sequence for L{image<Image.Image>} data
-@type images: L{libBlockSeq}
-@var lattices: sequence for L{lattice<Lattice.Lattice>} data
-@type lattices: L{libBlockSeq}
-@var lamps: sequence for L{lamp<Lamp.Lamp>} data
-@type lamps: L{libBlockSeq}
-@var cameras: sequence for L{camera<Camera.Camera>} data
-@type cameras: L{libBlockSeq}
-@var ipos: sequence for L{ipo<Ipo.Ipo>} data
-@type ipos: L{libBlockSeq}
-@var worlds: sequence for L{world<World.World>} data
-@type worlds: L{libBlockSeq}
-@var fonts: sequence for L{font<Font.Font>} data
-@type fonts: L{libBlockSeq}
-@var texts: sequence for L{text<Text.Text>} data
-@type texts: L{libBlockSeq}
-@var sounds: sequence for L{sound<Sound.Sound>} data
-@type sounds: L{libBlockSeq}
-@var groups: sequence for L{group<Group.Group>} data
-@type groups: L{libBlockSeq}
-@var armatures: sequence for L{armature<Armature.Armature>} data
-@type armatures: L{libBlockSeq}
-@var actions: sequence for L{action<NLA.Action>} data
-@type actions: L{libBlockSeq}
-"""
-
-
-class libBlockSeq:
- """
- Generic Data Access
- ===================
- This provides a unified way to access and manipulate data types in Blender
- (scene, object, mesh, curve, metaball, material, texture, image, lattice,
- lamp, camera, ipo, world, font, text, sound, groups, armatures, actions).
-
- Get Item
- ========
- To get a datablock by name you can use dictionary-like syntax.
-
- >>> ob = bpy.data.objects['myobject']
-
- Note that this can only be used for getting.
-
- >>> bpy.data.objects['myobject'] = data # will raise an error
-
- B{Library distinctions}
-
- Blender doesn't allow naming collisions within its own data, but it's
- possible to run into naming collisions when you have data linked from an external blend file.
-
- You can specify where the data is from by using a (name, library) pair as the key.
-
- >>> group = bpy.data.groups['mygroup', '//mylib.blend'] # only return data linked from mylib
-
- If you want to get a group from the local data only you can use None
-
- >>> group = bpy.data.groups['mygroup', None] # always returns local data
-
- Sequence
- ========
- These generic datablocks are sequence datatypes. They are not lists. They support the dictionary and iterator protocols. This implies the following
-
- - A B{for} statement allows you to loop through data using the iterator protocol without wasting resources on creating a large list.
-
- >>> for me in bpy.data.meshes:
- ... print me.name
-
- - You can also use len() to see how many datablocks exist.
-
- >>> print len(bpy.data.scenes)
-
- - Because the sequences are not lists and the [] operator is used to get items by name, you cannot use indexing to retrieve an item.
-
- >>> ob = bpy.data.objects[-1] # will raise an error
-
- - If you want to access the entire sequence as a list simply use the list() constructor.
-
- >>> ipo_list = list(bpy.data.ipos)
-
- @type tag: Bool
- @ivar tag: A fast way to set the tag value of every member of the sequence to True or False
-
- For example
-
- >>> bpy.data.meshes.tag = True
-
- Is the same as...
-
- >>> for me in bpy.data.meshes: me.tag = True
-
- @type active: Datablock or None
- @ivar active: The active member of the datatype
-
- Applies to:
- - L{images}
- - L{scenes}
- - L{texts}
- This can also be used to set the active data.
-
- >>> bpy.data.images.active = bpy.data.images.new(filename = '/home/me/someimage.jpg')
-
- """
-
- def new(name):
- """
- fixme: need description for parameters.
- This function returns a new datablock containing no data or loaded from a file.
-
- Most datatypes accept a name for their argument except for L{sounds}, L{fonts}, L{ipos} and L{curves} that need an additional argument.
-
- The name argument is optional if not given a default name will be assigned.
-
- The name given may be modified by blender to make it unique.
-
- Loading From File
- =================
- For L{images}, L{texts}, L{sounds}, L{fonts} types you can use the filename keyword to make a new datablock from a file.
-
- New L{sounds}, L{fonts} can only be made with the a filename given.
-
- The filename can a keyword or the second argument, use the keyword only for the datablocks new name to be set by the filename.
-
- >>> sound = bpy.data.sounds.new('newsound', '~/mysound.wav') # uses the first string given for the name.
-
- >>> sound = bpy.data.sounds.new(filename = '~/mysound.wav') # will use the filename to make the name.
-
- Images
- ======
- Images optionally accept extra 2 arguments for width and height, values between 4 and 5000 if no args are given they will be 256.
-
- >>> img = bpy.data.images.new(name, 512, 512)
-
- Curves
- ======
- Curves need 2 arguments: bpy.data.curves.new(name, type) type must be one of the following...
- - 'Curve'
- - 'Text3d'
-
- >>> text3d = bpy.data.curves.new('MyCurve', 'Text3d')
-
- Ipos
- ====
- Ipos need 2 arguments: bpy.data.ipos.new(name, type) type must be one of the following...
- - 'Camera'
- - 'World'
- - 'Material'
- - 'Texture'
- - 'Lamp'
- - 'Action'
- - 'Constraint'
- - 'Sequence'
- - 'Curve'
- - 'Key'
- Objects cannot be created from bpy.data.objects;
- objects must be created from the scene. Here are some examples.
-
- >>> ob = bpy.data.scenes.active.objects.new('Empty')
-
- >>> scn = bpy.data.scenes.active
- ... ob = sce.objects.new(bpy.data.meshes.new('mymesh'))
-
- @rtype: datablock
- """
-
- def unlink(datablock):
- """
- This function removes a datablock.
- applies to:
- - L{scenes}
- - L{groups}
- - L{texts}
- Other types will raise an error.
- @rtype: None
- """
-
-
- \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Camera.py b/source/blender/python/api2_2x/doc/Camera.py
deleted file mode 100644
index c4e664efa66..00000000000
--- a/source/blender/python/api2_2x/doc/Camera.py
+++ /dev/null
@@ -1,257 +0,0 @@
-# Blender.Camera module and the Camera PyType object
-
-"""
-The Blender.Camera submodule.
-
-B{New}: L{Camera.clearScriptLinks} accepts a parameter now.
-
-Camera Data
-===========
-
-This module provides access to B{Camera Data} objects in Blender.
-
-Example::
-
- from Blender import Camera, Object, Scene
- cam = Camera.New('ortho') # create new ortho camera data
- cam.scale = 6.0 # set scale value for ortho view
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(cam) # add a new camera object from the data
- scn.setCurrentCamera(ob) # make this camera the active
-"""
-
-def New (type = 'persp', name = 'CamData'):
- """
- Create a new Camera Data object.
- @type type: string
- @param type: The Camera type: 'persp' or 'ortho'.
- @type name: string
- @param name: The Camera Data name.
- @rtype: Blender Camera
- @return: The created Camera Data object.
- """
-
-def Get (name = None):
- """
- Get the Camera Data object(s) from Blender.
- @type name: string
- @param name: The name of the Camera Data.
- @rtype: Blender Camera or a list of Blender Cameras
- @return: It depends on the I{name} parameter:
- - (name): The Camera Data object with the given I{name};
- - (): A list with all Camera Data objects in the current scene.
- """
-
-class Camera:
- """
- The Camera Data object
- ======================
- This object gives access to Camera-specific data in Blender.
- @ivar type: The Camera type: 'persp' or 'ortho'
- @ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
- @ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
- @ivar angle: The lens value in degrees [7.323871, 172.847331], only relevant to *persp* cameras.
- @ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
- @ivar clipStart: The clip start value in [0.0, 100.0].
- @ivar clipEnd: The clip end value in [1.0, 5000.0].
- @ivar dofDist: The dofDist value in [0.0, 5000.0].
- @ivar shiftX: The horizontal offset of the camera [-2.0, 2.0].
- @ivar shiftY: The vertical offset of the camera [-2.0, 2.0].
- @ivar alpha: The PassePart alpha [0.0, 1.0].
- @ivar drawSize: The display size for the camera an the 3d view [0.1, 10.0].
- @type ipo: Blender Ipo
- @ivar ipo: The "camera data" ipo linked to this camera data object.
- Set to None to clear the ipo.
-
- @ivar drawLimits: Toggle the option to show limits in the 3d view.
- @ivar drawName: Toggle the option to show the camera name in the 3d view.
- @ivar drawMist: Toggle the option to show mist in the 3d view.
- @ivar drawTileSafe: Toggle the option to show tile safe in the 3d view.
- @ivar drawPassepartout: Toggle the option to show pass part out in the 3d view.
-
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
- """
-
- def getName():
- """
- Get the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
- @type name: string
- @param name: The new name.
- """
-
- def getIpo():
- """
- Get the Ipo associated with this camera data object, if any. (B{deprecated})
- @rtype: Ipo
- @return: the wrapped ipo or None. (B{deprecated}) See the L{ipo} attribute.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this camera data object. (B{deprecated}) See the L{ipo} attribute.
- @type ipo: Blender Ipo
- @param ipo: a "camera data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this camera data object. (B{deprecated}) See the L{ipo} attribute.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def getType():
- """
- Get this Camera's type. (B{deprecated}) See the L{type} attribute.
- @rtype: int
- @return: 0 for 'persp' or 1 for 'ortho'.
- """
-
- def setType(type):
- """
- Set this Camera's type. (B{deprecated}) See the L{type} attribute.
- @type type: string
- @param type: The Camera type: 'persp' or 'ortho'.
- """
-
- def getMode():
- """
- Get this Camera's mode flags. (B{deprecated}) See the L{mode} attribute.
- @rtype: int
- @return: B{OR'ed value}: 'showLimits' is 1, 'showMist' is 2, or
- respectively, 01 and 10 in binary.
- """
-
- def setMode(mode1 = None, mode2 = None):
- """
- Set this Camera's mode flags. Mode strings given are turned 'on'. (B{deprecated}) See the L{mode} attribute.
- Those not provided are turned 'off', so cam.setMode() -- without
- arguments -- turns off all mode flags for Camera cam.
- @type mode1: string
- @type mode2: string
- @param mode1: A mode flag: 'showLimits' or 'showMist'.
- @param mode2: A mode flag: 'showLimits' or 'showMist'.
- """
-
- def getLens():
- """
- Get the lens value. (B{deprecated}) See the L{lens} attribute.
- @rtype: float
- @warn: lens is only relevant for perspective (L{getType}) cameras.
- """
-
- def setLens(lens):
- """
- Set the lens value. (B{deprecated}) See the L{lens} attribute.
- @type lens: float
- @param lens: The new lens value.
- @warn: lens is only relevant for perspective (L{type}) cameras.
- """
-
- def getScale():
- """
- Get the scale value. (B{deprecated}) See the L{scale} attribute.
- @rtype: float
- @warn: scale is only relevant for ortho (L{type}) cameras.
- """
-
- def setScale(scale):
- """
- Set the scale value. (B{deprecated}) See the L{scale} attribute.
- @type scale: float
- @param scale: The new scale value in [0.01, 1000.00].
- @warn: scale is only relevant for ortho (L{getType}) cameras.
- """
-
- def getClipStart():
- """
- Get the clip start value. (B{deprecated}) See the L{clipStart} attribute.
- @rtype: float
- """
-
- def setClipStart(clipstart):
- """
- Set the clip start value. (B{deprecated}) See the L{clipStart} attribute.
- @type clipstart: float
- @param clipstart: The new lens value.
- """
-
- def getClipEnd():
- """
- Get the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
- @rtype: float
- """
-
- def setClipEnd(clipend):
- """
- Set the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
- @type clipend: float
- @param clipend: The new clip end value.
- """
-
- def getDrawSize():
- """
- Get the draw size value. (B{deprecated}) See the L{drawSize} attribute.
- @rtype: float
- """
-
- def setDrawSize(drawsize):
- """
- Set the draw size value. (B{deprecated}) See the L{drawSize} attribute.
- @type drawsize: float
- @param drawsize: The new draw size value.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Camera's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Camera. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Camera.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in camera ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -LENS
- -CLIPPING
- @return: py_none
- """
-
- def __copy__ ():
- """
- Make a copy of this camera
- @rtype: Camera
- @return: a copy of this camera
- """
-
-import id_generics
-Camera.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Constraint.py b/source/blender/python/api2_2x/doc/Constraint.py
deleted file mode 100644
index e00851caa36..00000000000
--- a/source/blender/python/api2_2x/doc/Constraint.py
+++ /dev/null
@@ -1,254 +0,0 @@
-# Blender.Constraint module and the Constraint PyType object
-
-"""
-The Blender.Constraint submodule
-
-B{New}:
- - provides access to Blender's constraint stack
-
-This module provides access to the Constraint Data in Blender.
-
-Examples::
- from Blender import *
-
- ob = Object.Get('Cube')
- if len(ob.constraints) > 0:
- const = ob.constraints[0]
- if const.type == Constraint.Type.FLOOR:
- offs = const[Constraint.Settings.OFFSET]
-
-Or to print all the constraints attached to each bone in a pose::
- from Blender import *
-
- ob = Object.Get('Armature')
- pose = ob.getPose()
- for bonename in pose.bones.keys():
- bone = pose.bones[bonename]
- for const in bone.constraints:
- print bone.name,'=>',const
-
-@type Type: readonly dictionary
-@var Type: Constant Constraint dict used by L{Constraints.append()} and
- for comparison with L{Constraint.type}. Values are
- TRACKTO, IKSOLVER, FOLLOWPATH, COPYROT, COPYLOC, COPYSIZE, ACTION,
- LOCKTRACK, STRETCHTO, FLOOR, LIMITLOC, LIMITROT, LIMITSIZE, LIMITDIST,
- CLAMPTO, PYTHON, CHILDOF, TRANSFORM, NULL
-
-@type Settings: readonly dictionary
-@var Settings: Constant dict used for changing constraint settings.
- - Used for all single-target constraints
- (TRACKTO, FOLLOWPATH, COPYROT, COPYLOC, COPYSIZE, ACTION, LOCKTRACK, STRETCHTO, FLOOR, CLAMPTO, CHILDOF, TRANSFORM, LIMITDIST)
- - TARGET (Object): target object
- - BONE (string): name of Bone sub-target (for Armature targets), or name of Vertex Group sub-target
- (for Geometry targets)
- - Used for all multiple-target constraints (PYTHON)
- - TARGET (list of Objects): list of target objects, with one list slot = one target slot
- - BONE (list of strings): list of names of Bone sub-target (for Armature targets) or name of Vertex Group
- sub-targets (for Geometry targets)
- - Used by some constraints:
- - OWNERSPACE (int): for TRACKTO, COPYLOC, COPYROT, COPYSIZE, LIMITLOC, LIMITROT, LIMITSIZE, PYTHON, TRANSFORM
- If the owner is an object, values are SPACE_WORLD, SPACE_LOCAL
- If the owner is a bone, values are SPACE_WORLD, SPACE_POSE, SPACE_PARLOCAL, SPACE_LOCAL
- - TARGETSPACE (list of ints): for TRACKTO, COPYLOC, COPYROT, COPYSIZE, PYTHON, TRANSFORM, ACTION
- For every target that the Constraint can have, the target space can be set
- If the target is an object, values are SPACE_WORLD, SPACE_LOCAL
- If the target is a bone, values are SPACE_WORLD, SPACE_POSE, SPACE_PARLOCAL, SPACE_LOCAL
- - Used by IK Solver (IKSOLVER) constraint:
- - TOLERANCE (float): clamped to [0.0001:1.0]
- - ITERATIONS (int): clamped to [1,10000]
- - CHAINLEN (int): clamped to [0,255]
- - POSWEIGHT (float): clamped to [0.01,1.0]
- - ROTWEIGHT (float): clamped to [0.01,1.0]
- - ROTATE (bool)
- - USETIP (bool)
- - Used by Action (ACTION) constraint:
- - ACTION (Action Object)
- - START (int): clamped to [1,maxframe]
- - END (int): clamped to [1,maxframe]
- - MIN (float): clamped to [-1000.0,1000.0] for Location, [-180.0,180.0] for Rotation, [0.0001,1000.0] for Scaling
- - MAX (float): clamped to [-1000.0,1000.0] for Location, [-180.0,180.0] for Rotation, [0.0001,1000.0] for Scaling
- - KEYON (int): values are XLOC, YLOC, ZLOC, XROT, YROT, ZROT, XSIZE, YSIZE, ZSIZE
- - Used by Track To (TRACKTO) constraint:
- - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - UP (int): values are UPX, UPY, UPZ
- - Used by Stretch To (STRETCHTO) constraint:
- - RESTLENGTH (float): clamped to [0.0:100.0]
- - VOLVARIATION (float): clamped to [0.0:100.0]
- - VOLUMEMODE (int): values are VOLUMEXZ, VOLUMEX, VOLUMEZ,
- VOLUMENONE
- - PLANE (int): values are PLANEX, PLANEZ
- - Used by Follow Path (FOLLOWPATH) constraint:
- - FOLLOW (bool)
- - OFFSET (float): clamped to [-maxframe:maxframe]
- - FORWARD (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - UP (int): values are UPX, UPY, UPZ
- - Used by Lock Track (FOLLOWPATH) constraint:
- - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - LOCK (int): values are LOCKX, LOCKY, LOCKZ
- - Used by Clamp To (CLAMPTO) constraint:
- - CLAMP (int): values are CLAMPAUTO, CLAMPX, CLAMPY, CLAMPZ
- - CLAMPCYCLIC (bool)
- - Used by Floor (FLOOR) constraint:
- - MINMAX (int): values are MINX, MINY, MINZ, MAXX, MAXY, MAXZ
- - OFFSET (float): clamped to [-100.0,100.0]
- - STICKY (bool)
- - Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
- - COPY (bitfield): any combination of COPYX, COPYY and COPYZ with possible addition of COPYXINVERT, COPYYINVERT and COPYZINVERT to invert that particular input (if on).
- - Used by Copy Size (COPYSIZE) constraint:
- - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
- - Used by Limit Location (LIMITLOC) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
- LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
- - XMIN (float): clamped to [-1000.0,1000.0]
- - XMAX (float): clamped to [-1000.0,1000.0]
- - YMIN (float): clamped to [-1000.0,1000.0]
- - YMAX (float): clamped to [-1000.0,1000.0]
- - ZMIN (float): clamped to [-1000.0,1000.0]
- - ZMAX (float): clamped to [-1000.0,1000.0]
- - Used by Limit Rotation (LIMITROT) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XROT, LIMIT_YROT,
- LIMIT_ZROT
- - XMIN (float): clamped to [-360.0,360.0]
- - XMAX (float): clamped to [-360.0,360.0]
- - YMIN (float): clamped to [-360.0,360.0]
- - YMAX (float): clamped to [-360.0,360.0]
- - ZMIN (float): clamped to [-360.0,360.0]
- - ZMAX (float): clamped to [-360.0,360.0]
- - Used by Limit Scale (LIMITSIZE) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
- LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
- - XMIN (float): clamped to [0.0001,1000.0]
- - XMAX (float): clamped to [0.0001,1000.0]
- - YMIN (float): clamped to [0.0001,1000.0]
- - YMAX (float): clamped to [0.0001,1000.0]
- - ZMIN (float): clamped to [0.0001,1000.0]
- - ZMAX (float): clamped to [0.0001,1000.0]
- - Used by Limit Distance (LIMITDIST) constraint:
- - LIMITMODE (int): any one of LIMIT_INSIDE, LIMIT_OUTSIDE, LIMIT_ONSURFACE
- - Used by Python Script (PYTHON) constraint:
- - SCRIPT (Text): script to use
- - PROPERTIES (IDProperties): ID-Properties of constraint
- - Used by Child Of (CHILDOF) constraint:
- - COPY (bitfield): any combination of PARLOCX, PARLOCY, PARLOCZ,
- PARROTX, PARROTY, PARROTZ, PARSIZEX, PARSIZEY, PARSIZEZ.
- - Used by Transformation (TRANSFORM) constraint:
- - FROM (int): values are LOC, ROT, SCALE
- - TO (int): values are LOC, ROT, SCALE
- - MAPX, MAPY, MAPZ (int): values are LOC, ROT, SCALE
- - EXTRAPOLATE (bool)
- - FROM_MINX, FROM_MINY, FROM_MINZ, FROM_MAXX,
- FROM_MAXY, FROM_MAXZ (float):
- If FROM==LOC, then is clamped to [-1000.0, 1000.0]
- If FROM==ROT, then is clamped to [-360.0, 360.0]
- If FROM==SCALE, then is clamped to [0.0001, 1000.0]
- - TO_MINX, TO_MINY, TO_MINZ, TO_MAXX, TO_MAXY, TO_MAXZ (float):
- If TO==LOC, then is clamped to [-1000.0, 1000.0]
- If TO==ROT, then is clamped to [-360.0, 360.0]
- If TO==SCALE, then is clamped to [0.0001, 1000.0]
-
-"""
-
-class Constraints:
- """
- The Constraints object
- ======================
- This object provides access to sequence of
- L{constraints<Constraint.Constraint>} for a particular object.
- They can be accessed from L{Object.constraints<Object.Object.constraints>}.
- or L{PoseBone.constraints<Pose.PoseBone.constraints>}.
- """
-
- def __getitem__(index):
- """
- This operator returns one of the constraints in the stack.
- @type index: int
- @return: an Constraint object
- @rtype: Constraint
- @raise KeyError: index was out of range
- """
-
- def __len__():
- """
- Returns the number of constraints in the constraint stack.
- @return: number of Constraints
- @rtype: int
- """
-
- def append(type):
- """
- Appends a new constraint to the end of the constraint stack.
- @param type: a constant specifying the type of constraint to create. as from L{Type}
- @type type: int constant
- @rtype: Constraint
- @return: the new Constraint
- """
-
- def remove(con):
- """
- Remove a constraint from this objects constraint sequence.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @note: Accessing attributes of the constraint after it is removed will
- throw an exception.
- """
-
- def moveUp(con):
- """
- Moves the constraint up in the object's constraint stack.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @rtype: None
- """
-
- def moveDown(con):
- """
- Moves the constraint down in the object's constraint stack.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @rtype: None
- """
-
-class Constraint:
- """
- The Constraint object
- =====================
- This object provides access to a constraint for a particular object
- accessed from L{Constraints}.
- @ivar name: The name of this constraint. 29 chars max.
- @type name: string
- @ivar type: The type of this constraint. Read-only. The returned value
- matches the types in L{Type}.
- @type type: int
- @ivar influence: The influence value of the constraint. Valid values
- are in the range [0.0,1.0].
- @type influence: float
- """
-
- def __getitem__(key):
- """
- This operator returns one of the constraint's data attributes.
- @param key: value from constraint's L{Constraint.Settings} constant
- @type key: int constant
- @return: the requested data
- @rtype: varies
- @raise KeyError: the key does not exist for the constraint
- """
-
- def __setitem__(key):
- """
- This operator changes one of the constraint's data attributes.
- @param key: value from constraint's L{Constraint.Settings} constant
- @type key: int constant
- @raise KeyError: the key does not exist for the constraint
- """
-
- def insertKey(frame):
- """
- Adds an influence keyframe for the constraint Ipo.
- @rtype: None
- @param frame: the frame number at which to insert the key.
- @type frame: float
- """
diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py
deleted file mode 100644
index 765921665cd..00000000000
--- a/source/blender/python/api2_2x/doc/Curve.py
+++ /dev/null
@@ -1,729 +0,0 @@
-# Blender.Curve module and the Curve PyType object
-
-"""
-The Blender.Curve submodule.
-
-Curve Data
-==========
-
-This module provides access to B{Curve Data} objects in Blender.
-
-A Blender Curve Data consists of multiple L{CurNurb}(s). Try converting a Text object to a Curve to see an example of this. Each curve is of
-type Bezier or Nurb. The underlying L{CurNurb}(s) can be accessed with
-the [] operator. Operator [] returns an object of type L{CurNurb}. Removing a L{CurNurb} can be done this way too. del curve[0] removes the first curve.
-
-Note that L{CurNurb} can be used to acces a curve of any type (Poly, Bezier or Nurb)
-
-The Curve module also supports the Python iterator interface. This means you
-can access the L{CurNurb}(s) in a Curve and the control points in a L{CurNurb} using a
-Python B{for} statement.
-
-
-Add a Curve to a Scene Example::
- from Blender import Curve, Object, Scene
- cu = Curve.New() # create new curve data
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(cu) # make a new curve from the curve data
-
-Iterator Example::
- from Blender import Curve, Object, Scene
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.active
- curvedata = ob.data
- for curnurb in curvedata:
- print type( curnurb ), curnurb
- for point in curnurb:
- print type( point ), point
-
-Creating a Curve from a list of Vec triples Examples::
- from Blender import *
- def bezList2Curve(bezier_vecs):
- '''
- Take a list or vector triples and converts them into a bezier curve object
- '''
-
- def bezFromVecs(vecs):
- '''
- Bezier triple from 3 vecs, shortcut functon
- '''
- bt= BezTriple.New(\
- vecs[0].x, vecs[0].y, vecs[0].z,\
- vecs[1].x, vecs[1].y, vecs[1].z,\
- vecs[2].x, vecs[2].y, vecs[2].z)
-
- bt.handleTypes= (BezTriple.HandleTypes.FREE, BezTriple.HandleTypes.FREE)
-
- return bt
-
- # Create the curve data with one point
- cu= Curve.New()
- cu.appendNurb(bezFromVecs(bezier_vecs[0])) # We must add with a point to start with
- cu_nurb= cu[0] # Get the first curve just added in the CurveData
-
-
- i= 1 # skip first vec triple because it was used to init the curve
- while i<len(bezier_vecs):
- bt_vec_triple= bezier_vecs[i]
- bt= bezFromVecs(bt_vec_triple)
- cu_nurb.append(bt)
- i+=1
-
- # Add the Curve into the scene
- scn= Scene.GetCurrent()
- ob = scn.objects.new(cu)
- return ob
-"""
-
-def New ( name):
- """
- Create a new Curve Data object.
- @type name: string
- @param name: The Curve Data name.
- @rtype: Blender Curve
- @return: The created Curve Data object.
- """
-
-def Get (name = None):
- """
- Get the Curve Data object(s) from Blender.
- @type name: string
- @param name: The name of the Curve Data.
- @rtype: Blender Curve or a list of Blender Curves
- @return: It depends on the 'name' parameter:
- - (name): The Curve Data object with the given name;
- - (): A list with all Curve Data objects in the current scene.
- """
-
-class Curve:
- """
- The Curve Data object
- =====================
- This object gives access to Curve and Surface data linked from Blender Objects.
-
- @ivar name: The Curve Data name.
- @type name: string
- @ivar pathlen: The Curve Data path length, used to set the number of frames for an animation (not the physical length).
- @type pathlen: int
- @ivar totcol: The Curve Data maximal number of linked materials. Read-only.
- @type totcol: int
- @ivar flag: The Curve Data flag value; see L{getFlag()} for the semantics.
- @ivar bevresol: The Curve Data bevel resolution. [0 - 32]
- @type bevresol: int
- @ivar resolu: The Curve Data U-resolution (used for curve and surface resolution) [0 - 1024].
- @type resolu: int
- @ivar resolv: The Curve Data V-resolution (used for surface resolution) [0 - 1024].
- @type resolv: int
- @ivar width: The Curve Data width [0 - 2].
- @type width: float
- @ivar ext1: The Curve Data extent1 Called "Extrude" in the user interface (for bevels only).
- @type ext1: float
- @ivar ext2: The Curve Data extent2 - Called "Bevel Depth" in the user interface (for bevels only).
- @type ext2: float
- @ivar loc: The Curve Data location(from the center).
- @type loc: list of 3 floats
- @ivar rot: The Curve Data rotation(from the center).
- @type rot: list of 3 floats
- @ivar size: The Curve Data size(from the center).
- @type size: list of 3 floats
- @ivar bevob: The Curve Bevel Object
- @type bevob: Blender L{Object<Object.Object>} or None
- @ivar taperob: The Curve Taper Object
- @type taperob: Blender L{Object<Object.Object>} or None
- @ivar key: The Key object associated with this Curve, if any.
- @type key: Blender L{Key<Key.Key>}
- @ivar materials: The curves's materials. Each curve can reference up to
- 16 materials. Empty slots in the curve's list are represented by B{None}.
- B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- B{Note}: The list that's returned is I{not} linked to the original curve.
- curve.materials.append(material) won't do anything.
- Use curve.materials += [material] instead.
- @type materials: list of L{Material}s
- """
-
- def getName():
- """
- Get the name of this Curve Data object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Curve Data object.
- @rtype: None
- @type name: string
- @param name: The new name.
- """
-
- def getPathLen():
- """
- Get this Curve's path frame length, used for an animated path.
- @rtype: int
- @return: the path length.
- """
-
- def setPathLen(len):
- """
- Set this Curve's path length.
- @rtype: None
- @type len: int
- @param len: the new curve's length.
- """
-
- def getTotcol():
- """
- Get the number of materials linked to the Curve.
- @rtype: int
- @return: number of materials linked.
- """
-
- def setTotcol(totcol):
- """
- Set the number of materials linked to the Curve. B{Note}: this method
- will probably be deprecated in the future.
- @rtype: None
- @type totcol: int
- @param totcol: number of materials linked.
- @warn: It is not advisable to use this method unless you know what you
- are doing; it's possible to
- corrupt a .blend file if you don't know what you're doing. If you want
- to change the number of materials, use the L{materials} attribute.
- """
-
- def getFlag():
- """
- Get the Curve flag value.
- This item is a bitfield whose value is a combination of the following parameters.
- - Bit 0 : "3D" is set
- - Bit 1 : "Front" is set
- - Bit 2 : "Back" is set
- - Bit 3 : "CurvePath" is set.
- - Bit 4 : "CurveFollow" is set.
-
- @rtype: integer bitfield
- """
-
- def setFlag(val):
- """
- Set the Curve flag value. The flag corresponds to the Blender settings for 3D, Front, Back, CurvePath and CurveFollow. This parameter is a bitfield.
- @rtype: None
- @type val: integer bitfield
- @param val : The Curve's flag bits. See L{getFlag} for the meaning of the individual bits.
- """
-
- def getBevresol():
- """
- Get the Curve's bevel resolution value.
- @rtype: float
- """
-
- def setBevresol(bevelresol):
- """
- Set the Curve's bevel resolution value.
- @rtype: None
- @type bevelresol: float
- @param bevelresol: The new Curve's bevel resolution value.
- """
-
- def getResolu():
- """
- Get the Curve's U-resolution value.
- @rtype: float
- """
-
- def setResolu(resolu):
- """
- Set the Curve's U-resolution value. [0 - 1024]
- This is used for surfaces and curves.
- @rtype: None
- @type resolu: float
- @param resolu: The new Curve's U-resolution value.
- """
-
- def getResolv():
- """
- Get the Curve's V-resolution value.
- @rtype: float
- """
-
- def setResolv(resolv):
- """
- Set the Curve's V-resolution value. [0 - 1024].
- This is used for surfaces only.
- @rtype: None
- @type resolv: float
- @param resolv: The new Curve's V-resolution value.
- """
-
- def getWidth():
- """
- Get the Curve's width value.
- @rtype: float
- """
-
- def setWidth(width):
- """
- Set the Curve's width value.
- @rtype: None
- @type width: float
- @param width: The new Curve's width value.
- """
-
- def getExt1():
- """
- Get the Curve's ext1 value.
- @rtype: float
- """
-
- def setExt1(ext1):
- """
- Set the Curve's ext1 value.
- @rtype: None
- @type ext1: float
- @param ext1: The new Curve's ext1 value.
- """
-
- def getExt2():
- """
- Get the Curve's ext2 value.
- @rtype: float
- """
-
- def setExt2(ext2):
- """
- Set the Curve's ext2 value.
- @rtype: None
- @type ext2: float
- @param ext2: The new Curve's ext2 value.
- """
-
- def getControlPoint(numcurve,numpoint):
- """
- Get the curve's control point value (B{deprecated}). The numpoint arg
- is an index into the list of points and starts with 0. B{Note}: new
- scripts should use the [] operator on Curves and CurNurbs. Example::
- curve = Blender.Curve.Get('Curve')
- p0 = curve[0][0] # get first point from first nurb
- # -- OR --
- nurb = curve[0] # get first nurb
- p0 = nurb[0] # get nurb's first point
-
- @type numcurve: int
- @type numpoint: int
- @rtype: list of floats
- @return: depends upon the curve's type.
- - type Bezier : a list of nine floats. Values are x, y, z for handle-1, vertex and handle-2
- - type Nurb : a list of 4 floats. Values are x, y, z, w.
-
- """
-
- def setControlPoint( numcurve, numpoint, controlpoint):
- """
- Set the Curve's controlpoint value. The numpoint arg is an index into the list of points and starts with 0.
- @rtype: None
- @type numcurve: int
- @type numpoint: int
- @type controlpoint: list
- @param numcurve: index for spline in Curve, starting from 0
- @param numpoint: index for point in spline, starting from 0
- @param controlpoint: The new controlpoint value.
- See L{getControlPoint} for the length of the list.
- """
-
- def appendPoint( numcurve, new_control_point ):
- """
- Add a new control point to the indicated curve (B{deprecated}).
- New scripts should use L{CurNurb.append()}.
- @rtype: None
- @type numcurve: int
- @type new_control_point: list of floats or BezTriple
- @param numcurve: index for spline in Curve, starting from 0
- @param new_control_point: depends on curve's type.
- - type Bezier: a BezTriple
- - type Nurb: a list of four or five floats for the xyzw values
- @raise AttributeError: throws exception if numcurve is out of range.
- """
-
- def appendNurb( new_point ):
- """
- add a new curve to this Curve. The new point is added to the new curve. Blender does not support a curve with zero points. The new curve is added to the end of the list of curves in the Curve.
- @rtype: CurNurb
- @return: the newly added spline
- @type new_point: BezTriple or list of xyzw coordinates for a Nurb curve.
- @param new_point: see L{CurNurb.append} for description of parameter.
- """
-
- def getLoc():
- """
- Get the curve's location value.
- @rtype: a list of 3 floats.
- """
-
- def setLoc(location):
- """
- Set the curve's location value.
- @rtype: None
- @type location: list[3]
- @param location: The new Curve's location values.
- """
-
- def getRot():
- """
- Get the curve's rotation value.
- @rtype: a list of 3 floats.
- """
-
- def setRot(rotation):
- """
- Set the Curve's rotation value.
- @rtype: None
- @type rotation: list[3]
- @param rotation: The new Curve's rotation values.
- """
-
- def getSize():
- """
- Get the curve's size value.
- @rtype: a list of 3 floats.
- """
-
- def setSize(size):
- """
- Set the curve size value.
- @rtype: None
- @type size: list[3]
- @param size: The new Curve's size values.
- """
-
- def getMaterials():
- """
- Returns a list of materials assigned to the Curve.
- @rtype: list of Material Objects
- @return: list of Material Objects assigned to the Curve.
- """
-
- def getBevOb():
- """
- Returns the Bevel Object (BevOb) assigned to the Curve.
- @rtype: Blender Object or None
- @return: Bevel Object (BevOb) assigned to the Curve.
- """
-
- def setBevOb( object ):
- """
- Assign a Bevel Object (BevOb) to the Curve. Passing None as the object parameter removes the bevel.
- @rtype: None
- @return: None
- @type object: Curve type Blender Object
- @param object: Blender Object to assign as Bevel Object (BevOb)
- @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
- """
-
- def getTaperOb():
- """
- Returns the Taper Object (TaperOb) assigned to the Curve.
- @rtype: Blender Object or None
- @return: Taper Object (TaperOb) assigned to the Curve.
- """
-
- def setTaperOb( object ):
- """
- Assign a Taper Object (TaperOb) to the Curve. Passing None as the object parameter removes the taper.
- @rtype: None
- @return: None
- @type object: Curve type Blender Object
- @param object: Blender Object to assign as Taper Object (TaperOb)
- @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
- """
-
- def update():
- """
- Updates display list for a Curve.
- Used after making changes to control points.
- You B{must} use this if you want to see your changes!
- @rtype: None
- @return: None
- """
-
- def isNurb( curve_num ):
- """
- Tells type of a CurNurb (B{deprecated}).
- New scripts should use L{CurNurb.isNurb()}.
-
- @rtype: integer
- @return: Zero if curve is type Bezier, one if curve is of type Nurb.
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve.
- @raise AttributeError: throws exception if curve_num is out of range.
- """
-
- def isCyclic( curve_num ):
- """
- Tells whether or not a CurNurb is cyclic (closed) (B{deprecated}).
- New scripts should use L{CurNurb.isCyclic()}.
-
- @rtype: boolean
- @return: True if is cyclic, False if not
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve
- @raise AttributeError: throws exception if curve_num is out of range.
- """
-
- def switchDirection( ):
- """
- Reverse the direction of a curve.
- @return: None
-
- I{B{Example:}}
- # This example switches the direction of all curves on the active object.
- from Blender import *
- scn = Scene.GetCurrent()
- ob = scn.objects.active # must be a curve
- data = ob.data
- for cu in data: cu.switchDirection()
- """
-
- def getNumCurves():
- """
- Get the number of curves in this Curve Data object.
- @rtype: integer
- """
-
- def getNumPoints( curve_num ):
- """
- Get the number of control points in the curve (B{deprecated}).
- New scripts should use the len operator (I{len(curve)}).
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve
- @rtype: integer
- """
-
- def getKey():
- """
- Return the L{Key<Key.Key>} object containing the keyframes for this
- curve, if any.
- @rtype: L{Key<Key.Key>} object or None
- """
-
- def recalc():
- """
- Recalculate control point handles after a curve has been changed.
- @rtype: None
- """
-
- def __copy__ ():
- """
- Make a copy of this curve
- @rtype: Curve
- @return: a copy of this curve
- """
-
-class CurNurb:
- """
- The CurNurb Object
- ==================
- This object provides access to the control points of the curves that make up a Blender Curve ObData.
-
- The CurNurb supports the python iterator protocol which means you can use a python for statement to access the points in a curve.
-
- The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator.
-
- Note that CurNurb is used for accesing poly, bezier and nurbs type curves.
-
- @ivar flagU: The CurNurb knot flag U. See L{setFlagU} for description.
- @type flagU: int
- @ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description.
- @type flagV: int
- @ivar orderU: The CurNurb knot order U, for nurbs curves only, this is clamped by the number of points, so the orderU will never be greater.
- @type orderU: int
- @ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)
- @type type: int
- @ivar knotsU: The knot vector in the U direction. The tuple will be empty
- if the curve isn't a NURB or doesn't have knots in this direction.
- @type knotsU: tuple of floats
- @ivar knotsV: The knot vector in the V direction. The tuple will be empty
- if the curve isn't a NURB or doesn't have knots in this direction.
- @type knotsV: tuple of floats
- @ivar smooth: Set the smoothing for this curve (applies to cuve objects that have a bevel)
- @type smooth: bool
- """
-
- def __setitem__( n, point ):
- """
- Replace the Nth point in the curve. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
- @rtype: None
- @return: None
- @type n: integer
- @param n: the index of the element to replace
- @type point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
- @param point: the point that will replace the one in the curve. The point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
- """
-
- def __getitem__( n ):
- """
- Get the Nth element in the curve. For Bezier curves, that element is a BezTriple. For the rest (Poly and Nurbs), it is a list of 5 floats: x, y, z, weight, tilt (in radians). NOTE 1: This element is independent on the curve, modifying it will not affect the curve. NOTE 2: Each successive call returns a new object.
- @rtype: BezTriple (Bezier Curve) or List of 5 floats [x, y, z, w, t] for Poly or Nurbs
- @return: The Nth element in the curve
- @type n: integer
- @param n: the index of the element to return
- """
-
- def append( new_point ):
- """
- Appends a new point to a curve. This method appends points to both Bezier and Nurb curves. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
- @rtype: None
- @return: None
- @type new_point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
- @param new_point: the new point to be appended to the curve. The new point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
- """
-
- def setMatIndex( index ):
- """
- Sets the Material index for this CurNurb.
- @rtype: None
- @return: None
- @type index: integer
- @param index: the new value for the Material number of this CurNurb. No range checking is done.
- """
-
- def getMatIndex():
- """
- Returns the Material index for this CurNurb.
- @rtype: integer
- @return: integer
- """
-
- def isNurb():
- """
- Boolean method used to determine whether a CurNurb is of type Bezier or of type Nurb.
- @rtype: boolean
- @return: True or False
- """
-
- def isCyclic():
- """
- Boolean method checks whether a CurNurb is cyclic (a closed curve) or not.
- @rtype: boolean
- @return: True or False
- """
-
- def getFlagU():
- """
- Get the CurNurb knot flag U.
- @rtype: integer
- @return: See L{setFlagU} for description of return value.
- """
-
- def setFlagU( flag ):
- """
- Set the entire CurNurb knot flag U (knots are recalculated automatically).
- The flag can be one of six values:
- - 0 or 1: uniform knots
- - 2 or 3: endpoints knots
- - 4 or 5: bezier knots
- Bit 0 controls whether or not the curve is cyclic (1 = cyclic).
- @type flag: integer
- @param flag: CurNurb knot flag
- @rtype: None
- @return: None
- """
-
- def getFlagV():
- """
- Get the CurNurb knot flag V.
- @rtype: integer
- @return: See L{setFlagU} for description of return value.
- """
-
- def setFlagV( value ):
- """
- Set the CurNurb knot flag V (knots are recalculated automatically).
- @type value: integer
- @param value: See L{setFlagU} for description of return.
- @rtype: None
- @return: None
- """
-
- def getType():
- """
- Get the type of the curve.
- @rtype: integer
- @return: 0 - Poly, 1 - Bezier, 4 - NURBS
- """
-
- def setType( value ):
- """
- Set the type of the curve and converts the curve to its new type if needed
- @type value: integer
- @param value: CurNurb type flag (0 - Poly, 1 - Bezier, 4 - NURBS)
- @rtype: None
- @return: None
- """
-
-class SurfNurb:
- """
- The SurfNurb Object
- ===================
- This object provides access to the control points of the surfaces that make
- up a Blender Curve.
-
- The SurfNurb supports the Python iterator and sequence protocols which
- means you can use a python B{for} statement or [] operator to access the
- points in a surface. Points are accessed linearly; for a N-by-M UV surface,
- the first N control points correspond to V=0, then second N to V=1, and so
- on.
-
- @ivar flagU: The knot flag U. Changing the knot type automatically
- recalculates the knots. The flag can be one of three values:
- - 0 : uniform knots
- - 1 : endpoints knots
- - 2 : bezier knots
- @type flagU: int
- @ivar flagV: The knot flag V. See L{flagU} for description.
- @type flagV: int
- @ivar pointsU: The number of control points in the U direction (read only).
- @type pointsU: int
- @ivar pointsV: The number of control points in the V direction (read only).
- @type pointsV: int
- @ivar cyclicU: The cyclic setting for the U direction (True = cyclic).
- @type cyclicU: boolean
- @ivar cyclicV: The cyclic setting for the V direction (True = cyclic).
- @type cyclicV: boolean
- @ivar orderU: The order setting for the U direction. Values are clamped
- to the range [2:6] and not greater than the U dimension.
- @type orderU: int
- @ivar orderV: The order setting for the V direction. Values are clamped
- to the range [2:6] and not greater than the V dimension.
- @type orderV: int
- @ivar knotsU: The The knot vector in the U direction
- @type knotsU: tuple
- @ivar knotsV: The The knot vector in the V direction
- @type knotsV: tuple
- """
-
- def __setitem__( n, point ):
- """
- Set the Nth control point in the surface.
- @rtype: None
- @return: None
- @type n: integer
- @param n: the index of the point to replace
- @type point: list of 4 floats (optional 5th float is the tilt value
- in radians)
- @param point: the point that will replace the one in the curve. The
- point is list of 4 floats in x,y,z,w (optionally tilt in radians as
- 5th value) format.
- """
-
- def __getitem__( n ):
- """
- Get the Nth control point in the surface.
- @rtype: List of 5 floats [x, y, z, w, t] for Poly or Nurbs
- @return: The Nth point in the curve
- @type n: integer
- @param n: the index of the point to return
- @note: This returned value is independent on the curve; modifying it will not affect the curve.
- @note: Each successive call returns a new object.
- """
-
diff --git a/source/blender/python/api2_2x/doc/Curvedoc.txt b/source/blender/python/api2_2x/doc/Curvedoc.txt
deleted file mode 100644
index cb435ff4048..00000000000
--- a/source/blender/python/api2_2x/doc/Curvedoc.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-CURVE Module documentation
-
-
-
-
-INTRODUCTION
-
-The Curve module gives access to the curves objects. Curves are used for many things in blender : creation of graphical objects, duplication of meshes, displacement of meshes, in IPOs for instance.
-Blender has three main types of curves :
- nurbs curves, each control point has three coordinates.
- bezier curves, each control point has nine coordinates.
- text curves, which represent graphical text objects.
-
-
-
-
-
-
-functions of the module :
-
-Get(Name:string) : returns the Curve whose name is Name.
-
-get : same as Get
-
-New(Name:string (optional)) : Creates a new Curve Object.
-If the parameter Name is given, it will be the name of the Curve Object,
-else the name will be choosen by blender.
-
-
-Curve Object member functions :
-
-getName() : Retreives the Curve Object name.
-
-setName(Name : string) : Sets the Curve Object name.
-
-getPathLen() : Retrieves the Curve Object path length.
-
-setPathLen(len:int) : Sets the Curve Object path length.
-
-getTotcol() : Retreives the parameter totcol of the Curve.
-
-setTotcol(val:int) : Sets the parameter totcol
-/*I do not know what means this parameter...*/
-
-getFlag()Retrieves the mode of the Curve Object
-
-setFlag(val:int) :Sets the mode of the Curve.
-
-The mode of the curve is a combination of parameters.
-Bits 0,1,2 : "Back", "Front" and "3D".
-Bit 3 : "CurvePath" is set.
-Bit 4 : "CurveFollow" is set.
-
-getBevresol() : Retreives the bevel resolution of the curve.
-
-setBevresol(val:float) : Sets the bevel resolution of the curve.
-
-getResolu() : Retreives the U-resolution of the curve.
-
-setResolu(val:int) : sets the U-resolution of the curve.
-
-getResolv() : Retreives the V-resolution of the curve.
-
-setResolv(val:int) : sets the V-resolution of the curve.
-
-getWidth() : Retreives the bevel width of the curve.
-
-setWidth(val:float) : Sets the bevel width.
-
-getExt1() : Retreives the bevel height1 of the curve.
-
-setExt1(val:float) : Sets the bevel height1 of the curve.
-
-getExt2() : Retreives the bevel height2 of the curve.
-
-setExt2(val:float) : Sets the bevel height2 of the curve.
-
-getControlPoint(i:int) : Retreives the i-th control point.
-Depending upon the curve type, returne a list of 4(nurbs) or 9(bez) floats.
-
-setControlPoint(i:int, x1:float,...x4:float)
-setControlPoint(i:int, x1:float,...x9:float) : Sets the i-th control point value.
-
-getLoc() : Retreives the Curve location(from the center)
-
-setLoc(x:float,y:float,z:float) : Sets the Curve location
-
-getRot() : Retreives the Curve rotation(from the center)
-
-setRot(x:float,y:float,z:float) : Sets the Curve rotation.
-
-getSize() : Retreives the Curve size.
-
-setSize(x:float,y:float,z:float) : Sets the Curve size.
-
-Direct acces to the parameters values : You cann read and write the parameter XXX with the following syntax :
-val = obj.XXX
-or obj.XXX = val.
-The possible parameters names are :"name","pathlen","resolu","resolv","width","ext1", and "ext2"
-
-
-
-
-
-Submodules : No submodule.
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py
deleted file mode 100644
index 98e92196f8d..00000000000
--- a/source/blender/python/api2_2x/doc/Draw.py
+++ /dev/null
@@ -1,906 +0,0 @@
-# Blender.Draw module and the Button PyType object
-
-"""
-The Blender.Draw submodule.
-
-Draw
-====
-
-B{New}:
- - access to ASCII values in L{events<Register>} callbacks;
- - 'large' fonts for L{Text} and L{GetStringWidth}.
- - Pop-up blocks with L{PupBlock}
- - Color Picker button with L{ColorPicker}
-
-This module provides access to a B{windowing interface} in Blender. Its widgets
-include many kinds of buttons: push, toggle, menu, number, string, slider,
-scrollbar, plus support for text drawing. It also includes keyboard keys and
-mouse button code values in its dictionary, see a list after this example.
-
-Example::
- import Blender
- from Blender import Draw, BGL
-
- mystring = ""
- mymsg = ""
- toggle = 0
-
- def event(evt, val): # the function to handle input events
- global mystring, mymsg
-
- if not val: # val = 0: it's a key/mbutton release
- if evt in [Draw.LEFTMOUSE, Draw.MIDDLEMOUSE, Draw.RIGHTMOUSE]:
- mymsg = "You released a mouse button."
- Draw.Redraw(1)
- return
-
- if evt == Draw.ESCKEY:
- Draw.Exit() # exit when user presses ESC
- return
-
- elif Draw.AKEY <= evt <= Draw.ZKEY: mystring += chr(evt)
- elif evt == Draw.SPACEKEY: mystring += ' '
- elif evt == Draw.BACKSPACEKEY and len(mystring):
- mystring = mystring[:-1]
- else: return # no need to redraw if nothing changed
-
- Draw.Redraw(1)
-
- def button_event(evt): # the function to handle Draw Button events
- global mymsg, toggle
- if evt == 1:
- mymsg = "You pressed the toggle button."
- toggle = 1 - toggle
- Draw.Redraw(1)
-
- def gui(): # the function to draw the screen
- global mystring, mymsg, toggle
- if len(mystring) > 90: mystring = ""
- BGL.glClearColor(0,0,1,1)
- BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
- BGL.glColor3f(1,1,1)
- Draw.Toggle("Toggle", 1, 10, 10, 55, 20, toggle,"A toggle button")
- BGL.glRasterPos2i(72, 16)
- if toggle: toggle_state = "down"
- else: toggle_state = "up"
- Draw.Text("The toggle button is %s." % toggle_state, "small")
- BGL.glRasterPos2i(10, 230)
- Draw.Text("Type letters from a to z, ESC to leave.")
- BGL.glRasterPos2i(20, 200)
- Draw.Text(mystring)
- BGL.glColor3f(1,0.4,0.3)
- BGL.glRasterPos2i(340, 70)
- Draw.Text(mymsg, "tiny")
-
- Draw.Register(gui, event, button_event) # registering the 3 callbacks
-
-All available events:
- - ACCENTGRAVEKEY
- - AKEY
- - BACKSLASHKEY
- - BACKSPACEKEY
- - BKEY
- - CAPSLOCKKEY
- - CKEY
- - COMMAKEY
- - DELKEY
- - DKEY
- - DOWNARROWKEY
- - EIGHTKEY
- - EKEY
- - ENDKEY
- - EQUALKEY
- - ESCKEY
- - F10KEY
- - F11KEY
- - F12KEY
- - F1KEY
- - F2KEY
- - F3KEY
- - F4KEY
- - F5KEY
- - F6KEY
- - F7KEY
- - F8KEY
- - F9KEY
- - FIVEKEY
- - FKEY
- - FOURKEY
- - GKEY
- - HKEY
- - HOMEKEY
- - IKEY
- - INPUTCHANGE
- - INSERTKEY
- - JKEY
- - KEYBD
- - KKEY
- - LEFTALTKEY
- - LEFTARROWKEY
- - LEFTBRACKETKEY
- - LEFTCTRLKEY
- - LEFTMOUSE
- - LEFTSHIFTKEY
- - LINEFEEDKEY
- - LKEY
- - MIDDLEMOUSE
- - MINUSKEY
- - MKEY
- - MOUSEX
- - MOUSEY
- - NINEKEY
- - NKEY
- - OKEY
- - ONEKEY
- - PAD0
- - PAD1
- - PAD2
- - PAD3
- - PAD4
- - PAD5
- - PAD6
- - PAD7
- - PAD8
- - PAD9
- - PADASTERKEY
- - PADENTER
- - PADMINUS
- - PADPERIOD
- - PADPLUSKEY
- - PADSLASHKEY
- - PAGEDOWNKEY
- - PAGEUPKEY
- - PAUSEKEY
- - PERIODKEY
- - PKEY
- - QFULL
- - QKEY
- - QUOTEKEY
- - Q_FIRSTTIME
- - RAWKEYBD
- - REDRAW
- - RETKEY
- - RIGHTALTKEY
- - RIGHTARROWKEY
- - RIGHTBRACKETKEY
- - RIGHTCTRLKEY
- - RIGHTMOUSE
- - RIGHTSHIFTKEY
- - RKEY
- - SEMICOLONKEY
- - SEVENKEY
- - SIXKEY
- - SKEY
- - SLASHKEY
- - SPACEKEY
- - TABKEY
- - THREEKEY
- - TIMER0
- - TIMER1
- - TIMER2
- - TIMER3
- - TKEY
- - TWOKEY
- - UKEY
- - UPARROWKEY
- - VKEY
- - WHEELDOWNMOUSE
- - WHEELUPMOUSE
- - WINCLOSE
- - WINFREEZE
- - WINQUIT
- - WINTHAW
- - WKEY
- - XKEY
- - YKEY
- - ZEROKEY
- - ZKEY
-
-@note: function Button has an alias: L{PushButton}.
-
-@warn: B{very important}: if using your script causes "Error totblock"
-messages when Blender exits (meaning that memory has been leaked), this may
-have been caused by an ignored return value from one of the button types. To
-avoid this, assign created buttons return values to B{global} variables,
-instead of ignoring them. Examples::
-
- # avoid this, it can cause memory leaks:
- Draw.Toggle(...)
- Draw.Number(...)
- Draw.String(...)
- # this is correct -- assuming the variables are globals:
- my_toggle_button = Draw.Toggle(...)
- my_int_button = Draw.Number(...)
- my_str_button = Draw.String(...)
-
-
-@warn: Inside the windowing loop (after Draw.Register() has been executed and
-before Draw.Exit() is called), don't use the redraw functions from other
-modules (Blender and Window). The Draw submodule has its own Draw.Redraw() and
-Draw.Draw() functions that can be used inside the windowing loop.
-"""
-
-def Exit():
- """
- Exit the windowing interface.
- """
-
-def BeginAlign():
- """
- Buttons after this function will draw aligned (button layout only).
- """
-
-def EndAlign():
- """
- Use after BeginAlign() to stop aligning the buttons (button layout only).
- """
-
-def UIBlock(draw, mouse_exit=1):
- """
- This function creates a popup area where buttons, labels, sliders etc can be drawn.
-
- @type mouse_exit: int
- @param mouse_exit: When zero the popup wont close when the mouse moves away from the popup.
- @type draw: function
- @param draw: A function to draw to the popup area, taking no arguments: draw().
-
- @note: The size of the popup will expand to fit the bounds of the buttons created in the draw function.
- @note: If mouse_exit is nonzero be sure to use the mouse coordinates if to position the buttons under the mouse,
- so the popup dosn't exit as soon as it opens.
- The coordinates for buttons start 0,0 at the bottom left hand side of the screen.
- @note: Within this popup, Redraw events and the registered button callback will not work.
- For buttons to run events, use per button callbacks instead.
- @note: OpenGL drawing functions wont work within this popup, for text use L{Label} rather then L{Text}
- @warning: L{Menu} will not work properly within a UIBlock, this is a limitation with blenders user interface internals.
- """
-
-def Register(draw = None, event = None, button = None):
- """
- Register callbacks for windowing.
- @type draw: function
- @type event: function
- @type button: function
- @param draw: A function to draw the screen, taking no arguments: draw().
- @param event: A function to handle keyboard and mouse input events, taking
- two arguments: f(evt, val), where:
- - 'evt' (int) is the event number;
- - 'val' (int) is the value modifier. If val = 0, the event refers to a
- key or mouse button being released. Otherwise it's a key/button press.
- @param button: A function to handle Draw Button events, taking one argument:
- f(evt), where:
- - 'evt' is the button number (see the I{event} parameter in L{Button}).
- @note: note that in the example at the beginning of this page Draw.Register
- is called only once. It's not necessary to re-register the callbacks,
- they will stay until Draw.Exit is called. It's enough to redraw the
- screen, when a relevant event is caught.
- @note: only during the B{event} callback: the L{Blender}.ascii variable holds
- the ASCII integer value (if it exists and is valid) of the current event.
- """
-
-def Redraw(after = 0):
- """
- Queue a redraw event. Redraw events are buffered so that, regardless of how
- many events are queued, the window only receives one redraw event.
- @type after: int
- @param after: If non-zero, the redraw is processed before other input events.
- """
-
-def Draw():
- """
- Force an immediate redraw. Forced redraws are not buffered. In other words,
- the window is redrawn once every time this function is called.
- """
-
-def Create(value):
- """
- Create a default Button object.
- @type value: int, float, string or 3 floats
- @param value: The value to store in the button.
- @rtype: Blender Button
- @return: The Button created.
- @note: String values must have less then 400 characters.
- """
-
-def PushButton(name, event, x, y, width, height, tooltip = None, callback = None):
- """
- Create a new (push) Button object.
- @type name: string
- @param name: The string to display on the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @note: This function used to be called only "Button". We added an
- alternative alias to avoid a name clash with the L{Button} class/type that
- caused trouble in this documentation's generation. The old name shouldn't
- be deprecated, use Button or PushButton (better) at your choice.
- """
-
-def PupMenu(name, maxrow = None):
- """
- Create a pop-up menu.
-
- The menu options are specified through the 'name' parameter, like with
- L{Menu}: options are followed by a format code and separated by the '|'
- character. Valid format codes are:
- - %t - The option should be used as the title of the pop-up;
- - %l - insert a separating line (only works if 'maxrow' isn't given);
- - %xB{N} - Chosen this option, PupMenu should return the integer B{N}.
-
- Example::
- name = "OK?%t|QUIT BLENDER" # if no %xN int is set, indices start from 1
- result = Draw.PupMenu(name)
- if result:
- Draw.PupMenu("Really?%t|Yes|No")
-
- @type name: string
- @param name: The format string to define the contents of the button.
- @type maxrow: int
- @param maxrow: The maximum number of rows for each column in the pop-up.
- @rtype: int
- @return: the chosen entry number or -1 if none was chosen.
- """
-
-def PupTreeMenu( menu ):
- """
- Create a popup menu tree.
-
- Each item in the list is: a menu item - (str, event); a separator - None;
- or submenu - (str, [...]).
-
- Submenus list uses the same syntax as the menu list. To add a title to the
- main menu, end the first entry str with '%t' - the event is ignored.
-
- Example::
- result = Draw.PupTreeMenu( [ ("Title%t", 0), ("Menu Item 1", 10), ("Menu Item 2", 12), ("SubMenu", [("Menu Item 3", 100), ("MenuItem4", 101) ] ) ] )
-
- @type menu: string
- @param menu: A menu list
- @rtype: int
- @return: the chosen entry number or -1 if none was chosen.
- """
-
-def PupIntInput(text, default, min, max):
- """
- Create an integer number input pop-up.
-
- This allows python to use Blender's integer number pop-up input.
-
- Example::
- default = 50
- min = 0
- max = 100
-
- msg = "Set this value between 0 and 100"
- result = Draw.PupIntInput(msg, default, min, max)
- if result != None:
- print result
- else:
- print 'no user input'
-
- @type text: string
- @param text: The text that is displayed in the pop-up.
- @type default: int
- @param default: The value that the pop-up is set to initially.
- @type min: int
- @param min: The lowest value the pop-up will allow.
- @type max: int
- @param max: The highest value the pop-up will allow.
- @rtype: int
- @return: the number chosen or None if none was chosen.
- """
-
-def PupFloatInput(text, default, min, max, clickStep, floatLen):
- """
- Create a floating point number input pop-up.
-
- This allows python to use Blender's floating point pop-up input.
-
- Example::
- default = 50
- min = 0.0
- max = 10.0
- clickStep = 100
- floatLen = 3
-
- msg = "Set this value between 0 and 100"
- result = Draw.PupFloatInput(msg, default, min, max, clickStep, floatLen)
- if result != None:
- print result
- else:
- print 'no user input'
-
- @type text: string
- @param text: The text that is displayed in the pop-up.
- @type default: float
- @param default: The value that the pop-up is set to initially.
- @type min: float
- @param min: The lowest value the pop-up will allow.
- @type max: float
- @param max: The highest value the pop-up will allow.
- @type clickStep: int
- @param clickStep: How much is incremented per user click, 100 will increment 1.0, 10 will increment 0.1 etc.
- @type floatLen: int
- @param floatLen: The number of decimal places to display, between 2 and 4.
- @rtype: float
- @return: the number chosen or None if none was chosen.
- """
-
-def PupStrInput(text, default, max = 20):
- """
- Create a string input pop-up.
-
- This allows python to use Blender's string pop-up input.
-
- Example::
- Blender.Draw.PupStrInput("Name:", "untitled", 25)
-
- @type text: string
- @param text: The text that is displayed in the pop-up.
- @type default: string
- @param default: The value that the pop-up is set to initially. If it's longer
- then 'max', it's truncated.
- @type max: int
- @param max: The most characters the pop-up input will allow. If not given
- it defaults to 20 chars. It should be in the range [1, 100].
- @rtype: string
- @return: The text entered by the user or None if none was chosen.
- """
-
-def PupBlock(title, sequence):
- """
- Display a pop-up block.
-
- Possible formats for the items in the sequence parameter.
- (Value are objects created with L{Create})
- - string: Defines a label
- - (string, Value, string): Defines a toggle button. The first string is the text on the button, the optional second string is the tooltip.
- - (string, Value, min, max, string): Defines a numeric or string button, depending on the content of Value. The first string is the text on the button, the optional second string is the tooltip. I{For string, max is the maximum length of the string and min is unused.}
-
- Example::
- import Blender
-
- text = Blender.Draw.Create("short text")
- f = Blender.Draw.Create(1.0)
- i = Blender.Draw.Create(2)
- tog = Blender.Draw.Create(0)
-
- block = []
-
- block.append(("Name: ", text, 0, 30, "this is some tool tip"))
- block.append("Some Label")
- block.append(("Value: ", f, 0.0, 100.0))
- block.append(("Value: ", i, 0, 100))
- block.append(("Option", tog, "another tooltip"))
-
- retval = Blender.Draw.PupBlock("PupBlock test", block)
-
- print "PupBlock returned", retval
-
- print "text\\t", text
- print "float\\t", f
- print "int\\t", i
- print "toggle\\t", tog
-
- @warning: On cancel, the Value objects are brought back to there initial values except for string values which will still contain the modified values.
- @type title: string
- @param title: The title of the block.
- @param sequence: A sequence defining what the block contains.
- The order of the list is the order of appearance, from top down.
- @rtype: int
- @return: 1 if the pop-up is confirmed, 0 otherwise
- """
-
-def Menu(name, event, x, y, width, height, default, tooltip = None, callback = None):
- """
- Create a new Menu Button object.
-
- The menu options are specified through the 'name' of the button. Options are
- I{followed} by a format code and separated by the '|' (pipe) character. Valid
- format codes are:
- - %t - The option should be used as the title;
- - %l - Insert a separating line;
- - %xB{N} - The option should set the integer B{N} in the button value.
-
- Example::
- name = "The Title %t|First Entry %x1|Second Entry %x2|Third Entry %x3"
- menu = Draw.Menu(name, 2, 60, 120, 200, 40, 3, "Just a test menu.")
- # note that, since default = 3, the "Third Entry"
- # will appear as the default choice in the Menu.
-
- @type name: string
- @param name: The format string to define the contents of the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type default: int
- @param default: The number of the option to be selected by default.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- """
-
-def Toggle(name, event, x, y, width, height, default, tooltip = None, callback = None):
- """
- Create a new Toggle Button object.
- @type name: string
- @param name: The string to display on the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type default: int
- @param default: The value specifying the default state:
- (0 for "up", 1 for "down").
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- """
-
-def Slider(name, event, x, y, width, height, initial, min, max, realtime = 1,
- tooltip = None, callback = None):
- """
- Create a new Slider Button object.
- @type name: string
- @param name: The string to display on the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type initial: int or float
- @type min: int or float
- @type max: int or float
- @param initial: The initial value.
- @param min: The minimum value.
- @param max: The maximum value.
- @type realtime: int
- @param realtime: If non-zero (the default), the slider will emit events as
- it is edited.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
-
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- @note: slider callbacks will not work if the realtime setting is enabled.
- """
-
-#def Scrollbar(event, x, y, width, height, initial, min, max, realtime = 1,
-# tooltip = None):
-# """
-# Create a new Scrollbar Button object.
-# @type event: int
-# @param event: The event number to pass to the button event function when
-# activated.
-# @type x: int
-# @type y: int
-# @param x: The lower left x (horizontal) coordinate of the button.
-# @param y: The lower left y (vertical) coordinate of the button.
-# @type width: int
-# @type height: int
-# @param width: The button width.
-# @param height: The button height.
-# @type initial: int or float
-# @type min: int or float
-# @type max: int or float
-# @param initial: The initial value.
-# @param min: The minimum value.
-# @param max: The maximum value.
-# @type realtime: int
-# @param realtime: If non-zero (the default), the slider will emit events as
-# it is edited.
-# @type tooltip: string
-# @param tooltip: The button's tooltip (the string that appears when the mouse
-# is kept over the button).
-# @rtype: Blender Button
-# @return: The Button created.
-# """
-
-def ColorPicker(event, x, y, width, height, initial, tooltip = None, callback = None):
- """
- Create a new Color Picker Button object.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type initial: 3-float tuple
- @param initial: The initial color value. All values must be between 0 and 1
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- @note: The color picker will not work if the Register's event function is None.
- @note: Using the same button variable with more then 1 button at a time will corrupt memory.
- """
-
-def Normal(event, x, y, width, height, initial, tooltip = None, callback = None):
- """
- Create a new Normal button, this allows you to set a 3d vector by rotating a sphere.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width - non square normal buttons .
- @param height: The button height.
- @type initial: 3-float tuple
- @param initial: The initial vector value.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- @note: The normal button will not work if the Register's event function is None.
- @note: Using the same button variable with more then 1 button at a time will corrupt memory.
- """
-
-def Number(name, event, x, y, width, height, initial, min, max, tooltip = None, callback = None, clickstep = None, precision = None):
- """
- Create a new Number Button object.
- @type name: string
- @param name: The string to display on the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type initial: int or float
- @type min: int or float
- @type max: int or float
- @param initial: The initial value.
- @param min: The minimum value.
- @param max: The maximum value.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @type clickstep: float
- @param clickstep: an optional argument to control the amount of change per click on the button.
- @type precision: float
- @param precision: an optional argument to control the amount of places after the decimal. From 1 to 4 places with 1.0..4.0.
- Larger values are clamped to 4 places.
- @rtype: Blender Button
- @return: The Button created.
-
- I{B{Example:}}
-
- This example draws a single floating point value::
- from Blender import Draw
- b= Draw.Create(0.0) # Data for floating point button
- def bevent(evt):
- print 'My Button event:', evt
- def gui():
- global b
- b= Draw.Number('value: ', 1000, 0,0, 200, 20, b.val, 0,10, 'some text tip')
-
- Draw.Register(gui, None, bevent) # we are not going to worry about keyboard and mouse events
- """
-
-
-def String(name, event, x, y, width, height, initial, length, tooltip = None, callback = None):
- """
- Create a new String Button object.
- @type name: string
- @param name: The string to display on the button.
- @type event: int
- @param event: The event number to pass to the button event function when
- activated.
- @type x: int
- @type y: int
- @param x: The lower left x (horizontal) coordinate of the button.
- @param y: The lower left y (vertical) coordinate of the button.
- @type width: int
- @type height: int
- @param width: The button width.
- @param height: The button height.
- @type initial: string
- @param initial: The string to display initially.
- @type length: int
- @param length: The maximum input length.
- @type tooltip: string
- @param tooltip: The button's tooltip (the string that appears when the mouse
- is kept over the button).
- @type callback: function
- @param callback: an optional argument so this button can have its own
- callback function. the function will run whenever this button is pressed.
- This function must accept 2 arguments (event, val).
- @rtype: Blender Button
- @return: The Button created.
- """
-
-def GetStringWidth(string, fontsize = 'normal'):
- """
- Get the width in pixels of a string.
- @type string: string
- @param string: A string.
- @type fontsize: string
- @param fontsize: The size of the font: 'large', 'normal', 'normalfix', 'small' or 'tiny'.
- @rtype: int
- @return: The width of I{string} with the chosen I{fontsize}.
- """
-
-def Text(string, fontsize = 'normal'):
- """
- Draw a string on the screen.
-
- Text location is set using the OpenGL raster location functions L{BGL.glRasterPos} before the text is drawn.
- This sets the text location from the lower left corner of the current window.
-
- Text color is set using the OpenGL color functions L{BGL.glColor} before the text is drawn.
-
- @type string: string
- @param string: The text string to draw.
- @type fontsize: string
- @param fontsize: The size of the font: 'large', 'normal', 'normalfix', 'small' or 'tiny'.
- @rtype: int
- @return: The width of I{string} drawn with the chosen I{fontsize}.
- @note: For drawing text in the 3d view see the workaround in L{BGL.glRasterPos}
- """
-
-def Label(string, x, y, w, h):
- """
- Draw a text lable on the screen.
-
- @type string: string
- @param string: The text string to draw.
- @rtype: None
- @return: None
- """
-
-def Image(image, x, y, zoomx=1.0, zoomy=1.0, clipx=0, clipy=0, clipw=-1, cliph=-1):
- """
- Draw an image on the screen.
-
- The image is drawn at the location specified by the coordinates (x,y). A
- pair of optional zoom factors (in horizontal and vertical directions) can
- be applied to the image as it is drawn, and an additional clipping rectangle
- can be applied to extract a particular sub-region of the image to draw.
-
- Note that the clipping rectangle is given in image space coordinates. In
- image space, the origin is located at the bottom left, with x coordinates
- increasing to the right and y coordinates increasing upwards. No matter
- where the clipping rectangle is placed in image space, the lower-left pixel
- drawn on the screen is always placed at the coordinates (x,y). The
- clipping rectangle is itself clipped to the dimensions of the image. If
- either the width or the height of the clipping rectangle are negative then
- the corresponding dimension (width or height) is set to include as much of
- the image as possible.
-
- For drawing images with alpha blending with the background you will need to enable blending as shown in the example.
-
- Example::
- import Blender
- from Blender import BGL, Image, Draw
-
- myimage = Image.Load('myimage.png')
-
- def gui():
- BGL.glEnable( BGL.GL_BLEND ) # Only needed for alpha blending images with background.
- BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA)
-
- Draw.Image(myimage, 50, 50)
-
- BGL.glDisable( BGL.GL_BLEND )
- def event(evt, val):
- if evt == Draw.ESCKEY:
- Draw.Exit()
-
- Draw.Register(gui, event, None)
-
- @type image: Blender.Image
- @param image: The image to draw.
- @type x: int
- @param x: The lower left x (horizontal) position of the origin of the image.
- @type y: int
- @param y: The lower left y (vertical) position of the origin of the image.
- @type zoomx: float
- @param zoomx: The x (horizontal) zoom factor to use when drawing the image.
- @type zoomy: float
- @param zoomy: The y (vertical) zoom factor to use when drawing the image.
- @type clipx: int
- @param clipx: The lower left x (horizontal) origin of the clipping rectangle
- within the image. A value of 0 indicates the left of the
- image.
- @type clipy: int
- @param clipy: The lower left y (vertical) origin of the clipping rectangle
- within the image. A value of 0 indicates the bottom of the
- image.
- @type clipw: int
- @param clipw: The width of the clipping rectangle within the image. If this
- value is negative then the clipping rectangle includes as much
- of the image as possible in the x (horizontal) direction.
- @type cliph: int
- @param cliph: The height of the clipping rectangle within the image. If this
- value is negative then the clipping rectangle includes as much
- of the image as possible in the y (vertical) direction.
- """
-
-class Button:
- """
- The Button object
- =================
- This object represents a button in Blender's GUI.
- @type val: int or float, string or 3-float tuple (depends on button type).
- @ivar val: The button's value.
- """
diff --git a/source/blender/python/api2_2x/doc/Effect.py b/source/blender/python/api2_2x/doc/Effect.py
deleted file mode 100644
index a7140d51d50..00000000000
--- a/source/blender/python/api2_2x/doc/Effect.py
+++ /dev/null
@@ -1,591 +0,0 @@
-# Blender.Effect module and the Effect PyType effect
-
-"""
-The Blender.Effect submodule
-
-B{Deprecated}:
-This module is now maintained but not actively developed.
-
-Effect
-======
-
-INTRODUCTION
-
-The Effect module allows you to access all the data of particle effects.
-An effect can modify a mesh object using particles, where vertex of
-the mesh emits particles, which can themselves emit new particles.
-
-In the Blender internals, the effect object is just a placeholder for
-the particle effect. Prior to v2.39 build and wave effects were also
-supported by Blender, and the Python API supported all three types of
-effects. They were removed in v2.39 when the build and wave modifiers
-were implemented.
-
-
-Example::
- import Blender
- listffects = Blender.Effect.Get()
- print listeffects
- eff = listeffects[0]
- #we suppose the first effect is a build effect
- print eff.getLen()
- eff.setLen(500)
-
-@type Flags: read-only dictionary
-@var Flags: The particle effect flags. Values can be ORed.
- - SELECTED: The particle effect is selected in the UI. (Read-only)
- - BSPLINE: Use a B-spline formula for particle interpolation
- - STATIC: Make static particles
- - ANIMATED: Recalculate static particles for each rendered frame
- - VERTS: Emit particles from vertices
- - FACES: Emit particles from faces
- - EVENDIST: Use even distribution based on face area (requires FACES)
- - TRUERAND: Use true random distribution based on face area (requires FACES)
- - UNBORN: Make particles appear before they are emitted
- - DIED: Make particles appear after they have died
- - EMESH: Render emitter mesh
-
-@type SpeedTypes: read-only dictionary
-@var SpeedTypes: The available settings for selecting particle speed vectors.
-Only one setting is active at a time.
- - INTENSITY: Use texture intensity
- - RGB: Use RGB values
- - GRADIENT: Use texture gradient
-"""
-
-def New (name):
- """
- Creates a new particle effect and attaches to an object.
- @type name: string
- @param name: The name of object to associate with the effect. Only mesh
- objects are supported.
- @rtype: Blender Effect
- @return: the new effect
- """
-
-def Get (name = None, position = None):
- """
- Get an Effect from Blender.
- @type name: string
- @param name: The name of object linked to the effect.
- @type position: int
- @param position: The position of the effect in the list of effects linked to the object.
- @rtype: Blender Effect or a list of Blender Effects
- @return: It depends on the 'objname, position' parameters:
- - (): A list with all Effects in the current scene;
- - (name): A list with all Effects linked to the given object;
- - (name, position): The Effect linked to the given object at the given position
- """
-
-class Effect:
- """
- The Effect object
- =================
- This object gives access to particle effect data in Blender.
-
- @ivar child: The number of children a particle may have.
- Values are clamped to the range [1,600].
- @type child: tuple of 4 ints
- @ivar childMat: The materials used by the 4 generation particles.
- Values are clamped to the range [1,16].
- @type childMat: tuple of 4 ints
- @ivar damping: The particle damping factor. This controls the rate at
- which particles decelerate.
- Values are clamped to the range [0.0,1.0].
- @type damping: float
- @ivar defvec: The x, y and z axis of the force defined by the texture.
- Values are clamped to the range [-1.0,1.0].
- @type defvec: tuple of 3 floats
- @ivar disp: The percentage of particles displayed.
- Value is clamped to the range [0,100].
- @type disp: int
- @ivar dispMat: The material used for the particles.
- Value is clamped to the range [1,16].
- @type dispMat: int
- @ivar emissionTex: The texture used for texture emission.
- Value is clamped to the range [1,10].
- @type emissionTex: int
- @ivar end: The end time of the effect.
- Value is clamped to the range [1.0,30000.0].
- @type end: float
- @ivar flag: The flag bitfield. See L{Flags} for values.
- @type flag: int
- @ivar force: The constant force applied to the parts.
- Values are clamped to the range [-1.0,1.0].
- @type force: tuple of 3 floats
- @ivar forceTex: The texture used for force.
- Value is clamped to the range [1,10].
- @type forceTex: int
- @ivar jitter: Jitter table distribution: maximum particles per face.
- Values are clamped to the range [0,200].
- @type jitter: int
- @ivar life: The lifetime of of the next generation of particles.
- Values are clamped to the range [1.0,30000.0].
- @type life: tuple of 4 floats
- @ivar lifetime: The lifetime of the effect.
- Value is clamped to the range [1.0,30000.0].
- @type lifetime: float
- @ivar mult: The probabilities of a particle having a child.
- Values are clamped to the range [0.0,1.0].
- @type mult: tuple of 4 floats
- @ivar nabla: The nabla value.
- Value is clamped to the range [0.0001,1.0].
- @type nabla: float
- @ivar normfac: The normal strength of the particles relative to mesh.
- Value is clamped to the range [-2.0,2.0].
- @type normfac: float
- @ivar obfac: The strength of the particles relative to objects.
- Value is clamped to the range [-1.0,1.0].
- @type obfac: float
- @ivar randfac: The initial random speed of the particles.
- Value is clamped to the range [0.0,2.0].
- @type randfac: float
- @ivar randlife: The variability of the life of the particles.
- Value is clamped to the range [0.0,2.0].
- @type randlife: float
- @ivar seed: The seed of the random number generator.
- Value is clamped to the range [0,255].
- @type seed: int
- @ivar speedType: Controls which texture property affects particle speeds.
- See L{SpeedTypes} for values and their meanings.
- @type speedType: int
- @ivar speedVGroup: The name of the vertex group used for speed control.
- @type speedVGroup: str
- @ivar sta: The start time of the effect.
- Value is clamped to the range [-250.0,30000.0].
- @type sta: float
- @ivar staticStep: percentage of skipped particles in static display.
- Value is clamped to the range [1,100].
- @type staticStep: int
- @ivar stype: The bitfield for vector.
- @type stype: int
- @ivar texfac: The initial speed of the particles caused by the texture.
- Value is clamped to the range [0.0,2.0].
- @type texfac: float
- @ivar totpart: The total number of particles.
- Value is clamped to the range [1,100000].
- @type totpart: int
- @ivar totkey: The total number of key positions.
- Value is clamped to the range [1,100].
- @type totkey: int
- @ivar type: The type of the effect. Deprecated.
- @type type: int
- @ivar vectsize: The size of vectors associated to the particles (if any).
- Value is clamped to the range [0.0,1.0].
- @type vectsize: float
- @ivar vGroup: The name of the vertex group used for emitted particles.
- @type vGroup: str
- """
-
- def getType():
- """
- Retrieves the type of an effect object.
- Deprecated, since only particle effects are supported.
- @rtype: int
- @return: the type of an effect object : should always return 1
- (particle effect)
- """
-
- def setType(name):
- """
- Deprecated, since only particle effects are supported.
- @type name: int
- @param name : the new type.
- @rtype: None
- @return: None
- """
-
- def getFlag():
- """
- Retrieves the flag of an effect object. The flag is a bit-mask.
- @rtype: int
- @return: The flag of the effect is a combination of parameters. See
- L{Flags} for values.
-
- """
-
- def setFlag(newflag):
- """
- Sets the flag of an effect object. See L{Flags} for values.
- @type newflag: int
- @param newflag: the new flag.
- @rtype: None
- @return: None
- """
-
- def getStartTime():
- """
- Retrieves the starting time of a particle effect object
- @rtype: float
- @return: the starting time of the effect.
- """
-
- def setSta(newstart):
- """
- Sets the starting time of an particle effect object
- @type newstart: float
- @param newstart: the new starting time.
- @rtype: None
- @return: None
- """
-
- def getEndTime():
- """
- Retrieves the end time of a particle effect object
- @rtype: float
- @return: the end time of the effect.
- """
-
- def setEnd(newendrt):
- """
- Sets the end time of an particle effect object
- @type newendrt: float
- @param newendrt: the new end time.
- @rtype: None
- @return: None
- """
-
- def getLifetime():
- """
- Retrieves the lifetime of a particle effect object
- @rtype: float
- @return: the lifetime of the effect.
- """
-
-
- def setLifetime(newlifetime):
- """
- Sets the lifetime of a particle effect object
- @type newlifetime: float
- @param newlifetime: the new lifetime.
- @rtype: None
- @return: None
- """
-
- def getNormfac():
- """
- Retrieves the normal strength of the particles (relatively to mesh).
- @rtype: float
- @return: normal strength of the particles (relatively to mesh).
- """
-
- def setNormfac(newnormfac):
- """
- Sets the normal strength of the particles (relatively to mesh).
- @type newnormfac: float
- @param newnormfac: the normal strength of the particles (relatively to mesh).
- @rtype: None
- @return: None
- """
-
- def getObfac():
- """
- Retrieves the initial strength of the particles relatively to objects.
- @rtype: float
- @return: initial strength of the particles (relatively to mesh).
- """
-
- def setObfac(newobfac):
- """
- Sets the initial strength of the particles relatively to objects.
- @type newobfac: float
- @param newobfac: the initial strength of the particles relatively to objects.
- @rtype: None
- @return: None
- """
-
- def getRandfac():
- """
- Retrieves the random strength applied to the particles.
- @rtype: float
- @return: random strength applied to the particles.
- """
-
- def setRandfac(newrandfac):
- """
- Sets the random strength applied to the particles.
- @type newrandfac: float
- @param newrandfac: the random strength applied to the particles.
- @rtype: None
- @return: None
- """
-
- def getStype():
- """
- Retrieves the vect state of an effect object.
- @rtype: int
- @return: the Stype (Vect) of an effect object : 0 , Vect is not enabled, 1, Vect is enabled
- (particle effect)
- """
-
- def setStype(int):
- """
- @type int : int
- @param int : state of the Stype : 0 not enabled, 1 enabled.
- @rtype: None
- @return: None
- """
-
- def getTexfac():
- """
- Retrieves the strength applied to the particles from the texture of the object.
- @rtype: float
- @return: strength applied to the particles from the texture of the object.
- """
-
- def setTexfac(newtexfac):
- """
- Sets the strength applied to the particles from the texture of the object.
- @type newtexfac: float
- @param newtexfac: the strength applied to the particles from the texture of the object.
- @rtype: None
- @return: None
- """
-
- def getRandlife():
- """
- Retrieves the variability of the life of the particles.
- @rtype: float
- @return: variability of the life of the particles.
- """
-
- def setRandlife(newrandlife):
- """
- Sets the variability of the life of the particles.
- @type newrandlife: float
- @param newrandlife: the variability of the life of the particles.
- @rtype: None
- @return: None
- """
-
- def getNabla():
- """
- Retrieves the sensibility of the particles to the variations of the texture.
- @rtype: float
- @return: sensibility of the particles to the variations of the texture.
- """
-
-
- def setNabla(newnabla):
- """
- Sets the sensibility of the particles to the variations of the texture.
- @type newnabla: float
- @param newnabla: the sensibility of the particles to the variations of the texture.
- @rtype: None
- @return: None
- """
-
- def getVectsize():
- """
- Retrieves the size of the vector which is associated to the particles.
- @rtype: float
- @return: size of the vector which is associated to the particles.
- """
-
-
- def setVectsize(newvectsize):
- """
- Sets the size of the vector which is associated to the particles.
- @type newvectsize: float
- @param newvectsize: the size of the vector which is associated to the particles.
- @rtype: None
- @return: None
- """
-
- def getTotpart():
- """
- Retrieves the total number of particles.
- @rtype: int
- @return: the total number of particles.
- """
-
-
- def setTotpart(newtotpart):
- """
- Sets the the total number of particles.
- @type newtotpart: int
- @param newtotpart: the the total number of particles.
- @rtype: None
- @return: None
- """
-
- def getTotkey():
- """
- Retrieves the number of keys associated to the particles (kind of degree of freedom)
- @rtype: int
- @return: number of keys associated to the particles.
- """
-
- def setTotkey(newtotkey):
- """
- Sets the number of keys associated to the particles.
- @type newtotkey: int
- @param newtotkey: number of keys associated to the particles.
- @rtype: None
- @return: None
- """
-
- def getSeed():
- """
- Retrieves the random number generator seed.
- @rtype: int
- @return: current seed value.
- """
-
- def setSeed(newseed):
- """
- Sets the random number generator seed.
- @type newseed: int
- @param newseed: new seed value.
- @rtype: None
- @return: None
- """
-
- def getForce():
- """
- Retrieves the force applied to the particles.
- @rtype: tuple of three floats
- @return: force applied to the particles.
- """
-
- def setForce(newforce):
- """
- Sets the force applied to the particles.
- @type newforce: tuple of 3 floats
- @param newforce: force applied to the particles.
- @rtype: None
- @return: None
- """
-
- def getMult():
- """
- Retrieves the probabilities of a particle having a child.
- @rtype: tuple of 4 floats
- @return: probabilities of a particle having a child.
- """
-
- def setMult(newmult):
- """
- Sets the probabilities of a particle having a child.
- @type newmult: tuple of 4 floats
- @param newmult: probabilities of a particle having a child.
- @rtype: None
- @return: None
- """
-
- def getLife():
- """
- Retrieves the average life of the particles (4 generations)
- @rtype: tuple of 4 floats
- @return: average life of the particles (4 generations)
- """
-
- def setLife(newlife):
- """
- Sets the average life of the particles (4 generations).
- @type newlife: tuple of 4 floats
- @param newlife: average life of the particles (4 generations).
- @rtype: None
- @return: None
- """
-
- def getChild():
- """
- Retrieves the average number of children of the particles (4 generations).
- @rtype: tuple of 4 ints
- @return: average number of children of the particles (4 generations).
- """
-
- def setChild(newchild):
- """
- Sets the average number of children of the particles (4 generations).
- @type newchild: tuple of 4 ints
- @param newchild: average number of children of the particles (4 generations).
- @rtype: None
- @return: None
- """
-
- def getMat():
- """
- Retrieves the indexes of the materials associated to the particles (4 generations).
- @rtype: tuple of 4 ints
- @return: indexes of the materials associated to the particles (4 generations).
- """
-
- def setMat(newmat):
- """
- Sets the indexes of the materials associated to the particles (4 generations).
- @type newmat: tuple of 4 ints
- @param newmat: the indexes of the materials associated to the particles (4 generations).
- @rtype: None
- @return: None
- """
-
- def getDefvec():
- """
- Retrieves the x, y and z components of the force defined by the texture.
- @rtype: tuple of 3 floats
- @return: x, y and z components of the force defined by the texture.
- """
-
- def setDefvec(newdefvec):
- """
- Sets the x, y and z components of the force defined by the texture.
- @type newdefvec: tuple of 3 floats
- @param newdefvec: the x, y and z components of the force defined by the
- texture.
- @rtype: None
- @return: None
- """
-
- def getParticlesLoc():
- """
- Gets the location of each particle at the current time in worldspace.
- @rtype: A list of vector or a list of vector lists.
- @return: The coordinates of each particle at the current time.
- If the "Vect" option is enabled a list Vector pairs will be returned with a start and end point for each particle.
- When static particles are enabled, a list of lists will be returned, each item a strand of particles.
-
- Example::
-
- import Blender
- from Blender import Effect, Object
- scn= Blender.Scene.GetCurrent()
- ob= scn.getActiveObject()
- effect= ob.effects[0]
- particles= effect.getParticlesLoc()
-
- # Check that particles are points only (not static and not vectors)
- if not effect.getFlag() & Effect.Flags.STATIC or not effect.getStype():
- for pt in particles:
- ob_empty= scn.objects.new('Empty')
- ob_empty.setLocation(pt)
-
- else: # Particles will be a list
- for pt in particles:
- for pt_item in pt:
- ob_empty= scn.objects.new('Empty')
- ob_empty.setLocation(pt_item)
-
- Example::
- # Converts particles into a mesh with edges for strands
- from Blender import Scene, Mathutils, Effect, Mesh, Object
- scn= Scene.GetCurrent()
- ob= scn.getActiveObject()
- me= Mesh.New()
-
- effects= Effect.Get()
- for eff in effects:
- for p in eff.getParticlesLoc():
- # p is either a vector or a list of vectors. me.verts.extend() will deal with either
- print p
- me.verts.extend(p)
-
- if type(p)==list: # Are we a strand or a pair, then add edges.
- if len(p)>1:
- edges= [(i, i+1) for i in range(len(me.verts)-len(p), len(me.verts)-1)]
- me.edges.extend( edges )
-
- print len(me.verts)
- ob= scn.objects.new(me)
- """
diff --git a/source/blender/python/api2_2x/doc/Effectdoc.txt b/source/blender/python/api2_2x/doc/Effectdoc.txt
deleted file mode 100644
index 76cff428ed6..00000000000
--- a/source/blender/python/api2_2x/doc/Effectdoc.txt
+++ /dev/null
@@ -1,257 +0,0 @@
-EFFECT Module documentation
-
-
-INTRODUCTION
-The module effect allows you to access all the data of an effect.
-An effect can modify an object (typically a mesh) in three different ways.
- a) the build effect : makes the mesh appear progressively.
- b) the wave effect : waves appear on the mesh (which should be fine-grained)
- c) the particle effect : every vertex of the mesh emits particles,
-which can themselves emit new particles. This effect is the most parameterizable.
-
-In the blender internals, the effect object is just a placeholder for the "real"
- effect, which can be a wave, particle or build effect. The python API follows
-this structure : the Effect module grants access to (the few) data which
- are shared between all effects. It has three submodules : Wave, Build, Particle
-, which grant r/w access to the real parameters of these effects.
-
-
-
-
-functions of the module :
-
-Get(Name:string,pos:int) : returns the pos-th Effect associated
- to the object whose name is Name.
-
-get : same as Get
-
-New(Type:string ) : Creates and returns a new Effect Object.
-The parameter Type can take the values "particle", "wave" or "build"
-
-
-
-Effect object member functions :
-
-getType() : Retrieves the type of the Effect Object.
-
-setType(val:int) : Sets the type of the Effect Object.
-The possible values of the type are :
- 0 : effect build.
- 1 : effect particle.
- 2 : effect wave.
-
-
-getFlag()Retrieves the flag of the Effect Object
-
-setFlag(val:int) :Sets the flag
-
-The flag of the effect is a combination of parameters, whose semantics depend upon the effect type.
-All types :
-Bit 0 : set to 1 if the effect is selected in the effects window.
-Wave effect :
-Bits 1,2,3 : set to 1 if the button "X", "Y" or "Cycl" is clicked.
-Particle effect :
-Bits 1,2,3 : set to 1 if the button "Bspline", "Static" or "Face" is clicked.
-
-
-
-
-
-
-Submodules : Wave, Build, Particle.
-
-
-
-
-Wave module
-
-
-
-functions of the module :
-
-Get(Name:string,pos:int) : returns the pos-th wave Effect associated to the object whose name is Name.
-
-get : same as Get
-
-New( ) : Creates and returns a new Wave Object.
-
-
-Wave object member functions :
-
-getStartx() : returns the startx parameter of the wave object.
-
-setStartx(val:int) : sets the startx parameter of the wave object.
-
-getStarty() : returns the starty parameter of the wave object.
-
-setStarty(val:int) : sets the starty parameter of the wave object.
-
-getHeight() : returns the height parameter of the wave object.
-
-setHeight(val:int) : sets the height parameter of the wave object.
-
-getWidth() : returns the width parameter of the wave object.
-
-setWidth(val:int) : sets the width parameter of the wave object.
-
-getNarrow() : returns the narrow parameter of the wave object.
-
-setNarrow(val:int) : sets the narrow parameter of the wave object.
-
-getSpeed() : returns the speed parameter of the wave object.
-
-setSpeed(val:int) : sets the speed parameter of the wave object.
-
-getMinfac() : returns the minfac parameter of the wave object.
-
-setMinfac(val:int) : sets the minfac parameter of the wave object.
-
-getDamp() : returns the damp parameter of the wave object.
-
-setDamp(val:int) : sets the damp parameter of the wave object.
-
-getTimeoffs() : returns the timeoffs parameter of the wave object.
-
-setTimeoffs(val:int) : sets the time offset parameter of the wave object.
-
-getLifetime() : returns the lifetime parameter of the wave object.
-
-setLifetime(val:int) : sets the lifetime parameter of the wave object.
-
-
-
-The Object.attr syntax
-
-Wave attributes can be read/written with the object.attr syntax.
-Example :
-
-w = Blender.Wave.Get("Obname",3) #retrieves the 4th effect associated to the object named Obname
-a = w.speed # a is now the value corresponding to the speed of the effect
-w.speed = 42 # the speed of the effect is now equal to 42
-
-The parameter can take these values : "lifetime","timeoffs","damp","minfac","speed","narrow","width","height","startx","starty"
-
-
-
-
-Build module
-
-
-
-functions of the module :
-
-Get(Name:string,pos:int) : returns the pos-th build Effect associated to the object whose name is Name.
-
-get(Name:string,pos:int) : same as Get
-
-New( ) : Creates and returns a new Build Object.
-
-
-Build object member functions :
-
-getLen() : returns the length of the effect (in frames).
-
-setLen(val:float) : sets the length of the effect (in frames).
-
-getSfra() : returns the starting frame of the effect.
-
-setSfra(val:float) : sets the starting frame of the effect.
-
-
-The Object.attribute syntax
-
-The attribute can take these values : "sfra","len".
-
-
-Particle module
-
-
-
-functions of the module :
-
-Get(Name:string,pos:int) : returns the pos-th particle Effect associated to the object whose name is Name.
-
-get(Name:string,pos:int) : same as Get
-
-New( ) : Creates and returns a new Effect Object.
-
-
-Particle object member functions :
-
-getStartTime() : returns the start time of the particle effect (in frames).
-
-setStartTime(val:float) : sets the start time of the particle effect (in frames).
-
-getEndTime() : returns the end time of the particle effect (in frames).
-
-setEndTime(val:float) : sets the end time of the particle effect (in frames).
-
-getLifeTime() : returns the life time of the particles.
-
-setLifeTime(val:float) : sets the life time of the particles.
-
-getNormfac() : returns the normal strength of the particles (relatively to mesh).
-
-setNormfac(val:float) : sets the normal strength of the particles(relatively to mesh).
-
-getObfac() : returns the initial of the particles relatively to objects.
-
-setObfac(val:float) : sets the initial of the particles relatively to objects.
-
-getRandfac() : returns the initial random speed of the particles.
-
-setRandfac(val:float) : sets the initial random speed of the particles.
-
-getTexfac() : returns the initial speed of the particles caused by the texture.
-
-setTexfac(val:float) : sets the initial speed of the particles caused by the texture.
-
-getRandlife() : returns the variability of the life of the particles.
-
-setRandlife(val:float) : sets the variability of the life of the particles.
-
-getNabla() : returns the dimension of the area for gradient computation.
-
-setNabla(val:float) : sets the dimension of the area for gradient computation.
-
-getTotpart() : returns the total number of particles.
-
-setTotpart(val:int) : sets the total number of particles.
-
-getTotkey() : returns the number of key positions.
-
-setTotkey(val:int) : sets the number of key positions.
-
-getSeed() : returns the seed of the RNG.
-
-setSeed(val:int) : sets the seed of the RNG.
-
-getSeed() : returns the x,y,z components of the constant force applied to the particles.
-
-setSeed(valx:float,valy:float,valz:float) : sets the x,y,z components of the constant force applied to the particles.
-
-getMult() : returns the 4 probabilities of a particle having a child.
-
-setMult(val1:float,val2:float,val3:float,val4:float) : sets the 4 probabilities of a particle having a child.
-
-getLife() : returns the lifespan of the 4 generation particles.
-
-setLife(val1:float,val2:float,val3:float,val4:float) : sets the lifespan of the 4 generation particles.
-
-getMat() : returns the material used by the 4 generation particles.
-
-setMat(val1:float,val2:float,val3:float,val4:float) : sets the material used by the 4 generation particles.
-
-getChild() : returns the number of children a particle may have.
-
-setChild(val1:float,val2:float,val3:float,val4:float) : sets the number of children a particle may have.
-
-getDefvec() : returns the x, y and z axis of the force defined by the texture.
-
-setDefvec(val1:float,val2:float,val3:float) : sets the x, y and z axis of the force defined by the texture.
-
-
-
-The Object.attribute syntax
-
-The attribute can take these values : "seed","nabla","sta","end","lifetime","normfac","obfac","randfac","texfac","randlife","vectsize","totpart","force","mult","life","child","mat","defvec". \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Font.py b/source/blender/python/api2_2x/doc/Font.py
deleted file mode 100644
index 44fa3d81f91..00000000000
--- a/source/blender/python/api2_2x/doc/Font.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# Blender.Text3d.Font module and the Font PyType object
-
-"""
-The Blender.Text3d.Font subsubmodule.
-
-Text3d.Font Objects
-===================
-
-This module provides access to B{Font} objects in Blender.
-
-Example::
- import Blender
- from Blender import Text3d
-
- # Load a font
- myfont= Text3d.Font.Load('/usr/share/fonts/ttf/verdana.ttf')
-
- #
- for font in Text3d.Font.Get():
- print font.name, font.filename, font.packed
-"""
-
-def Load (filename):
- """
- Create a new Text3d.Font object.
- @type filename: string
- @param filename: file of the font
- @rtype: Blender Text3d.Font
- @return: The created Text3d.Font Data object.
- """
-
-def Get (name = None):
- """
- Get the Text3d.Font object(s) from Blender.
- @type name: string
- @param name: The name of the Text3d object.
- @rtype: Blender Text3d or a list of Blender Text3ds
- @return: It depends on the 'name' parameter:
- - (name): The Text3d object with the given name;
- - (): A list with all Font objects in the current .blend file.
- """
-class Font:
- """
- The Text3d.Font object
- ======================
- This object gives access Blender's B{Font} objects
- @ivar filename: The filename (path) of the file loaded into this Font.
- @type filename: string
- @ivar packed: Boolean, True when the sample is packed (readonly).
- @type packed: string
- """
-
- def pack():
- """
- Packs the font into the current blend file.
- @note:
- @returns: nothing
- @rtype: none
- """
-
- def unpack(mode):
- """
- Unpacks the font.
- @param mode: One of the values in Blender.UnpackModes dict.
- @note: An error will be raised if the font is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
diff --git a/source/blender/python/api2_2x/doc/Geometry.py b/source/blender/python/api2_2x/doc/Geometry.py
deleted file mode 100644
index 5d507956cdb..00000000000
--- a/source/blender/python/api2_2x/doc/Geometry.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Blender.Geometry module and its subtypes
-
-"""
-The Blender.Geometry submodule.
-
-Geometry
-========
-
-This new module provides access to a geometry function.
-"""
-
-def PolyFill(polylines):
- """
- Takes a list of polylines and calculates triangles that would fill in the polylines.
- Multiple lines can be used to make holes inside a polyline, or fill in 2 seperate lines at once.
- @type polylines: List of lists containing vectors, each representing a closed polyline.
- @rtype: list
- @return: a list if tuples each a tuple of 3 ints representing a triangle indexing the points given.
- @note: 2D Vectors will have an assumed Z axis of zero, 4D Vectors W axis is ignored.
- @note: The order of points in a polyline effect the direction returned triangles face, reverse the order of a polyline to flip the normal of returned faces.
-
- I{B{Example:}}
-
- The example below creates 2 polylines and fills them in with faces, then makes a mesh in the current scene::
- import Blender
- Vector= Blender.Mathutils.Vector
-
- # Outline of 5 points
- polyline1= [Vector(-2.0, 1.0, 1.0), Vector(-1.0, 2.0, 1.0), Vector(1.0, 2.0, 1.0), Vector(1.0, -1.0, 1.0), Vector(-1.0, -1.0, 1.0)]
- polyline2= [Vector(-1, 1, 1.0), Vector(0, 1, 1.0), Vector(0, 0, 1.0), Vector(-1.0, 0.0, 1.0)]
- fill= Blender.Geometry.PolyFill([polyline1, polyline2])
-
- # Make a new mesh and add the truangles into it
- me= Blender.Mesh.New()
- me.verts.extend(polyline1)
- me.verts.extend(polyline2)
- me.faces.extend(fill) # Add the faces, they reference the verts in polyline 1 and 2
-
- scn = Blender.Scene.GetCurrent()
- ob = scn.objects.new(me)
- Blender.Redraw()
- """
-
-def LineIntersect2D(vec1, vec2, vec3, vec4):
- """
- Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line.
- @rtype: Vector
- @return: a 2D Vector for the intersection or None where there is no intersection.
- """
-
-def ClosestPointOnLine(pt, vec1, vec2):
- """
- Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line.
- @rtype: tuple
- @return: a tuple containing a vector and a float, the vector is the closest point on the line, the float is the position on the line, between 0 and 1 the point is on the line.
- """
-
-def PointInTriangle2D(pt, tri_pt1, tri_pt2, tri_pt3):
- """
- Takes 4 vectors (one for the test point and 3 for the triangle)
- This is a 2d function so only X and Y are used, Z and W will be ignored.
- @rtype: int
- @return: 1 for a clockwise intersection, -1 for counter clockwise intersection, 0 when there is no intersection.
- """
-
-def PointInQuad2D(pt, quad_pt1, quad_pt2, quad_pt3):
- """
- Takes 5 vectors (one for the test point and 5 for the quad)
- This is a 2d function so only X and Y are used, Z and W will be ignored.
- @rtype: int
- @return: 1 for a clockwise intersection, -1 for counter clockwise intersection, 0 when there is no intersection.
- """
-
-def BoxPack2D(boxlist):
- """
- Takes a list of 2D boxes and packs them into a square.
- Each box in boxlist must be a list of at least 4 items - [x,y,w,h], after running this script,
- the X and Y values in each box will be moved to packed, non overlapping locations.
-
- Example::
-
- # Make 500 random boxes, pack them and make a mesh from it
- from Blender import Geometry, Scene, Mesh
- import random
- boxes = []
- for i in xrange(500):
- boxes.append( [0,0, random.random()+0.1, random.random()+0.1] )
- boxsize = Geometry.BoxPack2D(boxes)
- print 'BoxSize', boxsize
- me = Mesh.New()
- for x in boxes:
- me.verts.extend([(x[0],x[1], 0), (x[0],x[1]+x[3], 0), (x[0]+x[2],x[1]+x[3], 0), (x[0]+x[2],x[1], 0) ])
- v1= me.verts[-1]
- v2= me.verts[-2]
- v3= me.verts[-3]
- v4= me.verts[-4]
- me.faces.extend([(v1,v2,v3,v4)])
- scn = Scene.GetCurrent()
- scn.objects.new(me)
-
- @note: Each boxlist item can be longer then 4, the extra items are ignored and stay untouched.
- @rtype: tuple
- @return: a tuple pair - (width, height) of all the packed boxes.
- """
- \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Group.py b/source/blender/python/api2_2x/doc/Group.py
deleted file mode 100644
index 1266d2efb6e..00000000000
--- a/source/blender/python/api2_2x/doc/Group.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Blender.Group module and the Group PyType object
-
-"""
-The Blender.Group submodule.
-
-Group
-=====
-
-This module provides access to B{Group} data in Blender.
-
-Example::
-
- # Make Dupli's Real, as a python script.
-
- from Blender import *
-
- scn= Scene.GetCurrent()
- for ob in scn.objects:
- print 'Object Group Settings'
- print ob.name, ob.type
- print 'enableDupVerts:', ob.enableDupVerts
- print 'enableDupFrames:', ob.enableDupFrames
- print 'enableDupGroup:', ob.enableDupGroup
- print 'DupGroup:', ob.DupGroup
- dupe_obs= ob.DupObjects
- print 'num dup obs:', len(dupe_obs)
-
- for dup_ob, dup_matrix in dupe_obs:
- print '\tDupOb', dup_ob.name
- scn.objects.new(dup_ob.data)
- new_ob.setMatrix(dup_matrix)
- new_ob.sel= 1 # select all real instances.
-
- ob.sel=0 # Desel the original object
-
- Window.RedrawAll()
-
-Example::
-
- # Make a new group with the selected objects, and add an instance of this group.
-
- from Blender import *
-
- scn= Scene.GetCurrent()
-
- # New Group
- grp= Group.New('mygroup')
- grp.objects= scn.objects
-
- # Instance the group at an empty using dupligroups
- ob= scn.objects.new(None)
- ob.enableDupGroup= True
- ob.DupGroup= grp
- Window.RedrawAll()
-
-
-Example::
-
- # Remove all non mesh objects from a group.
-
- from Blender import *
-
- scn= Scene.GetCurrent()
-
- # New Group
- grp= Group.Get('mygroup')
- for ob in list(grp.objects): # Convert to a list before looping because we are removing items
- if ob.type != 'Mesh':
- grp.objects.unlink(ob)
-"""
-
-def New (name = None):
- """
- Make a new empty group, name optional, default is "Group"
- @type name: string
- @param name: The name of the new group.
- @rtype: Blender Group
- @return: A Empty Blender Group object
- """
-
-def Get (name = None):
- """
- Get the Group object(s) from Blender.
- @type name: string
- @param name: The name of the Group object.
- @rtype: Blender Group or a list of Blender Groups
- @return: It depends on the I{name} parameter:
- - (name): The Group object called I{name}, Exception if it is not found.
- - (): A list with all Group objects in the current blend file.
- """
-
-def Unlink (group):
- """
- Unlink (delete) this group from Blender.
- @Note: No objects will be removed, just the group that references them.
- @type group: group
- @param group: A group to remove from this blend file, does not remove objects that this group uses.
- """
-
-
-class Group:
- """
- The Group object
- ================
- This object gives access to Groups in Blender.
- @ivar layers: Layer bitmask for this group.
- @type layers: int
- @ivar dupliOffset: Object offset when instanced as a dupligroup
- @type dupliOffset: vector
- @ivar objects: Objects that this group uses.
- This is a sequence with-list like access so use list(grp.objects) if you need to use a list (where grp is a group).
- The groups objects can be set by assigning a list or iterator of objects to the groups objects.
- objects.link() and objects.unlink() also work with the the objects iterator just like with lists.
-
- B{Note}: append() and remove() have been deprecated and replaced by link() and unlink(),
- after Blender 2.43 append() and remove() will not be available.
- @type objects: custom object sequence
- """
-
- def __copy__ ():
- """
- Make a copy of this group
- @rtype: Group
- @return: a copy of this group
- """
- def copy ():
- """
- Make a copy of this group
- @rtype: Group
- @return: a copy of this group
- """
-
-import id_generics
-Group.__doc__ += id_generics.attributes
-
diff --git a/source/blender/python/api2_2x/doc/IDProp.py b/source/blender/python/api2_2x/doc/IDProp.py
deleted file mode 100644
index 01d5136cd70..00000000000
--- a/source/blender/python/api2_2x/doc/IDProp.py
+++ /dev/null
@@ -1,132 +0,0 @@
-class IDGroup:
- """
- The IDGroup Type
- ================
- This type supports both iteration and the []
- operator to get child ID properties.
-
- You can also add new properties using the [] operator.
- For example::
-
- group['a float!'] = 0.0
- group['an int!'] = 0
- group['a string!'] = "hi!"
- group['an array!'] = [0, 0, 1.0, 0]
-
- group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2],
- "another subgroup": {"a": 0.0, "str": "bleh"}}
-
- Note that for arrays, the array type defaults to int unless a float is found
- while scanning the template list; if any floats are found, then the whole
- array is float. Note that double-precision floating point numbers are used for
- python-created float ID properties and arrays (though the internal C api does
- support single-precision floats, and the python code will read them).
-
- You can also delete properties with the del operator. For example:
-
- del group['property']
-
- To get the type of a property, use the type() operator, for example::
-
- if type(group['bleh']) == str: pass
-
- To tell if the property is a group or array type, import the Blender.Types module and test
- against IDGroupType and IDArrayType, like so::
-
- from Blender.Types import IDGroupType, IDArrayType.
-
- if type(group['bleghr']) == IDGroupType:
- (do something)
-
- @ivar name: The name of the property
- @type name: string
- """
-
- def pop(item):
- """
- Pop an item from the group property.
- @type item: string
- @param item: The item name.
- @rtype: can be dict, list, int, float or string.
- @return: The removed property.
- """
-
- def update(updatedict):
- """
- Updates items in the dict, similar to normal python
- dictionary method .update().
- @type updatedict: dict
- @param updatedict: A dict of simple types to derive updated/new IDProperties from.
- @rtype: None
- @return: None
- """
-
- def keys():
- """
- Returns a list of the keys in this property group.
- @rtype: list of strings.
- @return: a list of the keys in this property group.
- """
-
- def values():
- """
- Returns a list of the values in this property group.
-
- Note that unless a value is itself a property group or an array, you
- cannot change it by changing the values in this list, you must change them
- in the parent property group.
-
- For example,
-
- group['some_property'] = new_value
-
- . . .is correct, while,
-
- values = group.values()
- values[0] = new_value
-
- . . .is wrong.
-
- @rtype: list of strings.
- @return: a list of the values in this property group.
- """
-
- def iteritems():
- """
- Implements the python dictionary iteritmes method.
-
- For example::
-
- for k, v in group.iteritems():
- print "Property name: " + k
- print "Property value: " + str(v)
-
- @rtype: an iterator that spits out items of the form [key, value]
- @return: an iterator.
- """
-
- def convert_to_pyobject():
- """
- Converts the entire property group to a purely python form.
-
- @rtype: dict
- @return: A python dictionary representing the property group
- """
-
-class IDArray:
- """
- The IDArray Type
- ================
-
- @ivar type: returns the type of the array, can be either IDP_Int or IDP_Float
- """
-
- def __getitem__(index):
- pass
-
- def __setitem__(index, value):
- pass
-
- def __len__():
- pass
- \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Image.py b/source/blender/python/api2_2x/doc/Image.py
deleted file mode 100644
index e376b11c4fa..00000000000
--- a/source/blender/python/api2_2x/doc/Image.py
+++ /dev/null
@@ -1,411 +0,0 @@
-# Blender.Image module and the Image PyType object
-
-"""
-The Blender.Image submodule.
-
-Image
-=====
-
-B{New}: L{Image.clampX}, L{Image.clampY}.
-
-This module provides access to B{Image} objects in Blender.
-
-Example::
- import Blender
- from Blender import Image
- #
- image = Image.Load("/path/to/my/image.png") # load an image file
- print "Image from", image.getFilename(),
- print "loaded to obj", image.getName())
- image.setXRep(4) # set x tiling factor
- image.setYRep(2) # set y tiling factor
- print "All Images available now:", Image.Get()
-
-@type Sources: readonly dictionary
-@var Sources: The available Image Source.
- - STILL: Single image file
- - MOVIE: Movie file
- - SEQUENCE: Multiple image files, as sequence
- - GENERATED: Generated image
-"""
-
-def Load (filename):
- """
- Load the image called 'filename' into an Image object.
- @type filename: string
- @param filename: The full path to the image file.
- @rtype: Blender Image
- @return: A Blender Image object with the data from I{filename}.
- """
-
-def New (name, width, height, depth):
- """
- Create a new Image object.
- @type name: string
- @param name: The name of the new Image object.
- @type width: int
- @param width: The width of the new Image object, between 1 and 5000.
- @type height: int
- @param height: The height of the new Image object, between 1 and 5000.
- @type depth: int
- @param depth: The color depth of the new Image object. (32:RGBA 8bit channels, 128:RGBA 32bit high dynamic range float channels).
- @rtype: Blender Image
- @return: A new Blender Image object.
- """
-
-def Get (name = None):
- """
- Get the Image object(s) from Blender.
- @type name: string
- @param name: The name of the Image object.
- @rtype: Blender Image or a list of Blender Images
- @return: It depends on the I{name} parameter:
- - (name): The Image object called I{name}, None if not found;
- - (): A list with all Image objects in the current scene.
- """
-
-def GetCurrent ():
- """
- Get the currently displayed Image from Blenders UV/Image window.
- When multiple images are displayed, the last active UV/Image windows image is used.
- @rtype: Blender Image
- @return: The Current Blender Image, If there is no current image it returns None.
- """
-
-from IDProp import IDGroup, IDArray
-class Image:
- """
- The Image object
- ================
- This object gives access to Images in Blender.
- @ivar filename: The filename (path) to the image file loaded into this Image
- object.
- @type filename: string
- @ivar size: The [width, height] dimensions of the image (in pixels).
- @type size: list
- @ivar depth: The pixel depth of the image, read only. [8, 16, 18, 24, 32, 128 (for 32bit float color channels)]
- @type depth: int
- @ivar xrep: Texture tiling: the number of repetitions in the x (horizontal)
- axis. [1, 16].
- @ivar yrep: Texture tiling: the number of repetitions in the y (vertical)
- axis [1, 16].
- @type xrep: int
- @type yrep: int
- @ivar start: Texture's animation start frame [0, 128].
- @type start: int
- @ivar end: Texture's animation end frame [0, 128].
- @type end: int
- @ivar speed: Texture's animation speed [1, 100].
- @type speed: int
- @ivar packed: True when the Texture is packed (readonly).
- @type packed: boolean
- @ivar has_data: True when the image has pixel data (readonly).
- @type has_data: boolean
- @ivar fields: enable or disable the fields option for this image.
- @type fields: boolean
- @ivar fields_odd: enable or disable the odd fields option for this image.
- @type fields_odd: boolean
- @ivar antialias: enable or disable the antialias option for this image.
- @type antialias: boolean
- @ivar premul: premultiply alpha toggle.
- @type premul: boolean
- @ivar bindcode: Texture's bind code (readonly).
- @type bindcode: int
- @ivar source: Image source type. See L{the Sources dictionary<Sources>} .
- @type source: int
- @ivar clampX: When true the image will not tile horizontally.
- @type clampX: bool
- @ivar clampY: When true the image will not tile vertically.
- @type clampY: bool
- """
-
- def getName():
- """
- Get the name of this Image object.
- @rtype: string
- """
-
- def getFilename():
- """
- Get the filename of the image file loaded into this Image object.
- @rtype: string
- """
-
- def getSize():
- """
- Get the [width, height] dimensions (in pixels) of this image.
- @rtype: list of 2 ints
- """
-
- def getDepth():
- """
- Get the pixel depth of this image. [8,16,24,32,128 for 32bit float images]
- @rtype: int
- """
-
- def getPixelHDR(x, y):
- """
- Get the the colors of the current pixel in the form [r,g,b,a].
- For float image types, returned values can be greater then the useual [0.0, 1.0] range.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @returns: [ r, g, b, a]
- @rtype: list of 4 floats
- @type x: int
- @type y: int
- @param x: the x coordinate of pixel.
- @param y: the y coordinate of pixel.
- """
-
- def getPixelF(x, y):
- """
- Get the the colors of the current pixel in the form [r,g,b,a].
- Returned values are floats normalized to 0.0 - 1.0.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @returns: [ r, g, b, a]
- @rtype: list of 4 floats
- @type x: int
- @type y: int
- @param x: the x coordinate of pixel.
- @param y: the y coordinate of pixel.
- """
-
- def getPixelI(x, y):
- """
- Get the the colors of the current pixel in the form [r,g,b,a].
- Returned values are ints normalized to 0 - 255.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @returns: [ r, g, b, a]
- @rtype: list of 4 ints
- @type x: int
- @type y: int
- @param x: the x coordinate of pixel.
- @param y: the y coordinate of pixel.
- """
-
- def getMaxXY():
- """
- Get the x & y size for the image. Image coordinates range from 0 to size-1.
- @returns: [x, y]
- @rtype: list of 2 ints
- """
-
- def getMinXY():
- """
- Get the x & y origin for the image. Image coordinates range from 0 to size-1.
- @returns: [x, y]
- @rtype: list of 2 ints
- """
-
- def getXRep():
- """
- Get the number of repetitions in the x (horizontal) axis for this Image.
- This is for texture tiling.
- @rtype: int
- """
-
- def getYRep():
- """
- Get the number of repetitions in the y (vertical) axis for this Image.
- This is for texture tiling.
- @rtype: int
- """
-
- def getBindCode():
- """
- Get the Image's bindcode. This is for texture loading using BGL calls.
- See, for example, L{BGL.glBindTexture} and L{glLoad}.
- @rtype: int
- """
-
- def getStart():
- """
- Get the Image's start frame. Used for animated textures.
- @rtype: int
- """
-
- def getEnd():
- """
- Get the Image's end frame. Used for animated textures.
- @rtype: int
- """
-
- def getSpeed():
- """
- Get the Image's speed (fps). Used for animated textures.
- @rtype: int
- """
-
- def reload():
- """
- Reloads this image from the filesystem. If used within a loop you need to
- redraw the Window to see the change in the image, e.g. with
- Window.RedrawAll().
- @warn: if the image file is corrupt or still being written, it will be
- replaced by a blank image in Blender, but no error will be returned.
- @returns: None
- """
-
- def updateDisplay():
- """
- Update the display image from the floating point buffer (if it exists)
- @returns: None
- """
-
- def glLoad():
- """
- Load this image's data into OpenGL texture memory, if it is not already
- loaded (image.bindcode is 0 if it is not loaded yet).
- @note: Usually you don't need to call this method. It is only necessary
- if you want to draw textured objects in the Scripts window and the
- image's bind code is zero at that moment, otherwise Blender itself can
- take care of binding / unbinding textures. Calling this method for an
- image with nonzero bind code simply returns the image's bind code value
- (see L{getBindCode}).
- @rtype: int
- @returns: the texture's bind code.
- """
-
- def glFree():
- """
- Delete this image's data from OpenGL texture memory, only (the image itself
- is not removed from Blender's memory). Internally, glDeleteTextures (see
- L{BGL.glDeleteTextures}) is used, but this method also updates Blender's
- Image object so that its bind code is set to 0. See also L{Image.glLoad},
- L{Image.getBindCode}.
- """
-
- def setName(name):
- """
- Set the name of this Image object.
- @type name: string
- @param name: The new name.
- """
-
- def setFilename(name):
- """
- Change the filename of this Image object.
- @type name: string
- @param name: The new full filename.
- @warn: use this with caution and note that the filename is truncated if
- larger than 160 characters.
- """
-
- def setXRep(xrep):
- """
- Texture tiling: set the number of x repetitions for this Image.
- @type xrep: int
- @param xrep: The new value in [1, 16].
- """
-
- def setYRep(yrep):
- """
- Texture tiling: set the number of y repetitions for this Image.
- @type yrep: int
- @param yrep: The new value in [1, 16].
- """
-
- def setStart(start):
- """
- Get the Image's start frame. Used for animated textures.
- @type start: int
- @param start: The new value in [0, 128].
- """
-
- def setEnd(end):
- """
- Set the Image's end frame. Used for animated textures.
- @type end: int
- @param end: The new value in [0, 128].
- """
-
- def setSpeed(speed):
- """
- Set the Image's speed (fps). Used for animated textures.
- @type speed: int
- @param speed: The new value in [1, 100].
- """
-
- def setPixelHDR(x, y, (r, g, b,a )):
- """
- Set the the colors of the current pixel in the form [r,g,b,a].
- For float image types, returned values can be greater then the useual [0.0, 1.0] range.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @type x: int
- @type y: int
- @type r: float
- @type g: float
- @type b: float
- @type a: float
- @returns: nothing
- @rtype: none
- """
-
- def setPixelF(x, y, (r, g, b,a )):
- """
- Set the the colors of the current pixel in the form [r,g,b,a].
- Color values must be floats in the range 0.0 - 1.0.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @type x: int
- @type y: int
- @type r: float
- @type g: float
- @type b: float
- @type a: float
- @returns: nothing
- @rtype: none
- """
-
- def setPixelI(x, y, (r, g, b, a)):
- """
- Set the the colors of the current pixel in the form [r,g,b,a].
- Color values must be ints in the range 0 - 255.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @type x: int
- @type y: int
- @type r: int
- @type g: int
- @type b: int
- @type a: int
- @returns: nothing
- @rtype: none
- """
-
- def save():
- """
- Saves the current image to L{filename}
- @note: Saving to a directory that doent exist will raise an error.
- @note: Saving a packed image will make a unique (numbered) name if the file alredy exists. Remove the file first to be sure it will not be renamed.
- @returns: None
- """
-
- def pack():
- """
- Packs the image into the current blend file.
-
- Since 2.44 new images without valid filenames can be packed.
-
- If the image is alredy packed, it will be repacked.
-
- @returns: nothing
- @rtype: none
- """
-
- def unpack(mode):
- """
- Unpacks the image to the images filename.
- @param mode: One of the values in L{Blender.UnpackModes}.
- @note: An error will be raised if the image is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
- def makeCurrent():
- """
- Set the currently displayed Image from Blenders UV/Image window.
- When multiple images are displayed, the last active UV/Image windows image is used.
- @warn: Deprecated, set bpy.data.images.active = image instead.
- @rtype: bool
- @return: True if the current image could be set, if no window was available, return False.
- """
-import id_generics
-Image.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
deleted file mode 100644
index 507592ce8a6..00000000000
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ /dev/null
@@ -1,437 +0,0 @@
-# Blender.Ipo module and the Ipo PyType object
-
-"""
-The Blender.Ipo submodule
-
-B{New}:
- - Ipo updates to both the program and Bpython access.
- - access to Blender's new Ipo driver capabilities.
- - Ipo now supports the mapping operator [] to access IpoCurves
-
-This module provides access to the Ipo Data in Blender. An Ipo is composed of
-several IpoCurves, and an IpoCurve is composed of several BezTriples.
-
-Example::
- from Blender import Ipo
-
- ipo = Ipo.Get('ObIpo') # retrieves an Ipo object
- ipo.name = 'ipo1' # change the Ipo's name
- icu = ipo[Ipo.OB_LOCX] # request X Location Ipo curve
- if icu != None and len(icu.bezierPoints) > 0: # if curve exists and has BezTriple points
- val = icu[2.5] # get the curve's value at time 2.5
- ipo[Ipo.OB_LOCX] = None # delete the Ipo curve
-
-Each type of Ipo has different types Ipocurves. With the exception of Shape
-Key Ipos, constants are used to specify all Ipocurves. There are two ways
-to tell which Ipo curves go with which Ipo type:
- - all constants start with a two-character identifier for their Ipo type;
- for example, "OB_LOCX" is the LocX curve for an Object Ipo
- - each Ipo now has a read-only attribute L{Ipo.curveConsts}, which returns
- the valid Ipo curve types for that specific Ipo
-
-The valid IpoCurve constants are:
- 1. Material Ipo: MA_R, MA_G, MA_B, MA_SPECR, MA_SPECG, MA_SPECB,
- MA_MIRR, MA_MIRG, MA_MIRB, MA_REF, MA_ALPHA, MA_EMIT, MA_AMB,
- MA_SPEC, MA_HARD, MA_SPTRA, MA_IOR, MA_MODE, MA_HASIZE, MA_TRANSLU,
- MA_RAYMIR, MA_FRESMIR, MA_FRESMIRI, MA_FRESTRA, MA_FRESTRAI,
- MA_TRAGLOW, MA_OFSX, MA_OFSY, MA_OFSZ, MA_SIZEX, MA_SIZEY, MA_SIZEZ,
- MA_TEXR, MA_TEXG, MA_TEXB, MA_DEFVAR, MA_COL, MA_NOR, MA_VAR, MA_DISP
- 2. Lamp Ipo: LA_ENERG, LA_R, LA_G, LA_B, LA_DIST, LA_SPOSI, LA_SPOBL,
- LA_QUAD1, LA_QUAD2, LA_HAINT, LA_OFSX, LA_OFSY, LA_OFSZ, LA_SIZEX,
- LA_SIZEY, LA_SIZEZ, LA_TEXR, LA_TEXG, LA_TEXB, LA_DEFVAR, LA_COL
- 3. World Ipo: WO_HORR, WO_HORG, WO_HORB, WO_ZENR, WO_ZENG, WO_ZENB,
- WO_EXPOS, WO_MISI, WO_MISDI, WO_MISSTA, WO_MISHI, WO_STARR,
- WO_STARB, WO_STARG, WO_STARDI, WO_STARSI, WO_OFSX, WO_OFSY,
- WO_OFSZ, WO_SIZEX, WO_SIZEY, WO_SIZEZ, WO_TEXR, WO_TEXG,
- WO_TEXB, WO_DEFVAR, WO_COL, WO_NOR, WO_VAR
- 4. Camera Ipo: CA_LENS, CA_CLSTA, CA_CLEND, CA_APERT, CA_FDIST
- 5. Object Ipo: OB_LOCX, OB_LOCY, OB_LOCZ, OB_DLOCX, OB_DLOCY, OB_DLOCZ,
- OB_ROTX, OB_ROTY, OB_ROTZ, OB_DROTX, OB_DROTY, OB_DROTZ,
- OB_SCALEX, OB_SCALEY, OB_SCALEZ, OB_DSCALEX, OB_DSCALEY, OB_DSCALEZ,
- OB_LAYER, OB_TIME, OB_COLR, OB_COLG, OB_COLB, OB_COLA,
- OB_FSTRENG, OB_FFALL, OB_RDAMP, OB_DAMPING, OB_PERM
- 6. Curve Ipo: CU_SPEED
- 7. Constraint Ipo: CO_INF
- 8. Texture Ipo: TE_NSIZE, TE_NDEPTH, TE_NTYPE, TE_TURB, TE_VNW1, TE_VNW2,
- TE_VNW3, TE_VNW4, TE_MINKMEXP, TE_DISTM, TE_COLT, TE_ISCALE,
- TE_DISTA, TE_MGTYPE, TE_MGH, TE_LACU, TE_OCT, TE_MGOFF,
- TE_MGGAIN, TE_NBASE1, TE_NBASE2, TE_COLR, TE_COLG, TE_COLB,
- TE_BRIGHT, TE_CONTRAS
- 9. Pose/Action Ipo: PO_LOCX, PO_LOCY, PO_LOCZ, PO_SCALEX, PO_SCALEY,
- PO_SCALEZ, PO_QUATW, PO_QUATX, PO_QUATY, PO_QUATZ
- 10. Sequence Ipo: SQ_FAC
-
-Shape Key Ipos are handled differently from other Ipos. The user can rename
-the curves, so string are used to access them instead of constants. The
-L{Ipo.curveConsts} attribute for Shape Key Ipos returns a list of all defined
-key names.
-"""
-
-def New (type, name):
- """
- Creates a new Ipo.
- @type type: string
- @type name: string
- @param type: The Ipo's blocktype. Depends on the object the Ipo will be
- linked to. Currently supported types are Object, Camera, World,
- Material, Texture, Lamp, Action, Constraint, Sequence, Curve, Key.
- @param name: The name for this Ipo.
- @rtype: Blender Ipo
- @return: The created Ipo.
- """
-
-def Get (name = None):
- """
- Get the Ipo from Blender.
- @type name: string
- @param name: The name of the requested Ipo, or nothing.
- @rtype: Blender Ipo or a list of Blender Ipos
- @return: It depends on the 'name' parameter:
- - (name): The Ipo with the given name;
- - (): A list with all Ipos in the current scene.
- """
-
-class Ipo:
- """
- The Ipo object
- ==============
- This object gives access to Ipo data from all objects in Blender.
- @Note: Blender Materials, Lamps and Worlds have I{texture channels} which
- allow the user to assign textures to them. The Blender Ipo Window allows
- the user to access the IpoCurves for these channels by specifying a number
- between 0 and 9 (the number appears next to the Ipo type in the window
- header). Prior to Version 2.42, the BPy API did not allow users to access
- these texture channels in a predictable manner. A new attribute named
- L{channel} was added to the API in Version 2.42 to correct this problem.
-
- The current channel setting has an effect on the operators B{[]}, B{len()}
- and others. For example, suppose a Material has three IpoCurves
- (R, G, and B), and two texture channels (numbered 0 and 1), and furthermore
- channel 0 has one Ipocurve (Col). The IpoCurve Col can only be
- "seen" through the API when B{ipo.channel} is 0. Setting B{ipo.channel} to
- 1 will cause this curve to be ignored by B{len(ipo)}::
-
- from Blender import Ipo
-
- ipo = Ipo.Get('MatIpo')
- for channel in xrange(2):
- ipo.channel = channel
- print 'channel is',channel
- print ' len is',len(ipo)
- names = dict([(x[1],x[0]) for x in ipo.curveConsts.items()])
- for curve in [Ipo.MA_R,Ipo.MA_COL]:
- print ' ',names[curve],'is',curve in ipo
-
- will output::
- channel is 0
- len is 4
- MA_R is True
- MA_COL is True
- channel is 1
- len is 3
- MA_R is True
- MA_COL is False
-
- @ivar curves: Ipo curves currently defined for the Ipo.
- @type curves: list of Ipocurves.
- @ivar curveConsts: The valid Ipo curves for this Ipo. These can be used
- by the [] mapping operator. The value
- depends on the Ipo curve type. If the Ipo is any type other than a Key or
- Shape Ipo, this attribute returns a set of constants that can be
- used to specify a particular curve. For Key or Shape Ipos, the attribute
- returns a list of all defined keys by name.
- @type curveConsts: constant or list of strings. Read-only.
- @ivar channel: the current texture channel for Blender object which support
- textures (materials, lamps and worlds). Returns None if the Ipo does
- not support texture channels. Value must be in the range [0,9].
- @type channel: int or None
- """
-
- def __contains__():
- """
- The "in" operator for Ipos. It returns B{True} if the specified
- IpoCurve exists for the Ipo. This operator B{should not} be used to
- test for whether a curve constant is valid for a particular Ipo type.
- Many constants for different Ipo types have the same value, and it is
- the constant's value used internally.
- No exceptions are raised if the argument is not a valid curve constant or
- or string, nor does the operator return B{True} when the curve
- constant is valid but does not currently exist. As such, it should only be
- used to test for specific curves when the Ipo type is known::
- ipo = Object.Get('Cube').ipo # get Object-type Ipo
- if ipo:
- print Ipo.OB_LOCX in ipo # prints "True" if 'LocX' curve exists
- print Ipo.MA_R in ipo # also prints "True" since MA_R and OB_LOCX are have the same value
- print 'hiccup' in ipo # always prints "False" since argument is not a constant
-
- @return: see above.
- @rtype: Boolean
- """
-
- def __getitem__():
- """
- This operator is similar to the Python dictionary mapping operator [],
- except that the user cannot assign arbitrary keys. Each Ipo type has
- a pre-defined set of IpoCurves which may or may not exist at a given time. This operator
- will either return an IpoCurve object if the specified curve exists,
- return None if the curve does not exists, or throws a KeyError exception
- if the curve is not valid for this Ipo type.
- @return: an IpoCurve object if it exists
- @rtype: IpoCurve or None
- @raise KeyError: an undefined IpoCurve was specified for the Ipo
- """
-
- def __iter__():
- """
- Iterator for Ipos. It returns all the defined IpoCurve objects associated
- with the Ipo. For example::
- from Blender import Ipo
-
- ipo = Ipo.Get()
- if len(ipo) > 0:
- ipo = ipo[0]
- print 'ipo name is',ipo.name
- for icu in ipo:
- print ' curve name is',icu.name
- might result in::
- ipo name is ObIpo
- curve name is LocX
- curve name is LocY
- curve name is LocZ
-
- @return: an IpoCurve object
- @rtype: IpoCurve
- """
-
- def __len__():
- """
- Returns the number of curves defined for the Ipo.
- @return: number of defined IpoCurves
- @rtype: int
- """
-
- def getName():
- """
- Gets the name of the Ipo (B{deprecated}). See the L{name} attribute.
- @rtype: string
- @return: the name of the Ipo.
- """
-
- def setName(newname):
- """
- Sets the name of the Ipo (B{deprecated}). See the L{name} attribute.
- @type newname: string
- @rtype: None
- @return: None
- """
-
- def getCurves():
- """
- Gets all the IpoCurves of the Ipo (B{deprecated}). Use the
- L{iterator operator []<__iter__>} instead.
- @rtype: list of IpoCurves
- @return: A list (possibly empty) containing all the IpoCurves associated
- to the Ipo object.
- """
-
- def getCurve(curve):
- """
- Return the specified IpoCurve (B{deprecated}). Use the L{mapping
- operator B{[]}<__getitem__>} instead.
- If the curve does not exist in the Ipo,
- None is returned. I{curve} can be either a string or an integer,
- denoting either the name of the Ipo curve or its internal adrcode.
- The possible Ipo curve names are:
-
- 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
- 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
- Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
- RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
- OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
- Disp.
- 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
- dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ,
- Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
- RDamp, Perm.
- 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
- SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
- SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
- 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
- MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
- MgOff, MgGain, NBase1, NBase2.
- 7. Curve Ipo: Speed.
- 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
- QuatZ, QuatW.
- 9. Sequence Ipo: Fac.
- 10. Constraint Ipo: Inf.
-
- The adrcode for the Ipo curve can also be given; this is useful for
- accessing curves for Shape Key Ipos. The adrcodes for Shape Key Ipo are
- numbered consecutively starting at 0.
- @type curve : string or int
- @rtype: IpoCurve object
- @return: the corresponding IpoCurve, or None.
- @raise ValueError: I{curve} is not a valid name or adrcode for this Ipo
- type.
- """
-
- def addCurve(curvename):
- """
- Add a new curve to the Ipo object. The possible values for I{curvename} are:
- 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
- 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
- Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
- RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
- OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
- Disp.
- 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
- dRotX, dRotY, dRotZ, ScaleX, ScaleY, ScaleZ, dScaleX, dScaleY, dScaleZ,
- Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
- RDamp, Perm.
- 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
- SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
- SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
- 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
- MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
- MgOff, MgGain, NBase1, NBase2.
- 7. Curve Ipo: Speed.
- 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
- QuatZ, QuatW.
- 9. Sequence Ipo: Fac.
- 10. Constraint Ipo: Inf.
-
- For Key IPOs, the name must be an existing KeyBlock name. Use
- L{curveConsts} to determine the set of valid names.
-
- @type curvename : string
- @rtype: IpoCurve object
- @return: the corresponding IpoCurve, or None.
- @raise ValueError: I{curvename} is not valid or already exists
- """
-
- def delCurve(curvename):
- """
- Delete an existing curve from the Ipo object (B{deprecated}).
- Use the L{mapping operator B{[]}<__getitem__>} instead::
- from Blender import Ipo
-
- ipo = Ipo.Get('ObIpo')
- ipo[Ipo.LOCX] = None
-
- @type curvename : string
- @rtype: None
- @return: None.
- """
-
- def getBlocktype():
- """
- Gets the blocktype of the Ipo.
- @rtype: int
- @return: the blocktype of the Ipo.
- """
-
- def setBlocktype(newblocktype):
- """
- Sets the blocktype of the Ipo.
- @type newblocktype: int
- @rtype: None
- @return: None
- @warn: 'newblocktype' should not be changed unless you really know what
- you are doing ...
- """
-
- def getRctf():
- """
- Gets the rctf of the Ipo.
- Kind of bounding box...
- @rtype: list of floats
- @return: the rctf of the Ipo.
- """
-
- def setRctf(newrctf):
- """
- Sets the rctf of the Ipo.
- @type newrctf: four floats.
- @rtype: None
- @return: None
- @warn: rctf should not be changed unless you really know what you are
- doing ...
- """
-
- def getNcurves():
- """
- Gets the number of curves of the Ipo (B{deprecated}). Use
- L{len(ipo)<__len__>} instead.
- @rtype: int
- @return: the number of curve of the Ipo.
- """
-
- def getCurveBP(curvepos):
- """
- This method is unsupported. BPoint Ipo curves are not implemented.
- Calling this method throws a NotImplementedError exception.
- @raise NotImplementedError: this method B{always} raises an exception
- """
-
- def getBeztriple(curvepos,pointpos):
- """
- Gets a beztriple of the Ipo (B{deprecated}). B{Note}:
- Use L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} instead.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type pointpos: int
- @param pointpos: the position of the point in the curve.
- @rtype: list of 9 floats
- @return: the beztriple of the Ipo, or an error is raised.
- """
-
- def setBeztriple(curvepos,pointpos,newbeztriple):
- """
- Sets the beztriple of the Ipo (B{deprecated}). B{Note}: use
- L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} to get a
- BezTriple point, then use the
- L{BezTriple} API to set the point's attributes.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type pointpos: int
- @param pointpos: the position of the point in the curve.
- @type newbeztriple: list of 9 floats
- @param newbeztriple: the new value for the point
- @rtype: None
- @return: None
- """
-
- def getCurveCurval(curvepos):
- """
- Gets the current value of a curve of the Ipo (B{deprecated}). B{Note}:
- new scripts should use L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
- @type curvepos: int or string
- @param curvepos: the position of the curve in the Ipo or the name of the
- curve
- @rtype: float
- @return: the current value of the selected curve of the Ipo.
- """
-
- def EvaluateCurveOn(curvepos,time):
- """
- Gets the value at a specific time of a curve of the Ipo (B{deprecated}).
- B{Note}: new scripts should use
- L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type time: float
- @param time: the desired time.
- @rtype: float
- @return: the current value of the selected curve of the Ipo at the given
- time.
- """
-import id_generics
-Ipo.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/IpoCurve.py b/source/blender/python/api2_2x/doc/IpoCurve.py
deleted file mode 100644
index 850a1825325..00000000000
--- a/source/blender/python/api2_2x/doc/IpoCurve.py
+++ /dev/null
@@ -1,239 +0,0 @@
-# Blender.IpoCurve module and the IpoCurve PyType object
-
-"""
-The Blender.IpoCurve submodule
-
-B{New}:
- - IpoCurves supports the operator [], which accesses the value of
- curves at a given time.
-
-This module provides access to the IpoCurve data in Blender. An Ipo is
-composed of several IpoCurves, and an IpoCurve are composed of several
-BezTriples.
-
-@warning: Ipo curves store euler rotations as degrees/10.0 so 180.0 would be 18.0
-
-Example::
- import Blender
- ipo = Blender.Ipo.Get('ObIpo') # retrieves an Ipo object
- ipo.name = 'ipo1' # change the Ipo's name
- icu = ipo[Blender.Ipo.OB_LOCX] # request X Location Ipo curve object
- if icu != None and len(icu.bezierPoints) > 0: # if curve exists and has BezTriple points
- val = icu[2.5] # get the curve's value at time 2.5
-
-@type ExtendTypes: readonly dictionary
-@var ExtendTypes: The available IpoCurve extend types.
- - CONST - curve is constant beyond first and last knots
- - EXTRAP - curve maintains same slope beyond first and last knots
- - CYCLIC - curve values repeat beyond first and last knots
- - CYCLIC_EXTRAP - curve values repeat beyond first and last knots,
- but while retaining continuity
-
-@type InterpTypes: readonly dictionary
-@var InterpTypes: The available IpoCurve interpolation types.
- - CONST - curve remains constant from current BezTriple knot
- - LINEAR - curve is linearly interpolated between adjacent knots
- - BEZIER - curve is interpolated by a Bezier curve between adjacent knots
-"""
-
-class IpoCurve:
- """
- The IpoCurve object
- ===================
- This object gives access to generic data from all Ipo curves objects
- in Blender.
-
- Important Notes for Rotation Ipo Curves:\n
- For the rotation Ipo curves, the y values for points are in units of 10
- degrees. For example, 45.0 degrees is stored as 4.50 degrees. These are the
- same numbers you see in the Transform Properties pop-up menu ( NKey ) in
- the IPO Curve Editor window. Positive rotations are in a counter-clockwise
- direction, following the standard convention.
-
- @ivar driver: Status of the driver. 1= on, 0= object, 2= python expression.
- @type driver: int
- @ivar driverObject: Object used to drive the Ipo curve.
- @type driverObject: Blender Object or None
- @ivar driverExpression: Python expression used to drive the Ipo curve. [0 - 127 chars]
- @type driverExpression: string
- @ivar sel: The selection state of this curve.
- @type sel: bool
- @ivar driverChannel: Object channel used to drive the Ipo curve.
- Use module constants: IpoCurve.LOC_X, IpoCurve.LOC_Y, IpoCurve.LOC_Z,
- IpoCurve.ROT_X, IpoCurve.ROT_Y, IpoCurve.ROT_Z, IpoCurve.SIZE_X,
- IpoCurve.SIZE_Y, IpoCurve.SIZE_Z
- @type driverChannel: int
- @ivar name: The IpoCurve data name.
- @type name: string
- @ivar bezierPoints: The list of the curve's bezier points.
- @type bezierPoints: list of BezTriples.
- @ivar interpolation: The curve's interpolation mode. See L{InterpTypes} for
- values.
- @type interpolation: int
- @ivar extend: The curve's extend mode. See L{ExtendTypes} for values.
-
- B{Note}: Cyclic Ipo curves never reach the end value. If the first and
- last bezier points do not have the same y coordinate, the value of the
- curve when it "cycles" is that of the first point. If a user wants to
- get the value of the final curve point, read the final point from the
- curve::
-
- ipo = Blender.Object.Get('Cube').ipo
- icu = ipo['LocX']
- endtime,endvalue = icu.bezierPoints[-1].pt
- @type extend: int
- """
-
- def __getitem__ (time):
- """
- Returns the value of the curve at a particular time.
- @type time: float
- @param time: time (Vertex X) on the curve
- @rtype: float
- @return: value (Vertex Y) corresponding to the given time
- """
-
- def __setitem__ (time):
- """
- Sets the value (Vertex Y) of the curve at a particular time.
- @type time: float
- @param time: time (Vertex X) on the curve
- """
-
- def setExtrapolation(extendmode):
- """
- Sets the extend mode of the curve (B{deprecated}). B{Note}: new scripts
- should use the L{extend} attribute instead.
- @type extendmode: string
- @param extendmode: the extend mode of the curve.
- Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
- @rtype: None
- @return: None
- """
-
- def getExtrapolation():
- """
- Gets the extend mode of the curve (B{deprecated}). B{Note}: new scripts
- should use the L{extend} attribute instead.
- @rtype: string
- @return: the extend mode of the curve. Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation.
- """
-
- def setInterpolation(interpolationtype):
- """
- Sets the interpolation type of the curve (B{deprecated}). B{Note}:
- new scripts should use the L{interpolation} attribute instead.
- @type interpolationtype: string
- @param interpolationtype: the interpolation type of the curve. Can be Constant, Bezier, or Linear.
- @rtype: None
- @return: None
- """
-
- def getInterpolation():
- """
- Gets the interpolation type of the curve (B{deprecated}). B{Note}:
- new scripts should use the L{interpolation} attribute instead.
- @rtype: string
- @return: the interpolation type of the curve. Can be Constant, Bezier, or Linear.
- """
-
- def append(point):
- """
- Adds a Bezier point to a IpoCurve.
- @type point: BezTriple or tuple of 2 floats
- @param point: Can either be a BezTriple, or the x and y coordinates of
- the Bezier knot point.
- @rtype: None
- @return: None
- """
-
- def addBezier(coordlist):
- """
- Adds a Bezier point to a curve B{deprecated}). B{Note}: new scripts
- should use L{append} instead.
- @type coordlist: tuple of (at least) 2 floats
- @param coordlist: the x and y coordinates of the new Bezier point.
- @rtype: None
- @return: None
- """
-
- def delBezier(index):
- """
- Deletes a Bezier point from a curve.
- @type index: integer
- @param index: the index of the Bezier point. Negative values index from the end of the list.
- @rtype: None
- @return: None
- """
-
- def recalc():
- """
- Recomputes the curve after changes to control points.
- @rtype: None
- @return: None
- """
-
- def getName():
- """
- Returns the name of the Ipo curve (B{deprecated}). B{Note}:
- new scripts should use the L{name} attribute instead.
- The name can be:
- 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
- 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
- Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
- RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
- OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
- Disp.
- 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
- dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ,
- Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
- RDamp, Perm.
- 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
- SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
- SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
- 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
- MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
- MgOff, MgGain, NBase1, NBase2.
- 7. Curve Ipo: Speed.
- 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
- QuatZ, QuatW.
- 9. Sequence Ipo: Fac.
- 10. Constraint Ipo: Inf.
-
- @rtype: string
- @return: the name of the Ipo curve.
- """
-
- def getPoints():
- """
- Returns all the points of the IpoCurve (B{deprecated}).
- B{Note}: new scripts should use the L{bezierPoints} attribute instead.
- @rtype: list of BezTriples
- @return: the points of the Ipo curve.
- """
-
- def clean( thresh=0.0000001 ):
- """
- Calls the IPO-curve cleaning function on this IpoCurve.
- There is no need to recalculate curve manually.
- @type thresh: float
- @param thresh: The threshold to used to determine if two values are identical.
- By default, the IPO-editor tool's value is used.
- @rtype: None
- @return: None
- """
-
- def evaluate( time ):
- """
- Compute the value of the Ipo curve at a particular time (B{deprecated}).
- B{Note}: new scripts should use L{icu[time]<__getitem__>} instead.
- @type time: float
- @param time: value along the X axis
- @rtype: float
- @return: the Y value of the curve at the given time
- """
-
diff --git a/source/blender/python/api2_2x/doc/Ipodoc.txt b/source/blender/python/api2_2x/doc/Ipodoc.txt
deleted file mode 100644
index 81d51595fa9..00000000000
--- a/source/blender/python/api2_2x/doc/Ipodoc.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-IPO Module documentation
-
-
-INTRODUCTION
-The module ipo allows you to access all the data of an ipo.
-The most important part(s) of an ipo is its ipocurve(s). The ipocurve has a set of bezier points (defined by 9 coordinates). The ipo module grants the user read/write access to these points.
-
-
-
-
-functions of the module :
-
-Get(Name:string) : returns the Ipo associated whose name is Name.
-
-get : same as Get
-
-New(Name:string , idcode:int ) : Creates and returns a new Ipo Object.
-The parameters are mandatory. If the name is already used, blender will change it to name.XXX (XXX is an integer)
-
-
-
-Ipo object member functions :
-
-getName() : Retrieves the name of the Ipo Object.
-
-setName(newname:string) : Sets the name of the Ipo Object.
-
-getBlocktype() : Retrieves the blocktype of the Ipo Object.
-
-setBlocktype(newblocktype:string) : Sets the blocktype of the Ipo Object.
-
-getShowkey() : Retrieves the showkey of the Ipo Object.
-
-setShowkey(val:int) : Sets the showkey of the Ipo Object.
-
-getPad() : Retrieves the pad of the Ipo Object.
-
-setPad(val:int) : Sets the pad of the Ipo Object.
-
-getRctf() : Retrieves the rctf of the Ipo Object.
-
-setRctf(val:int) : Sets the rctf of the Ipo Object.
-
-I do not fully understand the meaning of these parameters.
-
-
-
-getNcurves() : returns the number of ipocurves the ipo object contains.
-
-getBP() : returns the basepoint of the ipo object (generally NULL)
-
-getCurveCurval(numcurve:int) : returns the current value of the ipo curve number numcurve.
-
-getCurveBeztriple(numcurve:int,numpoint:int) : returns a list of 9 floats, which are the coordinates of the control point number numpoint of the ipocurve number numcurve.
-
-
-
-setCurveBeztriple(numcurve:int,numpoint:int,newvalues : list of 9 floats) : sets the coordinates of the control point number numpoint of the ipocurve number numcurve to newvalues. (the z coordinate should be 0, but blender does not complain if non null values are passed)
-
-
-
-Example :
-import Blender
-
-d = Blender.Ipo.Get('ObIpo') # hope there is an ipo named "ObIpo"...Else create it before.
-
diff --git a/source/blender/python/api2_2x/doc/Key.py b/source/blender/python/api2_2x/doc/Key.py
deleted file mode 100644
index 53f289d2e8b..00000000000
--- a/source/blender/python/api2_2x/doc/Key.py
+++ /dev/null
@@ -1,124 +0,0 @@
-# Blender.Key module and the Key and KeyBlock PyType objects
-
-"""
-The Blender.Key submodule.
-
-This module provides access to B{Key} objects in Blender.
-
-@type Types: readonly dictionary
-@var Types: The type of a key owner, indicating the type of data in the
-data blocks.
- - MESH - the key is a Mesh key; data blocks contain
- L{NMVert<NMesh.NMVert>} vertices.
- - CURVE - the key is a Curve key; data blocks contains either
- L{BezTriples<BezTriple.BezTriple>} or points (represented by a list of
- 3 floating point numbers).
- - LATTICE - the key is a Lattice key; data blocks contain
- BPoints, each point represented by a list of 3 floating point numbers.
-"""
-
-def Get(name = None):
- """
- Get the named Key object from Blender. If the name is omitted, it
- will retrieve a list of all keys in Blender.
- @type name: string
- @param name: the name of the requested key
- @return: If name was given, return that Key object (or None if not
- found). If a name was not given, return a list of every Key object
- in Blender.
- """
-
-class Key:
- """
- The Key object
- ==============
- An object with keyframes (L{Lattice}, L{NMesh} or
- L{Curve}) will contain a Key object representing the
- keyframe data.
-
- @ivar ipo: Key Ipo. Contains the Ipo if one is assigned to the
- object, B{None} otherwise. Setting to B{None} clears the current Ipo.
- @type ipo: Blender Ipo
- @ivar value: The value of the key. Read-only.
- @type value: float
- @ivar type: An integer from the L{Types} dictionary
- representing the Key type. Read-only.
- @type type: int
- @ivar blocks: A list of KeyBlocks for the key. Read-only.
- @type blocks: Blender KeyBlock.
- @ivar relative: Indicates whether the key is relative(=True) or normal.
- @type relative: bool
- """
-
- def getIpo():
- """
- Get the L{Ipo} object associated with this key.
- """
- def getBlocks():
- """
- Get a list of L{KeyBlock}s, containing the keyframes defined for
- this Key.
- """
-
-class KeyBlock:
- """
- The KeyBlock object
- ===================
- Each Key object has a list of KeyBlocks attached, each KeyBlock
- representing a keyframe.
-
- @ivar curval: Current value of the corresponding IpoCurve. Read-only.
- @type curval: float
- @ivar name: The name of the Keyblock. Truncated to 32 characters.
- @type name: string
- @ivar pos: The position of the keyframe.
- @type pos: float
- @ivar slidermin: The minimum value for the action slider.
- Value is clamped to the range [-10.0,10.0].
- @type slidermin: float
- @ivar slidermax: The maximum value for the action slider.
- Value is clamped to the range [-10.0,10.0].
- @type slidermax: float
- @ivar vgroup: The assigned VGroup for the Key Block.
- @type vgroup: string
- @ivar data: The data of the KeyBlock (see L{getData}). This
- attribute is read-only.
- @type data: varies
- """
-
- def getData():
- """
- Get the data of a KeyBlock, as a list of data items. Each item
- will have a different data format depending on the type of this
- Key.
-
- Note that prior to 2.45 the behaviour of this function
- was different (and very wrong). Old scripts might need to be
- updated.
-
- - Mesh keys have a list of L{Vectors<Mathutils.Vector>} objects in the data
- block.
- - Lattice keys have a list of L{Vectors<Mathutils.Vector>} objects in the data
- block.
- - Curve keys return either a list of tuples, eacn containing
- four L{Vectors<Mathutils.Vector>} (if the curve is a Bezier curve),
- or otherwise just a list of L{Vectors<Mathutils.Vector>}.
-
- For bezier keys, the first three vectors in the tuple are the Bezier
- triple vectors, while the fourth vector's first element is the curve tilt
- (the other two elements are reserved and are currently unused).
-
- For non-Bezier keys, the first three elements of the returned vector is
- the curve handle point, while the fourth element is the tilt.
-
-
- A word on relative shape keys; relative shape keys are not actually
- stored as offsets to the base shape key (like you'd expect). Instead,
- each shape key stores an entire model (actually the state of the mesh
- vertices after exiting editmode with any given key active).
-
- The additive offset for a shape key is calculated (when needed) by
- comparing the shape key with its base key, which is always the very
- first in the keyblock list.
- """
-
diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py
deleted file mode 100644
index 162d94ccff3..00000000000
--- a/source/blender/python/api2_2x/doc/Lamp.py
+++ /dev/null
@@ -1,532 +0,0 @@
-# Blender.Lamp module and the Lamp PyType object
-
-"""
-The Blender.Lamp submodule.
-
-B{New}: L{Lamp.clearScriptLinks} accepts a parameter now.
-
-Lamp Data
-=========
-
-This module provides control over B{Lamp Data} objects in Blender.
-
-Example::
-
- from Blender import Lamp, Scene
- l = Lamp.New('Spot') # create new 'Spot' lamp data
- l.setMode('Square', 'Shadow') # set these two lamp mode flags
- scn = Scene.GetCurrent()
- ob = scn.objects.new(l)
-
-@type Types: read-only dictionary
-@var Types: The lamp types.
- - 'Lamp': 0
- - 'Sun' : 1
- - 'Spot': 2
- - 'Hemi': 3
- - 'Area': 4
- - 'Photon': 5
-@type Falloffs: read-only dictionary
-@var Falloffs: The lamp falloff types.
- - CONSTANT - Constant falloff
- - INVLINEAR - Inverse linear
- - INVSQUARE - Inverse square
- - CUSTOM - Custom curve
- - LINQUAD - Lin/Quad weighted
-@type Modes: read-only dictionary
-@var Modes: The lamp modes. Modes may be ORed together.
- - 'Shadows'
- - 'Halo'
- - 'Layer'
- - 'Quad'
- - 'Negative'
- - 'OnlyShadow'
- - 'Sphere'
- - 'Square'
- - 'NoDiffuse'
- - 'NoSpecular'
- - 'RayShadow'
-
- Example::
- from Blender import Lamp, Object
- # Change the mode of selected lamp objects.
- for ob in Object.GetSelected(): # Loop through the current selection
- if ob.getType() == "Lamp": # if this is a lamp.
- lamp = ob.getData() # get the lamp data.
- if lamp.type == Lamp.Types["Spot"]: # Lamp type is not a flag
- lamp.mode &= ~Lamp.Modes["RayShadow"] # Disable RayShadow.
- lamp.mode |= Lamp.Modes["Shadows"] # Enable Shadowbuffer shadows
-"""
-
-def New (type = 'Lamp', name = 'LampData'):
- """
- Create a new Lamp Data object.
- @type type: string
- @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'.
- @type name: string
- @param name: The Lamp Data name.
- @rtype: Blender Lamp
- @return: The created Lamp Data object.
- """
-
-def Get (name = None):
- """
- Get the Lamp Data object(s) from Blender.
- @type name: string
- @param name: The name of the Lamp Data.
- @rtype: Blender Lamp or a list of Blender Lamps
- @return: It depends on the I{name} parameter:
- - (name): The Lamp Data object with the given I{name};
- - (): A list with all Lamp Data objects in the current scene.
- """
-
-class Lamp:
- """
- The Lamp Data object
- ====================
- This object gives access to Lamp-specific data in Blender.
-
- @ivar B: Lamp color blue component.
- Value is clamped to the range [0.0,1.0].
- @type B: float
- @ivar G: Lamp color green component.
- Value is clamped to the range [0.0,1.0].
- @type G: float
- @ivar R: Lamp color red component.
- Value is clamped to the range [0.0,1.0].
- @type R: float
- @ivar bias: Lamp shadow map sampling bias.
- Value is clamped to the range [0.01,5.0].
- @type bias: float
- @ivar bufferSize: Lamp shadow buffer size.
- Value is clamped to the range [512,5120].
- @type bufferSize: int
- @ivar clipEnd: Lamp shadow map clip end.
- Value is clamped to the range [1.0,5000.0].
- @type clipEnd: float
- @ivar clipStart: Lamp shadow map clip start.
- Value is clamped to the range [0.1,1000.0].
- @type clipStart: float
- @ivar col: Lamp RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type col: RGB tuple
- @ivar dist: Lamp clipping distance.
- Value is clamped to the range [0.1,5000.0].
- @type dist: float
- @ivar energy: Lamp light intensity.
- Value is clamped to the range [0.0,10.0].
- @type energy: float
- @ivar haloInt: Lamp spotlight halo intensity.
- Value is clamped to the range [0.0,5.0].
- @type haloInt: float
- @ivar haloStep: Lamp volumetric halo sampling frequency.
- Value is clamped to the range [0,12].
- @type haloStep: int
- @ivar ipo: Lamp Ipo.
- Contains the Ipo if one is assigned to the object, B{None} otherwise. Setting to B{None} clears the current Ipo..
- @type ipo: Blender Ipo
- @ivar mode: Lamp mode bitfield. See L{Modes} for values.
- @type mode: int
- @ivar quad1: Quad lamp linear distance attenuation.
- Value is clamped to the range [0.0,1.0].
- @type quad1: float
- @ivar quad2: Quad lamp quadratic distance attenuation.
- Value is clamped to the range [0.0,1.0].
- @type quad2: float
- @ivar samples: Lamp shadow map samples.
- Value is clamped to the range [1,16].
- @type samples: int
- @ivar raySamplesX: Lamp raytracing X samples (X is used for the Y axis with square area lamps).
- Value is clamped to the range [1,16].
- @type raySamplesX: int
- @ivar raySamplesY: Lamp raytracing Y samples (Y is only used for rectangle area lamps).
- Value is clamped to the range [1,16].
- @type raySamplesY: int
- @ivar areaSizeX: Lamp X size (X is used for the Y axis with square area lamps)
- Value is clamped to the range [0.01,100.0].
- @type areaSizeX: float
- @ivar areaSizeY: Lamp Y size (Y is only used for rectangle area lamps).
- Value is clamped to the range [0.01,100.0].
- @type areaSizeY: float
- @ivar softness: Lamp shadow sample area size.
- Value is clamped to the range [1.0,100.0].
- @type softness: float
- @ivar spotBlend: Lamp spotlight edge softness.
- Value is clamped to the range [0.0,1.0].
- @type spotBlend: float
- @ivar spotSize: Lamp spotlight beam angle (in degrees).
- Value is clamped to the range [1.0,180.0].
- @type spotSize: float
- @ivar type: Lamp type. See L{Types} for values.
- @type type: int
- @ivar falloffType: Lamp falloff type. See L{Falloffs} for values.
- @type falloffType: int
- @type textures: a tuple of Blender MTex objects.
- @ivar textures: The Lamp's texture list. Empty texture channels contains None.
-
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
- """
-
- def getName():
- """
- Get the name of this Lamp Data object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Lamp Data object.
- @type name: string
- @param name: The new name.
- """
-
- def getType():
- """
- Get this Lamp's type.
- @rtype: int
- """
-
- def setType(type):
- """
- Set this Lamp's type.
- @type type: string
- @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'
- """
-
- def getMode():
- """
- Get this Lamp's mode flags.
- @rtype: int
- @return: B{OR'ed value}. Use the Modes dictionary to check which flags
- are 'on'.
-
- Example::
- flags = mylamp.getMode()
- if flags & mylamp.Modes['Shadows']:
- print "This lamp produces shadows"
- else:
- print "The 'Shadows' flag is off"
- """
-
- def setMode(m = None, m2 = None, m3 = None, m4 = None,
- m5 = None, m6 = None, m7 = None, m8 = None):
- """
- Set this Lamp's mode flags. Mode strings given are turned 'on'.
- Those not provided are turned 'off', so lamp.setMode() -- without
- arguments -- turns off all mode flags for Lamp lamp.
- @type m: string
- @param m: A mode flag. From 1 to 8 can be set at the same time.
- """
-
- def getSamples():
- """
- Get this lamp's samples value.
- @rtype: int
- """
-
- def setSamples(samples):
- """
- Set the samples value.
- @type samples: int
- @param samples: The new samples value.
- """
-
- def getRaySamplesX():
- """
- Get this lamp's raytracing sample value on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def setRaySamplesX():
- """
- Set the lamp's raytracing sample value on the X axis, between 1 and 16.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def getRaySamplesY():
- """
- Get this lamp's raytracing sample value on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def setRaySamplesY():
- """
- Set the lamp's raytracing sample value on the Y axis, between 1 and 16.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def getAreaSizeX():
- """
- Get this lamp's size on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def setAreaSizeX():
- """
- Set this lamp's size on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def getAreaSizeY():
- """
- Get this lamp's size on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def setAreaSizeY():
- """
- Set this lamp's size on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def getBufferSize():
- """
- Get this lamp's buffer size.
- @rtype: int
- """
-
- def setBufferSize(bufsize):
- """
- Set the buffer size value.
- @type bufsize: int
- @param bufsize: The new buffer size value.
- """
-
- def getHaloStep():
- """
- Get this lamp's halo step value.
- @rtype: int
- """
-
- def setHaloStep(hastep):
- """
- Set the halo step value.
- @type hastep: int
- @param hastep: The new halo step value.
- """
-
- def getEnergy():
- """
- Get this lamp's energy intensity value.
- @rtype: float
- """
-
- def setEnergy(energy):
- """
- Set the energy intensity value.
- @type energy: float
- @param energy: The new energy value.
- """
-
- def getDist():
- """
- Get this lamp's distance value.
- @rtype: float
- """
-
- def setDist(distance):
- """
- Set the distance value.
- @type distance: float
- @param distance: The new distance value.
- """
-
- def getSpotSize():
- """
- Get this lamp's spot size value.
- @rtype: float
- """
-
- def setSpotSize(spotsize):
- """
- Set the spot size value.
- @type spotsize: float
- @param spotsize: The new spot size value.
- """
-
- def getSpotBlend():
- """
- Get this lamp's spot blend value.
- @rtype: float
- """
-
- def setSpotBlend(spotblend):
- """
- Set the spot blend value.
- @type spotblend: float
- @param spotblend: The new spot blend value.
- """
-
- def getClipStart():
- """
- Get this lamp's clip start value.
- @rtype: float
- """
-
- def setClipStart(clipstart):
- """
- Set the clip start value.
- @type clipstart: float
- @param clipstart: The new clip start value.
- """
-
- def getClipEnd():
- """
- Get this lamp's clip end value.
- @rtype: float
- """
-
- def setClipEnd(clipend):
- """
- Set the clip end value.
- @type clipend: float
- @param clipend: The new clip end value.
- """
-
- def getBias():
- """
- Get this lamp's bias value.
- @rtype: float
- """
-
- def setBias(bias):
- """
- Set the bias value.
- @type bias: float
- @param bias: The new bias value.
- """
-
- def getSoftness():
- """
- Get this lamp's softness value.
- @rtype: float
- """
-
- def setSoftness(softness):
- """
- Set the softness value.
- @type softness: float
- @param softness: The new softness value.
- """
-
- def getHaloInt():
- """
- Get this lamp's halo intensity value.
- @rtype: float
- """
-
- def setHaloInt(haloint):
- """
- Set the halo intensity value.
- @type haloint: float
- @param haloint: The new halo intensity value.
- """
-
- def getQuad1():
- """
- Get this lamp's quad 1 value.
- @rtype: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def setQuad1(quad1):
- """
- Set the quad 1 value.
- @type quad1: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def getQuad2():
- """
- Get this lamp's quad 2 value.
- @rtype: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def setQuad2(quad2):
- """
- Set the quad 2 value.
- @type quad2: float
- @param quad2: The new quad 2 value.
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Lamp's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Lamp. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Lamp.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def getIpo():
- """
- Get the Ipo associated with this Lamp object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this Lamp object.
- @type ipo: Blender Ipo
- @param ipo: a "lamp data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this Lamp object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in lamp ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -RGB
- -ENERGY
- -SPOTSIZE
- -OFFSET
- -SIZE
- @return: None
- """
-
- def __copy__ ():
- """
- Make a copy of this lamp
- @rtype: Lamp
- @return: a copy of this lamp
- """
-
-import id_generics
-Lamp.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Lattice.py b/source/blender/python/api2_2x/doc/Lattice.py
deleted file mode 100644
index 8666254ec0d..00000000000
--- a/source/blender/python/api2_2x/doc/Lattice.py
+++ /dev/null
@@ -1,209 +0,0 @@
-# Blender.Lattice module and the Lattice PyType object
-
-"""
-The Blender.Lattice submodule.
-
-Lattice Object
-==============
-
-This module provides access to B{Lattice} object in Blender.
-
-Example::
- import Blender
- from Blender import Lattice, Object, Scene, Modifier
-
- # Make new lattice data
- lattice_data = Lattice.New()
- lattice_data.setPartitions(5,5,5)
- lattice_data.setKeyTypes(Lattice.LINEAR, Lattice.CARDINAL, Lattice.BSPLINE)
- lattice_data.setMode(Lattice.OUTSIDE)
-
- for y in range(125):
- vec = lattice_data.getPoint(y)
- co1 = vec[0] + vec[0] / 5
- co2 = vec[1] - vec[2] * 0.3
- co3 = vec[2] * 3
- lattice_data.setPoint(y,[co1,co2,co3])
-
- # Create a new object from the lattice in the current scene
- scn = Scene.GetCurrent()
- ob_lattice = scn.objects.new(lattice_data)
-
- # Get an object to deform with this lattice
- mySphere = Object.Get('Sphere')
-
- # Apply lattice modifier
- mod= mySphere.modifiers.append(Modifier.Type.LATTICE)
- mod[Modifier.Settings.OBJECT] = ob_lattice
- mySphere.makeDisplayList()
-
- Blender.Redraw()
-"""
-
-def New (name = None):
- """
- Create a new Lattice object.
- Passing a name to this function will name the Lattice
- datablock, otherwise the Lattice data will be given a
- default name.
- @type name: string
- @param name: The Lattice name.
- @rtype: Blender Lattice
- @return: The created Lattice Data object.
- """
-
-def Get (name = None):
- """
- Get the Lattice object(s) from Blender.
- @type name: string
- @param name: The name of the Lattice object.
- @rtype: Blender Lattice or a list of Blender Lattices
- @return: It depends on the 'name' parameter:
- - (name): The Lattice object with the given name;
- - (): A list with all Lattice objects in the current scene.
- """
-
-class Lattice:
- """
- The Lattice object
- ==================
- This object gives access to Lattices in Blender.
- @ivar width: The number of x dimension partitions.
- @ivar height: The number of y dimension partitions.
- @ivar depth: The number of z dimension partitions.
- @ivar widthType: The x dimension key type.
- @ivar heightType: The y dimension key type.
- @ivar depthType: The z dimension key type.
- @ivar mode: The current mode of the Lattice.
- @ivar latSize: The number of points in this Lattice (width*height*depth).
- @cvar key: The L{Key.Key} object associated with this Lattice or None.
- """
-
- def getName():
- """
- Get the name of this Lattice datablock.
- @rtype: string
- @return: The name of the Lattice datablock.
- """
-
- def setName(name):
- """
- Set the name of this Lattice datablock.
- @type name: string
- @param name: The new name.
- """
-
- def getPartitions():
- """
- Gets the number of 'walls' or partitions that the Lattice has
- in the x, y, and z dimensions.
- @rtype: list of ints
- @return: A list corresponding to the number of partitions: [x,y,z]
- """
-
- def setPartitions(x,y,z):
- """
- Set the number of 'walls' or partitions that the
- Lattice will be created with in the x, y, and z dimensions.
- @type x: int
- @param x: The number of partitions in the x dimension of the Lattice.
- @type y: int
- @param y: The number of partitions in the y dimension of the Lattice.
- @type z: int
- @param z: The number of partitions in the z dimension of the Lattice.
- """
-
- def getKeyTypes():
- """
- Returns the deformation key types for the x, y, and z dimensions of the
- Lattice.
- @rtype: list of strings
- @return: A list corresponding to the key types will be returned: [x,y,z]
- """
-
- def setKeyTypes(xType,yType,zType):
- """
- Sets the deformation key types for the x, y, and z dimensions of the
- Lattice.
- There are three key types possible:
- - Lattice.CARDINAL
- - Lattice.LINEAR
- - Lattice.BSPLINE
- @type xType: enum constant
- @param xType: the deformation key type for the x dimension of the Lattice
- @type yType: enum constant
- @param yType: the deformation key type for the y dimension of the Lattice
- @type zType: enum constant
- @param zType: the deformation key type for the z dimension of the Lattice
- """
-
- def getMode():
- """
- Returns the current Lattice mode
- @rtype: string
- @return: A string representing the current Lattice mode
- """
-
- def setMode(modeType):
- """
- Sets the current Lattice mode
- There are two Lattice modes possible:
- - Lattice.GRID
- - Lattice.OUTSIDE
- @type modeType: enum constant
- @param modeType: the Lattice mode
- """
-
- def getPoint(index):
- """
- Returns the coordinates of a point in the Lattice by index.
- @type index: int
- @param index: The index of the point on the Lattice you want returned
- @rtype: list of floats
- @return: The x,y,z coordiates of the Lattice point : [x,y,z]
- """
-
- def setPoint(index, position):
- """
- Sets the coordinates of a point in the Lattice by index.
- @type index: int
- @param index: The index of the point on the Lattice you want set
- @type position: list of floats
- @param position: The x,y,z coordinates that you want the point to be: [x,y,z]
- """
-
- def getKey():
- """
- Returns the L{Key.Key} object associated with this Lattice.
- @rtype: L{Key.Key}
- @return: A key object representing the keyframes of the lattice or None.
- """
-
- def insertKey(frame):
- """
- Inserts the current state of the Lattice as a new absolute keyframe
-
- B{Example}::
- for z in range(5):
- for y in range(125):
- vec = myLat.getPoint(y)
- co1 = vec[0] + vec[2]
- co2 = vec[1] - vec[2]
- co3 = vec[2] + vec[1]
- myLat.setPoint(y,[co1,co2,co3])
- w = (z + 1) * 10
- myLat.insertKey(w)
-
- @type frame: int
- @param frame: the frame at which the Lattice will be set as a keyframe
- """
-
- def __copy__ ():
- """
- Make a copy of this lattice
- @rtype: Lattice
- @return: a copy of this lattice
- """
-
-import id_generics
-Lattice.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/LibData.py b/source/blender/python/api2_2x/doc/LibData.py
deleted file mode 100644
index daa6a186531..00000000000
--- a/source/blender/python/api2_2x/doc/LibData.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# bpy.lib submodule
-
-"""
-The bpy.libraries submodule.
-
-Libraries
-=========
-
-This module provides access to objects stored in .blend files. With it scripts
-can append from Blender files to the current scene, like the File->Append
-menu entry in Blender does. It allows programmers to use .blend files as
-data files for their scripts.
-
-@warn: This module is new and being considered as a replacement for the
-L{original Library<Library>} module. Users should stay tuned to see
-which module is supported in the end.
-
-Example::
- import bpy
-
- scn= bpy.data.scenes.active # get current scene
- lib = bpy.libraries.load('//file.blend') # open file.blend
- ob = scn.objects.link(lib.objects.append('Cube')) # append Cube object from library to current scene
- mat = lib.objects.link('Material') # get a link to a material
- me = ob.getData(mesh=1) # get mesh data
- me.materials[0] = mat # assign linked material to mesh
-"""
-
-def load(filename,relative=False):
- """
- Select an existing .blend file for use as a library. Unlike the
- Library module, multiple libraries can be defined at the same time.
-
- @type filename: string
- @param filename: The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location.
- @type relative: boolean
- @param relative: Convert relative paths to absolute paths (default). Setting this parameter to True will leave paths relative.
- @rtype: Library
- @return: return a L{Library} object.
- """
-
-def paths(link=0):
- """
- Returns a list of paths used in the current blend file.
-
- @type link: int
- @param link: 0 (default if no args given) for all library paths, 1 for directly linked library paths only, 2 for indirectly linked library paths only.
- @rtype: List
- @return: return a list of path strings.
- """
-
-def replace(pathFrom, pathTo):
- """
- Replaces an existing directly linked path.
-
- @type pathFrom: string
- @param pathFrom: An existing library path.
- @type pathTo: string
- @param pathTo: A new library path.
- """
-
-class Libraries:
- """
- The Library object
- ==================
- This class provides a unified way to access and manipulate library types
- in Blender.
- It provides access to scenes, objects, meshes, curves, metaballs,
- materials, textures, images, lattices, lamps, cameras, ipos, worlds,
- fonts, texts, sounds, groups, armatures, and actions.
- @ivar filename: The filename of the library, as supplied by user.
- @type filename: string
- @ivar name: The path to the library, as used by Blender. If the filename supplied by the user is relative, but the relative option to L{library.load()<load>} is False, the name will be the absolute path.
- @type name: string
- @ivar scenes: library L{scene<Scene.Scene>} data
- @type scenes: L{LibData}
- @ivar objects: library L{object<Object.Object>} data
- @type objects: L{LibData}
- @ivar meshes: library L{mesh<Mesh.Mesh>} data
- @type meshes: L{LibData}
- @ivar curves: library L{curve<Curve.Curve>} data
- @type curves: L{LibData}
- @ivar metaballs: library L{metaball<Metaball.Metaball>} data
- @type metaballs: L{LibData}
- @ivar materials: library L{material<Material.Material>} data
- @type materials: L{LibData}
- @ivar textures: library L{texture<Texture.Texture>} data
- @type textures: L{LibData}
- @ivar images: library L{image<Image.Image>} data
- @type images: L{LibData}
- @ivar lattices: library L{lattice<Lattice.Lattice>} data
- @type lattices: L{LibData}
- @ivar lamps: library L{lamp<Lamp.Lamp>} data
- @type lamps: L{LibData}
- @ivar cameras: library L{camera<Camera.Camera>} data
- @type cameras: L{LibData}
- @ivar ipos: library L{ipo<Ipo.Ipo>} data
- @type ipos: L{LibData}
- @ivar worlds: library L{world<World.World>} data
- @type worlds: L{LibData}
- @ivar fonts: library L{font<Font.Font>} data
- @type fonts: L{LibData}
- @ivar texts: library L{text<Text.Text>} data
- @type texts: L{LibData}
- @ivar sounds: library L{sound<Sound.Sound>} data
- @type sounds: L{LibData}
- @ivar groups: library L{group<Group.Group>} data
- @type groups: L{LibData}
- @ivar armatures: library L{armature<Armature.Armature>} data
- @type armatures: L{LibData}
- @ivar actions: library L{action<NLA.Action>} data
- @type actions: L{LibData}
- """
-
-class LibData:
- """
- Generic Library Data Access
- ===========================
- This class provides access to a specific type of library data.
- """
-
- def append(name):
- """
- Append a new datablock from a library. The new copy
- is added to the current .blend file.
-
- B{Note}: Blender Objects cannot be appended or linked without linking
- them to a scene. For this reason, lib.objects.append() returns a
- special "wrapper object" which must be passed to Scene.objects.link()
- or bpy.data.scenes.active.link() in order to actually create the object.
- So the following code will not create a new object::
- import bpy
-
- scn= bpy.data.scenes.active # get current scene
- lib = bpy.libraries.load('//file.blend') # open file.blend
- pseudoOb = lib.objects.append('Cube')) # get an object wrapper
- But this code will::
- import bpy
-
- scn= bpy.data.scenes.active # get current scene
- lib = bpy.libraries.load('//file.blend') # open file.blend
- pseudoOb = lib.objects.append('Cube')) # get an object wrapper
- ob = scn.objects.link(pseudoOb) # link to scene
- @rtype: Blender data
- @return: return a Blender datablock or object
- @raise IOError: library cannot be read
- @raise ValueError: library does not contain B{name}
- """
-
- def link(name):
- """
- Link a new datablock from a library. The linked data is not copied
- into the local .blend file.
-
- See L{append} for notes on special handling of Blender Objects.
- @rtype: Blender data
- @return: return a Blender datablock or object
- @raise IOError: library cannot be read
- @raise ValueError: library does not contain B{name}
- """
-
diff --git a/source/blender/python/api2_2x/doc/Library.py b/source/blender/python/api2_2x/doc/Library.py
deleted file mode 100644
index c99739d939b..00000000000
--- a/source/blender/python/api2_2x/doc/Library.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# Blender.Library submodule
-
-"""
-The Blender.Library submodule.
-
-Library
-=======
-
-This module provides access to objects stored in .blend files. With it scripts
-can append from Blender files to the current scene, like the File->Append
-menu entry in Blender does. It allows programmers to use .blend files as
-data files for their scripts.
-
-@warn: This module is being considered for deprecation. Users should
-consider using the L{new Library<LibData>} module and stay tuned to see
-which module is supported in the end.
-
-Example::
- import Blender
- from Blender import Library
-
- def f(name):
- open_library(name)
-
- def open_library(name):
- Library.Open(name)
- groups = Library.LinkableGroups()
-
- for db in groups:
- print "DATABLOCK %s:" % db
- for obname in Library.Datablocks(db):
- print obname
-
- if 'Object' in groups:
- for obname in Library.Datablocks('Object'):
- Library.Load(obname, 'Object', 0) # note the 0...
- Library.Update()
-
- Library.Close()
- b.Redraw()
-
- b.Window.FileSelector(f, "Choose Library", "*.blend")
-
-"""
-
-def Open (filename):
- """
- Open an existing .blend file. If there was already one open file, it is
- closed first.
- @type filename: string
- @param filename: The filename of a Blender file. Filenames starting with "//" will be loaded relative to the blend file's location.
- @rtype: bool
- @return: 1 if successful. An IOError exception is thrown if the file cannot be opened.
- """
-
-def Close ():
- """
- Close the currently open library file, if any.
- """
-
-def getName ():
- """
- Get the filename of the currently open library file.
- @rtype: string
- @return: The open library filename.
- """
-
-def LinkableGroups ():
- """
- Get all the linkable group names from the currently open library file. These
- are the available groups for linking with the current scene. Ex: 'Object',
- 'Mesh', 'Material', 'Text', etc.
- @rtype: list of strings
- @return: the list of linkable groups.
- """
-
-def Datablocks (group):
- """
- Get all datablock objects of the given 'group' available in the currently
- open library file.
- @type group: string
- @param group: datablock group, see L{LinkableGroups}.
- """
-
-def Load (datablock, group, update = 1, linked = 0):
- """
- Load the given datablock object from the current library file
- @type datablock: string
- @type group: string
- @type update: bool
- @type linked: bool
- @param datablock: an available object name, as returned by L{Datablocks}.
- @param group: an available group name, as returned by L{LinkableGroups}.
- @param update: defines if Blender should be updated after loading this
- object. This means linking all objects and remaking all display lists,
- so it is potentially very slow.
- @param linked: Will keep objects linked to their source blend file, the update option or later updating will unlink the data from the original blend and make it local.
-
- @warn: If you plan to load more than one object in sequence, it is
- B{definitely recommended} to set 'update' to 0 in all calls to this
- function and after them call L{Update}.
- """
-
-def Update ():
- """
- Update all links and display lists in Blender. This function should be
- called after a series of L{Load}(datablock, group, B{0}) calls to make
- everything behave nicely.
- @warn: to use this function, remember to set the third L{Load} parameter to
- zero or each loading will automatically update Blender, which will slow
- down your script and make you look like a lousy programmer.
- Enough warnings :)?
- """
-
diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py
deleted file mode 100644
index b37fd660810..00000000000
--- a/source/blender/python/api2_2x/doc/Material.py
+++ /dev/null
@@ -1,1149 +0,0 @@
-# Blender.Material module and the Material PyObject
-
-"""
-The Blender.Material submodule.
-
-B{New}: access to shader data.
-
-Material
-========
-
-This module provides access to B{Material} objects in Blender.
-
-Example::
- import Blender
- from Blender import Material
- mat = Material.New('newMat') # create a new Material called 'newMat'
- print mat.rgbCol # print its rgb color triplet sequence
- mat.rgbCol = [0.8, 0.2, 0.2] # change its color
- mat.setAlpha(0.2) # mat.alpha = 0.2 -- almost transparent
- mat.emit = 0.7 # equivalent to mat.setEmit(0.8)
- mat.mode |= Material.Modes.ZTRANSP # turn on Z-Buffer transparency
- mat.setName('RedBansheeSkin') # change its name
- mat.setAdd(0.8) # make it glow
- mat.setMode('Halo') # turn 'Halo' "on" and all others "off"
-
-@type Modes: readonly dictionary
-@var Modes: The available Material Modes.
-
- B{Note}: Some Modes are only available when the 'Halo' mode is I{off} and
- others only when it is I{on}. But these two subsets of modes share the same
- numerical values in their Blender C #defines. So, for example, if 'Halo' is
- on, then 'NoMist' is actually interpreted as 'HaloShaded'. We marked all
- such possibilities in the Modes dict below: each halo-related mode that
- uses an already taken value is preceded by "+" and appear below the normal
- mode which also uses that value.
-
- - TRACEABLE - Make Material visible for shadow lamps.
- - SHADOW - Enable Material for shadows.
- - SHADOWBUF - Enable Material to cast shadows with shadow buffers.
- - SHADELESS - Make Material insensitive to light or shadow.
- - WIRE - Render only the edges of faces.
- - VCOL_LIGHT - Add vertex colors as extra light.
- - VCOL_PAINT - Replace basic colors with vertex colors.
- - HALO - Render as a halo.
- - ZTRANSP - Z-buffer transparent faces.
- - ZINVERT - Render with inverted Z-buffer.
- - + HALORINGS - Render rings over the basic halo.
- - ENV - Do not render Material.
- - + HALOLINES - Render star shaped lines over the basic halo.
- - ONLYSHADOW - Let alpha be determined on the degree of shadow.
- - + HALOXALPHA - Use extreme alpha.
- - TEXFACE - UV-Editor assigned texture gives color and texture info for faces.
- - TEXFACE_ALPHA - When TEXFACE is enabled, use the alpha as well.
- - + HALOSTAR - Render halo as a star.
- - NOMIST - Set the Material insensitive to mist.
- - + HALOSHADED - Let halo receive light.
- - HALOTEX - Give halo a texture.
- - HALOPUNO - Use the vertex normal to specify the dimension of the halo.
- - HALOFLARE - Render halo as a lens flare.
- - RAYMIRROR - Enables raytracing for mirror reflection rendering.
- - RAYTRANSP - Enables raytracing for transparency rendering.
- - RAYBIAS - Prevent ray traced shadow errors with Phong interpolated normals.
- - RAMPCOL - Status of colorband ramp for Material's diffuse color. This is a read-only bit.
- - RAMPSPEC - Status of colorband ramp for Material's specular color. This is a read-only bit.
- - TANGENTSTR - Uses direction of strands as normal for tangent-shading.
- - TRANSPSHADOW - Lets Material receive transparent shadows based on material color and alpha.
- - FULLOSA - Force rendering of all OSA samples.
- - TANGENT_V - Use the tangent vector in V direction for shading
- - NMAP_TS - Tangent space normal mapping.
- - GROUP_EXCLUSIVE - Light from this group even if the lights are on a hidden Layer.
-
-@type Shaders: readonly dictionary
-@var Shaders: The available Material Shaders.
- - DIFFUSE_LAMBERT - Make Material use the lambert diffuse shader.
- - DIFFUSE_ORENNAYAR - Make Material use the Oren-Nayer diffuse shader.
- - DIFFUSE_TOON - Make Material use the toon diffuse shader.
- - DIFFUSE_MINNAERT - Make Material use the minnaert diffuse shader.
- - SPEC_COOKTORR - Make Material use the Cook-Torr specular shader.
- - SPEC_PHONG - Make Material use the Phong specular shader.
- - SPEC_BLINN - Make Material use the Blinn specular shader.
- - SPEC_TOON - Make Material use the toon specular shader.
- - SPEC_WARDISO - Make Material use the Ward-iso specular shader.
-
-@type ColorbandMethod: readonly dictionary
-@var ColorbandMethod: The available Colorband mixing methods.
- - ADD - Make Material use the Add method.
- - BLEND - Make Material use the Blend/Mix method.
- - BURN - Make Material use the Burn method.
- - COLOR - Make Material use the Color method.
- - DARK - Make Material use the Darken method.
- - DIFF - Make Material use the Difference method.
- - DIV - Make Material use the Divide method.
- - DODGE - Make Material use the Dodge method.
- - HUE - Make Material use the Hue method.
- - LIGHT - Make Material use the Lighten method.
- - MIX - Make Material use the Blend/Mix method.
- - MULT - Make Material use the Multiply method.
- - OVERLAY - Make Material use the Overlay method.
- - SAT - Make Material use the Saturation method.
- - SCREEN - Make Material use the Screen method.
- - SUB - Make Material use the Substract method.
- - VAL - Make Material use the Value method.
-
-@type ColorbandInput: readonly dictionary
-@var ColorbandInput: The available Colorband Input sources.
- - ENERGY - Make Material use the Energy input.
- - NORMAL - Make Material use the Normal input.
- - RESULT - Make Material use the Result input.
- - SHADER - Make Material use the Shader input.
-
-
-"""
-
-def New (name = 'Mat'):
- """
- Create a new Material object.
- @type name: string
- @param name: The Material name.
- @rtype: Blender Material
- @return: The created Material object.
- """
-
-def Get (name = None):
- """
- Get the Material object(s) from Blender.
- @type name: string
- @param name: The name of the Material.
- @rtype: Blender Material or a list of Blender Materials
- @return: It depends on the 'name' parameter:
- - (name): The Material object with the given name;
- - (): A list with all Material objects in the current scene.
- """
-
-class Material:
- """
- The Material object
- ===================
- This object gives access to Materials in Blender.
- @ivar B: Diffuse color (L{rgbCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type B: float
- @ivar G: Diffuse color (L{rgbCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type G: float
- @ivar IOR: Angular index of refraction for raytrace.
- Value is clamped to the range [1.0,3.0].
- @type IOR: float
- @ivar R: Diffuse color (L{rgbCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type R: float
- @ivar add: Strength of the add effect.
- Value is clamped to the range [0.0,1.0].
- @type add: float
- @ivar alpha: Alpha (translucency) component of the material.
- Value is clamped to the range [0.0,1.0].
- @type alpha: float
- @ivar shadAlpha: Shadow Alpha for irregular shadow buffer.
- Value is clamped to the range [0.0,1.0].
- @type shadAlpha: float
- @ivar amb: Amount of global ambient color material receives.
- Value is clamped to the range [0.0,1.0].
- @type amb: float
- @ivar diffuseDarkness: Material's diffuse darkness ("Minnaert" diffuse shader only).
- Value is clamped to the range [0.0,2.0].
- @type diffuseDarkness: float
- @ivar diffuseShader: Diffuse shader type (see L{Shaders}).
- Value must be in the range [0,3].
- @type diffuseShader: int
- @ivar diffuseSize: Material's diffuse area size ("Toon" diffuse shader only).
- Value is clamped to the range [0.0,3.14].
- @type diffuseSize: float
- @ivar diffuseSmooth: Material's diffuse area smoothing ("Toon" diffuse shader only).
- Value is clamped to the range [0.0,1.0].
- @type diffuseSmooth: float
- @ivar emit: Amount of light the material emits.
- Value is clamped to the range [0.0,1.0].
- @type emit: float
- @ivar filter: Amount of filtering when transparent raytrace is enabled.
- Value is clamped to the range [0.0,1.0].
- @type filter: float
- @ivar flareBoost: Flare's extra strength.
- Value is clamped to the range [0.1,1.0].
- @type flareBoost: float
- @ivar flareSeed: Offset in the flare seed table.
- Value is clamped to the range [1,255].
- @type flareSeed: int
- @ivar flareSize: Ratio of flare size to halo size.
- Value is clamped to the range [0.1,25.0].
- @type flareSize: float
- @ivar fresnelDepth: Power of Fresnel for mirror reflection.
- Value is clamped to the range [0.0,5.0].
- @type fresnelDepth: float
- @ivar fresnelDepthFac: Blending factor for Fresnel mirror.
- Value is clamped to the range [1.0,5.0].
- @type fresnelDepthFac: float
- @ivar fresnelTrans: Power of Fresnel for transparency.
- Value is clamped to the range [0.0,5.0].
- @type fresnelTrans: float
- @ivar fresnelTransFac: Blending factor for Fresnel transparency.
- Value is clamped to the range [1.0,5.0].
- @type fresnelTransFac: float
- @ivar rbFriction: Rigid Body Friction coefficient.
- Value is clamped to the range [0.0,100.0].
- @type rbFriction: float
- @ivar rbRestitution: Rigid Body Friction restitution.
- Value is clamped to the range [0.0,1.0].
- @type rbRestitution: float
- @ivar haloSeed: Randomizes halo ring dimension and line location.
- Value is clamped to the range [1,255].
- @type haloSeed: int
- @ivar haloSize: Dimension of the halo.
- Value is clamped to the range [0.0,100.0].
- @type haloSize: float
- @ivar hard: Hardness of the specularity.
- Value is clamped to the range [1,511].
- @type hard: int
- @ivar ipo: Material Ipo data.
- Contains the Ipo if one is assigned to the object, None otherwise. Setting to None clears the current Ipo.
- @type ipo: Blender Ipo
-
- @ivar mirCol: Mirror RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type mirCol: list of 3 floats
- @ivar mirB: Mirror color (L{mirCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type mirB: float
- @ivar mirG: Mirror color (L{mirCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type mirG: float
- @ivar mirR: Mirror color (L{mirCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type mirR: float
-
- @ivar sssCol: SubSsurface scattering RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type sssCol: list of 3 floats
- @ivar sssB: SubSsurface scattering color (L{sssCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type sssB: float
- @ivar sssG: SubSsurface scattering color (L{sssCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type sssG: float
- @ivar sssR: SubSsurface scattering color (L{sssCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type sssR: float
-
- @ivar mode: Mode mode bitfield. See L{the Modes dictionary<Modes>} keys and descriptions.
- @type mode: int
- @ivar nFlares: Number of subflares with halo.
- Value is clamped to the range [1,32].
- @type nFlares: int
- @ivar nLines: Number of star-shaped lines with halo.
- Value is clamped to the range [0,250].
- @type nLines: int
- @ivar nRings: Number of rings with halo.
- Value is clamped to the range [0,24].
- @type nRings: int
- @ivar nStars: Number of star points with halo.
- Value is clamped to the range [3,50].
- @type nStars: int
- @ivar oopsLoc: Material OOPs location. Returns None if material not found in list.
- @type oopsLoc: list of 2 floats
- @ivar oopsSel: Material OOPs selection flag.
- Value must be in the range [0,1].
- @type oopsSel: int
- @ivar rayMirr: Mirror reflection amount for raytrace.
- Value is clamped to the range [0.0,1.0].
- @type rayMirr: float
- @ivar glossMir: Amount of reflection glossy.
- Value is clamped to the range [0.0,1.0].
- @type glossMir: float
- @ivar sampGloss_mir: Reflection glossy samples.
- Value is clamped to the range [1,1024].
- @type sampGloss_mir: int
- @ivar glossTra: Amount of refraction glossy.
- Value is clamped to the range [0.0,1.0].
- @type glossTra: float
- @ivar sampGlossTra: Refraction glossy samples.
- Value is clamped to the range [1,1024].
- @type sampGlossTra: int
- @ivar rayMirrDepth: Amount of raytrace inter-reflections.
- Value is clamped to the range [0,10].
- @type rayMirrDepth: int
- @ivar ref: Amount of reflections (for shader).
- Value is clamped to the range [0.0,1.0].
- @type ref: float
- @ivar refracIndex: Material's Index of Refraction (applies to the "Blinn" Specular Shader only.
- Value is clamped to the range [1.0,10.0].
- @type refracIndex: float
- @ivar rgbCol: Diffuse RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type rgbCol: list of 3 floats
- @ivar rms: Material's surface slope standard deviation ("WardIso" specular shader only).
- Value is clamped to the range [0.0,0.4].
- @type rms: float
- @ivar roughness: Material's roughness ("Oren Nayar" diffuse shader only).
- Value is clamped to the range [0.0,3.14].
- @type roughness: float
- @ivar spec: Degree of specularity.
- Value is clamped to the range [0.0,2.0].
- @type spec: float
- @ivar specB: Specular color (L{specCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type specB: float
- @ivar specCol: Specular RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type specCol: list of 3 floats
- @ivar specG: Specular color (L{specCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type specG: float
- @ivar specR: Specular color (L{specCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type specR: float
- @ivar specShader: Specular shader type. See L{Shaders}.
- Value must be in the range [0,4].
- @type specShader: int
- @ivar specSize: Material's specular area size ("Toon" specular shader only).
- Value is clamped to the range [0.0,1.53].
- @type specSize: float
- @ivar specSmooth: Sets the smoothness of specular toon area.
- Value is clamped to the range [0.0,1.0].
- @type specSmooth: float
- @ivar specTransp: Makes specular areas opaque on transparent materials.
- Value is clamped to the range [0.0,1.0].
- @type specTransp: float
- @ivar subSize: Dimension of subflares, dots and circles.
- Value is clamped to the range [0.1,25.0].
- @type subSize: float
- @ivar transDepth: calculated maximal. Amount of refractions for raytrace.
- Value is clamped to the range [0,10].
- @type transDepth: int
- @ivar translucency: Amount of diffuse shading of the back side.
- Value is clamped to the range [0.0,1.0].
- @type translucency: float
- @ivar zOffset: Artificial offset in the Z buffer (for Ztransp option).
- Value is clamped to the range [0.0,10.0].
- @type zOffset: float
- @ivar lightGroup: Limits lights that affect this material to a group.
- @type lightGroup: Group or None
- @ivar uvlayer: The uv layer name to use, when UV mapping is enabled.
- @type uvlayer: string
- @ivar colorband: Material colorband, a list of colors,
- each color a list of 5 floats [0 - 1], [r,g,b,a,pos].
- The colorband can have between 1 and 31 colors.
- @type colorband: list
-
- @ivar colorbandDiffuse: Material colorband, a list of colors,
- each color a list of 5 floats [0 - 1], [r,g,b,a,pos].
- The colorband can have between 1 and 31 colors.
- @type colorbandDiffuse: list
- @ivar colorbandSpecular: Material colorband, a list of colors,
- each color a list of 5 floats [0 - 1], [r,g,b,a,pos].
- The colorband can have between 1 and 31 colors.
- @type colorbandSpecular: list
- @ivar colorbandDiffuseInput: Material Diffuse colorband input.
- The integer result must be compared with L{ColorbandInput}
- dictionary.
- @type colorbandDiffuseInput: int
- @ivar colorbandDiffuseMethod: Material Diffuse colorband method.
- The integer result must be compared with L{ColorbandMethod}
- dictionary.
- @type colorbandDiffuseMethod: int
- @ivar colorbandDiffuseFactor: Material Diffuse colorband factor.
- Value is clamped to the range [0.0,1.0].
- @type colorbandDiffuseFactor: float
- @ivar colorbandSpecularInput: Material Specular colorband input.
- The integer result must be compared with L{ColorbandInput}
- dictionary.
- @type colorbandSpecularInput: int
- @ivar colorbandSpecularMethod: Material Specular colorband method.
- The integer result must be compared with L{ColorbandMethod}
- dictionary.
- @type colorbandSpecularMethod: int
- @ivar colorbandSpecularFactor: Material Specular colorband factor.
- Value is clamped to the range [0.0,1.0].
- @type colorbandSpecularFactor: float
- @type enabledTextures: list of integers
- @ivar enabledTextures: The texture channels enabled in this material.
- The attribute returns is list of integers in the range [0, 9], each
- number representing the respective enabled MTex entry (see
- L{getTextures()<getTextures>}). Enabling is done by assigning
- a list of ints or an empty list. Attempting to enable a channel
- which does not have a texture assigned to it will result in a
- ValueError exception.
- Example::
- mat.enabledTextures = [] # no texture channels are enabled
- mat.enabledTextures = [0, 6] # texture channels 0 and 6 are enabled
- ch = mat.enabledTextures
- ch.append(4)
- mat.enabledTextures = ch
- print mat.enabledTextures # will print: [0, 4, 6]
-
- @type textures: a tuple of Blender MTex objects.
- @ivar textures: the Material's Texture list. Empty texture channels contains None.
- @ivar enableSSS: If True, subsurface scattering will be rendered on this material.
- @type enableSSS: bool
- @ivar sssScale: If True, subsurface scattering will be rendered on this material.
- Value is clamped to the range [0.1,1000.0].
- @type sssScale: bool
- @ivar sssRadiusRed: Mean red scattering path length.
- Value is clamped to the range [0.0,10000.0].
- @type sssRadiusRed: float
- @ivar sssRadiusGreen: Mean green scattering path length.
- Value is clamped to the range [0.0,10000.0].
- @type sssRadiusGreen: float
- @ivar sssRadiusBlue: Mean blue scattering path length.
- Value is clamped to the range [0.0,10000.0].
- @type sssRadiusBlue: float
- @ivar sssIOR: Refraction index.
- Value is clamped to the range [0.1,2.0].
- @type sssIOR: float
- @ivar sssError: Error allowance for the calculation (a low value is slower).
- Value is clamped to the range [0.0,10.0].
- @type sssError: float
- @ivar sssColorBlend: Blend factor for SSS colors.
- Value is clamped to the range [0.0,1.0].
- @type sssColorBlend: float
- @ivar sssTextureScatter: Texture scattering factor.
- Value is clamped to the range [0.0,1.0].
- @type sssTextureScatter: float
- @ivar sssFront: Front scattering weight.
- Value is clamped to the range [0.0,2.0].
- @type sssFront: float
- @ivar sssBack: Back scattering weight
- Value is clamped to the range [0.0,10.0].
- @type sssBack: float
-
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
-
- """
-
- def getName():
- """
- Get the name of this Material object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Material object.
- @type name: string
- @param name: The new name.
- """
-
- def getIpo():
- """
- Get the Ipo associated with this material, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this material.
- @type ipo: Blender Ipo
- @param ipo: a material type ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this material.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in material ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -RGB
- -ALPHA
- -HALOSIZE
- -MODE
- -ALLCOLOR
- -ALLMIRROR
- -OFS
- -SIZE
- -ALLMAPPING
- @return: py_none
- """
-
- def getMode():
- """
- Get this Material's mode flags.
- @rtype: int
- @return: B{OR'ed value}. Use the Modes dictionary to check which flags
- are 'on'.
-
- Example::
- import Blender
- from Blender import Material
- flags = mymat.getMode()
- if flags & Material.Modes['HALO']:
- print "This material is rendered as a halo"
- else:
- print "Not a halo"
- """
-
- def setMode(param, stringN=None):
- """
- Set this Material's mode flags. Up to 22 mode strings can be given
- and specify the modes which are turned 'on'. Those not provided are
- turned 'off', so mat.setMode() -- without arguments -- turns off all
- mode flags for Material mat. Valid mode strings are "Traceable",
- "Shadow", "Shadeless", "Wire", "VColLight", "VColPaint", "Halo",
- "ZTransp", "ZInvert", "HaloRings", "HaloLines", "OnlyShadow",
- "HaloXAlpha", "HaloStar", "TexFace", "HaloTex", "HaloPuno", "NoMist",
- "HaloShaded", "HaloFlare", "Radio", "RayMirr", "ZTransp", "RayTransp",
- "Env"
-
- An integer can also be given, which directly sets the mode flag. The
- Modes dictionary keys can (and should) be added or ORed to specify
- which modes to turn 'on'. The value returned from getMode() can
- also be modified and input to this method.
-
- @type param: string, None or int
- @param param: A mode value (int) or flag (string). Can also be None.
- @type stringN: string
- @param stringN: A mode flag. Up to 22 flags can be set at the same time.
- """
-
- def getRGBCol():
- """
- Get the rgb color triplet sequence.
- @rtype: list of 3 floats
- @return: [r, g, b]
- """
-
- def setRGBCol(rgb = None):
- """
- Set the rgb color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setRGBCol ([r, g, b]) B{or}
- - three floats as separate parameters: setRGBCol (r,g,b).
- """
-
- def getSpecCol():
- """
- Get the specular color triplet sequence.
- @rtype: list of 3 floats
- @return: [specR, specG, specB]
- """
-
- def setSpecCol(rgb = None):
- """
- Set the specular color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setSpecCol ([r, g, b]) B{or}
- - three floats as separate parameters: setSpecCol (r,g,b).
- """
-
- def getMirCol():
- """
- Get the mirror color triplet sequence.
- @rtype: list of 3 floats
- @return: [mirR, mirG, mirb]
- """
-
- def setMirCol(rgb = None):
- """
- Set the mirror color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setMirCol ([r, g, b]) B{or}
- - three floats as separate parameters: setMirCol (r,g,b).
- """
-
- def getAlpha():
- """
- Get the alpha (transparency) value.
- @rtype: float
- """
-
- def setAlpha(alpha):
- """
- Set the alpha (transparency) value.
- @type alpha: float
- @param alpha: The new value in [0.0, 1.0].
- """
-
- def getAmb():
- """
- Get the ambient color blend factor.
- @rtype: float
- """
-
- def setAmb(amb):
- """
- Set the ambient color blend factor.
- @type amb: float
- @param amb: The new value in [0.0, 1.0].
- """
-
- def getEmit():
- """
- Get the emitting light intensity.
- @rtype: float
- """
-
- def setEmit(emit):
- """
- Set the emitting light intensity.
- @type emit: float
- @param emit: The new value in [0.0, 1.0].
- """
-
- def getRef():
- """
- Get the reflectivity value.
- @rtype: float
- """
-
- def setRef(ref):
- """
- Set the reflectivity value.
- @type ref: float
- @param ref: The new value in [0.0, 1.0].
- """
-
- def getSpec():
- """
- Get the specularity value.
- @rtype: float
- """
-
- def setSpec(spec):
- """
- Set the specularity value.
- @type spec: float
- @param spec: The new value in [0.0, 2.0].
- """
-
- def getSpecTransp():
- """
- Get the specular transparency.
- @rtype: float
- """
-
- def setSpecTransp(spectransp):
- """
- Set the specular transparency.
- @type spectransp: float
- @param spectransp: The new value in [0.0, 1.0].
- """
-
- def setSpecShader(specShader):
- """
- Set the material's specular shader from one of the shaders in Material.Shaders dict.
- @type specShader: int
- @param specShader: The new value in [0, 4].
- """
-
- def getSpecShader(specShader):
- """
- Get the material's specular shader from one of the shaders in Material.Shaders dict.
- @rtype: int
- """
-
- def setDiffuseShader(diffuseShader):
- """
- Set the material's diffuse shader from one of the shaders in Material.Shaders dict.
- @type diffuseShader: int
- @param diffuseShader: The new value in [0, 3].
- """
-
- def getDiffuseShader():
- """
- Get the material's diffuse shader from one of the shaders in Material.Shaders dict.
- @rtype: int
- """
-
- def setRoughness(roughness):
- """
- Set the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
- @type roughness: float
- @param roughness: The new value in [0.0, 3.14].
- """
-
- def getRoughness():
- """
- Get the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
- @rtype: float
- """
-
- def setSpecSize(specSize):
- """
- Set the material's size of specular area (applies to the \"Toon\" Specular Shader only)
- @type specSize: float
- @param specSize: The new value in [0.0, 1.53].
- """
-
- def getSpecSize():
- """
- Get the material's size of specular area (applies to the \"Toon\" Specular Shader only)
- @rtype specSize: float
- """
-
- def setSpecSize(diffuseSize):
- """
- Set the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @type diffuseSize: float
- @param diffuseSize: The new value in [0.0, 3.14].
- """
-
- def getSpecSize():
- """
- Get the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @rtype: float
- """
-
- def setSpecSmooth(specSmooth):
- """
- Set the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
- @type specSmooth: float
- @param specSmooth: The new value in [0.0, 1.0].
- """
-
- def getSpecSmooth():
- """
- Get the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
- @rtype: float
- """
-
- def setDiffuseSmooth(diffuseSmooth):
- """
- Set the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @type diffuseSmooth: float
- @param diffuseSmooth: The new value in [0.0, 1.0].
- """
-
- def getDiffuseSmooth():
- """
- Get the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @rtype: float
- """
-
- def setDiffuseDarkness(diffuseDarkness):
- """
- Set the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
- @type diffuseDarkness: float
- @param diffuseDarkness: The new value in [0.0, 2.0].
- """
-
- def getDiffuseDarkness():
- """
- Get the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
- @rtype: float
- """
-
- def setRefracIndex(refracIndex):
- """
- Set the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
- @type refracIndex: float
- @param refracIndex: The new value in [1.0, 10.0].
- """
-
- def getRefracIndex():
- """
- Get the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
- @rtype: float
- """
-
- def setRms(rms):
- """
- Set the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
- @type rms: float
- @param rms: The new value in [0.0, 0.4].
- """
-
- def getRms():
- """
- Get the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
- @rtype: float
- """
-
- def setFilter(filter):
- """
- Set the material's amount of filtering when transparent raytrace is enabled
- @type filter: float
- @param filter: The new value in [0.0, 1.0].
- """
-
- def getFilter():
- """
- Get the material's amount of filtering when transparent raytrace is enabled
- @rtype: float
- """
-
- def setTranslucency(translucency):
- """
- Set the material's amount of diffuse shading of the back side
- @type translucency: float
- @param translucency: The new value in [0.0, 1.0].
- """
-
- def getTranslucency():
- """
- Get the material's amount of diffuse shading of the back side
- @rtype: float
- """
-
- def getAdd():
- """
- Get the glow factor.
- @rtype: float
- """
-
- def setAdd(add):
- """
- Set the glow factor.
- @type add: float
- @param add: The new value in [0.0, 1.0].
- """
-
- def getZOffset():
- """
- Get the artificial offset for faces with this Material.
- @rtype: float
- """
-
- def setZOffset(zoffset):
- """
- Set the artificial offset for faces with this Material.
- @type zoffset: float
- @param zoffset: The new value in [0.0, 10.0].
- """
-
- def getHaloSize():
- """
- Get the halo size.
- @rtype: float
- """
-
- def setHaloSize(halosize):
- """
- Set the halo size.
- @type halosize: float
- @param halosize: The new value in [0.0, 100.0].
- """
-
- def getHaloSeed():
- """
- Get the seed for random ring dimension and line location in halos.
- @rtype: int
- """
-
- def setHaloSeed(haloseed):
- """
- Set the seed for random ring dimension and line location in halos.
- @type haloseed: int
- @param haloseed: The new value in [0, 255].
- """
-
- def getFlareSize():
- """
- Get the ratio: flareSize / haloSize.
- @rtype: float
- """
-
- def setFlareSize(flaresize):
- """
- Set the ratio: flareSize / haloSize.
- @type flaresize: float
- @param flaresize: The new value in [0.1, 25.0].
- """
-
- def getFlareSeed():
- """
- Get flare's offset in the seed table.
- @rtype: int
- """
-
- def setFlareSeed(flareseed):
- """
- Set flare's offset in the seed table.
- @type flareseed: int
- @param flareseed: The new value in [0, 255].
- """
-
- def getFlareBoost():
- """
- Get the flare's extra strength.
- @rtype: float
- """
-
- def setFlareBoost(flareboost):
- """
- Set the flare's extra strength.
- @type flareboost: float
- @param flareboost: The new value in [0.1, 10.0].
- """
-
- def getSubSize():
- """
- Get the dimension of subflare, dots and circles.
- @rtype: float
- """
-
- def setSubSize(subsize):
- """
- Set the dimension of subflare, dots and circles.
- @type subsize: float
- @param subsize: The new value in [0.1, 25.0].
- """
-
- def getHardness():
- """
- Get the hardness of the specularity.
- @rtype: int
- """
-
- def setHardness(hardness):
- """
- Set the hardness of the specularity.
- @type hardness: int
- @param hardness: The new value in [1, 511].
- """
-
- def getNFlares():
- """
- Get the number of halo subflares.
- @rtype: int
- """
-
- def setNFlares(nflares):
- """
- Set the number of halo subflares.
- @type nflares: int
- @param nflares: The new value in [1, 32].
- """
-
- def getNStars():
- """
- Get the number of points in the halo stars.
- @rtype: int
- """
-
- def setNStars(nstars):
- """
- Set the number of points in the halo stars.
- @type nstars: int
- @param nstars: The new value in [3, 50].
- """
-
- def getNLines():
- """
- Get the number of star shaped lines on each halo.
- @rtype: int
- """
-
- def setNLines(nlines):
- """
- Set the number of star shaped lines on each halo.
- @type nlines: int
- @param nlines: The new value in [0, 250].
- """
-
- def getNRings():
- """
- Get the number of rings on each halo.
- @rtype: int
- """
-
- def setNRings(nrings):
- """
- Set the number of rings on each halo.
- @type nrings: int
- @param nrings: The new value in [0, 24].
- """
-
- def getRayMirr():
- """
- Get amount mirror reflection for raytrace.
- @rtype: float
- """
-
- def setRayMirr(nrmirr):
- """
- Set amount mirror reflection for raytrace.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getRayMirrDepth():
- """
- Get amount of inter-reflections calculated maximal.
- @rtype: int
- """
-
- def setRayMirrDepth(nrmirr):
- """
- Set amount mirror reflection for raytrace.
- @type nrmirr: int
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelMirr():
- """
- Get power of Fresnel for mirror reflection.
- @rtype: float
- """
-
- def setFresnelMirr(nrmirr):
- """
- Set power of Fresnel for mirror reflection.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelMirrFac():
- """
- Get the number of Ray Mirror.
- @rtype: float
- """
-
- def setFresnelMirrFac(nrmirr):
- """
- Set the number of ray mirror
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getIOR():
- """
- Get the angular index of refraction for raytrace.
- @rtype: float
- """
-
- def setIOR(nrmirr):
- """
- Set the angular index of refraction for raytrace.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getTransDepth():
- """
- Get amount of refractions calculated maximal.
- @rtype: int
- """
-
- def setTransDepth(nrmirr):
- """
- Set amount of refractions calculated maximal.
- @type nrmirr: int
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelTrans():
- """
- Get power of Fresnel for transparency.
- @rtype: float
- """
-
- def setFresnelTrans(nrmirr):
- """
- Set power of Fresnel for transparency.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelTransFac():
- """
- Get blending factor for Fresnel.
- @rtype: float
- """
-
- def setFresnelTransFac(nrmirr):
- """
- Set blending factor for Fresnel.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def setTexture(index, texture, texco, mapto):
- """
- Assign a Blender Texture object to channel number 'number'.
- @type index: int
- @param index: material's texture index in [0, 9].
- @type texture: Blender Texture
- @param texture: a Blender Texture object.
- @type texco: int
- @param texco: optional ORed bitflag -- defaults to TexCo.ORCO. See TexCo var in L{Texture}.
- @type mapto: int
- @param mapto: optional ORed bitflag -- defaults to MapTo.COL. See MapTo var in L{Texture}.
- """
-
- def clearTexture(index):
- """
- Clear the ith (given by 'index') texture channel of this material.
- @type index: int
- @param index: material's texture channel index in [0, 9].
- """
-
- def getTextures ():
- """
- Get this Material's Texture list.
- @rtype: list of MTex
- @return: a list of Blender MTex objects. None is returned for each empty
- texture channel.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Material's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged" or "Redraw".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Material. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Material.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged" or "Redraw".
- """
-
- def __copy__ ():
- """
- Make a copy of this material
- @rtype: Material
- @return: a copy of this material
- """
-
- def freeNodes ():
- """
- Removes the node tree from this material.
- @rtype: bool
- @return: true if nodes were freed from this material.
- """
-
-import id_generics
-Material.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py
deleted file mode 100644
index 524d1fb6d4c..00000000000
--- a/source/blender/python/api2_2x/doc/Mathutils.py
+++ /dev/null
@@ -1,873 +0,0 @@
-# Blender.Mathutils module and its subtypes
-
-"""
-The Blender.Mathutils submodule.
-
-Mathutils
-=========
-
-This module provides access to matrices, eulers, quaternions and vectors.
-
-Example::
- import Blender
- from Blender import Mathutils
- from Blender.Mathutils import *
-
- vec = Vector([1,2,3])
- mat = RotationMatrix(90, 4, 'x')
- matT = TranslationMatrix(vec)
-
- matTotal = mat * matT
- matTotal.invert()
-
- mat3 = matTotal.rotationPart
- quat1 = mat.toQuat()
- quat2 = mat3.toQuat()
-
- angle = DifferenceQuats(quat1, quat2)
- print angle
-"""
-
-def Rand (low=0.0, high = 1.0):
- """
- Return a random number within a range.
- low and high represent are optional parameters which represent the range
- from which the random number must return its result.
- @type low: float
- @param low: The lower range.
- @type high: float
- @param high: The upper range.
- """
-
-def Intersect(vec1, vec2, vec3, ray, orig, clip=1):
- """
- Return the intersection between a ray and a triangle, if possible, return None otherwise.
- @type vec1: Vector object.
- @param vec1: A 3d vector, one corner of the triangle.
- @type vec2: Vector object.
- @param vec2: A 3d vector, one corner of the triangle.
- @type vec3: Vector object.
- @param vec3: A 3d vector, one corner of the triangle.
- @type ray: Vector object.
- @param ray: A 3d vector, the orientation of the ray. the length of the ray is not used, only the direction.
- @type orig: Vector object.
- @param orig: A 3d vector, the origin of the ray.
- @type clip: integer
- @param clip: if 0, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
- @rtype: Vector object
- @return: The intersection between a ray and a triangle, if possible, None otherwise.
- """
-
-def TriangleArea(vec1, vec2, vec3):
- """
- Return the area size of the 2D or 3D triangle defined.
- @type vec1: Vector object.
- @param vec1: A 2d or 3d vector, one corner of the triangle.
- @type vec2: Vector object.
- @param vec2: A 2d or 3d vector, one corner of the triangle.
- @type vec3: Vector object.
- @param vec3: A 2d or 3d vector, one corner of the triangle.
- @rtype: float
- @return: The area size of the 2D or 3D triangle defined.
- """
-
-def TriangleNormal(vec1, vec2, vec3):
- """
- Return the normal of the 3D triangle defined.
- @type vec1: Vector object.
- @param vec1: A 3d vector, one corner of the triangle.
- @type vec2: Vector object.
- @param vec2: A 3d vector, one corner of the triangle.
- @type vec3: Vector object.
- @param vec3: A 3d vector, one corner of the triangle.
- @rtype: float
- @return: The normal of the 3D triangle defined.
- """
-
-def QuadNormal(vec1, vec2, vec3, vec4):
- """
- Return the normal of the 3D quad defined.
- @type vec1: Vector object.
- @param vec1: A 3d vector, the first vertex of the quad.
- @type vec2: Vector object.
- @param vec2: A 3d vector, the second vertex of the quad.
- @type vec3: Vector object.
- @param vec3: A 3d vector, the third vertex of the quad.
- @type vec4: Vector object.
- @param vec4: A 3d vector, the fourth vertex of the quad.
- @rtype: float
- @return: The normal of the 3D quad defined.
- """
-
-def LineIntersect(vec1, vec2, vec3, vec4):
- """
- Return a tuple with the points on each line respectively closest to the other
- (when both lines intersect, both vector hold the same value).
- The lines are evaluated as infinite lines in space, the values returned may not be between the 2 points given for each line.
- @type vec1: Vector object.
- @param vec1: A 3d vector, one point on the first line.
- @type vec2: Vector object.
- @param vec2: A 3d vector, another point on the first line.
- @type vec3: Vector object.
- @param vec3: A 3d vector, one point on the second line.
- @type vec4: Vector object.
- @param vec4: A 3d vector, another point on the second line.
- @rtype: (Vector object, Vector object)
- @return: A tuple with the points on each line respectively closest to the other.
- """
-
-def CopyVec(vector):
- """
- Create a copy of the Vector object.
- @attention: B{DEPRECATED} use vector.copy() instead.
- @type vector: Vector object.
- @param vector: A 2d,3d or 4d vector to be copied.
- @rtype: Vector object.
- @return: A new vector object which is a copy of the one passed in.
- """
-
-def CrossVecs(vec1, vec2):
- """
- Return the cross product of two vectors.
- @type vec1: Vector object.
- @param vec1: A 3d vector.
- @type vec2: Vector object.
- @param vec2: A 3d vector.
- @rtype: Vector object.
- @return: A new vector representing the cross product of
- the two vectors.
- """
-
-def DotVecs(vec1, vec2):
- """
- Return the dot product of two vectors.
- @type vec1: Vector object.
- @param vec1: A 2d,3d or 4d vector.
- @type vec2: Vector object.
- @param vec2: A 2d,3d or 4d vector.
- @rtype: float
- @return: Return the scalar product of vector muliplication.
- """
-
-def AngleBetweenVecs(vec1, vec2):
- """
- Return the angle between two vectors. Zero length vectors raise an error.
- @type vec1: Vector object.
- @param vec1: A 2d or 3d vector.
- @type vec2: Vector object.
- @param vec2: A 2d or 3d vector.
- @rtype: float
- @return: The angle between the vectors in degrees.
- @raise AttributeError: When there is a zero-length vector as an argument.
- """
-
-def MidpointVecs(vec1, vec2):
- """
- Return a vector to the midpoint between two vectors.
- @type vec1: Vector object.
- @param vec1: A 2d,3d or 4d vector.
- @type vec2: Vector object.
- @param vec2: A 2d,3d or 4d vector.
- @rtype: Vector object
- @return: The vector to the midpoint.
- """
-
-def VecMultMat(vec, mat):
- """
- Multiply a vector and matrix (pre-multiply)
- Vector size and matrix column size must equal.
- @type vec: Vector object.
- @param vec: A 2d,3d or 4d vector.
- @type mat: Matrix object.
- @param mat: A 2d,3d or 4d matrix.
- @rtype: Vector object
- @return: The row vector that results from the muliplication.
- @attention: B{DEPRECATED} You should now multiply vector * matrix direcly
- Example::
- result = myVector * myMatrix
- """
-
-def ProjectVecs(vec1, vec2):
- """
- Return the projection of vec1 onto vec2.
- @type vec1: Vector object.
- @param vec1: A 2d,3d or 4d vector.
- @type vec2: Vector object.
- @param vec2: A 2d,3d or 4d vector.
- @rtype: Vector object
- @return: The parallel projection vector.
- """
-
-def RotationMatrix(angle, matSize, axisFlag, axis):
- """
- Create a matrix representing a rotation.
- @type angle: float
- @param angle: The angle of rotation desired.
- @type matSize: int
- @param matSize: The size of the rotation matrix to construct.
- Can be 2d, 3d, or 4d.
- @type axisFlag: string (optional)
- @param axisFlag: Possible values:
- - "x - x-axis rotation"
- - "y - y-axis rotation"
- - "z - z-axis rotation"
- - "r - arbitrary rotation around vector"
- @type axis: Vector object. (optional)
- @param axis: The arbitrary axis of rotation used with "R"
- @rtype: Matrix object.
- @return: A new rotation matrix.
- """
-
-def TranslationMatrix(vector):
- """
- Create a matrix representing a translation
- @type vector: Vector object
- @param vector: The translation vector
- @rtype: Matrix object.
- @return: An identity matrix with a translation.
- """
-
-def ScaleMatrix(factor, matSize, axis):
- """
- Create a matrix representing a scaling.
- @type factor: float
- @param factor: The factor of scaling to apply.
- @type matSize: int
- @param matSize: The size of the scale matrix to construct.
- Can be 2d, 3d, or 4d.
- @type axis: Vector object. (optional)
- @param axis: Direction to influence scale.
- @rtype: Matrix object.
- @return: A new scale matrix.
- """
-
-def OrthoProjectionMatrix(plane, matSize, axis):
- """
- Create a matrix to represent an orthographic projection
- @type plane: string
- @param plane: Can be any of the following:
- - "x - x projection (2D)"
- - "y - y projection (2D)"
- - "xy - xy projection"
- - "xz - xz projection"
- - "yz - yz projection"
- - "r - arbitrary projection plane"
- @type matSize: int
- @param matSize: The size of the projection matrix to construct.
- Can be 2d, 3d, or 4d.
- @type axis: Vector object. (optional)
- @param axis: Arbitrary perpendicular plane vector.
- @rtype: Matrix object.
- @return: A new projeciton matrix.
- """
-
-def ShearMatrix(plane, factor, matSize):
- """
- Create a matrix to represent an orthographic projection
- @type plane: string
- @param plane: Can be any of the following:
- - "x - x shear (2D)"
- - "y - y shear (2D)"
- - "xy - xy shear"
- - "xz - xz shear"
- - "yz - yz shear"
- @type factor: float
- @param factor: The factor of shear to apply.
- @type matSize: int
- @param matSize: The size of the projection matrix to construct.
- Can be 2d, 3d, or 4d.
- @rtype: Matrix object.
- @return: A new shear matrix.
- """
-
-def CopyMat(matrix):
- """
- Create a copy of the Matrix object.
- @type matrix: Matrix object.
- @param matrix: A 2d,3d or 4d matrix to be copied.
- @rtype: Matrix object.
- @return: A new matrix object which is a copy of the one passed in.
- @attention: B{DEPRECATED} Use the matrix copy funtion to make a copy.
- Example::
- newMat = myMat.copy()
- """
-
-def MatMultVec(mat, vec):
- """
- Multiply a matrix and a vector (post-multiply)
- Vector size and matrix row size must equal.
- @type vec: Vector object.
- @param vec: A 2d,3d or 4d vector.
- @type mat: Matrix object.
- @param mat: A 2d,3d or 4d matrix.
- @rtype: Vector object
- @return: The column vector that results from the muliplication.
- @attention: B{DEPRECATED} You should use direct muliplication on the arguments
- Example::
- result = myMatrix * myVector
- """
-
-def CopyQuat(quaternion):
- """
- Create a copy of the Quaternion object.
- @type quaternion: Quaternion object.
- @param quaternion: Quaternion to be copied.
- @rtype: Quaternion object.
- @return: A new quaternion object which is a copy of the one passed in.
- @attention: B{DEPRECATED} You should use the Quaterion() constructor directly
- to create copies of quaternions
- Example::
- newQuat = Quaternion(myQuat)
- """
-
-def CrossQuats(quat1, quat2):
- """
- Return the cross product of two quaternions.
- @type quat1: Quaternion object.
- @param quat1: Quaternion.
- @type quat2: Quaternion object.
- @param quat2: Quaternion.
- @rtype: Quaternion object.
- @return: A new quaternion representing the cross product of
- the two quaternions.
- """
-
-def DotQuats(quat1, quat2):
- """
- Return the dot product of two quaternions.
- @type quat1: Quaternion object.
- @param quat1: Quaternion.
- @type quat2: Quaternion object.
- @param quat2: Quaternion.
- @rtype: float
- @return: Return the scalar product of quaternion muliplication.
- """
-
-def DifferenceQuats(quat1, quat2):
- """
- Returns a quaternion represting the rotational difference.
- @type quat1: Quaternion object.
- @param quat1: Quaternion.
- @type quat2: Quaternion object.
- @param quat2: Quaternion.
- @rtype: Quaternion object
- @return: Return a quaternion which which represents the rotational
- difference between the two quat rotations.
- """
-
-def Slerp(quat1, quat2, factor):
- """
- Returns the interpolation of two quaternions.
- @type quat1: Quaternion object.
- @param quat1: Quaternion.
- @type quat2: Quaternion object.
- @param quat2: Quaternion.
- @type factor: float
- @param factor: The interpolation value
- @rtype: Quaternion object
- @return: The interpolated rotation.
- """
-
-def CopyEuler(euler):
- """
- Create a new euler object.
- @type euler: Euler object
- @param euler: The euler to copy
- @rtype: Euler object
- @return: A copy of the euler object passed in.
- @attention: B{DEPRECATED} You should use the Euler constructor directly
- to make copies of Euler objects
- Example::
- newEuler = Euler(myEuler)
- """
-
-def RotateEuler(euler, angle, axis):
- """
- Roatate a euler by an amount in degrees around an axis.
- @type euler: Euler object
- @param euler: Euler to rotate.
- @type angle: float
- @param angle: The amount of rotation in degrees
- @type axis: string
- @param axis: axis to rotate around:
- - "x"
- - "y"
- - "z"
- """
-
-class Vector:
- """
- The Vector object
- =================
- This object gives access to Vectors in Blender.
- @ivar x: The x value.
- @ivar y: The y value.
- @ivar z: The z value (if any).
- @ivar w: The w value (if any).
- @ivar length: The magnitude of the vector.
- @ivar magnitude: This is a synonym for length.
- @ivar wrapped: Whether or not this item is wrapped data
- @note: Comparison operators can be done on Vector classes:
- - >, >=, <, <= test the vector magnitude
- - ==, != test vector values e.g. 1,2,3 != 1,2,4 even if they are the same length
- @note: Math can be performed on Vector classes
- - vec + vec
- - vec - vec
- - vec * float/int
- - vec * matrix
- - vec * vec
- - vec * quat
- - -vec
- @note: You can access a vector object like a sequence
- - x = vector[0]
- @attention: Vector data can be wrapped or non-wrapped. When a object is wrapped it
- means that the object will give you direct access to the data inside of blender. Modification
- of this object will directly change the data inside of blender. To copy a wrapped object
- you need to use the object's constructor. If you copy and object by assignment you will not get
- a second copy but a second reference to the same data. Only certain functions will return
- wrapped data. This will be indicated in the method description.
- Example::
- wrappedObject = Object.getAttribute() #this is wrapped data
- print wrappedObject.wrapped #prints 'True'
- copyOfObject = Object(wrappedObject) #creates a copy of the object
- secondPointer = wrappedObject #creates a second pointer to the same data
- print wrappedObject.attribute #prints '5'
- secondPointer.attribute = 10
- print wrappedObject.attribute #prints '10'
- print copyOfObject.attribute #prints '5'
- """
-
- def __init__(list = None):
- """
- Create a new 2d, 3d, or 4d Vector object from a list of floating point numbers.
- @note: that python uses higher precission floating point numbers, so values assigned to a vector may have some rounding error.
-
-
- Example::
- v = Vector(1,0,0)
- v = Vector(myVec)
- v = Vector(list)
- @type list: PyList of float or int
- @param list: The list of values for the Vector object. Can be a sequence or raw numbers.
- Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w].
- @rtype: Vector object.
- @return: It depends wheter a parameter was passed:
- - (list): Vector object initialized with the given values;
- - (): An empty 3 dimensional vector.
- """
-
- def copy():
- """
- Returns a copy of this vector
- @return: a copy of itself
- """
-
- def zero():
- """
- Set all values to zero.
- @return: an instance of itself
- """
-
- def normalize():
- """
- Normalize the vector, making the length of the vector always 1.0
- @note: Normalize works for vectors of all sizes, however 4D Vectors w axis is left untouched.
- @note: Normalizing a vector where all values are zero results in all axis having a nan value (not a number).
- @return: an instance of itself
- """
-
- def negate():
- """
- Set all values to their negative.
- @return: an instance of its self
- """
-
- def resize2D():
- """
- Resize the vector to 2d.
- @return: an instance of itself
- """
-
- def resize3D():
- """
- Resize the vector to 3d. New axis will be 0.0.
- @return: an instance of itself
- """
-
- def resize4D():
- """
- Resize the vector to 4d. New axis will be 0.0.
- The last component will be 1.0, to make multiplying 3d vectors by 4x4 matrices easier.
- @return: an instance of itself
- """
-
- def toTrackQuat(track, up):
- """
- Return a quaternion rotation from the vector and the track and up axis.
- @type track: String.
- @param track: Possible values:
- - "x - x-axis up"
- - "y - y-axis up"
- - "z - z-axis up"
- - "-x - negative x-axis up"
- - "-y - negative y-axis up"
- - "-z - negative z-axis up"
- @type up: String.
- @param up: Possible values:
- - "x - x-axis up"
- - "y - y-axis up"
- - "z - z-axis up"
- @rtype: Quaternion
- @return: Return a quaternion rotation from the vector and the track and up axis.
- """
-
- def reflect(mirror):
- """
- Return the reflection vector from the mirror vector argument.
- @type mirror: Vector object
- @param mirror: This vector could be a normal from the reflecting surface.
- @rtype: Vector object matching the size of this vector.
- @return: The reflected vector.
- """
-
-class Euler:
- """
- The Euler object
- ================
- This object gives access to Eulers in Blender.
- @ivar x: The heading value in degrees.
- @ivar y: The pitch value in degrees.
- @ivar z: The roll value in degrees.
- @ivar wrapped: Whether or not this object is wrapping data directly
- @note: You can access a euler object like a sequence
- - x = euler[0]
- @note: Comparison operators can be done:
- - ==, != test numeric values within epsilon
- @attention: Euler data can be wrapped or non-wrapped. When a object is wrapped it
- means that the object will give you direct access to the data inside of blender. Modification
- of this object will directly change the data inside of blender. To copy a wrapped object
- you need to use the object's constructor. If you copy and object by assignment you will not get
- a second copy but a second reference to the same data. Only certain functions will return
- wrapped data. This will be indicated in the method description.
- Example::
- wrappedObject = Object.getAttribute() #this is wrapped data
- print wrappedObject.wrapped #prints 'True'
- copyOfObject = Object(wrappedObject) #creates a copy of the object
- secondPointer = wrappedObject #creates a second pointer to the same data
- print wrappedObject.attribute #prints '5'
- secondPointer.attribute = 10
- print wrappedObject.attribute #prints '10'
- print copyOfObject.attribute #prints '5'
- """
-
- def __init__(list = None):
- """
- Create a new euler object.
-
- Example::
- euler = Euler(45,0,0)
- euler = Euler(myEuler)
- euler = Euler(sequence)
- @type list: PyList of float/int
- @param list: 3d list to initialize euler
- @rtype: Euler object
- @return: Euler representing heading, pitch, bank.
- @note: Values are in degrees.
- """
-
- def zero():
- """
- Set all values to zero.
- @return: an instance of itself
- """
-
- def copy():
- """
- @return: a copy of this euler.
- """
-
- def unique():
- """
- Calculate a unique rotation for this euler. Avoids gimble lock.
- @return: an instance of itself
- """
-
- def toMatrix():
- """
- Return a matrix representation of the euler.
- @rtype: Matrix object
- @return: A roation matrix representation of the euler.
- """
-
- def toQuat():
- """
- Return a quaternion representation of the euler.
- @rtype: Quaternion object
- @return: Quaternion representation of the euler.
- """
-
-class Quaternion:
- """
- The Quaternion object
- =====================
- This object gives access to Quaternions in Blender.
- @ivar w: The w value.
- @ivar x: The x value.
- @ivar y: The y value.
- @ivar z: The z value.
- @ivar wrapped: Wether or not this object wraps data directly
- @ivar magnitude: The magnitude of the quaternion.
- @ivar axis: Vector representing the axis of rotation.
- @ivar angle: A scalar representing the amount of rotation
- in degrees.
- @note: Comparison operators can be done:
- - ==, != test numeric values within epsilon
- @note: Math can be performed on Quaternion classes
- - quat + quat
- - quat - quat
- - quat * float/int
- - quat * vec
- - quat * quat
- @note: You can access a quaternion object like a sequence
- - x = quat[0]
- @attention: Quaternion data can be wrapped or non-wrapped. When a object is wrapped it
- means that the object will give you direct access to the data inside of blender. Modification
- of this object will directly change the data inside of blender. To copy a wrapped object
- you need to use the object's constructor. If you copy and object by assignment you will not get
- a second copy but a second reference to the same data. Only certain functions will return
- wrapped data. This will be indicated in the method description.
- Example::
- wrappedObject = Object.getAttribute() #this is wrapped data
- print wrappedObject.wrapped #prints 'True'
- copyOfObject = Object(wrappedObject) #creates a copy of the object
- secondPointer = wrappedObject #creates a second pointer to the same data
- print wrappedObject.attribute #prints '5'
- secondPointer.attribute = 10
- print wrappedObject.attribute #prints '10'
- print copyOfObject.attribute #prints '5'
- """
-
- def __init__(list, angle = None):
- """
- Create a new quaternion object from initialized values.
-
- Example::
- quat = Quaternion(1,2,3,4)
- quat = Quaternion(axis, angle)
- quat = Quaternion()
- quat = Quaternion(180, list)
-
- @type list: PyList of int/float
- @param list: A 3d or 4d list to initialize quaternion.
- 4d if intializing [w,x,y,z], 3d if used as an axis of rotation.
- @type angle: float (optional)
- @param angle: An arbitrary rotation amount around 'list'.
- List is used as an axis of rotation in this case.
- @rtype: New quaternion object.
- @return: It depends wheter a parameter was passed:
- - (list/angle): Quaternion object initialized with the given values;
- - (): An identity 4 dimensional quaternion.
- """
-
- def identity():
- """
- Set the quaternion to the identity quaternion.
- @return: an instance of itself
- """
-
- def copy():
- """
- make a copy of the quaternion.
- @return: a copy of itself
- """
-
- def negate():
- """
- Set the quaternion to its negative.
- @return: an instance of itself
- """
-
- def conjugate():
- """
- Set the quaternion to its conjugate.
- @return: an instance of itself
- """
-
- def inverse():
- """
- Set the quaternion to its inverse
- @return: an instance of itself
- """
-
- def normalize():
- """
- Normalize the quaternion.
- @return: an instance of itself
- """
-
- def toEuler():
- """
- Return Euler representation of the quaternion.
- @rtype: Euler object
- @return: Euler representation of the quaternion.
- """
-
- def toMatrix():
- """
- Return a matrix representation of the quaternion.
- @rtype: Matrix object
- @return: A rotation matrix representation of the quaternion.
- """
-
-class Matrix:
- """
- The Matrix Object
- =================
- This object gives access to Matrices in Blender.
- @ivar rowSize: The row size of the matrix.
- @ivar colSize: The column size of the matrix.
- @ivar wrapped: Whether or not this object wrapps internal data
- @note: Math can be performed on Matrix classes
- - mat + mat
- - mat - mat
- - mat * float/int
- - mat * vec
- - mat * mat
- @note: Comparison operators can be done:
- - ==, != test numeric values within epsilon
- @note: You can access a quaternion object like a 2d sequence
- - x = matrix[0][1]
- - vector = matrix[2]
- @attention: Quaternion data can be wrapped or non-wrapped. When a object is wrapped it
- means that the object will give you direct access to the data inside of blender. Modification
- of this object will directly change the data inside of blender. To copy a wrapped object
- you need to use the object's constructor. If you copy and object by assignment you will not get
- a second copy but a second reference to the same data. Only certain functions will return
- wrapped data. This will be indicated in the method description.
- Example::
- wrappedObject = Object.getAttribute() #this is wrapped data
- print wrappedObject.wrapped #prints 'True'
- copyOfObject = Object(wrappedObject) #creates a copy of the object
- secondPointer = wrappedObject #creates a second pointer to the same data
- print wrappedObject.attribute #prints '5'
- secondPointer.attribute = 10
- print wrappedObject.attribute #prints '10'
- print copyOfObject.attribute #prints '5'
- """
-
- def __init__(list1 = None, list2 = None, list3 = None, list4 = None):
- """
- Create a new matrix object from initialized values.
-
- Example::
- matrix = Matrix([1,1,1],[0,1,0],[1,0,0])
- matrix = Matrix(mat)
- matrix = Matrix(seq1, seq2, vector)
-
- @type list1: PyList of int/float
- @param list1: A 2d,3d or 4d list.
- @type list2: PyList of int/float
- @param list2: A 2d,3d or 4d list.
- @type list3: PyList of int/float
- @param list3: A 2d,3d or 4d list.
- @type list4: PyList of int/float
- @param list4: A 2d,3d or 4d list.
- @rtype: New matrix object.
- @return: It depends wheter a parameter was passed:
- - (list1, etc.): Matrix object initialized with the given values;
- - (): An empty 3 dimensional matrix.
- """
-
- def zero():
- """
- Set all matrix values to 0.
- @return: an instance of itself
- """
-
-
- def copy():
- """
- Returns a copy of this matrix
- @return: a copy of itself
- """
-
- def identity():
- """
- Set the matrix to the identity matrix.
- An object with zero location and rotation, a scale of 1, will have an identity matrix.
-
- See U{http://en.wikipedia.org/wiki/Identity_matrix}
- @return: an instance of itself
- """
-
- def transpose():
- """
- Set the matrix to its transpose.
-
- See U{http://en.wikipedia.org/wiki/Transpose}
- @return: None
- """
-
- def determinant():
- """
- Return the determinant of a matrix.
-
- See U{http://en.wikipedia.org/wiki/Determinant}
- @rtype: float
- @return: Return a the determinant of a matrix.
- """
-
- def invert():
- """
- Set the matrix to its inverse.
-
- See U{http://en.wikipedia.org/wiki/Inverse_matrix}
- @return: an instance of itself.
- @raise ValueError: When matrix is singular.
- """
-
- def rotationPart():
- """
- Return the 3d submatrix corresponding to the linear term of the
- embedded affine transformation in 3d. This matrix represents rotation
- and scale. Note that the (4,4) element of a matrix can be used for uniform
- scaling, too.
- @rtype: Matrix object.
- @return: Return the 3d matrix for rotation and scale.
- """
-
- def translationPart():
- """
- Return a the translation part of a 4 row matrix.
- @rtype: Vector object.
- @return: Return a the translation of a matrix.
- """
-
- def scalePart():
- """
- Return a the scale part of a 3x3 or 4x4 matrix.
- @note: This method does not return negative a scale on any axis because it is not possible to obtain this data from the matrix alone.
- @rtype: Vector object.
- @return: Return a the scale of a matrix.
- """
-
- def resize4x4():
- """
- Resize the matrix to by 4x4
- @return: an instance of itself.
- """
-
- def toEuler():
- """
- Return an Euler representation of the rotation matrix (3x3 or 4x4 matrix only).
- @rtype: Euler object
- @return: Euler representation of the rotation matrix.
- """
-
- def toQuat():
- """
- Return a quaternion representation of the rotation matrix
- @rtype: Quaternion object
- @return: Quaternion representation of the rotation matrix
- """
-
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
deleted file mode 100644
index 9b6dcae8bb6..00000000000
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ /dev/null
@@ -1,1266 +0,0 @@
-# Blender.Mesh module and the Mesh PyType object
-
-"""
-The Blender.Mesh submodule.
-
-B{New}:
-
-Mesh Data
-=========
-
-This module provides access to B{Mesh Data} objects in Blender. It differs
-from the NMesh module by allowing direct access to the actual Blender data,
-so that changes are done immediately without need to update or put the data
-back into the original mesh. The result is faster operations with less memory
-usage. The example below creates a simple pyramid, and sets some of the
-face's attributes (the vertex color):
-
-Example::
- from Blender import *
- import bpy
-
- editmode = Window.EditMode() # are we in edit mode? If so ...
- if editmode: Window.EditMode(0) # leave edit mode before getting the mesh
-
- # define vertices and faces for a pyramid
- coords=[ [-1,-1,-1], [1,-1,-1], [1,1,-1], [-1,1,-1], [0,0,1] ]
- faces= [ [3,2,1,0], [0,1,4], [1,2,4], [2,3,4], [3,0,4] ]
-
- me = bpy.data.meshes.new('myMesh') # create a new mesh
-
- me.verts.extend(coords) # add vertices to mesh
- me.faces.extend(faces) # add faces to the mesh (also adds edges)
-
- me.vertexColors = 1 # enable vertex colors
- me.faces[1].col[0].r = 255 # make each vertex a different color
- me.faces[1].col[1].g = 255
- me.faces[1].col[2].b = 255
-
- scn = bpy.data.scenes.active # link object to current scene
- ob = scn.objects.new(me, 'myObj')
-
- if editmode: Window.EditMode(1) # optional, just being nice
-
-Vertices, edges and faces are added to a mesh using the .extend() methods.
-For best speed and efficiency, gather all vertices, edges or faces into a
-list and call .extend() once as in the above example. Similarly, deleting
-from the mesh is done with the .delete() methods and are most efficient when
-done once.
-
-@type Modes: readonly dictionary
-@type FaceFlags: readonly dictionary
-@type FaceModes: readonly dictionary
-@type FaceTranspModes: readonly dictionary
-@var Modes: The available mesh modes.
- - NOVNORMALSFLIP - no flipping of vertex normals during render.
- - TWOSIDED - double sided mesh.
- - AUTOSMOOTH - turn auto smoothing of faces "on".
- - note: SUBSURF and OPTIMAL have been removed, use Modifiers to apply subsurf.
-@var FaceFlags: The available *texture face* (uv face select mode) selection
- flags. Note: these refer to TexFace faces, available if mesh.faceUV
- returns true.
- - SELECT - selected (deprecated in versions after 2.43, use face.sel).
- - HIDE - hidden (deprecated in versions after 2.43, use face.hide).
- - ACTIVE - the active face, read only - Use L{mesh.activeFace<Mesh.Mesh.activeFace>} to set.
-@var FaceModes: The available *texture face* modes. Note: these are only
- meaningful if mesh.faceUV returns true, since in Blender this info is
- stored at the TexFace (TexFace button in Edit Mesh buttons) structure.
- - ALL - set all modes at once.
- - BILLBOARD - always orient after camera.
- - HALO - halo face, always point to camera.
- - DYNAMIC - respond to collisions.
- - ALPHASORT - game engine sorts these faces only.
- - INVISIBLE - invisible face.
- - LIGHT - dynamic lighting.
- - OBCOL - use object color instead of vertex colors.
- - SHADOW - shadow type.
- - SHAREDVERT - apparently unused in Blender.
- - SHAREDCOL - shared vertex colors (per vertex).
- - TEX - has texture image.
- - TILES - uses tiled image.
- - TWOSIDE - two-sided face.
-@var FaceTranspModes: The available face transparency modes. Note: these are
- enumerated values (enums), they can't be combined (ANDed, ORed, etc) like a bit vector.
- - SOLID - draw solid.
- - ADD - add to background (halo).
- - ALPHA - draw with transparency.
- - SUB - subtract from background.
- - CLIP - Clipped alpha.
-@var EdgeFlags: The available edge flags.
- - SELECT - selected (B{deprecated}). Use edge.sel attribute instead.
- - EDGEDRAW - edge is drawn out of edition mode.
- - EDGERENDER - edge is drawn out of edition mode.
- - SEAM - edge is a seam for UV unwrapping
- - FGON - edge is part of a F-Gon.
- - LOOSE - Edge is not a part of a face (only set on leaving editmode)
- - SHARP - Edge will be rendered sharp when used with the "Edge Split" modifier.
-@type AssignModes: readonly dictionary.
-@var AssignModes: The available vertex group assignment modes, used by
- L{mesh.assignVertsToGroup()<Mesh.Mesh.assignVertsToGroup>}.
- - ADD: if the vertex in the list is not assigned to the group
- already, this creates a new association between this vertex and the
- group with the weight specified, otherwise the weight given is added to
- the current weight of an existing association between the vertex and
- group.
- - SUBTRACT: will attempt to subtract the weight passed from a vertex
- already associated with a group, else it does nothing.\n
- - REPLACE: attempts to replace a weight with the new weight value
- for an already associated vertex/group, else it does nothing.
-@type SelectModes: readonly dictionary.
-@var SelectModes: The available edit select modes.
- - VERTEX: vertex select mode.
- - EDGE: edge select mode.
- - FACE: face select mode.
-"""
-
-AssignModes = {'REPLACE':1}
-
-def Get(name=None):
- """
- Get the mesh data object called I{name} from Blender.
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: Mesh
- @return: If a name is given, it returns either the requested mesh or None.
- If no parameter is given, it returns all the meshes in the current scene.
- """
-
-def New(name='Mesh'):
- """
- Create a new mesh data object called I{name}.
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: Mesh
- @return: a new Blender mesh.
- @note: if the mesh is not linked to an object, its datablock will be deleted
- when the object is deallocated.
- """
-
-def Mode(mode=0):
- """
- Get and/or set the selection modes for mesh editing. These are the modes
- visible in the 3D window when a mesh is in Edit Mode.
- @type mode: int
- @param mode: The desired selection mode. See L{SelectModes} for values.
- Modes can be combined. If omitted, the selection mode is not changed.
- @rtype: int
- @return: the current selection mode.
- @note: The selection mode is an attribute of the current scene. If the
- scene is changed, the selection mode may not be the same.
- """
-
-def Unlink(name):
- """
- Delete an unused mesh from Blender's database. The mesh must not have
- any users (i.e., it must not be linked to any object).
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: None
- @note: This function may be a temporary solution; it may be replaced
- in the future by a more general unlink function for many datablock types.
- Hopefully this will be decided prior to the 2.42 release of Blender.
- """
-
-class MCol:
- """
- The MCol object
- ===============
- This object is four ints representing an RGBA color.
- @ivar r: The Red component in [0, 255].
- @type r: int
- @ivar g: The Green component in [0, 255].
- @type g: int
- @ivar b: The Blue component in [0, 255].
- @type b: int
- @ivar a: The Alpha (transparency) component in [0, 255].
- @type a: int
- """
-
-class MVert:
- """
- The MVert object
- ================
- This object holds mesh vertex data.
- @ivar co: The vertex coordinates (x, y, z).
- @type co: vector (WRAPPED DATA)
- @ivar no: The vertex's unit normal vector (x, y, z).
- B{Note}: if vertex coordinates are changed, it may be necessary to use
- L{Mesh.calcNormals()} to update the vertex normals.
- B{Note}: Vertex normals can be set, but are not wrapped so modifying a normal
- vector will not effect the verts normal. The result is only visible
- when faces have the smooth option enabled.
- Example::
- # This won't work.
- for v in me.verts:
- v.no.x= 0
- v.no.y= 0
- v.no.z= 1
- # This will work
- no= Blender.Mathutils.Vector(0,0,1)
- for v in me.verts:
- v.no= no
- @type no: vector
- @ivar uvco: The vertex texture "sticky" coordinates (x, y),
- B{Note}: These are not seen in the UV editor and they are not a part of UV a UVLayer. Use face UV's for that.
- if present. Available for MVerts only.
- Use L{Mesh.vertexUV} to test for presence before trying to access;
- otherwise an exception will may be thrown.
- (Sticky coordinates can be set when the object is in the Edit mode;
- from the Editing Panel (F9), look under the "Mesh" properties for the
- "Sticky" button).
- @type uvco: vector (WRAPPED DATA)
- @ivar index: The vertex's index within the mesh (MVerts only). Read-only.
- @type index: int
- @ivar sel: The vertex's selection state (selected=1).
- B{Note}: a Mesh will return the selection state of the mesh when EditMode
- was last exited. A Python script operating in EditMode must exit EditMode
- before getting the current selection state of the mesh.
- @type sel: int
- @ivar hide: The face's B{edit mode} visibility state (hidden=1).
- @type hide: int
- @warn: There are two kinds of UV texture coordinates in Blender: per vertex
- ("sticky") and per face vertex (UV in L{MFace}). In the first, there's
- only one UV pair of coordinates for each vertex in the mesh. In the
- second, for each face it belongs to, a vertex can have different UV
- coordinates. This makes the per face option more flexible, since two
- adjacent faces won't have to be mapped to a continuous region in an image:
- each face can be independently mapped to any part of its texture.
- """
-
- def __init__(coord):
- """
- Create a new PVert object.
-
- @note: PVert-type objects are designed to be used for creating and
- modifying a mesh's vertex list, but since they do not "wrap" any Blender
- data there are some differences. The B{index} and B{uvco} attributes
- are not defined for PVerts, and the B{no} attribute contains valid
- data only if the PVert was created from an MVert (using a slice
- operation on the mesh's vertex list.) PVerts also cannot be used as an
- argument to any method which expects data wrapping a Blender mesh, such
- as L{MVertSeq.delete()}.
-
- Example::
- v = Blender.Mesh.MVert(1,0,0)
- v = Blender.Mesh.MVert(Blender.Mathutils.Vector([1,0,0]))
-
- m = Blender.Mesh.Get('Mesh')
- vlist = m.verts[:] # slice operation also returns PVerts
-
- @type coord: three floats or a Vector object
- @param coord: the coordinate values for the new vertex
- @rtype: PVert
- @return: a new PVert object
-
- """
-
-class MVertSeq:
- """
- The MVertSeq object
- ===================
- This object provides sequence and iterator access to the mesh's vertices.
- Access and assignment of single items and slices are also supported.
- When a single item in the vertex list is accessed, the operator[] returns
- a MVert object which "wraps" the actual vertex in the mesh; changing any
- of the vertex's attributes will immediately change the data in the mesh.
- When a slice of the vertex list is accessed, however, the operator[]
- returns a list of PVert objects which are copies of the mesh's vertex
- data. Changes to these objects have no effect on the mesh; they must be
- assigned back to the mesh's vertex list.
-
- Slice assignments cannot change the vertex list size. The size of the
- list being assigned must be the same as the specified slice; otherwise an
- exception is thrown.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- vert = me.verts[0] # vert accesses actual mesh data
- vert.co[0] += 2 # change the vertex's X location
- pvert = me.verts[-2:] # pvert is COPY of mesh's last two verts
- pvert[0].co[0] += 2 # change the vertex's X location
- pvert[1].co[0] += 2 # change the vertex's X location
- me.verts[-1] = pvert[1] # put change to second vertex into mesh
-
- @note: The mesh can be "cleared" by assigning B{None} to the mesh's vertex
- list. This does not delete the Blender mesh object, it only deletes all
- the memory allocated to the mesh. The result is equivalent to calling
- Mesh.New(). The intent is to allow users writing exporters to free memory
- after it is used in a quick and simple way.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- me.verts = None # delete all the mesh's attributes
-
- """
-
- def extend(coords):
- """
- Append zero or more vertices to the mesh. Unlike L{MEdgeSeq.extend()} and
- L{MFaceSeq.extend()} no attempt is made to check for duplicate vertices in
- the parameter list, or for vertices already in the mesh.
- @note: Since Blender 2.44 all new verts are selected.
-
- Example::
- import Blender
- from Blender import Mesh
- from Blender.Mathutils import Vector
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- me.verts.extend(1,1,1) # add one vertex
- l=[(.1,.1,.1),Vector([2,2,.5])]
- me.verts.extend(l) # add multiple vertices
-
- @type coords: sequences(s) of floats or vectors
- @param coords: coords can be
- - a sequence of three floats,
- - a 3D vector, or
- - a sequence (list or tuple) of either of the above.
- """
-
- def delete(verts):
- """
- Deletes one or more vertices from the mesh. Any edge or face which
- uses the specified vertices are also deleted.
-
- @type verts: multiple ints or MVerts
- @param verts: can be
- - a single MVert belonging to the mesh (B{note:} will not work with
- PVerts)
- - a single integer, specifying an index into the mesh's vertex list
- - a sequence (list or tuple) containing two or more of either of
- the above.
- """
-
- def selected():
- """
- Get selected vertices.
- @return: a list of the indices for all vertices selected in edit mode.
- @rtype: list of ints
- """
-
-class MEdge:
- """
- The MEdge object
- ================
- This object holds mesh edge data.
- @ivar v1: The first vertex of the edge.
- @type v1: MVert
- @ivar v2: The second vertex of the edge.
- @type v2: MVert
- @ivar length: The length of the edge, same as (ed.v1.co-ed.v2.co).length where "ed" is an MEdge.
- @type length: float
- @ivar crease: The crease value of the edge. It is in the range [0,255].
- @type crease: int
- @ivar flag: The bitfield describing edge properties. See L{EdgeFlags}.
- Example::
- # This script counts fgon and non fgon edges
- from Blender import Scene, Mesh
- scn= Scene.GetCurrent() # Current scene, important to be scene aware
- ob= scn.objects.active # last selected object
- me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
-
- total_fgon_eds= total_nor_eds= 0
-
- # Look through the edges and find any fgon edges, then print the findings to the console
- for ed in me.edges: # all meshes have edge data now
- if ed.flag & Mesh.EdgeFlags.FGON:
- total_fgon_eds+=1
- else:
- total_nor_eds+=1
-
- print 'Blender has', total_fgon_eds, 'fgon edges and', total_nor_eds, 'non fgon edges'
- @type flag: int
- @ivar index: The edge's index within the mesh. Read-only.
- @type index: int
- @ivar sel: The edge's B{edit mode} selection state (selected=1). B{Note}:
- changing the select state of an edge changes the select state of the edge's
- vertices.
- @type sel: int
- @ivar key: The edge's vert indices in an ordered tuple, which can be used
- as a dictionary key. Read-only.
- This is the same as (min(ed.v1.index, ed.v2.index), max(ed.v1.index, ed.v2.index))
- @type key: tuple
- """
-
- def __iter__():
- """
- Iterator for MEdge. It iterates over the MVerts of the edge, returning
- v1 then v2.
- @return: one of the edge's vertices
- @rtype: MVert
- """
-
-class MEdgeSeq:
- """
- The MEdgeSeq object
- ===================
- This object provides sequence and iterator access to the mesh's edges.
- """
-
- def extend(vertseq):
- """
- Add zero or more edges to the mesh. Edges which already exist in the
- mesh or with both vertices the same are ignored. If three or four verts
- are specified in any sequence, an edge is also created between the first
- and last vertices (this is useful when adding faces).
- @note: Since Blender 2.44 all new edges are selected.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- v = me.verts # get vertices
- if len(v) >= 6: # if there are enough vertices...
- me.edges.extend(v[0],v[1]) # add a single edge
- l=[(v[1],v[2],v[3]),[0,2,4,5]]
- me.edges.extend(l) # add multiple edges
-
- @type vertseq: sequence(s) of ints or MVerts
- @param vertseq: either two to four ints or MVerts, or sequence
- (list or tuple) of sequences each containing two to four ints or MVerts.
- """
-
- def delete(edges):
- """
- Deletes one or more edges from the mesh. In addition, also delete:
- - any faces which uses the specified edge(s)
- - any "orphan" vertices (belonging only to specified edge(s))
-
- @type edges: multiple ints or MEdges
- @param edges: can be
- - a single MEdge belonging to the mesh
- - a single integer, specifying an index into the mesh's edge list
- - a sequence (list or tuple) containing two or more of either of
- the above.
- """
-
- def selected():
- """
- Get selected edges.
- Selected edges are those for which both vertices are selected.
- @return: a list of the indices for all edges selected in edit mode.
- @rtype: list of ints
- """
-
-class MFace:
- """
- The MFace object
- ================
- This object holds mesh face data.
-
- Example::
- import Blender
- from Blender import Mesh, Window
-
- in_emode = Window.EditMode()
- if in_emode: Window.EditMode(0)
-
- me = Mesh.Get("Mesh")
- faces = me.faces
-
- ## Example for editmode faces selection:
- selected_faces = []
- for f in faces:
- if f.sel:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- f.sel = not f.sel # 1 becomes 0, 0 becomes 1
-
- ## Example for UV textured faces selection:
- selected_faces = []
- SEL = Mesh.FaceFlags['SELECT']
- # get selected faces:
- for f in faces:
- if f.flag & SEL:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- if f.flag & SEL:
- f.flag &= ~SEL # unselect these
- else:
- f.flag |= SEL # and select these
-
- if in_emode: Window.EditMode(1)
- Blender.Redraw()
-
- @ivar verts: The face's vertices. Each face has 3 or 4 vertices.
- @type verts: list of MVerts
- @ivar v: Same as L{verts}. This attribute is only for compatibility with
- NMesh scripts and will probably be deprecated in the future.
- @ivar sel: The face's B{edit mode} selection state (selected=1).
- This is not the same as the selection state of the textured faces
- (see L{flag}). B{Note}: changing the select state of a face changes
- the select state of the face's vertices.
- @type sel: int
- @ivar hide: The face's B{edit mode} visibility state (hidden=1).
- This is not the same as the visibility state of
- the textured faces (see L{flag}).
- @type hide: int
- @ivar smooth: If set, the vertex normals are averaged to make this
- face look smooth. (This is the same as choosing "Set Smooth" in the
- Editing Panel (F9) under "Link and Material" properties).
- @type smooth: int
- @ivar col: The face's vertex colors, if defined. Each vertex has its own
- color.
- Will throw an exception if L{Mesh.vertexColors} is False.
-
- Example::
- # This example uses vertex normals to apply normal colors to each face.
- import bpy
- from Blender import Window
- scn= bpy.scenes.active # Current scene, important to be scene aware
- ob= scn.objects.active # last selected object
- me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
- me.vertexColors= True # Enable face, vertex colors
- for f in me.faces:
- for i, v in enumerate(f):
- no= v.no
- col= f.col[i]
- col.r= int((no.x+1)*128)
- col.g= int((no.y+1)*128)
- col.b= int((no.z+1)*128)
- Window.RedrawAll()
- @type col: tuple of MCols
- @ivar mat: The face's index into the mesh's materials
- list. It is in the range [0,15].
- @type mat: int
- @ivar image: The Image used as a texture for this face.
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- Assigning an image will automatically set the TEX attribute of the
- L{mode} bitfield. Use "del f.image" or "f.image = None" to clear the
- image assigned to the face.
- @type image: Image
- @ivar mode: The texture mode bitfield (see L{FaceModes}).
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
- @type mode: int
- @ivar index: The face's index within the mesh. Read-only.
- @type index: int
-
- @ivar flag: The face's B{texture mode} flags; indicates the selection,
- active , and visibility states of a textured face (see
- L{FaceFlags} for values).
- This is not the same as the selection or visibility states of
- the faces in edit mode (see L{sel} and L{hide}).
- To set the active face, use
- the L{Mesh.activeFace} attribute instead.
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
-
- @ivar transp: Transparency mode. It is one of the values in
- L{FaceTranspModes}).
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
- @type transp: int
-
- @ivar uv: The face's UV coordinates. Each vertex has its own UV coordinate.
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- @type uv: tuple of vectors (WRAPPED DATA)
- @ivar uvSel: The face's UV coordinates selection state; a 1 indicates the
- vertex is selected. Each vertex has its own UV coordinate select state
- (this is not the same as the vertex's edit mode selection state).
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- @type uvSel: tuple of ints
- @ivar no: The face's normal vector (x, y, z). Read-only.
- @type no: vector
- @ivar cent: The center of the face. Read-only.
- @type cent: vector
- @ivar area: The area of the face. Read-only.
- @type area: float
- @ivar edge_keys: A tuple, each item a key that can reference an edge by its
- ordered indices. Read-only. This is useful for building connectivity data.
- Example::
- from Blender import Mesh
- me = Mesh.Get('Cube')
- # a dictionary where the edge is the key, and a list of faces that use it are the value
- edge_faces = dict([(ed.key, []) for ed in me.edges])
-
- # Add the faces to the dict
- for f in me.faces:
- for key in f.edge_keys:
- edge_faces[key].append(f) # add this face to the edge as a user
-
- # Print the edges and the number of face users
- for key, face_users in edge_faces.iteritems():
- print 'Edge:', key, 'uses:', len(face_users),'faces'
-
- @type edge_keys: tuple
- @note: there are regular faces and textured faces in Blender, both currently
- with their own selection and visibility states, due to a mix of old and new
- code. To (un)select or (un)hide regular faces (visible in EditMode), use
- L{MFace.sel} and L{MFace.hide} attributes. For textured faces (UV Face
- Select and Paint modes in Blender) use the L{MFace.flag} attribute.
- Check the example above and note L{Window.EditMode}.
- @note: Assigning UV textures to mesh faces in Blender works like this:
- 1. Select your mesh.
- 2. Enter face select mode (press f) and select at least some face(s).
- 3. In the UV/Image Editor window, load / select an image.
- 4. Play in both windows (better split the screen to see both at the same
- time) until the UV coordinates are where you want them. Hint: in the
- 3D window, the 'u' key opens a menu of default UV choices and the 'r'
- key lets you rotate the UV coords.
- 5. Leave face select mode (press f).
- """
-
- def __iter__():
- """
- Iterator for MVert. It iterates over the MVerts of the face, returning
- v1, v2, v3 (and optionally v4);
- @return: one of the face's vertices
- @rtype: MVert
- """
-
- def __len__():
- """
- len for MVert. It returns the number of vertices in the face.
- @rtype: int
- """
-
-class MFaceSeq:
- """
- The MFaceSeq object
- ===================
- This object provides sequence and iterator access to the mesh's faces.
- """
-
- def extend(vertseq,ignoreDups=True,indexList=True,smooth=False):
- """
- Add zero or more faces and edges to the mesh. Faces which already exist
- in the mesh, or faces which contain the same vertex multiple times are
- ignored. Sequences of two vertices are accepted, but no face will be
- created.
- @note: Since Blender 2.44 all new faces are selected.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- v = me.verts # get vertices
- if len(v) >= 6: # if there are enough vertices...
- me.faces.extend(v[1],v[2],v[3]) # add a single edge
- l=[(v[0],v[1]),[0,2,4,5]]
- me.faces.extend(l) # add another face
-
- @type vertseq: sequence(s) of MVerts
- @param vertseq: either two to four ints or MVerts, or sequence (list or
- tuple) of sequences each containing two to four ints or MVerts.
- @type ignoreDups: boolean
- @param ignoreDups: keyword parameter (default is False). If supplied and
- True, do not check the input list or mesh for duplicate faces. This can
- speed up scripts but can prossibly produce undesirable effects. Only
- use if you know what you're doing.
- @type indexList: boolean
- @param indexList: keyword parameter (default is False). If supplied and
- True, the method will return a list representing the new index for each
- face in the input list. If faces are removed as duplicates, None is
- inserted in place of the index.
- @type smooth: boolean
- @param smooth: keyword parameter (default is False). If supplied new faces will have smooth enabled.
- @warning: Faces using the first vertex at the 3rd or 4th location in the
- face's vertex list will have their order rotated so that the zero index
- on in the first or second location in the face. When creating face data
- with UVs or vertex colors, you may need to work around this, either by
- checking for zero indices yourself or by adding a dummy first vertex to
- the mesh that can be removed when your script has finished.
- """
-
- def delete(deledges, faces):
- """
- Deletes one or more faces (and optionally the edges associated with
- the face(s)) from the mesh.
-
- @type deledges: int
- @param deledges: controls whether just the faces (deledges=0)
- or the faces and edges (deledges=1) are deleted. These correspond to the
- "Only Faces" and "Edges & Faces" options in the Edit Mode pop-up menu
- @type faces: multiple ints or MFaces
- @param faces: a sequence (list or tuple) containing one or more of:
- - an MEdge belonging to the mesh
- - a integer, specifying an index into the mesh's face list
- """
-
- def sort():
- """
- Sorts the faces using exactly the same syntax as pythons own list sorting function.
-
- Example::
- import Blender
- from Blender import Mesh
- me = Mesh.Get('mymesh')
-
- me.faces.sort(key=lambda f: f.area)
-
- me.faces.sort(key=lambda f: f.cent)
-
- @note: Internally faces only refer to their index, so after sorting, faces you alredy have will not have their index changed to match the new sorted order.
- """
-
- def selected():
- """
- Get selected faces.
- @return: a list of the indices for all faces selected in edit mode.
- @rtype: list of ints
- """
-
-from IDProp import IDGroup, IDArray
-class Mesh:
- """
- The Mesh Data object
- ====================
- This object gives access to mesh data in Blender.
-
- @note: the verts, edges and faces attributes are implemented as sequences.
- The operator[] and len() are defined for these sequences. You cannot
- assign to an item in the sequence, but you can assign to most of the
- attributes of individual items.
- @ivar edges: The mesh's edges.
- @type edges: sequence of MEdges
- @ivar faces: The mesh's faces.
- @type faces: sequence of MFaces
- @ivar verts: The mesh's vertices.
- @type verts: sequence of MVerts
-
- @ivar materials: The mesh's materials. Each mesh can reference up to
- 16 materials. Empty slots in the mesh's list are represented by B{None}.
- B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- B{Note}: Making the material list shorter does not change the face's material indices.
- Take care when using the face's material indices to reference a material in this list.
- B{Note}: The list that's returned is I{not} linked to the original mesh.
- mesh.materials.append(material) won't do anything.
- Use mesh.materials += [material] instead.
- @type materials: list of L{Material}s
- @ivar degr: The max angle for auto smoothing in [1,80].
- @type degr: int
- @ivar maxSmoothAngle: Same as L{degr}. This attribute is only for
- compatibility with NMesh scripts and will probably be deprecated in
- the future.
- @ivar mode: The mesh's mode bitfield. See L{Modes}.
- @type mode: int
- @ivar sel: Sets selection status for all vertices, edges and faces in the
- mesh (write only).
- @type sel: boolean
- @ivar hide: Sets hidden status for all vertices, edges and faces in the
- mesh (write only).
- @type hide: boolean
- @ivar subDivLevels: The [display, rendering] subdivision levels in [1, 6].
- @type subDivLevels: list of 2 ints
- @ivar faceUV: The mesh contains UV-mapped textured faces.
- @type faceUV: bool
- @ivar vertexColors: The mesh contains vertex colors. Set True to add vertex colors.
- @type vertexColors: bool
- @ivar vertexUV: The mesh contains "sticky" per-vertex UV coordinates.
- @type vertexUV: bool
- @ivar activeFace: Index of the mesh's active face in UV Face Select and
- Paint modes. Only one face can be active at a time. Note that this is
- independent of the selected faces in Face Select and Edit modes.
- Will throw an exception if the mesh does not have UV faces; use
- L{faceUV} to test.
- @type activeFace: int
- @ivar activeGroup: The mesh's active vertex group. The mesh must be
- linked to an object (read the comment in L{addVertGroup} for more info).
- @type activeGroup: string or None
- @ivar texMesh: The mesh's texMesh setting, used so coordinates from another
- mesh can be used for rendering textures.
- @type texMesh: Mesh or None
- @ivar key: The L{Key<Key.Key>} object containing the keyframes for this mesh, if any.
- @type key: Key or None
- @ivar activeUVLayer: The mesh's active UV/Image layer. None if there is no UV/Image layers.
-
- B{Note}: After setting this value, call L{update} so the result can be seen the the 3d view.
- @type activeUVLayer: string
- @ivar activeColorLayer: The mesh's active Vertex Color layer. None if there is no UV/Image layers.
-
- B{Note}: After setting this value, call L{update} so the result can be seen the the 3d view.
- @type activeColorLayer: string
-
- @ivar renderUVLayer: The mesh's rendered UV/Image layer. None if there is no UV/Image layers.
- @type renderUVLayer: string
- @ivar renderColorLayer: The mesh's rendered Vertex Color layer. None if there is no UV/Image layers.
- @type renderColorLayer: string
-
- @ivar multires: The mesh has multires data, set True to add multires data.
- Will throw an exception if the mesh has shape keys; use L{key} to test.
- @type multires: bool
- @ivar multiresLevelCount: The mesh has multires data. (read only)
- @type multiresLevelCount: int
- @ivar multiresDrawLevel: The multires level to display in the 3dview in [1 - multiresLevelCount].
- @type multiresDrawLevel: int
- @ivar multiresEdgeLevel: The multires level edge display in the 3dview [1 - multiresLevelCount].
- @type multiresEdgeLevel: int
- @ivar multiresPinLevel: The multires pin level, used for applying modifiers [1 - multiresLevelCount].
- @type multiresPinLevel: int
- @ivar multiresRenderLevel: The multires level to render [1 - multiresLevelCount].
- @type multiresRenderLevel: int
-
-
- """
-
- def getFromObject(object, cage=0, render=0):
- """
- Replace the mesh's existing data with the raw mesh data from a Blender
- Object. This method supports all the geometry based objects (mesh, text,
- curve, surface, and meta). If the object has modifiers, they will be
- applied before to the object before extracting the vertex data unless
- the B{cage} parameter is 1.
- @note: The mesh coordinates are in I{local space}, not the world space of
- its object. For world space vertex coordinates, each vertex location must
- be multiplied by the object's 4x4 transform matrix (see L{transform}).
- @note: The objects materials will not be copied into the existing mesh,
- however the face material indices will match the material list of the original data.
- @type object: blender object or string
- @param object: The Blender object or its name, which contains the geometry data.
- @type cage: int
- @param cage: determines whether the original vertices or derived vertices
- @type render: int
- @param render: determines whether the render setting for modifiers will be used or not.
- (for objects with modifiers) are used. The default is derived vertices.
- """
-
- def calcNormals():
- """
- Recalculates the vertex normals using face data.
- """
-
- def pointInside(point, selected_only=False):
- """
- @type point: vector
- @param point: Test if this point is inside the mesh
- @type selected_only: bool
- @param selected_only: if True or 1, only the selected faces are taken into account.
- Returns true if vector is inside the mesh.
- @note: Only returns a valid result for mesh data that has no holes.
- @note: Bubbles in the mesh work as expect.
- """
- def getTangents():
- """
- Calculates tangents for this mesh, returning a list of tuples,
- each with 3 or 4 tangent vectors, these are alligned with the meshes faces.
-
- Example::
- # Display the tangents as edges over a the active mesh object
- from Blender import *
- sce = Scene.GetCurrent()
- ob = sce.objects.active
-
- me = ob.getData(mesh=1)
- ts = me.getTangents()
- me_disp = Mesh.New()
-
- verts = []
- edges = []
- for i, f in enumerate(me.faces):
- ft = ts[i]
- for j, v in enumerate(f):
- tan = ft[j]
- print tan
- co = v.co
-
- verts.append(co)
- verts.append(co+tan)
-
- i = len(verts)
- edges.append((i-1, i-2))
-
- me_disp.verts.extend( verts )
- me_disp.edges.extend( edges )
-
- sce.objects.new( me_disp )
-
- @note: The tangents are computed using the active UV layer, if there are no UV layers, orco coords are used.
- """
-
-
- def transform(matrix, recalc_normals = False, selected_only=False):
- """
- Transforms the mesh by the specified 4x4 matrix (such as returned by
- L{Object.Object.getMatrix}). The matrix should be invertible.
- Ideal usage for this is exporting to an external file where
- global vertex locations are required for each object.
- Sometimes external renderers or file formats do not use vertex normals.
- In this case, you can skip transforming the vertex normals by leaving
- the optional parameter recalc_normals as False or 0 (the default value).
-
- Example::
- # This script outputs deformed meshes worldspace vertex locations
- # for a selected object without changing the object
- import Blender
- from Blender import Mesh, Object
-
- ob = Object.GetSelected()[0] # Get the first selected object
- me = Mesh.New() # Create a new mesh
- me.getFromObject(ob.name) # Get the object's mesh data
- verts = me.verts[:] # Save a copy of the vertices
- me.transform(ob.matrix) # Convert verts to world space
- for v in me.verts:
- print 'worldspace vert', v.co
- me.verts = verts # Restore the original verts
-
- @type matrix: Py_Matrix
- @param matrix: 4x4 Matrix which can contain location, scale and rotation.
- @type recalc_normals: int
- @param recalc_normals: if True or 1, also transform vertex normals.
- @type selected_only: bool
- @param selected_only: if True or 1, only the selected verts will be transformed.
- @warn: unlike L{NMesh.transform()<NMesh.NMesh.transform>}, this method
- I{will immediately modify the mesh data} when it is used. If you
- transform the mesh using the object's matrix to get the vertices'
- world positions, the result will be a "double transform". To avoid
- this you either need to set the object's matrix to the identity
- matrix, perform the inverse transform after outputting the transformed
- vertices, or make a copy of the vertices prior to using this method
- and restore them after outputting the transformed vertices (as shown
- in the example).
- """
-
- def vertexShade(object):
- """
- Colors vertices based on the current lighting setup, like when there
- are no vertex colors and no textured faces and a user enters Vertex Paint
- Mode in Blender (only lamps in visible layers account). An exception is
- thrown if called while in EditMode.
- @type object: Object
- @param object: The Blender Object linked to the mesh.
- """
-
- def update(key=None):
- """
- Update display lists after changes to mesh. B{Note}: with changes taking
- place for using a directed acyclic graph (DAG) for scene and object
- updating, this method may be only temporary and may be removed in future
- releases.
- @type key: string
- @param key: Use this optional argument to write the current vertex
- locations to the a shape key. the name must match an existing shape key for this mesh
- See L{Mesh.Mesh.key} and L{Key.Key.blocks} to get a list of the named shape keys, setting the active keys is
- done from the object with L{Object.Object.pinShape}, L{Object.Object.activeShape}.
-
-
-
- @warn: Since Blender 2.42 this function has changed; now it won't recalculate
- vertex normals (seen when faces are smooth). See L{Mesh.calcNormals()}.
- """
-
- def findEdges(edges):
- """
- Quickly search for the location of an edges.
- @type edges: sequence(s) of ints or MVerts
- @param edges: can be tuples of MVerts or integer indexes (B{note:} will
- not work with PVerts) or a sequence (list or tuple) containing two or
- more sequences.
- @rtype: int, None or list
- @return: if an edge is found, its index is returned; otherwise None is
- returned. If a sequence of edges is passed, a list is returned.
- """
-
- def addVertGroup(group):
- """
- Add a named and empty vertex (deform) group to the object this mesh is
- linked to. The mesh must first be linked to an object (with object.link()
- or object.getData() ) so the method knows which object to update.
- This is because vertex groups in Blender are stored in I{the object} --
- not in the mesh, which may be linked to more than one object.
- @type group: string
- @param group: the name for the new group.
- """
-
- def removeVertGroup(group):
- """
- Remove a named vertex (deform) group from the object linked to this mesh.
- All vertices assigned to the group will be removed (just from the group,
- not deleted from the mesh), if any. If this mesh was newly created, it
- must first be linked to an object (read the comment in L{addVertGroup} for
- more info).
- @type group: string
- @param group: the name of a vertex group.
- """
-
- def assignVertsToGroup(group, vertList, weight, assignmode):
- """
- Adds an array (a Python list) of vertex points to a named vertex group
- associated with a mesh. The vertex list is a list of vertex indices from
- the mesh. You should assign vertex points to groups only when the mesh has
- all its vertex points added to it and is already linked to an object.
-
- I{B{Example:}}
- The example here adds a new set of vertex indices to a sphere primitive::
- import Blender
- sphere = Blender.Object.Get('Sphere')
- replace = Blender.Mesh.AssignModes.REPLACE
- mesh = sphere.getData(mesh=True)
- mesh.addVertGroup('firstGroup')
- vertList = []
- for x in range(300):
- if x % 3 == 0:
- vertList.append(x)
- mesh.assignVertsToGroup('firstGroup', vertList, 0.5, replace)
-
- @type group: string
- @param group: the name of the group.
- @type vertList: list of ints
- @param vertList: a list of vertex indices.
- @type weight: float
- @param weight: the deform weight for (which means: the amount of influence
- the group has over) the given vertices. It should be in the range
- [0.0, 1.0]. If weight <= 0, the given vertices are removed from the
- group. If weight > 1, it is clamped.
- @type assignmode: module constant
- @param assignmode: Three choices: REPLACE, ADD or SUBTRACT.
- See L{AssignModes} for a complete description.
- """
-
- def removeVertsFromGroup(group, vertList = None):
- """
- Remove a list of vertices from the given group. If this mesh was newly
- created, it must first be linked to an object (check L{addVertGroup}).
- @type group: string
- @param group: the name of a vertex group
- @type vertList: list of ints
- @param vertList: a list of vertex indices to be removed from I{group}.
- If None, all vertices are removed -- the group is emptied.
- """
-
- def getVertsFromGroup(group, weightsFlag = 0, vertList = None):
- """
- Return a list of vertex indices associated with the passed group. This
- method can be used to test whether a vertex index is part of a group and
- if so, what its weight is.
-
- I{B{Example:}}
- Append this to the example from L{assignVertsToGroup}::
- # ...
- print "Vertex indices from group %s :" % groupName
- print mesh.getVertsFromGroup('firstGroup')
- print "Again, with weights:"
- print mesh.getVertsFromGroup('firstGroup',1)
- print "Again, with weights and restricted to the given indices:"
- print mesh.getVertsFromGroup('firstGroup',1,[1,2,3,4,5,6])
-
- @type group: string
- @param group: the group name.
- @type weightsFlag: bool
- @param weightsFlag: if 1, each item in the list returned contains a
- tuple pair (index, weight), the weight is a float between 0.0 and 1.0.
- @type vertList: list of ints
- @param vertList: if given, only those vertex points that are both in the
- list and group passed in are returned.
- """
-
- def renameVertGroup(groupName, newName):
- """
- Renames a vertex group.
- @type groupName: string
- @param groupName: the vertex group name to be renamed.
- @type newName: string
- @param newName: the name to replace the old name.
- """
-
- def getVertGroupNames():
- """
- Return a list of all vertex group names.
- @rtype: list of strings
- @return: returns a list of strings representing all vertex group
- associated with the mesh's object
- """
-
- def getUVLayerNames():
- """
- Return a list of all UV layer names
- @rtype: list of strings
- @return: returns a list of strings representing all UV layers
- associated with the mesh's object
- """
-
- def getColorLayerNames():
- """
- Return a list of all color layer names
- @rtype: list of strings
- @return: returns a list of strings representing all color layers
- associated with the mesh's object
- """
-
- def getVertexInfluences(index):
- """
- Get the bone influences for a specific vertex.
- @type index: int
- @param index: The index of a vertex.
- @rtype: list of lists
- @return: List of pairs [name, weight], where name is the bone name (string)
- and weight is a float value.
- """
-
- def removeAllKeys():
- """
- Remove all mesh keys stored in this mesh.
- @rtype: bool
- @return: True if successful or False if the Mesh has no keys.
- """
-
- def insertKey(frame = None, type = 'relative'):
- """
- Insert a mesh key at the given frame.
- @type frame: int
- @type type: string
- @param frame: The Scene frame where the mesh key should be inserted. If
- None or the arg is not given, the current frame is used.
- @param type: The mesh key type: 'relative' or 'absolute'. This is only
- relevant on meshes with no keys.
- @warn: This and L{removeAllKeys} were included in this release only to
- make accessing vertex keys possible, but may not be a proper solution
- and may be substituted by something better later. For example, it
- seems that 'frame' should be kept in the range [1, 100]
- (the curves can be manually tweaked in the Ipo Curve Editor window in
- Blender itself later).
- @warn: Will throw an error if the mesh has multires. use L{multires} to check.
- """
-
- def addUVLayer(name):
- """
- Adds a new UV/Image layer to this mesh, it will always be the last layer but not made active.
- @type name: string
- @param name: The name of the new UV layer, 31 characters max.
- """
-
- def addColorLayer(name):
- """
- Adds a new Vertex Color layer to this mesh, it will always be the last layer but not made active.
- @type name: string
- @param name: The name of the new Color layer, 31 characters max.
- """
-
- def addMultiresLevel(levels = 1, type = 'catmull-clark'):
- """
- Adds multires levels to this mesh.
- @type levels: int
- @param levels: The number of levels to add
- @type type: string
- @param type: The type of multires level, 'catmull-clark' or 'simple'.
- """
-
- def removeUVLayer(name):
- """
- Removes the active UV/Image layer.
- @type name: string
- @param name: The name of the UV layer to remove.
- """
-
- def removeColorLayer(name):
- """
- Removes the active Vertex Color layer.
- @type name: string
- @param name: The name of the Color layer to remove.
- """
-
- def renameUVLayer(name, newname):
- """
- Renames the UV layer called name to newname.
- @type name: string
- @param name: The UV layer to rename.
- @type newname: string
- @param newname: The new name of the UV layer, will be made unique.
- """
-
- def renameColorLayer(name, newname):
- """
- Renames the color layer called name to newname.
- @type name: string
- @param name: The Color layer to rename.
- @type newname: string
- @param newname: The new name of the Color layer, will be made unique.
- """
-
- def smooth():
- """
- Flattens angle of selected faces. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def flipNormals():
- """
- Toggles the direction of selected face's normals. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def toSphere():
- """
- Moves selected vertices outward in a spherical shape. Experimental mesh
- tool.
- An exception is thrown if called while in EditMode.
- """
-
- def fill():
- """
- Scan fill a closed selected edge loop. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def triangleToQuad():
- """
- Convert selected triangles to quads. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def quadToTriangle(mode=0):
- """
- Convert selected quads to triangles. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type mode: int
- @param mode: specifies whether a to add the new edge between the
- closest (=0) or farthest(=1) vertices.
- """
-
- def subdivide(beauty=0):
- """
- Subdivide selected edges in a mesh. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type beauty: int
- @param beauty: specifies whether a "beauty" subdivide should be
- enabled (disabled is default). Value must be in the range [0,1].
- """
-
- def remDoubles(limit):
- """
- Removes duplicates from selected vertices. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type limit: float
- @param limit: specifies the maximum distance considered for vertices
- to be "doubles". Value is clamped to the range [0.0,1.0].
- @rtype: int
- @return: the number of vertices deleted
- """
-
- def recalcNormals(direction=0):
- """
- Recalculates inside or outside normals for selected faces. Experimental
- mesh tool.
- An exception is thrown if called while in EditMode.
- @type direction: int
- @param direction: specifies outward (0) or inward (1) normals. Outward
- is the default. Value must be in the range [0,1].
- """
-
- def __copy__ ():
- """
- Make a copy of this mesh
- @rtype: Mesh
- @return: a copy of this mesh
- """
-
-import id_generics
-Mesh.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/MeshPrimitives.py b/source/blender/python/api2_2x/doc/MeshPrimitives.py
deleted file mode 100644
index 4fb53ab4536..00000000000
--- a/source/blender/python/api2_2x/doc/MeshPrimitives.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# Blender.Mesh.Primitives module
-
-"""
-The Blender.Mesh.Primitives submodule.
-
-B{New}:
-
-Mesh Primitive Data
-===================
-
-This submodule provides access Blender's mesh primitives. Each module
-function returns a BPy_Mesh object which wraps the mesh data. This data can
-then be manipulated using the L{Mesh} API.
-
-Example::
-
- from Blender import *
-
- me = Mesh.Primitives.Cube(2.0) # create a new cube of size 2
- sc = Scene.GetCurrent() # get current scene
- sc.objects.new(me,'Mesh') # add a new mesh-type object to the scene
- Window.RedrawAll() # update windows
-"""
-
-def Plane(size=2.0):
- """
- Construct a filled planar mesh with 4 vertices. The default size
- creates a 2 by 2 Blender unit plane, identical to the Blender UI.
- @type size: float
- @param size: optional size of the plane.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Cube(size=2.0):
- """
- Construct a cube mesh. The default size creates a cube with each face
- 2 by 2 Blender units, identical to the Blender UI.
- @type size: float
- @param size: optional size of the cube.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Circle(verts=32,diameter=2.0):
- """
- Construct a circle mesh. The defaults create a circle with a
- diameter of 2 Blender units, identical to the Blender UI.
- @type verts: int
- @param verts: optional number of vertices for the circle.
- Value must be in the range [3,100].
- @type diameter: float
- @param diameter: optional diameter of the circle.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Cylinder(verts=32, diameter=2.0, length=2.0):
- """
- Construct a cylindrical mesh (ends filled). The defaults create a
- cylinder with a diameter of 2 Blender units and length 2 units,
- identical to the Blender UI.
- @type verts: int
- @param verts: optional number of vertices in the cylinder's perimeter.
- Value must be in the range [3,100].
- @type diameter: float
- @param diameter: optional diameter of the cylinder.
- @type length: float
- @param length: optional length of the cylinder.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Tube(verts=32, diameter=2.0, length=2.0):
- """
- Construct a cylindrical mesh (ends not filled). The defaults create a
- cylinder with a diameter of 2 Blender units and length 2 units, identical
- to the Blender UI.
- @type verts: int
- @param verts: optional number of vertices in the tube's perimeter.
- Value must be in the range [3,100].
- @type diameter: float
- @param diameter: optional diameter of the tube.
- @type length: float
- @param length: optional length of the tube.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Cone(verts=32, diameter=2.0, length=2.0):
- """
- Construct a conic mesh (ends filled). The defaulte create a cone with a
- base diameter of 2 Blender units and length 2 units, identical to
- the Blender UI.
- @type verts: int
- @param verts: optional number of vertices in the cone's perimeter.
- Value must be in the range [3,100].
- @type diameter: float
- @param diameter: optional diameter of the cone.
- @type length: float
- @param length: optional length of the cone.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Grid(xres=32, yres=32, size=2.0):
- """
- Construct a grid mesh. The defaults create a 32 by 32 mesh of size 2
- Blender units, identical to the Blender UI.
- @type xres: int
- @param xres: optional grid size in the x direction.
- Value must be in the range [2,100].
- @type yres: int
- @param yres: optional grid size in the y direction.
- Value must be in the range [2,100].
- @type size: float
- @param size: optional size of the grid.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def UVsphere(segments=32, rings=32, diameter=2.0):
- """
- Construct a UV sphere mesh. The defaults create a 32 by 32 sphere with
- a diameter of 2 Blender units, identical to the Blender UI.
- @type segments: int
- @param segments: optional number of longitudinal divisions.
- Value must be in the range [3,100].
- @type rings: int
- @param rings: optional number of latitudinal divisions.
- Value must be in the range [3,100].
- @type diameter: float
- @param diameter: optional diameter of the sphere.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Icosphere(subdivisions=2, diameter=2.0):
- """
- Construct a Icosphere mesh. The defaults create sphere with 2 subdivisions
- and diameter of 2 Blender units, identical to the Blender UI.
- @type subdivisions: int
- @param subdivisions: optional number of subdivisions.
- Value must be in the range [2,5].
- @type diameter: float
- @param diameter: optional diameter of the sphere.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
-def Monkey():
- """
- Construct a Suzanne mesh.
- @rtype: L{BPy_Mesh<Mesh>}
- @return: returns a mesh object.
- """
-
diff --git a/source/blender/python/api2_2x/doc/Metaball.py b/source/blender/python/api2_2x/doc/Metaball.py
deleted file mode 100644
index 69bcbedafae..00000000000
--- a/source/blender/python/api2_2x/doc/Metaball.py
+++ /dev/null
@@ -1,246 +0,0 @@
-# Blender.Metaball module and the Metaball PyType metaball
-
-"""
-The Blender.Metaball submodule
-
-This module provides access to B{Metaball} data in Blender and the elements they contain.
-
-
-Example::
- import Blender
- mb = Blender.Metaball.New()
- for i in xrange(20):
- element= mb.elements.add()
- element.co = Blender.Mathutils.Vector(i, 0, 0)
- sce = Blender.Scene.GetCurrent()
- sce.objects.new(mb)
-
-
-
-Example::
- # Converts the active armature into metaballs
- from Blender import *
- def main():
-
- scn= Scene.GetCurrent()
- ob_arm= scn.objects.active
- if not ob_arm or ob_arm.type!='Armature':
- Draw.PupMenu('No Armature Selected')
- return
- arm= ob_arm.data
-
- res= Draw.PupFloatInput('res:', 0.2, 0.05, 2.0)
- if not res:
- return
-
- # Make a metaball
- mb= Metaball.New()
- mb.wiresize= res
-
- # Link to the Scene
- ob_mb = scn.objects.new(ob_mb)
- ob_arm.sel= 0
- ob_mb.setMatrix(ob_arm.matrixWorld)
-
-
- meta_type= 0 # all elemts are ball type
- meta_stiffness= 2.0 # Volume
-
- for bone in arm.bones.values():
- print bone
-
- # Find out how many metaballs to add based on bone length, 4 min
- length= bone.length
- if length < res:
- mballs= 4
- else:
- mballs= int(length/res)
- if mballs < 4:
- mballs = 4
-
- print 'metaball count', mballs
-
- # get the bone properties
- head_rad= bone.headRadius
- tail_rad= bone.tailRadius
-
- head_loc= bone.head['ARMATURESPACE']
- tail_loc= bone.tail['ARMATURESPACE']
-
-
- for i in range(mballs):
- f= float(i)
-
- w1= f/mballs # weighting of this position on the bone for rad and loc
- w2= 1-w1
-
- loc= head_loc*w1 + tail_loc*w2
- rad= (head_rad*w1 + tail_rad*w2) * 1.3
-
- # Add the metaball
- ml= mb.elements.add()
- ml.co= loc
- ml.radius= rad
- ml.stiffness= meta_stiffness
-
-
- Window.RedrawAll()
-
- main()
-
-@type Types: readonly dictionary
-@var Types: MeteElement types.
- - BALL
- - TUBE
- - PLANE
- - ELIPSOID
- - CUBE
-
-@type Update: readonly dictionary
-@var Update: MeteElement types.
- - ALWAYS
- - HALFRES
- - FAST
- - NEVER
-
-"""
-
-
-def New (name):
- """
- Creates a new Metaball.
- @type name: string
- @param name: The name of the metaball. If this parameter is not given (or not valid) blender will assign a name to the metaball.
- @rtype: Blender Metaball
- @return: The created Metaball.
- """
-
-def Get (name):
- """
- Get the Metaball from Blender.
- @type name: string
- @param name: The name of the requested Metaball.
- @rtype: Blender Metaball or a list of Blender Metaballs
- @return: It depends on the 'name' parameter:
- - (name): The Metaball with the given name;
- - (): A list with all Metaballs in the current scene.
- """
-
-class Metaball:
- """
- The Metaball object
- ===================
- This metaball gives access to generic data from all metaballs in Blender.
- @ivar elements: Element iterator of MetaElemSeq type.
- @type elements: MetaElemSeq
- @ivar wiresize: display resolution.
- Value clamped between 0.05 and 1.0.
-
- A lower value results in more polygons.
- @type wiresize: float
- @ivar rendersize: render resolution.
- Value clamped between 0.05 and 1.0.
-
- A lower value results in more polygons.
- @type rendersize: float
- @ivar thresh: Threshold setting for this metaball.
- Value clamped between 0.0 and 5.0.
- @type thresh: float
- @ivar materials: List of up to 16 Materials or None types
- Only the first material of the mother-ball used at the moment.
- @type materials: list
- @ivar update: The update method to use for this metaball.
- @type update: int
- """
-
- def __copy__():
- """
- Return a copy of this metaball object data.
- @rtype: Metaball
- @return: Metaball
- """
-
-import id_generics
-Metaball.__doc__ += id_generics.attributes
-
-
-class MetaElemSeq:
- """
- The MetaElemSeq object
- ======================
- This object provides sequence and iterator access to the metaballs elements.
- The elements accessed within this iterator "wraps" the actual metaball elements; changing any
- of the elements's attributes will immediately change the data in the metaball.
-
- This iterator is most like pythons 'set' type.
- """
-
- def add():
- """
- Append a new element to the metaball.
- no arguments are taken, instead a new metaelement is
- added to the metaball data and returned.
- This new element can then be modified.
-
- @return: a new meta element.
- @rtype: Metaelement
- """
-
- def remove(element):
- """
- remove an element from the metaball data.
-
- if the element is not a part of the metaball data, an error will be raised.
-
- @return: None
- @rtype: None
- """
-
- def __iter__():
- """
- Iterate over elements in this metaball.
-
- @return: One of the metaelem in this metaball.
- @rtype: Metaelem
- """
-
- def __len__():
- """
- Iterate over elements in this metaball.
-
- @return: The number of elements in this metaball
- @rtype: int
- """
-
-class Metaelem:
- """
- The Metaelem object
- ===================
- This gives direct access to meta element data within a metaball.
- @ivar type: The type of the metaball.
- Values must be from L{Types}
-
- Example::
- from Blender import Metaball
- mb= Metaball.Get('mb')
- for el in mb.elements:
- el.type= Metaball.Types.CUBE
- @type type: int
- @ivar co: The location of this element.
- @type co: Vector
- @ivar dims: Element dimensions.
- Values clamped between 0 and 20 on all axies.
- @type dims: Vector
- @ivar quat: Element rotation.
- @type quat: Quaternion
- @ivar stiffness: Element stiffness.
- Value clamped between 0 and 10.
- @type stiffness: float
- @ivar radius: Element radius.
- Value clamped between 0 and 5000.
- @type radius: float
- @ivar negative: Element negative volume status.
- @type negative: bool
- @ivar hide: Element hidden status.
- @type hide: bool
- """
diff --git a/source/blender/python/api2_2x/doc/Metaballdoc.txt b/source/blender/python/api2_2x/doc/Metaballdoc.txt
deleted file mode 100644
index 2c64a43571e..00000000000
--- a/source/blender/python/api2_2x/doc/Metaballdoc.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-METABALL Module documentation
-
-
-INTRODUCTION
-The metaball module effect allows you to access all the data of an metaball.
-A metaball consists of several (maybe only one) metaelems, which are spheres, interacting with each other, thus creating soft organic volumes.
-
-
-
-functions of the module :
-New(name) : creates ans returns a metaball object.
-Get(opt : name) : if the parameter name is given, returns the metaball object whose name has been passed, or Py_None, if no such metaball exists in the current scene. If no parameter is given, returns a list of all the metaballs in the current scene.
-get : alias for Get
-
-Metaball object member functions :
-
-getName()Return Metaball name
-setName(string newname) - Sets Metaball name
-getWiresize() - Return Metaball wire size
-setWiresize(float val) - Sets Metaball wire size
-getRendersize() - Return Metaball render size
-setRendersize(float newval- Sets Metaball render size
-getThresh()- Return Metaball threshold
-setThresh(float newval)- Sets Metaball threshold
-getBbox,- Return Metaball bounding box(a list of eight lists of three elements)
-getNMetaElems() Returns the number of Metaelems (basic spheres)
-getMetatype(int num_metaelem): returns the type of the metaelem number num_metaelem.
-0 : ball
-1 : tubex
-2 : tubey
-3 : tubez
-setMetatype(int num_metaelem,int newtype) : sets the type of the metaelem number num_metaelem.
-getMetadata(field_name,int num_metaelem) gets Metaball MetaData. Explained later.
-setMetadata(field_name,int num_metaelem,newval) sets Metaball MetaData. Explained later.
-getMetalay(int num_metaelem)
-getMetax(int num_metaelem) : gets the x coordinate of the metaelement
-setMetax(int num_metaelem,float newval) : sets the x coordinate of the metaelement
-getMetay(int num_metaelem) : gets the y coordinate of the metaelement
-setMetay(int num_metaelem,float newval) : sets the y coordinate of the metaelement
-getMetaz(int num_metaelem) : gets the z coordinate of the metaelement
-setMetaz(int num_metaelem,float newval) : sets the z coordinate of the metaelement
-getMetas(int num_metaelem) : gets the s coordinate of the metaelement
-setMetas(int num_metaelem,float newval) : sets the s coordinate of the metaelement
-getMetalen(int num_metaelem) : gets the length of the metaelement. Important for tubes.
-setMetalen(int num_metaelem,float newval) : sets the length of the metaelement. Important for tubes.
-getloc, - Gets Metaball loc values
-setloc, (f f f) - Sets Metaball loc values
-getrot, () - Gets Metaball rot values
-setrot,, (f f f) - Sets Metaball rot values
-getsize,() - Gets Metaball size values
-setsize,(f f f) - Sets Metaball size values
-
-
-
-
-The Object.attribute syntax
-
-The attribute can take these values : seed,nabla,sta,end,lifetime,normfac,obfac,randfac,texfac,randlife,vectsize,totpart,force,mult,life,child,mat,defvec. \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Modifier.py b/source/blender/python/api2_2x/doc/Modifier.py
deleted file mode 100644
index 47f72e566b2..00000000000
--- a/source/blender/python/api2_2x/doc/Modifier.py
+++ /dev/null
@@ -1,231 +0,0 @@
-# Blender.Modifier module and the Modifier PyType object
-
-"""
-The Blender.Modifier submodule
-
-B{New}:
- - Supports the new Cast and Smooth modifiers.
-
-This module provides access to the Modifier Data in Blender.
-
-Example::
- from Blender import *
-
- ob = Object.Get('Cube') # retrieve an object
- mods = ob.modifiers # get the object's modifiers
- for mod in mods:
- print mod,mod.name # print each modifier and its name
- mod = mods.append(Modifier.Types.SUBSURF) # add a new subsurf modifier
- mod[Modifier.Settings.LEVELS] = 3 # set subsurf subdivision levels to 3
-
-
-Example::
- # Apply a lattice to an object and get the deformed object
- # Uses an object called 'Cube' and a lattice called 'Lattice'
-
- from Blender import *
- ob_mesh= Object.Get('Cube')
- ob_lattice= Object.Get('Lattice')
-
- myMeshMod = ob_mesh.modifiers
- mod = myMeshMod.append(Modifier.Types.LATTICE)
- mod[Modifier.Settings.OBJECT] = ob_lattice
-
- ob_mesh.makeDisplayList() # Needed to apply the modifier
-
- Window.RedrawAll() # View the change
-
- deformed_mesh= Mesh.New()
- deformed_mesh.getFromObject(ob_mesh.name)
-
-
- # Print the deformed locations
- for v in deformed_mesh.verts:
- print v.co
-
-
-
-@type Types: readonly dictionary
-@var Types: Constant Modifier dict used for L{ModSeq.append} to a
- modifier sequence and comparing with L{Modifier.type}:
- - ARMATURE - type value for Armature modifiers
- - ARRAY - type value for Array modifiers
- - BOOLEAN - type value for Boolean modifiers
- - BUILD - type value for Build modifiers
- - CURVE - type value for Curve modifiers
- - MIRROR - type value for Mirror modifiers
- - DECIMATE - type value for Decimate modifiers
- - LATTICE - type value for Lattice modifiers
- - SUBSURF - type value for Subsurf modifiers
- - WAVE - type value for Wave modifiers
- - EDGESPLIT - type value for Edge Split modifiers
- - DISPLACE - type value for Displace modifiers
- - SMOOTH - type value for Smooth modifiers
- - CAST - type value for Cast modifiers
-
-@type Settings: readonly dictionary
-@var Settings: Constant Modifier dict used for changing modifier settings.
- - RENDER - Used for all modifiers (bool) If true, the modifier is enabled for rendering.
- - REALTIME - Used for all modifiers (bool) If true, the modifier is enabled for interactive display.
- - EDITMODE - Used for all modifiers (bool) If both REALTIME and EDITMODE are true, the modifier is enabled for interactive display while the object is in edit mode.
- - ONCAGE - Used for all modifiers (bool) If true, the modifier is enabled for the editing cage during edit mode.
-
- - OBJECT - Used for Armature, Lattice, Curve, Boolean and Array (Object)
- - VERTGROUP - Used for Armature, Lattice, Curve, Smooth and Cast (String)
- - LIMIT - Array and Mirror (float [0.0 - 1.0])
- - FLAG - Mirror and Wave (int)
- - COUNT - Decimator Polycount (readonly) and Array (int)
- - LENGTH - Build [1.0-300000.0] and Array [0.0 - 10000.0] (float)
- - FACTOR - Smooth [-10.0, 10.0] and Cast [-10.0, 10.0] (float)
- - ENABLE_X = Smooth and Cast (bool, default: True)
- - ENABLE_Y = Smooth and Cast (bool, default: True)
- - ENABLE_Z = Smooth and Cast (bool, default: True)
- - TYPES - Subsurf and Cast. For Subsurf it determines the subdivision algorithm - (int): 0 = Catmull-Clark; 1 = simple subdivision. For Cast it determines the shape to deform to = (int): 0 = Sphere; 1 = Cylinder; 2 = Cuboid
-
- - LEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for interactive display.
- - RENDLEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for rendering.
- - OPTIMAL - Used for Subsurf only (bool). Enables Optimal Draw.
- - UV - Used for Subsurf only (bool). Enables Subsurf UV.
-
- - OBJECT_OFFSET - Used for Array only (Object)
- - OBJECT_CURVE - Used for Array only (Curve Object)
- - OFFSET_VEC - Used for Array only (3d Vector)
- - SCALE_VEC - Used for Array only (3d Vector)
- - MERGE_DIST - Used for Array only (float)
-
- - INVERT_VERTGROUP - Used for Armature only (bool)
- - ENVELOPES - Used for Armature only (bool)
- - VGROUPS - Used for Armature only (bool)
- - QUATERNION - Used for Armature only (bool)
- - B_BONE_REST - Used for Armature only (bool)
- - MULTIMODIFIER - Used for Armature only (bool)
-
- - START - Used for Build only (int)
- - SEED - Used for Build only (int)
- - RANDOMIZE - Used for Build only (bool)
-
- - AXIS_X - Used for Mirror only (bool)
- - AXIS_Y - Used for Mirror only (bool)
- - AXIS_Z - Used for Mirror only (bool)
-
- - RATIO - Used for Decimate only (float [0.0 - 1.0])
-
- - STARTX - Used for Wave only (float [-100.0 - 100.0])
- - STARTY - Used for Wave only (float [-100.0 - 100.0])
- - HEIGHT - Used for Wave only (float [-2.0 - 2.0])
- - WIDTH - Used for Wave only (float [0.0 - 5.0])
- - NARROW - Used for Wave only (float [0.0 - 10.0])
- - SPEED - Used for Wave only (float [-2.0 - 2.0])
- - DAMP - Used for Wave only (float [-MAXFRAME - MAXFRAME])
- - LIFETIME - Used for Wave only (float [-MAXFRAME - MAXFRAME])
- - TIMEOFFS - Used for Wave only (float [-MAXFRAME - MAXFRAME])
-
- - OPERATION - Used for boolean only (int 0,1,2 : Intersect, Union, Difference)
-
- - EDGESPLIT_ANGLE - Used for edge split only (float 0.0 - 180)
- - EDGESPLIT_FROM_ANGLE - Used for edge split only, should the modifier use the edge angle (bool)
- - EDGESPLIT_FROM_SHARP - Used for edge split only, should the modifier use the edge sharp flag (bool)
-
- - UVLAYER - Used for Displace only
- - MID_LEVEL - Used for Displace only (float [0.0, 1.0], default: 0.5)
- - STRENGTH - Used for Displace only (float [-1000.0, 1000.0, default: 1.0)
- - TEXTURE - Used for Displace only (string)
- - MAPPING - Used for Displace only
- - DIRECTION - Used for Displace only
-
- - REPEAT - Used for Smooth only (int [0, 30], default: 1)
-
- - RADIUS - Used for Cast only (float [0.0, 100.0], default: 0.0)
- - SIZE - Used for Cast only (float [0.0, 100.0], default: 0.0)
- - SIZE_FROM_RADIUS - Used for Cast only (bool, default: True)
- - USE_OB_TRANSFORM - Used for Cast only (bool, default: False)
-"""
-
-class ModSeq:
- """
- The ModSeq object
- =================
- This object provides access to list of L{modifiers<Modifier.Modifier>} for a particular object.
- Only accessed from L{Object.Object.modifiers}.
- """
-
- def __getitem__(index):
- """
- This operator returns one of the object's modifiers.
- @type index: int
- @return: an Modifier object
- @rtype: Modifier
- @raise KeyError: index was out of range
- """
-
- def __len__():
- """
- Returns the number of modifiers in the object's modifier stack.
- @return: number of Modifiers
- @rtype: int
- """
-
- def append(type):
- """
- Appends a new modifier to the end of the object's modifier stack.
- @type type: a constant specifying the type of modifier to create. as from L{Types}
- @rtype: Modifier
- @return: the new Modifier
- """
-
- def remove(modifier):
- """
- Remove a modifier from this objects modifier sequence.
- @type modifier: a modifier from this sequence to remove.
- @note: Accessing attributes of the modifier after removing will raise an error.
- """
-
- def moveUp(modifier):
- """
- Moves the modifier up in the object's modifier stack.
- @type modifier: a modifier from this sequence to remove.
- @rtype: None
- @raise RuntimeError: request to move above another modifier requiring
- original data
- @note: Accessing attributes of the modifier after removing will raise an error.
- """
-
- def moveDown(modifier):
- """
- Moves the modifier down in the object's modifier stack.
- @type modifier: a modifier from this sequence to remove.
- @rtype: None
- @raise RuntimeError: request to move modifier beyond a non-deforming
- modifier
- @note: Accessing attributes of the modifier after removing will raise an error.
- """
-
-class Modifier:
- """
- The Modifier object
- ===================
- This object provides access to a modifier for a particular object accessed
- from L{ModSeq}.
- @ivar name: The name of this modifier. 31 chars max.
- @type name: string
- @ivar type: The type of this modifier. Read-only. The returned value
- matches the types in L{Types}.
- @type type: int
- """
-
- def __getitem__(key):
- """
- This operator returns one of the modifier's data attributes.
- @type key: value from modifier's L{Modifier.Settings} constant
- @return: the requested data
- @rtype: varies
- @raise KeyError: the key does not exist for the modifier
- """
-
- def __setitem__(key):
- """
- This operator modifiers one of the modifier's data attributes.
- @type key: value from modifier's L{Modifier.Settings} constant
- @raise KeyError: the key does not exist for the modifier
- """
-
diff --git a/source/blender/python/api2_2x/doc/NLA.py b/source/blender/python/api2_2x/doc/NLA.py
deleted file mode 100644
index 0e30bfb118f..00000000000
--- a/source/blender/python/api2_2x/doc/NLA.py
+++ /dev/null
@@ -1,250 +0,0 @@
-# Blender.Armature.NLA module and the Action PyType object
-
-"""
-The Blender.Armature.NLA submodule.
-
-NLA
-===
-
-This module provides access to B{Action} objects in Blender. Actions are a
-series of keyframes/Ipo curves that define the movement of a bone.
-Actions are linked to objects of type armature.
-
-@type Flags: readonly dictionary
-@var Flags: Constant dict used by the L{ActionStrip.flag} attribute.
-It is a bitmask and settings are ORed together.
- - SELECT: action strip is selected in NLA window
- - STRIDE_PATH: play action based on path position and stride.
- - HOLD: continue displaying the last frame past the end of the strip
- - ACTIVE: action strip is active in NLA window
- - LOCK_ACTION: action start/end are automatically mapped to strip duration
- - MUTE: action strip does not contribute to the NLA solution
- - USEX: Turn off automatic single-axis cycling and use X as an offset axis. Note that you can use multiple axes at once.
- - USEY: Turn off automatic single-axis cycling and use Y as an offset axis. Note that you can use multiple axes at once.
- - USEZ: Turn off automatic single-axis cycling and use Z as an offset axis. Note that you can use multiple axes at once.
- - AUTO_BLEND: Automatic calculation of blend in/out values
-
-@type StrideAxes: readonly dictionary
-@var StrideAxes: Constant dict used by the L{ActionStrip.strideAxis} attribute.
-Values are STRIDEAXIS_X, STRIDEAXIS_Y, and STRIDEAXIS_Z.
-
-@type Modes: readonly dictionary
-@var Modes: Constant dict used by the L{ActionStrip.mode} attribute.
-Currently the only value is MODE_ADD.
-"""
-
-def NewAction (name = 'DefaultAction'):
- """
- Create a new Action object.
- @type name: string
- @param name: The Action name.
- @rtype: PyAction
- """
-
-def CopyAction (action):
- """
- Copy an action and it's keyframes
- @type action: PyAction
- @param action: The action to be copied.
- @rtype: PyAction
- @return: A copied action
- """
-
-def GetActions ():
- """
- Get all actions and return them as a Key : Value Dictionary.
- @rtype: Dictionary of PyActions
- @return: All the actions in blender
- """
-
-class Action:
- """
- The Action object
- =================
- This object gives access to Action-specific data in Blender.
- """
-
- def getName():
- """
- Get the name of this Action.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Action.
- @type name: string
- @param name: The new name
- """
-
- def setActive(object):
- """
- Set this action as the current action for an object.
- @type object: PyObject
- @param object: The object whose action is to be set
- """
-
- def getChannelIpo(channel):
- """
- Get the Ipo for the named channel in this action
- @type channel: string
- @param channel: The name of a channel in this action
- @rtype: PyIpo or None
- @return: the Ipo for the channel
- """
-
- def getFrameNumbers():
- """
- Gets the frame numbers at which a key was inserted into this action
- @rtype: PyList
- @return: a list of ints
- """
-
- def removeChannel(channel):
- """
- Remove a named channel from this action
- @type channel: string
- @param channel: The name of a channel in this action to be removed
- """
-
- def getAllChannelIpos():
- """
- Get the all the Ipos for this action
- @rtype: Dictionary [channel : PyIpo or None]
- @return: the Ipos for all the channels in the action
- """
-
- def getChannelNames():
- """
- Returns a list of channel names
- @rtype: list
- @return: the channel names that match bone and constraint names.
- """
-
- def renameChannel(nameFrom, nameTo):
- """
- rename an existing channel to a new name.
-
- if the nameFrom channel dosnt exist or the nameTo exists, an error will be raised.
- @return: None
- """
-
-import id_generics
-Action.__doc__ += id_generics.attributes
-
-
-class ActionStrips:
- """
- The ActionStrips object
- =======================
- This object gives access to sequence of L{ActionStrip} objects for
- a particular Object.
- """
-
- def __getitem__(index):
- """
- This operator returns one of the action strips in the stack.
- @type index: int
- @return: an action strip object
- @rtype: ActionStrip
- @raise KeyError: index was out of range
- """
-
- def __len__():
- """
- Returns the number of action strips for the object.
- @return: number of action strips
- @rtype: int
- """
-
- def append(action):
- """
- Appends a new action to the end of the action strip sequence.
- @type action: L{Action<NLA.Action>}
- @param action: the action to use in the action strip
- @rtype: ActionStrip
- @return: the new action strip
- """
-
- def remove(actionstrip):
- """
- Remove an action strip from this object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence to remove.
- @note: Accessing attributes of the action strip after it is removed will
- throw an exception.
- """
-
- def moveDown(actionstrip):
- """
- Move the action strip down in the object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence.
- """
-
- def moveUp(actionstrip):
- """
- Move the action strip up in the object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence.
- """
-
-class ActionStrip:
- """
- The ActionStrip object
- ======================
- This object gives access to a particular action strip.
- @ivar action: Action associated with the strip.
- @type action: BPy Action object
- @ivar stripStart: Starting frame of the strip.
- @type stripStart: float
- @ivar stripEnd: Ending frame of the strip.
- @type stripEnd: float
- @ivar actionStart: Starting frame of the action.
- @type actionStart: float
- @ivar actionEnd: Ending frame of the action.
- @type actionEnd: float
- @ivar repeat: The number of times to repeat the action range.
- @type repeat: float
- @ivar mode: Controls the ActionStrip mode. See L{Modes} for
- valid values.
- @type mode: int
- @ivar flag: Controls various ActionStrip attributes. Values can be ORed.
- See L{Flags} for valid values.
- @type flag: int
- @ivar strideAxis: Dominant axis for stride bone. See L{StrideAxes} for
- valid values.
- @type strideAxis: int
- @ivar strideLength: Distance covered by one complete cycle of the action
- specified in the Action Range.
- @type strideLength: float
- @ivar strideBone: Name of Bone used for stride
- @type strideBone: string
- @ivar groupTarget: Armature object within DupliGroup for local animation
- @type groupTarget: object
- @ivar blendIn: Number of frames of motion blending.
- @type blendIn: float
- @ivar blendOut: Number of frames of ease-out.
- @type blendOut: float
- """
-
- def resetActionLimits():
- """
- Activates the functionality found in NLA Strip menu under "Reset Action
- Start/End". This method restores the values of ActionStart and
- ActionEnd to their defaults, usually the first and last frames within
- an action that contain keys.
- @rtype: None
- """
-
- def resetStripSize():
- """
- Activates the functionality found in NLA Strip menu under "Reset Strip
- Size". This method resets the action strip size to its creation values.
- @rtype: None
- """
-
- def snapToFrame():
- """
- Activates the functionality found in NLA Strip menu under "Snap to Frame".
- This function snaps the ends of the action strip to the nearest whole
- numbered frame.
- @rtype: None
- """
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py
deleted file mode 100644
index e6d779aebb8..00000000000
--- a/source/blender/python/api2_2x/doc/NMesh.py
+++ /dev/null
@@ -1,823 +0,0 @@
-# Blender.NMesh module and the NMesh PyType object
-
-"""
-The Blender.NMesh submodule.
-
-B{Deprecated}:
-This module is now maintained but not actively developed.
-
-Access to data such as properties, library, UVLayers and ColorLayers is not available
-further more, a mesh modified with NMesh will destroy inactive UV and Color layers
-so writing tools that use NMesh is discouraged.
-
-Use L{Mesh} instead.
-
-Mesh Data
-=========
-
-This module provides access to B{Mesh Data} objects in Blender.
-
-Example::
-
- import Blender
- from Blender import NMesh, Material, Window
-
- editmode = Window.EditMode() # are we in edit mode? If so ...
- if editmode: Window.EditMode(0) # leave edit mode before getting the mesh
-
- me = NMesh.GetRaw("Plane") # get the mesh data called "Plane"
-
- if not me.materials: # if there are no materials ...
- newmat = Material.New() # create one ...
- me.materials.append(newmat) # and append it to the mesh's list of mats
-
- print me.materials # print the list of materials
- mat = me.materials[0] # grab the first material in the list
- mat.R = 1.0 # redefine its red component
- for v in me.verts: # loop the list of vertices
- v.co[0] *= 2.5 # multiply the coordinates
- v.co[1] *= 5.0
- v.co[2] *= 2.5
- me.update() # update the real mesh in Blender
-
- if editmode: Window.EditMode(1) # optional, just being nice
-
-@type Modes: readonly dictionary
-@type FaceFlags: readonly dictionary
-@type FaceModes: readonly dictionary
-@type FaceTranspModes: readonly dictionary
-@var Modes: The available mesh modes.
- - NOVNORMALSFLIP - no flipping of vertex normals during render.
- - TWOSIDED - double sided mesh.
- - AUTOSMOOTH - turn auto smoothing of faces "on".
-@var FaceFlags: The available *texture face* (uv face select mode) selection
- flags. Note: these refer to TexFace faces, available if nmesh.hasFaceUV()
- returns true.
- - SELECT - selected (deprecated after 2.43 release, use face.sel).
- - HIDE - hidden (deprecated after 2.43 release, use face.sel).
- - ACTIVE - the active face.
-@var FaceModes: The available *texture face* modes. Note: these are only
- meaningful if nmesh.hasFaceUV() returns true, since in Blender this info is
- stored at the TexFace (TexFace button in Edit Mesh buttons) structure.
- - ALL - set all modes at once.
- - BILLBOARD - always orient after camera.
- - HALO - halo face, always point to camera.
- - DYNAMIC - respond to collisions.
- - INVISIBLE - invisible face.
- - LIGHT - dynamic lighting.
- - OBCOL - use object color instead of vertex colors.
- - SHADOW - shadow type.
- - SHAREDVERT - apparently unused in Blender.
- - SHAREDCOL - shared vertex colors (per vertex).
- - TEX - has texture image.
- - TILES - uses tiled image.
- - TWOSIDE - two-sided face.
-@var FaceTranspModes: The available face transparency modes. Note: these are
- enumerated values (enums), they can't be combined (ANDed, ORed, etc) like a bit vector.
- - SOLID - draw solid.
- - ADD - add to background (halo).
- - ALPHA - draw with transparency.
- - SUB - subtract from background.
-@var EdgeFlags: The available edge flags.
- - SELECT - selected.
- - EDGEDRAW - edge is drawn out of edition mode.
- - SEAM - edge is a seam for UV unwrapping
- - FGON - edge is part of a F-Gon.
-"""
-
-def Col(col = [255, 255, 255, 255]):
- """
- Get a new mesh rgba color.
- @type col: list
- @param col: A list [red, green, blue, alpha] of integer values in [0, 255].
- @rtype: NMCol
- @return: A new NMCol (mesh rgba color) object.
- """
-
-def Vert(x = 0, y = 0, z = 0):
- """
- Get a new vertex object.
- @type x: float
- @type y: float
- @type z: float
- @param x: The x coordinate of the vertex.
- @param y: The y coordinate of the vertex.
- @param z: The z coordinate of the vertex.
- @rtype: NMVert
- @return: A new NMVert object.
- """
-
-def Face(vertexList = None):
- """
- Get a new face object.
- @type vertexList: list
- @param vertexList: A list of B{up to 4} NMVerts (mesh vertex
- objects).
- @rtype: NMFace
- @return: A new NMFace object.
- """
-
-def New(name = 'Mesh'):
- """
- Create a new mesh object.
- @type name: string
- @param name: An optional name for the created mesh.
- rtype: NMesh
- @return: A new (B{empty}) NMesh object.
- """
-
-def GetRaw(name = None):
- """
- Get the mesh data object called I{name} from Blender.
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: NMesh
- @return: It depends on the 'name' parameter:
- - (name) - The NMesh wrapper of the mesh called I{name},
- None if not found.
- - () - A new (empty) NMesh object.
- """
-
-def GetNames():
- """
- Get a list with the names of all available meshes in Blender.
- @rtype: list of strings
- @return: a list of mesh names.
- @note: to get actual mesh data, pass a mesh name to L{GetRaw}.
- """
-
-def GetRawFromObject(name):
- """
- Get the raw mesh data object from the Object in Blender called I{name}.\n
- Note: The mesh coordinates are in local space, not the world space of its Object.\n
- For world space vertex coordinates, each vertex location must be multiplied by the object's 4x4 matrix.
- This function support all the geometry based objects: Mesh, Text, Surface, Curve, Meta.
- @type name: string
- @param name: The name of an Object.
- @rtype: NMesh
- @return: The NMesh wrapper of the mesh data from the Object called I{name}.
- @note: For "subsurfed" meshes, it's the B{display} level of subdivision that
- matters, the rendering one is only processed at the rendering pre-stage
- and is not available for scripts. This is not a problem at all, since
- you can get and set the subdivision levels via scripting, too (see
- L{NMesh.NMesh.getSubDivLevels}, L{NMesh.NMesh.setSubDivLevels}).
- @note: Meshes extracted from curve based objects (Font/2D filled curves)
- contain both the filled surfaces and the outlines of the shapes.
- @warn: This function gets I{deformed} mesh data, already modified for
- displaying (think "display list"). It also doesn't let you overwrite the
- original mesh in Blender, so if you try to update it, a new mesh will
- be created.
- @warn: For Meta Object's, this function will only return a NMesh with some geometry
- when called on the base element (the one with the shortest name).
- """
-
-def PutRaw(nmesh, name = None, recalc_normals = 1, store_edges = 0):
- """
- Put a BPython NMesh object as a mesh data object in Blender.
- @note: if there is already a mesh with the given 'name', its contents are
- freed and the new data is put in it. Also, if this mesh is not linked to any
- object, a new object for it is created. Reminder: in Blender an object is
- composed of the base object and linked object data (mesh, metaball, camera,
- etc. etc).
- @type nmesh: NMesh
- @type name: string
- @type recalc_normals: int
- @type store_edges: int
- @param name: The name of the mesh data object in Blender which will receive
- this nmesh data. It can be an existing mesh data object or a new one.
- @param recalc_normals: If non-zero, the vertex normals for the mesh will
- be recalculated.
- @param store_edges: deprecated, edges are always stored now.
- @rtype: None or Object
- @return: It depends on the 'name' parameter:
- - I{name} refers to an existing mesh data obj already linked to an
- object: return None.
- - I{name} refers to a new mesh data obj or an unlinked (no users) one:
- return the created Blender Object wrapper.
- """
-
-class NMCol:
- """
- The NMCol object
- ================
- This object is a list of ints: [r, g, b, a] representing an
- rgba color.
- @ivar r: The Red component in [0, 255].
- @ivar g: The Green component in [0, 255].
- @ivar b: The Blue component in [0, 255].
- @ivar a: The Alpha (transparency) component in [0, 255].
- """
-
-class NMVert:
- """
- The NMVert object
- =================
- This object holds mesh vertex data.
- @type co: 3D Vector object. (WRAPPED DATA)
- @ivar co: The vertex coordinates (x, y, z).
- @type no: 3D Vector object. (unit length) (WRAPPED DATA)
- @ivar no: The vertex normal vector (x, y, z).
- @type uvco: 3D Vector object. (WRAPPED DATA)
- @ivar uvco: The vertex texture "sticky" coordinates. The Z value of the Vector is ignored.
- @type index: int
- @ivar index: The vertex index, if owned by a mesh.
- @type sel: int
- @ivar sel: The selection state (selected:1, unselected:0) of this vertex.\n
- Note: An NMesh will return the selection state of the mesh when EditMod was last exited. A python script operating in EditMode must exit edit mode, before getting the current selection state of the mesh.
- @warn: There are two kinds of uv texture coordinates in Blender: per vertex
- ("sticky") and per face vertex (uv in L{NMFace}). In the first, there's
- only one uv pair of coordinates for each vertex in the mesh. In the
- second, for each face it belongs to, a vertex can have different uv
- coordinates. This makes the per face option more flexible, since two
- adjacent faces won't have to be mapped to a continuous region in an image:
- each face can be independently mapped to any part of its texture.
- """
-
-class NMEdge:
- """
- The NMEdge object
- =================
- This object holds mesh edge data.
- @type v1: NMVert
- @ivar v1: The first vertex of the edge.
- @type v2: NMVert
- @ivar v2: The second vertex of the edge.
- @type crease: int
- @ivar crease: The crease value of the edge. It is in the range [0,255].
- @type flag: int
- @ivar flag: The bitmask describing edge properties. See L{NMesh.EdgeFlags<EdgeFlags>}.
- """
-
-class NMFace:
- """
- The NMFace object
- =================
- This object holds mesh face data.
-
- Example::
- import Blender
- from Blender import NMesh, Window
-
- in_emode = Window.EditMode()
- if in_emode: Window.EditMode(0)
-
- me = NMesh.GetRaw("Mesh")
- faces = me.faces
-
- ## Example for editmode faces selection:
- selected_faces = []
- for f in faces:
- if f.sel:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- f.sel = 1 - f.sel # 1 becomes 0, 0 becomes 1
-
- ## Example for uv textured faces selection:
- selected_faces = []
- SEL = NMesh.FaceFlags['SELECT']
- # get selected faces:
- for f in faces:
- if f.flag & SEL:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- if f.flag & SEL:
- f.flag &=~SEL # unselect these
- else: f.flag |= SEL # and select these
-
- me.update()
- if in_emode: Window.EditMode(1)
- Blender.Redraw()
-
- @type v: list
- @ivar v: The list of face vertices (B{up to 4}).
- @type sel: bool
- @ivar sel: The selection state (1: selected, 0: unselected) of this NMesh's
- faces *in edit mode*. This is not the same as the selection state of
- the textured faces (see L{flag}).
- @type hide: bool
- @ivar hide: The visibility state (1: hidden, 0: visible) of this NMesh's
- faces *in edit mode*. This is not the same as the visibility state of
- the textured faces (see L{flag}).
- @ivar col: The list of vertex colors.
- @ivar mat: Same as I{materialIndex} below.
- @ivar materialIndex: The index of this face's material in its NMesh materials
- list.
- @ivar smooth: If non-zero, the vertex normals are averaged to make this
- face look smooth.
- @ivar image: The Image used as a texture for this face.
- @ivar mode: The display mode (see L{Mesh.FaceModes<FaceModes>})
- @ivar flag: Bit vector specifying selection / visibility flags for uv
- textured faces (visible in Face Select mode, see
- L{NMesh.FaceFlags<FaceFlags>}).
- @ivar transp: Transparency mode bit vector
- (see L{NMesh.FaceTranspModes<FaceTranspModes>}).
- @ivar uv: List of per-face UV coordinates: [(u0, v0), (u1, v1), ...].
- @ivar normal: (or just B{no}) The normal vector for this face: [x,y,z].
- @note: there are normal faces and textured faces in Blender, both currently
- with their own selection and visibility states, due to a mix of old and new
- code. To (un)select or (un)hide normal faces (visible in editmode), use
- L{sel} and L{hide} variables. For textured faces (Face Select
- mode in Blender) use the old L{flag} bitflag. Also check the
- example above and note L{Window.EditMode}.
- @note: Assigning uv textures to mesh faces in Blender works like this:
- 1. Select your mesh.
- 2. Enter face select mode (press f) and select at least some face(s).
- 3. In the UV/Image Editor window, load / select an image.
- 4. Play in both windows (better split the screen to see both at the same
- time) until the uv coordinates are where you want them. Hint: in the
- 3d window, the 'u' key opens a menu of default uv choices and the 'r'
- key lets you rotate the uv coordinates.
- 5. Leave face select mode (press f).
- """
-
- def append(vertex):
- """
- Append a vertex to this face's vertex list.
- @type vertex: NMVert
- @param vertex: An NMVert object.
- """
-
-from IDProp import IDGroup, IDArray
-class NMesh:
- """
- The NMesh Data object
- =====================
- This object gives access to mesh data in Blender. We refer to mesh as the
- object in Blender and NMesh as its Python counterpart.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- object's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
- @ivar name: The NMesh name. It's common to use this field to store extra
- data about the mesh (to be exported to another program, for example).
- @ivar materials: The list of materials used by this NMesh. See
- L{getMaterials} for important details.
- @ivar verts: The list of NMesh vertices (NMVerts).
- @ivar users: The number of Objects using (linked to) this mesh.
- @ivar faces: The list of NMesh faces (NMFaces).
- @ivar edges: A list of L{NMEdge} edges.
- @ivar mode: The mode flags for this mesh. See L{setMode}.
- @ivar subDivLevels: The [display, rendering] subdivision levels in [1, 6].
- @ivar maxSmoothAngle: The max angle for auto smoothing. See L{setMode}.
- @cvar key: The L{Key.Key} object attached to this mesh, if any.
- """
-
- def addEdge(v1, v2):
- """
- Create an edge between two vertices.
- If an edge already exists between those vertices, it is returned.
- Created edge is automatically added to edges list.
- You can only call this method if mesh has edge data.
- @note: In Blender only zero or one edge can link two vertices.
- @type v1: NMVert
- @param v1: the first vertex of the edge.
- @type v2: NMVert
- @param v2: the second vertex of the edge.
- @rtype: NMEdge
- @return: The created or already existing edge.
- """
-
- def findEdge(v1, v2):
- """
- Try to find an edge between two vertices.
- If no edge exists between v1 and v2, None is returned.
- You can only call this method if mesh has edge data.
- @type v1: NMVert
- @param v1: the first vertex of the edge.
- @type v2: NMVert
- @param v2: the second vertex of the edge.
- @rtype: NMEdge
- @return: The found edge. None if no edge was found.
- """
-
- def removeEdge(v1, v2):
- """
- Remove an edge between two vertices.
- All faces using this edge are removed from faces list.
- You can only call this method if mesh has edge data.
- @type v1: NMVert
- @param v1: the first vertex of the edge.
- @type v2: NMVert
- @param v2: the second vertex of the edge.
- """
-
- def addFace(face):
- """
- Add a face to face list and add to edge list (if edge data exists) necessary edges.
- @type face: NMFace
- @param face: the face to add to the mesh.
- @rtype: list of NMEdge
- @return: If mesh has edge data, return the list of face edges.
- """
-
- def removeFace(face):
- """
- Remove a face for face list and remove edges no more used by any other face (if edge data exists).
- @type face: NMFace
- @param face: the face to add to the mesh.
- """
-
- def addMaterial(material):
- """
- Add a new material to this NMesh's list of materials. This method is the
- slower but safer way to add materials, since it checks if the argument
- given is really a material, imposes a limit of 16 materials and only adds
- the material if it wasn't already in the list.
- @type material: Blender Material
- @param material: A Blender Material.
- """
-
- def getMaterials(what = -1):
- """
- Get this NMesh's list of materials.
- @type what: int
- @param what: determines the list's contents:
- - -1: return the current NMesh's list;
- - 0: retrieve a fresh list from the Blender mesh -- eventual
- modifications made by the script not included, unless
- L{update} is called before this method;
- - 1: like 0, but empty slots are not ignored, they are returned as
- None's.
- @note: what >= 0 also updates nmesh.materials attribute.
- @rtype: list of materials
- @return: the requested list of materials.
- @note: if a user goes to the material buttons window and removes some
- mesh's link to a material, that material slot becomes empty.
- Previously such materials were ignored.
- @note: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- """
-
- def setMaterials(matlist):
- """
- Set this NMesh's list of materials. This method checks the consistency of
- the passed list: must only have materials or None's and can't contain more
- than 16 entries.
- @type matlist: list of materials
- @param matlist: a list with materials, None's also accepted (they become
- empty material slots in Blender.
- @note: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- """
-
- def hasVertexColours(flag = None):
- """
- Get (and optionally set) if this NMesh has vertex colors.
- @type flag: int
- @param flag: If given and non-zero, the "vertex color" flag for this NMesh
- is turned I{on}.
- @rtype: bool
- @return: The current value of the "vertex color" flag.
- @warn: If a mesh has both vertex colors and textured faces, this function
- will return False. This is due to the way Blender deals internally with
- the vertex colors array (if there are textured faces, it is copied to
- the textured face structure and the original array is freed/deleted).
- If you want to know if a mesh has both textured faces and vertex
- colors, set *in Blender* the "VCol Paint" flag for each material that
- covers an area that was also vertex painted and then check in your
- Python script if that material flag is set. Of course also tell others
- who use your script to do the same. The "VCol Paint" material mode flag
- is the way to tell Blender itself to render with vertex colors, too, so
- it's a natural solution.
- """
-
- def hasFaceUV(flag = None):
- """
- Get (and optionally set) if this NMesh has UV-mapped textured faces.
- @type flag: int
- @param flag: If given and non-zero, the "textured faces" flag for this
- NMesh is turned I{on}.
- @rtype: bool
- @return: The current value of the "textured faces" flag.
- """
-
- def hasVertexUV(flag = None):
- """
- Get (and optionally set) the "sticky" flag that controls if a mesh has
- per vertex UV coordinates.
- @type flag: int
- @param flag: If given and non-zero, the "sticky" flag for this NMesh is
- turned I{on}.
- @rtype: bool
- @return: The current value of the "sticky" flag.
- """
-
- def getActiveFace():
- """
- Get the index of the active face.
- @rtype: int
- @return: The index of the active face.
- """
-
- def getSelectedFaces(flag = None):
- """
- Get list of selected faces.
- @type flag: int
- @param flag: If given and non-zero, the list will have indices instead of
- the NMFace objects themselves.
- @rtype: list
- @return: It depends on the I{flag} parameter:
- - if None or zero: List of NMFace objects.
- - if non-zero: List of indices to NMFace objects.
- @warn: this method exists to speed up retrieving of selected faces from
- the actual mesh in Blender. So, if you make changes to the nmesh, you
- need to L{update} it before using this method.
- """
-
- def getVertexInfluences(index):
- """
- Get influences of bones in a specific vertex.
- @type index: int
- @param index: The index of a vertex.
- @rtype: list of lists
- @return: List of pairs (name, weight), where name is the bone name (string)
- and its weight is a float value.
- """
-
- def getKey():
- """
- Get the Key object representing the Vertex Keys (absolute or
- relative) assigned to this mesh.
- @rtype: L{Key.Key} object or None
- """
-
- def insertKey(frame = None, type = 'relative'):
- """
- Insert a mesh key at the given frame. Remember to L{update} the nmesh
- before doing this, or changes in the vertices won't be updated in the
- Blender mesh.
- @type frame: int
- @type type: string
- @param frame: The Scene frame where the mesh key should be inserted. If
- None, the current frame is used.
- @param type: The mesh key type: 'relative' or 'absolute'. This is only
- relevant on the first call to insertKey for each nmesh (and after all
- keys were removed with L{removeAllKeys}, of course).
- @warn: This and L{removeAllKeys} were included in this release only to
- make accessing vertex keys possible, but may not be a proper solution
- and may be substituted by something better later. For example, it
- seems that 'frame' should be kept in the range [1, 100]
- (the curves can be manually tweaked in the Ipo Curve Editor window in
- Blender itself later).
- """
-
- def removeAllKeys():
- """
- Remove all mesh keys stored in this mesh.
- @rtype: bool
- @return: True if successful or False if this NMesh wasn't linked to a real
- Blender Mesh yet (or was, but the Mesh had no keys).
- @warn: Currently the mesh keys from meshes that are grabbed with
- NMesh.GetRaw() or .GetRawFromObject() are preserved, so if you want to
- clear them or don't want them at all, remember to call this method. Of
- course NMeshes created with NMesh.New() don't have mesh keys until you
- add them.
- """
-
- def update(recalc_normals = 0, store_edges = 0, vertex_shade = 0):
- """
- Update the mesh in Blender. The changes made are put back to the mesh in
- Blender, if available, or put in a newly created mesh if this NMesh wasn't
- already linked to one.
- @type recalc_normals: int (bool)
- @param recalc_normals: if nonzero the vertex normals are recalculated.
- @type store_edges: int (bool)
- @param store_edges: deprecated, edges are always stored now.
- @type vertex_shade: int (bool)
- @param vertex_shade: if nonzero vertices are colored based on the
- current lighting setup, like when there are no vertex colors and no
- textured faces and a user enters Vertex Paint Mode in Blender (only
- lamps in visible layers account). To use this functionality, be out of
- edit mode or else an error will be returned.
- @warn: edit mesh and normal mesh are two different structures in Blender,
- synchronized upon leaving or entering edit mode. Always remember to
- leave edit mode (L{Window.EditMode}) before calling this update
- method, or your changes will be lost. Even better: for the same reason
- programmers should leave EditMode B{before} getting a mesh, or changes
- made to the editmesh in Blender may not be visible to your script
- (check the example at the top of NMesh module doc).
- @warn: unlike the L{PutRaw} function, this method doesn't check validity of
- vertex, face and material lists, because it is meant to be as fast as
- possible (and already performs many tasks). So programmers should make
- sure they only feed proper data to the nmesh -- a good general
- recommendation, of course. It's also trivial to write code to check
- all data before updating, for example by comparing each item's type
- with the actual L{Types}, if you need to.
- @note: this method also redraws the 3d view and -- if 'vertex_shade' is
- nonzero -- the edit buttons window.
- @note: if your mesh disappears after it's updated, try
- L{Object.Object.makeDisplayList}. 'Subsurf' meshes (see L{getMode},
- L{setMode}) need their display lists updated, too.
- """
-
- def transform(matrix, recalc_normals = False):
- """
- Transforms the mesh by the specified 4x4 matrix, as returned by
- L{Object.Object.getMatrix}, though this will work with any invertible 4x4
- matrix type. Ideal usage for this is exporting to an external file where
- global vertex locations are required for each object.
- Sometimes external renderers or file formats do not use vertex normals.
- In this case, you can skip transforming the vertex normals by leaving
- the optional parameter recalc_normals as False or 0 ( the default value ).
-
- Example::
- # This script outputs deformed meshes worldspace vertex locations
- # for a selected object
- import Blender
- from Blender import NMesh, Object
-
- ob = Object.GetSelected()[0] # Get the first selected object
- me = NMesh.GetRawFromObject(ob.name) # Get the objects deformed mesh data
- me.transform(ob.matrix)
-
- for v in me.verts:
- print 'worldspace vert', v.co
-
- @type matrix: Py_Matrix
- @param matrix: 4x4 Matrix which can contain location, scale and rotation.
- @type recalc_normals: int (bool)
- @param recalc_normals: if True or 1, transform normals as well as vertex coordinates.
- @warn: if you call this method and later L{update} the mesh, the new
- vertex positions will be passed back to Blender, but the object
- matrix of each object linked to this mesh won't be automatically
- updated. You need to set the object transformations (rotation,
- translation and scaling) to identities, then, or the mesh data will
- be changed ("transformed twice").
- """
-
- def getMode():
- """
- Get this mesh's mode flags.
- @rtype: int
- @return: ORed value. See L{Modes}.
- """
-
- def setMode(m=None, m1=None, m2=None):
- """
- Set the mode flags for this mesh. Given mode strings turn the mode "on".
- Modes not passed in are turned "off", so setMode() (without arguments)
- unsets all mode flags.
- @type m: string or int (bitflag)
- @param m: mode string or int. An int (see L{Modes}) or from none to 3
- strings can be given:
- - "NoVNormalsFlip"
- - "TwoSided"
- - "AutoSmooth"
- """
-
- def addVertGroup(group):
- """
- Add a named and empty vertex (deform) group to the object this nmesh is
- linked to. If this nmesh was newly created or accessed with GetRaw, it must
- first be linked to an object (with object.link or NMesh.PutRaw) so the
- method knows which object to update.\n
- This is because vertex groups in Blender are stored in I{the object} --
- not in the mesh, which may be linked to more than one object. For this
- reason, it's better to use "mesh = object.getData()" than
- "mesh = NMesh.GetRaw(meshName)" to access an existing mesh.
- @type group: string
- @param group: the name for the new group.
- """
-
- def removeVertGroup(group):
- """
- Remove a named vertex (deform) group from the object linked to this nmesh.
- All vertices assigned to the group will be removed (just from the group,
- not deleted from the mesh), if any. If this nmesh was newly created, it
- must first be linked to an object (read the comment in L{addVertGroup} for
- more info).
- @type group: string
- @param group: the name of a vertex group.
- """
-
- def assignVertsToGroup(group, vertList, weight, assignmode = 'replace'):
- """
- Adds an array (a python list) of vertex points to a named vertex group
- associated with a mesh. The vertex list is a list of vertex indices from
- the mesh. You should assign vertex points to groups only when the mesh has
- all its vertex points added to it and is already linked to an object.
-
- I{B{Example:}}
- The example here adds a new set of vertex indices to a sphere primitive::
- import Blender
- sphere = Blender.Object.Get('Sphere')
- mesh = sphere.getData()
- mesh.addVertGroup('firstGroup')
- vertList = []
- for x in range(300):
- if x % 3 == 0:
- vertList.append(x)
- mesh.assignVertsToGroup('firstGroup', vertList, 0.5, 'add')
-
- @type group: string
- @param group: the name of the group.
- @type vertList: list of ints
- @param vertList: a list of vertex indices.
- @type weight: float
- @param weight: the deform weight for (which means: the amount of influence
- the group has over) the given vertices. It should be in the range
- [0.0, 1.0]. If weight <= 0, the given vertices are removed from the
- group. If weight > 1, it is clamped.
- @type assignmode: string
- @param assignmode: Three choices:
- - 'add'
- - 'subtract'
- - 'replace'\n
-
- 'B{add}': if the vertex in the list is not assigned to the group
- already, this creates a new association between this vertex and the
- group with the weight specified, otherwise the weight given is added to
- the current weight of an existing association between the vertex and
- group.\n
- 'B{subtract}' will attempt to subtract the weight passed from a vertex
- already associated with a group, else it does nothing.\n
- 'B{replace}' attempts to replace a weight with the new weight value
- for an already associated vertex/group, else it does nothing.
- """
-
- def removeVertsFromGroup(group, vertList = None):
- """
- Remove a list of vertices from the given group. If this nmesh was newly
- created, it must first be linked to an object (check L{addVertGroup}).
- @type group: string
- @param group: the name of a vertex group
- @type vertList: list of ints
- @param vertList: a list of vertex indices to be removed from the given
- 'group'. If None, all vertices are removed -- the group is emptied.
- """
-
- def getVertsFromGroup(group, weightsFlag = 0, vertList = None):
- """
- Return a list of vertex indices associated with the passed group. This
- method can be used to test whether a vertex index is part of a group and
- if so, what its weight is.
-
- I{B{Example:}}
- Append this to the example from L{assignVertsToGroup}::
- # ...
- print "Vertex indices from group %s :" % groupName
- print mesh.getVertsFromGroup('firstGroup')
- print "Again, with weights:"
- print mesh.getVertsFromGroup('firstGroup',1)
- print "Again, with weights and restricted to the given indices:"
- print mesh.getVertsFromGroup('firstGroup',1,[1,2,3,4,5,6])
-
- @type group: string
- @param group: the group name.
- @type weightsFlag: bool
- @param weightsFlag: if 1, the weight is returned along with the index.
- @type vertList: list of ints
- @param vertList: if given, only those vertex points that are both in the
- list and group passed in are returned.
- """
-
- def renameVertGroup(groupName, newName):
- """
- Renames a vertex group.
- @type groupName: string
- @param groupName: the vertex group name to be renamed.
- @type newName: string
- @param newName: the name to replace the old name.
- """
-
- def getVertGroupNames():
- """
- Return a list of all vertex group names.
- @rtype: list of strings
- @return: returns a list of strings representing all vertex group
- associated with the mesh's object
- """
-
- def getMaxSmoothAngle():
- """
- Get the max angle for auto smoothing.
- Note: This will only affect smoothing generated at render time.
- Smoothing can also be set per face which is visible in Blenders 3D View.
- @return: The value in degrees.
- """
-
- def setMaxSmoothAngle(angle):
- """
- Set the max angle for auto smoothing.
- @type angle: int
- @param angle: The new value in degrees -- it's clamped to [1, 80].
- """
-
- def getSubDivLevels():
- """
- Get the mesh subdivision levels for realtime display and rendering.
- @return: list of ints: [display, render].
- """
-
- def setSubDivLevels(subdiv):
- """
- Set the mesh subdivision levels for realtime display and rendering.
- @type subdiv: list of 2 ints
- @param subdiv: new subdiv levels: [display, render]. Both are clamped to
- lie in the range [1, 6].
- """
-
-
diff --git a/source/blender/python/api2_2x/doc/Noise.py b/source/blender/python/api2_2x/doc/Noise.py
deleted file mode 100644
index 122fdd3eda1..00000000000
--- a/source/blender/python/api2_2x/doc/Noise.py
+++ /dev/null
@@ -1,298 +0,0 @@
-# Blender.Noise submodule
-
-"""
-The Blender.Noise submodule.
-
-Noise and Turbulence
-====================
-
-This module can be used to generate noise of various types. This can be used
-for terrain generation, to create textures, make animations more 'animated',
-object deformation, etc. As an example, this code segment when scriptlinked
-to a framechanged event, will make the camera sway randomly about, by changing
-parameters this can look like anything from an earthquake to a very nervous or
-maybe even drunk cameraman... (the camera needs an ipo with at least one Loc &
-Rot key for this to work!):
-
-Example::
- from Blender import Get, Scene, Noise
- ####################################################
- # This controls jitter speed
- sl = 0.025
- # This controls the amount of position jitter
- sp = 0.1
- # This controls the amount of rotation jitter
- sr = 0.25
- ####################################################
-
- time = Get('curtime')
- ob = Scene.GetCurrent().getCurrentCamera()
- ps = (sl*time, sl*time, sl*time)
- # To add jitter only when the camera moves, use this next line instead
- #ps = (sl*ob.LocX, sl*ob.LocY, sl*ob.LocZ)
- rv = Noise.vTurbulence(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN)
- ob.dloc = (sp*rv[0], sp*rv[1], sp*rv[2])
- ob.drot = (sr*rv[0], sr*rv[1], sr*rv[2])
-
-@type NoiseTypes: readonly dictionary
-@var NoiseTypes: The available noise types.
- - BLENDER
- - STDPERLIN
- - NEWPERLIN
- - VORONOI_F1
- - VORONOI_F2
- - VORONOI_F3
- - VORONOI_F4
- - VORONOI_F2F1
- - VORONOI_CRACKLE
- - CELLNOISE
-
-@type DistanceMetrics: readonly dictionary
-@var DistanceMetrics: The available distance metrics values for Voronoi.
- - DISTANCE
- - DISTANCE_SQUARED
- - MANHATTAN
- - CHEBYCHEV
- - MINKOVSKY_HALF
- - MINKOVSKY_FOUR
- - MINKOVISKY
-"""
-
-NoiseTypes = {'BLENDER':0, 'STDPERLIN':1}
-
-DistanceMetrics = {'DISTANCE':0}
-
-def random ():
- """
- Returns a random floating point number."
- @rtype: float
- @return: a random number in [0, 1).
- """
-
-def randuvec ():
- """
- Returns a random unit vector.
- @rtype: 3-float list
- @return: a list of three floats.
- """
-
-def setRandomSeed (seed):
- """
- Initializes the random number generator.
- @type seed: int
- @param seed: the seed for the random number generator. If seed = 0, the
- current time will be used as seed, instead.
- """
-
-def noise (xyz, type = NoiseTypes['STDPERLIN']):
- """
- Returns general noise of the optional specified type.
- @type xyz: tuple of 3 floats
- @param xyz: (x,y,z) float values.
- @type type: int
- @param type: the type of noise to return. See L{NoiseTypes}.
- @rtype: float
- @return: the generated noise value.
- """
-
-def vNoise (xyz, type = NoiseTypes['STDPERLIN']):
- """
- Returns noise vector of the optional specified type.
- @type xyz: tuple of 3 floats
- @param xyz: (x,y,z) float values.
- @type type: int
- @param type: the type of noise to return. See L{NoiseTypes}.
- @rtype: 3-float list
- @return: the generated noise vector.
- """
-
-def turbulence (xyz, octaves, hard, basis = NoiseTypes['STDPERLIN'],
- ampscale = 0.5, freqscale = 2.0):
- """
- Returns general turbulence value using the optional specified noise 'basis'
- function.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type octaves: int
- @param octaves: number of noise values added.
- @type hard: bool
- @param hard: noise hardness: 0 - soft noise; 1 - hard noise. (Returned value
- is always positive.)
- @type basis: int
- @param basis: type of noise used for turbulence, see L{NoiseTypes}.
- @type ampscale: float
- @param ampscale: amplitude scale value of the noise frequencies added.
- @type freqscale: float
- @param freqscale: frequency scale factor.
- @rtype: float
- @return: the generated turbulence value.
- """
-
-def vTurbulence (xyz, octaves, hard, basis = NoiseTypes['STDPERLIN'], ampscale = 0.5, freqscale = 2.0):
- """
- Returns general turbulence vector using the optional specified noise basis function.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type octaves: int
- @param octaves: number of noise values added.
- @type hard: bool
- @param hard: noise hardness: 0 - soft noise; 1 - hard noise. (Returned
- vector is always positive.)
- @type basis: int
- @param basis: type of noise used for turbulence, see L{NoiseTypes}.
- @type ampscale: float
- @param ampscale: amplitude scale value of the noise frequencies added.
- @type freqscale: float
- @param freqscale: frequency scale factor.
- @rtype: 3-float list
- @return: the generated turbulence vector.
- """
-
-def fBm (xyz, H, lacunarity, octaves, basis = NoiseTypes['STDPERLIN']):
- """
- Returns Fractal Brownian Motion noise value (fBm).
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type H: float
- @param H: the fractal increment parameter.
- @type lacunarity: float
- @param lacunarity: the gap between successive frequencies.
- @type octaves: float
- @param octaves: the number of frequencies in the fBm.
- @type basis: int
- @param basis: type of noise used for the turbulence, see L{NoiseTypes}.
- @rtype: float
- @return: the generated noise value.
- """
-
-def multiFractal (xyz, H, lacunarity, octaves, basis = NoiseTypes['STDPERLIN']):
- """
- Returns Multifractal noise value.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type H: float
- @param H: the highest fractal dimension.
- @type lacunarity: float
- @param lacunarity: the gap between successive frequencies.
- @type octaves: float
- @param octaves: the number of frequencies in the fBm.
- @type basis: int
- @param basis: type of noise used for the turbulence, see L{NoiseTypes}.
- @rtype: float
- @return: the generated noise value.
- """
-
-def vlNoise (xyz, distortion, type1 = NoiseTypes['STDPERLIN'],
- type2 = NoiseTypes['STDPERLIN']):
- """
- Returns Variable Lacunarity Noise value, a distorted variety of noise.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type distortion: float
- @param distortion: the amount of distortion.
- @type type1: int
- @type type2: int
- @param type1: sets the noise type to distort.
- @param type2: sets the noise type used for the distortion.
- @rtype: float
- @return: the generated noise value.
- """
-
-def heteroTerrain (xyz, H, lacunarity, octaves, offset,
- basis = NoiseTypes['STDPERLIN']):
- """
- Returns Heterogeneous Terrain value.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type H: float
- @param H: fractal dimension of the roughest areas.
- @type lacunarity: float
- @param lacunarity: gap between successive frequencies.
- @type octaves: float
- @param octaves: number of frequencies in the fBm.
- @type offset: float
- @param offset: it raises the terrain from 'sea level'.
- @type basis: int
- @param basis: noise basis determines the type of noise used for the
- turbulence, see L{NoiseTypes}.
- @rtype: float
- @return: the generated value.
- """
-
-def hybridMFractal (xyz, H, lacunarity, octaves, offset, gain,
- basis = NoiseTypes['STDPERLIN']):
- """
- Returns Hybrid Multifractal value.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type H: float
- @param H: fractal dimension of the roughest areas.
- @type lacunarity: float
- @param lacunarity: gap between successive frequencies.
- @type octaves: float
- @param octaves: number of frequencies in the fBm.
- @type offset: float
- @param offset: it raises the terrain from 'sea level'.
- @type gain: float
- @param gain: scale factor.
- @type basis: int
- @param basis: noise basis determines the type of noise used for the
- turbulence, see L{NoiseTypes}.
- @rtype: float
- @return: the generated value.
- """
-
-def ridgedMFractal (xyz, H, lacunarity, octaves, offset, gain,
- basis = NoiseTypes['STDPERLIN']):
- """
- Returns Ridged Multifractal value.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type H: float
- @param H: fractal dimension of the roughest areas.
- @type lacunarity: float
- @param lacunarity: gap between successive frequencies.
- @type octaves: float
- @param octaves: number of frequencies in the fBm.
- @type offset: float
- @param offset: it raises the terrain from 'sea level'.
- @type gain: float
- @param gain: scale factor.
- @type basis: int
- @param basis: noise basis determines the type of noise used for the
- turbulence, see L{NoiseTypes}.
- @rtype: float
- @return: the generated value.
- """
-
-def voronoi(xyz, distance_metric = DistanceMetrics['DISTANCE'], exponent = 2.5):
- """
- Returns Voronoi diagrams-related data.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @type distance_metric: int
- @param distance_metric: see L{DistanceMetrics}
- @type exponent: float
- @param exponent: only used with MINKOVSKY, default is 2.5.
- @rtype: list
- @return: a list containing a list of distances in order of closest feature,
- and a list containing the positions of the four closest features.
- """
-
-def cellNoise (xyz):
- """
- Returns cellnoise.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @rtype: float
- @return: the generated value.
- """
-
-def cellNoiseV (xyz):
- """
- Returns cellnoise vector/point/color.
- @type xyz: 3-float tuple
- @param xyz: (x,y,z) float values.
- @rtype: 3-float list
- @return: the generated vector.
- """
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
deleted file mode 100644
index c5ce7a4d2bf..00000000000
--- a/source/blender/python/api2_2x/doc/Object.py
+++ /dev/null
@@ -1,1790 +0,0 @@
-# Blender.Object module and the Object PyType object
-
-"""
-The Blender.Object submodule
-
-B{New}:
- - Addition of attributes for particle deflection, softbodies, and
- rigidbodies.
- - Objects now increment the Blender user count when they are created and
- decremented it when they are destroyed. This means Python scripts can
- keep the object "alive" if it is deleted in the Blender GUI.
- - L{Object.getData} now accepts two optional bool keyword argument to
- define (1) if the user wants the data object or just its name
- and (2) if a mesh object should use NMesh or Mesh.
- - L{Object.clearScriptLinks} accepts a parameter now.
- - Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
- added the easier L{layers<Object.Object.layers>}. The old form "Layer"
- will continue to work.
-
-
-Object
-======
-
-This module provides access to the B{Objects} in Blender.
-
-Example::
-
- import Blender
- scn = Blender.Scene.GetCurrent() # get the current scene
- cam = Blender.Camera.New('ortho') # make ortho camera data object
- ob = scn.objects.new(cam) # make a new object in this scene using the camera data
- ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
-
- Blender.Redraw() # redraw the scene to show the updates.
-
-@type DrawModes: readonly dictionary
-@var DrawModes: Constant dict used for with L{Object.drawMode} bitfield
- attribute. Values can be ORed together. Individual bits can also
- be set/cleared with boolean attributes.
- - AXIS: Enable display of active object's center and axis.
- - TEXSPACE: Enable display of active object's texture space.
- - NAME: Enable display of active object's name.
- - WIRE: Enable the active object's wireframe over solid drawing.
- - XRAY: Enable drawing the active object in front of others.
- - TRANSP: Enable transparent materials for the active object (mesh only).
-
-@type DrawTypes: readonly dictionary
-@var DrawTypes: Constant dict used for with L{Object.drawType} attribute.
- Only one type can be selected at a time.
- - BOUNDBOX: Only draw object with bounding box
- - WIRE: Draw object in wireframe
- - SOLID: Draw object in solid
- - SHADED: Draw object with shaded or textured
-
-@type ParentTypes: readonly dictionary
-@var ParentTypes: Constant dict used for with L{Object.parentType} attribute.
- - OBJECT: Object parent type.
- - CURVE: Curve deform parent type.
- - LATTICE: Lattice deform parent type. Note: This is the same as ARMATURE, 2.43 was released with LATTICE as an invalid value.
- - ARMATURE: Armature deform parent type.
- - VERT1: 1 mesh vert parent type.
- - VERT3: 1 mesh verts parent type.
- - BONE: Armature bone parent type.
-
-
-@type ProtectFlags: readonly dictionary
-@var ProtectFlags: Constant dict used for with L{Object.protectFlags} attribute.
- Values can be ORed together.
- - LOCX, LOCY, LOCZ: lock x, y or z location individually
- - ROTX, ROTY, ROTZ: lock x, y or z rotation individually
- - SCALEX, SCALEY, SCALEZ: lock x, y or z scale individually
- - LOC, ROT, SCALE: lock all 3 attributes for location, rotation or scale
-
-@type PITypes: readonly dictionary
-@var PITypes: Constant dict used for with L{Object.piType} attribute.
- Only one type can be selected at a time.
- - NONE: No force influence on particles
- - FORCE: Object center attracts or repels particles ("Spherical")
- - VORTEX: Particles swirl around Z-axis of the object
- - WIND: Constant force applied in direction of object Z axis
- - GUIDE: Use a Curve Path to guide particles
-
-@type RBFlags: readonly dictionary
-@var RBFlags: Constant dict used for with L{Object.rbFlags} attribute.
- Values can be ORed together.
- - SECTOR: All game elements should be in the Sector boundbox
- - PROP: An Object fixed within a sector
- - BOUNDS: Specify a bounds object for physics
- - ACTOR: Enables objects that are evaluated by the engine
- - DYNAMIC: Enables motion defined by laws of physics (requires ACTOR)
- - GHOST: Enable objects that don't restitute collisions (requires ACTOR)
- - MAINACTOR: Enables MainActor (requires ACTOR)
- - RIGIDBODY: Enable rolling physics (requires ACTOR, DYNAMIC)
- - COLLISION_RESPONSE: Disable auto (de)activation (requires ACTOR, DYNAMIC)
- - USEFH: Use Fh settings in Materials (requires ACTOR, DYNAMIC)
- - ROTFH: Use face normal to rotate Object (requires ACTOR, DYNAMIC)
- - ANISOTROPIC: Enable anisotropic friction (requires ACTOR, DYNAMIC)
- - CHILD: reserved
-
-@type IpoKeyTypes: readonly dictionary
-@var IpoKeyTypes: Constant dict used for with L{Object.insertIpoKey} attribute.
- Values can be ORed together.
- - LOC
- - ROT
- - SIZE
- - LOCROT
- - LOCROTSIZE
- - LAYER
- - PI_STRENGTH
- - PI_FALLOFF
- - PI_SURFACEDAMP
- - PI_RANDOMDAMP
- - PI_PERM
-
-@type RBShapes: readonly dictionary
-@var RBShapes: Constant dict used for with L{Object.rbShapeBoundType}
- attribute. Only one type can be selected at a time. Values are
- BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON
-
-@type EmptyShapes: readonly dictionary
-@var EmptyShapes: Constant dict used for with L{Object.emptyShape} attribute.
- Only one type can be selected at a time. Values are
- ARROW, ARROWS, AXES, CIRCLE, CONE, CUBE AND SPHERE
-"""
-
-def New (type, name='type'):
- """
- Creates a new Object. Deprecated; instead use Scene.objects.new().
- @type type: string
- @param type: The Object type: 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
- 'Mball', 'Mesh', 'Surf' or 'Empty'.
- @type name: string
- @param name: The name of the object. By default, the name will be the same
- as the object type.
- If the name is already in use, this new object will have a number at the end of the name.
- @return: The created Object.
-
- I{B{Example:}}
-
- The example below creates a new Lamp object and puts it at the default
- location (0, 0, 0) in the current scene::
- import Blender
-
- object = Blender.Object.New('Lamp')
- lamp = Blender.Lamp.New('Spot')
- object.link(lamp)
- sce = Blender.Scene.GetCurrent()
- sce.link(object)
-
- Blender.Redraw()
- @Note: if an object is created but is not linked to object data, and the
- object is not linked to a scene, it will be deleted when the Python
- object is deallocated. This is because Blender does not allow objects
- to exist without object data unless they are Empty objects. Scene.link()
- will automatically create object data for an object if it has none.
- """
-
-def Get (name = None):
- """
- Get the Object from Blender.
- @type name: string
- @param name: The name of the requested Object.
- @return: It depends on the 'name' parameter:
- - (name): The Object with the given name;
- - (): A list with all Objects in the current scene.
-
- I{B{Example 1:}}
-
- The example below works on the default scene. The script returns the plane object and prints the location of the plane::
- import Blender
-
- object = Blender.Object.Get ('plane')
- print object.getLocation()
-
- I{B{Example 2:}}
-
- The example below works on the default scene. The script returns all objects
- in the scene and prints the list of object names::
- import Blender
-
- objects = Blender.Object.Get ()
- print objects
- @note: Get will return objects from all scenes.
- Most user tools should only operate on objects from the current scene - Blender.Scene.GetCurrent().getChildren()
- """
-
-def GetSelected ():
- """
- Get the user selection. If no objects are selected, an empty list will be returned.
-
- @return: A list of all selected Objects in the current scene.
-
- I{B{Example:}}
-
- The example below works on the default scene. Select one or more objects and
- the script will print the selected objects::
- import Blender
-
- objects = Blender.Object.GetSelected()
- print objects
- @note: The active object will always be the first object in the list (if selected).
- @note: The user selection is made up of selected objects from Blender's current scene only.
- @note: The user selection is limited to objects on visible layers;
- if the user's last active 3d view is in localview then the selection will be limited to the objects in that localview.
- """
-
-
-def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0):
- """
- Duplicate selected objects on visible layers from Blenders current scene,
- de-selecting the currently visible, selected objects and making a copy where all new objects are selected.
- By default no data linked to the object is duplicated; use the keyword arguments to change this.
- L{Object.GetSelected()<GetSelected>} will return the list of objects resulting from duplication.
-
- B{Note}: This command will raise an error if used from the command line (background mode) because it uses the 3D view context.
-
- @type mesh: bool
- @param mesh: When non-zero, mesh object data will be duplicated with the objects.
- @type surface: bool
- @param surface: When non-zero, surface object data will be duplicated with the objects.
- @type curve: bool
- @param curve: When non-zero, curve object data will be duplicated with the objects.
- @type text: bool
- @param text: When non-zero, text object data will be duplicated with the objects.
- @type metaball: bool
- @param metaball: When non-zero, metaball object data will be duplicated with the objects.
- @type armature: bool
- @param armature: When non-zero, armature object data will be duplicated with the objects.
- @type lamp: bool
- @param lamp: When non-zero, lamp object data will be duplicated with the objects.
- @type material: bool
- @param material: When non-zero, materials used by the object or its object data will be duplicated with the objects.
- @type texture: bool
- @param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects.
- @type ipo: bool
- @param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects.
-
- I{B{Example:}}
-
- The example below creates duplicates the active object 10 times
- and moves each object 1.0 on the X axis::
- import Blender
-
- scn = Scene.GetCurrent()
- ob_act = scn.objects.active
-
- # Unselect all
- scn.objects.selected = []
- ob_act.sel = 1
-
- for x in xrange(10):
- Blender.Object.Duplicate() # Duplicate linked
- ob_act = scn.objects.active
- ob_act.LocX += 1
- Blender.Redraw()
- """
-
-from IDProp import IDGroup, IDArray
-class Object:
- """
- The Object object
- =================
- This object gives access to generic data from all objects in Blender.
-
- B{Note}:
- When dealing with properties and functions such as LocX/RotY/getLocation(), getSize() and getEuler(),
- keep in mind that these transformation properties are relative to the object itself, ignoring any other transformations.
-
- To get these values in worldspace (taking into account vertex parents, constraints, etc.)
- pass the argument 'worldspace' to these functions.
-
- @ivar restrictDisplay: Don't display this object in the 3D view: disabled by default, use the outliner to toggle.
- @type restrictDisplay: bool
- @ivar restrictSelect: Don't select this object in the 3D view: disabled by default, use the outliner to toggle.
- @type restrictSelect: bool
- @ivar restrictRender: Don't render this object: disabled by default, use the outliner to toggle.
- @type restrictRender: bool
- @ivar LocX: The X location coordinate of the object.
- @type LocX: float
- @ivar LocY: The Y location coordinate of the object.
- @type LocY: float
- @ivar LocZ: The Z location coordinate of the object.
- @type LocZ: float
- @ivar loc: The (X,Y,Z) location coordinates of the object.
- @type loc: tuple of 3 floats
- @ivar dLocX: The delta X location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocX: float
- @ivar dLocY: The delta Y location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocY: float
- @ivar dLocZ: The delta Z location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocZ: float
- @ivar dloc: The delta (X,Y,Z) location coordinates of the object (vector).
- This variable applies to IPO Objects only.
- @type dloc: tuple of 3 floats
- @ivar RotX: The X rotation angle (in radians) of the object.
- @type RotX: float
- @ivar RotY: The Y rotation angle (in radians) of the object.
- @type RotY: float
- @ivar RotZ: The Z rotation angle (in radians) of the object.
- @type RotZ: float
- @ivar rot: The (X,Y,Z) rotation angles (in radians) of the object.
- @type rot: euler (Py_WRAPPED)
- @ivar dRotX: The delta X rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotX: float
- @ivar dRotY: The delta Y rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotY: float
- @ivar dRotZ: The delta Z rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotZ: float
- @ivar drot: The delta (X,Y,Z) rotation angles (in radians) of the object.
- This variable applies to IPO Objects only.
- @type drot: tuple of 3 floats
- @ivar SizeX: The X size of the object.
- @type SizeX: float
- @ivar SizeY: The Y size of the object.
- @type SizeY: float
- @ivar SizeZ: The Z size of the object.
- @type SizeZ: float
- @ivar size: The (X,Y,Z) size of the object.
- @type size: tuple of 3 floats
- @ivar dSizeX: The delta X size of the object.
- @type dSizeX: float
- @ivar dSizeY: The delta Y size of the object.
- @type dSizeY: float
- @ivar dSizeZ: The delta Z size of the object.
- @type dSizeZ: float
- @ivar dsize: The delta (X,Y,Z) size of the object.
- @type dsize: tuple of 3 floats
- @ivar Layers: The object layers (also check the newer attribute
- L{layers<layers>}). This value is a bitmask with at
- least one position set for the 20 possible layers starting from the low
- order bit. The easiest way to deal with these values in in hexadecimal
- notation.
- Example::
- ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
- After setting the Layer value, call Blender.Redraw( -1 ) to update
- the interface.
- @type Layers: integer (bitmask)
- @type layers: list of integers
- @ivar layers: The layers this object is visible in (also check the older
- attribute L{Layers<Layers>}). This returns a list of
- integers in the range [1, 20], each number representing the respective
- layer. Setting is done by passing a list of ints or an empty list for
- no layers.
- Example::
- ob.layers = [] # object won't be visible
- ob.layers = [1, 4] # object visible only in layers 1 and 4
- ls = o.layers
- ls.append(10)
- o.layers = ls
- print ob.layers # will print: [1, 4, 10]
- B{Note}: changes will only be visible after the screen (at least
- the 3d View and Buttons windows) is redrawn.
- @ivar parent: The parent object of the object (if defined). Read-only.
- @type parent: Object or None
- @ivar data: The Datablock object linked to this object. Read-only.
- @type data: varies
- @ivar ipo: Contains the Ipo if one is assigned to the object, B{None}
- otherwise. Setting to B{None} clears the current Ipo.
- @type ipo: Ipo
- @ivar mat: The matrix of the object in world space (absolute, takes vertex parents, tracking
- and Ipos into account). Read-only.
- @type mat: Matrix
- @ivar matrix: Same as L{mat}. Read-only.
- @type matrix: Matrix
- @ivar matrixLocal: The matrix of the object relative to its parent; if there is no parent,
- returns the world matrix (L{matrixWorld<Object.Object.matrixWorld>}).
- @type matrixLocal: Matrix
- @ivar matrixParentInverse: The inverse if the parents local matrix, set when the objects parent is set (wrapped).
- @type matrixParentInverse: Matrix
- @ivar matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34).
- Read-only.
- @type matrixOldWorld: Matrix
- @ivar matrixWorld: Same as L{mat}. Read-only.
- @type matrixWorld: Matrix
- @ivar colbits: The Material usage mask. A set bit #n means: the Material
- #n in the Object's material list is used. Otherwise, the Material #n
- of the Objects Data material list is displayed.
- Example::
- object.colbits = (1<<0) + (1<<5) # use mesh materials 0 (1<<0) and 5 (1<<5)
- # use object materials for all others
- @ivar sel: The selection state of the object in the current scene.
- True is selected, False is unselected. Setting makes the object active.
- @type sel: boolean
- @ivar effects: The list of particle effects associated with the object. (depricated, will always return an empty list)
- Read-only.
- @type effects: list of Effect objects
- @ivar parentbonename: The string name of the parent bone (if defined).
- This can be set to another bone in the armature if the object already has a bone parent.
- @type parentbonename: string or None
- @ivar parentVertexIndex: A list of vertex parent indicies, with a length of 0, 1 or 3. When there are 1 or 3 vertex parents, the indicies can be assigned to a sequence of the same length.
- @type parentVertexIndex: list
- @ivar protectFlags: The "transform locking" bitfield flags for the object.
- See L{ProtectFlags} const dict for values.
- @type protectFlags: int
- @ivar DupGroup: The DupliGroup Animation Property. Assign a group to
- DupGroup to make this object an instance of that group.
- This does not enable or disable the DupliGroup option, for that use
- L{enableDupGroup}.
- The attribute returns None when this object does not have a dupliGroup,
- and setting the attrbute to None deletes the object from the group.
- @type DupGroup: Group or None
- @ivar DupObjects: The Dupli object instances. Read-only.
- Returns of list of tuples for object duplicated
- by dupliframe, dupliverts dupligroups and other animation properties.
- The first tuple item is the original object that is duplicated,
- the second is the 4x4 worldspace dupli-matrix.
- Example::
- import Blender
- from Blender import Object, Scene, Mathutils
-
- ob= Object.Get('Cube')
- dupe_obs= ob.DupObjects
- scn= Scene.GetCurrent()
- for dupe_ob, dupe_matrix in dupe_obs:
- print dupe_ob.name
- empty_ob = scn.objects.new('Empty')
- empty_ob.setMatrix(dupe_matrix)
- Blender.Redraw()
- @type DupObjects: list of tuples containing (object, matrix)
- @ivar enableNLAOverride: Whether the object uses NLA or active Action for animation. When True the NLA is used.
- @type enableNLAOverride: boolean
- @ivar enableDupVerts: The DupliVerts status of the object.
- Does not indicate that this object has any dupliVerts,
- (as returned by L{DupObjects}) just that dupliVerts are enabled.
- @type enableDupVerts: boolean
- @ivar enableDupFaces: The DupliFaces status of the object.
- Does not indicate that this object has any dupliFaces,
- (as returned by L{DupObjects}) just that dupliFaces are enabled.
- @type enableDupFaces: boolean
- @ivar enableDupFacesScale: The DupliFacesScale status of the object.
- @type enableDupFacesScale: boolean
- @ivar dupFacesScaleFac: Scale factor for dupliface instance, 1.0 by default.
- @type dupFacesScaleFac: float
- @ivar enableDupFrames: The DupliFrames status of the object.
- Does not indicate that this object has any dupliFrames,
- (as returned by L{DupObjects}) just that dupliFrames are enabled.
- @type enableDupFrames: boolean
- @ivar enableDupGroup: The DupliGroup status of the object.
- Set True to make this object an instance of the object's L{DupGroup},
- and set L{DupGroup} to a group for this to take effect,
- Use L{DupObjects} to get the object data from this instance.
- @type enableDupGroup: boolean
- @ivar enableDupRot: The DupliRot status of the object.
- Use with L{enableDupVerts} to rotate each instance
- by the vertex normal.
- @type enableDupRot: boolean
- @ivar enableDupNoSpeed: The DupliNoSpeed status of the object.
- Use with L{enableDupFrames} to ignore dupliFrame speed.
- @type enableDupNoSpeed: boolean
- @ivar DupSta: The DupliFrame starting frame. Use with L{enableDupFrames}.
- Value clamped to [1,32767].
- @type DupSta: int
- @ivar DupEnd: The DupliFrame end frame. Use with L{enableDupFrames}.
- Value clamped to [1,32767].
- @type DupEnd: int
- @ivar DupOn: The DupliFrames in succession between DupOff frames.
- Value is clamped to [1,1500].
- Use with L{enableDupFrames} and L{DupOff} > 0.
- @type DupOn: int
- @ivar DupOff: The DupliFrame removal of every Nth frame for this object.
- Use with L{enableDupFrames}. Value is clamped to [0,1500].
- @type DupOff: int
- @ivar passIndex: Index # for the IndexOB render pass.
- Value is clamped to [0,1000].
- @type passIndex: int
- @ivar activeMaterial: The active material index for this object.
-
- The active index is used to select the material to edit in the material buttons,
- new data created will also use the active material.
-
- Value is clamped to [1,len(ob.materials)]. - [0,0] when there is no materials applied to the object.
- @type activeMaterial: int
- @ivar activeShape: The active shape key index for this object.
-
- The active index is used to select the material to edit in the material buttons,
- new data created will also use the active material.
-
- Value is clamped to [1,len(ob.data.key.blocks)]. - [0,0] when there are no keys.
-
- @type activeShape: int
-
- @ivar pinShape: If True, only the activeShape will be displayed.
- @type pinShape: bool
- @ivar drawSize: The size to display the Empty.
- Value clamped to [0.01,10.0].
- @type drawSize: float
- @ivar modifiers: The modifiers associated with the object.
- Example::
- # copy the active objects modifiers to all other visible selected objects
- from Blender import *
- scn = Scene.GetCurrent()
- ob_act = scn.objects.active
- for ob in scn.objects.context:
- # Cannot copy modifiers to an object of a different type
- if ob.type == ob_act.type:
- ob.modifiers = ob_act.modifiers
- @type modifiers: L{Modifier Sequence<Modifier.ModSeq>}
- @ivar constraints: a L{sequence<Constraint.Constraints>} of
- L{constraints<Constraint.Constraint>} for the object. Read-only.
- @type constraints: Constraint Sequence
- @ivar actionStrips: a L{sequence<NLA.ActionStrips>} of
- L{action strips<NLA.ActionStrip>} for the object. Read-only.
- @type actionStrips: BPy_ActionStrips
- @ivar action: The action associated with this object (if defined).
- @type action: L{Action<NLA.Action>} or None
- @ivar oopsLoc: Object's (X,Y) OOPs location. Returns None if object
- is not found in list.
- @type oopsLoc: tuple of 2 floats
- @ivar oopsSel: Object OOPs selection flag.
- @type oopsSel: boolean
- @ivar game_properties: The object's properties. Read-only.
- @type game_properties: list of Properties.
- @ivar timeOffset: The time offset of the object's animation.
- Value clamped to [-300000.0,300000.0].
- @type timeOffset: float
- @ivar track: The object's tracked object. B{None} is returned if no
- object is tracked. Also, assigning B{None} clear the tracked object.
- @type track: Object or None
- @ivar type: The object's type. Read-only.
- @type type: string
- @ivar boundingBox: The bounding box of this object. Read-only.
- @type boundingBox: list of 8 3D vectors
- @ivar drawType: The object's drawing type.
- See L{DrawTypes} constant dict for values.
- @type drawType: int
- @ivar emptyShape: The empty drawing shape.
- See L{EmptyShapes} constant dict for values.
- @ivar parentType: The object's parent type. Read-only.
- See L{ParentTypes} constant dict for values.
- @type parentType: int
- @ivar axis: Enable display of active object's center and axis.
- Also see B{AXIS} bit in L{drawMode} attribute.
- @type axis: boolean
- @ivar texSpace: Enable display of active object's texture space.
- Also see B{TEXSPACE} bit in L{drawMode} attribute.
- @type texSpace: boolean
- @ivar nameMode: Enable display of active object's name.
- Also see B{NAME} bit in L{drawMode} attribute.
- @type nameMode: boolean
- @ivar wireMode: Enable the active object's wireframe over solid drawing.
- Also see B{WIRE} bit in L{drawMode} attribute.
- @type wireMode: boolean
- @ivar xRay: Enable drawing the active object in front of others.
- Also see B{XRAY} bit in L{drawMode} attribute.
- @type xRay: boolean
- @ivar transp: Enable transparent materials for the active object
- (mesh only). Also see B{TRANSP} bit in L{drawMode} attribute.
- @type transp: boolean
- @ivar color: Object color used by the game engine and optionally for materials, 4 floats for RGBA object color.
- @type color: tuple of 4 floats between 0 and 1
- @ivar drawMode: The object's drawing mode bitfield.
- See L{DrawModes} constant dict for values.
- @type drawMode: int
-
- @ivar piType: Type of particle interaction.
- See L{PITypes} constant dict for values.
- @type piType: int
- @ivar piFalloff: The particle interaction falloff power.
- Value clamped to [0.0,10.0].
- @type piFalloff: float
- @ivar piMaxDist: Max distance for the particle interaction field to work.
- Value clamped to [0.0,1000.0].
- @type piMaxDist: float
- @ivar piPermeability: Probability that a particle will pass through the
- mesh. Value clamped to [0.0,1.0].
- @type piPermeability: float
- @ivar piRandomDamp: Random variation of particle interaction damping.
- Value clamped to [0.0,1.0].
- @type piRandomDamp: float
- @ivar piSoftbodyDamp: Damping factor for softbody deflection.
- Value clamped to [0.0,1.0].
- @type piSoftbodyDamp: float
- @ivar piSoftbodyIThick: Inner face thickness for softbody deflection.
- Value clamped to [0.001,1.0].
- @type piSoftbodyIThick: float
- @ivar piSoftbodyOThick: Outer face thickness for softbody deflection.
- Value clamped to [0.001,1.0].
- @type piSoftbodyOThick: float
- @ivar piStrength: Particle interaction force field strength.
- Value clamped to [0.0,1000.0].
- @type piStrength: float
- @ivar piSurfaceDamp: Amount of damping during particle collision.
- Value clamped to [0.0,1.0].
- @type piSurfaceDamp: float
- @ivar piUseMaxDist: Use a maximum distance for the field to work.
- @type piUseMaxDist: boolean
-
- @ivar isSoftBody: True if object is a soft body. Read-only.
- @type isSoftBody: boolean
- @ivar SBDefaultGoal: Default softbody goal value, when no vertex group used.
- Value clamped to [0.0,1.0].
- @type SBDefaultGoal: float
- @ivar SBErrorLimit: Softbody Runge-Kutta ODE solver error limit (low values give more precision).
- Value clamped to [0.01,1.0].
- @type SBErrorLimit: float
- @ivar SBFriction: General media friction for softbody point movements.
- Value clamped to [0.0,10.0].
- @type SBFriction: float
- @ivar SBGoalFriction: Softbody goal (vertex target position) friction.
- Value clamped to [0.0,10.0].
- @type SBGoalFriction: float
- @ivar SBGoalSpring: Softbody goal (vertex target position) spring stiffness.
- Value clamped to [0.0,0.999].
- @type SBGoalSpring: float
- @ivar SBGrav: Apply gravitation to softbody point movement.
- Value clamped to [0.0,10.0].
- @type SBGrav: float
- @ivar SBInnerSpring: Softbody edge spring stiffness.
- Value clamped to [0.0,0.999].
- @type SBInnerSpring: float
- @ivar SBInnerSpringFrict: Softbody edge spring friction.
- Value clamped to [0.0,10.0].
- @type SBInnerSpringFrict: float
- @ivar SBMass: Softbody point mass (heavier is slower).
- Value clamped to [0.001,50.0].
- @type SBMass: float
- @ivar SBMaxGoal: Softbody goal maximum (vertex group weights scaled to
- match this range). Value clamped to [0.0,1.0].
- @type SBMaxGoal: float
- @ivar SBMinGoal: Softbody goal minimum (vertex group weights scaled to
- match this range). Value clamped to [0.0,1.0].
- @type SBMinGoal: float
- @ivar SBSpeed: Tweak timing for physics to control softbody frequency and
- speed. Value clamped to [0.0,10.0].
- @type SBSpeed: float
- @ivar SBStiffQuads: Softbody adds diagonal springs on 4-gons enabled.
- @type SBStiffQuads: boolean
- @ivar SBUseEdges: Softbody use edges as springs enabled.
- @type SBUseEdges: boolean
- @ivar SBUseGoal: Softbody forces for vertices to stick to animated position enabled.
- @type SBUseGoal: boolean
-
- @ivar rbFlags: Rigid body bitfield. See L{RBFlags} for valid values.
- @type rbFlags: int
- @ivar rbMass: Rigid body mass. Must be a positive value.
- @type rbMass: float
- @ivar rbRadius: Rigid body bounding sphere size. Must be a positive
- value.
- @type rbRadius: float
- @ivar rbShapeBoundType: Rigid body shape bound type. See L{RBShapes}
- const dict for values.
- @type rbShapeBoundType: int
- @ivar trackAxis: Track axis. Return string 'X' | 'Y' | 'Z' | '-X' | '-Y' | '-Z' (readonly)
- @type trackAxis: string
- @ivar upAxis: Up axis. Return string 'Y' | 'Y' | 'Z' (readonly)
- @type upAxis: string
- """
- def getParticleSystems():
- """
- Return a list of particle systems linked to this object (see Blender.Particle).
- """
-
- def newParticleSystem(name = None):
- """
- Link a particle system (see Blender.Particle). If no name is
- given, a new particle system is created. If a name is given and a
- particle system with that name exists, it is linked to the object.
- @type name: string
- @param name: The name of the requested Particle system (optional).
- """
-
- def addVertexGroupsFromArmature(object):
- """
- Add vertex groups from armature using the bone heat method
- This method can be only used with an Object of the type Mesh when NOT in edit mode.
- @type object: a bpy armature
- """
-
- def buildParts():
- """
- Recomputes the particle system. This method only applies to an Object of
- the type Effect. (depricated, does nothing now, use makeDisplayList instead to update the modifier stack)
- """
-
- def insertShapeKey():
- """
- Insert a Shape Key in the current object. It applies to Objects of
- the type Mesh, Lattice, or Curve.
- """
-
- def getPose():
- """
- Gets the current Pose of the object.
- @rtype: Pose object
- @return: the current pose object
- """
-
- def evaluatePose(framenumber):
- """
- Evaluates the Pose based on its currently bound action at a certain frame.
- @type framenumber: Int
- @param framenumber: The frame number to evaluate to.
- """
-
- def clearIpo():
- """
- Unlinks the ipo from this object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def clrParent(mode = 0, fast = 0):
- """
- Clears parent object.
- @type mode: Integer
- @type fast: Integer
- @param mode: A mode flag. If mode flag is 2, then the object transform will
- be kept. Any other value, or no value at all will update the object
- transform.
- @param fast: If the value is 0, the scene hierarchy will not be updated. Any
- other value, or no value at all will update the scene hierarchy.
- """
-
- def getData(name_only=False, mesh=False):
- """
- Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
- Object. If the keyword parameter B{name_only} is True, only the Datablock
- name is returned as a string. It the object is of type Mesh, then the
- B{mesh} keyword can also be used; the data return is a Mesh object if
- True, otherwise it is an NMesh object (the default).
- The B{mesh} keyword is ignored for non-mesh objects.
- @type name_only: bool
- @param name_only: This is a keyword parameter. If True (or nonzero),
- only the name of the data object is returned.
- @type mesh: bool
- @param mesh: This is a keyword parameter. If True (or nonzero),
- a Mesh data object is returned.
- @rtype: specific Object type or string
- @return: Depends on the type of Datablock linked to the Object. If
- B{name_only} is True, it returns a string.
- @note: Mesh is faster than NMesh because Mesh is a thin wrapper.
- @note: This function is different from L{NMesh.GetRaw} and L{Mesh.Get}
- because it keeps a link to the original mesh, which is needed if you are
- dealing with Mesh weight groups.
- @note: Make sure the object you are getting the data from isn't in
- EditMode before calling this function; otherwise you'll get the data
- before entering EditMode. See L{Window.EditMode}.
- """
-
- def getParentBoneName():
- """
- Returns None, or the 'sub-name' of the parent (eg. Bone name)
- @return: string
- """
-
- def getDeltaLocation():
- """
- Returns the object's delta location in a list (x, y, z)
- @rtype: A vector triple
- @return: (x, y, z)
- """
-
- def getDrawMode():
- """
- Returns the object draw mode.
- @rtype: Integer
- @return: a sum of the following:
- - 2 - axis
- - 4 - texspace
- - 8 - drawname
- - 16 - drawimage
- - 32 - drawwire
- - 64 - xray
- """
-
- def getDrawType():
- """
- Returns the object draw type
- @rtype: Integer
- @return: One of the following:
- - 1 - Bounding box
- - 2 - Wire
- - 3 - Solid
- - 4 - Shaded
- - 5 - Textured
- """
-
- def getEuler(space):
- """
- @type space: string
- @param space: The desired space for the size:
- - localspace: (default) location without other transformations
- - worldspace: location taking vertex parents, tracking and
- Ipos into account
- Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
- @rtype: Py_Euler
- @return: A python Euler. Data is wrapped when euler is present.
- """
-
- def getInverseMatrix():
- """
- Returns the object's inverse matrix.
- @rtype: Py_Matrix
- @return: A python matrix 4x4
- """
-
- def getIpo():
- """
- Returns the Ipo associated to this object or None if there's no linked ipo.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
- def isSelected():
- """
- Returns the objects selection state in the current scene as a boolean value True or False.
- @rtype: Boolean
- @return: Selection state as True or False
- """
-
- def getLocation(space):
- """
- @type space: string
- @param space: The desired space for the location:
- - localspace: (default) location without other transformations
- - worldspace: location taking vertex parents, tracking and
- Ipos into account
- Returns the object's location (x, y, z).
- @return: (x, y, z)
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and prints the name and location of each object::
- import Blender
-
- sce = Blender.Scene.GetCurrent()
-
- for ob in sce.objects:
- print obj.name
- print obj.loc
- @note: the worldspace location is the same as ob.matrixWorld[3][0:3]
- """
-
- def getAction():
- """
- Returns an action if one is associated with this object (only useful for armature types).
- @rtype: Py_Action
- @return: a python action.
- """
-
- def getMaterials(what = 0):
- """
- Returns a list of materials assigned to the object.
- @type what: int
- @param what: if nonzero, empty slots will be returned as None's instead
- of being ignored (default way). See L{NMesh.NMesh.getMaterials}.
- @rtype: list of Material Objects
- @return: list of Material Objects assigned to the object.
- """
-
- def getMatrix(space = 'worldspace'):
- """
- Returns the object matrix.
- @type space: string
- @param space: The desired matrix:
- - worldspace (default): absolute, taking vertex parents, tracking and
- Ipo's into account;
- - localspace: relative to the object's parent (returns worldspace
- matrix if the object doesn't have a parent);
- - old_worldspace: old behavior, prior to Blender 2.34, where eventual
- changes made by the script itself were not taken into account until
- a redraw happened, either called by the script or upon its exit.
- Returns the object matrix.
- @rtype: Py_Matrix (WRAPPED DATA)
- @return: a python 4x4 matrix object. Data is wrapped for 'worldspace'
- """
-
- def getName():
- """
- Returns the name of the object
- @return: The name of the object
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and prints the name of each object::
- import Blender
-
- sce= Blender.Scene.GetCurrent()
-
- for ob in sce.objects:
- print ob.getName()
- """
-
- def getParent():
- """
- Returns the object's parent object.
- @rtype: Object
- @return: The parent object of the object. If not available, None will be
- returned.
- """
-
- def getSize(space):
- """
- @type space: string
- @param space: The desired space for the size:
- - localspace: (default) location without other transformations
- - worldspace: location taking vertex parents, tracking and
- Ipos into account
- Returns the object's size.
- @return: (SizeX, SizeY, SizeZ)
- @note: the worldspace size will not return negative (flipped) scale values.
- """
-
- def getParentBoneName():
- """
- Returns the object's parent object's sub name, or None.
- For objects parented to bones, this is the name of the bone.
- @rtype: String
- @return: The parent object sub-name of the object.
- If not available, None will be returned.
- """
-
- def getTimeOffset():
- """
- Returns the time offset of the object's animation.
- @return: TimeOffset
- """
-
- def getTracked():
- """
- Returns the object's tracked object.
- @rtype: Object
- @return: The tracked object of the object. If not available, None will be
- returned.
- """
-
- def getType():
- """
- Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
- 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases.
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and updates the location and rotation of the camera. When run,
- the camera will rotate 180 degrees and moved to the opposite side of the X
- axis. Note that the number 'pi' in the example is an approximation of the
- true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.::
- import Blender
-
- sce = Blender.Scene.GetCurrent()
-
- for obj in sce.objects:
- if obj.type == 'Camera':
- obj.LocY = -obj.LocY
- obj.RotZ = 3.141592 - obj.RotZ
-
- Blender.Redraw()
-
- @return: The type of object.
- @rtype: String
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in object ipo at curframe.
- @type keytype: int
- @param keytype: A constant from L{IpoKeyTypes<Object.IpoKeyTypes>}
- @return: None
- """
-
- def link(datablock):
- """
- Links Object with ObData datablock provided in the argument. The data must match the
- Object's type, so you cannot link a Lamp to a Mesh type object.
- @type datablock: Blender ObData datablock
- @param datablock: A Blender datablock matching the objects type.
- """
-
- def makeParent(objects, noninverse = 0, fast = 0):
- """
- Makes the object the parent of the objects provided in the argument which
- must be a list of valid Objects.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- """
-
- def join(objects):
- """
- Uses the object as a base for all of the objects in the provided list to join into.
-
- @type objects: Sequence of Blender Object
- @param objects: A list of objects matching the object's type.
- @note: Objects in the list will not be removed from the scene.
- To avoid overlapping data you may want to remove them manually after joining.
- @note: Join modifies the base object's data in place so that
- other objects are joined into it. No new object or data is created.
- @note: Join will only work for object types Mesh, Armature, Curve and Surface;
- an excption will be raised if the object is not of these types.
- @note: Objects in the list will be ignored if they to not match the base object.
- @note: The base object must be in the current scene to be joined.
- @note: This function will not work in background mode (no user interface).
- @note: An error in the function input will raise a TypeError or AttributeError,
- otherwise an error in the data input will raise a RuntimeError.
- For situations where you don't have tight control on the data that is being joined,
- you should handle the RuntimeError error, letting the user know the data can't be joined.
- """
-
- def makeParentDeform(objects, noninverse = 0, fast = 0):
- """
- Makes the object the deformation parent of the objects provided in the argument
- which must be a list of valid Objects.
- The parent object must be a Curve or Armature.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- @warn: child objects must be of mesh type to deform correctly. Other object
- types will fall back to normal parenting silently.
- """
-
- def makeParentVertex(objects, indices, noninverse = 0, fast = 0):
- """
- Makes the object the vertex parent of the objects provided in the argument
- which must be a list of valid Objects.
- The parent object must be a Mesh, Curve or Surface.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type indices: Tuple of Integers
- @param indices: The indices of the vertices you want to parent to (1 or 3 values)
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- """
- def makeParentBone(objects, bonename, noninverse = 0, fast = 0):
- """
- Makes one of the object's bones the parent of the objects provided in the argument
- which must be a list of valid objects. The parent object must be an Armature.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type bonename: string
- @param bonename: a valid bone name from the armature
- @type noninverse: integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitly update the Scene hierarchy.
- @warn: Objects must first be linked to a scene before they can become
- parents of other objects. Calling this method for an
- unlinked object will result in an exception.
- """
-
- def setDeltaLocation(delta_location):
- """
- Sets the object's delta location which must be a vector triple.
- @type delta_location: A vector triple
- @param delta_location: A vector triple (x, y, z) specifying the new
- location.
- """
-
- def setDrawMode(drawmode):
- """
- Sets the object's drawing mode. The drawing mode can be a mix of modes. To
- enable these, add up the values.
- @type drawmode: Integer
- @param drawmode: A sum of the following:
- - 2 - axis
- - 4 - texspace
- - 8 - drawname
- - 16 - drawimage
- - 32 - drawwire
- - 64 - xray
- """
-
- def setDrawType(drawtype):
- """
- Sets the object's drawing type.
- @type drawtype: Integer
- @param drawtype: One of the following:
- - 1 - Bounding box
- - 2 - Wire
- - 3 - Solid
- - 4 - Shaded
- - 5 - Textured
- """
-
- def setEuler(euler):
- """
- Sets the object's localspace rotation according to the specified Euler angles.
- @type euler: Py_Euler or a list of floats
- @param euler: a python Euler or x,y,z rotations as floats
- """
-
- def setIpo(ipo):
- """
- Links an ipo to this object.
- @type ipo: Blender Ipo
- @param ipo: an object type ipo.
- """
-
- def setLocation(x, y, z):
- """
- Sets the object's location relative to the parent object (if any).
- @type x: float
- @param x: The X coordinate of the new location.
- @type y: float
- @param y: The Y coordinate of the new location.
- @type z: float
- @param z: The Z coordinate of the new location.
- """
-
- def setMaterials(materials):
- """
- Sets the materials. The argument must be a list 16 items or less. Each
- list element is either a Material or None. Also see L{colbits}.
- @type materials: Materials list
- @param materials: A list of Blender material objects.
- @note: Materials are assigned to the object's data by default. Unless
- you know the material is applied to the object or are changing the
- object's L{colbits}, you need to look at the object data's materials.
- """
-
- def setMatrix(matrix):
- """
- Sets the object's matrix and updates its transformation. If the object
- has a parent, the matrix transform is relative to the parent.
- @type matrix: Py_Matrix 3x3 or 4x4
- @param matrix: a 3x3 or 4x4 Python matrix. If a 3x3 matrix is given,
- it is extended to a 4x4 matrix.
- @Note: This method is "bad": when called it changes the location,
- rotation and size attributes of the object (since Blender uses these
- values to calculate the object's transformation matrix). Ton is
- not happy having a method which "pretends" to do a matrix operation.
- In the future, this method may be replaced with other methods which
- make it easier for the user to determine the correct loc/rot/size values
- for necessary for the object.
- """
-
- def setName(name):
- """
- Sets the name of the object. A string longer than 20 characters will be shortened.
- @type name: String
- @param name: The new name for the object.
- """
-
- def setSize(x, y, z):
- """
- Sets the object's size, relative to the parent object (if any), clamped
- @type x: float
- @param x: The X size multiplier.
- @type y: float
- @param y: The Y size multiplier.
- @type z: float
- @param z: The Z size multiplier.
- """
-
- def setTimeOffset(timeOffset):
- """
- Sets the time offset of the object's animation.
- @type timeOffset: float
- @param timeOffset: The new time offset for the object's animation.
- """
-
- def shareFrom(object):
- """
- Link data of a specified argument with this object. This works only
- if both objects are of the same type.
- @type object: Blender Object
- @param object: A Blender Object of the same type.
- @note: This function is faster than using L{getData()} and setData()
- because it skips making a Python object from the object's data.
- """
-
- def select(boolean):
- """
- Sets the object's selection state in the current scene.
- setting the selection will make this object the active object of this scene.
- @type boolean: Integer
- @param boolean:
- - 0 - unselected
- - 1 - selected
- """
-
- def getBoundBox(worldspace=1):
- """
- Returns the worldspace bounding box of this object. This works for meshes (out of
- edit mode) and curves.
- @type worldspace: int
- @param worldspace: An optional argument. When zero, the bounding values will be localspace.
- @rtype: list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA)
- @return: The coordinates of the 8 corners of the bounding box. Data is wrapped when
- bounding box is present.
- """
-
- def makeDisplayList():
- """
- Forces an update to the objects display data. If the object isn't modified,
- there's no need to recalculate this data.
- This method is here for the *few cases* where it is needed.
-
- Example::
- import Blender
-
- scn = Blender.Scene.GetCurrent()
- object = scn.objects.active
- object.modifiers.append(Blender.Modifier.Type.SUBSURF)
- object.makeDisplayList()
- Blender.Window.RedrawAll()
-
- If you try this example without the line to update the display list, the
- object will disappear from the screen until you press "SubSurf".
- @warn: If after running your script objects disappear from the screen or
- are not displayed correctly, try this method function. But if the script
- works properly without it, there's no reason to use it.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Object's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Object. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Object.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def makeTrack (tracked, fast = 0):
- """
- Make this Object track another.
- @type tracked: Blender Object
- @param tracked: the object to be tracked.
- @type fast: int (bool)
- @param fast: if zero, the scene hierarchy is updated automatically. If
- you set 'fast' to a nonzero value, don't forget to update the scene
- yourself (see L{Scene.Scene.update}).
- @note: you also need to clear the rotation (L{setEuler}) of this object
- if it was not (0,0,0) already.
- """
-
- def clearTrack (mode = 0, fast = 0):
- """
- Make this Object not track another anymore.
- @type mode: int (bool)
- @param mode: if nonzero the matrix transformation used for tracking is kept.
- @type fast: int (bool)
- @param fast: if zero, the scene hierarchy is updated automatically. If
- you set 'fast' to a nonzero value, don't forget to update the scene
- yourself (see L{Scene.Scene.update}).
- """
-
- def getAllProperties ():
- """
- Return a list of all game properties from this object.
- @rtype: PyList
- @return: List of Property objects.
- """
-
- def getProperty (name):
- """
- Return a game property from this object matching the name argument.
- @type name: string
- @param name: the name of the property to get.
- @rtype: Property object
- @return: The first property that matches name.
- """
-
- def addProperty (name_or_property, data, type):
- """
- Add or create a game property for an object. If called with only a
- property object, the property is assigned to the object. If called
- with a property name string and data object, a new property is
- created and added to the object.
- @type name_or_property: string or Property object
- @param name_or_property: the property name, or a property object.
- @type data: string, int or float
- @param data: Only valid when I{name_or_property} is a string.
- Value depends on what is passed in:
- - string: string type property
- - int: integer type property
- - float: float type property
- @type type: string (optional)
- @param type: Only valid when I{name_or_property} is a string.
- Can be the following:
- - 'BOOL'
- - 'INT'
- - 'FLOAT'
- - 'TIME'
- - 'STRING'
- @warn: If a type is not declared string data will
- become string type, int data will become int type
- and float data will become float type. Override type
- to declare bool type, and time type.
- @warn: A property object can be added only once to an object;
- you must remove the property from an object to add it elsewhere.
- """
-
- def removeProperty (property):
- """
- Remove a game property from an object.
- @type property: Property object or string
- @param property: Property object or property name to be removed.
- """
-
- def removeAllProperties():
- """
- Removes all game properties from an object.
- """
-
- def copyAllPropertiesTo (object):
- """
- Copies all game properties from one object to another.
- @type object: Object object
- @param object: Object that will receive the properties.
- """
-
- def getPIStregth():
- """
- Get the Object's Particle Interaction Strength.
- @rtype: float
- """
-
- def setPIStrength(strength):
- """
- Set the Object's Particle Interaction Strength.
- Values between -1000.0 to 1000.0
- @rtype: None
- @type strength: float
- @param strength: the Object's Particle Interaction New Strength.
- """
-
- def getPIFalloff():
- """
- Get the Object's Particle Interaction falloff.
- @rtype: float
- """
-
- def setPIFalloff(falloff):
- """
- Set the Object's Particle Interaction falloff.
- Values between 0 to 10.0
- @rtype: None
- @type falloff: float
- @param falloff: the Object's Particle Interaction New falloff.
- """
-
- def getPIMaxDist():
- """
- Get the Object's Particle Interaction MaxDist.
- @rtype: float
- """
-
- def setPIMaxDist(MaxDist):
- """
- Set the Object's Particle Interaction MaxDist.
- Values between 0 to 1000.0
- @rtype: None
- @type MaxDist: float
- @param MaxDist: the Object's Particle Interaction New MaxDist.
- """
-
- def getPIType():
- """
- Get the Object's Particle Interaction Type.
- @rtype: int
- """
-
- def setPIType(type):
- """
- Set the Object's Particle Interaction type.
- Use Module Constants
- - NONE
- - WIND
- - FORCE
- - VORTEX
- - MAGNET
- @rtype: None
- @type type: int
- @param type: the Object's Particle Interaction Type.
- """
-
- def getPIUseMaxDist():
- """
- Get the Object's Particle Interaction if using MaxDist.
- @rtype: int
- """
-
- def setPIUseMaxDist(status):
- """
- Set the Object's Particle Interaction MaxDist.
- 0 = Off, 1 = on
- @rtype: None
- @type status: int
- @param status: the new status
- """
-
- def getPIDeflection():
- """
- Get the Object's Particle Interaction Deflection Setting.
- @rtype: int
- """
-
- def setPIDeflection(status):
- """
- Set the Object's Particle Interaction Deflection Setting.
- 0 = Off, 1 = on
- @rtype: None
- @type status: int
- @param status: the new status
- """
-
- def getPIPermf():
- """
- Get the Object's Particle Interaction Permeability.
- @rtype: float
- """
-
- def setPIPerm(perm):
- """
- Set the Object's Particle Interaction Permeability.
- Values between 0 to 10.0
- @rtype: None
- @type perm: float
- @param perm: the Object's Particle Interaction New Permeability.
- """
-
- def getPIRandomDamp():
- """
- Get the Object's Particle Interaction RandomDamp.
- @rtype: float
- """
-
- def setPIRandomDamp(damp):
- """
- Set the Object's Particle Interaction RandomDamp.
- Values between 0 to 10.0
- @rtype: None
- @type damp: float
- @param damp: the Object's Particle Interaction New RandomDamp.
- """
-
- def getPISurfaceDamp():
- """
- Get the Object's Particle Interaction SurfaceDamp.
- @rtype: float
- """
-
- def setPISurfaceDamp(damp):
- """
- Set the Object's Particle Interaction SurfaceDamp.
- Values between 0 to 10.0
- @rtype: None
- @type damp: float
- @param damp: the Object's Particle Interaction New SurfaceDamp.
- """
-
- def getSBMass():
- """
- Get the Object's SoftBody Mass.
- @rtype: float
- """
-
- def setSBMass(mass):
- """
- Set the Object's SoftBody Mass.
- Values between 0 to 50.0
- @rtype: None
- @type mass: float
- @param mass: the Object's SoftBody New mass.
- """
-
- def getSBGravity():
- """
- Get the Object's SoftBody Gravity.
- @rtype: float
- """
-
- def setSBGravity(grav):
- """
- Set the Object's SoftBody Gravity.
- Values between 0 to 10.0
- @rtype: None
- @type grav: float
- @param grav: the Object's SoftBody New Gravity.
- """
-
- def getSBFriction():
- """
- Get the Object's SoftBody Friction.
- @rtype: float
- """
-
- def setSBFriction(frict):
- """
- Set the Object's SoftBody Friction.
- Values between 0 to 10.0
- @rtype: None
- @type frict: float
- @param frict: the Object's SoftBody New Friction.
- """
-
- def getSBErrorLimit():
- """
- Get the Object's SoftBody ErrorLimit.
- @rtype: float
- """
-
- def setSBErrorLimit(err):
- """
- Set the Object's SoftBody ErrorLimit.
- Values between 0 to 1.0
- @rtype: None
- @type err: float
- @param err: the Object's SoftBody New ErrorLimit.
- """
-
- def getSBGoalSpring():
- """
- Get the Object's SoftBody GoalSpring.
- @rtype: float
- """
-
- def setSBGoalSpring(gs):
- """
- Set the Object's SoftBody GoalSpring.
- Values between 0 to 0.999
- @rtype: None
- @type gs: float
- @param gs: the Object's SoftBody New GoalSpring.
- """
-
- def getSBGoalFriction():
- """
- Get the Object's SoftBody GoalFriction.
- @rtype: float
- """
-
- def setSBGoalFriction(gf):
- """
- Set the Object's SoftBody GoalFriction.
- Values between 0 to 10.0
- @rtype: None
- @type gf: float
- @param gf: the Object's SoftBody New GoalFriction.
- """
-
- def getSBMinGoal():
- """
- Get the Object's SoftBody MinGoal.
- @rtype: float
- """
-
- def setSBMinGoal(mg):
- """
- Set the Object's SoftBody MinGoal.
- Values between 0 to 1.0
- @rtype: None
- @type mg: float
- @param mg: the Object's SoftBody New MinGoal.
- """
-
- def getSBMaxGoal():
- """
- Get the Object's SoftBody MaxGoal.
- @rtype: float
- """
-
- def setSBMaxGoal(mg):
- """
- Set the Object's SoftBody MaxGoal.
- Values between 0 to 1.0
- @rtype: None
- @type mg: float
- @param mg: the Object's SoftBody New MaxGoal.
- """
-
- def getSBInnerSpring():
- """
- Get the Object's SoftBody InnerSpring.
- @rtype: float
- """
-
- def setSBInnerSpring(sprr):
- """
- Set the Object's SoftBody InnerSpring.
- Values between 0 to 0.999
- @rtype: None
- @type sprr: float
- @param sprr: the Object's SoftBody New InnerSpring.
- """
-
- def getSBInnerSpringFriction():
- """
- Get the Object's SoftBody InnerSpringFriction.
- @rtype: float
- """
-
- def setSBInnerSpringFriction(sprf):
- """
- Set the Object's SoftBody InnerSpringFriction.
- Values between 0 to 10.0
- @rtype: None
- @type sprf: float
- @param sprf: the Object's SoftBody New InnerSpringFriction.
- """
-
- def getSBDefaultGoal():
- """
- Get the Object's SoftBody DefaultGoal.
- @rtype: float
- """
-
- def setSBDefaultGoal(goal):
- """
- Set the Object's SoftBody DefaultGoal.
- Values between 0 to 1.0
- @rtype: None
- @type goal: float
- @param goal: the Object's SoftBody New DefaultGoal.
- """
-
- def isSB():
- """
- Returns the Object's SoftBody enabled state.
- @rtype: boolean
- """
-
- def getSBPostDef():
- """
- get SoftBodies PostDef option
- @rtype: int
- """
-
- def setSBPostDef(switch):
- """
- Enable / Disable SoftBodies PostDef option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New PostDef Value.
- """
-
- def getSBUseGoal():
- """
- get SoftBodies UseGoal option
- @rtype: int
- """
-
- def setSBUseGoal(switch):
- """
- Enable / Disable SoftBodies UseGoal option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New UseGoal Value.
- """
- def getSBUseEdges():
- """
- get SoftBodies UseEdges option
- @rtype: int
- """
-
- def setSBUseEdges(switch):
- """
- Enable / Disable SoftBodies UseEdges option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New UseEdges Value.
- """
-
- def getSBStiffQuads():
- """
- get SoftBodies StiffQuads option
- @rtype: int
- """
-
- def setSBStiffQuads(switch):
- """
- Enable / Disable SoftBodies StiffQuads option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New StiffQuads Value.
- """
-
-
-class Property:
- """
- The Property object
- ===================
- This property gives access to object property data in Blender, used by the game engine.
- @ivar name: The property name.
- @ivar data: Data for this property. Depends on property type.
- @ivar type: The property type.
- @warn: Comparisons between properties will only be true when
- both the name and data pairs are the same.
- """
-
- def getName ():
- """
- Get the name of this property.
- @rtype: string
- @return: The property name.
- """
-
- def setName (name):
- """
- Set the name of this property.
- @type name: string
- @param name: The new name of the property
- """
-
- def getData():
- """
- Get the data for this property.
- @rtype: string, int, or float
- """
-
- def setData(data):
- """
- Set the data for this property.
- @type data: string, int, or float
- @param data: The data to set for this property.
- @warn: See object.setProperty(). Changing data
- which is of a different type then the property is
- set to (i.e. setting an int value to a float type'
- property) will change the type of the property
- automatically.
- """
-
- def getType ():
- """
- Get the type for this property.
- @rtype: string
- """
-
-import id_generics
-Object.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py
deleted file mode 100644
index cf662d9147a..00000000000
--- a/source/blender/python/api2_2x/doc/Particle.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# Blender.Object module and the Object PyType object
-
-"""
-The Blender.Particle submodule
-
-
-Particle
-========
-
-This module provides access to the B{Particle} in Blender.
-
-@type TYPE: readonly dictionary
-@var TYPE: Constant dict used for with L{Particle.TYPE}
- - HAIR: set particle system to hair mode.
- - REACTOR: set particle system to reactor mode.
- - EMITTER: set particle system to emitter mode.
-@type DISTRIBUTION: readonly dictionary
-@var DISTRIBUTION: Constant dict used for with L{Particle.DISTRIBUTION}
- - GRID: set grid distribution.
- - RANDOM: set random distribution.
- - JITTERED: set jittered distribution.
-@type EMITFROM: readonly dictionary
-@var EMITFROM: Constant dict used for with L{Particle.EMITFROM}
- - VERTS: set particles emit from vertices
- - FACES: set particles emit from faces
- - VOLUME: set particles emit from volume
- - PARTICLE: set particles emit from particles
-@type REACTON: readonly dictionary
-@var REACTON: Constant dict used for with L{Particle.REACTON}
- - NEAR: react on near
- - COLLISION: react on collision
- - DEATH: react on death
-@type DRAWAS: readonly dictionary
-@var DRAWAS: Constant dict used for with L{Particle.DRAWAS}
- - NONE: Don't draw
- - POINT: Draw as point
- - CIRCLE: Draw as circles
- - CROSS: Draw as crosses
- - AXIS: Draw as axis
- - LINE: Draw as lines
- - PATH: Draw pathes
- - OBJECT: Draw object
- - GROUP: Draw goup
- - BILLBOARD: Draw as billboard
-"""
-
-class Particle:
- """
- The Particle object
- ===================
- This object gives access to paticles data.
-
- @ivar seed: Set an offset in the random table.
- @type seed: int
- @ivar type: Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] ).
- @type type: int
- @ivar resolutionGrid: The resolution of the particle grid.
- @type resolutionGrid: int
- @ivar startFrame: Frame number to start emitting particles.
- @type startFrame: float
- @ivar endFrame: Frame number to stop emitting particles.
- @type endFrame: float
- @ivar editable: Finalize hair to enable editing in particle mode.
- @type editable: int
- @ivar amount: The total number of particles.
- @type amount: int
- @ivar multireact: React multiple times ( Particle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ).
- @type multireact: int
- @ivar reactshape: Power of reaction strength, dependent on distance to target.
- @type reactshape: float
- @ivar hairSegments: Amount of hair segments.
- @type hairSegments: int
- @ivar lifetime: Specify the life span of the particles.
- @type lifetime: float
- @ivar randlife: Give the particle life a random variation.
- @type randlife: float
- @ivar randemission: Emit particles in random order.
- @type randemission: int
- @ivar particleDistribution: Where to emit particles from ( Particle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] )
- @type particleDistribution: int
- @ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths.
- @type evenDistribution: int
- @ivar distribution: How to distribute particles on selected element ( Particle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ).
- @type distribution: int
- @ivar jitterAmount: Amount of jitter applied to the sampling.
- @type jitterAmount: float
- @ivar pf: Emission locations / face (0 = automatic).
- @type pf:int
- @ivar invert: Invert what is considered object and what is not.
- @type invert: int
- @ivar targetObject: The object that has the target particle system (empty if same object).
- @type targetObject: Blender object
- @ivar targetpsys: The target particle system number in the object.
- @type targetpsys: int
- @ivar 2d: Constrain boids to a surface.
- @type 2d: float
- @ivar maxvel: Maximum velocity.
- @type maxvel: float
- @ivar avvel: The usual speed % of max velocity.
- @type avvel: float
- @ivar latacc: Lateral acceleration % of max velocity
- @type latacc: float
- @ivar tanacc: Tangential acceleration % of max velocity
- @type tanacc: float
- @ivar groundz: Default Z value.
- @type groundz: float
- @ivar object: Constrain boids to object's surface.
- @type object: Blender Object
- @ivar renderEmitter: Render emitter object.
- @type renderEmitter: int
- @ivar displayPercentage: Particle display percentage.
- @type displayPercentage: int
- @ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode.
- @type hairDisplayStep: int
- @ivar hairRenderStep: How many steps paths are rendered with (power of 2) in render mode."
- @type hairRenderStep: int
- @ivar duplicateObject: Get the duplicate object.
- @type duplicateObject: Blender Object
- @ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]).
- @type drawAs: int
- """
-
- def freeEdit():
- """
- Free edit mode.
- @return: None
- """
-
- def getLoc(all=0,id=0):
- """
- Get the particles locations.
- A list of tuple is returned in particle mode.
- A list of list of tuple is returned in hair mode.
- The tuple is a vector of 3 or 4 floats in world space (x,y,z, optionally the particle's id).
- @type all: int
- @param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None).
- @type id: int
- @param id: add the particle id in the end of the vector tuple
- @rtype: list of vectors (tuple of 3 floats and optionally the id) or list of list of vectors
- @return: list of vectors or list of list of vectors (hair mode) or None if system is disabled
- """
- def getRot(all=0,id=0):
- """
- Get the particles' rotations as quaternion.
- A list of tuple is returned in particle mode.
- The tuple is vector of 4 or 5 floats (x,y,z,w, optionally the id of the particle).
-
- @type all: int
- @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
- @type id: int
- @param id: add the particle id in the return tuple
- @rtype: list of tuple of 4 or 5 elements (if id is not zero)
- @return: list of 4-tuples or None if system is disabled
- """
-
- def getMat():
- """
- Get the particles' material.
- @rtype: Blender Material
- @return: The material assigned to particles
- """
-
- def getSize(all=0,id=0):
- """
- Get the particles' size.
- A list of float or list of tuple (particle's size,particle's id).
- @type all: int
- @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
- @type id: int
- @param id: add the particle id in the return tuple
- @rtype: list of floats
- @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
- """
-
- def getAge(all=0,id=0):
- """
- Get the particles' age.
- A list of float or list of tuple (particle's age, particle's id).
- @type all: int
- @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
- @type id: int
- @param id: add the particle id in the return tuple
- @rtype: list of floats
- @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
- """
diff --git a/source/blender/python/api2_2x/doc/Pose.py b/source/blender/python/api2_2x/doc/Pose.py
deleted file mode 100644
index ad1b44da5e2..00000000000
--- a/source/blender/python/api2_2x/doc/Pose.py
+++ /dev/null
@@ -1,245 +0,0 @@
-# Blender.Object.Pose module
-
-"""
-The Blender.Object.Pose submodule.
-
-Pose
-====
-
-This module provides access to B{Pose} objects in Blender. This Pose is the
-current object-level (as opposed to armature-data level) transformation.
-
-Example::
- import Blender
- from Blender import *
-
-
- scn= Scene.GetCurrent()
-
- # New Armature
- arm_data= Armature.New('myArmature')
- print arm_data
- arm_ob = scn.objects.new(arm_data)
- arm_data.makeEditable()
-
-
- # Add 4 bones
- ebones = [Armature.Editbone(), Armature.Editbone(), Armature.Editbone(), Armature.Editbone()]
-
- # Name the editbones
- ebones[0].name = 'Bone.001'
- ebones[1].name = 'Bone.002'
- ebones[2].name = 'Bone.003'
- ebones[3].name = 'Bone.004'
-
- # Assign the editbones to the armature
- for eb in ebones:
- arm_data.bones[eb.name]= eb
-
- # Set the locations of the bones
- ebones[0].head= Mathutils.Vector(0,0,0)
- ebones[0].tail= Mathutils.Vector(0,0,1)
- ebones[1].head= Mathutils.Vector(0,0,1)
- ebones[1].tail= Mathutils.Vector(0,0,2)
- ebones[2].head= Mathutils.Vector(0,0,2)
- ebones[2].tail= Mathutils.Vector(0,0,3)
- ebones[3].head= Mathutils.Vector(0,0,3)
- ebones[3].tail= Mathutils.Vector(0,0,4)
-
- ebones[1].parent= ebones[0]
- ebones[2].parent= ebones[1]
- ebones[3].parent= ebones[2]
-
- arm_data.update()
- # Done with editing the armature
-
-
- # Assign the pose animation
- pose = arm_ob.getPose()
-
- act = arm_ob.getAction()
- if not act: # Add a pose action if we dont have one
- act = Armature.NLA.NewAction()
- act.setActive(arm_ob)
-
- xbones=arm_ob.data.bones.values()
- pbones = pose.bones.values()
- print xbones
- print pbones
-
-
- frame = 1
- for pbone in pbones: # set bones to no rotation
- pbone.quat[:] = 1.000,0.000,0.000,0.0000
- pbone.insertKey(arm_ob, frame, Object.Pose.ROT)
-
- # Set a different rotation at frame 25
- pbones[0].quat[:] = 1.000,0.1000,0.2000,0.20000
- pbones[1].quat[:] = 1.000,0.6000,0.5000,0.40000
- pbones[2].quat[:] = 1.000,0.1000,0.3000,0.40000
- pbones[3].quat[:] = 1.000,-0.2000,-0.3000,0.30000
-
- frame = 25
- for i in xrange(4):
- pbones[i].insertKey(arm_ob, frame, Object.Pose.ROT)
-
- pbones[0].quat[:] = 1.000,0.000,0.000,0.0000
- pbones[1].quat[:] = 1.000,0.000,0.000,0.0000
- pbones[2].quat[:] = 1.000,0.000,0.000,0.0000
- pbones[3].quat[:] = 1.000,0.000,0.000,0.0000
-
-
- frame = 50
- for pbone in pbones: # set bones to no rotation
- pbone.quat[:] = 1.000,0.000,0.000,0.0000
- pbone.insertKey(arm_ob, frame, Object.Pose.ROT)
-
-
-
-@var ROT:
-@type ROT: Constant
-@var LOC:
-@type LOC: Constant
-@var SIZE:
-@type SIZE: Constant
-"""
-
-class Pose:
- """
- The Pose object
- ===============
- This object gives access to Pose-specific data in Blender.
- @ivar bones: A Dictionary of PosePoseBones (PoseDict) that make up this Pose.
- @type bones: PoseDict Object
- """
-
- def update():
- """
- Save all changes and update the Pose.
- @rtype: None
- """
-
-class PoseBonesDict:
- """
- The PoseBonesDict object
- ========================
- This object gives dictionary like access to the PoseBones in a Pose.
- It is internal to blender but is called as 'Pose.bones'
- """
-
- def items():
- """
- Return the key, value pairs in this dictionary
- @rtype: string, PosePoseBone
- @return: All strings, and PosePoseBones in the Pose (in that order)
- """
-
- def keys():
- """
- Return the keys in this dictionary
- @rtype: string
- @return: All strings representing the PosePoseBone names
- """
-
- def values():
- """
- Return the values in this dictionary
- @rtype: BPy_PoseBone
- @return: All PosePoseBones in this dictionary
- """
-
-class PoseBone:
- """
- The PoseBone object
- ===================
- This object gives access to PoseBone-specific data in Blender.
- @ivar name: The name of this PoseBone.
- @type name: String
- @ivar loc: The change in location for this PoseBone. this is the equivilent of bone.getLoc() in the old 2.3x python api.
- @type loc: Vector object
- @ivar size: The change in size for this PoseBone (no change is 1,1,1)
- @type size: Vector object
- @ivar quat: The change in rotation for this PoseBone.
- @type quat: Quaternion object
- @ivar head: The final head location for this PoseBone. (not settable)
- @type head: Vector object
- @ivar tail: The final tail location for this PoseBone. (not settable)
- @type tail: Vector object
- @ivar sel: The selection state of this bone
- @type sel: Boolean
- @ivar parent: The parent of this posebone (not settable)
- @type parent: posebone or None
- @ivar displayObject: The object to display in place of the bone. (custom bones)
- @type displayObject: Object or None
- @ivar localMatrix: The matrix combination of rot/size/loc.
- @type localMatrix: Matrix object
- @ivar poseMatrix: The total transformation of this PoseBone including constraints.
-
- This matrix is in armature space, for the current worldspace location of this pose bone, multiply
- it with its objects worldspace matrix.
-
- eg. pose_bone.poseMatrix * object.matrixWorld
-
- Setting the poseMatrix only sets the loc/size/rot, before constraints are applied (similar to actions).
- After setting pose matrix, run pose.update() to re-evaluate the pose and see the changes in the 3d view.
-
- @type poseMatrix: Matrix object
- @type constraints: BPy_ConstraintSeq
- @ivar constraints: a sequence of constraints for the object
- @type limitmin: 3-item sequence
- @ivar limitmin: The x,y,z minimum limits on rotation when part of an IK
- @type limitmax: 3-item sequence
- @ivar limitmax: The x,y,z maximum limits on rotation when part of an IK
-
- @type hasIK: bool
- @ivar hasIK: True if this pose bone is a part of an IK (readonly), when False, other IK related values have no affect.
-
- @type stretch: float
- @ivar stretch: The amount to stretch to the ik target when part of an IK [0.0 - 1.0]
-
- @type stiffX: float
- @ivar stiffX: The x stiffness when part of an IK [0.0 - 0.990]
- @type stiffY: float
- @ivar stiffY: The x stiffness when part of an IK [0.0 - 0.990]
- @type stiffZ: float
- @ivar stiffZ: The x stiffness when part of an IK [0.0 - 0.990]
-
- @type limitX: bool
- @ivar limitX: Limit rotation over X axis when part of an IK.
- @type limitY: bool
- @ivar limitY: Limit rotation over Y axis when part of an IK.
- @type limitZ: bool
- @ivar limitZ: Limit rotation over Z axis when part of an IK.
-
- @type lockXRot: bool
- @ivar lockXRot: Disable X DoF when part of an IK.
- @type lockYRot: bool
- @ivar lockYRot: Disable Y DoF when part of an IK.
- @type lockZRot: bool
- @ivar lockZRot: Disable Z DoF when part of an IK.
- @ivar layerMask: Layer bitmask
- Example::
- # set bone to layers 14 and 16
- bone.layerMask = (1<<13) + (1<<15)
- @type layerMask: Int
- """
-
- def insertKey(parentObject, frameNumber, type = "[Pose.LOC, Pose.ROT, Pose.SIZE]", fast = False):
- """
- Insert a pose key for this PoseBone at a frame.
- @type parentObject: Object object
- @param parentObject: The object the pose came from.
- @type frameNumber: integer
- @param frameNumber: The frame number to insert the pose key on.
- @type type: Constant object
- @param type: Optional argumentm.
- Can be any combination of 3 Module constants:
- - Pose.LOC
- - Pose.ROT (This adds keyframes to the quat ipo, since quaternions are used for pose bone rotation)
- - Pose.SIZE
- If this argument is omitted all keys will be added.
- @type fast: Bool
- @param fast: If enabled, the IPOs will not be recalculated, speeds up adding many keyframes at once.
- @rtype: None
- """
-
diff --git a/source/blender/python/api2_2x/doc/Radio.py b/source/blender/python/api2_2x/doc/Radio.py
deleted file mode 100644
index f336ea56765..00000000000
--- a/source/blender/python/api2_2x/doc/Radio.py
+++ /dev/null
@@ -1,351 +0,0 @@
-# Blender.Scene.Radio module and the Radiosity PyType object
-
-"""
-The Blender.Scene.Radio submodule.
-
-Radio
-=====
-
-This module gives access to B{Scene Radiosity Contexts} in Blender.
-
-Example::
- import Blender
- from Blender import Scene
-
- # Only the current scene has a radiosity context.
- # Naturally, any scene can be made the current one
- # with scene.makeCurrent()
-
- scn = Scene.GetCurrent()
-
- # this is the only way to access the radiosity object:
-
- radio = scn.getRadiosityContext()
-
- radio.setDrawType('Gouraud')
- radio.setMode('ShowLimits', 'Z')
-
- radio.collectMeshes() # prepare patches
- radio.go() # calculate radiosity
- Blender.Redraw(-1)
-
-
-@type Modes: readonly dictionary
-@var Modes:
- - ShowLimits
- - Z
-
-@type DrawTypes: readonly dictionary
-@var DrawTypes:
- - Wire
- - Solid
- - Gouraud
-"""
-
-class Radio:
- """
- The Radiosity object
- ====================
- This object wraps the current Scene's radiosity context in Blender.
- """
-
- def go():
- """
- Start the radiosity simulation. It is necessary to call L{collectMeshes}
- first.
- """
-
- def collectMeshes():
- """
- Convert B{selected} visible meshes to patches for radiosity calculation.
- @note: L{Object.Object.select} can be used to (un)select objects via
- bpython.
- """
-
- def freeData():
- """
- Release all memory used by radiosity.
- """
-
- def addMesh():
- """
- Add the new mesh created by the radiosity simulation (see L{go}) to
- Blender. The radiosity results are stored in this mesh's vertex colors.
- @note: see L{replaceMeshes} for a destructive alternative.
- """
-
- def replaceMeshes():
- """
- Replace the original input meshes with the B{one} calculated by the
- radiosity simulation. The radiosity results are stored in this mesh's
- vertex colors.
- @note: see L{addMesh} for a non-destructive alternative.
- """
-
- def limitSubdivide():
- """
- Subdivide patches (optional, it may improve results).
- """
-
- def filterFaces():
- """
- Force an extra smoothing. This method can be called only after the
- simulation has been calculated (L{go}).
- """
-
- def filterElems():
- """
- Filter elements to remove aliasing artifacts. This method can be called
- only after the simulation has been calculated (L{go}).
- """
-
- def subdividePatches():
- """
- Pre-subdivision: detect high-energy patches and subdivide them
- (optional, it may improve results).
- """
-
- def subdivideElems():
- """
- Pre-subdivision: detect high-energy elements (nodes) and subdivide them
- (optional, it may improve results).
- """
-
- def removeDoubles():
- """
- Join elements (nodes) which differ less than the defined element limit.
- This method can be called only after the simulation has been calculated
- (L{go}).
- """
-
- def getHemiRes():
- """
- Get hemicube size.
- @rtype: int
- @return: the current hemicube size.
- """
-
- def setHemiRes(ival):
- """
- Set hemicube size. The range is [100, 1000].
- @type ival: int
- @param ival: the new size.
- """
-
- def getMaxIter():
- """
- Get maximum number of radiosity rounds.
- @rtype: int
- @return: the current maxiter value.
- """
-
- def setMaxIter(ival):
- """
- Set maximum number of radiosity rounds. The range is [0, 10000].
- @type ival: int
- @param ival: the maxiter new value.
- """
-
- def getSubShPatch():
- """
- Get maximum number of times the environment is tested to detect patches.
- @rtype: int
- @return: the current value.
- """
-
- def setSubShPatch(ival):
- """
- Set the maximum number of times the environment is tested to detect
- patches. The range is [0, 10].
- @type ival: int
- @param ival: the new value.
- """
-
- def getSubShElem():
- """
- Get the number of times the environment is tested to detect elements.
- @rtype: int
- @return: the current value.
- """
-
- def setSubShElem(ival):
- """
- Set number of times the environment is tested to detect elements. The
- range is [0, 10].
- @type ival: int
- @param ival: the new value.
- """
-
- def getElemLimit():
- """
- Get the range for removing doubles.
- @rtype: int
- @return: the current value.
- """
-
- def setElemLimit(ival):
- """
- Set the range for removing doubles. The range is [0, 50].
- @type ival: int
- @param ival: the new value.
- """
-
- def getMaxSubdivSh():
- """
- Get the maximum number of initial shoot patches evaluated.
- @rtype: int
- @return: the current value.
- """
-
- def setMaxSubdivSh(ival):
- """
- Set the maximum number of initial shoot patches evaluated. The range is
- [1, 250].
- @type ival: int
- @param ival: the new value.
- """
-
- def getPatchMax():
- """
- Get the maximum size of a patch.
- @rtype: int
- @return: the current value.
- """
-
- def setPatchMax(ival):
- """
- Set the maximum size of a patch. The range is [10, 1000].
- @type ival: int
- @param ival: the new value.
- """
-
- def getPatchMin():
- """
- Get the minimum size of a patch.
- @rtype: int
- @return: the current value.
- """
-
- def setPatchMin(ival):
- """
- Set the minimum size of a patch. The range is [10, 1000].
- @type ival: int
- @param ival: the new value.
- """
-
- def getElemMax():
- """
- Get the maximum size of an element.
- @rtype: int
- @return: the current value.
- """
-
- def setElemMax(ival):
- """
- Set the maximum size of an element. The range is [1, 100].
- @type ival: int
- @param ival: the new value.
- """
-
- def getElemMin():
- """
- Get the minimum size of an element. The range is [1, 100].
- @rtype: int
- @return: the current value.
- """
-
- def setElemMin(ival):
- """
- Set the minimum size of an element. The range is [1, 100].
- @type ival: int
- @param ival: the new value.
- """
-
- def getMaxElems():
- """
- Get the maximum number of elements.
- @rtype: int
- @return: the current value.
- """
-
- def setMaxElems(ival):
- """
- Set the maximum number of elements. The range is [1, 250000].
- @type ival: int
- @param ival: the new value.
- """
-
- def getConvergence():
- """
- Get lower thresholdo of unshot energy.
- @rtype: float
- @return: the current value.
- """
-
- def setConvergence(fval):
- """
- Set lower threshold of unshot energy. The range is [0.0, 1.0].
- @type fval: float
- @param fval: the new value.
- """
-
- def getMult():
- """
- Get the energy value multiplier.
- @rtype: float
- @return: the current value.
- """
-
- def setMult (fval):
- """
- Set the energy value multiplier. The range is [0.001, 250.0].
- @type fval: float
- @param fval: the new value.
- """
-
- def getGamma():
- """
- Get change in the contrast of energy values.
- @rtype: float
- @return: the current value.
- """
-
- def setGamma (fval):
- """
- Set change in the contrast of energy values. The range is [0.2, 10.0].
- @type fval: float
- @param fval: the new value.
- """
-
- def getDrawType():
- """
- Get the draw type: Wire, Solid or Gouraud as an int value, see L{DrawTypes}.
- @rtype: int
- @return: the current draw type.
- """
-
- def setDrawType (dt):
- """
- Set the draw type.
- @type dt: string or int
- @param dt: either 'Wire', 'Solid' or 'Gouraud' or the equivalent entry in
- the L{DrawTypes} dictionary.
- """
-
- def getMode():
- """
- Get mode as an int (or'ed bitflags), see L{Modes} dictionary.
- @rtype: int
- @return: the current value.
- """
-
- def setMode (mode1 = None, mode2 = None):
- """
- Set mode flags as strings: 'ShowLimits' and 'Z'. To set one give it as
- only argument. Strings not passed in are unset, so setMode() unsets
- both.
- @type mode1: string
- @param mode1: optional mode string.
- @type mode2: string
- @param mode2: optional mode string.
- """
diff --git a/source/blender/python/api2_2x/doc/Registry.py b/source/blender/python/api2_2x/doc/Registry.py
deleted file mode 100644
index 02ac30e71ac..00000000000
--- a/source/blender/python/api2_2x/doc/Registry.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Blender.Registry module
-
-"""
-The Blender.Registry submodule.
-
-B{New}: L{GetKey} and L{SetKey} have been updated to save and load scripts
-*configuration data* to files.
-
-Registry
-========
-
-This module provides a way to create, retrieve and edit B{persistent data} in
-Blender.
-
-When a script is executed it has its own private global dictionary,
-which is deleted when the script exits. This is done to avoid problems with
-name clashes and garbage collecting. But because of this, the data created by
-a script isn't kept after it leaves: the data is not persistent. The Registry
-module was created to give programmers a way around this limitation.
-
-Possible uses:
- - saving arbitrary data from a script that itself or another one will need
- to access later.
- - saving configuration data for a script: users can view and edit this data
- using the "Scripts Configuration Editor" script.
- - saving the current state of a script's GUI (its button values) to restore it
- when the script is executed again.
-
-Example::
-
- import Blender
- from Blender import Registry
-
- # this function updates the Registry when we need to:
- def update_Registry():
- d = {}
- d['myvar1'] = myvar1
- d['myvar2'] = myvar2
- d['mystr'] = mystr
- # cache = True: data is also saved to a file
- Blender.Registry.SetKey('MyScript', d, True)
-
- # first declare global variables that should go to the Registry:
- myvar1 = 0
- myvar2 = 3.2
- mystr = "hello"
-
- # then check if they are already there (saved on a
- # previous execution of this script):
- rdict = Registry.GetKey('MyScript', True) # True to check on disk also
- if rdict: # if found, get the values saved there
- try:
- myvar1 = rdict['myvar1']
- myvar2 = rdict['myvar2']
- mystr = rdict['mystr']
- except: update_Registry() # if data isn't valid rewrite it
-
- # ...
- # here goes the main part of the script ...
- # ...
-
- # if at some point the data is changed, we update the Registry:
- update_Registry()
-
-@note: In Python terms, the Registry holds a dictionary of dictionaries.
- Technically any Python or BPython object can be stored: there are no
- restrictions, but ...
-
-@note: We have a few recommendations:
-
- Data saved to the Registry is kept in memory, so if you decide to store large
- amounts your script users should be clearly informed about it --
- always keep in mind that you have no idea about their resources and the
- applications they are running at a given time (unless you are the only
- user), so let them decide.
-
- There are restrictions to the data that gets automatically saved to disk by
- L{SetKey}(keyname, dict, True): this feature is only meant for simple data
- (bools, ints, floats, strings and dictionaries or sequences of these types).
-
- For more demanding needs, it's of course trivial to save data to another
- file or to a L{Blender Text<Text>}.
-"""
-
-def Keys ():
- """
- Get all keys currently in the Registry's dictionary.
- """
-
-def GetKey (key, cached = False):
- """
- Get key 'key' from the Registry.
- @type key: string
- @param key: a key from the Registry dictionary.
- @type cached: bool
- @param cached: if True and the requested key isn't already loaded in the
- Registry, it will also be searched on the user or default scripts config
- data dir (config subdir in L{Blender.Get}('datadir')).
- @return: the dictionary called 'key'.
- """
-
-def SetKey (key, dict, cache = False):
- """
- Store a new entry in the Registry.
- @type key: string
- @param key: the name of the new entry, tipically your script's name.
- @type dict: dictionary
- @param dict: a dict with all data you want to save in the Registry.
- @type cache: bool
- @param cache: if True the given key data will also be saved as a file
- in the config subdir of the scripts user or default data dir (see
- L{Blender.Get}).
- @warn: as stated in the notes above, there are restrictions to what can
- be automatically stored in config files.
- """
-
-def RemoveKey (key):
- """
- Remove the dictionary with key 'key' from the Registry.
- @type key: string
- @param key: the name of an existing Registry key.
- """
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py
deleted file mode 100644
index 397020fb909..00000000000
--- a/source/blender/python/api2_2x/doc/Render.py
+++ /dev/null
@@ -1,1244 +0,0 @@
-# Blender.Scene.Render module and the RenderData PyType object
-
-"""
-The Blender.Scene.Render submodule.
-
-Scene.Render
-============
-
-This module provides access to B{Scene Rendering Contexts} in Blender.
-
-Example::
- import Blender
- from Blender import *
- from Blender.Scene import Render
-
- scn = Scene.GetCurrent()
- context = scn.getRenderingContext()
-
- Render.EnableDispWin()
- context.extensions = True
- context.renderPath = "//myRenderdir/"
- context.sizePreset(Render.PC)
- context.imageType = Render.AVIRAW
- context.sFrame = 2
- context.eFrame = 10
- context.renderAnim()
-
- context.imageType = Render.TARGA
- context.fps = 15
- context.sFrame = 15
- context.eFrame = 22
- context.renderAnim()
-
- Render.CloseRenderWindow()
- print context.fps
- print context.cFrame
-
-@type Modes: readonly dictionary
-@var Modes: Constant dict used for with L{RenderData.mode} bitfield attribute.
-Values can be ORed together. Individual bits can also be set/cleared with
-boolean attributes.
- - OSA: Oversampling (anti-aliasing) enabled
- - SHADOW: Shadow calculation enabled
- - GAMMA: Gamma correction enabled
- - ENVMAP: Environment map rendering enabled
- - TOONSHADING: Toon edge shading enabled
- - FIELDRENDER: Field rendering enabled
- - FIELDTIME: Time difference in field calculations I{disabled}
- - RADIOSITY: Radiosity rendering enabled
- - BORDER_RENDER: Small cut-out rendering enabled
- - PANORAMA: Panorama rendering enabled
- - CROP: Crop image during border renders
- - ODDFIELD: Odd field first rendering enabled
- - MBLUR: Motion blur enabled
- - UNIFIED: Unified Renderer enabled
- - RAYTRACING: Ray tracing enabled
- - THREADS: Render in two threads enabled (Deprecated, use L{RenderData.threads})
-
-@type SceModes: readonly dictionary
-@var SceModes: Constant dict used for with L{RenderData.sceneMode} bitfield attribute.
-Values can be ORed together. Individual bits can also be set/cleared with
-boolean attributes.
- - SEQUENCER: Enables sequencer output rendering.
- - EXTENSION: Adds extensions to the output when rendering animations.
- - SAVE_BUFFERS: Save render tiles to disk to save memory.
- - FREE_IMAGES: Free images used by textures after each render.
-
-@type FramingModes: readonly dictionary
-@var FramingModes: Constant dict used for with L{RenderData.gameFrame}
-attribute. One of the following modes can be active:
- - BARS: Show the entire viewport in the display window, using bar
- horizontally or vertically.
- - EXTEND: Show the entire viewport in the display window, viewing more
- horizontally or vertically
- - SCALE: Stretch or squeeze the viewport to fill the display window.
-
-@type BakeModes: readonly dictionary
-@var BakeModes: Constant dict used for with L{RenderData.bakeMode}
-attribute. One of the following modes can be active:
- - LIGHT: Bake lighting only.
- - ALL: Bake all render lighting.
- - AO: Bake ambient occlusion.
- - NORMALS: Bake a normal map.
- - TEXTURE: Bake textures.
- - DISPLACEMENT: Bake displacement.
-
-@type BakeNormalSpaceModes: readonly dictionary
-@var BakeNormalSpaceModes: Constant dict used for with L{RenderData.bakeNormalSpace}
-attribute. One of the following modes can be active:
- - CAMERA: Bake normals relative to the camera.
- - WORLD: Bake normals in worldspace.
- - OBJECT: Bake normals relative to the object.
- - TANGENT: Bake tangent space normals.
-
-@var INTERNAL: The internal rendering engine. Use with setRenderer()
-@var YAFRAY: Yafray rendering engine. Use with setRenderer()
-
-@var AVIRAW: Output format. Use with renderdata.imageType / setImageType()
-@var AVIJPEG: Output format. Use with renderdata.imageType / setImageType()
-@var AVICODEC: Output format. Use with renderdata.imageType / setImageType()
-@var QUICKTIME: Output format. Use with renderdata.imageType / setImageType()
-@var TARGA: Output format. Use with renderdata.imageType / setImageType()
-@var RAWTGA: Output format. Use with renderdata.imageType / setImageType()
-@var HDR: Output format. Use with renderdata.imageType / setImageType()
-@var PNG: Output format. Use with renderdata.imageType / setImageType()
-@var BMP: Output format. Use with renderdata.imageType / setImageType()
-@var JPEG: Output format. Use with renderdata.imageType / setImageType()
-@var HAMX: Output format. Use with renderdata.imageType / setImageType()
-@var IRIS: Output format. Use with renderdata.imageType / setImageType()
-@var IRISZ: Output format. Use with renderdata.imageType / setImageType()
-@var FTYPE: Output format. Use with renderdata.imageType / setImageType()
-@var OPENEXR: Output format. Use with renderdata.imageType / setImageType()
-@var MULTILAYER: Output format. Use with renderdata.imageType / setImageType()
-@var TIFF: Output format. Use with renderdata.imageType / setImageType()
-@var FFMPEG: Output format. Use with renderdata.imageType / setImageType()
-@var CINEON: Output format. Use with renderdata.imageType / setImageType()
-@var DPX: Output format. Use with renderdata.imageType / setImageType()
-
-@var PAL: Output format. Use with renderdata.sizePreset()
-@var NTSC: Output format. Use with renderdata.sizePreset()
-@var DEFAULT: Output format. Use with renderdata.sizePreset()
-@var PREVIEW: Output format. Use with renderdata.sizePreset()
-@var PC: Output format. Use with renderdata.sizePreset()
-@var PAL169: Output format. Use with renderdata.sizePreset()
-@var B_PR_FULL: Output format. Use with renderdata.sizePreset()
-
-@var NONE: Yafray GI Quality / Method. Use with renderdata.setYafrayGIQuality()
-@var LOW: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var MEDIUM: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var HIGH: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var HIGHER: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var BEST: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var USEAOSETTINGS: Yafray GI Quality. Use with renderdata.setYafrayGIQuality()
-@var SKYDOME: Yafray GI Method. Use with renderdata.setYafrayGIMethod()
-@var GIFULL: Yafray GI Method. Use with renderdata.setYafrayGIMethod()
-"""
-
-def CloseRenderWindow():
- """
- Closes the rendering window.
- """
-
-def EnableDispView():
- """
- Render in the 3d View area. B{Note} this method is deprecated;
- use the l{displayMode} attribute instead.
- """
-
-def EnableDispWin():
- """
- Render in Render window.
- B{Note} this method is deprecated; use the l{displayMode} attribute instead.
- """
-
-def SetRenderWinPos(locationList):
- """
- Set the position of the Render window on the screen.
- Possible values are:
- - S = south
- - N = north
- - W = west
- - E = east
- - C = center
- - ne = northeast
- - nw = northwest
- - se = southeast
- - sw = southwest
- @type locationList: PyList of strings
- @param locationList: a list of strings that together define
- the location of the Render window on the screen.
- """
-
-class RenderData:
- """
- The RenderData object
- =====================
- This object gives access to Scene rendering contexts in Blender.
- @ivar unified: Unified Renderer enabled.
- Also see B{UNIFIED} in L{Modes} constant dict.
- @type unified: boolean
- @ivar renderwinSize: Size of the rendering window. Valid values are 25, 50,
- 75, or 100.
- @type renderwinSize: int
- @ivar xParts: Number of horizontal parts for image render.
- Values are clamped to the range [2,512].
- @type xParts: int
- @ivar fieldRendering: Field rendering enabled.
- Also see B{FIELDRENDER} in L{Modes} constant dict.
- @type fieldRendering: boolean
- @ivar gammaCorrection: Gamma correction enabled.
- Also see B{GAMMA} in L{Modes} constant dict.
- @type gammaCorrection: boolean
- @ivar eFrame: Ending frame for rendering.
- Values are clamped to the range [1,MAXFRAME].
- @type eFrame: int
- @ivar radiosityRender: Radiosity rendering enabled.
- @type radiosityRender: boolean
- @ivar sizeX: Image width (in pixels).
- Values are clamped to the range [4,10000].
- @type sizeX: int
- @ivar shadow: Shadow calculation enabled.
- Also see B{SHADOW} in L{Modes} constant dict.
- @type shadow: boolean
- @ivar aspectX: Horizontal aspect ratio.
- Values are clamped to the range [1,200].
- @type aspectX: int
- @ivar mode: Mode bitfield. See L{Modes} constant dict for values.
- @type mode: bitfield
- @ivar fieldTimeDisable: Time difference in field calculations I{disabled}.
- @type fieldTimeDisable: int
- @ivar cFrame: The current frame for rendering.
- Values are clamped to the range [1,MAXFRAME].
- @type cFrame: int
- @ivar crop: Crop image during border renders.
- Also see B{CROP} in L{Modes} constant dict.
- @type crop: boolean
- @ivar sFrame: Starting frame for rendering.
- Values are clamped to the range [1,MAXFRAME].
- @type sFrame: int
- @ivar backbuf: Backbuffer image enabled.
- @type backbuf: boolean
- @ivar OSALevel: Oversampling (anti-aliasing) level. Valid values are
- 5, 8, 11, or 16.
- @type OSALevel: int
- @ivar displayMode: Render output in separate window or 3D view.
- Valid values are 0 (display in image editor view), 1 (display in render
- window), or 2 (display full screen).
- @type displayMode: int
- @ivar threads: Number of threads to render, clamed [1-8]
- @type threads: int
- @ivar backbufPath: Path to a background image (setting loads image).
- @type backbufPath: string
- @ivar toonShading: Toon edge shading enabled.
- Also see B{TOONSHADING} in L{Modes} constant dict.
- @type toonShading: boolean
- @ivar sceneMode: Scene mode bitfield. See L{SceModes} constant dict for
- values.
- @type sceneMode: bitfield
- @ivar gameFrameColor: RGB color triplet for bars.
- Values are clamped in the range [0.0,1.0].
- @type gameFrameColor: list of RGB 3 floats
- @ivar sizeY: Image height (in pixels).
- Values are clamped to the range [4,10000].
- @type sizeY: int
- @ivar renderer: Rendering engine choice.
- Valid values are 0 (internal) or 1 (Yafray).
- @type renderer: int
-
- @ivar sequencer: Enables sequencer output rendering.
- Also see B{SEQUENCER} in L{SceModes} constant dict.
- @type sequencer: boolean
- @ivar extensions: Add extensions to output (when rendering animations).
- Also see B{EXTENSION} in L{SceModes} constant dict.
- @type extensions: boolean
- @ivar compositor: 'Do Compositor' enabled.
- @type compositor: boolean
- @ivar freeImages: Texture images are freed after render.
- @type freeImages: boolean
- @ivar singleLayer: Only render the active layer.
- @type singleLayer: boolean
- @ivar activeLayer: The active render layer. Must be in range[0,num render layers-1]
- @type activeLayer: int
- @ivar saveBuffers: Save render buffers to disk while rendering, saves memory.
- @type saveBuffers: boolean
- @ivar compositeFree: Free nodes that are not used while composite.
- @type compositeFree: boolean
-
- @ivar panorama: Panorama rendering enabled.
- Also see B{PANORAMA} in L{Modes} constant dict.
- @type panorama: boolean
- @ivar rayTracing: Ray tracing enabled.
- Also see B{RAYTRACING} in L{Modes} constant dict.
- @type rayTracing: boolean
- @ivar renderPath: The path to output the rendered images.
- @type renderPath: string
- @ivar gameFrame: Game framing type. See L{FramingModes} constant dict.
- @type gameFrame: int
- @ivar aspectY: Vertical aspect ratio.
- Values are clamped to the range [1,200].
- @type aspectY: int
- @ivar imageType: File format for saving images. See the module's constants
- for values.
- @type imageType: int
- @ivar ftypePath: The path to Ftype file.
- @type ftypePath: string
- @ivar border: The border for border rendering. The format is
- [xmin,ymin,xmax,ymax]. Values are clamped to [0.0,1.0].
- @type border: list of 4 floats.
- @ivar edgeColor: RGB color triplet for edges in Toon shading (unified
- renderer).
- Values are clamped in the range [0.0,1.0].
- @type edgeColor: list of 3 RGB floats
- @ivar yParts: Number of vertical parts for image render.
- Values are clamped to the range [2,512].
- @type yParts: int
- @ivar imagePlanes: Image depth in bits. Valid values are 8, 24, or 32.
- @type imagePlanes: int
- @ivar borderRender: Small cut-out rendering enabled.
- Also see B{BORDER_RENDER} in L{Modes} constant dict.
- @type borderRender: boolean
- @ivar oversampling: Oversampling (anti-aliasing) enabled.
- Also see B{OSA} in L{Modes} constant dict.
- @type oversampling: boolean
- @ivar fps: Frames per second.
- Values are clamped to the range [1,120].
- @ivar fpsBase: Frames per second base: used to generate fractional frames
- per second values. For example, setting fps to 30 and fps_base to 1.001
- will approximate the NTSC frame rate of 29.97 fps.
- Values are clamped to the range [1,120].
- @type fpsBase: float
- @ivar timeCode: Get the current frame in HH:MM:SS:FF format. Read-only.
- @type timeCode: string
- @ivar environmentMap: Environment map rendering enabled.
- Also see B{ENVMAP} in L{Modes} constant dict.
- @type environmentMap: boolean
- @ivar motionBlur: Motion blur enabled.
- Also see B{MBLUR} in L{Modes} constant dict.
- @type motionBlur: boolean
- @ivar oddFieldFirst: Odd field first rendering enabled.
- Also see B{ODDFIELD} in L{Modes} constant dict.
- @type oddFieldFirst: boolean
- @ivar alphaMode: Setting for sky/background. Valid values are 0 (fill
- background with sky), 1 (multiply alpha in advance), or 2 (alpha and color
- values remain unchanged).
- @type alphaMode: int
- @ivar gaussFilter: Gauss filter size.
- Values are clamped to the range [0.5,1.5].
- @type gaussFilter: float
- @ivar mblurFactor: Motion blur factor.
- Values are clamped to the range [0.01,5.0].
- @type mblurFactor: float
- @ivar mapOld: Number of frames the Map Old will last
- Values are clamped to the range [1,900].
- @type mapOld: int
- @ivar mapNew: New mapping value (in frames).
- Values are clamped to the range [1,900].
- @type mapNew: int
- @ivar set: The scene linked as a set to this scene. Values are an existing
- scene or None (setting to None clears the set). The scene argument cannot
- cause a circular link.
- @type set: BPy_Scene or None
- @ivar yafrayGIMethod: Global Illumination method.
- Valid values are NONE (0), SKYDOME (1) or FULL (2).
- @type yafrayGIMethod: int {NONE (0), SKYDOME (1), GIFULL (2)}
- @ivar yafrayGIQuality: Global Illumination quality.
- @type yafrayGIQuality: int {NONE (0), LOW (1), MEDIUM (2), HIGH (3), HIGHER (4), BEST (5), USEAOSETTINGS (6)}
- @ivar yafrayExportToXML: If true export to an xml file and call yafray instead of plugin.
- @type yafrayExportToXML: boolean
- @ivar yafrayAutoAntiAliasing: Automatic anti-aliasing enabled/disabled.
- @type yafrayAutoAntiAliasing: boolean
- @ivar yafrayClampRGB: Clamp RGB enabled/disabled.
- @type yafrayClampRGB: boolean
- @ivar yafrayAntiAliasingPasses: Number of anti-aliasing passes (0 is no Anti-Aliasing).
- @type yafrayAntiAliasingPasses: int [0, 64]
- @ivar yafrayAntiAliasingSamples: Number of samples per pass.
- @type yafrayAntiAliasingSamples: int [0, 2048]
- @ivar yafrayAntiAliasingPixelSize: Anti-aliasing pixel filter size.
- @type yafrayAntiAliasingPixelSize: float [1.0, 2.0]
- @ivar yafrayAntiAliasingThreshold: Anti-aliasing threshold.
- @type yafrayAntiAliasingThreshold: float [0.05, 1.0]
- @ivar yafrayGICache: Cache occlusion/irradiance samples (faster).
- @type yafrayGICache: boolean
- @ivar yafrayGICacheBumpNormals: Enable/disable bumpnormals for cache.
- @type yafrayGICacheBumpNormals: boolean
- @ivar yafrayGICacheShadowQuality: Shadow quality, keep it under 0.95 :-).
- @type yafrayGICacheShadowQuality: float [0.01, 1.0]
- @ivar yafrayGICachePixelsPerSample: Maximum number of pixels without samples, the lower the better and slower.
- @type yafrayGICachePixelsPerSample: int [1, 50]
- @ivar yafrayGICacheRefinement: Threshold to refine shadows EXPERIMENTAL. 1 = no refinement.
- @type yafrayGICacheRefinement: float [0.001, 1.0]
- @ivar yafrayGIPhotons: Enable/disable use of global photons to help in GI.
- @type yafrayGIPhotons: boolean
- @ivar yafrayGITunePhotons: If true the photonmap is shown directly in the render for tuning.
- @type yafrayGITunePhotons: boolean
- @ivar bakeMode: The method used when baking, see L{BakeModes}.
- @type bakeMode: int
- @ivar bakeNormalSpace: The method used when baking, see L{BakeNormalSpaceModes}.
- @type bakeNormalSpace: int
- @ivar bakeClear: When enabled, baking clears the image first.
- @type bakeClear: bool
- @ivar bakeToActive: When enabled, selected objects are baked onto the active object.
- @type bakeToActive: bool
- @ivar bakeNormalize: Normalize AO and displacement to the range of the distance value.
- @type bakeNormalize: bool
- @ivar bakeMargin: The pixel distance to extend baked pixels past the boundry (reduces bleeding when mipmapping)
- @type bakeMargin: int
- @ivar bakeDist: The distance in blender units to use when bakeToActive is enabled and geomtry does not overlap.
- @type bakeDist: float
- @ivar bakeBias: The distance in blender units to bias faces further away from the object.
- @type bakeBias: float
- @ivar halfFloat: When enabled use 16bit floats rather then 32bit for OpenEXR files.
- @type halfFloat: bool
- @ivar zbuf: When enabled, save the zbuffer with an OpenEXR file
- @type zbuf: bool
- @ivar preview: When enabled, save a preview jpeg with an OpenEXR file
- @type preview: bool
- @ivar touch: Create an empty file before rendering it.
- @type touch: bool
- @ivar noOverwrite: Skip rendering frames when the file exists.
- @type noOverwrite: bool
- """
-
- def currentFrame(frame = None):
- """
- Get/set the current frame.
- @type frame: int (optional)
- @param frame: must be between 1 - 30000
- @rtype: int (if prototype is empty)
- @return: Current frame for the scene.
- """
-
- def render():
- """
- Render the scene.
- """
-
- def bake():
- """
- Bake selected objects in the scene.
- """
-
- def renderAnim():
- """
- Render a series of frames to an output directory.
- """
-
- def saveRenderedImage(filename, zbuffer=0):
- """
- Saves the image rendered using RenderData.render() to the filename and path
- given in the variable 'filename'.
-
- Make sure the filename you provide makes a valid path when added to the "render path"
- (setRenderPath/getRenderPath) to make up the absolute path.
- If you want to render to a new absolute path just set the renderpath to an
- empty string and use the absolute path as the filename.
- @param filename: The path+filename for the rendered image.
- @type zbuffer: int
- @param zbuffer: Whether or not to render the zbuffer along with the image.
- @type filename: string
- @since: 2.40
- @requires: You must have an image currently rendered before calling this method
- @warning: This wont work in background mode. use renderAnim instead.
- """
-
- def play():
- """
- play animation of rendered images/avi (searches Pics: field).
- """
-
- def getTimeCode():
- """
- Get the current frame as a string in HH:MM:SS:FF format
- @rtype: string
- @return: current frame as a string in HH:MM:SS:FF format
- """
-
- def setRenderPath(path):
- """
- Set the path to where the renderer will write to.
- @type path: string
- @param path: A directory for that the renderer searches for
- both playback and output from the renderAnim function.
- """
-
- def getRenderPath():
- """
- Get the path to where the renderer will write to.
- @rtype: string
- @return: Returns the directory that is used to playback and store rendered
- sequences.
- """
-
- def getFrameFilename( frame ):
- """
- Get the filename used for the remdered image.
- @type frame: int
- @param frame: the frame to use in the filename, if no argument given, use the current frame.
- @rtype: string
- @return: Returns the filename that blender would render to, taking into account output path, extension and frame number.
- """
-
- def setBackbufPath(path):
- """
- Set the path to a background image and load it.
- @type path: string
- @param path: The path to a background image for loading.
- """
-
- def getBackbufPath():
- """
- Get the path to the background image.
- @rtype: string
- @return: The path to a background image.
- """
-
- def enableBackbuf(toggle):
- """
- Enable/disable the backbuf image.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def setFtypePath(path):
- """
- Set the path to Ftype file.
- @type path: string
- @param path: Path to Ftype Image type.
- """
-
- def getFtypePath():
- """
- Get the path to the Ftype file
- @rtype: string
- @return: Path to FtypeImage type.
- """
-
- def enableExtensions(toggle):
- """
- Enable/disable windows extensions for output files.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableSequencer(toggle):
- """
- Enable/disable Do Sequence.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableRenderDaemon(toggle):
- """
- Enable/disable Scene daemon.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableToonShading(toggle):
- """
- Enable/disable Edge rendering.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def edgeIntensity(intensity = None):
- """
- Get/set edge intensity for toon shading.
- @type intensity: int (optional)
- @param intensity: must be between 0 - 255
- @rtype: int (if prototype is empty)
- @return: Current edge intensity for the scene.
- """
-
- def setEdgeColor(red, green, blue):
- """
- Set the edge color for toon shading.
- @type red: float
- @param red: must be between 0 - 1.0
- @type green: float
- @param green: must be between 0 - 1.0
- @type blue: float
- @param blue: must be between 0 - 1.0
- """
-
- def getEdgeColor():
- """
- Get the edge color for toon shading.
- @rtype: string
- @return: A string representing the edge color.
- """
-
- def edgeAntiShift(intensity = None):
- """
- With the unified renderer, reduce intensity on boundaries.
- @type intensity: int (optional)
- @param intensity: must be between 0 - 255
- @rtype: int (if prototype is empty)
- @return: Current edge antishift for the scene.
- """
-
- def enableOversampling(toggle):
- """
- Enable/disable oversampling (anti-aliasing).
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def setOversamplingLevel(level):
- """
- Set the level of over-sampling (anti-aliasing).
- @type level: int
- @param level: can be either 5, 8, 11, or 16
- """
-
- def enableMotionBlur(toggle):
- """
- Enable/disable MBlur.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def motionBlurLevel(level = None):
- """
- Get/set the length of shutter time for motion blur.
- @type level: float (optional)
- @param level: must be between 0.01 - 5.0
- @rtype: float (if prototype is empty)
- @return: Current MBlur for the scene.
- """
-
- def partsX(parts = None):
- """
- Get/set the number of parts to divide the render in the X direction.
- @type parts: int (optional)
- @param parts: must be between 1 - 64
- @rtype: int (if prototype is empty)
- @return: Current number of parts in the X for the scene.
- """
-
- def partsY(parts = None):
- """
- Get/set the number of parts to divide the render in the Y direction.
- @type parts: int (optional)
- @param parts: must be between 1 - 64
- @rtype: int (if prototype is empty)
- @return: Current number of parts in the Y for the scene.
- """
-
- def enableSky():
- """
- Enable render background with sky.
- """
-
- def enablePremultiply():
- """
- Enable premultiply alpha.
- """
-
- def enableKey():
- """
- Enable alpha and color values remain unchanged.
- """
-
- def enableShadow(toggle):
- """
- Enable/disable shadow calculation.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableEnvironmentMap(toggle):
- """
- Enable/disable environment map rendering.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableRayTracing(toggle):
- """
- Enable/disable ray tracing.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableRadiosityRender(toggle):
- """
- Enable/disable radiosity rendering.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enablePanorama(toggle):
- """
- Enable/disable panorama rendering (output width is multiplied by Xparts).
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def setRenderWinSize(size):
- """
- Set the size of the render window.
- @type size: int
- @param size: can be 25, 50, 75 or 100 (percent).
- """
-
- def getRenderWinSize():
- """
- Get the size of the render window.
- @rtype: int
- @return: window size; can be 25, 50, 75 or 100 (percent).
- """
-
- def enableFieldRendering(toggle):
- """
- Enable/disable field rendering
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableOddFieldFirst(toggle):
- """
- Enable/disable Odd field first rendering (Default: Even field).
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableFieldTimeDisable(toggle):
- """
- Enable/disable time difference in field calculations.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableGaussFilter(toggle):
- """
- Enable/disable Gauss sampling filter for anti-aliasing.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableBorderRender(toggle):
- """
- Enable/disable small cut-out rendering.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def setBorder(left,bottom,right,top):
- """
- Set a border for rendering from cameras in the scene.
- The left,bottom coordinates and right,top coordinates
- define the size of the border. (0,0,1,1) will set the border
- to the whole camera. (0,0) lower left and (1,1) upper right.
- @type left: float
- @param left: float between 0 and 1
- @type right: float
- @param right: float between 0 and 1
- @type bottom: float
- @param bottom: float between 0 and 1
- @type top: float
- @param top: float between 0 and 1
- """
-
- def enableGammaCorrection(toggle):
- """
- Enable/disable gamma correction.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def gaussFilterSize(size = None):
- """
- Get/sets the Gauss filter size.
- @type size: float (optional)
- @param size: must be between 0.5 - 1.5
- @rtype: float (if prototype is empty)
- @return: Current gauss filter size for the scene.
- """
-
- def startFrame(frame = None):
- """
- Get/set the starting frame for sequence rendering.
- @type frame: int (optional)
- @param frame: must be a valid Blender frame number.
- @rtype: int (if prototype is empty)
- @return: Current starting frame for the scene.
- """
-
- def endFrame(frame = None):
- """
- Get/set the ending frame for sequence rendering.
- @type frame: int (optional)
- @param frame: must be a valid Blender frame number.
- @rtype: int (if prototype is empty)
- @return: Current ending frame for the scene.
- """
-
- def imageSizeX(size = None):
- """
- Get/set the image width in pixels.
- @type size: int (optional)
- @param size: must be between 4 - 10000
- @rtype: int (if prototype is empty)
- @return: Current image width for the scene.
- """
-
- def imageSizeY(size = None):
- """
- Get/set the image height in pixels.
- @type size: int (optional)
- @param size: must be between 4 - 10000
- @rtype: int (if prototype is empty)
- @return: Current image height for the scene.
- """
-
- def aspectRatioX(ratio = None):
- """
- Get/set the horizontal aspect ratio.
- @type ratio: int (optional)
- @param ratio: must be between 1 - 200
- @rtype: int (if prototype is empty)
- @return: Current horizontal aspect ratio for the scene.
- """
-
- def aspectRatioY(ratio = None):
- """
- Get/set the vertical aspect ratio.
- @type ratio: int (optional)
- @param ratio: must be between 1 - 200
- @rtype: int (if prototype is empty)
- @return: Current vertical aspect ratio for the scene.
- """
-
- def setRenderer(type):
- """
- Get/set which renderer to render the output.
- @type type: enum constant
- @param type: must be one of 2 constants:
- - INTERN: Blender's internal renderer
- - YAFRAY: Yafray renderer
- """
-
- def enableCropping(toggle):
- """
- Deprecated: see the L{crop} attribute.
- """
-
- def setImageType(type):
- """
- Set the type of image to output from the render.
- @type type: enum constant
- @param type: must be one of 13 constants:
- - AVIRAW: Uncompressed AVI files. AVI is a commonly used format on Windows platforms
- - AVIJPEG: AVI movie w/ JPEG images
- - AVICODEC: AVI using win32 codec
- - QUICKTIME: Quicktime movie (if enabled)
- - TARGA: Targa files
- - RAWTGA: Raw Targa files
- - PNG: Png files
- - BMP: Bitmap files
- - JPEG90: JPEG files
- - HAMX: Hamx files
- - IRIS: Iris files
- - IRIZ: Iris + z-buffer files
- - FTYPE: Ftype file
- """
-
- def quality(qual = None):
- """
- Get/set quality get/setting for JPEG images, AVI JPEG and SGI movies.
- @type qual: int (optional)
- @param qual: must be between 10 - 100
- @rtype: int (if prototype is empty)
- @return: Current image quality for the scene.
- """
-
- def framesPerSec(qual = None):
- """
- Get/set frames per second.
- @type qual: int (optional)
- @param qual: must be between 1 - 120
- @rtype: int (if prototype is empty)
- @return: Current frames per second for the scene.
- """
-
- def enableGrayscale():
- """
- Images are saved with black and white (grayscale) data.
- """
-
- def enableRGBColor():
- """
- Images are saved with RGB (color) data.
- """
-
- def enableRGBAColor():
- """
- Images are saved with RGB and Alpha data (if supported).
- """
-
- def sizePreset(type):
- """
- Set the renderer to one of a few presets.
- @type type: enum constant
- @param type: must be one of 8 constants:
- - PAL: The European video standard: 720 x 576 pixels, 54 x 51 aspect.
- - FULL: For large screens: 1280 x 1024 pixels.
- - PREVIEW: For preview rendering: 320 x 256 pixels.
- - PAL169: Wide-screen PAL.
- - DEFAULT: Like "PAL", but here the render settings are also set.
- - PANO: Panorama render.
- - NTSC: For TV playback.
- - PC: For standard PC graphics: 640 x 480 pixels.
- """
-
- def enableUnifiedRenderer(toggle):
- """
- Use the unified renderer.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def setYafrayGIQuality(type):
- """
- Set yafray global Illumination quality.
- @type type: enum constant
- @param type: must be one of 6 constants:
- - NONE
- - LOW
- - MEDIUM
- - HIGH
- - HIGHER
- - BEST
- - USEAOSETTINGS
- """
-
- def getYafrayGIQuality():
- """
- Get yafray global Illumination quality.
- @rtype: enum constant
- @return: one of 6 constants:
- - NONE
- - LOW
- - MEDIUM
- - HIGH
- - HIGHER
- - BEST
- - USEAOSETTINGS
- """
-
- def setYafrayGIMethod(type):
- """
- Set yafray global Illumination method.
- @type type: enum constant
- @param type: must be one of 3 constants:
- - NONE: Do not use GI illumination
- - SKYDOME: Use Skydome method
- - GIFULL: Use Full method
- """
-
- def getYafrayGIMethod():
- # (dietrich) 2007/06/01
- """
- Get yafray global Illumination method.
- @rtype: enum constant -
- @return: Current yafray global illumination method:
- - NONE: Do not use GI illumination
- - SKYDOME: Use Skydome method
- - GIFULL: Use Full method
- """
-
- def yafrayGIPower(power = None):
- """
- Get/set GI lighting intensity scale.
- YafrayMethod must be either SKYDOME or GIFULL.
- @type power: float (optional)
- @param power: must be between 0.01 - 100.0
- @rtype: float (if prototype is empty)
- @return: Current yafray global illumination intensity for the scene.
- """
-
- def yafrayGIIndirPower(power = None):
- """
- Get/set GI indirect lighting intensity scale.
- @type power: float (optional)
- @param power: must be between 0.01 - 100.0
- @rtype: float (if prototype is empty)
- @return: Current yafray indirect illumination intensity for the scene.
- """
-
- def yafrayGIDepth(depth = None):
- """
- Get/set number of bounces of the indirect light.
- YafrayMethod must be GIFULL.
- @type depth: int (optional)
- @param depth: must be between 1 - 8
- @rtype: int (if prototype is empty)
- @return: Current yafray global illumination light bounces for the scene.
- """
-
- def yafrayGICDepth(depth = None):
- """
- Get/set number of bounces inside objects (for caustics).
- YafrayMethod must be GIFULL.
- @type depth: int (optional)
- @param depth: must be between 1 - 8
- @rtype: int (if prototype is empty)
- @return: Current yafray global illumination inside light bounces for the scene.
- """
-
- def enableYafrayGICache(toggle):
- """
- Enable/disable cache irradiance samples (faster).
- YafrayMethod must be GIFULL.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def enableYafrayGIPhotons(toggle):
- """
- Enable/disable use of global photons to help in GI.
- YafrayMethod must be GIFULL.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def yafrayGIPhotonCount(count = None):
- """
- Get/set number of photons to shoot.
- YafrayMethod must be GIFULL and Photons enabled.
- @type count: int (optional)
- @param count: must be between 0 - 10000000
- @rtype: int (if prototype is empty)
- @return: Current number of photons to shoot for the scene.
- """
-
-
- def yafrayGIPhotonRadius(radius = None):
- """
- Get/set radius to search for photons to mix (blur).
- YafrayMethod must be GIFULL and Photons enabled.
- @type radius: float (optional)
- @param radius: must be between 0.00001 - 100.0
- @rtype: float (if prototype is empty)
- @return: Current photon search radius for the scene.
- """
-
-
- def yafrayGIPhotonMixCount(count = None):
- """
- Get/set number of photons to keep inside radius.
- YafrayMethod must be GIFULL and Photons enabled.
- @type count: int (optional)
- @param count: must be between 0 - 1000
- @rtype: int (if prototype is empty)
- @return: Current number of photons to keep inside radius for the scene.
- """
-
- def enableYafrayGITunePhotons(toggle):
- """
- Enable/disable show the photon map directly in the render for tuning.
- YafrayMethod must be GIFULL and Photons enabled.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def yafrayGIShadowQuality(qual = None):
- """
- Get/set the shadow quality, keep it under 0.95.
- YafrayMethod must be GIFULL and Cache enabled.
- @type qual: float (optional)
- @param qual: must be between 0.01 - 1.0
- @rtype: float (if prototype is empty)
- @return: Current shadow quality for the scene.
- """
-
- def yafrayGIPixelsPerSample(pixels = None):
- """
- Get/set maximum number of pixels without samples, the lower the better and slower.
- YafrayMethod must be GIFULL and Cache enabled.
- @type pixels: int (optional)
- @param pixels: must be between 1 - 50
- @rtype: int (if prototype is empty)
- @return: Current number of pixels without samples for the scene.
- """
-
- def enableYafrayGIGradient(toggle):
- """
- Enable/disable try to smooth lighting using a gradient.
- YafrayMethod must be GIFULL and Cache enabled.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def yafrayGIRefinement(refine = None):
- """
- Get/set threshold to refine shadows EXPERIMENTAL. 1 = no refinement.
- YafrayMethod must be GIFULL and Cache enabled.
- @type refine: float (optional)
- @param refine: must be between 0.001 - 1.0
- @rtype: float (if prototype is empty)
- @return: Current threshold to refine shadows for the scene.
- """
-
- def yafrayRayBias(bias = None):
- """
- Get/set shadow ray bias to avoid self shadowing.
- @type bias: float (optional)
- @param bias: must be between 0 - 10.0
- @rtype: float (if prototype is empty)
- @return: Current ray bias for the scene.
- """
-
- def yafrayRayDepth(depth = None):
- """
- Get/set maximum render ray depth from the camera.
- @type depth: int (optional)
- @param depth: must be between 1 - 80
- @rtype: int (if prototype is empty)
- @return: Current ray depth for the scene.
- """
-
- def yafrayGamma(gamma = None):
- """
- Get/set gamma correction, 1 is off.
- @type gamma: float (optional)
- @param gamma: must be between 0.001 - 5.0
- @rtype: float (if prototype is empty)
- @return: Current gamma correction for the scene.
- """
-
- def yafrayExposure(expose = None):
- """
- Get/set exposure adjustment, 0 is off.
- @type expose: float (optional)
- @param expose: must be between 0 - 10.0
- @rtype: float (if prototype is empty)
- @return: Current exposure adjustment for the scene.
- """
-
- def enableGameFrameStretch():
- """
- Enable stretch or squeeze the viewport to fill the display window.
- """
-
- def enableGameFrameExpose():
- """
- Enable show the entire viewport in the display window, viewing more
- horizontally or vertically.
- """
-
- def enableGameFrameBars():
- """
- Enable show the entire viewport in the display window, using bar
- horizontally or vertically.
- """
-
- def setGameFrameColor(red, green, blue):
- """
- Set the red, green, blue component of the bars.
- @type red: float
- @param red: must be between 0 - 1.0
- @type green: float
- @param green: must be between 0 - 1.0
- @type blue: float
- @param blue: must be between 0 - 1.0
- """
-
- def getGameFrameColor():
- """
- Set the red, green, blue component of the bars.
- @rtype: string
- @return: A string representing the color component of the bars.
- """
-
- def gammaLevel(level = None):
- """
- Get/set the gamma value for blending oversampled images (1.0 = no correction).
- Unified renderer must be enabled.
- @type level: float (optional)
- @param level: must be between 0.2 - 5.0
- @rtype: float (if prototype is empty)
- @return: Current gamma value for the scene.
- """
-
- def postProcessAdd(add = None):
- """
- Get/set post processing add.
- Unified renderer must be enabled.
- @type add: float (optional)
- @param add: must be between -1.0 - 1.0
- @rtype: float (if prototype is empty)
- @return: Current processing add value for the scene.
- """
-
- def postProcessMultiply(mult = None):
- """
- Get/set post processing multiply.
- Unified renderer must be enabled.
- @type mult: float (optional)
- @param mult: must be between 0.01 - 4.0
- @rtype: float (if prototype is empty)
- @return: Current processing multiply value for the scene.
- """
-
- def postProcessGamma(gamma = None):
- """
- Get/set post processing gamma.
- Unified renderer must be enabled.
- @type gamma: float (optional)
- @param gamma: must be between 0.2 - 2.0
- @rtype: float (if prototype is empty)
- @return: Current processing gamma value for the scene.
- """
-
- def SGIMaxsize(size = None):
- """
- Get/set maximum size per frame to save in an SGI movie.
- SGI must be defined on your machine.
- @type size: int (optional)
- @param size: must be between 0 - 500
- @rtype: int (if prototype is empty)
- @return: Current SGI maximum size per frame for the scene.
- """
-
- def enableSGICosmo(toggle):
- """
- Enable/disable attempt to save SGI movies using Cosmo hardware
- SGI must be defined on your machine.
- @type toggle: int
- @param toggle: pass 1 for on / 0 for off
- """
-
- def oldMapValue(value = None):
- """
- Get/set specify old map value in frames.
- @type value: int (optional)
- @param value: must be between 1 - 900
- @rtype: int (if prototype is empty)
- @return: Current old map value for the scene.
- """
-
- def newMapValue(value = None):
- """
- Get/set specify new map value in frames.
- @type value: int (optional)
- @param value: must be between 1 - 900
- @rtype: int (if prototype is empty)
- @return: Current new map value for the scene.
- """
-
- def addRenderLayer():
- """
- Add a new render layer to the rendering context, see L{RenderLayer}.
- @rtype: RenderLayer
- @return: The newly created renderlayer.
- """
-
- def removeRenderLayer(renderlayer):
- """
- Remove the specified render layer from the rendering context.
- @type renderlayer: L{RenderLayer}
- @param renderlayer: must be a L{RenderLayer}
- """
diff --git a/source/blender/python/api2_2x/doc/Renderlayer.py b/source/blender/python/api2_2x/doc/Renderlayer.py
deleted file mode 100644
index 60b8ec46b74..00000000000
--- a/source/blender/python/api2_2x/doc/Renderlayer.py
+++ /dev/null
@@ -1,92 +0,0 @@
-# Blender.Scene.Render.RenderLayer module and the RenderLayer PyType object
-
-"""
-The Blender.Scene.Render.RenderLayer submodule.
-
-Scene.Render.RenderLayer
-========================
-
-This module provides access to B{Render Layers} in Blender.
-
-Example::
- import bpy
- sce = bpy.data.scenes.active
- render = sce.render
- layer = render.addRenderLayer()
- render.removeRenderLayer(layer)
-"""
-
-class RenderLayer:
- """
- The RenderLayer object
- ======================
- @type name: string
- @ivar name: Get or set the name for the L{RenderLayer}
- @type lightGroup: group
- @ivar lightGroup: group of lights
- @type enable: bool
- @ivar enable: enable this render layer
- @type enableZMask: bool
- @ivar enableZMask: Only render what's in front of the solid z values
- @type enableZMaskAll: bool
- @ivar enableZMaskAll: Fill in Z values for solid faces in invisible layers, for masking
- @type enableSolid: bool
- @ivar enableSolid: Render Solid faces in this Layer
- @type enableZTra: bool
- @ivar enableZTra: Render Z-Transparent faces in this Layer (On top of Solid and Halos)
- @type enableHalo: bool
- @ivar enableHalo: Render Halos in this Layer (on top of Solid)
- @type enableEdge: bool
- @ivar enableEdge: Render Edge-enhance in this Layer (only works for Solid faces)
- @type enableSky: bool
- @ivar enableSky: Render Sky or backbuffer in this Layer
- @type enableStrand: bool
- @ivar enableStrand: Render Strands in this Layer
- @type layerMask: bool
- @ivar layerMask: ...
- @type zLayerMask: bool
- @ivar zLayerMask: ...
-
- @type passCombined: bool
- @ivar passCombined: Deliver full combined RGBA buffer
- @type passZ: bool
- @ivar passZ: Deliver Z values pass
- @type passSpeed: bool
- @ivar passSpeed: Deliver Speed Vector pass
- @type passNormal: bool
- @ivar passNormal: Deliver Normal pass
- @type passUV: bool
- @ivar passUV: Deliver Texture UV pass
- @type passMist: bool
- @ivar passMist: Deliver Mist factor pass (0-1)
- @type passIndex: bool
- @ivar passIndex: Deliver Object Index pass
- @type passColor: bool
- @ivar passColor: Deliver shade-less Color pass
- @type passDiffuse: bool
- @ivar passDiffuse: Deliver Diffuse pass
- @type passSpecular: bool
- @ivar passSpecular: Deliver Specular pass
- @type passShadow: bool
- @ivar passShadow: Deliver Shadow pass
- @type passAO: bool
- @ivar passAO: Deliver AO pass
- @type passReflect: bool
- @ivar passReflect: Deliver Raytraced Reflection pass
- @type passRefract: bool
- @ivar passRefract: Deliver Raytraced Reflection pass
- @type passRadiosity: bool
- @ivar passRadiosity: Deliver Radiosity pass
-
-
- @type passSpecularXOR: bool
- @ivar passSpecularXOR: Deliver Specular pass XOR
- @type passShadowXOR: bool
- @ivar passShadowXOR: Deliver Shadow pass XOR
- @type passAOXOR: bool
- @ivar passAOXOR: Deliver AO pass XOR
- @type passRefractXOR: bool
- @ivar passRefractXOR: Deliver Raytraced Reflection pass XOR
- @type passRadiosityXOR: bool
- @ivar passRadiosityXOR: Deliver Radiosity pass XOR
- """ \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/SConscript b/source/blender/python/api2_2x/doc/SConscript
deleted file mode 100644
index eca5d9a615c..00000000000
--- a/source/blender/python/api2_2x/doc/SConscript
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-Import ('env')
-
-
-from optparse import OptionParser
-try:
- import epydoc
-except ImportError:
- print "No epydoc install detected, Python API Docs will not be generated "
-if epydoc:
- from epydoc.docbuilder import build_doc_index
- from epydoc import cli
- names = env.Glob("source/blender/python/api2_2x/doc/[A-Z]*.py")
- docindex = build_doc_index(names)
- optvalues = cli.OPTION_DEFAULTS
- optvalues["verbose"] = 1
- optvalues["target"] = env["BF_DOCDIR"]+"/BPY_API/"
- optvalues["url"] = "http://www.blender.org"
- optvalues["top"] = "API_intro"
- optvalues["name"] = "Blender"
- optvalues["noprivate"] = 1
- optvalues["noframes"] = 1
- optvalues["names"] = names
- optparser = OptionParser()
- optparser.set_defaults(**optvalues)
- (options, args) = optparser.parse_args([])
- cli.write_html(docindex, options)
-
diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py
deleted file mode 100644
index caa5b56e8d5..00000000000
--- a/source/blender/python/api2_2x/doc/Scene.py
+++ /dev/null
@@ -1,402 +0,0 @@
-# Blender.Scene module and the Scene PyType object
-
-"""
-The Blender.Scene submodule.
-
-B{New}:
- - L{Scene.clearScriptLinks<Scene.Scene.clearScriptLinks>} accepts a parameter now.
- - acess methods L{Scene.getLayers<Scene.Scene.getLayers>}, L{Scene.setLayers<Scene.Scene.setLayers>} via lists to complement the layers and
- Layers Scene attributes which use bitmasks.
-
-Scene
-=====
-
-This module provides access to B{Scenes} in Blender.
-
-Example::
- import Blender
- from Blender import Scene, Object, Camera
- #
- camdata = Camera.New('persp') # create new camera data
- camdata.name = 'newCam'
- camdata.lens = 16.0
- scene = Scene.New('NewScene') # create a new scene
- scene.objects.new(camdata,'Camera') # add a new object to the scene with newly-created data
- scene.makeCurrent() # make this the current scene
-
-@warn: B{scene.objects.new} is the preferred way to add new objects to a scene.
- The older way is to create an object with B{Object.New()}, link the
- data to the new object, then link the object to the scene. This way is
- not recommended since a forgotten step or run-time error in the script can
- cause bad things to be done to Blender's database.
-
- If you use this older method, it's recommended to always perform the
- operations in this order. This is because if
- there is no object data linked to an object B{ob}, B{scene.link(ob)} will
- automatically create the missing data. This is OK on its own, but I{if
- after that} object B{ob} is linked to obdata, the automatically created one
- will be discarded -- as expected -- but will stay in Blender's memory
- space until the program is exited, since Blender doesn't really get rid of
- most kinds of data. So first linking ObData to object, then object to
- scene is a tiny tiny bit faster than the other way around and also saves
- some realtime memory (if many objects are created from scripts, the
- savings become important).
-"""
-
-def New (name = 'Scene'):
- """
- Create a new Scene in Blender.
- @type name: string
- @param name: The Scene name.
- @rtype: Blender Scene
- @return: The created Scene.
- """
-
-def Get (name = None):
- """
- Get the Scene(s) from Blender.
- @type name: string
- @param name: The name of a Scene.
- @rtype: Blender Scene or a list of Blender Scenes
- @return: It depends on the I{name} parameter:
- - (name): The Scene with the given I{name};
- - (): A list with all Scenes currently in Blender.
- """
-
-def GetCurrent():
- """
- Get the currently active Scene in Blender.
- @rtype: Blender Scene
- @return: The currently active Scene.
- """
-
-def Unlink(scene):
- """
- Unlink (delete) a Scene from Blender.
- @type scene: Blender Scene
- @param scene: The Scene to be unlinked.
- """
-
-from IDProp import IDGroup, IDArray
-class Scene:
- """
- The Scene object
- ================
- This object gives access to Scene data in Blender.
- @type Layers: integer (bitmask)
- @ivar Layers: The Scene layers (check also the easier to use
- L{layers}). This value is a bitmask with at least
- one position set for the 20 possible layers starting from the low order
- bit. The easiest way to deal with these values in in hexadecimal
- notation.
- Example::
- scene.Layers = 0x04 # sets layer 3 ( bit pattern 0100 )
- scene.Layers |= 0x01
- print scene.Layers # will print: 5 ( meaning bit pattern 0101)
- After setting the Layers value, the interface (at least the 3d View and
- the Buttons window) needs to be redrawn to show the changes.
- @type layers: list of integers
- @ivar layers: The Scene layers (check also L{Layers}).
- This attribute accepts and returns a list of integer values in the
- range [1, 20].
- Example::
- scene.layers = [3] # set layer 3
- scene.layers = scene.layers.append(1)
- print scene.layers # will print: [1, 3]
- @type objects: sequence of objects
- @ivar objects: The scene's objects. The sequence supports the methods .link(ob), .unlink(ob), and .new(obdata), and can be iterated over.
- @type cursor: Vector (wrapped)
- @ivar cursor: the 3d cursor location for this scene.
- @type camera: Camera or None
- @ivar camera: The active camera for this scene (can be set)
- @type world: World or None
- @ivar world: The world that this scene uses (if any)
- @type timeline: Timeline
- @ivar timeline: The L{timeline<TimeLine.TimeLine>} for this scene, named markers are stored here. (read only)
- @type render: RenderData
- @ivar render: The scenes L{render<Render.RenderData>} settings. (read only)
- @type radiosity: RenderData
- @ivar radiosity: The scenes L{radiosity<Radio>} settings. (read only)
- @type halfFloat: OpenEXR's half float option
- @ivar halfFloat: boolean
- @type zbuf: OpenEXR's save zbuf option
- @ivar zbuf: boolean
- @type preview: OpenEXR's save preview option
- @ivar preview: boolean
- @type touch: enable creating empty image files while they are rendered.
- @ivar touch: boolean
- @type noOverwrite: Skip rendering existing image files
- @ivar noOverwrite: boolean
- """
-
- def getName():
- """
- Get the name of this Scene.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Scene.
- @type name: string
- @param name: The new name.
- """
-
- def getLayers():
- """
- Get the layers set for this Scene.
- @rtype: list of integers
- @return: a list where each number means the layer with that number is set.
- """
-
- def setLayers(layers):
- """
- Set the visible layers for this scene.
- @type layers: list of integers
- @param layers: a list of integers in the range [1, 20], where each available
- index makes the layer with that number visible.
- @note: if this Scene is the current one, the 3D View layers are also
- updated, but the screen needs to be redrawn (at least 3D Views and
- Buttons windows) for the changes to be seen.
- """
-
- def copy(duplicate_objects = 1):
- """
- Make a copy of this Scene.
- @type duplicate_objects: int
- @param duplicate_objects: Defines how the Scene children are duplicated:
- - 0: Link Objects;
- - 1: Link Object Data;
- - 2: Full copy.
- @rtype: Scene
- @return: The copied Blender Scene.
- """
-
- def makeCurrent():
- """
- Make this Scene the currently active one in Blender.
- """
-
- def update(full = 0):
- """
- Update this Scene in Blender.
- @type full: int
- @param full: A bool to control the level of updating:
- - 0: sort the base list of objects.
- - 1: sort and also regroup, do ipos, keys, script links, etc.
- @warn: When in doubt, try with I{full = 0} first, since it is faster.
- The "full" update is a recent addition to this method.
- """
-
- def getRenderingContext():
- """
- Get the rendering context for this scene, see L{Render}.
- @rtype: RenderData
- @return: the render data object for this scene.
- """
-
- def getRadiosityContext():
- """
- Get the radiosity context for this scene, see L{Radio}.
- @rtype: Blender Radiosity
- @return: the radiosity object for this scene.
- @note: only the current scene can return a radiosity context.
- """
-
- def getChildren():
- """
- Get all objects linked to this Scene. (B{deprecated}). B{Note}: new scripts
- should use the L{objects} attribute instead. In cases where a list is
- required use list(scn.objects).
- @rtype: list of Blender Objects
- @return: A list with all Blender Objects linked to this Scene.
- @note: L{Object.Get} will return all objects currently in Blender, which
- means all objects from all available scenes. In most cases (exporter
- scripts, for example), it's probably better to use this
- scene.GetChildren instead, since it will only access objects from this
- particular scene.
- @warn: Depricated! use scene.objects instead.
- """
-
- def getActiveObject():
- """
- Get this scene's active object.
- @note: the active object, if selected, can also be retrieved with
- L{Object.GetSelected} -- it is the first item in the returned
- list. But even when no object is selected in Blender, there can be
- an active one (if the user enters editmode, for example, this is the
- object that should become available for edition). So what makes this
- scene method different from C{Object.GetSelected()[0]} is that it can
- return the active object even when no objects are selected.
- @rtype: Blender Object or None
- @return: the active object or None if not available.
- @warn: Depricated! use scene.objects.active instead.
- """
-
- def getCurrentCamera():
- """
- Get the currently active Camera for this Scene.
- @note: The active camera can be any object type, not just a camera object.
- @rtype: Blender Object
- @return: The currently active Camera object.
- """
-
- def setCurrentCamera(camera):
- """
- Set the currently active Camera in this Scene.
- @type camera: Blender Camera
- @param camera: The new active Camera.
- """
-
- def link(object):
- """
- Link an Object to this Scene.
- @type object: Blender Object
- @param object: A Blender Object.
- """
-
- def unlink(object):
- """
- Unlink an Object from this Scene.
- @type object: Blender Object
- @param object: A Blender Object.
- @rtype: boolean
- @return: true if object was found in the scene.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Scene's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Scene. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Scene.
-
- Using OpenGL functions within a scene ScriptLink will draw graphics over the 3D view.
- There is an issue with the zoom of the floating panels also scaling graphics drawn by your scriptlink.
- This makes matching OpenGL graphics to mouse location impossible.
- Make sure that you use floating point for operations that you would usually use int functions for: glRasterPos2f rather then glRasterPos2i.
-
- The following example shows how you can use the OpenGL model view matrix to obtain the scale value.
-
- Example::
- from Blender import BGL
- view_matrix = BGL.Buffer(BGL.GL_FLOAT, 16)
- BGL.glGetFloatv(BGL.GL_MODELVIEW_MATRIX, view_matrix)
- gl_scale = 1/viewMatrix[0]
-
- # Now that we have the scale we can draw to the correct scale.
- BGL.glRect2f(10*gl_scale, 10*gl_scale, 110*gl_scale, 110*gl_scale)
-
-
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
- """
-
- def play (mode = 0, win = '<VIEW3D>'):
- """
- Play a realtime animation. This is the "Play Back Animation" function in
- Blender, different from playing a sequence of rendered images (for that
- check L{Render.RenderData.play}).
- @type mode: int
- @param mode: controls playing:
- - 0: keep playing in the biggest 'win' window;
- - 1: keep playing in all 'win', VIEW3D and SEQ windows;
- - 2: play once in the biggest VIEW3D;
- - 3: play once in all 'win', VIEW3D and SEQ windows.
- @type win: int
- @param win: window type, see L{Window.Types}. Only some of them are
- meaningful here: VIEW3D, SEQ, IPO, ACTION, NLA, SOUND. But the others
- are also accepted, since this function can be used simply as an
- interruptible timer. If 'win' is not visible or invalid, VIEW3D is
- tried, then any bigger visible window.
- @rtype: bool
- @return: 0 on normal exit or 1 when play back is canceled by user input.
- """
-
-import id_generics
-Scene.__doc__ += id_generics.attributes
-
-
-class SceneObjects:
- """
- The SceneObjects (Scene ObjectSeq) object
- =========================================
- This object gives access to the Objects in a Scene in Blender.
-
- Example::
- from Blender import Scene
- scn = Scene.GetCurrent()
-
- scn.objects.selected = [] # select none
- scn.objects.selected = scn.objects # select all
- scn.objects.context = scn.objects # select all and move into the scenes display layer
-
- # get a list of mesh objects
- obs = [ob for ob in scn.objects if ob.type == 'Mesh']
-
- # Select only these mesh objects
- scn.objects.selected = obs
-
- # print all object names
- for ob in scn.objects: print ob.name
-
- # make a list of objects that you can add and remove to
- # will not affect the current scene
- scene_obs = list(scn.objects)
-
- @ivar selected: an iterator over all the selected objects in a scene.
- @type selected: sequence of L{Object}
- @ivar context: an iterator over all the visible selected objects in a scene.
- @type context: sequence of L{Object}
- @ivar active: the active object in the scene.
- @type active: L{Object}
- @ivar camera: the active camera in the scene.
- @type camera: L{Object}
- """
-
- def new(data):
- """
- Adds a new object to the scene. Data is either object data such as a
- L{Mesh} or L{Curve}, or the string "Empty" for an Empty object. The
- type of the object is determined by the type of the data.
- @type data: string or object data
- @param data: the object data for the new object
- @return: the new object.
- @rtype: L{Object}
- """
-
- def link(object):
- """
- Adds an existing object to the scene. If the object is already linked
- to the scene, no action is taken and no exception is raised.
- @type object: L{Object}
- @param object: the object
- @rtype: None
- """
-
- def unlink(object):
- """
- Removes an object from the scene. If the object is not linked
- to the scene, no action is taken and no exception is raised.
- @type object: L{Object}
- @param object: the object
- @rtype: None
- """
-
diff --git a/source/blender/python/api2_2x/doc/Sound.py b/source/blender/python/api2_2x/doc/Sound.py
deleted file mode 100644
index bc3a929ec15..00000000000
--- a/source/blender/python/api2_2x/doc/Sound.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# Blender.Sound module and the Sound PyType object
-
-"""
-The Blender.Sound submodule.
-
-Sound
-=====
-
-This module provides access to B{Sound} objects in Blender.
-
-Example::
- import Blender
- from Blender import Sound
- #
- sound = Sound.Load("/path/to/my/sound.wav") # load a sound file
- print "Sound from", sound.filename,
- print "loaded to obj", sound.name
- print "All Sounds available now:", Sound.Get()
-
-No way to get the actual audio data is provided by this library,
-but it is included in the Python standard library (module audioop).
-Note that using that module requires a full/normal Python installation.
-"""
-
-def Load (filename):
- """
- Load the sound called 'filename' into a Sound object.
- @type filename: string
- @param filename: The full path to the sound file.
- @rtype: Blender Sound
- @return: A Blender Sound object with the data from I{filename}.
- """
-
-def Get (name = None):
- """
- Get the Sound object(s) from Blender.
- @type name: string
- @param name: The name of the Sound object.
- @rtype: Blender Sound or a list of Blender Sounds
- @return: It depends on the I{name} parameter:
- - (name): The Sound object called I{name}, None if not found;
- - (): A list with all Sound objects in the current scene.
- """
-
-
-class Sound:
- """
- The Sound object
- ================
- This object gives access to Sounds in Blender.
- @ivar filename: The filename (path) to the sound file loaded into this Sound
- @ivar packed: Boolean, True when the sample is packed (readonly).
- """
-
- def getName():
- """
- Get the name of this Sound object.
- @rtype: string
- """
-
- def getFilename():
- """
- Get the filename of the sound file loaded into this Sound object.
- @rtype: string
- """
-
- def setName():
- """
- Set the name of this Sound object.
- @rtype: None
- """
-
- def setFilename():
- """
- Set the filename of the sound file loaded into this Sound object.
- @rtype: None
- """
-
- def setCurrent():
- """
- Make this the active sound in the sound buttons window (also redraws).
- """
-
- def play():
- """
- Play this sound.
- """
-
- def getVolume():
- """
- Get this sound's volume.
- rtype: float
- """
-
- def setVolume(f):
- """
- Set this sound's volume.
- @type f: float
- @param f: the new volume value in the range [0.0, 1.0].
- """
-
- def getAttenuation():
- """
- Get this sound's attenuation value.
- rtype: float
- """
-
- def setAttenuation(f):
- """
- Set this sound's attenuation.
- @type f: float
- @param f: the new attenuation value in the range [0.0, 5.0].
- """
-
- def getPitch():
- """
- Get this sound's pitch value.
- rtype: float
- """
-
- def setPitch(f):
- """
- Set this sound's pitch.
- @type f: float
- @param f: the new pitch value in the range [-12.0, 12.0].
- """
-
- def pack():
- """
- Packs the sound into the current blend file.
- @note: An error will be raised if the sound is already packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- """
-
- def unpack(mode):
- """
- Unpacks the sound to the samples filename.
- @param mode: One of the values in Blender.Unpackmodes dict.
- @note: An error will be raised if the sound is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
-
-import id_generics
-Sound.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Sys.py b/source/blender/python/api2_2x/doc/Sys.py
deleted file mode 100644
index d7c62f2cb02..00000000000
--- a/source/blender/python/api2_2x/doc/Sys.py
+++ /dev/null
@@ -1,176 +0,0 @@
-# Blender.sys module
-
-"""
-The Blender.sys submodule.
-
-sys
-===
-
-B{New}: L{expandpath}.
-
-This module provides a minimal set of helper functions and data. Its purpose
-is to avoid the need for the standard Python module 'os', in special 'os.path',
-though it is only meant for the simplest cases.
-
-Example::
-
- import Blender
-
- filename = ""
- def f(name): # file selector callback
- global filename
- filename = name
-
- Blender.Window.FileSelector(f)
-
- if filename:
- print 'basename:', Blender.sys.basename(filename)
- print 'dirname:', Blender.sys.dirname(filename)
- print 'splitext:', Blender.sys.splitext(filename)
-
- # what would basename(splitext(filename)[0]) print?
-
-@type sep: char
-@var sep: the platform-specific dir separator for this Blender: '/'
- everywhere, except on Win systems, that use '\\'.
-@type dirsep: char
-@var dirsep: same as L{sep}.
-@type progname: string
-@var progname: the Blender executable (argv[0]).
-
-@attention: The module is called sys, not Sys.
-"""
-
-def basename (path):
- """
- Get the base name (filename stripped from dir info) of 'path'.
- @type path: string
- @param path: a path name
- @rtype: string
- @return: the base name
- """
-
-def dirname (path):
- """
- Get the dir name (dir path stripped from filename) of 'path'.
- @type path: string
- @param path: a path name
- @rtype: string
- @return: the dir name
- """
-
-def join (dir, file):
- """
- Join the given dir and file paths, using the proper separator for each
- platform.
- @type dir: string
- @type file: string
- @param dir: the dir name, like returned from L{dirname}.
- @param file: the bare filename, like returned from L{basename}.
- @rtype: string
- @return: the resulting filename.
- @warn: this simple function isn't intended to be a complete replacement for
- the standard os.path.join() one, which handles more general cases.
- """
-
-def splitext (path):
- """
- Split 'path' into (root, ext), where 'ext' is a file extension including the full stop.
-
- Example::
-
- import Blender
- file, ext= Blender.sys.splitext('/tmp/foobar.blend')
- print file, ext
- # ('/tmp/foobar', '.blend')
-
- @type path: string
- @param path: a path name
- @rtype: tuple of two strings
- @return: (root, ext)
- @note: This function will raise an error if the path is longer then 80 characters.
- """
-
-def makename (path = "Blender.Get('filename')", ext = "", strip = 0):
- """
- Remove extension from 'path', append extension 'ext' (if given)
- to the result and return it. If 'strip' is non-zero, also remove
- dirname from path.
-
- Example::
- import Blender
- from Blender.sys import *
- print makename('/path/to/myfile.txt','.abc', 1) # returns 'myfile.abc'
-
- print makename('/path/to/myfile.obj', '-01.obj') # '/path/to/myfile-01.obj'
-
- print makename('/path/to/myfile.txt', strip = 1) # 'myfile'
-
- # note that:
- print makename(ext = '.txt')
- # is equivalent to:
- print sys.splitext(Blender.Get('filename'))[0]) + '.txt'
-
- @type path: string
- @param path: a path name or Blender.Get('filename'), if not given.
- @type ext: string
- @param ext: an extension to append. For flexibility, a dot ('.') is
- not automatically included.
- @rtype: string
- @return: the resulting string
- """
-
-def exists(path):
- """
- Tell if the given pathname (file or dir) exists.
- @rtype: int
- @return:
- - 0: path does not exist;
- - 1: path is an existing filename;
- - 2: path is an existing dirname;
- - -1: path exists but is neither a regular file nor a dir.
- """
-
-def time ():
- """
- Get the current time in seconds since a fixed value. Successive calls to
- this function are guaranteed to return values greater than the previous call.
- @rtype: float
- @return: the elapsed time in seconds.
- """
-
-def sleep (millisecs = 10):
- """
- Sleep for the specified amount of time.
- @type millisecs: int
- @param millisecs: the amount of time in milliseconds to sleep. The default
- is 10 which is 0.1 seconds.
- """
-
-def expandpath (path):
- """
- Expand the given Blender 'path' into an absolute and valid path.
- Internally, Blender recognizes two special character sequences in paths:
- - '//' (used at the beginning): means base path -- the current .blend file's
- dir;
- - '#' characters in the filename will be replaced by the frame number.
- The expanded string can be passed to generic python functions that don't
- understand Blender's internal relative paths.
- @note: this function is also useful for obtaining the name of the image
- that will be saved when rendered.
- @note: if the passed string doesn't contain the special characters it is
- returned unchanged.
- @type path: string
- @param path: a path name.
- @rtype: string
- @return: the expanded (if necessary) path.
- """
-
-def cleanpath (path):
- """
- Clean the given 'path' by removing unneeded components such as "/./" and "/test/../"
- @type path: string
- @param path: a path name.
- @rtype: string
- @return: the cleaned (if necessary) path.
- """
diff --git a/source/blender/python/api2_2x/doc/Text.py b/source/blender/python/api2_2x/doc/Text.py
deleted file mode 100644
index 3093b636658..00000000000
--- a/source/blender/python/api2_2x/doc/Text.py
+++ /dev/null
@@ -1,224 +0,0 @@
-# Blender.Text module and the Text PyType object
-
-"""
-The Blender.Text submodule.
-
-Text Objects
-============
-
-This module provides access to B{Text} objects in Blender.
-
-Example::
- import Blender
- from Blender import Text
- #
- txt = Text.New("MyText") # create a new Text object
- print Text.Get() # current list of Texts in Blender
- txt.write("Appending some ") # appending text
- txt.write("text to my\\n") # '\\n' inserts new-line markers
- txt.write("text buffer.")
- print txt.asLines() # retrieving the buffer as a list of lines
- Text.unlink(txt) # removing a Text object
-"""
-
-def New (name = None, follow_cursor = 0):
- """
- Create a new Text object.
- @type name: string
- @param name: The Text name.
- @type follow_cursor: int
- @param follow_cursor: The text follow flag: if 1, the text display always
- follows the cursor.
- @rtype: Blender Text
- @return: The created Text Data object.
- """
-
-def Get (name = None):
- """
- Get the Text object(s) from Blender.
- @type name: string
- @param name: The name of the Text object.
- @rtype: Blender Text or a list of Blender Texts
- @return: It depends on the 'name' parameter:
- - (name): The Text object with the given name;
- - (): A list with all Text objects in the current scene.
- """
-
-def Load (filename):
- """
- Load a file into a Blender Text object.
- @type filename: string
- @param filename: The name of the file to load.
- @rtype: Blender Text
- @return: A Text object with the contents of the loaded file.
- """
-
-def unlink(textobj):
- """
- Unlink (remove) the given Text object from Blender.
- @type textobj: Blender Text
- @param textobj: The Text object to be deleted.
- """
-
-class Text:
- """
- The Text object
- ===============
- This object gives access to Texts in Blender.
- @ivar filename: The filename of the file loaded into this Text.
- @ivar mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
- @ivar nlines: The number of lines in this Text.
- """
-
- def getName():
- """
- Get the name of this Text object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Text object.
- @type name: string
- @param name: The new name.
- """
-
- def getFilename():
- """
- Get the filename of the file loaded into this Text object.
- @rtype: string
- """
-
- def getNLines():
- """
- Get the number of lines in this Text buffer.
- @rtype: int
- """
-
- def clear():
- """
- Clear this Text object: its buffer becomes empty.
- """
-
- def reset():
- """
- Reset the read IO pointer to the start of the buffer.
- """
-
- def readline():
- """
- Reads a line of text from the buffer from the current IO pointer
- position to the end of the line. If the text has changed since the last
- read, reset() *must* be called.
- @rtype: string
- """
-
- def set(attribute, value):
- """
- Set this Text's attributes.
- @type attribute: string
- @param attribute: The attribute to change:
- currently, 'follow_cursor' is the only one available. It can be
- turned 'on' with value = 1 and 'off' with value = 0.
- @type value: int
- @param value: The new attribute value.
- """
-
- def write(data):
- """
- Append a string to this Text buffer.
- @type data: string
- @param data: The string to append to the text buffer.
- """
-
- def insert(data):
- """
- Inserts a string into this Text buffer at the cursor.
- @type data: string
- @param data: The string to insert into the text buffer.
- """
-
- def asLines(start=0, end=-1):
- """
- Retrieve the contents of this Text buffer as a list of strings between
- the start and end lines specified. If end < 0 all lines from start will
- be included.
- @type start: int
- @param start: Optional index of first line of the span to return
- @type end int
- @param end: Optional index of the line to which the span is taken or
- -1 to include all lines from start
- @rtype: list of strings
- @return: A list of strings, one for each line in the buffer between
- start and end.
- """
-
- def getCursorPos():
- """
- Retrieve the position of the cursor in this Text buffer.
- @rtype: (int, int)
- @return: A pair (row, col) indexing the line and character of the
- cursor.
- """
-
- def setCursorPos(row, col):
- """
- Set the position of the cursor in this Text buffer. Any selection will
- be cleared. Use setSelectPos to extend a selection from the point
- specified here.
- @type row: int
- @param row: The index of the line in which to position the cursor.
- @type col: int
- @param col: The index of the character within the line to position the
- cursor.
- """
-
- def getSelectPos():
- """
- Retrieve the position of the selection cursor in this Text buffer.
- @rtype: (int, int)
- @return: A pair (row, col) indexing the line and character of the
- selection cursor.
- """
-
- def setSelectPos(row, col):
- """
- Set the position of the selection cursor in this Text buffer. This
- method should be called after setCursorPos to extend the selection to
- the specified point.
- @type row: int
- @param row: The index of the line in which to position the cursor.
- @type col: int
- @param col: The index of the character within the line to position the
- cursor.
- """
-
- def suggest(list, prefix=''):
- """
- Suggest a list of names. If list is a list of tuples (name, type) the
- list will be formatted to syntax-highlight each entry type. Types must
- be strings in the list ['m', 'f', 'v', 'k', '?']. It is recommended that
- the list be sorted, case-insensitively by name.
-
- @type list: list of tuples or strings
- @param list: List of pair-tuples of the form (name, type) where name is
- the suggested name and type is one of 'm' (module or class), 'f'
- (function or method), 'v' (variable), 'k' (keyword), '?' (other).
- Lists of plain strings are also accepted where the type is always
- '?'.
- @type prefix: string
- @param prefix: The optional prefix used to limit what is suggested from
- the list. This is usually whatever precedes the cursor so that
- backspace will update it.
- """
-
- def showDocs(docs):
- """
- Displays a word-wrapped message box containing the specified
- documentation when this Text object is visible.
- @type docs: string
- @param docs: The documentation string to display.
- """
-
-import id_generics
-Text.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Text3d.py b/source/blender/python/api2_2x/doc/Text3d.py
deleted file mode 100644
index 4bd989014f4..00000000000
--- a/source/blender/python/api2_2x/doc/Text3d.py
+++ /dev/null
@@ -1,322 +0,0 @@
-# Blender.Text3d module and the Text3d PyType object
-
-"""
-The Blender.Text3d submodule.
-
-Text3d Objects
-==============
-
-This module provides access to B{Font} objects in Blender.
-
-Example::
- import Blender
- from Blender import Curve, Object, Scene, Text3d
- txt = Text3d.New("MyText") # create a new Text3d object called MyText
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(txt) # create an object from the obdata in the current scene
- ob.makeDisplayList() # rebuild the display list for this object
- Window.RedrawAll()
-"""
-
-def New (name = None):
- """
- Create a new Text3d object.
- @type name: string
- @param name: The name for the new object..
- @rtype: Blender Text3d
- @return: The created Text3d Data object.
- """
-
-def Get (name = None):
- """
- Get the Text3d object(s) from Blender.
- @type name: string
- @param name: The name of the Text3d object.
- @rtype: Blender Text3d or a list of Blender Text3d's
- @return: It depends on the 'name' parameter:
- - (name): The Text3d object with the given name;
- - (): A list with all Text3d objects in the current scene.
- """
-class Text3d:
- """
- The Text3d object
- =================
- This object gives access Blender's B{Font} objects
- @ivar frameWidth: The width of the active frame [0.0 - 50.0]
- @ivar frameHeight: The height of the active frame [0.0 - 50.0]
- @ivar frameX: The X position of the active frame [0.0 - 50.0]
- @ivar frameY: The Y position of the active frame [0.0 - 50.0]
-
- @ivar totalFrames: The total number of text frames (read only)
- @ivar activeFrame: The active frame for this text data.
- """
-
- def getName():
- """
- Get the name of this Text3d object.
- @rtype: string
- """
-
- def setName( name ):
- """
- Set the name of this Text3d object.
- @type name: string
- @param name: The new name.
- @returns: None
- """
-
- def getText():
- """
- Get text string for this object
- @rtype: string
- """
-
- def setText( name ):
- """
- Set the text string in this Text3d object
- @type name: string
- @param name: The new text string for this object.
- @returns: None
- """
-
- def getDrawMode():
- """
- Get the drawing mode (3d, front, and/or back)
- Gets the text3d's drawing modes. Uses module constants
- - DRAW3D : "3D" is set
- - DRAWFRONT : "Front" is set
- - DRAWBACK : "Back" is set
- @rtype: tuple of module constants
- """
-
- def setDrawMode(val):
- """
- Set the text3d's drawing mode. Uses module constants
- - DRAW3D
- - DRAWFRONT
- - DRAWBACK
- @rtype: None
- @type val: single module constant or tuple of module constants
- @param val : The Text3d's modes. See L{getDrawMode} for the meaning of
- the constants.
- """
-
- def getUVordco():
- """
- Return whether UV coords are used for Texture mapping
- """
-
- def setUVordco(val):
- """
- Set the font to use UV coords for Texture mapping
- """
-
- def getBevelAmount():
- """
- Get the Text3d's bevel resolution value.
- @rtype: float
- """
-
- def setBevelAmount(bevelresol):
- """
- Set the Text3d's bevel resolution value.
- @rtype: None
- @type bevelresol: float
- @param bevelresol: The new Curve's bevel resolution value.
- """
-
- def getDefaultResolution():
- """
- Return Default text resolution.
- @rtype: float
- """
-
- def setDefaultResolution(resolu):
- """
- Sets Default text Resolution.
- @rtype: None
- @type resolu: float
- @param resolu: The new Curve's U-resolution value.
- """
-
- def getWidth():
- """
- Get the Text3d's width value.
- @rtype: float
- """
-
- def setWidth(width):
- """
- Set the Text3d's width value.
- @rtype: None
- @type width: float
- @param width: The new text3d's width value.
- """
-
- def getExtrudeDepth():
- """
- Get the text3d's ext1 value.
- @rtype: float
- """
-
- def setExtrudeDepth(ext1):
- """
- Set the text3d's ext1 value.
- @rtype: None
- @type ext1: float
- @param ext1: The new text3d's ext1 value.
- """
-
- def getExtrudeBevelDepth():
- """
- Get the text3d's ext2 value.
- @rtype: float
- """
-
- def setExtrudeBevelDepth(ext2):
- """
- Set the text3d's ext2 value.
- @rtype: None
- @type ext2: float
- @param ext2: The new text3d's ext2 value.
- """
-
- def getShear():
- """
- Get the text3d's shear value.
- @rtype: float
- """
-
- def setShear(shear):
- """
- Set the text3d's shear value.
- @rtype: None
- @type shear: float
- @param shear: The new text3d's shear value.
- """
-
- def getSize():
- """
- Get the text3d's size value.
- @rtype: float
- """
-
- def setSize(size):
- """
- Set the text3d's size value.
- @rtype: None
- @type size: float
- @param size: The new text3d's size value.
- """
-
- def getLineSeparation():
- """
- Get the text3d's ext2 value.
- @rtype: float
- """
-
- def setLineSeparation(sep):
- """
- Set the text3d's ext2 value.
- @rtype: None
- @type sep: float
- @param sep: The new text3d's separation value.
- """
-
- def getSpacing():
- """
- Get the text3d's spacing value.
- @rtype: float
- """
-
- def setSpacing(spacing):
- """
- Set the text3d's spacing value.
- @rtype: None
- @type spacing: float
- @param spacing: The new text3d's spacing value.
- """
-
- def getXoffset():
- """
- Get the text3d's Xoffset value.
- @rtype: float
- """
-
- def setXoffset(xof):
- """
- Set the text3d's Xoffset value.
- @rtype: None
- @type xof: float
- @param xof: The new text3d's Xoffset value.
- """
-
- def getYoffset():
- """
- Get the text3d's Yoffset value.
- @rtype: float
- """
-
- def setYoffset(yof):
- """
- Set the text3d's Yoffset value.
- @rtype: None
- @type yof: float
- @param yof: The new text3d's Yoffset value.
- """
-
- def getAlignment():
- """
- Get the text3d's alignment value. Uses module constants
- - LEFT
- - RIGHT
- - MIDDLE
- - FLUSH
- @rtype: module constant
- """
-
- def setAlignment(align):
- """
- Set the text3d's Alignment value. Uses module constants
- - LEFT
- - RIGHT
- - MIDDLE
- - FLUSH
- @rtype: None
- @type align: module constant
- @param align: The new text3d's Alignment value.
- """
-
- def getMaterial(index):
- """
- get the material index of a character.
- @rtype: int
- @return: the material index if the character
- @type index: int
- @param index: the index of the character in a string
- """
-
- def setMaterial(index, material_index):
- """
- Set a characters material.
- @note: after changing this youll need to update the object with object.makeDisplayList() to see the changes.
- @rtype: None
- @type index: int
- @param index: the index of the character in a string
- @type material_index: int
- @param material_index: the material index set set the character.
- """
-
- def addFrame():
- """
- Adds a text frame. maximum number of frames is 255.
- @rtype: None
- """
-
- def removeFrame(index):
- """
- Removed the frame at this index
- @rtype: None
- """
-import id_generics
-Text3d.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py
deleted file mode 100644
index ad57c303ed2..00000000000
--- a/source/blender/python/api2_2x/doc/Texture.py
+++ /dev/null
@@ -1,612 +0,0 @@
-#
-# Blender.Texture module and the Texture PyType object
-#
-# Written by Alex Mole
-#
-
-"""
-The Blender.Texture submodule.
-
-B{New}:
- - many new attributes in L{MTex} submodule
- - new dictionaries (L{Texture.BlendModes}, L{Texture.Mappings}, L{Texture.Proj}) to use for the values of some of the new L{MTex} attributes.
-
-Texture
-=======
-
-This module provides access to B{Texture} objects in Blender.
-
-Example::
-
- from Blender import Texture,Image,Material
-
- footex = Texture.Get('foo') # get texture named 'foo'
- footex.setType('Image') # make foo be an image texture
- img = Image.Load('test.png') # load an image
- footex.image = img # link the image to the texture
-
- mat = Material.Get('bar') # get a material
- mtextures = mat.getTextures() # get a list of the MTex objects
- for mtex in mtextures:
- if mtex.tex.type == Texture.Types.IMAGE:
- print mtex.tex.image.filename # print the filenames of all the
- # images in textures linked to "bar"
-
- mat.setTexture(0, footex) # set the material's first texture
- # to be our texture
-
-
-@type Types: readonly dictionary
-@var Types: The available texture types:
- - NONE - No texture
- - CLOUDS - Clouds texture
- - WOOD - Wood texture
- - MARBLE - Marble texture
- - MAGIC - Magic texture
- - BLEND - Blend texture
- - STUCCI - Stucci texture
- - NOISE - Noise texture
- - IMAGE - Image texture
- - PLUGIN - Plugin texture
- - ENVMAP - EnvMap texture
- - MUSGRAVE - Musgrave procedural texture
- - VORONOI - Voronoi procedural texture
- - DISTNOISE - Distorted noise texture
-
-@type Flags: readonly dictionary
-@var Flags: The available Texture flags:
- - FLIPBLEND - Flips the blend texture's X and Y directions
- - NEGALPHA - Reverse the alpha value
- - CHECKER_ODD - Fill the "odd" checkerboard tiles
- - CHECKER_EVEN - Fill the "even" checkerboard tiles
- - COLORBAND - Enable colorband for this texture
- - PREVIEW_ALPHA - Show alpha in preview
- - REPEAT_XMIR - Mirrors X direction repeat
- - REPEAT_YMIR - Mirrors Y direction repeat
-
-@type ImageFlags: readonly dictionary
-@var ImageFlags: The available image flags for Texture.imageFlags:
- - INTERPOL - Interpolate pixels of the image
- - USEALPHA - Use the alpha layer
- - MIPMAP - Enable mipmapping [cannot be used with FIELDS]
- - FIELDS - Work with field images [cannot be used with MIPMAP]
- - ROT90 - Rotate the image 90 degrees when rendering
- - CALCALPHA - Calculate an alpha from the RGB
- - STFIELD - Denotes this is a standard field
- - MOVIE - Use a movie for an image
- - CYCLIC - Repeat animation image
- - ANTI - Use anti-aliasing
- - NORMALMAP - Use image RGB values for normal mapping
-
-@type ExtendModes: readonly dictionary
-@var ExtendModes: Extend, clip, repeat or checker modes for image textures
- - EXTEND - Extends the color of the edge
- - CLIP - Return alpha 0.0 outside image
- - CLIPCUBE - Return alpha 0.0 around cube-shaped area around image
- - REPEAT - Repeat image vertically and horizontally
- - CHECKER - Repeat image in checkerboard pattern
-
-@type Noise: readonly dictionary
-@var Noise: Noise types and bases. SINE, SAW and TRI are only used for
- marble and wood textures, while the remainder are used for all textures
- which has a noise basis function (for these textures, the constant should
- be used with the second noise basis setting).
- - SINE - Produce bands using sine wave (marble, wood textures)
- - SAW - Produce bands using saw wave (marble, wood textures)
- - TRI - Produce bands using triangle wave (marble, wood textures)
- - BLENDER - Original Blender algorithm
- - PERLIN - Ken Perlin's original (1985) algorithm
- - IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
- - VORONOIF1 - none
- - VORONOIF2 - none
- - VORONOIF3 - none
- - VORONOIF4 - none
- - VORONOIF2F1 - none
- - VORONOICRACKLE - none
- - CELLNOISE - Steven Worley's cellular basis algorithm (1996)
-
-@type BlendModes: readonly dictionary
-@var BlendModes: The available texture blending modes:
- - MIX - mix texture with value
- - MULTIPLY - multiply texture with value
- - ADD - add texture to value
- - SUBTRACT - subtract texture from value
- - DIVIDE - divide value by texture
- - DARKEN - replace value with texture if texture is darker
- - DIFFERENCE - difference of texture from value
- - LIGHTEN - replace value with texture if texture is lighter
- - SCREEN - 'screen' mode
-
-@type Mappings: readonly dictionary
-@var Mappings: The available 2D texture coordinate mappings for images:
- - FLAT - flat projection
- - CUBE - cube projection
- - TUBE - cylindrical projection
- - SPHERE - spherical projection
-
-@type Proj: readonly dictionary
-@var Proj: The available projections per axis:
- - NONE - axis isn't used
- - X - axis is used as final x axis
- - Y - axis is used as final y axis
- - Z - axis is used as final z axis
-
-@type STypes: readonly dictionary
-@var STypes: Texture-type specific data. Depending on the value of
- Texture.type, certain groups will make sense. For instance, when a texture
- is of type CLOUD, the CLD_xxx stypes can be used. Note that the first
- value in each group is the default.
- 1. Clouds type
- - CLD_DEFAULT - Monochromatic noise
- - CLD_COLOR - RGB noise
- 2. Wood type
- - WOD_BANDS - Use standard wood texture
- - WOD_RINGS - Use wood rings
- - WOD_BANDNOISE - Add noise to standard wood
- - WOD_RINGNOISE - Add noise to rings
- 3. Magic type
- - MAG_DEFAULT - Magic has no STypes
- 4. Marble type
- - MBL_SOFT - Use soft marble
- - MBL_SHARP - Use more clearly defined marble
- - MBL_SHARPER - Use very clearly dfefined marble
- 5. Blend type
- - BLN_LIN - Use a linear progression
- - BLN_QUAD - Use a quadratic progression
- - BLN_EASE - Uses a more complicated blend function
- - BLN_DIAG - Use a diagonal progression
- - BLN_SPHERE - Use a progression with the shape of a sphere
- - BLN_HALO - Use a quadratic progression with the shape of a sphere
- 6. Stucci type
- - STC_PLASTIC - Standard stucci
- - STC_WALLIN - Creates dimples
- - STC_WALLOUT - Creates ridges
- 7. Noise type
- - NSE_DEFAULT - Noise has no STypes
- 8. Image type
- - IMG_DEFAULT - Image has no STypes
- 9. Plugin type
- - PLG_DEFAULT - Plugin has no STypes
- 10. Envmap type
- - ENV_STATIC - Calculate map only once
- - ENV_ANIM - Calculate map each rendering
- - ENV_LOAD - Load map from disk
- 11. Musgrave type
- - MUS_MFRACTAL - Hetero Multifractal
- - MUS_RIDGEDMF - Ridged Multifractal
- - MUS_HYBRIDMF - Hybrid Multifractal
- - MUS_FBM - Fractal Brownian Motion
- - MUS_HTERRAIN - Hetero Terrain
- 12. Voronoi type
- - VN_INT - Only calculate intensity
- - VN_COL1 - Color cells by position
- - VN_COL2 - Same as Col1 plus outline based on F2-F1
- - VN_COL3 - Same as Col2 multiplied by intensity
- 13. Distorted noise type
- - DN_BLENDER - Original Blender algorithm
- - DN_PERLIN - Ken Perlin's original (1985) algorithm
- - DN_IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
- - DN_VORONOIF1 - none
- - DN_VORONOIF2 - none
- - DN_VORONOIF3 - none
- - DN_VORONOIF4 - none
- - DN_VORONOIF2F1 - none
- - DN_VORONOICRACKLE - none
- - DN_CELLNOISE - Steven Worley's cellular basis algorithm (1996)
-
-@var TexCo: Flags for MTex.texco.
- - ORCO - Use the original coordinates of the mesh (material texture only)
- - REFL - Use reflection vector as texture coordinates (material texture only)
- - NOR - Use normal vector as texture coordinates (material texture only)
- - GLOB - Use global coordinates for the texture coordinates
- - UV - Use UV coordinates for texture coordinates (material texture only)
- - OBJECT - Use linked object's coordinates for texture coordinates
- - WIN - Use screen coordinates as texture coordinates (material texture only)
- - VIEW - Use view coordinates for the texture (world and lamp texture only)
- - STICK - Use mesh sticky coordinates for the texture coordinates (material texture only)
- - STRESS - Use mesh stress coordinates for the texture coordinates (material texture only)
- - TANGENT - Use mesh tangent coordinates for the texture coordinates (material texture only)
- - ANGMAP - Uses 360 degree angular coordinates, e.g. for spherical light probes (world texture only)
- - HSPHERE - For 360 degree panorama sky, spherical mapped, only top half (world texture only)
- - HTUBE - For 360 degree panorama sky, cylindrical mapped, only top half (world texture only)
-@type TexCo: readonly dictionary
-
-@var MapTo: Flags for MTex.mapto
- - COL - Make the texture affect the basic color of the material
- - NOR - Make the texture affect the rendered normal
- - CSP - Make the texture affect the specularity color
- - CMIR - Make the texture affect the mirror color
- - REF - Make the texture affect the diffuse reflectivity value
- - SPEC - Make the texture affect the specularity value
- - HARD - Make the texture affect the hardness value
- - ALPHA - Make the texture affect the alpha value
- - EMIT - Make the texture affect the emit value
- - RAYMIR - Make the texture affect the mirror reflectivity value
- - DISP - Make the texture displace the mesh
- - TRANSLU - Make the texture affect the translucency value
- - AMB - Make the texture affect the ambient value
- - WARP - Make the texture affect texture coordinates for the following textures
-@type MapTo: readonly dictionary
-
-"""
-
-def New (name = 'Tex'):
- """
- Create a new Texture object.
- @type name: string
- @param name: The Texture name.
- @rtype: Blender Texture
- @return: The created Texture object.
- """
-
-def Get (name = None):
- """
- Get the Texture object(s) from Blender.
- @type name: string
- @param name: The name of the Texture.
- @rtype: Blender Texture or a list of Blender Textures
- @return: It depends on the I{name} parameter:
- - (name): The Texture object with the given I{name};
- - (): A list with all Texture objects in the current scene.
- """
-
-from IDProp import IDGroup, IDArray
-class Texture:
- """
- The Texture object
- ==================
- This object gives access to Texture-specific data in Blender.
-
- Note that many of the attributes of this object are only relevant for
- specific texture types.
-
- @ivar animFrames: Number of frames of a movie to use.
- Value is clamped to the range [0,300000].
- @type animFrames: int
- @ivar animOffset: Offsets the number of the first movie frame to use.
- Value is clamped to the range [-300000,300000].
- @type animOffset: int
- @ivar animStart: Starting frame of the movie to use.
- Value is clamped to the range [1,300000].
- @type animStart: int
- @ivar anti: Image anti-aliasing enabled. Also see L{ImageFlags}.
- @type anti: int
- @ivar brightness: Changes the brightness of a texture's color.
- Value is clamped to the range [0.0,2.0].
- @type brightness: float
- @ivar calcAlpha: Calculation of image's alpha channel enabled. Also see L{ImageFlags}.
- @type calcAlpha: int
- @ivar contrast: Changes the contrast of a texture's color.
- Value is clamped to the range [0.01,5.0].
- @type contrast: float
- @ivar crop: Sets the cropping extents (for image textures).
- @type crop: tuple of 4 ints
- @ivar cyclic: Looping of animated frames enabled. Also see L{ImageFlags}.
- @type cyclic: boolean
- @ivar distAmnt: Amount of distortion (for distorted noise textures).
- Value is clamped to the range [0.0,10.0].
- @type distAmnt: float
- @ivar distMetric: The distance metric (for Voronoi textures).
- @type distMetric: int
- @ivar exp: Minkovsky exponent (for Minkovsky Voronoi textures).
- Value is clamped to the range [0.01,10.0].
- @type exp: float
- @ivar extend: Texture's 'Extend' mode (for image textures). See L{ExtendModes}.
- @type extend: int
- @ivar fields: Use of image's fields enabled. Also see L{ImageFlags}.
- @type fields: int
- @ivar fieldsPerImage: Number of fields per rendered frame.
- Value is clamped to the range [1,200].
- @type fieldsPerImage: int
- @ivar filterSize: The filter size (for image and envmap textures).
- Value is clamped to the range [0.1,25.0].
- @type filterSize: float
- @ivar flags: Texture's 'Flag' bitfield. See L{Flags}.
- bitmask.
- @type flags: int
- @ivar hFracDim: Highest fractional dimension (for Musgrave textures).
- Value is clamped to the range [0.0001,2.0].
- @type hFracDim: float
- @ivar iScale: Intensity output scale (for Musgrave and Voronoi textures).
- Value is clamped to the range [0.0,10.0].
- @type iScale: float
- @ivar image: Texture's image object.
- @type image: Blender Image (or None)
- @ivar imageFlags: Texture's 'ImageFlags' bits.
- @type imageFlags: int
- @ivar interpol: Interpolate image's pixels to fit texture mapping enabled. Also see L{ImageFlags}.
- @type interpol: int
- @ivar ipo: Texture Ipo data.
- Contains the Ipo if one is assigned to the object, B{None} otherwise. Setting to B{None} clears the current Ipo..
- @type ipo: Blender Ipo
- @ivar lacunarity: Gap between succesive frequencies (for Musgrave textures).
- Value is clamped to the range [0.0,6.0].
- @type lacunarity: float
- @ivar mipmap: Mipmaps enabled. Also see L{ImageFlags}.
- @type mipmap: int
- @ivar movie: Movie frames as images enabled. Also see L{ImageFlags}.
- @type movie: int
- @ivar noiseBasis: Noise basis type (wood, stucci, marble, clouds,
- Musgrave, distorted). See L{Noise} dictionary.
- @type noiseBasis: int
- @ivar noiseBasis2: Additional noise basis type (wood, marble, distorted
- noise). See L{Noise} dictionary.
- @type noiseBasis2: int
- @ivar noiseDepth: Noise depth (magic, marble, clouds).
- Value is clamped to the range [0,6].
- @type noiseDepth: int
- @ivar noiseSize: Noise size (wood, stucci, marble, clouds, Musgrave,
- distorted noise).
- Value is clamped to the range [0.0001,2.0].
- @type noiseSize: float
- @ivar noiseType: Noise type (for wood, stucci, marble, clouds textures). Valid values are 'hard' or 'soft'.
- @type noiseType: string
- @ivar normalMap: Use of image RGB values for normal mapping enabled.
- Also see L{ImageFlags}.
- @type normalMap: int
- @ivar octs: Number of frequencies (for Musgrave textures).
- Value is clamped to the range [0.0,8.0].
- @type octs: float
- @ivar offset: Fractal offset (for hetero terrain and multifractal Musgrave textures).
- Value is clamped to the range [0.0,6.0].
- @type offset: float
- @ivar gain: Gain multiplier (for multifractal Musgrave textures).
- Value is clamped to the range [0.0,6.0].
- @type gain: float
- @ivar repeat: Repetition multiplier (for image textures).
- @type repeat: tuple of 2 ints
- @ivar rgbCol: RGB color tuple.
- @type rgbCol: tuple of 3 floats
- @ivar rot90: X/Y flip for rendering enabled. Also see L{ImageFlags}.
- @type rot90: int
- @ivar saw: Produce bands using saw wave (marble, wood textures). Also see L{Noise}.
- @type saw: int
- @ivar sine: Produce bands using sine wave (marble, wood textures). Also see L{Noise}.
- @type sine: int
- @ivar stField: Standard field deinterlacing enabled. Also see L{ImageFlags}.
- @type stField: int
- @ivar stype: Texture's 'SType' mode. See L{STypes}.
- @type stype: int
- @ivar tri: Produce bands using triangle wave (marble, wood textures). Also see L{Noise}.
- @type tri: int
- @ivar turbulence: Turbulence (for magic, wood, stucci, marble textures).
- Value is clamped to the range [0.0,200.0].
- @type turbulence: float
- @ivar type: Texture's 'Type' mode. See L{Types}.
- Value must be in the range [0,13].
- @type type: int
- @ivar useAlpha: Use of image's alpha channel enabled. Also see L{ImageFlags}.
- @type useAlpha: int
- @ivar weight1: Weight 1 (for Voronoi textures).
- Value is clamped to the range [-2.0,2.0].
- @type weight1: float
- @ivar weight2: Weight 2 (for Voronoi textures).
- Value is clamped to the range [-2.0,2.0].
- @type weight2: float
- @ivar weight3: Weight 3 (for Voronoi textures).
- Value is clamped to the range [-2.0,2.0].
- @type weight3: float
- @ivar weight4: Weight 4 (for Voronoi textures).
- Value is clamped to the range [-2.0,2.0].
- @type weight4: float
- @ivar colorband: Texture colorband, a list of colors,
- each color a list of 5 floats [0 - 1], [r,g,b,a,pos].
- The colorband can have between 1 and 31 colors.
- @type colorband: list
- @ivar autoRefresh: Refresh image on frame changes enabled.
- @type autoRefresh: boolean
- """
-
- def getExtend():
- """
- Get the extend mode of the texture. See L{setExtend}.
- @rtype: string.
- """
-
- def getImage():
- """
- Get the Image associated with this texture (or None).
- @rtype: Blender Image
- """
-
- def getName():
- """
- Get the name of this Texture object.
- @rtype: string
- """
-
- def getType():
- """
- Get this Texture's type. See L{setType}.
- @rtype: string
- """
-
- def setExtend(extendmode):
- """
- Set the extend mode of this texture (only used for IMAGE textures)
- @param extendmode: The new extend mode. One of:
- 'Extend', 'Clip', 'ClipCube' and 'Repeat'
- @type extendmode: string
- """
-
- def setFlags(f1=None, f2=None, f3=None, f4=None):
- """
- Set this object's flags.
- @param f1, f2, f3, f4: Flags to be set (omitted flags are cleared). Can be any of
- 'FlipBlendXY', 'NegAlpha', 'CheckerOdd', and 'CheckerEven'
- @type f1, f2, f3, f4: string
- """
-
- def setImage(image):
- """
- Set the Image of this texture.
- @param image: The new Image.
- @type image: Blender Image or None.
- @warning: This sets the texture's type to 'Image' if it is not already.
- """
-
- def setImageFlags(f1=None, f2=None, f3=None, etc=None):
- """
- Set the Image flags (only makes sense for IMAGE textures). Omitted
- flags are cleared.
- @param f1, f2, f3, etc: Flag to set. See L{ImageFlags} for their meanings. Can be
- any of: 'InterPol', 'UseAlpha', 'MipMap', 'Fields', 'Rot90',
- 'CalcAlpha', 'Cyclic', 'Movie', 'StField', 'Anti' and 'NormalMap'
- @type f1, f2, f3, etc: string
- """
-
- def setName(name):
- """
- Set the name of this Texture object.
- @param name: The new name.
- @type name: string
- """
-
- def setSType(stype):
- """
- Set the SType.
- @param stype: The new stype. This can be any of the values listed in
- L{STypes} or 'Default' which sets the stype to the default value.
- @type stype: string
-
- @note: the set of valid parameters is dependent on the current
- texture type. Be sure to always set the texture type B{before}
- setting the texture's stype; otherwise an exception might occur.
- """
-
- def setType(type):
- """
- Set this Texture's type.
- @param type: The new type. Possible options are:
- 'None', 'Clouds', 'Wood', 'Marble', 'Magic', 'Blend', 'Stucci',
- 'Noise', 'Image', 'Plugin', 'EnvMap', 'Musgrave', 'Voronoi'
- and 'DistNoise'
- @type type: string
- """
- def evaluate(coord):
- """
- Evaluates the texture at this location and returns the result.
-
- The return value is a 4D vector where (x,y,z,w) are (red, green, blue, intensity)
- For greyscale textures, often intensity only will be used.
- @type coord: vector or tuple of 3 numbers
- """
-
-import id_generics
-Texture.__doc__ += id_generics.attributes
-
-class MTex:
- """
- The MTex Object
- ===============
-
- This object links a material to a texture. It allows the same texture to be
- used in several different ways.
-
- @ivar blendmode: Texture blending mode. See L{BlendModes}
- @type blendmode: int
- @ivar col: Color that the texture blends with.
- @type col: tuple
- @ivar colfac: Factor by which texture affects color.
- @type colfac: float
- @ivar correctNor: Correct normal mapping for Texture space and Object space (material only).
- @type correctNor: boolean
- @ivar dispfac: Factor by which texture affects displacement (material only).
- @type dispfac: float
- @ivar dvar: Value that the texture blends with when not blending colors.
- @type dvar: float
- @ivar fromDupli: Duplis instanced from verts, faces or particles, inherit texture coordinate from their parent (material only).
- @type fromDupli: boolean
- @ivar fromOrig: Duplis derive their object coordinates from the original objects transformation (material only).
- @type fromOrig: boolean
- @ivar mapping: Mapping of texture coordinates (flat, cube, etc.) (material only). See L{Mappings}.
- @type mapping: int
- @ivar mapto: "Map to" field of texture (material only). OR'd values of L{MapTo}.
- @type mapto: int
- @ivar mtCol: How texture maps to color (material and lamp only).
- @type mtCol: int
- @ivar mtAlpha: How texture maps to alpha value (material only).
- @type mtAlpha: int
- @ivar mtAmb: How texture maps to ambient value (material only).
- @type mtAmb: int
- @ivar mtCmir: How texture maps to mirror color (material only).
- @type mtCmir: int
- @ivar mtCsp: How texture maps to specularity color (material only).
- @type mtCsp: int
- @ivar mtDisp: How texture maps to displacement (material only).
- @type mtDisp: int
- @ivar mtEmit: How texture maps to emit value (material only).
- @type mtEmit: int
- @ivar mtHard: How texture maps to hardness (material only).
- @type mtHard: int
- @ivar mtNor: How texture maps to normals (material only).
- @type mtNor: int
- @ivar mtRayMir: How texture maps to RayMir value (material only).
- @type mtRayMir: int
- @ivar mtRef: How texture maps to reflectivity (material only).
- @type mtRef: int
- @ivar mtSpec: How texture maps to specularity (material only).
- @type mtSpec: int
- @ivar mtTranslu: How texture maps to translucency (material only).
- @type mtTranslu: int
- @ivar mtWarp: How texture maps to warp (material only).
- @type mtWarp: int
- @ivar mtBlend: Texture affects color progression of background (world only).
- @type mtBlend: int
- @ivar mtHoriz: Texture affects color of the horizon (world only).
- @type mtHoriz: int
- @ivar mtZenUp: Texture affects color of the zenith above (world only).
- @type mtZenUp: int
- @ivar mtZenDown: Texture affects color of the zenith below (world only).
- @type mtZenDown: int
- @ivar neg: Negate texture values mode.
- @type neg: boolean
- @ivar norfac: Factor by which texture affects normal (material and world only).
- @type norfac: float
- @ivar noRGB: Convert texture RGB values to intensity values.
- @type noRGB: boolean
- @ivar object: Object whose space to use when texco is Object.
- @type object: Blender Object or None
- @ivar ofs: Offset to adjust texture space.
- @type ofs: tuple
- @ivar size: Size to scale texture space.
- @type size: tuple
- @ivar stencil: Stencil mode.
- @type stencil: boolean
- @ivar tex: The Texture this is linked to.
- @type tex: Blender Texture
- @ivar texco: Texture coordinates ("Map input"). See L{TexCo}.
- @type texco: int
- @ivar uvlayer: The name of the UV Layer this texture is mapped to (when left blank uses render layer) (material only).
- @type uvlayer: string
- @ivar varfac: Factor by which texture affects most variables (material and world only).
- @type varfac: float
- @ivar warpfac: Factor by which texture affects warp (material only).
- @type warpfac: float
- @ivar xproj: Projection of X axis to Texture space (material only). See L{Proj}
- @type xproj: int
- @ivar yproj: Projection of Y axis to Texture space (material only). See L{Proj}
- @type yproj: int
- @ivar zproj: Projection of Z axis to Texture space (material only). See L{Proj}
- @type zproj: int
- """
-
- def getIpo():
- """
- Get the Ipo associated with this texture object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this texture object.
- @type ipo: Blender Ipo
- @param ipo: a "texture data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this texture object.
- @return: True if there was an ipo linked or False otherwise.
- """
diff --git a/source/blender/python/api2_2x/doc/Theme.py b/source/blender/python/api2_2x/doc/Theme.py
deleted file mode 100644
index 90d0f8395a3..00000000000
--- a/source/blender/python/api2_2x/doc/Theme.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# Blender.Window.Theme submodule and the Theme PyType object
-
-"""
-The Blender.Window.Theme submodule.
-
-Theme
-=====
-
-This module provides access to B{Theme} objects in Blender.
-
-Example::
- # this is a simplified version of the save_theme.py script
- # shipped with Blender:
- import Blender
- from Blender.Window import Theme, FileSelector
-
- theme = Theme.Get()[0] # get current theme
-
- def write_theme(filename):
- "Write the current theme as a BPython script"
-
- f = file(filename, "w")
-
- f.write("import Blender")
- f.write("from Blender.Window import Theme")
- f.write("theme = Theme.New('%s')" % theme.name)
-
- for tsp in theme.get(): # write each theme space
- command = "\\n%s = theme.get('%s')" % (tsp, tsp)
- f.write(command + "\\n")
- exec(command)
- exec("vars = dir(%s)" % tsp)
- vars.remove('theme')
-
- for var in vars: # write each variable from each theme space
- v = "%s.%s" % (tsp, var)
- exec("value = %s" % v)
- f.write("%s = %s\\n" % (v, value))
-
- f.write('\\nBlender.Redraw(-1)') # redraw to update the screen
- f.close()
-
- FileSelector(write_theme, "Save Current Theme", default_fname)
-"""
-
-def New (name = "New Theme", theme = '<default>'):
- """
- Create a new Theme object.
- @type name: string
- @param name: The name of the new theme.
- @type theme: Blender Theme
- @param theme: a base theme to copy all data from. It defaults to the current
- one.
- @rtype: Blender Theme
- @return: A new Blender Theme object.
- """
-
-def Get (name = None):
- """
- Get the Theme object(s) from Blender.
- @type name: string
- @param name: The name of the Theme object.
- @rtype: Blender Theme or a list of Blender Themes
- @return: It depends on the I{name} parameter:
- - (name): The Theme object called I{name}, None if not found;
- - (): A list with all Theme objects currently in Blender.
- """
-
-
-class Theme:
- """
- The Theme object
- ================
- This object gives access to Themes in Blender. Each Theme object is
- composed of one UI (Use Interface) theme and many Space themes
- (3d view, Text Editor, Buttons window, etc).
- @ivar name: The name of this Theme object.
- """
-
- def getName():
- """
- Get the name of this Theme object.
- @rtype: string
- @return: the name of this Theme object.
- """
-
- def setName(s):
- """
- Rename this theme.
- @type s: string
- @param s: the new name.
- """
-
- def get(t = None):
- """
- Get a space or the ui (sub)theme from this Theme.
- @type t: string, int or None
- @param t: the wanted sub-theme as either:
- - int: -1 for UI or the types in L{Window.Types<Window.Types>} for the others;
- - string: use get() to know them (they are case insensitive);
- - nothing: as written above, get() returns a list of names.
- @rtype: Blender ThemeSpace or ThemeUI or list of sub-theme types as strings.
- @return: It depends on the given parameter:
- - (): a list with all available types, as strings;
- - (type): the chosen sub-theme.
- """
-
-class ThemeUI:
- """
- The User Interface sub-theme
- ============================
- This can be accessed with theme.get(t), where t can be 'ui' or -1.
- The available variables follow the internal (C coded) ThemeUI struct in
- Blender. Most of them represent rgba (red, green, blue, alpha) colors,
- with each component in the range [0, 255]. There is more than one way to
- access them.
-
- Examples::
- print outline.R
- outline.r = 180 # it's case insensitive
- outline[0] = 94 # 0 for red, 1 for green, ...
- outline = [200, 200, 200, 255] # setting all components at once
- @type theme: string
- @ivar theme: the parent Theme for this object.
- @ivar outline: theme rgba var.
- @ivar neutral: theme rgba var.
- @ivar action: theme rgba var.
- @ivar setting: theme rgba var.
- @ivar setting1: theme rgba var.
- @ivar setting2: theme rgba var.
- @ivar num: theme rgba var.
- @ivar textfield: theme rgba var.
- @ivar textfield_hi: theme rgba var.
- @ivar popup: theme rgba var.
- @ivar text: theme rgba var.
- @ivar text_hi: theme rgba var.
- @ivar menu_back: theme rgba var.
- @ivar menu_item: theme rgba var.
- @ivar menu_hilite: theme rgba var.
- @ivar menu_text: theme rgba var.
- @ivar menu_text_hi: theme rgba var.
- @type drawType: int
- @ivar drawType: the draw type (minimal, rounded, etc) in the range [1, 4].
- @type iconTheme: string
- @ivar iconTheme: the filename (without path) for the icon theme PNG in .blender/icons/
- """
-
-class ThemeSpace:
- """
- The Space sub-themes
- ====================
- There is a sub-theme for each space in Blender (except for the Scripts
- window, but it will be added soon). Please read the information about
- L{Theme.ThemeUI}, since it is also relevant here. In Blender,
- all theme spaces share the same C structure. For this reason, all of
- them here share the same variables, event though some spaces only use
- a few of them. This lower-level access is acceptable because generally
- users will prefer to use the interface to change single theme options
- and only use scripting to save or restore themes. But anyway, checking
- the Themes tab in the User Preferences space in Blender and using the
- bundled "Save current theme" script (or its simplified version written
- on the top of this page) can help you finding out any specific info you
- may need.
- @type theme: string
- @ivar theme: the parent Theme for this object.
- @ivar back: theme rgba var.
- @ivar text: theme rgba var.
- @ivar text_hi: theme rgba var.
- @ivar header: theme rgba var.
- @ivar panel: theme rgba var.
- @ivar shade1: theme rgba var.
- @ivar shade2: theme rgba var.
- @ivar hilite: theme rgba var.
- @ivar grid: theme rgba var.
- @ivar wire: theme rgba var.
- @ivar select: theme rgba var.
- @ivar active: theme rgba var.
- @ivar transform: theme rgba var.
- @ivar vertex: theme rgba var.
- @ivar vertex_select: theme rgba var.
- @ivar edge: theme rgba var.
- @ivar edge_select: theme rgba var.
- @ivar edge_seam: theme rgba var.
- @ivar edge_facesel: theme rgba var.
- @ivar face: theme rgba var.
- @ivar face_select: theme rgba var.
- @ivar face_dot: theme rgba var.
- @ivar normal: theme rgba var.
- @ivar bone_solid: theme rgba var.
- @ivar bon_pose: theme rgba var.
- @ivar strip: theme rgba var.
- @ivar strip_select: theme rgba var.
- @ivar syntaxl: theme rgba var.
- @ivar syntaxn: theme rgba var.
- @ivar syntaxb: theme rgba var.
- @ivar syntaxv: theme rgba var.
- @ivar syntaxc: theme rgba var.
- @ivar movie: theme rgba var.
- @ivar image: theme rgba var.
- @ivar scene: theme rgba var.
- @ivar audio: theme rgba var.
- @ivar effect: theme rgba var.
- @ivar plugin: theme rgba var.
- @ivar transition: theme rgba var.
- @ivar meta: theme rgba var.
- @type vertex_size: int
- @ivar vertex_size: size of the vertices dots on screen in the range [1, 10].
- @type facedot_size: int
- @ivar facedot_size: size of the face dots on screen in the range [1, 10].
- """
-
diff --git a/source/blender/python/api2_2x/doc/TimeLine.py b/source/blender/python/api2_2x/doc/TimeLine.py
deleted file mode 100644
index 0f456189767..00000000000
--- a/source/blender/python/api2_2x/doc/TimeLine.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Blender.Scene.TimeLine module
-
-"""
-The Blender.Scene.TimeLine submodule.
-
-TimeLine
-========
-
-This module gives access to B{Scene TimeLine Contexts} in Blender.
-
-Example::
- import Blender
- from Blender import Scene
-
- # Only the current scene has a radiosity context.
- # Naturally, any scene can be made the current one
- # with scene.makeCurrent()
-
- scn = Scene.GetCurrent()
-
- # this is the only way to access the radiosity object:
-
- time_line = scn.getTimeLine ()
- time_line.add (50)
- time_line.add (100)
- time_line.setName (50, 'first')
- time_line.setName (100, 'second')
-
- Blender.Redraw(-1)
-"""
-
-class TimeLine:
- """
- The TimeLine object
- ===================
- This object wraps the current Scene's time line context in Blender.
- """
-
- def add(ival):
- """
- add new marker to time line
- @type ival: int
- @param ival: the frame number.
- """
-
- def delete(ival):
- """
- delete frame.
- @type ival: int
- @param ival: the frame number.
- """
-
- def setName(ival, sval):
- """
- set name of frame.
- @type ival: int
- @type sval: string
- @param ival: the frame number.
- @param sval: the frame name.
- """
-
- def getName(ival):
- """
- Get name of frame.
- @type ival: int
- @param ival: the frame number.
- @rtype: string
- @return: the frame name.
- """
-
- def getMarked(ival):
- """
- Get name of frame.
- @type ival: int
- @param ival: the frame number.
- @rtype: int|string
- @return: the list of frame number or name.
-
- """
-
diff --git a/source/blender/python/api2_2x/doc/Types.py b/source/blender/python/api2_2x/doc/Types.py
deleted file mode 100644
index d9cd70a1f5b..00000000000
--- a/source/blender/python/api2_2x/doc/Types.py
+++ /dev/null
@@ -1,93 +0,0 @@
-# The Blender.Types submodule
-
-"""
-The Blender.Types submodule
-===========================
-
-This module is a dictionary of Blender Python types, for type checking.
-
-Example::
- import Blender
- from Blender import Types, Object, NMesh, Camera, Lamp
- #
- objs = Object.Get() # a list of all objects in the current scene
- for o in objs:
- print
- print o, type(o)
- data = o.getData()
- print type(data)
- if type(data) == Types.NMeshType:
- if len(data.verts):
- print "its vertices are obviously of type:", type(data.verts[0])
- print "and its faces:", Types.NMFaceType
- elif type(data) == Types.CameraType:
- print "It's a Camera."
- elif type(data) == Types.LampType:
- print "Let there be light!"
-
-Since Blender 2.48a you can get the size of the underlying DNA structs for a collection of Blender Python types.
-
-Example::
- # loop over Types dictionary and print the struct sizes
- # -1 where the type is not supported byt the CSizeof function
- import Blender.Types as bt
- x = dir(bt)
- for t in x:
- s = 'bt.CSizeof(bt.' + t + ')'
- print t,"=", eval(s)
-
-@var ObjectType: Blender Object. The base object, linked to its specific data
- at its .data member variable.
-@var GroupType: Blender Group. A Group that references a list of objects that are a part of this group.
-@var NMeshType: Blender NMesh. The mesh structure.
-@var NMFaceType: Blender NMFace. A mesh face, with one (a point), two (an edge),
- three (a triangular face) or four (a quad face) vertices.
-@var NMVertType: Blender NMVert. A mesh vertex.
-@var NMColType: Blender NMCol. A mesh rgba color.
-@var MeshType: Blender Mesh. The mesh structure.
-@var MFaceType: Blender MFace. A mesh face, with
- three (a triangular face) or four (a quad face) vertices.
-@var MEdgeType: Blender MEdge. A mesh edge, with two vertices
-@var MVertType: Blender MVert. A mesh vertex which wraps a Blender mesh vertex
- (typically an object returned from the mesh.verts sequence).
-@var PVertType: Blender MVert. A mesh vertex which does not wrap a Blender
- mesh vertex (returned from L{Blender.Mesh.MVert()<Mesh.MVert.__init__>}).
-@var MColType: Blender MCol. A mesh rgba color.
-@var ArmatureType: Blender Armature. The "skeleton", for animating and deforming
-objects.
-@var BoneType: Blender Bone. Bones are, obviously, the "pieces" of an Armature.
-@var EditBoneType: Blender Editbone. Bones in editmode.
-@var CurveType: Blender Curve.
-@var IpoType: Blender Ipo.
-@var CurNurbType: Blender CurNurb.
-@var SurfNurbType: Blender SurfNurb.
-@var IpoCurveType: Blender IpoCurve.
-@var MetaballType: Blender Metaball.
-@var CameraType: Blender Camera.
-@var ImageType: Blender Image.
-@var LampType: Blender Lamp.
-@var TextType: Blender Text.
-@var Text3dType: Blender Text3d.
-@var MaterialType: Blender Material.
-@var SceneType: A Blender Scene. Container of all other objects.
-@var ButtonType: Blender Button. One of the Draw widgets.
-@var vectorType: Blender vector. Used in NMesh, Mesh and elsewhere.
-@var matrixType: Blender matrix.
-@var quaternionType: Blender quaternion. Used in armatures.
-@var eulerType: Blender euler.
-@var bufferType: Blender buffer. A contiguous piece of storage, used in BGL.
-@var constantType: Blender constant. A constant dictionary.
-@var rgbTupleType: Blender rgbTuple. A (red, green, blue) triplet.
-@var TextureType: Blender Texture.
-@var MTexType: Blender MTex. Links materials to a texture.
-@var IDGroupType: Blender IDProperty Group type.
-@var IDArrayType: Blender IDProperty Array type.
-"""
-
-def CSizeof (type):
- """
- Get the size in bytes of the underlying DNA struct for the given type.
- @param type: A Blender Python type.
- @type type: type
- @return: size in bytes or -1 if not supported type.
- """ \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Window.py b/source/blender/python/api2_2x/doc/Window.py
deleted file mode 100644
index 1625e4d4082..00000000000
--- a/source/blender/python/api2_2x/doc/Window.py
+++ /dev/null
@@ -1,544 +0,0 @@
-# Blender.Window module and the Window PyType object
-
-"""
-The Blender.Window submodule.
-
-B{New}: renamed ViewLayer to L{ViewLayers} (actually added an alias, so both
-forms will work).
-
-Window
-======
-
-This module provides access to B{Window} functions in Blender.
-
-Example:
---------
-
-FileSelector::
-
- import Blender
- from Blender import Window
- #
- def my_callback(filename): # callback for the FileSelector
- print "You chose the file:", filename # do something with the chosen file
- #
- Window.FileSelector (my_callback, "Choose one!")
-
-Example:
---------
-
-DrawProgressBar::
-
- import Blender
- from Blender.Window import DrawProgressBar
- #
- # substitute the bogus_*() function calls for your own, of course.
- #
- DrawProgressBar (0.0, "Importing data ...")
- bogus_importData()
- DrawProgressBar (0.3, "Building something")
- bogus_build()
- DrawProgressBar (0.8, "Updating Blender")
- bogus_update()
- DrawProgressBar (1.0, "Finished")
- #
- # another example:
- #
- number = 1
- while number < 20:
- file = filename + "00%d" % number
- DrawProgressBar (number / 20.0, "Loading texture: %s" % file)
- Blender.Image.Load(file)
- number += 1
-
- DrawProgressBar (1.0, "Finished loading")
-
-
-@type Types: readonly dictionary
-@var Types: The available Window Types.
- - ACTION
- - BUTS
- - FILE
- - IMAGE
- - IMASEL
- - INFO
- - IPO
- - NLA
- - OOPS
- - SCRIPT
- - SEQ
- - SOUND
- - TEXT
- - VIEW3D
-
-@type Qual: readonly dictionary
-@var Qual: Qualifier keys (shift, control, alt) bitmasks.
- - LALT: left ALT key
- - RALT: right ALT key
- - ALT: any ALT key, ...
- - LCTRL
- - RCTRL
- - CTRL
- - LSHIFT
- - RSHIFT
- - SHIFT
-
-@type MButs: readonly dictionary
-@var MButs: Mouse buttons.
- - L: left mouse button
- - M: middle mouse button
- - R: right mouse button
-
-@warn: The event system in Blender needs a rewrite, though we don't know when that will happen. Until then, event related functions here (L{QAdd}, L{QRead},
-L{QHandle}, etc.) can be used, but they are actually experimental and can be
-substituted for a better method when the rewrite happens. In other words, use
-them at your own risk, because though they should work well and allow many
-interesting and powerful possibilities, they can be deprecated in some future
-version of Blender / Blender Python.
-"""
-
-def Redraw (spacetype = '<Types.VIEW3D>'):
- """
- Force a redraw of a specific space type.
- @type spacetype: int
- @param spacetype: the space type, see L{Types}. By default the 3d Views are
- redrawn. If spacetype < 0, all currently visible spaces are redrawn.
- """
-
-def RedrawAll ():
- """
- Redraw all windows.
- """
-
-def QRedrawAll ():
- """
- Redraw all windows by queue event.
- """
-
-def FileSelector (callback, title = 'SELECT FILE', filename = '<default>'):
- """
- Open the file selector window in Blender. After the user selects a filename,
- it is passed as parameter to the function callback given to FileSelector().
- Example::
- import Blender
- #
- def my_function(filename):
- print 'The selected file was:', filename
- #
- Blender.Window.FileSelector (my_function, 'SAVE FILE')
- @type callback: function that accepts a string: f(str)
- @param callback: The function that must be provided to FileSelector() and
- will receive the selected filename as parameter.
- @type title: string
- @param title: The string that appears in the button to confirm the selection
- and return from the file selection window.
- @type filename: string
- @param filename: A filename. This defaults to Blender.Get('filename').
- @warn: script links are not allowed to call the File / Image Selectors. This
- is because script links global dictionaries are removed when they finish
- execution and the File Selector needs the passed callback to stay around.
- An alternative is calling the File Selector from another script (see
- L{Blender.Run}).
- """
-
-def ImageSelector (callback, title = 'SELECT IMAGE', filename = '<default>'):
- """
- Open the image selector window in Blender. After the user selects a filename,
- it is passed as parameter to the function callback given to ImageSelector().
- Example::
- import Blender
- #
- def my_function(imagename):
- print 'The selected image was:', imagename
- #
- Blender.Window.ImageSelector (my_function, 'LOAD IMAGE')
- @type callback: function that accepts a string: f(str)
- @param callback: The function that must be provided to ImageSelector() and
- will receive the selected filename as parameter.
- @type title: string
- @param title: The string that appears in the button to confirm the selection
- and return from the image selection window.
- @type filename: string
- @param filename: A filename. This defaults to L{Blender.Get}('filename').
- @warn: script links are not allowed to call the File / Image Selectors. This
- is because script links global dictionaries are removed when they finish
- execution and the File Selector needs the passed callback to stay around.
- An alternative is calling the File Selector from another script (see
- L{Blender.Run}).
- """
-
-def DrawProgressBar (done, text):
- """
- Draw a progress bar in the upper right corner of the screen. To cancel it
- prematurely, users can press the "Esc" key. Start it with done = 0 and end
- it with done = 1.
- @type done: float
- @param done: A float in [0.0, 1.0] that tells the advance in the progress
- bar.
- @type text: string
- @param text: Info about what is currently being done "behind the scenes".
- """
-
-def GetCursorPos ():
- """
- Get the current 3d cursor position.
- @rtype: list of three floats
- @return: the current position: [x, y, z].
- """
-
-def GetActiveLayer ():
- """
- Get the bitmask for the active layer.
- @note: if there is no 3d view it will return zero.
- @rtype: int
- @return: layer bitmask
- """
-
-def SetActiveLayer(layermask):
- """
- Set the bitmask for the active layer.
- @type layermask: int
- @param layermask: An integer bitmask, to use humanly readable values do (1<<0) for the first layer, (1<<19) for the last layer.
- """
-
-def SetCursorPos (coords):
- """
- Change the 3d cursor position.
- @type coords: 3 floats or a list of 3 floats
- @param coords: The new x, y, z coordinates.
- @note: if visible, the 3d View must be redrawn to display the change. This
- can be done with L{Redraw}.
- """
-
-def GetPivot ():
- """
- Get the pivot for the active 3D view.
- @rtype: int
- @return: constant - Window.PivotTypes
- """
-
-def SetPivot (pivot):
- """
- Set the pivot on the active 3D view.
- @type pivot: int
- @param pivot: constant - Window.PivotTypes
- """
-
-def WaitCursor (bool):
- """
- Set cursor to wait or back to normal mode.
-
- Example::
- Blender.Window.WaitCursor(1)
- Blender.sys.sleep(2000) # do something that takes some time
- Blender.Window.WaitCursor(0) # back
-
- @type bool: int (bool)
- @param bool: if nonzero the cursor is set to wait mode, otherwise to normal
- mode.
- @note: when the script finishes execution, the cursor is set to normal by
- Blender itself.
- """
-
-def GetViewVector ():
- """
- Get the current 3d view vector.
- @rtype: list of three floats
- @return: the current vector: [x, y, z].
- """
-
-def GetViewMatrix ():
- """
- Get the current 3d view matrix.
- @rtype: 4x4 float matrix (WRAPPED DATA)
- @return: the current matrix.
- """
-
-def GetPerspMatrix ():
- """
- Get the current 3d perspective matrix.
- @rtype: 4x4 float matrix (WRAPPED DATA)
- @return: the current matrix.
- """
-
-def EditMode(enable = -1, undo_msg = 'From script', undo = 1):
- """
- Get and optionally set the current edit mode status: in or out.
-
- Example::
- in_editmode = Window.EditMode()
- # MUST leave edit mode before changing an active mesh:
- if in_editmode: Window.EditMode(0)
- # ...
- # make changes to the mesh
- # ...
- # be nice to the user and return things to how they were:
- if in_editmode: Window.EditMode(1)
- @type enable: int
- @param enable: get/set current status:
- - -1: just return current status (default);
- - 0: leave edit mode;
- - 1: enter edit mode.
-
- It's not an error to try to change to a state that is already the
- current one, the function simply ignores the request.
- @type undo_msg: string
- @param undo_msg: only needed when exiting edit mode (EditMode(0)). This
- string is used as the undo message in the Mesh->Undo History submenu in
- the 3d view header. Max length is 63, strings longer than that get
- clamped.
- @param undo: don't save Undo information (only needed when exiting edit
- mode).
- @type undo: int
- @rtype: int (bool)
- @return: 0 if Blender is not in edit mode right now, 1 otherwise.
- @warn: this is an important function. NMesh operates on normal Blender
- meshes, not edit mode ones. If a script changes an active mesh while in
- edit mode, when the user leaves the mode the changes will be lost,
- because the normal mesh will be rebuilt based on its unchanged edit mesh.
- """
-
-def PoseMode(enable = -1):
- """
- Get and optionally set the current pose mode status: in or out.
- @type enable: int
- @param enable: get/set current status:
- - -1: just return current status (default);
- - 0: leave edit mode;
- - 1: enter edit mode.
-
- @return: 0 if Blender is not in edit mode right now, 1 otherwise.
- @warn: This uses the active armature objects posemode status, enabling pose
- mode for non armature objects will always fail.
- """
-
-def ViewLayers (layers = [], winid = None):
- """
- Get and optionally set the currently visible layers in all 3d Views.
- @type layers: list of ints
- @param layers: a list with indexes of the layers that will be visible. Each
- index must be in the range [1, 20]. If not given or equal to [], the
- function simply returns the visible ones without changing anything.
- @type winid: window id from as redurned by GetScreenInfo
- @param winid: An optional argument to set the layer of a window
- rather then setting the scene layers. For this to display in the 3d view
- the layer lock must be disabled (unlocked).
- @rtype: list of ints
- @return: the currently visible layers.
- """
-
-def GetViewQuat ():
- """
- Get the current VIEW3D view quaternion values.
- @rtype: list of floats
- @return: the quaternion as a list of four float values.
- """
-
-def SetViewQuat (quat):
- """
- Set the current VIEW3D view quaternion.
- @type quat: floats or list of floats
- @param quat: four floats or a list of four floats.
- """
-
-def GetViewOffset ():
- """
- Get the current VIEW3D offset values.
- @rtype: list of floats
- @return: a list with three floats: [x,y,z].
- @note: The 3 values returned are flipped in comparison object locations.
- """
-
-def SetViewOffset (ofs):
- """
- Set the current VIEW3D offset values.
- @type ofs: 3 floats or list of 3 floats
- @param ofs: the new view offset values.
- @note: The value you give flipped in comparison object locations.
- """
-
-def CameraView (camtov3d = 0):
- """
- Set the current VIEW3D view to the active camera's view. If there's no
- active object or it is not of type 'Camera', the active camera for the
- current scene is used instead.
- @type camtov3d: int (bool)
- @param camtov3d: if nonzero it's the camera that gets positioned at the
- current view, instead of the view being changed to that of the camera.
- """
-
-def QTest ():
- """
- Check if there are pending events in the event queue.
- @rtype: int
- @return: 0 if there are no pending events, non-zero otherwise.
- """
-
-def QRead ():
- """
- Get the next pending event from the event queue.
-
- Example::
- # let's catch all events and move the 3D Cursor when user presses
- # the left mouse button.
- from Blender import Draw, Window
-
- v3d = Window.GetScreenInfo(Window.Types.VIEW3D)
- id = v3d[0]['id'] # get the (first) VIEW3D's id
-
- done = 0
-
- while not done: # enter a 'get event' loop
- evt, val = Window.QRead() # catch next event
- if evt in [Draw.MOUSEX, Draw.MOUSEY]:
- continue # speeds things up, ignores mouse movement
- elif evt in [Draw.ESCKEY, Draw.QKEY]: done = 1 # end loop
- elif evt == Draw.SPACEKEY:
- Draw.PupMenu("Hey!|What did you expect?")
- elif evt == Draw.Redraw: # catch redraw events to handle them
- Window.RedrawAll() # redraw all areas
- elif evt == Draw.LEFTMOUSE: # left button pressed
- Window.QAdd(id, evt, 1) # add the caught mouse event to our v3d
- # actually we should check if the event happened inside that area,
- # using Window.GetMouseCoords() and v3d[0]['vertices'] values.
- Window.QHandle(id) # process the event
- # do something fancy like putting some object where the
- # user positioned the 3d cursor, then:
- Window.Redraw() # show the change in the VIEW3D areas.
-
- @rtype: list
- @return: [event, val], where:
- - event: int - the key or mouse event (see L{Draw});
- - val: int - 1 for a key press, 0 for a release, new x or y coordinates
- for mouse movement events.
- """
-
-def QAdd (win, event, val, after = 0):
- """
- Add an event to some window's (actually called areas in Blender) event queue.
- @type win: int
- @param win: the window id, see L{GetScreenInfo}.
- @type event: positive int
- @param event: the event to add, see events in L{Draw}.
- @type val: int
- @param val: 1 for a key press, 0 for a release.
- @type after: int (bool)
- @param after: if nonzero the event is put after the current queue and added
- later.
- """
-
-def QHandle (winId):
- """
- Process immediately all pending events for the given window (area).
- @type winId: int
- @param winId: the window id, see L{GetScreenInfo}.
- @note: see L{QAdd} for how to send events to a particular window.
- """
-def TestBreak ():
- """
- Return true if the user has pressed escape
- @rtype: bool
- @return: a boolean from a test if the user pressed escape
- """
-
-def GetMouseCoords ():
- """
- Get mouse's current screen coordinates.
- @rtype: list with two ints
- @return: a [x, y] list with the coordinates.
- """
-
-def SetMouseCoords (coords):
- """
- Set mouse's current screen coordinates.
- @type coords: (list of) two ints
- @param coords: can be passed as x, y or [x, y] and are clamped to stay inside
- the screen. If not given they default to the coordinates of the middle
- of the screen.
- """
-
-def GetMouseButtons ():
- """
- Get the current mouse button state (see / compare against L{MButs}).
- @rtype: int
- @return: an OR'ed flag with the currently pressed buttons.
- """
-
-def GetKeyQualifiers ():
- """
- Get the current qualifier keys state (see / compare against L{Qual}).
- @rtype: int
- @return: an OR'ed combination of values in L{Qual}.
- """
-
-def SetKeyQualifiers (qual):
- """
- Fake qualifier keys state. This is useful because some key events require
- one or more qualifiers to be active (see L{QAdd}).
- @type qual: int
- @param qual: an OR'ed combination of values in L{Qual}.
- @rtype: int
- @return: the current state, that should be equal to 'qual'.
- @warn: remember to reset the qual keys to 0 once they are not necessary
- anymore.
- """
-
-def GetAreaID ():
- """
- Get the current area's ID.
- """
-
-def GetAreaSize ():
- """
- Get the current area's size.
- @rtype: list with two ints
- @return: a [width, height] list.
- @note: the returned values are 1 pixel bigger than what L{GetScreenInfo}
- returns for the 'vertices' of the same area.
- """
-
-def GetScreenSize ():
- """
- Get Blender's screen size.
- @rtype: list with two ints
- @return: a [width, height] list.
- """
-
-def GetScreens ():
- """
- Get the names of all available screens.
- @rtype: list of strings
- @return: a list of names that can be passed to L{SetScreen}.
- """
-
-def SetScreen (name):
- """
- Set as current screen the one with the given name.
- @type name: string
- @param name: the name of an existing screen. Use L{GetScreens} to get
- a list with all screen names.
- """
-
-def GetScreenInfo (type = -1, rect = 'win', screen = ''):
- """
- Get info about the current screen setup.
- @type type: int
- @param type: the space type (see L{Types}) to restrict the
- results to. If -1 (the default), info is reported about all available
- areas.
- @type rect: string
- @param rect: the rectangle of interest. This defines if the corner
- coordinates returned will refer to:
- - the whole area: 'total'
- - only the header: 'header'
- - only the window content part (default): 'win'
- @type screen: string
- @param screen: the name of an available screen. The current one is used by
- default.
- @rtype: list of dictionaries
- @return: a list of dictionaries, one for each area in the screen. Each
- dictionary has these keys (all values are ints):
- - 'vertices': [xmin, ymin, xmax, ymax] area corners;
- - 'win': window type, see L{Types};
- - 'id': this area's id.
- """
diff --git a/source/blender/python/api2_2x/doc/World.py b/source/blender/python/api2_2x/doc/World.py
deleted file mode 100644
index d8052c609cd..00000000000
--- a/source/blender/python/api2_2x/doc/World.py
+++ /dev/null
@@ -1,353 +0,0 @@
-# Blender.World module and the World PyType
-
-"""
-The Blender.World submodule
-
-B{New}: L{World.clearScriptLinks} accepts a parameter now.
-
-World
-=====
-
-The module world allows you to access all the data of a Blender World.
-
-Example::
- import Blender
- w = Blender.Get('World') #assume there exists a world named "world"
- print w.getName()
- w.hor = [1,1,.2]
- print w.getHor()
-
-Example::
- import Blender
- from Blender import *
-
- AllWorlds = Blender.World.Get() # returns a list of created world objects
- AvailWorlds = len(AllWorlds) # returns the number of available world objects
- PropWorld = dir(AllWorlds[0]) # returns the properties of the class world
- NameWorld = AllWorlds[0].getName() # get name of the first world object
-
- MiType = AllWorlds[0].getMistype() # get kind of mist from the first world object
- MiParam = AllWorlds[0].getMist() # get the parameters intensity, start, end and height of the mist
-
- HorColor = AllWorlds[0].getHor() # horizon color of the first world object
- HorColorR = HorColor[0] # get the red channel (RGB) of the horizon color
-
- ZenColor = AllWorlds[0].getZen() # zenith color of the first world object
- ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenith color
-
- blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
-"""
-
-def New (name):
- """
- Creates a new World.
- @type name: string
- @param name: World's name (optional).
- @rtype: Blender World
- @return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
- """
-
-def Get (name):
- """
- Get an World from Blender.
- @type name: string
- @param name: The name of the world to retrieve.
- @rtype: Blender World or a list of Blender Worlds
- @return:
- - (name): The World corresponding to the name
- - (): A list with all Worlds in the current scene.
- """
-
-
-def GetCurrent ():
- """
- Get the active world of the scene.
- @rtype: Blender World or None
- """
-
-class World:
- """
- The World object
- ================
- This object gives access to generic data from all worlds in Blender.
- Its attributes depend upon its type.
-
- @ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
- @ivar mode:
- @ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
- @ivar hor: the horizon color of a world object.
- @ivar zen: the zenith color of a world object.
- @ivar amb: the ambient color of a world object.
- @ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
- @ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
- @type ipo: Blender Ipo
- @ivar ipo: The world type ipo linked to this world object.
- @type textures: a tuple of Blender MTex objects.
- @ivar textures: The World's texture list. Empty texture channels contains None.
- """
-
- def getRange():
- """
- Retrieves the range parameter of a world object.
- @rtype: float
- @return: the range
- """
-
- def setRange(range):
- """
- Sets the range parameter of a world object.
- @type range: float
- @param range: the new range parameter
- @rtype: None
- @return: None
- """
-
- def getName():
- """
- Retrieves the name of a world object
- @rtype: string
- @return: the name of the world object.
- """
-
- def setName(name):
- """
- Sets the name of a world object.
- @type name: string
- @param name : the new name.
- @rtype: None
- @return: None
- """
-
- def getIpo():
- """
- Get the Ipo associated with this world object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this world object.
- @type ipo: Blender Ipo
- @param ipo: a "camera data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this world object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def getSkytype():
- """
- Retrieves the skytype of a world object.
- The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
- @rtype: int
- @return: the skytype of the world object.
- """
-
- def setSkytype(skytype):
- """
- Sets the skytype of a world object.
- See getSkytype for the semantics of the parameter.
- @type skytype: int
- @param skytype : the new skytype.
- @rtype: None
- @return: None
- """
-
- def getMode():
- """
- Retrieves the mode of a world object.
- The mode is a combination of 5 bits:
- - Bit 0 : mist simulation
- - Bit 1 : starfield simulation
- - Bit 2,3 : reserved
- - Bit 4 : ambient occlusion
- @rtype: int
- @return: the mode of the world object.
- """
-
- def setMode(mode):
- """
- Sets the mode of a world object.
- See getMode for the semantics of the parameter.
- @type mode: int
- @param mode : the new mode.
- @rtype: None
- @return: None
- """
-
- def getMistype():
- """
- Retrieves the mist type of a world object.
- The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
- @rtype: int
- @return: the mistype of the world object.
- """
-
- def setMistype(mistype):
- """
- Sets the mist type of a world object.
- See getMistype for the semantics of the parameter.
- @type mistype: int
- @param mistype : the new mist type.
- @rtype: None
- @return: None
- """
-
- def getHor():
- """
- Retrieves the horizon color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the horizon color of the world object.
- """
-
- def setHor(hor):
- """
- Sets the horizon color of a world object.
- @type hor: list of three floats
- @param hor : the new hor.
- @rtype: None
- @return: None
- """
-
- def getZen():
- """
- Retrieves the zenith color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the zenith color of the world object.
- """
-
- def setZen(zen):
- """
- Sets the zenith color of a world object.
- @type zen: list of three floats
- @param zen : the new zenith color.
- @rtype: None
- @return: None
- """
-
- def getAmb():
- """
- Retrieves the ambient color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the ambient color of the world object.
- """
-
- def setAmb(amb):
- """
- Sets the ambient color of a world object.
- @type amb: list of three floats
- @param amb : the new ambient color.
- @rtype: None
- @return: None
- """
-
- def getStar():
- """
- Retrieves the star parameters of a world object.
- It is a list of nine floats :
- red component of the color
- green component of the color
- blue component of the color
- size of the stars
- minimal distance between the stars
- average distance between the stars
- variations of the stars color
- @rtype: list of nine floats
- @return: the star parameters
- """
-
- def setStar(star):
- """
- Sets the star parameters of a world object.
- See getStar for the semantics of the parameter.
- @type star: list of 9 floats
- @param star : the new star parameters.
- @rtype: None
- @return: None
- """
-
- def getMist():
- """
- Retrieves the mist parameters of a world object.
- It is a list of four floats :
- intensity of the mist
- start of the mist
- end of the mist
- height of the mist
- @rtype: list of four floats
- @return: the mist parameters
- """
-
- def setMist(mist):
- """
- Sets the mist parameters of a world object.
- See getMist for the semantics of the parameter.
- @type mist: list of 4 floats
- @param mist : the new mist parameters.
- @rtype: None
- @return: None
- """
-
- def getScriptLinks (event):
- """
- Get a list with this World's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw", "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this World :). If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this World.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def setCurrent ():
- """
- Make this world active in the current scene.
- @rtype: None
- @return: None
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in world ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -ZENTIH
- -HORIZON
- -MIST
- -STARS
- -OFFSET
- -SIZE
- @return: py_none
- """
-
- def __copy__ ():
- """
- Make a copy of this world
- @rtype: World
- @return: a copy of this world
- """
-
-import id_generics
-World.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Worlddoc.txt b/source/blender/python/api2_2x/doc/Worlddoc.txt
deleted file mode 100644
index 78e325fd7ce..00000000000
--- a/source/blender/python/api2_2x/doc/Worlddoc.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-METABALL Module documentation
-
-INTRODUCTION
-The metaball module effect allows you to access all the data of an metaball.
-A metaball consists of several (maybe only one) metaelems, which are spheres, interacting with each other, thus creating soft organic volumes.
-
-functions of the module :
-New(name) : creates ans returns a metaball object.
-Get(opt : name) : if the parameter name is given, returns the metaball object whose name has been passed, or Py_None, if no such metaball exists in the current scene. If no parameter is given, returns a list of all the metaballs in the current scene.
-get : alias for Get
-
-Metaball object member functions :
-
-getName()Return Metaball name
-setName(string newname) - Sets Metaball name
-getWiresize() - Return Metaball wire size
-setWiresize(float val) - Sets Metaball wire size
-getRendersize() - Return Metaball render size
-setRendersize(float newval- Sets Metaball render size
-getThresh()- Return Metaball threshold
-setThresh(float newval)- Sets Metaball threshold
-getBbox,- Return Metaball bounding box(a list of eight lists of three elements)
-getNMetaElems() Returns the number of Metaelems (basic spheres)
-getMetatype(int num_metaelem): returns the type of the metaelem number num_metaelem.
-0 : ball
-1 : tubex
-2 : tubey
-3 : tubez
-setMetatype(int num_metaelem,int newtype) : sets the type of the metaelem number num_metaelem.
-getMetadata(field_name,int num_metaelem) gets Metaball MetaData. Explained later.
-setMetadata(field_name,int num_metaelem,newval) sets Metaball MetaData. Explained later.
-getMetalay(int num_metaelem)
-getMetax(int num_metaelem) : gets the x coordinate of the metaelement
-setMetax(int num_metaelem,float newval) : sets the x coordinate of the metaelement
-getMetay(int num_metaelem) : gets the y coordinate of the metaelement
-setMetay(int num_metaelem,float newval) : sets the y coordinate of the metaelement
-getMetaz(int num_metaelem) : gets the z coordinate of the metaelement
-setMetaz(int num_metaelem,float newval) : sets the z coordinate of the metaelement
-getMetas(int num_metaelem) : gets the s coordinate of the metaelement
-setMetas(int num_metaelem,float newval) : sets the s coordinate of the metaelement
-getMetalen(int num_metaelem) : gets the length of the metaelement. Important for tubes.
-setMetalen(int num_metaelem,float newval) : sets the length of the metaelement. Important for tubes.
-getloc, - Gets Metaball loc values
-setloc, (f f f) - Sets Metaball loc values
-getrot, () - Gets Metaball rot values
-setrot,, (f f f) - Sets Metaball rot values
-getsize,() - Gets Metaball size values
-setsize,(f f f) - Sets Metaball size values
-
-
-
-
-The Object.attribute syntax
-
-The attribute can take these values : seed,nabla,sta,end,lifetime,normfac,obfac,randfac,texfac,randlife,vectsize,totpart,force,mult,life,child,mat,defvec. \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/epy_docgen.sh b/source/blender/python/api2_2x/doc/epy_docgen.sh
deleted file mode 100644
index 0e5350e41ae..00000000000
--- a/source/blender/python/api2_2x/doc/epy_docgen.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# epy_docgen.sh
-# generates blender python doc using epydoc
-# requires epydoc in your PATH.
-# run from the doc directory containing the .py files
-# usage: sh epy_docgen.sh
-
-# set posix locale so regex works properly for [A-Z]*.py
-LC_ALL=POSIX
-
-epydoc --debug -v -o BPY_API --url "http://www.blender.org" --top API_intro \
- --name "Blender" --no-private --no-frames [A-Z]*.py
diff --git a/source/blender/python/api2_2x/doc/id_generics.py b/source/blender/python/api2_2x/doc/id_generics.py
deleted file mode 100644
index 30c7e5d6a3c..00000000000
--- a/source/blender/python/api2_2x/doc/id_generics.py
+++ /dev/null
@@ -1,30 +0,0 @@
-attributes = """
- @ivar name: unique name within each blend file.
-
- The name is case sensitive and 21 characters maximum length.
-
- B{Note}: a blend file may have naming collisions when external library data is used,
- be sure to check the value of L{lib}.
-
- B{Note}: Setting a value longer then 21 characters will be shortened
- @type name: string
- @ivar lib: path to the blend file this datablock is stored in (readonly).
-
- lib will be None unless you are using external blend files with (File, Append/Link)
-
- B{Note}: the path may be relative, to get the full path use L{Blender.sys.expandpath<Sys.expandpath>}
- @type lib: string or None
-
- @ivar fakeUser: When set to True, this datablock wont be removed, even if nothing is using it.
- All data has this disabled by default except for Actions.
- @type fakeUser: bool
- @ivar tag: A temporary tag that to flag data as being used within a loop.
- always set all tags to True or False before using since blender uses this flag for its own internal operations.
- @type tag: bool
- @ivar users: The number of users this datablock has. (readonly)
- Zero user datablocks are de-allocated after reloading and saving.
- @type users: int
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- datablocks's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
-""" \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/testbgl.py b/source/blender/python/api2_2x/doc/testbgl.py
deleted file mode 100644
index e895d01df69..00000000000
--- a/source/blender/python/api2_2x/doc/testbgl.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Testing the BGL module
-
-import Blender
-from Blender.BGL import *
-from Blender import Draw
-
-R = G = B = 0
-A = 1
-
-instructions = "Hold mouse buttons to change the background color."
-quitting = " Press ESC or q to quit."
-
-def show_win():
- glClearColor(R,G,B,A) # define color used to clear buffers
- glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer
- glColor3f(1,1,1) # change default color
- glRasterPos2i(50,100) # move cursor to x = 50, y = 100
- Draw.Text("Testing BGL + Draw") # draw this text there
- glRasterPos2i(350,20) # move cursor again
- Draw.Text(instructions + quitting) # draw another msg
- glBegin(GL_LINE_LOOP) # begin a vertex-data list
- glVertex2i(46,92)
- glVertex2i(120,92)
- glVertex2i(120,115)
- glVertex2i(46,115)
- glEnd() # close this list
- glColor3f(0.35,0.18,0.92) # change default color again
- glBegin(GL_POLYGON) # another list, for a polygon
- glVertex2i(315, 292)
- glVertex2i(412, 200)
- glVertex2i(264, 256)
- glEnd()
- Draw.Redraw(1) # make changes visible.
-
-def ev(evt, val): # this is a callback for Draw.Register()
- global R,G,B,A # it handles input events
- if evt == Draw.ESCKEY or evt == Draw.QKEY:
- Draw.Exit() # this quits the script
- elif evt == Draw.LEFTMOUSE: R = 1 - R
- elif evt == Draw.MIDDLEMOUSE: G = 1 - G
- elif evt == Draw.RIGHTMOUSE: B = 1 - B
- else:
- Draw.Register(show_win, ev, None)
-
-Draw.Register(show_win, ev, None) # start the main loop
diff --git a/source/blender/python/api2_2x/doc/testcamera.py b/source/blender/python/api2_2x/doc/testcamera.py
deleted file mode 100644
index a84b3ac5b15..00000000000
--- a/source/blender/python/api2_2x/doc/testcamera.py
+++ /dev/null
@@ -1,137 +0,0 @@
-# Blender.Camera module and Camera PyType test file
-# This also works with Lamp and Material, simply uncomment the right
-# line below
-
-MODULE = "Camera"
-#MODULE = "Lamp"
-#MODULE = "Material"
-BPY_OBJECT = MODULE
-
-LONG_STRING = "Supercalifragilisticspialidous"
-
-import types, sys
-import Blender
-exec ("from Blender import %s" % MODULE)
-
-def PRINT_HEADER(header, sep):
- print "\n", sep * 79
- print header
- print sep * 79
-
-def PRINT_UNDERLINED(str):
- print "\n", str
- print "-" * len(str)
-
-def PRINT_AND_RM(arg, branch, d):
- for a in arg:
- if a in d:
- d.remove(a)
- print "\n%s.%s:" % (branch, a),
- exec("print %s.%s" % (branch, a))
-
-PRINT_HEADER("Testing the Blender.%s module" % MODULE, '=')
-
-exec ("Module_dir = dir (%s)" % MODULE)
-print "\ndir (%s):" % MODULE
-print Module_dir
-
-PRINT_AND_RM (["__name__", "__doc__"], MODULE, Module_dir)
-
-for item in Module_dir:
- hooked = 0
- branch = "%s.%s" % (MODULE, item)
- PRINT_HEADER(branch, "-")
- exec ("item_type = type (%s)" % branch)
- print item_type
- exec ("sub_dir = dir(%s)" % branch)
- PRINT_AND_RM (["__name__", "__doc__"], branch, sub_dir)
- if item_type == types.BuiltinFunctionType:
- PRINT_UNDERLINED ("Executing %s:" % branch)
- exec ("result = %s()" % branch)
- print "Returned value is: ", result
- if item in ["Get", "get"] and not hooked:
- if len(result):
- obj = result[0]
- hooked = 1
-
-if hooked:
- PRINT_HEADER(obj, "=")
- exec ("obj_dir = dir(obj)")
- print "\ndir():"
- print obj_dir
-
- methods = []
- member_vars = []
-
- for item in obj_dir:
- exec ("item_type = type (obj.%s)" % item)
- if item_type == types.BuiltinMethodType:
- methods.append(item)
- else:
- member_vars.append(item)
-
- PRINT_HEADER("%s Methods" % BPY_OBJECT, '-')
- if methods: print methods
- else: print "XXX No methods found in %s" % BPY_OBJECT
-
- PRINT_HEADER("%s Member Variables" % BPY_OBJECT, '-')
- if member_vars:
- for m in member_vars:
- PRINT_UNDERLINED(m)
- exec ("mvalue = obj.%s" % m)
- exec ("mtype = type (obj.%s)" % m)
- mtype = str(mtype).split("'")[1]
- print "%s: %s" % (mtype, mvalue)
-
- M = m[0].upper() + m[1:]
- setM = "set%s" % M
- getM = "get%s" % M
- if setM in methods:
- print "There is a .%s() method." % setM
- methods.remove(setM)
- if mtype == 'str':
- try:
- print "Trying to set string to %s" % LONG_STRING
- exec("obj.%s('%s')" % (setM, LONG_STRING))
- exec("get_str = obj.%s()" % getM)
- print "It returned:", get_str
- len_str = len(get_str)
- if len_str < 100:
- print "It correctly clamped the string to %s chars." % len_str
- except:
- PRINT_HEADER("FAILED in .%s()" % setM, "X")
- print sys.exc_info()[0]
- elif mtype == 'float':
- try:
- exec("obj.%s(%d)" % (setM, -999999))
- exec("result = obj.%s()" % getM)
- print "%s's minimum value is %f" % (m, result)
- exec("obj.%s(%d)" % (setM, 999999))
- exec("result = obj.%s()" % getM)
- print "%s's maximum value is %f" % (m, result)
- except:
- PRINT_HEADER("FAILED in %s or %s" % (setM, getM), "X")
- print sys.exc_info()[0]
- elif mtype == 'int':
- try:
- dict = M+"s"
- if dict in member_vars:
- exec("key = obj.%s.keys()[1]" % dict)
- exec("obj.%s('%s')" % (setM, key))
- exec("result = obj.%s()" % getM)
- except:
- PRINT_HEADER("FAILED in %s or %s" % (setM, getM), "X")
- print sys.exc_info()[0]
-
- if getM in methods:
- print "There is a .%s() method." % getM,
- methods.remove(getM)
- exec("result = obj.%s()" % getM)
- print "It returned:", result
-
- else: print "XXX No member variables found in %s" % BPY_OBJECT
-
-else: # the module .Get() function found nothing
- PRINT_HEADER("Failed trying to %s.Get() a %s object"
- % (MODULE, BPY_OBJECT), 'X')
-
diff --git a/source/blender/python/api2_2x/doc/testcurve.py b/source/blender/python/api2_2x/doc/testcurve.py
deleted file mode 100644
index 1db037bc385..00000000000
--- a/source/blender/python/api2_2x/doc/testcurve.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import Blender
-
-
-list = Blender.Curve.Get()
-
-print list
-
-cur = Blender.Curve.Get('Curve')
-
-
-for prop in ["Name","PathLen","Totcol","Flag","Bevresol","Resolu","Resolv","Width","Ext1","Ext2","Loc","Rot","Size"]:
- value = eval("cur.get%s()"%prop)
- print prop,"-->",value
- exec("cur.set%s(value)"%prop)
-
-
-
-for attr in [ "name","pathlen","totcol","flag","bevresol","resolu","resolv","width","ext1","ext2","loc","rot","size"]:
- value = eval("cur.%s"%attr)
- exec("cur.%s = value"%attr) \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/testeffect.py b/source/blender/python/api2_2x/doc/testeffect.py
deleted file mode 100644
index 5d9b65c36be..00000000000
--- a/source/blender/python/api2_2x/doc/testeffect.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import Blender
-
-################## WARNING ########################
-#
-# this script tests the Effect module, and its submodules : Wave, Build and Particle
-# an object name "Plane" must be created, with three effects attached to it.
-# the first effect must be a "Build" effect
-# the second effect must be a "Wave" effect
-# the third effect must be a "Particle" effect
-#
-########################################################
-
-
-
-effect = Blender.Effect.New()
-print effect
-
-
-
-build = Blender.Effect.Get('Plane',0)
-
-
-for param in ['Type','Flag','Len','Sfra'] :
- value = eval("build.get%s()"%param)
- print param,value
- value1 = eval("build.set%s(%s)"%(param,value))
- print value1
-
-for param in ["sfra","len"]:
- str = "build.%s"%param
- value = eval(str)
- print str,value
- exec("build.%s = value"%param)
-
-
-
-wave = Blender.Effect.Get('Plane',1)
-for param in ['Type','Flag','Startx','Starty','Height', 'Width', 'Narrow', 'Speed', 'Minfac', 'Damp', 'Timeoffs' ,'Lifetime'] :
- value = eval("wave.get%s()"%param)
- print param,value
- value1 = eval("wave.set%s(%s)"%(param,value))
- print value1
-
-
-for param in ["lifetime","timeoffs","damp","minfac","speed","narrow","width","height","startx","starty"]:
- str = "wave.%s"%param
- value = eval(str)
- print str,value
- exec("wave.%s = value"%param)
-
-
-
-
-particle = Blender.Effect.Get('Plane',2)
-for param in ['Type','Flag','StartTime','EndTime','Lifetime','Normfac','Obfac','Randfac','Texfac','Randlife','Nabla','Totpart','Totkey','Seed','Force','Mult','Life','Child','Mat','Defvec'] :
- value = eval("particle.get%s()"%param)
- print param,value
- value1 = eval("particle.set%s(%s)"%(param,value))
- print value1
-
-for param in ['seed','nabla','sta','end','lifetime','normfac','obfac','randfac','texfac','randlife','vectsize','totpart','force','mult','life','child','mat','defvec']:
- str = "particle.%s"%param
- value = eval(str)
- print str,value
- exec("particle.%s = value"%param) \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/testipo.py b/source/blender/python/api2_2x/doc/testipo.py
deleted file mode 100644
index 89db92f03c2..00000000000
--- a/source/blender/python/api2_2x/doc/testipo.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import Blender
-
-ipo = Blender.Ipo.Get()
-print "Available ipos : ",ipo
-
-ipo = Blender.Ipo.Get('ObIpo')# hope there is an ipo named "ObIpo"...
-
-
-for prop in ["Name","Blocktype","Showkey","Pad","Rctf"]:
- val = eval("ipo.get%s()"%prop)
- print prop,"-->",val
- #exec("ipo.set%s(%s)"%(prop,val))
-
-try :
- val = ipo.getCurveBP(0)
- print "CurveBP -->",val
-except : print "error BP"
-val = ipo.getNcurves()
-print "NCurves -->",val
-
-curvebeztriple = ipo.getCurveBeztriple(0,0)
-print "curvebeztriple",curvebeztriple
-ipo.setCurveBeztriple(0,0,[1,2,3,4,5,6,7,8,9])
-print ipo.getCurveBeztriple(0,0)
diff --git a/source/blender/python/api2_2x/doc/testmball.py b/source/blender/python/api2_2x/doc/testmball.py
deleted file mode 100644
index 41c8377193f..00000000000
--- a/source/blender/python/api2_2x/doc/testmball.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import Blender
-
-
-
-
-d = Blender.Metaball.Get('Meta')
-
-for prop in ["Name","Wiresize","Thresh","Rendersize","loc","rot","size"]:
- str = "d.get%s()"%prop
- val = eval(str)
- print str,"-->",val
- str1 = "d.set%s(%s)"%(prop,repr(val))
- val1 = eval(str1)
- print str1,"-->",val1
-
-
-
-nelem = d.getNMetaElems()
-print "getNMetaElems",nelem
-
-
-for prop in ['lay','type','selcol','flag','pad','x','y','z','expx','expy','expz','rad','rad2','s','len','maxrad2']:
- str = "d.getMeta%s(0)"%prop
- value = eval(str)
- print str,"-->",value
- str1 = "d.setMeta%s(0,%s)"%(prop,repr(value))
- value1 = eval(str1)
- print str1,"-->",value1
-print;print
-
-for field in ["name","loc","rot","size"]:
- str = "d.%s"%field
- val = eval(str)
- print str,"-->",val
- exec("d.%s = val"%field)
-
-
diff --git a/source/blender/python/api2_2x/doc/testtext.py b/source/blender/python/api2_2x/doc/testtext.py
deleted file mode 100644
index 3e3fd1a5b01..00000000000
--- a/source/blender/python/api2_2x/doc/testtext.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Test Blender.Text
-
-import Blender
-from Blender import Text
-
-txt = Text.New("MyText")
-all_texts = Text.Get()
-
-for i in [1,4,7]:
- txt.write("%d\n%d\n%d little indians\n" % (i, i+1, i+2))
-
-x = txt.getNLines()
-
-txt.write("%d little indian boys!" % x)
-
-lines = txt.asLines()
-
-txt.clear()
-txt.write("... Yo-ho-ho! And a bottle of rum!")
-
-for s in lines:
- print s
-
-print all_texts
-print txt.asLines()
-
-Text.unlink(txt)
-
-print all_texts
diff --git a/source/blender/python/api2_2x/doc/testworld.py b/source/blender/python/api2_2x/doc/testworld.py
deleted file mode 100644
index 171855f66c9..00000000000
--- a/source/blender/python/api2_2x/doc/testworld.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import Blender
-#testfile
-list = Blender.World.Get()
-print "available worlds",list
-
-w = Blender.World.Get("World")
-
-for param in ["Name","Colormodel","Fastcol","Skytype","Mode","Totex","Texact","Mistype","Hor","Zen","Amb","Star","Dof","Mist"]:
- val = eval("w.get%s()"%param)
- print param,val
- val1 = eval("w.set%s(val)"%param)
- print val1
-
-
-for param in ["name","colormodel","fastcol","skytype","mode","totex","texact","mistype","hor","zen","amb","star","dof","mist"]:
- exec("val = w.%s"%param)
- print param,val
- exec ("w.%s = val"%param)
-
-
-
diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c
deleted file mode 100644
index e349dd26532..00000000000
--- a/source/blender/python/api2_2x/euler.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mathutils.h"
-
-#include "BLI_arithb.h"
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-
-
-//-------------------------DOC STRINGS ---------------------------
-char Euler_Zero_doc[] = "() - set all values in the euler to 0";
-char Euler_Unique_doc[] ="() - sets the euler rotation a unique shortest arc rotation - tests for gimbal lock";
-char Euler_ToMatrix_doc[] = "() - returns a rotation matrix representing the euler rotation";
-char Euler_ToQuat_doc[] = "() - returns a quaternion representing the euler rotation";
-char Euler_Rotate_doc[] = "() - rotate a euler by certain amount around an axis of rotation";
-char Euler_copy_doc[] = "() - returns a copy of the euler.";
-//-----------------------METHOD DEFINITIONS ----------------------
-struct PyMethodDef Euler_methods[] = {
- {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, Euler_Zero_doc},
- {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, Euler_Unique_doc},
- {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc},
- {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc},
- {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc},
- {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc},
- {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc},
- {NULL, NULL, 0, NULL}
-};
-//-----------------------------METHODS----------------------------
-//----------------------------Euler.toQuat()----------------------
-//return a quaternion representation of the euler
-PyObject *Euler_ToQuat(EulerObject * self)
-{
- float eul[3], quat[4];
- int x;
-
- for(x = 0; x < 3; x++) {
- eul[x] = self->eul[x] * ((float)Py_PI / 180);
- }
- EulToQuat(eul, quat);
- return newQuaternionObject(quat, Py_NEW);
-}
-//----------------------------Euler.toMatrix()---------------------
-//return a matrix representation of the euler
-PyObject *Euler_ToMatrix(EulerObject * self)
-{
- float eul[3];
- float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
- int x;
-
- for(x = 0; x < 3; x++) {
- eul[x] = self->eul[x] * ((float)Py_PI / 180);
- }
- EulToMat3(eul, (float (*)[3]) mat);
- return newMatrixObject(mat, 3, 3 , Py_NEW);
-}
-//----------------------------Euler.unique()-----------------------
-//sets the x,y,z values to a unique euler rotation
-PyObject *Euler_Unique(EulerObject * self)
-{
- double heading, pitch, bank;
- double pi2 = Py_PI * 2.0f;
- double piO2 = Py_PI / 2.0f;
- double Opi2 = 1.0f / pi2;
-
- //radians
- heading = self->eul[0] * (float)Py_PI / 180;
- pitch = self->eul[1] * (float)Py_PI / 180;
- bank = self->eul[2] * (float)Py_PI / 180;
-
- //wrap heading in +180 / -180
- pitch += Py_PI;
- pitch -= floor(pitch * Opi2) * pi2;
- pitch -= Py_PI;
-
-
- if(pitch < -piO2) {
- pitch = -Py_PI - pitch;
- heading += Py_PI;
- bank += Py_PI;
- } else if(pitch > piO2) {
- pitch = Py_PI - pitch;
- heading += Py_PI;
- bank += Py_PI;
- }
- //gimbal lock test
- if(fabs(pitch) > piO2 - 1e-4) {
- heading += bank;
- bank = 0.0f;
- } else {
- bank += Py_PI;
- bank -= (floor(bank * Opi2)) * pi2;
- bank -= Py_PI;
- }
-
- heading += Py_PI;
- heading -= (floor(heading * Opi2)) * pi2;
- heading -= Py_PI;
-
- //back to degrees
- self->eul[0] = (float)(heading * 180 / (float)Py_PI);
- self->eul[1] = (float)(pitch * 180 / (float)Py_PI);
- self->eul[2] = (float)(bank * 180 / (float)Py_PI);
-
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Euler.zero()-------------------------
-//sets the euler to 0,0,0
-PyObject *Euler_Zero(EulerObject * self)
-{
- self->eul[0] = 0.0;
- self->eul[1] = 0.0;
- self->eul[2] = 0.0;
-
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Euler.rotate()-----------------------
-//rotates a euler a certain amount and returns the result
-//should return a unique euler rotation (i.e. no 720 degree pitches :)
-PyObject *Euler_Rotate(EulerObject * self, PyObject *args)
-{
- float angle = 0.0f;
- char *axis;
- int x;
-
- if(!PyArg_ParseTuple(args, "fs", &angle, &axis)){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "euler.rotate():expected angle (float) and axis (x,y,z)");
- }
- if(!STREQ3(axis,"x","y","z")){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "euler.rotate(): expected axis to be 'x', 'y' or 'z'");
- }
-
- //covert to radians
- angle *= ((float)Py_PI / 180);
- for(x = 0; x < 3; x++) {
- self->eul[x] *= ((float)Py_PI / 180);
- }
- euler_rot(self->eul, angle, *axis);
- //convert back from radians
- for(x = 0; x < 3; x++) {
- self->eul[x] *= (180 / (float)Py_PI);
- }
-
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Euler.rotate()-----------------------
-// return a copy of the euler
-PyObject *Euler_copy(EulerObject * self, PyObject *args)
-{
- return newEulerObject(self->eul, Py_NEW);
-}
-
-
-//----------------------------dealloc()(internal) ------------------
-//free the py_object
-static void Euler_dealloc(EulerObject * self)
-{
- //only free py_data
- if(self->data.py_data){
- PyMem_Free(self->data.py_data);
- }
- PyObject_DEL(self);
-}
-//----------------------------getattr()(internal) ------------------
-//object.attribute access (get)
-static PyObject *Euler_getattr(EulerObject * self, char *name)
-{
- if(STREQ(name,"x")){
- return PyFloat_FromDouble(self->eul[0]);
- }else if(STREQ(name, "y")){
- return PyFloat_FromDouble(self->eul[1]);
- }else if(STREQ(name, "z")){
- return PyFloat_FromDouble(self->eul[2]);
- }
- if(STREQ(name, "wrapped")){
- if(self->wrapped == Py_WRAP)
- return EXPP_incr_ret((PyObject *)Py_True);
- else
- return EXPP_incr_ret((PyObject *)Py_False);
- }
- return Py_FindMethod(Euler_methods, (PyObject *) self, name);
-}
-//----------------------------setattr()(internal) ------------------
-//object.attribute access (set)
-static int Euler_setattr(EulerObject * self, char *name, PyObject * e)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(e);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "euler.attribute = x: argument not a number\n");
- }
-
- if(STREQ(name,"x")){
- self->eul[0] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "y")){
- self->eul[1] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "z")){
- self->eul[2] = (float)PyFloat_AS_DOUBLE(f);
- }else{
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "euler.attribute = x: unknown attribute\n");
- }
-
- Py_DECREF(f);
- return 0;
-}
-//----------------------------print object (internal)--------------
-//print the object to screen
-static PyObject *Euler_repr(EulerObject * self)
-{
- int i;
- char buffer[48], str[1024];
-
- BLI_strncpy(str,"[",1024);
- for(i = 0; i < 3; i++){
- if(i < (2)){
- sprintf(buffer, "%.6f, ", self->eul[i]);
- strcat(str,buffer);
- }else{
- sprintf(buffer, "%.6f", self->eul[i]);
- strcat(str,buffer);
- }
- }
- strcat(str, "](euler)");
-
- return PyString_FromString(str);
-}
-//------------------------tp_richcmpr
-//returns -1 execption, 0 false, 1 true
-static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
-{
- EulerObject *eulA = NULL, *eulB = NULL;
- int result = 0;
-
- if (!EulerObject_Check(objectA) || !EulerObject_Check(objectB)){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
- eulA = (EulerObject*)objectA;
- eulB = (EulerObject*)objectB;
-
- switch (comparison_type){
- case Py_EQ:
- result = EXPP_VectorsAreEqual(eulA->eul, eulB->eul, 3, 1);
- break;
- case Py_NE:
- result = EXPP_VectorsAreEqual(eulA->eul, eulB->eul, 3, 1);
- if (result == 0){
- result = 1;
- }else{
- result = 0;
- }
- break;
- default:
- printf("The result of the comparison could not be evaluated");
- break;
- }
- if (result == 1){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
-}
-//------------------------tp_doc
-static char EulerObject_doc[] = "This is a wrapper for euler objects.";
-//---------------------SEQUENCE PROTOCOLS------------------------
-//----------------------------len(object)------------------------
-//sequence length
-static int Euler_len(EulerObject * self)
-{
- return 3;
-}
-//----------------------------object[]---------------------------
-//sequence accessor (get)
-static PyObject *Euler_item(EulerObject * self, int i)
-{
- if(i < 0 || i >= 3)
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "euler[attribute]: array index out of range\n");
-
- return PyFloat_FromDouble(self->eul[i]);
-
-}
-//----------------------------object[]-------------------------
-//sequence accessor (set)
-static int Euler_ass_item(EulerObject * self, int i, PyObject * ob)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(ob);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "euler[attribute] = x: argument not a number\n");
- }
-
- if(i < 0 || i >= 3){
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_IndexError,
- "euler[attribute] = x: array assignment index out of range\n");
- }
- self->eul[i] = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- return 0;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (get)
-static PyObject *Euler_slice(EulerObject * self, int begin, int end)
-{
- PyObject *list = NULL;
- int count;
-
- CLAMP(begin, 0, 3);
- if (end<0) end= 4+end;
- CLAMP(end, 0, 3);
- begin = MIN2(begin,end);
-
- list = PyList_New(end - begin);
- for(count = begin; count < end; count++) {
- PyList_SetItem(list, count - begin,
- PyFloat_FromDouble(self->eul[count]));
- }
-
- return list;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (set)
-static int Euler_ass_slice(EulerObject * self, int begin, int end,
- PyObject * seq)
-{
- int i, y, size = 0;
- float eul[3];
- PyObject *e, *f;
-
- CLAMP(begin, 0, 3);
- if (end<0) end= 4+end;
- CLAMP(end, 0, 3);
- begin = MIN2(begin,end);
-
- size = PySequence_Length(seq);
- if(size != (end - begin)){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "euler[begin:end] = []: size mismatch in slice assignment\n");
- }
-
- for (i = 0; i < size; i++) {
- e = PySequence_GetItem(seq, i);
- if (e == NULL) { // Failed to read sequence
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "euler[begin:end] = []: unable to read sequence\n");
- }
-
- f = PyNumber_Float(e);
- if(f == NULL) { // parsed item not a number
- Py_DECREF(e);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "euler[begin:end] = []: sequence argument not a number\n");
- }
-
- eul[i] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,e);
- }
- //parsed well - now set in vector
- for(y = 0; y < 3; y++){
- self->eul[begin + y] = eul[y];
- }
- return 0;
-}
-//-----------------PROTCOL DECLARATIONS--------------------------
-static PySequenceMethods Euler_SeqMethods = {
- (inquiry) Euler_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) Euler_item, /* sq_item */
- (intintargfunc) Euler_slice, /* sq_slice */
- (intobjargproc) Euler_ass_item, /* sq_ass_item */
- (intintobjargproc) Euler_ass_slice, /* sq_ass_slice */
-};
-//------------------PY_OBECT DEFINITION--------------------------
-PyTypeObject euler_Type = {
- PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "euler", //tp_name
- sizeof(EulerObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)Euler_dealloc, //tp_dealloc
- 0, //tp_print
- (getattrfunc)Euler_getattr, //tp_getattr
- (setattrfunc) Euler_setattr, //tp_setattr
- 0, //tp_compare
- (reprfunc) Euler_repr, //tp_repr
- 0, //tp_as_number
- &Euler_SeqMethods, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- EulerObject_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- (richcmpfunc)Euler_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- 0, //tp_methods
- 0, //tp_members
- 0, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//------------------------newEulerObject (internal)-------------
-//creates a new euler object
-/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newEulerObject(float *eul, int type)
-{
- EulerObject *self;
- int x;
-
- self = PyObject_NEW(EulerObject, &euler_Type);
- self->data.blend_data = NULL;
- self->data.py_data = NULL;
-
- if(type == Py_WRAP){
- self->data.blend_data = eul;
- self->eul = self->data.blend_data;
- self->wrapped = Py_WRAP;
- }else if (type == Py_NEW){
- self->data.py_data = PyMem_Malloc(3 * sizeof(float));
- self->eul = self->data.py_data;
- if(!eul) { //new empty
- for(x = 0; x < 3; x++) {
- self->eul[x] = 0.0f;
- }
- }else{
- for(x = 0; x < 3; x++){
- self->eul[x] = eul[x];
- }
- }
- self->wrapped = Py_NEW;
- }else{ //bad type
- return NULL;
- }
- return (PyObject *) self;
-}
-
diff --git a/source/blender/python/api2_2x/euler.h b/source/blender/python/api2_2x/euler.h
deleted file mode 100644
index b76eb962baa..00000000000
--- a/source/blender/python/api2_2x/euler.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef EXPP_euler_h
-#define EXPP_euler_h
-
-#include <Python.h>
-
-extern PyTypeObject euler_Type;
-
-#define EulerObject_Check(v) ((v)->ob_type == &euler_Type)
-
-typedef struct {
- PyObject_VAR_HEAD
- struct{
- float *py_data; //python managed
- float *blend_data; //blender managed
- }data;
- float *eul; //1D array of data (alias)
- int wrapped; //is wrapped data?
-} EulerObject;
-
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
-
-//prototypes
-PyObject *Euler_Zero( EulerObject * self );
-PyObject *Euler_Unique( EulerObject * self );
-PyObject *Euler_ToMatrix( EulerObject * self );
-PyObject *Euler_ToQuat( EulerObject * self );
-PyObject *Euler_Rotate( EulerObject * self, PyObject *args );
-PyObject *Euler_copy( EulerObject * self, PyObject *args );
-PyObject *newEulerObject( float *eul, int type );
-
-#endif /* EXPP_euler_h */
diff --git a/source/blender/python/api2_2x/gen_library.c b/source/blender/python/api2_2x/gen_library.c
deleted file mode 100644
index 8673fefdbb5..00000000000
--- a/source/blender/python/api2_2x/gen_library.c
+++ /dev/null
@@ -1,332 +0,0 @@
-#include "gen_library.h"
-#include "gen_utils.h" /*This must come first*/
-
-/* use for GenericLib_getProperties */
-#include "BKE_idprop.h"
-#include "IDProp.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-#include "BKE_curve.h"
-
-/* GenericLib */
-#include "World.h"
-#include "Font.h"
-#include "Metaball.h"
-#include "Curve.h"
-#include "Camera.h"
-#include "NLA.h"
-#include "Lattice.h"
-#include "Armature.h"
-#include "Lamp.h"
-#include "Text.h"
-#include "Text3d.h"
-#include "Sound.h"
-#include "Scene.h"
-#include "Mesh.h"
-#include "Group.h"
-#include "Object.h"
-#include "Texture.h"
-#include "Ipo.h"
-#include "DNA_object_types.h"
-#include "DNA_ipo_types.h"
-
-
-/* Generic get/set attrs */
-PyObject *GenericLib_getName( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
- return PyString_FromString( id->name + 2 );
-}
-
-int GenericLib_setName( void *self, PyObject *value )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- char *name = NULL;
- if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- rename_id( id, name );
-
- return 0;
-}
-
-PyObject *GenericLib_getFakeUser( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
- if (id->flag & LIB_FAKEUSER)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-int GenericLib_setFakeUser( void *self, PyObject *value )
-{
- int param;
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
-
- param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param) {
- if (!(id->flag & LIB_FAKEUSER)) {
- id->flag |= LIB_FAKEUSER;
- id_us_plus(id);
- }
- } else {
- if (id->flag & LIB_FAKEUSER) {
- id->flag &= ~LIB_FAKEUSER;
- id->us--;
- }
- }
- return 0;
-}
-
-PyObject *GenericLib_getTag( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
- if (id->flag & LIB_DOIT)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-int GenericLib_setTag( void *self, PyObject *value )
-{
- int param;
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) );
-
- param = PyObject_IsTrue( value );
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument in range [0,1]" );
-
- if (param)
- id->flag |= LIB_DOIT;
- else
- id->flag &= ~LIB_DOIT;
- return 0;
-}
-
-
-/* read only */
-PyObject *GenericLib_getLib( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
-
- if (id->lib)
- return PyString_FromString(id->lib->name);
- else
- return EXPP_incr_ret( Py_None );
-}
-
-PyObject *GenericLib_getUsers( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
- return PyInt_FromLong(id->us);
-}
-
-PyObject *GenericLib_getProperties( void *self )
-{
- ID *id = ((BPy_GenericLib *)self)->id;
- if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) );
- return BPy_Wrap_IDProperty( id, IDP_GetProperties(id, 1), NULL );
-}
-
-/* use for any.setName("name")*/
-PyObject * GenericLib_setName_with_method( void *self, PyObject *args )
-{
- return EXPP_setterWrapper( (void *)self, args, (setter)GenericLib_setName );
-}
-
-
-/*
- * returns the Blender lib type code from a PyObject
- * -1 for no match, only give this function libdata
- *
- * At the moment this is only used by GenericLib_assignData
- * so not all types are needed.
- */
-short GenericLib_getType(PyObject * pydata)
-{
- //~ if (BPy_Scene_Check(pydata)) return ID_SCE;
- if (BPy_Object_Check(pydata)) return ID_OB;
- if (BPy_Mesh_Check(pydata)) return ID_ME;
- //~ if (BPy_Curve_Check(pydata)) return ID_CU;
- //~ if (BPy_Metaball_Check(pydata)) return ID_MB;
- //~ if (BPy_Material_Check(pydata)) return ID_MA;
- if (BPy_Texture_Check(pydata)) return ID_TE;
- //~ if (BPy_Image_Check(pydata)) return ID_IM;
- //~ //if (BPy_Lattice_Check(pydata)) return ID_LT;
- //~ if (BPy_Lamp_Check(pydata)) return ID_LA;
- //~ if (BPy_Camera_Check(pydata)) return ID_CA;
- if (BPy_Ipo_Check(pydata)) return ID_IP;
- if (BPy_World_Check(pydata)) return ID_WO;
- //~ //if (BPy_Font_Check(pydata)) return ID_VF;
- //~ if (BPy_Text_Check(pydata)) return ID_TXT;
- //~ if (BPy_Sound_Check(pydata)) return ID_SO;
- if (BPy_Group_Check(pydata)) return ID_GR;
- //~ if (BPy_Armature_Check(pydata)) return ID_AR;
- if (BPy_Action_Check(pydata)) return ID_AC;
-
- return -1;
-}
-
-
-/*
- * This function is used to assign a PyObject representing
- * blender libdata to a pointer.
- *
- * Python examples of this are...
- * ob.DupGroup = dupliGroup
- * mesh.texMesh = texme
- * ob.ipo = None
- *
- * This function deals with type checking, data usercounts,
- * and raising errors.
- *
- * value - python value
- * data - Blender pointer to assign value to
- * ndata - Use this if there is a value data cannot be.
- * for instance, a curve's curve modifier cant point to its self.
- * refcount - non zero values will modify blenders user count.
- * type - ID type.
- * subtype - used only for objects and IPO's to stop the wrong types of obs/ipos
- * being assigned.
- *
- */
-int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype)
-{
- ID *id= NULL;
-
- if (*data) {
- id = ((ID*)*data);
-
- if (ndata && *data == *ndata) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Cannot set this data to its self" );
- }
- }
-
- if (value == Py_None) {
- *data = NULL;
- if (refcount && id) id->us--;
- } else if (GenericLib_getType(value) == type) {
-
- /* object subtypes */
- if (subtype != 0) {
- if (type == ID_OB) {
- Object *ob= (Object *)(((BPy_GenericLib *)value)->id);
- if (ob->type != subtype)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Object type not supported" );
- }
-
- if (type == ID_IP) {
- Ipo *ipo = (Ipo *)(((BPy_GenericLib *)value)->id);
- if (ipo->blocktype != subtype)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Ipo type does is not compatible" );
- }
-
-
- }
- if (refcount && id) id->us--;
- id = ((BPy_GenericLib *)value)->id;
- id->us++;
- *data = id;
- } else {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Could not assign Python Type - None or Library Object" );
- }
- return 0;
-}
-
-
-/*
- * returns the ID of the object with given name
- * from a given list.
- */
-ID *GetIdFromList( ListBase * list, char *name )
-{
- ID *id = list->first;
-
- while( id ) {
- if( strcmp( name, id->name + 2 ) == 0 )
- break;
- id = id->next;
- }
-
- return id;
-}
-
-
-PyObject *GetPyObjectFromID( ID * id )
-{
- switch ( MAKE_ID2( id->name[0], id->name[1] ) ) {
- case ID_SCE:
- return Scene_CreatePyObject( ( Scene *) id );
- case ID_OB:
- return Object_CreatePyObject( (Object *) id );
- case ID_ME:
- return Mesh_CreatePyObject( (Mesh *)id, NULL );
- case ID_CU:
- switch (curve_type((Curve *)id)) {
- case OB_FONT:
- return Text3d_CreatePyObject( (Text3d *)id );
- default:
- return Curve_CreatePyObject( (Curve *)id );
- }
- case ID_MB:
- return Metaball_CreatePyObject((MetaBall *)id);
- case ID_MA:
- return Material_CreatePyObject((Material *)id);
- case ID_TE:
- return Texture_CreatePyObject((Tex *)id);
- case ID_IM:
- return Image_CreatePyObject((Image *)id);
- case ID_LT:
- return Lattice_CreatePyObject((Lattice *)id);
- case ID_LA:
- return Lamp_CreatePyObject((Lamp *)id);
- case ID_CA:
- return Camera_CreatePyObject((Camera *)id);
- case ID_IP:
- return Ipo_CreatePyObject((Ipo *)id);
- case ID_WO:
- return World_CreatePyObject((World *)id);
- case ID_VF:
- return Font_CreatePyObject((VFont *)id);
- case ID_TXT:
- return Text_CreatePyObject((Text *)id);
- case ID_SO:
- return Sound_CreatePyObject((bSound *)id);
- case ID_GR:
- return Group_CreatePyObject((Group *)id);
- case ID_AR:
- return Armature_CreatePyObject((bArmature *)id);
- case ID_AC:
- return Action_CreatePyObject((bAction *)id);
- }
- Py_RETURN_NONE;
-}
-
-long GenericLib_hash(BPy_GenericLib * pydata)
-{
- return (long)pydata->id;
-}
-
diff --git a/source/blender/python/api2_2x/gen_library.h b/source/blender/python/api2_2x/gen_library.h
deleted file mode 100644
index 66cc8552e6b..00000000000
--- a/source/blender/python/api2_2x/gen_library.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Alex Mole, Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_gen_library_h
-#define EXPP_gen_library_h
-
-#include <Python.h>
-
-#include "DNA_ID.h"
-#include "DNA_listBase.h"
-
-/* ID functions for all libdata */
-#define GENERIC_LIB_GETSETATTR \
- {"name",\
- (getter)GenericLib_getName, (setter)GenericLib_setName,\
- "name",\
- NULL},\
- {"lib",\
- (getter)GenericLib_getLib, (setter)NULL,\
- "external library path",\
- NULL},\
- {"users",\
- (getter)GenericLib_getUsers, (setter)NULL,\
- "user count",\
- NULL},\
- {"fakeUser",\
- (getter)GenericLib_getFakeUser, (setter)GenericLib_setFakeUser,\
- "fake user state",\
- NULL},\
- {"properties",\
- (getter)GenericLib_getProperties, (setter)NULL,\
- "properties",\
- NULL},\
- {"tag",\
- (getter)GenericLib_getTag, (setter)GenericLib_setTag,\
- "temporary tag",\
- NULL}
-
-/* Dummy struct for getting the ID from a libdata BPyObject */
-typedef struct {
- PyObject_HEAD /* required python macro */
- ID *id;
-} BPy_GenericLib;
-
-int GenericLib_setName( void *self, PyObject *value );
-PyObject *GenericLib_getName( void *self );
-PyObject *GenericLib_getFakeUser( void *self );
-int GenericLib_setFakeUser( void *self, PyObject *value );
-PyObject *GenericLib_getTag( void *self );
-int GenericLib_setTag( void *self, PyObject *value );
-PyObject *GenericLib_getLib( void *self );
-PyObject *GenericLib_getUsers( void *self );
-PyObject *GenericLib_getProperties( void *self );
-
-/* use this for oldstyle somedata.getName("name") */
-PyObject * GenericLib_setName_with_method( void *self, PyObject *value );
-
-int GenericLib_assignData(PyObject *value, void **data, void **ndata, short refcount, short type, short subtype);
-short GenericLib_getType(PyObject * pydata);
-
-/* Other ID functions */
-ID *GetIdFromList( ListBase * list, char *name );
-PyObject *GetPyObjectFromID( ID * id );
-long GenericLib_hash(BPy_GenericLib * pydata);
-#endif /* EXPP_gen_library_h */
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c
deleted file mode 100644
index de3704164ac..00000000000
--- a/source/blender/python/api2_2x/gen_utils.c
+++ /dev/null
@@ -1,957 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Alex Mole, Ken Hughes,
- * Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "gen_utils.h" /*This must come first*/
-
-#include "DNA_text_types.h"
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-#include "BIF_space.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-
-#include "Mathutils.h"
-
-#include "constant.h"
-
-/*---------------------- EXPP_FloatsAreEqual -------------------------
- Floating point comparisons
- floatStep = number of representable floats allowable in between
- float A and float B to be considered equal. */
-int EXPP_FloatsAreEqual(float A, float B, int floatSteps)
-{
- int a, b, delta;
- assert(floatSteps > 0 && floatSteps < (4 * 1024 * 1024));
- a = *(int*)&A;
- if (a < 0)
- a = 0x80000000 - a;
- b = *(int*)&B;
- if (b < 0)
- b = 0x80000000 - b;
- delta = abs(a - b);
- if (delta <= floatSteps)
- return 1;
- return 0;
-}
-/*---------------------- EXPP_VectorsAreEqual -------------------------
- Builds on EXPP_FloatsAreEqual to test vectors */
-int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){
-
- int x;
- for (x=0; x< size; x++){
- if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0)
- return 0;
- }
- return 1;
-}
-/*---------------------- EXPP_GetModuleConstant -------------------------
- Helper function for returning a module constant */
-PyObject *EXPP_GetModuleConstant(char *module, char *constant)
-{
- PyObject *py_module = NULL, *py_dict = NULL, *py_constant = NULL;
-
- /*Careful to pass the correct Package.Module string here or
- * else you add a empty module somewhere*/
- py_module = PyImport_AddModule(module);
- if(!py_module){ /*null = error returning module*/
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error encountered with returning module constant..." ) );
- }
- py_dict = PyModule_GetDict(py_module); /*never fails*/
-
- py_constant = PyDict_GetItemString(py_dict, constant);
- if(!py_constant){ /*null = key not found*/
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error encountered with returning module constant..." ) );
- }
-
- return EXPP_incr_ret(py_constant);
-}
-
-/*****************************************************************************/
-/* Description: This function clamps an int to the given interval */
-/* [min, max]. */
-/*****************************************************************************/
-int EXPP_ClampInt( int value, int min, int max )
-{
- if( value < min )
- return min;
- else if( value > max )
- return max;
- return value;
-}
-
-/*****************************************************************************/
-/* Description: This function clamps a float to the given interval */
-/* [min, max]. */
-/*****************************************************************************/
-float EXPP_ClampFloat( float value, float min, float max )
-{
- if( value < min )
- return min;
- else if( value > max )
- return max;
- return value;
-}
-
-/*****************************************************************************/
-/* Description: This function returns true if both given strings are equal, */
-/* otherwise it returns false. */
-/*****************************************************************************/
-int StringEqual( const char *string1, const char *string2 )
-{
- return ( strcmp( string1, string2 ) == 0 );
-}
-
-
-/*****************************************************************************/
-/* Description: These functions set an internal string with the given type */
-/* and error_msg arguments. */
-/*****************************************************************************/
-
-PyObject *EXPP_ReturnPyObjError( PyObject * type, char *error_msg )
-{ /* same as above, just to change its name smoothly */
- PyErr_SetString( type, error_msg );
- return NULL;
-}
-
-int EXPP_ReturnIntError( PyObject * type, char *error_msg )
-{
- PyErr_SetString( type, error_msg );
- return -1;
-}
-
-int EXPP_intError(PyObject *type, const char *format, ...)
-{
- PyObject *error;
- va_list vlist;
-
- va_start(vlist, format);
- error = PyString_FromFormatV(format, vlist);
- va_end(vlist);
-
- PyErr_SetObject(type, error);
- Py_DECREF(error);
- return -1;
-}
-/*Like EXPP_ReturnPyObjError but takes a printf format string and multiple arguments*/
-PyObject *EXPP_objError(PyObject *type, const char *format, ...)
-{
- PyObject *error;
- va_list vlist;
-
- va_start(vlist, format);
- error = PyString_FromFormatV(format, vlist);
- va_end(vlist);
-
- PyErr_SetObject(type, error);
- Py_DECREF(error);
- return NULL;
-}
-
-/*****************************************************************************/
-/* Description: This function increments the reference count of the given */
-/* Python object (usually Py_None) and returns it. */
-/*****************************************************************************/
-
-PyObject *EXPP_incr_ret( PyObject * object )
-{
- Py_INCREF( object );
- return ( object );
-}
-
-/* return Py_False - to avoid warnings, we use the fact that
- * 0 == False in Python: */
-PyObject *EXPP_incr_ret_False()
-{
- return Py_BuildValue("i", 0);
-}
-
-/* return Py_True - to avoid warnings, we use the fact that
- * 1 == True in Python: */
-PyObject *EXPP_incr_ret_True()
-{
- return Py_BuildValue("i", 1);
-}
-
-void EXPP_incr2( PyObject * ob1, PyObject * ob2 )
-{
- Py_INCREF( ob1 );
- Py_INCREF( ob2 );
-}
-
-void EXPP_incr3( PyObject * ob1, PyObject * ob2, PyObject * ob3 )
-{
- Py_INCREF( ob1 );
- Py_INCREF( ob2 );
- Py_INCREF( ob3 );
-}
-
-void EXPP_decr2( PyObject * ob1, PyObject * ob2 )
-{
- Py_DECREF( ob1 );
- Py_DECREF( ob2 );
-}
-
-void EXPP_decr3( PyObject * ob1, PyObject * ob2, PyObject * ob3 )
-{
- Py_DECREF( ob1 );
- Py_DECREF( ob2 );
- Py_DECREF( ob3 );
-}
-/*****************************************************************************/
-/* Description: This function maps the event identifier to a string. */
-/*****************************************************************************/
-char *event_to_name( short event )
-{
- switch ( event ) {
- case SCRIPT_FRAMECHANGED:
- return "FrameChanged";
- case SCRIPT_OBJECTUPDATE:
- return "ObjectUpdate";
- case SCRIPT_OBDATAUPDATE:
- return "ObDataUpdate";
- case SCRIPT_ONLOAD:
- return "OnLoad";
- case SCRIPT_ONSAVE:
- return "OnSave";
- case SCRIPT_REDRAW:
- return "Redraw";
- case SCRIPT_RENDER:
- return "Render";
- case SCRIPT_POSTRENDER:
- return "PostRender";
- default:
- return "Unknown";
- }
-}
-
-/*****************************************************************************/
-/* Description: Checks whether all objects in a PySequence are of a same */
-/* given type. Returns 0 if not, 1 on success. */
-/*****************************************************************************/
-int EXPP_check_sequence_consistency( PyObject * seq, PyTypeObject * against )
-{
- PyObject *ob;
- int len = PySequence_Length( seq );
- int i, result = 1;
-
- for( i = 0; i < len; i++ ) {
- ob = PySequence_GetItem( seq, i );
- if( ob == Py_None )
- result = 2;
- else if( ob->ob_type != against ) {
- Py_DECREF( ob );
- return 0;
- }
- Py_DECREF( ob );
- }
- return result; /* 1 if all of 'against' type, 2 if there are (also) Nones */
-}
-
-PyObject *EXPP_tuple_repr( PyObject * self, int size )
-{
- PyObject *repr, *item;
- int i;
-
-/*@ note: a value must be built because the list is decrefed!
- * otherwise we have nirvana pointers inside python.. */
-
- repr = PyString_FromString( "" );
- if( !repr )
- return 0;
-
- item = PySequence_GetItem( self, 0 );
- PyString_ConcatAndDel( &repr, PyObject_Repr( item ) );
- Py_DECREF( item );
-
- for( i = 1; i < size; i++ ) {
- item = PySequence_GetItem( self, i );
- PyString_ConcatAndDel( &repr, PyObject_Repr( item ) );
- Py_DECREF( item );
- }
-
- return repr;
-}
-
-/****************************************************************************/
-/* Description: searches through a map for a pair with a given name. If the */
-/* pair is present, its ival is stored in *ival and nonzero is */
-/* returned. If the pair is absent, zero is returned. */
-/****************************************************************************/
-int EXPP_map_getIntVal( const EXPP_map_pair * map, const char *sval,
- int *ival )
-{
- while( map->sval ) {
- if( StringEqual( sval, map->sval ) ) {
- *ival = map->ival;
- return 1;
- }
- ++map;
- }
- return 0;
-}
-
-/* same as above, but string case is ignored */
-int EXPP_map_case_getIntVal( const EXPP_map_pair * map, const char *sval,
- int *ival )
-{
- while( map->sval ) {
- if( !BLI_strcasecmp( sval, map->sval ) ) {
- *ival = map->ival;
- return 1;
- }
- ++map;
- }
- return 0;
-}
-
-/****************************************************************************/
-/* Description: searches through a map for a pair with a given name. If the */
-/* pair is present, its ival is stored in *ival and nonzero is */
-/* returned. If the pair is absent, zero is returned. */
-/* note: this function is identical to EXPP_map_getIntVal except that the */
-/* output is stored in a short value. */
-/****************************************************************************/
-int EXPP_map_getShortVal( const EXPP_map_pair * map,
- const char *sval, short *ival )
-{
- while( map->sval ) {
- if( StringEqual( sval, map->sval ) ) {
- *ival = (short)map->ival;
- return 1;
- }
- ++map;
- }
- return 0;
-}
-
-/****************************************************************************/
-/* Description: searches through a map for a pair with a given ival. If the */
-/* pair is present, a pointer to its name is stored in *sval */
-/* and nonzero is returned. If the pair is absent, zero is */
-/* returned. */
-/****************************************************************************/
-int EXPP_map_getStrVal( const EXPP_map_pair * map, int ival,
- const char **sval )
-{
- while( map->sval ) {
- if( ival == map->ival ) {
- *sval = map->sval;
- return 1;
- }
- ++map;
- }
- return 0;
-}
-
-/* Redraw wrappers */
-
-/* this queues redraws if we're not in background mode: */
-void EXPP_allqueue(unsigned short event, short val)
-{
- if (!G.background) allqueue(event, val);
-}
-
-/************************************************************************/
-/* Scriptlink-related functions, used by scene, object, etc. bpyobjects */
-/************************************************************************/
-PyObject *EXPP_getScriptLinks( ScriptLink * slink, PyObject * value,
- int is_scene )
-{
- PyObject *list = NULL, *tmpstr;
- char *eventname = PyString_AsString(value);
- int i, event = 0;
-
-
- if( !eventname )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected event name (string) as argument" );
-
- list = PyList_New( 0 );
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList!" );
-
- /* actually !scriptlink shouldn't happen ... */
- if( !slink || !slink->totscript )
- return list;
-
- if( !strcmp( eventname, "FrameChanged" ) )
- event = SCRIPT_FRAMECHANGED;
- else if( !strcmp( eventname, "ObjectUpdate" ) )
- event = SCRIPT_OBJECTUPDATE;
- else if( !strcmp( eventname, "ObDataUpdate" ) )
- event = SCRIPT_OBDATAUPDATE;
- else if( !strcmp( eventname, "Redraw" ) )
- event = SCRIPT_REDRAW;
- else if( !strcmp( eventname, "Render" ) )
- event = SCRIPT_RENDER;
- else if( is_scene && !strcmp( eventname, "OnLoad" ) )
- event = SCRIPT_ONLOAD;
- else if( is_scene && !strcmp( eventname, "OnSave" ) )
- event = SCRIPT_ONSAVE;
- else {
- Py_DECREF(list);
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "invalid event name" );
- }
-
- for( i = 0; i < slink->totscript; i++ ) {
- if( ( slink->flag[i] == event ) && slink->scripts[i] ) {
- tmpstr =PyString_FromString( slink->scripts[i]->name + 2 );
- PyList_Append( list, tmpstr );
- Py_DECREF(tmpstr);
- }
- }
-
- return list;
-}
-
-PyObject *EXPP_clearScriptLinks( ScriptLink * slink, PyObject * args )
-{
- int i, j, totLinks, deleted = 0;
- PyObject *seq = NULL;
- ID **stmp = NULL;
- short *ftmp = NULL;
-
- /* check for an optional list of strings */
- if( !PyArg_ParseTuple( args, "|O", &seq ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected no arguments or a list of strings" ) );
-
-
- /* if there was a parameter, handle it */
- if ( seq != NULL ) {
- /* check that parameter IS list of strings */
- if ( !PyList_Check ( seq ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected a list of strings" ) );
-
- totLinks = PyList_Size ( seq );
- for ( i = 0 ; i < totLinks ; ++i ) {
- if ( !PyString_Check ( PySequence_GetItem( seq, i ) ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_TypeError,
- "expected list to contain strings" ) );
- }
-
- /*
- parameters OK: now look for each script, and delete
- its link as we find it (this handles multiple links)
- */
- for ( i = 0 ; i < totLinks ; ++i )
- {
- char *str;
- str = PyString_AsString ( PySequence_GetItem( seq, i ) );
- for ( j = 0 ; j < slink->totscript ; ++j ) {
- if ( slink->scripts[j] && !strcmp( slink->scripts[j]->name+2, str ) )
- slink->scripts[j] = NULL;
- if( !slink->scripts[j] )
- ++deleted;
- }
- }
- }
- /* if no parameter, then delete all scripts */
- else {
- deleted = slink->totscript;
- }
-
- /*
- if not all scripts deleted, create new lists and copy remaining
- links to them
- */
-
- if ( slink->totscript > deleted ) {
- slink->totscript = slink->totscript - (short)deleted;
-
- stmp = slink->scripts;
- slink->scripts =
- MEM_mallocN( sizeof( ID * ) * ( slink->totscript ),
- "bpySlinkL" );
-
- ftmp = slink->flag;
- slink->flag =
- MEM_mallocN( sizeof( short * ) * ( slink->totscript ),
- "bpySlinkF" );
-
- for ( i = 0, j = 0 ; i < slink->totscript ; ++j ) {
- if ( stmp[j] != NULL ) {
- memcpy( slink->scripts+i, stmp+j, sizeof( ID * ) );
- memcpy( slink->flag+i, ftmp+j, sizeof( short ) );
- ++i;
- }
- }
- MEM_freeN( stmp );
- MEM_freeN( ftmp );
-
- /*EXPP_allqueue (REDRAWBUTSSCRIPT, 0 );*/
- slink->actscript = 1;
- } else {
-
- /* all scripts deleted, so delete entire list and free memory */
-
- if( slink->scripts )
- MEM_freeN( slink->scripts );
- if( slink->flag )
- MEM_freeN( slink->flag );
-
- slink->scripts = NULL;
- slink->flag = NULL;
- slink->totscript = slink->actscript = 0;
- }
-
- return EXPP_incr_ret( Py_None );
-}
-
-
-PyObject *EXPP_addScriptLink(ScriptLink *slink, PyObject *args, int is_scene)
-{
- int event = 0, found_txt = 0;
- void *stmp = NULL, *ftmp = NULL;
- Text *bltxt = G.main->text.first;
- char *textname = NULL;
- char *eventname = NULL;
-
- /* !scriptlink shouldn't happen ... */
- if( !slink ) {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "internal error: no scriptlink!" );
- }
-
- if( !PyArg_ParseTuple( args, "ss", &textname, &eventname ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two strings as arguments" );
-
- while( bltxt ) {
- if( !strcmp( bltxt->id.name + 2, textname ) ) {
- found_txt = 1;
- break;
- }
- bltxt = bltxt->id.next;
- }
-
- if( !found_txt )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "no such Blender Text" );
-
- if( !strcmp( eventname, "FrameChanged" ) )
- event = SCRIPT_FRAMECHANGED;
- else if( !strcmp( eventname, "ObjectUpdate" ) )
- event = SCRIPT_OBJECTUPDATE;
- else if( !strcmp( eventname, "ObDataUpdate" ) )
- event = SCRIPT_OBDATAUPDATE;
- else if( !strcmp( eventname, "Redraw" ) )
- event = SCRIPT_REDRAW;
- else if( !strcmp( eventname, "Render" ) )
- event = SCRIPT_RENDER;
- else if( is_scene && !strcmp( eventname, "OnLoad" ) )
- event = SCRIPT_ONLOAD;
- else if( is_scene && !strcmp( eventname, "OnSave" ) )
- event = SCRIPT_ONSAVE;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "invalid event name" );
-
- stmp = slink->scripts;
- slink->scripts =
- MEM_mallocN( sizeof( ID * ) * ( slink->totscript + 1 ),
- "bpySlinkL" );
-
- ftmp = slink->flag;
- slink->flag =
- MEM_mallocN( sizeof( short * ) * ( slink->totscript + 1 ),
- "bpySlinkF" );
-
- if( slink->totscript ) {
- memcpy( slink->scripts, stmp,
- sizeof( ID * ) * ( slink->totscript ) );
- MEM_freeN( stmp );
-
- memcpy( slink->flag, ftmp,
- sizeof( short ) * ( slink->totscript ) );
- MEM_freeN( ftmp );
- }
-
- slink->scripts[slink->totscript] = ( ID * ) bltxt;
- slink->flag[slink->totscript] = (short)event;
-
- slink->totscript++;
-
- if( slink->actscript < 1 )
- slink->actscript = 1;
-
- return EXPP_incr_ret (Py_None); /* normal exit */
-}
-
-/*
- * Utility routines to clamp and store various datatypes. The object type
- * is checked and a exception is raised if it's not the correct type.
- *
- * Inputs:
- * value: PyObject containing the new value
- * param: pointer to destination variable
- * max, min: range of values for clamping
- * type: kind of pointer and data (uses the same characters as
- * PyArgs_ParseTuple() and Py_BuildValue()
- *
- * Return 0 on success, -1 on error.
- */
-
-int EXPP_setFloatClamped( PyObject *value, float *param,
- float min, float max )
-{
- if( !PyNumber_Check ( value ) ) {
- char errstr[128];
- sprintf ( errstr, "expected float argument in [%f,%f]", min, max );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- *param = EXPP_ClampFloat( (float)PyFloat_AsDouble( value ), min, max );
-
- return 0;
-}
-
-int EXPP_setIValueClamped( PyObject *value, void *param,
- int min, int max, char type )
-{
- int number;
-
- if( !PyInt_Check( value ) ) {
- char errstr[128];
- sprintf ( errstr, "expected int argument in [%d,%d]", min, max );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-
- number = PyInt_AS_LONG( value );
-
- switch ( type ) {
- case 'b':
- *(char *)param = (char)EXPP_ClampInt( number, min, max );
- return 0;
- case 'h':
- *(short *)param = (short)EXPP_ClampInt( number, min, max );
- return 0;
- case 'H':
- *(unsigned short *)param = (unsigned short)EXPP_ClampInt( number, min, max );
- return 0;
- case 'i':
- *(int *)param = EXPP_ClampInt( number, min, max );
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "EXPP_setIValueClamped(): invalid type code" );
- }
-}
-
-int EXPP_setVec3Clamped( PyObject *value, float *param,
- float min, float max )
-{
- if( VectorObject_Check( value ) ) {
- VectorObject *vect = (VectorObject *)value;
- if( vect->size == 3 ) {
- param[0] = EXPP_ClampFloat( vect->vec[0], min, max );
- param[1] = EXPP_ClampFloat( vect->vec[1], min, max );
- param[2] = EXPP_ClampFloat( vect->vec[2], min, max );
- return 0;
- }
- }
-
- if (1) {
- char errstr[128];
- sprintf ( errstr, "expected vector argument in [%f,%f]", min, max );
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
- }
-}
-
-
-/*
- * Utility routines to range-check and store various datatypes. The object
- * type is checked and a exception is raised if it's not the correct type.
- * An exception is also raised if the value lies outside of the specified
- * range.
- *
- * Inputs:
- * value: PyObject containing the new value
- * param: pointer to destination variable
- * max, min: valid range for value
- * type: kind of pointer and data (uses the same characters as
- * PyArgs_ParseTuple() and Py_BuildValue()
- *
- * Return 0 on success, -1 on error.
- */
-
-int EXPP_setFloatRange( PyObject *value, float *param,
- float min, float max )
-{
- char errstr[128];
- float number;
-
- sprintf ( errstr, "expected int argument in [%f,%f]", min, max );
-
- if( !PyNumber_Check ( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
-
- number = (float)PyFloat_AsDouble( value );
- if ( number < min || number > max )
- return EXPP_ReturnIntError( PyExc_ValueError, errstr );
-
- *param = number;
- return 0;
-}
-
-int EXPP_setIValueRange( PyObject *value, void *param,
- int min, int max, char type )
-{
- char errstr[128];
- int number;
-
- sprintf ( errstr, "expected int argument in [%d,%d]", min, max );
-
- if( !PyInt_Check ( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
-
- number = PyInt_AS_LONG( value );
- if( number < min || number > max )
- return EXPP_ReturnIntError( PyExc_ValueError, errstr );
-
- switch ( type ) {
- case 'b':
- *(char *)param = (char)number;
- return 0;
- case 'h':
- *(short *)param = (short)number;
- return 0;
- case 'H':
- *(unsigned short *)param = (unsigned short)number;
- return 0;
- case 'i':
- *(int *)param = number;
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "EXPP_setIValueRange(): invalid type code" );
- }
-}
-
-/*
- * Utility routines to handle all attribute setters which use module
- * constants. Generic pointer to destination variable is used, and typecast
- * to the appropriate type based on the "type" specifier.
- *
- * Inputs:
- * constant: constant_Type value
- * param: pointer to destination variable
- * type: kind of pointer and data
- *
- * Return 0 on success, -1 on error.
- */
-
-int EXPP_setModuleConstant ( BPy_constant *constant, void *param, char type )
-{
- PyObject *item;
-
- if( constant->ob_type != &constant_Type )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected module constant" );
-
- item = PyDict_GetItemString( constant->dict, "value" );
- if( !item )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "module constant has no \"value\" key" );
-
- switch ( type ) {
- case 'h':
- *(short *)param = (short)PyInt_AS_LONG( item );
- return 0;
- case 'i':
- *(int *)param = PyInt_AS_LONG( item );
- return 0;
- case 'f':
- *(float *)param = (float)PyFloat_AS_DOUBLE( item );
- Py_DECREF(item); /* line above increfs */
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "EXPP_setModuleConstant(): invalid type code" );
- }
-}
-
-/*
- * Utility routines to get/set bits in bitfields. Adapted from code in
- * sceneRender.c (thanks, ascotan!).
- *
- * Inputs:
- * param: pointer to source/destination variable
- * setting: the bit to get/set
- * type: pointer type ('h' == short, 'i' == integer)
- */
-
-PyObject *EXPP_getBitfield( void *param, int setting, char type )
-{
- switch ( type ) {
- case 'b':
- return (*(char *)param & setting)
- ? EXPP_incr_ret_True() : EXPP_incr_ret_False();
- case 'h':
- return (*(short *)param & setting)
- ? EXPP_incr_ret_True() : EXPP_incr_ret_False();
- case 'i':
- return (*(int *)param & setting)
- ? EXPP_incr_ret_True() : EXPP_incr_ret_False();
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "EXPP_getBit(): invalid type code" );
- }
-}
-
-int EXPP_setBitfield( PyObject * value, void *param, int setting, char type )
-{
- int param_bool = PyObject_IsTrue( value );
-
- if( param_bool == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- switch ( type ) {
- case 'b':
- if ( param_bool )
- *(char *)param |= setting;
- else
- *(char *)param &= ~setting;
- return 0;
- case 'h':
- if ( param_bool )
- *(short *)param |= setting;
- else
- *(short *)param &= ~setting;
- return 0;
- case 'i':
- if ( param_bool )
- *(int *)param |= setting;
- else
- *(int *)param &= ~setting;
- return 0;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "EXPP_setBit(): invalid type code" );
- }
-}
-
-/*
- * Procedure to handle older setStuff() methods. Assumes that argument
- * is a tuple with one object, and so grabs the object and passes it to
- * the specified tp_getset setter for the corresponding attribute.
- */
-
-PyObject *EXPP_setterWrapper ( PyObject * self, PyObject * args,
- setter func)
-{
- int error;
-
- if ( !PyTuple_Check( args ) || PyTuple_Size( args ) != 1 )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "expected tuple of one item" );
-
- error = func ( self, PyTuple_GET_ITEM( args, 0 ), NULL );
- if ( !error ) {
- Py_INCREF( Py_None );
- return Py_None;
- } else
- return NULL;
-}
-
-/*
- * Procedure to handle older setStuff() methods. Assumes that argument
- * is a tuple, so just passes it to the specified tp_getset setter for
- * the corresponding attribute.
- */
-
-PyObject *EXPP_setterWrapperTuple ( PyObject * self, PyObject * args,
- setter func)
-{
- int error;
-
- if ( !PyTuple_Check( args ) )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "expected tuple" );
-
- error = func ( self, args, NULL );
- if ( !error ) {
- Py_INCREF( Py_None );
- return Py_None;
- } else
- return NULL;
-}
-
-/*
- * Helper to keep dictionaries from causing memory leaks. When some object
- * is just created to be added to the dictionary, its reference count needs
- * to be decremented so it can be reclaimed.
- */
-
-int EXPP_dict_set_item_str( PyObject *dict, char *key, PyObject *value)
-{
- /* add value to dictionary */
- int ret = PyDict_SetItemString(dict, key, value);
- Py_DECREF( value ); /* delete original */
- return ret;
-}
-
-/*
- * Helper function for subtypes that what the base types methods.
- * The command below needs to have args modified to have 'self' added at the start
- * ret = PyObject_Call(PyDict_GetItemString(PyList_Type.tp_dict, "sort"), newargs, keywds);
- *
- * This is not easy with the python API so adding a function here,
- * remember to Py_DECREF the tuple after
- */
-
-PyObject * EXPP_PyTuple_New_Prepend(PyObject *tuple, PyObject *value)
-{
- PyObject *item;
- PyObject *new_tuple;
- int i;
-
- i = PyTuple_Size(tuple);
- new_tuple = PyTuple_New(i+1);
- PyTuple_SetItem(new_tuple, 0, value);
- Py_INCREF(value);
- while (i) {
- i--;
- item = PyTuple_GetItem(tuple, i);
- PyTuple_SetItem(new_tuple, i+1, item);
- Py_INCREF(item);
- }
- return new_tuple;
-}
diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h
deleted file mode 100644
index f33dc69d703..00000000000
--- a/source/blender/python/api2_2x/gen_utils.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Alex Mole, Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_gen_utils_h
-#define EXPP_gen_utils_h
-
-#include <Python.h>
-#include "DNA_ID.h"
-#include "DNA_scriptlink_types.h"
-#include "DNA_listBase.h"
-
-#include "constant.h"
-
-#define Py_PI 3.14159265358979323846
-#define Py_WRAP 1024
-#define Py_NEW 2048
-
-/*
- Py_RETURN_NONE
- Python 2.4 macro.
- defined here until we switch to 2.4
- also in PyObjectPlus.h for gameengine
-*/
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE return PyBool_FromLong(0)
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE return PyBool_FromLong(1)
-#endif
-
-/* Py 2.5 adds a new Py_ssize_t type for 64 bit support */
-/* #if'ed for your compiling pleasure */
-#if 1
-
-/* for pre Py 2.5 */
-#if PY_VERSION_HEX < 0x02050000
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#else
-/* Py 2.5 and later */
-#define intargfunc ssizeargfunc
-#define intintargfunc ssizessizeargfunc
-#endif
-
-#endif
-
-/* name of list of Armature weak refs built into __main__ */
-#define ARM_WEAKREF_LIST_NAME "__arm_weakrefs"
-
-int EXPP_FloatsAreEqual(float A, float B, int floatSteps);
-int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps);
-
-PyObject *EXPP_GetModuleConstant(char *module, char *constant);
-
-int StringEqual( const char *string1, const char *string2 );
-
-PyObject *PythonReturnErrorObject( PyObject * type, char *error_msg );
-PyObject *PythonIncRef( PyObject * object );
-
-char *event_to_name( short event );
-
-float EXPP_ClampFloat( float value, float min, float max );
-int EXPP_ClampInt( int value, int min, int max );
-
-void EXPP_incr2( PyObject * ob1, PyObject * ob2 );
-void EXPP_incr3( PyObject * ob1, PyObject * ob2, PyObject * ob3 );
-void EXPP_decr2( PyObject * ob1, PyObject * ob2 );
-void EXPP_decr3( PyObject * ob1, PyObject * ob2, PyObject * ob3 );
-PyObject *EXPP_incr_ret( PyObject * object );
-PyObject *EXPP_incr_ret_True(void);
-PyObject *EXPP_incr_ret_False(void);
-PyObject *EXPP_ReturnPyObjError( PyObject * type, char *error_msg );
-int EXPP_ReturnIntError( PyObject * type, char *error_msg );
-
-PyObject *EXPP_objError(PyObject *type, const char *format, ...);
-int EXPP_intError(PyObject *type, const char *format, ...);
-
-int EXPP_check_sequence_consistency( PyObject * seq, PyTypeObject * against );
-PyObject *EXPP_tuple_repr( PyObject * self, int size );
-
-/* mapping utilities - see Texture.c for an example of how to use these */
-typedef struct {
- const char *sval;
- int ival;
-} EXPP_map_pair;
-
-/* maps must end with a pair that has NULL as sval */
-int EXPP_map_getIntVal( const EXPP_map_pair * map,
- const char *sval, int *ival );
-int EXPP_map_case_getIntVal( const EXPP_map_pair * map,
- const char *sval, int *ival );
-int EXPP_map_getShortVal( const EXPP_map_pair * map,
- const char *sval, short *ival );
-int EXPP_map_getStrVal( const EXPP_map_pair * map,
- int ival, const char **sval );
-
-/* clamping and range-checking utilities */
-
-int EXPP_setIValueClamped( PyObject *value, void *param,
- int min, int max, char type );
-int EXPP_setFloatClamped ( PyObject *value, float *param,
- float min, float max);
-int EXPP_setVec3Clamped ( PyObject *value, float *param,
- float min, float max);
-int EXPP_setIValueRange( PyObject *value, void *param,
- int min, int max, char type );
-int EXPP_setFloatRange ( PyObject *value, float *param,
- float min, float max);
-
-/* utility routine for PyType attributes setters with module constant */
-
-int EXPP_setModuleConstant ( BPy_constant *constant, void *param,
- char type );
-
-/* utilities to get/set bits in bitfields */
-
-PyObject *EXPP_getBitfield( void *param, int setting, char type );
-int EXPP_setBitfield( PyObject * value, void *param, int setting, char type );
-
-/*
- * Procedures to handle older setStuff() methods, which now access
- * a PyType's setter attributes using the tp_getset mechanism.
- */
-
-PyObject *EXPP_setterWrapper ( PyObject * self, PyObject * args,
- setter func);
-
-PyObject *EXPP_setterWrapperTuple ( PyObject * self, PyObject * args,
- setter func);
-
-/* scriplinks-related: */
-PyObject *EXPP_getScriptLinks(ScriptLink *slink, PyObject *value, int is_scene);
-PyObject *EXPP_addScriptLink(ScriptLink *slink, PyObject *args, int is_scene);
-PyObject *EXPP_clearScriptLinks(ScriptLink *slink, PyObject *args);
-
-/* this queues redraws if we're not in background mode: */
-void EXPP_allqueue(unsigned short event, short val);
-
-/* helper to keep dictionaries from causing memory leaks */
-int EXPP_dict_set_item_str( PyObject *dict, char *key, PyObject *value);
-PyObject * EXPP_PyTuple_New_Prepend(PyObject *tuple, PyObject *value);
-
-#endif /* EXPP_gen_utils_h */
-
diff --git a/source/blender/python/api2_2x/logic.c b/source/blender/python/api2_2x/logic.c
deleted file mode 100644
index 99c506d1a34..00000000000
--- a/source/blender/python/api2_2x/logic.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "logic.h" /*This must come first*/
-
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-
-//--------------- Python BPy_Property methods declarations:---------------
-static PyObject *Property_getName( BPy_Property * self );
-static PyObject *Property_setName( BPy_Property * self, PyObject * value );
-static PyObject *Property_getData( BPy_Property * self );
-static PyObject *Property_setData( BPy_Property * self, PyObject * args );
-static PyObject *Property_getType( BPy_Property * self );
-//--------------- Python BPy_Property methods table:----------------------
-static PyMethodDef BPy_Property_methods[] = {
- {"getName", ( PyCFunction ) Property_getName, METH_NOARGS,
- "() - return Property name"},
- {"setName", ( PyCFunction ) Property_setName, METH_O,
- "() - set the name of this Property"},
- {"getData", ( PyCFunction ) Property_getData, METH_NOARGS,
- "() - return Property data"},
- {"setData", ( PyCFunction ) Property_setData, METH_VARARGS,
- "() - set the data of this Property"},
- {"getType", ( PyCFunction ) Property_getType, METH_NOARGS,
- "() - return Property type"},
- {NULL, NULL, 0, NULL}
-};
-//--------------- Python TypeProperty callback function prototypes--------
-static void Property_dealloc( BPy_Property * Property );
-static PyObject *Property_getAttr( BPy_Property * Property, char *name );
-static int Property_setAttr( BPy_Property * Property, char *name,
- PyObject * v );
-static PyObject *Property_repr( BPy_Property * Property );
-static int Property_compare( BPy_Property * a1, BPy_Property * a2 );
-//--------------- Python TypeProperty structure definition----------------
-PyTypeObject property_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Property", /* tp_name */
- sizeof( BPy_Property ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) Property_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) Property_getAttr, /* tp_getattr */
- ( setattrfunc ) Property_setAttr, /* tp_setattr */
- ( cmpfunc ) Property_compare, /* tp_compare */
- ( reprfunc ) Property_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0, 0,
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- BPy_Property_methods, /* tp_methods */
- 0, /* tp_members */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-//--------------- Property module internal callbacks-------------------
-
-//--------------- updatePyProperty-------------------------------------
-int updatePyProperty( BPy_Property * self )
-{
- if( !self->property ) {
- return 0; //nothing to update - not linked
- } else {
- BLI_strncpy( self->name, self->property->name, 32 );
- self->type = self->property->type;
- if( self->property->type == PROP_BOOL ) {
- if( *( ( int * ) &self->property->poin ) ) {
- self->data = EXPP_incr_ret_True();
- } else {
- self->data = EXPP_incr_ret_False();
- }
- } else if( self->property->type == PROP_INT ) {
- self->data = PyInt_FromLong( self->property->data );
- } else if( self->property->type == PROP_FLOAT ) {
- self->data =
- PyFloat_FromDouble( *
- ( ( float * ) &self->
- property->data ) );
- } else if( self->property->type == PROP_TIME ) {
- self->data =
- PyFloat_FromDouble( *
- ( ( float * ) &self->
- property->data ) );
- } else if( self->property->type == PROP_STRING ) {
- self->data =
- PyString_FromString( self->property->poin );
- }
- return 1;
- }
-}
-
-//--------------- updatePropertyData------------------------------------
-int updateProperyData( BPy_Property * self )
-{
- if( !self->property ) {
- //nothing to update - not linked
- return 0;
- } else {
- BLI_strncpy( self->property->name, self->name, 32 );
- self->property->type = self->type;
- if( PyInt_Check( self->data ) ) {
- *( ( int * ) &self->property->data ) =
- ( int ) PyInt_AsLong( self->data );
- } else if( PyFloat_Check( self->data ) ) {
- *( ( float * ) &self->property->data ) =
- ( float ) PyFloat_AsDouble( self->data );
- } else if( PyString_Check( self->data ) ) {
- BLI_strncpy( self->property->poin,
- PyString_AsString( self->data ),
- MAX_PROPSTRING );
- }
- return 1;
- }
-}
-
-//--------------- checkValidData_ptr--------------------------------
-static int checkValidData_ptr( BPy_Property * self )
-{
- int length;
- /* test pointer to see if data was removed (oops) */
- /* WARNING!!! - MEMORY LEAK HERE, why not free this??? */
- length = MEM_allocN_len( self->property );
- if( length != sizeof( bProperty ) ) { //data was freed
- self->property = NULL;
- return 0;
- } else { //it's ok as far as we can tell
- return 1;
- }
-}
-
-//---------------BPy_Property internal callbacks/methods------------
-
-//--------------- dealloc-------------------------------------------
-static void Property_dealloc( BPy_Property * self )
-{
- PyMem_Free( self->name );
- PyObject_DEL( self );
-}
-
-//---------------getattr--------------------------------------------
-static PyObject *Property_getAttr( BPy_Property * self, char *name )
-{
- checkValidData_ptr( self );
- if( strcmp( name, "name" ) == 0 )
- return Property_getName( self );
- else if( strcmp( name, "data" ) == 0 )
- return Property_getData( self );
- else if( strcmp( name, "type" ) == 0 )
- return Property_getType( self );
- else if( strcmp( name, "__members__" ) == 0 ) {
- return Py_BuildValue( "[s,s,s]", "name", "data", "type" );
- }
-
- return Py_FindMethod( BPy_Property_methods, ( PyObject * ) self, name );
-}
-
-//--------------- setattr-------------------------------------------
-static int
-Property_setAttr( BPy_Property * self, char *name, PyObject * value )
-{
- PyObject *error = NULL;
-
- checkValidData_ptr( self );
-
- if( strcmp( name, "name" ) == 0 ) {
- error = Property_setName( self, value );
- } else if( strcmp( name, "data" ) == 0 ) {
- PyObject *valtuple = Py_BuildValue( "(O)", value );
- if( !valtuple )
- return EXPP_ReturnIntError( PyExc_MemoryError,
- "PropertySetAttr: couldn't create tuple" );
-
- error = Property_setData( self, valtuple );
- Py_DECREF( valtuple );
- } else {
- return ( EXPP_ReturnIntError
- ( PyExc_KeyError, "attribute not found" ) );
- }
-
-
- if( error != Py_None )
- return -1;
-
- Py_DECREF( Py_None );
- return 0;
-}
-
-//--------------- repr----------------------------------------------
-static PyObject *Property_repr( BPy_Property * self )
-{
- checkValidData_ptr( self );
- if( self->property ) {
- return PyString_FromFormat( "[Property \"%s\"]",
- self->property->name );
- } else {
- return PyString_FromFormat( "[Property \"%s\"]", self->name );
- }
-}
-
-//--------------- compare-------------------------------------------
-//compares property.name and property.data
-static int Property_compare( BPy_Property * a, BPy_Property * b )
-{
- BPy_Property *py_propA, *py_propB;
- int retval = -1;
-
- checkValidData_ptr( a );
- checkValidData_ptr( b );
- //2 python objects
- if( !a->property && !b->property ) {
- if( a->type != b->type )
- retval = -1;
- if( BLI_streq( a->name, b->name ) ) {
- retval = PyObject_Compare( a->data, b->data );
- } else
- retval = -1;
- } else if( a->property && b->property ) { //2 real properties
- if( a->property->type != b->property->type )
- retval = -1;
- if( BLI_streq( a->property->name, b->property->name ) ) {
- if( a->property->type == PROP_BOOL
- || a->property->type == PROP_INT ) {
- if( a->property->data == b->property->data )
- retval = 0;
- else
- retval = -1;
- } else if( a->property->type == PROP_FLOAT
- || a->property->type == PROP_TIME ) {
- if( *( ( float * ) &a->property->data ) ==
- *( ( float * ) &b->property->data ) )
- retval = 0;
- else
- retval = -1;
- } else if( a->property->type == PROP_STRING ) {
- if( BLI_streq
- ( a->property->poin, b->property->poin ) )
- retval = 0;
- else
- retval = -1;
- }
- } else
- retval = -1;
- } else { //1 real 1 python
- if( !a->property ) {
- py_propA = a;
- py_propB = b;
- } else {
- py_propA = b;
- py_propB = a;
- }
- if( py_propB->property->type != py_propA->type )
- retval = -1;
- if( BLI_streq( py_propB->property->name, py_propA->name ) ) {
- if( py_propB->property->type == PROP_BOOL ||
- py_propB->property->type == PROP_INT ) {
- retval = PyObject_Compare( py_propA->data,
- PyInt_FromLong
- ( py_propB->
- property->
- data ) );
- } else if( py_propB->property->type == PROP_FLOAT
- || py_propB->property->type == PROP_TIME ) {
- retval = PyObject_Compare( py_propA->data,
- PyFloat_FromDouble
- ( *
- ( ( float * )
- &py_propB->
- property->
- data ) ) );
- } else if( py_propB->property->type == PROP_STRING ) {
- PyObject *tmpstr = PyString_FromString( py_propB->property->poin );
- retval = PyObject_Compare( py_propA->data, tmpstr );
- Py_DECREF(tmpstr);
- }
- } else
- retval = -1;
- }
- return retval;
-}
-
-//--------------- Property visible functions------------------------
-//--------------- Property_CreatePyObject---------------------------
-PyObject *Property_CreatePyObject( struct bProperty * Property )
-{
- BPy_Property *py_property;
-
- py_property =
- ( BPy_Property * ) PyObject_NEW( BPy_Property,
- &property_Type );
-
- //set the struct flag
- py_property->property = Property;
-
- //allocate space for python vars
- py_property->name = PyMem_Malloc( 32 );
-
- if( !updatePyProperty( py_property ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, "Property struct empty" ) );
-
- return ( ( PyObject * ) py_property );
-}
-
-//--------------- Property_FromPyObject-----------------------------
-struct bProperty *Property_FromPyObject( PyObject * py_obj )
-{
- BPy_Property *py_property;
-
- py_property = ( BPy_Property * ) py_obj;
- if( !py_property->property )
- return NULL;
- else
- return ( py_property->property );
-}
-
-//--------------- newPropertyObject()-------------------------------
-PyObject *newPropertyObject( char *name, PyObject * data, int type )
-{
- BPy_Property *py_property;
-
- py_property =
- ( BPy_Property * ) PyObject_NEW( BPy_Property,
- &property_Type );
- py_property->name = PyMem_Malloc( 32 );
- py_property->property = NULL;
-
- BLI_strncpy( py_property->name, name, 32 );
- py_property->data = data;
- py_property->type = (short)type;
-
- return ( PyObject * ) py_property;
-}
-
-//--------------- Python BPy_Property methods-----------------------
-//--------------- BPy_Property.getName()----------------------------
-static PyObject *Property_getName( BPy_Property * self )
-{
- if( !self->property )
- return PyString_FromString( self->name );
- else
- return PyString_FromString( self->property->name );
-}
-
-//--------------- BPy_Property.setName()----------------------------
-static PyObject *Property_setName( BPy_Property * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
-
- if( !name )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected string argument" ) );
-
- if( !self->property ) {
- BLI_strncpy( self->name, name, 32 );
- } else {
- BLI_strncpy( self->property->name, name, 32 );
- updatePyProperty( self );
- }
-
- Py_RETURN_NONE;
-}
-
-//--------------- BPy_Property.getData()----------------------------
-static PyObject *Property_getData( BPy_Property * self )
-{
- PyObject *attr = NULL;
-
- if( !self->property ) {
- attr = EXPP_incr_ret( self->data );
- } else {
- if( self->property->type == PROP_BOOL ) {
- if( self->property->data )
- attr = EXPP_incr_ret_True();
- else
- attr = EXPP_incr_ret_False();
- } else if( self->property->type == PROP_INT ) {
- attr = PyInt_FromLong( self->property->data );
- } else if( self->property->type == PROP_FLOAT ||
- self->property->type == PROP_TIME ) {
- attr = PyFloat_FromDouble( *
- ( ( float * ) &self->
- property->data ) );
- } else if( self->property->type == PROP_STRING ) {
- attr = PyString_FromString( self->property->poin );
- }
- }
- if( attr )
- return attr;
-
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't get Property.data attribute" ) );
-}
-
-//--------------- BPy_Property.setData()----------------------------
-static PyObject *Property_setData( BPy_Property * self, PyObject * args )
-{
- PyObject *data;
- char *type_str = NULL;
- int type = -1;
- short *p_type = NULL;
-
- if( !PyArg_ParseTuple( args, "O|s", &data, &type_str ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected object and optional string argument" ) );
-
- if( !PyInt_Check( data ) && !PyFloat_Check( data )
- && !PyString_Check( data ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_RuntimeError,
- "float, int, or string expected as data" ) );
-
- //parse property name
- if( type_str ) {
- if( BLI_streq( type_str, "BOOL" ) )
- type = PROP_BOOL;
- else if( BLI_streq( type_str, "INT" ) )
- type = PROP_INT;
- else if( BLI_streq( type_str, "FLOAT" ) )
- type = PROP_FLOAT;
- else if( BLI_streq( type_str, "TIME" ) )
- type = PROP_TIME;
- else if( BLI_streq( type_str, "STRING" ) )
- type = PROP_STRING;
- else
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "BOOL, INT, FLOAT, TIME or STRING expected" ) );
- }
- //get pointer to type
- if( self->property )
- p_type = &self->property->type;
- else
- p_type = &self->type;
-
- //set the type
- if( PyInt_Check( data ) ) {
- if( type == -1 || type == PROP_INT )
- *p_type = PROP_INT;
- else
- *p_type = PROP_BOOL;
- } else if( PyFloat_Check( data ) ) {
- if( type == -1 || type == PROP_FLOAT )
- *p_type = PROP_FLOAT;
- else
- *p_type = PROP_TIME;
- } else if( PyString_Check( data ) ) {
- if( type == -1 || type == PROP_STRING )
- *p_type = PROP_STRING;
- } else {
- return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cant set unknown data type" ) );
- }
-
- //set the data
- if( self->property ) {
- if( PyInt_Check( data ) ) {
- *( ( int * ) &self->property->data ) =
- ( int ) PyInt_AsLong( data );
- } else if( PyFloat_Check( data ) ) {
- *( ( float * ) &self->property->data ) =
- ( float ) PyFloat_AsDouble( data );
- } else if( PyString_Check( data ) ) {
- BLI_strncpy( self->property->poin,
- PyString_AsString( data ),
- MAX_PROPSTRING );
- }
- updatePyProperty( self );
- } else {
- self->data = data;
- }
- Py_RETURN_NONE;
-}
-
-//--------------- BPy_Property.getType()----------------------------
-static PyObject *Property_getType( BPy_Property * self )
-{
- int type;
-
- if( self->property )
- type = self->property->type;
- else
- type = self->type;
-
- if( type == PROP_BOOL )
- return PyString_FromString( "BOOL" );
- else if( type == PROP_INT )
- return PyString_FromString( "INT" );
- else if( type == PROP_FLOAT )
- return PyString_FromString( "FLOAT" );
- else if( type == PROP_STRING )
- return PyString_FromString( "STRING" );
- else if( type == PROP_TIME )
- return PyString_FromString( "TIME" );
- Py_RETURN_NONE;
-}
diff --git a/source/blender/python/api2_2x/logic.h b/source/blender/python/api2_2x/logic.h
deleted file mode 100644
index 28aa5e6e3e7..00000000000
--- a/source/blender/python/api2_2x/logic.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_LOGIC_H
-#define EXPP_LOGIC_H
-
-#include <Python.h>
-#include "DNA_property_types.h"
-
-extern PyTypeObject property_Type;
-
-#define BPy_Property_Check(v) ((v)->ob_type == &property_Type)
-
-//--------------------------Python BPy_Property structure definition.----
-typedef struct {
- PyObject_HEAD
- //reference to property data if object linked
- bProperty * property;
- //list of vars that define the property
- char *name;
- PyObject *data;
- short type;
-} BPy_Property;
-
-//------------------------------visible prototypes-----------------------
-PyObject *Property_CreatePyObject( struct bProperty *prop );
-bProperty *Property_FromPyObject( PyObject * py_obj );
-PyObject *newPropertyObject( char *name, PyObject * data, int type );
-int updatePyProperty( BPy_Property * self );
-int updateProperyData( BPy_Property * self );
-
-#endif
diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c
deleted file mode 100644
index 7802de822cb..00000000000
--- a/source/blender/python/api2_2x/matrix.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Michel Selten & Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mathutils.h"
-
-#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-
-/*-------------------------DOC STRINGS ---------------------------*/
-char Matrix_Zero_doc[] = "() - set all values in the matrix to 0";
-char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix";
-char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose";
-char Matrix_Determinant_doc[] = "() - return the determinant of the matrix";
-char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible";
-char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix";
-char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix";
-char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector";
-char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix";
-char Matrix_toEuler_doc[] = "() - convert matrix to a euler angle rotation";
-char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation";
-char Matrix_copy_doc[] = "() - return a copy of the matrix";
-/*-----------------------METHOD DEFINITIONS ----------------------*/
-struct PyMethodDef Matrix_methods[] = {
- {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, Matrix_Zero_doc},
- {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, Matrix_Identity_doc},
- {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, Matrix_Transpose_doc},
- {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, Matrix_Determinant_doc},
- {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, Matrix_Invert_doc},
- {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, Matrix_TranslationPart_doc},
- {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, Matrix_RotationPart_doc},
- {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, Matrix_scalePart_doc},
- {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, Matrix_Resize4x4_doc},
- {"toEuler", (PyCFunction) Matrix_toEuler, METH_NOARGS, Matrix_toEuler_doc},
- {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc},
- {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc},
- {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc},
- {NULL, NULL, 0, NULL}
-};
-/*-----------------------------METHODS----------------------------*/
-/*---------------------------Matrix.toQuat() ---------------------*/
-PyObject *Matrix_toQuat(MatrixObject * self)
-{
- float quat[4];
-
- /*must be 3-4 cols, 3-4 rows, square matrix*/
- if(self->colSize < 3 || self->rowSize < 3 || (self->colSize != self->rowSize)) {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.toQuat(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n");
- }
- if(self->colSize == 3){
- Mat3ToQuat((float (*)[3])*self->matrix, quat);
- }else{
- Mat4ToQuat((float (*)[4])*self->matrix, quat);
- }
-
- return newQuaternionObject(quat, Py_NEW);
-}
-/*---------------------------Matrix.toEuler() --------------------*/
-PyObject *Matrix_toEuler(MatrixObject * self)
-{
- float eul[3];
-
- int x;
-
- /*must be 3-4 cols, 3-4 rows, square matrix*/
- if(self->colSize ==3 && self->rowSize ==3) {
- Mat3ToEul((float (*)[3])*self->matrix, eul);
- }else if (self->colSize ==4 && self->rowSize ==4) {
- float tempmat3[3][3];
- Mat3CpyMat4(tempmat3, (float (*)[4])*self->matrix);
- Mat3ToEul(tempmat3, eul);
- }else
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n");
-
- /*have to convert to degrees*/
- for(x = 0; x < 3; x++) {
- eul[x] *= (float) (180 / Py_PI);
- }
- return newEulerObject(eul, Py_NEW);
-}
-/*---------------------------Matrix.resize4x4() ------------------*/
-PyObject *Matrix_Resize4x4(MatrixObject * self)
-{
- int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index;
-
- if(self->data.blend_data){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "cannot resize wrapped data - only python matrices\n");
- }
-
- self->data.py_data = PyMem_Realloc(self->data.py_data, (sizeof(float) * 16));
- if(self->data.py_data == NULL) {
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "matrix.resize4x4(): problem allocating pointer space\n\n");
- }
- self->contigPtr = self->data.py_data; /*force*/
- self->matrix = PyMem_Realloc(self->matrix, (sizeof(float *) * 4));
- if(self->matrix == NULL) {
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "matrix.resize4x4(): problem allocating pointer space\n\n");
- }
- /*set row pointers*/
- for(x = 0; x < 4; x++) {
- self->matrix[x] = self->contigPtr + (x * 4);
- }
- /*move data to new spot in array + clean*/
- for(blank_rows = (4 - self->rowSize); blank_rows > 0; blank_rows--){
- for(x = 0; x < 4; x++){
- index = (4 * (self->rowSize + (blank_rows - 1))) + x;
- if (index == 10 || index == 15){
- self->contigPtr[index] = 1.0f;
- }else{
- self->contigPtr[index] = 0.0f;
- }
- }
- }
- for(x = 1; x <= self->rowSize; x++){
- first_row_elem = (self->colSize * (self->rowSize - x));
- curr_pos = (first_row_elem + (self->colSize -1));
- new_pos = (4 * (self->rowSize - x )) + (curr_pos - first_row_elem);
- for(blank_columns = (4 - self->colSize); blank_columns > 0; blank_columns--){
- self->contigPtr[new_pos + blank_columns] = 0.0f;
- }
- for(curr_pos = curr_pos; curr_pos >= first_row_elem; curr_pos--){
- self->contigPtr[new_pos] = self->contigPtr[curr_pos];
- new_pos--;
- }
- }
- self->rowSize = 4;
- self->colSize = 4;
- return EXPP_incr_ret((PyObject*)self);
-}
-/*---------------------------Matrix.translationPart() ------------*/
-PyObject *Matrix_TranslationPart(MatrixObject * self)
-{
- float vec[4];
-
- if(self->colSize < 3 || self->rowSize < 4){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.translationPart: inappropriate matrix size\n");
- }
-
- vec[0] = self->matrix[3][0];
- vec[1] = self->matrix[3][1];
- vec[2] = self->matrix[3][2];
-
- return newVectorObject(vec, 3, Py_NEW);
-}
-/*---------------------------Matrix.rotationPart() ---------------*/
-PyObject *Matrix_RotationPart(MatrixObject * self)
-{
- 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(self->colSize < 3 || self->rowSize < 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.rotationPart: inappropriate matrix size\n");
- }
-
- mat[0] = self->matrix[0][0];
- mat[1] = self->matrix[0][1];
- mat[2] = self->matrix[0][2];
- mat[3] = self->matrix[1][0];
- mat[4] = self->matrix[1][1];
- mat[5] = self->matrix[1][2];
- mat[6] = self->matrix[2][0];
- mat[7] = self->matrix[2][1];
- mat[8] = self->matrix[2][2];
-
- return newMatrixObject(mat, 3, 3, Py_NEW);
-}
-/*---------------------------Matrix.scalePart() --------------------*/
-PyObject *Matrix_scalePart(MatrixObject * self)
-{
- float scale[3], rot[3];
- float mat[3][3], imat[3][3], tmat[3][3];
-
- /*must be 3-4 cols, 3-4 rows, square matrix*/
- if(self->colSize == 4 && self->rowSize == 4)
- Mat3CpyMat4(mat, (float (*)[4])*self->matrix);
- else if(self->colSize == 3 && self->rowSize == 3)
- Mat3CpyMat3(mat, (float (*)[3])*self->matrix);
- else
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.scalePart(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n");
-
- /* functionality copied from editobject.c apply_obmat */
- Mat3ToEul(mat, rot);
- EulToMat3(rot, tmat);
- Mat3Inv(imat, tmat);
- Mat3MulMat3(tmat, imat, mat);
-
- scale[0]= tmat[0][0];
- scale[1]= tmat[1][1];
- scale[2]= tmat[2][2];
- return newVectorObject(scale, 3, Py_NEW);
-}
-/*---------------------------Matrix.invert() ---------------------*/
-PyObject *Matrix_Invert(MatrixObject * self)
-{
-
- int x, y, z = 0;
- float det = 0.0f;
- PyObject *f = NULL;
- 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(self->rowSize != self->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.invert(ed): only square matrices are supported\n");
- }
-
- /*calculate the determinant*/
- f = Matrix_Determinant(self);
- det = (float)PyFloat_AS_DOUBLE(f); /*Increfs, so we need to decref*/
- Py_DECREF(f);
-
- if(det != 0) {
- /*calculate the classical adjoint*/
- if(self->rowSize == 2) {
- mat[0] = self->matrix[1][1];
- mat[1] = -self->matrix[0][1];
- mat[2] = -self->matrix[1][0];
- mat[3] = self->matrix[0][0];
- } else if(self->rowSize == 3) {
- Mat3Adj((float (*)[3]) mat,(float (*)[3]) *self->matrix);
- } else if(self->rowSize == 4) {
- Mat4Adj((float (*)[4]) mat, (float (*)[4]) *self->matrix);
- }
- /*divide by determinate*/
- for(x = 0; x < (self->rowSize * self->colSize); x++) {
- mat[x] /= det;
- }
- /*set values*/
- for(x = 0; x < self->rowSize; x++) {
- for(y = 0; y < self->colSize; y++) {
- self->matrix[x][y] = mat[z];
- z++;
- }
- }
- /*transpose
- Matrix_Transpose(self);*/
- } else {
- return EXPP_ReturnPyObjError(PyExc_ValueError,
- "matrix does not have an inverse");
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-
-
-/*---------------------------Matrix.determinant() ----------------*/
-PyObject *Matrix_Determinant(MatrixObject * self)
-{
- float det = 0.0f;
-
- if(self->rowSize != self->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.determinant: only square matrices are supported\n");
- }
-
- if(self->rowSize == 2) {
- det = Det2x2(self->matrix[0][0], self->matrix[0][1],
- self->matrix[1][0], self->matrix[1][1]);
- } else if(self->rowSize == 3) {
- det = Det3x3(self->matrix[0][0], self->matrix[0][1],
- self->matrix[0][2], self->matrix[1][0],
- self->matrix[1][1], self->matrix[1][2],
- self->matrix[2][0], self->matrix[2][1],
- self->matrix[2][2]);
- } else {
- det = Det4x4((float (*)[4]) *self->matrix);
- }
-
- return PyFloat_FromDouble( (double) det );
-}
-/*---------------------------Matrix.transpose() ------------------*/
-PyObject *Matrix_Transpose(MatrixObject * self)
-{
- float t = 0.0f;
-
- if(self->rowSize != self->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.transpose(d): only square matrices are supported\n");
- }
-
- if(self->rowSize == 2) {
- t = self->matrix[1][0];
- self->matrix[1][0] = self->matrix[0][1];
- self->matrix[0][1] = t;
- } else if(self->rowSize == 3) {
- Mat3Transp((float (*)[3])*self->matrix);
- } else {
- Mat4Transp((float (*)[4])*self->matrix);
- }
-
- return EXPP_incr_ret((PyObject*)self);
-}
-
-
-/*---------------------------Matrix.zero() -----------------------*/
-PyObject *Matrix_Zero(MatrixObject * self)
-{
- int row, col;
-
- for(row = 0; row < self->rowSize; row++) {
- for(col = 0; col < self->colSize; col++) {
- self->matrix[row][col] = 0.0f;
- }
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-/*---------------------------Matrix.identity(() ------------------*/
-PyObject *Matrix_Identity(MatrixObject * self)
-{
- if(self->rowSize != self->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix.identity: only square matrices are supported\n");
- }
-
- if(self->rowSize == 2) {
- self->matrix[0][0] = 1.0f;
- self->matrix[0][1] = 0.0f;
- self->matrix[1][0] = 0.0f;
- self->matrix[1][1] = 1.0f;
- } else if(self->rowSize == 3) {
- Mat3One((float (*)[3]) *self->matrix);
- } else {
- Mat4One((float (*)[4]) *self->matrix);
- }
-
- return EXPP_incr_ret((PyObject*)self);
-}
-
-/*---------------------------Matrix.inverted() ------------------*/
-PyObject *Matrix_copy(MatrixObject * self)
-{
- return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW);
-}
-
-/*----------------------------dealloc()(internal) ----------------*/
-/*free the py_object*/
-static void Matrix_dealloc(MatrixObject * self)
-{
- Py_XDECREF(self->coerced_object);
- PyMem_Free(self->matrix);
- /*only free py_data*/
- if(self->data.py_data){
- PyMem_Free(self->data.py_data);
- }
- PyObject_DEL(self);
-}
-/*----------------------------getattr()(internal) ----------------*/
-/*object.attribute access (get)*/
-static PyObject *Matrix_getattr(MatrixObject * self, char *name)
-{
- if(STREQ(name, "rowSize")) {
- return PyInt_FromLong((long) self->rowSize);
- } else if(STREQ(name, "colSize")) {
- return PyInt_FromLong((long) self->colSize);
- }
- if(STREQ(name, "wrapped")){
- if(self->wrapped == Py_WRAP)
- return EXPP_incr_ret((PyObject *)Py_True);
- else
- return EXPP_incr_ret((PyObject *)Py_False);
- }
- return Py_FindMethod(Matrix_methods, (PyObject *) self, name);
-}
-/*----------------------------setattr()(internal) ----------------*/
-/*object.attribute access (set)*/
-static int Matrix_setattr(MatrixObject * self, char *name, PyObject * v)
-{
- /* This is not supported. */
- return (-1);
-}
-/*----------------------------print object (internal)-------------*/
-/*print the object to screen*/
-static PyObject *Matrix_repr(MatrixObject * self)
-{
- int x, y;
- char buffer[48], str[1024];
-
- BLI_strncpy(str,"",1024);
- for(x = 0; x < self->rowSize; x++){
- sprintf(buffer, "[");
- strcat(str,buffer);
- for(y = 0; y < (self->colSize - 1); y++) {
- sprintf(buffer, "%.6f, ", self->matrix[x][y]);
- strcat(str,buffer);
- }
- if(x < (self->rowSize-1)){
- sprintf(buffer, "%.6f](matrix [row %d])\n", self->matrix[x][y], x);
- strcat(str,buffer);
- }else{
- sprintf(buffer, "%.6f](matrix [row %d])", self->matrix[x][y], x);
- strcat(str,buffer);
- }
- }
-
- return PyString_FromString(str);
-}
-/*------------------------tp_richcmpr*/
-/*returns -1 execption, 0 false, 1 true*/
-static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
-{
- MatrixObject *matA = NULL, *matB = NULL;
- int result = 0;
-
- if (!MatrixObject_Check(objectA) || !MatrixObject_Check(objectB)){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
- matA = (MatrixObject*)objectA;
- matB = (MatrixObject*)objectB;
-
- if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
-
- switch (comparison_type){
- case Py_EQ:
- /*contigPtr is basically a really long vector*/
- result = EXPP_VectorsAreEqual(matA->contigPtr, matB->contigPtr,
- (matA->rowSize * matA->colSize), 1);
- break;
- case Py_NE:
- result = EXPP_VectorsAreEqual(matA->contigPtr, matB->contigPtr,
- (matA->rowSize * matA->colSize), 1);
- if (result == 0){
- result = 1;
- }else{
- result = 0;
- }
- break;
- default:
- printf("The result of the comparison could not be evaluated");
- break;
- }
- if (result == 1){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
-}
-/*------------------------tp_doc*/
-static char MatrixObject_doc[] = "This is a wrapper for matrix objects.";
-/*---------------------SEQUENCE PROTOCOLS------------------------
- ----------------------------len(object)------------------------
- sequence length*/
-static int Matrix_len(MatrixObject * self)
-{
- return (self->rowSize);
-}
-/*----------------------------object[]---------------------------
- sequence accessor (get)
- the wrapped vector gives direct access to the matrix data*/
-static PyObject *Matrix_item(MatrixObject * self, int i)
-{
- if(i < 0 || i >= self->rowSize)
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "matrix[attribute]: array index out of range\n");
-
- return newVectorObject(self->matrix[i], self->colSize, Py_WRAP);
-}
-/*----------------------------object[]-------------------------
- sequence accessor (set)*/
-static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob)
-{
- int y, x, size = 0;
- float vec[4];
- PyObject *m, *f;
-
- if(i >= self->rowSize || i < 0){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[attribute] = x: bad row\n");
- }
-
- if(PySequence_Check(ob)){
- size = PySequence_Length(ob);
- if(size != self->colSize){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[attribute] = x: bad sequence size\n");
- }
- for (x = 0; x < size; x++) {
- m = PySequence_GetItem(ob, x);
- if (m == NULL) { /*Failed to read sequence*/
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "matrix[attribute] = x: unable to read sequence\n");
- }
-
- f = PyNumber_Float(m);
- if(f == NULL) { /*parsed item not a number*/
- Py_DECREF(m);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[attribute] = x: sequence argument not a number\n");
- }
-
- vec[x] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(m, f);
- }
- /*parsed well - now set in matrix*/
- for(y = 0; y < size; y++){
- self->matrix[i][y] = vec[y];
- }
- return 0;
- }else{
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[attribute] = x: expects a sequence of column size\n");
- }
-}
-/*----------------------------object[z:y]------------------------
- sequence slice (get)*/
-static PyObject *Matrix_slice(MatrixObject * self, int begin, int end)
-{
-
- PyObject *list = NULL;
- int count;
-
- CLAMP(begin, 0, self->rowSize);
- CLAMP(end, 0, self->rowSize);
- begin = MIN2(begin,end);
-
- list = PyList_New(end - begin);
- for(count = begin; count < end; count++) {
- PyList_SetItem(list, count - begin,
- newVectorObject(self->matrix[count], self->colSize, Py_WRAP));
- }
-
- return list;
-}
-/*----------------------------object[z:y]------------------------
- sequence slice (set)*/
-static int Matrix_ass_slice(MatrixObject * self, int begin, int end,
- PyObject * seq)
-{
- int i, x, y, size, sub_size = 0;
- float mat[16];
- PyObject *subseq;
- PyObject *m, *f;
-
- CLAMP(begin, 0, self->rowSize);
- CLAMP(end, 0, self->rowSize);
- begin = MIN2(begin,end);
-
- if(PySequence_Check(seq)){
- size = PySequence_Length(seq);
- if(size != (end - begin)){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[begin:end] = []: size mismatch in slice assignment\n");
- }
- /*parse sub items*/
- for (i = 0; i < size; i++) {
- /*parse each sub sequence*/
- subseq = PySequence_GetItem(seq, i);
- if (subseq == NULL) { /*Failed to read sequence*/
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "matrix[begin:end] = []: unable to read sequence\n");
- }
-
- if(PySequence_Check(subseq)){
- /*subsequence is also a sequence*/
- sub_size = PySequence_Length(subseq);
- if(sub_size != self->colSize){
- Py_DECREF(subseq);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[begin:end] = []: size mismatch in slice assignment\n");
- }
- for (y = 0; y < sub_size; y++) {
- m = PySequence_GetItem(subseq, y);
- if (m == NULL) { /*Failed to read sequence*/
- Py_DECREF(subseq);
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "matrix[begin:end] = []: unable to read sequence\n");
- }
-
- f = PyNumber_Float(m);
- if(f == NULL) { /*parsed item not a number*/
- EXPP_decr2(m, subseq);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[begin:end] = []: sequence argument not a number\n");
- }
-
- mat[(i * self->colSize) + y] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f, m);
- }
- }else{
- Py_DECREF(subseq);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[begin:end] = []: illegal argument type for built-in operation\n");
- }
- Py_DECREF(subseq);
- }
- /*parsed well - now set in matrix*/
- for(x = 0; x < (size * sub_size); x++){
- self->matrix[begin + (int)floor(x / self->colSize)][x % self->colSize] = mat[x];
- }
- return 0;
- }else{
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix[begin:end] = []: illegal argument type for built-in operation\n");
- }
-}
-/*------------------------NUMERIC PROTOCOLS----------------------
- ------------------------obj + obj------------------------------*/
-static PyObject *Matrix_add(PyObject * m1, PyObject * m2)
-{
- int x, y;
- 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};
- MatrixObject *mat1 = NULL, *mat2 = NULL;
-
- mat1 = (MatrixObject*)m1;
- mat2 = (MatrixObject*)m2;
-
- if(mat1->coerced_object || mat2->coerced_object){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix addition: arguments not valid for this operation....\n");
- }
- if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix addition: matrices must have the same dimensions for this operation\n");
- }
-
- for(x = 0; x < mat1->rowSize; x++) {
- for(y = 0; y < mat1->colSize; y++) {
- mat[((x * mat1->colSize) + y)] = mat1->matrix[x][y] + mat2->matrix[x][y];
- }
- }
-
- return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW);
-}
-/*------------------------obj - obj------------------------------
- subtraction*/
-static PyObject *Matrix_sub(PyObject * m1, PyObject * m2)
-{
- int x, y;
- 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};
- MatrixObject *mat1 = NULL, *mat2 = NULL;
-
- mat1 = (MatrixObject*)m1;
- mat2 = (MatrixObject*)m2;
-
- if(mat1->coerced_object || mat2->coerced_object){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix addition: arguments not valid for this operation....\n");
- }
- if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix addition: matrices must have the same dimensions for this operation\n");
- }
-
- for(x = 0; x < mat1->rowSize; x++) {
- for(y = 0; y < mat1->colSize; y++) {
- mat[((x * mat1->colSize) + y)] = mat1->matrix[x][y] - mat2->matrix[x][y];
- }
- }
-
- return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW);
-}
-/*------------------------obj * obj------------------------------
- mulplication*/
-static PyObject *Matrix_mul(PyObject * m1, PyObject * m2)
-{
- int x, y, z;
- float scalar;
- 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};
- double dot = 0.0f;
- MatrixObject *mat1 = NULL, *mat2 = NULL;
- PyObject *f = NULL;
- PointObject *pt = NULL;
-
- mat1 = (MatrixObject*)m1;
- mat2 = (MatrixObject*)m2;
-
- if(mat1->coerced_object){
- if (PyFloat_Check(mat1->coerced_object) ||
- PyInt_Check(mat1->coerced_object)){ /*FLOAT/INT * MATRIX*/
- f = PyNumber_Float(mat1->coerced_object);
- if(f == NULL) { /*parsed item not a number*/
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Matrix multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- for(x = 0; x < mat2->rowSize; x++) {
- for(y = 0; y < mat2->colSize; y++) {
- mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y];
- }
- }
- return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW);
- }
- }else{
- if(mat2->coerced_object){
- /* MATRIX * VECTOR operation is now being done by vector */
- /*if(VectorObject_Check(mat2->coerced_object)){
- vec = (VectorObject*)mat2->coerced_object;
- return column_vector_multiplication(mat1, vec);
- }else */
- if(PointObject_Check(mat2->coerced_object)){ /*MATRIX * POINT*/
- pt = (PointObject*)mat2->coerced_object;
- return column_point_multiplication(mat1, pt);
- }else if (PyFloat_Check(mat2->coerced_object) ||
- PyInt_Check(mat2->coerced_object)){ /*MATRIX * FLOAT/INT*/
- f = PyNumber_Float(mat2->coerced_object);
- if(f == NULL) { /*parsed item not a number*/
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Matrix multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- for(x = 0; x < mat1->rowSize; x++) {
- for(y = 0; y < mat1->colSize; y++) {
- mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y];
- }
- }
- return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW);
- }
- }else{ /*MATRIX * MATRIX*/
- if(mat1->colSize != mat2->rowSize){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Matrix multiplication: matrix A rowsize must equal matrix B colsize\n");
- }
- for(x = 0; x < mat1->rowSize; x++) {
- for(y = 0; y < mat2->colSize; y++) {
- for(z = 0; z < mat1->colSize; z++) {
- dot += (mat1->matrix[x][z] * mat2->matrix[z][y]);
- }
- mat[((x * mat1->rowSize) + y)] = (float)dot;
- dot = 0.0f;
- }
- }
- return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW);
- }
- }
-
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Matrix multiplication: arguments not acceptable for this operation\n");
-}
-static PyObject* Matrix_inv(MatrixObject *self)
-{
- return Matrix_Invert(self);
-}
-/*------------------------coerce(obj, obj)-----------------------
- coercion of unknown types to type MatrixObject for numeric protocols.
-
- Coercion() is called whenever a math operation has 2 operands that
- it doesn't understand how to evaluate. 2+Matrix for example. We want to
- evaluate some of these operations like: (vector * 2), however, for math
- to proceed, the unknown operand must be cast to a type that python math will
- understand. (e.g. in the case above case, 2 must be cast to a vector and
- then call vector.multiply(vector, scalar_cast_as_vector)*/
-static int Matrix_coerce(PyObject ** m1, PyObject ** m2)
-{
- if(VectorObject_Check(*m2) || PyFloat_Check(*m2) || PyInt_Check(*m2) ||
- PointObject_Check(*m2)) {
- PyObject *coerced = EXPP_incr_ret(*m2);
- *m2 = newMatrixObject(NULL,3,3,Py_NEW);
- ((MatrixObject*)*m2)->coerced_object = coerced;
- Py_INCREF (*m1);
- return 0;
- }
-
- return EXPP_ReturnIntError(PyExc_TypeError,
- "matrix.coerce(): unknown operand - can't coerce for numeric protocols");
-}
-/*-----------------PROTOCOL DECLARATIONS--------------------------*/
-static PySequenceMethods Matrix_SeqMethods = {
- (inquiry) Matrix_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) Matrix_item, /* sq_item */
- (intintargfunc) Matrix_slice, /* sq_slice */
- (intobjargproc) Matrix_ass_item, /* sq_ass_item */
- (intintobjargproc) Matrix_ass_slice, /* sq_ass_slice */
-};
-static PyNumberMethods Matrix_NumMethods = {
- (binaryfunc) Matrix_add, /* __add__ */
- (binaryfunc) Matrix_sub, /* __sub__ */
- (binaryfunc) Matrix_mul, /* __mul__ */
- (binaryfunc) 0, /* __div__ */
- (binaryfunc) 0, /* __mod__ */
- (binaryfunc) 0, /* __divmod__ */
- (ternaryfunc) 0, /* __pow__ */
- (unaryfunc) 0, /* __neg__ */
- (unaryfunc) 0, /* __pos__ */
- (unaryfunc) 0, /* __abs__ */
- (inquiry) 0, /* __nonzero__ */
- (unaryfunc) Matrix_inv, /* __invert__ */
- (binaryfunc) 0, /* __lshift__ */
- (binaryfunc) 0, /* __rshift__ */
- (binaryfunc) 0, /* __and__ */
- (binaryfunc) 0, /* __xor__ */
- (binaryfunc) 0, /* __or__ */
- (coercion) Matrix_coerce, /* __coerce__ */
- (unaryfunc) 0, /* __int__ */
- (unaryfunc) 0, /* __long__ */
- (unaryfunc) 0, /* __float__ */
- (unaryfunc) 0, /* __oct__ */
- (unaryfunc) 0, /* __hex__ */
-};
-/*------------------PY_OBECT DEFINITION--------------------------*/
-PyTypeObject matrix_Type = {
- PyObject_HEAD_INIT(NULL) /*tp_head*/
- 0, /*tp_internal*/
- "matrix", /*tp_name*/
- sizeof(MatrixObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)Matrix_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)Matrix_getattr, /*tp_getattr*/
- (setattrfunc) Matrix_setattr, /*tp_setattr*/
- 0, /*tp_compare*/
- (reprfunc) Matrix_repr, /*tp_repr*/
- &Matrix_NumMethods, /*tp_as_number*/
- &Matrix_SeqMethods, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT, /*tp_flags*/
- MatrixObject_doc, /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- 0, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0 /*tp_del*/
-};
-
-/*------------------------newMatrixObject (internal)-------------
-creates a new matrix object
-self->matrix self->contiguous_ptr (reference to data.xxx)
- [0]------------->[0]
- [1]
- [2]
- [1]------------->[3]
- [4]
- [5]
- ....
-self->matrix[1][1] = self->contiguous_ptr[4] = self->data.xxx_data[4]*/
-
-/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type)
-{
- MatrixObject *self;
- int x, row, col;
-
- /*matrix objects can be any 2-4row x 2-4col matrix*/
- if(rowSize < 2 || rowSize > 4 || colSize < 2 || colSize > 4){
- return EXPP_ReturnPyObjError(PyExc_RuntimeError,
- "matrix(): row and column sizes must be between 2 and 4\n");
- }
-
- self = PyObject_NEW(MatrixObject, &matrix_Type);
- self->data.blend_data = NULL;
- self->data.py_data = NULL;
- self->rowSize = rowSize;
- self->colSize = colSize;
- self->coerced_object = NULL;
-
- if(type == Py_WRAP){
- self->data.blend_data = mat;
- self->contigPtr = self->data.blend_data;
- /*create pointer array*/
- self->matrix = PyMem_Malloc(rowSize * sizeof(float *));
- if(self->matrix == NULL) { /*allocation failure*/
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "matrix(): problem allocating pointer space\n");
- }
- /*pointer array points to contigous memory*/
- for(x = 0; x < rowSize; x++) {
- self->matrix[x] = self->contigPtr + (x * colSize);
- }
- self->wrapped = Py_WRAP;
- }else if (type == Py_NEW){
- self->data.py_data = PyMem_Malloc(rowSize * colSize * sizeof(float));
- if(self->data.py_data == NULL) { /*allocation failure*/
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "matrix(): problem allocating pointer space\n");
- }
- self->contigPtr = self->data.py_data;
- /*create pointer array*/
- self->matrix = PyMem_Malloc(rowSize * sizeof(float *));
- if(self->matrix == NULL) { /*allocation failure*/
- PyMem_Free(self->data.py_data);
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "matrix(): problem allocating pointer space\n");
- }
- /*pointer array points to contigous memory*/
- for(x = 0; x < rowSize; x++) {
- self->matrix[x] = self->contigPtr + (x * colSize);
- }
- /*parse*/
- if(mat) { /*if a float array passed*/
- for(row = 0; row < rowSize; row++) {
- for(col = 0; col < colSize; col++) {
- self->matrix[row][col] = mat[(row * colSize) + col];
- }
- }
- } else if (rowSize == colSize ) { /*or if no arguments are passed return identity matrix for square matrices */
- Matrix_Identity(self);
- Py_DECREF(self);
- }
- self->wrapped = Py_NEW;
- }else{ /*bad type*/
- return NULL;
- }
- return (PyObject *) self;
-}
diff --git a/source/blender/python/api2_2x/matrix.h b/source/blender/python/api2_2x/matrix.h
deleted file mode 100644
index 8e6bfc0674e..00000000000
--- a/source/blender/python/api2_2x/matrix.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef EXPP_matrix_h
-#define EXPP_matrix_h
-
-#include <Python.h>
-
-extern PyTypeObject matrix_Type;
-
-#define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type)
-
-typedef float **ptRow;
-typedef struct _Matrix {
- PyObject_VAR_HEAD
- struct{
- float *py_data; /*python managed*/
- float *blend_data; /*blender managed*/
- }data;
- ptRow matrix; /*ptr to the contigPtr (accessor)*/
- float *contigPtr; /*1D array of data (alias)*/
- int rowSize;
- int colSize;
- int wrapped; /*is wrapped data?*/
- PyObject *coerced_object;
-} MatrixObject;
-/*coerced_object is a pointer to the object that it was
-coerced from when a dummy vector needs to be created from
-the coerce() function for numeric protocol operations*/
-
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
-
-/*prototypes*/
-PyObject *Matrix_Zero( MatrixObject * self );
-PyObject *Matrix_Identity( MatrixObject * self );
-PyObject *Matrix_Transpose( MatrixObject * self );
-PyObject *Matrix_Determinant( MatrixObject * self );
-PyObject *Matrix_Invert( MatrixObject * self );
-PyObject *Matrix_TranslationPart( MatrixObject * self );
-PyObject *Matrix_RotationPart( MatrixObject * self );
-PyObject *Matrix_scalePart( MatrixObject * self );
-PyObject *Matrix_Resize4x4( MatrixObject * self );
-PyObject *Matrix_toEuler( MatrixObject * self );
-PyObject *Matrix_toQuat( MatrixObject * self );
-PyObject *Matrix_copy( MatrixObject * self );
-PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type);
-
-#endif /* EXPP_matrix_H */
diff --git a/source/blender/python/api2_2x/meshPrimitive.c b/source/blender/python/api2_2x/meshPrimitive.c
deleted file mode 100644
index 2b76a835c9f..00000000000
--- a/source/blender/python/api2_2x/meshPrimitive.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender, partially based on NMesh.c API.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mesh.h" /*This must come first*/
-
-#include "DNA_scene_types.h"
-#include "BDR_editobject.h"
-#include "BIF_editmesh.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_library.h"
-#include "blendef.h"
-
-#include "gen_utils.h"
-
-/*
- * local helper procedure which does the dirty work of messing with the
- * edit mesh, active objects, etc.
- */
-
-static PyObject *make_mesh( int type, char *name, short tot, short seg,
- short subdiv, float dia, float height, short ext, short fill )
-{
- float cent[3] = {0,0,0};
- float imat[3][3]={{1,0,0},{0,1,0},{0,0,1}};
- Mesh *me;
- BPy_Mesh *obj;
- Object *ob;
- Base *base;
-
- /* remember active object (if any) for later, so we can re-activate */
- base = BASACT;
-
- /* make a new object, "copy" to the editMesh structure */
- ob = add_object(OB_MESH);
- me = (Mesh *)ob->data;
- G.obedit = BASACT->object;
- make_editMesh( );
-
- /* create the primitive in the edit mesh */
-
- make_prim( type, imat, /* mesh type, transform matrix */
- tot, seg, /* total vertices, segments */
- subdiv, /* subdivisions (for Icosphere only) */
- dia, -height, /* diameter-ish, height */
- ext, fill, /* extrude, fill end faces */
- cent ); /* location of center */
-
- /* copy primitive back to the real mesh */
- load_editMesh( );
- free_editMesh( G.editMesh );
- G.obedit = NULL;
-
- /* remove object link to the data, then delete the object */
- ob->data = NULL;
- me->id.us = 0;
- free_and_unlink_base(BASACT);
-
- /* if there was an active object, reactivate it */
- if( base )
- scene_select_base(G.scene, base);
-
- /* create the BPy_Mesh that wraps this mesh */
- obj = (BPy_Mesh *)PyObject_NEW( BPy_Mesh, &Mesh_Type );
-
- rename_id( &me->id, name );
- obj->mesh = me;
- obj->object = NULL;
- obj->new = 1;
- return (PyObject *) obj;
-}
-
-static PyObject *M_MeshPrim_Plane( PyObject *self_unused, PyObject *args )
-{
- float size = 2.0;
-
- if( !PyArg_ParseTuple( args, "|f", &size ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional float arg" );
-
- size *= (float)(sqrt(2.0)/2.0);
- return make_mesh( 0, "Plane", 4, 0, 0, size, -size, 0, 1 );
-}
-
-static PyObject *M_MeshPrim_Cube( PyObject *self_unused, PyObject *args )
-{
- float height = 2.0;
- float dia;
-
- if( !PyArg_ParseTuple( args, "|f", &height ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional float arg" );
-
- height /= 2.0;
- dia = height * (float)sqrt(2.0);
- return make_mesh( 1, "Cube", 4, 32, 2, dia, -height, 1, 1 );
-}
-
-static PyObject *M_MeshPrim_Circle( PyObject *self_unused, PyObject *args )
-{
- int tot = 32;
- float size = 2;
-
- if( !PyArg_ParseTuple( args, "|if", &tot, &size ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int and optional float arg" );
- if( tot < 3 || tot > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "number of vertices must be in the range [3:100]" );
-
- size /= 2.0;
- return make_mesh( 4, "Circle", tot, 0, 0, size, -size, 0, 0 );
-}
-
-static PyObject *M_MeshPrim_Cylinder( PyObject *self_unused, PyObject *args )
-{
- int tot = 32;
- float size = 2.0;
- float len = 2.0;
-
- if( !PyArg_ParseTuple( args, "|iff", &tot, &size, &len ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int and optional float arg" );
- if( tot < 3 || tot > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "number of vertices must be in the range [3:100]" );
-
- return make_mesh( 5, "Cylinder", tot, 0, 0, size/2.0, -len/2.0, 1, 1 );
-}
-
-static PyObject *M_MeshPrim_Tube( PyObject *self_unused, PyObject *args )
-{
- int tot = 32;
- float size = 2.0;
- float len = 2.0;
-
- if( !PyArg_ParseTuple( args, "|iff", &tot, &size, &len ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int and optional float arg" );
- if( tot < 3 || tot > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "number of vertices must be in the range [3:100]" );
-
- return make_mesh( 6, "Tube", tot, 0, 0, size/2.0, -len/2.0, 1, 0 );
-}
-
-static PyObject *M_MeshPrim_Cone( PyObject *self_unused, PyObject *args )
-{
- int tot = 32;
- float size = 2.0;
- float len = 2.0;
-
- if( !PyArg_ParseTuple( args, "|iff", &tot, &size, &len ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int and optional float arg" );
- if( tot < 3 || tot > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "number of vertices must be in the range [3:100]" );
-
- return make_mesh( 7, "Cone", tot, 0, 0, size/2.0, -len/2.0, 0, 1 );
-}
-
-static PyObject *M_MeshPrim_Grid( PyObject *self_unused, PyObject *args )
-{
- int xres = 32;
- int yres = 32;
- float size = 2.0;
-
- if( !PyArg_ParseTuple( args, "|iif", &xres, &yres, &size ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two ints and an optional float arg" );
- if( xres < 2 || xres > 100 || yres < 2 || yres > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "resolution must be in the range [2:100]" );
-
- size /= 2.0;
- return make_mesh( 10, "Grid", xres, yres, 0, size, -size, 0, 0 );
-}
-
-static PyObject *M_MeshPrim_UVsphere( PyObject *self_unused, PyObject *args )
-{
- int segs = 32;
- int rings = 32;
- float size = 2.0;
-
- if( !PyArg_ParseTuple( args, "|iif", &segs, &rings, &size ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected two ints and an optional float arg" );
- if( segs < 3 || segs > 100 || rings < 3 || rings > 100 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "segments and rings must be in the range [3:100]" );
-
- size /= 2.0;
- return make_mesh( 11, "UVsphere", segs, rings, 0, size, -size, 0, 0 );
-}
-
-static PyObject *M_MeshPrim_Icosphere( PyObject *self_unused, PyObject *args )
-{
- int subdiv = 2;
- float size = 2.0;
-
- if( !PyArg_ParseTuple( args, "|if", &subdiv, &size ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int and an optional float arg" );
- if( subdiv < 1 || subdiv > 5 )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "subdivisions must be in the range [1:5]" );
-
- size /= 2.0;
- return make_mesh( 12, "Icosphere", 0, 0, subdiv, size, -size, 0, 0 );
-}
-
-static PyObject *M_MeshPrim_Suzanne( PyObject *self_unused, PyObject *args )
-{
- return make_mesh( 13, "Monkey", 0, 0, 0, 0, 0, 0, 0 );
-}
-
-static struct PyMethodDef M_MeshPrim_methods[] = {
- {"Plane", (PyCFunction)M_MeshPrim_Plane, METH_VARARGS,
- "Create a plane mesh"},
- {"Cube", (PyCFunction)M_MeshPrim_Cube, METH_VARARGS,
- "Create a cube mesh"},
- {"Circle", (PyCFunction)M_MeshPrim_Circle, METH_VARARGS,
- "Create a circle mesh"},
- {"Cylinder", (PyCFunction)M_MeshPrim_Cylinder, METH_VARARGS,
- "Create a cylindrical mesh"},
- {"Tube", (PyCFunction)M_MeshPrim_Tube, METH_VARARGS,
- "Create a tube mesh"},
- {"Cone", (PyCFunction)M_MeshPrim_Cone, METH_VARARGS,
- "Create a conic mesh"},
- {"Grid", (PyCFunction)M_MeshPrim_Grid, METH_VARARGS,
- "Create a 2D grid mesh"},
- {"UVsphere", (PyCFunction)M_MeshPrim_UVsphere, METH_VARARGS,
- "Create a UV sphere mesh"},
- {"Icosphere", (PyCFunction)M_MeshPrim_Icosphere, METH_VARARGS,
- "Create a Ico sphere mesh"},
- {"Monkey", (PyCFunction)M_MeshPrim_Suzanne, METH_NOARGS,
- "Create a Suzanne mesh"},
- {NULL, NULL, 0, NULL},
-};
-
-static char M_MeshPrim_doc[] = "The Blender.Mesh.Primitives submodule";
-
-PyObject *MeshPrimitives_Init( void )
-{
- return Py_InitModule3( "Blender.Mesh.Primitives",
- M_MeshPrim_methods, M_MeshPrim_doc );
-}
-
diff --git a/source/blender/python/api2_2x/meshPrimitive.h b/source/blender/python/api2_2x/meshPrimitive.h
deleted file mode 100644
index 9abd22749ad..00000000000
--- a/source/blender/python/api2_2x/meshPrimitive.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef EXPP_MESHPRIMITIVES_H
-#define EXPP_MESHPRIMITIVES_H
-
-#include <Python.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* PROTOS */
-
-PyObject *MeshPrimitives_Init( void );
-
-#endif /* EXPP_MESHPRIMITIVES_H */
diff --git a/source/blender/python/api2_2x/modules.h b/source/blender/python/api2_2x/modules.h
deleted file mode 100644
index 8700188b2e9..00000000000
--- a/source/blender/python/api2_2x/modules.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten, Willian P. Germano, Nathan Letwory,
- * Stephen Swaney
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_modules_h
-#define EXPP_modules_h
-
-/************************************************************
-Certain bpy module files ( BPY_interface.c, Blender.c, and Object.c )
-need to know about almost every other module. This file is a
-convenient way to include almost all the necessary declarations.
-
-The #includes commented out below currently do not exist.
-Their *_Init() method declarations are hacked in down below.
-************************************************************/
-
-#include <Python.h>
-
-/*****************************************************************************/
-/* Global variables */
-/*****************************************************************************/
-
-/****************************************************************************
-Module Init functions for modules without a .h file.
-BGL is a special case. It still has data declarations in the .h file
-and cannot be #included until it is cleaned up.
-****************************************************************************/
-
-PyObject *BGL_Init( void );
-
-PyObject *Library_Init( void );
-PyObject *Noise_Init( void );
-
-
-
-#endif /* EXPP_modules_h */
diff --git a/source/blender/python/api2_2x/point.c b/source/blender/python/api2_2x/point.c
deleted file mode 100644
index 0bdedfecdd6..00000000000
--- a/source/blender/python/api2_2x/point.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-#include "Mathutils.h"
-
-#include "BLI_blenlib.h"
-#include "BKE_utildefines.h"
-#include "gen_utils.h"
-
-//-------------------------DOC STRINGS ---------------------------
-char Point_Zero_doc[] = "() - set all values in the point to 0";
-char Point_toVector_doc[] = "() - create a vector representation of this point";
-//-----------------------METHOD DEFINITIONS ----------------------
-struct PyMethodDef Point_methods[] = {
- {"zero", (PyCFunction) Point_Zero, METH_NOARGS, Point_Zero_doc},
- {"toVector", (PyCFunction) Point_toVector, METH_NOARGS, Point_toVector_doc},
- {NULL, NULL, 0, NULL}
-};
-//-----------------------------METHODS----------------------------
-//--------------------------Vector.toPoint()----------------------
-//create a new point object to represent this vector
-PyObject *Point_toVector(PointObject * self)
-{
- float vec[3];
- int x;
-
- for(x = 0; x < self->size; x++){
- vec[x] = self->coord[x];
- }
-
- return newVectorObject(vec, self->size, Py_NEW);
-}
-//----------------------------Point.zero() ----------------------
-//set the point data to 0,0,0
-PyObject *Point_Zero(PointObject * self)
-{
- int x;
- for(x = 0; x < self->size; x++) {
- self->coord[x] = 0.0f;
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------dealloc()(internal) ----------------
-//free the py_object
-static void Point_dealloc(PointObject * self)
-{
- Py_XDECREF(self->coerced_object);
- //only free py_data
- if(self->data.py_data){
- PyMem_Free(self->data.py_data);
- }
- PyObject_DEL(self);
-}
-//----------------------------getattr()(internal) ----------------
-//object.attribute access (get)
-static PyObject *Point_getattr(PointObject * self, char *name)
-{
- if(STREQ(name,"x")){
- return PyFloat_FromDouble(self->coord[0]);
- }else if(STREQ(name, "y")){
- return PyFloat_FromDouble(self->coord[1]);
- }else if(STREQ(name, "z")){
- if(self->size > 2){
- return PyFloat_FromDouble(self->coord[2]);
- }else{
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "point.z: illegal attribute access\n");
- }
- }
- if(STREQ(name, "wrapped")){
- if(self->wrapped == Py_WRAP)
- return EXPP_incr_ret((PyObject *)Py_True);
- else
- return EXPP_incr_ret((PyObject *)Py_False);
- }
- return Py_FindMethod(Point_methods, (PyObject *) self, name);
-}
-//----------------------------setattr()(internal) ----------------
-//object.attribute access (set)
-static int Point_setattr(PointObject * self, char *name, PyObject * v)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(v);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "point.attribute = x: argument not a number\n");
- }
-
- if(STREQ(name,"x")){
- self->coord[0] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "y")){
- self->coord[1] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "z")){
- if(self->size > 2){
- self->coord[2] = (float)PyFloat_AS_DOUBLE(f);
- }else{
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "point.z = x: illegal attribute access\n");
- }
- }else{
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "point.attribute = x: unknown attribute\n");
- }
-
- Py_DECREF(f);
- return 0;
-}
-//----------------------------print object (internal)-------------
-//print the object to screen
-static PyObject *Point_repr(PointObject * self)
-{
- int i;
- char buffer[48], str[1024];
-
- BLI_strncpy(str,"[",1024);
- for(i = 0; i < self->size; i++){
- if(i < (self->size - 1)){
- sprintf(buffer, "%.6f, ", self->coord[i]);
- strcat(str,buffer);
- }else{
- sprintf(buffer, "%.6f", self->coord[i]);
- strcat(str,buffer);
- }
- }
- strcat(str, "](point)");
-
- return PyString_FromString(str);
-}
-//---------------------SEQUENCE PROTOCOLS------------------------
-//----------------------------len(object)------------------------
-//sequence length
-static int Point_len(PointObject * self)
-{
- return self->size;
-}
-//----------------------------object[]---------------------------
-//sequence accessor (get)
-static PyObject *Point_item(PointObject * self, int i)
-{
- if(i < 0 || i >= self->size)
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "point[attribute]: array index out of range\n");
-
- return PyFloat_FromDouble( (double)self->coord[i] );
-
-}
-//----------------------------object[]-------------------------
-//sequence accessor (set)
-static int Point_ass_item(PointObject * self, int i, PyObject * ob)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(ob);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "point[attribute] = x: argument not a number\n");
- }
-
- if(i < 0 || i >= self->size){
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_IndexError,
- "point[attribute] = x: array assignment index out of range\n");
- }
- self->coord[i] = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- return 0;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (get)
-static PyObject *Point_slice(PointObject * self, int begin, int end)
-{
- PyObject *list = NULL;
- int count;
-
- CLAMP(begin, 0, self->size);
- CLAMP(end, 0, self->size);
- begin = MIN2(begin,end);
-
- list = PyList_New(end - begin);
- for(count = begin; count < end; count++) {
- PyList_SetItem(list, count - begin,
- PyFloat_FromDouble(self->coord[count]));
- }
-
- return list;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (set)
-static int Point_ass_slice(PointObject * self, int begin, int end,
- PyObject * seq)
-{
- int i, y, size = 0;
- float coord[3];
- PyObject *v, *f;
-
- CLAMP(begin, 0, self->size);
- CLAMP(end, 0, self->size);
- begin = MIN2(begin,end);
-
- size = PySequence_Length(seq);
- if(size != (end - begin)){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "point[begin:end] = []: size mismatch in slice assignment\n");
- }
-
- for (i = 0; i < size; i++) {
- v = PySequence_GetItem(seq, i);
- if (v == NULL) { // Failed to read sequence
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "point[begin:end] = []: unable to read sequence\n");
- }
- f = PyNumber_Float(v);
- if(f == NULL) { // parsed item not a number
- Py_DECREF(v);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "point[begin:end] = []: sequence argument not a number\n");
- }
-
- coord[i] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,v);
- }
- //parsed well - now set in point
- for(y = 0; y < size; y++){
- self->coord[begin + y] = coord[y];
- }
- return 0;
-}
-//------------------------NUMERIC PROTOCOLS----------------------
-//------------------------obj + obj------------------------------
-//addition
-static PyObject *Point_add(PyObject * v1, PyObject * v2)
-{
- int x, size;
- float coord[3];
- PointObject *coord1 = NULL, *coord2 = NULL;
- VectorObject *vec = NULL;
-
- coord1 = (PointObject*)v1;
- coord2 = (PointObject*)v2;
-
- if(!coord1->coerced_object){
- if(coord2->coerced_object){
- if(VectorObject_Check(coord2->coerced_object)){ //POINT + VECTOR
- //Point translation
- vec = (VectorObject*)coord2->coerced_object;
- size = coord1->size;
- if(vec->size == size){
- for(x = 0; x < size; x++){
- coord[x] = coord1->coord[x] + vec->vec[x];
- }
- }else{
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Point addition: arguments are the wrong size....\n");
- }
- return newPointObject(coord, size, Py_NEW);
- }
- }else{ //POINT + POINT
- size = coord1->size;
- if(coord2->size == size){
- for(x = 0; x < size; x++) {
- coord[x] = coord1->coord[x] + coord2->coord[x];
- }
- }else{
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Point addition: arguments are the wrong size....\n");
- }
- return newPointObject(coord, size, Py_NEW);
- }
- }
-
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Point addition: arguments not valid for this operation....\n");
-}
-//------------------------obj - obj------------------------------
-//subtraction
-static PyObject *Point_sub(PyObject * v1, PyObject * v2)
-{
- int x, size;
- float coord[3];
- PointObject *coord1 = NULL, *coord2 = NULL;
-
- coord1 = (PointObject*)v1;
- coord2 = (PointObject*)v2;
-
- if(coord1->coerced_object || coord2->coerced_object){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Point subtraction: arguments not valid for this operation....\n");
- }
- if(coord1->size != coord2->size){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Point subtraction: points must have the same dimensions for this operation\n");
- }
-
- size = coord1->size;
- for(x = 0; x < size; x++) {
- coord[x] = coord1->coord[x] - coord2->coord[x];
- }
-
- //Point - Point = Vector
- return newVectorObject(coord, size, Py_NEW);
-}
-//------------------------obj * obj------------------------------
-//mulplication
-static PyObject *Point_mul(PyObject * p1, PyObject * p2)
-{
- int x, size;
- float coord[3], scalar;
- PointObject *coord1 = NULL, *coord2 = NULL;
- PyObject *f = NULL;
- MatrixObject *mat = NULL;
- QuaternionObject *quat = NULL;
-
- coord1 = (PointObject*)p1;
- coord2 = (PointObject*)p2;
-
- if(coord1->coerced_object){
- if (PyFloat_Check(coord1->coerced_object) ||
- PyInt_Check(coord1->coerced_object)){ // FLOAT/INT * POINT
- f = PyNumber_Float(coord1->coerced_object);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Point multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- size = coord2->size;
- for(x = 0; x < size; x++) {
- coord[x] = coord2->coord[x] * scalar;
- }
- Py_DECREF(f);
- return newPointObject(coord, size, Py_NEW);
- }
- }else{
- if(coord2->coerced_object){
- if (PyFloat_Check(coord2->coerced_object) ||
- PyInt_Check(coord2->coerced_object)){ // POINT * FLOAT/INT
- f = PyNumber_Float(coord2->coerced_object);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Point multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- size = coord1->size;
- for(x = 0; x < size; x++) {
- coord[x] = coord1->coord[x] * scalar;
- }
- Py_DECREF(f);
- return newPointObject(coord, size, Py_NEW);
- }else if(MatrixObject_Check(coord2->coerced_object)){ //POINT * MATRIX
- mat = (MatrixObject*)coord2->coerced_object;
- return row_point_multiplication(coord1, mat);
- }else if(QuaternionObject_Check(coord2->coerced_object)){ //POINT * QUATERNION
- quat = (QuaternionObject*)coord2->coerced_object;
- if(coord1->size != 3){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Point multiplication: only 3D point rotations (with quats) currently supported\n");
- }
- return quat_rotation((PyObject*)coord1, (PyObject*)quat);
- }
- }
- }
-
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Point multiplication: arguments not acceptable for this operation\n");
-}
-//-------------------------- -obj -------------------------------
-//returns the negative of this object
-static PyObject *Point_neg(PointObject *self)
-{
- int x;
- float coord[3];
-
- for(x = 0; x < self->size; x++)
- coord[x] = -self->coord[x];
-
- return newPointObject(coord, self->size, Py_NEW);
-}
-
-//------------------------coerce(obj, obj)-----------------------
-//coercion of unknown types to type PointObject for numeric protocols
-/*Coercion() is called whenever a math operation has 2 operands that
- it doesn't understand how to evaluate. 2+Matrix for example. We want to
- evaluate some of these operations like: (vector * 2), however, for math
- to proceed, the unknown operand must be cast to a type that python math will
- understand. (e.g. in the case above case, 2 must be cast to a vector and
- then call vector.multiply(vector, scalar_cast_as_vector)*/
-static int Point_coerce(PyObject ** p1, PyObject ** p2)
-{
- if(VectorObject_Check(*p2) || PyFloat_Check(*p2) || PyInt_Check(*p2) ||
- MatrixObject_Check(*p2) || QuaternionObject_Check(*p2)) {
- PyObject *coerced = EXPP_incr_ret(*p2);
- *p2 = newPointObject(NULL,3,Py_NEW);
- ((PointObject*)*p2)->coerced_object = coerced;
- Py_INCREF (*p1);
- return 0;
- }
-
- return EXPP_ReturnIntError(PyExc_TypeError,
- "point.coerce(): unknown operand - can't coerce for numeric protocols");
-}
-//-----------------PROTOCOL DECLARATIONS--------------------------
-static PySequenceMethods Point_SeqMethods = {
- (inquiry) Point_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) Point_item, /* sq_item */
- (intintargfunc) Point_slice, /* sq_slice */
- (intobjargproc) Point_ass_item, /* sq_ass_item */
- (intintobjargproc) Point_ass_slice, /* sq_ass_slice */
-};
-static PyNumberMethods Point_NumMethods = {
- (binaryfunc) Point_add, /* __add__ */
- (binaryfunc) Point_sub, /* __sub__ */
- (binaryfunc) Point_mul, /* __mul__ */
- (binaryfunc) 0, /* __div__ */
- (binaryfunc) 0, /* __mod__ */
- (binaryfunc) 0, /* __divmod__ */
- (ternaryfunc) 0, /* __pow__ */
- (unaryfunc) Point_neg, /* __neg__ */
- (unaryfunc) 0, /* __pos__ */
- (unaryfunc) 0, /* __abs__ */
- (inquiry) 0, /* __nonzero__ */
- (unaryfunc) 0, /* __invert__ */
- (binaryfunc) 0, /* __lshift__ */
- (binaryfunc) 0, /* __rshift__ */
- (binaryfunc) 0, /* __and__ */
- (binaryfunc) 0, /* __xor__ */
- (binaryfunc) 0, /* __or__ */
- (coercion) Point_coerce, /* __coerce__ */
- (unaryfunc) 0, /* __int__ */
- (unaryfunc) 0, /* __long__ */
- (unaryfunc) 0, /* __float__ */
- (unaryfunc) 0, /* __oct__ */
- (unaryfunc) 0, /* __hex__ */
-
-};
-//------------------PY_OBECT DEFINITION--------------------------
-PyTypeObject point_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size */
- "point", /*tp_name */
- sizeof(PointObject), /*tp_basicsize */
- 0, /*tp_itemsize */
- (destructor) Point_dealloc, /*tp_dealloc */
- (printfunc) 0, /*tp_print */
- (getattrfunc) Point_getattr, /*tp_getattr */
- (setattrfunc) Point_setattr, /*tp_setattr */
- 0, /*tp_compare */
- (reprfunc) Point_repr, /*tp_repr */
- &Point_NumMethods, /*tp_as_number */
- &Point_SeqMethods, /*tp_as_sequence */
-};
-//------------------------newPointObject (internal)-------------
-//creates a new point object
-/*pass Py_WRAP - if point is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if point is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newPointObject(float *coord, int size, int type)
-{
- PointObject *self;
- int x;
-
- point_Type.ob_type = &PyType_Type;
- self = PyObject_NEW(PointObject, &point_Type);
- self->data.blend_data = NULL;
- self->data.py_data = NULL;
- if(size > 3 || size < 2)
- return NULL;
- self->size = size;
- self->coerced_object = NULL;
-
- if(type == Py_WRAP){
- self->data.blend_data = coord;
- self->coord = self->data.blend_data;
- self->wrapped = Py_WRAP;
- }else if (type == Py_NEW){
- self->data.py_data = PyMem_Malloc(size * sizeof(float));
- self->coord = self->data.py_data;
- if(!coord) { //new empty
- for(x = 0; x < size; x++){
- self->coord[x] = 0.0f;
- }
- }else{
- for(x = 0; x < size; x++){
- self->coord[x] = coord[x];
- }
- }
- self->wrapped = Py_NEW;
- }else{ //bad type
- return NULL;
- }
- return (PyObject *) self;
-}
diff --git a/source/blender/python/api2_2x/point.h b/source/blender/python/api2_2x/point.h
deleted file mode 100644
index a9c4e5e4e2c..00000000000
--- a/source/blender/python/api2_2x/point.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_point_h
-#define EXPP_point_h
-
-#include <Python.h>
-
-extern PyTypeObject point_Type;
-
-#define PointObject_Check(v) ((v)->ob_type == &point_Type)
-
-typedef struct {
- PyObject_VAR_HEAD
- struct{
- float *py_data; //python managed
- float *blend_data; //blender managed
- }data;
- float *coord; //1D array of data (alias)
- int size;
- int wrapped; //is wrapped data?
- PyObject *coerced_object;
-} PointObject;
-/*coerced_object is a pointer to the object that it was
-coerced from when a dummy vector needs to be created from
-the coerce() function for numeric protocol operations*/
-
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
-
-//prototypes
-PyObject *Point_Zero( PointObject * self );
-PyObject *Point_toVector(PointObject * self);
-PyObject *newPointObject(float *coord, int size, int type);
-
-#endif /* EXPP_point_h */
diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c
deleted file mode 100644
index 7cfc1a7cde8..00000000000
--- a/source/blender/python/api2_2x/quat.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mathutils.h"
-
-#include "BLI_arithb.h"
-#include "BKE_utildefines.h"
-#include "BLI_blenlib.h"
-#include "gen_utils.h"
-
-
-//-------------------------DOC STRINGS ---------------------------
-char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)";
-char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative";
-char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate";
-char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse";
-char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion";
-char Quaternion_ToEuler_doc[] = "() - return a euler rotation representing the quaternion";
-char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion";
-char Quaternion_copy_doc[] = "() - return a copy of the quat";
-//-----------------------METHOD DEFINITIONS ----------------------
-struct PyMethodDef Quaternion_methods[] = {
- {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, Quaternion_Identity_doc},
- {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, Quaternion_Negate_doc},
- {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc},
- {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, Quaternion_Inverse_doc},
- {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc},
- {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_NOARGS, Quaternion_ToEuler_doc},
- {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc},
- {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
- {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc},
- {NULL, NULL, 0, NULL}
-};
-//-----------------------------METHODS------------------------------
-//----------------------------Quaternion.toEuler()------------------
-//return the quat as a euler
-PyObject *Quaternion_ToEuler(QuaternionObject * self)
-{
- float eul[3];
- int x;
-
- QuatToEul(self->quat, eul);
- for(x = 0; x < 3; x++) {
- eul[x] *= (180 / (float)Py_PI);
- }
- return newEulerObject(eul, Py_NEW);
-}
-//----------------------------Quaternion.toMatrix()------------------
-//return the quat as a matrix
-PyObject *Quaternion_ToMatrix(QuaternionObject * self)
-{
- float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
- QuatToMat3(self->quat, (float (*)[3]) mat);
-
- return newMatrixObject(mat, 3, 3, Py_NEW);
-}
-//----------------------------Quaternion.normalize()----------------
-//normalize the axis of rotation of [theta,vector]
-PyObject *Quaternion_Normalize(QuaternionObject * self)
-{
- NormalQuat(self->quat);
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Quaternion.inverse()------------------
-//invert the quat
-PyObject *Quaternion_Inverse(QuaternionObject * self)
-{
- double mag = 0.0f;
- int x;
-
- for(x = 1; x < 4; x++) {
- self->quat[x] = -self->quat[x];
- }
- for(x = 0; x < 4; x++) {
- mag += (self->quat[x] * self->quat[x]);
- }
- mag = sqrt(mag);
- for(x = 0; x < 4; x++) {
- self->quat[x] /= (float)(mag * mag);
- }
-
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Quaternion.identity()-----------------
-//generate the identity quaternion
-PyObject *Quaternion_Identity(QuaternionObject * self)
-{
- self->quat[0] = 1.0;
- self->quat[1] = 0.0;
- self->quat[2] = 0.0;
- self->quat[3] = 0.0;
-
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Quaternion.negate()-------------------
-//negate the quat
-PyObject *Quaternion_Negate(QuaternionObject * self)
-{
- int x;
- for(x = 0; x < 4; x++) {
- self->quat[x] = -self->quat[x];
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Quaternion.conjugate()----------------
-//negate the vector part
-PyObject *Quaternion_Conjugate(QuaternionObject * self)
-{
- int x;
- for(x = 1; x < 4; x++) {
- self->quat[x] = -self->quat[x];
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-//----------------------------Quaternion.copy()----------------
-//return a copy of the quat
-PyObject *Quaternion_copy(QuaternionObject * self)
-{
- return newQuaternionObject(self->quat, Py_NEW);
-}
-
-//----------------------------dealloc()(internal) ------------------
-//free the py_object
-static void Quaternion_dealloc(QuaternionObject * self)
-{
- Py_XDECREF(self->coerced_object);
- //only free py_data
- if(self->data.py_data){
- PyMem_Free(self->data.py_data);
- }
- PyObject_DEL(self);
-}
-//----------------------------getattr()(internal) ------------------
-//object.attribute access (get)
-static PyObject *Quaternion_getattr(QuaternionObject * self, char *name)
-{
- int x;
- double mag = 0.0f;
- float vec[3];
-
- if(STREQ(name,"w")){
- return PyFloat_FromDouble(self->quat[0]);
- }else if(STREQ(name, "x")){
- return PyFloat_FromDouble(self->quat[1]);
- }else if(STREQ(name, "y")){
- return PyFloat_FromDouble(self->quat[2]);
- }else if(STREQ(name, "z")){
- return PyFloat_FromDouble(self->quat[3]);
- }
- if(STREQ(name, "magnitude")) {
- for(x = 0; x < 4; x++) {
- mag += self->quat[x] * self->quat[x];
- }
- mag = sqrt(mag);
- return PyFloat_FromDouble(mag);
- }
- if(STREQ(name, "angle")) {
- mag = self->quat[0];
- mag = 2 * (saacos(mag));
- mag *= (180 / Py_PI);
- return PyFloat_FromDouble(mag);
- }
- if(STREQ(name, "axis")) {
- mag = self->quat[0] * (Py_PI / 180);
- mag = 2 * (saacos(mag));
- mag = sin(mag / 2);
- for(x = 0; x < 3; x++) {
- vec[x] = (float)(self->quat[x + 1] / mag);
- }
- Normalize(vec);
- //If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations
- if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) &&
- EXPP_FloatsAreEqual(vec[1], 0.0f, 10) &&
- EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){
- vec[0] = 1.0f;
- }
- return (PyObject *) newVectorObject(vec, 3, Py_NEW);
- }
- if(STREQ(name, "wrapped")){
- if(self->wrapped == Py_WRAP)
- return EXPP_incr_ret((PyObject *)Py_True);
- else
- return EXPP_incr_ret((PyObject *)Py_False);
- }
-
- return Py_FindMethod(Quaternion_methods, (PyObject *) self, name);
-}
-//----------------------------setattr()(internal) ------------------
-//object.attribute access (set)
-static int Quaternion_setattr(QuaternionObject * self, char *name, PyObject * q)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(q);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "quaternion.attribute = x: argument not a number\n");
- }
-
- if(STREQ(name,"w")){
- self->quat[0] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "x")){
- self->quat[1] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "y")){
- self->quat[2] = (float)PyFloat_AS_DOUBLE(f);
- }else if(STREQ(name, "z")){
- self->quat[3] = (float)PyFloat_AS_DOUBLE(f);
- }else{
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "quaternion.attribute = x: unknown attribute\n");
- }
-
- Py_DECREF(f);
- return 0;
-}
-//----------------------------print object (internal)--------------
-//print the object to screen
-static PyObject *Quaternion_repr(QuaternionObject * self)
-{
- int i;
- char buffer[48], str[1024];
-
- BLI_strncpy(str,"[",1024);
- for(i = 0; i < 4; i++){
- if(i < (3)){
- sprintf(buffer, "%.6f, ", self->quat[i]);
- strcat(str,buffer);
- }else{
- sprintf(buffer, "%.6f", self->quat[i]);
- strcat(str,buffer);
- }
- }
- strcat(str, "](quaternion)");
-
- return PyString_FromString(str);
-}
-//------------------------tp_richcmpr
-//returns -1 execption, 0 false, 1 true
-static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
-{
- QuaternionObject *quatA = NULL, *quatB = NULL;
- int result = 0;
-
- if (!QuaternionObject_Check(objectA) || !QuaternionObject_Check(objectB)){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
- quatA = (QuaternionObject*)objectA;
- quatB = (QuaternionObject*)objectB;
-
- switch (comparison_type){
- case Py_EQ:
- result = EXPP_VectorsAreEqual(quatA->quat, quatB->quat, 4, 1);
- break;
- case Py_NE:
- result = EXPP_VectorsAreEqual(quatA->quat, quatB->quat, 4, 1);
- if (result == 0){
- result = 1;
- }else{
- result = 0;
- }
- break;
- default:
- printf("The result of the comparison could not be evaluated");
- break;
- }
- if (result == 1){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
-}
-//------------------------tp_doc
-static char QuaternionObject_doc[] = "This is a wrapper for quaternion objects.";
-//---------------------SEQUENCE PROTOCOLS------------------------
-//----------------------------len(object)------------------------
-//sequence length
-static int Quaternion_len(QuaternionObject * self)
-{
- return 4;
-}
-//----------------------------object[]---------------------------
-//sequence accessor (get)
-static PyObject *Quaternion_item(QuaternionObject * self, int i)
-{
- if(i < 0 || i >= 4)
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "quaternion[attribute]: array index out of range\n");
- return PyFloat_FromDouble(self->quat[i]);
-
-}
-//----------------------------object[]-------------------------
-//sequence accessor (set)
-static int Quaternion_ass_item(QuaternionObject * self, int i, PyObject * ob)
-{
- PyObject *f = NULL;
-
- f = PyNumber_Float(ob);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnIntError(PyExc_TypeError,
- "quaternion[attribute] = x: argument not a number\n");
- }
-
- if(i < 0 || i >= 4){
- Py_DECREF(f);
- return EXPP_ReturnIntError(PyExc_IndexError,
- "quaternion[attribute] = x: array assignment index out of range\n");
- }
- self->quat[i] = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- return 0;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (get)
-static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end)
-{
- PyObject *list = NULL;
- int count;
-
- CLAMP(begin, 0, 4);
- if (end<0) end= 5+end;
- CLAMP(end, 0, 4);
- begin = MIN2(begin,end);
-
- list = PyList_New(end - begin);
- for(count = begin; count < end; count++) {
- PyList_SetItem(list, count - begin,
- PyFloat_FromDouble(self->quat[count]));
- }
-
- return list;
-}
-//----------------------------object[z:y]------------------------
-//sequence slice (set)
-static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end,
- PyObject * seq)
-{
- int i, y, size = 0;
- float quat[4];
- PyObject *q, *f;
-
- CLAMP(begin, 0, 4);
- if (end<0) end= 5+end;
- CLAMP(end, 0, 4);
- begin = MIN2(begin,end);
-
- size = PySequence_Length(seq);
- if(size != (end - begin)){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "quaternion[begin:end] = []: size mismatch in slice assignment\n");
- }
-
- for (i = 0; i < size; i++) {
- q = PySequence_GetItem(seq, i);
- if (q == NULL) { // Failed to read sequence
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "quaternion[begin:end] = []: unable to read sequence\n");
- }
-
- f = PyNumber_Float(q);
- if(f == NULL) { // parsed item not a number
- Py_DECREF(q);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "quaternion[begin:end] = []: sequence argument not a number\n");
- }
-
- quat[i] = (float)PyFloat_AS_DOUBLE(f);
- EXPP_decr2(f,q);
- }
- //parsed well - now set in vector
- for(y = 0; y < size; y++){
- self->quat[begin + y] = quat[y];
- }
- return 0;
-}
-//------------------------NUMERIC PROTOCOLS----------------------
-//------------------------obj + obj------------------------------
-//addition
-static PyObject *Quaternion_add(PyObject * q1, PyObject * q2)
-{
- int x;
- float quat[4];
- QuaternionObject *quat1 = NULL, *quat2 = NULL;
-
- quat1 = (QuaternionObject*)q1;
- quat2 = (QuaternionObject*)q2;
-
- if(quat1->coerced_object || quat2->coerced_object){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Quaternion addition: arguments not valid for this operation....\n");
- }
- for(x = 0; x < 4; x++) {
- quat[x] = quat1->quat[x] + quat2->quat[x];
- }
-
- return newQuaternionObject(quat, Py_NEW);
-}
-//------------------------obj - obj------------------------------
-//subtraction
-static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2)
-{
- int x;
- float quat[4];
- QuaternionObject *quat1 = NULL, *quat2 = NULL;
-
- quat1 = (QuaternionObject*)q1;
- quat2 = (QuaternionObject*)q2;
-
- if(quat1->coerced_object || quat2->coerced_object){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Quaternion addition: arguments not valid for this operation....\n");
- }
- for(x = 0; x < 4; x++) {
- quat[x] = quat1->quat[x] - quat2->quat[x];
- }
-
- return newQuaternionObject(quat, Py_NEW);
-}
-//------------------------obj * obj------------------------------
-//mulplication
-static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2)
-{
- int x;
- float quat[4], scalar;
- double dot = 0.0f;
- QuaternionObject *quat1 = NULL, *quat2 = NULL;
- PyObject *f = NULL;
- VectorObject *vec = NULL;
- PointObject *pt = NULL;
-
- quat1 = (QuaternionObject*)q1;
- quat2 = (QuaternionObject*)q2;
-
- if(quat1->coerced_object){
- if (PyFloat_Check(quat1->coerced_object) ||
- PyInt_Check(quat1->coerced_object)){ // FLOAT/INT * QUAT
- f = PyNumber_Float(quat1->coerced_object);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Quaternion multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- for(x = 0; x < 4; x++) {
- quat[x] = quat2->quat[x] * scalar;
- }
- return newQuaternionObject(quat, Py_NEW);
- }
- }else{
- if(quat2->coerced_object){
- if (PyFloat_Check(quat2->coerced_object) ||
- PyInt_Check(quat2->coerced_object)){ // QUAT * FLOAT/INT
- f = PyNumber_Float(quat2->coerced_object);
- if(f == NULL) { // parsed item not a number
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Quaternion multiplication: arguments not acceptable for this operation\n");
- }
-
- scalar = (float)PyFloat_AS_DOUBLE(f);
- Py_DECREF(f);
- for(x = 0; x < 4; x++) {
- quat[x] = quat1->quat[x] * scalar;
- }
- return newQuaternionObject(quat, Py_NEW);
- }else if(VectorObject_Check(quat2->coerced_object)){ //QUAT * VEC
- vec = (VectorObject*)quat2->coerced_object;
- if(vec->size != 3){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Quaternion multiplication: only 3D vector rotations currently supported\n");
- }
- return quat_rotation((PyObject*)quat1, (PyObject*)vec);
- }else if(PointObject_Check(quat2->coerced_object)){ //QUAT * POINT
- pt = (PointObject*)quat2->coerced_object;
- if(pt->size != 3){
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Quaternion multiplication: only 3D point rotations currently supported\n");
- }
- return quat_rotation((PyObject*)quat1, (PyObject*)pt);
- }
- }else{ //QUAT * QUAT (dot product)
- for(x = 0; x < 4; x++) {
- dot += quat1->quat[x] * quat1->quat[x];
- }
- return PyFloat_FromDouble(dot);
- }
- }
-
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Quaternion multiplication: arguments not acceptable for this operation\n");
-}
-//------------------------coerce(obj, obj)-----------------------
-//coercion of unknown types to type QuaternionObject for numeric protocols
-/*Coercion() is called whenever a math operation has 2 operands that
- it doesn't understand how to evaluate. 2+Matrix for example. We want to
- evaluate some of these operations like: (vector * 2), however, for math
- to proceed, the unknown operand must be cast to a type that python math will
- understand. (e.g. in the case above case, 2 must be cast to a vector and
- then call vector.multiply(vector, scalar_cast_as_vector)*/
-static int Quaternion_coerce(PyObject ** q1, PyObject ** q2)
-{
- if(VectorObject_Check(*q2) || PyFloat_Check(*q2) || PyInt_Check(*q2) ||
- PointObject_Check(*q2)) {
- PyObject *coerced = EXPP_incr_ret(*q2);
- *q2 = newQuaternionObject(NULL,Py_NEW);
- ((QuaternionObject*)*q2)->coerced_object = coerced;
- Py_INCREF (*q1);
- return 0;
- }
-
- return EXPP_ReturnIntError(PyExc_TypeError,
- "quaternion.coerce(): unknown operand - can't coerce for numeric protocols");
-}
-//-----------------PROTOCOL DECLARATIONS--------------------------
-static PySequenceMethods Quaternion_SeqMethods = {
- (inquiry) Quaternion_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) Quaternion_item, /* sq_item */
- (intintargfunc) Quaternion_slice, /* sq_slice */
- (intobjargproc) Quaternion_ass_item, /* sq_ass_item */
- (intintobjargproc) Quaternion_ass_slice, /* sq_ass_slice */
-};
-static PyNumberMethods Quaternion_NumMethods = {
- (binaryfunc) Quaternion_add, /* __add__ */
- (binaryfunc) Quaternion_sub, /* __sub__ */
- (binaryfunc) Quaternion_mul, /* __mul__ */
- (binaryfunc) 0, /* __div__ */
- (binaryfunc) 0, /* __mod__ */
- (binaryfunc) 0, /* __divmod__ */
- (ternaryfunc) 0, /* __pow__ */
- (unaryfunc) 0, /* __neg__ */
- (unaryfunc) 0, /* __pos__ */
- (unaryfunc) 0, /* __abs__ */
- (inquiry) 0, /* __nonzero__ */
- (unaryfunc) 0, /* __invert__ */
- (binaryfunc) 0, /* __lshift__ */
- (binaryfunc) 0, /* __rshift__ */
- (binaryfunc) 0, /* __and__ */
- (binaryfunc) 0, /* __xor__ */
- (binaryfunc) 0, /* __or__ */
- (coercion) Quaternion_coerce, /* __coerce__ */
- (unaryfunc) 0, /* __int__ */
- (unaryfunc) 0, /* __long__ */
- (unaryfunc) 0, /* __float__ */
- (unaryfunc) 0, /* __oct__ */
- (unaryfunc) 0, /* __hex__ */
-
-};
-//------------------PY_OBECT DEFINITION--------------------------
-PyTypeObject quaternion_Type = {
-PyObject_HEAD_INIT(NULL) //tp_head
- 0, //tp_internal
- "quaternion", //tp_name
- sizeof(QuaternionObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)Quaternion_dealloc, //tp_dealloc
- 0, //tp_print
- (getattrfunc)Quaternion_getattr, //tp_getattr
- (setattrfunc) Quaternion_setattr, //tp_setattr
- 0, //tp_compare
- (reprfunc) Quaternion_repr, //tp_repr
- &Quaternion_NumMethods, //tp_as_number
- &Quaternion_SeqMethods, //tp_as_sequence
- 0, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
- Py_TPFLAGS_DEFAULT, //tp_flags
- QuaternionObject_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
- (richcmpfunc)Quaternion_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
- 0, //tp_methods
- 0, //tp_members
- 0, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
- 0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
- 0, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
-};
-//------------------------newQuaternionObject (internal)-------------
-//creates a new quaternion object
-/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newQuaternionObject(float *quat, int type)
-{
- QuaternionObject *self;
- int x;
-
- self = PyObject_NEW(QuaternionObject, &quaternion_Type);
- self->data.blend_data = NULL;
- self->data.py_data = NULL;
- self->coerced_object = NULL;
-
- if(type == Py_WRAP){
- self->data.blend_data = quat;
- self->quat = self->data.blend_data;
- self->wrapped = Py_WRAP;
- }else if (type == Py_NEW){
- self->data.py_data = PyMem_Malloc(4 * sizeof(float));
- self->quat = self->data.py_data;
- if(!quat) { //new empty
- Quaternion_Identity(self);
- Py_DECREF(self);
- }else{
- for(x = 0; x < 4; x++){
- self->quat[x] = quat[x];
- }
- }
- self->wrapped = Py_NEW;
- }else{ //bad type
- return NULL;
- }
- return (PyObject *) self;
-}
diff --git a/source/blender/python/api2_2x/quat.h b/source/blender/python/api2_2x/quat.h
deleted file mode 100644
index ac70b4e3802..00000000000
--- a/source/blender/python/api2_2x/quat.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef EXPP_quat_h
-#define EXPP_quat_h
-
-#include <Python.h>
-
-extern PyTypeObject quaternion_Type;
-
-#define QuaternionObject_Check(v) ((v)->ob_type == &quaternion_Type)
-
-typedef struct {
- PyObject_VAR_HEAD
- struct{
- float *py_data; //python managed
- float *blend_data; //blender managed
- }data;
- float *quat; //1D array of data (alias)
- int wrapped; //is wrapped data?
- PyObject *coerced_object;
-} QuaternionObject;
-/*coerced_object is a pointer to the object that it was
-coerced from when a dummy vector needs to be created from
-the coerce() function for numeric protocol operations*/
-
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
-
-//prototypes
-PyObject *Quaternion_Identity( QuaternionObject * self );
-PyObject *Quaternion_Negate( QuaternionObject * self );
-PyObject *Quaternion_Conjugate( QuaternionObject * self );
-PyObject *Quaternion_Inverse( QuaternionObject * self );
-PyObject *Quaternion_Normalize( QuaternionObject * self );
-PyObject *Quaternion_ToEuler( QuaternionObject * self );
-PyObject *Quaternion_ToMatrix( QuaternionObject * self );
-PyObject *Quaternion_copy( QuaternionObject * self );
-PyObject *newQuaternionObject( float *quat, int type );
-
-#endif /* EXPP_quat_h */
diff --git a/source/blender/python/api2_2x/rgbTuple.c b/source/blender/python/api2_2x/rgbTuple.c
deleted file mode 100644
index 688f72f8f98..00000000000
--- a/source/blender/python/api2_2x/rgbTuple.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "rgbTuple.h" /*This must come first */
-
-#include "gen_utils.h"
-
-/* This file is heavily based on the old bpython Constant object code in
- Blender */
-
-/*****************************************************************************/
-/* Python rgbTuple_Type callback function prototypes: */
-/*****************************************************************************/
-static PyObject *rgbTuple_getAttr( BPy_rgbTuple * self, char *name );
-static int rgbTuple_setAttr( BPy_rgbTuple * self, char *name, PyObject * v );
-static PyObject *rgbTuple_repr( BPy_rgbTuple * self );
-
-static int rgbTupleLength( void );
-
-static PyObject *rgbTupleSubscript( BPy_rgbTuple * self, PyObject * key );
-static int rgbTupleAssSubscript( BPy_rgbTuple * self, PyObject * who,
- PyObject * cares );
-
-static PyObject *rgbTupleItem( BPy_rgbTuple * self, int i );
-static int rgbTupleAssItem( BPy_rgbTuple * self, int i, PyObject * ob );
-static PyObject *rgbTupleSlice( BPy_rgbTuple * self, int begin, int end );
-static int rgbTupleAssSlice( BPy_rgbTuple * self, int begin, int end,
- PyObject * seq );
-
-/*****************************************************************************/
-/* Python rgbTuple_Type Mapping Methods table: */
-/*****************************************************************************/
-static PyMappingMethods rgbTupleAsMapping = {
- ( inquiry ) rgbTupleLength, /* mp_length */
- ( binaryfunc ) rgbTupleSubscript, /* mp_subscript */
- ( objobjargproc ) rgbTupleAssSubscript, /* mp_ass_subscript */
-};
-
-/*****************************************************************************/
-/* Python rgbTuple_Type Sequence Methods table: */
-/*****************************************************************************/
-static PySequenceMethods rgbTupleAsSequence = {
- ( inquiry ) rgbTupleLength, /* sq_length */
- ( binaryfunc ) 0, /* sq_concat */
- ( intargfunc ) 0, /* sq_repeat */
- ( intargfunc ) rgbTupleItem, /* sq_item */
- ( intintargfunc ) rgbTupleSlice, /* sq_slice */
- ( intobjargproc ) rgbTupleAssItem, /* sq_ass_item */
- ( intintobjargproc ) rgbTupleAssSlice, /* sq_ass_slice */
- 0,0,0
-};
-
-/*****************************************************************************/
-/* Python rgbTuple_Type structure definition: */
-/*****************************************************************************/
-PyTypeObject rgbTuple_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "rgbTuple", /* tp_name */
- sizeof( BPy_rgbTuple ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- 0, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) rgbTuple_getAttr, /* tp_getattr */
- ( setattrfunc ) rgbTuple_setAttr, /* tp_setattr */
- 0, /* tp_compare */
- ( reprfunc ) rgbTuple_repr, /* tp_repr */
- 0, /* tp_as_number */
- &rgbTupleAsSequence, /* tp_as_sequence */
- &rgbTupleAsMapping, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT,
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* struct PyGetSetDef *tp_getset; */
- 0, /* struct _typeobject *tp_base; */
- 0, /* PyObject *tp_dict; */
- 0, /* descrgetfunc tp_descr_get; */
- 0, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- 0, /* initproc tp_init; */
- 0, /* allocfunc tp_alloc; */
- 0, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- 0, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- 0, /* inquiry tp_is_gc; */
- 0, /* PyObject *tp_bases; */
- /* method resolution order */
- 0, /* PyObject *tp_mro; */
- 0, /* PyObject *tp_cache; */
- 0, /* PyObject *tp_subclasses; */
- 0, /* PyObject *tp_weaklist; */
- 0
-};
-
-/*****************************************************************************/
-/* Function: rgbTuple_New */
-/*****************************************************************************/
-PyObject *rgbTuple_New( float *rgb[3] )
-{
- BPy_rgbTuple *rgbTuple = PyObject_NEW( BPy_rgbTuple, &rgbTuple_Type );
-
- if( rgbTuple == NULL )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create rgbTuple object" );
-
- rgbTuple->rgb[0] = rgb[0];
- rgbTuple->rgb[1] = rgb[1];
- rgbTuple->rgb[2] = rgb[2];
-
- return ( PyObject * ) rgbTuple;
-}
-
-/*****************************************************************************/
-/* Functions: rgbTuple_getCol and rgbTuple_setCol */
-/* Description: These functions get/set rgb color triplet values. The */
-/* get function returns a tuple, the set one accepts three */
-/* floats (separated or in a tuple) as arguments. */
-/*****************************************************************************/
-PyObject *rgbTuple_getCol( BPy_rgbTuple * self )
-{
- return Py_BuildValue( "[fff]", *(self->rgb[0]),
- *(self->rgb[1]), *(self->rgb[2]));
-}
-
-int rgbTuple_setCol( BPy_rgbTuple * self, PyObject * args )
-{
- int ok = 0;
- int i;
- float num[3]={0,0,0};
-
- /*
- * since rgbTuple_getCol() returns a list, be sure we accept a list
- * as valid input
- */
-
- if( PyObject_Length( args ) == 3 ) {
- if ( PyList_Check ( args ) ) {
- ok = 1;
- for( i = 0; i < 3; ++i ) {
- PyObject *tmp = PyList_GET_ITEM( args, i );
- if( !PyNumber_Check ( tmp ) ) {
- ok = 0;
- break;
- }
- num[i] = (float)PyFloat_AsDouble( tmp );
- }
- } else
- ok = PyArg_ParseTuple( args, "fff", &num[0], &num[1], &num[2] );
- } else
- ok = PyArg_ParseTuple( args, "|(fff)", &num[0], &num[1], &num[2] );
-
- if( !ok )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected [f,f,f], (f,f,f) or f,f,f as arguments (or nothing)" );
-
- for( i = 0; i < 3; ++i )
- *( self->rgb[i] ) = EXPP_ClampFloat( num[i], 0.0, 1.0 );
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: rgbTuple_getAttr */
-/* Description: This is a callback function for the BPy_rgbTuple type. It is */
-/* the function that accesses BPy_rgbTuple member variables and */
-/* methods. */
-/*****************************************************************************/
-static PyObject *rgbTuple_getAttr( BPy_rgbTuple * self, char *name )
-{
- int i;
-
- if( strcmp( name, "__members__" ) == 0 )
- return Py_BuildValue( "[s,s,s]", "R", "G", "B" );
-
- else if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- i = 0;
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- i = 1;
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- i = 2;
- else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "attribute not found" ) );
-
- return PyFloat_FromDouble( (double)(*( self->rgb[i] )) );
-}
-
-/*****************************************************************************/
-/* Function: rgbTuple_setAttr */
-/* Description: This is a callback function for the BPy_rgbTuple type. It is */
-/* the function that changes BPy_rgbTuple member variables. */
-/*****************************************************************************/
-static int rgbTuple_setAttr( BPy_rgbTuple * self, char *name, PyObject * v )
-{
- float value;
-
- if( !PyArg_Parse( v, "f", &value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float argument" );
-
- value = EXPP_ClampFloat( value, 0.0, 1.0 );
-
- if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- *( self->rgb[0] ) = value;
-
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- *( self->rgb[1] ) = value;
-
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- *( self->rgb[2] ) = value;
-
- else
- return ( EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute not found" ) );
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Section: rgbTuple as Mapping */
-/* These functions provide code to access rgbTuple objects as */
-/* mappings. */
-/*****************************************************************************/
-static int rgbTupleLength( void )
-{
- return 3;
-}
-
-static PyObject *rgbTupleSubscript( BPy_rgbTuple * self, PyObject * key )
-{
- char *name = NULL;
- int i;
-
- if( PyNumber_Check( key ) )
- return rgbTupleItem( self, ( int ) PyInt_AsLong( key ) );
-
- if( !PyArg_ParseTuple( key, "s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int or string argument" );
-
- if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- i = 0;
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- i = 1;
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- i = 2;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
-
- return PyFloat_FromDouble( (double)(*( self->rgb[i] )) );
-}
-
-static int rgbTupleAssSubscript( BPy_rgbTuple * self, PyObject * key,
- PyObject * v )
-{
- char *name = NULL;
- int i;
-
- if( !PyNumber_Check( v ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "value to assign must be a number" );
-
- if( PyNumber_Check( key ) )
- return rgbTupleAssItem( self, ( int ) PyInt_AsLong( key ), v );
-
- if( !PyArg_Parse( key, "s", &name ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int or string argument" );
-
- if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
- i = 0;
- else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
- i = 1;
- else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
- i = 2;
- else
- return EXPP_ReturnIntError( PyExc_AttributeError, name );
-
- *( self->rgb[i] ) = EXPP_ClampFloat( (float)PyFloat_AsDouble( v ), 0.0, 1.0 );
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Section: rgbTuple as Sequence */
-/* These functions provide code to access rgbTuple objects as */
-/* sequences. */
-/*****************************************************************************/
-static PyObject *rgbTupleItem( BPy_rgbTuple * self, int i )
-{
- if( i < 0 || i >= 3 )
- return EXPP_ReturnPyObjError( PyExc_IndexError,
- "array index out of range" );
-
- return PyFloat_FromDouble( (long)(*( self->rgb[i] )) );
-}
-
-static PyObject *rgbTupleSlice( BPy_rgbTuple * self, int begin, int end )
-{
- PyObject *list;
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 3 )
- end = 3;
- if( begin > end )
- begin = end;
-
- list = PyList_New( end - begin );
-
- for( count = begin; count < end; count++ )
- PyList_SetItem( list, count - begin,
- PyFloat_FromDouble( *( self->rgb[count] ) ) );
-
- return list;
-}
-
-static int rgbTupleAssItem( BPy_rgbTuple * self, int i, PyObject * ob )
-{
- if( i < 0 || i >= 3 )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "array assignment index out of range" );
-
- if( !PyNumber_Check( ob ) )
- return EXPP_ReturnIntError( PyExc_IndexError,
- "color component must be a number" );
-/* XXX this check above is probably ... */
- *( self->rgb[i] ) =
- EXPP_ClampFloat( (float)PyFloat_AsDouble( ob ), 0.0, 1.0 );
-
- return 0;
-}
-
-static int rgbTupleAssSlice( BPy_rgbTuple * self, int begin, int end,
- PyObject * seq )
-{
- int count;
-
- if( begin < 0 )
- begin = 0;
- if( end > 3 )
- end = 3;
- if( begin > end )
- begin = end;
-
- if( !PySequence_Check( seq ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "illegal argument type for built-in operation" );
-
- if( PySequence_Length( seq ) != ( end - begin ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "size mismatch in slice assignment" );
-
- for( count = begin; count < end; count++ ) {
- float value;
- PyObject *ob = PySequence_GetItem( seq, count );
-
- if( !PyArg_Parse( ob, "f", &value ) ) {
- Py_DECREF( ob );
- return -1;
- }
-
- *( self->rgb[count] ) = EXPP_ClampFloat( value, 0.0, 1.0 );
-
- Py_DECREF( ob );
- }
-
- return 0;
-}
-
-/*****************************************************************************/
-/* Function: rgbTuple_repr */
-/* Description: This is a callback function for the BPy_rgbTuple type. It */
-/* builds a meaninful string to represent rgbTuple objects. */
-/*****************************************************************************/
-static PyObject *rgbTuple_repr( BPy_rgbTuple * self )
-{
- float r, g, b;
-
- r = *( self->rgb[0] );
- g = *( self->rgb[1] );
- b = *( self->rgb[2] );
-
- return PyString_FromFormat( "[%f, %f, %f]", r, g, b );
-}
diff --git a/source/blender/python/api2_2x/rgbTuple.h b/source/blender/python/api2_2x/rgbTuple.h
deleted file mode 100644
index 0da05bb025f..00000000000
--- a/source/blender/python/api2_2x/rgbTuple.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_rgbTuple_H
-#define EXPP_rgbTuple_H
-
-#include <Python.h>
-
-/* Objects of <type 'rgbTuple'> are used inside other Blender Python
- * objects, so this header file must contain only 'public' declarations */
-
-/*****************************************************************************/
-/* Python BPy_rgbTuple structure definition: */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD float *rgb[3]; /* array of three pointers to floats */
-
-} BPy_rgbTuple;
-
-/*****************************************************************************/
-/* Python API function prototypes for the rgbTuple helper module. */
-/*****************************************************************************/
-PyObject *rgbTuple_New( float *rgb[3] );
-PyObject *rgbTuple_getCol( BPy_rgbTuple * self );
-int rgbTuple_setCol( BPy_rgbTuple * self, PyObject * args );
-
-#endif /* EXPP_rgbTuple_H */
diff --git a/source/blender/python/api2_2x/sceneRadio.c b/source/blender/python/api2_2x/sceneRadio.c
deleted file mode 100644
index 6bdc45d582c..00000000000
--- a/source/blender/python/api2_2x/sceneRadio.c
+++ /dev/null
@@ -1,890 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can Redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "sceneRadio.h" /*This must come first*/
-
-#include "BKE_global.h"
-#include "BKE_object.h" /* disable_where_script() */
-#include "gen_utils.h"
-#include "constant.h"
-#include "radio.h"
-
-
-/* bitflags */
-#define EXPP_RADIO_flag_SHOWLIM 1
-#define EXPP_RADIO_flag_Z 2
-/* shorts */
-#define EXPP_RADIO_hemires_MIN 100
-#define EXPP_RADIO_hemires_MAX 1000
-#define EXPP_RADIO_maxiter_MIN 0
-#define EXPP_RADIO_maxiter_MAX 10000
-#define EXPP_RADIO_subshootp_MIN 0
-#define EXPP_RADIO_subshootp_MAX 10
-#define EXPP_RADIO_subshoote_MIN 0
-#define EXPP_RADIO_subshoote_MAX 10
-#define EXPP_RADIO_nodelim_MIN 0
-#define EXPP_RADIO_nodelim_MAX 50
-#define EXPP_RADIO_maxsublamp_MIN 1
-#define EXPP_RADIO_maxsublamp_MAX 250
-#define EXPP_RADIO_pama_MIN 10
-#define EXPP_RADIO_pama_MAX 1000
-#define EXPP_RADIO_pami_MIN 10
-#define EXPP_RADIO_pami_MAX 1000
-#define EXPP_RADIO_elma_MIN 1
-#define EXPP_RADIO_elma_MAX 500
-#define EXPP_RADIO_elmi_MIN 1
-#define EXPP_RADIO_elmi_MAX 100
-/* ints */
-#define EXPP_RADIO_maxnode_MIN 1
-#define EXPP_RADIO_maxnode_MAX 250000
-/* floats */
-#define EXPP_RADIO_convergence_MIN 0.0
-#define EXPP_RADIO_convergence_MAX 0.1f
-#define EXPP_RADIO_radfac_MIN 0.001f
-#define EXPP_RADIO_radfac_MAX 250.0
-#define EXPP_RADIO_gamma_MIN 0.2f
-#define EXPP_RADIO_gamma_MAX 10.0
-/* drawtypes */
-#define EXPP_RADIO_drawtype_WIRE 0
-#define EXPP_RADIO_drawtype_SOLID 1
-#define EXPP_RADIO_drawtype_GOURAUD 2
-
-static int EXPP_check_scene( Scene * scene )
-{
- if( scene != G.scene ) {
- PyErr_SetString( PyExc_EnvironmentError,
- "\nradiosity only works on the current scene, check scene.makeCurrent()." );
- return 0;
- } else if( !scene->radio ) {
- PyErr_SetString( PyExc_EnvironmentError,
- "\nradiosity data was deleted from scene!" );
- return 0;
- }
-
- return 1;
-}
-
-static PyObject *Radio_collectMeshes( BPy_Radio * self );
-static PyObject *Radio_go( BPy_Radio * self );
-static PyObject *Radio_freeData( BPy_Radio * self );
-static PyObject *Radio_replaceMeshes( BPy_Radio * self );
-static PyObject *Radio_addMesh( BPy_Radio * self );
-static PyObject *Radio_filterFaces( BPy_Radio * self );
-static PyObject *Radio_filterElems( BPy_Radio * self );
-static PyObject *Radio_limitSubdivide( BPy_Radio * self );
-static PyObject *Radio_subdividePatches( BPy_Radio * self );
-static PyObject *Radio_subdivideElems( BPy_Radio * self );
-static PyObject *Radio_removeDoubles( BPy_Radio * self );
-
-static PyObject *Radio_repr( BPy_Radio * self );
-
-static PyObject *EXPP_create_ret_PyInt( int value )
-{
- PyObject *pyval = PyInt_FromLong( value );
-
- if( !pyval )
- PyErr_SetString( PyExc_MemoryError,
- "couldn't create py int!" );
-
- return pyval;
-}
-
-static PyObject *EXPP_create_ret_PyFloat( float value )
-{
- PyObject *pyval = PyFloat_FromDouble( ( double ) value );
-
- if( !pyval )
- PyErr_SetString( PyExc_MemoryError,
- "couldn't create py int!" );
-
- return pyval;
-}
-
-static PyObject *Radio_get_hemires( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->hemires );
-}
-
-static PyObject *Radio_get_maxiter( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->maxiter );
-}
-
-static PyObject *Radio_get_subshootp( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->subshootp );
-}
-
-static PyObject *Radio_get_subshoote( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->subshoote );
-}
-
-static PyObject *Radio_get_nodelim( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->nodelim );
-}
-
-static PyObject *Radio_get_maxsublamp( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->maxsublamp );
-}
-
-static PyObject *Radio_get_pama( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->pama );
-}
-
-static PyObject *Radio_get_pami( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->pami );
-}
-
-static PyObject *Radio_get_elma( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->elma );
-}
-
-static PyObject *Radio_get_elmi( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->elmi );
-}
-
-static PyObject *Radio_get_drawtype( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->drawtype );
-}
-
-static PyObject *Radio_get_flag( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->flag );
-}
-
-static PyObject *Radio_get_maxnode( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyInt( ( int ) self->scene->radio->maxnode );
-}
-
-static PyObject *Radio_get_convergence( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyFloat( self->scene->radio->convergence );
-}
-
-static PyObject *Radio_get_radfac( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyFloat( self->scene->radio->radfac );
-}
-
-static PyObject *Radio_get_gamma( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_create_ret_PyFloat( self->scene->radio->gamma );
-}
-
-static PyObject *EXPP_unpack_set_int( PyObject * args, int *ptr,
- int min, int max )
-{
- int value;
-
- if( !PyArg_ParseTuple( args, "i", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- *ptr = EXPP_ClampInt( value, min, max );
-
- return EXPP_incr_ret( Py_None );
-}
-
-/* could merge with set_int, but is cleaner this way */
-static PyObject *EXPP_unpack_set_short( PyObject * args, short *ptr,
- short min, short max )
-{
- int value;
-
- if( !PyArg_ParseTuple( args, "i", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int argument" );
-
- *ptr = ( short ) EXPP_ClampInt( value, min, max );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *EXPP_unpack_set_float( PyObject * args, float *ptr,
- float min, float max )
-{
- float value;
-
- if( !PyArg_ParseTuple( args, "f", &value ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected float argument" );
-
- *ptr = EXPP_ClampFloat( value, min, max );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_set_hemires( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_short( args, &self->scene->radio->hemires,
- EXPP_RADIO_hemires_MIN,
- EXPP_RADIO_hemires_MAX );
-
- if( ret )
- rad_setlimits( );
-
- return ret;
-}
-
-static PyObject *Radio_set_maxiter( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_short( args, &self->scene->radio->maxiter,
- EXPP_RADIO_maxiter_MIN,
- EXPP_RADIO_maxiter_MAX );
-}
-
-static PyObject *Radio_set_subshootp( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_short( args, &self->scene->radio->subshootp,
- EXPP_RADIO_subshootp_MIN,
- EXPP_RADIO_subshootp_MAX );
-}
-
-static PyObject *Radio_set_subshoote( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_short( args, &self->scene->radio->subshoote,
- EXPP_RADIO_subshoote_MIN,
- EXPP_RADIO_subshoote_MAX );
-}
-
-static PyObject *Radio_set_nodelim( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_short( args, &self->scene->radio->nodelim,
- EXPP_RADIO_nodelim_MIN,
- EXPP_RADIO_nodelim_MAX );
-}
-
-static PyObject *Radio_set_maxsublamp( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_short( args, &self->scene->radio->maxsublamp,
- EXPP_RADIO_maxsublamp_MIN,
- EXPP_RADIO_maxsublamp_MAX );
-}
-
-static PyObject *Radio_set_pama( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_short( args, &self->scene->radio->pama,
- EXPP_RADIO_pama_MIN,
- EXPP_RADIO_pama_MAX );
-
- if( ret )
- rad_setlimits( );
-
- return ret;
-}
-
-static PyObject *Radio_set_pami( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_short( args, &self->scene->radio->pami,
- EXPP_RADIO_pami_MIN,
- EXPP_RADIO_pami_MAX );
-
- if( ret )
- rad_setlimits( );
-
- return ret;
-}
-
-static PyObject *Radio_set_elma( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_short( args, &self->scene->radio->elma,
- EXPP_RADIO_elma_MIN,
- EXPP_RADIO_elma_MAX );
-
- if( ret )
- rad_setlimits( );
-
- return ret;
-}
-
-static PyObject *Radio_set_elmi( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_short( args, &self->scene->radio->elmi,
- EXPP_RADIO_elmi_MIN,
- EXPP_RADIO_elmi_MAX );
-
- if( ret )
- rad_setlimits( );
-
- return ret;
-}
-
-static PyObject *Radio_set_drawtype( BPy_Radio * self, PyObject * args )
-{
- PyObject *pyob = NULL;
- char *str = NULL;
- short dt = EXPP_RADIO_drawtype_WIRE;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( !PyArg_ParseTuple( args, "O", &pyob ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int or string and another optional int as arguments" );
-
- if( PyString_Check( pyob ) ) {
- str = PyString_AsString( pyob );
- if( !str )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create py string!" );
- else if( !strcmp( str, "Wire" ) )
- dt = EXPP_RADIO_drawtype_WIRE;
- else if( !strcmp( str, "Solid" ) )
- dt = EXPP_RADIO_drawtype_SOLID;
- else if( !strcmp( str, "Gouraud" ) )
- dt = EXPP_RADIO_drawtype_GOURAUD;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown drawtype string" );
- } else if( PyInt_Check( pyob ) ) {
- dt = ( short ) EXPP_ClampInt( PyInt_AsLong( pyob ),
- EXPP_RADIO_drawtype_WIRE,
- EXPP_RADIO_drawtype_GOURAUD );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected int or string as argument" );
-
- self->scene->radio->drawtype = dt;
-
- set_radglobal( ); /* needed to update 3d view(s) */
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_set_flag( BPy_Radio * self, PyObject * args )
-{
- int i, imode = 0;
- char *mode[2] = { NULL, NULL };
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( !PyArg_ParseTuple( args, "|ss", &mode[0], &mode[1] ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string arguments (or nothing)" );
-
- for( i = 0; i < 2; i++ ) {
- if( !mode[i] )
- break;
- else if( !strcmp( mode[i], "ShowLimits" ) )
- imode |= EXPP_RADIO_flag_SHOWLIM;
- else if( !strcmp( mode[i], "Z" ) )
- imode |= EXPP_RADIO_flag_Z;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown mode string" );
- }
-
- self->scene->radio->flag = ( short ) EXPP_ClampInt( imode, 0, 3 );
-
- set_radglobal( ); /* needed to update 3d view(s) */
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_set_maxnode( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_int( args, &self->scene->radio->maxnode,
- EXPP_RADIO_maxnode_MIN,
- EXPP_RADIO_maxnode_MAX );
-}
-
-static PyObject *Radio_set_convergence( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_float( args, &self->scene->radio->convergence,
- EXPP_RADIO_convergence_MIN,
- EXPP_RADIO_convergence_MAX );
-}
-
-static PyObject *Radio_set_radfac( BPy_Radio * self, PyObject * args )
-{
- PyObject *ret;
-
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- ret = EXPP_unpack_set_float( args, &self->scene->radio->radfac,
- EXPP_RADIO_radfac_MIN,
- EXPP_RADIO_radfac_MAX );
-
- if( ret ) {
- set_radglobal( );
- if( rad_phase( ) & RAD_PHASE_FACES )
- make_face_tab( );
- else
- make_node_display( );
- }
-
- return ret;
-}
-
-static PyObject *Radio_set_gamma( BPy_Radio * self, PyObject * args )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
- return EXPP_unpack_set_float( args, &self->scene->radio->gamma,
- EXPP_RADIO_gamma_MIN,
- EXPP_RADIO_gamma_MAX );
-}
-
-static PyMethodDef BPy_Radio_methods[] = {
- {"collectMeshes", ( PyCFunction ) Radio_collectMeshes, METH_NOARGS,
- "() - Convert selected meshes to patches."},
- {"go", ( PyCFunction ) Radio_go, METH_NOARGS,
- "() - Start radiosity calculations."},
- {"freeData", ( PyCFunction ) Radio_freeData, METH_NOARGS,
- "() - Free all memory used by radiosity."},
- {"addMesh", ( PyCFunction ) Radio_addMesh, METH_NOARGS,
- "() - Add a new mesh with the radio values as vertex colors to Blender."},
- {"replaceMeshes", ( PyCFunction ) Radio_replaceMeshes, METH_NOARGS,
- "() - Replace input meshes with the one created by radiosity simulation."},
- {"limitSubdivide", ( PyCFunction ) Radio_limitSubdivide, METH_NOARGS,
- "() - Subdivide patches."},
- {"filterFaces", ( PyCFunction ) Radio_filterFaces, METH_NOARGS,
- "() - Force an extra smoothing."},
- {"filterElems", ( PyCFunction ) Radio_filterElems, METH_NOARGS,
- "() - Filter elements to remove aliasing artifacts."},
- {"subdividePatches", ( PyCFunction ) Radio_subdividePatches,
- METH_NOARGS,
- "() - Pre-subdivision: detect high-energy patches and subdivide them."},
- {"subdivideElems", ( PyCFunction ) Radio_subdivideElems, METH_NOARGS,
- "() - Pre-subdivision: detect high-energy elements and subdivide them."},
- {"removeDoubles", ( PyCFunction ) Radio_removeDoubles, METH_NOARGS,
- "() - Join elements which differ less than the defined node limit."},
- {"getHemiRes", ( PyCFunction ) Radio_get_hemires, METH_NOARGS,
- "() - Get hemicube size."},
- {"setHemiRes", ( PyCFunction ) Radio_set_hemires, METH_VARARGS,
- "(int) - Set hemicube size, the range is [100, 1000]."},
- {"getMaxIter", ( PyCFunction ) Radio_get_maxiter, METH_NOARGS,
- "() - Get maximum number of radiosity rounds."},
- {"setMaxIter", ( PyCFunction ) Radio_set_maxiter, METH_VARARGS,
- "(i) - Set maximum number of radiosity rounds in [0, 10000]."},
- {"getSubShPatch", ( PyCFunction ) Radio_get_subshootp, METH_NOARGS,
- "() - Get max number of times environment is tested to detect patches."},
- {"setSubShPatch", ( PyCFunction ) Radio_set_subshootp, METH_VARARGS,
- "(i) - Set max number of times environment is tested to detect patches.\n\
- Range is [0, 10]."},
- {"getSubShElem", ( PyCFunction ) Radio_get_subshoote, METH_NOARGS,
- "() - Get number of times environment is tested to detect elements."},
- {"setSubShElem", ( PyCFunction ) Radio_set_subshoote, METH_VARARGS,
- "(i) - Set number of times environment is tested to detect elements.\n\
- Range is [0, 10]."},
- {"getElemLimit", ( PyCFunction ) Radio_get_nodelim, METH_NOARGS,
- "() - Get the range for removing doubles."},
- {"setElemLimit", ( PyCFunction ) Radio_set_nodelim, METH_VARARGS,
- "(i) - Set the range for removing doubles in [0, 50]."},
- {"getMaxSubdivSh", ( PyCFunction ) Radio_get_maxsublamp, METH_NOARGS,
- "() - Get max number of initial shoot patches evaluated."},
- {"setMaxSubdivSh", ( PyCFunction ) Radio_set_maxsublamp, METH_VARARGS,
- "(i) - Set max number of initial shoot patches evaluated in [1, 250]."},
- {"getPatchMax", ( PyCFunction ) Radio_get_pama, METH_NOARGS,
- "() - Get max size of a patch."},
- {"setPatchMax", ( PyCFunction ) Radio_set_pama, METH_VARARGS,
- "(i) - Set max size of a patch in [10, 1000]."},
- {"getPatchMin", ( PyCFunction ) Radio_get_pami, METH_NOARGS,
- "() - Get minimum size of a patch."},
- {"setPatchMin", ( PyCFunction ) Radio_set_pami, METH_VARARGS,
- "(i) - Set minimum size of a patch in [10, 1000]."},
- {"getElemMax", ( PyCFunction ) Radio_get_elma, METH_NOARGS,
- "() - Get max size of an element."},
- {"setElemMax", ( PyCFunction ) Radio_set_elma, METH_VARARGS,
- "(i) - Set max size of an element in [1, 100]."},
- {"getElemMin", ( PyCFunction ) Radio_get_elmi, METH_NOARGS,
- "() - Get minimum size of an element."},
- {"setElemMin", ( PyCFunction ) Radio_set_elmi, METH_VARARGS,
- "(i) - Set minimum size of an element in [1, 100]."},
- {"getMaxElems", ( PyCFunction ) Radio_get_maxnode, METH_NOARGS,
- "() - Get maximum number of elements."},
- {"setMaxElems", ( PyCFunction ) Radio_set_maxnode, METH_VARARGS,
- "(i) - Set maximum nunber of elements in [1, 250000]."},
- {"getConvergence", ( PyCFunction ) Radio_get_convergence, METH_NOARGS,
- "() - Get lower threshold of unshot energy."},
- {"setConvergence", ( PyCFunction ) Radio_set_convergence, METH_VARARGS,
- "(f) - Set lower threshold of unshot energy in [0.0, 1.0]."},
- {"getMult", ( PyCFunction ) Radio_get_radfac, METH_NOARGS,
- "() - Get energy value multiplier."},
- {"setMult", ( PyCFunction ) Radio_set_radfac, METH_VARARGS,
- "(f) - Set energy value multiplier in [0.001, 250.0]."},
- {"getGamma", ( PyCFunction ) Radio_get_gamma, METH_NOARGS,
- "() - Get change in the contrast of energy values."},
- {"setGamma", ( PyCFunction ) Radio_set_gamma, METH_VARARGS,
- "(f) - Set change in the contrast of energy values in [0.2, 10.0]."},
- {"getDrawType", ( PyCFunction ) Radio_get_drawtype, METH_NOARGS,
- "() - Get the draw type: Wire, Solid or Gouraud as an int value."},
- {"setDrawType", ( PyCFunction ) Radio_set_drawtype, METH_VARARGS,
- "(i or s) - Set the draw type: wire, solid (default) or gouraud."},
- {"getMode", ( PyCFunction ) Radio_get_flag, METH_NOARGS,
- "() - Get mode as int (or'ed bitflags), see Radio.Modes dict."},
- {"setMode", ( PyCFunction ) Radio_set_flag, METH_VARARGS,
- "(|ss) - Set mode flags as strings: 'ShowLimits', 'Z'."},
- {NULL, NULL, 0, NULL}
-};
-
-static PyTypeObject Radio_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /*ob_size */
- "Blender Radiosity", /*tp_name */
- sizeof( BPy_Radio ), /*tp_basicsize */
- 0, /*tp_itemsize */
- NULL, /*tp_dealloc */
- 0, /*tp_print */
- 0, /*tp_getattr */
- 0, /*tp_setattr */
- 0, /*tp_compare */
- ( reprfunc ) Radio_repr, /*tp_repr */
- 0, /*tp_as_number */
- 0, /*tp_as_sequence */
- 0, /*tp_as_mapping */
- 0, /*tp_hash */
- 0, /*tp_call */
- 0, /*tp_str */
- 0, /*tp_getattro */
- 0, /*tp_setattro */
- 0, /*tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags */
- "Blender radiosity", /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- BPy_Radio_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0, 0, 0, 0, 0, 0, 0, 0, /* up to tp_del, so we don't get a warning */
-};
-
-static PyObject *Radio_repr( BPy_Radio * self )
-{
- if( self->radio )
- return PyString_FromFormat( "[Radiosity \"%s\"]",
- self->scene->id.name + 2 );
- else
- return PyString_FromString( "NULL" );
-}
-
-PyObject *Radio_CreatePyObject( struct Scene * scene )
-{
- BPy_Radio *py_radio;
-
- if( scene != G.scene ) {
- return EXPP_ReturnPyObjError( PyExc_EnvironmentError,
- "\nradiosity only works on the current scene, check scene.makeCurrent()." );
- }
-
- py_radio = ( BPy_Radio * ) PyObject_NEW( BPy_Radio, &Radio_Type );
-
- if( !py_radio )
- return NULL;
-
- if( !scene->radio )
- add_radio( ); /* adds to G.scene */
-
- py_radio->radio = scene->radio;
- py_radio->scene = scene;
-
- return ( ( PyObject * ) py_radio );
-}
-
-static PyObject *Radio_collectMeshes( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- disable_where_script( 1 ); /* used to avoid error popups */
- rad_collect_meshes( );
- disable_where_script( 0 );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_freeData( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- delete_radio( );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_go( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) == RAD_PHASE_PATCHES )
- rad_go( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_replaceMeshes( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) & RAD_PHASE_FACES )
- rad_replacemesh( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_addMesh( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) & RAD_PHASE_FACES )
- rad_addmesh( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_filterFaces( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) & RAD_PHASE_FACES )
- filterFaces( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_filterElems( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) & RAD_PHASE_FACES ) {
- set_radglobal( );
- filterNodes( );
- make_face_tab( );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_limitSubdivide( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) == RAD_PHASE_PATCHES )
- rad_limit_subdivide( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call this before calculating the radiosity simulation." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_subdividePatches( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) == RAD_PHASE_PATCHES )
- rad_subdivshootpatch( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call this before calculating the radiosity simulation." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_subdivideElems( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) == RAD_PHASE_PATCHES )
- rad_subdivshootelem( );
- else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyObject *Radio_removeDoubles( BPy_Radio * self )
-{
- if( !EXPP_check_scene( self->scene ) )
- return NULL;
-
- if( rad_phase( ) == RAD_PHASE_FACES ) {
- set_radglobal( );
- removeEqualNodes( self->scene->radio->nodelim );
- make_face_tab( );
- } else
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "you need to call radio.collectMeshes() and radio.go() first." );
-
- return EXPP_incr_ret( Py_None );
-}
-
-static PyMethodDef M_Radio_methods[] = { {NULL, NULL, 0, NULL} };
-
-PyObject *Radio_Init( void )
-{
- PyObject *submodule, *Modes, *DrawTypes;
-
- if( PyType_Ready( &Radio_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Scene.Radio", M_Radio_methods,
- "The Blender Radiosity submodule" );
-
- Modes = PyConstant_New( );
- DrawTypes = PyConstant_New( );
-
- if( Modes ) {
- BPy_constant *d = ( BPy_constant * ) Modes;
-
- PyConstant_Insert( d, "ShowLimits",
- PyInt_FromLong( EXPP_RADIO_flag_SHOWLIM ) );
- PyConstant_Insert( d, "Z", PyInt_FromLong( EXPP_RADIO_flag_Z ) );
-
- PyModule_AddObject( submodule, "Modes", Modes );
- }
-
- if( DrawTypes ) {
- BPy_constant *d = ( BPy_constant * ) DrawTypes;
-
- PyConstant_Insert( d, "Wire",
- PyInt_FromLong( EXPP_RADIO_drawtype_WIRE ) );
- PyConstant_Insert( d, "Solid",
- PyInt_FromLong( EXPP_RADIO_drawtype_SOLID ) );
- PyConstant_Insert( d, "Gouraud",
- PyInt_FromLong
- ( EXPP_RADIO_drawtype_GOURAUD ) );
-
- PyModule_AddObject( submodule, "DrawTypes", DrawTypes );
- }
-
- return submodule;
-}
diff --git a/source/blender/python/api2_2x/sceneRadio.h b/source/blender/python/api2_2x/sceneRadio.h
deleted file mode 100644
index 5d7c05ac3a6..00000000000
--- a/source/blender/python/api2_2x/sceneRadio.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_SCENERADIO_H
-#define EXPP_SCENERADIO_H
-
-#include <Python.h>
-#include "DNA_radio_types.h"
-#include "DNA_scene_types.h"
-
-/* BPy_Radio declaration */
-typedef struct {
- PyObject_HEAD
- struct Radio *radio;
- struct Scene *scene;
-} BPy_Radio;
-
-PyObject *Radio_Init( void );
-
-PyObject *Radio_CreatePyObject( struct Scene *scene );
-
-#endif /* EXPP_SCENERADIO_H */
diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
deleted file mode 100644
index 4e1051176fd..00000000000
--- a/source/blender/python/api2_2x/sceneRender.c
+++ /dev/null
@@ -1,3980 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can Redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Dietrich Bollmann
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-struct View3D; /* keep me up here */
-
-#include "sceneRender.h" /*This must come first*/
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_image_types.h"
-#include "DNA_node_types.h"
-
-#include "BKE_image.h"
-#include "BKE_global.h"
-#include "BKE_screen.h"
-#include "BKE_scene.h"
-#include "BKE_node.h"
-
-#include "BIF_drawscene.h"
-#include "BIF_renderwin.h"
-#include "BIF_writeimage.h"
-#include "BIF_meshtools.h"
-
-#include "BLI_blenlib.h"
-
-#include "RE_pipeline.h"
-
-#include "mydevice.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "gen_utils.h"
-#include "gen_library.h"
-
-#include "../BPY_extern.h" /* for BPY_do_all_scripts() */
-#include "Scene.h"
-#include "Group.h"
-
-/* local defines */
-#define PY_NONE 0
-#define PY_LOW 1
-#define PY_MEDIUM 2
-#define PY_HIGH 3
-#define PY_HIGHER 4
-#define PY_BEST 5
-#define PY_USEAOSETTINGS 6
-#define PY_SKYDOME 1
-#define PY_FULL 2
-
-enum rend_constants {
- EXPP_RENDER_ATTR_XPARTS = 0,
- EXPP_RENDER_ATTR_YPARTS,
- EXPP_RENDER_ATTR_ASPECTX,
- EXPP_RENDER_ATTR_ASPECTY,
- EXPP_RENDER_ATTR_CFRAME,
- EXPP_RENDER_ATTR_SFRAME,
- EXPP_RENDER_ATTR_EFRAME,
- EXPP_RENDER_ATTR_FPS,
- EXPP_RENDER_ATTR_FPS_BASE,
- EXPP_RENDER_ATTR_SIZEX,
- EXPP_RENDER_ATTR_SIZEY,
- EXPP_RENDER_ATTR_GAUSSFILTER,
- EXPP_RENDER_ATTR_MBLURFACTOR,
- EXPP_RENDER_ATTR_BAKEMARGIN,
- EXPP_RENDER_ATTR_BAKEMODE,
- EXPP_RENDER_ATTR_BAKEDIST,
- EXPP_RENDER_ATTR_BAKENORMALSPACE,
- EXPP_RENDER_ATTR_BAKEBIAS,
- EXPP_RENDER_ATTR_OCRES
-};
-
-#define EXPP_RENDER_ATTR_CFRA 2
-#define EXPP_RENDER_ATTR_ANTISHIFT 3
-#define EXPP_RENDER_ATTR_EDGEINT 4
-#define EXPP_RENDER_ATTR_EFRA 5
-#define EXPP_RENDER_ATTR_QUALITY 11
-#define EXPP_RENDER_ATTR_GAUSS 13
-#define EXPP_RENDER_ATTR_BLURFAC 14
-
-#define EXPP_RENDER_ATTR_YF_EXPOSURE 20
-#define EXPP_RENDER_ATTR_YF_GAMMA 21
-#define EXPP_RENDER_ATTR_YF_GIDEPTH 22
-#define EXPP_RENDER_ATTR_YF_GICDEPTH 23
-#define EXPP_RENDER_ATTR_YF_GIPHOTONCOUNT 24
-#define EXPP_RENDER_ATTR_YF_GIPHOTONMIXCOUNT 25
-#define EXPP_RENDER_ATTR_YF_GIPHOTONRADIUS 26
-#define EXPP_RENDER_ATTR_YF_GIPIXPERSAMPLE 27
-#define EXPP_RENDER_ATTR_YF_GIPOWER 28
-#define EXPP_RENDER_ATTR_YF_GIREFINE 29
-#define EXPP_RENDER_ATTR_YF_GISHADOWQUAL 30
-#define EXPP_RENDER_ATTR_YF_RAYBIAS 31
-#define EXPP_RENDER_ATTR_YF_PROCCOUNT 32
-#define EXPP_RENDER_ATTR_YF_RAYDEPTH 33
-#define EXPP_RENDER_ATTR_YF_GIMETHOD 34
-#define EXPP_RENDER_ATTR_YF_GIQUALITY 35
-
-
-/* Render doc strings */
-static char M_Render_doc[] = "The Blender Render module";
-
-/* deprecated callbacks */
-static PyObject *RenderData_SetRenderPath( BPy_RenderData *self,
- PyObject *args );
-static PyObject *RenderData_SetBackbufPath( BPy_RenderData *self,
- PyObject *args );
-static PyObject *RenderData_SetOversamplingLevel( BPy_RenderData * self,
- PyObject * args );
-static PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self,
- PyObject * args );
-static PyObject *RenderData_SetBorder( BPy_RenderData * self,
- PyObject * args );
-static PyObject *RenderData_SetRenderer( BPy_RenderData * self,
- PyObject * args );
-static PyObject *RenderData_SetImageType( BPy_RenderData * self,
- PyObject * args );
-static PyObject *RenderData_Render( BPy_RenderData * self );
-static PyObject *RenderData_Bake( BPy_RenderData * self );
-
-/* BPy_RenderData Internal Protocols */
-
-static PyObject *RenderData_repr( BPy_RenderData * self )
-{
- if( self->renderContext )
- return PyString_FromFormat( "[RenderData \"%s\"]",
- self->scene->id.name + 2 );
- else
- return PyString_FromString( "NULL" );
-}
-
-/***************************************************************************/
-/* local utility routines for manipulating data */
-/***************************************************************************/
-static PyObject *M_Render_BitToggleInt( PyObject * args, int setting,
- int *structure )
-{
- int flag;
-
- if( !PyArg_ParseTuple( args, "i", &flag ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" ) );
-
- if( flag < 0 || flag > 1 )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" ) );
-
- if( flag )
- *structure |= setting;
- else
- *structure &= ~setting;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-
-}
-
-static PyObject *M_Render_BitToggleShort( PyObject * args, short setting,
- short *structure )
-{
- int flag;
-
- if( !PyArg_ParseTuple( args, "i", &flag ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" ) );
-
- if( flag < 0 || flag > 1 )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError,
- "expected TRUE or FALSE (1 or 0)" ) );
-
- if( flag )
- *structure |= setting;
- else
- *structure &= ~setting;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-
-}
-
-static PyObject *M_Render_GetSetAttributeFloat( PyObject * args,
- float *structure, float min,
- float max )
-{
- float property = -10.0f;
- char error[48];
-
- if( !PyArg_ParseTuple( args, "|f", &property ) )
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, "expected float" ) );
-
- if( property != -10.0f ) {
- if( property < min || property > max ) {
- sprintf( error, "out of range - expected %f to %f",
- min, max );
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, error ) );
- }
-
- *structure = property;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- Py_RETURN_NONE;
- } else
- return PyFloat_FromDouble( *structure );
-}
-
-static PyObject *M_Render_GetSetAttributeShort( PyObject * args,
- short *structure, int min,
- int max )
-{
- short property = -10;
- char error[48];
-
- if( !PyArg_ParseTuple( args, "|h", &property ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int" ) );
-
- if( property != -10 ) {
- if( property < min || property > max ) {
- sprintf( error, "out of range - expected %d to %d",
- min, max );
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, error ) );
- }
-
- *structure = property;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- Py_RETURN_NONE;
- } else
- return PyInt_FromLong( (long int)*structure );
-}
-
-static PyObject *M_Render_GetSetAttributeInt( PyObject * args, int *structure,
- int min, int max )
-{
- int property = -10;
- char error[48];
-
- if( !PyArg_ParseTuple( args, "|i", &property ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int" ) );
-
- if( property != -10 ) {
- if( property < min || property > max ) {
- sprintf( error, "out of range - expected %d to %d",
- min, max );
- return ( EXPP_ReturnPyObjError
- ( PyExc_AttributeError, error ) );
- }
-
- *structure = property;
-
- /* compare memory locations, not values */
- if (&G.scene->r.cfra == structure) {
- /* are we changing the current frame?
- update all objects, so python scripts can export all objects
- in a scene without worrying about the view layers */
- scene_update_for_newframe(G.scene, (1<<20) - 1);
- }
-
- /*I dont think this should be here, whatif the scene is not the current scene - campbell*/
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
- } else
- return PyInt_FromLong( *structure );
-}
-
-
-static void M_Render_DoSizePreset( BPy_RenderData * self, short xsch,
- short ysch, short xasp, short yasp,
- short size, short xparts, short yparts,
- short fps, float fps_base,
- float a, float b, float c,
- float d )
-{
- self->renderContext->xsch = xsch;
- self->renderContext->ysch = ysch;
- self->renderContext->xasp = xasp;
- self->renderContext->yasp = yasp;
- self->renderContext->size = size;
- self->renderContext->frs_sec = fps;
- self->renderContext->frs_sec_base = fps_base;
- self->renderContext->xparts = xparts;
- self->renderContext->yparts = yparts;
-
- BLI_init_rctf( &self->renderContext->safety, a, b, c, d );
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- EXPP_allqueue( REDRAWVIEWCAM, 0 );
-}
-
-/** set / get boolean */
-
-static int M_Render_setBooleanShort( BPy_RenderData * self, PyObject *value, short* var )
-{
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected boolean value" );
-
- *var = (PyInt_AsLong( value )) ? 1 : 0;
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *M_Render_getBooleanShort( BPy_RenderData * self, short var )
-{
- return PyInt_FromLong( (long) var );
-}
-
-/** set / get float */
-
-static int M_Render_setFloat( BPy_RenderData *self, PyObject *value, float *var, float min, float max )
-{
- float val;
- char error[48];
-
- if( !PyFloat_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected float value" );
-
- val = (float) PyFloat_AsDouble( value );
-
- /* check range */
- if ( val < min || val > max ) {
- sprintf( error, "out of range - expected %f to %f", min, max );
- return EXPP_ReturnIntError( PyExc_TypeError,error );
- }
-
- *var = val;
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *M_Render_getFloat( BPy_RenderData *self, float var )
-{
- return PyFloat_FromDouble( (double) var );
-}
-
-/** set / get integer */
-
-static int M_Render_setInt( BPy_RenderData *self, PyObject *value, int *var, int min, int max )
-{
- int val;
- char error[48];
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer value" );
-
- val = (int) PyInt_AsLong( value );
-
- /* check range */
- if ( val < min || val > max ) {
- sprintf( error, "out of range - expected %d to %d", min, max );
- return EXPP_ReturnIntError( PyExc_TypeError,error );
- }
-
- *var = val;
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *M_Render_getInt( BPy_RenderData *self, int var )
-{
- return PyInt_FromLong( (long) var );
-}
-
-/***************************************************************************/
-/* Render Module Function Definitions */
-/***************************************************************************/
-
-static PyObject *M_Render_CloseRenderWindow( PyObject * self )
-{
- BIF_close_render_display( );
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Render_SetRenderWinPos( PyObject * self, PyObject * args )
-{
- PyObject *list = NULL;
- char *loc = NULL;
- int x;
-
- if( !PyArg_ParseTuple( args, "O!", &PyList_Type, &list ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a list" ) );
-
- G.winpos = 0;
- for( x = 0; x < PyList_Size( list ); x++ ) {
- if( !PyArg_Parse( PyList_GetItem( list, x ), "s", &loc ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "python list not parseable" );
- }
- if( strcmp( loc, "SW" ) == 0 || strcmp( loc, "sw" ) == 0 )
- G.winpos |= 1;
- else if( strcmp( loc, "S" ) == 0 || strcmp( loc, "s" ) == 0 )
- G.winpos |= 2;
- else if( strcmp( loc, "SE" ) == 0 || strcmp( loc, "se" ) == 0 )
- G.winpos |= 4;
- else if( strcmp( loc, "W" ) == 0 || strcmp( loc, "w" ) == 0 )
- G.winpos |= 8;
- else if( strcmp( loc, "C" ) == 0 || strcmp( loc, "c" ) == 0 )
- G.winpos |= 16;
- else if( strcmp( loc, "E" ) == 0 || strcmp( loc, "e" ) == 0 )
- G.winpos |= 32;
- else if( strcmp( loc, "NW" ) == 0 || strcmp( loc, "nw" ) == 0 )
- G.winpos |= 64;
- else if( strcmp( loc, "N" ) == 0 || strcmp( loc, "n" ) == 0 )
- G.winpos |= 128;
- else if( strcmp( loc, "NE" ) == 0 || strcmp( loc, "ne" ) == 0 )
- G.winpos |= 256;
- else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "list contains unknown string" );
- }
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Render_EnableDispView( PyObject * self )
-{
- G.displaymode = R_DISPLAYIMAGE;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *M_Render_EnableDispWin( PyObject * self )
-{
- G.displaymode = R_DISPLAYWIN;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-
-/***************************************************************************/
-/* BPy_RenderData Function Definitions */
-/***************************************************************************/
-
-static PyObject *RenderData_Render( BPy_RenderData * self )
-{
- Scene *oldsce;
- /* unlock to prevent a deadlock when there are pynodes: */
- PyThreadState *tstate = NULL;
-
- if (!G.background) {
- oldsce = G.scene;
- set_scene( self->scene );
- tstate = PyEval_SaveThread();
- BIF_do_render( 0 );
- set_scene( oldsce );
- }
- else { /* background mode (blender -b file.blend -P script) */
- Render *re= RE_NewRender(G.scene->id.name);
-
- int end_frame = G.scene->r.efra;
-
- if (G.scene != self->scene)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "scene to render in bg mode must be the active scene");
-
- G.scene->r.efra = G.scene->r.sfra;
-
- if (G.f & G_DOSCRIPTLINKS)
- BPY_do_all_scripts(SCRIPT_RENDER, 0);
-
- tstate = PyEval_SaveThread();
-
- RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
-
- BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
-
- G.scene->r.efra = end_frame;
- }
-
- PyEval_RestoreThread(tstate);
- Py_RETURN_NONE;
-}
-
-/***************************************************************************/
-/* BPy_Bake Function Definitions */
-/***************************************************************************/
-
-static PyObject *RenderData_Bake( BPy_RenderData * self )
-{
- char *error_msg = NULL;
- Scene *oldsce;
-
- oldsce = G.scene;
- set_scene( self->scene );
-
- objects_bake_render(0, &error_msg);
-
- set_scene( oldsce );
-
- if (error_msg)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, error_msg );
-
- Py_RETURN_NONE;
-}
-
-/*
- * This will save the rendered image to an output file path already defined.
- */
-static PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args )
-{
- char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2];
- char *name_str, filepath[FILE_MAXDIR+FILE_MAXFILE];
- RenderResult *rr = NULL;
- int zbuff;
-
- if( !PyArg_ParseTuple( args, "s|i", &name_str, &zbuff ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected a filename (string) and optional int" );
-
- if (G.background)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "saveRenderedImage does not work in background mode, use renderAnim() instead" );
-
- if( strlen(self->renderContext->pic) + strlen(name_str)
- >= sizeof(filepath) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "full filename too long" );
-
- if (zbuff !=0 ) zbuff = 1; /*required 1/0 */ /* removed! (ton) */
-
- BLI_strncpy( filepath, self->renderContext->pic, sizeof(filepath) );
- strcat(filepath, name_str);
-
- rr = RE_GetResult(RE_GetRender(G.scene->id.name));
- if(!rr) {
- return EXPP_ReturnPyObjError (PyExc_ValueError, "No image rendered");
- } else {
- if(G.ima[0]==0) {
- strcpy(dir, G.sce);
- BLI_splitdirstring(dir, str);
- strcpy(G.ima, dir);
- }
- BIF_save_rendered_image(filepath);
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_RenderAnim( BPy_RenderData * self )
-{
- Scene *oldsce;
- /* unlock to prevent a deadlock when there are pynodes: */
- PyThreadState *tstate = NULL;
-
- if (!G.background) {
- oldsce = G.scene;
- set_scene( self->scene );
- tstate = PyEval_SaveThread();
- BIF_do_render( 1 );
- set_scene( oldsce );
- }
- else { /* background mode (blender -b file.blend -P script) */
- Render *re= RE_NewRender(G.scene->id.name);
-
- if (G.scene != self->scene)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "scene to render in bg mode must be the active scene");
-
- if (G.scene->r.sfra > G.scene->r.efra)
- return EXPP_ReturnPyObjError (PyExc_RuntimeError,
- "start frame must be less or equal to end frame");
-
- if (G.f & G_DOSCRIPTLINKS)
- BPY_do_all_scripts(SCRIPT_RENDER, 1);
-
- tstate = PyEval_SaveThread();
- RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
-
- if (G.f & G_DOSCRIPTLINKS)
- BPY_do_all_scripts(SCRIPT_POSTRENDER, 1);
- }
-
- PyEval_RestoreThread(tstate);
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_Play( BPy_RenderData * self )
-{
- char file[FILE_MAXDIR + FILE_MAXFILE];
- extern char bprogname[];
- char str[FILE_MAXDIR + FILE_MAXFILE];
- int pos[2], size[2];
- char txt[64];
-
-#ifdef WITH_QUICKTIME
- if( self->renderContext->imtype == R_QUICKTIME ) {
-
- strcpy( file, self->renderContext->pic );
- BLI_convertstringcode( file, G.sce );
- BLI_make_existing_file( file );
- if( BLI_strcasecmp( file + strlen( file ) - 4, ".mov" ) ) {
- sprintf( txt, "%04d_%04d.mov",
- ( self->renderContext->sfra ),
- ( self->renderContext->efra ) );
- strcat( file, txt );
- }
- } else
-#endif
- {
-
- strcpy( file, self->renderContext->pic );
- BLI_convertstringcode( file, G.sce );
-
- BLI_make_existing_file( file );
- if( BLI_strcasecmp( file + strlen( file ) - 4, ".avi" ) ) {
- sprintf( txt, "%04d_%04d.avi",
- ( self->renderContext->sfra ),
- ( self->renderContext->efra ) );
- strcat( file, txt );
- }
- }
- if( BLI_exist( file ) ) {
- calc_renderwin_rectangle(640, 480, G.winpos, pos, size);
- sprintf( str, "%s -a -p %d %d \"%s\"", bprogname, pos[0],
- pos[1], file );
- system( str );
- } else {
- BKE_makepicstring( file, G.scene->r.pic, self->renderContext->sfra, G.scene->r.imtype);
- if( BLI_exist( file ) ) {
- calc_renderwin_rectangle(640, 480, G.winpos, pos, size);
-#ifdef WIN32
- sprintf( str, "%s -a -p %d %d \"%s\"", bprogname,
- pos[0], pos[1], file );
-#else
- sprintf( str, "\"%s\" -a -p %d %d \"%s\"", bprogname,
- pos[0], pos[1], file );
-#endif
- system( str );
- } else
- sprintf( "Can't find image: %s", file );
- }
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableBackbuf( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleShort( args, 1,
- &self->renderContext->bufflag );
-}
-
-static PyObject *RenderData_EnableExtensions( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_EXTENSION,
- &self->renderContext->scemode );
-}
-
-static PyObject *RenderData_EnableSequencer( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_DOSEQ,
- &self->renderContext->scemode );
-}
-
-static PyObject *RenderData_EnableRenderDaemon( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_BG_RENDER,
- &self->renderContext->scemode );
-}
-
-static PyObject *RenderData_EnableToonShading( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_EDGE,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EdgeIntensity( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->edgeint, 0,
- 255 );
-}
-
-static PyObject *RenderData_SetEdgeColor( BPy_RenderData * self, PyObject * args )
-{
- float red, green, blue;
-
- if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected three floats" ) );
-
- if( red < 0 || red > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (red)" ) );
- if( green < 0 || green > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (green)" ) );
- if( blue < 0 || blue > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (blue)" ) );
-
- self->renderContext->edgeR = red;
- self->renderContext->edgeG = green;
- self->renderContext->edgeB = blue;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_GetEdgeColor( BPy_RenderData * self )
-{
- char rgb[24];
-
- sprintf( rgb, "[%.3f,%.3f,%.3f]", self->renderContext->edgeR,
- self->renderContext->edgeG, self->renderContext->edgeB );
- return PyString_FromString( rgb );
-}
-
-static PyObject *RenderData_EnableOversampling( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_OSA,
- &self->renderContext->mode );
-}
-
-static int RenderData_setOSALevel( BPy_RenderData * self,
- PyObject * value )
-{
- int level;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- level = PyInt_AsLong( value );
- if( level != 5 && level != 8 && level != 11 && level != 16 )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected 5, 8, 11, or 16" );
-
- self->renderContext->osa = (short)level;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- return 0;
-}
-
-static PyObject *RenderData_EnableMotionBlur( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_MBLUR,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_MotionBlurLevel( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->blurfac,
- 0.01f, 5.0f );
-}
-
-static PyObject *RenderData_PartsX( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->xparts, 1,
- 512 );
-}
-
-static PyObject *RenderData_PartsY( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->yparts, 1,
- 64 );
-}
-
-static PyObject *RenderData_EnableSky( BPy_RenderData * self )
-{
- self->renderContext->alphamode = R_ADDSKY;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnablePremultiply( BPy_RenderData * self )
-{
- self->renderContext->alphamode = R_ALPHAPREMUL;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableKey( BPy_RenderData * self )
-{
- self->renderContext->alphamode = R_ALPHAKEY;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableShadow( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_SHADOW,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableEnvironmentMap( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_ENVMAP,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnablePanorama( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_PANORAMA,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableRayTracing( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_RAYTRACE,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableRadiosityRender( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_RADIO,
- &self->renderContext->mode );
-}
-static PyObject *RenderData_EnableFieldRendering( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_FIELDS,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableOddFieldFirst( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_ODDFIELD,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableFieldTimeDisable( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_FIELDSTILL,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_EnableGaussFilter( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_GAUSS,
- &self->renderContext->mode );
-
- /* note, this now is obsolete (ton) */
- /* we now need a call like RenderData_SetFilter() or so */
- /* choices are listed in DNA_scene_types.h (search filtertype) */
-}
-
-static PyObject *RenderData_EnableBorderRender( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_BORDER,
- &self->renderContext->mode );
-}
-
-static int RenderData_setBorder( BPy_RenderData * self, PyObject * args )
-{
- float xmin, ymin, xmax, ymax;
-
- if( PyList_Check( args ) )
- args = PySequence_Tuple( args );
- else
- Py_INCREF( args );
-
- if( !PyArg_ParseTuple( args, "ffff", &xmin, &ymin, &xmax, &ymax ) ) {
- Py_DECREF( args );
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected four floats" );
- }
-
- self->renderContext->border.xmin = EXPP_ClampFloat( xmin, 0.0, 1.0 );
- self->renderContext->border.xmax = EXPP_ClampFloat( xmax, 0.0, 1.0 );
- self->renderContext->border.ymin = EXPP_ClampFloat( ymin, 0.0, 1.0 );
- self->renderContext->border.ymax = EXPP_ClampFloat( ymax, 0.0, 1.0 );
-
- EXPP_allqueue( REDRAWVIEWCAM, 1 );
-
- Py_DECREF( args );
- return 0;
-}
-
-static PyObject *RenderData_getBorder( BPy_RenderData * self )
-{
- return Py_BuildValue( "[ffff]",
- self->renderContext->border.xmin,
- self->renderContext->border.ymin,
- self->renderContext->border.xmax,
- self->renderContext->border.ymax );
-}
-
-static PyObject *RenderData_EnableGammaCorrection( BPy_RenderData * self,
- PyObject * args )
-{
- return M_Render_BitToggleInt( args, R_GAMMA,
- &self->renderContext->mode );
-}
-
-static PyObject *RenderData_GaussFilterSize( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->gauss,
- 0.5f, 1.5f );
-}
-
-static PyObject *RenderData_AspectRatioX( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args, &self->renderContext->xasp,
- 1.0f, 200.0f );
-}
-
-static PyObject *RenderData_AspectRatioY( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args, &self->renderContext->yasp,
- 1.0f, 200.0f );
-}
-
-static PyObject *RenderData_StartFrame( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeInt( args, &self->renderContext->sfra,
- 1, MAXFRAME );
-}
-
-static PyObject *RenderData_CurrentFrame( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeInt( args, &self->renderContext->cfra,
- 1, MAXFRAME );
-}
-
-static PyObject *RenderData_EndFrame( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeInt( args, &self->renderContext->efra,
- 1, MAXFRAME );
-}
-
-static PyObject *RenderData_ImageSizeX( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args, &self->renderContext->xsch,
- 4, 10000 );
-}
-
-static PyObject *RenderData_ImageSizeY( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args, &self->renderContext->ysch,
- 4, 10000 );
-}
-
-static int RenderData_setRenderer( BPy_RenderData * self, PyObject * value )
-{
- int type;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected constant INTERNAL or YAFRAY" );
-
- type = PyInt_AsLong( value );
- if( type == R_INTERN )
- self->renderContext->renderer = R_INTERN;
- else if( type == R_YAFRAY )
- self->renderContext->renderer = R_YAFRAY;
- else
- return EXPP_ReturnIntError( PyExc_ValueError,
- "expected constant INTERNAL or YAFRAY" );
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *RenderData_EnableCropping( void )
-{
-/* return M_Render_BitToggleInt( args, R_MOVIECROP,
- &self->renderContext->mode );
-*/
- printf("obsolete: movie cropping option is now default\n");
- Py_RETURN_NONE;
-}
-
-
-static int RenderData_setImageType( BPy_RenderData *self, PyObject *value )
-{
- int type;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int constant" );
-
- type = PyInt_AS_LONG( value );
-
- /*
- * this same logic and more is in buttons_scene.c imagetype_pup code but
- * only in generating strings for the popup menu, no way to reuse that :(
- */
-
- switch( type ) {
- case R_AVIRAW :
- case R_AVIJPEG :
- case R_TARGA :
- case R_RAWTGA :
- case R_RADHDR :
- case R_PNG :
- case R_BMP :
- case R_JPEG90 :
- case R_HAMX :
- case R_IRIS :
- case R_IRIZ :
- case R_TIFF :
- case R_CINEON :
- case R_DPX :
-#ifdef _WIN32
- case R_AVICODEC :
-#endif
-#ifdef WITH_OPENEXR
- case R_OPENEXR :
- case R_MULTILAYER :
-#endif
-#ifdef WITH_FFMPEG
- case R_FFMPEG :
-#endif
- self->renderContext->imtype = type;
- break;
- case R_QUICKTIME :
- if( G.have_quicktime ) {
- self->renderContext->imtype = R_QUICKTIME;
- break;
- }
- default:
- return EXPP_ReturnIntError( PyExc_ValueError,
- "unknown constant - see modules dict for help" );
- }
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *RenderData_Quality( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->quality,
- 10, 100 );
-}
-
-static PyObject *RenderData_FramesPerSec( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->frs_sec, 1,
- 120 );
-}
-
-static PyObject *RenderData_EnableGrayscale( BPy_RenderData * self )
-{
- self->renderContext->planes = R_PLANESBW;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableRGBColor( BPy_RenderData * self )
-{
- self->renderContext->planes = R_PLANES24;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableRGBAColor( BPy_RenderData * self )
-{
- self->renderContext->planes = R_PLANES32;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_SizePreset( BPy_RenderData * self, PyObject * args )
-{
- int type;
-
- if( !PyArg_ParseTuple( args, "i", &type ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected constant" ) );
-
- if( type == B_PR_PAL ) {
- M_Render_DoSizePreset( self, 720, 576, 54, 51, 100,
- self->renderContext->xparts,
- self->renderContext->yparts, 25, 1.0f,
- 0.1f,
- 0.9f, 0.1f, 0.9f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_NTSC ) {
- M_Render_DoSizePreset( self, 720, 480, 10, 11, 100, 1, 1,
- 30, 1.001f,
- 0.1f, 0.9f, 0.1f, 0.9f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_PRESET ) {
- M_Render_DoSizePreset( self, 720, 576, 54, 51, 100, 1, 1,
- self->renderContext->frs_sec,
- self->renderContext->frs_sec_base,
- 0.1f, 0.9f,
- 0.1f, 0.9f );
- self->renderContext->mode = R_OSA + R_SHADOW + R_FIELDS;
- self->renderContext->imtype = R_TARGA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_PRV ) {
- M_Render_DoSizePreset( self, 640, 512, 1, 1, 50, 1, 1,
- self->renderContext->frs_sec,
- self->renderContext->frs_sec_base,
- 0.1f, 0.9f,
- 0.1f, 0.9f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_PC ) {
- M_Render_DoSizePreset( self, 640, 480, 100, 100, 100, 1, 1,
- self->renderContext->frs_sec,
- self->renderContext->frs_sec_base,
- 0.0f, 1.0f,
- 0.0f, 1.0f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.0f, 1.0f, 0.0f,
- 1.0f );
- } else if( type == B_PR_PAL169 ) {
- M_Render_DoSizePreset( self, 720, 576, 64, 45, 100, 1, 1,
- 25, 1.0f, 0.1f, 0.9f, 0.1f, 0.9f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_PANO ) {
- M_Render_DoSizePreset( self, 36, 176, 115, 100, 100, 16, 1,
- self->renderContext->frs_sec,
- self->renderContext->frs_sec_base,
- 0.1f, 0.9f,
- 0.1f, 0.9f );
- self->renderContext->mode |= R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else if( type == B_PR_FULL ) {
- M_Render_DoSizePreset( self, 1280, 1024, 1, 1, 100, 1, 1,
- self->renderContext->frs_sec,
- self->renderContext->frs_sec_base,
- 0.1f, 0.9f,
- 0.1f, 0.9f );
- self->renderContext->mode &= ~R_PANORAMA;
- BLI_init_rctf( &self->renderContext->safety, 0.1f, 0.9f, 0.1f,
- 0.9f );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown constant - see modules dict for help" ) );
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- Py_RETURN_NONE;
-}
-
-/*
-
-PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
- PyObject * args )
-{
- int type;
-
- if( !PyArg_ParseTuple( args, "i", &type ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected constant" ) );
-
- if( type == PY_NONE || type == PY_LOW ||
- type == PY_MEDIUM || type == PY_HIGH ||
- type == PY_HIGHER || type == PY_BEST ) {
- self->renderContext->GIquality = (short)type;
- } else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown constant - see modules dict for help" ) );
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- Py_RETURN_NONE;
-}
-
-PyObject *RenderData_SetYafrayGIMethod( BPy_RenderData * self,
- PyObject * args )
-{
- int type;
-
- if( !PyArg_ParseTuple( args, "i", &type ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected constant" ) );
-
- if( type == PY_NONE || type == PY_SKYDOME || type == PY_FULL ) {
- self->renderContext->GImethod = (short)type;
- } else
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown constant - see modules dict for help" ) );
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- Py_RETURN_NONE;
-}
-*/
-
-/* (die) beg */
-
-/* YafRay - Yafray GI Method */
-
-static int RenderData_setYafrayGIQuality( BPy_RenderData * self, PyObject * value )
-{
- long type;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected constant" );
-
- type = PyInt_AsLong( value );
-
- if( type == PY_NONE || type == PY_LOW ||
- type == PY_MEDIUM || type == PY_HIGH ||
- type == PY_HIGHER || type == PY_BEST ||
- type == PY_USEAOSETTINGS
- ) {
- self->renderContext->GIquality = (short)type;
- } else {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected constant NONE, LOW, MEDIUM, HIGHER or BEST" );
- }
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *RenderData_getYafrayGIQuality( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->GIquality );
-}
-
-static PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void*) self, args,
- (setter) RenderData_setYafrayGIQuality );
-}
-
-static PyObject *RenderData_GetYafrayGIQuality( BPy_RenderData * self )
-{
- return RenderData_getYafrayGIQuality(self);
-}
-
-/* YafRay - Yafray GI Method */
-
-static int RenderData_setYafrayGIMethod( BPy_RenderData * self, PyObject * value )
-{
- int type;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected constant NONE, SKYDOME or FULL" );
-
- type = PyInt_AsLong( value );
- if( type == PY_NONE || type == PY_SKYDOME || type == PY_FULL ) {
- self->renderContext->GImethod = (short)type;
- } else {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected constant NONE, SKYDOME or FULL" );
- }
-
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-static PyObject *RenderData_getYafrayGIMethod( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long)self->renderContext->GImethod );
-}
-
-static PyObject *RenderData_GetYafrayGIMethod( BPy_RenderData * self )
-{
- return RenderData_getYafrayGIMethod(self);
-}
-
-static PyObject *RenderData_SetYafrayGIMethod( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setYafrayGIMethod );
-}
-
-
-/* YafRay - Export to XML */
-
-static int RenderData_setYafrayExportToXML( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->YFexportxml );
-}
-
-static PyObject *RenderData_getYafrayExportToXML( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->YFexportxml );
-}
-
-/** Auto AA */
-
-static int RenderData_setYafrayAutoAntiAliasing( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->YF_AA );
-}
-
-static PyObject *RenderData_getYafrayAutoAntiAliasing( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->YF_AA );
-}
-
-/** Clamp RGB */
-
-static int RenderData_setYafrayClampRGB( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->YF_clamprgb );
-}
-
-static PyObject *RenderData_getYafrayClampRGB( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->YF_clamprgb );
-}
-
-/** YafRay - Anti-Aliasing Passes */
-
-static int RenderData_setYafrayAntiAliasingPasses( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setInt( self, value, &self->renderContext->YF_AApasses, 0, 64 );
-}
-
-static PyObject *RenderData_getYafrayAntiAliasingPasses( BPy_RenderData * self )
-{
- return M_Render_getInt( self, self->renderContext->YF_AApasses );
-}
-
-/** YafRay - Anti-Aliasing Samples */
-
-static int RenderData_setYafrayAntiAliasingSamples( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setInt( self, value, &self->renderContext->YF_AAsamples, 0, 2048 );
-}
-
-static PyObject *RenderData_getYafrayAntiAliasingSamples( BPy_RenderData * self )
-{
- return M_Render_getInt( self, self->renderContext->YF_AAsamples );
-}
-
-/* YafRay - Anti-Aliasing Pixel Filter Size */
-
-static int RenderData_setYafrayAntiAliasingPixelSize( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setFloat( self, value, &self->renderContext->YF_AApixelsize, 1.0, 2.0 );
-}
-
-static PyObject *RenderData_getYafrayAntiAliasingPixelSize( BPy_RenderData * self )
-{
- return M_Render_getFloat( self, self->renderContext->YF_AApixelsize );
-}
-
-/* YafRay - Anti-Aliasing threshold */
-
-static int RenderData_setYafrayAntiAliasingThreshold( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setFloat( self, value, &self->renderContext->YF_AAthreshold, 0.05, 1.0 );
-}
-
-static PyObject *RenderData_getYafrayAntiAliasingThreshold( BPy_RenderData * self )
-{
- return M_Render_getFloat( self, self->renderContext->YF_AAthreshold );
-}
-
-/* YafRay - Cache occlusion/irradiance samples (faster) */
-
-static int RenderData_setYafrayGICache( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->GIcache );
-}
-
-static PyObject *RenderData_getYafrayGICache( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->GIcache );
-}
-
-/* YafRay - Enable/disable bumpnormals for cache
- (faster, but no bumpmapping in total indirectly lit areas) */
-
-static int RenderData_setYafrayGICacheBumpNormals( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->YF_nobump );
-}
-
-static PyObject *RenderData_getYafrayGICacheBumpNormals( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->YF_nobump );
-}
-
-/* YafRay - Shadow quality, keep it under 0.95 :-) */
-
-static int RenderData_setYafrayGICacheShadowQuality( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setFloat( self, value, &self->renderContext->GIshadowquality, 0.01, 1.0 );
-}
-
-static PyObject *RenderData_getYafrayGICacheShadowQuality( BPy_RenderData * self )
-{
- return M_Render_getFloat( self, self->renderContext->GIshadowquality );
-}
-
-/* YafRay - Threshold to refine shadows EXPERIMENTAL. 1 = no refinement */
-
-static int RenderData_setYafrayGICacheRefinement( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setFloat( self, value, &self->renderContext->GIrefinement, 0.001, 1.0 );
-}
-
-static PyObject *RenderData_getYafrayGICacheRefinement( BPy_RenderData * self )
-{
- return M_Render_getFloat( self, self->renderContext->GIrefinement );
-}
-
-/* YafRay - Maximum number of pixels without samples, the lower the better and slower */
-
-static int RenderData_setYafrayGICachePixelsPerSample( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setInt( self, value, &self->renderContext->GIpixelspersample, 1, 50 );
-}
-
-static PyObject *RenderData_getYafrayGICachePixelsPerSample( BPy_RenderData * self )
-{
- return M_Render_getInt( self, self->renderContext->GIpixelspersample );
-}
-
-/** YafRay - Enable/disable use of global photons to help in GI */
-
-static int RenderData_setYafrayGIPhotons( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->GIphotons );
-}
-
-static PyObject *RenderData_getYafrayGIPhotons( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->GIphotons );
-}
-
-/** YafRay - If true the photonmap is shown directly in the render for tuning */
-
-static int RenderData_setYafrayGITunePhotons( BPy_RenderData * self, PyObject * value )
-{
- return M_Render_setBooleanShort( self, value, &self->renderContext->GIdirect );
-}
-
-static PyObject *RenderData_getYafrayGITunePhotons( BPy_RenderData * self )
-{
- return M_Render_getBooleanShort( self, self->renderContext->GIdirect );
-}
-
-/* (die) end */
-
-static PyObject *RenderData_YafrayGIPower( BPy_RenderData * self, PyObject * args )
-{
- if( self->renderContext->GImethod > 0 ) {
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- GIpower, 0.01f,
- 100.00f );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'SKYDOME' or 'FULL'" ) );
-}
-
-static PyObject *RenderData_YafrayGIIndirPower( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- GIindirpower, 0.01f,
- 100.00f );
-}
-
-static PyObject *RenderData_YafrayGIDepth( BPy_RenderData * self, PyObject * args )
-{
- if( self->renderContext->GImethod == 2 ) {
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->
- GIdepth, 1, 100 );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL'" ) );
-}
-
-static PyObject *RenderData_YafrayGICDepth( BPy_RenderData * self, PyObject * args )
-{
- if( self->renderContext->GImethod == 2 ) {
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->
- GIcausdepth, 1, 100 );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL'" ) );
-}
-
-static PyObject *RenderData_EnableYafrayGICache( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2 ) {
- return M_Render_BitToggleShort( args, 1,
- &self->renderContext->
- GIcache );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL'" ) );
-}
-
-static PyObject *RenderData_EnableYafrayGIPhotons( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2 ) {
- return M_Render_BitToggleShort( args, 1,
- &self->renderContext->
- GIphotons );;
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL'" ) );
-}
-
-static PyObject *RenderData_YafrayGIPhotonCount( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIphotons == 1 ) {
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->
- GIphotoncount, 100000,
- 10000000 );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayGIPhotonRadius( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIphotons == 1 ) {
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- GIphotonradius, 0.00001f,
- 100.0f );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayGIPhotonMixCount( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIphotons == 1 ) {
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->
- GImixphotons, 100, 1000 );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled" ) );
-}
-
-static PyObject *RenderData_EnableYafrayGITunePhotons( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIphotons == 1 ) {
- return M_Render_BitToggleShort( args, 1,
- &self->renderContext->
- GIdirect );;
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GIPhotons must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayGIShadowQuality( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIcache == 1 ) {
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- GIshadowquality, 0.01f,
- 1.0f );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GICache must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayGIPixelsPerSample( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIcache == 1 ) {
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->
- GIpixelspersample, 1, 50 );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GICache must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayGIRefinement( BPy_RenderData * self,
- PyObject * args )
-{
- if( self->renderContext->GImethod == 2
- && self->renderContext->GIcache == 1 ) {
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- GIrefinement, 0.001f,
- 1.0f );
- } else
- return ( EXPP_ReturnPyObjError( PyExc_StandardError,
- "YafrayGIMethod must be set to 'FULL' and GICache must be enabled" ) );
-}
-
-static PyObject *RenderData_YafrayRayBias( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->YF_raybias,
- 0.0f, 10.0f );
-}
-
-static PyObject *RenderData_YafrayRayDepth( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeInt( args,
- &self->renderContext->YF_raydepth,
- 1, 80 );
-}
-
-static PyObject *RenderData_YafrayGamma( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->YF_gamma,
- 0.001f, 5.0f );
-}
-
-static PyObject *RenderData_YafrayExposure( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeFloat( args,
- &self->renderContext->
- YF_exposure, 0.0f, 10.0f );
-}
-
-static PyObject *RenderData_EnableGameFrameStretch( BPy_RenderData * self )
-{
- self->scene->framing.type = SCE_GAMEFRAMING_SCALE;
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableGameFrameExpose( BPy_RenderData * self )
-{
- self->scene->framing.type = SCE_GAMEFRAMING_EXTEND;
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_EnableGameFrameBars( BPy_RenderData * self )
-{
- self->scene->framing.type = SCE_GAMEFRAMING_BARS;
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_SetGameFrameColor( BPy_RenderData * self,
- PyObject * args )
-{
- float red = 0.0f;
- float green = 0.0f;
- float blue = 0.0f;
-
- if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected three floats" ) );
-
- if( red < 0 || red > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (red)" ) );
- if( green < 0 || green > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (green)" ) );
- if( blue < 0 || blue > 1 )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "value out of range 0.000 - 1.000 (blue)" ) );
-
- self->scene->framing.col[0] = red;
- self->scene->framing.col[1] = green;
- self->scene->framing.col[2] = blue;
-
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_GetGameFrameColor( BPy_RenderData * self )
-{
- char rgb[24];
-
- sprintf( rgb, "[%.3f,%.3f,%.3f]", self->scene->framing.col[0],
- self->scene->framing.col[1], self->scene->framing.col[2] );
- return PyString_FromString( rgb );
-}
-
-#ifdef __sgi
-static PyObject *RenderData_SGIMaxsize( BPy_RenderData * self, PyObject * args )
-{
- return M_Render_GetSetAttributeShort( args,
- &self->renderContext->maximsize,
- 0, 500 );
-}
-
-static PyObject *RenderData_EnableSGICosmo( BPy_RenderData *self, PyObject *args )
-{
- return M_Render_BitToggleInt( args, R_COSMO,
- &self->renderContext->mode );
-}
-#else
-static PyObject *RenderData_SGIMaxsize( void )
-{
- return EXPP_ReturnPyObjError( PyExc_StandardError,
- "SGI is not defined on this machine" );
-}
-
-static PyObject *RenderData_EnableSGICosmo( void )
-{
- return EXPP_ReturnPyObjError( PyExc_StandardError,
- "SGI is not defined on this machine" );
-}
-#endif
-
-static PyObject *RenderData_OldMapValue( BPy_RenderData * self, PyObject * args )
-{
- PyObject *tmp = M_Render_GetSetAttributeInt(args,
- &self->renderContext->framapto, 1, 900);
- self->renderContext->framelen =
- (float)self->renderContext->framapto / self->renderContext->images;
- return tmp;
-}
-
-static PyObject *RenderData_NewMapValue( BPy_RenderData * self, PyObject * args )
-{
- PyObject *tmp = M_Render_GetSetAttributeInt(args,
- &self->renderContext->images, 1, 900);
- self->renderContext->framelen =
- (float)self->renderContext->framapto / self->renderContext->images;
- return tmp;
-}
-
-static PyObject *RenderData_getTimeCode( BPy_RenderData * self) {
- char tc[12];
- int h, m, s, cfa;
- double fps;
-
- fps = (double) self->renderContext->frs_sec /
- self->renderContext->frs_sec_base;
- cfa = self->renderContext->cfra-1;
- s = cfa / fps;
- m = s / 60;
- h = m / 60;
- if( h > 99 )
- return PyString_FromString("Time Greater than 99 Hours!");
-
- sprintf( tc, "%02d:%02d:%02d:%02d", h%60, m%60, s%60,
- (int) (cfa - ((int) (cfa / fps) * fps)));
- return PyString_FromString(tc);
-}
-
-
-/***************************************************************************/
-/* Render layer functions */
-/***************************************************************************/
-static PyObject *RenderData_getRenderLayers(BPy_RenderData * self)
-{
- PyObject *list, *layer;
- SceneRenderLayer *srl;
-
- list = PyList_New(0);
-
- for(srl= self->renderContext->layers.first; srl; srl= srl->next) {
- layer = RenderLayer_CreatePyObject( self->scene, srl );
- PyList_Append(list, layer);
- Py_DECREF(layer);
- }
- return list;
-}
-
-static PyObject *RenderData_removeRenderLayer(BPy_RenderData * self, BPy_RenderLayer *value)
-{
- int index;
- if (!BPy_RenderLayer_Check(value))
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "can only remove a render layer" );
-
- index = BLI_findindex(&self->renderContext->layers, value->renderLayer);
-
- if (index == -1)
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "render layer is not in this scene" );
-
- if (BLI_countlist(&self->renderContext->layers)<=1)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "cannot remove the last render layer" );
-
- BLI_remlink(&self->scene->r.layers, value->renderLayer);
- MEM_freeN(value->renderLayer);
- self->scene->r.actlay= 0;
-
- if(self->scene->nodetree) {
- bNode *node;
- for(node= self->scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==index)
- node->custom1= 0;
- else if(node->custom1 > index)
- node->custom1--;
- }
- }
- }
-
- value->renderLayer = NULL;
- Py_RETURN_NONE;
-}
-
-static PyObject *RenderData_addRenderLayer(BPy_RenderData * self ) {
- scene_add_render_layer(self->scene);
- return RenderLayer_CreatePyObject( self->scene, self->renderContext->layers.last );
-
-}
-
-/***************************************************************************/
-/* generic handlers for getting/setting attributes */
-/***************************************************************************/
-
-/*
- * get floating point attributes
- */
-
-static PyObject *RenderData_getFloatAttr( BPy_RenderData *self, void *type )
-{
- float param;
-
- switch( (int)type ) {
- case EXPP_RENDER_ATTR_GAUSSFILTER:
- param = self->renderContext->gauss;
- break;
- case EXPP_RENDER_ATTR_MBLURFACTOR:
- param = self->renderContext->blurfac;
- break;
- case EXPP_RENDER_ATTR_FPS_BASE:
- param = self->renderContext->frs_sec_base;
- break;
- case EXPP_RENDER_ATTR_BAKEDIST:
- param = self->renderContext->bake_maxdist;
- break;
- case EXPP_RENDER_ATTR_BAKEBIAS:
- param = self->renderContext->bake_biasdist;
- break;
- case EXPP_RENDER_ATTR_ASPECTX:
- param = (long)self->renderContext->xasp;
- break;
- case EXPP_RENDER_ATTR_ASPECTY:
- param = (long)self->renderContext->yasp;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type constant in RenderData_getFloatAttr" );
- }
- return PyFloat_FromDouble( param );
-}
-
-/*
- * set floating point attributes which require clamping
- */
-
-static int RenderData_setFloatAttrClamp( BPy_RenderData *self, PyObject *value,
- void *type )
-{
- float *param;
- float min, max;
-
- switch( (int)type ) {
- case EXPP_RENDER_ATTR_GAUSSFILTER:
- min = 0.5f;
- max = 1.5f;
- param = &self->renderContext->gauss;
- break;
- case EXPP_RENDER_ATTR_MBLURFACTOR:
- min = 0.01f;
- max = 5.0f;
- param = &self->renderContext->blurfac;
- break;
- case EXPP_RENDER_ATTR_FPS_BASE:
- min = 1.0f;
- max = 120.0f;
- param = &self->renderContext->frs_sec_base;
- break;
- case EXPP_RENDER_ATTR_BAKEDIST:
- min = 0.0f;
- max = 1000.0f;
- param = &self->renderContext->bake_maxdist;
- break;
- case EXPP_RENDER_ATTR_BAKEBIAS:
- min = 0.0f;
- max = 1000.0f;
- param = &self->renderContext->bake_biasdist;
- break;
- case EXPP_RENDER_ATTR_ASPECTX:
- min = 1.0f;
- max = 200.0f;
- param = &self->renderContext->xasp;
- break;
- case EXPP_RENDER_ATTR_ASPECTY:
- min = 1.0f;
- max = 200.0f;
- param = &self->renderContext->yasp;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type constant in RenderData_setFloatAttrClamp" );
- }
- return EXPP_setFloatClamped( value, param, min, max );
-}
-
-/*
- * get integer attributes
- */
-
-static PyObject *RenderData_getIValueAttr( BPy_RenderData *self, void *type )
-{
- long param;
-
- switch( (int)type ) {
- case EXPP_RENDER_ATTR_XPARTS:
- param = (long)self->renderContext->xparts;
- break;
- case EXPP_RENDER_ATTR_YPARTS:
- param = (long)self->renderContext->yparts;
- break;
- case EXPP_RENDER_ATTR_CFRAME:
- param = (long)self->renderContext->cfra;
- break;
- case EXPP_RENDER_ATTR_EFRAME:
- param = (long)self->renderContext->efra;
- break;
- case EXPP_RENDER_ATTR_SFRAME:
- param = (long)self->renderContext->sfra;
- break;
- case EXPP_RENDER_ATTR_FPS:
- param = self->renderContext->frs_sec;
- break;
- case EXPP_RENDER_ATTR_SIZEX:
- param = self->renderContext->xsch;
- break;
- case EXPP_RENDER_ATTR_SIZEY:
- param = self->renderContext->ysch;
- break;
- case EXPP_RENDER_ATTR_BAKEMARGIN:
- param = self->renderContext->bake_filter;
- break;
- case EXPP_RENDER_ATTR_BAKEMODE:
- param = self->renderContext->bake_mode;
- break;
- case EXPP_RENDER_ATTR_BAKENORMALSPACE:
- param = self->renderContext->bake_normal_space;
- break;
- case EXPP_RENDER_ATTR_OCRES:
- param = self->renderContext->ocres;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type constant in RenderData_setIValueAttrClamp" );
- }
- return PyInt_FromLong( param );
-}
-
-/*
- * set integer attributes which require clamping
- */
-
-static int RenderData_setIValueAttrClamp( BPy_RenderData *self, PyObject *value,
- void *type )
-{
- void *param;
- int min, max, size;
-
- switch( (int)type ) {
- case EXPP_RENDER_ATTR_XPARTS:
- min = 1;
- max = 512;
- size = 'h';
- param = &self->renderContext->xparts;
- break;
- case EXPP_RENDER_ATTR_YPARTS:
- min = 1;
- max = 64;
- size = 'h';
- param = &self->renderContext->yparts;
- break;
- case EXPP_RENDER_ATTR_CFRAME:
- min = 1;
- max = MAXFRAME;
- size = 'i';
- param = &self->renderContext->cfra;
- break;
- case EXPP_RENDER_ATTR_EFRAME:
- min = 1;
- max = MAXFRAME;
- size = 'i';
- param = &self->renderContext->efra;
- break;
- case EXPP_RENDER_ATTR_SFRAME:
- min = 1;
- max = MAXFRAME;
- size = 'i';
- param = &self->renderContext->sfra;
- break;
- case EXPP_RENDER_ATTR_FPS:
- min = 1;
- max = 120;
- size = 'h';
- param = &self->renderContext->frs_sec;
- break;
- case EXPP_RENDER_ATTR_SIZEX:
- min = 4;
- max = 10000;
- size = 'h';
- param = &self->renderContext->xsch;
- break;
- case EXPP_RENDER_ATTR_SIZEY:
- min = 4;
- max = 10000;
- size = 'h';
- param = &self->renderContext->ysch;
- break;
- case EXPP_RENDER_ATTR_BAKEMARGIN:
- min = 0;
- max = 32;
- size = 'h';
- param = &self->renderContext->bake_filter;
- break;
- case EXPP_RENDER_ATTR_BAKEMODE:
- min = RE_BAKE_LIGHT;
- max = RE_BAKE_SHADOW;
- size = 'h';
- param = &self->renderContext->bake_mode;
- break;
- case EXPP_RENDER_ATTR_BAKENORMALSPACE:
- min = R_BAKE_SPACE_CAMERA;
- max = R_BAKE_SPACE_TANGENT;
- size = 'h';
- param = &self->renderContext->bake_normal_space;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type constant in RenderData_setIValueAttrClamp" );
- }
- return EXPP_setIValueClamped( value, param, min, max, size );
-}
-
-/***************************************************************************/
-/* handlers for other getting/setting attributes */
-/***************************************************************************/
-
-static PyObject *RenderData_getSubImTypeBits( BPy_RenderData *self, void* type )
-{
- return EXPP_getBitfield( &self->renderContext->subimtype, (int)type, 'h' );
-}
-
-static int RenderData_setSubImTypeBits( BPy_RenderData* self, PyObject *value,
- void* type )
-{
- return EXPP_setBitfield( value, &self->renderContext->subimtype,
- (int)type, 'h' );
-}
-
-static PyObject *RenderData_getModeBit( BPy_RenderData *self, void* type )
-{
- return EXPP_getBitfield( &self->renderContext->mode,
- (int)type, 'i' );
-}
-
-static int RenderData_setModeBit( BPy_RenderData* self, PyObject *value,
- void* type )
-{
- return EXPP_setBitfield( value, &self->renderContext->mode,
- (int)type, 'i' );
-}
-
-#define MODE_MASK ( R_OSA | R_SHADOW | R_GAMMA | R_ENVMAP | R_EDGE | \
- R_FIELDS | R_FIELDSTILL | R_RADIO | R_BORDER | R_PANORAMA | R_CROP | \
- R_ODDFIELD | R_MBLUR | R_RAYTRACE | R_FIXED_THREADS )
-
-static PyObject *RenderData_getMode( BPy_RenderData *self )
-{
- return PyInt_FromLong( (long)(self->renderContext->mode & MODE_MASK) );
-}
-
-static int RenderData_setMode( BPy_RenderData* self, PyObject *arg )
-{
- int value;
-
- if( !PyInt_Check( arg ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- value = PyInt_AsLong( arg );
- if( value & ~MODE_MASK )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "unexpected bits set in argument" );
-
- self->renderContext->mode = (short)value;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- return 0;
-}
-
-static PyObject *RenderData_getSceModeBits( BPy_RenderData *self, void* type )
-{
- return EXPP_getBitfield( &self->renderContext->scemode, (int)type, 'i' );
-}
-
-static int RenderData_setSceModeBits( BPy_RenderData* self, PyObject *value,
- void* type )
-{
- return EXPP_setBitfield( value, &self->renderContext->scemode,
- (int)type, 'i' );
-}
-
-static PyObject *RenderData_getSceMode( BPy_RenderData *self )
-{
- return PyInt_FromLong ( (long)self->renderContext->scemode );
-}
-
-static int RenderData_setSceMode( BPy_RenderData* self, PyObject *arg )
-{
- int value;
-
- if( !PyInt_Check( arg ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected int argument" );
-
- value = PyInt_AsLong( arg );
- if( value & ~( R_EXTENSION | R_DOSEQ ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "unexpected bits set in argument" );
-
- self->renderContext->scemode = (int)value;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- return 0;
-}
-
-static PyObject *RenderData_getFramingType( BPy_RenderData *self )
-{
- return PyInt_FromLong( (long)self->scene->framing.type );
-}
-
-static int RenderData_setFramingType( BPy_RenderData *self, PyObject *value )
-{
- return EXPP_setIValueRange( value, &self->scene->framing.type,
- SCE_GAMEFRAMING_BARS, SCE_GAMEFRAMING_SCALE, 'b' );
-}
-
-static PyObject *RenderData_getEdgeColor( BPy_RenderData * self )
-{
- return Py_BuildValue( "[fff]", self->renderContext->edgeR,
- self->renderContext->edgeG, self->renderContext->edgeB );
-}
-
-static int RenderData_setEdgeColor( BPy_RenderData * self, PyObject * args )
-{
- float red, green, blue;
-
- /* if we get a list, convert to a tuple; otherwise hope for the best */
- if( PyList_Check( args ) )
- args = PySequence_Tuple( args );
- else
- Py_INCREF( args );
-
- if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) ) {
- Py_DECREF( args );
- return EXPP_ReturnIntError( PyExc_TypeError, "expected three floats" );
- }
- Py_DECREF( args );
-
- self->renderContext->edgeR = EXPP_ClampFloat( red, 0.0, 1.0 );
- self->renderContext->edgeG = EXPP_ClampFloat( green, 0.0, 1.0 );
- self->renderContext->edgeB = EXPP_ClampFloat( blue, 0.0, 1.0 );
- return 0;
-}
-
-static PyObject *RenderData_getOSALevel( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long)self->renderContext->osa );
-}
-
-static PyObject *RenderData_getRenderer( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long)self->renderContext->renderer );
-}
-
-static PyObject *RenderData_getImageType( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->imtype );
-}
-
-static int RenderData_setGameFrameColor( BPy_RenderData * self,
- PyObject * args )
-{
- float red, green, blue;
-
- /* if we get a list, convert to a tuple; otherwise hope for the best */
- if( PyList_Check( args ) )
- args = PySequence_Tuple( args );
- else
- Py_INCREF( args );
-
- if( !PyArg_ParseTuple( args, "fff", &red, &green, &blue ) ) {
- Py_DECREF( args );
- return EXPP_ReturnIntError( PyExc_TypeError, "expected three floats" );
- }
- Py_DECREF( args );
-
- self->scene->framing.col[0] = EXPP_ClampFloat( red, 0.0, 1.0 );
- self->scene->framing.col[1] = EXPP_ClampFloat( green, 0.0, 1.0 );
- self->scene->framing.col[2] = EXPP_ClampFloat( blue, 0.0, 1.0 );
- return 0;
-}
-
-static PyObject *RenderData_getGameFrameColor( BPy_RenderData * self )
-{
- return Py_BuildValue( "[fff]", self->scene->framing.col[0],
- self->scene->framing.col[1], self->scene->framing.col[2] );
-}
-
-static PyObject *RenderData_getBackbuf( BPy_RenderData * self )
-{
- return EXPP_getBitfield( &self->renderContext->bufflag,
- R_BACKBUF, 'h' );
-}
-
-static int RenderData_setBackbuf( BPy_RenderData* self, PyObject *value )
-{
- return EXPP_setBitfield( value, &self->renderContext->bufflag,
- R_BACKBUF, 'h' );
-}
-
-static int RenderData_setImagePlanes( BPy_RenderData *self, PyObject *value )
-{
- int depth;
- char *errstr = "expected int argument of 8, 24, or 32";
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
-
- depth = PyInt_AsLong( value );
- if( depth != 8 && depth != 24 && depth != 32 )
- return EXPP_ReturnIntError( PyExc_ValueError, errstr );
-
- self->renderContext->planes = (short)depth;
-
- return 0;
-}
-
-static PyObject *RenderData_getImagePlanes( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->planes );
-}
-
-static int RenderData_setAlphaMode( BPy_RenderData *self, PyObject *value )
-{
- return EXPP_setIValueRange( value, &self->renderContext->alphamode,
- R_ADDSKY, R_ALPHAKEY, 'h' );
-}
-
-static PyObject *RenderData_getAlphaMode( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->alphamode );
-}
-
-static PyObject *RenderData_getDisplayMode( void )
-{
- return PyInt_FromLong( (long) G.displaymode );
-}
-
-static int RenderData_setDisplayMode( BPy_RenderData *self,
- PyObject *value )
-{
- return EXPP_setIValueRange( value, &G.displaymode,
- R_DISPLAYIMAGE, R_DISPLAYSCREEN, 'h' );
-}
-
-static PyObject *RenderData_getRenderPath( BPy_RenderData * self )
-{
- return PyString_FromString( self->renderContext->pic );
-}
-
-static int RenderData_setRenderPath( BPy_RenderData * self, PyObject * value )
-{
- char *name;
-
- name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a string" );
-
- if( strlen( name ) >= sizeof(self->renderContext->pic) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "render path is too long" );
-
- strcpy( self->renderContext->pic, name );
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- return 0;
-}
-
-static PyObject *RenderData_getFrameFilename( BPy_RenderData * self, PyObject *args )
-{
- char name[FILE_MAX];
- int frame = self->renderContext->cfra;
-
- if( !PyArg_ParseTuple( args, "|i", &( frame ) ) )
- return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected int argument or nothing" ) );
-
- BKE_makepicstring(name, self->renderContext->pic, frame, self->renderContext->imtype);
- return PyString_FromString( name );
-}
-
-PyObject *RenderData_getBackbufPath( BPy_RenderData * self )
-{
- return PyString_FromString( self->renderContext->backbuf );
-}
-
-static int RenderData_setBackbufPath( BPy_RenderData *self, PyObject *value )
-{
- char *name;
- Image *ima;
-
- name = PyString_AsString( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected a string" );
-
- if( strlen( name ) >= sizeof(self->renderContext->backbuf) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "backbuf path is too long" );
-
- strcpy( self->renderContext->backbuf, name );
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- ima = BKE_add_image_file( name );
- if( ima )
- BKE_image_signal( ima, NULL, IMA_SIGNAL_RELOAD );
-
- return 0;
-}
-
-PyObject *RenderData_getRenderWinSize( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->size );
-}
-
-static int RenderData_setRenderWinSize( BPy_RenderData *self, PyObject *value )
-{
- int size;
- char *errstr = "expected int argument of 25, 50, 75, or 100";
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, errstr );
-
- size = PyInt_AsLong( value );
- if( size != 25 && size != 50 && size != 75 && size != 100 )
- return EXPP_ReturnIntError( PyExc_ValueError, errstr );
-
- self->renderContext->size = (short)size;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
-
- return 0;
-}
-
-static PyObject *RenderData_getMapOld( BPy_RenderData *self )
-{
- return PyInt_FromLong( (long)self->renderContext->framapto );
-}
-
-static int RenderData_setMapOld( BPy_RenderData *self, PyObject *value )
-{
- int result = EXPP_setIValueClamped( value, &self->renderContext->framapto,
- 1, 900, 'h' );
- self->renderContext->framelen =
- (float)self->renderContext->framapto / self->renderContext->images;
- return result;
-}
-
-static PyObject *RenderData_getMapNew( BPy_RenderData *self )
-{
- return PyInt_FromLong( (long)self->renderContext->images );
-}
-
-static int RenderData_setMapNew( BPy_RenderData *self, PyObject *value )
-{
- int result = EXPP_setIValueClamped( value, &self->renderContext->images,
- 1, 900, 'h' );
- self->renderContext->framelen =
- (float)self->renderContext->framapto / self->renderContext->images;
- return result;
-}
-
-static PyObject *RenderData_getSet( BPy_RenderData *self )
-{
- if( self->scene->set )
- return Scene_CreatePyObject( self->scene->set );
- Py_RETURN_NONE;
-}
-
-static int RenderData_setSet( BPy_RenderData *self, PyObject *value )
-{
- BPy_Scene *sc;
-
- /* if "None", delete the link to the scene */
- if( value == Py_None ) {
- self->scene->set = NULL;
- return 0;
- }
-
- /* be sure argument is a Scene */
- if( !BPy_Scene_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected Scene as argument" );
-
- /* check for attempt to link to ourselves */
- sc = (BPy_Scene *)value;
- if( self->scene == sc->scene )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "cannot link a scene to itself" );
-
- /*
- * Accept the set link, then check for a circular link. If circular link
- * exists, scene_check_setscene() sets self->scene->set to NULL.
- */
-
- self->scene->set = sc->scene;
- if( !scene_check_setscene( self->scene ) )
- return EXPP_ReturnIntError( PyExc_ValueError,
- "linking scene would create a cycle" );
-
- return 0;
-}
-
-
-PyObject *RenderData_getThreads( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->threads );
-}
-
-static int RenderData_setThreads( BPy_RenderData *self, PyObject *value )
-{
- int threads;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "Error, threads must be an int" );
-
- threads = PyInt_AsLong( value );
- if (threads<1) threads = 1;
- else if (threads>8) threads = 8;
-
- self->renderContext->threads = (short)threads;
- EXPP_allqueue( REDRAWBUTSSCENE, 0 );
- return 0;
-}
-
-PyObject *RenderData_getActiveLayer( BPy_RenderData * self )
-{
- return PyInt_FromLong( (long) self->renderContext->actlay );
-}
-
-static int RenderData_setActiveLayer( BPy_RenderData *self, PyObject *value )
-{
- int layer;
- short nr;
- SceneRenderLayer *srl;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "active layer must be an int" );
-
- layer = PyInt_AsLong( value );
- for(nr=0, srl= self->renderContext->layers.first; srl; srl= srl->next, nr++) {
- }
- if(layer >= nr)
- return EXPP_ReturnIntError( PyExc_ValueError, "value larger than number of render layers" );
-
- self->renderContext->actlay = layer;
- EXPP_allqueue(REDRAWBUTSSCENE, 0);
- EXPP_allqueue(REDRAWNODE, 0);
- return 0;
-}
-
-static int RenderData_setBakeMode( BPy_RenderData *self, PyObject *value,
- void *type )
-{
- /* use negative numbers to flip truth */
- int param = PyObject_IsTrue( value );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param) {
- self->renderContext->bake_flag |= (int)type;
- } else {
- self->renderContext->bake_flag &= ~(int)type;
- }
- return 0;
-}
-
-static PyObject *RenderData_getBakeMode( BPy_RenderData *self, void *type )
-{
- int itype = (int)type;
- /* use negative numbers to flip truth */
- if (self->renderContext->bake_flag & itype) Py_RETURN_TRUE;
- else Py_RETURN_FALSE;
-}
-
-/***************************************************************************/
-/* BPy_RenderData attribute def */
-/***************************************************************************/
-static PyGetSetDef BPy_RenderData_getseters[] = {
- {"oversampling",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Oversampling (anti-aliasing) enabled",
- (void *)R_OSA},
- {"shadow",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Shadow calculation enabled",
- (void *)R_SHADOW},
- {"gammaCorrection",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Gamma correction enabled",
- (void *)R_GAMMA},
-/* R_ORTHO unused */
- {"environmentMap",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Environment map rendering enabled",
- (void *)R_ENVMAP},
- {"toonShading",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Toon edge shading enabled",
- (void *)R_EDGE},
- {"fieldRendering",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Field rendering enabled",
- (void *)R_FIELDS},
- {"fieldTimeDisable",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Time difference in field calculations disabled ('X' in UI)",
- (void *)R_FIELDSTILL},
- {"radiosityRender",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Radiosity rendering enabled",
- (void *)R_RADIO},
- {"borderRender",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Small cut-out rendering enabled",
- (void *)R_BORDER},
- {"panorama",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Panorama rendering enabled",
- (void *)R_PANORAMA},
- {"crop",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Crop image during border renders",
- (void *)R_CROP},
-/* R_COSMO unsupported */
- {"oddFieldFirst",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Odd field first rendering enabled",
- (void *)R_ODDFIELD},
- {"motionBlur",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Motion blur enabled",
- (void *)R_MBLUR},
- {"rayTracing",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Ray tracing enabled",
- (void *)R_RAYTRACE},
-
- {"touch",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Create an empry file with the frame name before rendering",
- (void *)R_TOUCH},
- {"noOverwrite",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Skip rendering existing image files",
- (void *)R_NO_OVERWRITE},
- {"fixedThreads",
- (getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
- "Use the number of threads defined by the blend file",
- (void *)R_FIXED_THREADS},
-/* R_GAUSS unused */
-/* R_FBUF unused */
- {"threads",
- (getter)RenderData_getThreads, (setter)RenderData_setThreads,
- "Number of threads used to render",
- NULL},
-/* R_SPEED unused */
- {"mode",
- (getter)RenderData_getMode, (setter)RenderData_setMode,
- "Mode bitfield",
- NULL},
-
- /* scene modes */
- {"sequencer",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "'Do Sequence' enabled",
- (void *)R_DOSEQ},
- {"extensions",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "Add extensions to output (when rendering animations) enabled",
- (void *)R_EXTENSION},
- {"compositor",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "'Do Compositor' enabled.",
- (void *)R_DOCOMP},
- {"freeImages",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "Free texture images after render.",
- (void *)R_FREE_IMAGE},
- {"singleLayer",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "Only render the active layer.",
- (void *)R_SINGLE_LAYER},
- {"saveBuffers",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "Save render buffers to disk while rendering, saves memory.",
- (void *)R_EXR_TILE_FILE},
- {"compositeFree",
- (getter)RenderData_getSceModeBits, (setter)RenderData_setSceModeBits,
- "Free nodes that are not used while composite.",
- (void *)R_COMP_FREE},
-
- {"sceneMode",
- (getter)RenderData_getSceMode, (setter)RenderData_setSceMode,
- "Scene mode bitfield",
- NULL},
-/* R_BG_RENDER unused */
-
- {"gameFrame",
- (getter)RenderData_getFramingType, (setter)RenderData_setFramingType,
- "Game framing type",
- NULL},
-
- {"renderPath",
- (getter)RenderData_getRenderPath, (setter)RenderData_setRenderPath,
- "The path to output the rendered images to",
- NULL},
- {"backbufPath",
- (getter)RenderData_getBackbufPath, (setter)RenderData_setBackbufPath,
- "Path to a background image (setting loads image)",
- NULL},
- {"edgeColor",
- (getter)RenderData_getEdgeColor, (setter)RenderData_setEdgeColor,
- "RGB color triplet for edges in Toon shading",
- NULL},
- {"OSALevel",
- (getter)RenderData_getOSALevel, (setter)RenderData_setOSALevel,
- "Oversampling (anti-aliasing) level",
- NULL},
- {"renderwinSize",
- (getter)RenderData_getRenderWinSize, (setter)RenderData_setRenderWinSize,
- "Size of the rendering window (25, 50, 75, or 100)",
- NULL},
- {"border",
- (getter)RenderData_getBorder, (setter)RenderData_setBorder,
- "The border for border rendering",
- NULL},
- {"timeCode",
- (getter)RenderData_getTimeCode, (setter)NULL,
- "Get the current frame in HH:MM:SS:FF format",
- NULL},
- {"renderer",
- (getter)RenderData_getRenderer, (setter)RenderData_setRenderer,
- "Rendering engine choice",
- NULL},
- {"imageType",
- (getter)RenderData_getImageType, (setter)RenderData_setImageType,
- "File format for saving images",
- NULL},
- {"gameFrameColor",
- (getter)RenderData_getGameFrameColor,(setter)RenderData_setGameFrameColor,
- "RGB color triplet for bars",
- NULL},
- {"backbuf",
- (getter)RenderData_getBackbuf, (setter)RenderData_setBackbuf,
- "Backbuffer image enabled",
- NULL},
- {"imagePlanes",
- (getter)RenderData_getImagePlanes, (setter)RenderData_setImagePlanes,
- "Image depth (8, 24, or 32 bits)",
- NULL},
- {"alphaMode",
- (getter)RenderData_getAlphaMode, (setter)RenderData_setAlphaMode,
- "Setting for sky/background.",
- NULL},
- {"displayMode",
- (getter)RenderData_getDisplayMode, (setter)RenderData_setDisplayMode,
- "Render output in separate window or 3D view",
- NULL},
-
- {"xParts",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Number of horizontal parts for image render",
- (void *)EXPP_RENDER_ATTR_XPARTS},
- {"yParts",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Number of vertical parts for image render",
- (void *)EXPP_RENDER_ATTR_YPARTS},
- {"cFrame",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "The current frame for rendering",
- (void *)EXPP_RENDER_ATTR_CFRAME},
- {"sFrame",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Starting frame for rendering",
- (void *)EXPP_RENDER_ATTR_SFRAME},
- {"eFrame",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Ending frame for rendering",
- (void *)EXPP_RENDER_ATTR_EFRAME},
- {"fps",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Frames per second",
- (void *)EXPP_RENDER_ATTR_FPS},
- {"fpsBase",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Frames per second base",
- (void *)EXPP_RENDER_ATTR_FPS_BASE},
- {"sizeX",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Image width (in pixels)",
- (void *)EXPP_RENDER_ATTR_SIZEX},
- {"sizeY",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "Image height (in pixels)",
- (void *)EXPP_RENDER_ATTR_SIZEY},
-
- {"gaussFilter",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Gauss filter size",
- (void *)EXPP_RENDER_ATTR_GAUSSFILTER},
- {"mblurFactor",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Motion blur factor",
- (void *)EXPP_RENDER_ATTR_MBLURFACTOR},
- {"aspectX",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Horizontal aspect ratio",
- (void *)EXPP_RENDER_ATTR_ASPECTX},
- {"aspectY",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Vertical aspect ratio",
- (void *)EXPP_RENDER_ATTR_ASPECTY},
- {"mapOld",
- (getter)RenderData_getMapOld, (setter)RenderData_setMapOld,
- "Number of frames the Map Old will last",
- NULL},
- {"mapNew",
- (getter)RenderData_getMapNew, (setter)RenderData_setMapNew,
- "New mapping value (in frames)",
- NULL},
- {"octreeResolution",
- (getter)RenderData_getIValueAttr, (setter)NULL,
- "Resolution for octree",
- (void *)EXPP_RENDER_ATTR_OCRES},
- {"set",
- (getter)RenderData_getSet, (setter)RenderData_setSet,
- "Scene link 'set' value",
- NULL},
-
- /* renderlayers */
- {"activeLayer",
- (getter)RenderData_getActiveLayer, (setter)RenderData_setActiveLayer,
- "Active rendering layer",
- NULL},
- {"renderLayers",
- (getter)RenderData_getRenderLayers, (setter)NULL,
- "Active rendering layer",
- NULL},
-
- {"halfFloat",
- (getter)RenderData_getSubImTypeBits, (setter)RenderData_setSubImTypeBits,
- "'Half' openexr option enabled",
- (void *)R_OPENEXR_HALF},
- {"zbuf",
- (getter)RenderData_getSubImTypeBits, (setter)RenderData_setSubImTypeBits,
- "'ZBuf' openexr option enabled",
- (void *)R_OPENEXR_ZBUF},
- {"preview",
- (getter)RenderData_getSubImTypeBits, (setter)RenderData_setSubImTypeBits,
- "'preview' openexr option enabled",
- (void *)R_PREVIEW_JPG},
-
- {"yafrayGIMethod",
- (getter)RenderData_getYafrayGIMethod, (setter)RenderData_setYafrayGIMethod,
- "Global illumination method",
- NULL},
- {"yafrayGIQuality",
- (getter)RenderData_getYafrayGIQuality, (setter)RenderData_setYafrayGIQuality,
- "Global Illumination quality",
- NULL},
- {"yafrayExportToXML",
- (getter)RenderData_getYafrayExportToXML, (setter)RenderData_setYafrayExportToXML,
- "If true export to an xml file and call yafray instead of plugin",
- NULL},
- {"yafrayAutoAntiAliasing",
- (getter)RenderData_getYafrayAutoAntiAliasing, (setter)RenderData_setYafrayAutoAntiAliasing,
- "Automatic anti-aliasing enabled/disabled",
- NULL},
- {"yafrayClampRGB",
- (getter)RenderData_getYafrayClampRGB, (setter)RenderData_setYafrayClampRGB,
- "Clamp RGB enabled/disabled",
- NULL},
- {"yafrayAntiAliasingPasses",
- (getter)RenderData_getYafrayAntiAliasingPasses, (setter)RenderData_setYafrayAntiAliasingPasses,
- "Number of anti-aliasing passes (0 is no anti-aliasing)",
- NULL},
- {"yafrayAntiAliasingSamples",
- (getter)RenderData_getYafrayAntiAliasingSamples, (setter)RenderData_setYafrayAntiAliasingSamples,
- "Number of samples per pass",
- NULL},
- {"yafrayAntiAliasingPixelSize",
- (getter)RenderData_getYafrayAntiAliasingPixelSize, (setter)RenderData_setYafrayAntiAliasingPixelSize,
- "Anti-aliasing pixel filter size",
- NULL},
- {"yafrayAntiAliasingThreshold",
- (getter)RenderData_getYafrayAntiAliasingThreshold, (setter)RenderData_setYafrayAntiAliasingThreshold,
- "Anti-aliasing threshold",
- NULL},
- {"yafrayGICache",
- (getter)RenderData_getYafrayGICache, (setter)RenderData_setYafrayGICache,
- "Cache occlusion/irradiance samples (faster)",
- NULL},
- {"yafrayGICacheBumpNormals",
- (getter)RenderData_getYafrayGICacheBumpNormals, (setter)RenderData_setYafrayGICacheBumpNormals,
- "Enable/disable bumpnormals for cache",
- NULL},
- {"yafrayGICacheShadowQuality",
- (getter)RenderData_getYafrayGICacheShadowQuality, (setter)RenderData_setYafrayGICacheShadowQuality,
- "Shadow quality, keep it under 0.95 :-)",
- NULL},
- {"yafrayGICachePixelsPerSample",
- (getter)RenderData_getYafrayGICachePixelsPerSample, (setter)RenderData_setYafrayGICachePixelsPerSample,
- "Maximum number of pixels without samples, the lower the better and slower",
- NULL},
- {"yafrayGICacheRefinement",
- (getter)RenderData_getYafrayGICacheRefinement, (setter)RenderData_setYafrayGICacheRefinement,
- "Threshold to refine shadows EXPERIMENTAL. 1 = no refinement",
- NULL},
- {"yafrayGIPhotons",
- (getter)RenderData_getYafrayGIPhotons, (setter)RenderData_setYafrayGIPhotons,
- "Enable/disable use of global photons to help in GI",
- NULL},
- {"yafrayGITunePhotons",
- (getter)RenderData_getYafrayGITunePhotons, (setter)RenderData_setYafrayGITunePhotons,
- "If true the photonmap is shown directly in the render for tuning",
- NULL},
-
- /* Bake stuff */
- {"bakeClear",
- (getter)RenderData_getBakeMode, (setter)RenderData_setBakeMode,
- "Clear the image before baking",
- (void *)R_BAKE_CLEAR},
- {"bakeToActive",
- (getter)RenderData_getBakeMode, (setter)RenderData_setBakeMode,
- "Bake selection to active",
- (void *)R_BAKE_TO_ACTIVE},
- {"bakeNormalize",
- (getter)RenderData_getBakeMode, (setter)RenderData_setBakeMode,
- "Normalize AO and displacement to the dist range",
- (void *)R_BAKE_NORMALIZE},
- {"bakeMargin",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "number of pixels to use as a margin for the edges of the image",
- (void *)EXPP_RENDER_ATTR_BAKEMARGIN},
- {"bakeMode",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "The mode for baking, see Blender.Scene.Render.BakeModes",
- (void *)EXPP_RENDER_ATTR_BAKEMODE},
- {"bakeNormalSpace",
- (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp,
- "The mode for baking, see Blender.Scene.Render.BakeNormalSpaceModes",
- (void *)EXPP_RENDER_ATTR_BAKENORMALSPACE},
- {"bakeDist",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Distance (in blender units)",
- (void *)EXPP_RENDER_ATTR_BAKEDIST},
- {"bakeBias",
- (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp,
- "Bias towards faces further away from the object (in blender units)",
- (void *)EXPP_RENDER_ATTR_BAKEDIST},
- {NULL,NULL,NULL,NULL,NULL}
-};
-
-/***************************************************************************/
-/* BPy_RenderData method def */
-/***************************************************************************/
-static PyMethodDef BPy_RenderData_methods[] = {
- {"render", ( PyCFunction ) RenderData_Render, METH_NOARGS,
- "() - render the scene"},
- {"bake", ( PyCFunction ) RenderData_Bake, METH_NOARGS,
- "() - bake current selection"},
- {"saveRenderedImage", (PyCFunction)RenderData_SaveRenderedImage, METH_VARARGS,
- "(filename) - save an image generated by a call to render() (set output path first)"},
- {"renderAnim", ( PyCFunction ) RenderData_RenderAnim, METH_NOARGS,
- "() - render a sequence from start frame to end frame"},
- {"play", ( PyCFunction ) RenderData_Play, METH_NOARGS,
- "() - play animation of rendered images/avi (searches Pics: field)"},
- {"setRenderPath", ( PyCFunction ) RenderData_SetRenderPath,
- METH_VARARGS,
- "(string) - get/set the path to output the rendered images to"},
- {"getRenderPath", ( PyCFunction ) RenderData_getRenderPath,
- METH_NOARGS,
- "() - get the path to directory where rendered images will go"},
- {"getFrameFilename", ( PyCFunction ) RenderData_getFrameFilename,
- METH_VARARGS,
- "() - get the filename of the frame this will be rendered, taking into account extension and frame range"},
- {"setBackbufPath", ( PyCFunction ) RenderData_SetBackbufPath,
- METH_VARARGS,
- "(string) - get/set the path to a background image and load it"},
- {"getBackbufPath", ( PyCFunction ) RenderData_getBackbufPath,
- METH_NOARGS,
- "() - get the path to background image file"},
- {"enableBackbuf", ( PyCFunction ) RenderData_EnableBackbuf,
- METH_VARARGS,
- "(bool) - enable/disable the backbuf image"},
- {"enableExtensions", ( PyCFunction ) RenderData_EnableExtensions,
- METH_VARARGS,
- "(bool) - enable/disable windows extensions for output files"},
- {"enableSequencer", ( PyCFunction ) RenderData_EnableSequencer,
- METH_VARARGS,
- "(bool) - enable/disable Do Sequence"},
- {"enableRenderDaemon", ( PyCFunction ) RenderData_EnableRenderDaemon,
- METH_VARARGS,
- "(bool) - enable/disable Scene daemon"},
- {"enableToonShading", ( PyCFunction ) RenderData_EnableToonShading,
- METH_VARARGS,
- "(bool) - enable/disable Edge rendering"},
- {"edgeIntensity", ( PyCFunction ) RenderData_EdgeIntensity,
- METH_VARARGS,
- "(int) - get/set edge intensity for toon shading"},
- {"setEdgeColor", ( PyCFunction ) RenderData_SetEdgeColor, METH_VARARGS,
- "(f,f,f) - set the edge color for toon shading - Red,Green,Blue expected."},
- {"getEdgeColor", ( PyCFunction ) RenderData_GetEdgeColor, METH_NOARGS,
- "() - get the edge color for toon shading - Red,Green,Blue expected."},
- {"enableOversampling", ( PyCFunction ) RenderData_EnableOversampling,
- METH_VARARGS,
- "(bool) - enable/disable oversampling (anit-aliasing)."},
- {"setOversamplingLevel",
- ( PyCFunction ) RenderData_SetOversamplingLevel, METH_VARARGS,
- "(enum) - get/set the level of oversampling (anit-aliasing)."},
- {"enableMotionBlur", ( PyCFunction ) RenderData_EnableMotionBlur,
- METH_VARARGS,
- "(bool) - enable/disable MBlur."},
- {"motionBlurLevel", ( PyCFunction ) RenderData_MotionBlurLevel,
- METH_VARARGS,
- "(float) - get/set the length of shutter time for motion blur."},
- {"partsX", ( PyCFunction ) RenderData_PartsX, METH_VARARGS,
- "(int) - get/set the number of parts to divide the render in the X direction"},
- {"partsY", ( PyCFunction ) RenderData_PartsY, METH_VARARGS,
- "(int) - get/set the number of parts to divide the render in the Y direction"},
- {"enableSky", ( PyCFunction ) RenderData_EnableSky, METH_NOARGS,
- "() - enable render background with sky"},
- {"enablePremultiply", ( PyCFunction ) RenderData_EnablePremultiply,
- METH_NOARGS,
- "() - enable premultiply alpha"},
- {"enableKey", ( PyCFunction ) RenderData_EnableKey, METH_NOARGS,
- "() - enable alpha and color values remain unchanged"},
- {"enableShadow", ( PyCFunction ) RenderData_EnableShadow, METH_VARARGS,
- "(bool) - enable/disable shadow calculation"},
- {"enablePanorama", ( PyCFunction ) RenderData_EnablePanorama,
- METH_VARARGS,
- "(bool) - enable/disable panorama rendering (output width is multiplied by Xparts)"},
- {"enableEnvironmentMap",
- ( PyCFunction ) RenderData_EnableEnvironmentMap, METH_VARARGS,
- "(bool) - enable/disable environment map rendering"},
- {"enableRayTracing", ( PyCFunction ) RenderData_EnableRayTracing,
- METH_VARARGS,
- "(bool) - enable/disable ray tracing"},
- {"enableRadiosityRender",
- ( PyCFunction ) RenderData_EnableRadiosityRender, METH_VARARGS,
- "(bool) - enable/disable radiosity rendering"},
- {"getRenderWinSize", ( PyCFunction ) RenderData_getRenderWinSize,
- METH_NOARGS,
- "() - get the size of the render window"},
- {"setRenderWinSize", ( PyCFunction ) RenderData_SetRenderWinSize,
- METH_VARARGS,
- "(int) - set the size of the render window"},
- {"enableFieldRendering",
- ( PyCFunction ) RenderData_EnableFieldRendering, METH_VARARGS,
- "(bool) - enable/disable field rendering"},
- {"enableOddFieldFirst", ( PyCFunction ) RenderData_EnableOddFieldFirst,
- METH_VARARGS,
- "(bool) - enable/disable Odd field first rendering (Default: Even field)"},
- {"enableFieldTimeDisable",
- ( PyCFunction ) RenderData_EnableFieldTimeDisable, METH_VARARGS,
- "(bool) - enable/disable time difference in field calculations"},
- {"enableGaussFilter", ( PyCFunction ) RenderData_EnableGaussFilter,
- METH_VARARGS,
- "(bool) - enable/disable Gauss sampling filter for antialiasing"},
- {"enableBorderRender", ( PyCFunction ) RenderData_EnableBorderRender,
- METH_VARARGS,
- "(bool) - enable/disable small cut-out rendering"},
- {"setBorder", ( PyCFunction ) RenderData_SetBorder, METH_VARARGS,
- "(f,f,f,f) - set the border for border rendering"},
- {"gaussFilterSize", ( PyCFunction ) RenderData_GaussFilterSize,
- METH_VARARGS,
- "(float) - get/sets the Gauss filter size"},
- {"startFrame", ( PyCFunction ) RenderData_StartFrame, METH_VARARGS,
- "(int) - get/set the starting frame for rendering"},
- {"currentFrame", ( PyCFunction ) RenderData_CurrentFrame, METH_VARARGS,
- "(int) - get/set the current frame for rendering"},
- {"endFrame", ( PyCFunction ) RenderData_EndFrame, METH_VARARGS,
- "(int) - get/set the ending frame for rendering"},
- {"getTimeCode", ( PyCFunction ) RenderData_getTimeCode, METH_NOARGS,
- "get the current frame in HH:MM:SS:FF format"},
- {"imageSizeX", ( PyCFunction ) RenderData_ImageSizeX, METH_VARARGS,
- "(int) - get/set the image width in pixels"},
- {"imageSizeY", ( PyCFunction ) RenderData_ImageSizeY, METH_VARARGS,
- "(int) - get/set the image height in pixels"},
- {"aspectRatioX", ( PyCFunction ) RenderData_AspectRatioX, METH_VARARGS,
- "(int) - get/set the horizontal aspect ratio"},
- {"aspectRatioY", ( PyCFunction ) RenderData_AspectRatioY, METH_VARARGS,
- "(int) - get/set the vertical aspect ratio"},
- {"setRenderer", ( PyCFunction ) RenderData_SetRenderer, METH_VARARGS,
- "(enum) - get/set which renderer to render the output"},
- {"enableCropping", ( PyCFunction ) RenderData_EnableCropping,
- METH_VARARGS,
- "(bool) - enable/disable exclusion of border rendering from total image"},
- {"setImageType", ( PyCFunction ) RenderData_SetImageType, METH_VARARGS,
- "(enum) - get/set the type of image to output from the render"},
- {"quality", ( PyCFunction ) RenderData_Quality, METH_VARARGS,
- "(int) - get/set quality get/setting for JPEG images, AVI Jpeg and SGI movies"},
- {"framesPerSec", ( PyCFunction ) RenderData_FramesPerSec, METH_VARARGS,
- "(int) - get/set frames per second"},
- {"enableGrayscale", ( PyCFunction ) RenderData_EnableGrayscale,
- METH_NOARGS,
- "() - images are saved with BW (grayscale) data"},
- {"enableRGBColor", ( PyCFunction ) RenderData_EnableRGBColor,
- METH_NOARGS,
- "() - images are saved with RGB (color) data"},
- {"enableRGBAColor", ( PyCFunction ) RenderData_EnableRGBAColor,
- METH_NOARGS,
- "() - images are saved with RGB and Alpha data (if supported)"},
- {"sizePreset", ( PyCFunction ) RenderData_SizePreset, METH_VARARGS,
- "(enum) - get/set the render to one of a few preget/sets"},
- {"setYafrayGIQuality", ( PyCFunction ) RenderData_SetYafrayGIQuality,
- METH_VARARGS,
- "(enum) - set yafray global Illumination quality"},
- {"getYafrayGIQuality", ( PyCFunction ) RenderData_GetYafrayGIQuality,
- METH_VARARGS,
- "(enum) - get yafray global Illumination quality"},
- {"setYafrayGIMethod", ( PyCFunction ) RenderData_SetYafrayGIMethod,
- METH_VARARGS,
- "(enum) - set yafray global Illumination method"},
- {"getYafrayGIMethod", ( PyCFunction ) RenderData_GetYafrayGIMethod,
- METH_VARARGS,
- "(enum) - get yafray global Illumination method"},
- {"yafrayGIPower", ( PyCFunction ) RenderData_YafrayGIPower,
- METH_VARARGS,
- "(float) - get/set GI lighting intensity scale"},
- {"yafrayGIIndirPower", ( PyCFunction ) RenderData_YafrayGIIndirPower,
- METH_VARARGS,
- "(float) - get/set GI indifect lighting intensity scale"},
- {"yafrayGIDepth", ( PyCFunction ) RenderData_YafrayGIDepth,
- METH_VARARGS,
- "(int) - get/set number of bounces of the indirect light"},
- {"yafrayGICDepth", ( PyCFunction ) RenderData_YafrayGICDepth,
- METH_VARARGS,
- "(int) - get/set number of bounces inside objects (for caustics)"},
- {"enableYafrayGICache", ( PyCFunction ) RenderData_EnableYafrayGICache,
- METH_VARARGS,
- "(bool) - enable/disable cache irradiance samples (faster)"},
- {"enableYafrayGIPhotons",
- ( PyCFunction ) RenderData_EnableYafrayGIPhotons, METH_VARARGS,
- "(bool) - enable/disable use global photons to help in GI"},
- {"yafrayGIPhotonCount", ( PyCFunction ) RenderData_YafrayGIPhotonCount,
- METH_VARARGS,
- "(int) - get/set number of photons to shoot"},
- {"yafrayGIPhotonRadius",
- ( PyCFunction ) RenderData_YafrayGIPhotonRadius, METH_VARARGS,
- "(float) - get/set radius to search for photons to mix (blur)"},
- {"yafrayGIPhotonMixCount",
- ( PyCFunction ) RenderData_YafrayGIPhotonMixCount, METH_VARARGS,
- "(int) - get/set number of photons to mix"},
- {"enableYafrayGITunePhotons",
- ( PyCFunction ) RenderData_EnableYafrayGITunePhotons, METH_VARARGS,
- "(bool) - enable/disable show the photonmap directly in the render for tuning"},
- {"yafrayGIShadowQuality",
- ( PyCFunction ) RenderData_YafrayGIShadowQuality, METH_VARARGS,
- "(float) - get/set the shadow quality, keep it under 0.95"},
- {"yafrayGIPixelsPerSample",
- ( PyCFunction ) RenderData_YafrayGIPixelsPerSample, METH_VARARGS,
- "(int) - get/set maximum number of pixels without samples, the lower the better and slower"},
- {"yafrayGIRefinement", ( PyCFunction ) RenderData_YafrayGIRefinement,
- METH_VARARGS,
- "(float) - get/setthreshold to refine shadows EXPERIMENTAL. 1 = no refinement"},
- {"yafrayRayBias", ( PyCFunction ) RenderData_YafrayRayBias,
- METH_VARARGS,
- "(float) - get/set shadow ray bias to avoid self shadowing"},
- {"yafrayRayDepth", ( PyCFunction ) RenderData_YafrayRayDepth,
- METH_VARARGS,
- "(int) - get/set maximum render ray depth from the camera"},
- {"yafrayGamma", ( PyCFunction ) RenderData_YafrayGamma, METH_VARARGS,
- "(float) - get/set gamma correction, 1 is off"},
- {"yafrayExposure", ( PyCFunction ) RenderData_YafrayExposure,
- METH_VARARGS,
- "(float) - get/set exposure adjustment, 0 is off"},
- {"enableGameFrameStretch",
- ( PyCFunction ) RenderData_EnableGameFrameStretch, METH_NOARGS,
- "(l) - enble stretch or squeeze the viewport to fill the display window"},
- {"enableGameFrameExpose",
- ( PyCFunction ) RenderData_EnableGameFrameExpose, METH_NOARGS,
- "(l) - enable show the entire viewport in the display window, viewing more horizontally or vertically"},
- {"enableGameFrameBars", ( PyCFunction ) RenderData_EnableGameFrameBars,
- METH_NOARGS,
- "() - enable show the entire viewport in the display window, using bar horizontally or vertically"},
- {"setGameFrameColor", ( PyCFunction ) RenderData_SetGameFrameColor,
- METH_VARARGS,
- "(f,f,f) - set the red, green, blue component of the bars"},
- {"getGameFrameColor", ( PyCFunction ) RenderData_GetGameFrameColor,
- METH_NOARGS,
- "() - get the red, green, blue component of the bars"},
- {"SGIMaxsize", ( PyCFunction ) RenderData_SGIMaxsize, METH_VARARGS,
- "(int) - get/set maximum size per frame to save in an SGI movie"},
- {"enableSGICosmo", ( PyCFunction ) RenderData_EnableSGICosmo,
- METH_VARARGS,
- "(bool) - enable/disable attempt to save SGI movies using Cosmo hardware"},
- {"oldMapValue", ( PyCFunction ) RenderData_OldMapValue, METH_VARARGS,
- "(int) - get/set specify old map value in frames"},
- {"newMapValue", ( PyCFunction ) RenderData_NewMapValue, METH_VARARGS,
- "(int) - get/set specify new map value in frames"},
- /* renderlayers */
- {"addRenderLayer", ( PyCFunction ) RenderData_addRenderLayer, METH_VARARGS,
- "(string) - add a new render layer"},
- {"removeRenderLayer", ( PyCFunction ) RenderData_removeRenderLayer, METH_O,
- "(renderLayer) - remove a render layer from this scene"},
- {NULL, NULL, 0, NULL}
-};
-
-/*------------------------------------BPy_RenderData Type defintion------ */
-PyTypeObject RenderData_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender RenderData", /* char *tp_name; */
- sizeof( BPy_RenderData ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) RenderData_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_RenderData_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_RenderData_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-
-/* render layers */
-
-static PyObject *RenderLayer_repr( BPy_RenderLayer * self )
-{
- if( self->renderLayer )
- return PyString_FromFormat( "[RenderLayer \"%s\"]",
- self->renderLayer->name );
- else
- return PyString_FromString( "NULL" );
-}
-
-static PyObject *RenderLayer_getName( BPy_RenderLayer * self )
-{
- if( !self->renderLayer )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- return PyString_FromString( self->renderLayer->name );
-}
-
-static int RenderLayer_setName( BPy_RenderLayer * self, PyObject *value )
-{
- char *name = NULL;
- int index = BLI_findindex(&self->scene->r.layers, self->renderLayer);
-
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- /* No check for doubles? - blender dosnt so we dont have to! */
- BLI_strncpy( self->renderLayer->name, name, sizeof( self->renderLayer->name ) );
-
- if(self->scene->nodetree) {
- bNode *node;
- for(node= self->scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==index)
- BLI_strncpy(node->name, self->renderLayer->name, NODE_MAXSTR);
- }
- }
- }
-
- return 0;
-}
-
-static PyObject *RenderLayer_getLightGroup( BPy_RenderLayer * self )
-{
- if( !self->renderLayer )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This render layer has been removed!" );
- return Group_CreatePyObject( self->renderLayer->light_override );
-}
-static int RenderLayer_setLightGroup( BPy_RenderLayer * self, PyObject * value )
-{
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
- return GenericLib_assignData(value, (void **) &self->renderLayer->light_override, NULL, 1, ID_GR, 0);
-}
-
-
-/*****************************************************************************/
-/* Python BPy_Render getsetattr funcs: */
-/*****************************************************************************/
-static int RenderLayer_setLayers( BPy_RenderLayer * self, PyObject * value, void *zlay )
-{
- unsigned int laymask = 0;
-
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an integer (bitmask) as argument" );
-
- laymask = ( unsigned int )PyInt_AS_LONG( value );
-
- if((laymask < 0) || (!zlay && laymask == 0))
- return EXPP_ReturnIntError( PyExc_ValueError,
- "layer value too low" );
-
- if (zlay) {
- self->renderLayer->lay_zmask= laymask & ((1<<20) - 1);
- } else {
- self->renderLayer->lay= laymask & ((1<<20) - 1);
- }
- return 0;
-}
-
-static PyObject *RenderLayer_getLayers( BPy_RenderLayer * self, void *zlay )
-{
- if (zlay) {
- return PyInt_FromLong( self->renderLayer->lay_zmask );
- } else {
- return PyInt_FromLong( self->renderLayer->lay );
- }
-}
-
-static PyObject *RenderLayer_getLayflagBits( BPy_RenderLayer *self, void *type )
-{
- int itype = (int)type;
- if( !self->renderLayer )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- /* use negative numbers to flip truth */
- if (self->renderLayer->lay & itype) Py_RETURN_TRUE;
- else Py_RETURN_FALSE;
-}
-
-static int RenderLayer_setLayflagBits( BPy_RenderLayer *self, PyObject *value,
- void *type )
-{
- /* use negative numbers to flip truth */
- int param = PyObject_IsTrue( value );
-
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param) {
- self->renderLayer->lay |= (int)type;
- } else {
- self->renderLayer->lay &= ~(int)type;
- }
- return 0;
-}
-
-static PyObject *RenderLayer_getPassBits( BPy_RenderLayer *self, void *type )
-{
- int itype = (int)type;
- if( !self->renderLayer )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- /* use negative numbers to flip truth */
- if (self->renderLayer->passflag & itype) Py_RETURN_TRUE;
- else Py_RETURN_FALSE;
-}
-
-static int RenderLayer_setPassBits( BPy_RenderLayer *self, PyObject *value,
- void *type )
-{
- /* use negative numbers to flip truth */
- int param = PyObject_IsTrue( value );
-
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param) {
- self->renderLayer->passflag |= ((int)type);
- } else {
- self->renderLayer->passflag &= ~((int)type);
- }
- return 0;
-}
-
-static PyObject *RenderLayer_getPassXorBits( BPy_RenderLayer *self, void *type )
-{
- if( !self->renderLayer )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- /* use negative numbers to flip truth */
- if (self->renderLayer->pass_xor & (int)type) Py_RETURN_TRUE;
- else Py_RETURN_FALSE;
-}
-
-static int RenderLayer_setPassXorBits( BPy_RenderLayer *self, PyObject *value,
- void *type )
-{
- int param = PyObject_IsTrue( value );
-
- if( !self->renderLayer )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This render layer has been removed!" );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param) {
- self->renderLayer->passflag |= (int)type;
- } else {
- self->renderLayer->passflag &= ~(int)type;
- }
- return 0;
-}
-
-/***************************************************************************/
-/* BPy_RenderData attribute def */
-/***************************************************************************/
-static PyGetSetDef BPy_RenderLayer_getseters[] = {
- {"name",
- (getter)RenderLayer_getName, (setter)RenderLayer_setName,
- "",
- (void *)NULL},
- {"lightGroup",
- (getter)RenderLayer_getLightGroup, (setter)RenderLayer_setLightGroup,
- "",
- (void *)NULL},
- /*{"material",
- (getter)RenderLayer_getMaterial, (setter)RenderLayer_setMaterial,
- "",
- (void *)NULL},*/
- {"enable",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "enable this render layer",
- (void *)SCE_LAY_DISABLE},
- {"enableZMask",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Only render what's in front of the solid z values",
- (void *)SCE_LAY_ZMASK},
- {"enableZMaskAll",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Fill in Z values for solid faces in invisible layers, for masking",
- (void *)SCE_LAY_ALL_Z},
-
- {"enableSolid",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Solid faces in this Layer",
- (void *)SCE_LAY_SOLID},
- {"enableZTra",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Z-Transparent faces in this Layer (On top of Solid and Halos)",
- (void *)SCE_LAY_ZTRA},
- {"enableHalo",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Halos in this Layer (on top of Solid)",
- (void *)SCE_LAY_HALO},
- {"enableEdge",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Edge-enhance in this Layer (only works for Solid faces)",
- (void *)SCE_LAY_EDGE},
- {"enableSky",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Sky or backbuffer in this Layer",
- (void *)SCE_LAY_SKY},
- {"enableStrand",
- (getter)RenderLayer_getLayflagBits, (setter)RenderLayer_setLayflagBits,
- "Render Strands in this Layer",
- (void *)SCE_LAY_STRAND},
-
- {"layerMask",
- (getter)RenderLayer_getLayers, (setter)RenderLayer_setLayers,
- "",
- (void *)0},
- {"zLayerMask",
- (getter)RenderLayer_getLayers, (setter)RenderLayer_setLayers,
- "",
- (void *)1},
-
- /* passes */
- {"passCombined",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver full combined RGBA buffer",
- (void *)SCE_PASS_COMBINED},
- {"passZ",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Z values pass",
- (void *)SCE_PASS_Z},
- {"passSpeed",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Speed Vector pass",
- (void *)SCE_PASS_VECTOR},
- {"passNormal",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Normal pass",
- (void *)SCE_PASS_NORMAL},
- {"passUV",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Texture UV pass",
- (void *)SCE_PASS_UV},
- {"passMist",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Mist factor pass (0-1)",
- (void *)SCE_PASS_MIST},
- {"passIndex",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Object Index pass",
- (void *)SCE_PASS_INDEXOB},
- {"passColor",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver shade-less Color pass",
- (void *)SCE_PASS_RGBA},
- {"passDiffuse",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Diffuse pass",
- (void *)SCE_PASS_DIFFUSE},
- {"passSpecular",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Specular pass",
- (void *)SCE_PASS_SPEC},
- {"passShadow",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Shadow pass",
- (void *)SCE_PASS_SHADOW},
- {"passAO",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver AO pass",
- (void *)SCE_PASS_AO},
- {"passReflect",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Raytraced Reflection pass",
- (void *)SCE_PASS_REFLECT},
- {"passRefract",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Raytraced Reflection pass",
- (void *)SCE_PASS_REFRACT},
- {"passRadiosity",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Radiosity pass",
- (void *)SCE_PASS_RADIO},
-
- /* xor */
- {"passSpecularXOR",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Specular pass XOR",
- (void *)SCE_PASS_SPEC},
- {"passShadowXOR",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver Shadow pass XOR",
- (void *)SCE_PASS_SHADOW},
- {"passAOXOR",
- (getter)RenderLayer_getPassBits, (setter)RenderLayer_setPassBits,
- "Deliver AO pass XOR",
- (void *)SCE_PASS_AO},
- {"passRefractXOR",
- (getter)RenderLayer_getPassXorBits, (setter)RenderLayer_setPassXorBits,
- "Deliver Raytraced Reflection pass XOR",
- (void *)SCE_PASS_REFRACT},
- {"passRadiosityXOR",
- (getter)RenderLayer_getPassXorBits, (setter)RenderLayer_setPassXorBits,
- "Deliver Radiosity pass XOR",
- (void *)SCE_PASS_RADIO},
-
- {NULL,NULL,NULL,NULL,NULL}
-};
-
-/* no methods */
-
-/*------------------------------------BPy_RenderData Type defintion------ */
-PyTypeObject RenderLayer_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender RenderLayer", /* char *tp_name; */
- sizeof( BPy_RenderLayer ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL, /* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) RenderLayer_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- NULL, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_RenderLayer_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-/***************************************************************************/
-/* BPy_RenderData Callbacks */
-/***************************************************************************/
-
-PyObject *RenderLayer_CreatePyObject( struct Scene * scene, struct SceneRenderLayer * renderLayer )
-{
- BPy_RenderLayer *py_renderlayer;
-
- py_renderlayer =
- ( BPy_RenderLayer * ) PyObject_NEW( BPy_RenderLayer,
- &RenderLayer_Type );
-
- if( py_renderlayer == NULL ) {
- return ( NULL );
- }
- py_renderlayer->renderLayer = renderLayer;
- py_renderlayer->scene = scene;
-
- return ( ( PyObject * ) py_renderlayer );
-}
-
-
-/***************************************************************************/
-/* Render method def */
-/***************************************************************************/
-struct PyMethodDef M_Render_methods[] = {
- {"CloseRenderWindow", ( PyCFunction ) M_Render_CloseRenderWindow,
- METH_NOARGS,
- "() - close the rendering window"},
- {"EnableDispView", ( PyCFunction ) M_Render_EnableDispView,
- METH_NOARGS,
- "(bool) - enable Sceneing in view"},
- {"EnableDispWin", ( PyCFunction ) M_Render_EnableDispWin, METH_NOARGS,
- "(bool) - enable Sceneing in new window"},
- {"SetRenderWinPos", ( PyCFunction ) M_Render_SetRenderWinPos,
- METH_VARARGS,
- "([string list]) - position the rendering window in around the edge of the screen"},
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *M_Render_ModesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "OSA", PyInt_FromLong( R_OSA ) );
- PyConstant_Insert( d, "SHADOW", PyInt_FromLong( R_SHADOW ) );
- PyConstant_Insert( d, "GAMMA", PyInt_FromLong( R_GAMMA ) );
- PyConstant_Insert( d, "ENVMAP", PyInt_FromLong( R_ENVMAP ) );
- PyConstant_Insert( d, "TOONSHADING", PyInt_FromLong( R_EDGE ) );
- PyConstant_Insert( d, "FIELDRENDER", PyInt_FromLong( R_FIELDS ) );
- PyConstant_Insert( d, "FIELDTIME", PyInt_FromLong( R_FIELDSTILL ) );
- PyConstant_Insert( d, "RADIOSITY", PyInt_FromLong( R_RADIO ) );
- PyConstant_Insert( d, "BORDER_RENDER", PyInt_FromLong( R_BORDER ) );
- PyConstant_Insert( d, "PANORAMA", PyInt_FromLong( R_PANORAMA ) );
- PyConstant_Insert( d, "CROP", PyInt_FromLong( R_CROP ) );
- PyConstant_Insert( d, "ODDFIELD", PyInt_FromLong( R_ODDFIELD ) );
- PyConstant_Insert( d, "MBLUR", PyInt_FromLong( R_MBLUR ) );
- PyConstant_Insert( d, "RAYTRACING", PyInt_FromLong( R_RAYTRACE ) );
- PyConstant_Insert( d, "FIXEDTHREADS", PyInt_FromLong( R_FIXED_THREADS ) );
- }
- return M;
-}
-
-static PyObject *M_Render_SceModesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "SEQUENCER", PyInt_FromLong( R_DOSEQ ) );
- PyConstant_Insert( d, "EXTENSION", PyInt_FromLong( R_EXTENSION ) );
- }
- return M;
-}
-
-static PyObject *M_Render_GameFramingDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "BARS",
- PyInt_FromLong( SCE_GAMEFRAMING_BARS ) );
- PyConstant_Insert( d, "EXTEND",
- PyInt_FromLong( SCE_GAMEFRAMING_EXTEND ) );
- PyConstant_Insert( d, "SCALE",
- PyInt_FromLong( SCE_GAMEFRAMING_SCALE ) );
- }
- return M;
-}
-
-static PyObject *M_Render_BakeModesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
-
- PyConstant_Insert( d, "LIGHT", PyInt_FromLong( RE_BAKE_LIGHT ) );
- PyConstant_Insert( d, "ALL", PyInt_FromLong( RE_BAKE_ALL ) );
- PyConstant_Insert( d, "AO", PyInt_FromLong( RE_BAKE_AO ) );
- PyConstant_Insert( d, "NORMALS", PyInt_FromLong( RE_BAKE_NORMALS ) );
- PyConstant_Insert( d, "TEXTURE", PyInt_FromLong( RE_BAKE_TEXTURE ) );
- PyConstant_Insert( d, "DISPLACEMENT", PyInt_FromLong( RE_BAKE_DISPLACEMENT ) );
- PyConstant_Insert( d, "SHADOW", PyInt_FromLong( RE_BAKE_SHADOW ) );
- }
- return M;
-}
-
-
-static PyObject *M_Render_BakeNormalSpaceDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
-
- PyConstant_Insert( d, "CAMERA", PyInt_FromLong( R_BAKE_SPACE_CAMERA ) );
- PyConstant_Insert( d, "WORLD", PyInt_FromLong( R_BAKE_SPACE_WORLD ) );
- PyConstant_Insert( d, "OBJECT", PyInt_FromLong( R_BAKE_SPACE_OBJECT ) );
- PyConstant_Insert( d, "TANGENT", PyInt_FromLong( R_BAKE_SPACE_TANGENT ) );
- }
- return M;
-}
-
-/***************************************************************************/
-/* Render Module Init */
-/***************************************************************************/
-PyObject *Render_Init( void )
-{
- PyObject *submodule;
- PyObject *ModesDict = M_Render_ModesDict( );
- PyObject *SceModesDict = M_Render_SceModesDict( );
- PyObject *GFramingDict = M_Render_GameFramingDict( );
- PyObject *BakeModesDict = M_Render_BakeModesDict( );
- PyObject *BakeNormalSpaceDict = M_Render_BakeNormalSpaceDict( );
-
- if( PyType_Ready( &RenderData_Type ) < 0 )
- return NULL;
-
- if( PyType_Ready( &RenderLayer_Type ) < 0 )
- return NULL;
-
- submodule = Py_InitModule3( "Blender.Scene.Render",
- M_Render_methods, M_Render_doc );
-
- if( ModesDict )
- PyModule_AddObject( submodule, "Modes", ModesDict );
- if( SceModesDict )
- PyModule_AddObject( submodule, "SceModes", SceModesDict );
- if( GFramingDict )
- PyModule_AddObject( submodule, "FramingModes", GFramingDict );
- if( BakeModesDict )
- PyModule_AddObject( submodule, "BakeModes", BakeModesDict );
- if( BakeNormalSpaceDict )
- PyModule_AddObject( submodule, "BakeNormalSpaceModes", BakeNormalSpaceDict );
-
- /* ugh: why aren't these in a constant dict? */
-
- PyModule_AddIntConstant( submodule, "INTERNAL", R_INTERN );
- PyModule_AddIntConstant( submodule, "YAFRAY", R_YAFRAY );
- PyModule_AddIntConstant( submodule, "AVIRAW", R_AVIRAW );
- PyModule_AddIntConstant( submodule, "AVIJPEG", R_AVIJPEG );
- PyModule_AddIntConstant( submodule, "AVICODEC", R_AVICODEC );
- PyModule_AddIntConstant( submodule, "QUICKTIME", R_QUICKTIME );
- PyModule_AddIntConstant( submodule, "TARGA", R_TARGA );
- PyModule_AddIntConstant( submodule, "RAWTGA", R_RAWTGA );
- PyModule_AddIntConstant( submodule, "HDR", R_RADHDR );
- PyModule_AddIntConstant( submodule, "PNG", R_PNG );
- PyModule_AddIntConstant( submodule, "BMP", R_BMP );
- PyModule_AddIntConstant( submodule, "JPEG", R_JPEG90 );
- PyModule_AddIntConstant( submodule, "HAMX", R_HAMX );
- PyModule_AddIntConstant( submodule, "IRIS", R_IRIS );
- PyModule_AddIntConstant( submodule, "IRISZ", R_IRIZ );
- PyModule_AddIntConstant( submodule, "PAL", B_PR_PAL );
- PyModule_AddIntConstant( submodule, "NTSC", B_PR_NTSC );
- PyModule_AddIntConstant( submodule, "DEFAULT", B_PR_PRESET );
- PyModule_AddIntConstant( submodule, "PREVIEW", B_PR_PRV );
- PyModule_AddIntConstant( submodule, "PC", B_PR_PC );
- PyModule_AddIntConstant( submodule, "PAL169", B_PR_PAL169 );
- PyModule_AddIntConstant( submodule, "PANO", B_PR_PANO );
- PyModule_AddIntConstant( submodule, "FULL", B_PR_FULL );
- PyModule_AddIntConstant( submodule, "NONE", PY_NONE );
- PyModule_AddIntConstant( submodule, "LOW", PY_LOW );
- PyModule_AddIntConstant( submodule, "MEDIUM", PY_MEDIUM );
- PyModule_AddIntConstant( submodule, "HIGH", PY_HIGH );
- PyModule_AddIntConstant( submodule, "HIGHER", PY_HIGHER );
- PyModule_AddIntConstant( submodule, "BEST", PY_BEST );
- PyModule_AddIntConstant( submodule, "USEAOSETTINGS", PY_USEAOSETTINGS );
- PyModule_AddIntConstant( submodule, "SKYDOME", PY_SKYDOME );
- PyModule_AddIntConstant( submodule, "GIFULL", PY_FULL );
- PyModule_AddIntConstant( submodule, "OPENEXR", R_OPENEXR );
- PyModule_AddIntConstant( submodule, "MULTILAYER", R_MULTILAYER );
- PyModule_AddIntConstant( submodule, "TIFF", R_TIFF );
- PyModule_AddIntConstant( submodule, "FFMPEG", R_FFMPEG );
- PyModule_AddIntConstant( submodule, "CINEON", R_CINEON );
- PyModule_AddIntConstant( submodule, "DPX", R_DPX );
-
- return ( submodule );
-}
-
-/***************************************************************************/
-/* BPy_RenderData Callbacks */
-/***************************************************************************/
-
-PyObject *RenderData_CreatePyObject( struct Scene * scene )
-{
- BPy_RenderData *py_renderdata;
-
- py_renderdata =
- ( BPy_RenderData * ) PyObject_NEW( BPy_RenderData,
- &RenderData_Type );
-
- if( py_renderdata == NULL ) {
- return ( NULL );
- }
- py_renderdata->renderContext = &scene->r;
- py_renderdata->scene = scene;
-
- return ( ( PyObject * ) py_renderdata );
-}
-
-/* #####DEPRECATED###### */
-
-static PyObject *RenderData_SetRenderPath( BPy_RenderData *self,
- PyObject *args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setRenderPath );
-}
-
-static PyObject *RenderData_SetBackbufPath( BPy_RenderData *self,
- PyObject *args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setBackbufPath );
-}
-
-static PyObject *RenderData_SetOversamplingLevel( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setOSALevel );
-}
-
-static PyObject *RenderData_SetRenderWinSize( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setRenderWinSize );
-}
-
-static PyObject *RenderData_SetBorder( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapperTuple( (void *)self, args,
- (setter)RenderData_setBorder );
-}
-
-static PyObject *RenderData_SetRenderer( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setRenderer );
-}
-
-static PyObject *RenderData_SetImageType( BPy_RenderData * self,
- PyObject * args )
-{
- return EXPP_setterWrapper( (void *)self, args,
- (setter)RenderData_setImageType );
-}
diff --git a/source/blender/python/api2_2x/sceneRender.h b/source/blender/python/api2_2x/sceneRender.h
deleted file mode 100644
index fffc7916a07..00000000000
--- a/source/blender/python/api2_2x/sceneRender.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_SCENERENDER_H
-#define EXPP_SCENERENDER_H
-
-#include <Python.h>
-#include "DNA_scene_types.h"
-
-PyTypeObject RenderLayer_Type;
-
-#define BPy_RenderData_Check(v) ((v)->ob_type == &RenderData_Type)
-#define BPy_RenderLayer_Check(v) ((v)->ob_type == &RenderLayer_Type)
-
-//------------------------------------Struct definitions-------
-typedef struct {
- PyObject_HEAD
- struct RenderData *renderContext;
- struct Scene *scene;
-} BPy_RenderData;
-
-typedef struct {
- PyObject_HEAD
- struct SceneRenderLayer *renderLayer; /* this is totally weak, pointer can become invalid */
- struct Scene *scene;
-} BPy_RenderLayer;
-
-//------------------------------------Visible prototypes-------
-PyObject *Render_Init( void );
-
-PyObject *RenderData_CreatePyObject( struct Scene *scene );
-PyObject *RenderLayer_CreatePyObject( struct Scene *scene, struct SceneRenderLayer * renderLayer );
-#endif /* EXPP_SCENERENDER_H */
diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c
deleted file mode 100644
index c7daea19fe7..00000000000
--- a/source/blender/python/api2_2x/sceneSequence.c
+++ /dev/null
@@ -1,1406 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "sceneSequence.h" /* This must come first */
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_sequence_types.h"
-#include "DNA_scene_types.h" /* for Base */
-
-#include "BKE_mesh.h"
-#include "BKE_image.h" // RFS: openanim
-#include "BKE_library.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-
-#include "BIF_editseq.h" /* get_last_seq */
-#include "BIF_editsound.h" // RFS: sound_open_hdaudio
-#include "BLI_blenlib.h"
-#include "BSE_sequence.h"
-#include "Ipo.h"
-#include "blendef.h" /* CLAMP */
-#include "BKE_utildefines.h"
-#include "Scene.h"
-#include "Sound.h"
-#include "gen_utils.h"
-
-#include "IMB_imbuf_types.h" // RFS: IB_rect
-#include "IMB_imbuf.h" // RFS: IMB_anim_get_duration
-
-enum seq_consts {
- EXPP_SEQ_ATTR_TYPE = 0,
- EXPP_SEQ_ATTR_CHAN,
- EXPP_SEQ_ATTR_LENGTH,
- EXPP_SEQ_ATTR_START,
- EXPP_SEQ_ATTR_STARTOFS,
- EXPP_SEQ_ATTR_ENDOFS,
- EXPP_SEQ_ATTR_STARTSTILL,
- EXPP_SEQ_ATTR_ENDSTILL
-};
-
-
-/*****************************************************************************/
-/* Python API function prototypes for the Blender module. */
-/*****************************************************************************/
-/*PyObject *M_Sequence_Get( PyObject * self, PyObject * args );*/
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Object module: */
-/*****************************************************************************/
-/*struct PyMethodDef M_Sequence_methods[] = {
- {"Get", ( PyCFunction ) M_Sequence_Get, METH_VARARGS,
-"(name) - return the sequence with the name 'name',\
-returns None if notfound.\nIf 'name' is not specified, it returns a list of all sequences."},
- {NULL, NULL, 0, NULL}
-};*/
-
-/*****************************************************************************/
-/* Python BPy_Sequence methods table: */
-/*****************************************************************************/
-static PyObject *Sequence_copy( BPy_Sequence * self );
-static PyObject *Sequence_new( BPy_Sequence * self, PyObject * args );
-static PyObject *Sequence_remove( BPy_Sequence * self, PyObject * args );
-static PyObject *Sequence_rebuildProxy( BPy_Sequence * self );
-
-static PyObject *SceneSeq_new( BPy_SceneSeq * self, PyObject * args );
-static PyObject *SceneSeq_remove( BPy_SceneSeq * self, PyObject * args );
-static void intern_pos_update(Sequence * seq);
-
-static PyMethodDef BPy_Sequence_methods[] = {
- /* name, method, flags, doc */
- {"new", ( PyCFunction ) Sequence_new, METH_VARARGS,
- "(data) - Return a new sequence."},
- {"remove", ( PyCFunction ) Sequence_remove, METH_VARARGS,
- "(data) - Remove a strip."},
- {"__copy__", ( PyCFunction ) Sequence_copy, METH_NOARGS,
- "() - Return a copy of the sequence containing the same objects."},
- {"copy", ( PyCFunction ) Sequence_copy, METH_NOARGS,
- "() - Return a copy of the sequence containing the same objects."},
- {"rebuildProxy", ( PyCFunction ) Sequence_rebuildProxy, METH_VARARGS,
- "() - Rebuild the active strip's Proxy."},
- {NULL, NULL, 0, NULL}
-};
-
-static PyMethodDef BPy_SceneSeq_methods[] = {
- /* name, method, flags, doc */
- {"new", ( PyCFunction ) SceneSeq_new, METH_VARARGS,
- "(data) - Return a new sequence."},
- {"remove", ( PyCFunction ) SceneSeq_remove, METH_VARARGS,
- "(data) - Remove a strip."},
- {NULL, NULL, 0, NULL}
-};
-
-/* use to add a sequence to a scene or its listbase */
-static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
-{
- PyObject *py_data = NULL;
-
- Sequence *seq;
- int a;
- Strip *strip;
- StripElem *se;
- int start, machine;
-
- if( !PyArg_ParseTuple( args, "Oii", &py_data, &start, &machine ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expect sequence data then 2 ints - (seqdata, start, track)" );
-
- seq = alloc_sequence(seqbase, start, machine); /* warning, this sets last */
-
- if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 2) {
- /* Image */
- PyObject *list;
- char *name;
-
- if (!PyArg_ParseTuple( py_data, "sO!", &name, &PyList_Type, &list)) {
- BLI_remlink(seqbase, seq);
- MEM_freeN(seq);
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "images data needs to be a tuple of a string and a list of images - (path, [filenames...])" );
- }
-
- seq->type= SEQ_IMAGE;
-
- seq->len = PyList_Size( list );
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= seq->len;
- strip->us= 1;
- strncpy(strip->dir, name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
-
- for(a=0; a<seq->len; a++) {
- name = PyString_AsString(PyList_GetItem( list, a ));
- strncpy(se->name, name, FILE_MAXFILE-1);
- se++;
- }
- } else if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 3) {
- float r,g,b;
- SolidColorVars *colvars;
- seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor");
- colvars = (SolidColorVars *)seq->effectdata;
-
- if (!PyArg_ParseTuple( py_data, "fff", &r, &g, &b)) {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "color needs to be a tuple of 3 floats - (r,g,b)" );
- }
-
- seq->type= SEQ_COLOR;
-
- CLAMP(r,0,1);
- CLAMP(g,0,1);
- CLAMP(b,0,1);
-
- colvars->col[0] = r;
- colvars->col[1] = b;
- colvars->col[2] = g;
-
- /* basic defaults */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len = seq->len = 1;
- strip->us= 1;
- strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
-
- } else if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 4) {
- // MOVIE or AUDIO_HD
- char *filename;
- char *dir;
- char *fullpath;
- char *type;
- int totframe;
-
- if (!PyArg_ParseTuple( py_data, "ssss", &filename, &dir, &fullpath, &type )) {
- BLI_remlink(seqbase, seq);
- MEM_freeN(seq);
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "movie/audio hd data needs to be a tuple of a string and a list of images - (filename, dir, fullpath, type)" );
- }
-
- // RFS - Attempting to support Movie and Audio (HD) strips
-#define RFS
-#ifdef RFS
- // Movie strips
- if( strcmp( type, "movie" ) == 0 )
- {
- /* open it as an animation */
- struct anim * an = openanim(fullpath, IB_rect);
- if(an==0) {
- BLI_remlink(seqbase, seq);
- MEM_freeN(seq);
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "invalid movie strip" );
- }
-
- /* get the length in frames */
- totframe = IMB_anim_get_duration( an );
-
- /* set up sequence */
- seq->type= SEQ_MOVIE;
- seq->len= totframe;
- seq->anim= an;
- seq->anim_preseek = IMB_anim_get_preseek(an);
-
- calc_sequence(seq);
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, dir, FILE_MAXDIR-1); // ????
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name movie in first strip */
- strncpy(se->name, filename, FILE_MAXFILE-1); // ????
- }
-
- // Audio (HD) strips
- if( strcmp( type, "audio_hd" ) == 0 )
- {
- struct hdaudio *hdaudio;
-
- totframe= 0;
-
- /* is it a sound file? */
- hdaudio = sound_open_hdaudio( fullpath );
- if(hdaudio==0) {
- BLI_remlink(seqbase, seq);
- MEM_freeN(seq);
-
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- fullpath );
- }
-
- totframe= sound_hdaudio_get_duration(hdaudio, FPS);
-
- /* set up sequence */
- seq->type= SEQ_HD_SOUND;
- seq->len= totframe;
- seq->hdaudio= hdaudio;
-
- calc_sequence(seq);
-
- /* strip and stripdata - same as for MOVIE */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, dir, FILE_MAXDIR-1); // ????
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name movie in first strip */
- strncpy(se->name, filename, FILE_MAXFILE-1); // ????
- }
-#endif
-
- } else if (BPy_Sound_Check(py_data)) {
- /* RAM sound */
- int totframe;
- bSound *sound = (( BPy_Sound * )py_data)->sound;
-
- seq->type= SEQ_RAM_SOUND;
- seq->sound = sound;
-
- totframe= (int) ( ((float)(sound->streamlen-1)/( (float)sce->audio.mixrate*4.0 ))* (float)sce->r.frs_sec / sce->r.frs_sec_base);
-
- sound->flags |= SOUND_FLAGS_SEQUENCE;
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, sound->name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name sound in first strip */
- strncpy(se->name, sound->name, FILE_MAXFILE-1);
-
- } else if (BPy_Scene_Check(py_data)) {
- /* scene */
- Scene *sceseq = ((BPy_Scene *)py_data)->scene;
-
- seq->type= SEQ_SCENE;
- seq->scene= sceseq;
-
- /*seq->sfra= sce->r.sfra;*/
- seq->len= sceseq->r.efra - sceseq->r.sfra + 1;
-
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strncpy(seq->name + 2, sceseq->id.name + 2,
- sizeof(seq->name) - 2);
- strip->len= seq->len;
- strip->us= 1;
- } else {
- // RFS: REMOVED MOVIE FROM HERE
- }
- strncpy(seq->name+2, "Untitled", 21);
- intern_pos_update(seq);
- return Sequence_CreatePyObject(seq, NULL, sce);
-}
-
-static PyObject *Sequence_new( BPy_Sequence * self, PyObject * args )
-{
- return NewSeq_internal(&self->seq->seqbase, args, self->scene);
-}
-
-static PyObject *SceneSeq_new( BPy_SceneSeq * self, PyObject * args )
-{
- return NewSeq_internal( &((Editing *)self->scene->ed)->seqbase, args, self->scene);
-}
-
-static void del_seq__internal(Sequence *seq)
-{
- if(seq->ipo) seq->ipo->id.us--;
-
- if(seq->type==SEQ_RAM_SOUND && seq->sound)
- seq->sound->id.us--;
- free_sequence(seq);
-}
-
-static void recurs_del_seq(ListBase *lb)
-{
- Sequence *seq, *seqn;
-
- seq= lb->first;
- while(seq) {
- seqn= seq->next;
- BLI_remlink(lb, seq);
- if(seq->type==SEQ_META) recurs_del_seq(&seq->seqbase);
- del_seq__internal(seq);
- seq= seqn;
- }
-}
-
-static PyObject *RemoveSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce)
-{
- BPy_Sequence *bpy_seq = NULL;
-
- if( !PyArg_ParseTuple( args, "O!", &Sequence_Type, &bpy_seq ) )
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "expects a sequence object" );
-
- /* quick way to tell if we dont have the seq */
- if (sce != bpy_seq->scene)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Sequence does not exist here, cannot remove" );
-
- recurs_del_seq(&bpy_seq->seq->seqbase);
- del_seq__internal(bpy_seq->seq);
- clear_last_seq(); /* just incase */
- Py_RETURN_NONE;
-}
-
-static PyObject *Sequence_remove( BPy_Sequence * self, PyObject * args )
-{
- return RemoveSeq_internal(&self->seq->seqbase, args, self->scene);
-}
-
-static PyObject *SceneSeq_remove( BPy_SceneSeq * self, PyObject * args )
-{
- return RemoveSeq_internal( &((Editing *)self->scene->ed)->seqbase, args, self->scene);
-}
-
-
-static PyObject *Sequence_copy( BPy_Sequence * self )
-{
- printf("Sequence Copy not implimented yet!\n");
- Py_RETURN_NONE;
-}
-
-
-/*****************************************************************************/
-/* PythonTypeObject callback function prototypes */
-/*****************************************************************************/
-static PyObject *Sequence_repr( BPy_Sequence * obj );
-static PyObject *SceneSeq_repr( BPy_SceneSeq * obj );
-static int Sequence_compare( BPy_Sequence * a, BPy_Sequence * b );
-static int SceneSeq_compare( BPy_SceneSeq * a, BPy_SceneSeq * b );
-
-/*****************************************************************************/
-/* Python BPy_Sequence methods: */
-/*****************************************************************************/
-
-
-static PyObject *Sequence_getIter( BPy_Sequence * self )
-{
- Sequence *iter = self->seq->seqbase.first;
-
- if (!self->iter) {
- self->iter = iter;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return Sequence_CreatePyObject(self->seq, iter, self->scene);
- }
-}
-
-static PyObject *SceneSeq_getIter( BPy_SceneSeq * self )
-{
- Sequence *iter = ((Editing *)self->scene->ed)->seqbase.first;
-
- if (!self->iter) {
- self->iter = iter;
- return EXPP_incr_ret ( (PyObject *) self );
- } else {
- return SceneSeq_CreatePyObject(self->scene, iter);
- }
-}
-
-
-/*
- * Return next Seq
- */
-static PyObject *Sequence_nextIter( BPy_Sequence * self )
-{
- PyObject *object;
- if( !(self->iter) ) {
- self->iter = NULL; /* so we can add objects again */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object= Sequence_CreatePyObject( self->iter, NULL, self->scene );
- self->iter= self->iter->next;
- return object;
-}
-
-
-/*
- * Return next Seq
- */
-static PyObject *SceneSeq_nextIter( BPy_Sequence * self )
-{
- PyObject *object;
- if( !(self->iter) ) {
- self->iter = NULL; /* so we can add objects again */
- return EXPP_ReturnPyObjError( PyExc_StopIteration,
- "iterator at end" );
- }
-
- object= Sequence_CreatePyObject( self->iter, NULL, self->scene );
- self->iter= self->iter->next;
- return object;
-}
-
-
-static PyObject *Sequence_getName( BPy_Sequence * self )
-{
- return PyString_FromString( self->seq->name+2 );
-}
-
-static int Sequence_setName( BPy_Sequence * self, PyObject * value )
-{
- char *name = NULL;
-
- name = PyString_AsString ( value );
- if( !name )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
-
- strncpy(self->seq->name+2, name, 21);
- return 0;
-}
-
-
-static PyObject *Sequence_getProxyDir( BPy_Sequence * self )
-{
- return PyString_FromString( self->seq->strip->proxy ? self->seq->strip->proxy->dir : "" );
-}
-
-
-static int Sequence_setProxyDir( BPy_Sequence * self, PyObject * value )
-{
- char *name = NULL;
-
- name = PyString_AsString ( value );
- if( !name ) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string argument" );
- }
-
- if (strlen(name) == 0) {
- if (self->seq->strip->proxy) {
- MEM_freeN(self->seq->strip->proxy);
- }
- } else {
- self->seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy");
- strncpy(self->seq->strip->proxy->dir, name, sizeof(struct StripProxy));
- }
- return 0;
-}
-
-
-static PyObject *Sequence_rebuildProxy( BPy_Sequence * self )
-{
- if (self->seq->strip->proxy)
- seq_proxy_rebuild(self->seq);
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Sequence_getSound( BPy_Sequence * self )
-{
- if (self->seq->type == SEQ_RAM_SOUND && self->seq->sound)
- return Sound_CreatePyObject(self->seq->sound);
- Py_RETURN_NONE;
-}
-
-static PyObject *Sequence_getIpo( BPy_Sequence * self )
-{
- struct Ipo *ipo;
-
- ipo = self->seq->ipo;
-
- if( ipo )
- return Ipo_CreatePyObject( ipo );
- Py_RETURN_NONE;
-}
-
-
-static PyObject *SceneSeq_getActive( BPy_SceneSeq * self )
-{
- Sequence *last_seq = NULL, *seq;
- Editing *ed = self->scene->ed;
-
- if (!ed)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "scene has no sequence data to edit" );
-
- seq = ed->seqbasep->first;
-
- while (seq) {
- if (seq->flag & SELECT)
- last_seq = seq;
-
- seq = seq->next;
- }
- if (last_seq)
- return Sequence_CreatePyObject(last_seq, NULL, self->scene );
-
- Py_RETURN_NONE;
-}
-
-static PyObject *SceneSeq_getMetaStrip( BPy_SceneSeq * self )
-{
- Sequence *seq = NULL;
- Editing *ed = self->scene->ed;
- MetaStack *ms;
- if (!ed)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "scene has no sequence data to edit" );
-
- ms = ed->metastack.last;
- if (!ms)
- Py_RETURN_NONE;
-
- seq = ms->parseq;
- return Sequence_CreatePyObject(seq, NULL, self->scene);
-}
-
-
-/*
- * this should accept a Py_None argument and just delete the Ipo link
- * (as Object_clearIpo() does)
- */
-
-static int Sequence_setIpo( BPy_Sequence * self, PyObject * value )
-{
- Ipo *ipo = NULL;
- Ipo *oldipo;
- ID *id;
-
- oldipo = self->seq->ipo;
-
- /* if parameter is not None, check for valid Ipo */
-
- if ( value != Py_None ) {
- if ( !BPy_Ipo_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected an Ipo object" );
-
- ipo = Ipo_FromPyObject( value );
-
- if( !ipo )
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "null ipo!" );
-
- if( ipo->blocktype != ID_SEQ )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Ipo is not a sequence data Ipo" );
- }
-
- /* if already linked to Ipo, delete link */
-
- if ( oldipo ) {
- id = &oldipo->id;
- if( id->us > 0 )
- id->us--;
- }
-
- /* assign new Ipo and increment user count, or set to NULL if deleting */
-
- self->seq->ipo = ipo;
- if ( ipo )
- id_us_plus(&ipo->id);
-
- return 0;
-}
-
-static PyObject *Sequence_getScene( BPy_Sequence * self )
-{
- struct Scene *scene;
-
- scene = self->seq->scene;
-
- if( scene )
- return Scene_CreatePyObject( scene );
- Py_RETURN_NONE;
-}
-
-
-static PyObject *Sequence_getImages( BPy_Sequence * self )
-{
- Strip *strip;
- StripElem *se;
- int i;
- PyObject *list, *ret;
-
- if (self->seq->type != SEQ_IMAGE) {
- list = PyList_New(0);
- ret= Py_BuildValue( "sO", "", list);
- Py_DECREF(list);
- return ret;
- }
-
- /*return EXPP_ReturnPyObjError( PyExc_TypeError,
- "Sequence is not an image type" );*/
-
-
- strip = self->seq->strip;
- se = strip->stripdata;
- list = PyList_New(strip->len);
-
- for (i=0; i<strip->len; i++, se++) {
- PyList_SetItem( list, i, PyString_FromString(se->name) );
- }
-
- ret= Py_BuildValue( "sO", strip->dir, list);
- Py_DECREF(list);
- return ret;
-}
-
-static int Sequence_setImages( BPy_Sequence * self, PyObject *value )
-{
- Strip *strip;
- StripElem *se;
- int i;
- PyObject *list;
- char *basepath, *name;
-
- if (self->seq->type != SEQ_IMAGE) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "Sequence is not an image type" );
- }
-
- if( !PyArg_ParseTuple
- ( value, "sO!", &basepath, &PyList_Type, &list ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string and optional list argument" );
-
- strip = self->seq->strip;
- se = strip->stripdata;
-
- /* for now dont support different image list sizes */
- if (PyList_Size(list) != strip->len) {
- return EXPP_ReturnIntError( PyExc_TypeError,
- "at the moment only image lista with the same number of images as the strip are supported" );
- }
-
- strncpy(strip->dir, basepath, sizeof(strip->dir));
-
- for (i=0; i<strip->len; i++, se++) {
- name = PyString_AsString(PyList_GetItem(list, i));
- if (name) {
- strncpy(se->name, name, sizeof(se->name));
- } else {
- PyErr_Clear();
- }
- }
-
- return 0;
-}
-
-static PyObject *M_Sequence_BlendModesDict( void )
-{
- PyObject *M = PyConstant_New( );
-
- if( M ) {
- BPy_constant *d = ( BPy_constant * ) M;
- PyConstant_Insert( d, "CROSS", PyInt_FromLong( SEQ_CROSS ) );
- PyConstant_Insert( d, "ADD", PyInt_FromLong( SEQ_ADD ) );
- PyConstant_Insert( d, "SUBTRACT", PyInt_FromLong( SEQ_SUB ) );
- PyConstant_Insert( d, "ALPHAOVER", PyInt_FromLong( SEQ_ALPHAOVER ) );
- PyConstant_Insert( d, "ALPHAUNDER", PyInt_FromLong( SEQ_ALPHAUNDER ) );
- PyConstant_Insert( d, "GAMMACROSS", PyInt_FromLong( SEQ_GAMCROSS ) );
- PyConstant_Insert( d, "MULTIPLY", PyInt_FromLong( SEQ_MUL ) );
- PyConstant_Insert( d, "OVERDROP", PyInt_FromLong( SEQ_OVERDROP ) );
- PyConstant_Insert( d, "PLUGIN", PyInt_FromLong( SEQ_PLUGIN ) );
- PyConstant_Insert( d, "WIPE", PyInt_FromLong( SEQ_WIPE ) );
- PyConstant_Insert( d, "GLOW", PyInt_FromLong( SEQ_GLOW ) );
- PyConstant_Insert( d, "TRANSFORM", PyInt_FromLong( SEQ_TRANSFORM ) );
- PyConstant_Insert( d, "COLOR", PyInt_FromLong( SEQ_COLOR ) );
- PyConstant_Insert( d, "SPEED", PyInt_FromLong( SEQ_SPEED ) );
- }
- return M;
-}
-
-static PyObject *Sequence_getBlendMode( BPy_Sequence * self )
-{
- return PyInt_FromLong( self->seq->blend_mode );
-}
-
-static int Sequence_setBlendMode( BPy_Sequence * self, PyObject * value )
-{
- struct Sequence *seq= self->seq;
- int number = PyInt_AsLong( value );
-
- if( number==-1 && PyErr_Occurred() )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" );
-
- if ( !seq_can_blend(seq) )
- return EXPP_ReturnIntError( PyExc_AttributeError, "this sequence type dosnt support blending" );
-
- if (number<SEQ_EFFECT || number>SEQ_EFFECT_MAX)
- return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" );
-
- seq->blend_mode=number;
-
- return 0;
-}
-
-/*
- * get floating point attributes
- */
-static PyObject *getIntAttr( BPy_Sequence *self, void *type )
-{
- int param;
- struct Sequence *seq= self->seq;
-
- /*printf("%i %i %i %i %i %i %i %i %i\n", seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->startdisp, seq->enddisp, seq->depth );*/
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_SEQ_ATTR_TYPE:
- param = seq->type;
- break;
- case EXPP_SEQ_ATTR_CHAN:
- param = seq->machine;
- break;
- case EXPP_SEQ_ATTR_LENGTH:
- param = seq->len;
- break;
- case EXPP_SEQ_ATTR_START:
- param = seq->start;
- break;
- case EXPP_SEQ_ATTR_STARTOFS:
- param = seq->startofs;
- break;
- case EXPP_SEQ_ATTR_ENDOFS:
- param = seq->endofs;
- break;
- case EXPP_SEQ_ATTR_STARTSTILL:
- param = seq->startstill;
- break;
- case EXPP_SEQ_ATTR_ENDSTILL:
- param = seq->endstill;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "undefined type in getIntAttr" );
- }
-
- return PyInt_FromLong( param );
-}
-
-/* internal functions for recursivly updating metastrip locatons */
-static void intern_pos_update(Sequence * seq) {
- /* update startdisp and enddisp */
- calc_sequence_disp(seq);
-}
-
-void intern_recursive_pos_update(Sequence * seq, int offset) {
- Sequence *iterseq;
- intern_pos_update(seq);
- if (seq->type != SEQ_META) return;
-
- for (iterseq = seq->seqbase.first; iterseq; iterseq= iterseq->next) {
- iterseq->start -= offset;
- intern_recursive_pos_update(iterseq, offset);
- }
-}
-
-
-static int setIntAttrClamp( BPy_Sequence *self, PyObject *value, void *type )
-{
- struct Sequence *seq= self->seq;
- int number, origval=0, regen_data;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError, "expected an int value" );
-
- number = PyInt_AS_LONG( value );
-
- switch( GET_INT_FROM_POINTER(type) ) {
- case EXPP_SEQ_ATTR_CHAN:
- CLAMP(number, 1, 1024);
- seq->machine = number;
- regen_data = 0;
- break;
- case EXPP_SEQ_ATTR_START:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "cannot set the location of an effect directly" );
- CLAMP(number, -MAXFRAME, MAXFRAME);
- origval = seq->start;
- seq->start = number;
- regen_data = 0;
- break;
-
- case EXPP_SEQ_ATTR_STARTOFS:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This property dosnt apply to an effect" );
- CLAMP(number, 0, seq->len - seq->endofs);
- origval = seq->startofs;
- seq->startofs = number;
- regen_data = 1;
- break;
- case EXPP_SEQ_ATTR_ENDOFS:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This property dosnt apply to an effect" );
- CLAMP(number, 0, seq->len - seq->startofs);
- origval = seq->endofs;
- seq->endofs = number;
- regen_data = 1;
- break;
- case EXPP_SEQ_ATTR_STARTSTILL:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This property dosnt apply to an effect" );
- CLAMP(number, 1, MAXFRAME);
- origval = seq->startstill;
- seq->startstill = number;
- regen_data = 1;
- break;
- case EXPP_SEQ_ATTR_ENDSTILL:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "This property dosnt apply to an effect" );
- CLAMP(number, seq->startstill+1, MAXFRAME);
- origval = seq->endstill;
- seq->endstill = number;
- regen_data = 1;
- break;
- case EXPP_SEQ_ATTR_LENGTH:
- if (self->seq->type == SEQ_EFFECT)
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "cannot set the length of an effect directly" );
- CLAMP(number, 1, MAXFRAME);
- origval = seq->len;
- seq->len = number;
- regen_data = 1;
- break;
- default:
- return EXPP_ReturnIntError( PyExc_RuntimeError,
- "undefined type in setFloatAttrClamp" );
- }
-
- if (number != origval) {
- intern_pos_update(seq);
-
- if (GET_INT_FROM_POINTER(type) == EXPP_SEQ_ATTR_START)
- intern_recursive_pos_update(seq, origval - seq->start);
-
- if (regen_data) {
- new_tstripdata(seq);
- }
- }
- return 0;
-}
-
-
-static PyObject *getFlagAttr( BPy_Sequence *self, void *type )
-{
- if (self->seq->flag & GET_INT_FROM_POINTER(type))
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-
-/*
- * set floating point attributes which require clamping
- */
-
-static int setFlagAttr( BPy_Sequence *self, PyObject *value, void *type )
-{
- int t = GET_INT_FROM_POINTER(type);
- int param = PyObject_IsTrue( value );
-
- if( param == -1 )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected True/False or 0/1" );
-
- if (param)
- self->seq->flag |= t;
- else {
- /* dont allow leftsel and rightsel when its not selected */
- if (t == SELECT)
- t = t + SEQ_LEFTSEL + SEQ_RIGHTSEL;
-
- self->seq->flag &= ~t;
- }
- return 0;
-}
-
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_Sequence_getseters[] = {
- {"name",
- (getter)Sequence_getName, (setter)Sequence_setName,
- "Sequence name",
- NULL},
- {"proxyDir",
- (getter)Sequence_getProxyDir, (setter)Sequence_setProxyDir,
- "Sequence proxy directory",
- NULL},
- {"ipo",
- (getter)Sequence_getIpo, (setter)Sequence_setIpo,
- "Sequence ipo",
- NULL},
-
- {"scene",
- (getter)Sequence_getScene, (setter)NULL,
- "Sequence scene",
- NULL},
- {"sound",
- (getter)Sequence_getSound, (setter)NULL,
- "Sequence name",
- NULL},
- {"images",
- (getter)Sequence_getImages, (setter)Sequence_setImages,
- "Sequence scene",
- NULL},
- {"blendMode",
- (getter)Sequence_getBlendMode, (setter)Sequence_setBlendMode,
- "Sequence Blend Mode",
- NULL},
-
- {"type",
- (getter)getIntAttr, (setter)NULL,
- "",
- (void *) EXPP_SEQ_ATTR_TYPE},
- {"channel",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_CHAN},
-
- {"length",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_LENGTH},
- {"start",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_START},
- {"startOffset",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_STARTOFS},
- {"endOffset",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_ENDOFS},
- {"startStill",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_STARTSTILL},
- {"endStill",
- (getter)getIntAttr, (setter)setIntAttrClamp,
- "",
- (void *) EXPP_SEQ_ATTR_ENDSTILL},
-
- {"sel",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "Sequence audio mute option",
- (void *)SELECT},
- {"selLeft",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_LEFTSEL},
- {"selRight",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_RIGHTSEL},
- {"filtery",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_FILTERY},
- {"flipX",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_FLIPX},
- {"flipY",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_FLIPY},
- {"mute",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_MUTE},
- {"floatBuffer",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_MAKE_FLOAT},
- {"lock",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_LOCK},
- {"useProxy",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_USE_PROXY},
- {"premul",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_MAKE_PREMUL},
- {"reversed",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_REVERSE_FRAMES},
- {"ipoLocked",
- (getter)getFlagAttr, (setter)setFlagAttr,
- "",
- (void *)SEQ_IPO_FRAME_LOCKED},
-
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef BPy_SceneSeq_getseters[] = {
- {"active",
- (getter)SceneSeq_getActive, (setter)NULL,
- "the active strip",
- NULL},
- {"metastrip",
- (getter)SceneSeq_getMetaStrip, (setter)NULL,
- "The currently active metastrip the user is editing",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-/*****************************************************************************/
-/* Python TypeSequence structure definition: */
-/*****************************************************************************/
-PyTypeObject Sequence_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Sequence", /* char *tp_name; */
- sizeof( BPy_Sequence ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) Sequence_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) Sequence_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) Sequence_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) Sequence_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_Sequence_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_Sequence_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-
-/*****************************************************************************/
-/* Python TypeSequence structure definition: */
-/*****************************************************************************/
-PyTypeObject SceneSeq_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender SceneSeq", /* char *tp_name; */
- sizeof( BPy_Sequence ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- NULL,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- ( cmpfunc ) SceneSeq_compare, /* cmpfunc tp_compare; */
- ( reprfunc ) SceneSeq_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- NULL, /* PyNumberMethods *tp_as_number; */
- NULL, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT, /* long tp_flags; */
-
- NULL, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- NULL, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- ( getiterfunc ) SceneSeq_getIter, /* getiterfunc tp_iter; */
- ( iternextfunc ) SceneSeq_nextIter, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- BPy_SceneSeq_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- BPy_SceneSeq_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*****************************************************************************/
-/* Function: M_Sequence_Get */
-/* Python equivalent: Blender.Sequence.Get */
-/*****************************************************************************/
-/*
-PyObject *M_Sequence_Get( PyObject * self, PyObject * args )
-{
- return SceneSeq_CreatePyObject( G.scene, NULL );
-}
-*/
-
-/*****************************************************************************/
-/* Function: initObject */
-/*****************************************************************************/
-PyObject *Sequence_Init( void )
-{
- PyObject *BlendModesDict = M_Sequence_BlendModesDict( );
- PyObject *submodule;
- if( PyType_Ready( &Sequence_Type ) < 0 )
- return NULL;
- if( PyType_Ready( &SceneSeq_Type ) < 0 )
- return NULL;
-
- /* NULL was M_Sequence_methods*/
- submodule = Py_InitModule3( "Blender.Scene.Sequence", NULL,
-"The Blender Sequence module\n\n\
-This module provides access to **Sequence Data** in Blender.\n" );
-
- if( BlendModesDict )
- PyModule_AddObject( submodule, "BlendModes", BlendModesDict );
-
- /*Add SUBMODULES to the module*/
- /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); //creates a *new* module*/
- return submodule;
-}
-
-
-/*****************************************************************************/
-/* Function: Sequence_CreatePyObject */
-/* Description: This function will create a new BlenObject from an existing */
-/* Object structure. */
-/*****************************************************************************/
-PyObject *Sequence_CreatePyObject( struct Sequence * seq, struct Sequence * iter, struct Scene *sce)
-{
- BPy_Sequence *pyseq;
-
- if( !seq )
- Py_RETURN_NONE;
-
- pyseq =
- ( BPy_Sequence * ) PyObject_NEW( BPy_Sequence, &Sequence_Type );
-
- if( pyseq == NULL ) {
- return ( NULL );
- }
- pyseq->seq = seq;
- pyseq->iter = iter;
- pyseq->scene = sce;
-
- return ( ( PyObject * ) pyseq );
-}
-
-/*****************************************************************************/
-/* Function: SceneSeq_CreatePyObject */
-/* Description: This function will create a new BlenObject from an existing */
-/* Object structure. */
-/*****************************************************************************/
-PyObject *SceneSeq_CreatePyObject( struct Scene * scn, struct Sequence * iter)
-{
- BPy_SceneSeq *pysceseq;
-
- if( !scn )
- Py_RETURN_NONE;
-
- if ( !scn->ed ) {
- Editing *ed;
- ed= scn->ed= MEM_callocN( sizeof(Editing), "addseq");
- ed->seqbasep= &ed->seqbase;
- }
-
- pysceseq =
- ( BPy_SceneSeq * ) PyObject_NEW( BPy_SceneSeq, &SceneSeq_Type );
-
- if( pysceseq == NULL ) {
- return ( NULL );
- }
- pysceseq->scene = scn;
- pysceseq->iter = iter;
-
- return ( ( PyObject * ) pysceseq );
-}
-
-/*****************************************************************************/
-/* Function: Sequence_FromPyObject */
-/* Description: This function returns the Blender sequence from the given */
-/* PyObject. */
-/*****************************************************************************/
-struct Sequence *Sequence_FromPyObject( PyObject * py_seq )
-{
- BPy_Sequence *blen_seq;
-
- blen_seq = ( BPy_Sequence * ) py_seq;
- return ( blen_seq->seq );
-}
-
-/*****************************************************************************/
-/* Function: Sequence_compare */
-/* Description: This is a callback function for the BPy_Sequence type. It */
-/* compares two Sequence_Type objects. Only the "==" and "!=" */
-/* comparisons are meaninful. Returns 0 for equality and -1 if */
-/* they don't point to the same Blender Object struct. */
-/* In Python it becomes 1 if they are equal, 0 otherwise. */
-/*****************************************************************************/
-static int Sequence_compare( BPy_Sequence * a, BPy_Sequence * b )
-{
- Sequence *pa = a->seq, *pb = b->seq;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static int SceneSeq_compare( BPy_SceneSeq * a, BPy_SceneSeq * b )
-{
-
- Scene *pa = a->scene, *pb = b->scene;
- return ( pa == pb ) ? 0 : -1;
-}
-
-/*****************************************************************************/
-/* Function: Sequence_repr / SceneSeq_repr */
-/* Description: This is a callback function for the BPy_Sequence type. It */
-/* builds a meaninful string to represent object objects. */
-/*****************************************************************************/
-static PyObject *Sequence_repr( BPy_Sequence * self )
-{
- return PyString_FromFormat( "[Sequence Strip \"%s\"]",
- self->seq->name + 2 );
-}
-static PyObject *SceneSeq_repr( BPy_SceneSeq * self )
-{
- return PyString_FromFormat( "[Scene Sequence \"%s\"]",
- self->scene->id.name + 2 );
-}
-
diff --git a/source/blender/python/api2_2x/sceneSequence.h b/source/blender/python/api2_2x/sceneSequence.h
deleted file mode 100644
index 2ac1ecdb295..00000000000
--- a/source/blender/python/api2_2x/sceneSequence.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Michel Selten
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_SEQUENCE_H
-#define EXPP_SEQUENCE_H
-
-#include <Python.h>
-#include "DNA_sequence_types.h"
-
-/* The Sequence PyTypeObject defined in Sequence.c */
-extern PyTypeObject Sequence_Type;
-extern PyTypeObject SceneSeq_Type;
-
-#define BPy_Sequence_Check(v) ((v)->ob_type == &Sequence_Type)
-#define BPy_SceneSeq_Check(v) ((v)->ob_type == &SceneSeq_Type)
-
-
-/*****************************************************************************/
-/* Python BPy_Sequence structure definition. */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required python macro */
-
- /*one of the folowing must be NULL*/
- struct Sequence *seq;/* if not NULL, this sequence is a Metaseq */
-
- /* used for looping over the scene or the strips strips */
- struct Sequence *iter;/* if not NULL, this sequence is a Metaseq */
-
- struct Scene *scene;
-
-} BPy_Sequence;
-
-
-
-/*****************************************************************************/
-/* Python BPy_Sequence structure definition. */
-/*****************************************************************************/
-typedef struct {
- PyObject_HEAD /* required python macro */
-
- /*one of the folowing must be NULL*/
- struct Scene *scene; /* if not NULL, this sequence is the root sequence for the scene*/
-
- /* used for looping over the scene or the strips strips */
- struct Sequence *iter;/* if not NULL, this sequence is a Metaseq */
-} BPy_SceneSeq;
-
-PyObject *Sequence_Init( void );
-PyObject *Sequence_CreatePyObject( struct Sequence * seq, struct Sequence * iter, struct Scene * scn);
-PyObject *SceneSeq_CreatePyObject( struct Scene * scn, struct Sequence * iter);
-struct Sequence *Sequence_FromPyObject( PyObject * py_obj );
-
-#endif /* EXPP_SEQUENCE_H */
diff --git a/source/blender/python/api2_2x/sceneTimeLine.c b/source/blender/python/api2_2x/sceneTimeLine.c
deleted file mode 100644
index 7e88ed00ffb..00000000000
--- a/source/blender/python/api2_2x/sceneTimeLine.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/* $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <BLI_blenlib.h>
-#include "Scene.h"
-
-#include <stdio.h>
-#include <MEM_guardedalloc.h> /* for MEM_callocN */
-
-#include "gen_utils.h"
-#include "sceneTimeLine.h"
-
-// static PyObject *TimeLine_New (PyObject *self);
-static PyObject *M_TimeLine_Get (PyObject *self, PyObject *args);
-
-static char M_TimeLine_Get_doc[]= "Return the Scene.TimeLine.";
-
-//----------------------Scene.TimeMarker subsubmodule method def----------------------------
-struct PyMethodDef M_TimeLine_methods[]= {
-// {"New", (PyCFunction) M_TimeMarker_New, METH_NOVAR,
-// M_TimeLine_New_doc},
- {"Get", (PyCFunction) M_TimeLine_Get, METH_VARARGS,
- M_TimeLine_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-static PyObject *TimeLine_addMarker (BPy_TimeLine *self, PyObject *args);
-static PyObject *TimeLine_delMarker (BPy_TimeLine *self, PyObject *args);
-static PyObject *TimeLine_setNameMarker (BPy_TimeLine *self, PyObject *args);
-static PyObject *TimeLine_getNameMarker (BPy_TimeLine *self, PyObject *args);
-static PyObject *TimeLine_getFramesMarked (BPy_TimeLine *self, PyObject *args);
-
-static PyObject *TimeLine_repr (BPy_TimeLine *self) {
-
- return PyString_FromFormat ("[TimeLine]");
-}
-
-static PyMethodDef BPy_TimeLine_methods[] = {
- {"add", (PyCFunction) TimeLine_addMarker,
- METH_VARARGS,
- "() - Add timemarker"},
- {"delete", (PyCFunction) TimeLine_delMarker,
- METH_VARARGS,
- "() - delete timemarker"},
- {"setName", (PyCFunction) TimeLine_setNameMarker,
- METH_VARARGS,
- "() - Get timemarker name"},
- {"getName", (PyCFunction) TimeLine_getNameMarker,
- METH_VARARGS,
- "() - Set timemarker name"},
- {"getMarked", (PyCFunction) TimeLine_getFramesMarked,
- METH_VARARGS,
- "() - Get frames timemarked"},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------dealloc----------------------------------------*/
-static void TimeLine_dealloc( BPy_TimeLine * self )
-{
- PyObject_DEL( self );
-}
-
-/*-----------------------getattr----------------------------------------*/
-static PyObject *TimeLine_getattr (BPy_TimeLine *self, char *name) {
- return Py_FindMethod( BPy_TimeLine_methods, ( PyObject * ) self, name );
-}
-
-/*-----------------------setattr----------------------------------------*/
-static int TimeLine_setattr (BPy_TimeLine *self, char *name, PyObject *value) {
- PyObject *valtuple;
- PyObject *error= NULL;
-
- valtuple= Py_BuildValue ("(O)", value);
-
- if (!valtuple)
- return EXPP_ReturnIntError( PyExc_MemoryError,
- "TimeLineSetAttr: couldn't create tuple" );
- if( strcmp( name, "name" ) == 0 )
- error = TimeLine_setNameMarker (self, valtuple);
- Py_DECREF (valtuple);
- if (error != Py_None)
- return -1;
-
- Py_DECREF (Py_None);
- return 0;
-}
-
-//-----------------------BPy_Scene method def------------------------------
-PyTypeObject TimeLine_Type = {
- PyObject_HEAD_INIT (NULL) 0, /* ob_size */
- "TimeLine", /* tp_name */
- sizeof (BPy_TimeLine), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) TimeLine_dealloc, /* tp_dealloc */
- (printfunc) 0, /* tp_print */
- (getattrfunc) TimeLine_getattr, /* tp_getattr */
- (setattrfunc) TimeLine_setattr, /* tp_setattr */
- 0,
- (reprfunc) TimeLine_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0,0,0,0,0,0,0,0,0,
- BPy_TimeLine_methods,
- 0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-PyObject *TimeLine_Init (void)
-{
- PyObject *submodule;
-
- if (PyType_Ready (&TimeLine_Type) < 0)
- return NULL;
- submodule= Py_InitModule3 ("Blender.Scene.TimeLine", M_TimeLine_methods,
- "The Blender TimeLine subsubmodule");
-
- return submodule;
-}
-
-PyObject *TimeLine_CreatePyObject (BPy_TimeLine *tl) {
- BPy_TimeLine *bl_tl;
-
- bl_tl= (BPy_TimeLine *) PyObject_NEW (BPy_TimeLine, &TimeLine_Type);
-
- return (( PyObject * ) bl_tl);
-}
-
-
-PyObject *M_TimeLine_Get (PyObject *self, PyObject *args) {
-
- return EXPP_incr_ret (Py_None);
-}
-
-static PyObject *TimeLine_getFramesMarked (BPy_TimeLine *self, PyObject *args) {
-
- PyObject *marker_dict= NULL;
- TimeMarker *marker_it= NULL;
- PyObject *tmarker= NULL, *pyo= NULL, *tmpstr;
-
- if (!PyArg_ParseTuple (args, "|O", &tmarker))
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "expected nothing, string or int as arguments.");
- if (tmarker) {
- char s[64];
- int frm= 0;
-
- if (PyString_Check (tmarker) && (BLI_strncpy(s, PyString_AsString (tmarker), 64)) ) {
- for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next)
- if (!strcmp (marker_it->name, s)) {
- frm= (int)marker_it->frame;
- break;
- }
- }
- else if (PyInt_Check (tmarker))
- frm= (int)PyInt_AS_LONG (tmarker);
- else
- return EXPP_ReturnPyObjError (PyExc_AttributeError,
- "expected nothing, string or int as arguments.");
- if (frm>0) {
- marker_dict= PyDict_New ();
- for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next){
- if (marker_it->frame==frm) {
- pyo= PyDict_GetItem ((PyObject*)marker_dict, PyInt_FromLong ((long int)marker_it->frame));
- tmpstr = PyString_FromString(marker_it->name);
- if (pyo) {
- PyList_Append (pyo, tmpstr);
- Py_INCREF(pyo);
- }else{
- pyo = PyList_New(0);
- PyList_Append (pyo, tmpstr);
- }
- Py_DECREF(tmpstr);
-
- PyDict_SetItem (marker_dict, PyInt_FromLong ((long int)marker_it->frame), pyo);
- if (pyo) {
- Py_DECREF (pyo);
- pyo= NULL;
- }
- }
- }
- }
-
- }else {
- marker_dict= PyDict_New ();
- for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) {
- pyo=PyDict_GetItem ((PyObject*)marker_dict, PyInt_FromLong ((long int)marker_it->frame));
- tmpstr = PyString_FromString(marker_it->name);
- if (pyo) {
- PyList_Append (pyo, tmpstr);
- Py_INCREF (pyo);
- }else{
- pyo= PyList_New (0);
- PyList_Append (pyo, tmpstr);
- }
- Py_DECREF(tmpstr);
-
- PyDict_SetItem (marker_dict, PyInt_FromLong ((long int)marker_it->frame), pyo);
- if (pyo) {
- Py_DECREF (pyo);
- pyo= NULL;
- }
- }
- }
-
- return marker_dict;
-}
-
-static PyObject *TimeLine_addMarker (BPy_TimeLine *self, PyObject *args) {
- int frame= 0;
- TimeMarker *marker= NULL, *marker_it= NULL;
-
- if (!PyArg_ParseTuple( args, "i", &frame ))
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected int as argument.");
- /* two markers can't be at the same place */
- for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) {
- if (marker_it->frame==frame)
- return EXPP_incr_ret (Py_None);
- }
- if (frame<self->sfra || frame>self->efra)
- return EXPP_ReturnPyObjError (PyExc_TypeError, "frame out of range.");
- marker= MEM_callocN (sizeof(TimeMarker), "TimeMarker");
- if (!marker) return EXPP_incr_ret (Py_None);
- marker->frame= frame;
- BLI_addtail (self->marker_list, marker);
- return EXPP_incr_ret (Py_None);
-}
-
-static PyObject *TimeLine_delMarker (BPy_TimeLine *self, PyObject *args) {
- int frame= 0;
- TimeMarker *marker= NULL;
-
- if (!PyArg_ParseTuple (args, "|i", &frame))
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected int as argument.");
-
- for (marker= self->marker_list->first; marker; marker= marker->next) {
- if (!frame)
- BLI_freelinkN (self->marker_list, marker);
- else if (marker->frame == frame) {
- BLI_freelinkN (self->marker_list, marker);
- return EXPP_incr_ret (Py_None);
- }
- }
-
- return EXPP_incr_ret (Py_None);
-}
-
-static PyObject *TimeLine_setNameMarker (BPy_TimeLine *self, PyObject *args) {
- char *buf;
- char name[64];
- int frame= 0;
- TimeMarker *marker= NULL;
-
- if (!PyArg_ParseTuple( args, "is", &frame, &buf))
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected int as argument.");
- PyOS_snprintf (name, sizeof (name), "%s", buf);
- for (marker= self->marker_list->first; marker; marker= marker->next) {
- if (marker->frame == frame) {
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- return EXPP_incr_ret (Py_None);
- }
- }
-
- return EXPP_ReturnPyObjError (PyExc_TypeError, "frame not marked.");
-}
-
-static PyObject *TimeLine_getNameMarker (BPy_TimeLine *self, PyObject *args) {
- int frame= 0;
- TimeMarker *marker;
-
- if (!PyArg_ParseTuple (args, "i", &frame))
- return EXPP_ReturnPyObjError (PyExc_TypeError, "expected int as argument.");
-
- for (marker= self->marker_list->first; marker; marker= marker->next) {
- if (marker->frame == frame)
- return PyString_FromString (marker->name);
- }
-
- return EXPP_ReturnPyObjError (PyExc_TypeError, "frame not marked.");
-}
-
-
diff --git a/source/blender/python/api2_2x/sceneTimeLine.h b/source/blender/python/api2_2x/sceneTimeLine.h
deleted file mode 100644
index b2255441b53..00000000000
--- a/source/blender/python/api2_2x/sceneTimeLine.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joilnen Leite
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_TIMELINE_H
-#define EXPP_TIMELINE_H
-
-#include <Python.h>
-#include <DNA_scene_types.h>
-
-extern PyTypeObject TimeLine_Type;
-#define BPy_TimeLine_Check (v) \
- ((v)->ob_type == &TimeLine_Type)
-
-typedef struct {
- PyObject_HEAD
- ListBase *marker_list;
- int sfra, efra;
-} BPy_TimeLine;
-
-//---------------------------Python BPy_TimeLine visible prototypes-----------
-// Python TimeLine_Type helper functions needed by Blender (the Init function) and Object modules.
-
-
-PyObject *TimeLine_Init (void);
-PyObject *TimeLine_CreatePyObject (BPy_TimeLine *tl);
-BPy_TimeLine *TimeLine_FromPyObject (PyObject * pyobj);
-
-#endif /* EXPP_TMARKER_H */
-
diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c
deleted file mode 100644
index fe28f0fac42..00000000000
--- a/source/blender/python/api2_2x/vector.c
+++ /dev/null
@@ -1,1313 +0,0 @@
-/*
- * $Id$
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- *
- * Contributor(s): Willian P. Germano & Joseph Gilbert, Ken Hughes
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "Mathutils.h"
-
-#include "BLI_blenlib.h"
-#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
-#include "gen_utils.h"
-
-
-/*-------------------------DOC STRINGS ---------------------------*/
-char Vector_Zero_doc[] = "() - set all values in the vector to 0";
-char Vector_Normalize_doc[] = "() - normalize the vector";
-char Vector_Negate_doc[] = "() - changes vector to it's additive inverse";
-char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]";
-char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]";
-char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]";
-char Vector_toPoint_doc[] = "() - create a new Point Object from this vector";
-char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis";
-char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal";
-char Vector_copy_doc[] = "() - return a copy of the vector";
-/*-----------------------METHOD DEFINITIONS ----------------------*/
-struct PyMethodDef Vector_methods[] = {
- {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc},
- {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc},
- {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc},
- {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc},
- {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc},
- {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc},
- {"toPoint", (PyCFunction) Vector_toPoint, METH_NOARGS, Vector_toPoint_doc},
- {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc},
- {"reflect", ( PyCFunction ) Vector_reflect, METH_O, Vector_reflect_doc},
- {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
- {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc},
- {NULL, NULL, 0, NULL}
-};
-
-/*-----------------------------METHODS----------------------------
- --------------------------Vector.toPoint()----------------------
- create a new point object to represent this vector */
-PyObject *Vector_toPoint(VectorObject * self)
-{
- float coord[3];
- int i;
-
- if(self->size < 2 || self->size > 3) {
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector.toPoint(): inappropriate vector size - expects 2d or 3d vector\n");
- }
- for(i = 0; i < self->size; i++){
- coord[i] = self->vec[i];
- }
-
- return newPointObject(coord, self->size, Py_NEW);
-}
-/*----------------------------Vector.zero() ----------------------
- set the vector data to 0,0,0 */
-PyObject *Vector_Zero(VectorObject * self)
-{
- int i;
- for(i = 0; i < self->size; i++) {
- self->vec[i] = 0.0f;
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-/*----------------------------Vector.normalize() -----------------
- normalize the vector data to a unit vector */
-PyObject *Vector_Normalize(VectorObject * self)
-{
- int i;
- float norm = 0.0f;
-
- for(i = 0; i < self->size; i++) {
- norm += self->vec[i] * self->vec[i];
- }
- norm = (float) sqrt(norm);
- for(i = 0; i < self->size; i++) {
- self->vec[i] /= norm;
- }
- return EXPP_incr_ret((PyObject*)self);
-}
-
-
-/*----------------------------Vector.resize2D() ------------------
- resize the vector to x,y */
-PyObject *Vector_Resize2D(VectorObject * self)
-{
- if(self->wrapped==Py_WRAP)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "vector.resize2d(): cannot resize wrapped data - only python vectors\n");
-
- self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
- if(self->vec == NULL)
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "vector.resize2d(): problem allocating pointer space\n\n");
-
- self->size = 2;
- return EXPP_incr_ret((PyObject*)self);
-}
-/*----------------------------Vector.resize3D() ------------------
- resize the vector to x,y,z */
-PyObject *Vector_Resize3D(VectorObject * self)
-{
- if (self->wrapped==Py_WRAP)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "vector.resize3d(): cannot resize wrapped data - only python vectors\n");
-
- self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
- if(self->vec == NULL)
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "vector.resize3d(): problem allocating pointer space\n\n");
-
- if(self->size == 2)
- self->vec[2] = 0.0f;
-
- self->size = 3;
- return EXPP_incr_ret((PyObject*)self);
-}
-/*----------------------------Vector.resize4D() ------------------
- resize the vector to x,y,z,w */
-PyObject *Vector_Resize4D(VectorObject * self)
-{
- if(self->wrapped==Py_WRAP)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "vector.resize4d(): cannot resize wrapped data - only python vectors\n");
-
- self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
- if(self->vec == NULL)
- return EXPP_ReturnPyObjError(PyExc_MemoryError,
- "vector.resize4d(): problem allocating pointer space\n\n");
-
- if(self->size == 2){
- self->vec[2] = 0.0f;
- self->vec[3] = 1.0f;
- }else if(self->size == 3){
- self->vec[3] = 1.0f;
- }
- self->size = 4;
- return EXPP_incr_ret((PyObject*)self);
-}
-/*----------------------------Vector.toTrackQuat(track, up) ----------------------
- extract a quaternion from the vector and the track and up axis */
-PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args )
-{
- float vec[3], quat[4];
- char *strack, *sup;
- short track = 2, up = 1;
-
- if( !PyArg_ParseTuple ( args, "|ss", &strack, &sup ) ) {
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected optional two strings\n" );
- }
- if (self->size != 3) {
- return EXPP_ReturnPyObjError( PyExc_TypeError, "only for 3D vectors\n" );
- }
-
- if (strack) {
- if (strlen(strack) == 2) {
- if (strack[0] == '-') {
- switch(strack[1]) {
- case 'X':
- case 'x':
- track = 3;
- break;
- case 'Y':
- case 'y':
- track = 4;
- break;
- case 'z':
- case 'Z':
- track = 5;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, -X, Y, -Y, Z or -Z for track axis\n" );
- }
- }
- else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, -X, Y, -Y, Z or -Z for track axis\n" );
- }
- }
- else if (strlen(strack) == 1) {
- switch(strack[0]) {
- case '-':
- case 'X':
- case 'x':
- track = 0;
- break;
- case 'Y':
- case 'y':
- track = 1;
- break;
- case 'z':
- case 'Z':
- track = 2;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, -X, Y, -Y, Z or -Z for track axis\n" );
- }
- }
- else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, -X, Y, -Y, Z or -Z for track axis\n" );
- }
- }
-
- if (sup) {
- if (strlen(sup) == 1) {
- switch(*sup) {
- case 'X':
- case 'x':
- up = 0;
- break;
- case 'Y':
- case 'y':
- up = 1;
- break;
- case 'z':
- case 'Z':
- up = 2;
- break;
- default:
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, Y or Z for up axis\n" );
- }
- }
- else {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "only X, Y or Z for up axis\n" );
- }
- }
-
- if (track == up) {
- return EXPP_ReturnPyObjError( PyExc_ValueError,
- "Can't have the same axis for track and up\n" );
- }
-
- /*
- flip vector around, since vectoquat expect a vector from target to tracking object
- and the python function expects the inverse (a vector to the target).
- */
- vec[0] = -self->vec[0];
- vec[1] = -self->vec[1];
- vec[2] = -self->vec[2];
-
- vectoquat(vec, track, up, quat);
-
- return newQuaternionObject(quat, Py_NEW);
-}
-
-/*----------------------------Vector.reflect(mirror) ----------------------
- return a reflected vector on the mirror normal
- ((2 * DotVecs(vec, mirror)) * mirror) - vec
- using arithb.c would be nice here */
-PyObject *Vector_reflect( VectorObject * self, PyObject * value )
-{
- VectorObject *mirrvec;
- float mirror[3];
- float vec[3];
- float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- float dot2;
-
- /* for normalizing */
- int i;
- float norm = 0.0f;
-
- if (!VectorObject_Check(value))
- return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a vector argument" );
-
- mirrvec = (VectorObject *)value;
-
- mirror[0] = mirrvec->vec[0];
- mirror[1] = mirrvec->vec[1];
- if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2];
- else mirror[2] = 0.0;
-
- /* normalize, whos idea was it not to use arithb.c? :-/ */
- for(i = 0; i < 3; i++) {
- norm += mirror[i] * mirror[i];
- }
- norm = (float) sqrt(norm);
- for(i = 0; i < 3; i++) {
- mirror[i] /= norm;
- }
- /* done */
-
- vec[0] = self->vec[0];
- vec[1] = self->vec[1];
- if (self->size > 2) vec[2] = self->vec[2];
- else vec[2] = 0.0;
-
- dot2 = 2 * vec[0]*mirror[0]+vec[1]*mirror[1]+vec[2]*mirror[2];
-
- reflect[0] = (dot2 * mirror[0]) - vec[0];
- reflect[1] = (dot2 * mirror[1]) - vec[1];
- reflect[2] = (dot2 * mirror[2]) - vec[2];
-
- return newVectorObject(reflect, self->size, Py_NEW);
-}
-
-/*----------------------------Vector.copy() --------------------------------------
- return a copy of the vector */
-PyObject *Vector_copy(VectorObject * self)
-{
- return newVectorObject(self->vec, self->size, Py_NEW);
-}
-
-/*----------------------------dealloc()(internal) ----------------
- free the py_object */
-static void Vector_dealloc(VectorObject * self)
-{
- /* only free non wrapped */
- if(self->wrapped != Py_WRAP){
- PyMem_Free(self->vec);
- }
- PyObject_DEL(self);
-}
-
-/*----------------------------print object (internal)-------------
- print the object to screen */
-static PyObject *Vector_repr(VectorObject * self)
-{
- int i;
- char buffer[48], str[1024];
-
- BLI_strncpy(str,"[",1024);
- for(i = 0; i < self->size; i++){
- if(i < (self->size - 1)){
- sprintf(buffer, "%.6f, ", self->vec[i]);
- strcat(str,buffer);
- }else{
- sprintf(buffer, "%.6f", self->vec[i]);
- strcat(str,buffer);
- }
- }
- strcat(str, "](vector)");
-
- return PyString_FromString(str);
-}
-/*---------------------SEQUENCE PROTOCOLS------------------------
- ----------------------------len(object)------------------------
- sequence length*/
-static int Vector_len(VectorObject * self)
-{
- return self->size;
-}
-/*----------------------------object[]---------------------------
- sequence accessor (get)*/
-static PyObject *Vector_item(VectorObject * self, int i)
-{
- if(i < 0 || i >= self->size)
- return EXPP_ReturnPyObjError(PyExc_IndexError,
- "vector[index]: out of range\n");
-
- return PyFloat_FromDouble(self->vec[i]);
-
-}
-/*----------------------------object[]-------------------------
- sequence accessor (set)*/
-static int Vector_ass_item(VectorObject * self, int i, PyObject * ob)
-{
-
- if(!(PyNumber_Check(ob))) { /* parsed item not a number */
- return EXPP_ReturnIntError(PyExc_TypeError,
- "vector[index] = x: index argument not a number\n");
- }
-
- if(i < 0 || i >= self->size){
- return EXPP_ReturnIntError(PyExc_IndexError,
- "vector[index] = x: assignment index out of range\n");
- }
- self->vec[i] = (float)PyFloat_AsDouble(ob);
- return 0;
-}
-
-/*----------------------------object[z:y]------------------------
- sequence slice (get) */
-static PyObject *Vector_slice(VectorObject * self, int begin, int end)
-{
- PyObject *list = NULL;
- int count;
-
- CLAMP(begin, 0, self->size);
- if (end<0) end= self->size+end+1;
- CLAMP(end, 0, self->size);
- begin = MIN2(begin,end);
-
- list = PyList_New(end - begin);
- for(count = begin; count < end; count++) {
- PyList_SetItem(list, count - begin,
- PyFloat_FromDouble(self->vec[count]));
- }
-
- return list;
-}
-/*----------------------------object[z:y]------------------------
- sequence slice (set) */
-static int Vector_ass_slice(VectorObject * self, int begin, int end,
- PyObject * seq)
-{
- int i, y, size = 0;
- float vec[4];
- PyObject *v;
-
- CLAMP(begin, 0, self->size);
- if (end<0) end= self->size+end+1;
- CLAMP(end, 0, self->size);
- begin = MIN2(begin,end);
-
- size = PySequence_Length(seq);
- if(size != (end - begin)){
- return EXPP_ReturnIntError(PyExc_TypeError,
- "vector[begin:end] = []: size mismatch in slice assignment\n");
- }
-
- for (i = 0; i < size; i++) {
- v = PySequence_GetItem(seq, i);
- if (v == NULL) { /* Failed to read sequence */
- return EXPP_ReturnIntError(PyExc_RuntimeError,
- "vector[begin:end] = []: unable to read sequence\n");
- }
-
- if(!PyNumber_Check(v)) { /* parsed item not a number */
- Py_DECREF(v);
- return EXPP_ReturnIntError(PyExc_TypeError,
- "vector[begin:end] = []: sequence argument not a number\n");
- }
-
- vec[i] = (float)PyFloat_AsDouble(v);
- Py_DECREF(v);
- }
- /*parsed well - now set in vector*/
- for(y = 0; y < size; y++){
- self->vec[begin + y] = vec[y];
- }
- return 0;
-}
-/*------------------------NUMERIC PROTOCOLS----------------------
- ------------------------obj + obj------------------------------
- addition*/
-static PyObject *Vector_add(PyObject * v1, PyObject * v2)
-{
- int i;
- float vec[4];
-
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if VectorObject_Check(v1)
- vec1= (VectorObject *)v1;
-
- if VectorObject_Check(v2)
- vec2= (VectorObject *)v2;
-
- /* make sure v1 is always the vector */
- if (vec1 && vec2 ) {
- /*VECTOR + VECTOR*/
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: vectors must have the same dimensions for this operation\n");
-
- for(i = 0; i < vec1->size; i++) {
- vec[i] = vec1->vec[i] + vec2->vec[i];
- }
- return newVectorObject(vec, vec1->size, Py_NEW);
- }
-
- if(PointObject_Check(v2)){ /*VECTOR + POINT*/
- /*Point translation*/
- PointObject *pt = (PointObject*)v2;
-
- if(pt->size == vec1->size){
- for(i = 0; i < vec1->size; i++){
- vec[i] = vec1->vec[i] + pt->coord[i];
- }
- }else{
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: arguments are the wrong size....\n");
- }
- return newPointObject(vec, vec1->size, Py_NEW);
- }
-
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: arguments not valid for this operation....\n");
-}
-
-/* ------------------------obj += obj------------------------------
- addition in place */
-static PyObject *Vector_iadd(PyObject * v1, PyObject * v2)
-{
- int i;
-
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if VectorObject_Check(v1)
- vec1= (VectorObject *)v1;
-
- if VectorObject_Check(v2)
- vec2= (VectorObject *)v2;
-
- /* make sure v1 is always the vector */
- if (vec1 && vec2 ) {
- /*VECTOR + VECTOR*/
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: vectors must have the same dimensions for this operation\n");
-
- for(i = 0; i < vec1->size; i++) {
- vec1->vec[i] += vec2->vec[i];
- }
- Py_INCREF( v1 );
- return v1;
- }
-
- if(PointObject_Check(v2)){ /*VECTOR + POINT*/
- /*Point translation*/
- PointObject *pt = (PointObject*)v2;
-
- if(pt->size == vec1->size){
- for(i = 0; i < vec1->size; i++){
- vec1->vec[i] += pt->coord[i];
- }
- }else{
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: arguments are the wrong size....\n");
- }
- Py_INCREF( v1 );
- return v1;
- }
-
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector addition: arguments not valid for this operation....\n");
-}
-
-/*------------------------obj - obj------------------------------
- subtraction*/
-static PyObject *Vector_sub(PyObject * v1, PyObject * v2)
-{
- int i;
- float vec[4];
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if (!VectorObject_Check(v1) || !VectorObject_Check(v2))
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector subtraction: arguments not valid for this operation....\n");
-
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
-
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector subtraction: vectors must have the same dimensions for this operation\n");
-
- for(i = 0; i < vec1->size; i++) {
- vec[i] = vec1->vec[i] - vec2->vec[i];
- }
-
- return newVectorObject(vec, vec1->size, Py_NEW);
-}
-
-/*------------------------obj -= obj------------------------------
- subtraction*/
-static PyObject *Vector_isub(PyObject * v1, PyObject * v2)
-{
- int i, size;
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if (!VectorObject_Check(v1) || !VectorObject_Check(v2))
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector subtraction: arguments not valid for this operation....\n");
-
- vec1 = (VectorObject*)v1;
- vec2 = (VectorObject*)v2;
-
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector subtraction: vectors must have the same dimensions for this operation\n");
-
- size = vec1->size;
- for(i = 0; i < vec1->size; i++) {
- vec1->vec[i] = vec1->vec[i] - vec2->vec[i];
- }
-
- Py_INCREF( v1 );
- return v1;
-}
-
-/*------------------------obj * obj------------------------------
- mulplication*/
-static PyObject *Vector_mul(PyObject * v1, PyObject * v2)
-{
- VectorObject *vec1 = NULL, *vec2 = NULL;
-
- if VectorObject_Check(v1)
- vec1= (VectorObject *)v1;
-
- if VectorObject_Check(v2)
- vec2= (VectorObject *)v2;
-
- /* make sure v1 is always the vector */
- if (vec1 && vec2 ) {
- int i;
- double dot = 0.0f;
-
- if(vec1->size != vec2->size)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "Vector multiplication: vectors must have the same dimensions for this operation\n");
-
- /*dot product*/
- for(i = 0; i < vec1->size; i++) {
- dot += vec1->vec[i] * vec2->vec[i];
- }
- return PyFloat_FromDouble(dot);
- }
-
- /*swap so vec1 is always the vector */
- if (vec2) {
- vec1= vec2;
- v2= v1;
- }
-
- if (PyNumber_Check(v2)) {
- /* VEC * NUM */
- int i;
- float vec[4];
- float scalar = (float)PyFloat_AsDouble( v2 );
-
- for(i = 0; i < vec1->size; i++) {
- vec[i] = vec1->vec[i] * scalar;
- }
- return newVectorObject(vec, vec1->size, Py_NEW);
-
- } else if (MatrixObject_Check(v2)) {
- /* VEC * MATRIX */
- if (v1==v2) /* mat*vec, we have swapped the order */
- return column_vector_multiplication((MatrixObject*)v2, vec1);
- else /* vec*mat */
- return row_vector_multiplication(vec1, (MatrixObject*)v2);
- } else if (QuaternionObject_Check(v2)) {
- QuaternionObject *quat = (QuaternionObject*)v2;
- if(vec1->size != 3)
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector multiplication: only 3D vector rotations (with quats) currently supported\n");
-
- return quat_rotation((PyObject*)vec1, (PyObject*)quat);
- }
-
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector multiplication: arguments not acceptable for this operation\n");
-}
-
-/*------------------------obj *= obj------------------------------
- in place mulplication */
-static PyObject *Vector_imul(PyObject * v1, PyObject * v2)
-{
- VectorObject *vec = (VectorObject *)v1;
- int i;
-
- /* only support vec*=float and vec*=mat
- vec*=vec result is a float so that wont work */
- if (PyNumber_Check(v2)) {
- /* VEC * NUM */
- float scalar = (float)PyFloat_AsDouble( v2 );
-
- for(i = 0; i < vec->size; i++) {
- vec->vec[i] *= scalar;
- }
-
- Py_INCREF( v1 );
- return v1;
-
- } else if (MatrixObject_Check(v2)) {
- float vecCopy[4];
- int x,y, size = vec->size;
- MatrixObject *mat= (MatrixObject*)v2;
-
- if(mat->colSize != size){
- if(mat->rowSize == 4 && vec->size != 3){
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "vector * matrix: matrix column size and the vector size must be the same");
- } else {
- vecCopy[3] = 1.0f;
- }
- }
-
- for(i = 0; i < size; i++){
- vecCopy[i] = vec->vec[i];
- }
-
- size = MIN2(size, mat->colSize);
-
- /*muliplication*/
- for(x = 0, i = 0; x < size; x++, i++) {
- double dot = 0.0f;
- for(y = 0; y < mat->rowSize; y++) {
- dot += mat->matrix[y][x] * vecCopy[y];
- }
- vec->vec[i] = (float)dot;
- }
- Py_INCREF( v1 );
- return v1;
- }
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector multiplication: arguments not acceptable for this operation\n");
-}
-
-/*------------------------obj / obj------------------------------
- divide*/
-static PyObject *Vector_div(PyObject * v1, PyObject * v2)
-{
- int i, size;
- float vec[4], scalar;
- VectorObject *vec1 = NULL;
-
- if(!VectorObject_Check(v1)) /* not a vector */
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector division: Vector must be divided by a float\n");
-
- vec1 = (VectorObject*)v1; /* vector */
-
- if(!PyNumber_Check(v2)) /* parsed item not a number */
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector division: Vector must be divided by a float\n");
-
- scalar = (float)PyFloat_AsDouble(v2);
-
- if(scalar==0.0) /* not a vector */
- return EXPP_ReturnPyObjError(PyExc_ZeroDivisionError,
- "Vector division: divide by zero error.\n");
-
- size = vec1->size;
- for(i = 0; i < size; i++) {
- vec[i] = vec1->vec[i] / scalar;
- }
- return newVectorObject(vec, size, Py_NEW);
-}
-
-/*------------------------obj / obj------------------------------
- divide*/
-static PyObject *Vector_idiv(PyObject * v1, PyObject * v2)
-{
- int i, size;
- float scalar;
- VectorObject *vec1 = NULL;
-
- /*if(!VectorObject_Check(v1))
- return EXPP_ReturnIntError(PyExc_TypeError,
- "Vector division: Vector must be divided by a float\n");*/
-
- vec1 = (VectorObject*)v1; /* vector */
-
- if(!PyNumber_Check(v2)) /* parsed item not a number */
- return EXPP_ReturnPyObjError(PyExc_TypeError,
- "Vector division: Vector must be divided by a float\n");
-
- scalar = (float)PyFloat_AsDouble(v2);
-
- if(scalar==0.0) /* not a vector */
- return EXPP_ReturnPyObjError(PyExc_ZeroDivisionError,
- "Vector division: divide by zero error.\n");
-
- size = vec1->size;
- for(i = 0; i < size; i++) {
- vec1->vec[i] /= scalar;
- }
- Py_INCREF( v1 );
- return v1;
-}
-
-/*-------------------------- -obj -------------------------------
- returns the negative of this object*/
-static PyObject *Vector_neg(VectorObject *self)
-{
- int i;
- float vec[4];
- for(i = 0; i < self->size; i++){
- vec[i] = -self->vec[i];
- }
-
- return newVectorObject(vec, self->size, Py_NEW);
-}
-/*------------------------coerce(obj, obj)-----------------------
- coercion of unknown types to type VectorObject for numeric protocols
- Coercion() is called whenever a math operation has 2 operands that
- it doesn't understand how to evaluate. 2+Matrix for example. We want to
- evaluate some of these operations like: (vector * 2), however, for math
- to proceed, the unknown operand must be cast to a type that python math will
- understand. (e.g. in the case above case, 2 must be cast to a vector and
- then call vector.multiply(vector, scalar_cast_as_vector)*/
-
-
-static int Vector_coerce(PyObject ** v1, PyObject ** v2)
-{
- /* Just incref, each functon must raise errors for bad types */
- Py_INCREF (*v1);
- Py_INCREF (*v2);
- return 0;
-}
-
-
-/*------------------------tp_doc*/
-static char VectorObject_doc[] = "This is a wrapper for vector objects.";
-/*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
-static double vec_magnitude_nosqrt(float *data, int size)
-{
- double dot = 0.0f;
- int i;
-
- for(i=0; i<size; i++){
- dot += data[i];
- }
- /*return (double)sqrt(dot);*/
- /* warning, line above removed because we are not using the length,
- rather the comparing the sizes and for this we do not need the sqrt
- for the actual length, the dot must be sqrt'd */
- return (double)dot;
-}
-
-
-/*------------------------tp_richcmpr
- returns -1 execption, 0 false, 1 true */
-PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type)
-{
- VectorObject *vecA = NULL, *vecB = NULL;
- int result = 0;
- float epsilon = .000001f;
- double lenA,lenB;
-
- if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
- vecA = (VectorObject*)objectA;
- vecB = (VectorObject*)objectB;
-
- if (vecA->size != vecB->size){
- if (comparison_type == Py_NE){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
- }
-
- switch (comparison_type){
- case Py_LT:
- lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
- lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- 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 ){
- result = 1;
- }else{
- result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
- }
- break;
- case Py_EQ:
- result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
- break;
- case Py_NE:
- result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1);
- if (result == 0){
- result = 1;
- }else{
- result = 0;
- }
- break;
- case Py_GT:
- lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size);
- lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size);
- 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 ){
- result = 1;
- }else{
- result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB));
- }
- break;
- default:
- printf("The result of the comparison could not be evaluated");
- break;
- }
- if (result == 1){
- return EXPP_incr_ret(Py_True);
- }else{
- return EXPP_incr_ret(Py_False);
- }
-}
-/*-----------------PROTCOL DECLARATIONS--------------------------*/
-static PySequenceMethods Vector_SeqMethods = {
- (inquiry) Vector_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) Vector_item, /* sq_item */
- (intintargfunc) Vector_slice, /* sq_slice */
- (intobjargproc) Vector_ass_item, /* sq_ass_item */
- (intintobjargproc) Vector_ass_slice, /* sq_ass_slice */
-};
-
-
-/* For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all
- arguments are guaranteed to be of the object's type (modulo
- coercion hacks -- i.e. if the type's coercion function
- returns other types, then these are allowed as well). Numbers that
- have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both*
- arguments for proper type and implement the necessary conversions
- in the slot functions themselves. */
-
-static PyNumberMethods Vector_NumMethods = {
- (binaryfunc) Vector_add, /* __add__ */
- (binaryfunc) Vector_sub, /* __sub__ */
- (binaryfunc) Vector_mul, /* __mul__ */
- (binaryfunc) Vector_div, /* __div__ */
- (binaryfunc) NULL, /* __mod__ */
- (binaryfunc) NULL, /* __divmod__ */
- (ternaryfunc) NULL, /* __pow__ */
- (unaryfunc) Vector_neg, /* __neg__ */
- (unaryfunc) NULL, /* __pos__ */
- (unaryfunc) NULL, /* __abs__ */
- (inquiry) NULL, /* __nonzero__ */
- (unaryfunc) NULL, /* __invert__ */
- (binaryfunc) NULL, /* __lshift__ */
- (binaryfunc) NULL, /* __rshift__ */
- (binaryfunc) NULL, /* __and__ */
- (binaryfunc) NULL, /* __xor__ */
- (binaryfunc) NULL, /* __or__ */
- (coercion) Vector_coerce, /* __coerce__ */
- (unaryfunc) NULL, /* __int__ */
- (unaryfunc) NULL, /* __long__ */
- (unaryfunc) NULL, /* __float__ */
- (unaryfunc) NULL, /* __oct__ */
- (unaryfunc) NULL, /* __hex__ */
-
- /* Added in release 2.0 */
- (binaryfunc) Vector_iadd, /*__iadd__*/
- (binaryfunc) Vector_isub, /*__isub__*/
- (binaryfunc) Vector_imul, /*__imul__*/
- (binaryfunc) Vector_idiv, /*__idiv__*/
- (binaryfunc) NULL, /*__imod__*/
- (ternaryfunc) NULL, /*__ipow__*/
- (binaryfunc) NULL, /*__ilshift__*/
- (binaryfunc) NULL, /*__irshift__*/
- (binaryfunc) NULL, /*__iand__*/
- (binaryfunc) NULL, /*__ixor__*/
- (binaryfunc) NULL, /*__ior__*/
-
- /* Added in release 2.2 */
- /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
- (binaryfunc) NULL, /*__floordiv__ __rfloordiv__*/
- (binaryfunc) NULL, /*__truediv__ __rfloordiv__*/
- (binaryfunc) NULL, /*__ifloordiv__*/
- (binaryfunc) NULL, /*__itruediv__*/
-};
-/*------------------PY_OBECT DEFINITION--------------------------*/
-
-/*
- * vector axis, vector.x/y/z/w
- */
-
-static PyObject *Vector_getAxis( VectorObject * self, void *type )
-{
- switch( (long)type ) {
- case 'X': /* these are backwards, but that how it works */
- return PyFloat_FromDouble(self->vec[0]);
- case 'Y':
- return PyFloat_FromDouble(self->vec[1]);
- case 'Z': /* these are backwards, but that how it works */
- if(self->size < 3)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "vector.z: error, cannot get this axis for a 2D vector\n");
- else
- return PyFloat_FromDouble(self->vec[2]);
- case 'W':
- if(self->size < 4)
- return EXPP_ReturnPyObjError(PyExc_AttributeError,
- "vector.w: error, cannot get this axis for a 3D vector\n");
-
- return PyFloat_FromDouble(self->vec[3]);
- default:
- {
- char errstr[1024];
- sprintf( errstr, "undefined type '%d' in Vector_getAxis",
- (int)((long)type & 0xff));
- return EXPP_ReturnPyObjError( PyExc_RuntimeError, errstr );
- }
- }
-}
-
-static int Vector_setAxis( VectorObject * self, PyObject * value, void * type )
-{
- float param;
-
- if (!PyNumber_Check(value))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a number for the vector axis" );
-
- param= (float)PyFloat_AsDouble( value );
-
- switch( (long)type ) {
- case 'X': /* these are backwards, but that how it works */
- self->vec[0]= param;
- break;
- case 'Y':
- self->vec[1]= param;
- break;
- case 'Z': /* these are backwards, but that how it works */
- if(self->size < 3)
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "vector.z: error, cannot get this axis for a 2D vector\n");
- self->vec[2]= param;
- break;
- case 'W':
- if(self->size < 4)
- return EXPP_ReturnIntError(PyExc_AttributeError,
- "vector.w: error, cannot get this axis for a 3D vector\n");
-
- self->vec[3]= param;
- break;
- default:
- {
- char errstr[1024];
- sprintf( errstr, "undefined type '%d' in Vector_setAxis",
- (int)((long)type & 0xff));
- return EXPP_ReturnIntError( PyExc_RuntimeError, errstr );
- }
- }
-
- return 0;
-}
-
-/* vector.length */
-static PyObject *Vector_getLength( VectorObject * self, void *type )
-{
- double dot = 0.0f;
- int i;
-
- for(i = 0; i < self->size; i++){
- dot += (self->vec[i] * self->vec[i]);
- }
- return PyFloat_FromDouble(sqrt(dot));
-}
-
-static int Vector_setLength( VectorObject * self, PyObject * value )
-{
- double dot = 0.0f, param;
- int i;
-
- if (!PyNumber_Check(value))
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected a number for the vector axis" );
-
- param= PyFloat_AsDouble( value );
-
- if (param < 0)
- return EXPP_ReturnIntError( PyExc_TypeError,
- "cannot set a vectors length to a negative value" );
-
- if (param==0) {
- for(i = 0; i < self->size; i++){
- self->vec[i]= 0;
- }
- return 0;
- }
-
- for(i = 0; i < self->size; i++){
- dot += (self->vec[i] * self->vec[i]);
- }
-
- if (!dot) /* cant sqrt zero */
- return 0;
-
- dot = sqrt(dot);
-
- if (dot==param)
- return 0;
-
- dot= dot/param;
-
- for(i = 0; i < self->size; i++){
- self->vec[i]= self->vec[i] / (float)dot;
- }
-
- return 0;
-}
-
-static PyObject *Vector_getWrapped( VectorObject * self, void *type )
-{
- if (self->wrapped == Py_WRAP)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-
-
-/*****************************************************************************/
-/* Python attributes get/set structure: */
-/*****************************************************************************/
-static PyGetSetDef Vector_getseters[] = {
- {"x",
- (getter)Vector_getAxis, (setter)Vector_setAxis,
- "Vector X axis",
- (void *)'X'},
- {"y",
- (getter)Vector_getAxis, (setter)Vector_setAxis,
- "Vector Y axis",
- (void *)'Y'},
- {"z",
- (getter)Vector_getAxis, (setter)Vector_setAxis,
- "Vector Z axis",
- (void *)'Z'},
- {"w",
- (getter)Vector_getAxis, (setter)Vector_setAxis,
- "Vector Z axis",
- (void *)'W'},
- {"length",
- (getter)Vector_getLength, (setter)Vector_setLength,
- "Vector Length",
- NULL},
- {"magnitude",
- (getter)Vector_getLength, (setter)Vector_setLength,
- "Vector Length",
- NULL},
- {"wrapped",
- (getter)Vector_getWrapped, (setter)NULL,
- "Vector Length",
- NULL},
- {NULL,NULL,NULL,NULL,NULL} /* Sentinel */
-};
-
-
-
-/* Note
- Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing
- but this means for eg that
- vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
-*/
-
-PyTypeObject vector_Type = {
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
- /* For printing, in format "<module>.<name>" */
- "Blender Vector", /* char *tp_name; */
- sizeof( VectorObject ), /* int tp_basicsize; */
- 0, /* tp_itemsize; For allocation */
-
- /* Methods to implement standard operations */
-
- ( destructor ) Vector_dealloc,/* destructor tp_dealloc; */
- NULL, /* printfunc tp_print; */
- NULL, /* getattrfunc tp_getattr; */
- NULL, /* setattrfunc tp_setattr; */
- NULL, /* cmpfunc tp_compare; */
- ( reprfunc ) Vector_repr, /* reprfunc tp_repr; */
-
- /* Method suites for standard classes */
-
- &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */
- &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */
- NULL, /* PyMappingMethods *tp_as_mapping; */
-
- /* More standard operations (here for binary compatibility) */
-
- NULL, /* hashfunc tp_hash; */
- NULL, /* ternaryfunc tp_call; */
- NULL, /* reprfunc tp_str; */
- NULL, /* getattrofunc tp_getattro; */
- NULL, /* setattrofunc tp_setattro; */
-
- /* Functions to access object as input/output buffer */
- NULL, /* PyBufferProcs *tp_as_buffer; */
-
- /*** Flags to define presence of optional/expanded features ***/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* long tp_flags; */
-
- VectorObject_doc, /* char *tp_doc; Documentation string */
- /*** Assigned meaning in release 2.0 ***/
- /* call function for all accessible objects */
- NULL, /* traverseproc tp_traverse; */
-
- /* delete references to contained objects */
- NULL, /* inquiry tp_clear; */
-
- /*** Assigned meaning in release 2.1 ***/
- /*** rich comparisons ***/
- (richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */
-
- /*** weak reference enabler ***/
- 0, /* long tp_weaklistoffset; */
-
- /*** Added in release 2.2 ***/
- /* Iterators */
- NULL, /* getiterfunc tp_iter; */
- NULL, /* iternextfunc tp_iternext; */
-
- /*** Attribute descriptor and subclassing stuff ***/
- Vector_methods, /* struct PyMethodDef *tp_methods; */
- NULL, /* struct PyMemberDef *tp_members; */
- Vector_getseters, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
- NULL, /* PyObject *tp_dict; */
- NULL, /* descrgetfunc tp_descr_get; */
- NULL, /* descrsetfunc tp_descr_set; */
- 0, /* long tp_dictoffset; */
- NULL, /* initproc tp_init; */
- NULL, /* allocfunc tp_alloc; */
- NULL, /* newfunc tp_new; */
- /* Low-level free-memory routine */
- NULL, /* freefunc tp_free; */
- /* For PyObject_IS_GC */
- NULL, /* inquiry tp_is_gc; */
- NULL, /* PyObject *tp_bases; */
- /* method resolution order */
- NULL, /* PyObject *tp_mro; */
- NULL, /* PyObject *tp_cache; */
- NULL, /* PyObject *tp_subclasses; */
- NULL, /* PyObject *tp_weaklist; */
- NULL
-};
-
-
-/*------------------------newVectorObject (internal)-------------
- creates a new vector object
- pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER
- (i.e. it was allocated elsewhere by MEM_mallocN())
- pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
- (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *newVectorObject(float *vec, int size, int type)
-{
- int i;
- VectorObject *self = PyObject_NEW(VectorObject, &vector_Type);
-
- if(size > 4 || size < 2)
- return NULL;
- self->size = size;
-
- 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) { /*new empty*/
- for(i = 0; i < size; i++){
- self->vec[i] = 0.0f;
- }
- if(size == 4) /* do the homogenous thing */
- self->vec[3] = 1.0f;
- }else{
- for(i = 0; i < size; i++){
- self->vec[i] = vec[i];
- }
- }
- self->wrapped = Py_NEW;
- }else{ /*bad type*/
- return NULL;
- }
- return (PyObject *) self;
-}
-
-/*
- #############################DEPRECATED################################
- #######################################################################
- ----------------------------Vector.negate() --------------------
- set the vector to it's negative -x, -y, -z */
-PyObject *Vector_Negate(VectorObject * self)
-{
- int i;
- for(i = 0; i < self->size; i++) {
- self->vec[i] = -(self->vec[i]);
- }
- /*printf("Vector.negate(): Deprecated: use -vector instead\n");*/
- return EXPP_incr_ret((PyObject*)self);
-}
-/*###################################################################
- ###########################DEPRECATED##############################*/
-
diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h
deleted file mode 100644
index 61b50d5f458..00000000000
--- a/source/blender/python/api2_2x/vector.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Willian P. Germano & Joseph Gilbert
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifndef EXPP_vector_h
-#define EXPP_vector_h
-
-#include <Python.h>
-
-extern PyTypeObject vector_Type;
-
-#define VectorObject_Check(v) ((v)->ob_type == &vector_Type)
-
-typedef struct {
- PyObject_VAR_HEAD
- float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */
- short size; /* vec size 2,3 or 4 */
- short wrapped; /* is wrapped data? */
-} VectorObject;
-
-/*prototypes*/
-PyObject *Vector_Zero( VectorObject * self );
-PyObject *Vector_Normalize( VectorObject * self );
-PyObject *Vector_Negate( VectorObject * self );
-PyObject *Vector_Resize2D( VectorObject * self );
-PyObject *Vector_Resize3D( VectorObject * self );
-PyObject *Vector_Resize4D( VectorObject * self );
-PyObject *Vector_toPoint( VectorObject * self );
-PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args );
-PyObject *Vector_reflect( VectorObject * self, PyObject * value );
-PyObject *Vector_copy( VectorObject * self );
-PyObject *newVectorObject(float *vec, int size, int type);
-
-#endif /* EXPP_vector_h */
diff --git a/source/blender/python/api2_2x/windowTheme.c b/source/blender/python/api2_2x/windowTheme.c
deleted file mode 100644
index ba231e9cb57..00000000000
--- a/source/blender/python/api2_2x/windowTheme.c
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#include "windowTheme.h" /*This must come first*/
-
-#include "BLI_blenlib.h"
-#include "BIF_interface_icons.h"
-#include "BIF_resources.h"
-#include "MEM_guardedalloc.h"
-#include "charRGBA.h"
-#include "gen_utils.h"
-
-
-#define EXPP_THEME_VTX_SIZE_MIN 1
-#define EXPP_THEME_VTX_SIZE_MAX 10
-#define EXPP_THEME_FDOT_SIZE_MIN 1
-#define EXPP_THEME_FDOT_SIZE_MAX 10
-#define EXPP_THEME_DRAWTYPE_MIN 1
-#define EXPP_THEME_DRAWTYPE_MAX 4
-
-#define EXPP_THEME_NUMBEROFTHEMES 16
-static const EXPP_map_pair themes_map[] = {
- {"ui", -1},
- {"buts", SPACE_BUTS},
- {"view3d", SPACE_VIEW3D},
- {"file", SPACE_FILE},
- {"ipo", SPACE_IPO},
- {"info", SPACE_INFO},
- {"sound", SPACE_SOUND},
- {"action", SPACE_ACTION},
- {"nla", SPACE_NLA},
- {"seq", SPACE_SEQ},
- {"image", SPACE_IMAGE},
- {"imasel", SPACE_IMASEL},
- {"text", SPACE_TEXT},
- {"oops", SPACE_OOPS},
- {"time", SPACE_TIME},
- {"node", SPACE_NODE},
- {NULL, 0}
-};
-
-static PyObject *M_Theme_New( PyObject * self, PyObject * args );
-static PyObject *M_Theme_Get( PyObject * self, PyObject * args );
-
-static char M_Theme_doc[] = "The Blender Theme module\n\n\
-This module provides access to UI Theme data in Blender";
-
-static char M_Theme_New_doc[] = "Theme.New (name = 'New Theme',\
-theme = <default>):\n\
- Return a new Theme Data object.\n\
-(name) - string: the Theme's name, it defaults to 'New Theme';\n\
-(theme) - bpy Theme: a base Theme to copy all data from, it defaults to the\n\
-current one.";
-
-static char M_Theme_Get_doc[] = "Theme.Get (name = None):\n\
- Return the theme data with the given 'name', None if not found, or\n\
- Return a list with all Theme Data objects if no argument was given.";
-
-/*****************************************************************************/
-/* Python method structure definition for Blender.Theme module: */
-/*****************************************************************************/
-struct PyMethodDef M_Theme_methods[] = {
- {"New", M_Theme_New, METH_VARARGS, M_Theme_New_doc},
- {"Get", M_Theme_Get, METH_VARARGS, M_Theme_Get_doc},
- {NULL, NULL, 0, NULL}
-};
-
-static void ThemeSpace_dealloc( BPy_ThemeSpace * self );
-static int ThemeSpace_compare( BPy_ThemeSpace * a, BPy_ThemeSpace * b );
-static PyObject *ThemeSpace_repr( BPy_ThemeSpace * self );
-static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name );
-static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name,
- PyObject * val );
-
-static PyMethodDef BPy_ThemeSpace_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
-PyTypeObject ThemeSpace_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /* ob_size */
- "Blender Space Theme", /* tp_name */
- sizeof( BPy_ThemeSpace ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) ThemeSpace_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) ThemeSpace_getAttr, /* tp_getattr */
- ( setattrfunc ) ThemeSpace_setAttr, /* tp_setattr */
- ( cmpfunc ) ThemeSpace_compare, /* tp_compare */
- ( reprfunc ) ThemeSpace_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0, 0,
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- 0, //BPy_ThemeSpace_methods, /* tp_methods */
- 0, /* tp_members */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-static void ThemeSpace_dealloc( BPy_ThemeSpace * self )
-{
- PyObject_DEL( self );
-}
-
-#define ELSEIF_TSP_RGBA(attr)\
- else if (!strcmp(name, #attr))\
- attrib = charRGBA_New(&tsp->attr[0]);
-
-/* Example: ELSEIF_TSP_RGBA(back) becomes:
- * else if (!strcmp(name, "back")
- * attrib = charRGBA_New(&tsp->back[0])
- */
-
-static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name )
-{
- PyObject *attrib = Py_None;
- ThemeSpace *tsp = self->tsp;
-
- if( !strcmp( name, "theme" ) )
- attrib = PyString_FromString( self->theme->name );
- ELSEIF_TSP_RGBA( back )
- ELSEIF_TSP_RGBA( text )
- ELSEIF_TSP_RGBA( text_hi )
- ELSEIF_TSP_RGBA( header )
- ELSEIF_TSP_RGBA( panel )
- ELSEIF_TSP_RGBA( shade1 )
- ELSEIF_TSP_RGBA( shade2 )
- ELSEIF_TSP_RGBA( hilite )
- ELSEIF_TSP_RGBA( grid )
- ELSEIF_TSP_RGBA( wire )
- ELSEIF_TSP_RGBA( select )
- ELSEIF_TSP_RGBA( lamp )
- ELSEIF_TSP_RGBA( active )
- ELSEIF_TSP_RGBA( group )
- ELSEIF_TSP_RGBA( group_active )
- ELSEIF_TSP_RGBA( transform )
- ELSEIF_TSP_RGBA( vertex )
- ELSEIF_TSP_RGBA( vertex_select )
- ELSEIF_TSP_RGBA( edge )
- ELSEIF_TSP_RGBA( edge_select )
- ELSEIF_TSP_RGBA( edge_seam )
- ELSEIF_TSP_RGBA( edge_sharp )
- ELSEIF_TSP_RGBA( editmesh_active )
- ELSEIF_TSP_RGBA( edge_facesel )
- ELSEIF_TSP_RGBA( face )
- ELSEIF_TSP_RGBA( face_select )
- ELSEIF_TSP_RGBA( face_dot )
- ELSEIF_TSP_RGBA( normal )
- ELSEIF_TSP_RGBA( bone_solid )
- ELSEIF_TSP_RGBA( bone_pose )
- ELSEIF_TSP_RGBA( strip )
- ELSEIF_TSP_RGBA( strip_select )
- ELSEIF_TSP_RGBA( syntaxl )
- ELSEIF_TSP_RGBA( syntaxn )
- ELSEIF_TSP_RGBA( syntaxb )
- ELSEIF_TSP_RGBA( syntaxv )
- ELSEIF_TSP_RGBA( syntaxc )
- ELSEIF_TSP_RGBA( movie )
- ELSEIF_TSP_RGBA( image )
- ELSEIF_TSP_RGBA( scene )
- ELSEIF_TSP_RGBA( audio )
- ELSEIF_TSP_RGBA( effect )
- ELSEIF_TSP_RGBA( plugin )
- ELSEIF_TSP_RGBA( transition )
- ELSEIF_TSP_RGBA( meta )
- else if( !strcmp( name, "vertex_size" ) )
- attrib = Py_BuildValue( "i", tsp->vertex_size );
- else if( !strcmp( name, "facedot_size" ) )
- attrib = Py_BuildValue( "i", tsp->facedot_size );
- else if( !strcmp( name, "__members__" ) )
- attrib = Py_BuildValue("[ssssssssssssssssssssssssssssssssssssssssssssssss]", "theme",
- "back", "text", "text_hi", "header",
- "panel", "shade1", "shade2", "hilite",
- "grid", "wire", "select", "lamp", "active",
- "group", "group_active",
- "transform", "vertex", "vertex_select",
- "edge", "edge_select", "edge_seam", "edge_sharp", "editmesh_active",
- "edge_facesel", "face", "face_select",
- "face_dot", "normal", "bone_solid", "bone_pose",
- "strip", "strip_select",
- "syntaxl", "syntaxn", "syntaxb", "syntaxv", "syntaxc",
- "movie", "image", "scene", "audio", "effect", "plugin",
- "transition", "meta",
- "vertex_size", "facedot_size" );
-
- if( attrib != Py_None )
- return attrib;
-
- return Py_FindMethod( BPy_ThemeSpace_methods, ( PyObject * ) self,
- name );
-}
-
-static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name,
- PyObject * value )
-{
- PyObject *attrib = NULL;
- ThemeSpace *tsp = self->tsp;
- int ret = -1;
-
- if( !strcmp( name, "back" ) )
- attrib = charRGBA_New( &tsp->back[0] );
- ELSEIF_TSP_RGBA( text )
- ELSEIF_TSP_RGBA( text_hi )
- ELSEIF_TSP_RGBA( header )
- ELSEIF_TSP_RGBA( panel )
- ELSEIF_TSP_RGBA( shade1 )
- ELSEIF_TSP_RGBA( shade2 )
- ELSEIF_TSP_RGBA( hilite )
- ELSEIF_TSP_RGBA( grid )
- ELSEIF_TSP_RGBA( wire )
- ELSEIF_TSP_RGBA( select )
- ELSEIF_TSP_RGBA( lamp )
- ELSEIF_TSP_RGBA( active )
- ELSEIF_TSP_RGBA( group )
- ELSEIF_TSP_RGBA( group_active )
- ELSEIF_TSP_RGBA( transform )
- ELSEIF_TSP_RGBA( vertex )
- ELSEIF_TSP_RGBA( vertex_select )
- ELSEIF_TSP_RGBA( edge )
- ELSEIF_TSP_RGBA( edge_select )
- ELSEIF_TSP_RGBA( edge_seam )
- ELSEIF_TSP_RGBA( edge_sharp )
- ELSEIF_TSP_RGBA( editmesh_active )
- ELSEIF_TSP_RGBA( edge_facesel )
- ELSEIF_TSP_RGBA( face )
- ELSEIF_TSP_RGBA( face_select )
- ELSEIF_TSP_RGBA( face_dot )
- ELSEIF_TSP_RGBA( normal )
- ELSEIF_TSP_RGBA( bone_solid )
- ELSEIF_TSP_RGBA( bone_pose )
- ELSEIF_TSP_RGBA( strip )
- ELSEIF_TSP_RGBA( strip_select )
- ELSEIF_TSP_RGBA( syntaxl )
- ELSEIF_TSP_RGBA( syntaxn )
- ELSEIF_TSP_RGBA( syntaxb )
- ELSEIF_TSP_RGBA( syntaxv )
- ELSEIF_TSP_RGBA( syntaxc )
- ELSEIF_TSP_RGBA( movie )
- ELSEIF_TSP_RGBA( image )
- ELSEIF_TSP_RGBA( scene )
- ELSEIF_TSP_RGBA( audio )
- ELSEIF_TSP_RGBA( effect )
- ELSEIF_TSP_RGBA( plugin )
- ELSEIF_TSP_RGBA( transition )
- ELSEIF_TSP_RGBA( meta )
- else if( !strcmp( name, "vertex_size" ) ) {
- int val;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer value" );
-
- val = ( int ) PyInt_AsLong( value );
- tsp->vertex_size = (char)EXPP_ClampInt( val,
- EXPP_THEME_VTX_SIZE_MIN,
- EXPP_THEME_VTX_SIZE_MAX );
- ret = 0;
- }
- else if( !strcmp( name, "facedot_size" ) ) {
- int val;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer value" );
-
- val = ( int ) PyInt_AsLong( value );
- tsp->vertex_size = (char)EXPP_ClampInt( val,
- EXPP_THEME_FDOT_SIZE_MIN,
- EXPP_THEME_FDOT_SIZE_MAX );
- ret = 0;
- } else
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute not found" );
-
- if( attrib ) {
- PyObject *pyret = NULL;
- PyObject *valtuple = Py_BuildValue( "(O)", value );
-
- if( !valtuple )
- return EXPP_ReturnIntError( PyExc_MemoryError,
- "couldn't create tuple!" );
-
- pyret = charRGBA_setCol( ( BPy_charRGBA * ) attrib, valtuple );
- Py_DECREF( valtuple );
-
- if( pyret == Py_None ) {
- Py_DECREF( Py_None ); /* was increfed by charRGBA_setCol */
- ret = 0;
- }
-
- Py_DECREF( attrib ); /* we're done with it */
- }
-
- return ret; /* 0 if all went well */
-}
-
-static int ThemeSpace_compare( BPy_ThemeSpace * a, BPy_ThemeSpace * b )
-{
- ThemeSpace *pa = a->tsp, *pb = b->tsp;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static PyObject *ThemeSpace_repr( BPy_ThemeSpace * self )
-{
- return PyString_FromFormat( "[Space theme from theme \"%s\"]",
- self->theme->name );
-}
-
-static void ThemeUI_dealloc( BPy_ThemeUI * self );
-static int ThemeUI_compare( BPy_ThemeUI * a, BPy_ThemeUI * b );
-static PyObject *ThemeUI_repr( BPy_ThemeUI * self );
-static PyObject *ThemeUI_getAttr( BPy_ThemeUI * self, char *name );
-static int ThemeUI_setAttr( BPy_ThemeUI * self, char *name, PyObject * val );
-
-static PyMethodDef BPy_ThemeUI_methods[] = {
- {NULL, NULL, 0, NULL}
-};
-
-PyTypeObject ThemeUI_Type = {
- PyObject_HEAD_INIT( NULL ) 0, /* ob_size */
- "Blender UI Theme", /* tp_name */
- sizeof( BPy_ThemeUI ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) ThemeUI_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) ThemeUI_getAttr, /* tp_getattr */
- ( setattrfunc ) ThemeUI_setAttr, /* tp_setattr */
- ( cmpfunc ) ThemeUI_compare, /* tp_compare */
- ( reprfunc ) ThemeUI_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0, 0,
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- 0, //BPy_ThemeUI_methods, /* tp_methods */
- 0, /* tp_members */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-static void ThemeUI_dealloc( BPy_ThemeUI * self )
-{
- PyObject_DEL( self );
-}
-
-#define ELSEIF_TUI_RGBA(attr)\
- else if (!strcmp(name, #attr))\
- attrib = charRGBA_New(&tui->attr[0]);
-
-/* Example: ELSEIF_TUI_RGBA(outline) becomes:
- * else if (!strcmp(name, "outline")
- * attr = charRGBA_New(&tui->outline[0])
- */
-
-static PyObject *ThemeUI_getAttr( BPy_ThemeUI * self, char *name )
-{
- PyObject *attrib = Py_None;
- ThemeUI *tui = self->tui;
-
- if( !strcmp( name, "theme" ) )
- attrib = PyString_FromString( self->theme->name );
- ELSEIF_TUI_RGBA( outline )
- ELSEIF_TUI_RGBA( neutral )
- ELSEIF_TUI_RGBA( action )
- ELSEIF_TUI_RGBA( setting )
- ELSEIF_TUI_RGBA( setting1 )
- ELSEIF_TUI_RGBA( setting2 )
- ELSEIF_TUI_RGBA( num )
- ELSEIF_TUI_RGBA( textfield )
- ELSEIF_TUI_RGBA( textfield_hi )
- ELSEIF_TUI_RGBA( popup )
- ELSEIF_TUI_RGBA( text )
- ELSEIF_TUI_RGBA( text_hi )
- ELSEIF_TUI_RGBA( menu_back )
- ELSEIF_TUI_RGBA( menu_item )
- ELSEIF_TUI_RGBA( menu_hilite )
- ELSEIF_TUI_RGBA( menu_text )
- ELSEIF_TUI_RGBA( menu_text_hi )
- else if( !strcmp( name, "drawType" ) )
- attrib = PyInt_FromLong( ( char ) tui->but_drawtype );
- else if( !strcmp( name, "iconTheme" ) )
- attrib = PyString_FromString( tui->iconfile );
- else if( !strcmp( name, "__members__" ) )
- attrib = Py_BuildValue( "[ssssssssssssssssssss]", "theme",
- "outline", "neutral", "action",
- "setting", "setting1", "setting2",
- "num", "textfield", "textfield_hi", "popup", "text",
- "text_hi", "menu_back", "menu_item",
- "menu_hilite", "menu_text",
- "menu_text_hi", "drawType", "iconTheme" );
-
- if( attrib != Py_None )
- return attrib;
-
- return Py_FindMethod( BPy_ThemeUI_methods, ( PyObject * ) self, name );
-}
-
-static int ThemeUI_setAttr( BPy_ThemeUI * self, char *name, PyObject * value )
-{
- PyObject *attrib = NULL;
- ThemeUI *tui = self->tui;
- int ret = -1;
-
- if( !strcmp( name, "outline" ) )
- attrib = charRGBA_New( &tui->outline[0] );
- ELSEIF_TUI_RGBA( neutral )
- ELSEIF_TUI_RGBA( action )
- ELSEIF_TUI_RGBA( setting )
- ELSEIF_TUI_RGBA( setting1 )
- ELSEIF_TUI_RGBA( setting2 )
- ELSEIF_TUI_RGBA( num )
- ELSEIF_TUI_RGBA( textfield )
- ELSEIF_TUI_RGBA( textfield_hi )
- ELSEIF_TUI_RGBA( popup )
- ELSEIF_TUI_RGBA( text )
- ELSEIF_TUI_RGBA( text_hi )
- ELSEIF_TUI_RGBA( menu_back )
- ELSEIF_TUI_RGBA( menu_item )
- ELSEIF_TUI_RGBA( menu_hilite )
- ELSEIF_TUI_RGBA( menu_text )
- ELSEIF_TUI_RGBA( menu_text_hi )
- else if( !strcmp( name, "drawType" ) ) {
- int val;
-
- if( !PyInt_Check( value ) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected integer value" );
-
- val = ( int ) PyInt_AsLong( value );
- tui->but_drawtype = (char)EXPP_ClampInt( val,
- EXPP_THEME_DRAWTYPE_MIN,
- EXPP_THEME_DRAWTYPE_MAX );
- ret = 0;
- } else if ( !strcmp( name, "iconTheme" ) ) {
- if ( !PyString_Check(value) )
- return EXPP_ReturnIntError( PyExc_TypeError,
- "expected string value" );
- BLI_strncpy(tui->iconfile, PyString_AsString(value), 80);
-
- BIF_icons_free();
- BIF_icons_init(BIFICONID_LAST+1);
-
- ret = 0;
- } else
- return EXPP_ReturnIntError( PyExc_AttributeError,
- "attribute not found" );
-
- if( attrib ) {
- PyObject *pyret = NULL;
- PyObject *valtuple = Py_BuildValue( "(O)", value );
-
- if( !valtuple )
- return EXPP_ReturnIntError( PyExc_MemoryError,
- "couldn't create tuple!" );
-
- pyret = charRGBA_setCol( ( BPy_charRGBA * ) attrib, valtuple );
- Py_DECREF( valtuple );
-
- if( pyret == Py_None ) {
- Py_DECREF( Py_None ); /* was increfed by charRGBA_setCol */
- ret = 0;
- }
-
- Py_DECREF( attrib ); /* we're done with it */
- }
-
- return ret; /* 0 if all went well */
-}
-
-
-static int ThemeUI_compare( BPy_ThemeUI * a, BPy_ThemeUI * b )
-{
- ThemeUI *pa = a->tui, *pb = b->tui;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static PyObject *ThemeUI_repr( BPy_ThemeUI * self )
-{
- return PyString_FromFormat( "[UI theme from theme \"%s\"]",
- self->theme->name );
-}
-
-static void Theme_dealloc( BPy_Theme * self );
-static int Theme_compare( BPy_Theme * a, BPy_Theme * b );
-static PyObject *Theme_getAttr( BPy_Theme * self, char *name );
-static PyObject *Theme_repr( BPy_Theme * self );
-
-static PyObject *Theme_get( BPy_Theme * self, PyObject * args );
-static PyObject *Theme_getName( BPy_Theme * self );
-static PyObject *Theme_setName( BPy_Theme * self, PyObject * value );
-
-static PyMethodDef BPy_Theme_methods[] = {
- {"get", ( PyCFunction ) Theme_get, METH_VARARGS,
- "(param) - Return UI or Space theme object.\n\
-(param) - the chosen theme object as an int or a string:\n\
-- () - default: UI;\n\
-- (i) - int: an entry from the Blender.Window.Types dictionary;\n\
-- (s) - string: 'UI' or a space name, like 'VIEW3D', etc."},
- {"getName", ( PyCFunction ) Theme_getName, METH_NOARGS,
- "() - Return Theme name"},
- {"setName", ( PyCFunction ) Theme_setName, METH_O,
- "(s) - Set Theme name"},
- {NULL, NULL, 0, NULL}
-};
-
-PyTypeObject Theme_Type = {
- PyObject_HEAD_INIT( NULL )
- 0, /* ob_size */
- "Blender Theme", /* tp_name */
- sizeof( BPy_Theme ), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- ( destructor ) Theme_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- ( getattrfunc ) Theme_getAttr, /* tp_getattr */
- 0, //(setattrfunc) Theme_setAttr, /* tp_setattr */
- ( cmpfunc ) Theme_compare, /* tp_compare */
- ( reprfunc ) Theme_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0, 0, 0, 0, 0, 0,
- 0, /* tp_doc */
- 0, 0, 0, 0, 0, 0,
- 0, /*BPy_Theme_methods,*/ /* tp_methods */
- 0, /* tp_members */
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-};
-
-static PyObject *M_Theme_New( PyObject * self, PyObject * args )
-{
- char *name = "New Theme";
- BPy_Theme *pytheme = NULL, *base_pytheme = NULL;
- bTheme *btheme = NULL, *newtheme = NULL;
-
- if( !PyArg_ParseTuple
- ( args, "|sO!", &name, &Theme_Type, &base_pytheme ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected nothing or a name and optional theme object as arguments" );
-
- if( base_pytheme )
- btheme = base_pytheme->theme;
- if( !btheme )
- btheme = U.themes.first;
-
- newtheme = MEM_callocN( sizeof( bTheme ), "theme" );
-
- if( newtheme )
- pytheme = PyObject_New( BPy_Theme, &Theme_Type );
- if( !pytheme )
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "couldn't create Theme Data in Blender" );
-
- memcpy( newtheme, btheme, sizeof( bTheme ) );
- BLI_addhead( &U.themes, newtheme );
- BLI_strncpy( newtheme->name, name, 32 );
-
- pytheme->theme = newtheme;
-
- return ( PyObject * ) pytheme;
-}
-
-static PyObject *M_Theme_Get( PyObject * self, PyObject * args )
-{
- char *name = NULL;
- bTheme *iter;
- PyObject *ret;
-
- if( !PyArg_ParseTuple( args, "|s", &name ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument (or nothing)" );
-
- iter = U.themes.first;
-
- if( name ) { /* (name) - return requested theme */
- BPy_Theme *wanted = NULL;
-
- while( iter ) {
- if( strcmp( name, iter->name ) == 0 ) {
- wanted = PyObject_New( BPy_Theme,
- &Theme_Type );
- wanted->theme = iter;
- break;
- }
- iter = iter->next;
- }
-
- if( !wanted ) {
- char emsg[64];
- PyOS_snprintf( emsg, sizeof( emsg ),
- "Theme \"%s\" not found", name );
- return EXPP_ReturnPyObjError( PyExc_NameError, emsg );
- }
-
- ret = ( PyObject * ) wanted;
- }
-
- else { /* () - return list with all themes */
- int index = 0;
- PyObject *list = NULL;
- BPy_Theme *pytheme = NULL;
-
- list = PyList_New( BLI_countlist( &( U.themes ) ) );
-
- if( !list )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create PyList" );
-
- while( iter ) {
- pytheme = PyObject_New( BPy_Theme, &Theme_Type );
- pytheme->theme = iter;
-
- if( !pytheme ) {
- Py_DECREF(list);
- return EXPP_ReturnPyObjError
- ( PyExc_MemoryError,
- "couldn't create Theme PyObject" );
- }
- PyList_SET_ITEM( list, index, ( PyObject * ) pytheme );
-
- iter = iter->next;
- index++;
- }
-
- ret = list;
- }
-
- return ret;
-}
-
-static PyObject *Theme_get( BPy_Theme * self, PyObject * args )
-{
- bTheme *btheme = self->theme;
- ThemeUI *tui = NULL;
- ThemeSpace *tsp = NULL;
- PyObject *pyob = NULL;
- BPy_ThemeUI *retUI = NULL;
- BPy_ThemeSpace *retSpc = NULL;
- int type;
-
- if( !PyArg_ParseTuple( args, "|O", &pyob ) )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string or int argument or nothing" );
-
- if( !pyob ) { /* (): return list with all names */
- PyObject *ret = PyList_New( EXPP_THEME_NUMBEROFTHEMES );
-
- if( !ret )
- return EXPP_ReturnPyObjError( PyExc_MemoryError,
- "couldn't create pylist!" );
-
- type = 0; /* using as a counter only */
-
- while( type < EXPP_THEME_NUMBEROFTHEMES ) {
- PyList_SET_ITEM( ret, type,
- PyString_FromString( themes_map[type].sval ) );
- type++;
- }
-
- return ret;
- }
-
- else if( PyInt_Check( pyob ) ) /* (int) */
- type = ( int ) PyInt_AsLong( pyob );
- else if( PyString_Check( pyob ) ) { /* (str) */
- char *str = PyString_AsString( pyob );
- if( !EXPP_map_case_getIntVal( themes_map, str, &type ) )
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "unknown string argument" );
- } else
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string or int argument or nothing" );
-
- switch ( type ) {
- case -1: /* UI */
- tui = &btheme->tui;
- break;
- case SPACE_BUTS:
- tsp = &btheme->tbuts;
- break;
- case SPACE_VIEW3D:
- tsp = &btheme->tv3d;
- break;
- case SPACE_FILE:
- tsp = &btheme->tfile;
- break;
- case SPACE_IPO:
- tsp = &btheme->tipo;
- break;
- case SPACE_INFO:
- tsp = &btheme->tinfo;
- break;
- case SPACE_SOUND:
- tsp = &btheme->tsnd;
- break;
- case SPACE_ACTION:
- tsp = &btheme->tact;
- break;
- case SPACE_NLA:
- tsp = &btheme->tnla;
- break;
- case SPACE_SEQ:
- tsp = &btheme->tseq;
- break;
- case SPACE_IMAGE:
- tsp = &btheme->tima;
- break;
- case SPACE_IMASEL:
- tsp = &btheme->timasel;
- break;
- case SPACE_TEXT:
- tsp = &btheme->text;
- break;
- case SPACE_OOPS:
- tsp = &btheme->toops;
- break;
- case SPACE_TIME:
- tsp = &btheme->ttime;
- break;
- case SPACE_NODE:
- tsp = &btheme->tnode;
- break;
- }
-
- if( tui ) {
- retUI = PyObject_New( BPy_ThemeUI, &ThemeUI_Type );
- retUI->theme = btheme;
- retUI->tui = tui;
- return ( PyObject * ) retUI;
- } else if( tsp ) {
- retSpc = PyObject_New( BPy_ThemeSpace, &ThemeSpace_Type );
- retSpc->theme = btheme;
- retSpc->tsp = tsp;
- return ( PyObject * ) retSpc;
- } else
- return EXPP_ReturnPyObjError( PyExc_AttributeError,
- "invalid parameter" );
-}
-
-static PyObject *Theme_getName( BPy_Theme * self )
-{
- return PyString_FromString( self->theme->name );
-}
-
-static PyObject *Theme_setName( BPy_Theme * self, PyObject * value )
-{
- char *name = PyString_AsString(value);
-
- if( !name )
- return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected string argument" );
-
- BLI_strncpy( self->theme->name, name, 32 );
-
- return EXPP_incr_ret( Py_None );
-}
-
-PyObject *Theme_Init( void )
-{
- PyObject *submodule;
-
- Theme_Type.ob_type = &PyType_Type;
-
- submodule = Py_InitModule3( "Blender.Window.Theme",
- M_Theme_methods, M_Theme_doc );
-
- return submodule;
-}
-
-static void Theme_dealloc( BPy_Theme * self )
-{
- PyObject_DEL( self );
-}
-
-static PyObject *Theme_getAttr( BPy_Theme * self, char *name )
-{
- if( !strcmp( name, "name" ) )
- return PyString_FromString( self->theme->name );
- else if( !strcmp( name, "__members__" ) )
- return Py_BuildValue( "[s]", "name" );
-
- return Py_FindMethod( BPy_Theme_methods, ( PyObject * ) self, name );
-}
-
-static int Theme_compare( BPy_Theme * a, BPy_Theme * b )
-{
- bTheme *pa = a->theme, *pb = b->theme;
- return ( pa == pb ) ? 0 : -1;
-}
-
-static PyObject *Theme_repr( BPy_Theme * self )
-{
- return PyString_FromFormat( "[Theme \"%s\"]", self->theme->name );
-}
diff --git a/source/blender/python/api2_2x/windowTheme.h b/source/blender/python/api2_2x/windowTheme.h
deleted file mode 100644
index 352a15e8c0e..00000000000
--- a/source/blender/python/api2_2x/windowTheme.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
- *
- * ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_WINDOWTHEME_H
-#define EXPP_WINDOWTHEME_H
-
-#include <Python.h>
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-
-typedef struct {
- PyObject_HEAD struct bTheme *theme;
- struct ThemeUI *tui;
-
-} BPy_ThemeUI;
-
-typedef struct {
- PyObject_HEAD struct bTheme *theme;
- struct ThemeSpace *tsp;
-
-} BPy_ThemeSpace;
-
-typedef struct {
- PyObject_HEAD struct bTheme *theme;
-
-} BPy_Theme;
-
-PyObject *Theme_Init( void );
-
-#endif /* EXPP_WINDOWTHEME_H */
diff --git a/source/blender/python/api2_2x/Makefile b/source/blender/python/intern/Makefile
index a2b77bf8c98..3d6ce51c9bd 100644
--- a/source/blender/python/api2_2x/Makefile
+++ b/source/blender/python/intern/Makefile
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -29,43 +29,47 @@
#
LIBNAME = python
-DIR = $(OCGDIR)/blender/python
-
-CSRCS ?= $(wildcard *.c) $(wildcard ../*.c)
+DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
-ifdef NAN_BUILDINFO
- CPPFLAGS += -DNAN_BUILDINFO
-endif
+# OpenGL and Python
+CPPFLAGS += $(OGL_CPPFLAGS)
+CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-ifeq ($(WITH_FFMPEG), true)
- CPPFLAGS += -DWITH_FFMPEG
-endif
+# PreProcessor stuff
-ifeq ($(WITH_OPENEXR),true)
- CPPFLAGS += -DWITH_OPENEXR
-endif
+CPPFLAGS += -I$(NAN_GHOST)/include
+CPPFLAGS += -I$(NAN_BMFONT)/include
+CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
-CPPFLAGS += -I$(NAN_GLEW)/include
-CPPFLAGS += -I$(OPENGL_HEADERS)
-CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+# modules
+CPPFLAGS += -I../../editors/include
+CPPFLAGS += -I../../python
CPPFLAGS += -I../../makesdna
-CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../nodes
+CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenloader
-CPPFLAGS += -I../../include
-CPPFLAGS += -I../../gpu
CPPFLAGS += -I../../render/extern/include
-CPPFLAGS += -I../../radiosity/extern/include
-CPPFLAGS += -I$(NAN_BMFONT)/include
-CPPFLAGS += -I../../imbuf
-CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-# We'll just add a little duct tape to fix things here ...
-.PHONY: clean
-clean::
- @rm -f $(OCGDIR)/blender/BPY_*.o
- @rm -f $(OCGDIR)/blender/BPY_*.d
+# path to the guarded memory allocator
+CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
+CPPFLAGS += -I$(NAN_MEMUTIL)/include
+
+
+ifeq ($(WITH_VERSE), true)
+ CPPFLAGS += -DWITH_VERSE
+ CPPFLAGS += -I$(NAN_VERSE)/include
+ # print some other debug information
+ ifeq ($(VERSE_DEBUG_PRINT), true)
+ CPPFLAGS += -DVERSE_DEBUG_PRINT
+ endif
+endif
+
+# path to our own headerfiles
+CPPFLAGS += -I..
diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h
new file mode 100644
index 00000000000..348947b7fcb
--- /dev/null
+++ b/source/blender/python/intern/bpy_compat.h
@@ -0,0 +1,60 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/* This file is only to contain definitions to functions that enable
+ * the python api to compile with different python versions.
+ * no utility functions please
+ */
+
+#ifndef BPY_COMPAT_H__
+#define BPY_COMPAT_H__
+
+/* if you are NOT using python 3.0 - define these */
+#if PY_VERSION_HEX < 0x03000000
+#define _PyUnicode_AsString PyString_AsString
+
+#undef PyUnicode_Check
+#define PyUnicode_Check PyString_Check
+
+#define PyLong_FromSize_t PyInt_FromLong
+#define PyLong_AsSsize_t PyInt_AsLong
+
+#undef PyLong_Check
+#define PyLong_Check PyInt_Check
+
+#define PyUnicode_FromString PyString_FromString
+#define PyUnicode_FromFormat PyString_FromFormat
+
+#endif
+
+/* older then python 2.6 - define these */
+// #if (PY_VERSION_HEX < 0x02060000)
+// #endif
+
+/* older then python 2.5 - define these */
+#if (PY_VERSION_HEX < 0x02050000)
+#define Py_ssize_t ssize_t
+#endif
+
+#endif /* BPY_COMPAT_H__ */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
new file mode 100644
index 00000000000..8ae7dcb5c88
--- /dev/null
+++ b/source/blender/python/intern/bpy_interface.c
@@ -0,0 +1,85 @@
+
+#include <Python.h>
+#include "compile.h" /* for the PyCodeObject */
+#include "eval.h" /* for PyEval_EvalCode */
+
+#include "bpy_compat.h"
+
+#include "bpy_rna.h"
+
+
+/*****************************************************************************
+* Description: This function creates a new Python dictionary object.
+*****************************************************************************/
+
+static PyObject *CreateGlobalDictionary( void )
+{
+ PyObject *dict = PyDict_New( );
+ PyObject *item = PyUnicode_FromString( "__main__" );
+ PyDict_SetItemString( dict, "__builtins__", PyEval_GetBuiltins( ) );
+ PyDict_SetItemString( dict, "__name__", item );
+ Py_DECREF(item);
+
+ /* Add Modules */
+ item = BPY_rna_module();
+ PyDict_SetItemString( dict, "bpy", item );
+ Py_DECREF(item);
+
+
+ return dict;
+}
+
+static void BPY_start_python( void )
+{
+ PyThreadState *py_tstate = NULL;
+
+ Py_Initialize( );
+
+ //PySys_SetArgv( argc_copy, argv_copy );
+
+ /* Initialize thread support (also acquires lock) */
+ PyEval_InitThreads();
+
+ // todo - sys paths - our own imports
+
+ py_tstate = PyGILState_GetThisThreadState();
+ PyEval_ReleaseThread(py_tstate);
+
+}
+
+static void BPY_end_python( void )
+{
+ PyGILState_Ensure(); /* finalizing, no need to grab the state */
+
+ // free other python data.
+
+ Py_Finalize( );
+ return;
+}
+
+void BPY_run_python_script( const char *fn )
+{
+ PyObject *py_dict, *py_result;
+ char pystring[512];
+ PyGILState_STATE gilstate;
+
+ /* TODO - look into a better way to run a file */
+ sprintf(pystring, "exec(open(r'%s').read())", fn);
+
+ BPY_start_python();
+
+ gilstate = PyGILState_Ensure();
+
+ py_dict = CreateGlobalDictionary();
+
+ py_result = PyRun_String( pystring, Py_file_input, py_dict, py_dict );
+
+ if (!py_result)
+ PyErr_Print();
+ else
+ Py_DECREF( py_result );
+
+ PyGILState_Release(gilstate);
+
+ BPY_end_python();
+}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
new file mode 100644
index 00000000000..0267fa35fd2
--- /dev/null
+++ b/source/blender/python/intern/bpy_rna.c
@@ -0,0 +1,1147 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "bpy_rna.h"
+#include "bpy_compat.h"
+//#include "blendef.h"
+#include "BLI_dynstr.h"
+
+#include "MEM_guardedalloc.h"
+#include "BKE_global.h" /* evil G.* */
+
+/* floats bigger then this are displayed as inf in the docstrings */
+#define MAXFLOAT_DOC 10000000
+
+static int pyrna_struct_compare( BPy_StructRNA * a, BPy_StructRNA * b )
+{
+ return (a->ptr.data==b->ptr.data) ? 0 : -1;
+}
+
+static int pyrna_prop_compare( BPy_PropertyRNA * a, BPy_PropertyRNA * b )
+{
+ return (a->prop==b->prop && a->ptr.data==b->ptr.data ) ? 0 : -1;
+}
+
+/*----------------------repr--------------------------------------------*/
+static PyObject *pyrna_struct_repr( BPy_StructRNA * self )
+{
+ return PyUnicode_FromFormat( "[BPy_StructRNA \"%s\"]", RNA_struct_identifier(&self->ptr));
+}
+
+static PyObject *pyrna_prop_repr( BPy_PropertyRNA * self )
+{
+ return PyUnicode_FromFormat( "[BPy_PropertyRNA \"%s\" -> \"%s\" ]", RNA_struct_identifier(&self->ptr), RNA_property_identifier(&self->ptr, self->prop) );
+}
+
+static long pyrna_struct_hash( BPy_StructRNA * self )
+{
+ return (long)self->ptr.data;
+}
+
+
+static PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
+{
+ PyObject *ret;
+ int type = RNA_property_type(ptr, prop);
+ int len = RNA_property_array_length(ptr, prop);
+ /* resolve path */
+
+ if (len > 0) {
+ /* resolve the array from a new pytype */
+ return pyrna_prop_CreatePyObject(ptr, prop);
+ }
+
+ /* see if we can coorce into a python type - PropertyType */
+ switch (type) {
+ case PROP_BOOLEAN:
+ ret = PyBool_FromLong( RNA_property_boolean_get(ptr, prop) );
+ break;
+ case PROP_INT:
+ ret = PyLong_FromSize_t( (size_t)RNA_property_int_get(ptr, prop) );
+ break;
+ case PROP_FLOAT:
+ ret = PyFloat_FromDouble( RNA_property_float_get(ptr, prop) );
+ break;
+ case PROP_STRING:
+ {
+ char *buf;
+ buf = RNA_property_string_get_alloc(ptr, prop, NULL, -1);
+ ret = PyUnicode_FromString( buf );
+ MEM_freeN(buf);
+ break;
+ }
+ case PROP_ENUM:
+ {
+ const char *identifier;
+ int val = RNA_property_enum_get(ptr, prop);
+
+ if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) {
+ ret = PyUnicode_FromString( identifier );
+ } else {
+ PyErr_Format(PyExc_AttributeError, "enum \"%d\" not found", val);
+ ret = NULL;
+ }
+
+ break;
+ }
+ case PROP_POINTER:
+ {
+ PointerRNA newptr;
+ RNA_property_pointer_get(ptr, prop, &newptr);
+ if (newptr.data) {
+ ret = pyrna_struct_CreatePyObject(&newptr);
+ } else {
+ ret = Py_None;
+ Py_INCREF(ret);
+ }
+ break;
+ }
+ case PROP_COLLECTION:
+ ret = pyrna_prop_CreatePyObject(ptr, prop);
+ break;
+ default:
+ PyErr_SetString(PyExc_AttributeError, "unknown type (pyrna_prop_to_py)");
+ ret = NULL;
+ break;
+ }
+
+ return ret;
+}
+
+
+static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
+{
+ int type = RNA_property_type(ptr, prop);
+ int len = RNA_property_array_length(ptr, prop);
+ /* resolve path */
+
+ if (len > 0) {
+ PyObject *item;
+ int i;
+
+ if (!PySequence_Check(value)) {
+ PyErr_SetString(PyExc_TypeError, "expected a python sequence type assigned to an RNA array.");
+ return -1;
+ }
+
+ if ((int)PySequence_Length(value) != len) {
+ PyErr_SetString(PyExc_AttributeError, "python sequence length did not match the RNA array.");
+ return -1;
+ }
+
+ /* for arrays we have a limited number of types */
+ switch (type) {
+ case PROP_BOOLEAN:
+ {
+ signed char *param_arr = MEM_mallocN(sizeof(char) * len, "pyrna bool array");
+
+ /* collect the variables before assigning, incase one of them is incorrect */
+ for (i=0; i<len; i++) {
+ item = PySequence_GetItem(value, i);
+ param_arr[i] = PyObject_IsTrue( item );
+ Py_DECREF(item);
+
+ if (param_arr[i] < 0) {
+ MEM_freeN(param_arr);
+ PyErr_SetString(PyExc_AttributeError, "one or more of the values in the sequence is not a boolean");
+ return -1;
+ }
+ }
+
+ for (i=0; i<len; i++) {
+ RNA_property_boolean_set_array(ptr, prop, i, param_arr[i]);
+ }
+
+ MEM_freeN(param_arr);
+ break;
+ }
+ case PROP_INT:
+ {
+ int *param_arr = MEM_mallocN(sizeof(int) * len, "pyrna int array");
+
+ /* collect the variables before assigning, incase one of them is incorrect */
+ for (i=0; i<len; i++) {
+ item = PySequence_GetItem(value, i);
+ param_arr[i] = (int)PyLong_AsSsize_t(item); /* deal with any errors later */
+ Py_DECREF(item);
+ }
+
+ if (PyErr_Occurred()) {
+ MEM_freeN(param_arr);
+ PyErr_SetString(PyExc_AttributeError, "one or more of the values in the sequence could not be used as an int");
+ return -1;
+ }
+
+ for (i=0; i<len; i++) {
+ RNA_property_int_set_array(ptr, prop, i, param_arr[i]);
+ }
+
+ MEM_freeN(param_arr);
+ break;
+ }
+ case PROP_FLOAT:
+ {
+ float *param_arr = MEM_mallocN(sizeof(float) * len, "pyrna float array");
+
+ /* collect the variables before assigning, incase one of them is incorrect */
+ for (i=0; i<len; i++) {
+ item = PySequence_GetItem(value, i);
+ param_arr[i] = (float)PyFloat_AsDouble(item); /* deal with any errors later */
+ Py_DECREF(item);
+ }
+
+ if (PyErr_Occurred()) {
+ MEM_freeN(param_arr);
+ PyErr_SetString(PyExc_AttributeError, "one or more of the values in the sequence could not be used as a float");
+ return -1;
+ }
+
+ for (i=0; i<len; i++) {
+ RNA_property_float_set_array(ptr, prop, i, param_arr[i]);
+ }
+
+ MEM_freeN(param_arr);
+ break;
+ }
+ }
+ } else {
+ /* Normal Property (not an array) */
+
+ /* see if we can coorce into a python type - PropertyType */
+ switch (type) {
+ case PROP_BOOLEAN:
+ {
+ int param = PyObject_IsTrue( value );
+
+ if( param < 0 ) {
+ PyErr_SetString(PyExc_TypeError, "expected True/False or 0/1");
+ return -1;
+ } else {
+ RNA_property_boolean_set(ptr, prop, param);
+ }
+ break;
+ }
+ case PROP_INT:
+ {
+ int param = PyLong_AsSsize_t(value);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "expected an int type");
+ return -1;
+ } else {
+ RNA_property_int_set(ptr, prop, param);
+ }
+ break;
+ }
+ case PROP_FLOAT:
+ {
+ float param = PyFloat_AsDouble(value);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "expected a float type");
+ return -1;
+ } else {
+ RNA_property_float_set(ptr, prop, param);
+ }
+ break;
+ }
+ case PROP_STRING:
+ {
+ char *param = _PyUnicode_AsString(value);
+
+ if (param==NULL) {
+ PyErr_SetString(PyExc_TypeError, "expected a string type");
+ return -1;
+ } else {
+ RNA_property_string_set(ptr, prop, param);
+ }
+ break;
+ }
+ case PROP_ENUM:
+ {
+ char *param = _PyUnicode_AsString(value);
+
+ if (param==NULL) {
+ PyErr_SetString(PyExc_TypeError, "expected a string type");
+ return -1;
+ } else {
+ int val;
+ if (RNA_property_enum_value(ptr, prop, param, &val)) {
+ RNA_property_enum_set(ptr, prop, val);
+ } else {
+ PyErr_Format(PyExc_AttributeError, "enum \"%s\" not found", param);
+ return -1;
+ }
+ }
+
+ break;
+ }
+ case PROP_POINTER:
+ {
+ PyErr_SetString(PyExc_AttributeError, "cant assign pointers yet");
+ return -1;
+ break;
+ }
+ case PROP_COLLECTION:
+ PyErr_SetString(PyExc_AttributeError, "cant assign to collections");
+ return -1;
+ break;
+ default:
+ PyErr_SetString(PyExc_AttributeError, "unknown property type (pyrna_py_to_prop)");
+ return -1;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+
+static PyObject * pyrna_prop_to_py_index(PointerRNA *ptr, PropertyRNA *prop, int index)
+{
+ PyObject *ret;
+ int type = RNA_property_type(ptr, prop);
+
+ /* resolve path */
+
+ /* see if we can coorce into a python type - PropertyType */
+ switch (type) {
+ case PROP_BOOLEAN:
+ ret = PyBool_FromLong( RNA_property_boolean_get_array(ptr, prop, index) );
+ break;
+ case PROP_INT:
+ ret = PyLong_FromSize_t( (size_t)RNA_property_int_get_array(ptr, prop, index) );
+ break;
+ case PROP_FLOAT:
+ ret = PyFloat_FromDouble( RNA_property_float_get_array(ptr, prop, index) );
+ break;
+ default:
+ PyErr_SetString(PyExc_AttributeError, "not an array type");
+ ret = NULL;
+ break;
+ }
+
+ return ret;
+}
+
+static int pyrna_py_to_prop_index(PointerRNA *ptr, PropertyRNA *prop, int index, PyObject *value)
+{
+ int ret = 0;
+ int type = RNA_property_type(ptr, prop);
+
+ /* resolve path */
+
+ /* see if we can coorce into a python type - PropertyType */
+ switch (type) {
+ case PROP_BOOLEAN:
+ {
+ int param = PyObject_IsTrue( value );
+
+ if( param < 0 ) {
+ PyErr_SetString(PyExc_TypeError, "expected True/False or 0/1");
+ ret = -1;
+ } else {
+ RNA_property_boolean_set_array(ptr, prop, index, param);
+ }
+ break;
+ }
+ case PROP_INT:
+ {
+ int param = PyLong_AsSsize_t(value);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "expected an int type");
+ ret = -1;
+ } else {
+ RNA_property_int_set_array(ptr, prop, index, param);
+ }
+ break;
+ }
+ case PROP_FLOAT:
+ {
+ float param = PyFloat_AsDouble(value);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "expected a float type");
+ ret = -1;
+ } else {
+ RNA_property_float_set_array(ptr, prop, index, param);
+ }
+ break;
+ }
+ default:
+ PyErr_SetString(PyExc_AttributeError, "not an array type");
+ ret = -1;
+ break;
+ }
+
+ return ret;
+}
+
+//---------------sequence-------------------------------------------
+static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self )
+{
+ Py_ssize_t len;
+
+ if (RNA_property_type(&self->ptr, self->prop) == PROP_COLLECTION) {
+ len = RNA_property_collection_length(&self->ptr, self->prop);
+ } else {
+ len = RNA_property_array_length(&self->ptr, self->prop);
+
+ if (len==0) { /* not an array*/
+ PyErr_SetString(PyExc_AttributeError, "len() only available for collection RNA types");
+ return -1;
+ }
+ }
+
+ return len;
+}
+
+static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key )
+{
+ PyObject *ret;
+ PointerRNA newptr;
+ int keynum;
+ char *keyname = NULL;
+
+ if (PyUnicode_Check(key)) {
+ keyname = _PyUnicode_AsString(key);
+ } else if (PyLong_Check(key)) {
+ keynum = PyLong_AsSsize_t(key);
+ } else {
+ PyErr_SetString(PyExc_AttributeError, "invalid key, key must be a string or an int");
+ return NULL;
+ }
+
+ if (RNA_property_type(&self->ptr, self->prop) == PROP_COLLECTION) {
+ int ok;
+ if (keyname) ok = RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr);
+ else ok = RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr);
+
+ if (ok) {
+ ret = pyrna_struct_CreatePyObject(&newptr);
+ } else {
+ PyErr_SetString(PyExc_AttributeError, "out of range");
+ ret = NULL;
+ }
+
+ } else if (keyname) {
+ PyErr_SetString(PyExc_AttributeError, "string keys are only supported for collections");
+ ret = NULL;
+ } else {
+ int len = RNA_property_array_length(&self->ptr, self->prop);
+
+ if (len==0) { /* not an array*/
+ PyErr_Format(PyExc_AttributeError, "not an array or collection %d", keynum);
+ ret = NULL;
+ }
+
+ if (keynum >= len){
+ PyErr_SetString(PyExc_AttributeError, "index out of range");
+ ret = NULL;
+ } else { /* not an array*/
+ ret = pyrna_prop_to_py_index(&self->ptr, self->prop, keynum);
+ }
+ }
+
+ return ret;
+}
+
+
+static int pyrna_prop_assign_subscript( BPy_PropertyRNA * self, PyObject *key, PyObject *value )
+{
+ int ret = 0;
+ int keynum;
+ char *keyname = NULL;
+
+ if (!RNA_property_editable(&self->ptr, self->prop)) {
+ PyErr_Format( PyExc_AttributeError, "Attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(&self->ptr, self->prop), RNA_struct_identifier(&self->ptr) );
+ return -1;
+ }
+
+ if (PyUnicode_Check(key)) {
+ keyname = _PyUnicode_AsString(key);
+ } else if (PyLong_Check(key)) {
+ keynum = PyLong_AsSsize_t(key);
+ } else {
+ PyErr_SetString(PyExc_AttributeError, "invalid key, key must be a string or an int");
+ return -1;
+ }
+
+ if (RNA_property_type(&self->ptr, self->prop) == PROP_COLLECTION) {
+ PyErr_SetString(PyExc_AttributeError, "assignment is not supported for collections (yet)");
+ ret = -1;
+ } else if (keyname) {
+ PyErr_SetString(PyExc_AttributeError, "string keys are only supported for collections");
+ ret = -1;
+ } else {
+ int len = RNA_property_array_length(&self->ptr, self->prop);
+
+ if (len==0) { /* not an array*/
+ PyErr_Format(PyExc_AttributeError, "not an array or collection %d", keynum);
+ ret = -1;
+ }
+
+ if (keynum >= len){
+ PyErr_SetString(PyExc_AttributeError, "index out of range");
+ ret = -1;
+ } else { /* not an array*/
+ ret = pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value);
+ }
+ }
+
+ return ret;
+}
+
+
+
+static PyMappingMethods pyrna_prop_as_mapping = {
+ ( inquiry ) pyrna_prop_len, /* mp_length */
+ ( binaryfunc ) pyrna_prop_subscript, /* mp_subscript */
+ ( objobjargproc ) pyrna_prop_assign_subscript, /* mp_ass_subscript */
+};
+
+
+PyObject *pyrna_struct_to_docstring(BPy_StructRNA *self)
+{
+ PyObject *ret;
+ PropertyRNA *prop;
+
+ DynStr *dynstr;
+ const char *identifier;
+ const char *desc;
+ char *readonly;
+ char *result;
+ int len;
+ int i; /* general iter */
+
+ dynstr= BLI_dynstr_new();
+ BLI_dynstr_appendf(dynstr, "RNA %s: %s\n", RNA_struct_identifier(&self->ptr), RNA_struct_ui_name(&self->ptr));
+
+ /* Add EPI ===='s */
+ i = BLI_dynstr_get_len(dynstr);
+ while (--i)
+ BLI_dynstr_append(dynstr, "=");
+
+ BLI_dynstr_append(dynstr, "\n");
+ /* done */
+
+ {
+ PropertyRNA *iterprop;
+ CollectionPropertyIterator iter;
+
+ iterprop= RNA_struct_iterator_property(&self->ptr);
+ RNA_property_collection_begin(&self->ptr, iterprop, &iter);
+
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ prop = iter.ptr.data;
+ identifier = RNA_property_identifier(&iter.ptr, prop);
+ desc = RNA_property_ui_description(&iter.ptr, prop);
+
+ readonly = (RNA_property_editable(&self->ptr, prop)) ? "" : " *readonly*";
+ len = RNA_property_array_length(&iter.ptr, prop);
+
+ switch(RNA_property_type(&iter.ptr, prop)) {
+ case PROP_BOOLEAN:
+ {
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s%s\n", identifier, desc, readonly);
+
+ if (len==0) BLI_dynstr_appendf(dynstr, "@type %s: bool\n", identifier);
+ else BLI_dynstr_appendf(dynstr, "@type %s: bool[%d]\n", identifier, len);
+ break;
+ }
+ case PROP_INT:
+ {
+ int hardmin, hardmax;
+ RNA_property_int_range(&iter.ptr, prop, &hardmin, &hardmax);
+
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s in (%d, %d)%s\n", identifier, desc, hardmin, hardmax, readonly);
+
+ if (len==0) BLI_dynstr_appendf(dynstr, "@type %s: int\n", identifier);
+ else BLI_dynstr_appendf(dynstr, "@type %s: int[%d]\n", identifier, len);
+ break;
+ }
+ case PROP_FLOAT:
+ {
+ float hardmin, hardmax;
+ RNA_property_float_range(&iter.ptr, prop, &hardmin, &hardmax);
+
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s in (", identifier, desc);
+
+ if (hardmin < -MAXFLOAT_DOC)BLI_dynstr_append(dynstr, "-inf, ");
+ else BLI_dynstr_appendf(dynstr, "%.3f, ", hardmin);
+
+ if (hardmax > MAXFLOAT_DOC)BLI_dynstr_append(dynstr, "inf");
+ else BLI_dynstr_appendf(dynstr, "%.3f", hardmax);
+
+ BLI_dynstr_appendf(dynstr, ")%s\n", readonly);
+
+
+ if (len==0) BLI_dynstr_appendf(dynstr, "@type %s: float\n", identifier);
+ else BLI_dynstr_appendf(dynstr, "@type %s: float[%d]\n", identifier, len);
+ break;
+ }
+ case PROP_STRING:
+ {
+ int maxlen = RNA_property_string_maxlength(&iter.ptr, prop);
+
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s (%d maximum length)%s\n", identifier, desc, maxlen, readonly);
+ BLI_dynstr_appendf(dynstr, "@type %s: string\n", identifier);
+ break;
+ }
+ case PROP_ENUM:
+ {
+ const EnumPropertyItem *item;
+ int totitem;
+
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s%s\n", identifier, desc, readonly);
+
+ BLI_dynstr_appendf(dynstr, "@type %s: enum in [", identifier);
+
+ RNA_property_enum_items(&iter.ptr, prop, &item, &totitem);
+
+ for (i=0; i<totitem; i++) {
+ BLI_dynstr_append(dynstr, item[i].identifier);
+ if (i<totitem-1) {
+ BLI_dynstr_append(dynstr, ", ");
+ }
+ }
+
+ BLI_dynstr_append(dynstr, "]\n");
+ break;
+ }
+ case PROP_POINTER:
+ {
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s%s\n", identifier, desc, readonly);
+
+ // TODO - why does this crash sometimes
+ // PointerRNA newptr;
+ // RNA_property_pointer_get(&iter.ptr, prop, &newptr);
+
+ // Use this instead, its not that useful
+ BLI_dynstr_appendf(dynstr, "@type %s: PyRNA %s\n", identifier, RNA_struct_identifier(&iter.ptr));
+ break;
+ }
+ case PROP_COLLECTION:
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s%s\n", identifier, desc, readonly);
+ BLI_dynstr_appendf(dynstr, "@type %s: PyRNA Collection\n", identifier);
+ break;
+ default:
+ BLI_dynstr_appendf(dynstr, "@ivar %s: %s%s\n", identifier, desc, readonly);
+ BLI_dynstr_appendf(dynstr, "@type %s: <unknown>\n", identifier);
+ break;
+ }
+ }
+
+ RNA_property_collection_end(&iter);
+ }
+
+ result= BLI_dynstr_get_cstring(dynstr);
+ BLI_dynstr_free(dynstr);
+
+ ret = PyUnicode_FromString(result);
+ MEM_freeN(result);
+
+ return ret;
+}
+
+
+//---------------getattr--------------------------------------------
+static PyObject *pyrna_struct_getattro( BPy_StructRNA * self, PyObject *pyname )
+{
+ char *name = _PyUnicode_AsString(pyname);
+ PyObject *ret;
+ PropertyRNA *prop;
+
+ /* Include this incase this instance is a subtype of a python class
+ * In these instances we may want to return a function or variable provided by the subtype
+ * */
+ ret = PyObject_GenericGetAttr((PyObject *)self, pyname);
+ if (ret) return ret;
+ else PyErr_Clear();
+ /* done with subtypes */
+
+ if( strcmp( name, "__members__" ) == 0 ) {
+ PyObject *item;
+
+ PropertyRNA *iterprop;
+ CollectionPropertyIterator iter;
+
+ ret = PyList_New(0);
+
+ iterprop= RNA_struct_iterator_property(&self->ptr);
+ RNA_property_collection_begin(&self->ptr, iterprop, &iter);
+
+
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ prop = iter.ptr.data;
+ item = PyUnicode_FromString( RNA_property_identifier(&iter.ptr, prop) );
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ }
+
+ RNA_property_collection_end(&iter);
+ } else if ( strcmp( name, "__doc__" ) == 0 ) {
+ ret = pyrna_struct_to_docstring(self);
+ } else {
+ prop = RNA_struct_find_property(&self->ptr, name);
+
+ if (prop==NULL) {
+ PyErr_Format( PyExc_AttributeError, "Attribute \"%s\" not found", name);
+ ret = NULL;
+ } else {
+ ret = pyrna_prop_to_py(&self->ptr, prop);
+ }
+ }
+
+ return ret;
+}
+
+//--------------- setattr-------------------------------------------
+static int pyrna_struct_setattro( BPy_StructRNA * self, PyObject *pyname, PyObject * value )
+{
+ char *name = _PyUnicode_AsString(pyname);
+ PropertyRNA *prop = RNA_struct_find_property(&self->ptr, name);
+
+ if (prop==NULL) {
+ PyErr_Format( PyExc_AttributeError, "Attribute \"%s\" not found", name);
+ return -1;
+ }
+
+ if (!RNA_property_editable(&self->ptr, prop)) {
+ PyErr_Format( PyExc_AttributeError, "Attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(&self->ptr, prop), RNA_struct_identifier(&self->ptr) );
+ return -1;
+ }
+
+ /* pyrna_py_to_prop sets its own exceptions */
+ return pyrna_py_to_prop(&self->ptr, prop, value);
+}
+
+PyObject *pyrna_prop_keys(BPy_PropertyRNA *self)
+{
+ PyObject *ret;
+ if (RNA_property_type(&self->ptr, self->prop) != PROP_COLLECTION) {
+ PyErr_SetString( PyExc_TypeError, "keys() is only valid for collection types" );
+ ret = NULL;
+ } else {
+ PyObject *item;
+ CollectionPropertyIterator iter;
+ PropertyRNA *nameprop;
+ char name[256], *nameptr;
+
+ ret = PyList_New(0);
+
+ RNA_property_collection_begin(&self->ptr, self->prop, &iter);
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ nameprop= RNA_struct_name_property(&iter.ptr);
+ if(iter.ptr.data && nameprop) {
+ nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name));
+
+ /* add to python list */
+ item = PyUnicode_FromString( nameptr );
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ /* done */
+
+ if ((char *)&name != nameptr)
+ MEM_freeN(nameptr);
+ }
+ }
+ RNA_property_collection_end(&iter);
+ }
+
+ return ret;
+}
+
+PyObject *pyrna_prop_items(BPy_PropertyRNA *self)
+{
+ PyObject *ret;
+ if (RNA_property_type(&self->ptr, self->prop) != PROP_COLLECTION) {
+ PyErr_SetString( PyExc_TypeError, "items() is only valid for collection types" );
+ ret = NULL;
+ } else {
+ PyObject *item;
+ CollectionPropertyIterator iter;
+ PropertyRNA *nameprop;
+ char name[256], *nameptr;
+
+ ret = PyList_New(0);
+
+ RNA_property_collection_begin(&self->ptr, self->prop, &iter);
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ nameprop= RNA_struct_name_property(&iter.ptr);
+ if(iter.ptr.data && nameprop) {
+ nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name));
+
+ /* add to python list */
+ item = Py_BuildValue("(NN)", PyUnicode_FromString( nameptr ), pyrna_struct_CreatePyObject(&iter.ptr));
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ /* done */
+
+ if ((char *)&name != nameptr)
+ MEM_freeN(nameptr);
+ }
+ }
+ RNA_property_collection_end(&iter);
+ }
+
+ return ret;
+}
+
+
+PyObject *pyrna_prop_values(BPy_PropertyRNA *self)
+{
+ PyObject *ret;
+ if (RNA_property_type(&self->ptr, self->prop) != PROP_COLLECTION) {
+ PyErr_SetString( PyExc_TypeError, "values() is only valid for collection types" );
+ ret = NULL;
+ } else {
+ PyObject *item;
+ CollectionPropertyIterator iter;
+ PropertyRNA *nameprop;
+
+ ret = PyList_New(0);
+
+ RNA_property_collection_begin(&self->ptr, self->prop, &iter);
+ for(; iter.valid; RNA_property_collection_next(&iter)) {
+ nameprop= RNA_struct_name_property(&iter.ptr);
+ if(iter.ptr.data && nameprop) {
+
+ /* add to python list */
+ item = pyrna_struct_CreatePyObject(&iter.ptr);
+ PyList_Append(ret, item);
+ Py_DECREF(item);
+ /* done */
+
+ }
+ }
+ RNA_property_collection_end(&iter);
+ }
+
+ return ret;
+}
+
+/* A bit of a kludge, make a list out of a collection or array,
+ * then return the lists iter function, not especially fast but convenient for now */
+PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
+{
+ /* Try get values from a collection */
+ PyObject *ret = pyrna_prop_values(self);
+
+ if (ret==NULL) {
+ /* collection did not work, try array */
+ int len = RNA_property_array_length(&self->ptr, self->prop);
+
+ if (len) {
+ int i;
+ PyErr_Clear();
+ ret = PyList_New(len);
+
+ for (i=0; i < len; i++) {
+ PyList_SET_ITEM(ret, i, pyrna_prop_to_py_index(&self->ptr, self->prop, i));
+ }
+ }
+ }
+
+ if (ret) {
+ /* we know this is a list so no need to PyIter_Check */
+ PyObject *iter = PyObject_GetIter(ret);
+ Py_DECREF(ret);
+ return iter;
+ }
+
+ PyErr_SetString( PyExc_TypeError, "this BPy_PropertyRNA object is not iterable" );
+ return NULL;
+}
+
+
+static struct PyMethodDef pyrna_prop_methods[] = {
+ {"keys", (PyCFunction)pyrna_prop_keys, METH_NOARGS, ""},
+ {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS, ""},
+ {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, ""},
+ {NULL, NULL, 0, NULL}
+};
+
+/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
+ * todo - also accept useful args */
+static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
+
+ BPy_StructRNA *base = NULL;
+
+ if (!PyArg_ParseTuple(args, "O!:Base BPy_StructRNA", &pyrna_struct_Type, &base))
+ return NULL;
+
+ if (type == &pyrna_struct_Type) {
+ return pyrna_struct_CreatePyObject(&base->ptr);
+ } else {
+ BPy_StructRNA *ret = (BPy_StructRNA *) type->tp_alloc(type, 0);
+ ret->ptr = base->ptr;
+ return (PyObject *)ret;
+ }
+}
+
+/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
+ * todo - also accept useful args */
+static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
+
+ BPy_PropertyRNA *base = NULL;
+
+ if (!PyArg_ParseTuple(args, "O!:Base BPy_PropertyRNA", &pyrna_prop_Type, &base))
+ return NULL;
+
+ if (type == &pyrna_prop_Type) {
+ return pyrna_prop_CreatePyObject(&base->ptr, base->prop);
+ } else {
+ BPy_PropertyRNA *ret = (BPy_PropertyRNA *) type->tp_alloc(type, 0);
+ ret->ptr = base->ptr;
+ ret->prop = base->prop;
+ return (PyObject *)ret;
+ }
+}
+
+/*-----------------------BPy_StructRNA method def------------------------------*/
+PyTypeObject pyrna_struct_Type = {
+#if (PY_VERSION_HEX >= 0x02060000)
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
+ /* python 2.5 and below */
+ PyObject_HEAD_INIT( NULL ) /* required py macro */
+ 0, /* ob_size */
+#endif
+ "StructRNA", /* tp_name */
+ sizeof( BPy_StructRNA ), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ NULL, /* tp_dealloc */
+ NULL, /* printfunc tp_print; */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
+ ( cmpfunc ) pyrna_struct_compare, /* tp_compare */
+ ( reprfunc ) pyrna_struct_repr, /* tp_repr */
+
+ /* Method suites for standard classes */
+
+ NULL, /* PyNumberMethods *tp_as_number; */
+ NULL, /* PySequenceMethods *tp_as_sequence; */
+ NULL, /* PyMappingMethods *tp_as_mapping; */
+
+ /* More standard operations (here for binary compatibility) */
+
+ ( hashfunc )pyrna_struct_hash, /* hashfunc tp_hash; */
+ NULL, /* ternaryfunc tp_call; */
+ NULL, /* reprfunc tp_str; */
+ ( getattrofunc ) pyrna_struct_getattro, /* getattrofunc tp_getattro; */
+ ( setattrofunc ) pyrna_struct_setattro, /* setattrofunc tp_setattro; */
+
+ /* Functions to access object as input/output buffer */
+ NULL, /* PyBufferProcs *tp_as_buffer; */
+
+ /*** Flags to define presence of optional/expanded features ***/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
+
+ NULL, /* char *tp_doc; Documentation string */
+ /*** Assigned meaning in release 2.0 ***/
+ /* call function for all accessible objects */
+ NULL, /* traverseproc tp_traverse; */
+
+ /* delete references to contained objects */
+ NULL, /* inquiry tp_clear; */
+
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
+ NULL, /* richcmpfunc tp_richcompare; */
+
+ /*** weak reference enabler ***/
+ 0, /* long tp_weaklistoffset; */
+
+ /*** Added in release 2.2 ***/
+ /* Iterators */
+ NULL, /* getiterfunc tp_iter; */
+ NULL, /* iternextfunc tp_iternext; */
+
+ /*** Attribute descriptor and subclassing stuff ***/
+ NULL, /* struct PyMethodDef *tp_methods; */
+ NULL, /* struct PyMemberDef *tp_members; */
+ NULL, /* struct PyGetSetDef *tp_getset; */
+ NULL, /* struct _typeobject *tp_base; */
+ NULL, /* PyObject *tp_dict; */
+ NULL, /* descrgetfunc tp_descr_get; */
+ NULL, /* descrsetfunc tp_descr_set; */
+ 0, /* long tp_dictoffset; */
+ NULL, /* initproc tp_init; */
+ NULL, /* allocfunc tp_alloc; */
+ pyrna_struct_new, /* newfunc tp_new; */
+ /* Low-level free-memory routine */
+ NULL, /* freefunc tp_free; */
+ /* For PyObject_IS_GC */
+ NULL, /* inquiry tp_is_gc; */
+ NULL, /* PyObject *tp_bases; */
+ /* method resolution order */
+ NULL, /* PyObject *tp_mro; */
+ NULL, /* PyObject *tp_cache; */
+ NULL, /* PyObject *tp_subclasses; */
+ NULL, /* PyObject *tp_weaklist; */
+ NULL
+};
+
+/*-----------------------BPy_PropertyRNA method def------------------------------*/
+PyTypeObject pyrna_prop_Type = {
+#if (PY_VERSION_HEX >= 0x02060000)
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
+ /* python 2.5 and below */
+ PyObject_HEAD_INIT( NULL ) /* required py macro */
+ 0, /* ob_size */
+#endif
+
+ "PropertyRNA", /* tp_name */
+ sizeof( BPy_PropertyRNA ), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ NULL, /* tp_dealloc */
+ NULL, /* printfunc tp_print; */
+ NULL, /* getattrfunc tp_getattr; */
+ NULL, /* setattrfunc tp_setattr; */
+ ( cmpfunc ) pyrna_prop_compare, /* tp_compare */
+ ( reprfunc ) pyrna_prop_repr, /* tp_repr */
+
+ /* Method suites for standard classes */
+
+ NULL, /* PyNumberMethods *tp_as_number; */
+ NULL, /* PySequenceMethods *tp_as_sequence; */
+ &pyrna_prop_as_mapping, /* PyMappingMethods *tp_as_mapping; */
+
+ /* More standard operations (here for binary compatibility) */
+
+ NULL, /* hashfunc tp_hash; */
+ NULL, /* ternaryfunc tp_call; */
+ NULL, /* reprfunc tp_str; */
+ NULL, /*PyObject_GenericGetAttr - MINGW Complains, assign later */ /* getattrofunc tp_getattro; */ /* will only use these if this is a subtype of a py class */
+ NULL, /*PyObject_GenericSetAttr - MINGW Complains, assign later */ /* setattrofunc tp_setattro; */
+
+ /* Functions to access object as input/output buffer */
+ NULL, /* PyBufferProcs *tp_as_buffer; */
+
+ /*** Flags to define presence of optional/expanded features ***/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
+
+ NULL, /* char *tp_doc; Documentation string */
+ /*** Assigned meaning in release 2.0 ***/
+ /* call function for all accessible objects */
+ NULL, /* traverseproc tp_traverse; */
+
+ /* delete references to contained objects */
+ NULL, /* inquiry tp_clear; */
+
+ /*** Assigned meaning in release 2.1 ***/
+ /*** rich comparisons ***/
+ NULL, /* richcmpfunc tp_richcompare; */
+
+ /*** weak reference enabler ***/
+ 0, /* long tp_weaklistoffset; */
+
+ /*** Added in release 2.2 ***/
+ /* Iterators */
+ (getiterfunc)pyrna_prop_iter, /* getiterfunc tp_iter; */
+ NULL, /* iternextfunc tp_iternext; */
+
+ /*** Attribute descriptor and subclassing stuff ***/
+ pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */
+ NULL, /* struct PyMemberDef *tp_members; */
+ NULL, /* struct PyGetSetDef *tp_getset; */
+ NULL, /* struct _typeobject *tp_base; */
+ NULL, /* PyObject *tp_dict; */
+ NULL, /* descrgetfunc tp_descr_get; */
+ NULL, /* descrsetfunc tp_descr_set; */
+ 0, /* long tp_dictoffset; */
+ NULL, /* initproc tp_init; */
+ NULL, /* allocfunc tp_alloc; */
+ pyrna_prop_new, /* newfunc tp_new; */
+ /* Low-level free-memory routine */
+ NULL, /* freefunc tp_free; */
+ /* For PyObject_IS_GC */
+ NULL, /* inquiry tp_is_gc; */
+ NULL, /* PyObject *tp_bases; */
+ /* method resolution order */
+ NULL, /* PyObject *tp_mro; */
+ NULL, /* PyObject *tp_cache; */
+ NULL, /* PyObject *tp_subclasses; */
+ NULL, /* PyObject *tp_weaklist; */
+ NULL
+};
+
+/*-----------------------CreatePyObject---------------------------------*/
+PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr )
+{
+ BPy_StructRNA *pyrna;
+
+ pyrna = ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type );
+
+ if( !pyrna ) {
+ PyErr_SetString( PyExc_MemoryError, "couldn't create BPy_StructRNA object" );
+ return NULL;
+ }
+
+ pyrna->ptr = *ptr;
+
+ return ( PyObject * ) pyrna;
+}
+
+PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop )
+{
+ BPy_PropertyRNA *pyrna;
+
+ pyrna = ( BPy_PropertyRNA * ) PyObject_NEW( BPy_PropertyRNA, &pyrna_prop_Type );
+
+ if( !pyrna ) {
+ PyErr_SetString( PyExc_MemoryError, "couldn't create BPy_rna object" );
+ return NULL;
+ }
+
+ pyrna->ptr = *ptr;
+ pyrna->prop = prop;
+
+ /* TODO - iterator? */
+
+ return ( PyObject * ) pyrna;
+}
+
+
+PyObject *BPY_rna_module( void )
+{
+ PointerRNA ptr;
+
+ if( PyType_Ready( &pyrna_struct_Type ) < 0 )
+ return NULL;
+
+ /* This can't be set in the pytype struct because some compilers complain */
+ pyrna_prop_Type.tp_getattro = PyObject_GenericGetAttr;
+ pyrna_prop_Type.tp_setattro = PyObject_GenericSetAttr;
+
+ if( PyType_Ready( &pyrna_prop_Type ) < 0 )
+ return NULL;
+
+ /* for now, return the base RNA type rather then a real module */
+ RNA_main_pointer_create(G.main, &ptr);
+
+ //submodule = Py_InitModule3( "rna", M_rna_methods, "rna module" );
+ return pyrna_struct_CreatePyObject(&ptr);
+}
diff --git a/source/blender/python/api2_2x/bpy_config.h b/source/blender/python/intern/bpy_rna.h
index 25178fd3e6f..6ceda34268f 100644
--- a/source/blender/python/api2_2x/bpy_config.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -1,4 +1,4 @@
-/*
+/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -17,33 +17,35 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
* Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
-*/
-
-#ifndef EXPP_BPY_CONFIG_H
-#define EXPP_BPY_CONFIG_H
+ */
+#ifndef BPY_RNA_H
+#define BPY_RNA_H
#include <Python.h>
-/* The Main PyType Object defined in Main.c */
-extern PyTypeObject Config_Type;
+#include "RNA_access.h"
+#include "RNA_types.h"
-#define BPy_Config_Check(v) \
- ((v)->ob_type == &Config_Type)
+extern PyTypeObject pyrna_struct_Type;
+extern PyTypeObject pyrna_prop_Type;
+
+typedef struct {
+ PyObject_VAR_HEAD /* required python macro */
+ PointerRNA ptr;
+} BPy_StructRNA;
-/* Main sequence, iterate on the libdatas listbase*/
typedef struct {
PyObject_VAR_HEAD /* required python macro */
-} BPy_Config;
+ PointerRNA ptr;
+ PropertyRNA *prop;
+} BPy_PropertyRNA;
-PyObject *Config_CreatePyObject();
+PyObject *BPY_rna_module( void );
+PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr );
+PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop );
-#endif /* EXPP_BPY_CONFIG_H */
+#endif
diff --git a/source/blender/python/intern/bpy_scriptlink.c b/source/blender/python/intern/bpy_scriptlink.c
new file mode 100644
index 00000000000..e790942aeb5
--- /dev/null
+++ b/source/blender/python/intern/bpy_scriptlink.c
@@ -0,0 +1,73 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_lamp_types.h"
+#include "DNA_camera_types.h"
+#include "DNA_world_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_material_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+
+
+/* only copies internal pointers, scriptlink usually is integral part of a struct */
+void BPY_copy_scriptlink( struct ScriptLink *scriptlink )
+{
+
+ if( scriptlink->totscript ) {
+ scriptlink->scripts = MEM_dupallocN(scriptlink->scripts);
+ scriptlink->flag = MEM_dupallocN(scriptlink->flag);
+ }
+
+ return;
+}
+
+/* not free slink itself */
+void BPY_free_scriptlink( struct ScriptLink *slink )
+{
+ if( slink->totscript ) {
+ if( slink->flag ) {
+ MEM_freeN( slink->flag );
+ slink->flag= NULL;
+ }
+ if( slink->scripts ) {
+ MEM_freeN( slink->scripts );
+ slink->scripts= NULL;
+ }
+ }
+
+ return;
+}
+
diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript
index 7cdeb44c33f..49ecfc94a5d 100644
--- a/source/blender/quicktime/SConscript
+++ b/source/blender/quicktime/SConscript
@@ -15,15 +15,15 @@ incs = ['.',
'../imbuf/intern',
'../blenloader',
'../render/extern/include',
- '../include']
+ '../editors/include']
incs.append(env['BF_QUICKTIME_INC'])
if env['OURPLATFORM'] in ['win32-vc', 'darwin']:
types = ['core', 'player']
- priorities = [95, 200]
+ priorities = [115, 200]
else:
types = ['core']
- priorities = [95]
+ priorities = [115]
env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=['WITH_QUICKTIME'], libtype=types, priority=priorities)
diff --git a/source/blender/quicktime/apple/Makefile b/source/blender/quicktime/apple/Makefile
index 40a353243a6..0cee45e3af0 100644
--- a/source/blender/quicktime/apple/Makefile
+++ b/source/blender/quicktime/apple/Makefile
@@ -51,7 +51,7 @@ CPPFLAGS += -I..
# stuff needed by quicktime_[import|export].c
CPPFLAGS += -I../../blenloader -I../../imbuf/intern -I../../imbuf
-CPPFLAGS += -I../../blenlib -I../../makesdna -I../../include -I../../avi
+CPPFLAGS += -I../../blenlib -I../../makesdna -I../../editors/include -I../../avi
CPPFLAGS += -I../../blenkernel -I../../render/extern/include
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 736bb4dd584..ca025a0b8a3 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -37,7 +37,6 @@
#include "BKE_scene.h"
#include "BLI_blenlib.h"
-#include "BIF_toolbox.h" /* error() */
#include "BLO_sys_types.h"
@@ -510,7 +509,7 @@ void start_qt(struct RenderData *rd, int rectx, int recty) {
if(err != noErr) {
G.afbreek = 1;
- error("Unable to create Quicktime movie: %s", name);
+// XXX error("Unable to create Quicktime movie: %s", name);
} else {
printf("Created QuickTime movie: %s\n", name);
diff --git a/source/blender/radiosity/CMakeLists.txt b/source/blender/radiosity/CMakeLists.txt
index 502acf1e211..e76f7409f99 100644
--- a/source/blender/radiosity/CMakeLists.txt
+++ b/source/blender/radiosity/CMakeLists.txt
@@ -27,7 +27,7 @@
FILE(GLOB SRC intern/source/*.c)
SET(INC
- extern/include ../blenlib ../blenkernel ../makesdna ../include
+ extern/include ../blenlib ../blenkernel ../makesdna ../editors/include
../../../intern/guardedalloc ../render/extern/include
../render/intern/include ../blenloader ../../../extern/glew/include
)
diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript
index 82d84f5ef16..528b4e29c04 100644
--- a/source/blender/radiosity/SConscript
+++ b/source/blender/radiosity/SConscript
@@ -3,10 +3,10 @@ Import ('env')
sources = env.Glob('intern/source/*.c')
-incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../include'
+incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../editors/include'
incs += ' #/intern/guardedalloc ../render/extern/include'
incs += ' ../render/intern/include ../blenloader #/extern/glew/include'
incs += ' ' + env['BF_OPENGL_INC']
-env.BlenderLib ( 'blender_radiosity', sources, Split(incs), [], libtype='core', priority=50 )
+env.BlenderLib ( 'bf_radiosity', sources, Split(incs), [], libtype='core', priority=60 )
diff --git a/source/blender/radiosity/extern/include/radio_types.h b/source/blender/radiosity/extern/include/radio_types.h
index 342e122cf36..5a218ee71be 100644
--- a/source/blender/radiosity/extern/include/radio_types.h
+++ b/source/blender/radiosity/extern/include/radio_types.h
@@ -41,10 +41,6 @@
struct Render;
struct CustomData;
-#define DTWIRE 0
-#define DTGOUR 2
-#define DTSOLID 1
-
#define PI M_PI
#define RAD_MAXFACETAB 1024
#define RAD_NEXTFACE(a) if( ((a) & 1023)==0 ) face= RG.facebase[(a)>>10]; else face++;
diff --git a/source/blender/radiosity/intern/source/Makefile b/source/blender/radiosity/intern/source/Makefile
index 5912cdba590..44b38de9bae 100644
--- a/source/blender/radiosity/intern/source/Makefile
+++ b/source/blender/radiosity/intern/source/Makefile
@@ -50,6 +50,6 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# first /include is my own includes, second are the external includes
# third is the external interface. there should be a nicer way to say this
-CPPFLAGS += -I../include -I../../../include -I../../extern/include
+CPPFLAGS += -I../include -I../../../editors/include -I../../extern/include
CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I../../../render/intern/include
diff --git a/source/blender/radiosity/intern/source/raddisplay.c b/source/blender/radiosity/intern/source/raddisplay.c
index 43860c2a9ae..753c2a5b58b 100644
--- a/source/blender/radiosity/intern/source/raddisplay.c
+++ b/source/blender/radiosity/intern/source/raddisplay.c
@@ -46,6 +46,7 @@
#include "BLI_blenlib.h"
+#include "DNA_radio_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
@@ -54,11 +55,6 @@
#include "BKE_main.h"
#include "BIF_gl.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-
-#include "BSE_view.h"
#include "radio.h"
@@ -205,7 +201,7 @@ void drawpatch_ext(RPatch *patch, unsigned int col)
cpack(col);
- oldsa= curarea;
+ oldsa= NULL; // XXX curarea;
sa= G.curscreen->areabase.first;
while(sa) {
@@ -213,8 +209,8 @@ void drawpatch_ext(RPatch *patch, unsigned int col)
v3d= sa->spacedata.first;
/* use mywinget() here: otherwise it draws in header */
- if(sa->win != mywinget()) areawinset(sa->win);
- persp(PERSP_VIEW);
+// XXX if(sa->win != mywinget()) areawinset(sa->win);
+// XXX persp(PERSP_VIEW);
if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
drawnodeWire(patch->first);
if(v3d->zbuf) glEnable(GL_DEPTH_TEST); // pretty useless?
@@ -222,7 +218,7 @@ void drawpatch_ext(RPatch *patch, unsigned int col)
sa= sa->next;
}
- if(oldsa && oldsa!=curarea) areawinset(oldsa->win);
+// XXX if(oldsa && oldsa!=curarea) areawinset(oldsa->win);
glFlush();
glDrawBuffer(GL_BACK);
@@ -317,8 +313,8 @@ void drawlimits()
/* center around cent */
short cox=0, coy=1;
- if((RG.flag & 3)==2) coy= 2;
- if((RG.flag & 3)==3) {
+ if((RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ))==RAD_SHOWZ) coy= 2;
+ if((RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ))==(RAD_SHOWLIMITS|RAD_SHOWZ)) {
cox= 1;
coy= 2;
}
@@ -397,7 +393,7 @@ void RAD_drawall(int depth_is_on)
}
if(RG.totface) {
- if(RG.drawtype==DTGOUR) {
+ if(RG.drawtype==RAD_GOURAUD) {
glShadeModel(GL_SMOOTH);
for(a=0; a<RG.totface; a++) {
RAD_NEXTFACE(a);
@@ -405,7 +401,7 @@ void RAD_drawall(int depth_is_on)
drawfaceGour(face);
}
}
- else if(RG.drawtype==DTSOLID) {
+ else if(RG.drawtype==RAD_SOLID) {
for(a=0; a<RG.totface; a++) {
RAD_NEXTFACE(a);
@@ -413,33 +409,23 @@ void RAD_drawall(int depth_is_on)
}
}
else {
- if(!(get_qual()&LR_SHIFTKEY)) {
-
- for(a=0; a<RG.totface; a++) {
- RAD_NEXTFACE(a);
-
- drawfaceWire(face);
- }
- }
- else {
- cpack(0);
- rp= RG.patchbase.first;
- while(rp) {
- drawsingnodeWire(rp->first);
- rp= rp->next;
- }
+ cpack(0);
+ rp= RG.patchbase.first;
+ while(rp) {
+ drawsingnodeWire(rp->first);
+ rp= rp->next;
}
}
}
else {
el= RG.elem;
- if(RG.drawtype==DTGOUR) {
+ if(RG.drawtype==RAD_GOURAUD) {
glShadeModel(GL_SMOOTH);
for(a=RG.totelem; a>0; a--, el++) {
drawnodeGour(*el);
}
}
- else if(RG.drawtype==DTSOLID) {
+ else if(RG.drawtype==RAD_SOLID) {
for(a=RG.totelem; a>0; a--, el++) {
drawnodeSolid(*el);
}
@@ -454,7 +440,7 @@ void RAD_drawall(int depth_is_on)
glShadeModel(GL_FLAT);
if(RG.totpatch) {
- if(RG.flag & 3) {
+ if(RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ)) {
if(depth_is_on) glDisable(GL_DEPTH_TEST);
drawlimits();
if(depth_is_on) glEnable(GL_DEPTH_TEST);
@@ -469,19 +455,19 @@ void rad_forcedraw()
{
ScrArea *sa, *oldsa;
- oldsa= curarea;
+ oldsa= NULL; // XXX curarea;
sa= G.curscreen->areabase.first;
while(sa) {
if (sa->spacetype==SPACE_VIEW3D) {
/* use mywinget() here: othwerwise it draws in header */
- if(sa->win != mywinget()) areawinset(sa->win);
- scrarea_do_windraw(sa);
+// XXX if(sa->win != mywinget()) areawinset(sa->win);
+// XXX scrarea_do_windraw(sa);
}
sa= sa->next;
}
- screen_swapbuffers();
+// XXX screen_swapbuffers();
- if(oldsa && oldsa!=curarea) areawinset(oldsa->win);
+// XXX if(oldsa && oldsa!=curarea) areawinset(oldsa->win);
}
diff --git a/source/blender/radiosity/intern/source/radfactors.c b/source/blender/radiosity/intern/source/radfactors.c
index ba4dbf1b793..1a400ff57a8 100644
--- a/source/blender/radiosity/intern/source/radfactors.c
+++ b/source/blender/radiosity/intern/source/radfactors.c
@@ -47,8 +47,6 @@
#include "BKE_global.h"
#include "BKE_main.h"
-#include "BIF_screen.h"
-
#include "radio.h"
#include "RE_render_ext.h" /* for `RE_zbufferall_radio and RE_zbufferall_radio */
@@ -546,7 +544,7 @@ void progressiverad()
applyformfactors(shoot);
it++;
- set_timecursor(it);
+ //XXX set_timecursor(it);
if( (it & 3)==1 ) {
make_node_display();
rad_forcedraw();
@@ -556,7 +554,7 @@ void progressiverad()
clear_backface_test();
- if(blender_test_break()) break;
+ //XXX if(blender_test_break()) break;
if(RG.maxiter && RG.maxiter<=it) break;
shoot=findshootpatch();
@@ -672,7 +670,7 @@ void subdivideshootElements(int it)
shoot= findshootpatch();
if(shoot==0) break;
- set_timecursor(a);
+ //XXX set_timecursor(a);
drawpatch_ext(shoot, 0x88FF00);
setnodeflags(shoot->first, RAD_SHOOT, 1);
@@ -722,7 +720,7 @@ void subdivideshootElements(int it)
}
else a--;
- if(blender_test_break()) break;
+ //XXX if(blender_test_break()) break;
}
/* test for extreme small color change within a patch with subdivflag */
@@ -791,7 +789,7 @@ void subdivideshootElements(int it)
}
makeGlobalElemArray();
- if(contin==0 || blender_test_break()) break;
+ //XXX if(contin==0 || blender_test_break()) break;
}
make_node_display();
@@ -816,7 +814,7 @@ void subdivideshootPatches(int it)
shoot= findshootpatch();
if(shoot==0) break;
- set_timecursor(a);
+ //XXX set_timecursor(a);
drawpatch_ext(shoot, 0x88FF00);
setnodeflags(shoot->first, RAD_SHOOT, 1);
@@ -866,7 +864,7 @@ void subdivideshootPatches(int it)
setnodeflags(shoot->first, RAD_SHOOT, 0);
- if(blender_test_break()) break;
+ //XXX if(blender_test_break()) break;
}
else a--;
@@ -893,7 +891,7 @@ void subdivideshootPatches(int it)
converttopatches();
makeGlobalElemArray();
- if(contin==0 || blender_test_break()) break;
+ //XXX if(contin==0 || blender_test_break()) break;
}
make_node_display();
}
diff --git a/source/blender/radiosity/intern/source/radio.c b/source/blender/radiosity/intern/source/radio.c
index aff07ebe9ef..ec4a0eec490 100644
--- a/source/blender/radiosity/intern/source/radio.c
+++ b/source/blender/radiosity/intern/source/radio.c
@@ -88,11 +88,7 @@
#include "BKE_global.h"
#include "BKE_main.h"
-#include "BIF_screen.h" /* curarea */
-#include "BIF_space.h" /* allqueue */
-
#include "radio.h"
-#include "mydevice.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -188,10 +184,10 @@ void rad_status_str(char *str)
void rad_printstatus()
{
/* actions always are started from a buttonswindow */
- if(curarea) {
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
+// XX if(curarea) {
+// scrarea_do_windraw(curarea);
+// screen_swapbuffers();
+// }
}
void rad_setlimits()
@@ -262,7 +258,7 @@ void add_radio()
rad->convergence= 0.1;
rad->radfac= 30.0;
rad->gamma= 2.0;
- rad->drawtype= DTSOLID;
+ rad->drawtype= RAD_SOLID;
rad->subshootp= 1;
rad->subshoote= 2;
rad->maxsublamp= 0;
@@ -354,7 +350,7 @@ void rad_subdivshootpatch()
removeEqualNodes(RG.nodelim);
closehemiwindows();
- allqueue(REDRAWVIEW3D, 1);
+// XXX allqueue(REDRAWVIEW3D, 1);
}
void rad_subdivshootelem(void)
@@ -373,7 +369,7 @@ void rad_subdivshootelem(void)
removeEqualNodes(RG.nodelim);
closehemiwindows();
- allqueue(REDRAWVIEW3D, 1);
+// XXX allqueue(REDRAWVIEW3D, 1);
}
void rad_limit_subdivide()
diff --git a/source/blender/radiosity/intern/source/radnode.c b/source/blender/radiosity/intern/source/radnode.c
index ae246476e6d..fa23ca5da57 100644
--- a/source/blender/radiosity/intern/source/radnode.c
+++ b/source/blender/radiosity/intern/source/radnode.c
@@ -46,8 +46,6 @@
#include "BKE_global.h"
#include "BKE_main.h"
-#include "BIF_toolbox.h"
-
#include "radio.h"
#include "BLO_sys_types.h" // for intptr_t support
@@ -220,7 +218,7 @@ void free_fastAll()
void start_fastmalloc(char *str)
{
if(fastmallocstr) {
- error("Fastmalloc in use: %s", fastmallocstr);
+// XXX error("Fastmalloc in use: %s", fastmallocstr);
return;
}
fastmallocstr= str;
diff --git a/source/blender/radiosity/intern/source/radpostprocess.c b/source/blender/radiosity/intern/source/radpostprocess.c
index a7dae59c5f0..75480eda5df 100644
--- a/source/blender/radiosity/intern/source/radpostprocess.c
+++ b/source/blender/radiosity/intern/source/radpostprocess.c
@@ -50,7 +50,6 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_ghash.h"
-#include "BIF_toolbox.h" // notice()
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -66,11 +65,6 @@
#include "BKE_object.h"
#include "BKE_utildefines.h"
-#include "BIF_screen.h" /* waitcursor */
-#include "BIF_editview.h" /* deselectall */
-
-#include "BDR_editobject.h" /* delete_obj */
-
#include "radio.h"
/* locals? not. done in radio.h... */
@@ -624,7 +618,7 @@ void removeEqualNodes(short limit)
thresh= 1.0/(256.0*RG.radfactor);
thresh= 3.0*pow(thresh, RG.gamma);
- waitcursor(1);
+// XXX waitcursor(1);
while(foundone) {
foundone= 0;
@@ -679,7 +673,7 @@ void removeEqualNodes(short limit)
makeGlobalElemArray();
}
}
- waitcursor(0);
+// XXX waitcursor(0);
}
unsigned int rad_find_or_add_mvert(Mesh *me, MFace *mf, RNode *orignode, float *w, float *radco, GHash *hash)
@@ -717,8 +711,8 @@ void rad_addmesh(void)
if(RG.totface==0)
return;
- if(RG.totmat==MAXMAT)
- notice("warning: cannot assign more than 16 materials to 1 mesh");
+// if(RG.totmat==MAXMAT)
+// XXX notice("warning: cannot assign more than 16 materials to 1 mesh");
/* create the mesh */
ob= add_object(OB_MESH);
@@ -809,7 +803,7 @@ void rad_replacemesh(void)
{
RPatch *rp;
- deselectall();
+// XXX deselectall();
rp= RG.patchbase.first;
while(rp) {
@@ -822,7 +816,7 @@ void rad_replacemesh(void)
}
copy_objectflags();
- delete_obj(1);
+// XXX delete_obj(1);
rad_addmesh();
}
diff --git a/source/blender/radiosity/intern/source/radpreprocess.c b/source/blender/radiosity/intern/source/radpreprocess.c
index 694cb261b08..eec75942da0 100644
--- a/source/blender/radiosity/intern/source/radpreprocess.c
+++ b/source/blender/radiosity/intern/source/radpreprocess.c
@@ -62,18 +62,10 @@
#include "BKE_object.h" /* during_script() */
#include "BKE_utildefines.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_editface.h"
-
#include "radio.h"
#include "BLO_sys_types.h" // for intptr_t support
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
void setparelem(RNode *rn, RPatch *par);
void splitconnected()
@@ -323,7 +315,7 @@ void rad_collect_meshes()
}
if(G.obedit) {
- if (!during_script()) error("Unable to perform function in EditMode");
+ if (!during_script()); //XXX error("Unable to perform function in EditMode");
return;
}
@@ -348,7 +340,7 @@ void rad_collect_meshes()
base= base->next;
}
if(RG.totvert==0) {
- if (!during_script()) error("No vertices");
+ if (!during_script()); //XXX error("No vertices");
return;
}
vnc= RG.verts= MEM_callocN(RG.totvert*sizeof(VeNoCo), "radioverts");
diff --git a/source/blender/radiosity/intern/source/radrender.c b/source/blender/radiosity/intern/source/radrender.c
index 68b5fa81f43..0233ffbcf9f 100644
--- a/source/blender/radiosity/intern/source/radrender.c
+++ b/source/blender/radiosity/intern/source/radrender.c
@@ -63,8 +63,6 @@
#include "BKE_global.h"
#include "BKE_main.h"
-#include "BIF_screen.h"
-
#include "radio.h"
/* the radiosity module uses internal includes from render! */
@@ -72,9 +70,6 @@
#include "render_types.h"
#include "renderdatabase.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
/* only needed now for a print, if its useful move to RG */
static float maxenergy;
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript
index 50c4b554193..7f799a78834 100644
--- a/source/blender/render/SConscript
+++ b/source/blender/render/SConscript
@@ -28,4 +28,4 @@ if env['WITH_BF_OPENEXR']:
if env['OURPLATFORM']=='linux2':
cflags='-pthread'
-env.BlenderLib ( libname = 'blender_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=45, compileflags=cflags )
+env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=55, compileflags=cflags )
diff --git a/source/blender/render/intern/source/Makefile b/source/blender/render/intern/source/Makefile
index a86da71e40d..eb12c7637f7 100644
--- a/source/blender/render/intern/source/Makefile
+++ b/source/blender/render/intern/source/Makefile
@@ -49,7 +49,7 @@ CPPFLAGS += -I../../../yafray
CPPFLAGS += -I../../../../kernel/gen_messaging
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# not very neat: the rest of blender..
-CPPFLAGS += -I../../../include
+CPPFLAGS += -I../../../editors/include
CPPFLAGS += $(NAN_SDLCFLAGS)
ifeq ($(WITH_QUICKTIME), true)
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 4e4e27fe286..e2692113d16 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -31,7 +31,6 @@
#include <string.h>
#include <limits.h>
-#include "blendef.h"
#include "MTC_matrixops.h"
#include "MEM_guardedalloc.h"
@@ -100,7 +99,7 @@
#include "IMB_imbuf_types.h"
#include "envmap.h"
-#include "multires.h"
+//XXX #include "multires.h"
#include "occlusion.h"
#include "render_types.h"
#include "rendercore.h"
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 1dfcbc6e45d..2d7d954b70d 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -63,8 +63,6 @@
#include "RE_pipeline.h"
#include "radio.h"
-#include "BSE_sequence.h" /* <----------------- bad!!! */
-
#ifndef DISABLE_YAFRAY
/* yafray: include for yafray export/render */
#include "YafRay_Api.h"
@@ -2274,7 +2272,7 @@ static void do_render_all_options(Render *re)
if(re->r.scemode & R_DOSEQ) {
/* note: do_render_seq() frees rect32 when sequencer returns float images */
if(!re->test_break())
- do_render_seq(re->result, re->r.cfra);
+ ; //XXX do_render_seq(re->result, re->r.cfra);
re->stats_draw(&re->i);
re->display_draw(re->result, NULL);
diff --git a/source/blender/src/.BCkey b/source/blender/src/.BCkey
deleted file mode 100644
index a0fd5e817d4..00000000000
--- a/source/blender/src/.BCkey
+++ /dev/null
@@ -1 +0,0 @@
-0xffffffff 0xfffffff0 fffffffe
diff --git a/source/blender/src/B.blend.c b/source/blender/src/B.blend.c
deleted file mode 100644
index 526b585c2e5..00000000000
--- a/source/blender/src/B.blend.c
+++ /dev/null
@@ -1,4488 +0,0 @@
-/* DataToC output of file </home/ideasman42/_B_blend> */
-
-int datatoc_B_blend_size= 143412;
-char datatoc_B_blend[]= {
- 66, 76, 69, 78, 68, 69, 82, 45,118, 50, 52, 53, 82, 69, 78, 68, 32, 0, 0, 0,
-144, 7,200, 92,255,127, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66, 40, 0, 0, 0,144, 7,200, 92,255,127, 0, 0,
-160, 0, 0, 0, 1, 0, 0, 0, 32, 32, 49, 54, 16, 0, 0, 0,240, 0, 0, 0, 1, 0, 0, 1,240,206, 87, 1, 0, 0, 0, 0,
-192,249, 88, 1, 0, 0, 0, 0, 0, 16, 0, 0,128, 32, 4, 0, 83, 82, 0, 0,168, 0, 0, 0, 0,145, 97, 1, 0, 0, 0, 0,
-155, 0, 0, 0, 1, 0, 0, 0,240,206, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 49, 45, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0,
- 48,151, 97, 1, 0, 0, 0, 0,208,160, 97, 1, 0, 0, 0, 0, 64,161, 97, 1, 0, 0, 0, 0,224,194, 87, 1, 0, 0, 0, 0,
-192,249, 88, 1, 0, 0, 0, 0, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 80,146, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 80,146, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-176,146, 97, 1, 0, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,176,146, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 16,147, 97, 1, 0, 0, 0, 0,
- 80,146, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 16,147, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0,176,146, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0, 16,147, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 3,248, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 48,148, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0,
-208,147, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-144,148, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,160, 2,248, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-160, 2, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-176,149, 97, 1, 0, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0,
- 80,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 16,150, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,204, 0,248, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-204, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 0,188, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 48,151, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,160,151, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80,146, 97, 1, 0, 0, 0, 0,176,146, 97, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,160,151, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 16,152, 97, 1, 0, 0, 0, 0,
- 48,151, 97, 1, 0, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0, 16,147, 97, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 16,152, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,128,152, 97, 1, 0, 0, 0, 0,
-160,151, 97, 1, 0, 0, 0, 0, 80,146, 97, 1, 0, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,128,152, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,240,152, 97, 1, 0, 0, 0, 0,
- 16,152, 97, 1, 0, 0, 0, 0,176,146, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,240,152, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 96,153, 97, 1, 0, 0, 0, 0,
-128,152, 97, 1, 0, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 96,153, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,208,153, 97, 1, 0, 0, 0, 0,
-240,152, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,208,153, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 64,154, 97, 1, 0, 0, 0, 0,
- 96,153, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 64,154, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,176,154, 97, 1, 0, 0, 0, 0,
-208,153, 97, 1, 0, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,176,154, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 32,155, 97, 1, 0, 0, 0, 0,
- 64,154, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 32,155, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,144,155, 97, 1, 0, 0, 0, 0,
-176,154, 97, 1, 0, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,144,155, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 0,156, 97, 1, 0, 0, 0, 0,
- 32,155, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 0,156, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,112,156, 97, 1, 0, 0, 0, 0,
-144,155, 97, 1, 0, 0, 0, 0, 16,147, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,112,156, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,224,156, 97, 1, 0, 0, 0, 0,
- 0,156, 97, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,224,156, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 80,157, 97, 1, 0, 0, 0, 0,
-112,156, 97, 1, 0, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 80,157, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,192,157, 97, 1, 0, 0, 0, 0,
-224,156, 97, 1, 0, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,192,157, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 48,158, 97, 1, 0, 0, 0, 0,
- 80,157, 97, 1, 0, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 48,158, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,160,158, 97, 1, 0, 0, 0, 0,
-192,157, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,160,158, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 16,159, 97, 1, 0, 0, 0, 0,
- 48,158, 97, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 16,159, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,128,159, 97, 1, 0, 0, 0, 0,
-160,158, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,128,159, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,240,159, 97, 1, 0, 0, 0, 0,
- 16,159, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,240,159, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 96,160, 97, 1, 0, 0, 0, 0,
-128,159, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 96,160, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,208,160, 97, 1, 0, 0, 0, 0,
-240,159, 97, 1, 0, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,208,160, 97, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 96,160, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0, 64,161, 97, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,112,181, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,240,145, 97, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0,
- 16,147, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0,187, 0, 0, 0,
- 0, 0, 0, 0,232, 3, 0, 0,161, 0, 0, 0,187, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0,160, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 4, 4,233, 3,161, 0, 3, 0, 3, 0, 79, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 97, 1, 0, 0, 0, 0, 48,179, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,162, 97, 1, 0, 0, 0, 0,208,176, 97, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,144,162, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,192,163, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,163, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-240,164, 97, 1, 0, 0, 0, 0,144,162, 97, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,240,164, 97, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 32,166, 97, 1, 0, 0, 0, 0,192,163, 97, 1, 0, 0, 0, 0, 65,110,105,109, 32,115,101,116,
-116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 32,166, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80,167, 97, 1, 0, 0, 0, 0,240,164, 97, 1, 0, 0, 0, 0,
- 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 80,167, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,128,168, 97, 1, 0, 0, 0, 0,
- 32,166, 97, 1, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128,168, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-176,169, 97, 1, 0, 0, 0, 0, 80,167, 97, 1, 0, 0, 0, 0, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,176,169, 97, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,224,170, 97, 1, 0, 0, 0, 0,128,168, 97, 1, 0, 0, 0, 0, 72,111,111,107,115, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,166, 97, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-224,170, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 16,172, 97, 1, 0, 0, 0, 0,176,169, 97, 1, 0, 0, 0, 0,
- 80, 97,114,116,105, 99,108,101, 32, 73,110,116,101,114, 97, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,167, 97, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 16,172, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 64,173, 97, 1, 0, 0, 0, 0,
-224,170, 97, 1, 0, 0, 0, 0, 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80,167, 97, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,173, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-112,174, 97, 1, 0, 0, 0, 0, 16,172, 97, 1, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,112,174, 97, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,160,175, 97, 1, 0, 0, 0, 0, 64,173, 97, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-160,175, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,208,176, 97, 1, 0, 0, 0, 0,112,174, 97, 1, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,208,176, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-160,175, 97, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,178, 97, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,
- 48,179, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,141, 44, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0,193, 0, 64,212, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,145,133,185, 68, 0, 0, 0,193, 0, 0,104, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
- 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0, 48,179, 97, 1, 0, 0, 0, 0,
-139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 97, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,141, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
- 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0,112,181, 97, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,192,182, 97, 1, 0, 0, 0, 0,
- 64,161, 97, 1, 0, 0, 0, 0,208,147, 97, 1, 0, 0, 0, 0, 80,146, 97, 1, 0, 0, 0, 0,176,146, 97, 1, 0, 0, 0, 0,
- 48,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0,192,182, 97, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 48,192, 97, 1, 0, 0, 0, 0,
-112,181, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0,240,148, 97, 1, 0, 0, 0, 0,
-144,148, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71,187,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,
-205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 19, 1, 0, 0,205, 0, 0, 0,159, 2, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 1,211, 1,242, 1, 1, 0, 3, 0,251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,186, 97, 1, 0, 0, 0, 0,240,189, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,184, 97, 1, 0, 0, 0, 0, 64,185, 97, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 16,184, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 64,185, 97, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,185, 97, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 16,184, 97, 1, 0, 0, 0, 0, 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,
-101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,112,186, 97, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0,240,189, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,178, 13, 32, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
-111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0,
- 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0,240,189, 97, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,186, 97, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 48,192, 97, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0,208,185, 87, 1, 0, 0, 0, 0,192,182, 97, 1, 0, 0, 0, 0,144,148, 97, 1, 0, 0, 0, 0,
-240,148, 97, 1, 0, 0, 0, 0, 48,148, 97, 1, 0, 0, 0, 0,112,147, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,
-161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 19, 1, 0, 0,
-161, 2, 0, 0,232, 3, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 72, 1,242, 1, 3, 0, 3, 0,
-203, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176,194, 97, 1, 0, 0, 0, 0,144,183, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-128,193, 97, 1, 0, 0, 0, 0,128,193, 97, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128,193, 97, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,
-109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0,
- 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0,
-176,194, 97, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0,112,196, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67,
- 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0, 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60,
- 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
-205,204,204,189,205,204,140, 63, 68, 65, 84, 65, 48, 1, 0, 0,112,196, 97, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,
-224,197, 97, 1, 0, 0, 0, 0,176,194, 97, 1, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
- 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,
-108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0,224,197, 97, 1, 0, 0, 0, 0,
-222, 0, 0, 0, 1, 0, 0, 0, 48,177, 87, 1, 0, 0, 0, 0,112,196, 97, 1, 0, 0, 0, 0, 11, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,160, 92, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66,
- 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67,
- 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,136, 0, 0, 0, 48,177, 87, 1, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0,
- 0,178, 87, 1, 0, 0, 0, 0,224,197, 97, 1, 0, 0, 0, 0, 9, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 11, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,114, 1, 0, 0,116, 1, 0, 0, 5, 0, 0, 0, 17, 0, 0, 0,
- 2, 0, 0, 0,116, 1, 0, 0, 68, 65, 84, 65,192, 0, 0, 0, 0,178, 87, 1, 0, 0, 0, 0,142, 0, 0, 0, 1, 0, 0, 0,
- 0,179, 87, 1, 0, 0, 0, 0, 48,177, 87, 1, 0, 0, 0, 0, 13, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68,
- 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0, 0, 0,182, 67,108, 1, 0, 0,124, 1, 0, 0,
- 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 0,108, 1, 0, 0,
- 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,122, 68,205,204,204, 61, 0, 0, 72, 66,
- 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,208, 0, 0, 0, 0,179, 87, 1, 0, 0, 0, 0,232, 0, 0, 0, 1, 0, 0, 0, 16,180, 87, 1, 0, 0, 0, 0,
- 0,178, 87, 1, 0, 0, 0, 0, 12, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,122,196, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66,
- 0, 0,150,194, 0, 0,160, 64,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 14, 2, 0, 0,128, 0, 0, 0,108, 1, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0, 16,180, 87, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,
-144,183, 87, 1, 0, 0, 0, 0, 0,179, 87, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191,
- 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 33,195, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194,
- 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,
-144,183, 87, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,180, 87, 1, 0, 0, 0, 0,
- 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,208,185, 87, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
-224,194, 87, 1, 0, 0, 0, 0, 48,192, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 16,150, 97, 1, 0, 0, 0, 0,
-112,147, 97, 1, 0, 0, 0, 0,176,149, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,
-189, 0, 0, 0,247, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,189, 0, 0, 0,215, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,
-216, 0, 0, 0,247, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15, 28, 3, 32, 0, 3, 0, 3, 0,192, 2, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,189, 87, 1, 0, 0, 0, 0,
-160,192, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,187, 87, 1, 0, 0, 0, 0,
- 80,188, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 32,187, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 80,188, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,
-108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,188, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,187, 87, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0,
-128,189, 87, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,112,190, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 16, 66,
-123, 10, 4,194,181,186,152, 67, 0, 0, 0, 0, 0, 0, 16, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 3, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 16, 66, 0, 0,250, 70, 0, 0, 16, 66,205,204,204, 61, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0,
- 68, 65, 84, 65,192, 0, 0, 0,112,190, 87, 1, 0, 0, 0, 0,222, 0, 0, 0, 1, 0, 0, 0,112,191, 87, 1, 0, 0, 0, 0,
-128,189, 87, 1, 0, 0, 0, 0, 11, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67,
- 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0,
- 16, 0, 0, 0, 36, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65,
- 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112,191, 87, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,160,192, 87, 1, 0, 0, 0, 0,112,190, 87, 1, 0, 0, 0, 0,
- 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0, 0, 35, 68, 0, 0, 0,193, 0, 0,104, 67,
-135, 22, 0,193,178, 16, 96, 68,112, 74,103, 67, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,
-251, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0,160,192, 87, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,191, 87, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,224,194, 87, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,185, 87, 1, 0, 0, 0, 0, 80,149, 97, 1, 0, 0, 0, 0,
-208,147, 97, 1, 0, 0, 0, 0,112,150, 97, 1, 0, 0, 0, 0,208,150, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0,215, 0, 0, 0,
- 0, 0, 0, 0,203, 0, 0, 0,216, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3,204, 0, 46, 2, 3, 0, 3, 0,
-145, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-144,198, 87, 1, 0, 0, 0, 0,176,204, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 48,196, 87, 1, 0, 0, 0, 0, 96,197, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 48,196, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 96,197, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,
-109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0,
- 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 96,197, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,196, 87, 1, 0, 0, 0, 0,
- 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 48, 1, 0, 0,144,198, 87, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0, 48,201, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 67, 0, 0,190,194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 67,
- 0,128, 11,196, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0,192,194, 0,128, 11,196,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,188, 0, 46, 2, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,142, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,200, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0, 0,200, 87, 1, 0, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0,
- 10, 0, 0, 0, 10, 0, 0, 0, 80,200, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, 80,200, 87, 1, 0, 0, 0, 0,
-181, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,192,249, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
-192, 9, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
-176, 35, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,144, 30, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
- 64, 34, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 80, 26, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
- 48, 6, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
- 64, 5, 89, 1, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0, 48,201, 87, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,
-176,204, 87, 1, 0, 0, 0, 0,144,198, 87, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,233,234, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0, 7, 0,175, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 3, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,134, 55, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,
-176,204, 87, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,201, 87, 1, 0, 0, 0, 0,
- 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,168, 0, 0, 0,240,206, 87, 1, 0, 0, 0, 0,155, 0, 0, 0, 1, 0, 0, 0,
- 48, 39, 88, 1, 0, 0, 0, 0, 0,145, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 83, 82, 50, 45, 77,111,100,101,108, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,224,207, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,224,210, 87, 1, 0, 0, 0, 0,
-208,214, 87, 1, 0, 0, 0, 0, 64,215, 87, 1, 0, 0, 0, 0, 80, 21, 88, 1, 0, 0, 0, 0,192,249, 88, 1, 0, 0, 0, 0,
- 64, 6,127, 12,255,255,129, 4, 64, 6,131, 4, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,224,207, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 64,208, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 64,208, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,160,208, 87, 1, 0, 0, 0, 0,
-224,207, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,131, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-160,208, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0, 64,208, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64, 6,131, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,160,208, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 6, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-192,209, 87, 1, 0, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0,
- 96,209, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 6, 20, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 32,210, 87, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 6,104, 4, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224,210, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 80,211, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,208, 87, 1, 0, 0, 0, 0,160,208, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80,211, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-192,211, 87, 1, 0, 0, 0, 0,224,210, 87, 1, 0, 0, 0, 0,224,207, 87, 1, 0, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,192,211, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 48,212, 87, 1, 0, 0, 0, 0, 80,211, 87, 1, 0, 0, 0, 0,224,207, 87, 1, 0, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48,212, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-160,212, 87, 1, 0, 0, 0, 0,192,211, 87, 1, 0, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,160,212, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 16,213, 87, 1, 0, 0, 0, 0, 48,212, 87, 1, 0, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 16,213, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-128,213, 87, 1, 0, 0, 0, 0,160,212, 87, 1, 0, 0, 0, 0, 64,208, 87, 1, 0, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128,213, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-240,213, 87, 1, 0, 0, 0, 0, 16,213, 87, 1, 0, 0, 0, 0,160,208, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240,213, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 96,214, 87, 1, 0, 0, 0, 0,128,213, 87, 1, 0, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96,214, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-208,214, 87, 1, 0, 0, 0, 0,240,213, 87, 1, 0, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208,214, 87, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,214, 87, 1, 0, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 64,215, 87, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
- 0, 20, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,207, 87, 1, 0, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,
-192,209, 87, 1, 0, 0, 0, 0, 0,209, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188, 0, 0, 0, 0, 0, 0, 0, 0, 64, 6, 0, 0,
- 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 0, 0, 64, 6, 0, 0,249, 0, 0, 0, 19, 1, 0, 0, 0, 0, 0, 0, 64, 6, 0, 0,
- 0, 0, 0, 0,248, 0, 0, 0, 5, 0, 4, 0, 2, 0, 4, 4, 65, 6,249, 0, 1, 1, 1, 0, 79, 1, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 11, 88, 1, 0, 0, 0, 0,
-192, 17, 88, 1, 0, 0, 0, 0, 96,238,142, 1, 0, 0, 0, 0, 32, 38,140, 1, 0, 0, 0, 0,144,216, 87, 1, 0, 0, 0, 0,
-112, 10, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,216, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-192,217, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,217, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,240,218, 87, 1, 0, 0, 0, 0,144,216, 87, 1, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-240,218, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 32,220, 87, 1, 0, 0, 0, 0,192,217, 87, 1, 0, 0, 0, 0,
- 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 32,220, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80,221, 87, 1, 0, 0, 0, 0,
-240,218, 87, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,221, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-128,222, 87, 1, 0, 0, 0, 0, 32,220, 87, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 32,220, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128,222, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,176,223, 87, 1, 0, 0, 0, 0, 80,221, 87, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-176,223, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,224,224, 87, 1, 0, 0, 0, 0,128,222, 87, 1, 0, 0, 0, 0,
- 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,224,224, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 16,226, 87, 1, 0, 0, 0, 0,
-176,223, 87, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,226, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 64,227, 87, 1, 0, 0, 0, 0,224,224, 87, 1, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,227, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,112,228, 87, 1, 0, 0, 0, 0, 16,226, 87, 1, 0, 0, 0, 0, 77,105,115,116, 32, 83,116, 97,
-114,115, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112,228, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,160,229, 87, 1, 0, 0, 0, 0, 64,227, 87, 1, 0, 0, 0, 0,
- 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160,229, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,208,230, 87, 1, 0, 0, 0, 0,
-112,228, 87, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,228, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,230, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0,232, 87, 1, 0, 0, 0, 0,160,229, 87, 1, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,232, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 48,233, 87, 1, 0, 0, 0, 0,208,230, 87, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 48,233, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 96,234, 87, 1, 0, 0, 0, 0, 0,232, 87, 1, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 96,234, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,144,235, 87, 1, 0, 0, 0, 0,
- 48,233, 87, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,235, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-192,236, 87, 1, 0, 0, 0, 0, 96,234, 87, 1, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,
-108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,236, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,240,237, 87, 1, 0, 0, 0, 0,144,235, 87, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-240,237, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 32,239, 87, 1, 0, 0, 0, 0,192,236, 87, 1, 0, 0, 0, 0,
- 77,101,115,104, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 32,239, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80,240, 87, 1, 0, 0, 0, 0,
-240,237, 87, 1, 0, 0, 0, 0, 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,240, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-128,241, 87, 1, 0, 0, 0, 0, 32,239, 87, 1, 0, 0, 0, 0, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128,241, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,176,242, 87, 1, 0, 0, 0, 0, 80,240, 87, 1, 0, 0, 0, 0, 83,104, 97,100,101,114,115, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 3, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-176,242, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,224,243, 87, 1, 0, 0, 0, 0,128,241, 87, 1, 0, 0, 0, 0,
- 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,224,243, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 16,245, 87, 1, 0, 0, 0, 0,
-176,242, 87, 1, 0, 0, 0, 0, 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,245, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 64,246, 87, 1, 0, 0, 0, 0,224,243, 87, 1, 0, 0, 0, 0, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,246, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,112,247, 87, 1, 0, 0, 0, 0, 16,245, 87, 1, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,
-110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112,247, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,160,248, 87, 1, 0, 0, 0, 0, 64,246, 87, 1, 0, 0, 0, 0,
- 83, 99,114,105,112,116,108,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160,248, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,208,249, 87, 1, 0, 0, 0, 0,
-112,247, 87, 1, 0, 0, 0, 0, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64,246, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,249, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0,251, 87, 1, 0, 0, 0, 0,160,248, 87, 1, 0, 0, 0, 0, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,176,242, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,251, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 48,252, 87, 1, 0, 0, 0, 0,208,249, 87, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,242, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 48,252, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 96,253, 87, 1, 0, 0, 0, 0, 0,251, 87, 1, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 96,253, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,144,254, 87, 1, 0, 0, 0, 0,
- 48,252, 87, 1, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,254, 87, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-192,255, 87, 1, 0, 0, 0, 0, 96,253, 87, 1, 0, 0, 0, 0, 76,105,115,116,101,110,101,114, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,255, 87, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,240, 0, 88, 1, 0, 0, 0, 0,144,254, 87, 1, 0, 0, 0, 0, 83,101,113,117,101,110, 99,101,
-114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-240, 0, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 32, 2, 88, 1, 0, 0, 0, 0,192,255, 87, 1, 0, 0, 0, 0,
- 65,114,109, 97,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 32, 2, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80, 3, 88, 1, 0, 0, 0, 0,
-240, 0, 88, 1, 0, 0, 0, 0, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176,223, 87, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 3, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-128, 4, 88, 1, 0, 0, 0, 0, 32, 2, 88, 1, 0, 0, 0, 0, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128, 4, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,176, 5, 88, 1, 0, 0, 0, 0, 80, 3, 88, 1, 0, 0, 0, 0, 77,105,115,116, 32, 47, 32, 83,
-116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-176, 5, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,224, 6, 88, 1, 0, 0, 0, 0,128, 4, 88, 1, 0, 0, 0, 0,
- 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 4, 88, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,224, 6, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 16, 8, 88, 1, 0, 0, 0, 0,
-176, 5, 88, 1, 0, 0, 0, 0, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16, 8, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 64, 9, 88, 1, 0, 0, 0, 0,224, 6, 88, 1, 0, 0, 0, 0, 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64, 9, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,112, 10, 88, 1, 0, 0, 0, 0, 16, 8, 88, 1, 0, 0, 0, 0, 83,104, 97,112,101,115, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0,
- 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 16, 8, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112, 10, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 9, 88, 1, 0, 0, 0, 0,
- 77,117,108,116,105,114,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160, 11, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,208, 12, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 64,215, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0,192,202, 68,
- 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,116, 10,195, 68,224, 88, 31,193,142,245,105, 67, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63,
- 0, 0, 1, 0, 1, 0, 1, 0, 65, 6,249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 1, 0, 0, 0, 4, 0,176, 35, 89, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,109, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,208, 12, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,
- 80, 16, 88, 1, 0, 0, 0, 0,160, 11, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 64,215, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191,
- 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194,
- 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,
- 80, 16, 88, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,192, 17, 88, 1, 0, 0, 0, 0,208, 12, 88, 1, 0, 0, 0, 0,
- 3, 0, 0, 0, 51, 51, 51, 63, 64,215, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 16, 72, 69, 0, 0, 0, 0, 0, 0,125, 67, 0, 0, 0, 0, 0, 16, 72, 69, 0, 0, 0, 0, 0, 0,125, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,129, 12, 0, 0, 0, 0, 0, 0,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 72, 69, 0, 0,125, 67,
- 0, 0,128, 63, 0, 0,128, 63, 17, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0,192, 17, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 16, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 64,215, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 0, 20, 88, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0, 80, 21, 88, 1, 0, 0, 0, 0, 64,215, 87, 1, 0, 0, 0, 0, 32,210, 87, 1, 0, 0, 0, 0,
- 64,208, 87, 1, 0, 0, 0, 0,160,208, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64, 6, 0, 0,105, 4, 0, 0,131, 4, 0, 0, 0, 0, 0, 0, 64, 6, 0, 0,105, 4, 0, 0,131, 4, 0, 0,
- 0, 0, 0, 0, 64, 6, 0, 0,131, 4, 0, 0,131, 4, 0, 0, 7, 0, 6, 0, 1, 0, 7, 7, 65, 6, 1, 0, 1, 1, 1, 1,
-196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,175,140, 1, 0, 0, 0, 0, 0,211,143, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 80, 21, 88, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 88, 1, 0, 0, 0, 0, 96,209, 87, 1, 0, 0, 0, 0,
- 32,210, 87, 1, 0, 0, 0, 0,128,210, 87, 1, 0, 0, 0, 0,192,209, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,213, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63,
- 0, 0, 0, 0, 64, 6, 0, 0, 21, 1, 0, 0,103, 4, 0, 0, 0, 0, 0, 0, 64, 6, 0, 0, 21, 1, 0, 0, 47, 1, 0, 0,
- 0, 0, 0, 0, 64, 6, 0, 0, 48, 1, 0, 0,103, 4, 0, 0, 9, 0, 8, 0, 1, 0, 1, 1, 65, 6, 56, 3, 1, 0, 1, 0,
- 35, 3, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 25, 88, 1, 0, 0, 0, 0,240, 36, 88, 1, 0, 0, 0, 0, 16,238,143, 1, 0, 0, 0, 0, 16,238,143, 1, 0, 0, 0, 0,
-160, 22, 88, 1, 0, 0, 0, 0,208, 23, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,160, 22, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,208, 23, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,
-109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 21, 2, 62, 1,204, 0,
- 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-208, 23, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 22, 88, 1, 0, 0, 0, 0,
- 86,105,101,119, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 84, 1, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 56, 3, 0, 0, 0, 25, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,128, 28, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 80, 21, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,213, 29, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63,123,176, 73, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,156,207, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,121,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,213, 29, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
- 0, 0, 0,128, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,123,176, 73, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,251,255, 0, 0, 0, 0, 12, 66, 0, 0,128, 63,205,204,204, 61,
- 38, 0,129, 60,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128,
-193, 55,143, 63, 0,174,255,192, 88, 23,141,191, 60, 0, 1, 0, 7, 0,207, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0,255,255,
- 43, 44,151, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44,151, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 43, 44,151, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0,128, 28, 88, 1, 0, 0, 0, 0,
-136, 0, 0, 0, 1, 0, 0, 0, 64, 30, 88, 1, 0, 0, 0, 0, 0, 25, 88, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63,
- 80, 21, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64,
- 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
- 16, 0, 0, 0,168, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68,
- 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63,
- 68, 65, 84, 65, 48, 1, 0, 0, 64, 30, 88, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,176, 34, 88, 1, 0, 0, 0, 0,
-128, 28, 88, 1, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 80, 21, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 72, 69, 0, 0, 0, 0, 0, 0, 86, 68, 0, 0, 0, 0, 0, 16, 72, 69,
- 0, 0, 0, 0, 0, 0, 86, 68, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129, 12, 0, 0, 0, 0, 0, 0, 88, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 16, 72, 69, 0, 0, 86, 68, 0, 0,128, 63, 0, 0,128, 63, 17, 0, 2, 0, 1, 0, 1, 0,233, 3, 50, 2, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 31, 88, 1, 0, 0, 0, 0, 48, 34, 88, 1, 0, 0, 0, 0,
- 0, 0,143, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0,176, 31, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,
- 48, 32, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 61, 10,192,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 64, 0, 0, 0, 48, 32, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,176, 32, 88, 1, 0, 0, 0, 0,
-176, 31, 88, 1, 0, 0, 0, 0, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0,192, 64,205,204,124, 65, 0, 0, 0, 0, 0, 0, 0, 0,
-176, 35, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0,
-176, 32, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 48, 33, 88, 1, 0, 0, 0, 0, 48, 32, 88, 1, 0, 0, 0, 0,
- 65, 77, 5, 0, 0, 0, 0, 0,235, 49,126, 65, 98, 62,200, 65, 0, 0, 0, 0, 0, 0, 0, 0,144, 30, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0, 48, 33, 88, 1, 0, 0, 0, 0,
-183, 0, 0, 0, 1, 0, 0, 0,176, 33, 88, 1, 0, 0, 0, 0,176, 32, 88, 1, 0, 0, 0, 0, 66, 79, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 96, 65, 0, 0, 0, 0, 0, 0, 0, 0, 80, 26, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0,176, 33, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,
- 48, 34, 88, 1, 0, 0, 0, 0, 48, 33, 88, 1, 0, 0, 0, 0, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65,
- 0, 0, 0, 0, 0, 0, 0, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 64, 0, 0, 0, 48, 34, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176, 33, 88, 1, 0, 0, 0, 0, 67, 83, 0, 0, 0, 0, 0, 0, 0, 0,192, 64,102,102,174,193, 0, 0, 0, 0, 0, 0, 0, 0,
-192,249, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,
-176, 34, 88, 1, 0, 0, 0, 0,232, 0, 0, 0, 1, 0, 0, 0,192, 35, 88, 1, 0, 0, 0, 0, 64, 30, 88, 1, 0, 0, 0, 0,
- 12, 0, 0, 0, 51, 51, 51, 63, 80, 21, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,122, 68, 0, 0,122,196, 0, 0, 0, 0, 0, 0,160,192, 0, 0,130, 66, 0, 0,150,194, 0, 0,160, 64,
-217, 3, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0,128, 0, 0, 0,217, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
-128, 0, 0, 0,217, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68,
- 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,192, 35, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,240, 36, 88, 1, 0, 0, 0, 0,
-176, 34, 88, 1, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 80, 21, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68,
- 0, 0,160,193, 0, 0,100, 67,246, 56,165, 67, 26, 29,110, 68, 13,102,183,193,246, 25,161, 67, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63,
- 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,240, 36, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 35, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 80, 21, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 83, 97,118,101,
- 32, 70,105,108,101, 0, 78, 84, 0, 32, 80, 73, 67, 84, 85, 82, 69, 83, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,
-101,115,107,116,111,112, 47, 0,117,109,112, 98,117,103, 32, 70,111,108,100,101,114, 47, 0,101,110,100,101,114, 46, 97,112,112,
- 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 11, 0, 1, 0, 0, 0,251, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,255,255, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,168, 0, 0, 0,
- 48, 39, 88, 1, 0, 0, 0, 0,155, 0, 0, 0, 1, 0, 0, 0, 96,127, 88, 1, 0, 0, 0, 0,240,206, 87, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 51, 45, 77, 97,116,101,114,105, 97,108, 0,111,100,101,
-108, 32, 83,105,110,103, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 40, 88, 1, 0, 0, 0, 0,
- 0, 45, 88, 1, 0, 0, 0, 0, 96, 45, 88, 1, 0, 0, 0, 0, 0, 55, 88, 1, 0, 0, 0, 0,112, 55, 88, 1, 0, 0, 0, 0,
- 96,117, 88, 1, 0, 0, 0, 0,192,249, 88, 1, 0, 0, 0, 0, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 3, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 32, 40, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,224, 40, 88, 1, 0, 0, 0, 0, 32, 40, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,224, 40, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 64, 41, 88, 1, 0, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 64, 41, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0,
-224, 40, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-160, 41, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0, 64, 41, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 3, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-192, 42, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0,
- 96, 42, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 32, 43, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 44, 3, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 44, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 64, 44, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 1, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0,
-224, 43, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 3,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-160, 44, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,164, 1,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-164, 1, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96, 45, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-208, 45, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0,224, 40, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208, 45, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 64, 46, 88, 1, 0, 0, 0, 0, 96, 45, 88, 1, 0, 0, 0, 0, 32, 40, 88, 1, 0, 0, 0, 0, 64, 41, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64, 46, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-176, 46, 88, 1, 0, 0, 0, 0,208, 45, 88, 1, 0, 0, 0, 0, 32, 40, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176, 46, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 32, 47, 88, 1, 0, 0, 0, 0, 64, 46, 88, 1, 0, 0, 0, 0, 64, 41, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32, 47, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-144, 47, 88, 1, 0, 0, 0, 0,176, 46, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144, 47, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0, 48, 88, 1, 0, 0, 0, 0, 32, 47, 88, 1, 0, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0, 48, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-112, 48, 88, 1, 0, 0, 0, 0,144, 47, 88, 1, 0, 0, 0, 0,224, 40, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,112, 48, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-224, 48, 88, 1, 0, 0, 0, 0, 0, 48, 88, 1, 0, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224, 48, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 80, 49, 88, 1, 0, 0, 0, 0,112, 48, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80, 49, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-192, 49, 88, 1, 0, 0, 0, 0,224, 48, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,192, 49, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 48, 50, 88, 1, 0, 0, 0, 0, 80, 49, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48, 50, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-160, 50, 88, 1, 0, 0, 0, 0,192, 49, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,160, 50, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 16, 51, 88, 1, 0, 0, 0, 0, 48, 50, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 16, 51, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-128, 51, 88, 1, 0, 0, 0, 0,160, 50, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128, 51, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-240, 51, 88, 1, 0, 0, 0, 0, 16, 51, 88, 1, 0, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240, 51, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 96, 52, 88, 1, 0, 0, 0, 0,128, 51, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96, 52, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-208, 52, 88, 1, 0, 0, 0, 0,240, 51, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208, 52, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 64, 53, 88, 1, 0, 0, 0, 0, 96, 52, 88, 1, 0, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64, 53, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-176, 53, 88, 1, 0, 0, 0, 0,208, 52, 88, 1, 0, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176, 53, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 32, 54, 88, 1, 0, 0, 0, 0, 64, 53, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32, 54, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-144, 54, 88, 1, 0, 0, 0, 0,176, 53, 88, 1, 0, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144, 54, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0, 55, 88, 1, 0, 0, 0, 0, 32, 54, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0, 55, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144, 54, 88, 1, 0, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,112, 55, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
-208, 71, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 40, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0,
- 0, 42, 88, 1, 0, 0, 0, 0, 64, 41, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 27, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 33, 0, 1, 1, 1, 0,192, 2, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 61, 88, 1, 0, 0, 0, 0,
-144, 69, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 56, 88, 1, 0, 0, 0, 0,
- 80, 60, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192, 56, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-240, 57, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,240, 57, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 32, 59, 88, 1, 0, 0, 0, 0,192, 56, 88, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 32, 59, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80, 60, 88, 1, 0, 0, 0, 0,240, 57, 88, 1, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 80, 60, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 32, 59, 88, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0,128, 61, 88, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,
-112, 62, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0,
- 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,128, 63, 0, 0, 16, 65, 0, 0,250, 70, 0, 0, 16, 65,
-205,204,204, 61, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0,112, 62, 88, 1, 0, 0, 0, 0,
-222, 0, 0, 0, 1, 0, 0, 0,112, 63, 88, 1, 0, 0, 0, 0,128, 61, 88, 1, 0, 0, 0, 0, 11, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,239, 92, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66,
- 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 9, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67,
- 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,112, 63, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,
-160, 64, 88, 1, 0, 0, 0, 0,112, 62, 88, 1, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67, 63, 0, 0,193,172, 3,182, 68, 0, 0, 0,193, 0, 0,104, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
- 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,251, 4,209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0,
-109, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,160, 64, 88, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0, 32, 68, 88, 1, 0, 0, 0, 0,112, 63, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 48, 1, 0, 0, 32, 68, 88, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,144, 69, 88, 1, 0, 0, 0, 0,
-160, 64, 88, 1, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,192, 0, 0,160, 64, 0, 0, 0, 0,205,204,140, 65,201, 82, 5,194,124,171, 30, 66,
- 49,238,226, 64,140,108,168, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0,245, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64,
- 0, 0,160, 67, 0, 0,160, 67, 10,215, 35, 60, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,144, 69, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 32, 68, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,
-208, 71, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 32, 73, 88, 1, 0, 0, 0, 0,112, 55, 88, 1, 0, 0, 0, 0,
- 96, 42, 88, 1, 0, 0, 0, 0,128, 40, 88, 1, 0, 0, 0, 0,224, 40, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,
-233, 3, 1, 0, 1, 1, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,
- 32, 73, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 96, 97, 88, 1, 0, 0, 0, 0,208, 71, 88, 1, 0, 0, 0, 0,
- 32, 43, 88, 1, 0, 0, 0, 0,128, 43, 88, 1, 0, 0, 0, 0,192, 42, 88, 1, 0, 0, 0, 0, 0, 42, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,139, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128,
- 74,215, 76,190, 0, 0, 0,128, 45, 3, 0, 0,232, 3, 0, 0, 61, 0, 0, 0, 5, 3, 0, 0, 45, 3, 0, 0,232, 3, 0, 0,
- 61, 0, 0, 0, 87, 0, 0, 0, 45, 3, 0, 0,232, 3, 0, 0, 88, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4,
-188, 0,174, 2, 1, 1, 1, 0,179, 1,126, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,176, 88, 88, 1, 0, 0, 0, 0, 32, 95, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,112, 74, 88, 1, 0, 0, 0, 0,128, 87, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112, 74, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,160, 75, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160, 75, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,208, 76, 88, 1, 0, 0, 0, 0,
-112, 74, 88, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208, 76, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0, 78, 88, 1, 0, 0, 0, 0,160, 75, 88, 1, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0, 78, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 48, 79, 88, 1, 0, 0, 0, 0,208, 76, 88, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 48, 79, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 96, 80, 88, 1, 0, 0, 0, 0, 0, 78, 88, 1, 0, 0, 0, 0,
- 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 96, 80, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,144, 81, 88, 1, 0, 0, 0, 0,
- 48, 79, 88, 1, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144, 81, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-192, 82, 88, 1, 0, 0, 0, 0, 96, 80, 88, 1, 0, 0, 0, 0, 83,104, 97,100,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192, 82, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,240, 83, 88, 1, 0, 0, 0, 0,144, 81, 88, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,252, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-240, 83, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 32, 85, 88, 1, 0, 0, 0, 0,192, 82, 88, 1, 0, 0, 0, 0,
- 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 92,251, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 32, 85, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 80, 86, 88, 1, 0, 0, 0, 0,
-240, 83, 88, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 86, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-128, 87, 88, 1, 0, 0, 0, 0, 32, 85, 88, 1, 0, 0, 0, 0, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 96, 80, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128, 87, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 86, 88, 1, 0, 0, 0, 0, 77,105,114,114,111,114, 32, 84,
-114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-176, 88, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,224, 89, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,193, 0, 0,163, 67, 0,128,148,196, 0, 0,104, 67,
- 0, 0, 0,193, 0, 0,163, 67,170,175,118,196,255,255,103, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,
-188, 0,174, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 56, 3, 0, 0,224, 89, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0, 96, 93, 88, 1, 0, 0, 0, 0,
-176, 88, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,
-200, 80, 98,190, 0, 0, 0, 0,239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,
-122,166,182,193, 0, 0,128, 63,186, 74,140, 62, 35,120,117, 63,254,220,151, 61, 0, 0, 0, 0,160,194, 72,191,131,105, 54, 62,
- 30, 40, 24, 63, 0, 0, 0, 0, 32,132, 14, 63,190, 80, 98,190, 94,255, 76, 63, 0, 0, 0, 0, 92,160, 70, 65,162, 28,188,192,
-224, 17,146, 65, 0, 0,128, 63,197, 52, 91, 63,228,148, 91,191,186,146, 14,191, 33,132, 14,191,223,197, 63, 64,106,131, 71, 62,
-246,103, 98, 62,200, 80, 98, 62, 52, 73,109, 62,225,107, 38, 63, 93, 20, 77,191, 94,255, 76,191,240, 60, 48, 64,130, 29,156,189,
-128, 31,181, 65,122,166,182, 65,252,146,179, 61,173, 25,157, 62, 75, 99,194, 60, 0, 0,165, 50,214,141, 55,191,192,199, 38, 62,
-176, 28, 11, 63, 0,128, 24,181,167, 58,120,194,184, 22,235, 65, 49,140,182,194, 27,247,159,192, 5, 26,118, 66, 44,106,233,193,
-230, 4,181, 66,126, 7,160, 64,255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,139, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128,
- 74,215, 76,190, 0, 0, 0,128,188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,
-200, 80, 98,190, 0, 0, 0, 0,239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,
-122,166,182,193, 0, 0,128, 63,218, 31, 64, 63, 36, 17,139,190,182,154, 36,190,156,165, 20,191,221, 79,187, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0, 96, 93, 88, 1, 0, 0, 0, 0,
-136, 0, 0, 0, 1, 0, 0, 0, 32, 95, 88, 1, 0, 0, 0, 0,224, 89, 88, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63,
- 1, 86,249,156,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68,
- 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0, 32, 95, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 96, 93, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,117,115,114, 47,104,111,109,101, 47,105,110,116,114,114, 47, 98,108,101,110,
-100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,
-116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 24, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 96, 97, 88, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0, 96,107, 88, 1, 0, 0, 0, 0, 32, 73, 88, 1, 0, 0, 0, 0,160, 41, 88, 1, 0, 0, 0, 0,
-224, 43, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0, 32, 43, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0, 87, 0, 0, 0,
- 0, 0, 0, 0, 43, 3, 0, 0, 88, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 44, 3, 88, 1, 1, 0, 1, 0,
-251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176, 98, 88, 1, 0, 0, 0, 0, 32,105, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,176, 98, 88, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0, 48,102, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 7,236,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0,104,217, 30,191,106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0,202, 25,217, 60,235, 76,145, 61, 70,151,128,186, 0, 0,128, 63,172, 79,187, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,181, 30, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
-255,255,249,195, 0, 0, 0, 0,103,217, 30,191,106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
-111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,172, 79,187, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 10, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 1, 0,
- 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 48,102, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0, 96,103, 88, 1, 0, 0, 0, 0,
-176, 98, 88, 1, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68,
- 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63,
- 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0, 96,103, 88, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0,
- 32,105, 88, 1, 0, 0, 0, 0, 48,102, 88, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
- 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0,
- 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,
- 32,105, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,103, 88, 1, 0, 0, 0, 0,
- 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,
-100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,
-110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 96,107, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
- 96,117, 88, 1, 0, 0, 0, 0, 96, 97, 88, 1, 0, 0, 0, 0,160, 44, 88, 1, 0, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
-128, 43, 88, 1, 0, 0, 0, 0, 64, 44, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,173,101,182, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-154, 65,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128,165, 1, 0, 0, 43, 3, 0, 0,
-177, 1, 0, 0, 5, 3, 0, 0,165, 1, 0, 0, 43, 3, 0, 0,177, 1, 0, 0,177, 1, 0, 0,165, 1, 0, 0, 43, 3, 0, 0,
-177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,135, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,108, 88, 1, 0, 0, 0, 0,
- 32,115, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,176,108, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,
- 48,112, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0,
- 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0,
- 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63,223,149, 47, 63, 55, 70, 58, 63,192, 56, 49,188, 0, 0, 0, 0,
- 87,126,162,190,228,251,159, 62, 56, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,150, 84, 28,191, 50,247,227, 62, 0, 0, 0, 0,
-110,101,239, 64,151, 62,208,192, 77,255,170, 64, 0, 0,128, 63,144, 52,122, 63, 39,192, 4,191,244,250, 39,191, 8,165, 39,191,
-228,183,132, 63, 75,179, 2, 63,180,164, 28, 63,149, 84, 28, 63,118,137,124,188,232, 64,187, 63, 8,108,228,190, 50,247,227,190,
- 18,188,246,190,141,144, 29,191,216, 49, 49, 65,152, 9, 52, 65,116,112,246, 62,142,184, 2, 63, 64,191,248,187, 0, 0,144,179,
- 64,230, 70,190,226,211, 67, 62,254, 71, 12, 63, 0, 0, 0, 52,211,120, 21,194,144, 5, 2, 66, 7,136,213,193,193,214,159,192,
-219, 38, 19, 66,196,173,255,193,155,101,210, 65,173, 40,160, 64,173,101,182, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191,
- 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128,221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0,
- 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0,191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0,
- 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63,241, 22, 72, 63, 78,162,246,190, 44, 8, 90,190, 3, 35,171,190,
-221, 79,187, 65, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 0, 0, 0, 0, 12, 66,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0,104,217, 30, 63,
-106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 3, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,224, 65, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 48,112, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0, 96,113, 88, 1, 0, 0, 0, 0,176,108, 88, 1, 0, 0, 0, 0,
- 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,
-172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,120, 1, 0, 0, 96,113, 88, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0, 32,115, 88, 1, 0, 0, 0, 0,
- 48,112, 88, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65,
- 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0, 32,115, 88, 1, 0, 0, 0, 0,
-139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,113, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,
-114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
- 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0, 96,117, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 96,107, 88, 1, 0, 0, 0, 0,224, 43, 88, 1, 0, 0, 0, 0, 96, 42, 88, 1, 0, 0, 0, 0, 0, 45, 88, 1, 0, 0, 0, 0,
-160, 44, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7, 43,186, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0,
- 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0,177, 1, 0, 0, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 1,164, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,118, 88, 1, 0, 0, 0, 0, 32,125, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 56, 3, 0, 0,176,118, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0, 48,122, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,
-255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51, 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,
-107, 40, 52,191, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,
- 1, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,128,191,176, 2, 19, 51, 0, 0, 0, 0, 59,248, 30, 64,107, 40, 52,191,
- 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,209, 85, 49,
-110, 18, 3, 59, 0, 0, 0, 0, 0, 0, 0, 0, 6, 43,186, 61,234,137,150,174, 0, 0, 0, 0,195,184, 59,190,143, 90,179,190,
- 79,123,184, 58, 0, 0,128, 63, 74,202, 88, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0,128, 52,
- 85, 3, 48, 65, 0, 0, 0, 0, 0, 0,128,171, 1, 0,250, 67,160,144,143,183, 0, 0, 0, 0, 59,248, 30, 64,106, 40, 52,191,
- 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 43,186, 61,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,
-255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51, 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,
-107, 40, 52,191, 0, 0,128, 63,243, 4, 53, 63,243, 4, 53,191, 0, 0, 0, 0, 0, 0, 0, 0, 73,202, 88, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 58,248, 30,192,106, 40, 52, 63, 46,161,118,192,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 2, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,
-162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 48,122, 88, 1, 0, 0, 0, 0,
-137, 0, 0, 0, 1, 0, 0, 0, 96,123, 88, 1, 0, 0, 0, 0,176,118, 88, 1, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,
-169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66,
- 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0,
- 96,123, 88, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0, 32,125, 88, 1, 0, 0, 0, 0, 48,122, 88, 1, 0, 0, 0, 0,
- 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67,
- 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60,
- 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0, 32,125, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,123, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69,
- 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,
-101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,168, 0, 0, 0,
- 96,127, 88, 1, 0, 0, 0, 0,155, 0, 0, 0, 1, 0, 0, 0,176,187, 88, 1, 0, 0, 0, 0, 48, 39, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 52, 45, 83,101,113,117,101,110, 99,101, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,128, 88, 1, 0, 0, 0, 0,
- 48,133, 88, 1, 0, 0, 0, 0,144,133, 88, 1, 0, 0, 0, 0, 80,142, 88, 1, 0, 0, 0, 0,192,142, 88, 1, 0, 0, 0, 0,
-144,179, 88, 1, 0, 0, 0, 0,192,249, 88, 1, 0, 0, 0, 0, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 4, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 80,128, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 16,129, 88, 1, 0, 0, 0, 0, 80,128, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 16,129, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-112,129, 88, 1, 0, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,112,129, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0,
- 16,129, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-208,129, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0,112,129, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 3,200, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-240,130, 88, 1, 0, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 1, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0,
-144,130, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 80,131, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 3,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-112,132, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 2,244, 1, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0,
- 16,132, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 2, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-208,132, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-232, 3, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144,133, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0,134, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0, 16,129, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0,134, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-112,134, 88, 1, 0, 0, 0, 0,144,133, 88, 1, 0, 0, 0, 0, 80,128, 88, 1, 0, 0, 0, 0,112,129, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,112,134, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-224,134, 88, 1, 0, 0, 0, 0, 0,134, 88, 1, 0, 0, 0, 0, 80,128, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224,134, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 80,135, 88, 1, 0, 0, 0, 0,112,134, 88, 1, 0, 0, 0, 0,112,129, 88, 1, 0, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80,135, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-192,135, 88, 1, 0, 0, 0, 0,224,134, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,192,135, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 48,136, 88, 1, 0, 0, 0, 0, 80,135, 88, 1, 0, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48,136, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-160,136, 88, 1, 0, 0, 0, 0,192,135, 88, 1, 0, 0, 0, 0, 16,129, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,160,136, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 16,137, 88, 1, 0, 0, 0, 0, 48,136, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 16,137, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-128,137, 88, 1, 0, 0, 0, 0,160,136, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128,137, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-240,137, 88, 1, 0, 0, 0, 0, 16,137, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240,137, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 96,138, 88, 1, 0, 0, 0, 0,128,137, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96,138, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-208,138, 88, 1, 0, 0, 0, 0,240,137, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208,138, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 64,139, 88, 1, 0, 0, 0, 0, 96,138, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64,139, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-176,139, 88, 1, 0, 0, 0, 0,208,138, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176,139, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 32,140, 88, 1, 0, 0, 0, 0, 64,139, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32,140, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-144,140, 88, 1, 0, 0, 0, 0,176,139, 88, 1, 0, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144,140, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0,141, 88, 1, 0, 0, 0, 0, 32,140, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0,141, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-112,141, 88, 1, 0, 0, 0, 0,144,140, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,112,141, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
-224,141, 88, 1, 0, 0, 0, 0, 0,141, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224,141, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 80,142, 88, 1, 0, 0, 0, 0,112,141, 88, 1, 0, 0, 0, 0, 48,130, 88, 1, 0, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80,142, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,224,141, 88, 1, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,192,142, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
- 64,152, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,128, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0,
- 48,130, 88, 1, 0, 0, 0, 0,112,129, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 0, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,173, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 0, 0, 0, 0,172, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,233, 3,173, 0, 1, 0, 1, 1,139, 1, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,148, 88, 1, 0, 0, 0, 0,
- 0,150, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,144, 88, 1, 0, 0, 0, 0,
-160,147, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,144, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 64,145, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,145, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,112,146, 88, 1, 0, 0, 0, 0, 16,144, 88, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112,146, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,160,147, 88, 1, 0, 0, 0, 0, 64,145, 88, 1, 0, 0, 0, 0,
- 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160,147, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,146, 88, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,148, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,
- 0,150, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 30,252,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,118,149,172, 68, 0, 0, 0,193, 0, 0,104, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
- 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0, 0,150, 88, 1, 0, 0, 0, 0,
-139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,148, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 30,252,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
- 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0, 64,152, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,144,153, 88, 1, 0, 0, 0, 0,
-192,142, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,176,128, 88, 1, 0, 0, 0, 0, 16,129, 88, 1, 0, 0, 0, 0,
-240,130, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 1, 0, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0,144,153, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,160,162, 88, 1, 0, 0, 0, 0,
- 64,152, 88, 1, 0, 0, 0, 0,208,129, 88, 1, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0,
- 48,130, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,
- 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0, 3, 1, 0, 0,
- 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0,227, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,228, 0, 0, 0, 3, 1, 0, 0,
- 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 32, 0, 1, 0, 1, 1,192, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,154, 88, 1, 0, 0, 0, 0, 96,160, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,176, 0, 0, 0,224,154, 88, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,208,155, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188,255,255,255,255, 0, 0,128,192, 0, 0,126, 67,
- 0, 0, 0, 0, 0, 0, 0, 66, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0,
- 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 66, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,208,155, 88, 1, 0, 0, 0, 0,138, 0, 0, 0, 1, 0, 0, 0,
-224,156, 88, 1, 0, 0, 0, 0,224,154, 88, 1, 0, 0, 0, 0, 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65,
- 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
- 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 32, 0, 0, 0,
- 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 68, 65, 84, 65, 56, 3, 0, 0,224,156, 88, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0, 96,160, 88, 1, 0, 0, 0, 0,208,155, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 38,188,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 38,140, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0, 96,160, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-224,156, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82, 71, 65, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46,
- 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,160,162, 88, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0,192,170, 88, 1, 0, 0, 0, 0,144,153, 88, 1, 0, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,
-112,132, 88, 1, 0, 0, 0, 0,240,130, 88, 1, 0, 0, 0, 0,176,131, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63,
- 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0, 5, 3, 0, 0, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0,245, 1, 0, 0,
- 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,148, 1, 17, 1, 3, 0, 1, 1,
- 9, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240,163, 88, 1, 0, 0, 0, 0,128,168, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,240,163, 88, 1, 0, 0, 0, 0,
-138, 0, 0, 0, 1, 0, 0, 0, 0,165, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 42,204,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
- 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0, 49, 1, 0, 0, 17, 0, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0,124, 2, 0, 0,
- 17, 0, 0, 0, 49, 1, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65,
- 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 68, 65, 84, 65, 56, 3, 0, 0,
- 0,165, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,128,168, 88, 1, 0, 0, 0, 0,240,163, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
-228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
-102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42,251,220, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
-128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60,
- 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,128,168, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,165, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69,
- 32, 84, 65, 82, 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,116, 49, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,
-192,170, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,144,179, 88, 1, 0, 0, 0, 0,160,162, 88, 1, 0, 0, 0, 0,
- 80,131, 88, 1, 0, 0, 0, 0,144,130, 88, 1, 0, 0, 0, 0,112,132, 88, 1, 0, 0, 0, 0, 16,132, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,220, 29, 62,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
- 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, 83, 2, 0, 0,245, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0,
-245, 1, 0, 0, 15, 2, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0, 16, 2, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2,
- 84, 2,246, 0, 1, 0, 1, 0,203, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 16,172, 88, 1, 0, 0, 0, 0, 80,177, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0,
- 16,172, 88, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0,208,173, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66,205,204,204,189,205,204,140, 63, 0, 0,160,192, 0, 0,210, 66,
-205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,246, 0, 0, 0, 16, 0, 0, 0, 19, 2, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 19, 2, 0, 0, 16, 0, 0, 0,246, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60,
- 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 83, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66,
-205,204,204,189,205,204,140, 63, 68, 65, 84, 65, 56, 3, 0, 0,208,173, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,
- 80,177, 88, 1, 0, 0, 0, 0, 16,172, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,205,220, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,179,146,207, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,
- 80,177, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,173, 88, 1, 0, 0, 0, 0,
- 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 79, 65, 68, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,144,179, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,192,170, 88, 1, 0, 0, 0, 0,208,132, 88, 1, 0, 0, 0, 0, 80,131, 88, 1, 0, 0, 0, 0,
-176,131, 88, 1, 0, 0, 0, 0, 48,133, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0,
- 5, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 5, 1, 0, 0, 31, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,
- 32, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0, 1, 0, 8, 8,233, 3,212, 0, 1, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,180, 88, 1, 0, 0, 0, 0,
-112,185, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,224,180, 88, 1, 0, 0, 0, 0,138, 0, 0, 0, 1, 0, 0, 0,
-240,181, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65,
- 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,212, 0, 0, 0,
- 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0,212, 0, 0, 0,
- 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 68, 65, 84, 65, 56, 3, 0, 0,240,181, 88, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0,112,185, 88, 1, 0, 0, 0, 0,224,180, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 87, 49,172,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 38,140, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0,112,185, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240,181, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82, 71, 65, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46,
- 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,168, 0, 0, 0,176,187, 88, 1, 0, 0, 0, 0,
-155, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,127, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 53, 45, 83, 99,114,105,112,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,188, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0,
- 96,192, 88, 1, 0, 0, 0, 0,128,198, 88, 1, 0, 0, 0, 0,240,198, 88, 1, 0, 0, 0, 0, 96,228, 88, 1, 0, 0, 0, 0,
-192,249, 88, 1, 0, 0, 0, 0, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,160,188, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 0,189, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0,189, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 96,189, 88, 1, 0, 0, 0, 0,160,188, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0, 96,189, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,192,189, 88, 1, 0, 0, 0, 0,
- 0,189, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
-192,189, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0, 96,189, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0,192,189, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
-224,190, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0,
- 68, 65, 84, 65, 32, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0,
-128,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,
- 64,191, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,156, 1,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0,
-156, 0, 0, 0, 1, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-156, 1, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0,156, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156, 1, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 96,192, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,208,192, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,189, 88, 1, 0, 0, 0, 0, 96,189, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,208,192, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 64,193, 88, 1, 0, 0, 0, 0,
- 96,192, 88, 1, 0, 0, 0, 0, 0,189, 88, 1, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 64,193, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,176,193, 88, 1, 0, 0, 0, 0,
-208,192, 88, 1, 0, 0, 0, 0, 96,189, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,176,193, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 32,194, 88, 1, 0, 0, 0, 0,
- 64,193, 88, 1, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 32,194, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,144,194, 88, 1, 0, 0, 0, 0,
-176,193, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,144,194, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 0,195, 88, 1, 0, 0, 0, 0,
- 32,194, 88, 1, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 0,195, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,112,195, 88, 1, 0, 0, 0, 0,
-144,194, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,112,195, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,224,195, 88, 1, 0, 0, 0, 0,
- 0,195, 88, 1, 0, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,224,195, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 80,196, 88, 1, 0, 0, 0, 0,
-112,195, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 80,196, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,192,196, 88, 1, 0, 0, 0, 0,
-224,195, 88, 1, 0, 0, 0, 0,160,188, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,192,196, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 48,197, 88, 1, 0, 0, 0, 0,
- 80,196, 88, 1, 0, 0, 0, 0,160,188, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 48,197, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,160,197, 88, 1, 0, 0, 0, 0,
-192,196, 88, 1, 0, 0, 0, 0,192,189, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,160,197, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 16,198, 88, 1, 0, 0, 0, 0,
- 48,197, 88, 1, 0, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0, 16,198, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,128,198, 88, 1, 0, 0, 0, 0,
-160,197, 88, 1, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,128,198, 88, 1, 0, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 16,198, 88, 1, 0, 0, 0, 0,192,189, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0,240,198, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 64,200, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0, 0,189, 88, 1, 0, 0, 0, 0, 96,189, 88, 1, 0, 0, 0, 0,
-224,190, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 8, 1, 0, 0, 64,200, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0,176,209, 88, 1, 0, 0, 0, 0,
-240,198, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0,128,190, 88, 1, 0, 0, 0, 0,160,191, 88, 1, 0, 0, 0, 0,
- 64,191, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122,214,248, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,155, 1, 0, 0,213, 0, 0, 0, 5, 3, 0, 0,
- 0, 0, 0, 0,155, 1, 0, 0,213, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,240, 0, 0, 0, 5, 3, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 1,156, 1, 22, 2, 1, 0, 3, 0,251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,203, 88, 1, 0, 0, 0, 0,112,207, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,201, 88, 1, 0, 0, 0, 0,192,202, 88, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,144,201, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,192,202, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,202, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144,201, 88, 1, 0, 0, 0, 0, 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,
-101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,240,203, 88, 1, 0, 0, 0, 0,
-132, 0, 0, 0, 1, 0, 0, 0,112,207, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,
- 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 38,175, 3, 65, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,
-111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0,
- 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0,
- 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,248, 1, 0, 0,112,207, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240,203, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,176,209, 88, 1, 0, 0, 0, 0,
-159, 0, 0, 0, 1, 0, 0, 0, 96,228, 88, 1, 0, 0, 0, 0, 64,200, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0,
-160,191, 88, 1, 0, 0, 0, 0,224,190, 88, 1, 0, 0, 0, 0,192,189, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,
-157, 1, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0,157, 1, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,
-157, 1, 0, 0,232, 3, 0, 0, 27, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 9, 9, 76, 2,235, 2, 3, 0, 3, 0,
-165, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 48,212, 88, 1, 0, 0, 0, 0, 32,226, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,211, 88, 1, 0, 0, 0, 0, 0,211, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,211, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,
-109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0,
- 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,136, 0, 0, 0,
- 48,212, 88, 1, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0, 0,213, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 9, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-160, 11, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,
-225, 2, 0, 0,227, 2, 0, 0, 5, 0, 0, 0, 17, 0, 0, 0,207, 2, 0, 0,227, 2, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,
- 0,213, 88, 1, 0, 0, 0, 0,141, 0, 0, 0, 1, 0, 0, 0, 96,214, 88, 1, 0, 0, 0, 0, 48,212, 88, 1, 0, 0, 0, 0,
- 6, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, 0, 0,120,190, 0, 0,159, 63, 0, 0,242,190, 0,128,188, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 1, 0, 0, 96,214, 88, 1, 0, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0,
- 32,216, 88, 1, 0, 0, 0, 0, 0,213, 88, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,
-205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0,
- 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 59, 1, 0, 0,
- 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0,
- 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65, 48, 1, 0, 0,
- 32,216, 88, 1, 0, 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,144,219, 88, 1, 0, 0, 0, 0, 96,214, 88, 1, 0, 0, 0, 0,
- 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181,
- 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144,217, 88, 1, 0, 0, 0, 0, 16,219, 88, 1, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 64, 0, 0, 0,144,217, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 16,218, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 65, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 26, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0,
- 16,218, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,144,218, 88, 1, 0, 0, 0, 0,144,217, 88, 1, 0, 0, 0, 0,
- 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65, 0, 0, 0, 0, 0, 0, 0, 0,128, 17, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0,144,218, 88, 1, 0, 0, 0, 0,
-183, 0, 0, 0, 1, 0, 0, 0, 16,219, 88, 1, 0, 0, 0, 0, 16,218, 88, 1, 0, 0, 0, 0, 66, 79, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,113, 61, 10,192, 0, 0, 0, 0, 0, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 0, 0, 0, 16,219, 88, 1, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144,218, 88, 1, 0, 0, 0, 0, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,174,143, 65,
- 0, 0, 0, 0, 0, 0, 0, 0,176, 35, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,192, 0, 0, 0,144,219, 88, 1, 0, 0, 0, 0,222, 0, 0, 0, 1, 0, 0, 0,144,220, 88, 1, 0, 0, 0, 0,
- 32,216, 88, 1, 0, 0, 0, 0, 11, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67,
- 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,
- 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65,
- 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0,
-144,220, 88, 1, 0, 0, 0, 0,142, 0, 0, 0, 1, 0, 0, 0,144,221, 88, 1, 0, 0, 0, 0,144,219, 88, 1, 0, 0, 0, 0,
- 13, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66,
- 0, 0, 0, 0, 0, 0,182, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0,
- 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,122, 68, 0, 0,122, 68,205,204,204, 61, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,144,221, 88, 1, 0, 0, 0, 0,
-232, 0, 0, 0, 1, 0, 0, 0,160,222, 88, 1, 0, 0, 0, 0,144,220, 88, 1, 0, 0, 0, 0, 12, 0, 0, 0, 51, 51, 51, 63,
- 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66,
- 0, 0,122,196, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,150,194, 0, 0,160, 64,108, 1, 0, 0,124, 1, 0, 0,
- 0, 0, 0, 0, 14, 2, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0,
- 16, 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66,
- 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,
-160,222, 88, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0, 32,226, 88, 1, 0, 0, 0, 0,144,221, 88, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63,
- 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,
- 33,195, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0,
-128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60,
- 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 10, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0, 32,226, 88, 1, 0, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,160,222, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0,
- 96,228, 88, 1, 0, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,209, 88, 1, 0, 0, 0, 0,
-160,188, 88, 1, 0, 0, 0, 0, 32,190, 88, 1, 0, 0, 0, 0, 64,191, 88, 1, 0, 0, 0, 0, 0,192, 88, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,
-185, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,
-156, 1,185, 0, 3, 0, 3, 0, 79, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80,246, 88, 1, 0, 0, 0, 0,128,247, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,176,229, 88, 1, 0, 0, 0, 0, 32,245, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-176,229, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,224,230, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,224,230, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 16,232, 88, 1, 0, 0, 0, 0,
-176,229, 88, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,232, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 64,233, 88, 1, 0, 0, 0, 0,224,230, 88, 1, 0, 0, 0, 0, 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,233, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,112,234, 88, 1, 0, 0, 0, 0, 16,232, 88, 1, 0, 0, 0, 0, 68,114, 97,119, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-112,234, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,160,235, 88, 1, 0, 0, 0, 0, 64,233, 88, 1, 0, 0, 0, 0,
- 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0,160,235, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,208,236, 88, 1, 0, 0, 0, 0,
-112,234, 88, 1, 0, 0, 0, 0, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,236, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
- 0,238, 88, 1, 0, 0, 0, 0,160,235, 88, 1, 0, 0, 0, 0, 72,111,111,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64,233, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,238, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0, 48,239, 88, 1, 0, 0, 0, 0,208,236, 88, 1, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101,
- 32, 73,110,116,101,114, 97, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,234, 88, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
- 48,239, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 96,240, 88, 1, 0, 0, 0, 0, 0,238, 88, 1, 0, 0, 0, 0,
- 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,234, 88, 1, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 96,240, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,144,241, 88, 1, 0, 0, 0, 0,
- 48,239, 88, 1, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,241, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,
-192,242, 88, 1, 0, 0, 0, 0, 96,240, 88, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,242, 88, 1, 0, 0, 0, 0,
-158, 0, 0, 0, 1, 0, 0, 0,240,243, 88, 1, 0, 0, 0, 0,144,241, 88, 1, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,
-240,243, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 32,245, 88, 1, 0, 0, 0, 0,192,242, 88, 1, 0, 0, 0, 0,
- 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65,240, 0, 0, 0, 32,245, 88, 1, 0, 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-240,243, 88, 1, 0, 0, 0, 0, 83, 99,114,105,112,116,108,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,246, 88, 1, 0, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,
-128,247, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63, 1, 89, 48,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0,193, 0, 0,163, 67, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193, 35,159, 3, 68, 0, 0, 0,193, 0, 0,104, 67,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67,
- 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,156, 1,185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,255,255, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,248, 1, 0, 0,128,247, 88, 1, 0, 0, 0, 0,
-139, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,246, 88, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63,
- 1, 89, 48,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
- 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 83, 67, 0, 0,208, 5, 0, 0,192,249, 88, 1, 0, 0, 0, 0,130, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,
-116, 97,103,101, 0, 97,105,110, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-128, 17, 89, 1, 0, 0, 0, 0,192, 9, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-208,255, 88, 1, 0, 0, 0, 0,176, 0, 89, 1, 0, 0, 0, 0,208,255, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,205,204,204, 61, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 1, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144, 1, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0,100, 0,
-141, 0, 32, 3, 88, 2, 4, 0, 4, 0, 0, 0, 24, 0, 4, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,
- 23, 0, 33, 0, 0, 0,128, 0, 0, 0, 8, 0, 25, 0, 10, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-160, 4, 89, 1, 0, 0, 0, 0,160, 4, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 5, 0, 2, 0, 1, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 98, 97, 99,107, 98,117,102, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,
-205,204, 76, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 6, 0, 0, 0, 16, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63,173, 2, 95, 0,154,153,217, 63, 68,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,
- 48, 49, 89, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,144, 2, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208,255, 88, 1, 0, 0, 0, 0,113, 0, 0, 0, 1, 0, 0, 0,
- 64, 0, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 32, 3,156, 1,
-192, 21, 89, 1, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64, 0, 89, 1, 0, 0, 0, 0,113, 0, 0, 0, 1, 0, 0, 0,
-176, 0, 89, 1, 0, 0, 0, 0,208,255, 88, 1, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 34, 4,219, 1,
- 80, 26, 89, 1, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176, 0, 89, 1, 0, 0, 0, 0,113, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 89, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0,224, 46, 0, 0,
-128, 17, 89, 1, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32, 1, 89, 1, 0, 0, 0, 0,112, 0, 0, 0, 1, 0, 0, 0,
- 44, 1, 0, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 0,244, 1,200, 0,100, 0, 20, 0, 16, 39, 0, 0,205,204,204, 61,
- 0, 0,240, 65, 0, 0, 0, 64, 68, 65, 84, 65,192, 0, 0, 0,144, 1, 89, 1, 0, 0, 0, 0,127, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 1, 0,205,204, 76, 63, 0, 0,180, 66, 9, 0, 1, 0, 0, 0,128, 63,111, 18,131, 58, 32, 0, 32, 0, 32, 0, 1, 0,
- 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 0, 5, 0, 5, 0,255,255, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0,100, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0,
- 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0,
- 0, 0,128, 62, 0, 0, 0, 0, 10,215, 35, 60,205,204,204, 61, 0, 0, 0, 0, 0, 0, 50, 0, 10,215, 35, 60, 10,215, 35, 60,
-102,102,166, 63, 0, 0,192, 63, 0, 0, 52, 66, 72,225,122, 63,205,204,204, 61, 3, 0, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 56, 1, 0, 0,144, 2, 89, 1, 0, 0, 0, 0, 24, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 6, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, 78, 10,127,191, 35, 44,177, 61, 80, 10,127,191,216, 43,177, 61,
- 16, 4, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 72, 0, 0, 0, 16, 4, 89, 1, 0, 0, 0, 0,
- 22, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 86,188,121, 63, 0, 0, 0, 0,
-154,153,153, 62, 96, 60, 75, 63, 0, 0, 0, 0, 51, 51, 51, 63,128, 14, 83, 62, 0, 0, 0, 0,102,102,102, 63, 79,117,200, 60,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 0, 0, 0,160, 4, 89, 1, 0, 0, 0, 0,
-118, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 32, 82,101,110,100,101,114,
- 76, 97,121,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255, 15, 0, 0, 0, 0, 0,255,127, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
- 67, 65, 0, 0,168, 0, 0, 0, 64, 5, 89, 1, 0, 0, 0, 0, 27, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97,
- 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 8, 0,205,204, 76, 62,145,137, 68, 66,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66,161, 14,234, 64, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 76, 65, 0, 0,104, 1, 0, 0, 48, 6, 89, 1, 0, 0, 0, 0, 37, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 32, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,247,255,239, 65,
- 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,224, 7, 89, 1, 0, 0, 0, 0,
- 1, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0,
- 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 56, 1, 0, 0,224, 7, 89, 1, 0, 0, 0, 0, 24, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,
- 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63,
- 96, 9, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 96, 9, 89, 1, 0, 0, 0, 0,
- 22, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 87, 79, 0, 0,152, 1, 0, 0,192, 9, 89, 1, 0, 0, 0, 0,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,128,174,103, 61,112, 29, 98, 62,205,204,204, 62, 0, 0, 0, 0,205,204,204, 61,205,204,204, 61,
-205,204,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 28, 65, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0,
- 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0, 10,215,163, 59, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0,152, 0, 0, 0,160, 11, 89, 1, 0, 0, 0, 0,
- 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0,
-128, 12, 89, 1, 0, 0, 0, 0,128, 12, 89, 1, 0, 0, 0, 0,128, 12, 89, 1, 0, 0, 0, 0,128, 12, 89, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64, 13, 89, 1, 0, 0, 0, 0,255,255,255,255, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 40, 0, 0, 0,128, 12, 89, 1, 0, 0, 0, 0, 24, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,240, 12, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 69, 82, 70,
- 68, 65, 84, 65, 4, 0, 0, 0,240, 12, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 79, 66, 0, 0,
- 0, 4, 0, 0,128, 17, 89, 1, 0, 0, 0, 0,104, 0, 0, 0, 1, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101,
-114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64, 5, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 42,254,141, 63,192, 57, 49, 60, 34,159, 80, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63, 53, 70, 58, 63,
-222, 56, 49,188, 0, 0, 0, 0, 86,126,162,190,227,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,149, 84, 28,191,
- 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0,128, 63, 1, 0,128, 51,
- 1, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0,128, 63, 1, 0,128, 51, 0, 0, 0, 0, 2, 0, 0,179, 2, 0, 0,167,
- 1, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 53, 1, 0, 0, 41, 1, 0,128,168, 0, 0,128, 63, 0, 0,128, 63,157,190,215, 49,
-167,170, 4, 52, 0, 0, 0,128,129,116,157,178, 1, 0,128, 63, 33, 69, 15, 51, 0, 0, 0,128, 73,254, 67, 51,243, 97,106, 49,
- 0, 0,128, 63, 0, 0, 0,128, 3, 0, 64, 52,183,164,157, 39, 0, 0,128, 53, 0, 0,128, 63, 1, 0, 0, 0, 0, 4, 0, 0,
- 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
-100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 6, 41,100, 63, 0, 0,128, 63,205,204,204, 62, 6, 41,100, 63,
- 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 4, 0, 0,192, 21, 89, 1,
- 0, 0, 0, 0,104, 0, 0, 0, 1, 0, 0, 0, 80, 26, 89, 1, 0, 0, 0, 0,128, 17, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 35, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,222,149, 47, 63, 52, 70, 58, 63,179, 56, 49,188, 0, 0, 0,128,
- 86,126,162,190,227,251,159, 62, 56, 53,101, 63, 0, 0, 0,128, 7,165, 39, 63,149, 84, 28,191, 50,247,227, 62, 0, 0, 0,128,
-110,101,239, 64,151, 62,208,192, 77,255,170, 64, 0, 0,128, 63, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0,
- 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0,
- 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1,
- 1, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,205, 35, 1, 0, 0, 0, 0, 64, 69, 92, 1, 0, 0, 0, 0, 25, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 0, 26, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 4, 0, 0, 80, 26, 89, 1, 0, 0, 0, 0,104, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 21, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 6, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,123, 38, 63, 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 54,236,148,190, 25,134,116, 63,236, 13, 98,189, 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190,
- 34,194, 26, 63, 0, 0, 0, 0, 37,255, 16, 63,241,161, 95, 62,164,111, 75, 63, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,
-112,236,188, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0,128, 50, 0, 0, 0,179, 0, 0, 0, 0, 1, 0,128, 50, 1, 0,128, 63,
- 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 39, 1, 0, 0, 52,
- 1, 0,128, 39, 0, 0,128, 63, 53,236,148,190,222,102, 69,191, 37,255, 16, 63, 0, 0, 0,128, 24,134,116, 63, 57,174, 76,190,
-240,161, 95, 62, 0, 0, 0,128,235, 13, 98,189, 34,194, 26, 63,166,111, 75, 63, 0, 0, 0,128,208, 19, 13, 63,234, 65,102,190,
- 10, 10,231,192, 0, 0,128, 63, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,
- 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 65, 0, 0,160, 2, 0, 0,144, 30, 89, 1, 0, 0, 0, 0, 39, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,
-116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 3, 0, 0, 0, 0, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63,
- 1, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63,112, 33, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63,205,204, 76, 63,
-205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
-144, 0, 0, 0,112, 33, 89, 1, 0, 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64, 34, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,205,204, 76, 62,
- 0, 0, 0, 0, 84, 69, 0, 0, 48, 1, 0, 0, 64, 34, 89, 1, 0, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 84,101,
-120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 3, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 0, 0,120, 1, 0, 0,176, 35, 89, 1, 0, 0, 0, 0, 51, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 37, 89, 1, 0, 0, 0, 0, 16, 44, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 39, 89, 1, 0, 0, 0, 0,192, 41, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 37, 89, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 24, 0, 0, 0,
- 0, 0, 0, 0, 64, 40, 89, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,144, 42, 89, 1,
- 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180, 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63,
- 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1, 0,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 8, 0, 0, 0,112, 37, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,144, 30, 89, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 64, 1, 0, 0,192, 37, 89, 1, 0, 0, 0, 0, 27, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 39, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0, 64, 39, 89, 1,
- 0, 0, 0, 0, 57, 0, 0, 0, 8, 0, 0, 0, 0, 0,128, 63,255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182, 3,255,
- 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128,191, 0, 0,128,191,230, 73, 26,182, 26,182, 3,255, 0, 0, 0, 0, 1, 0,128,191,
-253,255,127,191, 0, 0,128,191, 26,182, 26,182, 26,182, 3,255, 0, 0, 0, 0,250,255,127,191, 3, 0,128, 63, 0, 0,128,191,
- 26,182,230, 73, 26,182, 3,255, 0, 0, 0, 0, 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,230, 73,230, 73,230, 73, 3,255,
- 0, 0, 0, 0,245,255,127, 63, 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 3,255, 0, 0, 0, 0, 3, 0,128,191,
-250,255,127,191, 0, 0,128, 63, 26,182, 26,182,230, 73, 3,255, 0, 0, 0, 0,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63,
- 26,182,230, 73,230, 73, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 64, 40, 89, 1, 0, 0, 0, 0, 27, 1, 0, 0,
- 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 41, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,144, 0, 0, 0,192, 41, 89, 1, 0, 0, 0, 0, 54, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0,
- 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0,
- 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,
- 5, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0,
- 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0,144, 42, 89, 1, 0, 0, 0, 0, 27, 1, 0, 0,
- 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 44, 89, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0, 16, 44, 89, 1, 0, 0, 0, 0, 53, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0,
- 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 5, 0, 0, 0,
- 6, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2,
- 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 85, 83, 69, 82, 32, 12, 0, 0, 64,218, 34, 1,
- 0, 0, 0, 0,154, 0, 0, 0, 1, 0, 0, 0, 33, 24, 0, 0, 63, 2, 0, 0, 5, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85,115,101,114,115,
- 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98,108,101,110,100,
-101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 48, 52, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 64, 0,
- 5, 0, 2, 0, 0,104, 97,108,107, 98,111, 97,114,100, 46,116,116,102, 0, 55, 46, 53, 46, 48, 45,112,111,119,101,114,112, 99,
- 47, 98,105,110, 47, 98,108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114,
- 99,101,115, 47, 46, 98,102,111,110,116, 46,116,116,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 48, 57, 89, 1, 0, 0, 0, 0,192, 70, 89, 1, 0, 0, 0, 0, 32, 0, 0, 0, 5, 0, 5, 0, 1, 0, 0, 0,
- 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 30, 90,100,191,154,153,153, 62,102,102,102, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62,
- 9, 0, 0, 63,156,153, 25, 63, 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62,205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63,
- 32,133,235, 62,184,243,125, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63,
- 0, 0, 0, 0, 1, 43,135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190,
- 0, 0, 0, 0, 14, 0, 0, 0, 25, 0, 15, 0,120, 0, 0, 0, 60, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0,144, 31, 15, 0,
- 6, 0, 15, 0, 8, 0, 10, 0, 0, 0, 0, 0,100, 0,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,
- 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,
- 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,
- 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 13, 0, 0, 48, 57, 89, 1, 0, 0, 0, 0,152, 0, 0, 0,
- 1, 0, 0, 0,192, 70, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,101,102, 97,117,108,116, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,160,160,255,160,160,160,255,173,160,147,255,
-138,158,161,255,161,161,174,255,161,153,167,255,144,144,144,255,144,144,144,255,198,119,119,255,160,160,160,255, 0, 0, 0,255,
-255,255,255,255,210,210,210,255,218,218,218,255,127,127,127,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,180,180,180,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,255,255,255, 40,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,115,115,115,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,128,128,128,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,
-160,160,160,100,127,112,112,100,160,160,208,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,120,120,120,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,255,255,255,150,
-172,172,172,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-173,173,173,255,127,112,112,100, 0, 0, 0, 0,140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,
-172,172,172,255, 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 57,125, 27,255,125,233, 96,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255,166,166,166,255,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
-228,156,198,255,255,255,170,255, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,
-172,172,172,255, 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
-228,156,198,255,255,255,170,255, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,116,116,116,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255,169, 84,124,255,126,126, 80,255,
-162, 95,111,255,109,145,131,255,255,255,255,128, 53, 53, 53,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 40,200,100,200, 80,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,110,110,110,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,132,132,132,255,
- 94, 94, 94,255,172,172,172,255, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,195,195,195,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-143,143,143,255,198,119,119,255,255, 0, 0,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0,100, 0, 0,255, 0, 0,200,255,128, 0, 80,255,
- 95, 95, 0,255, 0,100, 50,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-173,173,173,255,127,112,112,100, 0, 0, 0, 0,140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,115,115,115,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,
-160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,
- 16, 64, 16,255, 85,187, 85,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255,
-255, 32, 32,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 4, 0, 0,150,150,150,255,129,131,144,255,127,127,127,255,
-142,138,145,255,120,145,120,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,247, 64, 24,255,
-246,105, 19,255,250,153, 0,255, 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0, 10, 54,148,255,
- 54,103,223,255, 94,193,239,255, 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0, 67, 12,120,255,
- 84, 58,163,255,135,100,213,255, 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255, 0, 0, 0, 0, 75,112,124,255,
-106,134,145,255,155,194,205,255, 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255, 0, 0, 0, 0, 30, 32, 36,255,
- 72, 76, 86,255,255,255,255,255, 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255, 0, 0, 0, 0,108,142, 34,255,
-127,176, 34,255,187,239, 91,255, 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255, 0, 0, 0, 0,131, 67, 38,255,
-139, 88, 17,255,189,106, 17,255, 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 13, 0, 0,192, 70, 89, 1,
- 0, 0, 0, 0,152, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 57, 89, 1, 0, 0, 0, 0, 82,111,117,110,
-100,101,100, 0, 0,101,119, 32, 85,115,101,114, 32, 84,104,101,109,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176,176,176,255,107,107,107,255,177,177,177,255,178,178,178,255,143,143,143,255,143,143,143,255,107,107,107,255,198,119,119,255,
-143,143,143,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0,111, 0, 0, 33, 83,255,130, 0,255,255,255,255,255, 0, 0, 0,255,
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,175,175,175, 51,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255, 0, 0, 0, 51,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255,
- 0, 0, 0, 40,255,255,255,255, 16, 64, 16,255,102,255,102,255,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,
-255,255,255,255,230,150, 50,255,255, 32, 32,255, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,
-200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100,255,130, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,107,107,107,150,107,107,107,100,143,143,143,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,130, 0,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255,
-158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,165,165,165,150,107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 57,125, 27,255,125,233, 96,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,143,143,143,255,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,204,255,255,170,204, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-143,143,143,255,165,165,165,150,107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,255,255,255,170,255, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255,
-169, 84,124,255,126,126, 80,255,162, 95,111,255,109,145,131,255, 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0,255,255,255,255,255,
-195,195,195,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-195,195,195,255,165,165,165,150,143,143,143,255,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,255,255,255,255,
-153,153,153,255,165,165,165,150,143,143,143,255,198,119,119,255,255, 0, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,100, 0, 0,255,
- 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255,
-158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255,
- 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,
-144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,
-107,107,107,255, 0, 0, 0, 51,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255,
- 0, 0, 0, 40,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,
-255,255,255,255,230,150, 50,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,
-200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0,150,150,150,255,
-129,131,144,255,127,127,127,255,142,138,145,255,120,145,120,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255,
- 0, 0, 0, 0,247, 64, 24,255,246,105, 19,255,250,153, 0,255, 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255,
- 0, 0, 0, 0, 10, 54,148,255, 54,103,223,255, 94,193,239,255, 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255,
- 0, 0, 0, 0, 67, 12,120,255, 84, 58,163,255,135,100,213,255, 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255,
- 0, 0, 0, 0, 75,112,124,255,106,134,145,255,155,194,205,255, 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255,
- 0, 0, 0, 0, 30, 32, 36,255, 72, 76, 86,255,255,255,255,255, 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255,
- 0, 0, 0, 0,108,142, 34,255,127,176, 34,255,187,239, 91,255, 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255,
- 0, 0, 0, 0,131, 67, 38,255,139, 88, 17,255,189,106, 17,255, 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 78, 65, 49,
-180,160, 0, 0, 16,170,154, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69,211, 8, 0, 0,
- 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116, 97, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120,
- 0,121, 0,122, 0,119, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,112,111,105,110,
-116,101,114, 0,103,114,111,117,112, 0,118, 97,108, 0,112, 97,100, 0,110, 97,109,101, 91, 51, 50, 93, 0,116,121,112,101, 0,
-115,117, 98,116,121,112,101, 0,102,108, 97,103, 0,115, 97,118,101,100, 0,100, 97,116, 97, 0,108,101,110, 0,116,111,116, 97,
-108,108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101, 91, 50, 52, 93, 0,117,115, 0,105, 99,111,
-110, 95,105,100, 0, 42,112,114,111,112,101,114,116,105,101,115, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102,105,
-108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48, 93, 0,102,105,108,101,110, 97,109,101, 91, 50, 52, 48, 93, 0,116,
-111,116, 0, 42,112, 97,114,101,110,116, 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 91, 50, 93, 0,
-112, 97,100, 48, 0,112, 97,100, 49, 0, 42,114,101, 99,116, 91, 50, 93, 0, 99,117,114,118,101, 0, 99,117,114, 0, 98,108,111,
- 99,107,116,121,112,101, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,112,111, 0,112,111,115, 0, 99,117,114,118, 97,
-108, 0, 97,100,114, 99,111,100,101, 0,114,101,108, 97,116,105,118,101, 0,116,111,116,101,108,101,109, 0,112, 97,100, 50, 0,
- 42,119,101,105,103,104,116,115, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,108,
-105,100,101,114,109, 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,109,
-115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,
-114,112,104, 0, 42, 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,111,
-116,115, 99,114,105,112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0, 42,110, 97,109,101,
- 0,102,108, 97,103,115, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0,
- 99,117,114, 99, 0,115,101,108, 99, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,117,110,100,
-111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,115,105,122,101, 0,115,101,101,107, 0,112, 97,115,115,101,112,
- 97,114,116, 97,108,112,104, 97, 0, 97,110,103,108,101, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101,110,100, 0,108,
-101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,115,104,105,102,116,120, 0,
-115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117,114,101, 0, 89, 70,
- 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114,111,116, 0,115, 99,
-114,105,112,116,108,105,110,107, 0, 42,100,111,102, 95,111, 98, 0,102,114, 97,109,101,110,114, 0,102,114, 97,109,101,115, 0,
-111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 99,121, 99,108, 0,111,107, 0,109,117,108,116,
-105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,109,101,110,117,110,114, 0,105, 98,117,102,115, 0,
- 42, 97,110,105,109, 0, 42,114,114, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116,112, 97,103,101,
-102,108, 97,103, 0,116,111,116, 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,
-110,100, 0, 98,105,110,100, 99,111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101,
- 0, 42,112,114,101,118,105,101,119, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101,100, 0, 97,110,
-105,109,115,112,101,101,100, 0,103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112,101, 0, 97,115,112,
-120, 0, 97,115,112,121, 0, 42,118,110,111,100,101, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,
-101,103, 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,117,118,110, 97,109,101,
- 91, 51, 50, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,
-102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108,
- 0,112,109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103, 0,110,111,114,109, 97,112,115,112, 97, 99,101, 0,112, 97,
-100, 91, 51, 93, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0,114,116, 0, 99,111,108,102, 97, 99, 0,110,
-111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0,110, 97,109,
-101, 91, 49, 54, 48, 93, 0, 42,104, 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,
-116,121,112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97,
- 0,100, 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,
-110,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,
-112,111,116,121,112,101, 0, 42,105,109, 97, 0, 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,
-111, 98,105,109, 97,116, 91, 51, 93, 91, 51, 93, 0,115,116,121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,
-108, 97,121, 0, 99,117, 98,101,114,101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,
-101, 0,110,111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,
-115,116, 0,114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95,
- 72, 0,109,103, 95,108, 97, 99,117,110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,
-102,115,101,116, 0,109,103, 95,103, 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115,
- 99, 97,108,101, 0,118,110, 95,119, 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,
-109,101,120,112, 0,118,110, 95,100,105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,
-112,116,104, 0,110,111,105,115,101,116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,
-115,105,115, 50, 0,105,109, 97,102,108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,
-114,111,112,120,109, 97,120, 0, 99,114,111,112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116,
- 0,101,120,116,101,110,100, 0, 99,104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0,
- 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, 42,101,110,118, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93,
- 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,109,105,110, 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0, 42,111, 98, 0,109,111,100,
-101, 0,116,111,116,101,120, 0,101,110,101,114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,
-116, 98,108,101,110,100, 0,104, 97,105,110,116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,
-102,102, 0,102, 97,108,108,111,102,102, 95,116,121,112,101, 0,112, 97,100, 51, 0,115,104, 97,100,115,112,111,116,115,105,122,
-101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0, 98,117,102,102,101,114,115,
- 0,102,105,108,116,101,114,116,121,112,101, 0, 98,117,102,102,108, 97,103, 0, 98,117,102,116,121,112,101, 0,114, 97,121, 95,
-115, 97,109,112, 0,114, 97,121, 95,115, 97,109,112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,
-112, 95,116,121,112,101, 0, 97,114,101, 97, 95,115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97,
- 95,115,105,122,101,121, 0, 97,114,101, 97, 95,115,105,122,101,122, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0,114,
- 97,121, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,
-101,112, 0, 89, 70, 95,110,117,109,112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70,
- 95,112,104,100,101,112,116,104, 0, 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70,
- 95,112, 97,100, 0, 89, 70, 95, 99, 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0,
- 89, 70, 95,103,108,111,119,105,110,116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,103,108,111,119,116,121,112,
-101, 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, 91, 49, 48, 93, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,
-115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,
-109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,
-114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,
-110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,
-114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,
-108,116,101,114, 0,116,120, 95,108,105,109,105,116, 0,116,120, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,
-116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50,
- 0,103,108,111,115,115, 95,109,105,114, 0,103,108,111,115,115, 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,
-109,105,114, 0,115, 97,109,112, 95,103,108,111,115,115, 95,116,114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,
-109,105,114, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115,
- 95,109,105,114, 0,100,105,115,116, 95,109,105,114, 0,102, 97,100,101,116,111, 95,109,105,114, 0,115,104, 97,100,101, 95,102,
-108, 97,103, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, 99, 0,115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,
-110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,
-114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,
-114, 97,110,100, 95,101, 97,115,101, 0,115,116,114, 97,110,100, 95,115,117,114,102,110,111,114, 0,115,116,114, 97,110,100, 95,
-109,105,110, 0,115,116,114, 97,110,100, 95,119,105,100,116,104,102, 97,100,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,
-109,101, 91, 51, 50, 93, 0,115, 98,105, 97,115, 0,108, 98,105, 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,112, 97,
-100,102, 0,114,103, 98,115,101,108, 0,112,114, 95,116,121,112,101, 0,117,115,101, 95,110,111,100,101,115, 0,112,114, 95, 98,
- 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,115,101,112,116,101,120, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,
-115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,
-114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95,
- 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110,
- 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,
-101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99,
- 95,115,112,101, 99, 0, 42,110,111,100,101,116,114,101,101, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,
-102,104, 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,
-100,101, 0,115,115,115, 95,114, 97,100,105,117,115, 91, 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,
-101,114,114,111,114, 0,115,115,115, 95,115, 99, 97,108,101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102,
- 97, 99, 0,115,115,115, 95,116,101,120,102, 97, 99, 0,115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107,
- 0,115,115,115, 95,102,108, 97,103, 0,115,115,115, 95,112,114,101,115,101,116, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103,
- 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100,115, 99, 97,108,101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112,
- 0, 89, 70, 95,112,114,101,115,101,116, 0, 89, 70, 95,100,106,105,116, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99, 97,
-108,101, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49, 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49,
- 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,
-114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112,
- 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,
-101, 0,116,104,114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,114,
- 97,100,105,117,115, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93,
- 0,109, 97,116, 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,
-118, 0,111,114,100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,
-116,115,117, 0, 42,107,110,111,116,115,118, 0, 42, 98,112, 0, 42, 98,101,122,116, 0,116,105,108,116, 95,105,110,116,101,114,
-112, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116,
- 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0,
- 98,101,118, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,
-101,120,116, 50, 0,114,101,115,111,108,117, 95,114,101,110, 0,114,101,115,111,108,118, 95,114,101,110, 0,115,112, 97, 99,101,
-109,111,100,101, 0,115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,
-101, 0,119,111,114,100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,
-111,102, 0,108,105,110,101,119,105,100,116,104, 0, 42,115,116,114, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,
-111,110,116, 0, 42,118,102,111,110,116, 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112,
- 99,104, 97,114, 0,116,111,116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,
-115,101,108,101,110,100, 0, 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0,110, 97,109,101, 91, 49, 50, 56,
- 93, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,
-105,112,111, 0,101,120,116,114, 97,112, 0, 98,105,116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0,115,108,105,
-100,101, 95,109, 97,120, 0, 42,100,114,105,118,101,114, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,109,116,
-102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116,
- 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,109,115,101,108,
-101, 99,116, 0,118,100, 97,116, 97, 0,101,100, 97,116, 97, 0,102,100, 97,116, 97, 0,116,111,116,101,100,103,101, 0,116,111,
-116,102, 97, 99,101, 0,116,111,116,115,101,108,101, 99,116, 0, 97, 99,116, 95,102, 97, 99,101, 0, 99,117, 98,101,109, 97,112,
-115,105,122,101, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,114, 0,115,
-117, 98,115,117,114,102,116,121,112,101, 0, 42,109,114, 0, 42,112,118, 0, 42,116,112, 97,103,101, 0,117,118, 91, 52, 93, 91,
- 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0,118, 49, 0,
-118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0, 98,119,101,105,103,104,116, 0,100,
-101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0,
- 99,111, 91, 50, 93, 0,105,110,100,101,120, 0,102, 0,105, 0,115, 91, 50, 53, 54, 93, 0,118, 91, 52, 93, 0,109,105,100, 0,
-112, 97,100, 91, 50, 93, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,102, 97, 99,101,115, 0, 42,101,100,
-103,101,115, 0, 42,101,100,103,101, 95, 98,111,117,110,100, 97,114,121, 95,115,116, 97,116,101,115, 0, 42,118,101,114,116, 95,
-101,100,103,101, 95,109, 97,112, 0, 42,118,101,114,116, 95,102, 97, 99,101, 95,109, 97,112, 0, 42,109, 97,112, 95,109,101,109,
- 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,111,117,110,116, 0, 99,117,114,114,101,
-110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,118,108, 0,114,101,110,100,101,114,108,
-118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115, 0, 42,101,100,103,101, 95, 99,114,101,
- 97,115,101,115, 0, 42,118,101,114,116, 95,109, 97,112, 0, 42,101,100,103,101, 95,109, 97,112, 0, 42,111,108,100, 95,102, 97,
- 99,101,115, 0, 42,111,108,100, 95,101,100,103,101,115, 0, 42,101,114,114,111,114, 0,109,111,100,105,102,105,101,114, 0,115,
-117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,101,109, 67, 97, 99,104,101, 0,
- 42,109, 67, 97, 99,104,101, 0,100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54, 93, 0,115,116, 97,114,116, 0,108,101,110,
-103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 42,115,116, 97,114,116, 95, 99, 97,112, 0, 42,101,
-110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,102,102,115,101,116, 95,111, 98, 0,111,102,102,115,
-101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,101, 95,100,105,115,116, 0,102,105,116, 95,116,121,
-112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110,116, 0, 97,120,105,115, 0,116,111,108,101,114, 97,
-110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105,116, 95, 97,110,103,108,101, 0,118, 97,108,117,101,
- 0,114,101,115, 0,118, 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,102,108, 97,103,115, 0,101, 95,102,108, 97,103,115,
- 0, 98,101,118,101,108, 95, 97,110,103,108,101, 0,100,101,102,103,114,112, 95,110, 97,109,101, 91, 51, 50, 93, 0, 42,116,101,
-120,116,117,114,101, 0,115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116,105,111,110, 0,109,105,100,108,101,118,101,
-108, 0,116,101,120,109, 97,112,112,105,110,103, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,118,108, 97,121,101,114,
- 95,110, 97,109,101, 91, 51, 50, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0, 42,112,114,111,106,101, 99,116,111,114,
-115, 91, 49, 48, 93, 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,115, 0, 97,115,112,101,
- 99,116,120, 0, 97,115,112,101, 99,116,121, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,102, 97,
- 99, 0,114,101,112,101, 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,110,116,101,114, 0,115,116, 97,114,116,120, 0,115,116,
- 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112, 0,116,105,
-109,101,111,102,102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108,116,105,
- 0, 42,112,114,101,118, 67,111,115, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, 91, 51,
- 93, 0,102, 97,108,108,111,102,102, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,
-101, 0, 42, 99,108,111,116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97,114,109,115, 0, 42, 99,111,108,108, 95,
-112, 97,114,109,115, 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0, 42,120, 0, 42,120,110,101,119, 0, 42,120,111,108,
-100, 0, 42, 99,117,114,114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,101,110,116, 95,120, 0, 42, 99,117,114,114,
-101,110,116, 95,118, 0, 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,115, 0,110,117,109,102, 97, 99,101,115, 0,
-116,105,109,101, 0, 42, 98,118,104, 0,111,112,101,114, 97,116,105,111,110, 0,118,101,114,116,101,120, 0,116,111,116,105,110,
-102,108,117,101,110, 99,101, 0,103,114,105,100,115,105,122,101, 0,110,101,101,100, 98,105,110,100, 0, 42, 98,105,110,100,119,
-101,105,103,104,116,115, 0, 42, 98,105,110,100, 99,111,115, 0,116,111,116, 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,
-103,114,105,100, 0, 42,100,121,110,105,110,102,108,117,101,110, 99,101,115, 0, 42,100,121,110,118,101,114,116,115, 0, 42,112,
- 97,100, 50, 0,100,121,110,103,114,105,100,115,105,122,101, 0,100,121,110, 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,
-110, 99,101,108,108,119,105,100,116,104, 0, 98,105,110,100,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,112,115,121,115, 0, 42,
-100,109, 0,116,111,116,100,109,118,101,114,116, 0,116,111,116,100,109,101,100,103,101, 0,116,111,116,100,109,102, 97, 99,101,
- 0,112,115,121,115, 0,114,116, 91, 50, 93, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101,
- 99,116, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,
-112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,
-119, 0, 42,100,101,102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,
-114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 51, 50, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,
-111,120,121, 0, 42,112,114,111,120,121, 95,103,114,111,117,112, 0, 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,
-116,105,111,110, 0, 42,112,111,115,101,108,105, 98, 0, 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104,
- 97,110,110,101,108,115, 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51, 93,
- 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,111, 98,109, 97,116, 91,
- 52, 93, 91, 52, 93, 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,108, 97,121, 0, 99,111,108, 98,105,116,115,
- 0,116,114, 97,110,115,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,
-108, 97,103, 0,110,108, 97,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,105,112,111,119,105,110, 0,115,
- 99, 97,102,108, 97,103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121,112,101, 0,100,117,112,111,
-110, 0,100,117,112,111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, 0, 99,116,105,109,101, 0,
-109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,
-114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,101,
-109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,112, 97,100, 49, 91, 51, 93, 0,101,109,112,116,121, 95,100,114, 97,119,
-115,105,122,101, 0,100,117,112,102, 97, 99,101,115, 99, 97, 0,112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,
-116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114,115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,
-100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, 50, 0,115,111,102,116,102,108, 97,103, 0,
- 97,110,105,115,111,116,114,111,112,105, 99, 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,
-116,115, 0,110,108, 97,115,116,114,105,112,115, 0,104,111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,101,
-109, 0, 42,112,100, 0, 42,115,111,102,116, 0, 42,100,117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,
-108, 97,103, 0,114,101,115,116,114,105, 99,116,102,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108,
- 97,103, 0,114,101, 99, 97,108, 99,111, 0,112, 97,100, 52, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,
-115, 0, 42,100,101,114,105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108,
- 97,115,116, 68, 97,116, 97, 77, 97,115,107, 0, 99,117,114,105,110,100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,
-101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,112,100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100,
- 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,112,100,101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,
-114,105, 99,116, 0,102, 95,115,116,114,101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,102, 95,100,105,115,116, 0,102,
- 95,100, 97,109,112, 0,109, 97,120,100,105,115,116, 0,109,105,110,100,105,115,116, 0,109, 97,120,114, 97,100, 0,109,105,110,
-114, 97,100, 0,102, 95,112,111,119,101,114, 95,114, 0,112,100,101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115,
- 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0, 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,
-112,111,119, 0,107,105,110,107, 95,102,114,101,113, 0,107,105,110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,
-112, 0,102,114,101,101, 95,101,110,100, 0,116,101,120, 95,110, 97, 98,108, 97, 0,116,101,120, 95,109,111,100,101, 0,107,105,
-110,107, 0,107,105,110,107, 95, 97,120,105,115, 0,114,116, 50, 0,115,105,109,102,114, 97,109,101, 0,115,116, 97,114,116,102,
-114, 97,109,101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114, 97,109,101, 0, 42,112, 97,114,116,105, 99,108,
-101,115, 0,116,111,116,112,111,105,110,116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,
-115,112,114,105,110,103, 0,110,111,100,101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,
-114,107,108,105,109,105,116, 0,112,104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103,
- 0,103,111, 97,108,102,114,105, 99,116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111,
- 97,108, 0,118,101,114,116,103,114,111,117,112, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103, 0,
-105,110,102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,118,
-101,114,102,108, 97,103,115, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,110,
-100,115,112,114,105,110,103, 0, 99,111,108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,105,
-102,102, 0,115, 98, 99, 95,109,111,100,101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, 97,
-120,108,111,111,112,115, 0, 99,104,111,107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0,115,
-112,114,105,110,103,112,114,101,108,111, 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102,102,
- 0,105,110,112,117,115,104, 0, 42,112,111,105,110,116, 99, 97, 99,104,101, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,101,
-100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,101,
-115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,110,
-100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,105,
-115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,114,
- 97,118,120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,
-100, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,
-121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, 0,
- 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97,114,
-116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, 78,
-111,118,101, 99,103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, 86,
- 97,108,117,101, 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97,114,
-116,105, 99,108,101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, 83,
-117, 98,100,105,118,115, 0,117,110,117,115,101,100, 68, 78, 65, 68,117,109,109,121, 0,112, 97,114,116,105, 99,108,101, 73,110,
-102, 83,105,122,101, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,
-105,122,101, 0, 42,109,101,115,104, 83,117,114,102, 78,111,114,109, 97,108,115, 0,109,105,115,116,121,112,101, 0,104,111,114,
-114, 0,104,111,114,103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,
-122,101,110,107, 0, 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114,
- 97,110,103,101, 0,108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,
-105,116,121, 66,111,120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,
-110,101, 0,109,105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,
-115,116, 97,114,114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101,
- 0,115,116, 97,114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,
-115,101, 0,100,111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,
-111,100,105,115,116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0,
- 97,111,109,111,100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 97,111, 95, 97,
-100, 97,112,116, 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115,112,101,101,100, 95,102, 97, 99, 0, 97,
-111, 95, 97,112,112,114,111,120, 95,101,114,114,111,114, 0, 97,111, 95, 97,112,112,114,111,120, 95, 99,111,114,114,101, 99,116,
-105,111,110, 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, 97,111, 95,103, 97,116,104,101,114, 95,109,101,116,
-104,111,100, 0, 97,111, 95, 97,112,112,114,111,120, 95,112, 97,115,115,101,115, 0, 42, 97,111,115,112,104,101,114,101, 0, 42,
- 97,111,116, 97, 98,108,101,115, 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116,121,112,
-101, 0,115,117, 98,115,104,111,111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0,109, 97,
-120,115,117, 98,108, 97,109,112, 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, 97,120,
-110,111,100,101, 0, 99,111,110,118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0,115,101,
-108, 99,111,108, 0,115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98,
- 70,111,114,109, 97,116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,
-114, 0,100,119, 75,101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,
-116,101,115, 80,101,114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,
-101, 69,118,101,114,121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,
-115, 0, 42,112, 97,100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 99,
-111,100,101, 99, 0, 97,117,100,105,111, 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, 0, 97,
-117,100,105,111, 95, 98,105,116,114, 97,116,101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105,110, 95,114, 97,116,
-101, 0,114, 99, 95,109, 97,120, 95,114, 97,116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122,101, 0,109,117,120,
- 95,112, 97, 99,107,101,116, 95,115,105,122,101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97,116,101, 0,109, 97,
-105,110, 0, 42,109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105,100,101,
- 0,108, 97,121, 95,122,109, 97,115,107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97,115,115,
- 95,120,111,114, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, 97, 0,
-102,102, 99,111,100,101, 99,100, 97,116, 97, 0, 99,102,114, 97, 0,112,115,102,114, 97, 0,112,101,102,114, 97, 0,105,109, 97,
-103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,101,110, 0, 98,108,
-117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,108,115, 99,114,101,
-101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,114,105, 98, 0,114,
-116, 49, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115,112,114,101,115,101,116, 0,109,
- 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,115,
- 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112,101, 0,115,117, 98,105,109,116,121,112,101, 0,
-113,117, 97,108,105,116,121, 0,114,112, 97,100, 0,114,112, 97,100, 49, 0,114,112, 97,100, 50, 0,115, 99,101,109,111,100,101,
- 0,114,101,110,100,101,114,101,114, 0,111, 99,114,101,115, 0, 97,108,112,104, 97,109,111,100,101, 0,111,115, 97, 0,102,114,
-115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,100,105,115,112,
-114,101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,120, 97,115,112, 0,121, 97,115,112, 0,102,114,115,
- 95,115,101, 99, 95, 98, 97,115,101, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0,112,111,115,116,103, 97,109,109,
- 97, 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,
-116,121, 0, 98, 97,107,101, 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, 0, 98, 97,107,101, 95,109,111,100,
-101, 0, 98, 97,107,101, 95,102,108, 97,103, 0, 98, 97,107,101, 95,110,111,114,109, 97,108, 95,115,112, 97, 99,101, 0, 98,112,
- 97,100, 0, 98, 97,107,101, 95,109, 97,120,100,105,115,116, 0, 98, 97,107,101, 95, 98,105, 97,115,100,105,115,116, 0, 98, 97,
-107,101, 95,112, 97,100, 0, 71, 73,113,117, 97,108,105,116,121, 0, 71, 73, 99, 97, 99,104,101, 0, 71, 73,109,101,116,104,111,
-100, 0, 71, 73,112,104,111,116,111,110,115, 0, 71, 73,100,105,114,101, 99,116, 0, 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,
-111,114,116,120,109,108, 0, 89, 70, 95,110,111, 98,117,109,112, 0, 89, 70, 95, 99,108, 97,109,112,114,103, 98, 0,121,102,112,
- 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, 71, 73, 99, 97,117,115,100,101,112,116,104, 0, 71, 73,112,105,120,101,108,115,
-112,101,114,115, 97,109,112,108,101, 0, 71, 73,112,104,111,116,111,110, 99,111,117,110,116, 0, 71, 73,109,105,120,112,104,111,
-116,111,110,115, 0, 71, 73,112,104,111,116,111,110,114, 97,100,105,117,115, 0, 89, 70, 95,114, 97,121,100,101,112,116,104, 0,
- 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108,101,115, 0,121,102,112, 97,100, 50, 0,
- 71, 73,115,104, 97,100,111,119,113,117, 97,108,105,116,121, 0, 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,
-111,119,101,114, 0, 71, 73,105,110,100,105,114,112,111,119,101,114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,
-112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101,
- 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111,108,100, 0, 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99,
- 91, 49, 54, 48, 93, 0,115,116, 97,109,112, 0,115,116, 97,109,112, 95,102,111,110,116, 95,105,100, 0,115,116, 97,109,112, 95,
-117,100, 97,116, 97, 91, 49, 54, 48, 93, 0,102,103, 95,115,116, 97,109,112, 91, 52, 93, 0, 98,103, 95,115,116, 97,109,112, 91,
- 52, 93, 0,115,105,109,112,108,105,102,121, 95,115,117, 98,115,117,114,102, 0,115,105,109,112,108,105,102,121, 95,115,104, 97,
-100,111,119,115, 97,109,112,108,101,115, 0,115,105,109,112,108,105,102,121, 95,112, 97,114,116,105, 99,108,101,115, 0,115,105,
-109,112,108,105,102,121, 95, 97,111,115,115,115, 0, 99,105,110,101,111,110,119,104,105,116,101, 0, 99,105,110,101,111,110, 98,
-108, 97, 99,107, 0, 99,105,110,101,111,110,103, 97,109,109, 97, 0,112, 97,114,116,105, 99,108,101, 95,112,101,114, 99, 0,115,
-117, 98,115,117,114,102, 95,109, 97,120, 0,115,104, 97,100, 98,117,102,115, 97,109,112,108,101, 95,109, 97,120, 0, 97,111, 95,
-101,114,114,111,114, 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97,109,101, 91, 54, 52, 93, 0, 42, 98,114,117,
-115,104, 0,116,111,111,108, 0,115,116,101,112, 0,105,110,118,101,114,116, 0,116,111,116,114,101,107,101,121, 0,116,111,116,
- 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112,101, 0, 98,114,117,115,104, 91, 55, 93, 0,101,109,105,116,116,101,
-114,100,105,115,116, 0,100,114, 97,119, 95,116,105,109,101,100, 0,110, 97,109,101, 91, 51, 54, 93, 0,109, 97,116, 91, 51, 93,
- 91, 51, 93, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,106,111,105,110,116,
-114,105,108,105,109,105,116, 0,100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, 95,111,102,102,115, 0,100,111,117, 98,
-108,105,109,105,116, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115, 0,117,110,
-119,114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118, 99, 97,108, 99, 95, 99,117, 98,
-101,115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,112,100,105,114, 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,
-105,103,110, 0,117,118, 99, 97,108, 99, 95,102,108, 97,103, 0, 97,117,116,111,105,107, 95, 99,104, 97,105,110,108,101,110, 0,
-105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,108,101, 0,115,101,108,101, 99,116, 95,116,104,114,101,115,104, 0,
- 99,108,101, 97,110, 95,116,104,114,101,115,104, 0,114,101,116,111,112,111, 95,109,111,100,101, 0,114,101,116,111,112,111, 95,
-112, 97,105,110,116, 95,116,111,111,108, 0,108,105,110,101, 95,100,105,118, 0,101,108,108,105,112,115,101, 95,100,105,118, 0,
-114,101,116,111,112,111, 95,104,111,116,115,112,111,116, 0,109,117,108,116,105,114,101,115, 95,115,117, 98,100,105,118, 95,116,
-121,112,101, 0,115,107,103,101,110, 95,114,101,115,111,108,117,116,105,111,110, 0,115,107,103,101,110, 95,116,104,114,101,115,
-104,111,108,100, 95,105,110,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100, 95,101,120,
-116,101,114,110, 97,108, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,114, 97,116,105,111, 0,115,107,103,101,110, 95,
-108,101,110,103,116,104, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 97,110,103,108,101, 95,108,105,109,105,116, 0,115,
-107,103,101,110, 95, 99,111,114,114,101,108, 97,116,105,111,110, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,115,121,109,
-109,101,116,114,121, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,
-112,111,115,116,112,114,111, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 95,112, 97,115,115,101,115, 0,115,107,103,
-101,110, 95,115,117, 98,100,105,118,105,115,105,111,110,115, 91, 51, 93, 0,112, 97,100, 51, 91, 53, 93, 0,100,105,114, 0,118,
-105,101,119, 0, 42,115,101,115,115,105,111,110, 0, 42, 99,117,109, 97,112, 0,100,114, 97,119, 98,114,117,115,104, 0,115,109,
-111,111,116,104, 98,114,117,115,104, 0,112,105,110, 99,104, 98,114,117,115,104, 0,105,110,102,108, 97,116,101, 98,114,117,115,
-104, 0,103,114, 97, 98, 98,114,117,115,104, 0,108, 97,121,101,114, 98,114,117,115,104, 0,102,108, 97,116,116,101,110, 98,114,
-117,115,104, 0,112,105,118,111,116, 91, 51, 93, 0, 98,114,117,115,104, 95,116,121,112,101, 0,116,101,120,110,114, 0,116,101,
-120,114,101,112,116, 0,116,101,120,102, 97,100,101, 0,116,101,120,115,101,112, 0, 97,118,101,114, 97,103,105,110,103, 0,116,
- 97, 98,108,101,116, 95,115,105,122,101, 0,116, 97, 98,108,101,116, 95,115,116,114,101,110,103,116,104, 0,115,121,109,109, 0,
-114, 97,107,101, 0, 97,120,105,115,108,111, 99,107, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, 0, 42,115,101,
-116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,116, 91,
- 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,101,100,105,116, 98,117,116,115,105,122,101,
- 0,115,101,108,101, 99,116,109,111,100,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,
-100,101, 0, 97,117,116,111,109,101,114,103,101, 0,112, 97,100, 53, 0,112, 97,100, 54, 0,112, 97,100, 55, 0, 42,101,100, 0,
- 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103, 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 97,117,100,
-105,111, 0,109, 97,114,107,101,114,115, 0,116,114, 97,110,115,102,111,114,109, 95,115,112, 97, 99,101,115, 0,106,117,109,112,
-102,114, 97,109,101, 0,115,110, 97,112, 95,102,108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,101,116, 0, 42,116,104,101,
- 68, 97,103, 0,100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0,115, 99,117,108,112,116,100, 97,
-116, 97, 0,122,111,111,109, 0, 98,108,101,110,100, 0,120,105,109, 0,121,105,109, 0,115,112, 97, 99,101,116,121,112,101, 0,
- 98,108,111, 99,107,115, 99, 97,108,101, 0, 42, 97,114,101, 97, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93,
- 0,118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,
-115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49,
- 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52,
- 93, 0,122,102, 97, 99, 0,112,101,114,115,112, 0, 42,111, 98, 95, 99,101,110,116,114,101, 0, 42, 98,103,112,105, 99, 0, 42,
-108,111, 99, 97,108,118,100, 0, 42,114,105, 0, 42,114,101,116,111,112,111, 95,118,105,101,119, 95,100, 97,116, 97, 0, 42,100,
-101,112,116,104,115, 0,111, 98, 95, 99,101,110,116,114,101, 95, 98,111,110,101, 91, 51, 50, 93, 0,108,111, 99, 97,108,118,105,
-101,119, 0,108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0, 99, 97,109,122,111,
-111,109, 0,112,105,118,111,116, 95,108, 97,115,116, 0,103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112,105,120,115,
-105,122,101, 0,110,101, 97,114, 0,102, 97,114, 0, 99, 97,109,100,120, 0, 99, 97,109,100,121, 0,103,114,105,100,108,105,110,
-101,115, 0,118,105,101,119, 98,117,116, 0,103,114,105,100,102,108, 97,103, 0,109,111,100,101,115,101,108,101, 99,116, 0,116,
-119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97,103, 0,116,119,100,114, 97,119,102,108, 97,103, 0,116,
-119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108,105,112, 91, 52, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 97,102,
-116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0,102,108, 97,103, 50, 0,103,114,105,100,115,117, 98,100,
-105,118, 0,110,100,111,102,109,111,100,101, 0,110,100,111,102,102,105,108,116,101,114, 0, 42,112,114,111,112,101,114,116,105,
-101,115, 95,115,116,111,114, 97,103,101, 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,
-109, 97,120, 91, 50, 93, 0,109,105,110,122,111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,107,101,
-101,112,116,111,116, 0,107,101,101,112, 97,115,112,101, 99,116, 0,107,101,101,112,122,111,111,109, 0,111,108,100,119,105,110,
-120, 0,111,108,100,119,105,110,121, 0, 99,117,114,115,111,114, 91, 50, 93, 0,114,111,119, 98,117,116, 0,118, 50,100, 0, 42,
-101,100,105,116,105,112,111, 0,105,112,111,107,101,121, 0, 97, 99,116,110, 97,109,101, 91, 51, 50, 93, 0, 99,111,110,115,116,
-110, 97,109,101, 91, 51, 50, 93, 0, 98,111,110,101,110, 97,109,101, 91, 51, 50, 93, 0,116,111,116,105,112,111, 0,112,105,110,
- 0, 98,117,116,111,102,115, 0, 99,104, 97,110,110,101,108, 0,108,111, 99,107, 0,109,101,100,105, 97,110, 91, 51, 93, 0, 99,
-117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0, 97,108,105,103,110, 0,116, 97, 98,111, 0,109, 97,105,110, 98, 0,109,
- 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120,102,114,111,109, 0,115,104,111,119,103,114,111,117,
-112, 0,109,111,100,101,108,116,121,112,101, 0,115, 99,114,105,112,116, 98,108,111, 99,107, 0,114,101, 95, 97,108,105,103,110,
- 0,111,108,100,107,101,121,112,114,101,115,115, 0,116, 97, 98, 91, 55, 93, 0, 99,104, 97,110,115,104,111,119,110, 0,122,101,
- 98,114, 97, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,108,101, 0,116,105,116,108,101, 91, 50, 52, 93, 0,
-100,105,114, 91, 50, 52, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,102,115, 0,115,111,114,116, 0,109, 97,120,110, 97,
-109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0,102, 95,102,112, 0,102,112, 95,115,116,114, 91, 56, 93, 0, 42,108,105,
- 98,102,105,108,101,100, 97,116, 97, 0,114,101,116,118, 97,108, 0,109,101,110,117, 0, 97, 99,116, 0, 40, 42,114,101,116,117,
-114,110,102,117,110, 99, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95,101,118,101,110,116, 41, 40, 41, 0,
- 40, 42,114,101,116,117,114,110,102,117,110, 99, 95, 97,114,103,115, 41, 40, 41, 0, 42, 97,114,103, 49, 0, 42, 97,114,103, 50,
- 0, 42,109,101,110,117,112, 0, 42,112,117,112,109,101,110,117, 0,111,111,112,115, 0,118,105,115,105,102,108, 97,103, 0,116,
-114,101,101, 0, 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97,114, 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93,
- 0,115,101, 97,114, 99,104, 95,116,115,101, 0,115,101, 97,114, 99,104, 95,102,108, 97,103,115, 0,100,111, 95, 0,111,117,116,
-108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,101,112,115, 95,102,108, 97,103,115, 0,105,109, 97,
-110,114, 0, 99,117,114,116,105,108,101, 0,105,109,116,121,112,101,110,114, 0,100,116, 95,117,118, 0,115,116,105, 99,107,121,
- 0,100,116, 95,117,118,115,116,114,101,116, 99,104, 0,112, 97,100, 91, 53, 93, 0, 99,101,110,116,120, 0, 99,101,110,116,121,
- 0, 97,117,116,111,115,110, 97,112, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115, 0,102,111,
-110,116, 95,105,100, 0,108,104,101,105,103,104,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116,
- 97, 98,110,117,109, 98,101,114, 0, 99,117,114,114,116, 97, 98, 95,115,101,116, 0,115,104,111,119,115,121,110,116, 97,120, 0,
-117,110,117,115,101,100, 95,112, 97,100,100, 0,112,105,120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,
-108,108, 0,116,120,116, 98, 97,114, 0, 42,112,121, 95,100,114, 97,119, 0, 42,112,121, 95,101,118,101,110,116, 0, 42,112,121,
- 95, 98,117,116,116,111,110, 0, 42,112,121, 95, 98,114,111,119,115,101,114, 99, 97,108,108, 98, 97, 99,107, 0, 42,112,121, 95,
-103,108,111, 98, 97,108,100,105, 99,116, 0,108, 97,115,116,115,112, 97, 99,101, 0,115, 99,114,105,112,116,110, 97,109,101, 91,
- 50, 53, 54, 93, 0,115, 99,114,105,112,116, 97,114,103, 91, 50, 53, 54, 93, 0, 42,115, 99,114,105,112,116, 0, 42, 98,117,116,
- 95,114,101,102,115, 0,114,101,100,114, 97,119,115, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0, 42, 99,117,114,102,111,110,
-116, 0, 42,101,100,105,116,116,114,101,101, 0,116,114,101,101,116,121,112,101, 0, 42,102,105,108,101,115, 0, 97, 99,116,105,
-118,101, 95,102,105,108,101, 0,110,117,109,116,105,108,101,115,120, 0,110,117,109,116,105,108,101,115,121, 0,115,101,108,115,
-116, 97,116,101, 0,118,105,101,119,114,101, 99,116, 0, 98,111,111,107,109, 97,114,107,114,101, 99,116, 0,115, 99,114,111,108,
-108,112,111,115, 0,115, 99,114,111,108,108,104,101,105,103,104,116, 0,115, 99,114,111,108,108, 97,114,101, 97, 0, 97, 99,116,
-105,118,101, 95, 98,111,111,107,109, 97,114,107, 0,112,114,118, 95,119, 0,112,114,118, 95,104, 0, 42,105,109,103, 0,111,117,
-116,108,105,110,101, 91, 52, 93, 0,110,101,117,116,114, 97,108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101,
-116,116,105,110,103, 91, 52, 93, 0,115,101,116,116,105,110,103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93,
- 0,110,117,109, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104,
-105, 91, 52, 93, 0,112,111,112,117,112, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93,
- 0,109,101,110,117, 95, 98, 97, 99,107, 91, 52, 93, 0,109,101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95,
-104,105,108,105,116,101, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116,
- 95,104,105, 91, 52, 93, 0, 98,117,116, 95,100,114, 97,119,116,121,112,101, 0,105, 99,111,110,102,105,108,101, 91, 56, 48, 93,
- 0, 98, 97, 99,107, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,
-101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,103,114,105,100, 91, 52,
- 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,
-118,101, 91, 52, 93, 0,103,114,111,117,112, 91, 52, 93, 0,103,114,111,117,112, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,
-114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,101,108,
-101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,
-103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,115,104, 97,114,112, 91, 52, 93, 0,101,100,103,101, 95,102, 97,
- 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,
-102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100,
- 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,
-115,101,108,101, 99,116, 91, 52, 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0,118,101,114,116,101,
-120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115,121,110,116,
- 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,115,121,110,
-116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, 93, 0,105,109, 97,103,
-101, 91, 52, 93, 0,115, 99,101,110,101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99,116, 91, 52, 93,
- 0,112,108,117,103,105,110, 91, 52, 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, 97, 91, 52, 93,
- 0,101,100,105,116,109,101,115,104, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,115,111,108,105,100, 91, 52, 93, 0,116,117,105,
- 0,116, 98,117,116,115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116,115,110,
-100, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97,115,101,108, 0,116,101,
-120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116, 97,114,109, 91, 50, 48, 93, 0, 98,112,
- 97,100, 91, 52, 93, 0, 98,112, 97,100, 49, 91, 52, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115,
- 97,118,101,116,105,109,101, 0,116,101,109,112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48,
- 93, 0,114,101,110,100,101,114,100,105,114, 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,
-108,117,103,116,101,120,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,
-121,116,104,111,110,100,105,114, 91, 49, 54, 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,
-112,111,114,116,100,105,114, 91, 49, 54, 48, 93, 0,118,101,114,115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103,
- 97,109,101,102,108, 97,103,115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,
-108, 97,110,103,117, 97,103,101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,
-108,101, 95, 98,117,102,102,101,114, 0, 99,111,110,115,111,108,101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101,
- 0,102,111,110,116,115,105,122,101, 0,101,110, 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,
-117,116,104,114,101,115,104,111,108,100, 49, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110,
- 97,109,101, 91, 50, 53, 54, 93, 0,116,104,101,109,101,115, 0,117,110,100,111,115,116,101,112,115, 0, 99,117,114,115,115,105,
-122,101, 0,116, 98, 95,108,101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,
-103,104,116, 91, 51, 93, 0,116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,
-100,108,101,115,105,122,101, 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,
-108,108,101, 99,116,114, 97,116,101, 0,109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101,102,101,116, 99,104,
-102,114, 97,109,101,115, 0,102,114, 97,109,101,115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95,114,111,116, 95, 97,
-110,103,108,101, 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114,118,105, 98,114,105,
-103,104,116, 0,114,101, 99,101,110,116, 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101,119,116,120, 0,103,
-108,114,101,115,108,105,109,105,116, 0,110,100,111,102, 95,112, 97,110, 0,110,100,111,102, 95,114,111,116, 97,116,101, 0,112,
- 97,100,115, 91, 50, 93, 0,112, 97,100, 91, 56, 93, 0,118,101,114,115,101,109, 97,115,116,101,114, 91, 49, 54, 48, 93, 0,118,
-101,114,115,101,117,115,101,114, 91, 49, 54, 48, 93, 0,103,108, 97,108,112,104, 97, 99,108,105,112, 0, 97,117,116,111,107,101,
-121, 95,109,111,100,101, 0, 97,117,116,111,107,101,121, 95,102,108, 97,103, 0, 99,111, 98, 97, 95,119,101,105,103,104,116, 0,
-118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,115, 99,101,110,
-101, 0,101,110,100,120, 0,101,110,100,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,115, 99,101,110,101,110,114, 0,
-115, 99,114,101,101,110,110,114, 0,102,117,108,108, 0,109, 97,105,110,119,105,110, 0,119,105,110, 97,107,116, 0,104, 97,110,
-100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118, 50, 0,112, 97,110,101,108,110,
- 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109,101, 91, 54, 52, 93,
- 0,111,102,115,120, 0,111,102,115,121, 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,111,108,100, 95,111,102,115,120,
- 0,111,108,100, 95,111,102,115,121, 0,115,111,114,116, 99,111,117,110,116,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0,
- 42,118, 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,104,101, 97,100,114,
- 99,116, 0,119,105,110,114, 99,116, 0,104,101, 97,100,119,105,110, 0,119,105,110, 0,104,101, 97,100,101,114,116,121,112,101,
- 0, 98,117,116,115,112, 97, 99,101,116,121,112,101, 0,119,105,110,120, 0,119,105,110,121, 0,104,101, 97,100, 95,115,119, 97,
-112, 0,104,101, 97,100, 95,101,113,117, 97,108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,110, 95,101,113,117, 97,108, 0,
-104,101, 97,100, 98,117,116,108,101,110, 0,104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,114,115,111,114, 0,115,112, 97,
- 99,101,100, 97,116, 97, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0,115,117, 98,118,115,116,114, 91, 52,
- 93, 0,115,117, 98,118,101,114,115,105,111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,115,105,111,110, 0,109,105,110,
-115,117, 98,118,101,114,115,105,111,110, 0,100,105,115,112,108, 97,121,109,111,100,101, 0, 42, 99,117,114,115, 99,114,101,101,
-110, 0, 42, 99,117,114,115, 99,101,110,101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,111, 98, 97,108,102, 0,110, 97,
-109,101, 91, 56, 48, 93, 0, 42,105, 98,117,102, 0, 42,105, 98,117,102, 95, 99,111,109,112, 0, 42,115,101, 49, 0, 42,115,101,
- 50, 0, 42,115,101, 51, 0,110,114, 0, 98,111,116,116,111,109, 0,114,105,103,104,116, 0,120,111,102,115, 0,121,111,102,115,
- 0,108,105,102,116, 91, 51, 93, 0,103, 97,109,109, 97, 91, 51, 93, 0,103, 97,105,110, 91, 51, 93, 0,115, 97,116,117,114, 97,
-116,105,111,110, 0,100,105,114, 91, 49, 54, 48, 93, 0,100,111,110,101, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110,
-100,115,116,105,108,108, 0, 42,115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42, 99,114,111,112, 0,
- 42,116,114, 97,110,115,102,111,114,109, 0, 42, 99,111,108,111,114, 95, 98, 97,108, 97,110, 99,101, 0, 42,116,115,116,114,105,
-112,100, 97,116, 97, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,115,116, 97,114,116,115,116,105,108,108, 0, 42,116,115,
-116,114,105,112,100, 97,116, 97, 95,101,110,100,115,116,105,108,108, 0, 42,105, 98,117,102, 95,115,116, 97,114,116,115,116,105,
-108,108, 0, 42,105, 98,117,102, 95,101,110,100,115,116,105,108,108, 0, 42,105,110,115,116, 97,110, 99,101, 95,112,114,105,118,
- 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,116, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0,
- 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,
-114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,109,117,108, 0,104, 97,110,100,115,105,122,101, 0, 97,110,105,109,
- 95,112,114,101,115,101,101,107, 0, 42,115,116,114,105,112, 0,102, 97, 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115,101,113,
- 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,111,117,110,100, 0, 42,104,100,
- 97,117,100,105,111, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,116,114,111, 98,101, 0, 42,101,
-102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115,116, 97,114,116,111,102,115, 0, 97,110,105,109, 95,101,110,100,
-111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98,108,101,110,100, 95,111,112, 97, 99,105,116,121, 0, 42,111,108,
-100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115,101,112, 0,109,101,116, 97,115,116, 97,
- 99,107, 0,101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,
-105,110,105, 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121,
- 0, 98, 78,111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,121, 73,110,105, 0, 83, 99, 97,
-108,101,120, 70,105,110, 0, 83, 99, 97,108,101,121, 70,105,110, 0,120, 73,110,105, 0,120, 70,105,110, 0,121, 73,110,105, 0,
-121, 70,105,110, 0,114,111,116, 73,110,105, 0,114,111,116, 70,105,110, 0,105,110,116,101,114,112,111,108, 97,116,105,111,110,
- 0, 42,102,114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108, 97,115,116, 86, 97,108,105,100,
- 70,114, 97,109,101, 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,101,110,100, 0,116,111,
-116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102,
- 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,109, 97,
-120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,
-104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,115,116,
- 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120, 0,102,
-108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51,
- 50, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99,
- 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0,100,120, 0,100,121, 0,108,105,110,107, 0,111,116,121,112,101, 0,
-111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116,100,105,115,116, 0,108, 97,115,
-116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,101,116, 78, 97,
-109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97,108,117,101, 91, 51, 50, 93, 0,
-109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, 0,100, 97,
-109,112,116,105,109,101,114, 0,100,101,108, 97,121, 0,112,114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97,116,110, 97,
-109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,
-101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,
-105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,102,114,101,113, 50, 0, 97,120,105,115,102, 0, 98,117,116,116,111,110, 0,
- 98,117,116,116,111,110,102, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49,
- 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,
-105,110,107,115, 0,118, 97,108,111, 0, 42, 97, 99,116, 0, 98,108,101,110,100,105,110, 0,112,114,105,111,114,105,116,121, 0,
-115,116,114,105,100,101, 97,120,105,115, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0,115,110,100,110,114, 0,112, 97,
-100, 49, 91, 50, 93, 0,109, 97,107,101, 99,111,112,121, 0, 99,111,112,121,109, 97,100,101, 0,112, 97,100, 50, 91, 49, 93, 0,
-116,114, 97, 99,107, 0,118,111,108,117,109,101, 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,
-108,111, 99, 97,108,102,108, 97,103, 0,102,111,114, 99,101,108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51,
- 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,
-105,116,121, 91, 51, 93, 0, 98,117,116,115,116, 97, 0, 98,117,116,101,110,100, 0,109,105,110, 0,109, 97,120, 0,118,105,115,
-105,102, 97, 99, 0,115,108,111,119, 0,109,105,110,108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,
-110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,116, 91, 51, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,
-110,116, 95, 97,114,103, 95, 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,
-108,111, 97,116, 95, 97,114,103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,
-101, 99,116, 0, 98,111,100,121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,
-105,110, 97,109,101, 91, 54, 52, 93, 0,105,110,116, 95, 97,114,103, 0,102,108,111, 97,116, 95, 97,114,103, 0,103,111, 0, 97,
- 99, 99,101,108,108,101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120,114,111,116,115,112,101,101,
-100, 0,109, 97,120,116,105,108,116,115,112,101,101,100, 0,114,111,116,100, 97,109,112, 0,116,105,108,116,100, 97,109,112, 0,
-115,112,101,101,100,100, 97,109,112, 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109, 0, 42,110,101,119,112, 97,
- 99,107,101,100,102,105,108,101, 0, 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105,110,103, 0, 97,116,116,101,
-110,117, 97,116,105,111,110, 0,112,105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,120, 95,103, 97,105,110, 0,
-100,105,115,116, 97,110, 99,101, 0,115,116,114,101, 97,109,108,101,110, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,
-112,114,105,111, 0,112, 97,100, 91, 49, 48, 93, 0,103, 97,105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,
-100,111,112,112,108,101,114,118,101,108,111, 99,105,116,121, 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114,
- 0,110,117,109,115,111,117,110,100,115,103, 97,109,101,101,110,103,105,110,101, 0, 42,108, 97,109,112,114,101,110, 0,103,111,
- 98,106,101, 99,116, 0, 99,104,105,108,100, 98, 97,115,101, 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,
-108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0,
- 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104,
- 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100,
- 95,116, 97,105,108, 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,112, 97,116,104,102,108, 97,
-103, 0,108, 97,121,101,114, 95,112,114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,
-105,122,101, 0,103,104,111,115,116,116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103,104,111,115,116,115,102, 0,103,
-104,111,115,116,101,102, 0,112, 97,116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,112, 97,116,104,
- 97, 99, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0,115,101,108,101, 99,116,102,108, 97,103, 0, 97,
-103,114,112, 95,105,110,100,101,120, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0,105,107,116,114,101,101, 0, 42, 98,
- 95, 98,111,110,101, 95,109, 97,116,115, 0, 42,100,117, 97,108, 95,113,117, 97,116, 0, 42, 98, 95, 98,111,110,101, 95,100,117,
- 97,108, 95,113,117, 97,116,115, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,109, 97,116,
- 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,111,115,101, 95,116, 97,105,108, 91, 51, 93,
- 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, 91, 51, 93, 0,115,116,105,102,102,110,101,
-115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 42, 99,117,115,116,111,109, 0, 99,104, 97,110, 98, 97,115,101,
- 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 99,121,
- 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,103,114,
-111,117,112, 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 42,103,114,112, 0,114,101,115,101,114,118,101,100, 49, 0,
-103,114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,109, 97,114,107,101,114, 0, 97, 99,116,110,114, 0, 97, 99,116,119,105,
-100,116,104, 0,116,105,109,101,115,108,105,100,101, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,
-116, 97,114,115,112, 97, 99,101, 0,101,110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0, 42,116, 97,114, 0,115,
-117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112, 97, 99,101, 0,
- 42,112,114,111,112, 0,116, 97,114,110,117,109, 0,116, 97,114,103,101,116,115, 0,105,116,101,114, 97,116,105,111,110,115, 0,
-114,111,111,116, 98,111,110,101, 0,109, 97,120, 95,114,111,111,116, 98,111,110,101, 0, 42,112,111,108,101,116, 97,114, 0,112,
-111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,112,111,108,101, 97,110,103,108,101, 0,111,114,105,101,110,
-116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,114,101,115,101,114,118,101,100, 50, 0,
-109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99,107,102,108,
- 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,
-101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,112,105,118, 90, 0, 97,120, 88, 0, 97,
-120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120, 76,105,109,105,116, 91, 54, 93, 0,101,
-120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,111,109, 0,116,111, 0,109, 97,112, 91,
- 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,111,109, 95,109, 97,120, 91, 51, 93, 0,
-116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,122,109,105,110, 0,122,109, 97,120, 0, 99,104,
- 97,110,110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114,105,100,101, 95, 97,120,105,
-115, 0, 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, 97, 99,116,111,102,102,115,
- 0,115,116,114,105,100,101,108,101,110, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,110,101,
-108, 91, 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110,112,117,116, 0,104, 97,115,
-111,117,116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112,101, 0, 42,110,101,119, 95,
-115,111, 99,107, 0,110,115, 0,108,105,109,105,116, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 0,105,110,116,101,114,110,
- 0,115,116, 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, 0,108,111, 99,120, 0,108,111, 99,121, 0,111,119,110, 95,105,
-110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,116,111,115,111, 99,107, 0, 42,108,105,110,107, 0, 42,110,101,119,
- 95,110,111,100,101, 0,117,115,101,114,110, 97,109,101, 91, 51, 50, 93, 0,108, 97,115,116,121, 0,111,117,116,112,117,116,115,
- 0, 42,115,116,111,114, 97,103,101, 0,109,105,110,105,119,105,100,116,104, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,
-111,109, 50, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120,101, 99, 0,116,111,116,114, 0, 98,117,116,114, 0,112,114,118,
-114, 0, 42,116,121,112,101,105,110,102,111, 0, 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,101, 0, 42,102,
-114,111,109,115,111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0, 42,115,116, 97, 99,107, 0, 42,116,104,114,101,
- 97,100,115,116, 97, 99,107, 0,105,110,105,116, 0,115,116, 97, 99,107,115,105,122,101, 0, 99,117,114, 95,105,110,100,101,120,
- 0, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0, 42,115,101,108,105,110, 0, 42,115,101,108,111,117,
-116, 0, 40, 42,116,105,109,101, 99,117,114,115,111,114, 41, 40, 41, 0, 40, 42,115,116, 97,116,115, 95,100,114, 97,119, 41, 40,
- 41, 0, 40, 42,116,101,115,116, 95, 98,114,101, 97,107, 41, 40, 41, 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115,
- 97,109,112,108,101,115, 0,109,105,110,115,112,101,101,100, 0,112,101,114, 99,101,110,116,120, 0,112,101,114, 99,101,110,116,
-121, 0, 98,111,107,101,104, 0, 99,117,114,118,101,100, 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,104, 0,105,109,
- 97,103,101, 95,105,110, 95,104,101,105,103,104,116, 0, 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,114, 95,121, 0,
-115,112,105,110, 0,105,116,101,114, 0,119,114, 97,112, 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,105,103,109, 97,
- 95,115,112, 97, 99,101, 0,104,117,101, 0,115, 97,116, 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,101,110,103,116,
-104, 0,102, 97,108,112,104, 97, 0,107,101,121, 91, 52, 93, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0, 99,111,108,110,
- 97,109,101, 91, 51, 50, 93, 0, 98,107,116,121,112,101, 0,114,111,116, 97,116,105,111,110, 0,112,114,101,118,105,101,119, 0,
-103, 97,109, 99,111, 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0, 98,116,104,114,
-101,115,104, 0, 42,100,105, 99,116, 0, 42,110,111,100,101, 0, 97,110,103,108,101, 95,111,102,115, 0, 99,111,108,109,111,100,
- 0,109,105,120, 0,116,104,114,101,115,104,111,108,100, 0,102, 97,100,101, 0,109, 0, 99, 0,106,105,116, 0,112,114,111,106,
- 0,102,105,116, 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,101, 0,101,120,
-116, 95,105,110, 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101, 0, 42,116, 97, 98,108,101,
- 0, 42,112,114,101,109,117,108,116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,
-108, 97, 99,107, 91, 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,115, 97,109,112,108,101,
- 91, 51, 93, 0,111,102,102,115,101,116, 91, 50, 93, 0,105,110,110,101,114,114, 97,100,105,117,115, 0,114, 97,116,101, 0,114,
-103, 98, 91, 51, 93, 0, 99,108,111,110,101, 0, 97, 99,116,105,118,101, 95,114,110,100, 0, 42,108, 97,121,101,114,115, 0,116,
-111,116,108, 97,121,101,114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,122,101, 0,101,100,105,116,102,108, 97,
-103, 0,118,101,108, 91, 51, 93, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93, 0,110,117,109, 0,112, 97,114,101,110,
-116, 0,112, 97, 91, 52, 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,102,102,115,101,116, 0,114, 97,110,100,
- 91, 51, 93, 0, 42,115,116,105, 99,107, 95,111, 98, 0,115,116, 97,116,101, 0, 42,104, 97,105,114, 0,105, 95,114,111,116, 91,
- 52, 93, 0,114, 95,114,111,116, 91, 52, 93, 0,114, 95, 97,118,101, 91, 51, 93, 0,114, 95,118,101, 91, 51, 93, 0,100,105,101,
-116,105,109,101, 0, 98, 97,110,107, 0,115,105,122,101,109,117,108, 0,110,117,109, 95,100,109, 99, 97, 99,104,101, 0, 98,112,
-105, 0, 97,108,105,118,101, 0,108,111,111,112, 0,100,105,115,116,114, 0,112,104,121,115,116,121,112,101, 0,114,111,116,109,
-111,100,101, 0, 97,118,101,109,111,100,101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,100,114, 97,119,
- 95, 97,115, 0,100,114, 97,119, 95,115,105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,100,114, 97,119, 95,115,116,101,
-112, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, 95,115,116,101,112, 0, 97,
-100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102,114,111,109, 0,105,110,116,
-101,103,114, 97,116,111,114, 0,110, 98,101,116,119,101,101,110, 0, 98,111,105,100,110,101,105,103,104, 98,111,117,114,115, 0,
- 98, 98, 95, 97,108,105,103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97,110,105,109, 0, 98, 98, 95,
-115,112,108,105,116, 95,111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, 97,110,100, 95,116,105,108,
-116, 0, 98, 98, 95,111,102,102,115,101,116, 91, 50, 93, 0,115,105,109,112,108,105,102,121, 95,102,108, 97,103, 0,115,105,109,
-112,108,105,102,121, 95,114,101,102,115,105,122,101, 0,115,105,109,112,108,105,102,121, 95,114, 97,116,101, 0,115,105,109,112,
-108,105,102,121, 95,116,114, 97,110,115,105,116,105,111,110, 0,115,105,109,112,108,105,102,121, 95,118,105,101,119,112,111,114,
-116, 0,116,105,109,101,116,119,101, 97,107, 0,106,105,116,102, 97, 99, 0,107,101,121,101,100, 95,116,105,109,101, 0,101,102,
-102, 95,104, 97,105,114, 0,103,114,105,100, 95,114,101,115, 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102, 97, 99, 0,116,
- 97,110,112,104, 97,115,101, 0,114,101, 97, 99,116,102, 97, 99, 0, 97,118,101,102, 97, 99, 0,112,104, 97,115,101,102, 97, 99,
- 0,114, 97,110,100,114,111,116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,100,115,105,122,
-101, 0,114,101, 97, 99,116,115,104, 97,112,101, 0, 97, 99, 99, 91, 51, 93, 0,100,114, 97,103,102, 97, 99, 0, 98,114,111,119,
-110,102, 97, 99, 0,100, 97,109,112,102, 97, 99, 0, 97, 98,115,108,101,110,103,116,104, 0,114, 97,110,100,108,101,110,103,116,
-104, 0, 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99,104,105,108,100, 95,110, 98,114, 0,112, 97,114,101,110,116,
-115, 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,122,101, 0, 99,104,105,108,100,114,
- 97,100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,104,105,108,100,115,112,114,101, 97,100, 0, 99,108,117,109,112,102, 97,
- 99, 0, 99,108,117,109,112,112,111,119, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95,115,105,122,101, 0,114,111,
-117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116,104,114,101,115, 0,114,111,
-117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 98,114, 97,110, 99,104, 95,116,
-104,114,101,115, 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,109, 97,120, 95,118,101,108, 0,109, 97,120, 95,108, 97,
-116, 95, 97, 99, 99, 0,109, 97,120, 95,116, 97,110, 95, 97, 99, 99, 0, 97,118,101,114, 97,103,101, 95,118,101,108, 0, 98, 97,
-110,107,105,110,103, 0,109, 97,120, 95, 98, 97,110,107, 0,103,114,111,117,110,100,122, 0, 98,111,105,100,102, 97, 99, 91, 56,
- 93, 0, 98,111,105,100,114,117,108,101, 91, 56, 93, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,112, 95,111, 98,
- 0, 42, 98, 98, 95,111, 98, 0, 42,112, 97,114,116, 0, 42,101,100,105,116, 0, 42, 42,112, 97,116,104, 99, 97, 99,104,101, 0,
- 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0, 42,116, 97,114,103,101,116, 95,111, 98, 0, 42,107,101,121,101,100, 95,111,
- 98, 0, 42,108, 97,116,116,105, 99,101, 0,101,102,102,101, 99,116,111,114,115, 0,114,101, 97, 99,116,101,118,101,110,116,115,
- 0,116,111,116, 99,104,105,108,100, 0,116,111,116, 99, 97, 99,104,101,100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,
-101, 0,116, 97,114,103,101,116, 95,112,115,121,115, 0,107,101,121,101,100, 95,112,115,121,115, 0,116,111,116,107,101,121,101,
-100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110, 97,109,101, 91, 51, 93, 91, 51, 50, 93, 0,118,103,114,
-111,117,112, 91, 49, 49, 93, 0,118,103, 95,110,101,103, 0,114,116, 51, 91, 50, 93, 0, 42,114,101,110,100,101,114,100, 97,116,
- 97, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0,118,103,114,111,117,112, 95,115,116,114,117, 99,116, 0,112,114,101,114,
-111,108,108, 0, 67,100,105,115, 0, 67,118,105, 0,115,116,101,112,115, 80,101,114, 70,114, 97,109,101, 0, 91, 51, 93, 0,117,
-102,108,117,105,100, 0,115,116,114,117, 99,116,117,114, 97,108, 0, 98,101,110,100,105,110,103, 0,115,111,108,118,101,114, 95,
-116,121,112,101, 0,118,103,114,111,117,112, 95, 98,101,110,100, 0,101,102,102, 95,102,111,114, 99,101, 95,115, 99, 97,108,101,
- 0,101,102,102, 95,119,105,110,100, 95,115, 99, 97,108,101, 0,115,105,109, 95,116,105,109,101, 95,111,108,100, 0, 42, 99, 97,
- 99,104,101, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,109, 97,120, 95, 98,101,110,100, 0,109, 97,120, 95,115,116,
-114,117, 99,116, 0,109, 97,120, 95,115,104,101, 97,114, 0, 97,118,103, 95,115,112,114,105,110,103, 95,108,101,110, 0,112,114,
-101,115,101,116,115, 0,116,105,109,101,115, 99, 97,108,101, 0,101,112,115,105,108,111,110, 0,115,101,108,102, 95,102,114,105,
- 99,116,105,111,110, 0,115,101,108,102, 95,108,111,111,112, 95, 99,111,117,110,116, 0,108,111,111,112, 95, 99,111,117,110,116,
- 0, 42, 99,111,108,108,105,115,105,111,110, 95,108,105,115,116, 0,115,101,108,102,101,112,115,105,108,111,110, 0, 42,115,112,
-114,105,110,103,115, 0,110,117,109,115,112,114,105,110,103,115, 0,111,108,100, 95,115,111,108,118,101,114, 95,116,121,112,101,
- 0, 42,116,114,101,101, 0, 42,105,109,112,108,105, 99,105,116, 0, 42,105,109,112,108,105, 99,105,116, 69, 77, 0, 42,101,100,
-103,101,104, 97,115,104, 0, 0, 84, 89, 80, 69, 79, 1, 0, 0, 99,104, 97,114, 0,117, 99,104, 97,114, 0,115,104,111,114,116,
- 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,110,103, 0,102,108,111, 97,116, 0,100,111,117,
- 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97,116, 97, 0, 76,105,115,116, 66, 97,115,101, 0,
-118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118,101, 99, 51,105, 0,118,101,
- 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, 52,100, 0,114, 99,116,105,
- 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,114,116,121, 68, 97,116, 97, 0, 73, 68, 80,114,111,112,101,114,116,121, 0,
- 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 80,114,101,118,105,101,119, 73,109, 97,103,101,
- 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,
-116, 76,105,110,101, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, 79, 98,106,
-101, 99,116, 0, 73,109, 97,103,101, 85,115,101,114, 0, 73,109, 97,103,101, 0, 97,110,105,109, 0, 82,101,110,100,101,114, 82,
-101,115,117,108,116, 0, 77, 84,101,120, 0, 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0,
- 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 73,109, 66,117,102, 0, 84,101,120, 77, 97,112,112,105,110,
-103, 0, 76, 97,109,112, 0, 67,117,114,118,101, 77, 97,112,112,105,110,103, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105, 97,
-108, 0, 98, 78,111,100,101, 84,114,101,101, 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116,
- 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 66,101,122,
- 84,114,105,112,108,101, 0, 66, 80,111,105,110,116, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116,
- 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0, 73,112,111, 68,114,105,118,101,114, 0, 73,112,111, 67,117,114,118,
-101, 0, 77,101,115,104, 0, 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, 0,
- 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 77,
- 83,101,108,101, 99,116, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 0, 80, 97,114,116,105,
- 97,108, 86,105,115,105, 98,105,108,105,116,121, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77, 70,108,111, 97,
-116, 80,114,111,112,101,114,116,121, 0, 77, 73,110,116, 80,114,111,112,101,114,116,121, 0, 77, 83,116,114,105,110,103, 80,114,
-111,112,101,114,116,121, 0, 79,114,105,103, 83,112, 97, 99,101, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 67,111,108,
- 0, 77,117,108,116,105,114,101,115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 70, 97, 99,101, 0, 77,117,
-108,116,105,114,101,115, 69,100,103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, 77,117,108,116,105,114,101,
-115, 77, 97,112, 78,111,100,101, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,
-105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,
-114,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116,
- 97, 0, 65,114,114, 97,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100,105,102,105,
-101,114, 68, 97,116, 97, 0, 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,101,118,
-101,108, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97,
- 0, 68,105,115,112,108, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,
-111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97,
- 0, 83,109,111,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114,
- 68, 97,116, 97, 0, 87, 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,
-100,105,102,105,101,114, 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116,
- 98,111,100,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,
-116, 97, 0, 67,108,111,116,104, 0, 67,108,111,116,104, 83,105,109, 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,
-111,108,108, 83,101,116,116,105,110,103,115, 0, 80,111,105,110,116, 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110,
- 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66, 86, 72, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,105,101,114,
- 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, 77, 68,101,102, 67,101,108,108, 0, 77,101,115,104,
- 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,
-109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 0, 68,101,114,
-105,118,101,100, 77,101,115,104, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102,105,101,
-114, 68, 97,116, 97, 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,
-101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, 80, 97,114,
-116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,
-103,115, 0, 79, 98, 72,111,111,107, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,
-121, 83,112,114,105,110,103, 0, 83, 66, 83, 99,114, 97,116, 99,104, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,
-115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,
-116, 97, 0, 70, 70, 77,112,101,103, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 83, 99,101,
-110,101, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 82,101,110,100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,
-114,111,102,105,108,101, 0, 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 73,109,
- 97,103,101, 80, 97,105,110,116, 83,101,116,116,105,110,103,115, 0, 66,114,117,115,104, 0, 80, 97,114,116,105, 99,108,101, 66,
-114,117,115,104, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 84,114,
- 97,110,115,102,111,114,109, 79,114,105,101,110,116, 97,116,105,111,110, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0,
- 66,114,117,115,104, 68, 97,116, 97, 0, 83, 99,117,108,112,116, 68, 97,116, 97, 0, 83, 99,117,108,112,116, 83,101,115,115,105,
-111,110, 0, 83, 99,101,110,101, 0, 68, 97,103, 70,111,114,101,115,116, 0, 66, 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0,
- 83,112, 97, 99,101, 76,105,110,107, 0, 83, 99,114, 65,114,101, 97, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,116,
-111,112,111, 86,105,101,119, 68, 97,116, 97, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 86,105,101,119, 50, 68, 0, 83,112,
- 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101,
- 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0,100,105,114,101,110,116,114,121, 0, 66,108,101,110,100, 72, 97,110,100,
-108,101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,101, 0, 84,114,101,101, 83,116,111,114,101,
- 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,
-120,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0,
- 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 73,109, 97, 83,101,108, 0, 70,105,108,101, 76,105,115,116, 0, 84,
-104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 84,104,101,109,101, 87,105,114,101, 67,111,108,111,114,
- 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,
-101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111,
- 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 84, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,112, 67,114,
-111,112, 0, 83,116,114,105,112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, 66, 97,108, 97,
-110, 99,101, 0, 83,116,114,105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,
-101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0,104,100, 97,117,100,105,111, 0, 77,101,116, 97, 83,116, 97, 99,107,
- 0, 69,100,105,116,105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,
-102,111,114,109, 86, 97,114,115, 0, 83,111,108,105,100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,
-116,114,111,108, 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102,
- 0, 80, 97,114,116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 79,111,112,115, 0, 98, 80,114,111,112,101,114,116,121,
- 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104,
- 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121,
- 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,114, 0, 98, 82, 97,100, 97,114, 83,101,
-110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,121, 83,101,110,115,111,114, 0, 98, 77,
-101,115,115, 97,103,101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114,
- 0, 98, 74,111,121,115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116,
- 0, 98, 80,121,116,104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,
-116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 98, 83,111,117,110,100,
- 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116,
- 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,
-121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,
-116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,
-110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,
-109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101,
- 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,
-111, 68, 70,105,108,116,101,114, 65, 99,116,117, 97,116,111,114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114,
- 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, 76,105,115,116,101,110,
-101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98,
- 65,114,109, 97,116,117,114,101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, 71,114,111,
-117,112, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 83,112, 97, 99,101, 65, 99,116,105,111,110, 0, 98, 67,
-111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,111,
-110,115,116,114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, 67,111,110,115,116,114, 97,105,110,116,
- 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97, 99,107, 84,111, 67,111,
-110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98,
- 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 77,105,110, 77, 97,120, 67,111,110,115,
-116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,
-111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,
-116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101,116, 99,104,
- 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,111,100,121, 74,111,105,110,116, 67,111,110,115,
-116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,104,105,108,100,
- 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,111,114,109, 67,111,110,115,116,114, 97,105,110,
-116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 76,105,109,105,116, 67,
-111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98,
- 68,105,115,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,
-105,101,114, 0, 98, 65, 99,116,105,111,110, 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,
-101, 83,111, 99,107,101,116, 0, 98, 78,111,100,101, 76,105,110,107, 0, 98, 78,111,100,101, 0, 98, 78,111,100,101, 80,114,101,
-118,105,101,119, 0, 98, 78,111,100,101, 84,121,112,101, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0, 78,111,100,
-101, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 68, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 66,105,108, 97,
-116,101,114, 97,108, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101, 73,109, 97,
-103,101, 70,105,108,101, 0, 78,111,100,101, 67,104,114,111,109, 97, 0, 78,111,100,101, 84,119,111, 88, 89,115, 0, 78,111,100,
-101, 84,119,111, 70,108,111, 97,116,115, 0, 78,111,100,101, 71,101,111,109,101,116,114,121, 0, 78,111,100,101, 86,101,114,116,
-101,120, 67,111,108, 0, 78,111,100,101, 68,101,102,111, 99,117,115, 0, 78,111,100,101, 83, 99,114,105,112,116, 68,105, 99,116,
- 0, 78,111,100,101, 71,108, 97,114,101, 0, 78,111,100,101, 84,111,110,101,109, 97,112, 0, 78,111,100,101, 76,101,110,115, 68,
-105,115,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,118,101, 77, 97,112, 0, 66,114,117,115,104,
- 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,114, 0, 72, 97,105,114, 75,101,121, 0, 80, 97,
-114,116,105, 99,108,101, 75,101,121, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,108,101, 0, 80, 97,114,116,105, 99,108,101,
- 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 69,100,
-105,116, 0, 80, 97,114,116,105, 99,108,101, 67, 97, 99,104,101, 75,101,121, 0, 76,105,110,107, 78,111,100,101, 0, 67,108,111,
-116,104, 86,101,114,116,101,120, 0, 73,109,112,108,105, 99,105,116, 95, 68, 97,116, 97, 0, 69,100,103,101, 72, 97,115,104, 0,
- 84, 76, 69, 78, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 16, 0, 24, 0, 16, 0, 4, 0,
- 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 32, 0, 96, 0, 72, 0, 72, 2, 0, 0,
- 40, 0,112, 0,128, 0,160, 0, 24, 0, 40, 0,152, 0, 24, 0,168, 0, 0, 4, 32, 0,176, 1, 0, 0, 0, 0,144, 0, 48, 1,
-120, 1, 24, 0, 8, 3,200, 0, 0, 0,136, 0,104, 1, 56, 1, 80, 0,160, 2,200, 0, 96, 0, 96, 1, 0, 0,128, 0,104, 0,
-184, 0, 56, 0, 36, 0, 80, 0, 8, 0, 16, 0,160, 1, 0, 0,144, 0,112, 0,120, 1, 20, 0, 48, 0, 64, 0, 24, 0, 12, 0,
- 16, 0, 4, 0, 8, 0, 8, 0, 24, 0, 96, 0, 48, 0, 8, 0, 4, 0, 4, 0, 0, 1, 32, 0, 16, 0, 64, 0, 24, 0, 12, 0,
- 96, 0, 0, 0, 64, 0, 88, 0,104, 0,112, 0, 80, 0,144, 0, 80, 0, 72, 0,120, 0, 72, 0,168, 0,208, 0, 72, 0,104, 0,
-120, 0,200, 0,120, 0,200, 0, 64, 0, 96, 0, 72, 0,152, 0, 32, 0, 20, 0,144, 0, 0, 0, 80, 0, 8, 0, 8, 0, 0, 1,
- 96, 0,120, 1, 0, 0, 80, 0, 80, 0,152, 0, 48, 0,128, 0, 72, 0,120, 0,176, 0,152, 1,224, 0, 16, 0, 0, 0, 0, 0,
- 0, 0,152, 1, 40, 0, 40, 0,184, 0,152, 0, 48, 0, 16, 0, 88, 0,192, 3, 64, 0, 16, 0, 88, 0, 16, 0,216, 0, 8, 0,
- 72, 0, 88, 0,192, 0, 8, 0,184, 0, 0, 0,208, 5, 0, 0, 64, 0, 56, 3, 48, 0, 8, 1, 0, 0, 0, 0, 0, 0,136, 0,
- 48, 0,120, 1,240, 0,208, 0,248, 1, 0, 0, 0, 0, 48, 1, 16, 0, 16, 0, 24, 1,192, 0,136, 0,120, 2, 56, 0,176, 0,
-232, 0,184, 2, 0, 0,152, 0,192, 0, 16, 0, 80, 13, 56, 0, 32, 12,168, 0, 32, 0, 40, 0,240, 0, 40, 0, 80, 0, 48, 0,
- 16, 0, 8, 0, 52, 0,160, 0, 32, 1,200, 1, 16, 1, 72, 1, 0, 0, 32, 0, 48, 0, 12, 0, 24, 0, 48, 0, 16, 0, 24, 0,
- 24, 0, 32, 0, 72, 1, 0, 0, 64, 0, 64, 0, 80, 0, 48, 0, 8, 0, 48, 0, 72, 0,104, 0, 72, 0, 44, 0, 40, 0,108, 0,
- 72, 0, 96, 0,104, 0, 64, 0,128, 0, 8, 0, 80, 0, 16, 0, 64, 0, 32, 0, 20, 0, 72, 0, 24, 0, 80, 0,104, 0, 52, 0,
- 32, 0, 56, 0, 64, 0, 56, 0,112, 0,140, 0, 4, 0, 24, 0, 16, 0, 40, 0, 0, 0, 88, 0,192, 0, 40, 0, 24, 1,152, 0,
-208, 1, 88, 0, 88, 0,208, 0, 56, 0, 80, 0,128, 0, 80, 0,112, 0, 56, 0, 48, 0, 48, 0, 72, 0, 48, 0, 72, 0, 48, 0,
- 24, 0, 56, 0,104, 0, 16, 0,112, 0, 96, 0, 28, 0, 28, 0, 28, 0, 56, 0, 72, 0,168, 0, 40, 0,144, 0, 48, 0,240, 0,
- 0, 0, 0, 0, 16, 0, 40, 0, 28, 0, 12, 0, 12, 0, 16, 1, 40, 0, 8, 0, 8, 0, 64, 0, 32, 0, 24, 0, 16, 0, 24, 0,
- 32, 0, 8, 0, 12, 0, 56, 0, 24, 0, 64, 0, 24, 0, 56, 0, 72, 0,208, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 83, 84, 82, 67, 38, 1, 0, 0, 10, 0, 2, 0, 10, 0, 0, 0, 10, 0, 1, 0, 11, 0, 3, 0, 11, 0, 0, 0,
- 11, 0, 1, 0, 9, 0, 2, 0, 12, 0, 2, 0, 9, 0, 3, 0, 9, 0, 4, 0, 13, 0, 2, 0, 2, 0, 5, 0, 2, 0, 6, 0,
- 14, 0, 2, 0, 4, 0, 5, 0, 4, 0, 6, 0, 15, 0, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0, 16, 0, 2, 0, 8, 0, 5, 0,
- 8, 0, 6, 0, 17, 0, 3, 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 18, 0, 3, 0, 7, 0, 5, 0, 7, 0, 6, 0,
- 7, 0, 7, 0, 19, 0, 3, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 20, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0,
- 4, 0, 7, 0, 4, 0, 8, 0, 21, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0, 8, 0, 22, 0, 4, 0,
- 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 8, 0, 8, 0, 23, 0, 4, 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0,
- 4, 0, 12, 0, 24, 0, 4, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 25, 0, 4, 0, 9, 0, 13, 0,
- 12, 0, 14, 0, 4, 0, 15, 0, 4, 0, 16, 0, 26, 0, 10, 0, 26, 0, 0, 0, 26, 0, 1, 0, 0, 0, 17, 0, 0, 0, 18, 0,
- 0, 0, 19, 0, 2, 0, 20, 0, 4, 0, 21, 0, 25, 0, 22, 0, 4, 0, 23, 0, 4, 0, 24, 0, 27, 0, 9, 0, 9, 0, 0, 0,
- 9, 0, 1, 0, 27, 0, 25, 0, 28, 0, 26, 0, 0, 0, 27, 0, 2, 0, 28, 0, 2, 0, 20, 0, 4, 0, 29, 0, 26, 0, 30, 0,
- 28, 0, 8, 0, 27, 0, 31, 0, 27, 0, 32, 0, 29, 0, 33, 0, 0, 0, 34, 0, 0, 0, 35, 0, 4, 0, 36, 0, 4, 0, 16, 0,
- 28, 0, 37, 0, 30, 0, 6, 0, 4, 0, 38, 0, 4, 0, 39, 0, 2, 0, 40, 0, 2, 0, 41, 0, 2, 0, 42, 0, 4, 0, 43, 0,
- 31, 0, 7, 0, 27, 0, 31, 0, 12, 0, 44, 0, 24, 0, 45, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 48, 0, 2, 0, 16, 0,
- 32, 0, 16, 0, 32, 0, 0, 0, 32, 0, 1, 0, 7, 0, 49, 0, 7, 0, 50, 0, 2, 0, 18, 0, 2, 0, 51, 0, 2, 0, 52, 0,
- 2, 0, 20, 0, 4, 0, 53, 0, 4, 0, 54, 0, 9, 0, 2, 0, 7, 0, 55, 0, 0, 0, 17, 0, 0, 0, 56, 0, 7, 0, 57, 0,
- 7, 0, 58, 0, 33, 0, 12, 0, 27, 0, 31, 0, 32, 0, 59, 0, 0, 0, 60, 0, 4, 0, 61, 0, 7, 0, 50, 0, 12, 0, 62, 0,
- 31, 0, 63, 0, 27, 0, 64, 0, 2, 0, 18, 0, 2, 0, 65, 0, 2, 0, 66, 0, 2, 0, 20, 0, 34, 0, 5, 0, 27, 0, 67, 0,
- 2, 0, 68, 0, 2, 0, 69, 0, 2, 0, 70, 0, 4, 0, 16, 0, 35, 0, 6, 0, 35, 0, 0, 0, 35, 0, 1, 0, 0, 0, 71, 0,
- 0, 0, 72, 0, 4, 0, 23, 0, 4, 0, 73, 0, 36, 0, 13, 0, 27, 0, 31, 0, 0, 0, 74, 0, 4, 0, 75, 0, 4, 0, 76, 0,
- 12, 0, 77, 0, 35, 0, 78, 0, 35, 0, 79, 0, 4, 0, 80, 0, 4, 0, 81, 0, 0, 0, 82, 0, 4, 0, 83, 0, 4, 0, 84, 0,
- 9, 0, 85, 0, 37, 0, 5, 0, 4, 0, 86, 0, 4, 0, 87, 0, 4, 0, 75, 0, 4, 0, 16, 0, 9, 0, 2, 0, 38, 0, 20, 0,
- 27, 0, 31, 0, 2, 0, 18, 0, 2, 0, 20, 0, 7, 0, 88, 0, 7, 0, 89, 0, 7, 0, 90, 0, 7, 0, 91, 0, 7, 0, 92, 0,
- 7, 0, 93, 0, 7, 0, 94, 0, 7, 0, 95, 0, 7, 0, 96, 0, 7, 0, 97, 0, 7, 0, 98, 0, 2, 0, 99, 0, 2, 0,100, 0,
- 7, 0,101, 0, 31, 0, 63, 0, 34, 0,102, 0, 39, 0,103, 0, 40, 0, 12, 0, 4, 0,104, 0, 4, 0,105, 0, 4, 0,106, 0,
- 4, 0,107, 0, 2, 0,108, 0, 2, 0,109, 0, 2, 0, 20, 0, 2, 0,110, 0, 2, 0,111, 0, 2, 0,112, 0, 2, 0,113, 0,
- 2, 0,114, 0, 41, 0, 31, 0, 27, 0, 31, 0, 0, 0, 34, 0, 12, 0,115, 0, 42, 0,116, 0, 43, 0,117, 0, 2, 0,110, 0,
- 2, 0, 20, 0, 2, 0,118, 0, 2, 0, 18, 0, 2, 0, 16, 0, 2, 0, 42, 0, 4, 0,119, 0, 2, 0,120, 0, 2, 0,121, 0,
- 2, 0,122, 0, 2, 0,123, 0, 2, 0,124, 0, 2, 0,125, 0, 4, 0,126, 0, 4, 0,127, 0, 37, 0,128, 0, 30, 0,129, 0,
- 7, 0,130, 0, 4, 0,131, 0, 2, 0,132, 0, 2, 0,133, 0, 2, 0,134, 0, 2, 0,135, 0, 7, 0,136, 0, 7, 0,137, 0,
- 9, 0,138, 0, 44, 0, 30, 0, 2, 0,139, 0, 2, 0,140, 0, 2, 0,141, 0, 2, 0,142, 0, 39, 0,143, 0, 45, 0,144, 0,
- 0, 0,145, 0, 0, 0,146, 0, 0, 0,147, 0, 0, 0,148, 0, 0, 0,149, 0, 7, 0,150, 0, 7, 0,151, 0, 2, 0,152, 0,
- 2, 0,153, 0, 2, 0,154, 0, 2, 0,155, 0, 2, 0,156, 0, 2, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0,
- 7, 0,161, 0, 7, 0,162, 0, 7, 0,163, 0, 7, 0,164, 0, 7, 0,165, 0, 7, 0,166, 0, 7, 0,167, 0, 7, 0,168, 0,
- 46, 0, 15, 0, 0, 0,169, 0, 9, 0,170, 0, 0, 0,171, 0, 0, 0,172, 0, 4, 0,173, 0, 4, 0,174, 0, 9, 0,175, 0,
- 7, 0,176, 0, 7, 0,177, 0, 7, 0,178, 0, 4, 0,179, 0, 9, 0,180, 0, 9, 0,181, 0, 4, 0,182, 0, 4, 0, 16, 0,
- 47, 0, 6, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, 7, 0,183, 0, 7, 0, 49, 0, 4, 0, 45, 0, 48, 0, 5, 0,
- 2, 0, 20, 0, 2, 0, 36, 0, 2, 0, 45, 0, 2, 0,184, 0, 47, 0,178, 0, 49, 0, 17, 0, 39, 0,143, 0, 41, 0,185, 0,
- 50, 0,186, 0, 7, 0,187, 0, 7, 0,188, 0, 2, 0, 18, 0, 2, 0,189, 0, 7, 0, 90, 0, 7, 0, 91, 0, 7, 0,190, 0,
- 4, 0,191, 0, 2, 0,192, 0, 2, 0,193, 0, 4, 0,110, 0, 4, 0,119, 0, 2, 0,194, 0, 2, 0,195, 0, 45, 0, 53, 0,
- 27, 0, 31, 0, 7, 0,196, 0, 7, 0,197, 0, 7, 0,198, 0, 7, 0,199, 0, 7, 0,200, 0, 7, 0,201, 0, 7, 0,202, 0,
- 7, 0,203, 0, 7, 0,204, 0, 7, 0,205, 0, 7, 0,206, 0, 7, 0,207, 0, 7, 0,208, 0, 7, 0,209, 0, 7, 0,210, 0,
- 7, 0,211, 0, 7, 0,212, 0, 7, 0,213, 0, 7, 0,214, 0, 7, 0,215, 0, 2, 0,216, 0, 2, 0,217, 0, 2, 0,218, 0,
- 2, 0,219, 0, 2, 0,220, 0, 2, 0,221, 0, 2, 0,222, 0, 2, 0, 20, 0, 2, 0, 18, 0, 2, 0,189, 0, 7, 0,223, 0,
- 7, 0,224, 0, 7, 0,225, 0, 7, 0,226, 0, 2, 0,227, 0, 2, 0,228, 0, 2, 0,229, 0, 2, 0,108, 0, 4, 0, 23, 0,
- 4, 0,105, 0, 4, 0,106, 0, 4, 0,107, 0, 7, 0,230, 0, 7, 0,231, 0, 7, 0,165, 0, 40, 0,232, 0, 31, 0, 63, 0,
- 41, 0,185, 0, 46, 0,233, 0, 48, 0,234, 0, 49, 0,235, 0, 30, 0,129, 0, 51, 0, 8, 0, 7, 0,236, 0, 7, 0,237, 0,
- 7, 0,151, 0, 4, 0, 20, 0, 7, 0,238, 0, 7, 0,239, 0, 7, 0,240, 0, 39, 0,241, 0, 52, 0, 60, 0, 27, 0, 31, 0,
- 2, 0, 18, 0, 2, 0,242, 0, 2, 0,153, 0, 2, 0,243, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, 7, 0,161, 0,
- 7, 0,244, 0, 7, 0,245, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248, 0, 7, 0,249, 0, 7, 0,250, 0, 4, 0, 54, 0,
- 53, 0,251, 0, 2, 0,252, 0, 2, 0,253, 0, 7, 0, 90, 0, 7, 0, 91, 0, 7, 0,254, 0, 7, 0,255, 0, 7, 0, 0, 1,
- 2, 0, 1, 1, 2, 0, 2, 1, 2, 0, 3, 1, 2, 0, 4, 1, 0, 0, 5, 1, 0, 0, 6, 1, 2, 0, 7, 1, 2, 0, 8, 1,
- 2, 0, 9, 1, 2, 0, 10, 1, 2, 0, 11, 1, 7, 0, 12, 1, 7, 0, 13, 1, 7, 0, 14, 1, 7, 0, 15, 1, 2, 0, 16, 1,
- 2, 0, 42, 0, 2, 0, 17, 1, 2, 0, 18, 1, 4, 0, 19, 1, 4, 0, 20, 1, 2, 0, 21, 1, 2, 0, 22, 1, 2, 0, 23, 1,
- 2, 0, 24, 1, 7, 0, 25, 1, 7, 0, 26, 1, 7, 0, 27, 1, 7, 0, 28, 1, 2, 0, 29, 1, 2, 0, 30, 1, 44, 0, 31, 1,
- 31, 0, 63, 0, 30, 0,129, 0, 34, 0,102, 0, 54, 0, 2, 0, 27, 0, 31, 0, 31, 0, 63, 0, 55, 0,128, 0, 27, 0, 31, 0,
- 2, 0,153, 0, 2, 0, 20, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, 7, 0, 32, 1, 7, 0, 33, 1, 7, 0, 34, 1,
- 7, 0, 35, 1, 7, 0, 36, 1, 7, 0, 37, 1, 7, 0, 38, 1, 7, 0, 39, 1, 7, 0, 40, 1, 7, 0, 41, 1, 7, 0, 42, 1,
- 7, 0, 43, 1, 7, 0, 44, 1, 7, 0, 45, 1, 7, 0, 46, 1, 7, 0, 47, 1, 7, 0, 48, 1, 7, 0, 49, 1, 7, 0, 50, 1,
- 7, 0, 51, 1, 7, 0, 52, 1, 7, 0, 53, 1, 7, 0, 54, 1, 7, 0, 55, 1, 7, 0, 56, 1, 7, 0, 57, 1, 7, 0, 58, 1,
- 2, 0, 59, 1, 2, 0, 60, 1, 2, 0, 61, 1, 0, 0, 62, 1, 0, 0, 63, 1, 7, 0, 64, 1, 7, 0, 65, 1, 2, 0, 66, 1,
- 2, 0, 67, 1, 7, 0, 68, 1, 7, 0, 69, 1, 7, 0, 70, 1, 7, 0, 71, 1, 2, 0, 72, 1, 2, 0, 73, 1, 4, 0,242, 0,
- 4, 0, 74, 1, 2, 0, 75, 1, 2, 0, 76, 1, 2, 0, 77, 1, 2, 0, 78, 1, 7, 0, 79, 1, 7, 0, 80, 1, 7, 0, 81, 1,
- 7, 0, 82, 1, 7, 0, 83, 1, 7, 0, 84, 1, 7, 0, 85, 1, 7, 0, 86, 1, 7, 0, 87, 1, 7, 0, 88, 1, 0, 0, 89, 1,
- 7, 0, 90, 1, 7, 0, 91, 1, 7, 0, 92, 1, 7, 0, 93, 1, 0, 0, 94, 1, 0, 0, 17, 1, 0, 0, 95, 1, 0, 0, 96, 1,
- 2, 0, 97, 1, 2, 0, 98, 1, 2, 0, 99, 1, 2, 0,100, 1, 2, 0,101, 1, 2, 0,102, 1, 7, 0,103, 1, 7, 0,104, 1,
- 7, 0,105, 1, 7, 0,106, 1, 7, 0,107, 1, 2, 0,139, 0, 2, 0,140, 0, 48, 0,108, 1, 48, 0,109, 1, 0, 0,110, 1,
- 0, 0,111, 1, 0, 0,112, 1, 0, 0,113, 1, 2, 0,114, 1, 2, 0,253, 0, 7, 0,115, 1, 7, 0,116, 1, 44, 0, 31, 1,
- 56, 0,117, 1, 31, 0, 63, 0, 57, 0,118, 1, 30, 0,129, 0, 7, 0,119, 1, 7, 0,120, 1, 7, 0,121, 1, 7, 0,122, 1,
- 7, 0,123, 1, 2, 0,124, 1, 2, 0, 54, 0, 7, 0,125, 1, 7, 0,126, 1, 7, 0,127, 1, 7, 0,128, 1, 7, 0,129, 1,
- 7, 0,130, 1, 7, 0,131, 1, 7, 0,132, 1, 7, 0,133, 1, 2, 0,134, 1, 2, 0,135, 1, 7, 0,136, 1, 7, 0,137, 1,
- 7, 0,138, 1, 7, 0,139, 1, 7, 0,140, 1, 4, 0,141, 1, 4, 0,142, 1, 4, 0,143, 1, 34, 0,102, 0, 58, 0, 6, 0,
- 27, 0, 31, 0, 0, 0,144, 1, 7, 0,145, 1, 7, 0, 16, 0, 59, 0, 2, 0, 37, 0,128, 0, 60, 0, 26, 0, 60, 0, 0, 0,
- 60, 0, 1, 0, 61, 0,146, 1, 4, 0,147, 1, 4, 0,148, 1, 4, 0,149, 1, 4, 0,150, 1, 4, 0,151, 1, 4, 0,152, 1,
- 2, 0, 18, 0, 2, 0, 20, 0, 2, 0,153, 1, 2, 0,154, 1, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0,155, 1,
- 7, 0,156, 1, 7, 0,157, 1, 7, 0,158, 1, 7, 0,159, 1, 7, 0,160, 1, 7, 0,161, 1, 7, 0, 23, 0, 7, 0,162, 1,
- 7, 0,163, 1, 62, 0, 15, 0, 27, 0, 31, 0, 61, 0,146, 1, 12, 0,164, 1, 12, 0,165, 1, 31, 0, 63, 0, 55, 0,166, 1,
- 2, 0, 20, 0, 2, 0,167, 1, 4, 0,152, 0, 7, 0,236, 0, 7, 0,151, 0, 7, 0,237, 0, 7, 0,168, 1, 7, 0,169, 1,
- 7, 0,170, 1, 63, 0, 10, 0, 7, 0,171, 1, 7, 0,172, 1, 7, 0,173, 1, 7, 0,174, 1, 2, 0,175, 1, 2, 0,176, 1,
- 0, 0,177, 1, 0, 0,178, 1, 0, 0,179, 1, 0, 0,180, 1, 64, 0, 7, 0, 7, 0,181, 1, 7, 0,172, 1, 7, 0,173, 1,
- 2, 0,177, 1, 2, 0,180, 1, 7, 0,174, 1, 7, 0, 16, 0, 65, 0, 21, 0, 65, 0, 0, 0, 65, 0, 1, 0, 2, 0, 18, 0,
- 2, 0,182, 1, 2, 0,180, 1, 2, 0, 20, 0, 2, 0,183, 1, 2, 0,184, 1, 2, 0,185, 1, 2, 0,186, 1, 2, 0,187, 1,
- 2, 0,188, 1, 2, 0,189, 1, 2, 0,190, 1, 7, 0,191, 1, 7, 0,192, 1, 64, 0,193, 1, 63, 0,194, 1, 2, 0,195, 1,
- 2, 0, 16, 0, 4, 0,196, 1, 66, 0, 5, 0, 2, 0,197, 1, 2, 0,182, 1, 0, 0, 20, 0, 0, 0, 16, 0, 2, 0, 54, 0,
- 67, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 8, 0, 7, 0,198, 1, 68, 0, 57, 0, 27, 0, 31, 0, 61, 0,146, 1,
- 12, 0,199, 1, 12, 0,165, 1, 39, 0,200, 1, 39, 0,201, 1, 39, 0,202, 1, 31, 0, 63, 0, 69, 0,203, 1, 33, 0,204, 1,
- 55, 0,166, 1, 12, 0,205, 1, 7, 0,236, 0, 7, 0,151, 0, 7, 0,237, 0, 4, 0,152, 0, 2, 0,206, 1, 2, 0,167, 1,
- 2, 0, 20, 0, 2, 0,207, 1, 7, 0,208, 1, 7, 0,209, 1, 7, 0,210, 1, 2, 0,185, 1, 2, 0,186, 1, 2, 0,211, 1,
- 2, 0,212, 1, 4, 0, 54, 0, 2, 0, 23, 0, 2, 0, 77, 0, 2, 0, 49, 0, 2, 0,213, 1, 7, 0,214, 1, 7, 0,215, 1,
- 7, 0,216, 1, 7, 0,217, 1, 7, 0,218, 1, 7, 0,219, 1, 7, 0,220, 1, 7, 0,221, 1, 7, 0,222, 1, 7, 0,223, 1,
- 0, 0,224, 1, 0, 0,225, 1, 58, 0,226, 1, 58, 0,227, 1, 58, 0,228, 1, 58, 0,229, 1, 4, 0,230, 1, 4, 0,231, 1,
- 4, 0,232, 1, 4, 0, 16, 0, 67, 0,233, 1, 4, 0,234, 1, 4, 0,235, 1, 66, 0,236, 1, 66, 0,237, 1, 70, 0, 6, 0,
- 39, 0,241, 0, 2, 0, 46, 0, 2, 0, 51, 0, 2, 0, 18, 0, 2, 0, 20, 0, 0, 0,238, 1, 71, 0, 21, 0, 71, 0, 0, 0,
- 71, 0, 1, 0, 64, 0,193, 1, 63, 0,194, 1, 24, 0,239, 1, 24, 0,240, 1, 2, 0, 46, 0, 2, 0, 51, 0, 2, 0,241, 1,
- 2, 0,242, 1, 2, 0,243, 1, 2, 0,244, 1, 2, 0, 20, 0, 2, 0,163, 0, 7, 0, 11, 0, 7, 0, 12, 0, 4, 0,245, 1,
- 7, 0,246, 1, 7, 0,247, 1, 7, 0, 50, 0, 70, 0,248, 1, 72, 0, 39, 0, 27, 0, 31, 0, 61, 0,146, 1, 12, 0,249, 1,
- 31, 0, 63, 0, 33, 0,204, 1, 55, 0,166, 1, 73, 0,250, 1, 74, 0,251, 1, 75, 0,252, 1, 76, 0,253, 1, 77, 0,254, 1,
- 78, 0,255, 1, 79, 0, 0, 2, 80, 0, 1, 2, 72, 0, 2, 2, 81, 0, 3, 2, 82, 0, 4, 2, 82, 0, 5, 2, 82, 0, 6, 2,
- 4, 0,242, 1, 4, 0, 7, 2, 4, 0, 8, 2, 4, 0, 9, 2, 4, 0, 10, 2, 4, 0,152, 0, 7, 0,236, 0, 7, 0,151, 0,
- 7, 0,237, 0, 7, 0, 11, 2, 7, 0, 16, 0, 2, 0, 12, 2, 2, 0, 20, 0, 2, 0, 13, 2, 2, 0, 14, 2, 2, 0,167, 1,
- 2, 0, 15, 2, 83, 0, 16, 2, 84, 0, 17, 2, 9, 0,138, 0, 75, 0, 8, 0, 9, 0, 18, 2, 7, 0, 19, 2, 4, 0, 20, 2,
- 0, 0, 20, 0, 0, 0, 21, 2, 2, 0,242, 0, 2, 0, 22, 2, 2, 0, 23, 2, 73, 0, 8, 0, 4, 0, 24, 2, 4, 0, 25, 2,
- 4, 0, 26, 2, 4, 0, 27, 2, 0, 0, 16, 0, 0, 0,182, 1, 0, 0, 28, 2, 0, 0, 20, 0, 77, 0, 5, 0, 4, 0, 24, 2,
- 4, 0, 25, 2, 0, 0, 29, 2, 0, 0, 30, 2, 2, 0, 20, 0, 85, 0, 2, 0, 4, 0, 31, 2, 7, 0,173, 1, 78, 0, 3, 0,
- 85, 0, 32, 2, 4, 0, 33, 2, 4, 0, 20, 0, 76, 0, 6, 0, 7, 0, 34, 2, 2, 0, 35, 2, 0, 0, 20, 0, 0, 0,182, 1,
- 0, 0, 30, 2, 0, 0,157, 0, 79, 0, 4, 0, 0, 0,183, 0, 0, 0,158, 0, 0, 0,159, 0, 0, 0,160, 0, 80, 0, 1, 0,
- 7, 0, 36, 2, 81, 0, 2, 0, 4, 0, 37, 2, 4, 0, 18, 0, 74, 0, 7, 0, 7, 0, 19, 2, 41, 0, 18, 2, 0, 0, 20, 0,
- 0, 0, 21, 2, 2, 0,242, 0, 2, 0, 22, 2, 2, 0, 23, 2, 86, 0, 1, 0, 7, 0, 38, 2, 87, 0, 1, 0, 4, 0, 39, 2,
- 88, 0, 1, 0, 0, 0, 40, 2, 89, 0, 1, 0, 7, 0, 19, 2, 90, 0, 4, 0, 7, 0,183, 0, 7, 0,158, 0, 7, 0,159, 0,
- 7, 0,160, 0, 91, 0, 1, 0, 90, 0, 20, 2, 92, 0, 5, 0, 4, 0, 41, 2, 4, 0, 42, 2, 0, 0, 20, 0, 0, 0,182, 1,
- 0, 0, 43, 2, 93, 0, 2, 0, 4, 0, 44, 2, 4, 0, 42, 2, 94, 0, 14, 0, 94, 0, 0, 0, 94, 0, 1, 0, 92, 0, 45, 2,
- 91, 0, 46, 2, 93, 0, 47, 2, 0, 0, 48, 2, 12, 0, 49, 2, 12, 0, 50, 2, 95, 0, 51, 2, 4, 0,242, 1, 4, 0, 8, 2,
- 4, 0, 7, 2, 4, 0, 16, 0, 76, 0, 52, 2, 83, 0, 14, 0, 12, 0, 53, 2, 76, 0, 52, 2, 0, 0, 54, 2, 0, 0, 55, 2,
- 0, 0, 56, 2, 0, 0, 57, 2, 0, 0, 58, 2, 0, 0, 59, 2, 0, 0, 60, 2, 0, 0, 20, 0, 82, 0, 4, 2, 82, 0, 6, 2,
- 2, 0, 61, 2, 0, 0, 62, 2, 84, 0, 8, 0, 4, 0, 63, 2, 4, 0, 64, 2, 73, 0, 65, 2, 77, 0, 66, 2, 4, 0, 8, 2,
- 4, 0, 7, 2, 4, 0,242, 1, 4, 0, 16, 0, 96, 0, 6, 0, 96, 0, 0, 0, 96, 0, 1, 0, 4, 0, 18, 0, 4, 0,242, 0,
- 0, 0, 17, 0, 0, 0, 67, 2, 97, 0, 7, 0, 96, 0, 68, 2, 2, 0, 69, 2, 2, 0, 53, 2, 2, 0, 70, 2, 2, 0, 75, 0,
- 9, 0, 71, 2, 9, 0, 72, 2, 98, 0, 3, 0, 96, 0, 68, 2, 39, 0,143, 0, 0, 0, 17, 0, 99, 0, 5, 0, 96, 0, 68, 2,
- 39, 0,143, 0, 0, 0, 17, 0, 2, 0, 73, 2, 0, 0, 74, 2,100, 0, 5, 0, 96, 0, 68, 2, 7, 0, 75, 2, 7, 0, 76, 2,
- 4, 0, 77, 2, 4, 0, 78, 2,101, 0, 13, 0, 96, 0, 68, 2, 39, 0, 79, 2, 39, 0, 80, 2, 39, 0, 81, 2, 39, 0, 82, 2,
- 7, 0, 83, 2, 7, 0, 84, 2, 7, 0, 76, 2, 7, 0, 85, 2, 4, 0, 86, 2, 4, 0, 87, 2, 4, 0, 75, 0, 4, 0, 88, 2,
-102, 0, 5, 0, 96, 0, 68, 2, 2, 0, 89, 2, 2, 0, 20, 0, 7, 0, 90, 2, 39, 0, 91, 2,103, 0, 3, 0, 96, 0, 68, 2,
- 7, 0, 92, 2, 4, 0, 75, 0,104, 0, 10, 0, 96, 0, 68, 2, 7, 0, 93, 2, 4, 0, 94, 2, 4, 0, 16, 0, 2, 0, 75, 0,
- 2, 0, 95, 2, 2, 0, 96, 2, 2, 0, 97, 2, 7, 0, 98, 2, 0, 0, 99, 2,105, 0, 3, 0, 96, 0, 68, 2, 7, 0, 16, 0,
- 4, 0, 18, 0,106, 0, 11, 0, 96, 0, 68, 2, 45, 0,100, 2, 7, 0,101, 2, 4, 0,102, 2, 0, 0, 99, 2, 7, 0,103, 2,
- 4, 0,104, 2, 39, 0,105, 2, 0, 0,106, 2, 4, 0,107, 2, 4, 0, 16, 0,107, 0, 10, 0, 96, 0, 68, 2, 39, 0,108, 2,
- 41, 0,109, 2, 4, 0, 75, 0, 4, 0,110, 2, 7, 0,111, 2, 7, 0,112, 2, 0, 0,106, 2, 4, 0,107, 2, 4, 0, 16, 0,
-108, 0, 3, 0, 96, 0, 68, 2, 7, 0,113, 2, 4, 0,114, 2,109, 0, 5, 0, 96, 0, 68, 2, 7, 0,115, 2, 0, 0, 99, 2,
- 2, 0, 20, 0, 2, 0,116, 2,110, 0, 8, 0, 96, 0, 68, 2, 39, 0,143, 0, 7, 0,115, 2, 7, 0,174, 1, 7, 0, 86, 0,
- 0, 0, 99, 2, 2, 0, 20, 0, 2, 0, 18, 0,111, 0, 19, 0, 96, 0, 68, 2, 39, 0,117, 2, 0, 0, 99, 2, 45, 0,100, 2,
- 39, 0,105, 2, 2, 0, 20, 0, 2, 0, 16, 0, 7, 0,118, 2, 7, 0,119, 2, 7, 0,120, 2, 7, 0,208, 1, 7, 0,121, 2,
- 7, 0,122, 2, 7, 0,123, 2, 4, 0,104, 2, 4, 0,107, 2, 0, 0,106, 2, 7, 0,124, 2, 7, 0,125, 2,112, 0, 7, 0,
- 96, 0, 68, 2, 2, 0,126, 2, 2, 0,127, 2, 4, 0, 54, 0, 39, 0,143, 0, 7, 0,128, 2, 0, 0, 99, 2,113, 0, 9, 0,
- 96, 0, 68, 2, 39, 0,143, 0, 7, 0,129, 2, 7, 0,130, 2, 7, 0,131, 2, 4, 0,132, 2, 4, 0,133, 2, 7, 0,134, 2,
- 0, 0, 17, 0,114, 0, 1, 0, 96, 0, 68, 2,115, 0, 5, 0, 96, 0, 68, 2,116, 0,135, 2,117, 0,136, 2,118, 0,137, 2,
-119, 0,138, 2,120, 0, 13, 0, 96, 0, 68, 2, 76, 0,139, 2, 76, 0,140, 2, 76, 0,141, 2, 76, 0,142, 2, 76, 0,143, 2,
- 76, 0,144, 2, 73, 0,145, 2, 4, 0,146, 2, 4, 0,147, 2, 4, 0, 16, 0, 7, 0,148, 2,121, 0,149, 2,122, 0, 4, 0,
- 96, 0, 68, 2, 39, 0,143, 0, 4, 0,150, 2, 4, 0, 16, 0,123, 0, 2, 0, 4, 0,151, 2, 7, 0,173, 1,124, 0, 2, 0,
- 4, 0,106, 0, 4, 0,152, 2,125, 0, 20, 0, 96, 0, 68, 2, 39, 0,143, 0, 0, 0, 99, 2, 2, 0,153, 2, 2, 0,154, 2,
- 2, 0, 20, 0, 2, 0, 16, 0, 7, 0,155, 2, 7, 0,156, 2, 4, 0,242, 1, 4, 0,157, 2,124, 0,158, 2,123, 0,159, 2,
- 4, 0,160, 2, 4, 0,161, 2, 4, 0,162, 2, 4, 0,152, 2, 7, 0,163, 2, 7, 0,164, 2, 7, 0,165, 2,126, 0, 8, 0,
- 96, 0, 68, 2,127, 0,166, 2,128, 0,167, 2, 4, 0,168, 2, 4, 0,169, 2, 4, 0,170, 2, 2, 0, 20, 0, 2, 0,163, 0,
-129, 0, 5, 0, 96, 0, 68, 2, 39, 0,241, 0, 2, 0,171, 2, 2, 0, 20, 0, 2, 0,172, 2,130, 0, 5, 0, 96, 0, 68, 2,
- 4, 0,173, 2, 2, 0, 20, 0, 2, 0,174, 2, 7, 0,175, 2,131, 0, 24, 0, 27, 0, 31, 0, 2, 0,183, 1, 2, 0,184, 1,
- 2, 0,176, 2, 2, 0, 20, 0, 2, 0,177, 2, 2, 0,178, 2, 2, 0,179, 2, 2, 0, 54, 0, 0, 0,180, 2, 0, 0,181, 2,
- 0, 0,182, 2, 0, 0, 18, 0, 4, 0, 16, 0, 7, 0,183, 2, 7, 0,184, 2, 7, 0,185, 2, 7, 0,186, 2, 7, 0,187, 2,
- 7, 0,188, 2, 64, 0,189, 2, 31, 0, 63, 0, 33, 0,204, 1, 78, 0,255, 1,132, 0, 3, 0,132, 0, 0, 0,132, 0, 1, 0,
- 0, 0, 17, 0, 61, 0, 3, 0, 7, 0,190, 2, 4, 0, 20, 0, 4, 0, 16, 0, 39, 0,103, 0, 27, 0, 31, 0, 2, 0, 18, 0,
- 2, 0,191, 2, 4, 0,192, 2, 4, 0,193, 2, 4, 0,194, 2, 0, 0,195, 2, 39, 0, 37, 0, 39, 0,196, 2, 39, 0,197, 2,
- 39, 0,198, 2, 39, 0,199, 2, 31, 0, 63, 0, 69, 0,203, 1, 61, 0,146, 1,133, 0,200, 2,133, 0,201, 2,134, 0,202, 2,
- 9, 0, 2, 0, 12, 0,203, 2, 12, 0,249, 1, 12, 0,165, 1, 12, 0,204, 2, 12, 0,205, 2, 55, 0,166, 1, 7, 0,236, 0,
- 7, 0,206, 2, 7, 0,207, 2, 7, 0,151, 0, 7, 0,208, 2, 7, 0,237, 0, 7, 0,209, 2, 7, 0,210, 2, 7, 0,129, 2,
- 7, 0,211, 2, 7, 0,187, 0, 4, 0,212, 2, 2, 0, 20, 0, 2, 0,213, 2, 2, 0,214, 2, 2, 0,215, 2, 2, 0,216, 2,
- 2, 0,217, 2, 2, 0,218, 2, 2, 0,219, 2, 2, 0,220, 2, 2, 0,221, 2, 2, 0,222, 2, 2, 0,223, 2, 4, 0,224, 2,
- 4, 0,225, 2, 4, 0,226, 2, 4, 0,227, 2, 7, 0,228, 2, 7, 0,229, 2, 7, 0,230, 2, 7, 0,231, 2, 7, 0,232, 2,
- 7, 0,233, 2, 7, 0,234, 2, 7, 0,235, 2, 0, 0,236, 2, 0, 0,237, 2, 0, 0,167, 1, 0, 0,238, 2, 0, 0,239, 2,
- 0, 0,240, 2, 7, 0,241, 2, 7, 0,242, 2, 34, 0,102, 0, 12, 0,243, 2, 12, 0,244, 2, 12, 0,245, 2, 12, 0,246, 2,
- 7, 0,247, 2, 2, 0, 37, 2, 2, 0,248, 2, 7, 0, 20, 2, 4, 0,249, 2, 4, 0,250, 2, 2, 0,251, 2, 2, 0,194, 0,
- 7, 0,252, 2, 12, 0,253, 2, 12, 0,254, 2, 12, 0,255, 2, 12, 0, 0, 3,135, 0, 1, 3,136, 0, 2, 3, 57, 0, 3, 3,
- 2, 0, 4, 3, 2, 0, 5, 3, 2, 0, 6, 3, 2, 0, 7, 3, 7, 0, 12, 2, 2, 0, 8, 3, 2, 0, 9, 3,137, 0, 10, 3,
-128, 0, 11, 3,128, 0, 12, 3, 4, 0, 13, 3, 4, 0, 16, 0, 9, 0,138, 0,138, 0, 14, 0,138, 0, 0, 0,138, 0, 1, 0,
- 39, 0, 37, 0, 7, 0,129, 2, 7, 0,238, 0, 7, 0,130, 2, 7, 0,131, 2, 0, 0, 17, 0, 4, 0,132, 2, 4, 0,133, 2,
- 4, 0, 14, 3, 2, 0, 18, 0, 2, 0, 15, 3, 7, 0,134, 2,135, 0, 33, 0, 2, 0, 16, 3, 2, 0, 17, 3, 2, 0, 20, 0,
- 2, 0,131, 2, 7, 0, 18, 3, 7, 0, 19, 3, 7, 0, 20, 3, 7, 0, 21, 3, 7, 0, 22, 3, 7, 0, 23, 3, 7, 0, 24, 3,
- 7, 0, 25, 3, 7, 0, 26, 3, 7, 0, 27, 3, 7, 0, 28, 3, 7, 0, 29, 3, 7, 0, 30, 3, 7, 0, 31, 3, 7, 0, 32, 3,
- 7, 0, 33, 3, 7, 0, 34, 3, 7, 0, 35, 3, 7, 0, 36, 3, 7, 0, 37, 3, 7, 0, 38, 3, 7, 0, 39, 3, 7, 0, 40, 3,
- 7, 0, 41, 3, 2, 0, 42, 3, 2, 0, 43, 3, 2, 0, 44, 3, 2, 0, 45, 3, 45, 0,144, 0,119, 0, 5, 0, 4, 0, 20, 0,
- 4, 0, 46, 3, 4, 0, 47, 3, 4, 0, 48, 3, 4, 0, 49, 3,139, 0, 1, 0, 7, 0,181, 1,136, 0, 44, 0,127, 0, 50, 3,
- 4, 0, 51, 3, 4, 0, 52, 3,140, 0, 53, 3,141, 0, 54, 3, 7, 0, 16, 0, 7, 0, 55, 3, 7, 0, 56, 3, 7, 0, 57, 3,
- 7, 0, 58, 3, 7, 0, 59, 3, 7, 0, 60, 3, 7, 0, 61, 3, 7, 0, 62, 3, 7, 0, 63, 3, 7, 0, 64, 3, 2, 0, 65, 3,
- 2, 0, 66, 3, 7, 0, 67, 3, 7, 0, 68, 3, 4, 0,107, 0, 4, 0, 69, 3, 4, 0, 70, 3, 2, 0, 71, 3, 2, 0, 72, 3,
-139, 0, 73, 3, 4, 0, 74, 3, 4, 0, 65, 0, 7, 0, 75, 3, 7, 0, 76, 3, 7, 0, 77, 3, 7, 0, 78, 3, 2, 0, 79, 3,
- 2, 0, 80, 3, 2, 0, 81, 3, 2, 0, 82, 3, 2, 0, 83, 3, 2, 0, 84, 3, 2, 0, 85, 3, 2, 0, 86, 3,142, 0, 87, 3,
- 7, 0, 88, 3, 7, 0, 89, 3,119, 0, 90, 3,137, 0, 40, 0, 2, 0, 18, 0, 2, 0, 91, 3, 2, 0, 92, 3, 2, 0, 93, 3,
- 7, 0, 94, 3, 2, 0, 95, 3, 2, 0, 96, 3, 7, 0, 97, 3, 2, 0, 98, 3, 2, 0, 99, 3, 7, 0,100, 3, 7, 0,101, 3,
- 7, 0,102, 3, 7, 0,103, 3, 7, 0,104, 3, 7, 0,105, 3, 4, 0,106, 3, 7, 0,107, 3, 7, 0,108, 3, 7, 0,109, 3,
- 72, 0,110, 3, 72, 0,111, 3, 72, 0,112, 3, 0, 0,113, 3, 7, 0,114, 3, 7, 0,115, 3, 31, 0, 63, 0, 2, 0,116, 3,
- 0, 0,117, 3, 0, 0,118, 3, 7, 0,119, 3, 4, 0,120, 3, 7, 0,121, 3, 7, 0,122, 3, 4, 0,123, 3, 4, 0,124, 3,
- 7, 0,125, 3, 7, 0,126, 3, 7, 0,127, 3, 76, 0,128, 3,143, 0, 66, 0, 27, 0, 31, 0, 2, 0,153, 0, 2, 0,243, 0,
- 2, 0, 17, 1, 2, 0,129, 3, 7, 0,130, 3, 7, 0,131, 3, 7, 0,132, 3, 7, 0,133, 3, 7, 0,134, 3, 7, 0,135, 3,
- 7, 0,136, 3, 7, 0,137, 3, 7, 0, 38, 1, 7, 0, 40, 1, 7, 0, 39, 1, 7, 0,138, 3, 4, 0,139, 3, 7, 0,140, 3,
- 7, 0,141, 3, 7, 0,142, 3, 7, 0,143, 3, 7, 0,144, 3, 7, 0,145, 3, 7, 0,146, 3, 2, 0,147, 3, 2, 0,242, 0,
- 4, 0,148, 3, 7, 0,149, 3, 7, 0,150, 3, 7, 0,151, 3, 7, 0,152, 3, 7, 0,153, 3, 7, 0,154, 3, 7, 0,155, 3,
- 7, 0,156, 3, 7, 0,157, 3, 7, 0,158, 3, 7, 0,159, 3, 7, 0,160, 3, 2, 0,161, 3, 2, 0,162, 3, 2, 0,163, 3,
- 2, 0,164, 3, 7, 0,165, 3, 7, 0,166, 3, 7, 0,167, 3, 7, 0,168, 3, 2, 0,169, 3, 2, 0,170, 3, 2, 0,171, 3,
- 2, 0,172, 3, 7, 0,173, 3, 7, 0,174, 3, 7, 0,175, 3, 7, 0,176, 3, 2, 0,177, 3, 2, 0,178, 3, 2, 0,179, 3,
- 2, 0, 42, 0, 7, 0,180, 3, 7, 0,181, 3, 31, 0, 63, 0, 44, 0, 31, 1, 30, 0,129, 0, 34, 0,102, 0,144, 0, 16, 0,
- 2, 0,182, 3, 2, 0,183, 3, 2, 0,184, 3, 2, 0, 20, 0, 2, 0,185, 3, 2, 0,186, 3, 2, 0,187, 3, 2, 0,188, 3,
- 2, 0,189, 3, 2, 0,190, 3, 2, 0,191, 3, 2, 0,192, 3, 4, 0,193, 3, 7, 0,194, 3, 7, 0,195, 3, 7, 0,196, 3,
-145, 0, 8, 0,145, 0, 0, 0,145, 0, 1, 0, 4, 0,212, 2, 4, 0,197, 3, 4, 0, 20, 0, 2, 0,198, 3, 2, 0,199, 3,
- 39, 0,143, 0,146, 0, 13, 0, 9, 0,200, 3, 9, 0,201, 3, 4, 0,202, 3, 4, 0,203, 3, 4, 0,204, 3, 4, 0,205, 3,
- 4, 0,206, 3, 4, 0,207, 3, 4, 0,208, 3, 4, 0,209, 3, 4, 0,210, 3, 4, 0, 16, 0, 0, 0,211, 3,147, 0, 5, 0,
- 9, 0,212, 3, 9, 0,213, 3, 4, 0,214, 3, 4, 0, 54, 0, 0, 0,215, 3,148, 0, 12, 0, 4, 0, 18, 0, 4, 0,216, 3,
- 4, 0,217, 3, 4, 0,218, 3, 4, 0,219, 3, 4, 0,220, 3, 4, 0, 75, 0, 4, 0,221, 3, 4, 0,222, 3, 4, 0,223, 3,
- 4, 0,224, 3, 4, 0,225, 3,149, 0, 4, 0, 4, 0,226, 3, 7, 0,227, 3, 2, 0, 20, 0, 2, 0,157, 0,150, 0, 11, 0,
-150, 0, 0, 0,150, 0, 1, 0, 0, 0, 17, 0, 55, 0,228, 3, 57, 0,229, 3, 4, 0,212, 2, 4, 0,230, 3, 4, 0,231, 3,
- 4, 0, 16, 0, 4, 0,232, 3, 4, 0,233, 3,151, 0,120, 0,146, 0,234, 3,147, 0,235, 3,148, 0,236, 3, 4, 0,237, 3,
- 4, 0,107, 0, 4, 0, 69, 3, 4, 0,238, 3, 4, 0,239, 3, 4, 0,240, 3, 4, 0,241, 3, 2, 0, 20, 0, 2, 0,242, 3,
- 7, 0,229, 2, 7, 0,243, 3, 7, 0,244, 3, 7, 0,245, 3, 7, 0,246, 3, 7, 0,247, 3, 2, 0,248, 3, 2, 0,249, 3,
- 2, 0,250, 3, 2, 0,251, 3, 2, 0,193, 0, 2, 0,252, 3, 2, 0,253, 3, 2, 0, 45, 3, 2, 0,254, 3, 2, 0,255, 3,
- 2, 0, 4, 1, 2, 0, 86, 0, 2, 0, 0, 4, 2, 0, 1, 4, 2, 0, 2, 4, 2, 0, 3, 4, 2, 0, 4, 4, 2, 0, 5, 4,
- 2, 0, 6, 4, 2, 0, 7, 4, 2, 0, 8, 4, 2, 0, 5, 1, 2, 0, 9, 4, 2, 0, 10, 4, 2, 0, 11, 4, 2, 0, 12, 4,
- 4, 0, 13, 4, 4, 0,242, 0, 2, 0, 14, 4, 2, 0, 15, 4, 2, 0, 16, 4, 2, 0, 17, 4, 2, 0, 18, 4, 2, 0, 19, 4,
- 24, 0, 20, 4, 24, 0, 21, 4, 23, 0, 22, 4, 12, 0, 23, 4, 2, 0, 24, 4, 2, 0, 16, 0, 7, 0, 25, 4, 7, 0, 26, 4,
- 7, 0, 27, 4, 7, 0, 28, 4, 7, 0, 29, 4, 7, 0, 30, 4, 7, 0, 31, 4, 7, 0, 32, 4, 7, 0, 33, 4, 2, 0, 34, 4,
- 2, 0, 35, 4, 2, 0, 36, 4, 2, 0, 37, 4, 2, 0, 38, 4, 2, 0, 39, 4, 7, 0, 40, 4, 7, 0, 41, 4, 7, 0, 42, 4,
- 2, 0, 43, 4, 2, 0, 44, 4, 2, 0, 45, 4, 2, 0, 46, 4, 2, 0, 47, 4, 2, 0, 48, 4, 2, 0, 49, 4, 2, 0, 50, 4,
- 2, 0, 51, 4, 2, 0, 52, 4, 4, 0, 53, 4, 4, 0, 54, 4, 4, 0, 55, 4, 4, 0, 56, 4, 4, 0, 57, 4, 7, 0, 58, 4,
- 4, 0, 59, 4, 4, 0, 60, 4, 4, 0, 61, 4, 4, 0, 62, 4, 7, 0, 63, 4, 7, 0, 64, 4, 7, 0, 65, 4, 7, 0, 66, 4,
- 7, 0, 67, 4, 7, 0, 68, 4, 7, 0, 69, 4, 7, 0, 70, 4, 7, 0, 71, 4, 0, 0, 72, 4, 0, 0, 73, 4, 4, 0, 74, 4,
- 2, 0, 75, 4, 2, 0,253, 0, 0, 0, 76, 4, 7, 0, 77, 4, 7, 0, 78, 4, 4, 0, 79, 4, 4, 0, 80, 4, 7, 0, 81, 4,
- 7, 0, 82, 4, 2, 0, 83, 4, 2, 0, 84, 4, 7, 0, 85, 4,152, 0, 9, 0,152, 0, 0, 0,152, 0, 1, 0, 0, 0, 17, 0,
- 2, 0, 86, 4, 2, 0, 87, 4, 2, 0, 88, 4, 2, 0, 42, 0, 7, 0, 89, 4, 7, 0, 54, 0,153, 0, 5, 0, 7, 0, 90, 4,
- 0, 0, 18, 0, 0, 0, 42, 0, 0, 0, 54, 0, 0, 0,253, 0,154, 0, 5, 0,154, 0, 0, 0,154, 0, 1, 0, 4, 0, 91, 4,
- 0, 0, 92, 4, 4, 0, 20, 0,155, 0, 4, 0,156, 0, 93, 4, 2, 0, 20, 0, 2, 0, 94, 4, 4, 0,253, 0,157, 0, 4, 0,
- 2, 0, 86, 0, 2, 0,101, 2, 2, 0, 95, 4, 2, 0, 96, 4,158, 0, 7, 0, 2, 0, 20, 0, 2, 0, 97, 4, 2, 0, 98, 4,
- 2, 0, 99, 4,157, 0,100, 4, 7, 0,101, 4, 4, 0,102, 4,159, 0, 4, 0,159, 0, 0, 0,159, 0, 1, 0, 0, 0,103, 4,
- 7, 0,104, 4,160, 0, 41, 0, 2, 0,105, 4, 2, 0,106, 4, 7, 0,107, 4, 7, 0,108, 4, 2, 0, 95, 4, 2, 0,109, 4,
- 7, 0,110, 4, 7, 0,111, 4, 2, 0,112, 4, 2, 0,113, 4, 2, 0,114, 4, 2, 0,115, 4, 7, 0,116, 4, 7, 0,117, 4,
- 2, 0,118, 4, 2, 0,119, 4, 2, 0,120, 4, 2, 0,121, 4,155, 0,122, 4,158, 0,123, 4, 7, 0,124, 4, 7, 0,125, 4,
- 0, 0,126, 4, 0, 0,127, 4, 0, 0,128, 4, 0, 0,129, 4, 0, 0,130, 4, 0, 0,131, 4, 2, 0,132, 4, 7, 0,133, 4,
- 7, 0,134, 4, 7, 0,135, 4, 7, 0,136, 4, 7, 0,137, 4, 7, 0,138, 4, 7, 0,139, 4, 2, 0,140, 4, 0, 0,141, 4,
- 0, 0,142, 4, 0, 0,143, 4, 0, 0,144, 4,161, 0, 6, 0, 2, 0, 86, 0, 0, 0,101, 2, 0, 0,145, 4, 0, 0,146, 4,
- 0, 0, 20, 0, 0, 0, 43, 2,162, 0, 26, 0,163, 0,147, 4, 44, 0, 31, 1, 53, 0,148, 4,161, 0,149, 4,161, 0,150, 4,
-161, 0,151, 4,161, 0,152, 4,161, 0,153, 4,161, 0,154, 4,161, 0,155, 4, 7, 0,156, 4, 2, 0,157, 4, 2, 0, 17, 1,
- 2, 0,158, 4, 2, 0,214, 1, 0, 0,159, 4, 0, 0,160, 4, 0, 0,161, 4, 0, 0,162, 4, 0, 0, 75, 0, 0, 0,163, 4,
- 0, 0,164, 4, 0, 0,165, 4, 0, 0,166, 4, 0, 0,167, 4, 0, 0, 43, 2,164, 0, 41, 0, 27, 0, 31, 0, 39, 0,168, 4,
-143, 0,169, 4,164, 0,170, 4, 41, 0,185, 0, 12, 0,171, 4,145, 0,172, 4, 7, 0,173, 4, 7, 0,174, 4, 7, 0,175, 4,
- 7, 0,176, 4, 4, 0,212, 2, 7, 0,177, 4, 2, 0,178, 4, 2, 0,179, 4, 2, 0,180, 4, 2, 0,181, 4, 2, 0,182, 4,
- 2, 0,183, 4, 2, 0,184, 4, 2, 0, 96, 1, 56, 0,117, 1, 9, 0,185, 4,144, 0,186, 4,153, 0,187, 4,160, 0,188, 4,
-151, 0,158, 0,149, 0,189, 4, 34, 0,102, 0, 12, 0,190, 4, 12, 0,191, 4, 2, 0,192, 4, 2, 0, 42, 0, 2, 0,193, 4,
- 2, 0,194, 4,165, 0,195, 4, 2, 0,196, 4, 2, 0,197, 4, 2, 0, 9, 3, 2, 0,194, 0,162, 0,198, 4,166, 0, 9, 0,
- 41, 0,185, 0, 40, 0,232, 0, 7, 0,221, 1, 7, 0,222, 1, 7, 0, 86, 0, 7, 0,199, 4, 7, 0,200, 4, 2, 0,201, 4,
- 2, 0,202, 4,167, 0, 69, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4,
- 7, 0,207, 4, 7, 0,208, 4, 7, 0,209, 4, 7, 0,210, 4, 7, 0,211, 4, 7, 0,212, 4, 7, 0,213, 4, 7, 0,245, 0,
- 7, 0,214, 4, 7, 0, 41, 0, 2, 0,215, 4, 2, 0,146, 4, 39, 0,168, 4, 39, 0,216, 4,166, 0,217, 4,167, 0,218, 4,
-170, 0,219, 4,171, 0,220, 4,172, 0,221, 4, 0, 0,222, 4, 2, 0,184, 3, 2, 0,223, 4, 4, 0,212, 2, 4, 0,224, 4,
- 2, 0,225, 4, 2, 0,226, 4, 2, 0,227, 4, 0, 0,228, 4, 0, 0, 42, 0, 7, 0, 92, 0, 7, 0,229, 4, 7, 0,230, 4,
- 7, 0,231, 4, 7, 0,232, 4, 7, 0,233, 4, 7, 0,234, 4, 7, 0,235, 4, 7, 0,150, 0, 7, 0,173, 4, 2, 0,236, 4,
- 2, 0,237, 4, 2, 0,238, 4, 2, 0,239, 4, 2, 0,114, 0, 2, 0,158, 4, 2, 0,240, 4, 2, 0,241, 4, 2, 0,242, 4,
- 2, 0,243, 4, 7, 0,244, 4, 7, 0,245, 4, 61, 0,246, 4, 12, 0,247, 4, 2, 0,248, 4, 2, 0, 21, 2, 2, 0,249, 4,
- 2, 0, 20, 0, 2, 0,250, 4, 2, 0,251, 4, 2, 0,253, 0, 0, 0,252, 4, 0, 0,253, 4, 9, 0,254, 4,173, 0, 19, 0,
- 24, 0, 36, 0, 24, 0, 45, 0, 23, 0,255, 4, 23, 0, 0, 5, 23, 0, 1, 5, 7, 0, 2, 5, 7, 0, 3, 5, 7, 0, 4, 5,
- 7, 0, 5, 5, 2, 0, 6, 5, 2, 0, 7, 5, 2, 0, 8, 5, 2, 0, 9, 5, 2, 0, 10, 5, 2, 0, 11, 5, 4, 0, 20, 0,
- 7, 0, 12, 5, 2, 0,226, 4, 0, 0, 74, 2,168, 0, 6, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,
-169, 0,205, 4, 2, 0,206, 4,174, 0, 6, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4,
- 2, 0,206, 4,175, 0, 27, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4,
- 4, 0, 13, 5, 4, 0, 54, 0,173, 0, 14, 5, 9, 0, 15, 5, 12, 0, 16, 5, 31, 0, 63, 0, 27, 0, 64, 0, 0, 0, 17, 5,
- 0, 0, 18, 5, 0, 0, 19, 5, 2, 0, 20, 5, 2, 0, 21, 5, 2, 0, 22, 5, 2, 0, 23, 5, 2, 0, 47, 0, 2, 0, 46, 0,
- 2, 0,114, 0, 2, 0, 24, 5, 4, 0, 20, 0, 7, 0, 25, 5, 24, 0, 36, 0,176, 0, 29, 0,168, 0, 0, 0,168, 0, 1, 0,
- 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4,170, 0,219, 4, 2, 0,206, 4, 2, 0, 26, 5, 2, 0, 27, 5, 2, 0, 28, 5,
- 2, 0, 29, 5,173, 0, 14, 5, 2, 0, 30, 5, 2, 0,114, 0, 2, 0, 21, 5, 2, 0, 31, 5, 9, 0, 32, 5, 2, 0,158, 4,
- 0, 0, 33, 5, 0, 0, 34, 5, 2, 0, 35, 5, 2, 0, 36, 5, 2, 0,221, 2, 2, 0, 37, 5, 2, 0, 38, 5, 0, 0, 16, 0,
- 0, 0, 20, 0, 0, 0, 17, 1, 0, 0, 39, 5,177, 0, 15, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,
-169, 0,205, 4, 2, 0,206, 4,173, 0, 14, 5, 7, 0,221, 1, 7, 0,222, 1, 2, 0, 30, 5, 2, 0, 16, 0, 2, 0, 40, 5,
- 2, 0, 41, 5, 4, 0, 20, 0, 7, 0,199, 4,178, 0, 33, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,
-169, 0,205, 4, 2, 0,206, 4,179, 0, 42, 5, 4, 0, 43, 5, 0, 0, 44, 5, 0, 0, 45, 5, 0, 0, 46, 5, 2, 0, 18, 0,
- 2, 0, 47, 5, 2, 0, 20, 0, 2, 0, 48, 5, 2, 0, 49, 5, 2, 0, 50, 5, 2, 0, 51, 5, 2, 0, 42, 0, 4, 0, 54, 0,
- 0, 0, 52, 5,180, 0, 53, 5, 2, 0, 54, 5, 2, 0, 55, 5, 2, 0, 56, 5, 2, 0,184, 0, 9, 0, 57, 5, 9, 0, 58, 5,
- 9, 0, 59, 5, 9, 0, 60, 5, 9, 0, 61, 5, 2, 0, 62, 5, 0, 0, 63, 5,181, 0, 23, 0,168, 0, 0, 0,168, 0, 1, 0,
- 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4,173, 0, 14, 5, 12, 0, 64, 5, 2, 0, 21, 5, 2, 0, 65, 5,
- 2, 0, 20, 0, 2, 0,163, 0, 9, 0, 32, 5, 12, 0, 66, 5,182, 0, 67, 5, 0, 0, 68, 5,183, 0, 69, 5, 4, 0, 70, 5,
- 4, 0, 71, 5, 2, 0, 18, 0, 2, 0, 72, 5, 2, 0, 73, 5, 2, 0, 74, 5,184, 0, 28, 0,168, 0, 0, 0,168, 0, 1, 0,
- 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4,173, 0, 14, 5, 41, 0,109, 2, 40, 0,232, 0, 53, 0,148, 4,
- 2, 0,242, 0, 2, 0,114, 0, 2, 0, 75, 5, 2, 0, 76, 5, 4, 0, 20, 0, 2, 0, 77, 5, 2, 0, 24, 5, 2, 0, 21, 5,
- 2, 0, 54, 0, 7, 0,199, 4, 0, 0, 78, 5, 0, 0, 79, 5, 0, 0, 80, 5, 0, 0, 81, 5, 7, 0,221, 1, 7, 0,222, 1,
- 7, 0, 82, 5, 7, 0, 83, 5,185, 0, 11, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4,
- 2, 0,206, 4, 2, 0,114, 0, 2, 0, 24, 5, 2, 0, 84, 5, 2, 0, 20, 0,173, 0, 14, 5,186, 0, 22, 0,168, 0, 0, 0,
-168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4, 36, 0, 85, 5, 4, 0, 86, 5, 4, 0, 87, 5,
- 2, 0, 75, 0, 2, 0,114, 0, 4, 0, 88, 5, 4, 0, 89, 5, 4, 0, 90, 5, 4, 0, 91, 5, 4, 0, 92, 5, 4, 0, 93, 5,
- 4, 0, 94, 5, 4, 0, 95, 5, 7, 0, 96, 5, 23, 0, 97, 5, 23, 0, 98, 5,187, 0, 10, 0, 27, 0, 31, 0, 9, 0, 99, 5,
- 9, 0,100, 5, 9, 0,101, 5, 9, 0,102, 5, 9, 0,103, 5, 4, 0, 75, 0, 4, 0,104, 5, 0, 0,105, 5, 0, 0,106, 5,
-188, 0, 10, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4,187, 0,107, 5, 2, 0, 75, 0,
- 2, 0,114, 0, 4, 0, 42, 0, 9, 0,108, 5,189, 0, 8, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,
-169, 0,205, 4,173, 0, 14, 5, 4, 0, 20, 0, 4, 0,109, 5,190, 0, 18, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4,
- 7, 0,204, 4,169, 0,205, 4,173, 0, 14, 5, 27, 0,110, 5, 27, 0, 64, 0, 2, 0, 20, 0, 2, 0,114, 0, 7, 0,111, 5,
- 9, 0,112, 5, 7, 0,221, 1, 7, 0,222, 1, 56, 0,117, 1, 56, 0,113, 5, 4, 0,114, 5, 4, 0, 16, 0,191, 0, 42, 0,
-168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4, 2, 0,206, 4,173, 0, 14, 5,192, 0,115, 5,
- 0, 0, 44, 5, 0, 0, 45, 5, 0, 0, 46, 5, 2, 0, 18, 0, 2, 0, 55, 5, 2, 0, 20, 0, 2, 0, 48, 5, 9, 0,112, 5,
- 4, 0,116, 5, 4, 0,117, 5, 4, 0,118, 5, 4, 0,119, 5, 23, 0,120, 5, 23, 0,121, 5, 7, 0,122, 5, 7, 0,123, 5,
- 7, 0,124, 5, 7, 0,111, 5, 2, 0, 54, 5, 2, 0,184, 0, 2, 0, 56, 1, 2, 0,125, 5, 2, 0, 16, 0, 2, 0, 42, 0,
- 2, 0,126, 5, 2, 0,127, 5, 9, 0, 57, 5, 9, 0, 58, 5, 9, 0, 59, 5, 9, 0, 60, 5, 9, 0, 61, 5, 2, 0, 62, 5,
- 0, 0, 63, 5, 50, 0,128, 5,193, 0, 20, 0, 0, 0,129, 5, 0, 0,130, 5, 0, 0,131, 5, 0, 0,132, 5, 0, 0,133, 5,
- 0, 0,134, 5, 0, 0,135, 5, 0, 0,136, 5, 0, 0,137, 5, 0, 0,138, 5, 0, 0,139, 5, 0, 0,140, 5, 0, 0,141, 5,
- 0, 0,142, 5, 0, 0,143, 5, 0, 0,144, 5, 0, 0,145, 5, 0, 0,146, 5, 0, 0,157, 0, 0, 0,147, 5,194, 0, 50, 0,
- 0, 0,148, 5, 0, 0,139, 5, 0, 0,140, 5, 0, 0,149, 5, 0, 0,150, 5, 0, 0,151, 5, 0, 0,152, 5, 0, 0,153, 5,
- 0, 0,154, 5, 0, 0,155, 5, 0, 0,156, 5, 0, 0,157, 5, 0, 0,158, 5, 0, 0,159, 5, 0, 0,160, 5, 0, 0,161, 5,
- 0, 0,162, 5, 0, 0,163, 5, 0, 0,164, 5, 0, 0,165, 5, 0, 0,166, 5, 0, 0,167, 5, 0, 0,168, 5, 0, 0,169, 5,
- 0, 0,170, 5, 0, 0,171, 5, 0, 0,172, 5, 0, 0,173, 5, 0, 0,174, 5, 0, 0,175, 5, 0, 0,176, 5, 0, 0,177, 5,
- 0, 0,178, 5, 0, 0,179, 5, 0, 0,180, 5, 0, 0,181, 5, 0, 0,182, 5, 0, 0,183, 5, 0, 0,184, 5, 0, 0,185, 5,
- 0, 0,186, 5, 0, 0,187, 5, 0, 0,188, 5, 0, 0,189, 5, 0, 0,190, 5, 0, 0,191, 5, 0, 0,192, 5, 0, 0,193, 5,
- 0, 0,194, 5, 0, 0,195, 5,195, 0, 5, 0, 0, 0,196, 5, 0, 0,156, 5, 0, 0,158, 5, 2, 0, 20, 0, 2, 0, 16, 0,
-196, 0, 22, 0,196, 0, 0, 0,196, 0, 1, 0, 0, 0, 17, 0,193, 0,197, 5,194, 0,198, 5,194, 0,199, 5,194, 0,200, 5,
-194, 0,201, 5,194, 0,202, 5,194, 0,203, 5,194, 0,204, 5,194, 0,205, 5,194, 0,206, 5,194, 0,207, 5,194, 0,208, 5,
-194, 0,209, 5,194, 0,210, 5,194, 0,211, 5,194, 0,212, 5,195, 0,213, 5, 0, 0,214, 5, 0, 0,215, 5,197, 0, 5, 0,
- 4, 0, 20, 0, 4, 0, 16, 0, 7, 0, 20, 2, 7, 0,216, 5, 7, 0,181, 1,198, 0, 61, 0, 4, 0, 20, 0, 4, 0,217, 5,
- 4, 0,218, 5, 0, 0,219, 5, 0, 0,220, 5, 0, 0,221, 5, 0, 0,222, 5, 0, 0,223, 5, 0, 0,224, 5, 0, 0,225, 5,
- 0, 0,226, 5, 0, 0,227, 5, 2, 0,228, 5, 2, 0,229, 5, 4, 0,230, 5, 4, 0,231, 5, 4, 0,232, 5, 4, 0,233, 5,
- 2, 0,234, 5, 2, 0,235, 5, 2, 0,236, 5, 2, 0,237, 5, 4, 0,238, 5, 4, 0,239, 5, 2, 0,240, 5, 2, 0,241, 5,
- 2, 0,242, 5, 2, 0,243, 5, 0, 0,244, 5, 12, 0,245, 5, 2, 0,246, 5, 2, 0,247, 5, 2, 0,248, 5, 2, 0,249, 5,
-197, 0,250, 5, 2, 0,251, 5, 2, 0,252, 5, 2, 0,253, 5, 2, 0,254, 5, 4, 0,255, 5, 4, 0, 0, 6, 4, 0, 1, 6,
- 4, 0, 2, 6, 2, 0, 3, 6, 2, 0, 4, 6, 2, 0, 5, 6, 2, 0, 6, 6, 2, 0, 7, 6, 2, 0, 8, 6, 2, 0, 9, 6,
- 2, 0, 10, 6, 2, 0, 11, 6, 2, 0, 12, 6, 2, 0, 13, 6, 0, 0, 14, 6, 0, 0, 15, 6, 0, 0, 16, 6, 7, 0, 17, 6,
- 2, 0, 18, 6, 2, 0, 19, 6, 48, 0, 20, 6,199, 0, 18, 0, 27, 0, 31, 0, 12, 0, 21, 6, 12, 0, 22, 6, 12, 0, 23, 6,
-164, 0, 24, 6, 2, 0,118, 2, 2, 0, 25, 6, 2, 0,119, 2, 2, 0, 26, 6, 2, 0, 27, 6, 2, 0, 28, 6, 2, 0, 29, 6,
- 2, 0, 30, 6, 2, 0, 31, 6, 2, 0, 16, 0, 2, 0, 32, 6, 2, 0, 33, 6, 2, 0, 34, 6,200, 0, 5, 0,200, 0, 0, 0,
-200, 0, 1, 0,200, 0, 35, 6, 13, 0, 36, 6, 4, 0, 20, 0,201, 0, 7, 0,201, 0, 0, 0,201, 0, 1, 0,200, 0, 37, 6,
-200, 0, 38, 6, 2, 0, 21, 4, 2, 0, 20, 0, 4, 0, 16, 0,202, 0, 17, 0,202, 0, 0, 0,202, 0, 1, 0, 0, 0, 39, 6,
- 0, 0, 40, 6, 0, 0, 41, 6, 2, 0, 42, 6, 2, 0, 43, 6, 2, 0, 27, 6, 2, 0, 28, 6, 2, 0, 20, 0, 2, 0, 15, 3,
- 2, 0, 44, 6, 2, 0, 45, 6, 2, 0, 46, 6, 2, 0, 47, 6, 4, 0, 48, 6,202, 0, 49, 6,169, 0, 30, 0,169, 0, 0, 0,
-169, 0, 1, 0,200, 0, 37, 6,200, 0, 38, 6,200, 0, 50, 6,200, 0, 51, 6,199, 0, 52, 6, 7, 0, 53, 6, 23, 0,240, 1,
- 23, 0, 54, 6, 23, 0, 55, 6, 2, 0, 56, 6, 2, 0, 57, 6, 2, 0, 58, 6, 0, 0,203, 4, 0, 0, 59, 6, 2, 0, 60, 6,
- 2, 0, 61, 6, 0, 0, 62, 6, 0, 0, 63, 6, 0, 0, 64, 6, 0, 0, 65, 6, 2, 0, 66, 6, 2, 0, 67, 6, 2, 0, 68, 6,
- 2, 0, 20, 0, 34, 0,102, 0, 12, 0, 69, 6, 12, 0, 70, 6, 12, 0, 71, 6,203, 0, 11, 0, 0, 0, 72, 6, 2, 0, 73, 6,
- 2, 0, 74, 6, 2, 0, 75, 6, 2, 0, 76, 6, 2, 0, 77, 6, 2, 0, 5, 4, 9, 0, 78, 6, 9, 0, 79, 6, 4, 0, 80, 6,
- 4, 0, 81, 6,204, 0, 1, 0, 0, 0, 82, 6,205, 0, 8, 0, 50, 0, 83, 6, 50, 0, 84, 6,205, 0, 85, 6,205, 0, 86, 6,
-205, 0, 87, 6, 2, 0,110, 0, 2, 0, 20, 0, 4, 0, 88, 6,206, 0, 4, 0, 4, 0, 86, 5, 4, 0, 89, 6, 4, 0, 90, 5,
- 4, 0, 90, 6,207, 0, 2, 0, 4, 0, 91, 6, 4, 0, 92, 6,208, 0, 7, 0, 7, 0, 93, 6, 7, 0, 94, 6, 7, 0, 95, 6,
- 4, 0, 20, 0, 4, 0, 16, 0, 7, 0,140, 3, 7, 0, 96, 6,209, 0, 1, 0, 0, 0, 97, 6,210, 0, 21, 0,210, 0, 0, 0,
-210, 0, 1, 0, 4, 0,163, 0, 4, 0, 23, 0, 4, 0, 28, 0, 4, 0, 98, 6, 4, 0, 99, 6, 4, 0,100, 6,204, 0,101, 6,
- 0, 0, 97, 6, 4, 0,102, 6, 4, 0,103, 6,209, 0,197, 2,206, 0,104, 6,207, 0,105, 6,208, 0,106, 6,205, 0,107, 6,
-205, 0,108, 6,205, 0,109, 6, 50, 0,110, 6, 50, 0,111, 6,211, 0, 12, 0, 0, 0,144, 1, 9, 0,170, 0, 0, 0,171, 0,
- 4, 0,174, 0, 4, 0,182, 0, 9, 0,175, 0, 7, 0,177, 0, 7, 0,178, 0, 9, 0,112, 6, 9, 0,113, 6, 9, 0,179, 0,
- 9, 0,181, 0,212, 0, 45, 0,212, 0, 0, 0,212, 0, 1, 0, 9, 0,114, 6, 9, 0, 26, 0, 0, 0, 27, 0, 4, 0, 20, 0,
- 4, 0, 18, 0, 4, 0, 23, 0, 4, 0, 75, 2, 4, 0,115, 6, 4, 0,116, 6, 4, 0, 99, 6, 4, 0,100, 6, 4, 0,117, 6,
- 4, 0,193, 0, 4, 0,118, 6, 4, 0,119, 6, 7, 0,120, 6, 7, 0,121, 6, 4, 0,107, 0, 4, 0,122, 6,210, 0,123, 6,
- 31, 0, 63, 0,164, 0, 24, 6, 42, 0,116, 0, 7, 0,124, 6, 7, 0,125, 6,211, 0,233, 0,212, 0,126, 6,212, 0,127, 6,
-212, 0,128, 6, 12, 0,129, 6,213, 0,130, 6,214, 0,131, 6, 7, 0,132, 6, 7, 0,133, 6, 4, 0,134, 6, 7, 0,135, 6,
- 9, 0,136, 6, 4, 0,137, 6, 4, 0,138, 6, 4, 0,139, 6, 7, 0,140, 6, 4, 0, 29, 6, 4, 0, 16, 0,215, 0, 4, 0,
-215, 0, 0, 0,215, 0, 1, 0, 12, 0,141, 6,212, 0,142, 6,216, 0, 6, 0, 12, 0,143, 6, 12, 0,129, 6, 12, 0,144, 6,
- 2, 0, 20, 0, 2, 0, 16, 0, 4, 0,163, 0,217, 0, 4, 0, 7, 0,145, 6, 7, 0, 89, 0, 2, 0,146, 6, 2, 0,147, 6,
-218, 0, 6, 0, 7, 0,148, 6, 7, 0,149, 6, 7, 0,150, 6, 7, 0,151, 6, 4, 0,152, 6, 4, 0,153, 6,219, 0, 12, 0,
- 7, 0,154, 6, 7, 0,155, 6, 7, 0,156, 6, 7, 0,157, 6, 7, 0,158, 6, 7, 0,159, 6, 7, 0,160, 6, 7, 0,161, 6,
- 7, 0,162, 6, 7, 0,163, 6, 4, 0,113, 2, 4, 0,164, 6,220, 0, 2, 0, 7, 0, 90, 4, 7, 0, 16, 0,221, 0, 5, 0,
- 7, 0,165, 6, 7, 0,166, 6, 4, 0, 75, 0, 4, 0, 76, 2, 4, 0,167, 6,222, 0, 6, 0,222, 0, 0, 0,222, 0, 1, 0,
- 2, 0, 18, 0, 2, 0, 20, 0, 2, 0,168, 6, 2, 0,163, 0,223, 0, 8, 0,223, 0, 0, 0,223, 0, 1, 0, 2, 0, 18, 0,
- 2, 0, 20, 0, 2, 0,168, 6, 2, 0,163, 0, 7, 0, 23, 0, 7, 0,107, 0,224, 0, 45, 0,224, 0, 0, 0,224, 0, 1, 0,
- 2, 0, 18, 0, 2, 0, 20, 0, 2, 0,168, 6, 2, 0,189, 0, 2, 0, 65, 3, 2, 0,169, 6, 7, 0,170, 6, 7, 0,171, 6,
- 7, 0,125, 2, 4, 0,172, 6, 4, 0, 65, 0, 4, 0, 78, 2, 7, 0,173, 6, 7, 0,174, 6, 7, 0,175, 6, 7, 0,176, 6,
- 7, 0,177, 6, 7, 0,178, 6, 7, 0,123, 2, 7, 0,231, 0, 7, 0,179, 6, 7, 0,180, 6, 7, 0, 16, 0, 7, 0,181, 6,
- 7, 0,182, 6, 7, 0,183, 6, 2, 0,184, 6, 2, 0,185, 6, 2, 0,186, 6, 2, 0,187, 6, 2, 0,188, 6, 2, 0,189, 6,
- 2, 0,190, 6, 2, 0,191, 6, 2, 0,250, 4, 2, 0,192, 6, 2, 0,165, 1, 2, 0,193, 6, 0, 0,194, 6, 0, 0,195, 6,
- 7, 0,187, 0,225, 0,196, 6, 57, 0,118, 1,226, 0, 16, 0,226, 0, 0, 0,226, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0,
- 2, 0,168, 6, 2, 0,189, 0, 7, 0,118, 2, 7, 0,119, 2, 7, 0,120, 2, 7, 0,208, 1, 7, 0,121, 2, 7, 0,122, 2,
- 7, 0,197, 6, 7, 0,123, 2, 7, 0,124, 2, 7, 0,125, 2,183, 0, 5, 0, 2, 0, 18, 0, 2, 0, 88, 6, 2, 0, 20, 0,
- 2, 0,198, 6, 27, 0,110, 5,182, 0, 3, 0, 4, 0, 53, 0, 4, 0,199, 6,183, 0, 2, 0,227, 0, 12, 0,227, 0, 0, 0,
-227, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 0,236, 2, 2, 0,180, 1, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0,200, 6,
- 7, 0,201, 6, 27, 0,110, 5, 12, 0,202, 6,228, 0, 11, 0,228, 0, 0, 0,228, 0, 1, 0, 0, 0, 17, 0, 2, 0, 18, 0,
- 2, 0,203, 6, 4, 0, 22, 0, 4, 0,204, 6, 2, 0, 20, 0, 2, 0, 16, 0, 9, 0,205, 6, 9, 0,206, 6,229, 0, 5, 0,
- 0, 0, 17, 0, 7, 0,245, 0, 7, 0,207, 6, 4, 0,208, 6, 4, 0, 16, 0,230, 0, 4, 0, 2, 0, 18, 0, 2, 0, 20, 0,
- 2, 0, 42, 0, 2, 0, 54, 0,231, 0, 4, 0, 0, 0, 17, 0, 55, 0,209, 6, 7, 0,245, 0, 7, 0, 16, 0,232, 0, 6, 0,
- 2, 0,210, 6, 2, 0,211, 6, 2, 0, 18, 0, 2, 0,212, 6, 0, 0,213, 6, 0, 0,214, 6,233, 0, 5, 0, 4, 0, 18, 0,
- 4, 0, 16, 0, 0, 0, 17, 0, 0, 0,215, 6, 0, 0,216, 6,234, 0, 6, 0, 0, 0, 17, 0, 0, 0,217, 6, 2, 0,218, 6,
- 2, 0,123, 2, 2, 0,242, 0, 2, 0, 54, 0,235, 0, 5, 0, 0, 0, 17, 0, 7, 0, 89, 0, 7, 0,142, 3, 2, 0, 20, 0,
- 2, 0, 89, 2,236, 0, 3, 0, 0, 0, 17, 0, 4, 0, 78, 2, 4, 0,219, 6,237, 0, 7, 0, 0, 0, 17, 0, 7, 0,142, 3,
- 0, 0,220, 6, 0, 0,221, 6, 2, 0,242, 0, 2, 0, 42, 0, 4, 0,222, 6,238, 0, 3, 0, 39, 0,223, 6, 0, 0,224, 6,
- 0, 0,225, 6,239, 0, 17, 0,239, 0, 0, 0,239, 0, 1, 0, 2, 0, 18, 0, 2, 0,203, 6, 2, 0, 20, 0, 2, 0,226, 6,
- 2, 0,227, 6, 2, 0,228, 6, 2, 0, 42, 0, 2, 0, 54, 0, 0, 0, 17, 0, 9, 0, 2, 0,240, 0,229, 6, 39, 0,241, 0,
- 2, 0, 96, 4, 2, 0,230, 6, 4, 0, 16, 0,241, 0, 10, 0, 0, 0, 17, 0, 2, 0, 18, 0, 2, 0, 16, 0, 4, 0, 89, 2,
- 4, 0,231, 6, 4, 0,232, 6, 4, 0,233, 6, 4, 0,234, 6, 4, 0,235, 6, 4, 0,236, 6,242, 0, 1, 0, 0, 0,237, 6,
-243, 0, 1, 0, 36, 0, 85, 5,240, 0, 18, 0,240, 0, 0, 0,240, 0, 1, 0,240, 0,238, 6, 2, 0, 18, 0, 2, 0, 20, 0,
- 2, 0,239, 6, 2, 0,228, 6, 2, 0,203, 6, 2, 0,240, 6, 2, 0, 54, 0, 2, 0,253, 0, 0, 0, 17, 0, 9, 0, 2, 0,
-244, 0,229, 6,239, 0,241, 6, 2, 0, 15, 0, 2, 0,242, 6, 4, 0,182, 4,245, 0, 3, 0, 4, 0,148, 2, 4, 0, 16, 0,
- 39, 0,241, 0,246, 0, 10, 0,133, 0,243, 6, 2, 0, 18, 0, 2, 0, 20, 0, 4, 0,170, 6, 4, 0,171, 6, 0, 0, 17, 0,
- 4, 0,244, 6, 2, 0,245, 6, 2, 0,246, 6, 7, 0,247, 6,247, 0, 10, 0, 2, 0, 20, 0, 2, 0,248, 6, 4, 0,170, 6,
- 4, 0,171, 6, 2, 0,249, 6,213, 0,130, 6, 2, 0, 18, 0, 2, 0,250, 6, 2, 0,251, 6, 2, 0,252, 6,248, 0, 7, 0,
- 2, 0, 20, 0, 2, 0,248, 6, 4, 0,170, 6, 4, 0,171, 6, 2, 0, 18, 0, 2, 0,253, 6, 7, 0,254, 6,249, 0, 9, 0,
- 4, 0,148, 2, 2, 0, 18, 0, 2, 0, 20, 0, 39, 0,241, 0, 72, 0,255, 6, 0, 0, 17, 0, 7, 0, 0, 7, 2, 0, 1, 7,
- 2, 0, 16, 0,250, 0, 5, 0, 2, 0, 18, 0, 2, 0, 20, 0, 4, 0, 16, 0,164, 0, 24, 6, 39, 0,168, 4,251, 0, 5, 0,
- 4, 0, 20, 0, 4, 0, 18, 0, 0, 0, 17, 0, 0, 0,215, 6, 39, 0,241, 0,252, 0, 10, 0, 4, 0, 20, 0, 4, 0, 18, 0,
- 7, 0, 2, 7, 7, 0, 3, 7, 7, 0,236, 0, 7, 0,237, 0, 7, 0,206, 2, 7, 0,209, 2, 7, 0, 4, 7, 7, 0, 5, 7,
-253, 0, 9, 0, 2, 0, 20, 0, 2, 0, 18, 0, 4, 0,170, 6, 4, 0,171, 6, 0, 0, 17, 0, 2, 0, 42, 0, 2, 0, 45, 0,
- 2, 0, 6, 7, 2, 0, 7, 7,254, 0, 8, 0, 39, 0,241, 0, 7, 0,120, 2, 7, 0, 8, 7, 7, 0, 9, 7, 7, 0,115, 2,
- 2, 0, 20, 0, 2, 0, 89, 2, 7, 0, 10, 7,255, 0, 7, 0, 2, 0, 20, 0, 2, 0,123, 2, 7, 0, 11, 7, 7, 0, 12, 7,
- 7, 0, 13, 7, 7, 0, 14, 7, 7, 0, 15, 7, 0, 1, 10, 0, 2, 0, 20, 0, 2, 0, 18, 0, 4, 0,170, 6, 4, 0,171, 6,
- 0, 0, 17, 0, 2, 0,157, 0, 2, 0, 45, 0, 2, 0, 6, 7, 2, 0, 7, 7, 57, 0,118, 1, 1, 1, 7, 0, 4, 0, 78, 2,
- 4, 0, 16, 7, 4, 0, 17, 7, 4, 0, 18, 7, 7, 0, 19, 7, 7, 0, 20, 7, 0, 0,220, 6, 2, 1, 7, 0, 0, 0, 21, 7,
- 39, 0, 22, 7, 0, 0,224, 6, 2, 0, 23, 7, 2, 0, 42, 0, 4, 0, 54, 0, 0, 0,225, 6, 3, 1, 6, 0, 2, 0, 20, 0,
- 2, 0, 18, 0, 4, 0,170, 6, 4, 0,171, 6, 0, 0, 24, 7, 0, 0, 25, 7, 4, 1, 1, 0, 4, 0, 20, 0, 5, 1, 6, 0,
- 0, 0,178, 5, 2, 0, 18, 0, 2, 0, 20, 0, 4, 0, 26, 7, 7, 0, 27, 7, 36, 0, 85, 5, 6, 1, 3, 0, 0, 0,178, 5,
- 4, 0, 18, 0, 39, 0,241, 0,244, 0, 10, 0,244, 0, 0, 0,244, 0, 1, 0,244, 0,238, 6, 2, 0, 18, 0, 2, 0, 20, 0,
- 2, 0,203, 6, 2, 0, 28, 7, 0, 0, 17, 0, 9, 0, 2, 0, 39, 0,241, 0, 7, 1, 10, 0, 7, 0,230, 2, 7, 0, 29, 7,
- 7, 0, 30, 7, 7, 0, 31, 7, 7, 0, 32, 7, 4, 0, 20, 0, 7, 0, 33, 7, 7, 0, 34, 7, 7, 0, 35, 7, 7, 0, 16, 0,
-213, 0, 20, 0, 27, 0, 31, 0, 0, 0,169, 0, 8, 1, 36, 7, 9, 0, 37, 7, 37, 0,128, 0, 37, 0, 38, 7, 9, 0, 39, 7,
- 31, 0, 63, 0, 7, 0,254, 6, 7, 0, 40, 7, 7, 0, 41, 7, 7, 0, 42, 7, 7, 0, 43, 7, 7, 0, 44, 7, 7, 0, 45, 7,
- 4, 0, 75, 0, 4, 0, 46, 7, 0, 0, 47, 7, 0, 0, 48, 7, 0, 0, 49, 7, 9, 1, 6, 0, 27, 0, 31, 0, 7, 0, 50, 7,
- 7, 0, 51, 7, 7, 0, 52, 7, 2, 0, 53, 7, 2, 0, 54, 7, 10, 1, 14, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4,
- 7, 0,204, 4,169, 0,205, 4,173, 0, 14, 5,213, 0,130, 6, 2, 0,242, 0, 2, 0,248, 6, 2, 0,221, 1, 2, 0,222, 1,
- 2, 0, 20, 0, 2, 0, 24, 5, 4, 0, 54, 0, 11, 1, 6, 0, 11, 1, 0, 0, 11, 1, 1, 0, 39, 0,241, 0, 9, 0, 55, 7,
- 4, 0,194, 0, 4, 0, 16, 0, 57, 0, 4, 0, 27, 0, 31, 0, 12, 0, 56, 7, 4, 0,112, 0, 4, 0, 16, 0, 12, 1, 25, 0,
- 12, 1, 0, 0, 12, 1, 1, 0, 12, 1, 37, 0, 12, 0, 57, 7, 0, 0, 17, 0, 7, 0, 58, 7, 7, 0, 59, 7, 7, 0, 60, 7,
- 7, 0, 61, 7, 4, 0, 20, 0, 7, 0, 62, 7, 7, 0, 63, 7, 7, 0, 64, 7, 7, 0,245, 0, 7, 0,173, 1, 7, 0, 65, 7,
- 7, 0, 76, 2, 7, 0, 66, 7, 7, 0, 67, 7, 7, 0, 68, 7, 7, 0, 69, 7, 7, 0, 70, 7, 7, 0,151, 0, 2, 0,112, 0,
- 2, 0,112, 4, 13, 1, 19, 0, 27, 0, 31, 0, 12, 0, 71, 7, 12, 0, 72, 7, 4, 0, 20, 0, 4, 0,184, 3, 2, 0,126, 2,
- 2, 0, 73, 7, 2, 0,112, 0, 2, 0, 74, 7, 2, 0, 75, 7, 2, 0, 76, 7, 2, 0, 77, 7, 2, 0, 78, 7, 4, 0, 79, 7,
- 4, 0, 80, 7, 4, 0, 81, 7, 4, 0, 82, 7, 4, 0, 83, 7, 4, 0, 84, 7, 14, 1, 34, 0, 14, 1, 0, 0, 14, 1, 1, 0,
- 12, 0,253, 2, 0, 0, 17, 0, 2, 0, 20, 0, 2, 0, 85, 7, 2, 0, 86, 7, 2, 0, 87, 7, 2, 0,219, 2, 2, 0, 88, 7,
- 4, 0,206, 1, 4, 0, 81, 7, 4, 0, 82, 7, 12, 1, 89, 7, 14, 1, 37, 0, 14, 1, 90, 7, 12, 0, 91, 7, 9, 0, 92, 7,
- 9, 0, 93, 7, 9, 0, 94, 7, 7, 0,236, 0, 7, 0,151, 0, 7, 0,155, 1, 7, 0, 95, 7, 7, 0, 96, 7, 7, 0,211, 2,
- 7, 0, 97, 7, 7, 0, 98, 7, 7, 0, 99, 7, 7, 0,100, 7, 7, 0,101, 7, 7, 0,102, 7, 7, 0,203, 1, 39, 0,103, 7,
-134, 0, 9, 0, 12, 0,104, 7, 2, 0, 20, 0, 2, 0,105, 7, 7, 0,229, 2, 7, 0,106, 7, 7, 0,107, 7, 12, 0,108, 7,
- 4, 0,109, 7, 4, 0, 16, 0, 15, 1, 7, 0, 15, 1, 0, 0, 15, 1, 1, 0, 12, 0, 47, 7, 4, 0, 20, 0, 4, 0,110, 7,
- 0, 0, 17, 0,195, 0,111, 7, 16, 1, 8, 0, 16, 1, 0, 0, 16, 1, 1, 0, 15, 1,112, 7, 31, 0, 63, 0, 12, 0,203, 2,
- 4, 0, 20, 0, 0, 0, 17, 0, 4, 0,113, 7,133, 0, 6, 0, 27, 0, 31, 0, 12, 0,104, 7, 12, 0,114, 7, 12, 0,190, 4,
- 4, 0,115, 7, 4, 0, 16, 0, 17, 1, 15, 0,168, 0, 0, 0,168, 0, 1, 0, 4, 0,203, 4, 7, 0,204, 4,169, 0,205, 4,
- 2, 0,206, 4,173, 0, 14, 5,133, 0,200, 2, 2, 0, 20, 0, 2, 0, 84, 5, 2, 0, 21, 5, 2, 0,116, 7, 2, 0, 24, 5,
- 2, 0,117, 7, 7, 0,118, 7, 18, 1, 5, 0, 18, 1, 0, 0, 18, 1, 1, 0, 31, 0, 63, 0, 2, 0, 20, 0, 0, 0,119, 7,
- 19, 1, 12, 0, 19, 1, 0, 0, 19, 1, 1, 0, 9, 0, 2, 0, 2, 0, 18, 0, 2, 0, 20, 0, 0, 0,120, 7, 0, 0,121, 7,
- 0, 0,119, 7, 7, 0,122, 7, 7, 0,123, 7, 4, 0, 16, 0, 31, 0, 63, 0, 20, 1, 9, 0, 20, 1, 0, 0, 20, 1, 1, 0,
- 39, 0,124, 7, 0, 0,125, 7, 7, 0,126, 7, 2, 0,127, 7, 2, 0, 20, 0, 2, 0, 18, 0, 2, 0, 16, 0, 21, 1, 7, 0,
- 36, 0, 85, 5, 26, 0,128, 7, 4, 0, 20, 0, 4, 0,129, 7, 12, 0,130, 7, 39, 0,124, 7, 0, 0,125, 7, 22, 1, 12, 0,
- 39, 0,124, 7, 2, 0,131, 7, 2, 0, 20, 0, 2, 0,132, 7, 2, 0,133, 7, 0, 0,125, 7, 39, 0,134, 7, 0, 0,135, 7,
- 7, 0,136, 7, 7, 0,173, 1, 7, 0,137, 7, 7, 0,138, 7, 23, 1, 6, 0, 39, 0,124, 7, 4, 0,113, 7, 4, 0,139, 7,
- 4, 0, 75, 0, 4, 0, 16, 0, 0, 0,125, 7, 24, 1, 4, 0, 39, 0,124, 7, 4, 0, 20, 0, 4, 0,113, 7, 0, 0,125, 7,
- 25, 1, 4, 0, 39, 0,124, 7, 4, 0, 20, 0, 4, 0,113, 7, 0, 0,125, 7, 26, 1, 10, 0, 39, 0,124, 7, 4, 0,140, 7,
- 7, 0,106, 0, 4, 0, 20, 0, 2, 0, 79, 5, 2, 0,141, 7, 2, 0, 42, 0, 2, 0, 54, 0, 7, 0,142, 7, 0, 0,125, 7,
- 27, 1, 4, 0, 39, 0,124, 7, 4, 0, 20, 0, 4, 0,113, 7, 0, 0,125, 7, 28, 1, 10, 0, 39, 0,124, 7, 2, 0, 18, 0,
- 2, 0, 71, 3, 4, 0, 75, 2, 4, 0,171, 6, 7, 0, 8, 7, 7, 0, 9, 7, 4, 0, 16, 0,133, 0,243, 6, 0, 0,125, 7,
- 29, 1, 4, 0, 39, 0,124, 7, 4, 0,216, 2, 4, 0,143, 7, 0, 0,125, 7, 30, 1, 5, 0, 39, 0,124, 7, 7, 0,106, 0,
- 4, 0,144, 7, 4, 0,216, 2, 4, 0,217, 2, 31, 1, 6, 0, 39, 0,124, 7, 4, 0,145, 7, 4, 0,146, 7, 7, 0,147, 7,
- 7, 0,148, 7, 0, 0,125, 7, 32, 1, 16, 0, 39, 0,124, 7, 39, 0, 90, 7, 4, 0, 18, 0, 7, 0,149, 7, 7, 0,150, 7,
- 7, 0,151, 7, 7, 0,152, 7, 7, 0,153, 7, 7, 0,154, 7, 7, 0,155, 7, 7, 0,156, 7, 7, 0,157, 7, 2, 0, 20, 0,
- 2, 0, 16, 0, 2, 0, 42, 0, 2, 0, 54, 0, 33, 1, 3, 0, 39, 0,124, 7, 4, 0, 20, 0, 4, 0,250, 4, 34, 1, 5, 0,
- 39, 0,124, 7, 4, 0, 20, 0, 4, 0, 16, 0, 7, 0,158, 7, 0, 0,125, 7, 35, 1, 10, 0, 39, 0,124, 7, 0, 0,125, 7,
- 2, 0,159, 7, 2, 0,160, 7, 0, 0,161, 7, 0, 0,162, 7, 7, 0,163, 7, 7, 0,164, 7, 7, 0,165, 7, 7, 0,166, 7,
- 36, 1, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 0,167, 7, 7, 0,168, 7, 2, 0, 20, 0,
- 2, 0,250, 4, 37, 1, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 0,167, 7, 7, 0,168, 7,
- 2, 0, 20, 0, 2, 0,250, 4, 38, 1, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 0,167, 7,
- 7, 0,168, 7, 2, 0, 20, 0, 2, 0,250, 4, 39, 1, 7, 0, 39, 0,124, 7, 0, 0,125, 7, 7, 0,245, 0, 7, 0, 0, 1,
- 2, 0, 20, 0, 2, 0,242, 0, 4, 0, 16, 0, 40, 1, 10, 0, 40, 1, 0, 0, 40, 1, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0,
- 0, 0,169, 7, 7, 0,196, 0, 7, 0,197, 0, 2, 0, 47, 7, 2, 0,170, 7, 39, 0,241, 0, 41, 1, 22, 0, 41, 1, 0, 0,
- 41, 1, 1, 0, 2, 0, 20, 0, 2, 0,242, 0, 2, 0,171, 7, 2, 0,172, 7, 31, 0, 63, 0,133, 0,243, 6, 39, 0,143, 0,
- 7, 0, 75, 2, 7, 0,171, 6, 7, 0,173, 7, 7, 0,174, 7, 7, 0,175, 7, 7, 0,176, 7, 7, 0,116, 2, 7, 0,145, 1,
- 7, 0,244, 6, 7, 0,177, 7, 0, 0,178, 7, 0, 0,179, 7, 12, 0,205, 2, 42, 1, 8, 0, 7, 0,181, 1, 7, 0, 8, 7,
- 7, 0, 9, 7, 9, 0, 2, 0, 2, 0,180, 7, 2, 0,181, 7, 2, 0,182, 7, 2, 0,183, 7, 43, 1, 18, 0, 43, 1, 0, 0,
- 43, 1, 1, 0, 43, 1,184, 7, 0, 0, 17, 0, 42, 1,185, 7, 2, 0, 18, 0, 2, 0, 20, 0, 2, 0,186, 7, 2, 0,187, 7,
- 2, 0,188, 7, 2, 0,189, 7, 4, 0, 42, 0, 7, 0,190, 7, 7, 0,191, 7, 4, 0,192, 7, 4, 0,193, 7, 43, 1,194, 7,
- 44, 1,195, 7, 45, 1, 30, 0, 45, 1, 0, 0, 45, 1, 1, 0, 45, 1,196, 7, 0, 0, 17, 0, 0, 0,197, 7, 2, 0, 18, 0,
- 2, 0, 20, 0, 2, 0, 98, 6, 2, 0,132, 6, 2, 0,198, 7, 2, 0,114, 0, 2, 0,187, 7, 2, 0, 88, 6, 12, 0,239, 6,
- 12, 0,199, 7, 27, 0,110, 5, 9, 0,200, 7, 7, 0,190, 7, 7, 0,191, 7, 7, 0,208, 1, 7, 0,201, 7, 2, 0,202, 7,
- 2, 0,203, 7, 2, 0,204, 7, 2, 0,205, 7, 24, 0,206, 7, 24, 0,207, 7, 24, 0,208, 7, 46, 1,129, 0, 47, 1,209, 7,
- 44, 1, 6, 0, 44, 1, 0, 0, 44, 1, 1, 0, 45, 1,210, 7, 45, 1,211, 7, 43, 1,212, 7, 43, 1,194, 7, 56, 0, 16, 0,
- 27, 0, 31, 0, 12, 0,213, 7, 12, 0,214, 7, 42, 1,215, 7, 12, 0,216, 7, 4, 0, 18, 0, 4, 0,217, 7, 4, 0,218, 7,
- 4, 0,219, 7, 12, 0,220, 7, 47, 1,221, 7, 43, 1,222, 7, 43, 1,223, 7, 9, 0,224, 7, 9, 0,225, 7, 4, 0,226, 7,
- 48, 1, 6, 0, 4, 0,105, 0, 4, 0,107, 0, 4, 0, 88, 6, 0, 0,227, 7, 0, 0,228, 7, 2, 0, 16, 0, 49, 1, 16, 0,
- 2, 0, 27, 6, 2, 0, 28, 6, 2, 0,229, 7, 2, 0, 30, 7, 2, 0,230, 7, 2, 0, 52, 0, 7, 0,115, 2, 7, 0,231, 7,
- 7, 0,232, 7, 2, 0, 4, 1, 0, 0,233, 7, 0, 0,196, 3, 2, 0,234, 7, 2, 0, 16, 0, 4, 0,235, 7, 4, 0,236, 7,
- 50, 1, 9, 0, 7, 0,237, 7, 7, 0,238, 7, 7, 0, 45, 7, 7, 0, 89, 0, 7, 0,239, 7, 7, 0,199, 4, 2, 0,240, 7,
- 0, 0,241, 7, 0, 0, 16, 0, 51, 1, 4, 0, 7, 0,242, 7, 7, 0,243, 7, 2, 0,240, 7, 2, 0, 16, 0, 52, 1, 3, 0,
- 7, 0,244, 7, 7, 0,245, 7, 7, 0, 15, 0, 53, 1, 7, 0, 0, 0,144, 1, 2, 0, 7, 4, 2, 0, 8, 4, 2, 0, 9, 4,
- 2, 0,216, 3, 4, 0,107, 0, 4, 0, 69, 3, 54, 1, 7, 0, 7, 0,246, 7, 7, 0,247, 7, 7, 0,248, 7, 7, 0,217, 1,
- 7, 0,249, 7, 7, 0,250, 7, 7, 0,251, 7, 55, 1, 4, 0, 2, 0,252, 7, 2, 0,253, 7, 2, 0,254, 7, 2, 0,255, 7,
- 56, 1, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0, 57, 1, 2, 0, 0, 0,145, 0, 0, 0, 0, 8, 58, 1, 1, 0, 0, 0, 17, 0,
- 59, 1, 10, 0, 0, 0, 1, 8, 0, 0, 2, 8, 0, 0, 3, 8, 0, 0, 4, 8, 2, 0,229, 7, 2, 0, 5, 8, 7, 0, 6, 8,
- 7, 0, 7, 8, 7, 0, 8, 8, 7, 0,145, 1, 60, 1, 2, 0, 9, 0, 9, 8, 9, 0, 10, 8, 61, 1, 11, 0, 0, 0, 9, 4,
- 0, 0, 18, 0, 0, 0,240, 7, 0, 0, 89, 0, 0, 0, 11, 8, 0, 0, 86, 0, 0, 0, 43, 2, 7, 0, 12, 8, 7, 0, 13, 8,
- 7, 0, 14, 8, 7, 0, 15, 8, 62, 1, 8, 0, 7, 0,210, 6, 7, 0,106, 0, 7, 0,196, 3, 7, 0, 38, 2, 7, 0, 16, 8,
- 7, 0,183, 0, 7, 0, 17, 8, 4, 0, 18, 0, 63, 1, 4, 0, 2, 0, 18, 8, 2, 0, 19, 8, 2, 0, 20, 8, 2, 0, 16, 0,
- 64, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 2, 0, 20, 0, 2, 0, 21, 8, 65, 1, 10, 0, 2, 0, 51, 3, 2, 0, 20, 0,
- 7, 0,142, 3, 7, 0, 22, 8, 7, 0, 23, 8, 7, 0, 24, 8, 7, 0, 25, 8, 64, 1, 26, 8, 64, 1, 27, 8, 64, 1, 28, 8,
- 53, 0, 9, 0, 4, 0, 20, 0, 4, 0, 45, 0, 24, 0, 29, 8, 24, 0, 30, 8, 65, 1, 31, 8, 7, 0, 32, 8, 7, 0, 33, 8,
- 7, 0, 34, 8, 7, 0, 35, 8, 66, 1, 4, 0, 41, 0,109, 2, 7, 0, 36, 8, 7, 0, 46, 1, 7, 0, 16, 0,156, 0, 13, 0,
- 27, 0, 31, 0, 2, 0, 20, 0, 2, 0,200, 4, 4, 0, 86, 0, 7, 0, 37, 8, 7, 0,214, 1, 7, 0, 38, 8, 7, 0, 39, 8,
- 7, 0, 46, 1, 2, 0, 17, 1, 2, 0, 16, 0, 44, 0, 31, 1, 66, 1, 40, 8, 67, 1, 8, 0, 4, 0, 18, 0, 4, 0,106, 0,
- 4, 0, 20, 0, 4, 0, 15, 3, 4, 0, 41, 8, 0, 0,178, 5, 0, 0, 17, 0, 9, 0, 2, 0, 82, 0, 5, 0, 67, 1, 42, 8,
- 4, 0, 43, 8, 4, 0, 44, 8, 4, 0, 45, 8, 4, 0, 16, 0, 68, 1, 5, 0, 7, 0, 34, 2, 7, 0,148, 2, 7, 0,173, 1,
- 2, 0, 46, 8, 2, 0, 16, 0, 69, 1, 5, 0, 7, 0, 34, 2, 7, 0, 47, 8, 7, 0, 48, 8, 7, 0, 49, 8, 7, 0,148, 2,
- 70, 1, 7, 0, 4, 0, 50, 8, 4, 0, 51, 8, 4, 0, 52, 8, 7, 0, 53, 8, 7, 0, 54, 8, 7, 0, 55, 8, 7, 0, 56, 8,
- 71, 1, 25, 0, 39, 0, 57, 8, 69, 1, 58, 8, 68, 1, 59, 8, 69, 1,196, 6, 7, 0, 60, 8, 7, 0, 61, 8, 7, 0, 62, 8,
- 7, 0, 63, 8, 7, 0, 54, 8, 7, 0, 55, 8, 7, 0,148, 2, 7, 0,125, 2, 7, 0, 64, 8, 7, 0, 65, 8, 7, 0, 86, 0,
- 7, 0, 66, 8, 4, 0, 50, 8, 4, 0, 67, 8, 4, 0, 16, 0, 4, 0, 65, 0, 4, 0, 68, 8, 2, 0, 20, 0, 2, 0, 69, 8,
- 2, 0, 70, 8, 2, 0, 45, 3, 72, 1,111, 0, 27, 0, 31, 0, 4, 0, 20, 0, 2, 0, 18, 0, 2, 0,159, 7, 2, 0, 71, 8,
- 2, 0, 72, 8, 2, 0, 73, 8, 2, 0, 74, 8, 2, 0, 75, 8, 2, 0, 76, 8, 2, 0, 77, 8, 2, 0, 78, 8, 2, 0, 79, 8,
- 2, 0, 80, 8, 2, 0, 81, 8, 2, 0, 82, 8, 2, 0, 83, 8, 2, 0, 84, 8, 2, 0, 85, 8, 2, 0,165, 1, 2, 0,189, 6,
- 2, 0,164, 6, 2, 0, 86, 8, 2, 0, 87, 8, 2, 0, 43, 3, 2, 0, 44, 3, 2, 0, 88, 8, 2, 0, 89, 8, 2, 0, 90, 8,
- 2, 0, 91, 8, 2, 0, 92, 8, 2, 0, 93, 8, 7, 0, 94, 8, 7, 0, 95, 8, 7, 0, 96, 8, 2, 0, 97, 8, 2, 0, 98, 8,
- 7, 0, 99, 8, 7, 0,100, 8, 7, 0,101, 8, 7, 0,170, 6, 7, 0,171, 6, 7, 0,125, 2, 7, 0,177, 6, 7, 0,102, 8,
- 7, 0,103, 8, 7, 0,104, 8, 7, 0,105, 8, 7, 0,163, 0, 4, 0,172, 6, 4, 0,169, 6, 4, 0,106, 8, 7, 0,173, 6,
- 7, 0,174, 6, 7, 0,175, 6, 7, 0,107, 8, 7, 0,108, 8, 7, 0,109, 8, 7, 0,110, 8, 7, 0,111, 8, 7, 0,112, 8,
- 7, 0,113, 8, 7, 0,114, 8, 7, 0,230, 2, 7, 0, 86, 0, 7, 0,115, 8, 7, 0,116, 8, 7, 0,117, 8, 7, 0,118, 8,
- 7, 0,119, 8, 7, 0,120, 8, 7, 0, 76, 2, 7, 0,121, 8, 7, 0,122, 8, 4, 0,123, 8, 4, 0,124, 8, 7, 0,125, 8,
- 7, 0,126, 8, 7, 0,127, 8, 7, 0,128, 8, 7, 0,129, 8, 7, 0,130, 8, 7, 0,131, 8, 7, 0,132, 8, 7, 0, 39, 3,
- 7, 0, 37, 3, 7, 0, 38, 3, 7, 0,133, 8, 7, 0,134, 8, 7, 0,135, 8, 7, 0,136, 8, 7, 0,137, 8, 7, 0,138, 8,
- 7, 0,139, 8, 7, 0,140, 8, 7, 0,141, 8, 7, 0,142, 8, 7, 0,143, 8, 7, 0,144, 8, 7, 0,145, 8, 7, 0,146, 8,
- 7, 0,147, 8, 7, 0,148, 8, 7, 0,149, 8, 0, 0,150, 8, 57, 0, 3, 3, 57, 0,151, 8, 39, 0,152, 8, 39, 0,153, 8,
- 31, 0, 63, 0,135, 0, 1, 3,127, 0, 35, 0,127, 0, 0, 0,127, 0, 1, 0, 72, 1,154, 8, 71, 1, 50, 3, 70, 1, 90, 7,
- 73, 1,155, 8, 74, 1,156, 8, 74, 1,157, 8,136, 0, 2, 3, 39, 0,158, 8, 39, 0,159, 8, 39, 0,160, 8, 12, 0,161, 8,
- 12, 0,162, 8, 7, 0,187, 0, 7, 0,237, 3, 4, 0, 78, 2, 4, 0, 20, 0, 4, 0,172, 6, 4, 0,163, 8, 4, 0,164, 8,
- 4, 0,165, 8, 4, 0,163, 0, 2, 0,194, 0, 2, 0,166, 8, 2, 0,167, 8, 2, 0,168, 8, 2, 0,251, 2, 2, 0,169, 8,
- 0, 0,170, 8, 2, 0,171, 8, 2, 0,172, 8, 2, 0,173, 8, 9, 0,174, 8,119, 0, 90, 3,117, 0, 36, 0, 2, 0,175, 8,
- 2, 0,176, 8, 7, 0, 62, 3, 4, 0,177, 8, 7, 0,178, 8, 7, 0,179, 8, 4, 0,180, 8, 7, 0,145, 3, 7, 0,181, 8,
- 7, 0,182, 8, 7, 0,181, 8, 7, 0,236, 2, 7, 0,230, 2, 7, 0,183, 8, 7, 0,216, 1, 7, 0,184, 8, 7, 0, 93, 1,
- 4, 0, 75, 0, 2, 0,185, 8, 2, 0,186, 8, 7, 0, 63, 3, 7, 0,187, 8, 7, 0,188, 8, 7, 0,189, 8, 75, 1,190, 8,
- 7, 0, 64, 3, 4, 0, 61, 3, 7, 0, 60, 3, 4, 0,191, 8, 7, 0,192, 8, 7, 0,193, 8, 7, 0,194, 8, 7, 0,195, 8,
- 2, 0,196, 8, 2, 0, 16, 0, 7, 0,197, 8,118, 0, 8, 0, 7, 0,198, 8, 7, 0,199, 8, 7, 0,119, 1, 2, 0,200, 8,
- 2, 0,201, 8, 75, 1,202, 8, 4, 0, 75, 0, 7, 0,203, 8,116, 0, 13, 0, 76, 1, 52, 2, 75, 1,204, 8, 4, 0,146, 2,
- 4, 0,205, 8, 4, 0,147, 2, 0, 0,206, 8, 0, 0, 54, 0, 2, 0,253, 0,121, 0,207, 8, 73, 0,145, 2, 77, 1,208, 8,
- 77, 1,209, 8, 78, 1,210, 8, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0};
-
diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript
deleted file mode 100644
index 2759e8ca7ff..00000000000
--- a/source/blender/src/SConscript
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/python
-Import ('env')
-
-# TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
-
-sources = env.Glob('*.c')
-
-if env['BF_SPLIT_SRC']:
- numobj = len(sources)
- maxobj = 30
-
- numlibs = numobj / maxobj
- if (numobj % maxobj):
- numlibs = numlibs + 1
- subsources = []
-
- if (env['OURPLATFORM'] == 'win32-mingw'):
- for i in range(numlibs - 1):
- subsources.append(sources[i*maxobj:(i+1)*maxobj])
- subsources.append(sources[(numlibs-1)*maxobj:])
-
-incs = ' #/intern/guardedalloc #/intern/memutil'
-incs += ' ../blenlib ../makesdna ../blenkernel'
-incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
-incs += ' #/intern/bsp/extern ../radiosity/extern/include'
-incs += ' #/intern/decimation/extern ../blenloader'
-incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes'
-incs += ' #/intern/elbeem/extern'
-incs += ' #/intern/ghost #/intern/opennl/extern'
-incs += ' ../gpu #extern/glew/include'
-
-incs += ' ' + env['BF_OPENGL_INC']
-
-defs = []
-
-if env['WITH_BF_PYTHON']:
- incs += ' ../python ' + env['BF_PYTHON_INC']
-else:
- defs.append('DISABLE_PYTHON')
-
-
-if env['BF_TWEAK_MODE']:
- defs.append('TWEAK_MODE')
-
-if not env['WITH_BF_YAFRAY']:
- defs.append('DISABLE_YAFRAY')
-
-if env['WITH_BF_INTERNATIONAL']:
- incs += ' ../ftfont'
- defs.append('INTERNATIONAL')
- defs.append('FTGL_STATIC_LIBRARY')
-
-if env['WITH_BF_OPENEXR']:
- defs.append('WITH_OPENEXR')
-
-if env['WITH_BF_DDS']:
- defs.append('WITH_DDS')
-
-if env['WITH_BF_QUICKTIME']:
- incs += ' ' + env['BF_QUICKTIME_INC']
- defs.append('WITH_QUICKTIME')
-
-if env['WITH_BF_ICONV']:
- incs += ' ../quicktime'
- incs += ' ' + env['BF_ICONV_INC']
- defs.append('WITH_ICONV')
-
-if env['WITH_BF_GAMEENGINE']:
- defs.append('GAMEBLENDER=1')
-
-if env['WITH_BF_FFMPEG']:
- defs.append('WITH_FFMPEG')
- incs += ' ' + env['BF_FFMPEG_INC']
-
-if env['WITH_BF_OGG']:
- defs.append('WITH_OGG')
-
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
- incs += ' ' + env['BF_PTHREADS_INC']
-
-if env['WITH_BF_VERSE']:
- defs.append('WITH_VERSE')
- incs += ' ' + env['BF_VERSE_INCLUDE']
-
-# TODO buildinfo
-if env['BF_BUILDINFO']:
- defs.append('NAN_BUILDINFO')
-
-if env['BF_NO_ELBEEM']:
- defs.append('DISABLE_ELBEEM')
-
-if env['WITH_BF_SDL']:
- incs += ' ' + env['BF_SDL_INC']
-else:
- defs.append('DISABLE_SDL')
-
-if env['BF_SPLIT_SRC'] and (env['OURPLATFORM'] == 'win32-mingw'):
- for i in range(numlibs):
- env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
-else:
- env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
diff --git a/source/blender/src/autoarmature.c b/source/blender/src/autoarmature.c
deleted file mode 100644
index b0a7a2ab5cc..00000000000
--- a/source/blender/src/autoarmature.c
+++ /dev/null
@@ -1,2968 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- * autoarmature.c: Interface for automagically manipulating armature (retarget, created, ...)
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_ghash.h"
-#include "BLI_graph.h"
-#include "BLI_rand.h"
-#include "BLI_threads.h"
-
-#include "BDR_editobject.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_constraint.h"
-#include "BKE_armature.h"
-
-#include "BIF_editarmature.h"
-#include "BIF_space.h"
-
-#include "PIL_time.h"
-
-#include "mydevice.h"
-#include "reeb.h" // FIX ME
-#include "blendef.h"
-
-/************ RIG RETARGET DATA STRUCTURES ***************/
-
-struct RigJoint;
-struct RigGraph;
-struct RigNode;
-struct RigArc;
-struct RigEdge;
-
-//#define USE_THREADS
-
-typedef struct RigGraph {
- ListBase arcs;
- ListBase nodes;
-
- float length;
-
- FreeArc free_arc;
- FreeNode free_node;
- RadialSymmetry radial_symmetry;
- AxialSymmetry axial_symmetry;
- /*********************************/
-
- struct RigNode *head;
- ReebGraph *link_mesh;
-
- ListBase editbones;
-
- ListBase controls;
- struct ThreadedWorker *worker;
-
- GHash *bones_map; /* map of editbones by name */
- GHash *controls_map; /* map of rigcontrols by bone pointer */
-
- Object *ob;
-} RigGraph;
-
-typedef struct RigNode {
- void *next, *prev;
- float p[3];
- int flag;
-
- int degree;
- struct BArc **arcs;
-
- int subgraph_index;
-
- int symmetry_level;
- int symmetry_flag;
- float symmetry_axis[3];
- /*********************************/
-
- ReebNode *link_mesh;
-} RigNode;
-
-typedef struct RigArc {
- void *next, *prev;
- RigNode *head, *tail;
- int flag;
-
- float length;
-
- int symmetry_level;
- int symmetry_group;
- int symmetry_flag;
- /*********************************/
-
- ListBase edges;
- int count;
- ReebArc *link_mesh;
-} RigArc;
-
-typedef struct RigEdge {
- struct RigEdge *next, *prev;
- float head[3], tail[3];
- float length;
- float angle;
- EditBone *bone;
- float up_axis[3];
-} RigEdge;
-
-/* Control flags */
-#define RIG_CTRL_DONE 1
-#define RIG_CTRL_PARENT_DEFORM 2
-#define RIG_CTRL_FIT_ROOT 4
-#define RIG_CTRL_FIT_BONE 8
-
-typedef struct RigControl {
- struct RigControl *next, *prev;
- float head[3], tail[3];
- EditBone *bone;
- EditBone *link;
- float up_axis[3];
- float offset[3];
- int flag;
-} RigControl;
-
-typedef struct MemoNode {
- float weight;
- int next;
-} MemoNode;
-
-typedef struct RetargetParam {
- RigGraph *rigg;
- RigArc *iarc;
- RigNode *inode_start;
-} RetargetParam;
-
-typedef enum
-{
- RETARGET_LENGTH,
- RETARGET_AGGRESSIVE
-} RetargetMode;
-
-typedef enum
-{
- METHOD_BRUTE_FORCE = 0,
- METHOD_MEMOIZE = 1,
- METHOD_ANNEALING = 2
-} RetargetMethod;
-
-typedef enum
-{
- ARC_FREE = 0,
- ARC_TAKEN = 1,
- ARC_USED = 2
-} ArcUsageFlags;
-
-
-RigGraph *GLOBAL_RIGG = NULL;
-
-/*******************************************************************************************************/
-
-void *exec_retargetArctoArc(void *param);
-
-static void RIG_calculateEdgeAngle(RigEdge *edge_first, RigEdge *edge_second);
-
-/* two levels */
-#define SHAPE_LEVELS (SHAPE_RADIX * SHAPE_RADIX)
-
-/*********************************** EDITBONE UTILS ****************************************************/
-
-int countEditBoneChildren(ListBase *list, EditBone *parent)
-{
- EditBone *ebone;
- int count = 0;
-
- for (ebone = list->first; ebone; ebone = ebone->next)
- {
- if (ebone->parent == parent)
- {
- count++;
- }
- }
-
- return count;
-}
-
-EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
-{
- EditBone *ebone;
-
- for (ebone = list->first; ebone; ebone = ebone->next)
- {
- if (ebone->parent == parent)
- {
- if (n == 0)
- {
- return ebone;
- }
- n--;
- }
- }
-
- return NULL;
-}
-
-void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
-{
- float mat[3][3], nor[3];
-
- VecSubf(nor, bone->tail, bone->head);
-
- vec_roll_to_mat3(nor, roll, mat);
- VECCOPY(up_axis, mat[2]);
-}
-
-float getNewBoneRoll(EditBone *bone, float old_up_axis[3], float quat[4])
-{
- float mat[3][3];
- float nor[3], up_axis[3], new_up_axis[3], vec[3];
- float roll;
-
- VECCOPY(new_up_axis, old_up_axis);
- QuatMulVecf(quat, new_up_axis);
-
- VecSubf(nor, bone->tail, bone->head);
-
- vec_roll_to_mat3(nor, 0, mat);
- VECCOPY(up_axis, mat[2]);
-
- roll = NormalizedVecAngle2(new_up_axis, up_axis);
-
- Crossf(vec, up_axis, new_up_axis);
-
- if (Inpf(vec, nor) < 0)
- {
- roll = -roll;
- }
-
- return roll;
-}
-
-/************************************ DESTRUCTORS ******************************************************/
-
-void RIG_freeRigArc(BArc *arc)
-{
- BLI_freelistN(&((RigArc*)arc)->edges);
-}
-
-void RIG_freeRigGraph(BGraph *rg)
-{
- BNode *node;
- BArc *arc;
-
-#ifdef USE_THREADS
- BLI_destroy_worker(((RigGraph*)rg)->worker);
-#endif
-
- REEB_freeGraph(((RigGraph*)rg)->link_mesh);
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RIG_freeRigArc(arc);
- }
- BLI_freelistN(&rg->arcs);
-
- for (node = rg->nodes.first; node; node = node->next)
- {
- BLI_freeNode(rg, (BNode*)node);
- }
- BLI_freelistN(&rg->nodes);
-
- BLI_freelistN(&((RigGraph*)rg)->controls);
-
- BLI_ghash_free(((RigGraph*)rg)->bones_map, NULL, NULL);
- BLI_ghash_free(((RigGraph*)rg)->controls_map, NULL, NULL);
-
- BLI_freelistN(&((RigGraph*)rg)->editbones);
-
- MEM_freeN(rg);
-}
-
-/************************************* ALLOCATORS ******************************************************/
-
-static RigGraph *newRigGraph()
-{
- RigGraph *rg;
- int totthread;
-
- rg = MEM_callocN(sizeof(RigGraph), "rig graph");
-
- rg->head = NULL;
-
- rg->bones_map = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp);
- rg->controls_map = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp);
-
- rg->free_arc = RIG_freeRigArc;
- rg->free_node = NULL;
-
-#ifdef USE_THREADS
- if(G.scene->r.mode & R_FIXED_THREADS)
- {
- totthread = G.scene->r.threads;
- }
- else
- {
- totthread = BLI_system_thread_count();
- }
-
- rg->worker = BLI_create_worker(exec_retargetArctoArc, totthread, 20); /* fix number of threads */
-#endif
-
- return rg;
-}
-
-static RigArc *newRigArc(RigGraph *rg)
-{
- RigArc *arc;
-
- arc = MEM_callocN(sizeof(RigArc), "rig arc");
- arc->count = 0;
- BLI_addtail(&rg->arcs, arc);
-
- return arc;
-}
-
-static RigControl *newRigControl(RigGraph *rg)
-{
- RigControl *ctrl;
-
- ctrl = MEM_callocN(sizeof(RigControl), "rig control");
-
- BLI_addtail(&rg->controls, ctrl);
-
- return ctrl;
-}
-
-static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3])
-{
- RigNode *node;
- node = MEM_callocN(sizeof(RigNode), "rig node");
- BLI_addtail(&rg->nodes, node);
-
- VECCOPY(node->p, p);
- node->degree = 1;
- node->arcs = NULL;
-
- arc->head = node;
-
- return node;
-}
-
-static void addRigNodeHead(RigGraph *rg, RigArc *arc, RigNode *node)
-{
- node->degree++;
-
- arc->head = node;
-}
-
-static RigNode *newRigNode(RigGraph *rg, float p[3])
-{
- RigNode *node;
- node = MEM_callocN(sizeof(RigNode), "rig node");
- BLI_addtail(&rg->nodes, node);
-
- VECCOPY(node->p, p);
- node->degree = 0;
- node->arcs = NULL;
-
- return node;
-}
-
-static RigNode *newRigNodeTail(RigGraph *rg, RigArc *arc, float p[3])
-{
- RigNode *node = newRigNode(rg, p);
-
- node->degree = 1;
- arc->tail = node;
-
- return node;
-}
-
-static void RIG_appendEdgeToArc(RigArc *arc, RigEdge *edge)
-{
- BLI_addtail(&arc->edges, edge);
-
- if (edge->prev == NULL)
- {
- VECCOPY(edge->head, arc->head->p);
- }
- else
- {
- RigEdge *last_edge = edge->prev;
- VECCOPY(edge->head, last_edge->tail);
- RIG_calculateEdgeAngle(last_edge, edge);
- }
-
- edge->length = VecLenf(edge->head, edge->tail);
-
- arc->length += edge->length;
-
- arc->count += 1;
-}
-
-static void RIG_addEdgeToArc(RigArc *arc, float tail[3], EditBone *bone)
-{
- RigEdge *edge;
-
- edge = MEM_callocN(sizeof(RigEdge), "rig edge");
-
- VECCOPY(edge->tail, tail);
- edge->bone = bone;
-
- if (bone)
- {
- getEditBoneRollUpAxis(bone, bone->roll, edge->up_axis);
- }
-
- RIG_appendEdgeToArc(arc, edge);
-}
-
-/*******************************************************************************************************/
-
-static void RIG_calculateEdgeAngle(RigEdge *edge_first, RigEdge *edge_second)
-{
- float vec_first[3], vec_second[3];
-
- VecSubf(vec_first, edge_first->tail, edge_first->head);
- VecSubf(vec_second, edge_second->tail, edge_second->head);
-
- Normalize(vec_first);
- Normalize(vec_second);
-
- edge_first->angle = saacos(Inpf(vec_first, vec_second));
-}
-
-/************************************ CONTROL BONES ****************************************************/
-
-static void RIG_addControlBone(RigGraph *rg, EditBone *bone)
-{
- RigControl *ctrl = newRigControl(rg);
- ctrl->bone = bone;
- VECCOPY(ctrl->head, bone->head);
- VECCOPY(ctrl->tail, bone->tail);
- getEditBoneRollUpAxis(bone, bone->roll, ctrl->up_axis);
-
- BLI_ghash_insert(rg->controls_map, bone->name, ctrl);
-}
-
-static int RIG_parentControl(RigControl *ctrl, EditBone *link)
-{
- if (link)
- {
- float offset[3];
- int flag = 0;
-
- VecSubf(offset, ctrl->bone->head, link->head);
-
- /* if root matches, check for direction too */
- if (Inpf(offset, offset) < 0.0001)
- {
- float vbone[3], vparent[3];
-
- flag |= RIG_CTRL_FIT_ROOT;
-
- VecSubf(vbone, ctrl->bone->tail, ctrl->bone->head);
- VecSubf(vparent, link->tail, link->head);
-
- /* test for opposite direction */
- if (Inpf(vbone, vparent) > 0)
- {
- float nor[3];
- float len;
-
- Crossf(nor, vbone, vparent);
-
- len = Inpf(nor, nor);
- if (len < 0.0001)
- {
- flag |= RIG_CTRL_FIT_BONE;
- }
- }
- }
-
- /* Bail out if old one is automatically better */
- if (flag < ctrl->flag)
- {
- return 0;
- }
-
- /* if there's already a link
- * overwrite only if new link is higher in the chain */
- if (ctrl->link && flag == ctrl->flag)
- {
- EditBone *bone = NULL;
-
- for (bone = ctrl->link; bone; bone = bone->parent)
- {
- /* if link is in the chain, break and use that one */
- if (bone == link)
- {
- break;
- }
- }
-
- /* not in chain, don't update link */
- if (bone == NULL)
- {
- return 0;
- }
- }
-
-
- ctrl->link = link;
- ctrl->flag = flag;
-
- VECCOPY(ctrl->offset, offset);
-
- return 1;
- }
-
- return 0;
-}
-
-static void RIG_reconnectControlBones(RigGraph *rg)
-{
- RigControl *ctrl;
- int change = 1;
-
- /* first pass, link to deform bones */
- for (ctrl = rg->controls.first; ctrl; ctrl = ctrl->next)
- {
- bPoseChannel *pchan;
- bConstraint *con;
- int found = 0;
-
- /* DO SOME MAGIC HERE */
- for (pchan= rg->ob->pose->chanbase.first; pchan; pchan= pchan->next)
- {
- for (con= pchan->constraints.first; con; con= con->next)
- {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets)
- {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next)
- {
- if ((ct->tar == rg->ob) && strcmp(ct->subtarget, ctrl->bone->name) == 0)
- {
- /* SET bone link to bone corresponding to pchan */
- EditBone *link = BLI_ghash_lookup(rg->bones_map, pchan->name);
-
- found = RIG_parentControl(ctrl, link);
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
-
- /* if not found yet, check parent */
- if (found == 0)
- {
- if (ctrl->bone->parent)
- {
- /* make sure parent is a deforming bone
- * NULL if not
- * */
- EditBone *link = BLI_ghash_lookup(rg->bones_map, ctrl->bone->parent->name);
-
- found = RIG_parentControl(ctrl, link);
- }
-
- /* check if bone is not superposed on another one */
- {
- RigArc *arc;
- RigArc *best_arc = NULL;
- EditBone *link = NULL;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RigEdge *edge;
- for (edge = arc->edges.first; edge; edge = edge->next)
- {
- if (edge->bone)
- {
- int fit = 0;
-
- fit = VecLenf(ctrl->bone->head, edge->bone->head) < 0.0001;
- fit = fit || VecLenf(ctrl->bone->tail, edge->bone->tail) < 0.0001;
-
- if (fit)
- {
- /* pick the bone on the arc with the lowest symmetry level
- * means you connect control to the trunk of the skeleton */
- if (best_arc == NULL || arc->symmetry_level < best_arc->symmetry_level)
- {
- best_arc = arc;
- link = edge->bone;
- }
- }
- }
- }
- }
-
- found = RIG_parentControl(ctrl, link);
- }
- }
-
- /* if not found yet, check child */
- if (found == 0)
- {
- RigArc *arc;
- RigArc *best_arc = NULL;
- EditBone *link = NULL;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RigEdge *edge;
- for (edge = arc->edges.first; edge; edge = edge->next)
- {
- if (edge->bone && edge->bone->parent == ctrl->bone)
- {
- /* pick the bone on the arc with the lowest symmetry level
- * means you connect control to the trunk of the skeleton */
- if (best_arc == NULL || arc->symmetry_level < best_arc->symmetry_level)
- {
- best_arc = arc;
- link = edge->bone;
- }
- }
- }
- }
-
- found = RIG_parentControl(ctrl, link);
- }
-
- }
-
-
- /* second pass, make chains in control bones */
- while (change)
- {
- change = 0;
-
- printf("-------------------------\n");
-
- for (ctrl = rg->controls.first; ctrl; ctrl = ctrl->next)
- {
- /* if control is not linked yet */
- if (ctrl->link == NULL)
- {
- bPoseChannel *pchan;
- bConstraint *con;
- RigControl *ctrl_parent = NULL;
- RigControl *ctrl_child;
- int found = 0;
-
- if (ctrl->bone->parent)
- {
- ctrl_parent = BLI_ghash_lookup(rg->controls_map, ctrl->bone->parent->name);
- }
-
- /* check constraints first */
-
- /* DO SOME MAGIC HERE */
- for (pchan= rg->ob->pose->chanbase.first; pchan; pchan= pchan->next)
- {
- for (con= pchan->constraints.first; con; con= con->next)
- {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets)
- {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next)
- {
- if ((ct->tar == rg->ob) && strcmp(ct->subtarget, ctrl->bone->name) == 0)
- {
- /* SET bone link to ctrl corresponding to pchan */
- RigControl *link = BLI_ghash_lookup(rg->controls_map, pchan->name);
-
- /* if owner is a control bone, link with it */
- if (link && link->link)
- {
- printf("%s -constraint- %s\n", ctrl->bone->name, link->bone->name);
- RIG_parentControl(ctrl, link->bone);
- found = 1;
- break;
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
-
- if (found == 0)
- {
- /* check if parent is already linked */
- if (ctrl_parent && ctrl_parent->link)
- {
- printf("%s -parent- %s\n", ctrl->bone->name, ctrl_parent->bone->name);
- RIG_parentControl(ctrl, ctrl_parent->bone);
- change = 1;
- }
- else
- {
- /* check childs */
- for (ctrl_child = rg->controls.first; ctrl_child; ctrl_child = ctrl_child->next)
- {
- /* if a child is linked, link to that one */
- if (ctrl_child->link && ctrl_child->bone->parent == ctrl->bone)
- {
- printf("%s -child- %s\n", ctrl->bone->name, ctrl_child->bone->name);
- RIG_parentControl(ctrl, ctrl_child->bone);
- change = 1;
- break;
- }
- }
- }
- }
- }
- }
-
- }
-}
-
-/*******************************************************************************************************/
-
-static void RIG_joinArcs(RigGraph *rg, RigNode *node, RigArc *joined_arc1, RigArc *joined_arc2)
-{
- RigEdge *edge, *next_edge;
-
- /* ignore cases where joint is at start or end */
- if (joined_arc1->head == joined_arc2->head || joined_arc1->tail == joined_arc2->tail)
- {
- return;
- }
-
- /* swap arcs to make sure arc1 is before arc2 */
- if (joined_arc1->head == joined_arc2->tail)
- {
- RigArc *tmp = joined_arc1;
- joined_arc1 = joined_arc2;
- joined_arc2 = tmp;
- }
-
- for (edge = joined_arc2->edges.first; edge; edge = next_edge)
- {
- next_edge = edge->next;
-
- RIG_appendEdgeToArc(joined_arc1, edge);
- }
-
- joined_arc1->tail = joined_arc2->tail;
-
- joined_arc2->edges.first = joined_arc2->edges.last = NULL;
-
- BLI_removeArc((BGraph*)rg, (BArc*)joined_arc2);
-
- BLI_removeNode((BGraph*)rg, (BNode*)node);
-}
-
-static void RIG_removeNormalNodes(RigGraph *rg)
-{
- RigNode *node, *next_node;
-
- for (node = rg->nodes.first; node; node = next_node)
- {
- next_node = node->next;
-
- if (node->degree == 2)
- {
- RigArc *arc, *joined_arc1 = NULL, *joined_arc2 = NULL;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (arc->head == node || arc->tail == node)
- {
- if (joined_arc1 == NULL)
- {
- joined_arc1 = arc;
- }
- else
- {
- joined_arc2 = arc;
- break;
- }
- }
- }
-
- RIG_joinArcs(rg, node, joined_arc1, joined_arc2);
- }
- }
-}
-
-static void RIG_removeUneededOffsets(RigGraph *rg)
-{
- RigArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RigEdge *first_edge, *last_edge;
-
- first_edge = arc->edges.first;
- last_edge = arc->edges.last;
-
- if (first_edge->bone == NULL)
- {
- if (first_edge->bone == NULL && VecLenf(first_edge->tail, arc->head->p) <= 0.001)
- {
- BLI_remlink(&arc->edges, first_edge);
- MEM_freeN(first_edge);
- }
- else if (arc->head->degree == 1)
- {
- RigNode *new_node = (RigNode*)BLI_FindNodeByPosition((BGraph*)rg, first_edge->tail, 0.001);
-
- if (new_node)
- {
- BLI_remlink(&arc->edges, first_edge);
- MEM_freeN(first_edge);
- BLI_replaceNodeInArc((BGraph*)rg, (BArc*)arc, (BNode*)new_node, (BNode*)arc->head);
- }
- else
- {
- RigEdge *next_edge = first_edge->next;
-
- if (next_edge)
- {
- BLI_remlink(&arc->edges, first_edge);
- MEM_freeN(first_edge);
-
- VECCOPY(arc->head->p, next_edge->head);
- }
- }
- }
- else
- {
- /* check if all arc connected start with a null edge */
- RigArc *other_arc;
- for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
- {
- if (other_arc != arc)
- {
- RigEdge *test_edge;
- if (other_arc->head == arc->head)
- {
- test_edge = other_arc->edges.first;
-
- if (test_edge->bone != NULL)
- {
- break;
- }
- }
- else if (other_arc->tail == arc->head)
- {
- test_edge = other_arc->edges.last;
-
- if (test_edge->bone != NULL)
- {
- break;
- }
- }
- }
- }
-
- if (other_arc == NULL)
- {
- RigNode *new_node = (RigNode*)BLI_FindNodeByPosition((BGraph*)rg, first_edge->tail, 0.001);
-
- if (new_node)
- {
- /* remove null edge in other arcs too */
- for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
- {
- if (other_arc != arc)
- {
- RigEdge *test_edge;
- if (other_arc->head == arc->head)
- {
- BLI_replaceNodeInArc((BGraph*)rg, (BArc*)other_arc, (BNode*)new_node, (BNode*)other_arc->head);
- test_edge = other_arc->edges.first;
- BLI_remlink(&other_arc->edges, test_edge);
- MEM_freeN(test_edge);
- }
- else if (other_arc->tail == arc->head)
- {
- BLI_replaceNodeInArc((BGraph*)rg, (BArc*)other_arc, (BNode*)new_node, (BNode*)other_arc->tail);
- test_edge = other_arc->edges.last;
- BLI_remlink(&other_arc->edges, test_edge);
- MEM_freeN(test_edge);
- }
- }
- }
-
- BLI_remlink(&arc->edges, first_edge);
- MEM_freeN(first_edge);
- BLI_replaceNodeInArc((BGraph*)rg, (BArc*)arc, (BNode*)new_node, (BNode*)arc->head);
- }
- else
- {
- RigEdge *next_edge = first_edge->next;
-
- if (next_edge)
- {
- BLI_remlink(&arc->edges, first_edge);
- MEM_freeN(first_edge);
-
- VECCOPY(arc->head->p, next_edge->head);
-
- /* remove null edge in other arcs too */
- for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
- {
- if (other_arc != arc)
- {
- RigEdge *test_edge;
- if (other_arc->head == arc->head)
- {
- test_edge = other_arc->edges.first;
- BLI_remlink(&other_arc->edges, test_edge);
- MEM_freeN(test_edge);
- }
- else if (other_arc->tail == arc->head)
- {
- test_edge = other_arc->edges.last;
- BLI_remlink(&other_arc->edges, test_edge);
- MEM_freeN(test_edge);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (last_edge->bone == NULL)
- {
- if (VecLenf(last_edge->head, arc->tail->p) <= 0.001)
- {
- BLI_remlink(&arc->edges, last_edge);
- MEM_freeN(last_edge);
- }
- else if (arc->tail->degree == 1)
- {
- RigNode *new_node = (RigNode*)BLI_FindNodeByPosition((BGraph*)rg, last_edge->head, 0.001);
-
- if (new_node)
- {
- RigEdge *previous_edge = last_edge->prev;
-
- BLI_remlink(&arc->edges, last_edge);
- MEM_freeN(last_edge);
- BLI_replaceNodeInArc((BGraph*)rg, (BArc*)arc, (BNode*)new_node, (BNode*)arc->tail);
-
- /* set previous angle to 0, since there's no following edges */
- if (previous_edge)
- {
- previous_edge->angle = 0;
- }
- }
- else
- {
- RigEdge *previous_edge = last_edge->prev;
-
- if (previous_edge)
- {
- BLI_remlink(&arc->edges, last_edge);
- MEM_freeN(last_edge);
-
- VECCOPY(arc->tail->p, previous_edge->tail);
- previous_edge->angle = 0;
- }
- }
- }
- }
- }
-}
-
-static void RIG_arcFromBoneChain(RigGraph *rg, ListBase *list, EditBone *root_bone, RigNode *starting_node)
-{
- EditBone *bone, *last_bone = root_bone;
- RigArc *arc = NULL;
- int contain_head = 0;
-
- for(bone = root_bone; bone; bone = nextEditBoneChild(list, bone, 0))
- {
- int nb_children;
-
- if ((bone->flag & BONE_NO_DEFORM) == 0)
- {
- BLI_ghash_insert(rg->bones_map, bone->name, bone);
-
- if (arc == NULL)
- {
- arc = newRigArc(rg);
-
- if (starting_node == NULL)
- {
- starting_node = newRigNodeHead(rg, arc, root_bone->head);
- }
- else
- {
- addRigNodeHead(rg, arc, starting_node);
- }
- }
-
- if (bone->parent && (bone->flag & BONE_CONNECTED) == 0)
- {
- RIG_addEdgeToArc(arc, bone->head, NULL);
- }
-
- RIG_addEdgeToArc(arc, bone->tail, bone);
-
- last_bone = bone;
-
- if (strcmp(bone->name, "head") == 0)
- {
- contain_head = 1;
- }
- }
- else if ((bone->flag & BONE_EDITMODE_LOCKED) == 0) /* ignore locked bones */
- {
- RIG_addControlBone(rg, bone);
- }
-
- nb_children = countEditBoneChildren(list, bone);
- if (nb_children > 1)
- {
- RigNode *end_node = NULL;
- int i;
-
- if (arc != NULL)
- {
- end_node = newRigNodeTail(rg, arc, bone->tail);
- }
- else
- {
- end_node = newRigNode(rg, bone->tail);
- }
-
- for (i = 0; i < nb_children; i++)
- {
- root_bone = nextEditBoneChild(list, bone, i);
- RIG_arcFromBoneChain(rg, list, root_bone, end_node);
- }
-
- /* arc ends here, break */
- break;
- }
- }
-
- /* If the loop exited without forking */
- if (arc != NULL && bone == NULL)
- {
- newRigNodeTail(rg, arc, last_bone->tail);
- }
-
- if (contain_head)
- {
- rg->head = arc->tail;
- }
-}
-
-/*******************************************************************************************************/
-static void RIG_findHead(RigGraph *rg)
-{
- if (rg->head == NULL)
- {
- if (BLI_countlist(&rg->arcs) == 1)
- {
- RigArc *arc = rg->arcs.first;
-
- rg->head = (RigNode*)arc->head;
- }
- else
- {
- RigArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RigEdge *edge = arc->edges.last;
-
- if (edge->bone->flag & (BONE_TIPSEL|BONE_SELECTED))
- {
- rg->head = arc->tail;
- break;
- }
- }
- }
-
- if (rg->head == NULL)
- {
- rg->head = rg->nodes.first;
- }
- }
-}
-
-/*******************************************************************************************************/
-
-void RIG_printNode(RigNode *node, char name[])
-{
- printf("%s %p %i <%0.3f, %0.3f, %0.3f>\n", name, node, node->degree, node->p[0], node->p[1], node->p[2]);
-
- if (node->symmetry_flag & SYM_TOPOLOGICAL)
- {
- if (node->symmetry_flag & SYM_AXIAL)
- printf("Symmetry AXIAL\n");
- else if (node->symmetry_flag & SYM_RADIAL)
- printf("Symmetry RADIAL\n");
-
- printvecf("symmetry axis", node->symmetry_axis);
- }
-}
-
-void RIG_printArcBones(RigArc *arc)
-{
- RigEdge *edge;
-
- for (edge = arc->edges.first; edge; edge = edge->next)
- {
- if (edge->bone)
- printf("%s ", edge->bone->name);
- else
- printf("---- ");
- }
- printf("\n");
-}
-
-void RIG_printCtrl(RigControl *ctrl, char *indent)
-{
- char text[128];
-
- printf("%sBone: %s\n", indent, ctrl->bone->name);
- printf("%sLink: %s\n", indent, ctrl->link ? ctrl->link->name : "!NONE!");
-
- sprintf(text, "%soffset", indent);
- printvecf(text, ctrl->offset);
-
- printf("%sFlag: %i\n", indent, ctrl->flag);
-}
-
-void RIG_printLinkedCtrl(RigGraph *rg, EditBone *bone, int tabs)
-{
- RigControl *ctrl;
- char indent[64];
- char *s = indent;
- int i;
-
- for (i = 0; i < tabs; i++)
- {
- s[0] = '\t';
- s++;
- }
- s[0] = 0;
-
- for (ctrl = rg->controls.first; ctrl; ctrl = ctrl->next)
- {
- if (ctrl->link == bone)
- {
- RIG_printCtrl(ctrl, indent);
- RIG_printLinkedCtrl(rg, ctrl->bone, tabs + 1);
- }
- }
-}
-
-void RIG_printArc(RigGraph *rg, RigArc *arc)
-{
- RigEdge *edge;
-
- RIG_printNode((RigNode*)arc->head, "head");
-
- for (edge = arc->edges.first; edge; edge = edge->next)
- {
- printf("\tinner joints %0.3f %0.3f %0.3f\n", edge->tail[0], edge->tail[1], edge->tail[2]);
- printf("\t\tlength %f\n", edge->length);
- printf("\t\tangle %f\n", edge->angle * 180 / M_PI);
- if (edge->bone)
- {
- printf("\t\t%s\n", edge->bone->name);
- RIG_printLinkedCtrl(rg, edge->bone, 3);
- }
- }
- printf("symmetry level: %i flag: %i group %i\n", arc->symmetry_level, arc->symmetry_flag, arc->symmetry_group);
-
- RIG_printNode((RigNode*)arc->tail, "tail");
-}
-
-void RIG_printGraph(RigGraph *rg)
-{
- RigArc *arc;
-
- printf("---- ARCS ----\n");
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- RIG_printArc(rg, arc);
- printf("\n");
- }
-
- if (rg->head)
- {
- RIG_printNode(rg->head, "HEAD NODE:");
- }
- else
- {
- printf("HEAD NODE: NONE\n");
- }
-}
-
-/*******************************************************************************************************/
-
-static RigGraph *armatureToGraph(Object *ob, bArmature *arm)
-{
- EditBone *ebone;
- RigGraph *rg;
-
- rg = newRigGraph();
-
- make_boneList(&rg->editbones, &arm->bonebase, NULL);
- rg->ob = ob;
-
- /* Do the rotations */
- for (ebone = rg->editbones.first; ebone; ebone=ebone->next){
- if (ebone->parent == NULL)
- {
- RIG_arcFromBoneChain(rg, &rg->editbones, ebone, NULL);
- }
- }
-
- BLI_removeDoubleNodes((BGraph*)rg, 0.001);
-
- RIG_removeNormalNodes(rg);
-
- RIG_removeUneededOffsets(rg);
-
- BLI_buildAdjacencyList((BGraph*)rg);
-
- RIG_findHead(rg);
-
- BLI_markdownSymmetry((BGraph*)rg, (BNode*)rg->head, G.scene->toolsettings->skgen_symmetry_limit);
-
- RIG_reconnectControlBones(rg); /* after symmetry, because we use levels to find best match */
-
- if (BLI_isGraphCyclic((BGraph*)rg))
- {
- printf("armature cyclic\n");
- }
-
- return rg;
-}
-
-/************************************ GENERATING *****************************************************/
-
-static EditBone *add_editbonetolist(char *name, ListBase *list)
-{
- EditBone *bone= MEM_callocN(sizeof(EditBone), "eBone");
-
- BLI_strncpy(bone->name, name, 32);
- unique_editbone_name(list, bone->name);
-
- BLI_addtail(list, bone);
-
- bone->flag |= BONE_TIPSEL;
- bone->weight= 1.0F;
- bone->dist= 0.25F;
- bone->xwidth= 0.1;
- bone->zwidth= 0.1;
- bone->ease1= 1.0;
- bone->ease2= 1.0;
- bone->rad_head= 0.10;
- bone->rad_tail= 0.05;
- bone->segments= 1;
- bone->layer= 1;//arm->layer;
-
- return bone;
-}
-
-EditBone * generateBonesForArc(RigGraph *rigg, ReebArc *arc, ReebNode *head, ReebNode *tail)
-{
- ReebArcIterator iter;
- float n[3];
- float ADAPTIVE_THRESHOLD = G.scene->toolsettings->skgen_correlation_limit;
- EditBone *lastBone = NULL;
-
- /* init iterator to get start and end from head */
- initArcIterator(&iter, arc, head);
-
- /* Calculate overall */
- VecSubf(n, arc->buckets[iter.end].p, head->p);
-
- if (1 /* G.scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION */ )
- {
- EmbedBucket *bucket = NULL;
- EmbedBucket *previous = NULL;
- EditBone *child = NULL;
- EditBone *parent = NULL;
- float normal[3] = {0, 0, 0};
- float avg_normal[3];
- int total = 0;
- int boneStart = iter.start;
-
- parent = add_editbonetolist("Bone", &rigg->editbones);
- parent->flag = BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- VECCOPY(parent->head, head->p);
-
- for (previous = nextBucket(&iter), bucket = nextBucket(&iter);
- bucket;
- previous = bucket, bucket = nextBucket(&iter))
- {
- float btail[3];
- float value = 0;
-
- if (G.scene->toolsettings->skgen_options & SKGEN_STICK_TO_EMBEDDING)
- {
- VECCOPY(btail, bucket->p);
- }
- else
- {
- float length;
-
- /* Calculate normal */
- VecSubf(n, bucket->p, parent->head);
- length = Normalize(n);
-
- total += 1;
- VecAddf(normal, normal, n);
- VECCOPY(avg_normal, normal);
- VecMulf(avg_normal, 1.0f / total);
-
- VECCOPY(btail, avg_normal);
- VecMulf(btail, length);
- VecAddf(btail, btail, parent->head);
- }
-
- if (G.scene->toolsettings->skgen_options & SKGEN_ADAPTIVE_DISTANCE)
- {
- value = calcDistance(arc, boneStart, iter.index, parent->head, btail);
- }
- else
- {
- float n[3];
-
- VecSubf(n, btail, parent->head);
- value = calcVariance(arc, boneStart, iter.index, parent->head, n);
- }
-
- if (value > ADAPTIVE_THRESHOLD)
- {
- VECCOPY(parent->tail, btail);
-
- child = add_editbonetolist("Bone", &rigg->editbones);
- VECCOPY(child->head, parent->tail);
- child->parent = parent;
- child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
-
- parent = child; // new child is next parent
- boneStart = iter.index; // start from end
-
- normal[0] = normal[1] = normal[2] = 0;
- total = 0;
- }
- }
-
- VECCOPY(parent->tail, tail->p);
-
- lastBone = parent; /* set last bone in the chain */
- }
-
- return lastBone;
-}
-
-void generateMissingArcsFromNode(RigGraph *rigg, ReebNode *node, int multi_level_limit)
-{
- while (node->multi_level > multi_level_limit && node->link_up)
- {
- node = node->link_up;
- }
-
- while (node->multi_level < multi_level_limit && node->link_down)
- {
- node = node->link_down;
- }
-
- if (node->multi_level == multi_level_limit)
- {
- int i;
-
- for (i = 0; i < node->degree; i++)
- {
- ReebArc *earc = node->arcs[i];
-
- if (earc->flag == ARC_FREE && earc->head == node)
- {
- ReebNode *other = BIF_otherNodeFromIndex(earc, node);
-
- earc->flag = ARC_USED;
-
- generateBonesForArc(rigg, earc, node, other);
- generateMissingArcsFromNode(rigg, other, multi_level_limit);
- }
- }
- }
-}
-
-void generateMissingArcs(RigGraph *rigg)
-{
- ReebGraph *reebg = rigg->link_mesh;
- int multi_level_limit = 5;
-
- for (reebg = rigg->link_mesh; reebg; reebg = reebg->link_up)
- {
- ReebArc *earc;
-
- for (earc = reebg->arcs.first; earc; earc = earc->next)
- {
- if (earc->flag == ARC_USED)
- {
- generateMissingArcsFromNode(rigg, earc->head, multi_level_limit);
- generateMissingArcsFromNode(rigg, earc->tail, multi_level_limit);
- }
- }
- }
-}
-
-/************************************ RETARGETTING *****************************************************/
-
-static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], float tail[3], float qrot[4], float resize)
-{
- RigControl *ctrl_child;
- float parent_offset[3], tail_offset[3];
-
- VecSubf(tail_offset, ctrl->tail, ctrl->head);
- VecMulf(tail_offset, resize);
-
- VECCOPY(parent_offset, ctrl->offset);
- VecMulf(parent_offset, resize);
-
- QuatMulVecf(qrot, parent_offset);
- QuatMulVecf(qrot, tail_offset);
-
- VecAddf(ctrl->bone->head, head, parent_offset);
- VecAddf(ctrl->bone->tail, ctrl->bone->head, tail_offset);
- ctrl->bone->roll = getNewBoneRoll(ctrl->bone, ctrl->up_axis, qrot);
-
- ctrl->flag |= RIG_CTRL_DONE;
-
- /* Cascade to connected control bones */
- for (ctrl_child = rigg->controls.first; ctrl_child; ctrl_child = ctrl_child->next)
- {
- if (ctrl_child->link == ctrl->bone)
- {
- repositionControl(rigg, ctrl_child, ctrl->bone->head, ctrl->bone->tail, qrot, resize);
- }
- }
-
-}
-
-static void repositionBone(RigGraph *rigg, RigEdge *edge, float vec0[3], float vec1[3])
-{
- EditBone *bone;
- RigControl *ctrl;
- float qrot[4], resize;
- float v1[3], v2[3];
- float l1, l2;
-
- bone = edge->bone;
-
- VecSubf(v1, edge->tail, edge->head);
- VecSubf(v2, vec1, vec0);
-
- l1 = Normalize(v1);
- l2 = Normalize(v2);
-
- resize = l2 / l1;
-
- RotationBetweenVectorsToQuat(qrot, v1, v2);
-
- for (ctrl = rigg->controls.first; ctrl; ctrl = ctrl->next)
- {
- if (ctrl->link == bone)
- {
- repositionControl(rigg, ctrl, vec0, vec1, qrot, resize);
- }
- }
-
- VECCOPY(bone->head, vec0);
- VECCOPY(bone->tail, vec1);
- bone->roll = getNewBoneRoll(bone, edge->up_axis, qrot);
-}
-
-static RetargetMode detectArcRetargetMode(RigArc *arc);
-static void retargetArctoArcLength(RigGraph *rigg, RigArc *iarc, RigNode *inode_start);
-
-
-static RetargetMode detectArcRetargetMode(RigArc *iarc)
-{
- RetargetMode mode = RETARGET_AGGRESSIVE;
- ReebArc *earc = iarc->link_mesh;
- RigEdge *edge;
- int large_angle = 0;
- float avg_angle = 0;
- float avg_length = 0;
- int nb_edges = 0;
-
-
- for (edge = iarc->edges.first; edge; edge = edge->next)
- {
- avg_angle += edge->angle;
- nb_edges++;
- }
-
- avg_angle /= nb_edges - 1; /* -1 because last edge doesn't have an angle */
-
- avg_length = iarc->length / nb_edges;
-
-
- if (nb_edges > 2)
- {
- for (edge = iarc->edges.first; edge; edge = edge->next)
- {
- if (fabs(edge->angle - avg_angle) > M_PI / 6)
- {
- large_angle = 1;
- }
- }
- }
- else if (nb_edges == 2 && avg_angle > 0)
- {
- large_angle = 1;
- }
-
-
- if (large_angle == 0)
- {
- mode = RETARGET_LENGTH;
- }
-
- if (earc->bcount <= (iarc->count - 1))
- {
- mode = RETARGET_LENGTH;
- }
-
- mode = RETARGET_AGGRESSIVE;
-
- return mode;
-}
-
-#ifndef USE_THREADS
-static void printCostCube(float *cost_cube, int nb_joints)
-{
- int i;
-
- for (i = 0; i < nb_joints; i++)
- {
- printf("%0.3f ", cost_cube[3 * i]);
- }
- printf("\n");
-
- for (i = 0; i < nb_joints; i++)
- {
- printf("%0.3f ", cost_cube[3 * i + 1]);
- }
- printf("\n");
-
- for (i = 0; i < nb_joints; i++)
- {
- printf("%0.3f ", cost_cube[3 * i + 2]);
- }
- printf("\n");
-}
-
-static void printMovesNeeded(int *positions, int nb_positions)
-{
- int moves = 0;
- int i;
-
- for (i = 0; i < nb_positions; i++)
- {
- moves += positions[i] - (i + 1);
- }
-
- printf("%i moves needed\n", moves);
-}
-
-static void printPositions(int *positions, int nb_positions)
-{
- int i;
-
- for (i = 0; i < nb_positions; i++)
- {
- printf("%i ", positions[i]);
- }
- printf("\n");
-}
-#endif
-
-#define MAX_COST 100 /* FIX ME */
-
-static float costDistance(ReebArcIterator *iter, float *vec0, float *vec1, int i0, int i1)
-{
- EmbedBucket *bucket = NULL;
- float max_dist = 0;
- float v1[3], v2[3], c[3];
- float v1_inpf;
-
- if (G.scene->toolsettings->skgen_retarget_distance_weight > 0)
- {
- VecSubf(v1, vec0, vec1);
-
- v1_inpf = Inpf(v1, v1);
-
- if (v1_inpf > 0)
- {
- int j;
- for (j = i0 + 1; j < i1 - 1; j++)
- {
- float dist;
-
- bucket = peekBucket(iter, j);
-
- VecSubf(v2, bucket->p, vec1);
-
- Crossf(c, v1, v2);
-
- dist = Inpf(c, c) / v1_inpf;
-
- max_dist = dist > max_dist ? dist : max_dist;
- }
-
- return G.scene->toolsettings->skgen_retarget_distance_weight * max_dist;
- }
- else
- {
- return MAX_COST;
- }
- }
- else
- {
- return 0;
- }
-}
-
-static float costAngle(float original_angle, float vec_first[3], float vec_second[3])
-{
- if (G.scene->toolsettings->skgen_retarget_angle_weight > 0)
- {
- float current_angle;
-
- if (!VecIsNull(vec_first) && !VecIsNull(vec_second))
- {
- current_angle = saacos(Inpf(vec_first, vec_second));
-
- return G.scene->toolsettings->skgen_retarget_angle_weight * fabs(current_angle - original_angle);
- }
- else
- {
- return G.scene->toolsettings->skgen_retarget_angle_weight * M_PI;
- }
- }
- else
- {
- return 0;
- }
-}
-
-static float costLength(float original_length, float current_length)
-{
- if (current_length == 0)
- {
- return MAX_COST;
- }
- else
- {
- float length_ratio = fabs((current_length - original_length) / original_length);
- return G.scene->toolsettings->skgen_retarget_length_weight * length_ratio * length_ratio;
- }
-}
-
-static float calcCostLengthDistance(ReebArcIterator *iter, float **vec_cache, RigEdge *edge, float *vec1, float *vec2, int i1, int i2)
-{
- float vec[3];
- float length;
-
- VecSubf(vec, vec2, vec1);
- length = Normalize(vec);
-
- return costLength(edge->length, length) + costDistance(iter, vec1, vec2, i1, i2);
-}
-
-static float calcCostAngleLengthDistance(ReebArcIterator *iter, float **vec_cache, RigEdge *edge, float *vec0, float *vec1, float *vec2, int i1, int i2)
-{
- float vec_second[3], vec_first[3];
- float length2;
- float new_cost = 0;
-
- VecSubf(vec_second, vec2, vec1);
- length2 = Normalize(vec_second);
-
-
- /* Angle cost */
- if (edge->prev)
- {
- VecSubf(vec_first, vec1, vec0);
- Normalize(vec_first);
-
- new_cost += costAngle(edge->prev->angle, vec_first, vec_second);
- }
-
- /* Length cost */
- new_cost += costLength(edge->length, length2);
-
- /* Distance cost */
- new_cost += costDistance(iter, vec1, vec2, i1, i2);
-
- return new_cost;
-}
-
-static float calcCost(ReebArcIterator *iter, RigEdge *e1, RigEdge *e2, float *vec0, float *vec1, float *vec2, int i0, int i1, int i2)
-{
- float vec_second[3], vec_first[3];
- float length1, length2;
- float new_cost = 0;
-
- VecSubf(vec_second, vec2, vec1);
- length2 = Normalize(vec_second);
-
- VecSubf(vec_first, vec1, vec0);
- length1 = Normalize(vec_first);
-
- /* Angle cost */
- new_cost += costAngle(e1->angle, vec_first, vec_second);
-
- /* Length cost */
- new_cost += costLength(e1->length, length1);
- new_cost += costLength(e2->length, length2);
-
- /* Distance cost */
- new_cost += costDistance(iter, vec0, vec1, i0, i1);
- new_cost += costDistance(iter, vec1, vec2, i1, i2);
-
- return new_cost;
-}
-
-static void calcGradient(RigEdge *e1, RigEdge *e2, ReebArcIterator *iter, int index, int nb_joints, float *cost_cube, int *positions, float **vec_cache)
-{
- EmbedBucket *bucket = NULL;
- float *vec0, *vec1, *vec2;
- float current_cost;
- int i0, i1, i2;
- int next_position;
-
- vec0 = vec_cache[index];
- vec1 = vec_cache[index + 1];
- vec2 = vec_cache[index + 2];
-
- if (index == 0)
- {
- i0 = 0;
- }
- else
- {
- i0 = positions[index - 1];
- }
-
- i1 = positions[index];
-
- if (index +1 == nb_joints)
- {
- i2 = iter->length;
- }
- else
- {
- i2 = positions[index + 1];
- }
-
-
- current_cost = calcCost(iter, e1, e2, vec0, vec1, vec2, i0, i1, i2);
- cost_cube[index * 3 + 1] = current_cost;
-
- next_position = positions[index] + 1;
-
- if (index + 1 < nb_joints && next_position == positions[index + 1])
- {
- cost_cube[index * 3 + 2] = MAX_COST;
- }
- else if (next_position > iter->length) /* positions are indexed at 1, so length is last */
- {
- cost_cube[index * 3 + 2] = MAX_COST;
- }
- else
- {
- bucket = peekBucket(iter, next_position);
-
- if (bucket == NULL)
- {
- cost_cube[index * 3 + 2] = MAX_COST;
- }
- else
- {
- vec1 = bucket->p;
-
- cost_cube[index * 3 + 2] = calcCost(iter, e1, e2, vec0, vec1, vec2, i0, next_position, i2) - current_cost;
- }
- }
-
- next_position = positions[index] - 1;
-
- if (index - 1 > -1 && next_position == positions[index - 1])
- {
- cost_cube[index * 3] = MAX_COST;
- }
- else if (next_position < 1) /* positions are indexed at 1, so 1 is first */
- {
- cost_cube[index * 3] = MAX_COST;
- }
- else
- {
- bucket = peekBucket(iter, next_position);
-
- if (bucket == NULL)
- {
- cost_cube[index * 3] = MAX_COST;
- }
- else
- {
- vec1 = bucket->p;
-
- cost_cube[index * 3] = calcCost(iter, e1, e2, vec0, vec1, vec2, i0, next_position, i2) - current_cost;
- }
- }
-}
-
-static float probability(float delta_cost, float temperature)
-{
- if (delta_cost < 0)
- {
- return 1;
- }
- else
- {
- return (float)exp(delta_cost / temperature);
- }
-}
-
-static int neighbour(int nb_joints, float *cost_cube, int *moving_joint, int *moving_direction)
-{
- int total = 0;
- int chosen = 0;
- int i;
-
- for (i = 0; i < nb_joints; i++)
- {
- if (cost_cube[i * 3] < MAX_COST)
- {
- total++;
- }
-
- if (cost_cube[i * 3 + 2] < MAX_COST)
- {
- total++;
- }
- }
-
- if (total == 0)
- {
- return 0;
- }
-
- chosen = (int)(BLI_drand() * total);
-
- for (i = 0; i < nb_joints; i++)
- {
- if (cost_cube[i * 3] < MAX_COST)
- {
- if (chosen == 0)
- {
- *moving_joint = i;
- *moving_direction = -1;
- break;
- }
- chosen--;
- }
-
- if (cost_cube[i * 3 + 2] < MAX_COST)
- {
- if (chosen == 0)
- {
- *moving_joint = i;
- *moving_direction = 1;
- break;
- }
- chosen--;
- }
- }
-
- return 1;
-}
-
-static int indexMemoNode(int nb_positions, int previous, int current, int joints_left)
-{
- return joints_left * nb_positions * nb_positions + current * nb_positions + previous;
-}
-
-static void copyMemoPositions(int *positions, MemoNode *table, int nb_positions, int joints_left)
-{
- int previous = 0, current = 0;
- int i = 0;
-
- for (i = 0; joints_left > 0; joints_left--, i++)
- {
- MemoNode *node;
- node = table + indexMemoNode(nb_positions, previous, current, joints_left);
-
- positions[i] = node->next;
-
- previous = current;
- current = node->next;
- }
-}
-
-static MemoNode * solveJoints(MemoNode *table, ReebArcIterator *iter, float **vec_cache, int nb_joints, int nb_positions, int previous, int current, RigEdge *edge, int joints_left)
-{
- MemoNode *node;
- int index = indexMemoNode(nb_positions, previous, current, joints_left);
-
- node = table + index;
-
- if (node->weight != 0)
- {
- return node;
- }
- else if (joints_left == 0)
- {
- float *vec1 = vec_cache[current];
- float *vec2 = vec_cache[nb_positions + 1];
-
- node->weight = calcCostLengthDistance(iter, vec_cache, edge, vec1, vec2, current, iter->length);
-
- return node;
- }
- else
- {
- MemoNode *min_node = NULL;
- float *vec0 = vec_cache[previous];
- float *vec1 = vec_cache[current];
- float min_weight;
- int min_next;
- int next;
-
- for (next = current + 1; next <= nb_positions - (joints_left - 1); next++)
- {
- MemoNode *next_node;
- float *vec2 = vec_cache[next];
- float weight = 0;
-
- /* ADD WEIGHT OF PREVIOUS - CURRENT - NEXT triple */
- weight = calcCostAngleLengthDistance(iter, vec_cache, edge, vec0, vec1, vec2, current, next);
-
- if (weight >= MAX_COST)
- {
- continue;
- }
-
- /* add node weight */
- next_node = solveJoints(table, iter, vec_cache, nb_joints, nb_positions, current, next, edge->next, joints_left - 1);
- weight += next_node->weight;
-
- if (min_node == NULL || weight < min_weight)
- {
- min_weight = weight;
- min_node = next_node;
- min_next = next;
- }
- }
-
- if (min_node)
- {
- node->weight = min_weight;
- node->next = min_next;
- return node;
- }
- else
- {
- node->weight = MAX_COST;
- return node;
- }
- }
-
-}
-
-static int testFlipArc(RigArc *iarc, RigNode *inode_start)
-{
- ReebArc *earc = iarc->link_mesh;
- ReebNode *enode_start = BIF_NodeFromIndex(earc, inode_start->link_mesh);
-
- /* no flip needed if both nodes are the same */
- if ((enode_start == earc->head && inode_start == iarc->head) || (enode_start == earc->tail && inode_start == iarc->tail))
- {
- return 0;
- }
- else
- {
- return 1;
- }
-}
-
-static void retargetArctoArcAggresive(RigGraph *rigg, RigArc *iarc, RigNode *inode_start)
-{
- ReebArcIterator iter;
- RigEdge *edge;
- EmbedBucket *bucket = NULL;
- ReebNode *node_start, *node_end;
- ReebArc *earc = iarc->link_mesh;
- float min_cost = FLT_MAX;
- float *vec0, *vec1, *vec2;
- float **vec_cache;
- float *cost_cache;
- int *best_positions;
- int *positions;
- int nb_edges = BLI_countlist(&iarc->edges);
- int nb_joints = nb_edges - 1;
- RetargetMethod method = G.scene->toolsettings->skgen_optimisation_method;
- int i;
-
- if (nb_joints > earc->bcount)
- {
- printf("NOT ENOUGH BUCKETS!\n");
- return;
- }
-
- positions = MEM_callocN(sizeof(int) * nb_joints, "Aggresive positions");
- best_positions = MEM_callocN(sizeof(int) * nb_joints, "Best Aggresive positions");
- cost_cache = MEM_callocN(sizeof(float) * nb_edges, "Cost cache");
- vec_cache = MEM_callocN(sizeof(float*) * (nb_edges + 1), "Vec cache");
-
- if (testFlipArc(iarc, inode_start))
- {
- node_start = earc->tail;
- node_end = earc->head;
- }
- else
- {
- node_start = earc->head;
- node_end = earc->tail;
- }
-
- /* init with first values */
- for (i = 0; i < nb_joints; i++)
- {
- positions[i] = i + 1;
- //positions[i] = (earc->bcount / nb_edges) * (i + 1);
- }
-
- /* init cost cache */
- for (i = 0; i < nb_edges; i++)
- {
- cost_cache[i] = 0;
- }
-
- vec_cache[0] = node_start->p;
- vec_cache[nb_edges] = node_end->p;
-
- if (method == METHOD_MEMOIZE)
- {
- int nb_positions = earc->bcount;
- int nb_memo_nodes = nb_positions * nb_positions * (nb_joints + 1);
- MemoNode *table = MEM_callocN(nb_memo_nodes * sizeof(MemoNode), "memoization table");
- MemoNode *result;
- float **positions_cache = MEM_callocN(sizeof(float*) * (nb_positions + 2), "positions cache");
- int i;
-
- positions_cache[0] = node_start->p;
- positions_cache[nb_positions + 1] = node_end->p;
-
- initArcIterator(&iter, earc, node_start);
-
- for (i = 1; i <= nb_positions; i++)
- {
- EmbedBucket *bucket = peekBucket(&iter, i);
- positions_cache[i] = bucket->p;
- }
-
- result = solveJoints(table, &iter, positions_cache, nb_joints, earc->bcount, 0, 0, iarc->edges.first, nb_joints);
-
- min_cost = result->weight;
- copyMemoPositions(best_positions, table, earc->bcount, nb_joints);
-
- MEM_freeN(table);
- MEM_freeN(positions_cache);
- }
- /* BRUTE FORCE */
- else if (method == METHOD_BRUTE_FORCE)
- {
- int last_index = 0;
- int first_pass = 1;
- int must_move = nb_joints - 1;
-
- while(1)
- {
- float cost = 0;
- int need_calc = 0;
-
- /* increment to next possible solution */
-
- i = nb_joints - 1;
-
- if (first_pass)
- {
- need_calc = 0;
- first_pass = 0;
- }
- else
- {
- /* increment positions, starting from the last one
- * until a valid increment is found
- * */
- for (i = must_move; i >= 0; i--)
- {
- int remaining_joints = nb_joints - (i + 1);
-
- positions[i] += 1;
- need_calc = i;
-
- if (positions[i] + remaining_joints <= earc->bcount)
- {
- break;
- }
- }
- }
-
- if (i == -1)
- {
- break;
- }
-
- /* reset joints following the last increment*/
- for (i = i + 1; i < nb_joints; i++)
- {
- positions[i] = positions[i - 1] + 1;
- }
-
- /* calculating cost */
- initArcIterator(&iter, earc, node_start);
-
- vec0 = NULL;
- vec1 = node_start->p;
- vec2 = NULL;
-
- for (edge = iarc->edges.first, i = 0, last_index = 0;
- edge;
- edge = edge->next, i += 1)
- {
-
- if (i >= need_calc)
- {
- float vec_first[3], vec_second[3];
- float length1, length2;
- float new_cost = 0;
- int i1, i2;
-
- if (i < nb_joints)
- {
- i2 = positions[i];
- bucket = peekBucket(&iter, positions[i]);
- vec2 = bucket->p;
- vec_cache[i + 1] = vec2; /* update cache for updated position */
- }
- else
- {
- i2 = iter.length;
- vec2 = node_end->p;
- }
-
- if (i > 0)
- {
- i1 = positions[i - 1];
- }
- else
- {
- i1 = 1;
- }
-
- vec1 = vec_cache[i];
-
-
- VecSubf(vec_second, vec2, vec1);
- length2 = Normalize(vec_second);
-
- /* check angle */
- if (i != 0 && G.scene->toolsettings->skgen_retarget_angle_weight > 0)
- {
- RigEdge *previous = edge->prev;
-
- vec0 = vec_cache[i - 1];
- VecSubf(vec_first, vec1, vec0);
- length1 = Normalize(vec_first);
-
- /* Angle cost */
- new_cost += costAngle(previous->angle, vec_first, vec_second);
- }
-
- /* Length Cost */
- new_cost += costLength(edge->length, length2);
-
- /* Distance Cost */
- new_cost += costDistance(&iter, vec1, vec2, i1, i2);
-
- cost_cache[i] = new_cost;
- }
-
- cost += cost_cache[i];
-
- if (cost > min_cost)
- {
- must_move = i;
- break;
- }
- }
-
- if (must_move != i || must_move > nb_joints - 1)
- {
- must_move = nb_joints - 1;
- }
-
- /* cost optimizing */
- if (cost < min_cost)
- {
- min_cost = cost;
- memcpy(best_positions, positions, sizeof(int) * nb_joints);
- }
- }
- }
- /* SIMULATED ANNEALING */
- else if (method == METHOD_ANNEALING)
- {
- RigEdge *previous;
- float *cost_cube;
- float cost;
- int k;
- int kmax;
-
- kmax = 100000;
-
- BLI_srand(nb_joints);
-
- /* [joint: index][position: -1, 0, +1] */
- cost_cube = MEM_callocN(sizeof(float) * 3 * nb_joints, "Cost Cube");
-
- initArcIterator(&iter, earc, node_start);
-
- /* init vec_cache */
- for (i = 0; i < nb_joints; i++)
- {
- bucket = peekBucket(&iter, positions[i]);
- vec_cache[i + 1] = bucket->p;
- }
-
- cost = 0;
-
- /* init cost cube */
- for (previous = iarc->edges.first, edge = previous->next, i = 0;
- edge;
- previous = edge, edge = edge->next, i += 1)
- {
- calcGradient(previous, edge, &iter, i, nb_joints, cost_cube, positions, vec_cache);
-
- cost += cost_cube[3 * i + 1];
- }
-
-#ifndef USE_THREADS
- printf("initial cost: %f\n", cost);
- printf("kmax: %i\n", kmax);
-#endif
-
- for (k = 0; k < kmax; k++)
- {
- int status;
- int moving_joint = -1;
- int move_direction = -1;
- float delta_cost;
- float temperature;
-
- status = neighbour(nb_joints, cost_cube, &moving_joint, &move_direction);
-
- if (status == 0)
- {
- /* if current state is still a minimum, copy it */
- if (cost < min_cost)
- {
- min_cost = cost;
- memcpy(best_positions, positions, sizeof(int) * nb_joints);
- }
- break;
- }
-
- delta_cost = cost_cube[moving_joint * 3 + (1 + move_direction)];
-
- temperature = 1 - (float)k / (float)kmax;
- if (probability(delta_cost, temperature) > BLI_frand())
- {
- /* update position */
- positions[moving_joint] += move_direction;
-
- /* update vector cache */
- bucket = peekBucket(&iter, positions[moving_joint]);
- vec_cache[moving_joint + 1] = bucket->p;
-
- cost += delta_cost;
-
- /* cost optimizing */
- if (cost < min_cost)
- {
- min_cost = cost;
- memcpy(best_positions, positions, sizeof(int) * nb_joints);
- }
-
- /* update cost cube */
- for (previous = iarc->edges.first, edge = previous->next, i = 0;
- edge;
- previous = edge, edge = edge->next, i += 1)
- {
- if (i == moving_joint - 1 ||
- i == moving_joint ||
- i == moving_joint + 1)
- {
- calcGradient(previous, edge, &iter, i, nb_joints, cost_cube, positions, vec_cache);
- }
- }
- }
- }
-
- //min_cost = cost;
- //memcpy(best_positions, positions, sizeof(int) * nb_joints);
-
-// printf("k = %i\n", k);
-
-
- MEM_freeN(cost_cube);
- }
-
-
- vec0 = node_start->p;
- initArcIterator(&iter, earc, node_start);
-
-#ifndef USE_THREADS
- printPositions(best_positions, nb_joints);
- printMovesNeeded(best_positions, nb_joints);
- printf("min_cost %f\n", min_cost);
- printf("buckets: %i\n", earc->bcount);
-#endif
-
- /* set joints to best position */
- for (edge = iarc->edges.first, i = 0;
- edge;
- edge = edge->next, i++)
- {
- if (i < nb_joints)
- {
- bucket = peekBucket(&iter, best_positions[i]);
- vec1 = bucket->p;
- }
- else
- {
- vec1 = node_end->p;
- }
-
- if (edge->bone)
- {
- repositionBone(rigg, edge, vec0, vec1);
- }
-
- vec0 = vec1;
- }
-
- MEM_freeN(positions);
- MEM_freeN(best_positions);
- MEM_freeN(cost_cache);
- MEM_freeN(vec_cache);
-}
-
-static void retargetArctoArcLength(RigGraph *rigg, RigArc *iarc, RigNode *inode_start)
-{
- ReebArcIterator iter;
- ReebArc *earc = iarc->link_mesh;
- ReebNode *node_start, *node_end;
- RigEdge *edge;
- EmbedBucket *bucket = NULL;
- float embedding_length = 0;
- float *vec0 = NULL;
- float *vec1 = NULL;
- float *previous_vec = NULL;
-
-
- if (testFlipArc(iarc, inode_start))
- {
- node_start = (ReebNode*)earc->tail;
- node_end = (ReebNode*)earc->head;
- }
- else
- {
- node_start = (ReebNode*)earc->head;
- node_end = (ReebNode*)earc->tail;
- }
-
- initArcIterator(&iter, earc, node_start);
-
- bucket = nextBucket(&iter);
-
- vec0 = node_start->p;
-
- while (bucket != NULL)
- {
- vec1 = bucket->p;
-
- embedding_length += VecLenf(vec0, vec1);
-
- vec0 = vec1;
- bucket = nextBucket(&iter);
- }
-
- embedding_length += VecLenf(node_end->p, vec1);
-
- /* fit bones */
- initArcIterator(&iter, earc, node_start);
-
- bucket = nextBucket(&iter);
-
- vec0 = node_start->p;
- previous_vec = vec0;
- vec1 = bucket->p;
-
- for (edge = iarc->edges.first; edge; edge = edge->next)
- {
- float new_bone_length = edge->length / iarc->length * embedding_length;
-
- float length = 0;
-
- while (bucket && new_bone_length > length)
- {
- length += VecLenf(previous_vec, vec1);
- bucket = nextBucket(&iter);
- previous_vec = vec1;
- vec1 = bucket->p;
- }
-
- if (bucket == NULL)
- {
- vec1 = node_end->p;
- }
-
- /* no need to move virtual edges (space between unconnected bones) */
- if (edge->bone)
- {
- repositionBone(rigg, edge, vec0, vec1);
- }
-
- vec0 = vec1;
- previous_vec = vec1;
- }
-}
-
-static void retargetArctoArc(RigGraph *rigg, RigArc *iarc, RigNode *inode_start)
-{
-#ifdef USE_THREADS
- RetargetParam *p = MEM_callocN(sizeof(RetargetParam), "RetargetParam");
-
- p->rigg = rigg;
- p->iarc = iarc;
- p->inode_start = inode_start;
-
- BLI_insert_work(rigg->worker, p);
-#else
- RetargetParam p;
-
- p.rigg = rigg;
- p.iarc = iarc;
- p.inode_start = inode_start;
-
- exec_retargetArctoArc(&p);
-#endif
-}
-
-void *exec_retargetArctoArc(void *param)
-{
- RetargetParam *p = (RetargetParam*)param;
- RigGraph *rigg = p->rigg;
- RigArc *iarc = p->iarc;
- RigNode *inode_start = p->inode_start;
- ReebArc *earc = iarc->link_mesh;
-
- if (BLI_countlist(&iarc->edges) == 1)
- {
- RigEdge *edge = iarc->edges.first;
-
- if (testFlipArc(iarc, inode_start))
- {
- repositionBone(rigg, edge, earc->tail->p, earc->head->p);
- }
- else
- {
- repositionBone(rigg, edge, earc->head->p, earc->tail->p);
- }
- }
- else
- {
- RetargetMode mode = detectArcRetargetMode(iarc);
-
- if (mode == RETARGET_AGGRESSIVE)
- {
- retargetArctoArcAggresive(rigg, iarc, inode_start);
- }
- else
- {
- retargetArctoArcLength(rigg, iarc, inode_start);
- }
- }
-
-#ifdef USE_THREADS
- MEM_freeN(p);
-#endif
-
- return NULL;
-}
-
-static void matchMultiResolutionNode(RigGraph *rigg, RigNode *inode, ReebNode *top_node)
-{
- ReebNode *enode = top_node;
- ReebGraph *reebg = BIF_graphForMultiNode(rigg->link_mesh, enode);
- int ishape, eshape;
-
- ishape = BLI_subtreeShape((BGraph*)rigg, (BNode*)inode, NULL, 0) % SHAPE_LEVELS;
- eshape = BLI_subtreeShape((BGraph*)reebg, (BNode*)enode, NULL, 0) % SHAPE_LEVELS;
-
- inode->link_mesh = enode;
-
- while (ishape == eshape && enode->link_down)
- {
- inode->link_mesh = enode;
-
- enode = enode->link_down;
- reebg = BIF_graphForMultiNode(rigg->link_mesh, enode); /* replace with call to link_down once that exists */
- eshape = BLI_subtreeShape((BGraph*)reebg, (BNode*)enode, NULL, 0) % SHAPE_LEVELS;
- }
-}
-
-static void markMultiResolutionChildArc(ReebNode *end_enode, ReebNode *enode)
-{
- int i;
-
- for(i = 0; i < enode->degree; i++)
- {
- ReebArc *earc = (ReebArc*)enode->arcs[i];
-
- if (earc->flag == ARC_FREE)
- {
- earc->flag = ARC_TAKEN;
-
- if (earc->tail->degree > 1 && earc->tail != end_enode)
- {
- markMultiResolutionChildArc(end_enode, earc->tail);
- }
- break;
- }
- }
-}
-
-static void markMultiResolutionArc(ReebArc *start_earc)
-{
- if (start_earc->link_up)
- {
- ReebArc *earc;
- for (earc = start_earc->link_up ; earc; earc = earc->link_up)
- {
- earc->flag = ARC_TAKEN;
-
- if (earc->tail->index != start_earc->tail->index)
- {
- markMultiResolutionChildArc(earc->tail, earc->tail);
- }
- }
- }
-}
-
-static void matchMultiResolutionArc(RigGraph *rigg, RigNode *start_node, RigArc *next_iarc, ReebArc *next_earc)
-{
- ReebNode *enode = next_earc->head;
- ReebGraph *reebg = BIF_graphForMultiNode(rigg->link_mesh, enode);
- int ishape, eshape;
-
- ishape = BLI_subtreeShape((BGraph*)rigg, (BNode*)start_node, (BArc*)next_iarc, 1) % SHAPE_LEVELS;
- eshape = BLI_subtreeShape((BGraph*)reebg, (BNode*)enode, (BArc*)next_earc, 1) % SHAPE_LEVELS;
-
- while (ishape != eshape && next_earc->link_up)
- {
- next_earc->flag = ARC_TAKEN; // mark previous as taken, to prevent backtrack on lower levels
-
- next_earc = next_earc->link_up;
- reebg = reebg->link_up;
- enode = next_earc->head;
- eshape = BLI_subtreeShape((BGraph*)reebg, (BNode*)enode, (BArc*)next_earc, 1) % SHAPE_LEVELS;
- }
-
- next_earc->flag = ARC_USED;
- next_iarc->link_mesh = next_earc;
-
- /* mark all higher levels as taken too */
- markMultiResolutionArc(next_earc);
-// while (next_earc->link_up)
-// {
-// next_earc = next_earc->link_up;
-// next_earc->flag = ARC_TAKEN;
-// }
-}
-
-static void matchMultiResolutionStartingNode(RigGraph *rigg, ReebGraph *reebg, RigNode *inode)
-{
- ReebNode *enode;
- int ishape, eshape;
-
- enode = reebg->nodes.first;
-
- ishape = BLI_subtreeShape((BGraph*)rigg, (BNode*)inode, NULL, 0) % SHAPE_LEVELS;
- eshape = BLI_subtreeShape((BGraph*)rigg->link_mesh, (BNode*)enode, NULL, 0) % SHAPE_LEVELS;
-
- while (ishape != eshape && reebg->link_up)
- {
- reebg = reebg->link_up;
-
- enode = reebg->nodes.first;
-
- eshape = BLI_subtreeShape((BGraph*)reebg, (BNode*)enode, NULL, 0) % SHAPE_LEVELS;
- }
-
- inode->link_mesh = enode;
-}
-
-static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *start_node, RigArc *next_iarc, int root)
-{
- ReebNode *enode = start_node->link_mesh;
- ReebArc *next_earc;
- int symmetry_level = next_iarc->symmetry_level;
- int symmetry_group = next_iarc->symmetry_group;
- int symmetry_flag = next_iarc->symmetry_flag;
- int i;
-
- next_iarc->link_mesh = NULL;
-
-// if (root)
-// {
-// printf("-----------------------\n");
-// printf("MATCHING LIMB\n");
-// RIG_printArcBones(next_iarc);
-// }
-
- for(i = 0; i < enode->degree; i++)
- {
- next_earc = (ReebArc*)enode->arcs[i];
-
-// if (next_earc->flag == ARC_FREE)
-// {
-// printf("candidate (level %i ?= %i) (flag %i ?= %i) (group %i ?= %i)\n",
-// symmetry_level, next_earc->symmetry_level,
-// symmetry_flag, next_earc->symmetry_flag,
-// symmetry_group, next_earc->symmetry_flag);
-// }
-
- if (next_earc->flag == ARC_FREE &&
- next_earc->symmetry_flag == symmetry_flag &&
- next_earc->symmetry_group == symmetry_group &&
- next_earc->symmetry_level == symmetry_level)
- {
-// printf("CORRESPONDING ARC FOUND\n");
-// printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
-
- matchMultiResolutionArc(rigg, start_node, next_iarc, next_earc);
- break;
- }
- }
-
- /* not found, try at higher nodes (lower node might have filtered internal arcs, messing shape of tree */
- if (next_iarc->link_mesh == NULL)
- {
-// printf("NO CORRESPONDING ARC FOUND - GOING TO HIGHER LEVELS\n");
-
- if (enode->link_up)
- {
- start_node->link_mesh = enode->link_up;
- findCorrespondingArc(rigg, start_arc, start_node, next_iarc, 0);
- }
- }
-
- /* still not found, print debug info */
- if (root && next_iarc->link_mesh == NULL)
- {
- start_node->link_mesh = enode; /* linking back with root node */
-
-// printf("NO CORRESPONDING ARC FOUND\n");
-// RIG_printArcBones(next_iarc);
-//
-// printf("ON NODE %i, multilevel %i\n", enode->index, enode->multi_level);
-//
-// printf("LOOKING FOR\n");
-// printf("flag %i -- level %i -- flag %i -- group %i\n", ARC_FREE, symmetry_level, symmetry_flag, symmetry_group);
-//
-// printf("CANDIDATES\n");
-// for(i = 0; i < enode->degree; i++)
-// {
-// next_earc = (ReebArc*)enode->arcs[i];
-// printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
-// }
-
- /* Emergency matching */
- for(i = 0; i < enode->degree; i++)
- {
- next_earc = (ReebArc*)enode->arcs[i];
-
- if (next_earc->flag == ARC_FREE && next_earc->symmetry_level == symmetry_level)
- {
-// printf("USING: \n");
-// printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
- matchMultiResolutionArc(rigg, start_node, next_iarc, next_earc);
- break;
- }
- }
- }
-
-}
-
-static void retargetSubgraph(RigGraph *rigg, RigArc *start_arc, RigNode *start_node)
-{
- RigNode *inode = start_node;
- int i;
-
- /* no start arc on first node */
- if (start_arc)
- {
- ReebNode *enode = start_node->link_mesh;
- ReebArc *earc = start_arc->link_mesh;
-
- retargetArctoArc(rigg, start_arc, start_node);
-
- enode = BIF_otherNodeFromIndex(earc, enode);
- inode = (RigNode*)BLI_otherNode((BArc*)start_arc, (BNode*)inode);
-
- /* match with lowest node with correct shape */
- matchMultiResolutionNode(rigg, inode, enode);
- }
-
- for(i = 0; i < inode->degree; i++)
- {
- RigArc *next_iarc = (RigArc*)inode->arcs[i];
-
- /* no back tracking */
- if (next_iarc != start_arc)
- {
- findCorrespondingArc(rigg, start_arc, inode, next_iarc, 1);
- if (next_iarc->link_mesh)
- {
- retargetSubgraph(rigg, next_iarc, inode);
- }
- }
- }
-}
-
-static void adjustGraphs(RigGraph *rigg)
-{
- RigArc *arc;
-
- for (arc = rigg->arcs.first; arc; arc = arc->next)
- {
- if (arc->link_mesh)
- {
- retargetArctoArc(rigg, arc, arc->head);
- }
- }
-
-#ifdef USE_THREADS
- BLI_end_worker(rigg->worker);
-#endif
-
- /* Turn the list into an armature */
- editbones_to_armature(&rigg->editbones, rigg->ob);
-
- BIF_undo_push("Retarget Skeleton");
-}
-
-static void retargetGraphs(RigGraph *rigg)
-{
- ReebGraph *reebg = rigg->link_mesh;
- RigNode *inode;
-
- /* flag all ReebArcs as free */
- BIF_flagMultiArcs(reebg, ARC_FREE);
-
- /* return to first level */
- reebg = rigg->link_mesh;
-
- inode = rigg->head;
-
- matchMultiResolutionStartingNode(rigg, reebg, inode);
-
- retargetSubgraph(rigg, NULL, inode);
-
- //generateMissingArcs(rigg);
-
-#ifdef USE_THREADS
- BLI_end_worker(rigg->worker);
-#endif
-
- /* Turn the list into an armature */
- editbones_to_armature(&rigg->editbones, rigg->ob);
-}
-
-
-void BIF_retargetArmature()
-{
- Object *ob;
- Base *base;
- ReebGraph *reebg;
- double start_time, end_time;
- double gstart_time, gend_time;
- double reeb_time, rig_time, retarget_time, total_time;
-
- gstart_time = start_time = PIL_check_seconds_timer();
-
- reebg = BIF_ReebGraphMultiFromEditMesh();
-
- end_time = PIL_check_seconds_timer();
- reeb_time = end_time - start_time;
-
- printf("Reeb Graph created\n");
-
- base= FIRSTBASE;
- for (base = FIRSTBASE; base; base = base->next)
- {
- if TESTBASELIB(base) {
- ob = base->object;
-
- if (ob->type==OB_ARMATURE)
- {
- RigGraph *rigg;
- bArmature *arm;
-
- arm = ob->data;
-
- /* Put the armature into editmode */
-
-
- start_time = PIL_check_seconds_timer();
-
- rigg = armatureToGraph(ob, arm);
-
- end_time = PIL_check_seconds_timer();
- rig_time = end_time - start_time;
-
- printf("Armature graph created\n");
-
- //RIG_printGraph(rigg);
-
- rigg->link_mesh = reebg;
-
- printf("retargetting %s\n", ob->id.name);
-
- start_time = PIL_check_seconds_timer();
-
- retargetGraphs(rigg);
-
- end_time = PIL_check_seconds_timer();
- retarget_time = end_time - start_time;
-
- BIF_freeRetarget();
-
- GLOBAL_RIGG = rigg;
-
- break; /* only one armature at a time */
- }
- }
- }
-
- gend_time = PIL_check_seconds_timer();
-
- total_time = gend_time - gstart_time;
-
- printf("-----------\n");
- printf("runtime: \t%.3f\n", total_time);
- printf("reeb: \t\t%.3f (%.1f%%)\n", reeb_time, reeb_time / total_time * 100);
- printf("rig: \t\t%.3f (%.1f%%)\n", rig_time, rig_time / total_time * 100);
- printf("retarget: \t%.3f (%.1f%%)\n", retarget_time, retarget_time / total_time * 100);
- printf("-----------\n");
-
- BIF_undo_push("Retarget Skeleton");
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void BIF_adjustRetarget()
-{
- if (GLOBAL_RIGG)
- {
- adjustGraphs(GLOBAL_RIGG);
- }
-}
-
-void BIF_freeRetarget()
-{
- if (GLOBAL_RIGG)
- {
- RIG_freeRigGraph((BGraph*)GLOBAL_RIGG);
- GLOBAL_RIGG = NULL;
- }
-}
diff --git a/source/blender/src/blenderbuttons.c b/source/blender/src/blenderbuttons.c
deleted file mode 100644
index f29397b2156..00000000000
--- a/source/blender/src/blenderbuttons.c
+++ /dev/null
@@ -1,2139 +0,0 @@
-/* DataToC output of file <blenderbuttons> */
-
-int datatoc_blenderbuttons_size= 68242;
-char datatoc_blenderbuttons[]= {
-137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0,
- 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144,206,103, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6,
- 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,
-154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,216, 9, 7, 16, 32, 48, 13, 5,217, 84, 0, 0, 32, 0, 73, 68, 65, 84,120,218,
-236,125,121, 92, 84, 85,255,255,251,220,217,217, 23, 1, 21,133,193,125, 95,201, 37, 55, 40, 49, 51,205, 52,192,212, 36,219,196,
-210,180,178,180,111,249, 60,233, 79,159, 12,148,202,212,132,158, 74,179,210, 18,151,180, 92, 18,116, 80, 83, 82,209, 92,202, 5,
- 69, 1, 65,145,101, 86,102,187,115,231,222,223, 31, 51,131, 3, 2,179,128, 73, 61,243,126,113, 95,195, 93,230, 51,231,158,237,
-253,249,124,206,231,156, 67,250,245,235,199,193, 3, 15, 60,240,192, 3, 15, 60,248,159, 2,229,201, 2, 15, 60,240,192, 3, 15,
- 60,248,223,193,153,223,179, 1, 0,196,227, 1,240,192, 3, 15, 60,240,192, 3,143, 7,192, 3, 15, 60,240,192, 3, 15, 60,240,
- 40, 0, 30,120,224,129, 7, 30,120,224,129, 71, 1,240,192, 3, 15, 60,240,192, 3, 15,254, 17,224,219,159,156, 61,123,150,184,
- 43,168,190, 88, 2,143, 60,143,188,134,144,145,145,193,173, 95,191,254,129,165,111,234,212,169,220,150, 45, 91,136,167, 60,254,
-214,242,208, 4,121,240,228,159, 71,222, 63, 89,158,203, 10,192,255, 56,234,102, 32,105,201,233, 76, 79, 79,199,236,217,179,137,
-167,216,220, 47,227,184,184,184,154,243,172,172,172,127, 68, 94, 78,124, 42,185,209,142, 96,215,143, 25,255,232, 58, 35, 9,220,
- 9,177,161, 19,162, 64,163, 26,251,144,175, 95,220,146,235,162,167,253,122,208,114, 60, 0,127, 69,101,157, 56,113, 98,204,174,
- 93,187,100,118,231,177,187,118,237,202,105, 17, 45,146,179,244,157,132,180,216,118,201, 21, 22, 22, 2, 0,164, 82,233,223,169,
- 19,113, 90, 59,157, 58,117,170,211,207,110,217,178,197, 21, 69,141,219,186,117,107,205,201,206,157, 59, 17, 23, 23, 87,235,254,
-131, 82, 2,242,242,242, 56, 0,136,142,142, 38,205,241,220,174, 31, 51,238,107,249,133, 71,181, 7, 0,220, 49, 24,192,232,141,
-150,139, 74, 53, 0, 32, 33, 33, 1,153,153,153, 13,166,111, 96,193, 64,174,243,237,206, 46,253,248,247,195,191,119,162, 92, 36,
- 8,124,245, 2, 12,187,118, 66,161,152, 4, 5,128, 1,146,149, 88, 44, 57,141,246, 98,160,194, 80,128,197,250, 68,151,126, 55,
- 33, 33, 33, 38, 51, 51, 83, 86,231, 90,108,102,102,102, 78, 11,107, 91,205, 82,111,255, 38,239,219,236,104, 19, 44, 34, 62, 2,
-127, 98, 20, 11, 57,163, 82, 79, 85,235,213,172,214,104,250,159,152, 29,231, 80, 1,176, 18,182,237,179,169, 21,129,219,181,107,
- 23,150,110, 93, 14,159,246,254,168,190,169,194,251,137,139,101, 45,220,226,110, 73, 32, 82,169,148, 43, 44, 44, 68, 97, 97, 33,
-246,239,223,143,217,179,103,183, 84, 37,192,214,128, 72, 70, 70,134, 32, 57, 57,217,148,154,154,122, 10, 0, 22, 46, 92,248, 80,
- 99, 95,156, 52,105, 82,205,255, 12, 99, 6,109, 50,130, 54,210,160,105,203,193, 48, 12, 22, 46, 92,232, 82, 90,236,201,191, 62,
- 88,149, 1,238, 65,122, 2, 92, 81,126, 30,152,133, 31,224,135,243,215,191,135, 4,237, 96,198, 49,148,127,113, 6,231, 10,170,
- 48,249,195, 13, 78,125,189,243,237,206, 78, 18,186, 5,207,252,250,140,195, 60,145,140, 91,140,160,137, 47,162,244,245, 1,128,
- 94, 81,115,253,140,254,109,156, 1, 0, 61, 48, 82,146,128,131,129,167, 17, 0, 96,160, 98,160, 83,117, 38, 51, 51,243,158,139,
-118, 4, 73, 90, 80, 27,107,142, 62,224,239,240,190,205,138, 97,125,250,145,103,195,163,248,202,136, 86,188,208,238,225, 20,159,
-132, 18,157, 74,197,138, 17,102,166,250,183, 51, 63, 55, 97,140,217, 73, 81,183, 92,248,217,182, 78, 60,179,192, 5,121,105,247,
- 85, 1,216,181,107,151,108,235,191,222, 69,226,178, 15,100, 77,172, 4,156,141,248, 1,160, 82, 87, 5, 4, 3,255,119,112, 9,
-212,215, 21, 88,247,242,234,150, 70,100, 13,117, 60, 15, 58,141, 53, 74,192,216,177, 99, 81, 88, 88, 8,169, 84,218,226,242, 78,
- 38,179,244, 27,177,177,177, 28, 0, 42, 35, 35, 35, 60, 57, 57,185, 52, 53, 53,245,180,179, 66, 24,134, 1, 77,155,106,136,223,
-158,252,243,242,242, 16, 29, 29,237, 82,162, 18, 19, 19,237,201, 22, 89, 89, 89,117, 21,128,230,168, 43, 46,151, 67,116,116, 52,
-153, 58,117, 42, 55,102,204,152,123,238, 29, 56,112,192,230,233,176,121, 61,156,150,223,156,195, 1,225, 81,237, 81,170, 80, 97,
-199,236,167, 17, 76,134,161,224,191,111,161,195,164, 14,200,114,129,252,107, 50,203,234,106, 35,205,224,106, 11,223,122, 12,186,
-162,106,148, 38, 71, 53,250,220, 5,113, 54,150,246,190,131, 21, 23,222,107,106,121, 54, 7,233, 54,167, 12, 52,179,172,251,241,
-190,205,130,164,164, 36, 47, 0, 15, 3,240,177,187,172, 4,112,126,211,166, 77,114,103,229,124,178,254, 19,138,174, 52, 10,104,
-163, 65,172,128, 73, 44, 16,240,249,106,131,152, 18, 10,245, 44,207,207,155,161, 37, 38, 19,191,236,150,241,235, 47, 54, 26,158,
-123,105,166,217,153,247, 86, 42,149,255,177,253,159,159,159, 95,233,237,237, 77,105,181, 90,214,254,153, 65,131, 6,125,220,204,
-196,190,160,169,121,202,119,100,253, 95,186,116, 9,157,125,252,236,189, 1,238,120, 1,106,200,191, 82, 87,133, 21,143, 46,169,
-185,241,252,174, 87,129, 80, 96, 82,106, 34,118, 46,220,234, 74, 37,107,172,115,107,114, 69,189,121,243, 38, 0,160,125,251,246,
-181,254,135, 11,238,236,102, 84, 68, 72, 67, 74,128,201,196,216,226, 1,154,197, 10,104,134,188,180, 39,127, 0, 32,201,201,201,
- 0,112, 43, 35, 35, 35, 48, 57, 57, 89,225, 52,249,155, 76,160,105, 35,140, 52, 13, 83, 29,242,231, 88,215,138, 33, 49, 49, 17,
-121,121,121,119, 91, 87, 90, 26,226,227,227,107,206,183,109,219,214,100,101,199, 78,225,105,114,253,179, 39,254,169, 83,167,162,
-127,255,254, 54, 5,192, 85,143, 64,179, 84,194,146,235,197,208,238,252, 55,124, 94, 88,141,240,168,246, 8, 11,150,224,250,206,
-235, 22,242, 15,240,179, 12, 1, 8,120,206,105,176,205, 52,198,214,229,226, 53,220,124,127, 57,244,153, 27, 27,247, 16, 72, 36,
- 48, 24, 12, 40, 40, 40, 64,185,225, 10,186, 32,188,193,103,173,110,240,198,234, 62,177,181, 19,235,179, 57,110,180, 47, 98,215,
-174, 57, 55,219, 25,105,132,184,157,174,131,245,189,111,124,124, 60, 71, 8,177, 13,229, 52,229,125,109,109,153,227,243,249, 77,
- 42,243,164,164, 36,127, 0,147, 14, 30, 60,248,111,150,101,141,118,117,137,207,227,241,188,147,146,146, 94,218,180,105,211, 94,
-135,140,185,104, 1,191,242, 86,133, 88, 32, 16,121, 83,124,226,199,241, 68, 94, 44,143,199,103, 9, 5,150,240,205, 28,143,103,
-228,177,196,160,229,153,117,222, 66, 1,249,226,216, 94,195,220,148,153, 44,138, 29,167, 81,161, 80,168,117, 58, 29, 3, 0, 90,
-173,150,125,247,221,119,107, 8,255,131, 15, 62,120,163,169,245,125,244,232,209,179,109,255,103,103,103,167, 55, 71, 27,162, 28,
- 89,255,203,167,196,195, 80, 81,129,183,122,118,131,253,216,189,211, 86,200,196,137, 49, 0,106,145,255,196,137, 19, 99, 1,144,
-137, 19, 39,198,110,152,248,153,197,179,216,181, 85,173,231,157,193,194,117,249, 88,184, 46, 31,115, 86, 93,194,115,203,254,192,
-228,255, 59,219,244,142,174,164,196, 41,197,224,175, 34,127,235,152, 63,215,128, 39, 0, 38,154,198,224, 65,131,154, 67,201,224,
-182,110,221,138,173, 91,183, 66, 38,147,213, 28, 46, 42, 60,156, 76, 38, 67,108,108,108, 13,249,219,223, 76, 78, 78, 86, 58,211,
- 49, 49,140,217, 98,249, 27, 45,174,255,186,228,111, 54,155,161,213,107, 93,122, 65,155,199,160,174,215, 96,219,182,109,216,182,
-109, 91, 45,101,192,165,247,205,169,221, 31, 90,207,155,164, 36,218,200,127,234,212,169, 72, 77, 77,173, 33,127, 1, 95,224, 42,
-249,219, 58,240,134, 14,167,161, 71, 49,170, 39, 13, 6,151,249, 22, 74,174, 23,131,155,212,253,110, 38,100,190, 5,126,155, 16,
- 32, 32,224, 47,213,140,181,149, 5,208,103,110, 4,199,113,184,112,225, 2, 70,142, 28, 9,137, 68, 82,139,248, 3, 3, 3,161,
-215,235,161,215,235, 81, 90, 90,138,105,250,121,248, 34,240,245, 6,101, 58,233,242, 38,117,158,117,149,184,155,203, 88, 33, 13,
-144,191,211,117,176,238,251,198,199,199,115,219,182,109, 67,102,102, 38, 18, 18, 18,184,166,190,175,149,252,193, 48,140,219,109,
- 34, 41, 41, 73, 12,224,229,236,236,236,119,151, 45, 91,118,130, 16, 34,181, 29, 0,218, 5, 7, 7,123, 29, 58,116,104,125, 82,
- 82,210,200,198,228,124,150,190,158,199, 35, 2, 17,205,112,126, 70,163, 41,212,204,178,237,204, 44, 27,101, 38, 36, 2, 60, 94,
- 48, 33, 36, 0,132,231,199,114, 8,226,104, 54, 64,173, 55,121,135,250, 49, 60,106,144,198,169, 50,210,233,116, 76, 93,171,191,
-165,131,106,140,184,187,116,233,130,206, 62,126,208,149,221,198,227,253, 7,184, 76,208, 54, 37, 98,233,214,229, 0, 80, 67,254,
- 54, 47,194,174, 93,187,114,108, 74, 64,137,250, 22, 6, 44, 28,226,146,146,161,213,155,161,213,155,113,187,202,136,210, 10, 3,
-110,222, 49,184, 69,124,182,198,226,136,252, 31, 20, 26, 81, 2, 96,160,141, 48, 24, 12, 77, 17,207,201,100, 50,216,198,200, 67,
- 66, 66,236,173, 89,184,208,153,212,178,132, 27,113, 37, 58,236,244,104,147,209, 98,249, 27,105,208,166,218,228,111, 50,153,160,
-213,106,161, 81,107, 30,116,177,112, 91,183,102,214,126, 37,203, 31,172,215,221,234,240,236,201,223, 70,252, 20, 69, 65, 44, 22,
-195,219,199,171, 73, 9,158,248, 84, 50,215,208,225,232,187,251,255,111, 9,130, 49, 12,204,232,215, 0, 0, 62,185,215,112,174,
-160,202,210,201,143,126, 13,166, 11, 75,129,202, 42,215, 50,208, 10,119,223,199, 27,149, 0,128,141, 27, 55, 98,215,174, 93, 88,
-185,114, 37, 78,158, 60, 9,163,209,136,242,242,114,155, 85, 86,243,124,120,120, 56,244, 0,120,184,241, 64,234, 75, 35,245,158,
- 52, 65,105, 36,141,120,240, 92,150,105,239, 9,171, 47, 38,192, 29,242, 7, 0,119,149,128,164,164,164,214, 86,242,159,245,245,
-215, 95, 95, 92,188,120,241, 83,155, 55,111, 70,151, 46, 93, 0, 0,145,145,145, 80,169, 84,162,165, 75,151,158, 62,116,232,208,
-183, 73, 73, 73,210, 6,115,137,229, 8, 88, 70,108, 54, 51, 65,102,198,220,206,100, 54,117,226, 81,164,173,144, 79, 9,196, 2,
-158,158,239, 37, 84,122,251,242,212, 60, 49,199,136,121, 60,111, 62, 67,251,221, 56,243,187,104, 70,200, 39, 14,211,157,159,159,
- 95,169,213,106,217,250,220,252,125,251,246,189, 66,211,116,179, 85,164,190,125,251, 54,155, 44,126, 99,196,253,223, 89, 47,222,
- 37,219,146,155,120,171,103, 55,172,178, 16,180, 75, 90,171,205,250,183,145,126,157,223,169, 57, 15,238,221,218,165,196, 87,235,
-205,208,232, 24,168,181, 12, 84,213, 12,148, 26,198,245, 86, 89, 79,228,191,189,149,111,255,255,245,235,215,161, 84, 42,255,178,
- 30, 35, 61, 61, 29, 82,169, 20,182,160,191, 58, 99,253, 92,122,122, 58, 12,122,125, 83, 20, 0,110,195,134, 13, 40, 41, 45,133,
-128,199, 67, 88,235,214,181,200,255,209, 71, 31,197,193,131, 7,157,237,156, 72,108,108,108, 93, 37,160,150, 39,195,217, 88, 5,
-218, 72,131, 54, 26, 97, 50,209, 96, 24,115, 13,249, 27,141, 70,232,116, 58, 84, 87, 87, 67,163,113, 93, 1,176, 31, 2,176,193,
- 93,203,127,107,230, 86,128, 3, 42,173, 68, 99, 29,212, 6,225, 56,139, 18,144,153,137, 68,139, 5,229, 82, 91,169, 75,254, 2,
-129, 0, 34,145, 8, 98,177, 24, 98,177,184,201,117,170,161, 33,129,250,230,197,219, 99,114,250,118,112, 79, 70,225,206,208, 1,
- 8,198, 48, 72,158, 94, 3,230,118, 5, 16,224, 7,126,213, 22,252,252,201,105,128,199,115, 41, 45, 77, 29, 10,208,242, 44,125,
-202,138, 21, 43, 80, 81, 81,129,245,235,215,163,111,223,190, 88,182,108, 25, 6, 12, 24, 0,189, 94, 95,215, 66,179,169,212,127,
- 53,241, 59, 75,208,238, 14, 7, 52,164, 72,184, 44,199, 58,139,163,166,109,184, 59, 52,102, 79,254, 53,100, 99, 85, 2, 92, 28,
- 14,240, 61,127,254,252,167,175,188,242,202,145,222,189,123,251, 1,192,146, 37, 75,144,159,159, 15, 0, 24, 50,100, 8,118,236,
-216,129,225,195,135,123, 79,155, 54,173, 32, 39, 39, 39,251,249,231,159,159,246,251,239,191,223,147,179, 65,193, 65,236,245,235,
- 5, 76,142,236,224,190, 78,157, 58,231, 68, 69, 74, 47,242,124, 37,229, 60, 34,212, 82, 34,129,142, 18,123,105,104, 62,143, 6,
-103,226,177, 98,147,175,166,180,202,231,228,161,179,131, 90, 5,134,237,112,168,140,218,141,249,239,220,185,243,185, 73,147, 38,
-125,109,115,251,171,213,106, 74, 40, 20, 54,185, 34,217,220,254,217,217,217,247,215, 3, 96,179,242,163, 59,118,134,161,162, 2,
-218, 18, 11, 9,142,180, 90,135,174,122, 1,174,255,113,237, 30,217,245,157, 87, 93, 40,115, 41,241, 77, 37,127,123,226,231, 56,
-206, 54,198, 95, 3,147,201, 84,115, 40,149, 74,104,181, 90,200,229,242,191,172,231,176,205,243,223,191,127,127, 93, 79, 0,151,
-158,158,142, 62,125,250,192, 96,208,215,116,116,233,233,233, 46,185,235,215,125,182, 14, 38,147, 9,237,194,195, 97, 50,155, 27,
- 34,127, 87, 58, 18, 82,143,235,191,102,234, 98, 99,158,140,123, 20, 0,218, 84, 67,254,167, 78,158,130, 78,175,135, 70,163,129,
- 74,165,130, 82,169,172,101,217,185, 10,219, 48, 64, 19,198,253, 81, 85, 89,133,170,170, 74, 84, 86,201, 81, 89, 85,133,170,170,
- 42, 84, 85, 90, 44,210,110,221,187, 67,110,253,223, 85,235, 31, 0,250,247,239,127,215,234,247,246,134,143,143, 47,124,125,124,
-161,209,104, 98,155, 72,254,110, 15, 7, 20,172,156, 5,193,211,107, 16,140, 97,224,231,174,129,105,251,107, 64,128, 31,118,191,
- 26,143,162,221, 55, 48, 33,117, 19,192,255,139,151, 21, 49, 20, 65, 18, 46,129, 86,171,133,193, 96,128, 78,167, 67,110,110, 46,
- 62,252,240,195,122, 31,247,242,178,121, 80,174,185, 67,222,238, 90,213,246,249, 75,156, 60,111,138,146,225,106,155,173, 37, 39,
- 51, 51,147, 36, 36, 36,216,200,223,109,207, 4,159,207, 39, 12,195,212, 85, 10,224,106, 44,192,166, 77,155,174, 38, 36, 36,244,
-221,188,121,243,200,163, 71,143,250,142, 30, 61,250,164,141,252,173, 6, 36, 68, 34, 17, 87, 84, 84, 36,216,183,111, 95,215,192,
-192,192, 83,195,134, 13, 43,168, 79,214, 51, 83,158, 97, 59, 71,117,209, 12, 25, 50, 36,254,226,197, 63, 31, 81,107, 53,173, 57,
-198,196,128,130,137, 49, 82, 70,163,209,168, 87,163, 76,205, 26, 13,154,210,226, 50,230,231, 61,123, 83, 90, 5,135,148,211,180,
-206,161,249, 94,159,245,175, 80, 40,248, 0,224,231,231,215, 98,135, 5,168,134,172,255,173,255,122,215,162, 53,151,221,174,117,
-207,213, 88,128,137, 19, 39,198,174,123,121, 53, 0, 75,192,223,174, 93,187,100, 54,210,183,173, 9, 16,247,205, 83, 0,128, 51,
-169,191,217,226, 3,254, 42,212, 84,198,146,146,146, 26,107,223, 70,250,118,133, 11,141, 70, 3,131,193, 96,215,137,252,117,105,
-156, 61,219, 18,251, 97, 98, 24, 92,188,120, 17,191,159, 57,131,190,125,250,194, 96, 48, 64,175, 55,192,160,215,227,219,111,190,
-129,237, 57,103, 26,122, 90, 90, 26,122,116,239, 1,147,201,132,171, 87,175,130, 49,209, 40, 45, 41,109,214, 60,181,157, 91,215,
- 44,176,173, 93,224,216, 3, 96, 50,130, 49, 91,220,254, 39, 78,252, 6,173, 94,139,106,141, 26, 42,149, 10, 10,165, 18, 10,133,
-188, 73,138,152,205, 19,224,166,245, 15, 0, 56,114,228, 8, 52, 26, 13, 52, 26,181,245, 83,131, 86,193,193,232,214,189, 59, 46,
- 95,186,132,195, 71,142,184, 44,211,102,253,243,249, 2,120,121,121,193,199,199, 7,190, 62, 62,240,241,241,130, 92, 33,143, 77,
- 78, 78,206,113,170,205, 53,193,213,223, 16,206, 21, 84,193,116, 97, 41,170,112, 12,100,220, 42,144, 97,255, 70,193,202, 89,120,
- 50,245,107,136, 5, 20, 32,224, 91, 14,119, 88,199,205,161,128,210,241,159, 33,104,203,120,232,116, 58, 4, 5, 5, 65,161, 80,
- 64,161, 80,224,248,241,227,184,125,251,118,141,155,184,230,249,210, 82,188, 26, 40, 65, 43,175,138,198, 44,224, 88,123, 82, 77,
- 72, 72,136,177,187, 23, 83,231, 94,172,139,237,130,107,132,192,155, 99, 70,129,203,150,127,125,239,155,153,153, 73,182,109,219,
- 70,154,248,190,181,148, 0,119,200,223,134,247,222,123,239,252, 83, 79, 61, 53,109,197,138, 21, 93,207,157, 59, 55, 76, 34,145,
-240,158,124,242, 73, 34, 18,137,192,178, 44, 25, 55,110,220,249,249,243,231,247,233,213,171,215,238,151, 94,122,233,185,151, 94,
-122,169,193,177,168,228, 57,201,236,159,151,174,158,234,213,187,207,179,167, 78,158,156,188,123,207, 79, 31,228,157, 60,217,250,
- 98,254,101,241,213,210, 2,238,219,213, 63, 72, 86,164,173,236,145,189,103, 79, 90,167,142,157,126,246, 9,243, 62,178,105,211,
- 38,179,179, 57, 58,122,244,104,156, 58,117,170, 95,122,122,250, 82,131,193, 32, 88,182,108,217, 71,187,119,239,158, 90, 90, 90,
-250,151, 19,135, 83,101,212,208,141,224, 27,133,144, 3, 53,214,191, 13, 35, 67, 66,176, 10,151,157,183, 58,172, 46,254,203,167,
- 47, 34,160,107, 43,196,125,243, 20,118,205,248, 81,102,211,222,108,228,111,179,254, 93,153,101,176, 99, 69,191,230, 97, 88, 66,
-112,233,210, 37,216, 42,107, 93,247,178, 64, 32,128, 64, 32, 64, 69, 69, 5,198,141, 27,247, 32,202,137, 72,165, 82, 46, 61, 61,
- 29,131, 6, 13,130,193,104,132,222,160,135,193, 26,220,164, 55, 88,134, 1,214,174, 93,139,185,115,231, 58,234, 76,184,212,212,
- 84,152,205,102,156, 62,125, 6, 2,190,197,109,219,185,115,103,220, 40, 44, 68,105,105, 41,182,108,249, 30, 83,167, 62, 3, 0,
- 92, 29, 79, 64,131, 29, 80, 70, 70,134, 16, 0,147,156,156,204,214,103, 1,185, 50, 85,209,102,249,231,230,230, 66, 91,173,171,
- 81,192,212, 26, 53,212,106, 21,212,106,247,134, 0,236,173,255,169, 83,167,214,120, 0, 92, 85, 4,166, 78,157, 90,235, 60, 74,
- 42, 69,183,238,150,160,184,203,151, 46,225,134,213,227, 49,117,234, 84,151,163,246,135, 62, 60, 20, 34,161, 8, 18,137, 4, 98,
-177, 24, 34,145, 8,101,101,101, 78,147,191,157,181,223,172, 21,112,242,135, 27,176, 3,192,216, 21, 79,128,203,124, 11, 36, 49,
- 13,231, 10,170, 64,130, 2,113,173, 68,109,177,254, 93, 28, 2,176,107,127,196,166, 8,216,159, 59,132, 94, 15,240, 44,198,222,
- 93,247,190,133,232, 77, 38, 19,190,248,226, 11,140, 28,121, 55, 46,236,224,204,112,160, 92,135,174,123, 21,232, 23, 18, 89,175,
-200,122,162,220,237,135, 60,101, 14,158,117,150,176, 73, 19, 60, 10,141,121, 35, 92, 86, 36,238,247,251, 90,149,128, 38,207, 2,
- 88,177, 98,197,150,121,243,230,133,156, 61,127, 62, 81,175,215,247,145,201, 14, 73, 68, 98, 17,159, 34, 20, 14, 29, 58,228,219,
-163, 71,143, 77, 9, 9, 9,255,158, 60,121,178, 67,107, 61,231,208, 1,118,194, 83, 19, 14,247,237,219,127, 33,205, 24,199, 94,
-203,191,250, 1, 91, 88,192, 0,224,196,160, 76,189, 59,117,205, 12, 13, 13,217,203,227, 11,191,253,207,226, 20,250,147,101, 31,
- 59, 44,165, 65,131, 6,125, 60,122,244,104, 0, 64, 69, 69, 5,178,179,179,253,190,250,234,171, 15, 0,224,212,169, 83,131,122,
-246,236,185,255,111,161, 0,216, 22,254,121,244,219,205,142, 44,123, 87,166, 4,146,157, 11,183,114, 3, 22, 14, 65,112,239,214,
- 53,164, 95,227, 78,189, 80,134, 51,169,191,185,234,182,106,174, 57,169, 4, 0,215,189,123,119, 92,184,112,161, 22,177, 40,149,
-202, 2, 0, 29, 93,212,230,239,167, 39,224,158,223,252,246,155,111, 97, 48, 24, 96,164,141,160,105, 26,169,169,169,141, 45,146,
-195,165,166,166,214,156,176,172, 25, 98,137, 15,244,122, 3, 46, 93,188, 8,190, 64, 0, 19, 77,195,203,219, 11, 91,182,108, 1,
-143,199, 67, 98, 98, 34, 30,125,244, 81,174,170,170,225, 0,175,212,212,212,253,201,201,201,116, 70, 70, 70,168, 45,111,234,172,
- 3,224,146,107,115,225,194,133, 56,118,236, 24,170,171,171, 81,173,213, 66,163, 86, 91,201, 95, 13,141, 90,131,106, 77, 53,180,
-118, 29,190, 51,121, 23, 29, 29,205,229,229,229,213, 88,255,245, 77, 3,116,118, 17, 32,235, 92,252, 90,101, 97, 35,125,219,216,
-163, 43,171, 20,218, 86,248, 3, 0, 31, 47, 31,136, 37, 98,104, 52,154, 88,219,208,142, 27,228,127, 95,230,107,219,148,128, 73,
- 43,190, 2,183, 29,104, 53, 51, 3, 57,175,199, 99,120,202,119,128, 64, 0,111,113,211,198, 57,235, 42, 2, 0, 48,245,216, 84,
- 7,223,186,131,222,251,189, 80,246,147, 14,138,229,119,175,154, 76, 38,140, 24, 49, 2, 0, 16, 30, 40,193,175, 25,237,177,242,
-195,155,248,236,140,222,145, 69,108, 63, 45, 14, 13,253,111,247,108,142, 27,125, 86,115,205,173,111,142, 49,255,251,249,190, 53,
- 74, 64,115,212,191, 79, 63,253,244,211,231,103, 62,191,239,161,129,209,131, 52,106,117, 16, 99,102,140, 97, 97, 97, 21,225,225,
-225,101,106,181,250,220,228,201,147,157,238, 20,126,250,241, 39, 22,192,150,103,167,191,152, 59,108,248,240, 31, 37, 18,137, 63,
- 1,199, 18, 66,192,178,156, 74,175, 85,200,174,156, 47,214,120,139,132, 78,245,243, 54,242, 7, 44,129,212,117, 3,245, 62,252,
-240,195,127,255, 45, 20, 0, 43,169, 59, 44,176, 93,187,118,185, 92, 89,207,164,254,198, 1,128, 77, 17,176, 35,254,230, 36,116,
-183, 27, 82,239,222,189,113,234,212, 41, 84, 84,212,184, 8, 59, 2,128,141,252,102,204,152,241,160,203,171, 86, 30,165,167,167,
-115,207,206,120, 22,107,215,174,179,142,153, 51, 88,184,112, 97,163,211,151, 92, 92, 65,207, 98, 57, 29, 60,232,104,179,137,238,
-169,169,169, 87,147,147,147,203, 51, 50, 50,120,201,201,201, 53, 1,129,214,105,129, 78,119,116, 54,139,121,216,176, 97,205,158,
-119,209,209,209,156,189, 21,111, 31, 3,224,198, 10,128, 4, 0,183,101,203,150,123,172,124,171,135,192,229,250,188,101,203, 22,
-226,170,199,192, 25, 52,230,250,119, 85, 89,152,252,225, 6,192,110,225,159, 81,239,222,157,142,172,109,174,130,178,243, 0, 56,
- 90, 9,176,116, 88, 41, 74, 1, 12, 88, 25,136,229,167,187, 32, 4, 64, 69,129, 22,157, 58,117,178,144,198,242, 64, 60,246, 80,
- 8,162, 30,203,119,214, 34,118,122,120,211,250, 44,113,183,191,105,166, 62,175, 73,178,254,162,247,109, 54,108,216,184,225, 42,
-128,171,205, 37,239,219,239,190, 44, 68, 51, 68,133, 54,103, 96,158, 21, 11,254,138,252,252,171, 55, 3, 34, 19, 39, 78,140,217,
-149,218, 34,247, 2, 32, 0,184,135, 30,122, 8,123,247,238, 53, 88, 73,159, 5,224,117,159, 60, 15, 77,134, 45, 72,112,238,220,
- 57,156,213,242,127, 32,105, 91,184,112, 97,100,125,110, 73,187,105,132,174, 88, 59,228, 62,151,113, 77,122,154,186,236,111, 67,
-171,242,185, 74,226,142,214,246,111, 14, 52,101, 72, 96,209,162, 69,184,126,253,122,179,165,197,153,229,125, 93,197,153,183, 21,
- 56, 3, 75, 96,232,200, 4, 9,126, 57,209, 5, 97, 94, 62,248, 51,239, 14,186, 58, 73,254, 78,212,191,150,186, 28, 46,185, 79,
-223,245, 44,207,238, 28,218, 54,179,188,180,191, 42,225,127,249,110,128,117, 61, 12,110,120, 18,238,187, 18, 48,110,220, 56,241,
-223,172, 2,186,101,217, 55,215,111,103,100,100,216, 86,168, 97,146,147,147,155, 58,149,201,131,230, 39,255, 38,149, 69, 74, 74,
- 74,179,148,101, 70, 70, 6, 63,121,120,242,125,175, 23, 71, 50,245, 56,146,153,223,226,219,172,167,102,122,240,192, 43,161,187,
-251, 8,123,224,129, 7, 30,120,224,129, 7,127, 95, 80,158, 44,240,192, 3, 15, 60,240,192, 3,143, 2,224,129, 7, 30,120,224,
-129, 7, 30,120, 20, 0, 15, 60,240,192, 3, 15, 60,240,192,163, 0,120,224,129, 7, 30,120,224,129, 7,255, 8,212,154, 5,112,
-246,236, 89,183, 35, 83,235, 11, 38,244,200,243,200,243,200,243,200,115, 82, 94,163,211, 68, 91,128, 60, 79,249,122,228,213,194,
- 43,175,188,210, 14,128, 2,128,208,186,213,121,139, 74,159,199, 3,224,129, 7, 30,192,223,223,159,242,247,247, 39,254,254,254,
- 2, 0,188,150,150, 62,219,190,243,118,251,207, 55, 21,245,173,143,239, 65, 11,194, 19, 79, 60, 17,243, 15,120, 13,219,218, 87,
-146,191,235, 11,120, 20,128,127, 56,154,176,221,186,203,136,139,139,139,177,118,186, 53,135,245,218, 63, 82, 94, 11, 7,137, 12,
- 11, 35, 0,160, 82,169, 88,149, 74,197,169, 84, 42, 19, 0,179, 59,194, 94,126,172,119,201,172,177,189, 39, 2,192,172,177,189,
-191,121,249,177,222,235, 0, 96,225,164,135,200,194,167,163, 5, 47,143,233,229,214,154, 34,246, 75,209,102,102,102,214,218,124,
-167, 41,228,111, 87,239,155,115,173,253,166,202,108, 14,121,220,125, 80,108,254, 82, 69,233,137, 39,158,136,217,187,119,175,236,
- 31,208,198, 12,176, 44, 22,119, 95,121,180, 77,176,136,234,220, 58,148, 31, 33,109, 71,133, 5, 4, 11,189, 69,130,102,251, 61,
- 62,254, 25,160,172, 90,152,222, 90, 32, 30,216, 41, 0, 78,236,173, 98, 4, 32,106,234, 79,101,101,101, 33, 45, 45,173,214,242,
-127, 11, 22, 44,176, 53,116,226,142, 60,246,135,192,218, 5, 61, 37,171,165,200,107,241, 69, 31,229, 45,225,162, 58, 72, 1, 0,
-101, 52, 51,189,181,144,255,157,237,230,101,117,181,168,172,178,146,118, 70,208, 75, 99,122,229,155,205, 92,248,195, 67, 91,249,
-117,237, 58,236,128, 72, 68, 21,205, 73, 25,244,159,255,146, 11,184,163,210, 61, 33,224,147,159, 0,114, 17, 64, 79, 87, 19, 89,
-119, 41,218, 38, 46, 55, 91,139,252,237,234,190,187, 75,229, 18, 23,175,223,119,121, 9, 9, 9,182, 53,250, 29,190, 83, 66, 66,
- 2,151,153,153, 73, 92,200, 59,210, 12,114,156, 34,127,150,101, 65, 8,193,200,145, 35,185, 35, 71,142, 16, 23,203, 88, 8,192,
-212, 28,233, 9, 10, 10,154, 37,151,203, 63,119,243,235,126, 0,148,104,190, 85,176,107, 97, 88,159,126,212,179,225, 81, 98,101,
- 68, 43, 97,104,247,112, 62,159,132, 82, 58,149,138, 17, 35,140,166,250,183,163,159,155, 48,134,110,234,111, 56,171, 73,132, 0,
-120,220,250,217,210,224, 7,224, 41, 0,233,214, 79,191,102,146,251,125, 75,179,176,221, 42, 96,202, 97, 17, 15,178, 54,168,208,
-166,144,205,252,249,243,239, 33,127, 0, 72, 75, 75,139,157, 63,127,190,203, 86,206,198,215,188,239, 33,107, 0, 96,127, 8,196,
-198,215,188, 31,168,188,212,212,212, 24,138,162,184,103,158,185,187,164,237, 43,175,188, 18, 3,128,139,136,136,224,218,181,107,
-199, 5, 7, 7,115, 79, 63,253,180, 83, 50, 55,164,126, 20,115,156, 26,194, 45,141,142,175,177,126,215, 45, 93, 23, 51, 15,171,
-185, 57, 17, 27,184, 25,237,182,114,227,131,247,115,131, 58, 44,115,202, 58,238,208, 46,172,117, 76, 7, 41,247,218,156, 25,198,
-229,111,189,200, 45,124, 97, 26, 90, 11,249,223,189, 59,251, 89,172,124,227,101,110,217,220, 23,216,110,126, 62, 70, 0,104,221,
- 58,152,111, 45,255,122,113,102,231,211,157,195,195,189, 2,158,153, 18,153, 54,113, 82,123, 1,203,177,210,144, 86, 34,239,143,
- 95, 63,145, 54,239,169,126,223, 62,254, 88,155,200,136, 8,239,226,127, 47,238,237,238, 54,153,246, 27, 69,185,180,105,148, 3,
-203, 31,205,224, 9,104,113, 30,128,204,204, 76,146,144,144, 80,243,189,132,132, 4,174,190,161, 19, 43,105, 59,173, 84, 52,148,
- 14, 59, 57, 77,238,232,236,201,127,193,130, 5, 24, 57,114, 36,247,235,175,191,186, 35,138,110, 70,227,181, 44, 40, 40,104,146,
-155,223, 13,183, 26,156, 82, 0, 72, 74, 74,138, 76, 74, 74,218,147,148,148,148,107,119,236, 76, 74, 74,114,105, 27,229, 79,214,
-127,194, 79, 93,150,226,247,248,147,147,194, 21, 3,123,118,224,183, 13,239,168, 54,136, 59, 86,155,245,237,137,159,119, 91, 58,
-204, 20,198,148,221, 10,248,250,139,141, 66, 23,121,220, 45, 5,160, 61,128,111, 0,196, 91, 63,219,183, 32,126, 11, 6,176,197,
-170,156, 28, 7, 48,214,122, 30,220, 12,178,167,192,137,241,210,150,174, 0, 56,129, 33, 0,174, 0,136,114,199,186,177,185,208,
- 35, 34, 34, 98,237,173,126, 59,203,191,230,158, 51,238,118,219, 51, 73,195,133,118, 86,186, 2,212, 20, 69,205,185,237,222,131,
-144, 7, 0, 39, 78,156,144,137,197, 98,228,230,230,222,163,108, 21, 23, 23,147,146,146, 18, 50,100,200,144,216, 61,123,246, 56,
-149,135,173, 79, 92,148,113, 98, 1,250, 84, 8,107, 89,195,132,226,176,174,248,121,242, 77, 73, 34,145,142,189, 16,203,220, 26,
-239,208,109, 26,211, 65,202, 69, 8, 37,183,223,124,117,186,177,157,143, 80,168,186,120,140,120,149,159,199,188, 17,157,209, 54,
- 64,130,242, 51, 71,201,157,211,199,168, 5,179,102,208, 49, 29,164, 92, 55, 47, 95,147,181, 67,173, 23,173, 90, 9, 71, 9,133,
-148,248,248,241,219,243, 79,157,188,213, 61,172, 93, 7, 83, 64,171,118,196,215, 23, 94, 29,162,188,162,130,130, 68,157, 88,142,
- 51,254,124,178, 92,251, 0,235, 48,103,111,241,219, 14, 55,149, 0,174,158,207,186, 71,125,207,253, 85,242,106,148, 0,185,124,
- 52, 50, 50, 20,104, 10,249, 55,166, 84,212,145,211, 36, 15,192, 19, 79, 60, 17,179,103,207, 30, 25, 33, 4, 20, 69, 33, 47, 47,
- 15, 71,143, 30,117, 75,150,217,108, 62,111,245, 0, 52, 71, 60,139, 68, 46,151,239, 12, 10, 10,122,218,141,239,218, 60,206,154,
-164,164,164, 94, 0, 14, 28, 60,120,112, 92, 86, 86,214, 16,219,145,157,157,253,148, 76, 38, 59,148,148,148,228,212,144,199,130,
- 69, 11,196,149,183, 42,130,245,156, 49,130,227,147,110,156, 72,212,157, 21, 8,187,179,132,234,204, 18,126, 39,134,199,139,100,
- 89, 18,174, 37,230, 80, 70, 72, 5,126,113,108,175, 88,252,100,232,125, 85, 0, 62, 1,112, 16,192, 60,235,231, 39, 77,200,236,
- 64, 0, 75, 0,236,177, 86,244, 61,214,243, 64, 55,229, 29, 1,176, 23, 64, 50,128,245, 0,222,176,202, 60,210,196, 74,225,111,
-253,244,110, 6, 11, 27, 86, 11,107, 73, 99,150,214, 3,196, 67, 0,142, 1,104,109, 85,158,158,117,229,203, 89, 89, 89, 50,123,
-203,127,193,130, 5,178,180,180,180,216,180,180,180, 88,123, 37, 32, 45, 45, 45, 54, 43, 43, 75,230,140, 60,123, 75,157,154,162,
-192,213,189, 51,112,117,239,140, 90,164,205,254, 16, 8,119,229,217, 44, 77,119,228,165,167,167,199, 28, 63,126, 28,211,167, 79,
- 71,113,113, 49,146,147,147, 99,234,123, 70, 44, 22,203,218,180,105,227, 48,255, 50,210,211, 99,218, 28,255, 3, 37,211,135, 65,
- 88,172,194,231, 75, 62,142,169,109, 28, 3,233,233, 25, 49, 2, 67,132, 44,168,141,222, 33,249,207,122,105, 10,253,175,249, 51,
- 56, 97,209, 25, 97,224,157, 11,228,194,109, 53,194, 67,188,241,112,143, 48,180, 85, 94,193,117,141, 30,124,150, 67, 0,225, 9,
-254,239,197,233,220,107,175,188,112, 37,166,131,180, 65,210, 81, 40, 53, 65,131, 6,249,164,245, 30,242,184,201, 55,168,163,200,
- 39, 32,148,149,248,120, 27,131, 90, 5, 27, 66,194,219,243, 21,114,141, 72,173, 98,160, 80, 25, 93,113, 99,199, 56, 67,156, 78,
-198, 3,220, 99,249,215,167,148,187,160, 4,144,122, 62,235, 30,245, 61,231,148, 60,110,107,224, 61,135,139,242, 26,202,211, 38,
-145,118, 93,165, 34, 35, 67,129,230, 34,127,138,162,184,125,251,246,201, 88,150,197,235,175,191, 14, 66, 8,142, 30, 61, 10,203,
-214,187, 44,113, 67, 30,104,154,254, 29, 0,211, 12,158, 0, 57, 0,200,229,242,237, 65, 65, 65,177, 46,126,151, 15, 0, 51,103,
-206, 20, 1,200,202,206,206,238,178,108,217, 50,166,174, 18, 26, 28, 28,140, 67,135, 14,197, 36, 37, 37, 57,212,202,120, 68,224,
- 71, 51, 92, 91,163,209,212,197,204,178,189,204, 44, 59,192, 76, 72, 47,240,120,237, 9, 33,109, 64,120, 97, 44,135, 8,142,102,
-219,169,245,166,144, 80, 63, 70, 72, 13,210,220, 55, 5, 32,220,106,241,175,132,101,156, 99,165,245, 60,220,141,223,154, 1,160,
-216, 90,153, 22, 1, 8,178,126, 18,235,117, 87,247,218,253, 55,128,107, 0,214, 1, 16,192, 50,134,205, 0,248,204,122,189, 41,
-251, 47,143, 4, 80, 1, 96, 84, 51,145,236, 11, 0,222,183,126,182, 52,244, 4,240, 35,128, 71,173,158,148,158,238, 10,178,145,
-191, 61,233,219, 43, 1, 46, 87, 78, 43,249,219, 80, 87, 9,112, 71, 94,157,206,140,184, 42,239,240,225,195,160,105, 26, 3, 7,
- 14,140,237,214,173, 27, 10, 11, 11,107,222,143,101, 89, 72,165, 82,110,241,226,197,178,227,199,143, 99,220,184,113, 14, 59, 20,
- 67,238, 41, 80, 52, 3,229, 64,105,172,177, 91, 48,174,109, 56,124,151,180, 88, 14,115,164, 27,184,195,139,131,101, 55,142,251,
- 35,238,249,171,142, 59, 40,138, 87, 93,113, 33,151, 45, 83, 26, 80, 85, 77,115,241,253, 34, 56,127,137, 16,183,148, 90, 84,168,
-244, 72,236, 31,193, 81,132,112,191,253,180, 31,170, 35, 39,184, 51, 59,127, 46,106, 76, 92,238,239,109,231,132,132,250,117,108,
- 27, 17,197,120, 73,216,142, 35, 31, 79,244,233, 48, 48,121,124,235, 46, 79,198, 5,181,141,238, 43,175,110, 29,111,162, 77,166,
-235, 5, 90,167,134,222,172, 4,229, 84,157,200,204,204,148, 57,152, 25, 80,239, 61, 39, 98, 94,254, 17,179, 3,146,147, 3,145,
-156,124, 87,185,181, 17,119,115,144,118, 61, 10,140,219,150, 63,199,113, 48,153,238, 14,217, 15, 31, 62,220,214, 94,220,149,109,
- 18, 8, 4, 38,150,101,143, 91, 61, 1, 77, 81, 2,106,134, 62,229,114,185, 44, 40, 40, 40,217,133,239, 22, 38, 38, 38,250, 29,
- 62,124,120, 69,118,118,118,235,175,191,254,154, 93,188,120, 49,127,243,230,205,232,210,165, 11, 0, 32, 50, 50, 18, 42,149, 10,
- 75,151, 46, 53, 31, 58,116, 40, 62, 41, 41,233,213, 70, 37,178,140,191,217,204, 68,154, 25,115, 79,147,217,212,159, 71,145, 40,
- 33,159, 18,137, 5, 60, 53,223, 75,120,219,219,151,119,135, 39,230,140, 98, 30, 47,136,207,208,109,110,156,249,221,119, 70,200,
- 39,110,199,189, 57, 82, 0, 30,179, 90,135,246, 56,102,189,238, 10,166, 1,120, 29,150,177,146,247, 1,252, 1,203,252,201, 63,
-172,231, 82,235,253,105, 78,202,243, 2, 48, 11, 64,146,245,220,104,119,192,122,125, 22,238,221,202,215, 89, 76, 1,240,149,245,
-179,169,120, 30,192, 28,107,158,205,177,158,183, 20,116,178,186,176,126, 6, 48, 23,192,108, 0, 49,240,160, 65,148,150,150,202,
- 6, 15, 30,140,217,179,103,231, 12, 30, 60, 24, 39, 78,156,192,250,245,235, 99, 90,183,110, 45,163, 40, 10,133,133,133,164,178,
-178,146,188,246,218,107,177, 71,142, 28,145,189,244,210, 75,141,146,205,208, 27,183,100,101,131,187, 35,121,246,236,156, 63,195,
-204,177, 61, 85, 65,178,140,245, 25, 49, 22,237, 4, 88, 87,248, 60,217, 82, 25, 79, 70,190, 86, 26,123, 52, 83, 42,139,125,120,
-101,131,229, 83, 66, 51,171, 62,255,124,115,208,246,243,165, 55, 55,159, 41, 86,110, 56,126, 93,123,163,204,192, 81, 28, 5,131,
-206,140,138, 10, 26,121,197, 10,243,174,194, 82,205,158, 91,101,202, 29, 69, 37,151,143,149,149,143,185,105, 52,125,212,144, 76,
-191,192,240,118,250,106, 69,219, 30,209,143, 80, 52,137, 28, 89,122,249, 71,125, 96,144,183,164, 67,247,126, 21, 28, 83,113,158,
-240,252, 66, 88,150,229,221,185,163,119,198,139, 87,215, 53, 93,159, 27,188, 86,148,187, 19,227,207,164,174,165,111, 59,238, 7,
-161,181, 20, 52, 22,148,103,231,206,111, 18,154, 67, 78,117,117,181, 12, 0,248,124, 62,222,122,235, 45,228,229,229,193,205,113,
-127,123, 24, 1, 24,141, 70,163,177,180,180, 52, 11, 77, 11, 8,212,212,114, 7,200,229, 25, 65, 65, 65, 19,156,245, 20, 27, 12,
-134,254, 11, 23, 46,124,242,149, 87, 94,225,122,247,238, 77, 0, 96,201,146, 37,200,207,183,236, 70, 57,100,200, 16,176, 44,139,
-225,195,135, 83,211,166, 77,227, 46, 95,190,188,238,249,231,159,127,222,203,171,126,106, 98, 89,206,144,115,240,224,182,194,194,
-235,207,155, 77,230, 48,158, 64, 98,224, 17,177,138, 18, 9, 85,148,216,171,156, 22,120, 85,130, 18,221,102,197,102,131, 70, 85,
-213, 74,182,251,236,123,230, 83,191,187, 29,247,230, 72, 1, 24, 3,224, 80,157,107,135,172,215,157, 5, 15,192,187, 0, 18, 1,
- 84, 53,240, 76,149,245,254,187,112,110, 92,103, 26,128, 3, 0, 84, 13,220, 87, 89,239, 79,115, 35, 79, 30,129, 37,134,224, 67,
-235,231, 35, 77,168, 92,241, 86,175,201, 16,107,122,134, 88,207,227, 93,148, 19, 8, 32,192,137,195,213,161,148,161, 0,157, 16,
- 39,240, 0, 0, 32, 0, 73, 68, 65, 84, 78,226,110, 4,112,145,213,211,227, 86,156, 71, 93,139,191,174, 71,192, 85,176, 63, 4,
-162,243,184,111,106,206, 59,143,251,166,222, 64, 62, 87,228,213, 33, 19,206, 21,121,107,215,174,229,242,242,242,112,250,244,105,
-180,107,215,142,251,229,151, 95,160, 86,171,113,233,210,165,123, 44,218,119,223,125, 55,167, 71,143, 30,177, 91,183,110,109, 80,
-222, 23,107,215,114,237,243, 46, 32,244,116, 62,100,237,198,113,189,175, 48, 50, 74,109,130,249, 82,245, 61,207,190,249,238,139,
- 57, 17,209,167, 99,139,254,152,210,160,245,124,173,164,228,237, 18,154, 89, 85, 81,169,151,210,122,115, 96,254, 45,181,207,158,
-203,165, 85,198,200,190,232, 17, 26, 4, 0,216,115,246, 14,191,160,172,218, 15, 64, 96, 25,109,232,113,211,104, 74, 40, 40, 45,
-125,187, 33,153,163,198, 39, 82,221, 70,126,208,155,209,254, 81, 28,209,125,180, 68, 32, 48,211,215,254,200, 82,150, 22, 95,186,
- 83, 94,252, 91,177, 90, 94, 10, 80, 20,145,107,104,255, 89,137,253, 29,213, 27, 82,135, 84,234,115,171,215, 10, 4,180, 62,255,
- 87, 69,227,255,237, 96,111,245,215,245, 8,184,235, 85, 8, 10,202,110,178, 28, 0, 24, 57,114, 36,119,248,240, 97,176, 63, 4,
-128,227, 56,124,252,241,199, 56,114,228,136, 77, 81,115,187, 12, 20, 10,133,145, 16, 50,226,212,169, 83,134,240,240,240,184, 38,
-122,117, 2, 0,203,108, 0,235,231, 12, 0,108, 80, 80,144, 51,134,154,106,247,238,221,165,251,247,239,255,106,243,230,205,228,
-232,209,163,100,244,232,209,156,141,252, 1,203,118,247, 34,145, 8, 69, 69, 69,216,183,111, 31, 9, 12, 12,100,134, 13, 27,246,
- 43,203,214,111,180,119,142,234,114,123,200,144, 33,179, 46, 94,252, 51, 66,173,213,132,113,140,201, 4, 10, 70,198, 72, 85, 27,
-141, 70,165, 26,101,183, 88,163,225, 78,105,113,153,241,231, 61,123,215,180, 10, 14, 41,162,105, 93,181,187,121,201,175,167, 97,
-216, 10,166,181,245, 56, 92, 71, 81, 56, 12, 96, 1,128,182, 0,202, 28,100, 62,129, 37,118,224, 56,128, 27, 14, 20,142, 27,214,
-231,230,161,225, 56, 3, 91,250, 38, 3, 72,113, 32,239,107, 88,134, 24,190,114,144, 62,251,138, 40,133, 37,206, 97, 32, 0, 53,
-128,247, 0,156, 6,208, 17, 64,161, 19, 46, 68,123,121,207, 0,120,209, 74,178,122,107, 90,245,214,243,116, 88,226, 1,190,119,
- 66,222, 12, 0,175, 56, 89,193, 9, 44,177, 16,223, 56, 72,223, 42, 0,190,176,196, 58,236,182,166, 77,108,213,164,255, 0, 48,
-216,234, 17,248, 21,119,227, 53,234, 69, 92, 92, 92,172, 61,209,219, 43, 1,117, 99, 3,226,226,226, 98,179,178,178, 26,125,129,
-184,184,184, 88,106,202,221,113,123,246,135, 64, 80, 86, 37,160,238, 88,190,219,242,166, 40, 56,119,228,157, 61,123, 22, 17, 17,
- 17,184,124,249,114, 77,157, 25, 54,108, 24,151,155,155,139,241,227,199,223,235,166,242,242,146,137,197, 98,168,213,234,122,229,
- 73,207,158,133, 50,162, 13,250, 93, 62, 81, 35,239, 77,191,199, 98,162,114, 85, 50,106,188,248, 30,197,169, 56,159,134, 72,108,
-178,212,204,134,149,128,133,104,215,238, 55, 0, 67, 56,112, 60,220,168,120, 67,199, 48, 96, 12, 22,231,216,197,138, 10,220, 48,
-208,155,248,132,104, 64,136,169,160,180,116, 91, 99,249,215, 86,218,109, 33,128,212,252,163,243, 11,197, 97,147, 21,165,101,226,
-118,101, 37,167,196, 16, 4,117, 42, 44, 50,135, 87,149,221,132, 80, 40, 8,237, 25,230, 61, 77,169, 49,125, 11,224,166, 35,203,
-213, 58,247,223,225, 48, 64, 66, 66, 66,108,102,102,102,142,203,236, 94,103, 8,224, 31, 16,168,219,100,175,128,139,223,231,154,
- 42,111,212,168,145,156, 76,150, 3,178,205, 18,143,125, 96,177, 47,198, 44,215, 96,228,200,145,112,113,218,223, 61,176,141,213,
- 63,252,240,195,186,102, 80,232, 20, 65, 65, 65,211,237,140, 83,163, 92, 46,223,227,228,119, 25, 0,229,187,118,237,146, 61,245,
-212, 83,209, 43, 86,172,232, 99, 54,155,137, 68, 34, 65, 92, 92, 28,126,249,229, 23,176, 44,139,113,227,198,113,243,231,207, 39,
-253,250,245, 51, 78,158, 60, 57, 50, 33, 33,225, 78,191,126,253,234, 87,192,230, 36, 51, 49,143,140,217,212,171,119, 31,255, 83,
- 39, 79,174,252,157,207,239,213, 33,178,195,151,126,193, 33, 37,130, 16, 49,119,120,223,161, 64,185,162,106, 68,120, 80,200,251,
- 93,186,116, 57,236, 19,230,189,254,147,101,159,211, 13,201,115, 85, 1,224, 1,136, 6, 48, 12,192, 50, 0,175, 89, 43,131,119,
- 29,242,251, 6,150,113,246,127,193, 50, 36,144,215,136,135,225, 33,171,245,235,140, 59,254,184,213,187, 64, 53, 34, 47, 4, 64,
-164,149,152, 27,147,121,218,250, 92, 40, 44,227,249, 13,201, 19, 90, 45,231, 36, 88,166, 17, 62, 3, 32,223, 42, 59,223,122,190,
- 25,150,113,242, 77,176, 12, 93,208, 14,228, 77, 1,240, 5,128,110, 86, 37,201, 62,157,183, 97, 9, 90,188,108,125,246, 7, 7,
-242, 94,135,101,118,131,206,137,252,243, 2,176, 31,192,119, 14,202,227,105, 0,255,177,126,254,110,151, 62,129,181, 44, 51, 1,
-172, 1,176,220,122,255,118, 67, 63,152,149,149,149, 3, 0,197,197,197, 50, 91,180,127, 93,171,191,184,184, 88,102,255,108, 99,
-176, 61,179,233, 87,186, 38, 58,191,174,149,190,233, 87, 26, 15, 66, 94,110,110, 46, 70,140, 24,129,203,151, 47,223, 37,113,169,
- 52,118,235,214,173,178, 14, 29, 58,196,178, 44, 43,139,140,140,228, 88,150,133, 94,175,199,207, 63,255,140,232,232,232,216,125,
-251,246,213, 43,175,107,110, 46,190, 15, 14,173,149, 87,221,231,142,129,118,229, 77,224,209, 80,112, 44, 48, 39,242, 43,174,154,
-245,129, 92,239, 7,121,126, 16,250,142,216, 29,123,105, 71,227,110,246,107, 37, 37,219, 1,108,239, 24,209,182, 43,128, 55,140,
-102, 22,219,206, 23, 98, 68,152,101,184,147,112,156, 70,195, 48,203,202,203,203,239, 56, 65,166, 43, 57,142,243,206,191, 44,127,
- 86,121,122,107,171,242,219,114,148,223,209,128,207,175,242,174, 86,112, 80,170,205, 92,104,136, 48,128,207, 98,146,222,104,254,
-126,217,235, 15, 7,252,235,147,227, 74, 7, 68,147,227, 68,167, 77, 92,137,100,191, 7,163,173,158,151,236, 68, 87,191,105,243,
-134, 57,138,202,183,127,142, 56, 43,143, 36, 42,208, 68,121,247, 88,236,153,153,153, 24, 56,112, 96, 75,210, 69,184,156, 57, 23,
- 0, 27,249,159,103,176, 65,102,105, 99, 77, 37,127, 91,221,224,241,120, 33,124, 62,191,252,248,241,227, 95, 62,252,240,195,238,
-174,243, 0, 0, 17,114,185,124,157, 85,177,152, 34,151,203,127,176,125, 58,227, 84, 4, 80, 13,160,114,197,138, 21,125,231,205,
-155, 87,122,246,252,249, 54,122,189,158,200,100,135, 32, 18,139, 64, 17, 10,135, 14, 29, 34, 61,122,244,208, 37, 36, 36, 12,158,
- 60,121,178,195, 54,151,115,232, 0, 51,225,169, 9,107,250,246,237,223,129,102,140,143, 95,203,191,250, 34, 91, 88,240, 2, 0,
-136, 65,113,189, 59,117, 61, 21, 26, 26,146,195,227, 11,223,254,207,226,148,234, 79,150,125,236,118, 70,214,167, 0,188, 97,213,
-134,198, 3,184, 4,192,167,158,239,237,181, 90,236,241,176,204, 35, 79,106,196,253,223, 25,150,232,114,103, 20,128, 42,235,243,
-188, 70,228,197, 0,184,234,164,188,171,214,231,119, 52, 34,111, 22,128,153, 0, 46, 0,152,111,125, 47,123,217, 50,171,245, 63,
-199,106, 13,111,180, 90,217, 13,201,155, 97,205,143,126, 86, 47, 66,125,233, 84, 91,239,219, 60, 1, 27, 27,145,247,181,181, 83,
-240,114,178,243,250,218, 65,254,125,100,245,108, 28,176, 42, 53,168, 35,251, 23, 0, 61,172,101,145,111, 85,164, 28,186,118, 87,
-175, 94,205, 1,144, 53,211, 66, 64,100,230, 26, 45, 55,115,141,182,158,133,123,220, 10,114,106, 22,121,127,254,249, 39,249,243,
-207, 63,107, 93,251,238,187,239,114, 0,144, 31,126,248, 1, 0, 72, 81, 81,237,152,186,134,200, 31, 0,218,255,249, 39, 1,106,
-203,123,249,131, 5, 22,114,252,208,154,166,186, 33,122, 59, 92,232,133,205, 92, 33,248, 0,175, 26, 53,228,111,101,245, 59, 98,
-177,216,169, 69, 68, 56,142, 35,132,144, 37, 11, 19,123,122,133,181,139,156,192,194,171,115, 73,113, 25,207,100, 80,114,173, 67,
-125,136,143,183,128, 48, 38, 22, 10, 37,205, 16, 9,145,168, 52, 76,167, 70, 12,130,134,234,108,221,255, 31,164,139,222,126, 56,
-162, 33, 98,225,224,222, 44,128,230,144, 87,175,197,222,161, 67, 7,156, 62,125,186, 69,144, 63,251, 67, 32, 14,156,103, 0, 0,
- 27,101, 52,190, 63, 78,219,188, 48,164,185,202,199,108, 54, 87, 1,192,128, 1, 3,154,180, 32,144,141,252,173,168,180,126, 58,
-187,192,142,208,106,152,157, 1,128, 79, 63,253, 52,252,249,153,207, 47,122,104, 96,244, 12,141, 90,237,207,152, 25, 83, 88, 88,
-216,157,240,240,240,171,106,181,122,249,228,201,147,243,157, 77,215, 79, 63,254,196, 0,120,237,217,233, 47, 14, 31, 54,124,248,
-120,137, 68,210,138,128, 51, 91,102, 78,112, 85,122,173, 98,221,149,243,197,183,189, 69,194, 38, 45,124, 87, 87, 1, 48,195, 18,
-164,230,204, 56,252, 41,235, 97, 70,195,203,139,154, 97,137,168,119,118,190,166, 12, 64,182, 3,121,187, 96, 9, 90,115, 6,207,
- 58,145,190,207, 1,124,233,168,239, 7,240,170,221,119, 26,147,247,141,213, 99,224, 8,133, 86,203,222,153,244,185, 50,223,245,
-115, 7,242, 30,117, 66,158,205,219,176,209,154, 55,206, 44, 31, 75,226,226,226, 98,234, 70,253, 91,221,234, 57,238, 52,244,184,
-184,184, 24,187,149,250, 90,154,188, 22,143,235,165,183,141, 84,187,118, 27, 95, 89,153, 62,211,118,141, 22, 80,223, 25,116,236,
-254,178,226, 98,141, 83,153, 70, 8,247,159, 89, 67,200,123,159,255,182,240,231, 53,161, 59, 79,156,188, 61, 59,196,159,125,146,
- 10,242, 11,224, 56,128, 16,206,104,100,216, 50, 22,168,164,141,108, 64,233,109,189, 75,171,147, 89,221,252,178, 58,231, 45, 37,
- 11, 91,220, 74,128,127, 23, 60,182, 92,115,191,223,145, 5,208, 70, 44, 22,223, 30, 48, 96,192,163,103,206,156,105,178, 64,185,
- 92,126, 48, 40, 40,104,166, 92, 46,223,232,130, 2,192, 88, 61,167, 0,128, 13, 27, 55,164,192, 50, 60,221, 44,248,246,187, 47,
-127,133,101, 40,246,190,160, 62, 5,192,224,142,214,215, 72, 33, 25, 61,242,254,177,242,106,193, 74,164,164,206, 53,183, 43,103,
- 75,151,247,119,128, 92,167,123, 1,240, 50, 1, 8, 97,193,149, 26, 12,244,230,178,178,138,115,214,142,203, 41,188,247,249,111,
-220,143, 31,141, 37,227, 95,219,159, 11, 32, 55, 97,112,215, 55,130,130, 68,139,248, 60,194,221,174, 50, 92,185, 77, 51,155, 36,
- 2, 74, 44,225,243,120, 38,134, 21,187,146,190,204,204,204, 28,219,242,182,214, 79,183,148,177,123,166,254,217,185,254,157,152,
- 22,216, 88,189, 39, 46, 92,255,171,229,221, 55,197,167, 41, 74, 24, 53, 69, 1, 66, 8,158,156, 56,171,222, 62,100,215,143, 25,
-205,245,174,101, 0, 72,115,144,191,157, 18,176,209,133,199, 3,173,237, 72,251,119,237, 31,248,245, 84,196,230,140,152,241,200,
-251,103,203,243,160,165, 43, 0,114, 57, 39,151,203,103, 53, 85,206, 83,111,238,231, 0,224,217,145, 61,200,183, 71, 46,126,172,
-231,230,172,121,109,234,241, 30,180,150, 68, 5, 9,248,173, 64,136,206, 71,194,175,232,213,205, 47,127,219, 1,215,100, 91, 93,
-217, 77, 89,111,254,126,145,231,223,197, 3, 64, 90,146,215, 36, 35, 35,157, 75, 78,158, 77,118,253,152,241, 79,111, 94,225, 86,
-131,217, 23,150, 61, 1,254,118, 32,238,238, 35,236,129, 7, 30,252, 13, 53,126, 30,224, 37, 34, 96, 89, 14, 32, 4,213,122, 79,
-243,247,192,131,255,217,254,192,147, 5, 30,120,240,191, 3,198, 12,168,117, 78, 47, 59,239,129, 7, 30,252,131, 65,121,178,192,
- 3, 15, 60,240,192, 3, 15, 60, 10,128, 7, 30,120,224,129, 7, 30,120,224, 81, 0, 60,240,192, 3, 15, 60,240,192,131,127, 34,
-106,197, 0,156, 61,123,214,237,104,212,250,130, 9,235,147, 55,254,145,232,152, 94,125, 58,201,218,180, 11,143,213,232,181,178,
-195,178,220,216,172, 67,231,114,220,149,215,123,240,152,152,126,125, 6,203,238,148,150,194, 91,226,141,155, 37, 5,177,121, 39,
-246,186, 45,175,185,223,119,238, 52, 42,102,200,224, 14, 50,137, 55, 15,124, 30, 5, 34, 38,120,114,234, 69,226,174,188,228,255,
-151, 27,243,208,224,135,100,254, 62, 60,128, 15, 36, 12,174,127,142,211,131,122, 95,143,188, 22, 43,175,209,169,102, 45,253,125,
- 59, 12,120,154,243, 99, 11,238,107,250,126,127,183,200,237,142,180,255, 7,145,247, 92,251,184, 85,169,219,242,222,168,188,119,
-195, 85, 79,125,254, 75,228,241, 81,207, 20, 89, 87,228,197,198,198, 70, 25, 12, 6, 69,110,110,174,242, 65,190,175,203, 10, 64,
- 67, 88, 29,131,206, 0, 58,192,178, 78, 64,193,252, 28,220,112,246, 7,198, 12,239, 16, 67,192, 34, 36, 32, 8,185,135,207,200,
-222,153, 59, 3,195, 70, 15, 3,163,213,201,122,116, 27, 9,150,133,108,222,139, 15,199,246,239,223, 7,215,174, 21, 65,165,212,
- 98,237,198, 35, 57, 13,201, 27, 56,226,153, 24, 14, 4,145,157, 58,200,146,223, 92,142, 23,158,121, 12,223,252,247, 51, 0, 98,
-236, 61, 87, 2,138,130,108,245,146,197,200,207,191, 2,169, 52, 18, 34, 9, 31,183, 74,242, 99,161,171, 63,201,139, 30,235,203,
- 9,133, 66, 72, 36, 18, 20, 20, 20,160,109,168, 31, 90,241,125,208, 54, 34, 0,129, 18,127,120, 19, 51, 40,138, 2,199,154,161,
- 19,241,161,186,163,194,164,255,102, 57, 44,168,212,133,125, 56, 95,137, 10,126, 1, 66,248,120,243, 33,148, 80,224,243, 0, 74,
-200, 71,206,207,209,156,137,227, 33,110,194, 9,167, 11,188,247, 83,171, 99,194,195,195,209,174, 99, 59,153,222, 96, 4, 37,146,
- 0, 38, 96, 78,218,169, 24,189, 78,139,175,254, 21,147,243, 0, 21,201,150, 54,143,249,127, 25,174,150,133,211,207, 39,188,179,
-200, 27,192, 67,173, 37, 94,255, 41, 45, 45,237, 38, 16,139,192,122,121,125, 8, 96,125,230,135, 41,213, 45, 37, 3,162,122,140,
-138,185,113,241,112,125,123, 13,252, 35,234,104, 70, 70, 6,249,102,211,166,203, 34,161, 80,194,178,172,191,183,143,143,207,132,
- 39,159,244, 2, 64, 39, 39, 39,115, 45, 52,205, 20, 0, 36, 39, 39,179,205, 32,206,207,223,223,127, 65,215,174, 93, 39,139, 68,
-162,118, 37, 37, 37, 37,165,165,165, 39,105,154,254, 0, 64,129, 27,242, 2, 2, 3, 3,151, 63,242,200, 35,143,135,133,133, 73,
- 79,157, 58,117,231,194,133, 11,199, 13, 6,195, 82, 88, 86,136,117, 26,163, 70,141, 74,141,136,136,120,219,219,219, 27,190,190,
-190,167, 15, 28, 56, 16,253,183,241, 0, 52, 64,254, 60,111, 17,255,161, 25,195, 59,174, 98, 57,206,112,244,202,157, 79, 87,199,
-168, 14,204,207,193, 69, 71,223,149,223, 62,200, 25,171,229, 48, 85, 43,193, 55, 83,248,227,226, 21, 60,247,220,252,154,251, 20,
- 5,252,150,187, 17,173, 34,194,101,108,181, 26, 52, 75,112,232, 80,110,236,218,141, 71, 26,144, 24,201,157, 62,113, 17,196,203,
- 15,103, 46, 22,227,220,197,231,241,213,247,191,212,220,101, 89, 96,236,208,161, 64,117, 25, 0, 95, 20, 92,184, 4, 65,171, 0,
- 12, 27,210, 75,166,212, 53,162,179, 16, 10, 32, 20,250,245, 25,128,214,222, 66,180,109, 37,134, 95,112, 16, 2, 69,190, 8, 20,
-243, 32,224,241, 96, 50,155,161,100, 88,156,170,116,188,220,230,210, 87,219,115, 18,158, 2,126, 94, 94, 8,105, 21, 12, 63, 63,
- 47,112,148, 25, 12, 91, 13, 51,204,240,241,241, 66,171,214,237, 80,112,185, 11,215,177,219, 55,141,118, 74,253,227,215,112,254,
-190,222,240, 15, 8, 68, 72,171, 96,104,181, 90, 8, 69, 98, 8, 12,150,197,249,162,164,145, 50,185, 66,137, 71, 94,220, 24, 91,
- 92,114, 11,138,178, 34, 84,157,203,112,164, 12, 56,221, 73,140,158, 57, 58, 54,123, 99,118,142, 19,178,238,171, 18, 80, 88, 88,
-200, 1,128, 84, 42, 37, 45, 69, 94,120,120,248,115, 52, 77,111, 4,128,201,177,177, 84,198,214,173,238,116,190,150, 53, 82,237,
- 28, 57, 28,199,129, 16, 82,243,105,187,102,123,206,193, 78,106,174,172, 39,239, 10,249,247,240, 54, 49,219,125, 3,252,187, 1,
-128, 80, 34, 6,173, 55,128,213,234, 82,143, 31, 57,188, 36,225,157, 69,221, 51, 63, 76, 41,118, 36,231,211,119,231,114, 86, 11,
-139,129,101, 8,146,181,246, 67,245,246, 69,125, 71, 61,142, 81,143, 61,225, 82, 25,221,184,120, 88,214,169, 87, 76,236,181, 63,
-114, 92, 87,138, 19,228, 46, 61,158,152,152,136,173, 9,217,141, 62, 19,155, 93,123, 43,146, 30, 1,150, 87, 45, 55,176,208, 51,
-150,114,213, 90, 63, 51, 6, 7,160,139,175,160, 81,121,171, 86,173,202,121,247,245,183, 66, 39, 78,158,228, 99, 48,232,177,250,
-227,143,168,181,107,215, 26,230,206,157, 27, 14,224, 86,115,183,189, 73,147, 38,141,222,185,115,103,150,171, 74,212,204,153, 51,
-185,194,194, 66, 84, 85, 85, 97,197,138, 21,240,245,245, 69, 76, 76, 12,164, 82, 41, 54,110,220,232,110,187, 27, 57, 96,192,128,
- 77,111,190,249,230,181,174, 93,187,110,236,223,191,255,165, 59,119,238,180,203,205,205, 29,240,194, 11, 47,236, 81,171,213,169,
-176,108, 0,231, 44, 98, 39, 79,158,156,153,146,146, 18,108, 50,153, 32,145, 72,224,237,237,221, 70,171,213, 62, 61,113,226,196,
- 9,231,207,159,159, 11,224,191,206, 10,139,136,136,104,187,104,209, 34,228,229,229,113, 26,141, 38,160,206,109, 30,156, 91, 85,
-181, 89,112,246,236,217,186, 94, 2,231, 20,128,213, 49,104, 15,203, 14,120, 60, 0,102,173,145,185,153,123,181,252,147,161,157,
- 67,231, 63,210,163,205,146,214,254,146,182,171, 81,182, 5,192,149,249, 57, 13,111, 82, 99,172,150,163,117,167, 71,177,252,237,
-201,216,104,199, 73,135,143,167, 67,171, 51, 98,220,232,249,120,120,216, 76, 60,147,248, 8, 36, 18, 17,104, 51, 3,141,142,150,
- 53, 92,201,138, 0, 26,152, 60,125, 61, 94,126,115,118,205,213,177, 15,199, 64, 44, 22,225,199, 67,191, 96,239,177, 92,108,218,
-240, 25, 12,122, 35,132, 60, 62,124,188,132,208, 86,149,196, 42, 75, 80,239,238, 99, 28,199, 1, 28,107, 57, 40, 22, 28,199,193,
- 72,139, 44,221,147, 8,224,104, 51,204, 60,192, 12, 51,204, 52, 11,198,220,184, 2,187,240, 69, 41, 23,232,199,192,207,215, 27,
-225,237,162,208,173,119, 39,248,250, 72,160,170,174, 64, 89, 69, 25, 20,170, 59, 48, 25, 8,188,188,188, 16, 18, 50, 12,149,229,
- 33, 92,171,208,143,234,119,227,143, 92,204, 49,122, 29,244,124, 64, 40, 22, 66,175, 19,130,214, 9, 97, 16,139,192, 39, 12, 56,
-240, 96,208, 87, 67,175,211,160, 93,187,182, 50, 33,143, 15, 57,212, 8,165,167,163,238, 26,243,117,177,114,211, 74,135, 21,232,
-237,164,183, 27,239, 43, 19, 18,106,237,239,158,144,144, 48, 48, 40, 40, 40,159, 16, 98,224, 56,142, 31, 24, 24,232, 85, 80, 80,
- 16,108, 93,221,173,173,187, 21,121,238,220,185, 83,237,126, 35,198,221,213,226,234,101, 75, 66,184, 57,115,230,196,174, 93,187,
-214, 37,153,225,225,225,201,131, 6, 13,250, 96,120,191,126, 48,137, 68, 72, 75, 75, 99,103, 79,153, 18,151,254,195, 15,217, 46,
-254, 62, 86, 45, 89, 82,115,190,224,253,247,145,182,116,105,163,231,206,136,173, 67,238,156,117,179, 24,110,244,232, 14, 61, 1,
- 92, 79, 73,201,212,187, 72,254,185,189,123,246,244,179,181, 25,111,177, 4,183, 43,202,161, 86, 40, 49, 96,208, 96,175,159,191,
-218,144,157,240,206,162,158,153, 31,166, 56, 90,155,157,153,247,193, 90,254,179, 79, 79,224,119,150, 74, 89,171, 18,128,247,211,
-214,212, 86,162, 23,188, 6, 0,120,247,245,185,110,109, 39,237, 22,249,219,144, 25,228,194,195,163, 93, 18,237,205, 39, 56,183,
-244, 69, 16,191, 86, 48, 95, 63, 7,227,245, 63,145, 47,215, 34,122, 95,185, 83,223,239, 63, 96,192,209, 89,211,146, 34,147, 94,
-122, 33, 32,243,187,239, 89,169, 84, 74, 45, 79, 73,133,239,146,229,248,241,199, 31, 75, 51, 50, 50,168,230,242, 2, 76,154, 52,
- 41,110,231,206,157, 7,118,238,220,105, 59, 31, 99,251,223,129,130, 18,115,224,192, 1, 89, 81, 81, 17, 58,118,236,136, 17, 35,
- 70,192,223,223, 31, 74,165, 18,183,110,221,194,141, 27, 55, 48,102,204, 24,110,204,152, 49,177,111,189,245,150, 43,229, 52,233,
-145, 71, 30, 89,189,106,213,170, 45,253,251,247, 95, 77, 8,185,101,215,143,147,248,248,120, 31, 0,185,214,195, 41,121,115,231,
-206,221, 54,103,206, 28,234,244,233,211, 32,132, 32, 56, 56,184,230,216,183,111,159,112,200,144, 33,159,221,188,121,243,132, 35,
- 65,147, 39, 79, 38, 59,118,236,224,138,138,138, 34,242,243,243,113,253,250,117,162, 82,169, 58, 2,224, 79,156, 56,209,188,107,
-215, 46,238, 65,146,191,237, 90, 93, 37,128, 95, 15,249, 7, 71, 71, 5, 39,245,139, 12,154, 78, 8, 17,112, 28,103, 98, 45, 7,
-109, 54, 25,244, 66,138,109,219,187,181,248,237, 86,126, 29, 59,237, 60,117,227,251,213, 49,236,209,249, 57, 13,239, 22, 7, 8,
-209,163,123, 87, 80, 84, 14,242,149, 85, 0, 46, 65, 85,122, 21, 2,177, 8,187,246,124, 10, 93,165, 25,211,159,127, 3, 44, 11,
- 60, 57, 97, 40,204,124, 31,135, 47,151,159,127, 9, 44, 11,140,235, 75,172,188, 18, 9,131,145, 70,252,216, 49, 16, 7, 80,216,
-180,121, 63, 40, 10,216,246,253, 70,148, 94,255, 51,118,223,150, 85, 57, 13,109,151,200,114, 0,203,178, 96, 89, 22,102,179, 25,
- 70, 1, 7, 19, 49,129,166,105,232,188, 12, 0, 43, 6,197,153, 97, 22,114,168,166, 13,208,170, 85,141,166, 45,196,199, 8, 62,
- 95,130,224,224, 96,116,234,212, 9, 97,173, 7, 3, 60, 10,102,243,105, 80,156, 18, 6, 45, 3, 51,171, 69,217, 45, 57, 66,130,
- 43, 17, 28, 48, 12, 31,174,250, 57,230,251,111,239,149, 37, 49, 48,224,140,149,128, 65, 4,154, 50, 65, 43,228,163, 90, 34, 0,
- 95, 32, 4, 88,111, 16, 30, 65,181, 86, 7, 69, 89, 17, 10, 78, 31,131,188,184, 24, 44,203,130,226,120,110, 85,154,175,214,223,
- 85,156, 95,120,229, 5,199,253,100,237,213,199, 12,153,153,153,139,222,124,243,205,217,197,197,197, 20, 33, 36, 36, 35, 35,227,
-123, 88, 54,119,242,114,183, 34,207, 74, 72, 16,172, 91,183,110,243,157, 59,119,176,109,219, 54, 68,119,237,202,107,142, 6, 34,
-149, 74, 73, 98, 98, 98, 12,199,113,178,181,107,215,186,188, 97, 17, 77,211,233,195,173,117, 74, 40, 20,162, 75,151, 46,216,126,
-232, 80, 86, 72, 72, 8, 42, 42, 42,156,150,115, 31,183,170, 37, 3, 7, 14,228,108, 27,196,216,125,254, 57,106,212,168,210, 69,
-139, 18,252, 83, 82, 28,175, 30,151,240,206, 34,111,111, 19,179,189,119,207,158,126, 60,138,194,171,207, 78,135,222, 96, 68,218,
-151, 95,194, 75, 34,129,193, 96,128, 65,175, 71,223,254,253, 58,255,242,221,119,115,208,240, 86,222, 53,125,206,210, 5,175,177,
- 0,168,171,133,133, 84, 93,194,175,219, 60,221,121,241,246,221, 70,198,222,188,124,132,139,123,242,197,216,172,221, 95,186,165,
- 8,216,239,218,199,109, 13,116,120,221, 17,122, 4,240, 81, 84,109,198,225,184, 16, 8,230,103, 64, 61, 61, 10,252,192, 80,151,
-200, 63, 49, 49,177,204,164,213,221,122,233,213,217,237,223,121, 99, 33,214,110, 72,191, 56,104,192,128, 14,233,107,210,189, 94,
- 95,248, 22,190, 27, 58, 24,155, 55,111,158, 1,203,174,165, 77, 33,254,152,157, 59,119,202,108,100,159,145,145, 81, 0,203, 54,
-237, 7,157, 81, 0, 14, 28, 56, 32, 11, 9, 9, 65,255,254,253, 25,138,162,248, 22,239, 44, 11,129, 64,128,160,160, 32,180,110,
-221, 26, 55,110,220,192,129, 3, 7,100, 46,180,185,132,241,227,199,127,180,106,213,170, 53, 93,187,118, 93, 79, 8, 97, 1,124,
- 6,224, 49, 0, 71, 8, 33, 75, 97,217, 95,229, 45, 0, 75,157,145,183,106,238,220, 31,134, 39, 36,144,221,187,119,131,207,231,
- 67, 38,147,225,220,185,115,232,212,169, 19,150, 45, 91,134, 94,189,122, 97,246,236,217,252,247,222,123,111,149, 35, 97, 59,118,
-236,224, 0,192,203,203,235,118, 64, 64, 0,196, 98, 49,132, 66, 97, 53, 0,198,129,199,238,190,145,255,172, 69, 31,214, 92,251,
- 60,229,157,122,149,128,250,102, 1, 80,124, 30,197,103, 88, 78,163, 55, 49,183, 8, 33, 34, 31, 17,175,143,159, 16,209,146,158,
-163, 58, 34,246,101,160,219, 8,180,241,230, 38,205, 24, 22,245, 78,144,159, 87,220,234, 24,248, 55,156, 28, 22, 60,158,173,207,
-246, 3,208, 14,254,225,227,161, 55, 27,176, 62, 99, 3,190,217,188, 13, 99, 98,135, 1, 0,116, 58,128,199,111, 88,148,196,171,
- 43, 0,192,108,182, 87,164,202, 0,228,130,226,137,144,244,220,139,136, 79, 76,196,207,123, 44, 68,230,229, 13,104,171,111, 55,
-154, 89, 38,240,106,200,223,196,152, 97, 84,155,160, 83,234,160, 52,209,144,235,104, 40,140, 26, 40, 53,213, 80,148,107, 32, 87,
- 26, 32,175,110,120, 9,245, 87,159,233,192, 17, 66,192,227, 17, 16, 74, 4,179,153, 3,163, 43,134, 86,121, 21,165,101, 42,200,
- 21,213, 80,105,204,144, 43, 12, 40, 41, 41,195,197,203,103,161, 84,157,197,224, 1, 3, 27,220, 27,157, 7,128,210, 24,160,191,
-118, 11, 85,127, 92, 66, 85,113, 17,212, 42, 57,212, 42, 57,138, 46,158,198,241,204,175,144,187,117, 19, 42,174, 93,131,153,102,
- 45,173,137,247,151, 13, 3, 18,235, 65,199,199,199,119, 95,190,124,249,155,109,218,180,209,110,219,182,173, 79,102,102,230, 79,
- 0,250, 91, 11,221,237, 5,167,132, 97, 97, 11, 0, 96, 72,175, 94,152, 51,103, 78,249,169,203,151,179, 31,234,214, 45,166, 57,
- 18,191,117,235,214, 28, 0,100,238, 92,139,149, 57,119,238, 92,151,228,154, 68, 34, 0,192,246,237,219, 17, 26, 26,138,119,230,
-206,197,130, 5, 11, 16, 18, 18,210, 34,198, 97,109,164,159,145,145, 81,115, 0,192,225,195,135,195, 1, 76,112, 82,204, 67, 1,
-129,129,221,120, 20,133,231,227,227,161, 84,169, 81,114,251, 22, 4, 2, 62,248,124,203, 33, 16, 8, 32,146,120,161,163, 84,250,
-113,255,209,163,157,178,216,175, 22, 22,226,219,237, 63,213, 28, 54,188,159,182, 6,239,167,173,193, 94,217, 97,151,223,119,116,
-194,123, 49, 0,112,243,242,145,156,209, 22,242,151,161,133,172,118,116,254,235, 79, 80,254,242, 0,140,202,170, 64,143, 0, 62,
-120,126, 65, 96, 20,229,136,222, 87, 14,111,190,133, 31,120, 14,230,100,221,184,118,173,234,243,140,255,118,253,250,191, 95,227,
-211, 47, 63, 43,250,108,213, 71,239,191,249,218,188, 9,203, 63, 88, 14,137,175, 55, 70, 12, 25,134, 83, 39, 79,125,253,108,210,
-179,110,191,179,141,252,109,231,187,119,239,198, 67, 15, 61,212, 17,192,116,103,221,254, 38,147, 9, 3, 6, 12, 96,205,102, 51,
- 95,165, 82,193,104, 52,194,104, 52,226,242,229,203,144,201,100, 56,118,236, 24,218,180,105, 3,147,201,132,153, 51,103, 58,147,
-214,169,137,137,137,159, 76,158, 60,217,111,253,250,245,126,132, 16, 33,128,195, 0, 84, 0, 6, 0,248,201, 78,241, 60, 8,160,
-151, 35,121, 59,223,124,243,135, 9,125,251,146,239,226,227, 81,250,251,239,248,232,163,143,216,159,127,254,249,255,221,188,121,
- 51, 84, 38,147,189,188,104,209, 34,152, 76, 38, 12, 27, 54, 12,222,222,222, 67,157,205,191,128,128,128,202,214,173, 91,195,199,
-199,135,243,246,246,190,105,205,195, 7, 94, 7,237,149,129, 70, 61, 0,243,115, 80,177, 26, 21,233,191, 93,171,200,138,142, 10,
-142, 29, 40, 13,178,172, 35, 62,126, 25,126,243, 25,131,131,127,148, 99,104,207, 64, 60, 34,253, 25,190,191,124,208,127,108, 63,
-233,244,205, 71, 46,254, 81,159,240, 54,157, 19, 8,199,149,112, 19,159,155,143, 5,175,125, 6, 64, 14,203,178,201, 70, 68,118,
- 29, 0,177,136, 15,189,214, 8,208, 22, 5,193,215,215, 23,229,242, 6,247,203,134, 94,119,133, 0,224, 46,254,246, 37, 40,106,
-109, 45, 35,129,213,255, 9,131,209, 4,137,143, 24, 16, 90, 20, 4,141, 90,141,161, 67,135,226,200, 79,223, 53,108,142,176, 52,
- 88,150, 15,134, 97, 96, 52, 26, 81,205,231,129, 79, 83,192,109, 53, 24, 47, 6,102, 33, 11, 78,192,131,142,199, 7,163,213, 65,
-105,108, 56,214,201,215, 71, 11,134, 33, 48,210,102, 40, 85,106,228, 95, 43, 70,201,237, 74,232,105, 19,212,213,114, 84,107,148,
- 48,152,105, 16, 62,129, 86,167,130, 90,119, 3, 69,165, 42, 84,105, 26,222, 75,194,108,167,165, 49, 42, 45, 74,206, 94,194,157,
- 75, 55,160,214, 92,131, 70,169, 4, 7, 62, 4, 60, 2,142, 8, 64, 81, 22,175,175, 43,234,230,219, 73,111, 59, 53, 28,224, 0,
-119, 0,220, 89,188,120,177, 30, 0, 22, 45, 90,116, 42, 37, 37,197,219,154,116, 3,128, 98,119, 5,175, 91,183,110, 69,124,124,
- 60, 0, 32, 42, 36, 36,212, 58, 38,206,107,206,198, 97,115,255, 91, 61, 1, 14,179, 47, 60, 60,124, 52, 77,211, 72, 75, 75,195,
-211, 79, 63,141,201, 99,198,220,237,232,207,159,183,120,130, 66, 66, 56,103,227, 2, 22,188,255,126,205,152, 63, 0,188,181,100,
- 73, 45,207,128,147,110,255, 90,176, 89,255, 54,210,183, 33, 35, 35, 3,201,201,201,200,206,190,254, 45,128,239, 28,118,104,124,
-254,127, 12,180, 17, 60, 30, 15,151,175, 23,128,227, 56, 92,204,191, 10,154, 54,129, 2, 1,159,207, 7, 33, 4,172,217, 12,189,
- 86,135,171,191,253,118,200,137, 60,164,236, 73,255,217,167, 39,216, 91,252, 20, 0,156, 56,115, 30,157,163, 34, 93,154,166,156,
-157,249,159, 26,107, 63,219, 98,249,219,134, 66,184,199, 39,189, 24,187,111,167,123,222,128,102,129,252, 54,132, 17, 93, 80, 62,
- 71, 12,209, 35, 83, 97,206,219, 15,179,218, 18,111, 80, 62,231, 97, 68,102,228,194,204, 54, 94, 85,186,118,238,218,214,203,203,
-219,235,211, 47,214, 25, 98, 71,141, 18, 14, 30, 58,228,187, 3,123,127,121,252,242,181,124,128,229, 32, 22,137, 48,108,224, 48,
-236,217,189, 7, 99,199,142,229,246,239,223,239,116, 87, 80,215,234, 63,112,224, 0,174, 95,191, 78, 3, 16,158, 60,121,146,158,
- 61,123,246,180,140,140,140,103, 29,201, 41, 44, 44, 68,199,142, 29, 1,128, 42, 44, 44,196,185,115,231, 16, 25, 25,137,168,168,
- 40, 40, 20, 10,228,229,229,161, 67,135, 14, 8, 13, 13, 69,100,100, 36, 10, 11, 11, 27,175, 40, 20,149,148,152,152,248,193,200,
-145, 35,125, 78,157, 58,229,199, 48,204, 75, 18,137,100,162, 94,175, 95, 5,203,214,231,176, 42, 0,107, 96,217,157,143, 70, 35,
-211,219, 5, 2, 65, 82,230,188,121, 27, 31, 14, 9, 33, 21, 11, 23, 98, 40,203, 98,205,238,221, 92,169, 78,247, 34,238,110,203,
-190,241,226,197,139,235, 25,134,225,251,248,248, 32, 60, 60,220,199,100, 50, 65, 32, 16, 56,122,125,175,210,210,210,174, 55,111,
-222,132, 86,171, 37, 10,133,162, 59,159,207,143, 99, 24,166,197,238, 56, 86,223, 16, 64, 24,128,142,147,162, 35, 94,109, 31,236,
- 61, 29, 38, 61,208, 53, 14,103, 66, 38,225,145,185, 95, 65, 95,169, 4,207,207, 23,178,213, 73, 24,209,227, 55, 4,157,207, 26,
- 9, 32,162,161, 31,232,228,215, 14,127,156,223, 97,231,112,208, 2, 48, 89, 14,147, 17,124,150, 7,202, 74,226, 59,127,116,188,
-139,200,254, 11, 28,198,246,239, 85,199, 8,229, 3, 16, 0, 2, 49, 24, 98,134,213, 14,198,148,233,243, 0, 64,150,242,238,220,
- 6, 27,130,153,229,192,176, 20, 40,134, 1, 69, 27,161,163, 44,117, 71,207,227,193,155,209, 67,173,231, 64, 4, 4,102,179, 25,
- 58, 51, 80,174,109,120,183, 83,134,102, 97, 16,240,192,234, 24, 48,172, 10,154,106, 19,120, 68, 0, 35, 99, 2,205,209, 96, 76,
- 52, 32,100, 65, 17,128,136, 88,168,244,102,148, 85,232,160, 53, 50,245, 26,201, 20, 49,215, 12, 26, 17,114,119, 72,215,100,208,
- 67, 37,151,131, 34, 60,240,249, 28,192,241,193, 35,238,155, 58, 87,138,174,208, 93, 35,187, 10,157,113,251, 55,164,155,193,110,
- 15,237,148,148,148, 9, 0,110, 46, 90,180,168,191,191,191,127,128, 74,165, 42, 74, 73,113,125,135,204,185,115,231,190,176,110,
-221, 58,180,110,221,218,254,154,114,205,154, 53,217, 15,117,235, 54,250,212,229,203, 7,155,171, 33,204,157, 59, 55,214,110, 40,
-160, 49,242,143, 25, 52,104, 80,248,240,126,253, 64,124,125,145,146,146,130,133, 11, 23, 66, 32, 16,192,164, 80,192,223,223, 31,
-239,204,157, 91, 19, 23,144,156,152,232, 80, 9,168, 59,198,239, 40, 38,160,177, 17,133,186,214,191, 3,239,128,195, 42,163,144,
-203,187,249,248,250,162, 82,161,128,236,196, 9,240, 41, 30,140, 38, 19,116,122, 61, 88,150,173, 81, 92, 24, 19, 13,218,104,116,
-102, 72,131, 5, 64, 89,135, 1, 88,187,138,111,176, 94,199,251,105,107,132, 0,208, 89, 42, 45,191, 81,191,109,225,146,151,170,
- 93,199,232,152,125, 59,191,116,197,221,220,112, 6,187,224,246,175,229,150,221,250, 95,244,123,238, 13,136,162,250, 88,250,138,
-202,219,200,151, 91, 20,127,209,208,241, 40, 54, 51,240, 90,219,248, 80,179, 90,173, 14, 16, 73,196,232, 20, 21, 37,190, 81,114,
-179, 77, 85, 69, 21,166, 60, 59, 93,182,247, 96, 22, 86,127,152,182,109,231,222,221,241,157,163, 58, 35,233,233, 25,200, 61,115,
- 12, 99,199,140,225,246, 31, 56,224,240,157,237,173,254, 3, 7, 14, 32, 46, 46,206,166, 44, 10,111,221,186,133,217,179,103, 11,
- 1,192,153,216,130,170,170, 42,140, 24, 49, 2,102,179, 25,133,133,133, 56,118,236, 24,122,244,232, 1,127,127,127,180,111,223,
- 30,253,250,245, 3, 69, 81,160, 40, 10,109,218,180,113, 84, 79,123,244,234,213,235,147,161, 67,135,242,206,159, 63,239,103, 54,
-155,203,182,111,223,174,214,235,245, 41, 0,236, 7, 77, 95,125,252,241,199,139,247,238,221, 27, 69, 8,185,141,134,119,180,237,
-159, 60,124,248,198,193,124, 62,169,248,224, 3,112, 38, 19,100, 60, 30,155,171,211,205,132,101, 27,119, 27, 94, 89,188,120, 49,
-159,162, 40,200,229,114, 92,191,126,189,188, 87,175, 94,161,206,148,115,120,120,120,144,153,227,160,215,233,112,241,226, 69, 48,
- 12,211,162,103,158,240,235,144,127,231, 48,127,201,240,199,251,134,207,246,147, 8, 6, 49,102, 86,193,231,204,126, 8,104,195,
-187,173, 52, 64, 95,169, 2,132,124,152,149, 26,148, 40,104, 32, 56, 2, 20, 75,139, 27,115,241, 94, 83,171,209, 37,192, 15,140,
- 17,184,150,243, 45, 58,197, 60, 86, 99,192,153,104, 19, 4,160, 80,109,176,236, 80, 59, 54,102, 0, 36,193,225, 88,181,241,167,
- 6, 19, 60,182, 55,193,222,115, 28, 4, 98, 64, 24,241, 24,232,226,163, 53, 94, 0,129, 80, 4, 19, 12,240,145, 88,118, 36,221,
-189,119, 11,254, 56,153,211,168, 75,146,101, 89, 8,105, 61, 76, 16,130,162, 24,192, 96,233,216, 76, 38, 19,140, 6, 1,120,124,
- 1, 96, 0, 56,214, 50, 68, 16, 41,141, 2,114,235,159, 81,160, 51,176,224,241, 8, 76,140, 9, 6, 35, 11,181,198, 82, 15, 77,
- 44, 7,218,200, 2,124,128, 39,224,129, 47, 6,136,222, 12,150, 48, 96,161,135, 70, 15, 88,118,150,108, 28,102, 0, 20, 11,112,
- 4,160, 40, 22,132,240,192,114, 4, 20,101, 53,156, 88, 10, 44, 69,129,176,206, 25,200,118, 65,126,194, 38,214, 35,111, 0, 33,
-139, 22, 45, 42, 79, 73, 73,137, 5,240,212,162, 69,139,198,164,164,164,104, 1, 84,185,229,178, 74, 72, 16,174, 91,183,238,203,
-248,248,120, 72, 91,181,170,185, 46,109,213, 42,192,234, 5, 8,121, 16, 13,134,166,105,153,109,236,159,211,104,240,175,127,253,
- 11,198,170, 42,216, 34,223, 58, 89,149, 21,129,209,136, 9, 19, 38,148,151,150,151, 79,115,198,210,110,198, 33,153, 90, 30,128,
- 70, 60, 4, 56,125,250, 52,169, 79,121,168,165,212, 26,105, 40,105, 57, 12, 6, 3, 2,252,253, 33, 22,138, 96, 50, 51,224, 56,
- 14,102,179, 25, 52, 77,195,100, 50,129,101,204,206,198, 51,176, 87, 11, 11,169,206, 82,169,205, 34, 96,175, 22, 22, 82,223,110,
-255, 73,108,239, 17,232, 44,149, 42,155,203,125, 95, 82,144,215,108,150,191,187, 49, 0,163,178, 42, 80, 46,221, 6, 97, 68, 23,
-144,168, 62,136,220,240, 59, 42, 13, 44,188,249, 4,244,175, 63,226,202,245, 27,112,180,107,177,158,161,113, 58,247, 36, 62, 89,
-245, 49, 30,142, 25,142,197,255,111, 9,126,217,247, 11,190,219,244, 13,134,142, 28, 30,223, 94, 26, 1,190,151, 0, 7,143, 30,
-196,230,175,191,193,142, 31,183, 67, 40, 22,115,187,119,239,110,116,125,136,157, 59,119,214, 34,126, 27,148, 74,215, 55,184,211,
-104, 52,240,247,247, 63, 1, 96,176, 84,103, 60,227,177, 0, 0, 32, 0, 73, 68, 65, 84, 42,197,192,129, 3,193,227, 89,134, 89,
- 35, 35, 35, 33, 18,137,160, 82,169, 32,149, 74,225,235,235, 91,164,209,104, 34, 27, 17,119,241,252,249,243, 43,118,236,216, 49,
-174,115,231,206,221,182,111,223, 94,173, 80, 40,150, 2,216,108,175,191,140, 26, 53,234,205, 13, 27, 54,108, 5, 80, 14, 32, 1,
-192,111, 0,250,214, 35,239,247,181, 50,217,138,128,188,188,119,159, 97, 24,124, 12,176, 95, 86, 87,207,168, 35,239,169,121,243,
-230,125, 60,107,214, 44,220,184,113, 3,123,246,236, 1,195, 48,135, 0, 60,227,196,235, 83, 1, 60, 94,149, 15, 77, 67,251,251,
-239, 92, 8,203,106,174, 1,154,191,186,143,234,215,175, 31,206,158, 61, 91, 51,238,223,104,130,235,156,119,152, 20, 29,177,220,
- 79, 34, 24, 84,161, 54,252,114,252,106, 69, 10,120, 34,224,202, 81, 60, 42,229,240,127,175, 77,192,192,158, 82,204, 75,126, 28,
- 79,118,164,129, 11, 7,192, 9, 36, 12, 26, 13,214, 81, 34, 95, 89, 12,190, 8, 24,251,228, 27,216,252,233,135, 22, 99, 81,103,
-132, 89, 15,252, 40, 59,139,236, 83,150, 25,133,237, 34,162, 64,241, 29,147,215,184,190, 4, 38, 3,176,123,207,126, 68,143,121,
-205, 98,253, 67, 0,158, 4, 72, 28,159,128,113, 35, 39, 90, 26,126, 81, 1, 24, 3,221,184, 70,207,113, 96,136,133,224,141,180,
- 37,248,207,104,208, 67,167,211,161,186,186, 26, 26,181, 10, 26,141, 6,106, 77, 53, 12,213,213,208,235,245, 13, 87,254,106, 2,
-189,193, 12,189,193, 12,173,206, 4, 77,181, 17, 10,141, 17, 74, 53, 13,149,198, 4,165,210,242, 41,175, 98, 32, 87, 48,144,171,
- 24, 84,202,105,220,169,108, 56,141, 20,199,193, 12,128,152, 9, 8,197,130, 35, 28,192,113,224, 56, 30,204,236,221,226, 99,173,
-189,135,171,190,241,238, 67,187,227,216,222, 99,248,229,208, 47, 53, 74,193,149,162, 43,174,214,185,112, 0, 29, 83, 83, 83,207,
- 1, 88,251,206, 59,239,188,222,161, 67, 7, 38, 35, 35,131,164,165,165,185,172, 1,207, 74, 72, 32,194,176,176,157, 0, 16, 22,
- 22,118,207,253, 57,115,230, 48,121, 87,174,108,105,174, 88, 0,155,251,223,217,125,227,109, 99,255, 0,240,195, 15, 63,224, 90,
- 89, 25, 0,224,231,156,156, 90,247,174, 92,185, 18, 26, 18, 18,162,120, 16,138,202,232,209, 29,108,243,174,107, 93,183,157,219,
-238, 59,244,105,250,249, 94,102,205,102,168,229, 10, 84, 86, 86,162, 74,169,128, 86,167,131, 86,167,131,166,186, 26, 90,149, 26,
- 26,165, 18, 6,189, 14,180,193, 0,150,113, 24,232, 76,117,150, 74,109,125, 6, 11,128,182, 31, 14, 0,128,111,183,255,132,247,
-211,214, 4, 0, 8,115,185, 34,118,140,142,169,171, 56, 68,245, 24, 21,131, 7,140,219, 83,164,136,220,240, 59, 72, 84, 31, 24,
- 15,111, 67,209,243,253,225,205, 39, 56, 26, 23, 2, 70, 85,129,232,253,229,224, 59,168,126, 89, 89, 89,228,229,249,175,224,218,
-149, 43,200,205, 57, 10,127, 95,127, 76,157, 50, 21, 1,193, 65, 56,115, 50, 15, 62, 66, 49,188,189,189,209, 70,218, 22, 91,190,
-223,130,119,222,123, 23,213, 74,247,119,169, 29, 48, 96,128,203,223,241,245,245,133, 74,165, 26, 76, 81, 20,221,190,125,123, 12,
- 26, 52, 8, 61,123,246, 68,171, 86,173, 32, 22,139, 33,149, 74,209,183,111, 95, 4, 4, 4, 64,163,209, 68,250,250,250, 58, 18,
-185,242,240,225,195, 89,155, 54,109, 18, 40, 20,138,197,117,200, 58, 97,196,136, 17,159,108,216,176,225,171,176,176,176, 15, 8,
- 33, 62, 0,222, 1,208,152,155,236,189,229, 26,205,202, 23, 25,198,252,165, 94, 63,173,142,188,248,103,146,255,189,227,181,215,
- 23,240,174, 92,185,130, 19, 39, 78, 96,195,134, 13,213, 0,254,207,201,215,167,188,140, 70, 49,119,233, 18,218,103,103,147,240,
-210, 82, 30, 30, 80, 12, 74,221,160,247,134,130,224,235,118, 2, 34, 30, 69,124,139,171,180,223,109,201,189,241,127,103,139,228,
- 39,245,102,114, 13,149, 55, 32,222,241, 42, 62, 24,166, 65,222,210, 65, 88, 29, 91, 13,239, 31,231, 0,242, 18, 84,115,226, 11,
- 86,205,171, 1,220,141,234, 63,119,254, 39,252,251,223,155,208,201,175, 55,254, 60,126, 14, 7,100,151, 16, 59,180, 39,226, 70,
- 88, 42, 26,199,227,131,118, 97,162,196,216,254,221,176,124,229,135,216,127, 65, 13, 31,105, 15,140, 31, 63, 1,191, 28,218,137,
- 61,191,108,177,188,156,217, 4,145,160,241,126,142, 99,205, 48,179, 22,107, 6, 86,107,134,166,105, 24, 12, 6,232,245,122,104,
-117,122,232,117, 90,232,117, 90,232,140, 6,208, 70, 67,195,238, 47,189, 47, 84,213,102,168,245, 44,212,122,214,242,191,134, 69,
-181,150, 65,181,142,129, 66,110, 70,149,220,132, 42,133, 9, 85, 85, 38, 84, 86,210,184, 83,105,106, 84, 1,184,235,254,191,215,
- 84,227,243, 56,240, 8, 1, 87, 39,234,159, 35,142,235,220,219, 73,111,163,251,208,238, 53,231,217, 27,179,107, 60, 2,199,246,
- 30,195,149,162, 43, 55, 92,169,112,219,182,109,251,149,227,184, 94,241,241,241, 73, 81, 81, 81, 33, 0, 40,150,101, 69, 38,147,
- 41,112,254,252,249,126, 13,184,130,235,133, 48, 44,236,253,117,235,214,141,139,143,143, 71, 84, 72,136, 83, 67, 87, 77,116,255,
-199, 0, 64,116,183,110, 14, 3,216, 58,183,110, 29,155,150,150,134, 63,139,138,212, 59, 14, 28,192,229,203,151,107,172,254,174,
- 93,187,194,122,143,222,113,224, 0,138,138,138,112, 37, 47, 79,239, 72,230,130,247,223,199, 91, 75,150,212,184,247,109,255,219,
-206,109,255,187, 18, 11,144,146,146,201,141, 26, 53,234, 85,123,210,183,125, 14, 28, 56, 16, 41, 41,153, 78,117, 76, 87, 47, 23,
-228, 49, 12, 3,154, 54, 66,126,167, 28, 21,183,203, 80, 89,118, 7,149,101,119, 32, 47,175,128,178,170, 10, 70,173,214, 18, 63,
-163, 84,194,137, 32, 64,230,253,180, 53,252,247,211,214,240, 1,168, 1,176,131, 7,244,185,231, 33,187,184, 0,167,209,182, 99,
-116, 76,105, 65,158,172,239,160,187,105,232,216,255,201, 24,101,197,117, 89, 83,234, 7, 73, 84,212,178,252,221, 65,190, 92,139,
-226,151, 30, 2,119,227, 60, 66,255,123, 6,222,235, 79,227,246, 20, 41, 6,238, 47, 7, 17,136,192, 39, 0,159,114,172,128,158,
-191,112,129,252,235,195,229,152,247,214,155, 48,177,102, 92, 46,188,138,233, 83,167, 65, 40, 22, 99,215,143,187, 1,147, 25, 70,
-131, 17, 71,243,142, 67,175,175,198,172,153, 51, 15,191,252,242,203,141,149, 53,153, 52,105, 82,236,152, 49, 99, 64, 8, 65, 86,
- 86,214, 61, 46,253,183,223,126,219,233,247, 12, 14, 14,198,173, 91,183, 0,128,159,158,158,142,138,138, 10,244,238,221, 27, 1,
- 1, 1,160, 40, 10, 39, 79,158, 4, 69, 81, 32,132,224,214,173, 91, 8, 14, 14,118, 70,236, 7, 52, 77,143, 4,240,131,221,181,
-169, 35, 70,140, 72,123,233,165,151, 2,211,211,211,197,132, 16, 10,192, 78, 88,102, 1,220,113, 32,111,225, 9,147, 41,186,174,
-188,103, 22,237,216,250,244,180, 57,100,220, 43,233,200, 57,113, 17,105,105,105,172, 90,173,126, 1,150,217, 5, 78,121,183, 58,
-249,250, 6,180, 47, 43,195,112,157, 14,109, 4, 2,111,111, 30,239,129, 45,183,223,175, 95,191,154,195,169, 33, 0, 0, 5, 91,
-142,223,152, 43,215, 26, 79, 3,200, 7,208, 38,247,106,197,231, 35,187,133,189,199,191,113, 34, 8, 27,102, 0, 34,111,192,168,
- 5, 56, 14, 38,158,248,206,209, 63,111,127,137, 70, 86, 95,218,252,221,103,177,211,166, 39,201, 0, 64,203,154,112, 77, 89, 12,
-192,140, 78,126, 81,136,141,237,131,176, 86,255,159,189, 43, 13,107,234,218,218,239, 62, 25, 8,160, 34, 56,139, 86,197,138, 90,
-181, 14, 88, 17,181,146, 40, 90,171,181,195, 87,163,182, 94, 91, 63,109, 9,106,175, 83, 7,180,181,215,222, 94, 91,245,222,139,
-218, 81, 98,135, 79,219, 91,111, 53, 88, 91,167, 58,160, 9, 42, 34,136, 86,235, 12,130,138,160,136,146, 48, 37, 64,166,253,253,
- 72, 78, 12, 33,144,147,128,162,237,121,159, 39, 15, 57, 67, 22,251,236,189,207, 94,239, 90,123,237,181,219,163,184,180,204,230,
- 43, 48,154,113,179, 68, 95,239, 67,117,122, 36, 10,249,121,246,101,158, 68,136,113,253,109, 49, 0,123,206,152,176,119,103, 18,
-110,221,185,129, 86, 45,109, 43, 9, 90,138, 69,120,124,240, 0,168,127,174,199,165, 11, 33,196, 86, 51, 44, 16,192, 74, 8, 24,
-139, 21, 48,153, 97, 17, 9, 1,194,128,125, 39,173, 20,182, 92, 1,245,224, 87,245, 21,242,244,136,230, 52, 64, 76, 33, 20, 57,
-121, 24, 76,128,153, 2, 85, 70,192, 82,109, 1, 33, 4, 68, 76, 96,182, 0,250,106, 32, 35,173,148, 12, 24,208,153,186,117,249,
-179, 61,139,177,130,216,221,255, 54, 82, 64, 96,177, 50, 96, 4,246,149, 2, 0,168,128, 2,148,155, 23,192, 89,249,187, 59, 78,
-221,157,218,141,107, 71,155, 52,105, 82,159,164,164,164, 53, 0, 6, 36, 37, 37,237, 73, 74, 74, 58, 60,105,210,164, 55,186,119,
-239,110, 34,132,180,250,228,147, 79,246, 45, 94,188,120,218,202,149, 43, 83,234, 33,159,172,245, 47,124,235,173,183,150,189,245,
-214, 91,216,179,103, 15,244,183,106,191,203,221,218,180,193,149, 43, 87, 0, 64,205, 37,145, 79, 93, 73,127,222,120,227, 13,233,
- 23, 95,124,161,254,252,243,207, 49,184,103, 79,217,241, 11, 23, 60,186,138,143,158, 57,163, 25,222,191,255, 83, 23,143, 31,239,
- 10,192, 15,192,167, 38, 63, 63,136,170,171,209,163, 67, 7, 44, 90,180, 8,169,169,169,171,194,195,195, 83, 82, 83, 83, 15,228,
-231,231,123, 32,119,181,243, 0, 52, 32, 6,160, 6, 15, 76, 73, 73, 33,241,241,242,227,199,142, 21,165, 42, 20, 10, 49, 0,196,
-199,203,135,173, 90,165, 74, 3,199, 36, 64, 93,251, 63,246,110,229,205,194,177, 86,179,165,151,190,180, 20,165,119,110,131, 16,
- 6,148, 90, 81, 85, 85, 5, 74, 41, 40,165,184,114,254, 2, 76,198,106,252,150,156,236,169, 14,157,199,156,150, 0,152,241,178,
-104,235,120, 89, 52,156,151, 5,218,167, 8, 56,163, 83,143, 33,210,252,236, 12, 53, 0,116,237,210, 5,167, 51,108, 60, 57,231,
-183,237, 0,128, 54,143, 12,146,221,206, 59,217,100, 30,128,193,191, 22, 33,243,105, 96, 64, 68, 12,138,230, 14, 67,251, 47,143,
- 34, 75,171, 71,176,152,160, 88,171,131,144, 16,143, 30, 0,199,187,153,154, 90,227,206,238,221,187,211,241, 19,158,198,206,237,
- 59,177,101,203, 22,124,240,222,251,216,167, 57, 0,129, 80,128,208, 78,161,209,165,165,245, 47, 93,222,182,109,155,198, 78, 4,
-164, 99,199,142,173, 17, 11,176,127,255,126, 92,190,124,185, 74,169, 84,118,112,245, 38,185,237, 47, 93,187, 34, 55, 55, 23,143,
- 61,246,152,121,193,130, 5,226, 31,127,252, 17, 65, 65, 65,184,120,241, 98, 45,207,107,110,110, 46,186,114,111,103,231,196,115,
-211,159,120,226,137, 15, 95,122,233,165,160,204,204,204,230, 85, 85, 85,255,235,239,239,255,140, 61, 48,240, 23,142,242,156, 23,
-202, 79,127,230,175, 63,110, 28, 49,250, 5,242,207,100,128,116,124, 22, 31,175,125,151,106,179, 47,206, 4,160,242,162,153, 73,
-185,201, 84, 34,246,243, 67, 11,177, 24,254, 22, 75,181,190,230,146,181, 7, 14, 53, 8,192,124, 13,206,125, 34,173,206,154,175,
-113, 76,105,230,125, 34, 45,249,181,188,202,172,143,124,180,245,248,144, 0,193, 19,130,234,170, 64, 51,101,202,139,203,141,199,
-210, 46, 23,238, 45,208, 26, 82,230,107,112,179, 46,146, 49,237, 47, 75, 53,135,142,166,201, 0,168,173, 2,118,154, 79,128,203,
-101, 55,241,183, 55,102,194, 96,168, 70, 89,165, 45, 6,192,200,248, 97,243,182,250,211,236,230,231,165,145, 23,158,253,171, 77,
- 89, 90, 88,203,217,140,113,253, 8,166,206, 89,141,128, 0, 63,180,240,151,200, 0,168,179,207,158,148,109,248,108, 91,189, 3,
-146,144,154, 97, 36, 54, 18, 0, 66, 96,161,212, 70, 4,204,246,229,126,132,129,208,106,133,217, 30, 28,232,137, 4,148, 84,182,
- 68,101,117, 49,196, 66,198,145,230,204,108, 5, 76, 38, 10,147,153,162,162,210, 10, 34, 32,176,128,192,100,189,235,186,119, 7,
-139,149, 1, 67, 44, 32, 22, 2,202, 80,135,251,159,212, 97, 60,179,146,206, 93,252,145,120,202, 13,125, 33,237, 66, 67,251,142,
-195,109,209,175, 95,191,155, 97, 97, 97, 47, 92,189,122,181,199,150, 45, 91, 50, 0, 60,151,148,148,244,156,243,205, 43, 87,174,
-212, 44, 94,188, 88,182,114,229, 74, 79, 10,194, 81, 33,113,113,113,117,222,244,226,171,175,218,124,128,222, 37, 6,162, 46,110,
-127, 0,192,144,222,189,101, 25, 28,148,191, 99, 0, 62,125,218, 17,173, 58,172, 95, 63,107, 66, 66,194,231, 19, 39, 78, 52, 95,
-186,116, 73,120,237,218, 53,116,109,213, 42,109,231,206,157,156, 2, 20,239, 81, 30, 0,103,229,126, 43, 37, 37,197, 57,198,227,
-140, 83, 61,123, 36, 1,170,149,171,244,242,197,241, 47, 94, 60,112, 48,173,101, 96, 96,139, 50, 93, 9,204,102, 51,168,253, 61,
-208,221, 42, 66,153, 78, 7, 74, 41, 6,198,196,200,126, 75,246,152, 7,201,140,187, 49, 39,140,125, 57, 32, 19, 57,232,113,140,
-151, 69, 59, 86, 1,100, 95,189,202,153, 4,196, 76,120, 73,154,188,235,191, 14, 43,255, 23,213, 55,106, 0,104, 19, 54, 92,118,
- 59, 55, 85, 3, 0, 77,163,252,105,109, 18,128,175, 48, 32,238,111, 40,180, 90,209,127, 67, 6, 50,198,181, 67,159,157,183, 32,
- 36, 64,115,145,111,198,226,206,157, 59,201,148,151,166,208, 81, 99, 70, 99,251,214,159,241,143, 85, 43, 17, 95, 90, 10,106,181,
- 98,243,230,173, 40, 40, 40,120, 6,192, 78, 79,114,220, 17, 1, 0,120,225,133, 23, 78,129,227, 92,246,134, 13, 27,200,216,177,
- 99,233,201,147, 39,197,131, 6, 13,194,232,209,163,161, 86,171,241,200, 35,143,160,186,186, 26,209,209,209,160,148, 90, 79,158,
- 60,201,136, 68, 34, 95, 50, 2, 62, 22, 20, 20,180,102,202,148, 41,162,243,231,207,183,168,174,174,174, 43, 48,144, 43, 6,134,
- 14,152,188,113,192,200, 41,228,155, 20,160,172, 18, 48, 94,217, 99,213,102,171,103,160,102, 96, 32, 39,125,170, 45, 45, 53,139,
- 77, 38, 24,196, 98, 8,205,102, 15,211,227,247, 6,108, 30, 0,103,203,223,221, 57,183,174, 84, 39,229,207, 30, 95,248, 68, 90,
-145,119,237, 78, 69, 26,128, 14,246,151,183, 26, 64, 1,128,220,249, 26,120,116,113, 42,191,220,165, 25, 49,162,159,204, 66,155,
-169,157, 95,142, 10,125,153,109,221, 63, 19,128,156,114,144,181, 95,110,226,244,128,219,182,127, 70,110,107,115,165, 96, 12,106,
-231,234,109,214, 44, 8, 22,147, 14,160,122,140,235,199,109, 66,215, 4, 1, 64,169, 77, 81, 67, 0, 49,181, 19, 1,187,242,183,
-229, 0, 4,192,145,200,165,157,184, 78, 34,250,118,160,102,147, 22, 66,187,247,135, 82, 10,139,153,162,202, 4,148,149,155, 97,
- 2,133,153, 50, 16,138, 8,238,220, 50,213, 89,206,227,199, 87, 17, 0, 24, 22,245, 54, 37, 38,155,245, 79, 1, 80, 74, 0,106,
-183, 24,168, 0, 68, 96,133,213, 42, 68, 86,246, 86, 78,207,252,218, 63, 94,147, 93,205,185, 90,159, 2, 22,193,182, 84,163, 62,
-237,228,168,249,101,203,150,177,254,209,211,118,171,248,174,162,126,241, 69,233,214,173, 91,213,118, 18,160,246, 68, 2,214,171,
- 84,166,223,206,156,145,119,237,215,207,242, 68,175, 94,122,123, 31,173,134, 75, 22, 45,249,184,113, 54,139,163, 95, 63,207,211,
- 29,111,191, 45, 3,128,193, 61,123,214,186,150,121,233,146, 38,227,130,239,100,168, 95,239,222, 95, 50, 12, 99,185,120,252,120,
- 96,187,118,237,238,164,230,231,111,244,100,245,223, 7,173,227,220, 15,244,246,128, 63,118,106,160,194,165,173,185,144,128,243,
-242,197,241,145,219,191,254,102,107, 88,183,174,143, 85, 87, 87,193, 98, 50,195,106,181,162,121,112, 48, 74,181, 90, 86,249,115,
- 33, 81, 37,127,127,243,175,109, 1, 24,179,175, 94, 21,179,243,255,233, 39,127,199,120, 89,180,117, 89,194,103,158,146, 3, 57,
- 48,103, 94, 60,189,120,233,162,204, 89,249, 3,192,168,167,158,147, 29,220,251,139,230,118,110,170,239,149, 88, 71,128,159,251,
-243,220,117,216,224, 95,139,128, 95,223,112, 28, 63,250, 75,161,227,123,169,201,119, 99,113,243,127, 55,147,225,195,135, 63, 61,
-118,194,184,221,175, 79,159,117,228,241,254,253, 70,108,255,101, 7,210, 78,157,192,137, 19, 39,118,213,231, 6,174,135, 8,204,
-218,182,109,219,215,219,182,109, 27,186,109,219, 54,206,133, 27, 59,118,236,168,125,251,246, 29,220,185,115, 39,194,194,194, 48,
-102,204, 24, 4, 5, 5,101,149,150,150,134,159, 59,119, 14,185,185,185,140, 72, 36,194,216,177, 99, 99,246,237,219,231,237,163,
-158, 47, 45, 45, 93,181, 99,199,142,250, 2, 3,189,193,111, 5,167,182,172,248, 57,233,217,119, 43, 67,167,161,242,248, 82,235,
-141,195, 31, 77,247, 81, 94,213,181,162, 34,209,155, 89, 89,249, 22,131,129, 57,205, 48,162,246, 2, 65, 97, 97, 19, 57, 1,220,
-101, 3,244, 52, 5,224, 22,243, 53,208, 3,248,221,254,241, 9, 71,142,156,209,196,197, 45,150, 37, 42,255,161, 14,237,210, 3,
- 64, 53, 68,126, 18,228,223, 44,195,166,157,169,196,123,121,187, 52, 51, 94, 91,136, 13,223,254, 4, 88,175, 1, 16,194, 92, 85,
-137,208, 14, 65,178,143,222,158,197,217,154,131,197, 10, 33, 99,133,137, 8, 33,162,230,187, 68, 0,102,128, 90,192, 53, 48,204,
- 25, 39,206,222, 36, 0,208, 62,132,161, 34,161,205,218, 55, 91,109, 9,140, 74,202, 41, 44,102, 64, 32,180,194, 98,230, 54,114,
- 28, 77,251, 23, 1,128,200, 33,139, 40,216,156,240, 12, 96, 37, 54,119,255,165,236, 29, 94, 21,242,235,247,191,214, 52, 66,255,
-226,100,174,176,202,223,201, 19,224,113, 57,214,241,139, 23,147,142,187,184, 12,235,185,215,227, 61,141,153, 58,184, 22,185,181,
- 45,241, 75,180,217,214,103,124,146,209,200,121, 0, 92,235, 86,239, 97,169, 21,167,190,163, 90,185,234,162,124,113,124, 95, 0,
-130,139, 41, 41,166, 42, 67, 37,172, 22, 11,122, 71, 68,200, 58,132, 63,134,227,191,238,224, 86,199,148, 76,217,251,235, 46,199,
-225,176,199,194, 28,223,247,254,186,171,214,113,125,161,241, 95,126,106, 35,200,163,159,122, 94,118,254, 98, 14,110, 94, 59,163,
- 6,128,131,123,127, 81,183,123,164,175,236, 86,222, 89,175,219,125,242,228,201,240, 54,189,175,133,248,213,123, 61,239,133,246,
-248,245, 70,213, 61, 31,240, 83, 83, 83,127, 85, 42,149, 76,102,102,166,245,192,177, 20,180,106,221,202,117,165,135, 87,216,182,
-109,219, 55, 74,165,242, 59,133, 66, 97,242,230,119,111,189,245,150, 26, 0,153, 49, 99, 6,205,201,201, 65, 70, 70, 6,202,203,
-203,195,155, 55,111,142, 86,173, 90, 57,246, 2,240, 65,249,179,248, 87, 74, 74,138, 40, 45, 45,173,159,209,104, 92,138,154,115,
-249,190,224,189,179,155,255, 34, 10,234,254,221,162,210,156,125,211, 26, 32,207,252, 99,122,250, 51, 0,198, 0,248, 13, 86,107,
- 57, 60,199, 35, 52, 58,216, 85, 0,238,206,251, 68, 0, 60, 14,130, 74,165,112,221,186,117,158, 93, 85,123,143,106, 58,117, 29,
- 77,110,229,167,209,182,161,157,161, 45, 55, 99,211,246, 35, 62,119,208, 13, 95,175,177,255,182, 29, 5,110, 33,184,185, 16, 31,
- 45,121,221,171,151,254,171, 99,217,247,108,157,102,161,214, 74, 0, 64,226, 47,162,198, 74, 19,172, 0, 2, 2, 2, 96, 48, 27,
-136,197,236,189,188,244, 12,219,158, 1,145, 79, 44,164, 86, 42,192,213, 43,187,155,114,141, 41,215,165,131,252, 46,129, 28,234,
-199, 89,225, 55,242,180,128, 49, 62, 94,238, 7,192,178,106,149,170, 65,166,136,106,229, 42,118, 35, 31, 71,155,230,156,245,110,
-157,254,188, 21,159,249, 68,198, 92,183, 2,118,198,129,189, 63,107, 92,251,218,173, 60,223,242, 7,120,218,216,199,149, 3,155,
-137, 31, 42,153,250, 87,164,230,148,155, 17,222, 92,120, 95, 94, 21,251, 90,253, 70,123,231,188, 85,254, 53,198,103,223, 55,252,
-225,130,143,141, 70,227,207,128,231, 77,233, 56,226,157,210,156,125,155, 80, 51, 54,192, 91,152, 0,148,192,187,184,129,123, 70,
- 2, 56, 13, 62,190,238, 35,204,131,135, 51,122,244,232,129,236,236,108,190, 34,120,240,224,193,227, 33, 1,195, 87, 1,143,198,
- 0,175,252,121,240,224,193,131, 39, 0, 60,120,240,224,193,131, 7, 15,158, 0,240,224,193,131, 7, 15, 30, 60,120, 2,192,131,
- 7, 15, 30, 60,120,240,104,114,212, 8, 77, 61,117,234,148,207, 81,155,238,130, 9,121,121,188, 60, 94,222, 3, 35,175,222,232,
-112,190,254,120,121,188,188, 63,150, 60,175, 9,128,211, 64,225, 45, 60, 13, 60,141, 41,143,199,131, 9,202,183,219, 67,217, 14,
-156,239, 87, 42,149,129, 0,158, 56,114,228,200, 71, 2,129, 96,152,159,159, 31, 12, 6,195,209, 17, 35, 70,188, 7, 32, 67,161,
- 80, 24, 30,132, 10,176,103,135, 84,255,153,199, 21, 74, 41, 61,123,246, 44,250,245,235,199,191,147, 60,188, 34, 0, 94,173, 67,
-230,146, 40,199,157, 60,231,196, 39,222,202,251, 19, 14,232,156,240,212, 83, 79,201,246,238,221,171,225, 42, 51, 52, 52,180,214,
-133,130,130, 2,215,193, 20, 42,149,138,112, 44,227, 61, 35, 1,117,229,243,111, 42,121,171, 87,175, 30,189,117,235,214,228,172,
-172, 44, 0, 64, 88, 88,216,179,233,233,233, 59,124,109, 95,231,126, 79, 41,117,188, 31,236,121,246, 93,177,159, 39, 30,200, 51,
-215,118,240, 70,249, 63,118,246,236,217,173,101,101,101,189,186,116,233,130, 59,119,238,160,170,170, 10, 0,134,109,221,186, 85,
- 29, 24, 24,120, 81,169, 84, 62,175, 80, 40,234,221, 74,242,236,217,179, 94, 25, 4,169,169,169, 50,133, 66,161,241,230, 55, 42,
-149, 74, 45,151,203,101,190, 36,128,162, 94, 38, 97,152, 60,121,178, 55,239, 7, 0,160, 75, 23,219, 14,184,229,229,229,168,174,
-182,165, 65,215,235,245,222,188,111,245,226,204,153, 51,116,216,176, 97,232,221,187, 55,252,252,252,138,170,171,171, 31,225,135,
-209, 63, 31, 92,147, 1,221,179, 68, 64,188, 21,123,111,241, 75,226, 56,143,247, 60, 63,123,143, 87, 50,213,234,187, 6, 82, 86,
- 86, 22, 2, 3, 3, 29,131, 16, 11, 46,155,127,200,229,114,170, 82,169, 92,143, 73, 29,247,248, 84,183,209,209,119,183,115,117,
- 39,191, 33, 32,132,208,145, 35, 71,202, 82, 82, 82,188, 82, 22, 91,183,110, 77,110,219,182, 45, 94,121,229, 21,232,116, 58,107,
- 66, 66,194,246,149, 43, 87, 78, 93,188,120,241,102, 47,255, 63,126,253,245, 87,199,241,184,113,227,176,103,207,158,122,143,185,
-136,117,233,203, 52, 34, 34, 2, 0,168, 83,102, 56,175,148,127,105,105,105, 90,247,238,221, 91, 0,128, 68, 34,129,191,191, 63,
-138,138,138, 80, 82, 82,130,160,160, 32, 20, 21, 21,245,218,179,103, 79,134, 82,169,236,169, 80, 40, 10,235,147,215,183,111, 95,
-200,229,114,132,133,221,205,250,183,106,213,170, 26,247,196,199,199, 3, 0,142, 29, 59,166,246,165,223, 52, 36,251,227,218,181,
-107,235,186,228,216,171,192, 87, 4, 6, 6,226,252,249,243, 16,137, 68, 48, 26,141,216,179,103, 15,178,179,179,177,100,201,146,
- 6,245,227,224,224, 96, 1,128,152, 67,135, 14,237,137,142,142,190,245,252,243,207,183, 75, 78, 78,134, 64, 32,104,211,178,101,
- 75, 1,120,252,169,149, 63,123,206,149, 4,252, 97,130, 0, 35, 35, 35,165,247,219,226,110, 74,132, 14, 94,238,248,248, 10,157,
- 78,231,176,248,245,122, 61,214,175, 95,239,248,120, 49,208,186, 61,158, 52,105, 18,149,203,229, 20, 0,117,189,199, 91, 28, 58,
-116, 72,253,246,219,111,163, 91,183,110,141, 86,127, 93,187,118, 37,239,188,243, 14, 40,165, 72, 73, 73, 81,123,219,238, 89, 89,
- 89, 24, 55,110,156, 21, 0,196, 98, 49, 19, 30, 30,142,132,132,132, 31,219,180,105, 67, 35, 35, 35,199,123, 97,113,222,171, 46,
- 66, 34, 34, 34, 40,251, 92, 39, 78,156, 96,247, 3, 96,219,133,179,219, 95,167,211,109, 21,139,197, 45, 0, 96,238,220,185,152,
- 54,109, 26,196, 98, 49,252,253,253, 33,145, 72, 64, 8,129, 64, 32, 64,105,105,105, 11, 0, 9, 74,165,178, 94,217,241,241,241,
- 8, 11, 11, 67,110,110,174,227, 19, 31, 31, 95,227,211, 16,200,229,114,153,253, 57,125, 30, 19, 22, 46, 92,232,248, 56,143,151,
- 46,231, 57,111,244,210,165, 75, 23, 4, 6, 6, 98,233,210,165, 8, 12, 12,196,246,237,219, 81, 89, 89,217, 40,202,223,254, 46,
- 83,157, 78,247,191,211,167, 79, 71,143, 30, 61,218,237,217,179, 7,183,110,221,194,245,235,215, 81, 82, 82, 98,188,159, 99,147,
- 82,169,148,230,231,231, 83,165, 82, 41,117,119, 45, 59, 59,155, 94,190,124,249, 79,145,128,142, 82,218,171, 41,149,127,108,252,
- 74,196,198,175,172,147, 24,220, 23, 2, 64,220,160,190,243,190, 32, 61, 61, 93,221, 24, 36, 96,218,180,105, 15, 13, 9,104, 40,
- 12, 6, 67, 45,171,223,151,230,101,149,201,164, 73,147, 28, 86,126, 82, 82, 18, 26,170,248,157,173,127,149, 74, 69, 70,142, 28,
- 41, 83,169, 84, 53, 60, 2, 13,193,150, 45, 91, 8, 0, 18, 29, 29, 45,115,245, 52,112, 28,116,205,118,111, 0,218,182,109,139,
-229,203,151, 87,189,249,230,155,198,220,220,220, 93, 43, 87,174, 28,211,212,237,235,180, 7, 0,113,110, 39, 47,219,229,137,236,
-236,236, 94, 0, 48,107,214, 44,148,150,150,226,198,141, 27, 16,137, 68, 16, 10,133, 16, 10,133, 16,137, 68,240,247,247, 71,101,
-101, 37,146,147,147, 95, 6, 16,236, 73,104,110,110, 46, 84, 42,149,227,227,236, 9, 88,181,106, 21,146,147,147,125,126,110,149,
- 74,165,177, 79, 1,168, 27,233, 93,174, 43,113, 55,231,241,243,234,213,171,216,181,107, 23,150, 47, 95,142, 46, 93,186,160,117,
-235,214, 72, 73, 73,193,146, 37, 75, 16, 24, 24, 8, 0, 16, 8, 26,100,168,119,152, 57,115,230,148,127,253,235, 95, 72, 79, 79,
-199,141, 27, 55, 96, 54,155, 95,105,213,170, 85, 48, 0,211,253,238,123,161,161,161,136,141,141, 85,231,228,228, 80,103,229, 31,
- 27, 27,171,126,244,209, 71,241,128,239,146,219,187,129,191,247, 3,208,117,213,170, 85,207,164,167,167, 71, 3,232,223, 20, 15,
-225,172,248,157,191, 55,133, 7,128,186,249,212,119,190,201, 72,192,248,241,227, 27,131, 4, 80, 47, 62,156,241,226, 27,123, 27,
-173, 65,178,178,178,160,215,235,235,116,243, 31, 61,122,180, 49,136, 65,131,113,232,208, 33,181,157, 88, 32, 37, 37, 69, 67, 8,
- 65,219,182,109,213,141,217, 57, 89,247,191,221, 19, 80, 47, 86,175, 94, 61,126,248,240,225, 20, 0, 18, 18, 18,196,223,126,251,
- 45, 94,121,229, 21,214, 53, 47,249,253,247,223,197,246,107,251, 34, 35, 35,159,227,242,255,199,141, 27,135,167,159,126,218,225,
-222,103,191,179,199,236,119,142,238,127, 0,128,221,250,119,215, 14,196,229,122,189,216,179,103,207, 71,173, 91,183, 6, 0, 92,
-190,124, 25,121,121,121, 56,121,242, 36,140, 70, 35, 8, 33, 16, 10,133, 32,132,192, 98,177,192, 96, 48, 96,219,182,109,224, 50,
-224,185, 76, 27,185, 37, 47,185,185,185, 13, 34, 1, 78,207,222, 32,111, 0, 26, 97,170,212,100, 50, 97,208,160, 65,208,104, 52,
-184,122,245, 42, 6, 15, 30,236,184,166,209,104, 16, 18, 18,226, 32, 2, 62,160,227,204,153, 51,243,191,249,230, 27,196,196,216,
- 54, 50,234,216,177, 35, 44, 22,203,247,176,229,166,191,175, 80, 40, 20, 26,150,124,134,133,133,225,248,241,227,148, 85,254, 44,
-249,235,217,179, 39,151,241, 97, 8,128,239, 96,219,243,172, 62, 76, 0, 16, 11,160, 77, 35, 41,255,134, 18,128, 14,115,231,206,
-149,189,243,206, 59,162,182,109,219,202, 1, 68, 61,168, 76,231,190,196, 0,220,207, 32, 64, 59, 9,144,165,167,167,107,124,149,
-209,181,107, 87, 76,155, 54, 13, 63,252,240,131,175, 49, 1, 4, 0,253,225,135, 31,220, 94,220,189,123, 55,236,215,188,150,125,
-236,202, 99, 24,218,237, 60, 10, 50,151, 54,168,158,156,231,252,147,147,147, 17, 19, 19,131,216,216, 88,135,242,239,220,185,115,
- 99,144,190, 6, 17,129,232,232,104,233,161, 67,135,112,231,206, 29, 25,123, 78, 42,149,202, 84, 42,149, 58, 58, 58, 90,234,237,
-188,189,135,255, 37,227, 66, 0,182,110,221,186,139,157,251,215,235,245, 88,181,106, 21, 42, 42, 42, 32, 18,137,224,231,231,135,
- 43, 87,174, 96,249,242,229,208,233,116, 72, 72, 72,248,121,229,202,149,163, 22, 47, 94,172,246,160,100,107,144, 1, 79, 49, 1,
- 28,234, 28, 30,118, 0,116, 76, 7,120,122,222,144,144,144, 97,213,213,213, 48,155,205, 56,122,244, 40, 4, 2, 1,140, 70, 35,
- 42, 43, 43, 97,181, 90, 29,239,177,201,100, 66,117,117, 53,251, 78,247,245, 36,183, 46, 55,127,124,124,188, 35, 30, 32, 44, 44,
- 12, 69, 69, 69, 13, 38,162, 78,171, 2,184,246, 69, 45,128, 16,119, 23,214,172, 89,227, 83, 33, 18, 18, 18,240,246,219,111, 99,
-224,192,129, 14, 15, 8,155, 62,123,224,192,129,184,116,233, 18,218,182,109,235,139,232, 46, 51,103,206,188,250,205, 55,223, 56,
-143,159,161, 55,110,220,184,209,148,138,101,240,224,193,132, 85,250,131, 7, 15,198,224,193,131,213, 0,112,233,210, 37,244,234,
-213,139,107, 59,156, 2,224, 15,224, 71, 0, 83,225,178, 37,184, 29,111, 0,248,204,254,253, 61, 0,189, 0,207, 91,212,123, 80,
-254,255, 3,224, 39, 95,159,125,213,170, 85,125,223,121,231,157, 82, 0, 47,118,235,214,173,208, 78, 80, 18,239, 87,221,179,187,
- 1,174, 95,181,216, 97,249,175, 95,181,216,113,237,190, 19,128,251,141, 7,133, 4, 76,155, 54,141,190,247,222,123,181, 92,129,
-190, 40,255,198,180,254, 1,184,181,254, 89,171, 95, 36, 18,161,176,176,176, 73,149,191,179,245,239, 28,208,165, 86,171,157,189,
- 0,247, 61, 96, 51, 43, 43, 11,175,188,242,138, 1, 64, 64, 96, 96, 32,222,127,255,125,136, 68, 34,199,245, 25, 51,102, 0, 0,
-130,131,131, 49,113,226, 68, 28, 57,114,228,224,125, 44, 39,113,246, 0,212, 71, 2, 34, 34, 34, 92,183,138,117, 75, 6,140, 70,
- 35,180, 90, 45,170,170,170, 16, 20, 20, 4, 63, 63, 63,152,205,102, 80, 74, 97,177, 88, 96, 52, 26, 97, 50,153, 96,177, 88,156,
- 9,253,157,250, 10,153,155,155, 91, 35, 0,144,157, 14,112,246, 8, 56, 95,111, 40,124, 8, 8,148,212,117,193, 57, 38,192, 27,
- 50,176,124,249,114, 76,152, 48, 1, 93,187,118, 69, 64, 64, 0,164, 82, 41,180, 90, 45, 2, 3, 3,161,211,233,176, 97,195, 6,
- 48,140,215, 14,217, 78, 51,103,206,188,186, 96,193, 2,108,223,190, 29,207, 61,247, 28, 0,180, 71, 19,108, 65, 91,151, 39, 32,
- 40, 40, 72, 54,101,202, 20, 53, 0,108,222,188, 89, 54,117,234, 84,111,218,194, 8, 96, 26,128, 31,234, 33, 1,206, 83,109,143,
- 0,232, 7, 32,195, 71,229,255, 24,128, 23, 26,104,236,246,202,200,200,232,116,229,202, 21,185, 93,249,179, 59,104, 54, 9, 88,
-197, 95, 23,254,144,153, 0, 27,170,252, 89,248,106,165, 59, 15,200, 31,125,244, 81,131,149, 63,139, 65, 3, 7,224,192, 65, 53,
- 54, 29, 12,112,144,130, 99, 87, 30,107,208, 51, 70, 68, 68, 32, 55, 55, 23, 73, 73, 73,232,220,185, 51, 54,110,220,232,181,213,
-165, 84, 38, 74,157, 60, 56,141,162,252,217,249,248,162,162, 34,153,235,181,145, 35, 71,202,146,146,146, 26, 45, 22, 0,176,185,
-255,185,122,159,116, 58,221, 5,251, 75,109,221,188,121, 51, 54,108,216, 0, 0,248,241,199, 31,161,211,233,216,219,204,151, 46,
- 93, 66,155, 54,109,154,228, 29,112,137,246,175, 69,206,184,238, 19,159,155,155,123,212, 98,177, 64,167,211,225,206,157, 59,208,
-233,116, 48, 24, 12, 48, 24, 12,168,168,168, 64, 89, 89, 25, 74, 75, 75, 81, 89, 89,137,234,234,106,118,110, 55,173, 62,153,174,
-202,221, 93, 32,169,235,170, 0,174,176,187,250,169,155,115,222, 32,160,177,219, 99,227,198,141,144, 74,165, 8, 8, 8,192,249,
-243,231,161,209,104, 16, 24, 24,136,191,253,237,111, 56,114,228, 8,150, 44, 89,226, 45, 1,104, 63,115,230,204,235, 83,167, 78,
-197, 79, 63,253,196, 42,255,142, 15,138,242,183,141, 11, 74, 41,171,252, 1, 96,202,148, 41,234,139, 23, 47,122, 59,181,202,146,
- 0,216, 73,128,235,116,192,101,167,239,121, 0,206, 52, 64,249,255,143,125,220,242,217,250, 39,132, 92,140,140,140, 76, 11, 11,
- 11, 75, 34,132, 4, 17, 66,154,217,203,221, 36,112, 13, 2,108, 18, 2,112, 63,130, 0, 27, 91,249,219, 21,119, 99, 88,110,228,
-163,143, 62,106,144,242,127,241,141,189, 24, 52,240,174,235,102,235, 79,219, 28, 30,129, 3, 7,213, 62,145, 0,133, 66, 1,251,
-210, 48, 24, 12, 6,236,223,191, 31,203,151,219, 86, 20,156, 57,115, 6,102,179,217, 11, 89,113, 26,192, 22,248, 71, 41,101,131,
- 1, 27,164,252, 89,235,191, 62, 55,127, 99,197, 2,176, 68, 66, 42,149,202, 60,221, 27, 22, 22, 54, 54, 33, 33, 33, 34, 61, 61,
- 93,248,221,119,223, 49, 23, 47, 94,196,140, 25, 51,204,108, 61, 38, 36, 36, 32, 61, 61, 29,223,125,247,157,240,218,181,107,136,
-140,140,244, 40,243, 94,196, 0,176,150,180, 11, 9,160, 44,233,227,138,240,240,240, 76,179,217, 12,163,209,136,219,183,111,163,
-176,176, 16,183,110,221,194,173, 91,183,112,251,246,109,104,181, 90, 24, 12, 6, 84, 87, 87,163,180,180,148,253,159,249,245,201,
-100, 3,253,156, 73,104, 61,101,247, 74,249,179, 57, 0, 92,207, 53,164,127,184, 89, 13,224, 32,121, 92,101,100,103,103,227,210,
-165, 75, 48, 24, 12,136,138,138, 66,255,254,253,177,113,227, 70,188,251,238,187, 16,139,197, 16, 8, 4, 16, 10, 57, 59,100, 59,
-205,156, 57,243,230,212,169, 83,145,145,145,129, 15, 62,248,128,181,126,111,226, 1, 89,198,156,153,153, 73,217, 57,255,147, 39,
- 79, 98,253,250,245, 50, 0,232,217,179, 39,156, 3, 3, 27, 72, 2,230,195,230, 94,159, 4, 96, 14,128, 72,248,230,254,191, 0,
- 96,171,253,127, 76,107, 8, 1,176,227, 52,128,117, 0,158, 1,240, 60,128,205,247,179,238,217, 72,127,119, 65,128,174,171, 0,
-238,215, 20, 0,245,242,252, 31, 69,249, 59, 72, 64, 3,166, 18,106, 40,127,119,199, 7, 14,122, 63,190, 57, 15,186, 1, 1, 1,
-232,221,187,102,220, 75,122,122,186, 87,242, 38, 77,154,132,164,164, 36,176, 68, 0, 0,181,159,243,122,221,249,198,141, 27,213,
- 0,176,103,207, 30,153,187,136,245,148,148, 20,205,213,171, 87,221, 90,143,238, 80, 87,210, 31,150,104,164,164,164, 32, 58, 58,
- 90,166, 86,171, 61,246,157,244,244,244,253, 43, 86,172, 24,157,154,154,122, 32, 60, 60, 28, 89, 89, 89,208,233,116,194,224,224,
- 96,204,156, 57, 19, 90,173,246, 90,106,106,106,151,240,240,112,164,166,166,146,184,184, 56, 79,228,184,214,156,127, 3, 98, 0,
-106,188, 91,108,190, 4,123,238, 4,135,103,198,105,254,223, 99,123, 12, 29, 58,244, 93,141, 70, 51,207, 98,177,160,172,172, 12,
- 38,147,201, 49,239, 95, 85, 85, 5, 74, 41, 40,165,184,116,233, 18,140, 70, 35, 98, 98, 98, 94, 82, 40, 20,102,119, 73, 71,234,
- 66, 76, 76, 12, 98, 98, 98,106, 4,253,121, 59, 5,224,172,232,237, 46,127,234,220, 63,236,171, 2, 26,123, 92,227, 60,126,178,
- 75,253,222,124,243, 77,104, 52, 26,200,100, 50,100,103,103,163, 89,179,102,200,203,203,131, 64, 32,224,234, 1, 32, 51,103,206,
-188, 62,125,250,116, 28, 62,124, 24,127,251,219,223, 0, 32, 20,192, 13,220,205,255,208,228,150, 63, 59,190,228,230,230, 34, 34,
- 34,130,237,103,178,216,216, 88,117, 88, 88, 24, 46, 93,186, 68, 57, 6, 2, 58,147,128,169,118, 2,240, 35,128,163, 0, 20, 0,
-164, 0, 10,193,163,241, 58,112, 99,103,227,115, 23,240,179,106,213,170, 58,207, 55,165,242,183,175, 0,184, 23, 44,218,103,153,
-215,243, 61,247,111,127,127,239,188,150,158,130,196,188, 69, 76, 76,140, 44, 41, 41, 73, 51,121,242,100,186,101,203,150, 26, 68,
-192,133,240,113,174,135,184,184, 56,143,204,198,203,196, 64,212,133, 72,216, 70, 37,153,140,147,242,119, 26,204, 29,243,250,145,
-145,145,127, 73, 72, 72,248,126,226,196,137,184,116,233, 18,174, 93,187,214,101,233,210,165,178,184,184, 56, 78,242,238, 81, 30,
-128, 26,245, 92,135,226,227,148, 49, 80,161, 80,232, 19, 19, 19,151,237,222,189,251,239,102,179, 25, 37, 37, 37,142, 24, 0, 0,
-184,125,251, 54, 74, 74, 74, 64, 41,101,173,118,175,180, 44, 59,255, 31, 17, 17,225,136, 96,103,207,115, 37, 1,110,172,252, 90,
-211, 80,247, 64,249,123, 13,150, 4, 44, 94,188, 24, 41, 41, 41,152, 56,113, 34, 86,172, 88,129,183,222,122, 11, 66,161, 16, 18,
-137,196,227, 24, 66, 41,181,206,154, 53, 11,223,127,255, 61,190,253,246, 91, 0,232,108,202,132,133,197, 0, 0, 32, 0, 73, 68,
- 65, 84, 87,254,141,110, 80, 53, 4, 5, 5, 5,216,181,107, 87,141, 44,142,246,239,178, 81,163, 70,169,125, 92,242,104,177,147,
-128,157,118,235,127, 40,175,252,235,134,187, 32, 64, 78, 4,192,155, 68, 28,190, 42,236,198, 70, 99, 40,255,134, 42,234,123,129,
-249,243,231,203, 46, 94,188,216,168, 50,237, 46,210, 70, 93, 74,199, 42, 60,251,218,122,214, 43, 64, 9, 33,176, 90,173,216,186,
-117, 43,103, 18,240,246,219,111,179,229,172, 21, 3,192, 48, 12,172, 86, 43,222,121,231, 29, 53, 87,229, 89,159,188,148,148, 20,
-141,115, 86, 68, 31,250,221,127, 86,172, 88,113, 59, 53, 53,117, 15, 87,171,255, 62,120,219,136,171,183,167, 14,194,199,137, 4,
-196,197,197,125,168, 84, 42,147,126,248,225,135,115, 98,177, 24,236,170, 0,171,213,138,150, 45, 91, 66,167,211, 65, 46,151, 35,
- 38, 38, 38, 64,161, 80,120, 92,224,205,142, 47,206,193,127, 39, 78,156, 64, 76, 76, 76,141,241,196,211, 56, 20, 31, 31, 79,115,
-115,115,101,174, 46,126, 95,211, 0, 59,195, 77,128,159, 25,128,121,205,154, 53, 18,187, 53,202, 56,125,188, 34, 1,206,137,127,
-230,204,153,227,248, 94, 86, 86,230,113,108, 34,132,144,153, 51,103,210,239,190,251,238,121, 0,191, 60,136,138,199,174,232,137,
-183,215,184,144,118, 23,220,124, 24,198,240,251, 13,118, 21,128, 59,197,207,105, 21, 64, 99, 43,245,186,228, 61, 40,228,225, 65,
-238, 56,159,124,242,137,166,177,101,186,172,145,190,103,112,113,255,115,125,169,185,230, 66, 39, 94, 60,239, 61,125,214, 37, 75,
-150,236,109, 72,125,142, 27, 55,174,198,178,216,167,159,126,186,134,103,192,203,185,127,226,165,183,135, 83,185, 21, 10,197,121,
-165, 82,217,108,223,190,125, 31,231,229,229,205,171,172,172,132,197, 98,193,128, 1, 3, 48,120,240,224,132,152,152,152,120, 46,
-202, 31, 0,142, 29, 59,230,248, 30, 29, 29, 93,227,188,235,177,135,113,133, 56, 19, 90,150, 76,216,227, 0,124,106,247,201,147,
- 39,215,117, 73,232, 52, 94,138,239,213,184,226,193, 83, 97, 5,128,111,191,253,150,223, 48,133, 7,103, 18, 80,151,242,175,139,
- 0, 52,118,231,226, 59, 43, 15,226, 37,179,255,211,213,141,179,194,191, 7,211, 2,141,242, 14, 42, 20, 10, 61,108,174,215,249,
-236,185, 11, 23, 46,112, 81, 92, 14,244,237,219,183,209,199, 3,119,132,214, 87,151,255,189, 38,139, 60,120,253,113, 63, 73,128,
-199,202,245,117, 31, 97, 30, 60,120,240,224,193,131,199,195, 11,134,175, 2, 30, 60,120,240,224,193,131, 39, 0, 60,120,240,224,
-193,131, 7, 15,158, 0,240,224,193,131, 7,143,135, 16,102,120,177, 93, 49,143, 63, 39,132,124, 21,240,224,193,131, 7, 63,182,
-243,248,147,119,146, 83,167, 78,249, 28,113,233, 46,152,208,131,188,122,215, 31,251, 32,175,177,203,199,203,227,229,253,169,229,
-253,246,238, 53,159, 7,150,129, 31,119,193,189,150,119, 98,137,239,242, 34, 86,212,150,199,214,159, 82,169,148,154, 76, 38, 92,
-185,114, 69,109, 52, 26, 33, 20, 10,145,159,159,143,151,130,186, 98,111,102, 38, 42, 31,239,140,161, 67,135,202, 4, 2, 1,187,
-174,189,201,218, 87,169, 84, 62, 6,160,237,185,115,231,118,117,236,216,145,209,106,181,146,142, 29, 59, 46,247,247,247, 95,167,
- 80, 40,110, 0, 64, 98, 98, 34,147,152,152,104,169, 75, 94, 98, 98, 98,115,187,183,192, 16, 23, 23, 71, 1, 96,233, 95,159,252,
- 74,241,100,222,204, 77,153,225, 87,132,109,199, 14,109,214,188, 69, 5, 0, 74, 41, 21, 2, 8, 78, 76, 76,188,206,191,111, 15,
-182,188,123,205, 18,185,110,250,226,109, 10, 92,175, 83,230,174,138,122, 74, 42, 12, 9, 82,231,100, 93,150, 61,234,215, 12,139,
-206, 30,210, 60, 72, 44,171,158,124,228,252, 18,151, 38,198,132, 9, 19,164,187,119,239, 86, 39,188,107, 59,254,249,240,147, 56,
-116,232, 16,167,118,249,203,140, 87,165, 12, 33,234, 75, 23, 47, 66,167,211,161, 75,151, 46,104,214,188, 57,182, 37,109,229,220,
-174,147, 38, 77,170,241,226, 38, 37, 37,213,187,151,130, 61,187,162, 79,253,134,221,168,137, 82,218,176,126, 39,215,214,124, 85,
- 85, 33,190,203,138, 88, 3,132,189,106,251,158,187, 1, 56,177,168,225,141, 58,233, 78,205,242, 37,181,230,244, 51,165, 82, 73,
-245,122,189,108,219,182,109,234,220,220, 92,200, 69,173,208,190,115, 27, 84,233, 43,225,111, 48, 99,248, 91,175, 99,228,196, 41,
-216,249, 77, 34,118, 28, 56,160, 30, 59,118,172,236, 1,232,194, 89, 22,139,165, 67,110,110,174,181,127,255,254,226,240,240,112,
-156, 60,121,242,221,170,170,170, 9, 74,165, 50, 70,161, 80,104,227,226,226,172,245, 45, 9,139,139,139, 43,119, 62,254,226,139,
- 47,152, 61,255,137,239,209,105,214, 64,188, 51,164, 79,155, 99,251,254,189,101,235, 25,233,169, 30,125, 71,173, 32,132,104, 21,
- 10, 69,254,128, 1, 3,172,118,210,192,123, 26,254,100,110, 34,111,153, 6,167,108, 99,190, 40,255, 47,163,159,149, 70,181,233,
-164, 38,160,200,174, 40, 65,135,142, 93,213, 38,171, 5, 75,250, 13, 67, 81,151, 54,178,111,118,254,194,137, 8,196, 78, 5,237,
-213,157, 61, 18, 96,219, 62, 43, 14, 31,167,136,157, 10,244,234, 14, 44,250,168, 97,138,155,221,160,164,161,217,201,220,145,137,
-198,146,219, 16, 80, 74, 41,150, 17,144, 15,235,189, 7, 88, 70, 48,249,130,252,129, 89,107,125, 87,249, 83,187,242, 31,137, 35,
- 71,142,112,250,109,218,177, 23,169,217,212, 11, 42,213, 77,164,167,217, 18,214,100, 93,188, 4, 0,216,181,139,208, 75,151, 39,
-201, 22,205,231,214, 46, 99,198,140,177,238,223,191,159, 73, 74, 74,194,193,131, 7,107, 36,195,113,133,143, 41, 84, 29,205,228,
-166, 35, 83,234, 3,161, 96,211,133, 55, 56,103, 65,216,171,142,141,118,214,172, 89,211, 56, 4,192,169,158,236,187, 19,114, 66,
- 78, 78, 14, 52, 91,182,168, 63,140,153,140, 1,211,230, 64,220, 46, 24, 16,218,147,253, 89, 41, 96, 21,193, 90, 77, 49,254,213,
- 88,228,125,186, 18, 71,143, 30, 85, 43,149,202, 26,233,110,155, 0, 22,134, 97,218,182,110,221, 26, 26,141, 70,216,191,127,127,
- 12, 25, 50,132, 41, 44, 44, 28,120,250,244,233,179, 74,165,114,144, 66,161, 40,180, 43,107,134, 99,221, 53, 27, 61,106, 76,216,
-138,213,219,153,248, 25,103, 90, 12, 29, 55, 91, 54, 52, 50,249,201,183, 62,203,127, 38,252,137, 87, 34, 0,148,195, 22, 99,192,
-212,165, 31,156, 19, 91,121,234, 71, 13, 38,164, 60, 92, 61, 9,158,188, 5,142,239,222, 4, 1, 82,182,113, 7,188,210, 15, 74,
-165,146,241, 66, 17,186,110, 82, 65, 35, 34, 34, 16, 17, 17,225,115,158,120,229,203,177,210,151, 7, 70,169,123,118, 8, 69,247,
- 14,161,120,188, 77, 71,132,250, 55,131,196, 10,116,243,107,134,160,236, 27,234,153,207, 60, 39,229, 34,171, 87,119,224, 98, 14,
-131, 11,151, 3,112, 54,167, 5,158, 31, 19,136,213,239, 9,208,171, 59,105, 52, 35,189,161, 74,154,221,230, 52, 44, 44, 76,157,
-153,153,137,204,204, 76,252,253, 63,167,241,232,248,120, 53, 0,234,229,150,167,148,235, 71, 46,151,123,126,139,151,217,234, 40,
- 34, 34, 2,114,185,220,237,135,189,199, 91, 76,236,255,129,212,185, 60, 19,250, 45,147, 54, 70,123, 76,152, 48, 65,186,107,215,
- 46, 53, 33, 4,111,126, 76,240,243,225,145, 56,124,248, 48,167,223,110,217, 50, 77, 58, 52, 50, 14, 35, 70,220,196,167,159,126,
- 90,227,218,203, 47, 3,227,199, 3, 11,231, 37,169, 87,127,194,173, 77, 88,229,175,209,104,192, 48, 12,166, 76,153, 2,129, 64,
-208, 16,101, 95,203,242,119, 55, 32, 19,226,155,242,111, 52, 68,172, 6, 0,172, 93,187, 22,107,215,174,181,157, 27,148,208,100,
-197, 57,120,240, 32,190,120, 33, 22,131,159,147, 67,216, 42, 4, 68, 36, 0, 35, 18, 64, 32, 17,131,241,151, 0,160,160, 22, 51,
-168,209,136,215, 95,157,131,178, 3,153,200,201,201, 81, 43,149, 74, 41,154, 14, 36, 51, 51, 51,170,115,231,206, 98,171,213,138,
-148,148, 20,108,223,190, 29, 65, 65, 65,136,138,138,234,176,121,243,230,127,216,239,227, 20, 16,168, 84, 42, 5, 71, 14,252,247,
-255, 30, 9,200,111,167, 47, 23,224,229,101, 21,248,252,223,159, 0,205,251, 10,255, 29,223,182, 91,206,201, 31, 94,118,210, 29,
- 76, 29,196,144, 56, 41,117, 98, 59, 77, 28,223,157,207,223,163,189, 48,120, 52,178, 7,192,209, 74,155,246,252, 80,210,253,209,
-238, 45, 21, 31,190,110,245, 82, 59,146,136,136, 8,202,166, 37,117, 74, 79, 74,189, 77,219,169,124,225, 85,233, 83,157, 31, 85,
-139,171,204,240,255,247,219, 48, 27,140,144,188,249, 17,130,196, 18, 84,137, 42,161,175,170,132, 63, 8,170,175, 23,169,255,249,
-207,127,202,222,121,231,157,122,149,239,197, 28, 96,253,143, 86, 0, 6,251, 7,120,242, 9, 6, 47,140, 37, 53,222,155,216,169,
-192,122, 31,118,118,182, 91,233,212, 87,107,157,181,250, 51, 51, 51,239,214,193, 17, 19, 42,141,122, 0,192,232,248,253, 80,173,
- 26,227,149,151, 33,103,101, 14, 68, 36,251,110, 71, 32, 5, 32,173,123, 57, 29, 23,161,205,255,190,192,173, 97, 63,116,228,155,
- 39,117,165,157, 37,118,210,119,226, 4,183,118, 86, 60,251,185,116,253,246,191,170,119,156,254, 0, 43, 22,252,140, 72,105, 56,
- 54,125,121, 24, 95,239,179,109, 16, 52,251, 47, 31,200,214,253,231, 3,159, 72, 85,194,187,160,192, 46,168,190, 59, 7, 74, 41,
-154,183,125, 28,135, 15, 31,134,125,223,130,122,203,183,250, 19,185, 84, 46,111,165, 6,190, 0,240, 51,210,211,129,200,200,187,
-215,255,241,143,187,223, 23,206, 75, 82,251, 7, 44,149,205,126,125,121,189,229,100,149,127,116,116, 52,172, 86, 43, 62,255,252,
-243, 70,117,208, 0,128,213,106,173,173,252,105,253,239, 47, 51, 89, 87,227,229,103,135,112,171,220,205,125, 14, 63,159,237, 75,
-255,254,181,231,216,153, 41,186, 26, 52,223,106,157,129, 5, 11, 22, 56,174, 47, 88,176, 0,107,215,174, 5,211, 99,214,221,255,
-106,191,223,157, 60,225, 20,247,229,115,221,201, 90, 56,133, 91,249,170,170,170,208,190, 75, 87,192,106, 4,227, 7, 16,161, 0,
-230,242, 82, 84,229, 94,193,237,252, 2,116, 26, 38, 5, 17,183, 4, 49, 25, 1, 1,131, 85,179,223,194,152,245, 31, 96,209,162,
- 69,141, 61, 46,115,210,138, 74,165,146, 80, 74, 91, 86, 86, 86, 14, 11, 9, 9,193,165, 75,151, 96,181, 90,113,229,202, 21,108,
-216,176, 1,189,123,247, 70,104,104,232, 43, 0, 94,119, 81,214,117,122, 3, 40,165,173,187, 48,233,210, 14,143,140, 19,151,164,
-156, 65,169,206, 15,223,239, 52, 99,247,177,255, 96,158,220, 95, 40, 52, 88, 35,236, 49, 5,110, 9, 0,175,208,155, 30,117, 77,
-247,184,243, 12, 48, 28, 58, 34, 59,111, 8,233,146,145, 88,159,162,108,153,115, 57, 7,167,190, 59, 3,165, 82,233,149,245,192,
- 42, 7,131,225, 7, 24, 12,155,160,213,198,176,214,177, 87, 15, 56,196,175,133,186,109,149, 5,146,101,115, 96,185,163,133,249,
-242, 85, 8,197, 34, 4, 16, 1, 2,137, 0,129, 2, 33, 66, 68, 18,208,114, 61,110, 30, 60,234,113,167, 23,119, 74,253,240,113,
-171,227, 61, 92,253, 30, 65,194, 82, 98,247, 8,248,102,253,219,149,179, 26, 62,164,192,117, 85,254, 16, 10,144,123,179, 2, 55,
-139,141, 72, 63,111,219, 64,164,199,140, 29,240,102,223,115, 17,201,134,144, 20,192,143, 57,109,251,219,150, 32,248,229, 27, 8,
-154,122, 22,126,207, 47, 3, 66, 3,189,243,228,114,216,185,205,155, 45, 94,149,219,223, 80, 15, 13,121, 15, 39, 14, 93,193,255,
- 76,154,136,208,214, 61, 49,231,175,175,225,179,165,251, 48, 52,120, 41,214,253,231,239, 62,239,224, 67, 8, 16,183,232,172,195,
- 98, 25, 49, 98,132, 93, 33, 89, 61, 54,240,180,169, 34, 53,112, 16,192,207, 40,185,213, 12, 61, 30,105,134,175,190,178, 89,254,
-203,150, 1, 97, 97, 54, 17, 37,183,154,161,228, 86, 51, 12,232,119, 65,237, 73,249, 31, 60,120, 16, 86,171,213,161,164, 55,111,
-222, 12,139,197,226,149,251,186, 30, 15, 79, 45,229,111,123,159, 61,147,119, 10,144,117, 74,165,140,181,212,172,148,194,106,173,
-221,125,217,243, 86, 74,177, 46, 49, 81,150,104,251,141,219,255, 73, 1, 66, 41, 72, 98,162, 82, 70, 41,197, 39,159,124,226,184,
-206,126, 79, 76, 76,148, 81,106,187,143, 2,164, 46,121,137, 74, 37,236,215,136,197, 98,129,217, 98,129,217, 92,187,206,216,243,
-102,139, 5, 95,174, 91, 39, 91,151,152, 88, 71,249, 40,132,205,155, 3, 34, 1, 44,134, 10,156,219,154,132,191,189,166, 64,167,
- 55, 20, 24,184,242, 67, 92,249,237, 36, 4,254, 18,152,138,111,225,204, 49, 13,118, 28,222,139,210,194, 66,156, 61,123,182,209,
- 54,214,138,138,138,226,228, 77, 80, 42,149, 65,148,210, 33,153,153,153,191,188,255,254,251,125,206,157, 59, 39, 54, 26,141, 16,
- 8, 4,104,222,188, 57,204,102, 51, 50, 50, 50, 64, 8, 17,123, 26,235, 19, 19, 19, 3,149, 74,165,127, 98, 98, 98,104, 73,126,
-234,111,127,255,191,188,144,223, 15,239,132, 86,207, 64, 44,100,208, 41, 88,130,210, 59, 98, 40,254,105,198,153, 59, 3, 3, 61,
-233, 13,123,172, 9,117,238,139,118, 98, 80,235, 60,175,174,239, 15, 88,229,239, 74, 14, 24, 79, 44,148,221,239,187,134,155,115,
-220, 52,239,189,125,118,119,191,193,176, 9, 0, 65, 85,213,183,144, 28,191, 10,195,222, 71,107, 92,247,132,119, 6, 69, 75,131,
-180,229,176,138,133, 48,158, 56,135,234, 11,185,168,218,119, 24,168,172,134,152, 82, 4, 64, 0, 33, 8,170,173,102,104,171,171,
-240,229,254,157, 30,101,174,126,207,102,221, 59,195,118,204,154, 43, 20,151, 46, 83, 44,250,200,247,254,234,146,175,156,179,203,
- 94, 46,151, 59,246,214,102,241,210,218,124, 28, 56,161, 67,222,173, 42, 0, 64,222,173, 42,100,231, 87, 2, 49, 91,216,141, 81,
- 60,187,126, 72,129,141, 8,148,159, 65, 96,224,101,248, 73,202, 97,181,106, 97, 50,157,128, 64, 16, 6,163,190,184,201, 58,235,
-228,113,127,149, 2, 4,159,255, 60, 11,205,152, 71, 0, 0, 55, 47, 81, 12,154, 40,192, 95,151,143,193,136, 49,125, 0, 80,251,
-125,222, 33, 58, 58,154,190,249, 49, 65,179, 54,253, 64, 1,140,123, 97, 54,231,121,255,117, 95, 45,165,109,219,254, 14,224, 44,
- 74,110, 53, 67,121,177,109, 11,230,254,253,129, 30, 61,128, 87, 94,185,171,252,203,139,253, 81, 94,236,143,144,128,155,245,202,
-156, 52,105, 18,100, 50, 25, 70,141, 26, 85,195,245,239,252,241,101, 74,192,221,123,235, 11,226,156,230,183, 9, 33,142, 79, 93,
-231,226, 20, 10,141, 34,214,243,156,120,108,108,172,218,157,229,188, 96,193, 2,196,198,198,214, 80,168,117,201,251, 89,169,196,
-217,179,103, 29, 46,120,231, 58, 99,225,122,110,118, 92,156, 38, 78,225,126,171,102, 49,165, 96, 2,252, 96, 42,188, 6,229,210,
-165,216,160, 47,129, 46,122,168,227,250, 55,255,217,128, 15,222,122, 13,225,139, 94,194,135,103, 14, 98,139,238, 10,198, 60,251,
- 44,194,194,194,188, 14, 6,180, 43,122, 26, 25, 25, 89,163, 15, 31, 59,118, 76, 93,223,118,236, 74,165, 82,164, 84, 42, 7,159,
- 57,115, 38, 47, 37, 37, 69,243,230,155,111, 14,253,252,243,207, 37, 21, 21, 21,142,109,154,171,170,170,208,172, 89,179,236,201,
-147, 39,247, 28, 62,124,248, 35, 30,136, 4, 67, 8,233,114, 38,109,107, 81,214,222, 69, 87, 23, 45, 73,232,176, 99, 89, 71, 92,
- 40, 16,162,180, 66, 0, 43, 1,138, 43,140,160,173,186, 87, 45,124,247,163, 62,207, 60,255,151,215,225, 33,158,192,238,254,175,
-225,234,247,240,157, 71, 19, 40,255,186,166, 0, 40, 87, 87,142, 66,161,240,116, 19,117,181,254,109,174,182,111,235,242, 14,120,
-252,167,125, 90,183, 83,107,169, 9,226, 98, 45, 36, 63, 31, 4, 17, 50, 64,149, 17,180, 92, 15, 98, 54, 67, 4,192, 66,173,168,
-178,152, 81,110, 54, 2, 86,207, 86, 20, 27,228,183,250,189, 58, 57, 45,108, 65,130,141, 66, 88,137, 83, 32,159,199, 23,160,150,
-245, 15,224,191,111,116,168,113, 60,120,113, 46, 68,244, 14, 76,164, 53, 84, 42,213, 65,174, 47,150,164, 66,141,144, 15,255,131,
-219,111,198,225,142,214, 31, 29, 77,231, 96,177,228, 2, 0,174,157,106,223,100, 29,118,203,158,207,212,175,141, 85,214, 80,254,
- 44,134, 6, 47,197,176, 62,147, 16, 21,114, 14, 91,246, 44, 87,123, 51,136,140, 28, 57,146,166,164,164,160,184,120, 52, 90,181,
- 58,128,102,173,251,130, 82, 10,134, 97, 56, 5, 34,229,229, 1,185,185,103,237, 71, 21,128,164, 2, 90, 61, 48,100,136,237, 76,
-118, 54,240,197, 23, 64,121, 25,160,175, 0, 42,244, 64, 96,112, 25,167,178,213,101,237,231,228,228, 0, 0, 62,254,248, 99, 0,
- 64,120,120,248,189,112, 51,115,170,195,249,243,231,215,176,216, 93, 21, 55,103,239,142, 93, 97, 59,230,253,157,240,201, 39,159,
- 96,237,218,181, 80, 42,149, 82, 79,193,117,179, 66,195,145,117,238, 60, 10,130,131,213, 12,195, 96,222,188,121,181, 98, 50,188,
- 41,223,147,213, 45, 65,173, 21,120,237,227,247,208,111,210, 36, 40, 63,254, 24, 12,115, 87,207, 41,179,207,222,245, 16, 30, 62,
-140,253,251,247,227,202,149, 43, 50,133, 66,161,225,178,241,138,179,242, 79, 75, 75, 83, 3, 64, 70, 70,134, 58, 42, 42, 74,150,
-150,150,166,137,140,140,148,166,167,167, 35, 42, 42, 74, 86, 89, 89,169,174, 99,204, 53,205,152, 49,163,223,180,105,211, 90,116,
-235,214, 13,187,119,239, 54,148,150,150, 10, 43, 43, 43,109,222, 14,251,252,199,182,109,219,194,199,141, 27,231,175, 80, 40, 42,
-221,136, 97,156,148, 53,147,123,233,212,218, 15,222,153,217,172, 85, 15, 21,126, 83,189,138,223,175, 19,228,221, 18, 2,148, 65,
-181,209, 4, 45,109, 85, 48,119,214,156,161,132,144, 2,118,204,247,230,121,221,120, 8,248,169,130, 7, 4,117,178,184,148,148,
-148, 90,159,146, 2, 29, 74, 10,116, 94,181, 53,251,185,107,197,218, 26, 94,114,252, 42,252,206, 22, 64,152,175, 99, 61, 0, 53,
-238,175, 75,224,249,252, 60, 28,191,115, 3,231,174,228,226,214,149,171, 40,187,154,143,242,235, 5, 48, 27, 42, 97, 50,153, 81,
-110, 49,194, 96, 49,163,154, 90, 96, 1, 5, 37,220, 73,166,115,180,255,197, 28,219,241,162,143, 88,203,159, 65,194,123,141,179,
-226,197,219, 56,128,120,149, 14,241, 42, 93, 13,133,207,126,162,226, 51, 32,162,119, 32,164, 58,252,119,150,197,204,121, 10,224,
-214,113, 88,244,205, 0, 0,255, 22, 6,161,250,214, 53,100,254,179, 3,178,126,152,128,227,255, 28,128,236, 75, 55,154,180, 99,
-246, 31, 18, 6,189, 14,208,235, 0,131,255,121, 0,192, 79,127, 55,225,157, 5,203, 0, 0,195, 99,250,120,109,249,191, 48,242,
- 16,180,218, 24, 4, 31, 59,128, 53,239,217, 72,238,200,145, 35, 57,185,254, 1, 96,197, 63,150,147,238,221, 1,231,207,197,139,
- 54,247, 63, 0,244,232, 65,177,118, 45,208,165,103, 5, 30, 27,122, 27, 67, 70,223,198,243, 47,153, 56,151,209,217,226,103,143,
-195,195,195, 17, 30, 30,142,121,243,230, 53,118, 21,123,124,215,156,177,126,253,122,153, 59,133,237,240,162,173, 94,141,245,235,
-215,115,178,132, 95,127,253,117, 53, 27,249,239, 14, 11, 23, 46,172,229, 5,112,135, 67,231,243, 48,115,214, 92,156,216,180, 9,
- 75,150, 44,169,147,156,176,229, 59,112,224, 0,234, 11,216, 27,249,216, 35,248,246,155, 47, 16,241,242,203, 88,177, 98, 5,234,
- 43,227,130, 5, 11, 48,122,244,104,248,178, 2, 32, 45, 45, 77,237, 20, 44,135, 99,199,142,169, 1, 32, 61, 61, 93, 77, 8, 65,
- 90, 90, 90,189, 50, 13, 6, 67,203,157, 59,119,226,252,249,243,200,206,206, 14,208,235,245, 48,153,108,253,204,104, 52, 98,207,
-158, 61,196, 78, 22, 42, 57, 20,199, 90, 93, 93, 45, 62,177,245,101, 84,101,125,134,189, 41, 57,184,114, 83,128, 50, 61, 3, 11,
- 5, 10,244,254,152,187,232,189,168,184,184,184,124, 14, 6,159,131, 87,176, 75, 78, 57, 78, 7,240,104, 2,235,191, 46, 2, 64,
- 0, 16,169, 84, 10,169, 84,138,211,167, 79, 59, 62,185,199,175,161,180,178, 20,173,134,120,191,238,247,196,137, 19, 4, 0, 2,
- 2,166, 65,114,252, 42, 68,215,138, 65, 9,129,120, 86,113,141,235, 30, 21,151, 88, 0, 11, 5,242,245, 37,200, 43,213,226,118,
-153, 14,165, 85, 85,208, 25, 43,113,187,186, 18, 55,171, 12, 40,168,170,128,214, 84, 13,157,213, 4,163,213,115,240,235,147, 79,
-184, 25,240,156,226, 2, 94,155,210, 12, 20, 98, 80,175,183, 1,191, 27,189,239,230, 28,103,228,221,170,194,129, 19, 58, 12, 94,
-156, 91,179, 46,232, 29,248, 89,175,193,207,122, 13, 31, 60, 37, 68, 94, 94,158,145,171,204,173, 87,172,104,147,144,232, 56,190,
-162,183, 32, 63,167, 0,151, 82,207,161,240,106, 73,147,119,220, 77, 95,166, 0, 0,202,138, 40, 2, 42, 31,131,116,150, 16,255,
-179, 76,228,248, 36,108,121, 25,132,187,241, 79,159, 27,145,130, 87, 23,217,148, 63, 33, 4,191,164,218,154,128,235,154,127, 22,
-225,189,122,214, 44,231, 38,224,243,207,129,203,151,109,158,128,191,255,157, 58,220,239,148, 82, 4, 7, 7,123, 30,129,237,125,
-148,157,247,255,248,227,143,145,147,147,131,172,172, 44,100,101,101, 33, 57, 57, 25,111,189,245, 22,242,242,242,154,172, 61, 88,
- 69,231,206,146,158, 63,127, 62, 8, 33,156,149, 33, 33, 4,245,145,137,250,174, 57,227,176, 95, 9, 8,211, 12, 95,191,251, 17,
-154,237, 76, 70,108,108, 44, 94,102,217, 24, 0, 69,143,190,152, 31, 49, 12, 1, 1, 1, 24, 57,114, 36,222,127,255,125, 36, 39,
- 39,171, 87,172, 88,225,246,253,251,166, 32, 11, 55,251, 60,134,208,208, 80,153,213,106,173,151, 80,212,119,141,131,114,116,120,
-156,162,162,162,100, 78,138, 18, 67,135, 14,149,121,240,158,140, 26, 57,114,100,139,188,188, 60, 28, 62,124, 24,143, 62,250, 40,
-132, 66,161, 99,138, 35, 52, 52,148,235,116,132,213,254,127, 73,247, 94, 3,227,215,239,107,137,223,119, 47,195,147, 81,189, 17,
- 40, 97, 16, 24, 96,129,191, 95, 53,158,126,110,178, 21,128,214,249,135,137,137,137,158,230,162, 28,171, 0, 56, 78, 7,240,120,
-208, 60, 0, 0,136, 82,169,108, 62,127,254,124,204,159, 63, 31, 0,140,255,136,251, 7, 76, 69,102,248,251, 75,224, 75,227,201,
-229,182,240,225,128,167, 46,131, 10, 24,188,255,147,193,217,250,231,132,128,208, 80,153,185, 89, 0,116,212,130,243,122, 29,206,
-150, 22,227, 92,217, 29,156, 43,211,226,188, 94,139,203, 6, 29,138,171,171, 80, 97, 54,227,134, 65,239,248,159,245,225,133,177,
- 4,171,223, 19, 96,245,123, 2, 80, 8, 64, 9,131,216,169, 4,175, 79, 21, 99,214,148, 54,232,222,189, 29,172, 16,121,253,200,
-172,171,223,121, 94,190,158,164, 64,117,201,144,101,231,219,136,124,230, 74, 91, 16,221,222,183,131, 0, 0, 66,170,131,128,234,
- 81,205,216, 34,154,181, 90,109,128, 92, 46,143,241,166,140, 17, 17, 17, 72, 78, 78,198,166, 10, 61, 42,141, 12, 94,253,241,107,
- 20, 73,252, 81,105,108,186,109, 34, 38,246,255, 64,150,166,253, 8,155,190,223,226, 56,247,211,223, 77, 24, 26,188,212,113, 28,
-251,204, 23, 50, 10, 78,235,135,233,154,165,192,140, 69,163,209,242, 88, 50,100,255,140, 6, 51, 1,208,104, 52, 62,245,225, 46,
- 93,106, 70,143,143, 26, 5,180,108, 9,132,133, 1,145,253,155, 67, 34, 22, 64,192,220, 21, 43,241,247,247, 56, 32, 51, 12,227,
-176,252,115,114,114, 28, 86, 63,251,249,240,195, 15,241,225,135, 31,226,198, 13,238, 94, 25,119,243,245, 53,175,123,111,125,173,
- 95,191, 94,182,102,205, 26,183, 10,155,171,245,239,228,122,174, 21,167,192, 30, 91,173,220, 82,216, 27, 9,129,213, 80, 13, 81,
-251, 46, 80, 44, 95,142, 25,129, 45,209, 82,147,230,184, 62,235, 47, 51,240,193,191,191, 70,246,234,255,226,111,253, 70, 97,114,
-112, 55,236,223,190, 29,185,185,185,110,223,191,231,227, 20,232,211,183,175,204,106, 47, 19, 75,200,156,167,103,220,157,171, 11,
-179,103,207,166,132, 16,202, 6,246,177,243,253,206, 74, 62, 45, 45, 77, 51,116,232, 80, 25,165, 20,236, 84,128,135,122, 75, 17,
-137, 68,143, 62,255,252,243, 57,165,165,165,208,233,116,240,247,247, 71,155, 54,109,208,178,101, 75,180,108,217,210, 83,229, 89,
- 93,136,157,197,207,207,207,240, 98,220,167,178, 13,199, 7,227,234,245, 50,180, 11, 18, 32,170, 39,193,227,221, 40, 2, 91,180,
- 40, 1, 96,169, 71,111,240,251, 13, 60,164,214, 63,224, 97, 25,160, 66,161,168, 80, 42,149,126, 0, 2, 21, 10,133,131, 5,118,
-138,238,232, 19,243,101,151,250,201,229,114, 42,158,229,136,252, 39, 78,243,255, 30, 7,228,119,119,109,209,124, 28,243, 28, 12,
-230,106,148,233, 13,200, 49,153, 32,178,218,126, 92,106,170,130,149, 82, 80, 0,187,111, 93,129,222,108, 2, 0, 14, 3, 19,193,
-162,143,106,246,113, 91, 60,128, 21, 22, 84,227,194,229,114,124,187,185,204,171,135,117, 86,244,118,151, 63,181,127,119, 40,118,
- 46,171, 31,108,191, 85, 65, 52,250, 75, 0, 97, 40, 46,190, 27,156, 39,182,222,132,145,233,128,185,253,178,112,243,166,195,114,
- 58,192,165,124,113, 63,173,175, 65,188, 84, 42, 21,216,210,252,120,230, 40, 98, 98, 98,154,172,227,238, 56,109, 91,222,151,154,
-124, 14, 0, 48,172,143, 45, 51,222, 59, 11,150,225,232,185, 62,248,247,150,151,161,220, 57,135,243,252,255,171,139, 98, 16, 18,
-146,108, 63,210,216,201, 82, 12, 40,181, 89, 99, 0, 69, 72, 72, 50, 39, 89,251,247,238,115,228,180,120,249,101, 64, 38, 35,184,
-115, 61, 8,122,157, 4,149,101, 98,252,184,145, 96,254,124,138,107, 69,229,136,140, 26,138,148,131,106, 78, 86,177,197, 98,113,
-204,247, 39, 39,219,202,234,172,240,139,138,138, 80, 84, 84,196, 89,255, 59, 41, 12,202, 48, 76, 45,165, 74, 41,136,183, 73,128,
- 20, 10,133,230,245,215, 95,175, 17, 11,192,122, 4,188,113,133, 19, 39, 86, 98,117, 89, 86, 64, 8,247, 57, 59, 66, 8,204,229,
-229, 16,181, 14,129, 32,160, 25,250,188, 56, 9, 31,142, 29,131,119,217,101,123, 3, 7,193, 82, 89, 5, 81,171,118,232, 55, 84,
-138,174,157,186,225,211, 11,105,232,219,183,175,236,248,241,227,181, 72, 64,156, 66, 1,128,168, 1, 96, 78, 92,156, 99,233,160,
-217, 69,217, 11,133, 2,128,222, 93,168, 88, 87,129,215,173, 91, 71, 0, 80,187,139,159,100,100,100,184,117,241,167,165,165,105,
-184, 40,255,196,196, 68, 66, 8, 89,218,178,101,203, 62, 67,135, 14,237,126,241,226, 69,156, 60,121, 18, 22,139, 5,129,129,129,
- 48, 24, 12, 69, 33, 33, 33, 87,189, 49,250,148, 74, 37,211,174, 93,187,253,207, 61,247, 92,187, 99, 71, 50,176, 86,181, 31, 45,
-136, 24, 61,219, 85,227,242,157, 64,140,232,105,186, 2,192,117, 30,203, 82, 95,155, 56,103,156, 34,132, 56, 31,186,230,125,225,
-209,196, 16,114,120,233,141, 0,140, 78,131, 10,205, 79,241,122,126,184,134,114,175, 67,241,113,206, 24, 88,166,213,201, 76, 1,
- 18,117, 41, 99, 69, 97, 85, 5, 96, 50,193, 98, 95,215,116,161,162, 4, 5,134, 50, 80, 74, 97,207, 47,160,225, 82,188,216,169,
- 4,235,127,188,219, 39, 47,230, 0,189,186,155, 33,128,190, 65,202,223,165,179,123,170,131, 58,189, 0, 42,213, 28, 53,144, 9,
-173, 86,107,204,203,203, 19,174, 26, 3, 38,126,255, 72, 44,232,123,212, 97,133,113, 37, 21,238,188, 46,174,199,172, 18,226,106,
-205, 97, 25,193, 96,251, 74, 14,119,203,253,182,108,217, 98,203, 4, 40,151, 83, 46, 57, 31,226, 38,126, 41, 83,238,152,171, 78,
-219, 66, 17, 21,114, 14,195, 99,250,224,200,254,115, 56,166, 91, 14, 2, 2,197,196, 47,100,137, 59,230,114, 42, 95, 72, 72, 50,
- 8, 33,120,225,133, 23,240,213, 87,101, 96, 85,140,237, 47,101, 9, 1,173,105,217,223,169, 83, 94,244, 40,153, 44,229,160, 90,
- 61,106, 20, 96, 44,236,140,235, 37,126,176,218,103, 91, 59,232,219,225,237,216,114,236, 63,214, 19,205, 59,245,148,177, 89, 2,
-235, 3,171,248,243,243,243, 1, 0,133,133,133, 14,207,192,173, 91,183, 28, 3,171,143, 32, 78,110,103,215,151,146,112,201, 7,
-224,140,175,190,250, 74,182,118,237, 90, 53, 75, 0,214,172, 89,227,181,245,239,170, 48,124,133, 68, 34, 65,225,181,171,232,214,
-189, 7,172,230,106, 16,179, 5,194,230, 45,208,124,208, 96, 52, 27,248, 4,172,122, 51, 44,134,106, 80,179, 5,176, 88, 17,191,
-238,223,152,242,242, 20, 72, 36, 18,183,242,204, 63, 6,115,250,191,238,238,139, 88,225,254,222,168,168, 40,153,157, 0, 80, 74,
- 41,134, 15, 31, 46, 75, 77, 77,173,117,159, 39,229,111,175, 43, 43,128, 61, 61,123,246, 28,248,217,103,159, 25,111,223,190, 93,
- 53,102,204,152,231, 50, 51, 51,255,102, 48, 24,138, 91,183,110,173,248,244,211, 79,181, 92,235, 79,169, 84,138, 0, 60, 50, 52,
- 50,178, 77,220,172, 56, 92,201,191,162,157, 62, 43,238,201,244,253, 27, 19,110,150,107,135, 13,142, 30, 99,109,215, 41,252,127,
- 92,173,252,250, 82, 11,219,251, 24,113,226,159,196,141, 14,112,253,206,227, 65, 37, 0,245, 89, 23,190, 40,127, 86,217,212,145,
- 48,134, 19, 9, 88,121,242,144, 6, 0,153, 58, 40,138,194, 95, 2, 29, 53,195,104, 54,195, 74,173,104, 21, 20,132,124,125, 41,
-188, 73, 46,228,110,121,223,221, 24, 0,239,214, 98,187,115,241, 55, 52, 93,175, 61,143,192,196,193,131, 7,239,136,143,143, 23,
-135,132,132, 88,111,222,188,137, 5,125,111,186, 42,127,206,255,163,174,132, 61, 62,193,158,229,207, 77,146,167, 90,247,112, 69,
-226,142, 57, 26, 0,100, 66,191,101,210, 93,103,254,174, 78,219, 2, 16, 16, 76,236,255,129,108,199,233, 15, 52, 92,149, 63,219,
-151,138,139, 71, 83,160,140,181,126,225, 78,239,108, 72, 56,192,246, 7, 82,223,230, 26,118,171,158, 20,235,250, 74, 45,229,229,
-106, 34, 0, 12, 85,254, 32,229,102, 8, 25, 33, 12,140, 68, 54,118,242,107,152, 27, 27,231,177, 61,146,146,146, 72, 82, 82, 18,
-189,135,239, 31, 40,165,132, 16, 66,157, 35,218,157, 61, 1,222,200, 82, 40, 20,154,216,216, 88, 44, 88,176,192, 65, 40,154, 42,
- 21,238,168, 81,163, 48,119,203,122,124, 88, 94,130, 1,209, 35,192,180, 11,182,149,201, 68,109,169,123, 33, 2, 17, 8, 65,196,
- 2,124,149,184, 26, 45, 70, 15, 70,247,238,221,189,142,218,111, 8,156,172,123,117,100,100,164, 44, 53, 53,181, 65,117,149,147,
-147, 19,115,224,192,129,107, 2,129, 96,251,147, 79, 62,249,143, 57,115,230,220, 94,183,110, 93, 10, 96,155,114,240, 66, 20, 3,
- 32,249,228,201,147, 67,190,219,176,145, 17, 11,252,174, 79,122,105, 82,255,185,115,231,234,190,252,242,203, 9, 0,130,236,138,
-191,156,221, 32,136,139, 71,129,199,131, 1, 46,238,127, 95, 9, 64,131, 9,131, 7,229,195,121, 64,250,241,100, 26,145, 79,146,
- 75,173,151,178,213,250,106, 35,204, 22, 11,186, 15, 25,132,112,115,164,183, 10,183,209,130, 81,216,164, 63, 0,212,172, 53,110,
-143, 3,104, 80, 14,124,149, 74,181, 83,169, 84, 10,147,147,147, 23,173, 90,181,234,159, 78,228, 98,148,243,255,226,234, 81, 0,
-208,104,201, 75, 38, 95, 96,227, 44,234,126,190,201, 23,228, 62, 49,253, 93,103,254,174, 97,219,135,130, 98,199,233, 15,124, 42,
-163, 77,185, 19,188,186,104,212, 93,179,151,220,189,182,232, 35,239,243,145,199,191,125, 86, 19, 15,144,117, 95, 45,149, 86, 26,
-108,251, 0,220,205,255, 31,231,245, 59, 98,183,200, 44, 10,133,162,209,231, 85, 89, 18,208, 24,178,236,177, 0,106,246,123, 35,
-148,205,167,223,117,239,222, 29,237,231,205,147,173,221,183, 79,157,251,143,159, 33, 23,181, 66, 75,251,230, 61,149, 6, 51,230,
-191,181, 4,130,128, 16,236,222,168,196,233,214, 4, 99,135, 13,243, 57,111,191,197, 98,246,121,152,224,234,226,231, 64,190,200,
-243,207, 63,127,155, 82,154,208,171, 87,175,255, 43, 46, 46,214,251,160,248,157,235,125,100, 70, 70, 6,172,102,130, 97,195,251,
-127, 48,119,238, 92, 29, 0,204,153, 51,199, 10, 64,215,144, 38,117,242, 56,213,248,238,198, 43,202,227, 33,243, 0,220, 19, 82,
-224,179, 98, 76,170,145, 96, 7, 25, 57,151,154,188, 82, 93,146,254,176,231, 26, 44, 87,161, 80, 88, 0,252,203,254,241, 89,174,
-187,242, 53,240,121, 73, 99,220,115, 47, 97, 83,240, 20,139, 62, 74,110,116,217,158, 82,253,122,209,190,166,123, 89, 7,141,181,
-233,138, 66,161,208, 40, 20,138, 70,145, 69, 26, 48, 7,192,150, 65,169, 84,194,190,125, 47,242,156,182,239, 77, 61,176,223,177,
-125,239,232,161,163, 97, 39,189,117,254, 63,193, 20, 29,177,108, 14,174,173,152, 56,238, 38,232,137, 4, 52, 70,125, 61,241,196,
- 19,213,102,179, 57, 5,128,254,253,247,223,111,144, 18,141,139,139, 35,239,191,255, 62, 53, 26,141, 0,176,175,174,251, 86,174,
- 92, 73, 22, 47, 94,236,248, 95,246, 84,192,245,142,237,174,193,157, 60,238, 47,184,122,184,136,175,251, 8,243,224,193,131, 7,
-143, 38,129, 25, 64, 21, 0, 73, 35, 27,113,158,118, 12,228,188,163, 32,143,135, 3,124, 99,242,224,193,131,199,195, 5, 33,128,
-102, 28,148,191, 1,182, 0,238,198,210, 7, 86,240,203,254,254,112, 29,137, 7, 15, 30, 60,120,252,241, 16,192,235, 11, 30,188,
- 7,128, 7, 15, 30, 60,120,240,224,193, 19, 0, 30, 60,120,240,224,193,227,207,142, 26, 46,157, 83,167, 78,249, 28,145,235, 46,
-152,240, 65,151, 23, 54,200, 15,254,126,133, 16,137, 75, 96,181,218,150,133, 9, 4, 12, 24, 34,176,253,101, 8, 8, 97, 64,137,
- 16,132, 16, 48, 48, 99,199, 46, 17, 40,165, 8, 97, 90,193,155,242,217, 51, 42,182,134, 45,128,167, 28,182, 4, 3, 38,118,201,
-215,195, 88,127,188, 60, 94, 30, 47,143,151,199,203,123, 48,229,241, 30, 0, 15, 56,116,228, 50,116,165, 58,152, 76, 20,183,239,
- 16,236, 77,246,199,190,253,129, 96,136, 8,251,213,237,177,239, 96, 7,236, 83,119,192,225,227,109, 32,132, 16, 12, 36, 24, 17,
-197,192, 79,236,199,249,127, 76,125,117, 58,157,250,234,116,122, 36, 85, 93,101, 98, 72,234,185,179,153,135,212, 71,143,232,147,
-147,147,171, 0, 52,231, 57,232,195,143, 49, 79,141,144,206,153, 51,157,122,187,201,211,195, 10,165, 82, 41,165,118,212,183,187,
- 30, 87, 80, 23,240, 61,138, 7,143, 38,240, 0,176, 24, 54,124, 8,231,151,240,104,106,134, 71,214,210,216,242, 26, 19, 25,153,
- 34,140, 27, 99,193,233,223,253, 33, 22, 9, 33, 20, 8, 33, 18, 81,248, 9, 76,128,176, 57,132,168,196,144, 62,102, 72,196,126,
-160, 0, 58,180, 3,158, 29,111,197,129,237,220,148,255,229, 11, 89,120,244,177,238,232, 24,218, 18,249,215, 46,118, 9,106,223,
- 13,173, 59, 90,240,235, 47,191, 32, 57, 57,185, 4, 77,188, 35,150, 92, 46, 31,175, 82,169,118, 57, 29, 63,227,124,204,163,110,
-204,157, 35,167,230,170,115,178, 33, 17,193,106,171,181, 24,165, 29, 43,213,157,218,143, 70, 69,117, 7,124,181,254, 63,127,216,
-157,206, 98, 99, 99,213, 11, 22, 44, 0, 33, 4,107,214,172, 81, 55, 70, 78, 0, 54, 29, 0,175,255,239, 63,188, 34, 93,148,130,
- 48, 76,125,237, 77,157,219,147,109,211,187,201,183,106,182,179,243,206,136, 60, 26, 23,108, 54, 64, 39, 47, 1, 55, 2,208, 84,
- 96,238,179, 46, 28, 63,214, 4, 10, 1,132, 2, 17,134, 69, 18,180,109,195, 64, 40,100,224, 39, 18,160, 87, 56,131,107,215,205,
- 24, 18,193,160, 85,136, 4,191, 30,108, 1, 0, 16,208, 74, 80,106,133,167, 20,193, 83, 95,157, 78,127,207,204, 68,215,142,157,
-240,123,218, 49,164, 27, 77,208,221,209, 65,236,215, 28,189, 7, 14, 71,255,225, 99,161,222,161,130,156, 99,110,252,123,160,248,
- 71,169, 84,170, 3, 97, 97, 97,200,204,204,100, 59, 76, 9,128,121, 42,149,106,167, 92, 46,143, 81,169, 84, 7,254,104, 47,197,
-236, 56, 57,245, 19,106, 33,100,140,168,170,178,160, 84,239,143,239,127, 56,224, 85,253,143, 30, 51, 92,218,194, 95,139, 81,195,
-197,232,218,229, 89,117,139, 22, 65, 48,153,205,184,125,251, 14,218,229, 93, 71,118, 78, 46, 94,125,101, 60,221,248,221,110,159,
-218, 53,194,190,167, 2,192,125,155,236,251,105,253, 3,119,183,195, 93,179,102, 13,148, 74,165,180,169,210, 1,223,199,247,133,
-110,221,186,181,246,126, 10, 77,164,188,148,202, 68, 41, 1, 65,108, 35,212, 59,205,251, 9, 36,253, 53,103, 29,111,207,146,233,
-216,247,202,129,215, 18,245, 30,137,220,175,191,254,234, 56, 30, 55,110, 28,246,236,217, 83,239, 49,143,123,175,252,157,207, 57,
- 19,129,112,212,249,165, 0, 0, 32, 0, 73, 68, 65, 84,122, 9, 64,234,145,116, 12, 31, 17,121,223, 10,109,245, 46, 59,164,243,
-205, 62,189,132,140, 80, 0,157, 86,136,246,109, 69,104,223, 86,140,138, 10, 17, 36, 34, 33, 44, 66, 63, 12,234, 71, 48,224,113,
- 1, 24, 34, 2, 33, 4,126, 34, 49, 68, 76, 53,136, 68, 12,179, 1, 48, 67, 95,175,242, 63,114,240, 0,186,117,104,131,179,167,
-207, 34,175,232,230,221,242,149, 87, 64,114,238, 56,101, 4, 4,131, 34, 6,225,215, 61,222,233,216,117,235,214, 73, 51, 51, 51,
-213,151, 47, 95,134,191,191, 63,252,253,253,101,219,182,109,211,120, 57,152,201, 84, 42,213, 1, 86,241, 59,117,142,150, 0,198,
-126,253,245,215,119, 94,123,237,181,100,185, 92, 62, 70,165, 82, 37, 63,136, 29, 60, 50, 50, 82,154,158,158,206,249,185,165,163,
-134, 73,251,134, 55, 87,119,234, 80,132,160, 22,126, 96,152, 0, 84, 86,154, 81,172,173,196,203,242,222, 84,210, 98, 16,190,253,
-230, 7, 78,253, 72,132, 66,188,240,204,227,234, 62,125,122,227,102,161, 14, 39,126, 59,137,138, 10, 61,130,130,154, 35, 44,172,
- 11, 24,129, 8, 22, 75, 30,226,102, 79,167,137,235,190,255, 67, 89, 55,177,177,177,234,133, 11, 23, 58,142, 23, 44, 88,208,104,
- 94,128, 7,217, 3,160, 82,169,136, 92, 46,167, 73, 73, 73,112,183,177,210,253, 54,218, 21,138, 56, 16, 66,176,126,189, 82, 22,
- 27,219, 48, 18,192,116,121,209,161,188, 51, 86, 52,115, 59,152,182,111,201, 32, 52,132,121,104,219,239,207, 10,103,101,239,142,
- 20,120,244, 0,164, 30, 73, 7,128, 6, 19,129, 35,243,178,235,189, 62,226,211, 30, 62, 15, 22, 78, 57,206,189, 26,132,146, 53,
-109, 33, 18,138,208,185, 99, 5,202,203, 69, 56,113,182, 51, 4, 2, 1, 4, 68, 0,177,200,140, 62, 61, 12,232,217, 67, 0, 2,
- 6, 98,145, 31,196, 2,130,136,199,141, 8, 9,182, 98,211,255,213, 47,187,119,183,118,184,150, 83, 84, 83,249,219,145,119,227,
- 26, 33,140,144,118,136,122, 28,193, 45,155,163, 68,119,135, 83,121,215,174, 93, 43, 93,185,114,165,250,218,181,107,206,167,213,
-227,199,143,199,238,221,220,173, 77,149, 74,117,208, 89,249,187, 65,235,132,132,132,146, 55,223,124,115, 63,154,120,138,162, 30,
-229,175,246,166,108,225, 97, 33,234,208,118,101,104,221, 42, 16,157, 66,219, 35, 32, 48, 0,215,174, 21,192, 98,177, 34,180, 99,
-115,156,187,144,134,168, 17, 67,164,105, 71, 50,234, 29, 76,223,120, 99, 58,125, 60, 92,135, 71, 30,233,132,243, 23,174,225,196,
-137, 11,184,125,167, 28,148, 2,193,193,254, 48, 24, 42, 48,112, 96, 31,148,148,148,162,224,196,111, 24,254,100,164, 52,245, 48,
-119,162,242, 32,131,181,254,237,219, 78,131,245, 4,172, 93,187,214,107, 47, 0, 59,221,239,154, 9,216,205,118,178, 13,238,127,
-157, 58,117,162,157, 59,119,110,112, 46,126,149, 74, 69, 38, 79,158, 76,183,108,217, 2,118, 99,165,250, 20,158,125, 43,220, 90,
-229,143,138,138,146,178,155, 3,213, 65, 98,169, 7,153,142,255,173, 80,196,169, 27,242,142,186,202, 27,178,164, 2,199, 87, 52,
-171,161,248,121, 60,156,214,191,171,203,191, 65, 83, 0, 13, 37, 2, 35, 62,237, 81, 39, 9,240, 69,249,179, 72, 73, 73, 65, 65,
- 65, 1, 0, 32, 52, 52,148,122,243, 50, 8,104, 37,132,196, 2,177, 72,132,223,206,182,129, 64, 40, 68,115,145,222, 22, 7,208,
-140, 65, 65, 65,115, 60,222,199, 10, 66, 8,228,207,154, 65,173, 12, 64,252, 64, 64, 97, 11,228,119, 15, 67,201,117, 20,106, 43,
-144, 85, 80, 80,103, 89, 74, 74,181,208,221, 46,180,203,226, 60, 0,185, 42,127, 0,192,238,221,187,241,212, 83, 79, 73,247,238,
-221,235,113,128,147,203,229,163,114,115,115,221,118,152,210,210, 82,231,211, 45,151, 45, 91,134,243,231,207,143,126,144,166, 2,
-156,148, 63,103, 72, 71, 13,147, 74,132, 55,225,239,223, 18, 18, 63, 49,186,117,235,138,206, 93,187,162,172, 76, 3,173,182, 2,
- 98,177, 0, 33,193, 18, 8,253, 91,122, 28, 76,133,180, 0,205,155,181,130,161,210,140,179,103,179,113,163,176, 20, 55, 11, 43,
- 80, 89, 45,193, 35,161,102, 72,252, 4,200,206,202,197,163,221,187,227,198,205, 50, 84,154, 91,112, 26,160,157,221,254,117,157,
-247,118, 58,160, 46,153,190,200, 98,173,255, 5, 11, 22,212, 58,191,112,225, 66,159,188, 0,238,118, 39,116,157, 59,110, 44,175,
- 66, 90, 90,154,186,161, 27,242, 76,158, 60,153,170, 84, 42,200,229,114,184,155, 14,224,226,169, 98,149, 63, 0,100,100,100,212,
- 42,147,253,186, 71,163,135,221, 97,176,177, 60, 46, 91, 22, 6, 98,242, 26,189, 91,197, 31, 26,194,216, 71, 41,110,205, 59,110,
-220,184, 26, 94,146,167,159,126,186, 70, 93,241,110,255, 7, 7, 94,199, 0, 52,150, 71,160, 49,145,157,109, 35, 22, 5, 5, 5,
- 94,145, 0,161, 80, 8,145, 64, 4,145,136, 96,228,112,192,160,175,198,149, 28, 49, 68, 66, 17,132, 22, 33,134, 70, 82,136, 69,
- 34, 8, 4, 12, 64, 9,180, 58,224,248, 73, 33,172, 86, 43,128,219,117,202, 61,249, 91, 14, 42, 42,234,206,192,217,173,125,123,
-170, 55, 19, 84, 86,150,194, 98, 53,115,126,206,147, 39, 79,214, 77, 58, 12, 6, 78,138,198,213,245,239,142, 25,238,216,177,195,
-249,254,228,166,240, 2,184,115,241, 59, 43,127,251, 0,200,205, 2, 12,109,167,102,152,235, 48, 91,172, 48,154,204,184,125, 71,
- 11,145, 88,130,234,106, 19, 76,102, 11,204,102, 43,204, 22,202,201, 19, 35, 22,233, 33,241,239,132,226,226, 82,148,149, 27,160,
-213, 85,162, 69,171,254, 24,246,248,227,200, 72,221,131,142, 70, 51, 74,203, 74,209,179,103,119,248,137,133,208,151,107,255, 16,
- 3,133, 61,242,223, 49,247,239,226,153,242, 41, 22, 96,193,130, 5, 53,188, 9,174,215,184, 18, 0,173, 54,198,113, 99, 92, 92,
- 8,182,108,217, 82,163,191,178, 6, 66, 94, 94,158,207,187,114,202,229,114,186,101,203, 22,199, 54,227,117,197, 4,184, 42, 87,
- 87, 79, 85, 90, 90,154,154, 13,124,163,148,210, 99,199,142,213,184,126,236,216, 49,181, 39,167, 7, 75, 26, 88, 18,224,108,197,
-215,101,232,123,120, 54, 76,138, 74,198,102, 0, 83,214,232,241,196,146,138, 6,145, 47,215, 57,126, 79, 49, 1, 60,238,189, 55,
-160, 46, 15,192,125,245,239,184,179,244, 27, 98,253,187, 88,172,200,206,206,102, 7, 20, 78,189, 87, 32, 16, 98,232, 16, 43, 4,
-140, 16,199, 51, 37,184,148, 45,193,132,167,128,103,158, 6, 38,142, 35,232,208, 78, 12,137,216, 15, 18,177, 31,252, 37,126, 8,
-237,224, 7,137, 88, 2,137,135,101,128,249,121,215, 73,137,246, 22,169,107, 32,233,222,173, 11,130, 90, 6, 66, 98, 53,162,194,
- 96,186,239,157,226,200,145, 35, 7,142, 28, 57, 82, 67,225, 59,127, 0,160,184,184, 24, 19, 39, 78,108, 50, 43,223,110, 29, 73,
- 93,207,217,191,123,101,201, 89, 44,128,222, 96,130, 94,111, 68, 89, 89, 53,110,221,210,225,198,141, 59, 40, 47,175, 70, 69,133,
- 9, 21, 21, 70,232,245, 38,148,150,148,122,148, 85, 93,109, 70, 85,149, 5, 38,147, 17,205,155,139,209, 57,180, 5, 2, 2, 3,
- 1, 0, 97,221,187,162, 83,199, 22, 8,106, 33, 1,165, 22,152,204, 86, 84, 87,235,255, 16, 3, 73,108,108,172,122,209,162, 69,
-245, 42,243,216,216, 88,206, 22,169,125, 75,225, 58,175,175, 89,179, 6, 95,125,245,149,215, 91, 13, 59,109, 59,235,248,176, 10,
-181,160,160,128,221, 61,211, 43,237, 54,121,242,100,154,148,148, 4,103,242,160, 82,169,200,164, 73,147,234,253,221,236,217,179,
- 65, 8, 1,219,143, 35, 35, 35,165, 0, 48,116,232, 80, 25,171,200, 89,171,159,189, 78, 41,117, 92,231,240,180, 53,172,120,119,
-196,129,203, 12, 74,235,214,173, 65,156, 88, 66, 67,229,241,120,240,148,191,187, 99,159, 60, 0, 15,146,229,127,119,128,183, 64,
- 32, 16,120,253,187,225, 67,172,104,219,198, 15,101,101, 66,248, 9,205,240, 19, 11,160, 73, 23, 99,130, 76, 4,177, 72,132,178,
- 50, 17, 82, 51, 3,209, 66, 66,192, 48, 12,198,197, 24,241,220, 4, 10,134,161, 88,126,202,251,114,202,229,114, 42, 8,144, 64,
- 43,106,141, 0, 83, 62, 46, 23, 80,140,146,142,228,188,165,239,192,129, 3,113,244,232, 81,183,215, 2, 2, 2, 56, 15,150, 58,
-157,110, 52, 0,108,216,176, 1, 51,102,204,112,156, 47, 46, 46,118,124,159, 49, 99, 6,138,138,138,154,164, 61,211,211,211, 53,
-132, 16,176,243,164, 12,195,128,117,119,214, 51,111, 90, 39,242,174,223,144,181,105, 97, 80,251,137, 5, 48,154,172,168,170,206,
-199,245,252, 98,104,117,101,208,106, 13, 40,214, 86,162, 88, 91,137,150, 33, 93, 1,228,212, 43,235,214, 29,138,194, 91,119,208,
-187,119,119,148,232,116, 16, 9, 25,148,149,231, 67, 95, 98,197, 99,143,234,209,174, 77, 27, 4, 4, 4,192,207,207, 31, 55, 11,
-203, 65, 4,193,156,202,232,236,146,111,172, 85, 0,141,189,130,160, 46,107, 29,184, 27, 11,192, 21, 10,133, 66, 19, 27, 27,139,
-249,243,231,215,242, 42,176,211, 12,190,174, 44,152, 60,121,114, 13, 11,150,125,191, 8, 33,120,241,197, 23,145,148,148, 68,184,
-146, 0, 87,203,223,249,154,171,167,193, 21,235,214,173, 35, 0, 28, 86,126, 70, 70,134,218,222,175, 53,118,111, 0,251, 87, 13,
-128,164,167,167, 59,174,215,183,157,107, 90, 90,154,122,248,240, 97,178,163, 71,109,239,196,236,217,179,113,234,212,111, 50, 86,
-133, 31, 59,118, 76,205, 62,255,208,161, 67, 61,122,202,214,173, 91,135, 47,100,193,152,178,214, 96,123,174,133,129, 53,174, 79,
- 89,107,112,212,231, 76,153, 8,223, 28, 52,130,199, 67, 64,218,227, 87,214, 36,221,171, 22,227,212,169, 83,220, 87, 1,220, 11,
-197,239, 28, 11,208, 16,235,191,166, 37, 95, 83,249,219,221, 76, 30,167, 2, 90,183, 22,128, 33, 2,180,105, 45, 64,143,238, 20,
- 55,110, 8,193, 8, 8, 68, 66, 33, 68, 66, 17,126, 63, 19,136,144, 64, 17, 4, 2, 1,134, 71, 90,224,239,239, 7,171,149, 2,
-212,226,147,242,111,214,174, 51,110, 85, 80,232, 47,107, 32, 36, 2, 92,190,145, 71, 46,115, 84,254,246,129, 77,118,253,250,117,
-245,245,235,215,221, 61,175,134, 99, 57,198, 20, 23, 23,239,103,149, 60, 0, 76,156, 56, 17, 27, 54,108,112,220, 83, 86, 86,134,
-162,162, 34,236,220,185,147, 93, 46,120,223, 59,175,125,224, 82,103,100,100,168,217, 96, 49,251, 57,175,149, 66,234,225,116,141,
- 76, 26, 1, 90, 80, 6, 67,165, 9, 58,191, 42, 80,232, 80, 85,101, 70, 89, 89, 53,138,238, 24,112,227,102, 5,158,148,117, 1,
-144, 90,175,172, 74, 99,107,228, 94,185,141,176,110,143,160, 91,183, 78, 40, 46,190,131,224,150, 22,244,232, 17,132,182,109,194,
- 32,241,247, 71, 73, 73, 5, 78,156,188,136,252,130, 50,180,239,212,231,161, 29, 64, 18,149, 74, 74, 8,100,172, 46,117, 86,170,
-245,173,219, 79, 84, 42,165,137,235,214,113,242, 2,172, 93,187, 86,237, 74, 0, 86,175, 94,141,245,235,215,203, 60,201, 75, 76,
- 76,164,113,113,113, 68,161, 8,118, 42, 19,117,167,152, 41, 0, 76,154, 52,137,147,251,223,121, 74,161, 85,171, 36,248, 58,109,
-192, 90,249,118, 2, 64, 41,165, 24, 62,124,184, 44, 53, 53,181,206,235,158, 20, 54, 59,183,158,154,122, 84, 77, 8, 1, 33, 4,
- 3, 6,244,151,173, 91,183, 78, 83,251,222,187, 36,195,147, 60,102,178, 14,172, 60,249,168,174, 53,248,209,228, 53,231, 29,242,
-184,128,143, 1,120,120,224,145, 0, 60,136, 22, 63,139,169, 83,167, 54,232,247, 12,195, 64, 32,176,125,122,135, 51, 24,216,207,
- 2, 63,177,196, 70, 0, 68, 34, 12,139, 4,252,252, 0,145,192, 15,173, 91, 75, 32, 16,232, 97,177, 88, 97,181,122,239,182, 55,
-104, 11, 33,233,212, 11, 87,146,255,131, 54, 66, 6, 71,242,174,121, 61,160, 44, 88,176, 64,179,110,221, 58, 89, 67,150, 1,178,
-203,250,222,120,227, 13,199, 57,214,210, 47, 43, 43,131,193, 96,192,204,153, 51, 1, 0, 95,126,249, 37, 0,168,155,162,109,211,
-210,210, 52,118,107, 95, 13, 0, 67,134, 12,105, 80, 0, 87,167, 46, 61,145,121,108, 47,218,182, 14, 64, 64,128,173,219, 87, 87,
- 91, 80, 86,110,132, 86, 87,137,206,221,250,224,251,141,155, 60,182,201, 47,191,236, 35, 47, 62, 63,148, 30,203, 56,135, 39,135,
-247, 71,151, 46, 93, 96, 50, 86, 97,224,128,199, 17, 24, 20,132,107,185,121, 40,184, 81,130,212,180, 11,208,149, 7, 97,207,134,
- 77, 15,173,207,116,118,156,194,222,254, 4,179, 21, 10,199,178,112,171,139,210,103, 24, 2, 80,135,202,160,179, 21, 10,244,119,
- 99,193, 18, 2, 10, 39, 90, 30, 23, 23, 7, 87, 47,192,252,249,243, 65, 8, 65, 92,156, 66,109,215,231,152, 29,167, 64,255,254,
-181,229,197,197,197, 57,220,241,158,148, 28, 87,229,239,138, 73,147, 38, 97,244,232,209, 50, 95, 73,176,243, 92,125,100,100,164,
- 44, 53, 53, 85, 83,215,117, 46, 65,138,246, 85, 5,148, 37, 95, 81, 81, 81, 50,133, 34, 78,227, 74, 58,156,228,195, 27,121, 91,
- 22, 54,179, 29, 74,218,221,245,116, 44,204,115, 16,130,189,167,235, 31,251,220,229, 1,224, 99, 0, 30, 82, 2, 48,108,248,144,
-123, 50,231,211, 88,150,191,115, 71,242, 5, 90, 29, 65,135,118, 12, 8, 97, 64, 24, 6,251, 14,216,230,247,253,252, 36,240, 19,
-251, 97,226,211, 4, 18, 63, 49,252, 37, 4,218, 98, 1, 50, 78, 52,135,197,106, 65,231, 78,222,205,235,202,229,114,122, 35,255,
- 10,116,153,187,209,163,179, 8,103, 11,124,159, 23,158, 61,123,182, 6, 13, 12,202,147,203,229,178,207, 63,255, 92,205,186,249,
-139,139,139,167, 68, 70, 70, 86,236,223,191,127,215,115,207, 61, 55,182,184,184,152, 76,159, 62,125,175, 61, 95, 64,147,117,206,
-244,244,116, 77,100,100,164,140,253,222, 16, 89,223,111,220, 68,166,191,250, 50,205,186,120, 30, 55,114,175,129, 97, 8, 44, 22,
- 10,137,127, 8,194,123,247,197,158, 95,147, 57,215,233,141,219, 86,153,182,248,134,186,170,202,140,126,125,195, 16,218,177, 53,
-242,174,223,130,238, 76, 14, 46,101,229,225,192,193,223,113,173,128,226,120,230, 89,159,218,233, 65, 73,254, 99,221, 28,236,243,
-125, 3, 63,230, 40, 47,231,255,176,118,237, 90, 7, 1, 88,187,118, 45,144,187,161,214,189,238,228,113, 5,165,148, 52,164, 31,
-199,197,197, 53,168,239, 57, 41,121,141, 47,215,221,121, 21,156,127,235, 78,158, 87,237,124,109, 43,146,214,190, 98, 27, 27, 70,
- 61, 82, 67,249, 3,128,124,252, 19,182, 47,186, 83, 30, 9, 0,159, 7,224,193,193,250, 85,139,107, 77, 3,120, 69, 0, 30,240,
-128,143, 6, 23, 46,243,164, 31, 36, 98, 49, 38,142, 39, 96, 8,193,144,193,102,156, 57,235, 15,134,216,230,252, 75, 74, 24,116,
-108, 47, 0, 67,196, 56,125, 70, 12,137, 31, 96, 52, 25,113, 45,207,223, 43,229,159,147,245, 27, 34, 71, 63, 3, 97,235, 72,228,
-100,101, 64, 88,152,132,160, 22, 33,180,180, 76,219, 36, 21,172, 82,169, 52,114,185, 92, 54,120,240, 96,117,124,124, 60,250,246,
-237, 91,164,211,233, 48,120,240, 96,153, 78,167,195,188,121,243,212,118,229,175,105,234, 70,110,168,226,119, 37, 1, 0, 16, 53,
- 98,136,180, 67,251, 14,234,192,192, 64,124,191,113, 19, 57,123, 46,199,187, 1, 61, 53, 67, 3,128, 88,208,154,158,191,148,142,
- 14,237,154, 65, 34, 17,161,162,194,136,130,155,101, 32,194,206, 56,158,153,202, 71, 75,113,193,201, 55,129,238,255,139, 26,203,
- 11, 79, 44,106,210, 34,197,197,133, 56,165,173,109, 28,133,230, 73, 41,123,163,180, 27,154,207,192,221, 56, 47,143,242,179, 61,
-107,229, 77,219,135,199, 67,139, 1, 3, 6, 56, 2,254,214,175, 90, 92,235,154, 71, 2,208,216,249,248,239,119,126,127,239, 88,
- 4,129, 78, 71, 16,208,158,160, 85, 8,193,224, 65, 38, 72,196, 2,248,137, 77,104, 21, 34,177, 15, 2, 4, 67, 7, 91,144,113,
- 82,100,243, 22,112, 36, 70,114,185,156,246,233,217, 2,111,206,255, 16,149,226, 78,248, 41,185, 0,221,195,135, 0, 0,154, 29,
-223,137,172, 60,208,138,242,166, 35, 1, 0, 72,110,110,174,116,213,170, 85,106,103,239, 0, 0,210,148,150,255,189,134, 61,217,
- 79,131,235,253,208,225,147,100,250,171, 47,211,219,197,183, 81, 89,104,128, 68,210, 10,157,186, 61,206,105, 42,225, 97,135, 45,
- 29,118, 35, 61,102,238, 6, 56, 86, 4,228,110,108,242,103,243, 20,220,247, 71,195,216,103,166, 52,170,229,206,199, 0, 60, 88,
- 36,160, 46,229,239,209, 3,240,103, 0,133, 45,170,159, 48, 20, 20, 20, 33, 45, 41, 82,142, 8, 33, 17,139,224, 39, 22,226,217,
-241, 20,148, 90, 17,220,202, 12,179,133,192,106,181,216, 7, 63,207,120,188,107, 5, 38,188, 40, 71,133,176, 7,218, 54, 11,196,
-203, 47,132, 96,211,182, 51, 14, 18, 96,178,252,132, 51, 23,155,118,157, 56, 75, 4,156,142,249,183,199, 7,175,194, 31, 17,100,
-178,142,208, 45,193,181, 53,131, 42,196, 39,121,235,117, 43, 17, 27,188,184,246,133, 19,139,154,220,234,255, 51, 99,255,239,166,
-198,236,195,196, 70, 16,169, 19, 89,228,167, 5,154,138, 4,120,108, 44, 95,247, 17,230,193,131, 7, 15, 30, 60,120, 60,188,224,
- 19, 61,243,224,193,131, 7, 15, 30, 60, 1,224,193,131, 7, 15, 30, 60,120,240, 4,128, 7, 15, 30, 60,120,240,224,193, 19, 0,
- 30, 60,120,240,224,193,131,199, 31, 3, 53, 86, 1,156, 58,117,202,231,104, 80,119,193,132,141, 45,111,218,204, 56,143,191,211,
-107, 11, 29,223, 3, 67,218, 59,190,255,240,109, 98,173,123,219,200, 94,243, 40,111,255,154,187, 25,243,198, 44,252,220,241,253,
-182,250,107,248, 82,190,186,224,107,249,234,130,187,242, 61, 63, 93,225,241,119,153,234, 93,232,218,181, 43,174, 94,189,138,193,
-178, 9,142,243, 63,127,175,188,231,245,231,169,191, 36,132,134, 74,223, 44, 40,112,206, 76, 72,238,103,255,115,149, 55, 97,194,
- 4,233,238,221,187,107,100, 74, 28, 63,126,188,108,215,174, 93,154,166,120, 63, 30,100,121, 13,145,245, 71,174,191,232,232,232,
-151,250,245,235,183,233,204,153, 51, 47,166,164,164,252,212, 8,229,163, 15,202,251,193,203,107, 90,121, 94, 19, 0, 87,124,241,
-197, 23,210,170,170, 42, 16,129, 8,132, 16, 88,204, 38,136, 69, 66,204,155, 55, 79,211, 80,230,241,197, 23, 95, 72, 1, 96,238,
-220,185, 13,146,165,215, 22, 34, 48,164,189, 67,241,183,239,220, 21, 0, 80,120,253,170, 79,242,246,175,121, 3, 99, 22,126,238,
- 80, 92, 95,108,207,248,127,246,174, 60,188,137,170,123,191,147,164, 89,186,175,148,125, 43, 84, 86, 41, 20, 17, 89, 19,217,132,
- 2,202, 82,180, 84, 63, 17,161, 1, 17,101, 83,164,159,191, 15, 63, 23, 4, 69,138,178, 6, 68,224,131,178, 21, 68, 89, 10,133,
- 66, 74,217,180, 82,160,236,148, 82, 74, 55,160,123,218,102, 79,102,126,127, 52, 19,211,144, 54,147, 52,172,206,251, 60,243, 36,
-179,228,100,230,206,189,247, 61,231,220,115,207, 5, 0,204, 24,221,235,185,212, 0,207,201, 15,162,167, 36, 2,231,228, 7,107,
- 72,109,124, 52, 0, 32, 39,231,201,151, 95, 40, 32,206, 4,228,161,128, 36, 19,144,207, 45, 40, 64,218,252, 79, 1, 0,189,150,
-124,247, 68,203, 45, 42, 42,138,218,177, 99, 7, 52, 26, 77,173,227, 66,161, 80, 30, 21, 21,133,237,219,183, 63,173,211, 3,251,
-189,208,166,217,102,202,104, 84,101,230,222, 95, 0,224, 0,107, 7,213,141,159,126,250,233,213, 11, 23, 46,120, 23, 22, 22, 54,
-246,247,247,247, 13, 15, 15, 47,152, 55,111,222, 22,103,229, 13, 28, 56,112,208,196,137, 19, 79,108,219,182,109, 10, 0,159,183,
-222,155, 54, 25, 0,121,249,242,229,127,201,100,178,223,164, 82, 41,233,160, 72, 58,185, 50,229,130,254,202,154, 68, 92, 85,135,
-169, 71, 32,147,133,171, 61, 0,150,248,126,233, 15, 98,159, 22, 93,229, 3,187,118,128,187,192, 13, 20, 69,193,104,164,112,229,
-214, 93,252, 16,247,163, 68, 36,112,195, 7, 31,124,224, 20,121,199,111, 94, 32,238,220, 62, 85,126, 37,179,173,196,217, 27,167,
- 9, 95,228, 19, 0,101,217,125, 51,241,215,231, 17, 96, 98,169,246,138,254, 12, 71,227, 62, 52, 55,164,186,174,171,111,142,165,
-245,127,242,249,252,154, 86, 64, 81, 32,201,154,246,109, 52, 26,205,247,207,225,186, 49,182,162, 1,160, 73,163,154, 84,157,186,
-202, 10,104, 13, 6, 0, 64,181,161, 70, 94,155,161,239,163, 93,231,238,140,136, 31, 0,186,245, 25,132,115,242,131,102,226,175,
-235,186,199, 89,126,116,167,145, 9, 96,152,135, 7,146,148, 74, 57, 77,252, 0,112,243,200,209,250, 58,173,122,241,221,214,111,
-196,233, 37,127,161, 32, 55, 3,237, 91,245,198,198,143,183, 59, 92,135, 35, 34, 34, 94,223,185,115, 39, 77,254, 6, 0, 26, 0,
-238, 0, 72,141, 70,195, 19,137, 68,136,136,136, 16,219,242, 4, 60, 97, 4,191, 20,214,245, 80,210,246,181,158,202,130,235,232,
- 23, 57,125,219,221,114,253,191, 0,252,246,180,117, 76,145,145,145,148,179, 11,240, 88, 17,163, 83, 88,185,114,165, 56, 45, 45,
- 77,190,121,243,223,137,137, 74, 74, 74,144,153,153,137,145, 35, 71,254, 79, 44, 22, 75,230,205,155,199,232,253,202,100, 50,206,
-182,109,219,254, 11,224,149,126,195,222, 16,109,219,182, 45,248,173,247,166,121, 1, 48, 2,104, 98,186,236, 5, 0,156,129, 3,
- 7, 14, 0, 30, 94,234,188, 46, 82,237, 21,253, 25,210,226, 23, 83,117,181, 55, 7,218, 7,149,122, 54, 13, 92, 46, 15, 70,163,
- 1,138,170,106, 76, 28,247, 58, 85, 85, 85,213, 80,194,166, 92,249, 94, 88,216,135,173,101,127, 45, 60, 5,246, 21,128,101,203,
- 87,136,197, 35,198,203, 91, 52,242,129,187,144, 7,146, 36, 97, 36, 1, 30,151,128,191, 79, 7,116,110,223, 82,158,156,116, 80,
-178,122,245,106,177,163, 74,192,138, 21, 43,196, 29, 67, 78,203,187,117,184, 3, 46,199, 40, 95,177,114,165,100,230,135, 31, 58,
- 36, 67, 89,118, 31, 34,159, 0,248,120,123, 1,128,249,211,214,117,141, 91,180,182,235, 13, 56, 26,247, 33,122, 69,127,134,119,
-223, 28, 11, 0,230, 79, 91,215,173,218,151,230,144,118,205,229,114,209,188,121,115,112,185, 92,232,116, 58, 40,149, 74, 24,141,
- 70,148,151,151, 59,245,114, 61,121, 92,252,178,124, 47, 4, 62,192,131, 28,224,175,234, 2, 20,223,207,194,150,184, 5, 14, 89,
-253,221,250, 12, 66,243,166, 53, 67, 36,205,109,144,127,235,214,173,205,195, 1, 0,144,159,159,239,146,242, 99,152, 92,149, 26,
-230,225,129,175, 62,156, 1, 0,248,202,130,248,183,102,102,214,238, 76, 28,200,214, 58,113, 65,127,113,121,175,100,249,103, 45,
-223,134,150, 28, 12, 1, 73, 97,200,235, 70,108,252,126,151,228,232, 42, 48,237,204,121,211,166, 77,251, 77,173, 86, 99,211,166,
- 77,154, 73,147, 38, 9, 1,120, 2, 32, 55,109,218,164,155, 52,105, 18, 79,173, 86, 67, 40, 20,202, 27,218,209, 13, 27, 54, 76,
-124,228,200, 17,185,105,193,150, 6,195,147,207,249,207,138,175, 62, 21,249, 94,219, 14,209,205,227,248,226, 85, 63,175,143,246,
- 23,127, 89,165,163,158, 42, 5,128, 94,130,183,188,124, 8,229,239,159,236,240,179,191,252,242,203,226, 63,255,252,211,105,178,
- 89,182,108,153,120,247,238,221,242,170,170, 42,155,231,239,221,187,135,221,187,119,203,223,123,239, 61,201,198,141, 27, 83,236,
-212, 23, 98,219,182,109, 91,250, 13,123, 99, 66,230,133, 51,188,230, 77, 27, 27,222,122,111, 90,173,126,247,248,193, 95,209,181,
-107,215, 14,219,182,109, 27,222,181,107,215,125, 0,112,234,212,169,122,219, 7,147,246, 86,211, 62, 8,192, 78, 34,158,238,221,
-187, 83,135,146,142,226,194,149,107,230, 99, 26,141, 22,223,173, 88, 87, 61,125, 82, 20, 75,216,207, 49, 30, 10, 2, 92,186,116,
-169,184,223,208, 49,242, 14, 45, 3, 32,112,227,128, 36, 73,220,191,127, 31,151, 51, 46, 64,103, 32, 65,146, 20, 2,124,220, 49,
-116,248, 72,185, 90,107,112,248, 15, 5,110, 69, 8,105,121, 31,224, 18,232,212, 62, 15, 2,222, 3,135, 45,127, 75,242,183,134,
-162,178, 10,247,243,114, 32,242, 9,168,211, 43, 80, 31,121, 89, 99,243,206, 95, 49, 99,116, 47,244,138,254, 12,245,104,217, 15,
-129,207,231,131,203,229,194,219,219, 27,217,217,217, 40, 47, 47,175, 81,164,156, 36,255, 38,141,130,225,201,227, 98,204,204,175,
- 49,124, 98, 31, 28,184, 82,128,251,106, 52,152,252,173,145, 95,120, 31, 87,207,157, 70,144,159,119, 13,249,243,184, 46, 41,191,
-215,198,189, 11, 0,240,227,185, 57, 68,254, 0,240,127, 43, 87,225,255, 86,174, 50,147,127,146, 82,137, 79,134,142,172, 57, 25,
-196,103,244,220,125, 98,219,136,167,206,125, 69,254, 94,171, 15,224,198,241,132, 7,220,193, 1, 23,205,130,251,226,195,175,230,
-200,231,239,239,192, 72,141, 72, 73, 73,209, 3,192,230,205,155, 85, 0,132,244, 50,202,155, 54,109, 34, 1,184, 91, 46,171, 28,
- 21, 21,229,212,184, 92, 92, 92,156,216,145,227, 12,208,175,103,247,110,170,132, 95,247, 74,187,119, 9,229, 42,175, 29, 67, 78,
- 81, 21,238, 85,168, 64, 82,148, 83,129,192, 20, 69, 81,101,101,131,169, 1, 3, 6,184, 52,145,152, 5,249,195,223, 63,217, 41,
- 25,105,105,105,114, 0, 4, 65, 16,120,249,229,151, 29, 46,179,228,228,228,135,200,255,220,185,115,152, 56,113,162,121, 95,175,
-215,227,198,141, 27,242,184,184,184,122,189,152,219,182,109,251,176,223,176, 55, 70,126, 19, 59,155,151,144,144,128,159, 87, 44,
-229,153, 60, 70,102,242, 79, 72, 72,192,202,149, 43,209,181,107,215,125,246,218,155, 53,249,215,213,222,134,247, 53,121, 1,189,
- 60,236,202,251, 97,197, 26, 51,249, 23,149,148,162,168,164, 20,138,170,106,184,185,241, 60,215,108,218,174,129,171, 22, 68, 96,
-241, 88, 17, 22, 22,246,208, 86,175, 2,176,122,245,106, 42,160,245,139,104,221,216, 23, 26,189, 17, 4, 1, 36, 37, 29,198,255,
- 54,111,194,165,140, 12,124, 50,103, 22,184, 92, 14, 72, 35, 9,111,119, 1, 90,191,216, 79,190,124,249,114,198, 13,108,229,202,
-149,226,206,237,239,202,189, 61, 85,248,101,115, 17, 56, 4,133, 94, 93,111,202, 87,174, 92,233, 80, 35,181, 69,254, 52,241,171,
- 21,165,181, 20, 4, 69,101,149, 93,121,182, 26, 19,221,144,210,226, 23,215, 34,184,205, 59,127,101,116,143, 33, 33, 33, 8, 8,
- 8, 64,101,101, 37,248,124, 62, 56, 28, 14,212,106, 53,202,203,203,193,229,214, 52,114, 71, 22, 91,218,243,219, 94,204, 90,126,
- 4,123, 87,124,142, 38,141,130,225,238,225,143, 60, 99, 1,182,196, 45,128,167,169,211,224, 50,148,103,139,252,105,226, 87, 20,
-222, 70,135,230,141, 80,165,210, 64,224, 46, 0,140, 70,187,241, 0,246,202,111,193,250, 3,184,122,254, 44,186,180,237, 4,133,
-209,190,210, 72,147,255,205, 35, 71,241,127, 43, 87,153,143, 39, 41,149, 72, 82, 42,145, 45,253, 47,142, 92,187,132,206,189,218,
- 2,165,246,151,102, 30, 56,175,173,120,250, 71,131,228, 65, 30, 29,161,166,170, 0,109, 17,248,218, 50,104,141, 85,208,144,106,
-144,124, 79, 52,235,223, 19, 67,166,183,162,236, 89,115,244,184,191, 84, 42,117,151, 74,165, 64,205, 16, 0,164, 82, 41, 76,251,
- 38, 11, 74,131, 29, 59,118, 56,220,104,103,207,158, 45,158, 51,103,142,188, 83,167, 78, 20, 65, 16,114, 0,120,251,237,183,169,
- 86,173, 90, 81,159,127,254,185, 83, 75, 51,123, 9, 56,155, 86,125,246,158,104, 88, 51, 45,247,204,141,251, 56,144,195,193,103,
-135, 30,104,255,155, 82,173, 80,234,241,174, 51, 50,203,203,135, 60, 74,203, 31,254,254,201,136,142,142,118,120,136,208,146,240,
- 41,138, 34,232,229,164,153,226,221,119,223, 21, 63,120,192,204, 40,209,233,116,184,124,249,242,241,250,234, 11, 0,113,243,166,
-141,249,145,145,145, 0,128,244,244,116, 28, 63,248,171, 48,191,240, 62, 73,147,191,233,217,205,237,237,242,229,203,113, 13,105,
-111,223, 77, 26,137, 43,183,243,208,184,109, 19, 64,169, 98,252,236, 69, 37,165,208,235, 13, 38, 5,199, 0,189,222,128,188,187,
- 57,194, 6,190, 86,194,206, 62,139, 39,136, 90,174, 40,173, 86,139,238, 29, 58,200,221, 69,110, 32, 73, 10, 70, 18, 56,125,242,
- 20,254,251,213,215, 32, 41,224, 86, 86, 22, 46,101, 92, 68,151, 46,221,192,229, 18,120,161,109,115,100,159,103,238, 5,224,243,
-138, 16,218,186, 16,224, 17,200,187,167, 7,120, 4, 94,236,112, 23,105,151,139,156,126, 0, 75,247,190, 45,207,128, 90, 81, 90,
-107, 54,128, 61, 88,186,247,109,105,218,105,241,139, 49,100,246, 74,155, 81,236,150, 48, 24, 12,112,119,119, 7,135,195,129,159,
-159, 31, 84, 42, 21,148,202,154,101,128,131,130,130, 80, 90, 90,234, 80,142,108, 77, 57,208, 75, 36,194, 39, 43, 78, 98, 72, 55,
-224,238, 5,224, 47,211,185, 79, 86,156,196, 79,179, 37, 48,146, 70,135,203,239,234,185,211,230,239,131,194, 59,128,231,197, 65,
- 82,202, 53,116,239,208, 2,222,158, 2,108,222,157,140,158,146, 8,228,219,152, 5, 96,175,252,246, 93,163,128,123,192,232, 65,
- 4,214, 31,200, 70,128, 95, 27,140,237, 75, 48, 42, 63,218,221,159,164,252,123,233,100,234,139, 56,160,153, 2,196,212,133,160,
-254,251, 21,192, 81,131, 72, 91, 68,119, 42,117, 22,102,200, 56, 79,121, 43,223,112, 84, 26,171,161, 45,207,194,150,220,109, 56,
- 53,186, 28,157,166, 72, 48,116,166, 39, 68,126, 47, 64,200,243, 3,111,180, 2, 83, 12, 83,168,159,215,255,108,179,147,146, 74,
-165, 20,173,180,113, 56, 28, 80, 20,165, 51, 41,209, 26, 14,135,163,162, 40,202, 31, 0,137, 6, 76,175,141,139,139, 75, 25, 54,
-108,152,164,180,180, 84,158,148,148, 84,163,248, 36, 37,161, 99,199,142,232,208,161,131,132, 62,230, 8,170,180,228, 71,147,255,
-239,167,253,223, 71, 52,230, 80, 26, 5,166,198,103,234, 13,122,253, 74,173, 17,139, 0, 56,181, 24,197, 27,111,232, 30, 57,249,
-199,199,199,167, 56, 99,253, 91, 14,153, 16, 4,129, 94,189,122,137,153,174, 42,105, 52, 26, 29, 82, 24,238,220,185, 3,153, 76,
- 70,172, 89,179,198,214,105, 33,128, 78, 0,120,175, 70,140,173,200,206,206,246, 77, 79, 79, 71, 66, 66, 2,194,179,179, 57,233,
-233,233, 0,128,240,240,112,188, 54,176, 39,188, 61, 5, 88,185,113,111,209,196,137, 19, 99,215,172, 89, 51,219,209,246,118,239,
-183,197,240,234, 44,132,103,251, 89,216,181,120, 10,186,117,105,140, 23, 70,126,109,183,125, 40, 42,171, 32, 20, 10, 0, 0,110,
-110, 60,168, 84, 26, 87,243, 12, 75,250, 79, 0, 76, 22, 3,170,213, 81,145, 36, 9,119, 1, 31, 58, 3, 5,146, 2, 56, 4,176,
-240,203,175, 97, 36,129,234,234,106,220,191,127, 15,193,193,141, 65, 81, 36, 12, 6, 35,132,110, 60,112,221,152,185, 96, 87,173,
- 90, 37,110,223, 58, 95, 30,232, 87, 89, 83, 29, 76, 27, 65, 80,232,209,249,150,156,158, 21,224, 8,104,235,158,118,247, 91,147,
- 63, 19,235,223, 90,139,166,137,127,213,190,180,135,200,159,169,245, 15,212, 4, 12, 9, 4, 2,248,248,248,152, 93,134,116,224,
-159,143,143, 15, 26, 55,110, 12,131,129,185,242,180, 49,249, 4,124, 90, 3,226,208,154,253, 76, 67,141,251, 31,168, 57,246,249,
-215,114, 84,232, 28, 27,146,201, 47,172, 9, 86,108,217,200, 31, 94, 62, 30,224,121,115,161, 41, 81, 3, 28, 14,154,180,106,142,
-211, 25, 57, 78,149,223,187,115,191,193,128,222,175,130,119, 31,168, 14, 6,220, 57, 28,244,110,221, 6,210,209,193,140,228, 88,
-143,245,111,125,115, 10,198,188,209, 31,104,167, 1, 46,241, 0, 79, 30, 48, 42, 28,205,215,174,103,230,141,105,230, 15,157,174,
- 12,132,182, 20, 91,114,183,225,236, 36, 31, 12, 24, 51, 9,253, 26,189, 38,185,114,196, 0, 3,169,132,155, 78, 9, 67, 7, 18,
-197, 15,152, 5,141,154,148, 55,205,164, 73,147, 56, 0,202, 41,211, 10, 81,166,253, 6, 33, 41, 41, 41,165, 99,199,142, 18,119,
-119,119, 4, 6, 6,194,221,221, 29,169,169,169, 68, 82, 82, 82,138, 19,226, 26,143, 28, 57,114,253,170,117,191,112, 22,166, 84,
-147,187,207,100, 65,171,211, 43, 53, 70,204,115,132,252,173, 93,254,169,169,169, 4,189, 61, 45,228,111,203,221,239,168, 23,160,
-186,186,218,252,253,220,185,115,230, 13, 0,230,204,153, 83,107,223,226,122, 65, 29,226,154, 2,104,109, 82, 10,221, 95, 27,247,
-182,198,210, 19, 64, 91,254,175,244,237,107,217,222, 14, 72,165, 82,141, 35,237, 45,102,212, 0,188, 24,222, 1, 94,221,188, 80,
-112, 44, 23, 16, 10, 48,110,230,191,208,235,157,159, 24, 61,179,193, 96, 68,193,189, 7, 6,218,242,167,145,119, 55,167,161,175,
-150,170, 99, 99,241, 20, 40, 4,176,101,169, 80,166,206,141,164, 0, 35, 89,163, 4, 16, 4,240,235,158,221, 24, 51,118, 60, 2,
-131, 26,153, 59, 64,202,129,119,201,229, 20,161,115,187, 60,243,254,139, 93,220,205,186, 97,143, 78,217,224,114, 28,247, 2, 88,
-187,251,109,157,119,196,250,183,118,247,219, 58,111, 57,151,189, 62, 84, 86, 86,162,170,170, 10, 90,173, 22, 36, 73,162,184,184,
-216,236,254, 87,169, 84,168,174,174,118,104, 8, 96,239,138,207,145,114, 5, 80,228, 0,122, 53,240,211,124,137,217,253,127,254,
- 2,112,241,222,105,112, 29, 44, 63, 69,225,109,248,251,120, 32,192,223, 3, 47,132,118, 68,246,157, 98,100, 22,148,162,101,128,
- 15,180, 15,138,144,117, 43,171, 86, 46, 0, 38,229,215, 71,252, 58,250, 73,162,176,119,255, 46,200, 83,119, 97,219,178,185, 24,
- 55,119, 17, 46,233,129,226,210, 34, 70,229,103, 57,214,255, 94,159,151, 17,221,169, 21,118,237, 61,142, 75,151,114,176,236,114,
- 58,118, 12,249, 23,176,225, 12, 10, 10,138, 25, 89, 23,205, 53, 2, 24,117, 37,208,233,106, 34,171,131,155,181, 64,135,142, 29,
- 37,149,162,154, 88, 12, 53,169, 2, 71,171,132, 72,201,197,131,123,245, 43, 0,244, 59,211,104, 52,208,104, 52, 66, 0, 58, 0,
- 94, 26,141,198,219,122, 74, 96, 3,188, 0,226,212,212, 84,121,199,142, 29,241,246,219,111, 75, 74, 74, 74, 48,118,236, 88, 71,
- 58,206,126,124, 62,191,218,211,211,211, 48,100,200,144,123,243,231,207,111, 26, 27, 27,155,253,215,133, 75, 35,118, 92,213,222,
-208,147,112,120, 61,214, 71,225,242,119, 37,249, 91, 91,255,180,194, 66,191, 51,166,177, 0,110,110,127,199,168, 44, 91,182,204,
-188,217,218, 7,204, 51,124,234,122, 55,124,211,198, 1,192, 83, 20,222,182,233, 78,167,219,219,133,243, 23,238, 76,156, 56, 49,
-198,145,246,214,255,165, 23, 48,184,111, 40,190,249,114, 41,126, 88,158,136,255,108, 61,142,105,175,246,196,253,223, 19,161, 40,
-175,100,210, 62,136,200,209,175, 65,175, 55, 92,208,235, 13, 6, 75, 5, 0, 0, 22, 45, 92,208, 16, 11,158,181,252,159, 32,108,
-141,253, 91, 43, 1,181, 20, 0, 14,135, 3, 69,181, 10, 92, 14, 1,131,193, 8,146,162, 96, 32,107,130, 72, 51, 46, 94,192,171,
-131,134,213,184,201, 40, 10, 92, 14, 23, 85, 42, 29, 12, 58,173,125,235,127,245,106,113,155,102,247,228, 65,254, 10,179,150,209,
-167,151,167, 41, 70,151, 0, 65, 80,232,222, 49, 75,190,106,245,106,198, 94, 0,218,186,175, 47, 24,208, 41,235,181,158,224, 26,
- 71,224,231,231,135,226,226, 98, 8, 4, 2, 84, 85, 85, 33, 40, 40,200, 28, 20,168,209,104, 80, 81, 81,225,144, 2, 16,243,205,
- 14,252, 52, 95, 2,159,214, 64,202, 21,224,163, 37,114,120,242,184, 24,251,241,183,200, 39,239, 35,126,217,167,224,114,152,203,
-163,173,255,240,240, 80, 4,181,109,141, 70, 65,129,224,115, 8, 24, 8, 10,197, 74, 53,202,171, 52, 78,149,223, 15,139,127,195,
- 27, 29,219,192,219, 59, 0,238, 65, 77,161, 47, 43,199,133, 3,219, 81, 81,150,235, 84, 37,254,101,241,135,192,236,193,224, 25,
-116,104,173, 4,138,184,149,248,233,222, 95, 0,223,155,177,140,243,251,255,144,148,112,212,200,229,171,208,179,157, 4,157,254,
-229,137,108,191, 20,121, 80,208, 5,121,139,222,217, 80,112,170,160,165,212, 80,109, 37, 33,244,244, 98, 98,249, 91,118,240,244,
- 44, 0,190,171, 26,238,225,195,135, 1, 0,209,209,209,146,184,184,184,148, 49, 99,198,152, 45, 70, 38,228, 31, 20, 20,116,104,
-253,250,245, 30, 50,153,140, 59,123,246,108,204,154, 53,139, 58,115,230, 76,111, 0, 73,106, 3, 58, 2,248,211,209,123,146, 74,
-253,234,116,251, 59, 27, 16,232, 74,242,183, 38,120, 75,133,133,162, 40,194, 20, 24,104,191, 93,228,231,159,161,191,111,219,182,
-205,188, 89, 31,163,225,239,239, 15,169, 84, 90, 87, 39,152, 15,160, 2, 0, 39,191,240, 62,206,158, 61,107, 30,243, 15, 15, 15,
- 7, 80,179,252,246,206,125,137, 40,175,210,168, 0, 44,156, 15, 74, 29, 0, 0, 32, 0, 73, 68, 65, 84,146, 74,165, 70, 71,218,
-219,239,123,191,192,176,249, 51, 49, 98,196, 32, 4, 10,184,168, 34, 40, 36,101,230,225,236,149, 2,135,136,122,250,164,168,151,
-178,179,178,120,121,119,115, 64,111, 38,242, 7,107,181, 63,155,196,111,125,204, 22,106,197, 0, 8, 4, 2,220,186,118, 73,210,
-186,169,191, 92,228,198,131,209, 72,130, 32, 8, 16, 4, 16, 35,157, 1,138, 34, 97, 52,229, 3, 80,105, 52,184,158,153, 13, 62,
-223,110, 84, 55, 12,250, 50,116,239,116,199,178,199,192, 7,179,239, 96,207,214,246,230,170,213,179,203,109,252,145,209,209, 97,
-235,223, 22,241,171, 21,165, 0,224,148,245,111,171,161,165,197, 47, 6, 0,198,214, 63, 80, 51,207,191,113,227,198,208,106,181,
-120,240,224, 1,140, 70, 35, 2, 3, 3, 81, 90, 90,138,192,192, 64, 83,185, 50, 39,236,226,251, 89,248,252,107, 57, 20, 57,192,
-247,115,251,163,218, 96,196,156, 37, 9,248,113,126, 36,230, 46, 59, 0, 30, 65,192, 1,254,135,162,240, 54,154, 4,250,194, 13,
-110, 48,130,192,189, 59, 87,113,183, 72,129,144, 32,127,252,126,254, 12,174, 95,131,195,214,255,184,201,115,224,230, 15,112,184,
-192,166,196, 59,216,179,250, 19, 76, 94, 44,195,156, 81,221, 48, 99, 80, 43,135,202, 47, 73,169,196, 15,163, 39, 0, 21, 66,128,
-112, 3,126, 88,138,241,127,157,196,145, 65,211, 65,124, 59, 19,196, 31,159, 50,182, 48, 46,222, 11,192,203,106, 5,170, 69, 92,
-168,132, 66,132,140,115,131,150, 82, 67,193,113,131, 1,161,160,140, 42,232, 75,238,225,244, 10, 5,162, 39,134, 32, 69, 46,127,
-236,141, 54, 38, 38,134, 2,128,117,235,214,209,174,126, 98,246,236,154, 97,224,173, 91,183, 50,125,179,125,155, 54,109,122,248,
-219,111,191,245,184,117,235, 22,220,220,220,224,237,237,141, 75,151, 46,233, 1, 20, 55,228,254,234,155,147,239,140,119,192,149,
-228,111,109,253,215, 16,243,195,211, 7, 77,211, 3, 83,236,220,215,173,157, 59,119,246, 97, 58, 60, 39, 20, 10, 39,215,173, 52,
- 73,171, 6, 14, 28,120, 7, 64,120,230,133, 51,176, 28,243,255, 96,242, 4, 28,110,219, 22, 9, 9, 9, 72, 79, 79,199,161,182,
-109,221, 39, 78,156,184,241,196,137, 19,140,219,219,155,131, 95,134, 15,233, 7, 21,220,176, 39,110, 38, 86, 31,184,136, 79, 94,
-235,135, 73,203,182, 97,252,162, 45,142, 90,224,196,162,133, 11,108, 37, 2,162, 44,148, 0,214,162,127,206, 80,203, 3,240,193,
- 7, 31, 16, 21,247,178,112, 59,175, 20, 60, 55, 46, 12, 70, 18,122,131, 17,231,207,167,227,127,255,219, 8,157,145,130,222, 72,
-130,207,227,160,168,188, 26, 5,215,207, 74,102,205,154, 85,111,131, 90,189,122,181,184, 99,200,221,191,173,127, 83,189,218,179,
- 53,180,166, 62,113, 40,128, 67,129,195, 33,209,187,219,117,249,106, 6, 94, 0, 91,214,191,229, 44, 0, 15,255,198, 14,145,191,
- 45,235,223, 50,170,118,200,236,149, 14,145, 87, 77,167, 88,142,234,234,106,184,185,185,153,173,127,146, 36,205,159,142, 42, 0,
- 91,226, 22,224,124,193, 9,120, 54,174, 9,250,243,226,113, 81,124, 63, 11,222, 2, 55, 84,148,229,131,203, 33,192,227, 48, 27,
-126,166,173,255, 22,254, 94,184,150,125, 7, 6,157, 14, 2, 30, 31,213,213, 26,252, 46, 63,131,158,146, 8,135,200,159, 46,191,
-215, 63,252, 10,241, 63,253, 8, 21, 9,180, 8,105,142, 43, 87,255,192,156, 81,221,156, 42, 63, 0,152, 19,210, 19,251,111, 29,
- 7, 20, 6, 64, 24,136,163,105,215, 64,124, 59,147,238,152, 24, 23,222,137,165,217, 41,167,143,166, 1,186, 42, 84, 19, 85, 40,
-231, 84, 67,193,211, 67,111,172,132, 64,163,130,176,240, 14,118,196,222, 66,235,176, 80,212, 21, 0,104, 13,145, 72,100, 73, 2,
- 16, 10,133, 54,207, 49,197,250,245,235,177,126,253,250, 6, 53,102, 47, 47,175,143,178,178,178, 60,188,189,189, 33, 18,137,224,
-239,239,143,226,226, 98, 16, 4,161,114,101,167, 65, 91,252,145,145,145, 20, 80, 19, 16,232, 72, 80,160,171,201,255,229,151, 95,
- 22,219, 11,168,101, 26, 11,224,225,225, 17,195,227,241,110, 91, 31, 95,182,108, 89, 45,203, 31, 0, 90,181,106,133,193,131, 7,
-111,178,103,255,228, 23,222,175, 21,237,255,249,255,205,134,128,199, 71,112,112, 48,232,152, 0,211,121, 15, 71,218,219, 20,241,
-139,152,181,244, 71, 84, 61, 40, 66,144,119, 35, 92,189,150,139, 73,203,182, 57,220, 62,172, 8,159,176,250,189,165, 28,214, 19,
-240, 12,224,226,197,139,245, 38, 3,170,211, 3, 0, 0,243,230,205, 75,249,126, 41, 33,161,168,209,242,214, 77, 3,224,229, 46,
- 64,167, 46, 97,232,212,185, 27,120, 28,160, 90,109, 68,238,189, 50,164,165, 28,148,120,122,184,219,253, 3,165, 74,133,208, 86,
-247,160,209, 10, 77, 89, 91,106,170,145, 72,168, 1, 69, 1,101, 21, 2,128, 0,188, 60, 12,232, 26,154,131,147,231,236,103,177,
-179,180,254, 45, 45,126,145, 79, 0,220, 40, 61, 96,248,187,191, 51,242,236,223,163,165,245,111,105,241,211,199,178,174, 94, 48,
- 95,203, 36,203,158,165, 18, 0, 0,141, 27,215, 40, 35,101,101,101,240,246,246, 54,187,255, 29, 81, 0,104, 37, 0,248, 22,211,
- 35, 7, 2, 63,157,196,234,127, 71, 96,252,220, 31,177,109,241, 12,240, 8, 2,124, 1,179, 25, 59,180,245,127, 45,183, 8,237,
- 90, 4, 98,195,207, 59,208,186,117,107,248, 52, 13, 65,183,166, 33,208,107,255,118,255,187, 49,144, 73, 91,255, 95, 79, 30,132,
-143, 22,110, 66,139,182, 68,131,202,143,182,254,135,238,253, 5, 71,162,163, 64, 52,239, 13,160, 38, 43, 32, 0,220, 81, 42,205,
- 74, 98, 38,152, 37,240, 89, 53,233, 54, 49,112, 30, 37, 14, 25, 91, 37,111,221,190, 11, 42, 69,192, 29,220, 69, 85, 78, 49,138,
- 23, 25, 81, 93,222, 28, 55, 78,103, 50,126, 33, 36, 73, 18, 34,145,136, 82,171,213,176,176, 60, 41,145, 72, 4,146, 36,137, 39,
-209, 89, 86, 85, 85,125, 63, 99,198,140,209,235,215,175, 23,250,248,248, 64, 46,151, 99,249,242,229,149, 58,157,238, 53, 87,254,
- 15,109,241,211,211,229, 28, 13, 4, 76, 72, 72, 32, 76, 73,126, 26, 76,254, 0, 96, 65,236,118,203,220, 94,134, 65,169, 84,170,
-147,201,100,189,119,237,218,117, 73,169, 84, 54,209,235,107,166,153, 90,147,127,167, 78,157,208,187,119,239,145, 82,169,212,222,
-127,242, 20,133,183,241,205, 23,159,227,215,253,135, 48,172, 95, 15, 28, 75,254,163,198,128,105, 26, 2,159,166, 33, 8,207,206,
-198,107,227,222, 46,201, 45, 85, 13, 5,176,155,169,245, 63,107,221,126,196,190, 63, 20, 77, 27,139,205,202,133,117, 57, 52, 48,
-155, 34,235, 9,120,142,148, 2, 70, 10, 0, 0,124, 50,111,110,202,247,223,147,146, 59,205, 95, 64,219,246, 29,229,222, 30, 34,
-144, 20,160,214,234,144,157,157,141,226,236,139, 18, 47, 79, 15, 76,159, 62,221,110,195, 21, 9,133,216,117,120,160,132,142,128,
-175,215, 29,193,225,192,195,131,185,245, 68, 79, 1,244,240,111, 12,210,168,175, 33,127, 19,244,132,155,221, 20,187,214,160,167,
-212, 12,153,189,178, 22,105, 57, 67,254,150, 74,128,101,226,159,178,178, 50,251, 47,192,142, 18,176,197, 98,150,240,250, 69, 31,
-252,189,163,175,134, 39, 67, 57, 45,252,189,176,235,220, 69, 92,185,113, 19, 61, 37, 17,181, 72,223, 17,242,167,241,250,135, 95,
- 97, 79, 15, 15,124, 56,166,131, 75,202,111, 78, 72, 79,204,221,183, 11,196, 55, 11,113, 40,248,101, 44,175,190, 82,235,252, 88,
- 31, 95, 44, 86, 84, 56, 68, 28, 39,150,102,167,248,241,134, 32,191,252, 54,138, 75,239,225, 65,166, 39,184, 70,111,244,125,177,
- 63,118,156,222,241, 68, 59, 53, 23,101,251, 59,183,113,227,198, 33, 4, 65, 28,253,241,199, 31,133,111,188,241, 70,165, 74,165,
- 26, 10, 39,198,252,235,131, 43,166, 0, 74,165,126, 46, 33,127, 27, 86,170, 61,229,131,193,189, 73, 75,100, 50, 89, 72, 85, 85,
-213, 55,233,233,233,179, 11, 10, 10,160, 84, 42,193,231,243,209,164, 73, 19, 4, 5, 5,189, 33,147,201,126,223,178,133,209,146,
- 0,215, 1,132,183,240,247,194, 43,175,188,130,139,183, 10, 16,216,166,115,173,246,246,218,184,183, 85, 0, 86,124, 19, 59,123,
- 55,211,231,152, 34,126, 17, 67,146,255, 68,244,194,255, 97,192,128, 1, 8, 14, 14,182,169,104,185,240,181, 19, 78,144, 63, 85,
-207,113, 86,137,120, 2,164,207, 40, 21, 48, 0,124,242,201, 39, 41,171, 86,173, 18,159, 79,201,148, 0, 53,145,180, 20, 69, 65,
- 32, 16,224,211, 79,230, 49,110,180, 31, 58,152,230,151, 41,104, 87, 63,215,160, 2, 12, 42,115, 4, 60, 77,252,142,206,197,162,
- 93,253, 89, 87, 47, 32,235,234, 5, 4, 5, 5,161,184,184,216, 41,226,247, 9,106, 10, 29,131,224, 72,166,136,254,106, 11,206,
-156,116, 93, 49,230,228,228,152, 87,251,211,107, 53, 15,145,191, 35,196, 79,227, 95, 61, 60, 92, 86,126, 0, 64,196,125,106, 38,
-126,154,252,239, 40,149,146,177, 62,190, 72, 2, 82, 22, 43, 42,156,122,246,223, 22, 31,181,232,120,212, 0,128, 29, 87,153, 39,
-236,161, 40,138, 16, 8, 4,102, 47, 0,253, 29, 0, 4, 2, 1, 97,235,251, 99,198,169, 95,126,249,101,192,238,221,187,231, 84,
- 86, 86,198, 1, 72,115,245, 31,184, 98,234,159,139,201,201,229,144, 74,165,106, 0,115, 76, 91,131,222,199,229,203,151,251, 2,
-104, 19,216,166,179, 74,175,213,184,155,218, 91, 37, 0, 5,128,235, 45, 3,220,223,148, 74,165, 14, 85,232, 33,159,175,127, 92,
-196,239,148,162,229,228,245, 44, 92,128,176,176, 48, 70,228,111,215, 0,109,232, 74,125,143, 2,244,216, 62, 77,252,104, 32,241,
-211, 99,211,138,162,124, 40,138,242, 17, 20, 20,212, 32,139, 31, 0, 12, 70,210, 97,239, 67,125, 40, 42, 83, 56,125, 47,214,160,
-199,246, 93, 69,252,143,160,252, 8, 0, 24,230,225, 65, 89, 90,253,221,121,110, 13, 34,254,127, 24,254,170,172,172,140, 98,139,
-225,201,227,196,137, 19, 50,153, 76,246,191,220, 82,149, 74,175,213, 88,142, 71,122,183, 12,112,247,115, 98,245, 63, 2,168, 25,
-202,120,214,148, 42, 22,143, 87, 9, 96, 84,153,156, 93, 71,152, 5, 11, 22, 44, 88,176, 96,241,236,130,195, 22, 1, 11, 22, 44,
- 88,176, 96,193, 42, 0, 44, 88,176, 96,193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88,176, 10, 0, 11, 22, 44, 88,176,
- 96,193,226,185, 64,173, 89, 0, 23, 47, 94,116, 58,138,212, 86, 48, 33, 43,143,149,231, 42,121,166,181,213, 57, 0, 72, 91,201,
- 87,216,242,171, 91, 94, 88, 88, 24, 93,118,244, 92,110,234,226,197,139, 36, 91,126,172,188,103, 73, 94,120,120, 56, 47, 61, 61,
-221, 0, 0,189,122,245,162,218,183,111,143,248,248,120,130, 45, 63,219,242, 28, 86, 0,158, 19, 52, 40,201, 68,100,100,164, 24,
-128,101,202, 80, 73, 66, 66, 66, 10,171, 43, 62, 25,124,247,221,119,239, 92,190,124,185,219,217,179,103,231, 10, 4, 2,168, 84,
-170, 79,101, 50,217, 82, 6, 25,216, 88,252,221,177, 80, 0,140,108, 73, 60,221,136,136,136, 16, 31, 60,120, 48,197,201,223, 74,
- 18, 19, 19,143,187, 40,161, 20, 34, 34, 34,222, 76, 76, 76,220,177,118,237, 90,127, 0, 85, 0,140, 79,186,205,209,228, 31, 29,
- 29, 77,109,221,186, 21, 61,123,246,100, 43, 77, 3,241, 92, 13, 1,152,200,187, 65,191,223,181,107,151,117,190,112,121, 67,228,
- 70, 70, 70,138, 77,115,118,169,200,200, 72,202, 81, 89,148,131,176, 53, 63,184,129,242,196, 79,226, 93,202,100, 50, 98,230,204,
-153, 75,175, 94,189,250, 83,171, 86,173,230, 10,133, 66,104,181, 90, 0,248,110,207,158, 61,228,152, 49, 99, 36, 79,168,201, 80,
-142,111,143, 83, 94,157,107,176, 91,174,197,238,212,250,236,145,145,145, 98,138,162, 40,234, 63,182,101,211,231,236,213, 65, 91,
-200,201,201,161,114,114,114, 92, 70, 48,101,101,131,107,173, 87,224,106,162, 38, 8,194, 33,185, 36, 73, 81, 70, 35, 69,145,164,
-237, 45, 34, 34, 66,156,152,152,232,212, 42, 84,235,214,173,123,245,208,161, 67,199, 7, 14, 28, 8,130, 32,168,237,219,183, 15,
-118,244,222,172,183, 67,135, 14,237,120,171, 15, 31,210,105,210,178,219,158,217,187,167, 78,141, 33,233,115,246,228, 41,149, 74,
- 74,169, 84,214, 91, 15,233,107,156,125, 63, 55,206, 73,144,188, 46, 3,225,225,225,172, 33,192,220, 16,120, 40, 65, 16,207, 78,
-131,183,153, 55,219, 94, 62,237, 39,136, 6, 45,227,182,107,215, 46,249,132, 9, 19, 0,212, 36,213,176,168,156,114,103,188, 10,
-180, 66, 65,231,252, 55,165, 33,149, 71, 70, 70, 58,230, 85, 72,240,119,224, 95,237,183,125,229,168, 15,152,139,115,124, 93,155,
-186, 26, 36,227,242,147,201,100,132, 66,161,216,217,165, 75,151,113, 0, 56, 20, 69, 65, 36, 18,161,168,168, 8, 21, 21, 21,240,
-241,241, 65, 81, 81,209,241, 49, 99,198, 72,246,238,221,155,226,224, 59,161,232,116,176, 4, 65, 96,220,184,113, 24, 60,120,176,
-100,218,180,105,140,229,236,219,247,155,249,251,232,209,111,216,221,183, 7,245,153, 15,255, 46,238, 62, 43,107,237, 91, 31, 19,
-245,177,191,168, 18,189,156,176, 37, 82, 83, 83,177,104,209,162,135,222, 69,255,254,253,169,147, 39, 79, 50,170,203, 9, 9, 9,
-114, 44, 36,232,253,135, 19,207, 44, 36, 26,220, 25, 63,197,125, 75, 45, 75, 91, 38,147, 73, 98, 98, 98, 48, 96,192, 0,234,212,
-169, 83,140,126,123,166,142,156,140,123, 19,230, 34, 49, 49, 81, 78, 47, 18, 54, 96,192, 0,170,178,178,178, 62,194, 23,199,196,
-196,152,235,235,239,191,255,238, 78, 16, 4,162,162,162, 30, 0, 8,158, 56,113,226, 81,153, 76,198,113,196, 98, 95,122,116,169,
-249,251,253,164,123, 32, 8, 2,219, 62,118, 7, 64,224,251,183,191,123, 61, 48, 48, 16, 0,176,125,243, 54,198,101, 21, 30, 30,
-142,182,109,219,186,164,220,195,195,195, 57,233,233,233,100,175, 94,189,168,173, 91,183,226, 65,102,107,160,196,143,101,117, 7,
-200,223, 81, 15, 0,149,144,144,240,144,134,101,209,129, 82, 78, 52,110,151, 90,147,214,242, 18, 18, 18, 44, 23,196,112, 24, 4,
- 65, 16, 9, 9, 9, 4,221, 1,153, 62,157,182, 52,105,242, 55,221, 19, 97,113,111, 14, 43, 42,196,132,114,243,198,228,184, 61,
-120, 30, 88, 99,222,152, 28,119,132,252, 41,138, 2,189, 58, 27, 69, 57, 86, 77,100, 50, 25,167,188,188,252,127, 62, 62, 62,227,
- 0,112, 38, 79,158,140,232,232,104,240,249,124,136, 68, 34, 8,133, 66, 16, 4, 1, 46,151, 11,133, 66,193,184, 28,135, 12, 25,
- 34, 6, 64,237,222,189, 27,244, 59,161, 40, 10,123,246,236,193,180,105,211,228,166,243, 79, 29,108, 41, 4, 79,194,179,150,144,
-144, 32, 7, 64,188,121, 99, 2, 38, 92,183,217,198,168, 9,215, 35, 37,196,151, 78,181, 59,234,147, 79, 62, 65,155, 54,109, 92,
-114,191, 4, 65, 80, 82,169, 31, 2, 2,142,185,180, 28,134, 15, 31, 62, 40, 57, 57,249, 56, 69, 81, 68, 76, 76, 76,138, 35,228,
- 95, 23,246, 38,204, 69, 92, 92, 28, 72,146,196,220,185,115, 25, 41, 20,150,228, 15, 0,135, 14, 29,218, 63, 96,192, 0, 0,240,
-139,138,138, 50, 12, 28, 56, 16, 82,169,148, 52,197,205, 48,241, 50,214,218, 95,190,124, 57,222,124,165,198, 54,220,246,177, 8,
-111,245,225,227,211, 97,159, 48,126, 38, 15, 15, 15, 12, 24, 48, 0,233,233,233,230,254,212,122,163,175, 97,170,236,165,167,167,
-147, 64,205, 50,235, 0,224,237, 94,194,178,122, 3,201,191, 94, 5,128, 38,171,244,244,116,115,218, 73, 75,235,201, 81,162,181,
-232, 68, 92,221, 41, 89, 43, 3, 46,117, 13,219, 24, 18,112, 24,150, 10,133,201,250,127, 30,235, 25,101,217,153, 20, 20, 20,152,
- 79,228,231,231, 51, 86, 24, 21, 10,197,183, 42,149,234,109, 14,135,195,153, 56,113, 34, 20, 10, 5, 10, 11, 11,225,230,230, 6,
- 30,143, 7, 30,143, 7, 55, 55, 55,136, 68, 34,168,213,106, 48,113, 33,174, 93,187, 86,124,244,232, 81, 57, 65, 16, 24, 63,126,
- 60, 40,138,162,149, 60, 98,252,248,241, 0,128,228,228,100, 57,219, 85,212, 79,254,166,247, 43,177, 84,146,233,119,111,233,213,
-114,198,130, 79, 72, 72, 32, 76,239, 5,107,215,174,117,137, 50,182, 96,193, 2,218, 40,104,176,103, 98,216,176, 97, 67,206,157,
- 59,151,220,186,117,107,180,107,215,142,234,219,183,175,217,115, 98, 90,253,209, 41,242, 95,182,108, 25, 8,130, 0,135,195,193,
-185,115,231,192,196, 27, 99,229,145,120,157, 32, 8,188,245,214, 91, 6,211, 33, 93, 84, 84, 84,165, 88, 44,198,180,105,211,200,
- 17, 35, 70,216,125,118,203, 85, 73,239, 39,221, 3, 8, 32,254,163,191,179, 22,111,251,216, 29, 81,125, 5,152,255,218,167,140,
-239,139,137,229,207,228,154,232,232,104, 42, 60, 60,220,188,157, 59,119, 14,213,185,225,128, 78, 13,194,211,128,228,175,175,195,
-242, 60,189,177, 45,183, 54,249,199,204, 95,108,243, 60,175,190, 6, 25, 30, 30, 78,165,167,167,131,246, 4,208,196, 21, 30, 30,
-238, 80, 35,127,212,228,111,105, 85, 63,237, 1,123,150, 67, 2,207,157, 6, 64, 81, 40, 40, 40,192,253,251,247,205,199,172,247,
-237, 88,255,220,195,135, 15,143, 8, 13, 13, 5,151,203, 69, 86, 86, 22, 40,138,194,205,155, 55,161,211,233, 64, 16, 4,120, 60,
- 30, 8,130,128,209,104,132, 74,165,194,222,189,123,237,202, 61,118,236,152, 28, 0,198,143, 31,255, 80,189,165,135,122,104,162,
- 96, 82,175,173,221,250,246,246,153, 88,249, 52,234, 26, 14, 96,226,250,183, 70,106,106, 42, 76,150, 97,195, 20,224,133, 4,136,
- 47,107, 20, 56, 75,229,149,162, 40, 96, 33,129, 9,215, 35,157, 14,148, 37, 8,130, 50,189, 23, 51, 25,153,222, 23,209, 16,121,
-237,219,183,127,136,220,156,133, 64, 32,160,174, 94,189,138,226,226, 98,162,184,184, 24, 97, 97, 97, 84, 78, 78, 14,184, 92, 46,
- 12, 6,131, 83,127, 48,176, 47,151, 86, 30, 48,111,222, 60, 44, 95,190, 28, 39, 79,158, 4, 65, 16, 24, 53,122, 42,238,230, 48,
- 91,192,241,208,161, 67,191,153,222,177, 6, 0,105,218, 16, 21, 21, 85, 1,192, 55, 49, 49, 17, 17, 17, 17, 98, 75,133,188, 62,
-212, 88,255, 15,175, 99, 82, 51, 28, 0,108,223,118,193, 33,121, 13,197,141, 27, 55,112,238,220,185, 90,199,140, 21,119, 96,208,
-147, 0, 81, 5,223,215,244, 56,103,181,216, 53, 27, 28,200,140,252,235,245, 0,152,172,127,194,210, 19, 64, 91,254,233,233,233,
- 13, 33,127,123, 1, 74, 78,201,179,240, 76,136,225, 68,128,211, 35,176,156, 40,139,206,199,124, 63,244, 49, 87, 5, 39, 81,187,
-252,204,155, 43, 80, 61,114,186,121,115,192,242,167,232,206,182,121,243,230,232,217,179,167,185, 17,210,251,214,215,214, 1, 95,
-127,127,255, 46, 90,173, 22,101,101,101, 56,115,230, 12,210,210,210, 80, 92, 92, 12,181, 90, 13,122,140,148,162, 40,232,245,122,
-104,181, 90, 70, 67, 12,116,221,168,139,220, 19, 18, 18, 8,130, 32,192,212, 51,179,111,223,111,230,141,201,190, 61,168,207,124,
- 88,139,232,233,205,114,223,242, 26,166, 24, 48, 96, 0, 82, 83, 83, 27, 86, 33, 44,198,252, 81, 51,140, 37, 49,145, 51, 65,159,
- 67, 3, 99,111, 44,223, 11,237, 5,112, 21, 92,225, 5,104,214,172, 25,242,243,243, 9,107,101,215, 89,242,223,155, 48,215, 92,
-135,105,244,235,215, 15, 0,112,226, 52,243,201, 26, 17, 17, 17,195, 76, 99,255,215, 0,168, 76,253, 57,189,153,181,110,166,193,
-133,181,199,254,109, 40, 87, 14,202,115, 5,210,211,211,137,158, 61,123,162,234,218,112,148,159,105,130,138, 83, 34, 80,229, 21,
- 64, 53,192, 81, 25, 80,121,146, 3,245,159,124, 84,156,105,132,195,219,134,160,103,207,158, 14,241,211, 63, 29, 60, 38,141,147,
-246, 4, 56,106,249,207,159, 63,159, 90,178,100,137,203,110,214,158, 60, 83, 39,229,178,202,201,116, 12,173, 62,210,177,144, 85,
- 45,149, 74, 61,235, 58,239, 44, 44,199,254, 93,161, 4, 88,142,253, 51, 85, 2,162,163,163,225,225,225, 1, 79, 79, 79,120,121,
-121,193,199,199,135,244,243,243,227, 36, 38, 38,226,157,119,222, 49, 95, 39, 20, 10, 49,116,232, 80,212,163, 4, 4,232,116, 58,
-148,149,149, 65,163,209,192,199,199, 7, 2,129, 0, 6,131, 1, 20, 69,193,104, 52, 66,167,211, 65,175,215,195,104, 52, 58, 20,
- 95, 96, 10, 90,171,243,188,165, 21,250, 36, 97, 47, 32,208, 81, 52, 84, 9, 32,190,172,123,184,111,194,245, 72, 19,185, 58, 41,
-219,202,250,183, 56,142,241,227,199, 59, 28, 12,104,109,253, 91,202,115, 22,225,225,225,148,209,104, 68, 88, 88, 24,117,241,226,
- 69, 34, 44, 44,140,210,235,245, 80, 40, 20, 13, 33,181,154,206,151,199,195,236,217,179,113,238,220, 57,252, 61,238,207,188, 78,
- 31, 62,124,248,112,255,254,253, 1,192,203, 68,250, 42, 0,216,177, 99, 71,163, 19, 39, 78,120,155,218, 7, 97,250,180, 43,120,
-249,143,203,241, 86,239,135,173,255,232,159, 84,216,113, 70, 15,138,162,208,125, 98,119, 92,216,118,129,120,156,198, 85,122,122,
- 58, 33,249, 87, 56,117,120,121, 43,240,170, 43, 1, 67,205, 95,147, 0,248, 60,160,224,190, 47,142,231,134, 27,215,109, 47,230,
-166,167,167, 19,225,225,225, 66, 58, 86,128,181,254, 23,215,123,157,221,105,128,145,145,145, 20, 93, 97, 45,227, 1,152, 96,201,
-146, 37,180,197,224, 18, 48,144,231,244,248,186,105,138, 94,173, 45, 57, 57,153,164,103, 5, 52,212, 98,143,137,137,241,124,158,
- 43,220,186,117,235,176,108,217,178, 90,245,138, 38,255,209,163, 71, 99,244,232,209, 53, 22,206,137, 19,245,137,241,207,206,206,
-214, 24,141, 70,148,151,151,163,164,164, 4,229,229,229, 80,169, 84, 80,169, 84,168,174,174, 70,101,101, 37, 20, 10, 5,212,106,
- 53,180, 90, 45,152, 52,116,130, 32,176,123,247,110,135, 20,182,103, 25,169,169,169,181, 54, 75,204,158, 61, 91,108,185,207,100,
-204,217,198,152,127, 45,203,189, 33, 81,251,182,126, 75, 81, 20,177,123,247,110,151,198, 2,236,222,189,219,225, 54,220,163, 71,
- 15,202,104, 52,154, 19,180,132,133,133, 81, 36, 73,226,193,131, 7, 80, 42,149, 78, 61,243,191,231, 15,196,137, 19, 39, 64,238,
-244, 5, 69, 81,136,139,139, 51,191,163,212, 51, 36,152,142,124, 68, 68, 68,188, 1, 0, 81, 81, 81, 5, 38, 5, 64,187,125,123,
-124,163,233,211,167, 55, 58,113,226, 4,134, 15, 31, 62,196,145,156, 0,247,147,238,129, 0,129,120, 11,235,127,226,143, 42,112,
-223, 82, 96,251, 25, 29,102,205,154,133, 37,135,191,123,236,117, 57, 60, 60,156, 75, 43, 1,175,205, 50,128, 82,251, 0,149, 0,
- 42, 1,110, 21, 80,249, 0, 56,116,161, 9, 44,200,159,151,158,158,174, 97,201,223, 62,249,219,245, 0, 88,143,251, 91,198, 3,
- 48,117,179, 36, 36, 36,164,152, 2,132,228, 86,158, 36,103, 59,140,135,228,209,195, 2,166,113, 72,151,184,127, 6, 15, 30,124,
- 37, 57, 57,185,203,211,248,130,105,171,223, 85,110,127,218,234,119,192,237, 95, 11,241,241,241,230,239,255,253,239,127,177,113,
-227, 70, 0,208, 1,224,211,196, 15, 0, 67,135, 14,181,167, 0,168, 67, 67, 67,161, 82,169,160,211,233, 80, 92, 92, 12,129, 64,
- 0, 30,143,103,246, 0, 40,149, 74,168, 84, 42,104,181, 90, 40, 20, 10,140, 27, 55, 78,178,103,207,158,122,239,143,182, 50,237,
- 76,107,197,248,241,227,237, 42, 10, 53, 10,205,163,139, 1,112,230,188, 53, 44,166,251, 61,132,184,184, 56,249,236,217,179, 37,
-113,113,113, 41, 79,180, 14,215, 97,253, 91,194,145, 88,128,186,172,127,103,209,163, 71, 15,234,252,249,243, 68, 88, 88,216, 23,
-116,213, 54, 26,141, 11, 61, 60, 60, 80, 82, 82,226, 84, 31,243,249,103, 3,145,146,146, 2, 98,119, 0, 0,224,200,231, 94, 24,
-250,117, 21, 6, 12, 24,128,111,150,156, 0, 69, 81,140,189, 21,135, 14, 29,218, 59,112,224, 64, 0, 40,222,177, 99, 91,179, 19,
- 39, 78,250, 82, 4,133, 17,195, 71,140, 62,120,240,224,254,131, 7, 15, 58,228,229, 92,190,124, 57,222,234,227, 86,219,226, 7,
-133,217,179,102, 35,120,104, 99, 60,169,184,165,244,244,244, 90, 26, 62, 85, 5, 8,116, 0, 73, 17, 48, 24, 41, 8, 40, 32, 88,
-196,177,188,222, 0, 22, 53, 70,217,146,207,234, 84, 16,194,194,194,234, 87, 0, 44, 35,254, 77,228,111, 14,150,162, 61, 1, 76,
- 53,127, 27,164,221, 32,216,144,231,242, 49,169,152,152,152, 46,201,201,201,174,236,240,158,215,122, 70,160, 38, 10,220,108, 73,
-191,247,222,123, 0,192,183,168, 75,230,115,166, 78,171, 46, 92,237,221,187,247, 59, 41, 41, 41, 9, 70,163, 17,149,149,149,208,
-235,245,230,113,127,141, 70, 99,158, 98, 72, 7, 6,238,217,179, 39,133, 65,125, 33, 96,154, 2,104, 93,111, 35, 35, 35, 41,154,
-244, 7, 15, 30, 44, 97,162, 0, 60,170, 60, 0,150, 99,255,150,228,111, 61, 44,192,224,125,212, 7, 42, 46, 46, 78,254,230,155,
-111, 98,231,206,157,206,122,203,196,150,158, 19,122,159, 14, 24,156,112, 61,146,186,117,235, 86,157,191,167, 19,254, 28, 62,124,
-184, 78,143,221,157, 59,119, 24,123,102,202,202, 6, 83, 0, 48,100, 72, 54,178,179,179,109, 70,151,151,150, 14, 2, 80, 14,192,
-126,191,213,169, 83, 39,234,252,249,243,132,169,179,252, 2, 0, 56, 28,206,194,187,119,239,162,188,188,220,169,134,204,225, 16,
- 53, 10, 59, 77,254,151, 12,216, 40,215, 1, 0,190, 89,114,194,225, 62,130,110, 19,211,167, 79, 15,163, 40, 10, 17, 35, 35,198,
- 29,216,127,224, 87,166,196,111, 41,234,141, 49,175, 95, 35, 8,162, 19, 69, 1,220,183, 20,160, 40, 10,179,231,204, 70,227,161,
- 77, 26,152, 87,181,102, 90, 47, 93,239, 26,146, 73, 48, 60, 60,156,218,245, 89, 83,120,150,222,193,237,202,230,104, 35, 40, 6,
- 60,130,193, 83, 62,128,183,178, 20, 64, 35,179,199,192, 90,105, 96,225,132, 7,192,114,186,159,213, 52, 54, 42, 33, 33,193, 97,
-151,169, 5,105,187,228,198, 45,229,209,243,255,159,211,233,117,207, 4,172,202,190,214, 20,177, 58,206, 61,212, 25, 72,165, 82,
-131, 76, 38,219, 51,112,224,192,153,137,137,137, 43, 12, 6, 3, 42, 42, 42,204, 49, 0, 0, 80, 92, 92,140,138,138, 10, 80, 20,
- 5, 71,234,211,144, 33, 67, 36, 71,143, 30,149, 39, 36, 36,212,178, 62,233,223, 15, 25, 50,196,161,100, 64,143, 2,234, 51, 31,
- 58, 67,248, 15, 17,188,157, 46,155, 32, 8,130,114,134,252, 77,158,182, 20, 91,109, 17, 0, 44,130, 2, 25, 97,218,180,105,114,
- 6,255, 73, 57, 48, 87,188,214,103,109, 34, 98,150, 28,175, 77,155, 54,212,181,107,215,104,151,255, 23, 0, 22,106,181, 90,220,
-190,125, 27, 10,133,194, 89, 42,164,200,157,126, 56,114,169,198, 56,221, 36,215, 97,199, 25, 29, 40,138,194,201,179,206,143, 44,
-166,166,166, 98,248,240,225,146,131, 7, 15,166, 28,216,127,192, 89, 49, 28,146, 36,221, 0, 96,231, 89, 61,102,205,154,133,198,
-195,154, 48, 87, 39,109, 64,169, 84, 2, 0,178,179,179,169,117,235,214,153, 21, 50,203, 88,146, 77,155, 54, 89,246, 15,140,254,
-165, 21, 71, 9, 4,133,225,157,245, 10, 0,193, 53,101, 48, 35, 16, 45,121,121,248,122,112, 17, 54,183,127,139,218,177, 99,199,
- 63, 62, 0,144,182,238,109, 89,254,214,231,235, 27, 2, 32, 76, 67, 0, 15, 77,155,114,100, 8,192,102, 71,225, 58,210,177,148,
-231,210,249,255,244,216,191,179,176,167,144, 56,170,176,212,229,238,119,118, 24,160, 46,119,191,147,195, 0,150, 65, 65,132, 3,
-231, 96, 67, 9,160, 0,172,148,201,100,107,227,227,227,245,124, 62, 31, 90,173, 22, 6,131, 1, 36, 73,194,215,215, 23,229,229,
-229,112, 52,155,226,209,163, 71, 83, 80, 51,239,159,218,189,123, 55, 76,138,128,121,106,224,209,163, 71,255, 17,157,195,155,111,
-190, 73, 41,149, 74, 28, 56,112,192,209,250, 44,182, 83,222,212,132,235,145, 18, 38,222,184, 79, 62,249,228, 33,227,194, 26,159,
-126,250, 41,197, 52,200, 83, 42,245,179, 43, 79, 42,245, 99, 36, 76, 36, 18,209,157, 36, 69, 81, 20, 84, 42, 21, 10, 11, 11,157,
- 30,243,183,196,176,175,171,106,237, 55,132,252,141, 70, 35, 1, 0, 78, 88,252,214, 32,247,253,190,191,189,101, 38, 64, 87,161,
- 62,133,204, 66, 1, 96,100,253, 75,199,135, 20,254,146,137,166,178,221,183,107, 69,249, 15, 88, 21, 78, 29,159,246, 2,110, 61,
- 16,161, 62,175, 19, 11, 7, 61, 0,166, 23, 71, 56,114,252, 9, 91,160, 41, 79,217,253, 16, 14, 88,204,118, 20,145,193, 46,187,
-175, 9, 19, 38, 72,156, 72,239, 91,175,133,102,195, 2,173,207, 58,101, 20, 52, 38,149, 74, 13, 0,136,113,227,198,137,115,115,
-115,229,106,181, 26, 70,163, 17,157, 58,117,146,244,236,217,211,233,247,189,123,247,110,203, 41,103, 78,121,141, 30,117, 12,128,
-189,125, 38,250,162, 41, 58,188, 54,225,156, 60,233,176,219,223, 52,215,159,154,112,253, 97, 5,142,162, 40,138,206, 17, 96,161,
-144,153, 3,230,156,109, 27, 0,176,107,215, 46,194, 85,109,141,233, 53, 0, 80, 86, 86,134, 54,109,218, 80,149,149,149,104,213,
-170, 21, 50, 50, 50, 92,210,215,113,222, 44, 7, 65, 16, 24,253,122, 12,237,134,193,210, 37,211,204,223, 29,205,152,233, 42, 72,
-165, 82,114,237,137,181, 46,149, 57,105,210, 36,147,215, 69,230, 9,192, 96,218, 40,169, 84, 74, 90, 92,227,208, 3,203,118,223,
-110,106,201, 61,180,171, 63, 61, 61,157,144, 30,123,139, 98,201,255, 17, 40, 0,207, 16, 26,220, 72,159,214,252,227,174,190,175,
- 71,224,133,121,164,229,102, 26,227, 55,255,199,245,235,215,159,240, 27, 33,137,167, 91, 94, 77, 89, 57,154, 81,174, 78, 44,172,
-181,142, 5,101,235,156,201,242, 78,121, 30, 58,146,251,247,239,155,223, 71,118,118,182,203,222,137, 76,182,150,146, 74,167, 17,
-191,255, 38, 99,244, 3,103,151,119,117, 6,166,105,125, 46,239, 19,234, 83,174, 29,236, 55, 60, 80, 19, 83,164,183, 48, 66,205,
-227,252,172,219, 31, 76,235,212,195, 21,243,113, 86, 52, 22, 44, 88,176, 96,193,130,197,211, 1, 14, 91, 4, 44, 88,176, 96,193,
-130, 5,171, 0,176, 96,193,130, 5, 11, 22, 44, 88, 5,128, 5, 11, 22, 44, 88,176, 96,193, 42, 0, 44, 88,176, 96,193,130, 5,
-139,231, 2,181,102, 1,208, 57,175,157,129,173, 96, 66, 86, 30, 43,143,149,247,248,228,197,198,198,214,214,238, 57, 28,115,118,
- 57,203,169,102,116, 54, 69,203,169,103,182,210, 7,123,122,122, 66, 40, 20,154,127,207,225,112,192,229,114, 31,146, 71, 47,204,
- 68,146, 53,179,188,234, 90, 44,135,125,191,117, 67, 38, 91, 39,230,242, 4,160, 72, 3,166, 78,125, 63,197, 25,121,107,215,174,
-149,100,100,100,240,194,194,194,146,173,179,238, 57, 41, 79,156,145,145,129, 53,107,214,164,176,237,237,217,147,231,176, 2,240,
- 79, 68, 96,224,251,181, 10,174,164,100, 3,241, 84,201,123, 63,144, 2,128,146, 13, 37,132,229,247, 6,136,108, 96,114,207, 71,
- 46,239, 31,139,245, 43,150,137,139,175,156,193, 0,191, 98,121, 51, 67, 30, 50,169, 54, 56,167,244,151,120,135,190,140,153,115,
-230,165,216,251,253,169, 83,167,208,175, 95, 63, 51,241,211,132, 77, 16,196, 67,132, 77,146,164,121,187,123,247,174, 77,121,231,
-207,159, 71,120,120, 56, 68, 34, 17,120, 60, 30,184, 92,110, 45,153, 52,233, 27,141, 70,243,166,213,106,145,158,158,142,118,237,
-218, 61,119,239, 71, 38,147, 17, 82,169,148, 90,187,118,173,248,230,205,155,184,117,235,150,220,215,215, 23, 91,183,110,109, 80,
-253, 95,183,110,189, 88, 32,244,135,175,223, 11,114,101,117,129,100,221,186,159,197,171, 87, 59,150,251, 97,205,154, 53,226,132,
-132,132,227,153,153,153, 56,112,224, 0, 66, 67, 67, 49,119,238, 92,174,229,220,123, 39,228,201,179,111,103,161, 93, 72, 91,240,
- 5, 2,204,154, 53,251,213,152,152, 24, 57,219, 82,159, 83, 15,192,179,132, 33, 67,134,216,213,120,142, 30, 61,106,183, 97,210,
- 4,109, 77,220,206,194,213,242, 30, 1, 8, 7, 73,219,110,106, 89, 23,203, 99,242,123,235,255,127,182,137,101,237, 90,241,181,
- 83, 71,144,187,227,123,185, 74,165,133,254,101, 14, 68,205, 9,180,207,189,132,151,188, 40,121,121,241, 95,104,186,246, 63,146,
-113,211,190,172, 87, 9,184,118,237, 26,184, 92, 46,250,247,239, 15, 30,143,103,222,104,133,128,182,250, 13, 6, 3,140, 70, 35,
-244,122, 61,238,222,189,139,227,199,143,219,148,167, 82,169,112,225,194, 5,244,238,221, 27,124, 62, 31,110,110,110,181,100,146,
- 36, 9,131,193, 0,131,193, 0,189, 94, 15,181, 90,141, 11, 23, 46,160,186,186,250,105, 32,107,142,169,110,112, 0, 24, 26,146,
-135, 94, 38,147, 17,177,177,177,100,108,108, 44, 2, 2, 2,240,239,127,255, 27,227,199,143, 71, 85, 85, 21, 2, 2, 2,156,202,
- 64, 26, 16, 16, 96,190,159, 5, 11, 62,195,150,109,233, 16,137, 26,129,203,229,203,171,171,242, 28,150,153,150,150,134,234,234,
-106,244,238,221,251,238,224,193,131,155,148,150,150,226,200,145, 35,198,169, 83,167, 98,253,250,245,245,182, 17,109, 78,214, 67,
-101,115,249,198, 13,164,120,185, 99, 78,220,151,121,221,123,116,105,113, 47,191, 8, 71, 18, 83,142,111,223,190, 99,112, 84,212,
- 91,199, 88,234,124,250, 65,167,254,181,242, 20, 48, 82, 0,172, 83,183,218,219,127,236,228,255,193, 7, 31,212,123, 77,121,121,
- 57, 0, 80, 76,148, 0,154,172, 27,106,173, 63, 10,121,150,150,191, 11,172,127, 71, 73,155, 41, 89,187, 90,158,229,181,150,159,
- 0,128,178,178,154,204,136,254,254,201,207, 69, 67,205,249, 51, 25,237,242,228,242, 60, 21,137,177,237,184,120, 33,200, 0,210,
-159,130,155, 63, 23, 85,165,124,136,170,212,232,152,177, 82,190, 37, 46, 86,242,206,236, 69,117, 42, 1, 4, 65,224,250,245,235,
-224,243,249,120,245,213, 87,205,164,237,230,230, 6, 14,135, 3,138,162,160,215,235, 97, 48, 24,160,213,106,145,151,151, 7,185,
- 92, 94,231,146,202, 28, 14, 7,122,189, 30, 25, 25, 25,232,223,191, 63, 68, 34, 17, 4, 2,129, 89, 30,173, 0,104,181, 90, 84,
- 87, 87,227,242,229,203,208,104, 52,230, 97, 2, 38,136,138,138, 18,115,185, 92,121, 85, 85, 21,248,124, 62,138,138,138, 62, 28,
- 59,118,108,149, 80, 40,220,226, 12,105, 71, 69, 69, 77,224,114,185, 59, 19, 19, 19,105,121,153, 99,199,142,189, 41,147,201,198,
- 75,165, 82,157, 51,150,112,108,108,172,124,209,162, 69, 69, 48,173, 56, 19, 27, 27,139,107,215,174,161, 81,163, 70, 8, 11, 11,
-195,230,205,155, 29, 38,255, 95, 38, 79,198,136,238,221, 1, 0,141,103,206,132,200, 61, 24,213,149,185,168, 84,220,150,196,196,
- 76, 73,169, 43,159,123, 93,120,241,197, 23, 81, 84, 84,132, 83,167, 78,181,226,112, 56,184,124,249, 50,252,253,253,145,154,154,
-138,119,223,125,151,202,200,200,168,247,247,165,223,206,169,181,239,169,211,163,169, 65,131, 89,159, 44,108, 17,183,244,191,248,
-126,233,106, 52,227, 24,177,122,233,178,228,119,223,125, 23,246,228,177,120,250,200,159, 62,206,116, 45,128,135,242,127,219,219,
-127,156,112,229, 74,125,207, 2, 44,149,128,199,228, 9,112,212, 82, 39,236, 88,231,206,200,179,245,249, 92, 37,174,250,113,201,
- 55,226,208,140, 95,228, 69, 92, 35,218,249, 0,173, 90, 82,224,190,200, 7,175,109, 91,240,181, 26,104, 79,231, 65,171,224,129,
- 75,186, 65,147,188, 69,190,126,213, 82,201,212, 25,182,135, 3,104,247,124, 86, 86, 22,252,252,252, 32,145, 72, 32, 20, 10,193,
-231,243,193,227,241,204, 86,191, 70,163, 65, 97, 97, 33, 78,156, 56, 1, 14,135, 3, 14,135,131,250,228, 25,141, 70, 92,189,122,
- 21,253,250,245,131,183,183, 55,132, 66, 33,184, 92, 46, 12, 6, 3,116, 58, 29, 42, 43, 43,241,215, 95,127, 65,171,213,130,199,
-227,153, 99, 1,236,161,127,255,254,226, 27, 55,110,200,239,220,185,131,202,202, 74,240,249,124, 52,110,220,120,229,201,147, 39,
-209,167, 79, 31,158, 76, 38,219,232,136, 18,208,191,127,255, 49, 55,110,220,216,105, 37, 47,244,228,201,147,161,125,250,244,217,
-110, 82, 2, 24,201, 91,179,102,141, 88,167,211,225,254,253,251,180,203,219, 92, 72,139, 22, 45, 42,136,141,141,109, 54,126,252,
-248, 87, 63,254,248, 99,135,250,191,245, 63,111, 20,127, 54,127, 94,173, 99,247, 87,172, 64,227, 55,154,227,251,239,127,148, 76,
-158,252,182, 83,253,233,169, 83,167,228,127,254,249, 39, 62,251,236,179, 74, 46,151,235, 45, 20, 10,209,167, 79, 31,200,229,114,
- 36, 38, 38,162, 89,179,102, 14,180, 60, 2, 91,179,238, 97,207,173, 2,236,251,125, 51,184, 92, 2,115,102,190, 67,118,107, 28,
-200, 89, 55,107, 33,214, 59, 42,143,197, 19, 33,127,107, 37,210,150, 82,224,244, 44,128, 39,189,188,109,126,185,231,118, 0, 0,
- 32, 0, 73, 68, 65, 84,219,182,109, 37,246,182,199,109,173, 63, 10,121, 46,180,250,153,146,182, 51,100, 13, 75,235,156,182,208,
- 77,114, 40, 39,229,213,217, 81,251,251, 39, 59,101,253,175, 90,181, 74, 60,101,202, 20,170,174, 99,214,231,234,130,229,245,171,
- 86,173, 18, 91,159,179, 62, 86,111,121, 93, 61, 47, 47, 44,168, 68, 35, 47, 30,218,122, 81,224, 5,146,224,189,242, 26, 60,186,
-109,129,168,199, 15, 16,248,136,192,175, 86, 67,165, 50,162, 37, 87,133,212,248,186, 83,201,114, 56, 28,240,120, 60,184,185,185,
-225,214,173, 91,184,124,249, 50,188,189,189, 17, 16, 16,128,128,128, 0, 4, 6, 6,194,215,215, 23, 10,133, 2,169,169,169,224,
-114,185,230,177,125, 91,160,207,243,249,124, 24,141, 70,100,102,102,194,221,221, 29,129,129,129,104,212,168, 17,130,130,130,224,
-233,233,137,204,204, 76,232,245,122,243, 16, 65, 93, 10,133,181,229,255,224,193, 3,249,237,219,183,209,166, 77, 27, 12, 27, 54,
- 12,189,122,245,130, 74,165,194,241,227,199,145,145,145,177, 65,163,209,188,237,128,229, 47,121, 80, 84,252,107,246, 61, 5,188,
-218,245, 70,232,176,247,209,172,215,104,148,107, 57, 56,154,124, 12, 25, 25, 25, 99, 53, 26,205, 84,166,228, 95, 89, 89,137, 75,
-151, 46,201, 79,157, 58,133, 23, 95,124, 17,177,177,177,129, 0, 72,147, 7,160, 25, 0, 8,133, 66,198,100,189,254,231,141,226,
-173,241,251,197,254, 1, 93,228,241, 59, 46, 97,242, 47,191, 32,241,194, 5, 36, 94,184,128,198, 51,103, 2, 0,244,122,229, 9,
-103,218,220,235,175,191, 78,237,219,183, 15,227,198,141,187,235,229,229,197,113,119,119, 79, 79, 75, 75,195,169, 83,167, 80, 82,
- 82,130,208,208, 80,199,148,210, 11,183,176,244,143, 43, 88,191,116,193, 37, 30, 87, 13,142,177, 10,223, 45,255,133,179, 51, 53,
- 29,133, 28, 30, 94,120,225, 5,150,101,159, 19,240,156, 37,248, 39,181,120,197, 35,179,176,255,217,138,192, 35, 25, 87,111,160,
-171,158,176,115,220, 33,165, 98,233,210,165,226, 99,199,142,201,179,178,178,234, 60,150,150,150,198, 72, 22,125, 93, 90, 90, 26,
-202,202,202,228, 75,151, 46,149,204,155, 87, 99,149,219, 58, 86, 31,188, 53,165, 72,204,213,160, 89, 57, 23,221,189, 9, 4, 21,
- 3,237,120, 62,224, 16, 1,160, 52, 15,160,124, 64,224,106, 46,137,251, 74, 13,120, 28, 14,186,250, 11,228,117, 61,183,165, 2,
- 32, 16, 8,112,251,246,109, 52,107,214, 12, 67,134, 12, 1,151,203, 5, 73,146, 40, 45, 45,197,169, 83,167,224,230,230, 6, 62,
-159, 15,157, 78, 87,167, 2, 64,123, 7,104, 37,128,162, 40,100,103,103,163, 93,187,118,240,241,241, 65,117,117, 53, 46, 92,184,
- 0,163,209, 8,129, 64, 0,173, 86, 11,173, 86, 91,103,223, 65, 7,209, 1, 64,113,113,177, 60, 63, 63, 31,221,186,117,131, 88,
- 44, 70,243,230,205, 37, 74,165, 18, 65, 65, 65,242,228,228,100,156, 61,123, 22,190,190,190,189,101, 50,217, 54,169, 84,106,119,
-125,247,226,226,226,227, 15,202, 20,240, 15,237,141,182,253,223,132,111,243, 80,104,149, 21,200,253,243, 32,110, 29,219, 76,203,
- 99,244,126, 77,177, 15,242,194,194, 66, 4, 7, 7, 67, 40, 20, 74, 46, 93,186, 36,143,141,141,229,152, 60, 0, 0,112, 35, 54,
- 54,150,100, 82, 7,127,222,176, 89,236,235,247,130,220,215,255, 5,112, 56,110,208,235,149,216,176, 81,142,201,239, 73,104,143,
- 2,166, 78,157,138,160,160, 32,210,209,182,247,206, 59,239, 80,241,241,241,232,223,191, 63,122,244,232,209, 10,128,225,216,177,
- 99,225, 57, 57, 57, 16,137, 68, 16,137, 68,136,136,136,120,117,215,174, 93,199,153,200,219,118, 51, 15, 63,252,117, 3, 63, 47,
-158, 95,214,252,133, 86, 47, 42,171,203,241,251,161,191,112,233,242, 77,248, 82, 36,248,247, 31, 32,226,195,232,193, 59,119,238,
-250,103,185, 96,159, 33,216, 26, 62,170,203, 43, 80,151,170, 78,140, 31, 63,222,210,130, 38, 34, 35, 35,235,219,127,102, 81, 82,
-178,129,176,220,158, 54,121,192, 35,113,255,215,103,181, 55,232,158,157,181,206, 29,241, 0, 56,138,168,168, 40,241,254,253,251,
-107,145,191,173, 99,206, 32, 43, 43, 11,251,247,239,151, 71, 69, 69,137,235, 59, 86, 39,113,149,228,225,204, 61, 53, 84, 70, 18,
- 39,243, 72,220, 55,240, 96,212,166,163,252,218, 7,216, 60, 51, 6, 7,142, 40,112,185,148,194,197, 98, 3,174,150, 26, 80, 90,
-120,191, 94,175,156,165, 18, 32, 20, 10,113,247,238, 93,220,184,113, 3, 64, 77, 92,204, 31,127,252, 81,107, 44,191,190,241,122,
-130, 32,204, 94, 0, 90, 30, 69, 81,200,203,203, 67,203,150, 45, 81, 88, 88, 8,146, 36, 33, 20, 10,205,178,234, 27, 82,176, 68,
-110,110, 46, 52, 26, 13,194,195,195,209,188,121,115, 9,151,203,133,183,183, 55, 94,126,249,101,137,167,167, 39,114,115,115, 81,
- 89, 89,121,153,105, 61,200,205,205, 5,201,225,163, 89,216, 96,248, 54, 15, 5,135,235, 6,145,119, 16, 90,190, 28, 1,190,135,
- 31, 45, 47,199,158,156,181,107,215,138, 43, 42, 42,228, 5, 5, 5,104,209,162, 5, 36, 18,137,100,203,150, 45, 41,165,165,165,
- 4, 0,244,238,221,219, 96,186, 52,212,199,199, 7, 50,153,204,110,192,131, 80, 24,128,128,160,110, 48, 26,180, 40,186,151,134,
-251, 5,167, 6,149, 20, 95, 88, 96,146, 7, 0,120,112,255, 62, 76,242,220,152,214, 61,169, 84, 58, 62, 62, 62, 30,209,209,209,
-152, 56,113, 34, 0,144, 71,142, 28,225,237,223,191, 31,147, 39, 79, 30,122,254,252,121,226,244,233,211, 68,108,108, 44,163,200,
-253,204, 74, 21,230,159,184,136,111,231,198,160,255,200,193,254, 70,202,128, 93,191,158,192, 79, 43,183,224,208,236,119,177,190,
- 91, 75,180,244,225, 97,193,130, 88, 54, 8,240, 25,193,197,139, 23,235, 36,255,122, 61, 0,214, 99,251,246,246,159, 71, 60,130,
- 41,120, 78,225,235,151,190,150, 76,155, 54,237, 89, 40,239, 90, 67, 10,143, 56, 72,143,209,123,136,136,136, 16,223,186,117, 75,
-174,211,233,234, 61,214, 16,148,151,151, 67,169, 84,202, 35, 34, 34, 36,121,121,121, 15, 29, 59,120,240, 96,157,239, 46,163, 76,
- 13,133,142, 68, 70,177, 1,133, 21, 6, 4,255,193,195,139,187,178,112, 55,231, 42,110,254,169,131,129,199,133,142, 4, 52, 58,
- 10,229, 20,137,160,122,150,181,167,167,251,209, 99,247,116,196,254,131, 7, 15,208,170, 85, 43,228,228,228,152, 93,254, 60, 30,
-207,124,189,163,195,121,150, 57, 4,232,207, 71, 52, 36, 88, 1,215,198,124,216, 37,107,146, 36,161, 84, 42,107, 58, 71, 30, 79,
-242,193, 7, 31,212,122,119, 85, 85, 85,188,125,251,246, 97,244,232,209,156,249,243,231, 63, 88,178,100,137,193, 94, 93, 36,136,
- 26,133, 72,173,122,128,234,170, 60,201,148, 41,239,166,200,100,178, 84, 0,223, 86, 85, 85, 97,223,190,125,102,197,177, 93,187,
-118, 58, 38,117,123,241,226,197,163,191,255,254,251,132,136,136, 8,244,235,215, 15, 0,200,211,167, 79,115,126,251,237, 55,136,
-197,226,145,171, 86,173, 58,234, 72,193,220, 83,105,241, 78,226, 31,152, 53, 33, 2,227,223, 25, 7,149,166, 18,123,247,165, 96,
-249,234,109,248,223,208,151,208,182, 40,159,101,211,231, 64, 25, 96,234, 1,112, 53, 40,171,134,108,111,159,133, 5, 30, 53,249,
-187,208,106,175,203,163,224,236,248,127,125,245,130, 81,125, 57,120,240, 96, 74,251,246,237, 37,126,126,126,245, 30,107, 8,252,
-252,252,208,190,125,251, 90, 68,111,235,152, 45,168,141,222,208, 19,192,185, 18, 45,138,140, 70, 28,203,214, 96, 87,130, 6,199,
-243,131,144,197,247, 65,190, 66,143,188, 42, 18, 74, 3,160, 50, 80, 16, 4, 52,182, 75,204,244,252,126,163,209, 8,131,193,128,
-128,128, 0,120,122,122,162, 85,171, 86,208,235,245,230,227,182, 18, 2, 89,203,163,231,247, 27, 12, 6,168,213,106, 80, 20,133,
- 22, 45, 90,160,160,160, 0, 77,154, 52, 1,143,199,131, 86,171,133, 78,167, 51,255, 47,147,225,193,150, 45, 91, 66, 40, 20, 34,
- 61, 61, 29,249,249,249,114,163,209,136,202,202, 74,226,207, 63,255,148, 87, 87, 87,163,101,203,150,240,246,246,126,141,105, 31,
-213,178,101, 75,112, 72, 29, 10, 46, 36,163, 34, 63, 19,164, 81, 15,117,101, 49,114,255, 60, 8,157,178,156,150,215,154,137,114,
- 67, 35, 32, 32, 64,190,102,205, 26,179, 23,167,180,180,148,184,122,245, 42, 76,164, 77, 2, 8,182,149,240,200, 26, 6,131, 26,
- 6,125, 53, 68, 30,141, 33, 20,249, 67, 38, 91, 39,150, 74,165,134, 69,139, 22, 5, 88,200,195,250,245,235,161, 80, 40,232, 41,
-140, 15, 97,209,162, 69, 84,223,190,125,169, 30, 61,122, 80, 95,126,249,229,239,163, 71,143,198,200,145, 35, 1, 0,231,207,159,
-175,220,191,127, 63,198,143, 31, 63,250,216,177, 99, 7,153,148,217,162, 69,139,168,126,253,250, 81,111,125,240, 33, 94,221,125,
- 2,243,254, 53, 22, 31,125, 58, 29, 26, 93, 53,238,220,206,131, 76,182, 11,191,141,234, 3,113,139, 70, 78,183,141,225,195,135,
-179,253,250, 19, 68, 88, 88, 88, 45,210,183, 14, 4,124,172,169,128, 35, 35, 35,197,142,236, 63, 54, 75,191,142, 57,251,214,214,
- 62, 83,235,191, 46,121,239, 7, 6, 82,239, 7,254,237,206,183,222,183,231,137,112,149,188, 58, 44,105,103,136,250,145,193, 74,
-137,112,218, 3, 0, 0,219,183,111, 79, 25, 53,106,148,196, 50, 57,141,173, 99,206,160, 93,187,118, 24, 53,106,148,100,251,246,
-237, 41,245, 29,171,243,247,237,219,161,189, 7, 23, 94, 4,160,167, 40, 92, 47,215, 33, 62, 75,139,237,103, 10,241,215,237, 50,
- 20,170,129, 82,141, 17,183,171, 41,220,211, 82,168,214,233, 37,245,145, 23, 61, 53, 79,167,211, 65,173, 86,163, 73,147, 38,232,
-210,165,139, 73,209,243, 71,175, 94,189,204,132, 77,147,118, 93,132, 77, 19,186, 94,175,135, 78,167, 3, 65, 16, 8, 9, 9, 65,
- 69, 69, 5,242,242,242, 80, 86, 86,134,214,173, 91,131,195,225, 64,167,211, 65,171,213,154,127, 99, 15, 65, 65, 65,146,230,205,
-155,227,234,213,171, 56,124,248, 48, 14, 28, 56, 32, 63,112,224,192,241,147, 39, 79,130,203,229,226,149, 87, 94, 65,219,182,109,
-213, 48, 5,222, 49,144, 55, 58,216,223, 7,165,217, 23,113,243,232, 70, 92, 61,184, 6,215, 15,202,112,247,236,111, 16,112, 72,
- 90, 94,129, 61, 57, 51,102,204, 72, 9, 14, 14,150,120,123,123, 35, 35, 35, 3,249,249,249,242,184,184, 56,177,165, 34, 96,242,
- 4,112,226,227,227,209,185,115,103,187,247,166,211, 42,160,168,200,130,155,155, 7,124,253, 59,200, 61, 60,155,225,151, 95,182,
-138, 9,130,211,155,190,198,171, 34, 25,242,255,125,132, 33, 29,170,235,172,219, 7, 15, 30,132, 72, 36, 66,231,206,157,209,186,
-117,107,122,248,192, 80, 94, 94, 94,189,123,247,110,223,176,176,176,209, 59,119,238,220,207,180,238, 38, 38, 30,132,183,183, 39,
- 6, 12,124, 89, 21,214,227, 69,140,249, 96, 50, 84,132, 1,197, 69,101,152, 54,243, 43, 44,233,217, 14, 61, 26, 57,175, 36, 15,
- 31, 62,156,250,238,187,239, 88, 37,224, 41, 81, 4,108,225,169, 89, 11,224, 73,207, 42,112,134,128, 29,197,134,146, 26, 5,194,
-146,168,233, 99, 79,131,188,167,213,163, 96,229, 9,160, 28,241, 0,208,152, 55,111, 94,202,160, 65,131, 36,189,122,245,170,243,
-152,229,185,250, 96,121,253,160, 65,131,106, 5,251,217, 58, 86,175,117, 40,240,144,116,109, 18,136,190, 1, 2,188,228,199, 71,
- 83, 33, 7, 2,138,130, 80,107, 64, 75, 79, 30,202, 41, 10, 87,170, 13,200, 84, 26,208,172, 81, 0, 90,191, 52,176, 78, 89,180,
-213, 79, 79,245,107,217,178, 37,186,117,235,134,242,242,114, 84, 84, 84,160,162,162, 2, 94, 94, 94,232,221,187, 55,116, 58,157,
- 57, 39, 64, 93,132, 77, 43, 19,122,189, 30, 4, 65, 32, 52, 52, 20,106,181, 26,197,197,197, 40, 42, 42, 66,113,113, 49,148, 74,
- 37, 66, 67, 67,193,227,241,204,242,234,202, 43, 96,173,148, 5, 7, 7, 75, 66, 66, 66,112,231,206, 29, 36, 37, 37, 33, 45, 45,
- 13,238,238,238,120,245,213, 87,209,173, 91,183,131, 66,161,112, 14,211,105,123,219,183,111,223, 31,220, 40,232,237,144, 38,190,
-168,190,253, 39, 50,147, 54,160, 32,237,119,248, 9,140, 24, 60,232, 85,116,235,214,109,210,199, 31,127,188,143,137, 44,111,111,
-111,244,232,209, 3, 20, 69,225,204,153, 51, 72, 79, 79,151, 23, 20, 20,200,191,253,246, 91,113,108,108,172,132,206,156,216,179,
-103, 79,164,166,166,218,149, 55,117,234,228, 20, 69,121,150,164,172,248, 50, 4, 66,127, 52,110,250,138, 60,168,113, 47,185,151,
-119,235,131,223, 47,253,105, 20, 45,111,251,199,238,216,113, 90,139,186,148,158,204,204, 76, 4, 6, 6,162, 95,191,126,228, 75,
- 47,189, 4,149, 74, 5,165, 82,137,149, 43, 87,122,118,232,208,225, 13,185, 92,190,223,145, 54,113,243,102, 38, 90,181,108,142,
-183,222, 26,237,254,249,191,103,161,180, 74,129,146,210, 18,196,124,244, 21,190, 26, 51, 8,131, 90, 6, 55,136,252,151, 47, 95,
-142, 46, 93,186, 96,197,138, 21,172, 18,240, 24, 97, 57,238,111, 15,143, 45, 19,160, 43,103, 21,152,146,251,184, 36, 19,160, 61,
- 88, 39,226,113,133, 18,224, 74,178,118,181, 60, 87,188,106,184, 32, 61,176,149, 2, 65,212,225,177,112, 8, 51,102,204, 72,177,
-254,157,229,177,159,127,254,153,145, 76,250, 58, 91,215, 51,149, 65, 99,211,246,157, 41,243,223,153, 0, 67, 90, 34,114, 20,128,
- 39,225,134, 86,158, 28, 20, 24, 9,112, 5, 60,164, 22, 25,161, 33,129, 32, 1, 23, 33, 61, 7,224,227,165,235, 83,234, 83, 0,
-244,122, 61,184, 92, 46,218,180,105,131, 30, 61,122,160,178,178, 18, 26,141,198, 60, 63, 95,167,211,193,223,223, 31,253,250,245,
-195,254,253,251,205, 67, 2,182, 96, 52, 26,205, 89, 4, 59,118,236, 8,147,155, 30, 26,141,198,220,158,105, 79, 66,199,142, 29,
- 81, 86, 86,134,234,234,234, 58,219,178, 53,153,159, 60,121, 50, 37, 42, 42,234,213,206,157, 59, 31,183, 72, 4, 84,209,191,127,
-255,227, 66,161, 48, 90, 42,149,106, 28, 41,203,147, 39, 79,198, 71, 69, 69, 85,118,238,220,121,159,133,188,146,254,253,251,175,
-252,248,227,143, 25,103,235,153, 62,125,122,202,154, 53,107, 36,195,134, 13,195,157, 59,119,228, 55,110,220, 64,110,110, 46,188,
-188,188,228,190,190,190, 24, 50,100, 8,126,254,249,103,244,236,217,147,241,189,189,255,254, 59, 41, 63,255,188, 73,162,209,148,
-193,215, 47, 84,238,233,213, 2, 94,222, 45,161,172, 42,216,191,120,201, 6, 68,189, 53, 24,219, 63,118, 55,151,147, 45,139,109,
-196,136, 17, 72, 76, 76, 68,126,126, 62,167,172,172, 12, 26,141, 6,169,169,169, 60,147,210, 89,121,250,244,105,135,218, 67, 68,
-196, 8,236,221,187, 31,149, 21,165,200, 47,188,135,143,103,252, 75,247,201,103,139,248, 99, 94,237,131,126,218, 74,192,205, 57,
-122, 24, 62,124, 56,245,197, 23, 95,152,211, 65,135,132,132,224,187,239,190, 3, 0,234,208,161, 67,108,218,240, 39,164, 20, 60,
- 73, 5,128, 24, 63,126,188,165, 11,141,176,114,247, 19,142,186,255, 93, 65,238,102,146, 47,217, 0,123,217,246, 28, 9,254, 43,
- 41,217, 0, 75, 87,188, 37, 49, 91,187,236,153,144,118,201,134, 18,151,202,123, 6,240,143,234, 36, 90,247,145, 72, 46,105, 13,
-242,226,227,199,224,102, 80,227, 82, 21,133,228, 42, 3,248, 4,129, 0,138,130,164,137, 47,252, 26, 7, 73,154,191, 44, 6, 54,
-237,180,235, 1,104,221,186, 53,122,245,234, 5,181, 90, 13,189, 94, 15, 62,159,111, 38,108,218, 74, 15, 10, 10, 66,223,190,125,
-145,148,148, 84,175, 7,128,199,227,161, 91,183,110, 32, 8, 2, 42,149,202,236, 93,160,149,118, 58,187, 32, 73,146,232,218,181,
- 43,254,248,227, 15, 56, 18, 92,185,125,251,118, 57, 0, 66, 38,147, 17, 0, 60, 81,147,109, 47, 87, 42,149,234,157, 41,203,237,
-219,183,239, 55,201,243, 4,224, 15,160, 76, 42,149, 58,156,155,120,250,244,233, 41, 0,176,106,213, 42,137,155,155, 27,178,179,
-179,225,239,239, 47, 7,128,130,130, 2, 12, 31, 62, 28,203,150, 45,115, 72,230,148, 41,147, 82,100,178,117, 98,157, 78, 33, 17,
- 85,230,200,189,125, 67,224,238,217, 20,238,158, 77,113,228,216, 3, 16,131,234,183,184, 55,111,222, 76, 76,157, 58,149, 42, 43,
- 43,195,136, 17, 35,116, 1, 1, 1,124,146, 36,145,155,155,235,176, 71, 12, 0, 54,109,218, 76, 72,165, 49,148,247,181,116,204,
-152,241, 62,154,135,182,231,127, 55,235,125,114,211,234,205,156,149, 92,141, 83,117,121,248,240,225,212,252,249,243,225,235,235,
-139,194,194, 66,136, 68, 34,144, 36, 9, 15, 15, 15,124,243,205, 55,172, 18,240, 24, 16, 22, 22, 86,167, 23,128,105, 42, 96,151,
-227, 41,159, 85, 64,148,108, 40,177,121,194, 73,235,159,216, 80,242,176, 60,107, 75,157,118,221, 51, 32,109, 87,203, 99,241, 20,
-193, 68, 54,196,155, 17,195,197, 62, 6,173,156,123, 55, 27,237,244,247,224, 21, 16,140, 62, 93, 59, 32,160, 89,160,228,211, 53,
-219, 82,118,164, 77,183,235, 69,107,211,166, 13,250,245,235,103, 30,143,231,114,185,208,106,181,230,212,189,150,195, 4, 45, 90,
-180, 64,223,190,125,145,146, 98,187,233,137, 68, 34,132,133,133,129,199,227, 65,167,211,153,127,103, 57,117,208,114, 33, 32, 14,
-135,131,238,221,187, 35, 61, 61,221,225, 50, 48,121, 7,170, 76, 91,131, 97, 34,253, 6, 47, 74, 96,242, 16,153,219,225,154, 53,
-107,196, 42,149, 10, 90,173, 22, 29, 58,116, 64, 92, 92,156,220,177,251,138, 73, 1, 0,153,108,157, 68,173, 46,134, 64,224, 7,
- 55,190,151,156,195,225, 97,107,252, 65,201,219,209, 17,245,202, 91,191,126, 61, 33,147,201,136, 31,126,248,129, 84,171,213, 0,
-128,208,208, 80,135,210, 47, 91, 66, 38, 91, 71,252,252,243,250,225,147,191,248, 33,177, 70, 30,197, 9, 13,125, 1,161,111,188,
-241,246,140, 25, 51,226,157,145,185,100,201, 18,182, 81, 63, 37, 74, 64,125,228,255, 88, 21,128,103, 21,174,156,246,103, 77,204,
- 13, 37,106, 23,202,115,181,194,192, 42, 32, 78, 96,231,193, 67, 41,181,202,174, 50, 23, 39,239,228, 50,254,125,100,100, 36,252,
-252,252,204, 17,254, 36, 73,154, 93,248,180, 7,128, 14,250,163, 87, 4, 12, 9, 9, 1, 65, 16,216,177, 99,199, 67,242,150, 47,
- 95,142,132,132, 4,243,181, 70,163,209,238,114,192,124, 62, 31, 61,123,246, 4,147,232,248,103, 88, 89,107,112, 93,167, 21,129,
- 26, 82,223,128,154,112, 44, 82,206, 68,158, 73, 89, 34, 0, 96,205,154, 53,212,244,233,211,137, 99,199,156,159,154, 63,101,202,
-212, 67, 38,175, 9,135, 36, 73, 35,135,195, 17, 57, 58,252, 66,131,181,238,159, 46, 37,192,110, 71,237,236, 58,194, 44, 88,176,
- 96,193,130, 5,139,103, 23, 28,182, 8, 88,176, 96,193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88,176, 10, 0, 11, 22,
- 44, 88,176, 96,193,130, 85, 0, 88,176, 96,193,130, 5, 11, 22,207, 5,106,205, 2,184,120,241,162,211, 17,156,182,130, 9, 89,
-121,172, 60, 86,222,115, 41,143,122,253, 13, 41,126,255, 77, 6,153, 76,198,177,149,173,143, 45, 63, 86, 94,203,150, 45,205,215,
-228,230,230, 18, 79,155,188,231,253,125, 56,172, 0,208,141,187,158,235,157,185,193,103, 89,158, 51, 50,159,246,231,173, 5,153,
- 76,198, 7,224, 13,192,221, 84, 31, 72, 0, 37,206, 36, 79,121,196,160, 92,245,204,117,148,233, 19,153,190,180,116,233, 82,241,
-153, 51,103,228, 39, 78,156, 0, 0, 12, 28, 56, 16,125,250,244, 97,156, 74,248, 73,188,135,215,223,144, 98,196,240, 30, 6, 64,
-202,147, 74,165, 36,216,105,159, 44,172,208,178,101, 75,106,212,168, 16,243,254,254,253,160,236,145,182, 61,121, 11, 22,244, 55,
-239,127,251,237,201, 6,201, 99, 81,183, 2, 0,106,215,195, 11, 64, 16, 19,202, 27,242, 63,132, 19,196,251,216,228,217,122,222,
- 6, 62,243, 83,253,188, 52,241, 95,189,116,114,227,174,237, 43, 7, 53,110, 22, 18,172, 80,232,225,227,227,134,251, 5,183,201,
-206,157,187,149,201,100,178, 94, 82,169,244,142, 35, 50,165,147,186, 81,217,183, 51,113, 59, 71,131,188,123, 20, 90, 52, 33, 16,
-210, 90,136,182, 33,161,144,109,202,120, 90, 26,171, 45, 69,130, 94,107,224,177,223,227,229,203,151,229, 97, 97,135,177,118,173,
- 10, 41, 41,192,194,133, 71,144,151,151, 39, 31, 53,106, 20,132, 66, 33, 10, 11, 11, 37, 99,198,140,129, 43, 20,130,183,223,126,
-155, 82, 40, 20,146, 33, 67,134,224,163,143, 62, 74,113,162,206,112,164, 82, 41, 70, 12,239, 65,198,196,196,240,128,117,248,253,
- 55, 64, 38,147, 17, 76,115,246,179,248,231, 64,167,155,143,164,164, 24, 12, 27,182, 14,163, 70, 45,193,254,253, 53,109,207, 89,
-226,190,121,115, 14,126,253,117, 12,198,142,221,139, 5, 11,106,148,128,134,200,123,222,193, 38, 2,114,132, 97, 45,200,158, 32,
- 0,114,167,223,115,251,172, 43, 87, 44,123,231,192,190, 95, 98,219,181,107,223, 97,236, 27, 3,209,162,153, 55,124,125, 4, 40,
-175,208,160,224, 94, 11,206,173,236,242,192, 3,251,126,145,175, 92,177,236,135, 15,103,206, 89, 97, 79,222,199, 31, 78, 20,223,
-201, 60, 32, 47, 42,204,192,155, 17, 64,223,112, 32,164, 21,144,149, 67,225,212, 57, 53, 18,229, 25, 24, 61,212,155,106, 19, 58,
- 82,242,227,202,109,206, 18,153, 43, 45,127,194,134,236, 39,162, 4,148,149,149,225,163,143, 84, 8, 10, 2, 34, 35,129,197,139,
-171,113,225,194, 5, 24, 12, 6, 8,133, 66, 52,106,212, 72,126,224,192, 1, 76,157, 58, 85,178,126,253,122,135,202,110,250,244,
-233,226, 43, 87,174, 32, 56, 56, 88,190,123,247,110, 98,235,214,173, 0, 32, 79, 78, 78,198,251,239,191,143, 13, 27, 54, 56,250,
-172,124, 0, 72, 60,116,158, 3,172, 35,107, 62, 31,206,241,207,130,181,254, 1, 96,220,184, 61, 72, 74,170,249,140,137,185, 13,
-218, 35,224,168, 55,128,150,247,206, 59, 91,240,235,175, 53,159, 99,198,156, 4,237, 17, 96,189, 1,245, 19,191,229,113,107, 37,
-128, 13, 2,180,225, 5,120,158,201, 95, 38,147,241,142, 38,237,250, 92, 50,160, 71,135,177, 17,161,232,214,185, 17, 2,252, 68,
- 32, 64,192,219, 83,128,208, 16,127, 12, 25,216, 26, 3,251,117,111,117, 52,105,215,231, 50,153,172,177, 61,153,119, 50, 15,200,
-251,135, 87, 98,215, 74, 96,114, 36,208,193,228,249,243,112, 7, 58,182, 3,190,156, 13,244,238, 86,137, 59,153, 7,228, 13,121,
- 69, 13,245,122,216, 81, 36,158, 72, 7,226,239,239,143, 3, 7, 68, 40, 46, 6, 18, 18,128,242,114, 30,218,181,107,135,145, 35,
- 71,210,203,189, 34, 37, 37, 5,233,233,233,242,165, 75,151,138,153,202, 29, 54,108,152,248,234,213,171,114, 62,159, 47, 47, 47,
-175,237,201, 82,171,213,216,176, 97, 3, 36, 18,137,163,229, 73, 2,192,239,191,201,144,120,232, 60,231,247,223,100, 13,122,246,
- 41, 83,166, 80,244, 86,223, 49,134,245,130,114,226, 88,189, 88,183,118,173,120,221,236,217,226,139, 83,167, 82,121, 35, 70, 80,
-103, 39, 77,162, 86,125,244,145,120,221,218,181,226,134, 60,115, 67,235,140, 45, 25, 76,143, 61,106,121,180,235,127,212,168, 16,
-196,196, 36,213,250,164, 49,106, 84, 72,173,241,124,123,242, 22, 44,232,143, 5, 11,250, 99,204,152, 95,107,125,210, 88,176,160,
- 63, 99,121,255, 36,132,133,133,213,218,108, 41, 7,172, 2,240, 52,176,192, 99,196,213, 75, 39, 23,183,107,215, 46,180, 87,143,
- 38,181, 43, 2,135, 0,159,207,133, 72,200,131,155, 27, 7, 33,109,252, 16, 18,210,174,209,213, 75, 39, 15,200,100,178, 58, 61,
- 69,210, 73,221, 40, 46, 42, 49,123, 50,160,209, 2,119,242,128,114, 5, 80, 81, 9,108,219, 7,204,252, 2,136, 93, 10,244,233,
- 1,112,168, 74, 72, 39,117, 99, 27,170, 5,186,118,237, 42,249,253,247,142,104,212, 8,152, 56,145,135,198,141, 95,194,192,129,
- 3, 37, 7, 14, 28, 32, 70,142, 28, 41, 25, 54,108, 24,130,131,131,113,254,252,121,236,220,185, 83, 62,110,220, 56,241, 79, 63,
-253, 84, 47, 1,245,239,223, 95,172,213,106,229,110,110,110,245,254,183, 92, 46,199,160, 65,131,152,144, 25, 21, 29, 29, 77, 73,
-165, 82,157, 41,102, 4, 22,228, 79, 0, 64,116,116,180,195, 10, 90, 90, 90,154,121,171,239,152,147,205,150,104, 72,243, 94,183,
-118,173,184,237,141, 27,242, 49, 23, 47,202, 91,100,102,129, 95, 89,137, 38,153, 55, 32,254,227,172, 60, 40, 35, 67, 46,115, 82,
- 9, 72, 75, 75,195,148, 41, 83,168,153, 51,103, 58,173, 68,208, 50,152, 28, 99, 42,207,154,232,153, 28,179, 7,154,244,233, 79,
-221,168,118, 13,106, 43, 52,233,211,159, 55,123, 5,177, 29, 72, 61,196,207, 4,207,170, 2, 64,217,216, 92, 38,248, 17,222, 31,
-229,226,219,164, 28, 45,139,171,215, 50,134,135,134,248,155, 73,223,214, 50,205, 66, 1, 15, 6, 3,137,208, 16,127, 92,189,150,
- 17, 2,192,167, 46,121,217,183, 51, 17,241,106,205,247,195,169,192,251,159, 1,107,183, 1,133, 15,128, 27, 89,192,133,171, 20,
-146, 79, 3,199,206, 0,195, 6,214, 92,223, 0,221,140,120,132,175,248,137, 40, 38,243,230,205, 75,169,174,174,137,183,156, 56,
-113, 34,206,158, 61, 75,200,100,178, 20,250, 92, 89, 89,153,164, 99, 71, 30,166, 78, 5,186,119, 63, 7,163,241,134, 60, 63, 63,
-191, 78, 79,202,244,233,211,197, 4, 65,200,153, 46, 14, 83, 84, 84,100,215, 43, 19, 29, 29,141,248,248,120, 0,160, 82, 83, 83,
-117, 22,239,130,160,137, 63, 62, 62, 30,209,209,209, 79,178, 63,112,246,152, 77,104,175, 92, 65,155, 63,255, 52, 45,130,164,131,
-129, 36, 65,234,141, 32,245, 6, 4,157, 76, 69, 37,195,245,214,235, 34,220,191,254,250, 75,254,202, 43,175, 60,114, 37,192, 25,
-239, 66, 67,201, 95, 55,170,157,205, 45, 41, 38,201,169,123,186,217, 43,200,230,246,235,152, 95, 89,182,111, 32,108, 42, 0,196,
-132,242,135, 54,103, 9,135, 1, 33, 58, 42,143,168,103,123, 42,148, 13,106,151,159,205,173, 1,202,203, 67,215,219,249, 15,155,
-144,201,100,188,198, 77, 67, 58, 53,109,236, 9,138, 2, 82,207,228,225,240,177,108, 28, 62,150,141,162, 18, 21, 40,138, 66,110,
-126, 37,153,114, 58, 23, 89,119,202, 17, 24, 32, 66,211,166,237,124, 81,179, 68,171, 77,220,206,209,160,111, 56,160,213, 3,135,
- 78, 0,242,179, 20, 86,108, 6,110,100, 3,131,250, 1, 29, 66, 8,240,184, 53, 75,139,247, 14,171,185,158,225,179, 58,243,157,
-169,165,104,203, 61,252,196, 28, 64,166,229, 92,241,226,139, 47, 74,172,207,113,185, 92,121,167, 78, 69, 88,184, 16,248,207,127,
- 40, 52,109,154,137,156,156,156, 58,101,105, 52, 26,187,150,191, 37,234,147, 69, 35, 62, 62,158, 38,123,179, 34, 64,111, 22,196,
- 79,152,174,123, 18, 78, 59,235,246,207,244, 88,157,104, 95, 82, 42,215,233,245,208,233,245,208, 25, 77, 43, 40,146, 36, 72,163,
- 17, 70, 35,137,230,247,238, 53,100, 56, 11, 42,149, 10, 74,165, 82, 62,101,202, 20,106,234,212,169, 13,242, 38,184, 74, 9,112,
-149,229, 79, 19,253,184, 61,127,127,167, 63,157,241, 2,208, 68,255,206,150,191,191,211,159,172, 23,192, 62, 44,151, 6,102,180,
- 28,112, 93,179, 0, 26, 48, 59,160,174, 40,118,103,162,219,169,122,254,131,114,224,255, 25, 61,183,141,223, 50,106, 92,245, 4,
- 21, 58, 35,175,206,223,208,255, 67, 0, 32,119,217,141, 93, 32,107,162,253, 5, 0,128,188,194, 74,168,213, 6, 0, 64,187,182,
-126, 8, 10, 16, 33,227,106, 17,231,230,173, 50, 8,133, 92,132,180,241, 69,185, 66, 7, 0,117, 10,206,187, 71, 33,164, 85,205,
-255,191, 54, 0, 8,235, 68, 64,192, 7, 12, 6, 96,104,127,192,215, 11,200,206, 5,134, 13, 0, 90, 53,175,185,254, 9,163, 46,
- 37,224,185, 24,253, 41, 42, 42,114,168, 29, 86, 85, 49, 95,125, 55, 62, 62,158,136,142,142,166, 76, 74,128,165,119,224,137,151,
- 93,219,182,109,169,236,236,108,194,217,243,214,112,187,157, 5,173, 94, 7,130,203,131,145,162, 64, 0, 48, 24, 73,232, 13, 36,
- 40,163, 17,196,173,155, 46,185,239, 43, 87,174, 32, 48, 48, 80,254,221,119,223, 73, 62,253,244,211, 20,103,149, 0,235, 97, 20,
- 71,137,219, 85,228,159,155,155, 75,180,108,217,146, 26,183,231, 97,133, 96,216,186, 97,224,239,207,194,254,253,183,205,145,251,
-246,198,238,105,121,239,108,121, 88, 33, 24,187,119, 44, 94, 72, 43,198,183,223,158,100, 44,239,159, 72,254, 52,158,167, 89, 0,
-245,145,168,195, 4,219,192, 41,142,117,203,125,196,179, 9,136, 9,229,142,254, 7,225,227,227,134,242, 10, 13, 2,253,221, 17,
-249,255,237,125,121, 92, 84,213,251,255,251, 14, 48, 12, 48, 40,184, 34, 26, 9,238,226, 26, 46,168, 89,140,185,141, 8,184,145,
-125,202,210,180,152,248,148, 89,185,160,150,102,125,234,167,144, 38,159, 44,117, 76, 83,250,182,104, 35, 26,226,134, 81, 67,105,
-106, 37,110,185,148, 2, 38, 38, 34,137,178, 13, 51,204,114,207,239,143,153,139,151, 97,150,123,103, 6,177, 62,247,253,122,241,
- 98,230,204,153,103,206, 61,231,222,243,126,158,231, 60,231, 57,241, 61, 97, 52,209,240,245,245,130,151, 72, 4, 66, 8, 38,142,
-237,130,216, 49, 93, 64, 81, 64,249, 29, 45, 90,182,244, 1,128,219,246, 4, 62,208,129, 66,225, 85,130,158, 93,128, 81,195,204,
-157,253, 91, 1,208,175, 39, 16,220, 2,144,199, 0, 52, 13,120,123, 1,151,174,152,235, 23, 93, 35, 92,199,150,207,107,119, 31,
-252,102,217, 6,184, 97,195,134,152,213,171, 87,163,176,176, 16, 63,252,240,131,250,189,247,222,147, 73,165,210,250, 99,103, 77,
- 38,147,236,194,133,118,234,183,222,186, 14,138,162, 80, 86,214, 29,221,187,119,198,165, 75,182,151, 82,104,154,182, 89,254,216,
- 99,143, 53,234, 31, 66, 8,190,251,238, 59, 94,215,204, 86, 2,238, 39,242,247,132,146,192,198,237, 78, 29, 33,254,237,119, 16,
- 31, 64, 76, 19, 80, 20, 96, 48, 25,161, 39, 38,212, 26,141,208,118,237, 9, 92,248,205,237,182,247,233,211, 7, 20, 69,185, 68,
-254, 0, 48,100,200, 16,108,222,188,153,234,215,175, 31,113, 84,230, 12,155, 55,111,166,172, 9,223, 86, 25, 31, 36,229,220, 37,
-126, 0, 16,103, 23, 52,248,156, 9, 24,204,206, 46,228, 36,111,242,174,187,196, 15, 0, 61,126,254,171,145,188, 37, 75, 70, 98,
-229,202,195, 2,243,115, 32,127, 64, 8, 2,180,229, 30,100,187, 9,221,154,220, 8, 1, 68,211,239, 52, 89,163,201, 87,193,230,
-223,224,174,192,120,151, 94, 47,188,117,237,186,217,234,123,127,195, 47, 56,125,174, 12, 6, 3, 13,154, 38, 22,165,133,170,143,
- 13,184,118,189, 26,165,215, 11,175, 0,176,107, 86,118,233, 44,193,143,249,230,215,109,162,128, 83,231,129,164,127, 1, 93, 31,
- 52,187,253,223,249, 16, 16,251, 0, 34, 17,240, 99,190,185,190, 27, 4,237,233, 24, 10,235,241,190,231,214,195,133, 11, 23, 32,
-145,152,251,100,223,190,125,248,252,243,207,213,121,121,102, 46, 88,189,122,117, 76,171, 86,173,212, 23, 47, 26,241,241,199,192,
-169, 83,131,224,229,213, 83,214,169, 83, 39,153, 61,121, 1, 1, 1,156,127,219,104, 52,254,237, 31, 92, 54,249, 71, 68, 68, 16,
-123,127,124,149,133,194,182,237,100,119,244,117,168,210,235,161,213, 27, 80,103, 52,194, 64, 76,168, 53, 24, 80,173,215,163, 36,
- 52, 84,230, 78,187,253,253,253, 17, 16, 16, 32,219,188,121, 51,197,119,123,167, 53,209, 59, 43,227,163, 4, 12, 25, 50,196,105,
- 25, 23, 47,128, 61,242,103, 91,255,124,228,217, 35,127,182,245, 47,128, 31,249, 11, 10,192, 61, 64, 83,111, 41, 36, 95, 5,131,
-128,179,162, 97,140,140,236, 95, 82,112,229, 14,104,154, 96,241,188,104, 92, 42,184,141,139,151,202, 65, 81,104, 16, 16, 72,211,
- 4, 5, 87,238, 32, 50,178,255, 57, 0,118,253,196, 17, 93,186, 99,223,119,128,201, 4,144, 34, 64,125, 12,200,254, 22,144, 63,
- 11,200,158, 4,242,142,155,235,153, 76,192,190,239,204,245,155, 17, 4,142,115, 1,220,115,220,190,125, 91,221,171,215, 21,252,
-252, 51,112,236,152, 9,157, 58,157,197,169, 83,167,212,113,113,113,100,239,222,189,234,156,156, 28,220,188,121, 19, 15, 61,244,
- 16,166, 79,159, 46,203,204,204,204,115,148,196,135, 16, 34,179,231, 5,176, 6,163,120,240, 5,179, 4,192, 94, 10,104, 46,176,
- 45,250,162,162, 34,202,222,159,173,250,142, 16, 60,112, 32,202, 71, 62,130,219, 90, 29,238, 24,234,160, 51, 26, 81, 99, 48,161,
- 82,175, 71,245,168,199,208, 38, 42,202, 69,175, 32,133, 33, 67,134,160,111,223,190,178, 99,199,142,229,185, 35,131, 77,244,182,
-202,220, 81, 2,216,115,129,173, 50, 46,176, 69,254,140,165,110,157, 41,144, 11,108,145, 63, 91, 30,123,107,160, 64,254,206,201,
- 95, 80, 0,254,238,110, 11, 38, 72,147,227, 50,128, 66,161, 48, 69,246, 27, 57,170,176,176,224,183,159,242, 75, 64,211, 4,242,
-209, 17, 56,123,190, 12,239,190,127, 12,239,172, 57, 90, 79,254, 63,229,151,160,176,176,224,106,100,191,145, 47, 41, 20, 10,131,
- 61,153,202,109,103, 40, 19, 90, 96,237, 39,102,146,223,248, 14,240,233, 46, 64, 22, 13, 12,236, 13,228,125,105, 46, 95,251, 9,
- 96, 66, 11,119, 50, 2,186, 27,232, 73,156,200,105,150,181, 67,141, 70,131,190,125,117, 24, 60, 24, 24, 60, 24, 24, 52,136,160,
-168,168, 8,217,217,217, 56,126,220,172, 61,197,196,196, 32, 42, 42,138, 83,122,224,204,204,204, 60, 46,196,110, 52, 26, 17, 24,
- 24,200,219,138,181, 68,253,215, 71,252, 51,239, 93,181, 96,153, 63, 71,101,124,148, 0, 79,212, 3, 0, 69,114,114,158,126,232,
- 80,217,197,177, 99,100,165, 61,122,160,212,199, 7,165, 61,123,226,210,184,113, 50,211,176,104,153,194,178, 68,195, 23,131, 7,
- 15,134, 59, 86, 63, 91,134,179, 50,174,125,104,203,234, 31, 60,120,176,211, 50, 87,192,228, 8,184,155, 20,168,208, 45, 11,158,
-201, 17,192, 74, 10, 36,120, 4, 56,146, 63, 32,100, 2,108, 82,203,252,126,252, 13,133, 66, 81,254,225,186,247,211,115, 14,238,
- 88,248,231,141,234, 46, 93,195,131, 17, 59,182, 11,130,131, 36,184, 83,161,195,169, 95,111,162,224,202, 29, 20, 22, 22, 28, 29,
- 55,126,250, 46, 0,215,156,201, 12,239, 62, 81,118, 56,127,175,250,104,126, 21, 98, 71, 1, 31,175, 52,103, 2, 44,188, 10,108,
-249,202,108,249,155,208, 2,225,221, 39,202,112,232, 11, 79, 16,184,167,191,219,108,187, 0,110,220,184, 33, 11, 14,110,163, 62,
-113,194,108,213, 92,186,212, 2,131, 7,247, 70,235,214,173, 33,145, 72,112,227,198, 13,217,196,137, 19,121,165, 2,238,220,185,
-179,236,247,223,127, 87,219,179,216,140, 70, 35,186,118,237,138, 45, 91,182,240, 34, 33,235,181,127,214,123,226, 74, 44,128, 45,
-107,213, 85, 11,214, 25,185,243, 33,127,182, 18,208,224,190, 56,123,214,237,241,118,215, 66,231,211,111, 92,127,203,211,242, 28,
-145, 63, 27,250,184,174, 0,199,245,127,123,228,207,134,176, 35,192,190, 39,192,158, 98,224,109,207,178,228, 83,206, 99, 2,246,
-148,213, 69, 92,252,236,158,180,207, 73, 63,121,164,125,238, 4, 46,190, 52,247, 53,165, 82,169,220,126,254,236,225,245,187,179,
-190,143, 8,233,216, 37,154,117, 22,192,241,200,200,254, 63, 79,140,159,189, 84,161, 80,104,184,200,179,164,247,165, 20,179,250,
-147, 29,251, 46,225,255,125,100,231, 44, 0,215,201,223, 35, 14,147,251,141,252, 1,224,137, 39,158,192,153, 51,103,240,236,179,
- 39, 0, 0,131, 6, 13,194,227,143,247,151,189,250,234,171,245,228,252,227,143, 63,242,146,185, 97,195,134, 60, 0, 84,108,108,
-108, 76,117,117,181,218,203,203, 11, 34,145, 8, 70,163, 17, 98,177, 24, 82,169, 84,230, 46,249, 3,240,136, 18, 32,224,159,137,
-226,226, 98, 42, 39, 41,135,132,206, 13,149,161,179,237, 58, 37, 73, 57,106,174,214,122,113,113, 49,181,107,242, 46,210, 45,181,
-155,236,215, 32,219,117, 46, 79, 62,172, 22,172,127,126,240,230, 49, 81,122,122,226,109, 10,121,212,125,222,190,251, 65, 30,227,
- 9,168, 84, 42,149, 51, 34,251,141,100, 50,198, 72, 1,180, 1,112, 3,128,214,114,202, 27, 47, 88,187,247,139,174, 17, 20, 93,
-211, 2,135,207, 52,119, 63, 80,247,186,127,185,194, 66,244,245,109, 56,119,238,156,199,100,239,219,183, 47,207, 83,215,199, 90,
-247,167,172,202, 41, 88,242, 1, 8, 16, 96, 77,218,197, 11,139, 61,246, 76, 23, 23, 23, 83,197,255, 42,198,253,250, 44,223, 47,
-224,154, 5, 16, 0, 40, 87,207, 17, 22, 32, 64,128, 0, 1, 2, 4,252,125, 33, 4, 1, 10, 16, 32, 64,128, 0, 1,130, 2, 32,
- 64,128, 0, 1, 2, 4,131, 1, 0,215, 0, 0, 32, 0, 73, 68, 65, 84, 8, 16, 20, 0, 1, 2, 4, 8, 16, 32, 64,128,160, 0,
- 8, 16, 32, 64,128, 0, 1, 2,254, 25,104,176, 11,224,244,233,211, 46, 71, 81,218, 10, 38, 20,228, 53,153, 60,167,135,216, 52,
-167,188,196,196,196, 24, 0,106,149, 74,229, 17,121,211,167, 79,143,161,105,218, 99,242,132,251,175,121,228, 37, 39, 39, 79, 87,
- 40, 20, 95, 53,101,251,148, 74,165, 15, 0,137,229,158,214, 1,160, 1, 16,133, 66, 65,132,241, 16,228,253, 47,201,243,148, 7,
-128,112,248,227, 3, 79,203,187,103, 32,183,211, 8,169, 73,231,220, 62, 11, 17,122,236,122, 89,242,176,102,205, 26,153,131,254,
-228, 45,239,220, 71, 45,224,174, 60, 6,147, 6,239, 87,135,183,200, 6, 0, 68, 69, 69,185, 61,158,221,219,239,192,131,109,191,
-133,159,159, 31, 70,143, 30,125,223,220, 31, 74,165,178, 45, 21, 32, 61,168, 84, 42,219,122, 72, 94,152,200,215, 63,199,158, 60,
-165, 82,233,163, 84, 42, 41, 39, 50,124,152,182, 73, 36,254, 7,149, 74,101, 91,165, 82,233,229,236,123,174, 60, 14, 46,220, 27,
-199,154,106, 44, 54,109,218, 52, 97,243,230,205, 11,124,124,124,118,139,197,226,124,177, 88,252, 27, 0,165,151,151,151,138,162,
-168,245, 74,165,178, 77, 19,244,129, 0, 1,141, 80,187,104, 17,241,240,131,214,100,115,158,179, 76,128,132, 16,251,191,205, 51,
- 55, 52,177, 8,244,148, 60, 94, 22,172, 39, 49,109,218, 52, 82, 80, 80,224,148, 92, 85, 42,149, 58, 37, 37, 5,237,218,181,179,
-153,114,117,254,252,249,156,207, 20,103,228,173, 89,179, 70, 54,127,254,124,245,241,227,199,213, 86,138,128, 75,242,232, 11,203,
- 33,234,253, 54, 62,253, 78, 15, 0,160, 47, 44,191,171, 29,246,126,155, 87,191,124,249, 94, 0,161, 9,176,253,160, 89,150,252,
- 81, 31, 68,118, 61, 15,192,172, 4,228,231,231,243, 26,155,180,143,100, 49, 21,127,148,163, 70, 31,172,214,212, 5, 64, 62,174,
- 2, 29, 67, 40,132,135,207, 36, 85, 85, 58,236,216,177,163, 89, 39,244,228,121,243, 94, 6, 77,143, 77,158, 55,239,101, 0,203,
-220,150, 55,119,222,243,132,166,199, 36,207,181, 45,207, 81, 74,102,118, 29,165, 82, 73,205,157, 59,239,101,154, 54,141,157, 59,
-119,222,203,122,189,110,153, 13, 69, 65,228, 74,174, 7, 55,161,103,223,127, 59,119,238, 84, 79,153, 50, 69,150,153,153,153,231,
-142,208,205,155, 55,203,189,189,189, 31,241,246,246,126,194,203,203, 43, 88, 36, 18, 73, 83, 83, 83, 69, 11, 23, 46,156,109, 50,
-153, 96, 52,227, 9,147,201, 20,167, 84, 42,127,180,120, 3,244,150,249,175,201,151, 65,227,227,227, 9,215,249, 46, 43, 43,139,
-215, 61,157,144,144, 64,220,249,190, 0,207,195, 47, 45,205,163,242,180,139, 22, 1,110,200,100, 50, 2,242, 61, 14,216, 41,249,
- 71, 69, 69, 33, 63, 63,159, 15, 57, 59, 36,121,142,242, 26,201, 79, 73, 73, 65, 81, 81, 17, 44, 46, 98,143, 29,235, 74, 74,162,
- 8,252,186,131, 10,254,146, 2, 0,170,213, 34,106,218,180,105, 78,181, 49, 54, 89,151,149,149,169,237,145,127, 74, 74, 10, 82,
- 83, 83,121,145,191,229, 61,162,163,163,101,209,209,209,110,201, 99,200,158,249,191,234, 63,104, 64,254,139,166, 74,144,150,169,
-227,212, 87,219,211,165,164, 79,184, 8, 26, 45,193,107, 79, 75,112,252,188, 17, 90, 13, 65,173, 30,144, 13, 56,143,243,151, 76,
-136,138,138, 34, 92,149,128,148, 55,122,146,194, 83, 85, 8,108, 33, 70, 72, 7, 41,218,182,239,138,171,133,122,116,238,109,128,
-143,164, 12,185,187,111, 97,252,248,241,228,224,193,131,205, 53,225,249,182,106,221,122,222,103,199,127,166,228, 61,186,189, 12,
-224, 29, 0,117,238,200,107,221,170,245,188,237,223, 29,167,198, 12,232,225,150, 60,133, 66, 33, 14, 9,233, 48,239,144,250, 48,
- 53,168,127,164, 77, 89,205, 64,254, 0, 80,127,252,160, 74,165, 82,199,197,197, 33, 51, 51, 83,109,235,121,253,229,151, 95,200,
- 91,111,189,133,189,123,247, 58, 28,223, 45, 91,182,140, 18,139,197,125,196, 98,241, 92,177, 88,236,127,237,218, 53,116,235,214,
- 13, 94, 94, 94, 8, 12, 12, 68, 65, 65, 1,164, 82,169,247, 47,191,252, 18,116,236,216,177,195, 47,190,248, 98,103, 0, 87, 1,
-136, 97, 94, 30,176, 59,241,177,231, 63,246,188,197,148, 83, 20, 5,138,131,213,178,103,207, 30,187, 50,216,229,142,230, 91,123,
-200,202,202,114,235,251, 77,170, 32, 39, 39,199, 88,178, 82,186,141,183,223,126,155,208, 52, 13,136, 42,160,175,211, 65,236, 43,
- 1,232, 32,136, 68, 34, 44, 95,190,156, 58,102,197, 51,201, 14,100,157, 63,127,158,100,102,102,194,158,188,169, 83,167, 34, 50,
- 50,146,114,181,125, 88,158,142, 21,111,191, 66,216,237,115,231,218,253,211,210,120,127,223, 94, 26, 96,174, 10, 0, 39,242,231,
-138,148,148, 20,167,117,184, 16,151, 61,242, 95,181,106, 21, 22, 47, 94,108,173,116,184,212,233,228, 68, 20, 65,235,238,160,194,
-191,164,216, 22,255,206,157, 59, 41, 0, 96,254,219, 91,115,177, 38,107, 71,228,111,241, 12, 56,181,218, 85, 42,149,218,218,194,
-103,202,216,125,204, 87,158, 35, 11,127,209, 84,238, 39,197,101,166, 7,144,110, 15,138,224,231, 75,225,193, 80, 47,220,186, 67,
-195, 96,244, 66,121, 5, 65,101, 13, 65,193,159, 52, 32, 2,218,248,159,101,250,199,225,164,176,244,245, 30, 49,221,187, 68,224,
- 88,233, 77,132,135,181, 69,159,126, 17,240,242,109,133, 7,195,239,224,142, 86,135,178, 82, 19,254,188,169,131,191,119, 17, 39,
-121, 77,132,167,158, 94,184, 80, 92,212, 33, 20,190, 81,131, 68,186,195, 63, 60, 5,224, 19,190, 66, 88,150,248, 83, 51, 95, 94,
- 32,254, 83, 28, 2,105,247,135, 68, 85,231,142,184, 36,143,105,219,139,243, 94, 21,195, 55, 16,225, 61, 34, 69,191,255,122,210,
- 29, 89,158, 4,205,178,254, 33,145, 72,100, 0,212,214, 99,120,226,196, 9, 78,228, 15, 0, 62, 62, 62, 65, 18,137,100,214,173,
- 91,183,252,187,119,239,142,129, 3, 7,194,219,219, 27, 31,124,240, 1, 76, 38, 19,250,246,237,139, 93,187,118,225,151, 95,126,
-193,217,179,103,225,229,229,181, 94,169, 84, 38,108,216,176,193,145, 85, 93, 63,207,121,194, 99,169, 84, 42,101, 33, 33, 33,106,
- 66,136,195,239,148,150,150,202, 20, 10, 5,223,251, 71, 22, 18, 18,162,118,245,251, 12, 81, 95,188,120,209,225,188,209,171, 87,
- 47, 25, 95, 50,191,120,241,162,250,201, 39,159, 68,203,150, 45,101,238, 40, 2,138, 23,102,146,164,228,177, 8, 8,240,107,244,
-153, 70,163,197,242,229,203, 49, 12,160,254,220,179,135, 92,139,143,183, 63,183,207,232,110, 30,204,149,147,209, 97,212, 68, 72,
- 30, 26, 4, 83,247,200, 6,117, 12,219, 51, 16,188,114,242,221,186, 0,180,227,159,195,240,213, 95, 56,108,223,204,103,199,160,
- 85,107,127,115,193,242,116,204, 95,240, 44, 0,224,118,121, 45,174,151, 20, 18,229,198, 12,151,149,128,218, 69,139,136, 43, 74,
-128,171, 10, 0,225, 98,169,223, 47, 40, 42, 42,194,226,197,139, 93, 85, 32,236, 98,218,180,105,132, 10,221, 73, 77,155, 22, 78,
- 84,155,134, 0,219, 30, 38,148,244, 21,167,131, 96,139,172,173, 73,217,209,178,128, 61,176, 21,138,227,199,143,171,163,163,163,
- 27,184,254,249,202,251, 98,161,212,238,228,246,212,106, 13,103, 57, 27, 54,108,136,241,245, 90, 8,145, 8,240,247, 3, 42,170,
-104,212, 17,130, 0, 63, 10, 58, 26,208,214, 17,116,106, 43, 2,109, 4, 46, 95, 51,161,168,168, 72,237, 72, 57,155,247,242,152,
-152,240, 7,253,213, 98, 49,193,243,179,134,194,100, 34, 40, 45,211,163,248,122, 5,224,115, 13,126,193,117,184, 81,246, 7, 68,
-226, 74, 92,184, 80,129,150,193,142,229, 53,157,249,223,106,249, 19,207, 60,227,251, 6, 13, 4, 47,126, 93,122,243,204,233,101,
-116, 85,149, 43, 36, 75, 0, 64,210,178,213,242,127,205,120,198,119,245, 21, 19, 58, 77, 79,145,254, 94,116,118,153,169,182,161,
- 60,165, 82, 73, 89, 7,179,217, 66,139,150, 65,203,159,154,241,180,239,217,226, 59,136,127, 50, 73,250,225,127,230, 47,211,214,
-106,220, 85, 0,184,158,151,225,104, 44, 76,204, 51, 50,113,226, 68, 48,164,175,213,106,235,199,144,177,252,179,179,179, 57,141,
-169,175,175,239,112,141, 70,211,179, 87,175, 94,144,201,100,152, 63,127, 62,230,204,153, 99,158,204, 13, 6,108,219,182, 13,249,
-249,249, 56,121,242, 36,118,236,216, 1,173, 86,219,149,166,105,185, 19,139,221,163,247,211,190,125,251, 56, 45,205, 81, 20,197,
-251, 94,102,203,118,229,251,150,103, 56,239,201, 39,159, 68, 73, 73,137,205,207, 67, 67, 67,225, 42,129,151,148,148,160,164,164,
-196, 45, 69,224,236,153, 75,248,191,140,189, 24, 57,114, 56, 34,251,118,188,107,201,255,122, 29,135, 15, 31,197,176, 97,195,136,
-106,201, 18, 92,139,143,135,223,136, 17,208,218, 57, 59,131,250,236, 18, 5, 0, 11,134,247, 33,253,202, 14,226,233,239,246,194,
-212, 61, 18,218, 5, 43, 0, 0,126,171, 87, 64,122,233, 60, 22, 22,137,177,250,232,185,187,253,248,217, 34,135, 65,118, 76,251,
- 70,143, 25,209,168,125,185,223,252,136,179,103, 46,185,117,255,184,178,164,192,118,247, 59,242, 6,120,243,181,216, 61, 77,180,
-238,194,226,246,119,125, 86,139, 2, 65, 7,128,218,107,126,112,168, 65,249,212,180,105,225,245,131,189,115,231, 78, 10,155,134,
- 16,107, 79, 0, 87,178, 46, 43, 43,107, 64,206,174,144, 53, 87,176,148, 14,167, 36,193,197, 93,200,114,255,219,172,188,113,227,
- 70,242,215,249, 87,209,161,187, 23, 52,218,187, 85,180, 38, 2,157, 30, 48, 88,202, 12, 70, 2, 34, 50,191,254,245,108, 62, 18,
- 19, 19, 99, 46, 95,190,108,243, 55, 3, 3, 43,213, 26,173, 8,109, 90, 5,161,226,118, 45, 42, 42, 43,112,252, 68, 41,174,223,
- 36, 16, 7,212,162, 99,215, 26,104,107,111,161, 91, 63, 3, 58,247,170,195,142,143,243, 49,121,242,228,152, 43, 87,174,220,147,
-251,205, 98,177,143,158, 56,117, 90,251,146,150,193, 40, 52, 2,126,163,199, 66, 20,220,186, 13, 93, 85, 53, 22,192, 33,134,172,
- 1,248, 40, 20, 10,189,179,121, 31,192,152,184,201, 83,219,255, 37,106,137,171, 53, 6, 4, 61, 52, 26,222,129,193,109, 76,181,
-119,229, 1, 0, 23,242, 7, 48,110,210,228, 41,237,137,151, 47, 42, 53,117,232, 19, 53, 12,210, 22, 45,219,104,107, 53, 13,100,
- 53, 23, 24,235,159,162, 40, 76,156, 56,145, 0,192,222,189,123,145,152,152, 24,147,146,146,162,230, 67,254, 74,165,210,183,162,
-162, 98,166,193, 96, 16,249,251,251,227,145, 71, 30,193,234,213,171,225,227,227, 3,133, 66,129,140,140, 12,228,231,231,227,248,
-241,227,248,246,219,111,241,235,175,191,162, 77,155, 54,109,140, 70,227,131,176,227,254,103,187, 64,157, 45, 1,136, 68, 34, 78,
-237,108,202, 37,128, 61,123,246,120,100, 9,160,101,203,150,178,146,146, 18,181,189,207,220, 29,119, 87, 20,129, 75,139, 22,145,
-242,180, 52,224,216, 49,224,216, 49,220,158, 58, 1,107,250,119,175,119,217, 71,246,238,141,199,167,199,162,243,157, 91,184, 22,
- 31,143,214,139, 22,161,123, 90, 90,163,229, 0,107,136,101, 15,163,187, 60, 6, 11, 23,189,131,247,112, 30,107,162, 71,161,207,
-224,161,232,122,187, 8,219,130, 6,162,168,229, 77,100,100,100,144,153, 51,103,114, 26, 95,217,168,254,120,122,230, 68,252,252,
-211,175, 56,152,115, 8,111, 2, 88,179,122, 43, 34,123,247,198,211, 51, 39,162, 86, 91,142, 23, 94,120,129,179, 60,107,184, 27,
- 3,192,215, 3,240,119, 2,101,135,156,120,119,244,180,105,211,136,106,241, 21,192, 75, 12, 4,249, 0, 65,157, 65,237,180, 8,
-227,184,246,223, 4, 32,108,171, 31, 0,216,150,191,141,201, 21,209,209,209, 50, 7,193,128,188,175,225,243, 5, 1,118, 61, 2,
-129, 85,243,241,135,158,160,244, 22, 13, 64, 4,169,191,217,197,105, 48, 18,232,234, 0,157, 30,208,213, 1,122, 3,160,211, 2,
-250,186,187, 94, 18, 91, 1, 41,159,127, 20, 64,114,143, 87,227,129,112, 41,136,143, 55,110,105,181, 80,127,127, 13, 23, 10,174,
-227,246,237, 26, 68, 70,153,160,209, 25,161,171, 51, 65, 91, 75,163,180, 24,208,106,128,221,187,119,171,249, 28,128,225, 14, 20,
- 10, 5,237, 21, 20,180,252,217, 37, 75, 36, 59, 88, 20, 18,188,228,117,233,237,197, 11,150,153, 42, 42, 14,177,200, 90,207,101,
-140,189,165, 65,203,231,188,186, 88,114,224,186,169,190,176,211, 19,139,165, 87,183, 44, 89,102,172,169, 56,196,199, 11,224, 47,
- 13, 92,246,242,107, 11, 36,133, 37,119, 79,139,140,123, 50, 73,186,125,211,154,101,181, 53,213,135,220,124,214,108,221, 75,124,
-158, 53,194, 88,255, 18,137, 68,166, 82,169,242,152, 45,163, 90,173, 86, 61,104,208, 32, 62,178,140, 0,186, 2,160, 7, 12, 24,
- 64, 75, 36, 18, 81, 70, 70, 6,102,207,158,141,149, 43, 87,130, 16,130,159,126,250, 9,223,127,255, 61,206,158, 61,139,202,202,
- 74,116,235,214, 13, 85, 85, 85,254, 34,145,168,157, 51,225,147, 38, 77,178, 75,168,206,150, 6,236,185,233,239,215, 37, 0, 71,
- 94, 0,119,172,127,119, 21,129, 59, 21, 21,245,175,219,189,254, 2,250,188,158,140,145, 86,117,174,140,159,131, 78, 63,156, 64,
-225,130,231,241, 83,104, 40, 0, 96, 24, 64, 13,176, 49,215,165,167,167,147, 78,157, 90,224,228,169,159, 17,249, 80, 47, 32,237,
- 13,188,186,101, 55,102,117, 57,131,254,117, 5, 88,120, 83,140,255,124,190, 20, 43,223,221,128,179,191, 30, 65,122,122, 58,121,
-229, 21,251, 94, 95,182,188, 86,173,253, 49,126,194, 80,140,159, 48, 20,111,209,233,208,215, 45,198,169, 83,192,169, 83,192,225,
-195, 19,241,225,186, 75,120,226,137,139, 36, 44,236, 65,164,165,249,243,226,167,220,135,223,192, 34,172,112,120,195, 29, 58, 52,
-252,127, 70, 1, 32,137,137,137, 50,214,154,161,181, 18, 64,177,173, 13,139, 75,222, 37,205,139, 33,253,157, 59,119, 82,170, 77,
- 67, 0,177, 24,212,206,157,247,244, 98,153,168,127,149, 74, 69, 37, 38, 38, 18,103,222, 16,235,216, 0, 62,132,110, 11,142,234,
-206, 92,162, 65,104,123, 17,158,140, 19, 67, 87, 7,180, 12,164, 32,162, 44, 86, 63, 8,116,181,128, 70, 79,160,209, 18,104,116,
- 4, 52, 1, 68, 14, 98,174,103,206,211,160,111,255, 34,132,244,188,141,111, 14,148,225,246,109, 29, 6, 12,171, 66,191, 86, 53,
-128, 79, 29,116,181, 52,202,174, 19,104, 52, 20,140, 70, 10,173,218, 80, 0,117,207, 99,217, 34, 7,246,239, 63, 40, 56, 44, 12,
- 71,239,242, 53,164, 79,206,192,237,148,249, 81, 0,122, 3,184,192, 67,161,232, 53,120,196,163,131, 90,135,134,225,196,207,245,
- 49,114,104, 43,251, 23,174,126,188,184,145, 60, 39, 94,128,222, 3,251, 15, 24, 20, 26,218, 9, 23, 78,222,245,136,140,120, 44,
- 22, 95, 42, 87,243,110, 91, 83, 42,180,204,243,107, 29,191, 17, 23, 23,215, 40,254,200, 70, 44, 0, 51,232, 93, 1,156, 94,180,
-104,209,112,111,111,111,233,167,159,126,138,173, 91,183,226,217,103,159,197,170, 85,171, 64, 81, 20,254,248,227, 15,104,181, 90,
-164,164,164,192,104, 52,226,133, 23, 94,160, 41,138,114,250, 0,120, 50,154,254,126, 95, 2,112,228, 5,240,132,245,239, 42, 50,
- 50, 50,240, 76,210,227,168,172,168, 3,222,221, 8,205,225, 19, 8, 24, 57,168,254,243,178,119, 55,226,188,175, 47,168,151,158,
- 67,159,233,227,113,108,219, 1,135,242, 46, 95, 62,135, 97, 35,228, 56,119, 62, 24, 27,215,171, 48,114,228,112,252,231,163,165,
-120,107,244, 83,248, 12, 64,207,167,103, 99,227,122, 21,196,226, 96, 36, 76, 26,132, 79,121,200,251,239,251, 95, 97,240,196,190,
-120,167,239,106,156,139,149, 34, 56,110, 87,131,186,109,252, 37,248, 57, 79,141,176,103,102,241,238,135, 35, 71,188,145,150,230,
-231,176,142,171,246,207,223,210, 3, 96, 99, 29,153,114, 80,143,187,137, 51,200, 28,161, 62,109, 90, 71, 2, 92,134,234,131, 43,
-128, 95,247,122, 79, 0,163, 20,112, 89, 6,240, 20, 24,107, 62, 49, 49,145,176,173,127,198, 35,192,126,159,152,152, 8, 86,178,
- 28,194,151,208,173,193,218, 5, 96, 83,158,209, 4,104,106, 9,234,244,230, 96,191, 58, 61,129,183,239,221,207,116,181,128,214,
- 64, 80,126,155,224,175, 59, 4, 39, 47, 24, 65,211, 64, 98, 98,162,236,242,229,203,141,198,198,104, 4, 74,174,233,113,173,240,
- 14,142, 28,187, 3, 66, 40, 92,248,141,198,196, 39,141, 16,123, 19,252,117, 19, 56,114, 8,168,170, 34, 32, 52,240,240, 40, 10,
- 18, 9, 32,151, 39,224,234,213,171,156,174, 73, 62, 12,228,192, 49,215, 39, 73,145,180,197,146,231, 87,165,250,100, 17, 81,131,
- 14,105,227,235, 11,159,151,230,249,252,177, 46,125,169,190,170,106, 6, 87,121, 94,126,210,165,201,203, 86,249, 28, 42, 33, 13,
-228,181, 14,240, 69,159,233, 47,250, 92,248,234,131,165,122, 77,205, 12, 46, 30, 0,137, 95,192,210,197,203, 87,248, 92, 41,173,
-108, 32,171, 69, 96, 0, 38, 63,249,172, 79,214, 23,159, 44,213,104, 52, 51,154,249,241,165,246,238,221,219,168,236,205, 55,223,
- 36,123,247,238, 69,118,118, 54,231,161, 0,112, 14,192,233, 53,107,214,244, 15, 10, 10,146, 50,110,240, 79, 62,249, 4,179,103,
-207,198,214,173, 91,235, 45,245, 53,107,214,160,162,162, 2, 85, 85, 85, 53,181,181,181, 69, 22, 15,130,216,209, 15,208, 52, 77,
-172, 93,244,140,245,207,213,253,207,184,233,217,114,172,221,245,247,195, 18,128, 45, 47,128,167,173,127, 70, 38,215, 37,128, 11,
-195,134,129,122,126, 58,130, 0,144, 81, 81,168, 61,121, 14,154,119, 55,222,237,183,164,199,209,237,233,199, 33,145,152,175,255,
-252,121,199, 91,179,153,207,229, 19,204, 74, 68,254,137,179,248,236,255,182,195,127,232, 16,212, 26,140,208, 67,143, 71, 30, 29,
-216,168, 62, 23,121,215, 76,122, 60,217,254, 69,208, 39,235,144,248,222, 40,136,167, 29, 71,239,200,222,136,236,211,181,190,125,
- 41, 11,215, 33, 45,237,223,156,239,155,130,170,130,209, 23,112,225,155,248, 22, 92, 60, 6,174, 37, 2,250, 91, 42, 0,249,249,
-249, 78,163,191, 45,159,115, 19,232, 27, 0, 85,231, 31,128,143,194, 9,194, 3,128, 46,117,160,122,100, 83,248, 32,170,126,237,
-223,157,101, 0,235,173,128,246,182, 6, 58,112,187,214,147,191,117, 0, 32,227, 82,103,202,156,120, 0, 40,107, 75,204,221,201,
-252,225, 71,227, 99,174,223, 56,160,166,219,210, 16,121, 3, 62,150,121,209, 64, 19, 24,141, 64,117, 53,129,222, 0, 24, 13,102,
-165, 32, 97,146,217,123, 99,199,101, 79, 69, 15,139,143,169,187,181, 95, 29, 25, 73,227,240,247, 38, 80, 34,224,175, 82, 10, 18,
- 63,224,251,131,128, 94, 75,129, 34, 64,191,135,124, 80, 82, 76,227,209, 71, 99,145,149,149,197,233, 88,107,249, 48,144,180, 23,
-205,215,239,170, 18, 64,104,211, 56, 83,235, 54,162, 3,244, 93, 22,106, 15, 32,132, 2,180, 81, 81,222, 87,140,166,113,188,228,
- 17,122, 28, 2, 91,137,212,165,166,122,121,109, 37, 64, 27, 9, 5,255,190, 81,222,231,183,211,227,172, 60, 6,196,145,172,128,
-192, 32,209,213,155, 21, 22, 98, 1, 2,253,124, 17,232, 47,198, 67, 3, 6,122,239,254,140,140,107,230, 71,215,102,159, 51, 81,
-255,236, 58,140,247,110,234,212,169,178,204,204, 76,123,242,106, 0, 92, 57,117,234, 84,205,200,145, 35,219,130,181,167,255,147,
- 79, 62,169, 39, 68,131,193, 0,147,201,132,203,151, 47,163,109,219,182,183,104,154,230,164, 45, 78,154, 52,201,158,165,238,146,
-155,254,126, 94, 2,176,229, 5,240,164,245,207,135,248, 25,116, 8, 13,194,199, 31,127,135,248,184, 97,104, 31, 21, 9, 68, 69,
-130,122,126,122, 67,165, 23,192,205, 82, 45,246,100, 31, 67,135,208, 32,238,242, 66,252, 16, 53,168, 27,162, 6,117,107, 84,143,
-175,188, 71,166,244,194,235,143,126, 0,250,156,153,252,231, 44,156,233,146, 60,107, 44, 9, 92,242,205,202,234,149, 99,154,242,
-129,116, 75, 1,176,236,217,191,167, 17,216,140,149,171, 82,169, 24,139,151,178, 81,135, 48,228,207,178,138,121,129,189, 11,128,
- 41,227,107,249, 91, 7, 0, 90, 80, 95, 54,127,254,124,181,101, 57,131,147, 60, 54,249,219,138, 9,224, 43,207, 25,210, 50,117,
-112, 38, 47, 43, 43, 43,175,117, 16,133,199,162,125, 64, 3, 48,232,105,248,138,205,221, 84,173, 33,168, 51, 16, 24, 77, 64,254,
- 57, 19, 76, 52,129,179, 45,123, 89, 89, 89,121,237,219, 82,120, 52,198, 11,147,159,242, 66, 77, 53, 65,117, 37,160,169,166, 16,
-222,141,192,100,160,224, 45,146,160,226, 54,141,146, 63,245,184,252, 27,183,128, 49,249, 48,144,244,121, 64,247, 48, 96,221,107,
-192,220,247, 93, 83, 2, 72,173,102,202, 75, 81, 3,247,135,100,237,151, 6,143,120, 24,237, 1,180,167, 0,211,209, 35,200,157,
- 57,163,198, 80,171,153,204, 71, 30,173,171,157,252,252,232, 65, 7,122,189,245,181,180, 93,191,225,104,227, 75,161,173,132,130,
-246,226,143,216,243,198,172, 26,131,182,150,179,188, 58,157,118,242,132,199, 70, 30,152,255,238,122,105,239,254, 81, 8,244, 23,
- 35,208,207, 23,133, 23, 78, 99,121,202,203, 53, 90, 30,178, 92, 37,115,103,151,107,139,252, 87,172, 88,209,200,205,191,115,231,
- 78, 38, 79, 64,158, 29,235, 31, 48,199, 88,156,238,209,163, 71,161, 78,167,235,232,229,229, 37,241,247, 55,111,197,202,204,204,
-196,212,169, 83,161,213,106,161,211,233, 80, 87, 87, 7,169, 84,170, 51,153, 76, 89,132,144, 82,142,214,181, 71,230,182,191,203,
- 18, 0,219, 11,192,188,110, 14,226,103, 16, 30, 30,130, 37,175, 39,225,224,129,159,240,245,238,147,240, 21,183,192,159, 37,119,
- 87,176, 58,133,246, 70,157,190, 10, 15, 69,245,196,218,244, 36,172,124,119, 3, 47,121,237,218,181,196,249, 11,231,235, 63,143,
-236, 29,137,178,178, 74, 94,242, 98,231, 77,198, 84,209, 12,212,157,171, 65,244,220, 62,160,251, 73,240,241,199, 59,234,219, 87,
- 89, 89,137,225, 15,247,226, 36,207, 26, 42, 74, 69,169,160, 66, 83,194,101, 5,160, 41,200,159,139, 76, 11,225, 19,203,107, 0,
- 32,236,109,137,249,249,249, 13, 8,223,150,130,208,216, 15, 75, 1, 98, 17,224,231, 5, 72,189,129,186,106,168, 86,250, 0,233,
-115, 8,252, 90, 1,126,173,120,175,253,219, 33,127,216, 32,107, 78, 15,134, 53,249, 91,199, 4,240,149,199,131,252,157,202, 43,
-175, 32,212,190, 60, 3,145, 72, 0,154, 6,250,246,240,186, 59, 30,191,154, 96, 48, 17,152,104, 47, 76,153, 50,133,147,114,114,
-243, 47, 66, 29, 56,104, 34, 70, 35,160, 55, 16,152,140,128,136, 2, 98, 98,129,234, 10, 10,191,157,209, 66,171, 19, 33, 62,110,
- 10,118,237,218,197,137,252, 87,204, 1,186,118, 50,191,239,210, 17,112,213, 19,160, 84, 42,143, 43, 20, 10,121,105,194,132, 3,
- 97,123,246, 75,195, 70, 60, 12,195,209, 35,216, 21, 55,161, 70, 95, 93, 45, 7,112,132,103, 87, 31, 49,105,171,229, 23,223,156,
-116, 32,244,189, 44,105,199,193, 35,160,185,120, 20,159,191,148, 80, 83, 87,203, 91,222, 17,157,182, 86,190,230,245,127, 31,248,
-207,127,183, 72,163,135, 13, 71,193,249,211,120, 57,105, 70, 77,109, 77,141, 43,109,107, 82, 56, 72,246, 67, 98, 99, 99,185,236,
- 6,240, 10, 10, 10, 58,173,213,106, 63, 43, 42, 42,234,220,191,127,255, 8,163,209,232,237,227,227,131,172,172, 44,140, 25, 51,
- 6, 58,157, 14,181,181,181,184,124,249,114, 85,112,112,240,119, 90,173,246, 83,154,166, 53,224,152, 1,144, 29,144,192,215,245,
-255,119, 91, 2, 96,123, 1, 60, 33,199,149,220, 1,182, 48, 94, 62, 20,227,229, 67, 45,239,220,215, 97, 27,202,155,228,158,114,
- 23,180, 19,117,103,106, 48,115,125, 44,254,243,221, 82,183,219,150,174, 79, 39,193,198, 96,204,244,159,121, 79, 12,107,151, 20,
-128,230,176,252,109, 88, 31,196,170, 61,158,178, 82,236,122, 4,184,122, 0, 60, 77,254,140,178, 99,229,222, 39,236, 50,190,242,
-156,197, 2,240,149,167,209, 17, 74,163, 3, 17,137,128, 35,249,230,181,126, 38,224,207,188,238, 63,133,151,188,234,106, 66, 81,
-150,101,118, 74,100,150,241,243, 15,128,166,134, 6,161,129,248,248, 88,236,218,181,203,233,120,200,135,129,164,204, 0,130,164,
- 64,201, 45,192,207, 23,160, 9, 16, 32, 1,222, 85,184,166, 4, 0, 56, 66, 87, 87,203,243,227, 39, 28,104,185,226,109,105,222,
-138,229, 53,117,174,145,127, 3, 37, 32,111, 81,194, 1,191,151,222,148,230,124,248,150, 43,228, 95, 47,203,104,208, 79, 88,254,
-202,243,251,231,206, 79,145,174, 95,155, 90, 83, 91, 83, 35, 87, 42,149,103,216,238, 97,165, 82,233,173, 80, 40,140,124, 29, 32,
-158,244, 10,216, 34,127,138,162, 72,108,108, 44, 0, 96,226,196,137,132,162, 40, 71,138,128, 84,175,215,215,136, 68,162,220,208,
-208,208, 78,213,213,213, 47,158, 56,113,162,195,192,129, 3,105,163,209, 88, 91, 89, 89,121,243,204,153, 51,127,132,135,135, 23,
-182,110,221,186, 72,171,213,102, 26,141,198,155, 73, 73, 73,154, 1, 3, 6,112, 82, 0,152,164, 64,238, 64,169, 84,114, 38, 84,
- 87,150, 0,220,249,190, 61, 47,128, 39,230, 76,119,229,232,180, 94, 30,173,239,105,121, 21,119, 68, 72, 53, 42, 16,113, 44, 4,
-211, 63,114,174,152, 84,220,113,126,203,221, 75,242,183,171, 0,112,216,235,207,171,129, 60,114, 7,240,145, 75,177,162,252, 93,
- 38, 47, 42, 31,212,180,240,241, 4,151, 0, 52,202,215, 80,105,249,227,183,199,220,114,189,106, 79,145,171, 85,191, 16, 38,207,
-128, 37, 64,144, 98,121, 67, 92,146,247,249,130, 0,182, 82,224,138,188,122,185, 83,167,222, 29, 19, 38,224, 79,165, 82,229,185,
- 34,143,208, 13,199,184,166, 10,136,141,141,197,190,125,251, 40,198,170,226, 52, 30,159,121,238,129, 97,229,227, 63, 98,168,174,
-150,127,191,226,205,140,186,234,234,153, 30,176,174,143,232,107,171,229,135,214,191,149,161,171,173,158,165, 84, 42,143,186, 58,
-153, 27,141,198,195, 70, 99,141,124,125,122, 90, 70, 77, 77,205, 76, 0, 71,172,101,185, 64,254,158, 64,131, 25,213,154,252,153,
-184, 29,118,144, 96, 92, 92,156, 35,121,197,122,189,222,151, 16, 82, 77,211,180, 82,175,215,255, 20, 22, 22,214,166,162,162,130,
- 90,182,108, 89, 85,101,101,101,121,199,142, 29,171,107,106,106, 52,122,189,190,202, 96, 48,212, 61,247,220,115, 90,158, 22, 54,
-229,129,123, 38,175,169, 58,180, 41,101, 55, 55,222,127,255, 35, 10, 0,121,252,137, 49,136,236, 19,110,183,222,249,115, 87,240,
-213,246,111,152,250,247, 76,222,250,245,235,235,229, 57, 52,152, 79, 20,225,171,237,223, 48,245, 29,226, 94,146,191, 61, 5,192,
-211, 13,104,178, 11,178,144, 40,101,203, 90,230, 3, 15, 71,245,115,201, 22,232,214, 15,240, 57,244,199, 19,222, 0, 23,198,196,
-238,123,119,229,237,219,183,143,215, 88,185, 19,241,207,133,180,117,213, 85, 93, 60, 41, 79, 91, 83,221,197, 67,150,220,145,154,
-234,234, 46,247,217,179, 76, 1,192,166, 77,155,136, 72, 36, 2,243,199,118, 97,203,229,114,208, 52, 13,154,166,145,148,148, 68,
- 57,217, 21, 64, 25,141, 70,127, 66,136,137,166,233, 58,131,193,240,131,151,151, 23, 37, 18,137,124, 1,248,210, 52, 13,147,201,
-228,101, 52, 26,197, 70,163,177,195,115,207, 61,119,145,245,221, 38, 63, 4, 72,128,103,148,128, 33, 67, 70,146,131,251,119,163,
-184,172, 10, 33,193,181,245,159,149,222,241, 71, 88,187, 22,232,217,179,167, 83,178,110, 42,121,235,215,175,167, 30,121,228, 17,
-178, 46,125, 31, 10,254,188,213, 72, 94,215, 78,109, 16, 17, 17,193,137,252,155, 10,142,114,164, 80,174,158, 35, 44, 64,128, 0,
- 1,247, 1,106, 89,132, 78,179, 12, 27,111, 86,249, 13, 0, 45, 97, 14, 26, 23,136, 95,128, 0, 7, 30, 0, 1, 2, 4, 8,248,
-187, 64, 98, 81, 2,104, 22,241,139,112,247,228, 65,111, 0, 29, 44,175,105,161,187, 4, 8, 16, 20, 0, 1, 2, 4,252, 51, 32,
- 2, 32,101,189,103,136, 95,204, 34,125,218, 82, 79,176,254, 5, 8, 16, 20, 0, 1, 2, 4,252,143,204,105, 2,233, 11, 16,224,
- 64,123, 22, 32, 64,128, 0, 1, 2, 4,252, 47,107,203,167, 79,159,102, 31,164, 67,172,146,232, 16, 52, 60,104,167, 88,165, 82,
-133, 49,239,109, 5, 19,178,229,241,197, 63, 81,158,141,109,139,148,208,127,194,120,252, 93,228,133,133,133,213,215, 41, 46, 46,
-166,248,202, 75, 78, 78,134, 66,161,160,132,251,207, 53,153,194,243, 43,200,227, 35,143,183, 2,192, 19,109, 57,214, 35,137,137,
-137,188, 51, 75,217, 59, 47, 30,141,147,145,216, 58, 13,208, 86,157,123, 14,134, 96, 44,123,225,213, 42,149,170, 62, 91, 23,223,
-124,226, 77,133,184,184,184,152,236,236,236,122, 18,140,141,141,149,237,219,183, 47,239,159,168,237,218, 26,143,139, 23,205, 59,
-195,122,245,234,213,220,205, 35, 9,147, 20,200,250, 90,105,243,158, 77,152,164, 32,150,207,236,222, 56, 9,147, 28,158, 20,136,
-172,175,149, 46,223,116, 97, 97, 97, 36, 46,238,238,174,194,236,108, 16,103, 74,128, 51,172, 94,179, 58,102,207,161, 61,136,136,
-140, 80,131, 2, 46,158,186, 32, 27, 54, 96, 56,210,223, 79,231,117,255,205,156, 57,179,209,117,103,100,100, 80, 16, 32, 64, 64,
-147, 41, 0, 98,174, 21,163,163,163,121, 11,119,160, 0,216, 36, 81,235,131, 54,120, 16,173, 43,154, 19,151,201,133,168, 84, 42,
-164,164,164, 32, 53, 53, 85,237, 32, 77, 39,151,223,111, 80,167, 99,248, 3, 0,128,155, 58, 29,140,218, 58,115, 97, 69, 21, 67,
-114,220,210, 31,215, 79,228,217, 13,114, 10, 88,114,139,243, 58,227, 93, 68,153,179,235, 49,255, 1,167,175,155, 99,114,110, 48,
- 30, 12,241,187, 49, 30,158,188, 6,146, 48, 73,129, 9,242,135,116,128, 66, 98, 33,122,151,126,131,165, 64,120, 28,122,125, 10,
-114,114,146, 48,110,220, 38,196,197,165, 34, 59,219,220, 87,174, 40, 2, 79,191,252, 52,169,104,117, 27,107,149,171, 17,236, 31,
- 12,218,104,130,142,212,169, 15,254,116,104,220,116,211,227,100,120,196, 8,217,188,121,243,156, 42, 2, 51,103,206, 36,201,201,
-201, 54,251, 84, 80, 2, 4,220, 11,196,199,199,215,207, 25,115,230,204,193,150, 45, 91, 26,112,207,236,217,179, 27, 28, 78,229,
- 44,185,148, 51,121, 92,143,170, 62,125,250,180,181,151,192,163, 10, 0,175,248, 1, 91,167,216,121, 2, 27,149,202,152, 23,220,
- 76,154,194, 39,135, 54, 71,203,157,164,164,164, 96,213,170, 85, 0, 80,255,223,246, 79, 19,126,222,128,160, 22, 56, 91,180, 29,
-126,232, 4, 19,126, 68,217,230,147, 56, 83, 88,142, 41,171,182, 54,219, 3,112,246,215,115,232,215,183, 15,104, 2,156, 59,103,
-126, 13,220,125,205, 46,167, 9,231, 49, 33, 28,199,131,226, 58, 30,179,102,205, 2,128,250,255, 54,137,157,162, 0,199, 63, 77,
- 30,123,236, 0,190,253, 86,238, 81, 37, 96,130,252,161,218,164,164, 36,127, 96, 19,178,190,118,141,216,221,177,240,157, 89,255,
- 0, 48,117,106, 38,114,114,204,255,147,146, 10,193,120, 4,248,120, 3, 54,110,220, 24,163,254,253, 59,245,243,201,179, 49,168,
-237, 64,248,181,108, 9,162, 55,130, 38, 38,120,121,139,209,117,116,215,156,223,162,126,199,170, 77,169,234,181,107,215,202, 94,
-125,245, 85,167, 74,192,173, 91,183, 26,188,143, 29, 25,128,161,243,126,132, 78, 55,189,193, 64,238,216,177,195,229,254,145,203,
-229,228,192,129, 3, 30,235, 95, 79,203,107, 74, 36, 39, 39,199,184,155,214, 55, 57, 57, 57, 6,112, 61, 61,176, 82,169,236,247,
-218,107,175,221,208,104, 52, 97, 0,198,194,124, 8,103, 47, 0,167, 97, 62, 20, 10, 0, 62, 7,240,219,189,238, 31,246, 89, 15,
-115,230,204, 65,118,118,118, 3, 78,153, 61,123, 54,248,100, 46,117, 38,175,254,121,207,202, 34, 9, 9, 9, 20, 23,242,103,202,
-172,149,128, 6, 10, 64, 74, 74, 10, 41, 42, 42, 2, 0, 68, 68, 68,128,125,216,140, 74,165,106,240,222,250,115, 71, 22,123, 89,
- 89,153, 90,165, 82,113,246, 4, 88,159,117,239,136,132, 95,176,164,194,180,230, 1,190, 46,246, 77,155, 54, 57,173,147,155,155,
-203,137,187, 18, 19, 19,237,146,254,226,197,139,145,154,154, 10,182,130,192, 5, 29,195, 31,192,245, 59,149,216,245,194, 84,180,
-166, 70,160,240,227, 5,136,152, 28,129,111,154,153,252, 1,212, 19, 62, 0,244,233,211,167, 65, 57,227, 25, 96,151,123,218,178,
-119, 66,196, 36, 49, 49,209, 46,233,111,219,182, 13,169,169,169,144,143, 24,136, 3, 63,158, 2, 2, 3,128,170,154,123,222,135,
-251, 15,156,244, 7, 54, 97,255,129,147, 30,145,119,243,189,214, 14,181,152,246, 11,203, 57, 61, 32,108,215,127, 82, 82, 14,226,
-226,186,212,255,103, 16, 23,215,133,179, 18,240,241,151, 31, 99,229, 71,239, 96,100,183, 24,152,234,234, 96, 52, 25, 65,121, 83,
- 0,188, 64, 64,227,230, 95, 37,232,213,182, 39,150,190,176, 20,239,164,189,195,201, 27,101, 61,217,197,134,110,179, 73,248,211,
-167, 79, 39,174, 40, 1,114,185,156,236, 95,118, 0, 19,224, 25,210,150,203,229, 36, 45, 45, 13, 0,238,107, 37, 32, 57, 57, 57,
-166,178,178,146,241,150,185,213,206,202,202, 74,102, 78,119, 73,142, 66,161, 40, 2, 48, 11,192, 41, 0,159, 2, 24, 3, 96, 60,
-128,127,179, 20,128, 91,205,209, 79,236,227,158, 1,224,235,175, 27,107,240, 95,127,253, 53, 8, 33,152, 52,105, 18,197, 87,222,
-198,141, 27, 71, 89,230, 57, 2,128, 10, 9, 9,177, 75,252,214, 72, 74, 49,115,204,166,212,197, 54, 63,111,160, 0,164,166,166,
- 58, 12, 2,100,191,183,254,220, 81, 16, 2,163, 84,204,159, 63, 95,157,146,146, 2,235,131,114,172, 15,207, 81,169, 84,142,210,
- 23, 82, 28,202,154,245,161,250,234,171,175,236, 18,191, 69,209,170, 39,255,197,139, 23,115,146,249,103, 81, 49, 52,187,151, 67,
- 58,251,191,232, 24,254, 0,218,183,246, 67,209,238, 34, 51,249, 7,181, 48, 47, 1,248,120,241,110,107, 92, 92,156,140,189, 12,
- 96,121,207, 75, 6, 77,128,176, 0,224,195, 25,192,115,219,128,182,254,192,197, 10,219,229,231,239,240,107,159, 61, 69,142,143,
-215,230,237,183,223,182, 75,252, 0,144, 54,107, 34,214, 29, 60,142,144,136, 14, 40,189,122,211,169,245, 15, 0, 28,189, 0,156,
-189, 4,102, 11, 95, 97,211,210,231,178,254,111, 11,105, 95,120, 54,201, 39, 67,250,204,127,125, 92, 87,136,179, 11, 56,127,191,
- 86, 91,139, 17,211,135,171,163, 59, 12, 69,157, 70, 3,111, 95, 95,120,123,223,157,130,138, 10, 10,176, 39, 43,235,250,236,103,
-103,117,236,236, 27,134,129,143, 14, 24, 45,213, 5,198,124,242,241, 39,188,172,198,119,247,207,194,247,223,127, 15,160, 97,219,
-118,236,216, 65,241, 85, 2, 24,242, 71,231,181,216,191,236, 85,183,149, 0,185, 92, 78,210,211,211,209,189,123,119,172, 91,183,
- 14,115,231,206,189,239,148, 0, 43,226,247,136, 60, 70,150, 27,222, 4, 25,128, 71, 1,108, 3, 80, 3, 32, 4,192,239, 0,174,
-226,110,238,135,102,129,245,113,207,108,183,189,181, 11, 63, 33, 33,129, 56,115,225,239,223,191,191,193,146,241,158, 61,123,212,
-108,171,159,171, 66,204,144, 63,243,122, 83,234,226, 70, 94,128,123,146, 7,128,181,246,138,162,162, 34,180,107,215,174,145,130,
-192,148,149,149,149,113,205,115,239, 44, 24,144,243,132,249,248,227,143, 55,217,181,179, 9,204,150,213,111, 33, 33, 91,109,111,
- 0, 45,138, 81, 51,121, 40, 72,224, 2, 96,244, 50,212,224, 75, 96,243, 73,139,102,182, 0, 62,207,172,131,209,200, 63,209, 89,
-118,118,118, 30,187,159,248,146, 63, 0,148,125, 2,188,181, 17,120,160, 19,112,115,175, 24, 25, 91,244,152,181,221,126, 57, 47,
-243,158,120,150,196,216,193,126, 55,190, 94,133,192, 72, 9,164,221, 94,193, 87,171,158, 67,255, 62, 33,232, 49,241, 29, 78,227,
-193,165,233, 60,150, 10, 40, 0,196,138,252, 41,134,248, 93, 89,215,231,106,225,115,129, 62,174,171,205,242, 28, 43, 79,128, 51,
-220, 40,187,129,177,137, 99, 17,216, 34, 24, 38,202,136,195,223,255,128,234,154, 26,196,197,199,227,175,178, 50,236,204,220,133,
- 57,207,206,234,232, 43,241,133,136,248, 96,220, 67,227,114,127, 87,175,115, 73,161,191,115,231,142,219,215,205, 38,127, 0,110,
- 43, 1,114,185,156,172, 88,177, 2, 93,187,154,251,179, 75,151, 46,184,159, 60, 1,158, 38,126, 27,214, 63,243,218,149,107,237,
-109,121, 38,125, 0,248, 3,136, 4,112, 1, 64, 71, 0, 85, 0, 42, 60,240,204,186, 4,235,227,158,231,204,153, 83, 95,198,184,
-240,153,185,140,139,103,218,222,114, 1,155,252,185, 40, 2, 92,112,207, 87,242, 20, 7, 0, 0, 9,178, 73, 68, 65, 84, 18, 1,
-181,107,215, 78,150,152,152,216,104, 41,192,114,182, 61, 0,240,142, 17,176, 23, 12,232,200,114,180,167,160, 52, 5, 24,235,222,
-158,187,159,171,245, 15, 0, 7,151,172, 64,220,202,247, 97, 28, 61, 2,222, 0,164,199, 10,240, 77, 97, 57, 0,192, 56,122, 46,
- 12,191,182, 1,213,246,223,188, 73,138,135,151,197, 46,202, 39,125,137,185,207, 94,195,165, 23, 22, 65,243,173, 30, 33,109, 28,
-151,123,194, 3,224,138,114,176,109,219, 54,179, 54, 28,247, 8,142,151,148, 33,176,127, 32,174,231, 20, 2, 18, 95, 76,157,251,
- 12, 90,117,154,216,156,243,175,189,168,127,143,120,181, 28,237, 16,112, 22, 59,144,147,148,131,113,155,198, 97,106, 38,144,148,
- 99,126,157,147,148,195,219, 11, 80,163,171, 70, 27,191,214, 48,234,106, 65, 68, 4,131,135, 12,193,238,221,187,117,233,239,191,
- 47,161, 9,193, 83, 51,158, 66,171,214,173, 80, 91, 83, 3,163,201,136, 64,159, 22, 48,136, 12, 46, 93,111, 69, 69, 69,131,221,
- 1,124, 3, 2, 27,145, 63, 3, 23,149, 0,185, 92, 78, 82, 82, 82, 48,100,200,144, 6,229,125,250,244,193,187,239,190,219,172,
- 74, 64, 83, 17,191,181,245, 15, 0, 37, 37, 37,174,122, 1,126,130,121,189,191, 10,102,215,255, 88, 0,151, 1,244, 3,144, 5,
- 96, 43, 0,135, 55,139, 82,169, 20, 41, 20, 10,143,167,131,102,187,236, 89,129,122,245,159,179,151, 4, 74, 75, 75, 99,156, 29,
-244, 69, 8,161, 24,130,103,187,250, 19, 18, 18,108,150,123, 82, 1, 32, 86,164, 72,120,126,238, 16, 17, 17, 17,245,164, 31, 29,
- 29, 45, 99, 98, 3, 24,239, 64, 68, 68,132,154, 89, 46,104,174,137,215,147,112,182,214,207,178,254,157, 98,202,198, 76,144,248,
-112,220, 28,246, 16, 90, 99, 4,252,166,174,131,241,198, 95, 64, 80, 11,120,151,127,137,189,233,249,128,151,151, 43,215,238,182,
- 38,121,230,181,127, 97,208, 0, 32, 98,238, 57, 68, 74,159,197,239, 15, 38, 2, 31, 46,178, 91,222, 92, 30,128,212,212, 84,140,
- 28,220, 3,163, 71,116, 71, 92,223, 69, 88,147,190, 1, 23,242,175,227,133, 81,131, 80,154,181, 31,149,119,170, 60,117, 63,216,
- 90, 42,112, 74,208,108,194,247, 36,249,219,145,201, 9,197,197,197, 84, 88, 88, 24,153,154,217, 80, 33, 0,128,113,155,198, 65,
-156, 93,128,236,236,194,250,157, 0,236, 92, 1,182,110, 55,154,166, 97,162, 1, 66, 27,225,235, 39,193,140,167,159,150,188,245,
-230,155,104,223,190, 61,221, 49, 36, 68,164,211,212,192, 68, 0, 66,155, 64,211,206,231,234,140,140, 12,106,204,152, 49,164,188,
-188, 28, 85, 85, 85, 13, 20, 71,171,221, 1,156,119, 5,200,229,114,178,230,185,243,128,164, 43, 80,250, 81,227, 10,146,174, 88,
-243,220,121,128,163, 18, 32,151,203, 73, 66, 66,130,172, 79,159, 62,234,242,242,242, 70,159,135,133,133, 33, 33, 33, 65,134,251,
- 60, 38,192, 93,235,223, 77, 47, 0, 91, 97,232, 0,224, 12,128,201, 0, 56, 31,101,218, 20,228, 15, 56, 94, 2,176, 97,204,228,
- 57,187,246,248,248,120,194,124, 63, 62, 62,158, 88,203,219,178,101, 11,226,227,227, 9,223, 93, 1, 92, 20, 0, 62,137,128,108,
-125,110, 19,137,137,137, 54,189, 0, 12,217,183,107,215, 78,150,146,146,162,102,214,100, 19, 19, 19, 29, 6, 21, 58,178, 14, 93,
-216, 95,223, 36,219, 0, 25,235,222, 81, 48, 32, 31, 20,190,151, 4,159,169,235,160, 45,185, 4,239, 99,235, 96,200,156, 11,106,
-194,106,236,249,247, 52, 92,221,115, 5,113,105,159, 2,222,205,147,217,121,145, 10,200, 73,219,141,200,171,227,128, 91, 26, 44,
- 28,179,200, 97,185, 39, 60, 0,174, 90,255, 89,187, 87,192,171, 99,111, 72,209, 29,197,223,111, 66, 53, 69,240,243,165,107, 24,
-125,238, 58,167,230,124,251,173,220, 46,217, 3,128,229,115,155,245,184,146,191,157,123,212, 45, 98,240,196, 14,129,164,156,187,
-196, 15,160,145,229,207, 4, 12,102,103, 23,218,252,126,160, 95, 32, 74, 42, 75, 48,164,243, 80,104,235,116,128, 86, 7,163,222,
-128,165, 41, 41,160, 68, 16,213,106,106, 64,211, 38, 24, 77, 4,190,222, 62,248,171,230, 47,248,152,156,239, 54,254,230,155,111,
-234,175,109,230,204,153,132,153,111,216,187, 3,110,220,184,193,249, 58,205, 36,108, 86, 2,122,133, 55,254,253,139, 87,244,152,
-191, 57, 18, 92,201,218, 82,143, 12, 25, 50, 4, 97, 97, 97,141, 62, 63,119,238, 28,178,178,178,212,205, 69,254, 22,107,156, 98,
- 60, 1, 37, 37, 37, 77, 98,253,123,192, 11,192, 96,172,133, 72,235,238, 7, 37,199,209, 18, 0,187,156,239, 18,128,167,150, 20,
-248, 40, 0, 77, 2,198,242, 7,128,232,232,104,153, 74,165, 82, 51,174,127, 59,202,129,236,242,229,203,206, 98, 1, 40,142,101,
- 30,181, 50,185,118, 56, 99,253,219, 34,126, 70,209,225,211,222, 51,133,229, 48,252,250, 22,110,226, 71,132, 76, 88, 13, 84, 86,
-161,112,211, 2,116, 73, 94,139,210,173, 11, 0, 31,111, 64,212, 60,153,157,139, 53, 64,175,118,147, 57,151, 55,135, 7, 32, 53,
- 53,181,102,250,232,161, 55, 90,210,193, 15,212,194, 71,146,185,118, 46,214,239, 61,141,133,227, 31,198,172,247,191,192,180,255,
-247,127, 77,234, 13,114,116,137, 89, 95, 43, 97, 73, 2, 68,185,171,156,186,227,234,119,228, 5, 72,202,201, 33,182,200,159,109,
-253, 59, 67,104,187, 80, 28, 60,156,131,225, 15, 12,135,127,128, 20, 52, 77, 32, 34, 70,208, 20, 5, 66, 8, 76, 4, 48,210, 4,
- 70,163, 17,218, 74, 13,246,253,178, 15, 98,147,152,247,214, 97,235, 93, 1,175,207, 29,129,216,208, 34, 80,135,184,203,176,167,
- 4,240, 37,127,107, 37, 32, 45, 45, 13, 29, 58,116,184,171,216, 23, 22, 34, 53, 53, 21,247,131,229,239,105, 69,192,150,245,239,
-166, 23, 0, 0, 98, 0, 60, 8,224, 13, 52,115,240, 31, 3,165, 82,217,224, 30, 45, 45, 45,133, 82,169,116,228,137,112, 42,143,
-189,164, 80, 90, 90, 26,163, 84, 42, 41, 0,164,180,180,148,218,184,113, 35, 97,121,111, 41,133, 27,219,224,239,137, 2, 96, 29,
-245,111, 73, 86,211, 72, 57, 96,191,118,211,130,231,125, 99,121,112, 27,160, 77,235,223, 85,226,103, 48,101,213, 86,236, 2, 48,
-126,101, 44,136,106, 1,168,199,215,224, 76, 97, 57,168, 86,193, 40,248,179,202,108,253,243, 95, 2,240, 8,236,237,247,119, 39,
- 15, 0, 23,133,139,171,114,176,109,219, 54, 61,128,234,231, 98,250, 85,189,178,250,191,250, 37, 75, 83,116,109, 91,180, 43, 63,
-127,161,184,253,172, 11, 95, 72,209,204,187, 70, 28,144, 51,123,137,134,231,142, 2,207,195, 22,249, 51,150, 63, 0,167, 1,129,
-243,230,205,163,134, 63, 54, 60, 94, 61, 34, 47, 43,177,239, 52, 84,233,170, 64,137, 0,115, 74, 17, 26, 38, 19, 1,109, 52, 34,
-192, 55, 16, 71, 43, 79,225,242,177, 2,236, 84,238,204,115,187,225,133,207, 3,224,191, 13,176,129, 18,208,161, 24, 23,111,132,
-185, 68,254,214, 74,192,186,117,235, 16, 20, 20,132,242,242,114,172, 88,177, 2,247,155,219,223, 19,138,128, 61,235,223, 69, 47,
- 64,123,152,163,254, 69, 0, 6, 2,152, 15,160,240,126,233, 47,133,101, 43,186,167, 96,189,164,176,103,207,158,239,155,170,237,
-247, 36, 15,128, 61,143,192,154, 53,107,100,214,138, 66, 98, 98,162,154,239, 69,176,137,224,126, 72,177,203,182,254,173,183,255,
- 89,250,151,221,175,156, 27,204, 40, 1,147, 87,126, 2,146, 9,180,153,165, 68,222, 43,211,240,112,234,231,128,143, 15, 2, 36,
-226,102,185, 94,246, 30,127, 91,175, 93,204, 3, 96, 4, 32,178,140,173,200,205,241,184, 57,125,244,208,146, 87, 54,101,135, 47,
-157, 51,182, 69,104, 72,140, 30,192,217,196,196,196,150, 48, 31, 37,235,210,120, 48,183,220,183,223,202,153,136,127, 87,148, 59,
-202,153, 5,207,135,208,155, 42, 25,144, 61, 88,147, 62,227, 17,104,213,170,149, 77,237,236,232,183, 71,247,132,245,124, 0,166,
-233,198,179,143, 62,240,104,191,214,129,173,161, 51,232, 64, 8,129,216, 91,140, 10,109, 45,142,255,249, 45,182,125,150, 1, 89,
-111,153,108, 39,118,186,221,198,119,247,207, 66, 70, 70, 6, 46, 95,230,159, 3,224,174, 18, 0,183,200,159, 45,111,238,220,185,
- 36, 45, 45, 13,139, 22, 45,194,253,188,230,207, 86, 4,242,242,242, 92,250,174,163, 58, 60,100, 38,192,188,223, 95, 7,224, 53,
- 0,191, 0, 48,225, 31, 10,235, 37, 0,190, 24, 48, 96, 0, 78,159, 62,141, 77,169,139, 27,229, 1,112,152, 8,168,169,242, 0,
-216,242, 8,216, 35,122, 23,189, 0,110,161,169,182, 1, 50, 3,168, 84, 42,145,155,155, 75, 23, 21, 21,177,137, 76,166, 82,169,
-120,107,142, 83, 86,109, 5, 88,137,127, 30, 93,186,177,254,181,166,121,238, 87,167,119, 41, 77, 92,234,187,116, 0,183, 97,222,
-254, 51,195,205, 54,150, 62, 23,211,175,110, 76,238, 79, 45,158,122,243, 83, 40,149, 74,113,110,110,110, 7, 52, 76,103,237,210,
-120, 52,181, 39,192, 89,126,127,167, 51,103, 19, 44, 9,216, 35,127,125, 92, 87, 32,219,185, 97,182,253,163, 29, 84,128,151,148,
- 28, 11, 59,142, 17, 67, 71,160, 99, 96, 71,128, 38,248, 75, 87,142,163, 39,143,162,244,124, 41, 70,245, 26, 37,123,249,229,151,
-155,125, 60,216, 74,128,167,200,154,241, 4,252, 93, 2,254,220,205, 2,232, 1,108,178,252,253, 79,192,122, 73,193, 29, 23,191,
-189, 4, 64, 54, 21,128,166,194,252,249,243,109,146,189,213, 73,108,108,168, 29, 36, 2,178, 75,180,174,162, 41,182, 1,166,166,
-166, 66,169, 84, 26,115,115,115,189, 45, 75, 7, 12,249,143,114,112,221, 54, 97, 57, 76, 73,221, 4, 67, 67, 28,148, 83,205,116,
-243,251, 90,238,203,101,150, 34,147, 66,161,120,218, 77,177,190, 99,222,248, 56, 95,169, 84, 62,146,155,155,139,220,220, 92, 29,
- 0,137,229,207, 19,196, 79,185,147, 26,216, 25,201, 39, 76, 82, 52, 24, 47,190,196,237,137, 37,129,226,226, 98, 42, 39, 41,135,
-132,206, 13,149,161,179,237, 58, 37, 73, 57,106,174,241, 0, 91, 62,216, 66,173, 93,187, 54,102,235,202,173, 8,235,250,160, 26,
- 0,126, 63,247,155,108,226,152, 56,164,111, 72,207,219,142,237, 46,181, 51, 35, 35,131, 26, 59,118,108,163, 93, 1, 6,131,193,
-173,235,247, 52, 89,255,211,162,253,239, 3,210,164, 20, 10, 5,249, 39, 92,139, 39,150, 20, 24, 47,128,117, 25,103, 5,192,153,
- 37,206,195, 82,119,245, 70, 39, 77, 44,223, 83,223,183, 41, 47, 49, 49,145,228,230,230,122,179,251,139,237, 97,225,169,160,228,
- 53, 17, 33,223,143,147, 80, 32,128, 26,115, 66,126,138, 2,224, 7, 39,251,123, 57,142,199, 31,185,185,185,204, 54,160,170,136,
-136,136,182,169,169,169,190,247, 67, 95, 54,165,219,222,147,178,139,139,139,169,226,133,197, 30,235, 3, 86,158,255,250,239, 29,
-253,238,152,219,237, 60,116,232,144, 64,174,255,112,178,103,115,152, 66,161, 48,120,146,252,149, 74,101,144, 66,161,168,248,187,
-247, 19, 23, 35,154,114,245, 28, 97, 1, 2, 4, 8, 16, 32, 64,192,223, 23, 34,161, 11, 4, 8, 16, 32, 64,128, 0, 65, 1, 16,
- 32, 64,128, 0, 1, 2, 4,252, 15,224,255, 3, 40, 50, 24,122,163,191,209,130, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
- 0};
-
diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c
deleted file mode 100644
index 14766d1f746..00000000000
--- a/source/blender/src/booleanops.c
+++ /dev/null
@@ -1,570 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * CSG operations.
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_ghash.h"
-
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "CSG_BooleanOps.h"
-
-#include "BKE_booleanops.h"
-#include "BKE_cdderivedmesh.h"
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_material.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_toolbox.h"
-
-#include "BDR_editface.h"
-
-#include <math.h>
-
-/**
- * Here's the vertex iterator structure used to walk through
- * the blender vertex structure.
- */
-
-typedef struct {
- Mesh *mesh;
- Object *ob;
- int pos;
-} VertexIt;
-
-/**
- * Implementations of local vertex iterator functions.
- * These describe a blender mesh to the CSG module.
- */
-
-static void VertexIt_Destruct(CSG_VertexIteratorDescriptor * iterator)
-{
- if (iterator->it) {
- // deallocate memory for iterator
- MEM_freeN(iterator->it);
- iterator->it = 0;
- }
- iterator->Done = NULL;
- iterator->Fill = NULL;
- iterator->Reset = NULL;
- iterator->Step = NULL;
- iterator->num_elements = 0;
-
-}
-
-static int VertexIt_Done(CSG_IteratorPtr it)
-{
- VertexIt * iterator = (VertexIt *)it;
- return(iterator->pos >= iterator->mesh->totvert);
-}
-
-static void VertexIt_Fill(CSG_IteratorPtr it, CSG_IVertex *vert)
-{
- VertexIt * iterator = (VertexIt *)it;
- MVert *verts = iterator->mesh->mvert;
-
- float global_pos[3];
-
- /* boolean happens in global space, transform both with obmat */
- VecMat4MulVecfl(
- global_pos,
- iterator->ob->obmat,
- verts[iterator->pos].co
- );
-
- vert->position[0] = global_pos[0];
- vert->position[1] = global_pos[1];
- vert->position[2] = global_pos[2];
-}
-
-static void VertexIt_Step(CSG_IteratorPtr it)
-{
- VertexIt * iterator = (VertexIt *)it;
- iterator->pos ++;
-}
-
-static void VertexIt_Reset(CSG_IteratorPtr it)
-{
- VertexIt * iterator = (VertexIt *)it;
- iterator->pos = 0;
-}
-
-static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, Object *ob)
-{
-
- VertexIt *it;
- if (output == 0) return;
-
- // allocate some memory for blender iterator
- it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt),"Boolean_VIt"));
- if (it == 0) {
- return;
- }
- // assign blender specific variables
- it->ob = ob;
- it->mesh = ob->data;
-
- it->pos = 0;
-
- // assign iterator function pointers.
- output->Step = VertexIt_Step;
- output->Fill = VertexIt_Fill;
- output->Done = VertexIt_Done;
- output->Reset = VertexIt_Reset;
- output->num_elements = it->mesh->totvert;
- output->it = it;
-}
-
-/**
- * Blender Face iterator
- */
-
-typedef struct {
- Mesh *mesh;
- int pos;
- int offset;
-} FaceIt;
-
-static void FaceIt_Destruct(CSG_FaceIteratorDescriptor * iterator)
-{
- MEM_freeN(iterator->it);
- iterator->Done = NULL;
- iterator->Fill = NULL;
- iterator->Reset = NULL;
- iterator->Step = NULL;
- iterator->num_elements = 0;
-}
-
-static int FaceIt_Done(CSG_IteratorPtr it)
-{
- // assume CSG_IteratorPtr is of the correct type.
- FaceIt * iterator = (FaceIt *)it;
- return(iterator->pos >= iterator->mesh->totface);
-}
-
-static void FaceIt_Fill(CSG_IteratorPtr it, CSG_IFace *face)
-{
- // assume CSG_IteratorPtr is of the correct type.
- FaceIt *face_it = (FaceIt *)it;
- MFace *mfaces = face_it->mesh->mface;
- MFace *mface = &mfaces[face_it->pos];
-
- face->vertex_index[0] = mface->v1;
- face->vertex_index[1] = mface->v2;
- face->vertex_index[2] = mface->v3;
- if (mface->v4) {
- face->vertex_index[3] = mface->v4;
- face->vertex_number = 4;
- } else {
- face->vertex_number = 3;
- }
-
- face->orig_face = face_it->offset + face_it->pos;
-}
-
-static void FaceIt_Step(CSG_IteratorPtr it)
-{
- FaceIt * face_it = (FaceIt *)it;
- face_it->pos ++;
-}
-
-static void FaceIt_Reset(CSG_IteratorPtr it)
-{
- FaceIt * face_it = (FaceIt *)it;
- face_it->pos = 0;
-}
-
-static void FaceIt_Construct(
- CSG_FaceIteratorDescriptor *output, Object *ob, int offset)
-{
- FaceIt *it;
- if (output == 0) return;
-
- // allocate some memory for blender iterator
- it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt),"Boolean_FIt"));
- if (it == 0) {
- return ;
- }
- // assign blender specific variables
- it->mesh = ob->data;
- it->offset = offset;
- it->pos = 0;
-
- // assign iterator function pointers.
- output->Step = FaceIt_Step;
- output->Fill = FaceIt_Fill;
- output->Done = FaceIt_Done;
- output->Reset = FaceIt_Reset;
- output->num_elements = it->mesh->totface;
- output->it = it;
-}
-
-static Object *AddNewBlenderMesh(Base *base)
-{
- // This little function adds a new mesh object to the blender object list
- // It uses ob to duplicate data as this seems to be easier than creating
- // a new one. This new oject contains no faces nor vertices.
- Mesh *old_me;
- Base *basen;
- Object *ob_new;
-
- // now create a new blender object.
- // duplicating all the settings from the previous object
- // to the new one.
- ob_new= copy_object(base->object);
-
- // Ok we don't want to use the actual data from the
- // last object, the above function incremented the
- // number of users, so decrement it here.
- old_me= ob_new->data;
- old_me->id.us--;
-
- // Now create a new base to add into the linked list of
- // vase objects.
-
- basen= MEM_mallocN(sizeof(Base), "duplibase");
- *basen= *base;
- BLI_addhead(&G.scene->base, basen); /* addhead: anders oneindige lus */
- basen->object= ob_new;
- basen->flag &= ~SELECT;
-
- // Initialize the mesh data associated with this object.
- ob_new->data= add_mesh("Mesh");
- G.totmesh++;
-
- // Finally assign the object type.
- ob_new->type= OB_MESH;
-
- return ob_new;
-}
-
-static void InterpCSGFace(
- DerivedMesh *dm, Mesh *orig_me, int index, int orig_index, int nr,
- float mapmat[][4])
-{
- float obco[3], *co[4], *orig_co[4], w[4][4];
- MFace *mface, *orig_mface;
- int j;
-
- mface = CDDM_get_face(dm, index);
- orig_mface = orig_me->mface + orig_index;
-
- // get the vertex coordinates from the original mesh
- orig_co[0] = (orig_me->mvert + orig_mface->v1)->co;
- orig_co[1] = (orig_me->mvert + orig_mface->v2)->co;
- orig_co[2] = (orig_me->mvert + orig_mface->v3)->co;
- orig_co[3] = (orig_mface->v4)? (orig_me->mvert + orig_mface->v4)->co: NULL;
-
- // get the vertex coordinates from the new derivedmesh
- co[0] = CDDM_get_vert(dm, mface->v1)->co;
- co[1] = CDDM_get_vert(dm, mface->v2)->co;
- co[2] = CDDM_get_vert(dm, mface->v3)->co;
- co[3] = (nr == 4)? CDDM_get_vert(dm, mface->v4)->co: NULL;
-
- for (j = 0; j < nr; j++) {
- // get coordinate into the space of the original mesh
- if (mapmat)
- VecMat4MulVecfl(obco, mapmat, co[j]);
- else
- VecCopyf(obco, co[j]);
-
- InterpWeightsQ3Dfl(orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco, w[j]);
- }
-
- CustomData_interp(&orig_me->fdata, &dm->faceData, &orig_index, NULL, (float*)w, 1, index);
-}
-
-/* Iterate over the CSG Output Descriptors and create a new DerivedMesh
- from them */
-static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
- CSG_FaceIteratorDescriptor *face_it,
- CSG_VertexIteratorDescriptor *vertex_it,
- float parinv[][4],
- float mapmat[][4],
- Material **mat,
- int *totmat,
- Object *ob1,
- Object *ob2)
-{
- DerivedMesh *dm;
- GHash *material_hash = NULL;
- Mesh *me1= (Mesh*)ob1->data;
- Mesh *me2= (Mesh*)ob2->data;
- int i;
-
- // create a new DerivedMesh
- dm = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements);
-
- CustomData_merge(&me1->fdata, &dm->faceData, CD_MASK_DERIVEDMESH,
- CD_DEFAULT, face_it->num_elements);
- CustomData_merge(&me2->fdata, &dm->faceData, CD_MASK_DERIVEDMESH,
- CD_DEFAULT, face_it->num_elements);
-
- // step through the vertex iterators:
- for (i = 0; !vertex_it->Done(vertex_it->it); i++) {
- CSG_IVertex csgvert;
- MVert *mvert = CDDM_get_vert(dm, i);
-
- // retrieve a csg vertex from the boolean module
- vertex_it->Fill(vertex_it->it, &csgvert);
- vertex_it->Step(vertex_it->it);
-
- // we have to map the vertex coordinates back in the coordinate frame
- // of the resulting object, since it was computed in world space
- VecMat4MulVecfl(mvert->co, parinv, csgvert.position);
- }
-
- // a hash table to remap materials to indices
- if (mat) {
- material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
- *totmat = 0;
- }
-
- // step through the face iterators
- for(i = 0; !face_it->Done(face_it->it); i++) {
- Mesh *orig_me;
- Object *orig_ob;
- Material *orig_mat;
- CSG_IFace csgface;
- MFace *mface;
- int orig_index, mat_nr;
-
- // retrieve a csg face from the boolean module
- face_it->Fill(face_it->it, &csgface);
- face_it->Step(face_it->it);
-
- // find the original mesh and data
- orig_ob = (csgface.orig_face < me1->totface)? ob1: ob2;
- orig_me = (orig_ob == ob1)? me1: me2;
- orig_index = (orig_ob == ob1)? csgface.orig_face: csgface.orig_face - me1->totface;
-
- // copy all face layers, including mface
- CustomData_copy_data(&orig_me->fdata, &dm->faceData, orig_index, i, 1);
-
- // set mface
- mface = CDDM_get_face(dm, i);
- mface->v1 = csgface.vertex_index[0];
- mface->v2 = csgface.vertex_index[1];
- mface->v3 = csgface.vertex_index[2];
- mface->v4 = (csgface.vertex_number == 4)? csgface.vertex_index[3]: 0;
-
- // set material, based on lookup in hash table
- orig_mat= give_current_material(orig_ob, mface->mat_nr+1);
-
- if (mat && orig_mat) {
- if (!BLI_ghash_haskey(material_hash, orig_mat)) {
- mat[*totmat] = orig_mat;
- mat_nr = mface->mat_nr = (*totmat)++;
- BLI_ghash_insert(material_hash, orig_mat, SET_INT_IN_POINTER(mat_nr));
- }
- else
- mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat));
- }
- else
- mface->mat_nr = 0;
-
- InterpCSGFace(dm, orig_me, i, orig_index, csgface.vertex_number,
- (orig_me == me2)? mapmat: NULL);
-
- test_index_face(mface, &dm->faceData, i, csgface.vertex_number);
- }
-
- if (material_hash)
- BLI_ghash_free(material_hash, NULL, NULL);
-
- CDDM_calc_edges(dm);
- CDDM_calc_normals(dm);
-
- return dm;
-}
-
-static void BuildMeshDescriptors(
- struct Object *ob,
- int face_offset,
- struct CSG_FaceIteratorDescriptor * face_it,
- struct CSG_VertexIteratorDescriptor * vertex_it)
-{
- VertexIt_Construct(vertex_it,ob);
- FaceIt_Construct(face_it,ob,face_offset);
-}
-
-static void FreeMeshDescriptors(
- struct CSG_FaceIteratorDescriptor *face_it,
- struct CSG_VertexIteratorDescriptor *vertex_it)
-{
- VertexIt_Destruct(vertex_it);
- FaceIt_Destruct(face_it);
-}
-
-DerivedMesh *NewBooleanDerivedMesh_intern(
- struct Object *ob, struct Object *ob_select,
- int int_op_type, Material **mat, int *totmat)
-{
-
- float inv_mat[4][4];
- float map_mat[4][4];
-
- DerivedMesh *dm = NULL;
- Mesh *me1 = get_mesh(ob_select);
- Mesh *me2 = get_mesh(ob);
-
- if (me1 == NULL || me2 == NULL) return 0;
- if (!me1->totface || !me2->totface) return 0;
-
- // we map the final object back into ob's local coordinate space. For this
- // we need to compute the inverse transform from global to ob (inv_mat),
- // and the transform from ob to ob_select for use in interpolation (map_mat)
- Mat4Invert(inv_mat, ob->obmat);
- Mat4MulMat4(map_mat, ob_select->obmat, inv_mat);
- Mat4Invert(inv_mat, ob_select->obmat);
-
- {
- // interface with the boolean module:
- //
- // the idea is, we pass the boolean module verts and faces using the
- // provided descriptors. once the boolean operation is performed, we
- // get back output descriptors, from which we then build a DerivedMesh
-
- CSG_VertexIteratorDescriptor vd_1, vd_2;
- CSG_FaceIteratorDescriptor fd_1, fd_2;
- CSG_OperationType op_type;
- CSG_BooleanOperation *bool_op;
-
- // work out the operation they chose and pick the appropriate
- // enum from the csg module.
- switch (int_op_type) {
- case 1 : op_type = e_csg_intersection; break;
- case 2 : op_type = e_csg_union; break;
- case 3 : op_type = e_csg_difference; break;
- case 4 : op_type = e_csg_classify; break;
- default : op_type = e_csg_intersection;
- }
-
- BuildMeshDescriptors(ob_select, 0, &fd_1, &vd_1);
- BuildMeshDescriptors(ob, me1->totface, &fd_2, &vd_2);
-
- bool_op = CSG_NewBooleanFunction();
-
- // perform the operation
- if (CSG_PerformBooleanOperation(bool_op, op_type, fd_1, vd_1, fd_2, vd_2)) {
- CSG_VertexIteratorDescriptor vd_o;
- CSG_FaceIteratorDescriptor fd_o;
-
- CSG_OutputFaceDescriptor(bool_op, &fd_o);
- CSG_OutputVertexDescriptor(bool_op, &vd_o);
-
- // iterate through results of operation and insert
- // into new object
- dm = ConvertCSGDescriptorsToDerivedMesh(
- &fd_o, &vd_o, inv_mat, map_mat, mat, totmat, ob_select, ob);
-
- // free up the memory
- CSG_FreeVertexDescriptor(&vd_o);
- CSG_FreeFaceDescriptor(&fd_o);
- }
- else
- error("Unknown internal error in boolean");
-
- CSG_FreeBooleanOperation(bool_op);
-
- FreeMeshDescriptors(&fd_1, &vd_1);
- FreeMeshDescriptors(&fd_2, &vd_2);
- }
-
- return dm;
-}
-
-int NewBooleanMesh(Base *base, Base *base_select, int int_op_type)
-{
- Mesh *me_new;
- int a, maxmat, totmat= 0;
- Object *ob_new, *ob, *ob_select;
- Material **mat;
- DerivedMesh *dm;
-
- ob= base->object;
- ob_select= base_select->object;
-
- maxmat= ob->totcol + ob_select->totcol;
- mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat");
-
- /* put some checks in for nice user feedback */
- if((!(get_mesh(ob)->totface)) || (!(get_mesh(ob_select)->totface)))
- {
- MEM_freeN(mat);
- return -1;
- }
-
- dm= NewBooleanDerivedMesh_intern(ob, ob_select, int_op_type, mat, &totmat);
-
- if (dm == NULL) {
- MEM_freeN(mat);
- return 0;
- }
-
- /* create a new blender mesh object - using 'base' as a template */
- ob_new= AddNewBlenderMesh(base_select);
- me_new= ob_new->data;
-
- DM_to_mesh(dm, me_new);
- dm->release(dm);
-
- /* add materials to object */
- for (a = 0; a < totmat; a++)
- assign_material(ob_new, mat[a], a+1);
-
- MEM_freeN(mat);
-
- /* update dag */
- DAG_object_flush_update(G.scene, ob_new, OB_RECALC_DATA);
-
- return 1;
-}
-
-DerivedMesh *NewBooleanDerivedMesh(struct Object *ob, struct Object *ob_select,
- int int_op_type)
-{
- return NewBooleanDerivedMesh_intern(ob, ob_select, int_op_type, NULL, NULL);
-}
-
diff --git a/source/blender/src/booleanops_mesh.c b/source/blender/src/booleanops_mesh.c
deleted file mode 100644
index 14e32873dbd..00000000000
--- a/source/blender/src/booleanops_mesh.c
+++ /dev/null
@@ -1,293 +0,0 @@
-#if 0
-
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#include "CSG_BooleanOps.h"
-
-#include "BKE_booleanops.h"
-#include "BKE_booleanops_mesh.h"
-#include "MEM_guardedalloc.h"
-
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_displist.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-#include "BKE_library.h"
-#include "BKE_material.h"
-
-#include "BLI_arithb.h"
-
-/**
- * Implementation of boolean ops mesh interface.
- */
-
- void
-CSG_DestroyMeshDescriptor(
- CSG_MeshDescriptor *mesh
-){
- // Call mesh descriptors destroy function....
- mesh->m_destroy_func(mesh);
-}
-
-// Destroy function for blender mesh internals.
-
-static
- void
-CSG_DestroyBlenderMeshInternals(
- CSG_MeshDescriptor *mesh
-) {
- // Free face and vertex iterators.
- FreeMeshDescriptors(&(mesh->m_face_iterator),&(mesh->m_vertex_iterator));
-}
-
-
-static
- void
-CSG_DestroyCSGMeshInternals(
- CSG_MeshDescriptor *mesh
-){
- CSG_FreeVertexDescriptor(&(mesh->m_vertex_iterator));
- CSG_FreeFaceDescriptor(&(mesh->m_face_iterator));
-}
-
-static
- int
-MakeCSGMeshFromBlenderBase(
- Base * base,
- CSG_MeshDescriptor * output
-) {
- Mesh *me;
- if (output == NULL || base == NULL) return 0;
-
- me = get_mesh(base->object);
-
- output->m_descriptor.user_face_vertex_data_size = 0;
- output->m_descriptor.user_data_size = sizeof(FaceData);
-
- output->base = base;
-
- BuildMeshDescriptors(
- base->object,
- &(output->m_face_iterator),
- &(output->m_vertex_iterator)
- );
-
- output->m_destroy_func = CSG_DestroyBlenderMeshInternals;
-
- return 1;
-}
-
- int
-CSG_LoadBlenderMesh(
- Object * obj,
- CSG_MeshDescriptor *output
-){
-
- Mesh *me;
- if (output == NULL || obj == NULL) return 0;
-
- me = get_mesh(obj);
-
- output->m_descriptor.user_face_vertex_data_size = 0;
- output->m_descriptor.user_data_size = sizeof(FaceData);
-
- output->base = NULL;
-
- BuildMeshDescriptors(
- obj,
- &(output->m_face_iterator),
- &(output->m_vertex_iterator)
- );
-
- output->m_destroy_func = CSG_DestroyBlenderMeshInternals;
- output->base = NULL;
-
- return 1;
-}
-
-
-
-
- int
-CSG_AddMeshToBlender(
- CSG_MeshDescriptor *mesh
-){
- Mesh *me_new = NULL;
- Object *ob_new = NULL;
- float inv_mat[4][4];
-
- if (mesh == NULL) return 0;
- if (mesh->base == NULL) return 0;
-
- Mat4Invert(inv_mat,mesh->base->object->obmat);
-
- // Create a new blender mesh object - using 'base' as
- // a template for the new object.
- ob_new= AddNewBlenderMesh(mesh->base);
-
- me_new = ob_new->data;
-
- // make sure the iterators are reset.
- mesh->m_face_iterator.Reset(mesh->m_face_iterator.it);
- mesh->m_vertex_iterator.Reset(mesh->m_vertex_iterator.it);
-
- // iterate through results of operation and insert into new object
- // see subsurf.c
-
- ConvertCSGDescriptorsToMeshObject(
- ob_new,
- &(mesh->m_descriptor),
- &(mesh->m_face_iterator),
- &(mesh->m_vertex_iterator),
- inv_mat
- );
-
- return 1;
-}
-
- int
-CSG_PerformOp(
- CSG_MeshDescriptor *mesh1,
- CSG_MeshDescriptor *mesh2,
- int int_op_type,
- CSG_MeshDescriptor *output
-){
-
- CSG_OperationType op_type;
- CSG_BooleanOperation * bool_op = CSG_NewBooleanFunction();
- int success = 0;
-
- if (bool_op == NULL) return 0;
-
- if ((mesh1 == NULL) || (mesh2 == NULL) || (output == NULL)) {
- return 0;
- }
- if ((int_op_type < 1) || (int_op_type > 3)) return 0;
-
- switch (int_op_type) {
- case 1 : op_type = e_csg_intersection; break;
- case 2 : op_type = e_csg_union; break;
- case 3 : op_type = e_csg_difference; break;
- case 4 : op_type = e_csg_classify; break;
- default : op_type = e_csg_intersection;
- }
-
- output->m_descriptor = CSG_DescibeOperands(bool_op,mesh1->m_descriptor,mesh2->m_descriptor);
- output->base = mesh1->base;
-
- if (output->m_descriptor.user_face_vertex_data_size) {
- // Then use the only interp function supported
- success =
- CSG_PerformBooleanOperation(
- bool_op,
- op_type,
- mesh1->m_face_iterator,
- mesh1->m_vertex_iterator,
- mesh2->m_face_iterator,
- mesh2->m_vertex_iterator,
- InterpFaceVertexData
- );
- } else {
- success =
- CSG_PerformBooleanOperation(
- bool_op,
- op_type,
- mesh1->m_face_iterator,
- mesh1->m_vertex_iterator,
- mesh2->m_face_iterator,
- mesh2->m_vertex_iterator,
- InterpNoUserData
- );
- }
-
- if (!success) {
- CSG_FreeBooleanOperation(bool_op);
- bool_op = NULL;
- return 0;
- }
-
- // get the ouput mesh descriptors.
-
- CSG_OutputFaceDescriptor(bool_op,&(output->m_face_iterator));
- CSG_OutputVertexDescriptor(bool_op,&(output->m_vertex_iterator));
- output->m_destroy_func = CSG_DestroyCSGMeshInternals;
-
- return 1;
-}
-
- int
-NewBooleanMeshTest(
- struct Base * base,
- struct Base * base_select,
- int op_type
-){
-
- CSG_MeshDescriptor m1,m2,output;
- CSG_MeshDescriptor output2,output3;
-
- if (!MakeCSGMeshFromBlenderBase(base,&m1)) {
- return 0;
- }
-
- if (!MakeCSGMeshFromBlenderBase(base_select,&m2)) {
- return 0;
- }
-
- CSG_PerformOp(&m1,&m2,1,&output);
- CSG_PerformOp(&m1,&m2,2,&output2);
- CSG_PerformOp(&m1,&m2,3,&output3);
-
- if (!CSG_AddMeshToBlender(&output)) {
- return 0;
- }
- if (!CSG_AddMeshToBlender(&output2)) {
- return 0;
- }
- if (!CSG_AddMeshToBlender(&output3)) {
- return 0;
- }
-
-
- CSG_DestroyMeshDescriptor(&m1);
- CSG_DestroyMeshDescriptor(&m2);
- CSG_DestroyMeshDescriptor(&output);
- CSG_DestroyMeshDescriptor(&output2);
- CSG_DestroyMeshDescriptor(&output3);
-
- return 1;
-}
-
-#endif
-
diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c
deleted file mode 100644
index ba4d02d2355..00000000000
--- a/source/blender/src/butspace.c
+++ /dev/null
@@ -1,807 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "blendef.h"
-#include "MEM_guardedalloc.h"
-
-#include "DNA_color_types.h"
-#include "DNA_image_types.h"
-#include "DNA_material_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-
-#include "BKE_colortools.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_library.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_blenlib.h"
-
-#include "BSE_drawview.h" // for do_viewbuttons.c .... hurms
-#include "BSE_node.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_butspace.h"
-#include "BSE_headerbuttons.h"
-#include "BIF_previewrender.h"
-#include "BIF_mywindow.h"
-#include "BIF_glutil.h"
-#include "BIF_resources.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "mydevice.h"
-#include "butspace.h" // own module
-
-/************************ function prototypes ***************************/
-void drawbutspace(ScrArea *, void *);
-
-
-/* Local vars ---------------------------------------------------------- */
-short bgpicmode=0, near=1000, far=1000;
-MTex emptytex;
-MTex mtexcopybuf;
-
-char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend",
- "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave",
- "Voronoi", "DistNoise", "", "", "", "", "", ""};
-/* ---------------------------------------------------------------------- */
-
-void test_idbutton_cb(void *namev, void *arg2)
-{
- char *name= namev;
-
- test_idbutton(name+2);
-}
-
-
-void test_scriptpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- id= G.main->text.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_actionpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- id= G.main->action.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- id_us_plus(id);
- *idpp= id;
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-
-void test_obpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if(idpp == (ID **)&(emptytex.object)) {
- error("You must add a texture first");
- *idpp= 0;
- return;
- }
-
- id= G.main->object.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_lib_extern(id); /* checks lib data, sets correct flag for saving then */
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-/* tests for an object of type OB_MESH */
-void test_meshobpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- id = G.main->object.first;
- while(id) {
- Object *ob = (Object *)id;
- if(ob->type == OB_MESH && strcmp(name, id->name + 2) == 0) {
- *idpp = id;
- /* checks lib data, sets correct flag for saving then */
- id_lib_extern(id);
- return;
- }
- id = id->next;
- }
- *idpp = NULL;
-}
-
-void test_meshpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->mesh.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_matpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->mat.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_scenepoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->scene.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_grouppoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->group.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_texpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->tex.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-void test_imapoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- if( *idpp ) (*idpp)->us--;
-
- id= G.main->image.first;
- while(id) {
- if( strcmp(name, id->name+2)==0 ) {
- *idpp= id;
- id_us_plus(id);
- return;
- }
- id= id->next;
- }
- *idpp= NULL;
-}
-
-/* ----------- custom button group ---------------------- */
-
-static void curvemap_buttons_zoom_in(void *cumap_v, void *unused)
-{
- CurveMapping *cumap = cumap_v;
- float d;
-
- /* we allow 20 times zoom */
- if( (cumap->curr.xmax - cumap->curr.xmin) > 0.04f*(cumap->clipr.xmax - cumap->clipr.xmin) ) {
- d= 0.1154f*(cumap->curr.xmax - cumap->curr.xmin);
- cumap->curr.xmin+= d;
- cumap->curr.xmax-= d;
- d= 0.1154f*(cumap->curr.ymax - cumap->curr.ymin);
- cumap->curr.ymin+= d;
- cumap->curr.ymax-= d;
- }
-}
-
-static void curvemap_buttons_zoom_out(void *cumap_v, void *unused)
-{
- CurveMapping *cumap = cumap_v;
- float d, d1;
-
- /* we allow 20 times zoom, but dont view outside clip */
- if( (cumap->curr.xmax - cumap->curr.xmin) < 20.0f*(cumap->clipr.xmax - cumap->clipr.xmin) ) {
- d= d1= 0.15f*(cumap->curr.xmax - cumap->curr.xmin);
-
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.xmin-d < cumap->clipr.xmin)
- d1= cumap->curr.xmin - cumap->clipr.xmin;
- cumap->curr.xmin-= d1;
-
- d1= d;
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.xmax+d > cumap->clipr.xmax)
- d1= -cumap->curr.xmax + cumap->clipr.xmax;
- cumap->curr.xmax+= d1;
-
- d= d1= 0.15f*(cumap->curr.ymax - cumap->curr.ymin);
-
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.ymin-d < cumap->clipr.ymin)
- d1= cumap->curr.ymin - cumap->clipr.ymin;
- cumap->curr.ymin-= d1;
-
- d1= d;
- if(cumap->flag & CUMA_DO_CLIP)
- if(cumap->curr.ymax+d > cumap->clipr.ymax)
- d1= -cumap->curr.ymax + cumap->clipr.ymax;
- cumap->curr.ymax+= d1;
- }
-}
-
-static void curvemap_buttons_setclip(void *cumap_v, void *unused)
-{
- CurveMapping *cumap = cumap_v;
-
- curvemapping_changed(cumap, 0);
-}
-
-static void curvemap_buttons_delete(void *cumap_v, void *unused)
-{
- CurveMapping *cumap = cumap_v;
-
- curvemap_remove(cumap->cm+cumap->cur, SELECT);
- curvemapping_changed(cumap, 0);
-}
-
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *curvemap_clipping_func(void *cumap_v)
-{
- CurveMapping *cumap = cumap_v;
- uiBlock *block;
- uiBut *bt;
-
- block= uiNewBlock(&curarea->uiblocks, "curvemap_clipping_func", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -4, 16, 128, 106, NULL, 0, 0, 0, 0, "");
-
- bt= uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping",
- 0,100,120,18, &cumap->flag, 0.0, 0.0, 10, 0, "");
- uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, 0, "Min X ", 0,74,120,18, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
- uiDefButF(block, NUM, 0, "Min Y ", 0,56,120,18, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
- uiDefButF(block, NUM, 0, "Max X ", 0,38,120,18, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "Max Y ", 0,20,120,18, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
-
- return block;
-}
-
-
-static void curvemap_tools_dofunc(void *cumap_v, int event)
-{
- CurveMapping *cumap = cumap_v;
- CurveMap *cuma= cumap->cm+cumap->cur;
-
- switch(event) {
- case 0:
- curvemap_reset(cuma, &cumap->clipr);
- curvemapping_changed(cumap, 0);
- break;
- case 1:
- cumap->curr= cumap->clipr;
- break;
- case 2: /* set vector */
- curvemap_sethandle(cuma, 1);
- curvemapping_changed(cumap, 0);
- break;
- case 3: /* set auto */
- curvemap_sethandle(cuma, 0);
- curvemapping_changed(cumap, 0);
- break;
- case 4: /* extend horiz */
- cuma->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
- curvemapping_changed(cumap, 0);
- break;
- case 5: /* extend extrapolate */
- cuma->flag |= CUMA_EXTEND_EXTRAPOLATE;
- curvemapping_changed(cumap, 0);
- break;
- }
- addqueue(curarea->win, REDRAW, 1);
-}
-
-static uiBlock *curvemap_tools_func(void *cumap_v)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "curvemap_tools_func", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
-void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short event, short redraw, rctf *rect)
-{
- uiBut *bt;
- float dx, fy= rect->ymax-18.0f;
- int icon;
- short xco, yco;
-
- yco= (short)(rect->ymax-18.0f);
-
- /* curve choice options + tools/settings, 8 icons + spacer */
- dx= (rect->xmax-rect->xmin)/(9.0f);
-
- uiBlockBeginAlign(block);
- if(labeltype=='v') { /* vector */
- xco= (short)rect->xmin;
- if(cumap->cm[0].curve)
- uiDefButI(block, ROW, redraw, "X", xco, yco+2, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
- xco= (short)(rect->xmin+1.0f*dx);
- if(cumap->cm[1].curve)
- uiDefButI(block, ROW, redraw, "Y", xco, yco+2, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
- xco= (short)(rect->xmin+2.0f*dx);
- if(cumap->cm[2].curve)
- uiDefButI(block, ROW, redraw, "Z", xco, yco+2, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
- }
- else if(labeltype=='c') { /* color */
- xco= (short)rect->xmin;
- if(cumap->cm[3].curve)
- uiDefButI(block, ROW, redraw, "C", xco, yco+2, dx, 16, &cumap->cur, 0.0, 3.0, 0.0, 0.0, "");
- xco= (short)(rect->xmin+1.0f*dx);
- if(cumap->cm[0].curve)
- uiDefButI(block, ROW, redraw, "R", xco, yco+2, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, "");
- xco= (short)(rect->xmin+2.0f*dx);
- if(cumap->cm[1].curve)
- uiDefButI(block, ROW, redraw, "G", xco, yco+2, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, "");
- xco= (short)(rect->xmin+3.0f*dx);
- if(cumap->cm[2].curve)
- uiDefButI(block, ROW, redraw, "B", xco, yco+2, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, "");
- }
- /* else no channels ! */
- uiBlockEndAlign(block);
-
- xco= (short)(rect->xmin+4.5f*dx);
- uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMIN, xco, yco, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in");
- uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL);
-
- xco= (short)(rect->xmin+5.25f*dx);
- bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMOUT, xco, yco, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out");
- uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL);
-
- xco= (short)(rect->xmin+6.0f*dx);
- bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, event, ICON_MODIFIER, xco, yco, dx, 18, "Tools");
-
- xco= (short)(rect->xmin+7.0f*dx);
- if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT;
- bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, event, icon, xco, yco, dx, 18, "Clipping Options");
-
- xco= (short)(rect->xmin+8.0f*dx);
- bt= uiDefIconBut(block, BUT, event, ICON_X, xco, yco, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
- uiButSetFunc(bt, curvemap_buttons_delete, cumap, NULL);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiDefBut(block, BUT_CURVE, event, "",
- rect->xmin, rect->ymin, rect->xmax-rect->xmin, fy-rect->ymin,
- cumap, 0.0f, 1.0f, 0, 0, "");
-
-
-}
-
-
-/* --------------------------------- */
-
-/* nodes have button callbacks, that can draw in butspace too. need separate handling */
-static void do_node_buts(unsigned short event)
-{
- Material *ma;
- SpaceNode *snode = curarea->spacedata.first;
-
- /* all operations default on active material layer here */
- /* but this also gets called for lamp and world... */
- ma= G.buts->lockpoin;
- if(ma && GS(ma->id.name)==ID_MA)
- ma = editnode_get_active_material(ma);
- else
- ma= NULL;
-
- if(event>=B_NODE_EXEC) {
- if(ma) end_render_material(ma); /// temporal... 3d preview
- BIF_preview_changed(ID_MA);
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- }
-}
-
-void do_butspace(unsigned short event)
-{
- SpaceButs *buts;
-
- /* redraw windows of the same type? */
- buts= curarea->spacedata.first;
- if(buts->mainb==CONTEXT_SCENE) allqueue(REDRAWBUTSSCENE, curarea->win);
- if(buts->mainb==CONTEXT_OBJECT) allqueue(REDRAWBUTSOBJECT, curarea->win);
- if(buts->mainb==CONTEXT_SHADING) allqueue(REDRAWBUTSSHADING, curarea->win);
- if(buts->mainb==CONTEXT_EDITING) allqueue(REDRAWBUTSEDIT, curarea->win);
- if(buts->mainb==CONTEXT_SCRIPT) allqueue(REDRAWBUTSSCRIPT, curarea->win);
- if(buts->mainb==CONTEXT_LOGIC) allqueue(REDRAWBUTSLOGIC, curarea->win);
-
- if (event <=50){
- do_global_buttons2(event);
- }
- else if(event<=100) {
- do_global_buttons(event);
- }
- else if(event < 1000) {
- do_headerbuttons(event);
- }
- else if(event<=B_VIEWBUTS) {
- do_viewbuts(event);
- }
- else if(event<=B_LAMPBUTS) {
- do_lampbuts(event);
- }
- else if(event<=B_MATBUTS) {
- do_matbuts(event);
- }
- else if(event<=B_TEXBUTS) {
- do_texbuts(event);
- }
- else if(event<=B_ANIMBUTS) {
- do_object_panels(event);
- }
- else if(event<=B_WORLDBUTS) {
- do_worldbuts(event);
- }
- else if(event<=B_RENDERBUTS) {
- do_render_panels(event); // buttons_scene.c
- }
- else if(event<=B_SEQUENCERBUTS) {
- do_sequencer_panels(event);
- }
- else if(event<=B_COMMONEDITBUTS) {
- do_common_editbuts(event);
- }
- else if(event<=B_MESHBUTS) {
- do_meshbuts(event);
- }
- else if(event<=B_VGROUPBUTS) {
- do_vgroupbuts(event);
- }
- else if(event<=B_CURVEBUTS) {
- do_curvebuts(event);
- }
- else if(event<=B_FONTBUTS) {
- do_fontbuts(event);
- }
- else if(event<=B_ARMBUTS) {
- do_armbuts(event);
- }
- else if(event<=B_CAMBUTS) {
- do_cambuts(event);
- }
- else if(event<=B_MBALLBUTS) {
- do_mballbuts(event);
- }
- else if(event<=B_LATTBUTS) {
- do_latticebuts(event);
- }
- else if(event<=B_GAMEBUTS) {
- do_logic_buts(event); // buttons_logic.c
- }
- else if(event<=B_FPAINTBUTS) {
- do_fpaintbuts(event);
- }
- else if(event<=B_RADIOBUTS) {
- do_radiobuts(event);
- }
- else if(event<=B_SCRIPTBUTS) {
- do_scriptbuts(event);
- }
- else if(event<=B_SOUNDBUTS) {
- do_soundbuts(event);
- }
- else if(event<=B_CONSTRAINTBUTS) {
- do_constraintbuts(event);
- }
- else if(event<=B_UVAUTOCALCBUTS) {
- do_uvcalculationbuts(event);
- }
- else if(event<=B_EFFECTSBUTS) {
- do_effects_panels(event);
- }
- else if(event<=B_MODIFIER_BUTS) {
- extern void do_modifier_panels(unsigned short event);
- do_modifier_panels(event);
- }
- else if(event<=B_NODE_BUTS) {
- do_node_buts(event);
- }
- else if(event==REDRAWVIEW3D) allqueue(event, 1); // 1=do header too
- else if(event>REDRAWVIEW3D) allqueue(event, 0);
-}
-
-static void butspace_context_switch(SpaceButs *buts, Object *new)
-{
- // change type automatically
- if(new) {
- int tab= buts->tab[CONTEXT_SHADING];
-
- if(tab == TAB_SHADING_WORLD) {
- if(new->type==OB_CAMERA);
- else if(new->type==OB_LAMP) {
- buts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
- }
- else buts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
-
- }
- else if(tab == TAB_SHADING_TEX) {
- if(new->type==OB_LAMP) buts->texfrom= 2;
- else if(new->type==OB_CAMERA) buts->texfrom= 1;
- else buts->texfrom= 0;
- }
- else if(tab == TAB_SHADING_RAD) {
- }
- else if(new->type==OB_CAMERA) {
- buts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD;
- }
- else if(new->type==OB_LAMP) {
- buts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
- }
- else {
- buts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
- }
- }
-}
-
-/* new active object */
-void redraw_test_buttons(Object *new)
-{
- ScrArea *sa;
- SpaceButs *buts;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
-
- if(ELEM5(buts->mainb, CONTEXT_OBJECT, CONTEXT_EDITING, CONTEXT_SHADING, CONTEXT_LOGIC, CONTEXT_SCRIPT)) {
- addqueue(sa->win, REDRAW, 1);
- buts->re_align= 1;
-
- if(new && buts->mainb==CONTEXT_SHADING) {
- /* does node previews too... */
- BIF_preview_changed(ID_TE);
- }
- }
- // always do context switch
- if(new) butspace_context_switch(buts, new);
-
- }
- sa= sa->next;
- }
-}
-
-
-/* callback */
-void drawbutspace(ScrArea *sa, void *spacedata)
-{
- ID *id, *idfrom;
- SpaceButs *sbuts= sa->spacedata.first;
- View2D *v2d= &sbuts->v2d;
- float col[3];
- int tab, align=0;
-
- /* context */
- buttons_active_id(&id, &idfrom);
- G.buts->lockpoin= id;
-
- myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- uiSetButLock(G.scene->id.lib!=0, ERROR_LIBDATA_MESSAGE);
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- /* select the context to be drawn, per contex/tab the actual context is tested */
- switch(sbuts->mainb) {
- case CONTEXT_SCENE:
- tab= sbuts->tab[CONTEXT_SCENE];
-
- if(tab== TAB_SCENE_RENDER)
- render_panels();
- else if(tab == TAB_SCENE_SEQUENCER)
- sequencer_panels();
- else if(tab == TAB_SCENE_ANIM)
- anim_panels();
- else if(tab == TAB_SCENE_SOUND)
- sound_panels();
-
- break;
- case CONTEXT_OBJECT:
- tab= sbuts->tab[CONTEXT_OBJECT];
-
- if(tab==TAB_OBJECT_OBJECT)
- object_panels();
- else if(tab==TAB_OBJECT_PHYSICS)
- physics_panels();
- else if(tab==TAB_OBJECT_PARTICLE)
- particle_panels();
-
- break;
- case CONTEXT_SHADING:
- tab= sbuts->tab[CONTEXT_SHADING];
-
- if(tab==TAB_SHADING_MAT)
- material_panels();
- else if(tab==TAB_SHADING_LAMP)
- lamp_panels();
- else if(tab==TAB_SHADING_WORLD)
- world_panels();
- else if(tab==TAB_SHADING_RAD)
- radio_panels();
- else if(tab==TAB_SHADING_TEX)
- texture_panels();
-
- break;
- case CONTEXT_EDITING:
- /* no tabs */
- editing_panels();
-
- break;
- case CONTEXT_SCRIPT:
- script_panels();
-
- break;
- case CONTEXT_LOGIC:
- /* no tabs */
- logic_buts();
- break;
- }
-
- uiClearButLock();
-
- /* when align changes, also do this for new panels */
- /* don't always align, this function is called during AnmatePanels too */
- if(sbuts->align)
- if(sbuts->re_align || sbuts->mainbo!=sbuts->mainb || sbuts->tabo!=sbuts->tab[sbuts->mainb])
- align= 1;
-
- uiDrawBlocksPanels(sa, align);
-
- /* since panels give different layouts, we have to make sure v2d.tot matches */
- uiMatchPanel_view2d(sa);
-
- sbuts->re_align= 0;
- // also for memory for finding which texture you'd like to see
- sbuts->mainbo= sbuts->mainb;
- sbuts->tabo= sbuts->tab[sbuts->mainb];
-
- myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
- draw_area_emboss(sa);
- myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
-
- /* always in end */
- sa->win_swap= WIN_BACK_OK;
-}
-
-
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
deleted file mode 100644
index b6dfd29d62a..00000000000
--- a/source/blender/src/buttons_editing.c
+++ /dev/null
@@ -1,6826 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-
-#ifdef WIN32
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
-#include "MEM_guardedalloc.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_cloth_types.h"
-#include "DNA_color_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_group_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_radio_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_packedFile_types.h"
-
-#include "BKE_blender.h"
-#include "BKE_brush.h"
-#include "BKE_cloth.h"
-#include "BKE_curve.h"
-#include "BKE_customdata.h"
-#include "BKE_colortools.h"
-#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_multires.h"
-#include "BKE_packedFile.h"
-#include "BKE_particle.h"
-#include "BKE_scene.h"
-#include "BKE_bmesh.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_vfontdata.h"
-#include "BLI_editVert.h"
-#include "BLI_dynstr.h"
-
-#include "BSE_filesel.h"
-
-#include "BIF_gl.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_editfont.h"
-#include "BIF_editkey.h"
-#include "BIF_editmesh.h"
-#include "BIF_editparticle.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_poselib.h"
-#include "BIF_poseobject.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_scrarea.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_previewrender.h"
-#include "BIF_butspace.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_displist.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_icons.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_poseobject.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_editface.h"
-#include "BDR_editobject.h"
-#include "BDR_sculptmode.h"
-#include "BDR_vpaint.h"
-#include "BDR_unwrapper.h"
-
-#include "BSE_drawview.h"
-#include "BSE_editipo.h"
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-#include "BSE_seqaudio.h"
-
-#include "RE_render_ext.h" // make_sticky
-
-#include "butspace.h" // own module
-#include "multires.h"
-
-#include "reeb.h"
-
-static float editbutweight= 1.0;
-float editbutvweight= 1;
-static int actmcol= 0, acttface= 0, acttface_rnd = 0, actmcol_rnd = 0;
-
-extern ListBase editNurb;
-
-/* *************************** Unicode Character Groups ****************** */
-unicodect uctabname[125] = {
- {"All", "All", 0x0000, 0xffff},
- {"Basic Latin", "Basic Latin", 0x0000, 0x007f},
- {"Latin 1 Supp", "Latin-1 Supplement", 0x0080, 0x00ff},
-
- {"Latin Ext. A.", "Latin Extended-A", 0x0100, 0x017F},
- {"Latin Ext. B.", "Latin Extended-B", 0x0180,0x024F},
- {"Latin Ext. Add.", "Latin Extended Additional", 0x1e00, 0x1eff},
-
- {"IPA Ext", "IPA Extensions", 0x0250, 0x02AF},
- {"Spacing Mod.", "Spacing Modifier Letters", 0x02b0, 0x02ff},
-
- {"Comb. Dia.", "Combining Diacritical Marks", 0x0300, 0x036F},
- {"Greek, Coptic", "Greek and Coptic", 0x0370, 0x03ff},
- {"Greek Ext.", "Greek Extended", 0x1f00, 0x1fff},
-
- {"Cyrillic", "Cyrillic", 0x0400, 0x04ff},
- {"Cyrillic Supp.", "Cyrillic Supplementary", 0x0500, 0x052f},
-
- {"Armenian", "Armenian", 0x0530, 0x058f},
- {"Hebrew", "Hebrew", 0x0590, 0x05ff},
-
-
- {"Arabic", "Arabic", 0x0600, 0x06ff},
- {"Syriac", "Syriac", 0x0700, 0x074f},
-
- {"Thaana", "Thaana", 0x0780, 0x07bf},
- {"Devanagari", "Devanagari", 0x0900, 0x097f},
-
- {"Bengali", "Bengali", 0x0980, 0x09ff},
- {"Gurmukhi", "Gurmukhi", 0x0a00, 0x0a7f},
-
- {"Gujarati", "Gujarati", 0x0a80, 0x0aff},
- {"Oriya", "Oriya", 0x0b00, 0x0b7f},
-
- {"Tamil", "Tamil", 0x0b80, 0x0bff},
- {"Tegulu", "Tegulu", 0x0c00, 0x0c7f},
-
- {"Kannada", "Kannada", 0x0c80, 0x0cff},
- {"Malayalam", "Malayalam", 0x0d00, 0x0d7f},
-
- {"Sinhala", "Sinhala", 0x0d80, 0x0dff},
- {"Thai", "Thai", 0x0e00, 0x0e7f},
-
- {"Lao", "Lao", 0x0e80, 0x0eff},
- {"Tibetan", "Tibetan", 0x0f00, 0x0fff},
-
- {"Myanmar", "Myanmar", 0x1000, 0x109f},
- {"Georgian", "Georgian", 0x10a0, 0x10ff},
-
- {"Ethiopic", "Ethiopic", 0x1200, 0x137f},
-
- {"Cherokee", "Cherokee", 0x13a0, 0x13ff},
- {"Unif. Canadian", "Unified Canadian Aboriginal Syllabics", 0x1400, 0x167f},
-
- {"Ogham", "Ogham", 0x1680, 0x169f},
- {"Runic", "Runic", 0x16a0, 0x16ff},
-
- {"Tagalog", "Tagalog", 0x1700, 0x171f},
- {"Hanunoo", "Hanunoo", 0x1720, 0x173f},
-
- {"Buhid", "Buhid", 0x1740, 0x175f},
- {"Tagbanwa", "Tagbanwa", 0x1760, 0x177f},
-
- {"Khmer", "Khmer", 0x1780, 0x17ff},
- {"Khmer Symb", "Khmer Symbols", 0x19e0, 0x19ff},
-
- {"Mongolian", "Mongolian", 0x1800, 0x18af},
-
- {"Limbu", "Limbu", 0x1900, 0x194f},
- {"Tai Le", "Tai Le", 0x1950, 0x197f},
-
- {"Phon. Ext.", "Phonetic Extensions", 0x1d00, 0x1d7f},
-
-
- {"Gen. Punct.", "General Punctutation", 0x2000, 0x206f},
- {"Super, Sub", "Superscripts and Subscripts", 0x2070, 0x209f},
-
- {"Curr. Symb.", "Currency Symbols", 0x20a0, 0x20cf},
- {"Comb. Diacrit.", "Combining Diacritical Marks for Symbols", 0x20d0, 0x20ff},
-
- {"Letter Symb", "Letterlike Symbols", 0x2100, 0x214f},
- {"Numb. Forms", "Number Forms", 0x2150, 0x218f},
-
- {"Arrows", "Arrows", 0x2190, 0x21ff},
- {"Math Oper.", "Mathematical Operators", 0x2200, 0x22ff},
-
- {"Misc. Tech.", "Miscellaneous Technical", 0x2300, 0x23ff},
- {"Ctrl. Pict.", "Control Pictures", 0x2400, 0x243f},
-
- {"OCR", "Optical Character Recognition", 0x2440, 0x245f},
- {"Enc. Alpha", "Enclosed Alphanumerics", 0x2460, 0x24ff},
-
- {"Bow Drawing", "Box Drawing", 0x2500, 0x257f},
- {"BLock Elem.", "Block Elements", 0x2580, 0x259f},
-
- {"Geom. Shapes", "Geometric Shapes", 0x25a0, 0x25ff},
- {"Misc. Symb.", "Miscellaneous Symbols", 0x2600, 0x26ff},
-
- {"Dingbats", "Dingbats", 0x2700, 0x27bf},
- {"Misc. Math A", "Miscellaneous Mathematical Symbols-A", 0x27c0, 0x27ef},
-
- {"Supp. Arrows-A", "Supplemental Arrows-A", 0x27f0, 0x27ff},
- {"Braille Pat.", "Braille Patterns", 0x2800, 0x28ff},
-
- {"Supp. Arrows-B", "Supplemental Arrows-B", 0x2900, 0x297f},
- {"Misc. Math B", "Miscellaneous Mathematical Symbols-B", 0x2980, 0x29ff},
-
- {"Supp. Math Op.", "Supplemental Mathematical Operators", 0x2a00, 0x2aff},
- {"Misc. Symb.", "Miscellaneous Symbols and Arrows", 0x2b00, 0x2bff},
-
- {"Kangxi Rad.", "Kangxi Radicals", 0x2f00, 0x2fdf},
-
- {"Ideographic", "Ideographic Description Characters", 0x2ff0, 0x2fff},
-
- {"Hiragana", "Hiragana", 0x3040, 0x309f},
- {"Katakana", "Katakana", 0x30a0, 0x30ff},
- {"Katakana Ext.", "Katakana Phonetic Extensions", 0x31f0, 0x31ff},
-
- {"Bopomofo", "Bopomofo", 0x3100, 0x312f},
- {"Bopomofo Ext.", "Bopomofo Extended", 0x31a0, 0x31bf},
-
- {"Hangul", "Hangul Jamo", 0x1100, 0x11ff},
- {"Hangul Comp.", "Hangul Compatibility Jamo", 0x3130, 0x318f},
- {"Hangul Syll.", "Hangul Syllables", 0xac00, 0xd7af},
-
- {"Kanbun", "Kanbun", 0x3190, 0x319f},
-
-
-
- {"Yijing Hex.", "Yijing Hexagram Symbols", 0x4dc0, 0x4dff},
-
- {"Yi Syllables", "Yi Syllables", 0xa000, 0xa48f},
- {"Yi Radicals", "Yi Radicals", 0xa490, 0xa4cf},
-
- {"High Surr.", "High Surrogate Area", 0xd800, 0xdbff},
-
- {"Low Surr.", "Low Surrogates", 0xdc00, 0xdfff},
- {"Priv. Use Area", "Private Use Area", 0xe000, 0xf8ff},
-
- {"CJK Rad. Supp.", "CJK Radicals Supplement", 0x2e80, 0x2eff},
- {"CJK Ideographs", "CJK Unified Ideographs", 0x4e00, 0x9faf},
- {"CJK Ideog. Ext. A", "CJK Unified Ideographs Extension A", 0x3400, 0x4dbf},
- {"CJK Ideog. Ext. B", "CJK Unified Ideographs Extension B", 0x20000, 0x2a6df},
- {"CJK Symbols.", "CJK Symbols and Punctuation", 0x3000, 0x303f},
- {"Enclosed CJK", "Enclosed CJK Letters and Months", 0x3200, 0x32ff},
- {"CJK Comp.", "CJK Compatibility", 0x3300, 0x33ff},
- {"CJK Comp. Ideog.", "CJK Compatibility Ideographs", 0xf900, 0xfaff},
- {"CJK Comp. Forms", "CJK Compatibility Forms", 0xfe30, 0xfe4f},
- {"CJK Comp. Supp.", "CJK Compatibility Ideographs Supplement", 0x2f800, 0x2fa1f},
-
- {"Alpha. Pres. Forms", "Alphabetic Presentation Forms", 0xfb00, 0xfb4f},
-
- {"Arabic Pres. A", "Arabic Presentation Forms-A", 0xfb50, 0xfdff},
- {"Arabic Pres. B", "Arabic Presentation Forms-B", 0xfe70, 0xfeff},
-
- {"Var. Sel.", "Variation Selectors", 0xfe00, 0xfe0f},
-
- {"Comb. Half", "Combining Half Marks", 0xfe20, 0xfe2f},
-
- {"Sml. From Var.", "Small Form Variants", 0xfe50, 0xfe6f},
-
- {"Half, Full Forms", "Halfwidth and Fullwidth Forms", 0xff00, 0xffef},
- {"Specials", "Specials", 0xfff0, 0xffff},
-
- {"Lin. B Syllab.", "Linear B Syllabary", 0x10000, 0x1007f},
- {"Lin. B Idog.", "Linear B Ideograms", 0x10080, 0x100ff},
-
- {"Aegean Num.", "Aegean Numbers", 0x10100, 0x1013f},
- {"Old Italic", "Old Italic", 0x10300, 0x1032f},
-
- {"Gothic", "Gothic", 0x10330, 0x1034f},
- {"Ugaritic", "Ugaritic", 0x10380, 0x1039f},
-
- {"Deseret", "Deseret", 0x10400, 0x1044f},
- {"Shavian", "Shavian", 0x10450, 0x1047f},
-
- {"Osmanya", "Osmanya", 0x10480, 0x104af},
- {"Cypriot Syll", "Cypriot Syllabary", 0x10800, 0x1083f},
-
- {"Bysantine Mus.", "Bysantine Musical Symbols", 0x1d000, 0x1d0ff},
- {"Music Symb.", "Musical Symbols", 0x1d100, 0x1d1ff},
-
- {"Tai Xuan Symb", "Tai Xuan Jing Symbols", 0x1d300, 0x1d35f},
- {"Math. Alpha Symb.", "Mathematical Alpanumeric Symbols", 0x1d400, 0x1d7ff},
-
-
- {"Tags", "Tags", 0xe0000, 0xe007f},
- {"Var. Supp", "Variation Selectors Supplement", 0xe0100, 0xe01ef},
-
- {"Supp. Priv. A", "Supplementary Private Use Area-A", 0xf0000, 0xffffd},
- {"Supp. Priv. B", "Supplementary Private Use Area-B", 0x100000, 0x10fffd}
-};
-
-
-/* *************************** static functions prototypes ****************** */
-VFont *exist_vfont(char *str);
-
-/* *************** */
-
-void do_common_editbuts(unsigned short event) // old name, is a mix of object and editing events....
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- Base *base;
- Object *ob= OBACT;
- Material *ma;
- Nurb *nu;
- Curve *cu;
- BezTriple *bezt;
- BPoint *bp;
- unsigned int local;
- int a, bit, index= -1;
-
- switch(event) {
-
- case B_MATWICH:
- if(G.obedit && G.obedit->actcol>0) {
- if(G.obedit->type == OB_MESH) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- if(index== -1) index= efa->mat_nr;
- else if(index!=efa->mat_nr) {
- error("Mixed colors");
- return;
- }
- }
- }
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- nu= editNurb.first;
- while(nu) {
- if( isNurbsel(nu) ) {
- if(index== -1) index= nu->mat_nr;
- else if(index!=nu->mat_nr) {
- error("Mixed colors");
- return;
- }
- }
- nu= nu->next;
- }
- }
- if(index>=0) {
- G.obedit->actcol= index+1;
- scrarea_queue_winredraw(curarea);
- }
- }
- break;
- case B_MATNEW:
- new_material_to_objectdata(ob);
- scrarea_queue_winredraw(curarea);
- BIF_undo_push("New material");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D_Z, 0);
- allqueue(REDRAWOOPS, 0);
- break;
- case B_MATDEL:
- delete_material_index();
- scrarea_queue_winredraw(curarea);
- BIF_undo_push("Delete material index");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D_Z, 0);
- allqueue(REDRAWOOPS, 0);
- break;
- case B_MATASS:
- if(G.obedit && G.obedit->actcol>0) {
- if(G.obedit->type == OB_MESH) {
- efa= em->faces.first;
- while(efa) {
- if(efa->f & SELECT)
- efa->mat_nr= G.obedit->actcol-1;
- efa= efa->next;
- }
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- nu= editNurb.first;
- while(nu) {
- if( isNurbsel(nu) )
- nu->mat_nr= nu->charidx= G.obedit->actcol-1;
- nu= nu->next;
- }
- }
- else if (G.obedit->type == OB_FONT) {
- if (mat_to_sel()) {
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- allqueue(REDRAWVIEW3D_Z, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- shade_buttons_change_3d();
- BIF_undo_push("Assign material index");
- }
- break;
- case B_MATASS_BROWSE:
- /* if slot available, make that index active, and assign */
- /* else, make new slot, and assign */
- ma= BLI_findlink(&G.main->mat, G.buts->menunr-1);
- if(ma) {
- ob->actcol= find_material_index(ob, ma);
- if(ob->actcol==0) {
- assign_material(ob, ma, ob->totcol+1);
- ob->actcol= ob->totcol;
- }
- }
- else {
- do_common_editbuts(B_MATNEW);
- }
- do_common_editbuts(B_MATASS);
- break;
-
- case B_MATCOL2:
- ma= give_current_material(ob, ob->actcol);
- BKE_icon_changed(BKE_icon_getid((ID *)ma));
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_MATSEL:
- case B_MATDESEL:
- if(G.obedit) {
- if(G.obedit->type == OB_MESH) {
- if (event==B_MATSEL) {
- editmesh_select_by_material(G.obedit->actcol-1);
- } else {
- editmesh_deselect_by_material(G.obedit->actcol-1);
- }
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- nu= editNurb.first;
- while(nu) {
- if(nu->mat_nr==G.obedit->actcol-1) {
- if(nu->bezt) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if(event==B_MATSEL) {
- bezt->f1 |= SELECT;
- bezt->f2 |= SELECT;
- bezt->f3 |= SELECT;
- }
- else {
- bezt->f1 &= ~SELECT;
- bezt->f2 &= ~SELECT;
- bezt->f3 &= ~SELECT;
- }
- }
- bezt++;
- }
- }
- else if(nu->bp) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->hide==0) {
- if(event==B_MATSEL) bp->f1 |= SELECT;
- else bp->f1 &= ~SELECT;
- }
- bp++;
- }
- }
- }
- nu= nu->next;
- }
- BIF_undo_push("Select material index");
- }
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- countall();
- break;
- case B_HIDE:
- if(G.obedit) {
- if(G.obedit->type == OB_MESH) hide_mesh(0);
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) hideNurb(0);
- }
- break;
- case B_REVEAL:
- if(G.obedit) {
- if(G.obedit->type == OB_MESH) reveal_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) revealNurb();
- }
- else if(FACESEL_PAINT_TEST) reveal_tface();
-
- break;
- case B_SELSWAP:
- if(G.obedit) {
- if(G.obedit->type == OB_MESH) selectswap_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) selectswapNurb();
- }
- break;
- case B_AUTOTEX:
- if(ob && G.obedit==0) {
- if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data);
- }
- break;
- case B_DOCENTER:
- docenter(0);
- break;
- case B_DOCENTERNEW:
- docenter_new();
- break;
- case B_DOCENTERCURSOR:
- docenter_cursor();
- break;
- case B_SETSMOOTH:
- case B_SETSOLID:
- if(G.obedit) {
- if(G.obedit->type == OB_MESH) {
- mesh_set_smooth_faces((event==B_SETSMOOTH));
- }
- else {
- nurb_set_smooth((event==B_SETSMOOTH));
- }
- }
- else if(G.vd) {
- base= FIRSTBASE;
- while(base) {
- if(TESTBASELIB(base)) {
- if(base->object->type==OB_MESH) {
- mesh_set_smooth_flag(base->object, (event==B_SETSMOOTH));
- }
- else if ELEM(base->object->type, OB_SURF, OB_CURVE) {
- cu= base->object->data;
- nu= cu->nurb.first;
- while(nu) {
- if(event==B_SETSMOOTH) nu->flag |= ME_SMOOTH;
- else nu->flag &= ~ME_SMOOTH;
- nu= nu->next;
- }
- makeDispListCurveTypes(base->object, 0);
- }
- }
- base= base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
-
- if(event == B_SETSMOOTH) BIF_undo_push("Set Smooth");
- else BIF_undo_push("Set Solid");
- }
- break;
- case B_CHANGEDEP:
- DAG_scene_sort(G.scene); // makes new dag
- if(ob) ob->recalc |= OB_RECALC;
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_ADDKEY:
- insert_shapekey(ob);
- break;
- case B_SETKEY:
- ob->shapeflag |= OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_LOCKKEY:
- ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_NEXTKEY:
- {
- Key *key= ob_get_key(ob);
- if(ob->shapenr == BLI_countlist(&key->block))
- ob->shapenr= 1;
- else ob->shapenr++;
- do_common_editbuts(B_SETKEY);
- break;
- }
- case B_PREVKEY:
- {
- Key *key= ob_get_key(ob);
- if(ob->shapenr <= 1)
- ob->shapenr= BLI_countlist(&key->block);
- else ob->shapenr--;
- do_common_editbuts(B_SETKEY);
- break;
- }
- case B_NAMEKEY:
- allspace(REMAKEIPO, 0);
- allqueue (REDRAWIPO, 0);
- break;
- case B_DELKEY:
- delete_key(OBACT);
- allqueue(REDRAWACTION, 0);
- break;
-
-
- default:
- if (G.vd==NULL)
- break;
-
- if(event>=B_OBLAY && event<=B_OBLAY+31) {
- local= BASACT->lay & 0xFF000000;
- BASACT->lay -= local;
- if(BASACT->lay==0 || (G.qual & LR_SHIFTKEY)==0) {
- bit= event-B_OBLAY;
- BASACT->lay= 1<<bit;
- scrarea_queue_winredraw(curarea);
- }
- BASACT->lay += local;
- /* optimal redraw */
- if( (ob->lay & G.vd->lay) && (BASACT->lay & G.vd->lay) );
- else if( (ob->lay & G.vd->lay)==0 && (BASACT->lay & G.vd->lay)==0 );
- else {
- allqueue(REDRAWVIEW3D, 0);
- DAG_scene_sort(G.scene);
- }
- ob->lay= BASACT->lay;
- }
- }
-
-}
-
-/* *************************** MESH ******************************** */
-
-static void verify_customdata_name_func(void *data1, void *data2)
-{
- CustomData *data= (CustomData*)data1;
- CustomDataLayer *layer= (CustomDataLayer*)data2;
-
- CustomData_set_layer_unique_name(data, layer - data->layers);
-}
-
-static void delete_customdata_layer(void *data1, void *data2)
-{
- Mesh *me= (Mesh*)data1;
- CustomData *data= (G.obedit)? &G.editMesh->fdata: &me->fdata;
- CustomDataLayer *layer= (CustomDataLayer*)data2;
- void *actlayerdata, *rndlayerdata, *layerdata=layer->data;
- int type= layer->type;
- int index= CustomData_get_layer_index(data, type);
- int i, actindex, rndindex;
-
- /*ok, deleting a non-active layer needs to preserve the active layer indices.
- to do this, we store a pointer to the .data member of both layer and the active layer,
- (to detect if we're deleting the active layer or not), then use the active
- layer data pointer to find where the active layer has ended up.
-
- this is necassary because the deletion functions only support deleting the active
- layer. */
- actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data;
- rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data;
- CustomData_set_layer_active(data, type, layer - &data->layers[index]);
-
- /* Multires is handled seperately because the display data is separate
- from the data stored in multires */
- if(me && me->mr) {
- multires_delete_layer(me, &me->mr->fdata, type, layer - &data->layers[index]);
- multires_level_to_editmesh(OBACT, me, 0);
- multires_finish_mesh_update(OBACT);
- }
- else if(G.obedit) {
- EM_free_data_layer(data, type);
- }
- else if(me) {
- CustomData_free_layer_active(data, type, me->totface);
- mesh_update_customdata_pointers(me);
- }
-
- if(!CustomData_has_layer(data, type)) {
- if(type == CD_MCOL && (G.f & G_VERTEXPAINT))
- G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */
- }
-
- /*reconstruct active layer*/
- if (actlayerdata != layerdata) {
- /*find index. . .*/
- actindex = CustomData_get_layer_index(data, type);
- for (i=actindex; i<data->totlayer; i++) {
- if (data->layers[i].data == actlayerdata) {
- actindex = i - actindex;
- break;
- }
- }
-
- /*set index. . .*/
- CustomData_set_layer_active(data, type, actindex);
- }
-
- if (rndlayerdata != layerdata) {
- /*find index. . .*/
- rndindex = CustomData_get_layer_index(data, type);
- for (i=rndindex; i<data->totlayer; i++) {
- if (data->layers[i].data == rndlayerdata) {
- rndindex = i - rndindex;
- break;
- }
- }
-
- /*set index. . .*/
- CustomData_set_layer_render(data, type, rndindex);
- }
-
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
-
- if(type == CD_MTFACE)
- BIF_undo_push("Delete UV Texture");
- else if(type == CD_MCOL)
- BIF_undo_push("Delete Vertex Color");
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-static int customdata_buttons(
- uiBlock *block, Mesh *me, CustomData *data,
- int type, int *activep, int *renderp,
- int setevt, int setevt_rnd, int newevt,
- char *label, char *shortlabel, char *browsetip, char *browsetip_rnd,
- char *newtip, char *deltip, int x, int y)
-{
- CustomDataLayer *layer;
- uiBut *but;
- int i, count= CustomData_number_of_layers(data, type);
-
- if(count >= MAX_MTFACE) {
- uiDefBut(block, LABEL, 0, label, x,y,220,19, 0, 0.0, 0, 0, 0, "");
- }
- else {
- uiDefBut(block, LABEL, 0, label, x,y,140,19, 0, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, newevt, "New", x+140,y,80,19, 0,0,0,0,0, newtip);
- uiBlockEndAlign(block);
- }
-
- y -= (count)? 24: 19;
-
- uiBlockBeginAlign(block);
- for (count=1, i=0; i<data->totlayer; i++) {
- layer= &data->layers[i];
-
- if(layer->type == type) {
- *activep= layer->active + 1;
- *renderp= layer->active_rnd + 1;
-
- uiDefIconButI(block, ROW, setevt, ICON_VIEW3D, x,y,25,19, activep, 1.0, count, 0, 0, browsetip);
- uiDefIconButI(block, ROW, setevt_rnd, ICON_SCENE, x+25,y,25,19, renderp, 1.0, count, 0, 0, browsetip_rnd);
- but=uiDefBut(block, TEX, setevt, "", x+50,y,145,19, layer->name, 0.0, 31.0, 0, 0, label);
- uiButSetFunc(but, verify_customdata_name_func, data, layer);
- but= uiDefIconBut(block, BUT, B_NOP, VICON_X, x+195,y,25,19, NULL, 0.0, 0.0, 0.0, 0.0, deltip);
- uiButSetFunc(but, delete_customdata_layer, me, layer);
-
-
- count++;
- y -= 19;
- }
- }
- uiBlockEndAlign(block);
-
- return y;
-}
-
-static void editing_panel_mesh_type(Object *ob, Mesh *me)
-{
- uiBlock *block;
- uiBut *but;
- float val;
- CustomData *fdata;
- int yco;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_type", UI_EMBOSS, UI_HELV, curarea->win);
- if( uiNewPanel(curarea, block, "Mesh", "Editing", 320, 0, 318, 204)==0) return;
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ME_AUTOSMOOTH, REDRAWVIEW3D, "Auto Smooth",10,180,170,19, &me->flag, 0, 0, 0, 0, "Treats all set-smoothed faces with angles less than Degr: as 'smooth' during render");
- uiDefButS(block, NUM, B_DIFF, "Degr:", 10,160,170,19, &me->smoothresh, 1, 80, 0, 0, "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
- uiBlockEndAlign(block);
-
- /* Retopo */
- if(G.obedit) {
- uiBlockBeginAlign(block);
- but= uiDefButBitC(block,TOG,RETOPO,B_NOP, "Retopo", 10,130,170,19, &G.scene->toolsettings->retopo_mode, 0,0,0,0, "Turn on the re-topology tool");
- uiButSetFunc(but,retopo_toggle,ob,me);
- if(G.scene->toolsettings->retopo_mode) {
- but= uiDefButBitC(block,TOG,RETOPO_PAINT,B_NOP,"Paint", 10,110,55,19, &G.scene->toolsettings->retopo_mode,0,0,0,0, "Draw intersecting lines in the 3d view, ENTER creates quad or tri faces, wrapped onto other objects in the 3d view.");
- uiButSetFunc(but,retopo_paint_toggle,ob,me);
- but= uiDefBut(block,BUT,B_NOP,"Retopo All", 65,110,115,19, 0,0,0,0,0, "Apply the re-topology tool to all selected vertices");
- uiButSetFunc(but,retopo_do_all_cb,ob,me);
- }
- uiBlockEndAlign(block);
- }
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_DOCENTER, "Center", 10, 80, 65, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
- uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 75, 80, 105, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
- uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ME_TWOSIDED, REDRAWVIEW3D, "Double Sided", 10,30,170,19, &me->flag, 0, 0, 0, 0, "Render/display the mesh with double or single sided lighting");
- uiDefButBitS(block, TOG, ME_NOPUNOFLIP, REDRAWVIEW3D, "No V.Normal Flip", 10,10,170,19, &me->flag, 0, 0, 0, 0, "Disables flipping of vertexnormals during render");
- uiBlockEndAlign(block);
-
- uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, B_REDR, "TexMesh: ", 190,180,220,19, &me->texcomesh, "Derive texture coordinates from another mesh.");
-
- if(me->msticky) val= 1.0; else val= 0.0;
- uiDefBut(block, LABEL, 0, "Sticky", 190,155,140,19, 0, val, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- if(me->msticky==NULL) {
- uiDefBut(block, BUT, B_MAKESTICKY, "Make", 330,155, 80,19, 0, 0, 0, 0, 0, "Creates Sticky coordinates from the current camera view background picture");
- }
- else uiDefBut(block, BUT, B_DELSTICKY, "Delete", 330,155, 80,19, 0, 0, 0, 0, 0, "Deletes Sticky texture coordinates");
- uiBlockEndAlign(block);
-
- fdata= (G.obedit)? &G.editMesh->fdata: &me->fdata;
- yco= customdata_buttons(block, me, fdata, CD_MTFACE, &acttface, &acttface_rnd,
- B_SETTFACE, B_SETTFACE_RND, B_NEWTFACE, "UV Texture", "UV Texture:",
- "Set active UV texture", "Set rendering UV texture", "Creates a new UV texture layer",
- "Removes the current UV texture layer", 190, 130);
-
- yco= customdata_buttons(block, me, fdata, CD_MCOL, &actmcol, &actmcol_rnd,
- B_SETMCOL, B_SETMCOL_RND, B_NEWMCOL, "Vertex Color", "Vertex Color:",
- "Sets active vertex color layer", "Sets rendering vertex color layer", "Creates a new vertex color layer",
- "Removes the current vertex color layer", 190, yco-5);
-
- if(yco < 0)
- uiNewPanelHeight(block, 204 - yco);
-}
-
-/* *************************** MODIFIERS ******************************** */
-
-void do_modifier_panels(unsigned short event)
-{
- Object *ob = OBACT;
-
- switch(event) {
- case B_MODIFIER_REDRAW:
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- break;
-
- case B_MODIFIER_RECALC:
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWOOPS, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- object_handle_update(ob);
- countall();
- break;
- }
-}
-
-static void modifiers_add(void *ob_v, int type)
-{
- Object *ob = ob_v;
- ModifierTypeInfo *mti = modifierType_getInfo(type);
-
- if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
- ModifierData *md = ob->modifiers.first;
-
- while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) {
- md = md->next;
- }
-
- BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type));
- } else {
- BLI_addtail(&ob->modifiers, modifier_new(type));
- }
- BIF_undo_push("Add modifier");
-}
-
-typedef struct MenuEntry {
- char *name;
- int ID;
-} MenuEntry;
-
-static int menuEntry_compare_names(const void *entry1, const void *entry2)
-{
- return strcmp(((MenuEntry *)entry1)->name, ((MenuEntry *)entry2)->name);
-}
-
-static uiBlock *modifiers_add_menu(void *ob_v)
-{
- Object *ob = ob_v;
- uiBlock *block;
- int i, yco=0;
- int numEntries = 0;
- MenuEntry entries[NUM_MODIFIER_TYPES];
-
- block= uiNewBlock(&curarea->uiblocks, "modifier_add_menu",
- UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, modifiers_add, ob);
-
- for (i=eModifierType_None+1; i<NUM_MODIFIER_TYPES; i++) {
- ModifierTypeInfo *mti = modifierType_getInfo(i);
-
- /* Only allow adding through appropriate other interfaces */
- if(ELEM3(i, eModifierType_Softbody, eModifierType_Hook, eModifierType_ParticleSystem)) continue;
-
- if(ELEM3(i, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim)) continue;
-
- if((mti->flags&eModifierTypeFlag_AcceptsCVs) ||
- (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) {
- entries[numEntries].name = mti->name;
- entries[numEntries].ID = i;
-
- ++numEntries;
- }
- }
-
- qsort(entries, numEntries, sizeof(*entries), menuEntry_compare_names);
-
-
- for(i = 0; i < numEntries; ++i)
- uiDefBut(block, BUTM, B_MODIFIER_RECALC, entries[i].name,
- 0, yco -= 20, 160, 19, NULL, 0, 0, 1, entries[i].ID, "");
-
- uiTextBoundsBlock(block, 50);
- uiBlockSetDirection(block, UI_DOWN);
-
- return block;
-}
-
-static void modifiers_del(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md;
-
- /* It seems on rapid delete it is possible to
- * get called twice on same modifier, so make
- * sure it is in list.
- */
- for (md=ob->modifiers.first; md; md=md->next)
- if (md==md_v)
- break;
-
- if (!md)
- return;
-
- if(md->type==eModifierType_ParticleSystem){
- ParticleSystemModifierData *psmd=(ParticleSystemModifierData*)md;
- BLI_remlink(&ob->particlesystem, psmd->psys);
- psys_free(ob,psmd->psys);
- }
-
- BLI_remlink(&ob->modifiers, md_v);
-
- modifier_free(md_v);
-
- BIF_undo_push("Del modifier");
-}
-
-int mod_moveUp(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
-
- if (md->prev) {
- ModifierTypeInfo *mti = modifierType_getInfo(md->type);
-
- if (mti->type!=eModifierTypeType_OnlyDeform) {
- ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
-
- if (nmti->flags&eModifierTypeFlag_RequiresOriginalData)
- return -1;
- }
-
- BLI_remlink(&ob->modifiers, md);
- BLI_insertlink(&ob->modifiers, md->prev->prev, md);
- }
-
- return 0;
-}
-
-static void modifiers_moveUp(void *ob_v, void *md_v)
-{
- if( mod_moveUp( ob_v, md_v ) )
- error("Cannot move above a modifier requiring original data.");
- else
- BIF_undo_push("Move modifier");
-}
-
-int mod_moveDown(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
-
- if (md->next) {
- ModifierTypeInfo *mti = modifierType_getInfo(md->type);
-
- if (mti->flags&eModifierTypeFlag_RequiresOriginalData) {
- ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
-
- if (nmti->type!=eModifierTypeType_OnlyDeform)
- return -1;
- }
-
- BLI_remlink(&ob->modifiers, md);
- BLI_insertlink(&ob->modifiers, md->next, md);
- }
-
- return 0;
-}
-
-static void modifiers_moveDown(void *ob_v, void *md_v)
-{
- if( mod_moveDown( ob_v, md_v ) )
- error("Cannot move beyond a non-deforming modifier.");
- else
- BIF_undo_push("Move modifier");
-}
-
-static void modifier_testLatticeObj(char *name, ID **idpp)
-{
- ID *id;
-
- for (id= G.main->object.first; id; id= id->next) {
- if( strcmp(name, id->name+2)==0 ) {
- if (((Object *)id)->type != OB_LATTICE) {
- error ("Lattice deform object must be a lattice");
- break;
- }
- *idpp= id;
- return;
- }
- }
- *idpp= 0;
-}
-
-static void modifier_testCurveObj(char *name, ID **idpp)
-{
- ID *id;
-
- for (id= G.main->object.first; id; id= id->next) {
- if( strcmp(name, id->name+2)==0 ) {
- if (((Object *)id)->type != OB_CURVE) {
- error ("Curve deform object must be a curve");
- break;
- }
- *idpp= id;
- return;
- }
- }
- *idpp= 0;
-}
-
-static void modifier_testMeshObj(char *name, ID **idpp)
-{
- ID *id;
-
- for (id= G.main->object.first; id; id= id->next) {
- /* no boolean on its own object */
- if(id != (ID *)OBACT) {
- if( strcmp(name, id->name+2)==0 ) {
- if (((Object *)id)->type != OB_MESH) {
- error ("Boolean modifier object must be a mesh");
- break;
- }
- *idpp= id;
- return;
- }
- }
- }
- *idpp= NULL;
-}
-
-static void modifier_testArmatureObj(char *name, ID **idpp)
-{
- ID *id;
-
- for (id= G.main->object.first; id; id= id->next) {
- if( strcmp(name, id->name+2)==0 ) {
- if (((Object *)id)->type != OB_ARMATURE) {
- error ("Armature deform object must be an armature");
- break;
- }
- *idpp= id;
- return;
- }
- }
- *idpp= 0;
-}
-
-static void modifier_testTexture(char *name, ID **idpp)
-{
- ID *id;
-
- for(id = G.main->tex.first; id; id = id->next) {
- if(strcmp(name, id->name + 2) == 0) {
- *idpp = id;
- /* texture gets user, objects not: delete object = clear modifier */
- id_us_plus(id);
- return;
- }
- }
- *idpp = 0;
-}
-
-#if 0 /* this is currently unused, but could be useful in the future */
-static void modifier_testMaterial(char *name, ID **idpp)
-{
- ID *id;
-
- for(id = G.main->mat.first; id; id = id->next) {
- if(strcmp(name, id->name + 2) == 0) {
- *idpp = id;
- return;
- }
- }
- *idpp = 0;
-}
-#endif
-
-static void modifier_testImage(char *name, ID **idpp)
-{
- ID *id;
-
- for(id = G.main->image.first; id; id = id->next) {
- if(strcmp(name, id->name + 2) == 0) {
- *idpp = id;
- return;
- }
- }
- *idpp = 0;
-}
-
-/* autocomplete callback for ID buttons */
-void autocomplete_image(char *str, void *arg_v)
-{
- /* search if str matches the beginning of an ID struct */
- if(str[0]) {
- AutoComplete *autocpl = autocomplete_begin(str, 22);
- ID *id;
-
- for(id = G.main->image.first; id; id = id->next)
- autocomplete_do_name(autocpl, id->name+2);
-
- autocomplete_end(autocpl, str);
- }
-}
-
-/* autocomplete callback for ID buttons */
-void autocomplete_meshob(char *str, void *arg_v)
-{
- /* search if str matches the beginning of an ID struct */
- if(str[0]) {
- AutoComplete *autocpl = autocomplete_begin(str, 22);
- ID *id;
-
- for(id = G.main->object.first; id; id = id->next)
- if(((Object *)id)->type == OB_MESH)
- autocomplete_do_name(autocpl, id->name+2);
-
- autocomplete_end(autocpl, str);
- }
-}
-static void modifiers_convertParticles(void *obv, void *mdv)
-{
- Object *obn;
- ModifierData *md = mdv;
- ParticleSystem *psys;
- ParticleCacheKey *key, **cache;
- ParticleSettings *part;
- Mesh *me;
- MVert *mvert;
- MEdge *medge;
- int a, k, kmax;
- int totvert=0, totedge=0, cvert=0;
- int totpart=0, totchild=0;
-
- if(md->type != eModifierType_ParticleSystem) return;
-
- if(G.f & G_PARTICLEEDIT) return;
-
- psys=((ParticleSystemModifierData *)md)->psys;
- part= psys->part;
-
- if(part->draw_as == PART_DRAW_GR || part->draw_as == PART_DRAW_OB) {
- make_object_duplilist_real(NULL);
- }
- else {
- if(part->draw_as != PART_DRAW_PATH || psys->pathcache == 0)
- return;
-
- totpart= psys->totcached;
- totchild= psys->totchildcache;
-
- if(totchild && (part->draw&PART_DRAW_PARENT)==0)
- totpart= 0;
-
- /* count */
- cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
- key= cache[a];
- totvert+= key->steps+1;
- totedge+= key->steps;
- }
-
- cache= psys->childcache;
- for(a=0; a<totchild; a++) {
- key= cache[a];
- totvert+= key->steps+1;
- totedge+= key->steps;
- }
-
- if(totvert==0) return;
-
- /* add new mesh */
- obn= add_object(OB_MESH);
- me= obn->data;
-
- me->totvert= totvert;
- me->totedge= totedge;
-
- me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
- me->medge= CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
- me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, 0);
-
- mvert= me->mvert;
- medge= me->medge;
-
- /* copy coordinates */
- cache= psys->pathcache;
- for(a=0; a<totpart; a++) {
- key= cache[a];
- kmax= key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
- VECCOPY(mvert->co,key->co);
- if(k) {
- medge->v1= cvert-1;
- medge->v2= cvert;
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
- medge++;
- }
- }
- }
-
- cache=psys->childcache;
- for(a=0; a<totchild; a++) {
- key=cache[a];
- kmax=key->steps;
- for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
- VECCOPY(mvert->co,key->co);
- if(k) {
- medge->v1=cvert-1;
- medge->v2=cvert;
- medge->flag= ME_EDGEDRAW|ME_EDGERENDER|ME_LOOSEEDGE;
- medge++;
- }
- }
- }
- }
-
- DAG_scene_sort(G.scene);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Convert particles to mesh object(s).");
-}
-
-static void modifiers_applyModifier(void *obv, void *mdv)
-{
- Object *ob = obv;
- ModifierData *md = mdv;
- DerivedMesh *dm;
- Mesh *me = ob->data;
- int converted = 0;
-
- if (G.obedit) {
- error("Modifiers cannot be applied in editmode");
- return;
- } else if (((ID*) ob->data)->us>1) {
- error("Modifiers cannot be applied to multi-user data");
- return;
- }
-
- if (md!=ob->modifiers.first) {
- if (!okee("Modifier is not first"))
- return;
- }
-
- if (ob->type==OB_MESH) {
- if(me->mr && multires_modifier_warning()) {
- error("Modifier changes topology; cannot apply with multires active");
- return;
- }
- if(me->key) {
- error("Modifier cannot be applied to Mesh with Shape Keys");
- return;
- }
-
- mesh_pmv_off(ob, me);
-
- dm = mesh_create_derived_for_modifier(ob, md);
- if (!dm) {
- error("Modifier is disabled or returned error, skipping apply");
- return;
- }
-
- DM_to_mesh(dm, me);
- converted = 1;
-
- dm->release(dm);
- }
- else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
- ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- Curve *cu = ob->data;
- int numVerts;
- float (*vertexCos)[3];
-
- if (!okee("Apply will only change CV points, not tesselated/bevel vertices"))
- return;
-
- if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md))) {
- error("Modifier is disabled, skipping apply");
- return;
- }
-
- vertexCos = curve_getVertexCos(cu, &cu->nurb, &numVerts);
- mti->deformVerts(md, ob, NULL, vertexCos, numVerts);
- curve_applyVertexCos(cu, &cu->nurb, vertexCos);
-
- converted = 1;
-
- MEM_freeN(vertexCos);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else {
- error("Cannot apply modifier for this object type");
- return;
- }
-
- if (converted) {
- BLI_remlink(&ob->modifiers, md);
- modifier_free(md);
-
- BIF_undo_push("Apply modifier");
- }
-}
-
-static void modifiers_copyModifier(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
- ModifierData *nmd = modifier_new(md->type);
-
- modifier_copyData(md, nmd);
-
- BLI_insertlink(&ob->modifiers, md, nmd);
-
- BIF_undo_push("Copy modifier");
-}
-
-static void modifiers_setOnCage(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md;
-
- int i, cageIndex = modifiers_getCageIndex(ob, NULL );
-
- for( i = 0, md=ob->modifiers.first; md; ++i, md=md->next )
- if( md == md_v ) {
- if( i >= cageIndex )
- md->mode ^= eModifierMode_OnCage;
- break;
- }
-}
-
-static void modifiers_clearHookOffset(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
-
- if (hmd->object) {
- Mat4Invert(hmd->object->imat, hmd->object->obmat);
- Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
- BIF_undo_push("Clear hook offset");
- }
-}
-
-static void modifiers_cursorHookCenter(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
-
- if (G.vd) {
- float *curs = give_cursor();
- float bmat[3][3], imat[3][3];
-
- where_is_object(ob);
-
- Mat3CpyMat4(bmat, ob->obmat);
- Mat3Inv(imat, bmat);
-
- curs= give_cursor();
- hmd->cent[0]= curs[0]-ob->obmat[3][0];
- hmd->cent[1]= curs[1]-ob->obmat[3][1];
- hmd->cent[2]= curs[2]-ob->obmat[3][2];
- Mat3MulVecfl(imat, hmd->cent);
-
- BIF_undo_push("Hook cursor center");
- }
-}
-
-static void modifiers_selectHook(void *ob_v, void *md_v)
-{
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
-
- hook_select(hmd);
-}
-
-static void modifiers_reassignHook(void *ob_v, void *md_v)
-{
- ModifierData *md = md_v;
- HookModifierData *hmd = (HookModifierData*) md;
- float cent[3];
- int *indexar, tot, ok;
- char name[32];
-
- ok= hook_getIndexArray(&tot, &indexar, name, cent);
-
- if (!ok) {
- error("Requires selected vertices or active Vertex Group");
- } else {
- if (hmd->indexar) {
- MEM_freeN(hmd->indexar);
- }
-
- VECCOPY(hmd->cent, cent);
- hmd->indexar = indexar;
- hmd->totindex = tot;
- }
-}
-
-static void modifiers_convertToReal(void *ob_v, void *md_v)
-{
- Object *ob = ob_v;
- ModifierData *md = md_v;
- ModifierData *nmd = modifier_new(md->type);
-
- modifier_copyData(md, nmd);
- nmd->mode &= ~eModifierMode_Virtual;
-
- BLI_addhead(&ob->modifiers, nmd);
-
- ob->partype = PAROBJECT;
-
- BIF_undo_push("Modifier convert to real");
-}
-
-static void build_uvlayer_menu_vars(CustomData *data, char **menu_string,
- int *uvlayer_tmp, char *uvlayer_name)
-{
- char strtmp[38];
- int totuv, i;
- CustomDataLayer *layer
- = &data->layers[CustomData_get_layer_index(data, CD_MTFACE)];
-
- *uvlayer_tmp = -1;
-
- totuv = CustomData_number_of_layers(data, CD_MTFACE);
-
- *menu_string = MEM_callocN(sizeof(**menu_string) * (totuv * 38 + 10),
- "menu_string");
- sprintf(*menu_string, "UV Layer%%t");
- for(i = 0; i < totuv; i++) {
- /* assign first layer as uvlayer_name if uvlayer_name is null. */
- if(strcmp(layer->name, uvlayer_name) == 0) *uvlayer_tmp = i + 1;
- sprintf(strtmp, "|%s%%x%d", layer->name, i + 1);
- strcat(*menu_string, strtmp);
- layer++;
- }
-
- /* there is no uvlayer defined, or else it was deleted. Assign active
- * layer, then recalc modifiers.
- */
- if(*uvlayer_tmp == -1) {
- if(CustomData_get_active_layer_index(data, CD_MTFACE) != -1) {
- *uvlayer_tmp = 1;
- layer = data->layers;
- for(i = 0; i < CustomData_get_active_layer_index(data, CD_MTFACE);
- i++, layer++) {
- if(layer->type == CD_MTFACE) (*uvlayer_tmp)++;
- }
- strcpy(uvlayer_name, layer->name);
-
- /* update the modifiers */
- do_modifier_panels(B_MODIFIER_RECALC);
- } else {
- /* ok we have no uv layers, so make sure menu button knows that.*/
- *uvlayer_tmp = 0;
- }
- }
-}
-
-void set_wave_uvlayer(void *arg1, void *arg2)
-{
- WaveModifierData *wmd=arg1;
- CustomDataLayer *layer = arg2;
-
- /*check we have UV layers*/
- if (wmd->uvlayer_tmp < 1) return;
- layer = layer + (wmd->uvlayer_tmp-1);
-
- strcpy(wmd->uvlayer_name, layer->name);
-}
-
-void set_displace_uvlayer(void *arg1, void *arg2)
-{
- DisplaceModifierData *dmd=arg1;
- CustomDataLayer *layer = arg2;
-
- /*check we have UV layers*/
- if (dmd->uvlayer_tmp < 1) return;
- layer = layer + (dmd->uvlayer_tmp-1);
-
- strcpy(dmd->uvlayer_name, layer->name);
-}
-
-void set_uvproject_uvlayer(void *arg1, void *arg2)
-{
- UVProjectModifierData *umd=arg1;
- CustomDataLayer *layer = arg2;
-
- /*check we have UV layers*/
- if (umd->uvlayer_tmp < 1) return;
- layer = layer + (umd->uvlayer_tmp-1);
-
- strcpy(umd->uvlayer_name, layer->name);
-}
-
-static void modifiers_bindMeshDeform(void *ob_v, void *md_v)
-{
- MeshDeformModifierData *mmd = (MeshDeformModifierData*) md_v;
- Object *ob = (Object*)ob_v;
-
- if(mmd->bindcos) {
- if(mmd->bindweights) MEM_freeN(mmd->bindweights);
- if(mmd->bindcos) MEM_freeN(mmd->bindcos);
- if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
- if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
- if(mmd->dynverts) MEM_freeN(mmd->dynverts);
- mmd->bindweights= NULL;
- mmd->bindcos= NULL;
- mmd->dyngrid= NULL;
- mmd->dyninfluences= NULL;
- mmd->dynverts= NULL;
- mmd->totvert= 0;
- mmd->totcagevert= 0;
- mmd->totinfluence= 0;
- }
- else {
- DerivedMesh *dm;
- int mode= mmd->modifier.mode;
-
- /* force modifier to run, it will call binding routine */
- mmd->needbind= 1;
- mmd->modifier.mode |= eModifierMode_Realtime;
-
- if(ob->type == OB_MESH) {
- dm= mesh_create_derived_view(ob, 0);
- dm->release(dm);
- }
- else if(ob->type == OB_LATTICE) {
- lattice_calc_modifiers(ob);
- }
- else if(ob->type==OB_MBALL) {
- makeDispListMBall(ob);
- }
- else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
- makeDispListCurveTypes(ob, 0);
- }
-
- mmd->needbind= 0;
- mmd->modifier.mode= mode;
- }
-}
-
-void modifiers_explodeFacepa(void *arg1, void *arg2)
-{
- ExplodeModifierData *emd=arg1;
-
- emd->flag |= eExplodeFlag_CalcFaces;
-}
-
-void modifiers_explodeDelVg(void *arg1, void *arg2)
-{
- ExplodeModifierData *emd=arg1;
- emd->vgroup = 0;
-}
-
-static int modifier_is_fluid_particles(ModifierData *md) {
- if(md->type == eModifierType_ParticleSystem) {
- if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
- return 1;
- }
- return 0;
-}
-static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex)
-{
- ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- uiBut *but;
- int isVirtual = md->mode&eModifierMode_Virtual;
- int x = *xco, y = *yco, color = md->error?TH_REDALERT:TH_BUT_NEUTRAL;
- int editing = (G.obedit==ob);
- short height=26, width = 295, buttonWidth = width-120-10;
- char str[128];
-
- /* rounded header */
- uiBlockSetCol(block, color);
- /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */
- uiDefBut(block, ROUNDBOX, 0, "", x-10, y-4, width, 25, NULL, 7.0, 0.0,
- (!isVirtual && (md->mode&eModifierMode_Expanded))?3:15, 20, "");
- uiBlockSetCol(block, TH_AUTO);
-
- /* open/close icon */
- if (!isVirtual) {
- uiBlockSetEmboss(block, UI_EMBOSSN);
- uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, B_MODIFIER_REDRAW, VICON_DISCLOSURE_TRI_RIGHT, x-10, y-2, 20, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier");
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- if (isVirtual) {
- sprintf(str, "%s parent deform", md->name);
- uiDefBut(block, LABEL, 0, str, x+10, y-1, width-110, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
-
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Make Real", x+width-100, y, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier");
- uiButSetFunc(but, modifiers_convertToReal, ob, md);
- } else {
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, B_MODIFIER_REDRAW, "", x+10, y-1, buttonWidth-60, 19, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name");
-
- /* Softbody not allowed in this situation, enforce! */
- if ((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) {
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, ICON_SCENE, x+10+buttonWidth-60, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering");
- but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, VICON_VIEW3D, x+10+buttonWidth-40, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
- if (mti->flags&eModifierTypeFlag_SupportsEditmode) {
- uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, VICON_EDIT, x+10+buttonWidth-20, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)");
- }
- }
- uiBlockEndAlign(block);
-
- uiBlockSetEmboss(block, UI_EMBOSSR);
-
- if (ob->type==OB_MESH && modifier_couldBeCage(md) && index<=lastCageIndex) {
- int icon, color;
-
- if (index==cageIndex) {
- color = TH_BUT_SETTING;
- icon = VICON_EDITMODE_HLT;
- } else if (index<cageIndex) {
- color = TH_BUT_NEUTRAL;
- icon = VICON_EDITMODE_DEHLT;
- } else {
- color = TH_BUT_NEUTRAL;
- icon = ICON_BLANK1;
- }
- uiBlockSetCol(block, color);
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, icon, x+width-105, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
- uiButSetFunc(but, modifiers_setOnCage, ob, md);
- uiBlockSetCol(block, TH_AUTO);
- }
-
- uiBlockSetCol(block, TH_BUT_ACTION);
-
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_UP, x+width-75, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack");
- uiButSetFunc(but, modifiers_moveUp, ob, md);
-
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, x+width-75+20, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack");
- uiButSetFunc(but, modifiers_moveDown, ob, md);
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- // deletion over the deflection panel
- // fluid particle modifier can't be deleted here
- if(md->type!=eModifierType_Fluidsim && md->type!=eModifierType_Collision && !modifier_is_fluid_particles(md))
- {
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_X, x+width-70+40, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Delete modifier");
- uiButSetFunc(but, modifiers_del, ob, md);
- }
- uiBlockSetCol(block, TH_AUTO);
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- if (isVirtual || !(md->mode&eModifierMode_Expanded)) {
- y -= 18;
- } else {
- int cy = y - 8;
- int lx = x + width - 60 - 15;
-
- if (md->type==eModifierType_Subsurf) {
- height = 105;
- } else if (md->type==eModifierType_Lattice) {
- height = 48;
- } else if (md->type==eModifierType_Curve) {
- height = 72;
- } else if (md->type==eModifierType_Build) {
- height = 86;
- } else if (md->type==eModifierType_Mirror) {
- height = 105;
- } else if (md->type==eModifierType_Bevel) {
- BevelModifierData *bmd = (BevelModifierData*) md;
- height = 105; /* height = 124; */
- if ((bmd->lim_flags & BME_BEVEL_ANGLE) || ((bmd->lim_flags & BME_BEVEL_WEIGHT) && !(bmd->flags & BME_BEVEL_VERT))) height += 19;
- } else if (md->type==eModifierType_EdgeSplit) {
- EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md;
- height = 48;
- if(emd->flags & MOD_EDGESPLIT_FROMANGLE) height += 19;
- } else if (md->type==eModifierType_Displace) {
- DisplaceModifierData *dmd = (DisplaceModifierData *)md;
- height = 124;
- if(dmd->texmapping == MOD_DISP_MAP_OBJECT ||
- dmd->texmapping == MOD_DISP_MAP_UV)
- height += 19;
- } else if (md->type==eModifierType_UVProject) {
- height = 114 + ((UVProjectModifierData *)md)->num_projectors * 19;
- } else if (md->type==eModifierType_Decimate) {
- height = 48;
- } else if (md->type==eModifierType_Smooth) {
- height = 86;
- } else if (md->type==eModifierType_Cast) {
- height = 143;
- } else if (md->type==eModifierType_Wave) {
- WaveModifierData *wmd = (WaveModifierData *)md;
- height = 315;
- if(wmd->texmapping == MOD_WAV_MAP_OBJECT ||
- wmd->texmapping == MOD_WAV_MAP_UV)
- height += 19;
- if(wmd->flag & MOD_WAVE_NORM)
- height += 19;
- } else if (md->type==eModifierType_Armature) {
- height = 105;
- } else if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
- height = 86;
- if (editing)
- height += 20;
- if(hmd->indexar==NULL)
- height += 20;
- } else if (md->type==eModifierType_Softbody) {
- height = 31;
- } else if (md->type==eModifierType_Cloth) {
- height = 31;
- } else if (md->type==eModifierType_Collision) {
- height = 31;
- } else if (md->type==eModifierType_Fluidsim) {
- height = 31;
- } else if (md->type==eModifierType_Boolean) {
- height = 48;
- } else if (md->type==eModifierType_Array) {
- height = 211;
- } else if (md->type==eModifierType_MeshDeform) {
- MeshDeformModifierData *mmd= (MeshDeformModifierData*)md;
- height = (mmd->bindcos)? 73: 93;
- } else if (md->type==eModifierType_ParticleSystem) {
- height = 31;
- } else if (md->type==eModifierType_ParticleInstance) {
- height = 94;
- } else if (md->type==eModifierType_Explode) {
- height = 94;
- } else if (md->type==eModifierType_Shrinkwrap) {
- ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
- height = 86 + 3;
- if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT)
- {
- height += 19*5;
- if(smd->projAxis == 0) height += 19;
- }
- else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE)
- height += 19;
- } else if (md->type == eModifierType_Mask) {
- height = 66;
- } else if (md->type==eModifierType_SimpleDeform) {
- SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md;
- height += 19*5;
- if(smd->origin != NULL) height += 19;
- if(smd->mode == MOD_SIMPLEDEFORM_MODE_STRETCH
- || smd->mode == MOD_SIMPLEDEFORM_MODE_TAPER )
- height += 19;
- }
- /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */
- uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, "");
-
- y -= 18;
-
- if (!isVirtual && (md->type!=eModifierType_Collision)) {
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); /* only here obdata, the rest of modifiers is ob level */
-
- uiBlockBeginAlign(block);
- if (md->type==eModifierType_ParticleSystem) {
- ParticleSystem *psys;
- psys= ((ParticleSystemModifierData *)md)->psys;
-
- if(!(G.f & G_PARTICLEEDIT)) {
- if(ELEM3(psys->part->draw_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) {
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Convert", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Convert the current particles to a mesh object");
- uiButSetFunc(but, modifiers_convertParticles, ob, md);
- }
- }
- }
- else{
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Apply", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Apply the current modifier and remove from the stack");
- uiButSetFunc(but, modifiers_applyModifier, ob, md);
- }
-
- if (md->type!=eModifierType_Fluidsim && md->type!=eModifierType_Softbody && md->type!=eModifierType_ParticleSystem && (md->type!=eModifierType_Cloth)) {
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Copy", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Duplicate the current modifier at the same position in the stack");
- uiButSetFunc(but, modifiers_copyModifier, ob, md);
- }
- uiBlockEndAlign(block);
-
- uiSetButLock(ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
- }
-
- lx = x + 10;
- cy = y + 10 - 1;
- uiBlockBeginAlign(block);
- if (md->type==eModifierType_Subsurf) {
- SubsurfModifierData *smd = (SubsurfModifierData*) md;
- char subsurfmenu[]="Subsurf Type%t|Catmull-Clark%x0|Simple Subdiv.%x1";
- uiDefButS(block, MENU, B_MODIFIER_RECALC, subsurfmenu, lx,(cy-=19),buttonWidth,19, &smd->subdivType, 0, 0, 0, 0, "Selects type of subdivision algorithm.");
- uiDefButS(block, NUM, B_MODIFIER_RECALC, "Levels:", lx, (cy-=19), buttonWidth,19, &smd->levels, 1, 6, 0, 0, "Number subdivisions to perform");
- uiDefButS(block, NUM, B_MODIFIER_REDRAW, "Render Levels:", lx, (cy-=19), buttonWidth,19, &smd->renderLevels, 1, 6, 0, 0, "Number subdivisions to perform when rendering");
-
- /* Disabled until non-EM DerivedMesh implementation is complete */
-
- /*
- uiDefButBitS(block, TOG, eSubsurfModifierFlag_Incremental, B_MODIFIER_RECALC, "Incremental", lx, (cy-=19),90,19,&smd->flags, 0, 0, 0, 0, "Use incremental calculation, even outside of mesh mode");
- uiDefButBitS(block, TOG, eSubsurfModifierFlag_DebugIncr, B_MODIFIER_RECALC, "Debug", lx+90, cy,buttonWidth-90,19,&smd->flags, 0, 0, 0, 0, "Visualize the subsurf incremental calculation, for debugging effect of other modifiers");
- */
-
- uiDefButBitS(block, TOG, eSubsurfModifierFlag_ControlEdges, B_MODIFIER_RECALC, "Optimal Draw", lx, (cy-=19), buttonWidth,19,&smd->flags, 0, 0, 0, 0, "Skip drawing/rendering of interior subdivided edges");
- uiDefButBitS(block, TOG, eSubsurfModifierFlag_SubsurfUv, B_MODIFIER_RECALC, "Subsurf UV", lx, (cy-=19),buttonWidth,19,&smd->flags, 0, 0, 0, 0, "Use subsurf to subdivide UVs");
- } else if (md->type==eModifierType_Lattice) {
- LatticeModifierData *lmd = (LatticeModifierData*) md;
- uiDefIDPoinBut(block, modifier_testLatticeObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &lmd->object, "Lattice object to deform with");
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &lmd->name, 0.0, 31.0, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- } else if (md->type==eModifierType_Curve) {
- CurveModifierData *cmd = (CurveModifierData*) md;
- uiDefIDPoinBut(block, modifier_testCurveObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &cmd->object, "Curve object to deform with");
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &cmd->name, 0.0, 31.0, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
-
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"X", lx, (cy-=19), 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSX, 0, 0, "The axis that the curve deforms along");
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"Y", (lx+buttonWidth/6), cy, 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSY, 0, 0, "The axis that the curve deforms along");
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"Z", (lx+2*buttonWidth/6), cy, 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSZ, 0, 0, "The axis that the curve deforms along");
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"-X", (lx+3*buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGX, 0, 0, "The axis that the curve deforms along");
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"-Y", (lx+4*buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGY, 0, 0, "The axis that the curve deforms along");
- uiDefButS(block, ROW,B_MODIFIER_RECALC,"-Z", (lx+buttonWidth-buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGZ, 0, 0, "The axis that the curve deforms along");
- } else if (md->type==eModifierType_Build) {
- BuildModifierData *bmd = (BuildModifierData*) md;
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Start:", lx, (cy-=19), buttonWidth,19, &bmd->start, 1.0, MAXFRAMEF, 100, 0, "Specify the start frame of the effect");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Length:", lx, (cy-=19), buttonWidth,19, &bmd->length, 1.0, MAXFRAMEF, 100, 0, "Specify the total time the build effect requires");
- uiDefButI(block, TOG, B_MODIFIER_RECALC, "Randomize", lx, (cy-=19), buttonWidth,19, &bmd->randomize, 0, 0, 1, 0, "Randomize the faces or edges during build.");
- uiDefButI(block, NUM, B_MODIFIER_RECALC, "Seed:", lx, (cy-=19), buttonWidth,19, &bmd->seed, 1.0, MAXFRAMEF, 100, 0, "Specify the seed for random if used.");
- } else if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Limit:", lx, (cy-=19), buttonWidth,19, &mmd->tolerance, 0.0, 1.0, 10, 10, "Distance from axis within which mirrored vertices are merged");
- uiDefButBitS(block, TOG, MOD_MIR_AXIS_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),20,19, &mmd->flag, 0, 0, 0, 0, "Enable X axis mirror");
- uiDefButBitS(block, TOG, MOD_MIR_AXIS_Y, B_MODIFIER_RECALC, "Y", lx+20,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Y axis mirror");
- uiDefButBitS(block, TOG, MOD_MIR_AXIS_Z, B_MODIFIER_RECALC, "Z", lx+40,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Z axis mirror");
- uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror");
- uiDefButBitS(block, TOG, MOD_MIR_VGROUP, B_MODIFIER_RECALC, "Mirror Vgroups", lx, (cy-=19), buttonWidth,19, &mmd->flag, 1, 2, 0, 0, "Mirror vertex groups (e.g. .R->.L)");
- uiDefButBitS(block, TOG, MOD_MIR_MIRROR_U, B_MODIFIER_RECALC,
- "Mirror U",
- lx, (cy-=19), buttonWidth/2, 19,
- &mmd->flag, 0, 0, 0, 0,
- "Mirror the U texture coordinate around "
- "the 0.5 point");
- uiDefButBitS(block, TOG, MOD_MIR_MIRROR_V, B_MODIFIER_RECALC,
- "Mirror V",
- lx + buttonWidth/2 + 1, cy, buttonWidth/2, 19,
- &mmd->flag, 0, 0, 0, 0,
- "Mirror the V texture coordinate around "
- "the 0.5 point");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP,
- "Ob: ", lx, (cy -= 19), buttonWidth, 19,
- &mmd->mirror_ob,
- "Object to use as mirror");
- } else if (md->type==eModifierType_Bevel) {
- BevelModifierData *bmd = (BevelModifierData*) md;
- /*uiDefButS(block, ROW, B_MODIFIER_RECALC, "Distance",
- lx, (cy -= 19), (buttonWidth/2), 19, &bmd->val_flags,
- 11.0, 0, 0, 0,
- "Interpret bevel value as a constant distance from each edge");
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "Radius",
- (lx+buttonWidth/2), cy, (buttonWidth - buttonWidth/2), 19, &bmd->val_flags,
- 11.0, BME_BEVEL_RADIUS, 0, 0,
- "Interpret bevel value as a radius - smaller angles will be beveled more");*/
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Width: ",
- lx, (cy -= 19), buttonWidth, 19, &bmd->value,
- 0.0, 0.5, 5, 4,
- "Bevel value/amount");
- /*uiDefButI(block, NUM, B_MODIFIER_RECALC, "Recurs",
- lx, (cy -= 19), buttonWidth, 19, &bmd->res,
- 1, 4, 5, 2,
- "Number of times to bevel");*/
- uiDefButBitS(block, TOG, BME_BEVEL_VERT,
- B_MODIFIER_RECALC, "Only Vertices",
- lx, (cy -= 19), buttonWidth, 19,
- &bmd->flags, 0, 0, 0, 0,
- "Bevel only verts/corners; not edges");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "Limit using:", lx, (cy-=25), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "None",
- lx, (cy -= 19), (buttonWidth/3), 19, &bmd->lim_flags,
- 12.0, 0, 0, 0,
- "Bevel the entire mesh by a constant amount");
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "Angle",
- (lx+buttonWidth/3), cy, (buttonWidth/3), 19, &bmd->lim_flags,
- 12.0, BME_BEVEL_ANGLE, 0, 0,
- "Only bevel edges with sharp enough angles between faces");
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "BevWeight",
- lx+(2*buttonWidth/3), cy, buttonWidth-2*(buttonWidth/3), 19, &bmd->lim_flags,
- 12.0, BME_BEVEL_WEIGHT, 0, 0,
- "Use bevel weights to determine how much bevel is applied; apply them separately in vert/edge select mode");
- if ((bmd->lim_flags & BME_BEVEL_WEIGHT) && !(bmd->flags & BME_BEVEL_VERT)) {
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "Min",
- lx, (cy -= 19), (buttonWidth/3), 19, &bmd->e_flags,
- 13.0, BME_BEVEL_EMIN, 0, 0,
- "The sharpest edge's weight is used when weighting a vert");
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "Average",
- (lx+buttonWidth/3), cy, (buttonWidth/3), 19, &bmd->e_flags,
- 13.0, 0, 0, 0,
- "The edge weights are averaged when weighting a vert");
- uiDefButS(block, ROW, B_MODIFIER_RECALC, "Max",
- (lx+2*(buttonWidth/3)), cy, buttonWidth-2*(buttonWidth/3), 19, &bmd->e_flags,
- 13.0, BME_BEVEL_EMAX, 0, 0,
- "The largest edge's wieght is used when weighting a vert");
- }
- else if (bmd->lim_flags & BME_BEVEL_ANGLE) {
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Angle:",
- lx, (cy -= 19), buttonWidth, 19, &bmd->bevel_angle,
- 0.0, 180.0, 100, 2,
- "Angle above which to bevel edges");
- }
- } else if (md->type==eModifierType_EdgeSplit) {
- EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md;
- uiDefButBitI(block, TOG, MOD_EDGESPLIT_FROMANGLE,
- B_MODIFIER_RECALC, "From Edge Angle",
- lx, (cy -= 19), buttonWidth, 19,
- &emd->flags, 0, 0, 0, 0,
- "Split edges with high angle between faces");
- if(emd->flags & MOD_EDGESPLIT_FROMANGLE) {
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Split Angle:",
- lx, (cy -= 19), buttonWidth, 19, &emd->split_angle,
- 0.0, 180.0, 100, 2,
- "Angle above which to split edges");
- }
- uiDefButBitI(block, TOG, MOD_EDGESPLIT_FROMFLAG,
- B_MODIFIER_RECALC, "From Marked As Sharp",
- lx, (cy -= 19), buttonWidth, 19,
- &emd->flags, 0, 0, 0, 0,
- "Split edges that are marked as sharp");
- } else if (md->type==eModifierType_Displace) {
- DisplaceModifierData *dmd = (DisplaceModifierData*) md;
- but = uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ",
- lx, (cy -= 19), buttonWidth, 19,
- &dmd->defgrp_name, 0.0, 31.0, 0, 0,
- "Name of vertex group to displace"
- " (displace whole mesh if blank)");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- uiDefIDPoinBut(block, modifier_testTexture, ID_TE, B_CHANGEDEP,
- "Texture: ", lx, (cy -= 19), buttonWidth, 19,
- &dmd->texture,
- "Texture to use as displacement input");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Midlevel:",
- lx, (cy -= 19), buttonWidth, 19, &dmd->midlevel,
- 0, 1, 10, 3,
- "Material value that gives no displacement");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Strength:",
- lx, (cy -= 19), buttonWidth, 19, &dmd->strength,
- -1000, 1000, 10, 0.1,
- "Strength of displacement");
- sprintf(str, "Direction%%t|Normal%%x%d|RGB -> XYZ%%x%d|"
- "Z%%x%d|Y%%x%d|X%%x%d",
- MOD_DISP_DIR_NOR, MOD_DISP_DIR_RGB_XYZ,
- MOD_DISP_DIR_Z, MOD_DISP_DIR_Y, MOD_DISP_DIR_X);
- uiDefButI(block, MENU, B_MODIFIER_RECALC, str,
- lx, (cy -= 19), buttonWidth, 19, &dmd->direction,
- 0.0, 1.0, 0, 0, "Displace direction");
- sprintf(str, "Texture Coordinates%%t"
- "|Local%%x%d|Global%%x%d|Object%%x%d|UV%%x%d",
- MOD_DISP_MAP_LOCAL, MOD_DISP_MAP_GLOBAL,
- MOD_DISP_MAP_OBJECT, MOD_DISP_MAP_UV);
- uiDefButI(block, MENU, B_MODIFIER_RECALC, str,
- lx, (cy -= 19), buttonWidth, 19, &dmd->texmapping,
- 0.0, 1.0, 0, 0,
- "Texture coordinates used for displacement input");
- if (dmd->texmapping == MOD_DISP_MAP_UV) {
- char *strtmp;
- int i;
- CustomData *fdata = G.obedit ? &G.editMesh->fdata
- : &((Mesh*)ob->data)->fdata;
- build_uvlayer_menu_vars(fdata, &strtmp, &dmd->uvlayer_tmp,
- dmd->uvlayer_name);
- but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp,
- lx, (cy -= 19), buttonWidth, 19, &dmd->uvlayer_tmp,
- 0.0, 1.0, 0, 0, "Set the UV layer to use");
- MEM_freeN(strtmp);
- i = CustomData_get_layer_index(fdata, CD_MTFACE);
- uiButSetFunc(but, set_displace_uvlayer, dmd,
- &fdata->layers[i]);
- }
- if(dmd->texmapping == MOD_DISP_MAP_OBJECT) {
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP,
- "Ob: ", lx, (cy -= 19), buttonWidth, 19,
- &dmd->map_object,
- "Object to get texture coordinates from");
- }
- } else if (md->type==eModifierType_UVProject) {
- UVProjectModifierData *umd = (UVProjectModifierData *) md;
- int i;
- char *strtmp;
- CustomData *fdata = G.obedit ? &G.editMesh->fdata
- : &((Mesh*)ob->data)->fdata;
- build_uvlayer_menu_vars(fdata, &strtmp, &umd->uvlayer_tmp,
- umd->uvlayer_name);
- but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp,
- lx, (cy -= 19), buttonWidth, 19, &umd->uvlayer_tmp,
- 0.0, 1.0, 0, 0, "Set the UV layer to use");
- i = CustomData_get_layer_index(fdata, CD_MTFACE);
- uiButSetFunc(but, set_uvproject_uvlayer, umd, &fdata->layers[i]);
- MEM_freeN(strtmp);
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "AspX:",
- lx, (cy -= 19), buttonWidth / 2, 19, &umd->aspectx,
- 1, 1000, 100, 2,
- "Horizontal Aspect Ratio");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "AspY:",
- lx + (buttonWidth / 2) + 1, cy, buttonWidth / 2, 19,
- &umd->aspecty,
- 1, 1000, 100, 2,
- "Vertical Aspect Ratio");
- uiDefButI(block, NUM, B_MODIFIER_RECALC, "Projectors:",
- lx, (cy -= 19), buttonWidth, 19, &umd->num_projectors,
- 1, MOD_UVPROJECT_MAXPROJECTORS, 0, 0,
- "Number of objects to use as projectors");
- for(i = 0; i < umd->num_projectors; ++i) {
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP,
- "Ob: ", lx, (cy -= 19), buttonWidth, 19,
- &umd->projectors[i],
- "Object to use as projector");
- }
- uiDefIDPoinBut(block, modifier_testImage, ID_IM, B_CHANGEDEP,
- "Image: ", lx, (cy -= 19), buttonWidth, 19,
- &umd->image,
- "Image to project (only faces with this image "
- "will be altered");
- uiButSetCompleteFunc(but, autocomplete_image, (void *)ob);
- uiDefButBitI(block, TOG, MOD_UVPROJECT_OVERRIDEIMAGE,
- B_MODIFIER_RECALC, "Override Image",
- lx, (cy -= 19), buttonWidth, 19,
- &umd->flags, 0, 0, 0, 0,
- "Override faces' current images with the "
- "given image");
- } else if (md->type==eModifierType_Decimate) {
- DecimateModifierData *dmd = (DecimateModifierData*) md;
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Ratio:", lx,(cy-=19),buttonWidth,19, &dmd->percent, 0.0, 1.0, 10, 0, "Defines the percentage of triangles to reduce to");
- sprintf(str, "Face Count: %d", dmd->faceCount);
- uiDefBut(block, LABEL, 1, str, lx, (cy-=19), 160,19, NULL, 0.0, 0.0, 0, 0, "Displays the current number of faces in the decimated mesh");
- } else if (md->type==eModifierType_Mask) {
- MaskModifierData *mmd = (MaskModifierData *)md;
-
- sprintf(str, "Mask Mode%%t|Vertex Group%%x%d|Selected Bones%%x%d|",
- MOD_MASK_MODE_VGROUP,MOD_MASK_MODE_ARM);
- uiDefButI(block, MENU, B_MODIFIER_RECALC, str,
- lx, (cy -= 19), buttonWidth, 19, &mmd->mode,
- 0.0, 1.0, 0, 0, "How masking region is defined");
-
- if (mmd->mode == MOD_MASK_MODE_ARM) {
- uiDefIDPoinBut(block, modifier_testArmatureObj, ID_OB, B_CHANGEDEP,
- "Ob: ", lx, (cy -= 19), buttonWidth, 19, &mmd->ob_arm,
- "Armature to use as source of bones to mask");
- }
- else {
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ",
- lx, (cy-=19), buttonWidth, 19, &mmd->vgroup,
- 0.0, 31.0, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- }
-
- uiDefButBitI(block, TOG, MOD_MASK_INV, B_MODIFIER_RECALC, "Inverse",
- lx, (cy-=19), buttonWidth, 19, &mmd->flag,
- 0, 0, 0, 0, "Use vertices that are not part of region defined");
- } else if (md->type==eModifierType_Smooth) {
- SmoothModifierData *smd = (SmoothModifierData*) md;
-
- uiDefButBitS(block, TOG, MOD_SMOOTH_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &smd->flag, 0, 0, 0, 0, "Enable X axis smoothing");
- uiDefButBitS(block, TOG, MOD_SMOOTH_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &smd->flag, 0, 0, 0, 0, "Enable Y axis smoothing");
- uiDefButBitS(block, TOG, MOD_SMOOTH_Z, B_MODIFIER_RECALC, "Z", lx+90,cy,45,19, &smd->flag, 0, 0, 0, 0, "Enable Z axis smoothing");
-
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth, 19, &smd->fac, -10.0, 10.0, 0.5, 0, "Define the amount of smoothing, from 0.0 to 1.0 (lower / higher values can deform the mesh)");
- uiDefButS(block, NUM, B_MODIFIER_RECALC, "Repeat:", lx,(cy-=19),buttonWidth, 19, &smd->repeat, 0.0, 30.0, 1, 0, "Number of smoothing iterations");
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to define which vertices are affected");
- } else if (md->type==eModifierType_Cast) {
- CastModifierData *cmd = (CastModifierData*) md;
-
- char casttypemenu[]="Projection Type%t|Sphere%x0|Cylinder%x1|Cuboid%x2";
- uiDefButS(block, MENU, B_MODIFIER_RECALC, casttypemenu, lx,(cy-=19),buttonWidth - 30,19, &cmd->type, 0, 0, 0, 0, "Projection type to apply");
- uiDefButBitS(block, TOG, MOD_CAST_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) X axis deformation");
- uiDefButBitS(block, TOG, MOD_CAST_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) Y axis deformation");
- if (cmd->type != MOD_CAST_TYPE_CYLINDER) {
- uiDefButBitS(block, TOG, MOD_CAST_Z, B_MODIFIER_RECALC, "Z", lx+90,cy,45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) Z axis deformation");
- }
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth, 19, &cmd->fac, -10.0, 10.0, 5, 0, "Define the amount of deformation");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Radius:", lx,(cy-=19),buttonWidth, 19, &cmd->radius, 0.0, 100.0, 10.0, 0, "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Size:", lx,(cy-=19),buttonWidth, 19, &cmd->size, 0.0, 100.0, 10.0, 0, "Size of projection shape (leave as 0 for auto)");
- uiDefButBitS(block, TOG, MOD_CAST_SIZE_FROM_RADIUS, B_MODIFIER_RECALC, "From radius", lx+buttonWidth,cy,80,19, &cmd->flag, 0, 0, 0, 0, "Use radius as size of projection shape (0 = auto)");
- if (ob->type == OB_MESH) {
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &cmd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to define which vertices are affected");
- }
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx,(cy-=19), buttonWidth,19, &cmd->object, "Control object: if available, its location determines the center of the effect");
- if(cmd->object) {
- uiDefButBitS(block, TOG, MOD_CAST_USE_OB_TRANSFORM, B_MODIFIER_RECALC, "Use transform", lx+buttonWidth,cy,80,19, &cmd->flag, 0, 0, 0, 0, "Use object transform to control projection shape");
- }
- } else if (md->type==eModifierType_Wave) {
- WaveModifierData *wmd = (WaveModifierData*) md;
- uiDefButBitS(block, TOG, MOD_WAVE_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &wmd->flag, 0, 0, 0, 0, "Enable X axis motion");
- uiDefButBitS(block, TOG, MOD_WAVE_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &wmd->flag, 0, 0, 0, 0, "Enable Y axis motion");
- uiDefButBitS(block, TOG, MOD_WAVE_CYCL, B_MODIFIER_RECALC, "Cycl", lx+90,cy,buttonWidth-90,19, &wmd->flag, 0, 0, 0, 0, "Enable cyclic wave effect");
- uiDefButBitS(block, TOG, MOD_WAVE_NORM, B_MODIFIER_RECALC, "Normals", lx,(cy-=19),buttonWidth,19, &wmd->flag, 0, 0, 0, 0, "Displace along normals");
- if (wmd->flag & MOD_WAVE_NORM){
- if (ob->type==OB_MESH) {
- uiDefButBitS(block, TOG, MOD_WAVE_NORM_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the X normal");
- uiDefButBitS(block, TOG, MOD_WAVE_NORM_Y, B_MODIFIER_RECALC, "Y", lx+(buttonWidth/3),cy,buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the Y normal");
- uiDefButBitS(block, TOG, MOD_WAVE_NORM_Z, B_MODIFIER_RECALC, "Z", lx+(buttonWidth/3)*2,cy,buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the Z normal");
- }
- else
- uiDefBut(block, LABEL, 1, "Meshes Only", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- uiBlockBeginAlign(block);
- if(wmd->speed >= 0)
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Time sta:", lx,(cy-=19),buttonWidth,19, &wmd->timeoffs, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify starting frame of the wave");
- else
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Time end:", lx,(cy-=19),buttonWidth,19, &wmd->timeoffs, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify ending frame of the wave");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lifetime:", lx,(cy-=19),buttonWidth,19, &wmd->lifetime, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the lifespan of the wave");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Damptime:", lx,(cy-=19),buttonWidth,19, &wmd->damp, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the dampingtime of the wave");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Falloff:", lx,(cy-=19),buttonWidth,19, &wmd->falloff, 0, 100, 100, 0, "Specify the falloff radius of the waves");
-
- cy -= 9;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta x:", lx,(cy-=19),113,19, &wmd->startx, -100.0, 100.0, 100, 0, "Starting position for the X axis");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta y:", lx+115,cy,105,19, &wmd->starty, -100.0, 100.0, 100, 0, "Starting position for the Y axis");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MODIFIER_RECALC, "Ob: ", lx, (cy-=19), 220,19, &wmd->objectcenter, "Object to use as Starting Position (leave blank to disable)");
- uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ",lx, (cy -= 19), 220, 19,&wmd->defgrp_name, 0.0, 31.0, 0, 0, "Name of vertex group with which to modulate displacement");
- uiDefIDPoinBut(block, modifier_testTexture, ID_TE, B_CHANGEDEP,"Texture: ", lx, (cy -= 19), 220, 19, &wmd->texture,"Texture with which to modulate wave");
- sprintf(str, "Texture Coordinates%%t"
- "|Local%%x%d|Global%%x%d|Object%%x%d|UV%%x%d",
- MOD_WAV_MAP_LOCAL, MOD_WAV_MAP_GLOBAL,
- MOD_WAV_MAP_OBJECT, MOD_WAV_MAP_UV);
- uiDefButI(block, MENU, B_MODIFIER_RECALC, str,
- lx, (cy -= 19), 220, 19, &wmd->texmapping,
- 0.0, 1.0, 0, 0,
- "Texture coordinates used for modulation input");
- if (wmd->texmapping == MOD_WAV_MAP_UV) {
- char *strtmp;
- int i;
- CustomData *fdata = G.obedit ? &G.editMesh->fdata
- : &((Mesh*)ob->data)->fdata;
- build_uvlayer_menu_vars(fdata, &strtmp, &wmd->uvlayer_tmp,
- wmd->uvlayer_name);
- but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp,
- lx, (cy -= 19), 220, 19, &wmd->uvlayer_tmp,
- 0.0, 1.0, 0, 0, "Set the UV layer to use");
- MEM_freeN(strtmp);
- i = CustomData_get_layer_index(fdata, CD_MTFACE);
- uiButSetFunc(but, set_wave_uvlayer, wmd,
- &fdata->layers[i]);
- }
- if(wmd->texmapping == MOD_DISP_MAP_OBJECT) {
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP,
- "Ob: ", lx, (cy -= 19), 220, 19,
- &wmd->map_object,
- "Object to get texture coordinates from");
- }
- cy -= 9;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Speed:", lx,(cy-=19),220,19, &wmd->speed, -2.0, 2.0, 0, 0, "Specify the wave speed");
- uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Height:", lx,(cy-=19),220,19, &wmd->height, -2.0, 2.0, 0, 0, "Specify the amplitude of the wave");
- uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Width:", lx,(cy-=19),220,19, &wmd->width, 0.0, 5.0, 0, 0, "Specify the width of the wave");
- uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Narrow:", lx,(cy-=19),220,19, &wmd->narrow, 0.0, 10.0, 0, 0, "Specify how narrow the wave follows");
- } else if (md->type==eModifierType_Armature) {
- ArmatureModifierData *amd = (ArmatureModifierData*) md;
- uiDefIDPoinBut(block, modifier_testArmatureObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &amd->object, "Armature object to deform with");
-
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth-40,19, &amd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to control overall armature influence");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- uiDefButBitS(block, TOG, ARM_DEF_INVERT_VGROUP, B_ARM_RECALCDATA, "Inv", lx+buttonWidth-40,cy, 40, 20, &amd->deformflag, 0, 0, 0, 0, "Invert vertex group influence");
-
- uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vert.Groups", lx,cy-=19,buttonWidth/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform");
- uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", lx+buttonWidth/2,cy,(buttonWidth + 1)/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform");
- uiDefButBitS(block, TOG, ARM_DEF_QUATERNION, B_ARM_RECALCDATA, "Quaternion", lx,(cy-=19),buttonWidth/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable deform rotation interpolation with Quaternions");
- uiDefButBitS(block, TOG, ARM_DEF_B_BONE_REST, B_ARM_RECALCDATA, "B-Bone Rest", lx+buttonWidth/2,cy,(buttonWidth + 1)/2,20, &amd->deformflag, 0, 0, 0, 0, "Make B-Bones deform already in rest position");
-
- uiDefButS(block, TOG, B_ARM_RECALCDATA, "MultiModifier", lx,cy-=19, buttonWidth, 20, &amd->multi, 0, 0, 0, 0, "Use same input as previous modifier, and mix results using overall vgroup");
-
- } else if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Falloff: ", lx, (cy-=19), buttonWidth,19, &hmd->falloff, 0.0, 100.0, 100, 0, "If not zero, the distance from hook where influence ends");
- uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Force: ", lx, (cy-=19), buttonWidth,19, &hmd->force, 0.0, 1.0, 100, 0, "Set relative force of hook");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &hmd->object, "Parent Object for hook, also recalculates and clears offset");
- if(hmd->indexar==NULL) {
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &hmd->name, 0.0, 31.0, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- }
- uiBlockBeginAlign(block);
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Reset", lx, (cy-=19), 80,19, NULL, 0.0, 0.0, 0, 0, "Recalculate and clear offset (transform) of hook");
- uiButSetFunc(but, modifiers_clearHookOffset, ob, md);
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Recenter", lx+80, cy, buttonWidth-80,19, NULL, 0.0, 0.0, 0, 0, "Sets hook center to cursor position");
- uiButSetFunc(but, modifiers_cursorHookCenter, ob, md);
-
- if (editing) {
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Select", lx, (cy-=19), 80,19, NULL, 0.0, 0.0, 0, 0, "Selects effected vertices on mesh");
- uiButSetFunc(but, modifiers_selectHook, ob, md);
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Reassign", lx+80, cy, buttonWidth-80,19, NULL, 0.0, 0.0, 0, 0, "Reassigns selected vertices to hook");
- uiButSetFunc(but, modifiers_reassignHook, ob, md);
- }
- } else if (md->type==eModifierType_Softbody) {
- uiDefBut(block, LABEL, 1, "See Soft Body panel.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- } else if (md->type==eModifierType_Cloth) {
- uiDefBut(block, LABEL, 1, "See Cloth panel.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
-
- } else if (md->type==eModifierType_Collision) {
- uiDefBut(block, LABEL, 1, "See Collision panel.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- } else if (md->type==eModifierType_Fluidsim) {
- uiDefBut(block, LABEL, 1, "See Fluidsim panel.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- } else if (md->type==eModifierType_Boolean) {
- BooleanModifierData *bmd = (BooleanModifierData*) md;
- uiDefButI(block, MENU, B_MODIFIER_RECALC, "Operation%t|Intersect%x0|Union%x1|Difference%x2", lx,(cy-=19),buttonWidth,19, &bmd->operation, 0.0, 1.0, 0, 0, "Boolean operation to perform");
- uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &bmd->object, "Mesh object to use for boolean operation");
- } else if (md->type==eModifierType_Array) {
- ArrayModifierData *amd = (ArrayModifierData*) md;
- float range = 10000;
- int cytop, halfwidth = (width - 5)/2 - 15;
- int halflx = lx + halfwidth + 10;
-
- uiBlockSetEmboss(block, UI_EMBOSSX);
- uiBlockEndAlign(block);
-
- /* length parameters */
- uiBlockBeginAlign(block);
- sprintf(str, "Length Fit%%t|Fixed Count%%x%d|Fixed Length%%x%d"
- "|Fit To Curve Length%%x%d",
- MOD_ARR_FIXEDCOUNT, MOD_ARR_FITLENGTH, MOD_ARR_FITCURVE);
- uiDefButI(block, MENU, B_MODIFIER_RECALC, str,
- lx, (cy-=19), buttonWidth, 19, &amd->fit_type,
- 0.0, 1.0, 0, 0, "Array length calculation method");
- switch(amd->fit_type)
- {
- case MOD_ARR_FIXEDCOUNT:
- uiDefButI(block, NUM, B_MODIFIER_RECALC, "Count:",
- lx, (cy -= 19), buttonWidth, 19, &amd->count,
- 1, 1000, 0, 0, "Number of duplicates to make");
- break;
- case MOD_ARR_FITLENGTH:
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Length:",
- lx, (cy -= 19), buttonWidth, 19, &amd->length,
- 0, range, 10, 2,
- "Length to fit array within");
- break;
- case MOD_ARR_FITCURVE:
- uiDefIDPoinBut(block, modifier_testCurveObj, ID_OB,
- B_CHANGEDEP, "Ob: ",
- lx, (cy -= 19), buttonWidth, 19, &amd->curve_ob,
- "Curve object to fit array length to");
- break;
- }
- uiBlockEndAlign(block);
-
- /* offset parameters */
- cy -= 10;
- cytop= cy;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MOD_ARR_OFF_CONST, B_MODIFIER_RECALC,
- "Constant Offset", lx, (cy-=19), halfwidth, 19,
- &amd->offset_type, 0, 0, 0, 0,
- "Constant offset between duplicates "
- "(local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "X:",
- lx, (cy-=19), halfwidth, 19,
- &amd->offset[0],
- -range, range, 10, 3,
- "Constant component for duplicate offsets "
- "(local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Y:",
- lx, (cy-=19), halfwidth, 19,
- &amd->offset[1],
- -range, range, 10, 3,
- "Constant component for duplicate offsets "
- "(local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Z:",
- lx, (cy-=19), halfwidth, 19,
- &amd->offset[2],
- -range, range, 10, 3,
- "Constant component for duplicate offsets "
- "(local coordinates)");
- uiBlockEndAlign(block);
-
- cy= cytop;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MOD_ARR_OFF_RELATIVE, B_MODIFIER_RECALC,
- "Relative Offset", halflx, (cy-=19), halfwidth, 19,
- &amd->offset_type, 0, 0, 0, 0,
- "Offset between duplicates relative to object width "
- "(local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "X:",
- halflx, (cy-=19), halfwidth, 19,
- &amd->scale[0],
- -range, range, 10, 3,
- "Component for duplicate offsets relative to object "
- "width (local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Y:",
- halflx, (cy-=19), halfwidth, 19,
- &amd->scale[1],
- -range, range, 10, 3,
- "Component for duplicate offsets relative to object "
- "width (local coordinates)");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Z:",
- halflx, (cy-=19), halfwidth, 19,
- &amd->scale[2],
- -range, range, 10, 3,
- "Component for duplicate offsets relative to object "
- "width (local coordinates)");
- uiBlockEndAlign(block);
-
- /* vertex merging parameters */
- cy -= 10;
- cytop= cy;
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MOD_ARR_MERGE, B_MODIFIER_RECALC,
- "Merge",
- lx, (cy-=19), halfwidth/2, 19, &amd->flags,
- 0, 0, 0, 0,
- "Merge vertices in adjacent duplicates");
- uiDefButBitI(block, TOG, MOD_ARR_MERGEFINAL, B_MODIFIER_RECALC,
- "First Last",
- lx + halfwidth/2, cy, (halfwidth+1)/2, 19,
- &amd->flags,
- 0, 0, 0, 0,
- "Merge vertices in first duplicate with vertices"
- " in last duplicate");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Limit:",
- lx, (cy-=19), halfwidth, 19, &amd->merge_dist,
- 0, 1.0f, 1, 4,
- "Limit below which to merge vertices");
-
- /* offset ob */
- cy = cytop;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MOD_ARR_OFF_OBJ, B_MODIFIER_RECALC,
- "Object Offset", halflx, (cy -= 19), halfwidth, 19,
- &amd->offset_type, 0, 0, 0, 0,
- "Add an object transformation to the total offset");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP,
- "Ob: ", halflx, (cy -= 19), halfwidth, 19,
- &amd->offset_ob,
- "Object from which to take offset transformation");
- uiBlockEndAlign(block);
-
- cy -= 10;
- but = uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB,
- B_CHANGEDEP, "Start cap: ",
- lx, (cy -= 19), halfwidth, 19,
- &amd->start_cap,
- "Mesh object to use as start cap");
- uiButSetCompleteFunc(but, autocomplete_meshob, (void *)ob);
- but = uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB,
- B_CHANGEDEP, "End cap: ",
- halflx, cy, halfwidth, 19,
- &amd->end_cap,
- "Mesh object to use as end cap");
- uiButSetCompleteFunc(but, autocomplete_meshob, (void *)ob);
- } else if (md->type==eModifierType_MeshDeform) {
- MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
-
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &mmd->object, "Mesh object to be use as cage");
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-19), buttonWidth-40,19, &mmd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to control overall meshdeform influence");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
- uiDefButBitS(block, TOG, MOD_MDEF_INVERT_VGROUP, B_MODIFIER_RECALC, "Inv", lx+buttonWidth-40, (cy-=19), 40,19, &mmd->flag, 0.0, 31.0, 0, 0, "Invert vertex group influence");
-
- uiBlockBeginAlign(block);
- if(mmd->bindcos) {
- but= uiDefBut(block, BUT, B_MODIFIER_RECALC, "Unbind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Unbind mesh from cage");
- uiButSetFunc(but,modifiers_bindMeshDeform,ob,md);
- }
- else {
- but= uiDefBut(block, BUT, B_MODIFIER_RECALC, "Bind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Bind mesh to cage");
- uiButSetFunc(but,modifiers_bindMeshDeform,ob,md);
- uiDefButS(block, NUM, B_NOP, "Precision:", lx,(cy-19), buttonWidth/2 + 20,19, &mmd->gridsize, 2, 10, 0.5, 0, "The grid size for binding");
- uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Recompute binding dynamically on top of other deformers like Shape Keys (slower and more memory consuming!)");
- }
- uiBlockEndAlign(block);
- } else if (md->type==eModifierType_ParticleSystem) {
- uiDefBut(block, LABEL, 1, "See Particle buttons.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, "");
- } else if (md->type==eModifierType_ParticleInstance) {
- ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData*) md;
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy -= 19), buttonWidth, 19, &pimd->ob, "Object that has the particlesystem");
- uiDefButS(block, NUM, B_MODIFIER_RECALC, "PSYS:", lx, (cy -= 19), buttonWidth, 19, &pimd->psys, 1, 10, 10, 3, "Particlesystem number in the object");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Parents, B_MODIFIER_RECALC, "Normal", lx, (cy -= 19), buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances from normal particles");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Children, B_MODIFIER_RECALC, "Children", lx+buttonWidth/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances from child particles");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Path, B_MODIFIER_RECALC, "Path", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances along particle paths");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Unborn, B_MODIFIER_RECALC, "Unborn", lx, (cy -= 19), buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are unborn");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are alive");
- uiDefButBitS(block, TOG, eParticleInstanceFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are dead");
- } else if (md->type==eModifierType_Explode) {
- ExplodeModifierData *emd = (ExplodeModifierData*) md;
- uiBut *but;
- char *menustr= get_vertexgroup_menustr(ob);
- int defCount=BLI_countlist(&ob->defbase);
- if(defCount==0) emd->vgroup=0;
- uiBlockBeginAlign(block);
- but=uiDefButS(block, MENU, B_MODIFIER_RECALC, menustr, lx, (cy-=19), buttonWidth-20,19, &emd->vgroup, 0, defCount, 0, 0, "Protect this vertex group");
- uiButSetFunc(but,modifiers_explodeFacepa,emd,0);
- MEM_freeN(menustr);
-
- but=uiDefIconBut(block, BUT, B_MODIFIER_RECALC, ICON_X, (lx+buttonWidth)-20, cy, 20,19, 0, 0, 0, 0, 0, "Disable use of vertex group");
- uiButSetFunc(but, modifiers_explodeDelVg, (void *)emd, (void *)NULL);
-
-
- but=uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "", lx, (cy-=19), buttonWidth,19, &emd->protect, 0.0f, 1.0f, 0, 0, "Clean vertex group edges");
- uiButSetFunc(but,modifiers_explodeFacepa,emd,0);
-
- but=uiDefBut(block, BUT, B_MODIFIER_RECALC, "Refresh", lx, (cy-=19), buttonWidth/2,19, 0, 0, 0, 0, 0, "Recalculate faces assigned to particles");
- uiButSetFunc(but,modifiers_explodeFacepa,emd,0);
-
- uiDefButBitS(block, TOG, eExplodeFlag_EdgeSplit, B_MODIFIER_RECALC, "Split Edges", lx+buttonWidth/2, cy, buttonWidth/2,19, &emd->flag, 0, 0, 0, 0, "Split face edges for nicer shrapnel");
- uiDefButBitS(block, TOG, eExplodeFlag_Unborn, B_MODIFIER_RECALC, "Unborn", lx, (cy-=19), buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are unborn");
- uiDefButBitS(block, TOG, eExplodeFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are alive");
- uiDefButBitS(block, TOG, eExplodeFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are dead");
- uiBlockEndAlign(block);
- } else if (md->type==eModifierType_Shrinkwrap) {
- ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
-
- char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|projection %x1|nearest vertex %x2";
-
- uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to");
-
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
-
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keepDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to keep from the target");
-
- cy -= 3;
- uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position.");
-
- if (smd->shrinkType == MOD_SHRINKWRAP_PROJECT){
-
-
- /* UI for projection axis */
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_MODIFIER_RECALC, "Normal" , lx,(cy-=19),buttonWidth,19, &smd->projAxis, 18.0, MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 0, 0, "Projection over X axis");
- if(smd->projAxis == 0)
- {
- uiDefButC(block, NUM, B_MODIFIER_RECALC, "SS Levels:", lx, (cy-=19), buttonWidth,19, &smd->subsurfLevels, 0, 6, 0, 0, "This indicates the number of CCSubdivisions that must be performed before extracting vertexs positions and normals");
- }
-
- uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, B_MODIFIER_RECALC, "X", lx+buttonWidth/3*0,(cy-=19),buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over X axis");
- uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, B_MODIFIER_RECALC, "Y", lx+buttonWidth/3*1,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Y axis");
- uiDefButBitC(block, TOG, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, B_MODIFIER_RECALC, "Z", lx+buttonWidth/3*2,cy,buttonWidth/3,19, &smd->projAxis, 0, 0, 0, 0, "Projection over Z axis");
-
-
- /* allowed directions of projection axis */
- uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR, B_MODIFIER_RECALC, "Negative", lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the negative direction of axis");
- uiDefButBitS(block, TOG, MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, B_MODIFIER_RECALC, "Positive", lx + buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows to move the vertex in the positive direction of axis");
-
- uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, B_MODIFIER_RECALC, "Cull frontfaces",lx,(cy-=19),buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a front face on target");
- uiDefButBitS(block, TOG, MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, B_MODIFIER_RECALC, "Cull backfaces", lx+buttonWidth/2,cy,buttonWidth/2,19, &smd->shrinkOpts, 0, 0, 0, 0, "Controls whether a vertex can be projected to a back face on target");
- uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->auxTarget, "Aditional mesh to project over");
- }
- else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){
- uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces");
- }
-
- uiBlockEndAlign(block);
-
- } else if (md->type==eModifierType_SimpleDeform) {
- SimpleDeformModifierData *smd = (SimpleDeformModifierData*) md;
- char simpledeform_modemenu[] = "Deform type%t|Twist %x1|Bend %x2|Taper %x3|Strech %x4";
-
- uiDefButC(block, MENU, B_MODIFIER_RECALC, simpledeform_modemenu, lx,(cy-=19),buttonWidth,19, &smd->mode, 0, 0, 0, 0, "Selects type of deform to apply to object.");
-
- but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->origin, "Origin of modifier space coordinates");
- if(smd->origin != NULL)
- uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_ORIGIN_LOCAL, B_MODIFIER_RECALC, "Relative",lx,(cy-=19),buttonWidth,19, &smd->originOpts, 0, 0, 0, 0, "Sets the origin of deform space to be relative to the object");
-
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth,19, &smd->factor, -10.0f, 10.0f, 0.5f, 0, "Deform Factor");
-
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Upper Limit:", lx,(cy-=19),buttonWidth,19, &smd->limit[1], 0.0f, 1.0f, 5.0f, 0, "Upper Limit for deform");
- uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lower Limit:", lx,(cy-=19),buttonWidth,19, &smd->limit[0], 0.0f, 1.0f, 5.0f, 0, "Lower Limit for deform");
-
- if(smd->mode == MOD_SIMPLEDEFORM_MODE_STRETCH
- || smd->mode == MOD_SIMPLEDEFORM_MODE_TAPER )
- {
- uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_LOCK_AXIS_X, B_MODIFIER_RECALC, "Loc X", lx, (cy-=19),buttonWidth/2,19, &smd->axis, 0, 0, 0, 0, "Disallow changes on the X coordinate");
- uiDefButBitC(block, TOG, MOD_SIMPLEDEFORM_LOCK_AXIS_Y, B_MODIFIER_RECALC, "Loc Y", lx+(buttonWidth/2), (cy),buttonWidth/2,19, &smd->axis, 0, 0, 0, 0, "Disallow changes on the Y coordinate");
- }
- }
-
- uiBlockEndAlign(block);
-
- y-=height;
- }
-
- if (md->error) {
- y -= 6;
-
- uiBlockSetCol(block, color);
- /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */
- uiDefBut(block, ROUNDBOX, 0, "", x-10, y, width, 20, NULL, 5.0, 0.0, 15, 40, "");
- uiBlockSetCol(block, TH_AUTO);
-
- uiDefIconBut(block,LABEL,B_NOP,ICON_ERROR, x-9, y,19,19, 0,0,0,0,0, "");
- uiDefBut(block, LABEL, B_NOP, md->error, x+5, y, width-15, 19, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- y -= 18;
- }
-
- uiClearButLock();
-
- y -= 3+6;
-
- *xco = x;
- *yco = y;
-}
-
-static void editing_panel_modifiers(Object *ob)
-{
- ModifierData *md;
- uiBlock *block;
- char str[64];
- int xco, yco, i, lastCageIndex, cageIndex = modifiers_getCageIndex(ob, &lastCageIndex);
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_modifiers", UI_EMBOSS, UI_HELV, curarea->win);
- if( uiNewPanel(curarea, block, "Modifiers", "Editing", 640, 0, 318, 204)==0) return;
-
- uiSetButLock((ob && ob->id.lib), ERROR_LIBDATA_MESSAGE);
- uiNewPanelHeight(block, 204);
-
- uiDefBlockBut(block, modifiers_add_menu, ob, "Add Modifier", 0, 190, 130, 20, "Add a new modifier");
-
- sprintf(str, "To: %s", ob->id.name+2);
- uiDefBut(block, LABEL, 1, str, 140, 190, 160, 20, NULL, 0.0, 0.0, 0, 0, "Object whose modifier stack is being edited");
-
- xco = 0;
- yco = 160;
-
- md = modifiers_getVirtualModifierList(ob);
-
- for (i=0; md; i++, md=md->next) {
- draw_modifier(block, ob, md, &xco, &yco, i, cageIndex, lastCageIndex);
- if (md->mode&eModifierMode_Virtual) i--;
- }
-
- if(yco < 0) uiNewPanelHeight(block, 204-yco);
-}
-
-static char *make_key_menu(Key *key, int startindex)
-{
- KeyBlock *kb;
- int index= 1;
- char *str, item[64];
-
- for (kb = key->block.first; kb; kb=kb->next, index++);
- str= MEM_mallocN(index*40, "key string");
- str[0]= 0;
-
- index= startindex;
- for (kb = key->block.first; kb; kb=kb->next, index++) {
- sprintf (item, "|%s%%x%d", kb->name, index);
- strcat(str, item);
- }
-
- return str;
-}
-
-static void editing_panel_shapes(Object *ob)
-{
- uiBlock *block;
- Key *key= NULL;
- KeyBlock *kb;
- int icon;
- char *strp;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_shapes", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Modifiers", "Editing");
- if( uiNewPanel(curarea, block, "Shapes", "Editing", 640, 0, 318, 204)==0) return;
-
- /* Todo check data is library here */
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- uiDefBut(block, BUT, B_ADDKEY, "Add Shape Key" , 10, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "Add new Shape Key");
-
- key= ob_get_key(ob);
- if(key==NULL) {
- /* label aligns add button */
- uiDefBut(block, LABEL, 0, "", 170, 180,140,20, NULL, 0, 0, 0, 0, "");
- return;
- }
-
- uiDefButS(block, TOG, B_RELKEY, "Relative", 170, 180,140,20, &key->type, 0, 0, 0, 0, "Makes Shape Keys relative");
-
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb==NULL) {
- ob->shapenr= 1;
- kb= key->block.first;
- }
-
- uiBlockBeginAlign(block);
- if(ob->shapeflag & OB_SHAPE_LOCK) icon= ICON_PIN_HLT; else icon= ICON_PIN_DEHLT;
- uiDefIconButBitS(block, TOG, OB_SHAPE_LOCK, B_LOCKKEY, icon, 10,150,25,20, &ob->shapeflag, 0, 0, 0, 0, "Always show the current Shape for this Object");
- if(kb->flag & KEYBLOCK_MUTE) icon= ICON_MUTE_IPO_ON; else icon = ICON_MUTE_IPO_OFF;
- uiDefIconButBitS(block, TOG, KEYBLOCK_MUTE, B_MODIFIER_RECALC, icon, 35,150,20,20, &kb->flag, 0, 0, 0, 0, "Mute the current Shape");
- uiSetButLock(G.obedit==ob, "Unable to perform in EditMode");
- uiDefIconBut(block, BUT, B_PREVKEY, ICON_TRIA_LEFT, 55,150,20,20, NULL, 0, 0, 0, 0, "Previous Shape Key");
- strp= make_key_menu(key, 1);
- uiDefButS(block, MENU, B_SETKEY, strp, 75,150,20,20, &ob->shapenr, 0, 0, 0, 0, "Browse existing choices");
- MEM_freeN(strp);
-
- uiDefIconBut(block, BUT, B_NEXTKEY, ICON_TRIA_RIGHT, 95,150,20,20, NULL, 0, 0, 0, 0, "Next Shape Key");
- uiClearButLock();
- uiDefBut(block, TEX, B_NAMEKEY, "", 115, 150, 170, 20, kb->name, 0.0, 31.0, 0, 0, "Current Shape Key name");
- uiDefIconBut(block, BUT, B_DELKEY, ICON_X, 285,150,25,20, 0, 0, 0, 0, 0, "Deletes current Shape Key");
- uiBlockEndAlign(block);
-
- if(key->type && (ob->shapeflag & OB_SHAPE_LOCK)==0 && ob->shapenr!=1) {
- uiBlockBeginAlign(block);
- make_rvk_slider(block, ob, ob->shapenr-1, 10, 120, 150, 20, "Key value, when used it inserts an animation curve point");
- uiDefButF(block, NUM, B_REDR, "Min ", 160,120, 75, 20, &kb->slidermin, -10.0, 10.0, 100, 1, "Minumum for slider");
- uiDefButF(block, NUM, B_REDR, "Max ", 235,120, 75, 20, &kb->slidermax, -10.0, 10.0, 100, 1, "Maximum for slider");
- uiBlockEndAlign(block);
- }
- if(key->type && ob->shapenr!=1) {
- uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", 10, 90, 150,19, &kb->vgroup, 0.0, 31.0, 0, 0, "Vertex Weight Group name, to blend with Basis Shape");
-
- strp= make_key_menu(key, 0);
- uiDefButS(block, MENU, B_MODIFIER_RECALC, strp, 160, 90, 150,19, &kb->relative, 0.0, 0.0, 0, 0, "Shape used as a relative key");
- MEM_freeN(strp);
- }
-
- if(key->type==0)
- uiDefButS(block, NUM, B_DIFF, "Slurph:", 10, 60, 150, 19, &(key->slurph), -500.0, 500.0, 0, 0, "Creates a delay in amount of frames in applying keypositions, first vertex goes first");
-
-}
-
-/* *************************** FONT ******************************** */
-
-static short give_vfontnr(VFont *vfont)
-{
- VFont *vf;
- short nr= 1;
-
- vf= G.main->vfont.first;
- while(vf) {
- if(vf==vfont) return nr;
- nr++;
- vf= vf->id.next;
- }
- return -1;
-}
-
-static VFont *give_vfontpointer(int nr) /* nr= button */
-{
- VFont *vf;
- short tel= 1;
-
- vf= G.main->vfont.first;
- while(vf) {
- if(tel==nr) return vf;
- tel++;
- vf= vf->id.next;
- }
- return G.main->vfont.first;
-}
-
-VFont *exist_vfont(char *str)
-{
- VFont *vf;
-
- vf= G.main->vfont.first;
- while(vf) {
- if(strcmp(vf->name, str)==0) return vf;
- vf= vf->id.next;
- }
- return 0;
-}
-
-static char *give_vfontbutstr(void)
-{
- VFont *vf;
- int len= 0;
- char *str, di[FILE_MAXDIR], fi[FILE_MAXFILE];
-
- vf= G.main->vfont.first;
- while(vf) {
- strcpy(di, vf->name);
- BLI_splitdirstring(di, fi);
- len+= strlen(fi)+4;
- vf= vf->id.next;
- }
-
- str= MEM_callocN(len+21, "vfontbutstr");
- strcpy(str, "FONTS %t");
- vf= G.main->vfont.first;
- while(vf) {
-
- if(vf->id.us==0) strcat(str, "|0 ");
- else strcat(str, "| ");
-
- strcpy(di, vf->name);
- BLI_splitdirstring(di, fi);
-
- strcat(str, fi);
- vf= vf->id.next;
- }
- return str;
-}
-
-static void load_buts_vfont(char *name)
-{
- VFont *vf;
- Curve *cu;
-
- if(OBACT && OBACT->type==OB_FONT) cu= OBACT->data;
- else return;
-
- vf= exist_vfont(name);
- if(vf==0) {
- vf= load_vfont(name);
- if(vf==0) return;
- }
- else id_us_plus((ID *)vf);
-
- switch(cu->curinfo.flag & CU_STYLE) {
- case CU_BOLD:
- if(cu->vfontb) cu->vfontb->id.us--;
- cu->vfontb= vf;
- break;
- case CU_ITALIC:
- if(cu->vfonti) cu->vfonti->id.us--;
- cu->vfonti= vf;
- break;
- case (CU_BOLD|CU_ITALIC):
- if(cu->vfontbi) cu->vfontbi->id.us--;
- cu->vfontbi= vf;
- break;
- default:
- if(cu->vfont) cu->vfont->id.us--;
- cu->vfont= vf;
- break;
- }
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- BIF_undo_push("Load vector font");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-static void set_unicode_text_fs(char *file)
-{
- if (file) paste_unicodeText(file);
-}
-
-void do_fontbuts(unsigned short event)
-{
- Curve *cu;
- VFont *vf;
- Object *ob;
- ScrArea *sa;
- char str[80];
- int ctevt;
- char *ctmenu;
- DynStr *ds;
- int i, style=0;
-
- ob= OBACT;
-
- switch(event) {
- case B_MAKEFONT:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_STYLETOSELU:
- case B_STYLETOSELB:
- case B_STYLETOSELI:
- switch (event) {
- case B_STYLETOSELU: style = CU_UNDERLINE; break;
- case B_STYLETOSELB: style = CU_BOLD; break;
- case B_STYLETOSELI: style = CU_ITALIC; break;
- }
- if (style_to_sel(style, ((Curve*)ob->data)->curinfo.flag & style)) {
- text_to_curve(ob, 0);
- makeDispListCurveTypes(ob, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_FASTFONT:
- if (G.obedit) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_INSTB:
- cu= ob->data;
- if (cu->totbox < 256) {
- for (i = cu->totbox; i>cu->actbox; i--) cu->tb[i]= cu->tb[i-1];
- cu->tb[cu->actbox]= cu->tb[cu->actbox-1];
- cu->actbox++;
- cu->totbox++;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- text_to_curve(ob, 0);
- makeDispListCurveTypes(ob, 0);
- }
- else {
- error("Do you really need that many text frames?");
- }
- break;
- case B_DELTB:
- cu= ob->data;
- if (cu->totbox > 1) {
- for (i = cu->actbox-1; i < cu->totbox; i++) cu->tb[i]= cu->tb[i+1];
- cu->totbox--;
- cu->actbox--;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- text_to_curve(ob, 0);
- makeDispListCurveTypes(ob, 0);
- }
- break;
- case B_TOUPPER:
- to_upper();
- break;
- case B_LOADFONT:
- vf= give_vfontpointer(G.buts->texnr);
- if(vf && vf->id.prev!=vf->id.next) strcpy(str, vf->name);
- else strcpy(str, U.fontdir);
-
- sa= closest_bigger_area();
- areawinset(sa->win);
-
- activate_fileselect(FILE_LOADFONT, "SELECT FONT", str, load_buts_vfont);
-
- break;
- case B_PACKFONT:
- if (ob) {
- cu= ob->data;
- if(cu && cu->vfont) {
- if (cu->vfont->packedfile) {
- if (G.fileflags & G_AUTOPACK) {
- if (okee("Disable AutoPack ?")) {
- G.fileflags &= ~G_AUTOPACK;
- }
- }
-
- if ((G.fileflags & G_AUTOPACK) == 0) {
- if (unpackVFont(cu->vfont, PF_ASK) == RET_OK) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- } else {
- cu->vfont->packedfile = newPackedFile(cu->vfont->name);
- }
- }
- }
- allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_LOAD3DTEXT:
- if (!G.obedit) { error("Only in editmode!"); return; }
- if (G.obedit->type != OB_FONT) return;
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, load_3dtext_fs);
- break;
-
- case B_LOREM:
- if (!G.obedit) { error("Only in editmode!"); return; }
- if (G.obedit->type != OB_FONT) return;
- add_lorem();
-
- break;
-
- case B_SETFONT:
- if(ob) {
- cu= ob->data;
-
- vf= give_vfontpointer(G.buts->texnr);
- if(vf) {
- id_us_plus((ID *)vf);
-
- switch(cu->curinfo.flag & CU_STYLE) {
- case CU_BOLD:
- cu->vfontb->id.us--;
- cu->vfontb= vf;
- break;
- case CU_ITALIC:
- cu->vfonti->id.us--;
- cu->vfonti= vf;
- break;
- case (CU_BOLD|CU_ITALIC):
- cu->vfontbi->id.us--;
- cu->vfontbi= vf;
- break;
- default:
- cu->vfont->id.us--;
- cu->vfont= vf;
- break;
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- BIF_undo_push("Set vector font");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- break;
-
- case B_SETCHAR:
- G.charmin = 0x0000;
- G.charmax = 0xffff;
- if(G.charstart < 0)
- G.charstart = 0;
- if(G.charstart > (0xffff - 12*6))
- G.charstart = 0xffff - (12*6);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_SETUPCHAR:
- G.charstart = G.charstart - (12*6);
- if(G.charstart < 0)
- G.charstart = 0;
- if(G.charstart < G.charmin)
- G.charstart = G.charmin;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_SETCAT:
- // Create new dynamic string
- ds = BLI_dynstr_new();
-
- // Fill the dynamic string with entries
- for(i=0;i<104;i++)
- {
- BLI_dynstr_append(ds, "|");
- BLI_dynstr_append(ds, uctabname[i].name);
- }
-
- // Create the menu string from dyn string
- ctmenu = BLI_dynstr_get_cstring(ds);
-
- // Call the popup menu
- ctevt = pupmenu_col(ctmenu, 40);
- G.charstart = uctabname[ctevt-1].start;
- G.charmin = uctabname[ctevt-1].start;
- G.charmax = uctabname[ctevt-1].end;
-
- // Free all data
- BLI_dynstr_free(ds);
- MEM_freeN(ctmenu);
-
- // And refresh
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- break;
-
- case B_SETDOWNCHAR:
- G.charstart = G.charstart + (12*6);
- if(G.charstart > (0xffff - 12*6))
- G.charstart = 0xffff - (12*6);
- if(G.charstart > G.charmax - 12*6)
- G.charstart = G.charmax - 12*6;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_SETUNITEXT:
- sa= closest_bigger_area();
- areawinset(sa->win);
-
- if(ob==G.obedit) {
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, set_unicode_text_fs);
- }
- break;
-
- case B_TEXTONCURVE:
- if(ob) {
- cu= ob->data;
- if(cu->textoncurve && cu->textoncurve->type!=OB_CURVE) {
- error("Only Curve Objects");
- cu->textoncurve= 0;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- DAG_scene_sort(G.scene); // makes new dag
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-}
-
-#ifdef INTERNATIONAL
-static void editing_panel_char_type(Object *ob, Curve *cu)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_char_type", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Font", "Editing");
- if(uiNewPanel(curarea, block, "Char", "Editing", 640, 0, 318, 204)==0)
- return;
-
- // Set the selected font
- G.selfont = cu->vfont;
-
- uiDefIconBut(block, BUT, B_SETUNITEXT, ICON_TEXT, 0,210,20,20, 0, 0, 0, 0, 0, "Load Unicode Text file");
-
- // Unicode categorization selection button
- uiDefBut(block, BUT, B_SETCAT, "Unicode Table", 22,210,226,20, 0, 0, 0, 0, 0, "Select Unicode Table");
- uiDefButI(block, NUM, /*B_SETUPCHAR*/ 0, "", 250,210,50,20, &G.charstart, 0, 0xffff, 0, 0, "UT");
-
- // Character selection button
- uiDefBut(block, CHARTAB, B_SETCHAR, "", 0, 0, 264, 200, 0, 0, 0, 0, 0, "Select character");
-
- // Buttons to change the max, min
- uiDefButI(block, BUT, B_SETUPCHAR, "U", 280, 185, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table up");
- uiDefButI(block, BUT, B_SETDOWNCHAR, "D", 280, 0, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table down");
-}
-#endif
-
-static void editing_panel_font_type(Object *ob, Curve *cu)
-{
- uiBlock *block;
- char *strp;
- static int packdummy = 0;
- char str[32];
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_font_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Font", "Editing", 640, 0, 470, 204)==0) return;
-
- switch(cu->curinfo.flag & CU_STYLE) {
- case CU_BOLD:
- G.buts->texnr= give_vfontnr(cu->vfontb);
- break;
- case CU_ITALIC:
- G.buts->texnr= give_vfontnr(cu->vfonti);
- break;
- case (CU_BOLD|CU_ITALIC):
- G.buts->texnr= give_vfontnr(cu->vfontbi);
- break;
- default:
- G.buts->texnr= give_vfontnr(cu->vfont);
- break;
- }
-
- strp= give_vfontbutstr();
-// vfd= cu->vfont->data;
-
- uiDefBut(block, BUT,B_LOADFONT, "Load", 480,188,68,20, 0, 0, 0, 0, 0, "Load a new font");
- uiDefButS(block, MENU, B_SETFONT, strp, 550,188,220,20, &G.buts->texnr, 0, 0, 0, 0, "Change font for object");
-
- if (cu->vfont->packedfile) {
- packdummy = 1;
- } else {
- packdummy = 0;
- }
- uiDefIconButI(block, TOG|BIT|0, B_PACKFONT, ICON_PACKAGE, 772,188,20,20, &packdummy, 0, 0, 0, 0, "Pack/Unpack this font");
-
- /* This doesn't work anyway */
-// uiDefBut(block, LABEL, 0, vfd->name, 480, 165,314,20, 0, 0, 0, 0, 0, "Postscript name of the font");
-
- uiDefBut(block, BUT, B_LOAD3DTEXT, "Insert Text", 480, 165, 90, 20, 0, 0, 0, 0, 0, "Insert text file at cursor");
- uiDefBut(block, BUT, B_LOREM, "Lorem", 575, 165, 70, 20, 0, 0, 0, 0, 0, "Insert a paragraph of Lorem Ipsum at cursor");
- uiDefButC(block, TOG|BIT|2,B_STYLETOSELU, "U", 727,165,20,20, &(cu->curinfo.flag), 0,0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitC(block, TOG, CU_BOLD, B_STYLETOSELB, "B", 752,165,20,20, &(cu->curinfo.flag), 0,0, 0, 0, "");
- uiDefButBitC(block, TOG, CU_ITALIC, B_STYLETOSELI, "i", 772,165,20,20, &(cu->curinfo.flag), 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
-
- MEM_freeN(strp);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_MAKEFONT, "Left", 480,135,47,20, &cu->spacemode, 0.0,0.0, 0, 0, "Left align the text from the object center");
- uiDefButS(block, ROW,B_MAKEFONT, "Center", 527,135,47,20, &cu->spacemode, 0.0,1.0, 0, 0, "Middle align the text from the object center");
- uiDefButS(block, ROW,B_MAKEFONT, "Right", 574,135,47,20, &cu->spacemode, 0.0,2.0, 0, 0, "Right align the text from the object center");
- uiDefButS(block, ROW,B_MAKEFONT, "Justify", 621,135,47,20, &cu->spacemode, 0.0,3.0, 0, 0, "Fill completed lines to maximum textframe width by expanding whitespace");
- uiDefButS(block, ROW,B_MAKEFONT, "Flush", 668,135,47,20, &cu->spacemode, 0.0,4.0, 0, 0, "Fill every line to maximum textframe width, distributing space among all characters");
- uiDefBut(block, BUT, B_TOUPPER, "ToUpper", 715,135,78,20, 0, 0, 0, 0, 0, "Toggle between upper and lower case in editmode");
- uiBlockEndAlign(block);
- uiDefButBitS(block, TOG, CU_FAST, B_FASTFONT, "Fast Edit", 715,105,78,20, &cu->flag, 0, 0, 0, 0, "Don't fill polygons while editing");
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_TEXTONCURVE, "TextOnCurve:", 480,105,220,19, &cu->textoncurve, "Apply a deforming curve to the text");
- uiDefBut(block, TEX,REDRAWVIEW3D, "Ob Family:", 480,84,220,19, cu->family, 0.0, 20.0, 0, 0, "Blender uses font from selfmade objects");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,B_MAKEFONT, "Size:", 480,56,155,20, &cu->fsize, 0.1,10.0, 10, 0, "Size of the text");
- uiDefButF(block, NUM,B_MAKEFONT, "Linedist:", 640,56,155,20, &cu->linedist, 0.0,10.0, 10, 0, "Distance between text lines");
- uiDefButF(block, NUM,B_MAKEFONT, "Word spacing:", 795,56,155,20, &cu->wordspace, 0.0,10.0, 10, 0, "Distance factor between words");
- uiDefButF(block, NUM,B_MAKEFONT, "Spacing:", 480,34,155,20, &cu->spacing, 0.0,10.0, 10, 0, "Spacing of individual characters");
- uiDefButF(block, NUM,B_MAKEFONT, "X offset:", 640,34,155,20, &cu->xof, -50.0,50.0, 10, 0, "Horizontal position from object center");
- uiDefButF(block, NUM,B_MAKEFONT, "UL position:", 795,34,155,20, &cu->ulpos, -0.2,0.8, 10, 0, "Vertical position of underline");
- uiDefButF(block, NUM,B_MAKEFONT, "Shear:", 480,12,155,20, &cu->shear, -1.0,1.0, 10, 0, "Italic angle of the characters");
- uiDefButF(block, NUM,B_MAKEFONT, "Y offset:", 640,12,155,20, &cu->yof, -50.0,50.0, 10, 0, "Vertical position from object center");
- uiDefButF(block, NUM,B_MAKEFONT, "UL height:", 795,12,155,20, &cu->ulheight, 0.01,0.5, 10, 0, "Thickness of underline");
- uiBlockEndAlign(block);
-
- sprintf(str, "%d TextFrame: ", cu->totbox);
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM, REDRAWVIEW3D, str, 805, 188, 145, 20, &cu->actbox, 1.0, cu->totbox, 0, 10, "Textbox to show settings for");
- uiDefBut(block, BUT,B_INSTB, "Insert", 805, 168, 72, 20, 0, 0, 0, 0, 0, "Insert a new text frame after the current one");
- uiDefBut(block, BUT,B_DELTB, "Delete", 877, 168, 73, 20, 0, 0, 0, 0, 0, "Delete current text frame and shift the others up");
- uiDefButF(block, NUM,B_MAKEFONT, "X:", 805, 148, 72, 20, &(cu->tb[cu->actbox-1].x), -50.0, 50.0, 10, 0, "Horizontal offset of text frame");
- uiDefButF(block, NUM,B_MAKEFONT, "Y:", 877, 148, 73, 20, &(cu->tb[cu->actbox-1].y), -50.0, 50.0, 10, 0, "Horizontal offset of text frame");
- uiDefButF(block, NUM,B_MAKEFONT, "Width:", 805, 128, 145, 20, &(cu->tb[cu->actbox-1].w), 0.0, 50.0, 10, 0, "Horizontal offset of text frame");
- uiDefButF(block, NUM,B_MAKEFONT, "Height:", 805, 108, 145, 20, &(cu->tb[cu->actbox-1].h), 0.0, 50.0, 10, 0, "Horizontal offset of text frame");
- uiBlockEndAlign(block);
-}
-
-
-/* *************************** CURVE ******************************** */
-
-
-void do_curvebuts(unsigned short event)
-{
- extern ListBase editNurb; /* from editcurve */
- Object *ob;
- Curve *cu;
- Nurb *nu;
-
- ob= OBACT;
- if(ob==0) return;
-
- switch(event) {
-
- case B_CONVERTPOLY:
- case B_CONVERTBEZ:
- case B_CONVERTBSPL:
- case B_CONVERTCARD:
- case B_CONVERTNURB:
- if(G.obedit) {
- setsplinetype(event-B_CONVERTPOLY);
- BIF_undo_push("Convert type");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_UNIFU:
- case B_ENDPU:
- case B_BEZU:
- case B_UNIFV:
- case B_ENDPV:
- case B_BEZV:
- if(G.obedit) {
- nu= editNurb.first;
- while(nu) {
- if(isNurbsel(nu)) {
- if((nu->type & 7)==CU_NURBS) {
- if(event<B_UNIFV) {
- nu->flagu &= CU_CYCLIC; /* disable all flags except for CU_CYCLIC */
- nu->flagu |= ((event-B_UNIFU)<<1);
- clamp_nurb_order_u(nu);
- makeknots(nu, 1, nu->flagu>>1);
- }
- else if(nu->pntsv>1) {
- nu->flagv &= CU_CYCLIC; /* disable all flags except for CU_CYCLIC */
- nu->flagv |= ((event-B_UNIFV)<<1);
- clamp_nurb_order_v(nu);
- makeknots(nu, 2, nu->flagv>>1);
- }
- }
- }
- nu= nu->next;
- }
- BIF_undo_push("Cyclic");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_SETWEIGHT:
- if(G.obedit) {
- weightflagNurb(1, editbutweight, 0);
- BIF_undo_push("Set weight");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_SETW1:
- editbutweight= 1.0;
- scrarea_queue_winredraw(curarea);
- break;
- case B_SETW2:
- editbutweight= sqrt(2.0)/4.0;
- scrarea_queue_winredraw(curarea);
- break;
- case B_SETW3:
- editbutweight= 0.25;
- scrarea_queue_winredraw(curarea);
- break;
- case B_SETW4:
- editbutweight= sqrt(0.5);
- scrarea_queue_winredraw(curarea);
- break;
- case B_SETORDER:
- if(G.obedit) {
- nu= get_actNurb();
- if(nu && (nu->type & 7)==CU_NURBS ) {
- if(clamp_nurb_order_u(nu)) {
- scrarea_queue_winredraw(curarea);
- }
- makeknots(nu, 1, nu->flagu>>1);
- if(clamp_nurb_order_v(nu)) {
- scrarea_queue_winredraw(curarea);
- }
- makeknots(nu, 2, nu->flagv>>1);
- }
- BIF_undo_push("Make knots");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_TILTINTERP:
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_SUBSURFTYPE:
- /* fallthrough */
- case B_MAKEDISP:
- if(G.vd) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
- }
- break;
-
- case B_SUBDIVCURVE:
- subdivideNurb();
- break;
- case B_SPINNURB:
- if( (G.obedit==NULL) || (G.obedit->type!=OB_SURF) || (G.vd==NULL) ||
- ((G.obedit->lay & G.vd->lay) == 0) ) return;
- spinNurb(0, 0);
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_CU3D: /* allow 3D curve */
- if(G.obedit) {
- cu= G.obedit->data;
- nu= editNurb.first;
- while(nu) {
- nu->type &= ~CU_2D;
- if((cu->flag & CU_3D)==0) nu->type |= CU_2D;
- test2DNurb(nu);
- nu= nu->next;
- }
- }
- if(ob->type==OB_CURVE) {
- cu= ob->data;
- nu= cu->nurb.first;
- while(nu) {
- nu->type &= ~CU_2D;
- if((cu->flag & CU_3D)==0) nu->type |= CU_2D;
- test2DNurb(nu);
- nu= nu->next;
- }
- }
- BIF_undo_push("Make 2D/3D");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_SETRESOLU:
- if(ob->type==OB_CURVE) {
- cu= ob->data;
- if(ob==G.obedit) nu= editNurb.first;
- else nu= cu->nurb.first;
-
- while(nu) {
- nu->resolu= cu->resolu;
- nu= nu->next;
- }
- }
-
- BIF_undo_push("Set resolution");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-
- break;
-
- /* Buttons for aligning handles */
- case B_SETPT_AUTO:
- if(ob->type==OB_CURVE) {
- sethandlesNurb(1);
- BIF_undo_push("Auto Curve Handles");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_SETPT_VECTOR:
- if(ob->type==OB_CURVE) {
- sethandlesNurb(2);
- BIF_undo_push("Vector Curve Handles");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_SETPT_ALIGN:
- if(ob->type==OB_CURVE) {
- sethandlesNurb(5);
- BIF_undo_push("Align Curve Handles");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_SETPT_FREE:
- if(ob->type==OB_CURVE) {
- sethandlesNurb(6);
- BIF_undo_push("Free Align Curve Handles");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- }
-}
-
-static void editing_panel_curve_tools(Object *ob, Curve *cu)
-{
- Nurb *nu;
- extern ListBase editNurb; /* from editcurve */
- uiBlock *block;
- short *sp;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Curve Tools", "Editing", 640, 0, 318, 204)==0) return;
-
- uiDefBut(block, LABEL, 0, "Make Knots",562,173,102, 18, 0, 0, 0, 0, 0, "");
-
- if(ob->type==OB_CURVE) {
- uiDefBut(block, LABEL, 0, "Convert", 463,173,72, 18, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_CONVERTPOLY,"Poly", 450,152,110, 18, 0, 0, 0, 0, 0, "Converts selected into regular Polygon vertices");
- uiDefBut(block, BUT,B_CONVERTBEZ,"Bezier", 450,132,110, 18, 0, 0, 0, 0, 0, "Converts selected to Bezier triples");
- uiDefBut(block, BUT,B_CONVERTNURB,"Nurb", 450,112,110, 18, 0, 0, 0, 0, 0, "Converts selected to Nurbs Points");
- }
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_UNIFU,"Uniform U", 565,152,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in U");
- uiDefBut(block, BUT,B_UNIFV,"V", 670,152,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in V");
- uiDefBut(block, BUT,B_ENDPU,"Endpoint U", 565,132,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in U");
- uiDefBut(block, BUT,B_ENDPV,"V", 670,132,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in V");
- uiDefBut(block, BUT,B_BEZU,"Bezier U", 565,112,102, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in U");
- uiDefBut(block, BUT,B_BEZV,"V", 670,112,50, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in V");
- uiBlockEndAlign(block);
-
- uiDefBut(block, BUT,B_SETWEIGHT,"Set Weight", 450,11,110,49, 0, 0, 0, 0, 0, "Nurbs only; set weight for select points");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,0,"Weight:", 565,36,102,22, &editbutweight, 0.01, 100.0, 10, 0, "The weight you can assign");
- uiDefBut(block, BUT,B_SETW1,"1.0", 670,36,50,22, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT,B_SETW2,"sqrt(2)/4",565,11,55,20, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT,B_SETW3,"0.25", 620,11,45,20, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT,B_SETW4,"sqrt(0.5)",665,11,55,20, 0, 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
-
- if(ob==G.obedit) {
- nu= get_actNurb();
- if(nu==NULL && editNurb.first) {
- nu= editNurb.first;
- set_actNurb(nu);
- }
- if(nu) {
- if (ob->type==OB_CURVE) {
- uiDefBut(block, LABEL, 0, "Tilt",
- 450,90,72, 18, 0, 0, 0, 0, 0, "");
- /* KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE */
- uiDefButS(block, MENU, B_TILTINTERP, "Tilt Interpolation %t|Linear%x0|Cardinal%x1|BSpline %x2|Ease%x3",
- 495,90,66, 18, &(nu->tilt_interp), 0, 0, 0, 0, "Tadius interpolation for 3D curves");
-
- uiDefBut(block, LABEL, 0, "Radius",
- 450,70,72, 18, 0, 0, 0, 0, 0, "");
- uiDefButS(block, MENU, B_TILTINTERP, "Radius Interpolation %t|Linear%x0|Cardinal%x1|BSpline %x2|Ease%x3",
- 495,70,66, 18, &(nu->radius_interp), 0, 0, 0, 0, "Radius interpolation");
- }
-
- uiBlockBeginAlign(block);
- sp= &(nu->orderu);
- uiDefButS(block, NUM, B_SETORDER, "Order U:", 565,90,102, 19, sp, 2.0, 6.0, 0, 0, "Nurbs only; the amount of control points involved");
- sp= &(nu->orderv);
- uiDefButS(block, NUM, B_SETORDER, "V:", 670,90,50, 19, sp, 2.0, 6.0, 0, 0, "Nurbs only; the amount of control points involved");
- sp= &(nu->resolu);
- uiDefButS(block, NUM, B_MAKEDISP, "Resol U:", 565,70,102, 19, sp, 1.0, 1024.0, 0, 0, "The amount of new points interpolated per control vertex pair");
- sp= &(nu->resolv);
- uiDefButS(block, NUM, B_MAKEDISP, "V:", 670,70,50, 19, sp, 1.0, 1024.0, 0, 0, "The amount of new points interpolated per control vertex pair");
- }
- }
-
-
-}
-
-static void editing_panel_curve_tools1(Object *ob, Curve *cu)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools1", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Curve Tools1", "Editing", 960, 0, 318, 204)==0) return;
-
- uiDefBut(block, BUT, B_SUBDIVCURVE, "Subdivide", 400,180,150,20, 0, 0, 0, 0, 0, "Subdivide selected");
- if(ob->type==OB_SURF) {
- uiDefBut(block, BUT, B_SPINNURB, "Spin", 400,160,150,20, 0, 0, 0, 0, 0, "Spin selected 360 degrees");
- }
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_HIDE, "Hide", 400,140,150,18, 0, 0, 0, 0, 0, "Hides selected faces");
- uiDefBut(block, BUT,B_REVEAL, "Reveal", 400,120,150,18, 0, 0, 0, 0, 0, "Reveals selected faces");
- uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 400,100,150,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 400, 60, 150, 19, &G.scene->editbutsize, 0.001, 1.0, 10, 0, "Normal size for drawing");
- uiDefButBitI(block, TOGN, G_HIDDENHANDLES, REDRAWVIEW3D, "Draw Handles", 400, 40, 150, 19, &G.f, 0, 0, 0, 0, "Draw curve handles in 3D view");
- uiBlockEndAlign(block);
-
- if(G.obedit) {
- uiBut *but;
- uiBlockBeginAlign(block);
- but= uiDefButBitS(block,TOG,CU_RETOPO,B_NOP, "Retopo", 560,180,100,19, &cu->flag, 0,0,0,0, "Turn on the re-topology tool");
- uiButSetFunc(but,retopo_toggle,0,0);
- if(cu->flag & CU_RETOPO) {
- but= uiDefBut(block,BUT,B_NOP,"Retopo All", 560,160,100,19, 0,0,0,0,0, "Apply the re-topology tool to all selected vertices");
- uiButSetFunc(but,retopo_do_all_cb,0,0);
- }
- }
-}
-
-/* only for bevel or taper */
-static void test_obcurpoin_but(char *name, ID **idpp)
-{
- ID *id;
-
- for(id= G.main->object.first; id; id= id->next) {
- if( strcmp(name, id->name+2)==0 ) {
- if (((Object *)id)->type != OB_CURVE) {
- error ("Bevel/Taper Object must be a Curve");
- break;
- }
- if(id == (ID *)OBACT) {
- error ("Cannot Bevel/Taper own Object");
- break;
- }
-
- *idpp= id;
- return;
- }
- }
- *idpp= NULL;
-}
-
-
-
-/* for curve, surf and font! */
-static void editing_panel_curve_type(Object *ob, Curve *cu)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Curve and Surface", "Editing", 320, 0, 318, 204)==0) return;
-
- uiDefButBitS(block, TOG, CU_UV_ORCO, 0, "UV Orco", 600,160,150,19, &cu->flag, 0, 0, 0, 0, "Forces to use UV coordinates for texture mapping 'orco'");
- if(ob->type==OB_SURF)
- uiDefButBitS(block, TOG, CU_NOPUNOFLIP, REDRAWVIEW3D, "No Puno Flip", 600,140,150,19, &cu->flag, 0, 0, 0, 0, "Don't flip vertex normals while render");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_DOCENTER, "Center", 600, 115, 55, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
- uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 655, 115, 95, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
- uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
- uiBlockEndAlign(block);
-
- if(cu->key) {
- /* uiDefButS(block, NUM, B_DIFF, "Slurph:", 600,25,140,19, &(cu->key->slurph), -500.0, 500.0,0,0); ,""*/
- uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 600, 72,150,19, &cu->key->type, 0, 0, 0, 0, "");
- }
-
-
- if(ob->type!=OB_SURF) {
-
- if(ob->type==OB_CURVE) {
- extern float prlen; // buttons_object.c, should be moved....
- char str[32];
-
- sprintf(str, "%.4f", prlen);
- uiDefBut(block, BUT, B_PRINTLEN, "PrintLen", 600,135,75,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, str, 675,135,75,19, 0, 1.0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- /*note, PathLen's max was MAXFRAMEF but this is a short, perhaps the pathlen should be increased later on */
- uiDefButS(block, NUM, B_RECALCPATH, "PathLen:", 600,50,150,19, &cu->pathlen, 1.0, 32767.0f, 0, 0, "If no speed Ipo was set, the amount of frames of the path");
- uiDefButBitS(block, TOG, CU_PATH, B_RECALCPATH, "CurvePath", 600,30,75,19 , &cu->flag, 0, 0, 0, 0, "Enables curve to become translation path");
- uiDefButBitS(block, TOG, CU_FOLLOW, REDRAWVIEW3D, "CurveFollow",675,30,75,19, &cu->flag, 0, 0, 0, 0, "Makes curve path children to rotate along path");
- uiDefButBitS(block, TOG, CU_STRETCH, B_CURVECHECK, "CurveStretch", 600,10,150,19, &cu->flag, 0, 0, 0, 0, "Option for curve-deform: makes deformed child to stretch along entire path");
- uiDefButBitS(block, TOG, CU_OFFS_PATHDIST, REDRAWVIEW3D, "PathDist Offs", 600,-10,150,19, &cu->flag, 0, 0, 0, 0, "Children will use TimeOffs value as path distance offset");
-
- uiBlockEndAlign(block);
- }
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_SETRESOLU, "DefResolU:", 760,160,150,19, &cu->resolu, 1.0, 1024.0, 0, 0, "Default resolution");
- uiDefButS(block, NUM, B_NOP, "RenResolU", 760,140,150,19, &cu->resolu_ren, 0.0f, 1024, 0, 0, "Set resolution for rendering. A value of zero skips this operation.");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MAKEDISP, "Width:", 760,90,150,19, &cu->width, 0.0, 2.0, 1, 0, "Make interpolated result thinner or fatter");
- uiDefButF(block, NUM, B_MAKEDISP, "Extrude:", 760,70,150,19, &cu->ext1, 0.0, 100.0, 10, 0, "Curve extrusion size when not using a bevel object");
- uiDefButF(block, NUM, B_MAKEDISP, "Bevel Depth:", 760,50,150,19, &cu->ext2, 0.0, 2.0, 1, 0, "Bevel depth when not using a bevel object");
- uiDefButS(block, NUM, B_MAKEDISP, "BevResol:", 760,30,150,19, &cu->bevresol, 0.0, 32.0, 0, 0, "Bevel resolution when depth is non-zero and not using a bevel object");
- uiDefIDPoinBut(block, test_obcurpoin_but, ID_OB, B_CHANGEDEP, "BevOb:", 760,10,150,19, &cu->bevobj, "Curve object name that defines the bevel shape");
- uiDefIDPoinBut(block, test_obcurpoin_but, ID_OB, B_CHANGEDEP, "TaperOb:", 760,-10,150,19, &cu->taperobj, "Curve object name that defines the taper (width)");
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, CU_BACK, B_MAKEDISP, "Back", 760,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled back for extruded/beveled curves");
- uiDefButBitS(block, TOG, CU_FRONT, B_MAKEDISP, "Front",810,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled front for extruded/beveled curves");
- uiDefButBitS(block, TOG, CU_3D, B_CU3D, "3D", 860,115,50,19, &cu->flag, 0, 0, 0, 0, "Allow Curve to be 3d, it doesn't fill then");
- }
-}
-
-
-/* *************************** CAMERA ******************************** */
-
-/* callback to handle angle to lens conversion */
-static void do_angletolensconversion_cb(void *lens1, void *angle1)
-{
- float *lens= (float *)lens1;
- float *angle= (float *)angle1;
- float anglevalue= *angle;
-
- if(lens) {
- *lens= 16.0f / tan(M_PI*anglevalue/360.0f);
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* callback to handle lens to angle conversion */
-static void do_lenstoangleconversion_cb(void *lens1, void *angle1)
-{
- float *lens= (float *)lens1;
- float *angle= (float *)angle1;
- float lensvalue= *lens;
-
- if(lens) {
- *angle= 360.0f * atan(16.0f/lensvalue) / M_PI;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void editing_panel_camera_type(Object *ob, Camera *cam)
-{
- uiBlock *block;
- uiBut *but;
- float grid=0.0;
-
- if(G.vd) grid= G.vd->grid;
- if(grid<1.0) grid= 1.0;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Camera", "Editing", 320, 0, 318, 204)==0) return;
-
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- uiDefBut(block, LABEL, 10, "Lens:", 10, 180, 150, 20, 0, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- if(cam->type==CAM_ORTHO) {
- uiDefButF(block, NUM,REDRAWVIEW3D, "Scale:",
- 10, 160, 150, 20, &cam->ortho_scale, 0.01, 1000.0, 50, 0, "Specify the ortho scaling of the used camera");
- } else {
- if(cam->flag & CAM_ANGLETOGGLE) {
- but= uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:",
- 10, 160, 130, 20, &cam->angle, 7.323871, 172.847331, 100, 0, "Specify the lens of the camera in degrees");
- uiButSetFunc(but,do_angletolensconversion_cb, &cam->lens, &cam->angle);
- }
- else {
- but= uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:",
- 10, 160, 130, 20, &cam->lens, 1.0, 250.0, 100, 0, "Specify the lens of the camera");
- uiButSetFunc(but,do_lenstoangleconversion_cb, &cam->lens, &cam->angle);
- }
-
- uiDefButS(block, TOG|BIT|5, B_REDR, "D",
- 140, 160, 20, 20, &cam->flag, 0, 0, 0, 0, "Use degree as the unit of the camera lens");
- }
- uiDefButS(block, TOG, REDRAWVIEW3D, "Orthographic",
- 10, 140, 150, 20, &cam->type, 0, 0, 0, 0, "Render with orthographic projection (no prespective)");
- uiBlockEndAlign(block);
-
-/* qdn: focal dist. param. from yafray now enabled for Blender as well, to use with defocus composit node */
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWVIEW3D, "Dof Dist:", 10, 110, 150, 20 /*0, 125, 150, 20*/, &cam->YF_dofdist, 0.0, 5000.0, 50, 0, "Sets distance to point of focus (enable 'Limits' to make visible in 3Dview)");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "Dof Ob:", 10, 90, 150, 20, &cam->dof_ob, "Focus on this object (overrides the 'Dof Dist')");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Clipping Start/End:", 10, 45, 150, 20, 0, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,REDRAWVIEW3D, "Start:",
- 10, 25, 150, 20, &cam->clipsta, 0.001*grid, 100.0*grid, 10, 0, "Clip out geometry closer then this distance to the camera");
- uiDefButF(block, NUM,REDRAWVIEW3D, "End:",
- 10, 5, 150, 20, &cam->clipend, 1.0, 5000.0*grid, 100, 0, "Clip out geometry further then this distance to the camera");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Show:", 170, 180, 150, 20, 0, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Limits",
- 170, 160, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw the clipping range and the focal point");
- uiDefButS(block, TOG|BIT|1, REDRAWVIEW3D, "Mist",
- 245, 160, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area");
-
- uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Name",
- 170, 140, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw the active camera's name in camera view");
- uiDefButS(block, TOG|BIT|3, REDRAWVIEW3D, "Title Safe",
- 245, 140, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw a the title safe zone in camera view");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, TOG|BIT|2, REDRAWVIEW3D, "Passepartout",
- 170, 110, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a darkened passepartout over the off-screen area in camera view");
- uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Alpha: ",
- 170, 90, 150, 20, &cam->passepartalpha, 0.0, 1.0, 0, 0, "The opacity (darkness) of the passepartout");
- uiBlockEndAlign(block);
-
- uiDefButF(block, NUM,REDRAWVIEW3D, "Size:",
- 170, 50, 150, 20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "The size that the camera is displayed in the 3D View (different from the object's scale)");
-
- uiDefBut(block, LABEL, 0, "Shift:", 170, 25, 150, 20, 0, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,REDRAWVIEW3D, "X:",
- 170, 5, 75, 20, &cam->shiftx, -2.0, 2.0, 1, 2, "Horizontally shift the camera view, without changing the perspective");
- uiDefButF(block, NUM,REDRAWVIEW3D, "Y:",
- 245, 5, 75, 20, &cam->shifty, -2.0, 2.0, 1, 2, "Vertically shift the camera view, without changing the perspective");
- uiBlockEndAlign(block);
-}
-
-/* yafray: extra camera panel to set Depth-of-Field parameters */
-static void editing_panel_camera_yafraydof(Object *ob, Camera *cam)
-{
- uiBlock *block;
- char *mst1, *mst2;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_yafraydof", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Camera", "Editing");
- if(uiNewPanel(curarea, block, "Yafray DoF", "Editing", 320, 0, 318, 204)==0) return;
-
- uiDefButF(block, NUM, REDRAWVIEW3D, "DoFDist:", 10, 147, 180, 20, &cam->YF_dofdist, 0.0, 5000.0, 50, 0, "Sets distance to point of focus (use camera 'ShowLimits' to make visible in 3Dview)");
- uiDefButF(block, NUM, B_DIFF, "Aperture:", 10, 125, 180, 20, &cam->YF_aperture, 0.0, 2.0, 1, 0, "Sets lens aperture, the larger, the more blur (use small values, 0 is no DoF)");
-
- uiDefButBitS(block, TOG, CAM_YF_NO_QMC, B_DIFF, "Random sampling", 10, 90, 180, 20, &cam->flag, 0, 0, 0, 0, "Use noisy random Lens sampling instead of QMC");
-
- uiDefBut(block, LABEL, 0, "Bokeh", 10, 60, 180, 19, 0, 0.0, 0.0, 0, 0, "");
- mst1 = "Bokeh Type%t|Disk1%x0|Disk2%x1|Triangle%x2|Square%x3|Pentagon%x4|Hexagon%x5|Ring%x6";
- uiDefButS(block, MENU, B_REDR, mst1, 10, 40, 89, 20, &cam->YF_bkhtype, 0.0, 0.0, 0, 0, "Sets Bokeh type");
-
- if ((cam->YF_bkhtype!=0) && (cam->YF_bkhtype!=6)) {
- mst2 = "Bokeh Bias%t|Uniform%x0|Center%x1|Edge%x2";
- uiDefButS(block, MENU, B_REDR, mst2, 100, 40, 90, 20, &cam->YF_bkhbias, 0.0, 0.0, 0, 0, "Sets Bokeh bias");
- if (cam->YF_bkhtype>1)
- uiDefButF(block, NUM, B_DIFF, "Rotation:", 10, 15, 180, 20, &cam->YF_bkhrot, 0.0, 360.0, 100, 0, "Shape rotation amount in degrees");
- }
-
-}
-
-/* **************************** CAMERA *************************** */
-
-void do_cambuts(unsigned short event)
-{
- Object *ob;
-
- ob= OBACT;
- if (ob==0) return;
-
- switch(event) {
- case 0:
- ;
- break;
- }
-}
-
-/* *************************** MBALL ******************************** */
-
-void do_mballbuts(unsigned short event)
-{
- switch(event) {
- case B_RECALCMBALL:
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
- }
-}
-
-static void editing_panel_mball_type(Object *ob, MetaBall *mb)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "MetaBall", "Editing", 320, 0, 318, 204)==0) return;
-
- ob= find_basis_mball(ob);
- mb= ob->data;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_RECALCMBALL, "Wiresize:", 470,178,250,19, &mb->wiresize, 0.05, 1.0, 1, 0, "Polygonization resolution in 3d window");
- uiDefButF(block, NUM, B_NOP, "Rendersize:", 470,158,250,19, &mb->rendersize, 0.05, 1.0, 1, 0, "Polygonization resolution in rendering");
- uiDefButF(block, NUM, B_RECALCMBALL, "Threshold:", 470,138,250,19, &mb->thresh, 0.0001, 5.0, 1, 0, "Defines influence of meta elements");
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefBut(block, LABEL, 0, "Update:", 471,108,120,19, 0, 0, 0, 0, 0, "");
- uiDefButS(block, ROW, B_DIFF, "Always", 471, 85, 120, 19, &mb->flag, 0.0, 0.0, 0, 0, "While editing, always updates");
- uiDefButS(block, ROW, B_DIFF, "Half Res", 471, 65, 120, 19, &mb->flag, 0.0, 1.0, 0, 0, "While editing, updates in half resolution");
- uiDefButS(block, ROW, B_DIFF, "Fast", 471, 45, 120, 19, &mb->flag, 0.0, 2.0, 0, 0, "While editing, updates without polygonization");
- uiDefButS(block, ROW, B_DIFF, "Never", 471, 25, 120, 19, &mb->flag, 0.0, 3.0, 0, 0, "While editing, doesn't update");
-
-}
-
-static void editing_panel_mball_tools(Object *ob, MetaBall *mb)
-{
- extern MetaElem *lastelem;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_tools", UI_EMBOSS, UI_HELV, curarea->win);
- if( uiNewPanel(curarea, block, "MetaBall tools", "Editing", 640, 0, 318, 204)==0) return;
-
- if(ob==G.obedit && lastelem) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 750,178,250,19, &lastelem->s, 0.0, 10.0, 1, 0, "Stiffness for active meta");
- if(lastelem->type!=MB_BALL)
- uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 750,158,250,19, &lastelem->expx, 0.0, 20.0, 1, 0, "X size for active meta");
- if((lastelem->type!=MB_BALL)&&(lastelem->type!=MB_TUBE))
- uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 750,138,250,19, &lastelem->expy, 0.0, 20.0, 1, 0, "Y size for active meta");
-
- if((lastelem->type==MB_CUBE)||(lastelem->type==MB_ELIPSOID))
- uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 750,118,250,19, &lastelem->expz, 0.0, 20.0, 1, 0, "Z size for active meta");
- uiBlockEndAlign(block);
-
- uiDefButS(block, ROW, B_RECALCMBALL, "Ball", 753,83,60,19, &lastelem->type, 1.0, MB_BALL, 0, 0, "Draw active meta as Ball");
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_RECALCMBALL, "Tube", 753,62,60,19, &lastelem->type, 1.0, MB_TUBE, 0, 0, "Draw active meta as Ball");
- uiDefButS(block, ROW, B_RECALCMBALL, "Plane", 814,62,60,19, &lastelem->type, 1.0, MB_PLANE, 0, 0, "Draw active meta as Plane");
- uiDefButS(block, ROW, B_RECALCMBALL, "Elipsoid", 876,62,60,19, &lastelem->type, 1.0, MB_ELIPSOID, 0, 0, "Draw active meta as Ellipsoid");
- uiDefButS(block, ROW, B_RECALCMBALL, "Cube", 938,62,60,19, &lastelem->type, 1.0, MB_CUBE, 0, 0, "Draw active meta as Cube");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, MB_NEGATIVE, B_RECALCMBALL, "Negative",753,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta creating holes");
- uiDefButBitS(block, TOG, MB_HIDE, B_RECALCMBALL, "Hide",878,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta invisible");
- uiBlockEndAlign(block);
-
- }
-
-}
-
-
-/* *************************** LATTICE ******************************** */
-
-void do_latticebuts(unsigned short event)
-{
- Object *ob;
- Lattice *lt;
-
- ob= OBACT;
- if(ob->type!=OB_LATTICE) return;
-
- switch(event) {
- case B_REGULARLAT:
- if(ob) {
- lt = ob->data;
- if(ob==G.obedit) resizelattice(editLatt, lt->opntsu, lt->opntsv, lt->opntsw, NULL);
- else resizelattice(ob->data, lt->opntsu, lt->opntsv, lt->opntsw, NULL);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- case B_RESIZELAT:
- if(ob) {
- lt = ob->data;
- resizelattice(ob->data, lt->opntsu, lt->opntsv, lt->opntsw, ob);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_DRAWLAT:
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_LATTCHANGED:
-
- lt= ob->data;
- if(lt->flag & LT_OUTSIDE) outside_lattice(lt);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
-
- break;
- }
-}
-
-static void editing_panel_lattice_type(Object *ob, Lattice *lt)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_lattice_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Lattice", "Editing", 320, 0, 318, 204)==0) return;
-
-
- uiSetButLock(lt->key!=0, "Not with VertexKeys");
- uiSetButLock(ob==G.obedit, "Unable to perform function in EditMode");
-
- uiBlockBeginAlign(block);
-
- lt->opntsu = lt->pntsu;
- lt->opntsv = lt->pntsv;
- lt->opntsw = lt->pntsw;
-
- uiDefButS(block, NUM, B_RESIZELAT, "U:", 469, 178,100,19, &lt->opntsu, 1.0, 64.0, 0, 0, "Points in U direction");
- uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
-
- uiDefButS(block, NUM, B_RESIZELAT, "V:", 469, 156,100,19, &lt->opntsv, 1.0, 64.0, 0, 0, "Points in V direction");
- uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 156, 40, 19, &lt->typev, 2.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 156, 40, 19, &lt->typev, 2.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 156, 40, 19, &lt->typev, 2.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
-
- uiDefButS(block, NUM, B_RESIZELAT, "W:", 469, 134,100,19, &lt->opntsw, 1.0, 64.0, 0, 0, "Points in W direction");
- uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 134, 40, 19, &lt->typew, 3.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 134, 40, 19, &lt->typew, 3.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
- uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 134, 40, 19, &lt->typew, 3.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
-
- uiBlockEndAlign(block);
-
- uiDefBut(block, BUT, B_REGULARLAT, "Make Regular", 469,98,102,31, 0, 0, 0, 0, 0, "Make Lattice regular");
-
- uiClearButLock();
- uiDefButBitS(block, TOG, LT_OUTSIDE, B_LATTCHANGED, "Outside", 571,98,122,31, &lt->flag, 0, 0, 0, 0, "Only draw, and take into account, the outer vertices");
-
- if(lt->key) {
- uiDefButS(block, NUM, B_DIFF, "Slurph:", 469,60,120,19, &(lt->key->slurph), -500.0, 500.0, 0, 0, "Set time value to denote 'slurph' (sequential delay) vertices with key framing");
- uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 469,40,120,19, &lt->key->type, 0, 0, 0, 0, "Use relative keys (instead of absolute)");
- }
-
-}
-
-/* *************************** ARMATURE ******************************** */
-
-void do_armbuts(unsigned short event)
-{
- Object *ob= OBACT;
- bAction *act;
-
- switch(event) {
- case B_ARM_RECALCDATA:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_ARM_STRIDE:
- if(ob && ob->pose) {
- bPoseChannel *pchan;
- bActionStrip *strip;
-
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next)
- if(pchan->flag & POSE_STRIDE)
- break;
-
- /* we put the stride bone name in the strips, for lookup of action channel */
- for (strip=ob->nlastrips.first; strip; strip=strip->next){
- if(strip->flag & ACTSTRIP_USESTRIDE) {
- if(pchan) BLI_strncpy(strip->stridechannel, pchan->name, 32);
- else strip->stridechannel[0]= 0;
- }
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case B_ARM_CALCPATHS:
- if (ob && ob->pose)
- pose_calculate_path(ob);
- break;
- case B_ARM_CLEARPATHS:
- if (ob && ob->pose)
- pose_clear_paths(ob);
- break;
-
- case B_POSELIB_ADDPOSE:
- if (ob && ob->pose)
- poselib_add_current_pose(ob, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- break;
- case B_POSELIB_REPLACEP:
- if (ob && ob->pose)
- poselib_add_current_pose(ob, 2);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- break;
- case B_POSELIB_REMOVEP:
- if (ob && ob->pose) {
- bAction *act= ob->poselib;
- TimeMarker *marker= poselib_get_active_pose(act);
-
- poselib_remove_pose(ob, marker);
- }
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- break;
- case B_POSELIB_VALIDATE:
- if (ob && ob->pose)
- poselib_validate_act(ob->poselib);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- break;
- case B_POSELIB_APPLYP:
- if (ob && ob->pose)
- poselib_preview_poses(ob, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- /* note: copied from headerbuttons.c */
- case B_POSELIB_ALONE: //B_ACTALONE
- if (ob && ob->id.lib==0) {
- act= ob->poselib;
-
- if (act->id.us > 1) {
- if (okee("Single user")) {
- ob->poselib= copy_action(act);
- act->id.us--;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- }
- }
- }
- break;
- case B_POSELIB_DELETE: //B_ACTIONDELETE
- act= ob->poselib;
-
- if (act)
- act->id.us--;
- ob->poselib=NULL;
-
- BIF_undo_push("Unlink PoseLib");
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- break;
- case B_POSELIB_BROWSE: //B_ACTIONBROWSE:
- {
- ID *id, *idtest;
- int nr= 1;
-
- if (ob == NULL)
- break;
- act= ob->poselib;
- id= (ID *)act;
-
- if (G.buts->menunr == -2) {
- activate_databrowse((ID *)ob->poselib, ID_AC, 0, B_POSELIB_BROWSE, &G.buts->menunr, do_armbuts);
- return;
- }
- if (G.buts->menunr < 0) break;
-
- /* See if we have selected a valid action */
- for (idtest= G.main->action.first; idtest; idtest= idtest->next) {
- if (nr == G.buts->menunr) {
- break;
- }
- nr++;
- }
-
- /* Store current action */
- if (!idtest) {
- /* 'Add New' option:
- * - make a copy of an exisiting action
- * - or make a new empty action if no existing action
- */
- if (act) {
- idtest= (ID *)copy_action(act);
- }
- else {
- /* a plain action */
- idtest=(ID *)add_empty_action("PoseLib");
- }
- idtest->us--;
- }
-
- if ((idtest != id) && (ob)) {
- act= (bAction *)idtest;
-
- ob->poselib= act;
- id_us_plus(idtest);
-
- if (id) id->us--;
-
- /* Update everything */
- BIF_undo_push("Browse PoseLibs");
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- }
- break;
-
- case B_POSEGRP_RECALC:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_POSEGRP_ADD:
- if (ob && ob->pose)
- pose_add_posegroup();
- break;
- case B_POSEGRP_REMOVE:
- if (ob && ob->pose)
- pose_remove_posegroup();
- break;
- case B_POSEGRP_MCUSTOM:
- if (ob && ob->pose) {
- if (ob->pose->active_group) {
- bActionGroup *grp= (bActionGroup *)BLI_findlink(&ob->pose->agroups, ob->pose->active_group-1);
- grp->customCol= -1;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- }
-}
-
-static void validate_stridebutton_cb(void *pchanv, void *poin)
-{
- Object *ob= OBACT;
- bPoseChannel *pchan;
-
- if(ob && ob->pose) {
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next){
- if(pchan!=pchanv)
- pchan->flag &= ~POSE_STRIDE;
- }
- }
-}
-
-static int editbone_to_parnr (EditBone *bone)
-{
- EditBone *ebone;
- int index;
-
- for (ebone=G.edbo.first, index=0; ebone; ebone=ebone->next, index++){
- if (ebone==bone)
- return index;
- }
-
- return -1;
-}
-
-
-/* the "IK" button in editbuttons */
-static void attach_bone_to_parent_cb(void *bonev, void *arg2_unused)
-{
- EditBone *ebone= bonev;
-
- if (ebone->parent) {
- if(ebone->flag & BONE_CONNECTED) {
- /* Attach this bone to its parent */
- VECCOPY(ebone->head, ebone->parent->tail);
-
- if(ebone->flag & BONE_ROOTSEL)
- ebone->parent->flag |= BONE_TIPSEL;
- }
- else if(!(ebone->parent->flag & BONE_ROOTSEL)) {
- ebone->parent->flag &= ~BONE_TIPSEL;
- }
- }
-}
-
-static void parnr_to_editbone(EditBone *bone)
-{
- if (bone->parNr == -1){
- if(bone->parent && !(bone->parent->flag & BONE_ROOTSEL))
- bone->parent->flag &= ~BONE_TIPSEL;
-
- bone->parent = NULL;
- bone->flag &= ~BONE_CONNECTED;
- }
- else{
- bone->parent = BLI_findlink(&G.edbo, bone->parNr);
- attach_bone_to_parent_cb(bone, NULL);
- }
-}
-
-static void parnr_to_editbone_cb(void *bonev, void *arg2_unused)
-{
- EditBone *curBone= bonev;
- parnr_to_editbone(curBone);
-}
-
-/* only used for showing parent of editbones */
-static void build_bonestring (char *string, EditBone *bone)
-{
- bArmature *arm= G.obedit->data;
- EditBone *curBone;
- EditBone *pBone;
- int skip=0;
- int index, numbones, i;
- char (*qsort_ptr)[32] = NULL;
- char *s = string;
-
- /* That space is there for a reason - for no parent */
- s += sprintf (string, "Parent%%t| %%x%d", -1);
-
- numbones = BLI_countlist(&G.edbo);
-
- /*
- * This will hold the bone names temporarily so we can sort them
- */
- if (numbones > 0)
- qsort_ptr = MEM_callocN (numbones * sizeof (qsort_ptr[0]),
- "qsort_ptr");
-
- numbones = 0;
- for (curBone = G.edbo.first, index=0; curBone;
- curBone=curBone->next, index++){
- /* Make sure this is a valid child */
- if (curBone != bone){
- skip=0;
- for (pBone=curBone->parent; pBone; pBone=pBone->parent){
- if (pBone==bone){
- skip=1;
- break;
- }
- }
- /* no browsing for bones in invisible layers */
- if ((arm->layer & curBone->layer) == 0) {
- /* but ensure the current parent at least shows */
- if(bone->parent!=curBone)
- skip= 1;
- }
-
- if (skip)
- continue;
-
- sprintf (qsort_ptr[numbones], "|%s%%x%d", curBone->name, index);
- numbones++;
- }
- }
- qsort (qsort_ptr, numbones, sizeof (qsort_ptr[0]),
- ( int (*)(const void *, const void *) ) strcmp);
-
- for (i=0; i < numbones; ++i) {
- strcat(s, qsort_ptr[i]);
- }
-
- if (qsort_ptr)
- MEM_freeN(qsort_ptr);
-}
-
-/* assumes armature editmode */
-/* exported to drawview.c via BIF_butspace.h */
-void validate_editbonebutton_cb(void *bonev, void *namev)
-{
- EditBone *eBone= bonev;
- char oldname[32], newname[32];
-
- /* need to be on the stack */
- BLI_strncpy(newname, eBone->name, 32);
- BLI_strncpy(oldname, (char *)namev, 32);
- /* restore */
- BLI_strncpy(eBone->name, oldname, 32);
-
- armature_bone_rename(G.obedit->data, oldname, newname); // editarmature.c
- allqueue(REDRAWALL, 0);
-}
-
-/* assumes armature posemode */
-static void validate_posebonebutton_cb(void *bonev, void *namev)
-{
- Bone *bone= bonev;
- Object *ob= OBACT;
- char oldname[32], newname[32];
-
- /* need to be on the stack */
- BLI_strncpy(newname, bone->name, 32);
- BLI_strncpy(oldname, (char *)namev, 32);
- /* restore */
- BLI_strncpy(bone->name, oldname, 32);
-
- armature_bone_rename(ob->data, oldname, newname); // editarmature.c
- allqueue(REDRAWALL, 0);
-}
-
-static void armature_layer_cb(void *lay_v, void *value_v)
-{
- short *layer= lay_v;
- int value= (intptr_t)value_v;
-
- if(*layer==0 || G.qual==0) *layer= value;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-static void editing_panel_armature_type(Object *ob, bArmature *arm)
-{
- uiBlock *block;
- uiBut *but;
- int a;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_type", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Armature", "Editing", 320, 0, 318, 204)==0) return;
-
- uiDefBut(block, LABEL, 0, "Editing Options", 10,180,150,20, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, ARM_MIRROR_EDIT, B_DIFF, "X-Axis Mirror", 10, 160,100,20, &arm->flag, 0, 0, 0, 0, "Enable X-axis mirrored editing");
- uiDefButBitC(block, TOG, OB_DRAWXRAY,REDRAWVIEW3D, "X-Ray", 110,160,100,20, &ob->dtx, 0, 0, 0, 0, "Draw armature in front of solid objects");
- uiDefButBitI(block, TOG, ARM_AUTO_IK, B_DIFF, "Auto IK", 210,160,100,20, &arm->flag, 0, 0, 0, 0, "Adds temporal IK chains while grabbing Bones");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Display Options", 10,133,150,19, 0, 0, 0, 0, 0, "");
-
- /* layers */
- uiBlockBeginAlign(block);
- for(a=0; a<8; a++) {
- short dx= 18;
- but= uiDefButBitS(block, BUT_TOGDUAL, 1<<a, REDRAWVIEW3D, "", 10+a*dx, 115, dx, 15, &arm->layer, 0, 0, 0, 0, "Armature layer (Hold Ctrl for locking in a proxy instance)");
- uiButSetFunc(but, armature_layer_cb, &arm->layer, SET_INT_IN_POINTER(1<<a));
- }
- uiBlockBeginAlign(block);
- for(a=8; a<16; a++) {
- short dx= 18;
- but= uiDefButBitS(block, BUT_TOGDUAL, 1<<a, REDRAWVIEW3D, "", 18+a*dx, 115, dx, 15, &arm->layer, 0, 0, 0, 0, "Armature layer (Hold Ctrl for locking in a proxy instance)");
- uiButSetFunc(but, armature_layer_cb, &arm->layer, SET_INT_IN_POINTER(1<<a));
- }
- /* quite bad here, but I don't know a better place for copy... */
- if(ob->pose)
- ob->pose->proxy_layer= arm->layer;
-
- uiBlockBeginAlign(block);
- uiDefButI(block, ROW, REDRAWVIEW3D, "Octahedron", 10, 87,90,20, &arm->drawtype, 0, ARM_OCTA, 0, 0, "Draw bones as octahedra");
- uiDefButI(block, ROW, REDRAWVIEW3D, "Stick", 100, 87,55,20, &arm->drawtype, 0, ARM_LINE, 0, 0, "Draw bones as simple 2d lines with dots");
- uiDefButI(block, ROW, REDRAWVIEW3D, "B-Bone", 155, 87,70,20, &arm->drawtype, 0, ARM_B_BONE, 0, 0, "Draw bones as boxes, showing subdivision and b-splines");
- uiDefButI(block, ROW, REDRAWVIEW3D, "Envelope", 225, 87,85,20, &arm->drawtype, 0, ARM_ENVELOPE, 0, 0, "Draw bones as extruded spheres, showing deformation influence volume");
-
- uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Axes", 10, 67,75,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
- uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Names", 85,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
- uiDefButBitI(block, TOGN, ARM_NO_CUSTOM, REDRAWVIEW3D, "Shapes", 160,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone shapes");
- uiDefButBitI(block, TOG, ARM_COL_CUSTOM, REDRAWVIEW3D, "Colors", 235,67,75,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone colors (colors are set per Bone Group)");
-
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Deform Options", 10,40,150,20, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vertex Groups", 10, 20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform (not for Modifiers)");
- uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", 110,20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform (not for Modifiers)");
- uiDefButBitS(block, TOG, ARM_DEF_QUATERNION, B_ARM_RECALCDATA, "Quaternion", 210,20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable deform rotation interpolation with Quaternions (not for Modifiers)");
- uiDefButBitI(block, TOG, ARM_RESTPOS, B_ARM_RECALCDATA,"Rest Position", 10,0,100,20, &arm->flag, 0, 0, 0, 0, "Show armature rest position, no posing possible");
- uiDefButBitI(block, TOG, ARM_DELAYDEFORM, REDRAWVIEW3D, "Delay Deform", 110,0,100,20, &arm->flag, 0, 0, 0, 0, "Don't deform children when manipulating bones in pose mode");
- uiDefButBitS(block, TOG, ARM_DEF_B_BONE_REST, B_ARM_RECALCDATA,"B-Bone Rest", 210,0,100,20, &arm->deformflag, 0, 0, 0, 0, "Make B-Bones deform already in rest position");
- uiBlockEndAlign(block);
-}
-
-static void editing_panel_armature_visuals(Object *ob, bArmature *arm)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_visuals", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Armature", "Editing");
- if(uiNewPanel(curarea, block, "Armature Visualisations", "Editing", 320, 0, 318, 204)==0) return;
-
- /* version patch for older files here (do_versions patch too complicated) */
- if ((arm->ghostsf == 0) || (arm->ghostef == 0)) {
- arm->ghostsf = CFRA - (arm->ghostep * arm->ghostsize);
- arm->ghostef = CFRA + (arm->ghostep * arm->ghostsize);
- }
- if ((arm->pathsf == 0) || (arm->pathef == 0)) {
- arm->pathsf = SFRA;
- arm->pathef = EFRA;
- }
- if ((arm->pathbc == 0) || (arm->pathac == 0)) {
- arm->pathbc = 15;
- arm->pathac = 15;
- }
-
- /* Ghost Drawing Options */
- uiDefBut(block, LABEL, 0, "Ghost Options", 10,180,150,20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, REDRAWVIEW3D, "Ghosts %t|Around Current Frame %x0|In Range %x1|On Keyframes %x2",
- 10, 160, 150, 20, &arm->ghosttype, 0, 0, 0, 0, "Choose range of Ghosts to draw for current Action");
-
- if (arm->ghosttype != ARM_GHOST_KEYS)
- uiDefButS(block, NUM, REDRAWVIEW3D, "GStep: ", 10,140,120,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
- else
- uiDefBut(block, LABEL, REDRAWVIEW3D, "GStep: N/A", 10,140,120,20, NULL, 0.0f, 0.0f, 0, 0, "How many frames between Ghost instances");
- uiDefButBitI(block, TOG, ARM_GHOST_ONLYSEL, REDRAWVIEW3D, "Sel", 130, 140, 30, 20, &arm->flag, 0, 0, 0, 0, "Only show Ghosts for selected bones");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- if (arm->ghosttype == ARM_GHOST_CUR) {
- /* range is around current frame */
- uiDefButS(block, NUM, REDRAWVIEW3D, "Ghost: ", 10,110,150,20, &arm->ghostep, 0.0f, 30.0f, 0, 0, "Draw Ghosts around current frame, for current Action");
- }
- else if (ELEM(arm->ghosttype, ARM_GHOST_RANGE, ARM_GHOST_KEYS)) {
- /* range is defined by start+end frame below */
- uiDefButI(block, NUM,REDRAWVIEW3D,"GSta:",10,110,150,20, &arm->ghostsf,1.0,MAXFRAMEF, 0, 0, "The start frame for Ghost display range");
- uiDefButI(block, NUM,REDRAWVIEW3D,"GEnd:",10,90,150,20, &arm->ghostef,arm->ghostsf,MAXFRAMEF, 0, 0, "The end frame for Ghost display range");
- }
- uiBlockEndAlign(block);
-
- /* Bone Path Drawing Options */
- uiDefBut(block, LABEL, 0, "Bone Paths Drawing:", 165,180,170,20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, REDRAWVIEW3D, "PStep:",170,160,80,20, &arm->pathsize,1,100, 10, 50, "Frames between highlighted points on bone path");
- uiDefButBitS(block, TOG, ARM_PATH_FNUMS, REDRAWVIEW3D, "Frame Nums", 250, 160, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show frame numbers on path");
-
- uiDefButBitS(block, TOG, ARM_PATH_KFRAS, REDRAWVIEW3D, "Show Keys", 170, 140, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show key frames on path");
- uiDefButBitS(block, TOG, ARM_PATH_KFNOS, REDRAWVIEW3D, "Keyframe Nums", 250, 140, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show frame numbers of key frames on path");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ARM_PATH_ACFRA, REDRAWVIEW3D, "Around Current Frame", 170, 110, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Only show Bone Path around the current frame");
-
- /* only show extra ranges when needed */
- if (arm->pathflag & ARM_PATH_ACFRA) {
- uiDefButI(block, NUM, REDRAWVIEW3D,"PPre:",170,90,80,20, &arm->pathbc, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames before current frame for Bone Path display range");
- uiDefButI(block, NUM, REDRAWVIEW3D,"PPost:",250,90,80,20, &arm->pathac, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames after current frame for Bone Path display range");
- }
- uiBlockEndAlign(block);
-
- /* Bone Path Calculation Options */
- uiDefBut(block, LABEL, 0, "Bone Paths Calc.", 10,50,170,20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_ARM_CALCPATHS, "Calculate Paths", 10,30,155,20, 0, 0, 0, 0, 0, "(Re)calculates the paths of the selected bones");
- uiDefBut(block, BUT, B_ARM_CLEARPATHS, "Clear Paths", 10,10,155,20, 0, 0, 0, 0, 0, "Clears bone paths of the selected bones");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ARM_PATH_HEADS, REDRAWVIEW3D, "Bone-Head Path", 170, 30, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Calculate the Path travelled by the Bone's Head instead of Tail");
- uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,10,80,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range");
- uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",250,10,80,20, &arm->pathef, arm->pathsf, MAXFRAMEF, 0, 0, "The end frame for Bone Path display range");
- uiBlockEndAlign(block);
-}
-
-/* autocomplete callback for editbones */
-static void autocomplete_editbone(char *str, void *arg_v)
-{
- if(G.obedit==NULL) return;
-
- /* search if str matches the beginning of an ID struct */
- if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, 32);
- EditBone *ebone;
-
- for (ebone=G.edbo.first; ebone; ebone=ebone->next)
- if(ebone->name!=str)
- autocomplete_do_name(autocpl, ebone->name);
-
- autocomplete_end(autocpl, str);
- }
-}
-
-static void editing_panel_armature_bones(Object *ob, bArmature *arm)
-{
- uiBlock *block;
- uiBut *but;
- EditBone *curBone;
- char *boneString=NULL;
- int by=180;
- int index, a;
-
- /* Draw the bone name block */
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_bones", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Armature Bones", "Editing", 640, 0, 318, 204)==0) return;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
-
- uiDefBut(block, LABEL, 0, "Selected Bones", 0,by,158,18, 0, 0, 0, 0, 0, "Only show in Armature Editmode");
- by-=20;
- for (curBone=G.edbo.first, index=0; curBone; curBone=curBone->next, index++) {
- if ((curBone->flag & BONE_SELECTED) && (curBone->layer & arm->layer)) {
- /* Bone naming button */
- but=uiDefBut(block, TEX, REDRAWVIEW3D, "BO:", -10,by,117,18, curBone->name, 0, 31, 0, 0, "Change the bone name");
- uiButSetFunc(but, validate_editbonebutton_cb, curBone, NULL);
- uiButSetCompleteFunc(but, autocomplete_editbone, (void *)OBACT);
-
- uiDefBut(block, LABEL, 0, "child of", 107,by,73,18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- boneString = MEM_mallocN((BLI_countlist(&G.edbo) * 64)+64, "Bone str");
- build_bonestring (boneString, curBone);
-
- curBone->parNr = editbone_to_parnr(curBone->parent);
- but = uiDefButI(block, MENU,REDRAWVIEW3D, boneString, 180,by,120,18, &curBone->parNr, 0.0, 0.0, 0.0, 0.0, "Parent");
- /* last arg NULL means button will put old string there */
- uiButSetFunc(but, parnr_to_editbone_cb, curBone, NULL);
-
- MEM_freeN(boneString);
-
- if (curBone->parent) {
- /* Connect to parent flag */
- but=uiDefButBitI(block, TOG, BONE_CONNECTED, B_ARM_RECALCDATA, "Con", 300,by,32,18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Connect this Bone to Parent");
- uiButSetFunc(but, attach_bone_to_parent_cb, curBone, NULL);
- }
- else {
- /* No cyclic-offset flag */
- uiDefButBitI(block, TOGN, BONE_NO_CYCLICOFFSET, B_ARM_RECALCDATA, "Offs", 300,by,31,18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Apply cyclic-offset to this Bone");
- }
-
- /* Segment, dist and weight buttons */
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_ARM_RECALCDATA, "Segm: ", -10,by-19,117,18, &curBone->segments, 1.0, 32.0, 0.0, 0.0, "Subdivisions for B-bones");
- uiDefButF(block, NUM,B_ARM_RECALCDATA, "Dist:", 110, by-19, 105, 18, &curBone->dist, 0.0, 1000.0, 10.0, 0.0, "Bone deformation distance");
- uiDefButF(block, NUM,B_ARM_RECALCDATA, "Weight:", 225, by-19,105, 18, &curBone->weight, 0.0F, 1000.0F, 10.0F, 0.0F, "Bone deformation weight");
-
- /* bone types */
- uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
- uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 50,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone");
- uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 70, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry");
- uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 150,by-38,60,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup");
- uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 210,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode");
- uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 270,by-38,60,18, &curBone->flag, 0, 0, 0, 0, "Prevents this bone from being transformed in Edit Mode");
-
- /* layers */
- uiBlockBeginAlign(block);
- for(a=0; a<8; a++) {
- short dx= 21;
- but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -10+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
- uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
- }
- uiBlockBeginAlign(block);
- for(a=8; a<16; a++) {
- short dx= 21;
- but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -6+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
- uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
- }
-
- uiBlockEndAlign(block);
- by-=80;
-
- if(by < -200) break; // for time being... extreme long panels are very slow
- }
- }
-
- if(by<0) {
- uiNewPanelHeight(block, 204 - by);
- }
-
-}
-
-/* sets warning popup for buttons, and returns 1 for protected proxy posechannels */
-static int ob_arm_bone_pchan_lock(Object *ob, bArmature *arm, Bone *bone, bPoseChannel *pchan)
-{
- /* ob lib case is already set globally */
- if(ob->id.lib)
- return 0;
- if(arm->id.lib) {
- if(pchan==NULL)
- uiSetButLock(1, ERROR_LIBDATA_MESSAGE);
- else if(ob->proxy && bone->layer & arm->layer_protected) {
- uiSetButLock(1, "Can't edit protected proxy channel");
- return 1;
- }
- else
- uiClearButLock();
- }
- return 0;
-}
-
-static void editing_panel_pose_bones(Object *ob, bArmature *arm)
-{
- uiBlock *block;
- uiBut *but;
- bPoseChannel *pchan;
- Bone *curBone;
- int by, a;
- int index, zerodof, zerolimit;
- char *menustr;
-
- /* Draw the bone name block */
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_pose_bones", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Armature Bones", "Editing", 640, 0, 318, 204)==0) return;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- uiDefBut(block, LABEL, 0, "Selected Bones", 0,180,158,18, 0, 0, 0, 0, 0, "Only show in Armature Editmode/Posemode");
- by= 160;
-
- for (pchan=ob->pose->chanbase.first, index=0; pchan; pchan=pchan->next, index++){
- curBone= pchan->bone;
- if ((curBone->flag & BONE_SELECTED) && (curBone->layer & arm->layer)) {
- if(ob_arm_bone_pchan_lock(ob, arm, curBone, pchan))
- uiDefBut(block, LABEL, 0, "Proxy Locked", 160, 180,150,18, NULL, 1, 0, 0, 0, "");
-
- /* Bone naming button */
- uiBlockBeginAlign(block);
- but=uiDefBut(block, TEX, REDRAWVIEW3D, "BO:", -10,by,117,19, curBone->name, 0, 24, 0, 0, "Change the bone name");
- uiButSetFunc(but, validate_posebonebutton_cb, curBone, NULL);
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
-
- /* Bone custom drawing */
- menustr= build_posegroups_menustr(ob->pose, 0);
- uiDefButS(block, MENU,REDRAWVIEW3D, menustr, 107,by,105,19, &pchan->agrp_index, 0, 0.0, 0.0, 0.0, "Change the Pose Group this Bone belongs to");
- MEM_freeN(menustr);
-
- ob_arm_bone_pchan_lock(ob, arm, curBone, pchan);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "OB:", 220,by,90,19, &pchan->custom, "Object that defines custom draw type for this Bone");
- ob_arm_bone_pchan_lock(ob, arm, curBone, NULL);
-
- uiDefButBitI(block, TOG, BONE_DRAWWIRE, B_ARM_RECALCDATA, "W", 309,by,21,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Custom shape of this Bone should always be drawn as a wireframe");
-
- /* Segment, ease in/out buttons */
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_ARM_RECALCDATA, "Segm: ", -10,by-19,117,19, &curBone->segments, 1.0, 32.0, 0.0, 0.0, "Subdivisions for B-bones");
- uiDefButF(block, NUM,B_ARM_RECALCDATA, "In:", 107, by-19,105, 19, &curBone->ease1, 0.0, 2.0, 10.0, 0.0, "First length of Bezier handle");
- uiDefButF(block, NUM,B_ARM_RECALCDATA, "Out:", 220, by-19, 110, 19, &curBone->ease2, 0.0, 2.0, 10.0, 0.0, "Second length of Bezier handle");
-
- /* bone types */
- uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
- uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone");
- uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 19, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry");
- uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup");
- uiDefButBitI(block, TOG, BONE_HIDDEN_P, B_ARM_RECALCDATA, "Hide", 250,by-38,80,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Toggles display of this bone in Edit Mode");
-
- /* layers */
- uiBlockBeginAlign(block);
- for(a=0; a<8; a++) {
- short dx= 21;
- but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -10+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
- uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
- }
- uiBlockBeginAlign(block);
- for(a=8; a<16; a++) {
- short dx= 21;
- but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -6+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
- uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
- }
- uiBlockEndAlign(block);
-
- by-= 20;
-
- ob_arm_bone_pchan_lock(ob, arm, curBone, pchan);
-
- /* DOFs only for IK chains */
- zerodof = 1;
- zerolimit = 1;
- if(pose_channel_in_IK_chain(ob, pchan)) {
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BONE_IK_NO_XDOF, B_ARM_RECALCDATA, "Lock X Rot", -10,by-60,114,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Disable X DoF for IK");
- if ((pchan->ikflag & BONE_IK_NO_XDOF)==0) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff X:", -10, by-80, 114, 19, &pchan->stiffness[0], 0.0, 0.99, 1.0, 0.0, "Resistance to bending for X axis");
- uiDefButBitS(block, TOG, BONE_IK_XLIMIT, B_ARM_RECALCDATA, "Limit X", -10,by-100,114,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over X axis");
- if ((pchan->ikflag & BONE_IK_XLIMIT)) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min X:", -10, by-120, 114, 19, &pchan->limitmin[0], -180.0, 0.0, 1000, 1, "Minimum X limit");
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max X:", -10, by-140, 114, 19, &pchan->limitmax[0], 0.0, 180.0f, 1000, 1, "Maximum X limit");
- zerolimit = 0;
- }
- zerodof = 0;
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BONE_IK_NO_YDOF, B_ARM_RECALCDATA, "Lock Y Rot", 104,by-60,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Disable Y DoF for IK");
- if ((pchan->ikflag & BONE_IK_NO_YDOF)==0) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff Y:", 104, by-80, 114, 19, &pchan->stiffness[1], 0.0, 0.99, 1.0, 0.0, "Resistance to twisting over Y axis");
- uiDefButBitS(block, TOG, BONE_IK_YLIMIT, B_ARM_RECALCDATA, "Limit Y", 104,by-100,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over Y axis");
- if ((pchan->ikflag & BONE_IK_YLIMIT)) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min Y:", 104, by-120, 113, 19, &pchan->limitmin[1], -180.0, 0.0, 1000, 1, "Minimum Y limit");
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max Y:", 104, by-140, 113, 19, &pchan->limitmax[1], 0.0, 180.0, 1000, 1, "Maximum Y limit");
- zerolimit = 0;
- }
- zerodof = 0;
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BONE_IK_NO_ZDOF, B_ARM_RECALCDATA, "Lock Z Rot", 217,by-60,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Disable Z DoF for IK");
- if ((pchan->ikflag & BONE_IK_NO_ZDOF)==0) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff Z:", 217, by-80, 114, 19, &pchan->stiffness[2], 0.0, 0.99, 1.0, 0.0, "Resistance to bending for Z axis");
- uiDefButBitS(block, TOG, BONE_IK_ZLIMIT, B_ARM_RECALCDATA, "Limit Z", 217,by-100,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over Z axis");
- if ((pchan->ikflag & BONE_IK_ZLIMIT)) {
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min Z:", 217, by-120, 113, 19, &pchan->limitmin[2], -180.0, 0.0, 1000, 1, "Minimum Z limit");
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max Z:", 217, by-140, 113, 19, &pchan->limitmax[2], 0.0, 180.0, 1000, 1, "Maximum Z limit");
- zerolimit = 0;
- }
- zerodof = 0;
- }
- uiBlockEndAlign(block);
-
- by -= (zerodof)? 82: (zerolimit)? 122: 162;
-
- uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stretch:", -10, by, 113, 19, &pchan->ikstretch, 0.0, 1.0, 1.0, 0.0, "Allow scaling of the bone for IK");
-
- by -= 20;
- }
- else {
- but= uiDefButBitS(block, TOG, POSE_STRIDE, B_ARM_STRIDE, "Stride Root", -10, by-60, 113, 19, &pchan->flag, 0.0, 0.0, 0, 0, "Set this PoseChannel to define the Stride distance");
- uiButSetFunc(but, validate_stridebutton_cb, pchan, NULL);
-
- uiDefBut(block, LABEL, 0, "(DoF only for IK chains)", 110,by-60, 190, 19, 0, 0, 0, 0, 0, "");
- by -= 82;
- }
-
-
- if(by < -200) break; // for time being... extreme long panels are very slow
- }
- }
-
- if(by<0) {
- uiNewPanelHeight(block, 204 - by);
- }
-
-}
-
-
-/* *************************** MESH ******************************** */
-
-/* from this object to all objects with same ob->data */
-static void copy_linked_vgroup_channels(Object *ob)
-{
- Base *base;
-
- for(base=FIRSTBASE; base; base= base->next) {
- if(base->object->type==ob->type) {
- if(base->object!=ob && base->object->data==ob->data) {
- BLI_freelistN(&base->object->defbase);
- duplicatelist(&base->object->defbase, &ob->defbase);
- base->object->actdef= ob->actdef;
- DAG_object_flush_update(G.scene, base->object, OB_RECALC_DATA);
- }
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-void do_vgroupbuts(unsigned short event)
-{
- Object *ob= OBACT;
-
- switch(event) {
- case B_NEWVGROUP:
- add_defgroup (ob);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("New vertex group");
- break;
- case B_DELVGROUP:
- if ((G.obedit) && (G.obedit == ob)) {
- del_defgroup (ob);
- } else {
- del_defgroup_in_object_mode (ob);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- allqueue (REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSEDIT, 1);
- BIF_undo_push("Delete vertex group");
- break;
- case B_ASSIGNVGROUP:
- assign_verts_defgroup ();
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue (REDRAWVIEW3D, 1);
- BIF_undo_push("Assign to vertex group");
- break;
- case B_REMOVEVGROUP:
- remove_verts_defgroup (0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue (REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Remove from vertex group");
- break;
- case B_SELVGROUP:
- sel_verts_defgroup(1); /* runs countall() */
- allqueue (REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Select vertex group");
- break;
- case B_DESELVGROUP:
- sel_verts_defgroup(0); /* runs countall() */
- allqueue (REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("DeSelect vertex group");
- break;
- case B_LINKEDVGROUP:
- copy_linked_vgroup_channels(ob);
- allqueue (REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Copy vertex group to linked obdata");
- break;
- case B_COPYVGROUP:
- duplicate_defgroup (ob);
- scrarea_queue_winredraw (curarea);
- allqueue (REDRAWOOPS, 0);
- BIF_undo_push("Copy vertex group");
- break;
- }
-}
-
-void do_meshbuts(unsigned short event)
-{
- Object *ob;
- Mesh *me;
- MCol *mcol;
- EditMesh *em= G.editMesh;
- float fac;
- int count; /* store num of changes made to see if redraw & undo are needed*/
- int layernum;
- short randfac;
-
- ob= OBACT;
- if(ob && ob->type==OB_MESH) {
-
- me= get_mesh(ob);
- if(me==NULL) return;
-
- switch(event) {
- case B_DELSTICKY:
- if(me->msticky) {
- CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert);
- me->msticky= NULL;
- BIF_undo_push("Delete Sticky");
- }
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_MAKESTICKY:
- RE_make_sticky();
- BIF_undo_push("Make Sticky");
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_NEWMCOL:
- if(G.obedit) {
- layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL);
- EM_add_data_layer(&em->fdata, CD_MCOL);
- CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum);
- }
- else if(me) {
- mcol= me->mcol;
- layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL);
-
- if(mcol)
- CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE,
- mcol, me->totface);
- else
- CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC,
- NULL, me->totface);
-
- CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
- mesh_update_customdata_pointers(me);
-
- if(!mcol)
- shadeMeshMCol(ob, me);
- }
-
- if (me->mr) multires_load_cols(me);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("New Vertex Color");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_SETMCOL:
- if (G.obedit || me) {
- CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata;
- CustomData_set_layer_active(fdata, CD_MCOL, actmcol-1);
- mesh_update_customdata_pointers(me);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Set Active Vertex Color");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case B_SETMCOL_RND:
- if (G.obedit || me) {
- CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata;
- CustomData_set_layer_render(fdata, CD_MCOL, actmcol_rnd-1);
-
- BIF_undo_push("Set Render Vertex Color");
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case B_NEWTFACE:
- if(me && me->mr) {
- layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE);
- multires_add_layer(me, &me->mr->fdata, CD_MTFACE, layernum);
- multires_level_to_editmesh(ob, me, 0);
- multires_finish_mesh_update(ob);
- }
- else if(G.obedit) {
- layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
- EM_add_data_layer(&em->fdata, CD_MTFACE);
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum);
- }
- else if(me) {
- layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE);
- if(me->mtface)
- CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE,
- me->mtface, me->totface);
- else
- CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
- NULL, me->totface);
-
- CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum);
- mesh_update_customdata_pointers(me);
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("New UV Texture");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_SETTFACE:
- if (G.obedit || me) {
- CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata;
-
- CustomData_set_layer_active(fdata, CD_MTFACE, acttface-1);
- mesh_update_customdata_pointers(me);
-
- /* Update first-level face data in multires */
- if(me && me->mr && me->mr->current != 1)
- CustomData_set_layer_active(&me->mr->fdata, CD_MTFACE, acttface-1);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Set Active UV Texture");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_SETTFACE_RND:
- if (G.obedit || me) {
- CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata;
- CustomData_set_layer_render(fdata, CD_MTFACE, acttface_rnd-1);
- BIF_undo_push("Set Render UV Texture");
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case B_FLIPNORM:
- if(G.obedit) {
- flip_editnormals();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Flip Normals");
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- }
- }
- if(G.obedit==NULL || (G.obedit->type!=OB_MESH)) return;
-
- switch(event) {
- case B_SPIN:
- if( select_area(SPACE_VIEW3D)) spin_mesh(G.scene->toolsettings->step, G.scene->toolsettings->degr, 0, 0);
- break;
- case B_SPINDUP:
- if( select_area(SPACE_VIEW3D)) spin_mesh(G.scene->toolsettings->step, G.scene->toolsettings->degr, 0, 1);
- break;
- case B_EXTR:
- if( select_area(SPACE_VIEW3D)) extrude_mesh();
- break;
- case B_SCREW:
- if( select_area(SPACE_VIEW3D)) screw_mesh(G.scene->toolsettings->step, G.scene->toolsettings->turn);
- break;
- case B_EXTREP:
- if( select_area(SPACE_VIEW3D)) extrude_repeat_mesh(G.scene->toolsettings->step, G.scene->toolsettings->extr_offs);
- break;
- case B_SPLIT:
- split_mesh();
- break;
- case B_REMDOUB:
- count= removedoublesflag(1, 0, G.scene->toolsettings->doublimit);
- notice("Removed: %d", count);
- if (count) { /* only undo and redraw if an action is taken */
- countall ();
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Rem Doubles");
- }
- break;
- case B_SUBDIV:
- waitcursor(1);
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag,1,0);
- countall();
- waitcursor(0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Subdivide");
- break;
- case B_FRACSUBDIV:
- randfac= 10;
- if(button(&randfac, 1, 100, "Rand fac:")==0) return;
- waitcursor(1);
- fac= -( (float)randfac )/100;
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag,1,0);
- countall();
- waitcursor(0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Fractal Subdivide");
- break;
- case B_XSORT:
- if( select_area(SPACE_VIEW3D)) xsortvert_flag(1);
- break;
- case B_HASH:
- hashvert_flag(1);
- break;
- case B_TOSPHERE:
- vertices_to_sphere();
- break;
- case B_VERTEXNOISE:
- vertexnoise();
- break;
- case B_VERTEXSMOOTH:
- vertexsmooth();
- break;
- case B_DRAWEDGES:
- G.f &= ~G_DRAWCREASES;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_DRAWCREASES:
- G.f &= ~G_DRAWEDGES;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- //~ case B_DRAWBWEIGHTS:
- //~ allqueue(REDRAWBUTSEDIT, 0);
- //~ allqueue(REDRAWVIEW3D, 0);
- //~ break;
- case B_JOINTRIA:
- join_triangles();
- break;
- case B_GEN_SKELETON:
- generateSkeleton();
- break;
- case B_RETARGET_SKELETON:
- BIF_retargetArmature();
- break;
- }
-
- /* WATCH IT: previous events only in editmode! */
-}
-
-static void editing_panel_mesh_tools(Object *ob, Mesh *me)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Mesh Tools", "Editing", 640, 0, 318, 254)==0) return;
-
- uiBlockBeginAlign(block);
- //uiDefButBitS(block, TOG, B_AUTOFGON, 0, "FGon", 10,195,30,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' To create FGon on inner edges where possible");
- uiDefButBitS(block, TOG, B_BEAUTY, 0, "Beauty", 10,195,53,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using long edges unless 'Short' is selected");
- uiDefButBitS(block, TOG, B_BEAUTY_SHORT, 0, "Short", 63,195,52,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "If Beauty is set, 'Subdivide' splits faces in halves using short edges");
-
- uiDefBut(block, BUT,B_SUBDIV,"Subdivide", 115,195,105,19, 0, 0, 0, 0, 0, "Splits selected faces into halves or quarters");
-
- uiDefButS(block, MENU, B_DIFF, "Corner Cut Type %t|Path %x0|Innervert %x1|Fan %x2",
- 220, 195, 105, 19, &G.scene->toolsettings->cornertype , 0, 0, 0, 0, "Choose Quad Corner Cut Type");
-
- uiDefBut(block, BUT,B_VERTEXNOISE,"Noise", 10,175,78,19, 0, 0, 0, 0, 0, "Use vertex coordinate as texture coordinate");
- uiDefBut(block, BUT,B_HASH,"Hash", 88,175,78,19, 0, 0, 0, 0, 0, "Randomizes selected vertex sequence data");
- uiDefBut(block, BUT,B_XSORT,"Xsort", 166,175,78,19, 0, 0, 0, 0, 0, "Sorts selected vertex data in the X direction");
- uiDefBut(block, BUT,B_FRACSUBDIV, "Fractal", 244,175,81,19, 0, 0, 0, 0, 0, "Subdivides selected faces with a random factor");
-
-
- uiDefBut(block, BUT,B_TOSPHERE,"To Sphere", 10,155,78,19, 0, 0, 0, 0, 0, "Moves selected vertices outwards into a spherical shape");
- uiDefBut(block, BUT,B_VERTEXSMOOTH,"Smooth", 88,155,78,19, 0, 0, 0, 0, 0, "Flattens angles of selected faces");
- uiDefBut(block, BUT,B_SPLIT,"Split", 166,155,78,19, 0, 0, 0, 0, 0, "Splits selected vertices to separate sub-mesh");
- uiDefBut(block, BUT,B_FLIPNORM,"Flip Normals", 244,155,81,19, 0, 0, 0, 0, 0, "Toggles the direction of the selected face's normals");
-
- uiDefBut(block, BUT,B_REMDOUB,"Rem Doubles", 10,135,78,19, 0, 0, 0, 0, 0, "Removes duplicates from selected vertices");
- uiDefButF(block, NUM, B_DIFF, "Limit:", 88,135,117,19, &G.scene->toolsettings->doublimit, 0.0001, 1.0, 10, 0, "Specifies the max distance 'Rem Doubles' will consider vertices as 'doubled'");
- uiDefButF(block, NUM, B_DIFF, "Threshold:", 205,135,120,19, &G.scene->toolsettings->select_thresh, 0.0001, 1.0, 10, 0, "Tolerence for the 'Select Group' tool (Shift+G) and 'Knife Exact' (vertex snap).");
- uiBlockEndAlign(block);
-
- uiDefBut(block, BUT,B_EXTR,"Extrude", 10,105,315,24, 0, 0, 0, 0, 0, "Converts selected edges to faces and selects the new vertices");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_SPIN, "Spin", 10,75,100,24, 0, 0, 0, 0, 0, "Extrudes the selected vertices in a circle around the cursor in the indicated viewport");
- uiDefBut(block, BUT,B_SPINDUP,"Spin Dup", 110,75,100,24, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a circle around the cursor in the indicated viewport");
- uiDefBut(block, BUT,B_SCREW,"Screw", 210,75,115,24, 0, 0, 0, 0, 0, "Activates the screw tool"); // Bish - This could use some more definition
-
- uiDefButF(block, NUM, B_DIFF, "Degr:", 10,55,100,19, &G.scene->toolsettings->degr,-360.0,360.0, 1000, 0, "Specifies the number of degrees 'Spin' revolves");
- uiDefButS(block, NUM, B_DIFF, "Steps:", 110,55,100,19, &G.scene->toolsettings->step,1.0,180.0, 0, 0, "Specifies the total number of 'Spin' slices");
- uiDefButS(block, NUM, B_DIFF, "Turns:", 210,55,115,19, &G.scene->toolsettings->turn,1.0,360.0, 0, 0, "Specifies the number of revolutions the screw turns");
- uiDefButBitS(block, TOG, B_KEEPORIG, B_DIFF, "Keep Original",10,35,200,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Keeps a copy of the original vertices and faces after executing tools");
- uiDefButBitS(block, TOG, B_CLOCKWISE, B_DIFF, "Clockwise", 210,35,115,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Specifies the direction for 'Screw' and 'Spin'");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_EXTREP, "Extrude Dup", 10,10,150,19, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a straight line away from the current viewport");
- uiDefButF(block, NUM, B_DIFF, "Offset:", 160,10,165,19, &G.scene->toolsettings->extr_offs, 0.01, 100.0, 100, 0, "Sets the distance between each copy for 'Extrude Dup'");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_JOINTRIA, "Join Triangles", 10, -20, 120, 19, 0, 0, 0, 0, 0, "Convert selected triangles to Quads");
- uiDefButF(block, NUM, B_DIFF, "Threshold", 130, -20, 195, 19, &G.scene->toolsettings->jointrilimit, 0.0, 1.0, 5, 0, "Conversion threshold for complex islands");
- uiDefButBitS(block, TOG, B_JOINTRIA_UV, 0, "Delimit UVs", 10, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where UVs match");
- uiDefButBitS(block, TOG, B_JOINTRIA_VCOL, 0, "Delimit Vcol", 90, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where Vcols match");
- uiDefButBitS(block, TOG, B_JOINTRIA_SHARP, 0, "Delimit Sharp", 170, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where edge is not sharp");
- uiDefButBitS(block, TOG, B_JOINTRIA_MAT, 0, "Delimit Mat", 250, -40, 74, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where material matches");
- uiBlockEndAlign(block);
-
-
-}
-
-static void verify_vertexgroup_name_func(void *datav, void *data2_unused)
-{
- unique_vertexgroup_name((bDeformGroup*)datav, OBACT);
-}
-
-static void skgen_reorder(void *option, void *arg2)
-{
- char tmp;
- switch (GET_INT_FROM_POINTER(option))
- {
- case 0:
- tmp = G.scene->toolsettings->skgen_subdivisions[0];
- G.scene->toolsettings->skgen_subdivisions[0] = G.scene->toolsettings->skgen_subdivisions[1];
- G.scene->toolsettings->skgen_subdivisions[1] = tmp;
- break;
- case 1:
- tmp = G.scene->toolsettings->skgen_subdivisions[2];
- G.scene->toolsettings->skgen_subdivisions[2] = G.scene->toolsettings->skgen_subdivisions[1];
- G.scene->toolsettings->skgen_subdivisions[1] = tmp;
- break;
- case 2:
- tmp = G.scene->toolsettings->skgen_subdivisions[0];
- G.scene->toolsettings->skgen_subdivisions[0] = G.scene->toolsettings->skgen_subdivisions[2];
- G.scene->toolsettings->skgen_subdivisions[2] = G.scene->toolsettings->skgen_subdivisions[1];
- G.scene->toolsettings->skgen_subdivisions[1] = tmp;
- break;
- }
-}
-
-static void skgen_graphgen(void *arg1, void *arg2)
-{
- BIF_GlobalReebGraphFromEditMesh();
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void skgen_graphfree(void *arg1, void *arg2)
-{
- BIF_GlobalReebFree();
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void skgen_rigadjust(void *arg1, void *arg2)
-{
- BIF_adjustRetarget();
-}
-
-static void skgen_rigfree(void *arg1, void *arg2)
-{
- BIF_freeRetarget();
-}
-
-static void skgen_graph_block(uiBlock *block)
-{
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_DIFF, "Resolution:", 1025,150,225,19, &G.scene->toolsettings->skgen_resolution,10.0,1000.0, 0, 0, "Specifies the resolution of the graph's embedding");
- uiDefButBitS(block, TOG, SKGEN_HARMONIC, B_DIFF, "H", 1250,150, 25,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Apply harmonic smoothing to the weighting");
- uiDefButBitS(block, TOG, SKGEN_FILTER_INTERNAL, B_DIFF, "Filter In", 1025,130, 83,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Filter internal small arcs from graph");
- uiDefButF(block, NUM, B_DIFF, "", 1111,130,164,19, &G.scene->toolsettings->skgen_threshold_internal,0.0, 10.0, 10, 0, "Specify the threshold ratio for filtering internal arcs");
- uiDefButBitS(block, TOG, SKGEN_FILTER_EXTERNAL, B_DIFF, "Filter Ex", 1025,110, 53,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Filter external small arcs from graph");
- uiDefButBitS(block, TOG, SKGEN_FILTER_SMART, B_DIFF, "Sm", 1078,110, 30,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Smart Filtering");
- uiDefButF(block, NUM, B_DIFF, "", 1111,110,164,19, &G.scene->toolsettings->skgen_threshold_external,0.0, 10.0, 10, 0, "Specify the threshold ratio for filtering external arcs");
-
- uiDefButBitS(block, TOG, SKGEN_SYMMETRY, B_DIFF, "Symmetry", 1025, 90,125,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Restore symmetries based on topology");
- uiDefButF(block, NUM, B_DIFF, "T:", 1150, 90,125,19, &G.scene->toolsettings->skgen_symmetry_limit,0.0, 1.0, 10, 0, "Specify the threshold distance for considering potential symmetric arcs");
- uiDefButC(block, NUM, B_DIFF, "P:", 1025, 70, 62,19, &G.scene->toolsettings->skgen_postpro_passes, 0, 10, 10, 0, "Specify the number of processing passes on the embeddings");
- uiDefButC(block, ROW, B_DIFF, "Smooth", 1087, 70, 63,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_SMOOTH, 0, 0, "Smooth embeddings");
- uiDefButC(block, ROW, B_DIFF, "Average", 1150, 70, 62,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_AVERAGE, 0, 0, "Average embeddings");
- uiDefButC(block, ROW, B_DIFF, "Sharpen", 1212, 70, 63,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_SHARPEN, 0, 0, "Sharpen embeddings");
-
- uiBlockEndAlign(block);
-}
-
-static void editing_panel_mesh_skgen_display(Object *ob, Mesh *me)
-{
- uiBlock *block;
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_skgen_display", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Mesh Tools More", "Skgen");
- if(uiNewPanel(curarea, block, "Graph", "Editing", 960, 0, 318, 204)==0) return;
-
- but = uiDefBut(block, BUT, B_DIFF, "Generate", 1025,170,125,19, 0, 0, 0, 0, 0, "Generate Graph from Mesh");
- uiButSetFunc(but, skgen_graphgen, NULL, NULL);
- but = uiDefBut(block, BUT, B_DIFF, "Free", 1150,170,125,19, 0, 0, 0, 0, 0, "Free Graph from Mesh");
- uiButSetFunc(but, skgen_graphfree, NULL, NULL);
-
- skgen_graph_block(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, SKGEN_DISP_LENGTH, REDRAWVIEW3D, "Length", 1025, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Length");
- uiDefButBitS(block, TOG, SKGEN_DISP_WEIGHT, REDRAWVIEW3D, "Weight", 1075, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Weight");
- uiDefButBitS(block, TOG, SKGEN_DISP_EMBED, REDRAWVIEW3D, "Embed", 1125, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Arc Embedings");
- uiDefButBitS(block, TOG, SKGEN_DISP_INDEX, REDRAWVIEW3D, "Index", 1175, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Arc and Node indexes");
- uiDefButBitS(block, TOG, SKGEN_DISP_ORIG, REDRAWVIEW3D, "Original", 1225, 40, 50,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Original Graph");
-
- uiBlockEndAlign(block);
-
- uiDefButC(block, NUM, REDRAWVIEW3D, "Level:", 1025, 20, 125,19, &G.scene->toolsettings->skgen_multi_level, 0, REEB_MAX_MULTI_LEVEL, 1, 0,"Specify the level to draw");
-}
-
-static void editing_panel_mesh_skgen_retarget(Object *ob, Mesh *me)
-{
- uiBlock *block;
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_skgen_retarget", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Mesh Tools More", "Skgen");
- if(uiNewPanel(curarea, block, "Retarget", "Editing", 960, 0, 318, 204)==0) return;
-
- uiDefBut(block, BUT, B_RETARGET_SKELETON, "Retarget Skeleton", 1025,170,100,19, 0, 0, 0, 0, 0, "Retarget Selected Armature to this Mesh");
- but = uiDefBut(block, BUT, B_DIFF, "Adjust", 1125,170,100,19, 0, 0, 0, 0, 0, "Adjust Retarget using new weights");
- uiButSetFunc(but, skgen_rigadjust, NULL, NULL);
- but = uiDefBut(block, BUT, B_DIFF, "Free", 1225,170,50,19, 0, 0, 0, 0, 0, "Free Retarget structure");
- uiButSetFunc(but, skgen_rigfree, NULL, NULL);
-
- skgen_graph_block(block);
-
- uiDefButF(block, NUM, B_DIFF, "Ang:", 1025, 40, 83,19, &G.scene->toolsettings->skgen_retarget_angle_weight, 0, 10, 1, 0, "Angle Weight");
- uiDefButF(block, NUM, B_DIFF, "Len:", 1108, 40, 83,19, &G.scene->toolsettings->skgen_retarget_length_weight, 0, 10, 1, 0, "Length Weight");
- uiDefButF(block, NUM, B_DIFF, "Dist:", 1191, 40, 84,19, &G.scene->toolsettings->skgen_retarget_distance_weight, 0, 10, 1, 0, "Distance Weight");
- uiDefButC(block, NUM, B_DIFF, "Method:", 1025, 20, 125,19, &G.scene->toolsettings->skgen_optimisation_method, 0, 2, 1, 0,"Optimisation Method (0: brute, 1: memoize, 2: annealing max fixed");
-}
-
-static void editing_panel_mesh_skgen(Object *ob, Mesh *me)
-{
- uiBlock *block;
- uiBut *but;
- int i;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_skgen", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Mesh Tools More", "Skgen");
- if(uiNewPanel(curarea, block, "Generator", "Editing", 960, 0, 318, 204)==0) return;
-
- uiDefBut(block, BUT, B_GEN_SKELETON, "Generate", 1025,170,250,19, 0, 0, 0, 0, 0, "Generate Skeleton from Mesh");
-
- skgen_graph_block(block);
-
- uiBlockBeginAlign(block);
- for(i = 0; i < SKGEN_SUB_TOTAL; i++)
- {
- int y = 50 - 20 * i;
-
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, 1025, y, 16, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Change the order the subdivisions algorithm are applied");
- uiButSetFunc(but, skgen_reorder, SET_INT_IN_POINTER(i), NULL);
-
- switch(G.scene->toolsettings->skgen_subdivisions[i])
- {
- case SKGEN_SUB_LENGTH:
- uiDefButBitS(block, TOG, SKGEN_CUT_LENGTH, B_DIFF, "Length", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs in bones of equal length");
- uiDefButF(block, NUM, B_DIFF, "T:", 1111, y, 82,19, &G.scene->toolsettings->skgen_length_ratio,1.0, 4.0, 10, 0, "Specify the ratio limit between straight arc and embeddings to trigger equal subdivisions");
- uiDefButF(block, NUM, B_DIFF, "L:", 1193, y, 82,19, &G.scene->toolsettings->skgen_length_limit,0.1,50.0, 10, 0, "Maximum length of the bones when subdividing");
- break;
- case SKGEN_SUB_ANGLE:
- uiDefButBitS(block, TOG, SKGEN_CUT_ANGLE, B_DIFF, "Angle", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs based on angle");
- uiDefButF(block, NUM, B_DIFF, "T:", 1111, y,164,19, &G.scene->toolsettings->skgen_angle_limit,0.0, 90.0, 10, 0, "Specify the threshold angle in degrees for subdivision");
- break;
- case SKGEN_SUB_CORRELATION:
- uiDefButBitS(block, TOG, SKGEN_CUT_CORRELATION, B_DIFF, "Adaptative", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs adaptatively");
- uiDefButF(block, NUM, B_DIFF, "T:", 1111, y,114,19, &G.scene->toolsettings->skgen_correlation_limit,0.0, 1.0, 0.01, 0, "Specify the adaptive threshold for subdivision");
- uiDefButBitS(block, TOG, SKGEN_STICK_TO_EMBEDDING, B_DIFF, "E", 1225, y, 25,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Stick endpoint to embedding");
- uiDefButBitS(block, TOG, SKGEN_ADAPTIVE_DISTANCE, B_DIFF, "D", 1250, y, 25,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Adaptive distance (on) or variance(off)");
- break;
- }
- }
-
- uiBlockEndAlign(block);
-}
-
-static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
-{
- uiBlock *block;
-
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools1", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Mesh Tools More", "Editing", 960, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 955, 200, 106, 19, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces (Ctrl+I)");
- uiDefBut(block, BUT,B_HIDE, "Hide", 1061, 200, 106, 19, 0, 0, 0, 0, 0, "Hides selected faces (H)");
- uiDefBut(block, BUT,B_REVEAL, "Reveal", 1167, 200, 107, 19, 0, 0, 0, 0, 0, "Reveals selected faces (Alt H)");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 955, 170, 150, 19, &G.scene->editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
- uiDefButBitI(block, TOG, G_DRAWNORMALS, REDRAWVIEW3D, "Draw Normals", 955,148,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
- uiDefButBitI(block, TOG, G_DRAW_VNORMALS, REDRAWVIEW3D, "Draw VNormals",955,126,150,19, &G.f, 0, 0, 0, 0, "Displays vertex normals as lines");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D_IMAGE, "Draw Faces", 955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades in the 3d view and UV editor");
- uiDefButBitI(block, TOG, G_DRAWEDGES, REDRAWVIEW3D_IMAGE, "Draw Edges", 955, 66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights in the 3d view and UV editor");
- uiDefButBitI(block, TOG, G_DRAWCREASES, REDRAWVIEW3D, "Draw Creases", 955, 42,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
- uiDefButBitI(block, TOG, G_DRAWBWEIGHTS, REDRAWVIEW3D, "Draw Bevel Weights", 955, 20,150,19, &G.f, 0, 0, 0, 0, "Displays weights created for the Bevel modifier");
- uiDefButBitI(block, TOG, G_DRAWSEAMS, REDRAWVIEW3D, "Draw Seams", 955, -2,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
- uiDefButBitI(block, TOG, G_DRAWSHARP, REDRAWVIEW3D, "Draw Sharp", 955, -24,150,19, &G.f, 0, 0, 0, 0, "Displays sharp edges, used with the EdgeSplit modifier");
- uiBlockEndAlign(block);
-
- /* Measurement drawing options */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, G_DRAW_EDGELEN, REDRAWVIEW3D, "Edge Length", 1125,170,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
- uiDefButBitI(block, TOG, G_DRAW_EDGEANG, REDRAWVIEW3D, "Edge Angles", 1125,148,150,19, &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
- uiDefButBitI(block, TOG, G_DRAW_FACEAREA, REDRAWVIEW3D, "Face Area", 1125,126,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- uiDefButBitI(block, TOG, G_DRAW_VERSE_DEBUG, REDRAWVIEW3D, "Draw VDebug",1125,104,150,19, &G.f, 0, 0, 0, 0, "Displays verse debug information");
-#endif
-
- uiBlockEndAlign(block);
-
- uiDefButC(block, MENU, REDRAWBUTSEDIT, "Edge Alt-Select Mode%t|Loop Select%x0|Tag Edges (Seam)%x1|Tag Edges (Sharp)%x2|Tag Edges (Crease)%x3|Tag Edges (Bevel)%x4",1125,88,150,19, &G.scene->toolsettings->edge_mode, 0, 0, 0, 0, "Operation to use when Alt+RMB on edges, Use Alt+Shift+RMB to tag the shortest path from the active edge");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, G_ALLEDGES, 0, "All Edges", 1125, 22,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
- uiDefButBitS(block, TOG, B_MESH_X_MIRROR, B_DIFF, "X-axis mirror",1125,0,150,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "While using transforms, mirrors the transformation");
- uiBlockEndAlign(block);
-}
-
-char *get_vertexgroup_menustr(Object *ob)
-{
- bDeformGroup *dg;
- int defCount, min, index;
- char (*qsort_ptr)[sizeof(dg->name)+6] = NULL; // +6 for "%x999|" max 999 groups selectable
- char *s, *menustr;
- int printed;
-
- defCount=BLI_countlist(&ob->defbase);
-
- if (!defCount) min=0;
- else min=1;
-
- if (defCount > 0) {
- /*
- * This will hold the group names temporarily
- * so we can sort them
- */
- qsort_ptr = MEM_callocN (defCount * sizeof (qsort_ptr[0]),
- "qsort_ptr");
- for (index = 1, dg = ob->defbase.first; dg; index++, dg=dg->next) {
- printed = snprintf (qsort_ptr[index - 1], sizeof (dg->name), dg->name);
- snprintf (qsort_ptr[index - 1]+printed, 6+1, "%%x%d|", index); // +1 to move the \0 see above 999 max here too
- }
-
- qsort (qsort_ptr, defCount, sizeof (qsort_ptr[0]),
- ( int (*)(const void *, const void *) ) strcmp);
- }
-
- s= menustr = MEM_callocN((sizeof(qsort_ptr[0]) * defCount)+30, "menustr"); // plus 30 for when defCount==0
- if(defCount) {
- for (index = 0; index < defCount; index++) {
- int cnt= sprintf (s, "%s", qsort_ptr[index]);
- if (cnt>0) s+= cnt;
- }
- }
- else strcpy(menustr, "No Vertex Groups in Object");
-
- if (qsort_ptr)
- MEM_freeN (qsort_ptr);
-
- return menustr;
-}
-
-static void verify_poselib_posename(void *arg1, void *arg2)
-{
- bAction *act= (bAction *)arg1;
- TimeMarker *marker= (TimeMarker *)arg2;
-
- BLI_uniquename(&act->markers, marker, "Pose", offsetof(TimeMarker, name), 64);
-}
-
-static void verify_posegroup_groupname(void *arg1, void *arg2)
-{
- bPose *pose= (bPose *)arg1;
- bActionGroup *grp= (bActionGroup *)arg2;
-
- BLI_uniquename(&pose->agroups, grp, "Group", offsetof(bActionGroup, name), 32);
-}
-
-static void editing_panel_links(Object *ob)
-{
- uiBlock *block;
- ID *id, *idfrom;
- int *poin, xco=143;
- float min;
- Material *ma;
- char str[64];
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_links", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Link and Materials", "Editing", 0, 0, 318, 204)==0) return;
-
- uiSetButLock((ob && ob->id.lib), ERROR_LIBDATA_MESSAGE);
-
- buttons_active_id(&id, &idfrom);
-
- if(id) {
- int alone= 0;
- int local= 0;
- int browse= B_EDITBROWSE;
-
- if(ob->type==OB_MESH) {
- browse= B_MESHBROWSE;
- alone= B_MESHALONE;
- local= B_MESHLOCAL;
- uiSetButLock(G.obedit!=0, "Unable to perform function in EditMode");
- }
- else if(ob->type==OB_MBALL) {
- alone= B_MBALLALONE;
- local= B_MBALLLOCAL;
- }
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
- alone= B_CURVEALONE;
- local= B_CURVELOCAL;
- }
- else if(ob->type==OB_CAMERA) {
- alone= B_CAMERAALONE;
- local= B_CAMERALOCAL;
- }
- else if(ob->type==OB_LAMP) {
- alone= B_LAMPALONE;
- local= B_LAMPLOCAL;
- }
- else if (ob->type==OB_ARMATURE){
- alone = B_ARMALONE;
- local = B_ARMLOCAL;
- }
- else if(ob->type==OB_LATTICE) {
- alone= B_LATTALONE;
- local= B_LATTLOCAL;
- }
- uiBlockSetCol(block, TH_BUT_SETTING2);
- xco= std_libbuttons(block, 143, 180, 0, NULL, browse, GS(id->name), 0, id, idfrom, &(G.buts->menunr), alone, local, 0, 0, B_KEEPDATA);
- uiBlockSetCol(block, TH_AUTO);
- }
- if(ob) {
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- but = uiDefBut(block, TEX, B_IDNAME, "OB:", xco, 180, 454-xco, YIC, ob->id.name+2, 0.0, 21.0, 0, 0, "Active Object name.");
-#ifdef WITH_VERSE
- if(ob->vnode) uiButSetFunc(but, test_and_send_idbutton_cb, ob, ob->id.name);
- else uiButSetFunc(but, test_idbutton_cb, ob->id.name, NULL);
-#else
- uiButSetFunc(but, test_idbutton_cb, ob->id.name, NULL);
-#endif
-
- }
-
- /* empty display handling, note it returns! */
- if (ob->type==OB_EMPTY) {
- uiDefBut(block, LABEL,0,"Empty Display:",
- xco, 154, 130,20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButC(block, MENU, REDRAWVIEW3D, "Empty Drawtype%t|Arrows%x1|Single Arrow%x4|Plain Axes%x2|Circle%x3|Cube%x5|Sphere%x6|Cone%x7",
- xco, 128, 140, 20, &ob->empty_drawtype, 0, 0, 0, 0, "The Empty 3D View display style");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Size:",
- xco, 108, 140, 21, &ob->empty_drawsize, 0.01, 10.0, 1, 0, "The size to display the Empty");
- uiBlockEndAlign(block);
- return;
- }
-
- /* poselib for armatures */
- if (ob->type==OB_ARMATURE) {
- if ((ob->pose) && (ob->flag & OB_POSEMODE) && (G.obedit != ob)) {
- bAction *act= ob->poselib;
- bPose *pose= ob->pose;
- bActionGroup *grp= NULL;
- int count;
- char *menustr;
-
- /* PoseLib settings for armature reside on the left */
- xco= 143;
-
- uiDefBut(block, LABEL,0, "Pose Library:", xco, 154, 200, 20, 0, 0, 0, 0, 0, "");
-
- /* PoseLib Action */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- std_libbuttons(block, 143, 130, 0, NULL, B_POSELIB_BROWSE, ID_AC, 0, (ID *)act, (ID *)ob, &(G.buts->menunr), B_POSELIB_ALONE, 0, B_POSELIB_DELETE, 0, 0);
- uiBlockSetCol(block, TH_AUTO);
-
- /* PoseLib - Pose editing controls */
- if (act) {
- uiDefBut(block, BUT, B_POSELIB_VALIDATE, "Auto-Sync PoseLib", xco,110,160,20, 0, 0, 0, 0, 0, "Syncs the current PoseLib with the poses available");
-
- uiBlockBeginAlign(block);
- /* currently 'active' pose */
- if (act->markers.first) {
- count= BLI_countlist(&act->markers);
- menustr= poselib_build_poses_menu(act, "PoseLib Poses");
- uiDefButI(block, MENU, B_POSELIB_APPLYP, menustr, xco, 85,18,20, &act->active_marker, 1, count, 0, 0, "Browses Poses in Pose Library. Applies chosen pose.");
- MEM_freeN(menustr);
-
- if (act->active_marker) {
- TimeMarker *marker= poselib_get_active_pose(act);
-
- but= uiDefBut(block, TEX, REDRAWBUTSEDIT,"", xco+18,85,160-18-20,20, marker->name, 0, 63, 0, 0, "Displays current Pose Library Pose name. Click to change.");
- uiButSetFunc(but, verify_poselib_posename, act, marker);
- uiDefIconBut(block, BUT, B_POSELIB_REMOVEP, VICON_X, xco+160-20, 85, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove this Pose Library Pose from Pose Library.");
- }
- }
-
- /* add new poses */
- uiDefBut(block, BUT, B_POSELIB_ADDPOSE, "Add Pose", xco,65,80,20, 0, 0, 0, 0, 0, "Add current pose to PoseLib");
- uiDefBut(block, BUT, B_POSELIB_REPLACEP, "Replace Pose", xco+80,65,80,20, 0, 0, 0, 0, 0, "Replace existing PoseLib Pose with current pose");
- uiBlockEndAlign(block);
- }
-
-
- /* Bone Groups settings for armature reside on the right */
- xco= 315;
-
- uiDefBut(block, LABEL,0, "Bone Groups:", xco, 154, 140, 20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- if (pose->agroups.first) {
- /* currently 'active' group - browse groups */
- count= BLI_countlist(&pose->agroups);
- menustr= build_posegroups_menustr(pose, 0);
- uiDefButI(block, MENU, B_POSEGRP_RECALC, menustr, xco, 130,18,20, &pose->active_group, 1, count, 0, 0, "Browses Bone Groups available for Armature. Click to change.");
- MEM_freeN(menustr);
-
- /* currently 'active' group - change name */
- if (pose->active_group) {
- grp= (bActionGroup *)BLI_findlink(&pose->agroups, pose->active_group-1);
-
- /* active group */
- but= uiDefBut(block, TEX, REDRAWBUTSEDIT,"", xco+18,130,140-18-20,20, grp->name, 0, 31, 0, 0, "Displays current Bone Group name. Click to change.");
- uiButSetFunc(but, verify_posegroup_groupname, pose, grp);
- uiDefIconBut(block, BUT, B_POSEGRP_REMOVE, VICON_X, xco+140-20, 130, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove this Bone Group");
- }
- }
-
- uiDefBut(block, BUT, B_POSEGRP_ADD, "Add Group", xco,110,140,20, 0, 21, 0, 0, 0, "Add a new Bone Group for the Pose");
- uiBlockEndAlign(block);
-
- /* color set for 'active' group */
- if (pose->active_group && grp) {
- uiBlockBeginAlign(block);
- menustr= BIF_ThemeColorSetsPup(1);
- uiDefButI(block, MENU,B_POSEGRP_RECALC, menustr, xco,85,140,19, &grp->customCol, -1, 20, 0.0, 0.0, "Index of set of Custom Colors to shade Group's bones with. 0 = Use Default Color Scheme, -1 = Use Custom Color Scheme");
- MEM_freeN(menustr);
-
- /* show color-selection/preview */
- if (grp->customCol) {
- /* do color copying/init (to stay up to date) */
- actionbone_group_copycolors(grp, 1);
-
- /* color changing */
- uiDefButC(block, COL, B_POSEGRP_MCUSTOM, "", xco, 65, 30, 19, grp->cs.solid, 0, 0, 0, 0, "Color to use for surface of bones");
- uiDefButC(block, COL, B_POSEGRP_MCUSTOM, "", xco+30, 65, 30, 19, grp->cs.select, 0, 0, 0, 0, "Color to use for 'selected' bones");
- uiDefButC(block, COL, B_POSEGRP_MCUSTOM, "", xco+60, 65, 30, 19, grp->cs.active, 0, 0, 0, 0, "Color to use for 'active' bones");
-
- uiDefButBitS(block, TOG, TH_WIRECOLOR_CONSTCOLS, B_POSEGRP_MCUSTOM, "ConstCols", xco+90,65,50,20, &grp->cs.flag, 0, 0, 0, 0, "Allow the use of colors indicating constraints/keyed status");
- }
- uiBlockEndAlign(block);
- }
- }
- return;
- }
-
- /* vertex group... partially editmode... */
- if(ob->type==OB_MESH || ob->type==OB_LATTICE) {
- bDeformGroup *defGroup;
- uiBut *but;
- int defCount;
-
- uiDefBut(block, LABEL,0,"Vertex Groups",
- 143,153,130,20, 0, 0, 0, 0, 0, "");
-
- defCount=BLI_countlist(&ob->defbase);
-
- if (defCount) {
- char *menustr= get_vertexgroup_menustr(ob);
-
- uiBlockBeginAlign(block);
-
- uiDefButS(block, MENU, B_MAKEDISP, menustr, 143, 132,18,21, (short *)&ob->actdef, 1, defCount, 0, 0, "Browses available vertex groups");
- MEM_freeN (menustr);
-
- if (ob->actdef){
- defGroup = BLI_findlink(&ob->defbase, ob->actdef-1);
- but= uiDefBut(block, TEX, REDRAWBUTSEDIT,"", 161,132,140-18,21, defGroup->name, 0, 31, 0, 0, "Displays current vertex group name. Click to change. (Match bone name for deformation.)");
- uiButSetFunc(but, verify_vertexgroup_name_func, defGroup, NULL);
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
-
- uiDefButF(block, NUM, REDRAWVIEW3D, "Weight:", 143, 111, 140, 21, &editbutvweight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength");
- }
- uiBlockEndAlign(block);
- }
-
- if (G.obedit && G.obedit==ob){
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_NEWVGROUP,"New", 143,90,70,21, 0, 0, 0, 0, 0, "Creates a new vertex group");
- uiDefBut(block, BUT,B_DELVGROUP,"Delete", 213,90,70,21, 0, 0, 0, 0, 0, "Removes the current vertex group");
-
- uiDefBut(block, BUT,B_ASSIGNVGROUP,"Assign", 143,69,70,21, 0, 0, 0, 0, 0, "Assigns selected vertices to the current vertex group");
- uiDefBut(block, BUT,B_REMOVEVGROUP,"Remove", 213,69,70,21, 0, 0, 0, 0, 0, "Removes selected vertices from the current vertex group");
-
- uiDefBut(block, BUT,B_SELVGROUP,"Select", 143,48,70,21, 0, 0, 0, 0, 0, "Selects vertices belonging to the current vertex group");
- uiDefBut(block, BUT,B_DESELVGROUP,"Desel.", 213,48,70,21, 0, 0, 0, 0, 0, "Deselects vertices belonging to the current vertex group");
- uiBlockEndAlign(block);
- }
- else {
- ID *id= ob->data;
-
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign (block);
- uiDefBut (block, BUT, B_NEWVGROUP, "New", 143, 90, 70, 21, 0, 0, 0, 0, 0, "Creates a new vertex group");
- uiDefBut (block, BUT, B_DELVGROUP, "Delete", 213, 90, 70, 21, 0, 0, 0, 0, 0, "Removes the current vertex group");
- uiDefBut (block, BUT, B_COPYVGROUP, "Copy Group", 143, 70, 140, 19, 0, 0, 0, 0, 0, "Copy Group of Vertex");
- uiBlockEndAlign (block);
-
- if(id->us > 1)
- uiDefBut(block, BUT,B_LINKEDVGROUP, "Copy To Linked", 143,50,140,20, 0, 0, 0, 0, 0, "Creates identical vertex group names in other Objects using this Object-data");
- }
- }
-
- /* now only objects that can be visible rendered */
- if (!OB_SUPPORT_MATERIAL(ob)) return;
-
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- give_obdata_texspace(ob, &poin, NULL, NULL, NULL);
- uiDefButBitI(block, TOG, AUTOSPACE, B_AUTOTEX, "AutoTexSpace", 143,15,140,19, poin, 0, 0, 0, 0, "Adjusts active object's texture space automatically when transforming object");
-
- sprintf(str,"%d Mat ", ob->totcol);
- if(ob->totcol) min= 1.0; else min= 0.0;
- ma= give_current_material(ob, ob->actcol);
-
- if(G.obedit) {
- char *str= NULL;
- IDnames_to_pupstring(&str, NULL, "ADD NEW %x 32767", &G.main->mat, NULL, NULL);
- uiDefButS(block, MENU, B_MATASS_BROWSE, str, 292,150,20,20, &G.buts->menunr, 0, 0, 0, 0, "Browses existing choices and assign");
- MEM_freeN(str);
- }
-
- if(ma) uiDefBut(block, LABEL, 0, ma->id.name+2, 318,150, 103, 20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- if(ma) uiDefButF(block, COL, B_MATCOL2, "", 292,113,31,30, &(ma->r), 0, 0, 0, 0, "");
- uiDefButC(block, NUM, B_ACTCOL, str, 324,113,100,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index");
- uiDefBut(block, BUT,B_MATWICH, "?", 424,113,30,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_MATNEW, "New", 292,90,80,20, 0, 0, 0, 0, 0, "Adds a new Material index");
- uiDefBut(block, BUT,B_MATDEL, "Delete", 372,90,80,20, 0, 0, 0, 0, 0, "Deletes this Material index");
- uiDefBut(block, BUT,B_MATSEL, "Select", 292,70,80,20, 0, 0, 0, 0, 0, "In EditMode, selects faces that have the active index");
- uiDefBut(block, BUT,B_MATDESEL, "Deselect", 372,70,80,20, 0, 0, 0, 0, 0, "Deselects everything with current indexnumber");
- uiDefBut(block, BUT,B_MATASS, "Assign", 292,50,160,20, 0, 0, 0, 0, 0, "In EditMode, assigns the active index to selected faces");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_SETSMOOTH,"Set Smooth", 292,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'smooth' rendering of selected faces");
- uiDefBut(block, BUT,B_SETSOLID, "Set Solid", 372,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'solid' rendering of selected faces");
-
- uiBlockEndAlign(block);
-
-
-}
-
-void editing_panel_sculpting_tools()
-{
- uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_tools", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Sculpt", "Editing", 300, 0, 318, 204)==0) return;
-
- sculptmode_draw_interface_tools(block,0,200);
-}
-
-void editing_panel_sculpting_brush()
-{
- uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_brush", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Brush", "Editing", 300, 0, 318, 204)==0) return;
-
- sculptmode_draw_interface_brush(block,0,200);
-}
-
-void editing_panel_sculpting_textures()
-{
- uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_texture", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Texture", "Editing", 300, 0, 318, 204)==0) return;
-
- sculptmode_draw_interface_textures(block,0,200);
-}
-
-void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned short cy)
-{
- SculptData *sd;
-
- if(!G.scene) return;
- sd= &G.scene->sculptdata;
-
- uiBlockBeginAlign(block);
-
- uiDefBut(block,LABEL,B_NOP,"Brush",cx,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
-
- uiBlockBeginAlign(block);
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Draw",cx,cy,67,19,&sd->brush_type,14.0,DRAW_BRUSH,0,0,"Draw lines on the model");
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Smooth",cx+67,cy,67,19,&sd->brush_type,14.0,SMOOTH_BRUSH,0,0,"Interactively smooth areas of the model");
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Pinch",cx+134,cy,67,19,&sd->brush_type,14.0,PINCH_BRUSH,0,0,"Interactively pinch areas of the model");
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Inflate",cx+201,cy,67,19,&sd->brush_type,14,INFLATE_BRUSH,0,0,"Push vertices along the direction of their normals");
- cy-= 20;
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Grab", cx,cy,89,19,&sd->brush_type,14,GRAB_BRUSH,0,0,"Grabs a group of vertices and moves them with the mouse");
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Layer", cx+89,cy,89,19,&sd->brush_type,14, LAYER_BRUSH,0,0,"Adds a layer of depth");
- uiDefButS(block,ROW,REDRAWBUTSEDIT,"Flatten", cx+178,cy,90,19,&sd->brush_type,14, FLATTEN_BRUSH,0,0,"Interactively flatten areas of the model");
- cy-= 25;
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block,LABEL,B_NOP,"Shape",cx,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
- uiBlockBeginAlign(block);
- if(sd->brush_type != SMOOTH_BRUSH && sd->brush_type != GRAB_BRUSH && sd->brush_type != FLATTEN_BRUSH) {
- uiDefButC(block,ROW,B_NOP,"Add",cx,cy,89,19,&sculptmode_brush()->dir,15.0,1.0,0, 0,"Add depth to model [Shift]");
- uiDefButC(block,ROW,B_NOP,"Sub",cx+89,cy,89,19,&sculptmode_brush()->dir,15.0,2.0,0, 0,"Subtract depth from model [Shift]");
- }
- if(sd->brush_type!=GRAB_BRUSH)
- uiDefButBitC(block, TOG, SCULPT_BRUSH_AIRBRUSH, B_NOP, "Airbrush", cx+178,cy,89,19, &sculptmode_brush()->flag,0,0,0,0, "Brush makes changes without waiting for the mouse to move");
- cy-= 20;
- uiDefButS(block,NUMSLI,B_NOP,"Size: ",cx,cy,268,19,&sculptmode_brush()->size,1.0,200.0,0,0,"Set brush radius in pixels");
- cy-= 20;
- if(sd->brush_type!=GRAB_BRUSH)
- uiDefButC(block,NUMSLI,B_NOP,"Strength: ",cx,cy,268,19,&sculptmode_brush()->strength,1.0,100.0,0,0,"Set brush strength");
- cy-= 25;
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut( block,LABEL,B_NOP,"Symmetry",cx,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
- uiBlockBeginAlign(block);
- uiDefButBitC(block, TOG, SYMM_X, B_NOP, "X", cx,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across X axis");
- uiDefButBitC(block, TOG, SYMM_Y, B_NOP, "Y", cx+40,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Y axis");
- uiDefButBitC(block, TOG, SYMM_Z, B_NOP, "Z", cx+80,cy,40,19, &sd->symm, 0,0,0,0, "Mirror brush across Z axis");
- uiBlockEndAlign(block);
-
-
- cy+= 20;
- uiBlockBeginAlign(block);
- uiDefBut( block,LABEL,B_NOP,"LockAxis",cx+140,cy,90,19,NULL,0,0,0,0,"");
- cy-= 20;
- uiBlockBeginAlign(block);
- uiDefButBitC(block, TOG, AXISLOCK_X, B_NOP, "X", cx+140,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain X axis");
- uiDefButBitC(block, TOG, AXISLOCK_Y, B_NOP, "Y", cx+180,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Y axis");
- uiDefButBitC(block, TOG, AXISLOCK_Z, B_NOP, "Z", cx+220,cy,40,19, &sd->axislock, 0,0,0,0, "Constrain Z axis");
- uiBlockEndAlign(block);
-
-
-
- cx+= 210;
-}
-
-static void sculptmode_curves_reset(void *sd_v, void *j)
-{
- SculptData *sd = sd_v;
- sculpt_reset_curve(sd);
- curvemapping_changed(sd->cumap, 0);
-}
-
-void sculptmode_draw_interface_brush(uiBlock *block, unsigned short cx, unsigned short cy)
-{
- SculptData *sd= sculpt_data();
- int orig_y = cy;
- rctf rect;
- uiBut *but;
-
- uiBlockBeginAlign(block);
- cy-= 20;
- uiDefButC(block,TOG,REDRAWBUTSEDIT, "Curve", cx,cy,80,19, &sd->texfade, 0,0,0,0,"Use curve control for radial brush intensity");
- cy-= 20;
- but= uiDefBut(block, BUT, REDRAWBUTSEDIT, "Reset",cx,cy,80,19, NULL, 0,0,0,0, "Default curve preset");
- uiButSetFunc(but, sculptmode_curves_reset, sd, NULL);
- cy-= 25;
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block,NUM,B_NOP, "Space", cx,cy,80,19, &sd->spacing, 0,500,20,0,"Non-zero inserts N pixels between dots");
- cy-= 20;
- if(sd->brush_type == DRAW_BRUSH)
- uiDefButC(block,NUM,B_NOP, "View", cx,cy,80,19, &sculptmode_brush()->view, 0,10,20,0,"Pulls brush direction towards view");
- cy-= 20;
- uiDefButBitC(block, TOG, SCULPT_BRUSH_ANCHORED, B_NOP, "Anchored", cx,cy,80,19, &sculptmode_brush()->flag, 0,0,0,0, "Keep the brush center anchored to the initial location (Shift A)");
- uiBlockEndAlign(block);
-
- /* Draw curve */
- cx += 90;
- cy = orig_y;
- rect.xmin= cx; rect.xmax= cx + 178;
- rect.ymin= cy - 160; rect.ymax= cy + 20;
- uiBlockBeginAlign(block);
- curvemap_buttons(block, sd->cumap, (char)0, B_NOP, 0, &rect);
- uiBlockEndAlign(block);
-}
-
-void sculptmode_draw_interface_textures(uiBlock *block, unsigned short cx, unsigned short cy)
-{
- SculptData *sd= sculpt_data();
- MTex *mtex;
- int i;
- int orig_y= cy;
- char *strp;
- uiBut *but;
-
- uiBlockBeginAlign(block);
- cy-= 20;
- /* TEX CHANNELS */
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
- for(i=-1; i<8; i++) {
- char str[64];
- int loos;
-
- if(i==-1)
- strcpy(str, "Default");
- else {
- mtex= sd->mtex[i];
- if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
- else strcpy(str, "");
- }
- str[10]= 0;
- uiDefButS(block, ROW, REDRAWBUTSEDIT, str,cx, cy, 80, 20, &sd->texact, 3.0, (float)i, 0, 0, "Texture channel");
- cy-= 18;
- }
-
- cy= orig_y-20;
- cx+= 85;
-
- if(sd->texact == -1) {
- uiBlockBeginAlign(block);
- uiDefBut(block,LABEL,B_NOP,"",cx,cy,115,20,0,0,0,0,0,""); /* Padding */
- } else {
- ID *id = NULL;
-
- mtex= sd->mtex[sd->texact];
-
- uiBlockBeginAlign(block);
-
- if(mtex && mtex->tex) id= &mtex->tex->id;
- IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &G.main->tex, id, &G.buts->texnr);
-
- if(mtex && mtex->tex) {
- uiDefBut(block, TEX, B_IDNAME, "TE:",cx,cy,115,19, mtex->tex->id.name+2, 0.0, 21.0, 0, 0, "Texture name");
- cy-= 20;
-
- uiDefButS(block,MENU,B_SCULPT_TEXBROWSE, strp, cx,cy,20,19, &G.buts->texnr, 0,0,0,0, "Selects an existing texture or creates new");
- uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, cx+21,cy,21,20, 0, 0, 0, 0, 0, "Auto-assigns name to texture");
-
- but= uiDefBut(block, BUT, B_NOP, "Clear",cx+43, cy, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture");
- uiButSetFunc(but,sculptmode_rem_tex,0,0);
- cy-= 25;
-
- uiBlockBeginAlign(block);
- uiDefButC(block,ROW, REDRAWBUTSEDIT, "Drag", cx, cy,39,19, &sd->texrept, 18,SCULPTREPT_DRAG,0,0,"Move the texture with the brush");
- uiDefButC(block,ROW, REDRAWBUTSEDIT, "Tile", cx+39,cy,39,19, &sd->texrept, 18,SCULPTREPT_TILE,0,0,"Treat the texture as a tiled image extending across the screen");
- uiDefButC(block,ROW, REDRAWBUTSEDIT, "3D", cx+78,cy,37,19, &sd->texrept, 18,SCULPTREPT_3D, 0,0,"Use vertex coords as texture coordinates");
- cy-= 20;
-
- if(sd->texrept != SCULPTREPT_3D) {
- uiBlockBeginAlign(block);
- uiDefButF(block,NUM,0, "Angle", cx,cy,115,19, &mtex->warpfac, 0,360,100,0, "Rotate texture counterclockwise");
- /*Moved inside, so that following buttons aren't made bigger for no reason*/
- cy-= 20;
- }
-
- /* Added Rake button. Needs to be turned off if 3D is on / disappear*/
- if(sd->texrept != SCULPTREPT_3D){
- uiDefButC(block,TOG,B_NOP, "Rake", cx,cy,115,19, &sd->rake, 0,0,0,0,"Rotate the brush in the direction of motion");
- cy-=20;
- }
-
- if(sd->texrept != SCULPTREPT_DRAG) {
- uiBlockBeginAlign(block);
- but= uiDefIconButC(block, TOG, REDRAWBUTSEDIT, sd->texsep ? ICON_UNLOCKED : ICON_LOCKED, cx,cy,20,19, &sd->texsep,0,0,0,0, "Locks the texture sizes together");
- uiBlockBeginAlign(block);
- uiDefButF(block,NUM,B_NOP, sd->texsep ? "SizeX" : "Size", cx+20,cy,95,19, &mtex->size[0],1,1000,100,0,"Scaling factor for texture");
- cy-= 20;
- if(sd->texsep) {
- uiDefButF(block,NUM,B_NOP, "SizeY", cx+20,cy,95,19, &mtex->size[1],1,1000,100,0,"Scaling factor for texture");
- cy-= 20;
- if(sd->texrept == SCULPTREPT_3D)
- uiDefButF(block,NUM,B_NOP, "SizeZ", cx+20,cy,95,19, &mtex->size[2],1,1000,100,0,"Scaling factor for texture");
- cy-= 20;
- }
- }
- }
- else {
- uiDefButS(block,TOG,B_SCULPT_TEXBROWSE, "Add New" ,cx, cy, 115, 19, &G.buts->texnr,-1,32767,0,0, "Adds a new texture");
- uiDefButS(block,MENU,B_SCULPT_TEXBROWSE, strp, cx,cy-20,20,19, &G.buts->texnr, 0,0,0,0, "Selects an existing texture or creates new");
- }
-
- MEM_freeN(strp);
- }
-
- uiBlockEndAlign(block);
-}
-
-/* *************************** FACE/PAINT *************************** */
-
-void do_fpaintbuts(unsigned short event)
-{
- Object *ob;
- bDeformGroup *defGroup;
- MTFace *activetf;
- SculptData *sd= &G.scene->sculptdata;
- ID *id, *idtest;
- extern VPaint Gwp; /* from vpaint */
- ToolSettings *settings= G.scene->toolsettings;
- int nr= 1;
- MTex *mtex;
- ParticleSystem *psys;
-
- ob= OBACT;
- if(ob==NULL) return;
-
- switch(event) {
-
- case B_VPGAMMA:
- vpaint_dogamma();
- break;
- case B_COPY_TF_MODE:
- EM_mesh_copy_face(4); /* todo, get rid of magic numbers */
- break;
- case B_COPY_TF_TRANSP:
- EM_mesh_copy_face(5);
- break;
- case B_COPY_TF_UV:
- EM_mesh_copy_face(3);
- break;
- case B_COPY_TF_COL:
- EM_mesh_copy_face(6);
- break;
- case B_COPY_TF_TEX:
- EM_mesh_copy_face(2);
- break;
- case B_SET_VCOL:
- if(FACESEL_PAINT_TEST)
- clear_vpaint_selectedfaces();
- else
- clear_vpaint();
- break;
- case B_REDR_3D_IMA:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_ASSIGNMESH:
-
- test_object_materials(ob->data);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_TFACE_HALO:
- activetf = get_active_mtface(NULL, NULL, 0);
- if(activetf) {
- activetf->mode &= ~TF_BILLBOARD2;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case B_TFACE_BILLB:
- activetf = get_active_mtface(NULL, NULL, 0);
- if(activetf) {
- activetf->mode &= ~TF_BILLBOARD;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case B_WEIGHT0_0:
- editbutvweight = 0.0f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_WEIGHT1_4:
- editbutvweight = 0.25f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_WEIGHT1_2:
- editbutvweight = 0.5f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_WEIGHT3_4:
- editbutvweight = 0.75f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_WEIGHT1_0:
- editbutvweight = 1.0f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_OPA1_8:
- Gwp.a = 0.125f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_OPA1_4:
- Gwp.a = 0.25f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_OPA1_2:
- Gwp.a = 0.5f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_OPA3_4:
- Gwp.a = 0.75f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_OPA1_0:
- Gwp.a = 1.0f;
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_CLR_WPAINT:
- if(!multires_level1_test()) {
- defGroup = BLI_findlink(&ob->defbase, ob->actdef-1);
- if(defGroup) {
- Mesh *me= ob->data;
- int a;
- for(a=0; a<me->totvert; a++)
- remove_vert_defgroup (ob, defGroup, a);
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- break;
- case B_SCULPT_TEXBROWSE:
- sd= &G.scene->sculptdata;
-
- if(G.buts->texnr== -2) {
- id= NULL;
- if(sd) {
- mtex= sd->mtex[sd->texact];
- if(mtex) id= &mtex->tex->id;
- }
-
- activate_databrowse((ID *)id, ID_TE, 0, B_SCULPT_TEXBROWSE, &G.buts->texnr, do_global_buttons);
- return;
- }
- if(G.buts->texnr < 0) break;
-
- if(G.buts->pin) {
-
- }
- else if(sd && sd->texact == -1) {
- error("No texture channel selected");
- allqueue(REDRAWBUTSSHADING, 0);
- }
- else if(sd && sd->texact != -1) {
- id= NULL;
-
- mtex= sd->mtex[sd->texact];
- if(mtex) id= &mtex->tex->id;
-
- idtest= G.main->tex.first;
- while(idtest) {
- if(nr==G.buts->texnr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new tex */
- if(id) idtest= (ID *)copy_texture((Tex *)id);
- else idtest= (ID *)add_texture("Tex");
- idtest->us--;
- }
- if(idtest!=id && sd) {
-
- if(sd->mtex[sd->texact]==0) {
- sd->mtex[sd->texact]= add_mtex();
- sd->mtex[sd->texact]->texco= TEXCO_VIEW;
- sd->mtex[sd->texact]->size[0]=
- sd->mtex[sd->texact]->size[1]=
- sd->mtex[sd->texact]->size[2]= 100;
- sd->mtex[sd->texact]->warpfac= 0;
- }
- sd->mtex[sd->texact]->tex= (Tex *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Texture browse");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_TE);
- }
- }
- break;
-
- case B_BRUSHBROWSE:
- if(G.buts->menunr==-2) {
- activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_BRUSHBROWSE, &G.buts->menunr, do_global_buttons);
- break;
- }
- else if(G.buts->menunr < 0) break;
-
- if(brush_set_nr(&settings->imapaint.brush, G.buts->menunr)) {
- BIF_undo_push("Browse Brush");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_BRUSHDELETE:
- if(brush_delete(&settings->imapaint.brush)) {
- BIF_undo_push("Unlink Brush");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_BRUSHKEEPDATA:
- brush_toggled_fake_user(settings->imapaint.brush);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_BRUSHLOCAL:
- if(settings->imapaint.brush && settings->imapaint.brush->id.lib) {
- if(okee("Make local")) {
- make_local_brush(settings->imapaint.brush);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- break;
- case B_BTEXBROWSE:
- if(settings->imapaint.brush) {
- Brush *brush= settings->imapaint.brush;
-
- if(G.buts->menunr==-2) {
- MTex *mtex= brush->mtex[brush->texact];
- ID *id= (ID*)((mtex)? mtex->tex: NULL);
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts);
- } else {
- activate_databrowse(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts);
- }
- break;
- }
- else if(G.buts->menunr < 0) break;
-
- if(brush_texture_set_nr(brush, G.buts->menunr)) {
- BIF_undo_push("Browse Brush Texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- break;
- case B_BTEXDELETE:
- if(settings->imapaint.brush) {
- if (brush_texture_delete(settings->imapaint.brush)) {
- BIF_undo_push("Unlink Brush Texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- break;
- case B_BRUSHCHANGE:
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_BAKE_REDRAWEDIT:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_BAKE_RECACHE:
- psys=PE_get_current(ob);
- PE_hide_keys_time(psys,CFRA);
- psys_cache_paths(ob,psys,CFRA,0);
- if(PE_settings()->flag & PE_SHOW_CHILD)
- psys_cache_child_paths(ob,psys,CFRA,0);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- }
-}
-
-/* -------------------- MODE: vpaint ------------------- */
-
-void weight_paint_buttons(uiBlock *block)
-{
- extern VPaint Gwp; /* from vpaint */
- Object *ob;
- ob= OBACT;
-
- if(ob==NULL) return;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Weight:",10,170,225,19, &editbutvweight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength");
-
- uiDefBut(block, BUT, B_WEIGHT0_0 , "0", 10,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_4 , "1/4", 55,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_2 , "1/2", 100,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT3_4 , "3/4", 145,150,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_WEIGHT1_0 , "1", 190,150,45,19, 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 10,130,225,19, &Gwp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
-
- uiDefBut(block, BUT, B_OPA1_8 , "1/8", 10,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_4 , "1/4", 55,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_2 , "1/2", 100,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA3_4 , "3/4", 145,110,45,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_OPA1_0 , "1", 190,110,45,19, 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, NUMSLI, B_NOP, "Size ", 10,90,225,19, &Gwp.size, 2.0, 64.0, 0, 0, "The size of the brush");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_DIFF, "Mix", 250,170,60,17, &Gwp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colors");
- uiDefButS(block, ROW, B_DIFF, "Add", 250,152,60,17, &Gwp.mode, 1.0, 1.0, 0, 0, "Add the vertex colors");
- uiDefButS(block, ROW, B_DIFF, "Sub", 250,134,60,17, &Gwp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
- uiDefButS(block, ROW, B_DIFF, "Mul", 250,116,60,17, &Gwp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
- uiDefButS(block, ROW, B_DIFF, "Blur", 250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values");
- uiDefButS(block, ROW, B_DIFF, "Lighter", 250, 80,60,17, &Gwp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
- uiDefButS(block, ROW, B_DIFF, "Darker", 250, 62,60,17, &Gwp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
- uiBlockEndAlign(block);
-
- /* draw options same as below */
- uiBlockBeginAlign(block);
- if (FACESEL_PAINT_TEST) {
- uiDefButBitI(block, TOG, G_DRAWFACES, B_UVAUTO_DRAWFACES, "Faces", 10,45,60,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
- uiDefButBitI(block,TOG, G_DRAWEDGES, REDRAWVIEW3D,"Edges",70,45,60,19, &G.f, 2.0, 0, 0, 0, "Displays edges of visible faces");
- uiDefButBitI(block,TOG, G_HIDDENEDGES, REDRAWVIEW3D,"Hidden Edges",130,45,100,19, &G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces");
- } else{
- uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 10,45,75,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 10,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Paint on all faces inside brush (otherwise only on face under mouse cursor)");
- uiDefButBitS(block, TOG, VP_SOFT, 0, "Vert Dist", 70,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of all vertices of face)");
- uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft", 130,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Use a soft brush");
- uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 190,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
- uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 250,20,55,19, &Gwp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
- uiBlockEndAlign(block);
-
- if(ob) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_ONLYVGROUP, REDRAWVIEW3D, "Vgroup", 10,0,100,19, &Gwp.flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group.");
- uiDefButBitS(block, TOG, VP_MIRROR_X, REDRAWVIEW3D, "X-Mirror", 110,0,100,19, &Gwp.flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name");
- uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 210,0,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices");
- uiBlockEndAlign(block);
- }
-}
-
-static void editing_panel_mesh_paint(void)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_paint", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Paint", "Editing", 640, 0, 318, 204)==0) return;
-
-
- if(G.f & G_WEIGHTPAINT) {
- weight_paint_buttons(block);
- }
- else if(G.f & G_VERTEXPAINT) {
- extern VPaint Gvp; /* from vpaint */
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_NOP, "R ", 979,170,150,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting");
- uiDefButF(block, NUMSLI, B_NOP, "G ", 979,150,150,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting");
- uiDefButF(block, NUMSLI, B_NOP, "B ", 979,130,150,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 979,105,222,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
- uiDefButF(block, NUMSLI, B_NOP, "Size ", 979,85,222,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush");
- uiBlockEndAlign(block);
-
- uiDefButF(block, COL, B_REDR, "", 1140,150,60,40, &(Gvp.r), 0, 0, 0, B_VPCOLSLI, "");
- uiDefBut(block, BUT, B_SET_VCOL, "SetVCol", 1140,130,60,20, 0, 0, 0, 0, 0, "Set Vertex color of selection to current (Shift+K)");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_DIFF, "Mix", 1212,170,63,17, &Gvp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colors");
- uiDefButS(block, ROW, B_DIFF, "Add", 1212,152,63,17, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex color");
- uiDefButS(block, ROW, B_DIFF, "Sub", 1212, 134,63,17, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
- uiDefButS(block, ROW, B_DIFF, "Mul", 1212, 116,63,17, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
- uiDefButS(block, ROW, B_DIFF, "Blur", 1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Blur the color with surrounding values");
- uiDefButS(block, ROW, B_DIFF, "Lighter", 1212, 80,63,17, &Gvp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
- uiDefButS(block, ROW, B_DIFF, "Darker", 1212, 62,63,17, &Gvp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
- uiBlockEndAlign(block);
-
- /* draw options */
- uiBlockBeginAlign(block);
- if (FACESEL_PAINT_TEST) {
- uiDefButBitI(block, TOG, G_DRAWFACES, B_UVAUTO_DRAWFACES, "Faces", 979,50,60,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
- uiDefButBitI(block,TOG, G_DRAWEDGES, REDRAWVIEW3D,"Edges",1039,50,60,19, &G.f, 2.0, 0, 0, 0, "Displays edges of visible faces");
- uiDefButBitI(block,TOG, G_HIDDENEDGES, REDRAWVIEW3D,"Hidden Edges",1099,50,100,19, &G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 979,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Paint on all faces inside brush");
- uiDefButBitS(block, TOG, VP_SOFT, 0, "Vertex Dist", 1054,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of paint entire faces)");
- uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 1129,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
- uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 1204,25,72,19, &Gvp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_VPGAMMA, "Set", 979,0,81,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colors");
- uiDefButF(block, NUM, B_DIFF, "Mul:", 1061,0,112,19, &Gvp.mul, 0.1, 50.0, 10, 0, "Set the number to multiply vertex colors with");
- uiDefButF(block, NUM, B_DIFF, "Gamma:", 1174,0,102,19, &Gvp.gamma, 0.1, 5.0, 10, 0, "Change the clarity of the vertex colors");
- uiBlockEndAlign(block);
- }
- else { /* texture paint */
- ToolSettings *settings= G.scene->toolsettings;
- Brush *brush= settings->imapaint.brush;
- ID *id;
- int yco, xco, butw;
-
- yco= 160;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_BRUSHCHANGE, "Draw", 0 ,yco,108,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_DRAW, 0, 0, "Draw brush");
- uiDefButS(block, ROW, B_BRUSHCHANGE, "Soften", 108 ,yco,106,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SOFTEN, 0, 0, "Soften brush");
- uiDefButS(block, ROW, B_BRUSHCHANGE, "Smear", 214,yco,106,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SMEAR, 0, 0, "Smear brush");
- uiBlockEndAlign(block);
- yco -= 30;
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (ID*)settings->imapaint.brush;
- xco= std_libbuttons(block, 0, yco, 0, NULL, B_BRUSHBROWSE, ID_BR, 0, id, NULL, &(G.buts->menunr), 0, B_BRUSHLOCAL, B_BRUSHDELETE, 0, B_BRUSHKEEPDATA);
- uiBlockSetCol(block, TH_AUTO);
-
- if(brush && !brush->id.lib) {
- MTex *mtex= brush->mtex[brush->texact];
-
- butw= 320-(xco+10);
-
- uiDefButS(block, MENU, B_NOP, "Mix %x0|Add %x1|Subtract %x2|Multiply %x3|Lighten %x4|Darken %x5|Erase Alpha %x6|Add Alpha %x7", xco+10,yco,butw,19, &brush->blend, 0, 0, 0, 0, "Blending method for applying brushes");
-
- uiDefButBitS(block, TOG|BIT, BRUSH_TORUS, B_BRUSHCHANGE, "Wrap", xco+10,yco-25,butw,19, &brush->flag, 0, 0, 0, 0, "Enables torus wrapping");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG|BIT, BRUSH_AIRBRUSH, B_BRUSHCHANGE, "Airbrush", xco+10,yco-50,butw,19, &brush->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse (spray)");
- uiDefButF(block, NUM, B_NOP, "Rate ", xco+10,yco-70,butw,19, &brush->rate, 0.01, 1.0, 0, 0, "Number of paints per second for Airbrush");
- uiBlockEndAlign(block);
-
- yco -= 25;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_VPCOLSLI, "", 0,yco,200,19, brush->rgb, 0, 0, 0, 0, "");
- uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 0,yco-20,180,19, &brush->alpha, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_ALPHA_PRESSURE, B_NOP, "P", 180,yco-20,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButI(block, NUMSLI, B_NOP, "Size ", 0,yco-40,180,19, &brush->size, 1, 200, 0, 0, "The size of the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_SIZE_PRESSURE, B_NOP, "P", 180,yco-40,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButF(block, NUMSLI, B_NOP, "Falloff ", 0,yco-60,180,19, &brush->innerradius, 0.0, 1.0, 0, 0, "The fall off radius of the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_RAD_PRESSURE, B_NOP, "P", 180,yco-60,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButF(block, NUMSLI, B_NOP, "Spacing ",0,yco-80,180,19, &brush->spacing, 1.0, 100.0, 0, 0, "Repeating paint on %% of brush diameter");
- uiDefButBitS(block, TOG|BIT, BRUSH_SPACING_PRESSURE, B_NOP, "P", 180,yco-80,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiBlockEndAlign(block);
-
- yco -= 110;
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (mtex)? (ID*)mtex->tex: NULL;
- xco= std_libbuttons(block, 0, yco, 0, NULL, B_BTEXBROWSE, ID_TE, 0, id, NULL, &(G.buts->menunr), 0, 0, B_BTEXDELETE, 0, 0);
- /*uiDefButBitS(block, TOG|BIT, BRUSH_FIXED_TEX, B_BRUSHCHANGE, "Fixed", xco+5,yco,butw,19, &brush->flag, 0, 0, 0, 0, "Keep texture origin in fixed position");*/
- uiBlockSetCol(block, TH_AUTO);
- }
- }
-}
-
-static void editing_panel_mesh_texface(void)
-{
- uiBlock *block;
- MTFace *tf;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_texface", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Multires", "Editing");
- if(uiNewPanel(curarea, block, "Texture Face", "Editing", 960, 0, 318, 204)==0) return;
-
- tf = get_active_mtface(NULL, NULL, 0);
-
- if(tf) {
- uiDefBut(block, LABEL, B_NOP, "Active Face Mode", 600,185,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine ");
- uiDefBut(block, BUT,B_COPY_TF_MODE, "Copy", 850,185,50,19, 0, 0, 0, 0, 0, "Copy active faces mode to other selected (View3D Ctrl+C)");
-
- /* Other copy buttons, layout isnt that nice */
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_COPY_TF_UV, "CopyUV", 600,15,100,19, 0, 0, 0, 0, 0, "Copy active faces UVs to other selected (View3D Ctrl+C)");
- uiDefBut(block, BUT,B_COPY_TF_TEX, "CopyTex", 700,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Texture to other selected (View3D Ctrl+C)");
- uiDefBut(block, BUT,B_COPY_TF_COL, "CopyColor", 800,15,100,19, 0, 0, 0, 0, 0, "Copy active faces Color to other selected (View3D Ctrl+C)");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
-
- uiDefButBitS(block, TOG, TF_TEX, B_REDR_3D_IMA, "Tex", 600,160,60,19, &tf->mode, 0, 0, 0, 0, "Render face with texture");
- uiDefButBitS(block, TOG, TF_TILES, B_REDR_3D_IMA, "Tiles", 660,160,60,19, &tf->mode, 0, 0, 0, 0, "Use tilemode for face");
- uiDefButBitS(block, TOG, TF_LIGHT, REDRAWVIEW3D, "Light", 720,160,60,19, &tf->mode, 0, 0, 0, 0, "Use light for face");
- uiDefButBitS(block, TOG, TF_INVISIBLE, REDRAWVIEW3D, "Invisible",780,160,60,19, &tf->mode, 0, 0, 0, 0, "Make face invisible");
- uiDefButBitS(block, TOG, TF_DYNAMIC, REDRAWVIEW3D, "Collision", 840,160,60,19, &tf->mode, 0, 0, 0, 0, "Use face for collision and ray-sensor detection");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TF_SHAREDCOL, REDRAWVIEW3D, "Shared", 600,135,60,19, &tf->mode, 0, 0, 0, 0, "Blend vertex colors across face when vertices are shared");
- uiDefButBitS(block, TOG, TF_TWOSIDE, REDRAWVIEW3D, "Twoside",660,135,60,19, &tf->mode, 0, 0, 0, 0, "Render face twosided");
- uiDefButBitS(block, TOG, TF_OBCOL, REDRAWVIEW3D, "ObColor",720,135,60,19, &tf->mode, 0, 0, 0, 0, "Use ObColor instead of vertex colors");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TF_BILLBOARD, B_TFACE_HALO, "Halo", 600,110,60,19, &tf->mode, 0, 0, 0, 0, "Screen aligned billboard");
- uiDefButBitS(block, TOG, TF_BILLBOARD2, B_TFACE_BILLB, "Billboard",660,110,60,19, &tf->mode, 0, 0, 0, 0, "Billboard with Z-axis constraint");
- uiDefButBitS(block, TOG, TF_SHADOW, REDRAWVIEW3D, "Shadow", 720,110,60,19, &tf->mode, 0, 0, 0, 0, "Face is used for shadow");
- uiDefButBitS(block, TOG, TF_BMFONT, REDRAWVIEW3D, "Text", 780,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable bitmap text on face");
- uiDefButBitS(block, TOG, TF_ALPHASORT, REDRAWVIEW3D, "Sort", 840,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, B_NOP, "Active Face Alpha Blending (Transp)", 600,75,300,19, NULL, 0.0, 0.0, 0, 0, "Face mode its used for TexFace display and the game engine");
- uiDefBut(block, BUT,B_COPY_TF_TRANSP, "Copy", 850,75,50,19, 0, 0, 0, 0, 0, "Copy active faces transp to other selected (View3D Ctrl+C)");
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,50,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,50,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,50,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha", 780,50,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)");
- uiBlockEndAlign(block);
-
- } else {
- uiDefBut(block,LABEL,B_NOP, "(No Active Face)", 10,200,150,19,0,0,0,0,0,"");
- }
-
-}
-
-void do_uvcalculationbuts(unsigned short event)
-{
- switch(event) {
- case B_UVAUTO_DRAWFACES:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- }
-}
-
-static void editing_panel_mesh_uvautocalculation(void)
-{
- uiBlock *block;
- int butH= 19, butHB= 20, row= 180, butS= 10;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_uvautocalculation", UI_EMBOSS, UI_HELV, curarea->win);
- /* make this a tab of "Texture face" to save screen space*/
- uiNewPanelTabbed("Multires", "Editing");
- if(uiNewPanel(curarea, block, "UV Calculation", "Editing", 960, 0, 318, 204)==0)
- return;
- row-= 4*butHB+butS;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, REDRAWBUTSEDIT, "Unwrapper%t|Conformal%x0|Angle Based%x1",100,row,200,butH, &G.scene->toolsettings->unwrapper, 0, 0, 0, 0, "Unwrap method");
- uiDefButBitS(block, TOG, UVCALC_FILLHOLES, B_NOP, "Fill Holes",100,row-butHB,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Fill holes to prevent internal overlaps");
- uiBlockEndAlign(block);
- row-= 2*butHB+butS;
-
- row= 180;
-
- uiDefButBitS(block, TOGN, UVCALC_NO_ASPECT_CORRECT, B_NOP, "Image Aspect",100,row,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Scale the UV Unwrapping to correct for the current images aspect ratio");
-
- row-= butHB+butS;
- uiDefButBitS(block, TOG, UVCALC_TRANSFORM_CORRECT, B_NOP, "Transform Correction",100,row,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Correct for UV distortion while transforming, (only works with edge slide now)");
-
- row= 180;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,B_UVAUTO_CUBESIZE ,"Cube Size:",315,row,200,butH, &G.scene->toolsettings->uvcalc_cubesize, 0.0001, 100.0, 10, 3, "Defines the cubemap size for cube mapping");
- uiBlockEndAlign(block);
- row-= butHB+butS;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,B_UVAUTO_CYLRADIUS ,"Cyl Radius:",315,row,200,butH, &G.scene->toolsettings->uvcalc_radius, 0.1, 100.0, 10, 3, "Defines the radius of the UV mapping cylinder");
- uiBlockEndAlign(block);
- row-= butHB+butS;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_UVAUTO_FACE,"View Aligns Face",315,row,200,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 1.0, 0.0,0.0, "View is on equator for cylindrical and spherical UV mapping");
- uiDefButS(block, ROW,B_UVAUTO_TOP,"VA Top",315,row-butHB,100,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 0.0, 0.0,0.0, "View is on poles for cylindrical and spherical UV mapping");
- uiDefButS(block, ROW,B_UVAUTO_TOP,"Al Obj",415,row-butHB,100,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 2.0, 0.0,0.0, "Align to object for cylindrical and spherical UV mapping");
- uiBlockEndAlign(block);
- row-= 2*butHB+butS;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_UVAUTO_ALIGNX,"Polar ZX",315,row,100,butH, &G.scene->toolsettings->uvcalc_mapalign,2.0, 0.0, 0.0,0.0, "Polar 0 is X for cylindrical and spherical UV mapping");
- uiDefButS(block, ROW,B_UVAUTO_ALIGNY,"Polar ZY",415,row,100,butH, &G.scene->toolsettings->uvcalc_mapalign,2.0, 1.0, 0.0,0.0, "Polar 0 is Y for cylindrical and spherical UV mapping");
- uiBlockEndAlign(block);
-}
-
-void editing_panel_mesh_multires()
-{
- uiBlock *block;
- uiBut *but;
- Object *ob= OBACT;
- Mesh *me= get_mesh(ob);
- int cx= 100, cy= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_multires", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Multires", "Editing", 500, 0, 318, 204)==0) return;
-
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- if(!me->mr) {
- but= uiDefBut(block,BUT,B_NOP,"Add Multires", cx,cy,268,19,0,0,0,0,0,"Allow editing of the mesh at multiple subdivision levels (disables distructive mesh editing)");
- uiButSetFunc(but,multires_make,ob,me);
- } else {
- char subsurfmenu[]= "Subsurf Type%t|Catmull-Clark%x0|Simple Subdiv.%x1";
-
- but= uiDefBut(block,BUT,B_NOP,"Apply Multires", cx,cy,268,19,0,0,0,0,0,"Apply current multires level to mesh and the delete other levels");
- uiButSetFunc(but,multires_delete,ob,me);
- cy-= 24;
-
- uiBlockBeginAlign(block);
- but= uiDefBut(block,BUT,B_NOP,"Add Level", cx,cy,134,19,0,0,0,0,0,"Add a new level of subdivision at the end of the chain");
- uiButSetFunc(but, multires_subdivide, ob, me);
- uiDefButC(block, MENU, B_NOP, subsurfmenu, cx + 134, cy, 134, 19, &G.scene->toolsettings->multires_subdiv_type, 0, 0, 0, 0, "Selects type of subdivision algorithm.");
- cy-= 20;
-
- if(me->mr->level_count>1) {
- but= uiDefBut(block,BUT,B_NOP,"Del Lower", cx,cy,134,19,0,0,0,0,0,"Remove all levels of subdivision below the current one");
- uiButSetFunc(but,multires_del_lower,ob,me);
- but= uiDefBut(block,BUT,B_NOP,"Del Higher", cx+134,cy,134,19,0,0,0,0,0,"Remove all levels of subdivision above the current one");
- uiButSetFunc(but,multires_del_higher,ob,me);
- cy-= 20;
-
- but= uiDefButC(block,NUM,B_NOP,"Level: ",cx,cy,268,19,(char *)&me->mr->newlvl,1.0,me->mr->level_count,0,0,"");
- uiButSetFunc(but,multires_set_level_cb, ob, me);
- cy-= 20;
-
- but= uiDefButC(block,NUM,B_NOP,"Edges: ",cx,cy,268,19,(char *)&me->mr->edgelvl,1.0,me->mr->level_count,0,0,"Set level of edges to display");
- uiButSetFunc(but,multires_edge_level_update_cb,ob,me);
- cy-= 20;
- uiBlockEndAlign(block);
-
- cy-= 5;
- uiDefBut(block,LABEL,B_NOP,"Rendering",cx,cy,100,19,0,0,0,0,0,"");
- cy-= 20;
-
- uiBlockBeginAlign(block);
- uiDefButC(block,NUM,B_NOP,"Pin: ",cx,cy,268,19,(char *)&me->mr->pinlvl,1.0,me->mr->level_count,0,0,"Set level to apply modifiers to during render");
- cy-= 20;
-
- uiDefButC(block,NUM,B_NOP,"Render: ",cx,cy,268,19,(char *)&me->mr->renderlvl,1.0,me->mr->level_count,0,0,"Set level to render");
- cy-= 20;
-
- if(multires_modifier_warning()) {
- char *tip= "One or more modifiers are enabled that modify mesh topology";
- uiDefIconBut(block,LABEL,B_NOP,ICON_ERROR, cx,cy,20,20, 0,0,0,0,0, tip);
- uiDefBut(block,LABEL,B_NOP, "Cannot use render level", cx+20,cy,180,19, 0,0,0,0,0, tip);
- }
- }
- }
-
- uiBlockEndAlign(block);
-}
-
-void particle_edit_buttons(uiBlock *block)
-{
- Object *ob=OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEditSettings *pset = PE_settings();
- ParticleEdit *edit;
- uiBut *but;
- short butx=10,buty=150,butw=150,buth=20, lastbuty;
- static short partact;
-
- char *menustr;
-
- if(psys==NULL) return;
-
- menustr = psys_menu_string(ob, 0);
- partact = PE_get_current_num(ob)+1;
-
- but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr, 160,180,butw,buth, &partact, 14.0, 0.0, 0, 0, "Browse systems");
- uiButSetFunc(but, PE_change_act, ob, &partact);
-
- MEM_freeN(menustr);
-
- if(psys->edit) {
- edit= psys->edit;
-
- /* brushes (the update evend needs to be B_BAKE_RECACHE so that path colors are updated properly) */
- uiBlockBeginAlign(block);
- uiDefButS(block,ROW,B_BAKE_RECACHE,"None",butx,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_NONE,0,0,"Disable brush");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Comb",butx+75,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_COMB,0,0,"Comb hairs");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Smooth",butx+150,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_SMOOTH,0,0,"Smooth hairs");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Weight",butx+225,buty,75,19,&pset->brushtype,14,PE_BRUSH_WEIGHT,0,0,"Weight hairs");
- buty-= buth;
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Add", butx,buty,75,19,&pset->brushtype,14,PE_BRUSH_ADD,0,0,"Add hairs");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Length", butx+75,buty,75,19,&pset->brushtype,14, PE_BRUSH_LENGTH,0,0,"Make hairs longer or shorter");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Puff", butx+150,buty,75,19,&pset->brushtype,14, PE_BRUSH_PUFF,0,0,"Make hairs stand up");
- uiDefButS(block,ROW,B_BAKE_RECACHE,"Cut", butx+225,buty,75,19,&pset->brushtype,14, PE_BRUSH_CUT,0,0,"Cut hairs");
- uiBlockEndAlign(block);
-
- buty-= 10;
- lastbuty= buty;
-
- /* brush options */
- if(pset->brushtype>=0) {
- ParticleBrushData *brush= &pset->brush[pset->brushtype];
-
- butw= 180;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Size:", butx,(buty-=buth),butw,buth, &brush->size, 1.0, 100.0, 1, 1, "Brush size");
- uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Strength:", butx,(buty-=buth),butw,buth, &brush->strength, 1.0, 100.0, 1, 1, "Brush strength");
-
- if(ELEM(pset->brushtype, PE_BRUSH_LENGTH, PE_BRUSH_PUFF)) {
- char *str1, *str2, *tip1, *tip2;
-
- if(pset->brushtype == PE_BRUSH_LENGTH) {
- str1= "Grow"; tip1= "Make hairs longer [Shift]";
- str2= "Shrink"; tip2= "Make hairs shorter [Shift]";
- }
- else /*if(pset->brushtype == PE_BRUSH_PUFF)*/ {
- str1= "Add"; tip1= "Make hair more puffy [Shift]";
- str2= "Sub"; tip2= "Make hair less puffy [Shift]";
- }
-
- uiDefButS(block,ROW,B_NOP,str1, butx,(buty-=buth),butw/2,buth,&brush->invert,0.0,0.0,0, 0,tip1);
- uiDefButS(block,ROW,B_NOP,str2, butx+butw/2,buty,butw/2,buth,&brush->invert,0.0,1.0,0, 0,tip2);
- }
- uiBlockEndAlign(block);
-
- butx += butw+10;
- buty= lastbuty;
- butw= 110;
-
- if(pset->brushtype==PE_BRUSH_ADD) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PE_INTERPOLATE_ADDED, B_BAKE_REDRAWEDIT, "Interpolate", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Interpolate new particles from the existing ones");
- uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Step:", butx,(buty-=buth),butw,buth, &brush->step, 1.0, 50.0, 1, 1, "Brush step");
- uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Keys:", butx,(buty-=buth),butw,buth, &pset->totaddkey, 2.0, 20.0, 1, 1, "How many keys to make new particles with");
- uiBlockEndAlign(block);
- }
- }
-
- /* keep options */
- butw= 150;
- butx= 10;
- buty= lastbuty - (buth*3 + 10);
- lastbuty= buty;
-
- uiDefBut(block, LABEL, 0, "Keep", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PE_KEEP_LENGTHS, B_BAKE_REDRAWEDIT, "Lengths", butx,(buty-=buth),butw/2,buth, &pset->flag, 0, 0, 0, 0, "Keep path lengths constant");
- uiDefButBitS(block, TOG, PE_LOCK_FIRST, B_BAKE_REDRAWEDIT, "Root", butx+butw/2,buty,butw/2,buth, &pset->flag, 0, 0, 0, 0, "Keep first keys unmodified");
- uiBlockEndAlign(block);
-
- buty -= 5;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PE_DEFLECT_EMITTER, B_BAKE_REDRAWEDIT, "Deflect Emitter", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Keep paths from intersecting the emitter");
- uiDefButF(block, NUM, B_BAKE_REDRAWEDIT, "Dist:", butx,(buty-=buth),butw,buth, &pset->emitterdist, 0.0, 10.0, 1, 1, "Distance from emitter");
- uiBlockEndAlign(block);
-
- buty= lastbuty;
- butx += butw+10;
- butw -= 10;
-
- uiDefBut(block, LABEL, 0, "Draw", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUMSLI, B_BAKE_RECACHE, "Steps:", butx,(buty-=buth),butw,buth, &psys->part->draw_step, 0.0, 10.0, 1, 1, "Drawing accuracy of paths");
- uiBlockEndAlign(block);
-
- buty -= 5;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PE_SHOW_TIME, B_BAKE_REDRAWEDIT, "Show Time", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Show time values of the baked keys");
- uiDefButBitS(block, TOG, PE_SHOW_CHILD, B_BAKE_RECACHE, "Show Children", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Show child particles in particle mode");
- uiBlockEndAlign(block);
- }
- else{
- uiDefBut(block, LABEL, 0, "System isn't editable", butx,(buty-=buth),250,buth, NULL, 0.0, 0, 0, 0, "");
- }
-}
-/* this is a mode context sensitive system */
-
-void editing_panels()
-{
- Object *ob;
- Curve *cu;
- MetaBall *mb;
- Lattice *lt;
- bArmature *arm;
- Camera *cam;
-
- ob= OBACT;
- if(ob==NULL) return;
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- switch(ob->type) {
- case OB_MESH:
- editing_panel_links(ob);
- editing_panel_mesh_type(ob, ob->data);
- editing_panel_modifiers(ob);
- editing_panel_shapes(ob);
- editing_panel_mesh_multires();
- /* modes */
- if(G.obedit) {
- editing_panel_mesh_tools(ob, ob->data);
- editing_panel_mesh_tools1(ob, ob->data);
- uiNewPanelTabbed("Mesh Tools 1", "Editing");
-
- #ifdef WITH_BF_REEB
- editing_panel_mesh_skgen(ob, ob->data);
- editing_panel_mesh_skgen_retarget(ob, ob->data);
- editing_panel_mesh_skgen_display(ob, ob->data);
- #endif
-
- editing_panel_mesh_uvautocalculation();
- if (EM_texFaceCheck())
- editing_panel_mesh_texface();
- }
- else if(G.f & G_SCULPTMODE) {
- uiNewPanelTabbed("Multires", "Editing");
- editing_panel_sculpting_tools();
- uiNewPanelTabbed("Multires", "Editing");
- editing_panel_sculpting_brush();
- uiNewPanelTabbed("Multires", "Editing");
- editing_panel_sculpting_textures();
- } else {
- if(G.f & (G_VERTEXPAINT | G_TEXTUREPAINT | G_WEIGHTPAINT) ) {
- editing_panel_mesh_paint();
- }
- }
- break;
-
- case OB_CURVE:
- case OB_SURF:
- cu= ob->data;
- editing_panel_links(ob);
- editing_panel_curve_type(ob, cu);
- editing_panel_modifiers(ob);
-// editing_panel_shapes(ob); /* there are some backend things that are not ready for this yet */
- if(G.obedit) {
- editing_panel_curve_tools(ob, cu);
- editing_panel_curve_tools1(ob, cu);
- }
- break;
-
- case OB_MBALL:
- mb= ob->data;
- editing_panel_links(ob);
- editing_panel_mball_type(ob, mb);
- if(G.obedit) {
- editing_panel_mball_tools(ob, mb);
- }
- break;
-
- case OB_FONT:
- cu= ob->data;
- editing_panel_links(ob);
- editing_panel_curve_type(ob, cu);
- editing_panel_font_type(ob, cu);
-
-#ifdef INTERNATIONAL
- if(G.obedit)
- {
- editing_panel_char_type(ob, cu);
- }
-#endif
- editing_panel_modifiers(ob);
- break;
-
- case OB_LATTICE:
- lt= ob->data;
- editing_panel_links(ob);
- editing_panel_lattice_type(ob, lt);
- editing_panel_modifiers(ob);
- editing_panel_shapes(ob);
- break;
-
- case OB_LAMP:
- editing_panel_links(ob);
- break;
-
- case OB_EMPTY:
- editing_panel_links(ob);
- break;
-
- case OB_CAMERA:
- cam= ob->data;
- editing_panel_links(ob); // no editmode!
- editing_panel_camera_type(ob, cam);
- /* yafray: extra panel for dof parameters */
- if (G.scene->r.renderer==R_YAFRAY) editing_panel_camera_yafraydof(ob, cam);
- break;
-
- case OB_ARMATURE:
- arm= ob->data;
- editing_panel_links(ob); // no editmode!
- editing_panel_armature_type(ob, arm);
- if(G.obedit) {
- editing_panel_armature_bones(ob, arm);
- }
- else if(ob->flag & OB_POSEMODE) {
- editing_panel_armature_visuals(ob, arm);
- editing_panel_pose_bones(ob, arm);
- object_panel_constraint("Editing");
- }
- break;
- }
- uiClearButLock();
-}
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
deleted file mode 100644
index 8aca111f41f..00000000000
--- a/source/blender/src/buttons_logic.c
+++ /dev/null
@@ -1,3822 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_material_types.h"
-#include "DNA_sensor_types.h"
-#include "DNA_actuator_types.h"
-#include "DNA_controller_types.h"
-#include "DNA_property_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_text_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_library.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_sca.h"
-#include "BKE_property.h"
-#include "BKE_property.h"
-#include "BKE_utildefines.h"
-#include "BKE_bullet.h"
-
-#include "BIF_gl.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_interface.h"
-#include "BIF_butspace.h"
-#include "BIF_screen.h"
-#include "BIF_keyval.h"
-#include "BIF_editsound.h"
-
-#include "BIF_editsca.h"
-
-
-#include "BDR_editcurve.h"
-#include "BDR_editobject.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_filesel.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "nla.h" /* For __NLA : Important, do not remove */
-#include "butspace.h" // own module
-#include "interface.h"
-
-/* internals */
-static void buttons_enji(uiBlock *, Object *);
-static void buttons_ketsji(uiBlock *, Object *);
-static void buttons_bullet(uiBlock *, Object *);
-
-/****/
-
-static ID **get_selected_and_linked_obs(short *count, short scavisflag);
-static char *actuator_pup(Object *owner);
-
-/****/
-
-
-static void del_property(void *selpropv, void *data2_unused)
-{
- bProperty *prop, *selprop= selpropv;
- Object *ob;
- int a=0;
-
- ob= OBACT;
- if(ob==NULL) return;
-
- prop= ob->prop.first;
- while(prop) {
- if(prop==selprop) {
- if (strcmp(prop->name,"Text") == 0) {
- allqueue(REDRAWVIEW3D, 0);
- }
- BLI_remlink(&ob->prop, prop);
- free_property(prop);
- break;
- }
- a++;
- prop= prop->next;
- }
- BIF_undo_push("Delete property");
- allqueue(REDRAWBUTSLOGIC, 0);
-
-}
-
-static int vergname(const void *v1, const void *v2)
-{
- char **x1, **x2;
-
- x1= (char **)v1;
- x2= (char **)v2;
-
- return strcmp(*x1, *x2);
-}
-
-void make_unique_prop_names(char *str)
-{
- Object *ob;
- bProperty *prop;
- bSensor *sens;
- bController *cont;
- bActuator *act;
- ID **idar;
- short a, obcount, propcount=0, nr;
- char **names;
-
- /* this function is called by a Button, and gives the current
- * stringpointer as an argument, this is the one that can change
- */
-
- idar= get_selected_and_linked_obs(&obcount, BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_CONT_SEL|BUTS_CONT_ACT);
-
- /* for each object, make properties and sca names unique */
-
- /* count total names */
- for(a=0; a<obcount; a++) {
- ob= (Object *)idar[a];
- propcount+= BLI_countlist(&ob->prop);
- propcount+= BLI_countlist(&ob->sensors);
- propcount+= BLI_countlist(&ob->controllers);
- propcount+= BLI_countlist(&ob->actuators);
- }
- if(propcount==0) {
- if(idar) MEM_freeN(idar);
- return;
- }
-
- /* make names array for sorting */
- names= MEM_callocN(propcount*sizeof(void *), "names");
-
- /* count total names */
- nr= 0;
- for(a=0; a<obcount; a++) {
- ob= (Object *)idar[a];
- prop= ob->prop.first;
- while(prop) {
- names[nr++]= prop->name;
- prop= prop->next;
- }
- sens= ob->sensors.first;
- while(sens) {
- names[nr++]= sens->name;
- sens= sens->next;
- }
- cont= ob->controllers.first;
- while(cont) {
- names[nr++]= cont->name;
- cont= cont->next;
- }
- act= ob->actuators.first;
- while(act) {
- names[nr++]= act->name;
- act= act->next;
- }
- }
-
- qsort(names, propcount, sizeof(void *), vergname);
-
- /* now we check for double names, and change them */
-
- for(nr=0; nr<propcount; nr++) {
- if(names[nr]!=str && strcmp( names[nr], str )==0 ) {
- BLI_newname(str, +1);
- }
- }
-
- MEM_freeN(idar);
- MEM_freeN(names);
-}
-
-static void make_unique_prop_names_cb(void *strv, void *redraw_view3d_flagv)
-{
- char *str= strv;
- int redraw_view3d_flag= GET_INT_FROM_POINTER(redraw_view3d_flagv);
-
- make_unique_prop_names(str);
- if (redraw_view3d_flag) allqueue(REDRAWVIEW3D, 0);
-}
-
-static void sca_move_sensor(void *datav, void *data2_unused)
-{
- bSensor *sens_to_delete= datav;
- int val;
- Base *base;
- bSensor *sens, *tmp;
-
- val= pupmenu("Move up%x1|Move down %x2");
-
- if(val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while(base) {
-
- sens= base->object->sensors.first;
- while(sens) {
- if(sens == sens_to_delete) break;
- sens= sens->next;
- }
-
- if(sens) {
- if( val==1 && sens->prev) {
- for (tmp=sens->prev; tmp; tmp=tmp->prev) {
- if (tmp->flag & SENS_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->sensors, sens);
- BLI_insertlinkbefore(&base->object->sensors, tmp, sens);
- }
- }
- else if( val==2 && sens->next) {
- for (tmp=sens->next; tmp; tmp=tmp->next) {
- if (tmp->flag & SENS_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->sensors, sens);
- BLI_insertlink(&base->object->sensors, tmp, sens);
- }
- }
- BIF_undo_push("Move sensor");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
- }
-
- base= base->next;
- }
- }
-}
-
-static void sca_move_controller(void *datav, void *data2_unused)
-{
- bController *controller_to_del= datav;
- int val;
- Base *base;
- bController *cont, *tmp;
-
- val= pupmenu("Move up%x1|Move down %x2");
-
- if(val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while(base) {
-
- cont= base->object->controllers.first;
- while(cont) {
- if(cont == controller_to_del) break;
- cont= cont->next;
- }
-
- if(cont) {
- if( val==1 && cont->prev) {
- /* locate the controller that has the same state mask but is earlier in the list */
- tmp = cont->prev;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
- break;
- tmp = tmp->prev;
- }
- if (tmp) {
- BLI_remlink(&base->object->controllers, cont);
- BLI_insertlinkbefore(&base->object->controllers, tmp, cont);
- }
- }
- else if( val==2 && cont->next) {
- tmp = cont->next;
- while(tmp) {
- if(tmp->state_mask & cont->state_mask)
- break;
- tmp = tmp->next;
- }
- BLI_remlink(&base->object->controllers, cont);
- BLI_insertlink(&base->object->controllers, tmp, cont);
- }
- BIF_undo_push("Move controller");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
- }
-
- base= base->next;
- }
- }
-}
-
-static void sca_move_actuator(void *datav, void *data2_unused)
-{
- bActuator *actuator_to_move= datav;
- int val;
- Base *base;
- bActuator *act, *tmp;
-
- val= pupmenu("Move up%x1|Move down %x2");
-
- if(val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while(base) {
-
- act= base->object->actuators.first;
- while(act) {
- if(act == actuator_to_move) break;
- act= act->next;
- }
-
- if(act) {
- if( val==1 && act->prev) {
- /* locate the first visible actuators before this one */
- for (tmp = act->prev; tmp; tmp=tmp->prev) {
- if (tmp->flag & ACT_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->actuators, act);
- BLI_insertlinkbefore(&base->object->actuators, tmp, act);
- }
- }
- else if( val==2 && act->next) {
- for (tmp=act->next; tmp; tmp=tmp->next) {
- if (tmp->flag & ACT_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->actuators, act);
- BLI_insertlink(&base->object->actuators, tmp, act);
- }
- }
- BIF_undo_push("Move actuator");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
- }
-
- base= base->next;
- }
- }
-}
-
-void do_logic_buts(unsigned short event)
-{
- bProperty *prop;
- bSensor *sens;
- bController *cont;
- bActuator *act;
- Object *ob;
- int didit, bit;
-
- ob= OBACT;
- if(ob==0) return;
-
- switch(event) {
-
- case B_SETSECTOR:
- /* check for inconsistant types */
- ob->gameflag &= ~(OB_PROP|OB_MAINACTOR|OB_DYNAMIC|OB_ACTOR);
- ob->dtx |= OB_BOUNDBOX;
- allqueue(REDRAWBUTSGAME, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_SETPROP:
- /* check for inconsistant types */
- ob->gameflag &= ~(OB_SECTOR|OB_MAINACTOR|OB_DYNAMIC|OB_ACTOR);
- allqueue(REDRAWBUTSGAME, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_SETACTOR:
- case B_SETDYNA:
- case B_SETMAINACTOR:
- ob->gameflag &= ~(OB_SECTOR|OB_PROP);
- allqueue(REDRAWBUTSGAME, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
-
- case B_ADD_PROP:
- prop= new_property(PROP_FLOAT);
- make_unique_prop_names(prop->name);
- BLI_addtail(&ob->prop, prop);
- BIF_undo_push("Add property");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_CHANGE_PROP:
- prop= ob->prop.first;
- while(prop) {
- if(prop->type!=prop->otype) {
- init_property(prop);
- if (strcmp(prop->name, "Text") == 0) {
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- prop= prop->next;
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_ADD_SENS:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDSENS) {
- ob->scaflag &= ~OB_ADDSENS;
- sens= new_sensor(SENS_ALWAYS);
- BLI_addtail(&(ob->sensors), sens);
- make_unique_prop_names(sens->name);
- ob->scaflag |= OB_SHOWSENS;
- }
- }
-
- BIF_undo_push("Add sensor");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_CHANGE_SENS:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- sens= ob->sensors.first;
- while(sens) {
- if(sens->type != sens->otype) {
- init_sensor(sens);
- sens->otype= sens->type;
- break;
- }
- sens= sens->next;
- }
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_DEL_SENS:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- sens= ob->sensors.first;
- while(sens) {
- if(sens->flag & SENS_DEL) {
- BLI_remlink(&(ob->sensors), sens);
- free_sensor(sens);
- break;
- }
- sens= sens->next;
- }
- }
- BIF_undo_push("Delete sensor");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_ADD_CONT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDCONT) {
- ob->scaflag &= ~OB_ADDCONT;
- cont= new_controller(CONT_LOGIC_AND);
- make_unique_prop_names(cont->name);
- ob->scaflag |= OB_SHOWCONT;
- BLI_addtail(&(ob->controllers), cont);
- /* set the controller state mask from the current object state.
- A controller is always in a single state, so select the lowest bit set
- from the object state */
- for (bit=0; bit<32; bit++) {
- if (ob->state & (1<<bit))
- break;
- }
- cont->state_mask = (1<<bit);
- if (cont->state_mask == 0) {
- /* shouldn't happen, object state is never 0 */
- cont->state_mask = 1;
- }
- }
- }
- BIF_undo_push("Add controller");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_SET_STATE_BIT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_SETSTBIT) {
- ob->scaflag &= ~OB_SETSTBIT;
- ob->state = 0x3FFFFFFF;
- }
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_INIT_STATE_BIT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_INITSTBIT) {
- ob->scaflag &= ~OB_INITSTBIT;
- ob->state = ob->init_state;
- if (!ob->state)
- ob->state = 1;
- }
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_CHANGE_CONT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- cont= ob->controllers.first;
- while(cont) {
- if(cont->type != cont->otype) {
- init_controller(cont);
- cont->otype= cont->type;
- break;
- }
- cont= cont->next;
- }
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
-
- case B_DEL_CONT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- cont= ob->controllers.first;
- while(cont) {
- if(cont->flag & CONT_DEL) {
- BLI_remlink(&(ob->controllers), cont);
- unlink_controller(cont);
- free_controller(cont);
- break;
- }
- cont= cont->next;
- }
- }
- BIF_undo_push("Delete controller");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_ADD_ACT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->scaflag & OB_ADDACT) {
- ob->scaflag &= ~OB_ADDACT;
- act= new_actuator(ACT_OBJECT);
- make_unique_prop_names(act->name);
- BLI_addtail(&(ob->actuators), act);
- ob->scaflag |= OB_SHOWACT;
- }
- }
- BIF_undo_push("Add actuator");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_CHANGE_ACT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- act= ob->actuators.first;
- while(act) {
- if(act->type != act->otype) {
- init_actuator(act);
- act->otype= act->type;
- break;
- }
- act= act->next;
- }
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_DEL_ACT:
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- act= ob->actuators.first;
- while(act) {
- if(act->flag & ACT_DEL) {
- BLI_remlink(&(ob->actuators), act);
- unlink_actuator(act);
- free_actuator(act);
- break;
- }
- act= act->next;
- }
- }
- BIF_undo_push("Delete actuator");
- allqueue(REDRAWBUTSLOGIC, 0);
- break;
-
- case B_SOUNDACT_BROWSE:
- /* since we don't know which... */
- didit= 0;
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- act= ob->actuators.first;
- while(act)
- {
- if(act->type==ACT_SOUND)
- {
- bSoundActuator *sa= act->data;
- if(sa->sndnr)
- {
- bSound *sound= G.main->sound.first;
- int nr= 1;
-
- if(sa->sndnr == -2) {
- activate_databrowse((ID *)G.main->sound.first, ID_SO, 0, B_SOUNDACT_BROWSE,
- &sa->sndnr, do_logic_buts);
- break;
- }
-
- while(sound)
- {
- if(nr==sa->sndnr)
- break;
- nr++;
- sound= sound->id.next;
- }
-
- if(sa->sound)
- sa->sound->id.us--;
-
- sa->sound= sound;
-
- if(sound)
- sound->id.us++;
-
- sa->sndnr= 0;
- didit= 1;
- }
- }
- act= act->next;
- }
- if(didit)
- break;
- }
- allqueue(REDRAWBUTSLOGIC, 0);
- allqueue(REDRAWSOUND, 0);
-
- break;
- }
-}
-
-
-static char *sensor_name(int type)
-{
- switch (type) {
- case SENS_ALWAYS:
- return "Always";
- case SENS_TOUCH:
- return "Touch";
- case SENS_NEAR:
- return "Near";
- case SENS_KEYBOARD:
- return "Keyboard";
- case SENS_PROPERTY:
- return "Property";
- case SENS_ACTUATOR:
- return "Actuator";
- case SENS_DELAY:
- return "Delay";
- case SENS_MOUSE:
- return "Mouse";
- case SENS_COLLISION:
- return "Collision";
- case SENS_RADAR:
- return "Radar";
- case SENS_RANDOM:
- return "Random";
- case SENS_RAY:
- return "Ray";
- case SENS_MESSAGE:
- return "Message";
- case SENS_JOYSTICK:
- return "Joystick";
- }
- return "unknown";
-}
-
-static char *sensor_pup(void)
-{
- /* the number needs to match defines in game.h */
- return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|"
- "Touch %x1|Collision %x6|Near %x2|Radar %x7|"
- "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12";
-}
-
-static char *controller_name(int type)
-{
- switch (type) {
- case CONT_LOGIC_AND:
- return "AND";
- case CONT_LOGIC_OR:
- return "OR";
- case CONT_LOGIC_NAND:
- return "NAND";
- case CONT_LOGIC_NOR:
- return "NOR";
- case CONT_LOGIC_XOR:
- return "XOR";
- case CONT_LOGIC_XNOR:
- return "XNOR";
- case CONT_EXPRESSION:
- return "Expression";
- case CONT_PYTHON:
- return "Python";
- }
- return "unknown";
-}
-
-static char *controller_pup(void)
-{
- return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3";
-}
-
-static char *actuator_name(int type)
-{
- switch (type) {
- case ACT_SHAPEACTION:
- return "Shape Action";
- case ACT_ACTION:
- return "Action";
- case ACT_OBJECT:
- return "Motion";
- case ACT_IPO:
- return "Ipo";
- case ACT_LAMP:
- return "Lamp";
- case ACT_CAMERA:
- return "Camera";
- case ACT_MATERIAL:
- return "Material";
- case ACT_SOUND:
- return "Sound";
- case ACT_CD:
- return "CD";
- case ACT_PROPERTY:
- return "Property";
- case ACT_EDIT_OBJECT:
- return "Edit Object";
- case ACT_CONSTRAINT:
- return "Constraint";
- case ACT_SCENE:
- return "Scene";
- case ACT_GROUP:
- return "Group";
- case ACT_RANDOM:
- return "Random";
- case ACT_MESSAGE:
- return "Message";
- case ACT_GAME:
- return "Game";
- case ACT_VISIBILITY:
- return "Visibility";
- case ACT_2DFILTER:
- return "2D Filter";
- case ACT_PARENT:
- return "Parent";
- case ACT_STATE:
- return "State";
- }
- return "unknown";
-}
-
-
-
-
-static char *actuator_pup(Object *owner)
-{
- switch (owner->type)
- {
- case OB_ARMATURE:
- return "Actuators %t|Action %x15|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
- break;
-
- case OB_MESH:
- return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
- break;
-
- default:
- return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
- }
-}
-
-
-
-static void set_sca_ob(Object *ob)
-{
- bController *cont;
- bActuator *act;
-
- cont= ob->controllers.first;
- while(cont) {
- cont->mynew= (bController *)ob;
- cont= cont->next;
- }
- act= ob->actuators.first;
- while(act) {
- act->mynew= (bActuator *)ob;
- act= act->next;
- }
-}
-
-static ID **get_selected_and_linked_obs(short *count, short scavisflag)
-{
- Base *base;
- Object *ob, *obt;
- ID **idar;
- bSensor *sens;
- bController *cont;
- unsigned int lay;
- int a, nr, doit;
-
- /* we need a sorted object list */
- /* set scavisflags flags in Objects to indicate these should be evaluated */
- /* also hide ob pointers in ->new entries of controllerss/actuators */
-
- *count= 0;
-
- if(G.scene==NULL) return NULL;
-
- ob= G.main->object.first;
- while(ob) {
- ob->scavisflag= 0;
- set_sca_ob(ob);
- ob= ob->id.next;
- }
-
- if(G.vd) lay= G.vd->lay;
- else lay= G.scene->lay;
-
- base= FIRSTBASE;
- while(base) {
- if(base->lay & lay) {
- if(base->flag & SELECT) {
- if(scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS;
- if(scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT;
- if(scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT;
- }
- }
- base= base->next;
- }
-
- if(OBACT) {
- if(scavisflag & BUTS_SENS_ACT) OBACT->scavisflag |= OB_VIS_SENS;
- if(scavisflag & BUTS_CONT_ACT) OBACT->scavisflag |= OB_VIS_CONT;
- if(scavisflag & BUTS_ACT_ACT) OBACT->scavisflag |= OB_VIS_ACT;
- }
-
- /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */
- if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) {
- doit= 1;
- while(doit) {
- doit= 0;
-
- ob= G.main->object.first;
- while(ob) {
-
- /* 1st case: select sensor when controller selected */
- if((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) {
- sens= ob->sensors.first;
- while(sens) {
- for(a=0; a<sens->totlinks; a++) {
- if(sens->links[a]) {
- obt= (Object *)sens->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_CONT)) {
- doit= 1;
- ob->scavisflag |= OB_VIS_SENS;
- break;
- }
- }
- }
- if(doit) break;
- sens= sens->next;
- }
- }
-
- /* 2nd case: select cont when act selected */
- if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) {
- cont= ob->controllers.first;
- while(cont) {
- for(a=0; a<cont->totlinks; a++) {
- if(cont->links[a]) {
- obt= (Object *)cont->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_ACT)) {
- doit= 1;
- ob->scavisflag |= OB_VIS_CONT;
- break;
- }
- }
- }
- if(doit) break;
- cont= cont->next;
- }
- }
-
- /* 3rd case: select controller when sensor selected */
- if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) {
- sens= ob->sensors.first;
- while(sens) {
- for(a=0; a<sens->totlinks; a++) {
- if(sens->links[a]) {
- obt= (Object *)sens->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_CONT)==0) {
- doit= 1;
- obt->scavisflag |= OB_VIS_CONT;
- }
- }
- }
- sens= sens->next;
- }
- }
-
- /* 4th case: select actuator when controller selected */
- if( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) {
- cont= ob->controllers.first;
- while(cont) {
- for(a=0; a<cont->totlinks; a++) {
- if(cont->links[a]) {
- obt= (Object *)cont->links[a]->mynew;
- if(obt && (obt->scavisflag & OB_VIS_ACT)==0) {
- doit= 1;
- obt->scavisflag |= OB_VIS_ACT;
- }
- }
- }
- cont= cont->next;
- }
-
- }
- ob= ob->id.next;
- }
- }
- }
-
- /* now we count */
- ob= G.main->object.first;
- while(ob) {
- if( ob->scavisflag ) (*count)++;
- ob= ob->id.next;
- }
-
- if(*count==0) return NULL;
- if(*count>24) *count= 24; /* temporal */
-
- idar= MEM_callocN( (*count)*sizeof(void *), "idar");
-
- ob= G.main->object.first;
- nr= 0;
- while(ob) {
- if( ob->scavisflag ) {
- idar[nr]= (ID *)ob;
- nr++;
- }
- if(nr>=24) break;
- ob= ob->id.next;
- }
-
- /* just to be sure... these were set in set_sca_done_ob() */
- clear_sca_new_poins();
-
- return idar;
-}
-
-
-static int get_col_sensor(int type)
-{
- switch(type) {
- case SENS_ALWAYS: return TH_BUT_ACTION;
- case SENS_DELAY: return TH_BUT_ACTION;
- case SENS_TOUCH: return TH_BUT_NEUTRAL;
- case SENS_COLLISION: return TH_BUT_SETTING;
- case SENS_NEAR: return TH_BUT_SETTING1;
- case SENS_KEYBOARD: return TH_BUT_SETTING2;
- case SENS_PROPERTY: return TH_BUT_NUM;
- case SENS_ACTUATOR: return TH_BUT_NUM;
- case SENS_MOUSE: return TH_BUT_TEXTFIELD;
- case SENS_RADAR: return TH_BUT_POPUP;
- case SENS_RANDOM: return TH_BUT_NEUTRAL;
- case SENS_RAY: return TH_BUT_SETTING1;
- case SENS_MESSAGE: return TH_BUT_SETTING2;
- case SENS_JOYSTICK: return TH_BUT_NEUTRAL;
- default: return TH_BUT_NEUTRAL;
- }
-}
-static void set_col_sensor(int type, int medium)
-{
- int col= get_col_sensor(type);
- BIF_ThemeColorShade(col, medium?30:0);
-}
-
-/**
- * Draws a toggle for pulse mode, a frequency field and a toggle to invert
- * the value of this sensor. Operates on the shared data block of sensors.
- */
-static void draw_default_sensor_header(bSensor *sens,
- uiBlock *block,
- short x,
- short y,
- short w)
-{
- /* Pulsing and frequency */
- uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP,
- (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19,
- &sens->pulse, 0.0, 0.0, 0, 0,
- "Activate TRUE level triggering (pulse mode)");
-
- uiDefIconButBitS(block, TOG, SENS_NEG_PULSE_MODE, 1, ICON_DOTSDOWN,
- (short)(x + 10 + 0.15 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19,
- &sens->pulse, 0.0, 0.0, 0, 0,
- "Activate FALSE level triggering (pulse mode)");
- uiDefButS(block, NUM, 1, "f:",
- (short)(x + 10 + 0.3 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19,
- &sens->freq, 0.0, 10000.0, 0, 0,
- "Delay between repeated pulses (in logic tics, 0 = no delay)");
-
- /* value or shift? */
- uiDefButS(block, TOG, 1, "Inv",
- (short)(x + 10 + 0.85 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19,
- &sens->invert, 0.0, 0.0, 0, 0,
- "Invert the level (output) of this sensor");
- uiDefButS(block, TOG, 1, "Level",
- (short)(x + 10 + 0.65 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19,
- &sens->level, 0.0, 0.0, 0, 0,
- "Level detector, trigger controllers of new states (only applicable upon logic state transition)");
-}
-
-static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname)
-{
- bNearSensor *ns = NULL;
- bTouchSensor *ts = NULL;
- bKeyboardSensor *ks = NULL;
- bPropertySensor *ps = NULL;
- bMouseSensor *ms = NULL;
- bCollisionSensor *cs = NULL;
- bRadarSensor *rs = NULL;
- bRandomSensor *randomSensor = NULL;
- bRaySensor *raySens = NULL;
- bMessageSensor *mes = NULL;
- bJoystickSensor *joy = NULL;
- bActuatorSensor *as = NULL;
- bDelaySensor *ds = NULL;
- short ysize;
- char *str;
-
- /* yco is at the top of the rect, draw downwards */
-
- uiBlockSetEmboss(block, UI_EMBOSSM);
-
- set_col_sensor(sens->type, 0);
-
- switch (sens->type)
- {
- case SENS_ALWAYS:
- {
- ysize= 24;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- yco-= ysize;
-
- break;
- }
- case SENS_TOUCH:
- {
- ysize= 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- ts= sens->data;
-
- /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, 31, 0, 0, "Only look for Objects with this property"); */
- uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
- ///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
- yco-= ysize;
- break;
- }
- case SENS_COLLISION:
- {
- ysize= 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- cs= sens->data;
-
- /* The collision sensor will become a generic collision (i.e. it */
- /* absorb the old touch sensor). */
-
- uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10),(short)(yco - 44),
- (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0,
- "Toggle collision on material or property.");
-
- if (cs->mode & SENS_COLLISION_MATERIAL) {
- uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.20 * (width-20)),
- (short)(yco-44), (short)(0.8*(width-20)), 19, &cs->materialName, 0, 31, 0, 0,
- "Only look for Objects with this material");
- } else {
- uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.20 * (width-20)), (short)(yco-44),
- (short)(0.8*(width-20)), 19, &cs->name, 0, 31, 0, 0,
- "Only look for Objects with this property");
- }
-
- /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */
-
- yco-= ysize;
- break;
- }
- case SENS_NEAR:
- {
- ysize= 72;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- ns= sens->data;
-
- uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19,
- &ns->name, 0, 31, 0, 0, "Only look for Objects with this property");
- uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19,
- &ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance");
- uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19,
- &ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance");
- yco-= ysize;
- break;
- }
- case SENS_RADAR:
- {
- ysize= 72;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- rs= sens->data;
-
- uiDefBut(block, TEX, 1, "Prop:",
- (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19,
- &rs->name, 0, 31, 0, 0,
- "Only look for Objects with this property");
-
- str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5";
- uiDefButS(block, MENU, B_REDR, str,
- (short)(10+xco+0.7 * (width-20)), (short)(yco-44), (short)(0.3 * (width-22)), 19,
- &rs->axis, 2.0, 31, 0, 0,
- "Specify along which axis the radar cone is cast.");
-
- uiDefButF(block, NUM, 1, "Ang:",
- (short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19,
- &rs->angle, 0.0, 179.9, 10, 0,
- "Opening angle of the radar cone.");
- uiDefButF(block, NUM, 1, "Dist:",
- (short)(xco+10 + (width-20)/2), (short)(yco-68), (short)((width-20)/2), 19,
- &rs->range, 0.01, 10000.0, 100, 0,
- "Depth of the radar cone");
- yco-= ysize;
- break;
- }
- case SENS_KEYBOARD:
- {
- ks= sens->data;
-
- /* 5 lines: 120 height */
- ysize= (ks->type&1) ? 96:120;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- /* header line */
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- /* part of line 1 */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- uiDefBut(block, LABEL, 0, "Key", xco, yco-44, 40, 19, NULL, 0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, 1, B_REDR, "All keys", xco+40+(width/2), yco-44, (width/2)-50, 19,
- &ks->type, 0, 0, 0, 0, "");
-
-
- if ((ks->type&1)==0) { /* is All Keys option off? */
- /* line 2: hotkey and allkeys toggle */
- uiDefKeyevtButS(block, B_DIFF, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code");
-
- /* line 3: two key modifyers (qual1, qual2) */
- uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, "");
- uiDefKeyevtButS(block, B_DIFF, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code");
- uiDefKeyevtButS(block, B_DIFF, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code");
- }
-
- /* line 4: toggle property for string logging mode */
- uiDefBut(block, TEX, 1, "LogToggle: ",
- xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19,
- ks->toggleName, 0, 31, 0, 0,
- "Property that indicates whether to log "
- "keystrokes as a string.");
-
- /* line 5: target property for string logging mode */
- uiDefBut(block, TEX, 1, "Target: ",
- xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19,
- ks->targetName, 0, 31, 0, 0,
- "Property that receives the keystrokes in case "
- "a string is logged.");
-
- yco-= ysize;
- break;
- }
- case SENS_PROPERTY:
- {
- ysize= 96;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize,
- (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- ps= sens->data;
-
- str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3";
- /* str= "Type %t|Equal %x0|Not Equal %x1"; */
- uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19,
- &ps->type, 0, 31, 0, 0, "Type");
-
- if (ps->type != SENS_PROP_EXPRESSION)
- {
- uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19,
- ps->name, 0, 31, 0, 0, "Property name");
- }
-
- if(ps->type == SENS_PROP_INTERVAL)
- {
- uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19,
- ps->value, 0, 31, 0, 0, "check for min value");
- uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
- ps->maxvalue, 0, 31, 0, 0, "check for max value");
- }
- else if(ps->type == SENS_PROP_CHANGED);
- else
- {
- uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
- ps->value, 0, 31, 0, 0, "check for value");
- }
-
- yco-= ysize;
- break;
- }
- case SENS_ACTUATOR:
- {
- ysize= 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize,
- (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- as= sens->data;
-
- uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19,
- as->name, 0, 31, 0, 0, "Actuator name, actuator active state modifications will be detected");
- yco-= ysize;
- break;
- }
- case SENS_DELAY:
- {
- ysize= 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize,
- (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- ds = sens->data;
-
- uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19,
- &ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of logic tics before the positive trigger (default 60 per second)");
- uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19,
- &ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
- uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44),
- (short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0,
- "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics");
- yco-= ysize;
- break;
- }
- case SENS_MOUSE:
- {
- ms= sens->data;
- /* Two lines: 48 pixels high. */
- ysize = 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- /* line 1: header */
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- /* Line 2: type selection. The number are a bit mangled to get
- * proper compatibility with older .blend files. */
- str= "Type %t|Left button %x1|Middle button %x2|"
- "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19,
- &ms->type, 0, 31, 0, 0,
- "Specify the type of event this mouse sensor should trigger on.");
-
- yco-= ysize;
- break;
- }
- case SENS_RANDOM:
- {
- ysize = 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- randomSensor = sens->data;
- /* some files were wrongly written, avoid crash now */
- if (randomSensor)
- {
- uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19,
- &randomSensor->seed, 0, 1000, 0, 0,
- "Initial seed of the generator. (Choose 0 for not random)");
- }
- yco-= ysize;
- break;
- }
- case SENS_RAY:
- {
- ysize = 72;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- draw_default_sensor_header(sens, block, xco, yco, width);
- raySens = sens->data;
-
- /* 1. property or material */
- uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",
- xco + 10,yco - 44, 0.20 * (width-20), 19,
- &raySens->mode, 0.0, 0.0, 0, 0,
- "Toggle collision on material or property.");
-
- if (raySens->mode & SENS_COLLISION_MATERIAL)
- {
- uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
- &raySens->matname, 0, 31, 0, 0,
- "Only look for Objects with this material");
- }
- else
- {
- uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
- &raySens->propname, 0, 31, 0, 0,
- "Only look for Objects with this property");
- }
-
- /* X-Ray option */
- uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X",
- xco + 10,yco - 68, 0.10 * (width-20), 19,
- &raySens->mode, 0.0, 0.0, 0, 0,
- "Toggle X-Ray option (see through objects that don't have the property)");
- /* 2. sensing range */
- uiDefButF(block, NUM, 1, "Range", xco+10 + 0.10 * (width-20), yco-68, 0.5 * (width-20), 19,
- &raySens->range, 0.01, 10000.0, 100, 0,
- "Sense objects no farther than this distance");
-
- /* 3. axis choice */
- str = "Type %t|+ X axis %x1|+ Y axis %x0|+ Z axis %x2|- X axis %x3|- Y axis %x4|- Z axis %x5";
- uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
- &raySens->axisflag, 2.0, 31, 0, 0,
- "Specify along which axis the ray is cast.");
-
- yco-= ysize;
- break;
- }
- case SENS_MESSAGE:
- {
- mes = sens->data;
- ysize = 2 * 24; /* total number of lines * 24 pixels/line */
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize,
- (float)xco+width, (float)yco, 1);
-
- /* line 1: header line */
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- /* line 2: Subject filter */
- uiDefBut(block, TEX, 1, "Subject: ",
- (xco+10), (yco-44), (width-20), 19,
- mes->subject, 0, 31, 0, 0,
- "Optional subject filter: only accept messages with this subject"
- ", or empty for all");
-
- yco -= ysize;
- break;
- }
- case SENS_JOYSTICK:
- {
-
- ysize = 72;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- /* line 1: header */
- draw_default_sensor_header(sens, block, xco, yco, width);
-
- joy= sens->data;
-
- uiDefButC(block, NUM, 1, "Index:", xco+10, yco-44, 0.33 * (width-20), 19,
- &joy->joyindex, 0, SENS_JOY_MAXINDEX-1, 100, 0,
- "Specify which joystick to use");
-
- str= "Type %t|Button %x0|Axis %x1|Hat%x2";
- uiDefButC(block, MENU, B_REDR, str, xco+87, yco-44, 0.26 * (width-20), 19,
- &joy->type, 0, 31, 0, 0,
- "The type of event this joystick sensor is triggered on.");
-
- if (joy->flag & SENS_JOY_ANY_EVENT) {
- switch (joy->type) {
- case SENS_JOY_AXIS:
- str = "All Axis Events";
- break;
- case SENS_JOY_BUTTON:
- str = "All Button Events";
- break;
- default:
- str = "All Hat Events";
- break;
- }
- } else {
- str = "All";
- }
-
- uiDefButBitS(block, TOG, SENS_JOY_ANY_EVENT, B_REDR, str,
- xco+10 + 0.475 * (width-20), yco-68, ((joy->flag & SENS_JOY_ANY_EVENT) ? 0.525 : 0.12) * (width-20), 19,
- &joy->flag, 0, 0, 0, 0,
- "Triggered by all events on this joysticks current type (axis/button/hat)");
-
- if(joy->type == SENS_JOY_BUTTON)
- {
- if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
- uiDefButI(block, NUM, 1, "Number:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
- &joy->button, 0, 18, 100, 0,
- "Specify which button to use");
- }
- }
- else if(joy->type == SENS_JOY_AXIS)
- {
- uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
- &joy->axis, 1, 2.0, 100, 0,
- "Specify which axis pair to use, 1 is useually the main direction input.");
-
- uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
- &joy->precision, 0, 32768.0, 100, 0,
- "Specify the precision of the axis");
-
- if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
- str = "Type %t|Up Axis %x1 |Down Axis %x3|Left Axis %x2|Right Axis %x0";
- uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
- &joy->axisf, 2.0, 31, 0, 0,
- "The direction of the axis, use 'All Events' to recieve events on any direction");
- }
- }
- else
- {
- uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
- &joy->hat, 1, 2.0, 100, 0,
- "Specify which hat to use");
-
- if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
- uiDefButI(block, NUM, 1, "Direction:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
- &joy->hatf, 0, 12, 100, 0,
- "Specify hat direction");
- }
- }
- yco-= ysize;
- break;
- }
- }
-
- uiBlockSetEmboss(block, UI_EMBOSSM);
- uiBlockSetCol(block, TH_AUTO);
-
- return yco-4;
-}
-
-
-
-static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco, short yco, short width)
-{
- bExpressionCont *ec;
- bPythonCont *pc;
- short ysize;
-
- uiBlockSetEmboss(block, UI_EMBOSSM);
-
- switch (cont->type) {
- case CONT_EXPRESSION:
- ysize= 28;
-
- BIF_ThemeColor(TH_BUT_SETTING);
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- /* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */
- ec= cont->data;
- /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */
- uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19,
- ec->str, 0, 127, 0, 0,
- "Expression");
-
- yco-= ysize;
- break;
- case CONT_PYTHON:
- ysize= 28;
-
- if(cont->data==NULL) init_controller(cont);
- pc= cont->data;
-
- BIF_ThemeColor(TH_BUT_SETTING1);
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+45,yco-24,width-90, 19, &pc->text, "");
-
- yco-= ysize;
- break;
-
- default:
- ysize= 4;
-
- BIF_ThemeColor(TH_BUT_NEUTRAL);
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- yco-= ysize;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSSM);
- uiBlockSetCol(block, TH_AUTO);
-
- return yco;
-}
-
-static int get_col_actuator(int type)
-{
- switch(type) {
- case ACT_ACTION: return TH_BUT_ACTION;
- case ACT_SHAPEACTION: return TH_BUT_ACTION;
- case ACT_OBJECT: return TH_BUT_NEUTRAL;
- case ACT_IPO: return TH_BUT_SETTING;
- case ACT_PROPERTY: return TH_BUT_SETTING1;
- case ACT_SOUND: return TH_BUT_SETTING2;
- case ACT_CD: return TH_BUT_NUM;
- case ACT_CAMERA: return TH_BUT_TEXTFIELD;
- case ACT_EDIT_OBJECT: return TH_BUT_POPUP;
- case ACT_GROUP: return TH_BUT_ACTION;
- case ACT_RANDOM: return TH_BUT_NEUTRAL;
- case ACT_SCENE: return TH_BUT_SETTING;
- case ACT_MESSAGE: return TH_BUT_SETTING1;
- case ACT_GAME: return TH_BUT_SETTING2;
- case ACT_VISIBILITY: return TH_BUT_NUM;
- case ACT_CONSTRAINT: return TH_BUT_ACTION;
- case ACT_STATE: return TH_BUT_SETTING2;
- default: return TH_BUT_NEUTRAL;
- }
-}
-static void set_col_actuator(int item, int medium)
-{
- int col= get_col_actuator(item);
- BIF_ThemeColorShade(col, medium?30:10);
-
-}
-
-static void change_object_actuator(void *act, void *arg)
-{
- bObjectActuator *oa = act;
-
- if (oa->type != oa->otype) {
- switch (oa->type) {
- case ACT_OBJECT_NORMAL:
- memset(oa, 0, sizeof(bObjectActuator));
- oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL;
- oa->type = ACT_OBJECT_NORMAL;
- break;
-
- case ACT_OBJECT_SERVO:
- memset(oa, 0, sizeof(bObjectActuator));
- oa->flag = ACT_LIN_VEL_LOCAL;
- oa->type = ACT_OBJECT_SERVO;
- oa->forcerot[0] = 30.0f;
- oa->forcerot[1] = 0.5f;
- oa->forcerot[2] = 0.0f;
- break;
- }
- }
-}
-
-static void change_ipo_actuator(void *arg1_but, void *arg2_ia)
-{
- bIpoActuator *ia = arg2_ia;
- uiBut *but = arg1_but;
-
- if (but->retval & ACT_IPOFORCE)
- ia->flag &= ~ACT_IPOADD;
- else if (but->retval & ACT_IPOADD)
- ia->flag &= ~ACT_IPOFORCE;
- but->retval = B_REDR;
-}
-
-void update_object_actuator_PID(void *act, void *arg)
-{
- bObjectActuator *oa = act;
- oa->forcerot[0] = 60.0f*oa->forcerot[1];
-}
-
-char *get_state_name(Object *ob, short bit)
-{
- bController *cont;
- unsigned int mask;
-
- mask = (1<<bit);
- cont = ob->controllers.first;
- while (cont) {
- if (cont->state_mask & mask) {
- return cont->name;
- }
- cont = cont->next;
- }
- return (char*)"";
-}
-
-static void check_state_mask(void *arg1_but, void *arg2_mask)
-{
- unsigned int *cont_mask = arg2_mask;
- uiBut *but = arg1_but;
-
- if (*cont_mask == 0 || !(G.qual & LR_SHIFTKEY))
- *cont_mask = (1<<but->retval);
- but->retval = B_REDR;
-}
-
-static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width)
-{
- bSoundActuator *sa = NULL;
- bCDActuator *cda = NULL;
- bObjectActuator *oa = NULL;
- bIpoActuator *ia = NULL;
- bPropertyActuator *pa = NULL;
- bCameraActuator *ca = NULL;
- bEditObjectActuator *eoa = NULL;
- bConstraintActuator *coa = NULL;
- bSceneActuator *sca = NULL;
- bGroupActuator *ga = NULL;
- bRandomActuator *randAct = NULL;
- bMessageActuator *ma = NULL;
- bActionActuator *aa = NULL;
- bGameActuator *gma = NULL;
- bVisibilityActuator *visAct = NULL;
- bTwoDFilterActuator *tdfa = NULL;
- bParentActuator *parAct = NULL;
- bStateActuator *staAct = NULL;
-
- float *fp;
- short ysize = 0, wval;
- char *str;
- int myline, stbit;
- uiBut *but;
-
-
- /* yco is at the top of the rect, draw downwards */
- uiBlockSetEmboss(block, UI_EMBOSSM);
- set_col_actuator(act->type, 0);
-
- switch (act->type)
- {
- case ACT_OBJECT:
- {
- oa = act->data;
- wval = (width-100)/3;
- if (oa->type == ACT_OBJECT_NORMAL)
- {
- if ( ob->gameflag & OB_DYNAMIC )
- {
- ysize= 175;
- }
- else
- {
- ysize= 72;
- }
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefBut(block, LABEL, 0, "Loc", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the location");
- uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "Rot", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the rotation");
- uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
-
- if ( ob->gameflag & OB_DYNAMIC )
- {
- uiDefBut(block, LABEL, 0, "Force", xco, yco-87, 55, 19, NULL, 0, 0, 0, 0, "Sets the force");
- uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque");
- uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, "");
- }
-
- if ( ob->gameflag & OB_DYNAMIC )
- {
- uiDefBut(block, LABEL, 0, "LinV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity");
- uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "AngV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity");
- uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, "");
-
- uiDefBut(block, LABEL, 0, "Damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity");
- uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
-
- uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
- uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
-
- uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
- }
- } else if (oa->type == ACT_OBJECT_SERVO)
- {
- ysize= 172;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefBut(block, LABEL, 0, "linV", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the target linear velocity, it will be achieve by automatic application of force. Null velocity is a valid target");
- uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
- uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates");
-
- uiDefBut(block, LABEL, 0, "Limit", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Select if the force need to be limited along certain axis (local or global depending on LinV Local flag)");
- uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis");
- uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis");
- uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis");
- uiDefBut(block, LABEL, 0, "Max", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force");
- uiDefBut(block, LABEL, 0, "Min", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force");
- if (oa->flag & ACT_SERVO_LIMIT_X) {
- uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
- }
- if (oa->flag & ACT_SERVO_LIMIT_Y) {
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
- }
- if (oa->flag & ACT_SERVO_LIMIT_Z) {
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
- }
- uiDefBut(block, LABEL, 0, "Servo", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller");
- uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-129, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient");
- uiDefBut(block, LABEL, 0, "Slow", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response");
- but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-148, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response");
- uiButSetFunc(but, update_object_actuator_PID, oa, NULL);
- uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-148, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response");
- uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-167, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability");
- }
- str= "Motion Type %t|Simple motion %x0|Servo Control %x1";
- but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &oa->type, 0.0, 0.0, 0, 0, "");
- oa->otype = oa->type;
- uiButSetFunc(but, change_object_actuator, oa, NULL);
- yco-= ysize;
- break;
- }
- case ACT_ACTION:
- case ACT_SHAPEACTION:
- {
- /* DrawAct */
-#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- ysize = 112;
-#else
- ysize= 92;
-#endif
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- aa = act->data;
- wval = (width-60)/3;
-
- // str= "Action types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
-#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6|Displacement %x7";
-#else
- str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
-#endif
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, width/3, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type");
- uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+10+ (width/3), yco-24, ((width/3)*2) - (20 + 60), 19, &aa->act, "Action name");
-
- uiDefButBitS(block, TOGN, 1, 0, "Continue", xco+((width/3)*2)+20, yco-24, 60, 19,
- &aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time");
-
-
- if(aa->type == ACT_ACTION_FROM_PROP)
- {
- uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position");
- }
- else
- {
- uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame");
- uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame");
- }
-
- uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending");
- uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "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");
-
- uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign this property this actions current frame number");
-
-
-#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
- if(aa->type == ACT_ACTION_MOTION)
- {
- uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
- }
-#endif
-
-
-
- yco-=ysize;
- break;
- }
- case ACT_IPO:
- {
- ia= act->data;
-
- ysize= 72;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str = "Ipo types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
-
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, (width-20)/2, 19, &ia->type, 0, 0, 0, 0, "");
-
- but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE,
- "Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19,
- &ia->flag, 0, 0, 0, 0,
- "Apply Ipo as a global or local force depending on the local option (dynamic objects only)");
- uiButSetFunc(but, change_ipo_actuator, but, ia);
-
- but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD,
- "Add", xco+3*(width-20)/4, yco-24, (width-20)/4-10, 19,
- &ia->flag, 0, 0, 0, 0,
- "Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag");
- uiButSetFunc(but, change_ipo_actuator, but, ia);
-
- /* Only show the do-force-local toggle if force is requested */
- if (ia->flag & (ACT_IPOFORCE|ACT_IPOADD)) {
- uiDefButBitS(block, TOG, ACT_IPOLOCAL, 0,
- "L", xco+width-30, yco-24, 20, 19,
- &ia->flag, 0, 0, 0, 0,
- "Let the ipo acts in local coordinates, used in Force and Add mode.");
- }
-
- if(ia->type==ACT_IPO_FROM_PROP) {
- uiDefBut(block, TEX, 0,
- "Prop: ", xco+10, yco-44, width-80, 19,
- ia->name, 0.0, 31.0, 0, 0,
- "Use this property to define the Ipo position");
- }
- else {
- uiDefButI(block, NUM, 0,
- "Sta", xco+10, yco-44, (width-80)/2, 19,
- &ia->sta, 1.0, MAXFRAMEF, 0, 0,
- "Start frame");
- uiDefButI(block, NUM, 0,
- "End", xco+10+(width-80)/2, yco-44, (width-80)/2, 19,
- &ia->end, 1.0, MAXFRAMEF, 0, 0,
- "End frame");
- }
- uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR,
- "Child", xco+10+(width-80), yco-44, 60, 19,
- &ia->flag, 0, 0, 0, 0,
- "Update IPO on all children Objects as well");
- uiDefBut(block, TEX, 0,
- "FrameProp: ", xco+10, yco-64, width-20, 19,
- ia->frameProp, 0.0, 31.0, 0, 0,
- "Assign this property this action current frame number");
-
- yco-= ysize;
- break;
- }
- case ACT_PROPERTY:
- {
- ysize= 68;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- pa= act->data;
-
- str= "Type %t|Assign %x0|Add %x1|Copy %x2";
- uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type");
-
- uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, 31, 0, 0, "Property name");
-
- if(pa->type==ACT_PROP_COPY) {
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object");
- uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, 31, 0, 0, "Copy this property");
- }
- else {
- uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, 31, 0, 0, "change with this value, use \"\" around strings");
- }
- yco-= ysize;
-
- break;
- }
- case ACT_SOUND:
- {
- ysize = 70;
-
- sa = act->data;
- sa->sndnr = 0;
-
- wval = (width-20)/2;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- if(G.main->sound.first) {
- IDnames_to_pupstring(&str, "Sound files", NULL, &(G.main->sound), (ID *)sa->sound, &(sa->sndnr));
- /* reset this value, it is for handling the event */
- sa->sndnr = 0;
- uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");
-
- if(sa->sound) {
- char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
- uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, "");
- uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->sound->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound");
- uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->sound->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound");
- }
- MEM_freeN(str);
- }
- else {
- uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, "");
- }
-
- yco-= ysize;
-
- break;
- }
- case ACT_CD:
- {
- char cd_type_str[] = "Sound mode %t|Play all tracks %x0|Play one track %x1|"
- "Volume %x3|Stop %x4|Pause %x5|Resume %x6";
- cda = act->data;
-
- if (cda) {
- if (cda->track == 0) {
- cda->track = 1;
- cda->volume = 1;
- cda->type = ACT_CD_PLAY_ALL;
- }
-
- if (cda->type == ACT_CD_PLAY_TRACK || cda->type == ACT_CD_LOOP_TRACK) {
- ysize = 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefButS(block, NUM, 0, "Track:", xco+10,yco-44,width-20, 19, &cda->track, 1, 99, 0, 0, "Select the track to be played");
- }
- else if (cda->type == ACT_CD_VOLUME) {
- ysize = 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-44,width-20, 19, &cda->volume, 0, 1, 0, 0, "Set the volume for CD playback");
- }
- else {
- ysize = 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
- uiDefButS(block, MENU, B_REDR, cd_type_str,xco+10,yco-22,width-20, 19, &cda->type, 0.0, 0.0, 0, 0, "");
- }
- yco-= ysize;
- break;
- }
- case ACT_CAMERA:
-
- ysize= 48;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- ca= act->data;
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
- uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
-
- uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
-
- if(ca->axis==0) ca->axis= 'x';
- uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
- uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
-
- uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
-
- yco-= ysize;
-
- break;
-
- case ACT_EDIT_OBJECT:
-
- eoa= act->data;
-
- if(eoa->type==ACT_EDOB_ADD_OBJECT) {
- int wval; /* just a temp width */
- ysize = 92;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all its children (cant be on an visible layer)");
- uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives");
-
- wval= (width-60)/3;
- uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19,
- NULL, 0, 0, 0, 0,
- "Velocity upon creation.");
- uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19,
- eoa->linVelocity, -100.0, 100.0, 10, 0,
- "Velocity upon creation, x component.");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19,
- eoa->linVelocity+1, -100.0, 100.0, 10, 0,
- "Velocity upon creation, y component.");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19,
- eoa->linVelocity+2, -100.0, 100.0, 10, 0,
- "Velocity upon creation, z component.");
- uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", xco+45+3*wval, yco-68, 15, 19,
- &eoa->localflag, 0.0, 0.0, 0, 0,
- "Apply the transformation locally");
-
-
- uiDefBut(block, LABEL, 0, "AngV", xco, yco-90, 45, 19,
- NULL, 0, 0, 0, 0,
- "Angular velocity upon creation.");
- uiDefButF(block, NUM, 0, "", xco+45, yco-90, wval, 19,
- eoa->angVelocity, -10000.0, 10000.0, 10, 0,
- "Angular velocity upon creation, x component.");
- uiDefButF(block, NUM, 0, "", xco+45+wval, yco-90, wval, 19,
- eoa->angVelocity+1, -10000.0, 10000.0, 10, 0,
- "Angular velocity upon creation, y component.");
- uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-90, wval, 19,
- eoa->angVelocity+2, -10000.0, 10000.0, 10, 0,
- "Angular velocity upon creation, z component.");
- uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", xco+45+3*wval, yco-90, 15, 19,
- &eoa->localflag, 0.0, 0.0, 0, 0,
- "Apply the rotation locally");
-
-
- }
- else if(eoa->type==ACT_EDOB_END_OBJECT) {
- ysize= 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
- else if(eoa->type==ACT_EDOB_REPLACE_MESH) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80), 19, &(eoa->me), "replace the existing mesh with this one");
- }
- else if(eoa->type==ACT_EDOB_TRACK_TO) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Track to this Object");
- uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes");
- uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking");
- }
- else if(eoa->type==ACT_EDOB_DYNAMICS) {
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str= "Dynamic Operation %t|Restore Dynamics %x0|Suspend Dynamics %x1|Enable Rigid Body %x2|Disable Rigid Body %x3";
- uiDefButS(block, MENU, B_REDR, str, xco+40, yco-44, (width-80), 19, &(eoa->dyn_operation), 0.0, 0.0, 0, 0, "");
- }
- str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4";
- uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, "");
-
- yco-= ysize;
-
- break;
-
- case ACT_CONSTRAINT:
- coa= act->data;
-
- if (coa->type == ACT_CONST_TYPE_LOC) {
- ysize= 69;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- /* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */
- /* coa->flag &= ~(63); */
- str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4";
- coa->flag &= 7;
- coa->time = 0;
- uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, "");
-
- uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
- uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc;
- else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1;
- else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2;
- else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot;
- else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1;
- else fp= coa->minrot+2;
-
- uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-65, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, "");
- } else if (coa->type == ACT_CONST_TYPE_DIST) {
- ysize= 106;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray");
-
- uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
- uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray");
- uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray");
- uiDefButBitS(block, TOG, ACT_CONST_LOCAL, 0, "L", xco+80+(width-115), yco-45, 25, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Set ray along object's axis or global axis");
-
- if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
- else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
- else fp= coa->minloc+2;
-
- uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray");
- if (coa->flag & ACT_CONST_DISTANCE)
- uiDefButF(block, NUM, 0, "", xco+80+(width-115)/2, yco-65, (width-115)/2, 19, fp, -2000.0, 2000.0, 10, 0, "Keep this distance to target");
- uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
- uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
- if (coa->flag & ACT_CONST_MATERIAL)
- {
- uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
- "Ray detects only Objects with this material");
- }
- else
- {
- uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
- "Ray detect only Objects with this property");
- }
- uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target");
- uiDefButS(block, NUM, 0, "time", xco+50, yco-103, (width-60)/2, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
- uiDefButS(block, NUM, 0, "rotDamp", xco+50+(width-60)/2, yco-103, (width-60)/2, 19, &(coa->rotdamp), 0.0, 100.0, 0, 0, "Use a different damping for orientation");
- } else if (coa->type == ACT_CONST_TYPE_ORI) {
- ysize= 87;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Select the axis to be aligned along the reference direction");
-
- uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
- uiDefBut(block, LABEL, 0, "X", xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Y", xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Z", xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/3, 19, &coa->maxrot[0], -2000.0, 2000.0, 10, 0, "X component of reference direction");
- uiDefButF(block, NUM, 0, "", xco+80+(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[1], -2000.0, 2000.0, 10, 0, "Y component of reference direction");
- uiDefButF(block, NUM, 0, "", xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[2], -2000.0, 2000.0, 10, 0, "Z component of reference direction");
-
- uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
- uiDefButF(block, NUM, 0, "min", xco+80, yco-84, (width-115)/2, 19, &(coa->minloc[0]), 0.0, 180.0, 10, 1, "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max");
- uiDefButF(block, NUM, 0, "max", xco+80+(width-115)/2, yco-84, (width-115)/2, 19, &(coa->maxloc[0]), 0.0, 180.0, 10, 1, "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max");
- } else if (coa->type == ACT_CONST_TYPE_FH) {
- ysize= 106;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32";
- uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray (in world coordinate)");
-
- if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
- else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
- else fp= coa->minloc+2;
-
- uiDefButF(block, NUM, 0, "damp", xco+10, yco-45, (width-70)/2, 19, &coa->maxrot[0], 0.0, 1.0, 1, 0, "Damping factor of the Fh spring force");
- uiDefButF(block, NUM, 0, "dist", xco+10+(width-70)/2, yco-45, (width-70)/2, 19, fp, 0.010, 2000.0, 10, 0, "Height of the Fh area");
- uiDefButBitS(block, TOG, ACT_CONST_DOROTFH, 0, "Rot Fh", xco+10+(width-70), yco-45, 50, 19, &coa->flag, 0.0, 0.0, 0, 0, "Keep object axis parallel to normal");
-
- uiDefButF(block, NUMSLI, 0, "Fh ", xco+80, yco-65, (width-115), 19, fp+3, 0.0, 1.0, 0, 0, "Spring force within the Fh area");
- uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
- uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
- if (coa->flag & ACT_CONST_MATERIAL)
- {
- uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
- "Ray detects only Objects with this material");
- }
- else
- {
- uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
- "Ray detect only Objects with this property");
- }
- uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
- &coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target");
- uiDefButS(block, NUM, 0, "time", xco+50, yco-103, 90, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
- uiDefButF(block, NUM, 0, "rotDamp", xco+140, yco-103, (width-150), 19, &coa->maxrot[1], 0.0, 1.0, 1, 0, "Use a different damping for rotation");
- }
- str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2|Force field %x3";
- but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, "");
- yco-= ysize;
- break;
-
- case ACT_SCENE:
- sca= act->data;
-
- if(sca->type==ACT_SCENE_RESTART) {
- ysize= 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
- else if(sca->type==ACT_SCENE_CAMERA) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
- }
- else if(sca->type==ACT_SCENE_SET) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
- }
- else if(sca->type==ACT_SCENE_ADD_FRONT) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
- }
- else if(sca->type==ACT_SCENE_ADD_BACK) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
- }
- else if(sca->type==ACT_SCENE_REMOVE) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
- }
- else if(sca->type==ACT_SCENE_SUSPEND) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
- }
- else if(sca->type==ACT_SCENE_RESUME) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
- }
-
- str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7";
- uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, "");
-
- yco-= ysize;
- break;
- case ACT_GAME:
- {
- gma = act->data;
- if (gma->type == ACT_GAME_LOAD)
- {
- //ysize = 68;
- ysize = 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file");
-// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation");
- }
-/* else if (gma->type == ACT_GAME_START)
- {
- ysize = 68;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file");
- uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation");
- }
-*/ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG))
- {
- ysize = 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
-
- //str = "Scene %t|Load game%x0|Start loaded game%x1|Restart this game%x2|Quit this game %x3";
- str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3|Save GameLogic.globalDict %x4|Load GameLogic.globalDict %x5";
- uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &gma->type, 0.0, 0.0, 0, 0, "");
-
- yco -= ysize;
- break;
- }
- case ACT_GROUP:
- ga= act->data;
-
- ysize= 52;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- str= "GroupKey types %t|Set Key %x6|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x5";
-
- uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, "");
- if(ga->type==ACT_GROUP_SET) {
- uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, 31.0, 0, 0, "This name defines groupkey to be set");
- uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame");
- }
- else if(ga->type==ACT_GROUP_FROM_PROP) {
- uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position");
- }
- else {
- uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame");
- uiDefButI(block, NUM, 0, "End", xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, "End frame");
- }
- yco-= ysize;
- break;
-
- case ACT_VISIBILITY:
- ysize = 24;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco,
- (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- visAct = act->data;
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOGN, ACT_VISIBILITY_INVISIBLE, B_REDR,
- "Visible",
- xco + 10, yco - 20, (width - 20)/3, 19, &visAct->flag,
- 0.0, 0.0, 0, 0,
- "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
- uiDefButBitI(block, TOG, ACT_VISIBILITY_INVISIBLE, B_REDR,
- "Invisible",
- xco + 10 + ((width - 20)/3), yco - 20, (width - 20)/3, 19, &visAct->flag,
- 0.0, 0.0, 0, 0,
- "Set the object invisible. Initialized from the objects render restriction toggle (access in the outliner)");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, ACT_VISIBILITY_RECURSIVE, B_NOP,
- "Children",
- xco + 10 + (((width - 20)/3)*2)+10, yco - 20, ((width - 20)/3)-10, 19, &visAct->flag,
- 0.0, 0.0, 0, 0,
- "Sets all the children of this object to the same visibility recursively");
-
- yco-= ysize;
-
- break;
-
- case ACT_STATE:
- ysize = 34;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco,
- (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- staAct = act->data;
-
- str= "Operation %t|Cpy %x0|Add %x1|Sub %x2|Inv %x3";
-
- uiDefButI(block, MENU, B_REDR, str,
- xco + 10, yco - 24, 65, 19, &staAct->type,
- 0.0, 0.0, 0, 0,
- "Select the bit operation on object state mask");
-
- for (wval=0; wval<15; wval+=5) {
- uiBlockBeginAlign(block);
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, TOG, 1<<(stbit+wval), stbit+wval, "", (short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval)));
- uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
- }
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, TOG, 1<<(stbit+wval+15), stbit+wval+15, "", (short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval+15)));
- uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
- }
- }
- uiBlockEndAlign(block);
-
- yco-= ysize;
-
- break;
-
- case ACT_RANDOM:
- ysize = 69;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco,
- (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- randAct = act->data;
-
- /* 1. seed */
- uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19,
- &randAct->seed, 0, 1000, 0, 0,
- "Initial seed of the random generator. Use Python for more freedom. "
- " (Choose 0 for not random)");
-
- /* 2. distribution type */
- /* One pick per distribution. These numbers MUST match the #defines */
- /* in game.h !!! */
- str= "Distribution %t|Bool Constant %x0|Bool Uniform %x1"
- "|Bool Bernoulli %x2|Int Constant %x3|Int Uniform %x4"
- "|Int Poisson %x5|Float Constant %x6|Float Uniform %x7"
- "|Float Normal %x8|Float Neg. Exp. %x9";
- uiDefButI(block, MENU, B_REDR, str, (xco+10) + 0.4 * (width-20), yco-24, 0.6 * (width-20), 19,
- &randAct->distribution, 0.0, 0.0, 0, 0,
- "Choose the type of distribution");
-
- /* 3. property */
- uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19,
- &randAct->propname, 0, 31, 0, 0,
- "Assign the random value to this property");
-
- /*4. and 5. arguments for the distribution*/
- switch (randAct->distribution) {
- case ACT_RANDOM_BOOL_CONST:
- uiDefButBitI(block, TOG, 1, 1, "Always true", (xco+10), yco-64, (width-20), 19,
- &randAct->int_arg_1, 2.0, 1, 0, 0,
- "Always false or always true");
- break;
- case ACT_RANDOM_BOOL_UNIFORM:
- uiDefBut(block, LABEL, 0, " Do a 50-50 pick.", (xco+10), yco-64, (width-20), 19,
- NULL, 0, 0, 0, 0,
- "Choose between true and false, 50% chance each.");
- break;
- case ACT_RANDOM_BOOL_BERNOUILLI:
- uiDefButF(block, NUM, 1, "Chance", (xco+10), yco-64, (width-20), 19,
- &randAct->float_arg_1, 0.0, 1.0, 0, 0,
- "Pick a number between 0 and 1. Success if you stay "
- "below this value");
- break;
- case ACT_RANDOM_INT_CONST:
- uiDefButI(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19,
- &randAct->int_arg_1, -1000, 1000, 0, 0,
- "Always return this number");
- break;
- case ACT_RANDOM_INT_UNIFORM:
- uiDefButI(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19,
- &randAct->int_arg_1, -1000, 1000, 0, 0,
- "Choose a number from a range. "
- "Lower boundary of the range.");
- uiDefButI(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
- &randAct->int_arg_2, -1000, 1000, 0, 0,
- "Choose a number from a range. "
- "Upper boundary of the range.");
- break;
- case ACT_RANDOM_INT_POISSON:
- uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20), 19,
- &randAct->float_arg_1, 0.01, 100.0, 0, 0,
- "Expected mean value of the distribution.");
- break;
- case ACT_RANDOM_FLOAT_CONST:
- uiDefButF(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19,
- &randAct->float_arg_1, 0.0, 1.0, 0, 0,
- "Always return this number");
- break;
- case ACT_RANDOM_FLOAT_UNIFORM:
- uiDefButF(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19,
- &randAct->float_arg_1, -10000.0, 10000.0, 0, 0,
- "Choose a number from a range. "
- "Lower boundary of the range.");
- uiDefButF(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
- &randAct->float_arg_2, -10000.0, 10000.0, 0, 0,
- "Choose a number from a range. "
- "Upper boundary of the range.");
- break;
- case ACT_RANDOM_FLOAT_NORMAL:
- uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20)/2, 19,
- &randAct->float_arg_1, -10000.0, 10000.0, 0, 0,
- "A normal distribution. Mean of the distribution.");
- uiDefButF(block, NUM, 1, "SD: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
- &randAct->float_arg_2, 0.0, 10000.0, 0, 0,
- "A normal distribution. Standard deviation of the "
- "distribution.");
- break;
- case ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL:
- uiDefButF(block, NUM, 1, "Half-life time: ", (xco+10), yco-64, (width-20), 19,
- &randAct->float_arg_1, 0.001, 10000.0, 0, 0,
- "Negative exponential dropoff.");
- break;
- default:
- ; /* don't know what this distro is... can be useful for testing */
- /* though :) */
- }
-
- yco-= ysize;
- break;
- case ACT_MESSAGE:
- ma = act->data;
-
- ysize = 4 + (3 * 24); /* footer + number of lines * 24 pixels/line */
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize,
- (float)xco+width, (float)yco, 1);
-
- myline=1;
-
- /* line 1: To */
- uiDefBut(block, TEX, 1, "To: ",
- (xco+10), (yco-(myline++*24)), (width-20), 19,
- &ma->toPropName, 0, 31, 0, 0,
- "Optional send message to objects with this name only, or empty to broadcast");
-
- /* line 2: Message Subject */
- uiDefBut(block, TEX, 1, "Subject: ",
- (xco+10), (yco-(myline++*24)), (width-20), 19,
- &ma->subject, 0, 31, 0, 0,
- "Optional message subject. This is what can be filtered on.");
-
- /* line 3: Text/Property */
- uiDefButBitS(block, TOG, 1, B_REDR, "T/P",
- (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19,
- &ma->bodyType, 0.0, 0.0, 0, 0,
- "Toggle message type: either Text or a PropertyName.");
-
- if (ma->bodyType == ACT_MESG_MESG)
- {
- /* line 3: Message Body */
- uiDefBut(block, TEX, 1, "Body: ",
- (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
- &ma->body, 0, 31, 0, 0,
- "Optional message body Text");
- } else
- {
- /* line 3: Property body (set by property) */
- uiDefBut(block, TEX, 1, "Propname: ",
- (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
- &ma->body, 0, 31, 0, 0,
- "The message body will be set by the Property Value");
- }
-
- yco -= ysize;
- break;
- case ACT_2DFILTER:
- tdfa = act->data;
-
- ysize = 50;
- if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER)
- {
- ysize +=20;
- }
- glRects( xco, yco-ysize, xco+width, yco );
- uiEmboss( (float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1 );
-
- switch(tdfa->type)
- {
- case ACT_2DFILTER_MOTIONBLUR:
- if(!tdfa->flag)
- {
- uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
- uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value");
- }
- else
- {
- uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
- }
- break;
- case ACT_2DFILTER_BLUR:
- case ACT_2DFILTER_SHARPEN:
- case ACT_2DFILTER_DILATION:
- case ACT_2DFILTER_EROSION:
- case ACT_2DFILTER_LAPLACIAN:
- case ACT_2DFILTER_SOBEL:
- case ACT_2DFILTER_PREWITT:
- case ACT_2DFILTER_GRAYSCALE:
- case ACT_2DFILTER_SEPIA:
- case ACT_2DFILTER_INVERT:
- case ACT_2DFILTER_NOFILTER:
- case ACT_2DFILTER_DISABLED:
- case ACT_2DFILTER_ENABLED:
- uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value");
- break;
- case ACT_2DFILTER_CUSTOMFILTER:
- uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value");
- uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, "");
- break;
- }
-
- str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|"
- "Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|"
- "Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|";
- uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type");
-
- yco -= ysize;
- break;
- case ACT_PARENT:
- parAct = act->data;
-
- if(parAct->type==ACT_PARENT_SET) {
-
- ysize= 48;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(parAct->ob), "Set this object as parent");
- }
- else if(parAct->type==ACT_PARENT_REMOVE) {
-
- ysize= 28;
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- }
-
- str= "Parent %t|Set Parent %x0|Remove Parent %x1";
- uiDefButI(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &parAct->type, 0.0, 0.0, 0, 0, "");
-
- yco-= ysize;
- break;
- default:
- ysize= 4;
-
- glRects(xco, yco-ysize, xco+width, yco);
- uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-
- yco-= ysize;
- break;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSSM);
-
- return yco-4;
-}
-
-static void do_sensor_menu(void *arg, int event)
-{
- ID **idar;
- Object *ob;
- bSensor *sens;
- short count, a;
-
- idar= get_selected_and_linked_obs(&count, G.buts->scaflag);
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWSENS;
- else if(event==1) ob->scaflag &= ~OB_SHOWSENS;
- }
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- sens= ob->sensors.first;
- while(sens) {
- if(event==2) sens->flag |= SENS_SHOW;
- else if(event==3) sens->flag &= ~SENS_SHOW;
- sens= sens->next;
- }
- }
-
- if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-static uiBlock *sensor_menu(void *arg_unused)
-{
- uiBlock *block;
- int yco=0;
-
- block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, do_sensor_menu, NULL);
-
- uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, BUTM, 1, "Show Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefBut(block, BUTM, 1, "Hide Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-static void do_controller_menu(void *arg, int event)
-{
- ID **idar;
- Object *ob;
- bController *cont;
- short count, a;
-
- idar= get_selected_and_linked_obs(&count, G.buts->scaflag);
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWCONT;
- else if(event==1) ob->scaflag &= ~OB_SHOWCONT;
- }
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- cont= ob->controllers.first;
- while(cont) {
- if(event==2) cont->flag |= CONT_SHOW;
- else if(event==3) cont->flag &= ~CONT_SHOW;
- cont= cont->next;
- }
- }
-
- if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-static uiBlock *controller_menu(void *arg_unused)
-{
- uiBlock *block;
- int yco=0;
-
- block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, do_controller_menu, NULL);
-
- uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, 1, "Hide Objects", 0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, BUTM, 1, "Show Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, "");
- uiDefBut(block, BUTM, 1, "Hide Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, "");
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-static void do_actuator_menu(void *arg, int event)
-{
- ID **idar;
- Object *ob;
- bActuator *act;
- short count, a;
-
- idar= get_selected_and_linked_obs(&count, G.buts->scaflag);
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- if(event==0 || event==2) ob->scaflag |= OB_SHOWACT;
- else if(event==1) ob->scaflag &= ~OB_SHOWACT;
- }
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- act= ob->actuators.first;
- while(act) {
- if(event==2) act->flag |= ACT_SHOW;
- else if(event==3) act->flag &= ~ACT_SHOW;
- act= act->next;
- }
- }
-
- if(idar) MEM_freeN(idar);
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-static uiBlock *actuator_menu(void *arg_unused)
-{
- uiBlock *block;
- int xco=0;
-
- block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, do_actuator_menu, NULL);
-
- uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, BUTM, 1, "Show Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefBut(block, BUTM, 1, "Hide Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-
-static void buttons_enji(uiBlock *block, Object *ob)
-{
- uiDefButBitI(block, TOG, OB_SECTOR, B_SETSECTOR, "Sector",
- 10,205,65,19, &ob->gameflag, 0, 0, 0, 0,
- "All game elements should be in the Sector boundbox");
- uiDefButBitI(block, TOG, OB_PROP, B_SETPROP, "Prop",
- 75,205,65,19, &ob->gameflag, 0, 0, 0, 0,
- "An Object fixed within a sector");
- uiBlockSetCol(block, BUTPURPLE);
- uiDefButBitI(block, TOG, OB_ACTOR, B_SETACTOR, "Actor",
- 140,205,65,19, &ob->gameflag, 0, 0, 0, 0,
- "Objects that are evaluated by the engine ");
- if(ob->gameflag & OB_ACTOR) {
- uiDefButBitI(block, TOG, OB_DYNAMIC, B_SETDYNA, "Dynamic",
- 205,205,75,19, &ob->gameflag, 0, 0, 0, 0,
- "Motion defined by laws of physics");
- uiDefButBitI(block, TOG, OB_MAINACTOR, B_SETMAINACTOR, "MainActor",
- 280,205,70,19, &ob->gameflag, 0, 0, 0, 0, "");
-
- if(ob->gameflag & OB_DYNAMIC) {
- uiDefButBitI(block, TOG, OB_DO_FH, B_DIFF, "Do Fh",
- 10,185,50,19, &ob->gameflag, 0, 0, 0, 0,
- "Use Fh settings in Materials");
- uiDefButBitI(block, TOG, OB_ROT_FH, B_DIFF, "Rot Fh",
- 60,185,50,19, &ob->gameflag, 0, 0, 0, 0,
- "Use face normal to rotate Object");
-
- uiBlockSetCol(block, BUTGREY);
- uiDefButF(block, NUM, B_DIFF, "Mass:",
- 110, 185, 120, 19, &ob->mass, 0.01, 100.0, 10, 0,
- "The mass of the Object");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Size:",
- 230, 185, 120, 19, &ob->inertia, 0.01, 10.0, 10, 0,
- "Bounding sphere size");
- uiDefButF(block, NUM, B_DIFF, "Damp:",
- 10, 165, 100, 19, &ob->damping, 0.0, 1.0, 10, 0,
- "General movement damping");
- uiDefButF(block, NUM, B_DIFF, "RotDamp:",
- 110, 165, 120, 19, &ob->rdamping, 0.0, 1.0, 10, 0,
- "General rotation damping");
- }
- }
-
-}
-
-static void buttons_ketsji(uiBlock *block, Object *ob)
-{
- uiDefButBitI(block, TOG, OB_COLLISION, B_REDR, "Physics",
- 10,205,70,19, &ob->gameflag, 0, 0, 0, 0,
- "Objects that have a physics representation");
- if (ob->gameflag & OB_COLLISION) {
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, OB_ACTOR, B_REDR, "Actor",
- 80,205,55,19, &ob->gameflag, 0, 0, 0, 0,
- "Objects that are evaluated by the engine ");
- if(ob->gameflag & OB_ACTOR) {
- uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", 135,205,55,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Objects that don't restitute collisions (like a ghost)");
- uiDefButBitI(block, TOG, OB_DYNAMIC, B_REDR, "Dynamic", 190,205,75,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Motion defined by laws of physics");
-
- if(ob->gameflag & OB_DYNAMIC) {
- uiDefButBitI(block, TOG, OB_RIGID_BODY, B_REDR, "Rigid Body", 265,205,85,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Enable rolling physics");
-
- uiDefButF(block, NUM, B_DIFF, "Mass:", 10, 185, 130, 19,
- &ob->mass, 0.01, 10000.0, 10, 2,
- "The mass of the Object");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 140, 185, 130, 19,
- &ob->inertia, 0.01, 10.0, 10, 2,
- "Bounding sphere radius");
- uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, B_REDR, "No sleeping", 270,185,80,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Disable auto (de)activation");
-
- uiDefButF(block, NUMSLI, B_DIFF, "Damp ", 10, 165, 150, 19,
- &ob->damping, 0.0, 1.0, 10, 0,
- "General movement damping");
- uiDefButF(block, NUMSLI, B_DIFF, "RotDamp ", 160, 165, 190, 19,
- &ob->rdamping, 0.0, 1.0, 10, 0,
- "General rotation damping");
-
- uiDefButBitI(block, TOG, OB_DO_FH, B_DIFF, "Do Fh", 10,145,50,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Use Fh settings in Materials");
- uiDefButBitI(block, TOG, OB_ROT_FH, B_DIFF, "Rot Fh", 60,145,50,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Use face normal to rotate Object");
- uiDefButF(block, NUM, B_DIFF, "Form:", 110, 145, 120, 19,
- &ob->formfactor, 0.01, 100.0, 10, 0,
- "Form factor");
-
- uiDefButBitI(block, TOG, OB_ANISOTROPIC_FRICTION, B_REDR, "Anisotropic",
- 230, 145, 120, 19,
- &ob->gameflag, 0.0, 1.0, 10, 0,
- "Enable anisotropic friction");
- }
-
- if (ob->gameflag & OB_ANISOTROPIC_FRICTION) {
- uiDefButF(block, NUM, B_DIFF, "x friction:", 10, 125, 114, 19,
- &ob->anisotropicFriction[0], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the x-direction.");
- uiDefButF(block, NUM, B_DIFF, "y friction:", 124, 125, 113, 19,
- &ob->anisotropicFriction[1], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the y-direction.");
- uiDefButF(block, NUM, B_DIFF, "z friction:", 237, 125, 113, 19,
- &ob->anisotropicFriction[2], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the z-direction.");
- }
- }
-
- if (!(ob->gameflag & OB_GHOST)) {
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 105, 75, 19,
- &ob->gameflag, 0, 0,0, 0,
- "Specify a collision shape bounds type");
- if (ob->gameflag & OB_BOUNDS) {
- /* assume triangle mesh, if no bounds chosen for soft body */
-
-
-
- uiDefButS(block, MENU, REDRAWVIEW3D, "Collision Type%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Concave TriangleMesh %x4",
- 85, 105, 160, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
- uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 250,105,100,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Add Children");
- }
- uiBlockEndAlign(block);
- }
- uiBlockEndAlign(block);
- }
-}
-
-static void check_body_type(void *arg1_but, void *arg2_object)
-{
- Object *ob = arg2_object;
-
- switch (ob->body_type) {
- case OB_BODY_TYPE_NO_COLLISION:
- ob->gameflag &= ~OB_COLLISION;
- break;
- case OB_BODY_TYPE_STATIC:
- ob->gameflag |= OB_COLLISION;
- ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY);
- break;
- case OB_BODY_TYPE_DYNAMIC:
- ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR;
- ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY);
- break;
- case OB_BODY_TYPE_RIGID:
- ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR;
- ob->gameflag &= ~(OB_SOFT_BODY);
- break;
- default:
- case OB_BODY_TYPE_SOFT:
- ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR;
- ob->gameflag &= ~(OB_RIGID_BODY);
-
- /* assume triangle mesh, if no bounds chosen for soft body */
- if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_POLYH))
- {
- ob->boundtype=OB_BOUND_POLYH;
- }
- /* create a BulletSoftBody structure if not already existing */
- if (!ob->bsoft)
- ob->bsoft = bsbNew();
- break;
- }
-}
-
-static uiBlock *advanced_bullet_menu(void *arg_ob)
-{
- uiBlock *block;
- Object *ob = arg_ob;
- short yco = 20, xco = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "advanced_bullet_options", UI_EMBOSS, UI_HELV, curarea->win);
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -10, -10, 380, 60, NULL, 0, 0, 0, 0, "");
-
- if (ob->gameflag & OB_SOFT_BODY) {
-
- if (ob->bsoft)
- {
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, OB_BSB_COL_CL_RS, 0, "Cluster Collision RS",
- xco, yco, 180, 19, &ob->bsoft->collisionflags, 0, 0, 0, 0,
- "Enable cluster collision between soft and rigid body");
- uiDefButBitI(block, TOG, OB_BSB_COL_CL_SS, 0, "Cluster Collision SS",
- xco+=180, yco, 180, 19, &ob->bsoft->collisionflags, 0, 0, 0, 0,
- "Enable cluster collision between soft and soft body");
- yco -= 20;
- xco = 0;
- uiDefButI(block, NUM, 0, "Cluster Iter.",
- xco, yco, 180, 19, &ob->bsoft->numclusteriterations, 1.0, 128.,
- 0, 0, "Specify the number of cluster iterations");
- uiDefButI(block, NUM, 0, "Position Iter.",
- xco+=180, yco, 180, 19, &ob->bsoft->piterations, 0, 10,
- 0, 0, "Position solver iterations");
- uiBlockEndAlign(block);
-
- /*
- //too complex tweaking, disable for now
- uiDefButF(block, NUMSLI, REDRAWVIEW3D, "kVC",
- xco+=80, yco, 80, 19, &ob->bsoft->kVC, 0, 100,
- 0, 0, "Volume coefficient");
- */
-
- xco = 0;
-/*
-//would be a cool option, like leaves in the wind, need complex tweaking
- uiDefButBitI(block, TOG, OB_BSB_AERO_VTWOSIDE, 0, "Aero model",
- xco, yco, 118, 19, &ob->bsoft->flag, 0, 0, 0, 0,
- "Enable aero model, vertex normals are flipped to match velocity");
-
- yco -= 25;
-*/
-
- }
-
- } else
- {
-
-
- xco = 0;
-
- if (ob->gameflag & OB_DYNAMIC) {
- if (ob->margin < 0.001f)
- ob->margin = 0.06f;
- uiDefButF(block, NUM, 0, "Margin",
- xco, yco, 170, 19, &ob->margin, 0.001, 1.0, 1, 0,
- "Collision margin");
- } else {
- uiDefButF(block, NUM, 0, "Margin",
- xco, yco, 170, 19, &ob->margin, 0.0, 1.0, 1, 0,
- "Collision margin");
- }
- yco -= 20;
- xco = 0;
-
-
- }
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-static void buttons_bullet(uiBlock *block, Object *ob)
-{
- uiBut *but;
-
- /* determine the body_type setting based on flags */
- if (!(ob->gameflag & OB_COLLISION))
- ob->body_type = OB_BODY_TYPE_NO_COLLISION;
- else if (!(ob->gameflag & OB_DYNAMIC))
- ob->body_type = OB_BODY_TYPE_STATIC;
- else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY)))
- ob->body_type = OB_BODY_TYPE_DYNAMIC;
- else if (ob->gameflag & OB_RIGID_BODY)
- ob->body_type = OB_BODY_TYPE_RIGID;
- else {
- ob->body_type = OB_BODY_TYPE_SOFT;
- /* create the structure here because we display soft body buttons in the main panel */
- if (!ob->bsoft)
- ob->bsoft = bsbNew();
- }
-
- uiBlockBeginAlign(block);
-
- //only enable game soft body if Blender Soft Body exists
- but = uiDefButS(block, MENU, REDRAWVIEW3D,
- "Object type%t|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4",
- 10, 205, 100, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation");
- uiButSetFunc(but, check_body_type, but, ob);
-
- if (ob->gameflag & OB_COLLISION) {
-
- uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor",
- 110, 205, 50, 19, &ob->gameflag, 0, 0, 0, 0,
- "Objects that are detected by the Near and Radar sensor");
-
-
-
- uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost",
- 160,205,50,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Objects that don't restitute collisions (like a ghost)");
-
- //uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefBlockBut(block, advanced_bullet_menu, ob,
- "Advanced Settings",
- 210, 205, 140, 19, "Display collision advanced settings");
- //uiBlockSetCol(block, TH_BUT_SETTING2);
-
-
- if(ob->gameflag & OB_DYNAMIC) {
-
- if (!(ob->gameflag & OB_SOFT_BODY))
- {
-
- uiDefButF(block, NUM, B_DIFF, "Mass:", 10, 185, 130, 19,
- &ob->mass, 0.01, 10000.0, 10, 2,
- "The mass of the Object");
-
- uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 140, 185, 130, 19,
- &ob->inertia, 0.01, 10.0, 10, 2,
- "Radius for Bounding sphere and Fh/Fh Rot");
-
- uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, B_REDR, "No sleeping", 270,185,80,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Disable auto (de)activation");
-
- uiDefButF(block, NUMSLI, B_DIFF, "Damp ", 10, 165, 150, 19,
- &ob->damping, 0.0, 1.0, 10, 0,
- "General movement damping");
- uiDefButF(block, NUMSLI, B_DIFF, "RotDamp ", 160, 165, 190, 19,
- &ob->rdamping, 0.0, 1.0, 10, 0,
- "General rotation damping");
-
- uiDefButBitI(block, TOG, OB_DO_FH, B_DIFF, "Do Fh", 10,145,50,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Use Fh settings in Materials");
- uiDefButBitI(block, TOG, OB_ROT_FH, B_DIFF, "Rot Fh", 60,145,50,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Use face normal to rotate Object");
- /* Form factor is hooked up in Bullet, to scale inertia tensor */
-
- uiDefButF(block, NUM, B_DIFF, "Form:", 110, 145, 120, 19,
- &ob->formfactor, 0.01, 100.0, 10, 0,
- "Form factor scales the inertia tensor");
- } else {
- uiDefButF(block, NUM, B_DIFF, "Mass:", 10, 185, 110, 19,
- &ob->mass, 0.01, 10000.0, 10, 2,
- "The mass of the Object");
-
- if (ob->bsoft) {
- uiDefButBitI(block, TOG, OB_BSB_SHAPE_MATCHING, B_REDR, "Shape Match",
- 120, 185, 110, 19, &ob->bsoft->flag, 0, 0, 0, 0,
- "Enable soft body shape matching goal");
-
- uiDefButBitI(block, TOG, OB_BSB_BENDING_CONSTRAINTS, 0, "Bending Const.",
- 230, 185, 120, 19, &ob->bsoft->flag, 0, 0, 0, 0,
- "Enable bending constraints");
-
- uiDefButF(block, NUMSLI, 0, "LinStiff ", 10, 165, 170, 19,
- &ob->bsoft->linStiff, 0.0, 1.0, 1, 0,
- "Linear stiffness of the soft body links");
-
- uiDefButF(block, NUMSLI, 0, "Friction ",
- 180, 165, 170, 19, &ob->bsoft->kDF, 0.0, 1.,
- 0, 0, "Dynamic Friction");
-
- if (ob->bsoft->flag & OB_BSB_SHAPE_MATCHING) {
- uiDefButF(block, NUMSLI, 0, "kMT ",
- 10, 145, 170, 19, &ob->bsoft->kMT, 0, 1,
- 0, 0, "Shape matching threshold");
- }
- }
- }
-
- } else {
- /* static object can also have a sphere bound shape, radius is used */
- if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE)) {
- uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 10, 185, 130, 19,
- &ob->inertia, 0.01, 10.0, 10, 2,
- "Radius for Bounding sphere");
- }
- }
-
- uiBlockEndAlign(block);
-
- /* In Bullet, anisotripic friction can be applied to static objects as well, just not soft bodies */
-
- if (!(ob->gameflag & OB_SOFT_BODY))
- {
- uiDefButBitI(block, TOG, OB_ANISOTROPIC_FRICTION, B_REDR, "Anisotropic",
- 230, 145, 120, 19,
- &ob->gameflag, 0.0, 1.0, 10, 0,
- "Enable anisotropic friction");
-
- if (ob->gameflag & OB_ANISOTROPIC_FRICTION) {
- uiDefButF(block, NUM, B_DIFF, "x friction:", 10, 125, 114, 19,
- &ob->anisotropicFriction[0], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the x-direction.");
- uiDefButF(block, NUM, B_DIFF, "y friction:", 124, 125, 113, 19,
- &ob->anisotropicFriction[1], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the y-direction.");
- uiDefButF(block, NUM, B_DIFF, "z friction:", 237, 125, 113, 19,
- &ob->anisotropicFriction[2], 0.0, 1.0, 10, 0,
- "Relative friction coefficient in the z-direction.");
- }
-
-
- }
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 105, 80, 19,
- &ob->gameflag, 0, 0, 0, 0,
- "Specify a collision bounds type");
- if (ob->gameflag & OB_BOUNDS) {
- //only allow convex hull/triangle mesh for soft bodies
-
- if ((ob->body_type==OB_BODY_TYPE_SOFT) && (ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_POLYH))
- {
- ob->boundtype=OB_BOUND_POLYH;
- }
-
- if (ob->body_type==OB_BODY_TYPE_SOFT)
- {
- uiDefButS(block, MENU, REDRAWVIEW3D, "Collision Bounds%t|Convex Hull%x5|Triangle Mesh%x4",
- 90, 105, 150, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
- } else
- {
- uiDefButS(block, MENU, REDRAWVIEW3D, "Collision Bounds%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Triangle Mesh%x4",
- 90, 105, 150, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
- }
- if (ob->body_type!=OB_BODY_TYPE_SOFT)
- {
- uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19,
- &ob->gameflag, 0, 0, 0, 0,
- "Add Children");
- }
- }
- uiBlockEndAlign(block);
- }
-
- uiBlockEndAlign(block);
-
-
-}
-
-static void check_controller_state_mask(void *arg1_but, void *arg2_mask)
-{
- unsigned int *cont_mask = arg2_mask;
- uiBut *but = arg1_but;
-
- /* a controller is always in a single state */
- *cont_mask = (1<<but->retval);
- but->retval = B_REDR;
-}
-
-static int first_bit(unsigned int mask)
-{
- int bit;
-
- for (bit=0; bit<32; bit++) {
- if (mask & (1<<bit))
- return bit;
- }
- return -1;
-}
-
-static uiBlock *controller_state_mask_menu(void *arg_cont)
-{
- uiBlock *block;
- uiBut *but;
- bController *cont = arg_cont;
-
- short yco = 12, xco = 0, stbit, offset;
-
- block= uiNewBlock(&curarea->uiblocks, "Controller state mask", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -5, -5, 200, 34, NULL, 0, 0, 0, 0, "");
-
- for (offset=0; offset<15; offset+=5) {
- uiBlockBeginAlign(block);
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, TOG, (1<<(stbit+offset)), (stbit+offset), "", (short)(xco+12*stbit+13*offset), yco, 12, 12, (int *)&(cont->state_mask), 0, 0, 0, 0, "");
- uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask));
- }
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, TOG, (1<<(stbit+offset+15)), (stbit+offset+15), "", (short)(xco+12*stbit+13*offset), yco-12, 12, 12, (int *)&(cont->state_mask), 0, 0, 0, 0, "");
- uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask));
- }
- }
- uiBlockEndAlign(block);
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-static void do_object_state_menu(void *arg, int event)
-{
- Object *ob = arg;
-
- switch (event) {
- case 0:
- ob->state = 0x3FFFFFFF;
- break;
- case 1:
- ob->state = ob->init_state;
- if (!ob->state)
- ob->state = 1;
- break;
- case 2:
- ob->init_state = ob->state;
- break;
- }
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-static uiBlock *object_state_mask_menu(void *arg_obj)
-{
- uiBlock *block;
- short xco = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "obstatemenu", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, do_object_state_menu, arg_obj);
-
- uiDefBut(block, BUTM, 1, "Set all bits", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, 1, "Recall init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, BUTM, 1, "Store init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_TOP);
- return block;
-}
-
-static int is_sensor_linked(uiBlock *block, bSensor *sens)
-{
- bController *cont;
- int i, count;
-
- for (count=0, i=0; i<sens->totlinks; i++) {
- cont = sens->links[i];
- if (uiFindInlink(block, cont) != NULL)
- return 1;
- }
- return 0;
-}
-
-/* never used, see CVS 1.134 for the code */
-/* static FreeCamera *new_freecamera(void) */
-
-/* never used, see CVS 1.120 for the code */
-/* static uiBlock *freecamera_menu(void) */
-
-
-void logic_buts(void)
-{
- ID **idar;
- Object *ob;
- bProperty *prop;
- bSensor *sens;
- bController *cont;
- bActuator *act;
- uiBlock *block;
- uiBut *but;
- World *wrld;
- int a, iact, stbit, offset;
- short xco, yco, count, width, ycoo;
- char *pupstr, name[32];
- /* pin is a bool used for actuator and sensor drawing with states
- * pin so changing states dosnt hide the logic brick */
- char pin;
-
- wrld= G.scene->world;
-
- ob= OBACT;
-
- if(ob==0) return;
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- sprintf(name, "buttonswin %d", curarea->win);
- block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSS, UI_HELV, curarea->win);
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
-
- if(wrld) {
- switch(wrld->physicsEngine) {
- case WOPHY_ENJI:
- buttons_enji(block, ob);
- break;
- case WOPHY_BULLET:
- buttons_bullet(block, ob);
- break;
- default:
- buttons_ketsji(block, ob);
- break;
- }
- }
- else buttons_ketsji(block, ob);
-
- uiBlockSetCol(block, TH_AUTO);
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_ADD_PROP, "Add Property", 10, 70, 340, 24,
- NULL, 0.0, 100.0, 100, 0,
- "");
-
- pupstr= "Types %t|Bool %x0|Int %x1|Float %x2|String %x3|Timer %x5";
-
- a= 0;
- prop= ob->prop.first;
- while(prop) {
- but= uiDefBut(block, BUT, 1, "Del", 10, (short)(50-20*a), 40, 20, NULL, 0.0, 0.0, 1, (float)a, "");
- uiButSetFunc(but, del_property, prop, NULL);
- uiDefButS(block, MENU, B_CHANGE_PROP, pupstr, 50, (short)(50-20*a), 60, 20, &prop->type, 0, 0, 0, 0, "");
- but= uiDefBut(block, TEX, 1, "Name:", 110, (short)(50-20*a), 110, 20, prop->name, 0, 31, 0, 0, "Available as GameObject attributes in the game engines python api");
- uiButSetFunc(but, make_unique_prop_names_cb, prop->name, (void*) 1);
-
- if(prop->type==PROP_BOOL) {
- uiDefButBitI(block, TOG, 1, B_REDR, "True", 220, (short)(50-20*a), 55, 20, &prop->data, 0, 0, 0, 0, "");
- uiDefButBitI(block, TOGN, 1, B_REDR, "False", 270, (short)(50-20*a), 55, 20, &prop->data, 0, 0, 0, 0, "");
- }
- else if(prop->type==PROP_INT)
- uiDefButI(block, NUM, B_REDR, "", 220, (short)(50-20*a), 110, 20, &prop->data, -10000, 10000, 0, 0, "");
- else if(prop->type==PROP_FLOAT)
- uiDefButF(block, NUM, B_REDR, "", 220, (short)(50-20*a), 110, 20, (float*) &prop->data, -10000, 10000, 100, 3, "");
- else if(prop->type==PROP_STRING)
- uiDefBut(block, TEX, B_REDR, "", 220, (short)(50-20*a), 110, 20, prop->poin, 0, 127, 0, 0, "");
- else if(prop->type==PROP_TIME)
- uiDefButF(block, NUM, B_REDR, "", 220, (short)(50-20*a), 110, 20, (float*) &prop->data, -10000, 10000, 100, 3, "");
-
- uiDefButBitS(block, TOG, PROP_DEBUG, B_REDR, "D", 330, (short)(50-20*a), 20, 20, &prop->flag, 0, 0, 0, 0, "Print Debug info");
-
- a++;
- prop= prop->next;
-
- }
- uiBlockEndAlign(block);
-
- uiClearButLock();
-
- idar= get_selected_and_linked_obs(&count, G.buts->scaflag);
-
- /* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that
- we can determine which is actually linked/visible */
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- act= ob->actuators.first;
- while(act) {
- act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
- act = act->next;
- }
- /* same for sensors */
- sens= ob->sensors.first;
- while(sens) {
- sens->flag &= ~(SENS_VISIBLE);
- sens = sens->next;
- }
- }
-
- /* start with the controller because we need to know which one is visible */
- /* ******************************* */
- xco= 695; yco= 170; width= 275;
-
- uiBlockSetEmboss(block, UI_EMBOSSP);
- uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, "");
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
- uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
- uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator");
- uiBlockEndAlign(block);
-
- ob= OBACT;
-
- for(a=0; a<count; a++) {
- unsigned int controller_state_mask = 0; /* store a bitmask for states that are used */
-
- ob= (Object *)idar[a];
- uiClearButLock();
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
-
- /* presume it is only objects for now */
- uiBlockSetEmboss(block, UI_EMBOSS);
- uiBlockBeginAlign(block);
- if(ob->controllers.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
- if(ob->controllers.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
- uiBlockEndAlign(block);
- yco-=20;
-
- /* mark all actuators linked to these controllers */
- /* note that some of these actuators could be from objects that are not in the display list.
- It's ok because those actuators will not be displayed here */
- cont= ob->controllers.first;
- while(cont) {
- for (iact=0; iact<cont->totlinks; iact++) {
- act = cont->links[iact];
- if (act)
- act->flag |= ACT_LINKED;
- }
- controller_state_mask |= cont->state_mask;
- cont = cont->next;
- }
-
- if(ob->scaflag & OB_SHOWCONT) {
-
- /* first show the state */
- uiBlockSetEmboss(block, UI_EMBOSSP);
- uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, 19, "Object state menu: store and retrieve initial state");
- uiBlockSetEmboss(block, UI_EMBOSS);
- if (!ob->state)
- ob->state = 1;
- for (offset=0; offset<15; offset+=5) {
- uiBlockBeginAlign(block);
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+31+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset)));
- uiButSetFunc(but, check_state_mask, but, &(ob->state));
- }
- for (stbit=0; stbit<5; stbit++) {
- but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+31+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15)));
- uiButSetFunc(but, check_state_mask, but, &(ob->state));
- }
- }
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
- uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state");
- uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, 19, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
- uiBlockEndAlign(block);
-
- yco-=35;
-
- /* display only the controllers that match the current state */
- offset = 0;
- for (stbit=0; stbit<32; stbit++) {
- if (!(ob->state & (1<<stbit)))
- continue;
- /* add a separation between controllers of different states */
- if (offset) {
- offset = 0;
- yco -= 6;
- }
- cont= ob->controllers.first;
- while(cont) {
- if (cont->state_mask & (1<<stbit)) {
- /* this controller is visible, mark all its actuator */
- for (iact=0; iact<cont->totlinks; iact++) {
- act = cont->links[iact];
- if (act)
- act->flag |= ACT_VISIBLE;
- }
- uiBlockSetEmboss(block, UI_EMBOSSM);
- uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller");
- uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings");
- uiBlockSetEmboss(block, UI_EMBOSSP);
- sprintf(name, "%d", first_bit(cont->state_mask)+1);
- uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)");
- uiBlockSetEmboss(block, UI_EMBOSSM);
-
- if(cont->flag & CONT_SHOW) {
- cont->otype= cont->type;
- uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, 19, &cont->type, 0, 0, 0, 0, "Controller type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-136), 19, cont->name, 0, 31, 0, 0, "Controller name");
- uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
-
- ycoo= yco;
- yco= draw_controllerbuttons(cont, block, xco, yco, width);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
- }
- else {
- cpack(0x999999);
- glRecti(xco+22, yco, xco+width-22,yco+19);
- but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, 19, cont, 0, 0, 0, 0, "Controller type");
- uiButSetFunc(but, sca_move_controller, cont, NULL);
- but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-136), 19, cont, 0, 0, 0, 0, "Controller name");
- uiButSetFunc(but, sca_move_controller, cont, NULL);
- ycoo= yco;
- }
-
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, "");
- uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
-
- uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, "");
- /* offset is >0 if at least one controller was displayed */
- offset++;
- yco-=20;
- }
- cont= cont->next;
- }
-
- }
- yco-= 6;
- }
- }
-
- /* ******************************* */
- xco= 375; yco= 170; width= 250;
-
- uiBlockSetEmboss(block, UI_EMBOSSP);
- uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, 19, "");
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
- uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
- uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
- uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states");
- uiBlockEndAlign(block);
-
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- uiClearButLock();
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- if( (ob->scavisflag & OB_VIS_SENS) == 0) continue;
-
- /* presume it is only objects for now */
- uiBlockSetEmboss(block, UI_EMBOSS);
- uiBlockBeginAlign(block);
- if(ob->sensors.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
- if(ob->sensors.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
- uiBlockEndAlign(block);
- yco-=20;
-
- if(ob->scaflag & OB_SHOWSENS) {
-
- sens= ob->sensors.first;
- while(sens) {
- if (!(G.buts->scaflag & BUTS_SENS_STATE) ||
- (sens->totlinks == 0) || /* always display sensor without links so that is can be edited */
- (sens->flag & SENS_PIN && G.buts->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */
- (is_sensor_linked(block, sens))
- ) {
- /* should we draw the pin? - for now always draw when there is a state */
- pin = (G.buts->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ;
-
- sens->flag |= SENS_VISIBLE;
- uiBlockSetEmboss(block, UI_EMBOSSM);
- uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor");
- if (pin)
- uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, ICON_PIN_DEHLT, (short)(xco+width-44), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
-
- uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings");
-
- ycoo= yco;
- if(sens->flag & SENS_SHOW)
- {
- uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, 19, &sens->type, 0, 0, 0, 0, "Sensor type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens->name, 0, 31, 0, 0, "Sensor name");
- uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
-
- sens->otype= sens->type;
- yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
- }
- else {
- set_col_sensor(sens->type, 1);
- glRecti(xco+22, yco, xco+width-22,yco+19);
- but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, 19, sens, 0, 0, 0, 0, "");
- uiButSetFunc(but, sca_move_sensor, sens, NULL);
- but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens, 0, 31, 0, 0, "");
- uiButSetFunc(but, sca_move_sensor, sens, NULL);
- }
-
- but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, "");
- uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER);
-
- yco-=20;
- }
- sens= sens->next;
- }
- yco-= 6;
- }
- }
-
- /* ******************************* */
- xco= 1040; yco= 170; width= 280;
-
- uiBlockSetEmboss(block, UI_EMBOSSP);
- uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, 19, "");
- uiBlockSetEmboss(block, UI_EMBOSS);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
- uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
- uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
- uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states");
- uiBlockEndAlign(block);
- for(a=0; a<count; a++) {
- ob= (Object *)idar[a];
- uiClearButLock();
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- if( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
-
- /* presume it is only objects for now */
- uiBlockSetEmboss(block, UI_EMBOSS);
- uiBlockBeginAlign(block);
- if(ob->actuators.first) uiSetCurFont(block, UI_HELVB);
- uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
- if(ob->actuators.first) uiSetCurFont(block, UI_HELV);
- uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
- uiBlockEndAlign(block);
- yco-=20;
-
- if(ob->scaflag & OB_SHOWACT) {
-
- act= ob->actuators.first;
- while(act) {
- if (!(G.buts->scaflag & BUTS_ACT_STATE) ||
- !(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */
- (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
- (act->flag & ACT_PIN && G.buts->scaflag & BUTS_ACT_STATE)) {
-
- pin = (G.buts->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ;
-
- act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */
- uiBlockSetEmboss(block, UI_EMBOSSM);
- uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator");
- if (pin)
- uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PIN_DEHLT, (short)(xco+width-44), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
- uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display the actuator");
-
- if(act->flag & ACT_SHOW) {
- act->otype= act->type;
- uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, 19, &act->type, 0, 0, 0, 0, "Actuator type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act->name, 0, 31, 0, 0, "Actuator name");
- uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
-
- ycoo= yco;
- yco= draw_actuatorbuttons(ob, act, block, xco, yco, width);
- if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
- }
- else {
- set_col_actuator(act->type, 1);
- glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19));
- but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, 19, act, 0, 0, 0, 0, "Actuator type");
- uiButSetFunc(but, sca_move_actuator, act, NULL);
- but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act, 0, 0, 0, 0, "Actuator name");
- uiButSetFunc(but, sca_move_actuator, act, NULL);
- ycoo= yco;
- }
-
- uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, "");
-
- yco-=20;
- }
- act= act->next;
- }
- yco-= 6;
- }
- }
-
- uiComposeLinks(block);
- uiDrawBlock(block);
-
- if(idar) MEM_freeN(idar);
-}
-
-
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
deleted file mode 100644
index 6162a12d06d..00000000000
--- a/source/blender/src/buttons_object.c
+++ /dev/null
@@ -1,5971 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_action.h"
-#include "BKE_cloth.h"
-#include "BKE_fluidsim.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_library.h"
-#include "BKE_softbody.h"
-#include "BKE_utildefines.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-
-#include "BIF_butspace.h"
-#include "BIF_editaction.h"
-#include "BIF_editparticle.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_outliner.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editcurve.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-/* -----includes for this file specific----- */
-
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_cloth_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_group_types.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_particle_types.h"
-#include "DNA_radio_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_text_types.h"
-
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_group.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_sound.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_DerivedMesh.h"
-
-#include "LBM_fluidsim.h"
-#include "elbeem.h"
-
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_editparticle.h"
-
-#include "BSE_editipo.h"
-#include "BSE_edit.h"
-
-#include "BDR_editobject.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "butspace.h" // own module
-
-static float prspeed=0.0;
-float prlen=0.0;
-
-
-/* ********************* CONSTRAINT ***************************** */
-
-static void constraint_active_func(void *ob_v, void *con_v)
-{
- Object *ob= ob_v;
- bConstraint *con;
- ListBase *lb;
-
- /* lets be nice and escape if its active already */
- if(con_v) {
- con= con_v;
- if(con->flag & CONSTRAINT_ACTIVE) return;
- }
-
- lb= get_active_constraints(ob);
- if (lb == NULL) return;
-
- for(con= lb->first; con; con= con->next) {
- if(con==con_v) con->flag |= CONSTRAINT_ACTIVE;
- else con->flag &= ~CONSTRAINT_ACTIVE;
- }
-
- /* make sure ipowin and buttons shows it */
- if(ob->ipowin==ID_CO) {
- allqueue(REDRAWIPO, ID_CO);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWNLA, 0);
- }
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-static void add_constraint_to_active(Object *ob, bConstraint *con)
-{
- ListBase *list= get_active_constraints(ob);
- bPoseChannel *pchan= get_active_posechannel(ob);
-
- if (list) {
- unique_constraint_name(con, list);
- BLI_addtail(list, con);
-
- if (proxylocked_constraints_owner(ob, pchan))
- con->flag |= CONSTRAINT_PROXY_LOCAL;
-
- con->flag |= CONSTRAINT_ACTIVE;
- for (con= con->prev; con; con= con->prev)
- con->flag &= ~CONSTRAINT_ACTIVE;
- }
-}
-
-/* returns base ID for Ipo, sets actname to channel if appropriate */
-/* should not make action... */
-static void get_constraint_ipo_context(void *ob_v, char *actname)
-{
- Object *ob= ob_v;
-
- /* todo: check object if it has ob-level action ipo */
- if (ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
-
- pchan = get_active_posechannel(ob);
- if (pchan) {
- BLI_strncpy(actname, pchan->name, 32);
- }
- }
- else if(ob->ipoflag & OB_ACTION_OB)
- strcpy(actname, "Object");
-}
-
-/* initialize UI to show Ipo window and make sure channels etc exist */
-static void enable_constraint_ipo_func (void *ob_v, void *con_v)
-{
- Object *ob= ob_v;
- bConstraint *con = con_v;
- char actname[32]="";
-
- /* verifies if active constraint is set and shown in UI */
- constraint_active_func(ob_v, con_v);
-
- /* the context */
- get_constraint_ipo_context(ob, actname);
-
- /* adds ipo & channels & curve if needed */
- if(con->flag & CONSTRAINT_OWN_IPO)
- verify_ipo((ID *)ob, ID_CO, NULL, con->name, actname, 1);
- else
- verify_ipo((ID *)ob, ID_CO, actname, con->name, NULL, 1);
-
- /* make sure ipowin shows it */
- ob->ipowin= ID_CO;
- allqueue(REDRAWIPO, ID_CO);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-
-static void add_influence_key_to_constraint_func (void *ob_v, void *con_v)
-{
- Object *ob= ob_v;
- bConstraint *con = con_v;
- IpoCurve *icu;
- char actname[32]="";
-
- /* verifies if active constraint is set and shown in UI */
- constraint_active_func(ob_v, con_v);
-
- /* the context */
- get_constraint_ipo_context(ob, actname);
-
- /* adds ipo & channels & curve if needed */
- if(con->flag & CONSTRAINT_OWN_IPO)
- icu= verify_ipocurve((ID *)ob, ID_CO, NULL, con->name, actname, CO_ENFORCE, 1);
- else
- icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE, 1);
-
- if (!icu) {
- error("Cannot get a curve from this IPO, may be dealing with linked data");
- return;
- }
-
- if(ob->action)
- insert_vert_icu(icu, get_action_frame(ob, (float)CFRA), con->enforce, 0);
- else
- insert_vert_icu(icu, CFRA, con->enforce, 0);
-
- /* make sure ipowin shows it */
- ob->ipowin= ID_CO;
- allqueue(REDRAWIPO, ID_CO);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWNLA, 0);
-
- BIF_undo_push("Insert Influence Key");
-}
-
-void del_constr_func (void *ob_v, void *con_v)
-{
- bConstraint *con= con_v;
- bConstraintChannel *chan;
- ListBase *lb;
-
- /* remove ipo channel */
- lb= get_active_constraint_channels(ob_v, 0);
- if(lb) {
- chan = get_constraint_channel(lb, con->name);
- if(chan) {
- if(chan->ipo) chan->ipo->id.us--;
- BLI_freelinkN(lb, chan);
- }
- }
- /* remove constraint itself */
- lb= get_active_constraints(ob_v);
- free_constraint_data(con);
- BLI_freelinkN(lb, con);
-
- constraint_active_func(ob_v, NULL);
-}
-
-static void del_constraint_func (void *ob_v, void *con_v)
-{
- del_constr_func (ob_v, con_v);
- BIF_undo_push("Delete constraint");
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-static void verify_constraint_name_func (void *con_v, void *name_v)
-{
- Object *ob= OBACT;
- bConstraint *con= con_v;
- char oldname[32];
-
- if (!con)
- return;
-
- /* put on the stack */
- BLI_strncpy(oldname, (char *)name_v, 32);
-
- rename_constraint(ob, con, oldname);
-
- constraint_active_func(ob, con);
- allqueue(REDRAWACTION, 0);
-}
-
-void const_moveUp(void *ob_v, void *con_v)
-{
- bConstraint *con, *constr= con_v;
- ListBase *conlist;
-
- if(constr->prev) {
- conlist = get_active_constraints(ob_v);
- for(con= conlist->first; con; con= con->next) {
- if(con==constr) {
- BLI_remlink(conlist, con);
- BLI_insertlink(conlist, con->prev->prev, con);
- break;
- }
- }
- }
-}
-
-static void constraint_moveUp(void *ob_v, void *con_v)
-{
- const_moveUp(ob_v, con_v);
- BIF_undo_push("Move constraint");
-}
-
-void const_moveDown(void *ob_v, void *con_v)
-{
- bConstraint *con, *constr= con_v;
- ListBase *conlist;
-
- if(constr->next) {
- conlist = get_active_constraints(ob_v);
- for(con= conlist->first; con; con= con->next) {
- if(con==constr) {
- BLI_remlink(conlist, con);
- BLI_insertlink(conlist, con->next, con);
- break;
- }
- }
- }
-}
-
-static void constraint_moveDown(void *ob_v, void *con_v)
-{
- const_moveDown(ob_v, con_v);
- BIF_undo_push("Move constraint");
-}
-
-/* autocomplete callback for buttons */
-void autocomplete_bone(char *str, void *arg_v)
-{
- Object *ob= (Object *)arg_v;
-
- if(ob==NULL || ob->pose==NULL) return;
-
- /* search if str matches the beginning of name */
- if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, 32);
- bPoseChannel *pchan;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next)
- autocomplete_do_name(autocpl, pchan->name);
-
- autocomplete_end(autocpl, str);
- }
-}
-
-/* autocomplete callback for buttons */
-void autocomplete_vgroup(char *str, void *arg_v)
-{
- Object *ob= (Object *)arg_v;
-
- if(ob==NULL) return;
-
- /* search if str matches the beginning of a name */
- if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, 32);
- bDeformGroup *dg;
-
- for(dg= ob->defbase.first; dg; dg= dg->next)
- if(dg->name!=str)
- autocomplete_do_name(autocpl, dg->name);
-
- autocomplete_end(autocpl, str);
- }
-}
-
-/* pole angle callback */
-void con_kinematic_set_pole_angle(void *ob_v, void *con_v)
-{
- bConstraint *con= con_v;
- bKinematicConstraint *data = con->data;
-
- if(data->poletar) {
- if(data->flag & CONSTRAINT_IK_SETANGLE) {
- data->flag |= CONSTRAINT_IK_GETANGLE;
- data->flag &= ~CONSTRAINT_IK_SETANGLE;
- }
- else {
- data->flag &= ~CONSTRAINT_IK_GETANGLE;
- data->flag |= CONSTRAINT_IK_SETANGLE;
- }
- }
-}
-
-/* some commonly used macros in the constraints drawing code */
-#define is_armature_target(target) (target && target->type==OB_ARMATURE)
-#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE))
-#define is_geom_target(target) (target && (ELEM(target->type, OB_MESH, OB_LATTICE)) )
-
-/* Helper function for draw constraint - draws constraint space stuff
- * This function should not be called if no menus are required
- * owner/target: -1 = don't draw menu; 0= not posemode, 1 = posemode
- */
-static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short xco, short yco, short owner, short target)
-{
- short tarx, ownx;
- short bwidth;
-
- /* calculate sizes and placement of menus */
- if (owner == -1) {
- bwidth = 125;
- tarx = 120;
- ownx = 0;
- }
- else if (target == -1) {
- bwidth = 125;
- tarx = 0;
- ownx = 120;
- }
- else {
- bwidth = 100;
- tarx = 95;
- ownx = tarx + bwidth;
- }
-
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "CSpace:", xco, yco, 80,18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiBlockBeginAlign(block);
-
- /* Target-Space */
- if (target == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
- tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in");
- }
- else if (target == 0) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Local (Without Parent) Space %x1",
- tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in");
- }
-
- /* Owner-Space */
- if (owner == 1) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x2|Local with Parent %x3|Local Space %x1",
- ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in");
- }
- else if (owner == 0) {
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Local (Without Parent) Space %x1",
- ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in");
- }
-
- uiBlockEndAlign(block);
-}
-
-/* draw panel showing settings for a constraint */
-static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, short *xco, short *yco)
-{
- Object *ob= OBACT;
- bPoseChannel *pchan= get_active_posechannel(ob);
- bConstraintTypeInfo *cti;
- uiBut *but;
- char typestr[32];
- short height, width = 265;
- short proxy_protected;
- int rb_col;
-
- /* get constraint typeinfo */
- cti= constraint_get_typeinfo(con);
- if (cti == NULL) {
- /* exception for 'Null' constraint - it doesn't have constraint typeinfo! */
- if (con->type == CONSTRAINT_TYPE_NULL)
- strcpy(typestr, "Null");
- else
- strcpy(typestr, "Unknown");
- }
- else
- strcpy(typestr, cti->name);
-
- /* determine whether constraint is proxy protected or not */
- if (proxylocked_constraints_owner(ob, pchan)) {
- proxy_protected= (con->flag & CONSTRAINT_PROXY_LOCAL) ? 0 : 1;
- }
- else
- proxy_protected= 0;
-
- /* unless button has own callback, it adds this callback to button */
- uiBlockSetFunc(block, constraint_active_func, ob, con);
-
- /* Draw constraint header */
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- /* rounded header */
- rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-1, width+40, 22, NULL, 5.0, 0.0,
- (con->flag & CONSTRAINT_EXPAND)?3:15 , rb_col-20, "");
-
- /* open/close */
- uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_DISCLOSURE_TRI_RIGHT, *xco-10, *yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint");
-
- /* name */
- if ((con->flag & CONSTRAINT_EXPAND) && (proxy_protected==0)) {
- if (con->flag & CONSTRAINT_DISABLE)
- uiBlockSetCol(block, TH_REDALERT);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, *xco+10, *yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", *xco+120, *yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name");
- uiButSetFunc(but, verify_constraint_name_func, con, NULL);
- }
- else {
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- if (con->flag & CONSTRAINT_DISABLE)
- uiBlockSetCol(block, TH_REDALERT);
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, *xco+10, *yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, *xco+120, *yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, "");
- }
-
- uiBlockSetCol(block, TH_AUTO);
-
- /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */
- if (proxy_protected) {
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- /* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, *xco+244, *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected");
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, *xco+262, *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected");
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- else {
- short prev_proxylock, show_upbut, show_downbut;
-
- /* Up/Down buttons:
- * Proxy-constraints are not allowed to occur after local (non-proxy) constraints
- * as that poses problems when restoring them, so disable the "up" button where
- * it may cause this situation.
- *
- * Up/Down buttons should only be shown (or not greyed - todo) if they serve some purpose.
- */
- if (proxylocked_constraints_owner(ob, pchan)) {
- if (con->prev) {
- prev_proxylock= (con->prev->flag & CONSTRAINT_PROXY_LOCAL) ? 0 : 1;
- }
- else
- prev_proxylock= 0;
- }
- else
- prev_proxylock= 0;
-
- show_upbut= ((prev_proxylock == 0) && (con->prev));
- show_downbut= (con->next) ? 1 : 0;
-
- if (show_upbut || show_downbut) {
- uiBlockBeginAlign(block);
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- if (show_upbut) {
- but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack");
- uiButSetFunc(but, constraint_moveUp, ob, con);
- }
-
- if (show_downbut) {
- but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack");
- uiButSetFunc(but, constraint_moveDown, ob, con);
- }
- uiBlockEndAlign(block);
- }
-
-
- /* Close 'button' - emboss calls here disable drawing of 'button' behind X */
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- but = uiDefIconBut(block, BUT, B_CONSTRAINT_CHANGETARGET, ICON_X, *xco+262, *yco, 19, 19, list, 0.0, 0.0, 0.0, 0.0, "Delete constraint");
- uiButSetFunc(but, del_constraint_func, ob, con);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
-
- /* Set but-locks for protected settings (magic numbers are used here!) */
- if (proxy_protected)
- uiSetButLock(1, "Cannot edit Proxy-Protected Constraint");
-
- /* Draw constraint data */
- if ((con->flag & CONSTRAINT_EXPAND) == 0) {
- (*yco) -= 21;
- }
- else {
- switch (con->type) {
-#ifndef DISABLE_PYTHON
- case CONSTRAINT_TYPE_PYTHON:
- {
- bPythonConstraint *data = con->data;
- bConstraintTarget *ct;
- uiBut *but2;
- int tarnum, theight;
- static int pyconindex=0;
- char *menustr;
-
- theight = (data->tarnum)? (data->tarnum * 38) : (38);
- height = theight + 78;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40, height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Script:", *xco+60, *yco-24, 55, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* do the scripts menu */
- menustr = buildmenu_pyconstraints(data->text, &pyconindex);
- but2 = uiDefButI(block, MENU, B_CONSTRAINT_TEST, menustr,
- *xco+120, *yco-24, 150, 20, &pyconindex,
- 0, 0, 0, 0, "Set the Script Constraint to use");
- uiButSetFunc(but2, validate_pyconstraint_cb, data, &pyconindex);
- MEM_freeN(menustr);
-
- /* draw target(s) */
- if (data->flag & PYCON_USETARGETS) {
- /* Draw target parameters */
- for (ct=data->targets.first, tarnum=1; ct; ct=ct->next, tarnum++) {
- char tarstr[32];
- short yoffset= ((tarnum-1) * 38);
-
- /* target label */
- sprintf(tarstr, "Target %d:", tarnum);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, tarstr, *xco+45, *yco-(48+yoffset), 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* target space-selector - per target */
- if (is_armature_target(ct->tar)) {
- uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1",
- *xco+10, *yco-(66+yoffset), 100, 18, &ct->space, 0, 0, 0, 0, "Choose space that target is evaluated in");
- }
- else {
- uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Local (Without Parent) Space %x1",
- *xco+10, *yco-(66+yoffset), 100, 18, &ct->space, 0, 0, 0, 0, "Choose space that target is evaluated in");
- }
-
- uiBlockBeginAlign(block);
- /* target object */
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-(48+yoffset), 150, 18, &ct->tar, "Target Object");
-
- /* subtarget */
- if (is_armature_target(ct->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-(66+yoffset),150,18, &ct->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ct->tar);
- }
- else if (is_geom_target(ct->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-(66+yoffset),150,18, &ct->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ct->tar);
- }
- else {
- strcpy(ct->subtarget, "");
- }
- uiBlockEndAlign(block);
- }
- }
- else {
- /* Draw indication that no target needed */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+60, *yco-48, 55, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Not Applicable", *xco+120, *yco-48, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- }
-
- /* settings */
- uiBlockBeginAlign(block);
- but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Options", *xco, *yco-(52+theight), (width/2),18, NULL, 0, 24, 0, 0, "Change some of the constraint's settings.");
- uiButSetFunc(but, BPY_pyconstraint_settings, data, NULL);
-
- but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Refresh", *xco+((width/2)+10), *yco-(52+theight), (width/2),18, NULL, 0, 24, 0, 0, "Force constraint to refresh it's settings");
- uiBlockEndAlign(block);
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-(73+theight), is_armature_owner(ob), -1);
- }
- break;
-#endif /* DISABLE_PYTHON */
- case CONSTRAINT_TYPE_ACTION:
- {
- bActionConstraint *data = con->data;
- float minval, maxval;
-
- height = 108;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
-
- uiBlockEndAlign(block);
-
- /* Draw action/type buttons */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, B_CONSTRAINT_TEST, "AC:", *xco+((width/2)-117), *yco-64, 78, 18, &data->act, "Action containing the keyed motion for this bone");
- uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Key on%t|Loc X%x20|Loc Y%x21|Loc Z%x22|Rot X%x0|Rot Y%x1|Rot Z%x2|Size X%x10|Size Y%x11|Size Z%x12", *xco+((width/2)-117), *yco-84, 78, 18, &data->type, 0, 24, 0, 0, "Specify which transformation channel from the target is used to key the action");
- uiBlockEndAlign(block);
-
- /* Draw start/end frame buttons */
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM, B_CONSTRAINT_TEST, "Start:", *xco+((width/2)-36), *yco-64, 78, 18, &data->start, 1, MAXFRAME, 0.0, 0.0, "Starting frame of the keyed motion");
- uiDefButI(block, NUM, B_CONSTRAINT_TEST, "End:", *xco+((width/2)-36), *yco-84, 78, 18, &data->end, 1, MAXFRAME, 0.0, 0.0, "Ending frame of the keyed motion");
- uiBlockEndAlign(block);
-
- /* Draw minimum/maximum transform range buttons */
- uiBlockBeginAlign(block);
- if (data->type < 10) { /* rotation */
- minval = -180.0f;
- maxval = 180.0f;
- }
- else if (data->type < 20) { /* scaling */
- minval = 0.0001f;
- maxval = 1000.0f;
- }
- else { /* location */
- minval = -1000.0f;
- maxval = 1000.0f;
- }
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Min:", *xco+((width/2)+45), *yco-64, 78, 18, &data->min, minval, maxval, 0, 0, "Minimum value for target channel range");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Max:", *xco+((width/2)+45), *yco-84, 78, 18, &data->max, minval, maxval, 0, 0, "Maximum value for target channel range");
- uiBlockEndAlign(block);
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-104, -1, is_armature_target(data->tar));
- }
- break;
- case CONSTRAINT_TYPE_CHILDOF:
- {
- bChildOfConstraint *data = con->data;
- short normButWidth = (width/3);
-
- height = 165;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Parent:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object to use as Parent");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone to use as Parent");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- /* Draw triples of channel toggles */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Use Channel(s):", *xco+65, *yco-64, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, CHILDOF_LOCX, B_CONSTRAINT_TEST, "Loc X", *xco, *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-location");
- uiDefButBitI(block, TOG, CHILDOF_LOCY, B_CONSTRAINT_TEST, "Loc Y", *xco+normButWidth, *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-location");
- uiDefButBitI(block, TOG, CHILDOF_LOCZ, B_CONSTRAINT_TEST, "Loc Z", *xco+(normButWidth * 2), *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-location");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, CHILDOF_ROTX, B_CONSTRAINT_TEST, "Rot X", *xco, *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-rotation");
- uiDefButBitI(block, TOG, CHILDOF_ROTY, B_CONSTRAINT_TEST, "Rot Y", *xco+normButWidth, *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-rotation");
- uiDefButBitI(block, TOG, CHILDOF_ROTZ, B_CONSTRAINT_TEST, "Rot Z", *xco+(normButWidth * 2), *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-rotation");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, CHILDOF_SIZEX, B_CONSTRAINT_TEST, "Scale X", *xco, *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-scaling");
- uiDefButBitI(block, TOG, CHILDOF_SIZEY, B_CONSTRAINT_TEST, "Scale Y", *xco+normButWidth, *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-scaling");
- uiDefButBitI(block, TOG, CHILDOF_SIZEZ, B_CONSTRAINT_TEST, "Scale Z", *xco+(normButWidth * 2), *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-scaling");
- uiBlockEndAlign(block);
-
-
- /* Inverse options */
- uiBlockBeginAlign(block);
- but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Set Offset", *xco, *yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Calculate current Parent-Inverse Matrix (i.e. restore offset from parent)");
- uiButSetFunc(but, childof_const_setinv, con, NULL);
-
- but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Clear Offset", *xco+((width/2)+10), *yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Clear Parent-Inverse Matrix (i.e. clear offset from parent)");
- uiButSetFunc(but, childof_const_clearinv, con, NULL);
- uiBlockEndAlign(block);
- }
- break;
- case CONSTRAINT_TYPE_LOCLIKE:
- {
- bLocateLikeConstraint *data = con->data;
-
- height = 111;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- /* Draw XYZ toggles */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, LOCLIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component");
- uiDefButBitI(block, TOG, LOCLIKE_X_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert X component");
- uiDefButBitI(block, TOG, LOCLIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component");
- uiDefButBitI(block, TOG, LOCLIKE_Y_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Y component");
- uiDefButBitI(block, TOG, LOCLIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+96), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component");
- uiDefButBitI(block, TOG, LOCLIKE_Z_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+128), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Z component");
- uiBlockEndAlign(block);
-
- /* Draw options */
- uiDefButBitI(block, TOG, LOCLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-89, (width/2), 18, &data->flag, 0, 24, 0, 0, "Add original location onto copied location");
- if (is_armature_target(data->tar)) {
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco+(width/2), *yco-89, (width/2), 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1");
- }
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-109, is_armature_owner(ob), is_armature_target(data->tar));
- }
- break;
- case CONSTRAINT_TYPE_ROTLIKE:
- {
- bRotateLikeConstraint *data = con->data;
-
- height = 101;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- /* Draw XYZ toggles */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, ROTLIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component");
- uiDefButBitI(block, TOG, ROTLIKE_X_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert X component");
- uiDefButBitI(block, TOG, ROTLIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component");
- uiDefButBitI(block, TOG, ROTLIKE_Y_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Y component");
- uiDefButBitI(block, TOG, ROTLIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+96), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component");
- uiDefButBitI(block, TOG, ROTLIKE_Z_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+128), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Z component");
- uiBlockEndAlign(block);
-
- /* draw offset toggle */
- uiDefButBitI(block, TOG, ROTLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original rotation onto copied rotation");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar));
- }
- break;
- case CONSTRAINT_TYPE_SIZELIKE:
- {
- bSizeLikeConstraint *data = con->data;
-
- height = 101;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- /* Draw XYZ toggles */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SIZELIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component");
- uiDefButBitI(block, TOG, SIZELIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component");
- uiDefButBitI(block, TOG, SIZELIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component");
- uiBlockEndAlign(block);
-
- /* draw offset toggle */
- uiDefButBitI(block, TOG, SIZELIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original scaling onto copied scaling");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar));
- }
- break;
- case CONSTRAINT_TYPE_KINEMATIC:
- {
- bKinematicConstraint *data = con->data;
-
- height = 146;
- if(data->poletar)
- height += 30;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- /* IK Target */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco, *yco-24, 80, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco, *yco-44, 137, 19, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco, *yco-62,137,19, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco, *yco-62,137,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy (data->subtarget, "");
- }
-
- uiBlockEndAlign(block);
-
- /* Settings */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, CONSTRAINT_IK_TIP, B_CONSTRAINT_TEST, "Use Tail", *xco, *yco-92, 137, 19, &data->flag, 0, 0, 0, 0, "Include Bone's tail also last element in Chain");
- uiDefButS(block, NUM, B_CONSTRAINT_TEST, "ChainLen:", *xco, *yco-112,137,19, &data->rootbone, 0, 255, 0, 0, "If not zero, the amount of bones in this chain");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_CONSTRAINT_TEST, "PosW ", *xco+147, *yco-92, 137, 19, &data->weight, 0.01, 1.0, 2, 2, "For Tree-IK: weight of position control for this target");
- uiDefButBitS(block, TOG, CONSTRAINT_IK_ROT, B_CONSTRAINT_TEST, "Rot", *xco+147, *yco-112, 40,19, &data->flag, 0, 0, 0, 0, "Chain follows rotation of target");
- uiDefButF(block, NUMSLI, B_CONSTRAINT_TEST, "W ", *xco+187, *yco-112, 97, 19, &data->orientweight, 0.01, 1.0, 2, 2, "For Tree-IK: Weight of orientation control for this target");
-
- uiBlockBeginAlign(block);
-
- uiDefButBitS(block, TOG, CONSTRAINT_IK_STRETCH, B_CONSTRAINT_TEST, "Stretch", *xco, *yco-137,137,19, &data->flag, 0, 0, 0, 0, "Enable IK stretching");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_CONSTRAINT_TEST, "Iterations:", *xco+147, *yco-137, 137, 19, &data->iterations, 1, 10000, 0, 0, "Maximum number of solving iterations");
- uiBlockEndAlign(block);
-
- /* Pole Vector */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Pole Target:", *xco+147, *yco-24, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+147, *yco-44, 137, 19, &data->poletar, "Pole Target Object");
- if (is_armature_target(data->poletar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+147, *yco-62,137,19, &data->polesubtarget, 0, 24, 0, 0, "Pole Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->poletar);
- }
- else if (is_geom_target(data->poletar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+147, *yco-62,137,18, &data->polesubtarget, 0, 24, 0, 0, "Name of Vertex Group defining pole 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->poletar);
- }
- else {
- strcpy(data->polesubtarget, "");
- }
-
- if (data->poletar) {
- uiBlockBeginAlign(block);
-#if 0
- but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, (data->flag & CONSTRAINT_IK_SETANGLE)? "Set Pole Offset": "Clear Pole Offset", *xco, *yco-167, 137, 19, 0, 0.0, 1.0, 0.0, 0.0, "Set the pole rotation offset from the current pose");
- uiButSetFunc(but, con_kinematic_set_pole_angle, ob, con);
- if (!(data->flag & CONSTRAINT_IK_SETANGLE))
-#endif
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pole Offset ", *xco, *yco-167, 137, 19, &data->poleangle, -180.0, 180.0, 0, 0, "Pole rotation offset");
- }
- }
- break;
- case CONSTRAINT_TYPE_TRACKTO:
- {
- bTrackToConstraint *data = con->data;
-
- if (is_armature_target(data->tar))
- height = 118;
- else
- height = 96;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Align:", *xco+5, *yco-42, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButBitI(block, TOG, 1, B_CONSTRAINT_TEST, "TargetZ", *xco+60, *yco-42, 50, 18, &data->flags, 0, 1, 0, 0, "Target Z axis, not world Z axis, will constrain up direction");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "To:", *xco+12, *yco-64, 25, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->reserved1, 12.0, 0.0, 0, 0, "X axis points to the target object");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->reserved1, 12.0, 1.0, 0, 0, "Y axis points to the target object");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->reserved1, 12.0, 2.0, 0, 0, "Z axis points to the target object");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->reserved1, 12.0, 3.0, 0, 0, "-X axis points to the target object");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->reserved1, 12.0, 4.0, 0, 0, "-Y axis points to the target object");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->reserved1, 12.0, 5.0, 0, 0, "-Z axis points to the target object");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Up:", *xco+174, *yco-64, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->reserved2, 13.0, 0.0, 0, 0, "X axis points upward");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->reserved2, 13.0, 1.0, 0, 0, "Y axis points upward");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->reserved2, 13.0, 2.0, 0, 0, "Z axis points upward");
- uiBlockEndAlign(block);
-
- if (is_armature_target(data->tar)) {
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco, *yco-94, 241, 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-116, is_armature_owner(ob), is_armature_target(data->tar));
- }
- else {
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar));
- }
- }
- break;
- case CONSTRAINT_TYPE_MINMAX:
- {
- bMinMaxConstraint *data = con->data;
-
- if (is_armature_target(data->tar))
- height = 88;
- else
- height = 66;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Offset:", *xco, *yco-44, 100, 18, &data->offset, -100, 100, 100.0, 0.0, "Offset from the position of the object center");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, MINMAX_STICKY, B_CONSTRAINT_TEST, "Sticky", *xco, *yco-24, 44, 18, &data->flag, 0, 24, 0, 0, "Immobilize object while constrained");
- uiDefButBitI(block, TOG, MINMAX_USEROT, B_CONSTRAINT_TEST, "Use Rot", *xco+44, *yco-24, 64, 18, &data->flag, 0, 24, 0, 0, "Use target object rotation");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Max/Min:", *xco-8, *yco-64, 54, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiBlockBeginAlign(block);
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+51, *yco-64,17,18, &data->minmaxflag, 12.0, 0.0, 0, 0, "Will not pass below X of target");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+67, *yco-64,17,18, &data->minmaxflag, 12.0, 1.0, 0, 0, "Will not pass below Y of target");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+85, *yco-64,17,18, &data->minmaxflag, 12.0, 2.0, 0, 0, "Will not pass below Z of target");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+102, *yco-64,24,18, &data->minmaxflag, 12.0, 3.0, 0, 0, "Will not pass above X of target");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+126, *yco-64,24,18, &data->minmaxflag, 12.0, 4.0, 0, 0, "Will not pass above Y of target");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+150, *yco-64,24,18, &data->minmaxflag, 12.0, 5.0, 0, 0, "Will not pass above Z of target");
- uiBlockEndAlign(block);
-
- if (is_armature_target(data->tar)) {
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco, *yco-86, 241, 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1");
- }
-
- }
- break;
- case CONSTRAINT_TYPE_LOCKTRACK:
- {
- bLockTrackConstraint *data = con->data;
- height = 66;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "To:", *xco+12, *yco-64, 25, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->trackflag, 12.0, 0.0, 0, 0, "X axis points to the target object");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->trackflag, 12.0, 1.0, 0, 0, "Y axis points to the target object");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->trackflag, 12.0, 2.0, 0, 0, "Z axis points to the target object");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->trackflag, 12.0, 3.0, 0, 0, "-X axis points to the target object");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->trackflag, 12.0, 4.0, 0, 0, "-Y axis points to the target object");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->trackflag, 12.0, 5.0, 0, 0, "-Z axis points to the target object");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Lock:", *xco+166, *yco-64, 38, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->lockflag, 13.0, 0.0, 0, 0, "X axis is locked");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->lockflag, 13.0, 1.0, 0, 0, "Y axis is locked");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->lockflag, 13.0, 2.0, 0, 0, "Z axis is locked");
- uiBlockEndAlign(block);
- }
- break;
- case CONSTRAINT_TYPE_FOLLOWPATH:
- {
- bFollowPathConstraint *data = con->data;
-
- height = 66;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- /* Draw Curve Follow toggle */
- uiDefButBitI(block, TOG, 1, B_CONSTRAINT_TEST, "CurveFollow", *xco+39, *yco-44, 100, 18, &data->followflag, 0, 24, 0, 0, "Object will follow the heading and banking of the curve");
-
- /* Draw Offset number button */
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Offset:", *xco+155, *yco-44, 100, 18, &data->offset, -MAXFRAMEF, MAXFRAMEF, 100.0, 0.0, "Offset from the position corresponding to the time frame");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Fw:", *xco+12, *yco-64, 27, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->trackflag, 12.0, 0.0, 0, 0, "The axis that points forward along the path");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->trackflag, 12.0, 1.0, 0, 0, "The axis that points forward along the path");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->trackflag, 12.0, 2.0, 0, 0, "The axis that points forward along the path");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->trackflag, 12.0, 3.0, 0, 0, "The axis that points forward along the path");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->trackflag, 12.0, 4.0, 0, 0, "The axis that points forward along the path");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->trackflag, 12.0, 5.0, 0, 0, "The axis that points forward along the path");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Up:", *xco+174, *yco-64, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->upflag, 13.0, 0.0, 0, 0, "The axis that points upward");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->upflag, 13.0, 1.0, 0, 0, "The axis that points upward");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->upflag, 13.0, 2.0, 0, 0, "The axis that points upward");
- uiBlockEndAlign(block);
- }
- break;
- case CONSTRAINT_TYPE_STRETCHTO:
- {
- bStretchToConstraint *data = con->data;
-
- height = 105;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- if (is_armature_target(data->tar)) {
- uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->orglength, 0.0, 0, 0, 0, "Recalculate RLength");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Rest Length:", *xco+18, *yco-60,139,18, &data->orglength, 0.0, 100, 0.5, 0.5, "Length at Rest Position");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco+155, *yco-60,98,18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1");
- }
- else {
- uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->orglength, 0.0, 0, 0, 0, "Recalculate RLength");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Rest Length:", *xco+18, *yco-60, 237, 18, &data->orglength, 0.0, 100, 0.5, 0.5, "Length at Rest Position");
- }
- uiBlockEndAlign(block);
-
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Volume Variation:", *xco+18, *yco-82, 237, 18, &data->bulge, 0.0, 100, 0.5, 0.5, "Factor between volume variation and stretching");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Vol:",*xco+14, *yco-104,30,18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"XZ", *xco+44, *yco-104,30,18, &data->volmode, 12.0, 0.0, 0, 0, "Keep Volume: Scaling X & Z");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+74, *yco-104,20,18, &data->volmode, 12.0, 1.0, 0, 0, "Keep Volume: Scaling X");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+94, *yco-104,20,18, &data->volmode, 12.0, 2.0, 0, 0, "Keep Volume: Scaling Z");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"NONE", *xco+114, *yco-104,50,18, &data->volmode, 12.0, 3.0, 0, 0, "Ignore Volume");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST,"Plane:",*xco+175, *yco-104,40,18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+215, *yco-104,20,18, &data->plane, 12.0, 0.0, 0, 0, "Keep X axis");
- uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+235, *yco-104,20,18, &data->plane, 12.0, 2.0, 0, 0, "Keep Z axis");
- uiBlockEndAlign(block);
- }
- break;
- case CONSTRAINT_TYPE_LOCLIMIT:
- {
- bLocLimitConstraint *data = con->data;
-
- int togButWidth = 50;
- int textButWidth = ((width/2)-togButWidth);
-
- height = 136;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- /* Draw Pairs of LimitToggle+LimitValue */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_XMIN, B_CONSTRAINT_TEST, "minX", *xco, *yco-28, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-28, (textButWidth-5), 18, &(data->xmin), -1000, 1000, 0.1,0.5,"Lowest x value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_XMAX, B_CONSTRAINT_TEST, "maxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-28, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-28, (textButWidth-5), 18, &(data->xmax), -1000, 1000, 0.1,0.5,"Highest x value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_YMIN, B_CONSTRAINT_TEST, "minY", *xco, *yco-50, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-50, (textButWidth-5), 18, &(data->ymin), -1000, 1000, 0.1,0.5,"Lowest y value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_YMAX, B_CONSTRAINT_TEST, "maxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-50, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-50, (textButWidth-5), 18, &(data->ymax), -1000, 1000, 0.1,0.5,"Highest y value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_ZMIN, B_CONSTRAINT_TEST, "minZ", *xco, *yco-72, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-72, (textButWidth-5), 18, &(data->zmin), -1000, 1000, 0.1,0.5,"Lowest z value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_ZMAX, B_CONSTRAINT_TEST, "maxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-72, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum z value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-72, (textButWidth-5), 18, &(data->zmax), -1000, 1000, 0.1,0.5,"Highest z value to allow");
- uiBlockEndAlign(block);
-
- /* special option(s) */
- uiDefButBitS(block, TOG, LIMIT_TRANSFORM, B_CONSTRAINT_TEST, "For Transform", *xco+(width/4), *yco-100, (width/2), 18, &data->flag2, 0, 24, 0, 0, "Transforms are affected by this constraint as well");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-130, is_armature_owner(ob), -1);
- }
- break;
- case CONSTRAINT_TYPE_ROTLIMIT:
- {
- bRotLimitConstraint *data = con->data;
- int normButWidth = (width/3);
-
- height = 136;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- /* Draw Pairs of LimitToggle+LimitValue */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_XROT, B_CONSTRAINT_TEST, "LimitX", *xco, *yco-28, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on x-axis");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-28, normButWidth, 18, &(data->xmin), -360, 360, 0.1,0.5,"Lowest x value to allow");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-28, normButWidth, 18, &(data->xmax), -360, 360, 0.1,0.5,"Highest x value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_YROT, B_CONSTRAINT_TEST, "LimitY", *xco, *yco-50, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on y-axis");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-50, normButWidth, 18, &(data->ymin), -360, 360, 0.1,0.5,"Lowest y value to allow");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-50, normButWidth, 18, &(data->ymax), -360, 360, 0.1,0.5,"Highest y value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_ZROT, B_CONSTRAINT_TEST, "LimitZ", *xco, *yco-72, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on z-axis");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-72, normButWidth, 18, &(data->zmin), -360, 360, 0.1,0.5,"Lowest z value to allow");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-72, normButWidth, 18, &(data->zmax), -360, 360, 0.1,0.5,"Highest z value to allow");
- uiBlockEndAlign(block);
-
- /* special option(s) */
- uiDefButBitS(block, TOG, LIMIT_TRANSFORM, B_CONSTRAINT_TEST, "For Transform", *xco+(width/4), *yco-100, (width/2), 18, &data->flag2, 0, 24, 0, 0, "Transforms are affected by this constraint as well");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-130, is_armature_owner(ob), -1);
- }
- break;
- case CONSTRAINT_TYPE_SIZELIMIT:
- {
- bSizeLimitConstraint *data = con->data;
-
- int togButWidth = 50;
- int textButWidth = ((width/2)-togButWidth);
-
- height = 136;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- /* Draw Pairs of LimitToggle+LimitValue */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_XMIN, B_CONSTRAINT_TEST, "minX", *xco, *yco-28, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-28, (textButWidth-5), 18, &(data->xmin), 0.0001, 1000, 0.1,0.5,"Lowest x value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_XMAX, B_CONSTRAINT_TEST, "maxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-28, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-28, (textButWidth-5), 18, &(data->xmax), 0.0001, 1000, 0.1,0.5,"Highest x value to allow");
- uiBlockEndAlign(block);
-
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_YMIN, B_CONSTRAINT_TEST, "minY", *xco, *yco-50, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-50, (textButWidth-5), 18, &(data->ymin), 0.0001, 1000, 0.1,0.5,"Lowest y value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_YMAX, B_CONSTRAINT_TEST, "maxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-50, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-50, (textButWidth-5), 18, &(data->ymax), 0.0001, 1000, 0.1,0.5,"Highest y value to allow");
- uiBlockEndAlign(block);
-
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_ZMIN, B_CONSTRAINT_TEST, "minZ", *xco, *yco-72, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-72, (textButWidth-5), 18, &(data->zmin), 0.0001, 1000, 0.1,0.5,"Lowest z value to allow");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LIMIT_ZMAX, B_CONSTRAINT_TEST, "maxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-72, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum z value");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-72, (textButWidth-5), 18, &(data->zmax), 0.0001, 1000, 0.1,0.5,"Highest z value to allow");
- uiBlockEndAlign(block);
-
- /* special option(s) */
- uiDefButBitS(block, TOG, LIMIT_TRANSFORM, B_CONSTRAINT_TEST, "For Transform", *xco+(width/4), *yco-100, (width/2), 18, &data->flag2, 0, 24, 0, 0, "Transforms are affected by this constraint as well");
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-130, is_armature_owner(ob), -1);
- }
- break;
- case CONSTRAINT_TYPE_DISTLIMIT:
- {
- bDistLimitConstraint *data = con->data;
-
- height = 105;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- if (is_armature_target(data->tar)) {
- but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- if (is_armature_target(data->tar)) {
- uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->dist, 0, 0, 0, 0, "Recalculate distance");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Distance:", *xco+18, *yco-60,139,18, &data->dist, 0.0, 100, 0.5, 0.5, "Radius of limiting sphere");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco+155, *yco-60,100,18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1");
- }
- else {
- uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->dist, 0, 0, 0, 0, "Recalculate distance");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Distance:", *xco+18, *yco-60, 237, 18, &data->dist, 0.0, 100, 0.5, 0.5, "Radius of limiting sphere");
- }
-
- /* disabled soft-distance controls... currently it doesn't work yet. It was intended to be used for soft-ik (see xsi-blog for details) */
-#if 0
- uiDefButBitS(block, TOG, LIMITDIST_USESOFT, B_CONSTRAINT_TEST, "Soft", *xco, *yco-82, 50, 18, &data->flag, 0, 24, 0, 0, "Enables soft-distance");
- if (data->flag & LIMITDIST_USESOFT)
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Soft-Distance:", *xco+50, *yco-82, 187, 18, &data->soft, 0.0, 100, 0.5, 0.5, "Distance surrounding radius when transforms should get 'delayed'");
-#endif
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Clamp Region:",*xco+((width/2)-110), *yco-104,100,18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Limit Mode%t|Inside %x0|Outside %x1|Surface %x2", *xco+(width/2), *yco-104, 100, 18, &data->mode, 0, 24, 0, 0, "Distances in relation to sphere of influence to allow");
- }
- break;
- case CONSTRAINT_TYPE_RIGIDBODYJOINT:
- {
- bRigidBodyJointConstraint *data = con->data;
- float extremeLin = 999.f;
- float extremeAngX = 180.f;
- float extremeAngY = 45.f;
- float extremeAngZ = 45.f;
- int togButWidth = 70;
- int offsetY = 150;
- int textButWidth = ((width/2)-togButWidth);
-
- height = 140;
- if (data->type==CONSTRAINT_RB_GENERIC6DOF)
- height = 270;
- if (data->type==CONSTRAINT_RB_CONETWIST)
- height = 200;
-
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefButI(block, MENU, B_CONSTRAINT_TEST, "Joint Types%t|Ball%x1|Hinge%x2|Cone Twist%x4|Generic (experimental)%x12",//|Extra Force%x6",
- *xco, *yco-25, 150, 18, &data->type, 0, 0, 0, 0, "Choose the joint type");
-
- uiDefButBitS(block, TOG, CONSTRAINT_DISABLE_LINKED_COLLISION, B_CONSTRAINT_TEST, "No Col.", *xco+155, *yco-25, 111, 18, &data->flag, 0, 24, 0, 0, "Disable Collision Between Linked Bodies");
-
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "toObject:", *xco, *yco-50, 130, 18, &data->tar, "Child Object");
- uiDefButBitS(block, TOG, CONSTRAINT_DRAW_PIVOT, B_CONSTRAINT_TEST, "ShowPivot", *xco+135, *yco-50, 130, 18, &data->flag, 0, 24, 0, 0, "Show pivot position and rotation");
-
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot X:", *xco, *yco-75, 130, 18, &data->pivX, -1000, 1000, 100, 0.0, "Offset pivot on X");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot Y:", *xco, *yco-100, 130, 18, &data->pivY, -1000, 1000, 100, 0.0, "Offset pivot on Y");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot Z:", *xco, *yco-125, 130, 18, &data->pivZ, -1000, 1000, 100, 0.0, "Offset pivot on z");
-
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax X:", *xco+135, *yco-75, 130, 18, &data->axX, -360, 360, 1500, 0.0, "Rotate pivot on X Axis (in degrees)");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax Y:", *xco+135, *yco-100, 130, 18, &data->axY, -360, 360, 1500, 0.0, "Rotate pivot on Y Axis (in degrees)");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax Z:", *xco+135, *yco-125, 130, 18, &data->axZ, -360, 360, 1500, 0.0, "Rotate pivot on Z Axis (in degrees)");
-
- if (data->type==CONSTRAINT_RB_GENERIC6DOF) {
- /* Draw Pairs of LimitToggle+LimitValue */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMinX", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"min x limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMaxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"max x limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMinY", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"min y limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMaxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"max y limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMinZ", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"min z limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMaxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"max z limit");
- uiBlockEndAlign(block);
- offsetY += 20;
- }
- if ((data->type==CONSTRAINT_RB_GENERIC6DOF) || (data->type==CONSTRAINT_RB_CONETWIST)) {
- /* Draw Pairs of LimitToggle+LimitValue */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMinX", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"min x limit");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMaxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"max x limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMinY", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"min y limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMaxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"max y limit");
- uiBlockEndAlign(block);
-
- offsetY += 20;
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMinZ", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"min z limit");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMaxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"max z limit");
- uiBlockEndAlign(block);
- }
-
- }
- break;
- case CONSTRAINT_TYPE_CLAMPTO:
- {
- bClampToConstraint *data = con->data;
-
- height = 90;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object");
-
- /* Draw XYZ toggles */
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Main Axis:", *xco, *yco-64, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Auto", *xco+100, *yco-64, 50, 18, &data->flag, 12.0, CLAMPTO_AUTO, 0, 0, "Automatically determine main-axis of movement");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST, "X", *xco+150, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_X, 0, 0, "Main axis of movement is x-axis");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Y", *xco+182, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_Y, 0, 0, "Main axis of movement is y-axis");
- uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Z", *xco+214, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_Z, 0, 0, "Main axis of movement is z-axis");
- uiBlockEndAlign(block);
-
- /* Extra Options Controlling Behaviour */
- //uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Options:", *xco, *yco-88, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButBitI(block, TOG, CLAMPTO_CYCLIC, B_CONSTRAINT_TEST, "Cyclic", *xco+((width/2)), *yco-88,60,19, &data->flag2, 0, 0, 0, 0, "Treat curve as cyclic curve (no clamping to curve bounding box)");
- //uiBlockEndAlign(block);
- }
- break;
- case CONSTRAINT_TYPE_TRANSFORM:
- {
- bTransformConstraint *data = con->data;
- float fmin, fmax, tmin, tmax;
-
- height = 178;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
-
- /* Draw target parameters */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* Draw target parameters */
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object to use as Parent");
-
- if (is_armature_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone to use as Parent");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar);
- }
- else if (is_geom_target(data->tar)) {
- but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points");
- uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar);
- }
- else {
- strcpy(data->subtarget, "");
- }
- uiBlockEndAlign(block);
-
- /* Extrapolate Ranges? */
- uiDefButBitC(block, TOG, 1, B_CONSTRAINT_TEST, "Extrapolate", *xco-10, *yco-42,80,19, &data->expo, 0, 0, 0, 0, "Extrapolate ranges");
-
- /* Draw options for source motion */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Source:", *xco-10, *yco-62, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* draw Loc/Rot/Size toggles */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Loc", *xco-5, *yco-82, 45, 18, &data->from, 12.0, 0, 0, 0, "Use Location transform channels from Target");
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Rot", *xco+40, *yco-82, 45, 18, &data->from, 12.0, 1, 0, 0, "Use Rotation transform channels from Target");
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Scale", *xco+85, *yco-82, 45, 18, &data->from, 12.0, 2, 0, 0, "Use Scale transform channels from Target");
- uiBlockEndAlign(block);
-
- /* Draw Pairs of Axis: Min/Max Value*/
- if (data->from == 2) {
- fmin= 0.0001;
- fmax= 1000.0;
- }
- else if (data->from == 1) {
- fmin= -360.0;
- fmax= 360.0;
- }
- else {
- fmin = -1000.0;
- fmax= 1000.0;
- }
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "X:", *xco-10, *yco-107, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-107, 55, 18, &data->from_min[0], fmin, fmax, 0, 0, "Bottom of range of x-axis source motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-107, 55, 18, &data->from_max[0], fmin, fmax, 0, 0, "Top of range of x-axis source motion for source->target mapping");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Y:", *xco-10, *yco-127, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-127, 55, 18, &data->from_min[1], fmin, fmax, 0, 0, "Bottom of range of y-axis source motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-127, 55, 18, &data->from_max[1], fmin, fmax, 0, 0, "Top of range of y-axis source motion for source->target mapping");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Z:", *xco-10, *yco-147, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-147, 55, 18, &data->from_min[2], fmin, fmax, 0, 0, "Bottom of range of z-axis source motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-147, 55, 18, &data->from_max[2], fmin, fmax, 0, 0, "Top of range of z-axis source motion for source->target mapping");
- uiBlockEndAlign(block);
-
-
- /* Draw options for target motion */
- uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Destination:", *xco+150, *yco-62, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, "");
-
- /* draw Loc/Rot/Size toggles */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Loc", *xco+150, *yco-82, 45, 18, &data->to, 12.0, 0, 0, 0, "Use as Location transform");
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Rot", *xco+195, *yco-82, 45, 18, &data->to, 12.0, 1, 0, 0, "Use as Rotation transform");
- uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Scale", *xco+245, *yco-82, 45, 18, &data->to, 12.0, 2, 0, 0, "Use as Scale transform");
- uiBlockEndAlign(block);
-
- /* Draw Pairs of Source-Axis: Min/Max Value*/
- if (data->to == 2) {
- tmin= 0.0001;
- tmax= 1000.0;
- }
- else if (data->to == 1) {
- tmin= -360.0;
- tmax= 360.0;
- }
- else {
- tmin = -1000.0;
- tmax= 1000.0;
- }
-
- uiBlockBeginAlign(block);
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->X%x0|Y->X%x1|Z->X%x2", *xco+150, *yco-107, 40, 18, &data->map[0], 0, 24, 0, 0, "Specify which source axis the x-axis destination uses");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-107, 50, 18, &data->to_min[0], tmin, tmax, 0, 0, "Bottom of range of x-axis destination motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-107, 50, 18, &data->to_max[0], tmin, tmax, 0, 0, "Top of range of x-axis destination motion for source->target mapping");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->Y%x0|Y->Y%x1|Z->Y%x2", *xco+150, *yco-127, 40, 18, &data->map[1], 0, 24, 0, 0, "Specify which source axis the y-axis destination uses");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-127, 50, 18, &data->to_min[1], tmin, tmax, 0, 0, "Bottom of range of y-axis destination motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-127, 50, 18, &data->to_max[1], tmin, tmax, 0, 0, "Top of range of y-axis destination motion for source->target mapping");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->Z%x0|Y->Z%x1|Z->Z%x2", *xco+150, *yco-147, 40, 18, &data->map[2], 0, 24, 0, 0, "Specify which source axis the z-axis destination uses");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-147, 50, 18, &data->to_min[2], tmin, tmax, 0, 0, "Bottom of range of z-axis destination motion for source->target mapping");
- uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-147, 50, 18, &data->to_max[2], tmin, tmax, 0, 0, "Top of range of z-axis destination motion for source->target mapping");
- uiBlockEndAlign(block);
-
- /* constraint space settings */
- draw_constraint_spaceselect(block, con, *xco, *yco-170, is_armature_owner(ob), is_armature_target(data->tar));
- }
- break;
- case CONSTRAINT_TYPE_NULL:
- {
- height = 17;
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, "");
- }
- break;
- default:
- height = 0;
- break;
- }
-
- (*yco)-=(24+height);
- }
-
- if (ELEM(con->type, CONSTRAINT_TYPE_NULL, CONSTRAINT_TYPE_RIGIDBODYJOINT)==0) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_CONSTRAINT_INF, "Influence ", *xco, *yco, 197, 20, &(con->enforce), 0.0, 1.0, 0.0, 0.0, "Amount of influence this constraint will have on the final solution");
- but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Show", *xco+200, *yco, 45, 20, 0, 0.0, 1.0, 0.0, 0.0, "Show constraint's ipo in the Ipo window, adds a channel if not there");
- /* If this is on an object or bone, add ipo channel the constraint */
- uiButSetFunc (but, enable_constraint_ipo_func, ob, con);
- but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Key", *xco+245, *yco, 40, 20, 0, 0.0, 1.0, 0.0, 0.0, "Add an influence keyframe to the constraint");
- /* Add a keyframe to the influence IPO */
- uiButSetFunc (but, add_influence_key_to_constraint_func, ob, con);
- uiBlockEndAlign(block);
- (*yco)-=24;
- }
- else {
- (*yco)-=3;
- }
-
- /* clear any locks set up for proxies/lib-linking */
- uiClearButLock();
-}
-
-static uiBlock *add_constraintmenu(void *arg_unused)
-{
- Object *ob= OBACT;
- uiBlock *block;
- ListBase *conlist;
- short yco= 0;
-
- conlist = get_active_constraints(ob);
-
- block= uiNewBlock(&curarea->uiblocks, "add_constraintmenu", UI_EMBOSSP, UI_HELV, curarea->win);
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_CHILDOF, "Child Of", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_TRANSFORM, "Transformation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCLIKE, "Copy Location", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ROTLIKE, "Copy Rotation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_SIZELIKE, "Copy Scale", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCLIMIT, "Limit Location", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ROTLIMIT, "Limit Rotation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_SIZELIMIT, "Limit Scale", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_DISTLIMIT, "Limit Distance", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_TRACKTO, "Track To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_MINMAX, "Floor", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCKTRACK, "Locked Track", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_FOLLOWPATH, "Follow Path", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_CLAMPTO, "Clamp To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_STRETCHTO, "Stretch To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_RIGIDBODYJOINT, "Rigid Body Joint", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");//rcruiz
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (ob->flag & OB_POSEMODE) {
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_KINEMATIC, "IK Solver", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- }
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ACTION, "Action", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_PYTHON, "Script", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, BUTM, B_CONSTRAINT_ADD_NULL, "Null", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
-
-
- uiTextBoundsBlock(block, 50);
- uiBlockSetDirection(block, UI_DOWN);
-
- return block;
-}
-
-void do_constraintbuts(unsigned short event)
-{
- Object *ob= OBACT;
- bConstraint *con;
-
- switch(event) {
- case B_CONSTRAINT_TEST:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break; // no handling
- case B_CONSTRAINT_INF:
- /* influence; do not execute actions for 1 dag_flush */
- if (ob->pose)
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
-
- case B_CONSTRAINT_CHANGETARGET:
- if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
- DAG_scene_sort(G.scene);
- break;
-
- case B_CONSTRAINT_ADD_NULL:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_NULL);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_PYTHON:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_PYTHON);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_KINEMATIC:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_CHILDOF:
- {
- con= add_new_constraint(CONSTRAINT_TYPE_CHILDOF);
- add_constraint_to_active(ob, con);
-
- /* if this constraint is being added to a posechannel, make sure
- * the constraint gets evaluated in pose-space
- */
- if (ob->flag & OB_POSEMODE) {
- con->ownspace = CONSTRAINT_SPACE_POSE;
- con->flag |= CONSTRAINT_SPACEONCE;
- }
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_TRACKTO:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_MINMAX:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_MINMAX);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_ROTLIKE:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_ROTLIKE);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_LOCLIKE:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_LOCLIKE);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_SIZELIKE:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_SIZELIKE);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_ACTION:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_ACTION);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_LOCKTRACK:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_FOLLOWPATH:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_STRETCHTO:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_STRETCHTO);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_LOCLIMIT:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_LOCLIMIT);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_ROTLIMIT:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_ROTLIMIT);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_SIZELIMIT:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_SIZELIMIT);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_RIGIDBODYJOINT:
- {
- bRigidBodyJointConstraint *data;
- Base *base_iter;
-
- con = add_new_constraint(CONSTRAINT_TYPE_RIGIDBODYJOINT);
- add_constraint_to_active(ob, con);
-
- /* set selected first object as target - moved from new_constraint_data */
- data = (bRigidBodyJointConstraint*)con->data;
- base_iter = G.scene->base.first;
- while ( base_iter && !data->tar ) {
- if( ( ( base_iter->flag & SELECT ) &&
-// ( base_iter->lay & G.vd->lay ) ) &&
- ( base_iter != G.scene->basact ) ))
- {
- data->tar=base_iter->object;
- break;
- }
- base_iter = base_iter->next;
- }
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_CLAMPTO:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_CLAMPTO);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_TRANSFORM:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_TRANSFORM);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
- case B_CONSTRAINT_ADD_DISTLIMIT:
- {
- con = add_new_constraint(CONSTRAINT_TYPE_DISTLIMIT);
- add_constraint_to_active(ob, con);
-
- BIF_undo_push("Add constraint");
- }
- break;
-
- default:
- break;
- }
-
- object_test_constraints(ob);
-
- if(ob->pose) update_pose_constraint_flags(ob->pose);
-
- if(ob->type==OB_ARMATURE) DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
- else DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-void pointcache_bake(PTCacheID *pid, int startframe)
-{
- Base *base;
- ScrArea *sa;
- PointCache *cache;
- ListBase pidlist;
- float frameleno= G.scene->r.framelen;
- int cfrao= CFRA, didbreak =0, endframe, cstart, cend;
-
- G.scene->r.framelen= 1.0; // baking has to be in uncorrected time
- sbSetInterruptCallBack(blender_test_break); // make softbody module ESC aware
- G.afbreek=0; // init global break system
-
- if(pid) {
- cache= pid->cache;
-
- BKE_ptcache_id_time(pid, 0.0f, &cstart, &cend, NULL);
-
- startframe= startframe;
- endframe= cend;
-
- cache->flag |= PTCACHE_BAKING;
- cache->flag &= ~PTCACHE_BAKED;
- }
- else {
- startframe= MAXFRAME;
- endframe= 0;
-
- for(base=G.scene->base.first; base; base= base->next) {
- if(TESTBASELIB(base)) {
- BKE_ptcache_ids_from_object(&pidlist, base->object);
-
- for(pid=pidlist.first; pid; pid=pid->next) {
- cache= pid->cache;
-
- BKE_ptcache_id_time(pid, 0.0f, &cstart, &cend, NULL);
-
- startframe= MIN2(startframe, cstart);
- endframe= MAX2(endframe, cend);
-
- cache->flag |= PTCACHE_BAKING;
- cache->flag &= ~PTCACHE_BAKED;
- }
-
- BLI_freelistN(&pidlist);
- }
- }
- }
-
- CFRA= startframe;
- update_for_newframe_muted(); // put everything on this frame
-
- curarea->win_swap= 0; // clean swapbuffers
-
- for(; CFRA <= endframe; CFRA++) {
- set_timecursor(CFRA);
-
- update_for_newframe_muted();
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next)
- if(sa->spacetype == SPACE_VIEW3D)
- scrarea_do_windraw(sa);
- screen_swapbuffers();
-
- //blender_test_break() has a granularity of 10 ms, who cares .. baking the unit cube is kinda boring
- if(blender_test_break()) {
- didbreak = 1;
- break;
- }
- }
-
- if(didbreak && G.qual!=LR_SHIFTKEY) {
- /* failed to bake, free the frames we baked */
- if(pid) {
- cache= pid->cache;
-
- BKE_ptcache_id_time(pid, 0.0f, &cstart, &cend, NULL);
-
- cache->flag &= ~PTCACHE_BAKING;
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_OUTDATED);
- }
- else {
- for(base=G.scene->base.first; base; base= base->next) {
- if(TESTBASELIB(base)) {
- BKE_ptcache_ids_from_object(&pidlist, base->object);
-
- for(pid=pidlist.first; pid; pid=pid->next) {
- cache= pid->cache;
-
- BKE_ptcache_id_time(pid, 0.0f, &cstart, &cend, NULL);
-
- cache->flag &= ~PTCACHE_BAKING;
-
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_OUTDATED);
- }
-
- BLI_freelistN(&pidlist);
- }
- }
- }
- }
- else {
- /* succesfully finished baking */
- if(pid) {
- cache= pid->cache;
-
- cache->flag &= ~PTCACHE_BAKING;
- cache->flag |= PTCACHE_BAKED;
- }
- else {
- for(base=G.scene->base.first; base; base= base->next) {
- if(TESTBASELIB(base)) {
- BKE_ptcache_ids_from_object(&pidlist, base->object);
-
- for(pid=pidlist.first; pid; pid=pid->next) {
- cache= pid->cache;
-
- cache->flag &= ~PTCACHE_BAKING;
- cache->flag |= PTCACHE_BAKED;
- }
-
- BLI_freelistN(&pidlist);
- }
- }
- }
- }
-
- /* restore */
- waitcursor(0);
- sbSetInterruptCallBack(NULL); // softbody module won't ESC
- G.afbreek=0; // reset global break system
-
- CFRA= cfrao;
- G.scene->r.framelen= frameleno;
- update_for_newframe_muted();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-void pointcache_free(PTCacheID *pid, int cacheonly)
-{
- Base *base;
- ListBase pidlist;
-
- if(pid) {
- if(cacheonly) {
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_DEPSGRAPH);
- }
- else {
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_BAKED);
- pid->cache->flag &= ~PTCACHE_BAKED;
- }
-
- DAG_object_flush_update(G.scene, pid->ob, OB_RECALC_DATA);
- }
- else {
- for(base=G.scene->base.first; base; base= base->next) {
- if(TESTBASELIB(base)) {
- BKE_ptcache_ids_from_object(&pidlist, base->object);
-
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(cacheonly) {
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_DEPSGRAPH);
- }
- else {
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_BAKED);
- pid->cache->flag &= ~PTCACHE_BAKED;
- }
-
- DAG_object_flush_update(G.scene, pid->ob, OB_RECALC_DATA);
- }
-
- BLI_freelistN(&pidlist);
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-// store processed path & file prefix for fluidsim bake directory
-void fluidsimFilesel(char *selection)
-{
- Object *ob = OBACT;
- char srcDir[FILE_MAXDIR+FILE_MAXFILE], srcFile[FILE_MAXFILE];
- char prefix[FILE_MAXFILE];
- char *srch, *srchSub, *srchExt, *lastFound;
- int isElbeemSurf = 0;
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
-
- // make prefix
- strcpy(srcDir, selection);
- BLI_splitdirstring(srcDir, srcFile);
- strcpy(prefix, srcFile);
- // check if this is a previously generated surface mesh file
- srch = strstr(prefix, "fluidsurface_");
- // TODO search from back...
- if(srch) {
- srchSub = strstr(prefix,"_preview_");
- if(!srchSub) srchSub = strstr(prefix,"_final_");
- srchExt = strstr(prefix,".gz.bobj");
- if(!srchExt) srchExt = strstr(prefix,".bobj");
- if(srchSub && srchExt) {
- *srch = '\0';
- isElbeemSurf = 1;
- }
- }
- if(!isElbeemSurf) {
- // try to remove suffix
- lastFound = NULL;
- srch = strchr(prefix, '.'); // search last . from extension
- while(srch) {
- lastFound = srch;
- if(srch) {
- srch++;
- srch = strchr(srch, '.');
- }
- }
- if(lastFound) {
- *lastFound = '\0';
- }
- }
-
- if(fluidmd && fluidmd->fss) {
- strcpy(fluidmd->fss->surfdataPath, srcDir);
- //not necessary? strcat(ob->fluidsimSettings->surfdataPath, "/");
- strcat(fluidmd->fss->surfdataPath, prefix);
-
- // redraw view & buttons...
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
-}
-
-void do_object_panels(unsigned short event)
-{
- Object *ob;
-
- ob= OBACT;
- if(ob==NULL)
- return;
-
- switch(event) {
- case B_TRACKBUTS:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RECALCPATH:
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_DUPLI_FRAME:
- ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFACES|OB_DUPLIGROUP);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_DUPLI_VERTS:
- ob->transflag &= ~(OB_DUPLIFRAMES|OB_DUPLIFACES|OB_DUPLIGROUP);
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_DUPLI_FACES:
- ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFRAMES|OB_DUPLIGROUP);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_DUPLI_GROUP:
- ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFRAMES|OB_DUPLIFACES);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
-
- case B_PRINTSPEED:
- {
- float vec[3];
- CFRA++;
- do_ob_ipo(ob);
- where_is_object(ob);
- VECCOPY(vec, ob->obmat[3]);
- CFRA--;
- do_ob_ipo(ob);
- where_is_object(ob);
- VecSubf(vec, vec, ob->obmat[3]);
- prspeed= Normalize(vec);
- scrarea_queue_winredraw(curarea);
- }
- break;
- case B_PRINTLEN:
- if(ob->type==OB_CURVE) {
- Curve *cu=ob->data;
-
- if(cu->path) prlen= cu->path->totdist; else prlen= -1.0;
- scrarea_queue_winredraw(curarea);
- }
- break;
- case B_RELKEY:
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIPO, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- break;
- case B_CURVECHECK:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_SOFTBODY_DEL_VG:
- if(ob->soft) {
- ob->soft->vertgroup= 0;
- //ob->softflag |= OB_SB_REDO;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_FLUIDSIM_BAKE:
- /* write config files (currently no simulation) */
- fluidsimBake(ob);
- break;
- case B_FLUIDSIM_MAKEPART:
- if(ob==NULL || ob->type!=OB_MESH) break;
- else {
- ParticleSettings *part = psys_new_settings("PSys", G.main);
- ParticleSystem *psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- ModifierData *md;
- ParticleSystemModifierData *psmd;
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
-
- part->type = PART_FLUID;
- psys->part = part;
- psys->pointcache = BKE_ptcache_add();
- psys->flag |= PSYS_ENABLED;
-
- fluidmd->fss->type = OB_FLUIDSIM_PARTICLE;
-
- BLI_addtail(&ob->particlesystem,psys);
-
- md= modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "FluidParticleSystem" );
- psmd= (ParticleSystemModifierData*) md;
- psmd->psys=psys;
- BLI_addtail(&ob->modifiers, md);
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_FLUIDSIM_CHANGETYPE:
- {
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; // clear flag
- if(ob && ob->particlesystem.first && fluidmd->fss->type!=OB_FLUIDSIM_PARTICLE){
- ParticleSystem *psys;
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part->type==PART_FLUID) {
- /* clear modifier */
- ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys);
- BLI_remlink(&ob->modifiers, psmd);
- modifier_free((ModifierData *)psmd);
-
- /* clear particle system */
- BLI_remlink(&ob->particlesystem,psys);
- psys_free(ob,psys);
-
- BIF_undo_push("Delete particle system");
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- break;
- }
- }
- }
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- }
- case B_FLUIDSIM_SELDIR:
- {
- ScrArea *sa = closest_bigger_area();
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- /* choose dir for surface files */
- areawinset(sa->win);
- activate_fileselect(FILE_SPECIAL, "Select Directory", fluidmd->fss->surfdataPath, fluidsimFilesel);
- }
- break;
- case B_GROUP_RELINK:
- group_relink_nla_objects(ob);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_OBJECT_IPOFLAG:
- if(ob->ipo) ob->ipo->showkey= (ob->ipoflag & OB_DRAWKEY)?1:0;
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_CLOTH_CHANGEPREROLL:
- {
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- if(clmd)
- {
- PTCacheID pid;
-
- BKE_ptcache_id_from_cloth(&pid, ob, clmd);
-
- // do nothing in editmode
- if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- break;
-
- CFRA= 1;
- update_for_newframe_muted();
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- break;
- case B_BAKE_CACHE_CHANGE:
- {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- }
-
-}
-
-static void do_add_groupmenu(void *arg, int event)
-{
- Object *ob= OBACT;
-
- if(ob) {
-
- if(event== -1) {
- Group *group= add_group( "Group" );
- add_to_group(group, ob);
- }
- else
- add_to_group(BLI_findlink(&G.main->group, event), ob);
-
- ob->flag |= OB_FROMGROUP;
- BASACT->flag |= OB_FROMGROUP;
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-static uiBlock *add_groupmenu(void *arg_unused)
-{
- uiBlock *block;
- Group *group;
- short xco=0, yco= 0, index=0;
- char str[32];
-
- block= uiNewBlock(&curarea->uiblocks, "add_constraintmenu", UI_EMBOSSP, UI_HELV, curarea->win);
- uiBlockSetButmFunc(block, do_add_groupmenu, NULL);
-
- uiDefBut(block, BUTM, B_NOP, "ADD NEW", 0, 20, 160, 19, NULL, 0.0, 0.0, 1, -1, "");
- for(group= G.main->group.first; group; group= group->id.next, index++) {
-
- /*if(group->id.lib) strcpy(str, "L ");*/ /* we cant allow adding objects inside linked groups, it wont be saved anyway */
- if(group->id.lib==0) {
- strcpy(str, " ");
- strcat(str, group->id.name+2);
- uiDefBut(block, BUTM, B_NOP, str, xco*160, -20*yco, 160, 19, NULL, 0.0, 0.0, 1, index, "");
-
- yco++;
- if(yco>24) {
- yco= 0;
- xco++;
- }
- }
- }
-
- uiTextBoundsBlock(block, 50);
- uiBlockSetDirection(block, UI_DOWN);
-
- return block;
-}
-
-static void group_ob_rem(void *gr_v, void *ob_v)
-{
- Object *ob= OBACT;
-
- if(rem_from_group(gr_v, ob) && find_group(ob, NULL)==NULL) {
- ob->flag &= ~OB_FROMGROUP;
- BASACT->flag &= ~OB_FROMGROUP;
- }
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
-
-}
-
-static void group_local(void *gr_v, void *unused)
-{
- Group *group= gr_v;
-
- group->id.lib= NULL;
-
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
-
-}
-
-static void object_panel_object(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- Group *group;
- int a, xco, yco=0;
- short dx= 33, dy= 30;
- int is_libdata = object_is_libdata(ob);
- block= uiNewBlock(&curarea->uiblocks, "object_panel_object", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Object and Links", "Object", 0, 0, 318, 204)==0) return;
-
-
-
- /* object name */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- uiSetButLock(is_libdata, ERROR_LIBDATA_MESSAGE);
- xco= std_libbuttons(block, 10, 180, 0, NULL, 0, ID_OB, 0, &ob->id, NULL, &(G.buts->menunr), B_OBALONE, B_OBLOCAL, 0, 0, B_KEEPDATA);
- uiBlockSetCol(block, TH_AUTO);
-
- /* parent */
- uiSetButLock(is_libdata, ERROR_LIBDATA_MESSAGE);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", xco+5, 180, 305-xco, 20, &ob->parent, "Parent Object");
-
- uiSetButLock(is_libdata, ERROR_LIBDATA_MESSAGE);
- but = uiDefButS(block, NUM, B_NOP, "PassIndex:", xco+5, 150, 305-xco, 20, &ob->index, 0.0, 1000.0, 0, 0, "Index # for the IndexOB render pass.");
-
- uiSetButLock(1, NULL);
- uiDefBlockBut(block, add_groupmenu, NULL, "Add to Group", 10,150,150,20, "Add Object to a new Group");
-
- /* all groups */
- for(group= G.main->group.first; group; group= group->id.next) {
- if(object_in_group(ob, group)) {
- xco= 130;
-
- if(group->id.lib) {
- uiBlockBeginAlign(block);
- uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE); /* We cant actually use this button */
- uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 100, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
- uiClearButLock();
-
- but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 110, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local");
- uiButSetFunc(but, group_local, group, NULL);
- uiBlockEndAlign(block);
- } else {
- but = uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 120, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
- uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL);
- }
-
- uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE);
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWALL, "X:", xco+5, 120-yco, 50, 20, &group->dupli_ofs[0], -100000, 100000, 100, 0, "Offset to use when instacing the group");
- uiDefButF(block, NUM, REDRAWALL, "Y:", xco+55, 120-yco, 50, 20, &group->dupli_ofs[1], -100000, 100000, 100, 0, "Offset to use when instacing the group");
- uiDefButF(block, NUM, REDRAWALL, "Z:", xco+105, 120-yco, 50, 20, &group->dupli_ofs[2], -100000, 100000, 100, 0, "Offset to use when instacing the group");
- uiBlockEndAlign(block);
- uiClearButLock();
-
- xco = 290;
- if(group->id.lib==0) { /* cant remove objects from linked groups */
- but = uiDefIconBut(block, BUT, B_NOP, VICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership");
- uiButSetFunc(but, group_ob_rem, group, ob);
- }
-
- yco+= 20;
- xco= 10;
-
- /* layers */
- uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE);
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<a, REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 120-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 105-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
-
- xco+= 7;
- uiBlockBeginAlign(block);
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<a, REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 120-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 105-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, "");
-
- uiBlockEndAlign(block);
- uiClearButLock();
-
- yco+= 40;
- }
- }
-
- if(120-yco < -10)
- uiNewPanelHeight(block, 204 - (120-yco));
-}
-
-static void object_panel_anim_timeoffset_callback( void *data, void *timeoffset_ui) {
- Object *ob = (Object *)data;
- ob->sf = (*(float *)timeoffset_ui) - (give_timeoffset(ob) - ob->sf);
-}
-
-static void object_panel_anim(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- static float timeoffset_ui;
- char str[32];
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Anim settings", "Object", 320, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_TRACKBUTS,"TrackX", 24,180,59,19, &ob->trackflag, 12.0, 0.0, 0, 0, "Specify the axis that points to another object");
- uiDefButS(block, ROW,B_TRACKBUTS,"Y", 85,180,19,19, &ob->trackflag, 12.0, 1.0, 0, 0, "Specify the axis that points to another object");
- uiDefButS(block, ROW,B_TRACKBUTS,"Z", 104,180,19,19, &ob->trackflag, 12.0, 2.0, 0, 0, "Specify the axis that points to another object");
- uiDefButS(block, ROW,B_TRACKBUTS,"-X", 124,180,24,19, &ob->trackflag, 12.0, 3.0, 0, 0, "Specify the axis that points to another object");
- uiDefButS(block, ROW,B_TRACKBUTS,"-Y", 150,180,24,19, &ob->trackflag, 12.0, 4.0, 0, 0, "Specify the axis that points to another object");
- uiDefButS(block, ROW,B_TRACKBUTS,"-Z", 178,180,24,19, &ob->trackflag, 12.0, 5.0, 0, 0, "Specify the axis that points to another object");
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,REDRAWVIEW3D,"UpX", 226,180,45,19, &ob->upflag, 13.0, 0.0, 0, 0, "Specify the axis that points up");
- uiDefButS(block, ROW,REDRAWVIEW3D,"Y", 274,180,20,19, &ob->upflag, 13.0, 1.0, 0, 0, "Specify the axis that points up");
- uiDefButS(block, ROW,REDRAWVIEW3D,"Z", 298,180,19,19, &ob->upflag, 13.0, 2.0, 0, 0, "Specify the axis that points up");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_DRAWKEY, B_OBJECT_IPOFLAG, "Draw Key", 24,155,71,19, &ob->ipoflag, 0, 0, 0, 0, "Draw object as key position");
- uiDefButBitS(block, TOG, OB_DRAWKEYSEL, REDRAWVIEW3D, "Draw Key Sel", 97,155,81,19, &ob->ipoflag, 0, 0, 0, 0, "Limit the drawing of object keys");
- uiDefButBitS(block, TOG, OB_POWERTRACK, REDRAWVIEW3D, "Powertrack", 180,155,78,19, &ob->transflag, 0, 0, 0, 0, "Switch objects rotation off");
- uiDefButBitS(block, TOG, PARSLOW, 0, "SlowPar", 260,155,56,19, &ob->partype, 0, 0, 0, 0, "Create a delay in the parent relationship");
- uiBlockBeginAlign(block);
-
- uiDefButBitS(block, TOG, OB_DUPLIFRAMES, B_DUPLI_FRAME, "DupliFrames", 24,130,95,20, &ob->transflag, 0, 0, 0, 0, "Make copy of object for every frame");
- uiDefButBitS(block, TOG, OB_DUPLIVERTS, B_DUPLI_VERTS, "DupliVerts", 119,130,95,20, &ob->transflag, 0, 0, 0, 0, "Duplicate child objects on all vertices");
- uiDefButBitS(block, TOG, OB_DUPLIFACES, B_DUPLI_FACES, "DupliFaces", 214,130,102,20, &ob->transflag, 0, 0, 0, 0, "Duplicate child objects on all faces");
- uiDefButBitS(block, TOG, OB_DUPLIGROUP, B_DUPLI_GROUP, "DupliGroup", 24,110,150,20, &ob->transflag, 0, 0, 0, 0, "Enable group instancing");
- if(ob->transflag & OB_DUPLIFRAMES) {
- uiDefButBitS(block, TOG, OB_DUPLINOSPEED, REDRAWVIEW3D, "No Speed", 174,110,142,20, &ob->transflag, 0, 0, 0, 0, "Set dupliframes to still, regardless of frame");
- } else if(ob->transflag & OB_DUPLIVERTS) {
- uiDefButBitS(block, TOG, OB_DUPLIROT, REDRAWVIEW3D, "Rot", 174,110,142,20, &ob->transflag, 0, 0, 0, 0, "Rotate dupli according to vertex normal");
- } else if(ob->transflag & OB_DUPLIFACES) {
- uiDefButBitS(block, TOG, OB_DUPLIFACES_SCALE, REDRAWVIEW3D, "Scale", 174,110,80,20, &ob->transflag, 0, 0, 0, 0, "Scale dupli based on face size");
- uiDefButF(block, NUM, REDRAWVIEW3D, "", 254,110,62,20, &ob->dupfacesca, 0.001, 10000.0, 0, 0, "Scale the DupliFace objects");
- } else {
- uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_GROUP_RELINK, "GR:", 174,110,142,20, &ob->dup_group, "Instance an existing group");
- }
-
- uiBlockBeginAlign(block);
- /* DupSta and DupEnd are both shorts, so the maxframe is greater then their range
- just limit the buttons to the max short */
- uiDefButI(block, NUM, REDRAWVIEW3D, "DupSta:", 24,85,141,19, &ob->dupsta, 1.0, 32767, 0, 0, "Specify startframe for Dupliframes");
- uiDefButI(block, NUM, REDRAWVIEW3D, "DupOn:", 170,85,146,19, &ob->dupon, 1.0, 1500.0, 0, 0, "Specify the number of frames to use between DupOff frames");
- uiDefButI(block, NUM, REDRAWVIEW3D, "DupEnd", 24,65,140,19, &ob->dupend, 1.0, 32767, 0, 0, "Specify endframe for Dupliframes");
- uiDefButI(block, NUM, REDRAWVIEW3D, "DupOff", 171,65,145,19, &ob->dupoff, 0.0, 1500.0, 0, 0, "Specify recurring frames to exclude from the Dupliframes");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
-
- timeoffset_ui = give_timeoffset(ob);
- but = uiDefButF(block, NUM, REDRAWALL, "TimeOffset:", 24,35,115,20, &timeoffset_ui, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Animation offset in frames for ipo's and dupligroup instances");
- uiButSetFunc(but, object_panel_anim_timeoffset_callback, ob, &timeoffset_ui);
-
- uiDefBut(block, BUT, B_AUTOTIMEOFS, "Auto", 139,35,34,20, 0, 0, 0, 0, 0, "Assign selected objects a timeoffset within a range, starting from the active object");
- uiDefBut(block, BUT, B_OFSTIMEOFS, "Ofs", 173,35,34,20, 0, 0, 0, 0, 0, "Offset selected objects timeoffset");
- uiDefBut(block, BUT, B_RANDTIMEOFS, "Rand", 207,35,34,20, 0, 0, 0, 0, 0, "Randomize selected objects timeoffset");
- uiDefBut(block, BUT, B_PRINTSPEED, "PrSpeed", 250,35,65,20, 0, 0, 0, 0, 0, "Print objectspeed");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_OFFS_OB, REDRAWALL, "OfsEdit", 24,10,56,20, &ob->ipoflag, 0, 0, 0, 0, "Use timeoffset when inserting keys and display timeoffset for ipo and action views");
- uiDefButBitS(block, TOG, OB_OFFS_PARENT, REDRAWALL, "OfsParent", 82,10,56,20 , &ob->ipoflag, 0, 0, 0, 0, "Apply the timeoffset to this objects parent relationship");
- uiDefButBitS(block, TOG, OB_OFFS_PARTICLE, REDRAWALL, "OfsParticle", 140,10,56,20, &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on the particle effect");
- uiDefButBitS(block, TOG, OB_OFFS_PARENTADD, REDRAWALL, "AddParent", 196,10,56,20, &ob->ipoflag, 0, 0, 0, 0, "Add the parents timeoffset value");
- uiBlockEndAlign(block);
-
- sprintf(str, "%.4f", prspeed);
- uiDefBut(block, LABEL, 0, str, 260,10,63,31, NULL, 1.0, 0, 0, 0, "");
-
-}
-
-static void object_panel_draw(Object *ob)
-{
- uiBlock *block;
- int xco, a, dx, dy;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Draw", "Object", 640, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- /* LAYERS */
- xco= 65;
- dx= 35;
- dy= 30;
-
- uiDefBut(block, LABEL, 0, "Layers", 10,170,100,20, NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<a, B_OBLAY+a, "", (short)(xco+a*(dx/2)), 180, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, "");
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), B_OBLAY+a+10, "", (short)(xco+a*(dx/2)), 165, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, "");
-
- xco+= 7;
- uiBlockBeginAlign(block);
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<a, B_OBLAY+a, "", (short)(xco+a*(dx/2)), 180, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, "");
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), B_OBLAY+a+10, "", (short)(xco+a*(dx/2)), 165, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, "");
-
- uiBlockEndAlign(block);
-
- /* Object Color */
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, REDRAWVIEW3D, "", 250, 180, 50, 15, ob->col, 0, 0, 0, 0, "Object color, used when faces have the ObCol mode enabled");
- uiDefButF(block, NUM, REDRAWVIEW3D, "A:", 250, 165, 50, 15, &ob->col[3], 0.0f, 1.0f, 10, 2, "Object alpha, used when faces have the ObCol mode enabled");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Drawtype", 10,120,100,20, NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, REDRAWVIEW3D, "Shaded", 10,100,100, 20, &ob->dt, 0, OB_SHADED, 0, 0, "Draw active object shaded or textured");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Solid", 10,80,100, 20, &ob->dt, 0, OB_SOLID, 0, 0, "Draw active object in solid");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Wire", 10,60, 100, 20, &ob->dt, 0, OB_WIRE, 0, 0, "Draw active object in wireframe");
- uiDefButC(block, ROW, REDRAWVIEW3D, "Bounds", 10,40, 100, 20, &ob->dt, 0, OB_BOUNDBOX, 0, 0, "Only draw object with bounding box");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Draw Extra", 120,120,90,20, NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitC(block, TOG, OB_BOUNDBOX, REDRAWVIEW3D, "Bounds", 120, 100, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's bounds");
- uiDefButBitC(block, TOG, OB_DRAWNAME, REDRAWVIEW3D, "Name", 210, 100, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's name");
-
- uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Polyheder%x4",
- 120, 80, 90, 20, &ob->boundtype, 0, 0, 0, 0, "Selects the boundary display type");
- uiDefButBitC(block, TOG, OB_AXIS, REDRAWVIEW3D, "Axis", 210, 80, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's center and axis");
-
- uiDefButBitC(block, TOG, OB_TEXSPACE, REDRAWVIEW3D, "TexSpace", 120, 60, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's texture space");
- uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 210, 60, 90, 20, &ob->dtx, 0, 0, 0, 0, "Adds the active object's wireframe over solid drawing");
-
- uiDefButBitC(block, TOG, OB_DRAWTRANSP, REDRAWVIEW3D, "Transp", 120, 40, 90, 20, &ob->dtx, 0, 0, 0, 0, "Enables transparent materials for the active object (Mesh only)");
- uiDefButBitC(block, TOG, OB_DRAWXRAY, REDRAWVIEW3D, "X-ray", 210, 40, 90, 20, &ob->dtx, 0, 0, 0, 0, "Makes the active object draw in front of others");
-}
-
-void object_panel_constraint(char *context)
-{
- uiBlock *block;
- Object *ob= OBACT;
- ListBase *conlist;
- bConstraint *curcon;
- short xco, yco;
- char str[64];
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Constraints", context, 960, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- /* do not allow this panel to draw in editmode - why?*/
- if(G.obedit==OBACT) return; // ??
-
- conlist = get_active_constraints(OBACT);
-
- if (conlist) {
- uiDefBlockBut(block, add_constraintmenu, NULL, "Add Constraint", 0, 190, 130, 20, "Add a new constraint");
-
- /* print active object or bone */
- str[0]= 0;
- if (ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
- if(pchan) sprintf(str, "To Bone: %s", pchan->name);
- }
- else {
- sprintf(str, "To Object: %s", ob->id.name+2);
- }
- uiDefBut(block, LABEL, 1, str, 150, 190, 150, 20, NULL, 0.0, 0.0, 0, 0, "Displays Active Object or Bone name");
-
- /* Go through the list of constraints and draw them */
- xco = 10;
- yco = 160;
-
- for (curcon = conlist->first; curcon; curcon=curcon->next) {
- /* hrms, the temporal constraint should not draw! */
- if(curcon->type==CONSTRAINT_TYPE_KINEMATIC) {
- bKinematicConstraint *data= curcon->data;
- if(data->flag & CONSTRAINT_IK_TEMP)
- continue;
- }
- /* Draw default constraint header */
- draw_constraint(block, conlist, curcon, &xco, &yco);
- }
-
- if(yco < 0) uiNewPanelHeight(block, 204-yco);
-
- }
-}
-
-void do_effects_panels(unsigned short event)
-{
- Object *ob;
- ModifierData *md;
- ParticleSystemModifierData *psmd;
- ParticleSystem *psys;
- ParticleSettings *part;
- LinkNode *node, *firstnode;
- ID *id,*idtest;
- int nr;
-
- ob= OBACT;
-
- psys=psys_get_current(ob);
-
- switch(event) {
-
- case B_AUTOTIMEOFS:
- auto_timeoffs();
- break;
- case B_OFSTIMEOFS:
- ofs_timeoffs();
- break;
- case B_RANDTIMEOFS:
- rand_timeoffs();
- break;
- case B_FRAMEMAP:
- G.scene->r.framelen= G.scene->r.framapto;
- G.scene->r.framelen/= G.scene->r.images;
- allqueue(REDRAWALL, 0);
- break;
- case B_PARTBROWSE:
- if(G.buts->menunr== -2) {
- activate_databrowse((ID *)G.buts->lockpoin, ID_PA, 0, B_PARTBROWSE, &G.buts->menunr, do_effects_panels);
- return;
- }
-
- if(G.buts->menunr < 0) return;
-
- if(G.buts->pin) {
-
- }
- else {
- psys= psys_get_current(ob);
- if(psys)
- part=psys->part;
- else
- part=NULL;
-
- nr= 1;
-
- id= (ID *)part;
-
- idtest= G.main->particle.first;
- while(idtest) {
- if(nr==G.buts->menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
-
- if(idtest==0) { /* new particle system */
- if(id){
- idtest= (ID *)psys_copy_settings((ParticleSettings *)id);
- }
- else {
- idtest= (ID *)psys_new_settings("PSys", G.main);
- }
- idtest->us--;
- }
- else if(((ParticleSettings*)idtest)->type==PART_FLUID) {
- error("Can't select fluid particles");
- break;
- }
-
- if(idtest!=id) {
- short nr=0;
- if(id==0){ /* no psys previously -> no modifier -> need to create that also */
- psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add();
- psys->flag |= PSYS_ENABLED;
- BLI_addtail(&ob->particlesystem,psys);
-
- md= modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
- psmd= (ParticleSystemModifierData*) md;
- psmd->psys=psys;
- BLI_addtail(&ob->modifiers, md);
- } else
- id->us--;
-
- idtest->us++;
- psys->part=(ParticleSettings*)idtest;
- psys->totpart=0;
- psys->flag= PSYS_ENABLED|PSYS_CURRENT;
- psys->cfra=bsystem_time(ob,G.scene->r.cfra+1,0.0);
-
- /* check need for dupliobjects */
- nr=0;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- ob->transflag |= OB_DUPLIPARTS;
- else
- ob->transflag &= ~OB_DUPLIPARTS;
-
- BIF_undo_push("Browse Particle System");
-
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
-
- }
- break;
- case B_PARTDELETE:
- if(ob && ob->particlesystem.first){
- psys= psys_get_current(ob);
- if(psys) {
- /* clear modifier */
- psmd= psys_get_modifier(ob,psys);
- BLI_remlink(&ob->modifiers, psmd);
- modifier_free((ModifierData *)psmd);
-
- /* clear particle system */
- BLI_remlink(&ob->particlesystem,psys);
- psys_free(ob,psys);
-
- BIF_undo_push("Delete particle system");
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- }
- break;
- case B_PARTALONE: /* TODO: not too sure of how this works so someone check please, jahka */
- if(ob && (psys=psys_get_current(ob))){
- if(psys->part) {
- if(psys->part->id.us>1){
- if(okee("Make Single User")){
- part=psys_copy_settings(psys->part);
- part->id.us=1;
- psys->part->id.us--;
- psys->part=part;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Make single user or local");
- }
- }
- }
- }
- break;
-
- case B_PART_ALLOC:
- case B_PART_DISTR:
- case B_PART_INIT:
- case B_PART_RECALC:
- case B_PART_ALLOC_CHILD:
- case B_PART_DISTR_CHILD:
- case B_PART_INIT_CHILD:
- case B_PART_RECALC_CHILD:
- if(psys) {
- Base *base;
- Object *bob;
- ParticleSystem *bpsys;
- int flush;
-
- nr=0;
- for(bpsys=ob->particlesystem.first; bpsys; bpsys=bpsys->next){
- if(ELEM(bpsys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- ob->transflag |= OB_DUPLIPARTS;
- else
- ob->transflag &= ~OB_DUPLIPARTS;
-
- if(psys->part->type==PART_REACTOR)
- if(psys->target_ob)
- DAG_object_flush_update(G.scene, psys->target_ob, OB_RECALC_DATA);
-
- for(base = G.scene->base.first; base; base= base->next) {
- bob= base->object;
- flush= 0;
- for(bpsys=bob->particlesystem.first; bpsys; bpsys=bpsys->next)
- if(bpsys->part==psys->part)
- flush= 1;
-
- if(flush)
- DAG_object_flush_update(G.scene, bob, OB_RECALC_DATA);
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- }
- break;
-
- /* there were separate update events before the pointcache refactor,
- * now it only does a flush update which means it is recalculating
- * more than strictly needed, but how to restore such partial updates
- * i'm not sure - brecht. */
-#if 0
- case B_PART_ALLOC:
- case B_PART_ALLOC_CHILD:
- if(psys){
- psys_flush_settings(psys->part,PSYS_ALLOC,event==B_PART_ALLOC);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- break;
-
- case B_PART_DISTR:
- case B_PART_DISTR_CHILD:
- if(psys){
- psys_flush_settings(psys->part,PSYS_DISTR,event==B_PART_DISTR);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- break;
- case B_PART_INIT:
- case B_PART_INIT_CHILD:
- if(psys){
- psys_flush_settings(psys->part,PSYS_INIT,event==B_PART_INIT);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- break;
- case B_PART_ENABLE:
- if(psys) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- /* no break! */
-#endif
- case B_PART_REDRAW_DEPS:
- if(event == B_PART_REDRAW_DEPS)
- DAG_scene_sort(G.scene);
- /* no break! */
- case B_PART_REDRAW:
- nr=0;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR))
- nr++;
- }
- if(nr)
- ob->transflag |= OB_DUPLIPARTS;
- else
- ob->transflag &= ~OB_DUPLIPARTS;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_PARTTYPE:
- if(psys) {
- /* 1 = do DAG_object_flush_update */
- firstnode= psys_using_settings(psys->part, 1);
-
- for(node=firstnode; node; node=node->next)
- psys_changed_type(node->link);
-
- BLI_linklist_free(firstnode, NULL);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- }
- break;
- case B_PARTACT:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWIPO, 0);
- break;
- case B_PARTTARGET:
- if((psys=psys_get_current(ob))){
- if(psys->keyed_ob==ob || psys->target_ob==ob){
- if(psys->keyed_ob==ob)
- psys->keyed_ob=NULL;
- else
- psys->target_ob=NULL;
- }
- else{
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- }
- break;
- case B_PART_REKEY:
- PE_rekey();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_PART_EDITABLE:
- if((psys = psys_get_current(ob))) {
- if(psys->flag & PSYS_EDITED){
- if(okee("Lose changes done in particle mode?")){
- if(psys->edit)
- PE_free_particle_edit(psys);
-
- psys->flag &= ~PSYS_EDITED;
- psys->recalc |= PSYS_RECALC_HAIR;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- else {
- if(psys_check_enabled(ob, psys)) {
- psys->flag |= PSYS_EDITED;
- if(G.f & G_PARTICLEEDIT)
- PE_create_particle_edit(ob, psys);
- }
- else
- error("Particle system not enabled, skipping set editable");
- }
- }
- case B_FIELD_DEP:
- /* do this before scene sort, that one checks for CU_PATH */
- if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) {
- Curve *cu= ob->data;
-
- cu->flag |= (CU_PATH|CU_3D);
- do_curvebuts(B_CU3D); /* all curves too */
- }
- DAG_scene_sort(G.scene);
-
- if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE)
- DAG_object_flush_update(G.scene, ob, OB_RECALC);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- break;
- case B_FIELD_CHANGE:
- if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex){
- ob->pd->tex->id.us--;
- ob->pd->tex=0;
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 0);
- break;
- }
-
-}
-
-/* copy from buttons_editing.c */
-static void field_testTexture(char *name, ID **idpp)
-{
- ID *id;
-
- for(id = G.main->tex.first; id; id = id->next) {
- if(strcmp(name, id->name + 2) == 0) {
- *idpp = id;
- /* texture gets user, objects not: delete object = clear modifier */
- id_us_plus(id);
- return;
- }
- }
- *idpp = 0;
-}
-
-/* Panel for collision */
-static void object_collision__enabletoggle ( void *ob_v, void *arg2 )
-{
- Object *ob = ob_v;
- PartDeflect *pd= ob->pd;
- ModifierData *md = modifiers_findByType ( ob, eModifierType_Collision );
-
- if ( !md )
- {
- if(pd && (pd->deflect))
- {
- md = modifier_new ( eModifierType_Collision );
- BLI_addtail ( &ob->modifiers, md );
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else
- {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BLI_remlink ( &ob->modifiers, md );
- modifier_free ( md );
- DAG_scene_sort(G.scene);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-}
-
-/* Panels for particle interaction settings */
-static void object_panel_collision(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_deflection", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Fields", "Physics");
- if(uiNewPanel(curarea, block, "Collision", "Physics", 0, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- /* should become button, option? */
- if(ob->pd==NULL) {
- ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
- /* and if needed, init here */
- ob->pd->pdef_sbdamp = 0.1f;
- ob->pd->pdef_sbift = 0.2f;
- ob->pd->pdef_sboft = 0.02f;
- }
-
- /* only meshes collide now */
- if(ob->pd && ob->type==OB_MESH) {
- PartDeflect *pd= ob->pd;
-
- but = uiDefButBitS(block, TOG, 1, B_REDR, "Collision",10,160,150,20, &pd->deflect, 0, 0, 0, 0, "Enable this objects as a collider for physics systems");
- uiButSetFunc(but, object_collision__enabletoggle, ob, NULL);
-
- uiDefBut(block, LABEL, 0, "",160,160,150,2, NULL, 0.0, 0, 0, 0, "");
-
- if(pd->deflect) {
- CollisionModifierData *collmd = (CollisionModifierData *)modifiers_findByType ( ob, eModifierType_Collision );
-
- uiDefBut(block, LABEL, 0, "Particle Interaction", 10,135,310,20, NULL, 0.0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping: ", 10,115,105,20, &pd->pdef_damp, 0.0, 1.0, 10, 2, "Amount of damping during particle collision");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Rnd: ", 115,115,75,20, &pd->pdef_rdamp, 0.0, 1.0, 10, 2, "Random variation of damping");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Friction: ", 10,95,105,20, &pd->pdef_frict, 0.0, 1.0, 10, 2, "Amount of friction during particle collision");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Rnd: ", 115,95,75,20, &pd->pdef_rfrict, 0.0, 1.0, 10, 2, "Random variation of friction");
- uiBlockEndAlign(block);
-
- uiDefButBitS(block, TOG, PDEFLE_KILL_PART, B_FIELD_CHANGE, "Kill",200,115,120,20, &pd->flag, 0, 0, 0, 0, "Kill collided particles");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Permeability: ", 200,90,120,20, &pd->pdef_perm, 0.0, 1.0, 10, 2, "Chance that the particle will pass through the mesh");
-
- uiDefBut(block, LABEL, 0, "Soft Body and Cloth Interaction", 10,65,310,20, NULL, 0.0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 10,45,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160, 45,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness");
- uiBlockEndAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 10,25,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during collision");
-
- uiDefButBitS(block, TOG, OB_SB_COLLFINAL, B_FIELD_CHANGE, "Ev.M.Stack", 160,25,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack (softbody only)");
-
- // collision options
- if(collmd)
- {
- uiDefButS(block, NUM, B_FIELD_CHANGE, "Absorption: ", 10,0,150,20, &collmd->absorption, 0.0, 100, 1, 2, "How much of effector force gets lost during collision with this object (in percent).");
- }
- }
- }
-}
-static void object_panel_fields(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- int particles=0;
- static short actpsys=-1;
- static char slot=0;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_fields", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Fields", "Physics", 0, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- /* should become button, option? */
- if(ob->pd==NULL) {
- ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
- /* and if needed, init here */
- ob->pd->pdef_sbdamp = 0.1f;
- ob->pd->pdef_sbift = 0.2f;
- ob->pd->pdef_sboft = 0.02f;
- }
-
- if(ob->pd) {
- PartDeflect *pd= ob->pd;
- char *menustr= MEM_mallocN(256, "temp string");
- char *tipstr="Choose field type";
-
- uiBlockBeginAlign(block);
-
- if(ob->particlesystem.first) {
- ParticleSystem *psys;
- char *menustr2= psys_menu_string(ob,1);
-
- psys= psys_get_current(ob);
- if(psys && actpsys >= 0) {
- actpsys= psys_get_current_num(ob)+1;
-
- if(psys->part->pd==NULL)
- psys->part->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
-
- if(psys->part->pd2==NULL)
- psys->part->pd2= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
-
- pd= ((slot==1) ? psys->part->pd2 : psys->part->pd);
- particles=1;
-
- uiDefButC(block, ROW, B_REDR, "", 10, 163, 14, 14, &slot, 3.0, 0, 0, 0, "Edit first particle effector slot");
- uiDefButC(block, ROW, B_REDR, "", 24, 163, 14, 14, &slot, 3.0, 1, 0, 0, "Edit second particle effector slot");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- }
- else
- actpsys= -1; /* -1 = object */
-
- but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr2, 10,180,70,20, &actpsys, 14.0, 0.0, 0, 0, "Browse systems");
- uiButSetFunc(but, PE_change_act, ob, &actpsys);
-
- MEM_freeN(menustr2);
- }
-
- /* setup menu button */
- if(particles){
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_CHARGE, PFIELD_LENNARDJ);
-
- if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles (On shared object layers)";
- else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis (On shared object layers)";
- else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the particle (On shared object layers)";
- }
- else{
- if(ob->type==OB_CURVE)
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ);
- else
- sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d",
- PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ);
-
- if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles (On shared object layers)";
- else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis (On shared object layers)";
- else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the Object (On shared object layers)";
- else if(pd->forcefield==PFIELD_GUIDE) tipstr= "Use a Curve Path to guide particles (On shared object layers)";
- }
-
- if(ob->particlesystem.first)
- uiDefButS(block, MENU, B_FIELD_DEP, menustr, 80,180,70,20, &pd->forcefield, 0.0, 0.0, 0, 0, tipstr);
- else
- uiDefButS(block, MENU, B_FIELD_DEP, menustr, 10,180,140,20, &pd->forcefield, 0.0, 0.0, 0, 0, tipstr);
-
- uiBlockEndAlign(block);
- uiDefBut(block, LABEL, 0, "",160,180,150,2, NULL, 0.0, 0, 0, 0, "");
-
- if(pd->forcefield) {
- uiBlockBeginAlign(block);
- if(pd->forcefield == PFIELD_GUIDE) {
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 10,140,140,20, &pd->f_strength, 0.0, 1000.0, 10, 0, "The distance from which particles are affected fully.");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 10,120,140,20, &pd->f_power, 0.0, 10.0, 10, 0, "Falloff factor, between mindist and maxdist");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Free: ", 10,100,140,20, &pd->free_end, 0.0, 0.99, 10, 0, "Guide-free time from particle life's end");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 10,80,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 50,80,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work");
- }
- else {
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Strength: ", 10,140,140,20, &pd->f_strength, -1000, 1000, 10, 3, "Strength of force field");
-
- if(pd->forcefield == PFIELD_TEXTURE){
- uiDefIDPoinBut(block, field_testTexture, ID_TE, B_FIELD_CHANGE, "Texture: ", 10,120,140,20, &pd->tex, "Texture to use as force");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PFIELD_TEX_OBJECT, B_FIELD_CHANGE, "Use Object Co", 10,95,140,20, &pd->flag, 0.0, 0, 0, 0, "Use object/global coordinates for texture");
- uiDefButBitS(block, TOG, PFIELD_TEX_ROOTCO, B_FIELD_CHANGE, "Root TexCo", 10,75,100,20, &pd->flag, 0.0, 0, 0, 0, "Texture coords from root particle locations");
- uiDefButBitS(block, TOG, PFIELD_TEX_2D, B_FIELD_CHANGE, "2D", 120,75,30,20, &pd->flag, 0.0, 0, 0, 0, "Apply force only in 2d");
- }
- else if(pd->forcefield == PFIELD_HARMONIC)
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Damp: ", 10,120,140,20, &pd->f_damp, 0, 10, 10, 0, "Damping of the harmonic force");
- else if(pd->forcefield == PFIELD_WIND)
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Noise: ",10,120,140,20, &pd->f_noise, 0, 10, 100, 0, "Noise of the wind force");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- if(pd->forcefield == PFIELD_GUIDE){
- uiDefButBitS(block, TOG, PFIELD_GUIDE_PATH_ADD, B_FIELD_CHANGE, "Additive", 10,40,140,20, &pd->flag, 0.0, 0, 0, 0, "Based on distance/falloff it adds a portion of the entire path");
- }
- else if(pd->forcefield==PFIELD_TEXTURE){
- uiDefButS(block, MENU, B_FIELD_CHANGE, "Texture mode%t|RGB%x0|Gradient%x1|Curl%x2", 10,50,140,20, &pd->tex_mode, 0.0, 0.0, 0, 0, "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)");
-
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Nabla:", 10,30,140,20, &pd->tex_nabla, 0.0001f, 1.0, 1, 0, "Specify the dimension of the area for gradient and curl calculation");
- }
- else if(particles==0 && ELEM(pd->forcefield,PFIELD_VORTEX,PFIELD_WIND)==0){
- //uiDefButF(block, NUM, B_FIELD_CHANGE, "Distance: ", 10,20,140,20, &pd->f_dist, 0, 1000.0, 10, 0, "Falloff power (real gravitational fallof = 2)");
- uiDefButBitS(block, TOG, PFIELD_PLANAR, B_FIELD_CHANGE, "Planar", 10,15,140,20, &pd->flag, 0.0, 0, 0, 0, "Create planar field");
- }
- uiBlockEndAlign(block);
-
- if(pd->forcefield==PFIELD_GUIDE){
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Clump:", 160,180,140,20, &pd->clump_fac, -1.0, 1.0, 1, 3, "Amount of clumpimg");
- uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Shape:", 160,160,140,20, &pd->clump_pow, -0.999, 0.999, 1, 3, "Shape of clumpimg");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- if(pd->kink){
- uiDefButS(block, MENU, B_FIELD_CHANGE, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", 160,120,70,20, &pd->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the curve");
- uiDefButS(block, MENU, B_FIELD_CHANGE, "Axis %t|Z %x2|Y %x1|X %x0", 230,120,70,20, &pd->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Freq:", 160,100,140,20, &pd->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)");
- uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Shape:", 160,80,140,20, &pd->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Amplitude:", 160,60,140,20, &pd->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset");
- }
- else{
- uiDefButS(block, MENU, B_FIELD_CHANGE, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", 160,120,140,20, &pd->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the curve");
- }
- uiBlockEndAlign(block);
- }
- else{
- if(pd->forcefield==PFIELD_LENNARDJ) {
- uiDefBut(block, LABEL, 0, "Fall-off determined", 160,140,140,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "by particle sizes", 160,120,140,20, NULL, 0.0, 0, 0, 0, "");
- }
- else {
- uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, "Fall-off shape");
- if(pd->falloff==PFIELD_FALL_TUBE)
- uiDefBut(block, LABEL, 0, "Longitudinal", 160,160,140,20, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work");
- uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off");
- uiBlockEndAlign(block);
-
- if(pd->falloff==PFIELD_FALL_TUBE){
- uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work");
- uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off");
- uiBlockEndAlign(block);
- }
- else if(pd->falloff==PFIELD_FALL_CONE){
- uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)");
- uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)");
- uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off");
- uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)");
- uiBlockEndAlign(block);
- }
- }
- }
-
- }
-
- MEM_freeN(menustr);
- }
-}
-
-/* Generic physics baking buttons */
-
-static void object_physics__baketoggle(void *pid_v, void *unused_v)
-{
- PTCacheID *pid = pid_v;
- Object *ob = pid->ob;
- PointCache *cache = pid->cache;
- ClothModifierData *clmd;
- int cageIndex, stack_index, startframe, endframe;
-
- // automatically enable modifier in editmode when we have a protected cache
- if(!(cache->flag & PTCACHE_BAKED)) {
- BKE_ptcache_id_time(pid, 0.0f, &startframe, &endframe, NULL);
- pointcache_bake(pid, startframe);
-
- if(pid->type == PTCACHE_TYPE_CLOTH) {
- clmd= (ClothModifierData*)pid->data;
- cageIndex = modifiers_getCageIndex(ob, NULL );
- stack_index = modifiers_indexInObject(ob, (ModifierData *)clmd);
- if(stack_index >= cageIndex)
- ((ModifierData *)clmd)->mode ^= eModifierMode_OnCage;
- }
- }
- else {
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE) {
- notice("Can't free bake in editmode");
- }
- else {
- if(pid->type == PTCACHE_TYPE_CLOTH) {
- clmd= (ClothModifierData*)pid->data;
- ((ModifierData *)clmd)->mode ^= eModifierMode_OnCage;
- }
-
- cache->flag &= ~PTCACHE_BAKED;
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_OUTDATED);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
-}
-
-static void object_physics__rebake(void *pid_v, void *unused_v)
-{
- PTCacheID *pid = pid_v;
- int curframe = (int)G.scene->r.cfra;
-
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, curframe);
- pointcache_bake(pid, curframe);
-}
-
-static void object_physics__clearcache(void *pid_v, void *unused_v)
-{
- PTCacheID *pid = pid_v;
- Object *ob = pid->ob;
- PointCache *cache = pid->cache;
-
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- return;
-
- BKE_ptcache_id_reset(pid, PTCACHE_RESET_BAKED);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void object_physics_bake_buttons(uiBlock *block, PTCacheID *pid, int y, int libdata)
-{
- uiBut *but;
- PointCache *cache;
-
- cache= pid->cache;
-
- if(!libdata && G.obedit)
- uiSetButLock(1, "Can't change bake settings in editmode");
-
- if(cache->flag & PTCACHE_BAKED)
- but = uiDefBut(block, BUT, REDRAWBUTSOBJECT, "Free Bake", 10,y+25,85,20, NULL, 0.0, 0.0, 0, 0, "Free baked simulation");
- else
- but = uiDefBut(block, BUT, REDRAWBUTSOBJECT, "Bake", 10,y+25,85,20, NULL, 0.0, 0.0, 0, 0, "Bake specified frame range");
- uiButSetFunc(but, object_physics__baketoggle, pid, NULL);
-
- if(!libdata && !G.obedit && (cache->flag & PTCACHE_BAKED))
- uiSetButLock(1, "Simulation frames are baked");
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM, B_BAKE_CACHE_CHANGE, "Start:", 100,y+25,105,20, &cache->startframe, 1, MAXFRAME, 1, 0, "Frame on which the simulation starts");
- uiDefButI(block, NUM, B_BAKE_CACHE_CHANGE, "End:", 205,y+25,105,20, &cache->endframe, 1, MAXFRAME, 1, 0, "Frame on which the simulation stops");
- uiBlockEndAlign(block);
-
- if(cache->flag & PTCACHE_BAKED) {
- if(pid->type == PTCACHE_TYPE_CLOTH ||
- (pid->type == PTCACHE_TYPE_SOFTBODY && !((SoftBody*)pid->data)->particles)) {
- if(!libdata && !G.obedit)
- uiClearButLock();
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, PTCACHE_BAKE_EDIT, REDRAWVIEW3D, "Bake Editing", 10,y,100,20, &cache->flag, 0, 0, 0, 0, "Enable editing of the baked results in editmode.");
- but= uiDefBut(block, BUT, REDRAWBUTSOBJECT, "Rebake From Current Frame", 110,y,200,20, NULL, 0.0, 0.0, 0, 0, "Bake again from current frame");
- uiButSetFunc(but, object_physics__rebake, pid, NULL);
- uiBlockEndAlign(block);
- }
-
- if(!libdata)
- uiClearButLock();
- }
- else {
- char str[512];
- int exist, startframe, endframe;
-
- if(!libdata)
- uiClearButLock();
-
- BKE_ptcache_id_time(pid, 0.0f, &startframe, &endframe, NULL);
- exist= BKE_ptcache_id_exist(pid, startframe);
-
- sprintf(str, "%simulation frames in disk cache.", (exist)? "S": "No s");
- uiDefBut(block, LABEL, 0, str, 10,y,200,20, NULL, 0.0, 0, 0, 0, "");
-
- if(exist) {
- but= uiDefBut(block, BUT, REDRAWBUTSOBJECT, "Free Cache", 210,y,100,20, NULL, 0.0, 0.0, 0, 0, "Free cached simulation results");
- uiButSetFunc(but, object_physics__clearcache, pid, NULL);
- }
- }
-}
-
-/* Panel for softbodies */
-static void object_softbodies__enable(void *ob_v, void *arg2)
-{
- Object *ob = ob_v;
- ModifierData *md = modifiers_findByType(ob, eModifierType_Softbody);
- PTCacheID pid;
-
- if(md) {
- BLI_remlink(&ob->modifiers, md);
- modifier_free(md);
- BIF_undo_push("Del modifier");
-
- ob->softflag &= ~OB_SB_ENABLE;
- } else {
- md = modifier_new(eModifierType_Softbody);
- BLI_addhead(&ob->modifiers, md);
-
- if (!ob->soft) {
- ob->soft= sbNew();
- ob->softflag |= OB_SB_GOAL|OB_SB_EDGES;
-
- BKE_ptcache_id_from_softbody(&pid, ob, ob->soft);
- BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0);
- }
-
- ob->softflag |= OB_SB_ENABLE;
- }
-
- /* needed so that initial state is cached correctly */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static int _can_softbodies_at_all(Object *ob)
-{
- // list of Yes
- if ((ob->type==OB_MESH)
- || (ob->type==OB_CURVE)
- || (ob->type==OB_LATTICE)
- || (ob->type==OB_SURF)
- ) return 1;
- // else deny
- return 0;
-}
-static void object_softbodies__enable_psys(void *ob_v, void *psys_v)
-{
- ParticleSystem *psys = psys_v;
- Object *ob = ob_v;
-
- if(psys->softflag & OB_SB_ENABLE) {
- psys->softflag &= ~OB_SB_ENABLE;
- }
- else{
- if (!psys->soft) {
- psys->soft= sbNew();
- psys->softflag |= OB_SB_GOAL|OB_SB_EDGES;
- psys->soft->particles=psys;
- }
- psys->softflag |= OB_SB_ENABLE;
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-
-#ifdef _work_on_sb_solver
-static char sbsolvers[] = "Solver %t|RKP almost SOFT not usable but for some german teachers %x1|STU ip semi implicit euler%x3|SI1 (half step)adaptive semi implict euler %x2|SI2 (use dv)adaptive semi implict euler %x4|SOFT step size controlled midpoint(1rst choice for real softbodies)%x0";
-/* SIF would have been candidate .. well lack of time .. brecht is busy .. better make a stable version for peach now :) */
-static char sbsolvers[] = "SIF semi implicit euler with fixed step size (worth a try with real stiff egdes)%x3|SOFT step size controlled midpoint(1rst choice for real softbodies)%x0";
-#else
-static char sbsolvers[] = "RKCP correct physics (harder to get stable but usefull for education :)%x1|SOFT step size controlled midpoint(1rst choice for real softbodies)%x0";
-#endif
-
-static void object_softbodies_collision(Object *ob)
-{
- SoftBody *sb=ob->soft;
- uiBlock *block;
- static int val;
- short *softflag=&ob->softflag, psys_cur=0;
- int ob_has_hair=psys_ob_has_hair(ob);
- static PTCacheID staticpid;
- int libdata;
-
- if(!_can_softbodies_at_all(ob)) return;
- /*bah that is ugly! creating missing data members in UI code*/
- if(ob->pd == NULL){
- ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
- ob->pd->pdef_sbdamp = 0.1f;
- ob->pd->pdef_sbift = 0.2f;
- ob->pd->pdef_sboft = 0.02f;
- }
- block= uiNewBlock(&curarea->uiblocks, "object_softbodies_collision", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Soft Body", "Physics");
- if(uiNewPanel(curarea, block, "Soft Body Collision", "Physics", 651, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- if(ob_has_hair) {
- if(PE_get_current_num(ob) >= 0) {
- ParticleSystem *psys = PE_get_current(ob);
- if(psys) {
- sb = psys->soft;
- softflag = &psys->softflag;
- psys_cur = 1;
- }
- }
- }
-
- if(psys_cur) {
- if(*softflag & OB_SB_ENABLE)
- val = 1;
- else
- val = 0;
- }
- else
- val = modifiers_isSoftbodyEnabled(ob);
-
- if(!val) {
- uiDefBut(block, LABEL, 0, "",10,10,1,2, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
- uiBlockBeginAlign(block);
- if(psys_cur){
- uiDefBut(block, LABEL, 0, "Hair is not a softbody.",10,190,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- else {
- uiDefBut(block, LABEL, 0, "Object is not a softbody.",10,190,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- uiBlockEndAlign(block);
- }
- else{
- BKE_ptcache_id_from_softbody(&staticpid, ob, sb);
- object_physics_bake_buttons(block, &staticpid, 125, libdata);
-
- /* SELF COLLISION STUFF */
- if ((ob->type==OB_MESH)||(ob->type==OB_CURVE) ) {
- uiBlockBeginAlign(block);
- if (*softflag & OB_SB_EDGES){
- uiDefButBitS(block, TOG, OB_SB_SELF, B_BAKE_CACHE_CHANGE, "Self Collision", 10,80,150,20, softflag, 0, 0, 0, 0, "enable naive vertex ball self collision");
- if(*softflag & OB_SB_SELF){
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Ball Size:", 160,80,150,20, &sb->colball, -10.0, 10.0, 10, 0, "Absolute ball size or factor if not manual adjusted");
- uiDefButS(block, ROW, B_BAKE_CACHE_CHANGE, "Man",10,60,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MANUAL, 0, 0, "Manual adjust");
- uiDefButS(block, ROW, B_BAKE_CACHE_CHANGE, "Av",70,60,60,20, &sb->sbc_mode, 4.0,SBC_MODE_AVG, 0, 0, "Average Spring lenght * Ball Size");
- uiDefButS(block, ROW, B_BAKE_CACHE_CHANGE, "Min",130,60,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MIN, 0, 0, "Minimal Spring lenght * Ball Size");
- uiDefButS(block, ROW, B_BAKE_CACHE_CHANGE, "Max",190,60,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MAX, 0, 0, "Maximal Spring lenght * Ball Size");
- uiDefButS(block, ROW, B_BAKE_CACHE_CHANGE, "AvMiMa",250,60,60,20, &sb->sbc_mode, 4.0,SBC_MODE_AVGMINMAX, 0, 0, "(Min+Max)/2 * Ball Size");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "B Stiff:", 10,40,150,20, &sb->ballstiff, 0.001, 100.0, 10, 0, "Ball inflating presure");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "B Damp:", 160,40,150,20, &sb->balldamp, 0.001, 1.0, 10, 0, "Blending to inelastic collision");
- }
- }
- else{
- uiDefBut(block, LABEL, 0, "<Self Collision> not available because there",10,80,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "are no edges, enable <Use Edges>",10,60,300,20, NULL, 0.0, 0, 0, 0, "");
- }
-
- uiBlockEndAlign(block);
- /*SOLVER SETTINGS*/
- /* done in another panel now*/
- }
-
- uiDefBut(block, LABEL, 0, "",10,10,1,2, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
- }
- uiBlockEndAlign(block);
-}
-static void object_softbodies_solver(Object *ob)
-{
- SoftBody *sb=ob->soft;
- uiBlock *block;
- static int val;
- short *softflag=&ob->softflag, psys_cur=0, adaptive_mode=0;
- int ob_has_hair=psys_ob_has_hair(ob);
- if(!_can_softbodies_at_all(ob)) return;
- block= uiNewBlock(&curarea->uiblocks, "object_softbodies_solver", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Soft Body", "Physics");
- if(uiNewPanel(curarea, block, "Soft Body Solver", "Physics", 651, 0, 318, 204)==0) return;
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- /* doubt that is really needed here but for now */
- if(ob_has_hair) {
- if(PE_get_current_num(ob) >= 0) {
- ParticleSystem *psys = PE_get_current(ob);
- if(psys) {
- sb = psys->soft;
- softflag = &psys->softflag;
- psys_cur = 1;
- }
- }
- }
-
- if(psys_cur) {
- if(*softflag & OB_SB_ENABLE)
- val = 1;
- else
- val = 0;
- }
- else
- val = modifiers_isSoftbodyEnabled(ob);
-
- if(!val) {
- uiDefBut(block, LABEL, 0, "",10,10,1,2, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
- if(psys_cur){
- uiDefBut(block, LABEL, 0, "Hair is not a softbody.",10,190,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- else {
- uiDefBut(block, LABEL, 0, "Object is not a softbody.",10,190,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- }
- else{
- if ((ob->type==OB_MESH)||(ob->type==OB_CURVE) ) {
- /*SOLVER SETTINGS*/
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, 0, "Solver select",10,200,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, sbsolvers,10,180,300,20, &sb->solver_ID, 14.0, 0.0, 0, 0, "Select Solver");
- uiBlockEndAlign(block);
-
- /*some have adapive step size - some not*/
- switch (sb->solver_ID) {
- case 0:
- case 1:
- {adaptive_mode = 1; break;}
- case 3:
- {adaptive_mode = 0; break;}
- default: printf("SB_solver?\n"); // should never happen
- }
- if(adaptive_mode){
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, 0, "Step size controls",10,160,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Error Lim:", 10,140,280,20, &sb->rklimit , 0.001, 10.0, 10, 0, "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
- uiDefButBitS(block, TOG, SBSO_OLDERR, B_BAKE_CACHE_CHANGE,"V", 290,140,20,20, &sb->solverflags, 0, 0, 0, 0, "Use velocities for automagic step sizes");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "MinS:", 10,120,150,20, &sb->minloops, 0.00, 30000.0, 10, 0, "Minimal # solver steps/frame ");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "MaxS:", 160,120,150,20, &sb->maxloops, 0.00, 30000.0, 10, 0, "Maximal # solver steps/frame ");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, 0, "Collision helpers",10,100,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Choke:", 10,80,150,20, &sb->choke, 0.00, 100.0, 10, 0, "'Viscosity' inside collision target ");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Fuzzy:", 160,80,150,20, &sb->fuzzyness, 1.00, 100.0, 10, 0, "Fuzzyness while on collision, high values make collsion handling faster but less stable");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, LABEL, 0, "Diagnosis",10,60,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, SBSO_MONITOR, B_BAKE_CACHE_CHANGE,"Print Performance to Console", 10,40,300,20, &sb->solverflags, 0, 0, 0, 0, "Turn on SB diagnose console prints");
- uiBlockEndAlign(block);
- }
- else{
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Fuzzy:", 210,100,90,20, &sb->fuzzyness, 1.00, 100.0, 10, 0, "Fuzzyness while on collision, high values make collsion handling faster but less stable");
- uiDefButBitS(block, TOG, SBSO_MONITOR, B_BAKE_CACHE_CHANGE,"M", 290,100,20,20, &sb->solverflags, 0, 0, 0, 0, "Turn on SB diagnose console prints");
- uiBlockEndAlign(block);
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Steps:", 10,80,100,20, &sb->minloops, 1.00, 30000.0, 10, 0, "Solver steps/frame ");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Choke:", 210,80,100,20, &sb->choke, 0.00, 100.0, 10, 0, "'Viscosity' inside collision target ");
- }
-
- uiBlockEndAlign(block);
-
- }
- }
- uiBlockEndAlign(block);
-}
-
-static void object_softbodies(Object *ob)
-{
- SoftBody *sb=ob->soft;
- ParticleSystem *psys=NULL;
- uiBlock *block;
- uiBut *but;
- ModifierData *md;
- static int val;
- short *softflag=&ob->softflag, psys_cur=0;
- int ob_has_hair = psys_ob_has_hair(ob);
- static short actsoft= -1;
-
- if(!_can_softbodies_at_all(ob)) return;
- block= uiNewBlock(&curarea->uiblocks, "object_softbodies", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Soft Body", "Physics");
- if(uiNewPanel(curarea, block, "Soft Body", "Physics", 640, 0, 318, 204)==0) return;
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- if(ob_has_hair) {
- psys= psys_get_current(ob);
-
- if(psys && actsoft >= 0) {
- actsoft= psys_get_current_num(ob)+1;
-
- sb=psys->soft;
- softflag=&psys->softflag;
- psys_cur=1;
- }
- else
- actsoft= -1; /* -1 = object */
- }
-
- if(psys_cur && psys) {
- if(*softflag & OB_SB_ENABLE)
- val = 1;
- else
- val = 0;
-
- but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 10,200,130,20, &val, 0, 0, 0, 0, "Sets hair to become soft body");
- uiButSetFunc(but, object_softbodies__enable_psys, ob, psys);
- }
- else {
- md = modifiers_findByType(ob, eModifierType_Softbody);
- val = (md != NULL);
-
- if(ob_has_hair)
- but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 10,200,130,20, &val, 0, 0, 0, 0, "Sets object to become soft body");
- else
- but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 10,200,130,20, &val, 0, 0, 0, 0, "Sets object to become soft body");
-
- uiButSetFunc(but, object_softbodies__enable, ob, NULL);
-
- if(md) {
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_BAKE_CACHE_CHANGE, ICON_SCENE, 145, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable soft body during rendering");
- but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_BAKE_CACHE_CHANGE, VICON_VIEW3D, 165, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable soft body during interactive display");
- uiBlockEndAlign(block);
- }
- }
-
- if(ob_has_hair) {
- char *menustr = psys_menu_string(ob,1);
-
- but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr, 210,200,100,20, &actsoft, 14.0, 0.0, 0, 0, "Browse systems");
- uiButSetFunc(but, PE_change_act, ob, &actsoft);
-
- MEM_freeN(menustr);
- }
-
-
-
- uiDefBut(block, LABEL, 0, "",10,10,300,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
-
- if(val) {
- int defCount;
- char *menustr;
- static char str[128];
-
- if(sb->pointcache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked");
-
- //if(ob->softflag & OB_SB_BAKESET) {
- // uiBlockBeginAlign(block);
- // uiDefButI(block, NUM, B_DIFF, "Start:", 10, 170,100,20, &sb->sfra, 1.0, 10000.0, 10, 0, "Start frame for baking");
- // uiDefButI(block, NUM, B_DIFF, "End:", 110, 170,100,20, &sb->efra, 1.0, 10000.0, 10, 0, "End frame for baking");
- // uiDefButI(block, NUM, B_DIFF, "Interval:", 210, 170,100,20, &sb->interval, 1.0, 10.0, 10, 0, "Interval in frames between baked keys");
- // uiBlockEndAlign(block);
-
- // uiDefButS(block, TOG, B_DIFF, "Local", 10, 145,100,20, &sb->local, 0.0, 0.0, 0, 0, "Use local coordinates for baking");
-
-
- // uiClearButLock();
- // uiBlockBeginAlign(block);
-
- // if(sb->keys) {
- // char str[128];
- // uiDefIconTextBut(block, BUT, B_SOFTBODY_BAKE_FREE, ICON_X, "FREE BAKE", 10, 120,300,20, NULL, 0.0, 0.0, 0, 0, "Free baked result");
- // sprintf(str, "Stored %d vertices %d keys %.3f MB", sb->totpoint, sb->totkey, ((float)16*sb->totpoint*sb->totkey)/(1024.0*1024.0));
- // uiDefBut(block, LABEL, 0, str, 10, 100,300,20, NULL, 0.0, 0.0, 00, 0, "");
- // }
- // else
- // uiDefBut(block, BUT, B_SOFTBODY_BAKE, "BAKE", 10, 120,300,20, NULL, 0.0, 0.0, 10, 0, "Start baking. Press ESC to exit without baking");
- //}
- //else {
- /* GENERAL STUFF */
- if (sb->totpoint){
- sprintf(str, "Vertex Mass; Object mass %f [k]",sb->nodemass*sb->totpoint/1000.0f);
- }
- else{
- sprintf(str, "Vertex Mass");
- }
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Friction:", 10, 170,150,20, &sb->mediafrict, 0.0, 50.0, 10, 0, "General media friction for point movements");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Mass:", 160, 170,150,20, &sb->nodemass , 0.001, 50000.0, 10, 0, str);
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Grav:", 10,150,150,20, &sb->grav , -10.0, 10.0, 10, 0, "Apply gravitation to point movement");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Speed:", 160,150,150,20, &sb->physics_speed , 0.01, 100.0, 10, 0, "Tweak timing for physics to control frequency and speed");
- uiBlockEndAlign(block);
-
- /* GOAL STUFF */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_SB_GOAL, B_BAKE_CACHE_CHANGE, "Use Goal", 10,120,130,20, softflag, 0, 0, 0, 0, "Define forces for vertices to stick to animated position");
- if (*softflag & OB_SB_GOAL){
- if(ob->type==OB_MESH) {
- menustr= get_vertexgroup_menustr(ob);
- defCount=BLI_countlist(&ob->defbase);
- if(defCount==0) sb->vertgroup= 0;
- uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, menustr, 140,120,20,20, &sb->vertgroup, 0, defCount, 0, 0, "Browses available vertex groups");
- MEM_freeN (menustr);
-
- if(sb->vertgroup) {
- bDeformGroup *defGroup = BLI_findlink(&ob->defbase, sb->vertgroup-1);
- if(defGroup)
- uiDefBut(block, BUT, B_BAKE_CACHE_CHANGE, defGroup->name, 160,120,130,20, NULL, 0.0, 0.0, 0, 0, "Name of current vertex group");
- else
- uiDefBut(block, BUT, B_BAKE_CACHE_CHANGE, "(no group)", 160,120,130,20, NULL, 0.0, 0.0, 0, 0, "Vertex Group doesn't exist anymore");
- uiDefIconBut(block, BUT, B_SOFTBODY_DEL_VG, ICON_X, 290,120,20,20, 0, 0, 0, 0, 0, "Disable use of vertex group");
- }
- else
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Goal:", 160,120,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used");
- }
- else {
- uiDefButS(block, TOG, B_BAKE_CACHE_CHANGE, "W", 140,120,20,20, &sb->vertgroup, 0, 1, 0, 0, "Use control point weight values");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Goal:", 160,120,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used");
- }
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Stiff:", 10,100,150,20, &sb->goalspring, 0.0, 0.999, 10, 0, "Goal (vertex target position) spring stiffness");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Damp:", 160,100,150,20, &sb->goalfrict , 0.0, 50.0, 10, 0, "Goal (vertex target position) friction");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Min:", 10,80,150,20, &sb->mingoal, 0.0, 1.0, 10, 0, "Goal minimum, vertex group weights are scaled to match this range");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Max:", 160,80,150,20, &sb->maxgoal, 0.0, 1.0, 10, 0, "Goal maximum, vertex group weights are scaled to match this range");
- }
- uiBlockEndAlign(block);
-
- /* EDGE SPRING STUFF */
- if(ob->type!=OB_SURF) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_SB_EDGES, B_BAKE_CACHE_CHANGE, "Use Edges", 10,50,90,20, softflag, 0, 0, 0, 0, "Use Edges as springs");
- if (*softflag & OB_SB_EDGES){
- uiDefButBitS(block, TOG, OB_SB_QUADS, B_BAKE_CACHE_CHANGE, "Stiff Quads", 110,50,90,20, softflag, 0, 0, 0, 0, "Adds diagonal springs on 4-gons");
- uiDefButBitS(block, TOG, OB_SB_EDGECOLL, B_BAKE_CACHE_CHANGE, "CEdge", 220,50,45,20, softflag, 0, 0, 0, 0, "Edge collide too");
- uiDefButBitS(block, TOG, OB_SB_FACECOLL, B_BAKE_CACHE_CHANGE, "CFace", 265,50,45,20, softflag, 0, 0, 0, 0, "Faces collide too SLOOOOOW warning ");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Pull:", 10,30,75,20, &sb->inspring, 0.0, 0.999, 10, 0, "Edge spring stiffness when longer than rest length");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Push:", 85,30,75,20, &sb->inpush, 0.0, 0.999, 10, 0, "Edge spring stiffness when shorter than rest length");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Damp:", 160,30,70,20, &sb->infrict, 0.0, 50.0, 10, 0, "Edge spring friction");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "SL:",250 ,30,60,20, &sb->springpreload, 0.0, 200.0, 10, 0, "Alter spring lenght to shrink/blow up (unit %) 0 to disable ");
-
- uiDefButBitS(block, TOG,OB_SB_AERO_ANGLE,B_BAKE_CACHE_CHANGE, "N",10,10,20,20, softflag, 0, 0, 0, 0, "New aero(uses angle and length)");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Aero:", 30,10,60,20, &sb->aeroedge, 0.00, 30000.0, 10, 0, "Make edges 'sail'");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Plas:", 90,10,60,20, &sb->plastic, 0.0, 100.0, 10, 0, "Permanent deform");
- if(ob->type==OB_MESH) {
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Bending Stiffness");
- if (*softflag & OB_SB_QUADS){
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Sh:", 230,10,80,20, &sb->shearstiff, 0.0, 1.0, 10, 0, "Shear Stiffness");
- }
- }
- else sb->secondspring = 0;
- uiDefBut(block, LABEL, 0, "",10,10,1,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
- }
- uiBlockEndAlign(block);
- }
- //}
- }
- uiBlockEndAlign(block);
-}
-
-static void object_panel_particle_bake(Object *ob)
-{
- uiBlock *block;
- ParticleSystem *psys= psys_get_current(ob);
- static PTCacheID staticpid;
- int libdata;
-
- if (psys==NULL || psys->part==NULL) return;
- if (ELEM(psys->part->type, PART_HAIR, PART_FLUID)) return;
- if (psys->part->phystype == PART_PHYS_KEYED) return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_bake", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Particle System", "Particle");
- if(uiNewPanel(curarea, block, "Bake", "Particle", 320, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- BKE_ptcache_id_from_particles(&staticpid, ob, psys);
- object_physics_bake_buttons(block, &staticpid, 10, libdata);
-}
-
- /* Panels for new particles*/
-static void object_panel_particle_children(Object *ob)
-{
- uiBlock *block;
- ParticleSystem *psys = psys_get_current(ob);
- ParticleSettings *part;
- short butx=0, buty=160, butw=150, buth=20;
- static short kink_ui=0;
-
- if (psys==NULL) return;
- part=psys->part;
- if(part==NULL) return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_child", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Extras", "Particle");
- if(uiNewPanel(curarea, block, "Children", "Particle", 1300, 0, 318, 204)==0) return;
-
- uiSetButLock((part->id.lib != NULL), ERROR_LIBDATA_MESSAGE);
-
- if(part->type == PART_FLUID) {
- uiDefBut(block, LABEL, 0, "No settings for fluid particles", butx,(buty-=2*buth),2*butw,buth, NULL, 0.0, 0, 0, 0, "");
- return;
- }
-
- uiDefButS(block, MENU, B_PART_ALLOC_CHILD, "Children from:%t|Faces%x2|Particles%x1|None%x0", butx,buty,butw,buth, &part->childtype, 14.0, 0.0, 0, 0, "Create child particles");
-
- if(part->childtype==0) return;
-
- if(part->childtype==PART_CHILD_FACES && !(part->phystype==PART_PHYS_KEYED || part->type==PART_HAIR)) {
- uiDefBut(block, LABEL, 0, "Hair or keyed", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "particles needed!", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- return;
- }
-
- uiBlockBeginAlign(block);
-
- buty -= buth/2;
-
- uiDefButI(block, NUM, B_PART_ALLOC_CHILD, "Amount:", butx,(buty-=buth),butw,buth, &part->child_nbr, 0.0, MAX_PART_CHILDREN, 0, 0, "Amount of children/parent");
- uiDefButI(block, NUM, B_DIFF, "Render Amount:", butx,(buty-=buth),butw,buth, &part->ren_child_nbr, 0.0, MAX_PART_CHILDREN, 0, 0, "Amount of children/parent for rendering");
-
- if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES) {
- uiDefButF(block, NUMSLI, B_PART_DISTR_CHILD, "VParents:", butx,(buty-=buth),butw,buth, &part->parents, 0.0, 1.0, 1, 3, "Relative amount of virtual parents");
- }
- else {
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Rad:", butx,(buty-=buth),butw,buth, &part->childrad, 0.0, 10.0, 1, 3, "Radius of children around parent");
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Round:", butx,(buty-=buth),butw,buth, &part->childflat, 0.0, 1.0, 1, 3, "Roundness of children around parent");
- }
- uiBlockEndAlign(block);
-
- buty -= buth/2;
-
- /* clump */
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Clump:", butx,(buty-=buth),butw,buth, &part->clumpfac, -1.0, 1.0, 1, 3, "Amount of clumpimg");
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->clumppow, -0.999, 0.999, 1, 3, "Shape of clumpimg");
- uiBlockEndAlign(block);
-
- buty -= buth/2;
-
- uiBlockBeginAlign(block);
- if(part->draw_as != PART_DRAW_PATH) {
- uiDefButF(block, NUM, B_PART_REDRAW, "Size:", butx,(buty-=buth),butw/2,buth, &part->childsize, 0.01, 100, 10, 1, "A multiplier for the child particle size");
- uiDefButF(block, NUM, B_PART_REDRAW, "Rand:", butx+butw/2,buty,butw/2,buth, &part->childrandsize, 0.0, 1.0, 10, 1, "Random variation to the size of the child particles");
- }
- if(part->childtype == PART_CHILD_FACES) {
- /* only works if children could be emitted from volume, but that option isn't available now */
- /*uiDefButF(block, NUM, B_PART_REDRAW, "Spread:",butx,(buty-=buth),butw/2,buth, &part->childspread, -1.0, 1.0, 10, 1, "Spread children from the faces");*/
- uiDefButBitI(block, TOG, PART_CHILD_SEAMS, B_PART_DISTR_CHILD, "Use Seams", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Use seams to determine parents");
- }
- uiBlockEndAlign(block);
-
- butx=160;
- buty=180;
-
- if(part->phystype==PART_PHYS_KEYED || part->type==PART_HAIR)
- uiDefButBitS(block, TOG, 1, B_PART_REDRAW, "Kink/Branch", butx,(buty-=buth),butw,buth, &kink_ui, 0, 0, 0, 0, "Show kink and branch options");
- else
- buty-=buth;
-
- if(kink_ui || !(part->phystype==PART_PHYS_KEYED || part->type==PART_HAIR)) {
- buty -= buth/2;
-
- /* kink */
- uiBlockBeginAlign(block);
- if(part->kink) {
- uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
- uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Axis %t|Z %x2|Y %x1|X %x0", butx+butw/2,buty,butw/2,buth, &part->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset");
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Freq:", butx,(buty-=buth),butw,buth, &part->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)");
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end");
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Amplitude:", butx,(buty-=buth),butw,buth, &part->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset");
- }
- else {
- uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
- buty-=3*buth;
- }
- uiBlockEndAlign(block);
-
- if(part->childtype==PART_CHILD_PARTICLES && (part->phystype==PART_PHYS_KEYED || part->type==PART_HAIR)) {
- if(part->flag & PART_BRANCHING) {
- uiDefButBitI(block, TOG, PART_BRANCHING, B_PART_RECALC_CHILD, "Branching", butx,(buty-=2*buth),butw,buth, &part->flag, 0, 0, 0, 0, "Branch child paths from eachother");
- uiDefButBitI(block, TOG, PART_ANIM_BRANCHING, B_PART_RECALC_CHILD, "Animated", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Animate branching");
- uiDefButBitI(block, TOG, PART_SYMM_BRANCHING, B_PART_RECALC_CHILD, "Symmetric", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Start and end points are the same");
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Threshold:", butx,(buty-=buth),butw,buth, &part->branch_thres, 0.0, 1.0, 1, 3, "Threshold of branching");
- }
- else
- uiDefButBitI(block, TOG, PART_BRANCHING, B_PART_RECALC_CHILD, "Branching", butx,(buty-=2*buth),butw,buth, &part->flag, 0, 0, 0, 0, "Branch child paths from eachother");
- }
- }
- else {
- /* rough */
- buty -= buth/2;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Rough1:", butx,(buty-=buth),butw,buth, &part->rough1, 0.0, 10.0, 1, 3, "Amount of location dependant rough");
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Size1:", butx,(buty-=buth),butw,buth, &part->rough1_size, 0.01, 10.0, 1, 3, "Size of location dependant rough");
- uiBlockEndAlign(block);
- buty -= buth/2;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Rough2:", butx,(buty-=buth),butw,buth, &part->rough2, 0.0, 10.0, 1, 3, "Amount of random rough");
- uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Size2:", butx,(buty-=buth),butw,buth, &part->rough2_size, 0.01, 10.0, 1, 3, "Size of random rough");
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Thresh:", butx,(buty-=buth),butw,buth, &part->rough2_thres, 0.00, 1.0, 1, 3, "Amount of particles left untouched by random rough");
- uiBlockEndAlign(block);
- buty -= buth/2;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "RoughE:", butx,(buty-=buth),butw,buth, &part->rough_end, 0.0, 10.0, 1, 3, "Amount of end point rough");
- uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->rough_end_shape, 0.0, 10.0, 1, 3, "Shape of end point rough");
- uiBlockEndAlign(block);
- }
-}
-static void particle_set_vg(void *ob_v, void *vgnum_v)
-{
- Object *ob= ob_v;
- ParticleSystem *psys=psys_get_current(ob);
- short vgnum = *((short *)vgnum_v);
-
- if(vgnum==PSYS_VG_DENSITY)
- psys->recalc|=PSYS_DISTR;
- else if(vgnum!=PSYS_VG_SIZE)
- psys->recalc|=PSYS_INIT;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-static void particle_del_vg(void *ob_v, void *vgnum_v)
-{
- Object *ob= ob_v;
- ParticleSystem *psys=psys_get_current(ob);
- short vgnum = *((short *)vgnum_v);
-
- if(vgnum==PSYS_VG_DENSITY) {
- psys->recalc|=PSYS_DISTR;
- }
-
- psys->vgroup[vgnum]=0;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-static void object_panel_particle_extra(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- ParticleSystem *psys=psys_get_current(ob);
- ParticleSettings *part;
- short butx=0, buty=160, butw=150, buth=20;
- static short vgnum=0;
-
- if (psys==NULL) return;
- part=psys->part;
- if(part==NULL) return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_extra", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Extras", "Particle", 980, 0, 318, 204)==0) return;
-
- uiSetButLock((part->id.lib != NULL), ERROR_LIBDATA_MESSAGE);
-
- if(part->type == PART_FLUID) {
- uiDefBut(block, LABEL, 0, "No settings for fluid particles", butx,(buty-=2*buth),2*butw,buth, NULL, 0.0, 0, 0, 0, "");
- return;
- }
-
- uiDefBut(block, LABEL, 0, "Effectors:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_PART_RECALC, "GR:", butx, (buty-=buth), butw/2, buth, &part->eff_group, "Limit effectors to this Group");
- uiDefButBitI(block, TOG, PART_SIZE_DEFL, B_PART_RECALC, "Size Deflect", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Use particle's size in deflection");
- uiDefButBitI(block, TOG, PART_DIE_ON_COL, B_PART_RECALC, "Die on hit",butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Particles die when they collide with a deflector object");
- uiDefButBitI(block, TOG, PART_STICKY, B_PART_RECALC, "Sticky", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Particles stick to collided objects if they die in the collision");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Time:", butx,(buty-=buth),butw/3,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, PART_GLOB_TIME, B_PART_RECALC, "Global", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Set all ipos that work on particles to be calculated in global/object time");
- uiDefButBitI(block, TOG, PART_ABS_TIME, B_PART_RECALC, "Absolute", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Set all ipos that work on particles to be calculated in absolute/relative time");
-
- //if(part->flag & PART_LOOP){
- // uiDefButBitI(block, TOG, PART_LOOP, B_PART_RECALC, "Loop", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Loop particle lives");
- // uiDefButBitI(block, TOG, PART_LOOP_INSTANT, B_PART_RECALC, "Instantly", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Loop particle life at time of death");
- //}
- //else
- uiDefButBitI(block, TOG, PART_LOOP, B_PART_RECALC, "Loop", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Loop particle lives");
-
- uiDefButF(block, NUM, B_PART_RECALC, "Tweak:", butx,(buty-=buth),butw,buth, &part->timetweak, 0.0, 10.0, 1, 0, "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
- uiBlockEndAlign(block);
-
- if(ob->type==OB_MESH) {
- char *menustr= get_vertexgroup_menustr(ob);
- int defCount=BLI_countlist(&ob->defbase);
- if(defCount==0) psys->vgroup[vgnum]= 0;
-
- uiDefBut(block, LABEL, 0, "Vertex group:", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
-
- uiDefButS(block, MENU, B_PART_REDRAW, "Attribute%t|Effector%x11|TanRot%x10|TanVel%x9|Size%x8|RoughE%x7|Rough2%x6|Rough1%x5|Kink%x4|Clump%x3|Length%x2|Velocity%x1|Density%x0", butx,(buty-=buth),butw-40,buth, &vgnum, 14.0, 0.0, 0, 0, "Attribute effected by vertex group");
- but=uiDefButBitS(block, TOG, (1<<vgnum), B_PART_RECALC, "Neg", butx+butw-40,buty,40,buth, &psys->vg_neg, 0, 0, 0, 0, "Negate the effect of the vertex group");
- uiButSetFunc(but, particle_set_vg, (void *)ob, (void *)(&vgnum));
-
- butx+=butw;
-
- but= uiDefButS(block, MENU, B_PART_RECALC, menustr, butx,buty,buth,buth, psys->vgroup+vgnum, 0, defCount, 0, 0, "Browses available vertex groups");
- uiButSetFunc(but, particle_set_vg, (void *)ob, (void *)(&vgnum));
- MEM_freeN (menustr);
-
- if(psys->vgroup[vgnum]) {
- bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[vgnum]-1);
- if(defGroup)
- uiDefBut(block, BUT, B_PART_REDRAW, defGroup->name, butx+buth,buty,butw-2*buth,buth, NULL, 0.0, 0.0, 0, 0, "Name of current vertex group");
- else{
- uiDefBut(block, BUT, B_PART_REDRAW, "(no group)", butx+buth,buty,butw-2*buth,buth, NULL, 0.0, 0.0, 0, 0, "Vertex Group doesn't exist anymore");
- }
- but=uiDefIconBut(block, BUT, B_PART_RECALC, ICON_X, butx+butw-buth,buty,buth,buth, 0, 0, 0, 0, 0, "Disable use of vertex group");
- uiButSetFunc(but, particle_del_vg, (void *)ob, (void *)(&vgnum));
- }
-
- uiBlockEndAlign(block);
- }
-
- buty=butx=160;
-
- uiDefButI(block, NUM, B_PART_DISTR, "Seed:", butx,(buty-=buth),butw,buth, &psys->seed, 0.0, 255.0, 1, 0, "Set an offset in the random table");
- if(part->type == PART_HAIR) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_PART_RECALC, "Stiff:", butx,(buty-=buth),(butw*3)/5,buth, &part->eff_hair, 0.0, 1.0, 0, 0, "Hair stiffness for effectors");
- uiDefButBitI(block, TOG, PART_CHILD_EFFECT, B_PART_RECALC, "Children", butx+(butw*3)/5,buty,(butw*2)/5,buth, &part->flag, 0, 0, 0, 0, "Apply effectors to children");
- uiBlockEndAlign(block);
- }
- else if(part->phystype == PART_PHYS_NEWTON)
- uiDefButBitI(block, TOG, PART_SELF_EFFECT, B_PART_RECALC, "Self Effect", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Particle effectors effect themselves");
- else
- buty-=buth;
-
- /* size changes must create a recalc event always so that sizes are updated properly */
- uiDefButF(block, NUM, B_PART_RECALC, "Size:", butx,(buty-=buth),butw,buth, &part->size, 0.01, 100, 10, 1, "The size of the particles");
- uiDefButF(block, NUM, B_PART_RECALC, "Rand:", butx,(buty-=buth),butw,buth, &part->randsize, 0.0, 1.0, 10, 1, "Give the particle size a random variation");
-
- uiDefButBitI(block, TOG, PART_SIZEMASS, B_PART_RECALC, "Mass from size", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Multiply mass with particle size");
- uiDefButF(block, NUM, B_PART_RECALC, "Mass:", butx,(buty-=buth),butw,buth, &part->mass, 0.01, 100, 10, 1, "Specify the mass of the particles");
-}
-/* copy from buttons_shading.c */
-static void autocomplete_uv(char *str, void *arg_v)
-{
- Mesh *me;
- CustomDataLayer *layer;
- AutoComplete *autocpl;
- int a;
-
- if(str[0]==0)
- return;
-
- autocpl= autocomplete_begin(str, 32);
-
- /* search if str matches the beginning of name */
- for(me= G.main->mesh.first; me; me=me->id.next)
- for(a=0, layer= me->fdata.layers; a<me->fdata.totlayer; a++, layer++)
- if(layer->type == CD_MTFACE)
- autocomplete_do_name(autocpl, layer->name);
-
- autocomplete_end(autocpl, str);
-}
-static void object_panel_particle_visual(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- ParticleSystem *psys=psys_get_current(ob);
- ParticleSettings *part;
- short butx=0, buty=160, butw=150, buth=20;
- static short bbuvnum=0;
-
- if (psys==NULL) return;
- part=psys->part;
- if(part==NULL) return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_visual", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Visualization", "Particle", 640, 0, 318, 204)==0) return;
-
- uiDefButS(block, MENU, B_PART_RECALC, "Billboard %x9|Group %x8|Object %x7|Path %x6|Line %x5|Axis %x4|Cross %x3|Circle %x2|Point %x1|None %x0", butx,buty,butw,buth, &part->draw_as, 14.0, 0.0, 0, 0, "How particles are visualized");
-
- if(part->draw_as==PART_DRAW_NOT) {
- uiDefButBitS(block, TOG, PART_DRAW_EMITTER, B_PART_REDRAW, "Render emitter", butx,(buty-=2*buth),butw,buth, &part->draw, 0, 0, 0, 0, "Render emitter object");
- return;
- }
-
- uiDefBut(block, LABEL, 0, "Draw:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PART_DRAW_VEL, B_PART_REDRAW, "Vel", butx,(buty-=buth),butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle velocity");
- uiDefButBitS(block, TOG, PART_DRAW_SIZE, B_PART_REDRAW, "Size", butx+butw/3,buty,butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle size");
- uiDefButBitS(block, TOG, PART_DRAW_NUM, B_PART_REDRAW, "Num", butx+2*butw/3,buty,butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle number");
- uiDefButS(block, NUM, B_PART_REDRAW, "Draw Size:", butx,(buty-=buth),butw,buth, &part->draw_size, 0.0, 10.0, 0, 0, "Size of particles on viewport in pixels (0=default)");
- uiDefButS(block, NUM, B_PART_RECALC_CHILD, "Disp:", butx,(buty-=buth),butw,buth, &part->disp, 0.0, 100.0, 10, 0, "Percentage of particles to display in 3d view");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Render:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_PART_DISTR, "Material:", butx,(buty-=buth),butw-30,buth, &part->omat, 1.0, 16.0, 0, 0, "Specify material used for the particles");
- uiDefButBitS(block, TOG, PART_DRAW_MAT_COL, B_PART_RECALC, "Col", butx+butw-30,buty,30,buth, &part->draw, 0, 0, 0, 0, "Draw particles using material's diffuse color");
- uiDefButBitS(block, TOG, PART_DRAW_EMITTER, B_PART_REDRAW, "Emitter", butx,(buty-=buth),butw/2,buth, &part->draw, 0, 0, 0, 0, "Render emitter Object also");
- uiDefButBitS(block, TOG, PART_DRAW_PARENT, B_PART_REDRAW, "Parents", butx+butw/2,buty,butw/2,buth, &part->draw, 0, 0, 0, 0, "Render parent particles");
- uiDefButBitI(block, TOG, PART_UNBORN, B_PART_REDRAW, "Unborn", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Show particles before they are emitted");
- uiDefButBitI(block, TOG, PART_DIED, B_PART_REDRAW, "Died", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Show particles after they have died");
-
- uiBlockEndAlign(block);
-
- butx=160;
- buty=160-buth;
-
- uiBlockBeginAlign(block);
-
- switch(part->draw_as) {
- case PART_DRAW_OB:
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PART_REDRAW_DEPS, "OB:", butx,(buty-=buth),butw,buth, &part->dup_ob, "Show this Object in place of particles");
- break;
- case PART_DRAW_GR:
- uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_PART_REDRAW_DEPS, "GR:", butx,(buty-=buth),butw,buth, &part->dup_group, "Show Objects in this Group in place of particles");
- uiDefButBitS(block, TOG, PART_DRAW_WHOLE_GR, B_PART_REDRAW, "Dupli Group", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Use whole group at once");
- if((part->draw & PART_DRAW_WHOLE_GR)==0)
- uiDefButBitS(block, TOG, PART_DRAW_RAND_GR, B_PART_REDRAW, "Pick Random", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Pick objects from group randomly");
- break;
- case PART_DRAW_BB:
- uiDefButBitS(block, TOG, PART_DRAW_BB_LOCK, B_PART_REDRAW, "Lock", butx,(buty+=buth),butw/2,buth, &part->draw, 0, 0, 0, 0, "Lock the billboards align axis");
- uiDefButS(block, MENU, B_PART_REDRAW, "Align to%t|Velocity%x4|View%x3|Z%x2|Y%x1|X%x0", butx+butw/2,buty,butw/2,buth, &part->bb_align, 14.0, 0.0, 0, 0, "In respect to what the billboards are aligned");
- uiDefButF(block, NUM, B_PART_REDRAW, "Tilt:", butx,(buty-=buth),butw/2,buth, &part->bb_tilt, -1.0, 1.0, 0, 0, "Tilt of the billboards");
- uiDefButF(block, NUM, B_PART_REDRAW, "Rand:", butx+butw/2,buty,butw/2,buth, &part->bb_rand_tilt, 0.0, 1.0, 0, 0, "Random tilt of the billboards");
- uiDefButS(block, NUM, B_PART_REDRAW, "UV Split:", butx,(buty-=buth),butw,buth, &part->bb_uv_split, 1.0, 10.0, 0, 0, "Amount of rows/columns to split uv coordinates for billboards");
- uiDefButS(block, MENU, B_PART_REDRAW, "Animate%t|Angle%x2|Time%x1|None%x0", butx,(buty-=buth),butw/2,buth, &part->bb_anim, 14.0, 0.0, 0, 0, "How to animate billboard textures");
- uiDefButS(block, MENU, B_PART_REDRAW, "Offset%t|Random%x2|Linear%x1|None%x0", butx+butw/2,buty,butw/2,buth, &part->bb_split_offset, 14.0, 0.0, 0, 0, "How to offset billboard textures");
- uiDefButF(block, NUM, B_PART_REDRAW, "OffsetX:", butx,(buty-=buth),butw,buth, part->bb_offset, -1.0, 1.0, 0, 0, "Offset billboards horizontally");
- uiDefButF(block, NUM, B_PART_REDRAW, "OffsetY:", butx,(buty-=buth),butw,buth, part->bb_offset+1, -1.0, 1.0, 0, 0, "Offset billboards vertically");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PART_REDRAW, "OB:", butx,(buty-=buth),butw,buth, &part->bb_ob, "Billboards face this object (default is active camera)");
- uiDefButS(block, MENU, B_PART_REDRAW, "UV channel%t|Split%x2|Time-Index (X-Y)%x1|Normal%x0", butx,(buty-=buth),butw,buth, &bbuvnum, 14.0, 0.0, 0, 0, "UV channel");
- but=uiDefBut(block, TEX, B_PART_REDRAW, "UV:", butx,(buty-=buth),butw,buth, psys->bb_uvname+bbuvnum, 0, 31, 0, 0, "Set name of UV layer to use with billboards, default is active UV layer");
- uiButSetCompleteFunc(but, autocomplete_uv, NULL);
- break;
- case PART_DRAW_LINE:
- uiDefButBitS(block, TOG, PART_DRAW_VEL_LENGTH, B_PART_REDRAW, "Speed", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Multiply line length by particle speed");
- uiDefButF(block, NUM, B_PART_REDRAW, "Back:", butx,(buty-=buth),butw,buth, &part->draw_line[0], 0.0, 10.0, 0, 0, "Length of the line's tail");
- uiDefButF(block, NUM, B_PART_REDRAW, "Front:", butx,(buty-=buth),butw,buth, &part->draw_line[1], 0.0, 10.0, 0, 0, "Length of the line's head");
- break;
- case PART_DRAW_PATH:
- if(part->phystype==PART_PHYS_KEYED || part->type==PART_HAIR) {
- uiDefButS(block, NUM, B_PART_RECALC, "Steps:", butx,(buty+=buth),butw,buth, &part->draw_step, 0.0, 7.0, 0, 0, "How many steps paths are drawn with (power of 2)");
- uiDefButS(block, NUM, B_PART_REDRAW, "Render:", butx,(buty-=buth),butw,buth, &part->ren_step, 0.0, 9.0, 0, 0, "How many steps paths are rendered with (power of 2)");
-
- uiDefButBitI(block, TOG, PART_ABS_LENGTH, B_PART_RECALC, "Abs Length", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Use maximum length for children");
- uiDefButF(block, NUM, B_PART_RECALC, "Max Length:", butx,(buty-=buth),butw,buth, &part->abslength, 0.0, 10000.0, 1, 3, "Absolute maximum path length for children, in blender units");
- uiDefButF(block, NUMSLI, B_PART_RECALC, "RLength:", butx,(buty-=buth),butw,buth, &part->randlength, 0.0, 1.0, 1, 3, "Give path length a random variation");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, PART_HAIR_BSPLINE, B_PART_RECALC, "B-Spline", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Interpolate hair using B-Splines");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PART_DRAW_REN_STRAND, B_PART_REDRAW, "Strand render", butx,buty-=buth,butw,buth, &part->draw, 0, 0, 0, 0, "Use the strand primitive for rendering");
- if(part->draw & PART_DRAW_REN_STRAND) {
- uiDefButS(block, NUM, B_PART_REDRAW, "Angle:", butx,(buty-=buth),butw,buth, &part->adapt_angle, 0.0, 45.0, 0, 0, "How many degrees path has to curve to make another render segment");
- }
- else {
- uiDefButBitS(block, TOG, PART_DRAW_REN_ADAPT, B_PART_REDRAW, "Adaptive render", butx,buty-=buth,butw,buth, &part->draw, 0, 0, 0, 0, "Draw steps of the particle path");
- if(part->draw & PART_DRAW_REN_ADAPT) {
- uiDefButS(block, NUM, B_PART_REDRAW, "Angle:", butx,(buty-=buth),butw/2,buth, &part->adapt_angle, 0.0, 45.0, 0, 0, "How many degrees path has to curve to make another render segment");
- uiDefButS(block, NUM, B_PART_REDRAW, "Pixel:", butx+butw/2,buty,(butw+1)/2,buth, &part->adapt_pix, 0.0, 50.0, 0, 0, "How many pixels path has to cover to make another render segment");
- }
- }
- }
- else {
- uiDefBut(block, LABEL, 0, "Hair or keyed", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "particles needed!", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- }
- break;
- }
- uiBlockEndAlign(block);
-}
-static void object_panel_particle_simplification(Object *ob)
-{
- uiBlock *block;
- ParticleSystem *psys=psys_get_current(ob);
- ParticleSettings *part;
- short butx=0, buty=160, butw=150, buth=20;
-
- if (psys==NULL) return;
- part=psys->part;
- if(part==NULL) return;
-
- if(part->draw_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND))
- return;
- if(part->childtype!=PART_CHILD_FACES)
- return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_simplification", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Visualization", "Particle");
- if(uiNewPanel(curarea, block, "Simplification", "Particle", 640, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PART_SIMPLIFY_ENABLE, B_PART_REDRAW, "Child Simplification", butx,buty-=buth,butw,buth, &part->simplify_flag, 0, 0, 0, 0, "Remove child strands as the object becomes smaller on the screen");
- uiBlockEndAlign(block);
- if(part->simplify_flag & PART_SIMPLIFY_ENABLE) {
- buty -= 10;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NOP, "Reference Size:", butx,(buty-=buth),butw,buth, &part->simplify_refsize, 1.0, 32768.0, 0, 0, "Reference size size in pixels, after which simplification begins");
- uiDefButF(block, NUM, B_NOP, "Rate:", butx,(buty-=buth),butw,buth, &part->simplify_rate, 0.0, 1.0, 0, 0, "Speed of simplification");
- uiDefButF(block, NUM, B_NOP, "Transition:", butx,(buty-=buth),butw,buth, &part->simplify_transition, 0.0, 1.0, 0, 0, "Transition period for fading out strands");
- uiBlockEndAlign(block);
-
- buty -= 10;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, PART_SIMPLIFY_VIEWPORT, B_PART_REDRAW, "Viewport", butx,buty-=buth,butw,buth, &part->simplify_flag, 0, 0, 0, 0, "Remove child strands as the object goes outside the viewport");
- uiDefButF(block, NUM, B_NOP, "Rate:", butx,(buty-=buth),butw,buth, &part->simplify_viewport, 0.0, 0.999, 0, 0, "Speed of simplification");
- uiBlockEndAlign(block);
- }
- uiBlockEndAlign(block);
-}
-static void boidrule_moveDown(void *part_v, void *rule_v)
-{
- ParticleSettings *part = part_v;
- char r, *rule = rule_v;
-
- int n= rule - part->boidrule;
-
- if(n+1 < BOID_TOT_RULES) {
- r=part->boidrule[n];
- part->boidrule[n]=part->boidrule[n+1];
- part->boidrule[n+1]=r;
- }
-}
-static void boidrule_moveUp(void *part_v, void *rule_v)
-{
- ParticleSettings *part = part_v;
- char r, *rule = rule_v;
-
- int n= rule - part->boidrule;
-
- if(n-1 >= 0) {
- r=part->boidrule[n];
- part->boidrule[n]=part->boidrule[n-1];
- part->boidrule[n-1]=r;
- }
-}
-static void object_panel_particle_physics(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- ParticleSystem *psys=psys_get_current(ob);
- ParticleSettings *part;
- short butx=0, buty=160, butw=150, buth=20;
-
- if (psys==NULL) return;
-
- part=psys->part;
-
- if(part==NULL) return;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_physics", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Physics", "Particle", 320, 0, 318, 204)==0) return;
-
- if(part->type == PART_FLUID) {
- uiDefBut(block, LABEL, 0, "No settings for fluid particles", butx,(buty-=2*buth),2*butw,buth, NULL, 0.0, 0, 0, 0, "");
- return;
- }
-
- if(ob->id.lib)
- uiSetButLock(1, "Can't edit library data");
- else if(psys->flag & PSYS_EDITED)
- uiSetButLock(1, "Hair is edited!");
- else if(psys->pointcache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked!");
-
- if(part->phystype==PART_PHYS_KEYED){
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, PSYS_FIRST_KEYED, B_PART_RECALC, "First", butx,buty,45,buth, &psys->flag, 0, 0, 0, 0, "Sets the system to be the starting point of keyed particles");
- uiDefButS(block, MENU, B_PART_RECALC, "Physics %t|Boids%x3|Keyed %x2|Newtonian %x1|None %x0", butx+45,buty,butw-45,buth, &part->phystype, 14.0, 0.0, 0, 0, "Select particle physics type");
- uiBlockEndAlign(block);
- }
- else
- uiDefButS(block, MENU, B_PART_RECALC, "Physics%t|Boids%x3|Keyed%x2|Newtonian%x1|None%x0", butx,buty,butw,buth, &part->phystype, 14.0, 0.0, 0, 0, "Select particle physics type");
-
- if(part->phystype==PART_PHYS_BOIDS) {
- int i;
- char *rules[BOID_TOT_RULES] = {"Collision", "Avoid", "Crowd", "Center", "AvVel", "Velocity", "Goal", "Level"};
- char *ruletext[BOID_TOT_RULES] = {
- "Avoid deflector objects",
- "Avoid predators",
- "Avoid other boids",
- "Get to flock center",
- "Maintain average velocity",
- "Match velocity of nearby boids",
- "Seek goal",
- "Keep the Z level"
- };
- /* left column */
- uiDefBut(block, LABEL, 0, "Behaviour:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- for(i=0; i<BOID_TOT_RULES; i++) {
- uiBlockSetCol(block, TH_BUT_ACTION);
-
- but = uiDefIconBut(block, BUT, B_PART_RECALC, VICON_MOVE_UP, butx, (buty-=buth), 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Move rule up");
- uiButSetFunc(but, boidrule_moveUp, part, part->boidrule+i);
-
- but = uiDefIconBut(block, BUT, B_PART_RECALC, VICON_MOVE_DOWN, butx+20, buty, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Move rule down");
- uiButSetFunc(but, boidrule_moveDown, part, part->boidrule+i);
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
-
- uiDefButF(block, NUM, B_PART_RECALC, rules[part->boidrule[i]], butx+40,buty,butw-40,buth, part->boidfac+part->boidrule[i], -1.0, 2.0, 1, 3, ruletext[part->boidrule[i]]);
- }
- uiBlockSetCol(block, TH_AUTO);
- uiBlockEndAlign(block);
-
- buty=140;
- butx=160;
-
- uiDefBut(block, LABEL, 0, "Physics:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, PART_BOIDS_2D, B_PART_RECALC, "2D", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Constrain boids to a surface");
- uiDefButF(block, NUM, B_PART_RECALC, "MaxVelocity:", butx,(buty-=buth),butw,buth, &part->max_vel, 0.0, 200.0, 1, 3, "Maximum velocity");
- uiDefButF(block, NUM, B_PART_RECALC, "AvVelocity:", butx,(buty-=buth),butw,buth, &part->average_vel, 0.0, 1.0, 1, 3, "The usual speed % of max velocity");
- uiDefButF(block, NUM, B_PART_RECALC, "LatAcc:", butx,(buty-=buth),butw,buth, &part->max_lat_acc, 0.0, 1.0, 1, 3, "Lateral acceleration % of max velocity");
- uiDefButF(block, NUM, B_PART_RECALC, "TanAcc:", butx,(buty-=buth),butw,buth, &part->max_tan_acc, 0.0, 1.0, 1, 3, "Tangential acceleration % of max velocity");
- if(part->flag & PART_BOIDS_2D) {
- uiDefButF(block, NUM, B_PART_RECALC, "GroundZ:", butx,(buty-=buth),butw,buth, &part->groundz, -100.0, 100.0, 1, 3, "Default Z value");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw,buth, &psys->keyed_ob, "Constrain boids to object's surface");
- }
- else {
- uiDefButF(block, NUM, B_PART_RECALC, "Banking:", butx,(buty-=buth),butw,buth, &part->banking, -10.0, 10.0, 1, 3, "Banking of boids on turns (1.0==natural banking)");
- uiDefButF(block, NUM, B_PART_RECALC, "MaxBank:", butx,(buty-=buth),butw,buth, &part->max_bank, 0.0, 1.0, 1, 3, "How much a boid can bank at a single step");
- }
- uiBlockEndAlign(block);
- uiDefButS(block, NUM, B_PART_RECALC, "N:", butx,(buty-=buth),butw,buth, &part->boidneighbours, 1.0, 10.0, 1, 3, "How many neighbours to consider for each boid");
- }
- else {
- /* left column */
- uiDefBut(block, LABEL, 0, "Initial velocity:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING2);
- uiDefButF(block, NUM, B_PART_RECALC, "Object:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->obfac, -1.0, 1.0, 1, 3, "Let the object give the particle a starting speed");
- uiDefButF(block, NUM, B_PART_RECALC, "Normal:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->normfac, -200.0, 200.0, 1, 3, "Let the surface normal give the particle a starting speed");
- uiDefButF(block, NUM, B_PART_RECALC, "Random:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->randfac, 0.0, 200.0, 1, 3, "Give the starting speed a random variation");
- if(part->type==PART_REACTOR) {
- uiDefButF(block, NUM, B_PART_RECALC, "Particle:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->partfac, -10.0, 10.0, 1, 3, "Let the target particle give the particle a starting speed");
- uiDefButF(block, NUM, B_PART_RECALC, "Reactor:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->reactfac, -10.0, 10.0, 1, 3, "Let the vector away from the target particles location give the particle a starting speed");
- }
- else {
- uiDefButF(block, NUM, B_PART_RECALC, "Tan:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->tanfac, -200.0, 200.0, 1, 3, "Let the surface tangent give the particle a starting speed");
- uiDefButF(block, NUM, B_PART_RECALC, "Rot:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->tanphase, -1.0, 1.0, 1, 3, "Rotate the surface tangent");
- }
- uiBlockSetCol(block, TH_AUTO);
- uiBlockEndAlign(block);
-
- buty=160;
- butx=160;
-
- if(part->phystype==PART_PHYS_NEWTON)
- uiDefButS(block, MENU, B_PART_RECALC, "Integration%t|RK4%x2|Midpoint%x1|Euler%x0", butx,buty,butw,buth, &part->integrator, 14.0, 0.0, 0, 0, "Select physics integrator type");
-
- uiDefBut(block, LABEL, 0, "Rotation:", butx, (buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, PART_ROT_DYN, B_PART_RECALC, "Dynamic", butx,(buty-=buth*4/5),butw/2,buth*4/5, &part->flag, 0, 0, 0, 0, "Sets rotation to dynamic/constant");
- uiDefButS(block, MENU, B_PART_RECALC, "Rotation%t|Object Z%x8|Object Y%x7|Object X%x6|Global Z%x5|Global Y%x4|Global X%x3|Velocity%x2|Normal%x1|None%x0", butx+butw/2,buty,butw/2,buth*4/5, &part->rotmode, 14.0, 0.0, 0, 0, "Particles initial rotation");
- uiBlockSetCol(block, TH_BUT_SETTING2);
- uiDefButF(block, NUM, B_PART_RECALC, "Random:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->randrotfac, 0.0, 1.0, 1, 3, "Randomize rotation");
- uiDefButF(block, NUM, B_PART_RECALC, "Phase:", butx,(buty-=buth*4/5),butw/2,buth*4/5, &part->phasefac, -1.0, 1.0, 1, 3, "Initial rotation phase");
- uiDefButF(block, NUM, B_PART_RECALC, "Rand:", butx+butw/2,buty,butw/2,buth*4/5, &part->randphasefac, 0.0, 1.0, 1, 3, "Randomize rotation phase");
- uiBlockSetCol(block, TH_AUTO);
-
- uiDefButS(block, MENU, B_PART_RECALC, "Angular v %t|Random%x2|Spin%x1|None%x0", butx,(buty-=buth*4/5),butw,buth*4/5, &part->avemode, 14.0, 0.0, 0, 0, "Select particle angular velocity mode");
- uiBlockSetCol(block, TH_BUT_SETTING2);
- if(ELEM(part->avemode,PART_AVE_RAND,PART_AVE_SPIN))
- uiDefButF(block, NUM, B_PART_RECALC, "Angular v:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->avefac, -200.0, 200.0, 1, 3, "Angular velocity amount");
- uiBlockSetCol(block, TH_AUTO);
- uiBlockEndAlign(block);
-
- if(part->phystype==PART_PHYS_NEWTON) {
- butx=0;
- buty=40;
- uiDefBut(block, LABEL, 0, "Global effects:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, "");
-
- butw=103;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_PART_RECALC, "AccX:", butx,(buty-=buth),butw,buth, part->acc, -200.0, 200.0, 10, 0, "Specify a constant acceleration along the X-axis");
- uiDefButF(block, NUM, B_PART_RECALC, "AccY:", butx+butw,buty,butw,buth, part->acc+1,-200.0, 200.0, 10, 0, "Specify a constant acceleration along the Y-axis");
- uiDefButF(block, NUM, B_PART_RECALC, "AccZ:", butx+2*butw,buty,butw+1,buth, part->acc+2, -200.0, 200.0, 10, 0, "Specify a constant acceleration along the Z-axis");
-
- uiDefButF(block, NUM, B_PART_RECALC, "Drag:", butx,(buty-=buth),butw,buth, &part->dragfac, 0.0, 1.0, 1, 0, "Specify the amount of air-drag");
- uiDefButF(block, NUM, B_PART_RECALC, "Brown:", butx+butw,buty,butw,buth, &part->brownfac, 0.0, 200.0, 1, 0, "Specify the amount of brownian motion");
- uiDefButF(block, NUM, B_PART_RECALC, "Damp:", butx+2*butw,buty,butw+1,buth, &part->dampfac, 0.0, 1.0, 1, 0, "Specify the amount of damping");
- uiBlockEndAlign(block);
- }
- else if(part->phystype==PART_PHYS_KEYED) {
- short totkpsys=1;
- butx=0;
- buty=40;
- uiDefBut(block, LABEL, 0, "Keyed Target:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, "");
- if(psys->keyed_ob){
- if(psys->keyed_ob==ob || BLI_findlink(&psys->keyed_ob->particlesystem,psys->keyed_psys-1)==0)
- uiBlockSetCol(block, TH_REDALERT);
- else
- totkpsys = BLI_countlist(&psys->keyed_ob->particlesystem);
- }
- else
- uiBlockSetCol(block, TH_REDALERT);
-
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw*2/3,buth, &psys->keyed_ob, "The object that has the target particle system");
- uiDefButS(block, NUM, B_PARTTARGET, "Psys:", butx+butw*2/3,buty,butw/3,buth, &psys->keyed_psys, 1.0, totkpsys, 0, 0, "The target particle system number in the object");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_AUTO);
-
- butx=160;
-
- if(psys->flag & PSYS_FIRST_KEYED)
- uiDefButBitI(block, TOG, PSYS_KEYED_TIME, B_PART_RECALC, "Timed", butx,buty,butw,buth, &psys->flag, 0, 0, 0, 0, "Use intermediate key times");
- else
- uiDefButF(block, NUMSLI, B_PART_RECALC, "Time:", butx,buty,butw,buth, &part->keyed_time, 0.0, 1.0, 1, 3, "Keyed key time relative to remaining particle life");
- }
- }
-}
-
-static void object_panel_particle_system(Object *ob)
-{
- uiBlock *block;
- uiBut *but;
- ParticleSystem *psys=NULL;
- ParticleSettings *part;
- ID *id, *idfrom;
- ModifierData *md;
- short butx=0, buty=160, butw=150, buth=20;
- char str[30], *lockmessage= NULL;
- static short partact;
- short totpart, lock= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_system", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Particle System", "Particle", 0, 0, 318, 204)==0) return;
-
- if(ob->id.lib) uiSetButLock(1, "Can't edit library data");
-
- if(ELEM4(ob->type,OB_MESH,OB_FONT,OB_CURVE,OB_SURF)==0) {
- uiDefBut(block, LABEL, 0, "Only Mesh or Curve Objects can generate particles", 10,180,300,20, NULL, 0.0, 0, 0, 0, "");
- return;
- }
- psys=psys_get_current(ob);
-
- if(psys)
- id=(ID*)(psys->part);
- else
- id=NULL;
- idfrom=&ob->id;
-
- if(psys==0 || psys->part->type != PART_FLUID) {
- /* browse buttons */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- butx= std_libbuttons(block, butx, buty, 0, NULL, B_PARTBROWSE, ID_PA, 0, id, idfrom, &(G.buts->menunr), B_PARTALONE, 0, B_PARTDELETE, 0, 0);
- }
-
- uiBlockSetCol(block, TH_AUTO);
-
- partact=psys_get_current_num(ob)+1;
- totpart=BLI_countlist(&ob->particlesystem);
- sprintf(str, "%d Part", totpart);
- but=uiDefButS(block, NUM, B_PARTACT, str, 230,buty,83,buth, &partact, 1.0, totpart+1, 0, 0, "Shows the number of particle systems in the object and the active particle system");
- uiButSetFunc(but, PE_change_act, ob, &partact);
-
- if(psys==NULL)
- return;
-
- part=psys->part;
-
- if(part==NULL)
- return;
-
- butx=0;
-
- if(part->type == PART_FLUID) {
- uiDefBut(block, LABEL, 0, "No settings for fluid particles", butx,buty,2*butw,buth, NULL, 0.0, 0, 0, 0, "");
- return;
- }
-
- buty -= (buth+5);
-
- if(part->type == PART_HAIR){
- if(psys->flag & PSYS_EDITED)
- uiDefBut(block, BUT, B_PART_EDITABLE, "Free Edit", butx+butw+10,buty,butw,buth, NULL, 0.0, 0.0, 10, 0, "Free editing");
- else
- uiDefBut(block, BUT, B_PART_EDITABLE, "Set Editable", butx+butw+10,buty,butw,buth, NULL, 0.0, 0.0, 10, 0, "Finalize hair to enable editing in particle mode");
-
- }
-
- md= (ModifierData*)psys_get_modifier(ob, psys);
- if(md) {
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_PART_RECALC, ICON_SCENE, butx+butw-40, buty, 20, 20,&md->mode, 0, 0, 1, 0, "Enable particle system during rendering");
- but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_PART_RECALC, VICON_VIEW3D, butx+butw-20, buty, 20, 20,&md->mode, 0, 0, 1, 0, "Enable particle system during interactive display");
- uiBlockEndAlign(block);
- }
-
- if(psys->flag & PSYS_EDITED) {
- lockmessage= "Hair is edited!";
- lock= 1;
- }
- else if(psys->pointcache->flag & PTCACHE_BAKED) {
- lockmessage= "Simulation frames are baked!";
- lock= 1;
- }
-
- if(lock)
- uiSetButLock(1, lockmessage);
-
- uiDefButS(block, MENU, B_PARTTYPE, "Type%t|Hair%x2|Reactor%x1|Emitter%x0", butx,buty,butw-45,buth, &part->type, 14.0, 0.0, 0, 0, "Type of particle system");
-
- buty-=5;
- uiDefBut(block, LABEL, 0, "Basic:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
-
- if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT)
- uiDefButI(block, NUM, B_PART_ALLOC, "Resol:", butx,(buty-=buth),butw,buth, &part->grid_res, 1.0, 100.0, 0, 0, "The resolution of the particle grid");
- else
- uiDefButI(block, NUM, B_PART_ALLOC, "Amount:", butx,(buty-=buth),butw,buth, &part->totpart, 0.0, 100000.0, 0, 0, "The total number of particles");
- if(part->type==PART_REACTOR) {
- uiDefButBitI(block, TOG, PART_REACT_STA_END, B_PART_INIT, "Sta/End", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Give birth to unreacted particles eventually");
- uiDefButS(block, MENU, B_PART_RECALC, "React on %t|Near %x2|Collision %x1|Death %x0", butx+butw/2,buty,butw/2,buth, &part->reactevent, 14.0, 0.0, 0, 0, "The event of target particles to react");
- if(part->flag&PART_REACT_STA_END) {
- uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, 1.0, part->end, 100, 1, "Frame # to start emitting particles");
- uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles");
- }
- if(part->from!=PART_FROM_PARTICLE) {
- uiDefButBitI(block, TOG, PART_REACT_MULTIPLE, B_PART_RECALC, "Multi React", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "React multiple times");
- uiDefButF(block, NUM, B_PART_RECALC, "Shape:", butx,(buty-=buth),butw,buth, &part->reactshape, 0.0, 10.0, 100, 1, "Power of reaction strength dependence on distance to target");
- }
- }
- else if(part->type==PART_HAIR) {
- uiDefButS(block, NUM, B_PART_RECALC, "Segments:", butx,(buty-=buth),butw,buth, &part->hair_step, 2.0, 50.0, 0, 0, "Amount of hair segments");
- }
- else {
- uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, -MAXFRAMEF, part->end, 100, 1, "Frame # to start emitting particles");
- uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles");
- }
-
- if(part->type!=PART_HAIR) {
- uiDefButF(block, NUM, B_PART_INIT, "Life:", butx,(buty-=buth),butw,buth, &part->lifetime, 1.0, MAXFRAMEF, 100, 1, "Specify the life span of the particles");
- uiDefButF(block, NUM, B_PART_INIT, "Rand:", butx,(buty-=buth),butw,buth, &part->randlife, 0.0, 2.0, 10, 1, "Give the particle life a random variation");
- }
-
- uiBlockEndAlign(block);
-
- butx=160;
- buty=120;
-
- buty-=10;
-
- uiDefBut(block, LABEL, 0, "Emit From:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
-
- if(lock) uiClearButLock();
- uiDefButBitI(block, TOG, PART_TRAND, B_PART_DISTR, "Random", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Emit in random order of elements");
- if(lock) uiSetButLock(1, lockmessage);
-
- if(part->type==PART_REACTOR)
- uiDefButS(block, MENU, B_PART_DISTR, "Particle %x3|Volume %x2|Faces %x1|Verts %x0", butx+butw/2,buty,butw/2,buth, &part->from, 14.0, 0.0, 0, 0, "Where to emit particles from");
- else
- uiDefButS(block, MENU, B_PART_DISTR, "Volume %x2|Faces %x1|Verts%x0", butx+butw/2,buty,butw/2,buth, &part->from, 14.0, 0.0, 0, 0, "Where to emit particles from");
-
- if(ELEM(part->from,PART_FROM_FACE,PART_FROM_VOLUME)) {
- if(lock) uiClearButLock();
- uiDefButBitI(block, TOG, PART_EDISTR, B_PART_DISTR, "Even",butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Use even distribution from faces based on face areas or edge lengths");
- if(lock) uiSetButLock(1, lockmessage);
- uiDefButS(block, MENU, B_PART_DISTR, "Distribution %t|Grid%x2|Random%x1|Jittered%x0", butx+butw/2,buty,butw/2,buth, &part->distr, 14.0, 0.0, 0, 0, "How to distribute particles on selected element");
- if(part->distr==PART_DISTR_JIT) {
- uiDefButF(block, NUM, B_PART_DISTR, "Amount:", butx,(buty-=buth),butw,buth, &part->jitfac, 0, 2.0, 1, 1, "Amount of jitter applied to the sampling");
- uiDefButI(block, NUM, B_PART_DISTR, "P/F:", butx,(buty-=buth),butw,buth, &part->userjit, 0, 1000.0, 1, 1, "Emission locations / face (0 = automatic)");
- }
- if(part->distr==PART_DISTR_GRID){
- uiDefButBitI(block, TOG, PART_GRID_INVERT, B_PART_DISTR, "Invert",butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Invert what is considered object and what is not.");
- }
- }
- uiBlockEndAlign(block);
-
- buty=30;
-
- if(part->type==PART_REACTOR) {
- ParticleSystem *tpsys=0;
- Object *tob=0;
- int tottpsys;
-
- uiDefBut(block, LABEL, 0, "Target:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
-
- if(psys->target_ob)
- tob=psys->target_ob;
- else
- tob=ob;
-
- tottpsys=BLI_countlist(&tob->particlesystem);
-
- uiBlockBeginAlign(block);
-
- if(tob->particlesystem.first==0)
- uiBlockSetCol(block, TH_REDALERT);
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw*2/3,buth, &psys->target_ob, "The object that has the target particle system (empty if same object)");
-
- tpsys=BLI_findlink(&tob->particlesystem,psys->target_psys-1);
- if(tpsys) {
- if(tob==ob && tpsys==psys)
- uiBlockSetCol(block, TH_REDALERT);
- }
- else
- uiBlockSetCol(block, TH_REDALERT);
-
- uiDefButS(block, NUM, B_PARTTARGET, "Psys:", butx+butw*2/3,buty,butw/3,buth, &psys->target_psys, 1.0, tottpsys, 0, 0, "The target particle system number in the object");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_AUTO);
- }
-}
-
-/* NT - Panel for fluidsim settings */
-#ifndef DISABLE_ELBEEM
-static int _can_fluidsim_at_all(Object *ob)
-{
- // list of Yes
- if ((ob->type==OB_MESH)) return 1;
- // else deny
- return 0;
-}
-
-/* Panel for fluidsim */
-static void object_fluidsim__enabletoggle(void *ob_v, void *arg2)
-{
- Object *ob = ob_v;
- ModifierData *md = modifiers_findByType(ob, eModifierType_Fluidsim);
-
- if (!md) {
- md = modifier_new(eModifierType_Fluidsim);
- BLI_addhead(&ob->modifiers, md);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else {
- Object *ob = ob_v;
- ModifierData *md = modifiers_findByType(ob, eModifierType_Fluidsim);
-
- if (!md)
- return;
-
- BLI_remlink(&ob->modifiers, md);
-
- modifier_free(md);
-
- BIF_undo_push("Del modifier");
-
- //ob->softflag |= OB_SB_RESET;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWOOPS, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
- object_handle_update(ob);
- countall();
- }
-}
-#endif
-
-static void object_panel_fluidsim(Object *ob)
-{
-#ifndef DISABLE_ELBEEM
- uiBlock *block;
- int yline = 174;
- const int lineHeight = 20;
- const int separateHeight = 2;
- const int objHeight = 20;
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- int libdata = 0;
- static int val = 0;
- uiBut *but=NULL;
-
- block= uiNewBlock(&curarea->uiblocks, "object_fluidsim", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Fluid", "Physics", 1060, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- val = (fluidmd ? 1:0);
-
- if(!_can_fluidsim_at_all(ob))
- {
- uiDefBut(block, LABEL, 0, "Fluidsim can be activated on mesh only.", 10,200,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- else
- {
- but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Fluid", 0,200,130,20, &val, 0, 0, 0, 0, "Sets object to participate in fluid simulation");
- uiButSetFunc(but, object_fluidsim__enabletoggle, ob, NULL);
-
- /*
- // no pointcache used in fluidsim *YET*
- md = (ModifierData*)clmd;
- if(md) {
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_BAKE_CACHE_CHANGE, ICON_SCENE, 145, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable fluidsim during rendering");
- but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_BAKE_CACHE_CHANGE, VICON_VIEW3D, 165, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable fluidsim during interactive display");
- uiBlockEndAlign(block);
- }
- */
- }
-
- uiDefBut(block, LABEL, 0, "",0,0,300,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
-
- if(fluidmd)
- {
- FluidsimSettings *fss = fluidmd->fss;
-
- if(!fss)
- return;
-
- /* GENERAL STUFF */
- /*
- if(!libdata) {
- uiClearButLock();
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- uiSetButLock(1, "Please leave editmode.");
- else if(cache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked");
- }
- */
- uiBlockBeginAlign ( block );
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Domain", 90, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_DOMAIN, 20.0, 1.0, "Bounding box of this object represents the computational domain of the fluid simulation." );
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Fluid", 160, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_FLUID, 20.0, 2.0, "Object represents a volume of fluid in the simulation." );
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Obstacle", 230, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OBSTACLE, 20.0, 3.0, "Object is a fixed obstacle." );
- yline -= lineHeight;
-
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Inflow", 90, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_INFLOW, 20.0, 4.0, "Object adds fluid to the simulation." );
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Outflow", 142, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OUTFLOW, 20.0, 5.0, "Object removes fluid from the simulation." );
- uiDefButS ( block, ROW, B_FLUIDSIM_MAKEPART ,"Particle", 194, yline, 52,objHeight, &fss->type, 15.0, OB_FLUIDSIM_PARTICLE,20.0, 3.0, "Object is made a particle system to display particles generated by a fluidsim domain object." );
- uiDefButS ( block, ROW, B_FLUIDSIM_CHANGETYPE ,"Control", 246, yline, 54,objHeight, &fss->type, 15.0, OB_FLUIDSIM_CONTROL,20.0, 3.0, "Object is made a fluid control mesh, which influences the fluid." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
-
- /* display specific settings for each type */
- if ( fss->type == OB_FLUIDSIM_DOMAIN )
- {
- const int maxRes = 1024;
- char memString[32];
- Mesh *mesh = ob->data;
-
- // use mesh bounding box and object scaling
- // TODO fix redraw issue
- fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);
- elbeemEstimateMemreq ( fss->resolutionxyz,
- fss->bbSize[0],fss->bbSize[1],fss->bbSize[2], fss->maxRefine, memString );
-
- uiBlockBeginAlign ( block );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT, "Std", 0,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 0, 20.0, 0, "Show standard domain options." );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT, "Adv", 20,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 1, 20.0, 1, "Show advanced domain options." );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT, "Bnd", 40,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 2, 20.0, 2, "Show domain boundary options." );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT, "Par", 60,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 3, 20.0, 3, "Show particle options." );
- uiBlockEndAlign ( block );
-
- uiDefBut ( block, BUT, B_FLUIDSIM_BAKE, "BAKE",90, yline,210,objHeight, NULL, 0.0, 0.0, 10, 0, "Perform simulation and output and surface&preview meshes for each frame." );
-
- yline -= lineHeight;
- yline -= separateHeight;
-
- if ( fss->show_advancedoptions == 1 )
- {
- // advanced options
- uiDefBut ( block, LABEL, 0, "Gravity:", 0, yline, 120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "X:", 120, yline, 60,objHeight, &fss->gravx, -1000.1, 1000.1, 10, 0, "Gravity in X direction" );
- uiDefButF ( block, NUM, B_DIFF, "Y:", 180, yline, 60,objHeight, &fss->gravy, -1000.1, 1000.1, 10, 0, "Gravity in Y direction" );
- uiDefButF ( block, NUM, B_DIFF, "Z:", 240, yline, 60,objHeight, &fss->gravz, -1000.1, 1000.1, 10, 0, "Gravity in Z direction" );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- /* viscosity */
- if ( fss->viscosityMode==1 ) /*manual*/
- uiBlockBeginAlign ( block );
- uiDefButS ( block, MENU, REDRAWVIEW3D, "Viscosity%t|Manual %x1|Water %x2|Oil %x3|Honey %x4",
- 0,yline, 90,objHeight, &fss->viscosityMode, 0, 0, 0, 0, "Set viscosity of the fluid to a preset value, or use manual input." );
- if ( fss->viscosityMode==1 )
- {
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "Value:", 120, yline, 90,objHeight, &fss->viscosityValue, 0.0, 10.0, 10, 0, "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)." );
- uiDefButS ( block, NUM, B_DIFF, "Neg-Exp.:", 210, yline, 90,objHeight, &fss->viscosityExponent, 0, 10, 10, 0, "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6." );
- uiBlockEndAlign ( block );
- }
- else
- {
- // display preset values
- uiDefBut ( block, LABEL, 0, fluidsimViscosityPresetString[fss->viscosityMode], 120,yline,180,objHeight, NULL, 0.0, 0, 0, 0, "" );
- }
-
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Realworld-size:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->realsize, 0.001, 10.0, 10, 0, "Size of the simulation domain in meters." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Gridlevels:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButI ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->maxRefine, -1, 4, 10, 0, "Number of coarsened Grids to use (set to -1 for automatic selection)." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Compressibility:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->gstar, 0.001, 0.10, 10,0, "Allowed compressibility due to gravitational force for standing fluid (directly affects simulation step size)." );
- yline -= lineHeight;
-
- }
- else if ( fss->show_advancedoptions == 2 )
- {
- // copied from obstacle...
- //yline -= lineHeight + 5;
- //uiDefBut(block, LABEL, 0, "Domain boundary type settings:", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, "");
- //yline -= lineHeight;
-
- uiDefBut ( block, LABEL, 0, "Boundary type:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block ); // domain
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Noslip", 120, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_NOSLIP, 20.0, 1.0, "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects." );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Part", 180, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_PARTSLIP, 20.0, 2.0, "Mix between no-slip and free-slip. Non moving objects only!" );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Free", 240, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_FREESLIP, 20.0, 3.0, "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!" );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "PartSlip Amount:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- if ( fss->typeFlags&OB_FSBND_PARTSLIP )
- {
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->partSlipValue, 0.0, 1.0, 10,0, "Amount of mixing between no- and free-slip, 0=stickier, 1=same as free slip." );
- }
- else
- {
- uiDefBut ( block, LABEL, 0, "-", 120,yline,180,objHeight, NULL, 0.0, 0, 0, 0, "" );
- }
-
- yline -= lineHeight;
- yline -= separateHeight;
-
- // copied from obstacle...
-
- uiDefBut ( block, LABEL, 0, "Surface Subdiv:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButI ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->surfaceSubdivs, 0.0, 5.0, 10,0, "Number of isosurface subdivisions. This is necessary for the inclusion of particles into the surface generation. Warning - can lead to longer computation times!" );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Surface Smoothing:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->surfaceSmoothing, 0.0, 5.0, 10,0, "Amount of surface smoothing (0=off, 1=normal, >1=stronger smoothing)." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- // use new variable...
- uiDefBut ( block, LABEL, 0, "Generate SpeedVecs:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitC ( block, TOG, 1, REDRAWBUTSOBJECT, "Disable", 120, yline,180,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Default is to generate and use fluidsim vertex speed vectors, this option switches calculation off during bake, and disables loading." );
- yline -= lineHeight;
- }
- else if ( fss->show_advancedoptions == 3 )
- {
- uiDefBut ( block, LABEL, 0, "Tracer Particles:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButI ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->generateTracers, 0.0, 10000.0, 10,0, "Number of tracer particles to generate." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Generate Particles:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->generateParticles, 0.0, 10.0, 10,0, "Amount of particles to generate (0=off, 1=normal, >1=more)." );
- yline -= lineHeight;
- }
- else
- {
- uiDefBut ( block, LABEL, 0, "Req. BAKE Mem.:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefBut ( block, LABEL, 0, memString, 120,yline,180,objHeight, NULL, 0.0, 0, 0, 0, "" );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Resolution:", 0,yline,90,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButS ( block, NUM, REDRAWBUTSOBJECT, "Res.:", 90, yline,105,objHeight, &fss->resolutionxyz, 1, maxRes, 10, 0, "Domain resolution in X, Y and Z direction" );
- uiDefButS ( block, NUM, B_DIFF, "Prev-Res.:", 195, yline,105,objHeight, &fss->previewresxyz, 1, 100, 10, 0, "Resolution of the preview meshes to generate, also in X, Y and Z direction" );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Time:", 0,yline,90,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "Start:", 90, yline,105,objHeight, &fss->animStart, 0.0, 100.0, 10, 0, "Simulation time of the first blender frame." );
- uiDefButF ( block, NUM, B_DIFF, "End:", 195, yline,105,objHeight, &fss->animEnd, 0.0, 100.0, 10, 0, "Simulation time of the last blender frame." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- if ( ( fss->guiDisplayMode<1 ) || ( fss->guiDisplayMode>3 ) ) { fss->guiDisplayMode=2; } // can be changed by particle setting
- uiDefBut ( block, LABEL, 0, "Disp.-Qual.:", 0,yline, 90,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButS ( block, MENU, B_BAKE_CACHE_CHANGE, "GuiDisplayMode%t|Geometry %x1|Preview %x2|Final %x3",
- 90,yline,105,objHeight, &fss->guiDisplayMode, 0, 0, 0, 0, "How to display the fluid mesh in the Blender GUI." );
- uiDefButS ( block, MENU, B_DIFF, "RenderDisplayMode%t|Geometry %x1|Preview %x2|Final %x3",
- 195,yline,105,objHeight, &fss->renderDisplayMode, 0, 0, 0, 0, "How to display the fluid mesh for rendering." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Reverse:", 0,yline,90,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitI ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Enable", 90, yline,210,objHeight, &fss->flag, 0, 0, 0, 0, "Reverse fluid frames." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Path:", 0,yline,90,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefIconBut ( block, BUT, B_FLUIDSIM_SELDIR, ICON_FILESEL, 90, yline, 20, objHeight, 0, 0, 0, 0, 0, "Select Directory (and/or filename prefix) to store baked fluid simulation files in" );
- uiDefBut ( block, TEX, B_BAKE_CACHE_CHANGE,"", 110, yline, 190, objHeight, fss->surfdataPath, 0.0,79.0, 0, 0, "Enter Directory (and/or filename prefix) to store baked fluid simulation files in" );
- yline -= lineHeight + 2;
- // FIXME what is the 79.0 above?
- }
- }
- else if (
- ( fss->type == OB_FLUIDSIM_FLUID )
- || ( fss->type == OB_FLUIDSIM_INFLOW )
- )
- {
- yline -=lineHeight - 10;
- uiDefBut ( block, LABEL, 0, "Volume init:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block ); // fluid
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Volume", 120, yline,60,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Shell", 180, yline,60,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Both", 240, yline,60,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- if ( fss->type == OB_FLUIDSIM_FLUID ) uiDefBut ( block, LABEL, 0, "Initial velocity:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- if ( fss->type == OB_FLUIDSIM_INFLOW ) uiDefBut ( block, LABEL, 0, "Inflow velocity:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- //yline -= lineHeight;
-
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "X:", 120, yline, 60,objHeight, &fss->iniVelx, -1000.1, 1000.1, 10, 0, "Fluid velocity in X direction" );
- uiDefButF ( block, NUM, B_DIFF, "Y:", 180, yline, 60,objHeight, &fss->iniVely, -1000.1, 1000.1, 10, 0, "Fluid velocity in Y direction" );
- uiDefButF ( block, NUM, B_DIFF, "Z:", 240, yline, 60,objHeight, &fss->iniVelz, -1000.1, 1000.1, 10, 0, "Fluid velocity in Z direction" );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- if ( fss->type == OB_FLUIDSIM_INFLOW ) // inflow
- {
- uiDefBut ( block, LABEL, 0, "Local Coords:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitS ( block, TOG, OB_FSINFLOW_LOCALCOORD, REDRAWBUTSOBJECT, "Enable", 120, yline,180,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Use local coordinates for inflow (e.g. for rotating objects)." );
- yline -= lineHeight;
- yline -= separateHeight;
- }
- else
- {
- }
-
- // domainNovecgen "misused" here
- uiDefBut ( block, LABEL, 0, "Animated Mesh:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitC ( block, TOG, 1, REDRAWBUTSOBJECT, "Export", 120, yline,180,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it." );
- yline -= lineHeight;
-
- } // fluid inflow
- else if ( ( fss->type == OB_FLUIDSIM_OUTFLOW ) )
- {
- yline -= lineHeight - 10;
- uiDefBut ( block, LABEL, 0, "Volumen init:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block ); // outflow
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Volume", 120, yline,60,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Shell", 180, yline,60,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Both", 240, yline,60,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- // domainNovecgen "misused" here
- uiDefBut ( block, LABEL, 0, "Animated Mesh:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitC ( block, TOG, 1, REDRAWBUTSOBJECT, "Export", 120, yline,180,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it." );
- yline -= lineHeight;
-
- //uiDefBut(block, LABEL, 0, "No additional settings as of now...", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, "");
- }
- else if ( ( fss->type == OB_FLUIDSIM_OBSTACLE ) )
- {
-
- yline -= lineHeight - 10; // obstacle
- uiDefBut ( block, LABEL, 0, "Volume init:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block ); // obstacle
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Volume", 120, yline,60,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Shell", 180, yline,60,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh." );
- uiDefButC ( block, ROW, REDRAWBUTSOBJECT ,"Both", 240, yline,60,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Boundary type:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block ); // obstacle
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Noslip", 120, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_NOSLIP, 20.0, 1.0, "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects." );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Part", 180, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_PARTSLIP, 20.0, 2.0, "Mix between no-slip and free-slip. Non moving objects only!" );
- uiDefButS ( block, ROW, REDRAWBUTSOBJECT ,"Free", 240, yline,60,objHeight, &fss->typeFlags, 15.0, OB_FSBND_FREESLIP, 20.0, 3.0, "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!" );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- // domainNovecgen "misused" here
- uiDefBut ( block, LABEL, 0, "Animated Mesh:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitC ( block, TOG, 1, REDRAWBUTSOBJECT, "Export", 120, yline,180,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated loc/rot/scale IPOs do not require it." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "PartSlip Amount:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- if ( fss->typeFlags&OB_FSBND_PARTSLIP )
- {
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->partSlipValue, 0.0, 1.0, 10,0, "Amount of mixing between no- and free-slip, 0=stickier, 1=same as free slip." );
- }
- else { uiDefBut ( block, LABEL, 0, "-", 120,yline,180,objHeight, NULL, 0.0, 0, 0, 0, "" ); }
- yline -= lineHeight;
- yline -= separateHeight;
-
- // generateParticles "misused" here
- uiDefBut ( block, LABEL, 0, "Impact Factor:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->surfaceSmoothing, -2.0, 10.0, 10,0, "This is an unphysical value for moving objects - it controls the impact an obstacle has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, while >1 results in high forces. Can be used to tweak total mass." );
- yline -= lineHeight;
-
- }
- else if ( fss->type == OB_FLUIDSIM_PARTICLE )
- {
-
- //fss->type == 0; // off, broken...
- if ( 1 )
- {
- // limited selection, old fixed: fss->typeFlags = (1<<5)|(1<<1);
- # define PARTBUT_WIDTH (180/3)
- yline -=lineHeight - 10;
- uiDefBut ( block, LABEL, 0, "Particle type:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButBitS ( block, TOG, ( 1<<2 ) , REDRAWBUTSOBJECT, "Drops", 120 + 0*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show drop particles." );
- uiDefButBitS ( block, TOG, ( 1<<4 ) , REDRAWBUTSOBJECT, "Floats", 120 + 1*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show floating foam particles." );
- uiDefButBitS ( block, TOG, ( 1<<5 ) , REDRAWBUTSOBJECT, "Tracer", 120 + 2*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show tracer particles." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
- # undef PARTBUT_WIDTH
-
-
- uiDefBut ( block, LABEL, 0, "Size Influence:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->particleInfSize, 0.0, 2.0, 10,0, "Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Alpha Influence:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->particleInfAlpha, 0.0, 2.0, 10,0, "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- // FSPARTICLE also select input files
- uiDefBut ( block, LABEL, 0, "Path:", 0,yline,120,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefIconBut ( block, BUT, B_FLUIDSIM_SELDIR, ICON_FILESEL, 120, yline, 20, objHeight, 0, 0, 0, 0, 0, "Select fluid simulation bake directory/prefix to load particles from, same as for domain object." );
- uiDefBut ( block, TEX, B_BAKE_CACHE_CHANGE,"", 140, yline, 160, objHeight, fss->surfdataPath, 0.0,79.0, 0, 0, "Enter fluid simulation bake directory/prefix to load particles from, same as for domain object." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- } // disabled for now...
-
- }
- else if ( fss->type == OB_FLUIDSIM_CONTROL )
- {
- yline -=lineHeight - 10;
- uiDefBut ( block, LABEL, 0, "Time:", 0,yline,100,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "Start:", 120, yline,90,objHeight, &fss->cpsTimeStart, 0.0, 100.0, 10, 0, "Specifies time when the control particles are activated." );
- uiDefButF ( block, NUM, B_DIFF, "End:", 210, yline,90,objHeight, &fss->cpsTimeEnd , 0.0, 100.0, 10, 0, "Specifies time when the control particles are deactivated." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Attraction force:", 0,yline,100,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "Strength:", 120, yline,90,objHeight, &fss->attractforceStrength, -10.0, 10.0, 10, 0, "Force strength for directional attraction towards the control object." );
- uiDefButF ( block, NUM, B_DIFF, "Radius:", 210, yline,90,objHeight, &fss->attractforceRadius, 0.0, 10.0, 10, 0, "Specifies the force field radius around the control object." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Velocity force:", 0,yline,100,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiBlockBeginAlign ( block );
- uiDefButF ( block, NUM, B_DIFF, "Strength:", 120, yline,90,objHeight, &fss->velocityforceStrength, 0.0, 10.0, 10, 0, "Force strength of how much of the control object's velocity is influencing the fluid velocity." );
- uiDefButF ( block, NUM, B_DIFF, "Radius:", 210, yline,90,objHeight, &fss->velocityforceRadius, 0.0, 10.0, 10, 0, "Specifies the force field radius around the control object." );
- uiBlockEndAlign ( block );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Quality:", 0,yline,100,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButF ( block, NUM, B_DIFF, "", 120, yline,180,objHeight, &fss->cpsQuality, 5.0, 100.0, 10, 0, "Specifies the quality which is used for object sampling (higher = better but slower)." );
- yline -= lineHeight;
- yline -= separateHeight;
-
- uiDefBut ( block, LABEL, 0, "Reverse:", 0,yline,100,objHeight, NULL, 0.0, 0, 0, 0, "" );
- uiDefButBitI ( block, TOG, OB_FLUIDSIM_REVERSE, REDRAWBUTSOBJECT, "Enable", 120, yline,180,objHeight, &fss->flag, 0, 0, 0, 0, "Reverse control object movement." );
- yline -= lineHeight;
-
-
- }
- else
- {
- yline -= lineHeight + 5;
- /* not yet set */
- uiDefBut ( block, LABEL, 0, "Select object type for simulation", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, "" );
- yline -= lineHeight;
- }
- return;
- }
-
-#endif // DISABLE_ELBEEM
-}
-
-/* Panel for cloth */
-static void object_cloth__enabletoggle(void *ob_v, void *arg2)
-{
- Object *ob = ob_v;
- ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
-
- if (!md) {
- md = modifier_new(eModifierType_Cloth);
- BLI_addtail(&ob->modifiers, md);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else {
- Object *ob = ob_v;
- ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
-
- if (!md)
- return;
-
- BLI_remlink(&ob->modifiers, md);
-
- modifier_free(md);
-
- BIF_undo_push("Del modifier");
-
- //ob->softflag |= OB_SB_RESET;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWOOPS, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- object_handle_update(ob);
- countall();
- }
-}
-
-static void cloth_presets_material(void *ob_v, void *arg2)
-{
- Object *ob = ob_v;
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(!clmd) return;
- if(clmd->sim_parms->presets==0) return;
-
- if(clmd->sim_parms->presets==1) /* SILK */
- {
- clmd->sim_parms->structural = clmd->sim_parms->shear = 5.0;
- clmd->sim_parms->bending = 0.05;
- clmd->sim_parms->Cdis = 0.0;
- clmd->sim_parms->mass = 0.15;
- }
- else if(clmd->sim_parms->presets==2) /* COTTON */
- {
- clmd->sim_parms->structural = clmd->sim_parms->shear = 15.0;
- clmd->sim_parms->bending = 0.5;
- clmd->sim_parms->Cdis = 5.0;
- clmd->sim_parms->mass = 0.3;
- }
- else if(clmd->sim_parms->presets==3) /* RUBBER */
- {
- clmd->sim_parms->structural = clmd->sim_parms->shear = 15.0;
- clmd->sim_parms->bending = 25.0;
- clmd->sim_parms->Cdis = 25.0;
- clmd->sim_parms->stepsPerFrame = MAX2(clmd->sim_parms->stepsPerFrame, 7.0);
- clmd->sim_parms->mass = 3.0;
- }
- else if(clmd->sim_parms->presets==4) /* DENIM */
- {
- clmd->sim_parms->structural = clmd->sim_parms->shear = 40.0;
- clmd->sim_parms->bending = 10.0;
- clmd->sim_parms->Cdis = 25.0;
- clmd->sim_parms->stepsPerFrame = MAX2(clmd->sim_parms->stepsPerFrame, 12.0);
- clmd->sim_parms->mass = 1.0;
- }
- else if(clmd->sim_parms->presets==5) /* LEATHER */
- {
- clmd->sim_parms->structural = clmd->sim_parms->shear = 80.0;
- clmd->sim_parms->bending = 150.0;
- clmd->sim_parms->Cdis = 25.0;
- clmd->sim_parms->stepsPerFrame = MAX2(clmd->sim_parms->stepsPerFrame, 15.0);
- clmd->sim_parms->mass = 0.4;
- }
-}
-
-static void cloth_presets_custom_material(void *ob_v, void *arg2)
-{
- Object *ob = ob_v;
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(!clmd) return;
-
- clmd->sim_parms->presets = 0;
-}
-
-static int _can_cloth_at_all(Object *ob)
-{
- // list of Yes
- if ((ob->type==OB_MESH)) return 1;
- // else deny
- return 0;
-}
-
-static void object_panel_cloth(Object *ob)
-{
- uiBlock *block=NULL;
- uiBut *but=NULL;
- static int val, val2;
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
- PointCache *cache;
- ModifierData *md;
- int libdata = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "object_cloth", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Cloth ", "Physics", 640, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- val = (clmd ? 1:0);
-
- if(!_can_cloth_at_all(ob))
- {
- uiDefBut(block, LABEL, 0, "Cloth can be activated on mesh only.", 10,200,300,20, NULL, 0.0, 0, 0, 0, "");
- }
- else
- {
- but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Cloth", 10,200,130,20, &val, 0, 0, 0, 0, "Sets object to become cloth");
- uiButSetFunc(but, object_cloth__enabletoggle, ob, NULL);
-
- md = (ModifierData*)clmd;
- if(md) {
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_BAKE_CACHE_CHANGE, ICON_SCENE, 145, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable cloth during rendering");
- but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_BAKE_CACHE_CHANGE, VICON_VIEW3D, 165, 200, 20, 20,&md->mode, 0, 0, 1, 0, "Enable cloth during interactive display");
- uiBlockEndAlign(block);
- }
- }
-
- uiDefBut(block, LABEL, 0, "",10,10,300,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/
-
- if(clmd)
- {
- int defCount;
- char *clvg1, *clvg2;
- char clmvg [] = "Vertex Groups%t|";
-
- val2=0;
- cache= clmd->point_cache;
-
- /* GENERAL STUFF */
- if(!libdata) {
- uiClearButLock();
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- uiSetButLock(1, "Please leave editmode.");
- else if(cache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked");
- }
-
- uiDefBut(block, LABEL, 0, "Material Preset:", 10,170,150,20, NULL, 0.0, 0, 0, 0, "");
- but=uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, "Silk %x1|Cotton %x2|Rubber %x3|Denim %x4|Leather %x5|Custom %x0",
- 160,170,150,20, &clmd->sim_parms->presets, 0, 0, 0, 0, "");
- uiButSetFunc(but, cloth_presets_material, ob, NULL);
-
- uiBlockBeginAlign(block);
- but = uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "StructStiff:", 10,150,150,20, &clmd->sim_parms->structural, 1.0, 10000.0, 100, 0, "Overall stiffness of structure");
- uiButSetFunc(but, cloth_presets_custom_material, ob, NULL);
-
- but = uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "BendStiff:", 160,150,150,20, &clmd->sim_parms->bending, 0.0, 10000.0, 1000, 0, "Wrinkle coefficient (higher = less smaller but more big wrinkles)");
- uiButSetFunc(but, cloth_presets_custom_material, ob, NULL);
-
- but = uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Spring Damp:", 10,130,150,20, &clmd->sim_parms->Cdis, 0.0, 50.0, 100, 0, "Damping of cloth velocity (higher = more smooth, less jiggling)");
- uiButSetFunc(but, cloth_presets_custom_material, ob, NULL);
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Air Damp:", 160,130,150,20, &clmd->sim_parms->Cvi, 0.0, 10.0, 10, 0, "Air has normaly some thickness which slows falling things down");
-
- uiDefButI(block, NUM, B_BAKE_CACHE_CHANGE, "Quality:", 10,110,150,20, &clmd->sim_parms->stepsPerFrame, 4.0, 80.0, 5, 0, "Quality of the simulation (higher=better=slower)");
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Mass:", 160,110,150,20, &clmd->sim_parms->mass, 0.0, 10.0, 1000, 0, "Mass of cloth material.");
-
- uiDefBut(block, LABEL, 0, "Gravity:", 10,90,60,20, NULL, 0.0, 0, 0, 0, "");
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "X:", 70,90,80,20, &clmd->sim_parms->gravity[0], -100.0, 100.0, 10, 0, "Apply gravitation to point movement");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Y:", 150,90,80,20, &clmd->sim_parms->gravity[1], -100.0, 100.0, 10, 0, "Apply gravitation to point movement");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Z:", 230,90,80,20, &clmd->sim_parms->gravity[2], -100.0, 100.0, 10, 0, "Apply gravitation to point movement");
- uiBlockEndAlign(block);
-
- /* GOAL STUFF */
- uiBlockBeginAlign(block);
-
-
- uiDefButBitI(block, TOG, CLOTH_SIMSETTINGS_FLAG_GOAL, B_BAKE_CACHE_CHANGE, "Pinning of cloth", 10,60,150,20, &clmd->sim_parms->flags, 0, 0, 0, 0, "Define forces for vertices to stick to animated position");
-
- if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (BLI_countlist (&ob->defbase) > 0))
- {
- if(ob->type==OB_MESH)
- {
-
- defCount = sizeof (clmvg);
- clvg1 = get_vertexgroup_menustr (ob);
- clvg2 = MEM_callocN (strlen (clvg1) + 1 + defCount, "clothVgMS");
- if (! clvg2) {
- printf ("draw_modifier: error allocating memory for cloth vertex group menu string.\n");
- return;
- }
- defCount = BLI_countlist (&ob->defbase);
- if (defCount == 0)
- {
- clmd->sim_parms->vgroup_mass = 0;
- }
- else
- {
- if(!clmd->sim_parms->vgroup_mass)
- clmd->sim_parms->vgroup_mass = 1;
- else if(clmd->sim_parms->vgroup_mass > defCount)
- clmd->sim_parms->vgroup_mass = defCount;
- }
-
- sprintf (clvg2, "%s%s", clmvg, clvg1);
-
- uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, clvg2, 160,60,150,20, &clmd->sim_parms->vgroup_mass, 0, defCount, 0, 0, "Browses available vertex groups");
- MEM_freeN (clvg1);
- MEM_freeN (clvg2);
- }
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Pin Stiff:", 10,40,150,20, &clmd->sim_parms->goalspring, 0.0, 50.0, 50, 0, "Pin (vertex target position) spring stiffness");
- uiDefBut(block, LABEL, 0, "",160,40,150,20, NULL, 0.0, 0, 0, 0, "");
- // uiDefButI(block, NUM, B_BAKE_CACHE_CHANGE, "Pin Damp:", 160,50,150,20, &clmd->sim_parms->goalfrict, 1.0, 100.0, 10, 0, "Pined damping (higher = doesn't oszilate so much)");
- /*
- // nobody is changing these ones anyway
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Min:", 10,30,150,20, &clmd->sim_parms->mingoal, 0.0, 1.0, 10, 0, "Goal minimum, vertex group weights are scaled to match this range");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "G Max:", 160,30,150,20, &clmd->sim_parms->maxgoal, 0.0, 1.0, 10, 0, "Goal maximum, vertex group weights are scaled to match this range");
- */
- }
- else if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
- {
- uiDefBut(block, LABEL, 0, " ", 160,60,150,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "No vertex group for pinning available.", 10,30,300,20, NULL, 0.0, 0, 0, 0, "");
- }
-
- uiBlockEndAlign(block);
-
- /*
- // no tearing supported anymore since modifier stack restrictions
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, CSIMSETT_FLAG_TEARING_ENABLED, B_EFFECT_DEP, "Tearing", 10,0,150,20, &clmd->sim_parms->flags, 0, 0, 0, 0, "Sets object to become a cloth collision object");
-
- if (clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)
- {
- uiDefButI(block, NUM, B_DIFF, "Max extent:", 160,0,150,20, &clmd->sim_parms->maxspringlen, 1.0, 1000.0, 10, 0, "Maximum extension before spring gets cut");
- }
-
- uiBlockEndAlign(block);
- */
- }
-
- uiBlockEndAlign(block);
-
- uiBlockEndAlign(block);
-}
-
-static void object_panel_cloth_II(Object *ob)
-{
- uiBlock *block;
- ClothModifierData *clmd = NULL;
- PointCache *cache;
- static PTCacheID staticpid;
- int libdata;
-
- block= uiNewBlock(&curarea->uiblocks, "object_cloth_II", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Cloth ", "Physics");
- if(uiNewPanel(curarea, block, "Cloth Collision", "Physics", 651, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(clmd)
- {
- BKE_ptcache_id_from_cloth(&staticpid, ob, clmd);
- cache= staticpid.cache;
-
- if(!libdata) {
- uiClearButLock();
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- uiSetButLock(1, "Please leave editmode.");
- }
-
- object_physics_bake_buttons(block, &staticpid, 135, libdata);
-
- uiDefBut(block, LABEL, 0, "",10,140,300,20, NULL, 0.0, 0, 0, 0, "");
-
- if(!libdata) {
- if(!(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE))
- if(cache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked");
- }
-
- /*
- TODO: implement this again in cloth!
- if(length>1) // B_CLOTH_CHANGEPREROLL
- uiDefButI(block, NUM, B_CLOTH_CHANGEPREROLL, "Preroll:", 10,80,145,20, &clmd->sim_parms->preroll, 0, length-1, 1, 0, "Simulation starts on this frame");
- else
- uiDefBut(block, LABEL, 0, " ", 10,80,145,20, NULL, 0.0, 0, 0, 0, "");
- */
-#ifdef WITH_BULLET
- uiDefButBitI(block, TOG, CLOTH_COLLSETTINGS_FLAG_ENABLED, B_BAKE_CACHE_CHANGE, "Enable collisions", 10,60,150,20, &clmd->coll_parms->flags, 0, 0, 0, 0, "Enable collisions with this object");
- if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED)
- {
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Min Distance:", 160,60,150,20, &clmd->coll_parms->epsilon, 0.001f, 1.0, 0.01f, 0, "Minimum distance between collision objects before collision response takes in, can be changed for each frame");
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Collision Quality:", 10,40,150,20, &clmd->coll_parms->loop_count, 1.0, 20.0, 1.0, 0, "How many collision iterations should be done. (higher = better = slower)");
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Friction:", 160,40,150,20, &clmd->coll_parms->friction, 0.0, 80.0, 1.0, 0, "Friction force if a collision happened (0=movement not changed, 100=no movement left)");
-
- uiDefButBitI(block, TOG, CLOTH_COLLSETTINGS_FLAG_SELF, B_BAKE_CACHE_CHANGE, "Enable selfcollisions", 10,20,150,20, &clmd->coll_parms->flags, 0, 0, 0, 0, "Enable selfcollisions with this object");
- if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF)
- {
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Min Distance:", 160,20,150,20, &clmd->coll_parms->selfepsilon, 0.5f, 1.0, 0.01f, 0, "0.5 means no distance at all, 1.0 is maximum distance");
- // self_loop_count
- uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Selfcoll Quality:", 10,0,150,20, &clmd->coll_parms->self_loop_count, 1.0, 10.0, 1.0, 0, "How many selfcollision iterations should be done. (higher = better = slower), can be changed for each frame");
- }
- else
- uiDefBut(block, LABEL, 0, "",160,20,150,20, NULL, 0.0, 0, 0, 0, "");
- }
- else
- uiDefBut(block, LABEL, 0, "",160,60,150,20, NULL, 0.0, 0, 0, 0, "");
-#else
- uiDefBut(block, LABEL, 0, "No collisions available (compile with bullet).",10,60,300,20, NULL, 0.0, 0, 0, 0, "");
-#endif
- }
-
- uiBlockEndAlign(block);
-
-}
-
-static void object_panel_cloth_III(Object *ob)
-{
- uiBlock *block;
- ClothModifierData *clmd = NULL;
- PointCache *cache;
- int libdata;
-
- block= uiNewBlock(&curarea->uiblocks, "object_cloth_III", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Cloth ", "Physics");
- if(uiNewPanel(curarea, block, "Cloth Advanced", "Physics", 651, 0, 318, 204)==0) return;
-
- libdata= object_is_libdata(ob);
- uiSetButLock(libdata, ERROR_LIBDATA_MESSAGE);
-
- clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(clmd)
- {
- int defCount;
- char *clvg1, *clvg2;
- char clmvg [] = "Vertex Groups%t|None%x0|";
- char clmvg2 [] = "Vertex Groups%t|None%x0|";
-
- cache= clmd->point_cache;
-
- if(!libdata) {
- uiClearButLock();
- if(cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)
- uiSetButLock(1, "Please leave editmode.");
- else if(cache->flag & PTCACHE_BAKED)
- uiSetButLock(1, "Simulation frames are baked");
- }
-
- uiDefButBitI(block, TOG, CLOTH_SIMSETTINGS_FLAG_SCALING, B_BAKE_CACHE_CHANGE, "Enable stiffness scaling",10,130,300,20, &clmd->sim_parms->flags, 0, 0, 0, 0, "If enabled, stiffness can be scaled along a weight painted vertex group.");
-
- if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING)&& (BLI_countlist (&ob->defbase) > 0))
- {
- uiDefBut(block, LABEL, 0, "StructStiff VGroup:",10,110,150,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "BendStiff VGroup:",160,110,150,20, NULL, 0.0, 0, 0, 0, "");
-
- defCount = sizeof (clmvg);
- clvg1 = get_vertexgroup_menustr (ob);
- clvg2 = MEM_callocN (strlen (clvg1) + 1 + defCount, "clothVgST");
- if (! clvg2) {
- printf ("draw_modifier: error allocating memory for cloth vertex group menu string.\n");
- return;
- }
- defCount = BLI_countlist (&ob->defbase);
- if (defCount == 0)
- {
- clmd->sim_parms->vgroup_struct = 0;
- }
- else
- {
- if(clmd->sim_parms->vgroup_struct > defCount)
- clmd->sim_parms->vgroup_struct = 0;
- }
-
- sprintf (clvg2, "%s%s", clmvg, clvg1);
-
- uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, clvg2, 10,90,150,20, &clmd->sim_parms->vgroup_struct, 0, defCount, 0, 0, "Browses available vertex groups");
- MEM_freeN (clvg1);
- MEM_freeN (clvg2);
-
- defCount = sizeof (clmvg);
- clvg1 = get_vertexgroup_menustr (ob);
- clvg2 = MEM_callocN (strlen (clvg1) + 1 + defCount, "clothVgBD");
- if (! clvg2) {
- printf ("draw_modifier: error allocating memory for cloth vertex group menu string.\n");
- return;
- }
- defCount = BLI_countlist (&ob->defbase);
- if (defCount == 0)
- {
- clmd->sim_parms->vgroup_bend = 0;
- }
- else
- {
- if(clmd->sim_parms->vgroup_bend > defCount)
- clmd->sim_parms->vgroup_bend = 0;
- }
-
- sprintf (clvg2, "%s%s", clmvg2, clvg1);
-
- uiDefButS(block, MENU, B_BAKE_CACHE_CHANGE, clvg2, 160,90,150,20, &clmd->sim_parms->vgroup_bend, 0, defCount, 0, 0, "Browses available vertex groups");
- MEM_freeN (clvg1);
- MEM_freeN (clvg2);
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "StructStiff Max:",10,70,150,20, &clmd->sim_parms->max_struct, clmd->sim_parms->structural, 10000.0, 0.01f, 0, "Maximum structural stiffness value");
-
- uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "BendStiff Max:",160,70,150,20, &clmd->sim_parms->max_bend, clmd->sim_parms->bending, 10000.0, 0.01f, 0, "Maximum bending stiffness value");
-
- }
- else if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING)
- {
- uiDefBut(block, LABEL, 0, " ", 10,110,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "No vertex group for stiffness scaling available.", 10,90,300,20, NULL, 0.0, 0, 0, 0, "");
- }
-
-
-
- }
-
- uiBlockEndAlign(block);
-
-}
-
-void object_panels()
-{
- Object *ob;
-
- /* check context here */
- ob= OBACT;
- if(ob) {
- object_panel_object(ob);
- object_panel_anim(ob);
- object_panel_draw(ob);
- object_panel_constraint("Object");
-
- uiClearButLock();
- }
-}
-
-void physics_panels()
-{
- Object *ob;
-
- /* check context here */
- ob= OBACT;
- if(ob) {
- object_panel_fields(ob);
- if(ob->type==OB_MESH)
- object_panel_collision(ob);
- object_softbodies(ob);
- object_softbodies_collision(ob);
- object_softbodies_solver(ob);
- object_panel_cloth(ob);
- object_panel_cloth_II(ob);
- object_panel_cloth_III(ob);
- object_panel_fluidsim(ob);
- }
-}
-void particle_panels()
-{
- Object *ob;
- ParticleSystem *psys;
-
- ob=OBACT;
-
- if(ob && ob->type==OB_MESH) {
- object_panel_particle_system(ob);
-
- psys=psys_get_current(ob);
-
- if(psys ){
- object_panel_particle_bake(ob);
- object_panel_particle_physics(ob);
- object_panel_particle_visual(ob);
- object_panel_particle_simplification(ob);
- object_panel_particle_extra(ob);
- object_panel_particle_children(ob);
- }
- }
-}
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
deleted file mode 100644
index 74725b99fea..00000000000
--- a/source/blender/src/buttons_scene.c
+++ /dev/null
@@ -1,3546 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-#include "BLO_sys_types.h" // for intptr_t support
-#include "DNA_node_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_packedFile_types.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_library.h"
-#include "BKE_scene.h"
-#include "BKE_sound.h"
-#include "BKE_packedFile.h"
-#include "BKE_utildefines.h"
-#include "BKE_idprop.h"
-
-#include "BLI_blenlib.h"
-
-#include "BSE_filesel.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_imasel.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_mywindow.h"
-#include "BIF_meshtools.h"
-#include "BIF_resources.h"
-#include "BIF_renderwin.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_editseq.h"
-
-#include "BIF_butspace.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-/* -----includes for this file specific----- */
-
-#include "DNA_image_types.h"
-
-#include "BKE_writeavi.h"
-#include "BKE_writeffmpeg.h"
-#include "BKE_image.h"
-#include "BKE_plugin_types.h"
-
-#include "BLI_threads.h"
-
-#include "BIF_editsound.h"
-#include "BIF_writeimage.h"
-#include "BIF_writeavicodec.h"
-
-#include "BSE_headerbuttons.h"
-#include "BSE_sequence.h"
-#include "BSE_seqeffects.h"
-#include "BSE_seqscopes.h"
-#include "BSE_seqaudio.h"
-
-#include "RE_pipeline.h"
-
-#include "butspace.h" // own module
-
-#ifdef WITH_QUICKTIME
-#include "quicktime_export.h"
-#endif
-
-#ifdef WITH_FFMPEG
-
-#include <ffmpeg/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/opt.h>
-
-static int ffmpeg_preset_sel = 0;
-
-extern int is_container(int);
-
-extern void makeffmpegstring(char* string);
-
-#endif
-
-/* here the calls for scene buttons
- - render
- - world
- - anim settings, audio
-*/
-
-/* prototypes */
-void playback_anim(void);
-
-/* ************************ SOUND *************************** */
-static void load_new_sample(char *str) /* called from fileselect */
-{
- char name[FILE_MAX];
- bSound *sound;
- bSample *sample, *newsample;
-
- sound = G.buts->lockpoin;
-
- /* No Sound or Selected the same sample as we alredy have, just ignore */
- if (sound==NULL || str==sound->name)
- return;
-
- if (sizeof(sound->sample->name) < strlen(str)) {
- error("Path too long: %s", str);
- return;
- }
-
- // save values
- sample = sound->sample;
- strcpy(name, sound->sample->name);
- strcpy(sound->name, str);
- sound_set_sample(sound, NULL);
- sound_initialize_sample(sound);
-
- if (sound->sample->type == SAMPLE_INVALID) {
- error("Not a valid sample: %s", str);
-
- newsample = sound->sample;
-
- // restore values
- strcpy(sound->name, name);
- sound_set_sample(sound, sample);
-
- // remove invalid sample
-
- sound_free_sample(newsample);
- BLI_remlink(samples, newsample);
- MEM_freeN(newsample);
- return;
- }
-
- BIF_undo_push("Load new audio file");
- allqueue(REDRAWBUTSSCENE, 0);
-}
-
-
-void do_soundbuts(unsigned short event)
-{
- char name[FILE_MAX];
- bSound *sound;
- bSample *sample;
- bSound* tempsound;
- ID *id;
-
- sound = G.buts->lockpoin;
-
- switch(event) {
- case B_SOUND_REDRAW:
- allqueue(REDRAWBUTSSCENE, 0);
- break;
-
- case B_SOUND_LOAD_SAMPLE:
- if (sound) strcpy(name, sound->name);
- else strcpy(name, U.sounddir);
-
- activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, load_new_sample);
- break;
-
- case B_SOUND_PLAY_SAMPLE:
- if (sound) {
- if (sound->sample->type != SAMPLE_INVALID) {
- sound_play_sound(sound);
- allqueue(REDRAWBUTSSCENE, 0);
- }
- }
- break;
-
- case B_SOUND_MENU_SAMPLE:
- if (G.buts->menunr > 0) {
- sample = BLI_findlink(samples, G.buts->menunr - 1);
- if (sample && sound && sound->sample != sample) {
- int wasrelative = (strncmp(sound->name, "//", 2)==0);
-
- BLI_strncpy(sound->name, sample->name, sizeof(sound->name));
- sound_set_sample(sound, sample);
-
- if (wasrelative)
- BLI_makestringcode(G.sce, sound->name);
-
- do_soundbuts(B_SOUND_REDRAW);
- }
- }
-
- break;
- case B_SOUND_NAME_SAMPLE:
- load_new_sample(sound->name);
- break;
-
- case B_SOUND_UNPACK_SAMPLE:
- if(sound && sound->sample) {
- sample = sound->sample;
-
- if (sample->packedfile) {
- if (G.fileflags & G_AUTOPACK) {
- if (okee("Disable AutoPack ?")) {
- G.fileflags &= ~G_AUTOPACK;
- }
- }
-
- if ((G.fileflags & G_AUTOPACK) == 0) {
- unpackSample(sample, PF_ASK);
- }
- } else {
- sound_set_packedfile(sample, newPackedFile(sample->name));
- }
- allqueue(REDRAWHEADERS, 0);
- do_soundbuts(B_SOUND_REDRAW);
- }
- break;
-
- case B_SOUND_COPY_SOUND:
- if (sound) {
- tempsound = sound_make_copy(sound);
- sound = tempsound;
- id = &sound->id;
- G.buts->lockpoin = (bSound*)id;
- BIF_undo_push("Copy sound");
- do_soundbuts(B_SOUND_REDRAW);
- }
- break;
-
- case B_SOUND_RECALC:
- waitcursor(1);
- sound = G.main->sound.first;
- while (sound) {
- free(sound->stream);
- sound->stream = 0;
- audio_makestream(sound);
- sound = (bSound *) sound->id.next;
- }
- waitcursor(0);
- allqueue(REDRAWSEQ, 0);
- break;
-
- case B_SOUND_RATECHANGED:
-
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWSEQ, 0);
- break;
-
- case B_SOUND_MIXDOWN:
- audio_mixdown();
- break;
-
- default:
- if (G.f & G_DEBUG) {
- printf("do_soundbuts: unhandled event %d\n", event);
- }
- }
-}
-
-
-static void sound_panel_listener(void)
-{
- uiBlock *block;
- int xco= 100, yco=100, mixrate;
- char mixrateinfo[256];
-
- block= uiNewBlock(&curarea->uiblocks, "sound_panel_listener", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Listener", "Sound", 320, 0, 318, 204)==0) return;
-
- mixrate = sound_get_mixrate();
- sprintf(mixrateinfo, "Game Mixrate: %d Hz", mixrate);
- uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
-
- yco -= 30;
- uiDefBut(block, LABEL, 0, "Game listener settings:",xco,yco,195,20, 0, 0, 0, 0, 0, "");
-
- yco -= 30;
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ",
- xco,yco,195,24,&G.listener->gain, 0.0, 1.0, 1.0, 0, "Sets the maximum volume for the overall sound");
-
- yco -= 30;
- uiDefBut(block, LABEL, 0, "Game Doppler effect settings:",xco,yco,195,20, 0, 0, 0, 0, 0, "");
-
- yco -= 30;
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Doppler: ",
- xco,yco,195,24,&G.listener->dopplerfactor, 0.0, 10.0, 1.0, 0, "Use this for scaling the doppler effect");
-
- yco -=30;
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Velocity: ",
- xco,yco,195,24,&G.listener->dopplervelocity,0.0,10000.0, 1.0,0, "Sets the propagation speed of sound");
-
-
-}
-
-static void sound_panel_sequencer(void)
-{
- uiBlock *block;
- short xco, yco;
- char mixrateinfo[256];
-
- block= uiNewBlock(&curarea->uiblocks, "sound_panel_sequencer", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Sequencer", "Sound", 640, 0, 318, 204)==0) return;
-
- /* audio sequence engine settings ------------------------------------------------------------------ */
-
- xco = 1010;
- yco = 195;
-
- uiDefBut(block, LABEL, 0, "Audio sequencer settings", xco,yco,295,20, 0, 0, 0, 0, 0, "");
-
- yco -= 25;
- sprintf(mixrateinfo, "Mixing/Sync (latency: %d ms)", (int)( (((float)U.mixbufsize)/(float)G.scene->audio.mixrate)*1000.0 ) );
- uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
-
- yco -= 25;
- uiDefButI(block, ROW, B_SOUND_RATECHANGED, "44.1 kHz", xco,yco,75,20, &G.scene->audio.mixrate, 2.0, 44100.0, 0, 0, "Mix at 44.1 kHz");
- uiDefButI(block, ROW, B_SOUND_RATECHANGED, "48.0 kHz", xco+80,yco,75,20, &G.scene->audio.mixrate, 2.0, 48000.0, 0, 0, "Mix at 48 kHz");
- uiDefBut(block, BUT, B_SOUND_RECALC, "Recalc", xco+160,yco,75,20, 0, 0, 0, 0, 0, "Recalculate samples");
-
- yco -= 25;
- uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync", xco,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
- uiDefButBitS(block, TOG, AUDIO_SCRUB, B_SOUND_CHANGED, "Scrub", xco+120,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Scrub when changing frames");
-
- yco -= 25;
- uiDefBut(block, LABEL, 0, "Main mix", xco,yco,295,20, 0, 0, 0, 0, 0, "");
-
- yco -= 25;
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Main (dB): ",
- xco,yco,235,24,&G.scene->audio.main, -24.0, 6.0, 0, 0, "Set the audio master gain/attenuation in dB");
-
- yco -= 25;
- uiDefButBitS(block, TOG, AUDIO_MUTE, 0, "Mute", xco,yco,235,24, &G.scene->audio.flag, 0, 0, 0, 0, "Mute audio from sequencer");
-
- yco -= 35;
- uiDefBut(block, BUT, B_SOUND_MIXDOWN, "MIXDOWN", xco,yco,235,24, 0, 0, 0, 0, 0, "Create WAV file from sequenced audio (output goes to render output dir)");
-
-}
-
-static char *make_sample_menu(void)
-{
- int len= BLI_countlist(samples); /* BKE_sound.h */
-
- if(len) {
- bSample *sample;
- char *str;
- int nr, a=0;
-
- str= MEM_callocN(32*len, "menu");
-
- for(nr=1, sample= samples->first; sample; sample= sample->id.next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", sample->id.name+2, nr);
- }
- return str;
- }
- return NULL;
-}
-
-static void sound_panel_sound(bSound *sound)
-{
- static int packdummy=0;
- ID *id, *idfrom;
- uiBlock *block;
- bSample *sample;
- char *strp, ch[256];
-
- block= uiNewBlock(&curarea->uiblocks, "sound_panel_sound", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Sound", "Sound", 0, 0, 318, 204)==0) return;
-
- uiDefBut(block, LABEL, 0, "Blender Sound block",10,180,195,20, 0, 0, 0, 0, 0, "");
-
- // warning: abuse of texnr here! (ton didnt code!)
- buttons_active_id(&id, &idfrom);
- std_libbuttons(block, 10, 160, 0, NULL, B_SOUNDBROWSE2, ID_SO, 0, id, idfrom, &(G.buts->texnr), 1, 0, 0, 0, 0);
-
- if (sound) {
-
- uiDefBut(block, BUT, B_SOUND_COPY_SOUND, "Copy sound", 220,160,90,20, 0, 0, 0, 0, 0, "Make another copy (duplicate) of the current sound");
-
- uiSetButLock(sound->id.lib!=0, ERROR_LIBDATA_MESSAGE);
- sound_initialize_sample(sound);
- sample = sound->sample;
-
- /* info string */
- if (sound->sample && sound->sample->len && sound->sample->channels && sound->sample->bits) {
- char *tmp;
- if (sound->sample->channels == 1) tmp= "Mono";
- else if (sound->sample->channels == 2) tmp= "Stereo";
- else tmp= "Unknown";
-
- sprintf(ch, "Sample: %s, %d bit, %d Hz, %d samples", tmp, sound->sample->bits, sound->sample->rate, (sound->sample->len/(sound->sample->bits/8)/sound->sample->channels));
- uiDefBut(block, LABEL, 0, ch, 35,140,225,20, 0, 0, 0, 0, 0, "");
- }
- else {
- uiDefBut(block, LABEL, 0, "Sample: No sample info available.",35,140,225,20, 0, 0, 0, 0, 0, "");
- }
-
- /* sample browse buttons */
- uiBlockBeginAlign(block);
- strp= make_sample_menu();
- if (strp) {
- uiDefButS(block, MENU, B_SOUND_MENU_SAMPLE, strp, 10,120,23,20, &(G.buts->menunr), 0, 0, 0, 0, "Select another loaded sample");
- MEM_freeN(strp);
- }
- uiDefBut(block, TEX, B_SOUND_NAME_SAMPLE, "", 35,120,250,20, sound->name, 0.0, 79.0, 0, 0, "The sample file used by this Sound");
-
- if (sound->sample->packedfile) packdummy = 1;
- else packdummy = 0;
-
- uiDefIconButBitI(block, TOG, 1, B_SOUND_UNPACK_SAMPLE, ICON_PACKAGE,
- 285, 120,25,20, &packdummy, 0, 0, 0, 0,"Pack/Unpack this sample");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_SOUND_LOAD_SAMPLE, "Load sample", 10, 95,150,24, 0, 0, 0, 0, 0, "Load a different sample file");
-
- uiDefBut(block, BUT, B_SOUND_PLAY_SAMPLE, "Play", 160, 95, 150, 24, 0, 0.0, 0, 0, 0, "Playback sample using settings below");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ",
- 10,70,150,20, &sound->volume, 0.0, 1.0, 0, 0, "Game engine only: Set the volume of this sound");
-
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Pitch: ",
- 160,70,150,20, &sound->pitch, -12.0, 12.0, 0, 0, "Game engine only: Set the pitch of this sound");
-
- /* looping */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SOUND_FLAGS_LOOP, B_SOUND_REDRAW, "Loop",
- 10, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between looping on/off");
-
- if (sound->flags & SOUND_FLAGS_LOOP) {
- uiDefButBitI(block, TOG, SOUND_FLAGS_BIDIRECTIONAL_LOOP, B_SOUND_REDRAW, "Ping Pong",
- 105, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between A->B and A->B->A looping");
-
- }
-
-
- /* 3D settings ------------------------------------------------------------------ */
- uiBlockBeginAlign(block);
-
- if (sound->sample->channels == 1) {
- uiDefButBitI(block, TOG, SOUND_FLAGS_3D, B_SOUND_REDRAW, "3D Sound",
- 10, 10, 90, 20, &sound->flags, 0, 0, 0, 0, "Game engine only: Turns 3D sound on");
-
- if (sound->flags & SOUND_FLAGS_3D) {
- uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Scale: ",
- 100,10,210,20, &sound->attenuation, 0.0, 5.0, 1.0, 0, "Game engine only: Sets the surround scaling factor for this sound");
-
- }
- }
- }
-}
-
-/* ************************* Sequencer *********************** */
-
-#define SEQ_PANEL_EDITING 1
-#define SEQ_PANEL_INPUT 2
-#define SEQ_PANEL_FILTER 4
-#define SEQ_PANEL_EFFECT 8
-#define SEQ_PANEL_PROXY 16
-
-static char* seq_panel_blend_modes()
-{
- static char string[2048];
-
- Sequence *last_seq = get_last_seq();
-
- sprintf(string, "Blend mode: %%t|%s %%x%d",
- "Replace", SEQ_BLEND_REPLACE);
-
- /*
- Blending can only work without effect strips.
- Otherwise, one would have
- to decide, what the effect strips IPO should do:
- - drive the effect _or_
- - drive the blend mode ?
-
- Also: effectdata is used by these implicit effects,
- so that would collide also.
- */
-
- if ( seq_can_blend(last_seq) ) {
- int i;
-
- for (i = SEQ_EFFECT; i <= SEQ_EFFECT_MAX; i++) {
- if (get_sequence_effect_num_inputs(i) == 2) {
- sprintf(string + strlen(string),
- "|%s %%x%d",
- give_seqname_by_type(i), i);
- }
- }
- }
- return string;
-}
-
-static char* seq_panel_scenes()
-{
- static char rstr[8192];
- char * str;
-
- IDnames_to_pupstring(&str, NULL, NULL,
- &G.main->scene, (ID *)G.scene, NULL);
-
- strncpy(rstr, str, 8192);
- MEM_freeN(str);
-
- return rstr;
-}
-
-static void seq_update_scenenr(Sequence * seq)
-{
- Scene * sce;
- int nr;
- if (seq->type != SEQ_SCENE) {
- return;
- }
-
- seq->scenenr = 0;
-
- sce = G.main->scene.first;
- nr = 1;
- while(sce) {
- if (sce == seq->scene) {
- seq->scenenr = nr;
- break;
- }
- nr++;
- sce = sce->id.next;
- }
-}
-
-
-static void seq_panel_editing()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
- static char strdata[1024];
- char * str = strdata;
- char * p;
- int yco;
-
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_editing",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Edit", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
- uiDefBut(block, LABEL,
- 0, give_seqname(last_seq),
- 10,140,60,19, 0,
- 0, 0, 0, 0, "");
-
- uiDefBut(block, TEX,
- B_NOP, "Name: ",
- 70,140,180,19, last_seq->name+2,
- 0.0, 21.0, 100, 0, "");
-
- uiDefButI(block, MENU, B_SEQ_BUT_RELOAD, seq_panel_blend_modes(),
- 10, 120, 120, 19, &last_seq->blend_mode,
- 0,0,0,0, "Strip Blend Mode");
-
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Blend:",
- 130, 120, 120, 19, &last_seq->blend_opacity,
- 0.0, 100.0, 100.0, 0,
- "Blend opacity");
-
- uiDefButBitI(block, TOG, SEQ_MUTE,
- B_SEQ_BUT_RELOAD_ALL, "Mute",
- 10,100,60,19, &last_seq->flag,
- 0.0, 1.0, 0, 0,
- "Mute the current strip.");
-
- uiDefButBitI(block, TOG, SEQ_LOCK,
- B_REDR, "Lock",
- 70,100,60,19, &last_seq->flag,
- 0.0, 1.0, 0, 0,
- "Lock strip, so that it can't be transformed.");
-
- uiDefButBitI(block, TOG, SEQ_IPO_FRAME_LOCKED,
- B_SEQ_BUT_RELOAD_ALL, "IPO Frame locked",
- 130,100,120,19, &last_seq->flag,
- 0.0, 1.0, 0, 0,
- "Lock the IPO coordinates to the "
- "global frame counter.");
-
- if (!(last_seq->flag & SEQ_LOCK)) {
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "Start",
- 10, 80, 120, 20, &last_seq->start,
- -MAXFRAMEF, MAXFRAMEF, 0.0, 0.0, "Start of strip");
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "Chan",
- 130, 80, 120, 20, &last_seq->machine,
- 0.0, MAXSEQ, 0.0, 0.0, "Channel used (Y position)");
-
- if (check_single_seq(last_seq) || last_seq->len == 0) {
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "End-Still",
- 130, 60, 120, 19, &last_seq->endstill,
- 0.0, MAXFRAMEF, 0.0, 0.0, "End still");
- } else {
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "Start-Still",
- 10, 60, 120, 20, &last_seq->startstill,
- 0.0, MAXFRAMEF, 0.0, 0.0, "Start still");
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "End-Still",
- 130, 60, 120, 19, &last_seq->endstill,
- 0.0, MAXFRAMEF, 0.0, 0.0, "End still");
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "Start-Ofs",
- 10, 40, 120, 20, &last_seq->startofs,
- 0.0, last_seq->len - last_seq->endofs,
- 0.0, 0.0, "Start offset");
- uiDefButI(block, NUM,
- B_SEQ_BUT_TRANSFORM, "End-Ofs",
- 130, 40, 120, 19, &last_seq->endofs,
- 0.0, last_seq->len - last_seq->startofs,
- 0.0, 0.0, "End offset");
- }
- }
-
-
- if(last_seq->type & SEQ_EFFECT)
- sprintf(str, "Len: %d\nFrom %d - %d\n", last_seq->len, last_seq->startdisp, last_seq->enddisp-1);
- else
- sprintf(str, "Len: %d(%d)\n", last_seq->enddisp-last_seq->startdisp, last_seq->len);
-
- str += strlen(str);
-
- if(last_seq->type==SEQ_IMAGE) {
- if (last_seq->len > 1) {
- /* CURRENT */
- StripElem * se= give_stripelem(last_seq, CFRA);
- StripElem * last;
-
- /* FIRST AND LAST */
-
- if(last_seq->strip) {
- se= last_seq->strip->stripdata;
- last= se+last_seq->len-1;
- if(last_seq->startofs) se+= last_seq->startofs;
- if(last_seq->endofs) last-= last_seq->endofs;
-
- sprintf(str, "First: %s at %d\nLast: %s at %d\n", se->name, last_seq->startdisp, last->name, last_seq->enddisp-1);
- }
- } else { /* single image */
- if (last_seq->strip) {
- sprintf(str, "Len: %d\n", last_seq->enddisp-last_seq->startdisp);
- }
- }
-
- str += strlen(str);
-
- /* orig size */
- if(last_seq->strip) {
- sprintf(str, "OrigSize: %d x %d\n", last_seq->strip->orx, last_seq->strip->ory);
- }
- }
- else if(last_seq->type==SEQ_MOVIE) {
- int sta= last_seq->startofs;
- int end= last_seq->len-1-last_seq->endofs;
-
- sprintf(str, "First: %d at %d\nLast: %d at %d\nCur: %d\n",
- sta, last_seq->startdisp, end, last_seq->enddisp-1,
- (G.scene->r.cfra)-last_seq->startdisp);
-
- str += strlen(str);
- /* orig size */
- if(last_seq->strip) {
- sprintf(str, "OrigSize: %d x %d\n",
- last_seq->strip->orx, last_seq->strip->ory);
- }
- }
- else if(last_seq->type==SEQ_SCENE) {
- TStripElem * se= give_tstripelem(last_seq, (G.scene->r.cfra));
- if(se && last_seq->scene) {
- sprintf(str, "First: %d\nLast: %d\nCur: %d\n", last_seq->sfra+se->nr, last_seq->sfra, last_seq->sfra+last_seq->len-1);
- }
- str += strlen(str);
- /* orig size */
- if(last_seq->strip) {
- sprintf(str, "OrigSize: %d x %d\n",
- last_seq->strip->orx, last_seq->strip->ory);
- }
- }
- else if(last_seq->type==SEQ_RAM_SOUND
- || last_seq->type == SEQ_HD_SOUND) {
-
- int sta= last_seq->startofs;
- int end= last_seq->len-1-last_seq->endofs;
-
- sprintf(str, "First: %d at %d\nLast: %d at %d\nCur: %d\n",
- sta, last_seq->startdisp, end, last_seq->enddisp-1,
- (G.scene->r.cfra)-last_seq->startdisp);
- }
- else if(last_seq->type == SEQ_SPEED) {
- SpeedControlVars * vars =
- (SpeedControlVars*) last_seq->effectdata;
-
- if (vars) {
- sprintf(str, "Last mapped frame: %d at %d\n",
- vars->lastValidFrame,
- vars->lastValidFrame
- + last_seq->startdisp);
- }
- }
-
- str = strdata;
- yco = 20;
-
- while ((p = strchr(str, '\n'))) {
- *p = 0;
- uiDefBut(block, LABEL, 0, str, 10,yco,240,17, 0,
- 0, 0, 0, 0, "");
- str = p+1;
- yco -= 18;
- }
-}
-
-static void seq_panel_input()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
-
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_input",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Input", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
- if (SEQ_HAS_PATH(last_seq)) {
- uiDefBut(block, TEX,
- B_SEQ_BUT_RELOAD_FILE, "Dir: ",
- 10,140,240,19, last_seq->strip->dir,
- 0.0, 160.0, 100, 0, "");
- }
-
- if (last_seq->type == SEQ_IMAGE) {
- int cfra = CFRA;
- StripElem * se;
-
- if(last_seq->startdisp >cfra) {
- cfra = last_seq->startdisp;
- } else if (last_seq->enddisp <= cfra) {
- cfra = last_seq->enddisp - 1;
- }
-
- se = give_stripelem(last_seq, cfra);
-
- if (se) {
- uiDefBut(block, TEX,
- B_SEQ_BUT_RELOAD_FILE, "File: ",
- 10, 120, 190,19, se->name,
- 0.0, 80.0, 100, 0, "");
- }
-
- } else if (last_seq->type == SEQ_MOVIE ||
- last_seq->type == SEQ_HD_SOUND ||
- last_seq->type == SEQ_RAM_SOUND) {
- uiDefBut(block, TEX,
- B_SEQ_BUT_RELOAD_FILE, "File: ",
- 10,120,190,19, last_seq->strip->stripdata->name,
- 0.0, 80.0, 100, 0, "");
- } else if (last_seq->type == SEQ_SCENE) {
- seq_update_scenenr(last_seq);
- uiDefButI(block, MENU, B_SEQ_BUT_RELOAD_FILE,
- seq_panel_scenes(),
- 10, 120, 190, 19, &last_seq->scenenr,
- 0,0,0,0, "Linked Scene");
- }
-
- uiDefBut(block, BUT, B_SEQ_BUT_RELOAD_FILE,
- "Reload",
- 200,120,50,19, 0, 0, 0, 0, 0,
- "Reload files/scenes from disk and update strip length.");
-
- if (last_seq->type == SEQ_MOVIE
- || last_seq->type == SEQ_IMAGE
- || last_seq->type == SEQ_SCENE
- || last_seq->type == SEQ_META) {
- uiDefButBitI(block, TOG, SEQ_USE_CROP,
- B_SEQ_BUT_RELOAD, "Use Crop",
- 10,100,240,19, &last_seq->flag,
- 0.0, 1.0, 0, 0,
- "Crop image before processing.");
-
- if (last_seq->flag & SEQ_USE_CROP) {
- if (!last_seq->strip->crop) {
- last_seq->strip->crop =
- MEM_callocN(sizeof(struct StripCrop),
- "StripCrop");
- }
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "Top",
- 10, 80, 120, 20,
- &last_seq->strip->crop->top,
- 0.0, 4096, 0.0, 0.0, "Top of source image");
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "Bottom",
- 130, 80, 120, 20,
- &last_seq->strip->crop->bottom,
- 0.0, 4096, 0.0, 0.0,
- "Bottom of source image");
-
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "Left",
- 10, 60, 120, 20,
- &last_seq->strip->crop->left,
- 0.0, 4096, 0.0, 0.0, "Left");
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "Right",
- 130, 60, 120, 19,
- &last_seq->strip->crop->right,
- 0.0, 4096, 0.0, 0.0, "Right");
- }
-
- uiDefButBitI(block, TOG, SEQ_USE_TRANSFORM,
- B_SEQ_BUT_RELOAD, "Use Translate",
- 10,40,240,19, &last_seq->flag,
- 0.0, 1.0, 0, 0,
- "Translate image before processing.");
-
- if (last_seq->flag & SEQ_USE_TRANSFORM) {
- if (!last_seq->strip->transform) {
- last_seq->strip->transform =
- MEM_callocN(
- sizeof(struct StripTransform),
- "StripTransform");
- }
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "X-Ofs",
- 10, 20, 120, 20,
- &last_seq->strip->transform->xofs,
- -4096.0, 4096, 0.0, 0.0, "X Offset");
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD, "Y-Ofs",
- 130, 20, 120, 20,
- &last_seq->strip->transform->yofs,
- -4096.0, 4096, 0.0, 0.0, "Y Offset");
- }
- }
-
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD_FILE, "A-Start",
- 10, 0, 120, 20, &last_seq->anim_startofs,
- 0.0, last_seq->len + last_seq->anim_startofs, 0.0, 0.0,
- "Animation start offset (trim start)");
- uiDefButI(block, NUM,
- B_SEQ_BUT_RELOAD_FILE, "A-End",
- 130, 0, 120, 20, &last_seq->anim_endofs,
- 0.0, last_seq->len + last_seq->anim_endofs, 0.0, 0.0,
- "Animation end offset (trim end)");
-
-
- if (last_seq->type == SEQ_MOVIE) {
- uiDefButI(block, NUM, B_SEQ_BUT_RELOAD, "MPEG-Preseek:",
- 10, -20, 240,19, &last_seq->anim_preseek,
- 0.0, 50.0, 100,0,
- "On MPEG-seeking preseek this many frames");
- }
-
-}
-
-static void seq_panel_filter_video()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_filter",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Filter", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
-
- uiBlockBeginAlign(block);
-
-
- uiDefButBitI(block, TOG, SEQ_MAKE_PREMUL,
- B_SEQ_BUT_RELOAD, "Premul",
- 10,110,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Converts RGB values to become premultiplied with Alpha");
-
- uiDefButBitI(block, TOG, SEQ_MAKE_FLOAT,
- B_SEQ_BUT_RELOAD, "Float",
- 90,110,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Convert input to float data");
-
- uiDefButBitI(block, TOG, SEQ_FILTERY,
- B_SEQ_BUT_RELOAD_FILE, "De-Inter",
- 170,110,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "For video movies to remove fields");
-
- uiDefButBitI(block, TOG, SEQ_FLIPX,
- B_SEQ_BUT_RELOAD, "FlipX",
- 10,90,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Flip on the X axis");
- uiDefButBitI(block, TOG, SEQ_FLIPY,
- B_SEQ_BUT_RELOAD, "FlipY",
- 90,90,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Flip on the Y axis");
-
- uiDefButBitI(block, TOG, SEQ_REVERSE_FRAMES,
- B_SEQ_BUT_RELOAD, "Flip Time",
- 170,90,80,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Reverse frame order");
-
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Mul:",
- 10,70,120,19, &last_seq->mul,
- 0.001, 20.0, 0.1, 0,
- "Multiply colors");
-
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Strobe:",
- 130,70,120,19, &last_seq->strobe,
- 1.0, 30.0, 100, 0,
- "Only display every nth frame");
-
- uiDefButBitI(block, TOG, SEQ_USE_COLOR_BALANCE,
- B_SEQ_BUT_RELOAD, "Use Color Balance",
- 10,50,240,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Activate Color Balance "
- "(3-Way color correction) on input");
-
-
- if (last_seq->flag & SEQ_USE_COLOR_BALANCE) {
- if (!last_seq->strip->color_balance) {
- int c;
- StripColorBalance * cb
- = last_seq->strip->color_balance
- = MEM_callocN(
- sizeof(struct StripColorBalance),
- "StripColorBalance");
- for (c = 0; c < 3; c++) {
- cb->lift[c] = 1.0;
- cb->gamma[c] = 1.0;
- cb->gain[c] = 1.0;
- }
- }
-
- uiDefBut(block, LABEL, 0, "Lift",
- 10,30,80,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Gamma",
- 90,30,80,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Gain",
- 170,30,80,19, 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, COL, B_SEQ_BUT_RELOAD, "Lift",
- 10,10,80,19, last_seq->strip->color_balance->lift,
- 0, 0, 0, 0, "Lift (shadows)");
-
- uiDefButF(block, COL, B_SEQ_BUT_RELOAD, "Gamma",
- 90,10,80,19, last_seq->strip->color_balance->gamma,
- 0, 0, 0, 0, "Gamma (midtones)");
-
- uiDefButF(block, COL, B_SEQ_BUT_RELOAD, "Gain",
- 170,10,80,19, last_seq->strip->color_balance->gain,
- 0, 0, 0, 0, "Gain (highlights)");
-
- uiDefButBitI(block, TOG, SEQ_COLOR_BALANCE_INVERSE_LIFT,
- B_SEQ_BUT_RELOAD, "Inv Lift",
- 10,-10,80,19,
- &last_seq->strip->color_balance->flag,
- 0.0, 21.0, 100, 0,
- "Inverse Lift");
- uiDefButBitI(block, TOG, SEQ_COLOR_BALANCE_INVERSE_GAMMA,
- B_SEQ_BUT_RELOAD, "Inv Gamma",
- 90,-10,80,19,
- &last_seq->strip->color_balance->flag,
- 0.0, 21.0, 100, 0,
- "Inverse Gamma");
- uiDefButBitI(block, TOG, SEQ_COLOR_BALANCE_INVERSE_GAIN,
- B_SEQ_BUT_RELOAD, "Inv Gain",
- 170,-10,80,19,
- &last_seq->strip->color_balance->flag,
- 0.0, 21.0, 100, 0,
- "Inverse Gain");
- }
-
-
- uiBlockEndAlign(block);
-
-}
-
-
-static void seq_panel_filter_audio()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_filter",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Filter", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Gain (dB):", 10,50,150,19, &last_seq->level, -96.0, 6.0, 100, 0, "");
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Pan:", 10,30,150,19, &last_seq->pan, -1.0, 1.0, 100, 0, "");
- uiBlockEndAlign(block);
-}
-
-static void seq_panel_effect()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_effect",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Effect", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
- if(last_seq->type == SEQ_PLUGIN) {
- PluginSeq *pis;
- VarStruct *varstr;
- int a, xco, yco;
-
- get_sequence_effect(last_seq);/* make sure, plugin is loaded */
-
- pis= last_seq->plugin;
- if(pis->vars==0) return;
-
- varstr= pis->varstr;
- if(varstr) {
- for(a=0; a<pis->vars; a++, varstr++) {
- xco= 150*(a/6)+10;
- yco= 125 - 20*(a % 6)+1;
- uiDefBut(block, varstr->type, B_SEQ_BUT_PLUGIN, varstr->name, xco,yco,150,19, &(pis->data[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
-
- }
- }
- return;
- }
-
- uiBlockBeginAlign(block);
-
- if(last_seq->type==SEQ_WIPE){
- WipeVars *wipe = (WipeVars *)last_seq->effectdata;
- char formatstring[256];
-
- strncpy(formatstring, "Transition Type %t|Single Wipe%x0|Double Wipe %x1|Iris Wipe %x4|Clock Wipe %x5", 255);
- uiDefButS(block, MENU,B_SEQ_BUT_EFFECT, formatstring, 10,65,220,22, &wipe->wipetype, 0, 0, 0, 0, "What type of wipe should be performed");
- uiDefButF(block, NUM,B_SEQ_BUT_EFFECT,"Blur:", 10,40,220,22, &wipe->edgeWidth,0.0,1.0, 1, 2, "The percent width of the blur edge");
- switch(wipe->wipetype){ /*Skip Types that do not require angle*/
- case DO_IRIS_WIPE:
- case DO_CLOCK_WIPE:
- break;
-
- default:
- uiDefButF(block, NUM,B_SEQ_BUT_EFFECT,"Angle:", 10,15,220,22, &wipe->angle,-90.0,90.0, 1, 2, "The Angle of the Edge");
- }
- uiDefButS(block, TOG,B_SEQ_BUT_EFFECT,"Wipe In", 10,-10,220,22, &wipe->forward,0,0, 0, 0, "Controls Primary Direction of Wipe");
- } else if(last_seq->type==SEQ_GLOW){
- GlowVars *glow = (GlowVars *)last_seq->effectdata;
-
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "Threshold:", 10,70,150,19, &glow->fMini, 0.0, 1.0, 0, 0, "Trigger Intensity");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "Clamp:", 10,50,150,19, &glow->fClamp, 0.0, 1.0, 0, 0, "Brightness limit of intensity");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "Boost factor:", 10,30,150,19, &glow->fBoost, 0.0, 10.0, 0, 0, "Brightness multiplier");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "Blur distance:", 10,10,150,19, &glow->dDist, 0.5, 20.0, 0, 0, "Radius of glow effect");
- uiDefButI(block, NUM, B_NOP, "Quality:", 10,-5,150,19, &glow->dQuality, 1.0, 5.0, 0, 0, "Accuracy of the blur effect");
- uiDefButI(block, TOG, B_NOP, "Only boost", 10,-25,150,19, &glow->bNoComp, 0.0, 0.0, 0, 0, "Show the glow buffer only");
- }
- else if(last_seq->type==SEQ_TRANSFORM){
- TransformVars *transform = (TransformVars *)last_seq->effectdata;
-
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "xScale Start:", 10,70,150,19, &transform->ScalexIni, 0.0, 10.0, 0, 0, "X Scale Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "xScale End:", 160,70,150,19, &transform->ScalexFin, 0.0, 10.0, 0, 0, "X Scale End");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "yScale Start:", 10,50,150,19, &transform->ScaleyIni, 0.0, 10.0, 0, 0, "Y Scale Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "yScale End:", 160,50,150,19, &transform->ScaleyFin, 0.0, 10.0, 0, 0, "Y Scale End");
-
- uiDefButI(block, ROW, B_SEQ_BUT_EFFECT, "Percent", 10, 30, 150, 19, &transform->percent, 0.0, 1.0, 0.0, 0.0, "Percent Translate");
- uiDefButI(block, ROW, B_SEQ_BUT_EFFECT, "Pixels", 160, 30, 150, 19, &transform->percent, 0.0, 0.0, 0.0, 0.0, "Pixels Translate");
- if(transform->percent==1){
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -500.0, 500.0, 0, 0, "X Position Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -500.0, 500.0, 0, 0, "X Position End");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -500.0, 500.0, 0, 0, "Y Position Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -500.0, 500.0, 0, 0, "Y Position End");
- } else {
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -10000.0, 10000.0, 0, 0, "X Position Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -10000.0, 10000.0, 0, 0, "X Position End");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -10000.0, 10000.0, 0, 0, "Y Position Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -10000.0, 10000.0, 0, 0, "Y Position End");
-
- }
-
-
-
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "rot Start:",10,-30,150,19, &transform->rotIni, 0.0, 360.0, 0, 0, "Rotation Start");
- uiDefButF(block, NUM, B_SEQ_BUT_EFFECT, "rot End:",160,-30,150,19, &transform->rotFin, 0.0, 360.0, 0, 0, "Rotation End");
-
- uiDefButI(block, ROW, B_SEQ_BUT_EFFECT, "No Interpolat", 10, -50, 100, 19, &transform->interpolation, 0.0, 0.0, 0.0, 0.0, "No interpolation");
- uiDefButI(block, ROW, B_SEQ_BUT_EFFECT, "Bilinear", 101, -50, 100, 19, &transform->interpolation, 0.0, 1.0, 0.0, 0.0, "Bilinear interpolation");
- uiDefButI(block, ROW, B_SEQ_BUT_EFFECT, "Bicubic", 202, -50, 100, 19, &transform->interpolation, 0.0, 2.0, 0.0, 0.0, "Bicubic interpolation");
- } else if(last_seq->type==SEQ_COLOR) {
- SolidColorVars *colvars = (SolidColorVars *)last_seq->effectdata;
- uiDefButF(block, COL, B_SEQ_BUT_RELOAD, "",10,90,150,19, colvars->col, 0, 0, 0, 0, "");
- } else if(last_seq->type==SEQ_SPEED){
- SpeedControlVars *sp =
- (SpeedControlVars *)last_seq->effectdata;
-
- uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Global Speed:", 10,70,150,19, &sp->globalSpeed, 0.0, 100.0, 0, 0, "Global Speed");
-
- uiDefButBitI(block, TOG, SEQ_SPEED_INTEGRATE,
- B_SEQ_BUT_RELOAD,
- "IPO is velocity",
- 10,50,150,19, &sp->flags,
- 0.0, 1.0, 0, 0,
- "Interpret the IPO value as a "
- "velocity instead of a frame number");
-
- uiDefButBitI(block, TOG, SEQ_SPEED_BLEND,
- B_SEQ_BUT_RELOAD,
- "Enable frame blending",
- 10,30,150,19, &sp->flags,
- 0.0, 1.0, 0, 0,
- "Blend two frames into the "
- "target for a smoother result");
-
- uiDefButBitI(block, TOG, SEQ_SPEED_COMPRESS_IPO_Y,
- B_SEQ_BUT_RELOAD,
- "IPO value runs from [0..1]",
- 10,10,150,19, &sp->flags,
- 0.0, 1.0, 0, 0,
- "Scale IPO value to get the "
- "target frame number.");
- }
-
- uiBlockEndAlign(block);
-}
-
-static void seq_panel_proxy()
-{
- Sequence *last_seq = get_last_seq();
- uiBlock *block;
- block = uiNewBlock(&curarea->uiblocks, "seq_panel_proxy",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- if(uiNewPanel(curarea, block, "Proxy", "Sequencer",
- 10, 230, 318, 204) == 0) return;
-
- uiBlockBeginAlign(block);
-
- uiDefButBitI(block, TOG, SEQ_USE_PROXY,
- B_SEQ_BUT_RELOAD, "Use Proxy",
- 10,140,120,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Use a preview proxy for this strip");
-
- if (last_seq->flag & SEQ_USE_PROXY) {
- if (!last_seq->strip->proxy) {
- last_seq->strip->proxy =
- MEM_callocN(sizeof(struct StripProxy),
- "StripProxy");
- }
-
- uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR,
- B_SEQ_BUT_RELOAD, "Custom Dir",
- 130,140,120,19, &last_seq->flag,
- 0.0, 21.0, 100, 0,
- "Use a custom directory to store data");
-
- if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
- uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR,
- ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0,
- "Select the directory/name for "
- "the proxy storage");
-
- uiDefBut(block, TEX,
- B_SEQ_BUT_RELOAD, "Dir: ",
- 30,120,220,20, last_seq->strip->proxy->dir,
- 0.0, 160.0, 100, 0, "");
- }
- }
-
- if (last_seq->flag & SEQ_USE_PROXY) {
- if (G.scene->r.size == 100) {
- uiDefBut(block, LABEL, 0,
- "Full render size selected, ",
- 10,100,240,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0,
- "so no proxy enabled!",
- 10,80,240,19, 0, 0, 0, 0, 0, "");
- } else if (last_seq->type != SEQ_MOVIE
- && last_seq->type != SEQ_IMAGE
- && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) {
- uiDefBut(block, LABEL, 0,
- "Cannot proxy this strip without ",
- 10,100,240,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0,
- "custom directory selection!",
- 10,80,240,19, 0, 0, 0, 0, 0, "");
-
- } else {
- uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY,
- "Rebuild proxy",
- 10,100,240,19, 0, 0, 0, 0, 0,
- "Rebuild proxy for the "
- "currently selected strip.");
- }
- }
-
- uiBlockEndAlign(block);
-}
-
-
-void sequencer_panels()
-{
- Sequence *last_seq = get_last_seq();
- int panels = 0;
- int type;
-
- if(last_seq == NULL) {
- return;
- }
-
- type = last_seq->type;
-
- panels = SEQ_PANEL_EDITING;
-
- if (type == SEQ_MOVIE || type == SEQ_IMAGE || type == SEQ_SCENE
- || type == SEQ_META) {
- panels |= SEQ_PANEL_INPUT | SEQ_PANEL_FILTER | SEQ_PANEL_PROXY;
- }
-
- if (type == SEQ_RAM_SOUND || type == SEQ_HD_SOUND) {
- panels |= SEQ_PANEL_FILTER | SEQ_PANEL_INPUT;
- }
-
- if (type == SEQ_PLUGIN || type >= SEQ_EFFECT) {
- panels |= SEQ_PANEL_EFFECT | SEQ_PANEL_PROXY;
- }
-
- if (panels & SEQ_PANEL_EDITING) {
- seq_panel_editing();
- }
-
- if (panels & SEQ_PANEL_INPUT) {
- seq_panel_input();
- }
-
- if (panels & SEQ_PANEL_FILTER) {
- if (type == SEQ_RAM_SOUND || type == SEQ_HD_SOUND) {
- seq_panel_filter_audio();
- } else {
- seq_panel_filter_video();
- }
- }
-
- if (panels & SEQ_PANEL_EFFECT) {
- seq_panel_effect();
- }
-
- if (panels & SEQ_PANEL_PROXY) {
- seq_panel_proxy();
- }
-}
-
-static void sel_proxy_dir(char *name)
-{
- Sequence *last_seq = get_last_seq();
- strcpy(last_seq->strip->proxy->dir, name);
-
- allqueue(REDRAWBUTSSCENE, 0);
-
- BIF_undo_push("Change proxy directory");
-}
-
-void do_sequencer_panels(unsigned short event)
-{
- Sequence *last_seq = get_last_seq();
- ScrArea * sa;
-
- if (!last_seq) {
- return;
- }
-
- switch(event) {
- case B_SEQ_BUT_PLUGIN:
- case B_SEQ_BUT_EFFECT:
- update_changed_seq_and_deps(last_seq, 0, 1);
- break;
- case B_SEQ_BUT_RELOAD_FILE:
- reload_sequence_new_file(last_seq);
- break;
- case B_SEQ_BUT_REBUILD_PROXY:
- seq_proxy_rebuild(last_seq);
- break;
- case B_SEQ_SEL_PROXY_DIR:
- sa= closest_bigger_area();
- areawinset(sa->win);
- activate_fileselect(FILE_SPECIAL, "SELECT PROXY DIR",
- last_seq->strip->proxy->dir,
- sel_proxy_dir);
- break;
- case B_SEQ_BUT_RELOAD:
- case B_SEQ_BUT_RELOAD_ALL:
- update_seq_ipo_rect(last_seq);
- update_seq_icu_rects(last_seq);
-
- free_imbuf_seq(); // frees all
-
- break;
- case B_SEQ_BUT_TRANSFORM:
- calc_sequence(last_seq);
- if (test_overlap_seq(last_seq))
- shuffle_seq(last_seq);
- break;
- }
-
- if (event == B_SEQ_BUT_RELOAD_ALL) {
- allqueue(REDRAWALL, 0);
- } else {
- allqueue(REDRAWSEQ, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- }
-}
-
-
-/* ************************* SCENE *********************** */
-
-
-static void output_pic(char *name)
-{
- strcpy(G.scene->r.pic, name);
- allqueue(REDRAWBUTSSCENE, 0);
- BIF_undo_push("Change output picture directory");
-}
-
-static void backbuf_pic(char *name)
-{
- Image *ima;
-
- strcpy(G.scene->r.backbuf, name);
- allqueue(REDRAWBUTSSCENE, 0);
-
- ima= BKE_add_image_file(name);
- if(ima)
- BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
-
- BIF_undo_push("Change background picture");
-}
-
-static void run_playanim(char *file)
-{
- extern char bprogname[]; /* usiblender.c */
- char str[FILE_MAX*2]; /* FILE_MAX*2 is a bit arbitary, but this should roughly allow for the args + the max-file-length */
- int pos[2], size[2];
-
- /* use current settings for defining position of window. it actually should test image size */
- calc_renderwin_rectangle((G.scene->r.xsch*G.scene->r.size)/100,
- (G.scene->r.ysch*G.scene->r.size)/100, G.winpos, pos, size);
-#ifdef WIN32
- sprintf(str, "%s -a -s %d -e %d -p %d %d -f %d %g \"%s\"", bprogname, G.scene->r.sfra, G.scene->r.efra, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
-#else
- sprintf(str, "\"%s\" -a -s %d -e %d -p %d %d -f %d %g \"%s\"", bprogname, G.scene->r.sfra, G.scene->r.efra, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file);
-#endif
- system(str);
-}
-
-void playback_anim(void)
-{
- char file[FILE_MAX];
-
- if(BKE_imtype_is_movie(G.scene->r.imtype)) {
- switch (G.scene->r.imtype) {
-#ifdef WITH_QUICKTIME
- case R_QUICKTIME:
- makeqtstring(file);
- break;
-#endif
-#ifdef WITH_FFMPEG
- case R_FFMPEG:
- makeffmpegstring(file);
- break;
-#endif
- default:
- makeavistring(&G.scene->r, file);
- break;
- }
- if(BLI_exist(file)) {
- run_playanim(file);
- }
- else error("Can't find movie: %s", file);
- }
- else {
- BKE_makepicstring(file, G.scene->r.pic, G.scene->r.sfra, G.scene->r.imtype);
- if(BLI_exist(file)) {
- run_playanim(file);
- }
- else error("Can't find image: %s", file);
- }
-}
-
-#ifdef WITH_FFMPEG
-static void set_ffmpeg_preset(int preset);
-static int ffmpeg_property_add_string(const char * type, const char * str);
-static char ffmpeg_option_to_add[255] = "";
-#endif
-
-void do_render_panels(unsigned short event)
-{
- ScrArea *sa;
- ID *id;
-
- switch(event) {
-
- case B_DORENDER:
- BIF_do_render(0);
- break;
- case B_RTCHANGED:
- allqueue(REDRAWALL, 0);
- break;
- case B_SWITCHRENDER:
- /* new panels added, so... */
- G.buts->re_align= 1;
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PLAYANIM:
- playback_anim();
- break;
-
- case B_DOANIM:
- BIF_do_render(1);
- break;
-
- case B_FS_PIC:
- sa= closest_bigger_area();
- areawinset(sa->win);
- if(G.qual == LR_CTRLKEY)
- activate_imageselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic);
- else
- activate_fileselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic);
- break;
-
- case B_FS_BACKBUF:
- sa= closest_bigger_area();
- areawinset(sa->win);
- if(G.qual == LR_CTRLKEY)
- activate_imageselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic);
- else
- activate_fileselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic);
- break;
-
- case B_PR_PAL:
- G.scene->r.xsch= 720;
- G.scene->r.ysch= 576;
- G.scene->r.xasp= 54;
- G.scene->r.yasp= 51;
- G.scene->r.size= 100;
- G.scene->r.frs_sec= 25;
- G.scene->r.frs_sec_base= 1;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-#ifdef WITH_FFMPEG
- G.scene->r.ffcodecdata.gop_size = 15;
-#endif
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set PAL");
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEWCAM, 0);
- break;
-
- case B_FILETYPEMENU:
- allqueue(REDRAWBUTSSCENE, 0);
-#ifdef WITH_FFMPEG
- if (G.scene->r.imtype == R_FFMPEG) {
- if (G.scene->r.ffcodecdata.type <= 0 ||
- G.scene->r.ffcodecdata.codec <= 0 ||
- G.scene->r.ffcodecdata.audio_codec <= 0 ||
- G.scene->r.ffcodecdata.video_bitrate <= 1) {
- G.scene->r.ffcodecdata.codec
- = CODEC_ID_MPEG2VIDEO;
- set_ffmpeg_preset(FFMPEG_PRESET_DVD);
- }
-
- if (G.scene->r.ffcodecdata.audio_codec <= 0) {
- G.scene->r.ffcodecdata.audio_codec
- = CODEC_ID_MP2;
- G.scene->r.ffcodecdata.audio_bitrate = 128;
- }
- break;
- }
-#endif
-#if defined (_WIN32) || defined (__APPLE__)
- // fall through to codec settings if this is the first
- // time R_AVICODEC is selected for this scene.
- if (((G.scene->r.imtype == R_AVICODEC)
- && (G.scene->r.avicodecdata == NULL)) ||
- ((G.scene->r.imtype == R_QUICKTIME)
- && (G.scene->r.qtcodecdata == NULL))) {
- } else {
- break;
- }
-#endif /*_WIN32 || __APPLE__ */
-
- case B_SELECTCODEC:
-#if defined (_WIN32) || defined (__APPLE__)
- if ((G.scene->r.imtype == R_QUICKTIME)) { /* || (G.scene->r.qtcodecdata)) */
-#ifdef WITH_QUICKTIME
- get_qtcodec_settings();
-#endif /* WITH_QUICKTIME */
- }
-#if defined (_WIN32) && !defined(FREE_WINDOWS)
- else
- get_avicodec_settings();
-#endif /* _WIN32 && !FREE_WINDOWS */
-#endif /* _WIN32 || __APPLE__ */
- break;
-
- case B_PR_HD:
- G.scene->r.xsch= 1920;
- G.scene->r.ysch= 1080;
- G.scene->r.xasp= 1;
- G.scene->r.yasp= 1;
- G.scene->r.size= 100;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set FULL");
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEWCAM, 0);
- break;
- case B_PR_FULL:
- G.scene->r.xsch= 1280;
- G.scene->r.ysch= 1024;
- G.scene->r.xasp= 1;
- G.scene->r.yasp= 1;
- G.scene->r.size= 100;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set FULL");
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEWCAM, 0);
- break;
- case B_PR_PRV:
- G.scene->r.xsch= 640;
- G.scene->r.ysch= 512;
- G.scene->r.xasp= 1;
- G.scene->r.yasp= 1;
- G.scene->r.size= 50;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 2;
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PR_PAL169:
- G.scene->r.xsch= 720;
- G.scene->r.ysch= 576;
- G.scene->r.xasp= 64;
- G.scene->r.yasp= 45;
- G.scene->r.size= 100;
- G.scene->r.frs_sec= 25;
- G.scene->r.frs_sec_base= 1;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-#ifdef WITH_FFMPEG
- G.scene->r.ffcodecdata.gop_size = 15;
-#endif
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set PAL 16/9");
- allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PR_PC:
- G.scene->r.xsch= 640;
- G.scene->r.ysch= 480;
- G.scene->r.xasp= 100;
- G.scene->r.yasp= 100;
- G.scene->r.size= 100;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-
- BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0);
- BIF_undo_push("Set PC");
- allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PR_PRESET:
- G.scene->r.xsch= 720;
- G.scene->r.ysch= 576;
- G.scene->r.xasp= 54;
- G.scene->r.yasp= 51;
- G.scene->r.size= 100;
- G.scene->r.mode= R_OSA+R_SHADOW+R_FIELDS+R_SSS;
- G.scene->r.imtype= R_TARGA;
- G.scene->r.xparts= G.scene->r.yparts= 4;
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set Default");
- allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PR_PANO:
- G.scene->r.xsch= 576;
- G.scene->r.ysch= 176;
- G.scene->r.xasp= 115;
- G.scene->r.yasp= 100;
- G.scene->r.size= 100;
- G.scene->r.mode |= R_PANORAMA;
- G.scene->r.xparts= 16;
- G.scene->r.yparts= 1;
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set Panorama");
- allqueue(REDRAWVIEWCAM, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_PR_NTSC:
- G.scene->r.xsch= 720;
- G.scene->r.ysch= 480;
- G.scene->r.xasp= 10;
- G.scene->r.yasp= 11;
- G.scene->r.size= 100;
- G.scene->r.frs_sec= 30;
- G.scene->r.frs_sec_base = 1.001;
- G.scene->r.mode &= ~R_PANORAMA;
- G.scene->r.xparts= G.scene->r.yparts= 2;
-#ifdef WITH_FFMPEG
- G.scene->r.ffcodecdata.gop_size = 18;
-#endif
-
- BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
- BIF_undo_push("Set NTSC");
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEWCAM, 0);
- break;
-
- case B_SETBROWSE:
- id= (ID*) G.scene->set;
-
- if (G.buts->menunr==-2) {
- activate_databrowse(id, ID_SCE, 0, B_SETBROWSE, &G.buts->menunr, do_render_panels);
- }
- else if (G.buts->menunr>0) {
- Scene *newset= (Scene*) BLI_findlink(&G.main->scene, G.buts->menunr-1);
-
- if (newset==G.scene)
- error("Can't use the same scene as its own set");
- else if (newset) {
- G.scene->set= newset;
- if (scene_check_setscene(G.scene)==0)
- error("This would create a cycle");
-
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Change Set Scene");
- }
- }
- break;
- case B_CLEARSET:
- G.scene->set= NULL;
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Clear Set Scene");
-
- break;
- case B_SET_EDGE:
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_SET_ZBLUR:
- G.scene->r.mode &= ~R_EDGE;
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_ADD_RENDERLAYER:
- if(G.scene->r.actlay==32767) {
- scene_add_render_layer(G.scene);
- G.scene->r.actlay= BLI_countlist(&G.scene->r.layers) - 1;
- }
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWNODE, 0);
- break;
- case B_SET_PASS:
- if(G.scene->nodetree) {
- ntreeCompositForceHidden(G.scene->nodetree);
- allqueue(REDRAWNODE, 0);
- }
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWOOPS, 0);
-#ifdef WITH_FFMPEG
- case B_ADD_FFMPEG_AUDIO_OPTION:
- if (ffmpeg_property_add_string("audio", ffmpeg_option_to_add)){
- *ffmpeg_option_to_add = 0;
- }
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- case B_ADD_FFMPEG_VIDEO_OPTION:
- if (ffmpeg_property_add_string("video", ffmpeg_option_to_add)){
- *ffmpeg_option_to_add = 0;
- }
- allqueue(REDRAWBUTSSCENE, 0);
- break;
-#endif
- }
-}
-
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *edge_render_menu(void *arg_unused)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "edge render", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", 0, 0, 220, 115, NULL, 0, 0, 0, 0, "");
-
- uiDefButS(block, NUM, 0,"Eint:", 45,75,175,19, &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
- "Sets edge intensity for Toon shading");
-
- /* color settings for the toon shading */
- uiDefButF(block, COL, 0, "", 10, 10,30,60, &(G.scene->r.edgeR), 0, 0, 0, B_EDGECOLSLI, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, 0, "R ", 45, 50, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
- "Color for edges in toon shading mode.");
- uiDefButF(block, NUMSLI, 0, "G ", 45, 30, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
- "Color for edges in toon shading mode.");
- uiDefButF(block, NUMSLI, 0, "B ", 45, 10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
- "Color for edges in toon shading mode.");
-
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *framing_render_menu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 190, xco = 0;
- int randomcolorindex = 1234;
-
- block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -5, -10, 295, 224, NULL, 0, 0, 0, 0, "");
-
- uiDefBut(block, LABEL, 0, "Framing:", xco, yco, 68,19, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, 0, "Stretch", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_SCALE , 0, 0, "Stretch or squeeze the viewport to fill the display window");
- uiDefButC(block, ROW, 0, "Expose", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_EXTEND, 0, 0, "Show the entire viewport in the display window, viewing more horizontally or vertically");
- uiDefButC(block, ROW, 0, "Letterbox", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_BARS , 0, 0, "Show the entire viewport in the display window, using bar horizontally or vertically");
- uiBlockEndAlign(block);
-
- yco -= 25;
- xco = 40;
-
- uiDefButF(block, COL, 0, "", 0, yco - 58 + 18, 33, 58, &G.scene->framing.col[0], 0, 0, 0, randomcolorindex, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, 0, "R ", xco,yco,243,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars");
- yco -= 20;
- uiDefButF(block, NUMSLI, 0, "G ", xco,yco,243,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars");
- yco -= 20;
- uiDefButF(block, NUMSLI, 0, "B ", xco,yco,243,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars");
- uiBlockEndAlign(block);
-
- xco = 0;
- uiDefBut(block, LABEL, 0, "Fullscreen:", xco, yco-=30, 100, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, TOG, 0, "Fullscreen", xco+70, yco, 68, 19, &G.scene->r.fullscreen, 0.0, 0.0, 0, 0, "Starts player in a new fullscreen display");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, 0, "X:", xco+40, yco-=27, 100, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
- uiDefButS(block, NUM, 0, "Y:", xco+140, yco, 100, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change.");
- uiDefButS(block, NUM, 0, "Freq:", xco+40, yco-=21, 100, 19, &G.scene->r.freqplay, 10.0, 2000.0, 0, 0, "Displays clock frequency of fullscreen display. Click to change.");
- uiDefButS(block, NUM, 0, "Bits:", xco+140, yco, 100, 19, &G.scene->r.depth, 8.0, 32.0, 800.0, 0, "Displays bit depth of full screen display. Click to change.");
- uiBlockEndAlign(block);
-
- /* stereo settings */
- /* can't use any definition from the game engine here so hardcode it. Change it here when it changes there!
- * RAS_IRasterizer has definitions:
- * RAS_STEREO_NOSTEREO 1
- * RAS_STEREO_QUADBUFFERED 2
- * RAS_STEREO_ABOVEBELOW 3
- * RAS_STEREO_INTERLACED 4 future
- * RAS_STEREO_ANAGLYPH 5
- * RAS_STEREO_SIDEBYSIDE 6
- * RAS_STEREO_VINTERLACE 7
- */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, 0, "No Stereo", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 1.0, 0, 0, "Disables stereo");
- uiDefButS(block, ROW, 0, "Pageflip", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 2.0, 0, 0, "Enables hardware pageflip stereo method");
- uiDefButS(block, ROW, 0, "Syncdouble", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method");
- uiDefButS(block, ROW, 0, "Anaglyph", xco-=180, yco-=21, 88, 19, &(G.scene->r.stereomode), 7.0, 5.0, 0, 0, "Enables anaglyph (Red-Blue) stereo method");
- uiDefButS(block, ROW, 0, "Side by Side", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 6.0, 0, 0, "Enables side by side left and right images");
- uiDefButS(block, ROW, 0, "V Interlace", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 7.0, 0, 0, "Enables interlaced vertical strips for autostereo display");
-
- uiBlockEndAlign(block);
-
- uiBlockSetDirection(block, UI_TOP);
-
- return block;
-}
-
-#ifdef WITH_FFMPEG
-
-static char* ffmpeg_format_pup(void)
-{
- static char string[2048];
- char formatstring[2048];
-#if 0
- int i = 0;
- int stroffs = 0;
- AVOutputFormat* next = first_oformat;
- formatstring = "FFMpeg format: %%t";
- sprintf(string, formatstring);
- formatstring = "|%s %%x%d";
- /* FIXME: This should only be generated once */
- while (next != NULL) {
- if (next->video_codec != CODEC_ID_NONE && !(next->flags & AVFMT_NOFILE)) {
- sprintf(string+stroffs, formatstring, next->name, i++);
- stroffs += strlen(string+stroffs);
- }
- next = next->next;
- }
- return string;
-#endif
- strcpy(formatstring, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"
-#if 0
-/* ifdef WITH_OGG, disabled, since broken within ffmpeg bundled with blender */
- "|%s %%x%d"
-#endif
- "|%s %%x%d");
- sprintf(string, formatstring,
- "MPEG-1", FFMPEG_MPEG1,
- "MPEG-2", FFMPEG_MPEG2,
- "MPEG-4", FFMPEG_MPEG4,
- "AVI", FFMPEG_AVI,
- "Quicktime", FFMPEG_MOV,
- "DV", FFMPEG_DV,
- "H264", FFMPEG_H264,
- "XVid", FFMPEG_XVID,
-#if 0
-/* ifdef WITH_OGG, disabled, since broken within ffmpeg bundled with blender */
- "OGG", FFMPEG_OGG,
-#endif
- "FLV", FFMPEG_FLV);
- return string;
-}
-
-static char* ffmpeg_preset_pup(void)
-{
- static char string[2048];
- char formatstring[2048];
-
- strcpy(formatstring, "FFMpeg preset: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
- sprintf(string, formatstring,
- "", FFMPEG_PRESET_NONE,
- "DVD", FFMPEG_PRESET_DVD,
- "SVCD", FFMPEG_PRESET_SVCD,
- "VCD", FFMPEG_PRESET_VCD,
- "DV", FFMPEG_PRESET_DV,
- "H264", FFMPEG_PRESET_H264);
- return string;
-}
-
-
-static char* ffmpeg_codec_pup(void) {
- static char string[2048];
- char formatstring[2048];
- strcpy(formatstring,
- "FFMpeg format: %%t"
- "|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"
-#ifdef WITH_OGG
- "|%s %%x%d"
-#endif
- "|%s %%x%d");
- sprintf(string, formatstring,
- "MPEG1", CODEC_ID_MPEG1VIDEO,
- "MPEG2", CODEC_ID_MPEG2VIDEO,
- "MPEG4(divx)", CODEC_ID_MPEG4,
- "HuffYUV", CODEC_ID_HUFFYUV,
- "DV", CODEC_ID_DVVIDEO,
- "H264", CODEC_ID_H264,
- "XVid", CODEC_ID_XVID,
-#ifdef WITH_OGG
- "Theora", CODEC_ID_THEORA,
-#endif
- "FlashVideo1", CODEC_ID_FLV1);
- return string;
-
-}
-
-static char* ffmpeg_audio_codec_pup(void) {
- static char string[2048];
- char formatstring[2048];
- strcpy(formatstring,
- "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d"
-#ifdef WITH_OGG
- "|%s %%x%d"
-#endif
- "|%s %%x%d");
- sprintf(string, formatstring,
- "MP2", CODEC_ID_MP2,
- "MP3", CODEC_ID_MP3,
- "AC3", CODEC_ID_AC3,
- "AAC", CODEC_ID_AAC,
-#ifdef WITH_OGG
- "Vorbis", CODEC_ID_VORBIS,
-#endif
- "PCM", CODEC_ID_PCM_S16LE);
- return string;
-
-}
-
-#endif
-
-static char *imagetype_pup(void)
-{
- static char string[1024];
- char formatstring[1024];
- char appendstring[1024];
-
- strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
-
-#ifdef __sgi
- strcat(formatstring, "|%s %%x%d"); // add space for Movie
-#endif
-
- strcat(formatstring, "|%s %%x%d"); // add space for PNG
-/* Commented out until implemented
-#ifdef WITH_DDS
- strcat(formatstring, "|%s %%x%d"); // add space for DDS
-#endif
-*/
- strcat(formatstring, "|%s %%x%d"); // add space for BMP
- strcat(formatstring, "|%s %%x%d"); // add space for Radiance HDR
- strcat(formatstring, "|%s %%x%d"); // add space for Cineon
- strcat(formatstring, "|%s %%x%d"); // add space for DPX
-
-#ifdef _WIN32
- strcat(formatstring, "|%s %%x%d"); // add space for AVI Codec
-#endif
-
-#ifdef WITH_FFMPEG
- strcat(formatstring, "|%s %%x%d"); // Add space for ffmpeg
-#endif
- strcat(formatstring, "|%s %%x%d"); // Add space for frameserver
-
-#ifdef WITH_QUICKTIME
- if(G.have_quicktime)
- strcat(formatstring, "|%s %%x%d"); // add space for Quicktime
-#endif
-
- if(G.have_quicktime) {
- sprintf(string, formatstring,
- "Frameserver", R_FRAMESERVER,
-#ifdef WITH_FFMPEG
- "FFMpeg", R_FFMPEG,
-#endif
- "AVI Raw", R_AVIRAW,
- "AVI Jpeg", R_AVIJPEG,
-#ifdef _WIN32
- "AVI Codec", R_AVICODEC,
-#endif
-#ifdef WITH_QUICKTIME
- "QuickTime", R_QUICKTIME,
-#endif
- "Targa", R_TARGA,
- "Targa Raw", R_RAWTGA,
- "PNG", R_PNG,
-/* commented out until implemented
-#ifdef WITH_DDS
- "DDS", R_DDS,
-#endif
-*/
- "BMP", R_BMP,
- "Jpeg", R_JPEG90,
- "HamX", R_HAMX,
- "Iris", R_IRIS,
- "Radiance HDR", R_RADHDR,
- "Cineon", R_CINEON,
- "DPX", R_DPX
-#ifdef __sgi
- ,"Movie", R_MOVIE
-#endif
- );
- } else {
- sprintf(string, formatstring,
- "Frameserver", R_FRAMESERVER,
-#ifdef WITH_FFMPEG
- "FFMpeg", R_FFMPEG,
-#endif
- "AVI Raw", R_AVIRAW,
- "AVI Jpeg", R_AVIJPEG,
-#ifdef _WIN32
- "AVI Codec", R_AVICODEC,
-#endif
- "Targa", R_TARGA,
- "Targa Raw", R_RAWTGA,
- "PNG", R_PNG,
-/*#ifdef WITH_DDS
- "DDS", R_DDS,
-#endif*/
- "BMP", R_BMP,
- "Jpeg", R_JPEG90,
- "HamX", R_HAMX,
- "Iris", R_IRIS,
- "Radiance HDR", R_RADHDR,
- "Cineon", R_CINEON,
- "DPX", R_DPX
-#ifdef __sgi
- ,"Movie", R_MOVIE
-#endif
- );
- }
-
-#ifdef WITH_OPENEXR
- strcpy(formatstring, "|%s %%x%d");
- sprintf(appendstring, formatstring, "OpenEXR", R_OPENEXR);
- strcat(string, appendstring);
- sprintf(appendstring, formatstring, "MultiLayer", R_MULTILAYER);
- strcat(string, appendstring);
-#endif
-
- if (G.have_libtiff) {
- strcpy(formatstring, "|%s %%x%d");
- sprintf(appendstring, formatstring, "TIFF", R_TIFF);
- strcat(string, appendstring);
- }
-
- return (string);
-}
-
-#ifdef _WIN32
-static char *avicodec_str(void)
-{
- static char string[1024];
-
- sprintf(string, "Codec: %s", G.scene->r.avicodecdata->avicodecname);
-
- return string;
-}
-#endif
-
-static void render_panel_output(void)
-{
- ID *id;
- int a,b;
- uiBlock *block;
- char *strp;
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Select the directory/name for saving animations");
- uiDefBut(block, TEX,0,"", 31, 190, 279, 20,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save animations, # characters defines the position and length of frame numbers");
- uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Select the directory/name for a Backbuf image");
- uiDefBut(block, TEX,0,"", 31, 168, 259, 20,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
- uiDefIconButBitS(block, ICONTOG, R_BACKBUF, B_NOP, ICON_CHECKBOX_HLT-1, 290, 168, 20, 20, &G.scene->r.bufflag, 0.0, 0.0, 0, 0, "Enable/Disable use of Backbuf image");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, R_EXTENSION, B_NOP, "Extensions", 10, 142, 100, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds filetype extensions to the filename when rendering animations");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_TOUCH, B_NOP, "Touch", 170, 142, 50, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Create an empty file before rendering each frame, remove if cancelled (and empty)");
- uiDefButBitI(block, TOG, R_NO_OVERWRITE, B_NOP, "No Overwrite", 220, 142, 90, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Skip rendering frames when the file exists (image output only)");
- uiBlockEndAlign(block);
-
- /* SET BUTTON */
- uiBlockBeginAlign(block);
- id= (ID *)G.scene->set;
- IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr));
- if(strp[0])
- uiDefButS(block, MENU, B_SETBROWSE, strp, 10, 114, 20, 20, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
- MEM_freeN(strp);
-
- if(G.scene->set) {
- uiSetButLock(1, NULL);
- uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, B_NOP, "", 31, 114, 100, 20, &(G.scene->set), "Name of the Set");
- uiClearButLock();
- uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 132, 114, 20, 20, 0, 0, 0, 0, 0, "Remove Set link");
- } else {
- uiDefBut(block, LABEL, 0, "No Set Scene", 31, 114, 200, 20, 0, 0, 0, 0, 0, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, TOGN, R_FIXED_THREADS, B_REDR, ICON_AUTO, 10, 63, 20, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Automatically set the threads to the number of processors on the system");
- if ((G.scene->r.mode & R_FIXED_THREADS)==0) {
- char thread_str[16];
- sprintf(thread_str, " Threads: %d", BLI_system_thread_count());
- uiDefBut(block, LABEL, 0, thread_str, 30, 63,80,20, 0, 0, 0, 0, 0, "");
- } else {
- uiDefButS(block, NUM, B_NOP, "Threads:", 30, 63, 80, 20, &G.scene->r.threads, 1, BLENDER_MAX_THREADS, 0, 0, "Amount of threads for render (takes advantage of multi-core and multi-processor computers)");
- }
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_AUTO);
-
- uiBlockBeginAlign(block);
- for(b=2; b>=0; b--)
- for(a=0; a<3; a++)
- uiDefButBitS(block, TOG, 1<<(3*b+a), 800,"", (short)(10+18*a),(short)(10+14*b),16,12, &G.winpos, 0, 0, 0, 0, "Render window placement on screen");
- uiBlockEndAlign(block);
-
-#ifdef WITH_OPENEXR
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_EXR_TILE_FILE, B_REDR, "Save Buffers", 72, 31, 120, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Save tiles for all RenderLayers and used SceneNodes to files in the temp directory (saves memory, allows Full Sampling)");
- if(G.scene->r.scemode & R_EXR_TILE_FILE)
- uiDefButBitI(block, TOG, R_FULL_SAMPLE, B_REDR, "FullSample", 192, 31, 118, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Saves for every OSA sample the entire RenderLayer results (Higher quality sampling but slower)");
- uiBlockEndAlign(block);
-#endif
-
- uiDefButS(block, MENU, B_REDR, "Render Display %t|Render Window %x1|Image Editor %x0|Full Screen %x2",
- 72, 10, 120, 19, &G.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output display");
-
- /* Dither control */
- uiDefButF(block, NUM,B_DIFF, "Dither:", 10,89,100,19, &G.scene->r.dither_intensity, 0.0, 2.0, 0, 0, "The amount of dithering noise present in the output image (0.0 = no dithering)");
-
- /* Toon shading buttons */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_EDGE, B_NOP,"Edge", 115, 89, 60, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon Edge-enhance");
- uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings", 175, 89, 135, 20, "Display Edge settings");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_NO_TEX, B_NOP, "Disable Tex", 115, 63, 75, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Disables Textures for render");
- uiDefButBitI(block, TOG, R_FREE_IMAGE, B_NOP, "Free Tex Images", 210, 63, 100, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Frees all Images used by Textures after each render");
- uiBlockEndAlign(block);
-}
-
-static void do_bake_func(void *unused_v, void *unused_p)
-{
- objects_bake_render_ui(0);
-}
-
-static void render_panel_bake(void)
-{
- uiBlock *block;
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_bake", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Anim", "Render");
- if(uiNewPanel(curarea, block, "Bake", "Render", 320, 0, 318, 204)==0) return;
-
- but= uiDefBut(block, BUT, B_NOP, "BAKE", 10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render for selected Objects");
- uiButSetFunc(but, do_bake_func, NULL, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, R_BAKE_TO_ACTIVE, B_DIFF, "Selected to Active", 10,120,190,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Bake shading on the surface of selected objects to the active object");
- uiDefButF(block, NUM, B_DIFF, "Dist:", 10,100,95,20,&G.scene->r.bake_maxdist, 0.0, 1000.0, 1, 0, "Maximum distance from active object to other object (in blender units)");
- uiDefButF(block, NUM, B_DIFF, "Bias:", 105,100,95,20,&G.scene->r.bake_biasdist, 0.0, 1000.0, 1, 0, "Bias towards faces further away from the object (in blender units)");
- uiBlockEndAlign(block);
-
- if(G.scene->r.bake_mode == RE_BAKE_NORMALS)
- uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3",
- 10,70,190,20, &G.scene->r.bake_normal_space, 0, 0, 0, 0, "Choose normal space for baking");
- else if(G.scene->r.bake_mode == RE_BAKE_AO || G.scene->r.bake_mode == RE_BAKE_DISPLACEMENT) {
- uiDefButBitS(block, TOG, R_BAKE_NORMALIZE, B_DIFF, "Normalized", 10,70,190,20, &G.scene->r.bake_flag, 0.0, 0, 0, 0,
- G.scene->r.bake_mode == RE_BAKE_AO ?
- "Bake ambient occlusion normalized, without taking into acount material settings":
- "Normalized displacement value to fit the 'Dist' range"
- );
- }
-
- uiDefButS(block, MENU, B_NOP, "Quad Split Order%t|Quad Split Auto%x0|Quad Split A (0,1,2) (0,2,3)%x1|Quad Split B (1,2,3) (1,3,0)%x2",
- 10,10,190,20, &G.scene->r.bake_quad_split, 0, 0, 0, 0, "Method to divide quads (use A or B for external applications that use a fixed order)");
-
-#if 0
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
- uiDefButS(block, ROW,B_DIFF,"5", 10,100,50,20,&G.scene->r.bake_osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
- uiDefButS(block, ROW,B_DIFF,"8", 60,100,45,20,&G.scene->r.bake_osa,2.0,8.0, 0, 0, "Sets oversample level to 8");
- uiDefButS(block, ROW,B_DIFF,"11", 105,100,45,20,&G.scene->r.bake_osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
- uiDefButS(block, ROW,B_DIFF,"16", 150,100,50,20,&G.scene->r.bake_osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
-#endif
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_REDR,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, "");
- uiDefButS(block, ROW,B_REDR,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, "");
- uiDefButS(block, ROW,B_REDR,"Shadow", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_SHADOW, 0, 0, "");
- uiDefButS(block, ROW,B_REDR,"Normals", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, "");
- uiDefButS(block, ROW,B_REDR,"Textures", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, "");
- uiDefButS(block, ROW,B_REDR,"Displacement", 210,70,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, "");
- uiBlockEndAlign(block);
-
- uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,40,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking");
-
- uiDefButS(block, NUM, B_DIFF,"Margin:", 210,10,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter");
-}
-
-static void render_panel_simplify(void)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_simplify", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Render", "Render");
- if(uiNewPanel(curarea, block, "Simplifcation", "Render", 320, 0, 318, 204)==0) return;
-
- uiDefButBitI(block, TOG, R_SIMPLIFY, B_DIFF,"Render Simplification", 10,150,190,20, &G.scene->r.mode, 0, 0, 0, 0, "Enable simplification of scene");
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM,B_DIFF, "Subsurf:", 10,120,190,20, &G.scene->r.simplify_subsurf, 0.0, 6.0, 0, 0, "Global maximum subsurf level percentage");
- uiDefButF(block, NUM,B_DIFF, "Child Particles:", 10,100,190,20, &G.scene->r.simplify_particles, 0.0, 1.0, 0, 0, "Global child particle percentage");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM,B_DIFF, "Shadow Samples:", 10,70,190,20, &G.scene->r.simplify_shadowsamples, 1.0, 16.0, 0, 0, "Global maximum shadow map samples");
- uiDefButF(block, NUM,B_DIFF, "AO and SSS:", 10,50,190,20, &G.scene->r.simplify_aosss, 0.0, 1.0, 0, 0, "Global approximate AO and SSS quality factor");
- uiBlockEndAlign(block);
-}
-
-static void render_panel_render(void)
-{
- uiBlock *block;
- char str[256];
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_DORENDER,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Render the current frame (F12)");
-#ifndef DISABLE_YAFRAY
- /* yafray: on request, render engine menu is back again, and moved to Render panel */
- uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0|YafRay %x1",
- 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");
-#else
- uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0",
- 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");
-#endif /* disable yafray */
-
- uiBlockBeginAlign(block);
- if((G.scene->r.scemode & R_FULL_SAMPLE) && (G.scene->r.scemode & R_EXR_TILE_FILE))
- uiDefButBitI(block, TOG, R_OSA, B_DIFF, "FSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Saves all samples, then composites, and then merges (for best Anti-aliasing)");
- else
- uiDefButBitI(block, TOG, R_OSA, B_DIFF, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
- uiDefButS(block, ROW,B_DIFF,"5", 369,88,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Render 5 samples per pixel for smooth edges (Fast)");
- uiDefButS(block, ROW,B_DIFF,"8", 400,88,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Render 8 samples per pixel for smooth edges (Recommended)");
- uiDefButS(block, ROW,B_DIFF,"11", 431,88,29,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Render 11 samples per pixel for smooth edges (High Quality)");
- uiDefButS(block, ROW,B_DIFF,"16", 462,88,29,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Render 16 samples per pixel for smooth edges (Highest Quality)");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_MBLUR, B_REDR, "MBLUR", 496,109,64,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
- uiDefButF(block, NUM,B_DIFF,"Bf:", 496,88,64,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 2, "Sets motion blur factor");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,46,95,29,&G.scene->r.xparts,1.0, 512.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)");
- uiDefButS(block, NUM,B_DIFF,"Yparts:", 465,46,95,29,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
- uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
- uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and color values remain unchanged");
- uiBlockEndAlign(block);
-
- uiDefButS(block, MENU, B_DIFF,"Octree resolution %t|64 %x64|128 %x128|256 %x256|512 %x512", 496,13,64,20,&G.scene->r.ocres,0.0,0.0, 0, 0, "Octree resolution for ray tracing and baking, Use higher values for complex scenes");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_SHADOW, B_REDR,"Shadow", 565,172,52,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
- uiDefButBitI(block, TOG, R_SSS, B_REDR,"SSS", 617,172,32,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable subsurface scattering map rendering");
- uiDefButBitI(block, TOG, R_PANORAMA, B_REDR,"Pano", 649,172,38,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
- uiDefButBitI(block, TOG, R_ENVMAP, B_REDR,"EnvMap", 565,142,52,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map rendering");
- uiDefButBitI(block, TOG, R_RAYTRACE, B_REDR,"Ray",617,142,32,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable ray tracing");
- uiDefButBitI(block, TOG, R_RADIO, B_REDR,"Radio", 649,142,38,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_DIFF,"100%", 565,109,122,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size");
- uiDefButS(block, ROW,B_DIFF,"75%", 565,88,40,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size");
- uiDefButS(block, ROW,B_DIFF,"50%", 606,88,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size");
- uiDefButS(block, ROW,B_DIFF,"25%", 647,88,40,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_FIELDS, B_REDR,"Fields", 565,55,60,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
- uiDefButBitI(block, TOG, R_ODDFIELD, B_REDR,"Odd", 627,55,39,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
- uiDefButBitI(block, TOG, R_FIELDSTILL, B_REDR,"X", 668,55,19,20,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
-
- sprintf(str, "Filter%%t|Box %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH);
- uiDefButS(block, MENU, B_DIFF,str, 565,34,60,20, &G.scene->r.filtertype, 0, 0, 0, 0, "Set sampling filter for antialiasing");
- uiDefButF(block, NUM,B_DIFF,"", 627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 10, 2, "Sets the filter size");
-
- uiDefButBitI(block, TOG, R_BORDER, REDRAWVIEWCAM, "Border", 565,13,122,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image (Shift+B to set in the camera view)");
- uiBlockEndAlign(block);
-
-}
-
-static void render_panel_anim(void)
-{
- uiBlock *block;
-
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Anim", "Render", 640, 0, 318, 204)==0) return;
-
-
- uiDefBut(block, BUT,B_DOANIM,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Render the animation to disk from start to end frame, (Ctrl+F12)");
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_DOSEQ, B_NOP, "Do Sequence",692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
- uiDefButBitI(block, TOG, R_DOCOMP, B_NOP, "Do Composite",692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Uses compositing nodes for output rendering");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefBut(block, BUT,B_PLAYANIM, "PLAY",692,50,94,33, 0, 0, 0, 0, 0, "Play rendered images/avi animation (Ctrl+F11), (Play Hotkeys: A-Noskip, P-PingPong)");
- uiDefButS(block, NUM, B_RTCHANGED, "rt:",789,50,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM,REDRAWSEQ,"Sta:",692,20,94,24, &G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation (inclusive)");
- uiDefButI(block, NUM,REDRAWSEQ,"End:",789,20,95,24, &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0, "The end frame of the animation (inclusive)");
- uiDefButI(block, NUM,REDRAWSEQ,"Step:",692,0,192,18, &G.scene->frame_step, 1.0, MAXFRAMEF, 0, 0, "Frame Step");
- uiBlockEndAlign(block);
-}
-
-#ifdef WITH_FFMPEG
-
-static void ffmpeg_property_del(void *type, void *prop_)
-{
- struct IDProperty *prop = (struct IDProperty *) prop_;
- IDProperty * group;
-
- if (!G.scene->r.ffcodecdata.properties) {
- return;
- }
-
- group = IDP_GetPropertyFromGroup(
- G.scene->r.ffcodecdata.properties, (char*) type);
- if (group && prop) {
- IDP_RemFromGroup(group, prop);
- IDP_FreeProperty(prop);
- MEM_freeN(prop);
- }
- allqueue(REDRAWBUTSSCENE, 0);
-}
-
-static IDProperty * ffmpeg_property_add(
- char * type, int opt_index, int parent_index)
-{
- AVCodecContext c;
- const AVOption * o;
- const AVOption * parent;
- IDProperty * group;
- IDProperty * prop;
- IDPropertyTemplate val;
- int idp_type;
- char name[256];
-
- avcodec_get_context_defaults(&c);
-
- o = c.av_class->option + opt_index;
- parent = c.av_class->option + parent_index;
-
- if (!G.scene->r.ffcodecdata.properties) {
- IDPropertyTemplate val;
-
- G.scene->r.ffcodecdata.properties
- = IDP_New(IDP_GROUP, val, "ffmpeg");
- }
-
- group = IDP_GetPropertyFromGroup(
- G.scene->r.ffcodecdata.properties, (char*) type);
-
- if (!group) {
- IDPropertyTemplate val;
-
- group = IDP_New(IDP_GROUP, val, (char*) type);
- IDP_AddToGroup(G.scene->r.ffcodecdata.properties, group);
- }
-
- if (parent_index) {
- sprintf(name, "%s:%s", parent->name, o->name);
- } else {
- strcpy(name, o->name);
- }
-
- fprintf(stderr, "ffmpeg_property_add: %s %d %d %s\n",
- type, parent_index, opt_index, name);
-
- prop = IDP_GetPropertyFromGroup(group, name);
- if (prop) {
- return prop;
- }
-
- switch (o->type) {
- case FF_OPT_TYPE_INT:
- case FF_OPT_TYPE_INT64:
- val.i = o->default_val;
- idp_type = IDP_INT;
- break;
- case FF_OPT_TYPE_DOUBLE:
- case FF_OPT_TYPE_FLOAT:
- val.f = o->default_val;
- idp_type = IDP_FLOAT;
- break;
- case FF_OPT_TYPE_STRING:
- val.str = " ";
- idp_type = IDP_STRING;
- break;
- case FF_OPT_TYPE_CONST:
- val.i = 1;
- idp_type = IDP_INT;
- break;
- default:
- return NULL;
- }
- prop = IDP_New(idp_type, val, name);
- IDP_AddToGroup(group, prop);
- return prop;
-}
-
-/* not all versions of ffmpeg include that, so here we go ... */
-
-static const AVOption *my_av_find_opt(void *v, const char *name,
- const char *unit, int mask, int flags){
- AVClass *c= *(AVClass**)v;
- const AVOption *o= c->option;
-
- for(;o && o->name; o++){
- if(!strcmp(o->name, name) &&
- (!unit || (o->unit && !strcmp(o->unit, unit))) &&
- (o->flags & mask) == flags )
- return o;
- }
- return NULL;
-}
-
-static int ffmpeg_property_add_string(const char * type, const char * str)
-{
- AVCodecContext c;
- const AVOption * o = 0;
- const AVOption * p = 0;
- char name_[128];
- char * name;
- char * param;
- IDProperty * prop;
-
- avcodec_get_context_defaults(&c);
-
- strncpy(name_, str, 128);
-
- name = name_;
- while (*name == ' ') name++;
-
- param = strchr(name, ':');
-
- if (!param) {
- param = strchr(name, ' ');
- }
- if (param) {
- *param++ = 0;
- while (*param == ' ') param++;
- }
-
- o = my_av_find_opt(&c, name, NULL, 0, 0);
- if (!o) {
- return FALSE;
- }
- if (param && o->type == FF_OPT_TYPE_CONST) {
- return FALSE;
- }
- if (param && o->type != FF_OPT_TYPE_CONST && o->unit) {
- p = my_av_find_opt(&c, param, o->unit, 0, 0);
- prop = ffmpeg_property_add(
- (char*) type, p - c.av_class->option,
- o - c.av_class->option);
- } else {
- prop = ffmpeg_property_add(
- (char*) type, o - c.av_class->option, 0);
- }
-
-
- if (!prop) {
- return FALSE;
- }
-
- if (param && !p) {
- switch (prop->type) {
- case IDP_INT:
- IDP_Int(prop) = atoi(param);
- break;
- case IDP_FLOAT:
- IDP_Float(prop) = atof(param);
- break;
- case IDP_STRING:
- strncpy(IDP_String(prop), param, prop->len);
- break;
- }
- }
- return TRUE;
-}
-
-static void ffmpeg_property_add_using_menu(void * type, int opt_indices)
-{
- int opt_index = opt_indices & 65535;
- int parent_index = opt_indices >> 16;
-
- ffmpeg_property_add((char*) type, opt_index, parent_index);
-
- allqueue(REDRAWBUTSSCENE, 0);
-}
-
-static uiBlock *ffmpeg_property_add_submenu(AVOption * parent, char * type)
-{
- AVCodecContext c;
- const AVOption * o;
- uiBlock *block;
- int yco = 0;
- int flags = 0;
- int parent_index = 0;
-
- if (strcmp(type, "audio") == 0) {
- flags = AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM;
- } else if (strcmp(type, "video") == 0) {
- flags = AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM;
- } else {
- return NULL;
- }
-
- block= uiNewBlock(&curarea->uiblocks, "ffmpeg_property_add_submenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, ffmpeg_property_add_using_menu, type);
-
- avcodec_get_context_defaults(&c);
-
- if (parent) {
- parent_index = (parent - c.av_class->option);
- }
-
- for(o = c.av_class->option; o && o->name; o++){
- if (o->help &&
- (strstr(o->help, "experimental")
- || strstr(o->help, "obsolete")
- || strstr(o->help, "useless")
- || strstr(o->help, "deprecated"))) {
- continue;
- }
- if((o->flags & flags) == flags) {
- if((!parent && !o->unit)
- || (o->unit && parent
- && strcmp(o->unit, parent->unit) == 0
- && o->type == FF_OPT_TYPE_CONST)) {
- uiDefBut(block, BUTM, B_REDR,
- (char*) (o->help && o->help[0] ?
- o->help : o->name),
- 0, yco, 160, 15,
- NULL, 0, 0, 1,
- (o - c.av_class->option) |
- (parent_index << 16),
- "");
- yco -= 16;
- }
- }
- }
-
- uiTextBoundsBlock(block, 50);
- uiBlockSetDirection(block, UI_RIGHT);
-
- return block;
-}
-
-static uiBlock *ffmpeg_property_add_submenu_audio(void* opt)
-{
- return ffmpeg_property_add_submenu((AVOption*) opt, "audio");
-}
-
-static uiBlock *ffmpeg_property_add_submenu_video(void* opt)
-{
- return ffmpeg_property_add_submenu((AVOption*) opt, "video");
-}
-
-static uiBlock *ffmpeg_property_add_menu(void* type_)
-{
- char * type = (char*) type_;
- AVCodecContext c;
- const AVOption * o;
- uiBlock *block;
- int yco = 0;
- int flags = 0;
- uiBlockFuncFP add_submenu = NULL;
-
- if (strcmp(type, "audio") == 0) {
- flags = AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM;
- add_submenu = ffmpeg_property_add_submenu_audio;
- } else if (strcmp(type, "video") == 0) {
- flags = AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM;
- add_submenu = ffmpeg_property_add_submenu_video;
- } else {
- return NULL;
- }
-
- block= uiNewBlock(&curarea->uiblocks, "ffmpeg_property_add_menu",
- UI_EMBOSSP, UI_HELV, curarea->win);
-
- avcodec_get_context_defaults(&c);
-
- for(o = c.av_class->option; o && o->name; o++){
- if((o->flags & flags) == flags) {
- if (o->type == FF_OPT_TYPE_CONST) {
- continue;
- }
- if (o->help &&
- (strstr(o->help, "experimental")
- || strstr(o->help, "obsolete")
- || strstr(o->help, "useless")
- || strstr(o->help, "deprecated"))) {
- continue;
- }
-
- if (o->unit) {
-
- uiDefIconTextBlockBut(
- block,
- add_submenu,
- (void*) o,
- ICON_RIGHTARROW_THIN,
- (char*) (o->help ?
- o->help : o->name),
- 0, yco, 160, 15, "");
- yco -= 16;
- }
- }
- }
-
- uiDefIconTextBlockBut(
- block,
- add_submenu,
- NULL,
- ICON_RIGHTARROW_THIN,
- "Value / string options",
- 0, yco, 160, 15, "");
-
- uiTextBoundsBlock(block, 50);
- uiBlockSetDirection(block, UI_DOWN);
-
- return block;
-}
-
-static int render_panel_ffmpeg_property_option(
- uiBlock *block, int xofs, int yofs, IDProperty * curr,
- const char * type)
-{
- AVCodecContext c;
- const AVOption * o;
- uiBut *but;
- char name[128];
- char * param;
-
- strcpy(name, curr->name);
- param = strchr(name, ':');
-
- if (param) {
- *param++ = 0;
- }
-
- avcodec_get_context_defaults(&c);
-
- o = my_av_find_opt(&c, param ? param : name, NULL, 0, 0);
- if (!o) {
- return yofs;
- }
-
- switch (curr->type) {
- case IDP_STRING:
- uiDefBut(block, TEX,
- B_REDR, curr->name,
- xofs,yofs, 200,19,
- IDP_String(curr),
- 0.0, curr->len - 1, 100, 0,
- (char*) o->help);
- break;
- case IDP_FLOAT:
- uiDefButF(block, NUM, B_REDR, curr->name,
- xofs, yofs, 200, 19,
- &IDP_Float(curr),
- o->min, o->max, 0, 0, (char*) o->help);
- break;
- case IDP_INT:
- if (o->type == FF_OPT_TYPE_CONST) {
- uiDefButBitI(block, TOG, 1, B_REDR,
- curr->name,
- xofs, yofs, 200, 19,
- &IDP_Int(curr),
- 0, 1, 0,0, (char*) o->help);
- } else {
- uiDefButI(block, NUM, B_REDR, curr->name,
- xofs, yofs, 200, 19,
- &IDP_Int(curr),
- o->min, o->max, 0, 0, (char*) o->help);
- }
- break;
- }
-
- but = uiDefIconBut(block, BUT, B_REDR, VICON_X,
- xofs + 220, yofs, 16, 16, NULL,
- 0.0, 0.0, 0.0, 0.0, "Delete property");
-
- uiButSetFunc(but, ffmpeg_property_del, (void*) type, curr);
-
- yofs -= 25;
-
- return yofs;
-}
-
-static int render_panel_ffmpeg_properties(uiBlock *block, const char * type,
- int xofs, int yofs)
-{
- short event = B_NOP;
-
- yofs -= 5;
-
- if (strcmp(type, "audio") == 0) {
- event = B_ADD_FFMPEG_AUDIO_OPTION;
- } else if (strcmp(type, "video") == 0) {
- event = B_ADD_FFMPEG_VIDEO_OPTION;
- }
-
- uiDefBut(block, TEX, event, "", xofs, yofs,
- 170, 19, ffmpeg_option_to_add, 0.0, 255.0, 100, 0,
- "FFMPEG option to add");
-
- uiDefBut(block, BUT, event, "Add", xofs+170,yofs,
- 30, 19, 0, 0, 0, 0, 0,
- "Add FFMPEG option");
-
- uiDefBlockBut(block, ffmpeg_property_add_menu, (void*) type,
- "Menu", xofs + 200, yofs, 40, 20,
- "Add FFMPEG option using menu");
- yofs -= 20;
-
- if (G.scene->r.ffcodecdata.properties) {
- IDProperty * prop;
- void * iter;
- IDProperty * curr;
-
- prop = IDP_GetPropertyFromGroup(
- G.scene->r.ffcodecdata.properties, (char*) type);
- if (prop) {
- iter = IDP_GetGroupIterator(prop);
-
- while ((curr = IDP_GroupIterNext(iter)) != NULL) {
- yofs = render_panel_ffmpeg_property_option(
- block, xofs, yofs, curr, type);
- }
- }
- }
-
- uiNewPanelHeight(block, 204-yofs);
-
- return yofs;
-}
-
-static void set_ffmpeg_preset(int preset)
-{
- int isntsc = (G.scene->r.frs_sec != 25);
- switch (preset) {
- case FFMPEG_PRESET_VCD:
- G.scene->r.ffcodecdata.type = FFMPEG_MPEG1;
- G.scene->r.ffcodecdata.video_bitrate = 1150;
- G.scene->r.xsch = 352;
- G.scene->r.ysch = isntsc ? 240 : 288;
- G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15;
- G.scene->r.ffcodecdata.rc_max_rate = 1150;
- G.scene->r.ffcodecdata.rc_min_rate = 1150;
- G.scene->r.ffcodecdata.rc_buffer_size = 40*8;
- G.scene->r.ffcodecdata.mux_packet_size = 2324;
- G.scene->r.ffcodecdata.mux_rate = 2352 * 75 * 8;
- break;
- case FFMPEG_PRESET_SVCD:
- G.scene->r.ffcodecdata.type = FFMPEG_MPEG2;
- G.scene->r.ffcodecdata.video_bitrate = 2040;
- G.scene->r.xsch = 480;
- G.scene->r.ysch = isntsc ? 480 : 576;
- G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15;
- G.scene->r.ffcodecdata.rc_max_rate = 2516;
- G.scene->r.ffcodecdata.rc_min_rate = 0;
- G.scene->r.ffcodecdata.rc_buffer_size = 224*8;
- G.scene->r.ffcodecdata.mux_packet_size = 2324;
- G.scene->r.ffcodecdata.mux_rate = 0;
-
- break;
- case FFMPEG_PRESET_DVD:
- G.scene->r.ffcodecdata.type = FFMPEG_MPEG2;
- G.scene->r.ffcodecdata.video_bitrate = 6000;
- G.scene->r.xsch = 720;
- G.scene->r.ysch = isntsc ? 480 : 576;
- G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15;
- G.scene->r.ffcodecdata.rc_max_rate = 9000;
- G.scene->r.ffcodecdata.rc_min_rate = 0;
- G.scene->r.ffcodecdata.rc_buffer_size = 224*8;
- G.scene->r.ffcodecdata.mux_packet_size = 2048;
- G.scene->r.ffcodecdata.mux_rate = 10080000;
-
- break;
- case FFMPEG_PRESET_DV:
- G.scene->r.ffcodecdata.type = FFMPEG_DV;
- G.scene->r.xsch = 720;
- G.scene->r.ysch = isntsc ? 480 : 576;
- break;
- case FFMPEG_PRESET_H264:
- G.scene->r.ffcodecdata.type = FFMPEG_AVI;
- G.scene->r.ffcodecdata.codec = CODEC_ID_H264;
- G.scene->r.ffcodecdata.video_bitrate = 6000;
- G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15;
- G.scene->r.ffcodecdata.rc_max_rate = 9000;
- G.scene->r.ffcodecdata.rc_min_rate = 0;
- G.scene->r.ffcodecdata.rc_buffer_size = 224*8;
- G.scene->r.ffcodecdata.mux_packet_size = 2048;
- G.scene->r.ffcodecdata.mux_rate = 10080000;
-
- ffmpeg_property_add_string("video", "coder:vlc");
- ffmpeg_property_add_string("video", "flags:loop");
- ffmpeg_property_add_string("video", "cmp:chroma");
- ffmpeg_property_add_string("video", "partitions:parti4x4");
- ffmpeg_property_add_string("video", "partitions:partp8x8");
- ffmpeg_property_add_string("video", "partitions:partb8x8");
- ffmpeg_property_add_string("video", "me:hex");
- ffmpeg_property_add_string("video", "subq:5");
- ffmpeg_property_add_string("video", "me_range:16");
- ffmpeg_property_add_string("video", "keyint_min:25");
- ffmpeg_property_add_string("video", "sc_threshold:40");
- ffmpeg_property_add_string("video", "i_qfactor:0.71");
- ffmpeg_property_add_string("video", "b_strategy:1");
-
- break;
- }
-}
-
-static void render_panel_ffmpeg_video(void)
-{
- uiBlock *block;
- int yofs;
- int xcol1;
- int xcol2;
-
- block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_video",
- UI_EMBOSS, UI_HELV, curarea->win);
-
- uiNewPanelTabbed("Format", "Render");
- if (uiNewPanel(curarea, block, "Video", "Render", 960, 0, 318, 204)== 0)
- return;
-
- if (ffmpeg_preset_sel != 0) {
- set_ffmpeg_preset(ffmpeg_preset_sel);
- ffmpeg_preset_sel = 0;
- allqueue(REDRAWBUTSSCENE, 0);
- }
-
- xcol1 = 872;
- xcol2 = 1002;
-
- yofs = 54;
- uiDefBut(block, LABEL, B_DIFF, "Format", xcol1, yofs+88,
- 110, 20, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, B_DIFF, "Preset", xcol2, yofs+88,
- 110, 20, 0, 0, 0, 0, 0, "");
- uiDefButI(block, MENU, B_DIFF, ffmpeg_format_pup(),
- xcol1, yofs+66, 110, 20, &G.scene->r.ffcodecdata.type,
- 0,0,0,0, "output file format");
- uiDefButI(block, NUM, B_DIFF, "Bitrate",
- xcol1, yofs+44, 110, 20,
- &G.scene->r.ffcodecdata.video_bitrate,
- 1, 14000, 0, 0, "Video bitrate(kb/s)");
- uiDefButI(block, NUM, B_DIFF, "Min Rate",
- xcol1, yofs+22, 110, 20,
- &G.scene->r.ffcodecdata.rc_min_rate,
- 0, G.scene->r.ffcodecdata.rc_max_rate,
- 0, 0, "Rate control: min rate(kb/s)");
- uiDefButI(block, NUM, B_DIFF, "Max Rate",
- xcol1, yofs, 110, 20, &G.scene->r.ffcodecdata.rc_max_rate,
- 1, 14000, 0, 0, "Rate control: max rate(kb/s)");
-
- uiDefButI(block, NUM, B_DIFF, "Mux Rate",
- xcol1, yofs-22, 110, 20,
- &G.scene->r.ffcodecdata.mux_rate,
- 0, 100000000, 0, 0, "Mux rate (bits/s(!))");
-
-
- uiDefButI(block, MENU, B_REDR, ffmpeg_preset_pup(),
- xcol2, yofs+66, 110, 20, &ffmpeg_preset_sel,
- 0,0,0,0, "Output file format preset selection");
- uiDefButI(block, NUM, B_DIFF, "GOP Size",
- xcol2, yofs+44, 110, 20, &G.scene->r.ffcodecdata.gop_size,
- 0, 100, 0, 0, "Distance between key frames");
- uiDefButI(block, NUM, B_DIFF, "Buffersize",
- xcol2, yofs+22, 110, 20,
- &G.scene->r.ffcodecdata.rc_buffer_size,
- 0, 2000, 0, 0, "Rate control: buffer size (kb)");
- uiDefButI(block, NUM, B_DIFF, "Mux PSize",
- xcol2, yofs, 110, 20,
- &G.scene->r.ffcodecdata.mux_packet_size,
- 0, 16384, 0, 0, "Mux packet size (byte)");
-
- uiDefButBitI(block, TOG, FFMPEG_AUTOSPLIT_OUTPUT, B_NOP,
- "Autosplit Output",
- xcol2, yofs-22, 110, 20,
- &G.scene->r.ffcodecdata.flags,
- 0, 1, 0,0, "Autosplit output at 2GB boundary.");
-
-
- if (ELEM4(G.scene->r.ffcodecdata.type, FFMPEG_AVI,
- FFMPEG_MOV, FFMPEG_MKV, FFMPEG_OGG)) {
- uiDefBut(block, LABEL, 0, "Codec",
- xcol1, yofs-44, 110, 20, 0, 0, 0, 0, 0, "");
- uiDefButI(block, MENU,B_REDR, ffmpeg_codec_pup(),
- xcol1, yofs-66, 110, 20,
- &G.scene->r.ffcodecdata.codec,
- 0,0,0,0, "FFMpeg codec to use");
- }
-
- render_panel_ffmpeg_properties(block, "video", xcol1, yofs-86);
-}
-
-static void render_panel_ffmpeg_audio(void)
-{
- uiBlock *block;
- int yofs;
- int xcol;
-
- block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_audio", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Format", "Render");
- if (uiNewPanel(curarea, block, "Audio", "Render", 960, 0, 318, 204) == 0) return;
-
- yofs = 54;
- xcol = 892;
-
- uiDefButBitI(block, TOG, FFMPEG_MULTIPLEX_AUDIO, B_NOP,
- "Multiplex audio", xcol, yofs, 225, 20,
- &G.scene->r.ffcodecdata.flags,
- 0, 1, 0,0, "Interleave audio with the output video");
- uiDefBut(block, LABEL, 0, "Codec",
- xcol, yofs-22, 225, 20, 0, 0, 0, 0, 0, "");
- uiDefButI(block, MENU,B_NOP, ffmpeg_audio_codec_pup(),
- xcol, yofs-44, 225, 20,
- &G.scene->r.ffcodecdata.audio_codec,
- 0,0,0,0, "FFMpeg codec to use");
- uiDefButI(block, NUM, B_DIFF, "Bitrate",
- xcol, yofs-66, 110, 20,
- &G.scene->r.ffcodecdata.audio_bitrate,
- 32, 384, 0, 0, "Audio bitrate(kb/s)");
-
- render_panel_ffmpeg_properties(block, "audio", xcol, yofs-86);
-}
-#endif
-
-static void render_panel_stamp(void)
-{
- uiBlock *block;
- int yofs=0, xofs=550;
-
- block= uiNewBlock (&curarea->uiblocks, "render_panel_stamp", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed ("Format", "Render");
- if(uiNewPanel (curarea, block, "Stamp", "Render", 960, 0, 318, 204)==0) return;
-
- if (G.scene->r.scemode & R_STAMP_INFO) {
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data");
- uiDefBut(block, TEX, B_NOP, "", xofs+120, yofs, 180, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note");
- uiBlockEndAlign(block);
- yofs += 30; /* gap */
-
-
- yofs += 80;
- /* Order is important for alligning ... grr */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, R_STAMP_FILENAME, B_REDR, "Filename", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp blend filename");
- yofs -= 20;
- uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name");
- uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name");
- yofs -= 20;
- uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)");
- uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date");
- yofs -= 20;
- uiDefButBitI(block, TOG, R_STAMP_FRAME, B_REDR, "Frame", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp frame number");
- uiDefButBitI(block, TOG, R_STAMP_MARKER, B_REDR, "Marker", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the last marker");
- yofs -= 20;
- uiDefButBitI(block, TOG, R_STAMP_SEQSTRIP, B_REDR, "Sequence Strip", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the forground sequence strip name");
- uiBlockEndAlign(block);
- yofs += 80;
-
- /* draw font selector */
- if (G.scene->r.stamp & R_STAMP_DRAW) {
- uiDefButS(block, MENU, B_REDR, "Stamp Font Size%t|Tiny Text%x1|Small Text%x2|Medium Text%x3|Large Text%x0|Extra Large Text%x4|",
- xofs+130, yofs, 170, 19, &G.scene->r.stamp_font_id, 0, 0, 0, 0, "Choose stamp text size");
-
- /* draw fg/bg next to the scene */
- yofs -= 25;
- uiDefBut(block, LABEL, B_NOP, "Text Color", xofs+130, yofs, 70, 19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, B_NOP, "Background", xofs+215, yofs, 70, 19, 0, 0, 0, 0, 0, "");
- yofs -= 20;
- uiDefButF(block, COL, B_NOP, "", xofs+130, yofs, 80, 19, G.scene->r.fg_stamp, 0, 0, 0, 0, "Foreground text color");
- uiDefButF(block, COL, B_NOP, "", xofs+220, yofs, 80, 19, G.scene->r.bg_stamp, 0, 0, 0, 0, "Background color");
- yofs -= 30;
- uiDefButF(block, NUMSLI, B_NOP, "A ", xofs+130, yofs, 170, 19, &G.scene->r.bg_stamp[3], 0, 1.0, 0, 0, "Alpha for text background");
- yofs += 105;
- } else {
- yofs += 30;
- }
-
- uiDefButBitI(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, yofs, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Disable stamp info in images metadata");
- uiDefButBitI(block, TOG, R_STAMP_DRAW, B_REDR, "Draw Stamp", xofs+130, yofs, 170, 20, &G.scene->r.stamp, 0, 0, 0, 0, "Draw the stamp info into each frame");
- yofs += 20;
- }
- else {
- uiDefButBitI(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, 142, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Enable stamp info to image metadata");
- yofs += 20;
- uiDefBut(block, LABEL, 0, "", xofs, yofs, 300, 19, 0, 0, 0, 0, 0, "");
- }
-}
-
-static void render_panel_format(void)
-{
- uiBlock *block;
- int yofs;
-
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Format", "Render", 960, 0, 318, 204)==0) return;
- uiDefBlockBut(block, framing_render_menu, NULL,
- "Game framing settings",
- 892, 169, 227, 20, "Display game framing settings");
- /* uiDefIconTextBlockBut(block, framing_render_menu, NULL,
- ICON_BLOCKBUT_CORNER,
- "Game framing settings",
- 892, 169, 227, 20,
- "Display game framing settings"); */
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeX:", 892 ,136,112,27, &G.scene->r.xsch, 4.0, 10000.0, 0, 0, "The image width in pixels");
- uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines");
-
- uiDefButF(block, NUM, REDRAWVIEWCAM, "AspX:",
- 892 ,114,112,20,
- &G.scene->r.xasp,
- 1, 200, 100, 2,
- "Horizontal Aspect Ratio");
- uiDefButF(block, NUM, REDRAWVIEWCAM, "AspY:",
- 1007,114,112,20,
- &G.scene->r.yasp,
- 1, 200, 100, 2,
- "Vertical Aspect Ratio");
-
- uiBlockEndAlign(block);
-
- yofs = 54;
-
-#ifdef __sgi
- yofs = 76;
- uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
- uiDefButBitI(block, TOG, R_COSMO, 0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
-#endif
-
- uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format");
- uiDefButBitI(block, TOG, R_CROP, B_DIFF, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "When Border render, the resulting image gets cropped");
-
- yofs -= 22;
-
- if(G.scene->r.quality==0) G.scene->r.quality= 90;
-
- if (G.scene->r.imtype == R_AVICODEC || G.scene->r.imtype == R_QUICKTIME) {
- if(G.scene->r.imtype == R_QUICKTIME) {
-#ifdef WITH_QUICKTIME
-#if defined (_WIN32) || defined (__APPLE__)
- //glColor3f(0.65, 0.65, 0.7);
- //glRecti(892,yofs+46,892+225,yofs+45+20);
- if(G.scene->r.qtcodecdata == NULL)
- uiDefBut(block, LABEL, 0, "Codec: not set", 892,yofs+44,225,20, 0, 0, 0, 0, 0, "");
- else
- uiDefBut(block, LABEL, 0, G.scene->r.qtcodecdata->qtcodecname, 892,yofs+44,225,20, 0, 0, 0, 0, 0, "");
- uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime");
-#endif
-#endif /* WITH_QUICKTIME */
- } else {
-#ifdef _WIN32
- //glColor3f(0.65, 0.65, 0.7);
- //glRecti(892,yofs+46,892+225,yofs+45+20);
- if(G.scene->r.avicodecdata == NULL)
- uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+43,225,20, 0, 0, 0, 0, 0, "");
- else
- uiDefBut(block, LABEL, 0, avicodec_str(), 892,yofs+43,225,20, 0, 0, 0, 0, 0, "");
-#endif
- uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for AVI");
- }
-#ifdef WITH_OPENEXR
- }
- else if (ELEM(G.scene->r.imtype, R_OPENEXR, R_MULTILAYER)) {
- if (G.scene->r.quality > 5) G.scene->r.quality = 2;
-
- if(G.scene->r.imtype==R_OPENEXR) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_NOP,"Half", 892,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Use 16 bit floats instead of 32 bit floats per channel");
- uiDefButBitS(block, TOG, R_OPENEXR_ZBUF, B_NOP,"Zbuf", 952,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save the z-depth per pixel (32 bit unsigned int zbuffer)");
- uiBlockEndAlign(block);
- uiDefButBitS(block, TOG, R_PREVIEW_JPG, B_NOP,"Preview",1027,yofs+44,90,20, &G.scene->r.subimtype, 0, 0, 0, 0, "When animation render, save JPG preview images in same directory");
- }
- uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",
- 892,yofs,74,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR");
-
-#endif
- } else if (G.scene->r.imtype == R_DPX || G.scene->r.imtype == R_CINEON) {
- uiDefButBitS(block, TOG, R_CINEON_LOG, B_REDR, "Log", 892,yofs,74,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Convert to log color space");
-
- if(G.scene->r.subimtype & R_CINEON_LOG) {
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NOP, "B", 892,yofs+44,80,20, &G.scene->r.cineonblack, 0, 1024, 0, 0, "Log conversion reference black");
- uiDefButS(block, NUM, B_NOP, "W", 972,yofs+44,80,20, &G.scene->r.cineonwhite, 0, 1024, 0, 0, "Log conversion reference white");
- uiDefButF(block, NUM, B_NOP, "G", 1052,yofs+44,70,20, &G.scene->r.cineongamma, 0.0f, 10.0f, 1, 2, "Log conversion gamma");
- uiBlockEndAlign(block);
- }
- } else if (G.scene->r.imtype == R_TIFF) {
- uiDefButBitS(block, TOG, R_TIFF_16BIT, B_REDR, "16 Bit", 892,yofs,74,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save 16 bit per channel TIFF");
- } else {
- if(G.scene->r.quality < 5) G.scene->r.quality = 90; /* restore from openexr */
-
- uiDefButS(block, NUM,B_DIFF, "Q:", 892,yofs,74,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies");
- }
- uiDefButS(block, NUM,B_FRAMEMAP,"FPS:", 968,yofs,75,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
- uiDefButF(block, NUM,B_FRAMEMAP,"/", 1043,yofs,75,20, &G.scene->r.frs_sec_base, 1.0, 120.0, 0.1, 3, "Frames per second base");
-
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data");
- uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data");
- uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,19, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_PR_PAL, "PAL", 1146,170,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps");
- uiDefBut(block, BUT,B_PR_NTSC, "NTSC", 1146,150,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps");
- uiDefBut(block, BUT,B_PR_PRESET, "Default", 1146,130,100,18, 0, 0, 0, 0, 0, "Same as PAL, with render settings (OSA, Shadows, Fields)");
- uiDefBut(block, BUT,B_PR_PRV, "Preview", 1146,110,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x512, Render size 50%");
- uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100");
- uiDefBut(block, BUT,B_PR_PAL169, "PAL 16:9",1146,70,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 64x45");
- uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings");
- uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1");
- uiDefBut(block, BUT,B_PR_HD, "HD", 1146,10,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1920x1080, Aspect ratio - 1x1");
- uiBlockEndAlign(block);
-}
-
-#ifndef DISABLE_YAFRAY /* disable yafray stuff */
-/* yafray: global illumination options panel */
-static void render_panel_yafrayGI()
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGI", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Render", "Render");
- if(uiNewPanel(curarea, block, "YafRay GI", "Render", 320, 0, 318, 204)==0) return;
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
-
- uiDefBut(block, LABEL, 0, "Method", 5,175,70,20, 0, 1.0, 0, 0, 0, "");
- uiDefButS(block, MENU, B_REDR, "GiMethod %t|None %x0|SkyDome %x1|Full %x2", 70,175,89,20, &G.scene->r.GImethod, 0, 0, 0, 0, "Global Illumination Method");
-
- uiDefBut(block, LABEL, 0, "Quality", 5,150,70,20, 0, 1.0, 0, 0, 0, "");
- uiDefButS(block, MENU, B_REDR, "GiQuality %t|None %x0|Low %x1|Medium %x2 |High %x3|Higher %x4|Best %x5|Use Blender AO settings %x6", 70,150,89,20, &G.scene->r.GIquality, 0, 0, 0, 0, "Global Illumination Quality");
-
- if (G.scene->r.GImethod>0) {
- uiDefButF(block, NUM, B_DIFF, "EmitPwr:", 5,35,154,20, &G.scene->r.GIpower, 0.01, 100.0, 10, 0, "arealight, material emit and background intensity scaling, 1 is normal");
- if (G.scene->r.GImethod==2) uiDefButF(block, NUM, B_DIFF, "GI Pwr:", 5,10,154,20, &G.scene->r.GIindirpower, 0.01, 100.0, 10, 0, "GI indirect lighting intensity scaling, 1 is normal");
- }
-
- if (G.scene->r.GImethod>0)
- {
- if (G.scene->r.GIdepth==0) G.scene->r.GIdepth=2;
-
- if (G.scene->r.GImethod==2) {
- uiDefButI(block, NUM, B_DIFF, "Depth:", 180,175,110,20, &G.scene->r.GIdepth, 1.0, 100.0, 10, 10, "Number of bounces of the indirect light");
- uiDefButI(block, NUM, B_DIFF, "CDepth:", 180,150,110,20, &G.scene->r.GIcausdepth, 1.0, 100.0, 10, 10, "Number of bounces inside objects (for caustics)");
- uiDefButBitS(block, TOG, 1, B_REDR, "Photons",210,125,100,20, &G.scene->r.GIphotons, 0, 0, 0, 0, "Use global photons to help in GI");
- }
-
- uiDefButBitS(block, TOG, 1, B_REDR, "Cache",6,125,95,20, &G.scene->r.GIcache, 0, 0, 0, 0, "Cache occlusion/irradiance samples (faster)");
- if (G.scene->r.GIcache)
- {
- uiDefButBitS(block,TOG, 1, B_REDR, "NoBump",108,125,95,20, &G.scene->r.YF_nobump, 0, 0, 0, 0, "Don't use bumpnormals for cache (faster, but no bumpmapping in total indirectly lit areas)");
- uiDefBut(block, LABEL, 0, "Cache parameters:", 5,105,130,20, 0, 1.0, 0, 0, 0, "");
- if (G.scene->r.GIshadowquality==0.0) G.scene->r.GIshadowquality=0.9;
- uiDefButF(block, NUM, B_DIFF,"ShadQu:", 5,85,154,20, &(G.scene->r.GIshadowquality), 0.01, 1.0 ,1,0, "Sets the shadow quality, keep it under 0.95 :-) ");
- if (G.scene->r.GIpixelspersample==0) G.scene->r.GIpixelspersample=10;
- uiDefButI(block, NUM, B_DIFF, "Prec:", 5,60,75,20, &G.scene->r.GIpixelspersample, 1, 50, 10, 10, "Maximum number of pixels without samples, the lower the better and slower");
- if (G.scene->r.GIrefinement==0) G.scene->r.GIrefinement=1.0;
- uiDefButF(block, NUM, B_DIFF, "Ref:", 84,60,75,20, &G.scene->r.GIrefinement, 0.001, 1.0, 1, 0, "Threshold to refine shadows EXPERIMENTAL. 1 = no refinement");
- }
-
- if (G.scene->r.GImethod==2) {
- if (G.scene->r.GIphotons)
- {
- uiDefBut(block, LABEL, 0, "Photon parameters:", 170,105,130,20, 0, 1.0, 0, 0, 0, "");
- if(G.scene->r.GIphotoncount==0) G.scene->r.GIphotoncount=100000;
- uiDefButI(block, NUM, B_DIFF, "Count:", 170,85,140,20, &G.scene->r.GIphotoncount,
- 0, 10000000, 10, 10, "Number of photons to shoot");
- if(G.scene->r.GIphotonradius==0.0) G.scene->r.GIphotonradius=1.0;
- uiDefButF(block, NUMSLI, B_DIFF,"Radius:", 170,60,140,20, &(G.scene->r.GIphotonradius),
- 0.00001, 100.0 ,0,0, "Radius to search for photons to mix (blur)");
- if(G.scene->r.GImixphotons==0) G.scene->r.GImixphotons=100;
- uiDefButI(block, NUM, B_DIFF, "MixCount:", 170,35,140,20, &G.scene->r.GImixphotons,
- 0, 1000, 10, 10, "Number of photons to mix");
- uiDefButBitS(block, TOG, 1, B_REDR, "Tune Photons",170,10,140,20, &G.scene->r.GIdirect,
- 0, 0, 0, 0, "Show the photonmap directly in the render for tuning");
- }
- }
-
- }
-}
-
-/* yafray: global options panel */
-static void render_panel_yafrayGlobal()
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGlobal", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Render", "Render");
- if(uiNewPanel(curarea, block, "YafRay", "Render", 320, 0, 318, 204)==0) return;
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
-
- uiDefButBitS(block, TOGN, 1, B_REDR, "xml", 5,180,75,20, &G.scene->r.YFexportxml,
- 0, 0, 0, 0, "Export to an xml file and call yafray instead of plugin");
-
- uiDefButF(block, NUMSLI, B_DIFF,"Bi ", 5,35,150,20, &(G.scene->r.YF_raybias),
- 0.0, 10.0 ,0,0, "Shadow ray bias to avoid self shadowing");
- uiDefButI(block, NUM, B_DIFF, "Raydepth ", 5,60,150,20,
- &G.scene->r.YF_raydepth, 1.0, 80.0, 10, 10, "Maximum render ray depth from the camera");
- uiDefButF(block, NUMSLI, B_DIFF, "Gam ", 5,10,150,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off");
- uiDefButF(block, NUMSLI, B_DIFF, "Exp ", 160,10,150,20,&G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off");
-
- /*AA Settings*/
- uiDefButBitS(block, TOGN, 1, B_REDR, "Auto AA", 5,140,150,20, &G.scene->r.YF_AA,
- 0, 0, 0, 0, "Set AA using OSA and GI quality, disable for manual control");
- uiDefButBitS(block, TOGN, 1, B_DIFF, "Clamp RGB", 160,140,150,20, &G.scene->r.YF_clamprgb, 1.0, 8.0, 10, 10, "For AA on fast high contrast changes. Not advisable for Bokeh! Dulls lens shape detail.");
- if(G.scene->r.YF_AA){
- uiDefButI(block, NUM, B_DIFF, "AA Passes ", 5,115,150,20, &G.scene->r.YF_AApasses, 0, 64, 10, 10, "Number of AA passes (0 is no AA)");
- uiDefButI(block, NUM, B_DIFF, "AA Samples ", 160,115,150,20, &G.scene->r.YF_AAsamples, 0, 2048, 10, 10, "Number of samples per pass");
- uiDefButF(block, NUMSLI, B_DIFF, "Psz ", 5,90,150,20, &G.scene->r.YF_AApixelsize, 1.0, 2.0, 0, 0, "AA pixel filter size");
- uiDefButF(block, NUMSLI, B_DIFF, "Thr ", 160,90,150,20, &G.scene->r.YF_AAthreshold, 0.000001, 1.0, 0, 0, "AA threshold");
- }
-}
-#endif /* disable yafray stuff */
-
-static void layer_copy_func(void *lay_v, void *lay_p)
-{
- unsigned int *lay= lay_p;
- int laybit= GET_INT_FROM_POINTER(lay_v);
-
- if(G.qual & (LR_SHIFTKEY|LR_CTRLKEY)) {
- if(*lay==0) *lay= 1<<laybit;
- }
- else
- *lay= 1<<laybit;
-
- copy_view3d_lock(REDRAW);
- allqueue(REDRAWBUTSSCENE, 0);
-}
-
-static void delete_scene_layer_func(void *srl_v, void *act_i)
-{
- if(BLI_countlist(&G.scene->r.layers)>1) {
- intptr_t act= (intptr_t)act_i;
-
- BLI_remlink(&G.scene->r.layers, srl_v);
- MEM_freeN(srl_v);
- G.scene->r.actlay= 0;
-
- if(G.scene->nodetree) {
- bNode *node;
- for(node= G.scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==act)
- node->custom1= 0;
- else if(node->custom1>act)
- node->custom1--;
- }
- }
- }
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWNODE, 0);
- }
-}
-
-static void rename_scene_layer_func(void *srl_v, void *unused_v)
-{
- if(G.scene->nodetree) {
- SceneRenderLayer *srl= srl_v;
- bNode *node;
- for(node= G.scene->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- if(node->custom1==G.scene->r.actlay)
- BLI_strncpy(node->name, srl->name, NODE_MAXSTR);
- }
- }
- }
- allqueue(REDRAWBUTSSCENE, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNODE, 0);
-}
-
-static char *scene_layer_menu(void)
-{
- SceneRenderLayer *srl;
- int len= 32 + 32*BLI_countlist(&G.scene->r.layers);
- short a, nr;
- char *str= MEM_callocN(len, "menu layers");
-
- strcpy(str, "ADD NEW %x32767");
- a= strlen(str);
- for(nr=0, srl= G.scene->r.layers.first; srl; srl= srl->next, nr++) {
- if(srl->layflag & SCE_LAY_DISABLE)
- a+= sprintf(str+a, "|%s %%i%d %%x%d", srl->name, ICON_BLANK1, nr);
- else
- a+= sprintf(str+a, "|%s %%i%d %%x%d", srl->name, ICON_CHECKBOX_HLT, nr);
- }
-
- return str;
-}
-
-static void draw_3d_layer_buttons(uiBlock *block, int type, unsigned int *poin, short xco, short yco, short dx, short dy, char *tip)
-{
- uiBut *bt;
- intptr_t a;
-
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++) {
- bt= uiDefButBitI(block, type, 1<<a, B_NOP, "", (short)(xco+a*(dx/2)), yco+dy/2, (short)(dx/2), (short)(dy/2), (int *)poin, 0, 0, 0, 0, tip);
- uiButSetFunc(bt, layer_copy_func, (void *)a, poin);
- }
- for(a=0; a<5; a++) {
- bt=uiDefButBitI(block, type, 1<<(a+10), B_NOP, "", (short)(xco+a*(dx/2)), yco, (short)(dx/2), (short)(dy/2), (int *)poin, 0, 0, 0, 0, tip);
- uiButSetFunc(bt, layer_copy_func, (void *)(a+10), poin);
- }
-
- xco+= 7;
- uiBlockBeginAlign(block);
- for(a=5; a<10; a++) {
- bt=uiDefButBitI(block, type, 1<<a, B_NOP, "", (short)(xco+a*(dx/2)), yco+dy/2, (short)(dx/2), (short)(dy/2), (int *)poin, 0, 0, 0, 0, tip);
- uiButSetFunc(bt, layer_copy_func, (void *)a, poin);
- }
- for(a=5; a<10; a++) {
- bt=uiDefButBitI(block, type, 1<<(a+10), B_NOP, "", (short)(xco+a*(dx/2)), yco, (short)(dx/2), (short)(dy/2), (int *)poin, 0, 0, 0, 0, tip);
- uiButSetFunc(bt, layer_copy_func, (void *)(a+10), poin);
- }
-
- uiBlockEndAlign(block);
-}
-
-static void render_panel_layers(void)
-{
- uiBlock *block;
- uiBut *bt;
- SceneRenderLayer *srl= BLI_findlink(&G.scene->r.layers, G.scene->r.actlay);
- char *strp;
-
- if(srl==NULL) {
- G.scene->r.actlay= 0;
- srl= G.scene->r.layers.first;
- }
-
- block= uiNewBlock(&curarea->uiblocks, "render_panel_layers", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Output", "Render");
- if(uiNewPanel(curarea, block, "Render Layers", "Render", 320, 0, 318, 204)==0) return;
-
- /* first, as reminder, the scene layers */
- uiDefBut(block, LABEL, 0, "Scene:", 10,170,100,20, NULL, 0, 0, 0, 0, "");
- draw_3d_layer_buttons(block, TOG, &G.scene->lay, 130, 170, 35, 30, "Scene layers to render");
-
- /* layer disable, menu, name, delete button */
- uiBlockBeginAlign(block);
- uiDefIconButBitI(block, ICONTOGN, SCE_LAY_DISABLE, B_REDR, ICON_CHECKBOX_HLT-1, 10, 145, 20, 20, &srl->layflag, 0.0, 0.0, 0, 0, "Disable or enable this RenderLayer");
- strp= scene_layer_menu();
- uiDefButS(block, MENU, B_ADD_RENDERLAYER, strp, 30,145,23,20, &(G.scene->r.actlay), 0, 0, 0, 0, "Choose Active Render Layer");
- MEM_freeN(strp);
-
- /* name max 20, exr format limit... */
- bt= uiDefBut(block, TEX, REDRAWNODE, "", 53,145,172,20, srl->name, 0.0, 20.0, 0, 0, "");
- uiButSetFunc(bt, rename_scene_layer_func, srl, NULL);
-
- uiDefButBitI(block, TOG, R_SINGLE_LAYER, B_NOP, "Single", 230,145,60,20, &G.scene->r.scemode, 0, 0, 0, 0, "Only render this layer");
- bt=uiDefIconBut(block, BUT, B_NOP, ICON_X, 285, 145, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer");
- uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(intptr_t)G.scene->r.actlay);
- uiBlockEndAlign(block);
-
- /* RenderLayer visible-layers */
- uiDefBut(block, LABEL, 0, "Layer:", 10,110,100,20, NULL, 0, 0, 0, 0, "");
- draw_3d_layer_buttons(block, BUT_TOGDUAL, &srl->lay, 130,110, 35, 30, "Scene-layers included in this render-layer (Hold CTRL for Z-mask)");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SCE_LAY_ZMASK, B_REDR,"Zmask", 10, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Only render what's in front of the solid z values");
- if(srl->layflag & SCE_LAY_ZMASK)
- uiDefButBitI(block, TOG, SCE_LAY_NEG_ZMASK, B_NOP,"Neg", 10, 65, 40, 20, &srl->layflag, 0, 0, 0, 0, "For Zmask, only render what is behind solid z values instead of in front");
- else
- uiDefButBitI(block, TOG, SCE_LAY_ALL_Z, B_NOP,"AllZ", 10, 65, 40, 20, &srl->layflag, 0, 0, 0, 0, "Fill in Z values for solid faces in invisible layers, for masking");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SCE_LAY_SOLID, B_NOP,"Solid", 50, 85, 45, 20, &srl->layflag, 0, 0, 0, 0, "Render Solid faces in this Layer");
- uiDefButBitI(block, TOG, SCE_LAY_HALO, B_NOP,"Halo", 95, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Halos in this Layer (on top of Solid)");
- uiDefButBitI(block, TOG, SCE_LAY_ZTRA, B_NOP,"Ztra", 135, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
- uiDefButBitI(block, TOG, SCE_LAY_SKY, B_NOP,"Sky", 175, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Sky or backbuffer in this Layer");
- uiDefButBitI(block, TOG, SCE_LAY_EDGE, B_NOP,"Edge", 215, 85, 45, 20, &srl->layflag, 0, 0, 0, 0, "Render Edge-enhance in this Layer (only works for Solid faces)");
- uiDefButBitI(block, TOG, SCE_LAY_STRAND, B_NOP,"Strand",260, 85, 50, 20, &srl->layflag, 0, 0, 0, 0, "Render Strands in this Layer");
-
- uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_SET_PASS, "Light:", 50, 65, 130, 20, &(srl->light_override), "Name of Group to use as Lamps instead");
- uiDefIDPoinBut(block, test_matpoin_but, ID_MA, B_SET_PASS, "Mat:", 180, 65, 130, 20, &(srl->mat_override), "Name of Material to use as Materials instead");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, SCE_PASS_COMBINED, B_SET_PASS,"Combined", 10, 30, 80, 20, &srl->passflag, 0, 0, 0, 0, "Deliver full combined RGBA buffer");
- uiDefButBitI(block, TOG, SCE_PASS_Z, B_SET_PASS,"Z", 90, 30, 30, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Z values pass");
- uiDefButBitI(block, TOG, SCE_PASS_VECTOR, B_SET_PASS,"Vec", 120, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Speed Vector pass");
- uiDefButBitI(block, TOG, SCE_PASS_NORMAL, B_SET_PASS,"Nor", 160, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Normal pass");
- uiDefButBitI(block, TOG, SCE_PASS_UV, B_SET_PASS,"UV", 200, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Texture UV pass");
- uiDefButBitI(block, TOG, SCE_PASS_MIST, B_SET_PASS,"Mist", 240, 30, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Mist factor pass (0-1)");
- uiDefButBitI(block, TOG, SCE_PASS_INDEXOB, B_SET_PASS,"Index", 275, 30, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Object Index pass");
-
- uiDefButBitI(block, TOG, SCE_PASS_RGBA, B_SET_PASS,"Col", 10, 10, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver shade-less Color pass");
- uiDefButBitI(block, TOG, SCE_PASS_DIFFUSE, B_SET_PASS,"Diff", 45, 10, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Diffuse pass");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_SPEC, B_SET_PASS,"Spec", 80, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Specular pass (Hold Ctrl to exclude from combined)");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_SHADOW, B_SET_PASS,"Shad", 120, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Shadow pass (Hold Ctrl to exclude from combined)");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_AO, B_SET_PASS,"AO", 160, 10, 30, 20, &srl->passflag, 0, 0, 0, 0, "Deliver AO pass (Hold Ctrl to exclude from combined)");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_REFLECT, B_SET_PASS,"Refl", 190, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Reflection pass (Hold Ctrl to exclude from combined)");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_REFRACT, B_SET_PASS,"Refr", 230, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Refraction pass (Hold Ctrl to exclude from combined)");
- uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_RADIO, B_SET_PASS,"Rad", 270, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Radiosity pass (Hold Ctrl to exclude from combined)");
-}
-
-void render_panels()
-{
-
- render_panel_output();
- render_panel_layers();
- render_panel_render();
- if(G.rt == 1) render_panel_simplify();
- render_panel_anim();
- render_panel_bake();
-
- render_panel_format();
- render_panel_stamp();
-#ifdef WITH_FFMPEG
- if (G.scene->r.imtype == R_FFMPEG) {
- render_panel_ffmpeg_video();
- render_panel_ffmpeg_audio();
- }
-#endif
-
-#ifndef DISABLE_YAFRAY
- /* yafray: GI & Global panel, only available when yafray enabled for rendering */
- if (G.scene->r.renderer==R_YAFRAY) {
- if (G.scene->r.YF_gamma==0.0) G.scene->r.YF_gamma=1.0;
- if (G.scene->r.YF_raybias==0.0) G.scene->r.YF_raybias=0.001;
- if (G.scene->r.YF_raydepth==0) G.scene->r.YF_raydepth=5;
- if (G.scene->r.YF_AApixelsize==0.0) G.scene->r.YF_AApixelsize=1.5;
- if (G.scene->r.YF_AAthreshold==0.0) G.scene->r.YF_AAthreshold=0.05;
- if (G.scene->r.GIpower==0.0) G.scene->r.GIpower=1.0;
- if (G.scene->r.GIindirpower==0.0) G.scene->r.GIindirpower=1.0;
- render_panel_yafrayGlobal();
- render_panel_yafrayGI();
- }
-#endif
-
-}
-
-/* --------------------------------------------- */
-
-void anim_panels()
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "anim_panel", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Anim", "Anim", 0, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM,B_FRAMEMAP,"Map Old:", 10,160,150,20,&G.scene->r.framapto,1.0,900.0, 0, 0, "Specify old mapping value in frames");
- uiDefButI(block, NUM,B_FRAMEMAP,"Map New:", 160,160,150,20,&G.scene->r.images,1.0,900.0, 0, 0, "Specify how many frames the Map Old will last");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM,B_FRAMEMAP,"FPS:", 10,130,75,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
- uiDefButF(block, NUM,B_FRAMEMAP,"/", 85,130,75,20, &G.scene->r.frs_sec_base, 1.0, 120.0, 0.1, 3, "Frames per second base");
-
- uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync",160,130,150,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
-
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM,REDRAWALL,"Sta:", 10,100,150,20,&G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "Specify the start frame of the animation");
- uiDefButI(block, NUM,REDRAWALL,"End:", 160,100,150,20,&G.scene->r.efra,1.0,MAXFRAMEF, 0, 0, "Specify the end frame of the animation");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, REDRAWTIME, "Steps:",10, 70, 150, 20,&(G.scene->jumpframe), 1, 100, 1, 100, "Set spacing between frames changes with up and down arrow keys");
-
-
-}
-
-/* --------------------------------------------- */
-
-void sound_panels()
-{
- bSound *sound;
-
- /* paranoia check */
- sound = G.buts->lockpoin;
- if(sound && GS(sound->id.name)!=ID_SO) {
- sound= NULL;
- G.buts->lockpoin= NULL;
- }
-
- sound_panel_sound(sound);
- sound_panel_listener();
- sound_panel_sequencer();
-}
-
-
-
diff --git a/source/blender/src/buttons_script.c b/source/blender/src/buttons_script.c
deleted file mode 100644
index 4ae4eab8825..00000000000
--- a/source/blender/src/buttons_script.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_group_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_radio_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_text_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_sound.h"
-#include "BKE_texture.h"
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "BSE_filesel.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-
-#include "BIF_butspace.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "butspace.h"
-
-/* ************************ function prototypes ********************** */
-void draw_scriptlink(uiBlock *, ScriptLink *, int , int , int ) ;
-
-/* *************************** SCRIPT ******************************** */
-
-static void extend_scriptlink(ScriptLink *slink)
-{
- void *stmp, *ftmp;
-
- if (!slink) return;
-
- stmp= slink->scripts;
- slink->scripts= MEM_mallocN(sizeof(ID*)*(slink->totscript+1), "scriptlistL");
-
- ftmp= slink->flag;
- slink->flag= MEM_mallocN(sizeof(short*)*(slink->totscript+1), "scriptlistF");
-
- if (slink->totscript) {
- memcpy(slink->scripts, stmp, sizeof(ID*)*(slink->totscript));
- MEM_freeN(stmp);
-
- memcpy(slink->flag, ftmp, sizeof(short)*(slink->totscript));
- MEM_freeN(ftmp);
- }
-
- slink->scripts[slink->totscript]= NULL;
- slink->flag[slink->totscript]= SCRIPT_FRAMECHANGED;
-
- slink->totscript++;
- slink->actscript = slink->totscript;
-}
-
-static void delete_scriptlink(ScriptLink *slink)
-{
- int i;
-
- if (!slink) return;
-
- if (slink->totscript>0) {
- for (i=slink->actscript-1; i<slink->totscript-1; i++) {
- slink->flag[i]= slink->flag[i+1];
- slink->scripts[i]= slink->scripts[i+1];
- }
-
- slink->totscript--;
- }
-
- CLAMP(slink->actscript, 1, slink->totscript);
-
- if (slink->totscript==0) {
- if (slink->scripts) MEM_freeN(slink->scripts);
- if (slink->flag) MEM_freeN(slink->flag);
-
- slink->scripts= NULL;
- slink->flag= NULL;
- slink->totscript= slink->actscript= 0;
- }
-}
-
-static char *scriptlinks_menu_string(void)
-{
- char *menu = NULL;
- DynStr *ds = BLI_dynstr_new();
- Text *text = G.main->text.first;
- int txtcounter = 0;
-
- if (text) {
- BLI_dynstr_append(ds, "Select Script Link%t");
- while (text) {
- BLI_dynstr_append(ds, "|");
- BLI_dynstr_append(ds, text->id.name+2);
- txtcounter += 1;
- text = text->id.next;
- }
- if (txtcounter) menu = BLI_dynstr_get_cstring(ds);
- }
- BLI_dynstr_free(ds);
- return menu;
-}
-
-static void scriptlinks_pupmenu(ScriptLink *slink)
-{
- short menuitem;
- char *menustr = scriptlinks_menu_string();
-
- if (!slink) return;
-
- if (menustr) {
- menuitem = pupmenu_col(menustr, 20);
- MEM_freeN(menustr);
- if (menuitem > 0) {
- Text *text = G.main->text.first;
- while (--menuitem) text = text->id.next;
- if (text) slink->scripts[slink->totscript - 1]= (ID *)text;
- }
- }
-}
-
-void do_scriptbuts(unsigned short event)
-{
- Object *ob=NULL;
- ScriptLink *slink=NULL;
- Material *ma;
-
- switch (event) {
- case B_SSCRIPT_ADD:
- slink = &G.scene->scriptlink;
- extend_scriptlink(slink);
- BIF_undo_push("Add scriptlink");
- scriptlinks_pupmenu(slink);
- break;
- case B_SSCRIPT_DEL:
- BIF_undo_push("Delete scriptlink");
- delete_scriptlink(&G.scene->scriptlink);
- break;
-
- case B_SCRIPT_ADD:
- case B_SCRIPT_DEL:
- ob= OBACT;
-
- if (ob && G.buts->scriptblock==ID_OB) {
- slink= &ob->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_MA) {
- ma= give_current_material(ob, ob->actcol);
- if (ma) slink= &ma->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_CA) {
- if (ob->type==OB_CAMERA)
- slink= &((Camera *)ob->data)->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_LA) {
- if (ob->type==OB_LAMP)
- slink= &((Lamp *)ob->data)->scriptlink;
-
- } else if (G.buts->scriptblock==ID_WO) {
- if (G.scene->world)
- slink= &(G.scene->world->scriptlink);
- }
-
- if (event==B_SCRIPT_ADD) {
- extend_scriptlink(slink);
- BIF_undo_push("Add scriptlink");
- scriptlinks_pupmenu(slink);
- }
- else {
- delete_scriptlink(slink);
- BIF_undo_push("Delete scriptlink");
- }
- break;
- default:
- break;
- }
-
- allqueue(REDRAWBUTSSCRIPT, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-void draw_scriptlink(uiBlock *block, ScriptLink *script, int sx, int sy, int idcode)
-{
- char str[256];
-
- if (script->totscript) {
- strcpy(str, "FrameChanged%x 1|");
- strcat(str, "Redraw%x 4|");
- strcat(str, "Render%x 16|");
- if (idcode==ID_SCE) {
- strcat(str, "OnLoad%x 2|");
- strcat(str, "OnSave%x 8");
- } else {
- strcat(str, "ObjectUpdate%x 64|");
- strcat(str, "ObDataUpdate%x 128");
- }
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, 1, str, (short)sx, (short)sy, 140, 19, &script->flag[script->actscript-1], 0, 0, 0, 0, "Script links for this event");
-
- uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", (short)(sx+140),(short)sy, 140, 19, &script->scripts[script->actscript-1], "Name of Script to link");
- uiBlockEndAlign(block);
- }
-
- sprintf(str,"%d Scr:", script->totscript);
-
- uiDefButS(block, NUM, REDRAWBUTSSCRIPT, str, (short)(sx+140), (short)sy-20,60,19, &script->actscript, 1, script->totscript, 0, 0, "Total / Active Script link (LeftMouse + Drag to change)");
-
- if (idcode==ID_SCE) {
-
- if (script->totscript<32767)
- uiDefBut(block, BUT, B_SSCRIPT_ADD, "New", (short)(sx+240), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Add a new Script link");
- if (script->totscript)
- uiDefBut(block, BUT, B_SSCRIPT_DEL, "Del", (short)(sx+200), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Delete the current Script link");
- uiDefBut(block, LABEL, 0, "Scene Script link", sx,sy-20,140,20, 0, 0, 0, 0, 0, "");
- }
- else {
- if (script->totscript<32767)
- uiDefBut(block, BUT, B_SCRIPT_ADD, "New", (short)(sx+240), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Add a new Script link");
- if (script->totscript)
- uiDefBut(block, BUT, B_SCRIPT_DEL, "Del", (short)(sx+200), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Delete the current Script link");
- uiDefBut(block, LABEL, 0, "Selected Script link", sx,sy-20,140,20, 0, 0, 0, 0, 0, "");
-
- }
-
-}
-
-/* ************************************* */
-
-static void script_panel_scriptlink(void)
-{
- uiBlock *block;
- Object *ob=NULL;
- ScriptLink *script=NULL;
- Material *ma;
- int xco = 10;
-
- block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return;
-
- uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT,
- "Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0,
- "Enable execution of all assigned Script links and Space Handelers");
- /* for proper alignment: */
- uiDefBut(block, LABEL, 0, "", 160, 200,150,20, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.f & G_DOSCRIPTLINKS) {
- //uiBlockBeginAlign(block);
- ob= OBACT;
- if(ob)
- uiDefIconButS(block, ROW, B_REDR, ICON_OBJECT, xco,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_OB, 0, 0, "Displays Object script links");
-
- if(ob && give_current_material(ob, ob->actcol))
- uiDefIconButS(block, ROW, B_REDR, ICON_MATERIAL, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_MA, 0, 0, "Displays Material script links ");
-
- if(G.scene->world)
- uiDefIconButS(block, ROW, B_REDR, ICON_WORLD, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_WO, 0, 0, "Displays World script links");
-
- if(ob && ob->type==OB_CAMERA)
- uiDefIconButS(block, ROW, B_REDR, ICON_CAMERA, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_CA, 0, 0, "Displays Camera script links");
-
- if(ob && ob->type==OB_LAMP)
- uiDefIconButS(block, ROW, B_REDR, ICON_LAMP, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_LA, 0, 0, "Displays Lamp script links");
- //uiBlockEndAlign(block);
-
- if (ob && G.buts->scriptblock==ID_OB) {
- script= &ob->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_MA) {
- ma= give_current_material(ob, ob->actcol);
- if (ma) script= &ma->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_CA) {
- if (ob->type==OB_CAMERA)
- script= &((Camera *)ob->data)->scriptlink;
-
- } else if (ob && G.buts->scriptblock==ID_LA) {
- if (ob->type==OB_LAMP)
- script= &((Lamp *)ob->data)->scriptlink;
-
- } else if (G.buts->scriptblock==ID_WO) {
- if (G.scene->world)
- script= &(G.scene->world->scriptlink);
- }
-
- if (script) draw_scriptlink(block, script, 10, 140, 0);
-
- draw_scriptlink(block, &G.scene->scriptlink, 10, 80, ID_SCE);
- }
-}
-
-
-
-
-void script_panels()
-{
- script_panel_scriptlink();
-
-}
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
deleted file mode 100644
index 6c1eff29072..00000000000
--- a/source/blender/src/buttons_shading.c
+++ /dev/null
@@ -1,4654 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: not all of this file anymore. :)
- *
- * Contributor(s):
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <time.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_brush_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_node_types.h"
-#include "DNA_packedFile_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_radio_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_colortools.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_particle.h"
-#include "BKE_utildefines.h"
-#include "BKE_texture.h"
-
-#include "BKE_packedFile.h"
-#include "BKE_plugin_types.h"
-#include "BKE_image.h"
-
-#include "BLI_blenlib.h"
-#include "BMF_Api.h"
-
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-
-#include "BDR_drawmesh.h"
-
-#include "BIF_drawimage.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_glutil.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_previewrender.h"
-#include "BIF_butspace.h"
-#include "BIF_writeimage.h"
-#include "BIF_toets.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "radio.h"
-
-#include "RE_pipeline.h"
-
-#include "GPU_material.h"
-
-/* -----includes for this file specific----- */
-
-#include "butspace.h" // own module
-
-
-static MTex emptytex;
-static int packdummy = 0;
-
-static char *mapto_blendtype_pup(void)
-{
- static char formatstr[] = "|%s %%x%d";
- static char string[1024];
- char *str = string;
-
- str += sprintf(str, formatstr, "Mix", MTEX_BLEND);
-
- str += sprintf(str, formatstr, "Add", MTEX_ADD);
- str += sprintf(str, formatstr, "Subtract", MTEX_SUB);
-
- str += sprintf(str, formatstr, "Multiply", MTEX_MUL);
- str += sprintf(str, formatstr, "Screen", MTEX_SCREEN);
- str += sprintf(str, formatstr, "Overlay", MTEX_OVERLAY);
-
- str += sprintf(str, formatstr, "Difference", MTEX_DIFF);
- str += sprintf(str, formatstr, "Divide", MTEX_DIV);
-
- str += sprintf(str, formatstr, "Darken", MTEX_DARK);
- str += sprintf(str, formatstr, "Lighten", MTEX_LIGHT);
-
- str += sprintf(str, formatstr, "Hue", MTEX_BLEND_HUE);
- str += sprintf(str, formatstr, "Saturation", MTEX_BLEND_SAT);
- str += sprintf(str, formatstr, "Value", MTEX_BLEND_VAL);
- str += sprintf(str, formatstr, "Color", MTEX_BLEND_COLOR);
-
- return string;
-}
-
-void shade_buttons_change_3d(void)
-{
- Object *ob= OBACT;
- ScrArea *sa;
-
- if(ob==NULL) return;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- View3D *v3d= sa->spacedata.first;
-
- if(v3d->drawtype >= OB_SOLID) addqueue(sa->win, REDRAW, 0);
- if(v3d->drawtype == OB_SHADED) {
- if(ob->type==OB_LAMP) reshadeall_displist();
- else {
- /* all objects using material */
- Base *base= FIRSTBASE;
- Material *ma= give_current_material(ob, ob->actcol);
- int a;
-
- while(base) {
- if(base->lay & G.vd->lay) {
- for(a=1; a<=ob->totcol; a++) {
- if(ma == give_current_material(base->object, a)) {
- freedisplist(&(base->object->disp));
- break;
- }
- }
- }
- base= base->next;
- }
- }
- }
- }
- }
-}
-
-/* *************************** TEXTURE ******************************** */
-
-static void load_image_cb(char *str, void *ima_pp_v, void *iuser_v) /* called from fileselect or button */
-{
- Image **ima_pp= (Image **)ima_pp_v;
- Image *ima= NULL;
-
- ima= BKE_add_image_file(str);
- if(ima) {
- if(*ima_pp) {
- (*ima_pp)->id.us--;
- }
- *ima_pp= ima;
-
- BKE_image_signal(ima, iuser_v, IMA_SIGNAL_RELOAD);
-
- /* button event gets lost when it goes via filewindow */
- if(G.buts && G.buts->lockpoin) {
- Tex *tex= G.buts->lockpoin;
- if(GS(tex->id.name)==ID_TE) {
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- }
- }
- }
-
- BIF_undo_push("Load image");
-}
-
-static void load_plugin_tex(char *str, void *tex_v, void *unused) /* called from fileselect */
-{
- Tex *tex= tex_v;
-
- if(tex->type!=TEX_PLUGIN) return;
-
- if(tex->plugin) free_plugin_tex(tex->plugin);
-
- tex->stype= 0;
- tex->plugin= add_plugin_tex(str);
-
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
-}
-
-static void save_env(char *name)
-{
- Tex *tex;
- char str[FILE_MAX];
-
- strcpy(str, name);
- BLI_convertstringcode(str, G.sce);
- tex= G.buts->lockpoin;
-
- if(tex && GS(tex->id.name)==ID_TE) {
- if(tex->env && tex->env->ok && saveover(str)) {
- waitcursor(1);
- BIF_save_envmap(tex->env, str);
- strcpy(G.ima, name);
- waitcursor(0);
- }
- }
-
-}
-
-static int vergcband(const void *a1, const void *a2)
-{
- const CBData *x1=a1, *x2=a2;
-
- if( x1->pos > x2->pos ) return 1;
- else if( x1->pos < x2->pos) return -1;
- return 0;
-}
-
-void do_texbuts(unsigned short event)
-{
- Tex *tex;
- ScrArea *sa;
- char str[FILE_MAX];
-
- tex= G.buts->lockpoin;
-
- switch(event) {
- case B_TEXPRV:
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
-
- if(tex && G.scene->nodetree) {
- NodeTagIDChanged(G.scene->nodetree, &tex->id);
- allqueue(RECALC_COMPOSITE, 0);
- }
- break;
- case B_TEXCHANNEL:
- scrarea_queue_headredraw(curarea);
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- if(G.buts->texfrom == 3) /* brush texture */
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_TEXTYPE:
- if(tex==NULL) return;
- tex->stype= 0;
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
-
- if(tex && G.scene->nodetree) {
- NodeTagIDChanged(G.scene->nodetree, &tex->id);
- allqueue(RECALC_COMPOSITE, 0);
- }
- break;
- case B_DEFTEXVAR:
- if(tex==NULL) return;
- default_tex(tex);
- BIF_undo_push("Default texture vars");
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- break;
-
- case B_IMAGECHANGED:
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
-
- if(tex) {
- if(G.scene->nodetree) {
- NodeTagIDChanged(G.scene->nodetree, &tex->id);
- allqueue(RECALC_COMPOSITE, 0);
- }
- if(tex->ima && (tex->imaflag & TEX_MIPMAP) && (tex->ima->flag & IMA_FIELDS)) {
- error("Cannot combine fields and mipmap");
- tex->imaflag -= TEX_MIPMAP;
- }
- if(tex->env)
- BKE_free_envmapdata(tex->env);
- }
-
- break;
-
- case B_TEXREDR_PRV:
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- shade_buttons_change_3d();
- break;
-
-
- case B_LOADPLUGIN:
- if(tex==NULL) return;
-
- sa= closest_bigger_area();
- areawinset(sa->win);
- if(tex->plugin) strcpy(str, tex->plugin->name);
- else {
- strcpy(str, U.plugtexdir);
- }
- activate_fileselect_args(FILE_SPECIAL, "SELECT PLUGIN", str, load_plugin_tex, tex, NULL);
-
- break;
-
- case B_NAMEPLUGIN:
- if(tex==NULL || tex->plugin==NULL) return;
- strcpy(str, tex->plugin->name);
- free_plugin_tex(tex->plugin);
- tex->stype= 0;
- tex->plugin= add_plugin_tex(str);
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- break;
-
- case B_COLORBAND:
- if(tex==NULL) return;
- if(tex->coba==NULL) tex->coba= add_colorband(0);
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE); // also ramps, so we do this
- break;
-
- case B_ENV_DELETE:
- if(tex->env) {
- BKE_free_envmap(tex->env);
- tex->env= 0;
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- }
- break;
- case B_ENV_FREE:
- if(tex->env) {
- BKE_free_envmapdata(tex->env);
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- }
- break;
- case B_ENV_FREE_ALL:
- tex= G.main->tex.first;
- while(tex) {
- if(tex->id.us && tex->type==TEX_ENVMAP) {
- if(tex->env) {
- if(tex->env->stype!=ENV_LOAD) BKE_free_envmapdata(tex->env);
- }
- }
- tex= tex->id.next;
- }
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_TE);
- break;
- case B_ENV_SAVE:
- if(tex->env && tex->env->ok) {
- if(tex->env->type==ENV_PLANE) {
- notice("Sorry, not implemented yet");
- }
- else {
- sa= closest_bigger_area();
- areawinset(sa->win);
- save_image_filesel_str(str);
- activate_fileselect(FILE_SPECIAL, str, G.ima, save_env);
- }
- }
- break;
- case B_ENV_OB:
- if(tex->env && tex->env->object) {
- BIF_preview_changed(ID_TE);
- if ELEM(tex->env->object->type, OB_CAMERA, OB_LAMP) {
- error("Camera or Lamp not allowed");
- tex->env->object= NULL;
- }
- }
- break;
- case B_TEX_USENODES:
- if(tex->use_nodes && tex->nodetree==NULL) {
- node_texture_default(tex);
- }
- tex->type = 0;
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- break;
-
- default:
- if(event>=B_PLUGBUT && event<=B_PLUGBUT+23) {
- PluginTex *pit= tex->plugin;
- if(pit && pit->callback) {
- pit->callback(event - B_PLUGBUT);
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
- }
- }
- }
-}
-
-static void texture_panel_plugin(Tex *tex)
-{
- uiBlock *block;
- VarStruct *varstr;
- PluginTex *pit;
- short xco, yco, a;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_plugin", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Plugin", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- if(tex->plugin && tex->plugin->doit) {
-
- pit= tex->plugin;
-
- for(a=0; a<pit->stypes; a++) {
- uiDefButS(block, ROW, B_TEXREDR_PRV, pit->stnames+16*a, (76*a), 152, 75, 20, &tex->stype, 2.0, (float)a, 0, 0, "");
- }
-
- varstr= pit->varstr;
- if(varstr) {
- for(a=0; a<pit->vars; a++, varstr++) {
- xco= 140*(a/6)+1;
- yco= 125 - 20*(a % 6)+1;
- uiDefBut(block, varstr->type, B_PLUGBUT+a, varstr->name, xco,yco,137,19, &(pit->data[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
- }
- }
- uiDefBut(block, TEX, B_NAMEPLUGIN, "", 0,180,318,24, pit->name, 0.0, 159.0, 0, 0, "");
- }
-
- uiDefBut(block, BUT, B_LOADPLUGIN, "Load Plugin", 0,204,137,24, 0, 0, 0, 0, 0, "");
-
-}
-
-
-static void texture_panel_magic(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Magic", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_TEXPRV, "Depth:", 10, 90, 150, 19, &tex->noisedepth, 0.0, 10.0, 0, 0, "Sets the depth of the pattern");
- uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the strength of the pattern");
-}
-
-static void texture_panel_blend(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_blend", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Blend", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Lin", 10, 180, 75, 19, &tex->stype, 2.0, (float)TEX_LIN, 0, 0, "Creates a linear progresion");
- uiDefButS(block, ROW, B_TEXPRV, "Quad", 85, 180, 75, 19, &tex->stype, 2.0, (float)TEX_QUAD, 0, 0, "Creates a quadratic progression");
- uiDefButS(block, ROW, B_TEXPRV, "Ease", 160, 180, 75, 19, &tex->stype, 2.0, (float)TEX_EASE, 0, 0, "Creates a progression easing from one step to the next");
- uiDefButBitS(block, TOG, TEX_FLIPBLEND, B_TEXPRV, "Flip XY", 235, 180, 75, 19, &tex->flag, 0, 0, 0, 0, "Flips the direction of the progression 90 degrees");
-
- uiDefButS(block, ROW, B_TEXPRV, "Diag", 10, 160, 75, 19, &tex->stype, 2.0, (float)TEX_DIAG, 0, 0, "Use a diagonal progression");
- uiDefButS(block, ROW, B_TEXPRV, "Sphere", 85, 160, 75, 19, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere");
- uiDefButS(block, ROW, B_TEXPRV, "Halo", 160, 160, 75, 19, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere");
- uiDefButS(block, ROW, B_TEXPRV, "Radial", 235, 160, 75, 19, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression");
-
-}
-
-/* newnoise: noisebasis menu string */
-static char* noisebasis_menu()
-{
- static char nbmenu[256];
- sprintf(nbmenu, "Noise Basis %%t|Blender Original %%x%d|Original Perlin %%x%d|Improved Perlin %%x%d|Voronoi F1 %%x%d|Voronoi F2 %%x%d|Voronoi F3 %%x%d|Voronoi F4 %%x%d|Voronoi F2-F1 %%x%d|Voronoi Crackle %%x%d|CellNoise %%x%d", TEX_BLENDER, TEX_STDPERLIN, TEX_NEWPERLIN, TEX_VORONOI_F1, TEX_VORONOI_F2, TEX_VORONOI_F3, TEX_VORONOI_F4, TEX_VORONOI_F2F1, TEX_VORONOI_CRACKLE, TEX_CELLNOISE);
- return nbmenu;
-}
-
-static void texture_panel_wood(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_wood", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Wood", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Bands", 10, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BAND, 0, 0, "Uses standard wood texture in bands");
- uiDefButS(block, ROW, B_TEXPRV, "Rings", 85, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RING, 0, 0, "Uses wood texture in rings");
- uiDefButS(block, ROW, B_TEXPRV, "BandNoise", 160, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BANDNOISE, 0, 0, "Adds noise to standard wood");
- uiDefButS(block, ROW, B_TEXPRV, "RingNoise", 235, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RINGNOISE, 0, 0, "Adds noise to rings");
-
- uiDefButS(block, ROW, B_TEXPRV, "Sin", 10, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SIN, 0, 0, "Uses a sine wave to produce bands");
- uiDefButS(block, ROW, B_TEXPRV, "Saw", 60, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SAW, 0, 0, "Uses a saw wave to produce bands");
- uiDefButS(block, ROW, B_TEXPRV, "Tri", 110, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_TRI, 0, 0, "Uses a triangle wave to produce bands");
- uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 160, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 235, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 160, 130, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the bandnoise and ringnoise types");
- uiBlockEndAlign(block);
-
- /* newnoise: noisebasis menu */
- uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
-}
-
-static void texture_panel_stucci(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_stucci", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Stucci", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Plastic", 10, 180, 100, 19, &tex->stype, 2.0, (float)TEX_PLASTIC, 0, 0, "Uses standard stucci");
- uiDefButS(block, ROW, B_TEXPRV, "Wall In", 110, 180, 100, 19, &tex->stype, 2.0, (float)TEX_WALLIN, 0, 0, "Creates Dimples");
- uiDefButS(block, ROW, B_TEXPRV, "Wall Out", 210, 180, 100, 19, &tex->stype, 2.0, (float)TEX_WALLOUT, 0, 0, "Creates Ridges");
-
- uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 10, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 160, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 90, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the depth of the stucci");
- uiBlockEndAlign(block);
-
- /* newnoise: noisebasis menu */
- uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
- // note, nabla not supported here!
-// uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
-}
-
-static void texture_panel_marble(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_marble", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Marble", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Soft", 10, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SOFT, 0, 0, "Uses soft marble");
- uiDefButS(block, ROW, B_TEXPRV, "Sharp", 110, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SHARP, 0, 0, "Uses more clearly defined marble");
- uiDefButS(block, ROW, B_TEXPRV, "Sharper", 210, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SHARPER, 0, 0, "Uses very clearly defined marble");
-
- uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 10, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 160, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
-
- uiDefButS(block, ROW, B_TEXPRV, "Sin", 10, 140, 100, 18, &tex->noisebasis2, 8.0, 0.0, 0, 0, "Uses a sine wave to produce bands.");
- uiDefButS(block, ROW, B_TEXPRV, "Saw", 110, 140, 100, 18, &tex->noisebasis2, 8.0, 1.0, 0, 0, "Uses a saw wave to produce bands");
- uiDefButS(block, ROW, B_TEXPRV, "Tri", 210, 140, 100, 18, &tex->noisebasis2, 8.0, 2.0, 0, 0, "Uses a triangle wave to produce bands");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiDefButS(block, NUM, B_TEXPRV, "NoiseDepth:", 10, 90, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Sets the depth of the marble calculation");
- uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the sine bands");
- uiBlockEndAlign(block);
-
- /* newnoise: noisebasis menu */
- uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
-}
-
-static void texture_panel_clouds(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_clouds", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Clouds", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Default", 10, 180, 70, 18, &tex->stype, 2.0, (float)TEX_DEFAULT, 0, 0, "Uses standard noise");
- uiDefButS(block, ROW, B_TEXPRV, "Color", 80, 180, 70, 18, &tex->stype, 2.0, (float)TEX_COLOR, 0, 0, "Lets Noise return RGB value");
- uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 155, 180, 75, 18, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 230, 180, 80, 18, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiDefButS(block, NUM, B_TEXPRV, "NoiseDepth:", 160, 130, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Sets the depth of the cloud calculation");
- uiBlockEndAlign(block);
-
- /* newnoise: noisebasis menu */
- uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
-}
-
-/*****************************************/
-/* newnoise: panel(s) for musgrave types */
-/*****************************************/
-
-static void texture_panel_musgrave(Tex *tex)
-{
- uiBlock *block;
- char *str;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_musgrave", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Musgrave", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* TEX_MFRACTAL, TEX_RIDGEDMF, TEX_HYBRIDMF, TEX_FBM, TEX_HTERRAIN */
- str= "Multifractal %x0|Ridged Multifractal %x1|Hybrid Multifractal %x2|Hetero Terrain %x4|fBm %x3";
- uiDefButS(block, MENU, B_TEXREDR_PRV, str, 10, 160, 150, 19, &tex->stype, 0.0, 0.0, 0, 0, "Sets Musgrave type");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_TEXPRV, "H: ", 10, 130, 150, 19, &tex->mg_H, 0.0001, 2.0, 10, 0, "Sets the highest fractal dimension");
- uiDefButF(block, NUMSLI, B_TEXPRV, "Lacu: ", 160, 130, 150, 19, &tex->mg_lacunarity, 0.0, 6.0, 10, 0, "Sets the gap between succesive frequencies");
- uiDefButF(block, NUMSLI, B_TEXPRV, "Octs: ", 10, 110, 150, 19, &tex->mg_octaves, 0.0, 8.0, 10, 0, "Sets the number of frequencies used");
- if ((tex->stype==TEX_RIDGEDMF) || (tex->stype==TEX_HYBRIDMF) || (tex->stype==TEX_HTERRAIN)) {
- uiDefButF(block, NUMSLI, B_TEXPRV, "Ofst: ", 160, 110, 150, 19, &tex->mg_offset, 0.0, 6.0, 10, 0, "Sets the fractal offset");
- if ((tex->stype==TEX_RIDGEDMF) || (tex->stype==TEX_HYBRIDMF))
- uiDefButF(block, NUMSLI, B_TEXPRV, "Gain: ", 10, 90, 150, 19, &tex->mg_gain, 0.0, 6.0, 10, 0, "Sets the gain multiplier");
- }
-
- uiBlockBeginAlign(block);
- /* noise output scale */
- uiDefButF(block, NUM, B_TEXPRV, "iScale: ", 10, 60, 150, 19, &tex->ns_outscale, 0.0, 10.0, 10, 0, "Scales intensity output");
- /* frequency scale */
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize: ", 160, 60, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiBlockEndAlign(block);
-
- /* noisebasis menu */
- uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
-}
-
-
-static void texture_panel_distnoise(Tex *tex)
-{
- uiBlock *block;
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_distnoise", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Distorted Noise", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockBeginAlign(block);
- /* distortion amount */
- uiDefButF(block, NUM, B_TEXPRV, "DistAmnt: ", 10, 130, 150, 19, &tex->dist_amount, 0.0, 10.0, 10, 0, "Sets amount of distortion");
- /* frequency scale */
- uiDefButF(block, NUM, B_TEXPRV, "NoiseSize: ", 160, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Distortion Noise", 10, 100, 150, 19, 0, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Noise Basis", 160, 100, 150, 19, 0, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- /* noisebasis used for the distortion */
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 80, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis which does the distortion");
- /* noisebasis to distort */
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 160, 80, 150, 19, &tex->noisebasis2, 0,0,0,0, "Sets the noise basis to distort");
- uiBlockEndAlign(block);
-
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 10, 50, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-}
-
-
-static void texture_panel_voronoi(Tex *tex)
-{
- char dm_menu[256];
- uiBlock *block;
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_voronoi", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Voronoi", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* color types */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Int", 10, 180, 75, 18, &tex->vn_coltype, 1.0, 0.0, 0, 0, "Only calculate intensity");
- uiDefButS(block, ROW, B_TEXPRV, "Col1", 85, 180, 75, 18, &tex->vn_coltype, 1.0, 1.0, 0, 0, "Color cells by position");
- uiDefButS(block, ROW, B_TEXPRV, "Col2", 160, 180, 75, 18, &tex->vn_coltype, 1.0, 2.0, 0, 0, "Same as Col1 + outline based on F2-F1");
- uiDefButS(block, ROW, B_TEXPRV, "Col3", 235, 180, 75, 18, &tex->vn_coltype, 1.0, 3.0, 0, 0, "Same as Col2 * intensity");
- uiBlockEndAlign(block);
-
- /* distance metric */
- sprintf(dm_menu, "Distance Metric %%t|Actual Distance %%x%d|Distance Squared %%x%d|Manhattan %%x%d|Chebychev %%x%d|Minkovsky 1/2 %%x%d|Minkovsky 4 %%x%d|Minkovsky %%x%d", TEX_DISTANCE, TEX_DISTANCE_SQUARED, TEX_MANHATTAN, TEX_CHEBYCHEV, TEX_MINKOVSKY_HALF, TEX_MINKOVSKY_FOUR, TEX_MINKOVSKY);
- uiDefBut(block, LABEL, B_TEXPRV, "Distance Metric", 10, 160, 150, 19, 0, 0, 0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXPRV, dm_menu, 10, 140, 150, 19, &tex->vn_distm, 0,0,0,0, "Sets the distance metric to be used");
-
- if (tex->vn_distm==TEX_MINKOVSKY)
- uiDefButF(block, NUMSLI, B_TEXPRV, "Exp: ", 10, 120, 150, 19, &tex->vn_mexp, 0.01, 10.0, 10, 0, "Sets minkovsky exponent");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "iScale: ", 160, 140, 150, 19, &tex->ns_outscale, 0.01, 10.0, 10, 0, "Scales intensity output");
- uiDefButF(block, NUM, B_TEXPRV, "Size: ", 160, 120, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 70, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal");
-
- /* weights */
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_TEXPRV, "W1: ", 10, 70, 150, 19, &tex->vn_w1, -2.0, 2.0, 10, 0, "Sets feature weight 1");
- uiDefButF(block, NUMSLI, B_TEXPRV, "W2: ", 10, 50, 150, 19, &tex->vn_w2, -2.0, 2.0, 10, 0, "Sets feature weight 2");
- uiDefButF(block, NUMSLI, B_TEXPRV, "W3: ", 10, 30, 150, 19, &tex->vn_w3, -2.0, 2.0, 10, 0, "Sets feature weight 3");
- uiDefButF(block, NUMSLI, B_TEXPRV, "W4: ", 10, 10, 150, 19, &tex->vn_w4, -2.0, 2.0, 10, 0, "Sets feature weight 4");
-}
-
-
-static char *layer_menu(RenderResult *rr, short *curlay)
-{
- RenderLayer *rl;
- int len= 64 + 32*BLI_countlist(&rr->layers);
- short a, nr= 0;
- char *str= MEM_callocN(len, "menu layers");
-
- strcpy(str, "Layer %t");
- a= strlen(str);
-
- /* compo result */
- if(rr->rectf) {
- a+= sprintf(str+a, "|Composite %%x0");
- nr= 1;
- }
- for(rl= rr->layers.first; rl; rl= rl->next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", rl->name, nr);
- }
-
- /* no curlay clip here, on render (redraws) the amount of layers can be 1 fir single-layer render */
-
- return str;
-}
-
-/* rl==NULL means composite result */
-static char *pass_menu(RenderLayer *rl, short *curpass)
-{
- RenderPass *rpass;
- int len= 64 + 32*(rl?BLI_countlist(&rl->passes):1);
- short a, nr= 0;
- char *str= MEM_callocN(len, "menu layers");
-
- strcpy(str, "Pass %t");
- a= strlen(str);
-
- /* rendered results don't have a Combined pass */
- if(rl==NULL || rl->rectf) {
- a+= sprintf(str+a, "|Combined %%x0");
- nr= 1;
- }
-
- if(rl)
- for(rpass= rl->passes.first; rpass; rpass= rpass->next, nr++)
- a+= sprintf(str+a, "|%s %%x%d", rpass->name, nr);
-
- if(*curpass >= nr)
- *curpass= 0;
-
- return str;
-}
-
-static void set_frames_cb(void *ima_v, void *iuser_v)
-{
- Image *ima= ima_v;
- ImageUser *iuser= iuser_v;
-
- if(ima->anim) {
- iuser->frames = IMB_anim_get_duration(ima->anim);
- BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0);
- }
-}
-
-static void image_src_change_cb(void *ima_v, void *iuser_v)
-{
- BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_SRC_CHANGE);
-}
-
-/* buttons have 2 arg callbacks, filewindow has 3 args... so thats why the wrapper below */
-static void image_browse_cb1(char *unused, void *ima_pp_v, void *iuser_v)
-{
- Image **ima_pp= (Image **)ima_pp_v;
- ImageUser *iuser= iuser_v;
-
- if(ima_pp) {
- Image *ima= *ima_pp;
-
- if(iuser->menunr== -2) {
- activate_databrowse_args(&ima->id, ID_IM, 0, &iuser->menunr, image_browse_cb1, ima_pp, iuser);
- }
- else if (iuser->menunr>0) {
- Image *newima= (Image*) BLI_findlink(&G.main->image, iuser->menunr-1);
-
- if (newima && newima!=ima) {
- *ima_pp= newima;
- id_us_plus(&newima->id);
- if(ima) ima->id.us--;
-
- BKE_image_signal(newima, iuser, IMA_SIGNAL_USER_NEW_IMAGE);
-
- BIF_undo_push("Browse image");
- }
- }
- }
-}
-
-static void image_browse_cb(void *ima_pp_v, void *iuser_v)
-{
- image_browse_cb1(NULL, ima_pp_v, iuser_v);
-}
-
-static void image_reload_cb(void *ima_v, void *iuser_v)
-{
- if(ima_v) {
- BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_RELOAD);
- }
-}
-
-static void image_field_test(void *ima_v, void *iuser_v)
-{
- Image *ima= ima_v;
-
- if(ima) {
- ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v);
- if(ibuf) {
- short nr= 0;
- if( !(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields) ) nr= 1;
- if( (ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields) ) nr= 1;
- if(nr) {
- BKE_image_signal(ima, iuser_v, IMA_SIGNAL_FREE);
- }
- }
- }
-}
-
-static void image_unlink_cb(void *ima_pp_v, void *unused)
-{
- Image **ima_pp= (Image **)ima_pp_v;
-
- if(ima_pp && *ima_pp) {
- Image *ima= *ima_pp;
- /* (for time being, texturefaces are no users, conflict in design...) */
- if(ima->id.us>1)
- ima->id.us--;
- *ima_pp= NULL;
- }
-}
-
-static void image_load_fs_cb(void *ima_pp_v, void *iuser_v)
-{
- Image **ima_pp= (Image **)ima_pp_v;
- ScrArea *sa;
- char *name;
-
- if(ima_pp==NULL) return;
-
- sa= closest_bigger_area();
- areawinset(sa->win);
- if(*ima_pp) name= (*ima_pp)->name;
-#ifdef _WIN32
- else {
- if (strcmp (U.textudir, "/") == 0)
- name= G.sce;
- else
- name= U.textudir;
- }
-#else
- else name = U.textudir;
-#endif
- if (G.qual & LR_CTRLKEY) {
- activate_imageselect_args(FILE_SPECIAL, "SELECT IMAGE", name, load_image_cb, ima_pp_v, iuser_v);
- }
- else {
- activate_fileselect_args(FILE_SPECIAL, "SELECT IMAGE", name, load_image_cb, ima_pp_v, iuser_v);
- }
-}
-
-/* 5 layer button callbacks... */
-static void image_multi_cb(void *rr_v, void *iuser_v)
-{
- BKE_image_multilayer_index(rr_v, iuser_v);
-}
-static void image_multi_inclay_cb(void *rr_v, void *iuser_v)
-{
- RenderResult *rr= rr_v;
- ImageUser *iuser= iuser_v;
- int tot= BLI_countlist(&rr->layers) + (rr->rectf?1:0); /* fake compo result layer */
- if(iuser->layer<tot-1)
- iuser->layer++;
- BKE_image_multilayer_index(rr, iuser);
-}
-static void image_multi_declay_cb(void *rr_v, void *iuser_v)
-{
- ImageUser *iuser= iuser_v;
- if(iuser->layer>0)
- iuser->layer--;
- BKE_image_multilayer_index(rr_v, iuser);
-}
-static void image_multi_incpass_cb(void *rr_v, void *iuser_v)
-{
- RenderResult *rr= rr_v;
- ImageUser *iuser= iuser_v;
- RenderLayer *rl= BLI_findlink(&rr->layers, iuser->layer);
- if(rl) {
- int tot= BLI_countlist(&rl->passes) + (rl->rectf?1:0); /* builtin render result has no combined pass in list */
- if(iuser->pass<tot-1) {
- iuser->pass++;
- BKE_image_multilayer_index(rr, iuser);
- }
- }
-}
-static void image_multi_decpass_cb(void *rr_v, void *iuser_v)
-{
- ImageUser *iuser= iuser_v;
- if(iuser->pass>0) {
- iuser->pass--;
- BKE_image_multilayer_index(rr_v, iuser);
- }
-}
-
-static void image_pack_cb(void *ima_v, void *iuser_v)
-{
- if(ima_v) {
- Image *ima= ima_v;
- if(ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE) {
- if (ima->packedfile) {
- if (G.fileflags & G_AUTOPACK) {
- if (okee("Disable AutoPack ?")) {
- G.fileflags &= ~G_AUTOPACK;
- }
- }
-
- if ((G.fileflags & G_AUTOPACK) == 0) {
- unpackImage(ima, PF_ASK);
- BIF_undo_push("Unpack image");
- }
- }
- else {
- ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v);
- if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- error("Can't pack painted image. Save image or use Repack as PNG.");
- } else {
- ima->packedfile = newPackedFile(ima->name);
- BIF_undo_push("Pack image");
- }
- }
- }
- }
-}
-
-static void image_load_cb(void *ima_pp_v, void *iuser_v)
-{
- if(ima_pp_v) {
- Image *ima= *((Image **)ima_pp_v);
- ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v);
- char str[FILE_MAX];
-
- /* name in ima has been changed by button! */
- BLI_strncpy(str, ima->name, FILE_MAX);
- if(ibuf) BLI_strncpy(ima->name, ibuf->name, FILE_MAX);
-
- load_image_cb(str, ima_pp_v, iuser_v);
- }
-}
-
-static void image_freecache_cb(void *ima_v, void *unused)
-{
- BKE_image_free_anim_ibufs(ima_v, G.scene->r.cfra);
- allqueue(REDRAWIMAGE, 0);
-}
-
-static void image_generated_change_cb(void *ima_v, void *iuser_v)
-{
- BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_FREE);
-}
-
-static void image_user_change(void *iuser_v, void *unused)
-{
- BKE_image_user_calc_imanr(iuser_v, G.scene->r.cfra, 0);
-}
-
-void uiblock_layer_pass_buttons(uiBlock *block, RenderResult *rr, ImageUser *iuser, int event, int x, int y, int w)
-{
- uiBut *but;
- RenderLayer *rl= NULL;
- int wmenu1, wmenu2;
- char *strp;
-
- /* layer menu is 1/3 larger than pass */
- wmenu1= (3*w)/5;
- wmenu2= (2*w)/5;
-
- /* menu buts */
- strp= layer_menu(rr, &iuser->layer);
- but= uiDefButS(block, MENU, event, strp, x, y, wmenu1, 20, &iuser->layer, 0,0,0,0, "Select Layer");
- uiButSetFunc(but, image_multi_cb, rr, iuser);
- MEM_freeN(strp);
-
- rl= BLI_findlink(&rr->layers, iuser->layer - (rr->rectf?1:0)); /* fake compo layer, return NULL is meant to be */
- strp= pass_menu(rl, &iuser->pass);
- but= uiDefButS(block, MENU, event, strp, x+wmenu1, y, wmenu2, 20, &iuser->pass, 0,0,0,0, "Select Pass");
- uiButSetFunc(but, image_multi_cb, rr, iuser);
- MEM_freeN(strp);
-}
-
-static void uiblock_layer_pass_arrow_buttons(uiBlock *block, RenderResult *rr, ImageUser *iuser, int imagechanged)
-{
- uiBut *but;
-
- if(rr==NULL || iuser==NULL)
- return;
- if(rr->layers.first==NULL) {
- uiDefBut(block, LABEL, 0, "No Layers in Render Result,", 10, 107, 300, 20, NULL, 1, 0, 0, 0, "");
- return;
- }
-
- uiBlockBeginAlign(block);
-
- /* decrease, increase arrows */
- but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_LEFT, 10,107,17,20, NULL, 0, 0, 0, 0, "Previous Layer");
- uiButSetFunc(but, image_multi_declay_cb, rr, iuser);
- but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_RIGHT, 27,107,18,20, NULL, 0, 0, 0, 0, "Next Layer");
- uiButSetFunc(but, image_multi_inclay_cb, rr, iuser);
-
- uiblock_layer_pass_buttons(block, rr, iuser, imagechanged, 45, 107, 230);
-
- /* decrease, increase arrows */
- but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_LEFT, 275,107,17,20, NULL, 0, 0, 0, 0, "Previous Pass");
- uiButSetFunc(but, image_multi_decpass_cb, rr, iuser);
- but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_RIGHT, 292,107,18,20, NULL, 0, 0, 0, 0, "Next Pass");
- uiButSetFunc(but, image_multi_incpass_cb, rr, iuser);
-
- uiBlockEndAlign(block);
-
-}
-
-/* The general Image panel with the loadsa callbacks! */
-void uiblock_image_panel(uiBlock *block, Image **ima_pp, ImageUser *iuser,
- short redraw, short imagechanged)
-{
- Image *ima= *ima_pp;
- uiBut *but;
- char str[128], *strp;
-
- /* different stuff when we show viewer */
- if(ima && ima->source==IMA_SRC_VIEWER) {
- ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser);
-
- image_info(ima, ibuf, str);
- uiDefBut(block, LABEL, 0, ima->id.name+2, 10, 180, 300, 20, NULL, 1, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, str, 10, 160, 300, 20, NULL, 1, 0, 0, 0, "");
-
- if(ima->type==IMA_TYPE_COMPOSITE) {
- iuser= ntree_get_active_iuser(G.scene->nodetree);
- if(iuser) {
- uiBlockBeginAlign(block);
- uiDefIconTextBut(block, BUT, B_SIMA_RECORD, ICON_REC, "Record", 10,120,100,20, 0, 0, 0, 0, 0, "");
- uiDefIconTextBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110,120,100,20, 0, 0, 0, 0, 0, "");
- but= uiDefBut(block, BUT, B_NOP, "Free Cache", 210,120,100,20, 0, 0, 0, 0, 0, "");
- uiButSetFunc(but, image_freecache_cb, ima, NULL);
-
- if(iuser->frames)
- sprintf(str, "(%d) Frames:", iuser->framenr);
- else strcpy(str, "Frames:");
- uiBlockBeginAlign(block);
- uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use");
- uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie");
- }
- }
- else if(ima->type==IMA_TYPE_R_RESULT) {
- /* browse layer/passes */
- uiblock_layer_pass_arrow_buttons(block, RE_GetResult(RE_GetRender(G.scene->id.name)), iuser, imagechanged);
- }
- return;
- }
-
- /* the main ima source types */
- if(ima) {
- uiSetButLock(ima->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
- uiBlockBeginAlign(block);
- uiBlockSetFunc(block, image_src_change_cb, ima, iuser);
- uiDefButS(block, ROW, imagechanged, "Still", 10, 180, 60, 20, &ima->source, 0.0, IMA_SRC_FILE, 0, 0, "Single Image file");
- uiDefButS(block, ROW, imagechanged, "Movie", 70, 180, 60, 20, &ima->source, 0.0, IMA_SRC_MOVIE, 0, 0, "Movie file");
- uiDefButS(block, ROW, imagechanged, "Sequence", 130, 180, 90, 20, &ima->source, 0.0, IMA_SRC_SEQUENCE, 0, 0, "Multiple Image files, as a sequence");
- uiDefButS(block, ROW, imagechanged, "Generated", 220, 180, 90, 20, &ima->source, 0.0, IMA_SRC_GENERATED, 0, 0, "Generated Image");
- uiBlockSetFunc(block, NULL, NULL, NULL);
- }
- else
- uiDefBut(block, LABEL, 0, " ", 10, 180, 300, 20, 0, 0, 0, 0, 0, ""); /* for align in panel */
-
- /* Browse */
- IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), NULL, &iuser->menunr);
-
- uiBlockBeginAlign(block);
- but= uiDefButS(block, MENU, imagechanged, strp, 10,155,23,20, &iuser->menunr, 0, 0, 0, 0, "Selects an existing Image or Movie");
- uiButSetFunc(but, image_browse_cb, ima_pp, iuser);
-
- MEM_freeN(strp);
-
- /* name + options, or only load */
- if(ima) {
- int drawpack= (ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE && ima->ok);
-
- but= uiDefBut(block, TEX, B_IDNAME, "IM:", 33, 155, 177, 20, ima->id.name+2, 0.0, 21.0, 0, 0, "Current Image Datablock name.");
- uiButSetFunc(but, test_idbutton_cb, ima->id.name, NULL);
- but= uiDefBut(block, BUT, imagechanged, "Reload", 210, 155, 60, 20, NULL, 0, 0, 0, 0, "Reloads Image or Movie");
- uiButSetFunc(but, image_reload_cb, ima, iuser);
-
- but= uiDefIconBut(block, BUT, imagechanged, ICON_X, 270,155,20,20, 0, 0, 0, 0, 0, "Unlink Image block");
- uiButSetFunc(but, image_unlink_cb, ima_pp, NULL);
- sprintf(str, "%d", ima->id.us);
- uiDefBut(block, BUT, B_NOP, str, 290,155,20,20, 0, 0, 0, 0, 0, "Only displays number of users of Image block");
-
- but= uiDefIconBut(block, BUT, imagechanged, ICON_FILESEL, 10, 135, 23, 20, 0, 0, 0, 0, 0, "Open Fileselect to load new Image");
- uiButSetFunc(but, image_load_fs_cb, ima_pp, iuser);
- but= uiDefBut(block, TEX, imagechanged, "", 33,135,257+(drawpack?0:20),20, ima->name, 0.0, 239.0, 0, 0, "Image/Movie file name, change to load new");
- uiButSetFunc(but, image_load_cb, ima_pp, iuser);
-
- if(drawpack) {
- if (ima->packedfile) packdummy = 1;
- else packdummy = 0;
- but= uiDefIconButBitI(block, TOG, 1, redraw, ICON_PACKAGE, 290,135,20,20, &packdummy, 0, 0, 0, 0, "Toggles Packed status of this Image");
- uiButSetFunc(but, image_pack_cb, ima, iuser);
- }
-
- }
- else {
- but= uiDefBut(block, BUT, imagechanged, "Load", 33, 155, 100,20, NULL, 0, 0, 0, 0, "Load new Image of Movie");
- uiButSetFunc(but, image_load_fs_cb, ima_pp, iuser);
- }
- uiBlockEndAlign(block);
-
- if(ima) {
- ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser);
-
- /* check for re-render, only buttons */
- if(imagechanged==B_IMAGECHANGED) {
- if(iuser->flag & IMA_ANIM_REFRESHED) {
- iuser->flag &= ~IMA_ANIM_REFRESHED;
- BIF_preview_changed(ID_TE);
- }
- }
-
- /* multilayer? */
- if(ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
- uiblock_layer_pass_arrow_buttons(block, ima->rr, iuser, imagechanged);
- }
- else {
- image_info(ima, ibuf, str);
- uiDefBut(block, LABEL, 0, str, 10, 112, 300, 20, NULL, 1, 0, 0, 0, "");
- }
-
- /* exception, let's do because we only use this panel 3 times in blender... but not real good code! */
- if( (FACESEL_PAINT_TEST) && G.sima && &G.sima->iuser==iuser)
- return;
- /* left side default per-image options, right half the additional options */
-
- /* fields */
- uiBlockBeginAlign(block);
- but= uiDefButBitS(block, TOG, IMA_FIELDS, imagechanged, "Fields", 10, 70, 65, 20, &ima->flag, 0, 0, 0, 0, "Click to enable use of fields in Image");
- uiButSetFunc(but, image_field_test, ima, iuser);
- uiDefButBitS(block, TOG, IMA_STD_FIELD, B_NOP, "Odd", 75, 70, 45, 20, &ima->flag, 0, 0, 0, 0, "Standard Field Toggle");
-
- uiBlockSetFunc(block, image_reload_cb, ima, iuser);
- uiDefButBitS(block, TOG, IMA_ANTIALI, B_NOP, "Anti", 10, 50, 45, 20, &ima->flag, 0, 0, 0, 0, "Toggles Image anti-aliasing, only works with solid colors");
- uiDefButBitS(block, TOG, IMA_DO_PREMUL, imagechanged, "Premul", 55, 50, 65, 20, &ima->flag, 0, 0, 0, 0, "Toggles premultiplying alpha");
- uiBlockEndAlign(block);
-
- if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
- sprintf(str, "(%d) Frames:", iuser->framenr);
-
- uiBlockBeginAlign(block);
- uiBlockSetFunc(block, image_user_change, iuser, NULL);
- uiDefButBitS(block, TOG, IMA_ANIM_ALWAYS, B_NOP, "Auto Refresh", 120, 70, 190, 20, &iuser->flag, 0, 0, 0, 0, "Always refresh Image on frame changes");
-
- if(ima->anim) {
- uiDefButI(block, NUM, imagechanged, str, 120, 50,170, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use");
- but= uiDefBut(block, BUT, redraw, "<", 290, 50, 20, 20, 0, 0, 0, 0, 0, "Copies number of frames in movie file to Frames: button");
- uiButSetFunc(but, set_frames_cb, ima, iuser);
- }
- else
- uiDefButI(block, NUM, imagechanged, str, 120, 50,190, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use");
-
- uiDefButI(block, NUM, imagechanged, "Offs:", 120,30,100,20, &iuser->offset, -MAXFRAMEF, MAXFRAMEF, 0, 0, "Offsets the number of the frame to use in the animation");
- uiDefButS(block, NUM, imagechanged, "Fie/Ima:", 220,30,90,20, &iuser->fie_ima, 1.0, 200.0, 0, 0, "The number of fields per rendered frame (2 fields is 1 image)");
-
- uiDefButI(block, NUM, imagechanged, "StartFr:", 120,10,100,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie");
- uiDefButS(block, TOG, imagechanged, "Cyclic", 220,10,90,20, &iuser->cycl, 0.0, 1.0, 0, 0, "Cycle the images in the movie");
-
- uiBlockSetFunc(block, NULL, iuser, NULL);
- }
- else if(ima->source==IMA_SRC_GENERATED) {
-
- uiBlockBeginAlign(block);
- uiBlockSetFunc(block, image_generated_change_cb, ima, iuser);
- uiDefButS(block, NUM, imagechanged, "SizeX:", 120,70,100,20, &ima->gen_x, 1.0, 5000.0, 0, 0, "Image size x");
- uiDefButS(block, NUM, imagechanged, "SizeY:", 220,70,90,20, &ima->gen_y, 1.0, 5000.0, 0, 0, "Image size y");
- uiDefButS(block, TOG, imagechanged, "UV Test grid",120,50,190,20, &ima->gen_type, 0.0, 1.0, 0, 0, "");
- uiBlockSetFunc(block, NULL, NULL, NULL);
- }
- }
- uiBlockEndAlign(block);
-}
-
-static void texture_panel_image(Image **ima, ImageUser *iuser)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_image", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Image", "Texture", 960, 0, 318, 204)==0) return;
-
- uiblock_image_panel(block, ima, iuser, B_REDR, B_IMAGECHANGED);
-}
-
-static void texture_panel_image_map(Tex *tex, MTex *mtex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_image_map", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Map Image", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* types */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_MIPMAP, B_IMAGECHANGED, "MipMap", 10, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Generates and uses mipmaps");
- uiDefButBitS(block, TOG, TEX_GAUSS_MIP, 0, "Gauss", 85, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Enable Gauss filter to sample down mipmaps");
- uiDefButBitS(block, TOG, TEX_INTERPOL, 0, "Interpol", 160, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Interpolates pixels using Area filter");
- uiDefButBitS(block, TOG, TEX_IMAROT, B_TEXPRV, "Rot90", 235, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Actually flips X and Y for rendering, rotates and mirrors");
-
- uiDefButBitS(block, TOG, TEX_USEALPHA, B_TEXPRV, "UseAlpha", 10, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to use Image's alpha channel");
- uiDefButBitS(block, TOG, TEX_CALCALPHA, B_TEXPRV, "CalcAlpha", 110, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to calculate an alpha channel based on Image RGB values");
- uiDefButBitS(block, TOG, TEX_NEGALPHA, B_TEXPRV, "NegAlpha", 210, 160, 100, 20, &tex->flag, 0, 0, 0, 0, "Click to invert the alpha values");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_FILTER_MIN, B_TEXPRV, "Min", 10, 120, 30, 20, &tex->imaflag, 0, 0, 0, 0, "Use Filtersize as a minimal filter value in pixels");
- uiDefButF(block, NUM, B_TEXPRV, "Filter: ", 40,120,120,20, &tex->filtersize, 0.1, 50.0, 10, 3, "Multiplies the filter size used by mipmap and interpol");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map", 160,120,(mtex)? 75: 150,20, &tex->imaflag,
- 0, 0, 0, 0, "Use image RGB values for normal mapping");
- if(mtex)
- uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3",
- 235,120,75,20, &mtex->normapspace, 0, 0, 0, 0, "Sets space of normal map image");
- uiBlockEndAlign(block);
-
- /* crop extend clip */
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,90,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the color of the edge pixels");
- uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,90,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges");
- uiDefButS(block, ROW, B_TEXREDR_PRV, "ClipCube", 121,90,63,19, &tex->extend, 4.0, 4.0, 0, 0, "Sets alpha to 0.0 outside cubeshaped area around Image");
- uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 184,90,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically");
- uiDefButS(block, ROW, B_TEXREDR_PRV, "Checker", 247,90,63,19, &tex->extend, 4.0, 5.0, 0, 0, "Causes Image to repeat in checker pattern");
-
- if(tex->extend==TEX_REPEAT) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_REPEAT_XMIR, B_TEXPRV, "Mirr", 10,60,30,19, &tex->flag, 0.0, 0.0, 0, 0, "Mirrors X direction repeat");
- uiDefButS(block, NUM, B_TEXPRV, "Xrepeat:", 40,60,120,19, &tex->xrepeat, 1.0, 512.0, 0, 0, "Sets a repetition multiplier in the X direction");
- uiDefButBitS(block, TOG, TEX_REPEAT_YMIR, B_TEXPRV, "Mirr", 160,60,30,19, &tex->flag, 0.0, 0.0, 0, 0, "Mirrors Y direction repeat");
- uiDefButS(block, NUM, B_TEXPRV, "Yrepeat:", 190,60,120,19, &tex->yrepeat, 1.0, 512.0, 0, 0, "Sets a repetition multiplier in the Y direction");
- }
- else if(tex->extend==TEX_CHECKER) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_CHECKER_ODD, B_TEXPRV, "Odd", 10,60,100,19, &tex->flag, 0.0, 0.0, 0, 0, "Sets odd checker tiles");
- uiDefButBitS(block, TOG, TEX_CHECKER_EVEN, B_TEXPRV, "Even", 110,60,100,19, &tex->flag, 0.0, 0.0, 0, 0, "Sets even checker tiles");
- uiDefButF(block, NUM, B_TEXPRV, "Mortar:", 210,60,100,19, &tex->checkerdist, 0.0, 0.99, 0, 0, "Set checkers distance (like mortar)");
- }
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "MinX ", 10,30,150,19, &tex->cropxmin, -10.0, 10.0, 10, 0, "Sets minimum X value to crop Image");
- uiDefButF(block, NUM, B_TEXPRV, "MinY ", 10,10,150,19, &tex->cropymin, -10.0, 10.0, 10, 0, "Sets minimum Y value to crop Image");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_TEXPRV, "MaxX ", 160,30,150,19, &tex->cropxmax, -10.0, 10.0, 10, 0, "Sets maximum X value to crop Image");
- uiDefButF(block, NUM, B_TEXPRV, "MaxY ", 160,10,150,19, &tex->cropymax, -10.0, 10.0, 10, 0, "Sets maximum Y value to crop Image");
- uiBlockEndAlign(block);
-
-}
-
-/***************************************/
-
-static void texture_panel_envmap(Tex *tex)
-{
- uiBlock *block;
- uiBut *but;
- EnvMap *env;
- ID *id;
- short a, xco, yco, dx, dy;
- char *strp, str[32];
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_envmap", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Envmap", "Texture", 640, 0, 318, 204)==0) return;
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- if(tex->env==NULL) {
- tex->env= BKE_add_envmap();
- tex->env->object= OBACT;
- }
- if(tex->env) {
- env= tex->env;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_REDR, "Static", 10, 180, 100, 19, &env->stype, 2.0, (float)ENV_STATIC, 0, 0, "Calculates environment map only once");
- uiDefButS(block, ROW, B_REDR, "Anim", 110, 180, 100, 19, &env->stype, 2.0, (float)ENV_ANIM, 0, 0, "Calculates environment map at each rendering");
- uiDefButS(block, ROW, B_ENV_FREE, "Load", 210, 180, 100, 19, &env->stype, 2.0, (float)ENV_LOAD, 0, 0, "Loads saved environment map from disk");
- uiBlockEndAlign(block);
-
- if(env->stype==ENV_LOAD) {
- /* file input */
- id= (ID *)tex->ima;
- IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(G.buts->menunr));
- if(strp[0]) {
- uiBlockBeginAlign(block);
-
- but= uiDefButS(block, MENU, B_TEXPRV, strp, 10,145,23,20, &tex->iuser.menunr, 0, 0, 0, 0, "Selects an existing environment map");
- uiButSetFunc(but, image_browse_cb, &tex->ima, &tex->iuser);
-
- if(tex->ima) {
- but= uiDefBut(block, TEX, B_NAMEIMA, "", 35,145,255,20, tex->ima->name, 0.0, 79.0, 0, 0, "Displays environment map name: click to change");
- uiButSetFunc(but, image_load_cb, &tex->ima, &tex->iuser);
-
- sprintf(str, "%d", tex->ima->id.us);
- uiDefBut(block, BUT, 0, str, 290,145,20,20, 0, 0, 0, 0, 0, "Displays number of users of environment map: click to make single user");
- uiBlockEndAlign(block);
-
- but= uiDefBut(block, BUT, B_IMAGECHANGED, "Reload", 230,125,80,20, 0, 0, 0, 0, 0, "Reloads saved environment map");
- uiButSetFunc(but, image_reload_cb, tex->ima, NULL);
-
- if (tex->ima->packedfile) packdummy = 1;
- else packdummy = 0;
- but= uiDefIconButBitI(block, TOG, 1, B_REDR, ICON_PACKAGE, 205,125,24,20, &packdummy, 0, 0, 0, 0, "Toggles Packed status of this environment map");
- uiButSetFunc(but, image_pack_cb, tex->ima, &tex->iuser);
- }
- else uiBlockEndAlign(block);
- }
- MEM_freeN(strp);
-
- but= uiDefBut(block, BUT, B_IMAGECHANGED, "Load Image", 10,125,150,20, 0, 0, 0, 0, 0, "Loads saved environment map - file select");
- uiButSetFunc(but, image_load_fs_cb, &tex->ima, &tex->iuser);
- }
- else {
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_ENV_FREE, "Free Data", 10,145,100,20, 0, 0, 0, 0, 0, "Releases all images associated with this environment map");
- uiDefBut(block, BUT, B_ENV_SAVE, "Save EnvMap", 110,145,100,20, 0, 0, 0, 0, 0, "Saves current environment map");
- uiDefBut(block, BUT, B_ENV_FREE_ALL, "Free all EnvMaps", 210,145,100,20, 0, 0, 0, 0, 0, "Frees all rendered environment maps for all materials");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_NOP, "Cube", 10,120,100,20, &env->type, 3.0f, (float)ENV_CUBE, 0, 0, "Use environment map with six cube sides");
- uiDefButS(block, ROW, B_NOP, "Plane", 110,120,100,20, &env->type, 3.0f, (float)ENV_PLANE, 0, 0, "Only one side is rendered, with Z axis pointing in direction of image");
- uiDefButF(block, NUM, B_NOP, "Zoom: ", 210,120,100,20, &env->viewscale, 0.5f, 5.0f, 100, 2, "Zoom factor for planar environment map");
- uiBlockEndAlign(block);
- }
-
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_ENV_OB, "Ob:", 10,90,150,20, &(env->object), "Displays object to use as viewpoint for environment map: click to change");
- if(env->stype!=ENV_LOAD)
- uiDefButS(block, NUM, B_ENV_FREE, "CubeRes", 160,90,150,20, &env->cuberes, 50, 4096.0, 0, 0, "Sets the pixel resolution of the rendered environment map");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_FILTER_MIN, B_TEXPRV, "Min", 10, 65, 30, 20, &tex->imaflag, 0, 0, 0, 0, "Use Filtersize as a minimal filter value in pixels");
- uiDefButF(block, NUM, B_TEXPRV, "Filter :", 40,65,120,20, &tex->filtersize, 0.1, 25.0, 0, 3, "Adjusts sharpness or blurriness of the reflection"),
- uiDefButS(block, NUM, B_ENV_FREE, "Depth:", 160,65,150,20, &env->depth, 0, 5.0, 0, 0, "Sets the number of times a map will be rendered recursively mirror effects"),
- uiDefButF(block, NUM, REDRAWVIEW3D, "ClipSta", 10,40,150,20, &env->clipsta, 0.01, 50.0, 100, 0, "Sets start value for clipping: objects nearer than this are not visible to map");
- uiDefButF(block, NUM, B_NOP, "ClipEnd", 160,40,150,20, &env->clipend, 0.1, 20000.0, 1000, 0, "Sets end value for clipping beyond which objects are not visible to map");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 0, "Don't render layer:", 10,10,140,22, 0, 0.0, 0.0, 0, 0, "");
- xco= 160;
- yco= 10;
- dx= 28;
- dy= 26;
-
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<a, 0, "", (xco+a*(dx/2)), (yco+dy/2), (dx/2), (1+dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map");
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), 0, "",(xco+a*(dx/2)), yco, (dx/2), (dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map");
-
- uiBlockBeginAlign(block);
- xco+= 5;
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<a, 0, "", (xco+a*(dx/2)), (yco+dy/2), (dx/2), (1+dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map");
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOG, 1<<(a+10), 0, "",(xco+a*(dx/2)), yco, (dx/2), (dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map");
-
- }
-}
-
-static void colorband_pos_cb(void *coba_v, void *unused_v)
-{
- ColorBand *coba= coba_v;
- int a;
-
- if(coba->tot<2) return;
-
- for(a=0; a<coba->tot; a++) coba->data[a].cur= a;
- qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
- for(a=0; a<coba->tot; a++) {
- if(coba->data[a].cur==coba->cur) {
- if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */
- coba->cur= a;
- break;
- }
- }
-}
-
-static void colorband_add_cb(void *coba_v, void *unused_v)
-{
- ColorBand *coba= coba_v;
-
- if(coba->tot < MAXCOLORBAND-1) coba->tot++;
- coba->cur= coba->tot-1;
-
- colorband_pos_cb(coba, NULL);
- BIF_undo_push("Add colorband");
-
-}
-
-static void colorband_del_cb(void *coba_v, void *unused_v)
-{
- ColorBand *coba= coba_v;
- int a;
-
- if(coba->tot<2) return;
-
- for(a=coba->cur; a<coba->tot; a++) {
- coba->data[a]= coba->data[a+1];
- }
- if(coba->cur) coba->cur--;
- coba->tot--;
-
- BIF_undo_push("Delete colorband");
- BIF_preview_changed(ID_TE);
-}
-
-
-/* offset aligns from bottom, standard width 300, height 115 */
-static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int yoffs, int redraw)
-{
- CBData *cbd;
- uiBut *bt;
-
- if(coba==NULL) return;
-
- bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new color position to the colorband");
- uiButSetFunc(bt, colorband_add_cb, coba, NULL);
- uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband");
- bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position");
- uiButSetFunc(bt, colorband_del_cb, coba, NULL);
-
- uiDefButS(block, MENU, redraw, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
- 236+xoffs, 95+yoffs, 64, 20, &coba->ipotype, 0.0, 0.0, 0, 0, "Sets interpolation type");
-
- uiDefBut(block, BUT_COLORBAND, redraw, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, "");
-
- cbd= coba->data + coba->cur;
-
- uiBlockBeginAlign(block);
- bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active color");
- uiButSetFunc(bt, colorband_pos_cb, coba, NULL);
- uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
- uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active color");
- uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active color");
- uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active color");
- uiBlockEndAlign(block);
-}
-
-void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int event)
-{
- CBData *cbd;
- uiBut *bt;
- float unit= (butr->xmax-butr->xmin)/14.0f;
- float xs= butr->xmin;
-
- cbd= coba->data + coba->cur;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
- uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, "");
- bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new color position to the colorband");
- uiButSetFunc(bt, colorband_add_cb, coba, NULL);
- bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position");
- uiButSetFunc(bt, colorband_del_cb, coba, NULL);
-
- uiDefButS(block, MENU, event, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
- xs+10.0f*unit, butr->ymin+20.0f, unit*4, 20, &coba->ipotype, 0.0, 0.0, 0, 0, "Sets interpolation type");
-
- uiDefBut(block, BUT_COLORBAND, event, "", xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
-
-}
-
-static void texture_panel_colors(Tex *tex)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_colors", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Texture", "Texture");
- if(uiNewPanel(curarea, block, "Colors", "Texture", 1280, 0, 318, 204)==0) return;
-
- uiSetButLock(tex->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- /* COLORBAND */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, TEX_COLORBAND, B_COLORBAND, "Colorband",10,180,80,20, &tex->flag, 0, 0, 0, 0, "Toggles colorband operations");
-
- if(tex->flag & TEX_COLORBAND) {
- draw_colorband_buts(block, tex->coba, 10, 85, B_TEXREDR_PRV);
- }
-
- /* RGB-BRICON */
- if((tex->flag & TEX_COLORBAND)==0) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_TEXPRV, "R ", 60,80,200,20, &tex->rfac, 0.0, 2.0, 0, 0, "Changes the red value of the texture");
- uiDefButF(block, NUMSLI, B_TEXPRV, "G ", 60,60,200,20, &tex->gfac, 0.0, 2.0, 0, 0, "Changes the green value of the texture");
- uiDefButF(block, NUMSLI, B_TEXPRV, "B ", 60,40,200,20, &tex->bfac, 0.0, 2.0, 0, 0, "Changes the blue value of the texture");
- }
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_TEXPRV, "Bright", 10,10,150,20, &tex->bright, 0.0, 2.0, 0, 0, "Changes the brightness of the color or intensity of a texture");
- uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 5.0, 0, 0, "Changes the contrast of the color or intensity of a texture");
-}
-
-static int texture_channels_num_display(MTex **mtex)
-{
- int a, num_mtex;
-
- if(!mtex)
- return 0;
-
- /* compute number of texture channels to draw, 1 more
- * than the last, used texture channel, and at least 10 */
- num_mtex = 0;
-
- for(a=MAX_MTEX-1; a>=0; a--) {
- if (mtex[a]) {
- num_mtex = a+1;
- break;
- }
- }
-
- if (num_mtex < 10)
- return 10;
- else if(num_mtex < MAX_MTEX)
- return num_mtex + 1;
- else
- return MAX_MTEX;
-}
-
-static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br, SculptData *sd)
-{
- MTex **mtex, *mt;
- uiBlock *block;
- ID *id=NULL, *idfrom;
- int a, yco, loos;
- char str[32];
-
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Texture", "Texture", 320, 0, 318, 204)==0) return;
-
- /* first do the browse but */
- if(actmtex)
- id= (ID *)actmtex->tex;
- else if(node)
- id= node->id;
-
- if(ma) {
- idfrom= &ma->id;
- mtex= ma->mtex;
- }
- else if(wrld) {
- idfrom= &wrld->id;
- mtex= wrld->mtex;
- }
- else if(la) {
- idfrom= &la->id;
- mtex= la->mtex;
- }
- else if(br) {
- idfrom= &br->id;
- mtex= br->mtex;
- }
- else if(sd) {
- idfrom= NULL; /* Not sure what this does */
- mtex= sd->mtex;
- }
- else {
- idfrom= NULL;
- mtex= NULL;
- }
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- if(ma) {
- std_libbuttons(block, 10, 180, 0, NULL, B_TEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
- }
- else if(wrld) {
- std_libbuttons(block, 10, 180, 0, NULL, B_WTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
- }
- else if(la) {
- std_libbuttons(block, 10, 180, 0, NULL, B_LTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
- }
- else if(br) {
- std_libbuttons(block, 10, 180, 0, NULL, B_BTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->menunr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
- }
- else if(sd) {
- std_libbuttons(block, 10, 180, 0, NULL, B_SCULPT_TEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
- }
- else if(node) {
-
- }
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
-
- uiClearButLock();
-
- /* From button: removed */
-
- /* CHANNELS */
- if(node==NULL) {
- int num_mtex;
- uiBlockBeginAlign(block);
- yco= 150;
-
- num_mtex= texture_channels_num_display(mtex);
- for(a=0; a<num_mtex; a++) {
- mt= mtex[a];
-
- if(mt && mt->tex) splitIDname(mt->tex->id.name+2, str, &loos);
- else strcpy(str, "");
- str[14]= 0;
-
- if(ma) {
- uiDefButC(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(ma->texact), 0.0, (float)a, 0, 0, "Click to select texture channel");
- yco-= 20;
- }
- else if(wrld) {
- uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(wrld->texact), 0.0, (float)a, 0, 0, "");
- yco-= 20;
- }
- else if(la) {
- uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(la->texact), 0.0, (float)a, 0, 0, "");
- yco-= 20;
- }
- else if(br) {
- uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(br->texact), 0.0, (float)a, 0, 0, "");
- yco-= 20;
- }
- else if(sd) {
- uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(sd->texact), 0.0, (float)a, 0, 0, "");
- yco-= 20;
- }
- }
- uiBlockEndAlign(block);
- }
- uiBlockSetCol(block, TH_AUTO);
-
- /* TYPES */
- if(id) {
- char textypes[512];
- Tex *tex= (Tex *)id;
-
- uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* newnoise: all texture types as menu, not enough room for more buttons.
- * Can widen panel, but looks ugly when other panels overlap it */
- if( !tex->use_nodes ) {
- sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE);
- uiDefBut(block, LABEL, 0, "Texture Type", 160, 150, 140, 20, 0, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type");
- }
-
- uiDefButC(block, TOG, B_TEX_USENODES, "Nodes", 160, 100, 140, 25, &tex->use_nodes, 0.0f, 0.0f, 0, 0, "");
-
- }
- else {
- // label to avoid centering
- uiDefBut(block, LABEL, 0, " ", 160, 10, 140, 20, 0, 0, 0, 0, 0, "");
- }
-}
-
-static void texture_panel_preview(MTex *mtex, int preview)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "texture_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Preview", "Texture", 0, 0, 318, 204)==0) return;
-
- if(preview) uiBlockSetDrawExtraFunc(block, BIF_previewdraw);
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_TEXREDR_PRV, "Mat", 200,175,80,25, &G.buts->texfrom, 3.0, 0.0, 0, 0, "Displays the textures of the active material");
- uiDefButC(block, ROW, B_TEXREDR_PRV, "World", 200,150,80,25, &G.buts->texfrom, 3.0, 1.0, 0, 0, "Displays the textures of the world block");
- uiDefButC(block, ROW, B_TEXREDR_PRV, "Lamp", 200,125,80,25, &G.buts->texfrom, 3.0, 2.0, 0, 0, "Displays the textures of the selected lamp");
- uiDefButC(block, ROW, B_TEXREDR_PRV, "Brush", 200,100,80,25, &G.buts->texfrom, 3.0, 3.0, 0, 0, "Displays the textures of the selected brush");
- uiBlockEndAlign(block);
-
- if(mtex && mtex->tex) {
- uiDefButBitS(block, TOG, TEX_PRV_ALPHA, B_TEXREDR_PRV, "Alpha", 200,60,80,20, &mtex->tex->flag, 0, 0, 0, 0, "Show alpha in preview");
- uiSetButLock(mtex->tex->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
- uiDefBut(block, BUT, B_DEFTEXVAR, "Default Vars",200,10,80,20, 0, 0, 0, 0, 0, "Sets all values to defaults");
- }
-}
-
-
-
-/* *************************** RADIO ******************************** */
-
-void do_radiobuts(unsigned short event)
-{
- Radio *rad;
- int phase;
-
- phase= rad_phase();
- rad= G.scene->radio;
-
- switch(event) {
- case B_RAD_ADD:
- add_radio();
- BIF_undo_push("Add radiosity");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_DELETE:
- delete_radio();
- BIF_undo_push("Delete radiosity");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_FREE:
- freeAllRad();
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_COLLECT:
- rad_collect_meshes();
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_INIT:
- if(phase==RAD_PHASE_PATCHES) {
- rad_limit_subdivide();
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_RAD_SHOOTP:
- if(phase==RAD_PHASE_PATCHES) {
- waitcursor(1);
- rad_subdivshootpatch();
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- waitcursor(0);
- }
- break;
- case B_RAD_SHOOTE:
- if(phase==RAD_PHASE_PATCHES) {
- waitcursor(1);
- rad_subdivshootelem();
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- waitcursor(0);
- }
- break;
- case B_RAD_GO:
- if(phase==RAD_PHASE_PATCHES) {
- waitcursor(1);
- rad_go();
- waitcursor(0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_RAD_LIMITS:
- rad_setlimits();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- break;
- case B_RAD_FAC:
- set_radglobal();
- if(phase & RAD_PHASE_FACES) make_face_tab();
- else make_node_display(); /* radio solver also uses nodes, different ones :) */
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_NODELIM:
- if(phase & RAD_PHASE_FACES) {
- set_radglobal();
- removeEqualNodes(rad->nodelim);
- make_face_tab();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_RAD_NODEFILT:
- if(phase & RAD_PHASE_FACES) {
- set_radglobal();
- filterNodes();
- make_face_tab();
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_RAD_FACEFILT:
- if(phase & RAD_PHASE_FACES) {
- filterFaces();
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_RAD_DRAW:
- set_radglobal();
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_ADDMESH:
- if(phase & RAD_PHASE_FACES) rad_addmesh();
- BIF_undo_push("Radiosity add mesh");
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_RAD_REPLACE:
- if(phase & RAD_PHASE_FACES) rad_replacemesh();
- BIF_undo_push("Radiosity replace mesh");
- allqueue(REDRAWVIEW3D, 0);
- break;
- }
-
-}
-
-
-static void radio_panel_calculation(Radio *rad, int flag)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "radio_panel_calculation", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Calculation", "Radio", 640, 0, 318, 204)==0) return;
- uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS);
-
- if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiDefBut(block, BUT, B_RAD_GO, "GO", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Starts the radiosity simulation");
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefButS(block, NUM, B_NOP, "SubSh Patch:", 1, 0, 10, 10, &rad->subshootp, 0.0, 10.0, 0, 0, "Sets the number of times the environment is tested to detect pathes");
- uiDefButS(block, NUM, B_NOP, "SubSh Element:", 1, 0, 10, 10, &rad->subshoote, 0.0, 10.0, 0, 0, "Sets the number of times the environment is tested to detect elements");
-
- if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiDefBut(block, BUT, B_RAD_SHOOTE, "Subdiv Shoot Element", 2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, Detects high energy changes and subdivide Elements");
- uiDefBut(block, BUT, B_RAD_SHOOTP, "Subdiv Shoot Patch", 2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, Detects high energy changes and subdivide Patches");
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefButI(block, NUM, B_NOP, "MaxEl:", 3, 0, 10, 10, &rad->maxnode, 1.0, 250000.0, 0, 0, "Sets the maximum allowed number of elements");
- uiDefButS(block, NUM, B_NOP, "Max Subdiv Shoot:", 3, 0, 10, 10, &rad->maxsublamp, 1.0, 250.0, 0, 0, "Sets the maximum number of initial shoot patches that are evaluated");
-
- if(flag & RAD_PHASE_FACES);
- else uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiDefBut(block, BUT, B_RAD_FACEFILT, "FaceFilter", 4, 0, 10, 10, NULL, 0, 0, 0, 0, "Forces an extra smoothing");
- uiDefBut(block, BUT, B_RAD_NODEFILT, "Element Filter", 4, 0, 10, 10, NULL, 0, 0, 0, 0, "Filters elements to remove aliasing artefacts");
-
- uiDefBut(block, BUT, B_RAD_NODELIM, "RemoveDoubles", 5, 0, 30, 10, NULL, 0.0, 50.0, 0, 0, "Joins elements which differ less than 'Lim'");
- uiBlockSetCol(block, TH_AUTO);
- uiDefButS(block, NUM, B_NOP, "Lim:", 5, 0, 10, 10, &rad->nodelim, 0.0, 50.0, 0, 0, "Sets the range for removing doubles");
-
-
-}
-
-static void radio_panel_tool(Radio *rad, int flag)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "radio_panel_tool", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Radio Tool", "Radio", 320, 0, 318, 204)==0) return;
- uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS);
-
- if(flag & RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefBut(block, BUT, B_RAD_COLLECT, "Collect Meshes", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Converts selected visible meshes to patches");
-
- if(flag & RAD_PHASE_PATCHES)uiBlockSetCol(block, TH_AUTO);
- else uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiDefBut(block, BUT, B_RAD_FREE, "Free Radio Data", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Releases all memory used by Radiosity");
-
- if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO);
- else uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiDefBut(block, BUT, B_RAD_REPLACE, "Replace Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, changing input-meshes");
- uiDefBut(block, BUT, B_RAD_ADDMESH, "Add new Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, unchanging input-meshes");
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefButS(block, ROW, B_RAD_DRAW, "Wire", 2, 0, 10, 10, &rad->drawtype, 0.0, 0.0, 0, 0, "Enables wireframe drawmode");
- uiDefButS(block, ROW, B_RAD_DRAW, "Solid", 2, 0, 10, 10, &rad->drawtype, 0.0, 1.0, 0, 0, "Enables solid drawmode");
- uiDefButS(block, ROW, B_RAD_DRAW, "Gour", 2, 0, 10, 10, &rad->drawtype, 0.0, 2.0, 0, 0, "Enables Gourad drawmode");
- uiDefButBitS(block, TOG, 1, B_RAD_DRAW, "ShowLim", 2, 0, 10, 10, &rad->flag, 0, 0, 0, 0, "Draws patch and element limits");
- uiDefButBitS(block, TOG, 2, B_RAD_DRAW, "Z", 2, 0, 3, 10, &rad->flag, 0, 0, 0, 0, "Draws limits differently");
-
- uiDefButS(block, NUM, B_RAD_LIMITS, "ElMax:", 3, 0, 10, 10, &rad->elma, 1.0, 500.0, 0, 0, "Sets maximum size of an element");
- uiDefButS(block, NUM, B_RAD_LIMITS, "ElMin:", 3, 0, 10, 10, &rad->elmi, 1.0, 100.0, 0, 0, "Sets minimum size of an element");
- uiDefButS(block, NUM, B_RAD_LIMITS, "PaMax:", 3, 0, 10, 10, &rad->pama, 10.0, 1000.0, 0, 0, "Sets maximum size of a patch");
- uiDefButS(block, NUM, B_RAD_LIMITS, "PaMin:", 3, 0, 10, 10, &rad->pami, 10.0, 1000.0, 0, 0, "Sets minimum size of a patch");
-
- uiDefBut(block, BUT, B_RAD_INIT, "Limit Subdivide", 5, 0, 10, 10, NULL, 0, 0, 0, 0, "Subdivides patches");
-}
-
-
-static void radio_panel_render(Radio *rad)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "radio_panel_render", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Radio Render", "Radio", 0, 0, 318, 204)==0) return;
- uiAutoBlock(block, 210, 30, 230, 150, UI_BLOCK_ROWS);
-
- uiDefButS(block, NUMSLI, B_RAD_LIMITS, "Hemires:", 0, 0, 10, 10, &rad->hemires, 100.0, 1000.0, 100, 0, "Sets the size of a hemicube");
- uiDefButS(block, NUM, B_NOP, "Max Iterations:", 2, 0, 10, 15, &rad->maxiter, 0.0, 10000.0, 0, 0, "Limits the maximum number of radiosity rounds");
- uiDefButF(block, NUM, B_RAD_FAC, "Mult:", 3, 0, 10, 15, &rad->radfac, 0.001, 250.0, 100, 0, "Mulitplies the energy values");
- uiDefButF(block, NUM, B_RAD_FAC, "Gamma:", 3, 0, 10, 15, &rad->gamma, 0.2, 10.0, 10, 0, "Changes the contrast of the energy values");
- uiDefButF(block, NUMSLI, B_NOP, "Convergence:", 5, 0, 10, 10, &rad->convergence, 0.0, 1.0, 10, 0, "Sets the lower threshold of unshot energy");
-}
-
-
-/* ***************************** WORLD ************************** */
-
-void do_worldbuts(unsigned short event)
-{
- static short mtexcopied=0;
- static MTex mtexcopybuf;
- World *wrld;
- MTex *mtex;
- MTex *mtexswap;
-
- switch(event) {
- case B_TEXCLEARWORLD:
- wrld= G.buts->lockpoin;
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- wrld->mtex[ wrld->texact ]= 0;
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Unlink world texture");
- BIF_preview_changed(ID_WO);
- }
- break;
- case B_WMTEXCOPY:
- wrld= G.buts->lockpoin;
- if(wrld && wrld->mtex[(int)wrld->texact] ) {
- mtex= wrld->mtex[(int)wrld->texact];
- if(mtex->tex==NULL) {
- error("No texture available");
- }
- else {
- memcpy(&mtexcopybuf, wrld->mtex[(int)wrld->texact], sizeof(MTex));
- mtexcopied= 1;
- }
- }
- break;
- case B_WMTEXPASTE:
- wrld= G.buts->lockpoin;
- if(wrld && mtexcopied && mtexcopybuf.tex) {
- if(wrld->mtex[(int)wrld->texact]==NULL )
- wrld->mtex[(int)wrld->texact]= MEM_mallocN(sizeof(MTex), "mtex");
- else if(wrld->mtex[(int)wrld->texact]->tex)
- wrld->mtex[(int)wrld->texact]->tex->id.us--;
-
- memcpy(wrld->mtex[(int)wrld->texact], &mtexcopybuf, sizeof(MTex));
-
- id_us_plus((ID *)mtexcopybuf.tex);
- BIF_undo_push("Paste mapping settings");
- BIF_preview_changed(ID_WO);
- scrarea_queue_winredraw(curarea);
- }
- break;
- case B_WMTEXMOVEUP:
- wrld= G.buts->lockpoin;
- if(wrld && (int)wrld->texact > 0) {
- mtexswap = wrld->mtex[(int)wrld->texact];
- wrld->mtex[(int)wrld->texact] = wrld->mtex[((int)wrld->texact)-1];
- wrld->mtex[((int)wrld->texact)-1] = mtexswap;
- wrld->texact--;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_WMTEXMOVEDOWN:
- wrld= G.buts->lockpoin;
- if(wrld && (int)wrld->texact < MAX_MTEX-1) {
- mtexswap = wrld->mtex[(int)wrld->texact];
- wrld->mtex[(int)wrld->texact] = wrld->mtex[((int)wrld->texact)+1];
- wrld->mtex[((int)wrld->texact)+1] = mtexswap;
- wrld->texact++;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_AO_FALLOFF:
- /* falloff distances option only supports plain */
- wrld= G.buts->lockpoin;
- if(wrld)
- wrld->aocolor= WO_AOPLAIN;
- scrarea_queue_winredraw(curarea);
- break;
- }
-}
-
-static void world_panel_mapto(World *wrld)
-{
- uiBlock *block;
- MTex *mtex;
-
- block= uiNewBlock(&curarea->uiblocks, "world_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Texture and Input", "World");
- if(uiNewPanel(curarea, block, "Map To", "World", 1280, 0, 318, 204)==0) return;
-
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- mtex->texco= TEXCO_VIEW;
- }
-
- /* TEXTURE OUTPUT */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, MTEX_STENCIL, B_WORLDPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture");
- uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_WORLDPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect");
- uiDefButBitS(block, TOG, MTEX_RGBTOINT, B_WORLDPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_WORLDPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, "");
- uiDefButF(block, NUMSLI, B_WORLDPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_WORLDPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_WORLDPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiBlockEndAlign(block);
- uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
-
- /* MAP TO */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, WOMAP_BLEND, B_WORLDPRV, "Blend", 10,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color progression of the background");
- uiDefButBitS(block, TOG, WOMAP_HORIZ, B_WORLDPRV, "Hori", 85,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the horizon");
- uiDefButBitS(block, TOG, WOMAP_ZENUP, B_WORLDPRV, "ZenUp", 160,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith above");
- uiDefButBitS(block, TOG, WOMAP_ZENDOWN, B_WORLDPRV, "ZenDo", 235,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith below");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, B_WORLDPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_WORLDPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
- uiDefButF(block, NUMSLI, B_WORLDPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects normal values");
- uiDefButF(block, NUMSLI, B_WORLDPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
-
-}
-
-static void world_panel_texture(World *wrld)
-{
- uiBlock *block;
- MTex *mtex;
- ID *id;
- int a, loos, num_mtex;
- char str[64], *strp;
-
- block= uiNewBlock(&curarea->uiblocks, "world_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Texture and Input", "World", 960, 0, 318, 204)==0) return;
-
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* TEX CHANNELS */
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiBlockBeginAlign(block);
- num_mtex= texture_channels_num_display(wrld->mtex);
- for(a= 0; a<num_mtex; a++) {
- mtex= wrld->mtex[a];
- if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
- else strcpy(str, "");
- str[10]= 0;
- uiDefButS(block, ROW, REDRAWBUTSSHADING, str,10, 160-18*a, 80, 20, &(wrld->texact), 3.0, (float)a, 0, 0, "Texture channel");
- }
- uiBlockEndAlign(block);
-
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- mtex->texco= TEXCO_VIEW;
- }
-
- /* TEXTUREBLOCK SELECT */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (ID *)mtex->tex;
- IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr));
- uiDefButS(block, MENU, B_WTEXBROWSE, strp, 100,140,20,19, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new");
- MEM_freeN(strp);
-
- if(id) {
- uiDefBut(block, TEX, B_IDNAME, "TE:", 100,160,200,19, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change");
- sprintf(str, "%d", id->us);
- uiDefBut(block, BUT, 0, str, 177,140,21,19, 0, 0, 0, 0, 0, "Displays number of users of texture: click to make single user");
- uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 155,140,21,19, 0, 0, 0, 0, 0, "Auto-assigns name to texture");
- if(id->lib) {
- if(wrld->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,140,21,19, 0, 0, 0, 0, 0, "");
- else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,140,21,19, 0, 0, 0, 0, 0, "");
- }
- uiBlockSetCol(block, TH_AUTO);
- uiDefBut(block, BUT, B_TEXCLEARWORLD, "Clear", 122, 140, 32, 19, 0, 0, 0, 0, 0, "Erases link to texture");
- }
- else
- uiDefButS(block, TOG, B_WTEXBROWSE, "Add New" ,100, 160, 200, 19, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock");
-
- uiBlockSetCol(block, TH_AUTO);
-
- /* copy/paste/up/down */
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_WMTEXCOPY, ICON_COPYUP, 200,140,25,19, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer");
- uiDefIconBut(block, BUT, B_WMTEXPASTE, ICON_PASTEUP, 225,140,25,19, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer");
- uiDefIconBut(block, BUT, B_WMTEXMOVEUP, VICON_MOVE_UP, 250,140,25,19, 0, 0, 0, 0, 0, "Move texture channel up");
- uiDefIconBut(block, BUT, B_WMTEXMOVEDOWN, VICON_MOVE_DOWN, 275,140,25,19, 0, 0, 0, 0, 0, "Move texture channel down");
-
- /* TEXCO */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_WORLDPRV, "View", 100,110,100,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Uses view vector for the texture coordinates");
- uiDefButS(block, ROW, B_WORLDPRV, "Global", 200,110,100,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates (interior mist)");
-
- uiDefButS(block, ROW, B_WORLDPRV, "AngMap", 100,90,70,20, &(mtex->texco), 4.0, (float)TEXCO_ANGMAP, 0, 0, "Uses 360 degree angular coordinates, e.g. for spherical light probes");
- uiDefButS(block, ROW, B_WORLDPRV, "Sphere", 170,90,65,20, &(mtex->texco), 4.0, (float)TEXCO_H_SPHEREMAP, 0, 0, "For 360 degree panorama sky, spherical mapped, only top half");
- uiDefButS(block, ROW, B_WORLDPRV, "Tube", 235,90,65,20, &(mtex->texco), 4.0, (float)TEXCO_H_TUBEMAP, 0, 0, "For 360 degree panorama sky, cylindrical mapped, only top half");
-
- uiDefButS(block, ROW, B_WORLDPRV, "Object", 100,70,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_WORLDPRV, "OB:", 170,70,130,20, &(mtex->object), "Object name to use for mapping");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_WORLDPRV, "dX", 100,40,100,19, mtex->ofs, -20.0, 20.0, 10, 0, "Fine tunes texture mapping X coordinate");
- uiDefButF(block, NUM, B_WORLDPRV, "dY", 100,20,100,19, mtex->ofs+1, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Y coordinate");
- uiDefButF(block, NUM, B_WORLDPRV, "dZ", 100, 0,100,19, mtex->ofs+2, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Z coordinate");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_WORLDPRV, "sizeX", 200,40,100,19, mtex->size, -10.0, 10.0, 10, 0, "Sets scaling for the texture's X size");
- uiDefButF(block, NUM, B_WORLDPRV, "sizeY", 200,20,100,19, mtex->size+1, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Y size");
- uiDefButF(block, NUM, B_WORLDPRV, "sizeZ", 200, 0,100,19, mtex->size+2, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Z size");
-
-}
-
-static void world_panel_mistaph(World *wrld)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "world_panel_mistaph", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Mist / Stars / Physics", "World", 640, 0, 318, 204)==0) return;
-
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
-#if GAMEBLENDER == 1
- uiDefButI(block, MENU, 1,
-#ifdef USE_ODE
- "Physics %t|None %x0|Sumo %x2|Ode %x4 |Bullet %x5",
-#else
- //"Physics %t|None %x0|Sumo %x2|Bullet %x5", //disable Sumo, until too many people complain ;-)
- "Physics %t|None %x0|Sumo (deprecated) %x2|Bullet %x5",
-#endif
- 10,180,140,19, &wrld->physicsEngine, 0, 0, 0, 0,
- "Physics Engine");
-
- /* Gravitation for the game worlds */
- uiDefButF(block, NUMSLI,0, "Grav ", 150,180,150,19, &(wrld->gravity), 0.0, 25.0, 0, 0, "Sets the gravitation constant of the game world");
-#endif
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, WO_MIST, B_WORLDPRV2,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation");
- uiBlockSetCol(block, TH_AUTO);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_WORLDPRV2, "Quad", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Mist uses quadratic progression");
- uiDefButS(block, ROW, B_WORLDPRV2, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Mist uses linear progression");
- uiDefButS(block, ROW, B_WORLDPRV2, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Mist uses inverse quadratic progression");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,B_WORLDPRV2, "Start:",10,70,140,19, &wrld->miststa, 0.0, 10000.0, 10, 0, "Specifies the starting distance of the mist");
- uiDefButF(block, NUM,B_WORLDPRV2, "Dist:",10,50,140,19, &wrld->mistdist, 0.0,10000.0, 10, 00, "Specifies the depth of the mist");
- uiDefButF(block, NUM,B_WORLDPRV2,"Height:", 10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specifies the factor for a less dense mist with increasing height");
- uiDefButF(block, NUMSLI, B_WORLDPRV2, "Misi ", 10,10,140,19, &(wrld->misi), 0., 1.0, 0, 0, "Sets the mist intensity");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, WO_STARS, B_WORLDPRV2, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation");
- uiBlockSetCol(block, TH_AUTO);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM,B_WORLDPRV2,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars");
- uiDefButF(block, NUM,B_WORLDPRV2,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars");
- uiDefButF(block, NUMSLI,B_WORLDPRV2,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars");
- uiDefButF(block, NUMSLI,B_WORLDPRV2,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes star color");
- uiBlockEndAlign(block);
-
-}
-
-static void world_panel_amb_occ(World *wrld)
-{
- uiBlock *block;
- short yco=PANEL_YMAX;
-
- block= uiNewBlock(&curarea->uiblocks, "world_panel_amb_oc", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Mist / Stars / Physics", "World");
- if(uiNewPanel(curarea, block, "Amb Occ", "World", PANELX, PANELY, PANELW, PANELH)==0) return;
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, WO_AMB_OCC, B_REDR, "Ambient Occlusion",
- X2CLM1, yco-=BUTH, BUTW1, BUTH, &wrld->mode, 0, 0, 0, 0, "Toggles ambient occlusion (soft shadows)");
- uiBlockSetCol(block, TH_AUTO);
-
- if(!(wrld->mode & WO_AMB_OCC)) return;
-
- yco -= YSPACE;
-
- if(wrld->ao_gather_method == WO_AOGATHER_RAYTRACE) {
- uiDefButS(block, NUM, B_REDR, "Samples:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aosamp, 1.0, 32.0, 100, 0, "Sets the number of samples used for AO (actual number: squared)");
-
- yco -= YSPACE;
-
- uiDefButF(block, NUM, B_REDR, "Max Dist:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aodist, 0.001, 5000.0, 100, 0, "Sets length of AO rays, defines how far away other faces give occlusion effect");
- }
- else {
- uiDefButS(block, NUM, B_REDR, "Passes:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->ao_approx_passes, 0.0, 10.0, 0, 0, "Sets the number of preprocessing passes to reduce overocclusion");
-
- yco -= YSPACE;
-
- uiDefButF(block, NUM, B_REDR, "Correction:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->ao_approx_correction, 0.0, 1.0, 0, 0, "Ad-hoc correction for over-occlusion due to the approximation.");
- }
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, WO_AODIST, B_AO_FALLOFF, "Use Falloff",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aomode, 0, 0, 0, 0, "When enabled, distances to objects will be used to attenuate shadows. Only for Plain AO.");
- if (wrld->aomode & WO_AODIST)
- uiDefButF(block, NUM, B_REDR, "Strength:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aodistfac, 0.00001, 10.0, 100, 0, "Distance attenuation factor, the higher, the 'shorter' the shadows");
- uiBlockEndAlign(block);
-
- /* column 2 */
- yco = PANEL_YMAX - BUTH - YSPACE;
-
- uiDefButS(block, MENU, B_REDR, "Gather Method%t|Raytrace %x0|Approximate %x1",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_gather_method, 0, 0, 0, 0, "Method for occlusion gathering: Raytrace: slow when noise free results are required, but accurate, Approximate: faster and without noise, but inaccurate");
-
- yco -= YSPACE;
-
- if(wrld->ao_gather_method == WO_AOGATHER_RAYTRACE) {
- uiDefButS(block, MENU, B_REDR, "Constant QMC %x2|Adaptive QMC %x1|Constant Jittered %x0",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Constant QMC: best quality, Adaptive QMC: fast in high contrast areas");
-
- yco -= YSPACE;
-
- if (wrld->ao_samp_method == WO_AOSAMP_HALTON) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_REDR, "Threshold:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_adapt_thresh, 0.0, 1.0, 100, 0, "Samples below this threshold will be considered fully shadowed/unshadowed and skipped");
- uiDefButF(block, NUMSLI, B_REDR, "Adapt Vec:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_adapt_speed_fac, 0.0, 1.0, 100, 0, "Use the speed vector pass to reduce AO samples in fast moving pixels. The higher the value, the more aggressive the sample reduction. Requires Vec pass enabled.");
- uiBlockEndAlign(block);
- } else if (wrld->ao_samp_method == WO_AOSAMP_CONSTANT) {
- uiDefButF(block, NUMSLI, B_REDR, "Bias:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->aobias, 0.0, 0.5, 10, 0, "Sets bias to prevent smoothed faces to show banding (in radians)");
- }
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_REDR, "Error:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_approx_error, 0.0001, 10.0, 0, 0, "Error tolerance (low values are slower and higher quality)");
-
- uiDefButBitS(block, TOG, WO_AOCACHE, B_REDR, "Pixel Cache",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->aomode, 0, 0, 0, 0, "Cache AO results in pixels and interpolate over neighbouring pixels for speedup.");
- uiBlockEndAlign(block);
- }
-
- yco = PANEL_YMAX - (5*BUTH+4*YSPACE);
-
- /* result mix modes */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_REDR, "Add",
- X3CLM1, yco-=BUTH, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOADD, 0, 0, "adds light/shadows");
- uiDefButS(block, ROW, B_REDR, "Sub",
- X3CLM2, yco, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOSUB, 0, 0, "subtracts light/shadows (needs at least one normal light to make anything visible)");
- uiDefButS(block, ROW, B_REDR, "Both",
- X3CLM3, yco, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOADDSUB, 0, 0, "both lightens & darkens");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- /* color treatment */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_REDR, "Plain",
- X3CLM1, yco-=BUTH, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOPLAIN, 0, 0, "Plain diffuse energy (white)");
- uiDefButS(block, ROW, B_REDR, "Sky Color",
- X3CLM2, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYCOL, 0, 0, "Use horizon and zenith color for diffuse energy");
- if(wrld->ao_gather_method == WO_AOGATHER_RAYTRACE)
- uiDefButS(block, ROW, B_REDR, "Sky Texture",
- X3CLM3, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYTEX, 0, 0, "Does full Sky texture render for diffuse energy");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- uiDefButF(block, NUMSLI, B_REDR, "Energy:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aoenergy, 0.01, 3.0, 100, 0, "Sets global energy scale for AO");
-}
-
-static void world_panel_world(World *wrld)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "world_panel_world", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "World", "World", 320, 0, 318, 204)==0) return;
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- std_libbuttons(block, 10, 180, 0, NULL, B_WORLDBROWSE, ID_WO, 0, (ID *)wrld, (ID *)G.scene, &(G.buts->menunr), B_WORLDALONE, B_WORLDLOCAL, B_WORLDDELETE, 0, B_KEEPDATA);
-
- if(wrld==NULL) return;
-
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
- uiBlockSetCol(block, TH_AUTO);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_WORLDPRV, "", 10,150,145,19, &wrld->horr, 0, 0, 0, B_COLHOR, "");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red color at the horizon");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green color at the horizon");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue color at the horizon");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red color at the zenith");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green color at the zenith");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue color at the zenith");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_WORLDPRV, "", 10,70,145,19, &wrld->ambr, 0, 0, 0, 0, "");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient color");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient color");
- uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient color");
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButF(block, NUMSLI,B_WORLDPRV2, "Exp ", 160,30,145,19, &(wrld->exp), 0.0, 1.0, 0, 2, "Sets amount of exponential color correction for light");
- uiDefButF(block, NUMSLI,B_WORLDPRV2, "Range ", 160,10,145,19, &(wrld->range), 0.2, 5.0, 0, 2, "Sets the color amount that will be mapped on color 1.0");
-
-
-}
-
-static void world_panel_preview(World *wrld)
-{
- uiBlock *block;
-
- /* name "Preview" is abused to detect previewrender offset panel */
- block= uiNewBlock(&curarea->uiblocks, "world_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Preview", "World", 0, 0, 318, 204)==0) return;
-
- if(wrld==NULL) return;
-
- uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockSetDrawExtraFunc(block, BIF_previewdraw);
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, WO_SKYBLEND, B_WORLDPRV,"Blend", 220,175,100,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with natural progression from horizon to zenith");
- uiDefButBitS(block, TOG,WO_SKYPAPER, B_WORLDPRV,"Paper", 220,150,100,25, &wrld->skytype, 0, 0, 0, 0, "Flattens blend or texture coordinates");
- /*if (wrld->skytype & WO_SKYBLEND) {*/ /* In some (rare?) cases its possible to use this, leave this out for now */
- uiDefButBitS(block, TOG, WO_SKYREAL, B_WORLDPRV,"Real", 220,125,100,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with a real horizon");
- /*}*/
- uiBlockEndAlign(block);
-
-}
-
-/* ************************ LAMP *************************** */
-
-void do_lampbuts(unsigned short event)
-{
- static short mtexcopied=0;
- static MTex mtexcopybuf;
- Lamp *la;
- MTex *mtex;
- MTex *mtexswap;
-
- switch(event) {
- case B_LAMPREDRAW:
- BIF_preview_changed(ID_LA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- break;
- case B_TEXCLEARLAMP:
- la= G.buts->lockpoin;
- mtex= la->mtex[ la->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- la->mtex[ la->texact ]= 0;
- BIF_undo_push("Unlink world texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_LA);
- }
- break;
- case B_SBUFF:
- la= G.buts->lockpoin;
- la->bufsize = la->bufsize&=(~15);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- break;
- case B_SHADBUF:
- la= G.buts->lockpoin;
- la->mode &= ~LA_SHAD_RAY;
- BIF_preview_changed(ID_LA);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_SHADRAY:
- la= G.buts->lockpoin;
- la->mode &= ~LA_SHAD_BUF;
- /* yafray: 'softlight' uses it's own shadbuf. flag.
- Must be cleared here too when switching from ray shadow */
- la->mode &= ~LA_YF_SOFT;
- BIF_preview_changed(ID_LA);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_LMTEXCOPY:
- la= G.buts->lockpoin;
- if(la && la->mtex[(int)la->texact] ) {
- mtex= la->mtex[(int)la->texact];
- if(mtex->tex==NULL) {
- error("No texture available");
- }
- else {
- memcpy(&mtexcopybuf, la->mtex[(int)la->texact], sizeof(MTex));
- mtexcopied= 1;
- }
- }
- break;
- case B_LMTEXPASTE:
- la= G.buts->lockpoin;
- if(la && mtexcopied && mtexcopybuf.tex) {
- if(la->mtex[(int)la->texact]==NULL )
- la->mtex[(int)la->texact]= MEM_mallocN(sizeof(MTex), "mtex");
- else if(la->mtex[(int)la->texact]->tex)
- la->mtex[(int)la->texact]->tex->id.us--;
-
- memcpy(la->mtex[(int)la->texact], &mtexcopybuf, sizeof(MTex));
-
- id_us_plus((ID *)mtexcopybuf.tex);
- BIF_undo_push("Paste mapping settings");
- BIF_preview_changed(ID_LA);
- scrarea_queue_winredraw(curarea);
- }
- break;
- case B_LMTEXMOVEUP:
- la= G.buts->lockpoin;
- if(la && (int)la->texact > 0) {
- mtexswap = la->mtex[(int)la->texact];
- la->mtex[(int)la->texact] = la->mtex[((int)la->texact)-1];
- la->mtex[((int)la->texact)-1] = mtexswap;
- la->texact--;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_LMTEXMOVEDOWN:
- la= G.buts->lockpoin;
- if(la && (int)la->texact < MAX_MTEX-1) {
- mtexswap = la->mtex[(int)la->texact];
- la->mtex[(int)la->texact] = la->mtex[((int)la->texact)+1];
- la->mtex[((int)la->texact)+1] = mtexswap;
- la->texact++;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_LFALLOFFCHANGED:
- la= G.buts->lockpoin;
- curvemapping_changed(la->curfalloff, 1);
- BIF_undo_push("Edit Lamp falloff curve");
- BIF_preview_changed(ID_LA);
- scrarea_queue_winredraw(curarea);
- break;
-
- }
-}
-
-
-static void lamp_panel_mapto(Object *ob, Lamp *la)
-{
- uiBlock *block;
- MTex *mtex;
-
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Texture and Input", "Lamp");
- if(uiNewPanel(curarea, block, "Map To", "Lamp", 1280, 0, 318, 204)==0) return;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- mtex= la->mtex[ la->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- mtex->texco= TEXCO_VIEW;
- }
-
- /* TEXTURE OUTPUT */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, MTEX_STENCIL, B_LAMPPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture");
- uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_LAMPPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect");
- uiDefButBitS(block, TOG, MTEX_RGBTOINT, B_LAMPPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_LAMPPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, "");
- uiDefButF(block, NUMSLI, B_LAMPPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_LAMPPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_LAMPPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiBlockEndAlign(block);
- uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
-
- /* MAP TO */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LAMAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp");
- uiDefButBitS(block, TOG, LAMAP_SHAD, B_LAMPPRV, "Shadow", 146,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the shadow color of the lamp");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
- uiBlockEndAlign(block);
-
- uiDefButF(block, NUMSLI, B_LAMPPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
-
-}
-
-
-static void lamp_panel_texture(Object *ob, Lamp *la)
-{
- uiBlock *block;
- MTex *mtex;
- ID *id;
- int a, loos, num_mtex;
- char *strp, str[64];
-
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Texture and Input", "Lamp", 960, 0, 318, 204)==0) return;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* TEX CHANNELS */
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiBlockBeginAlign(block);
- num_mtex= texture_channels_num_display(la->mtex);
- for(a= 0; a<num_mtex; a++) {
- mtex= la->mtex[a];
- if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
- else strcpy(str, "");
- str[10]= 0;
- uiDefButS(block, ROW, B_REDR, str, 10, 160-18*a, 80, 20, &(la->texact), 3.0, (float)a, 0, 0, "");
- }
- uiBlockEndAlign(block);
-
- mtex= la->mtex[ la->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- mtex->texco= TEXCO_VIEW;
- }
-
- /* TEXTUREBLOK SELECT */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (ID *)mtex->tex;
- IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr));
-
- /* doesnt work, because lockpoin points to lamp, not to texture */
- uiDefButS(block, MENU, B_LTEXBROWSE, strp, 100,140,20,19, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new");
- MEM_freeN(strp);
-
- if(id) {
- uiDefBut(block, TEX, B_IDNAME, "TE:", 100,160,200,19, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change");
- sprintf(str, "%d", id->us);
- uiDefBut(block, BUT, 0, str, 155,140,21,19, 0, 0, 0, 0, 0, "Displays number of users of texture: click to make single user");
- uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 177,140,21,19, 0, 0, 0, 0, 0, "Auto-assigns name to texture");
- if(id->lib) {
- if(la->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,140,21,19, 0, 0, 0, 0, 0, "");
- else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,140,21,19, 0, 0, 0, 0, 0, "");
- }
- uiBlockSetCol(block, TH_AUTO);
- uiDefBut(block, BUT, B_TEXCLEARLAMP, "Clear", 122, 140, 32, 19, 0, 0, 0, 0, 0, "Erases link to texture");
- }
- else
- uiDefButS(block, TOG, B_LTEXBROWSE, "Add New" ,100, 160, 200, 19, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock");
-
- /* copy/paste/up/down */
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_LMTEXCOPY, ICON_COPYUP, 200,140,25,19, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer");
- uiDefIconBut(block, BUT, B_LMTEXPASTE, ICON_PASTEUP, 225,140,25,19, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer");
- uiDefIconBut(block, BUT, B_LMTEXMOVEUP, VICON_MOVE_UP, 250,140,25,19, 0, 0, 0, 0, 0, "Move texture channel up");
- uiDefIconBut(block, BUT, B_LMTEXMOVEDOWN, VICON_MOVE_DOWN, 275,140,25,19, 0, 0, 0, 0, 0, "Move texture channel down");
-
-
- /* TEXCO */
- uiBlockSetCol(block, TH_AUTO);
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_LAMPPRV, "Glob", 100,110,60,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates");
- uiDefButS(block, ROW, B_LAMPPRV, "View", 160,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Uses view coordinates for the texture coordinates");
- uiDefButS(block, ROW, B_LAMPPRV, "Object", 230,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_LAMPPRV, "", 100,90,200,20, &(mtex->object), "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_LAMPPRV, "dX", 100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Fine tunes texture mapping X coordinate");
- uiDefButF(block, NUM, B_LAMPPRV, "dY", 100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Y coordinate");
- uiDefButF(block, NUM, B_LAMPPRV, "dZ", 100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Z coordinate");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_LAMPPRV, "sizeX", 200,50,100,18, mtex->size, -10.0, 10.0, 10, 0, "Sets scaling for the texture's X size");
- uiDefButF(block, NUM, B_LAMPPRV, "sizeY", 200,30,100,18, mtex->size+1, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Y size");
- uiDefButF(block, NUM, B_LAMPPRV, "sizeZ", 200,10,100,18, mtex->size+2, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Z size");
- uiBlockEndAlign(block);
-}
-
-static void lamp_panel_spot(Object *ob, Lamp *la)
-{
- uiBlock *block;
- float grid=0.0;
-
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Shadow and Spot", "Lamp", 640, 0, 318, 224)==0) return;
-
- /* hemis and ray shadow dont work at all... */
- /* yafray: ignore photonlight as well */
- if ((la->type==LA_HEMI) || (la->type==LA_YF_PHOTON)) return;
-
- if(G.vd) grid= G.vd->grid;
- if(grid<1.0) grid= 1.0;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
- if(la->type==LA_SPOT) {
- uiDefButBitI(block, TOG, LA_SHAD_BUF, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows using shadow buffer");
- if(la->mode & LA_SHAD_BUF) {
- char *tip= "Regular buffer type";
- if(la->buftype==LA_SHADBUF_IRREGULAR)
- tip= "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing";
- else if(la->buftype==LA_SHADBUF_HALFWAY)
- tip= "Regular buffer, averaging the closest and 2nd closest Z value for reducing biasing";
-
- uiDefButC(block, MENU, B_REDR, "Classical %x0|Classic-Halfway %x2|Irregular %x1", 10,140,80,19,&la->buftype, 0, 0, 0, 0, tip);
- }
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, LA_ONLYSHADOW, B_LAMPPRV,"OnlyShadow", 10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects");
- uiDefButBitI(block, TOG, LA_LAYER_SHADOW, B_LAMPPRV,"Layer", 10,90,80,19,&la->mode, 0, 0, 0, 0, "Causes only objects on the same layer to cast shadows");
- uiBlockEndAlign(block);
-
- if(la->type==LA_SPOT) {
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, LA_SQUARE, B_LAMPREDRAW,"Square", 10,60,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles");
- uiDefButBitI(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,40,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the spotlight beam in degrees");
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotBl ", 100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Sets the softness of the spotlight edge");
- uiBlockEndAlign(block);
-
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Sets the intensity of the spotlight halo");
-
- if(la->mode & LA_SHAD_BUF) {
- if(ELEM(la->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY)) {
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM,B_SBUFF,"ShadowBufferSize:", 100,110,200,19, &la->bufsize,512,10240, 0, 0, "Sets the size of the shadow buffer to nearest multiple of 16");
- uiDefButS(block, ROW,B_NOP, "Box", 100,90,65,19, &la->filtertype, 0.0, LA_SHADBUF_BOX, 0, 0, "Apply Box filter for shadowbuffer samples");
- uiDefButS(block, ROW,B_NOP, "Tent", 165,90,65,19, &la->filtertype, 0.0, LA_SHADBUF_TENT, 0, 0, "Apply Tent filter for shadowbuffer samples");
- uiDefButS(block, ROW,B_NOP, "Gauss", 230,90,70,19, &la->filtertype, 0.0, LA_SHADBUF_GAUSS, 0, 0, "Apply Gauss filter for shadowbuffer samples");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_NOP,"SampleBuffers: 1", 100,-15,140,19, &la->buffers, 1.0, 1.0, 0, 0, "Only one lampbuffer rendered");
- uiDefButS(block, ROW,B_NOP,"4", 240,-15,30,19, &la->buffers, 1.0, 4.0, 0, 0, "Renders 4 lampbuffers for better AA, this quadruples memory usage");
- uiDefButS(block, ROW,B_NOP,"9", 270,-15,30,19, &la->buffers, 1.0, 9.0, 0, 0, "Renders 9 lampbuffers for better AA, this uses nine times more memory");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM,B_LAMPREDRAW,"Samples:", 100,60,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples");
- uiDefButS(block, NUM,B_NOP,"Halo step:", 200,60,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency");
- uiDefButF(block, NUM,B_LAMPREDRAW,"Bias:", 100,40,100,19, &la->bias, 0.001, 5.0, 1, 0, "Sets the shadow map sampling bias");
- uiDefButF(block, NUM,B_LAMPREDRAW,"Soft:", 200,40,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area");
- }
- else { /* LA_SHADBUF_IRREGULAR */
- uiDefButF(block, NUM,B_LAMPREDRAW,"Bias:", 100,40,100,19, &la->bias, 0.001, 5.0, 1, 0, "Sets the shadow map sampling bias");
- }
-
- uiBlockBeginAlign(block);
- uiDefIconButBitC(block, TOG, LA_SHADBUF_AUTO_START, B_REDR, ICON_AUTO, 10, 10, 25, 19, &la->bufflag, 0.0, 0.0, 0, 0, "Automatic calculation of clipping-start, based on visible vertices");
- if(la->bufflag & LA_SHADBUF_AUTO_START)
- uiDefBut(block, LABEL, B_NOP, "ClipSta: Auto", 35,10,115,19, NULL, 0, 0, 0, 0, "");
- else
- uiDefButF(block, NUM,REDRAWVIEW3D,"ClipSta:", 35,10,115,19, &la->clipsta, 0.1*grid,1000.0*grid, 10, 0, "Sets the shadow map clip start: objects closer will not generate shadows");
- uiDefIconButBitC(block, TOG, LA_SHADBUF_AUTO_END, B_REDR, ICON_AUTO, 160, 10, 25, 19, &la->bufflag, 0.0, 0.0, 0, 0, "Automatic calculation of clipping-end, based on visible vertices");
- if(la->bufflag & LA_SHADBUF_AUTO_END)
- uiDefBut(block, LABEL,B_NOP, "ClipEnd: Auto", 185,10,115,19, NULL, 0, 0, 0, 0, "");
- else
- uiDefButF(block, NUM,REDRAWVIEW3D,"ClipEnd:", 185,10,115,19,&la->clipend, 1.0, 5000.0*grid, 100, 0, "Sets the shadow map clip end beyond which objects will not generate shadows");
- uiBlockEndAlign(block);
-
- }
- }
- if(ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL)) {
-
- if(la->mode & LA_SHAD_RAY) {
- if (ELEM3(la->type, LA_SPOT, LA_SUN, LA_LOCAL)) {
- if (la->ray_samp_method == LA_SAMP_CONSTANT) la->ray_samp_method = LA_SAMP_HALTON;
-
- uiDefButS(block, MENU, B_REDR, "Adaptive QMC %x1|Constant QMC %x2",
- 100,110,200,19, &la->ray_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower");
-
- uiDefButF(block, NUM,B_LAMPREDRAW,"Soft Size", 100,80,200,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size, doesn't affect energy amount");
-
- uiDefButS(block, NUM,0,"Samples:", 100,60,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)");
- if (la->ray_samp_method == LA_SAMP_HALTON)
- uiDefButF(block, NUM,0,"Threshold:", 100,40,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow");
- }
- else if (la->type == LA_AREA) {
- uiDefButS(block, MENU, B_REDR, "Adaptive QMC %x1|Constant QMC %x2|Constant Jittered %x0",
- 100,180,200,19, &la->ray_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Adaptive QMC is fastest");
-
- if (la->ray_samp_method == LA_SAMP_CONSTANT) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, LA_SAMP_UMBRA, 0,"Umbra", 100,90,200,19,&la->ray_samp_type, 0, 0, 0, 0, "Emphasis parts that are fully shadowed");
- uiDefButBitS(block, TOG, LA_SAMP_DITHER, 0,"Dither", 100,70,100,19,&la->ray_samp_type, 0, 0, 0, 0, "Use 2x2 dithering for sampling");
- uiDefButBitS(block, TOG, LA_SAMP_JITTER, 0,"Noise", 200,70,100,19,&la->ray_samp_type, 0, 0, 0, 0, "Use noise for sampling");
- uiBlockEndAlign(block);
- } else if (la->ray_samp_method == LA_SAMP_HALTON) {
- uiDefButF(block, NUM,0,"Threshold:", 100,90,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow");
- }
- }
- }
- /* also for non-shadow case, it's using light samples */
- if(la->type == LA_AREA) {
- if(la->area_shape==LA_AREA_SQUARE)
- uiDefButS(block, NUM,0,"Samples:", 100,150,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)");
- else if(la->area_shape==LA_AREA_CUBE)
- uiDefButS(block, NUM,0,"Samples:", 100,130,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp x samp)");
-
- if (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_BOX)) {
- uiDefButS(block, NUM,0,"SamplesX:", 100,150,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of X samples taken extra");
- uiDefButS(block, NUM,0,"SamplesY:", 100,130,200,19, &la->ray_sampy, 1.0, 16.0, 100, 0, "Sets the amount of Y samples taken extra");
- if(la->area_shape==LA_AREA_BOX)
- uiDefButS(block, NUM,0,"SamplesZ:", 100,110,200,19, &la->ray_sampz, 1.0, 8.0, 100, 0, "Sets the amount of Z samples taken extra");
- }
- }
- }
- else uiDefBut(block, LABEL,0," ", 100,180,200,19,NULL, 0, 0, 0, 0, "");
-
- if(ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && ((la->mode & LA_SHAD_RAY)||(la->mode & LA_SHAD_BUF))) {
- short yval= 10;
- if(la->type == LA_SPOT && (la->mode & LA_SHAD_BUF))
- yval= -15;
- if(la->type != LA_SPOT)
- uiDefBut(block, LABEL, 0, "Shadow", 10,30,90,19,NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, 0, "", 10,yval,90,19,&la->shdwr, 0, 0, 0, B_COLLAMP, "Sets the shadow color; default is black (RGB 0,0,0)");
- }
-
-}
-
-/* yafray: adaptation of lamp_panel_spot above with yafray specific parameters */
-static void lamp_panel_yafray(Object *ob, Lamp *la)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_yafray", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Yafray: Shadow and Photons", "Lamp", 640, 0, 318, 204)==0) return;
-
- /* hemis not used in yafray */
- if(la->type==LA_HEMI) return;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- /* photonlight params */
- if (la->type==LA_YF_PHOTON) {
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, 1, B_DIFF,"Use QMC",10,180,80,19,&la->YF_useqmc, 0, 0, 0, 0, "Use QMC sampling (sometimes visible patterns)");
- uiBlockSetCol(block, TH_AUTO);
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"Angle ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the photonlight beam in degrees");
- uiDefButI(block, NUM,B_DIFF,"photons:", 10,150,290,19, &la->YF_numphotons, 10000, 100000000, 0, 0, "Maximum number of photons to shoot");
- uiDefButI(block, NUM,B_DIFF,"search:", 10,130,290,19, &la->YF_numsearch, 100, 1000, 0, 0, "Number of photons to mix (blur)");
- uiDefButS(block, NUM,B_DIFF,"depth:", 10,100,290,19, &la->YF_phdepth, 1, 100, 0, 0, "Maximum caustic bounce depth");
- uiDefButF(block, NUM,B_DIFF,"Blur:", 10,70,290,19, &la->YF_causticblur, 0.01, 1.0, 1, 0, "Amount of caustics blurring (also depends on search)");
- return;
- }
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
-
- /* in yafray arealights always cast shadows, so ray shadow flag not needed */
- /* ray shadow also not used when halo for spot enabled */
- if ((la->type!=LA_AREA) && (!((la->type==LA_SPOT) && (la->mode & LA_HALO))))
- uiDefButBitI(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow");
-
- /* in yafray the regular lamp can use shadowbuffers (softlight), used by spot with halo as well */
- /* to prevent clash with blender shadowbuf flag, a special flag is used for yafray */
- if (la->type==LA_LOCAL) {
- uiDefButBitI(block, TOG, LA_YF_SOFT, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets light produce shadows using shadow buffer");
- uiDefButF(block, NUM, B_DIFF, "GloInt:", 100,155,200,19, &la->YF_glowint, 0.0, 1.0, 1, 0, "Sets light glow intensity, 0 is off");
- uiDefButF(block, NUM, B_DIFF, "GloOfs:", 100,135,100,19, &la->YF_glowofs, 0.0, 2.0, 1, 0, "Sets light glow offset, the higher, the less 'peaked' the glow");
- uiDefButS(block, NUM, B_DIFF, "GlowType:", 200,135,100,19, &la->YF_glowtype, 0, 1, 1, 0, "Sets light glow type");
- }
-
- /* shadowbuffers used only for 'softlight' & spotlight with halo */
- if (((la->type==LA_LOCAL) && (la->mode & LA_YF_SOFT)) || ((la->type==LA_SPOT) && (la->mode & LA_HALO))) {
- /* Shadow buffer size can be anything in yafray, but reasonable minimum is 128 */
- /* Maximum is 1024, since zbuf in yafray is float, no multiple of 16 restriction */
- uiDefButS(block, NUM,B_DIFF,"ShadowBufferSize:", 100,110,200,19, &la->YF_bufsize, 128, 1024, 0, 0, "Sets the size of the shadow buffer");
-
- /* samples & halostep params only used for spotlight with halo */
- if ((la->type==LA_SPOT) && (la->mode & LA_HALO)) {
- uiDefButS(block, NUM,B_DIFF,"Samples:", 100,30,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples");
- uiDefButS(block, NUM,B_DIFF,"Halo step:", 200,30,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency");
- }
- uiDefButF(block, NUM,B_DIFF,"Bias:", 100,10,100,19, &la->bias, 0.01, 5.0, 1, 0, "Sets the shadow map sampling bias");
- /* here can use the Blender soft param, since for yafray it has the same function as in Blender */
- uiDefButF(block, NUM,B_DIFF,"Soft:", 200,10,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area");
- }
- else if ((la->type==LA_LOCAL) && (la->mode & LA_SHAD_RAY)) {
- /* for spherelight, light radius */
- uiDefButF(block, NUM,B_DIFF,"Radius:", 200,10,100,19, &la->YF_ltradius, 0.0,100.0, 100, 0, "Sets the radius of the lightsource, 0 is same as pointlight");
- }
-
- if (la->type==LA_SPOT) {
-
- uiDefButBitI(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo");
-
- uiBlockSetCol(block, TH_AUTO);
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the spotlight beam in degrees");
- uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotBl ", 100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Sets the softness of the spotlight edge");
- uiBlockEndAlign(block);
-
- if (la->mode & LA_HALO) uiDefButF(block, NUMSLI,0,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Sets the intensity of the spotlight halo");
- }
- else if ((la->type==LA_AREA) || ((la->type==LA_LOCAL) && (la->mode & LA_SHAD_RAY))) {
- /* area samples param also used for 'spherelight' */
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_AUTO);
-
- uiDefButS(block, NUM,B_DIFF,"Samples:", 100,180,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)");
-
- /* shadow sampling types not used in yafray, removed */
- }
- else uiDefBut(block, LABEL,0," ", 100,180,200,19,NULL, 0, 0, 0, 0, "");
-
-}
-
-static void lamp_panel_atmosphere(Object *ob, Lamp *la)
-{
- uiBlock *block;
- int y;
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_atm", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Shadow and Spot", "Lamp");
- if(uiNewPanel(curarea, block, "Sky/Atmosphere", "Lamp", 3*PANELX, PANELY, PANELW, PANELH)==0) return;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiDefButBitS(block, TOG, LA_SUN_EFFECT_SKY, B_LAMPPRV, "Sky", 10,205,BUTW2,20,&(la->sun_effect_type), 0, 0, 0, 0, "Apply sun light effect on sky.");
- uiDefButBitS(block, TOG, LA_SUN_EFFECT_AP, REDRAWVIEW3D, "Atmosphere", 20+BUTW2,205,BUTW2,20,&(la->sun_effect_type), 0, 0, 0, 0, "Apply sun light effect on atmosphere.");
-
- if(la->sun_effect_type & (LA_SUN_EFFECT_SKY|LA_SUN_EFFECT_AP)){
- uiDefButF(block, NUM, B_LAMPREDRAW, "Turbidity:",10,180,BUTW1,19, &(la->atm_turbidity), 1.000f, 30.0f, 1, 0, "Sky Turbidity");
- }
-
- y = 180;
- if(la->sun_effect_type & LA_SUN_EFFECT_SKY)
- {
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, B_LAMPPRV, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Overlay %x9|Divide %x5|Difference %x6|Darken %x7|Lighten %x8|Dodge %x10|Burn %x11|Color %x15|Value %x14|Saturation %x13|Hue %x12",
- 10,y-25,BUTW2/2,19,
- &la->skyblendtype, 0.0f, 0.0f, 0, 0, "Blend type for how it gets combined with sky");
- uiDefButF(block, NUM, B_LAMPPRV, "",10+BUTW2/2,y-25,BUTW2/2,19, &(la->skyblendfac), 0.0f, 2.0f, 10, 0, "Sets blending factor with sky color");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, B_LAMPPRV, "SMPTE %x0|REC709 %x1|CIE %x2",
- 10,126,60,22, &la->sky_colorspace, 0.0f, 0.0f, 0, 0, "Color space");
-
- uiDefButF(block, NUM, B_LAMPPRV, "Exp:",70,126,BUTW2-60,22, &(la->sky_exposure), 0.00f, 20.00f, 10, 0, "Exposure correction, zero is no correction.");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_LAMPPRV, "Hor.Bright:",10,98,BUTW2,22, &(la->horizon_brightness), 0.00f, 20.00f, 10, 0, "Sets horizon brightness.");
- uiDefButF(block, NUM, B_LAMPPRV, "Hor.Spread:",10,76,BUTW2,22, &(la->spread), 0.00f, 10.00f, 10, 0, "Sets horizon spread.");
- uiDefButF(block, NUM, B_LAMPPRV, "Sun Bright:",10,54,BUTW2,22, &(la->sun_brightness), 0.00f, 10.0f, 10, 0, "Sets sun brightness.");
- uiDefButF(block, NUM, B_LAMPPRV, "Sun Size:",10,32,BUTW2,22, &(la->sun_size), 0.00f, 10.00f, 10, 0, "Sets sun size.");
- uiDefButF(block, NUM, B_LAMPPRV, "Back Light:",10,10,BUTW2,22, &(la->backscattered_light), -1.00f, 1.00f, 10, 0, "Sets backscatter light.");
- }
-
- if(la->sun_effect_type & LA_SUN_EFFECT_AP)
- {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_LAMPREDRAW, "Sun Intens.:",20+BUTW2,76,BUTW2,22, &(la->sun_intensity), 0.00f, 10.00f, 10, 0, "Sets sun intensity.");
- uiDefButF(block, NUM, B_LAMPREDRAW, "Inscattering:",20+BUTW2,54,BUTW2,22, &(la->atm_inscattering_factor), 0.00f, 1.00f, 10, 0, "In Scattering Contribution Factor.");
- uiDefButF(block, NUM, B_LAMPREDRAW, "Extinction:",20+BUTW2,32,BUTW2,22, &(la->atm_extinction_factor), 0.00f, 1.00f, 10, 0, "Extinction Scattering Contribution Factor.");
- uiDefButF(block, NUM, B_LAMPREDRAW, "Distance:",20+BUTW2,10,BUTW2,22, &(la->atm_distance_factor), 0.000f, 500.0f, 10, 0, "Scale blender distance to real distance.");
- }
-}
-
-static void lamp_panel_falloff(Object *ob, Lamp *la)
-{
- uiBlock *block;
- rctf butr;
- short yco=PANEL_YMAX;
- float grid= 0.0;
-
- /* name "Preview" is abused to detect previewrender offset panel */
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_falloff", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Lamp", "Lamp");
- if(uiNewPanel(curarea, block, "Falloff Curve", "Lamp", PANELX, PANELY, PANELW, PANELH)==0) return;
-
- if(G.vd) grid= G.vd->grid;
- if(grid<1.0) grid= 1.0;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- BLI_init_rctf(&butr, 10.0, 310.0, 10.0, (float)yco);
- curvemap_buttons(block, la->curfalloff, 's', B_LFALLOFFCHANGED, B_LAMPREDRAW, &butr);
-
-}
-
-static void lamp_panel_lamp(Object *ob, Lamp *la)
-{
- uiBlock *block;
- float grid= 0.0;
- short xco;
-
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_lamp", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Lamp", "Lamp", 320, 0, 318, 204)==0) return;
-
- if(G.vd) grid= G.vd->grid;
- if(grid<1.0) grid= 1.0;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- xco= std_libbuttons(block, 8, 180, 0, NULL, B_LAMPBROWSE, ID_LA, 0, (ID *)la, (ID *)ob, &(G.buts->menunr), B_LAMPALONE, B_LAMPLOCAL, 0, 0, 0);
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:", xco,180,300-xco,20,&la->dist, 0.01, 5000.0*grid, 100, 0, "Sets the distance value at which light intensity is half");
-
- uiBlockBeginAlign(block);
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
- if(la->type==LA_AREA) {
- //uiDefButS(block, MENU, B_LAMPREDRAW, "Shape %t|Square %x0|Rect %x1|Cube %x2|Box %x3",
- uiDefButS(block, MENU, B_LAMPREDRAW, "Shape %t|Square %x0|Rect %x1",
- 10, 150, 100, 19, &la->area_shape, 0,0,0,0, "Sets area light shape");
- if (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_BOX)){
- uiDefButF(block, NUM,B_LAMPREDRAW,"SizeX ", 10,130,100,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size X, doesn't affect energy amount");
- uiDefButF(block, NUM,B_LAMPREDRAW,"SizeY ", 10,110,100,19, &la->area_sizey, 0.01, 100.0, 10, 0, "Area light size Y, doesn't affect energy amount");
- }
- if(la->area_shape==LA_AREA_BOX)
- uiDefButF(block, NUM,B_LAMPREDRAW,"SizeZ ", 10,90,100,19, &la->area_sizez, 0.01, 100.0, 10, 0, "Area light size Z, doesn't affect energy amount");
- if (ELEM(la->area_shape, LA_AREA_SQUARE, LA_AREA_CUBE))
- uiDefButF(block, NUM,B_LAMPREDRAW,"Size ", 10,130,100,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size, doesn't affect energy amount");
- }
- else if( ELEM(la->type, LA_LOCAL, LA_SPOT)) {
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButS(block, MENU, B_LAMPREDRAW, "Falloff %t|Constant %x0|Inverse Linear %x1|Inverse Square %x2|Custom Curve %x3|Lin/Quad Weighted %x4|",
- 10,150,100,19, &la->falloff_type, 0,0,0,0, "Lamp falloff - intensity decay with distance");
- uiDefButBitI(block, TOG, LA_SPHERE, B_LAMPPRV,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value");
- }
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitI(block, TOG, LA_LAYER, 0,"Layer", 10,70,100,19,&la->mode, 0, 0, 0, 0, "Illuminates objects in the same layer as the lamp only");
- uiDefButBitI(block, TOG, LA_NEG, B_LAMPPRV,"Negative", 10,50,100,19,&la->mode, 0, 0, 0, 0, "Sets lamp to cast negative light");
- uiDefButBitI(block, TOG, LA_NO_DIFF, B_LAMPPRV,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp");
- uiDefButBitI(block, TOG, LA_NO_SPEC, B_LAMPPRV,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_AUTO);
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Energy ", 120,150,180,20, &(la->energy), 0.0, 10.0, 0, 0, "Sets the intensity of the light");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI,B_LAMPPRV,"R ", 120,120,180,20,&la->r, 0.0, 1.0, B_COLLAMP, 0, "Sets the red component of the light");
- uiDefButF(block, NUMSLI,B_LAMPPRV,"G ", 120,100,180,20,&la->g, 0.0, 1.0, B_COLLAMP, 0, "Sets the green component of the light");
- uiDefButF(block, NUMSLI,B_LAMPPRV,"B ", 120,80,180,20,&la->b, 0.0, 1.0, B_COLLAMP, 0, "Sets the blue component of the light");
- uiBlockEndAlign(block);
-
- uiDefButF(block, COL, B_LAMPPRV, "", 120,52,180,24, &la->r, 0, 0, 0, B_COLLAMP, "");
- uiBlockEndAlign(block);
-
- if (ELEM(la->type, LA_LOCAL, LA_SPOT) && (la->falloff_type == LA_FALLOFF_SLIDERS)) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Linear ", 120,30,180,19,&la->att1, 0.0, 1.0, 0, 0, "Set the linear distance attenuation for a Lin/Quad Weighted lamp");
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Quad ", 120,10,180,19,&la->att2, 0.0, 1.0, 0, 0, "Set the quadratic distance attenuation for a Lin/Quad Weighted lamp");
- }
- else if(la->type==LA_AREA) {
- if(la->k==0.0) la->k= 1.0;
- uiDefButF(block, NUMSLI,B_LAMPPRV,"Gamma ", 120,10,180,19,&la->k, 0.001, 2.0, 100, 0, "Set the light gamma correction value");
- }
-
-}
-
-
-static void lamp_panel_preview(Object *ob, Lamp *la)
-{
- uiBlock *block;
-
- /* name "Preview" is abused to detect previewrender offset panel */
- block= uiNewBlock(&curarea->uiblocks, "lamp_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Preview", "Lamp", 0, 0, 318, 204)==0) return;
-
- uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE);
-
- uiBlockSetDrawExtraFunc(block, BIF_previewdraw);
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_LAMPREDRAW,"Lamp", 200,175,80,25,&la->type,1.0,(float)LA_LOCAL, 0, 0, "Creates an omnidirectional point light source");
- uiDefButS(block, ROW,B_LAMPREDRAW,"Area", 200,150,80,25,&la->type,1.0,(float)LA_AREA, 0, 0, "Creates a directional area light source");
- uiDefButS(block, ROW,B_LAMPREDRAW,"Spot", 200,125,80,25,&la->type,1.0,(float)LA_SPOT, 0, 0, "Creates a directional cone light source");
- uiDefButS(block, ROW,B_LAMPREDRAW,"Sun", 200,100,80,25,&la->type,1.0,(float)LA_SUN, 0, 0, "Creates a constant direction parallel ray light source");
- uiDefButS(block, ROW,B_LAMPREDRAW,"Hemi", 200,75,80,25,&la->type,1.0,(float)LA_HEMI, 0, 0, "Creates a 180 degree constant light source");
- /* yafray: extra type, photonlight */
- if (G.scene->r.renderer==R_YAFRAY)
- uiDefButS(block, ROW,B_LAMPREDRAW,"Photon", 200,50,80,25,&la->type,1.0,(float)LA_YF_PHOTON, 0, 0, "Creates a special caustics photon 'light', not a real lightsource, use with other lights");
-}
-
-
-/* ****************** MATERIAL ***************** */
-
-
-void do_matbuts(unsigned short event)
-{
- static short mtexcopied=0;
- static MTex mtexcopybuf;
- Material *ma;
- MTex *mtex;
- MTex *mtexswap;
-
- /* all operations default on active material layer here */
- /* but this also gets called for lamp and world... */
- ma= G.buts->lockpoin;
- if(ma && GS(ma->id.name)==ID_MA)
- ma = editnode_get_active_material(ma);
- else
- ma= NULL;
-
- switch(event) {
- case B_MAT_YF_PRESET: {
- switch (ma->YF_preset) {
- case 0:
- /* normal mode, no reflection/refraction */
- ma->alpha = 1;
- ma->mode &= ~(MA_RAYMIRROR+MA_RAYTRANSP+MA_ZTRA);
- break;
- case 1: {
- /* clear glass */
- ma->alpha = 0.001;
- ma->ray_mirror = 1;
- ma->fresnel_mir_i = 5;
- ma->mode |= (MA_RAYMIRROR+MA_RAYTRANSP);
- ma->mode &= ~MA_ZTRA;
- ma->filter = 0;
- ma->ang = 1.5;
- break;
- }
- case 2: {
- /* color glass */
- ma->alpha = 0.001;
- ma->ray_mirror = 1;
- ma->fresnel_mir_i = 5;
- ma->mode |= (MA_RAYMIRROR+MA_RAYTRANSP);
- ma->mode &= ~MA_ZTRA;
- ma->filter = 1;
- ma->ang = 1.5;
- break;
- }
- case 3: {
- /* uniform reflect */
- ma->alpha = 1;
- ma->ray_mirror = 1;
- ma->fresnel_mir_i = 1;
- ma->mode |= MA_RAYMIRROR;
- ma->mode &= ~(MA_RAYTRANSP+MA_ZTRA);
- break;
- }
- case 4: {
- /* fresnel reflect */
- ma->alpha = 1;
- ma->ray_mirror = 1;
- ma->fresnel_mir_i = 5;
- ma->mode |= MA_RAYMIRROR;
- ma->mode &= ~(MA_RAYTRANSP+MA_ZTRA);
- ma->ang = 3;
- break;
- }
- }
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 0);
- shade_buttons_change_3d();
- break;
- }
- case B_ACTCOL:
- scrarea_queue_headredraw(curarea);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_MA);
- break;
- case B_MATFROM:
- scrarea_queue_headredraw(curarea);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- // BIF_previewdraw(); push/pop!
- break;
- case B_MATPRV:
- if(ma) end_render_material(ma); /// temporal... 3d preview
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 0);
- shade_buttons_change_3d();
- break;
- case B_LAMPPRV:
- BIF_preview_changed(ID_LA);
- allqueue(REDRAWBUTSSHADING, 0);
- shade_buttons_change_3d();
- break;
- case B_WORLDPRV:
- BIF_preview_changed(ID_WO);
- allqueue(REDRAWBUTSSHADING, 0);
- break;
- case B_WORLDPRV2:
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_MATHALO:
- /* when halo is disabled, clear star flag, this is the same as MA_FACETEXTURE <blush> */
- /* same for 'xtreme alpha' which is 'only shadow' */
- if(ma) {
- if((ma->mode & MA_HALO)==0) {
- ma->mode &= ~(MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV);
- }
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 0);
- shade_buttons_change_3d();
- }
- break;
- case B_TEXCLEAR:
- mtex= ma->mtex[(int) ma->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- ma->mtex[ (int) ma->texact ]= 0;
- BIF_undo_push("Unlink material texture");
- if(ma) end_render_material(ma); /// temporal... 3d preview
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_MA);
- }
- break;
- case B_MTEXCOPY:
- if(ma && ma->mtex[(int)ma->texact] ) {
- mtex= ma->mtex[(int)ma->texact];
- if(mtex->tex==NULL) {
- error("No texture available");
- }
- else {
- memcpy(&mtexcopybuf, ma->mtex[(int)ma->texact], sizeof(MTex));
- mtexcopied= 1;
- }
- }
- break;
- case B_MTEXPASTE:
- if(ma && mtexcopied && mtexcopybuf.tex) {
- if(ma->mtex[(int)ma->texact]==NULL )
- ma->mtex[(int)ma->texact]= MEM_mallocN(sizeof(MTex), "mtex");
- else if(ma->mtex[(int)ma->texact]->tex)
- ma->mtex[(int)ma->texact]->tex->id.us--;
-
- memcpy(ma->mtex[(int)ma->texact], &mtexcopybuf, sizeof(MTex));
-
- id_us_plus((ID *)mtexcopybuf.tex);
- BIF_undo_push("Paste mapping settings");
- BIF_preview_changed(ID_MA);
- scrarea_queue_winredraw(curarea);
- }
- break;
- case B_MTEXMOVEUP:
- if(ma && (int)ma->texact > 0) {
- int mtexuse = ma->septex & (1<<((int)ma->texact));
- ma->septex &= ~(1<<((int)ma->texact));
- ma->septex |= (ma->septex & (1<<((int)ma->texact-1))) << 1;
- ma->septex &= ~(1<<((int)ma->texact-1));
- ma->septex |= mtexuse >> 1;
- mtexswap = ma->mtex[(int)ma->texact];
- ma->mtex[(int)ma->texact] = ma->mtex[((int)ma->texact)-1];
- ma->mtex[((int)ma->texact)-1] = mtexswap;
- ma->texact--;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_MTEXMOVEDOWN:
- if(ma && (int)ma->texact < MAX_MTEX-1) {
- int mtexuse = ma->septex & (1<<((int)ma->texact));
- ma->septex &= ~(1<<((int)ma->texact));
- ma->septex |= (ma->septex & (1<<((int)ma->texact+1))) >> 1;
- ma->septex &= ~(1<<((int)ma->texact+1));
- ma->septex |= mtexuse << 1;
- mtexswap = ma->mtex[(int)ma->texact];
- ma->mtex[(int)ma->texact] = ma->mtex[((int)ma->texact)+1];
- ma->mtex[((int)ma->texact)+1] = mtexswap;
- ma->texact++;
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_MATZTRANSP:
- if(ma) {
- ma->mode &= ~MA_RAYTRANSP;
- //BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); /// temporal... 3d preview
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_MA);
- }
- break;
- case B_MATRAYTRANSP:
- if(ma) {
- ma->mode &= ~MA_ZTRA;
- if(ma) end_render_material(ma); /// temporal... 3d preview
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_MA);
- }
- break;
- case B_MATCOLORBAND:
- if(ma) {
- if(ma->mode & MA_RAMP_COL)
- if(ma->ramp_col==NULL) ma->ramp_col= add_colorband(0);
- if(ma->mode & MA_RAMP_SPEC)
- if(ma->ramp_spec==NULL) ma->ramp_spec= add_colorband(0);
-
- if(ma) end_render_material(ma); /// temporal... 3d preview
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_MA);
- shade_buttons_change_3d();
- }
- break;
- case B_MAT_USENODES:
- ma= G.buts->lockpoin; /* use base material instead */
- if(ma) {
- if(ma->use_nodes && ma->nodetree==NULL) {
- node_shader_default(ma);
- }
- if(ma) end_render_material(ma); /// temporal... 3d preview
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- }
- break;
- case B_MAT_VCOL_PAINT:
- if(ma) {
- ma->mode &= ~MA_VERTEXCOL;
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
- case B_MAT_VCOL_LIGHT:
- if(ma) {
- ma->mode &= ~MA_VERTEXCOLP;
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 0);
- }
- break;
-
- case B_MAT_PARTICLE:
- if(ma) {
- Base *base;
- Object *ob;
- ParticleSystem *psys;
-
- base= G.scene->base.first;
- while(base){
- if(base->object->type==OB_MESH) {
- ob=base->object;
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys && ma==give_current_material(ob,psys->part->omat)) {
- psys->recalc |= PSYS_INIT | PSYS_RECALC_HAIR;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
- base = base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-}
-
-static void particle_recalc_material(void *ma_v, void *arg2)
-{
- Material *ma = ma_v;
- Base *base;
- Object *ob;
- ParticleSystem *psys;
-
- base= G.scene->base.first;
- while(base){
- if(base->object->type==OB_MESH){
- ob=base->object;
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- if(psys && ma==give_current_material(ob,psys->part->omat)){
- psys->recalc |= PSYS_INIT | PSYS_RECALC_HAIR;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
- base = base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* if from nodes, hide options that are not available */
-static void material_panel_map_to(Object *ob, Material *ma, int from_nodes)
-{
- uiBlock *block;
- uiBut *but;
- MTex *mtex;
- ParticleSystem *psys;
- int psys_mapto=0;
- static short pattr=0;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_map_to", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Texture", "Material");
- if(uiNewPanel(curarea, block, "Map To", "Material", 1600, 0, 318, 204)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- mtex= ma->mtex[ ma->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- }
-
- /* TEXTURE OUTPUT */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, MTEX_STENCIL, B_MATPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture");
- uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_MATPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect");
- uiDefButBitS(block, TOG,MTEX_RGBTOINT, B_MATPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_MATPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, "");
-
- if(ma->colormodel==MA_HSV) {
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButF(block, HSVSLI, B_MATPRV, "H ", 10,80,135,19, &(mtex->r), 0.0, 0.9999, B_MTEXCOL, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "S ", 10,60,135,19, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "V ", 10,40,135,19, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, "");
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- uiDefButF(block, NUMSLI, B_MATPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_MATPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- uiDefButF(block, NUMSLI, B_MATPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
- }
- uiBlockEndAlign(block);
-
- /*check if material is being used by particles*/
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- if(psys->part->omat==ob->actcol)
- psys_mapto=1;
-
- but = uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
- if(psys_mapto && mtex->pmapto & MAP_PA_INIT)
- uiButSetFunc(but, particle_recalc_material, ma, NULL);
-
- /* MAP TO */
- uiBlockBeginAlign(block);
-
- if(psys_mapto && pattr) {
- but=uiDefButBitS(block, TOG3, MAP_PA_TIME, B_MAT_PARTICLE, "Time", 10,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the emission time of particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- but=uiDefButBitS(block, TOG3, MAP_PA_LIFE, B_MAT_PARTICLE, "Life", 70,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the life time of particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- but=uiDefButBitS(block, TOG3, MAP_PA_DENS, B_MAT_PARTICLE, "Dens", 130,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the density of particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- uiDefButBitS(block, TOG3, MAP_PA_IVEL, B_MAT_PARTICLE, "IVel", 190,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the initial velocity of particles");
- uiDefButBitS(block, TOG3, MAP_PA_ROUGH, B_MAT_PARTICLE, "Rough", 250,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the roughness of child particles");
-
- but=uiDefButBitS(block, TOG3, MAP_PA_SIZE, B_MAT_PARTICLE, "Size", 10,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the size of particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- but=uiDefButBitS(block, TOG3, MAP_PA_KINK, B_MAT_PARTICLE, "Kink", 70,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the kink of child particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- but=uiDefButBitS(block, TOG3, MAP_PA_LENGTH, B_MAT_PARTICLE, "Length",130,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the length of child particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
- but=uiDefButBitS(block, TOG3, MAP_PA_CLUMP, B_MAT_PARTICLE, "Clump", 190,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the clump of child particles");
- //uiButSetFunc(but, particle_recalc_material, ma, NULL);
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, 1, B_MATPRV, "PAttr", 250,160,60,19, &pattr, 0, 0, 0, 0, "Display settings for particle attributes");
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material");
- uiDefButBitS(block, TOG3, MAP_NORM, B_MATPRV, "Nor", 50,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the rendered normal");
- uiDefButBitS(block, TOG, MAP_COLSPEC, B_MATPRV, "Csp", 90,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the specularity color");
- uiDefButBitS(block, TOG, MAP_COLMIR, B_MATPRV, "Cmir", 130,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the mirror color");
- uiDefButBitS(block, TOG3, MAP_REF, B_MATPRV, "Ref", 180,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of the materials reflectivity");
- uiDefButBitS(block, TOG3, MAP_SPEC, B_MATPRV, "Spec", 220,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity");
- uiDefButBitS(block, TOG3, MAP_AMB, B_MATPRV, "Amb", 270,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of ambient");
-
- if(psys_mapto) {
- uiDefButBitS(block, TOG3, MAP_HAR, B_MATPRV, "Hard", 10,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value");
- uiDefButBitS(block, TOG3, MAP_RAYMIRR, B_MATPRV, "RayMir", 50,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the ray-mirror value");
- uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Alpha", 90,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value");
- uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 130,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value");
- uiDefButBitS(block, TOG3, MAP_TRANSLU, B_MATPRV, "TransLu", 180,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the translucency value");
- if(from_nodes==0)
- uiDefButBitS(block, TOG3, MAP_DISPLACE, B_MATPRV, "Disp", 220,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture displace the surface");
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitS(block, TOG, 1, B_MATPRV, "PAttr", 270,160,40,19, &pattr, 0, 0, 0, 0, "Display settings for particle attributes");
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- uiDefButBitS(block, TOG3, MAP_HAR, B_MATPRV, "Hard", 10,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value");
- uiDefButBitS(block, TOG3, MAP_RAYMIRR, B_MATPRV, "RayMir", 60,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the ray-mirror value");
- uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Alpha", 110,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value");
- uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 160,160,45,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value");
- uiDefButBitS(block, TOG3, MAP_TRANSLU, B_MATPRV, "TransLu", 205,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the translucency value");
- if(from_nodes==0)
- uiDefButBitS(block, TOG3, MAP_DISPLACE, B_MATPRV, "Disp", 265,160,45,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture displace the surface");
- }
- }
-
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- but=uiDefButS(block, MENU, B_MATPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
- uiBlockEndAlign(block);
- if(psys_mapto && mtex->pmapto & MAP_PA_INIT)
- uiButSetFunc(but, particle_recalc_material, ma, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
- /* newnoise: increased range to 25, the constant offset for bumpmapping quite often needs a higher nor setting */
- uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 25.0, 0, 0, "Sets the amount the texture affects normal values");
- but=uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
- if(psys_mapto && mtex->pmapto & MAP_PA_INIT)
- uiButSetFunc(but, particle_recalc_material, ma, NULL);
- uiDefButF(block, NUMSLI, B_MATPRV, "Disp ", 155,40,155,19, &(mtex->dispfac), 0.0, 1.0, 0, 0, "Sets the amount the texture displaces the surface");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, MAP_WARP, B_MATPRV, "Warp", 155,10,40,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture warp texture coordinates of next channels");
- uiDefButF(block, NUMSLI, B_MATPRV, "fac ", 195,10,115,19, &(mtex->warpfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects texture coordinates of next channels");
-}
-
-/* autocomplete callback for buttons */
-void autocomplete_uv(char *str, void *arg_v)
-{
- Mesh *me;
- CustomDataLayer *layer;
- AutoComplete *autocpl;
- int a;
-
- if(str[0]==0)
- return;
-
- autocpl= autocomplete_begin(str, 32);
-
- /* search if str matches the beginning of name */
- for(me= G.main->mesh.first; me; me=me->id.next)
- for(a=0, layer= me->fdata.layers; a<me->fdata.totlayer; a++, layer++)
- if(layer->type == CD_MTFACE)
- autocomplete_do_name(autocpl, layer->name);
-
- autocomplete_end(autocpl, str);
-}
-
-int verify_valid_uv_name(char *str)
-{
- Mesh *me;
- CustomDataLayer *layer;
- int a;
-
- if(str[0]==0)
- return 1;
-
- /* search if str matches the name */
- for(me= G.main->mesh.first; me; me=me->id.next)
- for(a=0, layer= me->fdata.layers; a<me->fdata.totlayer; a++, layer++)
- if(layer->type == CD_MTFACE)
- if(strcmp(layer->name, str)==0)
- return 1;
-
- return 0;
-}
-
-static void material_panel_map_input(Object *ob, Material *ma)
-{
- uiBlock *block;
- uiBut *but;
- MTex *mtex;
- int b;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_map_input", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Texture", "Material");
- if(uiNewPanel(curarea, block, "Map Input", "Material", 1280, 0, 318, 204)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- mtex= ma->mtex[ ma->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- }
-
- /* TEXCO */
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates");
- uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates");
- if(mtex->texco == TEXCO_UV && !(mtex->texflag & MTEX_DUPLI_MAPTO)) {
- if(!verify_valid_uv_name(mtex->uvname))
- uiBlockSetCol(block, TH_REDALERT);
- but=uiDefBut(block, TEX, B_MATPRV, "UV:", 750,180,158,18, mtex->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer");
- uiButSetCompleteFunc(but, autocomplete_uv, NULL);
- uiBlockSetCol(block, TH_AUTO);
- }
- else
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), "");
-
- uiDefButS(block, ROW, B_MATPRV, "UV", 630,160,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Uses UV coordinates for texture coordinates");
- uiDefButS(block, ROW, B_MATPRV, "Orco", 670,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object");
- if( ob->particlesystem.first )
- uiDefButS(block, ROW, B_MATPRV, "Strand", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STRAND, 0, 0, "Uses normalized strand texture coordinate (1D)");
- else
- uiDefButS(block, ROW, B_MATPRV, "Stick", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STICKY, 0, 0, "Uses mesh's sticky coordinates for the texture coordinates");
- uiDefButS(block, ROW, B_MATPRV, "Win", 775,160,45,18, &(mtex->texco), 4.0, (float)TEXCO_WINDOW, 0, 0, "Uses screen coordinates as texture coordinates");
- uiDefButS(block, ROW, B_MATPRV, "Nor", 820,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Uses normal vector as texture coordinates");
- uiDefButS(block, ROW, B_MATPRV, "Refl", 864,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Uses reflection vector as texture coordinates");
-
- uiDefButS(block, ROW, B_MATPRV, "Stress", 630,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_STRESS, 0, 0, "Uses the difference of edge lengths compared to original coordinates of the mesh");
- uiDefButS(block, ROW, B_MATPRV, "Tangent", 700,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_TANGENT, 0, 0, "Uses the optional tangent vector as texture coordinates");
- uiBlockEndAlign(block);
-
- if(ELEM(mtex->texco, TEXCO_UV, TEXCO_ORCO))
- uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent");
- else if(mtex->texco == TEXCO_OBJECT)
- uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's derive their object coordinates from the original objects transformation");
-
-
- /* COORDS */
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_MATPRV, "Flat", 630,115,48,19, &(mtex->mapping), 5.0, (float)MTEX_FLAT, 0, 0, "Maps X and Y coordinates directly");
- uiDefButC(block, ROW, B_MATPRV, "Cube", 681,115,50,19, &(mtex->mapping), 5.0, (float)MTEX_CUBE, 0, 0, "Maps using the normal vector");
- uiDefButC(block, ROW, B_MATPRV, "Tube", 630,95,48,19, &(mtex->mapping), 5.0, (float)MTEX_TUBE, 0, 0, "Maps with Z as central axis (tube-like)");
- uiDefButC(block, ROW, B_MATPRV, "Sphe", 681,95,50,19, &(mtex->mapping), 5.0, (float)MTEX_SPHERE, 0, 0, "Maps with Z as central axis (sphere-like)");
-
- uiBlockBeginAlign(block);
- for(b=0; b<3; b++) {
- char *cp;
- if(b==0) cp= &(mtex->projx);
- else if(b==1) cp= &(mtex->projy);
- else cp= &(mtex->projz);
-
- uiDefButC(block, ROW, B_MATPRV, "", 630, 50-20*b, 24, 18, cp, 6.0+b, 0.0, 0, 0, "");
- uiDefButC(block, ROW, B_MATPRV, "X", 656, 50-20*b, 24, 18, cp, 6.0+b, 1.0, 0, 0, "");
- uiDefButC(block, ROW, B_MATPRV, "Y", 682, 50-20*b, 24, 18, cp, 6.0+b, 2.0, 0, 0, "");
- uiDefButC(block, ROW, B_MATPRV, "Z", 708, 50-20*b, 24, 18, cp, 6.0+b, 3.0, 0, 0, "");
- }
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "ofsX", 778,115,130,19, mtex->ofs, -10.0, 10.0, 10, 0, "Fine tunes texture mapping X coordinate");
- uiDefButF(block, NUM, B_MATPRV, "ofsY", 778,95,130,19, mtex->ofs+1, -10.0, 10.0, 10, 0, "Fine tunes texture mapping Y coordinate");
- uiDefButF(block, NUM, B_MATPRV, "ofsZ", 778,75,130,19, mtex->ofs+2, -10.0, 10.0, 10, 0, "Fine tunes texture mapping Z coordinate");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "sizeX", 778,50,130,19, mtex->size, -100.0, 100.0, 10, 0, "Sets scaling for the texture's X size");
- uiDefButF(block, NUM, B_MATPRV, "sizeY", 778,30,130,19, mtex->size+1, -100.0, 100.0, 10, 0, "Sets scaling for the texture's Y size");
- uiDefButF(block, NUM, B_MATPRV, "sizeZ", 778,10,130,19, mtex->size+2, -100.0, 100.0, 10, 0, "Sets scaling for the texture's Z size");
- uiBlockEndAlign(block);
-
-}
-
-
-static void material_panel_texture(Object *ob, Material *ma)
-{
- uiBlock *block;
- uiBut *but;
- MTex *mtex;
- ID *id;
- ParticleSystem *psys;
- int loos, psys_mapto=0;
- int a, num_mtex;
- char str[64], *strp;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Texture", "Material", 960, 0, 318, 204)==0) return;
- uiClearButLock();
-
- /*check if material is being used by particles*/
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- if(psys->part->omat==ob->actcol)
- psys_mapto=1;
-
- /* TEX CHANNELS */
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
-
- uiBlockBeginAlign(block);
- num_mtex= texture_channels_num_display(ma->mtex);
- for(a= 0; a<num_mtex; a++) {
- mtex= ma->mtex[a];
- if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
- else strcpy(str, "");
- str[10]= 0;
- uiDefButC(block, ROW, B_TEXCHANNEL, str, 10, 180-18*a, 70, 20, &(ma->texact), 3.0, (float)a, 0, 0, "");
- }
- uiBlockEndAlign(block);
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- /* SEPTEX */
- uiBlockSetCol(block, TH_AUTO);
-
- for(a= 0; a<num_mtex; a++) {
- mtex= ma->mtex[a];
- if(mtex && mtex->tex) {
- but=uiDefIconButBitI(block, ICONTOGN, 1<<a, B_MATPRV, ICON_CHECKBOX_HLT-1, -20, 180-18*a, 28, 20, &ma->septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel");
-
- if(psys_mapto && ma->mtex[a]->mapto & MAP_PA_IVEL)
- uiButSetFunc(but, particle_recalc_material, ma, NULL);
- }
- }
- /* copy/paste/up/down */
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_MTEXCOPY, ICON_COPYUP, 100,180,25,19, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer");
- uiDefIconBut(block, BUT, B_MTEXPASTE, ICON_PASTEUP, 125,180,25,19, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer");
- uiDefIconBut(block, BUT, B_MTEXMOVEUP, VICON_MOVE_UP, 150,180,25,19, 0, 0, 0, 0, 0, "Move texture channel up");
- uiDefIconBut(block, BUT, B_MTEXMOVEDOWN, VICON_MOVE_DOWN, 175,180,25,19, 0, 0, 0, 0, 0, "Move texture channel down");
- uiBlockEndAlign(block);
- uiBlockSetCol(block, TH_AUTO);
-
- mtex= ma->mtex[ ma->texact ];
- if(mtex==NULL) {
- mtex= &emptytex;
- default_mtex(mtex);
- }
-
- /* TEXTUREBLOK SELECT */
- uiBlockSetCol(block, TH_BUT_SETTING2);
- if(G.main->tex.first==NULL)
- id= NULL;
- else
- id= (ID*) mtex->tex;
- IDnames_to_pupstring(&strp, NULL, "ADD NEW %x32767", &(G.main->tex), id, &(G.buts->texnr));
- uiDefButS(block, MENU, B_EXTEXBROWSE, strp, 100,130,20,20, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new");
- MEM_freeN(strp);
-
- if(id) {
- uiDefBut(block, TEX, B_IDNAME, "TE:", 100,150,163,20, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change");
- sprintf(str, "%d", id->us);
- uiDefBut(block, BUT, 0, str, 196,130,21,20, 0, 0, 0, 0, 0, "Displays number of users of texture");
- uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 241,130,21,20, 0, 0, 0, 0, 0, "Auto-assigns name to texture");
- if(id->lib) {
- if(ma->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,130,21,20, 0, 0, 0, 0, 0, "");
- else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,130,21,20, 0, 0, 0, 0, 0, "");
- }
- uiBlockSetCol(block, TH_AUTO);
- uiDefBut(block, BUT, B_TEXCLEAR, "Clear", 122, 130, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture");
-
- if(mtex->tex->use_nodes) {
- char *menustr = ntreeTexOutputMenu(mtex->tex->nodetree);
- uiDefButS(block, MENU, B_MATPRV, menustr, 100, 100, 163, 20, &mtex->which_output, 0, 0, 0, 0, "Which output to use, for multi-output textures");
- free(menustr);
- }
- }
- else
- uiDefButS(block, TOG, B_EXTEXBROWSE, "Add New" ,100, 150, 163, 20, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock");
-
- // force no centering
- uiDefBut(block, LABEL, 0, " ", 250, 10, 25, 20, 0, 0, 0, 0, 0, "");
-
- uiBlockSetCol(block, TH_AUTO);
-}
-
-static void material_panel_tramir(Material *ma)
-{
- uiBlock *block;
- short yco=PANEL_YMAX;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_tramir", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Shaders", "Material");
- if(uiNewPanel(curarea, block, "Mirror Transp", "Material", PANELX, PANELY, PANELW, PANELH+80)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- uiDefButBitI(block, TOG, MA_RAYMIRROR, B_MATPRV, "Ray Mirror",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering");
-
- yco -= YSPACE;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "RayMir: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_mir), 0.0, 5.0, 10, 2, "Power of Fresnel for mirror reflection");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fac: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_mir_i), 1.0, 5.0, 10, 2, "Blending factor for Fresnel");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Gloss: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->gloss_mir), 0.0, 1.0, 100, 0, "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections ");
- uiDefButF(block, NUMSLI, B_MATPRV, "Aniso: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->aniso_gloss_mir), 0.0, 1.0, 100, 0, "The shape of the reflection, from 0. (circular) to 1.0 (fully stretched along the tangent)");
- uiDefButS(block, NUM, B_MATPRV, "Samples:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_mir), 1.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry reflections");
- uiDefButF(block, NUM, B_MATPRV, "Thresh: ",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->adapt_thresh_mir), 0.0, 1.0, 100, 0, "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
- uiDefButS(block, NUM, B_MATPRV, "Depth:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->ray_depth), 0.0, 10.0, 100, 0, "Maximum allowed number of light inter-reflections");
-
- yco -= YSPACE;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "Max Dist:",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->dist_mir), 0.0, 10000.0, 100, 0, "Maximum distance of reflected rays. Reflections further than this range fade to sky color");
- uiDefButS(block, MENU, B_MATPRV, "Ray end fade-out: %t|Fade to Sky Color %x0|Fade to Material Color %x1",
- X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fadeto_mir), 0, 0, 0, 0, "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor.");
- uiBlockEndAlign(block);
-
- yco=PANEL_YMAX;
-
- uiDefButBitI(block, TOG, MA_RAYTRANSP, B_MATRAYTRANSP,"Ray Transp",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparent refraction rendering");
-
- yco -= YSPACE;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "IOR: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->ang), 1.0, 3.0, 100, 2, "Sets angular index of refraction for raytraced refraction");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_tra), 0.0, 5.0, 10, 2, "Power of Fresnel for transparency (Ray or ZTransp)");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fac: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_tra_i), 1.0, 5.0, 10, 2, "Blending factor for Fresnel");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Gloss: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->gloss_tra), 0.0, 1.0, 100, 0, "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions");
- uiDefButS(block, NUM, B_MATPRV, "Samples:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_tra), 0.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry refractions");
- uiDefButF(block, NUM, B_MATPRV, "Thresh: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->adapt_thresh_tra), 0.0, 1.0, 100, 0, "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- uiDefButS(block, NUM, B_MATPRV, "Depth:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->ray_depth_tra), 0.0, 10.0, 100, 0, "Maximum allowed number of light inter-refractions");
-
- yco -= YSPACE;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "Filter:",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->filter), 0.0, 1.0, 10, 0, "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)");
- uiDefButF(block, NUMSLI, B_MATPRV, "Limit: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->tx_limit), 0.0, 100.0, 10, 2, "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)");
- uiDefButF(block, NUMSLI, B_MATPRV, "Falloff: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->tx_falloff), 0.1, 10.0, 10, 2, "Falloff power for transmissivity filter effect (1.0 is linear)");
- uiBlockEndAlign(block);
-
- yco -= YSPACE;
-
- uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra: ",
- X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->spectra), 0.0, 1.0, 0, 0, "Makes specular areas opaque on transparent materials");
-}
-
-/* yafray: adapted version of Blender's tramir panel.
- * Only removed the buttons not needed, so only the ones that are important for yafray are left.
- * Also re-arranged buttons for more room for extra parameters.
- * With the exception of the material preset menu and the new parameters,
- * most of blender's parameters are re-used without interfering with them.
- */
-static void material_panel_tramir_yafray(Material *ma)
-{
- uiBlock *block;
- char *mstr = "Material presets %t|No Reflect/Transmit %x0|Clear Glass %x1|Color Glass %x2|Uniform Reflect %x3|Fresnel Reflect %x4";
-
- /* better to use same name as original panel */
- block= uiNewBlock(&curarea->uiblocks, "material_panel_tramir", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Shaders", "Material");
- if(uiNewPanel(curarea, block, "Mirror Transp", "Material", 640, 0, 318, 204)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- /* material preset menu */
- uiDefBut(block, LABEL, 0, "Mat.Preset", 20, 182, 100, 20, 0, 0.0, 0.0, 0, 0, "");
- uiDefButI(block, MENU, B_MAT_YF_PRESET, mstr, 110, 182, 200, 20, &ma->YF_preset, 0.0, 0.0, 0, 0, "Basic material presets to start with");
-
- uiDefButBitI(block, TOG, MA_RAYMIRROR, B_MATPRV,"Ray Mirror", 10,160,100,20, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering");
- uiDefButBitI(block, TOG, MA_RAYTRANSP, B_MATRAYTRANSP,"Ray Transp", 110,160,100,20, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparency rendering");
- uiDefButBitI(block, TOG, MA_ZTRA, B_MATZTRANSP,"ZTransp", 210,160,100,20, &(ma->mode), 0, 0, 0, 0, "Use for objects with alphamap textures");
-
- uiDefButF(block, NUMSLI, B_MATPRV, "rayMir ", 10,140,150,20, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace");
- uiDefButF(block, NUMSLI, B_MATPRV, "frsOfs ", 160,140,150,20, &(ma->fresnel_mir_i), 1.0, 5.0, 10, 2, "Fresnel offset, 1 is uniform mirror, 5 is fresnel mirror (IOR>1)");
-
- /* ior has extended range up to 30, for use with total fresnel reflection */
- uiDefButF(block, NUMSLI, B_MATPRV, "IOR ", 10,115,150,20, &(ma->ang), 1.0, 30.0, 100, 2, "Sets the angular index of refraction for raytrace");
-
- // parameters only used in ray_transp mode
- if(ma->mode & MA_RAYTRANSP) {
- // Filter
- uiDefButF(block, NUM, B_MATPRV, "Filt:", 160,115,150,20, &(ma->filter), 0.0, 1.0, 10, 0, "Amount of filtering for transparent raytrace");
-
- /* absorption color */
- uiDefBut(block, LABEL, 0, "Absorption Color", 10, 98, 150, 18, 0, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, COL, B_MATPRV, "", 10, 38, 30, 58, &ma->YF_ar, 0, 0, 0, B_MATCOL, "transmit absorption color, white is no absorption");
- uiDefButF(block, NUMSLI, B_MATPRV, "aR ", 40, 78, 120, 18, &ma->YF_ar, 1e-7f, 1.0, B_MATCOL, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "aG ", 40, 58, 120, 18, &ma->YF_ag, 1e-7f, 1.0, B_MATCOL, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "aB ", 40, 38, 120, 18, &ma->YF_ab, 1e-7f, 1.0, B_MATCOL, 0, "");
- uiDefButF(block, NUM, B_MATPRV, "Ds", 10, 18, 150, 18, &ma->YF_dscale, 1e-7f, 100.0, 10.0, 0, "absorption distance scale, 1 is one blender (world) unit of distance");
-
- /* disperions parameters */
- uiDefBut(block, LABEL, 0, "Dispersion", 160, 98, 150, 18, 0, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, B_MATPRV, "Pwr ", 160, 78, 150, 18, &ma->YF_dpwr, 0.0, 1.0, 0.25, 0, "Dispersion power, the higher, the more dispersion, 0 is no dispersion");
- uiDefButI(block, NUM, B_MATPRV, "Samples ", 160, 58, 150, 18, &ma->YF_dsmp, 1.0, 100.0, 0, 0, "Dispersion samples, minimum at least 10, unless using jitter ");
- uiDefButBitI(block, TOG, 1, B_MATPRV, "Jitter", 160, 38, 150, 18, &ma->YF_djit, 0.0, 1.0, 0, 0, "Enable jittering of wavelenghts, adds noise");
- }
-
-}
-
-static void material_sss_preset_cb(void *material_v, void *unused_v)
-{
- static const float presets[11][7] = {
- {0.909578, 0.905931, 0.665691, 6.961082, 6.400181, 1.895899, 1.300000},
- {0.429632, 0.210025, 0.167767, 11.605177, 3.883766, 1.754386, 1.300000},
- {0.439300, 0.216000, 0.141027, 9.435642, 3.347647, 1.790287, 1.300000},
- {0.986552, 0.942637, 0.827285, 15.027623, 4.663968, 2.541380, 1.300000},
- {0.221636, 0.007505, 0.002154, 4.761743, 0.574827, 0.394116, 1.300000},
- {0.925008, 0.905025, 0.884275, 8.509412, 5.566180, 3.951266, 1.500000},
- {0.855344, 0.740311, 0.291994, 14.266395, 7.227615, 2.036157, 1.300000},
- {0.889319, 0.888034, 0.795811, 18.424364, 10.443473, 3.501882, 1.300000},
- {0.573652, 0.312750, 0.174289, 3.673294, 1.366534, 0.682693, 1.300000},
- {0.748679, 0.570766, 0.467133, 4.821475, 1.693699, 1.089971, 1.300000},
- {0.947235, 0.931028, 0.851872, 10.898815, 6.575351, 2.508417, 1.300000}};
-
- Material *ma= (Material*)material_v;
-
- if(ma->sss_preset==0) return;
-
- ma->sss_col[0]= presets[ma->sss_preset][0];
- ma->sss_col[1]= presets[ma->sss_preset][1];
- ma->sss_col[2]= presets[ma->sss_preset][2];
- ma->sss_radius[0]= presets[ma->sss_preset][3];
- ma->sss_radius[1]= presets[ma->sss_preset][4];
- ma->sss_radius[2]= presets[ma->sss_preset][5];
- ma->sss_ior= presets[ma->sss_preset][6];
-}
-
-static void material_sss_custom_set_cb(void *material_v, void *unused_v)
-{
- Material *ma= (Material*)material_v;
-
- ma->sss_preset= 0;
- allqueue(REDRAWNODE, 0);
-}
-
-static void material_panel_sss(Material *ma)
-{
- uiBlock *block;
- uiBut *bt;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_sss", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Mirror Transp", "Material");
- if(uiNewPanel(curarea, block, "SSS", "Material", 640, 0, 318, 204)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- uiDefButBitS(block, TOG, MA_DIFF_SSS, B_MATPRV,"Subsurface Scattering",10,180,180,20, &(ma->sss_flag), 0, 0, 0, 0, "Enables diffuse subsurface scattering");
-
- bt=uiDefButS(block, MENU, B_MATPRV, "Apple %x1|Chicken %x2|Cream %x3|Ketchup %x4|Marble %x5|Potato %x6|Skim Milk %x7|Skin 1 %x8|Skin 2 %x9|Whole Milk %x10|Custom %x0",
- 200,180,110,20, &ma->sss_preset, 0, 0, 0, 0, "");
- uiButSetFunc(bt, material_sss_preset_cb, ma, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "Scale:", 10,150,145,20,
- &ma->sss_scale, 0.001, 1000, 1, 3, "Object scale");
- bt=uiDefButF(block, NUM, B_MATPRV, "Radius R", 10,130,145,20,
- &ma->sss_radius[0], 0.0001, 10000, 1, 3,
- "Mean red scattering path length");
- uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
- bt=uiDefButF(block, NUM, B_MATPRV, "Radius G", 10,110,145,20,
- &ma->sss_radius[1], 0.0001, 10000, 1, 3,
- "Mean green scattering path length");
- uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
- bt=uiDefButF(block, NUM, B_MATPRV, "Radius B", 10,90,145,20,
- &ma->sss_radius[2], 0.0001, 10000, 1, 3,
- "Mean blue scattering path length");
- uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
- uiBlockEndAlign(block);
-
- bt=uiDefButF(block, NUM, B_MATPRV, "IOR:", 10,60,145,20,
- &ma->sss_ior, 0.1, 2, 1, 3, "Index of refraction (higher values are denser)");
- uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MATPRV, "Error:", 10,30,145,20,
- &ma->sss_error, 0.0001, 10, 1, 3, "Error tolerance (low values are slower and higher quality)");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- bt=uiDefButF(block, COL, B_MATPRV, "", 165,150,145,20,
- &ma->sss_col[0], 0.0, 1.0, 0, 0,
- "Scattering color");
- uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
- uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 165,130,145,20,
- &ma->sss_colfac, 0.0, 1.0, 0, 0,
- "Blend factor for SSS colors");
- uiDefButF(block, NUMSLI, B_MATPRV, "Tex ", 165,110,145,20,
- &ma->sss_texfac, 0.0, 1.0, 0, 0,
- "Texture scattering factor");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Front ", 165,80,145,20,
- &ma->sss_front, 0.0, 2.0, 0, 0,
- "Front scattering weight");
- uiDefButF(block, NUMSLI, B_MATPRV, "Back ", 165,60,145,20,
- &ma->sss_back, 0.0, 10.0, 0, 0,
- "Back scattering weight");
- uiBlockEndAlign(block);
-}
-
-static void material_panel_shading(Material *ma)
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_shading", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Shaders", "Material", 640, 0, 318, 224)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- if(ma->mode & MA_HALO) {
- uiDefButF(block, NUM, B_MATPRV, "HaloSize: ", 10,155,190,18, &(ma->hasize), 0.0, 100.0, 10, 3, "Sets the dimension of the halo");
- uiDefButS(block, NUMSLI, B_MATPRV, "Hard ", 10,135,190,18, &(ma->har), 1.0, 127.0, 0, 0, "Sets the hardness of the halo");
- uiDefButF(block, NUMSLI, B_MATPRV, "Add ", 10,115,190,18, &(ma->add), 0.0, 1.0, 0, 0, "Sets the strength of the add effect");
-
- uiDefButS(block, NUM, B_MATPRV, "Rings: ", 10,90,90,18, &(ma->ringc), 0.0, 24.0, 0, 0, "Sets the number of rings rendered over the halo");
- uiDefButS(block, NUM, B_MATPRV, "Lines: ", 100,90,100,18, &(ma->linec), 0.0, 250.0, 0, 0, "Sets the number of star shaped lines rendered over the halo");
- uiDefButS(block, NUM, B_MATPRV, "Star: ", 10,70,90,18, &(ma->starc), 3.0, 50.0, 0, 0, "Sets the number of points on the star shaped halo");
- uiDefButC(block, NUM, B_MATPRV, "Seed: ", 100,70,100,18, &(ma->seed1), 0.0, 255.0, 0, 0, "Randomizes ring dimension and line location");
- if(ma->mode & MA_HALO_FLARE) {
- uiDefButF(block, NUM, B_MATPRV, "FlareSize: ", 10,50,95,18, &(ma->flaresize), 0.1, 25.0, 10, 3, "Sets the factor by which the flare is larger than the halo");
- uiDefButF(block, NUM, B_MATPRV, "Sub Size: ", 100,50,100,18, &(ma->subsize), 0.1, 25.0, 10, 3, "Sets the dimension of the subflares, dots and circles");
- uiDefButF(block, NUMSLI, B_MATPRV, "Boost: ", 10,30,190,18, &(ma->flareboost), 0.1, 10.0, 10, 3, "Gives the flare extra strength");
- uiDefButC(block, NUM, B_MATPRV, "Fl.seed: ", 10,10,90,18, &(ma->seed2), 0.0, 255.0, 0, 0, "Specifies an offset in the flare seed table");
- uiDefButS(block, NUM, B_MATPRV, "Flares: ", 100,10,100,18, &(ma->flarec), 1.0, 32.0, 0, 0, "Sets the number of subflares");
- }
- uiBlockSetCol(block, TH_BUT_SETTING1);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_HALO_FLARE, B_MATPRV, "Flare", 245,161,65,28, &(ma->mode), 0, 0, 0, 0, "Renders halo as a lensflare");
- uiDefButBitI(block, TOG, MA_HALO_RINGS, B_MATPRV, "Rings", 245,142,65,18, &(ma->mode), 0, 0, 0, 0, "Renders rings over halo");
- uiDefButBitI(block, TOG, MA_HALO_LINES, B_MATPRV, "Lines", 245,123,65,18, &(ma->mode), 0, 0, 0, 0, "Renders star shaped lines over halo");
- uiDefButBitI(block, TOG, MA_STAR, B_MATPRV, "Star", 245,104,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders halo as a star");
- uiDefButBitI(block, TOG, MA_HALOTEX, B_MATPRV, "HaloTex", 245,85,65, 18, &(ma->mode), 0, 0, 0, 0, "Gives halo a texture");
- uiDefButBitI(block, TOG, MA_HALOPUNO, B_MATPRV, "HaloPuno", 245,66,65, 18, &(ma->mode), 0, 0, 0, 0, "Uses the vertex normal to specify the dimension of the halo");
- uiDefButBitI(block, TOG, MA_HALO_XALPHA, B_MATPRV, "X Alpha", 245,47,65, 18, &(ma->mode), 0, 0, 0, 0, "Uses extreme alpha");
- uiDefButBitI(block, TOG, MA_HALO_SHADE, B_MATPRV, "Shaded", 245,28,65, 18, &(ma->mode), 0, 0, 0, 0, "Lets halo receive light and shadows");
- uiDefButBitI(block, TOG, MA_HALO_SOFT, B_MATPRV, "Soft", 245,9,65, 18, &(ma->mode), 0, 0, 0, 0, "Softens the halo");
- uiBlockEndAlign(block);
- }
- else {
- char *str1= "Diffuse Shader%t|Lambert %x0|Oren-Nayar %x1|Toon %x2|Minnaert %x3|Fresnel %x4";
- char *str2= "Specular Shader%t|CookTorr %x0|Phong %x1|Blinn %x2|Toon %x3|WardIso %x4";
-
- /* diff shader buttons */
- uiDefButS(block, MENU, B_MATPRV, str1, 9, 180,78,19, &(ma->diff_shader), 0.0, 0.0, 0, 0, "Creates a diffuse shader");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Ref ", 90,180,150,19, &(ma->ref), 0.0, 1.0, 0, 0, "Sets the amount of reflection");
- if(ma->diff_shader==MA_DIFF_ORENNAYAR)
- uiDefButF(block, NUMSLI, B_MATPRV, "Rough:",90,160, 150,19, &(ma->roughness), 0.0, 3.14, 0, 0, "Sets Oren Nayar Roughness");
- else if(ma->diff_shader==MA_DIFF_TOON) {
- uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 160,150,19, &(ma->param[0]), 0.0, 3.14, 0, 0, "Sets size of diffuse toon area");
- uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90,140,150,19, &(ma->param[1]), 0.0, 1.0, 0, 0, "Sets smoothness of diffuse toon area");
- }
- else if(ma->diff_shader==MA_DIFF_MINNAERT)
- uiDefButF(block, NUMSLI, B_MATPRV, "Dark:",90,160, 150,19, &(ma->darkness), 0.0, 2.0, 0, 0, "Sets Minnaert darkness");
- else if(ma->diff_shader==MA_DIFF_FRESNEL) {
- uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel:", 90, 160,150,19, &(ma->param[1]), 0.0, 5.0, 0, 0, "Power of Fresnel");
- uiDefButF(block, NUMSLI, B_MATPRV, "Fac:",90,140,150,19, &(ma->param[0]), 1.0, 5.0, 0, 0, "Blending factor");
- }
- uiBlockEndAlign(block);
-
- /* spec shader buttons */
- uiDefButS(block, MENU, B_MATPRV, str2, 9,120,77,19, &(ma->spec_shader), 0.0, 0.0, 0, 0, "Creates a specular shader");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Spec ", 90,120,150,19, &(ma->spec), 0.0, 2.0, 0, 0, "Sets the degree of specularity");
- if ELEM3(ma->spec_shader, MA_SPEC_COOKTORR, MA_SPEC_PHONG, MA_SPEC_BLINN) {
- uiDefButS(block, NUMSLI, B_MATPRV, "Hard:", 90, 100, 150,19, &(ma->har), 1.0, 511, 0, 0, "Sets the hardness of the specularity");
- }
- if(ma->spec_shader==MA_SPEC_BLINN)
- uiDefButF(block, NUMSLI, B_MATPRV, "Refr:", 90, 80,150,19, &(ma->refrac), 1.0, 10.0, 0, 0, "Sets the material's Index of Refraction");
- if(ma->spec_shader==MA_SPEC_TOON) {
- uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 100,150,19, &(ma->param[2]), 0.0, 1.53, 0, 0, "Sets the size of specular toon area");
- uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90, 80,150,19, &(ma->param[3]), 0.0, 1.0, 0, 0, "Sets the smoothness of specular toon area");
- }
- if(ma->spec_shader==MA_SPEC_WARDISO)
- uiDefButF(block, NUMSLI, B_MATPRV, "rms:", 90, 100,150,19, &(ma->rms), 0.0, 0.4, 0, 0, "Sets the standard deviation of surface slope");
- /* default shading variables */
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "Tralu ", 9,30,150,19, &(ma->translucency), 0.0, 1.0, 100, 2, "Translucency, amount of diffuse shading of the back side");
- uiDefButF(block, NUMSLI, B_MATPRV, "SBias ", 159,30,151,19, &(ma->sbias), 0.0, 0.25, 10, 2, "Shadow bias, to prevent terminator problems on shadow boundary");
- uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,10,150,19, &(ma->amb), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives");
- uiDefButF(block, NUMSLI, B_MATPRV, "Emit ", 159,10,151,19, &(ma->emit), 0.0, 2.0, 0, 0, "Sets the amount of light the material emits");
- uiDefButF(block, NUMSLI, B_MATPRV, "LBias ", 9,-10,300,19, &(ma->lbias), 0.0, 10.0, 100, 2, "Factor to multiply shadowbuffer bias with (0 is ignore)");
- uiBlockEndAlign(block);
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitI(block, TOG, MA_TANGENT_V, B_MATPRV, "Tangent V", 245,180,65,19, &(ma->mode), 0, 0, 0, 0, "Use the tangent vector in V direction for shading");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_SHADOW, B_MATPRV, "Shadow", 245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows");
- uiDefButBitI(block, TOG, MA_SHADOW_TRA, B_MATPRV, "TraShadow", 245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Receives transparent shadows based at material color and alpha");
- uiDefButBitI(block, TOG, MA_ONLYSHADOW, B_MATPRV, "OnlyShad", 245,100,65,20, &(ma->mode), 0, 0, 0, 0, "Renders shadows on material as Alpha value");
- uiDefButBitS(block, TOG, MA_CUBIC, B_MATPRV, "Cubic", 245,80,65,19, &(ma->shade_flag), 0, 0, 0, 0, "Use Cubic interpolation of diffuse values, for smoother transitions");
- uiDefButBitI(block, TOG, MA_RAYBIAS, B_MATPRV, "Bias", 245,60,65,19, &(ma->mode), 0, 0, 0, 0, "Prevents ray traced shadow errors with phong interpolated normals (terminator problem)");
-
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_MATPRV, "GR:", 9, 55, 150, 19, &ma->group, "Limit Lighting to Lamps in this Group");
- uiDefButBitI(block, TOG, MA_GROUP_NOLAY, B_MATPRV, "Exclusive", 159,55, 85,20, &(ma->mode), 0, 0, 0, 0, "Material uses Lights in this group exclusively, they get excluded from the Scene lighting");
-
-
- }
-}
-
-static void material_panel_ramps(Material *ma)
-{
- uiBlock *block;
- ColorBand *coba;
- float *facp;
- char *inputc, *methodc;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_ramps", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Material", "Material");
- if(uiNewPanel(curarea, block, "Ramps", "Material", 640, 0, 318, 204)==0) return;
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButS(block, ROW, B_REDR, "Show Col Ramp",10,180,150,20, &ma->ramp_show, 0, 0, 0, 0, "Show ramp buttons for material diffuse color");
- uiDefButS(block, ROW, B_REDR, "Show Spec Ramp",160,180,150,20, &ma->ramp_show, 0, 1, 0, 0, "Show ramp buttons for material specular color");
- uiBlockSetCol(block, TH_AUTO);
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- /* COLORBAND */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, ma->ramp_show?MA_RAMP_SPEC:MA_RAMP_COL, B_MATCOLORBAND, "Colorband",10,145,80,20, &ma->mode, 0, 0, 0, 0, "Toggles colorband ramp operations");
-
- if(ma->mode & (ma->ramp_show?MA_RAMP_SPEC:MA_RAMP_COL)) {
- if(ma->ramp_show==0) {
- coba= ma->ramp_col;
- inputc= &ma->rampin_col;
- methodc= &ma->rampblend_col;
- facp= &ma->rampfac_col;
- }
- else {
- coba= ma->ramp_spec;
- inputc= &ma->rampin_spec;
- methodc= &ma->rampblend_spec;
- facp= &ma->rampfac_spec;
- }
- draw_colorband_buts(block, coba, 10, 50, B_MATPRV); // aligns with previous button
-
- uiDefBut(block, LABEL, 0, "Input",10,30,90,20, NULL, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Method",100,30,90,20, NULL, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Factor",190,30,120,20, NULL, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButC(block, MENU, B_MATPRV, "Shader %x0|Energy %x1|Normal %x2|Result %x3",10,10,90,20, inputc, 0, 0, 0, 0, "Input for Ramp");
- uiDefButC(block, MENU, B_MATPRV, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Overlay %x9|Divide %x5|Difference %x6|Darken %x7|Lighten %x8|Dodge %x10|Burn %x11|Color %x15|Value %x14|Saturation %x13|Hue %x12",110,10,90,20, methodc, 0, 0, 0, 0, "Blending method for Ramp (uses alpha in Colorband)");
- uiDefButF(block, NUMSLI, B_MATPRV, "", 190,10,120,20, facp, 0.0, 1.0, 100, 0, "Blending factor (also uses alpha in Colorband)");
- }
-}
-
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *strand_menu(void *mat_v)
-{
- Material *ma= mat_v;
- uiBlock *block;
- int buth=20, butw=230, butx=10, buty=180;
-
- block= uiNewBlock(&curarea->uiblocks, "strand menu", UI_EMBOSS, UI_HELV, curarea->win);
-
- if(ma->mode & MA_STR_B_UNITS)
- buty += buth;
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", 0, 0, butw+20, buty+10, NULL, 0, 0, 0, 0, "");
- /* event return 0, to prevent menu to close */
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_TANGENT_STR, 0, "Use Tangent Shading", butx,buty-=buth,butw,buth, &(ma->mode), 0, 0, 0, 0, "Uses direction of strands as normal for tangent-shading");
- uiDefButBitI(block, TOG, MA_STR_SURFDIFF, 0, "Surface Diffuse", butx,buty-=buth,butw/2,buth, &(ma->mode), 0, 0, 0, 0, "Make diffuse shading more similar to shading the surface");
- uiDefButF(block, NUM, 0, "Dist", butx+butw/2,buty,butw/2,buth, &ma->strand_surfnor, 0.0f, 10.0f, 2, 0, "Distance in Blender units over which to blend in the surface normal");
-
- buty -= 5;
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_STR_B_UNITS, 0, "Use Blender Units", butx,buty-=buth,butw,buth, &(ma->mode), 0, 0, 0, 0, "Use actual Blender units for widths instead of pixels");
- if(ma->mode & MA_STR_B_UNITS){
- uiDefButF(block, NUMSLI, 0, "Start ", butx,buty-=buth, butw,buth, &ma->strand_sta, 0.0001, 2.0, 2, 0, "Start size of strands in Blender units");
- uiDefButF(block, NUMSLI, 0, "End ", butx,buty-=buth, butw,buth, &ma->strand_end, 0.0001, 1.0, 2, 0, "End size of strands in Blender units");
- uiDefButF(block, NUMSLI, 0, "Minimum ", butx,buty-=buth, butw,buth, &ma->strand_min, 0.001, 10.0, 0, 0, "Minimum size of strands in pixels");
- }
- else{
- uiDefButF(block, NUMSLI, 0, "Start ", butx,buty-=buth, butw,buth, &ma->strand_sta, 0.25, 20.0, 2, 0, "Start size of strands in pixels");
- uiDefButF(block, NUMSLI, 0, "End ", butx,buty-=buth, butw,buth, &ma->strand_end, 0.25, 10.0, 2, 0, "End size of strands in pixels");
- }
- uiDefButF(block, NUMSLI, 0, "Shape ", butx,buty-=buth, butw,buth, &ma->strand_ease, -0.9, 0.9, 2, 0, "Shape of strands, positive value makes it rounder, negative makes it spiky");
- uiDefButF(block, NUMSLI, 0, "Width Fade ", butx,buty-=buth, butw,buth, &ma->strand_widthfade, 0.0, 2.0, 2, 0, "Transparency along the width of the strand");
- uiDefBut(block, TEX, B_MATPRV, "UV:", butx,buty-=buth,butw,buth, ma->strand_uvname, 0, 31, 0, 0, "Set name of UV layer to override");
-
- uiBlockSetDirection(block, UI_TOP);
- BIF_preview_changed(ID_MA);
- return block;
-}
-
-
-static void material_panel_material(Material *ma)
-{
- uiBlock *block;
- float *colpoin = NULL;
- int rgbsel = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_material", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Material", "Material", 320, 0, 318, 204)==0) return;
-
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_MATCOPY, ICON_COPYUP, 262,200,XIC,YIC, 0, 0, 0, 0, 0, "Copies Material to the buffer");
- uiDefIconBut(block, BUT, B_MATPASTE, ICON_PASTEUP, 283,200,XIC,YIC, 0, 0, 0, 0, 0, "Pastes Material from the buffer");
- uiBlockEndAlign(block);
- if(ma->dynamode & MA_DRAW_DYNABUTS) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_DIFF, "Restitut ", 128,120,175,20, &ma->reflect, 0.0, 1.0, 0, 0, "Elasticity of collisions");
- uiDefButF(block, NUMSLI, B_DIFF, "Friction ", 128,100 ,175,20, &ma->friction, 0.0, 100.0, 0, 0, "Coulomb friction coefficient");
- uiDefButF(block, NUMSLI, B_DIFF, "Fh Force ", 128,80 ,175,20, &ma->fh, 0.0, 1.0, 0, 0, "Upward spring force within the Fh area");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NOP, "Fh Damp ", 8,120,100,20, &ma->xyfrict, 0.0, 1.0, 10, 0, "Damping of the Fh spring force");
- uiDefButF(block, NUM, B_NOP, "Fh Dist ", 8,100 ,100,20, &ma->fhdist, 0.0, 20.0, 10, 0, "Height of the Fh area");
- uiDefButBitS(block, TOG, MA_FH_NOR, 0, "Fh Norm", 8,80 ,100,20, &ma->dynamode, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
- }
- else {
- if(!(ma->mode & MA_HALO)) {
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colors as extra light");
- uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colors with vertex colors");
- uiDefButBitI(block, TOG, MA_FACETEXTURE, B_MATPRV, "TexFace", 156,166,60,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
- uiDefButBitI(block, TOG, MA_FACETEXTURE_ALPHA, B_MATPRV, "A", 216,166,20,20, &(ma->mode), 0, 0, 0, 0, "Use alpha channel in 'TexFace' assigned images");
- uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 236,166,67,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
-
- uiDefButBitI(block, TOG, MA_NOMIST, B_MATPRV, "No Mist", 8,146,74,20, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");
- uiDefButBitI(block, TOG, MA_ENV, B_MATPRV, "Env", 82,146,74,20, &(ma->mode), 0, 0, 0, 0, "Causes faces to render with alpha zero: allows sky/backdrop to show through (only for solid faces)");
- uiDefButBitS(block, TOG, MA_OBCOLOR, B_MATPRV, "ObColor", 156,146,60,20, &(ma->shade_flag), 0, 0, 0, 0, "Modulate the result with a per object color");
- uiDefButF(block, NUM, B_NOP, "Shad A ", 216,146,87,20, &ma->shad_alpha, 0.001, 1.0f, 10, 2, "Shadow casting alpha, only in use for Irregular Shadowbuffer");
- }
- uiBlockSetCol(block, TH_AUTO);
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_MATPRV, "", 8,97,72,20, &(ma->r), 0, 0, 0, B_MATCOL, "");
- uiDefButF(block, COL, B_MATPRV, "", 8,77,72,20, &(ma->specr), 0, 0, 0, B_SPECCOL, "");
- uiDefButF(block, COL, B_MATPRV, "", 8,57,72,20, &(ma->mirr), 0, 0, 0, B_MIRCOL, "");
-
- uiBlockBeginAlign(block);
- if(ma->mode & MA_HALO) {
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the color of the halo with the RGB sliders");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the color of the lines with the RGB sliders");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the color of the rings with the RGB sliders");
- }
- else {
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the diffuse color of the material");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular color of the material");
- uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror color of the material");
- }
-
- if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;}
- else if(ma->rgbsel==1) {colpoin= &(ma->specr); rgbsel= B_SPECCOL;}
- else if(ma->rgbsel==2) {colpoin= &(ma->mirr); rgbsel= B_MIRCOL;}
-
- if(ma->rgbsel==0 && (ma->mode & (MA_VERTEXCOLP|MA_FACETEXTURE) && !(ma->mode & MA_HALO)));
- else if(ma->colormodel==MA_HSV) {
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiBlockBeginAlign(block);
- uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,97,175,19, colpoin, 0.0, 0.9999, rgbsel, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,77,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
- uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,57,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,97,175,19, colpoin, 0.0, 1.0, rgbsel, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,77,175,19, colpoin+1, 0.0, 1.0, rgbsel, 0, "");
- uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,57,175,19, colpoin+2, 0.0, 1.0, rgbsel, 0, "");
- }
- uiBlockEndAlign(block);
- if (ma->mode & (MA_FACETEXTURE) && ma->mode & (MA_FACETEXTURE_ALPHA)) ;
- else uiDefButF(block, NUMSLI, B_MATPRV, "A ", 128,30,175,19, &ma->alpha, 0.0, 1.0, 0, 0, "Alpha");
-
- }
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,30,38,19, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates color using red, green and blue");
- uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 46,30,38,19, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates color using hue, saturation and value");
- uiDefButBitS(block, TOG, MA_DRAW_DYNABUTS, REDRAWBUTSSHADING, "DYN", 84,30,39,19, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options");
-
-}
-
-static void material_panel_nodes(Material *ma)
-{
- bNode *node;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_nodes", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Links and Pipeline", "Material");
- if(uiNewPanel(curarea, block, "Nodes", "Material", 640, 0, 318, 204)==0) return;
-
- node= editnode_get_active(ma->nodetree);
- if(node==NULL) return;
- /* we dont display the buttons here for the active material, is in links panel */
- if(node==editnode_get_active_idnode(ma->nodetree, ID_MA)) return;
-
- if(node->typeinfo->butfunc) {
- /* we use butfunc to retrieve height for the butrect, but node->width is
- used to calculate that too. Could be done smarter once */
- rctf rct;
- rct.xmin= 10.0f;
- rct.xmax= rct.xmin+node->width-NODE_DY;
- rct.ymax= 155.0;
- rct.ymin= rct.ymax - (float)node->typeinfo->butfunc(NULL, NULL, node, NULL);
- node->typeinfo->butfunc(block, ma->nodetree, node, &rct);
- }
-}
-
-static void material_panel_links(Object *ob, Material *ma)
-{
- uiBlock *block;
- uiBut *but;
- ID *id, *idn, *idfrom;
- bNode *node=NULL;
- float min;
- short xco;
- char str[30];
-
- block= uiNewBlock(&curarea->uiblocks, "material_panel_links", UI_EMBOSS, UI_HELV, curarea->win);
- /* 310 makes sorting code to put it right after preview panel */
- if(uiNewPanel(curarea, block, "Links and Pipeline", "Material", 310, 0, 318, 204)==0) return;
-
- /* Links from object to material/nodes */
- uiDefBut(block, ROUNDBOX, 0, "", 5, 90, 310, 110, NULL, 7.0, 0.0, 15 , 20, "");
- uiDefBut(block, LABEL, B_DIFF, "Link to Object", 10, 180, 300, 20, 0, 0, 0, 0, 0, "");
-
- /* the main material browse but */
- buttons_active_id(&id, &idfrom); /* base material! */
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- xco= std_libbuttons(block, 10, 160, 0, NULL, B_MATBROWSE, ID_MA, 0, id, idfrom, &(G.buts->menunr), B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA);
-
- if(ma) uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- if(ma)
- uiDefButC(block, TOG, B_MAT_USENODES, "Nodes", xco+5,160,300-xco-5,20, &ma->use_nodes, 0.0f, 0.0f, 0, 0, "Enables as a Nodes Material");
-
- if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */
-
- uiBlockBeginAlign(block);
-
- /* id is the block from which the material is used */
- if( BTST(ob->colbits, ob->actcol-1) ) id= (ID *)ob;
- else id= ob->data;
-
- /* indicate which one is linking a material */
- if(id) {
- if(id->lib)
- uiSetButLock(1, ERROR_LIBDATA_MESSAGE);
- else
- uiClearButLock();
-
- strncpy(str, id->name, 2);
- str[2]= ':'; str[3]= 0;
- but= uiDefBut(block, TEX, B_IDNAME, str, 10,135,115,20, id->name+2, 0.0, 21.0, 0, 0, "Shows the block the material is linked to");
- uiButSetFunc(but, test_idbutton_cb, id->name, NULL);
- }
-
- uiBlockSetCol(block, TH_BUT_ACTION);
- uiClearButLock();
- uiDefButBitS(block, TOG, 1<<(ob->actcol-1), B_MATFROM, "OB", 125,135,32,20, &ob->colbits, 0, 0, 0, 0, "Links material to object");
- idn= ob->data;
- strncpy(str, idn->name, 2);
- str[2]= 0;
- uiBlockSetCol(block, TH_BUT_SETTING);
- uiDefButBitS(block, TOGN, 1<<(ob->actcol-1), B_MATFROM, str, 158,135,32,20, &ob->colbits, 0, 0, 0, 0, "Shows the block the material is linked to");
- uiBlockSetCol(block, TH_AUTO);
-
- sprintf(str, "%d Mat", ob->totcol);
- if(ob->totcol) min= 1.0; else min= 0.0;
- uiDefButC(block, NUM, B_ACTCOL, str, 190,135,110,20, &(ob->actcol), min, (float)ob->totcol, 0, 0, "Shows the number of materials on object and the active material");
- uiBlockEndAlign(block);
-
- if(ma==NULL) return;
- uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE);
-
- /* Active material node */
- if(ma->use_nodes) {
- uiDefBut(block, LABEL, B_DIFF, "Active Material Node", 10, 115, 300, 20, 0, 0, 0, 0, 0, "");
-
- if(ma) node= editnode_get_active_idnode(ma->nodetree, ID_MA);
- if(node==NULL) {
- node= editnode_get_active(ma->nodetree);
- if(node && node->type!=SH_NODE_MATERIAL)
- node= NULL;
- }
- if(node) {
- rctf rct;
- rct.xmin= 10.0f;
- rct.xmax= 300.0f;
- rct.ymax= 114.0f;
- rct.ymin= 95.0f;
- node->typeinfo->butfunc(block, ma->nodetree, node, &rct);
- }
- }
-
- /* main render pipeline settings */
- uiDefBut(block, LABEL, B_DIFF, "Render Pipeline", 10, 70, 300, 20, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_HALO, B_MATHALO, "Halo", 10,50,100,19, &(ma->mode), 0, 0, 0, 0, "Renders material as a halo");
- uiDefButBitI(block, TOG, MA_ZTRA, B_MATZTRANSP,"ZTransp", 110,50,100,19, &(ma->mode), 0, 0, 0, 0, "Enables Z-Buffering of transparent faces");
- uiDefButF(block, NUM, B_DIFF, "Zoffs:", 210,50,100,19, &(ma->zoffs), 0.0, 100.0, 100, 0, "Gives faces an artificial offset in the Z buffer for Ztransp option");
-
- uiDefButBitI(block, TOG, MA_FULL_OSA, 0, "Full Osa", 10,30,75,19, &(ma->mode), 0.0, 10.0, 0, 0, "Forces to render all OSA samples, for shading and texture antialiasing");
- uiDefButBitI(block, TOG, MA_WIRE, B_MATPRV, "Wire", 85,30,75,19, &(ma->mode), 0, 0, 0, 0, "Renders only the edges of faces as a wireframe");
- uiDefBlockBut(block, strand_menu, ma, "Strands", 160,30,75, 19, "Display strand settings for static particles");
- uiDefButBitI(block, TOG, MA_ZINV, B_MATPRV, "ZInvert", 236,30,75,19, &(ma->mode), 0, 0, 0, 0, "Renders material's faces with inverted Z Buffer");
-
- uiDefButBitI(block, TOG, MA_RADIO, B_NOP, "Radio", 10,10,75,19, &(ma->mode), 0, 0, 0, 0, "Enables radiosity rendering for material");
- uiDefButBitI(block, TOG, MA_ONLYCAST, B_MATPRV,"OnlyCast", 85,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes faces cast shadows only, not rendered");
- uiDefButBitI(block, TOG, MA_TRACEBLE, B_NOP,"Traceable", 160,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material detectable by ray tracing");
- uiDefButBitI(block, TOG, MA_SHADBUF, B_MATPRV, "Shadbuf", 235,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material cast shadows from shadow buffer lamps");
-
-
-}
-
-static void material_panel_preview(Material *ma)
-{
- uiBlock *block;
-
- /* name "Preview" is abused to detect previewrender offset panel */
- block= uiNewBlock(&curarea->uiblocks, "material_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
- if(uiNewPanel(curarea, block, "Preview", "Material", 0, 0, 318, 204)==0) return;
-
- if(ma) {
- G.buts->lockpoin= ma; /* BIF_previewdraw callback will read it */
-
- uiBlockSetDrawExtraFunc(block, BIF_previewdraw);
-
- // label to force a boundbox for buttons not to be centered
- uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
- uiBlockSetCol(block, TH_BUT_NEUTRAL);
- uiBlockBeginAlign(block);
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MATPLANE, 210,180,25,22, &(ma->pr_type), 10, MA_FLAT, 0, 0, "Preview type: Flat XY plane");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210,158,25,22, &(ma->pr_type), 10, MA_SPHERE, 0, 0, "Preview type: Sphere");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE, 210,136,25,22, &(ma->pr_type), 10, MA_CUBE, 0, 0, "Preview type: Cube");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MONKEY, 210,114,25,22, &(ma->pr_type), 10, MA_MONKEY, 0, 0, "Preview type: Monkey");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_HAIR, 210, 92,25,22, &(ma->pr_type), 10, MA_HAIR, 0, 0, "Preview type: Hair strands");
- uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210, 70,25,22, &(ma->pr_type), 10, MA_SPHERE_A, 0, 0, "Preview type: Large sphere with sky");
- uiBlockEndAlign(block);
-
- uiDefIconButBitC(block, TOG, SB_PRV_OSA, B_MATPRV, ICON_RING, 210, 10,25,22, &(G.buts->flag), 0, 0, 0, 0, "Preview uses OSA (oversampling)");
- }
-}
-
-void material_panels()
-{
- Material *ma;
- MTex *mtex;
- Object *ob= OBACT;
-
- if(ob==NULL) return;
-
- // type numbers are ordered
- if((ob->type<OB_LAMP) && ob->type) {
- int from_nodes= 0;
-
- ma= give_current_material(ob, ob->actcol);
-
- // always draw first 2 panels
- material_panel_preview(ma);
- material_panel_links(ob, ma);
-
- if(ma && ma->use_nodes) {
- material_panel_nodes(ma);
- from_nodes= 1;
- }
-
- ma= editnode_get_active_material(ma);
- if(ma) {
- material_panel_material(ma);
- material_panel_ramps(ma);
- material_panel_shading(ma);
-
- if (G.scene->r.renderer==R_INTERN)
- material_panel_tramir(ma);
- else {
- if(ma->YF_ar==0.f) {
- ma->YF_ar = ma->YF_ag = ma->YF_ab = 1;
- ma->YF_dscale = 1;
- }
- material_panel_tramir_yafray(ma);
- }
-
- material_panel_sss(ma);
- material_panel_texture(ob, ma);
-
- mtex= ma->mtex[ ma->texact ];
- if(mtex && mtex->tex) {
- material_panel_map_input(ob, ma);
- material_panel_map_to(ob, ma, from_nodes);
- }
- }
- }
-}
-
-void lamp_panels()
-{
- Object *ob= OBACT;
- Lamp *la;
-
- if(ob==NULL || ob->type!= OB_LAMP) return;
- la= ob->data;
-
- lamp_panel_preview(ob, ob->data);
- lamp_panel_lamp(ob, ob->data);
-
- if (ELEM(la->type, LA_SPOT, LA_LOCAL) && (la->falloff_type == LA_FALLOFF_CURVE))
- lamp_panel_falloff(ob, ob->data);
-
- /* switch to yafray lamp panel if yafray enabled */
- if (G.scene->r.renderer==R_INTERN)
- lamp_panel_spot(ob, ob->data);
- else {
- /* init vars */
- if (la->YF_numphotons==0) la->YF_numphotons=1000;
- if (la->YF_numsearch==0) la->YF_numsearch=10;
- if (la->YF_phdepth==0) la->YF_phdepth=1;
- if (la->YF_causticblur==0.0) la->YF_causticblur=0.001;
- if (la->YF_bufsize==0) la->YF_bufsize=128;
- /* spherelight radius default is zero, so nothing to do */
- lamp_panel_yafray(ob, la);
- }
-
- if(la->type == LA_SUN){
- lamp_panel_atmosphere(ob, ob->data);
- }
-
- lamp_panel_texture(ob, ob->data);
- lamp_panel_mapto(ob, ob->data);
-
-}
-
-void world_panels()
-{
- World *wrld;
-
- wrld= G.scene->world;
-
- world_panel_preview(wrld);
- world_panel_world(wrld);
-
- if(wrld) {
- world_panel_mistaph(wrld);
- world_panel_amb_occ(wrld);
- world_panel_texture(wrld);
- world_panel_mapto(wrld);
- }
-}
-
-void texture_panels()
-{
- Material *ma=NULL;
- Brush *br=NULL;
- SculptData *sd=NULL;
- Lamp *la=NULL;
- World *wrld=NULL;
- bNode *node=NULL;
- Object *ob= OBACT;
- MTex *mtex= NULL;
-
- if(G.buts->texfrom==0) {
- if(ob) {
- ma= give_current_material(ob, ob->actcol);
-
- if(ma && ma->use_nodes) {
- node= editnode_get_active_idnode(ma->nodetree, ID_TE);
-
- if(node)
- ma= NULL;
- else {
- ma= editnode_get_active_material(ma);
- }
- }
- if(ma) mtex= ma->mtex[ ma->texact ];
- }
- }
- else if(G.buts->texfrom==1) {
- wrld= G.scene->world;
- if(wrld) mtex= wrld->mtex[ wrld->texact ];
- }
- else if(G.buts->texfrom==2) {
- if(ob && ob->type==OB_LAMP) {
- la= ob->data;
- mtex= la->mtex[ la->texact ];
- }
- }
- else if(G.buts->texfrom==3) {
- if(G.f & G_SCULPTMODE) {
- sd= &G.scene->sculptdata;
- if(sd->texact != -1)
- mtex= sd->mtex[sd->texact];
- }
- else {
- br= G.scene->toolsettings->imapaint.brush;
- if(br) mtex= br->mtex[br->texact];
- }
- }
-
- texture_panel_preview(mtex, ma || wrld || la || br || node || sd); // for 'from' buttons
-
- if(ma || wrld || la || br || node || sd) {
- Tex *tex= NULL;
-
- texture_panel_texture(mtex, ma, wrld, la, node, br, sd);
-
- if(mtex) tex= mtex->tex;
- else if(node) tex= (Tex *)node->id;
-
- if(tex) {
- texture_panel_colors(tex);
-
- switch(tex->type) {
- case TEX_IMAGE:
- texture_panel_image(&tex->ima, &tex->iuser);
- texture_panel_image_map(tex, mtex);
- break;
- case TEX_ENVMAP:
- texture_panel_envmap(tex);
- break;
- case TEX_CLOUDS:
- texture_panel_clouds(tex);
- break;
- case TEX_MARBLE:
- texture_panel_marble(tex);
- break;
- case TEX_STUCCI:
- texture_panel_stucci(tex);
- break;
- case TEX_WOOD:
- texture_panel_wood(tex);
- break;
- case TEX_BLEND:
- texture_panel_blend(tex);
- break;
- case TEX_MAGIC:
- texture_panel_magic(tex);
- break;
- case TEX_PLUGIN:
- texture_panel_plugin(tex);
- break;
- case TEX_NOISE:
- // no panel! (e: not really true, is affected by noisedepth param)
- break;
- /* newnoise: musgrave panels */
- case TEX_MUSGRAVE:
- texture_panel_musgrave(tex);
- break;
- case TEX_DISTNOISE:
- texture_panel_distnoise(tex);
- break;
- /* newnoise: voronoi */
- case TEX_VORONOI:
- texture_panel_voronoi(tex);
- break;
- }
- }
- }
-}
-
-void radio_panels()
-{
- Radio *rad;
- int flag;
-
- rad= G.scene->radio;
- if(rad==NULL) {
- add_radio();
- rad= G.scene->radio;
- }
-
- radio_panel_render(rad);
-
- flag= rad_phase();
-
- radio_panel_tool(rad, flag);
- if(flag) radio_panel_calculation(rad, flag);
-
-
-}
diff --git a/source/blender/src/cmap.tga.c b/source/blender/src/cmap.tga.c
deleted file mode 100644
index a0e3bece2bf..00000000000
--- a/source/blender/src/cmap.tga.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* DataToC output of file <cmap_tga> */
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int datatoc_cmap_tga_size= 13400;
-char datatoc_cmap_tga[]= {"\x00\x01\x01\x00\x00\x00\x01\x18\x00\x00\x00\x00\x9a\x00\x50\x00\x08\x08\xf3\xf3\xf3\xdb\xdb\xdb\xc4\xc4\xc4\xad\xad\xad\x96\x96\x96\x7f\x7f\x7f\x67\x67\x67\x50\x50\x50\x39\x39\x39\x22\x22\x22\x0b\x0b\x0b\xf4\xf4\xf4\xe6\xc8\xec\xe6\xa4\xec\xe6\x7f\xec\xe6\x5b\xec\xe6\x36\xec\xe6\x12\xec\xb3\xec\xec\xb3\xc8\xec\xb3\xa4\xec\xb3\x7f\xec\xb3\x5b\xec" \
-"\xb3\x36\xec\xb3\x12\xec\x80\xec\xec\x80\xc8\xec\x80\xa4\xec\x80\x7f\xec\x80\x5b\xec\x80\x36\xec\x80\x12\xec\x4d\xec\xec\x4d\xc8\xec\x4d\xa4\xec\x4d\x7f\xec\x4d\x5b\xec\x4d\x36\xec\x4d\x12\xec\x1a\xec\xec\x1a\xc8\xec\x1a\xa4\xec\x1a\x7f\xec\x1a\x5b\xec\x1a\x36\xec\x1a\x12\xec\xe6\xec\xc8\xe6\xc8\xc8\xe6\xa4\xc8\xe6\x7f\xc8\xe6\x5b\xc8\xe6\x36\xc8\xe6\x12\xc8\xb3\xec\xc8\xb3\xc8\xc8\xb3\xa4\xc8\xb3\x7f\xc8\xb3\x5b\xc8\xb3\x36\xc8\xb3\x12\xc8\x80\xec\xc8\x80\xc8\xc8\x80\xa4\xc8\x80\x7f\xc8\x80\x5b\xc8\x80\x36\xc8\x80\x12\xc8\x4d\xec\xc8\x4d\xc8\xc8\x4d\xa4\xc8\x4d\x7f\xc8\x4d\x5b\xc8\x4d\x36\xc8\x4d\x12\xc8\x1a\xec\xc8\x1a\xc8\xc8\x1a\xa4\xc8\x1a\x7f\xc8\x1a\x5b\xc8\x1a\x36\xc8\x1a\x12\xc8\xe6\xec\xa4\xe6\xc8\xa4\xe6\xa4\xa4\xe6\x7f\xa4\xe6\x5b\xa4\xe6\x36\xa4\xe6\x12\xa4\xb3\xec\xa4\xb3\xc8\xa4\xb3\xa4\xa4\xb3\x7f\xa4\xb3\x5b\xa4\xb3\x36\xa4\xb3\x12\xa4\x80\xec\xa4\x80\xc8\xa4\x80\xa4\xa4\x80\x7f\xa4\x80\x5b\xa4\x80\x36\xa4\x80\x12\xa4\x4d\xec\xa4\x4d\xc8\xa4\x4d\xa4\xa4\x4d\x7f\xa4\x4d\x5b\xa4\x4d\x36\xa4\x4d" \
-"\x12\xa4\x1a\xec\xa4\x1a\xc8\xa4\x1a\xa4\xa4\x1a\x7f\xa4\x1a\x5b\xa4\x1a\x36\xa4\x1a\x12\xa4\xe6\xec\x7f\xe6\xc8\x7f\xe6\xa4\x7f\xe6\x7f\x7f\xe6\x5b\x7f\xe6\x36\x7f\xe6\x12\x7f\xb3\xec\x7f\xb3\xc8\x7f\xb3\xa4\x7f\xb3\x7f\x7f\xb3\x5b\x7f\xb3\x36\x7f\xb3\x12\x7f\x80\xec\x7f\x80\xc8\x7f\x80\xa4\x7f\x80\x7f\x7f\x80\x5b\x7f\x80\x36\x7f\x80\x12\x7f\x4d\xec\x7f\x4d\xc8\x7f\x4d\xa4\x7f\x4d\x7f\x7f\x4d\x5b\x7f\x4d\x36\x7f\x4d\x12\x7f\x1a\xec\x7f\x1a\xc8\x7f\x1a\xa4\x7f\x1a\x7f\x7f\x1a\x5b\x7f\x1a\x36\x7f\x1a\x12\x7f\xe6\xec\x5b\xe6\xc8\x5b\xe6\xa4\x5b\xe6\x7f\x5b\xe6\x5b\x5b\xe6\x36\x5b\xe6\x12\x5b\xb3\xec\x5b\xb3\xc8\x5b\xb3\xa4\x5b\xb3\x7f\x5b\xb3\x5b\x5b\xb3\x36\x5b\xb3\x12\x5b\x80\xec\x5b\x80\xc8\x5b\x80\xa4\x5b\x80\x7f\x5b\x80\x5b\x5b\x80\x36\x5b\x80\x12\x5b\x4d\xec\x5b\x4d\xc8\x5b\x4d\xa4\x5b\x4d\x7f\x5b\x4d\x5b\x5b\x4d\x36\x5b\x4d\x12\x5b\x1a\xec\x5b\x1a\xc8\x5b\x1a\xa4\x5b\x1a\x7f\x5b\x1a\x5b\x5b\x1a\x36\x5b\x1a\x12\x5b\xe6\xec\x36\xe6\xc8\x36\xe6\xa4\x36\xe6\x7f\x36\xe6\x5b\x36\xe6\x36\x36\xe6\x12\x36\xb3\xec" \
-"\x36\xb3\xc8\x36\xb3\xa4\x36\xb3\x7f\x36\xb3\x5b\x36\xb3\x36\x36\xb3\x12\x36\x80\xec\x36\x80\xc8\x36\x80\xa4\x36\x80\x7f\x36\x80\x5b\x36\x80\x36\x36\x80\x12\x36\x4d\xec\x36\x4d\xc8\x36\x4d\xa4\x36\x4d\x7f\x36\x4d\x5b\x36\x4d\x36\x36\x4d\x12\x36\x1a\xec\x36\x1a\xc8\x36\x1a\xa4\x36\x1a\x7f\x36\x1a\x5b\x36\x1a\x36\x36\x1a\x12\x36\xe6\xec\x12\xe6\xc8\x12\xe6\xa4\x12\xe6\x7f\x12\xe6\x5b\x12\xe6\x36\x12\xe6\x12\x12\xb3\xec\x12\xb3\xc8\x12\xb3\xa4\x12\xb3\x7f\x12\xb3\x5b\x12\xb3\x36\x12\xb3\x12\x12\x80\xec\x12\x80\xc8\x12\x80\xa4\x12\x80\x7f\x12\x80\x5b\x12\x80\x36\x12\x80\x12\x12\x4d\xec\x12\x4d\xc8\x12\x4d\xa4\x12\x4d\x7f\x12\x4d\x5b\x12\x4d\x36\x12\x4d\x12\x12\x1a\xec\x12\x1a\xc8\x12\x1a\xa4\x12\x1a\x7f\x12\x1a\x5b\x12\x1a\x36\x12\x1a\x12\x12\x03\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" \
-"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \
-"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \
-"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \
-"\x0a\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xff\xff\xff\xff\xff\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\xff\xff\xff\xff\xff\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xdc\xdc\xdc\xdc\xdc" \
-"\xdc\xdc\xdc\xdc\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\x09\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x09\x09\x09\x09\xdb\xdb\xdb\xdb\xdb\xdb\x09\x09\x09\x09\x09\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\xdc\xdc\xdc\xdc" \
-"\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe" \
-"\xfe\xfe\xfe\xfe\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9" \
-"\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2" \
-"\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6" \
-"\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8" \
-"\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\xab\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\x96\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x94\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab" \
-"\xab\xab\xab\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x94\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5" \
-"\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x95\x95" \
-"\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab" \
-"\x88\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4" \
-"\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x72" \
-"\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x73\x73\x73\x73\x73\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81" \
-"\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x50\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3" \
-"\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50" \
-"\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x9d\x7a" \
-"\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2" \
-"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x57\x34\x34\x34\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d" \
-"\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe2\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a" \
-"\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x85\x85\x85\x85\x85\x85\x85\x02\x07\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2" \
-"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x02\x07\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x02\x07" \
-"\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a" \
-"\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf2\xf2" \
-"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xd6\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x2c\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04" \
-"\x02\x07\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x25\x25\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xcf\xcf\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79" \
-"\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x25\x24\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xcf\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\x9c\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x02\x07\x25\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xcf\xcf" \
-"\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbe\x9c\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x02\x07\x24\x24\x24\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x24\x24\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a" \
-"\x5a\x5a\x02\x07\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\x89\xac\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78" \
-"\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\x89\xac" \
-"\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x1d\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03" \
-"\x03\x03\x03\x03\x02\x07\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x54" \
-"\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f" \
-"\x5f\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x76\x54\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02" \
-"\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x1b\x1b\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53" \
-"\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x14\x14\x14\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x14\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35" \
-"\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01" \
-"\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f" \
-"\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x13\x13\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x01\x01\x01\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x01\x01\x01" \
-"\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x0c\x0c\x0c\x0c\x01\x01\x01\x01\x01\x01\x01\x12\x12\x12\x12\x12\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x12\x12\x12\x12\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x01\x01\x01\x01\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x01\x01\x01\x01\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x02\x04\x07\x0b" \
-"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0c\x01\x01\x01\x01\x01\x01\x01\x01\x01\x12\x12\x12\x12\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x12\x12\x12\x12\x12\x01\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x01\x01\x01\x01\x01\x01\x01\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x01\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x01\x01\x01\x01\x01" \
-"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x01\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" \
-"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04" \
-"\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" \
-"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x03\x01\x00\x14\x00\x3e\x33\x00\x00\x00\x01\x00\x00\x38\x42\x49\x4d\x03\xed\x00\x00\x00\x00\x00\x10\x00\x48\x00\x00\x00\x01\x00\x01\x00\x48\x00\x00\x00" \
-"\x01\x00\x01\x38\x42\x49\x4d\x03\xf3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x38\x42\x49\x4d\x03\xf5\x00\x00\x00\x00\x00\x48\x00\x2f\x66\x66\x00\x01\x00\x6c\x66\x66\x00\x06\x00\x00\x00\x00\x00\x00\x00\x2f\x66\x66\x00\x01\x00\xa1\x99\x9a\x00\x06\x00\x00\x00\x00\x00\x00\x00\x32\x00\x00\x00\x01\x00\x5a\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x35\x00\x00\x00\x01\x00\x2d\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x38\x42\x49\x4d\x03\xf8\x00\x00\x00\x00\x00\x70\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\x00\x00\x32\x33\x00\x00\x54\x52\x55\x45\x56\x49\x53\x49\x4f\x4e\x2d\x58\x46\x49\x4c\x45\x2e" \
-"\x00"};
diff --git a/source/blender/src/cmovie.tga.c b/source/blender/src/cmovie.tga.c
deleted file mode 100644
index 32359c02980..00000000000
--- a/source/blender/src/cmovie.tga.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* DataToC output of file <cmovie_tga> */
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int datatoc_cmovie_tga_size= 6247;
-char datatoc_cmovie_tga[]= {"\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x34\x00\x20\x00\x01\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x17\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x50\x50\x50\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xac\xac\xac\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xa9\xa9\xa9\xff\x9c\x9c\x9c\xff\xa4\xa4\xa4" \
-"\xff\xb2\xb2\xb2\xff\x3b\x35\x35\xff\x58\x51\x51\xff\xa3\x9c\x9c\xff\x9a\x97\x97\xff\xb8\xb8\xb8\xff\xaf\xae\xae\xff\x47\x42\x42\xff\x86\x80\x80\xff\xb4\xb4\xb4\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x52\x52\x52\xff\x9f\x9f\x9f\xff\xa0\xa0\xa0\xff\xa9\xa9\xa9\xff\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x9c\x9c\x9c\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\x38\x32\x32\xff\x72\x6a\x6a\xff\x86\x80\x80\xff\xaf\xaf\xaf\xff\xb7\xb7\xb7\xff\x5d\x5a\x5a\xff\x4d\x46\x46\xff\x9a\x93\x93\xff\xb4\xb4\xb4\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x5a\x5a\x5a\xff\xb3\xb3\xb3\xff\xb4\xb4\xb4\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa2\xa2\xa2\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xad\xad\xad\xff\xb8\xb8\xb8\xff\x91\x8f\x8f\xff\x8e\x8b\x8b\xff\xad\xac\xac\xff\xb8\xb8\xb8\xff\x9a\x99\x99\xff\x33\x2c\x2c\xff\x84" \
-"\x7d\x7d\xff\x9e\x99\x99\xff\xb6\xb6\xb6\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x04\xb5\xb5\xb5\xff\xa3\xa3\xa3\xff\x9e\x9e\x9e\xff\xa7\xa7\xa7\xff\xb6\xb6\xb6\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\x92\x90\x90\xff\x43\x3b\x3b\xff\x7b\x74\x74\xff\xa0\x9d\x9d\xff\x89\xb7\xb7\xb7\xff\x01\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\x86\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x03\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xb7\xb7\xb7\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb6\xb6\xb6\xff\x91\x8f\x8f\xff\xa2\xa0\xa0\xff\x8b\xb7\xb7\xb7\xff\x87\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83" \
-"\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x89\xb8\xb8\xb8\xff\x01\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x8f\xb7\xb7\xb7\xff\x88\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xb1\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xff\x0c\x0c\x0c\xff\x81\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x85\xb8\xb8\xb8\xff\x00\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x8d\xb8\xb8\xb8\xff\x02\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x82\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c" \
-"\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x09\xb6\xb6\xb6\xff\xb2\xb2\xb2\xff\xae\xae\xae\xff\xa9\xa9\xa9\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\xa8\xa8\xa8\xff\xab\xab\xab\xff\xb2\xb2\xb2\xff\xb6\xb6\xb6\xff\x89\xb8\xb8\xb8\xff\x86\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x06\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa8\xa8\xa8\xff\xa0\xa0\xa0\xff\x85\x9c\x9c\x9c\xff\x05\x9e\x9e\x9e\xff\xa4\xa4\xa4\xff\xb0\xb0\xb0\xff\xb9\xb9\xb9\xff\xba\xba\xba\xff\xb9\xb9\xb9\xff\x86\xb8\xb8\xb8\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0" \
-"\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x04\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xae\xae\xae\xff\xa1\xa1\xa1\xff\x87\x9c\x9c\x9c\xff\x09\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\xa3\xa3\xa3\xff\xa9\xa9\xa9\xff\x9c\x9b\x9c\xff\x8c\x8a\x8b\xff\x7f\x7e\x7e\xff\x8c\x8a\x8b\xff\xa1\xa1\xa1\xff\xb5\xb5\xb5\xff\x83\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x03\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x87\x9c\x9c\x9c\xff\x0e\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\x9f\x9f\x9f\xff\x6e\x6c\x6c\xff\x36\x31\x32\xff\x21\x1b\x1c\xff\x20\x1a\x1b\xff\x1f\x19\x1a\xff\x1e\x19\x1a\xff\x24\x1f\x20\xff\x42\x3e\x3f\xff\x84\x83\x83\xff\xb2\xb2\xb2\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5c\x5c\x5c\xff\xb1\xb1\xb1\xff\xa0\xa0\xa0\xff\x88\x9c\x9c\x9c" \
-"\xff\x0d\x9d\x9d\x9d\xff\x96\x96\x96\xff\x42\x3e\x3f\xff\x21\x1b\x1c\xff\x1e\x22\x20\xff\x16\x3e\x34\xff\x10\x4f\x41\xff\x0e\x53\x44\xff\x10\x41\x35\xff\x14\x1f\x1c\xff\x19\x14\x15\xff\x1e\x19\x1a\xff\x45\x41\x42\xff\xa2\xa1\xa1\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x5a\x5a\x5a\xff\xa5\xa5\xa5\xff\x89\x9c\x9c\x9c\xff\x0e\x96\x96\x96\xff\x41\x3d\x3e\xff\x20\x1d\x1e\xff\x14\x4d\x3f\xff\x07\x98\x78\xff\x05\xaf\x8a\xff\x05\xbc\x94\xff\x05\xbb\x92\xff\x05\xba\x92\xff\x05\xa0\x7d\xff\x09\x62\x4d\xff\x10\x21\x1c\xff\x19\x14\x15\xff\x2f\x2a\x2b\xff\x99\x98\x99\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x05\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x55" \
-"\x55\x55\xff\x9d\x9d\x9d\xff\x88\x9c\x9c\x9c\xff\x10\x9b\x9b\x9b\xff\x48\x45\x46\xff\x20\x1b\x1c\xff\x11\x6a\x55\xff\x06\x9d\x79\xff\x06\xa8\x82\xff\x06\xb2\x8a\xff\x06\xc3\x96\xff\x06\xd1\xa4\xff\x06\xd0\xa3\xff\x06\xbd\x94\xff\x04\xad\x88\xff\x05\x88\x6a\xff\x0b\x37\x2c\xff\x16\x12\x12\xff\x31\x2d\x2e\xff\xa2\xa2\xa2\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x55\x55\x55\xff\x9e\x9e\x9e\xff\x88\x9c\x9c\x9c\xff\x11\x75\x74\x75\xff\x22\x1d\x1e\xff\x1a\x48\x3d\xff\x06\x9f\x7b\xff\x06\xaf\x8a\xff\x06\xb4\x8c\xff\x06\xc0\x95\xff\x08\xc9\x9c\xff\x09\xcd\xa3\xff\x08\xc5\x9b\xff\x07\xca\x9f\xff\x05\xba\x92\xff\x04\xa5\x81\xff\x04\x90\x71\xff\x0b\x33\x28\xff\x17\x12\x12\xff\x4d\x49\x4a\xff\xb3\xb3\xb3\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf" \
-"\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5b\x5b\x5b\xff\xb0\xb0\xb0\xff\xa2\xa2\xa2\xff\x86\x9c\x9c\x9c\xff\x12\x9b\x9b\x9b\xff\x3c\x39\x39\xff\x24\x1f\x20\xff\x0e\x92\x75\xff\x07\xab\x85\xff\x07\xaf\x88\xff\x07\xbd\x94\xff\x06\x97\x76\xff\x0b\x66\x4f\xff\x13\x3c\x33\xff\x19\x2d\x33\xff\x1d\x39\x46\xff\x17\x61\x5e\xff\x0b\x91\x77\xff\x04\x9d\x7b\xff\x05\x86\x69\xff\x0d\x20\x1b\xff\x1d\x18\x18\xff\x86\x84\x84\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xa7\xa7\xa7\xff\x86\x9c\x9c\x9c\xff\x13\x8e\x8e\x8e\xff\x27\x23\x23\xff\x1d\x4c\x42\xff\x09\xb3\x8d\xff\x08\xaf\x87\xff\x09\xbf\x95\xff\x08\x9e\x7d\xff\x0b\x48\x39\xff\x1a\x10\x14\xff\x23\x12\x2a\xff\x2c\x19\x47\xff\x2d\x1b\x56\xff\x2b\x1a\x59\xff\x26\x24\x58\xff\x12\x76\x6e\xff" \
-"\x04\xa3\x80\xff\x07\x63\x4d\xff\x13\x0f\x0f\xff\x42\x3e\x3f\xff\xb4\xb4\xb4\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5c\x5c\x5c\xff\xb6\xb6\xb6\xff\xa3\xa3\xa3\xff\x86\x9c\x9c\x9c\xff\x13\x9b\x9b\x9b\xff\x88\x92\x8f\xff\x0f\xa5\x83\xff\x0a\xba\x93\xff\x0b\xb5\x8d\xff\x0a\xc4\x9b\xff\x08\x6c\x57\xff\x14\x0f\x0e\xff\x1d\x10\x20\xff\x28\x18\x42\xff\x30\x1d\x5d\xff\x36\x21\x72\xff\x39\x23\x82\xff\x37\x23\x85\xff\x2e\x27\x72\xff\x0b\x9a\x82\xff\x04\x97\x74\xff\x0c\x20\x1a\xff\x20\x1a\x1c\xff\x9f\x9e\x9e\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5b\x5b\x5b\xff\xb3\xb3\xb3\xff\xa4\xa4\xa4\xff\x86\x9c\x9c\x9c\xff\x13\x9d\x9d\x9d\xff\x8b\xa2\x9b\xff\x11\xb9\x96\xff\x0e\xc7\xa0\xff\x0e\xc8\xa0\xff\x0b\xb4\x8e\xff\x0d\x3b\x30\xff\x16\x0b\x10\xff\x21\x14\x2f\xff\x2d\x1c\x52\xff\x36\x22\x70\xff\x4a\x33\x9c\xff\x5d\x45\xc1\xff\x59\x42" \
-"\xc9\xff\x43\x2d\xaa\xff\x1e\x65\x7c\xff\x04\xb5\x8e\xff\x08\x50\x40\xff\x20\x22\x22\xff\x86\x85\x85\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x02\x52\x52\x52\xff\xa1\xa1\xa1\xff\x9e\x9e\x9e\xff\x87\x9c\x9c\x9c\xff\x12\x88\xa4\x9d\xff\x14\xb6\x92\xff\x12\xbb\x95\xff\x12\xca\xa1\xff\x0f\xb0\x8a\xff\x0f\x2c\x24\xff\x18\x0c\x17\xff\x26\x15\x3c\xff\x33\x20\x67\xff\x47\x30\x94\xff\x71\x57\xd5\xff\xa3\x87\xfc\xff\x92\x76\xfc\xff\x5b\x41\xda\xff\x2d\x4d\x90\xff\x06\xbc\x92\xff\x05\xaa\x84\xff\x55\xaf\x98\xff\xbc\xbc\xbc\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x51\x51\x51\xff\x88\x9c\x9c" \
-"\x9c\xff\x13\x98\x97\x97\xff\x93\x9d\x9a\xff\x45\xb3\x99\xff\x17\xc9\xa1\xff\x17\xca\xa1\xff\x15\xca\xa3\xff\x11\x3c\x31\xff\x17\x0b\x19\xff\x26\x15\x44\xff\x34\x21\x6f\xff\x4f\x37\xa4\xff\x85\x6b\xf0\xff\xc1\xa3\xff\xff\xad\x8f\xff\xff\x66\x4a\xec\xff\x30\x49\x91\xff\x07\xca\x9f\xff\x06\xb7\x8e\xff\x49\xb8\x9e\xff\xbe\xbe\xbe\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x55\x55\x55\xff\x88\x9c\x9c\x9c\xff\x16\x7a\x79\x79\xff\x86\x7f\x7f\xff\xa6\xb6\xaf\xff\x23\xd0\xaa\xff\x1e\xdc\xb1\xff\x1d\xe3\xb8\xff\x15\x7e\x65\xff\x18\x0d\x17\xff\x24\x15\x3e\xff\x33\x1f\x6a\xff\x49\x32\x9e\xff\x6f\x54\xdf\xff\x95\x78\xfe\xff\x88\x69\xfe\xff\x5b\x3e\xdf\xff\x26\x76\x91\xff\x07\xcf\xa2\xff\x07\xb8\x90\xff\x4b\xb6\x9c\xff\xbf\xbf\xbf\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff" \
-"\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x05\x59\x59\x59\xff\xa2\xa2\xa2\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x99\x99\x99\xff\x83\x9c\x9c\x9c\xff\x16\x93\x93\x93\xff\x6c\x65\x65\xff\xc1\xba\xb9\xff\x4d\xd8\xb7\xff\x25\xe2\xb8\xff\x24\xe1\xb6\xff\x1f\xd1\xa8\xff\x17\x2a\x28\xff\x21\x14\x32\xff\x2f\x1c\x5b\xff\x3e\x28\x88\xff\x50\x37\xb6\xff\x5f\x42\xdc\xff\x60\x40\xe8\xff\x46\x43\xb6\xff\x12\xd5\xb8\xff\x07\xd3\xa6\xff\x09\x85\x69\xff\x57\x5e\x5a\xff\xab\xa8\xa8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x20\x5c\x5c\x5c\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x8f\x8f\x8f\xff\x4d\x48\x48\xff\x56\x50\x50\xff\x66\x62\x62\xff\x74\x71\x71\xff\x7f\x7c\x7c\xff\x8d\x8a\x8a\xff\x99\x99\x99\xff\x5d\x59\x59\xff\xc2\xba\xba\xff\xa2\xd7\xc9\xff\x2d\xdd\xb5\xff\x2b\xe9\xbf\xff\x29\xef\xc8\xff\x21\xb9\x99\xff\x1a\x28\x2e\xff\x24\x16\x3f\xff\x33\x20\x66" \
-"\xff\x3c\x24\x85\xff\x43\x2b\x9d\xff\x43\x40\xa8\xff\x1e\xbe\xb2\xff\x0a\xea\xba\xff\x07\xd6\xaa\xff\x0c\x53\x42\xff\x79\x72\x72\xff\xa9\xa6\xa6\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x1d\x5c\x5c\x5c\xff\xb6\xb6\xb6\xff\xa5\xa5\xa5\xff\x65\x62\x62\xff\x43\x3b\x3b\xff\x77\x6f\x6f\xff\xa0\x99\x99\xff\x9f\x98\x98\xff\x91\x8a\x8a\xff\x91\x8f\x8f\xff\x9b\x9b\x9b\xff\x7e\x7d\x7d\xff\x92\x8b\x8b\xff\xd7\xd4\xd2\xff\x5f\xda\xbd\xff\x30\xe0\xb9\xff\x2e\xd7\xb0\xff\x2b\xde\xb7\xff\x25\xbe\x9c\xff\x1f\x71\x63\xff\x21\x48\x55\xff\x26\x4d\x63\xff\x26\x88\x90\xff\x19\xe4\xc7\xff\x10\xeb\xbc\xff\x0b\xdd\xae\xff\x08\xb5\x8f\xff\x25\x34\x2f\xff\x96\x8f\x8f\xff\xb2\xb1\xb1\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff" \
-"\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x1d\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\x98\x98\x98\xff\x4d\x49\x49\xff\x5e\x57\x57\xff\x77\x70\x70\xff\x80\x7c\x7c\xff\x93\x92\x92\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x61\x5d\x5d\xff\xcb\xc4\xc4\xff\xca\xda\xd4\xff\x45\xd5\xb2\xff\x31\xd3\xae\xff\x2e\xd0\xab\xff\x2b\xdc\xb8\xff\x29\xe0\xb7\xff\x24\xd8\xae\xff\x20\xe0\xb7\xff\x1b\xea\xbe\xff\x15\xe5\xb7\xff\x10\xe3\xb5\xff\x0c\xd0\xa5\xff\x0d\x69\x55\xff\x70\x6a\x6a\xff\xa3\x9d\x9d\xff\xb8\xb7\xb7\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x0a\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x59\x59\x59\xff\xae\xae\xae\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xa2\xa2\xa2\xff\x90\x90\x90\xff\x97\x97\x97\xff\x84\x9c\x9c\x9c\xff\x10\x92\x92\x92\xff\x77\x73\x73\xff\xe0" \
-"\xd9\xd9\xff\xc7\xdd\xd6\xff\x4e\xce\xaf\xff\x33\xd8\xb4\xff\x2f\xd4\xb0\xff\x2a\xd4\xad\xff\x25\xda\xb1\xff\x21\xd0\xa8\xff\x1b\xda\xb2\xff\x15\xd7\xaf\xff\x0f\xc3\x9c\xff\x0d\x84\x6a\xff\x4f\x55\x52\xff\x9d\x96\x96\xff\xb1\xae\xae\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x1f\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x4f\x4f\x4f\xff\xa3\xa3\xa3\xff\xb4\xb4\xb4\xff\xb8\xb8\xb8\xff\xb4\xb4\xb4\xff\xa7\xa7\xa7\xff\x9e\x9e\x9e\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x96\x96\x96\xff\x85\x83\x83\xff\x95\x94\x94\xff\x89\x89\x89\xff\x85\x80\x80\xff\xe8\xe0\xe0\xff\xd8\xe4\xdf\xff\x76\xdd\xc6\xff\x37\xcd\xab\xff\x2d\xcc\xa8\xff\x27\xd3\xae\xff\x21\xc7\xa1\xff\x1a\xbe\x97\xff\x13\xa6\x84\xff\x18\x73\x5f\xff\x5d\x61\x5f\xff\x9c\x95\x95\xff\xac\xa8\xa8\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8" \
-"\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x51\x51\x51\xff\xb0\xb0\xb0\xff\x82\xb8\xb8\xb8\xff\x16\xb6\xb6\xb6\xff\xaf\xaf\xaf\xff\x90\x90\x90\xff\x68\x65\x65\xff\x5a\x55\x55\xff\x63\x5d\x5d\xff\x88\x81\x81\xff\x9a\x9a\x9a\xff\x9c\x9c\x9c\xff\x8e\x8d\x8d\xff\x90\x8d\x8d\xff\xdf\xd8\xd8\xff\xee\xe7\xe7\xff\xcc\xda\xd4\xff\x8a\xcb\xbc\xff\x5b\xb5\x9f\xff\x48\xa0\x8b\xff\x4b\x8e\x7e\xff\x6b\x84\x7d\xff\x98\x92\x91\xff\xa5\x9e\x9e\xff\xae\xab\xab\xff\xb6\xb6\xb6\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x19\x59\x59\x59\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xae\xae\xae\xff\x8f\x8e\x8e\xff\x39\x32\x32\xff\x5f\x58\x58\xff\x91\x8a\x8a\xff\x98\x92\x92\xff\x9d\x9c\x9c\xff\xa7\xa7\xa7\xff\xa7\xa7\xa7\xff\xaa\xaa\xaa\xff\xad\xac\xac\xff\x9a\x9a\x9a\xff\xbf\xbb\xbb\xff\xd9\xd3\xd3\xff\xe2\xda\xda\xff\xd7\xcf\xcf\xff\xca\xc3\xc3\xff\xbf\xb8\xb8\xff" \
-"\xb8\xb1\xb1\xff\xb4\xaf\xaf\xff\xb5\xb3\xb3\xff\x86\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x17\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa4\xa4\xa4\xff\xa8\xa8\xa8\xff\x71\x6e\x6e\xff\x4a\x42\x42\xff\x7f\x78\x78\xff\x91\x8a\x8a\xff\xa3\xa1\xa1\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x8b\x89\x89\xff\xa1\x9e\x9e\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xab\xab\xab\xff\xb8\xb7\xb7\xff\xc1\xbe\xbe\xff\xc3\xc1\xc1\xff\xbd\xbb\xbb\xff\xb9\xb8\xb8\xff\x89\xb7\xb7\xb7\xff\x83\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x12\x5c\x5c\x5c\xff\xb4\xb4\xb4\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x9c\x9c\x9c\xff\xae\xae\xae\xff\xb3\xb3\xb3\xff\x84\x82\x82\xff\x7d\x7a\x7a\xff" \
-"\x98\x97\x97\xff\xb6\xb6\xb6\xff\xb8\xb8\xb8\xff\xb3\xb3\xb3\xff\x73\x71\x71\xff\x6a\x63\x63\xff\xaf\xae\xae\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x97\x95\x95\xff\x8e\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x13\x58\x58\x58\xff\xa3\xa3\xa3\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\xa2\xa2\xa2\xff\xb4\xb4\xb4\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa4\xa4\xa4\xff\xa3\xa3\xa3\xff\xb6\xb6\xb6\xff\xa0\x9f\x9f\xff\x4f\x4a\x4a\xff\x56\x4e\x4e\xff\x95\x8f\x8f\xff\xb5\xb5\xb5\xff\xb8\xb8\xb8\xff\x8e\x8d\x8d\xff\x78\x72\x72\xff\xb6\xb5\xb5\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x17\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe" \
-"\xfe\xfe\xff\x50\x50\x50\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xac\xac\xac\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xa9\xa9\xa9\xff\x9c\x9c\x9c\xff\xa4\xa4\xa4\xff\xb2\xb2\xb2\xff\x3b\x35\x35\xff\x58\x51\x51\xff\xa3\x9c\x9c\xff\x9a\x97\x97\xff\xb8\xb8\xb8\xff\xaf\xae\xae\xff\x47\x42\x42\xff\x86\x80\x80\xff\xb4\xb4\xb4\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x52\x52\x52\xff\x9f\x9f\x9f\xff\xa0\xa0\xa0\xff\xa9\xa9\xa9\xff\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x9c\x9c\x9c\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\x38\x32\x32\xff\x72\x6a\x6a\xff\x86\x80\x80\xff\xaf\xaf\xaf\xff\xb7\xb7\xb7\xff\x5d\x5a\x5a\xff\x4d\x46\x46\xff\x9a\x93\x93\xff\xb4\xb4\xb4\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x5a\x5a\x5a\xff\xb3\xb3\xb3\xff\xb4\xb4\xb4\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa2\xa2\xa2" \
-"\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xad\xad\xad\xff\xb8\xb8\xb8\xff\x91\x8f\x8f\xff\x8e\x8b\x8b\xff\xad\xac\xac\xff\xb8\xb8\xb8\xff\x9a\x99\x99\xff\x33\x2c\x2c\xff\x84\x7d\x7d\xff\x9e\x99\x99\xff\xb6\xb6\xb6\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x04\xb5\xb5\xb5\xff\xa3\xa3\xa3\xff\x9e\x9e\x9e\xff\xa7\xa7\xa7\xff\xb6\xb6\xb6\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\x92\x90\x90\xff\x43\x3b\x3b\xff\x7b\x74\x74\xff\xa0\x9d\x9d\xff\x89\xb7\xb7\xb7\xff\x01\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\x86\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x03\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xb7\xb7\xb7\xff" \
-"\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb6\xb6\xb6\xff\x91\x8f\x8f\xff\xa2\xa0\xa0\xff\x8b\xb7\xb7\xb7\xff\x87\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x89\xb8\xb8\xb8\xff\x01\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x8f\xb7\xb7\xb7\xff\x88\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xb1\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xff\x0c\x0c\x0c\xff\x81\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x85\xb8\xb8\xb8\xff\x00\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x8d\xb8\xb8\xb8\xff\x02\xb7\xb7\xb7\xff\xb7\xb7" \
-"\xb7\xff\xb8\xb8\xb8\xff\x82\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x09\xb6\xb6\xb6\xff\xb2\xb2\xb2\xff\xae\xae\xae\xff\xa9\xa9\xa9\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\xa8\xa8\xa8\xff\xab\xab\xab\xff\xb2\xb2\xb2\xff\xb6\xb6\xb6\xff\x89\xb8\xb8\xb8\xff\x86\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x06\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa8\xa8\xa8\xff\xa0\xa0\xa0\xff\x85\x9c\x9c\x9c\xff\x05\x9e\x9e\x9e\xff\xa4\xa4\xa4\xff\xb0\xb0\xb0\xff\xb9\xb9\xb9\xff\xba\xba\xba\xff\xb9\xb9\xb9\xff\x86\xb8\xb8\xb8\xff\x85\xb7\xb7" \
-"\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x04\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xae\xae\xae\xff\xa1\xa1\xa1\xff\x87\x9c\x9c\x9c\xff\x09\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\xa3\xa3\xa3\xff\xa9\xa9\xa9\xff\x9c\x9b\x9c\xff\x8c\x8a\x8b\xff\x7f\x7e\x7e\xff\x8c\x8a\x8b\xff\xa1\xa1\xa1\xff\xb5\xb5\xb5\xff\x83\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x03\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x87\x9c\x9c\x9c\xff\x0e\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\x9f\x9f\x9f\xff\x6e\x6c\x6c\xff\x36\x31\x32\xff\x21\x1b\x1c\xff\x20\x1a\x1b\xff\x1f\x19\x1a\xff\x1e\x19\x1a\xff\x24\x1f\x20\xff\x42\x3e\x3f\xff\x84\x83\x83\xff\xb2\xb2\xb2\xff\xb8\xb8\xb8" \
-"\xff\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5c\x5c\x5c\xff\xb1\xb1\xb1\xff\xa0\xa0\xa0\xff\x88\x9c\x9c\x9c\xff\x0d\x9d\x9d\x9d\xff\x96\x96\x96\xff\x42\x3e\x3f\xff\x21\x1b\x1c\xff\x1e\x22\x20\xff\x16\x3e\x34\xff\x10\x4f\x41\xff\x0e\x53\x44\xff\x10\x41\x35\xff\x14\x1f\x1c\xff\x19\x14\x15\xff\x1e\x19\x1a\xff\x45\x41\x42\xff\xa2\xa1\xa1\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x5a\x5a\x5a\xff\xa5\xa5\xa5\xff\x89\x9c\x9c\x9c\xff\x0e\x96\x96\x96\xff\x41\x3d\x3e\xff\x20\x1d\x1e\xff\x14\x4d\x3f\xff\x07\x98\x78\xff\x05\xaf\x8a\xff\x05\xbc\x94\xff\x05\xbb\x92\xff\x05\xba\x92\xff\x05\xa0\x7d\xff\x09\x62\x4d\xff\x10\x21\x1c\xff\x19\x14\x15\xff\x2f\x2a\x2b\xff\x99\x98\x99\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x02\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c" \
-"\xff"};
-
-/* these are not the monkeys you are looking for */
-int monkeyo= 4;
-int monkeynv= 271;
-int monkeynf= 250;
-signed char monkeyv[271][3]= {
-{-71,21,98},{-63,12,88},{-57,7,74},{-82,-3,79},{-82,4,92},
-{-82,17,100},{-92,21,102},{-101,12,95},{-107,7,83},
-{-117,31,84},{-109,31,95},{-96,31,102},{-92,42,102},
-{-101,50,95},{-107,56,83},{-82,66,79},{-82,58,92},
-{-82,46,100},{-71,42,98},{-63,50,88},{-57,56,74},
-{-47,31,72},{-55,31,86},{-67,31,97},{-66,31,99},
-{-70,43,100},{-82,48,103},{-93,43,105},{-98,31,105},
-{-93,20,105},{-82,31,106},{-82,15,103},{-70,20,100},
-{-127,55,95},{-127,45,105},{-127,-87,94},{-127,-41,100},
-{-127,-24,102},{-127,-99,92},{-127,52,77},{-127,73,73},
-{-127,115,-70},{-127,72,-109},{-127,9,-106},{-127,-49,-45},
-{-101,-24,72},{-87,-56,73},{-82,-89,73},{-80,-114,68},
-{-85,-121,67},{-104,-124,71},{-127,-126,74},{-71,-18,68},
-{-46,-5,69},{-21,19,57},{-17,55,76},{-36,62,80},
-{-64,77,88},{-86,97,94},{-107,92,97},{-119,63,96},
-{-106,53,99},{-111,39,98},{-101,12,95},{-79,2,90},
-{-64,8,86},{-47,24,83},{-45,38,83},{-50,48,85},
-{-72,56,92},{-95,60,97},{-127,-98,94},{-113,-92,94},
-{-112,-107,91},{-119,-113,89},{-127,-114,88},{-127,-25,96},
-{-127,-18,95},{-114,-19,95},{-111,-29,96},{-116,-37,95},
-{-76,-6,86},{-48,7,80},{-34,26,77},{-32,48,84},
-{-39,53,93},{-71,70,102},{-87,82,107},{-101,79,109},
-{-114,55,108},{-111,-13,104},{-100,-57,91},{-95,-90,88},
-{-93,-105,85},{-97,-117,81},{-106,-119,81},{-127,-121,82},
-{-127,6,93},{-127,27,98},{-85,61,95},{-106,18,96},
-{-110,27,97},{-112,-88,94},{-117,-57,96},{-127,-57,96},
-{-127,-42,95},{-115,-35,100},{-110,-29,102},{-113,-17,100},
-{-122,-16,100},{-127,-26,106},{-121,-19,104},{-115,-20,104},
-{-113,-29,106},{-117,-32,103},{-127,-37,103},{-94,-40,71},
-{-106,-31,91},{-104,-40,91},{-97,-32,71},{-127,-112,88},
-{-121,-111,88},{-115,-105,91},{-115,-95,93},{-127,-100,84},
-{-115,-96,85},{-115,-104,82},{-121,-109,81},{-127,-110,81},
-{-105,28,100},{-103,20,99},{-84,55,97},{-92,54,99},
-{-73,51,99},{-55,45,89},{-52,37,88},{-53,25,87},
-{-66,13,92},{-79,8,95},{-98,14,100},{-104,38,100},
-{-100,48,100},{-97,46,97},{-102,38,97},{-96,16,97},
-{-79,11,93},{-68,15,90},{-57,27,86},{-56,36,86},
-{-59,43,87},{-74,50,96},{-91,51,98},{-84,52,96},
-{-101,22,96},{-102,29,96},{-113,59,78},{-102,85,79},
-{-84,88,76},{-65,71,71},{-40,58,63},{-25,52,59},
-{-28,21,48},{-50,0,53},{-71,-12,60},{-127,115,37},
-{-127,126,-10},{-127,-25,-86},{-127,-59,24},{-127,-125,59},
-{-127,-103,44},{-127,-73,41},{-127,-62,36},{-18,30,7},
-{-17,41,-6},{-28,34,-56},{-68,56,-90},{-33,-6,9},
-{-51,-16,-21},{-45,-1,-55},{-84,7,-85},{-97,-45,52},
-{-104,-53,33},{-90,-91,49},{-95,-64,50},{-85,-117,51},
-{-109,-97,47},{-111,-69,46},{-106,-121,56},{-99,-36,55},
-{-100,-29,60},{-101,-22,64},{-100,-50,21},{-89,-40,-34},
-{-83,-19,-69},{-69,111,-49},{-69,119,-9},{-69,109,30},
-{-68,67,55},{-34,52,43},{-46,58,36},{-45,90,7},
-{-25,72,16},{-25,79,-15},{-45,96,-25},{-45,87,-57},
-{-25,69,-46},{-48,42,-75},{-65,3,-70},{-22,42,-26},
-{-75,-22,19},{-72,-25,-27},{-13,52,-30},{-28,-18,-16},
-{6,-13,-42},{37,7,-55},{46,41,-54},{31,65,-54},
-{4,61,-40},{3,53,-37},{25,56,-50},{35,37,-52},
-{28,10,-52},{5,-5,-39},{-21,-9,-17},{-9,46,-28},
-{-6,39,-37},{-14,-3,-27},{6,0,-47},{25,12,-57},
-{31,32,-57},{23,46,-56},{4,44,-46},{-19,37,-27},
-{-20,22,-35},{-30,12,-35},{-22,11,-35},{-19,2,-35},
-{-23,-2,-35},{-34,0,-9},{-35,-3,-22},{-35,5,-24},
-{-25,26,-27},{-13,31,-34},{-13,30,-41},{-23,-2,-41},
-{-18,2,-41},{-21,10,-41},{-29,12,-41},{-19,22,-41},
-{6,42,-53},{25,44,-62},{34,31,-63},{28,11,-62},
-{7,0,-54},{-14,-2,-34},{-5,37,-44},{-13,14,-42},
-{-7,8,-43},{1,16,-47},{-4,22,-45},{3,30,-48},
-{8,24,-49},{15,27,-50},{12,35,-50},{4,56,-62},
-{33,60,-70},{48,38,-64},{41,7,-68},{6,-11,-63},
-{-26,-16,-42},{-17,49,-49},
-};
-
-signed char monkeyf[250][4]= {
-{27,4,5,26}, {25,4,5,24}, {3,6,5,4}, {1,6,5,2}, {5,6,7,4},
-{3,6,7,2}, {5,8,7,6}, {3,8,7,4}, {7,8,9,6},
-{5,8,9,4}, {7,10,9,8}, {5,10,9,6}, {9,10,11,8},
-{7,10,11,6}, {9,12,11,10}, {7,12,11,8}, {11,6,13,12},
-{5,4,13,12}, {3,-2,13,12}, {-3,-4,13,12}, {-5,-10,13,12},
-{-11,-12,14,12}, {-13,-18,14,13}, {-19,4,5,13}, {10,12,4,4},
-{10,11,9,9}, {8,7,9,9}, {7,5,6,6}, {6,3,4,4},
-{5,1,2,2}, {4,-1,0,0}, {3,-3,-2,-2}, {22,67,68,23},
-{20,65,66,21}, {18,63,64,19}, {16,61,62,17}, {14,59,60,15},
-{12,19,48,57}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47},
-{18,19,48,47}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47},
-{18,19,48,47}, {18,-9,-8,47}, {18,27,45,46}, {26,55,43,44},
-{24,41,42,54}, {22,39,40,23}, {20,37,38,21}, {18,35,36,19},
-{16,33,34,17}, {14,31,32,15}, {12,39,30,13}, {11,48,45,38},
-{8,36,-19,9}, {8,-20,44,47}, {42,45,46,43}, {18,19,40,39},
-{16,17,38,37}, {14,15,36,35}, {32,44,43,33}, {12,33,32,42},
-{19,44,43,42}, {40,41,42,-27}, {8,9,39,-28}, {15,43,42,16},
-{13,43,42,14}, {11,43,42,12}, {9,-30,42,10}, {37,12,38,-32},
-{-33,37,45,46}, {-33,40,41,39}, {38,40,41,37}, {36,40,41,35},
-{34,40,41,33}, {36,39,38,37}, {35,40,39,38}, {1,2,14,21},
-{1,2,40,13}, {1,2,40,39}, {1,24,12,39}, {-34,36,38,11},
-{35,38,36,37}, {-37,8,35,37}, {-11,-12,-45,40}, {-11,-12,39,38},
-{-11,-12,37,36}, {-11,-12,35,34}, {33,34,40,41}, {33,34,38,39},
-{33,34,36,37}, {33,-52,34,35}, {33,37,36,34}, {33,35,34,34},
-{8,7,37,36}, {-32,7,35,46}, {-34,-33,45,46}, {4,-33,43,34},
-{-34,-33,41,42}, {-34,-33,39,40}, {-34,-33,37,38}, {-34,-33,35,36},
-{-34,-33,33,34}, {-34,-33,31,32}, {-34,-4,28,30}, {-5,-34,28,27},
-{-35,-44,36,27}, {26,35,36,45}, {24,25,44,45}, {25,23,44,42},
-{25,24,41,40}, {25,24,39,38}, {25,24,37,36}, {25,24,35,34},
-{25,24,33,32}, {25,24,31,30}, {15,24,29,38}, {25,24,27,26},
-{23,12,37,26}, {11,12,35,36}, {-86,-59,36,-80}, {-60,-61,36,35},
-{-62,-63,36,35}, {-64,-65,36,35}, {-66,-67,36,35}, {-68,-69,36,35},
-{-70,-71,36,35}, {-72,-73,36,35}, {-74,-75,36,35}, {42,43,53,58},
-{40,41,57,56}, {38,39,55,57}, {-81,-80,37,56}, {-83,-82,55,52},
-{-85,-84,51,49}, {-87,-86,48,49}, {47,50,51,48}, {46,48,51,49},
-{43,46,49,44}, {-92,-91,45,42}, {-23,49,50,-20}, {-94,40,48,-24},
-{-96,-22,48,49}, {-97,48,21,-90}, {-100,36,50,23}, {22,49,48,-100},
-{-101,47,46,22}, {21,45,35,25}, {33,34,44,41}, {13,14,28,24},
-{-107,26,30,-106}, {14,46,45,15}, {14,44,43,-110}, {-111,42,23,-110},
-{6,7,45,46}, {45,44,47,46}, {45,46,47,48}, {47,46,49,48},
-{17,49,47,48}, {17,36,46,48}, {35,36,44,45}, {35,36,40,43},
-{35,36,38,39}, {-4,-3,37,35}, {-123,34,33,1}, {-9,-8,-7,-6},
-{-10,-7,32,-125}, {-127,-11,-126,-126}, {-7,-6,5,31}, {4,5,33,30},
-{4,39,33,32}, {4,35,32,38}, {20,21,39,38}, {4,37,38,5},
-{-11,-10,36,3}, {-11,15,14,35}, {13,16,34,34}, {-13,14,13,13},
-{-3,1,30,29}, {-3,28,29,1}, {-2,31,28,-1}, {12,13,27,30},
-{-2,26,12,12}, {35,29,42,36}, {34,35,36,33}, {32,35,36,31},
-{30,35,36,29}, {28,35,36,27}, {26,35,36,25}, {34,39,38,35},
-{32,39,38,33}, {30,39,38,31}, {28,39,38,29}, {26,39,38,27},
-{25,31,32,38}, {-18,-17,45,44}, {-18,17,28,44}, {-24,-20,42,-23},
-{11,35,27,14}, {25,28,39,41}, {37,41,40,38}, {34,40,36,35},
-{32,40,39,33}, {30,39,31,40}, {21,29,39,22}, {-31,37,28,4},
-{-32,33,35,36}, {32,33,34,34}, {18,35,36,48}, {34,25,40,35},
-{24,25,38,39}, {24,25,36,37}, {24,25,34,35}, {24,25,32,33},
-{24,13,41,31}, {17,11,41,35}, {15,16,34,35}, {13,14,34,35},
-{11,12,34,35}, {9,10,34,35}, {7,8,34,35}, {26,25,37,36},
-{35,36,37,38}, {37,36,39,38}, {37,38,39,40}, {25,31,36,39},
-{18,34,35,30}, {17,22,30,33}, {19,29,21,20}, {16,26,29,17},
-{24,29,28,25}, {22,31,28,23}, {20,31,30,21}, {18,31,30,19},
-{16,30,17,17}, {-21,-22,35,34}, {-21,-22,33,32}, {-21,-22,31,30},
-{-21,-22,29,28}, {-21,-22,27,26}, {-28,-22,25,31}, {24,28,29,30},
-{23,24,26,27}, {23,24,25,25}, {-69,-35,-32,27}, {-70,26,25,-66},
-{-68,-67,24,-33},
-};
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
deleted file mode 100644
index 0d7a720dd1e..00000000000
--- a/source/blender/src/drawaction.c
+++ /dev/null
@@ -1,1882 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- * Drawing routines for the Action window type
- */
-
-/* System includes ----------------------------------------------------- */
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-/* Types --------------------------------------------------------------- */
-#include "DNA_listBase.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_gpencil_types.h"
-
-#include "BKE_action.h"
-#include "BKE_depsgraph.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_object.h"
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-/* Everything from source (BIF, BDR, BSE) ------------------------------ */
-
-#include "BIF_editaction.h"
-#include "BIF_editkey.h"
-#include "BIF_editnla.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_drawgpencil.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_keyframing.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-
-#include "BDR_drawaction.h"
-#include "BDR_editcurve.h"
-#include "BDR_gpencil.h"
-
-#include "BSE_drawnla.h"
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-#include "BSE_editaction_types.h"
-#include "BSE_editipo.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-/* 'old' stuff": defines and types, and own include -------------------- */
-
-#include "blendef.h"
-#include "interface.h"
-#include "mydevice.h"
-
-/********************************** Slider Stuff **************************** */
-
-/* sliders for shapekeys */
-static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
-{
- int i;
- char str[64];
- float x, y;
- uiBlock *block;
- uiBut *but;
-
-#define XIC 20
-#define YIC 20
-
- /* lets make the rvk sliders */
-
- /* reset the damn myortho2 or the sliders won't draw/redraw
- * correctly *grumble*
- */
- mywinset(curarea->win);
- myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- sprintf(str, "actionbuttonswin %d", curarea->win);
- block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS, UI_HELV, curarea->win);
-
- x = NAMEWIDTH + 1;
- y = 0.0f;
-
- /* make the little 'open the sliders' widget */
- // should eventually be removed
- BIF_ThemeColor(TH_FACE); // this slot was open... (???... Aligorith)
- glRects(2, (short)y + 2*CHANNELHEIGHT - 2, ACTWIDTH - 2, (short)y + CHANNELHEIGHT + 2);
- glColor3ub(0, 0, 0);
- glRasterPos2f(4, y + CHANNELHEIGHT + 6);
- BMF_DrawString(G.font, "Sliders");
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- if (!(G.saction->flag & SACTION_SLIDERS)) {
- ACTWIDTH = NAMEWIDTH;
- but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
- ICON_DISCLOSURE_TRI_RIGHT,
- NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
- XIC,YIC-2,
- &(G.saction->flag), 0, 0, 0, 0,
- "Show action window sliders");
- /* no hilite, the winmatrix is not correct later on... */
- uiButSetFlag(but, UI_NO_HILITE);
-
- }
- else {
- but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR,
- ICON_DISCLOSURE_TRI_DOWN,
- NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT,
- XIC,YIC-2,
- &(G.saction->flag), 0, 0, 0, 0,
- "Hide action window sliders");
- /* no hilite, the winmatrix is not correct later on... */
- uiButSetFlag(but, UI_NO_HILITE);
-
- ACTWIDTH = NAMEWIDTH + SLIDERWIDTH;
-
- /* sliders are open so draw them */
- BIF_ThemeColor(TH_FACE);
-
- glRects(NAMEWIDTH, 0, NAMEWIDTH+SLIDERWIDTH, curarea->winy);
- uiBlockSetEmboss(block, UI_EMBOSS);
- for (i=1; i < key->totkey; i++) {
- make_rvk_slider(block, ob, i,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys");
-
- y-=CHANNELHEIGHT+CHANNELSKIP;
-
- /* see sliderval array in editkey.c */
- if (i >= 255) break;
- }
- }
- uiDrawBlock(block);
-}
-
-static void icu_slider_func(void *voidicu, void *voidignore)
-{
- /* the callback for the icu sliders ... copies the
- * value from the icu->curval into a bezier at the
- * right frame on the right ipo curve (creating both the
- * ipo curve and the bezier if needed).
- */
- IpoCurve *icu= voidicu;
- BezTriple *bezt=NULL;
- float cfra, icuval;
-
- cfra = frame_to_float(CFRA);
- if (G.saction->pin==0 && OBACT)
- cfra= get_action_frame(OBACT, cfra);
-
- /* if the ipocurve exists, try to get a bezier
- * for this frame
- */
- bezt = get_bezt_icu_time(icu, &cfra, &icuval);
-
- /* create the bezier triple if one doesn't exist,
- * otherwise modify it's value
- */
- if (bezt == NULL) {
- insert_vert_icu(icu, cfra, icu->curval, 0);
- }
- else {
- bezt->vec[1][1] = icu->curval;
- }
-
- /* make sure the Ipo's are properly processed and
- * redraw as necessary
- */
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
-
- /* nla-update (in case this affects anything) */
- synchronize_action_strips();
-
- /* do redraw pushes, and also the depsgraph flushes */
- if (OBACT->pose || ob_get_key(OBACT))
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC);
- else
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWBUTSALL, 0);
-}
-
-static void make_icu_slider(uiBlock *block, IpoCurve *icu,
- int x, int y, int w, int h, char *tip)
-{
- /* create a slider for the ipo-curve*/
- uiBut *but;
-
- if(icu == NULL) return;
-
- if (IS_EQ(icu->slide_max, icu->slide_min)) {
- if (IS_EQ(icu->ymax, icu->ymin)) {
- if (ELEM(icu->blocktype, ID_CO, ID_KE)) {
- /* hack for constraints and shapekeys (and maybe a few others) */
- icu->slide_min= 0.0;
- icu->slide_max= 1.0;
- }
- else {
- icu->slide_min= -100;
- icu->slide_max= 100;
- }
- }
- else {
- icu->slide_min= icu->ymin;
- icu->slide_max= icu->ymax;
- }
- }
- if (icu->slide_min >= icu->slide_max) {
- SWAP(float, icu->slide_min, icu->slide_max);
- }
-
- but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "",
- x, y , w, h,
- &(icu->curval), icu->slide_min, icu->slide_max,
- 10, 2, tip);
-
- uiButSetFunc(but, icu_slider_func, icu, NULL);
-
- // no hilite, the winmatrix is not correct later on...
- uiButSetFlag(but, UI_NO_HILITE);
-}
-
-/* sliders for ipo-curves of active action-channel */
-static void action_icu_buts(SpaceAction *saction)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- char str[64];
- float x, y;
- uiBlock *block;
-
- /* lets make the action sliders */
-
- /* reset the damn myortho2 or the sliders won't draw/redraw
- * correctly *grumble*
- */
- mywinset(curarea->win);
- myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- sprintf(str, "actionbuttonswin %d", curarea->win);
- block= uiNewBlock (&curarea->uiblocks, str,
- UI_EMBOSS, UI_HELV, curarea->win);
-
- x = NAMEWIDTH + 1;
- y = 0.0f;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- if (G.saction->flag & SACTION_SLIDERS) {
- /* sliders are open so draw them */
-
- /* get editor data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* build list of channels to draw */
- filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* draw backdrop first */
- BIF_ThemeColor(TH_FACE); // change this color... it's ugly
- glRects(NAMEWIDTH, (short)G.v2d->cur.ymin, NAMEWIDTH+SLIDERWIDTH, (short)G.v2d->cur.ymax);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- for (ale= act_data.first; ale; ale= ale->next) {
- const float yminc= y-CHANNELHEIGHT/2;
- const float ymaxc= y+CHANNELHEIGHT/2;
-
- /* check if visible */
- if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
- IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
- {
- /* determine what needs to be drawn */
- switch (ale->type) {
- case ACTTYPE_CONCHAN: /* constraint channel */
- {
- bActionChannel *achan = (bActionChannel *)ale->owner;
- IpoCurve *icu = (IpoCurve *)ale->key_data;
-
- /* only show if action channel is selected */
- if (SEL_ACHAN(achan)) {
- make_icu_slider(block, icu,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
- "Slider to control current value of Constraint Influence");
- }
- }
- break;
- case ACTTYPE_ICU: /* ipo-curve channel */
- {
- bActionChannel *achan = (bActionChannel *)ale->owner;
- IpoCurve *icu = (IpoCurve *)ale->key_data;
-
- /* only show if action channel is selected */
- if (SEL_ACHAN(achan)) {
- make_icu_slider(block, icu,
- (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2,
- "Slider to control current value of IPO-Curve");
- }
- }
- break;
- case ACTTYPE_SHAPEKEY: /* shapekey channel */
- {
- // TODO...
- }
- break;
- }
- }
-
- /* adjust y-position for next one */
- y-=CHANNELHEIGHT+CHANNELSKIP;
- }
-
- /* free tempolary channels */
- BLI_freelistN(&act_data);
- }
- uiDrawBlock(block);
-}
-
-/********************************** Current Frame **************************** */
-
-void draw_cfra_action (void)
-{
- Object *ob;
- float vec[2];
-
- /* Draw a light green line to indicate current frame */
- vec[0]= (float)(G.scene->r.cfra);
- vec[0]*= G.scene->r.framelen;
-
- vec[1]= G.v2d->cur.ymin;
- BIF_ThemeColor(TH_CFRAME);
- glLineWidth(2.0);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec);
- vec[1]= G.v2d->cur.ymax;
- glVertex2fv(vec);
- glEnd();
-
- /* Draw dark green line if slow-parenting/time-offset is enabled */
- ob= (G.scene->basact) ? (G.scene->basact->object) : 0;
- if ((ob) && (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0)) {
- vec[0]-= give_timeoffset(ob); /* could avoid calling twice */
-
- BIF_ThemeColorShade(TH_CFRAME, -30);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec);
- vec[1]= G.v2d->cur.ymin;
- glVertex2fv(vec);
- glEnd();
- }
-
- glLineWidth(1.0);
-}
-
-/********************************** Left-Hand Panel + Generics **************************** */
-
-/* left hand part */
-static void draw_channel_names(void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- short ofsx = 0, ofsy = 0;
- float x= 0.0f, y= 0.0f;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* Clip to the scrollable area */
- if (curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= curarea->winrct.xmin;
- ofsy= curarea->winrct.ymin;
- glViewport(ofsx, ofsy+G.v2d->mask.ymin, NAMEWIDTH,
- (ofsy+G.v2d->mask.ymax) -
- (ofsy+G.v2d->mask.ymin));
- glScissor(ofsx, ofsy+G.v2d->mask.ymin, NAMEWIDTH,
- (ofsy+G.v2d->mask.ymax) -
- (ofsy+G.v2d->mask.ymin));
- }
- }
-
- /* prepare scaling for LHS panel */
- myortho2(0, NAMEWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- /* set default color back to black */
- glColor3ub(0x00, 0x00, 0x00);
-
- /* build list of channels to draw */
- filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through channels, and set up drawing depending on their type */
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- const float yminc= y-CHANNELHEIGHT/2;
- const float ymaxc= y+CHANNELHEIGHT/2;
-
- /* check if visible */
- if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
- IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
- {
- bActionGroup *grp = NULL;
- short indent= 0, offset= 0, sel= 0, group=0;
- int expand= -1, protect = -1, special= -1, mute = -1;
- char name[64];
-
- /* determine what needs to be drawn */
- switch (ale->type) {
- case ACTTYPE_GROUP: /* action group */
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- group= 2;
- indent= 0;
- special= -1;
-
- /* only show expand if there are any channels */
- if (agrp->channels.first) {
- if (EXPANDED_AGRP(agrp))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
- }
-
- if (EDITABLE_AGRP(agrp))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- sel = SEL_AGRP(agrp);
- sprintf(name, agrp->name);
- }
- break;
- case ACTTYPE_ACHAN: /* action channel */
- {
- bActionChannel *achan= (bActionChannel *)ale->data;
-
- group= (ale->grp) ? 1 : 0;
- grp= ale->grp;
-
- indent = 0;
- special = -1;
-
- if (EXPANDED_ACHAN(achan))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- if (EDITABLE_ACHAN(achan))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- if (achan->ipo) {
- if (achan->ipo->muteipo)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- sel = SEL_ACHAN(achan);
- sprintf(name, achan->name);
- }
- break;
- case ACTTYPE_CONCHAN: /* constraint channel */
- {
- bConstraintChannel *conchan = (bConstraintChannel *)ale->data;
-
- indent = 2;
-
- group= (ale->grp) ? 1 : 0;
- grp= ale->grp;
-
- if (EDITABLE_CONCHAN(conchan))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- if (conchan->ipo) {
- if (conchan->ipo->muteipo)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
- }
-
- sel = SEL_CONCHAN(conchan);
- sprintf(name, conchan->name);
- }
- break;
- case ACTTYPE_ICU: /* ipo-curve channel */
- {
- IpoCurve *icu = (IpoCurve *)ale->data;
-
- indent = 2;
- protect = -1; // for now, until this can be supported by others
-
- group= (ale->grp) ? 1 : 0;
- grp= ale->grp;
-
- if (icu->flag & IPO_MUTE)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- sel = SEL_ICU(icu);
- if (G.saction->pin)
- sprintf(name, getname_ipocurve(icu, NULL));
- else
- sprintf(name, getname_ipocurve(icu, OBACT));
- }
- break;
- case ACTTYPE_SHAPEKEY: /* shapekey channel */
- {
- KeyBlock *kb = (KeyBlock *)ale->data;
-
- indent = 0;
- special = -1;
-
- if (kb->name[0] == '\0')
- sprintf(name, "Key %d", ale->index);
- else
- sprintf(name, kb->name);
- }
- break;
- case ACTTYPE_FILLIPO: /* ipo expand widget */
- {
- bActionChannel *achan = (bActionChannel *)ale->data;
-
- indent = 1;
- special = geticon_ipo_blocktype(achan->ipo->blocktype);
-
- group= (ale->grp) ? 1 : 0;
- grp= ale->grp;
-
- if (FILTER_IPO_ACHAN(achan))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- sel = SEL_ACHAN(achan);
- sprintf(name, "IPO Curves");
- }
- break;
- case ACTTYPE_FILLCON: /* constraint expand widget */
- {
- bActionChannel *achan = (bActionChannel *)ale->data;
-
- indent = 1;
- special = ICON_CONSTRAINT;
-
- group= (ale->grp) ? 1 : 0;
- grp= ale->grp;
-
- if (FILTER_CON_ACHAN(achan))
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
-
- sel = SEL_ACHAN(achan);
- sprintf(name, "Constraint");
- }
- break;
- case ACTTYPE_GPDATABLOCK: /* gpencil datablock */
- {
- bGPdata *gpd = (bGPdata *)ale->data;
- ScrArea *sa = (ScrArea *)ale->owner;
-
- indent = 0;
- group= 3;
-
- /* only show expand if there are any channels */
- if (gpd->layers.first) {
- if (gpd->flag & GP_DATA_EXPAND)
- expand = ICON_TRIA_DOWN;
- else
- expand = ICON_TRIA_RIGHT;
- }
-
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- /* this shouldn't cause any overflow... */
- sprintf(name, "3DView[%02d]:%s", sa->win, view3d_get_name(sa->spacedata.first));
- special= ICON_VIEW3D;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
- char treetype[12];
-
- if (snode->treetype == 1)
- sprintf(treetype, "Composite");
- else
- sprintf(treetype, "Material");
- sprintf(name, "Nodes[%02d]:%s", sa->win, treetype);
-
- special= ICON_NODE;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
- char imgpreview[10];
-
- switch (sseq->mainb) {
- case 1: sprintf(imgpreview, "Image..."); break;
- case 2: sprintf(imgpreview, "Luma..."); break;
- case 3: sprintf(imgpreview, "Chroma..."); break;
- case 4: sprintf(imgpreview, "Histogram"); break;
-
- default: sprintf(imgpreview, "Sequence"); break;
- }
- sprintf(name, "Sequencer[%02d]:%s", sa->win, imgpreview);
-
- special= ICON_SEQUENCE;
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
-
- if (sima->image)
- sprintf(name, "Image[%02d]:%s", sa->win, sima->image->id.name+2);
- else
- sprintf(name, "Image[%02d]:<None>", sa->win);
-
- special= ICON_IMAGE_COL;
- }
- break;
-
- default:
- {
- sprintf(name, "[%02d]<Unknown GP-Data Source>", sa->win);
- special= -1;
- }
- break;
- }
- }
- break;
- case ACTTYPE_GPLAYER: /* gpencil layer */
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
-
- indent = 0;
- special = -1;
- expand = -1;
- group = 1;
-
- if (EDITABLE_GPL(gpl))
- protect = ICON_UNLOCKED;
- else
- protect = ICON_LOCKED;
-
- if (gpl->flag & GP_LAYER_HIDE)
- mute = ICON_MUTE_IPO_ON;
- else
- mute = ICON_MUTE_IPO_OFF;
-
- sel = SEL_GPL(gpl);
- BLI_snprintf(name, 32, gpl->info);
- }
- break;
- }
-
- /* now, start drawing based on this information */
- /* draw backing strip behind channel name */
- if (group == 3) {
- /* only for gp-data channels */
- if (ale->owner == curarea) // fixme... currently useless
- BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10);
- else
- BIF_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x, yminc, (float)NAMEWIDTH, ymaxc, 8);
-
- offset = 0;
- }
- else if (group == 2) {
- /* only for action group channels */
- if (ale->flag & AGRP_ACTIVE)
- BIF_ThemeColorShade(TH_GROUP_ACTIVE, 10);
- else
- BIF_ThemeColorShade(TH_GROUP, 20);
- uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
- gl_round_box(GL_POLYGON, x, yminc, (float)NAMEWIDTH, ymaxc, 8);
-
- offset = 0;
- }
- else {
- /* for normal channels
- * - use 3 shades of color group/standard color for 3 indention level
- * - only use group colors if allowed to, and if actually feasible
- */
- if ( !(G.saction->flag & SACTION_NODRAWGCOLORS) &&
- (grp) && (grp->customCol) )
- {
- char cp[3];
-
- if (indent == 2) {
- VECCOPY(cp, grp->cs.solid);
- }
- else if (indent == 1) {
- VECCOPY(cp, grp->cs.select);
- }
- else {
- VECCOPY(cp, grp->cs.active);
- }
-
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else
- BIF_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
-
- indent += group;
- offset = 7 * indent;
- glRectf(x+offset, yminc, (float)NAMEWIDTH, ymaxc);
- }
-
- /* draw expand/collapse triangle */
- if (expand > 0) {
- BIF_icon_draw(x+offset, yminc, expand);
- offset += 17;
- }
-
- /* draw special icon indicating certain data-types */
- if (special > -1) {
- if (group == 3) {
- /* for gpdatablock channels */
- BIF_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
- else {
- /* for ipo/constraint channels */
- offset = (group) ? 29 : 24;
- BIF_icon_draw(x+offset, yminc, special);
- offset += 17;
- }
- }
-
- /* draw name */
- if (sel)
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
- offset += 3;
- glRasterPos2f(x+offset, y-4);
- BMF_DrawString(G.font, name);
-
- /* reset offset - for RHS of panel */
- offset = 0;
-
- /* draw protect 'lock' */
- if (protect > -1) {
- offset = 16;
- BIF_icon_draw((float)NAMEWIDTH-offset, yminc, protect);
- }
-
- /* draw mute 'eye' */
- if (mute > -1) {
- offset += 16;
- BIF_icon_draw((float)(NAMEWIDTH-offset), yminc, mute);
- }
- }
-
- /* adjust y-position for next one */
- y-=CHANNELHEIGHT+CHANNELSKIP;
- }
-
- /* free tempolary channels */
- BLI_freelistN(&act_data);
-
- /* re-adjust view matrices for correct scaling */
- myortho2(0, NAMEWIDTH, 0, (float)(ofsy+G.v2d->mask.ymax) - (ofsy+G.v2d->mask.ymin)); // Scaling
-}
-
-/* sets or clears hidden flags */
-void check_action_context(SpaceAction *saction)
-{
- bActionChannel *achan;
-
- if (saction->action==NULL) return;
-
- for (achan=saction->action->chanbase.first; achan; achan=achan->next)
- achan->flag &= ~ACHAN_HIDDEN;
-
- if ((saction->pin==0) && ((saction->flag & SACTION_NOHIDE)==0) && (OBACT)) {
- Object *ob= OBACT;
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
-
- for (achan=saction->action->chanbase.first; achan; achan=achan->next) {
- pchan= get_pose_channel(ob->pose, achan->name);
- if (pchan && pchan->bone) {
- if ((pchan->bone->layer & arm->layer)==0)
- achan->flag |= ACHAN_HIDDEN;
- else if (pchan->bone->flag & BONE_HIDDEN_P)
- achan->flag |= ACHAN_HIDDEN;
- }
- }
- }
-}
-
-static void draw_channel_strips(void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- rcti scr_rct;
- gla2DDrawInfo *di;
- float y, sta, end;
- int act_start, act_end, dummy;
- char col1[3], col2[3];
- char col1a[3], col2a[3];
-
- BIF_GetThemeColor3ubv(TH_SHADE2, col2);
- BIF_GetThemeColor3ubv(TH_HILITE, col1);
- BIF_GetThemeColor3ubv(TH_GROUP, col2a);
- BIF_GetThemeColor3ubv(TH_GROUP_ACTIVE, col1a);
-
- /* get editor data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- scr_rct.xmin= G.saction->area->winrct.xmin + G.saction->v2d.mask.xmin;
- scr_rct.ymin= G.saction->area->winrct.ymin + G.saction->v2d.mask.ymin;
- scr_rct.xmax= G.saction->area->winrct.xmin + G.saction->v2d.hor.xmax;
- scr_rct.ymax= G.saction->area->winrct.ymin + G.saction->v2d.mask.ymax;
- di= glaBegin2DDraw(&scr_rct, &G.v2d->cur);
-
- /* if in NLA there's a strip active, map the view */
- if (datatype == ACTCONT_ACTION) {
- if (NLA_ACTION_SCALED)
- map_active_strip(di, OBACT, 0);
-
- /* start and end of action itself */
- calc_action_range(data, &sta, &end, 0);
- gla2DDrawTranslatePt(di, sta, 0.0f, &act_start, &dummy);
- gla2DDrawTranslatePt(di, end, 0.0f, &act_end, &dummy);
-
- if (NLA_ACTION_SCALED)
- map_active_strip(di, OBACT, 1);
- }
-
- /* build list of channels to draw */
- filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* first backdrop strips */
- y = 0.0;
- glEnable(GL_BLEND);
- for (ale= act_data.first; ale; ale= ale->next) {
- int frame1_x, channel_y, sel=0;
-
- /* determine if any need to draw channel */
- if (ale->datatype != ALE_NONE) {
- /* determine if channel is selected */
- switch (ale->type) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp = (bActionGroup *)ale->data;
- sel = SEL_AGRP(agrp);
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan = (bActionChannel *)ale->data;
- sel = SEL_ACHAN(achan);
- }
- break;
- case ACTTYPE_CONCHAN:
- {
- bConstraintChannel *conchan = (bConstraintChannel *)ale->data;
- sel = SEL_CONCHAN(conchan);
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu = (IpoCurve *)ale->data;
- sel = SEL_ICU(icu);
- }
- break;
- case ACTTYPE_GPLAYER:
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
- sel = SEL_GPL(gpl);
- }
- break;
- }
-
- if (datatype == ACTCONT_ACTION) {
- gla2DDrawTranslatePt(di, G.v2d->cur.xmin, y, &frame1_x, &channel_y);
-
- if (ale->datatype == ALE_GROUP) {
- if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
- else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
- }
- else {
- if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
- else glColor4ub(col2[0], col2[1], col2[2], 0x22);
- }
- glRectf((float)frame1_x, (float)channel_y-CHANNELHEIGHT/2, (float)G.v2d->hor.xmax, (float)channel_y+CHANNELHEIGHT/2);
-
- if (ale->datatype == ALE_GROUP) {
- if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
- else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
- }
- else {
- if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
- else glColor4ub(col2[0], col2[1], col2[2], 0x22);
- }
- glRectf((float)act_start, (float)channel_y-CHANNELHEIGHT/2, (float)act_end, (float)channel_y+CHANNELHEIGHT/2);
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
-
- /* all frames that have a frame number less than one
- * get a desaturated orange background
- */
- glColor4ub(col2[0], col2[1], col2[2], 0x22);
- glRectf(0.0f, (float)channel_y-CHANNELHEIGHT/2, (float)frame1_x, (float)channel_y+CHANNELHEIGHT/2);
-
- /* frames one and higher get a saturated orange background */
- glColor4ub(col2[0], col2[1], col2[2], 0x44);
- glRectf((float)frame1_x, (float)channel_y-CHANNELHEIGHT/2, (float)G.v2d->hor.xmax, (float)channel_y+CHANNELHEIGHT/2.0f);
- }
- else if (datatype == ACTCONT_GPENCIL) {
- gla2DDrawTranslatePt(di, G.v2d->cur.xmin, y, &frame1_x, &channel_y);
-
- /* frames less than one get less saturated background */
- if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
- else glColor4ub(col2[0], col2[1], col2[2], 0x22);
- glRectf(0.0f, (float)channel_y-CHANNELHEIGHT/2, (float)frame1_x, (float)channel_y+CHANNELHEIGHT/2);
-
- /* frames one and higher get a saturated background */
- if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44);
- else glColor4ub(col2[0], col2[1], col2[2], 0x44);
- glRectf((float)frame1_x, (float)channel_y-CHANNELHEIGHT/2, (float)G.v2d->hor.xmax, (float)channel_y+CHANNELHEIGHT/2);
- }
- }
-
- /* Increment the step */
- y-=CHANNELHEIGHT+CHANNELSKIP;
- }
- glDisable(GL_BLEND);
-
- if (NLA_ACTION_SCALED)
- map_active_strip(di, OBACT, 0);
-
- /* Draw keyframes
- * 1) Only channels that are visible in the Action Editor get drawn/evaluated.
- * This is to try to optimise this for heavier data sets
- * 2) Keyframes which are out of view horizontally are disregarded
- */
- y = 0.0;
- for (ale= act_data.first; ale; ale= ale->next) {
- const float yminc= y-CHANNELHEIGHT/2;
- const float ymaxc= y+CHANNELHEIGHT/2;
-
- /* check if visible */
- if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
- IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
- {
- switch (ale->datatype) {
- case ALE_GROUP:
- draw_agroup_channel(di, ale->data, y);
- break;
- case ALE_IPO:
- draw_ipo_channel(di, ale->key_data, y);
- break;
- case ALE_ICU:
- draw_icu_channel(di, ale->key_data, y);
- break;
- case ALE_GPFRAME:
- draw_gpl_channel(di, ale->data, y);
- break;
- }
- }
-
- y-=CHANNELHEIGHT+CHANNELSKIP;
- }
-
- /* free tempolary channels used for drawing */
- BLI_freelistN(&act_data);
-
- /* black line marking 'current frame' for Time-Slide transform mode */
- if (G.saction->flag & SACTION_MOVING) {
- int frame1_x, channel_y;
-
- gla2DDrawTranslatePt(di, G.saction->timeslide, 0, &frame1_x, &channel_y);
- cpack(0x0);
-
- glBegin(GL_LINES);
- glVertex2f((float)frame1_x, (float)G.v2d->mask.ymin - 100);
- glVertex2f((float)frame1_x, (float)G.v2d->mask.ymax);
- glEnd();
- }
-
- glaEnd2DDraw(di);
-}
-
-/* ********* action panel *********** */
-
-
-void do_actionbuts(unsigned short event)
-{
- switch(event) {
- /* general */
- case REDRAWVIEW3D:
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_REDR:
- allqueue(REDRAWACTION, 0);
- break;
-
- /* action-groups */
- case B_ACTCUSTCOLORS: /* only when of the color wells is edited */
- {
- bActionGroup *agrp= get_active_actiongroup(G.saction->action);
-
- if (agrp)
- agrp->customCol= -1;
-
- allqueue(REDRAWACTION, 0);
- }
- break;
- case B_ACTCOLSSELECTOR: /* sync color set after using selector */
- {
- bActionGroup *agrp= get_active_actiongroup(G.saction->action);
-
- if (agrp)
- actionbone_group_copycolors(agrp, 1);
-
- allqueue(REDRAWACTION, 0);
- }
- break;
- case B_ACTGRP_SELALL: /* select all grouped channels */
- {
- bAction *act= G.saction->action;
- bActionGroup *agrp= get_active_actiongroup(act);
-
- /* select all in group, then reselect/activate group as the previous operation clears that */
- select_action_group_channels(act, agrp);
- agrp->flag |= (AGRP_ACTIVE|AGRP_SELECTED);
-
- allqueue(REDRAWACTION, 0);
- }
- break;
- case B_ACTGRP_ADDTOSELF: /* add all selected action channels to self */
- action_groups_group(0);
- break;
- case B_ACTGRP_UNGROUP: /* remove channels from active group */
- // FIXME: todo...
- printf("FIXME: remove achans from active Action-Group not implemented yet! \n");
- break;
-
- }
-}
-
-// currently not used...
-static void action_panel_properties(short cntrl) // ACTION_HANDLER_PROPERTIES
-{
- uiBlock *block;
- void *data;
- short datatype;
-
- block= uiNewBlock(&curarea->uiblocks, "action_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(ACTION_HANDLER_PROPERTIES); // for close and esc
-
- /* get datatype */
- data= get_action_context(&datatype);
- //if (data == NULL) return;
-
- if (uiNewPanel(curarea, block, "Active Channel Properties", "Action", 10, 230, 318, 204)==0)
- return;
-
- /* currently, only show data for actions */
- if (datatype == ACTCONT_ACTION) {
- bActionGroup *agrp= get_active_actiongroup(data);
- //bActionChannel *achan= get_hilighted_action_channel(data);
- char *menustr;
-
- /* only for action-groups */
- if (agrp) {
- /* general stuff */
- uiDefBut(block, LABEL, 1, "Action Group:", 10, 180, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, TEX, B_REDR, "Name: ", 10,160,150,20, agrp->name, 0.0, 31.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, AGRP_EXPANDED, B_REDR, "Expanded", 170, 160, 75, 20, &agrp->flag, 0, 0, 0, 0, "Action Group is expanded");
- uiDefButBitI(block, TOG, AGRP_PROTECTED, B_REDR, "Protected", 245, 160, 75, 20, &agrp->flag, 0, 0, 0, 0, "Action Group is protected");
- uiBlockEndAlign(block);
-
- /* color stuff */
- uiDefBut(block, LABEL, 1, "Group Colors:", 10, 107, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- menustr= BIF_ThemeColorSetsPup(1);
- uiDefButI(block, MENU,B_ACTCOLSSELECTOR, menustr, 10,85,150,19, &agrp->customCol, -1, 20, 0.0, 0.0, "Index of set of Custom Colors to shade Group's bones with. 0 = Use Default Color Scheme, -1 = Use Custom Color Scheme");
- MEM_freeN(menustr);
-
- /* show color-selection/preview */
- if (agrp->customCol) {
- /* do color copying/init (to stay up to date) */
- actionbone_group_copycolors(agrp, 1);
-
- /* color changing */
- uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 10, 65, 50, 19, agrp->cs.active, 0, 0, 0, 0, "Color to use for 'top-level' channels");
- uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 60, 65, 50, 19, agrp->cs.select, 0, 0, 0, 0, "Color to use for '2nd-level' channels");
- uiDefButC(block, COL, B_ACTCUSTCOLORS, "", 110, 65, 50, 19, agrp->cs.solid, 0, 0, 0, 0, "Color to use for '3rd-level' channels");
- }
- uiBlockEndAlign(block);
-
- /* commands for active group */
- uiDefBut(block, BUT, B_ACTGRP_SELALL, "Select Grouped", 170,85,150,20, 0, 21, 0, 0, 0, "Select all action-channels belonging to this group (same as doing Ctrl-Shift-LMB)");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_ACTGRP_ADDTOSELF, "Add to Group", 170,60,150,20, 0, 21, 0, 0, 0, "Add selected action-channels to this group");
- uiDefBut(block, BUT, B_ACTGRP_UNGROUP, "Un-Group", 170,40,150,20, 0, 21, 0, 0, 0, "Remove selected action-channels from this group (unimplemented)");
- uiBlockEndAlign(block);
- }
- }
- else {
- /* Currently, there isn't anything to display for these types ... */
- }
-}
-
-static void action_blockhandlers(ScrArea *sa)
-{
- SpaceAction *sact= sa->spacedata.first;
- short a;
-
- for (a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(sact->blockhandler[a]) {
- case ACTION_HANDLER_PROPERTIES:
- action_panel_properties(sact->blockhandler[a+1]);
- break;
- }
-
- /* clear action value for event */
- sact->blockhandler[a+1]= 0;
- }
-
- uiDrawBlocksPanels(sa, 0);
-}
-
-/* ************************* Action Editor Space ***************************** */
-
-void drawactionspace(ScrArea *sa, void *spacedata)
-{
- bAction *act = NULL;
- Key *key = NULL;
- void *data;
- short datatype;
-
- short ofsx = 0, ofsy = 0;
- float col[3];
-
- /* this is unlikely to occur, but it may */
- if (G.saction == NULL)
- return;
-
- /* warning: blocks need to be freed each time, handlers dont remove */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- /* only try to refresh action that's displayed if not pinned */
- if (G.saction->pin==0) {
- /* depends on mode */
- switch (G.saction->mode) {
- case SACTCONT_ACTION:
- {
- if (OBACT)
- G.saction->action = OBACT->action;
- else
- G.saction->action= NULL;
- }
- break;
- }
- }
-
- /* get data */
- data = get_action_context(&datatype);
- switch (datatype) {
- case ACTCONT_ACTION:
- act = data;
- break;
- case ACTCONT_SHAPEKEY:
- key = data;
- break;
- case ACTCONT_GPENCIL:
- /* currently, 'data' value for grease-pencil is G.curscreen! */
- break;
- }
-
- /* Lets make sure the width of the left hand of the screen
- * is set to an appropriate value based on whether sliders
- * are showing of not
- */
- if ((data) && (G.saction->flag & SACTION_SLIDERS))
- ACTWIDTH = NAMEWIDTH + SLIDERWIDTH;
- else
- ACTWIDTH = NAMEWIDTH;
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
-
- /* background color for entire window (used in lefthand part though) */
- BIF_GetThemeColor3fv(TH_HEADER, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- if (curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= curarea->winrct.xmin;
- ofsy= curarea->winrct.ymin;
- glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin,
- ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1,
- ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin,
- ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1,
- ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- }
- }
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- /* Draw backdrop */
- calc_ipogrid();
- draw_ipogrid();
-
- check_action_context(G.saction);
-
- /* Draw channel strips */
- draw_channel_strips();
-
- /* reset matrices for stuff to be drawn on top of keys*/
- glViewport(ofsx+G.v2d->mask.xmin,
- ofsy+G.v2d->mask.ymin,
- ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1,
- ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin,
- ofsy+G.v2d->mask.ymin,
- ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1,
- ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- /* Draw current frame */
- draw_cfra_action();
-
- /* Draw markers (local behind scene ones, as local obscure scene markers) */
- if (act)
- draw_markers_timespace(&act->markers, DRAW_MARKERS_LOCAL);
- draw_markers_timespace(SCE_MARKERS, 0);
-
- /* Draw 'curtains' for preview */
- draw_anim_preview_timespace();
-
- /* Draw scroll */
- mywinset(curarea->win); // reset scissor too
- if (curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- myortho2(-0.375f, curarea->winx-0.375f, -0.375f, curarea->winy-0.375f);
- if (G.v2d->scroll) drawscroll(0);
- }
-
- /* Draw Left-Hand Panel if enough space in window */
- if (G.v2d->mask.xmin!=0) {
- /* Draw channel names */
- draw_channel_names();
-
- if(sa->winx > 50 + NAMEWIDTH + SLIDERWIDTH) {
- if (act) {
- /* if there is an action, draw sliders for its
- * ipo-curve channels in the action window
- */
- action_icu_buts(G.saction);
- }
- else if (key) {
- /* if there is a mesh with rvk's selected,
- * then draw the key frames in the action window
- */
- meshactionbuts(G.saction, OBACT, key);
- }
- }
- }
-
- mywinset(curarea->win); // reset scissor too
- myortho2(-0.375f, curarea->winx-0.375f, -0.375f, curarea->winy-0.375f);
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, G.saction->blockscale, G.saction->blockscale, G.saction->blockscale);
- action_blockhandlers(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-}
-
-/* *************************** Keyframe Drawing *************************** */
-
-static void add_bezt_to_keycolumnslist(ListBase *keys, BezTriple *bezt)
-{
- /* The equivilant of add_to_cfra_elem except this version
- * makes ActKeyColumns - one of the two datatypes required
- * for action editor drawing.
- */
- ActKeyColumn *ak, *akn;
-
- if (ELEM(NULL, keys, bezt)) return;
-
- /* try to any existing key to replace, or where to insert after */
- for (ak= keys->last; ak; ak= ak->prev) {
- /* do because of double keys */
- if (ak->cfra == bezt->vec[1][0]) {
- /* set selection status and 'touched' status */
- if (BEZSELECTED(bezt)) ak->sel = SELECT;
- ak->modified += 1;
-
- return;
- }
- else if (ak->cfra < bezt->vec[1][0]) break;
- }
-
- /* add new block */
- akn= MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumn");
- if (ak) BLI_insertlinkafter(keys, ak, akn);
- else BLI_addtail(keys, akn);
-
- akn->cfra= bezt->vec[1][0];
- akn->modified += 1;
-
- // TODO: handle type = bezt->h1 or bezt->h2
- akn->handle_type= 0;
-
- if (BEZSELECTED(bezt))
- akn->sel = SELECT;
- else
- akn->sel = 0;
-}
-
-static void add_bezt_to_keyblockslist(ListBase *blocks, IpoCurve *icu, int index)
-{
- /* The equivilant of add_to_cfra_elem except this version
- * makes ActKeyBlocks - one of the two datatypes required
- * for action editor drawing.
- */
- ActKeyBlock *ab, *abn;
- BezTriple *beztn=NULL, *prev=NULL;
- BezTriple *bezt;
- int v;
-
- /* get beztriples */
- beztn= (icu->bezt + index);
-
- /* we need to go through all beztriples, as they may not be in order (i.e. during transform) */
- for (v=0, bezt=icu->bezt; v<icu->totvert; v++, bezt++) {
- /* skip if beztriple is current */
- if (v != index) {
- /* check if beztriple is immediately before */
- if (beztn->vec[1][0] > bezt->vec[1][0]) {
- /* check if closer than previous was */
- if (prev) {
- if (prev->vec[1][0] < bezt->vec[1][0])
- prev= bezt;
- }
- else {
- prev= bezt;
- }
- }
- }
- }
-
- /* check if block needed - same value(s)?
- * -> firstly, handles must have same central value as each other
- * -> secondly, handles which control that section of the curve must be constant
- */
- if ((!prev) || (!beztn)) return;
- if (IS_EQ(beztn->vec[1][1], prev->vec[1][1])==0) return;
- if (IS_EQ(beztn->vec[1][1], beztn->vec[0][1])==0) return;
- if (IS_EQ(prev->vec[1][1], prev->vec[2][1])==0) return;
-
- /* try to find a keyblock that starts on the previous beztriple
- * Note: we can't search from end to try to optimise this as it causes errors there's
- * an A ___ B |---| B situation
- */
- // FIXME: here there is a bug where we are trying to get the summary for the following channels
- // A|--------------|A ______________ B|--------------|B
- // A|------------------------------------------------|A
- // A|----|A|---|A|-----------------------------------|A
- for (ab= blocks->first; ab; ab= ab->next) {
- /* check if alter existing block or add new block */
- if (ab->start == prev->vec[1][0]) {
- /* set selection status and 'touched' status */
- if (BEZSELECTED(beztn)) ab->sel = SELECT;
- ab->modified += 1;
-
- return;
- }
- else if (ab->start < prev->vec[1][0]) break;
- }
-
- /* add new block */
- abn= MEM_callocN(sizeof(ActKeyBlock), "ActKeyBlock");
- if (ab) BLI_insertlinkbefore(blocks, ab, abn);
- else BLI_addtail(blocks, abn);
-
- abn->start= prev->vec[1][0];
- abn->end= beztn->vec[1][0];
- abn->val= beztn->vec[1][1];
-
- if (BEZSELECTED(prev) || BEZSELECTED(beztn))
- abn->sel = SELECT;
- else
- abn->sel = 0;
- abn->modified = 1;
-}
-
-/* helper function - find actkeycolumn that occurs on cframe */
-static ActKeyColumn *cfra_find_actkeycolumn (ListBase *keys, float cframe)
-{
- ActKeyColumn *ak, *ak2;
-
- if (keys==NULL)
- return NULL;
-
- /* search from both ends at the same time, and stop if we find match or if both ends meet */
- for (ak=keys->first, ak2=keys->last; ak && ak2; ak=ak->next, ak2=ak2->prev) {
- /* return whichever end encounters the frame */
- if (ak->cfra == cframe)
- return ak;
- if (ak2->cfra == cframe)
- return ak2;
-
- /* no matches on either end, so return NULL */
- if (ak == ak2)
- return NULL;
- }
-
- return NULL;
-}
-
-#if 0 // disabled, as some intel cards have problems with this
-/* Draw a simple diamond shape with a filled in center (in screen space) */
-static void draw_key_but(int x, int y, short w, short h, int sel)
-{
- int xmin= x, ymin= y;
- int xmax= x+w-1, ymax= y+h-1;
- int xc= (xmin+xmax)/2, yc= (ymin+ymax)/2;
-
- /* interior - hardcoded colors (for selected and unselected only) */
- if (sel) glColor3ub(0xF1, 0xCA, 0x13);
- else glColor3ub(0xE9, 0xE9, 0xE9);
-
- glBegin(GL_QUADS);
- glVertex2i(xc, ymin);
- glVertex2i(xmax, yc);
- glVertex2i(xc, ymax);
- glVertex2i(xmin, yc);
- glEnd();
-
-
- /* outline */
- glColor3ub(0, 0, 0);
-
- glBegin(GL_LINE_LOOP);
- glVertex2i(xc, ymin);
- glVertex2i(xmax, yc);
- glVertex2i(xc, ymax);
- glVertex2i(xmin, yc);
- glEnd();
-}
-#endif
-
-static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, float ypos)
-{
- ActKeyColumn *ak;
- ActKeyBlock *ab;
-
- glEnable(GL_BLEND);
-
- /* draw keyblocks */
- if (blocks) {
- for (ab= blocks->first; ab; ab= ab->next) {
- short startCurves, endCurves, totCurves;
-
- /* find out how many curves occur at each keyframe */
- ak= cfra_find_actkeycolumn(keys, ab->start);
- startCurves = (ak)? ak->totcurve: 0;
-
- ak= cfra_find_actkeycolumn(keys, ab->end);
- endCurves = (ak)? ak->totcurve: 0;
-
- /* only draw keyblock if it appears in at all of the keyframes at lowest end */
- if (!startCurves && !endCurves)
- continue;
- else
- totCurves = (startCurves>endCurves)? endCurves: startCurves;
-
- if (ab->totcurve >= totCurves) {
- int sc_xa, sc_ya;
- int sc_xb, sc_yb;
-
- /* get co-ordinates of block */
- gla2DDrawTranslatePt(di, ab->start, ypos, &sc_xa, &sc_ya);
- gla2DDrawTranslatePt(di, ab->end, ypos, &sc_xb, &sc_yb);
-
- /* draw block */
- if (ab->sel)
- BIF_ThemeColor4(TH_STRIP_SELECT);
- else
- BIF_ThemeColor4(TH_STRIP);
- glRectf((float)sc_xa, (float)sc_ya-3, (float)sc_xb, (float)sc_yb+5);
- }
- }
- }
-
- /* draw keys */
- if (keys) {
- for (ak= keys->first; ak; ak= ak->next) {
- int sc_x, sc_y;
-
- /* get co-ordinate to draw at */
- gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y);
-
- /* draw using icons - old way which is slower but more proven */
- if (ak->sel & SELECT) BIF_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE2, 1.0f);
- else BIF_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE3, 1.0f);
-
- /* draw using OpenGL - slightly uglier but faster */
- // NOTE: disabled for now, as some intel cards seem to have problems with this
- //draw_key_but(sc_x-5, sc_y-4, 11, 11, (ak->sel & SELECT));
- }
- }
-
- glDisable(GL_BLEND);
-}
-
-
-static ActKeysInc *init_aki_data()
-{
- static ActKeysInc aki;
-
- /* init data of static struct here */
- if ((curarea->spacetype == SPACE_ACTION) && NLA_ACTION_SCALED &&
- (G.saction->mode == SACTCONT_ACTION))
- {
- aki.ob= OBACT;
- }
- else if (curarea->spacetype == SPACE_NLA)
- {
- aki.ob= NULL; // FIXME
- }
- else
- aki.ob= NULL;
-
- aki.start= G.v2d->cur.xmin - 10;
- aki.end= G.v2d->cur.xmax + 10;
-
- /* only pass pointer for Action Editor if enabled (for now) */
- if ((curarea->spacetype == SPACE_ACTION) && (G.saction->flag & SACTION_HORIZOPTIMISEON))
- return &aki;
- else
- return NULL;
-}
-
-void draw_object_channel(gla2DDrawInfo *di, Object *ob, float ypos)
-{
- ListBase keys = {0, 0};
- ListBase blocks = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- ob_to_keylist(ob, &keys, &blocks, aki);
- draw_keylist(di, &keys, &blocks, ypos);
-
- BLI_freelistN(&keys);
- BLI_freelistN(&blocks);
-}
-
-void draw_ipo_channel(gla2DDrawInfo *di, Ipo *ipo, float ypos)
-{
- ListBase keys = {0, 0};
- ListBase blocks = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- ipo_to_keylist(ipo, &keys, &blocks, aki);
- draw_keylist(di, &keys, &blocks, ypos);
-
- BLI_freelistN(&keys);
- BLI_freelistN(&blocks);
-}
-
-void draw_icu_channel(gla2DDrawInfo *di, IpoCurve *icu, float ypos)
-{
- ListBase keys = {0, 0};
- ListBase blocks = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- icu_to_keylist(icu, &keys, &blocks, aki);
- draw_keylist(di, &keys, &blocks, ypos);
-
- BLI_freelistN(&keys);
- BLI_freelistN(&blocks);
-}
-
-void draw_agroup_channel(gla2DDrawInfo *di, bActionGroup *agrp, float ypos)
-{
- ListBase keys = {0, 0};
- ListBase blocks = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- agroup_to_keylist(agrp, &keys, &blocks, aki);
- draw_keylist(di, &keys, &blocks, ypos);
- BLI_freelistN(&keys);
- BLI_freelistN(&blocks);
-}
-
-void draw_action_channel(gla2DDrawInfo *di, bAction *act, float ypos)
-{
- ListBase keys = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- action_to_keylist(act, &keys, NULL, aki);
- draw_keylist(di, &keys, NULL, ypos);
- BLI_freelistN(&keys);
-}
-
-void draw_gpl_channel(gla2DDrawInfo *di, bGPDlayer *gpl, float ypos)
-{
- ListBase keys = {0, 0};
- ActKeysInc *aki = init_aki_data();
-
- gpl_to_keylist(gpl, &keys, NULL, aki);
- draw_keylist(di, &keys, NULL, ypos);
- BLI_freelistN(&keys);
-}
-
-/* --------------- Conversion: data -> keyframe list ------------------ */
-
-void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- bConstraintChannel *conchan;
-
- if (ob) {
- /* Add object keyframes */
- if (ob->ipo)
- ipo_to_keylist(ob->ipo, keys, blocks, aki);
-
- /* Add constraint keyframes */
- for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next) {
- if (conchan->ipo)
- ipo_to_keylist(conchan->ipo, keys, blocks, aki);
- }
-
- /* Add object data keyframes */
- // TODO??
- }
-}
-
-static short bezt_in_aki_range (ActKeysInc *aki, BezTriple *bezt)
-{
- /* when aki == NULL, we don't care about range */
- if (aki == NULL)
- return 1;
-
- /* if nla-scaling is in effect, apply appropriate scaling adjustments */
- if (aki->ob) {
- float frame= get_action_frame_inv(aki->ob, bezt->vec[1][0]);
- return IN_RANGE(frame, aki->start, aki->end);
- }
- else {
- /* check if in range */
- return IN_RANGE(bezt->vec[1][0], aki->start, aki->end);
- }
-}
-
-void icu_to_keylist(IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- BezTriple *bezt;
- ActKeyColumn *ak, *ak2;
- ActKeyBlock *ab, *ab2;
- int v;
-
- if (icu && icu->totvert) {
- /* loop through beztriples, making ActKeys and ActKeyBlocks */
- bezt= icu->bezt;
-
- for (v=0; v<icu->totvert; v++, bezt++) {
- /* only if keyframe is in range (optimisation) */
- if (bezt_in_aki_range(aki, bezt)) {
- add_bezt_to_keycolumnslist(keys, bezt);
- if (blocks) add_bezt_to_keyblockslist(blocks, icu, v);
- }
- }
-
- /* update the number of curves that elements have appeared in */
- if (keys) {
- for (ak=keys->first, ak2=keys->last; ak && ak2; ak=ak->next, ak2=ak2->prev) {
- if (ak->modified) {
- ak->modified = 0;
- ak->totcurve += 1;
- }
-
- if (ak == ak2)
- break;
-
- if (ak2->modified) {
- ak2->modified = 0;
- ak2->totcurve += 1;
- }
- }
- }
- if (blocks) {
- for (ab=blocks->first, ab2=blocks->last; ab && ab2; ab=ab->next, ab2=ab2->prev) {
- if (ab->modified) {
- ab->modified = 0;
- ab->totcurve += 1;
- }
-
- if (ab == ab2)
- break;
-
- if (ab2->modified) {
- ab2->modified = 0;
- ab2->totcurve += 1;
- }
- }
- }
- }
-}
-
-void ipo_to_keylist(Ipo *ipo, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- IpoCurve *icu;
-
- if (ipo) {
- for (icu= ipo->curve.first; icu; icu= icu->next)
- icu_to_keylist(icu, keys, blocks, aki);
- }
-}
-
-void agroup_to_keylist(bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- if (agrp) {
- /* loop through action channels */
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- if (VISIBLE_ACHAN(achan)) {
- /* firstly, add keys from action channel's ipo block */
- if (achan->ipo)
- ipo_to_keylist(achan->ipo, keys, blocks, aki);
-
- /* then, add keys from constraint channels */
- for (conchan= achan->constraintChannels.first; conchan; conchan= conchan->next) {
- if (conchan->ipo)
- ipo_to_keylist(conchan->ipo, keys, blocks, aki);
- }
- }
- }
- }
-}
-
-void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- if (act) {
- /* loop through action channels */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- /* firstly, add keys from action channel's ipo block */
- if (achan->ipo)
- ipo_to_keylist(achan->ipo, keys, blocks, aki);
-
- /* then, add keys from constraint channels */
- for (conchan= achan->constraintChannels.first; conchan; conchan= conchan->next) {
- if (conchan->ipo)
- ipo_to_keylist(conchan->ipo, keys, blocks, aki);
- }
- }
- }
-}
-
-void gpl_to_keylist(bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki)
-{
- bGPDframe *gpf;
- ActKeyColumn *ak;
-
- if (gpl && keys) {
- /* loop over frames, converting directly to 'keyframes' (should be in order too) */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- ak= MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumn");
- BLI_addtail(keys, ak);
-
- ak->cfra= (float)gpf->framenum;
- ak->modified = 1;
- ak->handle_type= 0;
-
- if (gpf->flag & GP_FRAME_SELECT)
- ak->sel = SELECT;
- else
- ak->sel = 0;
- }
- }
-}
-
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c
deleted file mode 100644
index 2d41e01f7e4..00000000000
--- a/source/blender/src/drawarmature.c
+++ /dev/null
@@ -1,2576 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 by the Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_object.h"
-#include "BKE_ipo.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_poseobject.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-
-#include "BDR_editobject.h"
-#include "BDR_drawobject.h"
-#include "BDR_drawaction.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "nla.h"
-
-
-/* *************** Armature Drawing - Coloring API ***************************** */
-
-/* global here is reset before drawing each bone */
-static ThemeWireColor *bcolor= NULL;
-
-/* values of colCode for set_pchan_glcolor */
-enum {
- PCHAN_COLOR_NORMAL = 0, /* normal drawing */
- PCHAN_COLOR_SOLID, /* specific case where "solid" color is needed */
- PCHAN_COLOR_CONSTS, /* "constraint" colors (which may/may-not be suppressed) */
-
- PCHAN_COLOR_SPHEREBONE_BASE, /* for the 'stick' of sphere (envelope) bones */
- PCHAN_COLOR_SPHEREBONE_END, /* for the ends of sphere (envelope) bones */
- PCHAN_COLOR_LINEBONE /* for the middle of line-bones */
-};
-
-/* This function sets the color-set for coloring a certain bone */
-static void set_pchan_colorset (Object *ob, bPoseChannel *pchan)
-{
- bPose *pose= (ob) ? ob->pose : NULL;
- bArmature *arm= (ob) ? ob->data : NULL;
- bActionGroup *grp= NULL;
- short color_index= 0;
-
- /* sanity check */
- if (ELEM4(NULL, ob, arm, pose, pchan)) {
- bcolor= NULL;
- return;
- }
-
- /* only try to set custom color if enabled for armature */
- if (arm->flag & ARM_COL_CUSTOM) {
- /* currently, a bone can only use a custom color set if it's group (if it has one),
- * has been set to use one
- */
- if (pchan->agrp_index) {
- grp= (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
- if (grp)
- color_index= grp->customCol;
- }
- }
-
- /* bcolor is a pointer to the color set to use. If NULL, then the default
- * color set (based on the theme colors for 3d-view) is used.
- */
- if (color_index > 0) {
- bTheme *btheme= U.themes.first;
- bcolor= &btheme->tarm[(color_index - 1)];
- }
- else if (color_index == -1) {
- /* use the group's own custom color set */
- bcolor= (grp)? &grp->cs : NULL;
- }
- else
- bcolor= NULL;
-}
-
-/* This function is for brightening/darkening a given color (like BIF_ThemeColorShade()) */
-static void cp_shade_color3ub (char cp[], int offset)
-{
- int r, g, b;
-
- r= offset + (int) cp[0];
- CLAMP(r, 0, 255);
- g= offset + (int) cp[1];
- CLAMP(g, 0, 255);
- b= offset + (int) cp[2];
- CLAMP(b, 0, 255);
-
- cp[0]= r;
- cp[1]= g;
- cp[2]= b;
-}
-
-/* This function sets the gl-color for coloring a certain bone (based on bcolor) */
-static short set_pchan_glColor (short colCode, int armflag, int boneflag, int constflag)
-{
- switch (colCode) {
- case PCHAN_COLOR_NORMAL:
- {
- if (bcolor) {
- char cp[3];
-
- if (boneflag & BONE_ACTIVE) {
- VECCOPY(cp, bcolor->active);
- }
- else if (boneflag & BONE_SELECTED) {
- VECCOPY(cp, bcolor->select);
- }
- else {
- /* a bit darker than solid */
- VECCOPY(cp, bcolor->solid);
- cp_shade_color3ub(cp, -50);
- }
-
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else {
- if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40);
- else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE);
- else BIF_ThemeColor(TH_WIRE);
- }
-
- return 1;
- }
- break;
-
- case PCHAN_COLOR_SOLID:
- {
- if (bcolor) {
- char *cp= bcolor->solid;
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else
- BIF_ThemeColor(TH_BONE_SOLID);
-
- return 1;
- }
- break;
-
- case PCHAN_COLOR_CONSTS:
- {
- if ( (bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS) ) {
- if (constflag & PCHAN_HAS_STRIDE) glColor4ub(0, 0, 200, 80);
- else if (constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80);
- else if (constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
- else if (constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80);
- else if (constflag) BIF_ThemeColor4(TH_BONE_POSE); // PCHAN_HAS_ACTION
-
- return 1;
- }
- else
- return 0;
- }
- break;
-
- case PCHAN_COLOR_SPHEREBONE_BASE:
- {
- if (bcolor) {
- char cp[3];
-
- if (boneflag & BONE_ACTIVE) {
- VECCOPY(cp, bcolor->active);
- }
- else if (boneflag & BONE_SELECTED) {
- VECCOPY(cp, bcolor->select);
- }
- else {
- VECCOPY(cp, bcolor->solid);
- }
-
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else {
- if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40);
- else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE);
- else BIF_ThemeColor(TH_BONE_SOLID);
- }
-
- return 1;
- }
- break;
- case PCHAN_COLOR_SPHEREBONE_END:
- {
- if (bcolor) {
- char cp[3];
-
- if (boneflag & BONE_ACTIVE) {
- VECCOPY(cp, bcolor->active);
- cp_shade_color3ub(cp, 10);
- }
- else if (boneflag & BONE_SELECTED) {
- VECCOPY(cp, bcolor->select);
- cp_shade_color3ub(cp, -30);
- }
- else {
- VECCOPY(cp, bcolor->solid);
- cp_shade_color3ub(cp, -30);
- }
-
- glColor3ub(cp[0], cp[1], cp[2]);
- }
- else {
- if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 10);
- else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_BONE_POSE, -30);
- else BIF_ThemeColorShade(TH_BONE_SOLID, -30);
- }
- }
- break;
-
- case PCHAN_COLOR_LINEBONE:
- {
- /* inner part in background color or constraint */
- if ( (constflag) && ((bcolor==NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) ) {
- if (constflag & PCHAN_HAS_STRIDE) glColor3ub(0, 0, 200);
- else if (constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0);
- else if (constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0);
- else if (constflag & PCHAN_HAS_CONST) glColor3ub(0, 255, 120);
- else if (constflag) BIF_ThemeColor(TH_BONE_POSE); /* PCHAN_HAS_ACTION */
- }
- else {
- if (bcolor) {
- char *cp= bcolor->solid;
- glColor4ub(cp[0], cp[1], cp[2], 0.8);
- }
- else
- BIF_ThemeColorShade(TH_BACK, -30);
- }
-
- return 1;
- }
- break;
- }
-
- return 0;
-}
-
-
-/* *************** Armature drawing, helper calls for parts ******************* */
-
-/* half the cube, in Y */
-static float cube[8][3] = {
-{-1.0, 0.0, -1.0},
-{-1.0, 0.0, 1.0},
-{-1.0, 1.0, 1.0},
-{-1.0, 1.0, -1.0},
-{ 1.0, 0.0, -1.0},
-{ 1.0, 0.0, 1.0},
-{ 1.0, 1.0, 1.0},
-{ 1.0, 1.0, -1.0},
-};
-
-static void drawsolidcube_size(float xsize, float ysize, float zsize)
-{
- static GLuint displist=0;
- float n[3];
-
- glScalef(xsize, ysize, zsize);
-
- n[0]=0; n[1]=0; n[2]=0;
-
- if(displist==0) {
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- glBegin(GL_QUADS);
- n[0]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- n[0]=0;
- n[1]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]);
- n[1]=0;
- n[0]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]);
- n[0]=0;
- n[1]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- n[1]=0;
- n[2]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]);
- n[2]=0;
- n[2]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]);
- glEnd();
-
- glEndList();
- }
- else glCallList(displist);
-
-}
-
-static void drawcube_size(float xsize, float ysize, float zsize)
-{
- static GLuint displist=0;
-
- glScalef(xsize, ysize, zsize);
-
- if(displist == 0) {
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]);
- glEnd();
-
- glBegin(GL_LINES);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]);
- glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- glVertex3fv(cube[3]); glVertex3fv(cube[7]);
- glEnd();
-
- glEndList();
- }
- else glCallList(displist);
-
-}
-
-
-static void draw_bonevert(void)
-{
- static GLuint displist=0;
-
- if (displist == 0) {
- GLUquadricObj *qobj;
-
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- glPushMatrix();
-
- qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
- gluDisk(qobj, 0.0, 0.05, 16, 1);
-
- glRotatef(90, 0, 1, 0);
- gluDisk(qobj, 0.0, 0.05, 16, 1);
-
- glRotatef(90, 1, 0, 0);
- gluDisk(qobj, 0.0, 0.05, 16, 1);
-
- gluDeleteQuadric(qobj);
-
- glPopMatrix();
- glEndList();
- }
- else
- glCallList(displist);
-}
-
-static void draw_bonevert_solid(void)
-{
- static GLuint displist=0;
-
- if (displist == 0) {
- GLUquadricObj *qobj;
-
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_FILL);
- glShadeModel(GL_SMOOTH);
- gluSphere( qobj, 0.05, 8, 5);
- glShadeModel(GL_FLAT);
- gluDeleteQuadric(qobj);
-
- glEndList();
- }
- else
- glCallList(displist);
-}
-
-static void draw_bone_octahedral()
-{
- static GLuint displist=0;
-
- if (displist == 0) {
- float vec[6][3];
-
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- vec[0][0]= vec[0][1]= vec[0][2]= 0.0;
- vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0;
-
- vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1;
- vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1;
- vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1;
- vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1;
-
- /* Section 1, sides */
- glBegin(GL_LINE_LOOP);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[5]);
- glVertex3fv(vec[3]);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[4]);
- glVertex3fv(vec[5]);
- glVertex3fv(vec[2]);
- glEnd();
-
- /* Section 1, square */
- glBegin(GL_LINE_LOOP);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[2]);
- glVertex3fv(vec[3]);
- glVertex3fv(vec[4]);
- glEnd();
-
- glEndList();
- }
- else
- glCallList(displist);
-}
-
-static void draw_bone_solid_octahedral(void)
-{
- static GLuint displist=0;
-
- if (displist == 0) {
- float vec[6][3], nor[3];
-
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
-
- vec[0][0]= vec[0][1]= vec[0][2]= 0.0;
- vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0;
-
- vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1;
- vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1;
- vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1;
- vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1;
-
-
- glBegin(GL_TRIANGLES);
- /* bottom */
- CalcNormFloat(vec[2], vec[1], vec[0], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[2]);glVertex3fv(vec[1]);glVertex3fv(vec[0]);
-
- CalcNormFloat(vec[3], vec[2], vec[0], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[3]);glVertex3fv(vec[2]);glVertex3fv(vec[0]);
-
- CalcNormFloat(vec[4], vec[3], vec[0], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[4]);glVertex3fv(vec[3]);glVertex3fv(vec[0]);
-
- CalcNormFloat(vec[1], vec[4], vec[0], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[1]);glVertex3fv(vec[4]);glVertex3fv(vec[0]);
-
- /* top */
- CalcNormFloat(vec[5], vec[1], vec[2], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[5]);glVertex3fv(vec[1]);glVertex3fv(vec[2]);
-
- CalcNormFloat(vec[5], vec[2], vec[3], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[5]);glVertex3fv(vec[2]);glVertex3fv(vec[3]);
-
- CalcNormFloat(vec[5], vec[3], vec[4], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[5]);glVertex3fv(vec[3]);glVertex3fv(vec[4]);
-
- CalcNormFloat(vec[5], vec[4], vec[1], nor);
- glNormal3fv(nor);
- glVertex3fv(vec[5]);glVertex3fv(vec[4]);glVertex3fv(vec[1]);
-
- glEnd();
-
- glEndList();
- }
- else
- glCallList(displist);
-}
-
-/* *************** Armature drawing, bones ******************* */
-
-
-static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id)
-{
- /* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if (id != -1)
- glLoadName(id | BONESEL_ROOT);
-
- if(dt <= OB_WIRE) {
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
- }
- else {
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0);
- else
- BIF_ThemeColor(TH_BONE_SOLID);
- }
-
- if (dt > OB_WIRE)
- draw_bonevert_solid();
- else
- draw_bonevert();
- }
-
- /* Draw tip point */
- if (id != -1)
- glLoadName(id | BONESEL_TIP);
-
- if (dt <= OB_WIRE) {
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
- }
- else {
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, 0);
- else
- BIF_ThemeColor(TH_BONE_SOLID);
- }
-
- glTranslatef(0.0, 1.0, 0.0);
- if (dt > OB_WIRE)
- draw_bonevert_solid();
- else
- draw_bonevert();
- glTranslatef(0.0, -1.0, 0.0);
-
-}
-
-/* 16 values of sin function (still same result!) */
-static float si[16] = {
- 0.00000000,
- 0.20129852, 0.39435585,
- 0.57126821, 0.72479278,
- 0.84864425, 0.93775213,
- 0.98846832, 0.99871650,
- 0.96807711, 0.89780453,
- 0.79077573, 0.65137248,
- 0.48530196, 0.29936312,
- 0.10116832
-};
-/* 16 values of cos function (still same result!) */
-static float co[16] ={
- 1.00000000,
- 0.97952994, 0.91895781,
- 0.82076344, 0.68896691,
- 0.52896401, 0.34730525,
- 0.15142777, -0.05064916,
- -0.25065253, -0.44039415,
- -0.61210598, -0.75875812,
- -0.87434661, -0.95413925,
- -0.99486932
-};
-
-
-
-/* smat, imat = mat & imat to draw screenaligned */
-static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag, bPoseChannel *pchan, EditBone *ebone)
-{
- float head, tail, length, dist;
- float *headvec, *tailvec, dirvec[3];
-
- /* figure out the sizes of spheres */
- if (ebone) {
- /* this routine doesn't call set_matrix_editbone() that calculates it */
- ebone->length = VecLenf(ebone->head, ebone->tail);
-
- length= ebone->length;
- tail= ebone->rad_tail;
- dist= ebone->dist;
- if (ebone->parent && (ebone->flag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
- else
- head= ebone->rad_head;
- headvec= ebone->head;
- tailvec= ebone->tail;
- }
- else {
- length= pchan->bone->length;
- tail= pchan->bone->rad_tail;
- dist= pchan->bone->dist;
- if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
- else
- head= pchan->bone->rad_head;
- headvec= pchan->pose_head;
- tailvec= pchan->pose_tail;
- }
-
- /* ***** draw it ***** */
-
- /* move vector to viewspace */
- VecSubf(dirvec, tailvec, headvec);
- Mat4Mul3Vecfl(smat, dirvec);
- /* clear zcomp */
- dirvec[2]= 0.0;
- /* move vector back */
- Mat4Mul3Vecfl(imat, dirvec);
-
- if (0.0f != Normalize(dirvec)) {
- float norvec[3], vec1[3], vec2[3], vec[3];
- int a;
-
- //VecMulf(dirvec, head);
- Crossf(norvec, dirvec, imat[2]);
-
- glBegin(GL_QUAD_STRIP);
-
- for (a=0; a<16; a++) {
- vec[0]= - *(si+a) * dirvec[0] + *(co+a) * norvec[0];
- vec[1]= - *(si+a) * dirvec[1] + *(co+a) * norvec[1];
- vec[2]= - *(si+a) * dirvec[2] + *(co+a) * norvec[2];
-
- vec1[0]= headvec[0] + head*vec[0];
- vec1[1]= headvec[1] + head*vec[1];
- vec1[2]= headvec[2] + head*vec[2];
- vec2[0]= headvec[0] + (head+dist)*vec[0];
- vec2[1]= headvec[1] + (head+dist)*vec[1];
- vec2[2]= headvec[2] + (head+dist)*vec[2];
-
- glColor4ub(255, 255, 255, 50);
- glVertex3fv(vec1);
- //glColor4ub(255, 255, 255, 0);
- glVertex3fv(vec2);
- }
-
- for (a=15; a>=0; a--) {
- vec[0]= *(si+a) * dirvec[0] + *(co+a) * norvec[0];
- vec[1]= *(si+a) * dirvec[1] + *(co+a) * norvec[1];
- vec[2]= *(si+a) * dirvec[2] + *(co+a) * norvec[2];
-
- vec1[0]= tailvec[0] + tail*vec[0];
- vec1[1]= tailvec[1] + tail*vec[1];
- vec1[2]= tailvec[2] + tail*vec[2];
- vec2[0]= tailvec[0] + (tail+dist)*vec[0];
- vec2[1]= tailvec[1] + (tail+dist)*vec[1];
- vec2[2]= tailvec[2] + (tail+dist)*vec[2];
-
- //glColor4ub(255, 255, 255, 50);
- glVertex3fv(vec1);
- //glColor4ub(255, 255, 255, 0);
- glVertex3fv(vec2);
- }
- /* make it cyclic... */
-
- vec[0]= - *(si) * dirvec[0] + *(co) * norvec[0];
- vec[1]= - *(si) * dirvec[1] + *(co) * norvec[1];
- vec[2]= - *(si) * dirvec[2] + *(co) * norvec[2];
-
- vec1[0]= headvec[0] + head*vec[0];
- vec1[1]= headvec[1] + head*vec[1];
- vec1[2]= headvec[2] + head*vec[2];
- vec2[0]= headvec[0] + (head+dist)*vec[0];
- vec2[1]= headvec[1] + (head+dist)*vec[1];
- vec2[2]= headvec[2] + (head+dist)*vec[2];
-
- //glColor4ub(255, 255, 255, 50);
- glVertex3fv(vec1);
- //glColor4ub(255, 255, 255, 0);
- glVertex3fv(vec2);
-
- glEnd();
- }
-}
-
-
-/* smat, imat = mat & imat to draw screenaligned */
-static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
-{
- float head, tail, length;
- float *headvec, *tailvec, dirvec[3];
-
- /* figure out the sizes of spheres */
- if (ebone) {
- /* this routine doesn't call set_matrix_editbone() that calculates it */
- ebone->length = VecLenf(ebone->head, ebone->tail);
-
- length= ebone->length;
- tail= ebone->rad_tail;
- if (ebone->parent && (boneflag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
- else
- head= ebone->rad_head;
- headvec= ebone->head;
- tailvec= ebone->tail;
- }
- else {
- length= pchan->bone->length;
- tail= pchan->bone->rad_tail;
- if ((pchan->parent) && (boneflag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
- else
- head= pchan->bone->rad_head;
- headvec= pchan->pose_head;
- tailvec= pchan->pose_tail;
- }
-
- /* sphere root color */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
- else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
-
- /* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if (id != -1)
- glLoadName(id | BONESEL_ROOT);
-
- drawcircball(GL_LINE_LOOP, headvec, head, imat);
- }
-
- /* Draw tip point */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
-
- if (id != -1)
- glLoadName(id | BONESEL_TIP);
-
- drawcircball(GL_LINE_LOOP, tailvec, tail, imat);
-
- /* base */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_SELECT);
- else BIF_ThemeColor(TH_WIRE);
- }
-
- VecSubf(dirvec, tailvec, headvec);
-
- /* move vector to viewspace */
- Mat4Mul3Vecfl(smat, dirvec);
- /* clear zcomp */
- dirvec[2]= 0.0;
- /* move vector back */
- Mat4Mul3Vecfl(imat, dirvec);
-
- if (0.0f != Normalize(dirvec)) {
- float norvech[3], norvect[3], vec[3];
-
- VECCOPY(vec, dirvec);
-
- VecMulf(dirvec, head);
- Crossf(norvech, dirvec, imat[2]);
-
- VecMulf(vec, tail);
- Crossf(norvect, vec, imat[2]);
-
- if (id != -1)
- glLoadName(id | BONESEL_BONE);
-
- glBegin(GL_LINES);
- vec[0]= headvec[0] + norvech[0];
- vec[1]= headvec[1] + norvech[1];
- vec[2]= headvec[2] + norvech[2];
- glVertex3fv(vec);
- vec[0]= tailvec[0] + norvect[0];
- vec[1]= tailvec[1] + norvect[1];
- vec[2]= tailvec[2] + norvect[2];
- glVertex3fv(vec);
- vec[0]= headvec[0] - norvech[0];
- vec[1]= headvec[1] - norvech[1];
- vec[2]= headvec[2] - norvech[2];
- glVertex3fv(vec);
- vec[0]= tailvec[0] - norvect[0];
- vec[1]= tailvec[1] - norvect[1];
- vec[2]= tailvec[2] - norvect[2];
- glVertex3fv(vec);
-
- glEnd();
- }
-}
-
-/* does wire only for outline selecting */
-static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
-{
- GLUquadricObj *qobj;
- float head, tail, length;
- float fac1, fac2;
-
- glPushMatrix();
- qobj = gluNewQuadric();
-
- /* figure out the sizes of spheres */
- if (ebone) {
- length= ebone->length;
- tail= ebone->rad_tail;
- if (ebone->parent && (boneflag & BONE_CONNECTED))
- head= ebone->parent->rad_tail;
- else
- head= ebone->rad_head;
- }
- else {
- length= pchan->bone->length;
- tail= pchan->bone->rad_tail;
- if (pchan->parent && (boneflag & BONE_CONNECTED))
- head= pchan->parent->bone->rad_tail;
- else
- head= pchan->bone->rad_head;
- }
-
- /* move to z-axis space */
- glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
-
- if (dt==OB_SOLID) {
- /* set up solid drawing */
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_LIGHTING);
-
- gluQuadricDrawStyle(qobj, GLU_FILL);
- glShadeModel(GL_SMOOTH);
- }
- else {
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
- }
-
- /* sphere root color */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColorShade(TH_BONE_SOLID, -30);
- }
- else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_END, armflag, boneflag, constflag);
- else if (dt==OB_SOLID)
- BIF_ThemeColorShade(TH_BONE_SOLID, -30);
-
- /* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if (id != -1)
- glLoadName(id | BONESEL_ROOT);
- gluSphere(qobj, head, 16, 10);
- }
-
- /* Draw tip point */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColorShade(TH_BONE_SOLID, -30);
- }
-
- if (id != -1)
- glLoadName(id | BONESEL_TIP);
-
- glTranslatef(0.0, 0.0, length);
- gluSphere(qobj, tail, 16, 10);
- glTranslatef(0.0, 0.0, -length);
-
- /* base */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_SELECT);
- else BIF_ThemeColor(TH_BONE_SOLID);
- }
- else if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SPHEREBONE_BASE, armflag, boneflag, constflag);
- else if (dt == OB_SOLID)
- BIF_ThemeColor(TH_BONE_SOLID);
-
- fac1= (length-head)/length;
- fac2= (length-tail)/length;
-
- if (length > (head+tail)) {
- if (id != -1)
- glLoadName (id | BONESEL_BONE);
-
- glEnable(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(-1.0, -1.0);
-
- glTranslatef(0.0f, 0.0f, head);
- gluCylinder(qobj, fac1*head + (1.0f-fac1)*tail, fac2*tail + (1.0f-fac2)*head, length-head-tail, 16, 1);
- glTranslatef(0.0f, 0.0f, -head);
-
- glDisable(GL_POLYGON_OFFSET_FILL);
-
- /* draw sphere on extrema */
- glTranslatef(0.0f, 0.0f, length-tail);
- gluSphere(qobj, fac2*tail + (1.0f-fac2)*head, 16, 10);
- glTranslatef(0.0f, 0.0f, -length+tail);
-
- glTranslatef(0.0f, 0.0f, head);
- gluSphere(qobj, fac1*head + (1.0f-fac1)*tail, 16, 10);
- }
- else {
- /* 1 sphere in center */
- glTranslatef(0.0f, 0.0f, (head + length-tail)/2.0);
- gluSphere(qobj, fac1*head + (1.0f-fac1)*tail, 16, 10);
- }
-
- /* restore */
- if (dt==OB_SOLID) {
- glShadeModel(GL_FLAT);
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
- }
-
- glPopMatrix();
- gluDeleteQuadric(qobj);
-}
-
-static GLubyte bm_dot6[]= {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0};
-static GLubyte bm_dot8[]= {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C};
-
-static GLubyte bm_dot5[]= {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0};
-static GLubyte bm_dot7[]= {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38};
-
-
-static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
-{
- float length;
-
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- if (pchan)
- length= pchan->bone->length;
- else
- length= ebone->length;
-
- glPushMatrix();
- glScalef(length, length, length);
-
- /* this chunk not in object mode */
- if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) {
- glLineWidth(4.0);
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
- else if (armflag & ARM_EDITMODE) {
- BIF_ThemeColor(TH_WIRE);
- }
-
- /* Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if (G.f & G_PICKSEL) { // no bitmap in selection mode, crashes 3d cards...
- glLoadName (id | BONESEL_ROOT);
- glBegin(GL_POINTS);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glEnd();
- }
- else {
- glRasterPos3f(0.0f, 0.0f, 0.0f);
- glBitmap(8, 8, 4, 4, 0, 0, bm_dot8);
- }
- }
-
- if (id != -1)
- glLoadName((GLuint) id|BONESEL_BONE);
-
- glBegin(GL_LINES);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(0.0f, 1.0f, 0.0f);
- glEnd();
-
- /* tip */
- if (G.f & G_PICKSEL) {
- /* no bitmap in selection mode, crashes 3d cards... */
- glLoadName(id | BONESEL_TIP);
- glBegin(GL_POINTS);
- glVertex3f(0.0f, 1.0f, 0.0f);
- glEnd();
- }
- else {
- glRasterPos3f(0.0f, 1.0f, 0.0f);
- glBitmap(8, 8, 4, 4, 0, 0, bm_dot7);
- }
-
- /* further we send no names */
- if (id != -1)
- glLoadName(id & 0xFFFF); /* object tag, for bordersel optim */
-
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_LINEBONE, armflag, boneflag, constflag);
- }
-
- glLineWidth(2.0);
-
- /*Draw root point if we are not connected */
- if ((boneflag & BONE_CONNECTED)==0) {
- if ((G.f & G_PICKSEL)==0) {
- /* no bitmap in selection mode, crashes 3d cards... */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
- glRasterPos3f(0.0f, 0.0f, 0.0f);
- glBitmap(8, 8, 4, 4, 0, 0, bm_dot6);
- }
- }
-
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_EDGE_SELECT);
- else BIF_ThemeColorShade(TH_BACK, -30);
- }
- glBegin(GL_LINES);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3f(0.0f, 1.0f, 0.0f);
- glEnd();
-
- /* tip */
- if ((G.f & G_PICKSEL)==0) {
- /* no bitmap in selection mode, crashes 3d cards... */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- }
- glRasterPos3f(0.0f, 1.0f, 0.0f);
- glBitmap(8, 8, 4, 4, 0, 0, bm_dot5);
- }
-
- glLineWidth(1.0);
-
- glPopMatrix();
-}
-
-static void draw_b_bone_boxes(int dt, bPoseChannel *pchan, float xwidth, float length, float zwidth)
-{
- int segments= 0;
-
- if (pchan)
- segments= pchan->bone->segments;
-
- if ((segments > 1) && (pchan)) {
- float dlen= length/(float)segments;
- Mat4 *bbone= b_bone_spline_setup(pchan, 0);
- int a;
-
- for (a=0; a<segments; a++, bbone++) {
- glPushMatrix();
- glMultMatrixf(bbone->mat);
- if (dt==OB_SOLID) drawsolidcube_size(xwidth, dlen, zwidth);
- else drawcube_size(xwidth, dlen, zwidth);
- glPopMatrix();
- }
- }
- else {
- glPushMatrix();
- if (dt==OB_SOLID) drawsolidcube_size(xwidth, length, zwidth);
- else drawcube_size(xwidth, length, zwidth);
- glPopMatrix();
- }
-}
-
-static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
-{
- float xwidth, length, zwidth;
-
- if (pchan) {
- xwidth= pchan->bone->xwidth;
- length= pchan->bone->length;
- zwidth= pchan->bone->zwidth;
- }
- else {
- xwidth= ebone->xwidth;
- length= ebone->length;
- zwidth= ebone->zwidth;
- }
-
- /* draw points only if... */
- if (armflag & ARM_EDITMODE) {
- /* move to unitspace */
- glPushMatrix();
- glScalef(length, length, length);
- draw_bone_points(dt, armflag, boneflag, id);
- glPopMatrix();
- length*= 0.95f; // make vertices visible
- }
-
- /* colors for modes */
- if (armflag & ARM_POSEMODE) {
- if (dt <= OB_WIRE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
- else
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
- }
- else if (armflag & ARM_EDITMODE) {
- if (dt==OB_WIRE) {
- if (boneflag & BONE_ACTIVE) BIF_ThemeColor(TH_EDGE_SELECT);
- else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_EDGE_SELECT, -20);
- else BIF_ThemeColor(TH_WIRE);
- }
- else
- BIF_ThemeColor(TH_BONE_SOLID);
- }
-
- if (id != -1) {
- glLoadName ((GLuint) id|BONESEL_BONE);
- }
-
- /* set up solid drawing */
- if (dt > OB_WIRE) {
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_LIGHTING);
-
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
- else
- BIF_ThemeColor(TH_BONE_SOLID);
-
- draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth);
-
- /* disable solid drawing */
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_LIGHTING);
- }
- else {
- /* wire */
- if (armflag & ARM_POSEMODE) {
- if (constflag) {
- /* set constraint colors */
- if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) {
- glEnable(GL_BLEND);
-
- draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth);
-
- glDisable(GL_BLEND);
- }
-
- /* restore colors */
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
- }
- }
-
- draw_b_bone_boxes(OB_WIRE, pchan, xwidth, length, zwidth);
- }
-}
-
-static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, float length)
-{
-
- /* Draw a 3d octahedral bone, we use normalized space based on length,
- for glDisplayLists */
-
- glScalef(length, length, length);
-
- /* set up solid drawing */
- if (dt > OB_WIRE) {
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_LIGHTING);
- BIF_ThemeColor(TH_BONE_SOLID);
- }
-
- /* colors for posemode */
- if (armflag & ARM_POSEMODE) {
- if (dt <= OB_WIRE)
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
- else
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
- }
-
-
- draw_bone_points(dt, armflag, boneflag, id);
-
- /* now draw the bone itself */
- if (id != -1) {
- glLoadName((GLuint) id|BONESEL_BONE);
- }
-
- /* wire? */
- if (dt <= OB_WIRE) {
- /* colors */
- if (armflag & ARM_EDITMODE) {
- if (boneflag & BONE_ACTIVE) BIF_ThemeColor(TH_EDGE_SELECT);
- else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_EDGE_SELECT, -20);
- else BIF_ThemeColor(TH_WIRE);
- }
- else if (armflag & ARM_POSEMODE) {
- if (constflag) {
- /* draw constraint colors */
- if (set_pchan_glColor(PCHAN_COLOR_CONSTS, armflag, boneflag, constflag)) {
- glEnable(GL_BLEND);
-
- draw_bone_solid_octahedral();
-
- glDisable(GL_BLEND);
- }
-
- /* restore colors */
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, constflag);
- }
- }
- draw_bone_octahedral();
- }
- else {
- /* solid */
- if (armflag & ARM_POSEMODE)
- set_pchan_glColor(PCHAN_COLOR_SOLID, armflag, boneflag, constflag);
- else
- BIF_ThemeColor(TH_BONE_SOLID);
- draw_bone_solid_octahedral();
- }
-
- /* disable solid drawing */
- if (dt > OB_WIRE) {
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_LIGHTING);
- }
-}
-
-static void draw_custom_bone(Object *ob, int dt, int armflag, int boneflag, unsigned int id, float length)
-{
- if(ob==NULL) return;
-
- glScalef(length, length, length);
-
- /* colors for posemode */
- if (armflag & ARM_POSEMODE) {
- set_pchan_glColor(PCHAN_COLOR_NORMAL, armflag, boneflag, 0);
- }
-
- if (id != -1) {
- glLoadName((GLuint) id|BONESEL_BONE);
- }
-
- draw_object_instance(ob, dt, armflag & ARM_POSEMODE);
-}
-
-
-static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp)
-{
- bConstraint *con;
- bPoseChannel *parchan;
-
- for (con= pchan->constraints.first; con; con= con->next) {
- if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) {
- bKinematicConstraint *data = (bKinematicConstraint*)con->data;
- int segcount= 0;
-
- /* if only_temp, only draw if it is a temporary ik-chain */
- if ((only_temp) && !(data->flag & CONSTRAINT_IK_TEMP))
- continue;
-
- setlinestyle(3);
- glBegin(GL_LINES);
-
- /* exclude tip from chain? */
- if ((data->flag & CONSTRAINT_IK_TIP)==0)
- parchan= pchan->parent;
- else
- parchan= pchan;
-
- glVertex3fv(parchan->pose_tail);
-
- /* Find the chain's root */
- while (parchan->parent) {
- segcount++;
- if(segcount==data->rootbone || segcount>255) break; // 255 is weak
- parchan= parchan->parent;
- }
- if (parchan)
- glVertex3fv(parchan->pose_head);
-
- glEnd();
- setlinestyle(0);
- }
- }
-}
-
-static void bgl_sphere_project(float ax, float az)
-{
- float dir[3], sine, q3;
-
- sine= 1.0f-ax*ax-az*az;
- q3= (sine < 0.0f)? 0.0f: 2.0f*sqrt(sine);
-
- dir[0]= -az*q3;
- dir[1]= 1.0f-2.0f*sine;
- dir[2]= ax*q3;
-
- glVertex3fv(dir);
-}
-
-static void draw_dof_ellipse(float ax, float az)
-{
- static float staticSine[16] = {
- 0.0, 0.104528463268, 0.207911690818, 0.309016994375,
- 0.406736643076, 0.5, 0.587785252292, 0.669130606359,
- 0.743144825477, 0.809016994375, 0.866025403784,
- 0.913545457643, 0.951056516295, 0.978147600734,
- 0.994521895368, 1.0
- };
-
- int i, j, n=16;
- float x, z, px, pz;
-
- glEnable(GL_BLEND);
- glDepthMask(0);
-
- glColor4ub(70, 70, 70, 50);
-
- glBegin(GL_QUADS);
- pz= 0.0f;
- for(i=1; i<n; i++) {
- z= staticSine[i];
-
- px= 0.0f;
- for(j=1; j<n-i+1; j++) {
- x = staticSine[j];
-
- if(j == n-i) {
- glEnd();
- glBegin(GL_TRIANGLES);
- bgl_sphere_project(ax*px, az*z);
- bgl_sphere_project(ax*px, az*pz);
- bgl_sphere_project(ax*x, az*pz);
- glEnd();
- glBegin(GL_QUADS);
- }
- else {
- bgl_sphere_project(ax*x, az*z);
- bgl_sphere_project(ax*x, az*pz);
- bgl_sphere_project(ax*px, az*pz);
- bgl_sphere_project(ax*px, az*z);
- }
-
- px= x;
- }
- pz= z;
- }
- glEnd();
-
- glDisable(GL_BLEND);
- glDepthMask(1);
-
- glColor3ub(0, 0, 0);
-
- glBegin(GL_LINE_STRIP);
- for (i=0; i<n; i++)
- bgl_sphere_project(staticSine[n-i-1]*ax, staticSine[i]*az);
- glEnd();
-}
-
-static void draw_pose_dofs(Object *ob)
-{
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- Bone *bone;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
-
- if ( (bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) {
- if (bone->flag & BONE_SELECTED) {
- if (bone->layer & arm->layer) {
- if (pchan->ikflag & (BONE_IK_XLIMIT|BONE_IK_ZLIMIT)) {
- if (pose_channel_in_IK_chain(ob, pchan)) {
- float corner[4][3], posetrans[3], mat[4][4];
- float phi=0.0f, theta=0.0f, scale;
- int a, i;
-
- /* in parent-bone pose, but own restspace */
- glPushMatrix();
-
- VECCOPY(posetrans, pchan->pose_mat[3]);
- glTranslatef(posetrans[0], posetrans[1], posetrans[2]);
-
- if (pchan->parent) {
- Mat4CpyMat4(mat, pchan->parent->pose_mat);
- mat[3][0]= mat[3][1]= mat[3][2]= 0.0f;
- glMultMatrixf(mat);
- }
-
- Mat4CpyMat3(mat, pchan->bone->bone_mat);
- glMultMatrixf(mat);
-
- scale= bone->length*pchan->size[1];
- glScalef(scale, scale, scale);
-
- if (pchan->ikflag & BONE_IK_XLIMIT) {
- if (pchan->ikflag & BONE_IK_ZLIMIT) {
- float amin[3], amax[3];
-
- for (i=0; i<3; i++) {
- amin[i]= sin(pchan->limitmin[i]*M_PI/360.0);
- amax[i]= sin(pchan->limitmax[i]*M_PI/360.0);
- }
-
- glScalef(1.0, -1.0, 1.0);
- if (amin[0] != 0.0 && amin[2] != 0.0)
- draw_dof_ellipse(amin[0], amin[2]);
- if (amin[0] != 0.0 && amax[2] != 0.0)
- draw_dof_ellipse(amin[0], amax[2]);
- if (amax[0] != 0.0 && amin[2] != 0.0)
- draw_dof_ellipse(amax[0], amin[2]);
- if (amax[0] != 0.0 && amax[2] != 0.0)
- draw_dof_ellipse(amax[0], amax[2]);
- glScalef(1.0, -1.0, 1.0);
- }
- }
-
- /* arcs */
- if (pchan->ikflag & BONE_IK_ZLIMIT) {
- theta= 0.5*(pchan->limitmin[2]+pchan->limitmax[2]);
- glRotatef(theta, 0.0f, 0.0f, 1.0f);
-
- glColor3ub(50, 50, 255); // blue, Z axis limit
- glBegin(GL_LINE_STRIP);
- for (a=-16; a<=16; a++) {
- float fac= ((float)a)/16.0f;
- phi= fac*(M_PI/360.0f)*(pchan->limitmax[2]-pchan->limitmin[2]);
-
- i= (a == -16) ? 0 : 1;
- corner[i][0]= sin(phi);
- corner[i][1]= cos(phi);
- corner[i][2]= 0.0f;
- glVertex3fv(corner[i]);
- }
- glEnd();
-
- glRotatef(-theta, 0.0f, 0.0f, 1.0f);
- }
-
- if (pchan->ikflag & BONE_IK_XLIMIT) {
- theta= 0.5*(pchan->limitmin[0]+pchan->limitmax[0]);
- glRotatef(theta, 1.0f, 0.0f, 0.0f);
-
- glColor3ub(255, 50, 50); // Red, X axis limit
- glBegin(GL_LINE_STRIP);
- for (a=-16; a<=16; a++) {
- float fac= ((float)a)/16.0f;
- phi= 0.5f*M_PI + fac*(M_PI/360.0f)*(pchan->limitmax[0]-pchan->limitmin[0]);
-
- i= (a == -16) ? 2 : 3;
- corner[i][0]= 0.0f;
- corner[i][1]= sin(phi);
- corner[i][2]= cos(phi);
- glVertex3fv(corner[i]);
- }
- glEnd();
-
- glRotatef(-theta, 1.0f, 0.0f, 0.0f);
- }
-
- /* out of cone, out of bone */
- glPopMatrix();
- }
- }
- }
- }
- }
- }
-}
-
-/* assumes object is Armature with pose */
-static void draw_pose_channels(Base *base, int dt)
-{
- Object *ob= base->object;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- Bone *bone;
- GLfloat tmp;
- float smat[4][4], imat[4][4];
- int index= -1;
- short do_dashed= 3, draw_wire= 0;
- short flag, constflag;
-
- /* hacky... prevent outline select from drawing dashed helplines */
- glGetFloatv(GL_LINE_WIDTH, &tmp);
- if (tmp > 1.1) do_dashed &= ~1;
- if (G.vd->flag & V3D_HIDE_HELPLINES) do_dashed &= ~2;
-
- /* precalc inverse matrix for drawing screen aligned */
- if (arm->drawtype==ARM_ENVELOPE) {
- /* precalc inverse matrix for drawing screen aligned */
- mygetmatrix(smat);
- Mat4MulFloat3(smat[0], 1.0f/VecLength(ob->obmat[0]));
- Mat4Invert(imat, smat);
-
- /* and draw blended distances */
- if (arm->flag & ARM_POSEMODE) {
- glEnable(GL_BLEND);
- //glShadeModel(GL_SMOOTH);
-
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
- if (bone && !(bone->flag & (BONE_HIDDEN_P|BONE_NO_DEFORM|BONE_HIDDEN_PG))) {
- if (bone->flag & (BONE_SELECTED)) {
- if (bone->layer & arm->layer)
- draw_sphere_bone_dist(smat, imat, bone->flag, pchan, NULL);
- }
- }
- }
-
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- glDisable(GL_BLEND);
- //glShadeModel(GL_FLAT);
- }
- }
-
- /* little speedup, also make sure transparent only draws once */
- glCullFace(GL_BACK);
- glEnable(GL_CULL_FACE);
-
- /* if solid we draw that first, with selection codes, but without names, axes etc */
- if (dt > OB_WIRE) {
- if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
-
- if ( (bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)) ) {
- if (bone->layer & arm->layer) {
- glPushMatrix();
- glMultMatrixf(pchan->pose_mat);
-
- /* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ( (bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)) )
- flag &= ~BONE_CONNECTED;
-
- /* set color-set to use */
- set_pchan_colorset(ob, pchan);
-
- if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) {
- /* if drawwire, don't try to draw in solid */
- if (pchan->bone->flag & BONE_DRAWWIRE)
- draw_wire= 1;
- else
- draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length);
- }
- else if (arm->drawtype==ARM_LINE)
- ; /* nothing in solid */
- else if (arm->drawtype==ARM_ENVELOPE)
- draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
- else if (arm->drawtype==ARM_B_BONE)
- draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL);
- else
- draw_bone(OB_SOLID, arm->flag, flag, 0, index, bone->length);
-
- glPopMatrix();
- }
- }
-
- if (index!= -1)
- index+= 0x10000; // pose bones count in higher 2 bytes only
- }
-
- /* very very confusing... but in object mode, solid draw, we cannot do glLoadName yet,
- * stick bones and/or wire custom-shapes are drawn in next loop
- */
- if ((arm->drawtype != ARM_LINE) && (draw_wire == 0)) {
- /* object tag, for bordersel optim */
- glLoadName(index & 0xFFFF);
- index= -1;
- }
- }
-
- /* draw custom bone shapes as wireframes */
- if ( !(arm->flag & ARM_NO_CUSTOM) &&
- ((draw_wire) || (dt <= OB_WIRE)) )
- {
- if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
-
- /* only draw custom bone shapes that need to be drawn as wires */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
-
- if ((bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) {
- if (bone->layer & arm->layer) {
- if (pchan->custom) {
- if ((dt < OB_SOLID) || (bone->flag & BONE_DRAWWIRE)) {
- glPushMatrix();
- glMultMatrixf(pchan->pose_mat);
-
- /* prepare colors */
- if (arm->flag & ARM_POSEMODE)
- set_pchan_colorset(ob, pchan);
- else {
- if ((G.scene->basact)==base) {
- if (base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_ACTIVE);
- else BIF_ThemeColor(TH_WIRE);
- }
- else {
- if (base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_SELECT);
- else BIF_ThemeColor(TH_WIRE);
- }
- }
-
- /* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)))
- flag &= ~BONE_CONNECTED;
-
- draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length);
-
- glPopMatrix();
- }
- }
- }
- }
-
- if (index != -1)
- index+= 0x10000; // pose bones count in higher 2 bytes only
- }
-
- if (draw_wire) {
- /* object tag, for bordersel optim */
- glLoadName(index & 0xFFFF);
- index= -1;
- }
- }
-
- /* wire draw over solid only in posemode */
- if ((dt <= OB_WIRE) || (arm->flag & ARM_POSEMODE) || (arm->drawtype==ARM_LINE)) {
- /* draw line check first. we do selection indices */
- if (arm->drawtype==ARM_LINE) {
- if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
- }
- /* if solid && posemode, we draw again with polygonoffset */
- else if ((dt > OB_WIRE) && (arm->flag & ARM_POSEMODE)) {
- bglPolygonOffset(1.0);
- }
- else {
- /* and we use selection indices if not done yet */
- if (arm->flag & ARM_POSEMODE)
- index= base->selcol;
- }
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
-
- if ((bone) && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) {
- if (bone->layer & arm->layer) {
- if ((do_dashed & 1) && (bone->parent)) {
- /* Draw a line from our root to the parent's tip
- * - only if V3D_HIDE_HELPLINES is enabled...
- */
- if ( (do_dashed & 2) && ((bone->flag & BONE_CONNECTED)==0) ) {
- if (arm->flag & ARM_POSEMODE) {
- glLoadName(index & 0xFFFF); // object tag, for bordersel optim
- BIF_ThemeColor(TH_WIRE);
- }
- setlinestyle(3);
- glBegin(GL_LINES);
- glVertex3fv(pchan->pose_head);
- glVertex3fv(pchan->parent->pose_tail);
- glEnd();
- setlinestyle(0);
- }
-
- /* Draw a line to IK root bone
- * - only if temporary chain (i.e. "autoik")
- */
- if (arm->flag & ARM_POSEMODE) {
- if (pchan->constflag & PCHAN_HAS_IK) {
- if (bone->flag & BONE_SELECTED) {
- if (pchan->constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0);
- else glColor3ub(200, 200, 50); // add theme!
-
- glLoadName(index & 0xFFFF);
- pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
- }
- }
- }
- }
-
- glPushMatrix();
- if (arm->drawtype != ARM_ENVELOPE)
- glMultMatrixf(pchan->pose_mat);
-
- /* catch exception for bone with hidden parent */
- flag= bone->flag;
- if ((bone->parent) && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG)))
- flag &= ~BONE_CONNECTED;
-
- /* extra draw service for pose mode */
- constflag= pchan->constflag;
- if (pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE))
- constflag |= PCHAN_HAS_ACTION;
- if (pchan->flag & POSE_STRIDE)
- constflag |= PCHAN_HAS_STRIDE;
-
- /* set color-set to use */
- set_pchan_colorset(ob, pchan);
-
- if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM))
- ; // custom bone shapes should not be drawn here!
- else if (arm->drawtype==ARM_ENVELOPE) {
- if (dt < OB_SOLID)
- draw_sphere_bone_wire(smat, imat, arm->flag, flag, constflag, index, pchan, NULL);
- }
- else if (arm->drawtype==ARM_LINE)
- draw_line_bone(arm->flag, flag, constflag, index, pchan, NULL);
- else if (arm->drawtype==ARM_B_BONE)
- draw_b_bone(OB_WIRE, arm->flag, flag, constflag, index, pchan, NULL);
- else
- draw_bone(OB_WIRE, arm->flag, flag, constflag, index, bone->length);
-
- glPopMatrix();
- }
- }
-
- /* pose bones count in higher 2 bytes only */
- if (index != -1)
- index+= 0x10000;
- }
- /* restore things */
- if ((arm->drawtype!=ARM_LINE)&& (dt>OB_WIRE) && (arm->flag & ARM_POSEMODE))
- bglPolygonOffset(0.0);
- }
-
- /* restore */
- glDisable(GL_CULL_FACE);
-
- /* draw DoFs */
- if (arm->flag & ARM_POSEMODE)
- draw_pose_dofs(ob);
-
- /* finally names and axes */
- if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) {
- /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
- if ((G.f & G_PICKSEL) == 0) {
- float vec[3];
-
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if ((pchan->bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0) {
- if (pchan->bone->layer & arm->layer) {
- if (arm->flag & (ARM_EDITMODE|ARM_POSEMODE)) {
- bone= pchan->bone;
-
- if (bone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
- }
- else if (dt > OB_WIRE)
- BIF_ThemeColor(TH_TEXT);
-
- /* Draw names of bone */
- if (arm->flag & ARM_DRAWNAMES) {
- VecMidf(vec, pchan->pose_head, pchan->pose_tail);
- glRasterPos3fv(vec);
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, pchan->name);
- }
-
- /* Draw additional axes on the bone tail */
- if ( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ) {
- glPushMatrix();
- glMultMatrixf(pchan->pose_mat);
- glTranslatef(0.0f, pchan->bone->length, 0.0f);
- drawaxes(0.25f*pchan->bone->length, 0, OB_ARROWS);
- glPopMatrix();
- }
- }
- }
- }
-
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- }
- }
-}
-
-/* in editmode, we don't store the bone matrix... */
-static void set_matrix_editbone(EditBone *eBone)
-{
- float delta[3],offset[3];
- float mat[3][3], bmat[4][4];
-
- /* Compose the parent transforms (i.e. their translations) */
- VECCOPY(offset, eBone->head);
-
- glTranslatef(offset[0],offset[1],offset[2]);
-
- VecSubf(delta, eBone->tail, eBone->head);
-
- eBone->length = sqrt (delta[0]*delta[0] + delta[1]*delta[1] +delta[2]*delta[2]);
-
- vec_roll_to_mat3(delta, eBone->roll, mat);
- Mat4CpyMat3(bmat, mat);
-
- glMultMatrixf(bmat);
-
-}
-
-static void draw_ebones(Object *ob, int dt)
-{
- EditBone *eBone;
- bArmature *arm= ob->data;
- float smat[4][4], imat[4][4];
- unsigned int index;
- int flag;
-
- /* envelope (deform distance) */
- if(arm->drawtype==ARM_ENVELOPE) {
- /* precalc inverse matrix for drawing screen aligned */
- mygetmatrix(smat);
- Mat4MulFloat3(smat[0], 1.0f/VecLength(ob->obmat[0]));
- Mat4Invert(imat, smat);
-
- /* and draw blended distances */
- glEnable(GL_BLEND);
- //glShadeModel(GL_SMOOTH);
-
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++) {
- if (eBone->layer & arm->layer) {
- if ((eBone->flag & (BONE_HIDDEN_A|BONE_NO_DEFORM))==0) {
- if (eBone->flag & (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL))
- draw_sphere_bone_dist(smat, imat, eBone->flag, NULL, eBone);
- }
- }
- }
-
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- glDisable(GL_BLEND);
- //glShadeModel(GL_FLAT);
- }
-
- /* if solid we draw it first */
- if ((dt > OB_WIRE) && (arm->drawtype!=ARM_LINE)) {
- index= 0;
- for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++) {
- if (eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
- glPushMatrix();
- set_matrix_editbone(eBone);
-
- /* catch exception for bone with hidden parent */
- flag= eBone->flag;
- if ( (eBone->parent) && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) )
- flag &= ~BONE_CONNECTED;
-
- if (arm->drawtype==ARM_ENVELOPE)
- draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone);
- else if(arm->drawtype==ARM_B_BONE)
- draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone);
- else {
- draw_bone(OB_SOLID, arm->flag, flag, 0, index, eBone->length);
- }
-
- glPopMatrix();
- }
- }
- }
- }
-
- /* if wire over solid, set offset */
- index= -1;
- glLoadName(-1);
- if (arm->drawtype==ARM_LINE) {
- if(G.f & G_PICKSEL)
- index= 0;
- }
- else if (dt > OB_WIRE)
- bglPolygonOffset(1.0);
- else if (arm->flag & ARM_EDITMODE)
- index= 0; /* do selection codes */
-
- for (eBone=G.edbo.first; eBone; eBone=eBone->next) {
- if (eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
-
- /* catch exception for bone with hidden parent */
- flag= eBone->flag;
- if ( (eBone->parent) && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) )
- flag &= ~BONE_CONNECTED;
-
- if (arm->drawtype == ARM_ENVELOPE) {
- if (dt < OB_SOLID)
- draw_sphere_bone_wire(smat, imat, arm->flag, flag, 0, index, NULL, eBone);
- }
- else {
- glPushMatrix();
- set_matrix_editbone(eBone);
-
- if (arm->drawtype == ARM_LINE)
- draw_line_bone(arm->flag, flag, 0, index, NULL, eBone);
- else if (arm->drawtype == ARM_B_BONE)
- draw_b_bone(OB_WIRE, arm->flag, flag, 0, index, NULL, eBone);
- else
- draw_bone(OB_WIRE, arm->flag, flag, 0, index, eBone->length);
-
- glPopMatrix();
- }
-
- /* offset to parent */
- if (eBone->parent) {
- BIF_ThemeColor(TH_WIRE);
- glLoadName (-1); // -1 here is OK!
- setlinestyle(3);
-
- glBegin(GL_LINES);
- glVertex3fv(eBone->parent->tail);
- glVertex3fv(eBone->head);
- glEnd();
-
- setlinestyle(0);
- }
- }
- }
- if(index!=-1) index++;
- }
-
- /* restore */
- if (arm->drawtype==ARM_LINE);
- else if (dt>OB_WIRE) bglPolygonOffset(0.0);
-
- /* finally names and axes */
- if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) {
- // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing
- if ((G.f & G_PICKSEL) == 0) {
- float vec[3];
-
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++) {
- if(eBone->layer & arm->layer) {
- if ((eBone->flag & BONE_HIDDEN_A)==0) {
-
- if (eBone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
-
- /* Draw name */
- if (arm->flag & ARM_DRAWNAMES) {
- VecMidf(vec, eBone->head, eBone->tail);
- glRasterPos3fv(vec);
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, eBone->name);
- }
- /* Draw additional axes */
- if (arm->flag & ARM_DRAWAXES) {
- glPushMatrix();
- set_matrix_editbone(eBone);
- glTranslatef(0.0f, eBone->length, 0.0f);
- drawaxes(eBone->length*0.25f, 0, OB_ARROWS);
- glPopMatrix();
- }
-
- }
- }
- }
-
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- }
- }
-}
-
-/* ****************************** Armature Visualisation ******************************** */
-
-/* ---------- Paths --------- */
-
-/* draw bone paths
- * - in view space
- */
-static void draw_pose_paths(Object *ob)
-{
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- bAction *act;
- bActionChannel *achan;
- ActKeyColumn *ak;
- ListBase keys;
- float *fp, *fp_start;
- int a, stepsize;
- int sfra, efra, len;
-
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- glPushMatrix();
- glLoadMatrixf(G.vd->viewmat);
-
- /* version patch here - cannot access frame info from file reading */
- if (arm->pathsize == 0) arm->pathsize= 1;
- stepsize = arm->pathsize;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone->layer & arm->layer) {
- if (pchan->path) {
- /* version patch here - cannot access frame info from file reading */
- if ((pchan->pathsf == 0) || (pchan->pathef == 0)) {
- pchan->pathsf= SFRA;
- pchan->pathef= EFRA;
- }
-
- /* get frame ranges */
- if (arm->pathflag & ARM_PATH_ACFRA) {
- int sind;
-
- /* With "Around Current", we only choose frames from around
- * the current frame to draw. However, this range is still
- * restricted by the limits of the original path.
- */
- sfra= CFRA - arm->pathbc;
- efra= CFRA + arm->pathac;
- if (sfra < pchan->pathsf) sfra= pchan->pathsf;
- if (efra > pchan->pathef) efra= pchan->pathef;
-
- len= efra - sfra;
-
- sind= sfra - pchan->pathsf;
- fp_start= (pchan->path + (3*sind));
- }
- else {
- sfra= pchan->pathsf;
- efra = sfra + pchan->pathlen;
- len = pchan->pathlen;
- fp_start = pchan->path;
- }
-
- /* draw curve-line of path */
- glShadeModel(GL_SMOOTH);
-
- glBegin(GL_LINE_STRIP);
- for (a=0, fp=fp_start; a<len; a++, fp+=3) {
- float intensity; /* how faint */
-
- /* set color
- * - more intense for active/selected bones, less intense for unselected bones
- * - black for before current frame, green for current frame, blue for after current frame
- * - intensity decreases as distance from current frame increases
- */
- #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max-min)) + min)
- if ((a+sfra) < CFRA) {
- /* black - before cfra */
- if (pchan->bone->flag & BONE_SELECTED) {
- // intensity= 0.5;
- intensity = SET_INTENSITY(sfra, a, CFRA, 0.25f, 0.75f);
- }
- else {
- //intensity= 0.8;
- intensity = SET_INTENSITY(sfra, a, CFRA, 0.68f, 0.92f);
- }
- BIF_ThemeColorBlend(TH_WIRE, TH_BACK, intensity);
- }
- else if ((a+sfra) > CFRA) {
- /* blue - after cfra */
- if (pchan->bone->flag & BONE_SELECTED) {
- //intensity = 0.5;
- intensity = SET_INTENSITY(CFRA, a, efra, 0.25f, 0.75f);
- }
- else {
- //intensity = 0.8;
- intensity = SET_INTENSITY(CFRA, a, efra, 0.68f, 0.92f);
- }
- BIF_ThemeColorBlend(TH_BONE_POSE, TH_BACK, intensity);
- }
- else {
- /* green - on cfra */
- if (pchan->bone->flag & BONE_SELECTED) {
- intensity= 0.5;
- }
- else {
- intensity= 0.99;
- }
- BIF_ThemeColorBlendShade(TH_CFRAME, TH_BACK, intensity, 10);
- }
-
- /* draw a vertex with this color */
- glVertex3fv(fp);
- }
-
- glEnd();
- glShadeModel(GL_FLAT);
-
- glPointSize(1.0);
-
- /* draw little black point at each frame
- * NOTE: this is not really visible/noticable
- */
- glBegin(GL_POINTS);
- for (a=0, fp=fp_start; a<len; a++, fp+=3)
- glVertex3fv(fp);
- glEnd();
-
- /* Draw little white dots at each framestep value */
- BIF_ThemeColor(TH_TEXT_HI);
- glBegin(GL_POINTS);
- for (a=0, fp=fp_start; a<len; a+=stepsize, fp+=(stepsize*3))
- glVertex3fv(fp);
- glEnd();
-
- /* Draw frame numbers at each framestep value */
- if (arm->pathflag & ARM_PATH_FNUMS) {
- for (a=0, fp=fp_start; a<len; a+=stepsize, fp+=(stepsize*3)) {
- char str[32];
-
- /* only draw framenum if several consecutive highlighted points don't occur on same point */
- if (a == 0) {
- glRasterPos3fv(fp);
- sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
- }
- else if ((a > stepsize) && (a < len-stepsize)) {
- if ((VecEqual(fp, fp-(stepsize*3))==0) || (VecEqual(fp, fp+(stepsize*3))==0)) {
- glRasterPos3fv(fp);
- sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
- }
- }
- }
- }
-
- /* Keyframes - dots and numbers */
- if (arm->pathflag & ARM_PATH_KFRAS) {
- /* build list of all keyframes in active action for pchan */
- keys.first = keys.last = NULL;
- act= ob_get_action(ob);
- if (act) {
- achan= get_action_channel(act, pchan->name);
- if (achan)
- ipo_to_keylist(achan->ipo, &keys, NULL, NULL);
- }
-
- /* Draw slightly-larger yellow dots at each keyframe */
- BIF_ThemeColor(TH_VERTEX_SELECT);
- glPointSize(5.0);
-
- glBegin(GL_POINTS);
- for (a=0, fp=fp_start; a<len; a++, fp+=3) {
- for (ak= keys.first; ak; ak= ak->next) {
- if (ak->cfra == (a+sfra))
- glVertex3fv(fp);
- }
- }
- glEnd();
-
- glPointSize(1.0);
-
- /* Draw frame numbers of keyframes */
- if ((arm->pathflag & ARM_PATH_FNUMS) || (arm->pathflag & ARM_PATH_KFNOS)) {
- for(a=0, fp=fp_start; a<len; a++, fp+=3) {
- for (ak= keys.first; ak; ak= ak->next) {
- if (ak->cfra == (a+sfra)) {
- char str[32];
-
- glRasterPos3fv(fp);
- sprintf(str, " %d\n", (a+sfra));
- BMF_DrawString(G.font, str);
- }
- }
- }
- }
-
- BLI_freelistN(&keys);
- }
- }
- }
- }
-
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- glPopMatrix();
-}
-
-
-/* ---------- Ghosts --------- */
-
-/* helper function for ghost drawing - sets/removes flags for temporarily
- * hiding unselected bones while drawing ghosts
- */
-static void ghost_poses_tag_unselected(Object *ob, short unset)
-{
- bArmature *arm= ob->data;
- bPose *pose= ob->pose;
- bPoseChannel *pchan;
-
- /* don't do anything if no hiding any bones */
- if ((arm->flag & ARM_GHOST_ONLYSEL)==0)
- return;
-
- /* loop over all pchans, adding/removing tags as appropriate */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
- if (unset) {
- /* remove tags from all pchans if cleaning up */
- pchan->bone->flag &= ~BONE_HIDDEN_PG;
- }
- else {
- /* set tags on unselected pchans only */
- if ((pchan->bone->flag & BONE_SELECTED)==0)
- pchan->bone->flag |= BONE_HIDDEN_PG;
- }
- }
- }
-}
-
-/* draw ghosts that occur within a frame range
- * note: object should be in posemode
- */
-static void draw_ghost_poses_range(Base *base)
-{
- Object *ob= base->object;
- bArmature *arm= ob->data;
- bPose *posen, *poseo;
- float start, end, stepsize, range, colfac;
- int cfrao, flago, ipoflago;
-
- start = arm->ghostsf;
- end = arm->ghostef;
- if (end <= start)
- return;
-
- stepsize= (float)(arm->ghostsize);
- range= (float)(end - start);
-
- /* store values */
- ob->flag &= ~OB_POSEMODE;
- cfrao= CFRA;
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
- ipoflago= ob->ipoflag;
- ob->ipoflag |= OB_DISABLE_PATH;
-
- /* copy the pose */
- poseo= ob->pose;
- copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
-
- glEnable(GL_BLEND);
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- /* draw from first frame of range to last */
- for (CFRA= start; CFRA<end; CFRA+=stepsize) {
- colfac = (end-CFRA)/range;
- BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac)));
-
- do_all_pose_actions(ob);
- where_is_pose(ob);
- draw_pose_channels(base, OB_WIRE);
- }
- glDisable(GL_BLEND);
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
- free_pose(posen);
-
- /* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
- armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
- ob->ipoflag= ipoflago;
-}
-
-/* draw ghosts on keyframes in action within range
- * - object should be in posemode
- */
-static void draw_ghost_poses_keys(Base *base)
-{
- Object *ob= base->object;
- bAction *act= ob_get_action(ob);
- bArmature *arm= ob->data;
- bPose *posen, *poseo;
- ListBase keys= {NULL, NULL};
- ActKeysInc aki = {0, 0, 0};
- ActKeyColumn *ak, *akn;
- float start, end, range, colfac, i;
- int cfrao, flago, ipoflago;
-
- aki.start= start = arm->ghostsf;
- aki.end= end = arm->ghostef;
- if (end <= start)
- return;
-
- /* get keyframes - then clip to only within range */
- action_to_keylist(act, &keys, NULL, &aki);
- range= 0;
- for (ak= keys.first; ak; ak= akn) {
- akn= ak->next;
-
- if ((ak->cfra < start) || (ak->cfra > end))
- BLI_freelinkN(&keys, ak);
- else
- range++;
- }
- if (range == 0) return;
-
- /* store values */
- ob->flag &= ~OB_POSEMODE;
- cfrao= CFRA;
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
- ipoflago= ob->ipoflag;
- ob->ipoflag |= OB_DISABLE_PATH;
-
- /* copy the pose */
- poseo= ob->pose;
- copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
-
- glEnable(GL_BLEND);
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- /* draw from first frame of range to last */
- for (ak=keys.first, i=0; ak; ak=ak->next, i++) {
- colfac = i/range;
- BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac)));
-
- CFRA= (int)ak->cfra;
-
- do_all_pose_actions(ob);
- where_is_pose(ob);
- draw_pose_channels(base, OB_WIRE);
- }
- glDisable(GL_BLEND);
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
- BLI_freelistN(&keys);
- free_pose(posen);
-
- /* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
- armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
- ob->ipoflag= ipoflago;
-}
-
-/* draw ghosts around current frame
- * - object is supposed to be armature in posemode
- */
-static void draw_ghost_poses(Base *base)
-{
- Object *ob= base->object;
- bArmature *arm= ob->data;
- bPose *posen, *poseo;
- bActionStrip *strip;
- float cur, start, end, stepsize, range, colfac, actframe, ctime;
- int cfrao, maptime, flago, ipoflago;
-
- /* pre conditions, get an action with sufficient frames */
- if (ob->action==NULL)
- return;
-
- calc_action_range(ob->action, &start, &end, 0);
- if (start == end)
- return;
-
- stepsize= (float)(arm->ghostsize);
- range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */
-
- /* we only map time for armature when an active strip exists */
- for (strip=ob->nlastrips.first; strip; strip=strip->next)
- if (strip->flag & ACTSTRIP_ACTIVE)
- break;
-
- maptime= (strip!=NULL);
-
- /* store values */
- ob->flag &= ~OB_POSEMODE;
- cfrao= CFRA;
- if (maptime) actframe= get_action_frame(ob, (float)CFRA);
- else actframe= CFRA;
- flago= arm->flag;
- arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
- ipoflago= ob->ipoflag;
- ob->ipoflag |= OB_DISABLE_PATH;
-
- /* copy the pose */
- poseo= ob->pose;
- copy_pose(&posen, ob->pose, 1);
- ob->pose= posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
- ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
-
- glEnable(GL_BLEND);
- if (G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- /* draw from darkest blend to lowest */
- for(cur= stepsize; cur<range; cur+=stepsize) {
- ctime= cur - fmod((float)cfrao, stepsize); /* ensures consistant stepping */
- colfac= ctime/range;
- BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac)));
-
- /* only within action range */
- if (actframe+ctime >= start && actframe+ctime <= end) {
- if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe+ctime);
- else CFRA= (int)floor(actframe+ctime);
-
- if (CFRA!=cfrao) {
- do_all_pose_actions(ob);
- where_is_pose(ob);
- draw_pose_channels(base, OB_WIRE);
- }
- }
-
- ctime= cur + fmod((float)cfrao, stepsize) - stepsize+1.0f; /* ensures consistant stepping */
- colfac= ctime/range;
- BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac)));
-
- /* only within action range */
- if ((actframe-ctime >= start) && (actframe-ctime <= end)) {
- if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe-ctime);
- else CFRA= (int)floor(actframe-ctime);
-
- if (CFRA != cfrao) {
- do_all_pose_actions(ob);
- where_is_pose(ob);
- draw_pose_channels(base, OB_WIRE);
- }
- }
- }
- glDisable(GL_BLEND);
- if (G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
- ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
- free_pose(posen);
-
- /* restore */
- CFRA= cfrao;
- ob->pose= poseo;
- arm->flag= flago;
- armature_rebuild_pose(ob, ob->data);
- ob->flag |= OB_POSEMODE;
- ob->ipoflag= ipoflago;
-}
-
-/* ********************************** Armature Drawing - Main ************************* */
-
-/* called from drawobject.c, return 1 if nothing was drawn */
-int draw_armature(Base *base, int dt, int flag)
-{
- Object *ob= base->object;
- bArmature *arm= ob->data;
- int retval= 0;
-
- if(G.f & G_RENDER_SHADOW)
- return 1;
-
- if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) {
- /* we use color for solid lighting */
- glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
- glEnable(GL_COLOR_MATERIAL);
- glColor3ub(0,0,0); // clear spec
- glDisable(GL_COLOR_MATERIAL);
-
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); // only for lighting...
- }
-
- /* arm->flag is being used to detect mode... */
- /* editmode? */
- if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) {
- if(ob==G.obedit) arm->flag |= ARM_EDITMODE;
- draw_ebones(ob, dt);
- arm->flag &= ~ARM_EDITMODE;
- }
- else{
- /* Draw Pose */
- if(ob->pose && ob->pose->chanbase.first) {
- /* drawing posemode selection indices or colors only in these cases */
- if(!(base->flag & OB_FROMDUPLI)) {
- if(G.f & G_PICKSEL) {
- if(ob->flag & OB_POSEMODE)
- arm->flag |= ARM_POSEMODE;
- }
- else if(ob->flag & OB_POSEMODE) {
- if (arm->ghosttype == ARM_GHOST_RANGE) {
- draw_ghost_poses_range(base);
- }
- else if (arm->ghosttype == ARM_GHOST_KEYS) {
- draw_ghost_poses_keys(base);
- }
- else if (arm->ghosttype == ARM_GHOST_CUR) {
- if (arm->ghostep)
- draw_ghost_poses(base);
- }
- if ((flag & DRAW_SCENESET)==0) {
- if(ob==OBACT)
- arm->flag |= ARM_POSEMODE;
- else if(G.f & G_WEIGHTPAINT)
- arm->flag |= ARM_POSEMODE;
-
- draw_pose_paths(ob);
- }
- }
- }
- draw_pose_channels(base, dt);
- arm->flag &= ~ARM_POSEMODE;
-
- if(ob->flag & OB_POSEMODE)
- BIF_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */
- }
- else retval= 1;
- }
- /* restore */
- glFrontFace(GL_CCW);
-
- return retval;
-}
-
-/* *************** END Armature drawing ******************* */
-
-
diff --git a/source/blender/src/drawdeps.c b/source/blender/src/drawdeps.c
deleted file mode 100644
index d64d6427bd1..00000000000
--- a/source/blender/src/drawdeps.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef _WIN32
-#include "BLI_winstuff.h"
-#endif
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_ID.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_action_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_interface.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-
-#include "BIF_oops.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_drawoops.h"
-#include "MEM_guardedalloc.h"
-#include "blendef.h"
-
-
-#include "depsgraph_private.h"
-
-#ifdef WIN32
-#else
-#include <sys/time.h>
-#endif
-
-
-
-void boundbox_deps()
-{
- DagNode *node;
- float min[2], max[2];
-
- if(G.soops==0) return;
-
- min[0]= 1000.0;
- max[0]= -10000.0;
- min[1]= 1000.0;
- max[1]= -1000.0;
-
- node = getMainDag()->DagNode.first;
- while(node) {
- min[0]= MIN2(min[0], node->x);
- max[0]= MAX2(max[0], node->x+OOPSX);
- min[1]= MIN2(min[1], node->y);
- max[1]= MAX2(max[1], node->y+OOPSY);
-
- node= node->next;
- }
-
- G.v2d->tot.xmin= min[0];
- G.v2d->tot.xmax= max[0];
- G.v2d->tot.ymin= min[1];
- G.v2d->tot.ymax= max[1];
-}
-
-static unsigned int get_line_color(DagAdjList *child)
-{
- switch (child->type) {
- case DAG_RL_SCENE :
- return 0x00000;
- case DAG_RL_DATA :
- return 0xFF0000;
- case DAG_RL_OB_OB :
- return 0x00FF00;
- case DAG_RL_OB_DATA :
- return 0xFFFF00;
- case DAG_RL_DATA_OB :
- return 0x000000;
- case DAG_RL_DATA_DATA :
- return 0x0000FF;
- default :
- return 0xFF00FF;
- }
- //return 0x00000;
-}
-
-
-static void draw_deps(DagNode *node)
-{
- float v1[2], x1, y1, x2, y2;
- unsigned int body, border;
- short line= 0;
- char str[32];
- DagAdjList *itA = node->child;
-
- x1= node->x;
- x2= node->x+DEPSX;
- y1= node->y;
- y2= node->y+DEPSY;
-
- if(x2 < G.v2d->cur.xmin || x1 > G.v2d->cur.xmax) return;
- if(y2 < G.v2d->cur.ymin || y1 > G.v2d->cur.ymax) return;
-
- body = give_oops_color(node->type, 0, &border);
-
- line= 0;
-// border= 00;
- cpack(body);
-
- glRectf(x1, y1, x2, y2);
-
- v1[0]= x1;
- v1[1]= (y1+y2)/2 -0.3f;
- sprintf(str, " %s", ((ID *) node->ob)->name+2);
-
- calc_oopstext(str, v1);
-
- /* ICON */
-// if(str[1] && oopscalex>1.1) {
- draw_icon_oops(v1, node->type);
-// }
-
-
- cpack(0x0);
- glRasterPos3f(v1[0], v1[1], 0.0);
- BMF_DrawString(G.fonts, str);
-
-
- if(line) setlinestyle(2);
- cpack(border);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glRectf(x1, y1, x2, y2);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- if(line) setlinestyle(0);
-
- while (itA) { /* draw connection lines */
- cpack(get_line_color(itA));
- glBegin(GL_LINE_STRIP);
- glVertex2f(node->x+DEPSX, node->y+ 0.5*DEPSY);
- glVertex2f(itA->node->x, itA->node->y+ 0.5*DEPSY);
- glEnd();
- itA = itA->next;
- }
- /* Draw the little rounded connection point */
- glColor3ub(0, 0, 0);
- glPushMatrix();
-
- glTranslatef(node->x , node->y+ 0.5*DEPSY, 0.0);
- glutil_draw_filled_arc(-M_PI/2, M_PI, 0.07*DEPSX, 7);
-
- glPopMatrix();
-
-}
-
-void draw_all_deps(void)
-{
- DagNode *node;
- DagForest *dag;
-
- dag = getMainDag();
- node = dag->DagNode.first;
- //node = node->next;
- while(node) {
- draw_deps(node);
- node = node->next;
- }
- free_forest(dag);
- MEM_freeN(dag);
- setMainDag(NULL);
-}
-
-
-
-
-int build_deps(short mask)
-{
- Base *base;
- Object *ob = NULL;
- DagNode * node = NULL;
- DagNode * node2 = NULL ;
-DagNode * scenenode;
- DagForest *dag;
-
-#ifdef DEPS_DEBUG
- //timers
- struct timeval tp1, tp2, tp3, tp4;
-
- gettimeofday(&tp1,NULL);
-#endif
-
- DagNodeQueue *retqueue;
-
-// float y = 0;
-// int maxlev = 0;
-
- if(G.soops==0) return -1;
-
-
- // rebuilt each time for now
- dag = getMainDag();
- if ( dag)
- free_forest( dag );
- else {
- dag = dag_init();
- setMainDag(dag);
- }
-
- // add base node for scene. scene is always the first node in DAG
- scenenode = dag_add_node(dag, G.scene);
- set_node_xy(scenenode,0.0, 0.0);
- /* blocks from this scene */
-
-
- /* targets in object struct yet to be added. should even they ?
- struct Ipo *ipo;
- ListBase nlastrips;
- ListBase hooks;
- */
-
-
- base= FIRSTBASE;
- while(base) { // add all objects in any case
- int addtoroot = 1;
-
- // graph_print_adj_list();
- ob= (Object *) base->object;
-
- node = dag_get_node(dag,ob);
-
- if ((ob->data) && (mask&DAG_RL_DATA)) {
- node2 = dag_get_node(dag,ob->data);
- dag_add_relation(dag,node,node2,DAG_RL_DATA, "Object-Data Relation");
- node2->first_ancestor = ob;
- node2->ancestor_count += 1;
-
- }
-
- if (addtoroot == 1 )
- dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, "Scene Relation");
-
- base= base->next;
- }
-
-//graph_print_adj_list();
-//fprintf(stderr,"building deps\n");
-#ifdef DEPS_DEBUG
- gettimeofday(&tp2,NULL);
-#endif
-
-//graph_bfs(); //set levels
-
-#ifdef DEPS_DEBUG
-gettimeofday(&tp3,NULL);
-#endif
-
-
-retqueue = graph_dfs(); //set levels
-#ifdef DEPS_DEBUG
-gettimeofday(&tp4,NULL);
-fprintf(stderr,"************************************\n");
-graph_print_queue_dist(retqueue);
-//graph_print_queue(retqueue);
-
-fprintf(stderr,"TIME BUILD %d %d BFS %d %d DFS %d %d\n",tp2.tv_sec-tp1.tv_sec ,tp2.tv_usec-tp1.tv_usec
- , tp3.tv_sec-tp2.tv_sec ,tp3.tv_usec-tp2.tv_usec
- , tp4.tv_sec-tp3.tv_sec ,tp4.tv_usec-tp3.tv_usec);
-#endif
-
-queue_delete(retqueue);
-
-//graph_print_adj_list();
-return 0;
-}
diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c
deleted file mode 100644
index 1b3d869b2f8..00000000000
--- a/source/blender/src/drawgpencil.c
+++ /dev/null
@@ -1,1045 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "DNA_listBase.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_blender.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_butspace.h"
-#include "BIF_drawseq.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_toets.h"
-
-#include "BDR_gpencil.h"
-#include "BIF_drawgpencil.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-#include "butspace.h"
-
-#include "PIL_time.h"
-#include "mydevice.h"
-
-/* ************************************************** */
-/* GREASE PENCIL PANEL-UI DRAWING */
-
-/* Every space which implements Grease-Pencil functionality should have a panel
- * for the settings. All of the space-dependent parts should be coded in the panel
- * code for that space, but the rest is all handled by generic panel here.
- */
-
-/* ------- Callbacks ----------- */
-/* These are just 'dummy wrappers' around gpencil api calls */
-
-/* make layer active one after being clicked on */
-void gp_ui_activelayer_cb (void *gpd, void *gpl)
-{
- gpencil_layer_setactive(gpd, gpl);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* rename layer and set active */
-void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg)
-{
- bGPdata *gpd= (bGPdata *)gpd_arg;
- bGPDlayer *gpl= (bGPDlayer *)gpl_arg;
-
- BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128);
- gpencil_layer_setactive(gpd, gpl);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* add a new layer */
-void gp_ui_addlayer_cb (void *gpd, void *dummy)
-{
- gpencil_layer_addnew(gpd);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* delete active layer */
-void gp_ui_dellayer_cb (void *gpd, void *dummy)
-{
- gpencil_layer_delactive(gpd);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* delete last stroke of active layer */
-void gp_ui_delstroke_cb (void *gpd, void *gpl)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- gpencil_layer_setactive(gpd, gpl);
- gpencil_frame_delete_laststroke(gpf);
-
- scrarea_queue_winredraw(curarea);
-}
-
-/* delete active frame of active layer */
-void gp_ui_delframe_cb (void *gpd, void *gpl)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- gpencil_layer_setactive(gpd, gpl);
- gpencil_layer_delframe(gpl, gpf);
-
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWACTION, 0);
-}
-
-/* convert the active layer to geometry */
-void gp_ui_convertlayer_cb (void *gpd, void *gpl)
-{
- gpencil_layer_setactive(gpd, gpl);
- gpencil_convert_menu();
-
- scrarea_queue_winredraw(curarea);
-}
-
-/* ------- Drawing Code ------- */
-
-/* draw the controls for a given layer */
-static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco)
-{
- uiBut *but;
- short active= (gpl->flag & GP_LAYER_ACTIVE);
- short width= 314;
- short height;
- int rb_col;
-
- /* unless button has own callback, it adds this callback to button */
- uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl);
-
- /* draw header */
- {
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- /* rounded header */
- if (active) uiBlockSetCol(block, TH_BUT_ACTION);
- rb_col= (active)?-20:20;
- uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), "");
- if (active) uiBlockSetCol(block, TH_AUTO);
-
- /* lock toggle */
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified");
- }
-
- /* when layer is locked or hidden, only draw header */
- if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
- char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */
-
- height= 0;
-
- /* visibility button (only if hidden but not locked!) */
- if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
-
- /* name */
- if (gpl->flag & GP_LAYER_HIDE)
- sprintf(name, "%s (Hidden)", gpl->info);
- else
- sprintf(name, "%s (Locked)", gpl->info);
- uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)");
-
- /* delete button (only if hidden but not locked!) */
- if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) {
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL);
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- else {
- height= 97;
-
- /* draw rest of header */
- {
- /* visibility button */
- uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer");
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* name */
- but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)");
- uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl);
-
- /* delete 'button' */
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
-
- /* draw backdrop */
- if (active) uiBlockSetCol(block, TH_BUT_ACTION);
- uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, "");
- if (active) uiBlockSetCol(block, TH_AUTO);
-
- /* draw settings */
- {
- /* color */
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer");
- uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3f, 1.0f, 0, 0, "Visibility of stroke (0.3 to 1.0)");
- uiBlockEndAlign(block);
-
- /* stroke thickness */
- uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)");
-
- /* debugging options */
- if (G.f & G_DEBUG) {
- uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes");
- }
-
- /* onion-skinning */
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame");
- uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)");
- uiBlockEndAlign(block);
-
- /* options */
- uiBlockBeginAlign(block);
- if (curarea->spacetype == SPACE_VIEW3D) {
- but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)");
- uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl);
- }
- else {
- but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)");
- uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl);
- }
-
- but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)");
- uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl);
- uiBlockEndAlign(block);
- }
- }
-
- /* adjust height for new to start */
- (*yco) -= (height + 27);
-}
-
-/* Draw the contents for a grease-pencil panel. This assumes several things:
- * - that panel has been created, is 318 x 204. max yco is 225
- * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225)
- * which is basically the top left-hand corner
- * It will return the amount of extra space to extend the panel by
- */
-short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa)
-{
- uiBut *but;
- bGPDlayer *gpl;
- short xco= 10, yco= 170;
-
- /* draw gpd settings first */
- {
- /* add new layer buttons */
- but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer");
- uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL);
-
-
- /* show override lmb-clicks button + painting lock */
- uiBlockBeginAlign(block);
- if ((gpd->flag & GP_DATA_EDITPAINT)==0) {
- uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
-
- uiBlockSetCol(block, TH_BUT_SETTING);
- uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)");
- uiBlockSetCol(block, TH_AUTO);
- }
- else
- uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes");
- uiBlockEndAlign(block);
-
- /* 'view align' button (naming depends on context) */
- if (sa->spacetype == SPACE_VIEW3D)
- uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space");
- else
- uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas");
- }
-
- /* draw for each layer */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- gp_drawui_layer(block, gpd, gpl, &xco, &yco);
- }
-
- /* return new height if necessary */
- return (yco < 0) ? (204 - yco) : 204;
-}
-
-/* ************************************************** */
-/* GREASE PENCIL DRAWING */
-
-/* ----- General Defines ------ */
-
-/* flags for sflag */
-enum {
- GP_DRAWDATA_NOSTATUS = (1<<0), /* don't draw status info */
- GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */
- GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */
- GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */
-};
-
-/* thickness above which we should use special drawing */
-#define GP_DRAWTHICKNESS_SPECIAL 3
-
-/* ----- Tool Buffer Drawing ------ */
-
-/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted lines) */
-static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thickness, short dflag, short sflag)
-{
- tGPspoint *pt;
- int i;
-
- /* error checking */
- if ((points == NULL) || (totpoints <= 0))
- return;
-
- /* check if buffer can be drawn */
- if (dflag & (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_ONLYV2D))
- return;
-
- /* if drawing a single point, draw it larger */
- if (totpoints == 1) {
- /* draw point */
- glBegin(GL_POINTS);
- glVertex2f(points->x, points->y);
- glEnd();
- }
- else if (sflag & GP_STROKE_ERASER) {
- /* don't draw stroke at all! */
- }
- else {
- float oldpressure = 0.0f;
-
- /* draw stroke curve */
- if (G.f & G_DEBUG) setlinestyle(2);
-
- glBegin(GL_LINE_STRIP);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- if (fabs(pt->pressure - oldpressure) > 0.2f) {
- glEnd();
- glLineWidth(pt->pressure * thickness);
- glBegin(GL_LINE_STRIP);
-
- glVertex2f(pt->x, pt->y);
-
- oldpressure = pt->pressure;
- }
- else
- glVertex2f(pt->x, pt->y);
- }
- glEnd();
-
- if (G.f & G_DEBUG) setlinestyle(0);
- }
-}
-
-/* ----- Existing Strokes Drawing (3D and Point) ------ */
-
-/* draw a given stroke - just a single dot (only one point) */
-static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy)
-{
- /* draw point */
- if (sflag & GP_STROKE_3DSPACE) {
- glBegin(GL_POINTS);
- glVertex3f(points->x, points->y, points->z);
- glEnd();
- }
- else {
- float co[2];
-
- /* get coordinates of point */
- if (sflag & GP_STROKE_2DSPACE) {
- co[0]= points->x;
- co[1]= points->y;
- }
- else if (sflag & GP_STROKE_2DIMAGE) {
- co[0]= (points->x * winx) + offsx;
- co[1]= (points->y * winy) + offsy;
- }
- else {
- co[0]= (points->x / 1000 * winx);
- co[1]= (points->y / 1000 * winy);
- }
-
- /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok
- * - also mandatory in if Image Editor 'image-based' dot
- */
- if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
- ((curarea->spacetype==SPACE_IMAGE) && (sflag & GP_STROKE_2DSPACE)) )
- {
- glBegin(GL_POINTS);
- glVertex2fv(co);
- glEnd();
- }
- else
- {
- /* draw filled circle as is done in circf (but without the matrix push/pops which screwed things up) */
- GLUquadricObj *qobj = gluNewQuadric();
-
- gluQuadricDrawStyle(qobj, GLU_FILL);
-
- /* need to translate drawing position, but must reset after too! */
- glTranslatef(co[0], co[1], 0.);
- gluDisk(qobj, 0.0, thickness, 32, 1);
- glTranslatef(-co[0], -co[1], 0.);
-
- gluDeleteQuadric(qobj);
- }
- }
-}
-
-/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
-static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int winx, int winy)
-{
- bGPDspoint *pt;
- float oldpressure = 0.0f;
- int i;
-
- /* draw stroke curve */
- glBegin(GL_LINE_STRIP);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- if (fabs(pt->pressure - oldpressure) > 0.2f) {
- glEnd();
- glLineWidth(pt->pressure * thickness);
- glBegin(GL_LINE_STRIP);
-
- glVertex3f(pt->x, pt->y, pt->z);
-
- oldpressure = pt->pressure;
- }
- else
- glVertex3f(pt->x, pt->y, pt->z);
- }
- glEnd();
-
- /* draw debug points of curve on top? */
- if (debug) {
- glBegin(GL_POINTS);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++)
- glVertex3f(pt->x, pt->y, pt->z);
- glEnd();
- }
-}
-
-/* ----- Fancy 2D-Stroke Drawing ------ */
-
-/* draw a given stroke in 2d */
-static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag,
- short debug, int offsx, int offsy, int winx, int winy)
-{
- /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better
- * - 'smooth' opengl lines are also required if Image Editor 'image-based' stroke
- */
- if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) ||
- ((curarea->spacetype==SPACE_IMAGE) && (dflag & GP_DRAWDATA_ONLYV2D)) )
- {
- bGPDspoint *pt;
- int i;
-
- glBegin(GL_LINE_STRIP);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- if (sflag & GP_STROKE_2DSPACE) {
- glVertex2f(pt->x, pt->y);
- }
- else if (sflag & GP_STROKE_2DIMAGE) {
- const float x= (pt->x * winx) + offsx;
- const float y= (pt->y * winy) + offsy;
-
- glVertex2f(x, y);
- }
- else {
- const float x= (pt->x / 1000 * winx);
- const float y= (pt->y / 1000 * winy);
-
- glVertex2f(x, y);
- }
- }
- glEnd();
- }
-
- /* tesselation code - draw stroke as series of connected quads with connection
- * edges rotated to minimise shrinking artifacts, and rounded endcaps
- */
- else
- {
- bGPDspoint *pt1, *pt2;
- float pm[2];
- int i;
-
- glShadeModel(GL_FLAT);
- glBegin(GL_QUADS);
-
- for (i=0, pt1=points, pt2=points+1; i < (totpoints-1); i++, pt1++, pt2++) {
- float s0[2], s1[2]; /* segment 'center' points */
- float t0[2], t1[2]; /* tesselated coordinates */
- float m1[2], m2[2]; /* gradient and normal */
- float mt[2], sc[2]; /* gradient for thickness, point for end-cap */
- float pthick; /* thickness at segment point */
-
- /* get x and y coordinates from points */
- if (sflag & GP_STROKE_2DSPACE) {
- s0[0]= pt1->x; s0[1]= pt1->y;
- s1[0]= pt2->x; s1[1]= pt2->y;
- }
- else if (sflag & GP_STROKE_2DIMAGE) {
- s0[0]= (pt1->x * winx) + offsx;
- s0[1]= (pt1->y * winy) + offsy;
- s1[0]= (pt2->x * winx) + offsx;
- s1[1]= (pt2->y * winy) + offsy;
- }
- else {
- s0[0]= (pt1->x / 1000 * winx);
- s0[1]= (pt1->y / 1000 * winy);
- s1[0]= (pt2->x / 1000 * winx);
- s1[1]= (pt2->y / 1000 * winy);
- }
-
- /* calculate gradient and normal - 'angle'=(ny/nx) */
- m1[1]= s1[1] - s0[1];
- m1[0]= s1[0] - s0[0];
- Normalize2(m1);
- m2[1]= -m1[0];
- m2[0]= m1[1];
-
- /* always use pressure from first point here */
- pthick= (pt1->pressure * thickness);
-
- /* if the first segment, start of segment is segment's normal */
- if (i == 0) {
- /* draw start cap first
- * - make points slightly closer to center (about halfway across)
- */
- mt[0]= m2[0] * pthick * 0.5f;
- mt[1]= m2[1] * pthick * 0.5f;
- sc[0]= s0[0] - (m1[0] * pthick * 0.75f);
- sc[1]= s0[1] - (m1[1] * pthick * 0.75f);
-
- t0[0]= sc[0] - mt[0];
- t0[1]= sc[1] - mt[1];
- t1[0]= sc[0] + mt[0];
- t1[1]= sc[1] + mt[1];
-
- glVertex2fv(t0);
- glVertex2fv(t1);
-
- /* calculate points for start of segment */
- mt[0]= m2[0] * pthick;
- mt[1]= m2[1] * pthick;
-
- t0[0]= s0[0] - mt[0];
- t0[1]= s0[1] - mt[1];
- t1[0]= s0[0] + mt[0];
- t1[1]= s0[1] + mt[1];
-
- /* draw this line twice (first to finish off start cap, then for stroke) */
- glVertex2fv(t1);
- glVertex2fv(t0);
- glVertex2fv(t0);
- glVertex2fv(t1);
- }
- /* if not the first segment, use bisector of angle between segments */
- else {
- float mb[2]; /* bisector normal */
- float athick, dfac; /* actual thickness, difference between thicknesses */
-
- /* calculate gradient of bisector (as average of normals) */
- mb[0]= (pm[0] + m2[0]) / 2;
- mb[1]= (pm[1] + m2[1]) / 2;
- Normalize2(mb);
-
- /* calculate gradient to apply
- * - as basis, use just pthick * bisector gradient
- * - if cross-section not as thick as it should be, add extra padding to fix it
- */
- mt[0]= mb[0] * pthick;
- mt[1]= mb[1] * pthick;
- athick= Vec2Length(mt);
- dfac= pthick - (athick * 2);
- if ( ((athick * 2) < pthick) && (IS_EQ(athick, pthick)==0) )
- {
- mt[0] += (mb[0] * dfac);
- mt[1] += (mb[1] * dfac);
- }
-
- /* calculate points for start of segment */
- t0[0]= s0[0] - mt[0];
- t0[1]= s0[1] - mt[1];
- t1[0]= s0[0] + mt[0];
- t1[1]= s0[1] + mt[1];
-
- /* draw this line twice (once for end of current segment, and once for start of next) */
- glVertex2fv(t1);
- glVertex2fv(t0);
- glVertex2fv(t0);
- glVertex2fv(t1);
- }
-
- /* if last segment, also draw end of segment (defined as segment's normal) */
- if (i == totpoints-2) {
- /* for once, we use second point's pressure (otherwise it won't be drawn) */
- pthick= (pt2->pressure * thickness);
-
- /* calculate points for end of segment */
- mt[0]= m2[0] * pthick;
- mt[1]= m2[1] * pthick;
-
- t0[0]= s1[0] - mt[0];
- t0[1]= s1[1] - mt[1];
- t1[0]= s1[0] + mt[0];
- t1[1]= s1[1] + mt[1];
-
- /* draw this line twice (once for end of stroke, and once for endcap)*/
- glVertex2fv(t1);
- glVertex2fv(t0);
- glVertex2fv(t0);
- glVertex2fv(t1);
-
-
- /* draw end cap as last step
- * - make points slightly closer to center (about halfway across)
- */
- mt[0]= m2[0] * pthick * 0.5f;
- mt[1]= m2[1] * pthick * 0.5f;
- sc[0]= s1[0] + (m1[0] * pthick * 0.75f);
- sc[1]= s1[1] + (m1[1] * pthick * 0.75f);
-
- t0[0]= sc[0] - mt[0];
- t0[1]= sc[1] - mt[1];
- t1[0]= sc[0] + mt[0];
- t1[1]= sc[1] + mt[1];
-
- glVertex2fv(t1);
- glVertex2fv(t0);
- }
-
- /* store stroke's 'natural' normal for next stroke to use */
- Vec2Copyf(pm, m2);
- }
-
- glEnd();
- }
-
- /* draw debug points of curve on top? (original stroke points) */
- if (debug) {
- bGPDspoint *pt;
- int i;
-
- glBegin(GL_POINTS);
- for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
- if (sflag & GP_STROKE_2DSPACE) {
- glVertex2f(pt->x, pt->y);
- }
- else if (sflag & GP_STROKE_2DIMAGE) {
- const float x= (float)((pt->x * winx) + offsx);
- const float y= (float)((pt->y * winy) + offsy);
-
- glVertex2f(x, y);
- }
- else {
- const float x= (float)(pt->x / 1000 * winx);
- const float y= (float)(pt->y / 1000 * winy);
-
- glVertex2f(x, y);
- }
- }
- glEnd();
- }
-}
-
-/* ----- General Drawing ------ */
-
-/* draw a set of strokes */
-static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag,
- short debug, short lthick, float color[4])
-{
- bGPDstroke *gps;
-
- /* set color first (may need to reset it again later too) */
- glColor4f(color[0], color[1], color[2], color[3]);
-
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- /* check if stroke can be drawn - checks here generally fall into pairs */
- if ((dflag & GP_DRAWDATA_ONLY3D) && !(gps->flag & GP_STROKE_3DSPACE))
- continue;
- if (!(dflag & GP_DRAWDATA_ONLY3D) && (gps->flag & GP_STROKE_3DSPACE))
- continue;
- if ((dflag & GP_DRAWDATA_ONLYV2D) && !(gps->flag & GP_STROKE_2DSPACE))
- continue;
- if (!(dflag & GP_DRAWDATA_ONLYV2D) && (gps->flag & GP_STROKE_2DSPACE))
- continue;
- if ((dflag & GP_DRAWDATA_ONLYI2D) && !(gps->flag & GP_STROKE_2DIMAGE))
- continue;
- if (!(dflag & GP_DRAWDATA_ONLYI2D) && (gps->flag & GP_STROKE_2DIMAGE))
- continue;
- if ((gps->points == 0) || (gps->totpoints < 1))
- continue;
-
- /* check which stroke-drawer to use */
- if (gps->totpoints == 1)
- gp_draw_stroke_point(gps->points, lthick, gps->flag, offsx, offsy, winx, winy);
- else if (dflag & GP_DRAWDATA_ONLY3D)
- gp_draw_stroke_3d(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, winx, winy);
- else if (gps->totpoints > 1)
- gp_draw_stroke(gps->points, gps->totpoints, lthick, dflag, gps->flag, debug, offsx, offsy, winx, winy);
- }
-}
-
-/* draw grease-pencil datablock */
-static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy, int dflag)
-{
- bGPDlayer *gpl, *actlay=NULL;
-
- /* turn on smooth lines (i.e. anti-aliasing) */
- glEnable(GL_LINE_SMOOTH);
-
- /* turn on alpha-blending */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* loop over layers, drawing them */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- bGPDframe *gpf;
-
- short debug = (gpl->flag & GP_LAYER_DRAWDEBUG) ? 1 : 0;
- short lthick= gpl->thickness;
- float color[4], tcolor[4];
-
- /* don't draw layer if hidden */
- if (gpl->flag & GP_LAYER_HIDE)
- continue;
-
- /* if layer is active one, store pointer to it */
- if (gpl->flag & GP_LAYER_ACTIVE)
- actlay= gpl;
-
- /* get frame to draw */
- gpf= gpencil_layer_getframe(gpl, CFRA, 0);
- if (gpf == NULL)
- continue;
-
- /* set color, stroke thickness, and point size */
- glLineWidth(lthick);
- QUATCOPY(color, gpl->color); // just for copying 4 array elements
- QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting)
- glColor4f(color[0], color[1], color[2], color[3]);
- glPointSize((float)(gpl->thickness + 2));
-
- /* draw 'onionskins' (frame left + right) */
- if (gpl->flag & GP_LAYER_ONIONSKIN) {
- /* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/
- if (gpl->gstep) {
- bGPDframe *gf;
- float fac;
-
- /* draw previous frames first */
- for (gf=gpf->prev; gf; gf=gf->prev) {
- /* check if frame is drawable */
- if ((gpf->framenum - gf->framenum) <= gpl->gstep) {
- /* alpha decreases with distance from curframe index */
- fac= (float)(gpf->framenum - gf->framenum) / (float)gpl->gstep;
- tcolor[3] = color[3] - fac;
- gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
- }
- else
- break;
- }
-
- /* now draw next frames */
- for (gf= gpf->next; gf; gf=gf->next) {
- /* check if frame is drawable */
- if ((gf->framenum - gpf->framenum) <= gpl->gstep) {
- /* alpha decreases with distance from curframe index */
- fac= (float)(gf->framenum - gpf->framenum) / (float)gpl->gstep;
- tcolor[3] = color[3] - fac;
- gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
- }
- else
- break;
- }
-
- /* restore alpha */
- glColor4f(color[0], color[1], color[2], color[3]);
- }
- else {
- /* draw the strokes for the ghost frames (at half of the alpha set by user) */
- if (gpf->prev) {
- tcolor[3] = (color[3] / 7);
- gp_draw_strokes(gpf->prev, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
- }
-
- if (gpf->next) {
- tcolor[3] = (color[3] / 4);
- gp_draw_strokes(gpf->next, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
- }
-
- /* restore alpha */
- glColor4f(color[0], color[1], color[2], color[3]);
- }
- }
-
- /* draw the strokes already in active frame */
- tcolor[3]= color[3];
- gp_draw_strokes(gpf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
-
- /* Check if may need to draw the active stroke cache, only if this layer is the active layer
- * that is being edited. (Stroke buffer is currently stored in gp-data)
- */
- if ((G.f & G_GREASEPENCIL) && (gpl->flag & GP_LAYER_ACTIVE) &&
- (gpf->flag & GP_FRAME_PAINT))
- {
- /* Buffer stroke needs to be drawn with a different linestyle to help differentiate them from normal strokes. */
- gp_draw_stroke_buffer(gpd->sbuffer, gpd->sbuffer_size, lthick, dflag, gpd->sbuffer_sflag);
- }
- }
-
- /* turn off alpha blending, then smooth lines */
- glDisable(GL_BLEND); // alpha blending
- glDisable(GL_LINE_SMOOTH); // smooth lines
-
- /* show info for debugging the status of gpencil */
- if ( ((dflag & GP_DRAWDATA_NOSTATUS)==0) && (gpd->flag & GP_DATA_DISPINFO) ) {
- char printable[256];
- short xmax;
-
- /* get text to display */
- if (actlay) {
- if (gpd->flag & GP_DATA_EDITPAINT)
- BIF_ThemeColor(TH_BONE_POSE); // should be blue-ish
- else if (actlay->actframe == NULL)
- BIF_ThemeColor(TH_REDALERT);
- else if (actlay->actframe->framenum == CFRA)
- BIF_ThemeColor(TH_VERTEX_SELECT); // should be yellow
- else
- BIF_ThemeColor(TH_TEXT_HI);
-
- if (actlay->actframe) {
- sprintf(printable, "GPencil: Layer ('%s'), Frame (%d)%s",
- actlay->info, actlay->actframe->framenum,
- ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") );
- }
- else {
- sprintf(printable, "GPencil: Layer ('%s'), Frame <None>%s",
- actlay->info, ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") );
- }
- }
- else {
- BIF_ThemeColor(TH_REDALERT);
- sprintf(printable, "GPencil: Layer <None>");
- }
- xmax= GetButStringLength(printable);
-
- /* only draw it if view is wide enough (assume padding of 20 is enough for now) */
- if (winx > (xmax + 20)) {
- glRasterPos2i(winx-xmax, winy-20);
- BMF_DrawString(G.fonts, printable);
- }
- }
-
- /* restore initial gl conditions */
- glLineWidth(1.0);
- glPointSize(1.0);
- glColor4f(0, 0, 0, 1);
-}
-
-/* ----- Grease Pencil Sketches Drawing API ------ */
-
-/* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
-void draw_gpencil_2dimage (ScrArea *sa, ImBuf *ibuf)
-{
- bGPdata *gpd;
- int offsx, offsy, sizex, sizey;
- int dflag = GP_DRAWDATA_NOSTATUS;
-
- /* check that we have grease-pencil stuff to draw */
- if (ELEM(NULL, sa, ibuf)) return;
- gpd= gpencil_data_getactive(sa);
- if (gpd == NULL) return;
-
- /* calculate rect */
- switch (sa->spacetype) {
- case SPACE_IMAGE: /* image */
- {
- SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
-
- /* just draw using standard scaling (settings here are currently ignored anyways) */
- // FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled
- offsx= 0;
- offsy= 0;
- sizex= sa->winx;
- sizey= sa->winy;
-
- myortho2(sima->v2d.cur.xmin, sima->v2d.cur.xmax, sima->v2d.cur.ymin, sima->v2d.cur.ymax);
-
- dflag |= GP_DRAWDATA_ONLYV2D;
- }
- break;
-
- case SPACE_SEQ: /* sequence */
- {
- SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first;
- float zoom, zoomx, zoomy;
-
- /* calculate accessory values */
- zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom));
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
- zoomy = zoom;
- }
- else
- zoomx = zoomy = zoom;
-
- /* calculate transforms (Note: we use ibuf here, as we have it) */
- sizex= (int)(zoomx * ibuf->x);
- sizey= (int)(zoomy * ibuf->y);
- offsx= (int)( (sa->winx-sizex)/2 + sseq->xof );
- offsy= (int)( (sa->winy-sizey)/2 + sseq->yof );
-
- dflag |= GP_DRAWDATA_ONLYI2D;
- }
- break;
-
- default: /* for spacetype not yet handled */
- offsx= 0;
- offsy= 0;
- sizex= sa->winx;
- sizey= sa->winy;
-
- dflag |= GP_DRAWDATA_ONLYI2D;
- break;
- }
-
-
- /* draw it! */
- gp_draw_data(gpd, offsx, offsy, sizex, sizey, dflag);
-}
-
-/* draw grease-pencil sketches to specified 2d-view assuming that matrices are already set correctly
- * Note: this gets called twice - first time with onlyv2d=1 to draw 'canvas' strokes, second time with onlyv2d=0 for screen-aligned strokes
- */
-void draw_gpencil_2dview (ScrArea *sa, short onlyv2d)
-{
- bGPdata *gpd;
- int dflag = 0;
-
- /* check that we have grease-pencil stuff to draw */
- if (sa == NULL) return;
- gpd= gpencil_data_getactive(sa);
- if (gpd == NULL) return;
-
- /* draw it! */
- if (onlyv2d) dflag |= (GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_NOSTATUS);
- gp_draw_data(gpd, 0, 0, sa->winx, sa->winy, dflag);
-}
-
-/* draw grease-pencil sketches to specified 3d-view assuming that matrices are already set correctly
- * Note: this gets called twice - first time with only3d=1 to draw 3d-strokes, second time with only3d=0 for screen-aligned strokes
- */
-void draw_gpencil_3dview (ScrArea *sa, short only3d)
-{
- bGPdata *gpd;
- int dflag = 0;
-
- /* check that we have grease-pencil stuff to draw */
- gpd= gpencil_data_getactive(sa);
- if (gpd == NULL) return;
-
- /* draw it! */
- if (only3d) dflag |= (GP_DRAWDATA_ONLY3D|GP_DRAWDATA_NOSTATUS);
- gp_draw_data(gpd, 0, 0, sa->winx, sa->winy, dflag);
-}
-
-/* draw grease-pencil sketches to opengl render window assuming that matrices are already set correctly */
-void draw_gpencil_oglrender (View3D *v3d, int winx, int winy)
-{
- bGPdata *gpd;
-
- /* assume gpencil data comes from v3d */
- if (v3d == NULL) return;
- gpd= v3d->gpd;
- if (gpd == NULL) return;
-
- /* pass 1: draw 3d-strokes ------------ > */
- gp_draw_data(gpd, 0, 0, winx, winy, (GP_DRAWDATA_NOSTATUS|GP_DRAWDATA_ONLY3D));
-
- /* pass 2: draw 2d-strokes ------------ > */
- /* adjust view matrices */
- myortho2(-0.375f, (float)(winx)-0.375f, -0.375f, (float)(winy)-0.375f);
- glLoadIdentity();
-
- /* draw it! */
- gp_draw_data(gpd, 0, 0, winx, winy, GP_DRAWDATA_NOSTATUS);
-}
-
-/* ************************************************** */
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
deleted file mode 100644
index 84236a0701a..00000000000
--- a/source/blender/src/drawimage.c
+++ /dev/null
@@ -1,2903 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Blender Foundation, 2002-2006
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_color_types.h"
-#include "DNA_image_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_packedFile_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_brush.h"
-#include "BKE_colortools.h"
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_image.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_object.h"
-
-#include "BDR_editface.h"
-#include "BDR_drawobject.h"
-#include "BDR_drawmesh.h"
-#include "BDR_gpencil.h"
-#include "BDR_imagepaint.h"
-
-#include "BIF_cursors.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_mywindow.h"
-#include "BIF_drawimage.h"
-#include "BIF_drawgpencil.h"
-#include "BIF_resources.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_editsima.h"
-#include "BIF_glutil.h"
-#include "BIF_renderwin.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-#include "BIF_editmesh.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-
-#include "RE_pipeline.h"
-#include "BMF_Api.h"
-
-#include "PIL_time.h"
-
-/* Modules used */
-#include "mydevice.h"
-#include "blendef.h"
-#include "butspace.h" // event codes
-#include "winlay.h"
-
-#include "interface.h" /* bad.... but preview code needs UI info. Will solve... (ton) */
-
-static unsigned char *alloc_alpha_clone_image(int *width, int *height)
-{
- Brush *brush = G.scene->toolsettings->imapaint.brush;
- ImBuf *ibuf;
- unsigned int size, alpha;
- unsigned char *rect, *cp;
-
- if(!brush || !brush->clone.image)
- return NULL;
-
- ibuf= BKE_image_get_ibuf(brush->clone.image, NULL);
-
- if(!ibuf || !ibuf->rect)
- return NULL;
-
- rect= MEM_dupallocN(ibuf->rect);
- if(!rect)
- return NULL;
-
- *width= ibuf->x;
- *height= ibuf->y;
-
- size= (*width)*(*height);
- alpha= (unsigned char)255*brush->clone.alpha;
- cp= rect;
-
- while(size-- > 0) {
- cp[3]= alpha;
- cp += 4;
- }
-
- return rect;
-}
-
-static int image_preview_active(ScrArea *sa, float *xim, float *yim)
-{
- SpaceImage *sima= sa->spacedata.first;
-
- /* only when compositor shows, and image handler set */
- if(sima->image && sima->image->type==IMA_TYPE_COMPOSITE) {
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- if(sima->blockhandler[a] == IMAGE_HANDLER_PREVIEW) {
- if(xim) *xim= (G.scene->r.size*G.scene->r.xsch)/100;
- if(yim) *yim= (G.scene->r.size*G.scene->r.ysch)/100;
- return 1;
- }
- }
- }
- return 0;
-}
-
-
-/**
- * Sets up the fields of the View2D member of the SpaceImage struct
- * This routine can be called in two modes:
- * mode == 'f': float mode (0.0 - 1.0)
- * mode == 'p': pixel mode (0 - size)
- *
- * @param sima the image space to update
- * @param mode the mode to use for the update
- * @return void
- *
- */
-void calc_image_view(SpaceImage *sima, char mode)
-{
- float xim=256, yim=256;
- float x1, y1;
-
- if(image_preview_active(curarea, &xim, &yim));
- else if(sima->image) {
- ImBuf *ibuf= imagewindow_get_ibuf(sima);
- float xuser_asp, yuser_asp;
-
- image_pixel_aspect(sima->image, &xuser_asp, &yuser_asp);
- if(ibuf) {
- xim= ibuf->x * xuser_asp;
- yim= ibuf->y * yuser_asp;
- }
- else if( sima->image->type==IMA_TYPE_R_RESULT ) {
- /* not very important, just nice */
- xim= (G.scene->r.xsch*G.scene->r.size)/100;
- yim= (G.scene->r.ysch*G.scene->r.size)/100;
- }
- }
-
- sima->v2d.tot.xmin= 0;
- sima->v2d.tot.ymin= 0;
- sima->v2d.tot.xmax= xim;
- sima->v2d.tot.ymax= yim;
-
- sima->v2d.mask.xmin= sima->v2d.mask.ymin= 0;
- sima->v2d.mask.xmax= curarea->winx;
- sima->v2d.mask.ymax= curarea->winy;
-
-
- /* Which part of the image space do we see? */
- /* Same calculation as in lrectwrite: area left and down*/
- x1= curarea->winrct.xmin+(curarea->winx-sima->zoom*xim)/2;
- y1= curarea->winrct.ymin+(curarea->winy-sima->zoom*yim)/2;
-
- x1-= sima->zoom*sima->xof;
- y1-= sima->zoom*sima->yof;
-
- /* relative display right */
- sima->v2d.cur.xmin= ((curarea->winrct.xmin - (float)x1)/sima->zoom);
- sima->v2d.cur.xmax= sima->v2d.cur.xmin + ((float)curarea->winx/sima->zoom);
-
- /* relative display left */
- sima->v2d.cur.ymin= ((curarea->winrct.ymin-(float)y1)/sima->zoom);
- sima->v2d.cur.ymax= sima->v2d.cur.ymin + ((float)curarea->winy/sima->zoom);
-
- if(mode=='f') {
- sima->v2d.cur.xmin/= xim;
- sima->v2d.cur.xmax/= xim;
- sima->v2d.cur.ymin/= yim;
- sima->v2d.cur.ymax/= yim;
- }
-}
-
-/* check for facelesect, and set active image */
-void what_image(SpaceImage *sima)
-{
- if( (sima->mode!=SI_TEXTURE) ||
- (sima->image && sima->image->source==IMA_SRC_VIEWER) ||
- (G.obedit != OBACT) ||
- (G.editMesh==NULL) ||
- (sima->pin)
- ) {
- return;
- }
-
- /* viewer overrides uv editmode */
- if (EM_texFaceCheck()) {
- MTFace *activetf;
-
- sima->image= NULL;
-
- activetf = get_active_mtface(NULL, NULL, 1); /* partially selected face is ok */
-
- if(activetf && activetf->mode & TF_TEX) {
- /* done need to check for pin here, see above */
- /*if (!sima->pin)*/
- sima->image= activetf->tpage;
-
- if(sima->flag & SI_EDITTILE);
- else sima->curtile= activetf->tile;
-
- if(sima->image) {
- if(activetf->mode & TF_TILES)
- sima->image->tpageflag |= IMA_TILES;
- else sima->image->tpageflag &= ~IMA_TILES;
- }
- }
- }
-}
-
-/* after a what_image(), this call will give ibufs, includes the spare image */
-ImBuf *imagewindow_get_ibuf(SpaceImage *sima)
-{
- if(G.sima->image) {
- /* check for spare */
- if(sima->image->type==IMA_TYPE_R_RESULT && BIF_show_render_spare())
- return BIF_render_spare_imbuf();
- else
- return BKE_image_get_ibuf(sima->image, &sima->iuser);
- }
- return NULL;
-}
-
-/*
- * dotile - 1, set the tile flag (from the space image)
- * 2, set the tile index for the faces.
- * */
-void image_set_tile(SpaceImage *sima, int dotile)
-{
- MTFace *tface;
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- if(!sima->image || sima->mode!=SI_TEXTURE || !EM_texFaceCheck())
- return;
-
- /* skip assigning these procedural images... */
- if(sima->image && (sima->image->type==IMA_TYPE_R_RESULT || sima->image->type==IMA_TYPE_COMPOSITE))
- return;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (efa->h==0 && efa->f & SELECT) {
- if (dotile==1) {
- /* set tile flag */
- if (sima->image->tpageflag & IMA_TILES) {
- tface->mode |= TF_TILES;
- } else {
- tface->mode &= ~TF_TILES;
- }
- } else if (dotile==2) {
- /* set tile index */
- tface->tile= sima->curtile;
- }
- }
- }
- object_uvs_changed(OBACT);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-
-
-void uvco_to_areaco(float *vec, short *mval)
-{
- float x, y;
-
- mval[0]= IS_CLIPPED;
-
- x= (vec[0] - G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- y= (vec[1] - G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
-
- if(x>=0.0 && x<=1.0) {
- if(y>=0.0 && y<=1.0) {
- mval[0]= G.v2d->mask.xmin + x*(G.v2d->mask.xmax-G.v2d->mask.xmin);
- mval[1]= G.v2d->mask.ymin + y*(G.v2d->mask.ymax-G.v2d->mask.ymin);
- }
- }
-}
-
-void uvco_to_areaco_noclip(float *vec, int *mval)
-{
- float x, y;
-
- mval[0]= IS_CLIPPED;
-
- x= (vec[0] - G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- y= (vec[1] - G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
-
- x= G.v2d->mask.xmin + x*(G.v2d->mask.xmax-G.v2d->mask.xmin);
- y= G.v2d->mask.ymin + y*(G.v2d->mask.ymax-G.v2d->mask.ymin);
-
- mval[0]= x;
- mval[1]= y;
-}
-
-static void drawcursor_sima(float xuser_asp, float yuser_asp)
-{
- int wi, hi;
- float w, h;
-
- if ( !G.obedit || /* only draw cursor in editmode */
- !CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE) || /* must have UV's */
- (G.sima->image && G.sima->flag & SI_DRAWTOOL) /* cant be painting */
- ) return;
-
- transform_width_height_tface_uv(&wi, &hi);
- w = (((float)wi)/256.0f)*G.sima->zoom * xuser_asp;
- h = (((float)hi)/256.0f)*G.sima->zoom * yuser_asp;
-
- cpack(0xFFFFFF);
- glTranslatef(G.v2d->cursor[0], G.v2d->cursor[1], 0.0f);
- fdrawline(-0.05/w, 0, 0, 0.05/h);
- fdrawline(0, 0.05/h, 0.05/w, 0);
- fdrawline(0.05/w, 0, 0, -0.05/h);
- fdrawline(0, -0.05/h, -0.05/w, 0);
-
- setlinestyle(4);
- cpack(0xFF);
- fdrawline(-0.05/w, 0, 0, 0.05/h);
- fdrawline(0, 0.05/h, 0.05/w, 0);
- fdrawline(0.05/w, 0, 0, -0.05/h);
- fdrawline(0, -0.05/h, -0.05/w, 0);
-
-
- setlinestyle(0);
- cpack(0x0);
- fdrawline(-0.020/w, 0, -0.1/w, 0);
- fdrawline(0.1/w, 0, .020/w, 0);
- fdrawline(0, -0.020/h, 0, -0.1/h);
- fdrawline(0, 0.1/h, 0, 0.020/h);
-
- setlinestyle(1);
- cpack(0xFFFFFF);
- fdrawline(-0.020/w, 0, -0.1/w, 0);
- fdrawline(0.1/w, 0, .020/w, 0);
- fdrawline(0, -0.020/h, 0, -0.1/h);
- fdrawline(0, 0.1/h, 0, 0.020/h);
-
- glTranslatef(-G.v2d->cursor[0], -G.v2d->cursor[1], 0.0f);
- setlinestyle(0);
-}
-
-// checks if we are selecting only faces
-int draw_uvs_face_check(void)
-{
- if (G.sima==NULL) {
- return 0;
- }
- if (G.sima->flag & SI_SYNC_UVSEL) {
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- return 2;
- } else if (G.scene->selectmode & SCE_SELECT_FACE) {
- return 1;
- }
- } else {
- if (G.sima->selectmode == SI_SELECT_FACE) {
- return 1;
- }
- }
- return 0;
-}
-
-void uv_center(float uv[][2], float cent[2], void * isquad)
-{
-
- if (isquad) {
- cent[0] = (uv[0][0] + uv[1][0] + uv[2][0] + uv[3][0]) / 4.0;
- cent[1] = (uv[0][1] + uv[1][1] + uv[2][1] + uv[3][1]) / 4.0;
- } else {
- cent[0] = (uv[0][0] + uv[1][0] + uv[2][0]) / 3.0;
- cent[1] = (uv[0][1] + uv[1][1] + uv[2][1]) / 3.0;
- }
-}
-
-static float uv_area(float uv[][2], int quad)
-{
- if (quad) {
- return AreaF2Dfl(uv[0], uv[1], uv[2]) + AreaF2Dfl(uv[0], uv[2], uv[3]);
- } else {
- return AreaF2Dfl(uv[0], uv[1], uv[2]);
- }
-}
-
-void uv_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy)
-{
- uv[0][0] = uv_orig[0][0]*aspx;
- uv[0][1] = uv_orig[0][1]*aspy;
-
- uv[1][0] = uv_orig[1][0]*aspx;
- uv[1][1] = uv_orig[1][1]*aspy;
-
- uv[2][0] = uv_orig[2][0]*aspx;
- uv[2][1] = uv_orig[2][1]*aspy;
-
- uv[3][0] = uv_orig[3][0]*aspx;
- uv[3][1] = uv_orig[3][1]*aspy;
-}
-
-/* draws uv's in the image space */
-void draw_uvs_sima(void)
-{
- MTFace *tface,*activetface = NULL;
- EditMesh *em = G.editMesh;
- EditFace *efa, *efa_act;
-
- char col1[4], col2[4];
- float pointsize;
- int drawface;
- int lastsel, sel;
-
- if (!G.obedit || !CustomData_has_layer(&em->fdata, CD_MTFACE))
- return;
-
- drawface = draw_uvs_face_check();
-
- calc_image_view(G.sima, 'f'); /* float */
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- glLoadIdentity();
-
-
- if(G.sima->flag & SI_DRAWTOOL) {
- /* draws the grey mesh when painting */
- glColor3ub(112, 112, 112);
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- glBegin(GL_LINE_LOOP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- }
- return; /* only draw shadow mesh */
- } else if (G.sima->flag & SI_DRAWSHADOW) {
- /* draw shadow mesh - this is the mesh with the modifier applied */
- glColor3ub(112, 112, 112);
- if ( em->derivedFinal &&
- em->derivedFinal->drawUVEdges &&
- CustomData_has_layer(&em->derivedFinal->faceData, CD_MTFACE)
- ) {
- /* we can use the existing final mesh */
- glColor3ub(112, 112, 112);
- em->derivedFinal->drawUVEdges(em->derivedFinal);
- } else {
- DerivedMesh *finalDM, *cageDM;
-
- /* draw final mesh with modifiers applied */
- cageDM = editmesh_get_derived_cage_and_final(&finalDM, CD_MASK_BAREMESH | CD_MASK_MTFACE);
-
- if (finalDM->drawUVEdges &&
- DM_get_face_data_layer(finalDM, CD_MTFACE) &&
- /* When sync selection is enabled, all faces are drawn (except for hidden)
- * so if cage is the same as the final, theres no point in drawing the shadowmesh. */
- !((G.sima->flag & SI_SYNC_UVSEL && cageDM==finalDM))
- ) {
- glColor3ub(112, 112, 112);
- finalDM->drawUVEdges(finalDM);
- }
-
- if (cageDM != finalDM)
- cageDM->release(cageDM);
- finalDM->release(finalDM);
- }
- }
-
- activetface = get_active_mtface(&efa_act, NULL, 0); /* will be set to NULL if hidden */
-
-
- if (G.sima->flag & SI_DRAW_STRETCH) {
- float col[4];
- float aspx, aspy;
- float tface_uv[4][2];
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
-
- switch (G.sima->dt_uvstretch) {
- case SI_UVDT_STRETCH_AREA:
- {
- float totarea=0.0f, totuvarea=0.0f, areadiff, uvarea, area;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_copy_aspect(tface->uv, tface_uv, aspx, aspy);
-
- totarea += EM_face_area(efa);
- //totuvarea += tface_area(tface, efa->v4!=0);
- totuvarea += uv_area(tface_uv, efa->v4!=0);
-
- if (simaFaceDraw_Check(efa, tface)) {
- efa->tmp.p = tface;
- } else {
- if (tface == activetface)
- activetface= NULL;
- efa->tmp.p = NULL;
- }
- }
-
- if (totarea < FLT_EPSILON || totuvarea < FLT_EPSILON) {
- col[0] = 1.0;
- col[1] = col[2] = 0.0;
- glColor3fv(col);
- for (efa= em->faces.first; efa; efa= efa->next) {
- if ((tface=(MTFace *)efa->tmp.p)) {
- glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- }
- }
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if ((tface=(MTFace *)efa->tmp.p)) {
- area = EM_face_area(efa) / totarea;
- uv_copy_aspect(tface->uv, tface_uv, aspx, aspy);
- //uvarea = tface_area(tface, efa->v4!=0) / totuvarea;
- uvarea = uv_area(tface_uv, efa->v4!=0) / totuvarea;
-
- if (area < FLT_EPSILON || uvarea < FLT_EPSILON) {
- areadiff = 1.0;
- } else if (area>uvarea) {
- areadiff = 1.0-(uvarea/area);
- } else {
- areadiff = 1.0-(area/uvarea);
- }
-
- weight_to_rgb(areadiff, col, col+1, col+2);
- glColor3fv(col);
-
- glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- }
- }
- }
- break;
- }
- case SI_UVDT_STRETCH_ANGLE:
- {
- float uvang1,uvang2,uvang3,uvang4;
- float ang1,ang2,ang3,ang4;
- float av1[3], av2[3], av3[3], av4[3]; /* use for 2d and 3d angle vectors */
- float a;
-
- col[3] = 0.5; /* hard coded alpha, not that nice */
-
- glShadeModel(GL_SMOOTH);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- if (simaFaceDraw_Check(efa, tface)) {
- efa->tmp.p = tface;
- uv_copy_aspect(tface->uv, tface_uv, aspx, aspy);
- if (efa->v4) {
-
-#if 0 /* Simple but slow, better reuse normalized vectors */
- uvang1 = VecAngle3_2D(tface_uv[3], tface_uv[0], tface_uv[1]);
- ang1 = VecAngle3(efa->v4->co, efa->v1->co, efa->v2->co);
-
- uvang2 = VecAngle3_2D(tface_uv[0], tface_uv[1], tface_uv[2]);
- ang2 = VecAngle3(efa->v1->co, efa->v2->co, efa->v3->co);
-
- uvang3 = VecAngle3_2D(tface_uv[1], tface_uv[2], tface_uv[3]);
- ang3 = VecAngle3(efa->v2->co, efa->v3->co, efa->v4->co);
-
- uvang4 = VecAngle3_2D(tface_uv[2], tface_uv[3], tface_uv[0]);
- ang4 = VecAngle3(efa->v3->co, efa->v4->co, efa->v1->co);
-#endif
-
- /* uv angles */
- VECSUB2D(av1, tface_uv[3], tface_uv[0]); Normalize2(av1);
- VECSUB2D(av2, tface_uv[0], tface_uv[1]); Normalize2(av2);
- VECSUB2D(av3, tface_uv[1], tface_uv[2]); Normalize2(av3);
- VECSUB2D(av4, tface_uv[2], tface_uv[3]); Normalize2(av4);
-
- /* This is the correct angle however we are only comparing angles
- * uvang1 = 90-((NormalizedVecAngle2_2D(av1, av2) * 180.0/M_PI)-90);*/
- uvang1 = NormalizedVecAngle2_2D(av1, av2)*180.0/M_PI;
- uvang2 = NormalizedVecAngle2_2D(av2, av3)*180.0/M_PI;
- uvang3 = NormalizedVecAngle2_2D(av3, av4)*180.0/M_PI;
- uvang4 = NormalizedVecAngle2_2D(av4, av1)*180.0/M_PI;
-
- /* 3d angles */
- VECSUB(av1, efa->v4->co, efa->v1->co); Normalize(av1);
- VECSUB(av2, efa->v1->co, efa->v2->co); Normalize(av2);
- VECSUB(av3, efa->v2->co, efa->v3->co); Normalize(av3);
- VECSUB(av4, efa->v3->co, efa->v4->co); Normalize(av4);
-
- /* This is the correct angle however we are only comparing angles
- * ang1 = 90-((NormalizedVecAngle2(av1, av2) * 180.0/M_PI)-90);*/
- ang1 = NormalizedVecAngle2(av1, av2)*180.0/M_PI;
- ang2 = NormalizedVecAngle2(av2, av3)*180.0/M_PI;
- ang3 = NormalizedVecAngle2(av3, av4)*180.0/M_PI;
- ang4 = NormalizedVecAngle2(av4, av1)*180.0/M_PI;
-
- glBegin(GL_QUADS);
-
- /* This simple makes the angles display worse then they really are ;)
- * 1.0-pow((1.0-a), 2) */
-
- a = fabs(uvang1-ang1)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[0]);
- a = fabs(uvang2-ang2)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[1]);
- a = fabs(uvang3-ang3)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[2]);
- a = fabs(uvang4-ang4)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[3]);
-
- } else {
-#if 0 /* Simple but slow, better reuse normalized vectors */
- uvang1 = VecAngle3_2D(tface_uv[2], tface_uv[0], tface_uv[1]);
- ang1 = VecAngle3(efa->v3->co, efa->v1->co, efa->v2->co);
-
- uvang2 = VecAngle3_2D(tface_uv[0], tface_uv[1], tface_uv[2]);
- ang2 = VecAngle3(efa->v1->co, efa->v2->co, efa->v3->co);
-
- uvang3 = 180-(uvang1+uvang2);
- ang3 = 180-(ang1+ang2);
-#endif
-
- /* uv angles */
- VECSUB2D(av1, tface_uv[2], tface_uv[0]); Normalize2(av1);
- VECSUB2D(av2, tface_uv[0], tface_uv[1]); Normalize2(av2);
- VECSUB2D(av3, tface_uv[1], tface_uv[2]); Normalize2(av3);
-
- /* This is the correct angle however we are only comparing angles
- * uvang1 = 90-((NormalizedVecAngle2_2D(av1, av2) * 180.0/M_PI)-90); */
- uvang1 = NormalizedVecAngle2_2D(av1, av2)*180.0/M_PI;
- uvang2 = NormalizedVecAngle2_2D(av2, av3)*180.0/M_PI;
- uvang3 = NormalizedVecAngle2_2D(av3, av1)*180.0/M_PI;
-
- /* 3d angles */
- VECSUB(av1, efa->v3->co, efa->v1->co); Normalize(av1);
- VECSUB(av2, efa->v1->co, efa->v2->co); Normalize(av2);
- VECSUB(av3, efa->v2->co, efa->v3->co); Normalize(av3);
- /* This is the correct angle however we are only comparing angles
- * ang1 = 90-((NormalizedVecAngle2(av1, av2) * 180.0/M_PI)-90); */
- ang1 = NormalizedVecAngle2(av1, av2)*180.0/M_PI;
- ang2 = NormalizedVecAngle2(av2, av3)*180.0/M_PI;
- ang3 = NormalizedVecAngle2(av3, av1)*180.0/M_PI;
-
- /* This simple makes the angles display worse then they really are ;)
- * 1.0-pow((1.0-a), 2) */
-
- glBegin(GL_TRIANGLES);
- a = fabs(uvang1-ang1)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[0]);
- a = fabs(uvang2-ang2)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[1]);
- a = fabs(uvang3-ang3)/180.0;
- weight_to_rgb(1.0-pow((1.0-a), 2), col, col+1, col+2);
- glColor3fv(col);
- glVertex2fv(tface->uv[2]);
- }
- glEnd();
- } else {
- if (tface == activetface)
- activetface= NULL;
- efa->tmp.p = NULL;
- }
- }
- glShadeModel(GL_FLAT);
- break;
- }
- }
- } else if(G.f & G_DRAWFACES) {
- /* draw transparent faces */
- BIF_GetThemeColor4ubv(TH_FACE, col1);
- BIF_GetThemeColor4ubv(TH_FACE_SELECT, col2);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- if (simaFaceDraw_Check(efa, tface)) {
- efa->tmp.p = tface;
- if (tface==activetface) continue; /* important the temp pointer is set above */
- if( simaFaceSel_Check(efa, tface)) {
- glColor4ubv((GLubyte *)col2);
- } else {
- glColor4ubv((GLubyte *)col1);
- }
-
- glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
-
- } else {
- if (tface == activetface)
- activetface= NULL;
- efa->tmp.p = NULL;
- }
- }
- glDisable(GL_BLEND);
- } else {
- /* would be nice to do this within a draw loop but most below are optional, so it would involve too many checks */
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- efa->tmp.p = tface;
- } else {
- if (tface == activetface)
- activetface= NULL;
- efa->tmp.p = NULL;
- }
- }
-
- }
-
- if (activetface) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- BIF_ThemeColor4(TH_EDITMESH_ACTIVE);
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_quarttone);
- glBegin(efa_act->v4?GL_QUADS:GL_TRIANGLES);
- glVertex2fv(activetface->uv[0]);
- glVertex2fv(activetface->uv[1]);
- glVertex2fv(activetface->uv[2]);
- if(efa_act->v4) glVertex2fv(activetface->uv[3]);
- glEnd();
- glDisable(GL_POLYGON_STIPPLE);
- glDisable(GL_BLEND);
- }
-
- if (G.sima->flag & SI_SMOOTH_UV) {
- glEnable( GL_LINE_SMOOTH );
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- switch (G.sima->dt_uv) {
- case SI_UVDT_DASH:
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- cpack(0x111111);
- glBegin(GL_LINE_LOOP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
-
- setlinestyle(2);
- cpack(0x909090);
- glBegin(GL_LINE_STRIP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(tface->uv[0]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- else glVertex2fv(tface->uv[2]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- setlinestyle(0);
- }
- }
- break;
- case SI_UVDT_BLACK: /* black/white */
- case SI_UVDT_WHITE:
- cpack((G.sima->dt_uv==SI_UVDT_WHITE) ? 0xFFFFFF : 0x0);
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- glBegin(GL_LINE_LOOP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- }
- }
- break;
- case SI_UVDT_OUTLINE:
- glLineWidth(3);
- cpack(0x0);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- glBegin(GL_LINE_LOOP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4) glVertex2fv(tface->uv[3]);
- glEnd();
- }
- }
-
- glLineWidth(1);
- col2[0] = col2[1] = col2[2] = 128; col2[3] = 255;
- glColor4ubv((unsigned char *)col2);
-
- if (G.f & G_DRAWEDGES) {
- glShadeModel(GL_SMOOTH);
- BIF_GetThemeColor4ubv(TH_VERTEX_SELECT, col1);
- lastsel = sel = 0;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- // tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- // if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- glBegin(GL_LINE_LOOP);
- sel = (simaUVSel_Check(efa, tface, 0) ? 1 : 0);
- if (sel != lastsel) { glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); lastsel = sel; }
- glVertex2fv(tface->uv[0]);
-
- sel = simaUVSel_Check(efa, tface, 1) ? 1 : 0;
- if (sel != lastsel) { glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); lastsel = sel; }
- glVertex2fv(tface->uv[1]);
-
- sel = simaUVSel_Check(efa, tface, 2) ? 1 : 0;
- if (sel != lastsel) { glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); lastsel = sel; }
- glVertex2fv(tface->uv[2]);
-
- if(efa->v4) {
- sel = simaUVSel_Check(efa, tface, 3) ? 1 : 0;
- if (sel != lastsel) { glColor4ubv(sel ? (GLubyte *)col1 : (GLubyte *)col2); lastsel = sel; }
- glVertex2fv(tface->uv[3]);
- }
-
- glEnd();
- }
- }
- glShadeModel(GL_FLAT);
- } else { /* No nice edges */
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- // tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- // if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- glBegin(GL_LINE_LOOP);
- glVertex2fv(tface->uv[0]);
- glVertex2fv(tface->uv[1]);
- glVertex2fv(tface->uv[2]);
- if(efa->v4)
- glVertex2fv(tface->uv[3]);
- glEnd();
- }
- }
- }
-
- break;
- }
-
- if (G.sima->flag & SI_SMOOTH_UV) {
- glDisable( GL_LINE_SMOOTH);
- glDisable(GL_BLEND);
- }
-
- if (drawface) {
- // draw UV face points
- float cent[2];
-
-
- /* unselected faces's */
- pointsize = BIF_GetThemeValuef(TH_FACEDOT_SIZE);
- // TODO - drawobject.c changes this value after - Investiagate!
- glPointSize(pointsize);
-
- BIF_ThemeColor(TH_WIRE);
- bglBegin(GL_POINTS);
- for (efa= em->faces.first; efa; efa= efa->next) {
-
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
- if( ! simaFaceSel_Check(efa, tface) ) {
- uv_center(tface->uv, cent, (void *)efa->v4);
- bglVertex2fv(cent);
- }
- }
- }
- bglEnd();
- /* selected faces's */
- BIF_ThemeColor(TH_FACE_DOT);
- bglBegin(GL_POINTS);
- for (efa= em->faces.first; efa; efa= efa->next) {
-
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
- if( simaFaceSel_Check(efa, tface) ) {
- uv_center(tface->uv, cent, (void *)efa->v4);
- bglVertex2fv(cent);
- }
- }
- }
- bglEnd();
- }
-
- if (drawface != 2) { /* 2 means Mesh Face Mode */
- /* unselected uv's */
- BIF_ThemeColor(TH_VERTEX);
- pointsize = BIF_GetThemeValuef(TH_VERTEX_SIZE);
- glPointSize(pointsize);
-
- bglBegin(GL_POINTS);
- for (efa= em->faces.first; efa; efa= efa->next) {
-
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- if(simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
- if(simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
- if(simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
- if(efa->v4) {
- if(simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
- }
- }
- }
- bglEnd();
-
- /* pinned uv's */
- /* give odd pointsizes odd pin pointsizes */
- glPointSize(pointsize*2 + (((int)pointsize % 2)? (-1): 0));
- cpack(0xFF);
-
- bglBegin(GL_POINTS);
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- if(tface->unwrap & TF_PIN1) bglVertex2fv(tface->uv[0]);
- if(tface->unwrap & TF_PIN2) bglVertex2fv(tface->uv[1]);
- if(tface->unwrap & TF_PIN3) bglVertex2fv(tface->uv[2]);
- if(efa->v4) {
- if(tface->unwrap & TF_PIN4) bglVertex2fv(tface->uv[3]);
- }
- }
- }
- bglEnd();
-
- /* selected uv's */
- BIF_ThemeColor(TH_VERTEX_SELECT);
- glPointSize(pointsize);
-
- bglBegin(GL_POINTS);
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
-
- /*this is a shortcut to do the same as above but a faster for drawing */
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- if(!simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]);
- if(!simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]);
- if(!simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]);
- if(efa->v4) {
- if(!simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]);
- }
- }
- }
- bglEnd();
- }
- glPointSize(1.0);
-}
-
-static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty, short endx, short endy)
-{
- unsigned int *rt, *rp, *rectmain;
- short y, heigth, len;
-
- /* the right offset in rectot */
-
- rt= ibuf->rect+ (starty*ibuf->x+ startx);
-
- len= (endx-startx);
- heigth= (endy-starty);
-
- rp=rectmain= MEM_mallocN(heigth*len*sizeof(int), "rect");
-
- for(y=0; y<heigth; y++) {
- memcpy(rp, rt, len*4);
- rt+= ibuf->x;
- rp+= len;
- }
- return rectmain;
-}
-
-static void draw_image_transform(ImBuf *ibuf, float xuser_asp, float yuser_asp)
-{
- if(G.moving) {
- float aspx, aspy, center[3];
-
- BIF_drawConstraint();
-
- if(ibuf==0 || ibuf->rect==0 || ibuf->x==0 || ibuf->y==0) {
- aspx= aspy= 1.0;
- }
- else {
- aspx= (256.0/ibuf->x) * xuser_asp;
- aspy= (256.0/ibuf->y) * yuser_asp;
- }
- BIF_getPropCenter(center);
-
- /* scale and translate the circle into place and draw it */
- glPushMatrix();
- glScalef(aspx, aspy, 1.0);
- glTranslatef((1/aspx)*center[0] - center[0],
- (1/aspy)*center[1] - center[1], 0.0);
-
- BIF_drawPropCircle();
-
- glPopMatrix();
- }
-}
-
-static void draw_image_view_tool(void)
-{
- ToolSettings *settings= G.scene->toolsettings;
- Brush *brush= settings->imapaint.brush;
- short mval[2];
- float radius;
- int draw= 0;
-
- if(brush) {
- if(settings->imapaint.flag & IMAGEPAINT_DRAWING) {
- if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL_DRAWING)
- draw= 1;
- }
- else if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL)
- draw= 1;
-
- if(draw) {
- getmouseco_areawin(mval);
-
- radius= brush->size*G.sima->zoom/2;
- fdrawXORcirc(mval[0], mval[1], radius);
-
- if (brush->innerradius != 1.0) {
- radius *= brush->innerradius;
- fdrawXORcirc(mval[0], mval[1], radius);
- }
- }
- }
-}
-
-/* ************ panel stuff ************* */
-
-/* this function gets the values for cursor and vertex number buttons */
-static void image_transform_but_attr(int *imx, int *imy, int *step, int *digits) /*, float *xcoord, float *ycoord)*/
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- if(ibuf) {
- *imx= ibuf->x;
- *imy= ibuf->y;
- }
-
- if (G.sima->flag & SI_COORDFLOATS) {
- *step= 1;
- *digits= 3;
- }
- else {
- *step= 100;
- *digits= 2;
- }
-}
-
-
-/* is used for both read and write... */
-void image_editvertex_buts(uiBlock *block)
-{
- static float ocent[2];
- float cent[2]= {0.0, 0.0};
- int imx= 256, imy= 256;
- int nactive= 0, step, digits;
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tf;
-
- if( is_uv_tface_editing_allowed_silent()==0 ) return;
-
- image_transform_but_attr(&imx, &imy, &step, &digits);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
-
- if (simaUVSel_Check(efa, tf, 0)) {
- cent[0]+= tf->uv[0][0];
- cent[1]+= tf->uv[0][1];
- nactive++;
- }
- if (simaUVSel_Check(efa, tf, 1)) {
- cent[0]+= tf->uv[1][0];
- cent[1]+= tf->uv[1][1];
- nactive++;
- }
- if (simaUVSel_Check(efa, tf, 2)) {
- cent[0]+= tf->uv[2][0];
- cent[1]+= tf->uv[2][1];
- nactive++;
- }
- if (efa->v4 && simaUVSel_Check(efa, tf, 3)) {
- cent[0]+= tf->uv[3][0];
- cent[1]+= tf->uv[3][1];
- nactive++;
- }
- }
- }
-
- if(block) { // do the buttons
- if (nactive) {
- ocent[0]= cent[0]/nactive;
- ocent[1]= cent[1]/nactive;
- if (G.sima->flag & SI_COORDFLOATS) {
- } else {
- ocent[0] *= imx;
- ocent[1] *= imy;
- }
-
- //uiBlockBeginAlign(block);
- if(nactive==1) {
- uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
- uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
- }
- else {
- uiDefButF(block, NUM, B_TRANS_IMAGE, "Median X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
- uiDefButF(block, NUM, B_TRANS_IMAGE, "Median Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
- }
- //uiBlockEndAlign(block);
- }
- }
- else { // apply event
- float delta[2];
-
- cent[0]= cent[0]/nactive;
- cent[1]= cent[1]/nactive;
-
- if (G.sima->flag & SI_COORDFLOATS) {
- delta[0]= ocent[0]-cent[0];
- delta[1]= ocent[1]-cent[1];
- }
- else {
- delta[0]= ocent[0]/imx - cent[0];
- delta[1]= ocent[1]/imy - cent[1];
- }
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if (simaUVSel_Check(efa, tf, 0)) {
- tf->uv[0][0]+= delta[0];
- tf->uv[0][1]+= delta[1];
- }
- if (simaUVSel_Check(efa, tf, 1)) {
- tf->uv[1][0]+= delta[0];
- tf->uv[1][1]+= delta[1];
- }
- if (simaUVSel_Check(efa, tf, 2)) {
- tf->uv[2][0]+= delta[0];
- tf->uv[2][1]+= delta[1];
- }
- if (efa->v4 && simaUVSel_Check(efa, tf, 3)) {
- tf->uv[3][0]+= delta[0];
- tf->uv[3][1]+= delta[1];
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- }
-}
-
-
-/* is used for both read and write... */
-void image_editcursor_buts(uiBlock *block)
-{
- static float ocent[2];
- int imx= 256, imy= 256;
- int step, digits;
-
- if( is_uv_tface_editing_allowed_silent()==0 ) return;
-
- image_transform_but_attr(&imx, &imy, &step, &digits);
-
- if(block) { // do the buttons
- ocent[0]= G.v2d->cursor[0];
- ocent[1]= G.v2d->cursor[1];
- if (G.sima->flag & SI_COORDFLOATS) {
- } else {
- ocent[0] *= imx;
- ocent[1] *= imy;
- }
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_CURSOR_IMAGE, "Cursor X:", 165, 120, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
- uiDefButF(block, NUM, B_CURSOR_IMAGE, "Cursor Y:", 165, 100, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
- uiBlockEndAlign(block);
- }
- else { // apply event
- if (G.sima->flag & SI_COORDFLOATS) {
- G.v2d->cursor[0]= ocent[0];
- G.v2d->cursor[1]= ocent[1];
- }
- else {
- G.v2d->cursor[0]= ocent[0]/imx;
- G.v2d->cursor[1]= ocent[1]/imy;
- }
- allqueue(REDRAWIMAGE, 0);
- }
-}
-
-
-void image_info(Image *ima, ImBuf *ibuf, char *str)
-{
- int ofs= 0;
-
- str[0]= 0;
-
- if(ima==NULL) return;
- if(ibuf==NULL) {
- sprintf(str, "Can not get an image");
- return;
- }
-
- if(ima->source==IMA_SRC_MOVIE) {
- ofs= sprintf(str, "Movie ");
- if(ima->anim)
- ofs+= sprintf(str+ofs, "%d frs", IMB_anim_get_duration(ima->anim));
- }
- else
- ofs= sprintf(str, "Image ");
-
- ofs+= sprintf(str+ofs, ": size %d x %d,", ibuf->x, ibuf->y);
-
- if(ibuf->rect_float) {
- if(ibuf->channels!=4) {
- sprintf(str+ofs, "%d float channel(s)", ibuf->channels);
- }
- else if(ibuf->depth==32)
- strcat(str, " RGBA float");
- else
- strcat(str, " RGB float");
- }
- else {
- if(ibuf->depth==32)
- strcat(str, " RGBA byte");
- else
- strcat(str, " RGB byte");
- }
- if(ibuf->zbuf || ibuf->zbuf_float)
- strcat(str, " + Z");
-
-}
-
-static void image_panel_properties(short cntrl) // IMAGE_HANDLER_PROPERTIES
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "image_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "Image Properties", "Image", 10, 10, 318, 204)==0)
- return;
-
- /* note, it draws no bottom half in facemode, for vertex buttons */
- uiblock_image_panel(block, &G.sima->image, &G.sima->iuser, B_REDR, B_REDR);
- image_editvertex_buts(block);
-}
-
-static void image_panel_game_properties(short cntrl) // IMAGE_HANDLER_GAME_PROPERTIES
-{
- ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "image_panel_game_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_GAME_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "Real-time Properties", "Image", 10, 10, 318, 204)==0)
- return;
-
- if (ibuf) {
- char str[128];
-
- image_info(G.sima->image, ibuf, str);
- uiDefBut(block, LABEL, B_NOP, str, 10,180,300,19, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, IMA_TWINANIM, B_TWINANIM, "Anim", 10,150,140,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of animated texture");
- uiDefButS(block, NUM, B_TWINANIM, "Start:", 10,130,140,19, &G.sima->image->twsta, 0.0, 128.0, 0, 0, "Displays the start frame of an animated texture");
- uiDefButS(block, NUM, B_TWINANIM, "End:", 10,110,140,19, &G.sima->image->twend, 0.0, 128.0, 0, 0, "Displays the end frame of an animated texture");
- uiDefButS(block, NUM, B_NOP, "Speed", 10,90,140,19, &G.sima->image->animspeed, 1.0, 100.0, 0, 0, "Displays Speed of the animation in frames per second");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, IMA_TILES, B_SIMAGETILE, "Tiles", 160,150,140,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of tilemode for faces (Shift LMB to pick the tile for selected faces)");
- uiDefButS(block, NUM, B_SIMA_REDR_IMA_3D, "X:", 160,130,70,19, &G.sima->image->xrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the X direction");
- uiDefButS(block, NUM, B_SIMA_REDR_IMA_3D, "Y:", 230,130,70,19, &G.sima->image->yrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the Y direction");
- uiBlockBeginAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, IMA_CLAMP_U, B_SIMA3DVIEWDRAW, "ClampX", 160,100,70,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating horizontaly");
- uiDefButBitS(block, TOG, IMA_CLAMP_V, B_SIMA3DVIEWDRAW, "ClampY", 230,100,70,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating vertically");
- uiBlockEndAlign(block);
- }
-}
-
-static void image_panel_view_properties(short cntrl) // IMAGE_HANDLER_VIEW_PROPERTIES
-{
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "image_view_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_VIEW_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "View Properties", "Image", 10, 10, 318, 204)==0)
- return;
-
-
- uiDefButBitI(block, TOG, SI_DRAW_TILE, B_REDR, "Repeat Image", 10,160,140,19, &G.sima->flag, 0, 0, 0, 0, "Repeat/Tile the image display");
- uiDefButBitI(block, TOG, SI_COORDFLOATS, B_REDR, "Normalized Coords", 165,160,145,19, &G.sima->flag, 0, 0, 0, 0, "Display coords from 0.0 to 1.0 rather then in pixels");
-
-
- if (G.sima->image) {
- uiDefBut(block, LABEL, B_NOP, "Image Display:", 10,140,140,19, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_REDR, "AspX:", 10,120,140,19, &G.sima->image->aspx, 0.1, 5000.0, 100, 0, "X Display Aspect for this image, does not affect renderingm 0 disables.");
- uiDefButF(block, NUM, B_REDR, "AspY:", 10,100,140,19, &G.sima->image->aspy, 0.1, 5000.0, 100, 0, "X Display Aspect for this image, does not affect rendering 0 disables.");
- uiBlockEndAlign(block);
- }
-
-
- if (EM_texFaceCheck()) {
- uiDefBut(block, LABEL, B_NOP, "Draw Type:", 10, 80,120,19, 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_REDR, "Outline", 10,60,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_OUTLINE, 0, 0, "Outline Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "Dash", 68, 60,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_DASH, 0, 0, "Dashed Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "Black", 126, 60,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_BLACK, 0, 0, "Black Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "White", 184,60,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_WHITE, 0, 0, "White Wire UV drawtype");
-
- uiBlockEndAlign(block);
- uiDefButBitI(block, TOG, SI_SMOOTH_UV, B_REDR, "Smooth", 250,60,60,19, &G.sima->flag, 0, 0, 0, 0, "Display smooth lines in the UV view");
-
-
- uiDefButBitI(block, TOG, G_DRAWFACES, B_REDR, "Faces", 10,30,60,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades in the 3d view and UV editor");
- uiDefButBitI(block, TOG, G_DRAWEDGES, B_REDR, "Edges", 70, 30,60,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights in the 3d view and UV editor");
-
- uiDefButBitI(block, TOG, SI_DRAWSHADOW, B_REDR, "Final Shadow", 130, 30,110,19, &G.sima->flag, 0, 0, 0, 0, "Draw the final result from the objects modifiers");
-
- uiDefButBitI(block, TOG, SI_DRAW_STRETCH, B_REDR, "UV Stretch", 10,0,100,19, &G.sima->flag, 0, 0, 0, 0, "Difference between UV's and the 3D coords (blue for low distortion, red is high)");
- if (G.sima->flag & SI_DRAW_STRETCH) {
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_REDR, "Area", 120,0,60,19, &G.sima->dt_uvstretch, 0.0, SI_UVDT_STRETCH_AREA, 0, 0, "Area distortion between UV's and 3D coords");
- uiDefButC(block, ROW, B_REDR, "Angle", 180,0,60,19, &G.sima->dt_uvstretch, 0.0, SI_UVDT_STRETCH_ANGLE, 0, 0, "Angle distortion between UV's and 3D coords");
- uiBlockEndAlign(block);
- }
-
- }
- image_editcursor_buts(block);
-}
-
-static void image_panel_paint(short cntrl) // IMAGE_HANDLER_PAINT
-{
- /* B_SIMABRUSHCHANGE only redraws and eats the mouse messages */
- /* so that LEFTMOUSE does not 'punch' through the floating panel */
- /* B_SIMANOTHING */
- ToolSettings *settings= G.scene->toolsettings;
- Brush *brush= settings->imapaint.brush;
- uiBlock *block;
- ID *id;
- int yco, xco, butw;
-
- if ((G.sima->image && (G.sima->flag & SI_DRAWTOOL))==0) {
- return;
- }
-
- block= uiNewBlock(&curarea->uiblocks, "image_panel_paint", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_PAINT); // for close and esc
- if(uiNewPanel(curarea, block, "Image Paint", "Image", 10, 230, 318, 204)==0)
- return;
-
- yco= 160;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Draw", 0 ,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_DRAW, 0, 0, "Draw brush");
- uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Soften", 80 ,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SOFTEN, 0, 0, "Soften brush");
- uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Smear", 160,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SMEAR, 0, 0, "Smear brush");
- uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Clone", 240,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_CLONE, 0, 0, "Clone brush, use RMB to drag source image");
- uiBlockEndAlign(block);
- yco -= 30;
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (ID*)settings->imapaint.brush;
- xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMABRUSHBROWSE, ID_BR, 0, id, NULL, &(G.sima->menunr), 0, B_SIMABRUSHLOCAL, B_SIMABRUSHDELETE, 0, B_KEEPDATA);
- uiBlockSetCol(block, TH_AUTO);
-
- if(brush && !brush->id.lib) {
- butw= 320-(xco+10);
-
- uiDefButS(block, MENU, B_SIMANOTHING, "Mix %x0|Add %x1|Subtract %x2|Multiply %x3|Lighten %x4|Darken %x5|Erase Alpha %x6|Add Alpha %x7", xco+10,yco,butw,19, &brush->blend, 0, 0, 0, 0, "Blending method for applying brushes");
-
- uiDefButBitS(block, TOG|BIT, BRUSH_TORUS, B_SIMABRUSHCHANGE, "Wrap", xco+10,yco-25,butw,19, &brush->flag, 0, 0, 0, 0, "Enables torus wrapping");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG|BIT, BRUSH_AIRBRUSH, B_SIMABRUSHCHANGE, "Airbrush", xco+10,yco-50,butw,19, &brush->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse (spray)");
- uiDefButF(block, NUM, B_SIMANOTHING, "Rate ", xco+10,yco-70,butw,19, &brush->rate, 0.01, 1.0, 0, 0, "Number of paints per second for Airbrush");
- uiBlockEndAlign(block);
-
- yco -= 25;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, COL, B_VPCOLSLI, "", 0,yco,200,19, brush->rgb, 0, 0, 0, 0, "");
- uiDefButF(block, NUMSLI, B_SIMANOTHING, "Opacity ", 0,yco-20,180,19, &brush->alpha, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_ALPHA_PRESSURE, B_SIMANOTHING, "P", 180,yco-20,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButI(block, NUMSLI, B_SIMANOTHING, "Size ", 0,yco-40,180,19, &brush->size, 1, 200, 0, 0, "The size of the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_SIZE_PRESSURE, B_SIMANOTHING, "P", 180,yco-40,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButF(block, NUMSLI, B_SIMANOTHING, "Falloff ", 0,yco-60,180,19, &brush->innerradius, 0.0, 1.0, 0, 0, "The fall off radius of the brush");
- uiDefButBitS(block, TOG|BIT, BRUSH_RAD_PRESSURE, B_SIMANOTHING, "P", 180,yco-60,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiDefButF(block, NUMSLI, B_SIMANOTHING, "Spacing ",0,yco-80,180,19, &brush->spacing, 1.0, 100.0, 0, 0, "Repeating paint on %% of brush diameter");
- uiDefButBitS(block, TOG|BIT, BRUSH_SPACING_PRESSURE, B_SIMANOTHING, "P", 180,yco-80,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets");
- uiBlockEndAlign(block);
-
- yco -= 110;
-
- if(settings->imapaint.tool == PAINT_TOOL_CLONE) {
- id= (ID*)brush->clone.image;
- uiBlockSetCol(block, TH_BUT_SETTING2);
- xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMACLONEBROWSE, ID_IM, 0, id, 0, &G.sima->menunr, 0, 0, B_SIMACLONEDELETE, 0, 0);
- uiBlockSetCol(block, TH_AUTO);
- if(id) {
- butw= 320-(xco+5);
- uiDefButF(block, NUMSLI, B_SIMABRUSHCHANGE, "B ",xco+5,yco,butw,19, &brush->clone.alpha , 0.0, 1.0, 0, 0, "Opacity of clone image display");
- }
- }
- else {
- MTex *mtex= brush->mtex[brush->texact];
-
- uiBlockSetCol(block, TH_BUT_SETTING2);
- id= (mtex)? (ID*)mtex->tex: NULL;
- xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMABTEXBROWSE, ID_TE, 0, id, NULL, &(G.sima->menunr), 0, 0, B_SIMABTEXDELETE, 0, 0);
- /*uiDefButBitS(block, TOG|BIT, BRUSH_FIXED_TEX, B_SIMABRUSHCHANGE, "Fixed", xco+5,yco,butw,19, &brush->flag, 0, 0, 0, 0, "Keep texture origin in fixed position");*/
- uiBlockSetCol(block, TH_AUTO);
- }
- }
-
-#if 0
- uiDefButBitS(block, TOG|BIT, IMAGEPAINT_DRAW_TOOL_DRAWING, B_SIMABRUSHCHANGE, "TD", 0,1,50,19, &settings->imapaint.flag.flag, 0, 0, 0, 0, "Enables brush shape while drawing");
- uiDefButBitS(block, TOG|BIT, IMAGEPAINT_DRAW_TOOL, B_SIMABRUSHCHANGE, "TP", 50,1,50,19, &settings->imapaint.flag.flag, 0, 0, 0, 0, "Enables brush shape while not drawing");
-#endif
-}
-
-static void image_panel_curves_reset(void *cumap_v, void *ibuf_v)
-{
- CurveMapping *cumap = cumap_v;
- int a;
-
- for(a=0; a<CM_TOT; a++)
- curvemap_reset(cumap->cm+a, &cumap->clipr);
-
- cumap->black[0]=cumap->black[1]=cumap->black[2]= 0.0f;
- cumap->white[0]=cumap->white[1]=cumap->white[2]= 1.0f;
- curvemapping_set_black_white(cumap, NULL, NULL);
-
- curvemapping_changed(cumap, 0);
- curvemapping_do_ibuf(cumap, ibuf_v);
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-
-static void image_panel_curves(short cntrl) // IMAGE_HANDLER_CURVES
-{
- ImBuf *ibuf;
- uiBlock *block;
- uiBut *bt;
-
- /* and we check for spare */
- ibuf= imagewindow_get_ibuf(G.sima);
-
- block= uiNewBlock(&curarea->uiblocks, "image_panel_curves", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_CURVES); // for close and esc
- if(uiNewPanel(curarea, block, "Curves", "Image", 10, 450, 318, 204)==0)
- return;
-
- if (ibuf) {
- rctf rect;
-
- if(G.sima->cumap==NULL)
- G.sima->cumap= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
-
- rect.xmin= 110; rect.xmax= 310;
- rect.ymin= 10; rect.ymax= 200;
- curvemap_buttons(block, G.sima->cumap, 'c', B_SIMACURVES, B_REDR, &rect);
-
- /* curvemap min/max only works for RGBA */
- if(ibuf->channels==4) {
- bt=uiDefBut(block, BUT, B_SIMARANGE, "Reset", 10, 160, 90, 19, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves");
- uiButSetFunc(bt, image_panel_curves_reset, G.sima->cumap, ibuf);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_SIMARANGE, "Min R:", 10, 120, 90, 19, G.sima->cumap->black, -1000.0f, 1000.0f, 10, 2, "Black level");
- uiDefButF(block, NUM, B_SIMARANGE, "Min G:", 10, 100, 90, 19, G.sima->cumap->black+1, -1000.0f, 1000.0f, 10, 2, "Black level");
- uiDefButF(block, NUM, B_SIMARANGE, "Min B:", 10, 80, 90, 19, G.sima->cumap->black+2, -1000.0f, 1000.0f, 10, 2, "Black level");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_SIMARANGE, "Max R:", 10, 50, 90, 19, G.sima->cumap->white, -1000.0f, 1000.0f, 10, 2, "White level");
- uiDefButF(block, NUM, B_SIMARANGE, "Max G:", 10, 30, 90, 19, G.sima->cumap->white+1, -1000.0f, 1000.0f, 10, 2, "White level");
- uiDefButF(block, NUM, B_SIMARANGE, "Max B:", 10, 10, 90, 19, G.sima->cumap->white+2, -1000.0f, 1000.0f, 10, 2, "White level");
- }
- }
-}
-
-/* are there curves? curves visible? and curves do something? */
-static int image_curves_active(ScrArea *sa)
-{
- SpaceImage *sima= sa->spacedata.first;
-
- if(sima->cumap) {
- if(curvemapping_RGBA_does_something(sima->cumap)) {
- short a;
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- if(sima->blockhandler[a] == IMAGE_HANDLER_CURVES)
- return 1;
- }
- }
- }
- return 0;
-}
-
-/* 0: disable preview
- otherwise refresh preview
-*/
-void image_preview_event(int event)
-{
- int exec= 0;
-
-
- if(event==0) {
- G.scene->r.scemode &= ~R_COMP_CROP;
- exec= 1;
- }
- else {
- if(image_preview_active(curarea, NULL, NULL)) {
- G.scene->r.scemode |= R_COMP_CROP;
- exec= 1;
- }
- else
- G.scene->r.scemode &= ~R_COMP_CROP;
- }
-
- if(exec && G.scene->nodetree) {
- /* should work when no node editor in screen..., so we execute right away */
-
- ntreeCompositTagGenerators(G.scene->nodetree);
-
- G.afbreek= 0;
- G.scene->nodetree->timecursor= set_timecursor;
- G.scene->nodetree->test_break= blender_test_break;
-
- BIF_store_spare();
-
- ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, 1); /* 1 is do_previews */
-
- G.scene->nodetree->timecursor= NULL;
- G.scene->nodetree->test_break= NULL;
-
- scrarea_do_windraw(curarea);
- waitcursor(0);
-
- allqueue(REDRAWNODE, 1);
- }
-}
-
-
-/* nothing drawn here, we use it to store values */
-static void preview_cb(struct ScrArea *sa, struct uiBlock *block)
-{
- rctf dispf;
- rcti *disprect= &G.scene->r.disprect;
- int winx= (G.scene->r.size*G.scene->r.xsch)/100;
- int winy= (G.scene->r.size*G.scene->r.ysch)/100;
- short mval[2];
-
- if(G.scene->r.mode & R_BORDER) {
- winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin);
- winy*= (G.scene->r.border.ymax - G.scene->r.border.ymin);
- }
-
- /* while dragging we need to update the rects, otherwise it doesn't end with correct one */
-
- BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f);
- ui_graphics_to_window_rct(sa->win, &dispf, disprect);
-
- /* correction for gla draw */
- BLI_translate_rcti(disprect, -curarea->winrct.xmin, -curarea->winrct.ymin);
-
- calc_image_view(G.sima, 'p');
-// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin,disprect->xmax, disprect->ymax);
- /* map to image space coordinates */
- mval[0]= disprect->xmin; mval[1]= disprect->ymin;
- areamouseco_to_ipoco(G.v2d, mval, &dispf.xmin, &dispf.ymin);
- mval[0]= disprect->xmax; mval[1]= disprect->ymax;
- areamouseco_to_ipoco(G.v2d, mval, &dispf.xmax, &dispf.ymax);
-
- /* map to render coordinates */
- disprect->xmin= dispf.xmin;
- disprect->xmax= dispf.xmax;
- disprect->ymin= dispf.ymin;
- disprect->ymax= dispf.ymax;
-
- CLAMP(disprect->xmin, 0, winx);
- CLAMP(disprect->xmax, 0, winx);
- CLAMP(disprect->ymin, 0, winy);
- CLAMP(disprect->ymax, 0, winy);
-// printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin,disprect->xmax, disprect->ymax);
-
-}
-
-static int is_preview_allowed(ScrArea *cur)
-{
- SpaceImage *sima= cur->spacedata.first;
- ScrArea *sa;
-
- /* check if another areawindow has preview set */
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa!=cur && sa->spacetype==SPACE_IMAGE) {
- if(image_preview_active(sa, NULL, NULL))
- return 0;
- }
- }
- /* check image type */
- if(sima->image==NULL || sima->image->type!=IMA_TYPE_COMPOSITE)
- return 0;
-
- return 1;
-}
-
-static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW
-{
- uiBlock *block;
- SpaceImage *sima= sa->spacedata.first;
- int ofsx, ofsy;
-
- if(is_preview_allowed(sa)==0) {
- rem_blockhandler(sa, IMAGE_HANDLER_PREVIEW);
- G.scene->r.scemode &= ~R_COMP_CROP; /* quite weak */
- return;
- }
-
- block= uiNewBlock(&sa->uiblocks, "image_panel_preview", UI_EMBOSS, UI_HELV, sa->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_PREVIEW); // for close and esc
-
- ofsx= -150+(sa->winx/2)/sima->blockscale;
- ofsy= -100+(sa->winy/2)/sima->blockscale;
- if(uiNewPanel(sa, block, "Preview", "Image", ofsx, ofsy, 300, 200)==0) return;
-
- uiBlockSetDrawExtraFunc(block, preview_cb);
-
-}
-
-static void image_panel_gpencil(short cntrl) // IMAGE_HANDLER_GREASEPENCIL
-{
- uiBlock *block;
- SpaceImage *sima;
-
- sima= curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "image_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMAGE_HANDLER_GREASEPENCIL); // for close and esc
- if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceImage", 100, 30, 318, 204)==0) return;
-
- /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
- if (sima->flag & SI_DISPGP) {
- if (sima->gpd == NULL)
- gpencil_data_setactive(curarea, gpencil_data_addnew());
- }
-
- if (sima->flag & SI_DISPGP) {
- bGPdata *gpd= sima->gpd;
- short newheight;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- /* draw button for showing gpencil settings and drawings */
- uiDefButBitI(block, TOG, SI_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sima->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Image/UV Editor (draw using Shift-LMB)");
-
- /* extend the panel if the contents won't fit */
- newheight= draw_gpencil_panel(block, gpd, curarea);
- uiNewPanelHeight(block, newheight);
- }
- else {
- uiDefButBitI(block, TOG, SI_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sima->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Image/UV Editor");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
-}
-
-static void image_blockhandlers(ScrArea *sa)
-{
- SpaceImage *sima= sa->spacedata.first;
- short a;
-
- /* warning; blocks need to be freed each time, handlers dont remove */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(sima->blockhandler[a]) {
- case IMAGE_HANDLER_PROPERTIES:
- image_panel_properties(sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_GAME_PROPERTIES:
- image_panel_game_properties(sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_VIEW_PROPERTIES:
- image_panel_view_properties(sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_PAINT:
- image_panel_paint(sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_CURVES:
- image_panel_curves(sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_PREVIEW:
- image_panel_preview(sa, sima->blockhandler[a+1]);
- break;
- case IMAGE_HANDLER_GREASEPENCIL:
- image_panel_gpencil(sima->blockhandler[a+1]);
- break;
- }
- /* clear action value for event */
- sima->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-}
-
-void imagespace_composite_flipbook(ScrArea *sa)
-{
- SpaceImage *sima= sa->spacedata.first;
- ImBuf *ibuf;
- int cfrao= G.scene->r.cfra;
- int sfra, efra;
-
- if(sa->spacetype!=SPACE_IMAGE)
- return;
- if(sima->iuser.frames<2)
- return;
- if(G.scene->nodetree==NULL)
- return;
-
- sfra= sima->iuser.sfra;
- efra= sima->iuser.sfra + sima->iuser.frames-1;
- G.scene->nodetree->test_break= blender_test_break;
-
- for(G.scene->r.cfra=sfra; G.scene->r.cfra<=efra; G.scene->r.cfra++) {
-
- set_timecursor(CFRA);
-
- BKE_image_all_free_anim_ibufs(CFRA);
- ntreeCompositTagAnimated(G.scene->nodetree);
- ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, G.scene->r.cfra!=cfrao); /* 1 is no previews */
-
- force_draw(0);
-
- ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
- /* save memory in flipbooks */
- if(ibuf)
- imb_freerectfloatImBuf(ibuf);
-
- if(blender_test_break())
- break;
- }
- G.scene->nodetree->test_break= NULL;
- waitcursor(0);
-
- play_anim(0);
-
- allqueue(REDRAWNODE, 1);
- allqueue(REDRAWIMAGE, 1);
-
- G.scene->r.cfra= cfrao;
-}
-
-static void imagespace_grid(SpaceImage *sima)
-{
- float gridsize, gridstep= 1.0f/32.0f;
- float fac, blendfac;
-
- gridsize= sima->zoom;
-
- calc_image_view(sima, 'f');
- myortho2(sima->v2d.cur.xmin, sima->v2d.cur.xmax, sima->v2d.cur.ymin, sima->v2d.cur.ymax);
-
- BIF_ThemeColorShade(TH_BACK, 20);
- glRectf(0.0, 0.0, 1.0, 1.0);
-
- if(gridsize<=0.0f) return;
-
- if(gridsize<1.0f) {
- while(gridsize<1.0f) {
- gridsize*= 4.0;
- gridstep*= 4.0;
- }
- }
- else {
- while(gridsize>=4.0f) {
- gridsize/= 4.0;
- gridstep/= 4.0;
- }
- }
-
- /* the fine resolution level */
- blendfac= 0.25*gridsize - floor(0.25*gridsize);
- CLAMP(blendfac, 0.0, 1.0);
- BIF_ThemeColorShade(TH_BACK, (int)(20.0*(1.0-blendfac)));
-
- fac= 0.0f;
- glBegin(GL_LINES);
- while(fac<1.0) {
- glVertex2f(0.0f, fac);
- glVertex2f(1.0f, fac);
- glVertex2f(fac, 0.0f);
- glVertex2f(fac, 1.0f);
- fac+= gridstep;
- }
-
- /* the large resolution level */
- BIF_ThemeColor(TH_BACK);
-
- fac= 0.0f;
- while(fac<1.0) {
- glVertex2f(0.0f, fac);
- glVertex2f(1.0f, fac);
- glVertex2f(fac, 0.0f);
- glVertex2f(fac, 1.0f);
- fac+= 4.0*gridstep;
- }
- glEnd();
-
-}
-
-static void sima_draw_alpha_backdrop(SpaceImage *sima, float x1, float y1, float xsize, float ysize)
-{
- GLubyte checker_stipple[32*32/8] =
- {
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
- 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
- 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
- };
-
- glColor3ub(100, 100, 100);
- glRectf(x1, y1, x1 + sima->zoom*xsize, y1 + sima->zoom*ysize);
- glColor3ub(160, 160, 160);
-
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(checker_stipple);
- glRectf(x1, y1, x1 + sima->zoom*xsize, y1 + sima->zoom*ysize);
- glDisable(GL_POLYGON_STIPPLE);
-}
-
-static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, unsigned int *recti)
-{
-
- /* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- if(G.order==B_ENDIAN)
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
- glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
-}
-
-static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, float *rectf)
-{
- float *trectf= MEM_mallocN(rectx*recty*4, "temp");
- int a, b;
-
- for(a= rectx*recty -1, b= 4*a+3; a>=0; a--, b-=4)
- trectf[a]= rectf[b];
-
- glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, trectf);
- MEM_freeN(trectf);
- /* ogl trick below is slower... (on ATI 9600) */
-// glColorMask(1, 0, 0, 0);
-// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+3);
-// glColorMask(0, 1, 0, 0);
-// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+2);
-// glColorMask(0, 0, 1, 0);
-// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+1);
-// glColorMask(1, 1, 1, 1);
-}
-
-static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int *recti)
-{
- if(recti==NULL)
- return;
-
- /* zbuffer values are signed, so we need to shift color range */
- glPixelTransferf(GL_RED_SCALE, 0.5f);
- glPixelTransferf(GL_GREEN_SCALE, 0.5f);
- glPixelTransferf(GL_BLUE_SCALE, 0.5f);
- glPixelTransferf(GL_RED_BIAS, 0.5f);
- glPixelTransferf(GL_GREEN_BIAS, 0.5f);
- glPixelTransferf(GL_BLUE_BIAS, 0.5f);
-
- glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_INT, recti);
-
- glPixelTransferf(GL_RED_SCALE, 1.0f);
- glPixelTransferf(GL_GREEN_SCALE, 1.0f);
- glPixelTransferf(GL_BLUE_SCALE, 1.0f);
- glPixelTransferf(GL_RED_BIAS, 0.0f);
- glPixelTransferf(GL_GREEN_BIAS, 0.0f);
- glPixelTransferf(GL_BLUE_BIAS, 0.0f);
-}
-
-static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, float *rect_float)
-{
- float bias, scale, *rectf, clipend;
- int a;
-
- if(rect_float==NULL)
- return;
-
- if(G.scene->camera && G.scene->camera->type==OB_CAMERA) {
- bias= ((Camera *)G.scene->camera->data)->clipsta;
- clipend= ((Camera *)G.scene->camera->data)->clipend;
- scale= 1.0f/(clipend-bias);
- }
- else {
- bias= 0.1f;
- scale= 0.01f;
- clipend= 100.0f;
- }
-
- rectf= MEM_mallocN(rectx*recty*4, "temp");
- for(a= rectx*recty -1; a>=0; a--) {
- if(rect_float[a]>clipend)
- rectf[a]= 0.0f;
- else if(rect_float[a]<bias)
- rectf[a]= 1.0f;
- else {
- rectf[a]= 1.0f - (rect_float[a]-bias)*scale;
- rectf[a]*= rectf[a];
- }
- }
- glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, rectf);
-
- MEM_freeN(rectf);
-}
-
-static void imagewindow_draw_renderinfo(ScrArea *sa)
-{
- rcti rect;
- float colf[3];
- int showspare= BIF_show_render_spare();
- char *str= BIF_render_text();
-
- if(str==NULL)
- return;
-
- rect= sa->winrct;
- rect.ymin= rect.ymax-RW_HEADERY;
-
- glaDefine2DArea(&rect);
-
- /* clear header rect */
- BIF_GetThemeColor3fv(TH_BACK, colf);
- glClearColor(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- BIF_ThemeColor(TH_TEXT_HI);
- glRasterPos2i(12, 5);
- if(showspare) {
- BMF_DrawString(G.fonts, "(Previous)");
- glRasterPos2i(72, 5);
- }
- BMF_DrawString(G.fonts, str);
-}
-
-void drawimagespace(ScrArea *sa, void *spacedata)
-{
- SpaceImage *sima= spacedata;
- ImBuf *ibuf= NULL;
- Brush *brush;
- float col[3];
- unsigned int *rect;
- float x1, y1;
- short sx, sy, dx, dy, show_render= 0, show_viewer= 0;
- float xuser_asp=1, yuser_asp=1;
- /* If derived data is used then make sure that object
- * is up-to-date... might not be the case because updates
- * are normally done in drawview and could get here before
- * drawing a View3D.
- */
- if (G.obedit && OBACT && (sima->flag & SI_DRAWSHADOW)) {
- object_handle_update(OBACT);
- }
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- if(sima->image && sima->image->source==IMA_SRC_VIEWER) {
- show_viewer= 1;
- if(sima->image->type==IMA_TYPE_R_RESULT)
- show_render= 1;
- }
-
- what_image(sima);
-
- if(sima->image) {
- image_pixel_aspect(sima->image, &xuser_asp, &yuser_asp);
-
- /* UGLY hack? until now iusers worked fine... but for flipbook viewer we need this */
- if(sima->image->type==IMA_TYPE_COMPOSITE) {
- ImageUser *iuser= ntree_get_active_iuser(G.scene->nodetree);
- if(iuser) {
- BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0);
- G.sima->iuser= *iuser;
- }
- }
- /* and we check for spare */
- ibuf= imagewindow_get_ibuf(sima);
- }
-
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
- imagespace_grid(sima);
- if(show_viewer==0) {
- draw_uvs_sima();
- drawcursor_sima(xuser_asp, yuser_asp);
- }
- }
- else {
- float xim, yim, xoffs=0.0f, yoffs= 0.0f;
-
- if(image_preview_active(sa, &xim, &yim)) {
- xoffs= G.scene->r.disprect.xmin;
- yoffs= G.scene->r.disprect.ymin;
- glColor3ub(0,0,0);
- calc_image_view(sima, 'f');
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- glRectf(0.0f, 0.0f, 1.0f, 1.0f);
- glLoadIdentity();
- }
- else {
- xim= ibuf->x * xuser_asp; yim= ibuf->y * yuser_asp;
- }
-
- /* calc location */
- x1= sima->zoom*xoffs + ((float)sa->winx - sima->zoom*(float)xim)/2.0f;
- y1= sima->zoom*yoffs + ((float)sa->winy - sima->zoom*(float)yim)/2.0f;
-
- x1-= sima->zoom*sima->xof;
- y1-= sima->zoom*sima->yof;
-
- /* needed for gla draw */
- if(show_render) {
- rcti rct= sa->winrct;
-
- imagewindow_draw_renderinfo(sa); /* calls glaDefine2DArea too */
-
- rct.ymax-=RW_HEADERY;
- glaDefine2DArea(&rct);
- }
- else glaDefine2DArea(&sa->winrct);
-
- glPixelZoom(sima->zoom * xuser_asp, sima->zoom * yuser_asp);
-
- if(sima->flag & SI_EDITTILE) {
- /* create char buffer from float if needed */
- if(ibuf->rect_float && ibuf->rect==NULL)
- IMB_rect_from_float(ibuf);
-
- glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
-
- glPixelZoom(1.0, 1.0);
-
- dx= ibuf->x/sima->image->xrep;
- dy= ibuf->y/sima->image->yrep;
- sy= (sima->curtile / sima->image->xrep);
- sx= sima->curtile - sy*sima->image->xrep;
-
- sx*= dx;
- sy*= dy;
-
- calc_image_view(sima, 'p'); /* pixel */
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- cpack(0x0);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx, sy, sx+dx-1, sy+dy-1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- cpack(0xFFFFFF);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx+1, sy+1, sx+dx, sy+dy); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
- else if(sima->mode==SI_TEXTURE) {
-
- if(sima->image->tpageflag & IMA_TILES) {
-
- /* just leave this a while */
- if(sima->image->xrep<1) return;
- if(sima->image->yrep<1) return;
-
- if(sima->curtile >= sima->image->xrep*sima->image->yrep)
- sima->curtile = sima->image->xrep*sima->image->yrep - 1;
-
- dx= ibuf->x/sima->image->xrep;
- dy= ibuf->y/sima->image->yrep;
-
- sy= (sima->curtile / sima->image->xrep);
- sx= sima->curtile - sy*sima->image->xrep;
-
- sx*= dx;
- sy*= dy;
-
- /* create char buffer from float if needed */
- if(ibuf->rect_float && ibuf->rect==NULL)
- IMB_rect_from_float(ibuf);
-
- rect= get_part_from_ibuf(ibuf, sx, sy, sx+dx, sy+dy);
-
- /* rect= ibuf->rect; */
- for(sy= 0; sy+dy<=ibuf->y; sy+= dy) {
- for(sx= 0; sx+dx<=ibuf->x; sx+= dx) {
- glaDrawPixelsSafe(x1+sx*sima->zoom, y1+sy*sima->zoom, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect);
- }
- }
-
- MEM_freeN(rect);
- }
- else {
- float x1_rep, y1_rep;
- int x_rep, y_rep;
- double time_current;
- short loop_draw_ok = 0;
-
- if (sima->flag & SI_DRAW_TILE) {
- loop_draw_ok= 1;
- }
-
- time_current = PIL_check_seconds_timer();
-
- for (x_rep= ((int)G.v2d->cur.xmin)-1; x_rep < G.v2d->cur.xmax; x_rep++) {
- x1_rep=x1+ ((x_rep* ibuf->x * sima->zoom) *xuser_asp);
- for (y_rep= ((int)G.v2d->cur.ymin)-1; y_rep < G.v2d->cur.ymax; y_rep++) {
- y1_rep=y1+ ((y_rep * ibuf->y *sima->zoom) *yuser_asp);
-
- /* end repeating image loop */
-
- if(!loop_draw_ok) {
- y1_rep = y1;
- x1_rep = x1;
- }
-
- /*printf("Drawing %d %d zoom:%.6f (%.6f %.6f), (%.6f %.6f)\n", x_rep, y_rep, sima->zoom, G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);*/
-
- /* this part is generic image display */
- if(sima->flag & SI_SHOW_ALPHA) {
- if(ibuf->rect)
- sima_draw_alpha_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect);
- else if(ibuf->rect_float && ibuf->channels==4)
- sima_draw_alpha_pixelsf(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect_float);
- }
- else if(sima->flag & SI_SHOW_ZBUF && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1))) {
- if(ibuf->zbuf)
- sima_draw_zbuf_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->zbuf);
- else if(ibuf->zbuf_float)
- sima_draw_zbuffloat_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->zbuf_float);
- else if(ibuf->channels==1)
- sima_draw_zbuffloat_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect_float);
- }
- else {
- if(sima->flag & SI_USE_ALPHA) {
- sima_draw_alpha_backdrop(sima, x1_rep, y1_rep, ibuf->x*xuser_asp, ibuf->y*yuser_asp);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- /* detect if we need to redo the curve map.
- ibuf->rect is zero for compositor and render results after change
- convert to 32 bits always... drawing float rects isnt supported well (atis)
-
- NOTE: if float buffer changes, we have to manually remove the rect
- */
-
- if(ibuf->rect_float) {
- if(ibuf->rect==NULL) {
- if(image_curves_active(sa))
- curvemapping_do_ibuf(G.sima->cumap, ibuf);
- else
- IMB_rect_from_float(ibuf);
- }
- }
-
- if(ibuf->rect)
- glaDrawPixelsSafe(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- // else
- // glaDrawPixelsSafe(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
-
- if(sima->flag & SI_USE_ALPHA)
- glDisable(GL_BLEND);
- }
-
- /* only draw once */
- if(!loop_draw_ok) {
- break; /* only draw once */
- } else if ((PIL_check_seconds_timer() - time_current) > 0.25) {
- loop_draw_ok = 0;
- break;
- }
-
- /* tile draw loop */
- }
- /* only draw once */
- if(!loop_draw_ok) break;
- }
- /* tile draw loop */
-
- }
-
- brush= G.scene->toolsettings->imapaint.brush;
- if(brush && (G.scene->toolsettings->imapaint.tool == PAINT_TOOL_CLONE)) {
- int w, h;
- unsigned char *clonerect;
-
- /* this is not very efficient, but glDrawPixels doesn't allow
- drawing with alpha */
- clonerect= alloc_alpha_clone_image(&w, &h);
-
- if(clonerect) {
- int offx, offy;
- offx = sima->zoom*ibuf->x * + brush->clone.offset[0];
- offy = sima->zoom*ibuf->y * + brush->clone.offset[1];
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glaDrawPixelsSafe(x1 + offx, y1 + offy, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, clonerect);
- glDisable(GL_BLEND);
-
- MEM_freeN(clonerect);
- }
- }
-
- glPixelZoom(1.0, 1.0);
-
- if(show_viewer==0) {
- draw_uvs_sima();
- drawcursor_sima(xuser_asp, yuser_asp);
- }
- }
-
- glPixelZoom(1.0, 1.0);
-
- calc_image_view(sima, 'f'); /* float */
- }
-
- draw_image_transform(ibuf, xuser_asp, yuser_asp);
-
- /* draw grease-pencil ('image' strokes) */
- if (sima->flag & SI_DISPGP)
- draw_gpencil_2dimage(sa, ibuf);
-
- mywinset(sa->win); /* restore scissor after gla call... */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- /* draw grease-pencil (screen strokes) */
- if (sima->flag & SI_DISPGP)
- draw_gpencil_2dview(sa, 0);
-
- if(G.rendering==0) {
- draw_image_view_tool();
- }
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, sima->blockscale, sima->blockscale, sima->blockscale);
- if(!(G.rendering && show_render))
- image_blockhandlers(sa);
-
- sa->win_swap= WIN_BACK_OK;
-}
-
-static void image_zoom_set_factor(float zoomfac)
-{
- SpaceImage *sima= curarea->spacedata.first;
- int width, height;
-
- if (zoomfac <= 0.0f)
- return;
-
- sima->zoom *= zoomfac;
-
- if (sima->zoom > 0.1f && sima->zoom < 4.0f)
- return;
-
- /* check zoom limits */
-
- calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where this should be 'p'?*/
- width= 256;
- height= 256;
- if (sima->image) {
- ImBuf *ibuf= imagewindow_get_ibuf(sima);
-
- if (ibuf) {
- float xim, yim;
- /* I know a bit weak... but preview uses not actual image size */
- if(image_preview_active(curarea, &xim, &yim)) {
- width= (int) xim;
- height= (int) yim;
- }
- else {
- width= ibuf->x;
- height= ibuf->y;
- }
- }
- }
- width *= sima->zoom;
- height *= sima->zoom;
-
- if ((width < 4) && (height < 4))
- sima->zoom /= zoomfac;
- else if((curarea->winrct.xmax - curarea->winrct.xmin) <= sima->zoom)
- sima->zoom /= zoomfac;
- else if((curarea->winrct.ymax - curarea->winrct.ymin) <= sima->zoom)
- sima->zoom /= zoomfac;
-}
-
-void image_viewmove(int mode)
-{
- short mval[2], mvalo[2];
- int oldcursor;
- Window *win;
-
- getmouseco_sc(mvalo);
-
-
- oldcursor=get_cursor();
- win=winlay_get_active_window();
-
- SetBlenderCursor(BC_NSEW_SCROLLCURSOR);
-
- while(get_mbut()&(L_MOUSE|M_MOUSE)) {
-
- getmouseco_sc(mval);
-
- if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) {
-
- if(mode==0) {
- G.sima->xof += (mvalo[0]-mval[0])/G.sima->zoom;
- G.sima->yof += (mvalo[1]-mval[1])/G.sima->zoom;
- }
- else if (mode==1) {
- float factor;
-
- factor= 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/300.0;
- image_zoom_set_factor(factor);
- }
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else BIF_wait_for_statechange();
- }
- window_set_cursor(win, oldcursor);
-
- if(image_preview_active(curarea, NULL, NULL)) {
- /* recalculates new preview rect */
- scrarea_do_windraw(curarea);
- image_preview_event(2);
- }
-}
-
-void image_viewzoom(unsigned short event, int invert)
-{
- SpaceImage *sima= curarea->spacedata.first;
-
- if(event==WHEELDOWNMOUSE || event==PADMINUS)
- image_zoom_set_factor((U.uiflag & USER_WHEELZOOMDIR)? 1.25: 0.8);
- else if(event==WHEELUPMOUSE || event==PADPLUSKEY)
- image_zoom_set_factor((U.uiflag & USER_WHEELZOOMDIR)? 0.8: 1.25);
- else if(event==PAD1)
- sima->zoom= 1.0;
- else if(event==PAD2)
- sima->zoom= (invert)? 2.0: 0.5;
- else if(event==PAD4)
- sima->zoom= (invert)? 4.0: 0.25;
- else if(event==PAD8)
- sima->zoom= (invert)? 8.0: 0.125;
-
- /* ensure pixel exact locations for draw */
- sima->xof= (int)sima->xof;
- sima->yof= (int)sima->yof;
-
- if(image_preview_active(curarea, NULL, NULL)) {
- /* recalculates new preview rect */
- scrarea_do_windraw(curarea);
- image_preview_event(2);
- }
-}
-
-/**
- * Updates the fields of the View2D member of the SpaceImage struct.
- * Default behavior is to reset the position of the image and set the zoom to 1
- * If the image will not fit within the window rectangle, the zoom is adjusted
- *
- * @return void
- *
- */
-void image_home(void)
-{
- ImBuf *ibuf;
- int width, height, imgwidth, imgheight;
- float zoomX, zoomY;
-
- if (curarea->spacetype != SPACE_IMAGE) return;
- ibuf= imagewindow_get_ibuf(G.sima);
-
- if (ibuf == NULL) {
- imgwidth = 256;
- imgheight = 256;
- }
- else {
- float xuser_asp, yuser_asp;
- image_pixel_aspect(G.sima->image, &xuser_asp, &yuser_asp);
- imgwidth = ibuf->x * xuser_asp;
- imgheight = ibuf->y * yuser_asp;
- }
-
- /* Check if the image will fit in the image with zoom==1 */
- width = curarea->winx;
- height = curarea->winy;
- if (((imgwidth >= width) || (imgheight >= height)) &&
- ((width > 0) && (height > 0))) {
- /* Find the zoom value that will fit the image in the image space */
- zoomX = ((float)width) / ((float)imgwidth);
- zoomY = ((float)height) / ((float)imgheight);
- G.sima->zoom = 1.0f / power_of_2(1/ MIN2(zoomX, zoomY) );
- }
- else {
- G.sima->zoom= 1.0f;
- }
-
- G.sima->xof= G.sima->yof= 0.0f;
-
- calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where this should be 'p'?*/
- /*calc_arearcts(curarea);*/
- scrarea_queue_winredraw(curarea);
- scrarea_queue_winredraw(curarea);
-}
-
-void image_viewcenter(void)
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- float size, min[2], max[2], d[2], xim=256.0f, yim=256.0f;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- if (!minmax_tface_uv(min, max)) return;
-
- if(ibuf) {
- xim= ibuf->x;
- yim= ibuf->y;
- }
-
- G.sima->xof= (int) (((min[0] + max[0])*0.5f - 0.5f)*xim);
- G.sima->yof= (int) (((min[1] + max[1])*0.5f - 0.5f)*yim);
-
- d[0] = max[0] - min[0];
- d[1] = max[1] - min[1];
- size= 0.5*MAX2(d[0], d[1])*MAX2(xim, yim)/256.0f;
-
- if(size<=0.01) size= 0.01;
-
- G.sima->zoom= 0.7/size;
-
- calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where 'p' is still needed? */
-
- scrarea_queue_winredraw(curarea);
-}
-
-
-/* *********************** render callbacks ***************** */
-
-/* set on initialize render, only one render output to imagewindow can exist, so the global isnt dangerous yet :) */
-static ScrArea *image_area= NULL;
-
-/* can get as well the full picture, as the parts while rendering */
-static void imagewindow_progress(ScrArea *sa, RenderResult *rr, volatile rcti *renrect)
-{
- SpaceImage *sima= sa->spacedata.first;
- float x1, y1, *rectf= NULL;
- unsigned int *rect32= NULL;
- int ymin, ymax, xmin, xmax;
-
- /* if renrect argument, we only display scanlines */
- if(renrect) {
- /* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */
- if(rr->renlay==NULL || renrect->ymax>=rr->recty)
- return;
-
- /* xmin here is first subrect x coord, xmax defines subrect width */
- xmin = renrect->xmin;
- xmax = renrect->xmax - xmin;
- if (xmax<2) return;
-
- ymin= renrect->ymin;
- ymax= renrect->ymax - ymin;
- if(ymax<2)
- return;
- renrect->ymin= renrect->ymax;
- }
- else {
- xmin = ymin = 0;
- xmax = rr->rectx - 2*rr->crop;
- ymax = rr->recty - 2*rr->crop;
- }
-
- /* image window cruft */
-
- /* find current float rect for display, first case is after composit... still weak */
- if(rr->rectf)
- rectf= rr->rectf;
- else {
- if(rr->rect32)
- rect32= (unsigned int *)rr->rect32;
- else {
- if(rr->renlay==NULL || rr->renlay->rectf==NULL) return;
- rectf= rr->renlay->rectf;
- }
- }
- if(rectf) {
- /* if scanline updates... */
- rectf+= 4*(rr->rectx*ymin + xmin);
-
- /* when rendering more pixels than needed, we crop away cruft */
- if(rr->crop)
- rectf+= 4*(rr->crop*rr->rectx + rr->crop);
- }
-
- /* tilerect defines drawing offset from (0,0) */
- /* however, tilerect (xmin, ymin) is first pixel */
- x1 = sima->centx + (rr->tilerect.xmin + rr->crop + xmin)*sima->zoom;
- y1 = sima->centy + (rr->tilerect.ymin + rr->crop + ymin)*sima->zoom;
-
- /* needed for gla draw */
- { rcti rct= sa->winrct; rct.ymax-= RW_HEADERY; glaDefine2DArea(&rct);}
-
- glPixelZoom(sima->zoom, sima->zoom);
-
- if(rect32)
- glaDrawPixelsSafe(x1, y1, xmax, ymax, rr->rectx, GL_RGBA, GL_UNSIGNED_BYTE, rect32);
- else
- glaDrawPixelsSafe_to32(x1, y1, xmax, ymax, rr->rectx, rectf);
-
- glPixelZoom(1.0, 1.0);
-
-}
-
-
-/* in render window; display a couple of scanlines of rendered image */
-/* NOTE: called while render, so no malloc allowed! */
-static void imagewindow_progress_display_cb(RenderResult *rr, volatile rcti *rect)
-{
-
- if (image_area) {
-
- imagewindow_progress(image_area, rr, rect);
-
- /* no screen_swapbuffers, prevent any other window to draw */
- myswapbuffers();
- }
-}
-
-/* unused, init_display_cb is called on each render */
-static void imagewindow_clear_display_cb(RenderResult *rr)
-{
- if (image_area) {
- }
-}
-
-/* returns biggest area that is not uv/image editor. Note that it uses buttons */
-/* window as the last possible alternative. */
-static ScrArea *biggest_non_image_area(void)
-{
- ScrArea *sa, *big= NULL;
- int size, maxsize= 0, bwmaxsize= 0;
- short foundwin= 0;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->winx > 10 && sa->winy > 10) {
- size= sa->winx*sa->winy;
- if(sa->spacetype == SPACE_BUTS) {
- if(foundwin == 0 && size > bwmaxsize) {
- bwmaxsize= size;
- big= sa;
- }
- }
- else if(sa->spacetype != SPACE_IMAGE && size > maxsize) {
- maxsize= size;
- big= sa;
- foundwin= 1;
- }
- }
- }
-
- return big;
-}
-
-static ScrArea *biggest_area(void)
-{
- ScrArea *sa, *big= NULL;
- int size, maxsize= 0;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- size= sa->winx*sa->winy;
- if(size > maxsize) {
- maxsize= size;
- big= sa;
- }
- }
- return big;
-}
-
-
-/* if R_DISPLAYIMAGE
- use Image Window showing Render Result
- else: turn largest non-image area into Image Window (not to frustrate texture or composite usage)
- else: then we use Image Window anyway...
- if R_DISPSCREEN
- make a new temp fullscreen area with Image Window
-*/
-
-static ScrArea *find_area_showing_r_result(void)
-{
- ScrArea *sa;
- SpaceImage *sima;
-
- /* find an imagewindow showing render result */
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- sima= sa->spacedata.first;
- if(sima->image && sima->image->type==IMA_TYPE_R_RESULT)
- break;
- }
- }
- return sa;
-}
-
-static ScrArea *imagewindow_set_render_display(void)
-{
- ScrArea *sa;
- SpaceImage *sima;
-
- sa= find_area_showing_r_result();
-
- if(sa==NULL) {
- /* find largest open non-image area */
- sa= biggest_non_image_area();
- if(sa) {
- newspace(sa, SPACE_IMAGE);
- sima= sa->spacedata.first;
-
- /* makes ESC go back to prev space */
- sima->flag |= SI_PREVSPACE;
- }
- else {
- /* use any area of decent size */
- sa= biggest_area();
- if(sa->spacetype!=SPACE_IMAGE) {
- newspace(sa, SPACE_IMAGE);
- sima= sa->spacedata.first;
-
- /* makes ESC go back to prev space */
- sima->flag |= SI_PREVSPACE;
- }
- }
- }
-
- sima= sa->spacedata.first;
-
- /* get the correct image, and scale it */
- sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
-
- if(G.displaymode==R_DISPLAYSCREEN) {
- if(sa->full==0) {
- sima->flag |= SI_FULLWINDOW;
- /* fullscreen works with lousy curarea */
- curarea= sa;
- area_fullscreen();
- sa= curarea;
- }
- }
-
- return sa;
-}
-
-static void imagewindow_init_display_cb(RenderResult *rr)
-{
-
- image_area= imagewindow_set_render_display();
-
- if(image_area) {
- SpaceImage *sima= image_area->spacedata.first;
-
- areawinset(image_area->win);
-
- /* calc location using original size (tiles don't tell) */
- sima->centx= (image_area->winx - sima->zoom*(float)rr->rectx)/2.0f;
- sima->centy= (image_area->winy - sima->zoom*(float)rr->recty)/2.0f;
-
- sima->centx-= sima->zoom*sima->xof;
- sima->centy-= sima->zoom*sima->yof;
-
- drawimagespace(image_area, sima);
- if(image_area->headertype) scrarea_do_headdraw(image_area);
-
- /* no screen_swapbuffers, prevent any other window to draw */
- myswapbuffers();
-
- allqueue(REDRAWIMAGE, 0); /* redraw in end */
- }
-}
-
-/* coming from BIF_toggle_render_display() */
-void imagewindow_toggle_render(void)
-{
- ScrArea *sa;
-
- /* check if any imagewindow is showing temporal render output */
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= sa->spacedata.first;
-
- if(sima->image && sima->image->type==IMA_TYPE_R_RESULT)
- if(sima->flag & (SI_PREVSPACE|SI_FULLWINDOW))
- break;
- }
- }
- if(sa) {
- addqueue(sa->win, ESCKEY, 1); /* also returns from fullscreen */
- }
- else {
- sa= imagewindow_set_render_display();
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
-}
-
-/* NOTE: called while render, so no malloc allowed! */
-static void imagewindow_renderinfo_cb(RenderStats *rs)
-{
-
- if(image_area) {
- BIF_make_render_text(rs);
-
- imagewindow_draw_renderinfo(image_area);
-
- /* no screen_swapbuffers, prevent any other window to draw */
- myswapbuffers();
- }
-}
-
-void imagewindow_render_callbacks(Render *re)
-{
- RE_display_init_cb(re, imagewindow_init_display_cb);
- RE_display_draw_cb(re, imagewindow_progress_display_cb);
- RE_display_clear_cb(re, imagewindow_clear_display_cb);
- RE_stats_draw_cb(re, imagewindow_renderinfo_cb);
-}
-
diff --git a/source/blender/src/drawimasel.c b/source/blender/src/drawimasel.c
deleted file mode 100644
index e93f7391e32..00000000000
--- a/source/blender/src/drawimasel.c
+++ /dev/null
@@ -1,783 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef _WIN32
-#pragma warning (once : 4761)
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_storage_types.h"
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
-
-#include "BMF_Api.h"
-
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_icons.h"
-#include "BKE_utildefines.h"
-#include "BIF_filelist.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_resources.h"
-#include "BIF_language.h"
-
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_previewrender.h"
-#include "BIF_fsmenu.h"
-#include "BIF_space.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "BSE_drawimasel.h"
-#include "BSE_drawipo.h" /* for v2d functions */
-#include "BSE_view.h"
-
-#include "BLO_readfile.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "PIL_time.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "interface.h" /* urm... for rasterpos_safe, roundbox */
-
-#define BUTTONWIDTH 20
-#define BOOKMARKWIDTH_MAX 240
-
-void calc_imasel_rcts(SpaceImaSel *simasel, int winx, int winy)
-{
- int width = (int)16.0f*simasel->aspect;
- int numtiles;
- int numfiles = 0;
- int tilewidth = simasel->prv_w + TILE_BORDER_X*4;
- int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize;
-
- // complete area of the space
- simasel->v2d.mask.xmin= simasel->v2d.mask.ymin = 0;
- simasel->v2d.mask.xmax= winx;
- simasel->v2d.mask.ymax= winy;
-
- // vertical scroll bar
- simasel->v2d.vert= simasel->v2d.mask;
- simasel->v2d.vert.xmax -= TILE_BORDER_X + 2;
- simasel->v2d.vert.xmin= simasel->v2d.vert.xmax- width - TILE_BORDER_X - 2;
- simasel->v2d.vert.ymax -= IMASEL_BUTTONS_HEIGHT + TILE_BORDER_Y + 2;
- simasel->v2d.vert.ymin += TILE_BORDER_Y + 2;
- // simasel->v2d.mask.xmax= simasel->v2d.vert.xmin;
-
- if ((simasel->flag & FILE_BOOKMARKS) && (simasel->type != FILE_MAIN)) {
- int bmwidth = (simasel->v2d.vert.xmin - simasel->v2d.mask.xmin)/4.0f;
- if (bmwidth > BOOKMARKWIDTH_MAX) bmwidth = BOOKMARKWIDTH_MAX;
-
- simasel->bookmarkrect.xmin = simasel->v2d.mask.xmin + TILE_BORDER_X;
- simasel->bookmarkrect.xmax = simasel->v2d.mask.xmin + bmwidth - TILE_BORDER_X;
- simasel->bookmarkrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y;
- simasel->bookmarkrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y;
-
- simasel->viewrect.xmin = simasel->bookmarkrect.xmax + TILE_BORDER_X;
- simasel->viewrect.xmax = simasel->v2d.vert.xmin - TILE_BORDER_X;
- simasel->viewrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y;
- simasel->viewrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y;
- } else {
- simasel->viewrect.xmin = simasel->v2d.mask.xmin + TILE_BORDER_X;
- simasel->viewrect.xmax = simasel->v2d.vert.xmin - TILE_BORDER_X;
- simasel->viewrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y;
- simasel->viewrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y;
- }
-
- simasel->numtilesx = (simasel->viewrect.xmax - simasel->viewrect.xmin) / tilewidth;
- simasel->numtilesy = (simasel->viewrect.ymax - simasel->viewrect.ymin) / tileheight;
- numtiles = simasel->numtilesx*simasel->numtilesy;
-
- if (simasel->files) {
- numfiles = BIF_filelist_numfiles(simasel->files);
- }
- if (numtiles > numfiles) numtiles = numfiles;
-
- simasel->scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- if (numtiles < numfiles) {
- simasel->scrollheight = ((float)numtiles / (float)numfiles)*simasel->scrollarea;
- simasel->scrollarea -= simasel->scrollheight;
- } else {
- simasel->scrollheight = simasel->scrollarea;
- }
- if (simasel->scrollarea < 0) simasel->scrollarea = 0;
-}
-
-void draw_imasel_scroll(SpaceImaSel *simasel)
-{
- rcti scrollbar;
- rcti scrollhandle;
-
- scrollbar.xmin= simasel->v2d.cur.xmin + simasel->v2d.vert.xmin;
- scrollbar.ymin = simasel->v2d.cur.ymin + simasel->v2d.vert.ymin;
- scrollbar.xmax= simasel->v2d.cur.xmin + simasel->v2d.vert.xmax;
- scrollbar.ymax = simasel->v2d.cur.ymin + simasel->v2d.vert.ymax;
-
- scrollhandle.xmin= scrollbar.xmin;
- scrollhandle.ymin = scrollbar.ymax - simasel->scrollpos -1;
- scrollhandle.xmax= scrollbar.xmax-1;
- scrollhandle.ymax = scrollbar.ymax - simasel->scrollpos - simasel->scrollheight;
-
- BIF_ThemeColor(TH_SHADE1);
- glRecti(scrollbar.xmin, scrollbar.ymin, scrollbar.xmax, scrollbar.ymax);
- uiEmboss(scrollbar.xmin-2, scrollbar.ymin-2, scrollbar.xmax+2, scrollbar.ymax+2, 1);
-
- BIF_ThemeColor(TH_SHADE2);
- glRecti(scrollhandle.xmin, scrollhandle.ymin, scrollhandle.xmax, scrollhandle.ymax);
-
- uiEmboss(scrollhandle.xmin, scrollhandle.ymin, scrollhandle.xmax, scrollhandle.ymax, 1);
-}
-
-static void draw_tile(SpaceImaSel *simasel, short sx, short sy, int colorid)
-{
- /* TODO: BIF_ThemeColor seems to need this to show the color, not sure why? - elubie */
- glEnable(GL_BLEND);
- glColor4ub(0, 0, 0, 100);
- glDisable(GL_BLEND);
-
- BIF_ThemeColor4(colorid);
- uiSetRoundBox(15);
- uiRoundBox(sx+TILE_BORDER_X, sy - simasel->prv_h - TILE_BORDER_Y*3 - U.fontsize, sx + simasel->prv_w + TILE_BORDER_X*3, sy, 6);
-}
-
-static float shorten_string(SpaceImaSel *simasel, char* string, float w)
-{
- short shortened = 0;
- float sw = 0;
-
- sw = BIF_GetStringWidth(simasel->curfont, string, 0);
- while (sw>w) {
- int slen = strlen(string);
- string[slen-1] = '\0';
- sw = BIF_GetStringWidth(simasel->curfont, string, 0);
- shortened = 1;
- }
- if (shortened) {
- int slen = strlen(string);
- if (slen > 3) {
- BLI_strncpy(string+slen-3, "...", 4);
- }
- }
- return sw;
-}
-
-static void draw_file(SpaceImaSel *simasel, short sx, short sy, struct direntry *file)
-{
- short soffs;
- char fname[FILE_MAXFILE];
- float sw;
- float x,y;
-
- BLI_strncpy(fname,file->relname, FILE_MAXFILE);
- sw = shorten_string(simasel, fname, simasel->prv_w );
- soffs = (simasel->prv_w + TILE_BORDER_X*4 - sw) / 2;
- x = (float)(sx+soffs);
- y = (float)(sy - simasel->prv_h - TILE_BORDER_Y*2 - U.fontsize);
-
- ui_rasterpos_safe(x, y, simasel->aspect);
- /* handling of international fonts.
- TODO: proper support for utf8 in languages different from ja_JP abd zh_CH
- needs update of iconv in lib/windows to support getting the system language string
- */
- #ifdef WITH_ICONV
- {
- struct LANGMenuEntry *lme;
- lme = find_language(U.language);
-
- if ((lme !=NULL) && (!strcmp(lme->code, "ja_JP") ||
- !strcmp(lme->code, "zh_CN")))
- {
- BIF_RasterPos(x, y);
-#ifdef WIN32
- BIF_DrawString(simasel->curfont, fname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8));
-#else
- BIF_DrawString(simasel->curfont, fname, (U.transopts & USER_TR_MENUS));
-#endif
- } else {
- BMF_DrawString(simasel->curfont, fname);
- }
- }
-#else
- BMF_DrawString(simasel->curfont, fname);
-#endif /* WITH_ICONV */
-}
-
-static void draw_imasel_bookmarks(ScrArea *sa, SpaceImaSel *simasel)
-{
- char bookmark[FILE_MAX];
- float sw;
-
- if ((simasel->flag & FILE_BOOKMARKS) && (simasel->type != FILE_MAIN)) {
- int nentries = fsmenu_get_nentries();
- int i;
- short sx, sy;
- int bmwidth;
- int linestep = U.fontsize*3/2;
-
- sx = simasel->bookmarkrect.xmin + TILE_BORDER_X;
- sy = simasel->bookmarkrect.ymax - TILE_BORDER_Y - linestep;
- bmwidth = simasel->bookmarkrect.xmax - simasel->bookmarkrect.xmin - 2*TILE_BORDER_X;
-
- if (bmwidth < 0) return;
-
- for (i=0; i< nentries && sy > linestep ;++i) {
- char *fname = fsmenu_get_entry(i);
- char *sname = NULL;
-
- if (fname) {
- int sl;
- BLI_strncpy(bookmark, fname, FILE_MAX);
-
- sl = strlen(bookmark)-1;
- if (bookmark[sl] == '\\' || bookmark[sl] == '/') {
- bookmark[sl] = '\0';
- sl--;
- }
- while (sl) {
- if (bookmark[sl] == '\\' || bookmark[sl] == '/'){
- sl++;
- break;
- };
- sl--;
- }
- sname = &bookmark[sl];
- sw = shorten_string(simasel, sname, bmwidth);
-
-
- if (simasel->active_bookmark == i ) {
- glEnable(GL_BLEND);
- glColor4ub(0, 0, 0, 100);
- glDisable(GL_BLEND);
- BIF_ThemeColor(TH_HILITE);
- uiSetRoundBox(15);
- uiRoundBox(simasel->bookmarkrect.xmin + TILE_BORDER_X - 1, sy - linestep*0.25, simasel->bookmarkrect.xmax - TILE_BORDER_X + 1, sy + linestep*0.75, 6);
- BIF_ThemeColor(TH_TEXT_HI);
- } else {
- BIF_ThemeColor(TH_TEXT);
- }
- ui_rasterpos_safe(sx, sy, simasel->aspect);
-
- /* handling of international fonts.
- TODO: proper support for utf8 in languages different from ja_JP abd zh_CH
- needs update of iconv in lib/windows to support getting the system language string
- */
-#ifdef WITH_ICONV
- {
- struct LANGMenuEntry *lme;
- lme = find_language(U.language);
-
- if ((lme !=NULL) && (!strcmp(lme->code, "ja_JP") ||
- !strcmp(lme->code, "zh_CN")))
- {
- BIF_RasterPos(sx, sy);
-#ifdef WIN32
- BIF_DrawString(simasel->curfont, sname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8));
-#else
- BIF_DrawString(simasel->curfont, sname, (U.transopts & USER_TR_MENUS));
-#endif
- } else {
- BMF_DrawString(simasel->curfont, sname);
- }
- }
-#else
- BMF_DrawString(simasel->curfont, sname);
-#endif /* WITH_ICONV */
-
- sy -= linestep;
- } else {
- cpack(0xB0B0B0);
- sdrawline(sx, sy + U.fontsize/2 , sx + bmwidth, sy + U.fontsize/2);
- cpack(0x303030);
- sdrawline(sx, sy + 1 + U.fontsize/2 , sx + bmwidth, sy + 1 + U.fontsize/2);
- sy -= linestep;
- }
- }
-
- uiEmboss(simasel->bookmarkrect.xmin, simasel->bookmarkrect.ymin, simasel->bookmarkrect.xmax-1, simasel->bookmarkrect.ymax-1, 1);
- }
-}
-
-static void draw_imasel_previews(ScrArea *sa, SpaceImaSel *simasel)
-{
- static double lasttime= 0;
- struct FileList* files = simasel->files;
- int numfiles;
- struct direntry *file;
- int numtiles;
-
- int tilewidth = simasel->prv_w + TILE_BORDER_X*4;
- int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize;
- short sx, sy;
- int do_load = 1;
-
- ImBuf* imb=0;
- int i,j;
- short type;
- int colorid = 0;
- int todo;
- int fileoffset, rowoffset, columnoffset;
- float scrollofs;
-
-
- rcti viewrect = simasel->viewrect;
-
- if (!files) return;
- /* Reload directory */
- BLI_strncpy(simasel->dir, BIF_filelist_dir(files), FILE_MAX);
-
- type = BIF_filelist_gettype(simasel->files);
-
- if (BIF_filelist_empty(files))
- {
- unsigned int filter = 0;
- BIF_filelist_hidedot(simasel->files, simasel->flag & FILE_HIDE_DOT);
- if (simasel->flag & FILE_FILTER) {
- filter = simasel->filter ;
- } else {
- filter = 0;
- }
-
- BIF_filelist_setfilter(simasel->files, filter);
- BIF_filelist_readdir(files);
-
- if(simasel->sort!=FILE_SORTALPHA) BIF_filelist_sort(simasel->files, simasel->sort);
- }
-
- BIF_filelist_imgsize(simasel->files,simasel->prv_w,simasel->prv_h);
-
- numfiles = BIF_filelist_numfiles(files);
- numtiles = simasel->numtilesx*simasel->numtilesy;
-
- if (numtiles > numfiles) numtiles = numfiles;
-
- todo = 0;
- if (lasttime < 0.001) lasttime = PIL_check_seconds_timer();
-
-
- if (simasel->numtilesx > 0) {
- /* calculate the offset to start drawing */
- if ((numtiles < numfiles) && (simasel->scrollarea > 0)) {
- fileoffset = numfiles*( (simasel->scrollpos) / simasel->scrollarea) + 0.5;
- } else {
- fileoffset = 0;
- }
- rowoffset = (fileoffset / simasel->numtilesx)*simasel->numtilesx;
- columnoffset = fileoffset % simasel->numtilesx;
- scrollofs = (float)tileheight*(float)columnoffset/(float)simasel->numtilesx;
- } else {
- rowoffset = 0;
- scrollofs = 0;
- }
- /* add partially visible row */
- numtiles += simasel->numtilesx;
- for (i=rowoffset, j=0 ; (i < numfiles) && (j < numtiles); ++i, ++j)
- {
- sx = simasel->v2d.cur.xmin + viewrect.xmin + (j % simasel->numtilesx)*tilewidth;
- sy = simasel->v2d.cur.ymin + viewrect.ymax + (short)scrollofs - (viewrect.ymin + (j / simasel->numtilesx)*tileheight);
-
- file = BIF_filelist_file(files, i);
-
- if (simasel->active_file == i) {
- colorid = TH_ACTIVE;
- draw_tile(simasel, sx, sy, colorid);
- } else if (file->flags & ACTIVE) {
- colorid = TH_HILITE;
- draw_tile(simasel, sx, sy, colorid);
- } else {
- /*
- colorid = TH_PANEL;
- draw_tile(simasel, sx, sy, colorid);
- */
- }
-
- if ( type == FILE_MAIN) {
- ID *id;
- int icon_id = 0;
- int idcode;
- idcode= BIF_groupname_to_code(simasel->dir);
- if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) {
- id = (ID *)file->poin;
- icon_id = BKE_icon_getid(id);
- }
- if (icon_id) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if (do_load) {
- BIF_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 0);
- } else {
- BIF_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 1);
- todo++;
- }
-
- glDisable(GL_BLEND);
- }
- }
- else {
- if ( (file->flags & IMAGEFILE) || (file->flags & MOVIEFILE))
- {
- if (do_load) {
- BIF_filelist_loadimage(simasel->files, i);
- } else {
- todo++;
- }
- imb = BIF_filelist_getimage(simasel->files, i);
- } else {
- imb = BIF_filelist_getimage(simasel->files, i);
- }
-
- if (imb) {
- float fx = ((float)simasel->prv_w - (float)imb->x)/2.0f;
- float fy = ((float)simasel->prv_h - (float)imb->y)/2.0f;
- short dx = (short)(fx + 0.5f);
- short dy = (short)(fy + 0.5f);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- // glaDrawPixelsSafe((float)sx+8 + dx, (float)sy - imgwidth + dy - 8, imb->x, imb->y, imb->x, GL_RGBA, GL_UNSIGNED_BYTE, imb->rect);
- glColor4f(1.0, 1.0, 1.0, 1.0);
- glaDrawPixelsTex((float)sx+2*TILE_BORDER_X + dx, (float)sy - simasel->prv_h + dy - 2*TILE_BORDER_Y, imb->x, imb->y,GL_UNSIGNED_BYTE, imb->rect);
- // glDisable(GL_BLEND);
- imb = 0;
- }
- }
-
- if (type == FILE_MAIN) {
- glColor3f(1.0f, 1.0f, 1.0f);
- }
- else {
- if (S_ISDIR(file->type)) {
- glColor3f(1.0f, 1.0f, 0.9f);
- }
- else if (file->flags & IMAGEFILE) {
- BIF_ThemeColor(TH_SEQ_IMAGE);
- }
- else if (file->flags & MOVIEFILE) {
- BIF_ThemeColor(TH_SEQ_MOVIE);
- }
- else if (file->flags & BLENDERFILE) {
- BIF_ThemeColor(TH_SEQ_SCENE);
- }
- else {
- if (simasel->active_file == i) {
- BIF_ThemeColor(TH_GRID); /* grid used for active text */
- } else if (file->flags & ACTIVE) {
- BIF_ThemeColor(TH_TEXT_HI);
- } else {
- BIF_ThemeColor(TH_TEXT);
- }
- }
- }
-
- draw_file(simasel, sx, sy, file);
-
- if(do_load && (PIL_check_seconds_timer() - lasttime > 0.3)) {
- lasttime= PIL_check_seconds_timer();
- do_load = 0;
- }
- }
-
- if (!do_load && todo > 0) /* we broke off loading */
- addafterqueue(sa->win, RENDERPREVIEW, 1);
-}
-
-
-/* in panel space! */
-static void imasel_imgdraw(ScrArea *sa, uiBlock *block)
-{
- SpaceImaSel *simasel= sa->spacedata.first;
- rctf dispf;
- rcti winrect;
- struct direntry *file;
- char path[FILE_MAX];
- float tsize;
- short ofsx=0;
- short ofsy=0;
- short ex, ey;
- float scaledx, scaledy;
- int index;
-
- BLI_init_rctf(&dispf, 0.0f, (block->maxx - block->minx)-0.0f, 0.0f, (block->maxy - block->miny)-0.0f);
- ui_graphics_to_window_rct(sa->win, &dispf, &winrect);
-
- if (!simasel->img) {
- BLI_join_dirfile(path, simasel->dir, simasel->file);
- if (!BLI_exists(path))
- return;
-
- index = BIF_filelist_find(simasel->files, simasel->file);
- if (index >= 0) {
- file = BIF_filelist_file(simasel->files,index);
- if (file->flags & IMAGEFILE || file->flags & MOVIEFILE) {
- simasel->img = IMB_loadiffname(path, IB_rect);
-
- if (simasel->img) {
- tsize = MIN2(winrect.xmax - winrect.xmin,winrect.ymax - winrect.ymin);
-
- if (simasel->img->x > simasel->img->y) {
- scaledx = (float)tsize;
- scaledy = ( (float)simasel->img->y/(float)simasel->img->x )*tsize;
- ofsy = (scaledx - scaledy) / 2.0;
- ofsx = 0;
- }
- else {
- scaledy = (float)tsize;
- scaledx = ( (float)simasel->img->x/(float)simasel->img->y )*tsize;
- ofsx = (scaledy - scaledx) / 2.0;
- ofsy = 0;
- }
- ex = (short)scaledx;
- ey = (short)scaledy;
-
- IMB_scaleImBuf(simasel->img, ex, ey);
- }
- }
- }
- }
- if (simasel->img == NULL)
- return;
- if(simasel->img->rect==NULL)
- return;
-
- /* correction for gla draw */
- BLI_translate_rcti(&winrect, -curarea->winrct.xmin, -curarea->winrct.ymin);
-
- glaDefine2DArea(&sa->winrct);
- glaDrawPixelsSafe(winrect.xmin+ofsx, winrect.ymin+ofsy, simasel->img->x, simasel->img->y, simasel->img->x, GL_RGBA, GL_UNSIGNED_BYTE, simasel->img->rect);
-}
-
-static void imasel_panel_image(ScrArea *sa, short cntrl)
-{
- uiBlock *block;
- SpaceImaSel *simasel= sa->spacedata.first;
- short w = 300;
- short h = 300;
- short offsx, offsy;
-
- if (simasel->img) {
- w = simasel->img->x;
- h = simasel->img->y;
- }
-
- offsx = -150 + (simasel->v2d.mask.xmax - simasel->v2d.mask.xmin)/2;
- offsy = -150 + (simasel->v2d.mask.ymax - simasel->v2d.mask.ymin)/2;
-
- block= uiNewBlock(&curarea->uiblocks, "imasel_panel_image", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IMASEL_HANDLER_IMAGE); // for close and esc
- if(uiNewPanel(curarea, block, "Image Preview", "Image Browser", offsx, offsy, w, h)==0)
- return;
- uiBlockSetDrawExtraFunc(block, imasel_imgdraw);
-}
-
-static void imasel_blockhandlers(ScrArea *sa)
-{
- SpaceImaSel *simasel= sa->spacedata.first;
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(simasel->blockhandler[a]) {
-
- case IMASEL_HANDLER_IMAGE:
- imasel_panel_image(sa, simasel->blockhandler[a+1]);
- break;
-
- }
- /* clear action value for event */
- simasel->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-}
-
-
-static void draw_imasel_buttons(ScrArea *sa, SpaceImaSel* simasel)
-{
- uiBlock *block;
- int loadbutton;
- char name[20];
- char *menu;
- float slen;
- float parentbut_width = 20;
- float bookmarkbut_width = 0.0f;
- float file_start_width = 0.0f;
-
- int filebuty1, filebuty2;
-
- float xmin = simasel->v2d.mask.xmin + 10;
- float xmax = simasel->v2d.mask.xmax - 10;
-
- filebuty1= simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT;
- filebuty2= filebuty1+IMASEL_BUTTONS_HEIGHT/2 -6;
-
- /* HEADER */
- sprintf(name, "win %d", sa->win);
- block = uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->win);
-
- uiSetButLock( BIF_filelist_gettype(simasel->files)==FILE_MAIN && simasel->returnfunc, NULL);
-
- /* space available for load/save buttons? */
- slen = BIF_GetStringWidth(G.font, simasel->title, simasel->aspect);
- loadbutton= slen > 60 ? slen + 20 : 80; /* MAX2(80, 20+BIF_GetStringWidth(G.font, simasel->title)); */
- if(simasel->v2d.mask.xmax-simasel->v2d.mask.xmin > loadbutton+20) {
- if(simasel->title[0]==0) {
- loadbutton= 0;
- }
- }
- else {
- loadbutton= 0;
- }
-
- menu= fsmenu_build_menu();
-
- if (menu[0]&& (simasel->type != FILE_MAIN)) {
- bookmarkbut_width = parentbut_width;
- file_start_width = parentbut_width;
- }
-
- uiDefBut(block, TEX, B_FS_FILENAME,"", xmin+file_start_width+bookmarkbut_width+2, filebuty1, xmax-xmin-loadbutton-file_start_width-bookmarkbut_width, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
- uiDefBut(block, TEX, B_FS_DIRNAME,"", xmin+parentbut_width, filebuty2, xmax-xmin-loadbutton-parentbut_width, 21, simasel->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
-
- if(loadbutton) {
- uiSetCurFont(block, UI_HELV);
- uiDefBut(block, BUT,B_FS_LOAD, simasel->title, xmax-loadbutton, filebuty2, loadbutton, 21, simasel->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
- uiDefBut(block, BUT,B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
- }
-
- /* menu[0] = NULL happens when no .Bfs is there, and first time browse
- disallow external directory browsing for databrowse */
- if(menu[0] && (simasel->type != FILE_MAIN)) {
- uiDefButS(block, MENU,B_FS_DIR_MENU, menu, xmin, filebuty1, parentbut_width, 21, &simasel->menu, 0, 0, 0, 0, "");
- uiDefBut(block, BUT, B_FS_BOOKMARK, "B", xmin+22, filebuty1, bookmarkbut_width, 21, 0, 0, 0, 0, 0, "Bookmark current directory");
- }
- MEM_freeN(menu);
-
- uiDefBut(block, BUT, B_FS_PARDIR, "P", xmin, filebuty2, parentbut_width, 21, 0, 0, 0, 0, 0, "Move to the parent directory (PKEY)");
-
- uiDrawBlock(block);
-}
-
-
-
-/* ************** main drawing function ************** */
-
-void drawimaselspace(ScrArea *sa, void *spacedata)
-{
- float col[3];
- SpaceImaSel *simasel= curarea->spacedata.first;
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* HACK: somehow when going fullscreen, v2d isn't set correctly */
- simasel->v2d.cur.xmin= simasel->v2d.cur.ymin= 0.0f;
- simasel->v2d.cur.xmax= sa->winx;
- simasel->v2d.cur.ymax= sa->winy;
- simasel->v2d.tot= simasel->v2d.cur;
- test_view2d(G.v2d, sa->winx, sa->winy);
-
- calc_imasel_rcts(simasel, sa->winx, sa->winy);
-
- myortho2(simasel->v2d.cur.xmin, simasel->v2d.cur.xmax, simasel->v2d.cur.ymin, simasel->v2d.cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- /* warning; blocks need to be freed each time, handlers dont remove */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- /* aspect+font, set each time */
- simasel->aspect= (simasel->v2d.cur.xmax - simasel->v2d.cur.xmin)/((float)sa->winx);
- simasel->curfont= uiSetCurFont_ext(simasel->aspect);
-
- if (!simasel->files) {
- simasel->files = BIF_filelist_new();
- BIF_filelist_setdir(simasel->files, simasel->dir);
- BIF_filelist_settype(simasel->files, simasel->type);
- }
-
- /* Buttons */
- draw_imasel_buttons(sa, simasel);
-
- /* scrollbar */
- draw_imasel_scroll(simasel);
-
- /* bookmarks */
- draw_imasel_bookmarks(sa, simasel);
-
- uiEmboss(simasel->viewrect.xmin, simasel->viewrect.ymin, simasel->v2d.mask.xmax-TILE_BORDER_X, simasel->viewrect.ymax, 1);
-
-
- glScissor(sa->winrct.xmin + simasel->viewrect.xmin ,
- sa->winrct.ymin + simasel->viewrect.ymin,
- simasel->viewrect.xmax - simasel->viewrect.xmin ,
- simasel->viewrect.ymax - simasel->viewrect.ymin);
-
- /* previews */
- draw_imasel_previews(sa, simasel);
-
- /* BIF_ThemeColor(TH_HEADER);*/
- /* glRecti(simasel->viewrect.xmin, simasel->viewrect.ymin, simasel->viewrect.xmax, simasel->viewrect.ymax);*/
-
- /* restore viewport (not needed yet) */
- mywinset(sa->win);
-
- /* ortho at pixel level curarea */
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
-
- draw_area_emboss(sa);
-
- imasel_blockhandlers(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-}
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
deleted file mode 100644
index 973782d7463..00000000000
--- a/source/blender/src/drawipo.c
+++ /dev/null
@@ -1,2802 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_cursors.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_glutil.h"
-#include "BIF_editseq.h"
-#include "BIF_editaction.h"
-#include "BIF_language.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_view.h"
-#include "BSE_editipo.h"
-#include "BSE_editipo_types.h"
-#include "BSE_editnla_types.h"
-#include "BSE_time.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "butspace.h" // shouldnt be...
-#include "interface.h" /* for ui_rasterpos_safe */
-#include "winlay.h"
-
-/* local define... also used in editipo ... */
-#define ISPOIN(a, b, c) ( (a->b) && (a->c) )
-#define ISPOIN3(a, b, c, d) ( (a->b) && (a->c) && (a->d) )
-#define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) )
-
- /* minimum pixels per gridstep */
-#define IPOSTEP 35
-
-static float ipogrid_dx, ipogrid_dy, ipogrid_startx, ipogrid_starty;
-static int ipomachtx, ipomachty;
-
-static int vertymin, vertymax, horxmin, horxmax; /* globals to test LEFTMOUSE for scrollbar */
-
-static void scroll_prstr(float x, float y, float val, char dir, int disptype)
-{
- int len, macht;
- char str[32];
-
- if(dir=='v') {
- macht= ipomachty;
- if ELEM(disptype, IPO_DISPDEGR, IPO_DISPTIME) {
- macht+=1;
- val *= 10;
- }
- }
- else macht= ipomachtx;
-
- if (macht<=0) sprintf(str, "%.*f", 1-macht, val);
- else sprintf(str, "%d", (int)floor(val + 0.375));
-
- len= strlen(str);
- if(dir=='h') x-= 4*len;
-
- if(dir=='v' && disptype==IPO_DISPDEGR) {
- str[len]= 186; /* Degree symbol */
- str[len+1]= 0;
- }
-
- ui_rasterpos_safe(x, y, 1.0);
- BIF_DrawString(G.fonts, str, 0);
-}
-
-static void step_to_grid(float *step, int *macht)
-{
- float loga, rem;
-
- /* try to write step as a power of 10 */
-
- loga= log10(*step);
- *macht= (int)(loga);
-
- rem= loga- *macht;
- rem= pow(10.0, rem);
-
- if(loga<0.0) {
- if(rem < 0.2) rem= 0.2;
- else if(rem < 0.5) rem= 0.5;
- else rem= 1.0;
-
- *step= rem*pow(10.0, (float)*macht);
-
- // partial of a frame have no meaning
- switch(curarea->spacetype) {
- case SPACE_TIME: {
- SpaceTime *stime= curarea->spacedata.first;
- if(stime->flag & TIME_DRAWFRAMES) {
- rem = 1.0;
- *step = 1.0;
- }
- break;
- }
- case SPACE_SEQ: {
- SpaceTime * sseq= curarea->spacedata.first;
- if (sseq->flag & SEQ_DRAWFRAMES) {
- rem = 1.0;
- *step = 1.0;
- }
- }
- default:
- break;
- }
-
-
-
- if(rem==1.0) (*macht)++; // prevents printing 1.0 2.0 3.0 etc
- }
- else {
- if(rem < 2.0) rem= 2.0;
- else if(rem < 5.0) rem= 5.0;
- else rem= 10.0;
-
- *step= rem*pow(10.0, (float)*macht);
-
- (*macht)++;
- if(rem==10.0) (*macht)++; // prevents printing 1.0 2.0 3.0 etc
- }
-}
-
-void calc_ipogrid()
-{
- float space, pixels, secondiv=1.0;
- int secondgrid= 0;
- /* rule: gridstep is minimal IPOSTEP pixels */
- /* how large is IPOSTEP pixels? */
-
- if(G.v2d==0) return;
-
- /* detect of we have seconds or frames, should become argument */
-
- switch(curarea->spacetype) {
- case SPACE_TIME: {
- SpaceTime *stime= curarea->spacedata.first;
- if(!(stime->flag & TIME_DRAWFRAMES)) {
- secondgrid= 1;
- secondiv= 0.01 * FPS;
- }
- break;
- }
- case SPACE_SEQ: {
- SpaceSeq * sseq = curarea->spacedata.first;
- if (!(sseq->flag & SEQ_DRAWFRAMES)) {
- secondgrid = 1;
- secondiv = 0.01 * FPS;
- }
- break;
- }
- case SPACE_ACTION: {
- SpaceAction *saction = curarea->spacedata.first;
- if (saction->flag & SACTION_DRAWTIME) {
- secondgrid = 1;
- secondiv = 0.01 * FPS;
- }
- break;
- }
- case SPACE_NLA: {
- SpaceNla *snla = curarea->spacedata.first;
- if (snla->flag & SNLA_DRAWTIME) {
- secondgrid = 1;
- secondiv = 0.01 * FPS;
- }
- break;
- }
- default:
- break;
- }
-
- space= G.v2d->cur.xmax - G.v2d->cur.xmin;
- pixels= G.v2d->mask.xmax-G.v2d->mask.xmin;
-
- ipogrid_dx= IPOSTEP*space/(secondiv*pixels);
- step_to_grid(&ipogrid_dx, &ipomachtx);
- ipogrid_dx*= secondiv;
-
- if ELEM5(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME, SPACE_ACTION, SPACE_NLA) {
- if(ipogrid_dx < 0.1) ipogrid_dx= 0.1;
- ipomachtx-= 2;
- if(ipomachtx<-2) ipomachtx= -2;
- }
-
- space= (G.v2d->cur.ymax - G.v2d->cur.ymin);
- pixels= curarea->winy;
- ipogrid_dy= IPOSTEP*space/pixels;
- step_to_grid(&ipogrid_dy, &ipomachty);
-
- if ELEM5(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME, SPACE_ACTION, SPACE_NLA) {
- if(ipogrid_dy < 1.0) ipogrid_dy= 1.0;
- if(ipomachty<1) ipomachty= 1;
- }
-
- ipogrid_startx= secondiv*(G.v2d->cur.xmin/secondiv - fmod(G.v2d->cur.xmin/secondiv, ipogrid_dx/secondiv));
- if(G.v2d->cur.xmin<0.0) ipogrid_startx-= ipogrid_dx;
-
- ipogrid_starty= (G.v2d->cur.ymin-fmod(G.v2d->cur.ymin, ipogrid_dy));
- if(G.v2d->cur.ymin<0.0) ipogrid_starty-= ipogrid_dy;
-
-}
-
-void draw_ipogrid(void)
-{
- float vec1[2], vec2[2];
- int a, step;
-
- vec1[0]= vec2[0]= ipogrid_startx;
- vec1[1]= ipogrid_starty;
- vec2[1]= G.v2d->cur.ymax;
-
- step= (G.v2d->mask.xmax-G.v2d->mask.xmin+1)/IPOSTEP;
-
- BIF_ThemeColor(TH_GRID);
-
- for(a=0; a<step; a++) {
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1); glVertex2fv(vec2);
- glEnd();
- vec2[0]= vec1[0]+= ipogrid_dx;
- }
-
- vec2[0]= vec1[0]-= 0.5*ipogrid_dx;
-
- BIF_ThemeColorShade(TH_GRID, 16);
-
- step++;
- for(a=0; a<=step; a++) {
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1); glVertex2fv(vec2);
- glEnd();
- vec2[0]= vec1[0]-= ipogrid_dx;
- }
-
- if ELEM4(curarea->spacetype, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME);
- else {
- vec1[0]= ipogrid_startx;
- vec1[1]= vec2[1]= ipogrid_starty;
- vec2[0]= G.v2d->cur.xmax;
-
- step= (curarea->winy+1)/IPOSTEP;
-
- BIF_ThemeColor(TH_GRID);
- for(a=0; a<=step; a++) {
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1); glVertex2fv(vec2);
- glEnd();
- vec2[1]= vec1[1]+= ipogrid_dy;
- }
- vec2[1]= vec1[1]-= 0.5*ipogrid_dy;
- step++;
-
- if(curarea->spacetype==SPACE_IPO) {
- BIF_ThemeColorShade(TH_GRID, 16);
- for(a=0; a<step; a++) {
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1); glVertex2fv(vec2);
- glEnd();
- vec2[1]= vec1[1]-= ipogrid_dy;
- }
- }
- }
-
- BIF_ThemeColorShade(TH_GRID, -50);
-
- if (curarea->spacetype!=SPACE_ACTION && curarea->spacetype!=SPACE_NLA)
- { /* Horizontal axis */
- vec1[0]= G.v2d->cur.xmin;
- vec2[0]= G.v2d->cur.xmax;
- vec1[1]= vec2[1]= 0.0;
- glBegin(GL_LINE_STRIP);
-
- glVertex2fv(vec1);
- glVertex2fv(vec2);
-
- glEnd();
- }
-
- /* Vertical axis */
-
- vec1[1]= G.v2d->cur.ymin;
- vec2[1]= G.v2d->cur.ymax;
- vec1[0]= vec2[0]= 0.0;
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1); glVertex2fv(vec2);
- glEnd();
-
- /* Limits box */
- if(curarea->spacetype==SPACE_IPO) {
- if(G.sipo->blocktype==ID_SEQ) {
- Sequence * last_seq = get_last_seq();
- float start = 0.0;
- float end = 100.0;
-
- if (last_seq &&
- ((last_seq->flag & SEQ_IPO_FRAME_LOCKED) != 0)) {
- start = last_seq->startdisp;
- end = last_seq->enddisp;
- }
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glRectf(start, 0.0, end, 1.0);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
- else if(ELEM(G.sipo->blocktype, ID_CU, ID_CO)) {
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glRectf(0.0, 1.0, G.v2d->cur.xmax, 1.0);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
- }
-}
-
-void areamouseco_to_ipoco(View2D *v2d, short *mval, float *x, float *y)
-{
- float div, ofs;
-
- div= v2d->mask.xmax-v2d->mask.xmin;
- ofs= v2d->mask.xmin;
-
- *x= v2d->cur.xmin+ (v2d->cur.xmax-v2d->cur.xmin)*(mval[0]-ofs)/div;
-
- div= v2d->mask.ymax-v2d->mask.ymin;
- ofs= v2d->mask.ymin;
-
- *y= v2d->cur.ymin+ (v2d->cur.ymax-v2d->cur.ymin)*(mval[1]-ofs)/div;
-}
-
-void ipoco_to_areaco(View2D *v2d, float *vec, short *mval)
-{
- float x, y;
-
- mval[0]= IS_CLIPPED;
-
- x= (vec[0] - v2d->cur.xmin)/(v2d->cur.xmax-v2d->cur.xmin);
- y= (vec[1] - v2d->cur.ymin)/(v2d->cur.ymax-v2d->cur.ymin);
-
- if(x>=0.0 && x<=1.0) {
- if(y>=0.0 && y<=1.0) {
- mval[0]= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin);
- mval[1]= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin);
- }
- }
-}
-
-void ipoco_to_areaco_noclip(View2D *v2d, float *vec, short *mval)
-{
- float x, y;
-
- x= (vec[0] - v2d->cur.xmin)/(v2d->cur.xmax-v2d->cur.xmin);
- y= (vec[1] - v2d->cur.ymin)/(v2d->cur.ymax-v2d->cur.ymin);
-
- x= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin);
- y= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin);
-
- if(x<-32760) mval[0]= -32760;
- else if(x>32760) mval[0]= 32760;
- else mval[0]= x;
-
- if(y<-32760) mval[1]= -32760;
- else if(y>32760) mval[1]= 32760;
- else mval[1]= y;
-}
-
-int in_ipo_buttons(void)
-{
- short mval[2];
-
- getmouseco_areawin(mval);
-
- if(mval[0]< G.v2d->mask.xmax) return 0;
- else return 1;
-}
-
-View2D *spacelink_get_view2d(SpaceLink *sl)
-{
- if(sl->spacetype==SPACE_IPO)
- return &((SpaceIpo *)sl)->v2d;
- else if(sl->spacetype==SPACE_SOUND)
- return &((SpaceSound *)sl)->v2d;
- if(sl->spacetype==SPACE_ACTION)
- return &((SpaceAction *)sl)->v2d;
- if(sl->spacetype==SPACE_NLA)
- return &((SpaceNla *)sl)->v2d;
- if(sl->spacetype==SPACE_TIME)
- return &((SpaceTime *)sl)->v2d;
- if(sl->spacetype==SPACE_SEQ)
- return &((SpaceSeq *)sl)->v2d;
- return NULL;
-}
-
-/* copies changes in this view from or to all 2d views with lock option open */
-/* do not call this inside of drawing routines, to prevent eternal loops */
-void view2d_do_locks(ScrArea *cursa, int flag)
-{
- ScrArea *sa;
- View2D *v2d, *curv2d;
- SpaceLink *sl;
-
- curv2d= spacelink_get_view2d(cursa->spacedata.first);
- if(curv2d==NULL) return;
- if((curv2d->flag & V2D_VIEWLOCK)==0) return;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa!=cursa) {
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
-
- v2d= spacelink_get_view2d(sl);
- if(v2d) {
- if(v2d->flag & V2D_VIEWLOCK) {
- if(flag & V2D_LOCK_COPY) {
- v2d->cur.xmin= curv2d->cur.xmin;
- v2d->cur.xmax= curv2d->cur.xmax;
- }
- else {
- curv2d->cur.xmin= v2d->cur.xmin;
- curv2d->cur.xmax= v2d->cur.xmax;
- scrarea_queue_winredraw(sa);
- }
-
- if(flag & V2D_LOCK_REDRAW) {
- if(sl == sa->spacedata.first)
- scrarea_do_windraw(sa);
- }
- else
- scrarea_queue_winredraw(sa);
- }
- }
- }
- }
- }
-}
-
-/* event based, note: curarea is in here... */
-void view2d_zoom(View2D *v2d, float factor, int winx, int winy)
-{
- float dx= factor*(v2d->cur.xmax-v2d->cur.xmin);
- float dy= factor*(v2d->cur.ymax-v2d->cur.ymin);
- if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) {
- v2d->cur.xmin+= dx;
- v2d->cur.xmax-= dx;
- }
- if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) {
- v2d->cur.ymin+= dy;
- v2d->cur.ymax-= dy;
- }
- test_view2d(v2d, winx, winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-}
-
-void view2d_getscale(View2D *v2d, float *x, float *y) {
- if (x) *x = (G.v2d->mask.xmax-G.v2d->mask.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- if (y) *y = (G.v2d->mask.ymax-G.v2d->mask.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
-}
-
-void test_view2d(View2D *v2d, int winx, int winy)
-{
- /* cur is not allowed to be larger than max, smaller than min, or outside of tot */
- rctf *cur, *tot;
- float dx, dy, temp, fac, zoom;
-
- /* correct winx for scroll */
- if(v2d->scroll & L_SCROLL) winx-= SCROLLB;
- if(v2d->scroll & B_SCROLL) winy-= SCROLLH;
- if(v2d->scroll & B_SCROLLO) winy-= SCROLLH; /* B_SCROLL and B_SCROLLO are basically same thing */
-
- /* header completely closed window */
- if(winy<=0) return;
-
- cur= &v2d->cur;
- tot= &v2d->tot;
-
- dx= cur->xmax-cur->xmin;
- dy= cur->ymax-cur->ymin;
-
- /* Reevan's test */
- if (v2d->keepzoom & V2D_LOCKZOOM_Y)
- v2d->cur.ymax=v2d->cur.ymin+((float)winy);
-
- if (v2d->keepzoom & V2D_LOCKZOOM_X)
- v2d->cur.xmax=v2d->cur.xmin+((float)winx);
-
- if(v2d->keepzoom) {
-
- zoom= ((float)winx)/dx;
-
- if(zoom<v2d->minzoom || zoom>v2d->maxzoom) {
- if(zoom<v2d->minzoom) fac= zoom/v2d->minzoom;
- else fac= zoom/v2d->maxzoom;
-
- dx*= fac;
- temp= 0.5*(cur->xmax+cur->xmin);
-
- cur->xmin= temp-0.5*dx;
- cur->xmax= temp+0.5*dx;
- }
-
- zoom= ((float)winy)/dy;
-
- if(zoom<v2d->minzoom || zoom>v2d->maxzoom) {
- if(zoom<v2d->minzoom) fac= zoom/v2d->minzoom;
- else fac= zoom/v2d->maxzoom;
-
- dy*= fac;
- temp= 0.5*(cur->ymax+cur->ymin);
- cur->ymin= temp-0.5*dy;
- cur->ymax= temp+0.5*dy;
- }
- }
- else {
- if(dx<G.v2d->min[0]) {
- dx= G.v2d->min[0];
- temp= 0.5*(cur->xmax+cur->xmin);
- cur->xmin= temp-0.5*dx;
- cur->xmax= temp+0.5*dx;
- }
- else if(dx>G.v2d->max[0]) {
- dx= G.v2d->max[0];
- temp= 0.5*(cur->xmax+cur->xmin);
- cur->xmin= temp-0.5*dx;
- cur->xmax= temp+0.5*dx;
- }
-
- if(dy<G.v2d->min[1]) {
- dy= G.v2d->min[1];
- temp= 0.5*(cur->ymax+cur->ymin);
- cur->ymin= temp-0.5*dy;
- cur->ymax= temp+0.5*dy;
- }
- else if(dy>G.v2d->max[1]) {
- dy= G.v2d->max[1];
- temp= 0.5*(cur->ymax+cur->ymin);
- cur->ymin= temp-0.5*dy;
- cur->ymax= temp+0.5*dy;
- }
- }
-
- if(v2d->keepaspect) {
- short do_x=0, do_y=0;
-
- /* when a window edge changes, the aspect ratio can't be used to
- find which is the best new 'cur' rect. thats why it stores 'old' */
- if(winx!=v2d->oldwinx) do_x= 1;
- if(winy!=v2d->oldwiny) do_y= 1;
-
- dx= (cur->ymax-cur->ymin)/(cur->xmax-cur->xmin);
- dy= ((float)winy)/((float)winx);
-
- if(do_x==do_y) { // both sizes change, ctrl+uparrow
- if(do_x==1 && do_y==1) {
- if( ABS(winx-v2d->oldwinx)>ABS(winy-v2d->oldwiny)) do_y= 0;
- else do_x= 0;
- }
- else if( dy > 1.0) do_x= 0; else do_x= 1;
- }
-
- if( do_x ) {
- if (v2d->keeptot == 2 && winx < v2d->oldwinx) {
- /* This is a special hack for the outliner, to ensure that the
- * outliner contents will not eventually get pushed out of view
- * when shrinking the view.
- */
- cur->xmax -= cur->xmin;
- cur->xmin= 0.0f;
- }
- else {
- /* portrait window: correct for x */
- dx= cur->ymax-cur->ymin;
- temp= (cur->xmax+cur->xmin);
-
- cur->xmin= temp/2.0 - 0.5*dx/dy;
- cur->xmax= temp/2.0 + 0.5*dx/dy;
- }
- }
- else {
- dx= cur->xmax-cur->xmin;
- temp= (cur->ymax+cur->ymin);
-
- cur->ymin= temp/2.0 - 0.5*dy*dx;
- cur->ymax= temp/2.0 + 0.5*dy*dx;
- }
-
- v2d->oldwinx= winx;
- v2d->oldwiny= winy;
- }
-
- if(v2d->keeptot) {
- dx= cur->xmax-cur->xmin;
- dy= cur->ymax-cur->ymin;
-
- if(dx > tot->xmax-tot->xmin) {
- if(v2d->keepzoom==0) {
- if(cur->xmin<tot->xmin) cur->xmin= tot->xmin;
- if(cur->xmax>tot->xmax) cur->xmax= tot->xmax;
- }
- else {
- if(cur->xmax < tot->xmax) {
- dx= tot->xmax-cur->xmax;
- cur->xmin+= dx;
- cur->xmax+= dx;
- }
- else if(cur->xmin > tot->xmin) {
- dx= cur->xmin-tot->xmin;
- cur->xmin-= dx;
- cur->xmax-= dx;
- }
- }
- }
- else {
- if(cur->xmin < tot->xmin) {
- dx= tot->xmin-cur->xmin;
- cur->xmin+= dx;
- cur->xmax+= dx;
- }
- else if((v2d->keeptot!=2) && (cur->xmax > tot->xmax)) {
- /* keeptot==2 is a special case for the outliner. see space.c, init_v2d_oops for details */
- dx= cur->xmax-tot->xmax;
- cur->xmin-= dx;
- cur->xmax-= dx;
- }
- }
-
- if(dy > tot->ymax-tot->ymin) {
- if(v2d->keepzoom==0) {
- if(cur->ymin<tot->ymin) cur->ymin= tot->ymin;
- if(cur->ymax>tot->ymax) cur->ymax= tot->ymax;
- }
- else {
- if(cur->ymax < tot->ymax) {
- dy= tot->ymax-cur->ymax;
- cur->ymin+= dy;
- cur->ymax+= dy;
- }
- else if(cur->ymin > tot->ymin) {
- dy= cur->ymin-tot->ymin;
- cur->ymin-= dy;
- cur->ymax-= dy;
- }
- }
- }
- else {
- if(cur->ymin < tot->ymin) {
- dy= tot->ymin-cur->ymin;
- cur->ymin+= dy;
- cur->ymax+= dy;
- }
- else if(cur->ymax > tot->ymax) {
- dy= cur->ymax-tot->ymax;
- cur->ymin-= dy;
- cur->ymax-= dy;
- }
- }
- }
-}
-
-#define IPOBUTX 70
-static int calc_ipobuttonswidth(ScrArea *sa)
-{
- SpaceIpo *sipo= sa->spacedata.first;
- EditIpo *ei;
- int ipowidth = IPOBUTX;
- int a;
- float textwidth = 0;
-
- /* default width when no space ipo or no channels */
- if (sipo == NULL) return IPOBUTX;
- if ((sipo->totipo==0) || (sipo->editipo==NULL)) return IPOBUTX;
-
- ei= sipo->editipo;
-
- for(a=0; a<sipo->totipo; a++, ei++) {
- textwidth = BIF_GetStringWidth(G.font, ei->name, 0);
- if (textwidth + 18 > ipowidth)
- ipowidth = textwidth + 18;
- }
- return ipowidth;
-
-}
-
-void calc_scrollrcts(ScrArea *sa, View2D *v2d, int winx, int winy)
-{
- v2d->mask.xmin= v2d->mask.ymin= 0;
- v2d->mask.xmax= winx;
- v2d->mask.ymax= winy;
-
- if(sa->spacetype==SPACE_ACTION) {
- if(sa->winx > ACTWIDTH+50) {
- v2d->mask.xmin+= ACTWIDTH;
- v2d->hor.xmin+=ACTWIDTH;
- }
- }
- else if(sa->spacetype==SPACE_NLA){
- if(sa->winx > NLAWIDTH+50) {
- v2d->mask.xmin+= NLAWIDTH;
- v2d->hor.xmin+=NLAWIDTH;
- }
- }
- else if(sa->spacetype==SPACE_IPO) {
- int ipobutx = calc_ipobuttonswidth(sa);
-
- v2d->mask.xmax-= ipobutx;
-
- if(v2d->mask.xmax<ipobutx)
- v2d->mask.xmax= winx;
- }
-
- if(v2d->scroll) {
- if(v2d->scroll & L_SCROLL) {
- v2d->vert= v2d->mask;
- v2d->vert.xmax= SCROLLB;
- v2d->mask.xmin= SCROLLB;
- }
- else if(v2d->scroll & R_SCROLL) {
- v2d->vert= v2d->mask;
- v2d->vert.xmin= v2d->vert.xmax-SCROLLB;
- v2d->mask.xmax= v2d->vert.xmin;
- }
-
- if((v2d->scroll & B_SCROLL) || (v2d->scroll & B_SCROLLO)) {
- v2d->hor= v2d->mask;
- v2d->hor.ymax= SCROLLH;
- v2d->mask.ymin= SCROLLH;
- }
- else if(v2d->scroll & T_SCROLL) {
- v2d->hor= v2d->mask;
- v2d->hor.ymin= v2d->hor.ymax-SCROLLH;
- v2d->mask.ymax= v2d->hor.ymin;
- }
- }
-}
-
- /* draws a line in left vertical scrollbar at the given height */
-static void draw_solution_line(View2D *v2d, float h)
-{
- float vec[2];
- short mval[2];
-
- vec[0]= v2d->cur.xmin;
- vec[1]= h;
- ipoco_to_areaco(v2d, vec, mval);
- if(mval[0]!=IS_CLIPPED) {
- glBegin(GL_LINES);
- glVertex2f(v2d->vert.xmin, mval[1]);
- glVertex2f(v2d->vert.xmax, mval[1]);
- glEnd();
- }
-}
-
-static void draw_solution(SpaceIpo *sipo)
-{
- View2D *v2d= &sipo->v2d;
- EditIpo *ei;
- int a;
-
- if (!(v2d->scroll & VERT_SCROLL)) return;
-
- ei= sipo->editipo;
- for(a=0; a<sipo->totipo; a++, ei++) {
- if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
- cpack(ei->col);
-
- /* DISPBITS ipos have 'multiple' values. */
- if(ei->disptype==IPO_DISPBITS) {
- int b, val= ei->icu->curval;
-
- for (b=0; b<31; b++)
- if (val & (1<<b))
- draw_solution_line(v2d, b+1);
- } else {
- draw_solution_line(v2d, ei->icu->curval);
- }
- }
- }
-}
-
-/* used for drawing timeline */
-void draw_view2d_numbers_horiz(int drawframes)
-{
- float fac, fac2, dfac, val;
-
- /* the numbers: convert ipogrid_startx and -dx to scroll coordinates */
-
- fac= (ipogrid_startx- G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- fac= G.v2d->mask.xmin+fac*(G.v2d->mask.xmax-G.v2d->mask.xmin);
-
- dfac= (ipogrid_dx)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- dfac= dfac*(G.v2d->mask.xmax-G.v2d->mask.xmin);
-
- BIF_ThemeColor(TH_TEXT);
- val= ipogrid_startx;
- while(fac < G.v2d->mask.xmax) {
-
- if(drawframes) {
- ipomachtx= 1;
- scroll_prstr(fac, 2.0+(float)(G.v2d->mask.ymin), val, 'h', 0);
- }
- else {
- fac2= val/FPS;
- scroll_prstr(fac, 2.0+(float)(G.v2d->mask.ymin), fac2, 'h', 0);
- }
-
- fac+= dfac;
- val+= ipogrid_dx;
- }
-}
-
-
-void drawscroll(int disptype)
-{
- rcti vert, hor;
- float fac, dfac, val, fac2, tim;
- int darker, dark, light, lighter;
-
- vert= (G.v2d->vert);
- hor= (G.v2d->hor);
-
- darker= -40;
- dark= 0;
- light= 20;
- lighter= 50;
-
- if((G.v2d->scroll & HOR_SCROLL) || (G.v2d->scroll & HOR_SCROLLO)) {
-
- BIF_ThemeColorShade(TH_SHADE1, light);
- glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax);
-
- /* slider */
- fac= (G.v2d->cur.xmin- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin);
- if(fac<0.0) fac= 0.0;
- horxmin= hor.xmin+fac*(hor.xmax-hor.xmin);
-
- fac= (G.v2d->cur.xmax- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin);
- if(fac>1.0) fac= 1.0;
- horxmax= hor.xmin+fac*(hor.xmax-hor.xmin);
-
- if(horxmin > horxmax) horxmin= horxmax;
-
- BIF_ThemeColorShade(TH_SHADE1, dark);
- glRecti(horxmin, hor.ymin, horxmax, hor.ymax);
-
- /* decoration bright line */
- BIF_ThemeColorShade(TH_SHADE1, lighter);
- sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax);
-
- /* the numbers: convert ipogrid_startx and -dx to scroll coordinates */
- fac= (ipogrid_startx- G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- fac= hor.xmin+fac*(hor.xmax-hor.xmin);
-
- dfac= (ipogrid_dx)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
- dfac= dfac*(hor.xmax-hor.xmin);
-
- BIF_ThemeColor(TH_TEXT);
- val= ipogrid_startx;
-
- if (ELEM3(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME)) { /* prevents printing twice same frame */
- while(ipogrid_dx < 0.9999f) {
- ipogrid_dx *= 2.0f;
- dfac*= 2.0f;
- }
- }
- while(fac < hor.xmax) {
-
- if(curarea->spacetype==SPACE_OOPS) {
- /* Under no circumstances may the outliner/oops display numbers on its scrollbar
- * Unfortunately, versions of Blender without this patch will hang on loading files with
- * horizontally scrollable Outliners.
- */
- break;
- }
- else if(curarea->spacetype==SPACE_SEQ) {
- SpaceSeq * sseq = curarea->spacedata.first;
- if (sseq->flag & SEQ_DRAWFRAMES) {
- ipomachtx = 1;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- } else {
- fac2= val/FPS;
- tim= floor(fac2);
- fac2= fac2-tim;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), tim+FPS*fac2/100.0, 'h', disptype);
- }
- }
- else if (curarea->spacetype==SPACE_SOUND) {
- SpaceSound *ssound= curarea->spacedata.first;
-
- if(ssound->flag & SND_DRAWFRAMES) {
- ipomachtx= 1;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- else {
- fac2= val/FPS;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype);
- }
- }
- else if (curarea->spacetype==SPACE_TIME) {
- SpaceTime *stime= curarea->spacedata.first;
-
- if(stime->flag & TIME_DRAWFRAMES) {
- ipomachtx= 1;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- else {
- fac2= val/FPS;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype);
- }
- }
- else if (curarea->spacetype==SPACE_IPO) {
- EditIpo *ei= get_active_editipo();
-
- if(ei && ei->icu && ei->icu->driver) {
- int adrcode= ei->icu->driver->adrcode;
-
- if(adrcode==OB_ROT_X || adrcode==OB_ROT_Y || adrcode==OB_ROT_Z) {
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'v', IPO_DISPDEGR);
- }
- else
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- else
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- else if (curarea->spacetype==SPACE_ACTION) {
- SpaceAction *saction= curarea->spacedata.first;
-
- if (saction->flag & SACTION_DRAWTIME) {
- fac2= val/FPS;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype);
- }
- else {
- ipomachtx= 1;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- }
- else if (curarea->spacetype==SPACE_NLA) {
- SpaceNla *snla= curarea->spacedata.first;
-
- if (snla->flag & SNLA_DRAWTIME) {
- fac2= val/FPS;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype);
- }
- else {
- ipomachtx= 1;
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
- }
- else {
- scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype);
- }
-
- fac+= dfac;
- val+= ipogrid_dx;
- }
- }
-
- if(G.v2d->scroll & VERT_SCROLL) {
- BIF_ThemeColorShade(TH_SHADE1, light);
- glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax);
-
- /* slider */
- fac= (G.v2d->cur.ymin- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin);
- if(fac<0.0) fac= 0.0;
- vertymin= vert.ymin+fac*(vert.ymax-vert.ymin);
-
- fac= (G.v2d->cur.ymax- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin);
- if(fac>1.0) fac= 1.0;
- vertymax= vert.ymin+fac*(vert.ymax-vert.ymin);
-
- if(vertymin > vertymax) vertymin= vertymax;
-
- BIF_ThemeColorShade(TH_SHADE1, dark);
- glRecti(vert.xmin, vertymin, vert.xmax, vertymax);
-
- /* decoration black line */
- BIF_ThemeColorShade(TH_SHADE1, darker);
- if(G.v2d->scroll & HOR_SCROLL)
- sdrawline(vert.xmax, vert.ymin+SCROLLH, vert.xmax, vert.ymax);
- else
- sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax);
-
- /* the numbers: convert ipogrid_starty and -dy to scroll coordinates */
- fac= (ipogrid_starty- G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
- fac= vert.ymin+SCROLLH+fac*(vert.ymax-vert.ymin-SCROLLH);
-
- dfac= (ipogrid_dy)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
- dfac= dfac*(vert.ymax-vert.ymin-SCROLLH);
-
- if(curarea->spacetype==SPACE_OOPS);
- else if(curarea->spacetype==SPACE_SEQ) {
- BIF_ThemeColor(TH_TEXT);
- val= ipogrid_starty;
- fac+= 0.5*dfac;
- while(fac < vert.ymax) {
- scroll_prstr((float)(vert.xmax)-14.0, fac, val, 'v', disptype);
- fac+= dfac;
- val+= ipogrid_dy;
- }
- }
- else if (curarea->spacetype==SPACE_NLA){
- }
- else if (curarea->spacetype==SPACE_ACTION){
- /* No digits on vertical axis in action mode! */
- }
- else {
- BIF_ThemeColor(TH_TEXT);
- val= ipogrid_starty;
- while(fac < vert.ymax) {
- scroll_prstr((float)(vert.xmax)-14.0, fac, val, 'v', disptype);
- fac+= dfac;
- val+= ipogrid_dy;
- }
- }
- }
-}
-
-static void draw_ipobuts(SpaceIpo *sipo)
-{
- ScrArea *area= sipo->area;
- View2D *v2d= &sipo->v2d;
- Object *ob= OBACT;
- uiBlock *block;
- uiBut *but;
- EditIpo *ei;
- int a, y, sel, tot, ipobutx;
- char naam[20];
-
- if(area->winx< calc_ipobuttonswidth(area)) return;
-
- if(sipo->butofs) {
- tot= 30+IPOBUTY*sipo->totipo;
- if(tot<area->winy) sipo->butofs= 0;
- }
-
- ipobutx = calc_ipobuttonswidth(area);
-
- BIF_ThemeColor(TH_SHADE2);
- glRects(v2d->mask.xmax, 0, area->winx, area->winy);
-
- cpack(0x0);
- sdrawline(v2d->mask.xmax, 0, v2d->mask.xmax, area->winy);
-
- if(sipo->totipo==0) return;
- if(sipo->editipo==0) return;
-
- sprintf(naam, "ipowin %d", area->win);
- block= uiNewBlock(&area->uiblocks, naam, UI_EMBOSSN, UI_HELV, area->win);
-
- ei= sipo->editipo;
- y= area->winy-30+sipo->butofs;
-
- if(ob && sipo->blocktype==ID_KE) {
- int icon;
- if(ob->shapeflag & OB_SHAPE_LOCK) icon= ICON_PIN_HLT; else icon= ICON_PIN_DEHLT;
- uiDefIconButBitS(block, TOG, OB_SHAPE_LOCK, B_SETKEY, icon,
- v2d->mask.xmax+18,y,25,20, &ob->shapeflag, 0, 0, 0, 0, "Always show the current Shape for this Object");
- y-= IPOBUTY;
- }
-
- for(a=0; a<sipo->totipo; a++, ei++, y-=IPOBUTY) {
- // this button defines visiblity, bit zero of flag (IPO_VISIBLE)
- but= uiDefButBitS(block, TOG, IPO_VISIBLE, a+1, ei->name, v2d->mask.xmax+18, y, ipobutx-15, IPOBUTY-1, &(ei->flag), 0, 0, 0, 0, "");
- // no hilite, its not visible, but most of all the winmatrix is not correct later on...
- uiButSetFlag(but, UI_TEXT_LEFT|UI_NO_HILITE);
-
- // this fake button defines selection of curves
- if(ei->icu) {
- cpack(ei->col);
-
- glRects(v2d->mask.xmax+8, y+2, v2d->mask.xmax+15, y+IPOBUTY-2);
- sel= ei->flag & (IPO_SELECT + IPO_EDIT);
-
- uiEmboss((float)(v2d->mask.xmax+8), (float)(y+2), (float)(v2d->mask.xmax+15), (float)(y+IPOBUTY-2), sel);
-
- if(ei->icu->driver) {
- cpack(0x0);
- fdrawbox((float)v2d->mask.xmax+11, (float)y+8, (float)v2d->mask.xmax+12.5, (float)y+9.5);
- }
- }
-
- if(ei->flag & IPO_ACTIVE) {
- cpack(0x0);
- fdrawbox(v2d->mask.xmax+7, y+1, v2d->mask.xmax+16, y+IPOBUTY-1);
- }
- }
- uiDrawBlock(block);
-}
-
-static void draw_ipovertices(int sel)
-{
- EditIpo *ei;
- BezTriple *bezt;
- float v1[2];
- int val, ok, nr, a, b;
-
- if(G.f & G_PICKSEL) return;
-
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- ei= G.sipo->editipo;
- for(nr=0; nr<G.sipo->totipo; nr++, ei++) {
- if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
-
- if(G.sipo->showkey) {
- if(sel) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
- } else if(ei->flag & IPO_EDIT) {
- if(sel) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
- } else {
- if(sel) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
-
- val= (ei->icu->flag & IPO_SELECT)!=0;
- if(sel != val) continue;
- }
-
- /* We can't change the color in the middle of
- * GL_POINTS because then Blender will segfault
- * on TNT2 / Linux with NVidia's drivers
- * (at least up to ver. 4349) */
-
- a= ei->icu->totvert;
- bezt= ei->icu->bezt;
- bglBegin(GL_POINTS);
-
- while(a--) {
-
- /* IPO_DISPBITS is used for displaying layer ipo types as well as modes */
- if(ei->disptype==IPO_DISPBITS) {
- /*if (G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax) {*/
- ok= 0;
-
- if(ei->flag & IPO_EDIT) {
- if( (bezt->f2 & SELECT) == sel ) ok= 1;
- }
- else ok= 1;
-
- if(ok) {
- val= bezt->vec[1][1];
- b= 0;
- v1[0]= bezt->vec[1][0];
-
- while(b<31) {
- if(val & (1<<b)) {
- v1[1]= b+1;
- bglVertex3fv(v1);
- }
- b++;
- }
- }
- /*}*/
- } else { /* normal non bit curves */
- if(ei->flag & IPO_EDIT) {
- /* Only the vertex of the line, the
- * handler are draw below.
- */
- if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[1]);
-
- }
- else {
- /* draw only if in bounds */
- /*if (G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[1]);
-
- }
- }
-
- bezt++;
- }
- bglEnd();
-
- if (ei->flag & IPO_EDIT) {
- /* Now draw the two vertex of the handler,
- * need split it because we can't call glPointSize
- * in the middle of a glBegin/glEnd also the
- * bug comment before.
- */
- a= ei->icu->totvert;
- bezt= ei->icu->bezt;
-
- glPointSize(BIF_GetThemeValuef(TH_HANDLE_VERTEX_SIZE));
-
- if(sel) BIF_ThemeColor(TH_HANDLE_VERTEX_SELECT);
- else BIF_ThemeColor(TH_HANDLE_VERTEX);
-
- bglBegin(GL_POINTS);
-
- while(a--) {
- if (ei->disptype!=IPO_DISPBITS) {
- if(ei->flag & IPO_EDIT) {
- if(ei->icu->ipo==IPO_BEZ) {
- /* Draw the editmode hendels for a bezier curve */
- if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[0]);
-
- if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/
- bglVertex3fv(bezt->vec[2]);
- }
- }
- }
- bezt++;
- }
- bglEnd();
-
- /* The color are always reset (see the while)
- * but the point size not so we reset now.
- */
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
- }
- }
- }
-
- glPointSize(1.0);
-}
-
-static void draw_ipohandles(int sel)
-{
- extern unsigned int nurbcol[];
- EditIpo *ei;
- BezTriple *bezt;
- float *fp;
- unsigned int *col;
- int a, b;
-
- if(sel) col= nurbcol+4;
- else col= nurbcol;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN4(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu, disptype!=IPO_DISPBITS) {
- if(ei->icu->ipo==IPO_BEZ) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
-
- if( (bezt->f2 & SELECT)==sel) {
- fp= bezt->vec[0];
- cpack(col[bezt->h1]);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(fp); glVertex2fv(fp+3);
- glEnd();
- cpack(col[bezt->h2]);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(fp+3); glVertex2fv(fp+6);
- glEnd();
- }
- else if( (bezt->f1 & SELECT)==sel) {
- fp= bezt->vec[0];
- cpack(col[bezt->h1]);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(fp); glVertex2fv(fp+3);
- glEnd();
- }
- else if( (bezt->f3 & SELECT)==sel) {
- fp= bezt->vec[1];
- cpack(col[bezt->h2]);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(fp); glVertex2fv(fp+3);
- glEnd();
- }
-
- bezt++;
- }
- }
- }
- }
-}
-
-int pickselcode;
-
-static void init_pickselcode(void)
-{
- pickselcode= 1;
-}
-
-static void draw_ipocurves(int sel)
-{
- EditIpo *ei;
- IpoCurve *icu;
- BezTriple *bezt, *prevbezt;
- float *fp, fac, data[120], v1[2], v2[2], v3[2], v4[2];
- float cycdx=0, cycdy=0, cycxofs, cycyofs;
- int a, b, resol, cycount, val, nr;
-
-
- ei= G.sipo->editipo;
- for(nr=0; nr<G.sipo->totipo; nr++, ei++) {
- if ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt) {
-
- if(G.f & G_PICKSEL) {
- glLoadName(pickselcode++);
- val= 1;
- }
- else {
- val= (ei->flag & (IPO_SELECT+IPO_EDIT))!=0;
- val= (val==sel);
- }
-
- if(val) {
-
- cycyofs= cycxofs= 0.0;
- cycount= 1;
-
- icu= ei->icu;
-
- /* curve */
- if(G.sipo->showkey) BIF_ThemeColor(TH_TEXT);
- else cpack(ei->col);
-
- /* cyclic */
- if(icu->extrap & IPO_CYCL) {
- cycdx= (icu->bezt+icu->totvert-1)->vec[1][0] - icu->bezt->vec[1][0];
- cycdy= (icu->bezt+icu->totvert-1)->vec[1][1] - icu->bezt->vec[1][1];
- if(cycdx>0.01) {
-
- while(icu->bezt->vec[1][0]+cycxofs > G.v2d->cur.xmin) {
- cycxofs-= cycdx;
- if(icu->extrap & IPO_DIR) cycyofs-= cycdy;
- cycount++;
- }
- bezt= icu->bezt+(icu->totvert-1);
- fac= 0.0;
- while(bezt->vec[1][0]+fac < G.v2d->cur.xmax) {
- cycount++;
- fac+= cycdx;
- }
- }
- }
-
- while(cycount--) {
-
- if(ei->disptype==IPO_DISPBITS) {
-
- /* lines */
- cpack(ei->col);
- bezt= icu->bezt;
- a= icu->totvert;
-
- while(a--) {
- val= bezt->vec[1][1];
- b= 0;
-
- while(b<31) {
- if(val & (1<<b)) {
- v1[1]= b+1;
-
- glBegin(GL_LINE_STRIP);
- if(icu->extrap & IPO_CYCL) ;
- else if(a==icu->totvert-1) {
- v1[0]= G.v2d->cur.xmin+cycxofs;
- glVertex2fv(v1);
- }
- v1[0]= bezt->vec[1][0]+cycxofs;
- glVertex2fv(v1);
-
- if(a) v1[0]= (bezt+1)->vec[1][0]+cycxofs;
- else if(icu->extrap & IPO_CYCL) ;
- else v1[0]= G.v2d->cur.xmax+cycxofs;
-
- glVertex2fv(v1);
- glEnd();
- }
- b++;
- }
- bezt++;
- }
-
- }
- else {
-
- b= icu->totvert-1;
- prevbezt= icu->bezt;
- bezt= prevbezt+1;
-
- glBegin(GL_LINE_STRIP);
-
- /* extrapolate to left? */
- if( (icu->extrap & IPO_CYCL)==0) {
- if(prevbezt->vec[1][0] > G.v2d->cur.xmin) {
- v1[0]= G.v2d->cur.xmin;
- if(icu->extrap==IPO_HORIZ || icu->ipo==IPO_CONST || icu->totvert==1) {
- v1[1]= prevbezt->vec[1][1];
- } else if (icu->ipo==IPO_LIN) {
- /* extrapolate linear dosnt use the handle, use the next points center instead */
- fac= (prevbezt->vec[1][0]-bezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]);
- if(fac!=0.0) fac= 1.0/fac;
- v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[1][1]-bezt->vec[1][1]);
- } else {
- fac= (prevbezt->vec[0][0]-prevbezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]);
- if(fac!=0.0) fac= 1.0/fac;
- v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[0][1]-prevbezt->vec[1][1]);
- }
- glVertex2fv(v1);
- }
- }
-
- if(b==0) {
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- }
-
- while(b--) {
- if(icu->ipo==IPO_CONST) {
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- v1[0]= bezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- }
- else if(icu->ipo==IPO_LIN) {
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- }
- else {
- /* resol not depending on horizontal resolution anymore, drivers for example... */
- if(icu->driver) resol= 32;
- else resol= 3.0*sqrt(bezt->vec[1][0] - prevbezt->vec[1][0]);
-
- if(resol<2) {
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- }
- else {
- if(resol>32) resol= 32;
-
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- v2[0]= prevbezt->vec[2][0]+cycxofs;
- v2[1]= prevbezt->vec[2][1]+cycyofs;
-
- v3[0]= bezt->vec[0][0]+cycxofs;
- v3[1]= bezt->vec[0][1]+cycyofs;
- v4[0]= bezt->vec[1][0]+cycxofs;
- v4[1]= bezt->vec[1][1]+cycyofs;
-
- correct_bezpart(v1, v2, v3, v4);
-
- forward_diff_bezier(v1[0], v2[0], v3[0], v4[0], data, resol, 3);
- forward_diff_bezier(v1[1], v2[1], v3[1], v4[1], data+1, resol, 3);
-
- fp= data;
- while(resol--) {
- glVertex2fv(fp);
- fp+= 3;
- }
- }
- }
- prevbezt= bezt;
- bezt++;
-
- /* last point? */
- if(b==0) {
- v1[0]= prevbezt->vec[1][0]+cycxofs;
- v1[1]= prevbezt->vec[1][1]+cycyofs;
- glVertex2fv(v1);
- }
- }
-
- /* extrapolate to right? */
- if( (icu->extrap & IPO_CYCL)==0) {
- if(prevbezt->vec[1][0] < G.v2d->cur.xmax) {
- v1[0]= G.v2d->cur.xmax;
- if(icu->extrap==IPO_HORIZ || icu->ipo==IPO_CONST ||icu->totvert==1) {
- v1[1]= prevbezt->vec[1][1];
- } else if (icu->ipo==IPO_LIN) {
- /* extrapolate linear dosnt use the handle, use the previous points center instead */
- bezt = prevbezt-1;
- fac= (prevbezt->vec[1][0]-bezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]);
- if(fac!=0.0) fac= 1.0/fac;
- v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[1][1]-bezt->vec[1][1]);
- } else {
- fac= (prevbezt->vec[2][0]-prevbezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]);
- if(fac!=0.0) fac= 1.0/fac;
- v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[2][1]-prevbezt->vec[1][1]);
- }
- glVertex2fv(v1);
- }
- }
-
- glEnd();
-
- }
- cycxofs+= cycdx;
- if(icu->extrap & IPO_DIR) cycyofs+= cycdy;
- }
-
- /* line that indicates the end of a speed curve */
- if(G.sipo->blocktype==ID_CU && icu->adrcode==CU_SPEED) {
- b= icu->totvert-1;
- if(b) {
- glColor3ub(0, 0, 0);
- bezt= icu->bezt+b;
- glBegin(GL_LINES);
- glVertex2f(bezt->vec[1][0], 0.0);
- glVertex2f(bezt->vec[1][0], bezt->vec[1][1]);
- glEnd();
- }
- }
- }
- }
- }
-}
-
-static int get_ipo_cfra_from_cfra(SpaceIpo * sipo, int cfra)
-{
- if (sipo->blocktype==ID_SEQ) {
- Sequence * seq = (Sequence*) sipo->from;
-
- if (!seq) {
- return cfra;
- }
-
- if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- return cfra;
- } else {
- float ctime= frame_to_float(cfra - seq->startdisp);
- float div= (seq->enddisp - seq->startdisp)/100.0f;
-
- if(div == 0.0) {
- return 0;
- } else {
- return ctime / div;
- }
- }
- } else {
- return cfra;
- }
-}
-
-static void draw_cfra(SpaceIpo *sipo)
-{
- View2D *v2d= &sipo->v2d;
- Object *ob;
- float vec[2];
-
- vec[0] = get_ipo_cfra_from_cfra(sipo, G.scene->r.cfra);
- vec[0]*= G.scene->r.framelen;
-
- vec[1]= v2d->cur.ymin;
- BIF_ThemeColor(TH_CFRAME);
- glLineWidth(2.0);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec);
- vec[1]= v2d->cur.ymax;
- glVertex2fv(vec);
- glEnd();
-
- if(sipo->blocktype==ID_OB) {
- ob= (G.scene->basact) ? (G.scene->basact->object) : 0;
- if (ob && (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0)) {
- vec[0]-= give_timeoffset(ob);
-
- BIF_ThemeColorShade(TH_HILITE, -30);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec);
- vec[1]= G.v2d->cur.ymin;
- glVertex2fv(vec);
- glEnd();
- }
- }
-
- glLineWidth(1.0);
-}
-
-static void draw_ipokey(SpaceIpo *sipo)
-{
- IpoKey *ik;
-
- glBegin(GL_LINES);
- for (ik= sipo->ipokey.first; ik; ik= ik->next) {
- if(ik->flag & 1) glColor3ub(0xFF, 0xFF, 0x99);
- else glColor3ub(0xAA, 0xAA, 0x55);
-
- glVertex2f(ik->val, G.v2d->cur.ymin);
- glVertex2f(ik->val, G.v2d->cur.ymax);
- }
- glEnd();
-}
-
-static void draw_key(SpaceIpo *sipo, int visible)
-{
- View2D *v2d= &sipo->v2d;
- Key *key;
- KeyBlock *kb, *act=NULL;
- Object *ob= OBACT;
- unsigned int col;
- int index;
-
- key= ob_get_key((Object *)sipo->from);
- if(key==NULL)
- return;
-
- if(key->type== KEY_RELATIVE) if(visible==0) return;
-
- for(index=1, kb= key->block.first; kb; kb= kb->next, index++) {
- if(kb->type==KEY_LINEAR) setlinestyle(2);
- else if(kb->type==KEY_BSPLINE) setlinestyle(4);
- else setlinestyle(0);
-
- if(kb==key->refkey) col= 0x22FFFF;
- else col= 0xFFFF00;
-
- if(ob->shapenr!=index) col-= 0x225500;
- else act= kb;
-
- cpack(col);
-
- glBegin(GL_LINE_STRIP);
- glVertex2f(v2d->cur.xmin, kb->pos);
- glVertex2f(v2d->cur.xmax, kb->pos);
- glEnd();
-
- }
-
- if(act) {
- if(act->type==KEY_LINEAR) setlinestyle(2);
- else if(act->type==KEY_BSPLINE) setlinestyle(4);
- else setlinestyle(0);
-
- if(act==key->refkey) cpack(0x22FFFF);
- else cpack(0xFFFF00);
-
- glBegin(GL_LINE_STRIP);
- glVertex2f(v2d->cur.xmin, act->pos);
- glVertex2f(v2d->cur.xmax, act->pos);
- glEnd();
- }
-
- setlinestyle(0);
-}
-
-/* ************************** buttons *********************** */
-
-
-#define B_SETSPEED 3401
-#define B_MUL_IPO 3402
-#define B_TRANS_IPO 3403
-#define B_IPO_NONE 3404
-#define B_IPO_DRIVER 3405
-#define B_IPO_REDR 3406
-#define B_IPO_DEPCHANGE 3407
-#define B_IPO_DRIVERTYPE 3408
-
-static float hspeed= 0;
-
-static void boundbox_ipo_curves(SpaceIpo *si)
-{
- EditIpo *ei;
- Key *key;
- KeyBlock *kb;
- int a, first= 1;
-
- ei= si->editipo;
- if(ei==0)
- return;
-
- for(a=0; a<si->totipo; a++, ei++) {
-
- if(ei->icu) {
- if(ei->flag & IPO_VISIBLE) {
-
- boundbox_ipocurve(ei->icu, 0);
- if(first) {
- si->v2d.tot= ei->icu->totrct;
- first= 0;
- }
- else BLI_union_rctf(&(si->v2d.tot), &(ei->icu->totrct));
- }
- }
- }
- /* keylines? */
- if(si->blocktype==ID_KE) {
- key= ob_get_key((Object *)si->from);
- if(key && key->block.first) {
- kb= key->block.first;
- if(kb->pos < si->v2d.tot.ymin) si->v2d.tot.ymin= kb->pos;
- kb= key->block.last;
- if(kb->pos > si->v2d.tot.ymax) si->v2d.tot.ymax= kb->pos;
- }
- }
- si->tot= si->v2d.tot;
-}
-
-
-/* is used for both read and write... */
-static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float max)
-{
- Object *ob;
- EditIpo *ei;
- BezTriple *bezt;
- float median[3];
- int a, b, tot, iskey=0;
-
- median[0]= median[1]= median[2]= 0.0;
- tot= 0;
-
- /* use G.sipo->from (which should be an object) so that pinning ipo's will still work ok */
- if((G.sipo->from) && (GS(G.sipo->from->name) == ID_OB))
- ob= (Object *)(G.sipo->from);
- else
- ob= OBACT;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
-
- if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
- if( (ei->flag & IPO_EDIT) || G.sipo->showkey) {
-
- if(ei->icu->bezt) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
- // all three selected
- if(bezt->f2 & SELECT) {
- VecAddf(median, median, bezt->vec[1]);
- tot++;
- }
- else {
- if(bezt->f1 & SELECT) {
- VecAddf(median, median, bezt->vec[0]);
- tot++;
- }
- if(bezt->f3 & SELECT) {
- VecAddf(median, median, bezt->vec[2]);
- tot++;
- }
- }
- bezt++;
- }
-
- }
- }
- }
- }
- /* check for keys */
- if(tot==0) {
- if(G.sipo->blocktype==ID_KE) {
- Key *key= ob_get_key((Object *)G.sipo->from);
- KeyBlock *kb;
-
- if(key==NULL || ob->shapenr==0) return;
- iskey= 1;
-
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- median[1]+= kb->pos;
- tot++;
- }
- }
- if(tot==0) return;
-
- median[0] /= (float)tot;
- median[1] /= (float)tot;
- median[2] /= (float)tot;
-
- if(block) { // buttons
-
- VECCOPY(si->median, median);
-
- uiBlockBeginAlign(block);
- if(tot==1) {
- if(iskey)
- uiDefButF(block, NUM, B_TRANS_IPO, "Key Y:", 10, 80, 300, 19, &(si->median[1]), min, max, 10, 0, "");
- else {
- uiDefButF(block, NUM, B_TRANS_IPO, "Vertex X:", 10, 100, 150, 19, &(si->median[0]), min, max, 100, 0, "");
- uiDefButF(block, NUM, B_TRANS_IPO, "Vertex Y:", 160, 100, 150, 19, &(si->median[1]), min, max, 100, 0, "");
- }
- }
- else {
- if(iskey)
- uiDefButF(block, NUM, B_TRANS_IPO, "Median Key Y:", 10, 80, 300, 19, &(si->median[1]), min, max, 10, 0, "");
- else {
- uiDefButF(block, NUM, B_TRANS_IPO, "Median X:", 10, 100, 150, 19, &(si->median[0]), min, max, 100, 0, "");
- uiDefButF(block, NUM, B_TRANS_IPO, "Median Y:", 160, 100, 150, 19, &(si->median[1]), min, max, 100, 0, "");
- }
- }
- }
- else if(iskey) { // apply
- VecSubf(median, si->median, median);
-
- if(G.sipo->blocktype==ID_KE) {
- Key *key= ob_get_key((Object *)G.sipo->from);
- KeyBlock *kb;
-
- if(key==NULL || ob->shapenr==0) return;
-
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- kb->pos+= median[1];
- tot++;
-
- sort_keys(key);
- }
- }
- else {
-
- VecSubf(median, si->median, median);
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
-
- if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
- if( (ei->flag & IPO_EDIT) || G.sipo->showkey) {
-
- if(ei->icu->bezt) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
- // all three selected
- if(bezt->f2 & SELECT) {
- VecAddf(bezt->vec[0], bezt->vec[0], median);
- VecAddf(bezt->vec[1], bezt->vec[1], median);
- VecAddf(bezt->vec[2], bezt->vec[2], median);
- }
- else {
- if(bezt->f1 & SELECT) {
- VecAddf(bezt->vec[0], bezt->vec[0], median);
- }
- if(bezt->f3 & SELECT) {
- VecAddf(bezt->vec[2], bezt->vec[2], median);
- }
- }
- bezt++;
- }
-
- }
- }
- }
- }
- }
-}
-
-void do_ipobuts(unsigned short event)
-{
- Object *ob;
- EditIpo *ei;
-
- if(G.sipo->from==NULL) return;
-
- /* use G.sipo->from (which should be an object) so that pinning ipo's will still work ok */
- if(GS(G.sipo->from->name) == ID_OB)
- ob= (Object *)(G.sipo->from);
- else
- ob= OBACT;
-
- switch(event) {
- case B_IPO_REDR:
- ei= get_active_editipo();
- if(ei) {
- if(ei->icu->driver) {
-#ifndef DISABLE_PYTHON
- if (ei->icu->driver->type == IPO_DRIVER_TYPE_PYTHON) {
- /* first del pydriver's global dict, just in case
- * an available pydrivers.py module needs to be reloaded */
- BPY_pydriver_update();
- /* eval user's expression once for validity; update DAG */
- BPY_pydriver_eval(ei->icu->driver);
- DAG_scene_sort(G.scene);
- }
- else
-#endif
- if(G.sipo->blocktype==ID_KE || G.sipo->blocktype==ID_AC)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
- }
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_SETSPEED:
- set_speed_editipo(hspeed);
- break;
- case B_MUL_IPO:
- scale_editipo();
- allqueue(REDRAWIPO, 0);
- break;
- case B_TRANS_IPO:
- ipo_editvertex_buts(NULL, G.sipo, 0.0, 0.0);
- editipo_changed(G.sipo, 1);
- allqueue(REDRAWIPO, 0);
- break;
- case B_SETKEY:
- ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_IPO_DRIVER:
- ei= get_active_editipo();
- if(ei) {
- if(ei->icu==NULL) {
- ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode, 1);
- if (!ei->icu) {
- error("Could not add a driver to this curve, may be linked data!");
- break;
- }
- ei->flag |= IPO_SELECT;
- ei->icu->flag= ei->flag;
- }
- if(ei->icu->driver) {
- MEM_freeN(ei->icu->driver);
- ei->icu->driver= NULL;
- if(ei->icu->bezt==NULL) {
- BLI_remlink( &(G.sipo->ipo->curve), ei->icu);
- free_ipo_curve(ei->icu);
- ei->icu= NULL;
- }
- }
- else {
- ei->icu->driver= MEM_callocN(sizeof(IpoDriver), "ipo driver");
- ei->icu->driver->blocktype= ID_OB;
- ei->icu->driver->adrcode= OB_LOC_X;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- DAG_scene_sort(G.scene);
-
- BIF_undo_push("Add/Remove Ipo driver");
- }
- break;
- case B_IPO_DRIVERTYPE:
- ei= get_active_editipo();
- if(ei) {
- if(ei->icu->driver) {
- IpoDriver *driver= ei->icu->driver;
-
- if(driver->type == IPO_DRIVER_TYPE_PYTHON) {
- /* pydriver expression shouldn't reference own ob,
- * so we need to store ob ptr to check against it */
- driver->ob= ob;
- }
- else {
- driver->ob= NULL;
- driver->blocktype= ID_OB;
- driver->adrcode= OB_LOC_X;
- driver->flag &= ~IPO_DRIVER_FLAG_INVALID;
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- DAG_scene_sort(G.scene);
-
- BIF_undo_push("Change Ipo driver type");
- }
- break;
- case B_IPO_DEPCHANGE:
- ei= get_active_editipo();
- if(ei) {
- if(ei->icu->driver) {
- IpoDriver *driver= ei->icu->driver;
-
- if(driver->type == IPO_DRIVER_TYPE_PYTHON) {
- }
- else {
- if(driver->ob) {
- if(ob==driver->ob && G.sipo->bonename[0]==0) {
- error("Cannot assign a Driver to own Object");
- driver->ob= NULL;
- }
- else {
- /* check if type is still OK */
- if(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR);
- else driver->blocktype= ID_OB;
- }
- }
- }
- DAG_scene_sort(G.scene);
-
- if(G.sipo->blocktype==ID_KE || G.sipo->blocktype==ID_AC)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- }
-}
-
-static char *ipodriver_modeselect_pup(Object *ob)
-{
- static char string[265];
- char tmpstr[64];
- char formatstring[64];
-
- strcpy(string, "Driver type: %t");
-
- strcpy(formatstring, "|%s %%x%d %%i%d");
-
- if(ob) {
- sprintf(tmpstr,formatstring,"Object",ID_OB, ICON_OBJECT);
- strcat(string,tmpstr);
- }
- if(ob && ob->type==OB_ARMATURE) {
- sprintf(tmpstr,formatstring,"Pose",ID_AR, ICON_POSE_DEHLT);
- strcat(string,tmpstr);
- }
-
- return (string);
-}
-
-static char *ipodriver_channelselect_pup(int is_armature)
-{
- static char string[1024];
- char *tmp;
-
- strcpy(string, "Driver channel: %t");
- tmp= string+strlen(string);
-
- tmp+= sprintf(tmp, "|Loc X %%x%d", OB_LOC_X);
- tmp+= sprintf(tmp, "|Loc Y %%x%d", OB_LOC_Y);
- tmp+= sprintf(tmp, "|Loc Z %%x%d", OB_LOC_Z);
- tmp+= sprintf(tmp, "|Rot X %%x%d", OB_ROT_X);
- tmp+= sprintf(tmp, "|Rot Y %%x%d", OB_ROT_Y);
- tmp+= sprintf(tmp, "|Rot Z %%x%d", OB_ROT_Z);
- tmp+= sprintf(tmp, "|Scale X %%x%d", OB_SIZE_X);
- tmp+= sprintf(tmp, "|Scale Y %%x%d", OB_SIZE_Y);
- tmp+= sprintf(tmp, "|Scale Z %%x%d", OB_SIZE_Z);
- if(is_armature)
- tmp+= sprintf(tmp, "|Rotation Difference %%x%d", OB_ROT_DIFF);
-
- return (string);
-}
-
-static void ipo_panel_properties(short cntrl) // IPO_HANDLER_PROPERTIES
-{
- extern int totipo_curve; // editipo.c
- uiBlock *block;
- EditIpo *ei;
- char name[48];
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(IPO_HANDLER_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "Transform Properties", "Ipo", 10, 230, 318, 204)==0) return;
-
- /* this is new panel height, newpanel doesnt force new size on existing panels */
- uiNewPanelHeight(block, 204);
-
- /* driver buttons first */
- ei= get_active_editipo();
- if(ei) {
-
- sprintf(name, "Driven Channel: %s", ei->name);
- uiDefBut(block, LABEL, 0, name, 10, 265, 200, 19, NULL, 1.0, 0.0, 0, 0, "");
-
- if(ei->icu && ei->icu->driver) {
- IpoDriver *driver= ei->icu->driver;
-
- uiDefBut(block, BUT, B_IPO_DRIVER, "Remove", 210,265,100,20, NULL, 0.0f, 0.0f, 0, 0, "Remove Driver for this Ipo Channel");
-
- uiBlockBeginAlign(block);
- uiDefIconButS(block, TOG, B_IPO_DRIVERTYPE, ICON_PYTHON, 10,240,25,20, &driver->type, (float)IPO_DRIVER_TYPE_NORMAL, (float)IPO_DRIVER_TYPE_PYTHON, 0, 0, "Use a one-line Python Expression as Driver");
-
- if(driver->type == IPO_DRIVER_TYPE_PYTHON) {
- uiDefBut(block, TEX, B_IPO_REDR, "", 35,240,275,20, driver->name, 0, 127, 0, 0, "Python Expression");
- uiBlockEndAlign(block);
- if(driver->flag & IPO_DRIVER_FLAG_INVALID) {
- uiDefBut(block, LABEL, 0, "Error: invalid Python expression",
- 5,215,230,19, NULL, 0, 0, 0, 0, "");
- }
- }
- else {
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_IPO_DEPCHANGE, "OB:", 35, 240, 125, 20, &(driver->ob), "Driver Object");
- if(driver->ob) {
- int icon=ICON_OBJECT;
-
- if(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR) {
- icon = ICON_POSE_DEHLT;
- uiDefBut(block, TEX, B_IPO_REDR, "BO:", 10,220,150,20, driver->name, 0, 31, 0, 0, "Bone name");
-
- if(driver->adrcode==OB_ROT_DIFF)
- uiDefBut(block, TEX, B_IPO_REDR, "BO:", 10,200,150,20, driver->name+DRIVER_NAME_OFFS, 0, 31, 0, 0, "Bone name for angular reference");
-
- }
- else driver->blocktype= ID_OB; /* safety when switching object button */
-
- uiBlockBeginAlign(block);
- uiDefIconTextButS(block, MENU, B_IPO_DEPCHANGE, icon,
- ipodriver_modeselect_pup(driver->ob), 165,240,145,20, &(driver->blocktype), 0, 0, 0, 0, "Driver type");
-
- uiDefButS(block, MENU, B_IPO_REDR,
- ipodriver_channelselect_pup(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR),
- 165,220,145,20, &(driver->adrcode), 0, 0, 0, 0, "Driver channel");
- }
- uiBlockEndAlign(block);
- }
- }
- else {
- uiDefBut(block, BUT, B_IPO_DRIVER, "Add Driver", 210,265,100,19, NULL, 0.0f, 0.0f, 0, 0, "Create a Driver for this Ipo Channel");
- }
- }
- else
- uiDefBut(block, LABEL, 0, " ", 10, 265, 150, 19, NULL, 1.0, 0.0, 0, 0, "");
-
- boundbox_ipo_curves(G.sipo); // should not be needed... transform/draw calls should update
-
- /* note ranges for buttons below are idiot... we need 2 ranges, one for sliding scale, one for real clip */
- if(G.sipo->ipo && G.sipo->ipo->curve.first && totipo_curve) {
- extern int totipo_vertsel; // editipo.c
- uiDefBut(block, LABEL, 0, "Visible curves", 160, 200, 150, 19, NULL, 1.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_MUL_IPO, "Xmin:", 10, 180, 150, 19, &G.sipo->tot.xmin, G.sipo->tot.xmin-1000.0, MAXFRAMEF, 100, 0, "");
- uiDefButF(block, NUM, B_MUL_IPO, "Xmax:", 160, 180, 150, 19, &G.sipo->tot.xmax, G.sipo->tot.ymin-1000.0, MAXFRAMEF, 100, 0, "");
-
- uiDefButF(block, NUM, B_MUL_IPO, "Ymin:", 10, 160, 150, 19, &G.sipo->tot.ymin, G.sipo->tot.ymin-1000.0, 5000.0, 100, 0, "");
- uiDefButF(block, NUM, B_MUL_IPO, "Ymax:", 160, 160, 150, 19, &G.sipo->tot.ymax, G.sipo->tot.ymin-1000.0, 5000.0, 100, 0, "");
-
- /* SPEED BUTTON */
- if(totipo_vertsel) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_IPO_NONE, "Speed:", 10,130,150,19, &hspeed, 0.0, 180.0, 1, 0, "");
- uiDefBut(block, BUT, B_SETSPEED,"SET", 160,130,50,19, 0, 0, 0, 0, 0, "");
- }
- }
-
- /* this one also does keypositions */
- if(G.sipo->ipo) ipo_editvertex_buts(block, G.sipo, -10000, MAXFRAMEF);
-}
-
-static void ipo_blockhandlers(ScrArea *sa)
-{
- SpaceIpo *sipo= sa->spacedata.first;
- short a;
-
- /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(sipo->blockhandler[a]) {
-
- case IPO_HANDLER_PROPERTIES:
- ipo_panel_properties(sipo->blockhandler[a+1]);
- break;
-
- }
- /* clear action value for event */
- sipo->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-
-}
-
-
-void drawipospace(ScrArea *sa, void *spacedata)
-{
- SpaceIpo *sipo= sa->spacedata.first;
- View2D *v2d= &sipo->v2d;
- EditIpo *ei;
- float col[3];
- int ofsx, ofsy, a, disptype;
-
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- uiFreeBlocksWin(&sa->uiblocks, sa->win); /* for panel handler to work */
-
- test_editipo(0); /* test if current editipo is correct, make_editipo sets v2d->cur, call here because of calc_ipobuttonswidth() */
-
- v2d->hor.xmax+=calc_ipobuttonswidth(sa);
- calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy);
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
-
- if (sipo->pin)
- glClearColor(col[0]+0.05,col[1],col[2], 0.0); // litepink
- else
- glClearColor(col[0],col[1],col[2], 0.0);
-
- glClear(GL_COLOR_BUFFER_BIT);
-
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
- if(v2d->scroll) {
- ofsx= sa->winrct.xmin; // ivm mywin
- ofsy= sa->winrct.ymin;
- glViewport(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1);
- glScissor(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1);
- }
- }
-
- myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
-
- if(sipo->editipo) {
-
- /* correct scale for degrees? */
- disptype= -1;
- ei= sipo->editipo;
- for(a=0; a<sipo->totipo; a++, ei++) {
- if(ei->flag & IPO_VISIBLE) {
- if(disptype== -1) disptype= ei->disptype;
- else if(disptype!=ei->disptype) disptype= 0;
- }
- }
-
- calc_ipogrid();
- draw_ipogrid();
-
- draw_cfra(sipo);
-
- /* ipokeys */
- if(sipo->showkey) {
- //if(sipo->ipokey.first==0) make_ipokey();
- //else update_ipokey_val();
- make_ipokey();
- draw_ipokey(sipo);
- }
-
- if(sipo->blocktype==ID_KE) {
- ei= sipo->editipo;
- draw_key(sipo, ei->flag & IPO_VISIBLE);
- }
-
- /* map ipo-points for drawing if scaled ipo */
- if (NLA_IPO_SCALED)
- actstrip_map_ipo_keys(OBACT, sipo->ipo, 0, 0);
-
- /* draw deselect */
- draw_ipocurves(0);
- draw_ipohandles(0);
- draw_ipovertices(0);
-
- /* draw select */
- draw_ipocurves(1);
- draw_ipohandles(1);
- draw_ipovertices(1);
-
- /* undo mapping of ipo-points for drawing if scaled ipo */
- if (NLA_IPO_SCALED)
- actstrip_map_ipo_keys(OBACT, sipo->ipo, 1, 0);
-
- /* Draw 'curtains' for preview */
- draw_anim_preview_timespace();
-
- /* draw markers */
- draw_markers_timespace(SCE_MARKERS, 0);
-
- /* restore viewport */
- mywinset(sa->win);
-
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
-
- /* ortho at pixel level sa */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- if(v2d->scroll) {
- drawscroll(disptype);
- draw_solution(sipo);
- }
-
- draw_ipobuts(sipo);
- }
- }
- else {
- calc_ipogrid();
- draw_ipogrid();
- }
-
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, sipo->blockscale, sipo->blockscale, sipo->blockscale);
- /* only draw panels when relevant */
- if(sipo->editipo) ipo_blockhandlers(sa);
-
- sa->win_swap= WIN_BACK_OK;
-}
-
-void scroll_ipobuts()
-{
- int tot;
- short yo, mval[2];
-
- tot= 30+IPOBUTY*G.sipo->totipo;
- if(tot<curarea->winy) return;
-
- getmouseco_areawin(mval);
- yo= mval[1];
-
- while(get_mbut()&M_MOUSE) {
- getmouseco_areawin(mval);
- if(mval[1]!=yo) {
- G.sipo->butofs+= (mval[1]-yo);
- if(G.sipo->butofs<0) G.sipo->butofs= 0;
- else if(G.sipo->butofs+curarea->winy>tot) G.sipo->butofs= tot-curarea->winy;
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- yo= mval[1];
- }
- else BIF_wait_for_statechange();
- }
-}
-
-/* total mess function, especially with mousewheel, needs cleanup badly (ton) */
-int view2dzoom(unsigned short event)
-{
- ScrArea *sa;
- float fac, dx, dy, wtemp;
- short mval[2], mvalo[2];
- short is_wheel= (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE);
-
- getmouseco_areawin(mvalo);
- mval[0]= mvalo[0];
- mval[1]= mvalo[1];
-
- while( (get_mbut()&(L_MOUSE|M_MOUSE)) || is_wheel ) {
-
- /* regular mousewheel: zoom regular
- * alt-shift mousewheel: zoom y only
- * alt-ctrl mousewheel: zoom x only
- */
- if (event==WHEELUPMOUSE) {
- if(U.uiflag & USER_WHEELZOOMDIR)
- wtemp = -0.0375;
- else
- wtemp = 0.03;
- if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3;
-
- dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin));
-
- switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) {
- case 0:
- break;
- case (LR_SHIFTKEY|LR_ALTKEY):
- dx = 0;
- break;
- case (LR_CTRLKEY|LR_ALTKEY):
- dy = 0;
- break;
- default:
- if(curarea->spacetype==SPACE_BUTS); // exception
- else return 0;
- break;
- }
- }
- else if (event==WHEELDOWNMOUSE) {
- if(U.uiflag & USER_WHEELZOOMDIR)
- wtemp = 0.03;
- else
- wtemp = -0.0375;
- if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3;
-
- dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin));
-
- switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) {
- case 0:
- break;
- case (LR_SHIFTKEY|LR_ALTKEY):
- dx = 0;
- break;
- case (LR_CTRLKEY|LR_ALTKEY):
- dy = 0;
- break;
- default:
- if(curarea->spacetype==SPACE_BUTS);
- else return 0;
- break;
- }
- }
- else {
- getmouseco_areawin(mval);
- if(U.viewzoom==USER_ZOOM_SCALE) {
- float dist;
-
- dist = (G.v2d->mask.xmax - G.v2d->mask.xmin)/2.0;
- dx= 1.0-(fabs(mvalo[0]-dist)+2.0)/(fabs(mval[0]-dist)+2.0);
- dx*= 0.5*(G.v2d->cur.xmax-G.v2d->cur.xmin);
-
- dist = (G.v2d->mask.ymax - G.v2d->mask.ymin)/2.0;
- dy= 1.0-(fabs(mvalo[1]-dist)+2.0)/(fabs(mval[1]-dist)+2.0);
- dy*= 0.5*(G.v2d->cur.ymax-G.v2d->cur.ymin);
-
- }
- else {
- fac= 0.01*(mval[0]-mvalo[0]);
- dx= fac*(G.v2d->cur.xmax-G.v2d->cur.xmin);
- fac= 0.01*(mval[1]-mvalo[1]);
- dy= fac*(G.v2d->cur.ymax-G.v2d->cur.ymin);
-
- if(U.viewzoom==USER_ZOOM_CONT) {
- dx/= 20.0;
- dy/= 20.0;
- }
- }
- }
-
- if (ELEM(event, WHEELUPMOUSE, WHEELDOWNMOUSE) || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
-
- if(U.viewzoom!=USER_ZOOM_CONT) {
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
-
- if( ELEM(curarea->spacetype, SPACE_NLA, SPACE_ACTION) ) {
- if(mvalo[0] < G.v2d->mask.xmin) {
- G.v2d->cur.ymin+= dy;
- G.v2d->cur.ymax-= dy;
- }
- else {
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- }
- }
- else if (ELEM(curarea->spacetype, SPACE_SOUND, SPACE_TIME)) {
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- }
- else if (curarea->spacetype == SPACE_SEQ) {
- /* less sensitivity on y scale */
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- if (!(ELEM(event, WHEELUPMOUSE, WHEELDOWNMOUSE))) {
- G.v2d->cur.ymin+= dy/2;
- G.v2d->cur.ymax-= dy/2;
- }
- }
- else {
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- G.v2d->cur.ymin+= dy;
- G.v2d->cur.ymax-= dy;
- }
-
- test_view2d(G.v2d, curarea->winx, curarea->winy); /* cur min max rects */
-
- sa= curarea; /* now when are you going to kill this one! */
- view2d_do_locks(curarea, V2D_LOCK_COPY|V2D_LOCK_REDRAW);
- areawinset(sa->win);
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else BIF_wait_for_statechange();
- /* return if we were using the mousewheel
- */
- if ( is_wheel ) return 1;
- }
- return 1;
-}
-
-void center_currframe(void)
-{
- /* place the current frame in the
- * center of the 2D window.
- */
- float width;
-
- width = G.v2d->cur.xmax - G.v2d->cur.xmin;
- G.v2d->cur.xmin = CFRA - 0.5*(width);
- G.v2d->cur.xmax = CFRA + 0.5*(width);
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-
- scrarea_queue_winredraw(curarea);
-}
-
-/* total mess function, especially with mousewheel, needs cleanup badly (ton) */
-int view2dmove(unsigned short event)
-{
- /* return 1 when something was done */
- float facx=0.0, facy=0.0, dx, dy, left=1.0, right=1.0;
- short mval[2], mvalo[2], leftret=1, mousebut;
- short is_wheel= (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE);
- int oldcursor, cursor;
- Window *win;
-
- /* when wheel is used, we only draw it once */
-
- /* try to do some zooming if the
- * middlemouse and ctrl are pressed
- * or if the mousewheel is being used.
- * Return if zooming was done.
- */
-
- /* check for left mouse / right mouse button select */
- if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
- else mousebut = L_MOUSE;
-
- if ( (G.qual & LR_CTRLKEY) || is_wheel ) {
- /* patch for oops & buttonswin, standard scroll no zoom */
- if(curarea->spacetype==SPACE_OOPS) {
- SpaceOops *soops= curarea->spacedata.first;
- if(soops->type==SO_OUTLINER);
- else if (view2dzoom(event)) {
- return 0;
- }
- }
- else if(curarea->spacetype==SPACE_BUTS && (G.qual & LR_CTRLKEY)==0);
- else if (view2dzoom(event)) {
- return 0;
- }
- }
-
- /* test where mouse is */
- getmouseco_areawin(mvalo);
- /* initialize this too */
- mval[0]= mvalo[0];
- mval[1]= mvalo[1];
-
- if ELEM7(curarea->spacetype, SPACE_IPO, SPACE_SEQ, SPACE_OOPS, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME) {
-
- if( BLI_in_rcti(&G.v2d->mask, (int)mvalo[0], (int)mvalo[1]) ) {
- facx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(float)(G.v2d->mask.xmax-G.v2d->mask.xmin);
- facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- }
- /* stoopid exception to allow scroll in lefthand side */
- else if(curarea->spacetype==SPACE_ACTION && BLI_in_rcti(&G.v2d->mask, ACTWIDTH+(int)mvalo[0], (int)mvalo[1]) ) {
- facx= 0.0f;
- facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- }
- else if(curarea->spacetype==SPACE_NLA && BLI_in_rcti(&G.v2d->mask, NLAWIDTH+(int)mvalo[0], (int)mvalo[1]) ) {
- facx= 0.0f;
- facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- }
- else if(IN_2D_VERT_SCROLL((int)mvalo)) {
- facy= -(G.v2d->tot.ymax-G.v2d->tot.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- if(get_mbut() & mousebut) {
- /* which part of scrollbar should move? */
- if(mvalo[1]< (vertymin+vertymax)/2 ) right= 0.0;
- else left= 0.0;
- leftret= 0;
- }
- if(is_wheel)
- facy= -facy;
- }
- else if(IN_2D_HORIZ_SCROLL((int)mvalo)) {
- facx= -(G.v2d->tot.xmax-G.v2d->tot.xmin)/(float)(G.v2d->mask.xmax-G.v2d->mask.xmin);
- if(get_mbut() & mousebut) {
- /* which part of scrollbar should move? */
- if(mvalo[0]< (horxmin+horxmax)/2 ) right= 0.0;
- else left= 0.0;
- leftret= 0;
- }
- }
- }
- else {
- facx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(float)(curarea->winx);
- facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(curarea->winy);
- }
-
- cursor = BC_NSEW_SCROLLCURSOR;
-
- /* no y move in audio & time */
- if ELEM(curarea->spacetype, SPACE_SOUND, SPACE_TIME) {
- facy= 0.0;
- cursor = BC_EW_SCROLLCURSOR;
- }
-
- /* store the old cursor to temporarily change it */
- oldcursor=get_cursor();
- win=winlay_get_active_window();
-
-
- if(get_mbut() & mousebut && leftret) return 0;
- if(facx==0.0 && facy==0.0) return 1;
-
- if (!is_wheel) SetBlenderCursor(cursor);
-
- while( (get_mbut()&(L_MOUSE|M_MOUSE)) || is_wheel) {
-
- /* If the mousewheel is used with shift key
- * the scroll up and down. If the mousewheel
- * is used with the ctrl key then scroll left
- * and right.
- */
- if (is_wheel) {
-
- if(event==WHEELDOWNMOUSE) {
- facx= -facx; facy= -facy;
- }
- switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) {
- case (LR_SHIFTKEY):
- dx = 0.0;
- dy= facy*20.0;
- break;
- case (LR_CTRLKEY):
- dx= facx*20.0;
- dy = 0.0;
- break;
- default:
- if(curarea->spacetype==SPACE_OOPS) {
- dx= 0.0;
- dy= facy*20;
- }
- else if(curarea->spacetype==SPACE_BUTS) {
- if(G.buts->align==BUT_HORIZONTAL) {
- dx= facx*30; dy= 0.0;
- } else {
- dx= 0.0; dy= facy*30;
- }
- }
- else return 0;
- break;
- }
- }
- else {
-
-
- getmouseco_areawin(mval);
- dx= facx*(mvalo[0]-mval[0]);
- dy= facy*(mvalo[1]-mval[1]);
- }
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || is_wheel) {
- ScrArea *sa;
-
- G.v2d->cur.xmin+= left*dx;
- G.v2d->cur.xmax+= right*dx;
- G.v2d->cur.ymin+= left*dy;
- G.v2d->cur.ymax+= right*dy;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
-
- sa= curarea; /* bad global */
- view2d_do_locks(curarea, V2D_LOCK_COPY|V2D_LOCK_REDRAW);
- areawinset(sa->win);
-
- if(curarea->spacetype==SPACE_OOPS)
- ((SpaceOops *)curarea->spacedata.first)->storeflag |= SO_TREESTORE_REDRAW;
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
- else BIF_wait_for_statechange();
- /* return if we were using the mousewheel
- */
- if ( is_wheel ) return 1;
- }
-
- window_set_cursor(win, oldcursor);
- return 1;
-}
-
-void view2dborder(void)
-{
-
-}
-
-EditIpo *select_proj_ipo(rctf *rectf, int event)
-{
- EditIpo *ei;
- float xmin, ymin, xmax, ymax;
- /* this was IGLuint, but it's a useless typedef... */
- GLuint buffer[MAXPICKBUF];
- int a, b;
- int hits;
- unsigned int code;
- short mval[2];
-
- G.f |= G_PICKSEL;
-
- if(rectf==0) {
- getmouseco_areawin(mval);
-
- mval[0]-= 6; mval[1]-= 6;
- areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin);
- mval[0]+= 12; mval[1]+= 12;
- areamouseco_to_ipoco(G.v2d, mval, &xmax, &ymax);
-
- myortho2(xmin, xmax, ymin, ymax);
- }
- else myortho2(rectf->xmin, rectf->xmax, rectf->ymin, rectf->ymax);
-
- glSelectBuffer( MAXPICKBUF, buffer);
- glRenderMode(GL_SELECT);
- glInitNames(); /* whatfor? but otherwise it does not work */
- glPushName(-1);
-
- /* get rid of buttons view */
- glPushMatrix();
- glLoadIdentity();
-
- init_pickselcode(); /* drawipo.c */
- draw_ipocurves(0);
-
- /* restore buttons view */
- glPopMatrix();
-
- G.f -= G_PICKSEL;
-
- hits= glRenderMode(GL_RENDER);
- glPopName(); /* see above (pushname) */
- if(hits<1) return 0;
-
- code= 1;
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN(ei, icu, flag & IPO_VISIBLE) {
- if(rectf) {
- for(b=0; b<hits; b++) {
- /* conversion for glSelect */
- if(code == buffer[ (4 * b) + 3] ) {
- if(event==LEFTMOUSE) ei->flag |= IPO_SELECT;
- else ei->flag &= ~IPO_SELECT;
- ei->icu->flag= ei->flag;
- }
- }
- }
- else {
- /* also conversion for glSelect */
- if(code==buffer[ 3 ]) return ei;
- }
- code++;
- }
- }
- return 0;
-}
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c
deleted file mode 100644
index ba266fa8c29..00000000000
--- a/source/blender/src/drawmesh.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_edgehash.h"
-#include "BLI_editVert.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_property_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_bmfont.h"
-#include "BKE_displist.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_effect.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_property.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-#include "BDR_drawmesh.h"
-
-#include "BSE_drawview.h"
-
-#include "GPU_extensions.h"
-#include "GPU_draw.h"
-
-#include "blendef.h"
-#include "nla.h"
-
-/***/
-
- /* Flags for marked edges */
-enum {
- eEdge_Visible = (1<<0),
- eEdge_Select = (1<<1),
-};
-
- /* Creates a hash of edges to flags indicating
- * adjacent tface select/active/etc flags.
- */
-static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flags)
-{
- int *flags_p;
-
- if (!BLI_edgehash_haskey(eh, v0, v1)) {
- BLI_edgehash_insert(eh, v0, v1, 0);
- }
-
- flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1);
- *flags_p |= flags;
-}
-
-static EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me)
-{
- EdgeHash *eh = BLI_edgehash_new();
- int i;
- MFace *mf;
- MTFace *tf = NULL;
-
- for (i=0; i<me->totface; i++) {
- mf = &me->mface[i];
- if (me->mtface)
- tf = &me->mtface[i];
-
- if (mf->v3) {
- if (!(mf->flag&ME_HIDE)) {
- unsigned int flags = eEdge_Visible;
- if (mf->flag&ME_FACE_SEL) flags |= eEdge_Select;
-
- get_marked_edge_info__orFlags(eh, mf->v1, mf->v2, flags);
- get_marked_edge_info__orFlags(eh, mf->v2, mf->v3, flags);
- if (mf->v4) {
- get_marked_edge_info__orFlags(eh, mf->v3, mf->v4, flags);
- get_marked_edge_info__orFlags(eh, mf->v4, mf->v1, flags);
- } else {
- get_marked_edge_info__orFlags(eh, mf->v3, mf->v1, flags);
- }
- }
- }
- }
-
- return eh;
-}
-
-
-static int draw_tfaces3D__setHiddenOpts(void *userData, int index)
-{
- struct { Mesh *me; EdgeHash *eh; } *data = userData;
- MEdge *med = &data->me->medge[index];
- uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
-
- if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) {
- return 0;
- } else if(G.f & G_DRAWEDGES){
- if (G.f&G_HIDDENEDGES) {
- return 1;
- } else {
- return (flags & eEdge_Visible);
- }
- } else {
- return (flags & eEdge_Select);
- }
-}
-static int draw_tfaces3D__setSeamOpts(void *userData, int index)
-{
- struct { Mesh *me; EdgeHash *eh; } *data = userData;
- MEdge *med = &data->me->medge[index];
- uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
-
- if (med->flag&ME_SEAM) {
- if (G.f&G_HIDDENEDGES) {
- return 1;
- } else {
- return (flags & eEdge_Visible);
- }
- } else {
- return 0;
- }
-}
-static int draw_tfaces3D__setSelectOpts(void *userData, int index)
-{
- struct { Mesh *me; EdgeHash *eh; } *data = userData;
- MEdge *med = &data->me->medge[index];
- uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
-
- return flags & eEdge_Select;
-}
-static int draw_tfaces3D__setActiveOpts(void *userData, int index)
-{
- struct { Mesh *me; EdgeHash *eh; } *data = userData;
- MEdge *med = &data->me->medge[index];
- uintptr_t flags = (intptr_t) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
-
- if (flags & eEdge_Select) {
- return 1;
- } else {
- return 0;
- }
-}
-static int draw_tfaces3D__drawFaceOpts(void *userData, int index)
-{
- Mesh *me = (Mesh*)userData;
-
- MFace *mface = &me->mface[index];
- if (!(mface->flag&ME_HIDE) && (mface->flag&ME_FACE_SEL))
- return 2; /* Don't set color */
- else
- return 0;
-}
-static void draw_tfaces3D(Object *ob, Mesh *me, DerivedMesh *dm)
-{
- struct { Mesh *me; EdgeHash *eh; } data;
-
- data.me = me;
- data.eh = get_tface_mesh_marked_edge_info(me);
-
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
- bglPolygonOffset(1.0);
-
- /* Draw (Hidden) Edges */
- BIF_ThemeColor(TH_EDGE_FACESEL);
- dm->drawMappedEdges(dm, draw_tfaces3D__setHiddenOpts, &data);
-
- /* Draw Seams */
- if(G.f & G_DRAWSEAMS) {
- BIF_ThemeColor(TH_EDGE_SEAM);
- glLineWidth(2);
-
- dm->drawMappedEdges(dm, draw_tfaces3D__setSeamOpts, &data);
-
- glLineWidth(1);
- }
-
- /* Draw Selected Faces */
- if(G.f & G_DRAWFACES) {
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- BIF_ThemeColor4(TH_FACE_SELECT);
-
- dm->drawMappedFacesTex(dm, draw_tfaces3D__drawFaceOpts, (void*)me);
-
- glDisable(GL_BLEND);
- }
-
- bglPolygonOffset(1.0);
-
- /* Draw Stippled Outline for selected faces */
- glColor3ub(255, 255, 255);
- setlinestyle(1);
- dm->drawMappedEdges(dm, draw_tfaces3D__setSelectOpts, &data);
- setlinestyle(0);
-
- dm->drawMappedEdges(dm, draw_tfaces3D__setActiveOpts, &data);
-
- bglPolygonOffset(0.0); // resets correctly now, even after calling accumulated offsets
-
- BLI_edgehash_free(data.eh, NULL);
-}
-
-static Material *give_current_material_or_def(Object *ob, int matnr)
-{
- extern Material defmaterial; // render module abuse...
- Material *ma= give_current_material(ob, matnr);
-
- return ma?ma:&defmaterial;
-}
-
-static int set_draw_settings_cached(int clearcache, int textured, MTFace *texface, int lit, Object *litob, int litmatnr, int doublesided)
-{
- static int c_textured;
- static int c_lit;
- static int c_doublesided;
- static MTFace *c_texface;
- static Object *c_litob;
- static int c_litmatnr;
- static int c_badtex;
-
- if (clearcache) {
- c_textured= c_lit= c_doublesided= -1;
- c_texface= (MTFace*) -1;
- c_litob= (Object*) -1;
- c_litmatnr= -1;
- c_badtex= 0;
- }
-
- if (texface) {
- lit = lit && (lit==-1 || texface->mode&TF_LIGHT);
- textured = textured && (texface->mode&TF_TEX);
- doublesided = texface->mode&TF_TWOSIDE;
- } else {
- textured = 0;
- }
-
- if (doublesided!=c_doublesided) {
- if (doublesided) glDisable(GL_CULL_FACE);
- else glEnable(GL_CULL_FACE);
-
- c_doublesided= doublesided;
- }
-
- if (textured!=c_textured || texface!=c_texface) {
- if (textured ) {
- c_badtex= !GPU_set_tpage(texface);
- } else {
- GPU_set_tpage(0);
- c_badtex= 0;
- }
- c_textured= textured;
- c_texface= texface;
- }
-
- if (c_badtex) lit= 0;
- if (lit!=c_lit || litob!=c_litob || litmatnr!=c_litmatnr) {
- if (lit) {
- Material *ma= give_current_material_or_def(litob, litmatnr+1);
- float spec[4];
-
- spec[0]= ma->spec*ma->specr;
- spec[1]= ma->spec*ma->specg;
- spec[2]= ma->spec*ma->specb;
- spec[3]= 1.0;
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glEnable(GL_LIGHTING);
- glEnable(GL_COLOR_MATERIAL);
- }
- else {
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
- }
- c_lit= lit;
- c_litob= litob;
- c_litmatnr= litmatnr;
- }
-
- return c_badtex;
-}
-
-/* Icky globals, fix with userdata parameter */
-
-struct TextureDrawState {
- Object *ob;
- int islit, istex;
- unsigned char obcol[4];
-} Gtexdraw = {NULL, 0, 0, {0, 0, 0, 0}};
-
-static void draw_textured_begin(Object *ob)
-{
- unsigned char obcol[4];
- int istex, solidtex= 0;
-
- if(G.vd->drawtype==OB_SOLID || (ob==G.obedit && G.vd->drawtype!=OB_TEXTURE)) {
- /* draw with default lights in solid draw mode and edit mode */
- solidtex= 1;
- Gtexdraw.islit= -1;
- }
- else
- /* draw with lights in the scene otherwise */
- Gtexdraw.islit= GPU_scene_object_lights(G.scene, ob, G.vd->lay, G.vd->viewmat);
-
- obcol[0]= CLAMPIS(ob->col[0]*255, 0, 255);
- obcol[1]= CLAMPIS(ob->col[1]*255, 0, 255);
- obcol[2]= CLAMPIS(ob->col[2]*255, 0, 255);
- obcol[3]= CLAMPIS(ob->col[3]*255, 0, 255);
-
- glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
- if(solidtex || G.vd->drawtype==OB_TEXTURE) istex= 1;
- else istex= 0;
-
- Gtexdraw.ob = ob;
- Gtexdraw.istex = istex;
- memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
- set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0);
- glShadeModel(GL_SMOOTH);
-}
-
-static void draw_textured_end()
-{
- /* switch off textures */
- GPU_set_tpage(0);
-
- glShadeModel(GL_FLAT);
- glDisable(GL_CULL_FACE);
-
- /* XXX, bad patch - GPU_default_lights() calls
- * glLightfv(GL_LIGHT_POSITION, ...) which
- * is transformed by the current matrix... we
- * need to make sure that matrix is identity.
- *
- * It would be better if drawmesh.c kept track
- * of and restored the light settings it changed.
- * - zr
- */
- glPushMatrix();
- glLoadIdentity();
- GPU_default_lights();
- glPopMatrix();
-}
-
-
-static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr)
-{
- if (tface && (tface->mode&TF_INVISIBLE)) return 0;
-
- if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) {
- glColor3ub(0xFF, 0x00, 0xFF);
- return 2; /* Don't set color */
- } else if (tface && tface->mode&TF_OBCOL) {
- glColor3ubv(Gtexdraw.obcol);
- return 2; /* Don't set color */
- } else if (!mcol) {
- if (tface) glColor3f(1.0, 1.0, 1.0);
- else {
- Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
- if(ma) glColor3f(ma->r, ma->g, ma->b);
- else glColor3f(1.0, 1.0, 1.0);
- }
- return 2; /* Don't set color */
- } else {
- return 1; /* Set color from mcol */
- }
-}
-
-static int draw_tface_mapped__set_draw(void *userData, int index)
-{
- Mesh *me = (Mesh*)userData;
- MTFace *tface = (me->mtface)? &me->mtface[index]: NULL;
- MFace *mface = (me->mface)? &me->mface[index]: NULL;
- MCol *mcol = (me->mcol)? &me->mcol[index]: NULL;
- int matnr = me->mface[index].mat_nr;
- if (mface && mface->flag&ME_HIDE) return 0;
- return draw_tface__set_draw(tface, mcol, matnr);
-}
-
-static int draw_em_tf_mapped__set_draw(void *userData, int index)
-{
- EditMesh *em = userData;
- EditFace *efa = EM_get_face_for_index(index);
- MTFace *tface;
- MCol *mcol;
- int matnr;
-
- if (efa==NULL || efa->h)
- return 0;
-
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- matnr = efa->mat_nr;
-
- return draw_tface__set_draw(tface, mcol, matnr);
-}
-
-static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
-{
- Mesh *me = (Mesh*)userData;
- MTFace *tface = (me->mtface)? &me->mtface[index]: NULL;
- MFace *mface = (me->mface)? &me->mface[index]: NULL;
-
- if ((mface->flag&ME_HIDE) || (tface && (tface->mode&TF_INVISIBLE)))
- return 0;
-
- *drawSmooth_r = 1;
- return 1;
-}
-
-void draw_mesh_text(Object *ob, int glsl)
-{
- Mesh *me = ob->data;
- DerivedMesh *ddm;
- MFace *mf, *mface= me->mface;
- MTFace *tface= me->mtface;
- MCol *mcol= me->mcol; /* why does mcol exist? */
- bProperty *prop = get_ob_property(ob, "Text");
- GPUVertexAttribs gattribs;
- int a, totface= me->totface;
-
- /* don't draw without tfaces */
- if(!tface)
- return;
-
- /* don't draw when editing */
- if(ob==G.obedit)
- return;
- else if(ob==OBACT)
- if(FACESEL_PAINT_TEST)
- return;
-
- ddm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH);
-
- for(a=0, mf=mface; a<totface; a++, tface++, mf++) {
- int mode= tface->mode;
- int matnr= mf->mat_nr;
- int mf_smooth= mf->flag & ME_SMOOTH;
-
- if (!(mf->flag&ME_HIDE) && !(mode&TF_INVISIBLE) && (mode&TF_BMFONT)) {
- float v1[3], v2[3], v3[3], v4[3];
- char string[MAX_PROPSTRING];
- int characters, i, glattrib= -1, badtex= 0;
-
- if(glsl) {
- GPU_enable_material(matnr+1, &gattribs);
-
- for(i=0; i<gattribs.totlayer; i++) {
- if(gattribs.layer[i].type == CD_MTFACE) {
- glattrib = gattribs.layer[i].glindex;
- break;
- }
- }
- }
- else {
- badtex = set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE);
- if (badtex) {
- if (mcol) mcol+=4;
- continue;
- }
- }
-
- ddm->getVertCo(ddm, mf->v1, v1);
- ddm->getVertCo(ddm, mf->v2, v2);
- ddm->getVertCo(ddm, mf->v3, v3);
- if (mf->v4) ddm->getVertCo(ddm, mf->v4, v4);
-
- // The BM_FONT handling is in the gpu module, shared with the
- // game engine, was duplicated previously
-
- set_property_valstr(prop, string);
- characters = strlen(string);
-
- if(!BKE_image_get_ibuf(tface->tpage, NULL))
- characters = 0;
-
- if (!mf_smooth) {
- float nor[3];
-
- CalcNormFloat(v1, v2, v3, nor);
-
- glNormal3fv(nor);
- }
-
- GPU_render_text(tface, tface->mode, string, characters,
- (unsigned int*)mcol, v1, v2, v3, (mf->v4? v4: NULL), glattrib);
- }
- if (mcol) {
- mcol+=4;
- }
- }
-
- ddm->release(ddm);
-}
-
-void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
-{
- Mesh *me= ob->data;
-
- /* correct for negative scale */
- if(ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
- else glFrontFace(GL_CCW);
-
- /* draw the textured mesh */
- draw_textured_begin(ob);
-
- if(ob==G.obedit) {
- dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, G.editMesh);
- } else if(faceselect) {
- if(G.f & G_WEIGHTPAINT)
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1);
- else
- dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
- }
- else
- dm->drawFacesTex(dm, draw_tface__set_draw);
-
- /* draw game engine text hack */
- if(get_ob_property(ob, "Text"))
- draw_mesh_text(ob, 0);
-
- draw_textured_end();
-
- /* draw edges and selected faces over textured mesh */
- if(!G.obedit && faceselect)
- draw_tfaces3D(ob, me, dm);
-
- /* reset from negative scale correction */
- glFrontFace(GL_CCW);
-
- /* in editmode, the blend mode needs to be set incase it was ADD */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-}
-
diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c
deleted file mode 100644
index 083d10fd484..00000000000
--- a/source/blender/src/drawnla.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef _WIN32
-#pragma warning (once : 4761)
-#endif
-
-#include "BMF_Api.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "DNA_view3d_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_object_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_action_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_constraint_types.h"
-
-#include "BLI_blenlib.h"
-#include "MEM_guardedalloc.h"
-
-#include "BKE_action.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-
-#include "BSE_drawnla.h"
-#include "BSE_drawipo.h"
-#include "BSE_editnla_types.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "BIF_editnla.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
-#include "BDR_drawaction.h"
-#include "BDR_editcurve.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
-
-#define TESTBASE_SAFE(base) ((base)->flag & SELECT && ((base)->object->restrictflag & OB_RESTRICT_VIEW)==0)
-
-
-/* the left hand side with channels only */
-static void draw_nla_channels(void)
-{
- bActionStrip *strip;
- Base *base;
- Object *ob;
- float x, y;
- short ofsx, ofsy = 0;
-
- myortho2(0, NLAWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling
-
- /* Clip to the scrollable area */
- if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= curarea->winrct.xmin;
- ofsy= curarea->winrct.ymin;
- glViewport(ofsx, ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin));
- glScissor(ofsx, ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin));
- }
- }
-
- glColor3ub(0x00, 0x00, 0x00);
-
- x = 0.0;
- y = count_nla_levels();
- y*= (NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- for (base=G.scene->base.first; base; base=base->next){
- if (nla_filter(base)) {
- ob= base->object;
-
- BIF_ThemeColorShade(TH_HEADER, 20);
- glRectf(x, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2);
-
- /* Draw the name / ipo timeline*/
- if (TESTBASE_SAFE(base))
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
- glRasterPos2f(x+34, y-4);
- BMF_DrawString(G.font, ob->id.name+2);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
-
- /* icon to indicate expanded or collapsed */
- if ((ob->nlastrips.first) || (ob->action)) {
- if (ob->nlaflag & OB_NLA_COLLAPSED)
- BIF_icon_draw(x+1, y-8, ICON_TRIA_RIGHT);
- else
- BIF_icon_draw(x+1, y-8, ICON_TRIA_DOWN);
- }
-
- /* icon to indicate nla or action */
- if(ob->nlastrips.first && ob->action) {
- if(ob->nlaflag & OB_NLA_OVERRIDE)
- BIF_icon_draw(x+17, y-8, ICON_NLA);
- else
- BIF_icon_draw(x+17, y-8, ICON_ACTION);
- }
-
- /* icon to indicate if ipo-channel muted */
- if (ob->ipo) {
- if (ob->ipo->muteipo)
- BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_ON);
- else
- BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_OFF);
- }
-
- glDisable(GL_BLEND);
- y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
-
- /* check if object's nla strips are collapsed or not */
- if ((ob->nlaflag & OB_NLA_COLLAPSED)==0) {
- /* Draw the action timeline */
- if (ob->action){
- BIF_ThemeColorShade(TH_HEADER, -20);
- glRectf(x+19, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2);
-
- if (TESTBASE_SAFE(base))
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
- glRasterPos2f(x+38, y-4);
- BMF_DrawString(G.font, ob->action->id.name+2);
-
- /* icon for active action (no strip mapping) */
- for (strip = ob->nlastrips.first; strip; strip=strip->next)
- if(strip->flag & ACTSTRIP_ACTIVE) break;
- if(strip==NULL) {
- glEnable(GL_BLEND);
- BIF_icon_draw(x+5, y-8, ICON_DOT);
- glDisable(GL_BLEND);
- }
-
- y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
- }
-
- /* Draw the nla strips */
- for (strip = ob->nlastrips.first; strip; strip=strip->next){
- BIF_ThemeColorShade(TH_HEADER, -40);
- glRectf(x+32, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2);
-
- if (TESTBASE_SAFE(base))
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
-
- // why this test? check freeing mem when deleting strips? (ton)
- if(strip->act) {
- glRasterPos2f(x+48, y-4);
- BMF_DrawString(G.font, strip->act->id.name+2);
-
- glEnable(GL_BLEND);
-
- if(strip->flag & ACTSTRIP_ACTIVE)
- BIF_icon_draw(x+16, y-8, ICON_DOT);
-
- if(strip->modifiers.first)
- BIF_icon_draw(x+34, y-8, ICON_MODIFIER);
-
- if(strip->flag & ACTSTRIP_MUTE)
- BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_ON);
- else
- BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_OFF);
-
- glDisable(GL_BLEND);
- }
-
- y-=(NLACHANNELHEIGHT+NLACHANNELSKIP);
- }
- }
- }
- }
-
- myortho2(0, NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin)); // Scaling
-}
-
-void map_active_strip(gla2DDrawInfo *di, Object *ob, int restore)
-{
- static rctf stored;
-
- if(restore)
- gla2DSetMap(di, &stored);
- else {
- rctf map;
-
- gla2DGetMap(di, &stored);
- map= stored;
- map.xmin= get_action_frame(ob, map.xmin);
- map.xmax= get_action_frame(ob, map.xmax);
- if(map.xmin==map.xmax) map.xmax+= 1.0;
- gla2DSetMap(di, &map);
- }
-}
-
-/* the right hand side, with strips and keys */
-static void draw_nla_strips_keys(SpaceNla *snla)
-{
- Base *base;
- rcti scr_rct;
- gla2DDrawInfo *di;
- float y;
- char col1[3], col2[3];
-
- BIF_GetThemeColor3ubv(TH_SHADE2, col2);
- BIF_GetThemeColor3ubv(TH_HILITE, col1);
-
- /* Draw strips */
-
- scr_rct.xmin= snla->area->winrct.xmin + snla->v2d.mask.xmin;
- scr_rct.ymin= snla->area->winrct.ymin + snla->v2d.mask.ymin;
- scr_rct.xmax= snla->area->winrct.xmin + snla->v2d.hor.xmax;
- scr_rct.ymax= snla->area->winrct.ymin + snla->v2d.mask.ymax;
- di= glaBegin2DDraw(&scr_rct, &G.v2d->cur);
-
- y=count_nla_levels();
- y*= (NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- for (base=G.scene->base.first; base; base=base->next){
- Object *ob= base->object;
- bActionStrip *strip;
- int frame1_x, channel_y;
-
- if (nla_filter(base)==0)
- continue;
-
- /* Draw the field */
- glEnable (GL_BLEND);
- if (TESTBASE_SAFE(base))
- glColor4ub (col1[0], col1[1], col1[2], 0x22);
- else
- glColor4ub (col2[0], col2[1], col2[2], 0x22);
-
- gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
- glRectf(0, channel_y-NLACHANNELHEIGHT/2, frame1_x, channel_y+NLACHANNELHEIGHT/2);
-
-
- if (TESTBASE_SAFE(base))
- glColor4ub (col1[0], col1[1], col1[2], 0x44);
- else
- glColor4ub (col2[0], col2[1], col2[2], 0x44);
- glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2);
-
- glDisable (GL_BLEND);
-
- /* Draw the ipo keys */
- draw_object_channel(di, ob, y);
-
- y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
-
- /* check if object nla-strips expanded or not */
- if (ob->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
-
- /* Draw the action strip */
- if (ob->action) {
-
- /* Draw the field */
- glEnable (GL_BLEND);
- if (TESTBASE_SAFE(base))
- glColor4ub (col1[0], col1[1], col1[2], 0x22);
- else
- glColor4ub (col2[0], col2[1], col2[2], 0x22);
-
- gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
- glRectf(0, channel_y-NLACHANNELHEIGHT/2+4, frame1_x, channel_y+NLACHANNELHEIGHT/2-4);
-
- if (TESTBASE_SAFE(base))
- glColor4ub (col1[0], col1[1], col1[2], 0x44);
- else
- glColor4ub (col2[0], col2[1], col2[2], 0x44);
- glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2+4, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2-4);
-
- glDisable (GL_BLEND);
-
- /* Draw the action keys, optionally corrected for active strip */
- map_active_strip(di, ob, 0);
- draw_action_channel(di, ob->action, y);
- map_active_strip(di, ob, 1);
-
- y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
-
- }
-
- /* Draw the nla strips */
- for (strip=ob->nlastrips.first; strip; strip=strip->next){
- int stripstart, stripend;
- int blendstart, blendend;
-
- /* Draw rect */
- if (strip->flag & ACTSTRIP_SELECT)
- BIF_ThemeColor(TH_STRIP_SELECT);
- else
- BIF_ThemeColor(TH_STRIP);
-
- gla2DDrawTranslatePt(di, strip->start+strip->blendin, y, &stripstart, &channel_y);
- gla2DDrawTranslatePt(di, strip->end-strip->blendout, y, &stripend, &channel_y);
- glRectf(stripstart, channel_y-NLACHANNELHEIGHT/2+3, stripend, channel_y+NLACHANNELHEIGHT/2-3);
-
- if (strip->flag & ACTSTRIP_SELECT)
- BIF_ThemeColorShade(TH_STRIP_SELECT, -60);
- else
- BIF_ThemeColorShade(TH_STRIP, -60);
-
- /* Draw blendin */
- if (strip->blendin>0){
- glBegin(GL_TRIANGLES);
-
- gla2DDrawTranslatePt(di, strip->start, y, &blendstart, &channel_y);
-
- glVertex2f(blendstart, channel_y-NLACHANNELHEIGHT/2+3);
- glVertex2f(stripstart, channel_y+NLACHANNELHEIGHT/2-3);
- glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3);
-
-
- glEnd();
- }
- if (strip->blendout>0){
- glBegin(GL_TRIANGLES);
-
- gla2DDrawTranslatePt(di, strip->end, y, &blendend, &channel_y);
-
- glVertex2f(blendend, channel_y-NLACHANNELHEIGHT/2+3);
- glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3);
- glVertex2f(stripend, channel_y-NLACHANNELHEIGHT/2+3);
- glEnd();
- }
-
- gla2DDrawTranslatePt(di, strip->start, y, &stripstart, &channel_y);
- gla2DDrawTranslatePt(di, strip->end, y, &stripend, &channel_y);
-
- /* muted strip */
- if(strip->flag & ACTSTRIP_MUTE) {
- glColor3f(1, 0, 0);
- glBegin(GL_LINES);
- glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3);
- glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3);
- glEnd();
- }
-
- /* Draw border */
- glEnable (GL_BLEND);
- glBegin(GL_LINE_STRIP);
- glColor4f(1, 1, 1, 0.7);
-
- glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3);
- glVertex2f(stripstart, channel_y+NLACHANNELHEIGHT/2-3);
- glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3);
- glColor4f(0, 0, 0, 0.7);
- glVertex2f(stripend, channel_y-NLACHANNELHEIGHT/2+3);
- glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3);
- glEnd();
-
- /* Show strip extension */
- if (strip->flag & ACTSTRIP_HOLDLASTFRAME){
- if (strip->flag & ACTSTRIP_SELECT)
- BIF_ThemeColorShadeAlpha(TH_STRIP_SELECT, 0, -180);
- else
- BIF_ThemeColorShadeAlpha(TH_STRIP, 0, -180);
-
- glRectf(stripend, channel_y-NLACHANNELHEIGHT/2+4, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2-2);
- }
-
- /* Show repeat */
- if (strip->repeat > 1.0 && !(strip->flag & ACTSTRIP_USESTRIDE)){
- float rep = 1;
- glBegin(GL_LINES);
- while (rep<strip->repeat){
- /* Draw line */
- glColor4f(0, 0, 0, 0.5);
- gla2DDrawTranslatePt(di, strip->start+(rep*((strip->end-strip->start)/strip->repeat)), y, &frame1_x, &channel_y);
- glVertex2f(frame1_x, channel_y-NLACHANNELHEIGHT/2+4);
- glVertex2f(frame1_x, channel_y+NLACHANNELHEIGHT/2-2);
-
- glColor4f(1.0, 1.0, 1.0, 0.5);
- gla2DDrawTranslatePt(di, strip->start+(rep*((strip->end-strip->start)/strip->repeat)), y, &frame1_x, &channel_y);
- glVertex2f(frame1_x+1, channel_y-NLACHANNELHEIGHT/2+4);
- glVertex2f(frame1_x+1, channel_y+NLACHANNELHEIGHT/2-2);
- rep+=1.0;
- }
- glEnd();
-
- }
- glDisable (GL_BLEND);
-
- y-=(NLACHANNELHEIGHT+NLACHANNELSKIP);
- }
- }
- glaEnd2DDraw(di);
-
-}
-
-/* ******* panel *********** */
-
-#define B_NLA_PANEL 121
-#define B_NLA_LOCK 122
-#define B_NLA_SCALE 123
-#define B_NLA_SCALE2 124
-#define B_NLA_MOD_ADD 125
-#define B_NLA_MOD_NEXT 126
-#define B_NLA_MOD_PREV 127
-#define B_NLA_MOD_DEL 128
-#define B_NLA_MOD_DEPS 129
-
-/* For now just returns the first selected strip */
-bActionStrip *get_active_nlastrip(Object **obpp)
-{
- Base *base;
- bActionStrip *strip;
-
- for (base=G.scene->base.first; base; base=base->next){
- if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) {
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT) {
- *obpp= base->object;
- return strip;
- }
- }
- }
- }
-
- return NULL;
-}
-
-void do_nlabuts(unsigned short event)
-{
- Object *ob;
- bActionStrip *strip;
-
- /* Determine if an nla strip has been selected */
- strip = get_active_nlastrip(&ob);
- if (!strip) return;
-
- switch(event) {
- case B_REDR:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWNLA, 0);
- break;
- case B_NLA_PANEL:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWVIEW3D, 0);
- break;
- case B_NLA_SCALE: /* adjust end-frame when scale is changed */
- {
- float actlen= strip->actend - strip->actstart;
- float mapping= strip->scale * strip->repeat;
-
- if (mapping != 0.0f)
- strip->end = (actlen * mapping) + strip->start;
- else
- printf("NLA Scale Error: Scale = %0.4f, Repeat = %0.4f \n", strip->scale, strip->repeat);
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_NLA_SCALE2: /* adjust scale when end-frame is changed */
- {
- float actlen= strip->actend - strip->actstart;
- float len= strip->end - strip->start;
-
- strip->scale= len / (actlen * strip->repeat);
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case B_NLA_LOCK:
- synchronize_action_strips();
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_NLA_MOD_ADD:
- {
- bActionModifier *amod= MEM_callocN(sizeof(bActionModifier), "bActionModifier");
-
- BLI_addtail(&strip->modifiers, amod);
- strip->curmod= BLI_countlist(&strip->modifiers)-1;
- allqueue (REDRAWNLA, 0);
- }
- break;
- case B_NLA_MOD_DEL:
- if(strip->modifiers.first) {
- bActionModifier *amod= BLI_findlink(&strip->modifiers, strip->curmod);
- BLI_remlink(&strip->modifiers, amod);
- MEM_freeN(amod);
- if(strip->curmod) strip->curmod--;
- allqueue (REDRAWNLA, 0);
- }
- break;
- case B_NLA_MOD_NEXT:
- if(strip->curmod < BLI_countlist(&strip->modifiers)-1)
- strip->curmod++;
- allqueue (REDRAWNLA, 0);
- break;
- case B_NLA_MOD_PREV:
- if(strip->curmod > 0)
- strip->curmod--;
- allqueue (REDRAWNLA, 0);
- break;
- case B_NLA_MOD_DEPS:
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
- break;
- }
-}
-
-static char *make_modifier_menu(ListBase *lb)
-{
- bActionModifier *amod;
- int index= 1;
- char *str, item[64], *types[3]={"Deform", "Noise", "Oomph"};
-
- for (amod = lb->first; amod; amod=amod->next, index++);
- str= MEM_mallocN(index*64, "key string");
- str[0]= 0;
-
- index= 0;
- for (amod = lb->first; amod; amod=amod->next, index++) {
- sprintf (item, "|%s %s%%x%d", types[amod->type], amod->channel, index);
- strcat(str, item);
- }
-
- return str;
-}
-
-
-static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES
-{
- Object *ob;
- bActionStrip *strip;
- uiBlock *block;
- uiBut *but;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(NLA_HANDLER_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "Transform Properties", "NLA", 10, 230, 318, 224)==0) return;
-
- /* Determine if an nla strip has been selected */
- strip = get_active_nlastrip(&ob);
- if (!strip) return;
-
- /* first labels, for simpler align code :) */
- uiDefBut(block, LABEL, 0, "Timeline Range:", 10,180,300,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Blending:", 10,120,150,19, 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "Options:", 160,120,150,19, 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NLA_PANEL, "Strip Start:", 10,160,150,19, &strip->start, -1000.0, strip->end-1, 100, 0, "First frame in the timeline");
- uiDefButF(block, NUM, B_NLA_SCALE2, "Strip End:", 160,160,150,19, &strip->end, strip->start+1, MAXFRAMEF, 100, 0, "Last frame in the timeline");
-
- uiDefIconButBitS(block, ICONTOG, ACTSTRIP_LOCK_ACTION, B_NLA_LOCK, ICON_UNLOCKED, 10,140,20,19, &(strip->flag), 0, 0, 0, 0, "Toggles Action end/start to be automatic mapped to strip duration");
- if(strip->flag & ACTSTRIP_LOCK_ACTION) {
- char str[40];
- sprintf(str, "Action Start: %.2f", strip->actstart);
- uiDefBut(block, LABEL, B_NOP, str, 30,140,140,19, NULL, 0.0, 0.0, 0, 0, "First frame of the action to map to the playrange");
- sprintf(str, "Action End: %.2f", strip->actend);
- uiDefBut(block, LABEL, B_NOP, str, 170,140,140,19, NULL, 0.0, 0.0, 0, 0, "Last frame of the action to map to the playrange");
- }
- else {
- uiDefButF(block, NUM, B_NLA_PANEL, "Action Start:", 30,140,140,19, &strip->actstart, -1000.0, strip->actend-1, 100, 0, "First frame of the action to map to the playrange");
- uiDefButF(block, NUM, B_NLA_PANEL, "Action End:", 170,140,140,19, &strip->actend, strip->actstart+1, MAXFRAMEF, 100, 0, "Last frame of the action to map to the playrange");
- }
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ACTSTRIP_AUTO_BLENDS, B_NLA_LOCK, "Auto-Blending", 10,100,145,19, &(strip->flag), 0, 0, 0, 0, "Toggles automatic calculation of blendin/out values");
- if (strip->flag & ACTSTRIP_AUTO_BLENDS) {
- char str[32];
- sprintf(str, "In: %.2f", strip->blendin);
- uiDefBut(block, LABEL, B_NOP, str, 10,80,77,19, NULL, 0.0, 0.0, 0, 0, "Number of frames of ease-in");
- sprintf(str, "Out: %.2f", strip->blendout);
- uiDefBut(block, LABEL, B_NOP, str, 77,80,78,19, NULL, 0.0, 0.0, 0, 0, "Number of frames of ease-out");
- }
- else {
- uiDefButF(block, NUM, B_NLA_PANEL, "In:", 10,80,77,19, &strip->blendin, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-in");
- uiDefButF(block, NUM, B_NLA_PANEL, "Out:", 77,80,78,19, &strip->blendout, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-out");
- }
- uiDefButBitS(block, TOG, ACTSTRIP_MUTE, B_NLA_PANEL, "Mute", 10,60,145,19, &strip->flag, 0, 0, 0, 0, "Toggles whether the strip contributes to the NLA solution");
-
- uiBlockBeginAlign(block);
- // FIXME: repeat and scale are too cramped!
- uiDefButF(block, NUMABS, B_NLA_SCALE, "Repeat:", 160,100,75,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat");
- if ((strip->actend - strip->actstart) < 1.0f) {
- uiBlockSetCol(block, TH_REDALERT);
- uiDefButF(block, NUMABS, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Please run Alt-S to fix up this error");
- uiBlockSetCol(block, TH_AUTO);
- }
- else
- uiDefButF(block, NUMABS, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Amount the action should be scaled by");
- but= uiDefButC(block, TEX, B_NLA_PANEL, "OffsBone:", 160,80,150,19, strip->offs_bone, 0, 31.0f, 0, 0, "Name of Bone that defines offset for repeat");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
- uiDefButBitS(block, TOG, ACTSTRIP_HOLDLASTFRAME, B_NLA_PANEL, "Hold", 160,60,75,19, &strip->flag, 0, 0, 0, 0, "Toggles whether to continue displaying the last frame past the end of the strip");
- uiDefButS(block, TOG, B_NLA_PANEL, "Add", 235,60,75,19, &strip->mode, 0, 0, 0, 0, "Toggles additive blending mode");
-
- uiBlockEndAlign(block);
-
- uiDefButBitS(block, TOG, ACTSTRIP_USESTRIDE, B_NLA_PANEL, "Stride Path", 10, 30,140,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride");
-
- if (strip->offs_bone[0]) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEX, B_NLA_PANEL, "Use X", 160,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use X as an offset axis. Note that you can use multiple axes at once.");
- uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEY, B_NLA_PANEL, "Use Y", 210,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use Y as an offset axis. Note that you can use multiple axes at once.");
- uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEZ, B_NLA_PANEL, "Use Z", 260,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use Z as an offset axis. Note that you can use multiple axes at once.");
- uiBlockEndAlign(block);
- }
-
- if(ob->dup_group)
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_NLA_PANEL, "Target:", 160,30, 150, 19, &strip->object, "Target Object in this group");
-
- if(strip->flag & ACTSTRIP_USESTRIDE) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OB_DISABLE_PATH, B_NLA_PANEL, "Disable", 10,0,60,19, &ob->ipoflag, 0, 0, 0, 0, "Disable path temporally, for editing cycles");
-
- uiDefButF(block, NUM, B_NLA_PANEL, "Offs:", 70,0,120,19, &strip->actoffs, -500, 500.0, 100, 0, "Action offset in frames to tweak cycle of the action within the stride");
- uiDefButF(block, NUM, B_NLA_PANEL, "Stri:", 190,0,120,19, &strip->stridelen, 0.0001, 1000.0, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range");
-
- uiDefButS(block, ROW, B_NLA_PANEL, "X", 10, -20, 33, 19, &strip->stride_axis, 1, 0, 0, 0, "Dominant axis for Stride Bone");
- uiDefButS(block, ROW, B_NLA_PANEL, "Y", 43, -20, 33, 19, &strip->stride_axis, 1, 1, 0, 0, "Dominant axis for Stride Bone");
- uiDefButS(block, ROW, B_NLA_PANEL, "Z", 76, -20, 34, 19, &strip->stride_axis, 1, 2, 0, 0, "Dominant axis for Stride Bone");
-
- but= uiDefBut(block, TEX, B_NLA_PANEL, "Stride Bone:", 110, -20, 200, 19, strip->stridechannel, 1, 31, 0, 0, "Name of Bone used for stride");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
- }
- else { /* modifiers */
- bActionModifier *amod= BLI_findlink(&strip->modifiers, strip->curmod);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_NLA_MOD_ADD, "Add Modifier", 10,0,140,19, NULL, 0, 0, 0, 0, "");
- if(amod) {
- char *strp= make_modifier_menu(&strip->modifiers);
-
- uiDefIconBut(block, BUT, B_NLA_MOD_NEXT, ICON_TRIA_LEFT, 150,0,20,19, NULL, 0, 0, 0, 0, "Previous Modifier");
- uiDefButS(block, MENU, B_NLA_PANEL, strp, 170,0,20,19, &strip->curmod, 0, 0, 0, 0, "Browse modifier");
- MEM_freeN(strp);
- uiDefIconBut(block, BUT, B_NLA_MOD_PREV, ICON_TRIA_RIGHT, 190,0,20,19, NULL, 0, 0, 0, 0, "Next Modifier");
- uiDefButS(block, MENU, B_REDR, "Deform %x0|Noise %x1|Oomph %x2", 210,0,80,19, &amod->type, 0, 0, 0, 0, "Modifier type");
- uiDefIconBut(block, BUT, B_NLA_MOD_DEL, ICON_X, 290,0,20,19, NULL, 0, 0, 0, 0, "Delete Modifier");
-
- if(amod->type==ACTSTRIP_MOD_DEFORM) {
- but= uiDefBut(block, TEX, B_NLA_PANEL, "Chan:", 10, -20, 130, 19, amod->channel, 1, 31, 0, 0, "Name of channel used for modifier");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
- uiDefButS(block, MENU, B_REDR, "All%x0|XY%x3|XZ%x2|YZ%x1", 140,-20,40,19, &amod->no_rot_axis, 0, 0, 0, 0, "Enable rotation axes (local for curve)");
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_NLA_MOD_DEPS, "Ob:", 180,-20, 130, 19, &amod->ob, "Curve Object");
- }
-#if 0 /* this is not really ready for the primetime yet, but is here for testing */
- else if(amod->type==ACTSTRIP_MOD_NOISE) {
- but= uiDefBut(block, TEX, B_NLA_PANEL, "Chan:", 10, -20, 130, 19, amod->channel, 1, 31, 0, 0, "Name of channel used for modifier");
- uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
- uiDefButBitS(block, TOG, 1, B_NLA_PANEL, "L", 140, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Location of channel");
- uiDefButBitS(block, TOG, 2, B_NLA_PANEL, "R", 160, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Rotation of channel");
- uiDefButBitS(block, TOG, 4, B_NLA_PANEL, "S", 180, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Scaling of channel");
- uiDefButF(block, NUM, B_NLA_PANEL, "NSize:", 200,-20,55,19, &amod->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input");
- uiDefButF(block, NUM, B_NLA_PANEL, "Turb:", 255,-20,55,19, &amod->turbul, 0.0, 200.0, 10, 0, "Sets the depth of the noise");
- }
-#endif
- else
- uiDefBut(block, LABEL, B_NOP, "Ack! Not implemented.", 10, -20, 150, 19, NULL, 0, 0, 0, 0, "");
-
- }
- else { /* for panel aligning */
- uiBlockEndAlign(block);
- uiDefBut(block, LABEL, B_NOP, " ", 10, -20, 150, 19, NULL, 0, 0, 0, 0, "");
- }
- }
-}
-
-static void nla_blockhandlers(ScrArea *sa)
-{
- SpaceNla *snla= sa->spacedata.first;
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(snla->blockhandler[a]) {
-
- case NLA_HANDLER_PROPERTIES:
- nla_panel_properties(snla->blockhandler[a+1]);
- break;
-
- }
- /* clear action value for event */
- snla->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-}
-
-
-void drawnlaspace(ScrArea *sa, void *spacedata)
-{
- float col[3];
- short ofsx = 0, ofsy = 0;
-
- uiFreeBlocksWin(&sa->uiblocks, sa->win); /* for panel handler to work */
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
-
- calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
-
- /* clear all, becomes the color for left part */
- BIF_GetThemeColor3fv(TH_HEADER, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= curarea->winrct.xmin;
- ofsy= curarea->winrct.ymin;
- glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- }
- }
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- /* Draw backdrop */
- calc_ipogrid();
- draw_ipogrid();
-
- /* the right hand side, with strips and keys */
- draw_nla_strips_keys(G.snla);
-
-
- glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- /* Draw current frame */
- draw_cfra_action();
-
- /* draw markers */
- draw_markers_timespace(SCE_MARKERS, 0);
-
- /* Draw preview 'curtains' */
- draw_anim_preview_timespace();
-
- /* Draw scroll */
- mywinset(curarea->win); // reset scissor too
- if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
- if(G.v2d->scroll) drawscroll(0);
- }
- if(G.v2d->mask.xmin!=0) {
- /* Draw channel names */
- draw_nla_channels();
- }
- mywinset(curarea->win); // reset scissor too
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, G.snla->blockscale, G.snla->blockscale, G.snla->blockscale);
- nla_blockhandlers(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-}
-
-int count_nla_levels(void)
-{
- Base *base;
- int y= 0;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if (nla_filter(base)) {
- /* object level */
- y++;
-
- /* nla strips for object collapsed? */
- if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) {
- if(base->object->action)
- y++;
-
- /* Nla strips */
- y+= BLI_countlist(&base->object->nlastrips);
- }
- }
- }
-
- return y;
-}
-
-int nla_filter (Base *base)
-{
- Object *ob = base->object;
-
- if ((G.snla->flag & SNLA_ALLKEYED) || (base->lay & G.scene->lay)) {
- if(ob->action || ob->nlastrips.first)
- return 1;
-
- /* should become option */
- if (ob->ipo)
- return 1;
-
- if (ob->constraintChannels.first)
- return 1;
- }
- return 0;
-}
-
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c
deleted file mode 100644
index ddde111f14b..00000000000
--- a/source/blender/src/drawnode.c
+++ /dev/null
@@ -1,3733 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): David Millan Escriva, Juho Vepsäläinen
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_color_types.h"
-#include "DNA_customdata_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_node.h"
-#include "BKE_object.h"
-#include "BKE_texture.h"
-#include "BKE_text.h"
-#include "BKE_utildefines.h"
-
-#include "CMP_node.h"
-#include "SHD_node.h"
-
-#include "BDR_gpencil.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_drawgpencil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
-#include "BMF_Api.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "RE_pipeline.h"
-#include "IMB_imbuf_types.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "interface.h" /* urm... for rasterpos_safe, roundbox */
-#include "mydevice.h"
-
-extern void autocomplete_uv(char *str, void *arg_v);
-extern int verify_valid_uv_name(char *str);
-
-/* autocomplete callback for buttons */
-static void autocomplete_vcol(char *str, void *arg_v)
-{
- Mesh *me;
- CustomDataLayer *layer;
- AutoComplete *autocpl;
- int a;
-
- if(str[0]==0)
- return;
-
- autocpl= autocomplete_begin(str, 32);
-
- /* search if str matches the beginning of name */
- for(me= G.main->mesh.first; me; me=me->id.next)
- for(a=0, layer= me->fdata.layers; a<me->fdata.totlayer; a++, layer++)
- if(layer->type == CD_MCOL)
- autocomplete_do_name(autocpl, layer->name);
-
- autocomplete_end(autocpl, str);
-}
-
-static int verify_valid_vcol_name(char *str)
-{
- Mesh *me;
- CustomDataLayer *layer;
- int a;
-
- if(str[0]==0)
- return 1;
-
- /* search if str matches the name */
- for(me= G.main->mesh.first; me; me=me->id.next)
- for(a=0, layer= me->fdata.layers; a<me->fdata.totlayer; a++, layer++)
- if(layer->type == CD_MCOL)
- if(strcmp(layer->name, str)==0)
- return 1;
-
- return 0;
-}
-
-static void snode_drawstring(SpaceNode *snode, char *str, int okwidth)
-{
- char drawstr[NODE_MAXSTR];
- int width;
-
- if(str[0]==0 || okwidth<4) return;
-
- BLI_strncpy(drawstr, str, NODE_MAXSTR);
- width= snode->aspect*BIF_GetStringWidth(snode->curfont, drawstr, 0);
-
- if(width > okwidth) {
- int len= strlen(drawstr)-1;
-
- while(width > okwidth && len>=0) {
- drawstr[len]= 0;
-
- width= snode->aspect*BIF_GetStringWidth(snode->curfont, drawstr, 0);
- len--;
- }
- if(len==0) return;
- }
- BIF_DrawString(snode->curfont, drawstr, 0);
-
-}
-
-/* ************** Socket callbacks *********** */
-
-static void socket_vector_menu_cb(void *node_v, void *ntree_v)
-{
- if(node_v && ntree_v) {
- NodeTagChanged(ntree_v, node_v);
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+((bNode *)node_v)->nr);
- }
-}
-
-/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
-static uiBlock *socket_vector_menu(void *socket_v)
-{
- SpaceNode *snode= curarea->spacedata.first;
- bNode *node;
- bNodeSocket *sock= socket_v;
- bNodeStack *ns= &sock->ns;
- uiBlock *block;
- uiBut *bt;
-
- /* a bit ugly... retrieve the node the socket comes from */
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- bNodeSocket *sockt;
- for(sockt= node->inputs.first; sockt; sockt= sockt->next)
- if(sockt==sock)
- break;
- if(sockt)
- break;
- }
-
- block= uiNewBlock(&curarea->uiblocks, "socket menu", UI_EMBOSS, UI_HELV, curarea->win);
-
- /* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", -4, -4, 188, 68, NULL, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- bt= uiDefButF(block, NUMSLI, 0, "X ", 0,40,180,20, ns->vec, ns->min, ns->max, 10, 0, "");
- uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree);
- bt= uiDefButF(block, NUMSLI, 0, "Y ", 0,20,180,20, ns->vec+1, ns->min, ns->max, 10, 0, "");
- uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree);
- bt= uiDefButF(block, NUMSLI, 0, "Z ", 0,0,180,20, ns->vec+2, ns->min, ns->max, 10, 0, "");
- uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree);
-
- uiBlockSetDirection(block, UI_TOP);
-
- allqueue(REDRAWNODE, 0);
-
- return block;
-}
-
-static void node_sync_cb(void *snode_v, void *node_v)
-{
- SpaceNode *snode= snode_v;
-
- if(snode->treetype==NTREE_SHADER) {
- nodeShaderSynchronizeID(node_v, 1);
- allqueue(REDRAWBUTSSHADING, 0);
- }
-}
-
-/* ****************** GENERAL CALLBACKS FOR NODES ***************** */
-
-static void node_ID_title_cb(void *node_v, void *unused_v)
-{
- bNode *node= node_v;
-
- if(node->id) {
- test_idbutton(node->id->name+2); /* library.c, verifies unique name */
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWOOPS, 0);
- }
-}
-
-
-static void node_but_title_cb(void *node_v, void *but_v)
-{
- bNode *node= node_v;
- uiBut *bt= but_v;
- BLI_strncpy(node->name, bt->drawstr, NODE_MAXSTR);
-
- allqueue(REDRAWNODE, 0);
-}
-
-static void node_group_alone_cb(void *node_v, void *unused_v)
-{
- bNode *node= node_v;
-
- nodeCopyGroup(node);
-
- allqueue(REDRAWNODE, 0);
-}
-
-/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */
-
-static int node_buts_group(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block && node->id) {
- uiBut *bt;
- short width;
-
- uiBlockBeginAlign(block);
-
- /* name button */
- width= (short)(butr->xmax-butr->xmin - (node->id->us>1?19.0f:0.0f));
- bt= uiDefBut(block, TEX, B_NOP, "NT:",
- butr->xmin, butr->ymin, width, 19,
- node->id->name+2, 0.0, 19.0, 0, 0, "NodeTree name");
- uiButSetFunc(bt, node_ID_title_cb, node, NULL);
-
- /* user amount */
- if(node->id->us>1) {
- char str1[32];
- sprintf(str1, "%d", node->id->us);
- bt= uiDefBut(block, BUT, B_NOP, str1,
- butr->xmax-19, butr->ymin, 19, 19,
- NULL, 0, 0, 0, 0, "Displays number of users.");
- uiButSetFunc(bt, node_group_alone_cb, node, NULL);
- }
-
- uiBlockEndAlign(block);
- }
- return 19;
-}
-
-static int node_buts_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- bNodeSocket *sock= node->outputs.first; /* first socket stores value */
-
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- sock->ns.vec, sock->ns.min, sock->ns.max, 10, 2, "");
-
- }
- return 20;
-}
-
-static int node_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- bNodeSocket *sock= node->outputs.first; /* first socket stores value */
- if(sock) {
- /* enforce square box drawing */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- uiDefButF(block, HSVCUBE, B_NODE_EXEC+node->nr, "",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12,
- sock->ns.vec, 0.0f, 1.0f, 3, 0, "");
- uiDefButF(block, HSVCUBE, B_NODE_EXEC+node->nr, "",
- butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15,
- sock->ns.vec, 0.0f, 1.0f, 2, 0, "");
- uiDefButF(block, COL, B_NOP, "",
- butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12,
- sock->ns.vec, 0.0, 0.0, -1, 0, "");
- /* the -1 above prevents col button to popup a color picker */
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- }
- return 30 + (int)(node->width-NODE_DY);
-}
-
-static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
- int a_but= (ntree->type==NTREE_COMPOSIT);
-
- /* blend type */
- uiBlockBeginAlign(block);
- bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Overlay %x9|Divide %x5|Difference %x6|Darken %x7|Lighten %x8|Dodge %x10|Burn %x11|Color %x15|Value %x14|Saturation %x13|Hue %x12",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin -(a_but?20:0), 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_but_title_cb, node, bt);
- /* Alpha option, composite */
- if(a_but)
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "A",
- butr->xmax-20, butr->ymin, 20, 20,
- &node->custom2, 0, 0, 0, 0, "Include Alpha of 2nd input in this operation");
- }
- return 20;
-}
-
-static int node_buts_time(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- CurveMapping *cumap= node->storage;
- short dx= (short)((butr->xmax-butr->xmin)/2);
- butr->ymin += 26;
-
- curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, butr);
-
- if(cumap) {
- cumap->flag |= CUMA_DRAW_CFRA;
- if(node->custom1<node->custom2)
- cumap->sample[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
- }
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Sta:",
- butr->xmin, butr->ymin-22, dx, 19,
- &node->custom1, 1.0, 20000.0, 0, 0, "Start frame");
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "End:",
- butr->xmin+dx, butr->ymin-22, dx, 19,
- &node->custom2, 1.0, 20000.0, 0, 0, "End frame");
- }
-
- return node->width-NODE_DY;
-}
-
-static int node_buts_valtorgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- if(node->storage) {
- draw_colorband_buts_small(block, node->storage, butr, B_NODE_EXEC+node->nr);
- }
- }
- return 40;
-}
-
-static int node_buts_curvevec(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- curvemap_buttons(block, node->storage, 'v', B_NODE_EXEC+node->nr, B_REDR, butr);
- }
- return (int)(node->width-NODE_DY);
-}
-
-static float *_sample_col= NULL; // bad bad, 2.5 will do better?
-void node_curvemap_sample(float *col)
-{
- _sample_col= col;
-}
-
-static int node_buts_curvecol(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- CurveMapping *cumap= node->storage;
- if(_sample_col) {
- cumap->flag |= CUMA_DRAW_SAMPLE;
- VECCOPY(cumap->sample, _sample_col);
- }
- else
- cumap->flag &= ~CUMA_DRAW_SAMPLE;
-
- curvemap_buttons(block, node->storage, 'c', B_NODE_EXEC+node->nr, B_REDR, butr);
- }
- return (int)(node->width-NODE_DY);
-}
-
-static int node_buts_normal(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- bNodeSocket *sock= node->outputs.first; /* first socket stores normal */
-
- uiDefButF(block, BUT_NORMAL, B_NODE_EXEC+node->nr, "",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, butr->ymax-butr->ymin,
- sock->ns.vec, 0.0f, 1.0f, 0, 0, "");
-
- }
- return (int)(node->width-NODE_DY);
-}
-
-static void node_browse_tex_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
- Tex *tex;
-
- if(node->menunr<1) return;
-
- if(node->id) {
- node->id->us--;
- node->id= NULL;
- }
- tex= BLI_findlink(&G.main->tex, node->menunr-1);
-
- node->id= &tex->id;
- id_us_plus(node->id);
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- nodeSetActive(ntree, node);
-
- if( ntree->type == NTREE_TEXTURE )
- ntreeTexCheckCyclics( ntree );
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- NodeTagChanged(ntree, node);
-
- node->menunr= 0;
-}
-
-static void node_dynamic_update_cb(void *ntree_v, void *node_v)
-{
- Material *ma;
- bNode *node= (bNode *)node_v;
- ID *id= node->id;
- int error= 0;
-
- if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) error= 1;
-
- /* Users only have to press the "update" button in one pynode
- * and we also update all others sharing the same script */
- for (ma= G.main->mat.first; ma; ma= ma->id.next) {
- if (ma->nodetree) {
- bNode *nd;
- for (nd= ma->nodetree->nodes.first; nd; nd= nd->next) {
- if ((nd->type == NODE_DYNAMIC) && (nd->id == id)) {
- nd->custom1= 0;
- nd->custom1= BSET(nd->custom1, NODE_DYNAMIC_REPARSE);
- nd->menunr= 0;
- if (error)
- nd->custom1= BSET(nd->custom1, NODE_DYNAMIC_ERROR);
- }
- }
- }
- }
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- BIF_preview_changed(ID_MA);
-}
-
-static int node_buts_texture(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- short multi = (node->id && ((Tex*)node->id)->use_nodes && (node->type != CMP_NODE_TEXTURE));
-
- if(block) {
- uiBut *bt;
- char *strp;
- short width = (short)(butr->xmax - butr->xmin);
-
- /* browse button texture */
- uiBlockBeginAlign(block);
- IDnames_to_pupstring(&strp, NULL, "", &(G.main->tex), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp,
- butr->xmin, butr->ymin+(multi?30:0), 20, 19,
- &node->menunr, 0, 0, 0, 0, "Browse texture");
- uiButSetFunc(bt, node_browse_tex_cb, ntree, node);
- if(strp) MEM_freeN(strp);
-
- if(node->id) {
- bt= uiDefBut(block, TEX, B_NOP, "TE:",
- butr->xmin+19, butr->ymin+(multi?30:0), butr->xmax-butr->xmin-19, 19,
- node->id->name+2, 0.0, 19.0, 0, 0, "Texture name");
- uiButSetFunc(bt, node_ID_title_cb, node, NULL);
- }
- uiBlockEndAlign(block);
-
- if(multi) {
- char *menustr = ntreeTexOutputMenu(((Tex*)node->id)->nodetree);
- uiDefButS(block, MENU, B_MATPRV, menustr, butr->xmin, butr->ymin, width, 19, &node->custom1, 0, 0, 0, 0, "Which output to use, for multi-output textures");
- free(menustr);
- return 50;
- }
- return 20;
- }
- else return multi? 50: 20;
-}
-
-static int node_buts_math(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
-
- bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Multiply %x2|Divide %x3|Sine %x4|Cosine %x5|Tangent %x6|Arcsine %x7|Arccosine %x8|Arctangent %x9|Power %x10|Logarithm %x11|Minimum %x12|Maximum %x13|Round %x14|Less Than %x15|Greater Than %x16", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_but_title_cb, node, bt);
- }
- return 20;
-}
-
-
-/* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */
-
-static void node_browse_text_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
- ID *oldid;
-
- if(node->menunr<1) return;
-
- if(node->id) {
- node->id->us--;
- }
- oldid= node->id;
- node->id= BLI_findlink(&G.main->text, node->menunr-1);
- id_us_plus(node->id);
- BLI_strncpy(node->name, node->id->name+2, 21); /* huh? why 21? */
-
- node->custom1= BSET(node->custom1, NODE_DYNAMIC_NEW);
-
- nodeSetActive(ntree, node);
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
-
- node->menunr= 0;
-}
-
-static void node_mat_alone_cb(void *node_v, void *unused)
-{
- bNode *node= node_v;
-
- node->id= (ID *)copy_material((Material *)node->id);
-
- BIF_undo_push("Single user material");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-static void node_browse_mat_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
-
- if(node->menunr<1) return;
-
- if(node->menunr==32767) { /* code for Add New */
- if(node->id) {
- /* make copy, but make sure it doesnt have the node tag nor nodes */
- Material *ma= (Material *)node->id;
- ma->id.us--;
- ma= copy_material(ma);
- ma->use_nodes= 0;
- if(ma->nodetree) {
- ntreeFreeTree(ma->nodetree);
- MEM_freeN(ma->nodetree);
- }
- ma->nodetree= NULL;
- node->id= (ID *)ma;
- }
- else node->id= (ID *)add_material("MatNode");
- }
- else {
- if(node->id) node->id->us--;
- node->id= BLI_findlink(&G.main->mat, node->menunr-1);
- id_us_plus(node->id);
- }
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- nodeSetActive(ntree, node);
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- BIF_preview_changed(ID_MA);
-
- node->menunr= 0;
-}
-
-static void node_new_mat_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
-
- node->id= (ID *)add_material("MatNode");
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- nodeSetActive(ntree, node);
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- BIF_preview_changed(ID_MA);
-
-}
-
-static void node_texmap_cb(void *texmap_v, void *unused_v)
-{
- init_mapping(texmap_v);
-}
-
-static int node_shader_buts_material(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
- short dx= (short)((butr->xmax-butr->xmin)/3.0f), has_us= (node->id && node->id->us>1);
- short dy= (short)butr->ymin;
- char *strp;
-
- /* WATCH IT: we use this callback in material buttons, but then only want first row */
- if(butr->ymax-butr->ymin > 21.0f) dy+= 19;
-
- uiBlockBeginAlign(block);
- if(node->id==NULL) uiBlockSetCol(block, TH_REDALERT);
- else if(has_us) uiBlockSetCol(block, TH_BUT_SETTING1);
- else uiBlockSetCol(block, TH_BUT_SETTING2);
-
- /* browse button */
- IDnames_to_pupstring(&strp, NULL, "ADD NEW %x32767", &(G.main->mat), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NOP, strp,
- butr->xmin, dy, 19, 19,
- &node->menunr, 0, 0, 0, 0, "Browses existing choices or adds NEW");
- uiButSetFunc(bt, node_browse_mat_cb, ntree, node);
- if(strp) MEM_freeN(strp);
-
- /* Add New button */
- if(node->id==NULL) {
- bt= uiDefBut(block, BUT, B_NOP, "Add New",
- butr->xmin+19, dy, (short)(butr->xmax-butr->xmin-19.0f), 19,
- NULL, 0.0, 0.0, 0, 0, "Add new Material");
- uiButSetFunc(bt, node_new_mat_cb, ntree, node);
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- /* name button */
- short width= (short)(butr->xmax-butr->xmin-19.0f - (has_us?19.0f:0.0f));
- bt= uiDefBut(block, TEX, B_NOP, "MA:",
- butr->xmin+19, dy, width, 19,
- node->id->name+2, 0.0, 19.0, 0, 0, "Material name");
- uiButSetFunc(bt, node_ID_title_cb, node, NULL);
-
- /* user amount */
- if(has_us) {
- char str1[32];
- sprintf(str1, "%d", node->id->us);
- bt= uiDefBut(block, BUT, B_NOP, str1,
- butr->xmax-19, dy, 19, 19,
- NULL, 0, 0, 0, 0, "Displays number of users. Click to make a single-user copy.");
- uiButSetFunc(bt, node_mat_alone_cb, node, NULL);
- }
-
- /* WATCH IT: we use this callback in material buttons, but then only want first row */
- if(butr->ymax-butr->ymin > 21.0f) {
- /* node options */
- uiBlockSetCol(block, TH_AUTO);
- uiDefButBitS(block, TOG, SH_NODE_MAT_DIFF, B_NODE_EXEC+node->nr, "Diff",
- butr->xmin, butr->ymin, dx, 19,
- &node->custom1, 0, 0, 0, 0, "Material Node outputs Diffuse");
- uiDefButBitS(block, TOG, SH_NODE_MAT_SPEC, B_NODE_EXEC+node->nr, "Spec",
- butr->xmin+dx, butr->ymin, dx, 19,
- &node->custom1, 0, 0, 0, 0, "Material Node outputs Specular");
- uiDefButBitS(block, TOG, SH_NODE_MAT_NEG, B_NODE_EXEC+node->nr, "Neg Normal",
- butr->xmax-dx, butr->ymin, dx, 19,
- &node->custom1, 0, 0, 0, 0, "Material Node uses inverted Normal");
- }
- }
- uiBlockEndAlign(block);
- }
- return 38;
-}
-
-static int node_shader_buts_mapping(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- TexMapping *texmap= node->storage;
- short dx= (short)((butr->xmax-butr->xmin)/7.0f);
- short dy= (short)(butr->ymax-19);
-
- uiBlockSetFunc(block, node_texmap_cb, texmap, NULL); /* all buttons get this */
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->loc, -1000.0f, 1000.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->loc+1, -1000.0f, 1000.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->loc+2, -1000.0f, 1000.0f, 10, 2, "");
- dy-= 19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->rot, -1000.0f, 1000.0f, 1000, 1, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->rot+1, -1000.0f, 1000.0f, 1000, 1, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->rot+2, -1000.0f, 1000.0f, 1000, 1, "");
- dy-= 19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->size, -1000.0f, 1000.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->size+1, -1000.0f, 1000.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->size+2, -1000.0f, 1000.0f, 10, 2, "");
- dy-= 25;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->min, -10.0f, 10.0f, 100, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->min+1, -10.0f, 10.0f, 100, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->min+2, -10.0f, 10.0f, 100, 2, "");
- dy-= 19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->max, -10.0f, 10.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->max+1, -10.0f, 10.0f, 10, 2, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->max+2, -10.0f, 10.0f, 10, 2, "");
- uiBlockEndAlign(block);
-
- /* labels/options */
-
- dy= (short)(butr->ymax-19);
- uiDefBut(block, LABEL, B_NOP, "Loc", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, "");
- dy-= 19;
- uiDefBut(block, LABEL, B_NOP, "Rot", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, "");
- dy-= 19;
- uiDefBut(block, LABEL, B_NOP, "Size", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, "");
- dy-= 25;
- uiDefButBitI(block, TOG, TEXMAP_CLIP_MIN, B_NODE_EXEC+node->nr, "Min", butr->xmin, dy, dx-4, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
- dy-= 19;
- uiDefButBitI(block, TOG, TEXMAP_CLIP_MAX, B_NODE_EXEC+node->nr, "Max", butr->xmin, dy, dx-4, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
-
- }
- return 5*19 + 6;
-}
-
-static int node_shader_buts_vect_math(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
-
- bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Average %x2|Dot Product %x3 |Cross Product %x4|Normalize %x5", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_but_title_cb, node, bt);
- }
- return 20;
-}
-
-static int node_shader_buts_geometry(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *but;
- NodeGeometry *ngeo= (NodeGeometry*)node->storage;
-
- if(!verify_valid_uv_name(ngeo->uvname))
- uiBlockSetCol(block, TH_REDALERT);
- but= uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "UV:", butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20, ngeo->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer");
- uiButSetCompleteFunc(but, autocomplete_uv, NULL);
- uiBlockSetCol(block, TH_AUTO);
-
- if(!verify_valid_vcol_name(ngeo->colname))
- uiBlockSetCol(block, TH_REDALERT);
- but= uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "Col:", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, ngeo->colname, 0, 31, 0, 0, "Set name of vertex color layer to use, default is active vertex color layer");
- uiButSetCompleteFunc(but, autocomplete_vcol, NULL);
- uiBlockSetCol(block, TH_AUTO);
- }
-
- return 40;
-}
-
-static int node_shader_buts_dynamic(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if (block) {
- uiBut *bt;
- SpaceNode *snode= curarea->spacedata.first;
- short dy= (short)butr->ymin;
- int xoff=0;
-
- /* B_NODE_EXEC is handled in butspace.c do_node_buts */
- if(!node->id) {
- char *strp;
- IDnames_to_pupstring(&strp, NULL, "", &(G.main->text), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NODE_EXEC/*+node->nr*/, strp,
- butr->xmin, dy, 19, 19,
- &node->menunr, 0, 0, 0, 0, "Browses existing choices");
- uiButSetFunc(bt, node_browse_text_cb, ntree, node);
- xoff=19;
- if(strp) MEM_freeN(strp);
- }
- else {
- bt = uiDefBut(block, BUT, B_NOP, "Update",
- butr->xmin+xoff, butr->ymin+20, 50, 19,
- &node->menunr, 0.0, 19.0, 0, 0, "Refresh this node (and all others that use the same script)");
- uiButSetFunc(bt, node_dynamic_update_cb, ntree, node);
-
- if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) {
- BIF_ThemeColor(TH_REDALERT);
- ui_rasterpos_safe(butr->xmin + xoff, butr->ymin + 5, snode->aspect);
- snode_drawstring(snode, "Error! Check console...", butr->xmax - butr->xmin);
- }
- }
- }
- return 20+19;
-}
-
-/* only once called */
-static void node_shader_set_butfunc(bNodeType *ntype)
-{
- switch(ntype->type) {
- /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
-
- case SH_NODE_MATERIAL:
- case SH_NODE_MATERIAL_EXT:
- ntype->butfunc= node_shader_buts_material;
- break;
- case SH_NODE_TEXTURE:
- ntype->butfunc= node_buts_texture;
- break;
- case SH_NODE_NORMAL:
- ntype->butfunc= node_buts_normal;
- break;
- case SH_NODE_CURVE_VEC:
- ntype->butfunc= node_buts_curvevec;
- break;
- case SH_NODE_CURVE_RGB:
- ntype->butfunc= node_buts_curvecol;
- break;
- case SH_NODE_MAPPING:
- ntype->butfunc= node_shader_buts_mapping;
- break;
- case SH_NODE_VALUE:
- ntype->butfunc= node_buts_value;
- break;
- case SH_NODE_RGB:
- ntype->butfunc= node_buts_rgb;
- break;
- case SH_NODE_MIX_RGB:
- ntype->butfunc= node_buts_mix_rgb;
- break;
- case SH_NODE_VALTORGB:
- ntype->butfunc= node_buts_valtorgb;
- break;
- case SH_NODE_MATH:
- ntype->butfunc= node_buts_math;
- break;
- case SH_NODE_VECT_MATH:
- ntype->butfunc= node_shader_buts_vect_math;
- break;
- case SH_NODE_GEOMETRY:
- ntype->butfunc= node_shader_buts_geometry;
- break;
- case NODE_DYNAMIC:
- ntype->butfunc= node_shader_buts_dynamic;
- break;
- default:
- ntype->butfunc= NULL;
- }
-}
-
-/* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */
-
-
-
-static void node_browse_image_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
-
- nodeSetActive(ntree, node);
-
- if(node->menunr<1) return;
- if(node->menunr==32767) { /* code for Load New */
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_LOADIMAGE);
- }
- else {
- if(node->id) node->id->us--;
- node->id= BLI_findlink(&G.main->image, node->menunr-1);
- id_us_plus(node->id);
-
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- NodeTagChanged(ntree, node);
- BKE_image_signal((Image *)node->id, node->storage, IMA_SIGNAL_USER_NEW_IMAGE);
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+node->nr);
- }
- node->menunr= 0;
-}
-
-static void node_active_cb(void *ntree_v, void *node_v)
-{
- nodeSetActive(ntree_v, node_v);
-}
-static void node_image_type_cb(void *node_v, void *unused)
-{
-
- allqueue(REDRAWNODE, 1);
-}
-
-static char *node_image_type_pup(void)
-{
- char *str= MEM_mallocN(256, "image type pup");
- int a;
-
- str[0]= 0;
-
- a= sprintf(str, "Image Type %%t|");
- a+= sprintf(str+a, " Image %%x%d %%i%d|", IMA_SRC_FILE, ICON_IMAGE_DEHLT);
- a+= sprintf(str+a, " Movie %%x%d %%i%d|", IMA_SRC_MOVIE, ICON_SEQUENCE);
- a+= sprintf(str+a, " Sequence %%x%d %%i%d|", IMA_SRC_SEQUENCE, ICON_IMAGE_COL);
- a+= sprintf(str+a, " Generated %%x%d %%i%d", IMA_SRC_GENERATED, ICON_BLANK1);
-
- return str;
-}
-
-/* copy from buttons_shading.c */
-static char *layer_menu(RenderResult *rr)
-{
- RenderLayer *rl;
- int len= 40 + 40*BLI_countlist(&rr->layers);
- short a, nr;
- char *str= MEM_callocN(len, "menu layers");
-
- strcpy(str, "Layer %t");
- a= strlen(str);
- for(nr=0, rl= rr->layers.first; rl; rl= rl->next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", rl->name, nr);
- }
-
- return str;
-}
-
-static void image_layer_cb(void *ima_v, void *iuser_v)
-{
-
- ntreeCompositForceHidden(G.scene->nodetree);
- BKE_image_multilayer_index(ima_v, iuser_v);
- allqueue(REDRAWNODE, 0);
-}
-
-static int node_composit_buts_image(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- ImageUser *iuser= node->storage;
-
- if(block) {
- uiBut *bt;
- short dy= (short)butr->ymax-19;
- char *strp;
-
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING2);
-
- /* browse button */
- IMAnames_to_pupstring(&strp, NULL, "LOAD NEW %x32767", &(G.main->image), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NOP, strp,
- butr->xmin, dy, 19, 19,
- &node->menunr, 0, 0, 0, 0, "Browses existing choices");
- uiButSetFunc(bt, node_browse_image_cb, ntree, node);
- if(strp) MEM_freeN(strp);
-
- /* Add New button */
- if(node->id==NULL) {
- bt= uiDefBut(block, BUT, B_NODE_LOADIMAGE, "Load New",
- butr->xmin+19, dy, (short)(butr->xmax-butr->xmin-19.0f), 19,
- NULL, 0.0, 0.0, 0, 0, "Add new Image");
- uiButSetFunc(bt, node_active_cb, ntree, node);
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- /* name button + type */
- Image *ima= (Image *)node->id;
- short xmin= (short)butr->xmin, xmax= (short)butr->xmax;
- short width= xmax - xmin - 45;
- short icon= ICON_IMAGE_DEHLT;
-
- if(ima->source==IMA_SRC_MOVIE) icon= ICON_SEQUENCE;
- else if(ima->source==IMA_SRC_SEQUENCE) icon= ICON_IMAGE_COL;
- else if(ima->source==IMA_SRC_GENERATED) icon= ICON_BLANK1;
-
- bt= uiDefBut(block, TEX, B_NOP, "IM:",
- xmin+19, dy, width, 19,
- node->id->name+2, 0.0, 19.0, 0, 0, "Image name");
- uiButSetFunc(bt, node_ID_title_cb, node, NULL);
-
- /* buffer type option */
- strp= node_image_type_pup();
- bt= uiDefIconTextButS(block, MENU, B_NOP, icon, strp,
- xmax-26, dy, 26, 19,
- &ima->source, 0.0, 19.0, 0, 0, "Image type");
- uiButSetFunc(bt, node_image_type_cb, node, ima);
- MEM_freeN(strp);
-
- if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE) ) {
- width= (xmax-xmin)/2;
-
- dy-= 19;
- uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "Frs:",
- xmin, dy, width, 19,
- &iuser->frames, 1.0, MAXFRAMEF, 0, 0, "Amount of images used in animation");
- uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "SFra:",
- xmin+width, dy, width, 19,
- &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Start frame of animation");
- dy-= 19;
- uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "Offs:",
- xmin, dy, width, 19,
- &iuser->offset, -MAXFRAMEF, MAXFRAMEF, 0, 0, "Offsets the number of the frame to use in the animation");
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Cycl",
- xmin+width, dy, width-20, 19,
- &iuser->cycl, 0.0, 0.0, 0, 0, "Make animation go cyclic");
- uiDefIconButBitS(block, TOG, IMA_ANIM_ALWAYS, B_NODE_EXEC+node->nr, ICON_AUTO,
- xmax-20, dy, 20, 19,
- &iuser->flag, 0.0, 0.0, 0, 0, "Always refresh Image on frame changes");
- }
- if( ima->type==IMA_TYPE_MULTILAYER && ima->rr) {
- RenderLayer *rl= BLI_findlink(&ima->rr->layers, iuser->layer);
- if(rl) {
- width= (xmax-xmin);
- dy-= 19;
- strp= layer_menu(ima->rr);
- bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp,
- xmin, dy, width, 19,
- &iuser->layer, 0.0, 10000.0, 0, 0, "Layer");
- uiButSetFunc(bt, image_layer_cb, ima->rr, node->storage);
- MEM_freeN(strp);
- }
- }
- }
-
- }
- if(node->id) {
- Image *ima= (Image *)node->id;
- int retval= 19;
-
- /* for each draw we test for anim refresh event */
- if(iuser->flag & IMA_ANIM_REFRESHED) {
- iuser->flag &= ~IMA_ANIM_REFRESHED;
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+node->nr);
- }
-
- if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE) )
- retval+= 38;
- if( ima->type==IMA_TYPE_MULTILAYER)
- retval+= 19;
- return retval;
- }
- else
- return 19;
-}
-
-/* if we use render layers from other scene, we make a nice title */
-static void set_render_layers_title(void *node_v, void *unused)
-{
- bNode *node= node_v;
- Scene *sce;
- SceneRenderLayer *srl;
- char str[64];
-
- if(node->id) {
- BLI_strncpy(str, node->id->name+2, 21);
- strcat(str, "|");
- sce= (Scene *)node->id;
- }
- else {
- str[0]= 0;
- sce= G.scene;
- }
- srl= BLI_findlink(&sce->r.layers, node->custom1);
- if(srl==NULL) {
- node->custom1= 0;
- srl= sce->r.layers.first;
- }
-
- strcat(str, srl->name);
- BLI_strncpy(node->name, str, 32);
-}
-
-static char *scene_layer_menu(Scene *sce)
-{
- SceneRenderLayer *srl;
- int len= 40 + 40*BLI_countlist(&sce->r.layers);
- short a, nr;
- char *str= MEM_callocN(len, "menu layers");
-
- strcpy(str, "Active Layer %t");
- a= strlen(str);
- for(nr=0, srl= sce->r.layers.first; srl; srl= srl->next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", srl->name, nr);
- }
-
- return str;
-}
-
-static void node_browse_scene_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
- Scene *sce;
-
- if(node->menunr<1) return;
-
- if(node->id) {
- node->id->us--;
- node->id= NULL;
- }
- sce= BLI_findlink(&G.main->scene, node->menunr-1);
- if(sce!=G.scene) {
- node->id= &sce->id;
- id_us_plus(node->id);
- }
-
- set_render_layers_title(node, NULL);
- nodeSetActive(ntree, node);
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- NodeTagChanged(ntree, node);
-
- node->menunr= 0;
-}
-
-
-static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
- char *strp;
-
- /* browse button scene */
- uiBlockBeginAlign(block);
- IDnames_to_pupstring(&strp, NULL, "", &(G.main->scene), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NOP, strp,
- butr->xmin, butr->ymin, 20, 19,
- &node->menunr, 0, 0, 0, 0, "Browse Scene to use RenderLayer from");
- uiButSetFunc(bt, node_browse_scene_cb, ntree, node);
- if(strp) MEM_freeN(strp);
-
- /* browse button layer */
- strp= scene_layer_menu(node->id?(Scene *)node->id:G.scene);
- if(node->id)
- bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC+node->nr, ICON_SCENE_DEHLT, strp,
- butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19,
- &node->custom1, 0, 0, 0, 0, "Choose Render Layer");
- else
- bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp,
- butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19,
- &node->custom1, 0, 0, 0, 0, "Choose Render Layer");
- uiButSetFunc(bt, set_render_layers_title, node, NULL);
- MEM_freeN(strp);
-
- /* re-render */
- /* uses custom2, not the best implementation of the world... but we need it to work now :) */
- bt= uiDefIconButS(block, TOG, B_NODE_EXEC+node->nr, ICON_SCENE,
- butr->xmax-20, butr->ymin, 20, 19,
- &node->custom2, 0, 0, 0, 0, "Re-render this Layer");
-
- }
- return 19;
-}
-
-static void node_blur_relative_cb(void *node, void *poin2)
-{
- bNode *nodev= node;
- NodeBlurData *nbd= nodev->storage;
- if(nbd->image_in_width != 0){
- if(nbd->relative){ /* convert absolute values to relative */
- nbd->percentx= (float)(nbd->sizex)/nbd->image_in_width;
- nbd->percenty= (float)(nbd->sizey)/nbd->image_in_height;
- }else{ /* convert relative values to absolute */
- nbd->sizex= (int)(nbd->percentx*nbd->image_in_width);
- nbd->sizey= (int)(nbd->percenty*nbd->image_in_height);
- }
- }
- allqueue(REDRAWNODE, 0);
-}
-static void node_blur_update_sizex_cb(void *node, void *poin2)
-{
- bNode *nodev= node;
- NodeBlurData *nbd= nodev->storage;
-
- nbd->sizex= (int)(nbd->percentx*nbd->image_in_width);
-}
-static void node_blur_update_sizey_cb(void *node, void *poin2)
-{
- bNode *nodev= node;
- NodeBlurData *nbd= nodev->storage;
-
- nbd->sizey= (int)(nbd->percenty*nbd->image_in_height);
-}
-static int node_composit_buts_blur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeBlurData *nbd= node->storage;
- uiBut *bt;
- short dy= butr->ymin+58;
- short dx= (butr->xmax-butr->xmin)/2;
- char str[256];
-
- uiBlockBeginAlign(block);
- sprintf(str, "Filter Type%%t|Flat %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|Fast Gauss%%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_FAST_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH);
- uiDefButS(block, MENU, B_NODE_EXEC+node->nr,str,
- butr->xmin, dy, dx*2, 19,
- &nbd->filtertype, 0, 0, 0, 0, "Set sampling filter for blur");
- dy-=19;
- if (nbd->filtertype != R_FILTER_FAST_GAUSS) {
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Bokeh",
- butr->xmin, dy, dx, 19,
- &nbd->bokeh, 0, 0, 0, 0, "Uses circular filter, warning it's slow!");
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Gamma",
- butr->xmin+dx, dy, dx, 19,
- &nbd->gamma, 0, 0, 0, 0, "Applies filter on gamma corrected values");
- } else {
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- }
- dy-=19;
- bt= uiDefButS(block, TOG, B_NOP, "Relative",
- butr->xmin, dy, dx*2, 19,
- &nbd->relative, 0, 0, 0, 0, "Use relative (percent) values to define blur radius");
- uiButSetFunc(bt, node_blur_relative_cb, node, NULL);
-
- dy-=19;
- if(nbd->relative) {
- bt= uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "X:",
- butr->xmin, dy, dx, 19,
- &nbd->percentx, 0.0f, 1.0f, 0, 0, "");
- uiButSetFunc(bt, node_blur_update_sizex_cb, node, NULL);
- bt= uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Y:",
- butr->xmin+dx, dy, dx, 19,
- &nbd->percenty, 0.0f, 1.0f, 0, 0, "");
- uiButSetFunc(bt, node_blur_update_sizey_cb, node, NULL);
- }
- else {
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X:",
- butr->xmin, dy, dx, 19,
- &nbd->sizex, 0, 256, 0, 0, "");
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y:",
- butr->xmin+dx, dy, dx, 19,
- &nbd->sizey, 0, 256, 0, 0, "");
- }
- uiBlockEndAlign(block);
- }
- return 77;
-}
-
-static int node_composit_buts_dblur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeDBlurData *ndbd = node->storage;
- short dy = butr->ymin + 171;
- short dx = butr->xmax - butr->xmin;
- short halfdx= (short)dx/2;
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Iterations:",
- butr->xmin, dy, dx, 19,
- &ndbd->iter, 1, 32, 10, 0, "Amount of iterations");
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Wrap",
- butr->xmin, dy-= 19, dx, 19,
- &ndbd->wrap, 0, 0, 0, 0, "Wrap blur");
- uiBlockEndAlign(block);
-
- dy-= 9;
-
- uiDefBut(block, LABEL, B_NOP, "Center", butr->xmin, dy-= 19, dx, 19, NULL, 0.0f, 0.0f, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "X:",
- butr->xmin, dy-= 19, halfdx, 19,
- &ndbd->center_x, 0.0f, 1.0f, 10, 0, "X center in percents");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Y:",
- butr->xmin+halfdx, dy, halfdx, 19,
- &ndbd->center_y, 0.0f, 1.0f, 10, 0, "Y center in percents");
- uiBlockEndAlign(block);
-
- dy-= 9;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Distance:",
- butr->xmin, dy-= 19, dx, 19,
- &ndbd->distance, -1.0f, 1.0f, 10, 0, "Amount of which the image moves");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Angle:",
- butr->xmin, dy-= 19, dx, 19,
- &ndbd->angle, 0.0f, 360.0f, 1000, 0, "Angle in which the image will be moved");
- uiBlockEndAlign(block);
-
- dy-= 9;
-
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Spin:",
- butr->xmin, dy-= 19, dx, 19,
- &ndbd->spin, -360.0f, 360.0f, 1000, 0, "Angle that is used to spin the image");
-
- dy-= 9;
-
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Zoom:",
- butr->xmin, dy-= 19, dx, 19,
- &ndbd->zoom, 0.0f, 100.0f, 100, 0, "Amount of which the image is zoomed");
-
- }
- return 190;
-}
-
-static int node_composit_buts_bilateralblur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeBilateralBlurData *nbbd= node->storage;
- short dy= butr->ymin+38;
- short dx= (butr->xmax-butr->xmin);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Iterations:",
- butr->xmin, dy, dx, 19,
- &nbbd->iter, 1, 128, 0, 0, "Amount of iterations");
- dy-=19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Color Sigma:",
- butr->xmin, dy, dx, 19,
- &nbbd->sigma_color,0.01, 3, 10, 0, "Sigma value used to modify color");
- dy-=19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Space Sigma:",
- butr->xmin, dy, dx, 19,
- &nbbd->sigma_space ,0.01, 30, 10, 0, "Sigma value used to modify space");
-
- }
- return 57;
-}
-
-/* qdn: defocus node */
-static int node_composit_buts_defocus(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeDefocus *nqd = node->storage;
- short dy = butr->ymin + 209;
- short dx = butr->xmax - butr->xmin;
- char* mstr1 = "Bokeh Type%t|Octagon %x8|Heptagon %x7|Hexagon %x6|Pentagon %x5|Square %x4|Triangle %x3|Disk %x0";
-
- uiDefBut(block, LABEL, B_NOP, "Bokeh Type", butr->xmin, dy, dx, 19, NULL, 0, 0, 0, 0, "");
- uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mstr1,
- butr->xmin, dy-19, dx, 19,
- &nqd->bktype, 0, 0, 0, 0, "Bokeh type");
- if (nqd->bktype) { /* for some reason rotating a disk doesn't seem to work... ;) */
- uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Rotate:",
- butr->xmin, dy-38, dx, 19,
- &nqd->rotation, 0, 90, 0, 0, "Bokeh shape rotation offset in degrees");
- }
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Gamma Correct",
- butr->xmin, dy-57, dx, 19,
- &nqd->gamco, 0, 0, 0, 0, "Enable gamma correction before and after main process");
- if (nqd->no_zbuf==0) {
- // only needed for zbuffer input
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "fStop:",
- butr->xmin, dy-76, dx, 19,
- &nqd->fstop, 0.5, 128, 10, 0, "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius");
- }
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Maxblur:",
- butr->xmin, dy-95, dx, 19,
- &nqd->maxblur, 0, 10000, 1000, 0, "blur limit, maximum CoC radius, 0=no limit");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BThreshold:",
- butr->xmin, dy-114, dx, 19,
- &nqd->bthresh, 0, 100, 100, 0, "CoC radius threshold, prevents background bleed on in-focus midground, 0=off");
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Preview",
- butr->xmin, dy-142, dx, 19,
- &nqd->preview, 0, 0, 0, 0, "Enable sampling mode, useful for preview when using low samplecounts");
- if (nqd->preview) {
- /* only visible when sampling mode enabled */
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Samples:",
- butr->xmin, dy-161, dx, 19,
- &nqd->samples, 16, 256, 0, 0, "Number of samples (16=grainy, higher=less noise)");
- }
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "No zbuffer",
- butr->xmin, dy-190, dx, 19,
- &nqd->no_zbuf, 0, 0, 0, 0, "Enable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node)");
- if (nqd->no_zbuf) {
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Zscale:",
- butr->xmin, dy-209, dx, 19,
- &nqd->scale, 0, 1000, 100, 0, "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1");
- }
- }
- return 228;
-}
-
-
-/* qdn: glare node */
-static int node_composit_buts_glare(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeGlare *ndg = node->storage;
- short dy = butr->ymin + 152, dx = butr->xmax - butr->xmin;
- char* mn1 = "Type%t|Ghosts%x3|Streaks%x2|Fog Glow%x1|Simple Star%x0";
- char* mn2 = "Quality/Speed%t|High/Slow%x0|Medium/Medium%x1|Low/Fast%x2";
- uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mn1,
- butr->xmin, dy, dx, 19,
- &ndg->type, 0, 0, 0, 0, "Glow/Flare/Bloom type");
- uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mn2,
- butr->xmin, dy-19, dx, 19,
- &ndg->quality, 0, 0, 0, 0,
- "Quality speed trade off, if not set to high quality, effect will be applied to low-res copy of source image");
- if (ndg->type != 1) {
- uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Iterations:",
- butr->xmin, dy-38, dx, 19,
- &ndg->iter, 2, 5, 1, 0,
- "higher values will generate longer/more streaks/ghosts");
- if (ndg->type != 0)
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "ColMod:",
- butr->xmin, dy-57, dx, 19,
- &ndg->colmod, 0, 1, 10, 0,
- "Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect");
- }
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Mix:",
- butr->xmin, dy-76, dx, 19,
- &ndg->mix, -1, 1, 10, 0,
- "Mix balance, -1 is original image only, 0 is exact 50/50 mix, 1 is processed image only");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Threshold:",
- butr->xmin, dy-95, dx, 19,
- &ndg->threshold, 0, 1000, 10, 0,
- "Brightness threshold, the glarefilter will be applied only to pixels brighter than this value");
- if ((ndg->type == 2) || (ndg->type == 0))
- {
- if (ndg->type == 2) {
- uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "streaks:",
- butr->xmin, dy-114, dx, 19,
- &ndg->angle, 2, 16, 1000, 0,
- "Total number of streaks");
- uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "AngOfs:",
- butr->xmin, dy-133, dx, 19,
- &ndg->angle_ofs, 0, 180, 1000, 0,
- "Streak angle rotation offset in degrees");
- }
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Fade:",
- butr->xmin, dy-152, dx, 19,
- &ndg->fade, 0.75, 1, 5, 0,
- "Streak fade out factor");
- }
- if (ndg->type == 0)
- uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Rot45",
- butr->xmin, dy-114, dx, 19,
- &ndg->angle, 0, 0, 0, 0,
- "simple star filter, add 45 degree rotation offset");
- if ((ndg->type == 1) || (ndg->type > 3)) // PBGH and fog glow
- uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Size:",
- butr->xmin, dy-114, dx, 19,
- &ndg->size, 6, 9, 1000, 0,
- "glow/glare size (not actual size, relative to initial size of bright area of pixels)");
- }
- return 171;
-}
-
-/* qdn: tonemap node */
-static int node_composit_buts_tonemap(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeTonemap *ntm = node->storage;
- short dy = butr->ymin + 76, dx = butr->xmax - butr->xmin;
- char* mn = "Type%t|R/D Photoreceptor%x1|Rh Simple%x0";
-
- uiBlockBeginAlign(block);
- uiDefButI(block, MENU, B_NODE_EXEC+node->nr, mn,
- butr->xmin, dy, dx, 19,
- &ntm->type, 0, 0, 0, 0,
- "Tone mapping type");
- if (ntm->type == 0) {
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Key:",
- butr->xmin, dy-19, dx, 19,
- &ntm->key, 0, 1, 5, 0,
- "The value the average luminance is mapped to");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Offset:",
- butr->xmin, dy-38, dx, 19,
- &ntm->offset, 0.001, 10, 5, 0,
- "Tonemap offset, normally always 1, but can be used as an extra control to alter the brightness curve");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Gamma:",
- butr->xmin, dy-57, dx, 19,
- &ntm->gamma, 0.001, 3, 5, 0,
- "Gamma factor, if not used, set to 1");
- }
- else {
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Intensity:",
- butr->xmin, dy-19, dx, 19,
- &ntm->f, -8, 8, 10, 0, "if less than zero, darkens image, otherwise makes it brighter");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Contrast:",
- butr->xmin, dy-38, dx, 19,
- &ntm->m, 0, 1, 5, 0, "Set to 0 to use estimate from input image");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Adaptation:",
- butr->xmin, dy-57, dx, 19,
- &ntm->a, 0, 1, 5, 0, "if 0, global, if 1, based on pixel intensity");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "ColCorrect:",
- butr->xmin, dy-76, dx, 19,
- &ntm->c, 0, 1, 5, 0, "color correction, if 0, same for all channels, if 1, each independent");
- }
- uiBlockEndAlign(block);
- }
- return 95;
-}
-
-/* qdn: lens distortion node */
-static int node_composit_buts_lensdist(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeLensDist *nld = node->storage;
- short dy = butr->ymin + 19, dx = butr->xmax - butr->xmin;
- uiBlockBeginAlign(block);
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Projector",
- butr->xmin, dy, dx, 19,
- &nld->proj, 0, 0, 0, 0,
- "Enable/disable projector mode, effect is applied in horizontal direction only");
- if (!nld->proj) {
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Jitter",
- butr->xmin, dy-19, dx/2, 19,
- &nld->jit, 0, 0, 0, 0,
- "Enable/disable jittering, faster, but also noisier");
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Fit",
- butr->xmin+dx/2, dy-19, dx/2, 19,
- &nld->fit, 0, 0, 0, 0,
- "For positive distortion factor only, scale image such that black areas are not visible");
- }
- uiBlockEndAlign(block);
- }
- return 38;
-}
-
-
-static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeBlurData *nbd= node->storage;
- short dy= butr->ymin;
- short dx= (butr->xmax-butr->xmin);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Samples:",
- butr->xmin, dy+76, dx, 19,
- &nbd->samples, 1, 256, 0, 0, "Amount of samples");
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "MinSpeed:",
- butr->xmin, dy+57, dx, 19,
- &nbd->minspeed, 0, 1024, 0, 0, "Minimum speed for a pixel to be blurred, used to separate background from foreground");
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "MaxSpeed:",
- butr->xmin, dy+38, dx, 19,
- &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BlurFac:",
- butr->xmin, dy+19, dx, 19,
- &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames");
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Curved",
- butr->xmin, dy, dx, 19,
- &nbd->curved, 0.0f, 2.0f, 10, 2, "Interpolate between frames in a bezier curve, rather than linearly");
- uiBlockEndAlign(block);
- }
- return 95;
-}
-
-static int node_composit_buts_filter(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
-
- /* blend type */
- bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Soften %x0|Sharpen %x1|Laplace %x2|Sobel %x3|Prewitt %x4|Kirsch %x5|Shadow %x6",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_but_title_cb, node, bt);
- }
- return 20;
-}
-
-static int node_composit_buts_flip(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
-
- /* flip x\y */
- bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Flip X %x0|Flip Y %x1|Flip X & Y %x2",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_but_title_cb, node, bt);
- }
- return 20;
-}
-
-static int node_composit_buts_crop(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeTwoXYs *ntxy= node->storage;
- char elementheight = 19;
- short dx= (butr->xmax-butr->xmin)/2;
- short dy= butr->ymax - elementheight;
- short xymin= 0, xymax= 10000;
-
- uiBlockBeginAlign(block);
-
- /* crop image size toggle */
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Crop Image Size",
- butr->xmin, dy, dx*2, elementheight,
- &node->custom1, 0, 0, 0, 0, "Crop the size of the input image.");
-
- dy-=elementheight;
-
- /* x1 */
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X1:",
- butr->xmin, dy, dx, elementheight,
- &ntxy->x1, xymin, xymax, 0, 0, "");
- /* y1 */
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y1:",
- butr->xmin+dx, dy, dx, elementheight,
- &ntxy->y1, xymin, xymax, 0, 0, "");
-
- dy-=elementheight;
-
- /* x2 */
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X2:",
- butr->xmin, dy, dx, elementheight,
- &ntxy->x2, xymin, xymax, 0, 0, "");
- /* y2 */
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y2:",
- butr->xmin+dx, dy, dx, elementheight,
- &ntxy->y2, xymin, xymax, 0, 0, "");
-
- uiBlockEndAlign(block);
- }
- return 60;
-}
-
-static int node_composit_buts_splitviewer(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBlockBeginAlign(block);
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "X",
- butr->xmin, butr->ymin+19, (butr->xmax-butr->xmin)/2, 20,
- &node->custom2, 0.0, 0.0, 0, 0, "");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Y",
- butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin+19, (butr->xmax-butr->xmin)/2, 20,
- &node->custom2, 0.0, 1.0, 0, 0, "");
-
- uiDefButS(block, NUMSLI, B_NODE_EXEC+node->nr, "Split %: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 100, 10, 0, "");
- }
- return 40;
-}
-
-static int node_composit_buts_map_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- TexMapping *texmap= node->storage;
- short xstart= (short)butr->xmin;
- short dy= (short)(butr->ymax-19.0f);
- short dx= (short)(butr->xmax-butr->xmin)/2;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Offs:", xstart, dy, 2*dx, 19, texmap->loc, -1000.0f, 1000.0f, 10, 2, "");
- dy-= 19;
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Size:", xstart, dy, 2*dx, 19, texmap->size, -1000.0f, 1000.0f, 10, 3, "");
- dy-= 23;
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, TEXMAP_CLIP_MIN, B_NODE_EXEC+node->nr, "Min", xstart, dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", xstart+dx, dy, dx, 19, texmap->min, -1000.0f, 1000.0f, 10, 2, "");
- dy-= 19;
- uiDefButBitI(block, TOG, TEXMAP_CLIP_MAX, B_NODE_EXEC+node->nr, "Max", xstart, dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, "");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", xstart+dx, dy, dx, 19, texmap->max, -1000.0f, 1000.0f, 10, 2, "");
- }
- return 80;
-}
-
-static int node_composit_buts_alphaover(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeTwoFloats *ntf= node->storage;
-
- /* alpha type */
- uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "ConvertPremul",
- butr->xmin, butr->ymin+19, butr->xmax-butr->xmin, 19,
- &node->custom1, 0, 0, 0, 0, "");
- /* mix factor */
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Premul: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 19,
- &ntf->x, 0.0f, 1.0f, 100, 0, "");
- }
- return 38;
-}
-
-static int node_composit_buts_hue_sat(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeHueSat *nhs= node->storage;
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Hue: ",
- butr->xmin, butr->ymin+40.0f, butr->xmax-butr->xmin, 20,
- &nhs->hue, 0.0f, 1.0f, 100, 0, "");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Sat: ",
- butr->xmin, butr->ymin+20.0f, butr->xmax-butr->xmin, 20,
- &nhs->sat, 0.0f, 2.0f, 100, 0, "");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Val: ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &nhs->val, 0.0f, 2.0f, 100, 0, "");
- }
- return 60;
-}
-
-static int node_composit_buts_dilateerode(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Distance:",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom2, -100, 100, 0, 0, "Distance to grow/shrink (number of iterations)");
- }
- return 20;
-}
-
-static int node_composit_buts_diff_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- short sx= (butr->xmax-butr->xmin)/4;
- short dx= (butr->xmax-butr->xmin)/3;
- NodeChroma *c= node->storage;
-
- uiBlockBeginAlign(block);
- /*color space selectors*/
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"RGB",
- butr->xmin,butr->ymin+60,sx,20,
- &node->custom1,1,1, 0, 0, "RGB Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"HSV",
- butr->xmin+sx,butr->ymin+60,sx,20,
- &node->custom1,1,2, 0, 0, "HSV Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YUV",
- butr->xmin+2*sx,butr->ymin+60,sx,20,
- &node->custom1,1,3, 0, 0, "YUV Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YCC",
- butr->xmin+3*sx,butr->ymin+60,sx,20,
- &node->custom1,1,4, 0, 0, "YCbCr Color Space");
- /*channel tolorences*/
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ",
- butr->xmin, butr->ymin+40, dx, 20,
- &c->t1, 0.0f, 1.0f, 100, 0, "Channel 1 Tolerance");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ",
- butr->xmin+dx, butr->ymin+40, dx, 20,
- &c->t2, 0.0f, 1.0f, 100, 0, "Channel 2 Tolorence");
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ",
- butr->xmin+2*dx, butr->ymin+40, dx, 20,
- &c->t3, 0.0f, 1.0f, 100, 0, "Channel 3 Tolorence");
- /*falloff parameters*/
- /*
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff Size ",
- butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20,
- &c->fsize, 0.0f, 1.0f, 100, 0, "");
- */
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff: ",
- butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20,
- &c->fstrength, 0.0f, 1.0f, 100, 0, "");
- }
- return 80;
-}
-
-static int node_composit_buts_color_spill(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- short dx= (butr->xmax-butr->xmin)/3;
-
- NodeChroma *c=node->storage;
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Enhance: ",
- butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 0.5f, 100, 2, "Adjusts how much selected channel is affected by color spill algorithm");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "R",
- butr->xmin,butr->ymin,dx,20,
- &node->custom1,1,1, 0, 0, "Red Spill Suppression");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "G",
- butr->xmin+dx,butr->ymin,dx,20,
- &node->custom1,1,2, 0, 0, "Green Spill Suppression");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "B",
- butr->xmin+2*dx,butr->ymin,dx,20,
- &node->custom1, 1, 3, 0, 0, "Blue Spill Suppression");
- uiBlockEndAlign(block);
- }
- return 60;
-}
-
-static int node_composit_buts_chroma_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- short dx=(butr->xmax-butr->xmin)/2;
- NodeChroma *c= node->storage;
- uiBlockBeginAlign(block);
-
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Acceptance ",
- butr->xmin, butr->ymin+60, butr->xmax-butr->xmin, 20,
- &c->t1, 1.0f, 80.0f, 100, 0, "Tolerance for colors to be considered a keying color");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Cutoff ",
- butr->xmin, butr->ymin+40, butr->xmax-butr->xmin, 20,
- &c->t2, 0.0f, 30.0f, 100, 0, "Colors below this will be considered as exact matches for keying color");
-
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Lift ",
- butr->xmin, butr->ymin+20, dx, 20,
- &c->fsize, 0.0f, 1.0f, 100, 0, "Alpha Lift");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Gain ",
- butr->xmin+dx, butr->ymin+20, dx, 20,
- &c->fstrength, 0.0f, 1.0f, 100, 0, "Alpha Gain");
-
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Shadow Adjust ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &c->t3, 0.0f, 1.0f, 100, 0, "Adjusts the brightness of any shadows captured");
-
- if(c->t2 > c->t1)
- c->t2=c->t1;
- }
- return 80;
-}
-
-static int node_composit_buts_channel_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- short sx= (butr->xmax-butr->xmin)/4;
- short cx= (butr->xmax-butr->xmin)/3;
- NodeChroma *c=node->storage;
- char *c1, *c2, *c3;
-
- /*color space selectors*/
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"RGB",
- butr->xmin,butr->ymin+60,sx,20,&node->custom1,1,1, 0, 0, "RGB Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"HSV",
- butr->xmin+sx,butr->ymin+60,sx,20,&node->custom1,1,2, 0, 0, "HSV Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YUV",
- butr->xmin+2*sx,butr->ymin+60,sx,20,&node->custom1,1,3, 0, 0, "YUV Color Space");
- uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YCC",
- butr->xmin+3*sx,butr->ymin+60,sx,20,&node->custom1,1,4, 0, 0, "YCbCr Color Space");
-
- if (node->custom1==1) {
- c1="R"; c2="G"; c3="B";
- }
- else if(node->custom1==2){
- c1="H"; c2="S"; c3="V";
- }
- else if(node->custom1==3){
- c1="Y"; c2="U"; c3="V";
- }
- else { // if(node->custom1==4){
- c1="Y"; c2="Cb"; c3="Cr";
- }
-
- /*channel selector */
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c1,
- butr->xmin,butr->ymin+40,cx,20,&node->custom2,1, 1, 0, 0, "Channel 1");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c2,
- butr->xmin+cx,butr->ymin+40,cx,20,&node->custom2,1, 2, 0, 0, "Channel 2");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c3,
- butr->xmin+cx+cx,butr->ymin+40,cx,20,&node->custom2, 1, 3, 0, 0, "Channel 3");
-
- /*tolerance sliders */
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "High ",
- butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 1.0f, 100, 0, "Values higher than this setting are 100% opaque");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Low ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &c->t2, 0.0f, 1.0f, 100, 0, "Values lower than this setting are 100% keyed");
- uiBlockEndAlign(block);
-
- /*keep t2 (low) less than t1 (high) */
- if(c->t2 > c->t1) {
- c->t2=c->t1;
- }
- }
- return 80;
-}
-
-static int node_composit_buts_luma_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeChroma *c=node->storage;
-
- /*tolerance sliders */
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "High ",
- butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20,
- &c->t1, 0.0f, 1.0f, 100, 0, "Values higher than this setting are 100% opaque");
- uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Low ",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &c->t2, 0.0f, 1.0f, 100, 0, "Values lower than this setting are 100% keyed");
- uiBlockEndAlign(block);
-
- /*keep t2 (low) less than t1 (high) */
- if(c->t2 > c->t1) {
- c->t2=c->t1;
- }
- }
- return 40;
-}
-
-static int node_composit_buts_map_uv(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Alpha:",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 100, 0, 0, "Conversion percentage of UV differences to Alpha");
- }
- return 20;
-}
-
-static int node_composit_buts_id_mask(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "ID:",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 10000, 0, 0, "Pass Index number to convert to Alpha");
- }
- return 20;
-}
-
-/* allocate sufficient! */
-static void node_imagetype_string(char *str)
-{
- str += sprintf(str, "Save Image as: %%t|");
- str += sprintf(str, "Targa %%x%d|", R_TARGA);
- str += sprintf(str, "Targa Raw %%x%d|", R_RAWTGA);
- str += sprintf(str, "PNG %%x%d|", R_PNG);
- str += sprintf(str, "BMP %%x%d|", R_BMP);
- str += sprintf(str, "Jpeg %%x%d|", R_JPEG90);
- str += sprintf(str, "Iris %%x%d|", R_IRIS);
- str += sprintf(str, "Radiance HDR %%x%d|", R_RADHDR);
- str += sprintf(str, "Cineon %%x%d|", R_CINEON);
- str += sprintf(str, "DPX %%x%d|", R_DPX);
- str += sprintf(str, "OpenEXR %%x%d", R_OPENEXR);
-}
-
-static void node_set_image_cb(void *ntree_v, void *node_v)
-{
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
-
- nodeSetActive(ntree, node);
-}
-
-static int node_composit_buts_file_output(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- NodeImageFile *nif= node->storage;
- uiBut *bt;
- short x= (short)butr->xmin;
- short y= (short)butr->ymin;
- short w= (short)butr->xmax-butr->xmin;
- char str[320];
-
- node_imagetype_string(str);
-
- uiBlockBeginAlign(block);
-
- bt = uiDefIconBut(block, BUT, B_NODE_SETIMAGE, ICON_FILESEL,
- x, y+60, 20, 20,
- 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
- uiButSetFunc(bt, node_set_image_cb, ntree, node);
-
- uiDefBut(block, TEX, B_NOP, "",
- 20+x, y+60, w-20, 20,
- nif->name, 0.0f, 240.0f, 0, 0, "");
-
- uiDefButS(block, MENU, B_NOP, str,
- x, y+40, w, 20,
- &nif->imtype, 0.0f, 1.0f, 0, 0, "");
-
- if(nif->imtype==R_OPENEXR) {
- uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_REDR, "Half",
- x, y+20, w/2, 20,
- &nif->subimtype, 0, 0, 0, 0, "");
-
- uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",
- x+w/2, y+20, w/2, 20,
- &nif->codec, 0, 0, 0, 0, "");
- }
- else {
- uiDefButS(block, NUM, B_NOP, "Quality: ",
- x, y+20, w, 20,
- &nif->quality, 10.0f, 100.0f, 10, 0, "");
- }
-
- /* start frame, end frame */
- uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "SFra: ",
- x, y, w/2, 20,
- &nif->sfra, 1, MAXFRAMEF, 10, 0, "");
- uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "EFra: ",
- x+w/2, y, w/2, 20,
- &nif->efra, 1, MAXFRAMEF, 10, 0, "");
-
- }
- return 80;
-}
-
-static void node_scale_cb(void *node_v, void *unused_v)
-{
- bNode *node= node_v;
- bNodeSocket *nsock;
-
- /* check the 2 inputs, and set them to reasonable values */
- for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(ELEM(node->custom1, CMP_SCALE_RELATIVE, CMP_SCALE_SCENEPERCENT))
- nsock->ns.vec[0]= 1.0;
- else {
- if(nsock->next==NULL)
- nsock->ns.vec[0]= (float)G.scene->r.ysch;
- else
- nsock->ns.vec[0]= (float)G.scene->r.xsch;
- }
- }
-}
-
-static int node_composit_buts_scale(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Relative %x0|Absolute %x1|Scene Size % %x2|",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 0, 0, 0, "Scale new image to absolute pixel size, size relative to the incoming image, or using the 'percent' size of the scene");
- uiButSetFunc(bt, node_scale_cb, node, NULL);
- }
- return 20;
-}
-
-static int node_composit_buts_invert(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, CMP_CHAN_RGB, B_NODE_EXEC+node->nr, "RGB",
- butr->xmin, butr->ymin, (butr->xmax-butr->xmin)/2, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiDefButBitS(block, TOG, CMP_CHAN_A, B_NODE_EXEC+node->nr, "A",
- butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin, (butr->xmax-butr->xmin)/2, 20,
- &node->custom1, 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
- }
- return 20;
-}
-
-static int node_composit_buts_premulkey(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- uiBut *bt;
-
- /* blend type */
- bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Key to Premul %x0|Premul to Key %x1",
- butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20,
- &node->custom1, 0, 0, 0, 0, "Conversion between premultiplied alpha and key alpha");
- }
- return 20;
-}
-
-/* only once called */
-static void node_composit_set_butfunc(bNodeType *ntype)
-{
- switch(ntype->type) {
- /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
-
- case CMP_NODE_IMAGE:
- ntype->butfunc= node_composit_buts_image;
- break;
- case CMP_NODE_R_LAYERS:
- ntype->butfunc= node_composit_buts_renderlayers;
- break;
- case CMP_NODE_NORMAL:
- ntype->butfunc= node_buts_normal;
- break;
- case CMP_NODE_CURVE_VEC:
- ntype->butfunc= node_buts_curvevec;
- break;
- case CMP_NODE_CURVE_RGB:
- ntype->butfunc= node_buts_curvecol;
- break;
- case CMP_NODE_VALUE:
- ntype->butfunc= node_buts_value;
- break;
- case CMP_NODE_RGB:
- ntype->butfunc= node_buts_rgb;
- break;
- case CMP_NODE_FLIP:
- ntype->butfunc= node_composit_buts_flip;
- break;
- case CMP_NODE_SPLITVIEWER:
- ntype->butfunc= node_composit_buts_splitviewer;
- break;
- case CMP_NODE_MIX_RGB:
- ntype->butfunc= node_buts_mix_rgb;
- break;
- case CMP_NODE_VALTORGB:
- ntype->butfunc= node_buts_valtorgb;
- break;
- case CMP_NODE_CROP:
- ntype->butfunc= node_composit_buts_crop;
- break;
- case CMP_NODE_BLUR:
- ntype->butfunc= node_composit_buts_blur;
- break;
- case CMP_NODE_DBLUR:
- ntype->butfunc= node_composit_buts_dblur;
- break;
- case CMP_NODE_BILATERALBLUR:
- ntype->butfunc= node_composit_buts_bilateralblur;
- break;
- /* qdn: defocus node */
- case CMP_NODE_DEFOCUS:
- ntype->butfunc = node_composit_buts_defocus;
- break;
- /* qdn: glare node */
- case CMP_NODE_GLARE:
- ntype->butfunc = node_composit_buts_glare;
- break;
- /* qdn: tonemap node */
- case CMP_NODE_TONEMAP:
- ntype->butfunc = node_composit_buts_tonemap;
- break;
- /* qdn: lens distortion node */
- case CMP_NODE_LENSDIST:
- ntype->butfunc = node_composit_buts_lensdist;
- break;
- case CMP_NODE_VECBLUR:
- ntype->butfunc= node_composit_buts_vecblur;
- break;
- case CMP_NODE_FILTER:
- ntype->butfunc= node_composit_buts_filter;
- break;
- case CMP_NODE_MAP_VALUE:
- ntype->butfunc= node_composit_buts_map_value;
- break;
- case CMP_NODE_TIME:
- ntype->butfunc= node_buts_time;
- break;
- case CMP_NODE_ALPHAOVER:
- ntype->butfunc= node_composit_buts_alphaover;
- break;
- case CMP_NODE_HUE_SAT:
- ntype->butfunc= node_composit_buts_hue_sat;
- break;
- case CMP_NODE_TEXTURE:
- ntype->butfunc= node_buts_texture;
- break;
- case CMP_NODE_DILATEERODE:
- ntype->butfunc= node_composit_buts_dilateerode;
- break;
- case CMP_NODE_OUTPUT_FILE:
- ntype->butfunc= node_composit_buts_file_output;
- break;
-
- case CMP_NODE_DIFF_MATTE:
- ntype->butfunc=node_composit_buts_diff_matte;
- break;
- case CMP_NODE_COLOR_SPILL:
- ntype->butfunc=node_composit_buts_color_spill;
- break;
- case CMP_NODE_CHROMA:
- ntype->butfunc=node_composit_buts_chroma_matte;
- break;
- case CMP_NODE_SCALE:
- ntype->butfunc= node_composit_buts_scale;
- break;
- case CMP_NODE_CHANNEL_MATTE:
- ntype->butfunc= node_composit_buts_channel_matte;
- break;
- case CMP_NODE_LUMA_MATTE:
- ntype->butfunc= node_composit_buts_luma_matte;
- break;
- case CMP_NODE_MAP_UV:
- ntype->butfunc= node_composit_buts_map_uv;
- break;
- case CMP_NODE_ID_MASK:
- ntype->butfunc= node_composit_buts_id_mask;
- break;
- case CMP_NODE_MATH:
- ntype->butfunc= node_buts_math;
- break;
- case CMP_NODE_INVERT:
- ntype->butfunc= node_composit_buts_invert;
- break;
- case CMP_NODE_PREMULKEY:
- ntype->butfunc= node_composit_buts_premulkey;
- break;
- default:
- ntype->butfunc= NULL;
- }
-}
-
-/* ****************** BUTTON CALLBACKS FOR TEXTURE NODES ***************** */
-
-static int node_texture_buts_bricks(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- short w = butr->xmax-butr->xmin;
- short ofw = 32;
-
- uiBlockBeginAlign(block);
-
- /* Offset */
- uiDefButF(
- block, NUM, B_NODE_EXEC+node->nr, "Offset",
- butr->xmin, butr->ymin+20, w-ofw, 20,
- &node->custom3,
- 0, 1, 0.25, 2,
- "Offset amount" );
- uiDefButS(
- block, NUM, B_NODE_EXEC+node->nr, "",
- butr->xmin+w-ofw, butr->ymin+20, ofw, 20,
- &node->custom1,
- 2, 99, 0, 0,
- "Offset every N rows" );
-
- /* Squash */
- uiDefButF(
- block, NUM, B_NODE_EXEC+node->nr, "Squash",
- butr->xmin, butr->ymin+0, w-ofw, 20,
- &node->custom4,
- 0, 99, 0.25, 2,
- "Stretch amount" );
- uiDefButS(
- block, NUM, B_NODE_EXEC+node->nr, "",
- butr->xmin+w-ofw, butr->ymin+0, ofw, 20,
- &node->custom2,
- 2, 99, 0, 0,
- "Stretch every N rows" );
-
- uiBlockEndAlign(block);
- }
- return 40;
-}
-
-/* Copied from buttons_shading.c -- needs unifying */
-static char* noisebasis_menu()
-{
- static char nbmenu[256];
- sprintf(nbmenu, "Noise Basis %%t|Blender Original %%x%d|Original Perlin %%x%d|Improved Perlin %%x%d|Voronoi F1 %%x%d|Voronoi F2 %%x%d|Voronoi F3 %%x%d|Voronoi F4 %%x%d|Voronoi F2-F1 %%x%d|Voronoi Crackle %%x%d|CellNoise %%x%d", TEX_BLENDER, TEX_STDPERLIN, TEX_NEWPERLIN, TEX_VORONOI_F1, TEX_VORONOI_F2, TEX_VORONOI_F3, TEX_VORONOI_F4, TEX_VORONOI_F2F1, TEX_VORONOI_CRACKLE, TEX_CELLNOISE);
- return nbmenu;
-}
-
-static int node_texture_buts_proc(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- Tex *tex = (Tex *)node->storage;
- short x,y,w,h;
-
- if( block ) {
- x = butr->xmin;
- y = butr->ymin;
- w = butr->xmax - x;
- h = butr->ymax - y;
- }
-
- switch( tex->type ) {
- case TEX_BLEND:
- if( block ) {
- uiBlockBeginAlign( block );
- uiDefButS( block, MENU, B_NODE_EXEC+node->nr,
- "Linear %x0|Quad %x1|Ease %x2|Diag %x3|Sphere %x4|Halo %x5|Radial %x6",
- x, y+20, w, 20, &tex->stype, 0, 1, 0, 0, "Blend Type" );
- uiDefButBitS(block, TOG, TEX_FLIPBLEND, B_NODE_EXEC+node->nr, "Flip XY", x, y, w, 20,
- &tex->flag, 0, 0, 0, 0, "Flips the direction of the progression 90 degrees");
- uiBlockEndAlign( block );
- }
- return 40;
-
-
- case TEX_MARBLE:
- if( block ) {
- uiBlockBeginAlign(block);
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Soft", 0*w/3+x, 40+y, w/3, 18, &tex->stype, 2.0, (float)TEX_SOFT, 0, 0, "Uses soft marble");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Sharp", 1*w/3+x, 40+y, w/3, 18, &tex->stype, 2.0, (float)TEX_SHARP, 0, 0, "Uses more clearly defined marble");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Sharper", 2*w/3+x, 40+y, w/3, 18, &tex->stype, 2.0, (float)TEX_SHARPER, 0, 0, "Uses very clearly defined marble");
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Soft noise", 0*w/2+x, 20+y, w/2, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Hard noise", 1*w/2+x, 20+y, w/2, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Sin", 0*w/3+x, 0+y, w/3, 18, &tex->noisebasis2, 8.0, 0.0, 0, 0, "Uses a sine wave to produce bands.");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Saw", 1*w/3+x, 0+y, w/3, 18, &tex->noisebasis2, 8.0, 1.0, 0, 0, "Uses a saw wave to produce bands");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Tri", 2*w/3+x, 0+y, w/3, 18, &tex->noisebasis2, 8.0, 2.0, 0, 0, "Uses a triangle wave to produce bands");
-
- uiBlockEndAlign(block);
- }
- return 60;
-
- case TEX_WOOD:
- if( block ) {
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), x, y+64, w, 18, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "Bands", x, 40+y, w/2, 18, &tex->stype, 2.0, (float)TEX_BANDNOISE, 0, 0, "Uses standard noise");
- uiDefButS(block, ROW, B_TEXPRV, "Rings", w/2+x, 40+y, w/2, 18, &tex->stype, 2.0, (float)TEX_RINGNOISE, 0, 0, "Lets Noise return RGB value");
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Sin", 0*w/3+x, 20+y, w/3, 18, &tex->noisebasis2, 8.0, (float)TEX_SIN, 0, 0, "Uses a sine wave to produce bands.");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Saw", 1*w/3+x, 20+y, w/3, 18, &tex->noisebasis2, 8.0, (float)TEX_SAW, 0, 0, "Uses a saw wave to produce bands");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Tri", 2*w/3+x, 20+y, w/3, 18, &tex->noisebasis2, 8.0, (float)TEX_TRI, 0, 0, "Uses a triangle wave to produce bands");
-
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Soft noise", 0*w/2+x, 0+y, w/2, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Hard noise", 1*w/2+x, 0+y, w/2, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
- uiBlockEndAlign(block);
- }
- return 80;
-
- case TEX_CLOUDS:
- if( block ) {
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), x, y+60, w, 18, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_TEXPRV, "B/W", x, y+38, w/2, 18, &tex->stype, 2.0, (float)TEX_DEFAULT, 0, 0, "Uses standard noise");
- uiDefButS(block, ROW, B_TEXPRV, "Color", w/2+x, y+38, w/2, 18, &tex->stype, 2.0, (float)TEX_COLOR, 0, 0, "Lets Noise return RGB value");
- uiDefButS(block, ROW, B_TEXPRV, "Soft", x, y+20, w/2, 18, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise");
- uiDefButS(block, ROW, B_TEXPRV, "Hard", w/2+x, y+20, w/2, 18, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise");
- uiBlockEndAlign(block);
-
- uiDefButS(block, NUM, B_TEXPRV, "Depth:", x, y, w, 18, &tex->noisedepth, 0.0, 6.0, 0, 0, "Sets the depth of the cloud calculation");
- }
- return 80;
-
- case TEX_DISTNOISE:
- if( block ) {
- uiBlockBeginAlign(block);
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), x, y+18, w, 18, &tex->noisebasis2, 0,0,0,0, "Sets the noise basis to distort");
- uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), x, y, w, 18, &tex->noisebasis, 0,0,0,0, "Sets the noise basis which does the distortion");
- uiBlockEndAlign(block);
- }
- return 36;
- }
- return 0;
-}
-
-static int node_texture_buts_image(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- char *strp;
- uiBut *bt;
-
- if( block ) {
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING2);
-
- /* browse button */
- IMAnames_to_pupstring(&strp, NULL, "LOAD NEW %x32767", &(G.main->image), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NOP, strp,
- butr->xmin, butr->ymin, 19, 19,
- &node->menunr, 0, 0, 0, 0, "Browses existing choices");
- uiButSetFunc(bt, node_browse_image_cb, ntree, node);
- if(strp) MEM_freeN(strp);
-
- /* Add New button */
- if(node->id==NULL) {
- bt= uiDefBut(block, BUT, B_NODE_LOADIMAGE, "Load New",
- butr->xmin+19, butr->ymin, (short)(butr->xmax-butr->xmin-19.0f), 19,
- NULL, 0.0, 0.0, 0, 0, "Add new Image");
- uiButSetFunc(bt, node_active_cb, ntree, node);
- uiBlockSetCol(block, TH_AUTO);
- }
- else {
- /* name button */
- short xmin= (short)butr->xmin, xmax= (short)butr->xmax;
- short width= xmax - xmin - 19;
-
- bt= uiDefBut(block, TEX, B_NOP, "IM:",
- xmin+19, butr->ymin, width, 19,
- node->id->name+2, 0.0, 19.0, 0, 0, "Image name");
- uiButSetFunc(bt, node_ID_title_cb, node, NULL);
- }
- }
- return 20;
-}
-
-static int node_texture_buts_output(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if( block ) {
- uiBut *bt;
- short width;
- char *name = ((TexNodeOutput*)node->storage)->name;
-
- uiBlockBeginAlign(block);
-
- width = (short)(butr->xmax - butr->xmin);
-
- bt = uiDefBut(
- block, TEX, B_NOP,
- "Name:",
- butr->xmin, butr->ymin,
- width, 19,
- name, 0, 31,
- 0, 0,
- "Name this output"
- );
-
- uiBlockEndAlign(block);
- }
- return 19;
-}
-
-/* only once called */
-static void node_texture_set_butfunc(bNodeType *ntype)
-{
- if( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) {
- ntype->butfunc = node_texture_buts_proc;
- }
- else switch(ntype->type) {
-
- case TEX_NODE_MATH:
- ntype->butfunc = node_buts_math;
- break;
-
- case TEX_NODE_MIX_RGB:
- ntype->butfunc = node_buts_mix_rgb;
- break;
-
- case TEX_NODE_VALTORGB:
- ntype->butfunc = node_buts_valtorgb;
- break;
-
- case TEX_NODE_CURVE_RGB:
- ntype->butfunc= node_buts_curvecol;
- break;
-
- case TEX_NODE_CURVE_TIME:
- ntype->butfunc = node_buts_time;
- break;
-
- case TEX_NODE_TEXTURE:
- ntype->butfunc = node_buts_texture;
- break;
-
- case TEX_NODE_BRICKS:
- ntype->butfunc = node_texture_buts_bricks;
- break;
-
- case TEX_NODE_IMAGE:
- ntype->butfunc = node_texture_buts_image;
- break;
-
- case TEX_NODE_OUTPUT:
- ntype->butfunc = node_texture_buts_output;
- break;
-
- default:
- ntype->butfunc= NULL;
- }
-}
-
-/* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */
-
-void init_node_butfuncs(void)
-{
- bNodeType *ntype;
-
- /* shader nodes */
- ntype= node_all_shaders.first;
- while(ntype) {
- node_shader_set_butfunc(ntype);
- ntype= ntype->next;
- }
- /* composit nodes */
- ntype= node_all_composit.first;
- while(ntype) {
- node_composit_set_butfunc(ntype);
- ntype= ntype->next;
- }
- ntype = node_all_textures.first;
- while(ntype) {
- node_texture_set_butfunc(ntype);
- ntype= ntype->next;
- }
-}
-
-/* ************** Generic drawing ************** */
-
-void node_rename_but(char *s)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- int dy, x1, y1, sizex=80, sizey=30;
- short pivot[2], mval[2], ret=0;
-
- getmouseco_sc(mval);
-
- pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30);
- pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10);
-
- if (pivot[0]!=mval[0] || pivot[1]!=mval[1])
- warp_pointer(pivot[0], pivot[1]);
-
- mywinset(G.curscreen->mainwin);
-
- x1= pivot[0]-sizex+10;
- y1= pivot[1]-sizey/2;
- dy= sizey/2;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
-
- /* buttons have 0 as return event, to prevent menu to close on hotkeys */
- uiBlockBeginAlign(block);
-
- uiDefBut(block, TEX, B_NOP, "Name: ", (short)(x1),(short)(y1+dy), 150, 19, s, 0.0, 19.0, 0, 0, "Node user name");
-
- uiBlockEndAlign(block);
-
- uiDefBut(block, BUT, 32767, "OK", (short)(x1+150), (short)(y1+dy), 29, 19, NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 2);
-
- ret= uiDoBlocks(&listb, 0, 0);
-}
-
-
-static void draw_nodespace_grid(SpaceNode *snode)
-{
- float start, step= 25.0f;
-
- BIF_ThemeColorShade(TH_BACK, -10);
-
- start= snode->v2d.cur.xmin -fmod(snode->v2d.cur.xmin, step);
-
- glBegin(GL_LINES);
- for(; start<snode->v2d.cur.xmax; start+=step) {
- glVertex2f(start, snode->v2d.cur.ymin);
- glVertex2f(start, snode->v2d.cur.ymax);
- }
-
- start= snode->v2d.cur.ymin -fmod(snode->v2d.cur.ymin, step);
- for(; start<snode->v2d.cur.ymax; start+=step) {
- glVertex2f(snode->v2d.cur.xmin, start);
- glVertex2f(snode->v2d.cur.xmax, start);
- }
-
- /* X and Y axis */
- BIF_ThemeColorShade(TH_BACK, -18);
- glVertex2f(0.0f, snode->v2d.cur.ymin);
- glVertex2f(0.0f, snode->v2d.cur.ymax);
- glVertex2f(snode->v2d.cur.xmin, 0.0f);
- glVertex2f(snode->v2d.cur.xmax, 0.0f);
-
- glEnd();
-}
-
-static void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
-{
-
- draw_nodespace_grid(snode);
-
- if((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
- Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf) {
- int x, y;
- /* somehow the offset has to be calculated inverse */
-
- glaDefine2DArea(&sa->winrct);
- /* ortho at pixel level curarea */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- x = (sa->winx-ibuf->x)/2 + snode->xof;
- y = (sa->winy-ibuf->y)/2 + snode->yof;
-
- if(ibuf->rect)
- glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- else if(ibuf->channels==4)
- glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
-
- /* sort this out, this should not be needed */
- myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
- }
- }
-}
-
-#if 0
-/* note: needs to be userpref or opengl profile option */
-static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
-{
-
- draw_nodespace_grid(snode);
-
- if(snode->flag & SNODE_BACKDRAW) {
- Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf) {
- int x, y;
- float zoom = 1.0;
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glaDefine2DArea(&sa->winrct);
-
- if(ibuf->x > sa->winx || ibuf->y > sa->winy) {
- float zoomx, zoomy;
- zoomx= (float)sa->winx/ibuf->x;
- zoomy= (float)sa->winy/ibuf->y;
- zoom = MIN2(zoomx, zoomy);
- }
-
- x = (sa->winx-zoom*ibuf->x)/2 + snode->xof;
- y = (sa->winy-zoom*ibuf->y)/2 + snode->yof;
-
- glPixelZoom(zoom, zoom);
-
- glColor4f(1.0, 1.0, 1.0, 1.0);
- if(ibuf->rect)
- glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
- else if(ibuf->channels==4)
- glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_FLOAT, ibuf->rect_float);
-
- glPixelZoom(1.0, 1.0);
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- }
- }
-}
-#endif
-
-/* nice AA filled circle */
-/* this might have some more generic use */
-static void circle_draw(float x, float y, float size, int type, int col[3])
-{
- /* 16 values of sin function */
- static float si[16] = {
- 0.00000000, 0.39435585,0.72479278,0.93775213,
- 0.99871650,0.89780453,0.65137248,0.29936312,
- -0.10116832,-0.48530196,-0.79077573,-0.96807711,
- -0.98846832,-0.84864425,-0.57126821,-0.20129852
- };
- /* 16 values of cos function */
- static float co[16] ={
- 1.00000000,0.91895781,0.68896691,0.34730525,
- -0.05064916,-0.44039415,-0.75875812,-0.95413925,
- -0.99486932,-0.87434661,-0.61210598,-0.25065253,
- 0.15142777,0.52896401,0.82076344,0.97952994,
- };
- int a;
-
- glColor3ub(col[0], col[1], col[2]);
-
- glBegin(GL_POLYGON);
- for(a=0; a<16; a++)
- glVertex2f(x+size*si[a], y+size*co[a]);
- glEnd();
-
- glColor4ub(0, 0, 0, 150);
- glEnable(GL_BLEND);
- glEnable( GL_LINE_SMOOTH );
- glBegin(GL_LINE_LOOP);
- for(a=0; a<16; a++)
- glVertex2f(x+size*si[a], y+size*co[a]);
- glEnd();
- glDisable( GL_LINE_SMOOTH );
- glDisable(GL_BLEND);
-}
-
-static void socket_circle_draw(bNodeSocket *sock, float size)
-{
- int col[3];
-
- /* choose color based on sock flags */
- if(sock->flag & SELECT) {
- if(sock->flag & SOCK_SEL) {
- col[0]= 240; col[1]= 200; col[2]= 40;}
- else if(sock->type==SOCK_VALUE) {
- col[0]= 200; col[1]= 200; col[2]= 200;}
- else if(sock->type==SOCK_VECTOR) {
- col[0]= 140; col[1]= 140; col[2]= 240;}
- else if(sock->type==SOCK_RGBA) {
- col[0]= 240; col[1]= 240; col[2]= 100;}
- else {
- col[0]= 140; col[1]= 240; col[2]= 140;}
- }
- else if(sock->flag & SOCK_SEL) {
- col[0]= 200; col[1]= 160; col[2]= 0;}
- else {
- if(sock->type==-1) {
- col[0]= 0; col[1]= 0; col[2]= 0;}
- else if(sock->type==SOCK_VALUE) {
- col[0]= 160; col[1]= 160; col[2]= 160;}
- else if(sock->type==SOCK_VECTOR) {
- col[0]= 100; col[1]= 100; col[2]= 200;}
- else if(sock->type==SOCK_RGBA) {
- col[0]= 200; col[1]= 200; col[2]= 40;}
- else {
- col[0]= 100; col[1]= 200; col[2]= 100;}
- }
-
- circle_draw(sock->locx, sock->locy, size, sock->type, col);
-}
-
-/* not a callback */
-static void node_draw_preview(bNodePreview *preview, rctf *prv)
-{
- float xscale= (prv->xmax-prv->xmin)/((float)preview->xsize);
- float yscale= (prv->ymax-prv->ymin)/((float)preview->ysize);
- float tile= (prv->xmax - prv->xmin) / 10.0;
- float x, y;
-
- /* draw checkerboard backdrop to show alpha */
- glColor3ub(120, 120, 120);
- glRectf(prv->xmin, prv->ymin, prv->xmax, prv->ymax);
- glColor3ub(160, 160, 160);
-
- for(y=prv->ymin; y<prv->ymax; y+=tile*2) {
- for(x=prv->xmin; x<prv->xmax; x+=tile*2) {
- float tilex= tile, tiley= tile;
-
- if(x+tile > prv->xmax)
- tilex= prv->xmax-x;
- if(y+tile > prv->ymax)
- tiley= prv->ymax-y;
-
- glRectf(x, y, x + tilex, y + tiley);
- }
- }
- for(y=prv->ymin+tile; y<prv->ymax; y+=tile*2) {
- for(x=prv->xmin+tile; x<prv->xmax; x+=tile*2) {
- float tilex= tile, tiley= tile;
-
- if(x+tile > prv->xmax)
- tilex= prv->xmax-x;
- if(y+tile > prv->ymax)
- tiley= prv->ymax-y;
-
- glRectf(x, y, x + tilex, y + tiley);
- }
- }
-
-#ifdef __APPLE__
- if(is_a_really_crappy_nvidia_card()) {
- float zoomx= curarea->winx/(float)(G.v2d->cur.xmax-G.v2d->cur.xmin);
- float zoomy= curarea->winy/(float)(G.v2d->cur.ymax-G.v2d->cur.ymin);
- glPixelZoom(zoomx*xscale, zoomy*yscale);
- }
- else
-#endif
- glPixelZoom(xscale, yscale);
-
- glEnable(GL_BLEND);
- glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */
-
- glColor4f(1.0, 1.0, 1.0, 1.0);
- glaDrawPixelsTex(prv->xmin, prv->ymin, preview->xsize, preview->ysize, GL_FLOAT, preview->rect);
-
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- glDisable(GL_BLEND);
- glPixelZoom(1.0f, 1.0f);
-
- BIF_ThemeColorShadeAlpha(TH_BACK, -15, +100);
- fdrawbox(prv->xmin, prv->ymin, prv->xmax, prv->ymax);
-
-}
-
-/* based on settings in node, sets drawing rect info. each redraw! */
-static void node_update_hidden(bNode *node)
-{
- bNodeSocket *nsock;
- float rad, drad, hiddenrad= HIDDEN_RAD;
- int totin=0, totout=0, tot;
-
- /* calculate minimal radius */
- for(nsock= node->inputs.first; nsock; nsock= nsock->next)
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- totin++;
- for(nsock= node->outputs.first; nsock; nsock= nsock->next)
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- totout++;
-
- tot= MAX2(totin, totout);
- if(tot>4) {
- hiddenrad += 5.0*(float)(tot-4);
- }
-
- node->totr.xmin= node->locx;
- node->totr.xmax= node->locx + 3*hiddenrad + node->miniwidth;
- node->totr.ymax= node->locy + (hiddenrad - 0.5f*NODE_DY);
- node->totr.ymin= node->totr.ymax - 2*hiddenrad;
-
- /* output sockets */
- rad=drad= M_PI/(1.0f + (float)totout);
-
- for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- nsock->locx= node->totr.xmax - hiddenrad + sin(rad)*hiddenrad;
- nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad;
- rad+= drad;
- }
- }
-
- /* input sockets */
- rad=drad= - M_PI/(1.0f + (float)totin);
-
- for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- nsock->locx= node->totr.xmin + hiddenrad + sin(rad)*hiddenrad;
- nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad;
- rad+= drad;
- }
- }
-}
-
-/* based on settings in node, sets drawing rect info. each redraw! */
-static void node_update(bNode *node)
-{
- bNodeSocket *nsock;
- float dy= node->locy;
-
- /* header */
- dy-= NODE_DY;
-
- /* little bit space in top */
- if(node->outputs.first)
- dy-= NODE_DYS/2;
-
- /* output sockets */
- for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- nsock->locx= node->locx + node->width;
- nsock->locy= dy - NODE_DYS;
- dy-= NODE_DY;
- }
- }
-
- node->prvr.xmin= node->butr.xmin= node->locx + NODE_DYS;
- node->prvr.xmax= node->butr.xmax= node->locx + node->width- NODE_DYS;
-
- /* preview rect? */
- if(node->flag & NODE_PREVIEW) {
- /* only recalculate size when there's a preview actually, otherwise we use stored result */
- if(node->preview && node->preview->rect) {
- float aspect= 1.0f;
-
- if(node->preview && node->preview->xsize && node->preview->ysize)
- aspect= (float)node->preview->ysize/(float)node->preview->xsize;
-
- dy-= NODE_DYS/2;
- node->prvr.ymax= dy;
-
- if(aspect <= 1.0f)
- node->prvr.ymin= dy - aspect*(node->width-NODE_DY);
- else {
- float dx= (node->width - NODE_DYS) - (node->width- NODE_DYS)/aspect; /* width correction of image */
-
- node->prvr.ymin= dy - (node->width-NODE_DY);
-
- node->prvr.xmin+= 0.5*dx;
- node->prvr.xmax-= 0.5*dx;
- }
-
- dy= node->prvr.ymin - NODE_DYS/2;
-
- /* make sure that maximums are bigger or equal to minimums */
- if(node->prvr.xmax < node->prvr.xmin) SWAP(float, node->prvr.xmax, node->prvr.xmin);
- if(node->prvr.ymax < node->prvr.ymin) SWAP(float, node->prvr.ymax, node->prvr.ymin);
- }
- else {
- float oldh= node->prvr.ymax - node->prvr.ymin;
- if(oldh==0.0f)
- oldh= 0.6f*node->width-NODE_DY;
- dy-= NODE_DYS/2;
- node->prvr.ymax= dy;
- node->prvr.ymin= dy - oldh;
- dy= node->prvr.ymin - NODE_DYS/2;
- }
- }
-
- /* XXX ugly hack, typeinfo for group is generated */
- if(node->type == NODE_GROUP)
- node->typeinfo->butfunc= node_buts_group;
-
- /* buttons rect? */
- if((node->flag & NODE_OPTIONS) && node->typeinfo->butfunc) {
- dy-= NODE_DYS/2;
- node->butr.ymax= dy;
- node->butr.ymin= dy - (float)node->typeinfo->butfunc(NULL, NULL, node, NULL);
- dy= node->butr.ymin - NODE_DYS/2;
- }
-
- /* input sockets */
- for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
- if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- nsock->locx= node->locx;
- nsock->locy= dy - NODE_DYS;
- dy-= NODE_DY;
- }
- }
-
- /* little bit space in end */
- if(node->inputs.first || (node->flag & (NODE_OPTIONS|NODE_PREVIEW))==0 )
- dy-= NODE_DYS/2;
-
- node->totr.xmin= node->locx;
- node->totr.xmax= node->locx + node->width;
- node->totr.ymax= node->locy;
- node->totr.ymin= dy;
-}
-
-/* based on settings in node, sets drawing rect info. each redraw! */
-/* note: this assumes only 1 group at a time is drawn (linked data) */
-/* in node->totr the entire boundbox for the group is stored */
-static void node_update_group(bNode *gnode)
-{
- bNodeTree *ngroup= (bNodeTree *)gnode->id;
- bNode *node;
- bNodeSocket *nsock;
- rctf *rect= &gnode->totr;
- int counter;
-
- /* center them, is a bit of abuse of locx and locy though */
- for(node= ngroup->nodes.first; node; node= node->next) {
- node->locx+= gnode->locx;
- node->locy+= gnode->locy;
- if(node->flag & NODE_HIDDEN)
- node_update_hidden(node);
- else
- node_update(node);
- node->locx-= gnode->locx;
- node->locy-= gnode->locy;
- }
- counter= 1;
- for(node= ngroup->nodes.first; node; node= node->next) {
- if(counter) {
- *rect= node->totr;
- counter= 0;
- }
- else
- BLI_union_rctf(rect, &node->totr);
- }
- if(counter==1) return; /* should be prevented? */
-
- rect->xmin-= NODE_DY;
- rect->ymin-= NODE_DY;
- rect->xmax+= NODE_DY;
- rect->ymax+= NODE_DY;
-
- /* output sockets */
- for(nsock= gnode->outputs.first; nsock; nsock= nsock->next) {
- nsock->locx= rect->xmax;
- nsock->locy= nsock->tosock->locy;
- }
-
- /* input sockets */
- for(nsock= gnode->inputs.first; nsock; nsock= nsock->next) {
- nsock->locx= rect->xmin;
- nsock->locy= nsock->tosock->locy;
- }
-}
-
-static void node_scaling_widget(int color_id, float aspect, float xmin, float ymin, float xmax, float ymax)
-{
- float dx;
- float dy;
-
- dx= 0.5f*(xmax-xmin);
- dy= 0.5f*(ymax-ymin);
-
- BIF_ThemeColorShade(color_id, +30);
- fdrawline(xmin, ymin, xmax, ymax);
- fdrawline(xmin+dx, ymin, xmax, ymax-dy);
-
- BIF_ThemeColorShade(color_id, -10);
- fdrawline(xmin, ymin+aspect, xmax, ymax+aspect);
- fdrawline(xmin+dx, ymin+aspect, xmax, ymax-dy+aspect);
-}
-
-static int node_get_colorid(bNode *node)
-{
- if(node->typeinfo->nclass==NODE_CLASS_INPUT)
- return TH_NODE_IN_OUT;
- if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
- if(node->flag & NODE_DO_OUTPUT)
- return TH_NODE_IN_OUT;
- else
- return TH_NODE;
- }
- if(node->typeinfo->nclass==NODE_CLASS_CONVERTOR)
- return TH_NODE_CONVERTOR;
- if(ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER))
- return TH_NODE_OPERATOR;
- if(node->typeinfo->nclass==NODE_CLASS_GROUP)
- return TH_NODE_GROUP;
- return TH_NODE;
-}
-
-static void node_draw_link_bezier(float vec[][3], int th_col1, int th_col2, int do_shaded)
-{
- float dist;
-
- dist= 0.5f*ABS(vec[0][0] - vec[3][0]);
-
- /* check direction later, for top sockets */
- vec[1][0]= vec[0][0]+dist;
- vec[1][1]= vec[0][1];
-
- vec[2][0]= vec[3][0]-dist;
- vec[2][1]= vec[3][1];
-
- if( MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > G.v2d->cur.xmax); /* clipped */
- else if ( MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < G.v2d->cur.xmin); /* clipped */
- else {
- float curve_res = 24, spline_step = 0.0f;
-
- /* we can reuse the dist variable here to increment the GL curve eval amount*/
- dist = 1.0f/curve_res;
-
- glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]);
- glBegin(GL_LINE_STRIP);
- while (spline_step < 1.000001f) {
- if(do_shaded)
- BIF_ThemeColorBlend(th_col1, th_col2, spline_step);
- glEvalCoord1f(spline_step);
- spline_step += dist;
- }
- glEnd();
- }
-
-}
-
-/* note; this is used for fake links in groups too */
-void node_draw_link(SpaceNode *snode, bNodeLink *link)
-{
- float vec[4][3];
- float mx=0.0f, my=0.0f;
- int do_shaded= 1, th_col1= TH_WIRE, th_col2= TH_WIRE;
-
- if(link->fromnode==NULL && link->tonode==NULL)
- return;
-
- /* this is dragging link */
- if(link->fromnode==NULL || link->tonode==NULL) {
- short mval[2];
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
- BIF_ThemeColor(TH_WIRE);
- do_shaded= 0;
- }
- else {
- /* going to give issues once... */
- if(link->tosock->flag & SOCK_UNAVAIL)
- return;
- if(link->fromsock->flag & SOCK_UNAVAIL)
- return;
-
- /* a bit ugly... but thats how we detect the internal group links */
- if(link->fromnode==link->tonode) {
- BIF_ThemeColorBlend(TH_BACK, TH_WIRE, 0.25f);
- do_shaded= 0;
- }
- else {
- /* check cyclic */
- if(link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) {
- if(link->fromnode->flag & SELECT)
- th_col1= TH_EDGE_SELECT;
- if(link->tonode->flag & SELECT)
- th_col2= TH_EDGE_SELECT;
- }
- else {
- BIF_ThemeColor(TH_REDALERT);
- do_shaded= 0;
- }
- }
- }
-
- vec[0][2]= vec[1][2]= vec[2][2]= vec[3][2]= 0.0; /* only 2d spline, set the Z to 0*/
-
- /* in v0 and v3 we put begin/end points */
- if(link->fromnode) {
- vec[0][0]= link->fromsock->locx;
- vec[0][1]= link->fromsock->locy;
- }
- else {
- vec[0][0]= mx;
- vec[0][1]= my;
- }
- if(link->tonode) {
- vec[3][0]= link->tosock->locx;
- vec[3][1]= link->tosock->locy;
- }
- else {
- vec[3][0]= mx;
- vec[3][1]= my;
- }
-
- node_draw_link_bezier(vec, th_col1, th_col2, do_shaded);
-}
-
-
-/* note: in cmp_util.c is similar code, for node_compo_pass_on() */
-static void node_draw_mute_line(SpaceNode *snode, bNode *node)
-{
- bNodeSocket *valsock= NULL, *colsock= NULL, *vecsock= NULL;
- bNodeSocket *sock;
- float vec[4][3];
- int a;
-
- vec[0][2]= vec[1][2]= vec[2][2]= vec[3][2]= 0.0; /* only 2d spline, set the Z to 0*/
-
- /* 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(nodeCountSocketLinks(snode->edittree, sock)) {
- if(sock->type==SOCK_VALUE && valsock==NULL) valsock= sock;
- if(sock->type==SOCK_VECTOR && vecsock==NULL) vecsock= sock;
- if(sock->type==SOCK_RGBA && colsock==NULL) colsock= sock;
- }
- }
-
- /* outputs, draw lines */
- BIF_ThemeColor(TH_REDALERT);
- glEnable(GL_BLEND);
- glEnable( GL_LINE_SMOOTH );
-
- if(valsock || colsock || vecsock) {
- for(a=0, sock= node->outputs.first; sock; sock= sock->next, a++) {
- if(nodeCountSocketLinks(snode->edittree, sock)) {
- vec[3][0]= sock->locx;
- vec[3][1]= sock->locy;
-
- if(sock->type==SOCK_VALUE && valsock) {
- vec[0][0]= valsock->locx;
- vec[0][1]= valsock->locy;
- node_draw_link_bezier(vec, TH_WIRE, TH_WIRE, 0);
- valsock= NULL;
- }
- if(sock->type==SOCK_VECTOR && vecsock) {
- vec[0][0]= vecsock->locx;
- vec[0][1]= vecsock->locy;
- node_draw_link_bezier(vec, TH_WIRE, TH_WIRE, 0);
- vecsock= NULL;
- }
- if(sock->type==SOCK_RGBA && colsock) {
- vec[0][0]= colsock->locx;
- vec[0][1]= colsock->locy;
- node_draw_link_bezier(vec, TH_WIRE, TH_WIRE, 0);
- colsock= NULL;
- }
- }
- }
- }
- glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
-}
-
-
-static void node_draw_basis(ScrArea *sa, SpaceNode *snode, bNode *node)
-{
- bNodeSocket *sock;
- uiBlock *block= NULL;
- uiBut *bt;
- rctf *rct= &node->totr;
- float slen, iconofs;
- int ofs, color_id= node_get_colorid(node);
- char showname[128]; /* 128 used below */
-
- uiSetRoundBox(15-4);
- ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT);
-
- /* header */
- if(color_id==TH_NODE)
- BIF_ThemeColorShade(color_id, -20);
- else
- BIF_ThemeColor(color_id);
-
- uiSetRoundBox(3);
- uiRoundBox(rct->xmin, rct->ymax-NODE_DY, rct->xmax, rct->ymax, BASIS_RAD);
-
- /* show/hide icons, note this sequence is copied in editnode.c */
- iconofs= rct->xmax;
-
- if(node->typeinfo->flag & NODE_PREVIEW) {
- int icon_id;
-
- if(node->flag & (NODE_ACTIVE_ID|NODE_DO_OUTPUT))
- icon_id= ICON_MATERIAL;
- else
- icon_id= ICON_MATERIAL_DEHLT;
- iconofs-= 18.0f;
- glEnable(GL_BLEND);
- BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, -60);
- glDisable(GL_BLEND);
- }
- if(node->type == NODE_GROUP) {
-
- iconofs-= 18.0f;
- glEnable(GL_BLEND);
- if(node->id->lib) {
- glPixelTransferf(GL_GREEN_SCALE, 0.7f);
- glPixelTransferf(GL_BLUE_SCALE, 0.3f);
- BIF_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect);
- glPixelTransferf(GL_GREEN_SCALE, 1.0f);
- glPixelTransferf(GL_BLUE_SCALE, 1.0f);
- }
- else {
- BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, -60);
- }
- glDisable(GL_BLEND);
- }
- if(node->typeinfo->flag & NODE_OPTIONS) {
- iconofs-= 18.0f;
- glEnable(GL_BLEND);
- BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, -60);
- glDisable(GL_BLEND);
- }
- { /* always hide/reveil unused sockets */
- int shade;
-
- iconofs-= 18.0f;
- if(node_has_hidden_sockets(node))
- shade= -40;
- else
- shade= -90;
- glEnable(GL_BLEND);
- BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, shade);
- glDisable(GL_BLEND);
- }
-
- /* title */
- if(node->flag & SELECT)
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10);
-
- /* open/close entirely? */
- ui_draw_tria_icon(rct->xmin+8.0f, rct->ymax-NODE_DY+4.0f, snode->aspect, 'v');
-
- if(node->flag & SELECT)
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
-
- ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
-
- if(node->flag & NODE_MUTED)
- sprintf(showname, "[%s]", node->name);
- else if(node->username[0])
- sprintf(showname, "(%s) %s", node->username, node->name);
- else
- BLI_strncpy(showname, node->name, 128);
-
- snode_drawstring(snode, showname, (int)(iconofs - rct->xmin-18.0f));
-
- /* body */
- BIF_ThemeColor4(TH_NODE);
- glEnable(GL_BLEND);
- uiSetRoundBox(8);
- uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax-NODE_DY, BASIS_RAD);
- glDisable(GL_BLEND);
-
- /* scaling indicator */
- node_scaling_widget(TH_NODE, snode->aspect, rct->xmax-BASIS_RAD*snode->aspect, rct->ymin, rct->xmax, rct->ymin+BASIS_RAD*snode->aspect);
-
- /* outline active emphasis */
- if(node->flag & NODE_ACTIVE) {
- glEnable(GL_BLEND);
- glColor4ub(200, 200, 200, 140);
- uiSetRoundBox(15-4);
- gl_round_box(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD);
- glDisable(GL_BLEND);
- }
-
- /* disable lines */
- if(node->flag & NODE_MUTED)
- node_draw_mute_line(snode, node);
-
- /* we make buttons for input sockets, if... */
- if(node->flag & NODE_OPTIONS) {
- if(node->inputs.first || node->typeinfo->butfunc) {
- char str[32];
-
- /* make unique block name, also used for handling blocks in editnode.c */
- sprintf(str, "node buttons %p", node);
-
- block= uiNewBlock(&sa->uiblocks, str, UI_EMBOSS, UI_HELV, sa->win);
- uiBlockSetFlag(block, UI_BLOCK_NO_HILITE);
- if(snode->id)
- uiSetButLock(snode->id->lib!=NULL, ERROR_LIBDATA_MESSAGE);
- }
- }
-
- /* hurmf... another candidate for callback, have to see how this works first */
- if(node->id && block && snode->treetype==NTREE_SHADER)
- nodeShaderSynchronizeID(node, 0);
-
- /* socket inputs, buttons */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- socket_circle_draw(sock, NODE_SOCKSIZE);
-
- if(block && sock->link==NULL) {
- float *butpoin= sock->ns.vec;
-
- if(sock->type==SOCK_VALUE) {
- bt= uiDefButF(block, NUM, B_NODE_EXEC+node->nr, sock->name,
- (short)sock->locx+NODE_DYS, (short)(sock->locy)-9, (short)node->width-NODE_DY, 17,
- butpoin, sock->ns.min, sock->ns.max, 10, 2, "");
- uiButSetFunc(bt, node_sync_cb, snode, node);
- }
- else if(sock->type==SOCK_VECTOR) {
- uiDefBlockBut(block, socket_vector_menu, sock, sock->name,
- (short)sock->locx+NODE_DYS, (short)sock->locy-9, (short)node->width-NODE_DY, 17,
- "");
- }
- else if(block && sock->type==SOCK_RGBA) {
- short labelw= node->width-NODE_DY-40, width;
-
- if(labelw>0) width= 40; else width= node->width-NODE_DY;
-
- bt= uiDefButF(block, COL, B_NODE_EXEC+node->nr, "",
- (short)(sock->locx+NODE_DYS), (short)sock->locy-8, width, 15,
- butpoin, 0, 0, 0, 0, "");
- uiButSetFunc(bt, node_sync_cb, snode, node);
-
- if(labelw>0) uiDefBut(block, LABEL, 0, sock->name,
- (short)(sock->locx+NODE_DYS) + 40, (short)sock->locy-8, labelw, 15,
- NULL, 0, 0, 0, 0, "");
- }
- }
- else {
- BIF_ThemeColor(TH_TEXT);
- ui_rasterpos_safe(sock->locx+8.0f, sock->locy-5.0f, snode->aspect);
- BIF_DrawString(snode->curfont, sock->name, 0);
- }
- }
- }
-
- /* socket outputs */
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- socket_circle_draw(sock, NODE_SOCKSIZE);
-
- BIF_ThemeColor(TH_TEXT);
- ofs= 0;
- slen= snode->aspect*BIF_GetStringWidth(snode->curfont, sock->name, 0);
- while(slen > node->width) {
- ofs++;
- slen= snode->aspect*BIF_GetStringWidth(snode->curfont, sock->name+ofs, 0);
- }
- ui_rasterpos_safe(sock->locx-8.0f-slen, sock->locy-5.0f, snode->aspect);
- BIF_DrawString(snode->curfont, sock->name+ofs, 0);
- }
- }
-
- /* preview */
- if(node->flag & NODE_PREVIEW)
- if(node->preview && node->preview->rect)
- node_draw_preview(node->preview, &node->prvr);
-
- /* buttons */
- if(node->flag & NODE_OPTIONS) {
- if(block) {
- if(node->typeinfo->butfunc) {
- node->typeinfo->butfunc(block, snode->nodetree, node, &node->butr);
- }
- uiDrawBlock(block);
- }
- }
-
-}
-
-static void node_draw_hidden(SpaceNode *snode, bNode *node)
-{
- bNodeSocket *sock;
- rctf *rct= &node->totr;
- float dx, centy= 0.5f*(rct->ymax+rct->ymin);
- float hiddenrad= 0.5f*(rct->ymax-rct->ymin);
- int color_id= node_get_colorid(node);
- char showname[128]; /* 128 is used below */
-
- /* shadow */
- uiSetRoundBox(15);
- ui_dropshadow(rct, hiddenrad, snode->aspect, node->flag & SELECT);
-
- /* body */
- BIF_ThemeColor(color_id);
- uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad);
-
- /* outline active emphasis */
- if(node->flag & NODE_ACTIVE) {
- glEnable(GL_BLEND);
- glColor4ub(200, 200, 200, 140);
- gl_round_box(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad);
- glDisable(GL_BLEND);
- }
-
- /* title */
- if(node->flag & SELECT)
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10);
-
- /* open entirely icon */
- ui_draw_tria_icon(rct->xmin+9.0f, centy-6.0f, snode->aspect, 'h');
-
- /* disable lines */
- if(node->flag & NODE_MUTED)
- node_draw_mute_line(snode, node);
-
- if(node->flag & SELECT)
- BIF_ThemeColor(TH_TEXT_HI);
- else
- BIF_ThemeColor(TH_TEXT);
-
- if(node->miniwidth>0.0f) {
- ui_rasterpos_safe(rct->xmin+21.0f, centy-4.0f, snode->aspect);
-
- if(node->flag & NODE_MUTED)
- sprintf(showname, "[%s]", node->name);
- else if(node->username[0])
- sprintf(showname, "(%s)%s", node->username, node->name);
- else
- BLI_strncpy(showname, node->name, 128);
-
- snode_drawstring(snode, showname, (int)(rct->xmax - rct->xmin-18.0f -12.0f));
- }
-
- /* scale widget thing */
- BIF_ThemeColorShade(color_id, -10);
- dx= 10.0f;
- fdrawline(rct->xmax-dx, centy-4.0f, rct->xmax-dx, centy+4.0f);
- fdrawline(rct->xmax-dx-3.0f*snode->aspect, centy-4.0f, rct->xmax-dx-3.0f*snode->aspect, centy+4.0f);
-
- BIF_ThemeColorShade(color_id, +30);
- dx-= snode->aspect;
- fdrawline(rct->xmax-dx, centy-4.0f, rct->xmax-dx, centy+4.0f);
- fdrawline(rct->xmax-dx-3.0f*snode->aspect, centy-4.0f, rct->xmax-dx-3.0f*snode->aspect, centy+4.0f);
-
- /* sockets */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- socket_circle_draw(sock, NODE_SOCKSIZE);
- }
-
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- socket_circle_draw(sock, NODE_SOCKSIZE);
- }
-}
-
-static void node_draw_nodetree(ScrArea *sa, SpaceNode *snode, bNodeTree *ntree)
-{
- bNode *node;
- bNodeLink *link;
- int a;
-
- if(ntree==NULL) return; /* groups... */
-
- /* node lines */
- glEnable(GL_BLEND);
- glEnable( GL_LINE_SMOOTH );
- for(link= ntree->links.first; link; link= link->next)
- node_draw_link(snode, link);
- glDisable(GL_BLEND);
- glDisable( GL_LINE_SMOOTH );
-
- /* not selected first */
- for(a=0, node= ntree->nodes.first; node; node= node->next, a++) {
- node->nr= a; /* index of node in list, used for exec event code */
- if(!(node->flag & SELECT)) {
- if(node->flag & NODE_GROUP_EDIT);
- else if(node->flag & NODE_HIDDEN)
- node_draw_hidden(snode, node);
- else
- node_draw_basis(sa, snode, node);
- }
- }
-
- /* selected */
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if(node->flag & NODE_GROUP_EDIT);
- else if(node->flag & NODE_HIDDEN)
- node_draw_hidden(snode, node);
- else
- node_draw_basis(sa, snode, node);
- }
- }
-}
-
-/* fake links from groupnode to internal nodes */
-static void node_draw_group_links(SpaceNode *snode, bNode *gnode)
-{
- bNodeLink fakelink;
- bNodeSocket *sock;
-
- glEnable(GL_BLEND);
- glEnable(GL_LINE_SMOOTH);
-
- fakelink.tonode= fakelink.fromnode= gnode;
-
- for(sock= gnode->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- if(sock->tosock) {
- fakelink.fromsock= sock;
- fakelink.tosock= sock->tosock;
- node_draw_link(snode, &fakelink);
- }
- }
- }
-
- for(sock= gnode->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- if(sock->tosock) {
- fakelink.tosock= sock;
- fakelink.fromsock= sock->tosock;
- node_draw_link(snode, &fakelink);
- }
- }
- }
-
- glDisable(GL_BLEND);
- glDisable(GL_LINE_SMOOTH);
-}
-
-/* groups are, on creation, centered around 0,0 */
-static void node_draw_group(ScrArea *sa, SpaceNode *snode, bNode *gnode)
-{
- bNodeTree *ngroup= (bNodeTree *)gnode->id;
- bNodeSocket *sock;
- rctf rect= gnode->totr;
- char showname[128];
-
- /* backdrop header */
- glEnable(GL_BLEND);
- uiSetRoundBox(3);
- BIF_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70);
- gl_round_box(GL_POLYGON, rect.xmin, rect.ymax, rect.xmax, rect.ymax+NODE_DY, BASIS_RAD);
-
- /* backdrop body */
- BIF_ThemeColorShadeAlpha(TH_BACK, -8, -70);
- uiSetRoundBox(12);
- gl_round_box(GL_POLYGON, rect.xmin, rect.ymin, rect.xmax, rect.ymax, BASIS_RAD);
-
- /* selection outline */
- uiSetRoundBox(15);
- glColor4ub(200, 200, 200, 140);
- glEnable( GL_LINE_SMOOTH );
- gl_round_box(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax+NODE_DY, BASIS_RAD);
- glDisable( GL_LINE_SMOOTH );
- glDisable(GL_BLEND);
-
- /* backdrop title */
- BIF_ThemeColor(TH_TEXT_HI);
- ui_rasterpos_safe(rect.xmin+8.0f, rect.ymax+5.0f, snode->aspect);
-
- if(gnode->username[0]) {
- strcpy(showname,"(");
- strcat(showname, gnode->username);
- strcat(showname,") ");
- strcat(showname, ngroup->id.name+2);
- }
- else
- strcpy(showname, ngroup->id.name+2);
-
- BIF_DrawString(snode->curfont, showname, 0);
-
- /* links from groupsockets to the internal nodes */
- node_draw_group_links(snode, gnode);
-
- /* group sockets */
- for(sock= gnode->inputs.first; sock; sock= sock->next)
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- socket_circle_draw(sock, NODE_SOCKSIZE);
- for(sock= gnode->outputs.first; sock; sock= sock->next)
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
- socket_circle_draw(sock, NODE_SOCKSIZE);
-
- /* and finally the whole tree */
- node_draw_nodetree(sa, snode, ngroup);
-}
-
-
-
-static void nodes_panel_gpencil(short cntrl) // NODES_HANDLER_GREASEPENCIL
-{
- uiBlock *block;
- SpaceNode *snode;
-
- snode= curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "nodes_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(NODES_HANDLER_GREASEPENCIL); // for close and esc
- if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceNode", 100, 30, 318, 204)==0) return;
-
- /* we can only really draw stuff if there are nodes (otherwise no events are handled */
- if (snode->nodetree == NULL)
- return;
-
- /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
- if (snode->flag & SNODE_DISPGP) {
- if (snode->gpd == NULL)
- gpencil_data_setactive(curarea, gpencil_data_addnew());
- }
-
- if (snode->flag & SNODE_DISPGP) {
- bGPdata *gpd= snode->gpd;
- short newheight;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- /* draw button for showing gpencil settings and drawings */
- uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor (draw using Shift-LMB)");
-
- /* extend the panel if the contents won't fit */
- newheight= draw_gpencil_panel(block, gpd, curarea);
- uiNewPanelHeight(block, newheight);
- }
- else {
- uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
-}
-
-static void nodes_blockhandlers(ScrArea *sa)
-{
- SpaceNode *snode= sa->spacedata.first;
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(snode->blockhandler[a]) {
- case NODES_HANDLER_GREASEPENCIL:
- nodes_panel_gpencil(snode->blockhandler[a+1]);
- break;
- }
-
- /* clear action value for event */
- snode->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-}
-
-void drawnodespace(ScrArea *sa, void *spacedata)
-{
- SpaceNode *snode= sa->spacedata.first;
- float col[3];
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- calc_scrollrcts(sa, &(snode->v2d), sa->winx, sa->winy);
-
- myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- /* always free, blocks here have no unique identifier (1 block per node) */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- /* only set once */
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- glEnable(GL_MAP1_VERTEX_3);
-
- /* aspect+font, set each time */
- snode->aspect= (snode->v2d.cur.xmax - snode->v2d.cur.xmin)/((float)sa->winx);
- snode->curfont= uiSetCurFont_ext(snode->aspect);
-
- /* backdrop */
- draw_nodespace_back_pix(sa, snode);
-
- /* nodes */
- snode_set_context(snode);
-
- if(snode->nodetree) {
- bNode *node;
-
- /* for now, we set drawing coordinates on each redraw */
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_GROUP_EDIT)
- node_update_group(node);
- else if(node->flag & NODE_HIDDEN)
- node_update_hidden(node);
- else
- node_update(node);
- }
-
- node_draw_nodetree(sa, snode, snode->nodetree);
-
- /* active group */
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_GROUP_EDIT)
- node_draw_group(sa, snode, node);
- }
- }
-
- /* draw grease-pencil ('canvas' strokes) */
- if ((snode->flag & SNODE_DISPGP) && (snode->nodetree))
- draw_gpencil_2dview(sa, 1);
-
- /* restore viewport (not needed yet) */
- mywinset(sa->win);
-
- /* ortho at pixel level curarea */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- /* draw grease-pencil (screen strokes) */
- if ((snode->flag & SNODE_DISPGP) && (snode->nodetree))
- draw_gpencil_2dview(sa, 0);
-
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, snode->blockscale, snode->blockscale, snode->blockscale);
- nodes_blockhandlers(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-
- /* in the end, this is a delayed previewrender test, to allow buttons to be first */
- if(snode->flag & SNODE_DO_PREVIEW) {
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- snode->flag &= ~SNODE_DO_PREVIEW;
- }
-}
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
deleted file mode 100644
index 551ce874db8..00000000000
--- a/source/blender/src/drawobject.c
+++ /dev/null
@@ -1,5569 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "IMB_imbuf.h"
-
-
-#include "MTC_matrixops.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_constraint_types.h" // for drawing constraint
-#include "DNA_effect_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-// FSPARTICLE
-#include "DNA_object_fluidsim.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_edgehash.h"
-#include "BLI_rand.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_curve.h"
-#include "BKE_constraint.h" // for the get_constraint_target function
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_anim.h" //for the where_on_path function
-#include "BKE_particle.h"
-#include "BKE_property.h"
-#include "BKE_utildefines.h"
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_editarmature.h"
-#include "BIF_editdeform.h"
-#include "BIF_editmesh.h"
-#include "BIF_editparticle.h"
-#include "BIF_glutil.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_drawmesh.h"
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_sculptmode.h"
-#include "BDR_vpaint.h"
-
-#include "BSE_drawview.h"
-#include "BSE_node.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "nla.h"
-
-#include "BKE_deform.h"
-
-#include "GPU_draw.h"
-#include "GPU_material.h"
-#include "GPU_extensions.h"
-
-/* pretty stupid */
-/* extern Lattice *editLatt; already in BKE_lattice.h */
-/* editcurve.c */
-extern ListBase editNurb;
-/* editmball.c */
-extern ListBase editelems;
-
-static void draw_bounding_volume(Object *ob);
-
-static void drawcube_size(float size);
-static void drawcircle_size(float size);
-static void draw_empty_sphere(float size);
-static void draw_empty_cone(float size);
-
-/* check for glsl drawing */
-
-int draw_glsl_material(Object *ob, int dt)
-{
- if(!GPU_extensions_minimum_support())
- return 0;
- if(G.f & G_PICKSEL)
- return 0;
- if(!CHECK_OB_DRAWTEXTURE(G.vd, dt))
- return 0;
- if(ob==OBACT && (G.f & G_WEIGHTPAINT))
- return 0;
-
- return ((G.fileflags & G_FILE_GAME_MAT) &&
- (G.fileflags & G_FILE_GAME_MAT_GLSL) && (dt >= OB_SHADED));
-}
-
-static int check_material_alpha(Base *base, Object *ob, int glsl)
-{
- if(base->flag & OB_FROMDUPLI)
- return 0;
-
- if(G.f & G_PICKSEL)
- return 0;
-
- if(G.obedit && G.obedit->data==ob->data)
- return 0;
-
- return (glsl || (ob->dtx & OB_DRAWTRANSP));
-}
-
- /***/
-static unsigned int colortab[24]=
- {0x0, 0xFF88FF, 0xFFBBFF,
- 0x403000, 0xFFFF88, 0xFFFFBB,
- 0x104040, 0x66CCCC, 0x77CCCC,
- 0x104010, 0x55BB55, 0x66FF66,
- 0xFFFFFF
-};
-
-
-static float cube[8][3] = {
- {-1.0, -1.0, -1.0},
- {-1.0, -1.0, 1.0},
- {-1.0, 1.0, 1.0},
- {-1.0, 1.0, -1.0},
- { 1.0, -1.0, -1.0},
- { 1.0, -1.0, 1.0},
- { 1.0, 1.0, 1.0},
- { 1.0, 1.0, -1.0},
-};
-
-/* ----------------- OpenGL Circle Drawing - Tables for Optimised Drawing Speed ------------------ */
-/* 32 values of sin function (still same result!) */
-static float sinval[32] = {
- 0.00000000,
- 0.20129852,
- 0.39435585,
- 0.57126821,
- 0.72479278,
- 0.84864425,
- 0.93775213,
- 0.98846832,
- 0.99871650,
- 0.96807711,
- 0.89780453,
- 0.79077573,
- 0.65137248,
- 0.48530196,
- 0.29936312,
- 0.10116832,
- -0.10116832,
- -0.29936312,
- -0.48530196,
- -0.65137248,
- -0.79077573,
- -0.89780453,
- -0.96807711,
- -0.99871650,
- -0.98846832,
- -0.93775213,
- -0.84864425,
- -0.72479278,
- -0.57126821,
- -0.39435585,
- -0.20129852,
- 0.00000000
-};
-
-/* 32 values of cos function (still same result!) */
-static float cosval[32] ={
- 1.00000000,
- 0.97952994,
- 0.91895781,
- 0.82076344,
- 0.68896691,
- 0.52896401,
- 0.34730525,
- 0.15142777,
- -0.05064916,
- -0.25065253,
- -0.44039415,
- -0.61210598,
- -0.75875812,
- -0.87434661,
- -0.95413925,
- -0.99486932,
- -0.99486932,
- -0.95413925,
- -0.87434661,
- -0.75875812,
- -0.61210598,
- -0.44039415,
- -0.25065253,
- -0.05064916,
- 0.15142777,
- 0.34730525,
- 0.52896401,
- 0.68896691,
- 0.82076344,
- 0.91895781,
- 0.97952994,
- 1.00000000
-};
-
-/* flag is same as for draw_object */
-void drawaxes(float size, int flag, char drawtype)
-{
- int axis;
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
- float v3[3]= {0.0, 0.0, 0.0};
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- switch(drawtype) {
-
- case OB_PLAINAXES:
- for (axis=0; axis<3; axis++) {
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
-
- glBegin(GL_LINES);
-
- v1[axis]= size;
- v2[axis]= -size;
- glVertex3fv(v1);
- glVertex3fv(v2);
-
- glEnd();
- }
- break;
- case OB_SINGLE_ARROW:
-
- glBegin(GL_LINES);
- /* in positive z direction only */
- v1[2]= size;
- glVertex3fv(v1);
- glVertex3fv(v2);
- glEnd();
-
- /* square pyramid */
- glBegin(GL_TRIANGLES);
-
- v2[0]= size*0.035; v2[1] = size*0.035;
- v3[0]= size*-0.035; v3[1] = size*0.035;
- v2[2]= v3[2]= size*0.75;
-
- for (axis=0; axis<4; axis++) {
- if (axis % 2 == 1) {
- v2[0] *= -1;
- v3[1] *= -1;
- } else {
- v2[1] *= -1;
- v3[0] *= -1;
- }
-
- glVertex3fv(v1);
- glVertex3fv(v2);
- glVertex3fv(v3);
-
- }
- glEnd();
-
- break;
- case OB_CUBE:
- drawcube_size(size);
- break;
-
- case OB_CIRCLE:
- drawcircle_size(size);
- break;
-
- case OB_EMPTY_SPHERE:
- draw_empty_sphere(size);
- break;
-
- case OB_EMPTY_CONE:
- draw_empty_cone(size);
- break;
-
- case OB_ARROWS:
- default:
- for (axis=0; axis<3; axis++) {
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
- int arrow_axis= (axis==0)?1:0;
-
- glBegin(GL_LINES);
-
- v2[axis]= size;
- glVertex3fv(v1);
- glVertex3fv(v2);
-
- v1[axis]= size*0.8;
- v1[arrow_axis]= -size*0.125;
- glVertex3fv(v1);
- glVertex3fv(v2);
-
- v1[arrow_axis]= size*0.125;
- glVertex3fv(v1);
- glVertex3fv(v2);
-
- glEnd();
-
- v2[axis]+= size*0.125;
- glRasterPos3fv(v2);
-
- // patch for 3d cards crashing on glSelect for text drawing (IBM)
- if((flag & DRAW_PICKING) == 0) {
- if (axis==0)
- BMF_DrawString(G.font, "x");
- else if (axis==1)
- BMF_DrawString(G.font, "y");
- else
- BMF_DrawString(G.font, "z");
- }
- }
- break;
- }
-}
-
-/* circle for object centers, special_color is for library or ob users */
-static void drawcentercircle(float *vec, int selstate, int special_color)
-{
- View3D *v3d= G.vd;
- float size;
-
- size= v3d->persmat[0][3]*vec[0]+ v3d->persmat[1][3]*vec[1]+ v3d->persmat[2][3]*vec[2]+ v3d->persmat[3][3];
- size*= v3d->pixsize*((float)U.obcenter_dia*0.5f);
-
- /* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */
- if(v3d->zbuf) glDepthFunc(GL_ALWAYS);
- glEnable(GL_BLEND);
-
- if(special_color) {
-#ifdef WITH_VERSE
- if (selstate==VERSE) glColor4ub(0x00, 0xFF, 0x00, 155);
- else if (selstate==ACTIVE || selstate==SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155);
-#else
- if (selstate==ACTIVE || selstate==SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155);
-#endif
-
- else glColor4ub(0x55, 0xCC, 0xCC, 155);
- }
- else {
- if (selstate == ACTIVE) BIF_ThemeColorShadeAlpha(TH_ACTIVE, 0, -80);
- else if (selstate == SELECT) BIF_ThemeColorShadeAlpha(TH_SELECT, 0, -80);
- else if (selstate == DESELECT) BIF_ThemeColorShadeAlpha(TH_TRANSFORM, 0, -80);
- }
- drawcircball(GL_POLYGON, vec, size, v3d->viewinv);
-
- BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -30);
- drawcircball(GL_LINE_LOOP, vec, size, v3d->viewinv);
-
- glDisable(GL_BLEND);
- if(v3d->zbuf) glDepthFunc(GL_LEQUAL);
-}
-
-
-void drawsolidcube(float size)
-{
- float n[3];
-
- glPushMatrix();
- glScalef(size, size, size);
-
- n[0]=0; n[1]=0; n[2]=0;
- glBegin(GL_QUADS);
- n[0]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- n[0]=0;
- glEnd();
-
- glBegin(GL_QUADS);
- n[1]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]);
- n[1]=0;
- glEnd();
-
- glBegin(GL_QUADS);
- n[0]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]);
- n[0]=0;
- glEnd();
-
- glBegin(GL_QUADS);
- n[1]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- n[1]=0;
- glEnd();
-
- glBegin(GL_QUADS);
- n[2]= 1.0;
- glNormal3fv(n);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]);
- n[2]=0;
- glEnd();
-
- glBegin(GL_QUADS);
- n[2]= -1.0;
- glNormal3fv(n);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]);
- glEnd();
-
- glPopMatrix();
-}
-
-static void drawcube(void)
-{
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[3]); glVertex3fv(cube[7]);
- glEnd();
-}
-
-/* draws a cube on given the scaling of the cube, assuming that
- * all required matrices have been set (used for drawing empties)
- */
-static void drawcube_size(float size)
-{
- glBegin(GL_LINE_STRIP);
- glVertex3f(-size,-size,-size); glVertex3f(-size,-size,size);glVertex3f(-size,size,size); glVertex3f(-size,size,-size);
- glVertex3f(-size,-size,-size); glVertex3f(size,-size,-size);glVertex3f(size,-size,size); glVertex3f(size,size,size);
- glVertex3f(size,size,-size); glVertex3f(size,-size,-size);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(-size,-size,size); glVertex3f(size,-size,size);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(-size,size,size); glVertex3f(size,size,size);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(-size,size,-size); glVertex3f(size,size,-size);
- glEnd();
-}
-
-/* this is an unused (old) cube-drawing function based on a given size */
-#if 0
-static void drawcube_size(float *size)
-{
-
- glPushMatrix();
- glScalef(size[0], size[1], size[2]);
-
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]);
- glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]);
- glVertex3fv(cube[7]); glVertex3fv(cube[4]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[1]); glVertex3fv(cube[5]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[2]); glVertex3fv(cube[6]);
- glEnd();
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(cube[3]); glVertex3fv(cube[7]);
- glEnd();
-
- glPopMatrix();
-}
-#endif
-
-static void drawshadbuflimits(Lamp *la, float mat[][4])
-{
- float sta[3], end[3], lavec[3];
-
- lavec[0]= -mat[2][0];
- lavec[1]= -mat[2][1];
- lavec[2]= -mat[2][2];
- Normalize(lavec);
-
- sta[0]= mat[3][0]+ la->clipsta*lavec[0];
- sta[1]= mat[3][1]+ la->clipsta*lavec[1];
- sta[2]= mat[3][2]+ la->clipsta*lavec[2];
-
- end[0]= mat[3][0]+ la->clipend*lavec[0];
- end[1]= mat[3][1]+ la->clipend*lavec[1];
- end[2]= mat[3][2]+ la->clipend*lavec[2];
-
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(sta);
- glVertex3fv(end);
- glEnd();
-
- glPointSize(3.0);
- bglBegin(GL_POINTS);
- bglVertex3fv(sta);
- bglVertex3fv(end);
- bglEnd();
- glPointSize(1.0);
-}
-
-
-
-static void spotvolume(float *lvec, float *vvec, float inp)
-{
- /* camera is at 0,0,0 */
- float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle;
-
- Normalize(lvec);
- Normalize(vvec); /* is this the correct vector ? */
-
- Crossf(temp,vvec,lvec); /* equation for a plane through vvec en lvec */
- Crossf(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */
-
- Normalize(plane);
-
- /* now we've got two equations: one of a cone and one of a plane, but we have
- three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
-
- /* rotate around cross product vector of (0,0,1) and plane normal, dot product degrees */
- /* according definition, we derive cross product is (plane[1],-plane[0],0), en cos = plane[2]);*/
-
- /* translating this comment to english didnt really help me understanding the math! :-) (ton) */
-
- q[1] = plane[1] ;
- q[2] = -plane[0] ;
- q[3] = 0 ;
- Normalize(&q[1]);
-
- angle = saacos(plane[2])/2.0;
- co = cos(angle);
- si = sqrt(1-co*co);
-
- q[0] = co;
- q[1] *= si;
- q[2] *= si;
- q[3] = 0;
-
- QuatToMat3(q,mat1);
-
- /* rotate lamp vector now over acos(inp) degrees */
-
- vvec[0] = lvec[0] ;
- vvec[1] = lvec[1] ;
- vvec[2] = lvec[2] ;
-
- Mat3One(mat2);
- co = inp;
- si = sqrt(1-inp*inp);
-
- mat2[0][0] = co;
- mat2[1][0] = -si;
- mat2[0][1] = si;
- mat2[1][1] = co;
- Mat3MulMat3(mat3,mat2,mat1);
-
- mat2[1][0] = si;
- mat2[0][1] = -si;
- Mat3MulMat3(mat4,mat2,mat1);
- Mat3Transp(mat1);
-
- Mat3MulMat3(mat2,mat1,mat3);
- Mat3MulVecfl(mat2,lvec);
- Mat3MulMat3(mat2,mat1,mat4);
- Mat3MulVecfl(mat2,vvec);
-
- return;
-}
-
-static void drawlamp(Object *ob)
-{
- Lamp *la;
- View3D *v3d= G.vd;
- float vec[3], lvec[3], vvec[3], circrad, x,y,z;
- float pixsize, lampsize;
- float imat[4][4], curcol[4];
- char col[4];
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- la= ob->data;
-
- /* we first draw only the screen aligned & fixed scale stuff */
- glPushMatrix();
- myloadmatrix(G.vd->viewmat);
-
- /* lets calculate the scale: */
- pixsize= v3d->persmat[0][3]*ob->obmat[3][0]+ v3d->persmat[1][3]*ob->obmat[3][1]+ v3d->persmat[2][3]*ob->obmat[3][2]+ v3d->persmat[3][3];
- pixsize*= v3d->pixsize;
- lampsize= pixsize*((float)U.obcenter_dia*0.5f);
-
- /* and view aligned matrix: */
- Mat4CpyMat4(imat, G.vd->viewinv);
- Normalize(imat[0]);
- Normalize(imat[1]);
-
- /* for AA effects */
- glGetFloatv(GL_CURRENT_COLOR, curcol);
- curcol[3]= 0.6;
- glColor4fv(curcol);
-
- if(ob->id.us>1) {
- if (ob==OBACT || (ob->flag & SELECT)) glColor4ub(0x88, 0xFF, 0xFF, 155);
- else glColor4ub(0x77, 0xCC, 0xCC, 155);
- }
-
- /* Inner Circle */
- VECCOPY(vec, ob->obmat[3]);
- glEnable(GL_BLEND);
- drawcircball(GL_LINE_LOOP, vec, lampsize, imat);
- glDisable(GL_BLEND);
- drawcircball(GL_POLYGON, vec, lampsize, imat);
-
- /* restore */
- if(ob->id.us>1)
- glColor4fv(curcol);
-
- /* Outer circle */
- circrad = 3.0f*lampsize;
- drawcircball(GL_LINE_LOOP, vec, circrad, imat);
-
- setlinestyle(3);
-
- /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */
- if (la->type!=LA_HEMI) {
- if ((la->mode & LA_SHAD_RAY) ||
- ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT)) )
- {
- drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat);
- }
- }
-
- /* draw the pretty sun rays */
- if(la->type==LA_SUN) {
- float v1[3], v2[3], mat[3][3];
- short axis;
-
- /* setup a 45 degree rotation matrix */
- VecRotToMat3(imat[2], M_PI/4.0f, mat);
-
- /* vectors */
- VECCOPY(v1, imat[0]);
- VecMulf(v1, circrad*1.2f);
- VECCOPY(v2, imat[0]);
- VecMulf(v2, circrad*2.5f);
-
- /* center */
- glTranslatef(vec[0], vec[1], vec[2]);
-
- setlinestyle(3);
-
- glBegin(GL_LINES);
- for (axis=0; axis<8; axis++) {
- glVertex3fv(v1);
- glVertex3fv(v2);
- Mat3MulVecfl(mat, v1);
- Mat3MulVecfl(mat, v2);
- }
- glEnd();
-
- glTranslatef(-vec[0], -vec[1], -vec[2]);
-
- }
-
- if (la->type==LA_LOCAL) {
- if(la->mode & LA_SPHERE) {
- drawcircball(GL_LINE_LOOP, vec, la->dist, imat);
- }
- /* yafray: for photonlight also draw lightcone as for spot */
- }
-
- glPopMatrix(); /* back in object space */
- vec[0]= vec[1]= vec[2]= 0.0f;
-
- if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) {
- lvec[0]=lvec[1]= 0.0;
- lvec[2] = 1.0;
- x = G.vd->persmat[0][2];
- y = G.vd->persmat[1][2];
- z = G.vd->persmat[2][2];
- vvec[0]= x*ob->obmat[0][0] + y*ob->obmat[0][1] + z*ob->obmat[0][2];
- vvec[1]= x*ob->obmat[1][0] + y*ob->obmat[1][1] + z*ob->obmat[1][2];
- vvec[2]= x*ob->obmat[2][0] + y*ob->obmat[2][1] + z*ob->obmat[2][2];
-
- y = cos( M_PI*la->spotsize/360.0 );
- spotvolume(lvec, vvec, y);
- x = -la->dist;
- lvec[0] *= x ;
- lvec[1] *= x ;
- lvec[2] *= x;
- vvec[0] *= x ;
- vvec[1] *= x ;
- vvec[2] *= x;
-
- /* draw the angled sides of the cone */
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vvec);
- glVertex3fv(vec);
- glVertex3fv(lvec);
- glEnd();
-
- z = x*sqrt(1.0 - y*y);
- x *= y;
-
- /* draw the circle/square at the end of the cone */
- glTranslatef(0.0, 0.0 , x);
- if(la->mode & LA_SQUARE) {
- vvec[0]= fabs(z);
- vvec[1]= fabs(z);
- vvec[2]= 0.0;
- glBegin(GL_LINE_LOOP);
- glVertex3fv(vvec);
- vvec[1]= -fabs(z);
- glVertex3fv(vvec);
- vvec[0]= -fabs(z);
- glVertex3fv(vvec);
- vvec[1]= fabs(z);
- glVertex3fv(vvec);
- glEnd();
- }
- else circ(0.0, 0.0, fabs(z));
-
- /* draw the circle/square representing spotbl */
- if(la->type==LA_SPOT) {
- float spotblcirc = fabs(z)*(1 - pow(la->spotblend, 2));
- /* make sure the line is always visible - prevent it from reaching the outer border (or 0)
- * values are kinda arbitrary - just what seemed to work well */
- if (spotblcirc == 0) spotblcirc = 0.15;
- else if (spotblcirc == fabs(z)) spotblcirc = fabs(z) - 0.07;
- circ(0.0, 0.0, spotblcirc);
- }
-
- }
- else if ELEM(la->type, LA_HEMI, LA_SUN) {
-
- /* draw the line from the circle along the dist */
- glBegin(GL_LINE_STRIP);
- vec[2] = -circrad;
- glVertex3fv(vec);
- vec[2]= -la->dist;
- glVertex3fv(vec);
- glEnd();
-
- if(la->type==LA_HEMI) {
- /* draw the hemisphere curves */
- short axis, steps, dir;
- float outdist, zdist, mul;
- vec[0]=vec[1]=vec[2]= 0.0;
- outdist = 0.14; mul = 1.4; dir = 1;
-
- setlinestyle(4);
- /* loop over the 4 compass points, and draw each arc as a LINE_STRIP */
- for (axis=0; axis<4; axis++) {
- float v[3]= {0.0, 0.0, 0.0};
- zdist = 0.02;
-
- glBegin(GL_LINE_STRIP);
-
- for (steps=0; steps<6; steps++) {
- if (axis == 0 || axis == 1) { /* x axis up, x axis down */
- /* make the arcs start at the edge of the energy circle */
- if (steps == 0) v[0] = dir*circrad;
- else v[0] = v[0] + dir*(steps*outdist);
- } else if (axis == 2 || axis == 3) { /* y axis up, y axis down */
- /* make the arcs start at the edge of the energy circle */
- if (steps == 0) v[1] = dir*circrad;
- else v[1] = v[1] + dir*(steps*outdist);
- }
-
- v[2] = v[2] - steps*zdist;
-
- glVertex3fv(v);
-
- zdist = zdist * mul;
- }
-
- glEnd();
- /* flip the direction */
- dir = -dir;
- }
- }
- } else if(la->type==LA_AREA) {
- setlinestyle(3);
- if(la->area_shape==LA_AREA_SQUARE)
- fdrawbox(-la->area_size*0.5, -la->area_size*0.5, la->area_size*0.5, la->area_size*0.5);
- else if(la->area_shape==LA_AREA_RECT)
- fdrawbox(-la->area_size*0.5, -la->area_sizey*0.5, la->area_size*0.5, la->area_sizey*0.5);
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(0.0,0.0,-circrad);
- glVertex3f(0.0,0.0,-la->dist);
- glEnd();
- }
-
- /* and back to viewspace */
- myloadmatrix(G.vd->viewmat);
- VECCOPY(vec, ob->obmat[3]);
-
- setlinestyle(0);
-
- if(la->type==LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
- drawshadbuflimits(la, ob->obmat);
- }
-
- BIF_GetThemeColor4ubv(TH_LAMP, col);
- glColor4ub(col[0], col[1], col[2], col[3]);
-
- glEnable(GL_BLEND);
-
- if (vec[2]>0) vec[2] -= circrad;
- else vec[2] += circrad;
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec);
- vec[2]= 0;
- glVertex3fv(vec);
- glEnd();
-
- glPointSize(2.0);
- glBegin(GL_POINTS);
- glVertex3fv(vec);
- glEnd();
- glPointSize(1.0);
-
- glDisable(GL_BLEND);
-
- /* restore for drawing extra stuff */
- glColor3fv(curcol);
-
-}
-
-static void draw_limit_line(float sta, float end, unsigned int col)
-{
- glBegin(GL_LINES);
- glVertex3f(0.0, 0.0, -sta);
- glVertex3f(0.0, 0.0, -end);
- glEnd();
-
- glPointSize(3.0);
- glBegin(GL_POINTS);
- cpack(col);
- glVertex3f(0.0, 0.0, -sta);
- glVertex3f(0.0, 0.0, -end);
- glEnd();
- glPointSize(1.0);
-}
-
-
-/* yafray: draw camera focus point (cross, similar to aqsis code in tuhopuu) */
-/* qdn: now also enabled for Blender to set focus point for defocus composit node */
-static void draw_focus_cross(float dist, float size)
-{
- glBegin(GL_LINES);
- glVertex3f(-size, 0.f, -dist);
- glVertex3f(size, 0.f, -dist);
- glVertex3f(0.f, -size, -dist);
- glVertex3f(0.f, size, -dist);
- glEnd();
-}
-
-/* flag similar to draw_object() */
-static void drawcamera(Object *ob, int flag)
-{
- /* a standing up pyramid with (0,0,0) as top */
- Camera *cam;
- World *wrld;
- float vec[8][4], tmat[4][4], fac, facx, facy, depth;
- int i;
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- cam= ob->data;
-
- glDisable(GL_LIGHTING);
- glDisable(GL_CULL_FACE);
-
- if(G.vd->persp>=2 && cam->type==CAM_ORTHO && ob==G.vd->camera) {
- facx= 0.5*cam->ortho_scale*1.28;
- facy= 0.5*cam->ortho_scale*1.024;
- depth= -cam->clipsta-0.1;
- }
- else {
- fac= cam->drawsize;
- if(G.vd->persp>=2 && ob==G.vd->camera) fac= cam->clipsta+0.1; /* that way it's always visible */
-
- depth= - fac*cam->lens/16.0;
- facx= fac*1.28;
- facy= fac*1.024;
- }
-
- vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.001; /* GLBUG: for picking at iris Entry (well thats old!) */
- vec[1][0]= facx; vec[1][1]= facy; vec[1][2]= depth;
- vec[2][0]= facx; vec[2][1]= -facy; vec[2][2]= depth;
- vec[3][0]= -facx; vec[3][1]= -facy; vec[3][2]= depth;
- vec[4][0]= -facx; vec[4][1]= facy; vec[4][2]= depth;
-
- glBegin(GL_LINE_LOOP);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[2]);
- glVertex3fv(vec[3]);
- glVertex3fv(vec[4]);
- glEnd();
-
-
- if(G.vd->persp>=2 && ob==G.vd->camera) return;
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec[2]);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[4]);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[3]);
- glEnd();
-
-
- /* arrow on top */
- vec[0][2]= depth;
-
-
- /* draw an outline arrow for inactive cameras and filled
- * for active cameras. We actually draw both outline+filled
- * for active cameras so the wire can be seen side-on */
- for (i=0;i<2;i++) {
- if (i==0) glBegin(GL_LINE_LOOP);
- else if (i==1 && (ob == G.vd->camera)) glBegin(GL_TRIANGLES);
- else break;
-
- vec[0][0]= -0.7*cam->drawsize;
- vec[0][1]= 1.1*cam->drawsize;
- glVertex3fv(vec[0]);
-
- vec[0][0]= 0.0;
- vec[0][1]= 1.8*cam->drawsize;
- glVertex3fv(vec[0]);
-
- vec[0][0]= 0.7*cam->drawsize;
- vec[0][1]= 1.1*cam->drawsize;
- glVertex3fv(vec[0]);
-
- glEnd();
- }
-
- if(flag==0) {
- if(cam->flag & (CAM_SHOWLIMITS+CAM_SHOWMIST)) {
- myloadmatrix(G.vd->viewmat);
- Mat4CpyMat4(vec, ob->obmat);
- Mat4Ortho(vec);
- mymultmatrix(vec);
-
- MTC_Mat4SwapMat4(G.vd->persmat, tmat);
- mygetsingmatrix(G.vd->persmat);
-
- 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);
- }
-
- wrld= G.scene->world;
- if(cam->flag & CAM_SHOWMIST)
- if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF);
-
- MTC_Mat4SwapMat4(G.vd->persmat, tmat);
- }
- }
-}
-
-static void lattice_draw_verts(Lattice *lt, DispList *dl, short sel)
-{
- BPoint *bp = lt->def;
- float *co = dl?dl->verts:NULL;
- int u, v, w;
-
- BIF_ThemeColor(sel?TH_VERTEX_SELECT:TH_VERTEX);
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
- bglBegin(GL_POINTS);
-
- for(w=0; w<lt->pntsw; w++) {
- int wxt = (w==0 || w==lt->pntsw-1);
- for(v=0; v<lt->pntsv; v++) {
- int vxt = (v==0 || v==lt->pntsv-1);
- for(u=0; u<lt->pntsu; u++, bp++, co+=3) {
- int uxt = (u==0 || u==lt->pntsu-1);
- if(!(lt->flag & LT_OUTSIDE) || uxt || vxt || wxt) {
- if(bp->hide==0) {
- if((bp->f1 & SELECT)==sel) {
- bglVertex3fv(dl?co:bp->vec);
- }
- }
- }
- }
- }
- }
-
- glPointSize(1.0);
- bglEnd();
-}
-
-void lattice_foreachScreenVert(void (*func)(void *userData, BPoint *bp, int x, int y), void *userData)
-{
- int i, N = editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- DispList *dl = find_displist(&G.obedit->disp, DL_VERTS);
- float *co = dl?dl->verts:NULL;
- BPoint *bp = editLatt->def;
- float pmat[4][4], vmat[4][4];
- short s[2];
-
- view3d_get_object_project_mat(curarea, G.obedit, pmat, vmat);
-
- for (i=0; i<N; i++, bp++, co+=3) {
- if (bp->hide==0) {
- view3d_project_short_clip(curarea, dl?co:bp->vec, s, pmat, vmat);
- func(userData, bp, s[0], s[1]);
- }
- }
-}
-
-static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, int use_wcol)
-{
- int index = ((w*lt->pntsv + v)*lt->pntsu) + u;
-
- if(use_wcol) {
- float col[3];
- MDeformWeight *mdw= get_defweight (lt->dvert+index, use_wcol-1);
-
- weight_to_rgb(mdw?mdw->weight:0.0f, col, col+1, col+2);
- glColor3fv(col);
- }
-
- if (dl) {
- glVertex3fv(&dl->verts[index*3]);
- } else {
- glVertex3fv(lt->def[index].vec);
- }
-}
-
-/* lattice color is hardcoded, now also shows weightgroup values in edit mode */
-static void drawlattice(Object *ob)
-{
- Lattice *lt;
- DispList *dl;
- int u, v, w;
- int use_wcol= 0;
-
- lt= (ob==G.obedit)?editLatt:ob->data;
-
- /* now we default make displist, this will modifiers work for non animated case */
- if(ob->disp.first==NULL)
- lattice_calc_modifiers(ob);
- dl= find_displist(&ob->disp, DL_VERTS);
-
- if(ob==G.obedit) {
- cpack(0x004000);
-
- if(ob->defbase.first && lt->dvert) {
- use_wcol= ob->actdef;
- glShadeModel(GL_SMOOTH);
- }
- }
-
- glBegin(GL_LINES);
- for(w=0; w<lt->pntsw; w++) {
- int wxt = (w==0 || w==lt->pntsw-1);
- for(v=0; v<lt->pntsv; v++) {
- int vxt = (v==0 || v==lt->pntsv-1);
- for(u=0; u<lt->pntsu; u++) {
- int uxt = (u==0 || u==lt->pntsu-1);
-
- if(w && ((uxt || vxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u, v, w-1, use_wcol);
- drawlattice__point(lt, dl, u, v, w, use_wcol);
- }
- if(v && ((uxt || wxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u, v-1, w, use_wcol);
- drawlattice__point(lt, dl, u, v, w, use_wcol);
- }
- if(u && ((vxt || wxt) || !(lt->flag & LT_OUTSIDE))) {
- drawlattice__point(lt, dl, u-1, v, w, use_wcol);
- drawlattice__point(lt, dl, u, v, w, use_wcol);
- }
- }
- }
- }
- glEnd();
-
- /* restoration for weight colors */
- if(use_wcol)
- glShadeModel(GL_FLAT);
-
- if(ob==G.obedit) {
- if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- lattice_draw_verts(lt, dl, 0);
- lattice_draw_verts(lt, dl, 1);
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- }
-}
-
-/* ***************** ******************** */
-
-static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } *data = userData;
- EditVert *eve = EM_get_vert_for_index(index);
- short s[2];
-
- if (eve->h==0) {
- if (data->clipVerts) {
- view3d_project_short_clip(curarea, co, s, data->pmat, data->vmat);
- } else {
- view3d_project_short_noclip(curarea, co, s, data->pmat);
- }
-
- data->func(data->userData, eve, s[0], s[1], index);
- }
-}
-void mesh_foreachScreenVert(void (*func)(void *userData, EditVert *eve, int x, int y, int index), void *userData, int clipVerts)
-{
- struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } data;
- DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- data.func = func;
- data.userData = userData;
- data.clipVerts = clipVerts;
-
- view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat);
-
- EM_init_index_arrays(1, 0, 0);
- dm->foreachMappedVert(dm, mesh_foreachScreenVert__mapFunc, &data);
- EM_free_index_arrays();
-
- dm->release(dm);
-}
-
-static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co)
-{
- struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } *data = userData;
- EditEdge *eed = EM_get_edge_for_index(index);
- short s[2][2];
-
- if (eed->h==0) {
- if (data->clipVerts==1) {
- view3d_project_short_clip(curarea, v0co, s[0], data->pmat, data->vmat);
- view3d_project_short_clip(curarea, v1co, s[1], data->pmat, data->vmat);
- } else {
- view3d_project_short_noclip(curarea, v0co, s[0], data->pmat);
- view3d_project_short_noclip(curarea, v1co, s[1], data->pmat);
-
- if (data->clipVerts==2) {
- if (!(s[0][0]>=0 && s[0][1]>= 0 && s[0][0]<curarea->winx && s[0][1]<curarea->winy))
- if (!(s[1][0]>=0 && s[1][1]>= 0 && s[1][0]<curarea->winx && s[1][1]<curarea->winy))
- return;
- }
- }
-
- data->func(data->userData, eed, s[0][0], s[0][1], s[1][0], s[1][1], index);
- }
-}
-void mesh_foreachScreenEdge(void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts)
-{
- struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } data;
- DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- data.func = func;
- data.userData = userData;
- data.clipVerts = clipVerts;
-
- view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat);
-
- EM_init_index_arrays(0, 1, 0);
- dm->foreachMappedEdge(dm, mesh_foreachScreenEdge__mapFunc, &data);
- EM_free_index_arrays();
-
- dm->release(dm);
-}
-
-static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *no)
-{
- struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; float pmat[4][4], vmat[4][4]; } *data = userData;
- EditFace *efa = EM_get_face_for_index(index);
- short s[2];
-
- if (efa && efa->h==0 && efa->fgonf!=EM_FGON) {
- view3d_project_short_clip(curarea, cent, s, data->pmat, data->vmat);
-
- data->func(data->userData, efa, s[0], s[1], index);
- }
-}
-void mesh_foreachScreenFace(void (*func)(void *userData, EditFace *efa, int x, int y, int index), void *userData)
-{
- struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; float pmat[4][4], vmat[4][4]; } data;
- DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- data.func = func;
- data.userData = userData;
-
- view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat);
-
- EM_init_index_arrays(0, 0, 1);
- dm->foreachMappedFaceCenter(dm, mesh_foreachScreenFace__mapFunc, &data);
- EM_free_index_arrays();
-
- dm->release(dm);
-}
-
-void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y), void *userData)
-{
- float pmat[4][4], vmat[4][4];
- short s[2];
- Nurb *nu;
- int i;
-
- view3d_get_object_project_mat(curarea, G.obedit, pmat, vmat);
-
- for (nu= editNurb.first; nu; nu=nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- for (i=0; i<nu->pntsu; i++) {
- BezTriple *bezt = &nu->bezt[i];
-
- if(bezt->hide==0) {
- if (G.f & G_HIDDENHANDLES) {
- view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat);
- if (s[0] != IS_CLIPPED)
- func(userData, nu, NULL, bezt, 1, s[0], s[1]);
- } else {
- view3d_project_short_clip(curarea, bezt->vec[0], s, pmat, vmat);
- if (s[0] != IS_CLIPPED)
- func(userData, nu, NULL, bezt, 0, s[0], s[1]);
- view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat);
- if (s[0] != IS_CLIPPED)
- func(userData, nu, NULL, bezt, 1, s[0], s[1]);
- view3d_project_short_clip(curarea, bezt->vec[2], s, pmat, vmat);
- if (s[0] != IS_CLIPPED)
- func(userData, nu, NULL, bezt, 2, s[0], s[1]);
- }
- }
- }
- }
- else {
- for (i=0; i<nu->pntsu*nu->pntsv; i++) {
- BPoint *bp = &nu->bp[i];
-
- if(bp->hide==0) {
- view3d_project_short_clip(curarea, bp->vec, s, pmat, vmat);
- func(userData, nu, bp, NULL, -1, s[0], s[1]);
- }
- }
- }
- }
-}
-
-/* ************** DRAW MESH ****************** */
-
-/* First section is all the "simple" draw routines,
- * ones that just pass some sort of primitive to GL,
- * with perhaps various options to control lighting,
- * color, etc.
- *
- * These routines should not have user interface related
- * logic!!!
- */
-
-static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent, float *no)
-{
- EditFace *efa = EM_get_face_for_index(index);
-
- if (efa->h==0 && efa->fgonf!=EM_FGON) {
- glVertex3fv(cent);
- glVertex3f( cent[0] + no[0]*G.scene->editbutsize,
- cent[1] + no[1]*G.scene->editbutsize,
- cent[2] + no[2]*G.scene->editbutsize);
- }
-}
-static void draw_dm_face_normals(DerivedMesh *dm) {
- glBegin(GL_LINES);
- dm->foreachMappedFaceCenter(dm, draw_dm_face_normals__mapFunc, 0);
- glEnd();
-}
-
-static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *no)
-{
- EditFace *efa = EM_get_face_for_index(index);
- int sel = *((int*) userData);
-
- if (efa->h==0 && efa->fgonf!=EM_FGON && (efa->f&SELECT)==sel) {
- bglVertex3fv(cent);
- }
-}
-static void draw_dm_face_centers(DerivedMesh *dm, int sel)
-{
- bglBegin(GL_POINTS);
- dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, &sel);
- bglEnd();
-}
-
-static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- EditVert *eve = EM_get_vert_for_index(index);
-
- if (eve->h==0) {
- glVertex3fv(co);
-
- if (no_f) {
- glVertex3f( co[0] + no_f[0]*G.scene->editbutsize,
- co[1] + no_f[1]*G.scene->editbutsize,
- co[2] + no_f[2]*G.scene->editbutsize);
- } else {
- glVertex3f( co[0] + no_s[0]*G.scene->editbutsize/32767.0f,
- co[1] + no_s[1]*G.scene->editbutsize/32767.0f,
- co[2] + no_s[2]*G.scene->editbutsize/32767.0f);
- }
- }
-}
-static void draw_dm_vert_normals(DerivedMesh *dm) {
- glBegin(GL_LINES);
- dm->foreachMappedVert(dm, draw_dm_vert_normals__mapFunc, NULL);
- glEnd();
-}
-
- /* Draw verts with color set based on selection */
-static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- struct { int sel; EditVert *eve_act; } * data = userData;
- EditVert *eve = EM_get_vert_for_index(index);
-
- if (eve->h==0 && (eve->f&SELECT)==data->sel) {
- /* draw active larger - need to stop/start point drawing for this :/ */
- if (eve==data->eve_act) {
- float size = BIF_GetThemeValuef(TH_VERTEX_SIZE);
- BIF_ThemeColor4(TH_EDITMESH_ACTIVE);
-
- bglEnd();
-
- glPointSize(size);
- bglBegin(GL_POINTS);
- bglVertex3fv(co);
- bglEnd();
-
- BIF_ThemeColor4(data->sel?TH_VERTEX_SELECT:TH_VERTEX);
- glPointSize(size);
- bglBegin(GL_POINTS);
- } else {
- bglVertex3fv(co);
- }
- }
-}
-static void draw_dm_verts(DerivedMesh *dm, int sel, EditVert *eve_act)
-{
- struct { int sel; EditVert *eve_act; } data;
- data.sel = sel;
- data.eve_act = eve_act;
-
- bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data);
- bglEnd();
-}
-
- /* Draw edges with color set based on selection */
-static int draw_dm_edges_sel__setDrawOptions(void *userData, int index)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
- //unsigned char **cols = userData, *col;
- struct { unsigned char *baseCol, *selCol, *actCol; EditEdge *eed_act; } * data = userData;
- unsigned char *col;
-
- if (eed->h==0) {
- if (eed==data->eed_act) {
- glColor4ubv(data->actCol);
- } else {
- if (eed->f&SELECT) {
- col = data->selCol;
- } else {
- col = data->baseCol;
- }
- /* no alpha, this is used so a transparent color can disable drawing unselected edges in editmode */
- if (col[3]==0) return 0;
-
- glColor4ubv(col);
- }
- return 1;
- } else {
- return 0;
- }
-}
-static void draw_dm_edges_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol, unsigned char *actCol, EditEdge *eed_act)
-{
- struct { unsigned char *baseCol, *selCol, *actCol; EditEdge *eed_act; } data;
-
- data.baseCol = baseCol;
- data.selCol = selCol;
- data.actCol = actCol;
- data.eed_act = eed_act;
- dm->drawMappedEdges(dm, draw_dm_edges_sel__setDrawOptions, &data);
-}
-
- /* Draw edges */
-static int draw_dm_edges__setDrawOptions(void *userData, int index)
-{
- return EM_get_edge_for_index(index)->h==0;
-}
-static void draw_dm_edges(DerivedMesh *dm)
-{
- dm->drawMappedEdges(dm, draw_dm_edges__setDrawOptions, NULL);
-}
-
- /* Draw edges with color interpolated based on selection */
-static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index)
-{
- return EM_get_edge_for_index(index)->h==0;
-}
-static void draw_dm_edges_sel_interp__setDrawInterpOptions(void *userData, int index, float t)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
- unsigned char **cols = userData;
- unsigned char *col0 = cols[(eed->v1->f&SELECT)?1:0];
- unsigned char *col1 = cols[(eed->v2->f&SELECT)?1:0];
-
- glColor4ub( col0[0] + (col1[0]-col0[0])*t,
- col0[1] + (col1[1]-col0[1])*t,
- col0[2] + (col1[2]-col0[2])*t,
- col0[3] + (col1[3]-col0[3])*t);
-}
-static void draw_dm_edges_sel_interp(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol)
-{
- unsigned char *cols[2];
- cols[0] = baseCol;
- cols[1] = selCol;
- dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_sel_interp__setDrawInterpOptions, cols);
-}
-
- /* Draw only seam edges */
-static int draw_dm_edges_seams__setDrawOptions(void *userData, int index)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
-
- return (eed->h==0 && eed->seam);
-}
-static void draw_dm_edges_seams(DerivedMesh *dm)
-{
- dm->drawMappedEdges(dm, draw_dm_edges_seams__setDrawOptions, NULL);
-}
-
- /* Draw only sharp edges */
-static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
-
- return (eed->h==0 && eed->sharp);
-}
-static void draw_dm_edges_sharp(DerivedMesh *dm)
-{
- dm->drawMappedEdges(dm, draw_dm_edges_sharp__setDrawOptions, NULL);
-}
-
-
- /* Draw faces with color set based on selection
- * return 2 for the active face so it renders with stipple enabled */
-static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *drawSmooth_r)
-{
- struct { unsigned char *cols[3]; EditFace *efa_act; } * data = userData;
- EditFace *efa = EM_get_face_for_index(index);
- unsigned char *col;
-
- if (efa->h==0) {
- if (efa == data->efa_act) {
- glColor4ubv(data->cols[2]);
- return 2; /* stipple */
- } else {
- col = data->cols[(efa->f&SELECT)?1:0];
- if (col[3]==0) return 0;
- glColor4ubv(col);
- return 1;
- }
- }
- return 0;
-}
-
-/* also draws the active face */
-static void draw_dm_faces_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol, unsigned char *actCol, EditFace *efa_act)
-{
- struct { unsigned char *cols[3]; EditFace *efa_act; } data;
- data.cols[0] = baseCol;
- data.cols[1] = selCol;
- data.cols[2] = actCol;
- data.efa_act = efa_act;
-
- dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, &data, 0);
-}
-
-static int draw_dm_creases__setDrawOptions(void *userData, int index)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
-
- if (eed->h==0 && eed->crease!=0.0) {
- BIF_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, eed->crease);
- return 1;
- } else {
- return 0;
- }
-}
-static void draw_dm_creases(DerivedMesh *dm)
-{
- glLineWidth(3.0);
- dm->drawMappedEdges(dm, draw_dm_creases__setDrawOptions, NULL);
- glLineWidth(1.0);
-}
-
-static int draw_dm_bweights__setDrawOptions(void *userData, int index)
-{
- EditEdge *eed = EM_get_edge_for_index(index);
-
- if (eed->h==0 && eed->bweight!=0.0) {
- BIF_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, eed->bweight);
- return 1;
- } else {
- return 0;
- }
-}
-static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- EditVert *eve = EM_get_vert_for_index(index);
-
- if (eve->h==0 && eve->bweight!=0.0) {
- BIF_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, eve->bweight);
- bglVertex3fv(co);
- }
-}
-static void draw_dm_bweights(DerivedMesh *dm)
-{
- if (G.scene->selectmode & SCE_SELECT_VERTEX) {
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE) + 2);
- bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, NULL);
- bglEnd();
- }
- else {
- glLineWidth(3.0);
- dm->drawMappedEdges(dm, draw_dm_bweights__setDrawOptions, NULL);
- glLineWidth(1.0);
- }
-}
-
-/* Second section of routines: Combine first sets to form fancy
- * drawing routines (for example rendering twice to get overlays).
- *
- * Also includes routines that are basic drawing but are too
- * specialized to be split out (like drawing creases or measurements).
- */
-
-/* EditMesh drawing routines*/
-
-static void draw_em_fancy_verts(EditMesh *em, DerivedMesh *cageDM, EditVert *eve_act)
-{
- int sel;
-
- if(G.vd->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select
-
- for (sel=0; sel<2; sel++) {
- char col[4], fcol[4];
- int pass;
-
- BIF_GetThemeColor3ubv(sel?TH_VERTEX_SELECT:TH_VERTEX, col);
- BIF_GetThemeColor3ubv(sel?TH_FACE_DOT:TH_WIRE, fcol);
-
- for (pass=0; pass<2; pass++) {
- float size = BIF_GetThemeValuef(TH_VERTEX_SIZE);
- float fsize = BIF_GetThemeValuef(TH_FACEDOT_SIZE);
-
- if (pass==0) {
- if(G.vd->zbuf && !(G.vd->flag&V3D_ZBUF_SELECT)) {
- glDisable(GL_DEPTH_TEST);
-
- glEnable(GL_BLEND);
- } else {
- continue;
- }
-
- size = (size>2.1?size/2.0:size);
- fsize = (fsize>2.1?fsize/2.0:fsize);
- col[3] = fcol[3] = 100;
- } else {
- col[3] = fcol[3] = 255;
- }
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- glPointSize(size);
- glColor4ubv((GLubyte *)col);
- draw_dm_verts(cageDM, sel, eve_act);
- }
-
- if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) {
- glPointSize(fsize);
- glColor4ubv((GLubyte *)fcol);
- draw_dm_face_centers(cageDM, sel);
- }
-
- if (pass==0) {
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- }
- }
- }
-
- if(G.vd->zbuf) glDepthMask(1);
- glPointSize(1.0);
-}
-
-static void draw_em_fancy_edges(DerivedMesh *cageDM, short sel_only, EditEdge *eed_act)
-{
- int pass;
- unsigned char wireCol[4], selCol[4], actCol[4];
-
- /* since this function does transparant... */
- BIF_GetThemeColor4ubv(TH_EDGE_SELECT, (char *)selCol);
- BIF_GetThemeColor4ubv(TH_WIRE, (char *)wireCol);
- BIF_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, (char *)actCol);
-
- /* when sel only is used, dont render wire, only selected, this is used for
- * textured draw mode when the 'edges' option is disabled */
- if (sel_only)
- wireCol[3] = 0;
-
- for (pass=0; pass<2; pass++) {
- /* show wires in transparant when no zbuf clipping for select */
- if (pass==0) {
- if (G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) {
- glEnable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- selCol[3] = 85;
- if (!sel_only) wireCol[3] = 85;
- } else {
- continue;
- }
- } else {
- selCol[3] = 255;
- if (!sel_only) wireCol[3] = 255;
- }
-
- if(G.scene->selectmode == SCE_SELECT_FACE) {
- draw_dm_edges_sel(cageDM, wireCol, selCol, actCol, eed_act);
- }
- else if( (G.f & G_DRAWEDGES) || (G.scene->selectmode & SCE_SELECT_EDGE) ) {
- if(cageDM->drawMappedEdgesInterp && (G.scene->selectmode & SCE_SELECT_VERTEX)) {
- glShadeModel(GL_SMOOTH);
- draw_dm_edges_sel_interp(cageDM, wireCol, selCol);
- glShadeModel(GL_FLAT);
- } else {
- draw_dm_edges_sel(cageDM, wireCol, selCol, actCol, eed_act);
- }
- }
- else {
- if (!sel_only) {
- glColor4ubv(wireCol);
- draw_dm_edges(cageDM);
- }
- }
-
- if (pass==0) {
- glDisable(GL_BLEND);
- glEnable(GL_DEPTH_TEST);
- }
- }
-}
-
-#ifdef WITH_VERSE
-/*
- * draw some debug info about verse mesh (vertex indexes,
- * face indexes, status of )
- */
-static void draw_verse_debug(Object *ob, EditMesh *em)
-{
- struct EditVert *eve=NULL;
- struct EditFace *efa=NULL;
- float v1[3], v2[3], v3[3], v4[3], fvec[3], col[3];
- char val[32];
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0)
- glDisable(GL_DEPTH_TEST);
-
- if(G.vd->zbuf) bglPolygonOffset(5.0);
-
- BIF_GetThemeColor3fv(TH_TEXT, col);
- /* make color a bit more red */
- if(col[0]> 0.5) {col[1]*=0.7; col[2]*= 0.7;}
- else col[0]= col[0]*0.7 + 0.3;
- glColor3fv(col);
-
- /* draw IDs of verse vertexes */
- for(eve = em->verts.first; eve; eve = eve->next) {
- if(eve->vvert) {
- VecLerpf(fvec, ob->loc, eve->co, 1.1);
- glRasterPos3f(fvec[0], fvec[1], fvec[2]);
-
- sprintf(val, "%d", ((VerseVert*)eve->vvert)->id);
- BMF_DrawString(G.fonts, val);
- }
- }
-
- /* draw IDs of verse faces */
- for(efa = em->faces.first; efa; efa = efa->next) {
- if(efa->vface) {
- VECCOPY(v1, efa->v1->co);
- VECCOPY(v2, efa->v2->co);
- VECCOPY(v3, efa->v3->co);
- if(efa->v4) {
- VECCOPY(v4, efa->v4->co);
- glRasterPos3f(0.25*(v1[0]+v2[0]+v3[0]+v4[0]),
- 0.25*(v1[1]+v2[1]+v3[1]+v4[1]),
- 0.25*(v1[2]+v2[2]+v3[2]+v4[2]));
- }
- else {
- glRasterPos3f((v1[0]+v2[0]+v3[0])/3,
- (v1[1]+v2[1]+v3[1])/3,
- (v1[2]+v2[2]+v3[2])/3);
- }
-
- sprintf(val, "%d", ((VerseFace*)efa->vface)->id);
- BMF_DrawString(G.fonts, val);
-
- }
- }
-
- if(G.vd->zbuf) {
- glEnable(GL_DEPTH_TEST);
- bglPolygonOffset(0.0);
- }
-}
-#endif
-
-static void draw_em_measure_stats(Object *ob, EditMesh *em)
-{
- EditEdge *eed;
- EditFace *efa;
- float v1[3], v2[3], v3[3], v4[3];
- float fvec[3];
- char val[32]; /* Stores the measurement display text here */
- char conv_float[5]; /* Use a float conversion matching the grid size */
- float area, col[3]; /* area of the face, color of the text to draw */
-
- if(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))
- return;
-
- /* make the precission of the pronted value proportionate to the gridsize */
- if ((G.vd->grid) < 0.01)
- strcpy(conv_float, "%.6f");
- else if ((G.vd->grid) < 0.1)
- strcpy(conv_float, "%.5f");
- else if ((G.vd->grid) < 1.0)
- strcpy(conv_float, "%.4f");
- else if ((G.vd->grid) < 10.0)
- strcpy(conv_float, "%.3f");
- else
- strcpy(conv_float, "%.2f");
-
-
- if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0)
- glDisable(GL_DEPTH_TEST);
-
- if(G.vd->zbuf) bglPolygonOffset(5.0);
-
- if(G.f & G_DRAW_EDGELEN) {
- BIF_GetThemeColor3fv(TH_TEXT, col);
- /* make color a bit more red */
- if(col[0]> 0.5) {col[1]*=0.7; col[2]*= 0.7;}
- else col[0]= col[0]*0.7 + 0.3;
- glColor3fv(col);
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- /* draw non fgon edges, or selected edges, or edges next to selected verts while draging */
- if((eed->h != EM_FGON) && ((eed->f & SELECT) || (G.moving && ((eed->v1->f & SELECT) || (eed->v2->f & SELECT)) ))) {
- VECCOPY(v1, eed->v1->co);
- VECCOPY(v2, eed->v2->co);
-
- glRasterPos3f( 0.5*(v1[0]+v2[0]), 0.5*(v1[1]+v2[1]), 0.5*(v1[2]+v2[2]));
-
- if(G.vd->flag & V3D_GLOBAL_STATS) {
- Mat4MulVecfl(ob->obmat, v1);
- Mat4MulVecfl(ob->obmat, v2);
- }
-
- sprintf(val, conv_float, VecLenf(v1, v2));
- BMF_DrawString( G.fonts, val);
- }
- }
- }
-
- if(G.f & G_DRAW_FACEAREA) {
- extern int faceselectedOR(EditFace *efa, int flag); // editmesh.h shouldn't be in this file... ok for now?
-
- BIF_GetThemeColor3fv(TH_TEXT, col);
- /* make color a bit more green */
- if(col[1]> 0.5) {col[0]*=0.7; col[2]*= 0.7;}
- else col[1]= col[1]*0.7 + 0.3;
- glColor3fv(col);
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if((efa->f & SELECT) || (G.moving && faceselectedOR(efa, SELECT)) ) {
- VECCOPY(v1, efa->v1->co);
- VECCOPY(v2, efa->v2->co);
- VECCOPY(v3, efa->v3->co);
- if (efa->v4) {
- VECCOPY(v4, efa->v4->co);
- }
- if(G.vd->flag & V3D_GLOBAL_STATS) {
- Mat4MulVecfl(ob->obmat, v1);
- Mat4MulVecfl(ob->obmat, v2);
- Mat4MulVecfl(ob->obmat, v3);
- if (efa->v4) Mat4MulVecfl(ob->obmat, v4);
- }
-
- if (efa->v4)
- area= AreaQ3Dfl(v1, v2, v3, v4);
- else
- area = AreaT3Dfl(v1, v2, v3);
-
- sprintf(val, conv_float, area);
- glRasterPos3fv(efa->cent);
- BMF_DrawString( G.fonts, val);
- }
- }
- }
-
- if(G.f & G_DRAW_EDGEANG) {
- EditEdge *e1, *e2, *e3, *e4;
-
- BIF_GetThemeColor3fv(TH_TEXT, col);
- /* make color a bit more blue */
- if(col[2]> 0.5) {col[0]*=0.7; col[1]*= 0.7;}
- else col[2]= col[2]*0.7 + 0.3;
- glColor3fv(col);
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- VECCOPY(v1, efa->v1->co);
- VECCOPY(v2, efa->v2->co);
- VECCOPY(v3, efa->v3->co);
- if(efa->v4) {
- VECCOPY(v4, efa->v4->co);
- }
- else {
- VECCOPY(v4, v3);
- }
- if(G.vd->flag & V3D_GLOBAL_STATS) {
- Mat4MulVecfl(ob->obmat, v1);
- Mat4MulVecfl(ob->obmat, v2);
- Mat4MulVecfl(ob->obmat, v3);
- Mat4MulVecfl(ob->obmat, v4);
- }
-
- e1= efa->e1;
- e2= efa->e2;
- e3= efa->e3;
- if(efa->e4) e4= efa->e4; else e4= e3;
-
- /* Calculate the angles */
-
- if( (e4->f & e1->f & SELECT) || (G.moving && (efa->v1->f & SELECT)) ) {
- /* Vec 1 */
- sprintf(val,"%.3f", VecAngle3(v4, v1, v2));
- VecLerpf(fvec, efa->cent, efa->v1->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
- }
- if( (e1->f & e2->f & SELECT) || (G.moving && (efa->v2->f & SELECT)) ) {
- /* Vec 2 */
- sprintf(val,"%.3f", VecAngle3(v1, v2, v3));
- VecLerpf(fvec, efa->cent, efa->v2->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
- }
- if( (e2->f & e3->f & SELECT) || (G.moving && (efa->v3->f & SELECT)) ) {
- /* Vec 3 */
- if(efa->v4)
- sprintf(val,"%.3f", VecAngle3(v2, v3, v4));
- else
- sprintf(val,"%.3f", VecAngle3(v2, v3, v1));
- VecLerpf(fvec, efa->cent, efa->v3->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
- }
- /* Vec 4 */
- if(efa->v4) {
- if( (e3->f & e4->f & SELECT) || (G.moving && (efa->v4->f & SELECT)) ) {
- sprintf(val,"%.3f", VecAngle3(v3, v4, v1));
- VecLerpf(fvec, efa->cent, efa->v4->co, 0.8);
- glRasterPos3fv(fvec);
- BMF_DrawString( G.fonts, val);
- }
- }
- }
- }
-
- if(G.vd->zbuf) {
- glEnable(GL_DEPTH_TEST);
- bglPolygonOffset(0.0);
- }
-}
-
-static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth_r)
-{
- EditFace *efa = EM_get_face_for_index(index);
-
- if (efa->h==0) {
- GPU_enable_material(efa->mat_nr+1, NULL);
- return 1;
- }
- else
- return 0;
-}
-
-static int draw_em_fancy__setGLSLFaceOpts(void *userData, int index)
-{
- EditFace *efa = EM_get_face_for_index(index);
-
- return (efa->h==0);
-}
-
-static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, int dt)
-{
- Mesh *me = ob->data;
- EditFace *efa_act = EM_get_actFace(0); /* annoying but active faces is stored differently */
- EditEdge *eed_act = NULL;
- EditVert *eve_act = NULL;
-
- if (G.editMesh->selected.last) {
- EditSelection *ese = G.editMesh->selected.last;
- /* face is handeled above */
- /*if (ese->type == EDITFACE ) {
- efa_act = (EditFace *)ese->data;
- } else */ if ( ese->type == EDITEDGE ) {
- eed_act = (EditEdge *)ese->data;
- } else if ( ese->type == EDITVERT ) {
- eve_act = (EditVert *)ese->data;
- }
- }
-
- EM_init_index_arrays(1, 1, 1);
-
- if(dt>OB_WIRE) {
- if(CHECK_OB_DRAWTEXTURE(G.vd, dt)) {
- if(draw_glsl_material(ob, dt)) {
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-
- finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
- draw_em_fancy__setGLSLFaceOpts, NULL);
- GPU_disable_material();
-
- glFrontFace(GL_CCW);
- }
- else {
- draw_mesh_textured(ob, finalDM, 0);
- }
- }
- else {
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
-
- glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-
- finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, 0, 0);
-
- glFrontFace(GL_CCW);
- glDisable(GL_LIGHTING);
- }
-
- // Setup for drawing wire over, disable zbuffer
- // write to show selected edge wires better
- BIF_ThemeColor(TH_WIRE);
-
- bglPolygonOffset(1.0);
- glDepthMask(0);
- }
- else {
- if (cageDM!=finalDM) {
- BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.7);
- finalDM->drawEdges(finalDM, 1);
- }
- }
-
- if((G.f & (G_DRAWFACES)) || FACESEL_PAINT_TEST) { /* transp faces */
- unsigned char col1[4], col2[4], col3[4];
-
- BIF_GetThemeColor4ubv(TH_FACE, (char *)col1);
- BIF_GetThemeColor4ubv(TH_FACE_SELECT, (char *)col2);
- BIF_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, (char *)col3);
-
- glEnable(GL_BLEND);
- glDepthMask(0); // disable write in zbuffer, needed for nice transp
-
- /* dont draw unselected faces, only selected, this is MUCH nicer when texturing */
- if CHECK_OB_DRAWTEXTURE(G.vd, dt)
- col1[3] = 0;
-
- draw_dm_faces_sel(cageDM, col1, col2, col3, efa_act);
-
- glDisable(GL_BLEND);
- glDepthMask(1); // restore write in zbuffer
- } else if (efa_act) {
- /* even if draw faces is off it would be nice to draw the stipple face
- * Make all other faces zero alpha except for the active
- * */
- unsigned char col1[4], col2[4], col3[4];
- col1[3] = col2[3] = 0; /* dont draw */
- BIF_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, (char *)col3);
-
- glEnable(GL_BLEND);
- glDepthMask(0); // disable write in zbuffer, needed for nice transp
-
- draw_dm_faces_sel(cageDM, col1, col2, col3, efa_act);
-
- glDisable(GL_BLEND);
- glDepthMask(1); // restore write in zbuffer
-
- }
-
- /* here starts all fancy draw-extra over */
- if((G.f & G_DRAWEDGES)==0 && CHECK_OB_DRAWTEXTURE(G.vd, dt)) {
- /* we are drawing textures and 'G_DRAWEDGES' is disabled, dont draw any edges */
-
- /* only draw selected edges otherwise there is no way of telling if a face is selected */
- draw_em_fancy_edges(cageDM, 1, eed_act);
-
- } else {
- if(G.f & G_DRAWSEAMS) {
- BIF_ThemeColor(TH_EDGE_SEAM);
- glLineWidth(2);
-
- draw_dm_edges_seams(cageDM);
-
- glColor3ub(0,0,0);
- glLineWidth(1);
- }
-
- if(G.f & G_DRAWSHARP) {
- BIF_ThemeColor(TH_EDGE_SHARP);
- glLineWidth(2);
-
- draw_dm_edges_sharp(cageDM);
-
- glColor3ub(0,0,0);
- glLineWidth(1);
- }
-
- if(G.f & G_DRAWCREASES) {
- draw_dm_creases(cageDM);
- }
- if(G.f & G_DRAWBWEIGHTS) {
- draw_dm_bweights(cageDM);
- }
-
- draw_em_fancy_edges(cageDM, 0, eed_act);
- }
- if(ob==G.obedit) {
- retopo_matrix_update(G.vd);
-
- draw_em_fancy_verts(em, cageDM, eve_act);
-
- if(G.f & G_DRAWNORMALS) {
- BIF_ThemeColor(TH_NORMAL);
- draw_dm_face_normals(cageDM);
- }
- if(G.f & G_DRAW_VNORMALS) {
- BIF_ThemeColor(TH_NORMAL);
- draw_dm_vert_normals(cageDM);
- }
-
- if(G.f & (G_DRAW_EDGELEN|G_DRAW_FACEAREA|G_DRAW_EDGEANG))
- draw_em_measure_stats(ob, em);
-#ifdef WITH_VERSE
- if(em->vnode && (G.f & G_DRAW_VERSE_DEBUG))
- draw_verse_debug(ob, em);
-#endif
- }
-
- if(dt>OB_WIRE) {
- glDepthMask(1);
- bglPolygonOffset(0.0);
- GPU_disable_material();
- }
-
- EM_free_index_arrays();
-}
-
-/* Mesh drawing routines */
-
-static void draw_mesh_object_outline(Object *ob, DerivedMesh *dm)
-{
-
- if(G.vd->transp==0) { // not when we draw the transparent pass
- glLineWidth(2.0);
- glDepthMask(0);
-
- /* if transparent, we cannot draw the edges for solid select... edges have no material info.
- drawFacesSolid() doesn't draw the transparent faces */
- if(ob->dtx & OB_DRAWTRANSP) {
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- dm->drawFacesSolid(dm, GPU_enable_material);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- GPU_disable_material();
- }
- else {
- dm->drawEdges(dm, 0);
- }
-
- glLineWidth(1.0);
- glDepthMask(1);
- }
-}
-
-static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
-{
- *drawSmooth_r = 1;
- return 1;
-}
-
-static void draw_mesh_fancy(Base *base, int dt, int flag)
-{
- Object *ob= base->object;
- Mesh *me = ob->data;
- Material *ma= give_current_material(ob, 1);
- int hasHaloMat = (ma && (ma->mode&MA_HALO));
- int draw_wire = 0;
- int totvert, totedge, totface;
- DispList *dl;
- DerivedMesh *dm= mesh_get_derived_final(ob, get_viewedit_datamask());
-
- if(!dm)
- return;
-
- if (ob->dtx&OB_DRAWWIRE) {
- draw_wire = 2; /* draw wire after solid using zoffset and depth buffer adjusment */
- }
-
-#ifdef WITH_VERSE
- if(me->vnode) {
- struct VNode *vnode = (VNode*)me->vnode;
- struct VLayer *vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- struct VLayer *face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- if(vert_vlayer) totvert = vert_vlayer->dl.da.count;
- else totvert = 0;
- totedge = 0; /* total count of edge needn't to be zero, but verse doesn't know edges */
- if(face_vlayer) totface = face_vlayer->dl.da.count;
- else totface = 0;
- }
- else {
- totvert = dm->getNumVerts(dm);
- totedge = dm->getNumEdges(dm);
- totface = dm->getNumFaces(dm);
- }
-#else
- totvert = dm->getNumVerts(dm);
- totedge = dm->getNumEdges(dm);
- totface = dm->getNumFaces(dm);
-#endif
-
- /* vertexpaint, faceselect wants this, but it doesnt work for shaded? */
- if(dt!=OB_SHADED)
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-
- // Unwanted combination.
- if (ob==OBACT && FACESEL_PAINT_TEST) draw_wire = 0;
-
- if(dt==OB_BOUNDBOX) {
- draw_bounding_volume(ob);
- }
- else if(hasHaloMat || (totface==0 && totedge==0)) {
- glPointSize(1.5);
- dm->drawVerts(dm);
- glPointSize(1.0);
- }
- else if(dt==OB_WIRE || totface==0) {
- draw_wire = 1; /* draw wire only, no depth buffer stuff */
- }
- else if( (ob==OBACT && (G.f & G_TEXTUREPAINT || FACESEL_PAINT_TEST)) ||
- CHECK_OB_DRAWTEXTURE(G.vd, dt))
- {
- int faceselect= (ob==OBACT && FACESEL_PAINT_TEST);
-
- if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !(G.f&G_PICKSEL || FACESEL_PAINT_TEST) && !draw_wire) {
- draw_mesh_object_outline(ob, dm);
- }
-
- if(draw_glsl_material(ob, dt)) {
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-
- dm->drawFacesGLSL(dm, GPU_enable_material);
- if(get_ob_property(ob, "Text"))
- draw_mesh_text(ob, 1);
- GPU_disable_material();
-
- glFrontFace(GL_CCW);
- }
- else {
- draw_mesh_textured(ob, dm, faceselect);
- }
-
- if(!faceselect) {
- if(base->flag & SELECT)
- BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
- else
- BIF_ThemeColor(TH_WIRE);
-
- dm->drawLooseEdges(dm);
- }
- }
- else if(dt==OB_SOLID) {
- if((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire)
- draw_mesh_object_outline(ob, dm);
-
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED );
-
- glEnable(GL_LIGHTING);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-
- dm->drawFacesSolid(dm, GPU_enable_material);
- GPU_disable_material();
-
- glFrontFace(GL_CCW);
- glDisable(GL_LIGHTING);
-
- if(base->flag & SELECT) {
- BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
- } else {
- BIF_ThemeColor(TH_WIRE);
- }
- dm->drawLooseEdges(dm);
- }
- else if(dt==OB_SHADED) {
- int do_draw= 1; /* to resolve all G.f settings below... */
-
- if(ob==OBACT) {
- do_draw= 0;
- if( (G.f & G_WEIGHTPAINT)) {
- /* enforce default material settings */
- GPU_enable_material(0, NULL);
-
- /* but set default spec */
- glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
- glEnable(GL_COLOR_MATERIAL); /* according manpages needed */
- glColor3ub(120, 120, 120);
- glDisable(GL_COLOR_MATERIAL);
- /* diffuse */
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glEnable(GL_LIGHTING);
- glEnable(GL_COLOR_MATERIAL);
-
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1);
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_LIGHTING);
-
- GPU_disable_material();
- }
- else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) {
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1);
- }
- else if(G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) {
- glColor3f(1.0f, 1.0f, 1.0f);
- dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0);
- }
- else do_draw= 1;
- }
- if(do_draw) {
- dl = ob->disp.first;
- if (!dl || !dl->col1) {
- /* release and reload derivedmesh because it might be freed in
- shadeDispList due to a different datamask */
- dm->release(dm);
- shadeDispList(base);
- dl = find_displist(&ob->disp, DL_VERTCOL);
- dm= mesh_get_derived_final(ob, get_viewedit_datamask());
- }
-
- if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) {
- draw_mesh_object_outline(ob, dm);
- }
-
- /* False for dupliframe objects */
- if (dl) {
- unsigned int *obCol1 = dl->col1;
- unsigned int *obCol2 = dl->col2;
-
- dm->drawFacesColored(dm, me->flag&ME_TWOSIDED, (unsigned char*) obCol1, (unsigned char*) obCol2);
- }
-
- if(base->flag & SELECT) {
- BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
- } else {
- BIF_ThemeColor(TH_WIRE);
- }
- dm->drawLooseEdges(dm);
- }
- }
-
- /* set default draw color back for wire or for draw-extra later on */
- if (dt!=OB_WIRE) {
- if(base->flag & SELECT) {
- if(ob==OBACT && ob->flag & OB_FROMGROUP)
- BIF_ThemeColor(TH_GROUP_ACTIVE);
- else if(ob->flag & OB_FROMGROUP)
- BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16);
- else if(flag!=DRAW_CONSTCOLOR)
- BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
- else
- glColor3ub(80,80,80);
- } else {
- if (ob->flag & OB_FROMGROUP)
- BIF_ThemeColor(TH_GROUP);
- else {
- if(ob->dtx & OB_DRAWWIRE && flag==DRAW_CONSTCOLOR)
- glColor3ub(80,80,80);
- else
- BIF_ThemeColor(TH_WIRE);
- }
- }
- }
- if (draw_wire) {
- /* If drawing wire and drawtype is not OB_WIRE then we are
- * overlaying the wires.
- *
- * UPDATE bug #10290 - With this wire-only objects can draw
- * behind other objects depending on their order in the scene. 2x if 0's below. undo'ing zr's commit: r4059
- *
- * if draw wire is 1 then just drawing wire, no need for depth buffer stuff,
- * otherwise this wire is to overlay solid mode faces so do some depth buffer tricks.
- */
- if (dt!=OB_WIRE && draw_wire==2) {
- bglPolygonOffset(1.0);
- glDepthMask(0); // disable write in zbuffer, selected edge wires show better
- }
-
- dm->drawEdges(dm, (dt==OB_WIRE || totface==0));
-
- if (dt!=OB_WIRE && draw_wire==2) {
- glDepthMask(1);
- bglPolygonOffset(0.0);
- }
- }
-
- dm->release(dm);
-}
-
-/* returns 1 if nothing was drawn, for detecting to draw an object center */
-static int draw_mesh_object(Base *base, int dt, int flag)
-{
- Object *ob= base->object;
- Mesh *me= ob->data;
- int do_alpha_pass= 0, drawlinked= 0, retval= 0, glsl, check_alpha;
-
- if(G.obedit && ob!=G.obedit && ob->data==G.obedit->data) {
- if(ob_get_key(ob));
- else drawlinked= 1;
- }
-
- if(ob==G.obedit || drawlinked) {
- DerivedMesh *finalDM, *cageDM;
-
- if (G.obedit!=ob)
- finalDM = cageDM = editmesh_get_derived_base();
- else
- cageDM = editmesh_get_derived_cage_and_final(&finalDM,
- get_viewedit_datamask());
-
- if(dt>OB_WIRE) {
- // no transp in editmode, the fancy draw over goes bad then
- glsl = draw_glsl_material(ob, dt);
- GPU_set_object_materials(G.scene, ob, glsl, NULL);
- }
-
- draw_em_fancy(ob, G.editMesh, cageDM, finalDM, dt);
-
- if (G.obedit!=ob && finalDM)
- finalDM->release(finalDM);
- }
- else if(!G.obedit && (G.f & G_SCULPTMODE) &&(G.scene->sculptdata.flags & SCULPT_DRAW_FAST) &&
- OBACT==ob && !sculpt_modifiers_active(ob)) {
- sculptmode_draw_mesh(0);
- }
- else {
- /* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
- if(me->totface<=4 || boundbox_clip(ob->obmat, (ob->bb)? ob->bb: me->bb)) {
- glsl = draw_glsl_material(ob, dt);
- check_alpha = check_material_alpha(base, ob, glsl);
-
- if(dt==OB_SOLID || glsl) {
- GPU_set_object_materials(G.scene, ob, glsl,
- (check_alpha)? &do_alpha_pass: NULL);
- }
-
- draw_mesh_fancy(base, dt, flag);
-
- if(me->totvert==0) retval= 1;
- }
- }
-
- /* GPU_set_object_materials checked if this is needed */
- if(do_alpha_pass) add_view3d_after(G.vd, base, V3D_TRANSP, flag);
-
- return retval;
-}
-
-/* ************** DRAW DISPLIST ****************** */
-
-static int draw_index_wire= 1;
-static int index3_nors_incr= 1;
-
-/* returns 1 when nothing was drawn */
-static int drawDispListwire(ListBase *dlbase)
-{
- DispList *dl;
- int parts, nr;
- float *data;
-
- if(dlbase==NULL) return 1;
-
- glDisableClientState(GL_NORMAL_ARRAY);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- for(dl= dlbase->first; dl; dl= dl->next) {
- if(dl->parts==0 || dl->nr==0)
- continue;
-
- data= dl->verts;
-
- switch(dl->type) {
- case DL_SEGM:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for(parts=0; parts<dl->parts; parts++)
- glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr);
-
- break;
- case DL_POLY:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for(parts=0; parts<dl->parts; parts++)
- glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr);
-
- break;
- case DL_SURF:
-
- glVertexPointer(3, GL_FLOAT, 0, data);
-
- for(parts=0; parts<dl->parts; parts++) {
- if(dl->flag & DL_CYCL_U)
- glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr);
- else
- glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr);
- }
-
- for(nr=0; nr<dl->nr; nr++) {
- int ofs= 3*dl->nr;
-
- data= ( dl->verts )+3*nr;
- parts= dl->parts;
-
- if(dl->flag & DL_CYCL_V) glBegin(GL_LINE_LOOP);
- else glBegin(GL_LINE_STRIP);
-
- while(parts--) {
- glVertex3fv(data);
- data+=ofs;
- }
- glEnd();
-
- /* (ton) this code crashes for me when resolv is 86 or higher... no clue */
-// glVertexPointer(3, GL_FLOAT, sizeof(float)*3*dl->nr, data + 3*nr);
-// if(dl->flag & DL_CYCL_V)
-// glDrawArrays(GL_LINE_LOOP, 0, dl->parts);
-// else
-// glDrawArrays(GL_LINE_STRIP, 0, dl->parts);
- }
- break;
-
- case DL_INDEX3:
- if(draw_index_wire) {
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
- }
- break;
-
- case DL_INDEX4:
- if(draw_index_wire) {
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
- }
- break;
- }
- }
-
- glEnableClientState(GL_NORMAL_ARRAY);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-
- return 0;
-}
-
-static void drawDispListsolid(ListBase *lb, Object *ob, int glsl)
-{
- DispList *dl;
- GPUVertexAttribs gattribs;
- float *data, curcol[4];
- float *ndata;
-
- if(lb==NULL) return;
-
- /* for drawing wire */
- glGetFloatv(GL_CURRENT_COLOR, curcol);
-
- glEnable(GL_LIGHTING);
-
- if(ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
- else glFrontFace(GL_CCW);
-
- if(ob->type==OB_MBALL) { // mball always smooth shaded
- glShadeModel(GL_SMOOTH);
- }
-
- dl= lb->first;
- while(dl) {
- data= dl->verts;
- ndata= dl->nors;
-
- switch(dl->type) {
- case DL_SEGM:
- if(ob->type==OB_SURF) {
- int nr;
-
- glDisable(GL_LIGHTING);
- glColor3fv(curcol);
-
- // glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- // glDrawArrays(GL_LINE_STRIP, 0, dl->nr);
-
- glBegin(GL_LINE_STRIP);
- for(nr= dl->nr; nr; nr--, data+=3)
- glVertex3fv(data);
- glEnd();
-
- glEnable(GL_LIGHTING);
- }
- break;
- case DL_POLY:
- if(ob->type==OB_SURF) {
- int nr;
-
- BIF_ThemeColor(TH_WIRE);
- glDisable(GL_LIGHTING);
-
- /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */
- //glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- //glDrawArrays(GL_LINE_LOOP, 0, dl->nr);
-
- glBegin(GL_LINE_LOOP);
- for(nr= dl->nr; nr; nr--, data+=3)
- glVertex3fv(data);
- glEnd();
-
- glEnable(GL_LIGHTING);
- break;
- }
- case DL_SURF:
-
- if(dl->index) {
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- if(dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH);
- else glShadeModel(GL_FLAT);
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glNormalPointer(GL_FLOAT, 0, dl->nors);
- glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index);
- GPU_disable_material();
- }
- break;
-
- case DL_INDEX3:
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
-
- /* voor polys only one normal needed */
- if(index3_nors_incr==0) {
- glDisableClientState(GL_NORMAL_ARRAY);
- glNormal3fv(ndata);
- }
- else
- glNormalPointer(GL_FLOAT, 0, dl->nors);
-
- glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
- GPU_disable_material();
-
- if(index3_nors_incr==0)
- glEnableClientState(GL_NORMAL_ARRAY);
-
- break;
-
- case DL_INDEX4:
- GPU_enable_material(dl->col+1, (glsl)? &gattribs: NULL);
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glNormalPointer(GL_FLOAT, 0, dl->nors);
- glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
-
- GPU_disable_material();
-
- break;
- }
- dl= dl->next;
- }
-
- glShadeModel(GL_FLAT);
- glDisable(GL_LIGHTING);
- glFrontFace(GL_CCW);
-}
-
-static void drawDispListshaded(ListBase *lb, Object *ob)
-{
- DispList *dl, *dlob;
- unsigned int *cdata;
-
- if(lb==NULL) return;
-
- glShadeModel(GL_SMOOTH);
- glDisableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
-
- dl= lb->first;
- dlob= ob->disp.first;
- while(dl && dlob) {
-
- cdata= dlob->col1;
- if(cdata==NULL) break;
-
- switch(dl->type) {
- case DL_SURF:
- if(dl->index) {
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata);
- glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index);
- }
- break;
-
- case DL_INDEX3:
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata);
- glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index);
- break;
-
- case DL_INDEX4:
-
- glVertexPointer(3, GL_FLOAT, 0, dl->verts);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata);
- glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index);
- break;
- }
-
- dl= dl->next;
- dlob= dlob->next;
- }
-
- glShadeModel(GL_FLAT);
- glEnableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
-}
-
-/* returns 1 when nothing was drawn */
-static int drawDispList(Base *base, int dt)
-{
- Object *ob= base->object;
- ListBase *lb=0;
- DispList *dl;
- Curve *cu;
- int solid, retval= 0;
-
- solid= (dt > OB_WIRE);
-
- switch(ob->type) {
- case OB_FONT:
- case OB_CURVE:
- cu= ob->data;
-
- lb= &cu->disp;
-
- if(solid) {
- dl= lb->first;
- if(dl==NULL) return 1;
-
- if(dl->nors==0) addnormalsDispList(ob, lb);
- index3_nors_incr= 0;
-
- if( displist_has_faces(lb)==0) {
- draw_index_wire= 0;
- drawDispListwire(lb);
- draw_index_wire= 1;
- }
- else {
- if(draw_glsl_material(ob, dt)) {
- GPU_set_object_materials(G.scene, ob, 1, NULL);
- drawDispListsolid(lb, ob, 1);
- }
- else if(dt == OB_SHADED) {
- if(ob->disp.first==0) shadeDispList(base);
- drawDispListshaded(lb, ob);
- }
- else {
- GPU_set_object_materials(G.scene, ob, 0, NULL);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
- drawDispListsolid(lb, ob, 0);
- }
- if(ob==G.obedit && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0 && cu->ext2 == 0.0) {
- cpack(0);
- draw_index_wire= 0;
- drawDispListwire(lb);
- draw_index_wire= 1;
- }
- }
- index3_nors_incr= 1;
- }
- else {
- draw_index_wire= 0;
- retval= drawDispListwire(lb);
- draw_index_wire= 1;
- }
- break;
- case OB_SURF:
-
- lb= &((Curve *)ob->data)->disp;
-
- if(solid) {
- dl= lb->first;
- if(dl==NULL) return 1;
-
- if(dl->nors==NULL) addnormalsDispList(ob, lb);
-
- if(draw_glsl_material(ob, dt)) {
- GPU_set_object_materials(G.scene, ob, 1, NULL);
- drawDispListsolid(lb, ob, 1);
- }
- else if(dt==OB_SHADED) {
- if(ob->disp.first==NULL) shadeDispList(base);
- drawDispListshaded(lb, ob);
- }
- else {
- GPU_set_object_materials(G.scene, ob, 0, NULL);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
-
- drawDispListsolid(lb, ob, 0);
- }
- }
- else {
- retval= drawDispListwire(lb);
- }
- break;
- case OB_MBALL:
-
- if( is_basis_mball(ob)) {
- lb= &ob->disp;
- if(lb->first==NULL) makeDispListMBall(ob);
- if(lb->first==NULL) return 1;
-
- if(solid) {
-
- if(draw_glsl_material(ob, dt)) {
- GPU_set_object_materials(G.scene, ob, 1, NULL);
- drawDispListsolid(lb, ob, 1);
- }
- else if(dt == OB_SHADED) {
- dl= lb->first;
- if(dl && dl->col1==0) shadeDispList(base);
- drawDispListshaded(lb, ob);
- }
- else {
- GPU_set_object_materials(G.scene, ob, 0, NULL);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
-
- drawDispListsolid(lb, ob, 0);
- }
- }
- else{
- /* MetaBalls use DL_INDEX4 type of DispList */
- retval= drawDispListwire(lb);
- }
- }
- break;
- }
-
- return retval;
-}
-
-/* unified drawing of all new particle systems draw types except dupli ob & group */
-/* mostly tries to use vertex arrays for speed */
-
-/* 1. check that everything is ok & updated */
-/* 2. start initialising things */
-/* 3. initialize according to draw type */
-/* 4. allocate drawing data arrays */
-/* 5. start filling the arrays */
-/* 6. draw the arrays */
-/* 7. clean up */
-static void draw_new_particle_system(Base *base, ParticleSystem *psys, int dt)
-{
- View3D *v3d= G.vd;
- Object *ob=base->object;
- ParticleSystemModifierData *psmd;
- ParticleSettings *part;
- ParticleData *pars, *pa;
- ParticleKey state, *states=0;
- ParticleCacheKey *cache=0;
- Material *ma;
- Object *bb_ob=0;
- float vel[3], vec[3], vec2[3], imat[4][4], onevec[3]={0.0f,0.0f,0.0f}, bb_center[3];
- float timestep, pixsize=1.0, pa_size, pa_time, r_tilt;
- float cfra=bsystem_time(ob,(float)CFRA,0.0);
- float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3];
- float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f;
- int a, k, k_max=0, totpart, totpoint=0, draw_as, path_nbr=0;
- int path_possible=0, keys_possible=0, draw_keys=0, totchild=0;
- int select=ob->flag&SELECT, create_cdata=0;
- GLint polygonmode[2];
- char val[32];
-
-/* 1. */
- if(psys==0)
- return;
-
- part=psys->part;
- pars=psys->particles;
-
- if(part==0 || !psys_check_enabled(ob, psys))
- return;
-
- if(pars==0) return;
-
- if(!G.obedit && psys_in_edit_mode(psys)
- && psys->flag & PSYS_HAIR_DONE && part->draw_as==PART_DRAW_PATH)
- return;
-
- if(part->draw_as==PART_DRAW_NOT) return;
-
-/* 2. */
- if(part->phystype==PART_PHYS_KEYED){
- if(psys->flag & PSYS_FIRST_KEYED){
- if(psys->flag&PSYS_KEYED){
- select=psys_count_keyed_targets(ob,psys);
- if(psys->totkeyed==0)
- return;
- }
- }
- else
- return;
- }
-
- if(select){
- select=0;
- if(psys_get_current(ob)==psys)
- select=1;
- }
-
- psys->flag|=PSYS_DRAWING;
-
- if(part->type==PART_HAIR && !psys->childcache)
- totchild=0;
- else
- totchild=psys->totchild*part->disp/100;
-
- ma= give_current_material(ob,part->omat);
-
- if(ma) {
- ma_r = ma->r;
- ma_g = ma->g;
- ma_b = ma->b;
- }
-
- if(G.vd->zbuf) glDepthMask(1);
-
- if(select)
- cpack(0xFFFFFF);
- else if((ma) && (part->draw&PART_DRAW_MAT_COL)) {
- glColor3f(ma->r,ma->g,ma->b);
- create_cdata = 1;
- }
- else
- cpack(0);
-
- psmd= psys_get_modifier(ob,psys);
-
- timestep= psys_get_timestep(part);
-
- myloadmatrix(G.vd->viewmat);
-
- if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) {
- float mat[4][4];
- Mat4MulMat4(mat, psys->imat, ob->obmat);
- mymultmatrix(mat);
- }
-
- totpart=psys->totpart;
- draw_as=part->draw_as;
-
- if(part->flag&PART_GLOB_TIME)
- cfra=bsystem_time(0,(float)CFRA,0.0);
-
- if(psys->pathcache){
- path_possible=1;
- keys_possible=1;
- }
- if(draw_as==PART_DRAW_PATH && path_possible==0)
- draw_as=PART_DRAW_DOT;
-
- if(draw_as!=PART_DRAW_PATH && keys_possible && part->draw&PART_DRAW_KEYS){
- path_nbr=part->keys_step;
- draw_keys=1;
- }
-
-/* 3. */
- switch(draw_as){
- case PART_DRAW_DOT:
- if(part->draw_size)
- glPointSize(part->draw_size);
- else
- glPointSize(2.0); /* default dot size */
- break;
- case PART_DRAW_CIRC:
- /* calculate view aligned matrix: */
- Mat4CpyMat4(imat, G.vd->viewinv);
- Normalize(imat[0]);
- Normalize(imat[1]);
- /* no break! */
- case PART_DRAW_CROSS:
- case PART_DRAW_AXIS:
- /* lets calculate the scale: */
- pixsize= v3d->persmat[0][3]*ob->obmat[3][0]+ v3d->persmat[1][3]*ob->obmat[3][1]+ v3d->persmat[2][3]*ob->obmat[3][2]+ v3d->persmat[3][3];
- pixsize*= v3d->pixsize;
- if(part->draw_size==0.0)
- pixsize*=2.0;
- else
- pixsize*=part->draw_size;
- break;
- case PART_DRAW_OB:
- if(part->dup_ob==0)
- draw_as=PART_DRAW_DOT;
- else
- draw_as=0;
- break;
- case PART_DRAW_GR:
- if(part->dup_group==0)
- draw_as=PART_DRAW_DOT;
- else
- draw_as=0;
- break;
- case PART_DRAW_BB:
- if(G.vd->camera==0 && part->bb_ob==0){
- error("Billboards need an active camera or a target object!");
-
- draw_as=part->draw_as=PART_DRAW_DOT;
-
- if(part->draw_size)
- glPointSize(part->draw_size);
- else
- glPointSize(2.0); /* default dot size */
- }
- else if(part->bb_ob)
- bb_ob=part->bb_ob;
- else
- bb_ob=G.vd->camera;
-
- if(part->bb_align<PART_BB_VIEW)
- onevec[part->bb_align]=1.0f;
- break;
- case PART_DRAW_PATH:
- break;
- }
- if(part->draw & PART_DRAW_SIZE && part->draw_as!=PART_DRAW_CIRC){
- Mat4CpyMat4(imat, G.vd->viewinv);
- Normalize(imat[0]);
- Normalize(imat[1]);
- }
-
-/* 4. */
- if(draw_as && draw_as!=PART_DRAW_PATH){
- if(draw_as!=PART_DRAW_CIRC){
- switch(draw_as){
- case PART_DRAW_AXIS:
- case PART_DRAW_CROSS:
- if(draw_as!=PART_DRAW_CROSS || create_cdata)
- cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_cdata");
- vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_vdata");
- break;
- case PART_DRAW_LINE:
- if(create_cdata)
- cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*2*3*sizeof(float), "particle_cdata");
- vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*2*3*sizeof(float), "particle_vdata");
- break;
- case PART_DRAW_BB:
- if(create_cdata)
- cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_cdata");
- vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata");
- ndata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata");
- break;
- default:
- if(create_cdata)
- cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*3*sizeof(float), "particle_cdata");
- vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*3*sizeof(float), "particle_vdata");
- }
- }
-
- if(part->draw&PART_DRAW_VEL && draw_as!=PART_DRAW_LINE)
- vedata=MEM_callocN((totpart+totchild)*2*3*(path_nbr+1)*sizeof(float), "particle_vedata");
-
- vd=vdata;
- ved=vedata;
- cd=cdata;
- nd=ndata;
-
- psys->lattice=psys_get_lattice(ob,psys);
- }
-
- if(draw_as){
-/* 5. */
- for(a=0,pa=pars; a<totpart+totchild; a++, pa++){
- if(a<totpart){
- if(totchild && (part->draw&PART_DRAW_PARENT)==0) continue;
- if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue;
-
- pa_time=(cfra-pa->time)/pa->lifetime;
- pa_size=pa->size;
-
- if((part->flag&PART_ABS_TIME)==0){
- if(ma && ma->ipo){
- IpoCurve *icu;
-
- /* correction for lifetime */
- calc_ipo(ma->ipo, 100.0f*pa_time);
-
- for(icu = ma->ipo->curve.first; icu; icu=icu->next) {
- if(icu->adrcode == MA_COL_R)
- ma_r = icu->curval;
- else if(icu->adrcode == MA_COL_G)
- ma_g = icu->curval;
- else if(icu->adrcode == MA_COL_B)
- ma_b = icu->curval;
- }
- }
- if(part->ipo) {
- IpoCurve *icu;
-
- /* correction for lifetime */
- calc_ipo(part->ipo, 100*pa_time);
-
- for(icu = part->ipo->curve.first; icu; icu=icu->next) {
- if(icu->adrcode == PART_SIZE)
- pa_size = icu->curval;
- }
- }
- }
-
- r_tilt=1.0f+pa->r_ave[0];
-
- if(path_nbr){
- cache=psys->pathcache[a];
- k_max=(int)(cache->steps);
- }
- }
- else{
- ChildParticle *cpa= &psys->child[a-totpart];
-
- pa_time=psys_get_child_time(psys,cpa,cfra);
-
- if((part->flag&PART_ABS_TIME)==0) {
- if(ma && ma->ipo){
- IpoCurve *icu;
-
- /* correction for lifetime */
- calc_ipo(ma->ipo, 100.0f*pa_time);
-
- for(icu = ma->ipo->curve.first; icu; icu=icu->next) {
- if(icu->adrcode == MA_COL_R)
- ma_r = icu->curval;
- else if(icu->adrcode == MA_COL_G)
- ma_g = icu->curval;
- else if(icu->adrcode == MA_COL_B)
- ma_b = icu->curval;
- }
- }
- }
-
- pa_size=psys_get_child_size(psys,cpa,cfra,0);
-
- r_tilt=2.0f*cpa->rand[2];
- if(path_nbr){
- cache=psys->childcache[a-totpart];
- k_max=(int)(cache->steps);
- }
- }
-
- if(draw_as!=PART_DRAW_PATH){
- int next_pa=0;
- for(k=0; k<=path_nbr; k++){
- if(draw_keys){
- state.time=(float)k/(float)path_nbr;
- psys_get_particle_on_path(ob,psys,a,&state,1);
- }
- else if(path_nbr){
- if(k<=k_max){
- VECCOPY(state.co,(cache+k)->co);
- VECCOPY(state.vel,(cache+k)->vel);
- QUATCOPY(state.rot,(cache+k)->rot);
- }
- else
- continue;
- }
- else{
- state.time=cfra;
- if(psys_get_particle_state(ob,psys,a,&state,0)==0){
- next_pa=1;
- break;
- }
- }
-
- switch(draw_as){
- case PART_DRAW_DOT:
- if(cd) {
- cd[0]=ma_r;
- cd[1]=ma_g;
- cd[2]=ma_b;
- cd+=3;
- }
- if(vd){
- VECCOPY(vd,state.co) vd+=3;
- }
- break;
- case PART_DRAW_CROSS:
- case PART_DRAW_AXIS:
- vec[0]=2.0f*pixsize;
- vec[1]=vec[2]=0.0;
- QuatMulVecf(state.rot,vec);
- if(draw_as==PART_DRAW_AXIS){
- cd[1]=cd[2]=cd[4]=cd[5]=0.0;
- cd[0]=cd[3]=1.0;
- cd[6]=cd[8]=cd[9]=cd[11]=0.0;
- cd[7]=cd[10]=1.0;
- cd[13]=cd[12]=cd[15]=cd[16]=0.0;
- cd[14]=cd[17]=1.0;
- cd+=18;
-
- VECCOPY(vec2,state.co);
- }
- else {
- if(cd) {
- cd[0]=cd[3]=cd[6]=cd[9]=cd[12]=cd[15]=ma_r;
- cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]=ma_g;
- cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]=ma_b;
- cd+=18;
- }
- VECSUB(vec2,state.co,vec);
- }
-
- VECADD(vec,state.co,vec);
- VECCOPY(vd,vec); vd+=3;
- VECCOPY(vd,vec2); vd+=3;
-
- vec[1]=2.0f*pixsize;
- vec[0]=vec[2]=0.0;
- QuatMulVecf(state.rot,vec);
- if(draw_as==PART_DRAW_AXIS){
- VECCOPY(vec2,state.co);
- }
- else VECSUB(vec2,state.co,vec);
-
- VECADD(vec,state.co,vec);
- VECCOPY(vd,vec); vd+=3;
- VECCOPY(vd,vec2); vd+=3;
-
- vec[2]=2.0f*pixsize;
- vec[0]=vec[1]=0.0;
- QuatMulVecf(state.rot,vec);
- if(draw_as==PART_DRAW_AXIS){
- VECCOPY(vec2,state.co);
- }
- else VECSUB(vec2,state.co,vec);
-
- VECADD(vec,state.co,vec);
-
- VECCOPY(vd,vec); vd+=3;
- VECCOPY(vd,vec2); vd+=3;
- break;
- case PART_DRAW_LINE:
- VECCOPY(vec,state.vel);
- Normalize(vec);
- if(part->draw & PART_DRAW_VEL_LENGTH)
- VecMulf(vec,VecLength(state.vel));
- VECADDFAC(vd,state.co,vec,-part->draw_line[0]); vd+=3;
- VECADDFAC(vd,state.co,vec,part->draw_line[1]); vd+=3;
- if(cd) {
- cd[0]=cd[3]=ma_r;
- cd[1]=cd[4]=ma_g;
- cd[2]=cd[5]=ma_b;
- cd+=3;
- }
- break;
- case PART_DRAW_CIRC:
- if(create_cdata)
- glColor3f(ma_r,ma_g,ma_b);
- drawcircball(GL_LINE_LOOP, state.co, pixsize, imat);
- break;
- case PART_DRAW_BB:
- if(cd) {
- cd[0]=cd[3]=cd[6]=cd[9]=ma_r;
- cd[1]=cd[4]=cd[7]=cd[10]=ma_g;
- cd[2]=cd[5]=cd[8]=cd[11]=ma_b;
- cd+=12;
- }
- if(part->draw&PART_DRAW_BB_LOCK && part->bb_align==PART_BB_VIEW){
- VECCOPY(xvec,bb_ob->obmat[0]);
- Normalize(xvec);
- VECCOPY(yvec,bb_ob->obmat[1]);
- Normalize(yvec);
- VECCOPY(zvec,bb_ob->obmat[2]);
- Normalize(zvec);
- }
- else if(part->bb_align==PART_BB_VEL){
- float temp[3];
- VECCOPY(temp,state.vel);
- Normalize(temp);
- VECSUB(zvec,bb_ob->obmat[3],state.co);
- if(part->draw&PART_DRAW_BB_LOCK){
- float fac=-Inpf(zvec,temp);
- VECADDFAC(zvec,zvec,temp,fac);
- }
- Normalize(zvec);
- Crossf(xvec,temp,zvec);
- Normalize(xvec);
- Crossf(yvec,zvec,xvec);
- }
- else{
- VECSUB(zvec,bb_ob->obmat[3],state.co);
- if(part->draw&PART_DRAW_BB_LOCK)
- zvec[part->bb_align]=0.0f;
- Normalize(zvec);
-
- if(part->bb_align<PART_BB_VIEW)
- Crossf(xvec,onevec,zvec);
- else
- Crossf(xvec,bb_ob->obmat[1],zvec);
- Normalize(xvec);
- Crossf(yvec,zvec,xvec);
- }
-
- VECCOPY(vec,xvec);
- VECCOPY(vec2,yvec);
-
- VecMulf(xvec,cos(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI));
- VecMulf(vec2,sin(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI));
- VECADD(xvec,xvec,vec2);
-
- VecMulf(yvec,cos(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI));
- VecMulf(vec,-sin(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI));
- VECADD(yvec,yvec,vec);
-
- VecMulf(xvec,pa_size);
- VecMulf(yvec,pa_size);
-
- VECADDFAC(bb_center,state.co,xvec,part->bb_offset[0]);
- VECADDFAC(bb_center,bb_center,yvec,part->bb_offset[1]);
-
- VECADD(vd,bb_center,xvec);
- VECADD(vd,vd,yvec); vd+=3;
-
- VECSUB(vd,bb_center,xvec);
- VECADD(vd,vd,yvec); vd+=3;
-
- VECSUB(vd,bb_center,xvec);
- VECSUB(vd,vd,yvec); vd+=3;
-
- VECADD(vd,bb_center,xvec);
- VECSUB(vd,vd,yvec); vd+=3;
-
- VECCOPY(nd, zvec); nd+=3;
- VECCOPY(nd, zvec); nd+=3;
- VECCOPY(nd, zvec); nd+=3;
- VECCOPY(nd, zvec); nd+=3;
- break;
- }
-
- if(vedata){
- VECCOPY(ved,state.co);
- ved+=3;
- VECCOPY(vel,state.vel);
- VecMulf(vel,timestep);
- VECADD(ved,state.co,vel);
- ved+=3;
- }
-
- if(part->draw & PART_DRAW_SIZE){
- setlinestyle(3);
- drawcircball(GL_LINE_LOOP, state.co, pa_size, imat);
- setlinestyle(0);
- }
-
- totpoint++;
- }
- if(next_pa)
- continue;
- if(part->draw&PART_DRAW_NUM && !(G.f & G_RENDER_SHADOW)){
- /* in path drawing state.co is the end point */
- glRasterPos3f(state.co[0], state.co[1], state.co[2]);
- sprintf(val," %i",a);
- BMF_DrawString(G.font, val);
- }
- }
- }
-/* 6. */
-
- glGetIntegerv(GL_POLYGON_MODE, polygonmode);
- glDisableClientState(GL_NORMAL_ARRAY);
-
- if(draw_as != PART_DRAW_CIRC){
- if(draw_as==PART_DRAW_PATH){
- ParticleCacheKey **cache, *path;
- float *cd2=0,*cdata2=0;
-
- glEnableClientState(GL_VERTEX_ARRAY);
-
- if(dt > OB_WIRE) {
- glEnableClientState(GL_NORMAL_ARRAY);
-
- if(part->draw&PART_DRAW_MAT_COL)
- glEnableClientState(GL_COLOR_ARRAY);
-
- glEnable(GL_LIGHTING);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- glEnable(GL_COLOR_MATERIAL);
- }
- else {
- glDisableClientState(GL_NORMAL_ARRAY);
-
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_LIGHTING);
- BIF_ThemeColor(TH_WIRE);
- }
-
- if(totchild && (part->draw&PART_DRAW_PARENT)==0)
- totpart=0;
-
- cache=psys->pathcache;
- for(a=0, pa=psys->particles; a<totpart; a++, pa++){
- path=cache[a];
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
-
- if(dt > OB_WIRE) {
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
- if(part->draw&PART_DRAW_MAT_COL)
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
- }
-
- glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
- }
-
- cache=psys->childcache;
- for(a=0; a<totchild; a++){
- path=cache[a];
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
-
- if(dt > OB_WIRE) {
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
- if(part->draw&PART_DRAW_MAT_COL)
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col);
- }
-
- glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
- }
-
- if(dt > OB_WIRE) {
- if(part->draw&PART_DRAW_MAT_COL)
- glDisable(GL_COLOR_ARRAY);
- glDisable(GL_COLOR_MATERIAL);
- }
-
- if(cdata2)
- MEM_freeN(cdata2);
- cd2=cdata2=0;
-
- glLineWidth(1.0f);
-
- /* draw particle edit mode key points*/
- }
-
- if(draw_as!=PART_DRAW_PATH){
- glDisableClientState(GL_COLOR_ARRAY);
-
- if(vdata){
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, vdata);
- }
- else
- glDisableClientState(GL_VERTEX_ARRAY);
-
- if(ndata && dt>OB_WIRE){
- glEnableClientState(GL_NORMAL_ARRAY);
- glNormalPointer(GL_FLOAT, 0, ndata);
- glEnable(GL_LIGHTING);
- }
- else{
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisable(GL_LIGHTING);
- }
-
- if(cdata){
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(3, GL_FLOAT, 0, cdata);
- }
-
- switch(draw_as){
- case PART_DRAW_AXIS:
- case PART_DRAW_CROSS:
- glDrawArrays(GL_LINES, 0, 6*totpoint);
- break;
- case PART_DRAW_LINE:
- glDrawArrays(GL_LINES, 0, 2*totpoint);
- break;
- case PART_DRAW_BB:
- if(dt<=OB_WIRE)
- glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
-
- glDrawArrays(GL_QUADS, 0, 4*totpoint);
- break;
- default:
- glDrawArrays(GL_POINTS, 0, totpoint);
- break;
- }
- }
-
- }
- if(vedata){
- glDisableClientState(GL_COLOR_ARRAY);
- cpack(0xC0C0C0);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, vedata);
-
- glDrawArrays(GL_LINES, 0, 2*totpoint);
- }
-
- glPolygonMode(GL_FRONT, polygonmode[0]);
- glPolygonMode(GL_BACK, polygonmode[1]);
- }
-
-/* 7. */
-
- glDisable(GL_LIGHTING);
- glDisableClientState(GL_COLOR_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- if(states)
- MEM_freeN(states);
- if(vdata)
- MEM_freeN(vdata);
- if(vedata)
- MEM_freeN(vedata);
- if(cdata)
- MEM_freeN(cdata);
- if(ndata)
- MEM_freeN(ndata);
-
- psys->flag &= ~PSYS_DRAWING;
-
- if(psys->lattice){
- end_latt_deform();
- psys->lattice=0;
- }
-
- myloadmatrix(G.vd->viewmat);
- mymultmatrix(ob->obmat); // bring back local matrix for dtx
-}
-
-static void draw_particle_edit(Object *ob, ParticleSystem *psys, int dt)
-{
- ParticleEdit *edit = psys->edit;
- ParticleData *pa;
- ParticleCacheKey **path;
- ParticleEditKey *key;
- ParticleEditSettings *pset = PE_settings();
- int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed;
- char nosel[4], sel[4];
- float sel_col[3];
- float nosel_col[3];
- char val[32];
-
- /* create path and child path cache if it doesn't exist already */
- if(psys->pathcache==0){
- PE_hide_keys_time(psys,CFRA);
- psys_cache_paths(ob,psys,CFRA,0);
- }
- if(psys->pathcache==0)
- return;
-
- if(pset->flag & PE_SHOW_CHILD && psys->part->draw_as == PART_DRAW_PATH) {
- if(psys->childcache==0)
- psys_cache_child_paths(ob, psys, CFRA, 0);
- }
- else if(!(pset->flag & PE_SHOW_CHILD) && psys->childcache)
- free_child_path_cache(psys);
-
- /* opengl setup */
- if((G.vd->flag & V3D_ZBUF_SELECT)==0)
- glDisable(GL_DEPTH_TEST);
-
- myloadmatrix(G.vd->viewmat);
-
- /* get selection theme colors */
- BIF_GetThemeColor3ubv(TH_VERTEX_SELECT, sel);
- BIF_GetThemeColor3ubv(TH_VERTEX, nosel);
- sel_col[0]=(float)sel[0]/255.0f;
- sel_col[1]=(float)sel[1]/255.0f;
- sel_col[2]=(float)sel[2]/255.0f;
- nosel_col[0]=(float)nosel[0]/255.0f;
- nosel_col[1]=(float)nosel[1]/255.0f;
- nosel_col[2]=(float)nosel[2]/255.0f;
-
- if(psys->childcache)
- totchild = psys->totchildcache;
-
- /* draw paths */
- if(timed)
- glEnable(GL_BLEND);
-
- glEnableClientState(GL_VERTEX_ARRAY);
-
- if(dt > OB_WIRE) {
- /* solid shaded with lighting */
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
-
- glEnable(GL_COLOR_MATERIAL);
- glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
- }
- else {
- /* flat wire color */
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisable(GL_LIGHTING);
- BIF_ThemeColor(TH_WIRE);
- }
-
- /* only draw child paths with lighting */
- if(dt > OB_WIRE)
- glEnable(GL_LIGHTING);
-
- if(psys->part->draw_as == PART_DRAW_PATH) {
- for(i=0, path=psys->childcache; i<totchild; i++,path++){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co);
- if(dt > OB_WIRE) {
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel);
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col);
- }
-
- glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
- }
- }
-
- if(dt > OB_WIRE)
- glDisable(GL_LIGHTING);
-
- if(pset->brushtype == PE_BRUSH_WEIGHT) {
- glLineWidth(2.0f);
- glEnableClientState(GL_COLOR_ARRAY);
- glDisable(GL_LIGHTING);
- }
-
- /* draw parents last without lighting */
- for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co);
- if(dt > OB_WIRE)
- glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel);
- if(dt > OB_WIRE || pset->brushtype == PE_BRUSH_WEIGHT)
- glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col);
-
- glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1);
- }
-
- /* draw edit vertices */
- if(G.scene->selectmode!=SCE_SELECT_PATH){
- glDisableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- glDisable(GL_LIGHTING);
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- if(G.scene->selectmode==SCE_SELECT_POINT){
- float *cd=0,*cdata=0;
- cd=cdata=MEM_callocN(edit->totkeys*(timed?4:3)*sizeof(float), "particle edit color data");
-
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++){
- if(key->flag&PEK_SELECT){
- VECCOPY(cd,sel_col);
- }
- else{
- VECCOPY(cd,nosel_col);
- }
- if(timed)
- *(cd+3) = (key->flag&PEK_HIDE)?0.0f:1.0f;
- cd += (timed?4:3);
- }
- }
- cd=cdata;
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- if((pa->flag & PARS_HIDE)==0){
- glVertexPointer(3, GL_FLOAT, sizeof(ParticleEditKey), edit->keys[i]->world_co);
- glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd);
- glDrawArrays(GL_POINTS, 0, pa->totkey);
- }
- cd += (timed?4:3) * pa->totkey;
-
- if((pset->flag&PE_SHOW_TIME) && (pa->flag&PARS_HIDE)==0 && !(G.f & G_RENDER_SHADOW)){
- for(k=0, key=edit->keys[i]+k; k<pa->totkey; k++, key++){
- if(key->flag & PEK_HIDE) continue;
-
- glRasterPos3fv(key->world_co);
- sprintf(val," %.1f",*key->time);
- BMF_DrawString(G.font, val);
- }
- }
- }
- if(cdata)
- MEM_freeN(cdata);
- cd=cdata=0;
- }
- else if(G.scene->selectmode == SCE_SELECT_END){
- for(i=0, pa=psys->particles; i<totpart; i++, pa++){
- if((pa->flag & PARS_HIDE)==0){
- key = edit->keys[i] + pa->totkey - 1;
- if(key->flag & PEK_SELECT)
- glColor3fv(sel_col);
- else
- glColor3fv(nosel_col);
- /* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/
- glBegin(GL_POINTS);
- glVertex3fv(key->world_co);
- glEnd();
-
- if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){
- glRasterPos3fv(key->world_co);
- sprintf(val," %.1f",*key->time);
- BMF_DrawString(G.font, val);
- }
- }
- }
- }
- }
-
- glDisable(GL_BLEND);
- glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
- glDisableClientState(GL_COLOR_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnable(GL_DEPTH_TEST);
- glLineWidth(1.0f);
-
- mymultmatrix(ob->obmat); // bring back local matrix for dtx
- glPointSize(1.0);
-}
-
-unsigned int nurbcol[8]= {
- 0, 0x9090, 0x409030, 0x603080, 0, 0x40fff0, 0x40c033, 0xA090F0 };
-
-static void tekenhandlesN(Nurb *nu, short sel)
-{
- BezTriple *bezt;
- float *fp;
- unsigned int *col;
- int a;
-
- if(nu->hide || (G.f & G_HIDDENHANDLES)) return;
-
- glBegin(GL_LINES);
-
- if( (nu->type & 7)==1) {
- if(sel) col= nurbcol+4;
- else col= nurbcol;
-
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->hide==0) {
- if( (bezt->f2 & SELECT)==sel) {
- fp= bezt->vec[0];
-
- cpack(col[bezt->h1]);
- glVertex3fv(fp);
- glVertex3fv(fp+3);
-
- cpack(col[bezt->h2]);
- glVertex3fv(fp+3);
- glVertex3fv(fp+6);
- }
- else if( (bezt->f1 & SELECT)==sel) {
- fp= bezt->vec[0];
-
- cpack(col[bezt->h1]);
- glVertex3fv(fp);
- glVertex3fv(fp+3);
- }
- else if( (bezt->f3 & SELECT)==sel) {
- fp= bezt->vec[1];
-
- cpack(col[bezt->h2]);
- glVertex3fv(fp);
- glVertex3fv(fp+3);
- }
- }
- bezt++;
- }
- }
- glEnd();
-}
-
-static void tekenvertsN(Nurb *nu, short sel)
-{
- BezTriple *bezt;
- BPoint *bp;
- float size;
- int a;
-
- if(nu->hide) return;
-
- if(sel) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
-
- size= BIF_GetThemeValuef(TH_VERTEX_SIZE);
- glPointSize(size);
-
- bglBegin(GL_POINTS);
-
- if((nu->type & 7)==1) {
-
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->hide==0) {
- if (G.f & G_HIDDENHANDLES) {
- if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
- } else {
- if((bezt->f1 & SELECT)==sel) bglVertex3fv(bezt->vec[0]);
- if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]);
- if((bezt->f3 & SELECT)==sel) bglVertex3fv(bezt->vec[2]);
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->hide==0) {
- if((bp->f1 & SELECT)==sel) bglVertex3fv(bp->vec);
- }
- bp++;
- }
- }
-
- bglEnd();
- glPointSize(1.0);
-}
-
-static void draw_editnurb(Object *ob, Nurb *nurb, int sel)
-{
- Nurb *nu;
- BPoint *bp, *bp1;
- int a, b, ofs;
-
- nu= nurb;
- while(nu) {
- if(nu->hide==0) {
- switch(nu->type & 7) {
- case CU_POLY:
- cpack(nurbcol[3]);
- bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
- if(nu->flagu & 1) glBegin(GL_LINE_LOOP);
- else glBegin(GL_LINE_STRIP);
-
- for(a=0; a<nu->pntsu; a++, bp++) {
- glVertex3fv(bp->vec);
- }
-
- glEnd();
- }
- break;
- case CU_NURBS:
-
- bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
- bp1= bp;
- bp++;
- for(a=nu->pntsu-1; a>0; a--, bp++) {
- if(bp->hide==0 && bp1->hide==0) {
- if(sel) {
- if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT ) ) {
- cpack(nurbcol[5]);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
- else {
- if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
- else {
- cpack(nurbcol[1]);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
- }
- bp1= bp;
- }
- }
- if(nu->pntsv > 1) { /* surface */
-
- ofs= nu->pntsu;
- for(b=0; b<nu->pntsu; b++) {
- bp1= nu->bp+b;
- bp= bp1+ofs;
- for(a=nu->pntsv-1; a>0; a--, bp+=ofs) {
- if(bp->hide==0 && bp1->hide==0) {
- if(sel) {
- if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ) {
- cpack(nurbcol[7]);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
- else {
- if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) );
- else {
- cpack(nurbcol[3]);
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(bp->vec);
- glVertex3fv(bp1->vec);
- glEnd();
- }
- }
- }
- bp1= bp;
- }
- }
-
- }
- break;
- }
- }
- nu= nu->next;
- }
-}
-
-static void drawnurb(Base *base, Nurb *nurb, int dt)
-{
- Object *ob= base->object;
- Curve *cu = ob->data;
- Nurb *nu;
- BevList *bl;
-
- retopo_matrix_update(G.vd);
-
- /* DispList */
- BIF_ThemeColor(TH_WIRE);
- drawDispList(base, dt);
-
- if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- /* first non-selected handles */
- for(nu=nurb; nu; nu=nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- tekenhandlesN(nu, 0);
- }
- }
- draw_editnurb(ob, nurb, 0);
- draw_editnurb(ob, nurb, 1);
- /* selected handles */
- for(nu=nurb; nu; nu=nu->next) {
- if((nu->type & 7)==1) tekenhandlesN(nu, 1);
- tekenvertsN(nu, 0);
- }
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
- /* direction vectors for 3d curve paths
- when at its lowest, dont render normals */
- if(cu->flag & CU_3D && G.scene->editbutsize > 0.0015) {
- BIF_ThemeColor(TH_WIRE);
- for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) {
- BevPoint *bevp= (BevPoint *)(bl+1);
- int nr= bl->nr;
- int skip= nu->resolu/16;
-
- while (nr-->0) { /* accounts for empty bevel lists */
- float fac= bevp->radius * G.scene->editbutsize;
- float ox,oy,oz; // Offset perpendicular to the curve
- float dx,dy,dz; // Delta along the curve
-
- ox = fac*bevp->mat[0][0];
- oy = fac*bevp->mat[0][1];
- oz = fac*bevp->mat[0][2];
-
- dx = fac*bevp->mat[2][0];
- dy = fac*bevp->mat[2][1];
- dz = fac*bevp->mat[2][2];
-
- glBegin(GL_LINE_STRIP);
- glVertex3f(bevp->x - ox - dx, bevp->y - oy - dy, bevp->z - oz - dz);
- glVertex3f(bevp->x, bevp->y, bevp->z);
- glVertex3f(bevp->x + ox - dx, bevp->y + oy - dy, bevp->z + oz - dz);
- glEnd();
-
- bevp += skip+1;
- nr -= skip;
- }
- }
- }
-
- if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- for(nu=nurb; nu; nu=nu->next) {
- tekenvertsN(nu, 1);
- }
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-}
-
-/* draw a sphere for use as an empty drawtype */
-static void draw_empty_sphere (float size)
-{
- float cent=0;
- GLUquadricObj *qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
-
- glPushMatrix();
- glTranslatef(cent, cent, cent);
- glScalef(size, size, size);
- gluSphere(qobj, 1.0, 8, 5);
-
- glPopMatrix();
-
- gluDeleteQuadric(qobj);
-}
-
-/* draw a cone for use as an empty drawtype */
-static void draw_empty_cone (float size)
-{
- float cent=0;
- float radius;
- GLUquadricObj *qobj = gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
-
-
- glPushMatrix();
-
- radius = size;
- glTranslatef(cent,cent, cent);
- glScalef(radius, 2.0*size, radius);
- glRotatef(-90., 1.0, 0.0, 0.0);
- gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
-
- glPopMatrix();
-
- gluDeleteQuadric(qobj);
-}
-
-/* draw points on curve speed handles */
-static void curve_draw_speed(Object *ob)
-{
- Curve *cu= ob->data;
- IpoCurve *icu;
- BezTriple *bezt;
- float loc[4], dir[3];
- int a;
-
- if(cu->ipo==NULL)
- return;
-
- icu= cu->ipo->curve.first;
- if(icu==NULL || icu->totvert<2)
- return;
-
- glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) );
- bglBegin(GL_POINTS);
-
- for(a=0, bezt= icu->bezt; a<icu->totvert; a++, bezt++) {
- if( where_on_path(ob, bezt->vec[1][1], loc, dir)) {
- BIF_ThemeColor((bezt->f2 & SELECT) && ob==OBACT?TH_VERTEX_SELECT:TH_VERTEX);
- bglVertex3fv(loc);
- }
- }
-
- glPointSize(1.0);
- bglEnd();
-}
-
-
-static void tekentextcurs(void)
-{
- cpack(0);
-
- set_inverted_drawing(1);
- glBegin(GL_QUADS);
- glVertex2fv(G.textcurs[0]);
- glVertex2fv(G.textcurs[1]);
- glVertex2fv(G.textcurs[2]);
- glVertex2fv(G.textcurs[3]);
- glEnd();
- set_inverted_drawing(0);
-}
-
-static void drawspiral(float *cent, float rad, float tmat[][4], int start)
-{
- float vec[3], vx[3], vy[3];
- int a, tot=32;
- char inverse=0;
-
- if (start < 0) {
- inverse = 1;
- start *= -1;
- }
-
- VECCOPY(vx, tmat[0]);
- VECCOPY(vy, tmat[1]);
- VecMulf(vx, rad);
- VecMulf(vy, rad);
-
- VECCOPY(vec, cent);
-
- if (inverse==0) {
- for(a=0; a<tot; a++) {
- if (a+start>31)
- start=-a + 1;
- glBegin(GL_LINES);
- glVertex3fv(vec);
- vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)a/(float)tot) + *(cosval+a+start) * (vy[0] * (float)a/(float)tot);
- vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)a/(float)tot) + *(cosval+a+start) * (vy[1] * (float)a/(float)tot);
- vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)a/(float)tot) + *(cosval+a+start) * (vy[2] * (float)a/(float)tot);
- glVertex3fv(vec);
- glEnd();
- }
- }
- else {
- a=0;
- vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[0] * (float)(-a+31)/(float)tot);
- vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[1] * (float)(-a+31)/(float)tot);
- vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[2] * (float)(-a+31)/(float)tot);
- for(a=0; a<tot; a++) {
- if (a+start>31)
- start=-a + 1;
- glBegin(GL_LINES);
- glVertex3fv(vec);
- vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[0] * (float)(-a+31)/(float)tot);
- vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[1] * (float)(-a+31)/(float)tot);
- vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[2] * (float)(-a+31)/(float)tot);
- glVertex3fv(vec);
- glEnd();
- }
- }
-}
-
-/* draws a circle on x-z plane given the scaling of the circle, assuming that
- * all required matrices have been set (used for drawing empties)
- */
-static void drawcircle_size(float size)
-{
- float x, y;
- short degrees;
-
- glBegin(GL_LINE_LOOP);
-
- /* coordinates are: cos(degrees*11.25)=x, sin(degrees*11.25)=y, 0.0f=z */
- for (degrees=0; degrees<32; degrees++) {
- x= *(cosval + degrees);
- y= *(sinval + degrees);
-
- glVertex3f(x*size, 0.0f, y*size);
- }
-
- glEnd();
-
-}
-
-void drawcircball(int mode, float *cent, float rad, float tmat[][4])
-{
- float vec[3], vx[3], vy[3];
- int a, tot=32;
-
- VECCOPY(vx, tmat[0]);
- VECCOPY(vy, tmat[1]);
- VecMulf(vx, rad);
- VecMulf(vy, rad);
-
- glBegin(mode);
- for(a=0; a<tot; a++) {
- vec[0]= cent[0] + *(sinval+a) * vx[0] + *(cosval+a) * vy[0];
- vec[1]= cent[1] + *(sinval+a) * vx[1] + *(cosval+a) * vy[1];
- vec[2]= cent[2] + *(sinval+a) * vx[2] + *(cosval+a) * vy[2];
- glVertex3fv(vec);
- }
- glEnd();
-}
-/* needs fixing if non-identity matrice used */
-static void drawtube(float *vec, float radius, float height, float tmat[][4])
-{
- float cur[3];
- drawcircball(GL_LINE_LOOP, vec, radius, tmat);
-
- VecCopyf(cur,vec);
- cur[2]+=height;
-
- drawcircball(GL_LINE_LOOP, cur, radius, tmat);
-
- glBegin(GL_LINES);
- glVertex3f(vec[0]+radius,vec[1],vec[2]);
- glVertex3f(cur[0]+radius,cur[1],cur[2]);
- glVertex3f(vec[0]-radius,vec[1],vec[2]);
- glVertex3f(cur[0]-radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1]+radius,vec[2]);
- glVertex3f(cur[0],cur[1]+radius,cur[2]);
- glVertex3f(vec[0],vec[1]-radius,vec[2]);
- glVertex3f(cur[0],cur[1]-radius,cur[2]);
- glEnd();
-}
-/* needs fixing if non-identity matrice used */
-static void drawcone(float *vec, float radius, float height, float tmat[][4])
-{
- float cur[3];
-
- VecCopyf(cur,vec);
- cur[2]+=height;
-
- drawcircball(GL_LINE_LOOP, cur, radius, tmat);
-
- glBegin(GL_LINES);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0]+radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0]-radius,cur[1],cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0],cur[1]+radius,cur[2]);
- glVertex3f(vec[0],vec[1],vec[2]);
- glVertex3f(cur[0],cur[1]-radius,cur[2]);
- glEnd();
-}
-/* return 1 if nothing was drawn */
-static int drawmball(Base *base, int dt)
-{
- Object *ob= base->object;
- MetaBall *mb;
- MetaElem *ml;
- float imat[4][4], tmat[4][4];
- int code= 1;
-
- mb= ob->data;
-
- if(ob==G.obedit) {
- BIF_ThemeColor(TH_WIRE);
- if((G.f & G_PICKSEL)==0 ) drawDispList(base, dt);
- ml= editelems.first;
- }
- else {
- if((base->flag & OB_FROMDUPLI)==0)
- drawDispList(base, dt);
- ml= mb->elems.first;
- }
-
- if(ml==NULL) return 1;
-
- /* in case solid draw, reset wire colors */
- if(ob!=G.obedit && (ob->flag & SELECT)) {
- if(ob==OBACT) BIF_ThemeColor(TH_ACTIVE);
- else BIF_ThemeColor(TH_SELECT);
- }
- else BIF_ThemeColor(TH_WIRE);
-
- mygetmatrix(tmat);
- Mat4Invert(imat, tmat);
- Normalize(imat[0]);
- Normalize(imat[1]);
-
- while(ml) {
-
- /* draw radius */
- if(ob==G.obedit) {
- if((ml->flag & SELECT) && (ml->flag & MB_SCALE_RAD)) cpack(0xA0A0F0);
- else cpack(0x3030A0);
-
- if(G.f & G_PICKSEL) {
- ml->selcol1= code;
- glLoadName(code++);
- }
- }
- drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad, imat);
-
- /* draw stiffness */
- if(ob==G.obedit) {
- if((ml->flag & SELECT) && !(ml->flag & MB_SCALE_RAD)) cpack(0xA0F0A0);
- else cpack(0x30A030);
-
- if(G.f & G_PICKSEL) {
- ml->selcol2= code;
- glLoadName(code++);
- }
- drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atan(ml->s)/M_PI_2, imat);
- }
-
- ml= ml->next;
- }
- return 0;
-}
-
-static void draw_forcefield(Object *ob)
-{
- PartDeflect *pd= ob->pd;
- float imat[4][4], tmat[4][4];
- float vec[3]= {0.0, 0.0, 0.0};
- int curcol;
- float size;
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- if(ob!=G.obedit && (ob->flag & SELECT)) {
- if(ob==OBACT) curcol= TH_ACTIVE;
- else curcol= TH_SELECT;
- }
- else curcol= TH_WIRE;
-
- /* scale size of circle etc with the empty drawsize */
- if (ob->type == OB_EMPTY) size = ob->empty_drawsize;
- else size = 1.0;
-
- /* calculus here, is reused in PFIELD_FORCE */
- mygetmatrix(tmat);
- Mat4Invert(imat, tmat);
-// Normalize(imat[0]); // we don't do this because field doesnt scale either... apart from wind!
-// Normalize(imat[1]);
-
- if (pd->forcefield == PFIELD_WIND) {
- float force_val;
-
- Mat4One(tmat);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.5);
-
- if (has_ipo_code(ob->ipo, OB_PD_FSTR))
- force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra);
- else
- force_val = pd->f_strength;
- force_val*= 0.1;
- drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 0.5*force_val;
- drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 1.0*force_val;
- drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2]= 1.5*force_val;
- drawcircball(GL_LINE_LOOP, vec, size, tmat);
- vec[2] = 0; /* reset vec for max dist circle */
-
- }
- else if (pd->forcefield == PFIELD_FORCE) {
- float ffall_val;
-
- if (has_ipo_code(ob->ipo, OB_PD_FFALL))
- ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, G.scene->r.cfra);
- else
- ffall_val = pd->f_power;
-
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.5);
- drawcircball(GL_LINE_LOOP, vec, size, imat);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(1.5, (double)ffall_val));
- drawcircball(GL_LINE_LOOP, vec, size*1.5, imat);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(2.0, (double)ffall_val));
- drawcircball(GL_LINE_LOOP, vec, size*2.0, imat);
- }
- else if (pd->forcefield == PFIELD_VORTEX) {
- float ffall_val, force_val;
-
- Mat4One(tmat);
- if (has_ipo_code(ob->ipo, OB_PD_FFALL))
- ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, G.scene->r.cfra);
- else
- ffall_val = pd->f_power;
-
- if (has_ipo_code(ob->ipo, OB_PD_FSTR))
- force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra);
- else
- force_val = pd->f_strength;
-
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.7);
- if (force_val < 0) {
- drawspiral(vec, size*1.0, tmat, 1);
- drawspiral(vec, size*1.0, tmat, 16);
- }
- else {
- drawspiral(vec, size*1.0, tmat, -1);
- drawspiral(vec, size*1.0, tmat, -16);
- }
- }
- else if (pd->forcefield == PFIELD_GUIDE && ob->type==OB_CURVE) {
- Curve *cu= ob->data;
- if((cu->flag & CU_PATH) && cu->path && cu->path->data) {
- float mindist, guidevec1[4], guidevec2[3];
-
- if (has_ipo_code(ob->ipo, OB_PD_FSTR))
- mindist = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra);
- else
- mindist = pd->f_strength;
-
- /*path end*/
- setlinestyle(3);
- where_on_path(ob, 1.0f, guidevec1, guidevec2);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.5);
- drawcircball(GL_LINE_LOOP, guidevec1, mindist, imat);
-
- /*path beginning*/
- setlinestyle(0);
- where_on_path(ob, 0.0f, guidevec1, guidevec2);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.5);
- drawcircball(GL_LINE_LOOP, guidevec1, mindist, imat);
-
- VECCOPY(vec, guidevec1); /* max center */
- }
- }
-
- setlinestyle(3);
- BIF_ThemeColorBlend(curcol, TH_BACK, 0.5);
-
- if(pd->falloff==PFIELD_FALL_SPHERE){
- /* as last, guide curve alters it */
- if(pd->flag & PFIELD_USEMAX)
- drawcircball(GL_LINE_LOOP, vec, pd->maxdist, imat);
-
- if(pd->flag & PFIELD_USEMIN)
- drawcircball(GL_LINE_LOOP, vec, pd->mindist, imat);
- }
- else if(pd->falloff==PFIELD_FALL_TUBE){
- float radius,distance;
-
- Mat4One(tmat);
-
- vec[0]=vec[1]=0.0f;
- radius=(pd->flag&PFIELD_USEMAXR)?pd->maxrad:1.0f;
- distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f;
- vec[2]=distance;
- distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance;
-
- if(pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR))
- drawtube(vec,radius,distance,tmat);
-
- radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f;
- distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f;
- vec[2]=distance;
- distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance;
-
- if(pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR))
- drawtube(vec,radius,distance,tmat);
- }
- else if(pd->falloff==PFIELD_FALL_CONE){
- float radius,distance;
-
- Mat4One(tmat);
-
- radius=(pd->flag&PFIELD_USEMAXR)?pd->maxrad:1.0f;
- radius*=(float)M_PI/180.0f;
- distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f;
-
- if(pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR)){
- drawcone(vec,distance*sin(radius),distance*cos(radius),tmat);
- if((pd->flag & PFIELD_POSZ)==0)
- drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat);
- }
-
- radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f;
- radius*=(float)M_PI/180.0f;
- distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f;
-
- if(pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR)){
- drawcone(vec,distance*sin(radius),distance*cos(radius),tmat);
- if((pd->flag & PFIELD_POSZ)==0)
- drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat);
- }
- }
- setlinestyle(0);
-}
-
-static void draw_box(float vec[8][3])
-{
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec[0]); glVertex3fv(vec[1]);glVertex3fv(vec[2]); glVertex3fv(vec[3]);
- glVertex3fv(vec[0]); glVertex3fv(vec[4]);glVertex3fv(vec[5]); glVertex3fv(vec[6]);
- glVertex3fv(vec[7]); glVertex3fv(vec[4]);
- glEnd();
-
- glBegin(GL_LINES);
- glVertex3fv(vec[1]); glVertex3fv(vec[5]);
- glVertex3fv(vec[2]); glVertex3fv(vec[6]);
- glVertex3fv(vec[3]); glVertex3fv(vec[7]);
- glEnd();
-}
-
-/* uses boundbox, function used by Ketsji */
-void get_local_bounds(Object *ob, float *center, float *size)
-{
- BoundBox *bb= object_get_boundbox(ob);
-
- if(bb==NULL) {
- center[0]= center[1]= center[2]= 0.0;
- VECCOPY(size, ob->size);
- }
- else {
- size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]);
- size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
- size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
-
- center[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
- center[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
- center[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
- }
-}
-
-
-
-static void draw_bb_quadric(BoundBox *bb, short type)
-{
- float size[3], cent[3];
- GLUquadricObj *qobj = gluNewQuadric();
-
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
-
- size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]);
- size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
- size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
-
- cent[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
- cent[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
- cent[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
-
- glPushMatrix();
- if(type==OB_BOUND_SPHERE) {
- glTranslatef(cent[0], cent[1], cent[2]);
- glScalef(size[0], size[1], size[2]);
- gluSphere(qobj, 1.0, 8, 5);
- }
- else if(type==OB_BOUND_CYLINDER) {
- float radius = size[0] > size[1] ? size[0] : size[1];
- glTranslatef(cent[0], cent[1], cent[2]-size[2]);
- glScalef(radius, radius, 2.0*size[2]);
- gluCylinder(qobj, 1.0, 1.0, 1.0, 8, 1);
- }
- else if(type==OB_BOUND_CONE) {
- float radius = size[0] > size[1] ? size[0] : size[1];
- glTranslatef(cent[0], cent[2]-size[2], cent[1]);
- glScalef(radius, 2.0*size[2], radius);
- glRotatef(-90., 1.0, 0.0, 0.0);
- gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
- }
- glPopMatrix();
-
- gluDeleteQuadric(qobj);
-}
-
-static void draw_bounding_volume(Object *ob)
-{
- BoundBox *bb=0;
-
- if(ob->type==OB_MESH) {
- bb= mesh_get_bb(ob);
- }
- else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
- bb= ( (Curve *)ob->data )->bb;
- }
- else if(ob->type==OB_MBALL) {
- bb= ob->bb;
- if(bb==0) {
- makeDispListMBall(ob);
- bb= ob->bb;
- }
- }
- else {
- drawcube();
- return;
- }
-
- if(bb==0) return;
-
- if(ob->boundtype==OB_BOUND_BOX) draw_box(bb->vec);
- else draw_bb_quadric(bb, ob->boundtype);
-
-}
-
-static void drawtexspace(Object *ob)
-{
- float vec[8][3], loc[3], size[3];
-
- if(ob->type==OB_MESH) {
- mesh_get_texspace(ob->data, loc, NULL, size);
- }
- else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
- Curve *cu= ob->data;
- VECCOPY(size, cu->size);
- VECCOPY(loc, cu->loc);
- }
- else if(ob->type==OB_MBALL) {
- MetaBall *mb= ob->data;
- VECCOPY(size, mb->size);
- VECCOPY(loc, mb->loc);
- }
- else return;
-
- vec[0][0]=vec[1][0]=vec[2][0]=vec[3][0]= loc[0]-size[0];
- vec[4][0]=vec[5][0]=vec[6][0]=vec[7][0]= loc[0]+size[0];
-
- vec[0][1]=vec[1][1]=vec[4][1]=vec[5][1]= loc[1]-size[1];
- vec[2][1]=vec[3][1]=vec[6][1]=vec[7][1]= loc[1]+size[1];
-
- vec[0][2]=vec[3][2]=vec[4][2]=vec[7][2]= loc[2]-size[2];
- vec[1][2]=vec[2][2]=vec[5][2]=vec[6][2]= loc[2]+size[2];
-
- setlinestyle(2);
-
- draw_box(vec);
-
- setlinestyle(0);
-}
-
-/* draws wire outline */
-static void drawSolidSelect(Base *base)
-{
- Object *ob= base->object;
-
- glLineWidth(2.0);
- glDepthMask(0);
-
- if(ELEM3(ob->type, OB_FONT,OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
- if (displist_has_faces(&cu->disp) && boundbox_clip(ob->obmat, cu->bb)) {
- draw_index_wire= 0;
- drawDispListwire(&cu->disp);
- draw_index_wire= 1;
- }
- } else if (ob->type==OB_MBALL) {
- if((base->flag & OB_FROMDUPLI)==0)
- drawDispListwire(&ob->disp);
- }
- else if(ob->type==OB_ARMATURE) {
- if(!(ob->flag & OB_POSEMODE))
- draw_armature(base, OB_WIRE, 0);
- }
-
- glLineWidth(1.0);
- glDepthMask(1);
-}
-
-static void drawWireExtra(Object *ob)
-{
- if(ob!=G.obedit && (ob->flag & SELECT)) {
- if(ob==OBACT) {
- if(ob->flag & OB_FROMGROUP) BIF_ThemeColor(TH_GROUP_ACTIVE);
- else BIF_ThemeColor(TH_ACTIVE);
- }
- else if(ob->flag & OB_FROMGROUP)
- BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16);
- else
- BIF_ThemeColor(TH_SELECT);
- }
- else {
- if(ob->flag & OB_FROMGROUP)
- BIF_ThemeColor(TH_GROUP);
- else {
- if(ob->dtx & OB_DRAWWIRE) {
- glColor3ub(80,80,80);
- } else {
- BIF_ThemeColor(TH_WIRE);
- }
- }
- }
-
- bglPolygonOffset(1.0);
- glDepthMask(0); // disable write in zbuffer, selected edge wires show better
-
- if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
- Curve *cu = ob->data;
- if (boundbox_clip(ob->obmat, cu->bb)) {
- if (ob->type==OB_CURVE)
- draw_index_wire= 0;
- drawDispListwire(&cu->disp);
- if (ob->type==OB_CURVE)
- draw_index_wire= 1;
- }
- } else if (ob->type==OB_MBALL) {
- drawDispListwire(&ob->disp);
- }
-
- glDepthMask(1);
- bglPolygonOffset(0.0);
-}
-
-/* should be called in view space */
-static void draw_hooks(Object *ob)
-{
- ModifierData *md;
- float vec[3];
-
- for (md=ob->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
-
- VecMat4MulVecfl(vec, ob->obmat, hmd->cent);
-
- if(hmd->object) {
- setlinestyle(3);
- glBegin(GL_LINES);
- glVertex3fv(hmd->object->obmat[3]);
- glVertex3fv(vec);
- glEnd();
- setlinestyle(0);
- }
-
- glPointSize(3.0);
- bglBegin(GL_POINTS);
- bglVertex3fv(vec);
- bglEnd();
- glPointSize(1.0);
- }
- }
-}
-
-//<rcruiz>
-void drawRBpivot(bRigidBodyJointConstraint *data)
-{
- float radsPerDeg = 6.283185307179586232f / 360.f;
- int axis;
- float v1[3]= {data->pivX, data->pivY, data->pivZ};
- float eu[3]= {radsPerDeg*data->axX, radsPerDeg*data->axY, radsPerDeg*data->axZ};
- float mat[4][4];
-
- if(G.f & G_RENDER_SHADOW)
- return;
-
- EulToMat4(eu,mat);
- glLineWidth (4.0f);
- setlinestyle(2);
- for (axis=0; axis<3; axis++) {
- float dir[3] = {0,0,0};
- float v[3]= {data->pivX, data->pivY, data->pivZ};
-
- dir[axis] = 1.f;
- glBegin(GL_LINES);
- Mat4MulVecfl(mat,dir);
- v[0] += dir[0];
- v[1] += dir[1];
- v[2] += dir[2];
- glVertex3fv(v1);
- glVertex3fv(v);
- glEnd();
- glRasterPos3fv(v);
- if (axis==0)
- BMF_DrawString(G.font, "px");
- else if (axis==1)
- BMF_DrawString(G.font, "py");
- else
- BMF_DrawString(G.font, "pz");
- }
- glLineWidth (1.0f);
- setlinestyle(0);
-}
-
-/* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR, DRAW_SCENESET */
-void draw_object(Base *base, int flag)
-{
- static int warning_recursive= 0;
- Object *ob;
- Curve *cu;
- float cfraont;
- float vec1[3], vec2[3];
- unsigned int col=0;
- int sel, drawtype, colindex= 0, ipoflag;
- int i, selstart, selend, empty_object=0;
- short dt, dtx, zbufoff= 0;
-
- /* only once set now, will be removed too, should become a global standard */
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- ob= base->object;
-
- if (ob!=G.obedit) {
- if (ob->restrictflag & OB_RESTRICT_VIEW)
- return;
- }
-
- /* xray delay? */
- if((flag & DRAW_PICKING)==0 && (base->flag & OB_FROMDUPLI)==0) {
- /* don't do xray in particle mode, need the z-buffer */
- if(!(G.f & G_PARTICLEEDIT)) {
- /* xray and transp are set when it is drawing the 2nd/3rd pass */
- if(!G.vd->xray && !G.vd->transp && (ob->dtx & OB_DRAWXRAY)) {
- add_view3d_after(G.vd, base, V3D_XRAY, flag);
- return;
- }
- }
- }
-
- /* draw keys? */
- if(base==(G.scene->basact) || (base->flag & (SELECT+BA_WAS_SEL))) {
- if(flag==0 && warning_recursive==0 && ob!=G.obedit) {
- if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) {
- ListBase elems;
- CfraElem *ce;
- float temp[7][3];
-
- warning_recursive= 1;
-
- elems.first= elems.last= 0;
- // warning: no longer checks for certain ob-keys only... (so does this need to use the proper ipokeys then?)
- make_cfra_list(ob->ipo, &elems);
-
- cfraont= (G.scene->r.cfra);
- drawtype= G.vd->drawtype;
- if(drawtype>OB_WIRE) G.vd->drawtype= OB_WIRE;
- sel= base->flag;
- memcpy(temp, &ob->loc, 7*3*sizeof(float));
-
- ipoflag= ob->ipoflag;
- ob->ipoflag &= ~OB_OFFS_OB;
-
- set_no_parent_ipo(1);
- disable_speed_curve(1);
-
- if ((ob->ipoflag & OB_DRAWKEYSEL)==0) {
- ce= elems.first;
- while(ce) {
- if(!ce->sel) {
- (G.scene->r.cfra)= ce->cfra/G.scene->r.framelen;
-
- base->flag= 0;
-
- where_is_object_time(ob, (G.scene->r.cfra));
- draw_object(base, 0);
- }
- ce= ce->next;
- }
- }
-
- ce= elems.first;
- while(ce) {
- if(ce->sel) {
- (G.scene->r.cfra)= ce->cfra/G.scene->r.framelen;
-
- base->flag= SELECT;
-
- where_is_object_time(ob, (G.scene->r.cfra));
- draw_object(base, 0);
- }
- ce= ce->next;
- }
-
- set_no_parent_ipo(0);
- disable_speed_curve(0);
-
- base->flag= sel;
- ob->ipoflag= ipoflag;
-
- /* restore icu->curval */
- (G.scene->r.cfra)= cfraont;
-
- memcpy(&ob->loc, temp, 7*3*sizeof(float));
- where_is_object(ob);
- G.vd->drawtype= drawtype;
-
- BLI_freelistN(&elems);
-
- warning_recursive= 0;
- }
- }
- }
-
- /* patch? children objects with a timeoffs change the parents. How to solve! */
- /* if( ((int)ob->ctime) != F_(G.scene->r.cfra)) where_is_object(ob); */
-
- mymultmatrix(ob->obmat);
-
- /* which wire color */
- if((flag & DRAW_CONSTCOLOR) == 0) {
- project_short(ob->obmat[3], &base->sx);
-
- if((G.moving & G_TRANSFORM_OBJ) && (base->flag & (SELECT+BA_WAS_SEL))) BIF_ThemeColor(TH_TRANSFORM);
- else {
-
- if(ob->type==OB_LAMP) BIF_ThemeColor(TH_LAMP);
- else BIF_ThemeColor(TH_WIRE);
-
- if((G.scene->basact)==base) {
- if(base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_ACTIVE);
- }
- else {
- if(base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_SELECT);
- }
-
- // no theme yet
- if(ob->id.lib) {
- if(base->flag & (SELECT+BA_WAS_SEL)) colindex = 4;
- else colindex = 3;
- }
- else if(warning_recursive==1) {
- if(base->flag & (SELECT+BA_WAS_SEL)) {
- if(G.scene->basact==base) colindex = 8;
- else colindex= 7;
- }
- else colindex = 6;
- }
- else if(ob->flag & OB_FROMGROUP) {
- if(base->flag & (SELECT+BA_WAS_SEL)) {
- if(G.scene->basact==base) BIF_ThemeColor(TH_GROUP_ACTIVE);
- else BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16);
- }
- else BIF_ThemeColor(TH_GROUP);
- colindex= 0;
- }
-
- }
-
- if(colindex) {
- col= colortab[colindex];
- cpack(col);
- }
- }
-
- /* maximum drawtype */
- dt= MIN2(G.vd->drawtype, ob->dt);
- if(G.vd->zbuf==0 && dt>OB_WIRE) dt= OB_WIRE;
- dtx= 0;
-
- /* faceselect exception: also draw solid when dt==wire, except in editmode */
- if(ob==OBACT && (G.f & (G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT))) {
- if(ob->type==OB_MESH) {
-
- if(ob==G.obedit);
- else {
- if(dt<OB_SOLID)
- zbufoff= 1;
-
- dt= OB_SHADED;
- glEnable(GL_DEPTH_TEST);
- }
- }
- else {
- if(dt<OB_SOLID) {
- dt= OB_SOLID;
- glEnable(GL_DEPTH_TEST);
- zbufoff= 1;
- }
- }
- }
-
- /* draw-extra supported for boundbox drawmode too */
- if(dt>=OB_BOUNDBOX ) {
-
- dtx= ob->dtx;
- if(G.obedit==ob) {
- // the only 2 extra drawtypes alowed in editmode
- dtx= dtx & (OB_DRAWWIRE|OB_TEXSPACE);
- }
-
- if(G.f & G_DRAW_EXT) {
- if(ob->type==OB_EMPTY || ob->type==OB_CAMERA || ob->type==OB_LAMP) dt= OB_WIRE;
- }
- }
-
- /* draw outline for selected solid objects, mesh does itself */
- if((G.vd->flag & V3D_SELECT_OUTLINE) && ob->type!=OB_MESH) {
- if(dt>OB_WIRE && dt<OB_TEXTURE && ob!=G.obedit && (flag && DRAW_SCENESET)==0) {
- if (!(ob->dtx&OB_DRAWWIRE) && (ob->flag&SELECT) && !(flag&DRAW_PICKING)) {
- drawSolidSelect(base);
- }
- }
- }
-
- switch( ob->type) {
- case OB_MESH:
- if (!(base->flag&OB_RADIO)) {
- empty_object= draw_mesh_object(base, dt, flag);
- if(flag!=DRAW_CONSTCOLOR) dtx &= ~OB_DRAWWIRE; // mesh draws wire itself
- }
-
- break;
- case OB_FONT:
- cu= ob->data;
- if (cu->disp.first==NULL) makeDispListCurveTypes(ob, 0);
- if(ob==G.obedit) {
- tekentextcurs();
-
- if (cu->flag & CU_FAST) {
- cpack(0xFFFFFF);
- set_inverted_drawing(1);
- drawDispList(base, OB_WIRE);
- set_inverted_drawing(0);
- } else {
- drawDispList(base, dt);
- }
-
- if (cu->linewidth != 0.0) {
- cpack(0xff44ff);
- BIF_ThemeColor(TH_WIRE);
- VECCOPY(vec1, ob->orig);
- VECCOPY(vec2, ob->orig);
- vec1[0] += cu->linewidth;
- vec2[0] += cu->linewidth;
- vec1[1] += cu->linedist * cu->fsize;
- vec2[1] -= cu->lines * cu->linedist * cu->fsize;
- setlinestyle(3);
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec1);
- glVertex2fv(vec2);
- glEnd();
- setlinestyle(0);
- }
-
- setlinestyle(3);
- for (i=0; i<cu->totbox; i++) {
- if (cu->tb[i].w != 0.0) {
- if (i == (cu->actbox-1))
- BIF_ThemeColor(TH_ACTIVE);
- else
- BIF_ThemeColor(TH_WIRE);
- vec1[0] = cu->tb[i].x;
- vec1[1] = cu->tb[i].y + cu->fsize;
- vec1[2] = 0.001;
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec1);
- vec1[0] += cu->tb[i].w;
- glVertex3fv(vec1);
- vec1[1] -= cu->tb[i].h;
- glVertex3fv(vec1);
- vec1[0] -= cu->tb[i].w;
- glVertex3fv(vec1);
- vec1[1] += cu->tb[i].h;
- glVertex3fv(vec1);
- glEnd();
- }
- }
- setlinestyle(0);
-
-
- if (getselection(&selstart, &selend) && selboxes) {
- float selboxw;
-
- cpack(0xffffff);
- set_inverted_drawing(1);
- for (i=0; i<(selend-selstart+1); i++) {
- SelBox *sb = &(selboxes[i]);
-
- if (i<(selend-selstart)) {
- if (selboxes[i+1].y == sb->y)
- selboxw= selboxes[i+1].x - sb->x;
- else
- selboxw= sb->w;
- }
- else {
- selboxw= sb->w;
- }
- glBegin(GL_QUADS);
- glVertex3f(sb->x, sb->y, 0.001);
- glVertex3f(sb->x+selboxw, sb->y, 0.001);
- glVertex3f(sb->x+selboxw, sb->y+sb->h, 0.001);
- glVertex3f(sb->x, sb->y+sb->h, 0.001);
- glEnd();
- }
- set_inverted_drawing(0);
- }
- }
- else if(dt==OB_BOUNDBOX)
- draw_bounding_volume(ob);
- else if(boundbox_clip(ob->obmat, cu->bb))
- empty_object= drawDispList(base, dt);
-
- break;
- case OB_CURVE:
- case OB_SURF:
- cu= ob->data;
- /* still needed for curves hidden in other layers. depgraph doesnt handle that yet */
- if (cu->disp.first==NULL) makeDispListCurveTypes(ob, 0);
-
- if(ob==G.obedit) {
- drawnurb(base, editNurb.first, dt);
- }
- else if(dt==OB_BOUNDBOX)
- draw_bounding_volume(ob);
- else if(boundbox_clip(ob->obmat, cu->bb)) {
- empty_object= drawDispList(base, dt);
-
- if(cu->path)
- curve_draw_speed(ob);
- }
- break;
- case OB_MBALL:
- if(ob==G.obedit)
- drawmball(base, dt);
- else if(dt==OB_BOUNDBOX)
- draw_bounding_volume(ob);
- else
- empty_object= drawmball(base, dt);
- break;
- case OB_EMPTY:
- drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype);
- break;
- case OB_LAMP:
- drawlamp(ob);
- if(dtx || (base->flag & SELECT)) mymultmatrix(ob->obmat);
- break;
- case OB_CAMERA:
- drawcamera(ob, flag);
- break;
- case OB_LATTICE:
- drawlattice(ob);
- break;
- case OB_ARMATURE:
- if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material
- empty_object= draw_armature(base, dt, flag);
- if(dt>OB_WIRE) GPU_disable_material();
- break;
- default:
- drawaxes(1.0, flag, OB_ARROWS);
- }
- if(ob->pd && ob->pd->forcefield) draw_forcefield(ob);
-
- /* code for new particle system */
- if( (warning_recursive==0) &&
- (ob->particlesystem.first) &&
- (flag & DRAW_PICKING)==0 &&
- (ob!=G.obedit)
- ) {
- ParticleSystem *psys;
- if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */
- glDepthMask(GL_FALSE);
-
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- draw_new_particle_system(base, psys, dt);
-
- if(G.f & G_PARTICLEEDIT && ob==OBACT) {
- psys= PE_get_current(ob);
- if(psys && !G.obedit && psys_in_edit_mode(psys))
- draw_particle_edit(ob, psys, dt);
- }
- glDepthMask(GL_TRUE);
- if(col) cpack(col);
- }
-
- {
- bConstraint *con;
- for(con=ob->constraints.first; con; con= con->next)
- {
- if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT)
- {
- bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)con->data;
- if(data->flag&CONSTRAINT_DRAW_PIVOT)
- drawRBpivot(data);
- }
- }
- }
-
- /* draw extra: after normal draw because of makeDispList */
- if(dtx && !(G.f & (G_RENDER_OGL|G_RENDER_SHADOW))) {
- if(dtx & OB_AXIS) {
- drawaxes(1.0f, flag, OB_ARROWS);
- }
- if(dtx & OB_BOUNDBOX) draw_bounding_volume(ob);
- if(dtx & OB_TEXSPACE) drawtexspace(ob);
- if(dtx & OB_DRAWNAME) {
- /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
- /* but, we also dont draw names for sets or duplicators */
- if(flag == 0) {
- if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
- glRasterPos3f(0.0, 0.0, 0.0);
-
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, ob->id.name+2);
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- }
- }
- /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/
- if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(ob);
- }
-
- if(dt<OB_SHADED) {
- if((ob->gameflag & OB_DYNAMIC) ||
- ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) {
- float tmat[4][4], imat[4][4], vec[3];
-
- vec[0]= vec[1]= vec[2]= 0.0;
- mygetmatrix(tmat);
- Mat4Invert(imat, tmat);
-
- setlinestyle(2);
- drawcircball(GL_LINE_LOOP, vec, ob->inertia, imat);
- setlinestyle(0);
- }
- }
-
- myloadmatrix(G.vd->viewmat);
-
- if(zbufoff) glDisable(GL_DEPTH_TEST);
-
- if(warning_recursive) return;
- if(base->flag & (OB_FROMDUPLI|OB_RADIO)) return;
- if(G.f & G_RENDER_SHADOW) return;
-
- /* object centers, need to be drawn in viewmat space for speed, but OK for picking select */
- if(ob!=OBACT || (G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) {
- int do_draw_center= -1; /* defines below are zero or positive... */
-
- if((G.scene->basact)==base)
- do_draw_center= ACTIVE;
- else if(base->flag & SELECT)
- do_draw_center= SELECT;
- else if(empty_object || (G.vd->flag & V3D_DRAW_CENTERS))
- do_draw_center= DESELECT;
-
- if(do_draw_center != -1) {
- if(flag & DRAW_PICKING) {
- /* draw a single point for opengl selection */
- glBegin(GL_POINTS);
- glVertex3fv(ob->obmat[3]);
- glEnd();
- }
- else if((flag & DRAW_CONSTCOLOR)==0) {
- /* we don't draw centers for duplicators and sets */
-#ifdef WITH_VERSE
- if(ob->vnode)
- drawcentercircle(ob->obmat[3], VERSE, 1);
- else
-#endif
- drawcentercircle(ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us>1);
- }
- }
- }
-
- /* not for sets, duplicators or picking */
- if(flag==0 && (!(G.vd->flag & V3D_HIDE_HELPLINES))) {
- ListBase *list;
-
- /* draw hook center and offset line */
- if(ob!=G.obedit) draw_hooks(ob);
-
- /* help lines and so */
- if(ob!=G.obedit && ob->parent && (ob->parent->lay & G.vd->lay)) {
- setlinestyle(3);
- glBegin(GL_LINES);
- glVertex3fv(ob->obmat[3]);
- glVertex3fv(ob->orig);
- glEnd();
- setlinestyle(0);
- }
-
- /* Drawing the constraint lines */
- list = &ob->constraints;
- if (list) {
- bConstraint *curcon;
- bConstraintOb *cob;
- char col[4], col2[4];
-
- BIF_GetThemeColor3ubv(TH_GRID, col);
- make_axis_color(col, col2, 'z');
- glColor3ubv((GLubyte *)col2);
-
- cob= constraints_make_evalob(ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
-
- for (curcon = list->first; curcon; curcon=curcon->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- if ((curcon->flag & CONSTRAINT_EXPAND) && (cti) && (cti->get_constraint_targets)) {
- cti->get_constraint_targets(curcon, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- /* calculate target's matrix */
- if (cti->get_target_matrix)
- cti->get_target_matrix(curcon, cob, ct, bsystem_time(ob, (float)(G.scene->r.cfra), give_timeoffset(ob)));
- else
- Mat4One(ct->matrix);
-
- setlinestyle(3);
- glBegin(GL_LINES);
- glVertex3fv(ct->matrix[3]);
- glVertex3fv(ob->obmat[3]);
- glEnd();
- setlinestyle(0);
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(curcon, &targets, 1);
- }
- }
-
- constraints_clear_evalob(cob);
- }
- }
-
- free_old_images();
-}
-
-void draw_object_ext(Base *base)
-{
-
- if(G.vd==NULL || base==NULL) return;
-
- if(G.vd->drawtype > OB_WIRE) {
- G.vd->zbuf= 1;
- glEnable(GL_DEPTH_TEST);
- }
-
- G.f |= G_DRAW_EXT;
-
- glDrawBuffer(GL_FRONT);
- persp(PERSP_VIEW);
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_set_clipping(G.vd);
-
- draw_object(base, 0);
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
- G.f &= ~G_DRAW_EXT;
-
- bglFlush(); /* reveil frontbuffer drawing */
- glDrawBuffer(GL_BACK);
-
- if(G.vd->zbuf) {
- G.vd->zbuf= 0;
- glDisable(GL_DEPTH_TEST);
- }
- curarea->win_swap= WIN_FRONT_OK;
-}
-
-/* ***************** BACKBUF SEL (BBS) ********* */
-
-static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- int offset = (intptr_t) userData;
- EditVert *eve = EM_get_vert_for_index(index);
-
- if (eve->h==0) {
- set_framebuffer_index_color(offset+index);
- bglVertex3fv(co);
- }
-}
-static int bbs_mesh_verts(DerivedMesh *dm, int offset)
-{
- glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) );
- bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(intptr_t) offset);
- bglEnd();
- glPointSize(1.0);
-
- return offset + G.totvert;
-}
-
-static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
-{
- int offset = (intptr_t) userData;
- EditEdge *eed = EM_get_edge_for_index(index);
-
- if (eed->h==0) {
- set_framebuffer_index_color(offset+index);
- return 1;
- } else {
- return 0;
- }
-}
-static int bbs_mesh_wire(DerivedMesh *dm, int offset)
-{
- dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(intptr_t) offset);
-
- return offset + G.totedge;
-}
-
-static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
-{
- if (EM_get_face_for_index(index)->h==0) {
- if (userData) {
- set_framebuffer_index_color(index+1);
- }
- return 1;
- } else {
- return 0;
- }
-}
-
-static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *no)
-{
- EditFace *efa = EM_get_face_for_index(index);
-
- if (efa->h==0 && efa->fgonf!=EM_FGON) {
- set_framebuffer_index_color(index+1);
-
- bglVertex3fv(cent);
- }
-}
-
-/* two options, facecolors or black */
-static int bbs_mesh_solid_EM(DerivedMesh *dm, int facecol)
-{
- cpack(0);
-
- if (facecol) {
- dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(intptr_t) 1, 0);
-
- if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) {
- glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE));
-
- bglBegin(GL_POINTS);
- dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, NULL);
- bglEnd();
- }
-
- return 1+G.totface;
- } else {
- dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*) 0, 0);
- return 1;
- }
-}
-
-static int bbs_mesh_solid__setDrawOpts(void *userData, int index, int *drawSmooth_r)
-{
- Mesh *me = userData;
-
- if (!(me->mface[index].flag&ME_HIDE)) {
- set_framebuffer_index_color(index+1);
- return 1;
- } else {
- return 0;
- }
-}
-
-/* TODO remove this - since face select mode now only works with painting */
-static void bbs_mesh_solid(Object *ob)
-{
- DerivedMesh *dm = mesh_get_derived_final(ob, get_viewedit_datamask());
- Mesh *me = (Mesh*)ob->data;
-
- glColor3ub(0, 0, 0);
- dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, me, 0);
-
- dm->release(dm);
-}
-
-void draw_object_backbufsel(Object *ob)
-{
-
- mymultmatrix(ob->obmat);
-
- glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
-
- switch( ob->type) {
- case OB_MESH:
- if(ob==G.obedit) {
- DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- EM_init_index_arrays(1, 1, 1);
-
- em_solidoffs= bbs_mesh_solid_EM(dm, G.scene->selectmode & SCE_SELECT_FACE);
-
- bglPolygonOffset(1.0);
-
- // we draw edges always, for loop (select) tools
- em_wireoffs= bbs_mesh_wire(dm, em_solidoffs);
-
- // we draw verts if vert select mode or if in transform (for snap).
- if(G.scene->selectmode & SCE_SELECT_VERTEX || G.moving & G_TRANSFORM_EDIT)
- em_vertoffs= bbs_mesh_verts(dm, em_wireoffs);
- else em_vertoffs= em_wireoffs;
-
- bglPolygonOffset(0.0);
-
- dm->release(dm);
-
- EM_free_index_arrays();
- }
- else bbs_mesh_solid(ob);
-
- break;
- case OB_CURVE:
- case OB_SURF:
- break;
- }
-
- myloadmatrix(G.vd->viewmat);
-}
-
-
-/* ************* draw object instances for bones, for example ****************** */
-/* assumes all matrices/etc set OK */
-
-/* helper function for drawing object instances - meshes */
-static void draw_object_mesh_instance(Object *ob, int dt, int outline)
-{
- DerivedMesh *dm=NULL, *edm=NULL;
- int glsl;
-
- if(G.obedit && ob->data==G.obedit->data)
- edm= editmesh_get_derived_base();
- else
- dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
-
- if(dt<=OB_WIRE) {
- if(dm)
- dm->drawEdges(dm, 1);
- else if(edm)
- edm->drawEdges(edm, 1);
- }
- else {
- if(outline)
- draw_mesh_object_outline(ob, dm?dm:edm);
-
- if(dm) {
- glsl = draw_glsl_material(ob, dt);
- GPU_set_object_materials(G.scene, ob, glsl, NULL);
- }
- else {
- glEnable(GL_COLOR_MATERIAL);
- BIF_ThemeColor(TH_BONE_SOLID);
- glDisable(GL_COLOR_MATERIAL);
- }
-
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
- glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- glEnable(GL_LIGHTING);
-
- if(dm) {
- dm->drawFacesSolid(dm, GPU_enable_material);
- GPU_disable_material();
- }
- else if(edm)
- edm->drawMappedFaces(edm, NULL, NULL, 0);
-
- glDisable(GL_LIGHTING);
- }
-
- if(edm) edm->release(edm);
- if(dm) dm->release(dm);
-}
-
-void draw_object_instance(Object *ob, int dt, int outline)
-{
- if (ob == NULL)
- return;
-
- switch (ob->type) {
- case OB_MESH:
- draw_object_mesh_instance(ob, dt, outline);
- break;
- case OB_EMPTY:
- drawaxes(ob->empty_drawsize, 0, ob->empty_drawtype);
- break;
- }
-}
diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c
deleted file mode 100644
index 75bea40a8b4..00000000000
--- a/source/blender/src/drawoops.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_ID.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_outliner.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-
-/* #include "BIF_drawoops.h" bad name :(*/
-#include "BIF_oops.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_drawoops.h"
-
-float aspect;
-void *font;
-
-
-static float icon_width();
-float center_oops_text(char *str);
-
-
-void boundbox_oops(short sel)
-{
- Oops *oops;
- float min[2], max[2];
- int ok= 0;
-
- if(G.soops==0) return;
-
- min[0]= 1000.0;
- max[0]= -1000.0;
- min[1]= 1000.0;
- max[1]= -1000.0;
-
- oops= G.soops->oops.first;
- while(oops) {
- if ((oops->hide==0 && !sel) || (sel && oops->flag & SELECT )) {
- ok= 1;
-
- min[0]= MIN2(min[0], oops->x);
- max[0]= MAX2(max[0], oops->x+OOPSX);
- min[1]= MIN2(min[1], oops->y);
- max[1]= MAX2(max[1], oops->y+OOPSY);
- }
- oops= oops->next;
- }
-
- if(ok==0) return;
-
- G.v2d->tot.xmin= min[0];
- G.v2d->tot.xmax= max[0];
- G.v2d->tot.ymin= min[1];
- G.v2d->tot.ymax= max[1];
-
-}
-
-void give_oopslink_line(Oops *oops, OopsLink *ol, float *v1, float *v2)
-{
-
- if(ol->to && ol->to->hide==0) {
- v1[0]= oops->x+ol->xof;
- v1[1]= oops->y+ol->yof;
- v2[0]= ol->to->x+OOPSX/2;
- v2[1]= ol->to->y;
- }
- else if(ol->from && ol->from->hide==0) {
- v1[0]= ol->from->x + ol->xof;
- v1[1]= ol->from->y + ol->xof;
- v2[0]= oops->x+OOPSX/2;
- v2[1]= oops->y;
- }
-}
-
-void draw_oopslink(Oops *oops)
-{
- OopsLink *ol;
- float vec[4][3], dist, spline_step;
- short curve_res;
-
- if(oops->type==ID_SCE || oops->type==ID_GR) {
- if(oops->flag & SELECT) {
- /* when using python Mesh to make meshes a file was saved
- that had an oops with no ID, stops a segfault when looking for lib */
- if(oops->id && oops->id->lib) cpack(0x4080A0);
- else cpack(0x808080);
- }
- else cpack(0x606060);
- }
- else {
- if(oops->flag & SELECT) {
- if(oops->id && oops->id->lib) cpack(0x11AAFF);
- else cpack(0xFFFFFF);
- }
- else cpack(0x0);
- }
-
- glEnable(GL_MAP1_VERTEX_3);
- vec[0][2]= vec[1][2]= vec[2][2]= vec[3][2]= 0.0; /* only 2d spline, set the Z to 0*/
-
- ol= oops->link.first;
- while(ol) {
- if(ol->to && ol->to->hide==0) {
-
- give_oopslink_line(oops, ol, vec[0], vec[3]);
-
- dist= 0.5*VecLenf(vec[0], vec[3]);
-
- /* check ol->xof and yof for direction */
- if(ol->xof == 0.0) {
- vec[1][0]= vec[0][0]-dist;
- vec[1][1]= vec[0][1];
- }
- else if(ol->xof==OOPSX) {
- vec[1][0]= vec[0][0]+dist;
- vec[1][1]= vec[0][1];
- }
- else {
- vec[1][0]= vec[0][0];
- vec[1][1]= vec[0][1]+dist;
- }
-
- /* v3 is always pointing down */
- vec[2][0]= vec[3][0];
- vec[2][1]= vec[3][1] - dist;
-
- if( MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > G.v2d->cur.xmax); /* clipped */
- else if ( MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < G.v2d->cur.xmin); /* clipped */
- else {
- /* calculate a curve resolution to use based on the length of the curve.*/
- curve_res = MIN2(40, MAX2(2, 2*dist/aspect));
-
- /* we can reuse the dist variable here to increment the GL curve eval amount*/
- dist = (float)1/curve_res;
- spline_step = 0.0;
-
- glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]);
- glBegin(GL_LINE_STRIP);
- while (spline_step < 1.000001) {
- glEvalCoord1f(spline_step);
- spline_step += dist;
- }
- glEnd();
- }
-
- }
- ol= ol->next;
- }
-}
-
-static float icon_width()
-{
- /* change it in *one place* when you mess around */
- return 0.8*OOPSY;
-}
-
-void draw_icon_oops(float *co, short type)
-{
- BIFIconID icon;
- float ofs;
-
- switch(type) {
- default: return;
-
- case ID_OB: icon= ICON_OBJECT_HLT; break;
- case ID_ME: icon= ICON_MESH_HLT; break;
- case ID_CU: icon= ICON_CURVE_HLT; break;
- case ID_MB: icon= ICON_MBALL_HLT; break;
- case ID_LT: icon= ICON_LATTICE_HLT; break;
- case ID_LA: icon= ICON_LAMP_HLT; break;
- case ID_MA: icon= ICON_MATERIAL_HLT; break;
- case ID_TE: icon= ICON_TEXTURE_HLT; break;
- case ID_IP: icon= ICON_IPO_HLT; break;
- case ID_LI: icon= ICON_LIBRARY_HLT; break;
- case ID_IM: icon= ICON_IMAGE_HLT; break;
- case ID_GR: icon= ICON_CIRCLE_DEHLT; break;
- case ID_CA: icon= ICON_CAMERA_DEHLT; break;
- case ID_AR: icon= ICON_ARMATURE; break;
- }
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- /* height of box is OOPSY...icon is centered vertically */
- ofs = (OOPSY - icon_width())/2.0;
- BIF_icon_draw_aspect(co[0], co[1]+ofs, icon, icon_width()*aspect*ICON_DEFAULT_HEIGHT/OOPSY);
-
- glBlendFunc(GL_ONE, GL_ZERO);
- glDisable(GL_BLEND);
-}
-
-void mysbox(float x1, float y1, float x2, float y2)
-{
- float vec[2];
-
- glBegin(GL_LINE_LOOP);
- vec[0]= x1; vec[1]= y1;
- glVertex2fv(vec);
- vec[0]= x2;
- glVertex2fv(vec);
- vec[1]= y2;
- glVertex2fv(vec);
- vec[0]= x1;
- glVertex2fv(vec);
- glEnd();
-}
-
-unsigned int give_oops_color(short type, short sel, unsigned int *border)
-{
- unsigned int body;
- /* also finds out if a dashed line should be drawn */
-
- switch(type) {
- case ID_OB:
- body= 0x707070; break;
- case ID_SCE:
- body= 0x608060; break;
- case ID_MA:
- body= 0x808060; break;
- case ID_TE:
- body= 0x7080a0; break;
- case ID_IP:
- body= 0x906050; break;
- case ID_LA:
- body= 0x608080; break;
- case ID_LI:
- body= 0x2198DC; break;
- case ID_IM:
- body= 0x35659F; break;
- case ID_GR:
- body= 0x507050; break;
- case ID_CA:
- body= 0x7570A0; break;
- case ID_LT:
- body= 0xA08090; break;
- case ID_AR:
- body= 0x70B0C0; break;
- default:
- body= 0x606070; break;
- }
-
- if(sel) {
- if(G.moving) *border= 0xf0f0f0;
- else *border= 0xc0c0c0;
- }
- else *border= 0x0;
-
-
- return body;
-}
-
-
-float center_oops_text(char *str)
-/* gives x offset at which to draw oops text -- takes icon into account */
-{
- int len;
- float width;
-
- len= strlen(str);
- if(len < 1) return 0;
-
- /* center at box width of OOPSX */
- width= aspect*BIF_GetStringWidth(font, str, 0) + icon_width();
-
- while(width > OOPSX && len >= 0) {
- str[len] = 0;
- width= aspect*BIF_GetStringWidth(font, str, 0) + icon_width();
- len--;
- }
- return (OOPSX - width)/2;
-}
-
-void draw_oops(Oops *oops)
-{
- OopsLink *ol;
- float v1[2], x1, y1, x2, y2, f1, f2;
- unsigned int body, border;
- short line= 0;
- char str[FILE_MAXDIR+FILE_MAXFILE+5];
-
- x1= oops->x;
- x2= oops->x+OOPSX;
- y1= oops->y;
- y2= oops->y+OOPSY;
-
- /* do clip */
- if(x2 < G.v2d->cur.xmin || x1 > G.v2d->cur.xmax) return;
- if(y2 < G.v2d->cur.ymin || y1 > G.v2d->cur.ymax) return;
-
- body= give_oops_color(oops->type, oops->flag & SELECT, &border);
- if(oops->id== (ID *)((G.scene->basact) ? (G.scene->basact->object) : 0)) line= 1;
- else if(oops->id== (ID *)G.scene) line= 1;
-
- if (!oops->id) return;
-
- if(oops->id->us) {
- cpack(body);
-
- glRectf(x1, y1, x2, y2);
- }
-
- if(oops->id->lib) {
- if(oops->id->flag & LIB_INDIRECT) cpack(0x1144FF);
- else cpack(0x11AAFF);
-
- glRectf(x2-0.2*OOPSX, y2-0.2*OOPSX, x2-0.1*OOPSX, y2-0.1*OOPSX);
- }
-
- v1[0]= x1;
- v1[1] = y1;
-
- if(oops->type==ID_LI) {
- sprintf(str, " %s", ((Library *)oops->id)->name);
- }
- else {
- sprintf(str, " %s", oops->id->name+2);
- }
-
- BIF_SetScale(aspect);
- v1[0] += center_oops_text(str);
-
- draw_icon_oops(v1, oops->type);
- v1[0] += icon_width();
-
- v1[1] = y1+(y2-y1)/3.0;
- if(oops->flag & SELECT) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
- glRasterPos2f(v1[0], v1[1]);
- BIF_RasterPos(v1[0], v1[1]);
- BIF_SetScale(aspect);
- BIF_DrawString(font, str, 0);
-
-
- if(line) setlinestyle(2);
- cpack(border);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glRectf(x1, y1, x2, y2);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- if(line) setlinestyle(0);
-
- /* connection blocks */
- ol= oops->link.first;
- while(ol) {
-
- f1= x1+ol->xof;
- f2= y1+ol->yof;
-
- body= give_oops_color(ol->type, oops->flag & SELECT, &border);
- cpack(body);
-
- glRectf(f1-.2, f2-.2, f1+.2, f2+.2);
- cpack(border);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glRectf(f1-.2, f2-.2, f1+.2, f2+.2);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-
- ol= ol->next;
- }
-
- if(oops->flag & OOPS_REFER) {
- /* Draw the little rounded connection point */
- glColor3ub(0, 0, 0);
- glPushMatrix();
-
- glTranslatef(oops->x + 0.5*OOPSX, oops->y, 0.0);
- glutil_draw_filled_arc(0.0, M_PI, 0.05*OOPSX, 7);
-
- glPopMatrix();
- }
-}
-
-void drawoopsspace(ScrArea *sa, void *spacedata)
-{
- SpaceOops *soops= spacedata;
- Oops *oops;
- float col[3];
-
- BIF_GetThemeColor3fv(TH_BACK, col);
-
- if(soops==0) return;
-
- /* darker background for oops */
- if(soops->type!=SO_OUTLINER) {
- col[0] = col[0] * 0.75; col[1] = col[1] * 0.75; col[2] = col[2] * 0.75;
- }
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- if(soops->type==SO_OUTLINER) draw_outliner(sa, soops);
- else {
- build_oops(); /* changed to become first call... */
-
- boundbox_oops(0);
- calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
-
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- aspect= (G.v2d->cur.xmax - G.v2d->cur.xmin)/((float)sa->winx);
- font= uiSetCurFont_ext(30*aspect);
-
- calc_ipogrid(); /* for scrollvariables */
-
- /* drop shadow */
- BIF_ThemeColorShade(TH_BACK, -96); /* drop shadow color */
- glRectf(G.v2d->tot.xmin-1, G.v2d->tot.ymin-3, G.v2d->tot.xmax+3,
- G.v2d->tot.ymax+1);
-
- /* light square in the center */
- BIF_GetThemeColor3fv(TH_BACK, col);
- glColor3fv(col);
- glRectf(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2,
- G.v2d->tot.ymax+2);
-
- /* box around the oops. */
- cpack(0x0);
- mysbox(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2,
- G.v2d->tot.ymax+2);
-
-
- /* Draw unselected oops links */
- for(oops= soops->oops.first; oops; oops = oops->next) {
- if(oops->hide==0 && (oops->flag & SELECT)); else {
- draw_oopslink(oops);
- }
- }
-
- /* Draw selected oops links */
- for(oops= soops->oops.first; oops; oops = oops->next) {
- if(oops->hide==0 && (oops->flag & SELECT)) {
- draw_oopslink(oops);
- }
- }
-
- for(oops= soops->oops.first; oops; oops = oops->next) {
- if(oops->hide==0) {
- if(oops->flag & SELECT); else draw_oops(oops);
- }
- }
-
- for(oops= soops->oops.first; oops; oops = oops->next) {
- if(oops->hide==0) {
- if(oops->flag & SELECT) draw_oops(oops);
- }
- }
- }
-
- /* restore viewport */
- mywinset(curarea->win);
-
- /* ortho at pixel level curarea */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- if(soops->type==SO_OUTLINER) {
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
- if(G.v2d->scroll) drawscroll(0);
- }
- }
- draw_area_emboss(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-}
-
-
-
-
diff --git a/source/blender/src/drawscene.c b/source/blender/src/drawscene.c
deleted file mode 100644
index 124a09da3a2..00000000000
--- a/source/blender/src/drawscene.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * drawing graphics and editing
- */
-
-#include <math.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-#include "BDR_sculptmode.h"
-#include "BDR_vpaint.h"
-
-#include "BIF_space.h"
-#include "BIF_drawscene.h"
-#include "BIF_editseq.h"
-#include "BIF_poseobject.h"
-
-#include "BSE_view.h"
-
-#include "radio.h"
-
-#include "blendef.h" /* old */
-#include "mydevice.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-void set_scene(Scene *sce) /* also see scene.c: set_scene_bg() */
-{
- bScreen *sc;
-
- /* ending all modes */
- if( G.obedit)
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
-
- exit_paint_modes();
-
- set_last_seq(NULL);
-
- G.scene= sce;
-
- sc= G.main->screen.first;
- while(sc) {
- if((U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
-
- if(sce != sc->scene) {
- /* all areas endlocalview */
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- endlocalview(sa);
- sa= sa->next;
- }
- sc->scene= sce;
- }
-
- }
- sc= sc->id.next;
- }
-
- copy_view3d_lock(0); /* space.c */
-
- /* are there cameras in the views that are not in the scene? */
- sc= G.main->screen.first;
- while(sc) {
- if( (U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D*) sl;
- if (!v3d->camera || !object_in_scene(v3d->camera, sce)) {
- v3d->camera= scene_find_camera(sc->scene);
- if (sc==G.curscreen) handle_view3d_lock();
- if (!v3d->camera && v3d->persp==V3D_CAMOB) v3d->persp= V3D_PERSP;
- }
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- }
- sc= sc->id.next;
- }
-
- set_scene_bg(G.scene);
- scene_update_for_newframe(G.scene, G.scene->lay);
-
- set_radglobal();
-
- /* complete redraw */
- allqueue(REDRAWALL, 0);
- allqueue(REDRAWDATASELECT, 0); /* does a remake */
-}
-
-
diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c
deleted file mode 100644
index f9e2d138a78..00000000000
--- a/source/blender/src/drawscript.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: drawtext.c.
- *
- * Contributor(s): Willian Padovani Germano.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_text.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "BIF_gl.h"
-#include "BIF_keyval.h"
-#include "BIF_interface.h"
-#include "BIF_drawscript.h"
-#include "BIF_editfont.h"
-#include "BIF_spacetypes.h"
-#include "BIF_usiblender.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-
-#include "BSE_filesel.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "interface.h"
-
-void drawscriptspace(ScrArea *sa, void *spacedata);
-void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-void drawscriptspace(ScrArea *sa, void *spacedata)
-{
- SpaceScript *sc = curarea->spacedata.first;
- Script *script = NULL;
-
- glClearColor(0.6, 0.6, 0.6, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
- myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5);
-
-#ifdef DISABLE_PYTHON
- return;
-#else
- if (!sc->script) return;
-
- script = sc->script;
-
- /* Is this script loaded from a file and it needs running??? */
- if ( (G.f & G_DOSCRIPTLINKS) &&
- script->scriptname[0] != '\0' &&
- (script->flags == 0 &&
- script->py_event == NULL &&
- script->py_button == NULL &&
- script->py_draw == NULL )
- ) {
- if (!BPY_run_script(script)) {
- /* if this fails, script will be free'd */
- script = NULL;
- }
- }
-
- if (script) {
- if (script->py_draw) {
- BPY_spacescript_do_pywin_draw(sc);
- } else if (!script->flags && !script->py_event && !script->py_button) {
- /* quick hack for 2.37a for scripts that call the progress bar inside a
- * file selector callback, to show previous space after finishing, w/o
- * needing an event */
- addqueue(curarea->win, MOUSEX, 0);
- }
- }
-#endif /* DISABLE_PYTHON */
-}
-
-void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt)
-{
-#ifndef DISABLE_PYTHON
- unsigned short event = evt->event;
- short val = evt->val;
- char ascii = evt->ascii;
- SpaceScript *sc = curarea->spacedata.first;
- Script *script = sc->script;
-
- if (script) {
- /* Is this script loaded from a file and it needs running??? */
- if ( (G.f & G_DOSCRIPTLINKS) &&
- script->scriptname[0] != '\0' &&
- (script->flags == 0 &&
- script->py_event == NULL &&
- script->py_button == NULL &&
- script->py_draw == NULL )
- ) {
- if (!BPY_run_script(script)) {
- /* if this fails, script will be free'd */
- script = NULL;
- }
- }
- }
-
- if (script) {
- if (script->py_event || script->py_button)
- BPY_spacescript_do_pywin_event(sc, event, val, ascii);
-
- /* for file/image sel scripts: if user leaves file/image selection space,
- * this frees the script (since it can't be accessed anymore): */
- else if (script->flags == SCRIPT_FILESEL) {
- script->flags = 0;
- script->lastspace = SPACE_SCRIPT;
- }
-
- if (!script->flags) {/* finished with this script, let's free it */
- if (script->lastspace != SPACE_SCRIPT)
- newspace (curarea, script->lastspace);
- BPY_free_finished_script(script);
- sc->script = NULL;
- }
- }
- else {
- if (event == QKEY)
- if (val && (G.qual & LR_CTRLKEY) && okee("Quit Blender")) exit_usiblender();
- }
-#endif
- return;
-
-}
-
-void free_scriptspace (SpaceScript *sc)
-{
- if (!sc) return;
-#ifndef DISABLE_PYTHON
- /*free buttons references*/
- if (sc->but_refs) {
- BPy_Set_DrawButtonsList(sc->but_refs);
- BPy_Free_DrawButtonsList();
- sc->but_refs = NULL;
- }
-#endif
- sc->script = NULL;
-}
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
deleted file mode 100644
index f54ac186a21..00000000000
--- a/source/blender/src/drawseq.c
+++ /dev/null
@@ -1,1266 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "DNA_gpencil_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_global.h"
-#include "BKE_plugin_types.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_cursors.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_drawseq.h"
-#include "BIF_editseq.h"
-#include "BIF_glutil.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_interface.h"
-
-#include "BIF_drawgpencil.h"
-#include "BDR_gpencil.h"
-
-#include "BSE_view.h"
-#include "BSE_drawipo.h"
-#include "BSE_sequence.h"
-#include "BSE_seqeffects.h"
-#include "BSE_seqscopes.h"
-#include "BSE_seqaudio.h"
-#include "BSE_time.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "blendef.h" /* CFRA */
-#include "mydevice.h" /* REDRAWSEQ */
-#include "interface.h"
-#include "winlay.h"
-
-#define SEQ_LEFTHANDLE 1
-#define SEQ_RIGHTHANDLE 2
-
-#define SEQ_STRIP_OFSBOTTOM 0.2
-#define SEQ_STRIP_OFSTOP 0.8
-
-/* Note, Dont use WHILE_SEQ while drawing! - it messes up transform, - Campbell */
-
-int no_rightbox=0, no_leftbox= 0;
-static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction);
-static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq);
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col);
-static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2);
-static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct SpaceSeq *sseq, int outline_tint, float pixelx);
-
-
-static void seq_panel_gpencil(short cntrl) // SEQ_HANDLER_GREASEPENCIL
-{
- uiBlock *block;
- SpaceSeq *sseq;
-
- sseq= curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(SEQ_HANDLER_GREASEPENCIL); // for close and esc
- if (uiNewPanel(curarea, block, "Grease Pencil", "Seq", 100, 30, 318, 204)==0) return;
-
- /* only draw settings if right mode */
- if (sseq->mainb == 0)
- return;
-
- /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
- if (sseq->flag & SEQ_DRAW_GPENCIL) {
- if (sseq->gpd == NULL)
- gpencil_data_setactive(curarea, gpencil_data_addnew());
- }
-
- if (sseq->flag & SEQ_DRAW_GPENCIL) {
- bGPdata *gpd= sseq->gpd;
- short newheight;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- /* draw button for showing gpencil settings and drawings */
- uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View (draw using Shift-LMB)");
-
- /* extend the panel if the contents won't fit */
- newheight= draw_gpencil_panel(block, gpd, curarea);
- uiNewPanelHeight(block, newheight);
- }
- else {
- uiDefButBitI(block, TOG, SEQ_DRAW_GPENCIL, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &sseq->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Sequencer View");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
-}
-
-static void seq_blockhandlers(ScrArea *sa)
-{
- SpaceSeq *sseq= sa->spacedata.first;
- short a;
-
- /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(sseq->blockhandler[a]) {
- case SEQ_HANDLER_GREASEPENCIL:
- seq_panel_gpencil(sseq->blockhandler[a+1]);
- break;
- }
- /* clear action value for event */
- sseq->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-
-}
-
-
-static void draw_cfra_seq(void)
-{
- glColor3ub(0x30, 0x90, 0x50);
- glLineWidth(2.0);
- glBegin(GL_LINES);
- glVertex2f(G.scene->r.cfra, G.v2d->cur.ymin);
- glVertex2f(G.scene->r.cfra, G.v2d->cur.ymax);
- glEnd();
- glLineWidth(1.0);
-}
-
-static void get_seq_color3ubv(Sequence *seq, char *col)
-{
- char blendcol[3];
- float hsv[3], rgb[3];
- SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
-
- switch(seq->type) {
- case SEQ_IMAGE:
- BIF_GetThemeColor3ubv(TH_SEQ_IMAGE, col);
- break;
- case SEQ_META:
- BIF_GetThemeColor3ubv(TH_SEQ_META, col);
- break;
- case SEQ_MOVIE:
- BIF_GetThemeColor3ubv(TH_SEQ_MOVIE, col);
- break;
- case SEQ_SCENE:
- BIF_GetThemeColor3ubv(TH_SEQ_SCENE, col);
-
- if(seq->scene==G.scene) {
- BIF_GetColorPtrBlendShade3ubv(col, col, col, 1.0, 20);
- }
- break;
-
- /* transitions */
- case SEQ_CROSS:
- case SEQ_GAMCROSS:
- case SEQ_WIPE:
- /* slightly offset hue to distinguish different effects */
- BIF_GetThemeColor3ubv(TH_SEQ_TRANSITION, col);
-
- rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0;
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
-
- if (seq->type == SEQ_CROSS) hsv[0]+= 0.04;
- if (seq->type == SEQ_GAMCROSS) hsv[0]+= 0.08;
- if (seq->type == SEQ_WIPE) hsv[0]+= 0.12;
-
- if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
- col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255);
- break;
-
- /* effects */
- case SEQ_TRANSFORM:
- case SEQ_SPEED:
- case SEQ_ADD:
- case SEQ_SUB:
- case SEQ_MUL:
- case SEQ_ALPHAOVER:
- case SEQ_ALPHAUNDER:
- case SEQ_OVERDROP:
- case SEQ_GLOW:
- /* slightly offset hue to distinguish different effects */
- BIF_GetThemeColor3ubv(TH_SEQ_EFFECT, col);
-
- rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0;
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
-
- if (seq->type == SEQ_ADD) hsv[0]+= 0.04;
- if (seq->type == SEQ_SUB) hsv[0]+= 0.08;
- if (seq->type == SEQ_MUL) hsv[0]+= 0.12;
- if (seq->type == SEQ_ALPHAOVER) hsv[0]+= 0.16;
- if (seq->type == SEQ_ALPHAUNDER) hsv[0]+= 0.20;
- if (seq->type == SEQ_OVERDROP) hsv[0]+= 0.24;
- if (seq->type == SEQ_GLOW) hsv[0]+= 0.28;
- if (seq->type == SEQ_TRANSFORM) hsv[0]+= 0.36;
-
- if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
- col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255);
- break;
- case SEQ_COLOR:
- if (colvars->col) {
- col[0]= (char)(colvars->col[0]*255);
- col[1]= (char)(colvars->col[1]*255);
- col[2]= (char)(colvars->col[2]*255);
- } else {
- col[0] = col[1] = col[2] = 128;
- }
- break;
- case SEQ_PLUGIN:
- BIF_GetThemeColor3ubv(TH_SEQ_PLUGIN, col);
- break;
- case SEQ_HD_SOUND:
- case SEQ_RAM_SOUND:
- BIF_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
- blendcol[0] = blendcol[1] = blendcol[2] = 128;
- if(seq->flag & SEQ_MUTE) BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
- break;
- default:
- col[0] = 10; col[1] = 255; col[2] = 40;
- }
-}
-
-static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, float y2)
-{
- /* Note, this used to use WHILE_SEQ, but it messes up the seq->depth value, (needed by transform when doing overlap checks)
- * so for now, just use the meta's immediate children, could be fixed but its only drawing - Campbell */
- Sequence *seq;
- float dx;
- int nr;
- char col[3];
-
- nr= BLI_countlist(&seqm->seqbase);
-
- dx= (x2-x1)/nr;
-
- if (seqm->flag & SEQ_MUTE) {
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_halftone);
-
- glEnable(GL_LINE_STIPPLE);
- glLineStipple(1, 0x8888);
- }
-
- for (seq= seqm->seqbase.first; seq; seq= seq->next) {
- get_seq_color3ubv(seq, col);
-
- glColor3ubv((GLubyte *)col);
-
- glRectf(x1, y1, x1+0.9*dx, y2);
-
- BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30);
- glColor3ubv((GLubyte *)col);
-
- fdrawbox(x1, y1, x1+0.9*dx, y2);
-
- x1+= dx;
- }
-
- if (seqm->flag & SEQ_MUTE) {
- glDisable(GL_POLYGON_STIPPLE);
- glDisable(GL_LINE_STIPPLE);
- }
-}
-
-static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, int winx)
-{
- /*
- x1 is the starting x value to draw the wave,
- x2 the end x value, same for y1 and y2
- winx is the zoom level.
- */
-
- float
- f, /* floating point value used to store the X draw location for the wave lines when openGL drawing*/
- midy, /* fast access to the middle location (y1+y2)/2 */
- clipxmin, /* the minimum X value, clip this with the window */
- clipxmax, /* the maximum X value, clip this with the window */
- sample_step, /* steps to move per sample, floating value must later translate into an int */
- fsofs, /* steps to move per sample, floating value must later translate into an int */
- feofs_sofs, /* */
- sound_width, /* convenience: x2-x1 */
- wavemulti; /* scale the samples by this value when GL_LINE drawing so it renders the right height */
-
- int
- offset, /* initial offset value for the wave drawing */
- offset_next, /* when in the wave drawing loop this value is the samples intil the next vert */
- sofs, /* Constrained offset value (~3) for the wave, start */
- eofs, /* ditto, end */
- wavesample, /* inner loop storage if the current wave sample value, used to make the 2 values below */
- wavesamplemin, /* used for finding the min and max wave peaks */
- wavesamplemax, /* ditto */
- subsample_step=4; /* when the sample step is 4 every sample of
- the wave is evaluated for min and max values used to draw the wave,
- however this is slow ehrn zoomed out so when the sample step is above
- 1 (the larger the further out the zoom is) so not evaluate all samples, only some. */
-
- signed short* s;
- bSound *sound;
- uint8_t *stream;
-
- audio_makestream(seq->sound);
- if(seq->sound==NULL || seq->sound->stream==NULL) return;
-
- if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0);
-
- sofs = ((int)( FRA2TIME(seq->startdisp-seq->start+seq->anim_startofs)*(float)G.scene->audio.mixrate*4.0 )) & (~3);
- eofs = ((int)( FRA2TIME(seq->enddisp-seq->start+seq->anim_startofs)*(float)G.scene->audio.mixrate*4.0 )) & (~3);
-
- /* clip the drawing area to the screen bounds to save time */
- sample_step= (G.v2d->cur.xmax - G.v2d->cur.xmin)/winx;
- clipxmin= MAX2(x1, G.v2d->cur.xmin);
- clipxmax= MIN2(x2, G.v2d->cur.xmax);
-
- if (sample_step > 1)
- subsample_step= ((int)(subsample_step*sample_step*8)) & (~3);
-
- /* for speedy access */
- midy = (y1+y2)/2;
- fsofs= (float)sofs;
- feofs_sofs= (float)(eofs-sofs);
- sound_width= x2-x1;
- sound = seq->sound;
- stream = sound->stream;
- wavemulti = (y2-y1)/196605; /*y2-y1 is the height*/
- wavesample=0;
-
- /* we need to get the starting offset value, excuse the duplicate code */
- f=clipxmin;
- offset= (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3);
-
- /* start the loop, draw a line per sample_step -sample_step is about 1 line drawn per pixel */
- glBegin(GL_LINES);
- for (f=x1+sample_step; f<=clipxmax; f+=sample_step) {
-
- offset_next = (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3);
- if (f > G.v2d->cur.xmin) {
- /* if this is close to the last sample just exit */
- if (offset_next >= sound->streamlen) break;
-
- wavesamplemin = 131070;
- wavesamplemax = -131070;
-
- /*find with high and low of the waveform for this draw,
- evaluate small samples to find this range */
- while (offset < offset_next) {
- s = (signed short*)(stream+offset);
-
- wavesample = s[0]*2 + s[1];
- if (wavesamplemin>wavesample)
- wavesamplemin=wavesample;
- if (wavesamplemax<wavesample)
- wavesamplemax=wavesample;
- offset+=subsample_step;
- }
- /* draw the wave line, looks good up close and zoomed out */
- glVertex2f(f, midy-(wavemulti*wavesamplemin) );
- glVertex2f(f, midy-(wavemulti*wavesamplemax) );
- } else {
- while (offset < offset_next) offset+=subsample_step;
- }
-
- offset=offset_next;
- }
- glEnd();
-}
-
-/* draw a handle, for each end of a sequence strip */
-static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction)
-{
- float v1[2], v2[2], v3[2], rx1=0, rx2=0; //for triangles and rect
- float x1, x2, y1, y2;
- float handsize;
- float minhandle, maxhandle;
- char str[32];
- unsigned int whichsel=0;
- View2D *v2d;
-
- x1= seq->startdisp;
- x2= seq->enddisp;
-
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
-
- v2d = &sseq->v2d;
-
- /* clamp handles to defined size in pixel space */
- handsize = seq->handsize;
- minhandle = 7;
- maxhandle = 40;
- CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx);
-
- /* set up co-ordinates/dimensions for either left or right handle */
- if (direction == SEQ_LEFTHANDLE) {
- rx1 = x1;
- rx2 = x1+handsize*0.75;
-
- v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2);
- v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2);
- v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0;
-
- whichsel = SEQ_LEFTSEL;
- } else if (direction == SEQ_RIGHTHANDLE) {
- rx1 = x2-handsize*0.75;
- rx2 = x2;
-
- v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2);
- v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2);
- v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0;
-
- whichsel = SEQ_RIGHTSEL;
- }
-
- /* draw! */
- if(seq->type < SEQ_EFFECT ||
- get_sequence_effect_num_inputs(seq->type) == 0) {
- glEnable( GL_BLEND );
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- if(seq->flag & whichsel) glColor4ub(0, 0, 0, 80);
- else if (seq->flag & SELECT) glColor4ub(255, 255, 255, 30);
- else glColor4ub(0, 0, 0, 22);
-
- glRectf(rx1, y1, rx2, y2);
-
- if(seq->flag & whichsel) glColor4ub(255, 255, 255, 200);
- else glColor4ub(0, 0, 0, 50);
-
- glEnable( GL_POLYGON_SMOOTH );
- glBegin(GL_TRIANGLES);
- glVertex2fv(v1); glVertex2fv(v2); glVertex2fv(v3);
- glEnd();
-
- glDisable( GL_POLYGON_SMOOTH );
- glDisable( GL_BLEND );
- }
-
- if(G.moving || (seq->flag & whichsel)) {
- cpack(0xFFFFFF);
- if (direction == SEQ_LEFTHANDLE) {
- sprintf(str, "%d", seq->startdisp);
- glRasterPos3f(rx1, y1-0.15, 0.0);
- } else {
- sprintf(str, "%d", seq->enddisp - 1);
- glRasterPos3f((x2-BMF_GetStringWidth(G.fonts, str)*pixelx), y2+0.05, 0.0);
- }
- BMF_DrawString(G.fonts, str);
- }
-}
-
-static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq)
-{
- float x1, x2, y1, y2, pixely, a;
- char col[3], blendcol[3];
- View2D *v2d;
-
- if(seq->type >= SEQ_EFFECT) return;
-
- x1= seq->startdisp;
- x2= seq->enddisp;
-
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
-
- v2d = &sseq->v2d;
- pixely = (v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin);
-
- blendcol[0] = blendcol[1] = blendcol[2] = 120;
-
- if(seq->startofs) {
- glEnable( GL_BLEND );
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- get_seq_color3ubv(seq, col);
-
- if (seq->flag & SELECT) {
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
- glColor4ub(col[0], col[1], col[2], 170);
- } else {
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
- glColor4ub(col[0], col[1], col[2], 110);
- }
-
- glRectf((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1);
-
- if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255);
- else glColor4ub(col[0], col[1], col[2], 160);
-
- fdrawbox((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); //outline
-
- glDisable( GL_BLEND );
- }
- if(seq->endofs) {
- glEnable( GL_BLEND );
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- get_seq_color3ubv(seq, col);
-
- if (seq->flag & SELECT) {
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
- glColor4ub(col[0], col[1], col[2], 170);
- } else {
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
- glColor4ub(col[0], col[1], col[2], 110);
- }
-
- glRectf(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM);
-
- if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255);
- else glColor4ub(col[0], col[1], col[2], 160);
-
- fdrawbox(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); //outline
-
- glDisable( GL_BLEND );
- }
- if(seq->startstill) {
- get_seq_color3ubv(seq, col);
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40);
- glColor3ubv((GLubyte *)col);
-
- draw_shadedstrip(seq, col, x1, y1, (float)(seq->start), y2);
-
- /* feint pinstripes, helps see exactly which is extended and which isn't,
- * especially when the extension is very small */
- if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
- else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16);
-
- glColor3ubv((GLubyte *)col);
-
- for(a=y1; a< y2; a+= pixely*2.0 ) {
- fdrawline(x1, a, (float)(seq->start), a);
- }
- }
- if(seq->endstill) {
- get_seq_color3ubv(seq, col);
- BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40);
- glColor3ubv((GLubyte *)col);
-
- draw_shadedstrip(seq, col, (float)(seq->start+seq->len), y1, x2, y2);
-
- /* feint pinstripes, helps see exactly which is extended and which isn't,
- * especially when the extension is very small */
- if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
- else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16);
-
- glColor3ubv((GLubyte *)col);
-
- for(a=y1; a< y2; a+= pixely*2.0 ) {
- fdrawline((float)(seq->start+seq->len), a, x2, a);
- }
- }
-}
-
-/* draw info text on a sequence strip */
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2, char *background_col)
-{
- float v1[2], v2[2];
- int len, size;
- char str[32 + FILE_MAXDIR+FILE_MAXFILE], *strp;
- short mval[2];
-
- v1[1]= y1;
- v2[1]= y2;
-
- v1[0]= x1;
- ipoco_to_areaco_noclip(G.v2d, v1, mval);
- x1= mval[0];
- v2[0]= x2;
- ipoco_to_areaco_noclip(G.v2d, v2, mval);
- x2= mval[0];
- size= x2-x1;
-
- if(seq->name[2]) {
- sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->name+2);
- }else{
- if(seq->type == SEQ_META) {
- sprintf(str, "%d | %s", seq->len, give_seqname(seq));
- }
- else if(seq->type == SEQ_SCENE) {
- if(seq->scene) sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->scene->id.name+2);
- else sprintf(str, "%d | %s", seq->len, give_seqname(seq));
-
- }
- else if(seq->type == SEQ_IMAGE) {
- sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
- }
- else if(seq->type & SEQ_EFFECT) {
- int can_float = (seq->type != SEQ_PLUGIN)
- || (seq->plugin && seq->plugin->version >= 4);
-
- if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
- sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!");
- else if (seq->seq1 && seq->seq2)
- sprintf(str, "%d | %s: %d>%d%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!");
- else
- sprintf(str, "%d | %s", seq->len, give_seqname(seq));
- }
- else if (seq->type == SEQ_RAM_SOUND) {
- sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name);
- }
- else if (seq->type == SEQ_HD_SOUND) {
- sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name);
- }
- else if (seq->type == SEQ_MOVIE) {
- sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
- }
- }
-
- strp= str;
-
- while( (len= BMF_GetStringWidth(G.font, strp)) > size) {
- if(len < 10) break;
- if(strp[1]==0) break;
- strp++;
- }
-
- mval[0]= (x1+x2-len+1)/2;
- mval[1]= 1;
- areamouseco_to_ipoco(G.v2d, mval, &x1, &x2);
-
- if(seq->flag & SELECT){
- cpack(0xFFFFFF);
- }else if ((((int)background_col[0] + (int)background_col[1] + (int)background_col[2]) / 3) < 50){
- cpack(0x505050); /* use lighter text colour for dark background */
- }else{
- cpack(0);
- }
- glRasterPos3f(x1, y1+SEQ_STRIP_OFSBOTTOM, 0.0);
- BMF_DrawString(G.font, strp);
-}
-
-/* draws a shaded strip, made from gradient + flat color + gradient */
-static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2)
-{
- float ymid1, ymid2;
-
- if (seq->flag & SEQ_MUTE) {
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(stipple_halftone);
- }
-
- ymid1 = (y2-y1)*0.25 + y1;
- ymid2 = (y2-y1)*0.65 + y1;
-
- glShadeModel(GL_SMOOTH);
- glBegin(GL_QUADS);
-
- if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -50);
- else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 0);
-
- glColor3ubv((GLubyte *)col);
-
- glVertex2f(x1,y1);
- glVertex2f(x2,y1);
-
- if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5);
- else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -5);
-
- glColor3ubv((GLubyte *)col);
-
- glVertex2f(x2,ymid1);
- glVertex2f(x1,ymid1);
-
- glEnd();
-
- glRectf(x1, ymid1, x2, ymid2);
-
- glBegin(GL_QUADS);
-
- glVertex2f(x1,ymid2);
- glVertex2f(x2,ymid2);
-
- if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -15);
- else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 25);
-
- glColor3ubv((GLubyte *)col);
-
- glVertex2f(x2,y2);
- glVertex2f(x1,y2);
-
- glEnd();
-
- if (seq->flag & SEQ_MUTE) {
- glDisable(GL_POLYGON_STIPPLE);
- }
-}
-
-/*
-Draw a sequence strip, bounds check alredy made
-ScrArea is currently only used to get the windows width in pixels
-so wave file sample drawing precission is zoom adjusted
-*/
-static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outline_tint, float pixelx)
-{
- float x1, x2, y1, y2;
- char col[3], background_col[3], is_single_image;
-
- /* we need to know if this is a single image/color or not for drawing */
- is_single_image = (char)check_single_seq(seq);
-
- /* body */
- if(seq->startstill) x1= seq->start;
- else x1= seq->startdisp;
- y1= seq->machine+SEQ_STRIP_OFSBOTTOM;
- if(seq->endstill) x2= seq->start+seq->len;
- else x2= seq->enddisp;
- y2= seq->machine+SEQ_STRIP_OFSTOP;
-
-
- /* get the correct color per strip type*/
- //get_seq_color3ubv(seq, col);
- get_seq_color3ubv(seq, background_col);
-
- /* draw the main strip body */
- if (is_single_image) /* single image */
- draw_shadedstrip(seq, background_col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
- else /* normal operation */
- draw_shadedstrip(seq, background_col, x1, y1, x2, y2);
-
- /* draw additional info and controls */
- if (seq->type == SEQ_RAM_SOUND)
- drawseqwave(seq, x1, y1, x2, y2, sa->winx);
-
- if (!is_single_image)
- draw_seq_extensions(seq, sseq);
-
- draw_seq_handle(seq, sseq, pixelx, SEQ_LEFTHANDLE);
- draw_seq_handle(seq, sseq, pixelx, SEQ_RIGHTHANDLE);
-
- /* draw the strip outline */
- x1= seq->startdisp;
- x2= seq->enddisp;
-
- get_seq_color3ubv(seq, col);
- if (G.moving && (seq->flag & SELECT)) {
- if(seq->flag & SEQ_OVERLAP) {
- col[0]= 255; col[1]= col[2]= 40;
- } else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 120);
- }
-
- BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, outline_tint);
-
- glColor3ubv((GLubyte *)col);
-
- if (seq->flag & SEQ_MUTE) {
- glEnable(GL_LINE_STIPPLE);
- glLineStipple(1, 0x8888);
- }
-
- gl_round_box_shade(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0);
-
- if (seq->flag & SEQ_MUTE) {
- glDisable(GL_LINE_STIPPLE);
- }
-
- /* calculate if seq is long enough to print a name */
- x1= seq->startdisp+seq->handsize;
- x2= seq->enddisp-seq->handsize;
-
- /* but first the contents of a meta */
- if(seq->type==SEQ_META) drawmeta_contents(seq, x1, y1+0.15, x2, y2-0.15);
-
- /* info text on the strip */
- if(x1<G.v2d->cur.xmin) x1= G.v2d->cur.xmin;
- else if(x1>G.v2d->cur.xmax) x1= G.v2d->cur.xmax;
- if(x2<G.v2d->cur.xmin) x2= G.v2d->cur.xmin;
- else if(x2>G.v2d->cur.xmax) x2= G.v2d->cur.xmax;
-
- /* nice text here would require changing the view matrix for texture text */
- if( (x2-x1) / pixelx > 32) {
- draw_seq_text(seq, x1, x2, y1, y2, background_col);
- }
-}
-
-static Sequence *special_seq_update= 0;
-
-void set_special_seq_update(int val)
-{
- int x;
-
- /* if mouse over a sequence && LEFTMOUSE */
- if(val) {
- special_seq_update= find_nearest_seq(&x);
- }
- else special_seq_update= 0;
-}
-
-
-static void draw_image_seq(ScrArea *sa)
-{
- SpaceSeq *sseq;
- struct ImBuf *ibuf;
- int x1, y1, rectx, recty;
- int free_ibuf = 0;
- static int recursive= 0;
- float zoom;
- float zoomx, zoomy;
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- sseq= sa->spacedata.first;
- if(sseq==0) return;
-
- rectx= (G.scene->r.size*G.scene->r.xsch)/100;
- recty= (G.scene->r.size*G.scene->r.ysch)/100;
-
- /* BIG PROBLEM: the give_ibuf_seq() can call a rendering, which in turn calls redraws...
- this shouldn't belong in a window drawing....
- So: solve this once event based.
- Now we check for recursion, space type and active area again (ton) */
-
- if(recursive)
- return;
- else {
- recursive= 1;
- if (special_seq_update) {
- ibuf= give_ibuf_seq_direct(
- rectx, recty, (G.scene->r.cfra),
- special_seq_update);
- } else if (!U.prefetchframes || (G.f & G_PLAYANIM) == 0) {
- ibuf= (ImBuf *)give_ibuf_seq(
- rectx, recty, (G.scene->r.cfra),
- sseq->chanshown);
- } else {
- ibuf= (ImBuf *)give_ibuf_seq_threaded(
- rectx, recty, (G.scene->r.cfra),
- sseq->chanshown);
- }
- recursive= 0;
-
- /* HURMF! the give_ibuf_seq can call image display in this window */
- if(sa->spacetype!=SPACE_SEQ)
- return;
- if(sa!=curarea) {
- areawinset(sa->win);
- }
- }
-
- if(ibuf==NULL)
- return;
-
- if(ibuf->rect==NULL && ibuf->rect_float == NULL)
- return;
-
- switch(sseq->mainb) {
- case SEQ_DRAW_IMG_IMBUF:
- if (sseq->zebra != 0) {
- ibuf = make_zebra_view_from_ibuf(ibuf, sseq->zebra);
- free_ibuf = 1;
- }
- break;
- case SEQ_DRAW_IMG_WAVEFORM:
- if ((sseq->flag & SEQ_DRAW_COLOR_SEPERATED) != 0) {
- ibuf = make_sep_waveform_view_from_ibuf(ibuf);
- } else {
- ibuf = make_waveform_view_from_ibuf(ibuf);
- }
- free_ibuf = 1;
- break;
- case SEQ_DRAW_IMG_VECTORSCOPE:
- ibuf = make_vectorscope_view_from_ibuf(ibuf);
- free_ibuf = 1;
- break;
- case SEQ_DRAW_IMG_HISTOGRAM:
- ibuf = make_histogram_view_from_ibuf(ibuf);
- free_ibuf = 1;
- break;
- }
-
- if(ibuf->rect_float && ibuf->rect==NULL)
- IMB_rect_from_float(ibuf);
-
- /* needed for gla draw */
- glaDefine2DArea(&curarea->winrct);
-
- zoom= SEQ_ZOOM_FAC(sseq->zoom);
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
- zoomy = zoom;
- } else {
- zoomx = zoomy = zoom;
- }
-
- /* calc location */
- x1= (sa->winx-zoomx*ibuf->x)/2 + sseq->xof;
- y1= (sa->winy-zoomy*ibuf->y)/2 + sseq->yof;
-
- glPixelZoom(zoomx, zoomy);
-
- glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
-
- glPixelZoom(1.0, 1.0);
-
- /* safety border */
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF &&
- (sseq->flag & SEQ_DRAW_SAFE_MARGINS) != 0) {
- float fac= 0.1;
- float x2 = x1 + ibuf->x * zoomx;
- float y2 = y1 + ibuf->y * zoomy;
-
- float a= fac*(x2-x1);
- x1+= a;
- x2-= a;
-
- a= fac*(y2-y1);
- y1+= a;
- y2-= a;
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- setlinestyle(3);
-
- BIF_ThemeColorBlendShade(TH_WIRE, TH_BACK, 1.0, 0);
-
- uiSetRoundBox(15);
- gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
-
- setlinestyle(0);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
-
- /* draw grease-pencil (image aligned) */
- if (sseq->flag & SEQ_DRAW_GPENCIL)
- draw_gpencil_2dimage(sa, ibuf);
-
- if (free_ibuf) {
- IMB_freeImBuf(ibuf);
- }
-
- /* draw grease-pencil (screen aligned) */
- if (sseq->flag & SEQ_DRAW_GPENCIL)
- draw_gpencil_2dview(sa, 0);
-
- /* ortho at pixel level sa */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, sseq->blockscale, sseq->blockscale, sseq->blockscale);
- seq_blockhandlers(sa);
-
- sa->win_swap= WIN_BACK_OK;
-}
-
-void seq_reset_imageofs(SpaceSeq *sseq)
-{
- sseq->xof = sseq->yof = sseq->zoom = 0;
-}
-
-void seq_home(void)
-{
- SpaceSeq *sseq= curarea->spacedata.first;
-
- if (!sseq->mainb) {
- G.v2d->cur= G.v2d->tot;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- } else {
- float zoomX, zoomY;
- int width, height, imgwidth, imgheight;
-
- width = curarea->winx;
- height = curarea->winy;
-
- seq_reset_imageofs(sseq);
-
- imgwidth= (G.scene->r.size*G.scene->r.xsch)/100;
- imgheight= (G.scene->r.size*G.scene->r.ysch)/100;
-
- /* Apply aspect, dosnt need to be that accurate */
- imgwidth= (int)(imgwidth * ((float)G.scene->r.xasp / (float)G.scene->r.yasp));
-
- if (((imgwidth >= width) || (imgheight >= height)) &&
- ((width > 0) && (height > 0))) {
-
- /* Find the zoom value that will fit the image in the image space */
- zoomX = ((float)width) / ((float)imgwidth);
- zoomY = ((float)height) / ((float)imgheight);
- sseq->zoom= (zoomX < zoomY) ? zoomX : zoomY;
-
- sseq->zoom = 1.0f / power_of_2(1/ MIN2(zoomX, zoomY) );
- }
- else {
- sseq->zoom= 1.0f;
- }
- }
- scrarea_queue_winredraw(curarea);
-}
-
-void seq_viewzoom(unsigned short event, int invert)
-{
- SpaceSeq *sseq= curarea->spacedata.first;
-
- if(event==PAD1)
- sseq->zoom= 1.0;
- else if(event==PAD2)
- sseq->zoom= (invert)? 2.0: 0.5;
- else if(event==PAD4)
- sseq->zoom= (invert)? 4.0: 0.25;
- else if(event==PAD8)
- sseq->zoom= (invert)? 8.0: 0.125;
-
- /* ensure pixel exact locations for draw */
- sseq->xof= (int)sseq->xof;
- sseq->yof= (int)sseq->yof;
-}
-
-void seq_viewmove(SpaceSeq *sseq)
-{
- ScrArea *sa;
- short mval[2], mvalo[2];
- short rectx, recty, xmin, xmax, ymin, ymax, pad;
- int oldcursor;
- Window *win;
-
- sa = sseq->area;
- rectx= (G.scene->r.size*G.scene->r.xsch)/100;
- recty= (G.scene->r.size*G.scene->r.ysch)/100;
-
- pad = 10;
- xmin = -(sa->winx/2) - rectx/2 + pad;
- xmax = sa->winx/2 + rectx/2 - pad;
- ymin = -(sa->winy/2) - recty/2 + pad;
- ymax = sa->winy/2 + recty/2 - pad;
-
- getmouseco_sc(mvalo);
-
- oldcursor=get_cursor();
- win=winlay_get_active_window();
-
- SetBlenderCursor(BC_NSEW_SCROLLCURSOR);
-
- while(get_mbut()&(L_MOUSE|M_MOUSE)) {
-
- getmouseco_sc(mval);
-
- if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) {
-
- sseq->xof -= (mvalo[0]-mval[0]);
- sseq->yof -= (mvalo[1]-mval[1]);
-
- /* prevent dragging image outside of the window and losing it! */
- CLAMP(sseq->xof, xmin, xmax);
- CLAMP(sseq->yof, ymin, ymax);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else BIF_wait_for_statechange();
- }
- window_set_cursor(win, oldcursor);
-}
-
-void drawprefetchseqspace(ScrArea *sa, void *spacedata)
-{
- SpaceSeq *sseq= sa->spacedata.first;
- int rectx, recty;
-
- rectx= (G.scene->r.size*G.scene->r.xsch)/100;
- recty= (G.scene->r.size*G.scene->r.ysch)/100;
-
- if(sseq->mainb) {
- give_ibuf_prefetch_request(
- rectx, recty, (G.scene->r.cfra), sseq->chanshown);
- }
-}
-
-void drawseqspace(ScrArea *sa, void *spacedata)
-{
- SpaceSeq *sseq= sa->spacedata.first;
- View2D *v2d= &sseq->v2d;
- Editing *ed;
- Sequence *seq;
- float col[3];
- int ofsx, ofsy;
- int i;
-
- ed= G.scene->ed;
-
- if(sseq->mainb) {
- draw_image_seq(sa);
- return;
- }
-
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- if(ed && ed->metastack.first) glClearColor(col[0], col[1], col[2]-0.1, 0.0);
- else glClearColor(col[0], col[1], col[2], 0.0);
-
- glClear(GL_COLOR_BUFFER_BIT);
-
- calc_scrollrcts(sa, v2d, sa->winx, sa->winy);
-
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
- if(v2d->scroll) {
- ofsx= sa->winrct.xmin; /* because of mywin */
- ofsy= sa->winrct.ymin;
- glViewport(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1);
- glScissor(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1);
- }
- }
-
-
- myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
-
- BIF_ThemeColorShade(TH_BACK, -20);
- glRectf(v2d->cur.xmin, 0.0, v2d->cur.xmax, 1.0);
-
-
- boundbox_seq();
- calc_ipogrid();
-
- /* Alternating horizontal stripes */
- i= MAX2(1, ((int)G.v2d->cur.ymin)-1);
-
- glBegin(GL_QUADS);
- while (i<v2d->cur.ymax) {
- if (((int)i) & 1)
- BIF_ThemeColorShade(TH_BACK, -15);
- else
- BIF_ThemeColorShade(TH_BACK, -25);
-
- glVertex2f(v2d->cur.xmax, i);
- glVertex2f(v2d->cur.xmin, i);
- glVertex2f(v2d->cur.xmin, i+1);
- glVertex2f(v2d->cur.xmax, i+1);
- i+=1.0;
- }
- glEnd();
-
- /* Force grid lines */
- i= MAX2(1, ((int)G.v2d->cur.ymin)-1);
- glBegin(GL_LINES);
-
- while (i<G.v2d->cur.ymax) {
- BIF_ThemeColor(TH_GRID);
- glVertex2f(G.v2d->cur.xmax, i);
- glVertex2f(G.v2d->cur.xmin, i);
- i+=1.0;
- }
- glEnd();
-
-
- draw_ipogrid();
- draw_cfra_seq();
-
-
- /* sequences: first deselect */
- if(ed) {
- Sequence *last_seq = get_last_seq();
- int sel = 0, j;
- int outline_tint;
- float pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
- /* loop through twice, first unselected, then selected */
- for (j=0; j<2; j++) {
- seq= ed->seqbasep->first;
- if (j==0) outline_tint = -150;
- else outline_tint = -60;
-
- while(seq) { /* bound box test, dont draw outside the view */
- if ( ((seq->flag & SELECT) == sel) ||
- seq == last_seq ||
- MIN2(seq->startdisp, seq->start) > v2d->cur.xmax ||
- MAX2(seq->enddisp, seq->start+seq->len) < v2d->cur.xmin ||
- seq->machine+1.0 < v2d->cur.ymin ||
- seq->machine > v2d->cur.ymax)
- {
- /* dont draw */
- } else {
- draw_seq_strip(seq, sa, sseq, outline_tint, pixelx);
- }
- seq= seq->next;
- }
- sel= SELECT; /* draw selected next time round */
- }
- /* draw the last selected last, removes some overlapping error */
- if (last_seq) {
- draw_seq_strip(last_seq, sa, sseq, 120, pixelx);
- }
- }
-
- /* Draw markers */
- draw_markers_timespace(SCE_MARKERS, DRAW_MARKERS_LINES);
-
- /* restore viewport */
- mywinset(sa->win);
-
- /* ortho at pixel level sa */
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
- if(v2d->scroll) {
- drawscroll(0);
- }
- }
-
- draw_area_emboss(sa);
-
- if(sseq->mainb==0) {
- /* it is important to end a view in a transform compatible with buttons */
- bwin_scalematrix(sa->win, sseq->blockscale, sseq->blockscale, sseq->blockscale);
- seq_blockhandlers(sa);
- }
-
- sa->win_swap= WIN_BACK_OK;
-}
-
-
diff --git a/source/blender/src/drawsound.c b/source/blender/src/drawsound.c
deleted file mode 100644
index f765f62a12f..00000000000
--- a/source/blender/src/drawsound.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_gl.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_editsound.h"
-#include "BIF_resources.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_time.h"
-#include "BMF_Api.h"
-
-#include "blendef.h"
-
-/* local */
-void drawsoundspace(ScrArea *sa, void *spacedata);
-
-/*implementation */
-static void draw_wave(int startsamp, int endsamp, short sampdx, short offset, short *sp, float sampfac, float y)
-{
- float min, max, v1[2], v2[3];
- int i, j, deltasp, value; /*deltasp, value: were both shorts but for music files 5min, zooming out cased a crash */
-
- sp+= offset*startsamp;
-
- deltasp= offset*sampdx;
-
- glBegin(GL_LINES);
- for(i=startsamp; i<endsamp; i+=sampdx, sp+=deltasp) {
-
- /* filter */
- min= max= 0.0;
- for(j=0; j<sampdx; j++) {
- value= sp[offset*j];
- if(value < min) min= value;
- else if(value > max) max= value;
- }
- v1[1]= y + 0.002*min;
- v2[1]= y + 0.002*max;
-
- v1[0]=v2[0]= sampfac*i;
-
- glVertex2fv(v1);
- glVertex2fv(v2);
- }
- glEnd();
-}
-
-static void draw_sample(bSample *sample)
-{
- float sampxlen, sampfac;
- int samples, startsamp, endsamp;
- short *sp, sampdx;
-
- /* one sample is where in v2d space? (v2d space in frames!) */
- sampfac= FPS/(sample->rate);
-
- /* how many samples? */
- samples= sample->len/(sample->channels*(sample->bits/8));
- /* total len in v2d space */
- sampxlen= sampfac*samples;
-
- /* one pixel is how many samples? */
- sampdx= (samples*((G.v2d->cur.xmax-G.v2d->cur.xmin)/sampxlen))/curarea->winx;
-
- if(sampdx==0) sampdx= 1;
-
- /* start and and */
- startsamp = G.v2d->cur.xmin/sampfac;
- CLAMP(startsamp, 0, samples-1);
- endsamp= G.v2d->cur.xmax/sampfac;
- CLAMP(endsamp, 0, samples-1);
- endsamp-= sampdx;
-
- /* set 'tot' for sliders */
- G.v2d->tot.xmax= sampfac*samples;
-
- /* channels? */
- if(sample->channels==2) {
-
- cpack(0x905050);
- sp= (short *)(sample->data);
- draw_wave(startsamp, endsamp, sampdx, 2, sp, sampfac, 85.0);
-
- cpack(0x506890);
- sp++;
- draw_wave(startsamp, endsamp, sampdx, 2, sp, sampfac, 190.0);
- }
- else {
- cpack(0x905050);
- sp= (short *)(sample->data);
-
- draw_wave(startsamp, endsamp, sampdx, 1, sp, sampfac, 128.0);
- }
-}
-
-static void draw_cfra_sound(SpaceSound *ssound)
-{
- float vec[2];
-
- if(ssound->flag & SND_CFRA_NUM) {
- short mval[2];
- float x, y;
- char str[32];
- /* little box with frame */
-
- getmouseco_areawin(mval);
-
- if(mval[1]>curarea->winy-10) mval[1]= curarea->winy - 13;
-
- if (curarea->winy < 25) {
- if (mval[1]<17) mval[1]= 17;
- } else if (mval[1]<22) mval[1]= 22;
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
- if(ssound->flag & SND_DRAWFRAMES)
- sprintf(str, " %d\n", CFRA);
- else sprintf(str, " %.2f\n", FRA2TIME(CFRA));
-
- glRasterPos2f(x, y);
- glColor3ub(0, 0, 0);
- BMF_DrawString(G.font, str);
-
- }
-
- vec[0]= (G.scene->r.cfra);
- vec[0]*= G.scene->r.framelen;
-
- vec[1]= G.v2d->cur.ymin;
- BIF_ThemeColor(TH_CFRAME);
- glLineWidth(2.0);
-
- glBegin(GL_LINE_STRIP);
- glVertex2fv(vec);
- vec[1]= G.v2d->cur.ymax;
- glVertex2fv(vec);
- glEnd();
-
- glLineWidth(1.0);
-}
-
-void drawsoundspace(ScrArea *sa, void *spacedata)
-{
- float col[3];
- short ofsx, ofsy;
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy);
-
- if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= curarea->winrct.xmin; /* because mywin */
- ofsy= curarea->winrct.ymin;
- glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- }
- }
-
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-
- /* boundbox_seq(); */
- calc_ipogrid();
- draw_ipogrid();
-
- if (G.ssound->sound) {
- sound_initialize_sample(G.ssound->sound);
- draw_sample(G.ssound->sound->sample);
- }
-
- draw_cfra_sound(spacedata);
- draw_markers_timespace(SCE_MARKERS, 0);
-
- /* restore viewport */
- mywinset(curarea->win);
-
- /* ortho at pixel level curarea */
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
-
- if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- drawscroll(0);
- }
- }
-
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
- draw_area_emboss(sa);
- curarea->win_swap= WIN_BACK_OK;
-}
diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c
deleted file mode 100644
index 1c8380c7a7d..00000000000
--- a/source/blender/src/drawtext.c
+++ /dev/null
@@ -1,3493 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_text_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_text.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_suggestions.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_keyval.h"
-#include "BIF_interface.h"
-#include "BIF_drawtext.h"
-#include "BIF_editfont.h"
-#include "BIF_spacetypes.h"
-#include "BIF_usiblender.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_mainqueue.h"
-
-#include "BSE_filesel.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "winlay.h"
-#include "PIL_time.h"
-#include <ctype.h> /* ispunct */
-#include <sys/stat.h>
-
-/***********************/ /*
-
-Notes on word-wrap
---
-All word-wrap functions follow the algorithm below to maintain consistency.
- line The line to wrap (tabs converted to spaces)
- view_width The maximum number of characters displayable in the region
- This equals region_width/font_width for the region
- wrap_chars Characters that allow wrapping. This equals [' ', '\t', '-']
-
-def wrap(line, view_width, wrap_chars):
- draw_start = 0
- draw_end = view_width
- pos = 0
- for c in line:
- if pos-draw_start >= view_width:
- print line[draw_start:draw_end]
- draw_start = draw_end
- draw_end += view_width
- elif c in wrap_chars:
- draw_end = pos+1
- pos += 1
- print line[draw_start:]
-
-*/ /***********************/
-
-#define TEXTXLOC 38
-
-#define SUGG_LIST_SIZE 7
-#define SUGG_LIST_WIDTH 20
-#define DOC_WIDTH 40
-#define DOC_HEIGHT 10
-
-#define TOOL_SUGG_LIST 0x01
-#define TOOL_DOCUMENT 0x02
-
-#define TMARK_GRP_CUSTOM 0x00010000 /* Lower 2 bytes used for Python groups */
-#define TMARK_GRP_FINDALL 0x00020000
-
-/* forward declarations */
-
-void drawtextspace(ScrArea *sa, void *spacedata);
-void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-void redraw_alltext(void);
-
-static void txt_copy_selectbuffer(Text *text);
-static void draw_brackets(SpaceText *st);
-static void get_selection_buffer(Text *text);
-static int check_bracket(char ch);
-static int check_delim(char ch);
-static int check_digit(char ch);
-static int check_identifier(char ch);
-static int check_whitespace(char ch);
-
-static int get_wrap_width(SpaceText *st);
-static void get_suggest_prefix(Text *text, int offset);
-static void confirm_suggestion(Text *text, int skipleft);
-
-#define TXT_MAXFINDSTR 255
-static int g_find_flags= TXT_FIND_WRAP;
-static char *g_find_str= NULL;
-static char *g_replace_str= NULL;
-
-static int doc_scroll= 0;
-static int jump_to= 0;
-static double last_jump= 0;
-
-static BMF_Font *spacetext_get_font(SpaceText *st)
-{
- static BMF_Font *scr12= NULL;
- static BMF_Font *scr15= NULL;
-
- switch (st->font_id) {
- default:
- case 0:
- if (!scr12)
- scr12= BMF_GetFont(BMF_kScreen12);
- return scr12;
- case 1:
- if (!scr15)
- scr15= BMF_GetFont(BMF_kScreen15);
- return scr15;
- }
-}
-
-static int spacetext_get_fontwidth(SpaceText *st)
-{
- return BMF_GetCharacterWidth(spacetext_get_font(st), ' ');
-}
-
-static char *temp_char_buf= NULL;
-static int *temp_char_accum= NULL;
-static int temp_char_len= 0;
-static int temp_char_pos= 0;
-
-static void temp_char_write(char c, int accum)
-{
- if (temp_char_len==0 || temp_char_pos>=temp_char_len) {
- char *nbuf; int *naccum;
- int olen= temp_char_len;
-
- if (olen) temp_char_len*= 2;
- else temp_char_len= 256;
-
- nbuf= MEM_mallocN(sizeof(*temp_char_buf)*temp_char_len, "temp_char_buf");
- naccum= MEM_mallocN(sizeof(*temp_char_accum)*temp_char_len, "temp_char_accum");
-
- if (olen) {
- memcpy(nbuf, temp_char_buf, olen);
- memcpy(naccum, temp_char_accum, olen);
-
- MEM_freeN(temp_char_buf);
- MEM_freeN(temp_char_accum);
- }
-
- temp_char_buf= nbuf;
- temp_char_accum= naccum;
- }
-
- temp_char_buf[temp_char_pos]= c;
- temp_char_accum[temp_char_pos]= accum;
-
- if (c==0) temp_char_pos= 0;
- else temp_char_pos++;
-}
-
-void free_txt_data(void)
-{
- txt_free_cut_buffer();
-
- if (g_find_str) MEM_freeN(g_find_str);
- if (g_replace_str) MEM_freeN(g_replace_str);
- if (temp_char_buf) MEM_freeN(temp_char_buf);
- if (temp_char_accum) MEM_freeN(temp_char_accum);
-}
-
-static int render_string (SpaceText *st, char *in)
-{
- int r = 0, i = 0;
-
- while(*in) {
- if (*in=='\t') {
- if (temp_char_pos && *(in-1)=='\t') i= st->tabnumber;
- else if (st->tabnumber > 0) i= st->tabnumber - (temp_char_pos%st->tabnumber);
- while(i--) temp_char_write(' ', r);
- } else temp_char_write(*in, r);
-
- r++;
- in++;
- }
- r= temp_char_pos;
- temp_char_write(0, 0);
-
- return r;
-}
-
-/* Checks the specified source string for a Python built-in function name. This
- name must start at the beginning of the source string and must be followed by
- a non-identifier (see check_identifier(char)) or null character.
-
- If a built-in function is found, the length of the matching name is returned.
- Otherwise, -1 is returned.
- */
-static int find_builtinfunc(char *string)
-{
- int a, i;
- char builtinfuncs[][11] = {"and", "as", "assert", "break", "class", "continue", "def",
- "del", "elif", "else", "except", "exec", "finally",
- "for", "from", "global", "if", "import", "in",
- "is", "lambda", "not", "or", "pass", "print",
- "raise", "return", "try", "while", "yield"};
- for (a=0; a<30; a++) {
- i = 0;
- while (1) {
- /* If we hit the end of a keyword... (eg. "def") */
- if (builtinfuncs[a][i]=='\0') {
- /* If we still have identifier chars in the source (eg. "definate") */
- if (check_identifier(string[i]))
- i = -1; /* No match */
- break; /* Next keyword if no match, otherwise we're done */
-
- /* If chars mismatch, move on to next keyword */
- } else if (string[i]!=builtinfuncs[a][i]) {
- i = -1;
- break; /* Break inner loop, start next keyword */
- }
- i++;
- }
- if (i>0) break; /* If we have a match, we're done */
- }
- return i;
-}
-
-/* Checks the specified source string for a Python special name. This name must
- start at the beginning of the source string and must be followed by a non-
- identifier (see check_identifier(char)) or null character.
-
- If a special name is found, the length of the matching name is returned.
- Otherwise, -1 is returned.
- */
-static int find_specialvar(char *string)
-{
- int i = 0;
- /* Check for "def" */
- if (string[0]=='d' && string[1]=='e' && string[2]=='f')
- i = 3;
- /* Check for "class" */
- else if (string[0]=='c' && string[1]=='l' && string[2]=='a' && string[3]=='s' && string[4]=='s')
- i = 5;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
- if (i==0 || check_identifier(string[i]))
- return -1;
- return i;
-}
-
-/* Ensures the format string for the given line is long enough, reallocating
- as needed. Allocation is done here, alone, to ensure consitency.
- */
-static int check_format_len(TextLine *line, unsigned int len)
-{
- if (line->format) {
- if (strlen(line->format) < len) {
- MEM_freeN(line->format);
- line->format = MEM_mallocN(len+2, "SyntaxFormat");
- if (!line->format) return 0;
- }
- } else {
- line->format = MEM_mallocN(len+2, "SyntaxFormat");
- if (!line->format) return 0;
- }
- return 1;
-}
-
-/* Formats the specified line. If do_next is set, the process will move on to
- the succeeding line if it is affected (eg. multiline strings). Format strings
- may contain any of the following characters:
- '_' Whitespace
- '#' Comment text
- '!' Punctuation and other symbols
- 'n' Numerals
- 'l' String letters
- 'v' Special variables (class, def)
- 'b' Built-in names (print, for, etc.)
- 'q' Other text (identifiers, etc.)
- It is terminated with a null-terminator '\0' followed by a continuation
- flag indicating whether the line is part of a multi-line string.
- */
-void txt_format_line(SpaceText *st, TextLine *line, int do_next)
-{
- char *str, *fmt, orig, cont, find, prev = ' ';
- int len, i;
-
- /* Get continuation from previous line */
- if (line->prev && line->prev->format != NULL) {
- fmt= line->prev->format;
- cont = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
- } else cont = 0;
-
- /* Get original continuation from this line */
- if (line->format != NULL) {
- fmt= line->format;
- orig = fmt[strlen(fmt)+1]; /* Just after the null-terminator */
- } else orig = 0xFF;
-
- render_string(st, line->line);
- str = temp_char_buf;
- len = strlen(str);
- if (!check_format_len(line, len)) return;
- fmt = line->format;
-
- while (*str) {
- /* Handle escape sequences by skipping both \ and next char */
- if (*str == '\\') {
- *fmt = prev; fmt++; str++;
- if (*str == '\0') break;
- *fmt = prev; fmt++; str++;
- continue;
- }
- /* Handle continuations */
- else if (cont) {
- /* Triple strings ("""...""" or '''...''') */
- if (cont & TXT_TRISTR) {
- find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
- if (*str==find && *(str+1)==find && *(str+2)==find) {
- *fmt = 'l'; fmt++; str++;
- *fmt = 'l'; fmt++; str++;
- cont = 0;
- }
- /* Handle other strings */
- } else {
- find = (cont & TXT_DBLQUOTSTR) ? '"' : '\'';
- if (*str == find) cont = 0;
- }
- *fmt = 'l';
- }
- /* Not in a string... */
- else {
- /* Deal with comments first */
- if (prev == '#' || *str == '#')
- *fmt = '#';
- /* Strings */
- else if (*str == '"' || *str == '\'') {
- find = *str;
- cont = (*str== '"') ? TXT_DBLQUOTSTR : TXT_SNGQUOTSTR;
- if (*(str+1) == find && *(str+2) == find) {
- *fmt = 'l'; fmt++; str++;
- *fmt = 'l'; fmt++; str++;
- cont |= TXT_TRISTR;
- }
- *fmt = 'l';
- }
- /* Whitespace (all ws. has been converted to spaces) */
- else if (*str == ' ')
- *fmt = '_';
- /* Numbers (digits not part of an identifier and periods followed by digits) */
- else if ((prev != 'q' && check_digit(*str)) || (*str == '.' && check_digit(*(str+1))))
- *fmt = 'n';
- /* Punctuation */
- else if (check_delim(*str))
- *fmt = '!';
- /* Identifiers and other text (no previous ws. or delims. so text continues) */
- else if (prev == 'q')
- *fmt = 'q';
- /* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
- else {
- /* Special vars(v) or built-in keywords(b) */
- if ((i=find_specialvar(str)) != -1)
- prev = 'v';
- else if ((i=find_builtinfunc(str)) != -1)
- prev = 'b';
- if (i>0) {
- while (i>1) {
- *fmt = prev; fmt++; str++;
- i--;
- }
- *fmt = prev;
- } else
- *fmt = 'q';
- }
- }
- prev = *fmt;
- fmt++;
- str++;
- }
-
- /* Terminate and add continuation char */
- *fmt = '\0'; fmt++;
- *fmt = cont;
-
- /* Debugging */
- //print_format(st, line);
-
- /* If continuation has changed and we're allowed, process the next line */
- if (cont!=orig && do_next && line->next) {
- txt_format_line(st, line->next, do_next);
- }
-}
-
-/* Formats every line of the current text */
-void txt_format_text(SpaceText *st)
-{
- TextLine *linep;
-
- if (!st->text) return;
-
- for (linep=st->text->lines.first; linep; linep=linep->next)
- txt_format_line(st, linep, 0);
-}
-
-/* Sets the current drawing color based on the format character specified */
-static void format_draw_color(char formatchar)
-{
- switch (formatchar) {
- case '_': /* Whitespace */
- break;
- case '!': /* Symbols */
- BIF_ThemeColorBlend(TH_TEXT, TH_BACK, 0.5f);
- break;
- case '#': /* Comments */
- BIF_ThemeColor(TH_SYNTAX_C);
- break;
- case 'n': /* Numerals */
- BIF_ThemeColor(TH_SYNTAX_N);
- break;
- case 'l': /* Strings */
- BIF_ThemeColor(TH_SYNTAX_L);
- break;
- case 'v': /* Specials: class, def */
- BIF_ThemeColor(TH_SYNTAX_V);
- break;
- case 'b': /* Keywords: for, print, etc. */
- BIF_ThemeColor(TH_SYNTAX_B);
- break;
- case 'q': /* Other text (identifiers) */
- default:
- BIF_ThemeColor(TH_TEXT);
- break;
- }
-}
-
-static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char *format)
-{
- int basex, i, a, len, start, end, max, lines;
-
- len= render_string(st, str);
- str= temp_char_buf;
- max= w/spacetext_get_fontwidth(st);
- if (max<8) max= 8;
- basex= x;
-
- lines= 1;
- start= 0;
- end= max;
- for (i=0; i<len; i++) {
- if (i-start >= max) {
- /* Draw the visible portion of text on the overshot line */
- for (a=start; a<end; a++) {
- if (st->showsyntax && format) format_draw_color(format[a]);
- glRasterPos2i(x, y);
- BMF_DrawCharacter(spacetext_get_font(st), str[a]);
- x += BMF_GetCharacterWidth(spacetext_get_font(st), str[a]);
- }
- y -= st->lheight;
- x= basex;
- lines++;
- start= end;
- end += max;
- } else if (str[i]==' ' || str[i]=='-') {
- end = i+1;
- }
- }
- /* Draw the remaining text */
- for (a=start; a<len; a++) {
- if (st->showsyntax && format) format_draw_color(format[a]);
- glRasterPos2i(x, y);
- BMF_DrawCharacter(spacetext_get_font(st), str[a]);
- x += BMF_GetCharacterWidth(spacetext_get_font(st), str[a]);
- }
- return lines;
-}
-
-static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, char *format)
-{
- int r=0, w= 0;
- int *acc;
- char *in;
-
- w= render_string(st, str);
- if(w<cshift ) return 0; /* String is shorter than shift */
-
- in= temp_char_buf+cshift;
- acc= temp_char_accum+cshift;
- w= w-cshift;
-
- if (draw) {
- if(st->showsyntax && format) {
- int amount, a;
- format = format+cshift;
-
- amount = strlen(in);
-
- for(a = 0; a < amount; a++) {
- format_draw_color(format[a]);
- glRasterPos2i(x, y);
- BMF_DrawCharacter(spacetext_get_font(st), in[a]);
- x = x+BMF_GetCharacterWidth(spacetext_get_font(st), in[a]);
- }
- } else {
- glRasterPos2i(x, y);
- BMF_DrawString(spacetext_get_font(st), in);
- }
- } else {
- while (w-- && *acc++ < maxwidth) {
- r+= spacetext_get_fontwidth(st);
- }
- }
-
- if (cshift && r==0) return 0;
- else if (st->showlinenrs)
- return r+TXT_OFFSET+TEXTXLOC;
- else
- return r+TXT_OFFSET;
-}
-
-static void set_cursor_to_pos (SpaceText *st, int x, int y, int sel)
-{
- Text *text;
- TextLine **linep;
- int *charp;
- int w;
-
- text= st->text;
-
- if(sel) { linep= &text->sell; charp= &text->selc; }
- else { linep= &text->curl; charp= &text->curc; }
-
- y= (curarea->winy - y)/st->lheight;
-
- if(st->showlinenrs)
- x-= TXT_OFFSET+TEXTXLOC;
- else
- x-= TXT_OFFSET;
-
- if (x<0) x= 0;
- x = (x/spacetext_get_fontwidth(st)) + st->left;
-
- if (st->wordwrap) {
- int i, j, endj, curs, max, chop, start, end, chars, loop;
- char ch;
-
- /* Point to first visible line */
- *linep= text->lines.first;
- for (i=0; i<st->top && (*linep)->next; i++) *linep= (*linep)->next;
-
- max= get_wrap_width(st);
-
- loop= 1;
- while (loop && *linep) {
- start= 0;
- end= max;
- chop= 1;
- chars= 0;
- curs= 0;
- endj= 0;
- for (i=0, j=0; loop; j++) {
-
- /* Mimic replacement of tabs */
- ch= (*linep)->line[j];
- if (ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- ch= ' ';
- } else
- chars= 1;
-
- while (chars--) {
- /* Gone too far, go back to last wrap point */
- if (y<0) {
- *charp= endj;
- loop= 0;
- break;
- /* Exactly at the cursor, done */
- } else if (y==0 && i-start==x) {
- *charp= curs= j;
- loop= 0;
- break;
- /* Prepare curs for next wrap */
- } else if (i-end==x) {
- curs= j;
- }
- if (i-start>=max) {
- if (chop) endj= j;
- y--;
- start= end;
- end += max;
- chop= 1;
- if (y==0 && i-start>=x) {
- *charp= curs;
- loop= 0;
- break;
- }
- } else if (ch==' ' || ch=='-' || ch=='\0') {
- if (y==0 && i-start>=x) {
- *charp= curs;
- loop= 0;
- break;
- }
- end = i+1;
- endj = j;
- chop= 0;
- }
- i++;
- }
- if (ch=='\0') break;
- }
- if (!loop || y<0) break;
-
- if (!(*linep)->next) {
- *charp= (*linep)->len;
- break;
- }
-
- /* On correct line but didn't meet cursor, must be at end */
- if (y==0) {
- *charp= (*linep)->len;
- break;
- }
- *linep= (*linep)->next;
- y--;
- }
-
- } else {
- y-= txt_get_span(text->lines.first, *linep) - st->top;
-
- if (y>0) {
- while (y-- != 0) if((*linep)->next) *linep= (*linep)->next;
- } else if (y<0) {
- while (y++ != 0) if((*linep)->prev) *linep= (*linep)->prev;
- }
-
-
- w= render_string(st, (*linep)->line);
- if(x<w) *charp= temp_char_accum[x];
- else *charp= (*linep)->len;
- }
- if(!sel) txt_pop_sel(text);
-}
-
-static int get_wrap_width(SpaceText *st)
-{
- int x, max;
-
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- max= (curarea->winx-x)/spacetext_get_fontwidth(st);
- return max>8 ? max : 8;
-}
-
-/* Sets (offl, offc) for transforming (line, curs) to its wrapped position */
-static void wrap_offset(SpaceText *st, TextLine *linein, int cursin, int *offl, int *offc)
-{
- Text *text;
- TextLine *linep;
- int i, j, start, end, chars, max, chop;
- char ch;
-
- *offl= *offc= 0;
-
- if (!st->text) return;
- if (!st->wordwrap) return;
-
- text= st->text;
-
- /* Move pointer to first visible line (top) */
- linep= text->lines.first;
- i= st->top;
- while (i>0 && linep) {
- if (linep == linein) return; /* Line before top */
- linep= linep->next;
- i--;
- }
-
- max= get_wrap_width(st);
-
- while (linep) {
- start= 0;
- end= max;
- chop= 1;
- chars= 0;
- *offc= 0;
- for (i=0, j=0; linep->line[j]!='\0'; j++) {
-
- /* Mimic replacement of tabs */
- ch= linep->line[j];
- if (ch=='\t') {
- chars= st->tabnumber-i%st->tabnumber;
- if (linep==linein && i<cursin) cursin += chars-1;
- ch= ' ';
- } else
- chars= 1;
-
- while (chars--) {
- if (i-start>=max) {
- if (chop && linep==linein && i >= cursin)
- return;
- (*offl)++;
- *offc -= end-start;
- start= end;
- end += max;
- chop= 1;
- } else if (ch==' ' || ch=='-') {
- end = i+1;
- chop= 0;
- if (linep==linein && i >= cursin)
- return;
- }
- i++;
- }
- }
- if (linep==linein) break;
- linep= linep->next;
- }
-}
-
-static int get_char_pos(SpaceText *st, char *line, int cur)
-{
- int a=0, i;
-
- for (i=0; i<cur && line[i]; i++) {
- if (line[i]=='\t')
- a += st->tabnumber-a%st->tabnumber;
- else
- a++;
- }
- return a;
-}
-
-static void draw_markers(SpaceText *st)
-{
- Text *text= st->text;
- TextMarker *marker, *next;
- TextLine *top, *bottom, *line;
- int offl, offc, i, cy, x1, x2, y1, y2, x, y;
-
- for (i=st->top, top= text->lines.first; top->next && i>0; i--) top= top->next;
- for (i=st->viewlines-1, bottom=top; bottom->next && i>0; i--) bottom= bottom->next;
-
- for (marker= text->markers.first; marker; marker= next) {
- next= marker->next;
- for (cy= 0, line= top; line; cy++, line= line->next) {
- if (cy+st->top==marker->lineno) {
- /* Remove broken markers */
- if (marker->end>line->len || marker->start>marker->end) {
- BLI_freelinkN(&text->markers, marker);
- break;
- }
-
- wrap_offset(st, line, marker->start, &offl, &offc);
- x1= get_char_pos(st, line->line, marker->start) - st->left + offc;
- y1= cy + offl;
- wrap_offset(st, line, marker->end, &offl, &offc);
- x2= get_char_pos(st, line->line, marker->end) - st->left + offc;
- y2= cy + offl;
-
- glColor3ub(marker->color[0], marker->color[1], marker->color[2]);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= curarea->winy-3;
-
- if (y1==y2) {
- y -= y1*st->lheight;
- glBegin(GL_LINE_LOOP);
- glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y);
- glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y);
- glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y-st->lheight);
- glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y-st->lheight);
- glEnd();
- } else {
- y -= y1*st->lheight;
- glBegin(GL_LINE_STRIP);
- glVertex2i(curarea->winx, y);
- glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y);
- glVertex2i(x+x1*spacetext_get_fontwidth(st)-2, y-st->lheight);
- glVertex2i(curarea->winx, y-st->lheight);
- glEnd();
- y-=st->lheight;
- for (i=y1+1; i<y2; i++) {
- glBegin(GL_LINES);
- glVertex2i(x, y);
- glVertex2i(curarea->winx, y);
- glVertex2i(x, y-st->lheight);
- glVertex2i(curarea->winx, y-st->lheight);
- glEnd();
- y-=st->lheight;
- }
- glBegin(GL_LINE_STRIP);
- glVertex2i(x, y);
- glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y);
- glVertex2i(x+x2*spacetext_get_fontwidth(st)+1, y-st->lheight);
- glVertex2i(x, y-st->lheight);
- glEnd();
- }
-
- break;
- }
- if (line==bottom) break;
- }
- }
-}
-
-static void draw_cursor(SpaceText *st)
-{
- Text *text= st->text;
- int vcurl, vcurc, vsell, vselc, hidden=0;
- int offl, offc, x, y, w, i;
-
- /* Draw the selection */
- if (text->curl!=text->sell || text->curc!=text->selc) {
-
- /* Convert all to view space character coordinates */
- wrap_offset(st, text->curl, text->curc, &offl, &offc);
- vcurl = txt_get_span(text->lines.first, text->curl) - st->top + offl;
- vcurc = get_char_pos(st, text->curl->line, text->curc) - st->left + offc;
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
- vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
- vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
-
- if (vcurc<0) vcurc=0;
- if (vselc<0) vselc=0, hidden=1;
-
- BIF_ThemeColor(TH_SHADE2);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= curarea->winy-2;
-
- if (vcurl==vsell) {
- y -= vcurl*st->lheight;
- if (vcurc < vselc)
- glRecti(x+vcurc*spacetext_get_fontwidth(st)-1, y, x+vselc*spacetext_get_fontwidth(st), y-st->lheight);
- else
- glRecti(x+vselc*spacetext_get_fontwidth(st)-1, y, x+vcurc*spacetext_get_fontwidth(st), y-st->lheight);
- } else {
- int froml, fromc, tol, toc;
- if (vcurl < vsell) {
- froml= vcurl; tol= vsell;
- fromc= vcurc; toc= vselc;
- } else {
- froml= vsell; tol= vcurl;
- fromc= vselc; toc= vcurc;
- }
- y -= froml*st->lheight;
- glRecti(x+fromc*spacetext_get_fontwidth(st)-1, y, curarea->winx, y-st->lheight); y-=st->lheight;
- for (i=froml+1; i<tol; i++)
- glRecti(x-4, y, curarea->winx, y-st->lheight), y-=st->lheight;
- glRecti(x-4, y, x+toc*spacetext_get_fontwidth(st), y-st->lheight); y-=st->lheight;
- }
- } else {
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
- vsell = txt_get_span(text->lines.first, text->sell) - st->top + offl;
- vselc = get_char_pos(st, text->sell->line, text->selc) - st->left + offc;
- if (vselc<0) vselc=0, hidden=1;
- }
-
- if (!hidden) {
- /* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- x += vselc*spacetext_get_fontwidth(st);
- y= curarea->winy-2 - vsell*st->lheight;
-
- if (st->overwrite) {
- char ch= text->sell->line[text->selc];
- if (!ch) ch= ' ';
- w= BMF_GetCharacterWidth(spacetext_get_font(st), ch);
- BIF_ThemeColor(TH_HILITE);
- glRecti(x, y-st->lheight-1, x+w, y-st->lheight+1);
- } else {
- BIF_ThemeColor(TH_HILITE);
- glRecti(x-1, y, x+1, y-st->lheight);
- }
- }
-}
-
-static void calc_text_rcts(SpaceText *st)
-{
- int lhlstart, lhlend, ltexth;
- short barheight, barstart, hlstart, hlend, blank_lines;
- short pix_available, pix_top_margin, pix_bottom_margin, pix_bardiff;
-
- pix_top_margin = 8;
- pix_bottom_margin = 4;
- pix_available = curarea->winy - pix_top_margin - pix_bottom_margin;
- ltexth= txt_get_span(st->text->lines.first, st->text->lines.last);
- blank_lines = st->viewlines / 2;
-
- /* when resizing a vieport with the bar at the bottom to a greater height more blank lines will be added */
- if (ltexth + blank_lines < st->top + st->viewlines) {
- blank_lines = st->top + st->viewlines - ltexth;
- }
-
- ltexth += blank_lines;
-
- barheight = (ltexth > 0)? (st->viewlines*pix_available)/ltexth: 0;
- pix_bardiff = 0;
- if (barheight < 20) {
- pix_bardiff = 20 - barheight; /* take into account the now non-linear sizing of the bar */
- barheight = 20;
- }
- barstart = (ltexth > 0)? ((pix_available - pix_bardiff) * st->top)/ltexth: 0;
-
- st->txtbar.xmin = 5;
- st->txtbar.xmax = 17;
- st->txtbar.ymax = curarea->winy - pix_top_margin - barstart;
- st->txtbar.ymin = st->txtbar.ymax - barheight;
-
- CLAMP(st->txtbar.ymin, pix_bottom_margin, curarea->winy - pix_top_margin);
- CLAMP(st->txtbar.ymax, pix_bottom_margin, curarea->winy - pix_top_margin);
-
- st->pix_per_line= (pix_available > 0)? (float) ltexth/pix_available: 0;
- if (st->pix_per_line<.1) st->pix_per_line=.1f;
-
- lhlstart = MIN2(txt_get_span(st->text->lines.first, st->text->curl),
- txt_get_span(st->text->lines.first, st->text->sell));
- lhlend = MAX2(txt_get_span(st->text->lines.first, st->text->curl),
- txt_get_span(st->text->lines.first, st->text->sell));
-
- if(ltexth > 0) {
- hlstart = (lhlstart * pix_available)/ltexth;
- hlend = (lhlend * pix_available)/ltexth;
-
- /* the scrollbar is non-linear sized */
- if (pix_bardiff > 0) {
- /* the start of the highlight is in the current viewport */
- if (ltexth && st->viewlines && lhlstart >= st->top && lhlstart <= st->top + st->viewlines) {
- /* speed the progresion of the start of the highlight through the scrollbar */
- hlstart = ( ( (pix_available - pix_bardiff) * lhlstart) / ltexth) + (pix_bardiff * (lhlstart - st->top) / st->viewlines);
- }
- else if (lhlstart > st->top + st->viewlines && hlstart < barstart + barheight && hlstart > barstart) {
- /* push hl start down */
- hlstart = barstart + barheight;
- }
- else if (lhlend > st->top && lhlstart < st->top && hlstart > barstart) {
- /*fill out start */
- hlstart = barstart;
- }
-
- if (hlend <= hlstart) {
- hlend = hlstart + 2;
- }
-
- /* the end of the highlight is in the current viewport */
- if (ltexth && st->viewlines && lhlend >= st->top && lhlend <= st->top + st->viewlines) {
- /* speed the progresion of the end of the highlight through the scrollbar */
- hlend = (((pix_available - pix_bardiff )*lhlend)/ltexth) + (pix_bardiff * (lhlend - st->top)/st->viewlines);
- }
- else if (lhlend < st->top && hlend >= barstart - 2 && hlend < barstart + barheight) {
- /* push hl end up */
- hlend = barstart;
- }
- else if (lhlend > st->top + st->viewlines && lhlstart < st->top + st->viewlines && hlend < barstart + barheight) {
- /* fill out end */
- hlend = barstart + barheight;
- }
-
- if (hlend <= hlstart) {
- hlstart = hlend - 2;
- }
- }
- }
- else {
- hlstart = 0;
- hlend = 0;
- }
-
- if (hlend - hlstart < 2) {
- hlend = hlstart + 2;
- }
-
- st->txtscroll.xmin= 5;
- st->txtscroll.xmax= 17;
- st->txtscroll.ymax= curarea->winy - pix_top_margin - hlstart;
- st->txtscroll.ymin= curarea->winy - pix_top_margin - hlend;
-
- CLAMP(st->txtscroll.ymin, pix_bottom_margin, curarea->winy - pix_top_margin);
- CLAMP(st->txtscroll.ymax, pix_bottom_margin, curarea->winy - pix_top_margin);
-}
-
-static void draw_textscroll(SpaceText *st)
-{
- if (!st->text) return;
-
- calc_text_rcts(st);
-
- BIF_ThemeColorShade(TH_SHADE1, -20);
- glRecti(2, 2, 20, curarea->winy-6);
- uiEmboss(2, 2, 20, curarea->winy-6, 1);
-
- BIF_ThemeColor(TH_SHADE1);
- glRecti(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax);
-
- BIF_ThemeColor(TH_SHADE2);
- glRecti(st->txtscroll.xmin, st->txtscroll.ymin, st->txtscroll.xmax, st->txtscroll.ymax);
-
- uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT);
-}
-
-/* Moves the view vertically by the specified number of lines */
-static void screen_skip(SpaceText *st, int lines)
-{
- int last;
-
- if (!st) return;
- if (st->spacetype != SPACE_TEXT) return;
- if (!st->text) return;
-
- st->top += lines;
-
- last= txt_get_span(st->text->lines.first, st->text->lines.last);
- last= last - (st->viewlines/2);
-
- if (st->top>last) st->top= last;
- if (st->top<0) st->top= 0;
-}
-
-/* Moves the cursor vertically by the specified number of lines.
- If the destination line is shorter than the current cursor position, the
- cursor will be positioned at the end of this line.
-
- This is to replace screen_skip for PageUp/Down operations.
- */
-static void cursor_skip(SpaceText *st, int lines, int sel)
-{
- Text *text;
- TextLine **linep;
- int oldl, oldc, *charp;
-
- if (!st) return;
- if (st->spacetype != SPACE_TEXT) return;
- if (!st->text) return;
-
- text= st->text;
-
- if (sel) linep= &text->sell, charp= &text->selc;
- else linep= &text->curl, charp= &text->curc;
- oldl= txt_get_span(text->lines.first, *linep);
- oldc= *charp;
-
- while (lines>0 && (*linep)->next) {
- *linep= (*linep)->next;
- lines--;
- }
- while (lines<0 && (*linep)->prev) {
- *linep= (*linep)->prev;
- lines++;
- }
-
- if (*charp > (*linep)->len) *charp= (*linep)->len;
-
- if (!sel) txt_pop_sel(st->text);
- txt_undo_add_toop(st->text, sel?UNDO_STO:UNDO_CTO, oldl, oldc, txt_get_span(text->lines.first, *linep), *charp);
-}
-
-/* Handles text scrolling via grabbing the view (MMB, mode 1) or with the
- scrollbar (mode 2)
- */
-static void do_textscroll(SpaceText *st, int mode)
-{
- short delta[2]= {0, 0};
- short mval[2], hold[2], old[2];
-
- if (!st->text) return;
-
- calc_text_rcts(st);
-
- st->flags|= ST_SCROLL_SELECT;
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- getmouseco_areawin(mval);
- old[0]= hold[0]= mval[0];
- old[1]= hold[1]= mval[1];
-
- while(get_mbut()&(L_MOUSE|M_MOUSE)) {
- getmouseco_areawin(mval);
-
- if(old[0]!=mval[0] || old[1]!=mval[1]) {
- if (mode==1) {
- delta[0]= (hold[0]-mval[0])/spacetext_get_fontwidth(st);
- delta[1]= (mval[1]-hold[1])/st->lheight;
- }
- else delta[1]= (hold[1]-mval[1])*st->pix_per_line;
-
- if (delta[0] || delta[1]) {
- screen_skip(st, delta[1]);
- if (st->wordwrap) {
- st->left= 0;
- } else {
- st->left+= delta[0];
- if (st->left<0) st->left= 0;
- }
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- hold[0]=mval[0];
- hold[1]=mval[1];
- }
- old[0]=mval[0];
- old[1]=mval[1];
- } else {
- BIF_wait_for_statechange();
- }
- }
- st->flags^= ST_SCROLL_SELECT;
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-}
-
-static void do_selection(SpaceText *st, int selecting)
-{
- int sell, selc;
- int linep2, charp2;
- int first= 1;
- short mval[2], old[2];
-
- getmouseco_areawin(mval);
- old[0]= mval[0];
- old[1]= mval[1];
-
- if (!selecting) {
- int curl= txt_get_span(st->text->lines.first, st->text->curl);
- int curc= st->text->curc;
- int linep2, charp2;
-
- set_cursor_to_pos(st, mval[0], mval[1], 0);
-
- linep2= txt_get_span(st->text->lines.first, st->text->curl);
- charp2= st->text->selc;
-
- if (curl!=linep2 || curc!=charp2)
- txt_undo_add_toop(st->text, UNDO_CTO, curl, curc, linep2, charp2);
- }
-
- sell= txt_get_span(st->text->lines.first, st->text->sell);
- selc= st->text->selc;
-
- while(get_mbut()&L_MOUSE) {
- getmouseco_areawin(mval);
-
- if (mval[1]<0 || mval[1]>curarea->winy) {
- int d= (old[1]-mval[1])*st->pix_per_line;
- if (d) screen_skip(st, d);
-
- set_cursor_to_pos(st, mval[0], mval[1]<0?0:curarea->winy, 1);
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else if (!st->wordwrap && (mval[0]<0 || mval[0]>curarea->winx)) {
- if (mval[0]>curarea->winx) st->left++;
- else if (mval[0]<0 && st->left>0) st->left--;
-
- set_cursor_to_pos(st, mval[0], mval[1], 1);
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- PIL_sleep_ms(10);
- }
- else if (first || old[0]!=mval[0] || old[1]!=mval[1]) {
- set_cursor_to_pos(st, mval[0], mval[1], 1);
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- old[0]= mval[0];
- old[1]= mval[1];
- first= 1;
- }
- else {
- BIF_wait_for_statechange();
- }
- }
-
- linep2= txt_get_span(st->text->lines.first, st->text->sell);
- charp2= st->text->selc;
-
- if (sell!=linep2 || selc!=charp2)
- txt_undo_add_toop(st->text, UNDO_STO, sell, selc, linep2, charp2);
-
- pop_space_text(st);
-}
-
-static int do_suggest_select(SpaceText *st)
-{
- SuggItem *item, *first, *last, *sel;
- TextLine *tmp;
- int l, x, y, w, h, i;
- int tgti, *top;
- short mval[2];
-
- if (!st || !st->text) return 0;
- if (!texttool_text_is_active(st->text)) return 0;
-
- first = texttool_suggest_first();
- last = texttool_suggest_last();
- sel = texttool_suggest_selected();
- top = texttool_suggest_top();
-
- if (!last || !first)
- return 0;
-
- /* Count the visible lines to the cursor */
- for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if (l<0) return 0;
-
- if(st->showlinenrs) {
- x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
- } else {
- x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
- }
- y = curarea->winy - st->lheight*l - 2;
-
- w = SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 20;
- h = SUGG_LIST_SIZE*st->lheight + 8;
-
- getmouseco_areawin(mval);
-
- if (mval[0]<x || x+w<mval[0] || mval[1]<y-h || y<mval[1])
- return 0;
-
- /* Work out which of the items is at the top of the visible list */
- for (i=0, item=first; i<*top && item->next; i++, item=item->next);
-
- /* Work out the target item index in the visible list */
- tgti = (y-mval[1]-4) / st->lheight;
- if (tgti<0 || tgti>SUGG_LIST_SIZE)
- return 1;
-
- for (i=tgti; i>0 && item->next; i--, item=item->next);
- if (item)
- texttool_suggest_select(item);
- return 1;
-}
-
-static void pop_suggest_list()
-{
- SuggItem *item, *sel;
- int *top, i;
-
- item= texttool_suggest_first();
- sel= texttool_suggest_selected();
- top= texttool_suggest_top();
-
- i= 0;
- while (item && item != sel) {
- item= item->next;
- i++;
- }
- if (i > *top+SUGG_LIST_SIZE-1)
- *top= i-SUGG_LIST_SIZE+1;
- else if (i < *top)
- *top= i;
-}
-
-void draw_documentation(SpaceText *st)
-{
- TextLine *tmp;
- char *docs, buf[DOC_WIDTH+1], *p;
- int len, i, br, lines;
- int boxw, boxh, l, x, y, top;
-
- if (!st || !st->text) return;
- if (!texttool_text_is_active(st->text)) return;
-
- docs = texttool_docs_get();
-
- if (!docs) return;
-
- /* Count the visible lines to the cursor */
- for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if (l<0) return;
-
- if(st->showlinenrs) {
- x= spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
- } else {
- x= spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
- }
- if (texttool_suggest_first()) {
- x += SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 50;
- }
-
- top= y= curarea->winy - st->lheight*l - 2;
- len= strlen(docs);
- boxw= DOC_WIDTH*spacetext_get_fontwidth(st) + 20;
- boxh= (DOC_HEIGHT+1)*st->lheight;
-
- /* Draw panel */
- BIF_ThemeColor(TH_BACK);
- glRecti(x, y, x+boxw, y-boxh);
- BIF_ThemeColor(TH_SHADE1);
- glBegin(GL_LINE_LOOP);
- glVertex2i(x, y);
- glVertex2i(x+boxw, y);
- glVertex2i(x+boxw, y-boxh);
- glVertex2i(x, y-boxh);
- glEnd();
- glBegin(GL_LINE_LOOP);
- glVertex2i(x+boxw-10, y-7);
- glVertex2i(x+boxw-4, y-7);
- glVertex2i(x+boxw-7, y-2);
- glEnd();
- glBegin(GL_LINE_LOOP);
- glVertex2i(x+boxw-10, y-boxh+7);
- glVertex2i(x+boxw-4, y-boxh+7);
- glVertex2i(x+boxw-7, y-boxh+2);
- glEnd();
- BIF_ThemeColor(TH_TEXT);
-
- i= 0; br= DOC_WIDTH; lines= -doc_scroll;
- for (p=docs; *p; p++) {
- if (*p == '\r' && *(++p) != '\n') *(--p)= '\n'; /* Fix line endings */
- if (*p == ' ' || *p == '\t')
- br= i;
- else if (*p == '\n') {
- buf[i]= '\0';
- if (lines>=0) {
- y -= st->lheight;
- text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
- }
- i= 0; br= DOC_WIDTH; lines++;
- }
- buf[i++]= *p;
- if (i == DOC_WIDTH) { /* Reached the width, go to last break and wrap there */
- buf[br]= '\0';
- if (lines>=0) {
- y -= st->lheight;
- text_draw(st, buf, 0, 0, 1, x+4, y-3, NULL);
- }
- p -= i-br-1; /* Rewind pointer to last break */
- i= 0; br= DOC_WIDTH; lines++;
- }
- if (lines >= DOC_HEIGHT) break;
- }
- if (doc_scroll > 0 && lines < DOC_HEIGHT) {
- doc_scroll--;
- draw_documentation(st);
- }
-}
-
-void draw_suggestion_list(SpaceText *st)
-{
- SuggItem *item, *first, *last, *sel;
- TextLine *tmp;
- char str[SUGG_LIST_WIDTH+1];
- int w, boxw=0, boxh, i, l, x, y, b, *top;
-
- if (!st || !st->text) return;
- if (!texttool_text_is_active(st->text)) return;
-
- first = texttool_suggest_first();
- last = texttool_suggest_last();
-
- if (!first || !last) return;
-
- pop_suggest_list();
- sel = texttool_suggest_selected();
- top = texttool_suggest_top();
-
- /* Count the visible lines to the cursor */
- for (tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++);
- if (l<0) return;
-
- if(st->showlinenrs) {
- x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4;
- } else {
- x = spacetext_get_fontwidth(st)*(st->text->curc-st->left) + TXT_OFFSET - 4;
- }
- y = curarea->winy - st->lheight*l - 2;
-
- boxw = SUGG_LIST_WIDTH*spacetext_get_fontwidth(st) + 20;
- boxh = SUGG_LIST_SIZE*st->lheight + 8;
-
- BIF_ThemeColor(TH_SHADE1);
- glRecti(x-1, y+1, x+boxw+1, y-boxh-1);
- BIF_ThemeColor(TH_BACK);
- glRecti(x, y, x+boxw, y-boxh);
-
- /* Set the top 'item' of the visible list */
- for (i=0, item=first; i<*top && item->next; i++, item=item->next);
-
- for (i=0; i<SUGG_LIST_SIZE && item; i++, item=item->next) {
-
- y -= st->lheight;
-
- strncpy(str, item->name, SUGG_LIST_WIDTH);
- str[SUGG_LIST_WIDTH] = '\0';
-
- w = BMF_GetStringWidth(spacetext_get_font(st), str);
-
- if (item == sel) {
- BIF_ThemeColor(TH_SHADE2);
- glRecti(x+16, y-3, x+16+w, y+st->lheight-3);
- }
- b=1; /* b=1 colour block, text is default. b=0 no block, colour text */
- switch (item->type) {
- case 'k': BIF_ThemeColor(TH_SYNTAX_B); b=0; break;
- case 'm': BIF_ThemeColor(TH_TEXT); break;
- case 'f': BIF_ThemeColor(TH_SYNTAX_L); break;
- case 'v': BIF_ThemeColor(TH_SYNTAX_N); break;
- case '?': BIF_ThemeColor(TH_TEXT); b=0; break;
- }
- if (b) {
- glRecti(x+8, y+2, x+11, y+5);
- BIF_ThemeColor(TH_TEXT);
- }
- text_draw(st, str, 0, 0, 1, x+16, y-1, NULL);
-
- if (item == last) break;
- }
-}
-
-static short check_blockhandler(SpaceText *st, short handler)
-{
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2)
- if (st->blockhandler[a]==handler) return 1;
- return 0;
-}
-
-/* Find and replace GUI panel */
-static void text_panel_find(short cntrl) // TEXT_HANDLER_FIND
-{
- uiBlock *block;
-
- /* Ensure that find and replace buffers have been allocated */
- if (!g_find_str || !g_replace_str) {
- g_find_str= MEM_mallocN(TXT_MAXFINDSTR+1, "find_string");
- g_replace_str= MEM_mallocN(TXT_MAXFINDSTR+1, "replace_string");
- g_find_str[0]= g_replace_str[0]= '\0';
- }
-
- block= uiNewBlock(&curarea->uiblocks, "text_panel_find", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(TEXT_HANDLER_FIND); // for close and esc
- if(uiNewPanel(curarea, block, "Find & Replace", "Text", curarea->winx-230, curarea->winy-130, 260, 120)==0) return;
-
- uiBlockBeginAlign(block);
- uiDefButC(block, TEX, 0, "Find: ", 0,80,220,20, g_find_str, 0,(float)TXT_MAXFINDSTR, 0,0, "");
- uiDefIconBut(block, BUT, B_PASTEFIND, ICON_TEXT, 220,80,20,20, NULL, 0,0,0,0, "Copy from selection");
- uiDefButC(block, TEX, 0, "Replace: ", 0,60,220,20, g_replace_str, 0,(float)TXT_MAXFINDSTR, 0,0, "");
- uiDefIconBut(block, BUT, B_PASTEREPLACE, ICON_TEXT, 220,60,20,20, NULL, 0,0,0,0, "Copy from selection");
- uiBlockEndAlign(block);
- uiDefButBitI(block, TOG, TXT_FIND_WRAP, 0,"Wrap Around", 0,30,110,20,&g_find_flags,0,0,0,0,"Wrap search around current text");
- uiDefButBitI(block, TOG, TXT_FIND_ALLTEXTS,0,"Search All Texts", 110,30,130,20,&g_find_flags,0,0,0,0,"Search in each text");
- uiDefBut(block, BUT, B_TEXTFIND, "Find", 0,0,50,20, NULL, 0,0,0,0, "Find next");
- uiDefBut(block, BUT, B_TEXTREPLACE, "Replace/Find", 50,0,110,20, NULL, 0,0,0,0, "Replace then find next");
- uiDefBut(block, BUT, B_TEXTMARKALL, "Mark All", 160,0,80,20, NULL, 0,0,0,0, "Mark each occurrence to edit all from one");
-}
-
-/* mode: 0 find only, 1 replace/find, 2 mark all occurrences */
-void find_and_replace(SpaceText *st, short mode)
-{
- Text *start= NULL, *text= st->text;
- int flags, first= 1;
- char *tmp;
-
- if (!check_blockhandler(st, TEXT_HANDLER_FIND)) {
- toggle_blockhandler(st->area, TEXT_HANDLER_FIND, UI_PNL_TO_MOUSE);
- return;
- }
-
- if (!g_find_str || !g_replace_str) return;
- if (g_find_str[0] == '\0') return;
- flags= g_find_flags;
- if (flags & TXT_FIND_ALLTEXTS) flags ^= TXT_FIND_WRAP;
-
- do {
- if (first)
- txt_clear_markers(text, TMARK_GRP_FINDALL, 0);
- first= 0;
-
- /* Replace current */
- if (mode && txt_has_sel(text)) {
- tmp= txt_sel_to_buf(text);
- if (strcmp(g_find_str, tmp)==0) {
- if (mode==1) {
- txt_insert_buf(text, g_replace_str);
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- } else if (mode==2) {
- char color[4];
- BIF_GetThemeColor4ubv(TH_SHADE2, color);
- if (txt_find_marker(text, text->curl, text->selc, TMARK_GRP_FINDALL, 0)) {
- if (tmp) MEM_freeN(tmp), tmp=NULL;
- break;
- }
- txt_add_marker(text, text->curl, text->curc, text->selc, color, TMARK_GRP_FINDALL, TMARK_EDITALL);
- }
- }
- MEM_freeN(tmp);
- tmp= NULL;
- }
-
- /* Find next */
- if (txt_find_string(text, g_find_str, flags & TXT_FIND_WRAP)) {
- pop_space_text(st);
- } else if (flags & TXT_FIND_ALLTEXTS) {
- if (text==start) break;
- if (!start) start= text;
- if (text->id.next)
- text= st->text= text->id.next;
- else
- text= st->text= G.main->text.first;
- txt_move_toline(text, 0, 0);
- pop_space_text(st);
- first= 1;
- } else {
- okee("Text not found: %s", g_find_str);
- break;
- }
- } while (mode==2);
-}
-
-static void do_find_buttons(val)
-{
- Text *text;
- SpaceText *st;
- char *tmp;
-
- st= curarea->spacedata.first;
- if (!st || st->spacetype != SPACE_TEXT) return;
- text= st->text;
- if (!text) return;
-
- switch (val) {
- case B_PASTEFIND:
- if (!g_find_str) break;
- tmp= txt_sel_to_buf(text);
- strncpy(g_find_str, tmp, TXT_MAXFINDSTR);
- MEM_freeN(tmp);
- break;
- case B_PASTEREPLACE:
- if (!g_replace_str) break;
- tmp= txt_sel_to_buf(text);
- strncpy(g_replace_str, tmp, TXT_MAXFINDSTR);
- MEM_freeN(tmp);
- break;
- case B_TEXTFIND:
- find_and_replace(st, 0);
- break;
- case B_TEXTREPLACE:
- find_and_replace(st, 1);
- break;
- case B_TEXTMARKALL:
- find_and_replace(st, 2);
- break;
- }
-}
-
-static void text_blockhandlers(ScrArea *sa)
-{
- SpaceText *st= sa->spacedata.first;
- short a;
-
- /* warning; blocks need to be freed each time, handlers dont remove */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- /* clear action value for event */
- switch(st->blockhandler[a]) {
- case TEXT_HANDLER_FIND:
- text_panel_find(st->blockhandler[a+1]);
- break;
- }
- }
- uiDrawBlocksPanels(sa, 0);
-}
-
-void drawtextspace(ScrArea *sa, void *spacedata)
-{
- SpaceText *st= curarea->spacedata.first;
- Text *text;
- TextLine *tmp;
- float col[3];
- int i, x, y;
- int linecount = 0;
- char linenr[12];
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- bwin_clear_viewmat(sa->win); /* clear buttons view */
- glLoadIdentity();
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
-
- draw_area_emboss(sa);
-
- text= st->text;
- if(!text) return;
-
- /* Make sure all the positional pointers exist */
- if (!text->curl || !text->sell || !text->lines.first || !text->lines.last)
- txt_clean_text(text);
-
- if(st->lheight) st->viewlines= (int) curarea->winy/st->lheight;
- else st->viewlines= 0;
-
- if(st->showlinenrs) {
- BIF_ThemeColor(TH_GRID);
- glRecti(23, 0, (st->lheight==15)?63:59, curarea->winy - 2);
- }
-
- draw_cursor(st);
-
- tmp= text->lines.first;
- for (i= 0; i<st->top && tmp; i++) {
- if (st->showsyntax && !tmp->format) txt_format_line(st, tmp, 0);
- tmp= tmp->next;
- linecount++;
- }
-
- y= curarea->winy-st->lheight;
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
-
- BIF_ThemeColor(TH_TEXT);
- for (i=0; y>0 && i<st->viewlines && tmp; i++, tmp= tmp->next) {
- if (st->showsyntax && !tmp->format) {
- txt_format_line(st, tmp, 0);
- }
- if(st->showlinenrs) {
- /*Change the color of the current line the cursor is on*/
- if(tmp == text->curl) {
- BIF_ThemeColor(TH_HILITE);
- } else {
- BIF_ThemeColor(TH_TEXT);
- }
- if(((float)(i + linecount + 1)/10000.0) < 1.0) {
- sprintf(linenr, "%4d", i + linecount + 1);
- glRasterPos2i(TXT_OFFSET - 7, y);
- } else {
- sprintf(linenr, "%5d", i + linecount + 1);
- glRasterPos2i(TXT_OFFSET - 11, y);
- }
- BIF_ThemeColor(TH_TEXT);
- BMF_DrawString(spacetext_get_font(st), linenr);
- }
- if (st->wordwrap) {
- int lines = text_draw_wrapped(st, tmp->line, x, y, curarea->winx-x, tmp->format);
- y -= lines*st->lheight;
- } else {
- text_draw(st, tmp->line, st->left, 0, 1, x, y, tmp->format);
- y -= st->lheight;
- }
- }
-
- draw_brackets(st);
- draw_markers(st);
-
- draw_textscroll(st);
- draw_documentation(st);
- draw_suggestion_list(st);
-
- bwin_scalematrix(sa->win, st->blockscale, st->blockscale, st->blockscale);
- text_blockhandlers(sa);
-
- curarea->win_swap= WIN_BACK_OK;
-}
-
-/* Moves the view to the cursor location,
- also used to make sure the view isnt outside the file */
-void pop_space_text (SpaceText *st)
-{
- int i, x;
-
- if(!st) return;
- if(!st->text) return;
- if(!st->text->curl) return;
-
- i= txt_get_span(st->text->lines.first, st->text->sell);
- if (st->top+st->viewlines <= i || st->top > i) {
- st->top= i - st->viewlines/2;
- }
-
- if (st->wordwrap) {
- st->left= 0;
- } else {
- x= text_draw(st, st->text->sell->line, st->left, st->text->selc, 0, 0, 0, NULL);
-
- if (x==0 || x>curarea->winx) {
- st->left= st->text->curc-0.5*(curarea->winx)/spacetext_get_fontwidth(st);
- }
- }
-
- if (st->top < 0) st->top= 0;
- if (st->left <0) st->left= 0;
-}
-
-void add_text_fs(char *file) /* bad but cant pass an as arg here */
-{
- SpaceText *st= curarea->spacedata.first;
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text= add_text(file);
-
- st->text= text;
-
- st->top= 0;
-
- if (st->showsyntax) txt_format_text(st);
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
-}
-
-void free_textspace(SpaceText *st)
-{
- if (!st) return;
-
- st->text= NULL;
-}
-
-static void save_mem_text(char *str)
-{
- SpaceText *st= curarea->spacedata.first;
- Text *text;
-
- if (!str) return;
-
- if (!st) return;
- if (st->spacetype != SPACE_TEXT) return;
-
- text= st->text;
- if(!text) return;
-
- if (text->name) MEM_freeN(text->name);
- text->name= MEM_mallocN(strlen(str)+1, "textname");
- strcpy(text->name, str);
-
- text->flags ^= TXT_ISMEM;
-
- txt_write_file(text);
-}
-
-void txt_write_file(Text *text)
-{
- FILE *fp;
- TextLine *tmp;
- struct stat st;
- int res;
- char file[FILE_MAXDIR+FILE_MAXFILE];
-
- /* Do we need to get a filename? */
- if (text->flags & TXT_ISMEM) {
- if (text->name)
- activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->name, save_mem_text);
- else
- activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->id.name+2, save_mem_text);
- return;
- }
-
- BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_convertstringcode(file, G.sce);
-
- /* Should we ask to save over? */
- if (text->flags & TXT_ISTMP) {
- if (BLI_exists(file)) {
- if (!okee("Save over")) return;
- } else if (!okee("Create new file")) return;
-
- text->flags ^= TXT_ISTMP;
- }
-
- fp= fopen(file, "w");
- if (fp==NULL) {
- error("Unable to save file");
- return;
- }
-
- tmp= text->lines.first;
- while (tmp) {
- if (tmp->next) fprintf(fp, "%s\n", tmp->line);
- else fprintf(fp, "%s", tmp->line);
-
- tmp= tmp->next;
- }
-
- fclose (fp);
-
- res= stat(file, &st);
- text->mtime= st.st_mtime;
-
- if (text->flags & TXT_ISDIRTY) text->flags ^= TXT_ISDIRTY;
-}
-
-void unlink_text(Text *text)
-{
- bScreen *scr;
- ScrArea *area;
- SpaceLink *sl;
-
-#ifndef DISABLE_PYTHON
- /* check if this text was used as script link:
- * this check function unsets the pointers and returns how many
- * script links used this Text */
- if (BPY_check_all_scriptlinks (text)) {
- allqueue(REDRAWBUTSSCRIPT, 0);
- }
- /* equivalently for pynodes: */
- if (nodeDynamicUnlinkText ((ID*)text)) {
- allqueue(REDRAWNODE, 0);
- }
-#endif
-
- for (scr= G.main->screen.first; scr; scr= scr->id.next) {
- for (area= scr->areabase.first; area; area= area->next) {
- for (sl= area->spacedata.first; sl; sl= sl->next) {
- if (sl->spacetype==SPACE_TEXT) {
- SpaceText *st= (SpaceText*) sl;
-
- if (st->text==text) {
- st->text= NULL;
- st->top= 0;
-
- if (st==area->spacedata.first) {
- scrarea_queue_redraw(area);
- }
- }
- }
- }
- }
- }
-}
-
-int jumptoline_interactive(SpaceText *st)
-{
- short nlines= txt_get_span(st->text->lines.first, st->text->lines.last)+1;
- short tmp= txt_get_span(st->text->lines.first, st->text->curl)+1;
-
- if (button(&tmp, 1, nlines, "Jump to line:")) {
- txt_move_toline(st->text, tmp-1, 0);
- pop_space_text(st);
- return 1;
- } else {
- return 0;
- }
-}
-
-
-int bufferlength;
-static char *copybuffer = NULL;
-
-static void txt_copy_selectbuffer (Text *text)
-{
- int length=0;
- TextLine *tmp, *linef, *linel;
- int charf, charl;
-
- if (!text) return;
- if (!text->curl) return;
- if (!text->sell) return;
-
- if (!txt_has_sel(text)) return;
-
- if (copybuffer) {
- MEM_freeN(copybuffer);
- copybuffer= NULL;
- }
-
- if (text->curl==text->sell) {
- linef= linel= text->curl;
-
- if (text->curc < text->selc) {
- charf= text->curc;
- charl= text->selc;
- } else{
- charf= text->selc;
- charl= text->curc;
- }
- } else if (txt_get_span(text->curl, text->sell)<0) {
- linef= text->sell;
- linel= text->curl;
-
- charf= text->selc;
- charl= text->curc;
- } else {
- linef= text->curl;
- linel= text->sell;
-
- charf= text->curc;
- charl= text->selc;
- }
-
- if (linef == linel) {
- length= charl-charf;
-
- copybuffer= MEM_mallocN(length+1, "cut buffera");
-
- BLI_strncpy(copybuffer, linef->line + charf, length+1);
- } else {
- length+= linef->len - charf;
- length+= charl;
- length++; /* For the '\n' */
-
- tmp= linef->next;
- while (tmp && tmp!= linel) {
- length+= tmp->len+1;
- tmp= tmp->next;
- }
-
- copybuffer= MEM_mallocN(length+1, "cut bufferb");
-
- strncpy(copybuffer, linef->line+ charf, linef->len-charf);
- length= linef->len-charf;
-
- copybuffer[length++]='\n';
-
- tmp= linef->next;
- while (tmp && tmp!=linel) {
- strncpy(copybuffer+length, tmp->line, tmp->len);
- length+= tmp->len;
-
- copybuffer[length++]='\n';
-
- tmp= tmp->next;
- }
- strncpy(copybuffer+length, linel->line, charl);
- length+= charl;
-
- copybuffer[length]=0;
- }
-
- bufferlength = length;
-}
-
-static char *unixNewLine(char *buffer)
-{
- char *p, *p2, *output;
-
- /* we can afford the few extra bytes */
- output= MEM_callocN(strlen(buffer)+1, "unixnewline");
- for (p= buffer, p2= output; *p; p++)
- if (*p != '\r') *(p2++)= *p;
-
- *p2= 0;
- return(output);
-}
-
-static char *winNewLine(char *buffer)
-{
- char *p, *p2, *output;
- int add= 0;
-
- for (p= buffer; *p; p++)
- if (*p == '\n') add++;
-
- bufferlength= p-buffer+add+1;
- output= MEM_callocN(bufferlength, "winnewline");
- for (p= buffer, p2= output; *p; p++, p2++) {
- if (*p == '\n') {
- *(p2++)= '\r'; *p2= '\n';
- } else *p2= *p;
- }
- *p2= 0;
-
- return(output);
-}
-
-void txt_paste_clipboard(Text *text)
-{
- char * buff;
- char *temp_buff;
-
- buff = (char*)getClipboard(0);
- if(buff) {
- temp_buff = unixNewLine(buff);
-
- txt_insert_buf(text, temp_buff);
- if(buff){free((void*)buff);}
- if(temp_buff){MEM_freeN(temp_buff);}
- }
-}
-
-void get_selection_buffer(Text *text)
-{
- char *buff = getClipboard(1);
-
- txt_insert_buf(text, buff);
-}
-
-void txt_copy_clipboard(Text *text)
-{
- char *temp;
-
- txt_copy_selectbuffer(text);
-
- if (copybuffer) {
- copybuffer[bufferlength] = '\0';
- temp = winNewLine(copybuffer);
-
- putClipboard(temp, 0);
- MEM_freeN(temp);
- MEM_freeN(copybuffer);
- copybuffer= NULL;
- }
-}
-
-void run_python_script(SpaceText *st)
-{
- Text *text=st->text;
- char *py_filename;
-#ifdef DISABLE_PYTHON
- error("python disabled in this build");
-#else
- if (!BPY_txt_do_python_Text(text)) {
- int lineno = BPY_Err_getLinenumber();
- // jump to error if happened in current text:
- py_filename = (char*) BPY_Err_getFilename();
-
- /* st->text can become NULL: user called Blender.Load(blendfile)
- * before the end of the script. */
- if (!st->text) return;
-
- if (!strcmp(py_filename, st->text->id.name+2)) {
- error_pyscript( );
- if (lineno >= 0) {
- txt_move_toline(text, lineno-1, 0);
- txt_sel_line(text);
- pop_space_text(st);
- }
- } else {
- error("Error in other (possibly external) file, "\
- "check console");
- }
- }
-#endif
-}
-
-static void set_tabs(Text *text)
-{
- SpaceText *st = curarea->spacedata.first;
-
- st->currtab_set = setcurr_tab(text);
-}
-
-static void wrap_move_bol(SpaceText *st, short sel)
-{
- Text *text= st->text;
- int offl, offc, lin;
-
- lin= txt_get_span(text->lines.first, text->sell);
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
-
- if (sel) {
- txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, -offc);
- text->selc= -offc;
- } else {
- txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, -offc);
- text->curc= -offc;
- txt_pop_sel(text);
- }
-}
-
-static void wrap_move_eol(SpaceText *st, short sel)
-{
- Text *text= st->text;
- int offl, offc, lin, startl, c;
-
- lin= txt_get_span(text->lines.first, text->sell);
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
- startl= offl;
- c= text->selc;
- while (offl==startl && text->sell->line[c]!='\0') {
- c++;
- wrap_offset(st, text->sell, c, &offl, &offc);
- } if (offl!=startl) c--;
-
- if (sel) {
- txt_undo_add_toop(text, UNDO_STO, lin, text->selc, lin, c);
- text->selc= c;
- } else {
- txt_undo_add_toop(text, UNDO_CTO, lin, text->curc, lin, c);
- text->curc= c;
- txt_pop_sel(text);
- }
-}
-
-static void wrap_move_up(SpaceText *st, short sel)
-{
- Text *text= st->text;
- int offl, offl_1, offc, fromline, toline, c, target;
-
- wrap_offset(st, text->sell, 0, &offl_1, &offc);
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
- fromline= toline= txt_get_span(text->lines.first, text->sell);
- target= text->selc + offc;
-
- if (offl==offl_1) {
- if (!text->sell->prev) {
- txt_move_bol(text, sel);
- return;
- }
- toline--;
- c= text->sell->prev->len; /* End of prev. line */
- wrap_offset(st, text->sell->prev, c, &offl, &offc);
- c= -offc+target;
- } else {
- c= -offc-1; /* End of prev. line */
- wrap_offset(st, text->sell, c, &offl, &offc);
- c= -offc+target;
- }
- if (c<0) c=0;
-
- if (sel) {
- txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c);
- if (toline<fromline) text->sell= text->sell->prev;
- if(text->sell) {
- if (c>text->sell->len) c= text->sell->len;
- text->selc= c;
- }
- }
- else if(text->curl) {
- txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
- if (toline<fromline) text->curl= text->curl->prev;
- if(text->curl) {
- if (c>text->curl->len) c= text->curl->len;
- text->curc= c;
- txt_pop_sel(text);
- }
- }
-}
-
-static void wrap_move_down(SpaceText *st, short sel)
-{
- Text *text= st->text;
- int offl, startoff, offc, fromline, toline, c, target;
-
- wrap_offset(st, text->sell, text->selc, &offl, &offc);
- fromline= toline= txt_get_span(text->lines.first, text->sell);
- target= text->selc + offc;
- startoff= offl;
- c= text->selc;
- while (offl==startoff && text->sell->line[c]!='\0') {
- c++;
- wrap_offset(st, text->sell, c, &offl, &offc);
- }
-
- if (text->sell->line[c]=='\0') {
- if (!text->sell->next) {
- txt_move_eol(text, sel);
- return;
- }
- toline++;
- c= target;
- } else {
- c += target;
- if (c > text->sell->len) c= text->sell->len;
- }
- if (c<0) c=0;
-
- if (sel) {
- txt_undo_add_toop(text, UNDO_STO, fromline, text->selc, toline, c);
- if (toline>fromline) text->sell= text->sell->next;
- if(text->sell) {
- if (c>text->sell->len) c= text->sell->len;
- text->selc= c;
- }
- }
- else if(text->curl) {
- txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
- if (toline>fromline) text->curl= text->curl->next;
- if(text->curl) {
- if (c > text->curl->len) c= text->curl->len;
- text->curc= c;
- txt_pop_sel(text);
- }
- }
-}
-
-static void get_suggest_prefix(Text *text, int offset)
-{
- int i, len;
- char *line, tmp[256];
-
- if (!text) return;
- if (!texttool_text_is_active(text)) return;
-
- line= text->curl->line;
- for (i=text->curc-1+offset; i>=0; i--)
- if (!check_identifier(line[i]))
- break;
- i++;
- len= text->curc-i+offset;
- if (len > 255) {
- printf("Suggestion prefix too long\n");
- len = 255;
- }
- strncpy(tmp, line+i, len);
- tmp[len]= '\0';
- texttool_suggest_prefix(tmp);
-}
-
-static void confirm_suggestion(Text *text, int skipleft)
-{
- SuggItem *sel;
- int i, over=0;
- char *line;
-
- if (!text) return;
- if (!texttool_text_is_active(text)) return;
-
- sel = texttool_suggest_selected();
- if (!sel) return;
-
- line= text->curl->line;
- i=text->curc-skipleft-1;
- while (i>=0) {
- if (!check_identifier(line[i]))
- break;
- over++;
- i--;
- }
-
- for (i=0; i<skipleft; i++)
- txt_move_left(text, 0);
- for (i=0; i<over; i++)
- txt_move_left(text, 1);
-
- txt_insert_buf(text, sel->name);
-
- for (i=0; i<skipleft; i++)
- txt_move_right(text, 0);
-
- texttool_text_clear();
-}
-
-static short do_texttools(SpaceText *st, char ascii, unsigned short evnt, short val)
-{
- int draw=0, tools=0, swallow=0, scroll=1;
- if (!texttool_text_is_active(st->text)) return 0;
- if (!st->text || st->text->id.lib) return 0;
-
- if (st->doplugins && texttool_text_is_active(st->text)) {
- if (texttool_suggest_first()) tools |= TOOL_SUGG_LIST;
- if (texttool_docs_get()) tools |= TOOL_DOCUMENT;
- }
-
- if (ascii) {
- if (tools & TOOL_SUGG_LIST) {
- if ((ascii != '_' && ascii != '*' && ispunct(ascii)) || check_whitespace(ascii)) {
- confirm_suggestion(st->text, 0);
- if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
- } else if ((st->overwrite && txt_replace_char(st->text, ascii)) || txt_add_char(st->text, ascii)) {
- get_suggest_prefix(st->text, 0);
- pop_suggest_list();
- swallow= 1;
- draw= 1;
- }
- }
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
-
- } else if (val==1 && evnt) {
- switch (evnt) {
- case LEFTMOUSE:
- if (do_suggest_select(st))
- swallow= 1;
- else {
- if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- }
- draw= 1;
- break;
- case MIDDLEMOUSE:
- if (do_suggest_select(st)) {
- confirm_suggestion(st->text, 0);
- if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
- swallow= 1;
- } else {
- if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- }
- draw= 1;
- break;
- case ESCKEY:
- draw= swallow= 1;
- if (tools & TOOL_SUGG_LIST) texttool_suggest_clear();
- else if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- else draw= swallow= 0;
- break;
- case RETKEY:
- if (tools & TOOL_SUGG_LIST) {
- confirm_suggestion(st->text, 0);
- if (st->showsyntax) txt_format_line(st, st->text->curl, 1);
- swallow= 1;
- draw= 1;
- }
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
- break;
- case LEFTARROWKEY:
- case BACKSPACEKEY:
- if (tools & TOOL_SUGG_LIST) {
- if (G.qual)
- texttool_suggest_clear();
- else {
- /* Work out which char we are about to delete/pass */
- if (st->text->curl && st->text->curc > 0) {
- char ch= st->text->curl->line[st->text->curc-1];
- if ((ch=='_' || !ispunct(ch)) && !check_whitespace(ch)) {
- get_suggest_prefix(st->text, -1);
- pop_suggest_list();
- }
- else
- texttool_suggest_clear();
- } else
- texttool_suggest_clear();
- }
- }
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- break;
- case RIGHTARROWKEY:
- if (tools & TOOL_SUGG_LIST) {
- if (G.qual)
- texttool_suggest_clear();
- else {
- /* Work out which char we are about to pass */
- if (st->text->curl && st->text->curc < st->text->curl->len) {
- char ch= st->text->curl->line[st->text->curc+1];
- if ((ch=='_' || !ispunct(ch)) && !check_whitespace(ch)) {
- get_suggest_prefix(st->text, 1);
- pop_suggest_list();
- }
- else
- texttool_suggest_clear();
- } else
- texttool_suggest_clear();
- }
- }
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0;
- break;
- case PAGEDOWNKEY:
- scroll= SUGG_LIST_SIZE-1;
- case WHEELDOWNMOUSE:
- case DOWNARROWKEY:
- if (tools & TOOL_DOCUMENT) {
- doc_scroll++;
- swallow= 1;
- draw= 1;
- break;
- } else if (tools & TOOL_SUGG_LIST) {
- SuggItem *sel = texttool_suggest_selected();
- if (!sel) {
- texttool_suggest_select(texttool_suggest_first());
- } else while (sel && sel!=texttool_suggest_last() && sel->next && scroll--) {
- texttool_suggest_select(sel->next);
- sel= sel->next;
- }
- pop_suggest_list();
- swallow= 1;
- draw= 1;
- break;
- }
- case PAGEUPKEY:
- scroll= SUGG_LIST_SIZE-1;
- case WHEELUPMOUSE:
- case UPARROWKEY:
- if (tools & TOOL_DOCUMENT) {
- if (doc_scroll>0) doc_scroll--;
- swallow= 1;
- draw= 1;
- break;
- } else if (tools & TOOL_SUGG_LIST) {
- SuggItem *sel = texttool_suggest_selected();
- while (sel && sel!=texttool_suggest_first() && sel->prev && scroll--) {
- texttool_suggest_select(sel->prev);
- sel= sel->prev;
- }
- pop_suggest_list();
- swallow= 1;
- draw= 1;
- break;
- }
- case RIGHTSHIFTKEY:
- case LEFTSHIFTKEY:
- break;
- default:
- if (tools & TOOL_SUGG_LIST) texttool_suggest_clear(), draw= 1;
- if (tools & TOOL_DOCUMENT) texttool_docs_clear(), doc_scroll= 0, draw= 1;
- }
- }
-
- if (draw)
- redraw_alltext();
-
- return swallow;
-}
-
-static short do_markers(SpaceText *st, char ascii, unsigned short evnt, short val)
-{
- Text *text;
- TextMarker *marker, *mrk, *nxt;
- int c, s, draw=0, swallow=0;
-
- text= st->text;
- if (!text || text->id.lib || text->curl != text->sell) return 0;
-
- marker= txt_find_marker(text, text->sell, text->selc, 0, 0);
- if (marker && (marker->start > text->curc || marker->end < text->curc))
- marker= NULL;
-
- if (!marker) {
- /* Find the next temporary marker */
- if (evnt==TABKEY) {
- int lineno= txt_get_span(text->lines.first, text->curl);
- TextMarker *mrk= text->markers.first;
- while (mrk) {
- if (!marker && (mrk->flags & TMARK_TEMP)) marker= mrk;
- if ((mrk->flags & TMARK_TEMP) && (mrk->lineno > lineno || (mrk->lineno==lineno && mrk->end > text->curc))) {
- marker= mrk;
- break;
- }
- mrk= mrk->next;
- }
- if (marker) {
- txt_move_to(text, marker->lineno, marker->start, 0);
- txt_move_to(text, marker->lineno, marker->end, 1);
- pop_space_text(st);
- evnt= ascii= val= 0;
- draw= 1;
- swallow= 1;
- }
- } else if (evnt==ESCKEY) {
- if (txt_clear_markers(text, 0, TMARK_TEMP)) swallow= 1;
- else if (txt_clear_markers(text, 0, 0)) swallow= 1;
- else return 0;
- evnt= ascii= val= 0;
- draw= 1;
- }
- if (!swallow) return 0;
- }
-
- if (ascii) {
- if (marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if (s<0 || s>marker->end-marker->start) return 0;
-
- mrk= txt_next_marker(text, marker);
- while (mrk) {
- nxt=txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
- if (st->overwrite) {
- if (txt_replace_char(text, ascii))
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- } else {
- if (txt_add_char(text, ascii)) {
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- }
- }
-
- if (mrk==marker || mrk==nxt) break;
- mrk=nxt;
- }
- swallow= 1;
- draw= 1;
- }
- } else if (val) {
- switch(evnt) {
- case BACKSPACEKEY:
- if (marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if (s<0 || s>marker->end-marker->start) return 0;
-
- mrk= txt_next_marker(text, marker);
- while (mrk) {
- nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
- txt_backspace_char(text);
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- if (mrk==marker || mrk==nxt) break;
- mrk= nxt;
- }
- swallow= 1;
- draw= 1;
- }
- break;
- case DELKEY:
- if (marker->flags & TMARK_EDITALL) {
- c= text->curc-marker->start;
- s= text->selc-marker->start;
- if (s<0 || s>marker->end-marker->start) return 0;
-
- mrk= txt_next_marker(text, marker);
- while (mrk) {
- nxt= txt_next_marker(text, mrk); /* mrk may become invalid */
- txt_move_to(text, mrk->lineno, mrk->start+c, 0);
- if (s!=c) txt_move_to(text, mrk->lineno, mrk->start+s, 1);
- txt_delete_char(text);
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- if (mrk==marker || mrk==nxt) break;
- mrk= nxt;
- }
- swallow= 1;
- draw= 1;
- }
- break;
- case TABKEY:
- if (G.qual & LR_SHIFTKEY) {
- nxt= marker->prev;
- if (!nxt) nxt= text->markers.last;
- } else {
- nxt= marker->next;
- if (!nxt) nxt= text->markers.first;
- }
- if (marker->flags & TMARK_TEMP) {
- if (nxt==marker) nxt= NULL;
- BLI_freelinkN(&text->markers, marker);
- }
- mrk= nxt;
- if (mrk) {
- txt_move_to(text, mrk->lineno, mrk->start, 0);
- txt_move_to(text, mrk->lineno, mrk->end, 1);
- pop_space_text(st);
- }
- swallow= 1;
- draw= 1;
- break;
-
- /* Events that should clear markers */
- case UKEY: if (!(G.qual & LR_ALTKEY)) break;
- case ZKEY: if (evnt==ZKEY && !(G.qual & LR_CTRLKEY)) break;
- case RETKEY:
- case ESCKEY:
- if (marker->flags & (TMARK_EDITALL | TMARK_TEMP))
- txt_clear_markers(text, marker->group, 0);
- else
- BLI_freelinkN(&text->markers, marker);
- swallow= 1;
- draw= 1;
- break;
- case RIGHTMOUSE: /* Marker context menu? */
- case LEFTMOUSE:
- break;
- case FKEY: /* Allow find */
- if (G.qual & LR_SHIFTKEY) swallow= 1;
- break;
-
- default:
- if (G.qual!=0 && G.qual!=LR_SHIFTKEY)
- swallow= 1; /* Swallow all other shortcut events */
- }
- }
-
- if (draw)
- redraw_alltext();
-
- return swallow;
-}
-
-
-void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- SpaceText *st= curarea->spacedata.first;
- Text *text;
- int do_draw=0, p;
- unsigned short event= evt->event;
- short val= evt->val;
- char ascii= evt->ascii;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- /* smartass code to prevent the CTRL/ALT events below from not working! */
- if(G.qual & (LR_ALTKEY|LR_CTRLKEY))
- if(!ispunct(ascii))
- ascii= 0;
-
- text= st->text;
-
- if (!text) {
- if (event==RIGHTMOUSE) {
- switch (pupmenu("File %t|New %x0|Open... %x1")) {
- case 0:
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case 1:
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- break;
- }
- }
- if (val && !ELEM(G.qual, 0, LR_SHIFTKEY)) {
- if (event==FKEY && G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
- switch (pupmenu("File %t|New %x0|Open... %x1")) {
- case 0:
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case 1:
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- break;
- }
- }
- else if (event==QKEY) {
- if (G.qual & LR_CTRLKEY) {
- if(okee("Quit Blender")) exit_usiblender();
- }
- }
- else if (event==NKEY) {
- if (G.qual & LR_ALTKEY) {
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- }
- else if (event==OKEY) {
- if (G.qual & LR_ALTKEY) {
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- }
- }
- }
- return;
- }
-
- if (val && uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING) event= 0;
-
- if (st->doplugins && do_texttools(st, ascii, event, val)) return;
- if (do_markers(st, ascii, event, val)) return;
-
- if (event==UI_BUT_EVENT) {
- do_find_buttons(val);
- do_draw= 1;
- } else if (event==LEFTMOUSE) {
- if (val) {
- short mval[2];
- char *buffer;
- set_tabs(text);
- getmouseco_areawin(mval);
-
- if (mval[0]>2 && mval[0]<20 && mval[1]>2 && mval[1]<curarea->winy-2) {
- do_textscroll(st, 2);
- } else {
- do_selection(st, G.qual&LR_SHIFTKEY);
- if (txt_has_sel(text)) {
- buffer = txt_sel_to_buf(text);
- putClipboard(buffer, 1);
- MEM_freeN(buffer);
- }
- do_draw= 1;
- }
- }
- } else if (event==MIDDLEMOUSE) {
- if (val) {
- if (U.uiflag & USER_MMB_PASTE) {
- do_selection(st, G.qual&LR_SHIFTKEY);
- get_selection_buffer(text);
- do_draw= 1;
- } else {
- do_textscroll(st, 1);
- }
- }
- } else if (event==RIGHTMOUSE) {
- if (val) {
- if (txt_has_sel(text))
- p= pupmenu("Text %t|Cut%x10|Copy%x11|Paste%x12|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4");
- else
- p= pupmenu("Text %t|Paste%x12|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4");
-
- switch(p) {
- case 0:
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
-
- case 1:
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- break;
-
- case 3:
- text->flags |= TXT_ISMEM;
-
- case 2:
- txt_write_file(text);
- do_draw= 1;
- break;
- case 4:
- run_python_script(st);
- do_draw= 1;
- break;
- case 10:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_copy_clipboard(text);
- txt_cut_sel(text);
- pop_space_text(st);
- do_draw= 1;
- break;
- case 11:
- //txt_copy_sel(text);
- txt_copy_clipboard(text);
- break;
- case 12:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_paste_clipboard(text);
- if (st->showsyntax) txt_format_text(st);
- do_draw= 1;
- break;
- }
- }
- } else if (ascii) {
- if (text && text->id.lib) {
- error_libdata();
- } else {
- short mval[2];
- getmouseco_areawin(mval);
- if (st->showlinenrs && mval[0]>2 && mval[0]<60 && mval[1]>2 && mval[1]<curarea->winy-2) {
- if (ascii>='0' && ascii<='9') {
- double time = PIL_check_seconds_timer();
- if (last_jump < time-1) jump_to= 0;
- jump_to *= 10; jump_to += (int)(ascii-'0');
- txt_move_toline(text, jump_to-1, 0);
- last_jump= time;
- }
- } else if ((st->overwrite && txt_replace_char(text, ascii)) || txt_add_char(text, ascii)) {
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- }
- pop_space_text(st);
- do_draw= 1;
- }
- } else if (val) {
- switch (event) {
- case AKEY:
- if (G.qual & LR_ALTKEY) {
- txt_move_bol(text, G.qual & LR_SHIFTKEY);
- do_draw= 1;
- pop_space_text(st);
- } else if (G.qual & LR_CTRLKEY) {
- txt_sel_all(text);
- do_draw= 1;
- }
- break; /* BREAK A */
- case CKEY:
- if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) {
- if(G.qual & LR_SHIFTKEY)
- txt_copy_clipboard(text);
- else
- txt_copy_clipboard(text);
-
- do_draw= 1;
- }
- break; /* BREAK C */
- case DKEY:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- //uncommenting
- txt_order_cursors(text);
- uncomment(text);
- do_draw = 1;
- if (st->showsyntax) txt_format_text(st);
- break;
- } else if (G.qual == LR_CTRLKEY) {
- txt_delete_char(text);
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- do_draw= 1;
- pop_space_text(st);
- }
- break; /* BREAK D */
- case EKEY:
- if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
- switch(pupmenu("Edit %t|Cut %x0|Copy %x1|Paste %x2|Print Cut Buffer %x3")) {
- case 0:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_copy_clipboard(text); //First copy to clipboard
- txt_cut_sel(text);
- do_draw= 1;
- break;
- case 1:
- txt_copy_clipboard(text);
- //txt_copy_sel(text);
- do_draw= 1;
- break;
- case 2:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- //txt_paste(text);
- txt_paste_clipboard(text);
- if (st->showsyntax) txt_format_text(st);
- do_draw= 1;
- break;
- case 3:
- txt_print_cutbuffer();
- break;
- }
- }
- else if (G.qual == LR_CTRLKEY || G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- txt_move_eol(text, G.qual & LR_SHIFTKEY);
- do_draw= 1;
- pop_space_text(st);
- }
- break; /* BREAK E */
- case FKEY:
- if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
- switch(pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3")) {
- case 0:
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case 1:
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- break;
- case 3:
- text->flags |= TXT_ISMEM;
- case 2:
- txt_write_file(text);
- do_draw= 1;
- break;
- }
- }
- else if (G.qual & (LR_ALTKEY|LR_CTRLKEY)) {
- find_and_replace(st, 0);
- do_draw= 1;
- }
- break; /* BREAK F */
- case HKEY:
- if (G.qual & (LR_ALTKEY|LR_CTRLKEY)) {
- find_and_replace(st, 1);
- do_draw= 1;
- }
- break; /* BREAK H */
- case JKEY:
- if (G.qual == LR_ALTKEY) {
- do_draw= jumptoline_interactive(st);
- }
- break; /* BREAK J */
- case MKEY:
- if (G.qual == LR_ALTKEY) {
- txt_export_to_object(text);
- do_draw= 1;
- }
- break; /* BREAK M */
- case NKEY:
- if (G.qual == LR_ALTKEY) {
- st->text= add_empty_text("Text");
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- break; /* BREAK N */
- case OKEY:
- if (G.qual == LR_ALTKEY) {
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- }
- break; /* BREAK O */
- case PKEY:
- if (G.qual == LR_ALTKEY) {
- run_python_script(st);
- do_draw= 1;
- }
- break; /* BREAK P */
- case QKEY:
- if(okee("Quit Blender")) exit_usiblender();
- break; /* BREAK Q */
- case RKEY:
- if (G.qual == LR_ALTKEY) {
-#ifndef DISABLE_PYTHON
- if (text->compiled) BPY_free_compiled_text(text);
- text->compiled = NULL;
-#endif
- if (okee("Reopen text")) {
- if (!reopen_text(text))
- error("Could not reopen file");
- if (st->showsyntax) txt_format_text(st);
- }
- do_draw= 1;
- }
- break; /* BREAK R */
- case SKEY:
- if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
- p= pupmenu("Select %t|"
- "Select All %x0|"
- "Select Line %x1|"
- "Jump to Line %x3");
- switch(p) {
- case 0:
- txt_sel_all(text);
- do_draw= 1;
- break;
-
- case 1:
- txt_sel_line(text);
- do_draw= 1;
- break;
-
- case 3:
- do_draw= jumptoline_interactive(st);
- break;
- }
- }
- else if (G.qual & LR_ALTKEY) {
- /* Event treatment CANNOT enter this if
- if (G.qual & LR_SHIFTKEY)
- if (text) text->flags |= TXT_ISMEM;
- */
- txt_write_file(text);
- do_draw= 1;
- }
- break; /* BREAK S */
- case UKEY:
- //txt_print_undo(text); //debug buffer in console
- if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) {
- txt_do_redo(text);
- pop_space_text(st);
- do_draw= 1;
- }
- if (G.qual == LR_ALTKEY) {
- txt_do_undo(text);
- if (st->showsyntax) txt_format_text(st);
- pop_space_text(st);
- do_draw= 1;
- }
- break; /* BREAK U */
- case VKEY:
- if (G.qual == (LR_ALTKEY| LR_SHIFTKEY)) {
- switch(pupmenu("View %t|Top of File %x0|Bottom of File %x1|Page Up %x2|Page Down %x3")) {
- case 0:
- txt_move_bof(text, 0);
- do_draw= 1;
- pop_space_text(st);
- break;
- case 1:
- txt_move_eof(text, 0);
- do_draw= 1;
- pop_space_text(st);
- break;
- case 2:
- screen_skip(st, -st->viewlines);
- do_draw= 1;
- break;
- case 3:
- screen_skip(st, st->viewlines);
- do_draw= 1;
- break;
- }
- }
- /* Support for both Alt-V and Ctrl-V for Paste, for backward compatibility reasons */
- else if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) {
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- /* Throwing in the Shift modifier Paste from the OS clipboard */
- if (G.qual & LR_SHIFTKEY)
- txt_paste_clipboard(text);
- else
- txt_paste_clipboard(text);
- if (st->showsyntax) txt_format_text(st);
- do_draw= 1;
- pop_space_text(st);
- }
- break; /* BREAK V */
- case XKEY:
- if (G.qual == LR_ALTKEY || G.qual == LR_CTRLKEY) {
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_cut_sel(text);
- if (st->showsyntax) txt_format_text(st);
- do_draw= 1;
- pop_space_text(st);
- }
- break;
- case ZKEY:
- if (G.qual & (LR_ALTKEY|LR_CTRLKEY|LR_COMMANDKEY)) {
- if (G.qual & LR_SHIFTKEY) {
- txt_do_redo(text);
- } else {
- txt_do_undo(text);
- }
- if (st->showsyntax) txt_format_text(st);
- pop_space_text(st);
- do_draw= 1;
- }
- break;
- case TABKEY:
- if (text && text->id.lib) {
- error_libdata();
- break;
- } else {
- if (txt_has_sel(text)) {
- if (G.qual & LR_SHIFTKEY) {
- txt_order_cursors(text);
- unindent(text);
- if (st->showsyntax) txt_format_text(st);
- } else {
- txt_order_cursors(text);
- indent(text);
- if (st->showsyntax) txt_format_text(st);
- }
- } else {
- txt_add_char(text, '\t');
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- }
- }
- pop_space_text(st);
- do_draw= 1;
- st->currtab_set = setcurr_tab(text);
- break;
- case RETKEY:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- //double check tabs before splitting the line
- st->currtab_set = setcurr_tab(text);
- txt_split_curline(text);
- {
- int a = 0;
- if (a < st->currtab_set)
- {
- while ( a < st->currtab_set) {
- txt_add_char(text, '\t');
- a++;
- }
- }
- }
- if (st->showsyntax) {
- if (text->curl->prev) txt_format_line(st, text->curl->prev, 0);
- txt_format_line(st, text->curl, 1);
- }
- do_draw= 1;
- pop_space_text(st);
- break;
- case BACKSPACEKEY:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if (G.qual & (LR_ALTKEY | LR_CTRLKEY)) {
- txt_backspace_word(text);
- } else {
- txt_backspace_char(text);
- }
- set_tabs(text);
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- do_draw= 1;
- pop_space_text(st);
- break;
- case DELKEY:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if (G.qual & (LR_ALTKEY | LR_CTRLKEY)) {
- txt_delete_word(text);
- } else {
- txt_delete_char(text);
- }
- if (st->showsyntax) txt_format_line(st, text->curl, 1);
- do_draw= 1;
- pop_space_text(st);
- st->currtab_set = setcurr_tab(text);
- break;
- case INSERTKEY:
- st->overwrite= !st->overwrite;
- do_draw= 1;
- break;
- case LEFTARROWKEY:
- if (G.qual & LR_COMMANDKEY)
- txt_move_bol(text, G.qual & LR_SHIFTKEY);
- else if (G.qual & LR_ALTKEY)
- txt_jump_left(text, G.qual & LR_SHIFTKEY);
- else
- txt_move_left(text, G.qual & LR_SHIFTKEY);
- set_tabs(text);
- do_draw= 1;
- pop_space_text(st);
- break;
- case RIGHTARROWKEY:
- if (G.qual & LR_COMMANDKEY)
- txt_move_eol(text, G.qual & LR_SHIFTKEY);
- else if (G.qual & LR_ALTKEY)
- txt_jump_right(text, G.qual & LR_SHIFTKEY);
- else
- txt_move_right(text, G.qual & LR_SHIFTKEY);
- set_tabs(text);
- do_draw= 1;
- pop_space_text(st);
- break;
- case UPARROWKEY:
- if (st->wordwrap) wrap_move_up(st, G.qual & LR_SHIFTKEY);
- else txt_move_up(text, G.qual & LR_SHIFTKEY);
- set_tabs(text);
- do_draw= 1;
- pop_space_text(st);
- break;
- case DOWNARROWKEY:
- if (st->wordwrap) wrap_move_down(st, G.qual & LR_SHIFTKEY);
- else txt_move_down(text, G.qual & LR_SHIFTKEY);
- set_tabs(text);
- do_draw= 1;
- pop_space_text(st);
- break;
- case PAGEDOWNKEY:
- cursor_skip(st, st->viewlines, G.qual & LR_SHIFTKEY);
- pop_space_text(st);
- do_draw= 1;
- break;
- case PAGEUPKEY:
- cursor_skip(st, -st->viewlines, G.qual & LR_SHIFTKEY);
- pop_space_text(st);
- do_draw= 1;
- break;
- case HOMEKEY:
- if (st->wordwrap) wrap_move_bol(st, G.qual & LR_SHIFTKEY);
- else txt_move_bol(text, G.qual & LR_SHIFTKEY);
- do_draw= 1;
- pop_space_text(st);
- break;
- case ENDKEY:
- if (st->wordwrap) wrap_move_eol(st, G.qual & LR_SHIFTKEY);
- else txt_move_eol(text, G.qual & LR_SHIFTKEY);
- do_draw= 1;
- pop_space_text(st);
- break;
- case WHEELUPMOUSE:
- screen_skip(st, -U.wheellinescroll);
- do_draw= 1;
- break;
- case WHEELDOWNMOUSE:
- screen_skip(st, U.wheellinescroll);
- do_draw= 1;
- break;
- }
- }
-
-#ifndef DISABLE_PYTHON
- /* Run text plugin scripts if enabled */
- if (st->doplugins && event && val) {
- if (BPY_menu_do_shortcut(PYMENU_TEXTPLUGIN, event, G.qual)) {
- do_draw= 1;
- }
- }
-#endif
- if (do_draw)
- redraw_alltext();
-}
-
-static void draw_brackets(SpaceText *st)
-{
- TextLine *startl, *endl, *linep;
- Text *text = st->text;
- int b, c, startc, endc, find, stack;
- int viewc, viewl, offl, offc, x, y;
- char ch;
-
- if (!text || !text->curl) return;
-
- startl= text->curl;
- startc= text->curc;
- b= check_bracket(startl->line[startc]);
- if (b==0 && startc>0) b = check_bracket(startl->line[--startc]);
- if (b==0) return;
-
- linep= startl;
- c= startc;
- endl= NULL;
- endc= -1;
- find= -b;
- stack= 0;
-
- /* Opening bracket, search forward for close */
- if (b>0) {
- c++;
- while (linep) {
- while (c<linep->len) {
- b= check_bracket(linep->line[c]);
- if (b==find) {
- if (stack==0) {
- endl= linep;
- endc= c;
- break;
- }
- stack--;
- } else if (b==-find) {
- stack++;
- }
- c++;
- }
- if (endl) break;
- linep= linep->next;
- c= 0;
- }
- }
- /* Closing bracket, search backward for open */
- else {
- c--;
- while (linep) {
- while (c>=0) {
- b= check_bracket(linep->line[c]);
- if (b==find) {
- if (stack==0) {
- endl= linep;
- endc= c;
- break;
- }
- stack--;
- } else if (b==-find) {
- stack++;
- }
- c--;
- }
- if (endl) break;
- linep= linep->prev;
- if (linep) c= linep->len-1;
- }
- }
-
- if (!endl || endc==-1) return;
-
- BIF_ThemeColor(TH_HILITE);
- x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET;
- y= curarea->winy - st->lheight;
-
- ch= startl->line[startc];
- wrap_offset(st, startl, startc, &offl, &offc);
- viewc= get_char_pos(st, startl->line, startc) - st->left + offc;
- if (viewc >= 0){
- viewl= txt_get_span(text->lines.first, startl) - st->top + offl;
- glRasterPos2i(x+viewc*spacetext_get_fontwidth(st), y-viewl*st->lheight);
- BMF_DrawCharacter(spacetext_get_font(st), ch);
- glRasterPos2i(x+viewc*spacetext_get_fontwidth(st)+1, y-viewl*st->lheight);
- BMF_DrawCharacter(spacetext_get_font(st), ch);
- }
- ch= endl->line[endc];
- wrap_offset(st, endl, endc, &offl, &offc);
- viewc= get_char_pos(st, endl->line, endc) - st->left + offc;
- if (viewc >= 0) {
- viewl= txt_get_span(text->lines.first, endl) - st->top + offl;
- glRasterPos2i(x+viewc*spacetext_get_fontwidth(st), y-viewl*st->lheight);
- BMF_DrawCharacter(spacetext_get_font(st), ch);
- glRasterPos2i(x+viewc*spacetext_get_fontwidth(st)+1, y-viewl*st->lheight);
- BMF_DrawCharacter(spacetext_get_font(st), ch);
- }
-}
-
-static int check_bracket(char ch)
-{
- int a;
- char opens[] = "([{";
- char close[] = ")]}";
-
- for (a=0; a<3; a++) {
- if(ch==opens[a])
- return a+1;
- else if (ch==close[a])
- return -(a+1);
- }
- return 0;
-}
-
-static int check_delim(char ch)
-{
- int a;
- char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,";
-
- for (a=0; a<28; a++) {
- if (ch==delims[a])
- return 1;
- }
- return 0;
-}
-
-static int check_digit(char ch)
-{
- if (ch < '0') return 0;
- if (ch <= '9') return 1;
- return 0;
-}
-
-static int check_identifier(char ch)
-{
- if (ch < '0') return 0;
- if (ch <= '9') return 1;
- if (ch < 'A') return 0;
- if (ch <= 'Z' || ch == '_') return 1;
- if (ch < 'a') return 0;
- if (ch <= 'z') return 1;
- return 0;
-}
-
-static int check_whitespace(char ch)
-{
- if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
- return 1;
- return 0;
-}
-
-void convert_tabs (struct SpaceText *st, int tab)
-{
- Text *text = st->text;
- TextLine *tmp;
- size_t a, j;
- char *check_line, *new_line;
- int extra, number; //unknown for now
-
- if (!text) return;
-
- tmp = text->lines.first;
-
- //first convert to all space, this make it alot easier to convert to tabs because there is no mixtures of ' ' && '\t'
- while(tmp) {
- check_line = tmp->line;
- new_line = MEM_mallocN(render_string(st, check_line)+1, "Converted_Line");
- j = 0;
- for (a=0; a < strlen(check_line); a++) { //foreach char in line
- if(check_line[a] == '\t') { //checking for tabs
- //get the number of spaces this tabs is showing
- //i dont like doing it this way but will look into it later
- new_line[j] = '\0';
- number = render_string(st, new_line);
- new_line[j] = '\t';
- new_line[j+1] = '\0';
- number = render_string(st, new_line)-number;
- for(extra = 0; extra < number; extra++) {
- new_line[j] = ' ';
- j++;
- }
- } else {
- new_line[j] = check_line[a];
- ++j;
- }
- }
- new_line[j] = '\0';
- // put new_line in the tmp->line spot still need to try and set the curc correctly
- if (tmp->line) MEM_freeN(tmp->line);
- if(tmp->format) MEM_freeN(tmp->format);
-
- tmp->line = new_line;
- tmp->len = strlen(new_line);
- tmp->format = NULL;
- tmp = tmp->next;
- }
-
- if (tab) // Converting to tabs
- { //start over from the begining
- tmp = text->lines.first;
-
- while(tmp) {
- check_line = tmp->line;
- extra = 0;
- for (a = 0; a < strlen(check_line); a++) {
- number = 0;
- for (j = 0; j < (size_t)st->tabnumber; j++) {
- if ((a+j) <= strlen(check_line)) { //check to make sure we are not pass the end of the line
- if(check_line[a+j] != ' ') {
- number = 1;
- }
- }
- }
- if (!number) { //found all number of space to equal a tab
- a = a+(st->tabnumber-1);
- extra = extra+1;
- }
- }
-
- if ( extra > 0 ) { //got tabs make malloc and do what you have to do
- new_line = MEM_mallocN(strlen(check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Line");
- extra = 0; //reuse vars
- for (a = 0; a < strlen(check_line); a++) {
- number = 0;
- for (j = 0; j < (size_t)st->tabnumber; j++) {
- if ((a+j) <= strlen(check_line)) { //check to make sure we are not pass the end of the line
- if(check_line[a+j] != ' ') {
- number = 1;
- }
- }
- }
- if (!number) { //found all number of space to equal a tab
- new_line[extra] = '\t';
- a = a+(st->tabnumber-1);
- ++extra;
-
- } else { //not adding a tab
- new_line[extra] = check_line[a];
- ++extra;
- }
- }
- new_line[extra] = '\0';
- // put new_line in the tmp->line spot still need to try and set the curc correctly
- if (tmp->line) MEM_freeN(tmp->line);
- if(tmp->format) MEM_freeN(tmp->format);
-
- tmp->line = new_line;
- tmp->len = strlen(new_line);
- tmp->format = NULL;
- }
- tmp = tmp->next;
- }
- }
-
- if (st->showsyntax) txt_format_text(st);
-}
-
-void redraw_alltext(void)
-{
- ScrArea *sa;
-
- if(!G.curscreen)
- return;
-
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- SpaceText *st= sa->spacedata.first;
-
- if (st && st->spacetype==SPACE_TEXT) {
- scrarea_queue_redraw(sa);
- }
- }
-}
diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c
deleted file mode 100644
index 14e6336c6a9..00000000000
--- a/source/blender/src/drawtime.c
+++ /dev/null
@@ -1,506 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_view2d_types.h"
-
-#include "BKE_ipo.h"
-#include "BKE_object.h"
-#include "BKE_material.h"
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_editaction.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_resources.h"
-#include "BIF_language.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-#include "interface.h" /* for ui_rasterpos_safe */
-
-#define TIMELINE_STIPPLE \
-{ \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \
- 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0 \
-}
-
-/* ---- prototypes ------ */
-void drawtimespace(ScrArea *, void *);
-
-/* draws a current frame indicator for the TimeLine */
-static void draw_cfra_time(SpaceTime *stime)
-{
- float vec[2];
-
- vec[0]= (G.scene->r.cfra);
- vec[0]*= G.scene->r.framelen;
-
- vec[1]= G.v2d->cur.ymin;
- BIF_ThemeColor(TH_CFRAME); // no theme, should be global color once...
- glLineWidth(3.0);
-
- glBegin(GL_LINES);
- glVertex2fv(vec);
- vec[1]= G.v2d->cur.ymax;
- glVertex2fv(vec);
- glEnd();
-
- glLineWidth(1.0);
-
- if(stime->flag & TIME_CFRA_NUM) {
- short mval[2];
- float x, y;
- float xscale, yscale;
- char str[32];
-
- /* little box with frame drawn beside */
-
- glFlush(); // huhh... without this glColor won't work for the text...
- getmouseco_areawin(mval);
-
- if(mval[1]>curarea->winy-10) mval[1]= curarea->winy - 13;
-
- if (curarea->winy < 25) {
- if (mval[1]<17) mval[1]= 17;
- } else if (mval[1]<22) mval[1]= 22;
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
- if(stime->flag & TIME_DRAWFRAMES)
- sprintf(str, " %d", CFRA);
- else sprintf(str, " %.2f", FRA2TIME(CFRA));
-
- /* HACK! somehow the green color won't go away... */
- glColor4ub(0, 0, 0, 0);
- BIF_ThemeColor(TH_TEXT);
-
- view2d_getscale(G.v2d, &xscale, &yscale);
-
- /* because the frame number text is subject to the same scaling as the contents of the view */
- glScalef( 1.0/xscale, 1.0/yscale, 1.0);
-
- ui_rasterpos_safe(x * xscale, y * yscale, 1.0);
- BIF_DrawString(G.fonts, str, 0);
- glScalef(xscale, yscale, 1.0);
- }
-}
-
-/* ---------- */
-
-/* function to draw markers */
-static void draw_marker(TimeMarker *marker, int flag)
-{
- float xpos, ypixels, xscale, yscale;
- int icon_id= 0;
-
- xpos = marker->frame;
- /* no time correction for framelen! space is drawn with old values */
-
- ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin;
- view2d_getscale(G.v2d, &xscale, &yscale);
-
- glScalef( 1.0/xscale, 1.0/yscale, 1.0);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- /* verticle line */
- if (flag & DRAW_MARKERS_LINES) {
- setlinestyle(3);
- if(marker->flag & SELECT)
- glColor4ub(255,255,255, 96);
- else
- glColor4ub(0,0,0, 96);
-
- glBegin(GL_LINES);
- glVertex2f((xpos*xscale)+0.5, 12);
- glVertex2f((xpos*xscale)+0.5, 34*yscale); /* a bit lazy but we know it cant be greater then 34 strips high*/
- glEnd();
- setlinestyle(0);
- }
-
- /* 5 px to offset icon to align properly, space / pixels corrects for zoom */
- if (flag & DRAW_MARKERS_LOCAL) {
- icon_id= (marker->flag & ACTIVE) ? ICON_PMARKER_ACT :
- (marker->flag & SELECT) ? ICON_PMARKER_SEL :
- ICON_PMARKER;
- }
- else {
- icon_id= (marker->flag & SELECT) ? ICON_MARKER_HLT :
- ICON_MARKER;
- }
- BIF_icon_draw(xpos*xscale-5.0, 12.0, icon_id);
-
- glBlendFunc(GL_ONE, GL_ZERO);
- glDisable(GL_BLEND);
-
- /* and the marker name too, shifted slightly to the top-right */
- if(marker->name && marker->name[0]) {
- if(marker->flag & SELECT) {
- BIF_ThemeColor(TH_TEXT_HI);
- ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
- }
- else {
- BIF_ThemeColor(TH_TEXT);
- if((marker->frame <= G.scene->r.cfra) && (marker->frame+5 > G.scene->r.cfra))
- ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
- else
- ui_rasterpos_safe(xpos*xscale+4.0, 17.0, 1.0);
- }
- BIF_DrawString(G.font, marker->name, 0);
- }
- glScalef(xscale, yscale, 1.0);
-}
-
-/* Draw Scene-Markers for the TimeLine */
-static void draw_markers_time(int flag)
-{
- TimeMarker *marker;
-
- /* unselected markers are drawn at the first time */
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (!(marker->flag & SELECT)) draw_marker(marker, flag);
- }
-
- /* selected markers are drawn later ... selected markers have to cover unselected
- * markers laying at the same position as selected markers
- * (jiri: it is hack, it could be solved better)
- */
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (marker->flag & SELECT) draw_marker(marker, flag);
- }
-}
-
-/* Draw specified set of markers for Animation Editors */
-void draw_markers_timespace(ListBase *markers, int flag)
-{
- TimeMarker *marker;
- float yspace, ypixels;
-
- /* move ortho view to align with slider in bottom */
- glTranslatef(0.0f, G.v2d->cur.ymin, 0.0f);
-
- /* bad hacks in drawing markers... inverse correct that as well */
- yspace= G.v2d->cur.ymax - G.v2d->cur.ymin;
- ypixels= G.v2d->mask.ymax - G.v2d->mask.ymin;
- glTranslatef(0.0f, -11.0*yspace/ypixels, 0.0f);
-
- /* unselected markers are drawn at the first time */
- for (marker= markers->first; marker; marker= marker->next) {
- if (!(marker->flag & SELECT)) draw_marker(marker, flag);
- }
-
- /* selected markers are drawn later ... selected markers have to cover unselected
- * markers laying at the same position as selected markers */
- for (marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT) draw_marker(marker, flag);
- }
-
- glTranslatef(0.0f, -G.v2d->cur.ymin, 0.0f);
- glTranslatef(0.0f, 11.0*yspace/ypixels, 0.0f);
-}
-
-
-void draw_anim_preview_timespace()
-{
- /* only draw this if preview range is set */
- if (G.scene->r.psfra) {
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- glEnable(GL_BLEND);
- glColor4f(0, 0, 0, 0.4);
-
- if (PSFRA < PEFRA) {
- glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax);
- glRectf(PEFRA, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);
- }
- else {
- glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);
- }
-
- glDisable(GL_BLEND);
- }
-}
-
-static void draw_sfra_efra()
-{
- BIF_ThemeColorShade(TH_BACK, -25);
-
- if (PSFRA < PEFRA) {
- glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax);
- glRectf(PEFRA, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);
- }
- else {
- glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);
- }
-
- BIF_ThemeColorShade(TH_BACK, -60);
- /* thin lines where the actual frames are */
- fdrawline(PSFRA, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax);
- fdrawline(PEFRA, G.v2d->cur.ymin, PEFRA, G.v2d->cur.ymax);
-
- glDisable(GL_BLEND);
-}
-
-static void draw_mapoldnew()
-{
- float anim_end; /* the end of the blender frames that are actually animated (map old)*/
- float frames_end; /* the end of the frames that get rendered and saved to disk (map new) */
- GLubyte timeline_stipple[32*32/8] = TIMELINE_STIPPLE;
-
- if (G.scene->r.framelen == 1.0) return;
-
- anim_end = PEFRA * G.scene->r.framelen;
- frames_end = PEFRA;
-
- glEnable(GL_POLYGON_STIPPLE);
- glPolygonStipple(timeline_stipple);
- BIF_ThemeColorShade(TH_BACK, -65);
-
- if (anim_end < frames_end)
- glRectf(anim_end, G.v2d->cur.ymin, frames_end, G.v2d->cur.ymax);
-
- glDisable(GL_POLYGON_STIPPLE);
-}
-
-
-static void draw_ipo_keys(Ipo *ipo, char col[3])
-{
- IpoCurve *icu;
- int nvert;
- int i;
- int lbound, ubound;
- int idx;
- int diff;
- float t;
- float drawnext; /* next time to begin drawing new keyframes */
-
- float space = G.v2d->cur.xmax - G.v2d->cur.xmin;
- float pixels = G.v2d->mask.xmax-G.v2d->mask.xmin;
- float spaceperpix = 1; /* amount of time occupied per pixel */
-
- if (pixels > 0)
- spaceperpix = space / pixels;
-
- glColor3ub(col[0], col[1], col[2]);
- glBegin(GL_LINES);
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- if (icu->flag & IPO_VISIBLE) {
- if (icu->bezt) {
- nvert= icu->totvert;
-
- if (nvert > 0)
- drawnext = icu->bezt[0].vec[1][0];
- else
- continue;
-
- /* binary search for beginning of the visible keys */
- lbound = 0;
- ubound = nvert;
- while (ubound - lbound > 1) {
- diff = (ubound - lbound) / 2;
- idx = lbound + diff;
- t= icu->bezt[idx].vec[1][0];
- if (t < G.v2d->cur.xmin)
- lbound += diff;
- else
- ubound = lbound + diff;
- }
-
- for (i = lbound; i < nvert; i++) {
- t= icu->bezt[i].vec[1][0];
-
- /* dont do anymore draw tests after we draw the last visible key */
- if (t > G.v2d->cur.xmax)
- break;
- /* avoid repeatedly drawing lines on the same pixel */
- if (t < drawnext)
- continue;
-
- glVertex2f(t, G.v2d->cur.ymin);
- glVertex2f(t, G.v2d->cur.ymax);
-
- drawnext = t + spaceperpix;
- }
- }
- }
- }
-
- glEnd();
-}
-
-
-/* This function draws keyframes that the active object has (as long as
- * it is not in EditMode). Some filters are available to optimise the
- * drawing efficiency.
- */
-static void draw_ob_keys()
-{
- /* mostly copied from drawobject.c, draw_object() */
- SpaceTime *stime= curarea->spacedata.first;
-
- Object *ob= OBACT;
- short filter, ok;
- char col[3];
- int a;
-
- if (ob && ob!=G.obedit) {
- /* Object's IPO block - show all keys */
- if (ob->ipo) {
- /* draw the list of current frame elements */
- col[0] = 0xDD; col[1] = 0xD7; col[2] = 0x00;
- draw_ipo_keys(ob->ipo, col);
- }
-
- /* Object's Action block - may be filtered in some cases */
- if (ob->action) {
- bAction *act = ob->action;
- bActionChannel *achan;
-
- /* only apply filter if action is likely to be for pose channels + filter is on */
- filter= ((stime->flag & TIME_ONLYACTSEL) &&
- (ob->pose) && (ob->flag & OB_POSEMODE));
-
- /* go through each channel in the action */
- for (achan=act->chanbase.first; achan; achan=achan->next) {
- /* if filtering, check if this channel passes */
- if (filter) {
- ok= (SEL_ACHAN(achan))? 1 : 0;
- }
- else ok= 1;
-
- /* convert the ipo to a list of 'current frame elements' */
- if (achan->ipo && ok) {
- col[0] = 0x00; col[1] = 0x82; col[2] = 0x8B;
- draw_ipo_keys(achan->ipo, col);
- }
- }
- }
-
- /* Materials (only relevant for geometry objects) - some filtering might occur */
- // err... is this ok?
- filter= (stime->flag & TIME_ONLYACTSEL);
- if (filter) {
- Material *ma= give_current_material(ob, (ob->actcol + 1));
-
- /* we only retrieve the active material... */
- if (ma && ma->ipo) {
- col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00;
- draw_ipo_keys(ma->ipo, col);
- }
- }
- else {
- for (a=0; a<ob->totcol; a++) {
- Material *ma= give_current_material(ob, a+1);
-
- if (ma && ma->ipo) {
- col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00;
- draw_ipo_keys(ma->ipo, col);
- }
- }
- }
- }
-}
-
-void drawtimespace(ScrArea *sa, void *spacedata)
-{
- SpaceTime *stime= sa->spacedata.first;
- float col[3];
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- calc_scrollrcts(sa, &(stime->v2d), curarea->winx, curarea->winy);
-
- myortho2(stime->v2d.cur.xmin, stime->v2d.cur.xmax, stime->v2d.cur.ymin, stime->v2d.cur.ymax);
-
- /* draw darkened area outside of active timeline
- * frame range used is preview range or scene range
- */
- draw_sfra_efra();
- draw_mapoldnew();
-
- /* boundbox_seq(); */
- calc_ipogrid();
- draw_ipogrid();
-
- draw_cfra_time(spacedata);
- draw_ob_keys();
- draw_markers_time(0);
-
- /* restore viewport */
- mywinset(curarea->win);
-
- /* ortho at pixel level curarea */
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
-
- /* the bottom with time values */
- BIF_ThemeColor(TH_HEADER);
- glRectf(0.0f, 0.0f, (float)curarea->winx, 12.0f);
- BIF_ThemeColorShade(TH_HEADER, 50);
- fdrawline(0.0f, 12.0f, (float)curarea->winx, 12.0f);
- draw_view2d_numbers_horiz(stime->flag & TIME_DRAWFRAMES);
-
- draw_area_emboss(sa);
- curarea->win_swap= WIN_BACK_OK;
-}
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
deleted file mode 100644
index de3e464060d..00000000000
--- a/source/blender/src/drawview.c
+++ /dev/null
@@ -1,3927 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-//#define NAN_LINEAR_PHYSICS
-
-#include <math.h>
-#include <string.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#include <sys/times.h>
-#else
-#include <io.h>
-#endif
-
-#ifdef WIN32
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_anim.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_customdata.h"
-#include "BKE_displist.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_global.h"
-#include "BKE_lattice.h"
-#include "BKE_library.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-#include "BKE_scene.h"
-#include "BKE_sculpt.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_butspace.h"
-#include "BIF_drawimage.h"
-#include "BIF_drawgpencil.h"
-#include "BIF_editgroup.h"
-#include "BIF_editarmature.h"
-#include "BIF_editmesh.h"
-#include "BIF_editparticle.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_keyframing.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_previewrender.h"
-#include "BIF_radialcontrol.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BDR_drawaction.h"
-#include "BDR_drawmesh.h"
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_vpaint.h"
-#include "BDR_sculptmode.h"
-#include "BDR_gpencil.h"
-
-#include "BSE_drawview.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_seqaudio.h"
-#include "BSE_sequence.h"
-#include "BSE_trans_types.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "RE_render_ext.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "butspace.h" // event codes
-
-#include "BIF_transform.h"
-
-#include "RE_pipeline.h" // make_stars
-
-#include "reeb.h"
-
-#include "GPU_draw.h"
-#include "GPU_material.h"
-
-#include "multires.h"
-
-/* For MULTISAMPLE_ARB #define.
- Note that older systems like irix
- may not have this, and will need a #ifdef
- to disable it.*/
-/* #include "GL/glext.h" Disabled for release, to avoid possibly breaking platforms.
- Instead, the define we need will just be #defined if it's not in the platform opengl.h.
-*/
-
-/* Modules used */
-#include "radio.h"
-
-/* locals */
-//static void drawname(Object *ob);
-
-static void star_stuff_init_func(void)
-{
- cpack(-1);
- glPointSize(1.0);
- glBegin(GL_POINTS);
-}
-static void star_stuff_vertex_func(float* i)
-{
- glVertex3fv(i);
-}
-static void star_stuff_term_func(void)
-{
- glEnd();
-}
-
-void circf(float x, float y, float rad)
-{
- GLUquadricObj *qobj = gluNewQuadric();
-
- gluQuadricDrawStyle(qobj, GLU_FILL);
-
- glPushMatrix();
-
- glTranslatef(x, y, 0.);
-
- gluDisk( qobj, 0.0, rad, 32, 1);
-
- glPopMatrix();
-
- gluDeleteQuadric(qobj);
-}
-
-void circ(float x, float y, float rad)
-{
- GLUquadricObj *qobj = gluNewQuadric();
-
- gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
-
- glPushMatrix();
-
- glTranslatef(x, y, 0.);
-
- gluDisk( qobj, 0.0, rad, 32, 1);
-
- glPopMatrix();
-
- gluDeleteQuadric(qobj);
-}
-
-/* ********** ********** */
-
-static void draw_bgpic(void)
-{
- BGpic *bgpic;
- Image *ima;
- ImBuf *ibuf= NULL;
- float vec[4], fac, asp, zoomx, zoomy;
- float x1, y1, x2, y2, cx, cy;
-
- bgpic= G.vd->bgpic;
- if(bgpic==NULL) return;
-
- ima= bgpic->ima;
-
- if(ima)
- ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser);
- if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL) )
- return;
- if(ibuf->channels!=4)
- return;
- if(ibuf->rect==NULL)
- IMB_rect_from_float(ibuf);
-
- if(G.vd->persp==2) {
- rctf vb;
-
- calc_viewborder(G.vd, &vb);
-
- x1= vb.xmin;
- y1= vb.ymin;
- x2= vb.xmax;
- y2= vb.ymax;
- }
- else {
- float sco[2];
-
- /* calc window coord */
- initgrabz(0.0, 0.0, 0.0);
- window_to_3d(vec, 1, 0);
- fac= MAX3( fabs(vec[0]), fabs(vec[1]), fabs(vec[1]) );
- fac= 1.0/fac;
-
- asp= ( (float)ibuf->y)/(float)ibuf->x;
-
- vec[0] = vec[1] = vec[2] = 0.0;
- view3d_project_float(curarea, vec, sco, G.vd->persmat);
- cx = sco[0];
- cy = sco[1];
-
- x1= cx+ fac*(bgpic->xof-bgpic->size);
- y1= cy+ asp*fac*(bgpic->yof-bgpic->size);
- x2= cx+ fac*(bgpic->xof+bgpic->size);
- y2= cy+ asp*fac*(bgpic->yof+bgpic->size);
- }
-
- /* complete clip? */
-
- if(x2 < 0 ) return;
- if(y2 < 0 ) return;
- if(x1 > curarea->winx ) return;
- if(y1 > curarea->winy ) return;
-
- zoomx= (x2-x1)/ibuf->x;
- zoomy= (y2-y1)/ibuf->y;
-
- /* for some reason; zoomlevels down refuses to use GL_ALPHA_SCALE */
- if(zoomx < 1.0f || zoomy < 1.0f) {
- float tzoom= MIN2(zoomx, zoomy);
- int mip= 0;
-
- if(ibuf->mipmap[0]==NULL)
- IMB_makemipmap(ibuf, 0);
-
- while(tzoom < 1.0f && mip<8 && ibuf->mipmap[mip]) {
- tzoom*= 2.0f;
- zoomx*= 2.0f;
- zoomy*= 2.0f;
- mip++;
- }
- if(mip>0)
- ibuf= ibuf->mipmap[mip-1];
- }
-
- if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glaDefine2DArea(&curarea->winrct);
-
- glEnable(GL_BLEND);
-
- glPixelZoom(zoomx, zoomy);
- glColor4f(1.0, 1.0, 1.0, 1.0-bgpic->blend);
- glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
-
- glPixelZoom(1.0, 1.0);
- glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- glDisable(GL_BLEND);
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
- areawinset(curarea->win); // restore viewport / scissor
-}
-
-static void drawgrid_draw(float wx, float wy, float x, float y, float dx)
-{
- float fx, fy;
-
- x+= (wx);
- y+= (wy);
- fx= x/dx;
- fx= x-dx*floor(fx);
-
- while(fx< curarea->winx) {
- fdrawline(fx, 0.0, fx, (float)curarea->winy);
- fx+= dx;
- }
-
- fy= y/dx;
- fy= y-dx*floor(fy);
-
-
- while(fy< curarea->winy) {
- fdrawline(0.0, fy, (float)curarea->winx, fy);
- fy+= dx;
- }
-
-}
-
-// not intern, called in editobject for constraint axis too
-void make_axis_color(char *col, char *col2, char axis)
-{
- if(axis=='x') {
- col2[0]= col[0]>219?255:col[0]+36;
- col2[1]= col[1]<26?0:col[1]-26;
- col2[2]= col[2]<26?0:col[2]-26;
- }
- else if(axis=='y') {
- col2[0]= col[0]<46?0:col[0]-36;
- col2[1]= col[1]>189?255:col[1]+66;
- col2[2]= col[2]<46?0:col[2]-36;
- }
- else {
- col2[0]= col[0]<26?0:col[0]-26;
- col2[1]= col[1]<26?0:col[1]-26;
- col2[2]= col[2]>209?255:col[2]+46;
- }
-
-}
-
-static void drawgrid(void)
-{
- /* extern short bgpicmode; */
- float wx, wy, x, y, fw, fx, fy, dx;
- float vec4[4];
- char col[3], col2[3];
- short sublines = G.vd->gridsubdiv;
-
- vec4[0]=vec4[1]=vec4[2]=0.0;
- vec4[3]= 1.0;
- Mat4MulVec4fl(G.vd->persmat, vec4);
- fx= vec4[0];
- fy= vec4[1];
- fw= vec4[3];
-
- wx= (curarea->winx/2.0); /* because of rounding errors, grid at wrong location */
- wy= (curarea->winy/2.0);
-
- x= (wx)*fx/fw;
- y= (wy)*fy/fw;
-
- vec4[0]=vec4[1]=G.vd->grid;
- vec4[2]= 0.0;
- vec4[3]= 1.0;
- Mat4MulVec4fl(G.vd->persmat, vec4);
- fx= vec4[0];
- fy= vec4[1];
- fw= vec4[3];
-
- dx= fabs(x-(wx)*fx/fw);
- if(dx==0) dx= fabs(y-(wy)*fy/fw);
-
- glDepthMask(0); // disable write in zbuffer
-
- /* check zoom out */
- BIF_ThemeColor(TH_GRID);
- persp(PERSP_WIN);
-
- if(dx<6.0) {
- G.vd->gridview*= sublines;
- dx*= sublines;
-
- if(dx<6.0) {
- G.vd->gridview*= sublines;
- dx*= sublines;
-
- if(dx<6.0) {
- G.vd->gridview*= sublines;
- dx*=sublines;
- if(dx<6.0);
- else {
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, dx);
- }
- }
- else { // start blending out
- BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(wx, wy, x, y, dx);
-
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, sublines*dx);
- }
- }
- else { // start blending out (6 < dx < 60)
- BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(wx, wy, x, y, dx);
-
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, sublines*dx);
- }
- }
- else {
- if(dx>60.0) { // start blending in
- G.vd->gridview/= sublines;
- dx/= sublines;
- if(dx>60.0) { // start blending in
- G.vd->gridview/= sublines;
- dx/= sublines;
- if(dx>60.0) {
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, dx);
- }
- else {
- BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(wx, wy, x, y, dx);
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, dx*sublines);
- }
- }
- else {
- BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(wx, wy, x, y, dx);
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, dx*sublines);
- }
- }
- else {
- BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0);
- drawgrid_draw(wx, wy, x, y, dx);
- BIF_ThemeColor(TH_GRID);
- drawgrid_draw(wx, wy, x, y, dx*sublines);
- }
- }
-
- x+= (wx);
- y+= (wy);
- BIF_GetThemeColor3ubv(TH_GRID, col);
-
- setlinestyle(0);
-
- /* center cross */
- if(G.vd->view==3) make_axis_color(col, col2, 'y');
- else make_axis_color(col, col2, 'x');
- glColor3ubv((GLubyte *)col2);
-
- fdrawline(0.0, y, (float)curarea->winx, y);
-
- if(G.vd->view==7) make_axis_color(col, col2, 'y');
- else make_axis_color(col, col2, 'z');
- glColor3ubv((GLubyte *)col2);
-
- fdrawline(x, 0.0, x, (float)curarea->winy);
-
- glDepthMask(1); // enable write in zbuffer
- persp(PERSP_VIEW);
-}
-
-
-
-static void drawfloor(void)
-{
- View3D *vd;
- float vert[3], grid;
- int a, gridlines, emphasise;
- char col[3], col2[3];
- short draw_line = 0;
-
- vd= curarea->spacedata.first;
-
- vert[2]= 0.0;
-
- if(vd->gridlines<3) return;
-
- if(G.vd->zbuf && G.obedit) glDepthMask(0); // for zbuffer-select
-
- gridlines= vd->gridlines/2;
- grid= gridlines*vd->grid;
-
- BIF_GetThemeColor3ubv(TH_GRID, col);
- BIF_GetThemeColor3ubv(TH_BACK, col2);
-
- /* emphasise division lines lighter instead of darker, if background is darker than grid */
- if ( ((col[0]+col[1]+col[2])/3+10) > (col2[0]+col2[1]+col2[2])/3 )
- emphasise = 20;
- else
- emphasise = -10;
-
- /* draw the Y axis and/or grid lines */
- for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show Y axis' preference */
- if (vd->gridflag & V3D_SHOW_Y) {
- make_axis_color(col, col2, 'y');
- glColor3ubv((GLubyte *)col2);
-
- draw_line = 1;
- } else if (vd->gridflag & V3D_SHOW_FLOOR) {
- BIF_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
- }
- } else {
- /* check for the 'show grid floor' preference */
- if (vd->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- BIF_ThemeColorShade(TH_GRID, emphasise);
- }
- else BIF_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
- }
-
- if (draw_line) {
- glBegin(GL_LINE_STRIP);
- vert[0]= a*vd->grid;
- vert[1]= grid;
- glVertex3fv(vert);
- vert[1]= -grid;
- glVertex3fv(vert);
- glEnd();
- }
- }
-
- /* draw the X axis and/or grid lines */
- for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show X axis' preference */
- if (vd->gridflag & V3D_SHOW_X) {
- make_axis_color(col, col2, 'x');
- glColor3ubv((GLubyte *)col2);
-
- draw_line = 1;
- } else if (vd->gridflag & V3D_SHOW_FLOOR) {
- BIF_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
- }
- } else {
- /* check for the 'show grid floor' preference */
- if (vd->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- BIF_ThemeColorShade(TH_GRID, emphasise);
- }
- else BIF_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
- }
-
- if (draw_line) {
- glBegin(GL_LINE_STRIP);
- vert[1]= a*vd->grid;
- vert[0]= grid;
- glVertex3fv(vert );
- vert[0]= -grid;
- glVertex3fv(vert);
- glEnd();
- }
- }
-
- /* draw the Z axis line */
- /* check for the 'show Z axis' preference */
- if (vd->gridflag & V3D_SHOW_Z) {
- make_axis_color(col, col2, 'z');
- glColor3ubv((GLubyte *)col2);
-
- glBegin(GL_LINE_STRIP);
- vert[0]= 0;
- vert[1]= 0;
- vert[2]= grid;
- glVertex3fv(vert );
- vert[2]= -grid;
- glVertex3fv(vert);
- glEnd();
- }
-
- if(G.vd->zbuf && G.obedit) glDepthMask(1);
-
-}
-
-static void drawcursor(View3D *v3d)
-{
- short mx,my,co[2];
- int flag;
-
- /* we dont want the clipping for cursor */
- flag= v3d->flag;
- v3d->flag= 0;
- project_short( give_cursor(), co);
- v3d->flag= flag;
-
- mx = co[0];
- my = co[1];
-
- if(mx!=IS_CLIPPED) {
- setlinestyle(0);
- cpack(0xFF);
- circ((float)mx, (float)my, 10.0);
- setlinestyle(4);
- cpack(0xFFFFFF);
- circ((float)mx, (float)my, 10.0);
- setlinestyle(0);
- cpack(0x0);
-
- sdrawline(mx-20, my, mx-5, my);
- sdrawline(mx+5, my, mx+20, my);
- sdrawline(mx, my-20, mx, my-5);
- sdrawline(mx, my+5, mx, my+20);
- }
-}
-
-/* ********* custom clipping *********** */
-
-static void view3d_draw_clipping(View3D *v3d)
-{
- BoundBox *bb= v3d->clipbb;
-
- BIF_ThemeColorShade(TH_BACK, -8);
-
- glBegin(GL_QUADS);
-
- glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[3]);
- glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[1]);
- glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[5]);
- glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[3]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[6]);
- glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[2]);
- glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[3]);
-
- glEnd();
-}
-
-void view3d_set_clipping(View3D *v3d)
-{
- double plane[4];
- int a;
-
- for(a=0; a<4; a++) {
- QUATCOPY(plane, v3d->clip[a]);
- glClipPlane(GL_CLIP_PLANE0+a, plane);
- glEnable(GL_CLIP_PLANE0+a);
- }
-}
-
-void view3d_clr_clipping(void)
-{
- int a;
-
- for(a=0; a<4; a++) {
- glDisable(GL_CLIP_PLANE0+a);
- }
-}
-
-int view3d_test_clipping(View3D *v3d, float *vec)
-{
- /* vec in world coordinates, returns 1 if clipped */
- float view[3];
-
- VECCOPY(view, vec);
-
- if(0.0f < v3d->clip[0][3] + INPR(view, v3d->clip[0]))
- if(0.0f < v3d->clip[1][3] + INPR(view, v3d->clip[1]))
- if(0.0f < v3d->clip[2][3] + INPR(view, v3d->clip[2]))
- if(0.0f < v3d->clip[3][3] + INPR(view, v3d->clip[3]))
- return 0;
-
- return 1;
-}
-
-/* ********* end custom clipping *********** */
-
-static void view3d_get_viewborder_size(View3D *v3d, float size_r[2])
-{
- float winmax= MAX2(v3d->area->winx, v3d->area->winy);
- float aspect= (float) (G.scene->r.xsch*G.scene->r.xasp)/(G.scene->r.ysch*G.scene->r.yasp);
-
- if(aspect>1.0) {
- size_r[0]= winmax;
- size_r[1]= winmax/aspect;
- } else {
- size_r[0]= winmax*aspect;
- size_r[1]= winmax;
- }
-}
-
-void calc_viewborder(struct View3D *v3d, rctf *viewborder_r)
-{
- float zoomfac, size[2];
- float dx= 0.0f, dy= 0.0f;
-
- view3d_get_viewborder_size(v3d, size);
-
- /* magic zoom calculation, no idea what
- * it signifies, if you find out, tell me! -zr
- */
- /* simple, its magic dude!
- * well, to be honest, this gives a natural feeling zooming
- * with multiple keypad presses (ton)
- */
-
- zoomfac= (M_SQRT2 + v3d->camzoom/50.0);
- zoomfac= (zoomfac*zoomfac)*0.25;
-
- size[0]= size[0]*zoomfac;
- size[1]= size[1]*zoomfac;
-
- /* center in window */
- viewborder_r->xmin= 0.5*v3d->area->winx - 0.5*size[0];
- viewborder_r->ymin= 0.5*v3d->area->winy - 0.5*size[1];
- viewborder_r->xmax= viewborder_r->xmin + size[0];
- viewborder_r->ymax= viewborder_r->ymin + size[1];
-
- dx= v3d->area->winx*G.vd->camdx*zoomfac*2.0f;
- dy= v3d->area->winy*G.vd->camdy*zoomfac*2.0f;
-
- /* apply offset */
- viewborder_r->xmin-= dx;
- viewborder_r->ymin-= dy;
- viewborder_r->xmax-= dx;
- viewborder_r->ymax-= dy;
-
- if(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);
-
- viewborder_r->xmin+= cam->shiftx*side;
- viewborder_r->xmax+= cam->shiftx*side;
- viewborder_r->ymin+= cam->shifty*side;
- viewborder_r->ymax+= cam->shifty*side;
- }
-}
-
-void view3d_set_1_to_1_viewborder(View3D *v3d)
-{
- float size[2];
- int im_width= (G.scene->r.size*G.scene->r.xsch)/100;
-
- view3d_get_viewborder_size(v3d, size);
-
- v3d->camzoom= (sqrt(4.0*im_width/size[0]) - M_SQRT2)*50.0;
- v3d->camzoom= CLAMPIS(v3d->camzoom, -30, 300);
-}
-
-
-static void drawviewborder_flymode(void)
-{
- /* draws 4 edge brackets that frame the safe area where the
- mouse can move during fly mode without spinning the view */
- float x1, x2, y1, y2;
-
- x1= 0.45*(float)curarea->winx;
- y1= 0.45*(float)curarea->winy;
- x2= 0.55*(float)curarea->winx;
- y2= 0.55*(float)curarea->winy;
- cpack(0);
-
-
- glBegin(GL_LINES);
- /* bottom left */
- glVertex2f(x1,y1);
- glVertex2f(x1,y1+5);
-
- glVertex2f(x1,y1);
- glVertex2f(x1+5,y1);
-
- /* top right */
- glVertex2f(x2,y2);
- glVertex2f(x2,y2-5);
-
- glVertex2f(x2,y2);
- glVertex2f(x2-5,y2);
-
- /* top left */
- glVertex2f(x1,y2);
- glVertex2f(x1,y2-5);
-
- glVertex2f(x1,y2);
- glVertex2f(x1+5,y2);
-
- /* bottom right */
- glVertex2f(x2,y1);
- glVertex2f(x2,y1+5);
-
- glVertex2f(x2,y1);
- glVertex2f(x2-5,y1);
- glEnd();
-}
-
-
-static void drawviewborder(void)
-{
- extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); // interface_panel.c
- float fac, a;
- float x1, x2, y1, y2;
- float x3, y3, x4, y4;
- rctf viewborder;
- Camera *ca= NULL;
-
- if(G.vd->camera==NULL)
- return;
- if(G.vd->camera->type==OB_CAMERA)
- ca = G.vd->camera->data;
-
- calc_viewborder(G.vd, &viewborder);
- x1= viewborder.xmin;
- y1= viewborder.ymin;
- x2= viewborder.xmax;
- y2= viewborder.ymax;
-
- /* passepartout, specified in camera edit buttons */
- if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001) {
- if (ca->passepartalpha == 1.0) {
- glColor3f(0, 0, 0);
- } else {
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
- glEnable(GL_BLEND);
- glColor4f(0, 0, 0, ca->passepartalpha);
- }
- if (x1 > 0.0)
- glRectf(0.0, (float)curarea->winy, x1, 0.0);
- if (x2 < (float)curarea->winx)
- glRectf(x2, (float)curarea->winy, (float)curarea->winx, 0.0);
- if (y2 < (float)curarea->winy)
- glRectf(x1, (float)curarea->winy, x2, y2);
- if (y2 > 0.0)
- glRectf(x1, y1, x2, 0.0);
-
- glDisable(GL_BLEND);
- }
-
- /* edge */
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- setlinestyle(0);
- BIF_ThemeColor(TH_BACK);
- glRectf(x1, y1, x2, y2);
-
- setlinestyle(3);
- BIF_ThemeColor(TH_WIRE);
- glRectf(x1, y1, x2, y2);
-
- /* camera name - draw in highlighted text color */
- if (ca && (ca->flag & CAM_SHOWNAME)) {
- BIF_ThemeColor(TH_TEXT_HI);
- glRasterPos2f(x1, y1-15);
-
- BMF_DrawString(G.font, G.vd->camera->id.name+2);
- BIF_ThemeColor(TH_WIRE);
- }
-
-
- /* border */
- if(G.scene->r.mode & R_BORDER) {
-
- cpack(0);
- x3= x1+ G.scene->r.border.xmin*(x2-x1);
- y3= y1+ G.scene->r.border.ymin*(y2-y1);
- x4= x1+ G.scene->r.border.xmax*(x2-x1);
- y4= y1+ G.scene->r.border.ymax*(y2-y1);
-
- cpack(0x4040FF);
- glRectf(x3, y3, x4, y4);
- }
-
- /* safety border */
- if (ca && (ca->flag & CAM_SHOWTITLESAFE)) {
- fac= 0.1;
-
- a= fac*(x2-x1);
- x1+= a;
- x2-= a;
-
- a= fac*(y2-y1);
- y1+= a;
- y2-= a;
-
- BIF_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
-
- uiSetRoundBox(15);
- gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
- }
-
- setlinestyle(0);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
-
-}
-
-void backdrawview3d(int test)
-{
- struct Base *base;
-
-/*for 2.43 release, don't use glext and just define the constant.
- this to avoid possibly breaking platforms before release.*/
-#ifndef GL_MULTISAMPLE_ARB
- #define GL_MULTISAMPLE_ARB 0x809D
-#endif
-
-#ifdef GL_MULTISAMPLE_ARB
- int m;
-#endif
-
- if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT);
- else if(G.obedit && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT));
- else {
- G.vd->flag &= ~V3D_NEEDBACKBUFDRAW;
- return;
- }
-
- if( !(G.vd->flag & V3D_NEEDBACKBUFDRAW) ) return;
-
- if(test) {
- if(qtest()) {
- addafterqueue(curarea->win, BACKBUFDRAW, 1);
- return;
- }
- }
- persp(PERSP_VIEW);
-
- /*Disable FSAA for backbuffer selection.
-
- Only works if GL_MULTISAMPLE_ARB is defined by the header
- file, which is should be for every OS that supports FSAA.*/
-
-#ifdef GL_MULTISAMPLE_ARB
- m = glIsEnabled(GL_MULTISAMPLE_ARB);
- if (m) glDisable(GL_MULTISAMPLE_ARB);
-#endif
-
-#ifdef __APPLE__
- glDrawBuffer(GL_AUX0);
-#endif
- if(G.vd->drawtype > OB_WIRE) G.vd->zbuf= TRUE;
- curarea->win_swap &= ~WIN_BACK_OK;
-
- glDisable(GL_DITHER);
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- if(G.vd->zbuf) {
- glEnable(GL_DEPTH_TEST);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- }
- else {
- glClear(GL_COLOR_BUFFER_BIT);
- glDisable(GL_DEPTH_TEST);
- }
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_set_clipping(G.vd);
-
- G.f |= G_BACKBUFSEL;
-
- base= (G.scene->basact);
- if(base && (base->lay & G.vd->lay)) {
- draw_object_backbufsel(base->object);
- }
-
- G.vd->flag &= ~V3D_NEEDBACKBUFDRAW;
-
- G.f &= ~G_BACKBUFSEL;
- G.vd->zbuf= FALSE;
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_DITHER);
-
-#ifdef __APPLE__
- glDrawBuffer(GL_BACK); /* we were in aux buffers */
-#endif
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
-#ifdef GL_MULTISAMPLE_ARB
- if (m) glEnable(GL_MULTISAMPLE_ARB);
-#endif
-
- /* it is important to end a view in a transform compatible with buttons */
- persp(PERSP_WIN); // set ortho
- bwin_scalematrix(curarea->win, G.vd->blockscale, G.vd->blockscale, G.vd->blockscale);
-
-}
-
-void check_backbuf(void)
-{
- if(G.vd->flag & V3D_NEEDBACKBUFDRAW)
- backdrawview3d(0);
-}
-
-/* samples a single pixel (copied from vpaint) */
-unsigned int sample_backbuf(int x, int y)
-{
- unsigned int col;
-
- if(x>=curarea->winx || y>=curarea->winy) return 0;
- x+= curarea->winrct.xmin;
- y+= curarea->winrct.ymin;
-
- check_backbuf(); // actually not needed for apple
-
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0);
-#endif
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
- glReadBuffer(GL_BACK);
-
- if(G.order==B_ENDIAN) SWITCH_INT(col);
-
- return framebuffer_to_index(col);
-}
-
-/* reads full rect, converts indices */
-ImBuf *read_backbuf(short xmin, short ymin, short xmax, short ymax)
-{
- unsigned int *dr, *rd;
- struct ImBuf *ibuf, *ibuf1;
- int a;
- short xminc, yminc, xmaxc, ymaxc, xs, ys;
-
- /* clip */
- if(xmin<0) xminc= 0; else xminc= xmin;
- if(xmax>=curarea->winx) xmaxc= curarea->winx-1; else xmaxc= xmax;
- if(xminc > xmaxc) return NULL;
-
- if(ymin<0) yminc= 0; else yminc= ymin;
- if(ymax>=curarea->winy) ymaxc= curarea->winy-1; else ymaxc= ymax;
- if(yminc > ymaxc) return NULL;
-
- ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect,0);
-
- check_backbuf(); // actually not needed for apple
-
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0);
-#endif
- glReadPixels(curarea->winrct.xmin+xminc, curarea->winrct.ymin+yminc, (xmaxc-xminc+1), (ymaxc-yminc+1), GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- glReadBuffer(GL_BACK);
-
- if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
-
- a= (xmaxc-xminc+1)*(ymaxc-yminc+1);
- dr= ibuf->rect;
- while(a--) {
- if(*dr) *dr= framebuffer_to_index(*dr);
- dr++;
- }
-
- /* put clipped result back, if needed */
- if(xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax)
- return ibuf;
-
- ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect,0);
- rd= ibuf->rect;
- dr= ibuf1->rect;
-
- for(ys= ymin; ys<=ymax; ys++) {
- for(xs= xmin; xs<=xmax; xs++, dr++) {
- if( xs>=xminc && xs<=xmaxc && ys>=yminc && ys<=ymaxc) {
- *dr= *rd;
- rd++;
- }
- }
- }
- IMB_freeImBuf(ibuf);
- return ibuf1;
-}
-
-/* smart function to sample a rect spiralling outside, nice for backbuf selection */
-unsigned int sample_backbuf_rect(short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index))
-{
- struct ImBuf *buf;
- unsigned int *bufmin, *bufmax, *tbuf;
- int minx, miny;
- int a, b, rc, nr, amount, dirvec[4][2];
- int distance=0;
- unsigned int index = 0;
- short indexok = 0;
-
- amount= (size-1)/2;
-
- minx = mval[0]-(amount+1);
- miny = mval[1]-(amount+1);
- buf = read_backbuf(minx, miny, minx+size-1, miny+size-1);
- if (!buf) return 0;
-
- rc= 0;
-
- dirvec[0][0]= 1; dirvec[0][1]= 0;
- dirvec[1][0]= 0; dirvec[1][1]= -size;
- dirvec[2][0]= -1; dirvec[2][1]= 0;
- dirvec[3][0]= 0; dirvec[3][1]= size;
-
- bufmin = buf->rect;
- tbuf = buf->rect;
- bufmax = buf->rect + size*size;
- tbuf+= amount*size+ amount;
-
- for(nr=1; nr<=size; nr++) {
-
- for(a=0; a<2; a++) {
- for(b=0; b<nr; b++, distance++) {
- if (*tbuf && *tbuf>=min && *tbuf<max) { //we got a hit
- if(strict){
- indexok = indextest(*tbuf - min+1);
- if(indexok){
- *dist= (short) sqrt( (float)distance );
- index = *tbuf - min+1;
- goto exit;
- }
- }
- else{
- *dist= (short) sqrt( (float)distance ); // XXX, this distance is wrong -
- index = *tbuf - min+1; // messy yah, but indices start at 1
- goto exit;
- }
- }
-
- tbuf+= (dirvec[rc][0]+dirvec[rc][1]);
-
- if(tbuf<bufmin || tbuf>=bufmax) {
- goto exit;
- }
- }
- rc++;
- rc &= 3;
- }
- }
-
-exit:
- IMB_freeImBuf(buf);
- return index;
-}
-
-#if 0
-static void drawname(Object *ob)
-{
- cpack(0x404040);
- glRasterPos3f(0.0, 0.0, 0.0);
-
- BMF_DrawString(G.font, " ");
- BMF_DrawString(G.font, ob->id.name+2);
-}
-#endif
-
-static char *get_cfra_marker_name()
-{
- ListBase *markers= &G.scene->markers;
- TimeMarker *m1, *m2;
-
- /* search through markers for match */
- for (m1=markers->first, m2=markers->last; m1 && m2; m1=m1->next, m2=m2->prev) {
- if (m1->frame==CFRA)
- return m1->name;
-
- if (m1 == m2)
- break;
-
- if (m2->frame==CFRA)
- return m2->name;
- }
-
- return NULL;
-}
-
-/* draw info beside axes in bottom left-corner:
- * framenum, object name, bone name (if available), marker name (if available)
- */
-static void draw_selected_name(Object *ob)
-{
- char info[256], *markern;
- short offset=30;
-
- /* get name of marker on current frame (if available) */
- markern= get_cfra_marker_name();
-
- /* check if there is an object */
- if(ob) {
- /* name(s) to display depends on type of object */
- if(ob->type==OB_ARMATURE) {
- bArmature *arm= ob->data;
- char *name= NULL;
-
- /* show name of active bone too (if possible) */
- if(ob==G.obedit) {
- EditBone *ebo;
- for (ebo=G.edbo.first; ebo; ebo=ebo->next){
- if ((ebo->flag & BONE_ACTIVE) && (ebo->layer & arm->layer)) {
- name= ebo->name;
- break;
- }
- }
- }
- else if(ob->pose && (ob->flag & OB_POSEMODE)) {
- bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) {
- name= pchan->name;
- break;
- }
- }
- }
- if(name && markern)
- sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, name, markern);
- else if(name)
- sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, name);
- else
- sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
- }
- else if(ELEM3(ob->type, OB_MESH, OB_LATTICE, OB_CURVE)) {
- Key *key= NULL;
- KeyBlock *kb = NULL;
- char shapes[75];
-
- /* try to display active shapekey too */
- shapes[0] = 0;
- key = ob_get_key(ob);
- if(key){
- kb = BLI_findlink(&key->block, ob->shapenr-1);
- if(kb){
- sprintf(shapes, ": %s ", kb->name);
- if(ob->shapeflag == OB_SHAPE_LOCK){
- sprintf(shapes, "%s (Pinned)",shapes);
- }
- }
- }
-
- if(markern)
- sprintf(info, "(%d) %s %s <%s>", CFRA, ob->id.name+2, shapes, markern);
- else
- sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, shapes);
- }
- else {
- /* standard object */
- if (markern)
- sprintf(info, "(%d) %s <%s>", CFRA, ob->id.name+2, markern);
- else
- sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
- }
-
- /* colour depends on whether there is a keyframe */
- if (id_frame_has_keyframe((ID *)ob, frame_to_float(CFRA), G.vd->keyflags))
- BIF_ThemeColor(TH_VERTEX_SELECT);
- else
- BIF_ThemeColor(TH_TEXT_HI);
- }
- else {
- /* no object */
- if (markern)
- sprintf(info, "(%d) <%s>", CFRA, markern);
- else
- sprintf(info, "(%d)", CFRA);
-
- /* colour is always white */
- BIF_ThemeColor(TH_TEXT_HI);
- }
-
- if (U.uiflag & USER_SHOW_ROTVIEWICON)
- offset = 14 + (U.rvisize * 2);
-
- glRasterPos2i(offset, 10);
- BMF_DrawString(G.fonts, info);
-}
-
-
-/* Draw a live substitute of the view icon, which is always shown */
-static void draw_view_axis(void)
-{
- const float k = U.rvisize; /* axis size */
- const float toll = 0.5; /* used to see when view is quasi-orthogonal */
- const float start = k + 1.0; /* axis center in screen coordinates, x=y */
- float ydisp = 0.0; /* vertical displacement to allow obj info text */
-
- /* rvibright ranges approx. from original axis icon color to gizmo color */
- float bright = U.rvibright / 15.0f;
-
- unsigned char col[3];
- unsigned char gridcol[3];
- float colf[3];
-
- float vec[4];
- float dx, dy;
- float h, s, v;
-
- /* thickness of lines is proportional to k */
- /* (log(k)-1) gives a more suitable thickness, but fps decreased by about 3 fps */
- glLineWidth(k / 10);
- //glLineWidth(log(k)-1); // a bit slow
-
- BIF_GetThemeColor3ubv(TH_GRID, (char *)gridcol);
-
- /* X */
- vec[0] = vec[3] = 1;
- vec[1] = vec[2] = 0;
- QuatMulVecf(G.vd->viewquat, vec);
-
- make_axis_color((char *)gridcol, (char *)col, 'x');
- rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v);
- s = s<0.5 ? s+0.5 : 1.0;
- v = 0.3;
- v = (v<1.0-(bright) ? v+bright : 1.0);
- hsv_to_rgb(h, s, v, colf, colf+1, colf+2);
- glColor3fv(colf);
-
- dx = vec[0] * k;
- dy = vec[1] * k;
- fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
- if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "x");
- }
-
- /* Y */
- vec[1] = vec[3] = 1;
- vec[0] = vec[2] = 0;
- QuatMulVecf(G.vd->viewquat, vec);
-
- make_axis_color((char *)gridcol, (char *)col, 'y');
- rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v);
- s = s<0.5 ? s+0.5 : 1.0;
- v = 0.3;
- v = (v<1.0-(bright) ? v+bright : 1.0);
- hsv_to_rgb(h, s, v, colf, colf+1, colf+2);
- glColor3fv(colf);
-
- dx = vec[0] * k;
- dy = vec[1] * k;
- fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
- if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "y");
- }
-
- /* Z */
- vec[2] = vec[3] = 1;
- vec[1] = vec[0] = 0;
- QuatMulVecf(G.vd->viewquat, vec);
-
- make_axis_color((char *)gridcol, (char *)col, 'z');
- rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v);
- s = s<0.5 ? s+0.5 : 1.0;
- v = 0.5;
- v = (v<1.0-(bright) ? v+bright : 1.0);
- hsv_to_rgb(h, s, v, colf, colf+1, colf+2);
- glColor3fv(colf);
-
- dx = vec[0] * k;
- dy = vec[1] * k;
- fdrawline(start, start + ydisp, start + dx, start + dy + ydisp);
- if (fabs(dx) > toll || fabs(dy) > toll) {
- glRasterPos2i(start + dx + 2, start + dy + ydisp + 2);
- BMF_DrawString(G.fonts, "z");
- }
-
- /* restore line-width */
- glLineWidth(1.0);
-}
-
-
-static void draw_view_icon(void)
-{
- BIFIconID icon;
-
- if(G.vd->view==7) icon= ICON_AXIS_TOP;
- else if(G.vd->view==1) icon= ICON_AXIS_FRONT;
- else if(G.vd->view==3) icon= ICON_AXIS_SIDE;
- else return ;
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- BIF_icon_draw(5.0, 5.0, icon);
-
- glDisable(GL_BLEND);
-}
-
-char *view3d_get_name(View3D *v3d)
-{
- char *name = NULL;
-
- switch (v3d->view) {
- case 1:
- if (v3d->persp == V3D_ORTHO)
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho";
- else
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp";
- break;
- case 3:
- if (v3d->persp == V3D_ORTHO)
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho";
- else
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp";
- break;
- case 7:
- if (v3d->persp == V3D_ORTHO)
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho";
- else
- name = (v3d->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp";
- break;
- default:
- if (v3d->persp==V3D_CAMOB) {
- if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
- Camera *cam;
- cam = v3d->camera->data;
- name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho";
- } else {
- name = "Object as Camera";
- }
- } else {
- name = (v3d->persp == V3D_ORTHO) ? "User Ortho" : "User Persp";
- }
- break;
- }
-
- return name;
-}
-
-static void draw_viewport_name(ScrArea *sa)
-{
- char *name = view3d_get_name(sa->spacedata.first);
- char *printable = NULL;
-
- if (G.vd->localview) {
- printable = malloc(strlen(name) + strlen(" (Local)_")); /* '_' gives space for '\0' */
- strcpy(printable, name);
- strcat(printable, " (Local)");
- } else {
- printable = name;
- }
-
- if (printable) {
- BIF_ThemeColor(TH_TEXT_HI);
- glRasterPos2i(10, sa->winy-20);
- BMF_DrawString(G.fonts, printable);
- }
-
- if (G.vd->localview) {
- free(printable);
- }
-}
-
-/* ******************* view3d space & buttons ************** */
-
-
-/* temporal struct for storing transform properties */
-typedef struct {
- float ob_eul[4]; // used for quat too....
- float ob_scale[3]; // need temp space due to linked values
- float ob_dims[3];
- short link_scale;
- float ve_median[5];
- int curdef;
- float *defweightp;
-} TransformProperties;
-
-/* is used for both read and write... */
-static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *evedef=NULL;
- EditEdge *eed;
- MDeformVert *dvert=NULL;
- TransformProperties *tfp= G.vd->properties_storage;
- float median[5], ve_median[5];
- int tot, totw, totweight, totedge;
- char defstr[320];
-
- median[0]= median[1]= median[2]= median[3]= median[4]= 0.0;
- tot= totw= totweight= totedge= 0;
- defstr[0]= 0;
-
- if(ob->type==OB_MESH) {
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- evedef= eve;
- tot++;
- VecAddf(median, median, eve->co);
- }
- eve= eve->next;
- }
- eed= em->edges.first;
- while(eed) {
- if((eed->f & SELECT)) {
- totedge++;
- median[3]+= eed->crease;
- }
- eed= eed->next;
- }
-
- /* check for defgroups */
- if(evedef)
- dvert= CustomData_em_get(&em->vdata, evedef->data, CD_MDEFORMVERT);
- if(tot==1 && dvert && dvert->totweight) {
- bDeformGroup *dg;
- int i, max=1, init=1;
- char str[320];
-
- for (i=0; i<dvert->totweight; i++){
- dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
- if(dg) {
- max+= snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
- if(max<320) strcat(defstr, str);
- }
- else printf("oh no!\n");
- if(tfp->curdef==dvert->dw[i].def_nr) {
- init= 0;
- tfp->defweightp= &dvert->dw[i].weight;
- }
- }
-
- if(init) { // needs new initialized
- tfp->curdef= dvert->dw[0].def_nr;
- tfp->defweightp= &dvert->dw[0].weight;
- }
- }
- }
- else if(ob->type==OB_CURVE || ob->type==OB_SURF) {
- extern ListBase editNurb; /* editcurve.c */
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->f2 & SELECT) {
- VecAddf(median, median, bezt->vec[1]);
- tot++;
- median[4]+= bezt->weight;
- totweight++;
- }
- else {
- if(bezt->f1 & SELECT) {
- VecAddf(median, median, bezt->vec[0]);
- tot++;
- }
- if(bezt->f3 & SELECT) {
- VecAddf(median, median, bezt->vec[2]);
- tot++;
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- VecAddf(median, median, bp->vec);
- median[3]+= bp->vec[3];
- totw++;
- tot++;
- median[4]+= bp->weight;
- totweight++;
- }
- bp++;
- }
- }
- nu= nu->next;
- }
- }
- else if(ob->type==OB_LATTICE) {
- BPoint *bp;
- int a;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- VecAddf(median, median, bp->vec);
- tot++;
- median[4]+= bp->weight;
- totweight++;
- }
- bp++;
- }
- }
-
- if(tot==0) return;
-
- median[0] /= (float)tot;
- median[1] /= (float)tot;
- median[2] /= (float)tot;
- if(totedge) median[3] /= (float)totedge;
- else if(totw) median[3] /= (float)totw;
- if(totweight) median[4] /= (float)totweight;
-
- if(G.vd->flag & V3D_GLOBAL_STATS)
- Mat4MulVecfl(ob->obmat, median);
-
- if(block) { // buttons
- int but_y;
- if((ob->parent) && (ob->partype == PARBONE)) but_y = 135;
- else but_y = 150;
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Global", 160, but_y, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Local", 230, but_y, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays local values");
- uiBlockEndAlign(block);
-
- memcpy(tfp->ve_median, median, sizeof(tfp->ve_median));
-
- uiBlockBeginAlign(block);
- if(tot==1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex X:", 10, 110, 290, 19, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Y:", 10, 90, 290, 19, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Z:", 10, 70, 290, 19, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
- if(totw==1)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex W:", 10, 50, 290, 19, &(tfp->ve_median[3]), 0.01, 100.0, 10, 3, "");
- uiBlockEndAlign(block);
-
- if(defstr[0]) {
- uiDefBut(block, LABEL, 1, "Vertex Deform Groups", 10, 40, 290, 20, NULL, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_NOP, "Weight:", 10, 20, 150, 19, tfp->defweightp, 0.0f, 1.0f, 10, 3, "Weight value");
- uiDefButI(block, MENU, REDRAWVIEW3D, defstr, 160, 20, 140, 19, &tfp->curdef, 0.0, 0.0, 0, 0, "Current Vertex Group");
- uiBlockEndAlign(block);
- }
- else if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 10, 20, 290, 19, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "");
-
- }
- else {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median X:", 10, 110, 290, 19, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Y:", 10, 90, 290, 19, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Z:", 10, 70, 290, 19, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
- if(totw==tot)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median W:", 10, 50, 290, 19, &(tfp->ve_median[3]), 0.01, 100.0, 10, 3, "");
- uiBlockEndAlign(block);
- if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 10, 20, 290, 19, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal");
- }
-
- if(ob->type==OB_CURVE && (totw==0)) { /* bez curves have no w */
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT,B_SETPT_AUTO,"Auto", 10, 44, 72, 19, 0, 0, 0, 0, 0, "Auto handles (Shift H)");
- uiDefBut(block, BUT,B_SETPT_VECTOR,"Vector",82, 44, 73, 19, 0, 0, 0, 0, 0, "Vector handles (V)");
- uiDefBut(block, BUT,B_SETPT_ALIGN,"Align",155, 44, 73, 19, 0, 0, 0, 0, 0, "Align handles (H Toggles)");
- uiDefBut(block, BUT,B_SETPT_FREE,"Free", 227, 44, 72, 19, 0, 0, 0, 0, 0, "Align handles (H Toggles)");
- uiBlockEndAlign(block);
- }
-
- if(totedge==1)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease W:", 10, 30, 290, 19, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, "");
- else if(totedge>1)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Crease W:", 10, 30, 290, 19, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, "");
-
- }
- else { // apply
- memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median));
-
- if(G.vd->flag & V3D_GLOBAL_STATS) {
- Mat4Invert(ob->imat, ob->obmat);
- Mat4MulVecfl(ob->imat, median);
- Mat4MulVecfl(ob->imat, ve_median);
- }
- VecSubf(median, ve_median, median);
- median[3]= ve_median[3]-median[3];
- median[4]= ve_median[4]-median[4];
-
- if(ob->type==OB_MESH) {
-
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- VecAddf(eve->co, eve->co, median);
- }
- eve= eve->next;
- }
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f & SELECT) {
- /* ensure the median can be set to zero or one */
- if(ve_median[3]==0.0f) eed->crease= 0.0f;
- else if(ve_median[3]==1.0f) eed->crease= 1.0f;
- else {
- eed->crease+= median[3];
- CLAMP(eed->crease, 0.0, 1.0);
- }
- }
- }
-
- recalc_editnormals();
- }
- else if(ob->type==OB_CURVE || ob->type==OB_SURF) {
- extern ListBase editNurb; /* editcurve.c */
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==1) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->f2 & SELECT) {
- VecAddf(bezt->vec[0], bezt->vec[0], median);
- VecAddf(bezt->vec[1], bezt->vec[1], median);
- VecAddf(bezt->vec[2], bezt->vec[2], median);
- bezt->weight+= median[4];
- }
- else {
- if(bezt->f1 & SELECT) {
- VecAddf(bezt->vec[0], bezt->vec[0], median);
- }
- if(bezt->f3 & SELECT) {
- VecAddf(bezt->vec[2], bezt->vec[2], median);
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- VecAddf(bp->vec, bp->vec, median);
- bp->vec[3]+= median[3];
- bp->weight+= median[4];
- }
- bp++;
- }
- }
- test2DNurb(nu);
- testhandlesNurb(nu); /* test for bezier too */
-
- nu= nu->next;
- }
- }
- else if(ob->type==OB_LATTICE) {
- BPoint *bp;
- int a;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- VecAddf(bp->vec, bp->vec, median);
- bp->weight+= median[4];
- }
- bp++;
- }
- }
-
- BIF_undo_push("Transform properties");
- }
-}
-
-/* assumes armature active */
-static void validate_bonebutton_cb(void *bonev, void *namev)
-{
- Object *ob= OBACT;
-
- if(ob && ob->type==OB_ARMATURE) {
- Bone *bone= bonev;
- char oldname[32], newname[32];
-
- /* need to be on the stack */
- BLI_strncpy(newname, bone->name, 32);
- BLI_strncpy(oldname, (char *)namev, 32);
- /* restore */
- BLI_strncpy(bone->name, oldname, 32);
-
- armature_bone_rename(ob->data, oldname, newname); // editarmature.c
- allqueue(REDRAWALL, 0);
- }
-}
-
-static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim)
-{
- uiBut *but;
- bArmature *arm;
- bPoseChannel *pchan;
- Bone *bone= NULL;
- TransformProperties *tfp= G.vd->properties_storage;
-
- arm = get_armature(OBACT);
- if (!arm || !ob->pose) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone = pchan->bone;
- if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer))
- break;
- }
- if (!pchan || !bone) return;
-
- if((ob->parent) && (ob->partype == PARBONE))
- but= uiDefBut (block, TEX, B_DIFF, "Bone:", 160, 130, 140, 19, bone->name, 1, 31, 0, 0, "");
- else
- but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 140, 140, 19, bone->name, 1, 31, 0, 0, "");
- uiButSetFunc(but, validate_bonebutton_cb, bone, NULL);
-
- QuatToEul(pchan->quat, tfp->ob_eul);
- tfp->ob_eul[0]*= 180.0/M_PI;
- tfp->ob_eul[1]*= 180.0/M_PI;
- tfp->ob_eul[2]*= 180.0/M_PI;
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, REDRAWVIEW3D, ICON_UNLOCKED, 10,140,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocX:", 30, 140, 120, 19, pchan->loc, -lim, lim, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, REDRAWVIEW3D, ICON_UNLOCKED, 10,120,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocY:", 30, 120, 120, 19, pchan->loc+1, -lim, lim, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,100,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocZ:", 30, 100, 120, 19, pchan->loc+2, -lim, lim, 100, 3, "");
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 10,70,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotX:", 30, 70, 120, 19, tfp->ob_eul, -1000.0, 1000.0, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 10,50,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotY:", 30, 50, 120, 19, tfp->ob_eul+1, -1000.0, 1000.0, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,30,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotZ:", 30, 30, 120, 19, tfp->ob_eul+2, -1000.0, 1000.0, 100, 3, "");
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, REDRAWVIEW3D, ICON_UNLOCKED, 160,70,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleX:", 180, 70, 120, 19, pchan->size, -lim, lim, 10, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, REDRAWVIEW3D, ICON_UNLOCKED, 160,50,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleY:", 180, 50, 120, 19, pchan->size+1, -lim, lim, 10, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,30,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleZ:", 180, 30, 120, 19, pchan->size+2, -lim, lim, 10, 3, "");
- uiBlockEndAlign(block);
-}
-
-static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
- uiBut *but;
- TransformProperties *tfp= G.vd->properties_storage;
-
- ebone= G.edbo.first;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next){
- if ((ebone->flag & BONE_ACTIVE) && (ebone->layer & arm->layer))
- break;
- }
-
- if (!ebone)
- return;
-
- if((ob->parent) && (ob->partype == PARBONE))
- but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 130, 140, 19, ebone->name, 1, 31, 0, 0, "");
- else
- but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 150, 140, 19, ebone->name, 1, 31, 0, 0, "");
- uiButSetFunc(but, validate_editbonebutton_cb, ebone, NULL);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadX:", 10, 70, 140, 19, ebone->head, -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadY:", 10, 50, 140, 19, ebone->head+1, -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadZ:", 10, 30, 140, 19, ebone->head+2, -lim, lim, 10, 3, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailX:", 160, 70, 140, 19, ebone->tail, -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailY:", 160, 50, 140, 19, ebone->tail+1, -lim, lim, 10, 3, "");
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailZ:", 160, 30, 140, 19, ebone->tail+2, -lim, lim, 10, 3, "");
- uiBlockEndAlign(block);
-
- tfp->ob_eul[0]= 180.0*ebone->roll/M_PI;
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 140, 19, tfp->ob_eul, -lim, lim, 1000, 3, "");
-
- uiDefButBitI(block, TOG, BONE_EDITMODE_LOCKED, REDRAWVIEW3D, "Lock", 160, 100, 140, 19, &(ebone->flag), 0, 0, 0, 0, "Prevents bone from being transformed in edit mode");
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailRadius:", 10, 150, 140, 19, &ebone->rad_tail, 0, lim, 10, 3, "");
- if (ebone->parent && ebone->flag & BONE_CONNECTED )
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadRadius:", 10, 130, 140, 19, &ebone->parent->rad_tail, 0, lim, 10, 3, "");
- else
- uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadRadius:", 10, 130, 140, 19, &ebone->rad_head, 0, lim, 10, 3, "");
- uiBlockEndAlign(block);
-}
-
-static void v3d_editmetaball_buts(uiBlock *block, Object *ob, float lim)
-{
- extern MetaElem *lastelem;
-
- if(lastelem) {
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_RECALCMBALL, "LocX:", 10, 70, 140, 19, &lastelem->x, -lim, lim, 100, 3, "");
- uiDefButF(block, NUM, B_RECALCMBALL, "LocY:", 10, 50, 140, 19, &lastelem->y, -lim, lim, 100, 3, "");
- uiDefButF(block, NUM, B_RECALCMBALL, "LocZ:", 10, 30, 140, 19, &lastelem->z, -lim, lim, 100, 3, "");
-
- uiBlockBeginAlign(block);
- if(lastelem->type!=MB_BALL)
- uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 160, 70, 140, 19, &lastelem->expx, 0, lim, 100, 3, "");
- if((lastelem->type!=MB_BALL) && (lastelem->type!=MB_TUBE))
- uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 160, 50, 140, 19, &lastelem->expy, 0, lim, 100, 3, "");
- if((lastelem->type==MB_ELIPSOID) || (lastelem->type==MB_CUBE))
- uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 160, 30, 140, 19, &lastelem->expz, 0, lim, 100, 3, "");
-
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_RECALCMBALL, "Radius:", 10, 120, 140, 19, &lastelem->rad, 0, lim, 100, 3, "Size of the active metaball");
- uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 10, 100, 140, 19, &lastelem->s, 0, 10, 100, 3, "Stiffness of the active metaball");
- uiBlockEndAlign(block);
-
- uiDefButS(block, MENU, B_RECALCMBALL, "Type%t|Ball%x0|Tube%x4|Plane%x5|Elipsoid%x6|Cube%x7", 160, 120, 140, 19, &lastelem->type, 0.0, 0.0, 0, 0, "Set active element type");
-
- }
-}
-
-void do_viewbuts(unsigned short event)
-{
- BoundBox *bb;
- View3D *vd;
- Object *ob= OBACT;
- TransformProperties *tfp= G.vd->properties_storage;
-
- vd= G.vd;
- if(vd==NULL) return;
-
- switch(event) {
-
- case B_OBJECTPANEL:
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 1);
- break;
-
- case B_OBJECTPANELROT:
- if(ob) {
- ob->rot[0]= M_PI*tfp->ob_eul[0]/180.0;
- ob->rot[1]= M_PI*tfp->ob_eul[1]/180.0;
- ob->rot[2]= M_PI*tfp->ob_eul[2]/180.0;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
-
- case B_OBJECTPANELSCALE:
- if(ob) {
-
- /* link scale; figure out which axis changed */
- if (tfp->link_scale) {
- float ratio, tmp, max = 0.0;
- int axis;
-
- axis = 0;
- max = fabs(tfp->ob_scale[0] - ob->size[0]);
- tmp = fabs(tfp->ob_scale[1] - ob->size[1]);
- if (tmp > max) {
- axis = 1;
- max = tmp;
- }
- tmp = fabs(tfp->ob_scale[2] - ob->size[2]);
- if (tmp > max) {
- axis = 2;
- max = tmp;
- }
-
- if (ob->size[axis] != tfp->ob_scale[axis]) {
- if (fabs(ob->size[axis]) > FLT_EPSILON) {
- ratio = tfp->ob_scale[axis] / ob->size[axis];
- ob->size[0] *= ratio;
- ob->size[1] *= ratio;
- ob->size[2] *= ratio;
- }
- }
- }
- else {
- VECCOPY(ob->size, tfp->ob_scale);
-
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
-
- case B_OBJECTPANELDIMS:
- bb= object_get_boundbox(ob);
- if(bb) {
- float old_dims[3], scale[3], ratio, len[3];
- int axis;
-
- Mat4ToSize(ob->obmat, scale);
-
- len[0] = bb->vec[4][0] - bb->vec[0][0];
- len[1] = bb->vec[2][1] - bb->vec[0][1];
- len[2] = bb->vec[1][2] - bb->vec[0][2];
-
- old_dims[0] = fabs(scale[0]) * len[0];
- old_dims[1] = fabs(scale[1]) * len[1];
- old_dims[2] = fabs(scale[2]) * len[2];
-
- /* for each axis changed */
- for (axis = 0; axis<3; axis++) {
- if (fabs(old_dims[axis] - tfp->ob_dims[axis]) > 0.0001) {
- if (old_dims[axis] > 0.0) {
- ratio = tfp->ob_dims[axis] / old_dims[axis];
- if (tfp->link_scale) {
- ob->size[0] *= ratio;
- ob->size[1] *= ratio;
- ob->size[2] *= ratio;
- break;
- }
- else {
- ob->size[axis] *= ratio;
- }
- }
- else {
- if (len[axis] > 0) {
- ob->size[axis] = tfp->ob_dims[axis] / len[axis];
- }
- }
- }
- }
-
- /* prevent multiple B_OBJECTPANELDIMS events to keep scaling, cycling with TAB on buttons can cause that */
- VECCOPY(tfp->ob_dims, old_dims);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
-
- case B_OBJECTPANELMEDIAN:
- if(ob) {
- v3d_editvertex_buts(NULL, ob, 1.0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
-
- /* note; this case also used for parbone */
- case B_OBJECTPANELPARENT:
- if(ob) {
- if(ob->id.lib || test_parent_loop(ob->parent, ob) )
- ob->parent= NULL;
- else {
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- break;
-
- case B_ARMATUREPANEL1:
- {
- bArmature *arm= G.obedit->data;
- EditBone *ebone, *child;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next){
- if ((ebone->flag & BONE_ACTIVE) && (ebone->layer & arm->layer))
- break;
- }
- if (ebone) {
- ebone->roll= M_PI*tfp->ob_eul[0]/180.0;
- // Update our parent
- if (ebone->parent && ebone->flag & BONE_CONNECTED){
- VECCOPY (ebone->parent->tail, ebone->head);
- }
-
- // Update our children if necessary
- for (child = G.edbo.first; child; child=child->next){
- if (child->parent == ebone && (child->flag & BONE_CONNECTED)){
- VECCOPY (child->head, ebone->tail);
- }
- }
- if(arm->flag & ARM_MIRROR_EDIT) {
- EditBone *eboflip= armature_bone_get_mirrored(ebone);
- if(eboflip) {
- eboflip->roll= -ebone->roll;
- eboflip->head[0]= -ebone->head[0];
- eboflip->tail[0]= -ebone->tail[0];
-
- // Update our parent
- if (eboflip->parent && eboflip->flag & BONE_CONNECTED){
- VECCOPY (eboflip->parent->tail, eboflip->head);
- }
-
- // Update our children if necessary
- for (child = G.edbo.first; child; child=child->next){
- if (child->parent == eboflip && (child->flag & BONE_CONNECTED)){
- VECCOPY (child->head, eboflip->tail);
- }
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 1);
- }
- }
- break;
- case B_ARMATUREPANEL3: // rotate button on channel
- {
- bArmature *arm;
- bPoseChannel *pchan;
- Bone *bone;
- float eul[3];
-
- arm = get_armature(OBACT);
- if (!arm || !ob->pose) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone = pchan->bone;
- if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer))
- break;
- }
- if (!pchan) return;
-
- /* make a copy to eul[3], to allow TAB on buttons to work */
- eul[0]= M_PI*tfp->ob_eul[0]/180.0;
- eul[1]= M_PI*tfp->ob_eul[1]/180.0;
- eul[2]= M_PI*tfp->ob_eul[2]/180.0;
- EulToQuat(eul, pchan->quat);
- }
- /* no break, pass on */
- case B_ARMATUREPANEL2:
- {
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
- case B_TRANSFORMSPACEADD:
- BIF_manageTransformOrientation(1, 0);
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_TRANSFORMSPACECLEAR:
- BIF_clearTransformOrientation();
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-void removeTransformOrientation_func(void *target, void *unused)
-{
- BIF_removeTransformOrientation((TransformOrientation *) target);
-}
-
-void selectTransformOrientation_func(void *target, void *unused)
-{
- BIF_selectTransformOrientation((TransformOrientation *) target);
-}
-
-static void view3d_panel_transform_spaces(short cntrl)
-{
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts = transform_spaces->first;
- uiBlock *block;
- uiBut *but;
- int xco = 20, yco = 70, height = 140;
- int index;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_panel_transform", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_TRANSFORM); // for close and esc
-
- if(uiNewPanel(curarea, block, "Transform Orientations", "View3d", 10, 230, 318, height)==0) return;
-
- uiNewPanelHeight(block, height);
-
- uiBlockBeginAlign(block);
-
- if (G.obedit)
- uiDefBut(block, BUT, B_TRANSFORMSPACEADD, "Add", xco,120,80,20, 0, 0, 0, 0, 0, "Add the selected element as a Transform Orientation");
- else
- uiDefBut(block, BUT, B_TRANSFORMSPACEADD, "Add", xco,120,80,20, 0, 0, 0, 0, 0, "Add the active object as a Transform Orientation");
-
- uiDefBut(block, BUT, B_TRANSFORMSPACECLEAR, "Clear", xco + 80,120,80,20, 0, 0, 0, 0, 0, "Removal all Transform Orientations");
-
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
-
- uiDefButS(block, ROW, REDRAWHEADERS, "Global", xco, 90, 40,20, &G.vd->twmode, 5.0, (float)V3D_MANIP_GLOBAL,0, 0, "Global Transform Orientation");
- uiDefButS(block, ROW, REDRAWHEADERS, "Local", xco + 40, 90, 40,20, &G.vd->twmode, 5.0, (float)V3D_MANIP_LOCAL, 0, 0, "Local Transform Orientation");
- uiDefButS(block, ROW, REDRAWHEADERS, "Normal", xco + 80, 90, 40,20, &G.vd->twmode, 5.0, (float)V3D_MANIP_NORMAL,0, 0, "Normal Transform Orientation");
- uiDefButS(block, ROW, REDRAWHEADERS, "View", xco + 120, 90, 40,20, &G.vd->twmode, 5.0, (float)V3D_MANIP_VIEW, 0, 0, "View Transform Orientation");
-
- for (index = V3D_MANIP_CUSTOM, ts = transform_spaces->first ; ts ; ts = ts->next, index++) {
-
- BIF_ThemeColor(TH_BUT_ACTION);
- if (G.vd->twmode == index) {
- but = uiDefIconButS(block,ROW, REDRAWHEADERS, ICON_CHECKBOX_HLT, xco,yco,XIC,YIC, &G.vd->twmode, 5.0, (float)index, 0, 0, "Use this Custom Transform Orientation");
- }
- else {
- but = uiDefIconButS(block,ROW, REDRAWHEADERS, ICON_CHECKBOX_DEHLT, xco,yco,XIC,YIC, &G.vd->twmode, 5.0, (float)index, 0, 0, "Use this Custom Transform Orientation");
- }
- uiButSetFunc(but, selectTransformOrientation_func, ts, NULL);
- uiDefBut(block, TEX, 0, "", xco+=XIC, yco,100+XIC,20, &ts->name, 0, 30, 0, 0, "Edits the name of this Transform Orientation");
- but = uiDefIconBut(block, BUT, REDRAWVIEW3D, ICON_X, xco+=100+XIC,yco,XIC,YIC, 0, 0, 0, 0, 0, "Deletes this Transform Orientation");
- uiButSetFunc(but, removeTransformOrientation_func, ts, NULL);
-
- xco = 20;
- yco -= 25;
- }
- uiBlockEndAlign(block);
-
- if(yco < 0) uiNewPanelHeight(block, height-yco);
-}
-
-
-static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
-{
- uiBlock *block;
- uiBut *bt;
- Object *ob= OBACT;
- TransformProperties *tfp;
- float lim;
- static char hexcol[128];
-
- if(ob==NULL) return;
-
- /* make sure we got storage */
- if(G.vd->properties_storage==NULL)
- G.vd->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties");
- tfp= G.vd->properties_storage;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_panel_object", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_OBJECT); // for close and esc
-
- if((G.f & G_SCULPTMODE) && !G.obedit) {
- if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 234))
- return;
- } else if(G.f & G_PARTICLEEDIT && !G.obedit){
- if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 234))
- return;
- } else {
- if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204))
- return;
- }
-
- uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
-
- if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) {
- uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
- }
- else {
- bt= uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 21.0, 0, 0, "");
-#ifdef WITH_VERSE
- if(ob->vnode) uiButSetFunc(bt, test_and_send_idbutton_cb, ob, ob->id.name);
- else uiButSetFunc(bt, test_idbutton_cb, ob->id.name, NULL);
-#else
- uiButSetFunc(bt, test_idbutton_cb, ob->id.name, NULL);
-#endif
-
- if((G.f & G_PARTICLEEDIT)==0) {
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object");
- if((ob->parent) && (ob->partype == PARBONE)) {
- bt= uiDefBut(block, TEX, B_OBJECTPANELPARENT, "ParBone:", 160, 160, 140, 20, ob->parsubstr, 0, 30, 0, 0, "");
- uiButSetCompleteFunc(bt, autocomplete_bone, (void *)ob->parent);
- }
- else {
- strcpy(ob->parsubstr, "");
- }
- uiBlockEndAlign(block);
- }
- }
-
- lim= 10000.0f*MAX2(1.0, G.vd->grid);
-
- if(ob==G.obedit) {
- if(ob->type==OB_ARMATURE) v3d_editarmature_buts(block, ob, lim);
- if(ob->type==OB_MBALL) v3d_editmetaball_buts(block, ob, lim);
- else v3d_editvertex_buts(block, ob, lim);
- }
- else if(ob->flag & OB_POSEMODE) {
- v3d_posearmature_buts(block, ob, lim);
- }
- else if(G.f & G_WEIGHTPAINT) {
- uiNewPanelTitle(block, "Weight Paint Properties");
- weight_paint_buttons(block);
- }
- else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) {
- extern VPaint Gvp; /* from vpaint */
- static float hsv[3], old[3]; // used as temp mem for picker
- float *rgb= NULL;
- ToolSettings *settings= G.scene->toolsettings;
-
- if(G.f & G_VERTEXPAINT) rgb= &Gvp.r;
- else if(settings->imapaint.brush) rgb= settings->imapaint.brush->rgb;
-
- uiNewPanelTitle(block, "Paint Properties");
- if (rgb)
- /* 'f' is for floating panel */
- uiBlockPickerButtons(block, rgb, hsv, old, hexcol, 'f', REDRAWBUTSEDIT);
- }
- else if(G.f & G_SCULPTMODE) {
- uiNewPanelTitle(block, "Sculpt Properties");
- sculptmode_draw_interface_tools(block,10,150);
- } else if(G.f & G_PARTICLEEDIT){
- uiNewPanelTitle(block, "Particle Edit Properties");
- particle_edit_buttons(block);
- } else {
- BoundBox *bb = NULL;
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, REDRAWVIEW3D, ICON_UNLOCKED, 10,150,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANEL, "LocX:", 30, 150, 120, 19, &(ob->loc[0]), -lim, lim, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, REDRAWVIEW3D, ICON_UNLOCKED, 10,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANEL, "LocY:", 30, 130, 120, 19, &(ob->loc[1]), -lim, lim, 100, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANEL, "LocZ:", 30, 110, 120, 19, &(ob->loc[2]), -lim, lim, 100, 3, "");
-
- tfp->ob_eul[0]= 180.0*ob->rot[0]/M_PI;
- tfp->ob_eul[1]= 180.0*ob->rot[1]/M_PI;
- tfp->ob_eul[2]= 180.0*ob->rot[2]/M_PI;
-
- uiBlockBeginAlign(block);
- if ((ob->parent) && (ob->partype == PARBONE)) {
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 160,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 180, 130, 120, 19, &(tfp->ob_eul[0]), -lim, lim, 1000, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 160,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 180, 110, 120, 19, &(tfp->ob_eul[1]), -lim, lim, 1000, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,90,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 180, 90, 120, 19, &(tfp->ob_eul[2]), -lim, lim, 1000, 3, "");
-
- }
- else {
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 160,150,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 180, 150, 120, 19, &(tfp->ob_eul[0]), -lim, lim, 1000, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 160,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 180, 130, 120, 19, &(tfp->ob_eul[1]), -lim, lim, 1000, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 180, 110, 120, 19, &(tfp->ob_eul[2]), -lim, lim, 1000, 3, "");
- }
-
- tfp->ob_scale[0]= ob->size[0];
- tfp->ob_scale[1]= ob->size[1];
- tfp->ob_scale[2]= ob->size[2];
-
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, REDRAWVIEW3D, ICON_UNLOCKED, 10,80,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleX:", 30, 80, 120, 19, &(tfp->ob_scale[0]), -lim, lim, 10, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, REDRAWVIEW3D, ICON_UNLOCKED, 10,60,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleY:", 30, 60, 120, 19, &(tfp->ob_scale[1]), -lim, lim, 10, 3, "");
- uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,40,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed");
- uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleZ:", 30, 40, 120, 19, &(tfp->ob_scale[2]), -lim, lim, 10, 3, "");
- uiBlockEndAlign(block);
-
- uiDefButS(block, TOG, REDRAWVIEW3D, "Link Scale", 10, 10, 140, 19, &(tfp->link_scale), 0, 1, 0, 0, "Scale values vary proportionally in all directions");
-
- bb= object_get_boundbox(ob);
- if (bb) {
- float scale[3];
-
- Mat4ToSize(ob->obmat, scale);
-
- tfp->ob_dims[0] = fabs(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]);
- tfp->ob_dims[1] = fabs(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]);
- tfp->ob_dims[2] = fabs(scale[2]) * (bb->vec[1][2] - bb->vec[0][2]);
-
- uiBlockBeginAlign(block);
- if ((ob->parent) && (ob->partype == PARBONE)) {
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimX:", 160, 60, 140, 19, &(tfp->ob_dims[0]), 0.0, lim, 10, 3, "Manipulate bounding box size");
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimY:", 160, 40, 140, 19, &(tfp->ob_dims[1]), 0.0, lim, 10, 3, "Manipulate bounding box size");
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimZ:", 160, 20, 140, 19, &(tfp->ob_dims[2]), 0.0, lim, 10, 3, "Manipulate bounding box size");
-
- }
- else {
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimX:", 160, 80, 140, 19, &(tfp->ob_dims[0]), 0.0, lim, 10, 3, "Manipulate bounding box size");
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimY:", 160, 60, 140, 19, &(tfp->ob_dims[1]), 0.0, lim, 10, 3, "Manipulate bounding box size");
- uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimZ:", 160, 40, 140, 19, &(tfp->ob_dims[2]), 0.0, lim, 10, 3, "Manipulate bounding box size");
- }
-
- uiBlockEndAlign(block);
- }
- }
- uiClearButLock();
-}
-
-static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND
-{
- uiBlock *block;
- View3D *vd;
-
- vd= G.vd;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_panel_background", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_BACKGROUND); // for close and esc
- if(uiNewPanel(curarea, block, "Background Image", "View3d", 340, 10, 318, 204)==0) return;
-
- if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT || G.f & G_GREASEPENCIL) {
- uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
- }
-
- if(vd->flag & V3D_DISPBGPIC) {
- if(vd->bgpic==NULL) {
- vd->bgpic= MEM_callocN(sizeof(BGpic), "bgpic");
- vd->bgpic->size= 5.0;
- vd->bgpic->blend= 0.5;
- vd->bgpic->iuser.fie_ima= 2;
- vd->bgpic->iuser.ok= 1;
- }
- }
-
- if(!(vd->flag & V3D_DISPBGPIC)) {
- uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use Background Image", 10, 180, 150, 20, &vd->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
- else {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use", 10, 225, 50, 20, &vd->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View");
- uiDefButF(block, NUMSLI, B_REDR, "Blend:", 60, 225, 150, 20, &vd->bgpic->blend, 0.0,1.0, 0, 0, "Set the transparency of the background image");
- uiDefButF(block, NUM, B_REDR, "Size:", 210, 225, 100, 20, &vd->bgpic->size, 0.1, 250.0*vd->grid, 100, 0, "Set the size (width) of the background image");
-
- uiDefButF(block, NUM, B_REDR, "X Offset:", 10, 205, 150, 20, &vd->bgpic->xof, -250.0*vd->grid,250.0*vd->grid, 10, 2, "Set the horizontal offset of the background image");
- uiDefButF(block, NUM, B_REDR, "Y Offset:", 160, 205, 150, 20, &vd->bgpic->yof, -250.0*vd->grid,250.0*vd->grid, 10, 2, "Set the vertical offset of the background image");
-
- uiblock_image_panel(block, &vd->bgpic->ima, &vd->bgpic->iuser, B_REDR, B_REDR);
- }
-}
-
-
-static void view3d_panel_properties(short cntrl) // VIEW3D_HANDLER_SETTINGS
-{
- uiBlock *block;
- View3D *vd;
- float *curs;
-
- vd= G.vd;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "View Properties", "View3d", 340, 30, 318, 254)==0) return;
-
- /* to force height */
- uiNewPanelHeight(block, 264);
-
- if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT|G_GREASEPENCIL)) {
- uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
- }
-
- uiDefBut(block, LABEL, 1, "Grid:", 10, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWVIEW3D, "Spacing:", 10, 200, 140, 19, &vd->grid, 0.001, 100.0, 10, 0, "Set the distance between grid lines");
- uiDefButS(block, NUM, REDRAWVIEW3D, "Lines:", 10, 180, 140, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of grid lines in perspective view");
- uiDefButS(block, NUM, REDRAWVIEW3D, "Divisions:", 10, 160, 140, 19, &vd->gridsubdiv, 1.0, 100.0, 100, 0, "Set the number of grid lines");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "3D Display:", 160, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefButBitS(block, TOG, V3D_SHOW_FLOOR, REDRAWVIEW3D, "Grid Floor",160, 200, 150, 19, &vd->gridflag, 0, 0, 0, 0, "Show the grid floor in free camera mode");
- uiDefButBitS(block, TOG, V3D_SHOW_X, REDRAWVIEW3D, "X Axis", 160, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the X Axis line");
- uiDefButBitS(block, TOG, V3D_SHOW_Y, REDRAWVIEW3D, "Y Axis", 212, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the Y Axis line");
- uiDefButBitS(block, TOG, V3D_SHOW_Z, REDRAWVIEW3D, "Z Axis", 262, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the Z Axis line");
-
- uiDefBut(block, LABEL, 1, "View Camera:", 10, 140, 140, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 120, 140, 19, &vd->lens, 10.0, 120.0, 100, 0, "The lens angle in perspective view");
- uiBlockBeginAlign(block);
- uiDefButF(block, NUM, REDRAWVIEW3D, "Clip Start:", 10, 96, 140, 19, &vd->near, vd->grid/100.0, 100.0, 10, 0, "Set the beginning of the range in which 3D objects are displayed (perspective view)");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Clip End:", 10, 76, 140, 19, &vd->far, 1.0, 10000.0*vd->grid, 100, 0, "Set the end of the range in which 3D objects are displayed (perspective view)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "3D Cursor:", 160, 150, 140, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- curs= give_cursor();
- uiDefButF(block, NUM, REDRAWVIEW3D, "X:", 160, 130, 150, 22, curs, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "X co-ordinate of the 3D cursor");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Y:", 160, 108, 150, 22, curs+1, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Y co-ordinate of the 3D cursor");
- uiDefButF(block, NUM, REDRAWVIEW3D, "Z:", 160, 86, 150, 22, curs+2, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Z co-ordinate of the 3D cursor");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "Display:", 10, 50, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_SELECT_OUTLINE, REDRAWVIEW3D, "Outline Selected", 10, 30, 140, 19, &vd->flag, 0, 0, 0, 0, "Highlight selected objects with an outline, in Solid, Shaded or Textured viewport shading modes");
- uiDefButBitS(block, TOG, V3D_DRAW_CENTERS, REDRAWVIEW3D, "All Object Centers", 10, 10, 140, 19, &vd->flag, 0, 0, 0, 0, "Draw the center points on all objects");
- uiDefButBitS(block, TOGN, V3D_HIDE_HELPLINES, REDRAWVIEW3D, "Relationship Lines", 10, -10, 140, 19, &vd->flag, 0, 0, 0, 0, "Draw dashed lines indicating Parent, Constraint, or Hook relationships");
- uiDefButBitS(block, TOG, V3D_SOLID_TEX, REDRAWVIEW3D, "Solid Tex", 10, -30, 140, 19, &vd->flag2, 0, 0, 0, 0, "Display textures in Solid draw type (Shift T)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL, 1, "View Locking:", 160, 60, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "Object:", 160, 40, 140, 19, &vd->ob_centre, "Lock view to center to this Object");
- uiDefBut(block, TEX, REDRAWVIEW3D, "Bone:", 160, 20, 140, 19, vd->ob_centre_bone, 1, 31, 0, 0, "If view locked to Object, use this Bone to lock to view to");
-
- uiDefBut(block, LABEL, 1, "Keyframe Display:", 160, -2, 150, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, ANIMFILTER_ACTIVE, REDRAWVIEW3D, "Active",160, -22, 50, 19, &vd->keyflags, 0, 0, 0, 0, "Show keyframes for active element only (i.e. active bone or active material)");
- uiDefButBitS(block, TOG, ANIMFILTER_MUTED, REDRAWVIEW3D, "Muted",210, -22, 50, 19, &vd->keyflags, 0, 0, 0, 0, "Show keyframes in muted channels");
- uiDefButBitS(block, TOG, ANIMFILTER_LOCAL, REDRAWVIEW3D, "Local",260, -22, 50, 19, &vd->keyflags, 0, 0, 0, 0, "Show keyframes directly connected to datablock");
- if ((vd->keyflags & ANIMFILTER_LOCAL)==0) {
- uiDefButBitS(block, TOGN, ANIMFILTER_NOMAT, REDRAWVIEW3D, "Material",160, -42, 75, 19, &vd->keyflags, 0, 0, 0, 0, "Show keyframes for any available Materials");
- uiDefButBitS(block, TOGN, ANIMFILTER_NOSKEY, REDRAWVIEW3D, "ShapeKey",235, -42, 75, 19, &vd->keyflags, 0, 0, 0, 0, "Show keyframes for any available Shape Keys");
- }
- uiBlockEndAlign(block);
-}
-
-static void view3d_panel_preview(ScrArea *sa, short cntrl) // VIEW3D_HANDLER_PREVIEW
-{
- uiBlock *block;
- View3D *v3d= sa->spacedata.first;
- int ofsx, ofsy;
-
- block= uiNewBlock(&sa->uiblocks, "view3d_panel_preview", UI_EMBOSS, UI_HELV, sa->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc
-
- ofsx= -150+(sa->winx/2)/v3d->blockscale;
- ofsy= -100+(sa->winy/2)/v3d->blockscale;
- if(uiNewPanel(sa, block, "Preview", "View3d", ofsx, ofsy, 300, 200)==0) return;
-
- uiBlockSetDrawExtraFunc(block, BIF_view3d_previewdraw);
-
- if(G.scene->recalc & SCE_PRV_CHANGED) {
- G.scene->recalc &= ~SCE_PRV_CHANGED;
- //printf("found recalc\n");
- BIF_view3d_previewrender_free(sa->spacedata.first);
- BIF_preview_changed(0);
- }
-}
-
-static void view3d_panel_gpencil(short cntrl) // VIEW3D_HANDLER_GREASEPENCIL
-{
- uiBlock *block;
- View3D *vd;
-
- vd= G.vd;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win);
- uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_GREASEPENCIL); // for close and esc
- if (uiNewPanel(curarea, block, "Grease Pencil", "View3d", 100, 30, 318, 204)==0) return;
-
- if (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT|G_GREASEPENCIL)) {
- uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
- }
-
- /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */
- if (vd->flag2 & V3D_DISPGP) {
- if (vd->gpd == NULL)
- gpencil_data_setactive(curarea, gpencil_data_addnew());
- }
-
- if (vd->flag2 & V3D_DISPGP) {
- bGPdata *gpd= vd->gpd;
- short newheight;
-
- /* this is a variable height panel, newpanel doesnt force new size on existing panels */
- /* so first we make it default height */
- uiNewPanelHeight(block, 204);
-
- /* draw button for showing gpencil settings and drawings */
- uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)");
-
- /* extend the panel if the contents won't fit */
- newheight= draw_gpencil_panel(block, gpd, curarea);
- uiNewPanelHeight(block, newheight);
- }
- else {
- uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &vd->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View");
- uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- }
-}
-
-
-static void view3d_blockhandlers(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
- short a;
-
- /* warning; blocks need to be freed each time, handlers dont remove */
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- /*uv face-sel and wp mode when mixed with wire leave depth enabled causing
- models to draw over the UI */
- glDisable(GL_DEPTH_TEST);
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- switch(v3d->blockhandler[a]) {
- case VIEW3D_HANDLER_PROPERTIES:
- view3d_panel_properties(v3d->blockhandler[a+1]);
- break;
- case VIEW3D_HANDLER_BACKGROUND:
- view3d_panel_background(v3d->blockhandler[a+1]);
- break;
- case VIEW3D_HANDLER_OBJECT:
- view3d_panel_object(v3d->blockhandler[a+1]);
- break;
- case VIEW3D_HANDLER_PREVIEW:
- view3d_panel_preview(sa, v3d->blockhandler[a+1]);
- break;
- case VIEW3D_HANDLER_TRANSFORM:
- view3d_panel_transform_spaces(v3d->blockhandler[a+1]);
- break;
- case VIEW3D_HANDLER_GREASEPENCIL:
- view3d_panel_gpencil(v3d->blockhandler[a+1]);
- break;
- }
- /* clear action value for event */
- v3d->blockhandler[a+1]= 0;
- }
- uiDrawBlocksPanels(sa, 0);
-
-}
-
-/* ****************** View3d afterdraw *************** */
-
-typedef struct View3DAfter {
- struct View3DAfter *next, *prev;
- struct Base *base;
- int type, flag;
-} View3DAfter;
-
-/* temp storage of Objects that need to be drawn as last */
-void add_view3d_after(View3D *v3d, Base *base, int type, int flag)
-{
- View3DAfter *v3da= MEM_callocN(sizeof(View3DAfter), "View 3d after");
-
- BLI_addtail(&v3d->afterdraw, v3da);
- v3da->base= base;
- v3da->type= type;
- v3da->flag= flag;
-}
-
-/* clears zbuffer and draws it over */
-static void view3d_draw_xray(View3D *v3d, int clear)
-{
- View3DAfter *v3da, *next;
- int doit= 0;
-
- for(v3da= v3d->afterdraw.first; v3da; v3da= v3da->next)
- if(v3da->type==V3D_XRAY) doit= 1;
-
- if(doit) {
- if(clear && v3d->zbuf) glClear(GL_DEPTH_BUFFER_BIT);
- v3d->xray= TRUE;
-
- for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
- next= v3da->next;
- if(v3da->type==V3D_XRAY) {
- draw_object(v3da->base, v3da->flag);
- BLI_remlink(&v3d->afterdraw, v3da);
- MEM_freeN(v3da);
- }
- }
- v3d->xray= FALSE;
- }
-}
-
-/* disables write in zbuffer and draws it over */
-static void view3d_draw_transp(View3D *v3d)
-{
- View3DAfter *v3da, *next;
-
- glDepthMask(0);
- v3d->transp= TRUE;
-
- for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
- next= v3da->next;
- if(v3da->type==V3D_TRANSP) {
- draw_object(v3da->base, v3da->flag);
- BLI_remlink(&v3d->afterdraw, v3da);
- MEM_freeN(v3da);
- }
- }
- v3d->transp= FALSE;
-
- glDepthMask(1);
-
-}
-
-/* *********************** */
-
-/*
- In most cases call draw_dupli_objects,
- draw_dupli_objects_color was added because when drawing set dupli's
- we need to force the color
-*/
-static void draw_dupli_objects_color(View3D *v3d, Base *base, int color)
-{
- ListBase *lb;
- DupliObject *dob;
- Base tbase;
- BoundBox *bb= NULL;
- GLuint displist=0;
- short transflag, use_displist= -1; /* -1 is initialize */
- char dt, dtx;
-
- if (base->object->restrictflag & OB_RESTRICT_VIEW) return;
-
- tbase.flag= OB_FROMDUPLI|base->flag;
- lb= object_duplilist(G.scene, base->object);
-
- for(dob= lb->first; dob; dob= dob->next) {
- if(dob->no_draw);
- else {
- tbase.object= dob->ob;
-
- /* extra service: draw the duplicator in drawtype of parent */
- /* MIN2 for the drawtype to allow bounding box objects in groups for lods */
- dt= tbase.object->dt; tbase.object->dt= MIN2(tbase.object->dt, base->object->dt);
- dtx= tbase.object->dtx; tbase.object->dtx= base->object->dtx;
-
- /* negative scale flag has to propagate */
- transflag= tbase.object->transflag;
- if(base->object->transflag & OB_NEG_SCALE)
- tbase.object->transflag ^= OB_NEG_SCALE;
-
- BIF_ThemeColorBlend(color, TH_BACK, 0.5);
-
- /* generate displist, test for new object */
- if(use_displist==1 && dob->prev && dob->prev->ob!=dob->ob) {
- use_displist= -1;
- glDeleteLists(displist, 1);
- }
- /* generate displist */
- if(use_displist == -1) {
-
- /* lamp drawing messes with matrices, could be handled smarter... but this works */
- if(dob->ob->type==OB_LAMP || dob->type==OB_DUPLIGROUP)
- use_displist= 0;
- else {
- /* disable boundbox check for list creation */
- object_boundbox_flag(dob->ob, OB_BB_DISABLED, 1);
- /* need this for next part of code */
- bb= object_get_boundbox(dob->ob);
-
- Mat4One(dob->ob->obmat); /* obmat gets restored */
-
- displist= glGenLists(1);
- glNewList(displist, GL_COMPILE);
- draw_object(&tbase, DRAW_CONSTCOLOR);
- glEndList();
-
- use_displist= 1;
- object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0);
- }
- }
- if(use_displist) {
- mymultmatrix(dob->mat);
- if(boundbox_clip(dob->mat, bb))
- glCallList(displist);
- myloadmatrix(G.vd->viewmat);
- }
- else {
- Mat4CpyMat4(dob->ob->obmat, dob->mat);
- draw_object(&tbase, DRAW_CONSTCOLOR);
- }
-
- tbase.object->dt= dt;
- tbase.object->dtx= dtx;
- tbase.object->transflag= transflag;
- }
- }
-
- /* Transp afterdraw disabled, afterdraw only stores base pointers, and duplis can be same obj */
-
- free_object_duplilist(lb); /* does restore */
-
- if(use_displist)
- glDeleteLists(displist, 1);
-}
-
-static void draw_dupli_objects(View3D *v3d, Base *base)
-{
- /* define the color here so draw_dupli_objects_color can be called
- * from the set loop */
-
- int color= (base->flag & SELECT)?TH_SELECT:TH_WIRE;
- /* debug */
- if(base->object->dup_group && base->object->dup_group->id.us<1)
- color= TH_REDALERT;
-
- draw_dupli_objects_color(v3d, base, color);
-}
-
-void view3d_update_depths(View3D *v3d)
-{
- /* Create storage for, and, if necessary, copy depth buffer */
- if(!v3d->depths) v3d->depths= MEM_callocN(sizeof(ViewDepths),"ViewDepths");
- if(v3d->depths) {
- ViewDepths *d= v3d->depths;
- if(d->w != v3d->area->winx ||
- d->h != v3d->area->winy ||
- !d->depths) {
- d->w= v3d->area->winx;
- d->h= v3d->area->winy;
- if(d->depths)
- MEM_freeN(d->depths);
- d->depths= MEM_mallocN(sizeof(float)*d->w*d->h,"View depths");
- d->damaged= 1;
- }
-
- if(d->damaged) {
- glReadPixels(v3d->area->winrct.xmin,v3d->area->winrct.ymin,d->w,d->h,
- GL_DEPTH_COMPONENT,GL_FLOAT, d->depths);
-
- glGetDoublev(GL_DEPTH_RANGE,d->depth_range);
-
- d->damaged= 0;
- }
- }
-}
-
-/* Enable sculpting in wireframe mode by drawing sculpt object only to the depth buffer */
-static void draw_sculpt_depths(View3D *v3d)
-{
- Object *ob = OBACT;
-
- int dt= MIN2(v3d->drawtype, ob->dt);
- if(v3d->zbuf==0 && dt>OB_WIRE)
- dt= OB_WIRE;
- if(dt == OB_WIRE) {
- GLboolean depth_on;
- int orig_vdt = v3d->drawtype;
- int orig_zbuf = v3d->zbuf;
- int orig_odt = ob->dt;
-
- glGetBooleanv(GL_DEPTH_TEST, &depth_on);
- v3d->drawtype = ob->dt = OB_SOLID;
- v3d->zbuf = 1;
-
- glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
- glEnable(GL_DEPTH_TEST);
- draw_object(BASACT, 0);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- if(!depth_on)
- glDisable(GL_DEPTH_TEST);
-
- v3d->drawtype = orig_vdt;
- v3d->zbuf = orig_zbuf;
- ob->dt = orig_odt;
- }
-}
-
-void draw_depth(ScrArea *sa, void *spacedata, int (* func)(void *))
-{
- View3D *v3d= spacedata;
- Base *base;
- Scene *sce;
- short zbuf, flag;
- float glalphaclip;
- /* temp set drawtype to solid */
-
- /* Setting these temporarily is not nice */
- zbuf = v3d->zbuf;
- flag = v3d->flag;
- glalphaclip = U.glalphaclip;
-
- U.glalphaclip = 0.5; /* not that nice but means we wont zoom into billboards */
- v3d->flag &= ~V3D_SELECT_OUTLINE;
-
- setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
- setviewmatrixview3d(); /* note: calls where_is_object for camera... */
-
- Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat);
- Mat4Invert(v3d->persinv, v3d->persmat);
- Mat4Invert(v3d->viewinv, v3d->viewmat);
-
- glClear(GL_DEPTH_BUFFER_BIT);
-
- myloadmatrix(v3d->viewmat);
- persp(PERSP_STORE); // store correct view for persp(PERSP_VIEW) calls
-
- if(v3d->flag & V3D_CLIPPING) {
- view3d_set_clipping(v3d);
- }
-
- v3d->zbuf= TRUE;
- glEnable(GL_DEPTH_TEST);
-
- /* draw set first */
- if(G.scene->set) {
- for(SETLOOPER(G.scene->set, base)) {
- if(v3d->lay & base->lay) {
- if (func == NULL || func(base)) {
- draw_object(base, 0);
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects_color(v3d, base, TH_WIRE);
- }
- }
- }
- }
- }
-
- for(base= G.scene->base.first; base; base= base->next) {
- if(v3d->lay & base->lay) {
- if (func == NULL || func(base)) {
- /* dupli drawing */
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects(v3d, base);
- }
- draw_object(base, 0);
- }
- }
- }
-
- /* this isnt that nice, draw xray objects as if they are normal */
- if (v3d->afterdraw.first) {
- View3DAfter *v3da, *next;
- int num = 0;
- v3d->xray= TRUE;
-
- glDepthFunc(GL_ALWAYS); /* always write into the depth bufer, overwriting front z values */
- for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
- next= v3da->next;
- if(v3da->type==V3D_XRAY) {
- draw_object(v3da->base, 0);
- num++;
- }
- /* dont remove this time */
- }
- v3d->xray= FALSE;
-
- glDepthFunc(GL_LEQUAL); /* Now write the depth buffer normally */
- for(v3da= v3d->afterdraw.first; v3da; v3da= next) {
- next= v3da->next;
- if(v3da->type==V3D_XRAY) {
- v3d->xray= TRUE; v3d->transp= FALSE;
- } else if (v3da->type==V3D_TRANSP) {
- v3d->xray= FALSE; v3d->transp= TRUE;
- }
-
- draw_object(v3da->base, 0); /* Draw Xray or Transp objects normally */
- BLI_remlink(&v3d->afterdraw, v3da);
- MEM_freeN(v3da);
- }
- v3d->xray= FALSE;
- v3d->transp= FALSE;
- }
-
- v3d->zbuf = zbuf;
- U.glalphaclip = glalphaclip;
- v3d->flag = flag;
-}
-
-static void draw_viewport_fps(ScrArea *sa);
-
-typedef struct View3DShadow{
- struct View3DShadow*next, *prev;
- GPULamp *lamp;
-} View3DShadow;
-
-static void gpu_render_lamp_update(View3D *v3d, Object *ob, Object *par, float obmat[][4], ListBase *shadows)
-{
- GPULamp *lamp;
- View3DShadow *shadow;
-
- lamp = GPU_lamp_from_blender(G.scene, ob, par);
-
- if(lamp) {
- GPU_lamp_update(lamp, ob->lay, obmat);
-
- if((ob->lay & v3d->lay) && GPU_lamp_has_shadow_buffer(lamp)) {
- shadow= MEM_callocN(sizeof(View3DShadow), "View3DShadow");
- shadow->lamp = lamp;
- BLI_addtail(shadows, shadow);
- }
- }
-}
-
-static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
-{
- ListBase shadows;
- View3DShadow *shadow;
- Scene *sce;
- Base *base;
- Object *ob;
-
- shadows.first= shadows.last= NULL;
-
- /* update lamp transform and gather shadow lamps */
- for(SETLOOPER(G.scene, base)) {
- ob= base->object;
-
- if(ob->type == OB_LAMP)
- gpu_render_lamp_update(v3d, ob, NULL, ob->obmat, &shadows);
-
- if (ob->transflag & OB_DUPLI) {
- DupliObject *dob;
- ListBase *lb = object_duplilist(G.scene, ob);
-
- for(dob=lb->first; dob; dob=dob->next)
- if(dob->ob->type==OB_LAMP)
- gpu_render_lamp_update(v3d, dob->ob, ob, dob->mat, &shadows);
-
- free_object_duplilist(lb);
- }
- }
-
- /* render shadows after updating all lamps, nested object_duplilist
- * don't work correct since it's replacing object matrices */
- for(shadow=shadows.first; shadow; shadow=shadow->next) {
- /* this needs to be done better .. */
- float viewmat[4][4], winmat[4][4];
- int drawtype, lay, winsize, flag2;
-
- drawtype= v3d->drawtype;
- lay= v3d->lay;
- flag2= v3d->flag2 & V3D_SOLID_TEX;
-
- v3d->drawtype = OB_SOLID;
- v3d->lay &= GPU_lamp_shadow_layer(shadow->lamp);
- v3d->flag2 &= ~V3D_SOLID_TEX;
-
- GPU_lamp_shadow_buffer_bind(shadow->lamp, viewmat, &winsize, winmat);
- drawview3d_render(v3d, viewmat, winsize, winsize, winmat, 1);
- GPU_lamp_shadow_buffer_unbind(shadow->lamp);
-
- v3d->drawtype= drawtype;
- v3d->lay= lay;
- v3d->flag2 |= flag2;
- }
-
- BLI_freelistN(&shadows);
-}
-
-void drawview3dspace(ScrArea *sa, void *spacedata)
-{
- View3D *v3d= spacedata;
- Base *base;
- Object *ob;
- Scene *sce;
- char retopo, sculptparticle;
- Object *obact = OBACT;
-
- /* update all objects, ipos, matrices, displists, etc. Flags set by depgraph or manual,
- no layer check here, gets correct flushed */
- /* sets first, we allow per definition current scene to have dependencies on sets */
- if(G.scene->set) {
- for(SETLOOPER(G.scene->set, base))
- object_handle_update(base->object); // bke_object.h
- }
-
- v3d->lay_used = 0;
- for(base= G.scene->base.first; base; base= base->next) {
- object_handle_update(base->object); // bke_object.h
- v3d->lay_used |= base->lay;
- }
-
- /* shadow buffers, before we setup matrices */
- if(draw_glsl_material(NULL, v3d->drawtype))
- gpu_update_lamps_shadows(G.scene, v3d);
-
- setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
- setviewmatrixview3d(); /* note: calls where_is_object for camera... */
-
- Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat);
- Mat4Invert(v3d->persinv, v3d->persmat);
- Mat4Invert(v3d->viewinv, v3d->viewmat);
-
- /* calculate pixelsize factor once, is used for lamps and obcenters */
- {
- float len1, len2, vec[3];
-
- VECCOPY(vec, v3d->persinv[0]);
- len1= Normalize(vec);
- VECCOPY(vec, v3d->persinv[1]);
- len2= Normalize(vec);
-
- v3d->pixsize= 2.0f*(len1>len2?len1:len2);
-
- /* correct for window size */
- if(sa->winx > sa->winy) v3d->pixsize/= (float)sa->winx;
- else v3d->pixsize/= (float)sa->winy;
- }
-
- if(v3d->drawtype > OB_WIRE) {
- float col[3];
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
-
- glLoadIdentity();
- }
- else {
- float col[3];
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
- }
-
- myloadmatrix(v3d->viewmat);
- persp(PERSP_STORE); // store correct view for persp(PERSP_VIEW) calls
-
- if(v3d->flag & V3D_CLIPPING)
- view3d_draw_clipping(v3d);
-
- /* set zbuffer after we draw clipping region */
- if(v3d->drawtype > OB_WIRE) {
- v3d->zbuf= TRUE;
- glEnable(GL_DEPTH_TEST);
- }
-
- // needs to be done always, gridview is adjusted in drawgrid() now
- v3d->gridview= v3d->grid;
-
- if(v3d->view==0 || v3d->persp!=0) {
- drawfloor();
- if(v3d->persp==2) {
- if(G.scene->world) {
- if(G.scene->world->mode & WO_STARS) {
- RE_make_stars(NULL, star_stuff_init_func, star_stuff_vertex_func,
- star_stuff_term_func);
- }
- }
- if(v3d->flag & V3D_DISPBGPIC) draw_bgpic();
- }
- }
- else {
- drawgrid();
-
- if(v3d->flag & V3D_DISPBGPIC) {
- draw_bgpic();
- }
- }
-
- if(v3d->flag & V3D_CLIPPING)
- view3d_set_clipping(v3d);
-
- /* draw set first */
- if(G.scene->set) {
- for(SETLOOPER(G.scene->set, base)) {
-
- if(v3d->lay & base->lay) {
-
- BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f);
- draw_object(base, DRAW_CONSTCOLOR|DRAW_SCENESET);
-
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects_color(v3d, base, TH_WIRE);
- }
- }
- }
-
- /* Transp and X-ray afterdraw stuff for sets is done later */
- }
-
- /* then draw not selected and the duplis, but skip editmode object */
- for(base= G.scene->base.first; base; base= base->next) {
- if(v3d->lay & base->lay) {
-
- /* dupli drawing */
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects(v3d, base);
- }
- if((base->flag & SELECT)==0) {
- if(base->object!=G.obedit) draw_object(base, 0);
- }
- }
- }
-
- retopo= retopo_mesh_check() || retopo_curve_check();
- sculptparticle= (G.f & (G_SCULPTMODE|G_PARTICLEEDIT)) && !G.obedit;
- if(retopo)
- view3d_update_depths(v3d);
-
- /* draw selected and editmode */
- for(base= G.scene->base.first; base; base= base->next) {
- if(v3d->lay & base->lay) {
- if (base->object==G.obedit || ( base->flag & SELECT) )
- draw_object(base, 0);
- }
- }
-
- if(!retopo && sculptparticle && !(obact && (obact->dtx & OB_DRAWXRAY))) {
- if(G.f & G_SCULPTMODE)
- draw_sculpt_depths(v3d);
- view3d_update_depths(v3d);
- }
-
- if(G.moving) {
- BIF_drawConstraint();
- if(G.obedit || (G.f & G_PARTICLEEDIT))
- BIF_drawPropCircle(); // only editmode and particles have proportional edit
- BIF_drawSnap();
- }
-
- REEB_draw();
-
- if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID);
-
- /* Transp and X-ray afterdraw stuff */
- view3d_draw_transp(v3d);
- view3d_draw_xray(v3d, 1); // clears zbuffer if it is used!
-
- if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) {
- if(G.f & G_SCULPTMODE)
- draw_sculpt_depths(v3d);
- view3d_update_depths(v3d);
- }
-
- if(v3d->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
- BIF_draw_manipulator(sa);
-
- if(v3d->zbuf) {
- v3d->zbuf= FALSE;
- glDisable(GL_DEPTH_TEST);
- }
-
- /* draw grease-pencil stuff */
- if (v3d->flag2 & V3D_DISPGP)
- draw_gpencil_3dview(sa, 1);
-
- persp(PERSP_WIN); // set ortho
-
- /* Draw Sculpt Mode brush */
- if(!G.obedit && (G.f & G_SCULPTMODE) && area_is_active_area(v3d->area) && sculpt_session()) {
- RadialControl *rc= sculpt_session()->radialcontrol;
-
- if(sculpt_data()->flags & SCULPT_INPUT_SMOOTH)
- sculpt_stroke_draw();
-
- if(rc)
- radialcontrol_draw(rc);
- else if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
- short csc[2], car[2];
- getmouseco_sc(csc);
- getmouseco_areawin(car);
- if(csc[0] > v3d->area->winrct.xmin &&
- csc[1] > v3d->area->winrct.ymin &&
- csc[0] < v3d->area->winrct.xmax &&
- csc[1] < v3d->area->winrct.ymax)
- fdrawXORcirc((float)car[0], (float)car[1], sculptmode_brush()->size);
- }
- }
-
- retopo_paint_view_update(v3d);
- retopo_draw_paint_lines();
-
- if(!G.obedit && OBACT && G.f&G_PARTICLEEDIT && area_is_active_area(v3d->area)){
- ParticleSystem *psys = PE_get_current(OBACT);
- ParticleEditSettings *pset = PE_settings();
-
- short c[2];
- if(*PE_radialcontrol())
- radialcontrol_draw(*PE_radialcontrol());
- else if(psys && psys->edit && pset->brushtype>=0) {
- getmouseco_areawin(c);
- fdrawXORcirc((float)c[0], (float)c[1], (float)pset->brush[pset->brushtype].size);
- }
- }
-
- if(v3d->persp>1) drawviewborder();
- if(v3d->flag2 & V3D_FLYMODE) drawviewborder_flymode();
-
- /* draw grease-pencil stuff */
- if (v3d->flag2 & V3D_DISPGP)
- draw_gpencil_3dview(sa, 0);
-
- if(!(G.f & G_PLAYANIM)) drawcursor(v3d);
- if(U.uiflag & USER_SHOW_ROTVIEWICON)
- draw_view_axis();
- else
- draw_view_icon();
-
- if(U.uiflag & USER_SHOW_FPS && G.f & G_PLAYANIM) {
- draw_viewport_fps(sa);
- } else if(U.uiflag & USER_SHOW_VIEWPORTNAME) {
- draw_viewport_name(sa);
- }
-
- ob= OBACT;
- if(U.uiflag & USER_DRAWVIEWINFO)
- draw_selected_name(ob);
-
- draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
-
- bwin_scalematrix(sa->win, v3d->blockscale, v3d->blockscale, v3d->blockscale);
- view3d_blockhandlers(sa);
-
- sa->win_swap= WIN_BACK_OK;
-
- if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT) {
- v3d->flag |= V3D_NEEDBACKBUFDRAW;
- addafterqueue(sa->win, BACKBUFDRAW, 1);
- }
- // test for backbuf select
- if(G.obedit && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT)) {
- extern int afterqtest(short win, unsigned short evt); //editscreen.c
-
- v3d->flag |= V3D_NEEDBACKBUFDRAW;
- if(afterqtest(sa->win, BACKBUFDRAW)==0) {
- addafterqueue(sa->win, BACKBUFDRAW, 1);
- }
- }
-
-#ifndef DISABLE_PYTHON
- /* run any view3d draw handler script links */
- if (sa->scriptlink.totscript)
- BPY_do_spacehandlers(sa, 0, 0, SPACEHANDLER_VIEW3D_DRAW);
-
- /* run scene redraw script links */
- if((G.f & G_DOSCRIPTLINKS) && G.scene->scriptlink.totscript &&
- !during_script()) {
- BPY_do_pyscript((ID *)G.scene, SCRIPT_REDRAW);
- }
-#endif
-}
-
-void drawview3d_render(struct View3D *v3d, float viewmat[][4], int winx, int winy, float winmat[][4], int shadow)
-{
- Base *base;
- Scene *sce;
- float v3dviewmat[4][4], v3dwinmat[4][4];
-
- /* shadow buffers, before we setup matrices */
- if(!shadow && draw_glsl_material(NULL, v3d->drawtype))
- gpu_update_lamps_shadows(G.scene, v3d);
-
- if(!winmat)
- setwinmatrixview3d(winx, winy, NULL);
-
- if(viewmat) {
- Mat4CpyMat4(v3dviewmat, viewmat);
- Mat4CpyMat4(v3d->viewmat, viewmat);
- }
- else {
- setviewmatrixview3d();
- Mat4CpyMat4(v3dviewmat, v3d->viewmat);
- }
-
- myloadmatrix(v3dviewmat);
-
- /* when winmat is not NULL, it overrides the regular window matrix */
- glMatrixMode(GL_PROJECTION);
- if(winmat)
- myloadmatrix(winmat);
- mygetmatrix(v3dwinmat);
- glMatrixMode(GL_MODELVIEW);
-
- Mat4MulMat4(v3d->persmat, v3dviewmat, v3dwinmat);
- Mat4Invert(v3d->persinv, v3d->persmat);
- Mat4Invert(v3d->viewinv, v3d->viewmat);
-
- if(!shadow) {
- GPU_free_images();
- reshadeall_displist();
- }
-
- if(v3d->drawtype > OB_WIRE) {
- v3d->zbuf= TRUE;
- glEnable(GL_DEPTH_TEST);
- }
-
- if(v3d->flag & V3D_CLIPPING)
- view3d_set_clipping(v3d);
-
- if (v3d->drawtype==OB_TEXTURE && G.scene->world) {
- glClearColor(G.scene->world->horr, G.scene->world->horg, G.scene->world->horb, 0.0);
- } else {
- float col[3];
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- }
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- G.f |= G_RENDER_OGL;
- if(shadow)
- G.f |= G_RENDER_SHADOW;
-
- /* first draw set */
- if(G.scene->set) {
- for(SETLOOPER(G.scene->set, base)) {
- if(v3d->lay & base->lay) {
- if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE);
- else {
- where_is_object(base->object);
-
- BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f);
- draw_object(base, DRAW_CONSTCOLOR|DRAW_SCENESET);
-
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects(v3d, base);
- }
- }
- }
- }
-
- /* Transp and X-ray afterdraw stuff for sets is done later */
- }
-
- /* first not selected and duplis */
- base= G.scene->base.first;
- while(base) {
-
- if(v3d->lay & base->lay) {
- if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE);
- else {
-
- if(base->object->transflag & OB_DUPLI) {
- draw_dupli_objects(v3d, base);
- }
- else if((base->flag & SELECT)==0) {
- draw_object(base, 0);
- }
- }
- }
-
- base= base->next;
- }
-
- /* draw selected */
- base= G.scene->base.first;
- while(base) {
-
- if ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) ) {
- if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE);
- else draw_object(base, 0);
- }
-
- base= base->next;
- }
-
- if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID);
-
- /* Transp and X-ray afterdraw stuff */
- view3d_draw_transp(v3d);
- view3d_draw_xray(v3d, !shadow); // clears zbuffer if it is used!
-
- if(v3d->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
- if(v3d->zbuf) {
- v3d->zbuf= FALSE;
- glDisable(GL_DEPTH_TEST);
- }
-
- if((v3d->gpd) && (v3d->flag2 & V3D_DISPGP)) {
- /* draw grease-pencil overlays (only if enabled)
- * WARNING: view matrices are altered here!
- */
- draw_gpencil_oglrender(v3d, winx, winy);
- }
-
- G.f &= ~(G_RENDER_OGL|G_RENDER_SHADOW);
-
- if(!shadow) {
- glFlush();
- GPU_free_images();
- }
-
- glLoadIdentity();
-}
-
-
-double tottime = 0.0;
-static ScrArea *oldsa;
-static double swaptime;
-static int curmode;
-
-/* used for fps display */
-#define REDRAW_FRAME_AVERAGE 8
-static double redrawtime;
-static double lredrawtime;
-static float redrawtimes_fps[REDRAW_FRAME_AVERAGE];
-static short redrawtime_index;
-
-
-int update_time(int cfra)
-{
- static double ltime;
- double time;
-
- if ((audiostream_pos() != cfra)
- && (G.scene->audio.flag & AUDIO_SYNC)) {
- return 0;
- }
-
- time = PIL_check_seconds_timer();
-
- tottime += (time - ltime);
- ltime = time;
- return (tottime < 0.0);
-}
-
-static void draw_viewport_fps(ScrArea *sa)
-{
- float fps;
- char printable[16];
- int i, tot;
-
- if (!lredrawtime || !redrawtime)
- return;
-
- printable[0] = '\0';
-
-#if 0
- /* this is too simple, better do an average */
- fps = (float)(1.0/(lredrawtime-redrawtime))
-#else
- redrawtimes_fps[redrawtime_index] = (float)(1.0/(lredrawtime-redrawtime));
-
- for (i=0, tot=0, fps=0.0f ; i < REDRAW_FRAME_AVERAGE ; i++) {
- if (redrawtimes_fps[i]) {
- fps += redrawtimes_fps[i];
- tot++;
- }
- }
- if (tot) {
- redrawtime_index++;
- if (redrawtime_index >= REDRAW_FRAME_AVERAGE)
- redrawtime_index = 0;
-
- fps = fps / tot;
- }
-#endif
-
- /* is this more then half a frame behind? */
- if (fps+0.5 < FPS) {
- BIF_ThemeColor(TH_REDALERT);
- sprintf(printable, "fps: %.2f", (float)fps);
- } else {
- BIF_ThemeColor(TH_TEXT_HI);
- sprintf(printable, "fps: %i", (int)(fps+0.5));
- }
-
- glRasterPos2i(10, sa->winy-20);
- BMF_DrawString(G.fonts, printable);
-}
-
-static void inner_play_prefetch_frame(int mode, int cfra)
-{
- ScrArea *sa;
- int oldcfra = CFRA;
- ScrArea *oldcurarea = curarea;
-
- if (!U.prefetchframes) {
- return;
- }
-
- CFRA = cfra;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa==oldsa) {
- scrarea_do_winprefetchdraw(sa);
- }
- else if(mode & 1) { /* all view3d and seq spaces */
- if ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ) {
- scrarea_do_winprefetchdraw(sa);
- }
- }
- else if(mode & 4) { /* all seq spaces */
- if (sa->spacetype == SPACE_SEQ) {
- scrarea_do_winprefetchdraw(sa);
- }
- }
-
- sa= sa->next;
- }
-
- CFRA = oldcfra;
- curarea = oldcurarea;
-}
-
-static void inner_play_prefetch_startup(int mode)
-{
- int i;
-
- if (!U.prefetchframes) {
- return;
- }
-
- seq_start_threads();
-
- for (i = 0; i <= U.prefetchframes; i++) {
- int cfra = CFRA + i;
- inner_play_prefetch_frame(mode, cfra);
- }
-
- seq_wait_for_prefetch_ready();
-}
-
-static void inner_play_prefetch_shutdown(int mode)
-{
- if (!U.prefetchframes) {
- return;
- }
- seq_stop_threads();
-}
-
-static int cached_dynamics(int sfra, int efra)
-{
- Base *base = G.scene->base.first;
- Object *ob;
- ParticleSystem *psys;
- int i, cached=1;
- PTCacheID pid;
-
- while(base && cached) {
- ob = base->object;
- if(ob->softflag & OB_SB_ENABLE && ob->soft) {
- BKE_ptcache_id_from_softbody(&pid, ob, ob->soft);
-
- for(i=sfra; i<=efra && cached; i++)
- cached &= BKE_ptcache_id_exist(&pid, i);
- }
-
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- if(psys->part->type==PART_HAIR) {
- if(psys->softflag & OB_SB_ENABLE && psys->soft) {
- BKE_ptcache_id_from_softbody(&pid, ob, psys->soft);
-
- for(i=sfra; i<=efra && cached; i++)
- cached &= BKE_ptcache_id_exist(&pid, i);
- }
- }
- }
-
- base = base->next;
- }
-
- return cached;
-}
-void inner_play_anim_loop(int init, int mode)
-{
- ScrArea *sa;
- static int last_cfra = -1;
- static int cached = 0;
-
- /* init */
- if(init) {
- oldsa= curarea;
- swaptime= 1.0/FPS;
- tottime= 0.0;
- curmode= mode;
- last_cfra = -1;
- cached = cached_dynamics(PSFRA,PEFRA);
-
- redrawtime = 0.0;
-
- redrawtime_index = REDRAW_FRAME_AVERAGE;
- while(redrawtime_index--) {
- redrawtimes_fps[redrawtime_index] = 0.0;
- }
- redrawtime_index = 0;
- lredrawtime = 0.0;
- return;
- }
-
- if (CFRA != last_cfra) {
- int pf;
- set_timecursor(CFRA);
-
- update_for_newframe_nodraw(1); /* adds no events in UI */
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa==oldsa) {
- scrarea_do_windraw(sa);
- }
- else if(curmode & 1) { /* all view3d and seq spaces */
- if ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ) {
- scrarea_do_windraw(sa);
- }
- }
- else if(curmode & 4) { /* all seq spaces */
- if (sa->spacetype == SPACE_SEQ) {
- scrarea_do_windraw(sa);
- }
- }
-
- sa= sa->next;
- }
-
- if (last_cfra == -1) {
- last_cfra = CFRA - 1;
- }
-
- if (U.prefetchframes) {
- pf = last_cfra;
-
- if (CFRA - last_cfra >= U.prefetchframes ||
- CFRA - last_cfra < 0) {
- pf = CFRA - U.prefetchframes;
- fprintf(stderr,
- "SEQ-THREAD: Lost sync, "
- "stopping threads, "
- "back to skip mode...\n");
- seq_stop_threads();
- } else {
- while (pf < CFRA) {
- int c;
- pf++;
- c = pf + U.prefetchframes;
- if (c >= PEFRA) {
- c -= PEFRA;
- c += PSFRA;
- }
-
- inner_play_prefetch_frame(curmode, c);
- }
- }
-
- }
- }
-
- last_cfra = CFRA;
-
- /* make sure that swaptime passed by */
- tottime -= swaptime;
- while (update_time(CFRA)) {
- PIL_sleep_ms(1);
- }
-
- if (CFRA >= PEFRA) {
- if (tottime > 0.0) {
- tottime = 0.0;
- }
- CFRA = PSFRA;
- audiostream_stop();
- audiostream_start( CFRA );
- cached = cached_dynamics(PSFRA,PEFRA);
- } else {
- if (cached
- && (G.scene->audio.flag & AUDIO_SYNC)) {
- CFRA = audiostream_pos();
- } else {
- CFRA++;
- }
- if (CFRA < last_cfra) {
- fprintf(stderr,
- "SEQ-THREAD: CFRA running backwards: %d\n",
- CFRA);
- }
- }
-
-}
-
-/* play_anim: 'mode' defines where to play and if repeat is on (now bitfield):
- * - mode & 1 : All view3d and seq areas
- * - mode & 2 : No replay
- * - mode & 4 : All seq areas
- */
-int play_anim(int mode)
-{
- ScrArea *sa, *oldsa;
- int cfraont;
- unsigned short event=0;
- short val = 0; /* its possible qtest() wont run and val must be initialized */
-
- /* patch for very very old scenes */
- if(SFRA==0) SFRA= 1;
- if(EFRA==0) EFRA= 250;
-
- if(PSFRA>PEFRA) return 0;
-
- /* waitcursor(1); */
- G.f |= G_PLAYANIM; /* in sequence.c and view.c this is handled */
-
- cfraont= CFRA;
- oldsa= curarea;
-
- if (curarea && curarea->spacetype == SPACE_SEQ) {
- SpaceSeq *sseq = curarea->spacedata.first;
- if (sseq->mainb == 0) mode |= 4;
- }
-
- inner_play_prefetch_startup(mode);
-
- update_time(CFRA);
-
- inner_play_anim_loop(1, mode); /* 1==init */
-
- audiostream_start( CFRA );
-
- /* forces all buffers to be OK for current frame (otherwise other windows get redrawn with CFRA+1) */
- curarea->win_swap= WIN_BACK_OK;
- screen_swapbuffers();
-
- while(TRUE) {
-
- if (U.uiflag & USER_SHOW_FPS)
- lredrawtime = PIL_check_seconds_timer();
-
- while(qtest()) {
- /* we test events first because of MKEY event */
-
- event= extern_qread(&val);
- if(event==ESCKEY) break;
- else if(event==MIDDLEMOUSE) {
- if(U.flag & USER_VIEWMOVE) {
- if(G.qual & LR_SHIFTKEY) viewmove(0);
- else if(G.qual & LR_CTRLKEY) viewmove(2);
- else viewmove(1);
- }
- else {
- if(G.qual & LR_SHIFTKEY) viewmove(1);
- else if(G.qual & LR_CTRLKEY) viewmove(2);
- else viewmove(0);
- }
- } else if (event==WHEELDOWNMOUSE || (val && event==PADMINUS)) { /* copied from persptoetsen */
- if (G.vd) { /* when using the sequencer this can be NULL */
- /* this min and max is also in viewmove() */
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom-= 10;
- if(G.vd->camzoom<-30) G.vd->camzoom= -30;
- }
- else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f;
- }
- } else if (event==WHEELUPMOUSE || (val && event==PADPLUSKEY)) { /* copied from persptoetsen */
- if (G.vd) {
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom+= 10;
- if(G.vd->camzoom>300) G.vd->camzoom= 300;
- }
- else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f;
- }
- } else if(event==MKEY) {
- if(val) add_marker(CFRA-1);
- }
- }
- if(val && ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break;
-
- inner_play_anim_loop(0, 0);
-
-
- screen_swapbuffers();
-
- if (U.uiflag & USER_SHOW_FPS)
- redrawtime = lredrawtime;
-
- if((mode & 2) && CFRA==PEFRA) break; /* no replay */
- }
-
- if(event==SPACEKEY);
- else CFRA= cfraont;
-
- inner_play_prefetch_shutdown(mode);
- audiostream_stop();
-
- if(oldsa!=curarea) areawinset(oldsa->win);
-
- /* restore all areas */
- sa= G.curscreen->areabase.first;
- while(sa) {
- if( ((mode & 1) && sa->spacetype==SPACE_VIEW3D) || sa==curarea) addqueue(sa->win, REDRAW, 1);
- sa= sa->next;
- }
-
- /* groups could have changed ipo */
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
-
- /* restore for cfra */
- update_for_newframe_muted();
-
- waitcursor(0);
- G.f &= ~G_PLAYANIM;
-
- if (event==ESCKEY || event==SPACEKEY) return 1;
- else return 0;
-}
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c
deleted file mode 100644
index a80e7b6c360..00000000000
--- a/source/blender/src/edit.c
+++ /dev/null
@@ -1,1918 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "PIL_time.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h" /* for U.dupflag */
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_linklist.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_anim.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_editmesh.h"
-#include "BIF_editview.h"
-#include "BIF_editarmature.h"
-#include "BIF_editparticle.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_edit.h"
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editmball.h"
-#include "BDR_editcurve.h"
-
-/* old stuff */
-#include "blendef.h"
-#include "mydevice.h"
-
-/*#include "armature.h"*/
-/* #include "edit.h" */
-#include "nla.h"
-#include "transform.h"
-
-#ifdef __NLA
-#include "BIF_editarmature.h"
-#endif
-
-
-/* circle selection callback */
-typedef void (*select_CBfunc)(short selecting, Object *editobj, short *mval, float rad);
-
-extern void obedit_selectionCB(short selecting, Object *editobj,
- short *mval, float rad);
-extern void uvedit_selectionCB(short selecting, Object *editobj,
- short *mval, float rad);
-
-static void circle_selectCB(select_CBfunc func);
-
-
-/* flag==2 only border, flag==3 cross+border
- flag==5 cross + border + start&end frame
- */
-int get_border(rcti *rect, short flag)
-{
- float dvec[4], fac1, fac2;
- int retval=1;
- unsigned short event= 0;
- short mval[2], mvalo[4], val, x1, y1;
- char str[64];
-
- mywinset(G.curscreen->mainwin);
-
- /* slightly larger, 1 pixel at the edge */
- glReadBuffer(GL_FRONT);
- glDrawBuffer(GL_FRONT);
-
- /* removed my_get_frontbuffer, this crashes when it gets a part outside the screen */
- /* solved it with just a redraw! */
-
- mywinset(curarea->win);
-
- glDrawBuffer(GL_FRONT);
- persp(PERSP_WIN);
- initgrabz(0.0, 0.0, 0.0);
-
- if(flag & 1) {
- getmouseco_areawin(mvalo);
-
- /* draws the selection initial cross */
- sdrawXORline4(0, 0, mvalo[1], curarea->winx, mvalo[1]);
- sdrawXORline4(1, mvalo[0], 0, mvalo[0], curarea->winy);
- bglFlush();
-
- while(TRUE) {
-
- /* selection loop while mouse pressed */
- getmouseco_areawin(mval);
-
- if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) {
-
- /* aiming cross */
- sdrawXORline4(0, 0, mval[1], curarea->winx, mval[1]);
- sdrawXORline4(1, mval[0], 0, mval[0], curarea->winy);
- bglFlush();
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
- event= extern_qread(&val);
-
- if(event && val) {
-
- /* for when a renderwindow is open, and a mouse cursor activates it */
- persp(PERSP_VIEW);
- mywinset(curarea->win);
- persp(PERSP_WIN);
-
- if(event==ESCKEY) {
- retval= 0;
- break;
- }
- else if(event==BKEY) {
- /* b has been pressed twice: proceed with circle select */
- retval= 0;
- break;
- }
- else if(event==LEFTMOUSE) break;
- else if(event==MIDDLEMOUSE) break;
- else if(event==RIGHTMOUSE) break;
- }
- else PIL_sleep_ms(10);
-
- } /* end while (TRUE) */
-
- /* erase XORed lines */
- sdrawXORline4(-1, 0, 0, 0, 0);
- }
- else getmouseco_areawin(mval);
-
- if(retval) {
- /* box select */
- x1= mval[0];
- y1= mval[1];
-
- getmouseco_areawin(mvalo);
-
- sdrawXORline4(0, x1, y1, x1, mvalo[1]);
- sdrawXORline4(1, x1, mvalo[1], mvalo[0], mvalo[1]);
- sdrawXORline4(2, mvalo[0], mvalo[1], mvalo[0], y1);
- sdrawXORline4(3, mvalo[0], y1, x1, y1);
- bglFlush();
-
- while(TRUE) {
- getmouseco_areawin(mval);
- if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) {
-
- sdrawXORline4(0, x1, y1, x1, mval[1]);
- sdrawXORline4(1, x1, mval[1], mval[0], mval[1]);
- sdrawXORline4(2, mval[0], mval[1], mval[0], y1);
- sdrawXORline4(3, mval[0], y1, x1, y1);
-
- /* draw size information in corner */
- if(curarea->spacetype==SPACE_VIEW3D) {
- BIF_ThemeColor(TH_BACK);
- glRecti(10, 25, 250, 40);
-
- if(G.vd->persp==V3D_ORTHO) {
- window_to_3d(dvec, mvalo[0]-x1, mvalo[1]-y1);
-
- sprintf(str, "X %.4f Y %.4f Z %.4f Dia %.4f", dvec[0], dvec[1], dvec[2], sqrt(dvec[0]*dvec[0]+dvec[1]*dvec[1]+dvec[2]*dvec[2]));
- glColor3f(0.0, 0.0, 0.0);
- glRasterPos2i(15, 27);
- BMF_DrawString(G.fonts, str);
- glColor3f(0.7, 0.7, 0.7);
- glRasterPos2i(16, 28);
- BMF_DrawString(G.fonts, str);
- }
- else if(G.vd->persp==V3D_CAMOB) {
- rctf vb;
-
- calc_viewborder(G.vd, &vb);
-
- fac1= (mvalo[0]-x1)/( (float) (vb.xmax-vb.xmin) );
- fac1*= 0.01*G.scene->r.size*G.scene->r.xsch;
-
- fac2= (mvalo[1]-y1)/( (float) (vb.ymax-vb.ymin) );
- fac2*= 0.01*G.scene->r.size*G.scene->r.ysch;
-
- sprintf(str, "X %.1f Y %.1f Dia %.1f", fabs(fac1), fabs(fac2), sqrt(fac1*fac1 + fac2*fac2) );
- glColor3f(0.0, 0.0, 0.0);
- glRasterPos2i(15, 27);
- BMF_DrawString(G.fonts, str);
- glColor3f(0.7, 0.7, 0.7);
- glRasterPos2i(16, 28);
- BMF_DrawString(G.fonts, str);
- }
- }
- else if(curarea->spacetype==SPACE_IPO) {
- SpaceIpo *sipo= curarea->spacedata.first;
-
- BIF_ThemeColor(TH_BACK);
- glRecti(20, 30, 170, 40);
-
- mvalo[2]= x1;
- mvalo[3]= y1;
- areamouseco_to_ipoco(&sipo->v2d, mval, dvec, dvec+1);
- areamouseco_to_ipoco(&sipo->v2d, mvalo+2, dvec+2, dvec+3);
-
- if (flag == 5) {
- /* setting preview range */
- if (dvec[0] < dvec[2])
- sprintf(str, "Preview Range: %d to %d", (int)dvec[0], (int)dvec[2]);
- else
- sprintf(str, "Preview Range: %d to %d", (int)dvec[2], (int)dvec[0]);
- }
- else
- sprintf(str, "Time: %.4f Y %.4f", dvec[0]-dvec[2], dvec[1]-dvec[3]);
-
- BIF_ThemeColor(TH_BACK);
- glRecti(14, 24, 165, 38);
-
- glColor3f(0.0, 0.0, 0.0);
- glRasterPos2i(15, 27);
- BMF_DrawString(G.fonts, str);
- glColor3f(0.8, 0.8, 0.8);
- glRasterPos2i(16, 28);
- BMF_DrawString(G.fonts, str);
- }
- else if ((ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME)) && flag==5) {
- /* only while setting preview range */
- View2D *v2d;
-
- switch (curarea->spacetype)
- {
- case SPACE_ACTION:
- {
- SpaceAction *saaction= curarea->spacedata.first;
- v2d= &saaction->v2d;
- }
- break;
- case SPACE_NLA:
- {
- SpaceNla *snla= curarea->spacedata.first;
- v2d= &snla->v2d;
- }
- break;
- default:
- v2d= G.v2d;
- break;
- }
-
- mvalo[2]= x1;
- mvalo[3]= y1;
- areamouseco_to_ipoco(v2d, mval, dvec, dvec+1);
- areamouseco_to_ipoco(v2d, mvalo+2, dvec+2, dvec+3);
-
- if (dvec[0] < dvec[2])
- sprintf(str, "Preview Range: %d to %d", (int)dvec[0], (int)dvec[2]);
- else
- sprintf(str, "Preview Range: %d to %d", (int)dvec[2], (int)dvec[0]);
-
- BIF_ThemeColor(TH_BACK);
- glRecti(14, 24, 165, 38);
-
- glColor3f(0.0, 0.0, 0.0);
- glRasterPos2i(15, 27);
- BMF_DrawString(G.fonts, str);
- glColor3f(0.8, 0.8, 0.8);
- glRasterPos2i(16, 28);
- BMF_DrawString(G.fonts, str);
- }
-
- bglFlush();
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
-
- event= extern_qread(&val);
-
- if(event && val==0) {
- /* still because of the renderwindow... */
- persp(PERSP_VIEW);
- mywinset(curarea->win);
- persp(PERSP_WIN);
-
- if(event==ESCKEY) {
- retval= 0;
- break;
- }
- else if(event==LEFTMOUSE) break;
- else if(event==MIDDLEMOUSE) break;
- else if(event==RIGHTMOUSE) break;
- }
-
- } /* end while (TRUE) */
- sdrawXORline4(-1, 0, 0, 0, 0);
-
- if(retval) {
- rect->xmin= x1;
- rect->ymin= y1;
- rect->xmax= mval[0];
- rect->ymax= mval[1];
- retval= event;
-
- /* normalize */
- if(rect->xmin>rect->xmax) SWAP(int, rect->xmin, rect->xmax);
- if(rect->ymin>rect->ymax) SWAP(int, rect->ymin, rect->ymax);
-
- if(rect->xmin==rect->xmax) retval= 0;
- if(rect->ymin==rect->ymax) retval= 0;
- }
- }
-
-
- /* clear */
- if(event!=BKEY) {
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_IPO) {
- scrarea_queue_winredraw(curarea);
- }
- else if ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME) {
- scrarea_queue_winredraw(curarea); // only really needed for
- }
- }
-
- bglFlush();
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
-
- persp(PERSP_VIEW);
-
- /* pressed B again ? -> brush select */
- if(event==BKEY) {
- setlinestyle(0);
- switch (curarea->spacetype) {
- case SPACE_VIEW3D:
- if (G.obedit) {
- if ELEM4(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) {
- circle_selectCB(&obedit_selectionCB);
- }
- }
- else if (FACESEL_PAINT_TEST) {
- circle_selectCB(&obedit_selectionCB);
- }
- else if (G.f&G_PARTICLEEDIT) {
- circle_selectCB(&PE_selectionCB);
- }
- return 0;
-
- case SPACE_IMAGE: // brush select in UV editor
- circle_selectCB(&uvedit_selectionCB);
- // this is a hack; we return 0 that the caller from get_border
- // doesn't execute the selection code for border select..
- return 0;
- }
- }
- return retval;
-}
-
-void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selecting)
-{
- static short no_mvalo=0;
-
- if(mval==NULL && mvalo==NULL) { /* signal */
- no_mvalo= 1;
- return;
- }
-
- persp(PERSP_WIN);
- glReadBuffer(GL_FRONT);
- glDrawBuffer(GL_FRONT);
- //setlinestyle(2);
-
- /* draw circle */
- if(mvalo && no_mvalo==0) {
- fdrawXORcirc(mvalo[0], mvalo[1], rado);
- }
-
- if(mval) {
- fdrawXORcirc(mval[0], mval[1], rad);
- }
- //setlinestyle(0);
-
- bglFlush();
- persp(PERSP_VIEW);
- glDrawBuffer(GL_BACK);
- glReadBuffer(GL_BACK);
-
- no_mvalo= 0;
-}
-
-/** This function does the same as editview.c:circle_select(),
- * but the selection actions are defined by a callback, making
- * it (hopefully) reusable for other windows than the 3D view.
- */
-
-static void circle_selectCB(select_CBfunc callback)
-{
- static float rad= 40.0;
- float rado= rad;
- int firsttime=1;
- int escape= 0;
- unsigned short event;
- short mvalo[2], mval[2], val;
- short selecting=0;
- Object *obj;
-
- if(G.obedit) obj = G.obedit;
- else obj = OBACT;
-
- mywinset(curarea->win);
-
- getmouseco_areawin(mvalo);
- mval[0]= mvalo[0]; mval[1]= mvalo[1];
-
- draw_sel_circle(mval, NULL, rad, 0.0, selecting); // draws frontbuffer, but sets backbuf again
-
- while(TRUE) {
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || rado!=rad || firsttime) {
- firsttime= 0;
-
- if(selecting) {
- callback(selecting, obj, mval, rad);
- }
-
- draw_sel_circle(mval, mvalo, rad, rado, selecting);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- rado= rad;
-
- }
-
- while(qtest()) {
- event= extern_qread(&val);
- if (event) {
-
- /* for when another window is open and a mouse cursor activates it */
- if(event!=MOUSEY && event!=MOUSEX) mywinset(curarea->win);
-
- getmouseco_areawin(mval); // important to do here, trust events!
-
- switch(event) {
-
- case LEFTMOUSE:
- case MIDDLEMOUSE:
- if(val) selecting= event;
- else selecting= 0;
- firsttime= 1;
-
- break;
- case PAGEUPKEY:
- case WHEELDOWNMOUSE:
- case PADPLUSKEY:
- case EQUALKEY:
- if(val) if(rad<200.0) rad*= 1.2;
- break;
- case PAGEDOWNKEY:
- case WHEELUPMOUSE:
- case PADMINUS:
- case MINUSKEY:
- if(val) if(rad>5.0) rad/= 1.2;
- break;
-
- case ESCKEY: case SPACEKEY: case RIGHTMOUSE: case INPUTCHANGE:
- case GKEY: case SKEY: case RKEY: case XKEY: case EKEY: case TABKEY:
- escape= 1;
- break;
-
- }
-
- if(escape) break;
- }
- }
- PIL_sleep_ms(10);
-
- if(escape) break;
- }
-
- /* clear circle */
- draw_sel_circle(NULL, mvalo, 0, rad, 1);
- BIF_undo_push("Circle Select");
- countall();
- allqueue(REDRAWINFO, 0);
-}
-
-static void count_object(Object *ob, int sel, int totob)
-{
- Mesh *me;
- Curve *cu;
- DerivedMesh *dm;
- int tot=0, totf=0;
-
- switch(ob->type) {
- case OB_MESH:
- G.totmesh+=totob;
- me= get_mesh(ob);
- if(me) {
- int totvert, totedge, totface;
- dm = mesh_get_derived_final(ob, get_viewedit_datamask());
- totvert = dm->getNumVerts(dm);
- totedge = dm->getNumEdges(dm);
- totface = dm->getNumFaces(dm);
-
- G.totvert+= totvert*totob;
- G.totedge+= totedge*totob;
- G.totface+= totface*totob;
- if(sel) {
- G.totvertsel+= totvert;
- G.totfacesel+= totface;
- }
- }
- break;
-
- case OB_LAMP:
- G.totlamp+=totob;
- break;
- case OB_SURF:
- case OB_CURVE:
- case OB_FONT:
- G.totcurve+=totob;
- tot=totf= 0;
- cu= ob->data;
- if(cu->disp.first)
- count_displist( &cu->disp, &tot, &totf);
- tot*= totob;
- totf*= totob;
- G.totvert+= tot;
- G.totface+= totf;
- if(sel) {
- G.totvertsel+= tot;
- G.totfacesel+= totf;
- }
- break;
- case OB_MBALL:
- count_displist( &ob->disp, &tot, &totf);
- tot*= totob;
- totf*= totob;
- G.totvert+= tot;
- G.totface+= totf;
- if(sel) {
- G.totvertsel+= tot;
- G.totfacesel+= totf;
- }
- break;
- }
-
-}
-
-/* countall does statistics */
-/* is called on most actions, like select/add/delete/layermove */
-void countall()
-{
- extern ListBase editNurb;
- Base *base;
- Object *ob= OBACT;
- Mesh *me;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- MetaElem *ml;
- struct EditBone *ebo;
- int a;
-
- G.totvert= G.totvertsel= G.totedge= G.totedgesel= G.totfacesel= G.totface= G.totobj=
- G.totmesh= G.totlamp= G.totcurve= G.totobjsel= G.totbone= G.totbonesel= 0;
-
- if(G.obedit) {
-
- if(G.obedit->type==OB_MESH) {
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- G.totvert++;
- if(eve->f & SELECT) G.totvertsel++;
- }
- for(eed= em->edges.first; eed; eed= eed->next) {
- G.totedge++;
- if(eed->f & SELECT) G.totedgesel++;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- G.totface++;
- if(efa->f & SELECT) G.totfacesel++;
- }
-
- EM_validate_selections();
- }
- else if (G.obedit->type==OB_ARMATURE){
- for (ebo=G.edbo.first;ebo;ebo=ebo->next){
- G.totbone++;
-
- /* Sync selection to parent for connected children */
- if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
- G.totvert--;
- if (ebo->parent->flag & BONE_TIPSEL)
- ebo->flag |= BONE_ROOTSEL;
- else
- ebo->flag &= ~BONE_ROOTSEL;
- }
-
- if (ebo->flag & BONE_TIPSEL)
- G.totvertsel++;
- if (ebo->flag & BONE_ROOTSEL)
- G.totvertsel++;
-
- if ((ebo->flag & BONE_TIPSEL) && (ebo->flag & BONE_ROOTSEL))
- ebo->flag |= BONE_SELECTED;
- else
- ebo->flag &= ~BONE_SELECTED;
-
- if(ebo->flag & BONE_SELECTED) G.totbonesel++;
-
- // If this is a connected child and it's parent is being moved, remove our root
- if ((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL)){
- G.totvertsel--;
- }
-
- G.totvert+=2;
- }
- }
- else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT) {
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- G.totvert+=3;
- if(bezt->f1) G.totvertsel++;
- if(bezt->f2) G.totvertsel++;
- if(bezt->f3) G.totvertsel++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- G.totvert++;
- if(bp->f1 & SELECT) G.totvertsel++;
- bp++;
- }
- }
- nu= nu->next;
- }
- }
- else if(G.obedit->type==OB_MBALL) {
- /* editmball.c */
- extern ListBase editelems; /* go away ! */
-
- ml= editelems.first;
- while(ml) {
- G.totvert++;
- if(ml->flag & SELECT) G.totvertsel++;
- ml= ml->next;
- }
- }
- else if(G.obedit->type==OB_LATTICE) {
- bp= editLatt->def;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- while(a--) {
- G.totvert++;
- if(bp->f1 & SELECT) G.totvertsel++;
- bp++;
- }
- }
-
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
- return;
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- if(ob->pose) {
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- G.totbone++;
- if(pchan->bone && (pchan->bone->flag & BONE_SELECTED))
- if(pchan->bone->layer & arm->layer)
- G.totbonesel++;
- }
- }
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
- return;
- }
- else if(FACESEL_PAINT_TEST) {
- me= get_mesh((G.scene->basact) ? (G.scene->basact->object) : 0);
- if(me) {
- G.totface= me->totface;
- G.totvert= me->totvert;
- }
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
- return;
- }
-
- if(G.scene==NULL) return;
-
- base= (G.scene->base.first);
- while(base) {
- if(G.scene->lay & base->lay) {
- ob= base->object; /* warning, ob not is obact anymore */
-
- if(base->flag & SELECT) G.totobjsel++;
-
- if(ob->transflag & OB_DUPLIPARTS) {
- ParticleSystem *psys;
- ParticleSettings *part;
- int step_nbr;
-
- for(psys=ob->particlesystem.first; psys; psys=psys->next){
- part=psys->part;
-
- //if(psys->flag&PSYS_BAKED && part->draw&PART_DRAW_KEYS)
- // step_nbr=part->keys_step;
- //else
- step_nbr=1;
-
- if(part->draw_as==PART_DRAW_OB && part->dup_ob){
- int tot=count_particles(psys);
- count_object(part->dup_ob, 0, tot*step_nbr);
- }
- else if(part->draw_as==PART_DRAW_GR && part->dup_group){
- GroupObject *go;
- int tot, totgroup=0, cur=0;
-
- go= part->dup_group->gobject.first;
- while(go){
- go=go->next;
- totgroup++;
- }
- go= part->dup_group->gobject.first;
- while(go){
- tot=count_particles_mod(psys,totgroup,cur);
- count_object(go->ob, 0, tot*step_nbr);
- cur++;
- go=go->next;
- }
- }
- }
-
- count_object(ob, base->flag & SELECT, 1);
- G.totobj++;
- }
- else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) {
- int tot= count_duplilist(ob->parent);
- G.totobj+=tot;
- count_object(ob, base->flag & SELECT, tot);
- }
- else if(ob->transflag & OB_DUPLIFRAMES) {
- int tot= count_duplilist(ob);
- G.totobj+=tot;
- count_object(ob, base->flag & SELECT, tot);
- }
- else if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
- int tot= count_duplilist(ob);
- G.totobj+=tot;
- count_object(ob, base->flag & SELECT, tot);
- }
- else {
- count_object(ob, base->flag & SELECT, 1);
- G.totobj++;
- }
- }
- base= base->next;
- }
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-}
-
-/* ************************************************** */
-/* ********************* old transform stuff ******** */
-/* ************************************************** */
-
-static TransVert *transvmain=NULL;
-static int tottrans= 0;
-
-/* copied from editobject.c, now uses (almost) proper depgraph */
-static void special_transvert_update(void)
-{
-
- if(G.obedit) {
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- if(G.obedit->type==OB_MESH) {
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
-#endif
- recalc_editnormals(); // does face centers too
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- extern ListBase editNurb;
- Nurb *nu= editNurb.first;
- while(nu) {
- test2DNurb(nu);
- testhandlesNurb(nu); /* test for bezier too */
- nu= nu->next;
- }
- }
- else if(G.obedit->type==OB_ARMATURE){
- bArmature *arm= G.obedit->data;
- EditBone *ebo;
- TransVert *tv= transvmain;
- int a=0;
-
- /* Ensure all bone tails are correctly adjusted */
- for (ebo=G.edbo.first; ebo; ebo=ebo->next) {
- /* adjust tip if both ends selected */
- if ((ebo->flag & BONE_ROOTSEL) && (ebo->flag & BONE_TIPSEL)) {
- if (tv) {
- float diffvec[3];
-
- VecSubf(diffvec, tv->loc, tv->oldloc);
- VecAddf(ebo->tail, ebo->tail, diffvec);
-
- a++;
- if (a<tottrans) tv++;
- }
- }
- }
-
- /* Ensure all bones are correctly adjusted */
- for (ebo=G.edbo.first; ebo; ebo=ebo->next) {
- if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
- /* If this bone has a parent tip that has been moved */
- if (ebo->parent->flag & BONE_TIPSEL){
- VECCOPY (ebo->head, ebo->parent->tail);
- }
- /* If this bone has a parent tip that has NOT been moved */
- else{
- VECCOPY (ebo->parent->tail, ebo->head);
- }
- }
- }
- if(arm->flag & ARM_MIRROR_EDIT)
- transform_armature_mirror_update();
- }
- else if(G.obedit->type==OB_LATTICE) {
- if(editLatt->flag & LT_OUTSIDE) outside_lattice(editLatt);
- }
- }
-}
-
-/* copied from editobject.c, needs to be replaced with new transform code still */
-/* mode: 1 = proportional, 2 = all joints (for bones only) */
-static void make_trans_verts(float *min, float *max, int mode)
-{
- extern ListBase editNurb;
- EditMesh *em = G.editMesh;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- TransVert *tv=NULL;
- MetaElem *ml;
- EditVert *eve;
- EditBone *ebo;
- float total, center[3], centroid[3];
- int a;
-
- tottrans= 0; // global!
-
- INIT_MINMAX(min, max);
- centroid[0]=centroid[1]=centroid[2]= 0.0;
-
- /* note for transform refactor: dont rely on countall anymore... its ancient */
- /* I skip it for editmesh now (ton) */
- if(G.obedit->type!=OB_MESH) {
- countall();
- if(mode) tottrans= G.totvert;
- else tottrans= G.totvertsel;
-
- if(G.totvertsel==0) {
- tottrans= 0;
- return;
- }
- tv=transvmain= MEM_callocN(tottrans*sizeof(TransVert), "maketransverts");
- }
-
- /* we count again because of hide (old, not for mesh!) */
- tottrans= 0;
-
- if(G.obedit->type==OB_MESH) {
- int proptrans= 0;
-
- // transform now requires awareness for select mode, so we tag the f1 flags in verts
- tottrans= 0;
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0 && (eve->f & SELECT)) {
- eve->f1= SELECT;
- tottrans++;
- }
- else eve->f1= 0;
- }
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- EditEdge *eed;
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0 && (eed->f & SELECT)) eed->v1->f1= eed->v2->f1= SELECT;
- }
- for(eve= em->verts.first; eve; eve= eve->next) if(eve->f1) tottrans++;
- }
- else {
- EditFace *efa;
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0 && (efa->f & SELECT)) {
- efa->v1->f1= efa->v2->f1= efa->v3->f1= SELECT;
- if(efa->v4) efa->v4->f1= SELECT;
- }
- }
- for(eve= em->verts.first; eve; eve= eve->next) if(eve->f1) tottrans++;
- }
-
- /* proportional edit exception... */
- if((mode & 1) && tottrans) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0) {
- eve->f1 |= 2;
- proptrans++;
- }
- }
- if(proptrans>tottrans) tottrans= proptrans;
- }
-
- /* and now make transverts */
- if(tottrans) {
- tv=transvmain= MEM_callocN(tottrans*sizeof(TransVert), "maketransverts");
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f1) {
- VECCOPY(tv->oldloc, eve->co);
- tv->loc= eve->co;
- if(eve->no[0]!=0.0 || eve->no[1]!=0.0 ||eve->no[2]!=0.0)
- tv->nor= eve->no; // note this is a hackish signal (ton)
- tv->flag= eve->f1 & SELECT;
- tv++;
- }
- }
- }
- }
- else if (G.obedit->type==OB_ARMATURE){
- bArmature *arm= G.obedit->data;
-
- for (ebo=G.edbo.first;ebo;ebo=ebo->next){
- if(ebo->layer & arm->layer) {
- short tipsel= (ebo->flag & BONE_TIPSEL);
- short rootsel= (ebo->flag & BONE_ROOTSEL);
- short rootok= (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && ebo->parent->flag & BONE_TIPSEL));
-
- if ((tipsel && rootsel) || (rootsel)) {
- /* Don't add the tip (unless mode & 2, for getting all joints),
- * otherwise we get zero-length bones as tips will snap to the same
- * location as heads.
- */
- if (rootok) {
- VECCOPY (tv->oldloc, ebo->head);
- tv->loc= ebo->head;
- tv->nor= NULL;
- tv->flag= 1;
- tv++;
- tottrans++;
- }
-
- if ((mode & 2) && (tipsel)) {
- VECCOPY (tv->oldloc, ebo->tail);
- tv->loc= ebo->tail;
- tv->nor= NULL;
- tv->flag= 1;
- tv++;
- tottrans++;
- }
- }
- else if (tipsel) {
- VECCOPY (tv->oldloc, ebo->tail);
- tv->loc= ebo->tail;
- tv->nor= NULL;
- tv->flag= 1;
- tv++;
- tottrans++;
- }
- }
- }
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if((mode & 1) || (bezt->f1 & SELECT)) {
- VECCOPY(tv->oldloc, bezt->vec[0]);
- tv->loc= bezt->vec[0];
- tv->flag= bezt->f1 & SELECT;
- tv++;
- tottrans++;
- }
- if((mode & 1) || (bezt->f2 & SELECT)) {
- VECCOPY(tv->oldloc, bezt->vec[1]);
- tv->loc= bezt->vec[1];
- tv->val= &(bezt->alfa);
- tv->oldval= bezt->alfa;
- tv->flag= bezt->f2 & SELECT;
- tv++;
- tottrans++;
- }
- if((mode & 1) || (bezt->f3 & SELECT)) {
- VECCOPY(tv->oldloc, bezt->vec[2]);
- tv->loc= bezt->vec[2];
- tv->flag= bezt->f3 & SELECT;
- tv++;
- tottrans++;
- }
- }
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->hide==0) {
- if((mode & 1) || (bp->f1 & SELECT)) {
- VECCOPY(tv->oldloc, bp->vec);
- tv->loc= bp->vec;
- tv->val= &(bp->alfa);
- tv->oldval= bp->alfa;
- tv->flag= bp->f1 & SELECT;
- tv++;
- tottrans++;
- }
- }
- bp++;
- }
- }
- nu= nu->next;
- }
- }
- else if(G.obedit->type==OB_MBALL) {
- extern ListBase editelems; /* go away ! */
- ml= editelems.first;
- while(ml) {
- if(ml->flag & SELECT) {
- tv->loc= &ml->x;
- VECCOPY(tv->oldloc, tv->loc);
- tv->val= &(ml->rad);
- tv->oldval= ml->rad;
- tv->flag= 1;
- tv++;
- tottrans++;
- }
- ml= ml->next;
- }
- }
- else if(G.obedit->type==OB_LATTICE) {
- bp= editLatt->def;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- while(a--) {
- if((mode & 1) || (bp->f1 & SELECT)) {
- if(bp->hide==0) {
- VECCOPY(tv->oldloc, bp->vec);
- tv->loc= bp->vec;
- tv->flag= bp->f1 & SELECT;
- tv++;
- tottrans++;
- }
- }
- bp++;
- }
- }
-
- /* cent etc */
- tv= transvmain;
- total= 0.0;
- for(a=0; a<tottrans; a++, tv++) {
- if(tv->flag & SELECT) {
- centroid[0]+= tv->oldloc[0];
- centroid[1]+= tv->oldloc[1];
- centroid[2]+= tv->oldloc[2];
- total+= 1.0;
- DO_MINMAX(tv->oldloc, min, max);
- }
- }
- if(total!=0.0) {
- centroid[0]/= total;
- centroid[1]/= total;
- centroid[2]/= total;
- }
-
- center[0]= (min[0]+max[0])/2.0;
- center[1]= (min[1]+max[1])/2.0;
- center[2]= (min[2]+max[2])/2.0;
-
-}
-
-void snap_sel_to_grid()
-{
- extern float originmat[3][3]; /* object.c */
- TransVert *tv;
- Base *base;
- Object *ob;
- float gridf, imat[3][3], bmat[3][3], vec[3];
- int a;
-
- gridf= G.vd->gridview;
-
-
- if(G.obedit) {
- tottrans= 0;
-
- if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(bmat[0], bmat[1], 0);
- if(tottrans==0) return;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat, bmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
-
- VECCOPY(vec, tv->loc);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, G.obedit->obmat[3]);
- vec[0]= G.vd->gridview*floor(.5+ vec[0]/gridf);
- vec[1]= G.vd->gridview*floor(.5+ vec[1]/gridf);
- vec[2]= G.vd->gridview*floor(.5+ vec[2]/gridf);
- VecSubf(vec, vec, G.obedit->obmat[3]);
-
- Mat3MulVecfl(imat, vec);
- VECCOPY(tv->loc, vec);
-
- }
-
- special_transvert_update();
-
- MEM_freeN(transvmain);
- transvmain= 0;
-
- allqueue(REDRAWVIEW3D, 0);
- return;
- }
-
- base= (G.scene->base.first);
- while(base) {
- if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) {
- ob= base->object;
- if(ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone->flag & BONE_SELECTED) {
- if(pchan->bone->layer & arm->layer) {
- if((pchan->bone->flag & BONE_CONNECTED)==0) {
- float vecN[3], nLoc[3];
-
- /* get nearest grid point to snap to */
- VECCOPY(nLoc, pchan->pose_mat[3]);
- vec[0]= gridf * (float)(floor(.5+ nLoc[0]/gridf));
- vec[1]= gridf * (float)(floor(.5+ nLoc[1]/gridf));
- vec[2]= gridf * (float)(floor(.5+ nLoc[2]/gridf));
-
- /* get bone-space location of grid point */
- armature_loc_pose_to_bone(pchan, vec, vecN);
-
- /* adjust location */
- VECCOPY(pchan->loc, vecN);
- }
- /* if the bone has a parent and is connected to the parent,
- * don't do anything - will break chain unless we do auto-ik.
- */
- }
- }
- }
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
-
- /* auto-keyframing */
- autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else {
- ob->recalc |= OB_RECALC_OB;
-
- vec[0]= -ob->obmat[3][0]+G.vd->gridview*floor(.5+ ob->obmat[3][0]/gridf);
- vec[1]= -ob->obmat[3][1]+G.vd->gridview*floor(.5+ ob->obmat[3][1]/gridf);
- vec[2]= -ob->obmat[3][2]+G.vd->gridview*floor(.5+ ob->obmat[3][2]/gridf);
-
- if(ob->parent) {
- where_is_object(ob);
-
- Mat3Inv(imat, originmat);
- Mat3MulVecfl(imat, vec);
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
- else {
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
-#ifdef WITH_VERSE
- if(ob->vnode) b_verse_send_transformation(ob);
-#endif
-
- /* auto-keyframing */
- autokeyframe_ob_cb_func(ob, TFM_TRANSLATION);
- }
- }
-
- base= base->next;
- }
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void snap_sel_to_curs()
-{
- extern float originmat[3][3]; /* object.c */
- TransVert *tv;
- Base *base;
- Object *ob;
- float *curs, imat[3][3], bmat[3][3], vec[3];
- int a;
-
- curs= give_cursor();
-
- if(G.obedit) {
- tottrans= 0;
-
- if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(bmat[0], bmat[1], 0);
- if(tottrans==0) return;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat, bmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
- vec[0]= curs[0]-G.obedit->obmat[3][0];
- vec[1]= curs[1]-G.obedit->obmat[3][1];
- vec[2]= curs[2]-G.obedit->obmat[3][2];
-
- Mat3MulVecfl(imat, vec);
- VECCOPY(tv->loc, vec);
- }
-
- special_transvert_update();
-
- MEM_freeN(transvmain);
- transvmain= 0;
-
- allqueue(REDRAWVIEW3D, 0);
- return;
- }
-
- base= (G.scene->base.first);
- while(base) {
- if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) {
- ob= base->object;
- if(ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
- float cursp[3];
-
- Mat4Invert(ob->imat, ob->obmat);
- VECCOPY(cursp, curs);
- Mat4MulVecfl(ob->imat, cursp);
-
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if(pchan->bone->flag & BONE_SELECTED) {
- if(pchan->bone->layer & arm->layer) {
- if((pchan->bone->flag & BONE_CONNECTED)==0) {
- float curspn[3];
-
- /* get location of cursor in bone-space */
- armature_loc_pose_to_bone(pchan, cursp, curspn);
-
- /* calculate new position */
- VECCOPY(pchan->loc, curspn);
- }
- /* if the bone has a parent and is connected to the parent,
- * don't do anything - will break chain unless we do auto-ik.
- */
- }
- }
- }
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
-
- /* auto-keyframing */
- autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else {
- ob->recalc |= OB_RECALC_OB;
-
- vec[0]= -ob->obmat[3][0] + curs[0];
- vec[1]= -ob->obmat[3][1] + curs[1];
- vec[2]= -ob->obmat[3][2] + curs[2];
-
- if(ob->parent) {
- where_is_object(ob);
-
- Mat3Inv(imat, originmat);
- Mat3MulVecfl(imat, vec);
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
- else {
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
-#ifdef WITH_VERSE
- if(ob->vnode) b_verse_send_transformation(ob);
-#endif
-
- /* auto-keyframing */
- autokeyframe_ob_cb_func(ob, TFM_TRANSLATION);
- }
- }
-
- base= base->next;
- }
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void snap_curs_to_grid()
-{
- float gridf, *curs;
-
- gridf= G.vd->gridview;
- curs= give_cursor();
-
- curs[0]= G.vd->gridview*floor(.5+curs[0]/gridf);
- curs[1]= G.vd->gridview*floor(.5+curs[1]/gridf);
- curs[2]= G.vd->gridview*floor(.5+curs[2]/gridf);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void snap_curs_to_sel()
-{
- TransVert *tv;
- Base *base;
- float *curs, bmat[3][3], vec[3], min[3], max[3], centroid[3];
- int count, a;
-
- curs= give_cursor();
-
- count= 0;
- INIT_MINMAX(min, max);
- centroid[0]= centroid[1]= centroid[2]= 0.0;
-
- if(G.obedit) {
- tottrans=0;
-
- if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(bmat[0], bmat[1], 2);
- if(tottrans==0) return;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, G.obedit->obmat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- }
-
- if(G.vd->around==V3D_CENTROID) {
- VecMulf(centroid, 1.0/(float)tottrans);
- VECCOPY(curs, centroid);
- }
- else {
- curs[0]= (min[0]+max[0])/2;
- curs[1]= (min[1]+max[1])/2;
- curs[2]= (min[2]+max[2])/2;
- }
- MEM_freeN(transvmain);
- transvmain= 0;
- }
- else {
- Object *ob= OBACT;
-
- if(ob && (ob->flag & OB_POSEMODE)) {
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & BONE_SELECTED) {
- VECCOPY(vec, pchan->pose_head);
- Mat4MulVecfl(ob->obmat, vec);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- count++;
- }
- }
- }
- }
- else {
- for(base= G.scene->base.first; base; base= base->next) {
- if(((base)->flag & SELECT) && ((base)->lay & G.vd->lay) ) {
- VECCOPY(vec, base->object->obmat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- count++;
- }
- }
- }
- if(count) {
- if(G.vd->around==V3D_CENTROID) {
- VecMulf(centroid, 1.0/(float)count);
- VECCOPY(curs, centroid);
- }
- else {
- curs[0]= (min[0]+max[0])/2;
- curs[1]= (min[1]+max[1])/2;
- curs[2]= (min[2]+max[2])/2;
- }
- }
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void snap_curs_to_active()
-{
- float *curs;
- curs = give_cursor();
-
- if (G.obedit)
- {
- if (G.obedit->type == OB_MESH)
- {
- /* check active */
- EditSelection ese;
- if (EM_get_actSelection(&ese)) {
- EM_editselection_center(curs, &ese);
- }
-
- Mat4MulVecfl(G.obedit->obmat, curs);
- }
- }
- else
- {
- if (BASACT)
- {
- VECCOPY(curs, BASACT->object->obmat[3]);
- }
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-void snap_to_center()
-{
- extern float originmat[3][3];
- TransVert *tv;
- Base *base;
- Object *ob;
- float snaploc[3], imat[3][3], bmat[3][3], vec[3], min[3], max[3], centroid[3];
- int count, a;
-
- /*calculate the snaplocation (centerpoint) */
- count= 0;
- INIT_MINMAX(min, max);
- centroid[0]= centroid[1]= centroid[2]= 0.0f;
- snaploc[0]= snaploc[1]= snaploc[2]= 0.0f;
-
- if(G.obedit) {
- tottrans= 0;
-
- if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(bmat[0], bmat[1], 0);
- if(tottrans==0) return;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat, bmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, G.obedit->obmat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- }
-
- if(G.vd->around==V3D_CENTROID) {
- VecMulf(centroid, 1.0/(float)tottrans);
- VECCOPY(snaploc, centroid);
- }
- else {
- snaploc[0]= (min[0]+max[0])/2;
- snaploc[1]= (min[1]+max[1])/2;
- snaploc[2]= (min[2]+max[2])/2;
- }
-
- MEM_freeN(transvmain);
- transvmain= 0;
- }
- else {
- base= (G.scene->base.first);
- while(base) {
- if(((base)->flag & SELECT) && ((base)->lay & G.vd->lay) ) {
- ob= base->object;
- if(ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
-
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if(pchan->bone->flag & BONE_SELECTED) {
- if(pchan->bone->layer & arm->layer) {
- VECCOPY(vec, pchan->pose_mat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- count++;
- }
- }
- }
- }
- else {
- /* not armature bones (i.e. objects) */
- VECCOPY(vec, base->object->obmat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- count++;
- }
- }
- base= base->next;
- }
- if(count) {
- if(G.vd->around==V3D_CENTROID) {
- VecMulf(centroid, 1.0/(float)count);
- VECCOPY(snaploc, centroid);
- }
- else {
- snaploc[0]= (min[0]+max[0])/2;
- snaploc[1]= (min[1]+max[1])/2;
- snaploc[2]= (min[2]+max[2])/2;
- }
- }
- }
-
- /* Snap the selection to the snaplocation (duh!) */
- if(G.obedit) {
- tottrans= 0;
-
- if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL)
- make_trans_verts(bmat[0], bmat[1], 0);
- if(tottrans==0) return;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat, bmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
- vec[0]= snaploc[0]-G.obedit->obmat[3][0];
- vec[1]= snaploc[1]-G.obedit->obmat[3][1];
- vec[2]= snaploc[2]-G.obedit->obmat[3][2];
-
- Mat3MulVecfl(imat, vec);
- VECCOPY(tv->loc, vec);
- }
-
- special_transvert_update();
-
- MEM_freeN(transvmain);
- transvmain= 0;
-
- allqueue(REDRAWVIEW3D, 0);
- return;
- }
-
- base= (G.scene->base.first);
- while(base) {
- if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) {
- ob= base->object;
- if(ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
-
- for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if(pchan->bone->flag & BONE_SELECTED) {
- if(pchan->bone->layer & arm->layer) {
- if((pchan->bone->flag & BONE_CONNECTED)==0) {
- /* get location of cursor in bone-space */
- armature_loc_pose_to_bone(pchan, snaploc, vec);
-
- /* calculate new position */
- VECCOPY(pchan->loc, vec);
- }
- /* if the bone has a parent and is connected to the parent,
- * don't do anything - will break chain unless we do auto-ik.
- */
- }
- }
- }
-
- /* auto-keyframing */
- ob->pose->flag |= POSE_DO_UNLOCK;
- autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else {
- ob->recalc |= OB_RECALC_OB;
-
- vec[0]= -ob->obmat[3][0] + snaploc[0];
- vec[1]= -ob->obmat[3][1] + snaploc[1];
- vec[2]= -ob->obmat[3][2] + snaploc[2];
-
- if(ob->parent) {
- where_is_object(ob);
-
- Mat3Inv(imat, originmat);
- Mat3MulVecfl(imat, vec);
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
- else {
- ob->loc[0]+= vec[0];
- ob->loc[1]+= vec[1];
- ob->loc[2]+= vec[2];
- }
-#ifdef WITH_VERSE
- if(ob->vnode) b_verse_send_transformation(ob);
-#endif
-
- /* auto-keyframing */
- autokeyframe_ob_cb_func(ob, TFM_TRANSLATION);
- }
- }
-
- base= base->next;
- }
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-void snapmenu()
-{
- short event;
-
- event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Selection -> Center%x3|%l|Cursor -> Selection%x4|Cursor -> Grid%x5|Cursor -> Active%x6");
-
- switch (event) {
- case 1: /*Selection to grid*/
- snap_sel_to_grid();
- BIF_undo_push("Snap selection to grid");
- break;
- case 2: /*Selection to cursor*/
- snap_sel_to_curs();
- BIF_undo_push("Snap selection to cursor");
- break;
- case 3: /*Selection to center of selection*/
- snap_to_center();
- BIF_undo_push("Snap selection to center");
- break;
- case 4: /*Cursor to selection*/
- snap_curs_to_sel();
- break;
- case 5: /*Cursor to grid*/
- snap_curs_to_grid();
- break;
- case 6: /*Cursor to Active*/
- snap_curs_to_active();
- BIF_undo_push("Snap selection to center");
- break;
- }
-}
-
-void alignmenu()
-{
- short val;
- char *str_menu = BIF_menustringTransformOrientation("Align");
- val= pupmenu(str_menu);
- MEM_freeN(str_menu);
-
- if (val >= 0)
- {
- short old_val = G.vd->twmode;
- G.vd->twmode = val;
- initTransform(TFM_ALIGN, CTX_NO_PET|CTX_AUTOCONFIRM);
- Transform();
- G.vd->twmode = old_val;
- }
-}
-
-#define MERGELIMIT 0.001
-void mergemenu(void)
-{
-
- short event;
- int remCount = 0;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX)
- if(G.editMesh->selected.first && G.editMesh->selected.last &&
- ((EditSelection*)G.editMesh->selected.first)->type == EDITVERT && ((EditSelection*)G.editMesh->selected.last)->type == EDITVERT)
- event = pupmenu("Merge %t|At First %x6|At Last%x1|At Center%x3|At Cursor%x4|Collapse%x2");
- else if (G.editMesh->selected.first && ((EditSelection*)G.editMesh->selected.first)->type == EDITVERT)
- event = pupmenu("Merge %t|At First %x6|At Center%x3|At Cursor%x4|Collapse%x2");
- else if (G.editMesh->selected.last && ((EditSelection*)G.editMesh->selected.last)->type == EDITVERT)
- event = pupmenu("Merge %t|At Last %x1|At Center%x3|At Cursor%x4|Collapse%x2");
- else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2");
- else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2");
- switch (event)
- {
- case -1:
- return;
- case 3:
- if(G.qual & LR_CTRLKEY) remCount = merge_target(0,1);
- else remCount = merge_target(0,0);
- BIF_undo_push("Merge at center");
- break;
- case 4:
- if(G.qual & LR_CTRLKEY) remCount = merge_target(1,1);
- else remCount = merge_target(1,0);
- BIF_undo_push("Merge at cursor");
- break;
- case 1:
- if(G.qual & LR_CTRLKEY) remCount = merge_firstlast(0,1);
- else remCount = merge_firstlast(0,0);
- BIF_undo_push("Merge at last selected");
- break;
- case 6:
- if(G.qual & LR_CTRLKEY) remCount = merge_firstlast(1,1);
- else remCount = merge_firstlast(1,0);
- BIF_undo_push("Merge at first selected");
- break;
- case 2:
- remCount = collapseEdges();
- BIF_undo_push("Collapse");
- break;
- }
- notice("Removed %d Vertices", remCount);
- allqueue(REDRAWVIEW3D, 0);
- countall();
-}
-#undef MERGELIMIT
-
-
-void delete_context_selected(void)
-{
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) delete_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) delNurb();
- else if(G.obedit->type==OB_MBALL) delete_mball();
- else if (G.obedit->type==OB_ARMATURE) delete_armature();
- }
- else if(G.f & G_PARTICLEEDIT){
- PE_delete_particle();
- }
- else delete_obj(0);
-}
-
-void duplicate_context_selected(void)
-{
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) adduplicate_mesh();
- else if(G.obedit->type==OB_ARMATURE) adduplicate_armature();
- else if(G.obedit->type==OB_MBALL) adduplicate_mball();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) adduplicate_nurb();
- }
- else if(G.f & G_PARTICLEEDIT);
- else
- adduplicate(0, U.dupflag);
-}
-
-void toggle_shading(void)
-{
- if(G.qual & LR_SHIFTKEY) {
- if(G.qual & LR_ALTKEY) {
- reshadeall_displist();
- G.vd->drawtype= OB_SHADED;
- }
- else {
- if(G.vd->drawtype== OB_SHADED) G.vd->drawtype= OB_WIRE;
- else G.vd->drawtype= OB_SHADED;
- }
- }
- else if(G.qual & LR_ALTKEY) {
- if(G.vd->drawtype== OB_TEXTURE) G.vd->drawtype= OB_SOLID;
- else G.vd->drawtype= OB_TEXTURE;
- }
- else {
- if(G.vd->drawtype==OB_SOLID || G.vd->drawtype==OB_SHADED) G.vd->drawtype= OB_WIRE;
- else G.vd->drawtype= OB_SOLID;
- }
-
- if(G.vd->drawtype != OB_WIRE && G.vd->depths) {
- G.vd->depths->damaged= 1;
- }
-}
-
-int minmax_verts(float *min, float *max)
-{
- TransVert *tv;
- float centroid[3], vec[3], bmat[3][3];
- int a;
-
- tottrans=0;
- if ELEM5(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE)
- make_trans_verts(bmat[0], bmat[1], 2);
- if(tottrans==0) return 0;
-
- Mat3CpyMat4(bmat, G.obedit->obmat);
-
- tv= transvmain;
- for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, G.obedit->obmat[3]);
- VecAddf(centroid, centroid, vec);
- DO_MINMAX(vec, min, max);
- }
-
- MEM_freeN(transvmain);
- transvmain= 0;
- return 1;
-}
-
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
deleted file mode 100644
index e230c97f010..00000000000
--- a/source/blender/src/editaction.c
+++ /dev/null
@@ -1,5244 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): 2007, Joshua Leung (major rewrite of Action Editor)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stddef.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_gpencil_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-#include "BKE_object.h" /* for where_is_object in obanim -> action baking */
-
-#include "BIF_butspace.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editnla.h"
-#include "BIF_editview.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-
-#include "BSE_edit.h"
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_editaction_types.h"
-#include "BSE_editipo.h"
-#include "BSE_time.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_drawaction.h"
-#include "BDR_editobject.h"
-#include "BDR_gpencil.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "nla.h"
-
-/* **************************************************** */
-/* ACTION API */
-
-/* this function adds a new Action block */
-bAction *add_empty_action (char *name)
-{
- bAction *act;
-
- act= alloc_libblock(&G.main->action, ID_AC, name);
- act->id.flag |= LIB_FAKEUSER;
- act->id.us++;
-
- return act;
-}
-
-/* generic get current action call, for action window context */
-bAction *ob_get_action (Object *ob)
-{
- bActionStrip *strip;
-
- if(ob->action)
- return ob->action;
-
- for (strip=ob->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT)
- return strip->act;
- }
- return NULL;
-}
-
-/* used by ipo, outliner, buttons to find the active channel */
-bActionChannel *get_hilighted_action_channel (bAction *action)
-{
- bActionChannel *achan;
-
- if (!action)
- return NULL;
-
- for (achan= action->chanbase.first; achan; achan= achan->next) {
- if (VISIBLE_ACHAN(achan)) {
- if (SEL_ACHAN(achan) && (achan->flag & ACHAN_HILIGHTED))
- return achan;
- }
- }
-
- return NULL;
-}
-
-/* ----------------------------------------- */
-
-void remake_action_ipos (bAction *act)
-{
- bActionChannel *achan;
- bConstraintChannel *conchan;
- IpoCurve *icu;
-
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- if (achan->ipo) {
- for (icu = achan->ipo->curve.first; icu; icu=icu->next) {
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
- }
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (conchan->ipo) {
- for (icu = conchan->ipo->curve.first; icu; icu=icu->next) {
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
- }
- }
- }
-
- synchronize_action_strips();
-}
-
-/* **************************************************** */
-/* FILTER->EDIT STRUCTURES */
-/*
- * This method involves generating a list of edit structures which enable
- * tools to naively perform the actions they require without all the boiler-plate
- * associated with loops within loops and checking for cases to ignore.
- */
-
-/* this function allocates memory for a new bActListElem struct for the
- * provided action channel-data.
- */
-bActListElem *make_new_actlistelem (void *data, short datatype, void *owner, short ownertype)
-{
- bActListElem *ale= NULL;
-
- /* only allocate memory if there is data to convert */
- if (data) {
- /* allocate and set generic data */
- ale= MEM_callocN(sizeof(bActListElem), "bActListElem");
-
- ale->data= data;
- ale->type= datatype;
- ale->owner= owner;
- ale->ownertype= ownertype;
-
- if ((owner) && (ownertype == ACTTYPE_ACHAN)) {
- bActionChannel *ochan= (bActionChannel *)owner;
- ale->grp= ochan->grp;
- }
- else
- ale->grp= NULL;
-
- /* do specifics */
- switch (datatype) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)data;
-
- ale->flag= agrp->flag;
-
- ale->key_data= NULL;
- ale->datatype= ALE_GROUP;
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan= (bActionChannel *)data;
-
- ale->flag= achan->flag;
-
- if (achan->ipo) {
- ale->key_data= achan->ipo;
- ale->datatype= ALE_IPO;
- }
- else {
- ale->key_data= NULL;
- ale->datatype= ALE_NONE;
- }
- }
- break;
- case ACTTYPE_CONCHAN:
- case ACTTYPE_CONCHAN2:
- {
- bConstraintChannel *conchan= (bConstraintChannel *)data;
-
- ale->flag= conchan->flag;
-
- if (datatype == ACTTYPE_CONCHAN2) {
- /* CONCHAN2 is a hack so that constraint-channels keyframes can be edited */
- if (conchan->ipo) {
- ale->key_data= conchan->ipo;
- ale->datatype= ALE_IPO;
- }
- else {
- ale->key_data= NULL;
- ale->datatype= ALE_NONE;
- }
- }
- else {
- if (conchan->ipo && conchan->ipo->curve.first) {
- /* we assume that constraint ipo blocks only have 1 curve:
- * INFLUENCE, so we pretend that a constraint channel is
- * really just a Ipo-Curve channel instead.
- */
- ale->key_data= conchan->ipo->curve.first;
- ale->datatype= ALE_ICU;
- }
- else {
- ale->key_data= NULL;
- ale->datatype= ALE_NONE;
- }
- }
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)data;
-
- ale->flag= icu->flag;
- ale->key_data= icu;
- ale->datatype= ALE_ICU;
- }
- break;
-
- case ACTTYPE_FILLIPO:
- case ACTTYPE_FILLCON:
- {
- bActionChannel *achan= (bActionChannel *)data;
-
- if (datatype == ACTTYPE_FILLIPO)
- ale->flag= FILTER_IPO_ACHAN(achan);
- else
- ale->flag= FILTER_CON_ACHAN(achan);
-
- ale->key_data= NULL;
- ale->datatype= ALE_NONE;
- }
- break;
- case ACTTYPE_IPO:
- {
- ale->flag= 0;
- ale->key_data= data;
- ale->datatype= ALE_IPO;
- }
- break;
- case ACTTYPE_GPLAYER:
- {
- bGPDlayer *gpl= (bGPDlayer *)data;
-
- ale->flag= gpl->flag;
-
- ale->key_data= NULL;
- ale->datatype= ALE_GPFRAME;
- }
- break;
- }
- }
-
- /* return created datatype */
- return ale;
-}
-
-/* ----------------------------------------- */
-
-static void actdata_filter_actionchannel (ListBase *act_data, bActionChannel *achan, int filter_mode)
-{
- bActListElem *ale;
- bConstraintChannel *conchan;
- IpoCurve *icu;
-
- /* only work with this channel and its subchannels if it is visible */
- if (!(filter_mode & ACTFILTER_VISIBLE) || VISIBLE_ACHAN(achan)) {
- /* only work with this channel and its subchannels if it is editable */
- if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_ACHAN(achan)) {
- /* check if this achan should only be included if it is selected */
- if (!(filter_mode & ACTFILTER_SEL) || SEL_ACHAN(achan)) {
- /* are we only interested in the ipo-curves? */
- if ((filter_mode & ACTFILTER_ONLYICU)==0) {
- ale= make_new_actlistelem(achan, ACTTYPE_ACHAN, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
- else {
- /* for insert key... this check could be improved */
- return;
- }
-
- /* check if expanded - if not, continue on to next action channel */
- if (EXPANDED_ACHAN(achan) == 0 && (filter_mode & ACTFILTER_ONLYICU)==0) {
- /* only exit if we don't need to include constraint channels for group-channel keyframes */
- if ( !(filter_mode & ACTFILTER_IPOKEYS) || (achan->grp == NULL) || (EXPANDED_AGRP(achan->grp)==0) )
- return;
- }
-
- /* ipo channels */
- if ((achan->ipo) && (filter_mode & ACTFILTER_IPOKEYS)==0) {
- /* include ipo-expand widget? */
- if ((filter_mode & ACTFILTER_CHANNELS) && (filter_mode & ACTFILTER_ONLYICU)==0) {
- ale= make_new_actlistelem(achan, ACTTYPE_FILLIPO, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
-
- /* add ipo-curve channels? */
- if (FILTER_IPO_ACHAN(achan) || (filter_mode & ACTFILTER_ONLYICU)) {
- /* loop through ipo-curve channels, adding them */
- for (icu= achan->ipo->curve.first; icu; icu=icu->next) {
- ale= make_new_actlistelem(icu, ACTTYPE_ICU, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
- }
-
- /* constraint channels */
- if (achan->constraintChannels.first) {
- /* include constraint-expand widget? */
- if ( (filter_mode & ACTFILTER_CHANNELS) && !(filter_mode & ACTFILTER_ONLYICU)
- && !(filter_mode & ACTFILTER_IPOKEYS) )
- {
- ale= make_new_actlistelem(achan, ACTTYPE_FILLCON, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
-
- /* add constraint channels? */
- if (FILTER_CON_ACHAN(achan) || (filter_mode & ACTFILTER_IPOKEYS) || (filter_mode & ACTFILTER_ONLYICU)) {
- /* loop through constraint channels, checking and adding them */
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- /* only work with this channel and its subchannels if it is editable */
- if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_CONCHAN(conchan)) {
- /* check if this conchan should only be included if it is selected */
- if (!(filter_mode & ACTFILTER_SEL) || SEL_CONCHAN(conchan)) {
- if (filter_mode & ACTFILTER_IPOKEYS) {
- ale= make_new_actlistelem(conchan, ACTTYPE_CONCHAN2, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
- else {
- ale= make_new_actlistelem(conchan, ACTTYPE_CONCHAN, achan, ACTTYPE_ACHAN);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_mode)
-{
- bActListElem *ale=NULL;
- bActionGroup *agrp;
- bActionChannel *achan, *lastchan=NULL;
-
- /* loop over groups */
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- /* add this group as a channel first */
- if (!(filter_mode & ACTFILTER_ONLYICU) && !(filter_mode & ACTFILTER_IPOKEYS)) {
- /* check if filtering by selection */
- if ( !(filter_mode & ACTFILTER_SEL) || SEL_AGRP(agrp) ) {
- ale= make_new_actlistelem(agrp, ACTTYPE_GROUP, NULL, ACTTYPE_NONE);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
-
- /* store reference to last channel of group */
- if (agrp->channels.last)
- lastchan= agrp->channels.last;
-
-
- /* there are some situations, where only the channels of the active group should get considered */
- if (!(filter_mode & ACTFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) {
- /* filters here are a bit convoulted...
- * - groups show a "summary" of keyframes beside their name which must accessable for tools which handle keyframes
- * - groups can be collapsed (and those tools which are only interested in channels rely on knowing that group is closed)
- *
- * cases when we should include action-channels and so-forth inside group:
- * - we don't care about visibility
- * - group is expanded
- * - we're interested in keyframes, but not if they appear in selected channels
- */
- if ( (!(filter_mode & ACTFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) ||
- ( ((filter_mode & ACTFILTER_IPOKEYS) || (filter_mode & ACTFILTER_ONLYICU)) &&
- (!(filter_mode & ACTFILTER_SEL) || (SEL_AGRP(agrp))) ) )
- {
- if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- actdata_filter_actionchannel(act_data, achan, filter_mode);
- }
-
- /* remove group from filtered list if last element is group
- * (i.e. only if group had channels, which were all hidden)
- */
- if ( (ale) && (act_data->last == ale) &&
- (ale->data == agrp) && (agrp->channels.first) )
- {
- BLI_freelinkN(act_data, ale);
- }
- }
- }
- }
- }
-
- /* loop over un-grouped action channels (only if we're not only considering those channels in the active group) */
- if (!(filter_mode & ACTFILTER_ACTGROUPED)) {
- for (achan=(lastchan)?lastchan->next:act->chanbase.first; achan; achan=achan->next) {
- actdata_filter_actionchannel(act_data, achan, filter_mode);
- }
- }
-}
-
-static void actdata_filter_shapekey (ListBase *act_data, Key *key, int filter_mode)
-{
- bActListElem *ale;
- KeyBlock *kb;
- IpoCurve *icu;
- int i;
-
- /* are we filtering for display or editing */
- if (filter_mode & ACTFILTER_FORDRAWING) {
- /* for display - loop over shapekeys, adding ipo-curve references where needed */
- kb= key->block.first;
-
- /* loop through possible shapekeys, manually creating entries */
- for (i= 1; i < key->totkey; i++) {
- ale= MEM_callocN(sizeof(bActListElem), "bActListElem");
- kb = kb->next;
-
- ale->data= kb;
- ale->type= ACTTYPE_SHAPEKEY; /* 'abused' usage of this type */
- ale->owner= key;
- ale->ownertype= ACTTYPE_SHAPEKEY;
- ale->datatype= ALE_NONE;
- ale->index = i;
-
- if (key->ipo) {
- for (icu= key->ipo->curve.first; icu; icu=icu->next) {
- if (icu->adrcode == i) {
- ale->key_data= icu;
- ale->datatype= ALE_ICU;
- break;
- }
- }
- }
-
- BLI_addtail(act_data, ale);
- }
- }
- else {
- /* loop over ipo curves if present - for editing */
- if (key->ipo) {
- if (filter_mode & ACTFILTER_IPOKEYS) {
- ale= make_new_actlistelem(key->ipo, ACTTYPE_IPO, key, ACTTYPE_SHAPEKEY);
- if (ale) BLI_addtail(act_data, ale);
- }
- else {
- for (icu= key->ipo->curve.first; icu; icu=icu->next) {
- ale= make_new_actlistelem(icu, ACTTYPE_ICU, key, ACTTYPE_SHAPEKEY);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
- }
- }
-}
-
-
-static void actdata_filter_gpencil (ListBase *act_data, bScreen *sc, int filter_mode)
-{
- bActListElem *ale;
- ScrArea *sa;
- bGPdata *gpd;
- bGPDlayer *gpl;
-
- /* check if filtering types are appropriate */
- if ( !(filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU|ACTFILTER_ACTGROUPED)) )
- {
- /* special hack for fullscreen area (which must be this one then):
- * - we use the curarea->full as screen to get spaces from, since the
- * old (pre-fullscreen) screen was stored there...
- * - this is needed as all data would otherwise disappear
- */
- if ((curarea->full) && (curarea->spacetype==SPACE_ACTION))
- sc= curarea->full;
-
- /* loop over spaces in current screen, finding gpd blocks (could be slow!) */
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- /* try to get gp data */
- gpd= gpencil_data_getactive(sa);
- if (gpd == NULL) continue;
-
- /* add gpd as channel too (if for drawing, and it has layers) */
- if ((filter_mode & ACTFILTER_FORDRAWING) && (gpd->layers.first)) {
- /* add to list */
- ale= make_new_actlistelem(gpd, ACTTYPE_GPDATABLOCK, sa, ACTTYPE_SPECIALDATA);
- if (ale) BLI_addtail(act_data, ale);
- }
-
- /* only add layers if they will be visible (if drawing channels) */
- if ( !(filter_mode & ACTFILTER_VISIBLE) || (EXPANDED_GPD(gpd)) ) {
- /* loop over layers as the conditions are acceptable */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- /* only if selected */
- if (!(filter_mode & ACTFILTER_SEL) || SEL_GPL(gpl)) {
- /* only if editable */
- if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_GPL(gpl)) {
- /* add to list */
- ale= make_new_actlistelem(gpl, ACTTYPE_GPLAYER, gpd, ACTTYPE_GPDATABLOCK);
- if (ale) BLI_addtail(act_data, ale);
- }
- }
- }
- }
- }
- }
-}
-
-/* This function filters the active data source to leave only the desired
- * data types. 'Public' api call.
- * *act_data: is a pointer to a ListBase, to which the filtered action data
- * will be placed for use.
- * filter_mode: how should the data be filtered - bitmapping accessed flags
- */
-void actdata_filter (ListBase *act_data, int filter_mode, void *data, short datatype)
-{
- /* only filter data if there's somewhere to put it */
- if (data && act_data) {
- bActListElem *ale, *next;
-
- /* firstly filter the data */
- switch (datatype) {
- case ACTCONT_ACTION:
- actdata_filter_action(act_data, data, filter_mode);
- break;
- case ACTCONT_SHAPEKEY:
- actdata_filter_shapekey(act_data, data, filter_mode);
- break;
- case ACTCONT_GPENCIL:
- actdata_filter_gpencil(act_data, data, filter_mode);
- break;
- }
-
- /* remove any weedy entries */
- for (ale= act_data->first; ale; ale= next) {
- next= ale->next;
-
- if (ale->type == ACTTYPE_NONE)
- BLI_freelinkN(act_data, ale);
-
- if (filter_mode & ACTFILTER_IPOKEYS) {
- if (ale->datatype != ALE_IPO)
- BLI_freelinkN(act_data, ale);
- else if (ale->key_data == NULL)
- BLI_freelinkN(act_data, ale);
- }
- }
- }
-}
-
-/* **************************************************** */
-/* GENERAL ACTION TOOLS */
-
-/* gets the key data from the currently selected
- * mesh/lattice. If a mesh is not selected, or does not have
- * key data, then we return NULL (currently only
- * returns key data for RVK type meshes). If there
- * is an action that is pinned, return null
- */
-/* Note: there's a similar function in key.c (ob_get_key) */
-Key *get_action_mesh_key(void)
-{
- Object *ob;
- Key *key;
-
- ob = OBACT;
- if (ob == NULL)
- return NULL;
-
- if (G.saction->pin) return NULL;
-
- if (ob->type==OB_MESH)
- key = ((Mesh *)ob->data)->key;
- else if (ob->type==OB_LATTICE)
- key = ((Lattice *)ob->data)->key;
- else if (ELEM(ob->type, OB_CURVE, OB_SURF))
- key= ((Curve *)ob->data)->key;
- else
- return NULL;
-
- if (key) {
- if (key->type == KEY_RELATIVE)
- return key;
- }
-
- return NULL;
-}
-
-/* TODO: kill this! */
-int get_nearest_key_num (Key *key, short *mval, float *x)
-{
- /* returns the key num that cooresponds to the
- * y value of the mouse click. Does not check
- * if this is a valid keynum. Also gives the Ipo
- * x coordinate.
- */
- int num;
- float y;
-
- areamouseco_to_ipoco(G.v2d, mval, x, &y);
- num = (int) ((CHANNELHEIGHT/2 - y) / (CHANNELHEIGHT+CHANNELSKIP));
-
- return (num + 1);
-}
-
-/* this function finds the channel that mouse is floating over */
-void *get_nearest_act_channel (short mval[], short *ret_type, void **owner)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- int clickmin, clickmax;
- float x,y;
-
- /* init 'owner' return val */
- *owner= NULL;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) {
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
- clickmax = clickmin;
-
- if (clickmax < 0) {
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
-
- /* filter data */
- filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- if (clickmax < 0)
- break;
- if (clickmin <= 0) {
- /* found match */
- *ret_type= ale->type;
- data= ale->data;
- *owner= ale->owner;
-
- BLI_freelistN(&act_data);
-
- return data;
- }
- --clickmin;
- --clickmax;
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
-
- *ret_type= ACTTYPE_NONE;
- return NULL;
-}
-
-/* used only by mouse_action. It is used to find the location of the nearest
- * keyframe to where the mouse clicked,
- */
-static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, bActionChannel **par)
-{
- ListBase act_data = {NULL, NULL};
- ListBase act_keys = {NULL, NULL};
- bActListElem *ale;
- ActKeyColumn *ak;
- void *data;
- short datatype;
- int filter;
-
- rctf rectf;
- float xmin, xmax, x, y;
- int clickmin, clickmax;
- short mval[2];
- short found = 0;
-
- getmouseco_areawin (mval);
-
- /* action-channel */
- *par= NULL;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) {
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
- clickmax = clickmin;
-
- mval[0]-=7;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]+=14;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- /* if action is mapped in NLA, it returns a correction */
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- xmin= get_action_frame(OBACT, rectf.xmin);
- xmax= get_action_frame(OBACT, rectf.xmax);
- }
- else {
- xmin= rectf.xmin;
- xmax= rectf.xmax;
- }
-
- if (clickmax < 0) {
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
-
- /* filter data */
- filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- if (clickmax < 0)
- break;
- if (clickmin <= 0) {
- /* found match */
-
- /* make list of keyframes */
- if (ale->key_data) {
- switch (ale->datatype) {
- case ALE_IPO:
- {
- Ipo *ipo= (Ipo *)ale->key_data;
- ipo_to_keylist(ipo, &act_keys, NULL, NULL);
- }
- break;
- case ALE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)ale->key_data;
- icu_to_keylist(icu, &act_keys, NULL, NULL);
- }
- break;
- }
- }
- else if (ale->type == ACTTYPE_GROUP) {
- bActionGroup *agrp= (bActionGroup *)ale->data;
- agroup_to_keylist(agrp, &act_keys, NULL, NULL);
- }
- else if (ale->type == ACTTYPE_GPDATABLOCK) {
- /* cleanup */
- BLI_freelistN(&act_data);
-
- /* this channel currently doens't have any keyframes... must ignore! */
- *ret_type= ACTTYPE_NONE;
- return NULL;
- }
- else if (ale->type == ACTTYPE_GPLAYER) {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
- gpl_to_keylist(gpl, &act_keys, NULL, NULL);
- }
-
- /* loop through keyframes, finding one that was clicked on */
- for (ak= act_keys.first; ak; ak= ak->next) {
- if (IN_RANGE(ak->cfra, xmin, xmax)) {
- *selx= ak->cfra;
- found= 1;
- break;
- }
- }
- /* no matching keyframe found - set to mean frame value so it doesn't actually select anything */
- if (found == 0)
- *selx= ((xmax+xmin) / 2);
-
- /* figure out what to return */
- if (datatype == ACTCONT_ACTION) {
- *par= ale->owner; /* assume that this is an action channel */
- *ret_type= ale->type;
- data = ale->data;
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- data = ale->key_data;
- *ret_type= ACTTYPE_ICU;
- }
- else if (datatype == ACTCONT_GPENCIL) {
- data = ale->data;
- *ret_type= ACTTYPE_GPLAYER;
- }
-
- /* cleanup tempolary lists */
- BLI_freelistN(&act_keys);
- act_keys.first = act_keys.last = NULL;
-
- BLI_freelistN(&act_data);
-
- return data;
- }
- --clickmin;
- --clickmax;
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
-
- *ret_type= ACTTYPE_NONE;
- return NULL;
-}
-
-void *get_action_context (short *datatype)
-{
- bAction *act;
- Key *key;
-
- /* get pointers to active action/shapekey blocks */
- act = (G.saction)? G.saction->action: NULL;
- key = get_action_mesh_key();
-
- /* check mode selector */
- if (G.saction) {
- switch (G.saction->mode) {
- case SACTCONT_ACTION:
- *datatype= ACTCONT_ACTION;
- return act;
-
- case SACTCONT_SHAPEKEY:
- *datatype= ACTCONT_SHAPEKEY;
- return key;
-
- case SACTCONT_GPENCIL:
- *datatype= ACTCONT_GPENCIL;
- return G.curscreen; // FIXME: add that dopesheet type thing here!
-
- default: /* includes SACTCONT_DOPESHEET for now */
- *datatype= ACTCONT_NONE;
- return NULL;
- }
- }
- else {
- /* resort to guessing based on what is available */
- if (act) {
- *datatype= ACTCONT_ACTION;
- return act;
- }
- else if (key) {
- *datatype= ACTCONT_SHAPEKEY;
- return key;
- }
- else {
- *datatype= ACTCONT_NONE;
- return NULL;
- }
- }
-}
-
-/* Quick-tool for preview-range functionality in Action Editor for setting Preview-Range
- * bounds to extents of Action, when Ctrl-Alt-P is used. Only available for actions.
- */
-void action_previewrange_set (bAction *act)
-{
- float start, end;
-
- /* sanity check */
- if (act == NULL)
- return;
-
- /* calculate range + make sure it is adjusted for nla-scaling */
- calc_action_range(act, &start, &end, 0);
- if (NLA_ACTION_SCALED) {
- start= get_action_frame_inv(OBACT, start);
- end= get_action_frame_inv(OBACT, end);
- }
-
- /* set preview range */
- G.scene->r.psfra= (int)start;
- G.scene->r.pefra= (int)end;
-
- BIF_undo_push("Set anim-preview range");
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSALL, 0);
-}
-
-/* **************************************************** */
-/* ACTION CHANNEL GROUPS */
-
-/* Get the active action-group for an Action */
-bActionGroup *get_active_actiongroup (bAction *act)
-{
- bActionGroup *agrp= NULL;
-
- if (act && act->groups.first) {
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- if (agrp->flag & AGRP_ACTIVE)
- break;
- }
- }
-
- return agrp;
-}
-
-/* Make the given Action-Group the active one */
-void set_active_actiongroup (bAction *act, bActionGroup *agrp, short select)
-{
- bActionGroup *grp;
-
- /* sanity checks */
- if (act == NULL)
- return;
-
- /* Deactive all others */
- for (grp= act->groups.first; grp; grp= grp->next) {
- if ((grp==agrp) && (select))
- grp->flag |= AGRP_ACTIVE;
- else
- grp->flag &= ~AGRP_ACTIVE;
- }
-}
-
-/* Add given channel into (active) group
- * - assumes that channel is not linked to anything anymore
- * - always adds at the end of the group
- */
-static void action_groups_addachan (bAction *act, bActionGroup *agrp, bActionChannel *achan)
-{
- bActionChannel *chan;
- short done=0;
-
- /* sanity checks */
- if (ELEM3(NULL, act, agrp, achan))
- return;
-
- /* if no channels, just add to two lists at the same time */
- if (act->chanbase.first == NULL) {
- achan->next = achan->prev = NULL;
-
- agrp->channels.first = agrp->channels.last = achan;
- act->chanbase.first = act->chanbase.last = achan;
-
- achan->grp= agrp;
- return;
- }
-
- /* try to find a channel to slot this in before/after */
- for (chan= act->chanbase.first; chan; chan= chan->next) {
- /* if channel has no group, then we have ungrouped channels, which should always occur after groups */
- if (chan->grp == NULL) {
- BLI_insertlinkbefore(&act->chanbase, chan, achan);
-
- if (agrp->channels.first == NULL)
- agrp->channels.first= achan;
- agrp->channels.last= achan;
-
- done= 1;
- break;
- }
-
- /* if channel has group after current, we can now insert (otherwise we have gone too far) */
- else if (chan->grp == agrp->next) {
- BLI_insertlinkbefore(&act->chanbase, chan, achan);
-
- if (agrp->channels.first == NULL)
- agrp->channels.first= achan;
- agrp->channels.last= achan;
-
- done= 1;
- break;
- }
-
- /* if channel has group we're targeting, check whether it is the last one of these */
- else if (chan->grp == agrp) {
- if ((chan->next) && (chan->next->grp != agrp)) {
- BLI_insertlinkafter(&act->chanbase, chan, achan);
- agrp->channels.last= achan;
- done= 1;
- break;
- }
- else if (chan->next == NULL) {
- BLI_addtail(&act->chanbase, achan);
- agrp->channels.last= achan;
- done= 1;
- break;
- }
- }
-
- /* if channel has group before target, check whether the next one is something after target */
- else if (chan->grp == agrp->prev) {
- if (chan->next) {
- if ((chan->next->grp != chan->grp) && (chan->next->grp != agrp)) {
- BLI_insertlinkafter(&act->chanbase, chan, achan);
-
- agrp->channels.first= achan;
- agrp->channels.last= achan;
-
- done= 1;
- break;
- }
- }
- else {
- BLI_insertlinkafter(&act->chanbase, chan, achan);
-
- agrp->channels.first= achan;
- agrp->channels.last= achan;
-
- done= 1;
- break;
- }
- }
- }
-
- /* only if added, set channel as belonging to this group */
- if (done) {
- achan->grp= agrp;
- }
- else
- printf("Error: ActionChannel: '%s' couldn't be added to Group: '%s' \n", achan->name, agrp->name);
-}
-
-/* Remove the given channel from all groups */
-static void action_groups_removeachan (bAction *act, bActionChannel *achan)
-{
- /* sanity checks */
- if (ELEM(NULL, act, achan))
- return;
-
- /* check if any group used this directly */
- if (achan->grp) {
- bActionGroup *agrp= achan->grp;
-
- if (agrp->channels.first == agrp->channels.last) {
- if (agrp->channels.first == achan) {
- agrp->channels.first= NULL;
- agrp->channels.last= NULL;
- }
- }
- else if (agrp->channels.first == achan) {
- if ((achan->next) && (achan->next->grp==agrp))
- agrp->channels.first= achan->next;
- else
- agrp->channels.first= NULL;
- }
- else if (agrp->channels.last == achan) {
- if ((achan->prev) && (achan->prev->grp==agrp))
- agrp->channels.last= achan->prev;
- else
- agrp->channels.last= NULL;
- }
-
- achan->grp= NULL;
- }
-
- /* now just remove from list */
- BLI_remlink(&act->chanbase, achan);
-}
-
-/* Add a new Action-Group or add channels to active one */
-void action_groups_group (short add_group)
-{
- bAction *act;
- bActionChannel *achan, *anext;
- bActionGroup *agrp;
- void *data;
- short datatype;
-
- /* validate type of data we are working on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* get active group */
- if ((act->groups.first==NULL) || (add_group)) {
- /* Add a new group, and make it active */
- agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
-
- agrp->flag |= (AGRP_ACTIVE|AGRP_SELECTED|AGRP_EXPANDED);
- sprintf(agrp->name, "Group");
-
- BLI_addtail(&act->groups, agrp);
- BLI_uniquename(&act->groups, agrp, "Group", offsetof(bActionGroup, name), 32);
-
- set_active_actiongroup(act, agrp, 1);
-
- add_group= 1;
- }
- else {
- agrp= get_active_actiongroup(act);
-
- if (agrp == NULL) {
- error("No Active Action Group");
- return;
- }
- }
-
- /* loop through action-channels, finding those that are selected + visible to move */
- // FIXME: this should be done with action api instead
- for (achan= act->chanbase.first; achan; achan= anext) {
- anext= achan->next;
-
- /* make sure not already in new-group */
- if (achan->grp != agrp) {
- if ((achan->grp==NULL) || (EXPANDED_AGRP(achan->grp))) {
- if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan)) {
- /* unlink from everything else */
- action_groups_removeachan(act, achan);
-
- /* add to end of group's channels */
- action_groups_addachan(act, agrp, achan);
- }
- }
- }
- }
-
- /* updates and undo */
- if (add_group)
- BIF_undo_push("Add Action Group");
- else
- BIF_undo_push("Add to Action Group");
-
- allqueue(REDRAWACTION, 0);
-}
-
-/* Remove selected channels from their groups */
-void action_groups_ungroup (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- bAction *act;
- void *data;
- short datatype;
- short filter;
-
- /* validate type of data we are working on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE|ACTFILTER_SEL);
- actdata_filter(&act_data, filter, act, ACTCONT_ACTION);
-
- /* Only ungroup selected action-channels */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_ACHAN) {
- action_groups_removeachan(act, ale->data);
- BLI_addtail(&act->chanbase, ale->data);
- }
- }
-
- BLI_freelistN(&act_data);
-
- /* updates and undo */
- BIF_undo_push("Remove From Action Groups");
-
- allqueue(REDRAWACTION, 0);
-}
-
-/* Copy colors from a specified theme's color set to an Action/Bone Group */
-void actionbone_group_copycolors (bActionGroup *grp, short init_new)
-{
- /* error checking */
- if (grp == NULL)
- return;
-
- /* only do color copying if using a custom color */
- if (grp->customCol) {
- if (grp->customCol > 0) {
- /* copy theme colors on-to group's custom color in case user tries to edit color */
- bTheme *btheme= U.themes.first;
- ThemeWireColor *col_set= &btheme->tarm[(grp->customCol - 1)];
-
- memcpy(&grp->cs, col_set, sizeof(ThemeWireColor));
- }
- else if (init_new) {
- /* init custom colors with a generic multi-color rgb set, if not initialised already (and allowed to do so) */
- if (grp->cs.solid[0] == 0) {
- /* define for setting colors in theme below */
- #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a;
-
- SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255);
- SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255);
- SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255);
-
- #undef SETCOL
- }
- }
- }
-}
-
-/* This function is used when inserting keyframes for pose-channels. It assigns the
- * action-channel with the nominated name to a group with the same name as that of
- * the pose-channel with the nominated name.
- *
- * Note: this function calls validate_action_channel if action channel doesn't exist
- */
-void verify_pchan2achan_grouping (bAction *act, bPose *pose, char name[])
-{
- bActionChannel *achan;
- bPoseChannel *pchan;
-
- /* sanity checks */
- if (ELEM3(NULL, act, pose, name))
- return;
- if (name[0] == 0)
- return;
-
- /* try to get the channels */
- pchan= get_pose_channel(pose, name);
- if (pchan == NULL) return;
- achan= verify_action_channel(act, name);
-
- /* check if pchan has a group */
- if ((pchan->agrp_index > 0) && (achan->grp == NULL)) {
- bActionGroup *agrp, *grp=NULL;
-
- /* get group to try to be like */
- agrp= (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
- if (agrp == NULL) {
- error("PoseChannel has invalid group!");
- return;
- }
-
- /* try to find a group which is similar to the one we want (or add one) */
- for (grp= act->groups.first; grp; grp= grp->next) {
- if (!strcmp(grp->name, agrp->name))
- break;
- }
- if (grp == NULL) {
- grp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
-
- grp->flag |= (AGRP_ACTIVE|AGRP_SELECTED|AGRP_EXPANDED);
-
- /* copy name */
- sprintf(grp->name, agrp->name);
-
- /* deal with group-color copying (grp is destination, agrp is source) */
- memcpy(grp, agrp, sizeof(bActionGroup));
- actionbone_group_copycolors(grp, 1);
-
- BLI_addtail(&act->groups, grp);
- }
-
- /* make sure this channel is definitely not connected to anything before adding to group */
- action_groups_removeachan(act, achan);
- action_groups_addachan(act, grp, achan);
- }
-}
-
-/* This function is used when the user specifically requests to sync changes of pchans + bone groups
- * to achans + action groups. All achans are detached from their groups, and all groups are destroyed.
- * They are then recreated when the achans are reassigned to groups.
- *
- * Note: This doesn't preserve hand-created groups, and will operate on ALL action-channels regardless of
- * whether they were selected or active. More specific filtering can be added later.
- */
-void sync_pchan2achan_grouping ()
-{
- void *data;
- short datatype;
- bAction *act;
- bActionChannel *achan, *next, *last;
- bPose *pose;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if ((datatype != ACTCONT_ACTION) || (data==NULL)) return;
- if ((G.saction->pin) || (OBACT==NULL) || (OBACT->type != OB_ARMATURE)) {
- error("Action doesn't belong to active armature");
- return;
- }
-
- /* get data */
- act= (bAction *)data;
- pose= OBACT->pose;
-
- /* remove achan->group links, then delete all groups */
- for (achan= act->chanbase.first; achan; achan= achan->next)
- achan->grp = NULL;
- BLI_freelistN(&act->groups);
-
- /* loop through all achans, reassigning them to groups (colors are resyncronised) */
- last= act->chanbase.last;
- for (achan= act->chanbase.first; achan && achan!=last; achan= next) {
- next= achan->next;
- verify_pchan2achan_grouping(act, pose, achan->name);
- }
-
- /* undo and redraw */
- BIF_undo_push("Sync Armature-Data and Action");
- allqueue(REDRAWACTION, 0);
-}
-
-/* **************************************************** */
-/* TRANSFORM TOOLS */
-
-/* main call to start transforming keyframes */
-void transform_action_keys (int mode, int dummy)
-{
- void *data;
- short datatype;
- short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- switch (mode) {
- case 'g':
- {
- initTransform(TFM_TIME_TRANSLATE, context);
- Transform();
- }
- break;
- case 's':
- {
- initTransform(TFM_TIME_SCALE, context);
- Transform();
- }
- break;
- case 't':
- {
- initTransform(TFM_TIME_SLIDE, context);
- Transform();
- }
- break;
- case 'e':
- {
- initTransform(TFM_TIME_EXTEND, context);
- Transform();
- }
- break;
- }
-}
-
-/* ----------------------------------------- */
-
-/* duplicate keyframes */
-void duplicate_action_keys (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through filtered data and duplicate selected keys */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER)
- duplicate_gplayer_frames(ale->data);
- else
- duplicate_ipo_keys((Ipo *)ale->key_data);
- }
-
- /* free filtered list */
- BLI_freelistN(&act_data);
-
- /* now, go into transform-grab mode, to move keys */
- BIF_TransformSetUndo("Add Duplicate");
- transform_action_keys('g', 0);
-}
-
-/* this function is responsible for snapping the current frame to selected data */
-void snap_cfra_action()
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* snap current frame to selected data */
- snap_cfra_ipo_keys(NULL, -1);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- snap_cfra_ipo_keys(ale->key_data, 0);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else
- snap_cfra_ipo_keys(ale->key_data, 0);
- }
- BLI_freelistN(&act_data);
-
- snap_cfra_ipo_keys(NULL, 1);
-
- BIF_undo_push("Snap Current Frame to Keys");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* this function is responsible for snapping keyframes to frame-times */
-void snap_action_keys(short mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- char str[32];
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* determine mode */
- switch (mode) {
- case 1:
- strcpy(str, "Snap Keys To Nearest Frame");
- break;
- case 2:
- if (G.saction->flag & SACTION_DRAWTIME)
- strcpy(str, "Snap Keys To Current Time");
- else
- strcpy(str, "Snap Keys To Current Frame");
- break;
- case 3:
- strcpy(str, "Snap Keys To Nearest Marker");
- break;
- case 4:
- strcpy(str, "Snap Keys To Nearest Second");
- break;
- default:
- return;
- }
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* snap to frame */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- snap_ipo_keys(ale->key_data, mode);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else if (ale->type == ACTTYPE_GPLAYER)
- snap_gplayer_frames(ale->data, mode);
- else
- snap_ipo_keys(ale->key_data, mode);
- }
- BLI_freelistN(&act_data);
-
- if (datatype == ACTCONT_ACTION)
- remake_action_ipos(data);
-
- BIF_undo_push(str);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* this function is responsible for snapping keyframes to frame-times */
-void mirror_action_keys(short mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- char str[32];
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* determine mode */
- switch (mode) {
- case 1:
- strcpy(str, "Mirror Keys Over Current Frame");
- break;
- case 2:
- strcpy(str, "Mirror Keys Over Y-Axis");
- break;
- case 3:
- strcpy(str, "Mirror Keys Over X-Axis");
- break;
- case 4:
- strcpy(str, "Mirror Keys Over Marker");
- break;
- default:
- return;
- }
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* mirror */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- mirror_ipo_keys(ale->key_data, mode);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else if (ale->type == ACTTYPE_GPLAYER)
- mirror_gplayer_frames(ale->data, mode);
- else
- mirror_ipo_keys(ale->key_data, mode);
- }
- BLI_freelistN(&act_data);
-
- if (datatype == ACTCONT_ACTION)
- remake_action_ipos(data);
-
- BIF_undo_push(str);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* **************************************************** */
-/* ADD/REMOVE KEYFRAMES */
-
-/* This function allows the user to insert keyframes on the current
- * frame from the Action Editor, using the current values of the channels
- * to be keyframed.
- */
-void insertkey_action(void)
-{
- void *data;
- short datatype;
-
- Object *ob= OBACT;
- short mode;
- float cfra;
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
- cfra = frame_to_float(CFRA);
-
- if (datatype == ACTCONT_ACTION) {
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
-
- /* ask user what to keyframe */
- mode = pupmenu("Insert Key%t|All Channels%x1|Only Selected Channels%x2|In Active Group%x3");
- if (mode <= 0) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_ONLYICU );
- if (mode == 2) filter |= ACTFILTER_SEL;
- else if (mode == 3) filter |= ACTFILTER_ACTGROUPED;
-
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through ipo curves retrieved */
- for (ale= act_data.first; ale; ale= ale->next) {
- /* verify that this is indeed an ipo curve */
- if (ale->key_data && ale->owner) {
- bActionChannel *achan= (bActionChannel *)ale->owner;
- bConstraintChannel *conchan= (ale->type==ACTTYPE_CONCHAN) ? ale->data : NULL;
- IpoCurve *icu= (IpoCurve *)ale->key_data;
-
- if (ob)
- insertkey((ID *)ob, icu->blocktype, achan->name, ((conchan)?(conchan->name):(NULL)), icu->adrcode, 0);
- else
- insert_vert_icu(icu, cfra, icu->curval, 0);
- }
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- Key *key= (Key *)data;
- IpoCurve *icu;
-
- /* ask user if they want to insert a keyframe */
- mode = okee("Insert Keyframe?");
- if (mode <= 0) return;
-
- if (key->ipo) {
- for (icu= key->ipo->curve.first; icu; icu=icu->next) {
- insert_vert_icu(icu, cfra, icu->curval, 0);
- }
- }
- }
- else {
- /* this tool is not supported in this mode */
- return;
- }
-
- BIF_undo_push("Insert Key");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-/* delete selected keyframes */
-void delete_action_keys (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through filtered data and delete selected keys */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER)
- delete_gplayer_frames((bGPDlayer *)ale->data);
- else
- delete_ipo_keys((Ipo *)ale->key_data);
- }
-
- /* free filtered list */
- BLI_freelistN(&act_data);
-
- if (datatype == ACTCONT_ACTION)
- remake_action_ipos(data);
-
- BIF_undo_push("Delete Action Keys");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* delete selected action-channels (only achans and conchans are considered) */
-void delete_action_channels (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale, *next;
- bAction *act;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* deal with groups first */
- if (act->groups.first) {
- bActionGroup *agrp, *grp;
- bActionChannel *chan, *nchan;
-
- /* unlink achan's that belonged to this group (and make sure they're not selected if they weren't visible) */
- for (agrp= act->groups.first; agrp; agrp= grp) {
- grp= agrp->next;
-
- /* remove if group is selected */
- if (SEL_AGRP(agrp)) {
- for (chan= agrp->channels.first; chan && chan->grp==agrp; chan= nchan) {
- nchan= chan->next;
-
- action_groups_removeachan(act, chan);
- BLI_addtail(&act->chanbase, chan);
-
- if (EXPANDED_AGRP(agrp) == 0)
- chan->flag &= ~(ACHAN_SELECTED|ACHAN_HILIGHTED);
- }
-
- BLI_freelinkN(&act->groups, agrp);
- }
- }
- }
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* remove irrelevant entries */
- for (ale= act_data.first; ale; ale= next) {
- next= ale->next;
-
- if (ale->type != ACTTYPE_ACHAN)
- BLI_freelinkN(&act_data, ale);
- }
-
- /* clean up action channels */
- for (ale= act_data.first; ale; ale= next) {
- bActionChannel *achan= (bActionChannel *)ale->data;
- bConstraintChannel *conchan, *cnext;
- next= ale->next;
-
- /* release references to ipo users */
- if (achan->ipo)
- achan->ipo->id.us--;
-
- for (conchan= achan->constraintChannels.first; conchan; conchan=cnext) {
- cnext= conchan->next;
-
- if (conchan->ipo)
- conchan->ipo->id.us--;
- }
-
- /* remove action-channel from group(s) */
- if (achan->grp)
- action_groups_removeachan(act, achan);
-
- /* free memory */
- BLI_freelistN(&achan->constraintChannels);
- BLI_freelinkN(&act->chanbase, achan);
- BLI_freelinkN(&act_data, ale);
- }
-
- remake_action_ipos(data);
-
- BIF_undo_push("Delete Action Channels");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* 'Clean' IPO curves - remove any unnecessary keyframes */
-void clean_action (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype, ok;
-
- /* don't proceed any further if nothing to work on or user refuses */
- data= get_action_context(&datatype);
- ok= fbutton(&G.scene->toolsettings->clean_thresh,
- 0.0000001f, 1.0f, 0.001f, 0.1f,
- "Clean Threshold");
- if (!ok) return;
- if (datatype == ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_SEL | ACTFILTER_ONLYICU);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through filtered data and clean curves */
- for (ale= act_data.first; ale; ale= ale->next) {
- clean_ipo_curve((IpoCurve *)ale->key_data);
- }
-
- /* admin and redraws */
- BLI_freelistN(&act_data);
-
- BIF_undo_push("Clean Action");
- allqueue(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-
-/* little cache for values... */
-typedef struct tempFrameValCache {
- float frame, val;
-} tempFrameValCache;
-
-/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
-void sample_action_keys (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* sanity checks */
- data= get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype == ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_ONLYICU);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through filtered data and add keys between selected keyframes on every frame */
- for (ale= act_data.first; ale; ale= ale->next) {
- IpoCurve *icu= (IpoCurve *)ale->key_data;
- BezTriple *bezt, *start=NULL, *end=NULL;
- tempFrameValCache *value_cache, *fp;
- int sfra, range;
- int i, n;
-
- /* find selected keyframes... once pair has been found, add keyframes */
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- /* check if selected, and which end this is */
- if (BEZSELECTED(bezt)) {
- if (start) {
- /* set end */
- end= bezt;
-
- /* cache values then add keyframes using these values, as adding
- * keyframes while sampling will affect the outcome...
- */
- range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) );
- sfra= (int)( floor(start->vec[1][0]) );
-
- if (range) {
- value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache");
-
- /* sample values */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- fp->frame= (float)(sfra + n);
- fp->val= eval_icu(icu, fp->frame);
- }
-
- /* add keyframes with these */
- for (n=0, fp=value_cache; n<range && fp; n++, fp++) {
- insert_vert_icu(icu, fp->frame, fp->val, 1);
- }
-
- /* free temp cache */
- MEM_freeN(value_cache);
-
- /* as we added keyframes, we need to compensate so that bezt is at the right place */
- bezt = icu->bezt + i + range - 1;
- i += (range - 1);
- }
-
- /* bezt was selected, so it now marks the start of a whole new chain to search */
- start= bezt;
- end= NULL;
- }
- else {
- /* just set start keyframe */
- start= bezt;
- end= NULL;
- }
- }
- }
-
- /* recalculate channel's handles? */
- calchandles_ipocurve(icu);
- }
-
- /* admin and redraws */
- BLI_freelistN(&act_data);
-
- BIF_undo_push("Sample Action Keys");
- allqueue(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* **************************************************** */
-/* COPY/PASTE FOR ACTIONS */
-/* - The copy/paste buffer currently stores a set of Action Channels, with temporary
- * IPO-blocks, and also temporary IpoCurves which only contain the selected keyframes.
- * - Only pastes between compatable data is possible (i.e. same achan->name, ipo-curve type, etc.)
- * Unless there is only one element in the buffer, names are also tested to check for compatability.
- * - All pasted frames are offset by the same amount. This is calculated as the difference in the times of
- * the current frame and the 'first keyframe' (i.e. the earliest one in all channels).
- * - The earliest frame is calculated per copy operation.
- */
-
-/* globals for copy/paste data (like for other copy/paste buffers) */
-ListBase actcopybuf = {NULL, NULL};
-static float actcopy_firstframe= 999999999.0f;
-
-/* This function frees any MEM_calloc'ed copy/paste buffer data */
-void free_actcopybuf ()
-{
- bActionChannel *achan, *anext;
- bConstraintChannel *conchan, *cnext;
-
- for (achan= actcopybuf.first; achan; achan= anext) {
- anext= achan->next;
-
- if (achan->ipo) {
- free_ipo(achan->ipo);
- MEM_freeN(achan->ipo);
- }
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=cnext) {
- cnext= conchan->next;
-
- if (conchan->ipo) {
- free_ipo(conchan->ipo);
- MEM_freeN(conchan->ipo);
- }
-
- BLI_freelinkN(&achan->constraintChannels, conchan);
- }
-
- BLI_freelinkN(&actcopybuf, achan);
- }
-
- actcopybuf.first= actcopybuf.last= NULL;
- actcopy_firstframe= 999999999.0f;
-}
-
-/* This function adds data to the copy/paste buffer, freeing existing data first
- * Only the selected action channels gets their selected keyframes copied.
- */
-void copy_actdata ()
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* clear buffer first */
- free_actcopybuf();
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* assume that each of these is an ipo-block */
- for (ale= act_data.first; ale; ale= ale->next) {
- bActionChannel *achan;
- Ipo *ipo= ale->key_data;
- Ipo *ipn;
- IpoCurve *icu, *icn;
- BezTriple *bezt;
- int i;
-
- /* coerce an action-channel out of owner */
- if (ale->ownertype == ACTTYPE_ACHAN) {
- bActionChannel *achanO= ale->owner;
- achan= MEM_callocN(sizeof(bActionChannel), "ActCopyPasteAchan");
- strcpy(achan->name, achanO->name);
- }
- else if (ale->ownertype == ACTTYPE_SHAPEKEY) {
- achan= MEM_callocN(sizeof(bActionChannel), "ActCopyPasteAchan");
- strcpy(achan->name, "#ACP_ShapeKey");
- }
- else
- continue;
- BLI_addtail(&actcopybuf, achan);
-
- /* add constraint channel if needed, then add new ipo-block */
- if (ale->type == ACTTYPE_CONCHAN) {
- bConstraintChannel *conchanO= ale->data;
- bConstraintChannel *conchan;
-
- conchan= MEM_callocN(sizeof(bConstraintChannel), "ActCopyPasteConchan");
- strcpy(conchan->name, conchanO->name);
- BLI_addtail(&achan->constraintChannels, conchan);
-
- conchan->ipo= ipn= MEM_callocN(sizeof(Ipo), "ActCopyPasteIpo");
- }
- else {
- achan->ipo= ipn= MEM_callocN(sizeof(Ipo), "ActCopyPasteIpo");
- }
- ipn->blocktype = ipo->blocktype;
-
- /* now loop through curves, and only copy selected keyframes */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- /* allocate a new curve */
- icn= MEM_callocN(sizeof(IpoCurve), "ActCopyPasteIcu");
- icn->blocktype = icu->blocktype;
- icn->adrcode = icu->adrcode;
- BLI_addtail(&ipn->curve, icn);
-
- /* find selected BezTriples to add to the buffer (and set first frame) */
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- if (BEZSELECTED(bezt)) {
- /* add to buffer ipo-curve */
- insert_bezt_icu(icn, bezt);
-
- /* check if this is the earliest frame encountered so far */
- if (bezt->vec[1][0] < actcopy_firstframe)
- actcopy_firstframe= bezt->vec[1][0];
- }
- }
- }
- }
-
- /* check if anything ended up in the buffer */
- if (ELEM(NULL, actcopybuf.first, actcopybuf.last))
- error("Nothing copied to buffer");
-
- /* free temp memory */
- BLI_freelistN(&act_data);
-}
-
-void paste_actdata ()
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- Object *ob= OBACT;
-
- const float offset = (float)(CFRA - actcopy_firstframe);
- char *actname = NULL, *conname = NULL;
- short no_name= 0;
-
- /* check if buffer is empty */
- if (ELEM(NULL, actcopybuf.first, actcopybuf.last)) {
- error("No data in buffer to paste");
- return;
- }
- /* check if single channel in buffer (disregard names if so) */
- if (actcopybuf.first == actcopybuf.last)
- no_name= 1;
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* from selected channels */
- for (ale= act_data.first; ale; ale= ale->next) {
- Ipo *ipo_src = NULL;
- bActionChannel *achan;
- IpoCurve *ico, *icu;
- BezTriple *bezt;
- int i;
-
- /* find suitable IPO-block from buffer to paste from */
- for (achan= actcopybuf.first; achan; achan= achan->next) {
- /* try to match data */
- if (ale->ownertype == ACTTYPE_ACHAN) {
- bActionChannel *achant= ale->owner;
-
- /* check if we have a corresponding action channel */
- if ((no_name) || (strcmp(achan->name, achant->name)==0)) {
- actname= achant->name;
-
- /* check if this is a constraint channel */
- if (ale->type == ACTTYPE_CONCHAN) {
- bConstraintChannel *conchant= ale->data;
- bConstraintChannel *conchan;
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (strcmp(conchan->name, conchant->name)==0) {
- conname= conchant->name;
- ipo_src= conchan->ipo;
- break;
- }
- }
- if (ipo_src) break;
- }
- else {
- ipo_src= achan->ipo;
- break;
- }
- }
- }
- else if (ale->ownertype == ACTTYPE_SHAPEKEY) {
- /* check if this action channel is "#ACP_ShapeKey" */
- if ((no_name) || (strcmp(achan->name, "#ACP_ShapeKey")==0)) {
- actname= NULL;
- ipo_src= achan->ipo;
- break;
- }
- }
- }
-
- /* this shouldn't happen, but it might */
- if (ipo_src == NULL)
- continue;
-
- /* loop over curves, pasting keyframes */
- for (ico= ipo_src->curve.first; ico; ico= ico->next) {
- /* get IPO-curve to paste to (IPO-curve might not exist for destination, so gets created) */
- icu= verify_ipocurve((ID *)ob, ico->blocktype, actname, conname, NULL, ico->adrcode, 1);
-
- if (icu) {
- /* just start pasting, with the the first keyframe on the current frame, and so on */
- for (i=0, bezt=ico->bezt; i < ico->totvert; i++, bezt++) {
- /* temporarily apply offset to src beztriple while copying */
- bezt->vec[0][0] += offset;
- bezt->vec[1][0] += offset;
- bezt->vec[2][0] += offset;
-
- /* insert the keyframe */
- insert_bezt_icu(icu, bezt);
-
- /* un-apply offset from src beztriple after copying */
- bezt->vec[0][0] -= offset;
- bezt->vec[1][0] -= offset;
- bezt->vec[2][0] -= offset;
- }
-
- /* recalculate channel's handles? */
- calchandles_ipocurve(icu);
- }
- }
- }
-
- /* free temp memory */
- BLI_freelistN(&act_data);
-
- /* do depsgraph updates (for 3d-view)? */
- if ((ob) && (G.saction->pin==0)) {
- if (ob->type == OB_ARMATURE)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
-
- /* undo and redraw stuff */
- allqueue(REDRAWVIEW3D, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
- BIF_undo_push("Paste Action Keyframes");
-}
-
-/* **************************************************** */
-/* VARIOUS SETTINGS */
-
-/* This function combines several features related to setting
- * various ipo extrapolation/interpolation
- */
-void action_set_ipo_flags (short mode, short event)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype == ACTCONT_GPENCIL) return;
-
- /* determine which set of processing we are doing */
- switch (mode) {
- case SET_EXTEND_POPUP:
- {
- /* present popup menu for ipo extrapolation type */
- event
- = pupmenu("Channel Extending Type %t|"
- "Constant %x11|"
- "Extrapolation %x12|"
- "Cyclic %x13|"
- "Cyclic extrapolation %x14");
- if (event < 1) return;
- }
- break;
- case SET_IPO_POPUP:
- {
- /* present popup menu for ipo interpolation type */
- event
- = pupmenu("Channel Ipo Type %t|"
- "Constant %x1|"
- "Linear %x2|"
- "Bezier %x3");
- if (event < 1) return;
- }
- break;
-
- case SET_IPO_MENU: /* called from menus */
- case SET_EXTEND_MENU:
- break;
-
- default: /* weird, unhandled case */
- return;
- }
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through setting flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- Ipo *ipo= (Ipo *)ale->key_data;
-
- /* depending on the mode */
- switch (mode) {
- case SET_EXTEND_POPUP: /* extrapolation */
- case SET_EXTEND_MENU:
- {
- switch (event) {
- case SET_EXTEND_CONSTANT:
- setexprap_ipoloop(ipo, IPO_HORIZ);
- break;
- case SET_EXTEND_EXTRAPOLATION:
- setexprap_ipoloop(ipo, IPO_DIR);
- break;
- case SET_EXTEND_CYCLIC:
- setexprap_ipoloop(ipo, IPO_CYCL);
- break;
- case SET_EXTEND_CYCLICEXTRAPOLATION:
- setexprap_ipoloop(ipo, IPO_CYCLX);
- break;
- }
- }
- break;
- case SET_IPO_POPUP: /* interpolation */
- case SET_IPO_MENU:
- {
- setipotype_ipo(ipo, event);
- }
- break;
- }
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
-
- if (datatype == ACTCONT_ACTION)
- remake_action_ipos(data);
-
- BIF_undo_push("Set Ipo Type");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* this function sets the handles on keyframes */
-void sethandles_action_keys (int code)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype == ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop through setting flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- sethandles_ipo_keys((Ipo *)ale->key_data, code);
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
- if (datatype == ACTCONT_ACTION)
- remake_action_ipos(data);
-
- BIF_undo_push("Set Handle Type");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* ----------------------------------------- */
-
-/* this gets called when nkey is pressed (no Transform Properties panel yet) */
-static void numbuts_action ()
-{
- void *data;
- short datatype;
-
- void *act_channel, *channel_owner;
- short chantype;
-
- bActionGroup *agrp= NULL;
- bActionChannel *achan= NULL;
- bConstraintChannel *conchan= NULL;
- IpoCurve *icu= NULL;
- KeyBlock *kb= NULL;
- bGPdata *gpd= NULL;
- bGPDlayer *gpl= NULL;
-
- short mval[2];
-
- int but=0;
- char str[128];
- short expand, protect, mute;
- float slidermin, slidermax;
-
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* figure out what is under cursor */
- getmouseco_areawin(mval);
- if (mval[0] > NAMEWIDTH)
- return;
- act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
-
- /* create items for clever-numbut */
- if (chantype == ACTTYPE_ACHAN) {
- /* Action Channel */
- achan= (bActionChannel *)act_channel;
-
- strcpy(str, achan->name);
- protect= (achan->flag & ACHAN_PROTECTED);
- expand = (achan->flag & ACHAN_EXPANDED);
- mute = (achan->ipo)? (achan->ipo->muteipo): 0;
-
- add_numbut(but++, TEX, "ActChan: ", 0, 31, str, "Name of Action Channel");
- add_numbut(but++, TOG|SHO, "Expanded", 0, 24, &expand, "Action Channel is Expanded");
- add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted");
- add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected");
- }
- else if (chantype == ACTTYPE_CONCHAN) {
- /* Constraint Channel */
- conchan= (bConstraintChannel *)act_channel;
-
- strcpy(str, conchan->name);
- protect= (conchan->flag & CONSTRAINT_CHANNEL_PROTECTED);
- mute = (conchan->ipo)? (conchan->ipo->muteipo): 0;
-
- add_numbut(but++, TEX, "ConChan: ", 0, 29, str, "Name of Constraint Channel");
- add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted");
- add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected");
- }
- else if (chantype == ACTTYPE_ICU) {
- /* IPO Curve */
- icu= (IpoCurve *)act_channel;
-
- if (G.saction->pin)
- sprintf(str, getname_ipocurve(icu, NULL));
- else
- sprintf(str, getname_ipocurve(icu, OBACT));
-
- if (IS_EQ(icu->slide_max, icu->slide_min)) {
- if (IS_EQ(icu->ymax, icu->ymin)) {
- icu->slide_min= -100.0;
- icu->slide_max= 100.0;
- }
- else {
- icu->slide_min= icu->ymin;
- icu->slide_max= icu->ymax;
- }
- }
- slidermin= icu->slide_min;
- slidermax= icu->slide_max;
-
- //protect= (icu->flag & IPO_PROTECT);
- mute = (icu->flag & IPO_MUTE);
-
- add_numbut(but++, NUM|FLO, "Slider Min:", -10000, slidermax, &slidermin, 0);
- add_numbut(but++, NUM|FLO, "Slider Max:", slidermin, 10000, &slidermax, 0);
- add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted");
- //add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected");
- }
- else if (chantype == ACTTYPE_SHAPEKEY) {
- /* Shape Key */
- kb= (KeyBlock *)act_channel;
-
- if (kb->name[0] == '\0') {
- Key *key= (Key *)data;
- int keynum= BLI_findindex(&key->block, kb);
-
- sprintf(str, "Key %d", keynum);
- }
- else
- strcpy(str, kb->name);
-
- if (kb->slidermin >= kb->slidermax) {
- kb->slidermin = 0.0;
- kb->slidermax = 1.0;
- }
-
- add_numbut(but++, TEX, "KB: ", 0, 24, str,
- "Does this really need a tool tip?");
- add_numbut(but++, NUM|FLO, "Slider Min:",
- -10000, kb->slidermax, &kb->slidermin, 0);
- add_numbut(but++, NUM|FLO, "Slider Max:",
- kb->slidermin, 10000, &kb->slidermax, 0);
- }
- else if (chantype == ACTTYPE_GROUP) {
- /* Action Group */
- agrp= (bActionGroup *)act_channel;
-
- strcpy(str, agrp->name);
- protect= (agrp->flag & AGRP_PROTECTED);
- expand = (agrp->flag & AGRP_EXPANDED);
-
- add_numbut(but++, TEX, "ActGroup: ", 0, 31, str, "Name of Action Group");
- add_numbut(but++, TOG|SHO, "Expanded", 0, 24, &expand, "Action Group is Expanded");
- add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Group is Protected");
- }
- else if (chantype == ACTTYPE_GPLAYER) {
- /* Grease-Pencil Layer */
- gpd= (bGPdata *)channel_owner;
- gpl= (bGPDlayer *)act_channel;
-
- strcpy(str, gpl->info);
- protect= (gpl->flag & GP_LAYER_LOCKED);
- mute = (gpl->flag & GP_LAYER_HIDE);
-
- add_numbut(but++, TEX, "GP-Layer: ", 0, 128, str, "Name of Grease Pencil Layer");
- add_numbut(but++, TOG|SHO, "Hide", 0, 24, &mute, "Grease Pencil Layer is Visible");
- add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Grease Pencil Layer is Protected");
- }
- else {
- /* nothing under-cursor */
- return;
- }
-
- /* draw clever-numbut */
- if (do_clever_numbuts(str, but, REDRAW)) {
- /* restore settings based on type */
- if (icu) {
- icu->slide_min= slidermin;
- icu->slide_max= slidermax;
-
- //if (protect) icu->flag |= IPO_PROTECT;
- //else icu->flag &= ~IPO_PROTECT;
- if (mute) icu->flag |= IPO_MUTE;
- else icu->flag &= ~IPO_MUTE;
- }
- else if (conchan) {
- strcpy(conchan->name, str);
-
- if (protect) conchan->flag |= CONSTRAINT_CHANNEL_PROTECTED;
- else conchan->flag &= ~CONSTRAINT_CHANNEL_PROTECTED;
-
- if (conchan->ipo)
- conchan->ipo->muteipo = mute;
- }
- else if (achan) {
- strcpy(achan->name, str);
-
- if (expand) achan->flag |= ACHAN_EXPANDED;
- else achan->flag &= ~ACHAN_EXPANDED;
-
- if (protect) achan->flag |= ACHAN_PROTECTED;
- else achan->flag &= ~ACHAN_PROTECTED;
-
- if (achan->ipo)
- achan->ipo->muteipo = mute;
- }
- else if (agrp) {
- strcpy(agrp->name, str);
- BLI_uniquename(&( ((bAction *)data)->groups ), agrp, "Group", offsetof(bActionGroup, name), 32);
-
- if (expand) agrp->flag |= AGRP_EXPANDED;
- else agrp->flag &= ~AGRP_EXPANDED;
-
- if (protect) agrp->flag |= AGRP_PROTECTED;
- else agrp->flag &= ~AGRP_PROTECTED;
- }
- else if (gpl) {
- strcpy(gpl->info, str);
- BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info), 128);
-
- if (mute) gpl->flag |= GP_LAYER_HIDE;
- else gpl->flag &= ~GP_LAYER_HIDE;;
-
- if (protect) gpl->flag |= GP_LAYER_LOCKED;
- else gpl->flag &= ~GP_LAYER_LOCKED;
- }
-
- allqueue(REDRAWACTION, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-/* Set/clear a particular flag (setting) for all selected + visible channels
- * mode: 0 = toggle, 1 = turn on, 2 = turn off
- */
-void setflag_action_channels (short mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- char str[32];
- short val;
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
-
- /* get setting to affect */
- if (mode == 2) {
- val= pupmenu("Disable Setting%t|Protect %x1|Mute%x2");
- sprintf(str, "Disable Action Setting");
- }
- else if (mode == 1) {
- val= pupmenu("Enable Setting%t|Protect %x1|Mute%x2");
- sprintf(str, "Enable Action Setting");
- }
- else {
- val= pupmenu("Toggle Setting%t|Protect %x1|Mute%x2");
- sprintf(str, "Toggle Action Setting");
- }
- if (val <= 0) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS | ACTFILTER_SEL);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* affect selected channels */
- for (ale= act_data.first; ale; ale= ale->next) {
- switch (ale->type) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- /* only 'protect' is available */
- if (val == 1) {
- if (mode == 2)
- agrp->flag &= ~AGRP_PROTECTED;
- else if (mode == 1)
- agrp->flag |= AGRP_PROTECTED;
- else
- agrp->flag ^= AGRP_PROTECTED;
- }
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan= (bActionChannel *)ale->data;
-
- /* 'protect' and 'mute' */
- if ((val == 2) && (achan->ipo)) {
- Ipo *ipo= achan->ipo;
-
- /* mute */
- if (mode == 2)
- ipo->muteipo= 0;
- else if (mode == 1)
- ipo->muteipo= 1;
- else
- ipo->muteipo= (ipo->muteipo) ? 0 : 1;
- }
- else if (val == 1) {
- /* protected */
- if (mode == 2)
- achan->flag &= ~ACHAN_PROTECTED;
- else if (mode == 1)
- achan->flag |= ACHAN_PROTECTED;
- else
- achan->flag ^= ACHAN_PROTECTED;
- }
- }
- break;
- case ACTTYPE_CONCHAN:
- {
- bConstraintChannel *conchan= (bConstraintChannel *)ale->data;
-
- /* 'protect' and 'mute' */
- if ((val == 2) && (conchan->ipo)) {
- Ipo *ipo= conchan->ipo;
-
- /* mute */
- if (mode == 2)
- ipo->muteipo= 0;
- else if (mode == 1)
- ipo->muteipo= 1;
- else
- ipo->muteipo= (ipo->muteipo) ? 0 : 1;
- }
- else if (val == 1) {
- /* protect */
- if (mode == 2)
- conchan->flag &= ~CONSTRAINT_CHANNEL_PROTECTED;
- else if (mode == 1)
- conchan->flag |= CONSTRAINT_CHANNEL_PROTECTED;
- else
- conchan->flag ^= CONSTRAINT_CHANNEL_PROTECTED;
- }
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)ale->data;
-
- /* mute */
- if (val == 2) {
- if (mode == 2)
- icu->flag &= ~IPO_MUTE;
- else if (mode == 1)
- icu->flag |= IPO_MUTE;
- else
- icu->flag ^= IPO_MUTE;
- }
- }
- break;
- case ACTTYPE_GPLAYER:
- {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
-
- /* 'protect' and 'mute' */
- if (val == 2) {
- /* mute */
- if (mode == 2)
- gpl->flag &= ~GP_LAYER_HIDE;
- else if (mode == 1)
- gpl->flag |= GP_LAYER_HIDE;
- else
- gpl->flag ^= GP_LAYER_HIDE;
- }
- else if (val == 1) {
- /* protected */
- if (mode == 2)
- gpl->flag &= ~GP_LAYER_LOCKED;
- else if (mode == 1)
- gpl->flag |= GP_LAYER_LOCKED;
- else
- gpl->flag ^= GP_LAYER_LOCKED;
- }
- }
- break;
- }
- }
- BLI_freelistN(&act_data);
-
- BIF_undo_push(str);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-/* **************************************************** */
-/* CHANNEL SELECTION */
-
-/* select_mode = SELECT_REPLACE
- * = SELECT_ADD
- * = SELECT_SUBTRACT
- * = SELECT_INVERT
- */
-static void select_action_group (bAction *act, bActionGroup *agrp, int selectmode)
-{
- /* Select the channel based on the selection mode */
- short select;
-
- switch (selectmode) {
- case SELECT_ADD:
- agrp->flag |= AGRP_SELECTED;
- break;
- case SELECT_SUBTRACT:
- agrp->flag &= ~AGRP_SELECTED;
- break;
- case SELECT_INVERT:
- agrp->flag ^= AGRP_SELECTED;
- break;
- }
- select = (agrp->flag & AGRP_SELECTED) ? 1 : 0;
-
- set_active_actiongroup(act, agrp, select);
-}
-
-static void hilight_channel (bAction *act, bActionChannel *achan, short select)
-{
- bActionChannel *curchan;
-
- if (!act)
- return;
-
- for (curchan=act->chanbase.first; curchan; curchan=curchan->next) {
- if (curchan==achan && select)
- curchan->flag |= ACHAN_HILIGHTED;
- else
- curchan->flag &= ~ACHAN_HILIGHTED;
- }
-}
-
-/* Syncs selection of channels with selection of object elements in posemode */
-/* messy call... */
-static void select_poseelement_by_name (char *name, int select)
-{
- Object *ob= OBACT;
- bPoseChannel *pchan;
-
- if ((ob==NULL) || (ob->type!=OB_ARMATURE))
- return;
-
- if (abs(select) == 2) {
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next)
- pchan->bone->flag &= ~(BONE_ACTIVE);
- }
-
- pchan= get_pose_channel(ob->pose, name);
- if (pchan) {
- if (select)
- pchan->bone->flag |= (BONE_SELECTED);
- else
- pchan->bone->flag &= ~(BONE_SELECTED);
- if (select == 2)
- pchan->bone->flag |= (BONE_ACTIVE);
- }
-}
-
-/* apparently within active object context */
-/* called extern, like on bone selection */
-void select_actionchannel_by_name (bAction *act, char *name, int select)
-{
- bActionChannel *achan;
-
- if (act == NULL)
- return;
-
- for (achan = act->chanbase.first; achan; achan= achan->next) {
- if (!strcmp(achan->name, name)) {
- if (select) {
- achan->flag |= ACHAN_SELECTED;
- hilight_channel(act, achan, 1);
- }
- else {
- achan->flag &= ~ACHAN_SELECTED;
- hilight_channel(act, achan, 0);
- }
- return;
- }
- }
-}
-
-/* select_mode = SELECT_REPLACE
- * = SELECT_ADD
- * = SELECT_SUBTRACT
- * = SELECT_INVERT
- */
-
-/* exported for outliner (ton) */
-/* apparently within active object context */
-int select_channel (bAction *act, bActionChannel *achan, int selectmode)
-{
- /* Select the channel based on the selection mode */
- int flag;
-
- switch (selectmode) {
- case SELECT_ADD:
- achan->flag |= ACHAN_SELECTED;
- break;
- case SELECT_SUBTRACT:
- achan->flag &= ~ACHAN_SELECTED;
- break;
- case SELECT_INVERT:
- achan->flag ^= ACHAN_SELECTED;
- break;
- }
- flag = (achan->flag & ACHAN_SELECTED) ? 1 : 0;
-
- hilight_channel(act, achan, flag);
- select_poseelement_by_name(achan->name, flag);
-
- return flag;
-}
-
-static int select_constraint_channel (bAction *act,
- bConstraintChannel *conchan,
- int selectmode)
-{
- /* Select the constraint channel based on the selection mode */
- int flag;
-
- switch (selectmode) {
- case SELECT_ADD:
- conchan->flag |= CONSTRAINT_CHANNEL_SELECT;
- break;
- case SELECT_SUBTRACT:
- conchan->flag &= ~CONSTRAINT_CHANNEL_SELECT;
- break;
- case SELECT_INVERT:
- conchan->flag ^= CONSTRAINT_CHANNEL_SELECT;
- break;
- }
- flag = (conchan->flag & CONSTRAINT_CHANNEL_SELECT) ? 1 : 0;
-
- return flag;
-}
-
-int select_icu_channel (bAction *act, IpoCurve *icu, int selectmode)
-{
- /* Select the channel based on the selection mode */
- int flag;
-
- switch (selectmode) {
- case SELECT_ADD:
- icu->flag |= IPO_SELECT;
- break;
- case SELECT_SUBTRACT:
- icu->flag &= ~IPO_SELECT;
- break;
- case SELECT_INVERT:
- icu->flag ^= IPO_SELECT;
- break;
- }
- flag = (icu->flag & IPO_SELECT) ? 1 : 0;
- return flag;
-}
-
-int select_gplayer_channel (bGPdata *gpd, bGPDlayer *gpl, int selectmode)
-{
- /* Select the channel based on the selection mode */
- int flag;
-
- switch (selectmode) {
- case SELECT_ADD:
- gpl->flag |= GP_LAYER_SELECT;
- break;
- case SELECT_SUBTRACT:
- gpl->flag &= ~GP_LAYER_SELECT;
- break;
- case SELECT_INVERT:
- gpl->flag ^= GP_LAYER_SELECT;
- break;
- }
-
- flag = (gpl->flag & GP_LAYER_SELECT) ? 1 : 0;
- if (flag)
- gpencil_layer_setactive(gpd, gpl);
-
- return flag;
-}
-
-
-/* select only the active action-group's action channels */
-void select_action_group_channels (bAction *act, bActionGroup *agrp)
-{
- bActionChannel *achan;
-
- /* error checking */
- if (ELEM(NULL, act, agrp))
- return;
-
- /* deselect all other channels */
- deselect_actionchannels(act, 0);
-
- /* only select channels in group */
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- select_channel(act, achan, SELECT_ADD);
-
- /* messy... set active bone */
- select_poseelement_by_name(achan->name, 1);
- }
-}
-
-/* ----------------------------------------- */
-
-/* De-selects or inverts the selection of Channels in a given Action
- * mode: 0 = default behaviour (select all), 1 = test if (de)select all, 2 = invert all
- */
-void deselect_actionchannels (bAction *act, short mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter, sel=1;
-
- /* filter data */
- filter= ACTFILTER_VISIBLE;
- actdata_filter(&act_data, filter, act, ACTCONT_ACTION);
-
- /* See if we should be selecting or deselecting */
- if (mode == 1) {
- for (ale= act_data.first; ale; ale= ale->next) {
- if (sel == 0)
- break;
-
- switch (ale->type) {
- case ACTTYPE_GROUP:
- if (ale->flag & AGRP_SELECTED)
- sel= 0;
- break;
- case ACTTYPE_ACHAN:
- if (ale->flag & ACHAN_SELECTED)
- sel= 0;
- break;
- case ACTTYPE_CONCHAN:
- if (ale->flag & CONSTRAINT_CHANNEL_SELECT)
- sel=0;
- break;
- case ACTTYPE_ICU:
- if (ale->flag & IPO_SELECT)
- sel=0;
- break;
- }
- }
- }
- else
- sel= 0;
-
- /* Now set the flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- switch (ale->type) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- if (mode == 2)
- agrp->flag ^= AGRP_SELECTED;
- else if (sel)
- agrp->flag |= AGRP_SELECTED;
- else
- agrp->flag &= ~AGRP_SELECTED;
-
- agrp->flag &= ~AGRP_ACTIVE;
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan= (bActionChannel *)ale->data;
-
- if (mode == 2)
- achan->flag ^= AGRP_SELECTED;
- else if (sel)
- achan->flag |= ACHAN_SELECTED;
- else
- achan->flag &= ~ACHAN_SELECTED;
-
- select_poseelement_by_name(achan->name, sel);
- achan->flag &= ~ACHAN_HILIGHTED;
- }
- break;
- case ACTTYPE_CONCHAN:
- {
- bConstraintChannel *conchan= (bConstraintChannel *)ale->data;
-
- if (mode == 2)
- conchan->flag ^= CONSTRAINT_CHANNEL_SELECT;
- else if (sel)
- conchan->flag |= CONSTRAINT_CHANNEL_SELECT;
- else
- conchan->flag &= ~CONSTRAINT_CHANNEL_SELECT;
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)ale->data;
-
- if (mode == 2)
- icu->flag ^= IPO_SELECT;
- else if (sel)
- icu->flag |= IPO_SELECT;
- else
- icu->flag &= ~IPO_SELECT;
-
- icu->flag &= ~IPO_ACTIVE;
- }
- break;
- }
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
-}
-
-/* deselects channels in the action editor */
-void deselect_action_channels (short mode)
-{
- void *data;
- short datatype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* based on type */
- if (datatype == ACTCONT_ACTION)
- deselect_actionchannels(data, mode);
- else if (datatype == ACTCONT_GPENCIL)
- deselect_gpencil_layers(data, mode);
- // should shapekey channels be allowed to do this?
-}
-
-/* deselects keyframes in the action editor */
-void deselect_action_keys (short test, short sel)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* determine type-based settings */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
-
- /* filter data */
- actdata_filter(&act_data, filter, data, datatype);
-
- /* See if we should be selecting or deselecting */
- if (test) {
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER) {
- if (is_gplayer_frame_selected(ale->data)) {
- sel= 0;
- break;
- }
- }
- else {
- if (is_ipo_key_selected(ale->key_data)) {
- sel= 0;
- break;
- }
- }
- }
- }
-
- /* Now set the flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER)
- set_gplayer_frame_selection(ale->data, sel);
- else
- set_ipo_key_selection(ale->key_data, sel);
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
-}
-
-/* selects all keyframes in the action editor - per channel or time
- * mode = 0: all in channel; mode = 1: all in frame
- */
-void selectall_action_keys (short mval[], short mode, short select_mode)
-{
- void *data;
- short datatype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- if (select_mode == SELECT_REPLACE) {
- deselect_action_keys(0, 0);
- select_mode = SELECT_ADD;
- }
-
- /* depending on mode */
- switch (mode) {
- case 0: /* all in channel*/
- {
- void *act_channel, *channel_owner;
- short chantype;
-
- /* get channel, and act according to type */
- act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
- switch (chantype) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)act_channel;
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- select_ipo_bezier_keys(achan->ipo, select_mode);
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next)
- select_ipo_bezier_keys(conchan->ipo, select_mode);
- }
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan= (bActionChannel *)act_channel;
- select_ipo_bezier_keys(achan->ipo, select_mode);
- }
- break;
- case ACTTYPE_CONCHAN:
- {
- bConstraintChannel *conchan= (bConstraintChannel *)act_channel;
- select_ipo_bezier_keys(conchan->ipo, select_mode);
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)act_channel;
- select_icu_bezier_keys(icu, select_mode);
- }
- break;
- case ACTTYPE_GPLAYER:
- {
- bGPDlayer *gpl= (bGPDlayer *)act_channel;
- select_gpencil_frames(gpl, select_mode);
- }
- break;
- }
- }
- break;
- case 1: /* all in frame */
- {
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- rcti rect;
- rctf rectf;
-
- /* use bounding box to find kframe */
- rect.xmin = rect.xmax = mval[0];
- rect.ymin = rect.ymax = mval[1];
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- rectf.xmax= rectf.xmin;
- rectf.ymax= rectf.ymin;
-
- rectf.xmin = rectf.xmin - 0.5f;
- rectf.xmax = rectf.xmax + 0.5f;
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* Now set the flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, select_mode);
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
- }
- break;
- }
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-/* Selects all visible keyframes between the specified markers */
-void markers_selectkeys_between (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- float min, max;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* get extreme markers */
- get_minmax_markers(1, &min, &max);
- if (min==max) return;
- min -= 0.5f;
- max += 0.5f;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* select keys in-between */
- for (ale= act_data.first; ale; ale= ale->next) {
- if(NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else {
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
- }
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
-}
-
-/* Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */
-void selectkeys_leftright (short leftright, short select_mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
- float min, max;
-
- if (select_mode==SELECT_REPLACE) {
- select_mode=SELECT_ADD;
- deselect_action_keys(0, 0);
- }
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- if (leftright == 1) {
- min = -MAXFRAMEF;
- max = (float)(CFRA + 0.1f);
- }
- else {
- min = (float)(CFRA - 0.1f);
- max = MAXFRAMEF;
- }
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* select keys on the side where most data occurs */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else if (ale->type == ACTTYPE_GPLAYER)
- borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD);
- else
- borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD);
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-/* ----------------------------------------- */
-
-/* Jumps to the frame where the next/previous keyframe (that is visible) occurs
- * dir: indicates direction
- */
-void nextprev_action_keyframe (short dir)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- ListBase elems= {NULL, NULL};
- CfraElem *ce, *nearest=NULL;
- float dist, min_dist= 1000000;
-
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* abort if no direction */
- if (dir == 0)
- return;
-
- /* get list of keyframes that can be used (in global-time) */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- make_cfra_list(ale->key_data, &elems);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else if (ale->type == ACTTYPE_GPLAYER)
- gplayer_make_cfra_list(ale->key_data, &elems, 0);
- else
- make_cfra_list(ale->key_data, &elems);
- }
-
- BLI_freelistN(&act_data);
-
- /* find nearest keyframe to current frame */
- for (ce= elems.first; ce; ce= ce->next) {
- dist= ABS(ce->cfra - CFRA);
-
- if (dist < min_dist) {
- min_dist= dist;
- nearest= ce;
- }
- }
-
- /* if a nearest keyframe was found, use the one either side */
- if (nearest) {
- short changed= 0;
-
- if ((dir > 0) && (nearest->next)) {
- CFRA= (int)nearest->next->cfra;
- changed= 1;
- }
- else if ((dir < 0) && (nearest->prev)) {
- CFRA= (int)nearest->prev->cfra;
- changed= 1;
- }
-
- if (changed) {
- update_for_newframe();
- allqueue(REDRAWALL, 0);
- }
- }
-
- /* free temp data */
- BLI_freelistN(&elems);
-}
-
-/* ----------------------------------------- */
-
-/* This function makes a list of the selected keyframes
- * in the ipo curves it has been passed
- */
-static void make_sel_cfra_list (Ipo *ipo, ListBase *elems)
-{
- IpoCurve *icu;
-
- if (ipo == NULL) return;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- BezTriple *bezt;
- int a= 0;
-
- for (bezt=icu->bezt; a<icu->totvert; a++, bezt++) {
- if (bezt && BEZSELECTED(bezt))
- add_to_cfra_elem(elems, bezt);
- }
- }
-}
-
-/* This function selects all key frames in the same column(s) as a already selected key(s)
- * or marker(s), or all the keyframes on a particular frame (triggered by a RMB on x-scrollbar)
- */
-void column_select_action_keys (int mode)
-{
- ListBase elems= {NULL, NULL};
- CfraElem *ce;
- IpoCurve *icu;
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* build list of columns */
- switch (mode) {
- case 1: /* list of selected keys */
- if (datatype == ACTCONT_GPENCIL) {
- filter= (ACTFILTER_VISIBLE);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next)
- gplayer_make_cfra_list(ale->data, &elems, 1);
- }
- else {
- filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next)
- make_sel_cfra_list(ale->key_data, &elems);
- }
-
- BLI_freelistN(&act_data);
- break;
- case 2: /* list of selected markers */
- make_marker_cfra_list(&elems, 1);
-
- /* apply scaled action correction if needed */
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- for (ce= elems.first; ce; ce= ce->next)
- ce->cfra= get_action_frame(OBACT, ce->cfra);
- }
- break;
- case 3: /* current frame */
- /* make a single CfraElem */
- ce= MEM_callocN(sizeof(CfraElem), "cfraElem");
- BLI_addtail(&elems, ce);
-
- /* apply scaled action correction if needed */
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION)
- ce->cfra= (float)get_action_frame(OBACT, (float)CFRA);
- else
- ce->cfra= (float)CFRA;
- }
-
- /* loop through all of the keys and select additional keyframes
- * based on the keys found to be selected above
- */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_ONLYICU);
- actdata_filter(&act_data, filter, data, datatype);
-
- for (ale= act_data.first; ale; ale= ale->next) {
- for (ce= elems.first; ce; ce= ce->next) {
- /* select elements with frame number matching cfraelem */
- if (ale->type == ACTTYPE_GPLAYER) {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
- bGPDframe *gpf;
-
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if ( (int)ce->cfra == gpf->framenum )
- gpf->flag |= GP_FRAME_SELECT;
- }
- }
- else {
- for (icu= ale->key_data; icu; icu= icu->next) {
- BezTriple *bezt;
- int verts = 0;
-
- for (bezt=icu->bezt; verts<icu->totvert; bezt++, verts++) {
- if (bezt) {
- if( (int)(ce->cfra) == (int)(bezt->vec[1][0]) )
- bezt->f2 |= 1;
- }
- }
- }
- }
- }
- }
-
- BLI_freelistN(&act_data);
- BLI_freelistN(&elems);
-}
-
-/* borderselect: for action-channels */
-void borderselect_actionchannels (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- rcti rect;
- rctf rectf;
- int val, selectmode;
- short mval[2];
- float ymin, ymax;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_GPENCIL)==0) return;
-
- /* draw and handle the borderselect stuff (ui) and get the select rect */
- if ( (val = get_border(&rect, 3)) ) {
- selectmode= ((val==LEFTMOUSE) ? SELECT_ADD : SELECT_SUBTRACT);
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax-2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- ymax = CHANNELHEIGHT/2;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop over data, doing border select */
- for (ale= act_data.first; ale; ale= ale->next) {
- ymin=ymax-(CHANNELHEIGHT+CHANNELSKIP);
-
- /* if channel is within border-select region, alter it */
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
- /* only the following types can be selected */
- switch (ale->type) {
- case ACTTYPE_GROUP: /* action group */
- {
- bActionGroup *agrp= (bActionGroup *)ale->data;
-
- if (selectmode == SELECT_ADD)
- agrp->flag |= AGRP_SELECTED;
- else
- agrp->flag &= ~AGRP_SELECTED;
- }
- break;
- case ACTTYPE_ACHAN: /* action channel */
- case ACTTYPE_FILLIPO: /* expand ipo curves = action channel */
- case ACTTYPE_FILLCON: /* expand constraint channels = action channel */
- {
- bActionChannel *achan= (bActionChannel *)ale->data;
-
- if (selectmode == SELECT_ADD)
- achan->flag |= ACHAN_SELECTED;
- else
- achan->flag &= ~ACHAN_SELECTED;
-
- /* messy... set active bone */
- select_poseelement_by_name(achan->name, selectmode);
- }
- break;
- case ACTTYPE_CONCHAN: /* constraint channel */
- {
- bConstraintChannel *conchan = (bConstraintChannel *)ale->data;
-
- if (selectmode == SELECT_ADD)
- conchan->flag |= CONSTRAINT_CHANNEL_SELECT;
- else
- conchan->flag &= ~CONSTRAINT_CHANNEL_SELECT;
- }
- break;
- case ACTTYPE_ICU: /* ipo-curve channel */
- {
- IpoCurve *icu = (IpoCurve *)ale->data;
-
- if (selectmode == SELECT_ADD)
- icu->flag |= IPO_SELECT;
- else
- icu->flag &= ~IPO_SELECT;
- }
- break;
- case ACTTYPE_GPLAYER: /* grease-pencil layer */
- {
- bGPDlayer *gpl = (bGPDlayer *)ale->data;
-
- if (selectmode == SELECT_ADD)
- gpl->flag |= GP_LAYER_SELECT;
- else
- gpl->flag &= ~GP_LAYER_SELECT;
- }
- break;
- }
-
- /* select action-channel 'owner' */
- if ((ale->owner) && (ale->ownertype == ACTTYPE_ACHAN)) {
- bActionChannel *achano= (bActionChannel *)ale->owner;
-
- /* messy... set active bone */
- select_poseelement_by_name(achano->name, selectmode);
- }
- }
-
- ymax=ymin;
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
-
- BIF_undo_push("Border Select Action");
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-/* some quick defines for borderselect modes */
-enum {
- ACTEDIT_BORDERSEL_ALL = 0,
- ACTEDIT_BORDERSEL_FRA,
- ACTEDIT_BORDERSEL_CHA
-};
-
-/* borderselect: for keyframes only */
-void borderselect_action (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- rcti rect;
- rctf rectf;
- int val, selectmode, mode;
- int (*select_function)(BezTriple *);
- short mval[2];
- float ymin, ymax;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* what should be selected (based on the starting location of cursor) */
- getmouseco_areawin(mval);
- if (IN_2D_VERT_SCROLL(mval))
- mode = ACTEDIT_BORDERSEL_CHA;
- else if (IN_2D_HORIZ_SCROLL(mval))
- mode = ACTEDIT_BORDERSEL_FRA;
- else
- mode = ACTEDIT_BORDERSEL_ALL;
-
- /* draw and handle the borderselect stuff (ui) and get the select rect */
- if ( (val = get_border(&rect, 3)) ) {
- if (val == LEFTMOUSE) {
- selectmode = SELECT_ADD;
- select_function = select_bezier_add;
- }
- else {
- selectmode = SELECT_SUBTRACT;
- select_function = select_bezier_subtract;
- }
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax-2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- /* if action is mapped in NLA, it returns a correction */
- if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) {
- rectf.xmin= get_action_frame(OBACT, rectf.xmin);
- rectf.xmax= get_action_frame(OBACT, rectf.xmax);
- }
-
- ymax = CHANNELHEIGHT/2;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* loop over data, doing border select */
- for (ale= act_data.first; ale; ale= ale->next) {
- ymin=ymax-(CHANNELHEIGHT+CHANNELSKIP);
-
- /* what gets selected depends on the mode (based on initial position of cursor) */
- switch (mode) {
- case ACTEDIT_BORDERSEL_FRA: /* all in frame(s) */
- if (ale->key_data) {
- if (ale->datatype == ALE_IPO)
- borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, selectmode);
- else if (ale->datatype == ALE_ICU)
- borderselect_icu_key(ale->key_data, rectf.xmin, rectf.xmax, select_function);
- }
- else if (ale->type == ACTTYPE_GROUP) {
- bActionGroup *agrp= ale->data;
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- borderselect_ipo_key(achan->ipo, rectf.xmin, rectf.xmax, selectmode);
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next)
- borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax, selectmode);
- }
- }
- else if (ale->type == ACTTYPE_GPLAYER) {
- borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode);
- }
- break;
- case ACTEDIT_BORDERSEL_CHA: /* all in channel(s) */
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
- if (ale->key_data) {
- if (ale->datatype == ALE_IPO)
- select_ipo_bezier_keys(ale->key_data, selectmode);
- else if (ale->datatype == ALE_ICU)
- select_icu_bezier_keys(ale->key_data, selectmode);
- }
- else if (ale->type == ACTTYPE_GROUP) {
- bActionGroup *agrp= ale->data;
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- select_ipo_bezier_keys(achan->ipo, selectmode);
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next)
- select_ipo_bezier_keys(conchan->ipo, selectmode);
- }
- }
- else if (ale->type == ACTTYPE_GPLAYER) {
- select_gpencil_frames(ale->data, selectmode);
- }
- }
- break;
- default: /* any keyframe inside region defined by region */
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
- if (ale->key_data) {
- if (ale->datatype == ALE_IPO)
- borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, selectmode);
- else if (ale->datatype == ALE_ICU)
- borderselect_icu_key(ale->key_data, rectf.xmin, rectf.xmax, select_function);
- }
- else if (ale->type == ACTTYPE_GROUP) {
- bActionGroup *agrp= ale->data;
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- borderselect_ipo_key(achan->ipo, rectf.xmin, rectf.xmax, selectmode);
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next)
- borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax, selectmode);
- }
- }
- else if (ale->type == ACTTYPE_GPLAYER) {
- borderselect_gplayer_frames(ale->data, rectf.xmin, rectf.xmax, selectmode);
- }
- }
- }
-
- ymax=ymin;
- }
-
- /* cleanup */
- BLI_freelistN(&act_data);
-
- BIF_undo_push("Border Select Action");
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
-}
-
-/* **************************************************** */
-/* MOUSE-HANDLING */
-
-/* right-hand side - mouse click */
-static void mouse_action (int selectmode)
-{
- void *data;
- short datatype;
-
- bAction *act= NULL;
- bActionGroup *agrp= NULL;
- bActionChannel *achan= NULL;
- bConstraintChannel *conchan= NULL;
- IpoCurve *icu= NULL;
- bGPdata *gpd = NULL;
- bGPDlayer *gpl = NULL;
- TimeMarker *marker, *pmarker;
-
- void *act_channel;
- short sel, act_type = 0;
- float selx = 0.0;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype == ACTCONT_ACTION) act= (bAction *)data;
- if (datatype == ACTCONT_GPENCIL) gpd= (bGPdata *)data;
-
- act_channel= get_nearest_action_key(&selx, &sel, &act_type, &achan);
- marker= find_nearest_marker(SCE_MARKERS, 1);
- pmarker= (act) ? find_nearest_marker(&act->markers, 1) : NULL;
-
- if (marker) {
- /* what about scene's markers? */
- if (selectmode == SELECT_REPLACE) {
- deselect_markers(0, 0);
- marker->flag |= SELECT;
- }
- else if (selectmode == SELECT_INVERT) {
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- }
- else if (selectmode == SELECT_ADD)
- marker->flag |= SELECT;
- else if (selectmode == SELECT_SUBTRACT)
- marker->flag &= ~SELECT;
-
- std_rmouse_transform(transform_markers);
-
- allqueue(REDRAWMARKER, 0);
- }
- else if (pmarker) {
- /* action's markers are drawn behind scene markers */
- if (selectmode == SELECT_REPLACE) {
- action_set_activemarker(act, pmarker, 1);
- pmarker->flag |= SELECT;
- }
- else if (selectmode == SELECT_INVERT) {
- if (pmarker->flag & SELECT) {
- pmarker->flag &= ~SELECT;
- action_set_activemarker(act, NULL, 0);
- }
- else {
- pmarker->flag |= SELECT;
- action_set_activemarker(act, pmarker, 0);
- }
- }
- else if (selectmode == SELECT_ADD) {
- pmarker->flag |= SELECT;
- action_set_activemarker(act, pmarker, 0);
- }
- else if (selectmode == SELECT_SUBTRACT) {
- pmarker->flag &= ~SELECT;
- action_set_activemarker(act, NULL, 0);
- }
-
- // TODO: local-markers cannot be moved atm...
- //std_rmouse_transform(transform_markers);
-
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- else if (act_channel) {
- /* must have been a channel */
- switch (act_type) {
- case ACTTYPE_ICU:
- icu= (IpoCurve *)act_channel;
- break;
- case ACTTYPE_CONCHAN:
- conchan= (bConstraintChannel *)act_channel;
- break;
- case ACTTYPE_ACHAN:
- achan= (bActionChannel *)act_channel;
- break;
- case ACTTYPE_GROUP:
- agrp= (bActionGroup *)act_channel;
- break;
- case ACTTYPE_GPLAYER:
- gpl= (bGPDlayer *)act_channel;
- break;
- default:
- return;
- }
-
- if (selectmode == SELECT_REPLACE) {
- selectmode = SELECT_ADD;
-
- deselect_action_keys(0, 0);
-
- if (datatype == ACTCONT_ACTION) {
- deselect_action_channels(0);
-
- /* Highlight either an Action-Channel or Action-Group */
- if (achan) {
- achan->flag |= ACHAN_SELECTED;
- hilight_channel(act, achan, 1);
- select_poseelement_by_name(achan->name, 2); /* 2 is activate */
- }
- else if (agrp) {
- agrp->flag |= AGRP_SELECTED;
- set_active_actiongroup(act, agrp, 1);
- }
- }
- else if (datatype == ACTCONT_GPENCIL) {
- deselect_action_channels(0);
-
- /* Highlight gpencil layer */
- gpl->flag |= GP_LAYER_SELECT;
- gpencil_layer_setactive(gpd, gpl);
- }
- }
-
- if (icu)
- select_icu_key(icu, selx, selectmode);
- else if (conchan)
- select_ipo_key(conchan->ipo, selx, selectmode);
- else if (achan)
- select_ipo_key(achan->ipo, selx, selectmode);
- else if (agrp) {
- for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) {
- select_ipo_key(achan->ipo, selx, selectmode);
-
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next)
- select_ipo_key(conchan->ipo, selx, selectmode);
- }
- }
- else if (gpl)
- select_gpencil_frame(gpl, (int)selx, selectmode);
-
- std_rmouse_transform(transform_action_keys);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSALL, 0);
- }
-}
-
-/* lefthand side - mouse-click */
-static void mouse_actionchannels (short mval[])
-{
- bAction *act= G.saction->action;
- void *data, *act_channel, *channel_owner;
- short datatype, chantype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* get channel to work on */
- act_channel= get_nearest_act_channel(mval, &chantype, &channel_owner);
-
- /* action to take depends on what channel we've got */
- switch (chantype) {
- case ACTTYPE_GROUP:
- {
- bActionGroup *agrp= (bActionGroup *)act_channel;
-
- if ((mval[0] < 16) && (agrp->channels.first)) {
- /* toggle expand */
- agrp->flag ^= AGRP_EXPANDED;
- }
- else if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle protection/locking */
- agrp->flag ^= AGRP_PROTECTED;
- }
- else {
- /* select/deselect group */
- if (G.qual == LR_SHIFTKEY) {
- /* inverse selection status of group */
- select_action_group(act, agrp, SELECT_INVERT);
- }
- else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- /* select all in group (and deselect everthing else) */
- select_action_group_channels(act, agrp);
- select_action_group(act, agrp, SELECT_ADD);
- }
- else {
- /* select group by itself */
- deselect_actionchannels(act, 0);
- select_action_group(act, agrp, SELECT_ADD);
- }
- }
- }
- break;
- case ACTTYPE_ACHAN:
- {
- bActionChannel *achan= (bActionChannel *)act_channel;
-
- if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle protect */
- achan->flag ^= ACHAN_PROTECTED;
- }
- else if ((mval[0] >= (NAMEWIDTH-32)) && (achan->ipo)) {
- /* toggle mute */
- achan->ipo->muteipo = (achan->ipo->muteipo)? 0: 1;
- }
- else if (mval[0] <= 17) {
- /* toggle expand */
- achan->flag ^= ACHAN_EXPANDED;
- }
- else {
- /* select/deselect achan */
- if (G.qual & LR_SHIFTKEY) {
- select_channel(act, achan, SELECT_INVERT);
- }
- else {
- deselect_actionchannels(act, 0);
- select_channel(act, achan, SELECT_ADD);
- }
-
- /* messy... set active bone */
- select_poseelement_by_name(achan->name, 2);
- }
- }
- break;
- case ACTTYPE_FILLIPO:
- {
- bActionChannel *achan= (bActionChannel *)act_channel;
-
- achan->flag ^= ACHAN_SHOWIPO;
-
- if ((mval[0] > 24) && (achan->flag & ACHAN_SHOWIPO)) {
- /* select+make active achan */
- deselect_actionchannels(act, 0);
- select_channel(act, achan, SELECT_ADD);
-
- /* messy... set active bone */
- select_poseelement_by_name(achan->name, 2);
- }
- }
- break;
- case ACTTYPE_FILLCON:
- {
- bActionChannel *achan= (bActionChannel *)act_channel;
-
- achan->flag ^= ACHAN_SHOWCONS;
-
- if ((mval[0] > 24) && (achan->flag & ACHAN_SHOWCONS)) {
- /* select+make active achan */
- deselect_actionchannels(act, 0);
- select_channel(act, achan, SELECT_ADD);
-
- /* messy... set active bone */
- select_poseelement_by_name(achan->name, 2);
- }
- }
- break;
- case ACTTYPE_ICU:
- {
- IpoCurve *icu= (IpoCurve *)act_channel;
-
-#if 0 /* disabled until all ipo tools support this -------> */
- if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle protection */
- icu->flag ^= IPO_PROTECT;
- }
-#endif /* <------- end of disabled code */
- if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle mute */
- icu->flag ^= IPO_MUTE;
- }
- else {
- /* select/deselect */
- select_icu_channel(act, icu, SELECT_INVERT);
- }
-
- allspace(REMAKEIPO, 0);
- }
- break;
- case ACTTYPE_CONCHAN:
- {
- bConstraintChannel *conchan= (bConstraintChannel *)act_channel;
-
- if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle protection */
- conchan->flag ^= CONSTRAINT_CHANNEL_PROTECTED;
- }
- else if ((mval[0] >= (NAMEWIDTH-32)) && (conchan->ipo)) {
- /* toggle mute */
- conchan->ipo->muteipo = (conchan->ipo->muteipo)? 0: 1;
- }
- else {
- /* select/deselect */
- select_constraint_channel(act, conchan, SELECT_INVERT);
- }
- }
- break;
- case ACTTYPE_GPDATABLOCK:
- {
- bGPdata *gpd= (bGPdata *)act_channel;
-
- /* toggle expand */
- gpd->flag ^= GP_DATA_EXPAND;
- }
- break;
- case ACTTYPE_GPLAYER:
- {
- bGPdata *gpd= (bGPdata *)channel_owner;
- bGPDlayer *gpl= (bGPDlayer *)act_channel;
-
- if (mval[0] >= (NAMEWIDTH-16)) {
- /* toggle lock */
- gpl->flag ^= GP_LAYER_LOCKED;
- }
- else if (mval[0] >= (NAMEWIDTH-32)) {
- /* toggle hide */
- gpl->flag ^= GP_LAYER_HIDE;
- }
- else {
- /* select/deselect */
- if (G.qual & LR_SHIFTKEY) {
- select_gplayer_channel(gpd, gpl, SELECT_INVERT);
- }
- else {
- deselect_gpencil_layers(data, 0);
- select_gplayer_channel(gpd, gpl, SELECT_INVERT);
- }
- }
- }
- break;
- default:
- return;
- }
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSALL, 0);
-}
-
-/* **************************************************** */
-/* ACTION CHANNEL RE-ORDERING */
-
-/* make sure all action-channels belong to a group (and clear action's list) */
-static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
-{
- bActionChannel *achan;
- bActionGroup *agrp;
-
- /* Separate action-channels into lists per group */
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- if (agrp->channels.first) {
- achan= agrp->channels.last;
- act->chanbase.first= achan->next;
-
- achan= agrp->channels.first;
- achan->prev= NULL;
-
- achan= agrp->channels.last;
- achan->next= NULL;
- }
- }
-
- /* Initialise memory for temp-group */
- memset(tgrp, 0, sizeof(bActionGroup));
- tgrp->flag |= (AGRP_EXPANDED|AGRP_TEMP);
- strcpy(tgrp->name, "#TempGroup");
-
- /* Move any action-channels not already moved, to the temp group */
- if (act->chanbase.first) {
- /* start of list */
- achan= act->chanbase.first;
- achan->prev= NULL;
- tgrp->channels.first= achan;
- act->chanbase.first= NULL;
-
- /* end of list */
- achan= act->chanbase.last;
- achan->next= NULL;
- tgrp->channels.last= achan;
- act->chanbase.last= NULL;
- }
-
- /* Add temp-group to list */
- BLI_addtail(&act->groups, tgrp);
-}
-
-/* link lists of channels that groups have */
-static void join_groups_action_temp (bAction *act)
-{
- bActionGroup *agrp;
- bActionChannel *achan;
-
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- ListBase tempGroup;
-
- /* add list of channels to action's channels */
- tempGroup= agrp->channels;
- addlisttolist(&act->chanbase, &agrp->channels);
- agrp->channels= tempGroup;
-
- /* clear moved flag */
- agrp->flag &= ~AGRP_MOVED;
-
- /* if temp-group... remove from list (but don't free as it's on the stack!) */
- if (agrp->flag & AGRP_TEMP) {
- BLI_remlink(&act->groups, agrp);
- break;
- }
- }
-
- /* clear "moved" flag from all achans */
- for (achan= act->chanbase.first; achan; achan= achan->next)
- achan->flag &= ~ACHAN_MOVED;
-}
-
-
-static short rearrange_actchannel_is_ok (Link *channel, short type)
-{
- if (type == ACTTYPE_GROUP) {
- bActionGroup *agrp= (bActionGroup *)channel;
-
- if (SEL_AGRP(agrp) && !(agrp->flag & AGRP_MOVED))
- return 1;
- }
- else if (type == ACTTYPE_ACHAN) {
- bActionChannel *achan= (bActionChannel *)channel;
-
- if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan) && !(achan->flag & ACHAN_MOVED))
- return 1;
- }
-
- return 0;
-}
-
-static short rearrange_actchannel_after_ok (Link *channel, short type)
-{
- if (type == ACTTYPE_GROUP) {
- bActionGroup *agrp= (bActionGroup *)channel;
-
- if (agrp->flag & AGRP_TEMP)
- return 0;
- }
-
- return 1;
-}
-
-
-static short rearrange_actchannel_top (ListBase *list, Link *channel, short type)
-{
- if (rearrange_actchannel_is_ok(channel, type)) {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* make it first element */
- BLI_insertlinkbefore(list, list->first, channel);
-
- return 1;
- }
-
- return 0;
-}
-
-static short rearrange_actchannel_up (ListBase *list, Link *channel, short type)
-{
- if (rearrange_actchannel_is_ok(channel, type)) {
- Link *prev= channel->prev;
-
- if (prev) {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* push it up */
- BLI_insertlinkbefore(list, prev, channel);
-
- return 1;
- }
- }
-
- return 0;
-}
-
-static short rearrange_actchannel_down (ListBase *list, Link *channel, short type)
-{
- if (rearrange_actchannel_is_ok(channel, type)) {
- Link *next = (channel->next) ? channel->next->next : NULL;
-
- if (next) {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* move it down */
- BLI_insertlinkbefore(list, next, channel);
-
- return 1;
- }
- else if (rearrange_actchannel_after_ok(list->last, type)) {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* add at end */
- BLI_addtail(list, channel);
-
- return 1;
- }
- else {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* add just before end */
- BLI_insertlinkbefore(list, list->last, channel);
-
- return 1;
- }
- }
-
- return 0;
-}
-
-static short rearrange_actchannel_bottom (ListBase *list, Link *channel, short type)
-{
- if (rearrange_actchannel_is_ok(channel, type)) {
- if (rearrange_actchannel_after_ok(list->last, type)) {
- /* take it out off the chain keep data */
- BLI_remlink(list, channel);
-
- /* add at end */
- BLI_addtail(list, channel);
-
- return 1;
- }
- }
-
- return 0;
-}
-
-
-/* Change the order of action-channels
- * mode: REARRANGE_ACTCHAN_*
- */
-void rearrange_action_channels (short mode)
-{
- bAction *act;
- bActionChannel *achan, *chan;
- bActionGroup *agrp, *grp;
- bActionGroup tgrp;
-
- void *data;
- short datatype;
-
- short (*rearrange_func)(ListBase *, Link *, short);
- short do_channels = 1;
- char undostr[60];
-
- /* Get the active action, exit if none are selected */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* exit if invalid mode */
- switch (mode) {
- case REARRANGE_ACTCHAN_TOP:
- strcpy(undostr, "Channel(s) to Top");
- rearrange_func= rearrange_actchannel_top;
- break;
- case REARRANGE_ACTCHAN_UP:
- strcpy(undostr, "Channel(s) Move Up");
- rearrange_func= rearrange_actchannel_up;
- break;
- case REARRANGE_ACTCHAN_DOWN:
- strcpy(undostr, "Channel(s) Move Down");
- rearrange_func= rearrange_actchannel_down;
- break;
- case REARRANGE_ACTCHAN_BOTTOM:
- strcpy(undostr, "Channel(s) to Bottom");
- rearrange_func= rearrange_actchannel_bottom;
- break;
- default:
- return;
- }
-
- /* make sure we're only operating with groups */
- split_groups_action_temp(act, &tgrp);
-
- /* rearrange groups first (and then, only consider channels if the groups weren't moved) */
- #define GET_FIRST(list) ((mode > 0) ? (list.first) : (list.last))
- #define GET_NEXT(item) ((mode > 0) ? (item->next) : (item->prev))
-
- for (agrp= GET_FIRST(act->groups); agrp; agrp= grp) {
- /* Get next group to consider */
- grp= GET_NEXT(agrp);
-
- /* try to do group first */
- if (rearrange_func(&act->groups, (Link *)agrp, ACTTYPE_GROUP)) {
- do_channels= 0;
- agrp->flag |= AGRP_MOVED;
- }
- }
-
- if (do_channels) {
- for (agrp= GET_FIRST(act->groups); agrp; agrp= grp) {
- /* Get next group to consider */
- grp= GET_NEXT(agrp);
-
- /* only consider action-channels if they're visible (group expanded) */
- if (EXPANDED_AGRP(agrp)) {
- for (achan= GET_FIRST(agrp->channels); achan; achan= chan) {
- /* Get next channel to consider */
- chan= GET_NEXT(achan);
-
- /* Try to do channel */
- if (rearrange_func(&agrp->channels, (Link *)achan, ACTTYPE_ACHAN))
- achan->flag |= ACHAN_MOVED;
- }
- }
- }
- }
- #undef GET_FIRST
- #undef GET_NEXT
-
- /* assemble lists into one list (and clear moved tags) */
- join_groups_action_temp(act);
-
- /* Undo + redraw */
- BIF_undo_push(undostr);
- allqueue(REDRAWACTION, 0);
-}
-
-/* ******************************************************************* */
-/* CHANNEL VISIBILITY/FOLDING */
-
-/* Expand all channels to show full hierachy */
-void expand_all_action (void)
-{
- void *data;
- short datatype;
-
- bAction *act;
- bActionChannel *achan;
- bActionGroup *agrp;
- short mode= 1;
-
- /* Get the selected action, exit if none are selected */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* check if expand all, or close all */
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- if (EXPANDED_AGRP(agrp)) {
- mode= 0;
- break;
- }
- }
-
- if (mode == 0) {
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- if (VISIBLE_ACHAN(achan)) {
- if (EXPANDED_ACHAN(achan)) {
- mode= 0;
- break;
- }
- }
- }
- }
-
- /* expand/collapse depending on mode */
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- if (mode == 1)
- agrp->flag |= AGRP_EXPANDED;
- else
- agrp->flag &= ~AGRP_EXPANDED;
- }
-
- for (achan=act->chanbase.first; achan; achan= achan->next) {
- if (VISIBLE_ACHAN(achan)) {
- if (mode == 1)
- achan->flag |= (ACHAN_EXPANDED|ACHAN_SHOWIPO|ACHAN_SHOWCONS);
- else
- achan->flag &= ~(ACHAN_EXPANDED|ACHAN_SHOWIPO|ACHAN_SHOWCONS);
- }
- }
-
- /* Cleanup and do redraws */
- BIF_undo_push("Expand Action Hierachy");
- allqueue(REDRAWACTION, 0);
-}
-
-/* Expands those groups which are hiding a selected actionchannel */
-void expand_obscuregroups_action (void)
-{
- void *data;
- short datatype;
-
- bAction *act;
- bActionChannel *achan;
-
- /* Get the selected action, exit if none are selected */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* check if expand all, or close all */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan)) {
- if (achan->grp)
- achan->grp->flag |= AGRP_EXPANDED;
- }
- }
-
- /* Cleanup and do redraws */
- BIF_undo_push("Show Group-Hidden Channels");
- allqueue(REDRAWACTION, 0);
-}
-
-/* For visible channels, expand/collapse one level */
-void openclose_level_action (short mode)
-{
- void *data;
- short datatype;
-
- bAction *act;
- bActionChannel *achan;
- bActionGroup *agrp;
-
- /* Get the selected action, exit if none are selected */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_ACTION) return;
- act= (bAction *)data;
-
- /* Abort if no operation required */
- if (mode == 0) return;
-
- /* Only affect selected channels */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- /* make sure if there is a group, it isn't about to be collapsed and is open */
- if ( (achan->grp==NULL) || (EXPANDED_AGRP(achan->grp) && SEL_AGRP(achan->grp)==0) ) {
- if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan)) {
- if (EXPANDED_ACHAN(achan)) {
- if (FILTER_IPO_ACHAN(achan) || FILTER_CON_ACHAN(achan)) {
- if (mode < 0)
- achan->flag &= ~(ACHAN_SHOWIPO|ACHAN_SHOWCONS);
- }
- else {
- if (mode > 0)
- achan->flag |= (ACHAN_SHOWIPO|ACHAN_SHOWCONS);
- else
- achan->flag &= ~ACHAN_EXPANDED;
- }
- }
- else {
- if (mode > 0)
- achan->flag |= ACHAN_EXPANDED;
- }
- }
- }
- }
-
- /* Expand/collapse selected groups */
- for (agrp= act->groups.first; agrp; agrp= agrp->next) {
- if (SEL_AGRP(agrp)) {
- if (mode < 0)
- agrp->flag &= ~AGRP_EXPANDED;
- else
- agrp->flag |= AGRP_EXPANDED;
- }
- }
-
- /* Cleanup and do redraws */
- BIF_undo_push("Expand/Collapse Action Level");
- allqueue(REDRAWACTION, 0);
-}
-
-/* **************************************************** */
-/* ACTION MARKERS (PoseLib features) */
-/* NOTE: yes, these duplicate code from edittime.c a bit, but these do a bit more...
- * These could get merged with those someday if need be... (Aligorith, 20071230)
- */
-
-/* Makes the given marker the active one
- * - deselect indicates whether unactive ones should be deselected too
- */
-void action_set_activemarker (bAction *act, TimeMarker *active, short deselect)
-{
- TimeMarker *marker;
- int index= 0;
-
- /* sanity checks */
- if (act == NULL)
- return;
- act->active_marker= 0;
-
- /* set appropriate flags for all markers */
- for (marker=act->markers.first; marker; marker=marker->next, index++) {
- /* only active may be active */
- if (marker == active) {
- act->active_marker= index + 1;
- marker->flag |= (SELECT|ACTIVE);
- }
- else {
- if (deselect)
- marker->flag &= ~(SELECT|ACTIVE);
- else
- marker->flag &= ~ACTIVE;
- }
- }
-}
-
-/* Adds a local marker to the active action */
-void action_add_localmarker (bAction *act, int frame)
-{
- TimeMarker *marker;
- char name[64];
-
- /* sanity checks */
- if (act == NULL)
- return;
-
- /* get name of marker */
- sprintf(name, "Pose");
- if (sbutton(name, 0, sizeof(name)-1, "Name: ") == 0)
- return;
-
- /* add marker to action - replaces any existing marker there */
- for (marker= act->markers.first; marker; marker= marker->next) {
- if (marker->frame == frame) {
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- break;
- }
- }
- if (marker == NULL) {
- marker= MEM_callocN(sizeof(TimeMarker), "ActionMarker");
-
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- marker->frame= frame;
-
- BLI_addtail(&act->markers, marker);
- }
-
- /* validate the name */
- BLI_uniquename(&act->markers, marker, "Pose", offsetof(TimeMarker, name), 64);
-
- /* sets the newly added marker as the active one */
- action_set_activemarker(act, marker, 1);
-
- BIF_undo_push("Action Add Marker");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-/* Renames the active local marker to the active action */
-void action_rename_localmarker (bAction *act)
-{
- TimeMarker *marker;
- char name[64];
- int val;
-
- /* sanity checks */
- if (act == NULL)
- return;
-
- /* get active marker to rename */
- if (act->active_marker == 0)
- return;
- else
- val= act->active_marker;
-
- if (val <= 0) return;
- marker= BLI_findlink(&act->markers, val-1);
- if (marker == NULL) return;
-
- /* get name of marker */
- sprintf(name, marker->name);
- if (sbutton(name, 0, sizeof(name)-1, "Name: ") == 0)
- return;
-
- /* copy then validate name */
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- BLI_uniquename(&act->markers, marker, "Pose", offsetof(TimeMarker, name), 64);
-
- /* undo and update */
- BIF_undo_push("Action Rename Marker");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
-}
-
-/* Deletes all selected markers, and adjusts things as appropriate */
-void action_remove_localmarkers (bAction *act)
-{
- TimeMarker *marker, *next;
-
- /* sanity checks */
- if (act == NULL)
- return;
-
- /* remove selected markers */
- for (marker= act->markers.first; marker; marker= next) {
- next= marker->next;
-
- if (marker->flag & SELECT)
- BLI_freelinkN(&act->markers, marker);
- }
-
- /* clear active just in case */
- act->active_marker= 0;
-
- /* undo and update */
- BIF_undo_push("Action Remove Marker(s)");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
-}
-
-/* **************************************************** */
-/* EVENT HANDLING */
-
-void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- extern void do_actionbuts(unsigned short event); // drawaction.c
- SpaceAction *saction;
- void *data;
- short datatype;
- float dx, dy;
- int doredraw= 0;
- int cfra;
- short mval[2];
- unsigned short event= evt->event;
- short val= evt->val;
- short mousebut = L_MOUSE;
-
- if (curarea->win==0) return;
-
- saction= curarea->spacedata.first;
- if (!saction)
- return;
-
- data= get_action_context(&datatype);
-
- if (val) {
- if ( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- }
- else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- getmouseco_areawin(mval);
-
- switch(event) {
- case UI_BUT_EVENT:
- do_actionbuts(val); /* window itself */
- break;
-
- /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
- * based on user preference USER_LMOUSESELECT
- */
- case LEFTMOUSE:
- if (view2dmove(LEFTMOUSE)) /* only checks for sliders */
- break;
- else if ((G.v2d->mask.xmin==0) || (mval[0] > ACTWIDTH)) {
- /* moving time-marker / current frame */
- do {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- cfra= (int)(dx+0.5f);
- if (cfra < 1) cfra= 1;
-
- if (cfra != CFRA) {
- CFRA= cfra;
- update_for_newframe();
- force_draw_all(0);
- }
- else
- PIL_sleep_ms(30);
- }
- while(get_mbut() & mousebut);
- break;
- }
- /* passed on as selection */
- case RIGHTMOUSE:
- /* Clicking in the channel area */
- if ((G.v2d->mask.xmin) && (mval[0] < NAMEWIDTH)) {
- if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_GPENCIL)) {
- /* mouse is over action channels */
- if (G.qual == LR_CTRLKEY)
- numbuts_action();
- else
- mouse_actionchannels(mval);
- }
- else
- numbuts_action();
- }
- else {
- short select_mode= (G.qual & LR_SHIFTKEY)? SELECT_INVERT: SELECT_REPLACE;
-
- /* Clicking in the vertical scrollbar selects
- * all of the keys for that channel at that height
- */
- if (IN_2D_VERT_SCROLL(mval))
- selectall_action_keys(mval, 0, select_mode);
-
- /* Clicking in the horizontal scrollbar selects
- * all of the keys within 0.5 of the nearest integer
- * frame
- */
- else if (IN_2D_HORIZ_SCROLL(mval))
- selectall_action_keys(mval, 1, select_mode);
-
- /* Clicking in the main area of the action window
- * selects keys and markers
- */
- else if (G.qual & LR_ALTKEY) {
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- /* sends a 1 for left and 0 for right */
- selectkeys_leftright((dx < (float)CFRA), select_mode);
- }
- else
- mouse_action(select_mode);
- }
- break;
-
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
-
- case AKEY:
- if (mval[0] < NAMEWIDTH) {
- deselect_action_channels(1);
- BIF_undo_push("(De)Select Action Channels");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- }
- else if (mval[0] > ACTWIDTH) {
- if (G.qual == LR_CTRLKEY) {
- deselect_markers(1, 0);
- BIF_undo_push("(De)Select Markers");
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWSOUND, 0);
- }
- else {
- deselect_action_keys(1, 1);
- BIF_undo_push("(De)Select Keys");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- }
- }
- break;
-
- case BKEY:
- if (G.qual & LR_CTRLKEY) {
- borderselect_markers();
- }
- else {
- if (mval[0] <= ACTWIDTH)
- borderselect_actionchannels();
- else
- borderselect_action();
- }
- break;
-
- case CKEY:
- /* scroll the window so the current
- * frame is in the center.
- */
- center_currframe();
- break;
-
- case DKEY:
- if (mval[0] > ACTWIDTH) {
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- duplicate_marker();
- else if (G.qual == LR_SHIFTKEY)
- duplicate_action_keys();
- }
- break;
-
- case EKEY:
- if (mval[0] >= ACTWIDTH)
- transform_action_keys('e', 0);
- break;
-
- case GKEY:
- /* Action Channel Groups */
- if (G.qual == LR_SHIFTKEY)
- action_groups_group(0);
- else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- action_groups_group(1);
- else if (G.qual == LR_ALTKEY)
- action_groups_ungroup();
-
- /* Transforms */
- else {
- if (mval[0] >= ACTWIDTH) {
- if (G.qual == LR_CTRLKEY)
- transform_markers('g', 0);
- else
- transform_action_keys('g', 0);
- }
- }
- break;
-
- case HKEY:
- if (G.qual & LR_SHIFTKEY) {
- if (okee("Set Keys to Auto Handle"))
- sethandles_action_keys(HD_AUTO);
- }
- else {
- if (okee("Toggle Keys Aligned Handle"))
- sethandles_action_keys(HD_ALIGN);
- }
- break;
-
- case IKEY:
- if (G.qual & LR_CTRLKEY) {
- if (mval[0] < ACTWIDTH) {
- deselect_action_channels(2);
- BIF_undo_push("Inverse Action Channels");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- }
- else if (G.qual & LR_SHIFTKEY) {
- deselect_markers(0, 2);
- BIF_undo_push("Inverse Markers");
- allqueue(REDRAWMARKER, 0);
- }
- else {
- deselect_action_keys(0, 2);
- BIF_undo_push("Inverse Keys");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- }
- }
- break;
-
- case KKEY:
- if (G.qual == LR_ALTKEY)
- markers_selectkeys_between();
- else if (G.qual == LR_SHIFTKEY)
- column_select_action_keys(2);
- else if (G.qual == LR_CTRLKEY)
- column_select_action_keys(3);
- else
- column_select_action_keys(1);
-
- allqueue(REDRAWMARKER, 0);
- break;
-
- case LKEY:
- /* poselib manipulation - only for actions */
- if (datatype == ACTCONT_ACTION) {
- if (G.qual == LR_SHIFTKEY)
- action_add_localmarker(data, CFRA);
- else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- action_rename_localmarker(data);
- else if (G.qual == LR_ALTKEY)
- action_remove_localmarkers(data);
- else if (G.qual == LR_CTRLKEY) {
- G.saction->flag |= SACTION_POSEMARKERS_MOVE;
- transform_markers('g', 0);
- G.saction->flag &= ~SACTION_POSEMARKERS_MOVE;
- }
- }
- break;
-
- case MKEY:
- if (G.qual & LR_SHIFTKEY) {
- /* mirror keyframes */
- if (data) {
- if (G.saction->flag & SACTION_DRAWTIME)
- val = pupmenu("Mirror Keys Over%t|Current Time%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4");
- else
- val = pupmenu("Mirror Keys Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4");
-
- mirror_action_keys(val);
- }
- }
- else {
- /* marker operations */
- if (G.qual == 0)
- add_marker(CFRA);
- else if (G.qual == LR_CTRLKEY)
- rename_marker();
- else
- break;
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- case NKEY:
- if (G.qual==0) {
- /* panel will not always show useful info! */
- if (mval[0] > ACTWIDTH) {
- add_blockhandler(curarea, ACTION_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- scrarea_queue_winredraw(curarea);
- }
- else
- numbuts_action();
- }
- break;
-
- case OKEY:
- if (G.qual & LR_ALTKEY)
- sample_action_keys();
- else
- clean_action();
- break;
-
- case PKEY:
- if (G.qual == (LR_CTRLKEY|LR_ALTKEY)) /* set preview range to range of action */
- action_previewrange_set(G.saction->action);
- else if (G.qual & LR_CTRLKEY) /* set preview range */
- anim_previewrange_set();
- else if (G.qual & LR_ALTKEY) /* clear preview range */
- anim_previewrange_clear();
-
- allqueue(REDRAWMARKER, 0);
- allqueue(REDRAWBUTSALL, 0);
- break;
-
- case SKEY:
- if (mval[0]>=ACTWIDTH) {
- if (G.qual == (LR_SHIFTKEY|LR_CTRLKEY)) {
- if (data) {
- snap_cfra_action();
- }
- }
- else if (G.qual & LR_SHIFTKEY) {
- if (data) {
- if (G.saction->flag & SACTION_DRAWTIME)
- val = pupmenu("Snap Keys To%t|Nearest Second%x4|Current Time%x2|Nearest Marker %x3");
- else
- val = pupmenu("Snap Keys To%t|Nearest Frame%x1|Current Frame%x2|Nearest Marker %x3");
-
- snap_action_keys(val);
- }
- }
- else {
- transform_action_keys('s', 0);
- }
- }
- break;
-
- case TKEY:
- if (G.qual & LR_SHIFTKEY)
- action_set_ipo_flags(SET_IPO_POPUP, 0);
- else if (G.qual & LR_CTRLKEY) {
- val= pupmenu("Time value%t|Frames %x1|Seconds%x2");
-
- if (val > 0) {
- if (val == 2) saction->flag |= SACTION_DRAWTIME;
- else saction->flag &= ~SACTION_DRAWTIME;
-
- doredraw= 1;
- }
- }
- else
- transform_action_keys ('t', 0);
- break;
-
- case VKEY:
- if (okee("Set Keys to Vector Handle"))
- sethandles_action_keys(HD_VECT);
- break;
-
- case WKEY:
- /* toggle/turn-on\off-based-on-setting */
- if (G.qual) {
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- val= 1;
- else if (G.qual == LR_ALTKEY)
- val= 2;
- else
- val= 0;
-
- setflag_action_channels(val);
- }
- break;
-
- case PAGEUPKEY:
- if (datatype == ACTCONT_ACTION) {
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- rearrange_action_channels(REARRANGE_ACTCHAN_TOP);
- else if (G.qual == LR_SHIFTKEY)
- rearrange_action_channels(REARRANGE_ACTCHAN_UP);
- else if (G.qual == LR_CTRLKEY)
- nextprev_action_keyframe(1);
- else
- nextprev_marker(1);
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- /* only jump to markers possible (key channels can't be moved yet) */
- if (G.qual == LR_CTRLKEY)
- nextprev_action_keyframe(1);
- else
- nextprev_marker(1);
- }
- break;
- case PAGEDOWNKEY:
- if (datatype == ACTCONT_ACTION) {
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- rearrange_action_channels(REARRANGE_ACTCHAN_BOTTOM);
- else if (G.qual == LR_SHIFTKEY)
- rearrange_action_channels(REARRANGE_ACTCHAN_DOWN);
- else if (G.qual == LR_CTRLKEY)
- nextprev_action_keyframe(-1);
- else
- nextprev_marker(-1);
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- /* only jump to markers possible (key channels can't be moved yet) */
- if (G.qual == LR_CTRLKEY)
- nextprev_action_keyframe(-1);
- else
- nextprev_marker(-1);
- }
- break;
-
- case DELKEY:
- case XKEY:
- /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
- if (G.qual == LR_SHIFTKEY) {
- if (okee("Erase selected marker(s)?")) {
- if (mval[0] >= NAMEWIDTH)
- remove_marker();
- }
- }
- else {
- if (okee("Erase selected?")) {
- if (mval[0] < NAMEWIDTH) {
- if (datatype == ACTCONT_ACTION)
- delete_action_channels();
- else if (datatype == ACTCONT_GPENCIL)
- delete_gpencil_layers();
- }
- else
- delete_action_keys();
- }
- }
-
- allqueue(REDRAWMARKER, 0);
-
- break;
-
- case ACCENTGRAVEKEY:
- if (datatype == ACTCONT_ACTION) {
- if (G.qual == LR_SHIFTKEY)
- expand_obscuregroups_action();
- else
- expand_all_action();
- }
- break;
-
- case PADPLUSKEY:
- if (G.qual == LR_CTRLKEY) {
- if (datatype == ACTCONT_ACTION)
- openclose_level_action(1);
- }
- else {
- view2d_zoom(G.v2d, 0.1154f, sa->winx, sa->winy);
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-
- doredraw= 1;
- }
- break;
- case PADMINUS:
- if (G.qual == LR_CTRLKEY) {
- if (datatype == ACTCONT_ACTION)
- openclose_level_action(-1);
- }
- else {
- view2d_zoom(G.v2d, -0.15f, sa->winx, sa->winy);
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-
- doredraw= 1;
- }
- break;
-
- case HOMEKEY:
- do_action_buttons(B_ACTHOME); /* header */
- break;
- }
- }
-
- if (doredraw) addqueue(curarea->win, REDRAW, 1);
-}
-
-/* **************************************************** */
diff --git a/source/blender/src/editaction_gpencil.c b/source/blender/src/editaction_gpencil.c
deleted file mode 100644
index fb070624e8f..00000000000
--- a/source/blender/src/editaction_gpencil.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "DNA_listBase.h"
-#include "DNA_action_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_view2d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_blender.h"
-#include "BKE_ipo.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_butspace.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_toets.h"
-
-#include "BIF_editaction.h"
-#include "BSE_editaction_types.h"
-
-#include "BDR_gpencil.h"
-#include "BIF_drawgpencil.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-#include "butspace.h"
-
-#include "PIL_time.h"
-#include "mydevice.h"
-
-/* ***************************************** */
-/* NOTE ABOUT THIS FILE:
- * This file contains code for editing Grease Pencil data in the Action Editor
- * as a 'keyframes', so that a user can adjust the timing of Grease Pencil drawings.
- * Therefore, this file mostly contains functions for selecting Grease-Pencil frames.
- */
-/* ***************************************** */
-/* Generics - Loopers */
-
-/* Loops over the gp-frames for a gp-layer, and applies the given callback */
-short gplayer_frames_looper (bGPDlayer *gpl, short (*gpf_cb)(bGPDframe *))
-{
- bGPDframe *gpf;
-
- /* error checker */
- if (gpl == NULL)
- return 0;
-
- /* do loop */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- /* execute callback */
- if (gpf_cb(gpf))
- return 1;
- }
-
- /* nothing to return */
- return 0;
-}
-
-/* ****************************************** */
-/* Data Conversion Tools */
-
-/* make a listing all the gp-frames in a layer as cfraelems */
-void gplayer_make_cfra_list (bGPDlayer *gpl, ListBase *elems, short onlysel)
-{
- bGPDframe *gpf;
- CfraElem *ce;
-
- /* error checking */
- if (ELEM(NULL, gpl, elems))
- return;
-
- /* loop through gp-frames, adding */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if ((onlysel == 0) || (gpf->flag & GP_FRAME_SELECT)) {
- ce= MEM_callocN(sizeof(CfraElem), "CfraElem");
-
- ce->cfra= (float)gpf->framenum;
- ce->sel= (gpf->flag & GP_FRAME_SELECT) ? 1 : 0;
-
- BLI_addtail(elems, ce);
- }
- }
-}
-
-/* ***************************************** */
-/* Selection Tools */
-
-/* check if one of the frames in this layer is selected */
-short is_gplayer_frame_selected (bGPDlayer *gpl)
-{
- bGPDframe *gpf;
-
- /* error checking */
- if (gpl == NULL)
- return 0;
-
- /* stop at the first one found */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if (gpf->flag & GP_FRAME_SELECT)
- return 1;
- }
-
- /* not found */
- return 0;
-}
-
-/* helper function - select gp-frame based on SELECT_* mode */
-static void gpframe_select (bGPDframe *gpf, short select_mode)
-{
- switch (select_mode) {
- case SELECT_ADD:
- gpf->flag |= GP_FRAME_SELECT;
- break;
- case SELECT_SUBTRACT:
- gpf->flag &= ~GP_FRAME_SELECT;
- break;
- case SELECT_INVERT:
- gpf->flag ^= GP_FRAME_SELECT;
- break;
- }
-}
-
-/* set all/none/invert select (like above, but with SELECT_* modes) */
-void select_gpencil_frames (bGPDlayer *gpl, short select_mode)
-{
- bGPDframe *gpf;
-
- /* error checking */
- if (gpl == NULL)
- return;
-
- /* handle according to mode */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- gpframe_select(gpf, select_mode);
- }
-}
-
-/* set all/none/invert select */
-void set_gplayer_frame_selection (bGPDlayer *gpl, short mode)
-{
- /* error checking */
- if (gpl == NULL)
- return;
-
- /* convert mode to select_mode */
- switch (mode) {
- case 2:
- mode= SELECT_INVERT;
- break;
- case 1:
- mode= SELECT_ADD;
- break;
- case 0:
- mode= SELECT_SUBTRACT;
- break;
- default:
- return;
- }
-
- /* now call the standard function */
- select_gpencil_frames (gpl, mode);
-}
-
-/* select the frame in this layer that occurs on this frame (there should only be one at most) */
-void select_gpencil_frame (bGPDlayer *gpl, int selx, short select_mode)
-{
- bGPDframe *gpf;
-
- /* search through frames for a match */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- /* there should only be one frame with this frame-number */
- if (gpf->framenum == selx) {
- gpframe_select(gpf, select_mode);
- break;
- }
- }
-}
-
-/* select the frames in this layer that occur within the bounds specified */
-void borderselect_gplayer_frames (bGPDlayer *gpl, float min, float max, short select_mode)
-{
- bGPDframe *gpf;
-
- /* only select those frames which are in bounds */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if (IN_RANGE(gpf->framenum, min, max))
- gpframe_select(gpf, select_mode);
- }
-}
-
-
-/* De-selects or inverts the selection of Layers for a grease-pencil block
- * mode: 0 = default behaviour (select all), 1 = test if (de)select all, 2 = invert all
- */
-void deselect_gpencil_layers (void *data, short mode)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter, sel=1;
-
- /* filter data */
- filter= ACTFILTER_VISIBLE;
- actdata_filter(&act_data, filter, data, ACTCONT_GPENCIL);
-
- /* See if we should be selecting or deselecting */
- if (mode == 1) {
- for (ale= act_data.first; ale; ale= ale->next) {
- if (sel == 0)
- break;
-
- if (ale->flag & GP_LAYER_SELECT)
- sel= 0;
- }
- }
- else
- sel= 0;
-
- /* Now set the flags */
- for (ale= act_data.first; ale; ale= ale->next) {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
-
- if (mode == 2)
- gpl->flag ^= GP_LAYER_SELECT;
- else if (sel)
- gpl->flag |= GP_LAYER_SELECT;
- else
- gpl->flag &= ~GP_LAYER_SELECT;
-
- gpl->flag &= ~GP_LAYER_ACTIVE;
- }
-
- /* Cleanup */
- BLI_freelistN(&act_data);
-}
-
-/* ***************************************** */
-/* Frame Editing Tools */
-
-/* Delete selected grease-pencil layers */
-void delete_gpencil_layers (void)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale, *next;
- void *data;
- short datatype;
- int filter;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* clean up grease-pencil layers */
- for (ale= act_data.first; ale; ale= next) {
- bGPdata *gpd= (bGPdata *)ale->owner;
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
- next= ale->next;
-
- /* free layer and its data */
- if (SEL_GPL(gpl)) {
- free_gpencil_frames(gpl);
- BLI_freelinkN(&gpd->layers, gpl);
- }
-
- /* free temp memory */
- BLI_freelinkN(&act_data, ale);
- }
-
- BIF_undo_push("Delete GPencil Layers");
- allspace(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
-}
-
-/* Delete selected frames */
-void delete_gplayer_frames (bGPDlayer *gpl)
-{
- bGPDframe *gpf, *gpfn;
-
- /* error checking */
- if (gpl == NULL)
- return;
-
- /* check for frames to delete */
- for (gpf= gpl->frames.first; gpf; gpf= gpfn) {
- gpfn= gpf->next;
-
- if (gpf->flag & GP_FRAME_SELECT)
- gpencil_layer_delframe(gpl, gpf);
- }
-}
-
-/* Duplicate selected frames from given gp-layer */
-void duplicate_gplayer_frames (bGPDlayer *gpl)
-{
- bGPDframe *gpf, *gpfn;
-
- /* error checking */
- if (gpl == NULL)
- return;
-
- /* duplicate selected frames */
- for (gpf= gpl->frames.first; gpf; gpf= gpfn) {
- gpfn= gpf->next;
-
- /* duplicate this frame */
- if (gpf->flag & GP_FRAME_SELECT) {
- bGPDframe *gpfd;
-
- /* duplicate frame, and deselect self */
- gpfd= gpencil_frame_duplicate(gpf);
- gpf->flag &= ~GP_FRAME_SELECT;
-
- BLI_insertlinkafter(&gpl->frames, gpf, gpfd);
- }
- }
-}
-
-/* -------------------------------------- */
-/* Copy and Paste Tools */
-/* - The copy/paste buffer currently stores a set of GP_Layers, with temporary
- * GP_Frames with the necessary strokes
- * - Unless there is only one element in the buffer, names are also tested to check for compatability.
- * - All pasted frames are offset by the same amount. This is calculated as the difference in the times of
- * the current frame and the 'first keyframe' (i.e. the earliest one in all channels).
- * - The earliest frame is calculated per copy operation.
- */
-
-/* globals for copy/paste data (like for other copy/paste buffers) */
-ListBase gpcopybuf = {NULL, NULL};
-static int gpcopy_firstframe= 999999999;
-
-/* This function frees any MEM_calloc'ed copy/paste buffer data */
-void free_gpcopybuf ()
-{
- free_gpencil_layers(&gpcopybuf);
-
- gpcopybuf.first= gpcopybuf.last= NULL;
- gpcopy_firstframe= 999999999;
-}
-
-/* This function adds data to the copy/paste buffer, freeing existing data first
- * Only the selected GP-layers get their selected keyframes copied.
- */
-void copy_gpdata ()
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- /* clear buffer first */
- free_gpcopybuf();
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* assume that each of these is an ipo-block */
- for (ale= act_data.first; ale; ale= ale->next) {
- bGPDlayer *gpls, *gpln;
- bGPDframe *gpf, *gpfn;
-
- /* get new layer to put into buffer */
- gpls= (bGPDlayer *)ale->data;
- gpln= MEM_callocN(sizeof(bGPDlayer), "GPCopyPasteLayer");
-
- gpln->frames.first= gpln->frames.last= NULL;
- strcpy(gpln->info, gpls->info);
-
- BLI_addtail(&gpcopybuf, gpln);
-
- /* loop over frames, and copy only selected frames */
- for (gpf= gpls->frames.first; gpf; gpf= gpf->next) {
- /* if frame is selected, make duplicate it and its strokes */
- if (gpf->flag & GP_FRAME_SELECT) {
- /* add frame to buffer */
- gpfn= gpencil_frame_duplicate(gpf);
- BLI_addtail(&gpln->frames, gpfn);
-
- /* check if this is the earliest frame encountered so far */
- if (gpf->framenum < gpcopy_firstframe)
- gpcopy_firstframe= gpf->framenum;
- }
- }
- }
-
- /* check if anything ended up in the buffer */
- if (ELEM(NULL, gpcopybuf.first, gpcopybuf.last))
- error("Nothing copied to buffer");
-
- /* free temp memory */
- BLI_freelistN(&act_data);
-}
-
-void paste_gpdata ()
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
- void *data;
- short datatype;
-
- const int offset = (CFRA - gpcopy_firstframe);
- short no_name= 0;
-
- /* check if buffer is empty */
- if (ELEM(NULL, gpcopybuf.first, gpcopybuf.last)) {
- error("No data in buffer to paste");
- return;
- }
- /* check if single channel in buffer (disregard names if so) */
- if (gpcopybuf.first == gpcopybuf.last)
- no_name= 1;
-
- /* get data */
- data= get_action_context(&datatype);
- if (data == NULL) return;
- if (datatype != ACTCONT_GPENCIL) return;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_FOREDIT);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* from selected channels */
- for (ale= act_data.first; ale; ale= ale->next) {
- bGPDlayer *gpld= (bGPDlayer *)ale->data;
- bGPDlayer *gpls= NULL;
- bGPDframe *gpfs, *gpf;
-
- /* find suitable layer from buffer to use to paste from */
- for (gpls= gpcopybuf.first; gpls; gpls= gpls->next) {
- /* check if layer name matches */
- if ((no_name) || (strcmp(gpls->info, gpld->info)==0))
- break;
- }
-
- /* this situation might occur! */
- if (gpls == NULL)
- continue;
-
- /* add frames from buffer */
- for (gpfs= gpls->frames.first; gpfs; gpfs= gpfs->next) {
- /* temporarily apply offset to buffer-frame while copying */
- gpfs->framenum += offset;
-
- /* get frame to copy data into (if no frame returned, then just ignore) */
- gpf= gpencil_layer_getframe(gpld, gpfs->framenum, 1);
- if (gpf) {
- bGPDstroke *gps, *gpsn;
- ScrArea *sa;
-
- /* get area that gp-data comes from */
- sa= gpencil_data_findowner((bGPdata *)ale->owner);
-
- /* this should be the right frame... as it may be a pre-existing frame,
- * must make sure that only compatible stroke types get copied over
- * - we cannot just add a duplicate frame, as that would cause errors
- * - need to check for compatible types to minimise memory usage (copying 'junk' over)
- */
- for (gps= gpfs->strokes.first; gps; gps= gps->next) {
- short stroke_ok;
-
- /* if there's an area, check that it supports this type of stroke */
- if (sa) {
- stroke_ok= 0;
-
- /* check if spacetype supports this type of stroke
- * - NOTE: must sync this with gp_paint_initstroke() in gpencil.c
- */
- switch (sa->spacetype) {
- case SPACE_VIEW3D: /* 3D-View: either screen-aligned or 3d-space */
- if ((gps->flag == 0) || (gps->flag & GP_STROKE_3DSPACE))
- stroke_ok= 1;
- break;
-
- case SPACE_NODE: /* Nodes Editor: either screen-aligned or view-aligned */
- case SPACE_IMAGE: /* Image Editor: either screen-aligned or view\image-aligned */
- if ((gps->flag == 0) || (gps->flag & GP_STROKE_2DSPACE))
- stroke_ok= 1;
- break;
-
- case SPACE_SEQ: /* Sequence Editor: either screen-aligned or view-aligned */
- if ((gps->flag == 0) || (gps->flag & GP_STROKE_2DIMAGE))
- stroke_ok= 1;
- break;
- }
- }
- else
- stroke_ok= 1;
-
- /* if stroke is ok, we make a copy of this stroke and add to frame */
- if (stroke_ok) {
- /* make a copy of stroke, then of its points array */
- gpsn= MEM_dupallocN(gps);
- gpsn->points= MEM_dupallocN(gps->points);
-
- /* append stroke to frame */
- BLI_addtail(&gpf->strokes, gpsn);
- }
- }
-
- /* if no strokes (i.e. new frame) added, free gpf */
- if (gpf->strokes.first == NULL)
- gpencil_layer_delframe(gpld, gpf);
- }
-
- /* unapply offset from buffer-frame */
- gpfs->framenum -= offset;
- }
- }
-
- /* free temp memory */
- BLI_freelistN(&act_data);
-
- /* undo and redraw stuff */
- allqueue(REDRAWVIEW3D, 0);
- //allqueue(REDRAWNODES, 0);
- allqueue(REDRAWACTION, 0);
- BIF_undo_push("Paste Grease Pencil Frames");
-}
-
-/* -------------------------------------- */
-/* Snap Tools */
-
-static short snap_gpf_nearest (bGPDframe *gpf)
-{
- if (gpf->flag & GP_FRAME_SELECT)
- gpf->framenum= (int)(floor(gpf->framenum+0.5));
- return 0;
-}
-
-static short snap_gpf_nearestsec (bGPDframe *gpf)
-{
- float secf = (float)FPS;
- if (gpf->flag & GP_FRAME_SELECT)
- gpf->framenum= (int)(floor(gpf->framenum/secf + 0.5f) * secf);
- return 0;
-}
-
-static short snap_gpf_cframe (bGPDframe *gpf)
-{
- if (gpf->flag & GP_FRAME_SELECT)
- gpf->framenum= (int)CFRA;
- return 0;
-}
-
-static short snap_gpf_nearmarker (bGPDframe *gpf)
-{
- if (gpf->flag & GP_FRAME_SELECT)
- gpf->framenum= (int)find_nearest_marker_time((float)gpf->framenum);
- return 0;
-}
-
-
-/* snap selected frames to ... */
-void snap_gplayer_frames (bGPDlayer *gpl, short mode)
-{
- switch (mode) {
- case 1: /* snap to nearest frame */
- gplayer_frames_looper(gpl, snap_gpf_nearest);
- break;
- case 2: /* snap to current frame */
- gplayer_frames_looper(gpl, snap_gpf_cframe);
- break;
- case 3: /* snap to nearest marker */
- gplayer_frames_looper(gpl, snap_gpf_nearmarker);
- break;
- case 4: /* snap to nearest second */
- gplayer_frames_looper(gpl, snap_gpf_nearestsec);
- break;
- default: /* just in case */
- gplayer_frames_looper(gpl, snap_gpf_nearest);
- break;
- }
-}
-
-/* -------------------------------------- */
-/* Mirror Tools */
-
-static short mirror_gpf_cframe (bGPDframe *gpf)
-{
- int diff;
-
- if (gpf->flag & GP_FRAME_SELECT) {
- diff= CFRA - gpf->framenum;
- gpf->framenum= CFRA;
- }
-
- return 0;
-}
-
-static short mirror_gpf_yaxis (bGPDframe *gpf)
-{
- int diff;
-
- if (gpf->flag & GP_FRAME_SELECT) {
- diff= -gpf->framenum;
- gpf->framenum= diff;
- }
-
- return 0;
-}
-
-static short mirror_gpf_xaxis (bGPDframe *gpf)
-{
- int diff;
-
- if (gpf->flag & GP_FRAME_SELECT) {
- diff= -gpf->framenum;
- gpf->framenum= diff;
- }
-
- return 0;
-}
-
-static short mirror_gpf_marker (bGPDframe *gpf)
-{
- static TimeMarker *marker;
- static short initialised = 0;
- int diff;
-
- /* In order for this mirror function to work without
- * any extra arguments being added, we use the case
- * of bezt==NULL to denote that we should find the
- * marker to mirror over. The static pointer is safe
- * to use this way, as it will be set to null after
- * each cycle in which this is called.
- */
-
- if (gpf) {
- /* mirroring time */
- if ((gpf->flag & GP_FRAME_SELECT) && (marker)) {
- diff= (marker->frame - gpf->framenum);
- gpf->framenum= (marker->frame + diff);
- }
- }
- else {
- /* initialisation time */
- if (initialised) {
- /* reset everything for safety */
- marker = NULL;
- initialised = 0;
- }
- else {
- /* try to find a marker */
- for (marker= G.scene->markers.first; marker; marker=marker->next) {
- if (marker->flag & SELECT) {
- initialised = 1;
- break;
- }
- }
-
- if (initialised == 0)
- marker = NULL;
- }
- }
-
- return 0;
-}
-
-
-/* mirror selected gp-frames on... */
-void mirror_gplayer_frames (bGPDlayer *gpl, short mode)
-{
- switch (mode) {
- case 1: /* mirror over current frame */
- gplayer_frames_looper(gpl, mirror_gpf_cframe);
- break;
- case 2: /* mirror over frame 0 */
- gplayer_frames_looper(gpl, mirror_gpf_yaxis);
- break;
- case 3: /* mirror over value 0 */
- gplayer_frames_looper(gpl, mirror_gpf_xaxis);
- break;
- case 4: /* mirror over marker */
- mirror_gpf_marker(NULL);
- gplayer_frames_looper(gpl, mirror_gpf_marker);
- mirror_gpf_marker(NULL);
- break;
- default: /* just in case */
- gplayer_frames_looper(gpl, mirror_gpf_yaxis);
- break;
- }
-}
-
-/* ***************************************** */
diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c
deleted file mode 100644
index 5ddf522e4a8..00000000000
--- a/source/blender/src/editarmature.c
+++ /dev/null
@@ -1,5079 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * editarmature.c: Interface for creating and posing armature objects
- */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_ghash.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_object.h"
-#include "BKE_subsurf.h"
-#include "BKE_utildefines.h"
-#include "BKE_modifier.h"
-
-#include "BIF_editaction.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_editdeform.h"
-#include "BIF_editarmature.h"
-#include "BIF_editconstraint.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_meshlaplacian.h"
-#include "BIF_meshtools.h"
-#include "BIF_poseobject.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-
-#include "BDR_editobject.h"
-#include "BDR_drawobject.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-#include "BSE_trans_types.h"
-
-#include "PIL_time.h"
-
-#include "reeb.h" // FIX ME
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "nla.h"
-
-extern float center[3], centroid[3]; /* Originally defined in editobject.c */
-
-/* Macros */
-#define TEST_EDITARMATURE {if(G.obedit==0) return; if( (G.vd->lay & G.obedit->lay)==0 ) return;}
-
-/* prototypes for later */
-static EditBone *editbone_name_exists (ListBase *ebones, char *name); // proto for below
-
-/* **************** tools on Editmode Armature **************** */
-
-/* converts Bones to EditBone list, used for tools as well */
-void make_boneList(ListBase *list, ListBase *bones, EditBone *parent)
-{
- EditBone *eBone;
- Bone *curBone;
- float delta[3];
- float premat[3][3];
- float postmat[3][3];
- float imat[3][3];
- float difmat[3][3];
-
- for (curBone=bones->first; curBone; curBone=curBone->next) {
- eBone= MEM_callocN(sizeof(EditBone), "make_editbone");
-
- /* Copy relevant data from bone to eBone */
- eBone->parent= parent;
- BLI_strncpy(eBone->name, curBone->name, 32);
- eBone->flag = curBone->flag;
-
- /* fix selection flags */
- if (eBone->flag & BONE_SELECTED) {
- eBone->flag |= BONE_TIPSEL;
- if (eBone->parent && (eBone->flag & BONE_CONNECTED))
- eBone->parent->flag |= BONE_TIPSEL;
- else
- eBone->flag |= BONE_ROOTSEL;
- }
- else
- eBone->flag &= ~BONE_ROOTSEL;
-
- VECCOPY(eBone->head, curBone->arm_head);
- VECCOPY(eBone->tail, curBone->arm_tail);
-
- eBone->roll= 0.0;
-
- /* roll fixing */
- VecSubf(delta, eBone->tail, eBone->head);
- vec_roll_to_mat3(delta, 0.0, postmat);
-
- Mat3CpyMat4(premat, curBone->arm_mat);
-
- Mat3Inv(imat, postmat);
- Mat3MulMat3(difmat, imat, premat);
-
- eBone->roll = atan2(difmat[2][0], difmat[2][2]);
-
- /* rest of stuff copy */
- eBone->length= curBone->length;
- eBone->dist= curBone->dist;
- eBone->weight= curBone->weight;
- eBone->xwidth= curBone->xwidth;
- eBone->zwidth= curBone->zwidth;
- eBone->ease1= curBone->ease1;
- eBone->ease2= curBone->ease2;
- eBone->rad_head= curBone->rad_head;
- eBone->rad_tail= curBone->rad_tail;
- eBone->segments = curBone->segments;
- eBone->layer = curBone->layer;
-
- BLI_addtail(list, eBone);
-
- /* Add children if necessary */
- if (curBone->childbase.first)
- make_boneList(list, &curBone->childbase, eBone);
- }
-}
-
-/* nasty stuff for converting roll in editbones into bones */
-/* also sets restposition in armature (arm_mat) */
-static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
-{
- Bone *curBone;
- EditBone *ebone;
- float premat[3][3];
- float postmat[3][3];
- float difmat[3][3];
- float imat[3][3];
- float delta[3];
-
- for (curBone=bonelist->first; curBone; curBone=curBone->next) {
- /* sets local matrix and arm_mat (restpos) */
- where_is_armature_bone(curBone, curBone->parent);
-
- /* Find the associated editbone */
- for (ebone = editbonelist->first; ebone; ebone=ebone->next)
- if ((Bone*)ebone->temp == curBone)
- break;
-
- if (ebone) {
- /* Get the ebone premat */
- VecSubf(delta, ebone->tail, ebone->head);
- vec_roll_to_mat3(delta, ebone->roll, premat);
-
- /* Get the bone postmat */
- Mat3CpyMat4(postmat, curBone->arm_mat);
-
- Mat3Inv(imat, premat);
- Mat3MulMat3(difmat, imat, postmat);
-#if 0
- printf ("Bone %s\n", curBone->name);
- printmatrix4("premat", premat);
- printmatrix4("postmat", postmat);
- printmatrix4("difmat", difmat);
- printf ("Roll = %f\n", (-atan2(difmat[2][0], difmat[2][2]) * (180.0/M_PI)));
-#endif
- curBone->roll = -atan2(difmat[2][0], difmat[2][2]);
-
- /* and set restposition again */
- where_is_armature_bone(curBone, curBone->parent);
- }
- fix_bonelist_roll(&curBone->childbase, editbonelist);
- }
-}
-
-/* converts the editbones back to the armature */
-void editbones_to_armature (ListBase *list, Object *ob)
-{
- bArmature *arm;
- EditBone *eBone, *neBone;
- Bone *newBone;
- Object *obt;
-
- arm = get_armature(ob);
- if (!list) return;
- if (!arm) return;
-
- /* armature bones */
- free_bones(arm);
-
- /* remove zero sized bones, this gives instable restposes */
- for (eBone=list->first; eBone; eBone= neBone) {
- float len= VecLenf(eBone->head, eBone->tail);
- neBone= eBone->next;
- if (len <= FLT_EPSILON) {
- EditBone *fBone;
-
- /* Find any bones that refer to this bone */
- for (fBone=list->first; fBone; fBone= fBone->next) {
- if (fBone->parent==eBone)
- fBone->parent= eBone->parent;
- }
- printf("Warning: removed zero sized bone: %s\n", eBone->name);
- BLI_freelinkN(list, eBone);
- }
- }
-
- /* Copy the bones from the editData into the armature */
- for (eBone=list->first; eBone; eBone=eBone->next) {
- newBone= MEM_callocN(sizeof(Bone), "bone");
- eBone->temp= newBone; /* Associate the real Bones with the EditBones */
-
- BLI_strncpy(newBone->name, eBone->name, 32);
- memcpy(newBone->head, eBone->head, sizeof(float)*3);
- memcpy(newBone->tail, eBone->tail, sizeof(float)*3);
- newBone->flag= eBone->flag;
- if (eBone->flag & BONE_ACTIVE)
- newBone->flag |= BONE_SELECTED; /* important, editbones can be active with only 1 point selected */
- newBone->roll = 0.0f;
-
- newBone->weight = eBone->weight;
- newBone->dist = eBone->dist;
-
- newBone->xwidth = eBone->xwidth;
- newBone->zwidth = eBone->zwidth;
- newBone->ease1= eBone->ease1;
- newBone->ease2= eBone->ease2;
- newBone->rad_head= eBone->rad_head;
- newBone->rad_tail= eBone->rad_tail;
- newBone->segments= eBone->segments;
- newBone->layer = eBone->layer;
- }
-
- /* Fix parenting in a separate pass to ensure ebone->bone connections
- are valid at this point */
- for (eBone=list->first;eBone;eBone=eBone->next) {
- newBone= (Bone *)eBone->temp;
- if (eBone->parent) {
- newBone->parent= (Bone *)eBone->parent->temp;
- BLI_addtail(&newBone->parent->childbase, newBone);
-
- {
- float M_boneRest[3][3];
- float M_parentRest[3][3];
- float iM_parentRest[3][3];
- float delta[3];
-
- /* Get the parent's matrix (rotation only) */
- VecSubf(delta, eBone->parent->tail, eBone->parent->head);
- vec_roll_to_mat3(delta, eBone->parent->roll, M_parentRest);
-
- /* Get this bone's matrix (rotation only) */
- VecSubf(delta, eBone->tail, eBone->head);
- vec_roll_to_mat3(delta, eBone->roll, M_boneRest);
-
- /* Invert the parent matrix */
- Mat3Inv(iM_parentRest, M_parentRest);
-
- /* Get the new head and tail */
- VecSubf(newBone->head, eBone->head, eBone->parent->tail);
- VecSubf(newBone->tail, eBone->tail, eBone->parent->tail);
-
- Mat3MulVecfl(iM_parentRest, newBone->head);
- Mat3MulVecfl(iM_parentRest, newBone->tail);
- }
- }
- /* ...otherwise add this bone to the armature's bonebase */
- else
- BLI_addtail(&arm->bonebase, newBone);
- }
-
- /* Make a pass through the new armature to fix rolling */
- /* also builds restposition again (like where_is_armature) */
- fix_bonelist_roll(&arm->bonebase, list);
-
- /* so all users of this armature should get rebuilt */
- for (obt= G.main->object.first; obt; obt= obt->id.next) {
- if (obt->data==arm)
- armature_rebuild_pose(obt, arm);
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-}
-
-
-
-void apply_rot_armature (Object *ob, float mat[3][3])
-{
- ListBase list;
- EditBone *ebone;
- bArmature *arm;
- float scale = Mat3ToScalef(mat); /* store the scale of the matrix here to use on envelopes */
- arm = get_armature(ob);
-
- if (!arm)
- return;
-
- /* Put the armature into editmode */
- list.first= list.last = NULL;
- make_boneList(&list, &arm->bonebase, NULL);
-
- /* Do the rotations */
- for (ebone = list.first; ebone; ebone=ebone->next){
- Mat3MulVecfl(mat, ebone->head);
- Mat3MulVecfl(mat, ebone->tail);
-
- ebone->rad_head *= scale;
- ebone->rad_tail *= scale;
- ebone->dist *= scale;
- }
-
- /* Turn the list into an armature */
- editbones_to_armature(&list, ob);
-
- /* Free the editbones */
- if (list.first){
- BLI_freelistN (&list);
- }
-}
-
-/* 0 == do center, 1 == center new, 2 == center cursor */
-void docenter_armature (Object *ob, int centermode)
-{
- ListBase list;
- EditBone *ebone;
- bArmature *arm;
- float cent[3] = {0.0f, 0.0f, 0.0f};
- float min[3], max[3];
- float omat[3][3];
-
- arm = get_armature(ob);
- if (!arm) return;
-
- /* Put the armature into editmode */
- list.first= list.last = NULL;
- make_boneList(&list, &arm->bonebase, NULL);
-
- /* Find the centerpoint */
- if (centermode == 2) {
- VECCOPY(cent, give_cursor());
- Mat4Invert(ob->imat, ob->obmat);
- Mat4MulVecfl(ob->imat, cent);
- }
- else {
- INIT_MINMAX(min, max);
-
- for (ebone= list.first; ebone; ebone=ebone->next) {
- DO_MINMAX(ebone->head, min, max);
- DO_MINMAX(ebone->tail, min, max);
- }
-
- cent[0]= (min[0]+max[0])/2.0f;
- cent[1]= (min[1]+max[1])/2.0f;
- cent[2]= (min[2]+max[2])/2.0f;
- }
-
- /* Do the adjustments */
- for (ebone= list.first; ebone; ebone=ebone->next){
- VecSubf(ebone->head, ebone->head, cent);
- VecSubf(ebone->tail, ebone->tail, cent);
- }
-
- /* Turn the list into an armature */
- editbones_to_armature(&list, ob);
-
- /* Free the editbones */
- if (list.first){
- BLI_freelistN(&list);
- }
-
- /* Adjust object location for new centerpoint */
- if(centermode && G.obedit==0) {
- Mat3CpyMat4(omat, ob->obmat);
-
- Mat3MulVecfl(omat, cent);
- ob->loc[0]+= cent[0];
- ob->loc[1]+= cent[1];
- ob->loc[2]+= cent[2];
- }
-}
-
-/* helper for apply_armature_pose2bones - fixes parenting of objects that are bone-parented to armature */
-static void applyarmature_fix_boneparents (Object *armob)
-{
- Object *ob;
-
- /* go through all objects in database */
- for (ob= G.main->object.first; ob; ob= ob->id.next) {
- /* if parent is bone in this armature, apply corrections */
- if ((ob->parent == armob) && (ob->partype == PARBONE)) {
- /* apply current transform from parent (not yet destroyed),
- * then calculate new parent inverse matrix
- */
- apply_obmat(ob);
-
- what_does_parent(ob);
- Mat4Invert(ob->parentinv, workob.obmat);
- }
- }
-}
-
-/* set the current pose as the restpose */
-void apply_armature_pose2bones(void)
-{
- Object *ob;
- bArmature *arm;
- bPose *pose;
- bPoseChannel *pchan;
- EditBone *curbone;
-
- /* don't check if editmode (should be done by caller) */
- ob= OBACT;
- if (ob->type!=OB_ARMATURE) return;
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return;
- }
- arm= get_armature(ob);
-
- /* helpful warnings... */
- // TODO: add warnings to be careful about actions, applying deforms first, etc.
-
- /* Get editbones of active armature to alter */
- if (G.edbo.first) BLI_freelistN(&G.edbo);
- make_boneList(&G.edbo, &arm->bonebase, NULL);
-
- /* get pose of active object and move it out of posemode */
- pose= ob->pose;
-
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
- curbone= editbone_name_exists(&G.edbo, pchan->name);
-
- /* simply copy the head/tail values from pchan over to curbone */
- VECCOPY(curbone->head, pchan->pose_head);
- VECCOPY(curbone->tail, pchan->pose_tail);
-
- /* fix roll:
- * 1. find auto-calculated roll value for this bone now
- * 2. remove this from the 'visual' y-rotation
- */
- {
- float premat[3][3], imat[3][3],pmat[3][3], tmat[3][3];
- float delta[3], eul[3];
-
- /* obtain new auto y-rotation */
- VecSubf(delta, curbone->tail, curbone->head);
- vec_roll_to_mat3(delta, 0.0, premat);
- Mat3Inv(imat, premat);
-
- /* get pchan 'visual' matrix */
- Mat3CpyMat4(pmat, pchan->pose_mat);
-
- /* remove auto from visual and get euler rotation */
- Mat3MulMat3(tmat, imat, pmat);
- Mat3ToEul(tmat, eul);
-
- /* just use this euler-y as new roll value */
- curbone->roll= eul[1];
- }
-
- /* clear transform values for pchan */
- pchan->loc[0]= pchan->loc[1]= pchan->loc[2]= 0;
- pchan->quat[1]= pchan->quat[2]= pchan->quat[3]= 0;
- pchan->quat[0]= pchan->size[0]= pchan->size[1]= pchan->size[2]= 1;
-
- /* set anim lock */
- curbone->flag |= BONE_UNKEYED;
- }
-
- /* convert editbones back to bones */
- editbones_to_armature(&G.edbo, ob);
- if (G.edbo.first) BLI_freelistN(&G.edbo);
-
- /* flush positions of posebones */
- where_is_pose(ob);
-
- /* fix parenting of objects which are bone-parented */
- applyarmature_fix_boneparents(ob);
-
- BIF_undo_push("Apply new restpose");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-/* Helper function for armature joining - link fixing */
-static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone)
-{
- Object *ob;
- bPose *pose;
- bPoseChannel *pchant;
- bConstraint *con;
-
- /* let's go through all objects in database */
- for (ob= G.main->object.first; ob; ob= ob->id.next) {
- /* do some object-type specific things */
- if (ob->type == OB_ARMATURE) {
- pose= ob->pose;
- for (pchant= pose->chanbase.first; pchant; pchant= pchant->next) {
- for (con= pchant->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if (ct->tar == srcArm) {
- if (strcmp(ct->subtarget, "")==0) {
- ct->tar = tarArm;
- }
- else if (strcmp(ct->subtarget, pchan->name)==0) {
- ct->tar = tarArm;
- strcpy(ct->subtarget, curbone->name);
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
-
- /* action constraint? */
- if (con->type == CONSTRAINT_TYPE_ACTION) {
- bActionConstraint *data= con->data;
- bAction *act;
- bActionChannel *achan;
-
- if (data->act) {
- act= data->act;
-
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- if (strcmp(achan->name, pchan->name)==0)
- BLI_strncpy(achan->name, curbone->name, 32);
- }
- }
- }
-
- }
- }
- }
-
- /* fix object-level constraints */
- if (ob != srcArm) {
- for (con= ob->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if (ct->tar == srcArm) {
- if (strcmp(ct->subtarget, "")==0) {
- ct->tar = tarArm;
- }
- else if (strcmp(ct->subtarget, pchan->name)==0) {
- ct->tar = tarArm;
- strcpy(ct->subtarget, curbone->name);
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
-
- /* See if an object is parented to this armature */
- if (ob->parent && (ob->parent == srcArm)) {
- /* Is object parented to a bone of this src armature? */
- if (ob->partype==PARBONE) {
- /* bone name in object */
- if (!strcmp(ob->parsubstr, pchan->name))
- BLI_strncpy(ob->parsubstr, curbone->name, 32);
- }
-
- /* make tar armature be new parent */
- ob->parent = tarArm;
- }
- }
-}
-
-int join_armature(void)
-{
- Object *ob;
- bArmature *arm;
- Base *base, *nextbase;
- bPose *pose, *opose;
- bPoseChannel *pchan, *pchann;
- ListBase ebbase, eblist;
- EditBone *curbone;
- float mat[4][4], oimat[4][4];
-
- /* Ensure we're not in editmode and that the active object is an armature*/
- /* if(G.obedit) return; */ /* Alredy checked in join_menu() */
-
- ob= OBACT;
- if (ob->type!=OB_ARMATURE) return 0;
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return 0;
- }
- arm= get_armature(ob);
-
- /* Get editbones of active armature to add editbones to */
- ebbase.first=ebbase.last= NULL;
- make_boneList(&ebbase, &arm->bonebase, NULL);
-
- /* get pose of active object and move it out of posemode */
- pose= ob->pose;
- ob->flag &= ~OB_POSEMODE;
- BASACT->flag &= ~OB_POSEMODE;
-
- for (base=FIRSTBASE; base; base=nextbase) {
- nextbase = base->next;
- if (TESTBASE(base)){
- if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) {
- /* Make a list of editbones in current armature */
- eblist.first=eblist.last= NULL;
- make_boneList(&eblist, &((bArmature *)base->object->data)->bonebase, NULL);
-
- /* Get Pose of current armature */
- opose= base->object->pose;
- base->object->flag &= ~OB_POSEMODE;
- BASACT->flag &= ~OB_POSEMODE;
-
- /* Find the difference matrix */
- Mat4Invert(oimat, ob->obmat);
- Mat4MulMat4(mat, base->object->obmat, oimat);
-
- /* Copy bones and posechannels from the object to the edit armature */
- for (pchan=opose->chanbase.first; pchan; pchan=pchann) {
- pchann= pchan->next;
- curbone= editbone_name_exists(&eblist, pchan->name);
-
- /* Get new name */
- unique_editbone_name(&ebbase, curbone->name);
-
- /* Transform the bone */
- {
- float premat[4][4];
- float postmat[4][4];
- float difmat[4][4];
- float imat[4][4];
- float temp[3][3];
- float delta[3];
-
- /* Get the premat */
- VecSubf(delta, curbone->tail, curbone->head);
- vec_roll_to_mat3(delta, curbone->roll, temp);
-
- Mat4MulMat34(premat, temp, mat);
-
- Mat4MulVecfl(mat, curbone->head);
- Mat4MulVecfl(mat, curbone->tail);
-
- /* Get the postmat */
- VecSubf(delta, curbone->tail, curbone->head);
- vec_roll_to_mat3(delta, curbone->roll, temp);
- Mat4CpyMat3(postmat, temp);
-
- /* Find the roll */
- Mat4Invert(imat, premat);
- Mat4MulMat4(difmat, postmat, imat);
-
- curbone->roll -= atan2(difmat[2][0], difmat[2][2]);
- }
-
- /* Fix Constraints and Other Links to this Bone and Armature */
- joined_armature_fix_links(ob, base->object, pchan, curbone);
-
- /* Rename pchan */
- sprintf(pchan->name, curbone->name);
-
- /* Jump Ship! */
- BLI_remlink(&eblist, curbone);
- BLI_addtail(&ebbase, curbone);
-
- BLI_remlink(&opose->chanbase, pchan);
- BLI_addtail(&pose->chanbase, pchan);
- }
-
- free_and_unlink_base(base);
- }
- }
- }
-
- DAG_scene_sort(G.scene); // because we removed object(s)
-
- editbones_to_armature(&ebbase, ob);
- if (ebbase.first) BLI_freelistN(&ebbase);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- return 1;
-}
-
-/* Helper function for armature separating - link fixing */
-static void separated_armature_fix_links(Object *origArm, Object *newArm)
-{
- Object *ob;
- bPoseChannel *pchan, *pcha, *pchb;
- bConstraint *con;
- ListBase *opchans, *npchans;
-
- /* get reference to list of bones in original and new armatures */
- opchans= &origArm->pose->chanbase;
- npchans= &newArm->pose->chanbase;
-
- /* let's go through all objects in database */
- for (ob= G.main->object.first; ob; ob= ob->id.next) {
- /* do some object-type specific things */
- if (ob->type == OB_ARMATURE) {
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- for (con= pchan->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- /* any targets which point to original armature are redirected to the new one only if:
- * - the target isn't origArm/newArm itself
- * - the target is one that can be found in newArm/origArm
- */
- if ((ct->tar == origArm) && (ct->subtarget[0] != 0)) {
- for (pcha=npchans->first, pchb=npchans->last; pcha && pchb; pcha=pcha->next, pchb=pchb->prev) {
- /* check if either one matches */
- if ( (strcmp(pcha->name, ct->subtarget)==0) ||
- (strcmp(pchb->name, ct->subtarget)==0) )
- {
- ct->tar= newArm;
- break;
- }
-
- /* check if both ends have met (to stop checking) */
- if (pcha == pchb) break;
- }
- }
- else if ((ct->tar == newArm) && (ct->subtarget[0] != 0)) {
- for (pcha=opchans->first, pchb=opchans->last; pcha && pchb; pcha=pcha->next, pchb=pchb->prev) {
- /* check if either one matches */
- if ( (strcmp(pcha->name, ct->subtarget)==0) ||
- (strcmp(pchb->name, ct->subtarget)==0) )
- {
- ct->tar= origArm;
- break;
- }
-
- /* check if both ends have met (to stop checking) */
- if (pcha == pchb) break;
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
- }
-
- /* fix object-level constraints */
- if (ob != origArm) {
- for (con= ob->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* constraint targets */
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- /* any targets which point to original armature are redirected to the new one only if:
- * - the target isn't origArm/newArm itself
- * - the target is one that can be found in newArm/origArm
- */
- if ((ct->tar == origArm) && (ct->subtarget[0] != 0)) {
- for (pcha=npchans->first, pchb=npchans->last; pcha && pchb; pcha=pcha->next, pchb=pchb->prev) {
- /* check if either one matches */
- if ( (strcmp(pcha->name, ct->subtarget)==0) ||
- (strcmp(pchb->name, ct->subtarget)==0) )
- {
- ct->tar= newArm;
- break;
- }
-
- /* check if both ends have met (to stop checking) */
- if (pcha == pchb) break;
- }
- }
- else if ((ct->tar == newArm) && (ct->subtarget[0] != 0)) {
- for (pcha=opchans->first, pchb=opchans->last; pcha && pchb; pcha=pcha->next, pchb=pchb->prev) {
- /* check if either one matches */
- if ( (strcmp(pcha->name, ct->subtarget)==0) ||
- (strcmp(pchb->name, ct->subtarget)==0) )
- {
- ct->tar= origArm;
- break;
- }
-
- /* check if both ends have met (to stop checking) */
- if (pcha == pchb) break;
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
-
- /* See if an object is parented to this armature */
- if ((ob->parent) && (ob->parent == origArm)) {
- /* Is object parented to a bone of this src armature? */
- if (ob->partype==PARBONE) {
- /* bone name in object */
- for (pcha=npchans->first, pchb=npchans->last; pcha && pchb; pcha=pcha->next, pchb=pchb->prev) {
- /* check if either one matches */
- if ( (strcmp(pcha->name, ob->parsubstr)==0) ||
- (strcmp(pchb->name, ob->parsubstr)==0) )
- {
- ob->parent= newArm;
- break;
- }
-
- /* check if both ends have met (to stop checking) */
- if (pcha == pchb) break;
- }
- }
- }
- }
-}
-
-/* Helper function for armature separating - remove certain bones from the given armature
- * sel: remove selected bones from the armature, otherwise the unselected bones are removed
- */
-static void separate_armature_bones (Object *ob, short sel)
-{
- ListBase edbo = {NULL, NULL};
- bArmature *arm= (bArmature *)ob->data;
- bPoseChannel *pchan, *pchann;
- EditBone *curbone;
-
- /* make local set of editbones to manipulate here */
- make_boneList(&edbo, &arm->bonebase, NULL);
-
- /* go through pose-channels, checking if a bone should be removed */
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchann) {
- pchann= pchan->next;
- curbone= editbone_name_exists(&edbo, pchan->name);
-
- /* check if bone needs to be removed */
- if ( (sel && (curbone->flag & BONE_SELECTED)) ||
- (!sel && !(curbone->flag & BONE_SELECTED)) )
- {
- EditBone *ebo;
- bPoseChannel *pchn;
-
- /* clear the bone->parent var of any bone that had this as its parent */
- for (ebo= edbo.first; ebo; ebo= ebo->next) {
- if (ebo->parent == curbone) {
- ebo->parent= NULL;
- ebo->temp= NULL; /* this is needed to prevent random crashes with in editbones_to_armature */
- ebo->flag &= ~BONE_CONNECTED;
- }
- }
-
- /* clear the pchan->parent var of any pchan that had this as its parent */
- for (pchn= ob->pose->chanbase.first; pchn; pchn=pchn->next) {
- if (pchn->parent == pchan)
- pchn->parent= NULL;
- }
-
- /* free any of the extra-data this pchan might have */
- if (pchan->path) MEM_freeN(pchan->path);
- free_constraints(&pchan->constraints);
-
- /* get rid of unneeded bone */
- BLI_freelinkN(&edbo, curbone);
- BLI_freelinkN(&ob->pose->chanbase, pchan);
- }
- }
-
- /* exit editmode (recalculates pchans too) */
- editbones_to_armature(&edbo, ob);
- BLI_freelistN(&edbo);
-}
-
-/* separate selected bones into their armature */
-void separate_armature (void)
-{
- Object *oldob, *newob;
- Base *base, *oldbase, *newbase;
- bArmature *arm;
-
- if ( G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return;
- if ( okee("Separate")==0 ) return;
-
- waitcursor(1);
-
- arm= G.obedit->data;
-
- /* we are going to do this as follows (unlike every other instance of separate):
- * 1. exit editmode +posemode for active armature/base. Take note of what this is.
- * 2. duplicate base - BASACT is the new one now
- * 3. for each of the two armatures, enter editmode -> remove appropriate bones -> exit editmode + recalc
- * 4. fix constraint links
- * 5. make original armature active and enter editmode
- */
-
- /* 1) only edit-base selected */
- base= FIRSTBASE;
- for (base= FIRSTBASE; base; base= base->next) {
- if (base->lay & G.vd->lay) {
- if (base->object==G.obedit) base->flag |= 1;
- else base->flag &= ~1;
- }
- }
-
- /* 1) store starting settings and exit editmode */
- oldob= G.obedit;
- oldbase= BASACT;
- oldob->flag &= ~OB_POSEMODE;
- oldbase->flag &= ~OB_POSEMODE;
-
- load_editArmature();
- free_editArmature();
-
- /* 2) duplicate base */
- adduplicate(1, USER_DUP_ARM); /* no transform and zero so do get a linked dupli */
-
- newbase= BASACT; /* basact is set in adduplicate() */
- newob= newbase->object;
- newbase->flag &= ~SELECT;
-
-
- /* 3) remove bones that shouldn't still be around on both armatures */
- separate_armature_bones(oldob, 1);
- separate_armature_bones(newob, 0);
-
-
- /* 4) fix links before depsgraph flushes */ // err... or after?
- separated_armature_fix_links(oldob, newob);
-
- DAG_object_flush_update(G.scene, oldob, OB_RECALC_DATA); /* this is the original one */
- DAG_object_flush_update(G.scene, newob, OB_RECALC_DATA); /* this is the separated one */
-
-
- /* 5) restore original conditions */
- G.obedit= oldob;
- BASACT= oldbase;
- BASACT->flag |= SELECT;
-
- make_editArmature();
-
- /* recalc/redraw + cleanup */
- waitcursor(0);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Separate Armature");
-}
-
-/* **************** END tools on Editmode Armature **************** */
-/* **************** PoseMode & EditMode *************************** */
-
-/* only for opengl selection indices */
-Bone *get_indexed_bone (Object *ob, int index)
-{
- bPoseChannel *pchan;
- int a= 0;
-
- if(ob->pose==NULL) return NULL;
- index>>=16; // bone selection codes use left 2 bytes
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
- if(a==index) return pchan->bone;
- }
- return NULL;
-}
-
-/* See if there are any selected bones in this buffer */
-static void *get_bone_from_selectbuffer(Base *base, unsigned int *buffer, short hits, short findunsel)
-{
- Object *ob= base->object;
- Bone *bone;
- EditBone *ebone;
- void *firstunSel=NULL, *firstSel=NULL, *data;
- unsigned int hitresult;
- short i, takeNext=0, sel;
-
- for (i=0; i< hits; i++){
- hitresult = buffer[3+(i*4)];
-
- if (!(hitresult & BONESEL_NOSEL)) { // -1
- if(hitresult & BONESEL_ANY) { // to avoid including objects in selection
-
- hitresult &= ~(BONESEL_ANY);
- /* Determine what the current bone is */
- if (G.obedit==NULL || base->object!=G.obedit) {
- /* no singular posemode, so check for correct object */
- if(base->selcol == (hitresult & 0xFFFF)) {
- bone = get_indexed_bone(ob, hitresult);
-
- if (findunsel)
- sel = (bone->flag & BONE_SELECTED);
- else
- sel = !(bone->flag & BONE_SELECTED);
-
- data = bone;
- }
- else {
- data= NULL;
- sel= 0;
- }
- }
- else{
- ebone = BLI_findlink(&G.edbo, hitresult);
- if (findunsel)
- sel = (ebone->flag & BONE_SELECTED);
- else
- sel = !(ebone->flag & BONE_SELECTED);
-
- data = ebone;
- }
-
- if(data) {
- if (sel) {
- if(!firstSel) firstSel= data;
- takeNext=1;
- }
- else {
- if (!firstunSel)
- firstunSel=data;
- if (takeNext)
- return data;
- }
- }
- }
- }
- }
-
- if (firstunSel)
- return firstunSel;
- else
- return firstSel;
-}
-
-/* used by posemode as well editmode */
-static void *get_nearest_bone (short findunsel)
-{
- unsigned int buffer[MAXPICKBUF];
- short hits;
-
- persp(PERSP_VIEW);
-
- glInitNames();
- hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0);
-
- if (hits>0)
- return get_bone_from_selectbuffer(BASACT, buffer, hits, findunsel);
-
- return NULL;
-}
-
-/* helper for setflag_sel_bone() */
-static void bone_setflag (int *bone, int flag, short mode)
-{
- if (bone && flag) {
- /* exception for inverse flags */
- if (flag == BONE_NO_DEFORM) {
- if (mode == 2)
- *bone |= flag;
- else if (mode == 1)
- *bone &= ~flag;
- else
- *bone ^= flag;
-
- }
- else {
- if (mode == 2)
- *bone &= ~flag;
- else if (mode == 1)
- *bone |= flag;
- else
- *bone ^= flag;
- }
- }
-}
-
-/* Get the first available child of an editbone */
-static EditBone *editbone_get_child(EditBone *pabone, short use_visibility)
-{
- Object *ob;
- bArmature *arm;
- EditBone *curbone, *chbone=NULL;
-
- if (!G.obedit) return NULL;
- else ob= G.obedit;
- arm= (bArmature *)ob->data;
-
- for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
- if (curbone->parent == pabone) {
- if (use_visibility) {
- if ((arm->layer & curbone->layer) && !(pabone->flag & BONE_HIDDEN_A))
- chbone = curbone;
- }
- else
- chbone = curbone;
- }
- }
-
- return chbone;
-}
-
-void armature_select_hierarchy(short direction, short add_to_sel)
-{
- Object *ob;
- bArmature *arm;
- EditBone *curbone, *pabone, *chbone;
-
- if (!G.obedit) return;
- else ob= G.obedit;
- arm= (bArmature *)ob->data;
-
- for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
- if (EBONE_VISIBLE(arm, curbone)) {
- if (curbone->flag & (BONE_ACTIVE)) {
- if (direction == BONE_SELECT_PARENT) {
- if (curbone->parent == NULL) continue;
- else pabone = curbone->parent;
-
- if (EBONE_VISIBLE(arm, pabone)) {
- pabone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- if (pabone->parent) pabone->parent->flag |= BONE_TIPSEL;
-
- if (!add_to_sel) curbone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- curbone->flag &= ~BONE_ACTIVE;
- break;
- }
-
- }
- else { // BONE_SELECT_CHILD
- chbone = editbone_get_child(curbone, 1);
- if (chbone == NULL) continue;
-
- if (EBONE_VISIBLE(arm, chbone)) {
- chbone->flag |= (BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
-
- if (!add_to_sel) {
- curbone->flag &= ~(BONE_SELECTED|BONE_ROOTSEL);
- if (curbone->parent) curbone->parent->flag &= ~BONE_TIPSEL;
- }
- curbone->flag &= ~BONE_ACTIVE;
- break;
- }
- }
- }
- }
- }
-
- countall(); // flushes selection!
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSEDIT, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- if (direction==BONE_SELECT_PARENT)
- BIF_undo_push("Select edit bone parent");
- if (direction==BONE_SELECT_CHILD)
- BIF_undo_push("Select edit bone child");
-}
-
-/* used by posemode and editmode */
-void setflag_armature (short mode)
-{
- Object *ob;
- bArmature *arm;
- int flag;
-
- /* get data */
- if (G.obedit)
- ob= G.obedit;
- else if (OBACT)
- ob= OBACT;
- else
- return;
- arm= (bArmature *)ob->data;
-
- /* get flag to set (sync these with the ones used in eBone_Flag */
- if (mode == 2)
- flag= pupmenu("Disable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
- else if (mode == 1)
- flag= pupmenu("Enable Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
- else
- flag= pupmenu("Toggle Setting%t|Draw Wire%x1|Deform%x2|Mult VG%x3|Hinge%x4|No Scale%x5|Locked%x6");
- switch (flag) {
- case 1: flag = BONE_DRAWWIRE; break;
- case 2: flag = BONE_NO_DEFORM; break;
- case 3: flag = BONE_MULT_VG_ENV; break;
- case 4: flag = BONE_HINGE; break;
- case 5: flag = BONE_NO_SCALE; break;
- case 6: flag = BONE_EDITMODE_LOCKED; break;
- default: return;
- }
-
- /* determine which mode armature is in */
- if ((!G.obedit) && (ob->flag & OB_POSEMODE)) {
- /* deal with pose channels */
- bPoseChannel *pchan;
-
- /* set setting */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
- if (pchan->bone->flag & BONE_SELECTED) {
- bone_setflag(&pchan->bone->flag, flag, mode);
- }
- }
- }
- }
- else if (G.obedit) {
- /* deal with editbones */
- EditBone *curbone;
-
- /* set setting */
- for (curbone= G.edbo.first; curbone; curbone= curbone->next) {
- if (arm->layer & curbone->layer) {
- if (curbone->flag & BONE_SELECTED) {
- bone_setflag(&curbone->flag, flag, mode);
- }
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Change Bone Setting");
-}
-
-/* **************** END PoseMode & EditMode *************************** */
-/* **************** Posemode stuff ********************** */
-
-
-static void selectconnected_posebonechildren (Object *ob, Bone *bone)
-{
- Bone *curBone;
-
- if (!(bone->flag & BONE_CONNECTED))
- return;
-
- select_actionchannel_by_name (ob->action, bone->name, !(G.qual & LR_SHIFTKEY));
-
- if (G.qual & LR_SHIFTKEY)
- bone->flag &= ~BONE_SELECTED;
- else
- bone->flag |= BONE_SELECTED;
-
- for (curBone=bone->childbase.first; curBone; curBone=curBone->next){
- selectconnected_posebonechildren (ob, curBone);
- }
-}
-
-/* within active object context */
-void selectconnected_posearmature(void)
-{
- Bone *bone, *curBone, *next;
- Object *ob= OBACT;
-
- if(!ob || !ob->pose) return;
-
- if (G.qual & LR_SHIFTKEY)
- bone= get_nearest_bone(0);
- else
- bone = get_nearest_bone(1);
-
- if (!bone)
- return;
-
- /* Select parents */
- for (curBone=bone; curBone; curBone=next){
- select_actionchannel_by_name (ob->action, curBone->name, !(G.qual & LR_SHIFTKEY));
- if (G.qual & LR_SHIFTKEY)
- curBone->flag &= ~BONE_SELECTED;
- else
- curBone->flag |= BONE_SELECTED;
-
- if (curBone->flag & BONE_CONNECTED)
- next=curBone->parent;
- else
- next=NULL;
- }
-
- /* Select children */
- for (curBone=bone->childbase.first; curBone; curBone=next){
- selectconnected_posebonechildren (ob, curBone);
- }
-
- countall(); // flushes selection!
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Select connected");
-
-}
-
-/* **************** END Posemode stuff ********************** */
-/* **************** EditMode stuff ********************** */
-
-/* called in space.c */
-void selectconnected_armature(void)
-{
- EditBone *bone, *curBone, *next;
-
- if (G.qual & LR_SHIFTKEY)
- bone= get_nearest_bone(0);
- else
- bone= get_nearest_bone(1);
-
- if (!bone)
- return;
-
- /* Select parents */
- for (curBone=bone; curBone; curBone=next){
- if (G.qual & LR_SHIFTKEY){
- curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- }
- else{
- curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- }
-
- if (curBone->flag & BONE_CONNECTED)
- next=curBone->parent;
- else
- next=NULL;
- }
-
- /* Select children */
- while (bone){
- for (curBone=G.edbo.first; curBone; curBone=next){
- next = curBone->next;
- if (curBone->parent == bone){
- if (curBone->flag & BONE_CONNECTED){
- if (G.qual & LR_SHIFTKEY)
- curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- else
- curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- bone=curBone;
- break;
- }
- else{
- bone=NULL;
- break;
- }
- }
- }
- if (!curBone)
- bone=NULL;
-
- }
-
- countall(); // flushes selection!
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Select connected");
-
-}
-
-/* does bones and points */
-/* note that BONE ROOT only gets drawn for root bones (or without IK) */
-static EditBone * get_nearest_editbonepoint (int findunsel, int *selmask)
-{
- EditBone *ebone;
- unsigned int buffer[MAXPICKBUF];
- unsigned int hitresult, besthitresult=BONESEL_NOSEL;
- int i, mindep= 4;
- short hits, mval[2];
-
- persp(PERSP_VIEW);
-
- glInitNames();
-
- getmouseco_areawin(mval);
- hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-5, mval[1]-5, mval[0]+5, mval[1]+5);
- if(hits==0)
- hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-12, mval[1]-12, mval[0]+12, mval[1]+12);
-
- /* See if there are any selected bones in this group */
- if (hits>0) {
-
- if(hits==1) {
- if (!(buffer[3] & BONESEL_NOSEL))
- besthitresult= buffer[3];
- }
- else {
- for (i=0; i< hits; i++) {
- hitresult= buffer[3+(i*4)];
- if (!(hitresult & BONESEL_NOSEL)) {
- int dep;
-
- ebone = BLI_findlink(&G.edbo, hitresult & ~BONESEL_ANY);
-
- /* clicks on bone points get advantage */
- if( hitresult & (BONESEL_ROOT|BONESEL_TIP)) {
- /* but also the unselected one */
- if(findunsel) {
- if( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0)
- dep= 1;
- else if( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0)
- dep= 1;
- else
- dep= 2;
- }
- else dep= 2;
- }
- else {
- /* bone found */
- if(findunsel) {
- if((ebone->flag & BONE_SELECTED)==0)
- dep= 2;
- else
- dep= 3;
- }
- else dep= 3;
- }
- if(dep < mindep) {
- mindep= dep;
- besthitresult= hitresult;
- }
- }
- }
- }
-
- if (!(besthitresult & BONESEL_NOSEL)) {
-
- ebone= BLI_findlink(&G.edbo, besthitresult & ~BONESEL_ANY);
-
- *selmask = 0;
- if (besthitresult & BONESEL_ROOT)
- *selmask |= BONE_ROOTSEL;
- if (besthitresult & BONESEL_TIP)
- *selmask |= BONE_TIPSEL;
- if (besthitresult & BONESEL_BONE)
- *selmask |= BONE_SELECTED;
- return ebone;
- }
- }
- *selmask = 0;
- return NULL;
-}
-
-static void delete_bone(EditBone* exBone)
-{
- EditBone *curBone;
-
- /* Find any bones that refer to this bone */
- for (curBone=G.edbo.first;curBone;curBone=curBone->next) {
- if (curBone->parent==exBone) {
- curBone->parent=exBone->parent;
- curBone->flag &= ~BONE_CONNECTED;
- }
- }
-
- BLI_freelinkN(&G.edbo,exBone);
-}
-
-/* only editmode! */
-void delete_armature(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *curBone, *next;
- bConstraint *con;
-
- TEST_EDITARMATURE;
- if (okee("Erase selected bone(s)")==0) return;
-
- /* Select mirrored bones */
- if (arm->flag & ARM_MIRROR_EDIT) {
- for (curBone=G.edbo.first; curBone; curBone=curBone->next) {
- if (arm->layer & curBone->layer) {
- if (curBone->flag & BONE_SELECTED) {
- next = armature_bone_get_mirrored(curBone);
- if (next)
- next->flag |= BONE_SELECTED;
- }
- }
- }
- }
-
- /* First erase any associated pose channel */
- if (G.obedit->pose) {
- bPoseChannel *chan, *next;
- for (chan=G.obedit->pose->chanbase.first; chan; chan=next) {
- next= chan->next;
- curBone = editbone_name_exists(&G.edbo, chan->name);
-
- if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) {
- free_constraints(&chan->constraints);
- BLI_freelinkN (&G.obedit->pose->chanbase, chan);
- }
- else {
- for (con= chan->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if (ct->tar == G.obedit) {
- if (ct->subtarget[0]) {
- curBone = editbone_name_exists(&G.edbo, ct->subtarget);
- if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) {
- con->flag |= CONSTRAINT_DISABLE;
- ct->subtarget[0]= 0;
- }
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
- }
- }
- }
- }
-
-
- for (curBone=G.edbo.first;curBone;curBone=next) {
- next=curBone->next;
- if (arm->layer & curBone->layer) {
- if (curBone->flag & BONE_SELECTED)
- delete_bone(curBone);
- }
- }
-
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- countall(); // flushes selection!
-
- BIF_undo_push("Delete bone(s)");
-}
-
-/* context: editmode armature */
-void mouse_armature(void)
-{
- EditBone *nearBone = NULL, *ebone;
- int selmask;
-
- nearBone= get_nearest_editbonepoint(1, &selmask);
- if (nearBone) {
-
- if (!(G.qual & LR_SHIFTKEY)) {
- deselectall_armature(0, 0);
- }
-
- /* by definition the non-root connected bones have no root point drawn,
- so a root selection needs to be delivered to the parent tip,
- countall() (bad location) flushes these flags */
-
- if(selmask & BONE_SELECTED) {
- if(nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
- /* click in a chain */
- if(G.qual & LR_SHIFTKEY) {
- /* hold shift inverts this bone's selection */
- if(nearBone->flag & BONE_SELECTED) {
- /* deselect this bone */
- nearBone->flag &= ~(BONE_TIPSEL|BONE_SELECTED);
- /* only deselect parent tip if it is not selected */
- if(!(nearBone->parent->flag & BONE_SELECTED))
- nearBone->parent->flag &= ~BONE_TIPSEL;
- }
- else {
- /* select this bone */
- nearBone->flag |= BONE_TIPSEL;
- nearBone->parent->flag |= BONE_TIPSEL;
- }
- }
- else {
- /* select this bone */
- nearBone->flag |= BONE_TIPSEL;
- nearBone->parent->flag |= BONE_TIPSEL;
- }
- }
- else {
- if(G.qual & LR_SHIFTKEY) {
- /* hold shift inverts this bone's selection */
- if(nearBone->flag & BONE_SELECTED)
- nearBone->flag &= ~(BONE_TIPSEL|BONE_ROOTSEL);
- else
- nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL);
- }
- else nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL);
- }
- }
- else {
- if ((G.qual & LR_SHIFTKEY) && (nearBone->flag & selmask))
- nearBone->flag &= ~selmask;
- else
- nearBone->flag |= selmask;
- }
-
- countall(); // flushes selection!
-
- if(nearBone) {
- /* then now check for active status */
- for (ebone=G.edbo.first;ebone;ebone=ebone->next) ebone->flag &= ~BONE_ACTIVE;
- if(nearBone->flag & BONE_SELECTED) nearBone->flag |= BONE_ACTIVE;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
-
- rightmouse_transform();
-}
-
-void free_editArmature(void)
-{
- /* Clear the editbones list */
- if (G.edbo.first)
- BLI_freelistN(&G.edbo);
-}
-
-void remake_editArmature(void)
-{
- if(okee("Reload original data")==0) return;
-
- make_editArmature();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSHEAD, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-
-// BIF_undo_push("Delete bone");
-}
-
-/* Put object in EditMode */
-void make_editArmature(void)
-{
- bArmature *arm;
-
- if (G.obedit==0) return;
-
- free_editArmature();
-
- arm= get_armature(G.obedit);
- if (!arm) return;
-
- make_boneList(&G.edbo, &arm->bonebase,NULL);
-}
-
-/* put EditMode back in Object */
-void load_editArmature(void)
-{
- bArmature *arm;
-
- arm= get_armature(G.obedit);
- if (!arm) return;
-
- editbones_to_armature(&G.edbo, G.obedit);
-}
-
-/* toggle==0: deselect
- toggle==1: swap (based on test)
- toggle==2: only active tag
- toggle==3: swap (no test)
-*/
-void deselectall_armature(int toggle, int doundo)
-{
- bArmature *arm= G.obedit->data;
- EditBone *eBone;
- int sel=1;
-
- if(toggle==1) {
- /* Determine if there are any selected bones
- And therefore whether we are selecting or deselecting */
- for (eBone=G.edbo.first;eBone;eBone=eBone->next){
-// if(arm->layer & eBone->layer) {
- if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)){
- sel=0;
- break;
- }
-// }
- }
- }
- else sel= toggle;
-
- /* Set the flags */
- for (eBone=G.edbo.first;eBone;eBone=eBone->next) {
- if (sel==3) {
- /* invert selection of bone */
- if ((arm->layer & eBone->layer) && (eBone->flag & BONE_HIDDEN_A)==0) {
- eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- eBone->flag &= ~BONE_ACTIVE;
- }
- }
- else if (sel==1) {
- /* select bone */
- if(arm->layer & eBone->layer && (eBone->flag & BONE_HIDDEN_A)==0) {
- eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
- if(eBone->parent)
- eBone->parent->flag |= (BONE_TIPSEL);
- }
- }
- else if (sel==2) {
- /* clear active flag */
- eBone->flag &= ~(BONE_ACTIVE);
- }
- else {
- /* deselect bone */
- eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE);
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- countall(); // flushes selection!
- if (doundo) {
- if (sel==1) BIF_undo_push("Select All");
- else BIF_undo_push("Deselect All");
- }
-}
-
-/* Sets the roll value of selected bones, depending on the mode
- * mode == 0: their z-axes point upwards
- * mode == 1: their z-axes point towards 3d-cursor
- */
-void auto_align_armature(short mode)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
- EditBone *flipbone = NULL;
- float delta[3];
- float curmat[3][3];
- float *cursor= give_cursor();
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (arm->flag & ARM_MIRROR_EDIT)
- flipbone = armature_bone_get_mirrored(ebone);
-
- if ((ebone->flag & BONE_SELECTED) ||
- (flipbone && (flipbone->flag & BONE_SELECTED)))
- {
- /* specific method used to calculate roll depends on mode */
- if (mode == 1) {
- /* Z-Axis point towards cursor */
- float mat[4][4], tmat[4][4], imat[4][4];
- float rmat[4][4], rot[3];
- float vec[3];
-
- /* find the current bone matrix as a 4x4 matrix (in Armature Space) */
- VecSubf(delta, ebone->tail, ebone->head);
- vec_roll_to_mat3(delta, ebone->roll, curmat);
- Mat4CpyMat3(mat, curmat);
- VECCOPY(mat[3], ebone->head);
-
- /* multiply bone-matrix by object matrix (so that bone-matrix is in WorldSpace) */
- Mat4MulMat4(tmat, mat, G.obedit->obmat);
- Mat4Invert(imat, tmat);
-
- /* find position of cursor relative to bone */
- VecMat4MulVecfl(vec, imat, cursor);
-
- /* check that cursor is in usable position */
- if ((IS_EQ(vec[0], 0)==0) && (IS_EQ(vec[2], 0)==0)) {
- /* Compute a rotation matrix around y */
- rot[1] = atan2(vec[0], vec[2]);
- rot[0] = rot[2] = 0.0f;
- EulToMat4(rot, rmat);
-
- /* Multiply the bone matrix by rotation matrix. This should be new bone-matrix */
- Mat4MulMat4(tmat, rmat, mat);
- Mat3CpyMat4(curmat, tmat);
-
- /* Now convert from new bone-matrix, back to a roll value (in radians) */
- mat3_to_vec_roll(curmat, delta, &ebone->roll);
- }
- }
- else {
- /* Z-Axis Point Up */
- float xaxis[3]={1.0, 0.0, 0.0}, yaxis[3], zaxis[3]={0.0, 0.0, 1.0};
- float targetmat[3][3], imat[3][3], diffmat[3][3];
-
- /* Find the current bone matrix */
- VecSubf(delta, ebone->tail, ebone->head);
- vec_roll_to_mat3(delta, 0.0, curmat);
-
- /* Make new matrix based on y axis & z-up */
- VECCOPY (yaxis, curmat[1]);
-
- Mat3One(targetmat);
- VECCOPY (targetmat[0], xaxis);
- VECCOPY (targetmat[1], yaxis);
- VECCOPY (targetmat[2], zaxis);
- Mat3Ortho(targetmat);
-
- /* Find the difference between the two matrices */
- Mat3Inv(imat, targetmat);
- Mat3MulMat3(diffmat, imat, curmat);
-
- ebone->roll = atan2(diffmat[2][0], diffmat[2][2]);
- }
- }
- }
- }
-}
-
-/* **************** undo for armatures ************** */
-
-static void undoBones_to_editBones(void *lbv)
-{
- ListBase *lb= lbv;
- EditBone *ebo, *newebo;
-
- BLI_freelistN(&G.edbo);
-
- /* copy */
- for(ebo= lb->first; ebo; ebo= ebo->next) {
- newebo= MEM_dupallocN(ebo);
- ebo->temp= newebo;
- BLI_addtail(&G.edbo, newebo);
- }
-
- /* set pointers */
- for(newebo= G.edbo.first; newebo; newebo= newebo->next) {
- if(newebo->parent) newebo->parent= newebo->parent->temp;
- }
- /* be sure they dont hang ever */
- for(newebo= G.edbo.first; newebo; newebo= newebo->next) {
- newebo->temp= NULL;
- }
-}
-
-static void *editBones_to_undoBones(void)
-{
- ListBase *lb;
- EditBone *ebo, *newebo;
-
- lb= MEM_callocN(sizeof(ListBase), "listbase undo");
-
- /* copy */
- for(ebo= G.edbo.first; ebo; ebo= ebo->next) {
- newebo= MEM_dupallocN(ebo);
- ebo->temp= newebo;
- BLI_addtail(lb, newebo);
- }
-
- /* set pointers */
- for(newebo= lb->first; newebo; newebo= newebo->next) {
- if(newebo->parent) newebo->parent= newebo->parent->temp;
- }
-
- return lb;
-}
-
-static void free_undoBones(void *lbv)
-{
- ListBase *lb= lbv;
-
- BLI_freelistN(lb);
- MEM_freeN(lb);
-}
-
-/* and this is all the undo system needs to know */
-void undo_push_armature(char *name)
-{
- undo_editmode_push(name, free_undoBones, undoBones_to_editBones, editBones_to_undoBones, NULL);
-}
-
-
-
-/* **************** END EditMode stuff ********************** */
-/* *************** Adding stuff in editmode *************** */
-
-/* default bone add, returns it selected, but without tail set */
-static EditBone *add_editbone(char *name)
-{
- bArmature *arm= G.obedit->data;
-
- EditBone *bone= MEM_callocN(sizeof(EditBone), "eBone");
-
- BLI_strncpy(bone->name, name, 32);
- unique_editbone_name(&G.edbo, bone->name);
-
- BLI_addtail(&G.edbo, bone);
-
- bone->flag |= BONE_TIPSEL;
- bone->weight= 1.0F;
- bone->dist= 0.25F;
- bone->xwidth= 0.1;
- bone->zwidth= 0.1;
- bone->ease1= 1.0;
- bone->ease2= 1.0;
- bone->rad_head= 0.10;
- bone->rad_tail= 0.05;
- bone->segments= 1;
- bone->layer= arm->layer;
-
- return bone;
-}
-
-static void add_primitive_bone(Object *ob, short newob)
-{
- float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3];
- EditBone *bone;
-
- VECCOPY(curs, give_cursor());
-
- /* Get inverse point for head and orientation for tail */
- Mat4Invert(G.obedit->imat, G.obedit->obmat);
- Mat4MulVecfl(G.obedit->imat, curs);
-
- if ( !(newob) || (U.flag & USER_ADD_VIEWALIGNED) ) Mat3CpyMat4(obmat, G.vd->viewmat);
- else Mat3One(obmat);
-
- Mat3CpyMat4(viewmat, G.obedit->obmat);
- Mat3MulMat3(totmat, obmat, viewmat);
- Mat3Inv(imat, totmat);
-
- deselectall_armature(0, 0);
-
- /* Create a bone */
- bone= add_editbone("Bone");
-
- VECCOPY(bone->head, curs);
-
- if ( !(newob) || (U.flag & USER_ADD_VIEWALIGNED) )
- VecAddf(bone->tail, bone->head, imat[1]); // bone with unit length 1
- else
- VecAddf(bone->tail, bone->head, imat[2]); // bone with unit length 1, pointing up Z
-
-}
-
-void add_primitiveArmature(int type)
-{
- short newob=0;
-
- if(G.scene->id.lib) return;
-
- /* this function also comes from an info window */
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
- if (G.vd==NULL) return;
-
- G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE);
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
-
- check_editmode(OB_ARMATURE);
-
- /* If we're not the "obedit", make a new object and enter editmode */
- if (G.obedit==NULL) {
- add_object(OB_ARMATURE);
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
-
- where_is_object(G.obedit);
-
- make_editArmature();
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- newob=1;
- }
-
- /* no primitive support yet */
- add_primitive_bone(G.obedit, newob);
-
- countall(); // flushes selection!
-
- if ((newob) && !(U.flag & USER_ADD_EDITMODE)) {
- exit_editmode(2);
- }
-
- allqueue(REDRAWALL, 0);
- BIF_undo_push("Add primitive");
-}
-
-/* the ctrl-click method */
-void addvert_armature(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone, *newbone, *flipbone;
- float *curs, mat[3][3],imat[3][3];
- int a, to_root= 0;
-
- TEST_EDITARMATURE;
-
- /* find the active or selected bone */
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & (BONE_ACTIVE|BONE_TIPSEL))
- break;
- }
- }
-
- if (ebone==NULL) {
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & (BONE_ACTIVE|BONE_ROOTSEL))
- break;
- }
- }
- if (ebone == NULL)
- return;
-
- to_root= 1;
- }
-
- deselectall_armature(0, 0);
-
- /* we re-use code for mirror editing... */
- flipbone= NULL;
- if (arm->flag & ARM_MIRROR_EDIT)
- flipbone= armature_bone_get_mirrored(ebone);
-
- for (a=0; a<2; a++) {
- if (a==1) {
- if (flipbone==NULL)
- break;
- else {
- SWAP(EditBone *, flipbone, ebone);
- }
- }
-
- newbone= add_editbone(ebone->name);
- newbone->flag |= BONE_ACTIVE;
-
- if (to_root) {
- VECCOPY(newbone->head, ebone->head);
- newbone->rad_head= ebone->rad_tail;
- newbone->parent= ebone->parent;
- }
- else {
- VECCOPY(newbone->head, ebone->tail);
- newbone->rad_head= ebone->rad_tail;
- newbone->parent= ebone;
- newbone->flag |= BONE_CONNECTED;
- }
-
- curs= give_cursor();
- VECCOPY(newbone->tail, curs);
- VecSubf(newbone->tail, newbone->tail, G.obedit->obmat[3]);
-
- if (a==1)
- newbone->tail[0]= -newbone->tail[0];
-
- Mat3CpyMat4(mat, G.obedit->obmat);
- Mat3Inv(imat, mat);
- Mat3MulVecfl(imat, newbone->tail);
-
- newbone->length= VecLenf(newbone->head, newbone->tail);
- newbone->rad_tail= newbone->length*0.05f;
- newbone->dist= newbone->length*0.25f;
-
- }
-
- countall();
-
- BIF_undo_push("Add Bone");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* adds an EditBone between the nominated locations (should be in the right space) */
-static EditBone *add_points_bone (float head[], float tail[])
-{
- EditBone *ebo;
-
- ebo= add_editbone("Bone");
-
- VECCOPY(ebo->head, head);
- VECCOPY(ebo->tail, tail);
-
- return ebo;
-}
-
-
-static EditBone *get_named_editbone(char *name)
-{
- EditBone *eBone;
-
- if (name) {
- for (eBone=G.edbo.first; eBone; eBone=eBone->next) {
- if (!strcmp(name, eBone->name))
- return eBone;
- }
- }
-
- return NULL;
-}
-
-static void update_dup_subtarget(EditBone *dupBone)
-{
- /* If an edit bone has been duplicated, lets
- * update it's constraints if the subtarget
- * they point to has also been duplicated
- */
- EditBone *oldtarget, *newtarget;
- bPoseChannel *chan;
- bConstraint *curcon;
- ListBase *conlist;
-
- if ( (chan = verify_pose_channel(OBACT->pose, dupBone->name)) ) {
- if ( (conlist = &chan->constraints) ) {
- for (curcon = conlist->first; curcon; curcon=curcon->next) {
- /* does this constraint have a subtarget in
- * this armature?
- */
- bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(curcon, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if ((ct->tar == G.obedit) && (ct->subtarget[0])) {
- oldtarget = get_named_editbone(ct->subtarget);
- if (oldtarget) {
- /* was the subtarget bone duplicated too? If
- * so, update the constraint to point at the
- * duplicate of the old subtarget.
- */
- if (oldtarget->flag & BONE_SELECTED){
- newtarget = (EditBone *) oldtarget->temp;
- strcpy(ct->subtarget, newtarget->name);
- }
- }
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(curcon, &targets, 0);
- }
- }
- }
- }
-}
-
-
-void adduplicate_armature(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *eBone = NULL;
- EditBone *curBone;
- EditBone *firstDup=NULL; /* The beginning of the duplicated bones in the edbo list */
-
- countall(); // flushes selection!
-
- /* Select mirrored bones */
- if (arm->flag & ARM_MIRROR_EDIT) {
- for (curBone=G.edbo.first; curBone; curBone=curBone->next) {
- if (EBONE_VISIBLE(arm, curBone)) {
- if (curBone->flag & BONE_SELECTED) {
- eBone = armature_bone_get_mirrored(curBone);
- if (eBone)
- eBone->flag |= BONE_SELECTED;
- }
- }
- }
- }
-
- /* Find the selected bones and duplicate them as needed */
- for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (EBONE_VISIBLE(arm, curBone)) {
- if (curBone->flag & BONE_SELECTED) {
- eBone=MEM_callocN(sizeof(EditBone), "addup_editbone");
- eBone->flag |= BONE_SELECTED;
-
- /* Copy data from old bone to new bone */
- memcpy(eBone, curBone, sizeof(EditBone));
-
- curBone->temp = eBone;
- eBone->temp = curBone;
-
- unique_editbone_name(&G.edbo, eBone->name);
- BLI_addtail(&G.edbo, eBone);
- if (!firstDup)
- firstDup=eBone;
-
- /* Lets duplicate the list of constraints that the
- * current bone has.
- */
- if (OBACT->pose) {
- bPoseChannel *chanold, *channew;
- ListBase *listold, *listnew;
-
- chanold = verify_pose_channel(OBACT->pose, curBone->name);
- if (chanold) {
- listold = &chanold->constraints;
- if (listold) {
- /* WARNING: this creates a new posechannel, but there will not be an attached bone
- * yet as the new bones created here are still 'EditBones' not 'Bones'.
- */
- channew =
- verify_pose_channel(OBACT->pose, eBone->name);
- if (channew) {
- /* copy transform locks */
- channew->protectflag = chanold->protectflag;
-
- /* copy bone group */
- channew->agrp_index= chanold->agrp_index;
-
- /* ik (dof) settings */
- channew->ikflag = chanold->ikflag;
- VECCOPY(channew->limitmin, chanold->limitmin);
- VECCOPY(channew->limitmax, chanold->limitmax);
- VECCOPY(channew->stiffness, chanold->stiffness);
- channew->ikstretch= chanold->ikstretch;
-
- /* constraints */
- listnew = &channew->constraints;
- copy_constraints(listnew, listold);
-
- /* custom shape */
- channew->custom= chanold->custom;
- }
- }
- }
- }
- }
- }
- }
-
- /* Run though the list and fix the pointers */
- for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (EBONE_VISIBLE(arm, curBone)) {
- if (curBone->flag & BONE_SELECTED) {
- eBone=(EditBone*) curBone->temp;
-
- /* If this bone has no parent,
- Set the duplicate->parent to NULL
- */
- if (!curBone->parent)
- eBone->parent = NULL;
- /* If this bone has a parent that IS selected,
- Set the duplicate->parent to the curBone->parent->duplicate
- */
- else if (curBone->parent->flag & BONE_SELECTED)
- eBone->parent= (EditBone *)curBone->parent->temp;
- /* If this bone has a parent that IS not selected,
- Set the duplicate->parent to the curBone->parent
- */
- else {
- eBone->parent=(EditBone*) curBone->parent;
- eBone->flag &= ~BONE_CONNECTED;
- }
-
- /* Lets try to fix any constraint subtargets that might
- have been duplicated */
- update_dup_subtarget(eBone);
- }
- }
- }
-
- /* Deselect the old bones and select the new ones */
-
- for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next) {
- if (EBONE_VISIBLE(arm, curBone))
- curBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE);
- }
-
- BIF_TransformSetUndo("Add Duplicate");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-
-
-/* *************** END Adding stuff in editmode *************** */
-/* ************** Add/Remove stuff in editmode **************** */
-
-/* temporary data-structure for merge/fill bones */
-typedef struct EditBonePoint {
- struct EditBonePoint *next, *prev;
-
- EditBone *head_owner; /* EditBone which uses this point as a 'head' point */
- EditBone *tail_owner; /* EditBone which uses this point as a 'tail' point */
-
- float vec[3]; /* the actual location of the point in local/EditMode space */
-} EditBonePoint;
-
-/* find chain-tips (i.e. bones without children) */
-static void chains_find_tips (ListBase *list)
-{
- EditBone *curBone, *ebo;
- LinkData *ld;
-
- /* note: this is potentially very slow ... there's got to be a better way */
- for (curBone= G.edbo.first; curBone; curBone= curBone->next) {
- short stop= 0;
-
- /* is this bone contained within any existing chain? (skip if so) */
- for (ld= list->first; ld; ld= ld->next) {
- for (ebo= ld->data; ebo; ebo= ebo->parent) {
- if (ebo == curBone) {
- stop= 1;
- break;
- }
- }
-
- if (stop) break;
- }
- /* skip current bone if it is part of an existing chain */
- if (stop) continue;
-
- /* is any existing chain part of the chain formed by this bone? */
- stop= 0;
- for (ebo= curBone->parent; ebo; ebo= ebo->parent) {
- for (ld= list->first; ld; ld= ld->next) {
- if (ld->data == ebo) {
- ld->data= curBone;
- stop= 1;
- break;
- }
- }
-
- if (stop) break;
- }
- /* current bone has already been added to a chain? */
- if (stop) continue;
-
- /* add current bone to a new chain */
- ld= MEM_callocN(sizeof(LinkData), "BoneChain");
- ld->data= curBone;
- BLI_addtail(list, ld);
- }
-}
-
-
-static void fill_add_joint (EditBone *ebo, short eb_tail, ListBase *points)
-{
- EditBonePoint *ebp;
- float vec[3];
- short found= 0;
-
- if (eb_tail) {
- VECCOPY(vec, ebo->tail);
- }
- else {
- VECCOPY(vec, ebo->head);
- }
-
- for (ebp= points->first; ebp; ebp= ebp->next) {
- if (VecEqual(ebp->vec, vec)) {
- if (eb_tail) {
- if ((ebp->head_owner) && (ebp->head_owner->parent == ebo)) {
- /* so this bone's tail owner is this bone */
- ebp->tail_owner= ebo;
- found= 1;
- break;
- }
- }
- else {
- if ((ebp->tail_owner) && (ebo->parent == ebp->tail_owner)) {
- /* so this bone's head owner is this bone */
- ebp->head_owner= ebo;
- found = 1;
- break;
- }
- }
- }
- }
-
- /* allocate a new point if no existing point was related */
- if (found == 0) {
- ebp= MEM_callocN(sizeof(EditBonePoint), "EditBonePoint");
-
- if (eb_tail) {
- VECCOPY(ebp->vec, ebo->tail);
- ebp->tail_owner= ebo;
- }
- else {
- VECCOPY(ebp->vec, ebo->head);
- ebp->head_owner= ebo;
- }
-
- BLI_addtail(points, ebp);
- }
-}
-
-/* bone adding between selected joints */
-void fill_bones_armature(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebo, *newbone=NULL;
- ListBase points = {NULL, NULL};
- int count;
-
- /* loop over all bones, and only consider if visible */
- for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if (EBONE_VISIBLE(arm, ebo)) {
- if (!(ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL))
- fill_add_joint(ebo, 0, &points);
- if (ebo->flag & BONE_TIPSEL)
- fill_add_joint(ebo, 1, &points);
- }
- }
-
- /* the number of joints determines how we fill:
- * 1) between joint and cursor (joint=head, cursor=tail)
- * 2) between the two joints (order is dependent on active-bone/hierachy)
- * 3+) error (a smarter method involving finding chains needs to be worked out
- */
- count= BLI_countlist(&points);
-
- if (count == 0) {
- error("No joints selected");
- return;
- }
- else if (count == 1) {
- EditBonePoint *ebp;
- float curs[3];
-
- /* Get Points - selected joint */
- ebp= (EditBonePoint *)points.first;
-
- /* Get points - cursor (tail) */
- VECCOPY (curs, give_cursor());
-
- Mat4Invert(G.obedit->imat, G.obedit->obmat);
- Mat4MulVecfl(G.obedit->imat, curs);
-
- /* Create a bone */
- newbone= add_points_bone(ebp->vec, curs);
- }
- else if (count == 2) {
- EditBonePoint *ebp, *ebp2;
- float head[3], tail[3];
- short headtail = 0;
-
- /* check that the points don't belong to the same bone */
- ebp= (EditBonePoint *)points.first;
- ebp2= ebp->next;
-
- if ((ebp->head_owner==ebp2->tail_owner) && (ebp->head_owner!=NULL)) {
- error("Same bone selected...");
- BLI_freelistN(&points);
- return;
- }
- if ((ebp->tail_owner==ebp2->head_owner) && (ebp->tail_owner!=NULL)) {
- error("Same bone selected...");
- BLI_freelistN(&points);
- return;
- }
-
- /* find which one should be the 'head' */
- if ((ebp->head_owner && ebp2->head_owner) || (ebp->tail_owner && ebp2->tail_owner)) {
- /* rule: whichever one is closer to 3d-cursor */
- float curs[3];
- float vecA[3], vecB[3];
- float distA, distB;
-
- /* get cursor location */
- VECCOPY(curs, give_cursor());
-
- Mat4Invert(G.obedit->imat, G.obedit->obmat);
- Mat4MulVecfl(G.obedit->imat, curs);
-
- /* get distances */
- VecSubf(vecA, ebp->vec, curs);
- VecSubf(vecB, ebp2->vec, curs);
- distA= VecLength(vecA);
- distB= VecLength(vecB);
-
- /* compare distances - closer one therefore acts as direction for bone to go */
- headtail= (distA < distB) ? 2 : 1;
- }
- else if (ebp->head_owner) {
- headtail = 1;
- }
- else if (ebp2->head_owner) {
- headtail = 2;
- }
-
- /* assign head/tail combinations */
- if (headtail == 2) {
- VECCOPY(head, ebp->vec);
- VECCOPY(tail, ebp2->vec);
- }
- else if (headtail == 1) {
- VECCOPY(head, ebp2->vec);
- VECCOPY(tail, ebp->vec);
- }
-
- /* add new bone and parent it to the appropriate end */
- if (headtail) {
- newbone= add_points_bone(head, tail);
-
- /* do parenting (will need to set connected flag too) */
- if (headtail == 2) {
- /* ebp tail or head - tail gets priority */
- if (ebp->tail_owner)
- newbone->parent= ebp->tail_owner;
- else
- newbone->parent= ebp->head_owner;
- }
- else {
- /* ebp2 tail or head - tail gets priority */
- if (ebp2->tail_owner)
- newbone->parent= ebp2->tail_owner;
- else
- newbone->parent= ebp2->head_owner;
- }
-
- newbone->flag |= BONE_CONNECTED;
- }
- }
- else {
- // FIXME.. figure out a method for multiple bones
- error("Too many points selected");
- printf("Points selected: %d \n", count);
- BLI_freelistN(&points);
- return;
- }
-
- /* free points */
- BLI_freelistN(&points);
-
- /* undo + updates */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Fill Bones");
-}
-
-/* this function merges between two bones, removes them and those in-between,
- * and adjusts the parent relationships for those in-between
- */
-static void bones_merge(EditBone *start, EditBone *end, EditBone *endchild, ListBase *chains)
-{
- EditBone *ebo, *ebone, *newbone;
- LinkData *chain;
- float head[3], tail[3];
-
- /* check if same bone */
- if (start == end) {
- printf("Error: same bone! \n");
- printf("\tstart = %s, end = %s \n", start->name, end->name);
- }
-
- /* step 1: add a new bone
- * - head = head/tail of start (default head)
- * - tail = head/tail of end (default tail)
- * - parent = parent of start
- */
- if ((start->flag & BONE_TIPSEL) && !(start->flag & (BONE_SELECTED|BONE_ACTIVE))) {
- VECCOPY(head, start->tail);
- }
- else {
- VECCOPY(head, start->head);
- }
- if ((end->flag & BONE_ROOTSEL) && !(end->flag & (BONE_SELECTED|BONE_ACTIVE))) {
- VECCOPY(tail, end->head);
- }
- else {
- VECCOPY(tail, end->tail);
- }
- newbone= add_points_bone(head, tail);
- newbone->parent = start->parent;
-
- /* step 2a: parent children of in-between bones to newbone */
- for (chain= chains->first; chain; chain= chain->next) {
- /* ick: we need to check if parent of each bone in chain is one of the bones in the */
- for (ebo= chain->data; ebo; ebo= ebo->parent) {
- short found= 0;
-
- /* try to find which bone from the list to be removed, is the parent */
- for (ebone= end; ebone; ebone= ebone->parent) {
- if (ebo->parent == ebone) {
- found= 1;
- break;
- }
- }
-
- /* adjust this bone's parent to newbone then */
- if (found) {
- ebo->parent= newbone;
- break;
- }
- }
- }
-
- /* step 2b: parent child of end to newbone (child from this chain) */
- if (endchild)
- endchild->parent= newbone;
-
- /* step 3: delete all bones between and including start and end */
- for (ebo= end; ebo; ebo= ebone) {
- ebone= (ebo == start) ? (NULL) : (ebo->parent);
- BLI_freelinkN(&G.edbo, ebo);
- }
-}
-
-/* bone merging - has a menu! */
-void merge_armature(void)
-{
- bArmature *arm= G.obedit->data;
- short val= 0;
-
- /* process a menu to determine how to merge */
- // TODO: there's room for more modes of merging stuff...
- val= pupmenu("Merge Selected Bones%t|Within Chains%x1");
- if (val <= 0) return;
-
- if (val == 1) {
- /* go down chains, merging bones */
- ListBase chains = {NULL, NULL};
- LinkData *chain, *nchain;
- EditBone *ebo;
-
- /* get chains (ends on chains) */
- chains_find_tips(&chains);
- if (chains.first == NULL) return;
-
- /* each 'chain' is the last bone in the chain (with no children) */
- for (chain= chains.first; chain; chain= nchain) {
- EditBone *bstart= NULL, *bend= NULL;
- EditBone *bchild= NULL, *child=NULL;
-
- /* temporarily remove chain from list of chains */
- nchain= chain->next;
- BLI_remlink(&chains, chain);
-
- /* only consider bones that are visible and selected */
- for (ebo=chain->data; ebo; child=ebo, ebo=ebo->parent) {
- /* check if visible + selected */
- if ( EBONE_VISIBLE(arm, ebo) &&
- ((ebo->flag & BONE_CONNECTED) || (ebo->parent==NULL)) &&
- (ebo->flag & (BONE_SELECTED|BONE_ACTIVE)) )
- {
- /* set either end or start (end gets priority, unless it is already set) */
- if (bend == NULL) {
- bend= ebo;
- bchild= child;
- }
- else
- bstart= ebo;
- }
- else {
- /* chain is broken... merge any continous segments then clear */
- if (bstart && bend)
- bones_merge(bstart, bend, bchild, &chains);
-
- bstart = NULL;
- bend = NULL;
- bchild = NULL;
- }
- }
-
- /* merge from bstart to bend if something not merged */
- if (bstart && bend)
- bones_merge(bstart, bend, bchild, &chains);
-
- /* put back link */
- BLI_insertlinkbefore(&chains, nchain, chain);
- }
-
- BLI_freelistN(&chains);
- }
-
- /* undo + updates */
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Merge Bones");
-}
-
-/* ************** END Add/Remove stuff in editmode ************ */
-/* *************** Tools in editmode *********** */
-
-
-void hide_selected_armature_bones(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & (BONE_SELECTED)) {
- ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE);
- ebone->flag |= BONE_HIDDEN_A;
- }
- }
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Hide Bones");
-}
-
-void hide_unselected_armature_bones(void)
-{
- EditBone *ebone;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- bArmature *arm= G.obedit->data;
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL));
- else {
- ebone->flag &= ~BONE_ACTIVE;
- ebone->flag |= BONE_HIDDEN_A;
- }
- }
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Hide Unselected Bones");
-}
-
-void show_all_armature_bones(void)
-{
- EditBone *ebone;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- bArmature *arm= G.obedit->data;
- if(arm->layer & ebone->layer) {
- if (ebone->flag & BONE_HIDDEN_A) {
- ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
- ebone->flag &= ~BONE_HIDDEN_A;
- }
- }
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Reveal Bones");
-}
-
-/* check for null, before calling! */
-static void bone_connect_to_existing_parent(EditBone *bone)
-{
- bone->flag |= BONE_CONNECTED;
- VECCOPY(bone->head, bone->parent->tail);
- bone->rad_head = bone->parent->rad_tail;
-}
-
-static void bone_connect_to_new_parent(EditBone *selbone, EditBone *actbone, short mode)
-{
- EditBone *ebone;
- float offset[3];
-
- if ((selbone->parent) && (selbone->flag & BONE_CONNECTED))
- selbone->parent->flag &= ~(BONE_TIPSEL);
-
- /* make actbone the parent of selbone */
- selbone->parent= actbone;
-
- /* in actbone tree we cannot have a loop */
- for (ebone= actbone->parent; ebone; ebone= ebone->parent) {
- if (ebone->parent==selbone) {
- ebone->parent= NULL;
- ebone->flag &= ~BONE_CONNECTED;
- }
- }
-
- if (mode == 1) {
- /* Connected: Child bones will be moved to the parent tip */
- selbone->flag |= BONE_CONNECTED;
- VecSubf(offset, actbone->tail, selbone->head);
-
- VECCOPY(selbone->head, actbone->tail);
- selbone->rad_head= actbone->rad_tail;
-
- VecAddf(selbone->tail, selbone->tail, offset);
-
- /* offset for all its children */
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- EditBone *par;
-
- for (par= ebone->parent; par; par= par->parent) {
- if (par==selbone) {
- VecAddf(ebone->head, ebone->head, offset);
- VecAddf(ebone->tail, ebone->tail, offset);
- break;
- }
- }
- }
- }
- else {
- /* Offset: Child bones will retain their distance from the parent tip */
- selbone->flag &= ~BONE_CONNECTED;
- }
-}
-
-void make_bone_parent(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *actbone, *ebone, *selbone;
- EditBone *flipbone, *flippar;
- short allchildbones= 0, foundselbone= 0;
- short val;
-
- /* find active bone to parent to */
- for (actbone = G.edbo.first; actbone; actbone=actbone->next) {
- if (EBONE_VISIBLE(arm, actbone)) {
- if (actbone->flag & BONE_ACTIVE)
- break;
- }
- }
- if (actbone == NULL) {
- error("Needs an active bone");
- return;
- }
-
- /* find selected bones */
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) {
- foundselbone++;
- if (ebone->parent != actbone) allchildbones= 1;
- }
- }
- }
- /* abort if no selected bones, and active bone doesn't have a parent to work with instead */
- if (foundselbone==0 && actbone->parent==NULL) {
- error("Need selected bone(s)");
- return;
- }
-
- /* 'Keep Offset' option is only displayed if it's likely to be useful */
- if (allchildbones)
- val= pupmenu("Make Parent%t|Connected%x1|Keep Offset%x2");
- else
- val= pupmenu("Make Parent%t|Connected%x1");
-
- if (val < 1) return;
-
- if (foundselbone==0 && actbone->parent) {
- /* When only the active bone is selected, and it has a parent,
- * connect it to the parent, as that is the only possible outcome.
- */
- bone_connect_to_existing_parent(actbone);
-
- if (arm->flag & ARM_MIRROR_EDIT) {
- flipbone = armature_bone_get_mirrored(actbone);
- if (flipbone)
- bone_connect_to_existing_parent(flipbone);
- }
- }
- else {
- /* loop through all editbones, parenting all selected bones to the active bone */
- for (selbone = G.edbo.first; selbone; selbone=selbone->next) {
- if (EBONE_VISIBLE(arm, selbone)) {
- if ((selbone->flag & BONE_SELECTED) && (selbone!=actbone)) {
- /* parent selbone to actbone */
- bone_connect_to_new_parent(selbone, actbone, val);
-
- if (arm->flag & ARM_MIRROR_EDIT) {
- /* - if there's a mirrored copy of selbone, try to find a mirrored copy of actbone
- * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
- * This is useful for arm-chains, for example parenting lower arm to upper arm
- * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
- * then just use actbone. Useful when doing upper arm to spine.
- */
- flipbone = armature_bone_get_mirrored(selbone);
- flippar = armature_bone_get_mirrored(actbone);
-
- if (flipbone) {
- if (flippar)
- bone_connect_to_new_parent(flipbone, flippar, val);
- else
- bone_connect_to_new_parent(flipbone, actbone, val);
- }
- }
- }
- }
- }
- }
-
- countall(); /* checks selection */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Make Parent");
-
- return;
-}
-
-static void editbone_clear_parent(EditBone *ebone, int mode)
-{
- if (ebone->parent) {
- /* for nice selection */
- ebone->parent->flag &= ~(BONE_TIPSEL);
- }
-
- if (mode==1) ebone->parent= NULL;
- ebone->flag &= ~BONE_CONNECTED;
-}
-
-void clear_bone_parent(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
- EditBone *flipbone = NULL;
- short val;
-
- val= pupmenu("Clear Parent%t|Clear Parent%x1|Disconnect Bone%x2");
- if (val<1) return;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & BONE_SELECTED) {
- if (arm->flag & ARM_MIRROR_EDIT)
- flipbone = armature_bone_get_mirrored(ebone);
-
- if (flipbone)
- editbone_clear_parent(flipbone, val);
- editbone_clear_parent(ebone, val);
- }
- }
- }
-
- countall(); // checks selection
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Clear Parent");
-}
-
-
-static EditBone *editbone_name_exists (ListBase *ebones, char *name)
-{
- EditBone *eBone;
-
- if (ebones == NULL) ebones = &G.edbo;
-
- for (eBone=ebones->first; eBone; eBone=eBone->next) {
- if (!strcmp(name, eBone->name))
- return eBone;
- }
- return NULL;
-}
-
-/* note: there's a unique_bone_name() too! */
-void unique_editbone_name (ListBase *ebones, char *name)
-{
- char tempname[64];
- int number;
- char *dot;
-
- if (editbone_name_exists(ebones, name)) {
- /* Strip off the suffix, if it's a number */
- number= strlen(name);
- if (number && isdigit(name[number-1])) {
- dot= strrchr(name, '.'); // last occurrance
- if (dot)
- *dot=0;
- }
-
- for (number = 1; number <=999; number++) {
- sprintf(tempname, "%s.%03d", name, number);
- if (!editbone_name_exists(ebones, tempname)) {
- BLI_strncpy(name, tempname, 32);
- return;
- }
- }
- }
-}
-
-/* context; editmode armature */
-/* if forked && mirror-edit: makes two bones with flipped names */
-void extrude_armature(int forked)
-{
- bArmature *arm= G.obedit->data;
- EditBone *newbone, *ebone, *flipbone, *first=NULL;
- int a, totbone= 0, do_extrude;
-
- TEST_EDITARMATURE;
-
- /* since we allow root extrude too, we have to make sure selection is OK */
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- if (ebone->flag & BONE_ROOTSEL) {
- if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
- if (ebone->parent->flag & BONE_TIPSEL)
- ebone->flag &= ~BONE_ROOTSEL;
- }
- }
- }
- }
-
- /* Duplicate the necessary bones */
- for (ebone = G.edbo.first; ((ebone) && (ebone!=first)); ebone=ebone->next) {
- if (EBONE_VISIBLE(arm, ebone)) {
- /* we extrude per definition the tip */
- do_extrude= 0;
- if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED))
- do_extrude= 1;
- else if (ebone->flag & BONE_ROOTSEL) {
- /* but, a bone with parent deselected we do the root... */
- if (ebone->parent && (ebone->parent->flag & BONE_TIPSEL));
- else do_extrude= 2;
- }
-
- if (do_extrude) {
- /* we re-use code for mirror editing... */
- flipbone= NULL;
- if (arm->flag & ARM_MIRROR_EDIT) {
- flipbone= armature_bone_get_mirrored(ebone);
- if (flipbone) {
- forked= 0; // we extrude 2 different bones
- if (flipbone->flag & (BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED))
- /* don't want this bone to be selected... */
- flipbone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE);
- }
- if ((flipbone==NULL) && (forked))
- flipbone= ebone;
- }
-
- for (a=0; a<2; a++) {
- if (a==1) {
- if (flipbone==NULL)
- break;
- else {
- SWAP(EditBone *, flipbone, ebone);
- }
- }
-
- totbone++;
- newbone = MEM_callocN(sizeof(EditBone), "extrudebone");
-
- if (do_extrude==1) {
- VECCOPY (newbone->head, ebone->tail);
- VECCOPY (newbone->tail, newbone->head);
- newbone->parent = ebone;
-
- newbone->flag = ebone->flag & BONE_TIPSEL; // copies it, in case mirrored bone
-
- if (newbone->parent) newbone->flag |= BONE_CONNECTED;
- }
- else {
- VECCOPY(newbone->head, ebone->head);
- VECCOPY(newbone->tail, ebone->head);
- newbone->parent= ebone->parent;
-
- newbone->flag= BONE_TIPSEL;
-
- if (newbone->parent && (ebone->flag & BONE_CONNECTED)) {
- newbone->flag |= BONE_CONNECTED;
- }
- }
-
- newbone->weight= ebone->weight;
- newbone->dist= ebone->dist;
- newbone->xwidth= ebone->xwidth;
- newbone->zwidth= ebone->zwidth;
- newbone->ease1= ebone->ease1;
- newbone->ease2= ebone->ease2;
- newbone->rad_head= ebone->rad_tail; // dont copy entire bone...
- newbone->rad_tail= ebone->rad_tail;
- newbone->segments= 1;
- newbone->layer= ebone->layer;
-
- BLI_strncpy (newbone->name, ebone->name, 32);
-
- if (flipbone && forked) { // only set if mirror edit
- if (strlen(newbone->name)<30) {
- if (a==0) strcat(newbone->name, "_L");
- else strcat(newbone->name, "_R");
- }
- }
- unique_editbone_name(&G.edbo, newbone->name);
-
- /* Add the new bone to the list */
- BLI_addtail(&G.edbo, newbone);
- if (!first)
- first = newbone;
-
- /* restore ebone if we were flipping */
- if (a==1 && flipbone)
- SWAP(EditBone *, flipbone, ebone);
- }
- }
-
- /* Deselect the old bone */
- ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE);
- }
- }
- /* if only one bone, make this one active */
- if (totbone==1 && first) first->flag |= BONE_ACTIVE;
-
- /* Transform the endpoints */
- countall(); // flushes selection!
- BIF_TransformSetUndo("Extrude");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-/* context; editmode armature */
-void subdivide_armature(int numcuts)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone, *newbone, *tbone, *mbone;
- int a, i;
-
- if (numcuts < 1) return;
-
- for (mbone = G.edbo.last; mbone; mbone= mbone->prev) {
- if (EBONE_VISIBLE(arm, mbone)) {
- if (mbone->flag & BONE_SELECTED) {
- for (i=numcuts+1; i>1; i--) {
- /* compute cut ratio first */
- float cutratio= 1/(float)i;
- float cutratioI= 1-cutratio;
-
- /* take care of mirrored stuff */
- for (a=0; a<2; a++) {
- float val1[3];
- float val2[3];
- float val3[3];
-
- /* try to find mirrored bone on a != 0 */
- if (a) {
- if (arm->flag & ARM_MIRROR_EDIT)
- ebone= armature_bone_get_mirrored(mbone);
- else
- ebone= NULL;
- }
- else
- ebone= mbone;
-
- if (ebone) {
- newbone= MEM_mallocN(sizeof(EditBone), "ebone subdiv");
- *newbone = *ebone;
- BLI_addtail(&G.edbo, newbone);
-
- /* calculate location of newbone->head */
- VECCOPY(val1, ebone->head);
- VECCOPY(val2, ebone->tail);
- VECCOPY(val3, newbone->head);
-
- val3[0]= val1[0]*cutratio+val2[0]*cutratioI;
- val3[1]= val1[1]*cutratio+val2[1]*cutratioI;
- val3[2]= val1[2]*cutratio+val2[2]*cutratioI;
-
- VECCOPY(newbone->head, val3);
- VECCOPY(newbone->tail, ebone->tail);
- VECCOPY(ebone->tail, newbone->head);
-
- newbone->rad_head= 0.5*(ebone->rad_head+ebone->rad_tail);
- ebone->rad_tail= newbone->rad_head;
-
- newbone->flag |= BONE_CONNECTED;
-
- unique_editbone_name (&G.edbo, newbone->name);
-
- /* correct parent bones */
- for (tbone = G.edbo.first; tbone; tbone=tbone->next) {
- if (tbone->parent==ebone)
- tbone->parent= newbone;
- }
- newbone->parent= ebone;
- }
- }
- }
- }
- }
- }
-
- if (numcuts==1) BIF_undo_push("Subdivide");
- else BIF_undo_push("Subdivide multi");
-}
-
-/* switch direction of bone chains */
-void switch_direction_armature (void)
-{
- bArmature *arm= (G.obedit) ? G.obedit->data : NULL;
- ListBase chains = {NULL, NULL};
- LinkData *chain;
-
- /* error checking paranoia */
- if (arm == NULL)
- return;
-
- /* get chains of bones (ends on chains) */
- chains_find_tips(&chains);
- if (chains.first == NULL) return;
-
- /* loop over chains, only considering selected and visible bones */
- for (chain= chains.first; chain; chain= chain->next) {
- EditBone *ebo, *child=NULL, *parent=NULL;
-
- /* loop over bones in chain */
- for (ebo= chain->data; ebo; ebo= parent) {
- /* parent is this bone's original parent
- * - we store this, as the next bone that is checked is this one
- * but the value of ebo->parent may change here...
- */
- parent= ebo->parent;
-
- /* only if selected and editable */
- if (EBONE_VISIBLE(arm, ebo) && EBONE_EDITABLE(ebo)) {
- /* swap head and tail coordinates */
- SWAP(float, ebo->head[0], ebo->tail[0]);
- SWAP(float, ebo->head[1], ebo->tail[1]);
- SWAP(float, ebo->head[2], ebo->tail[2]);
-
- /* do parent swapping:
- * - use 'child' as new parent
- * - connected flag is only set if points are coincidental
- */
- ebo->parent= child;
- if ((child) && VecEqual(ebo->head, child->tail))
- ebo->flag |= BONE_CONNECTED;
- else
- ebo->flag &= ~BONE_CONNECTED;
-
- /* get next bones
- * - child will become the new parent of next bone
- */
- child= ebo;
- }
- else {
- /* not swapping this bone, however, if its 'parent' got swapped, unparent us from it
- * as it will be facing in opposite direction
- */
- if ((parent) && (EBONE_VISIBLE(arm, parent) && EBONE_EDITABLE(parent))) {
- ebo->parent= NULL;
- ebo->flag &= ~BONE_CONNECTED;
- }
-
- /* get next bones
- * - child will become new parent of next bone (not swapping occurred,
- * so set to NULL to prevent infinite-loop)
- */
- child= NULL;
- }
- }
- }
-
- /* free chains */
- BLI_freelistN(&chains);
-
- BIF_undo_push("Switch Direction");
-}
-
-/* editbone alignment */
-
-/* helper to fix a ebone position if its parent has moved due to alignment*/
-static void fix_connected_bone(EditBone *ebone)
-{
- float diff[3];
-
- if (!(ebone->parent) || !(ebone->flag & BONE_CONNECTED) || VecEqual(ebone->parent->tail, ebone->head))
- return;
-
- /* if the parent has moved we translate child's head and tail accordingly*/
- VecSubf(diff, ebone->parent->tail, ebone->head);
- VecAddf(ebone->head, ebone->head, diff);
- VecAddf(ebone->tail, ebone->tail, diff);
- return;
-}
-
-/* helper to recursively find chains of connected bones starting at ebone and fix their position */
-static void fix_editbone_connected_children(EditBone *ebone)
-{
- EditBone *selbone;
-
- for (selbone = G.edbo.first; selbone; selbone=selbone->next) {
- if ((selbone->parent) && (selbone->parent == ebone) && (selbone->flag & BONE_CONNECTED)) {
- fix_connected_bone(selbone);
- fix_editbone_connected_children(selbone);
- }
- }
- return;
-}
-
-static void bone_align_to_bone(EditBone *selbone, EditBone *actbone)
-{
- float selboneaxis[3], actboneaxis[3], length;
-
- VecSubf(actboneaxis, actbone->tail, actbone->head);
- Normalize(actboneaxis);
-
- VecSubf(selboneaxis, selbone->tail, selbone->head);
- length = VecLength(selboneaxis);
-
- VecMulf(actboneaxis, length);
- VecAddf(selbone->tail, selbone->head, actboneaxis);
- selbone->roll = actbone->roll;
-
- /* if the bone being aligned has connected descendants they must be moved
- according to their parent new position, otherwise they would be left
- in an unconsistent state: connected but away from the parent*/
- fix_editbone_connected_children(selbone);
- return;
-}
-
-void align_selected_bones(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *actbone, *ebone, *selbone;
- EditBone *flipbone, *flippar;
- short allchildbones= 0, foundselbone= 0;
-
- /* find active bone to align to */
- for (actbone = G.edbo.first; actbone; actbone=actbone->next) {
- if (arm->layer & actbone->layer) {
- if (actbone->flag & BONE_ACTIVE)
- break;
- }
- }
- if (actbone == NULL) {
- error("Needs an active bone");
- return;
- }
-
- /* find selected bones */
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
- if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) {
- foundselbone++;
- if (ebone->parent != actbone) allchildbones= 1;
- }
- }
- }
- /* abort if no selected bones, and active bone doesn't have a parent to work with instead */
- if (foundselbone==0 && actbone->parent==NULL) {
- error("Need selected bone(s)");
- return;
- }
-
- if (foundselbone==0 && actbone->parent) {
- /* When only the active bone is selected, and it has a parent,
- * align it to the parent, as that is the only possible outcome.
- */
- bone_align_to_bone(actbone, actbone->parent);
-
- if (arm->flag & ARM_MIRROR_EDIT) {
- flipbone = armature_bone_get_mirrored(actbone);
- if (flipbone)
- bone_align_to_bone(flipbone, flipbone->parent);
- }
- }
- else {
- /* loop through all editbones, aligning all selected bones to the active bone */
- for (selbone = G.edbo.first; selbone; selbone=selbone->next) {
- if (arm->layer & selbone->layer) {
- if ((selbone->flag & BONE_SELECTED) && (selbone!=actbone)) {
- /* align selbone to actbone */
- bone_align_to_bone(selbone, actbone);
-
- if (arm->flag & ARM_MIRROR_EDIT) {
- /* - if there's a mirrored copy of selbone, try to find a mirrored copy of actbone
- * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R").
- * This is useful for arm-chains, for example parenting lower arm to upper arm
- * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
- * then just use actbone. Useful when doing upper arm to spine.
- */
- flipbone = armature_bone_get_mirrored(selbone);
- flippar = armature_bone_get_mirrored(actbone);
-
- if (flipbone) {
- if (flippar)
- bone_align_to_bone(flipbone, flippar);
- else
- bone_align_to_bone(flipbone, actbone);
- }
- }
- }
- }
- }
- }
-
- countall(); /* checks selection */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Align bones");
-
- return;
-}
-
-/* ***************** Pose tools ********************* */
-
-void clear_armature(Object *ob, char mode)
-{
- bPoseChannel *pchan;
- bArmature *arm;
-
- arm= get_armature(ob);
- if (arm == NULL)
- return;
-
- /* only clear those channels that are not locked */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone && (pchan->bone->flag & BONE_SELECTED)) {
- if (arm->layer & pchan->bone->layer) {
- switch (mode) {
- case 'r':
- if (pchan->protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ)) {
- float eul[3], oldeul[3], quat1[4];
-
- QUATCOPY(quat1, pchan->quat);
- QuatToEul(pchan->quat, oldeul);
- eul[0]= eul[1]= eul[2]= 0.0f;
-
- if (pchan->protectflag & OB_LOCK_ROTX)
- eul[0]= oldeul[0];
- if (pchan->protectflag & OB_LOCK_ROTY)
- eul[1]= oldeul[1];
- if (pchan->protectflag & OB_LOCK_ROTZ)
- eul[2]= oldeul[2];
-
- EulToQuat(eul, pchan->quat);
- /* quaternions flip w sign to accumulate rotations correctly */
- if ((quat1[0]<0.0f && pchan->quat[0]>0.0f) || (quat1[0]>0.0f && pchan->quat[0]<0.0f)) {
- QuatMulf(pchan->quat, -1.0f);
- }
- }
- else {
- pchan->quat[1]=pchan->quat[2]=pchan->quat[3]=0.0F;
- pchan->quat[0]=1.0F;
- }
- break;
- case 'g':
- if ((pchan->protectflag & OB_LOCK_LOCX)==0)
- pchan->loc[0]= 0.0f;
- if ((pchan->protectflag & OB_LOCK_LOCY)==0)
- pchan->loc[1]= 0.0f;
- if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
- pchan->loc[2]= 0.0f;
- break;
- case 's':
- if ((pchan->protectflag & OB_LOCK_SCALEX)==0)
- pchan->size[0]= 1.0f;
- if ((pchan->protectflag & OB_LOCK_SCALEY)==0)
- pchan->size[1]= 1.0f;
- if ((pchan->protectflag & OB_LOCK_SCALEZ)==0)
- pchan->size[2]= 1.0f;
- break;
-
- }
-
- /* the current values from IPO's may not be zero, so tag as unkeyed */
- pchan->bone->flag |= BONE_UNKEYED;
- }
- }
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- /* no update for this object, this will execute the action again */
- /* is weak... like for ipo editing which uses ctime now... */
- where_is_pose (ob);
- ob->recalc= 0;
-}
-
-/* helper for function below */
-static int clear_active_flag(Object *ob, Bone *bone, void *data)
-{
- bone->flag &= ~BONE_ACTIVE;
- return 0;
-}
-
-
-/* called from editview.c, for mode-less pose selection */
-int do_pose_selectbuffer(Base *base, unsigned int *buffer, short hits)
-{
- Object *ob= base->object;
- Bone *nearBone;
-
- if (!ob || !ob->pose) return 0;
-
- nearBone= get_bone_from_selectbuffer(base, buffer, hits, 1);
-
- if (nearBone) {
- bArmature *arm= ob->data;
-
- /* since we do unified select, we don't shift+select a bone if the armature object was not active yet */
- if (!(G.qual & LR_SHIFTKEY) || (base != BASACT)) {
- deselectall_posearmature(ob, 0, 0);
- nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 1);
- }
- else {
- if (nearBone->flag & BONE_SELECTED) {
- /* if not active, we make it active */
- if((nearBone->flag & BONE_ACTIVE)==0) {
- bone_looper(ob, arm->bonebase.first, NULL, clear_active_flag);
- nearBone->flag |= BONE_ACTIVE;
- }
- else {
- nearBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 0);
- }
- }
- else {
- bone_looper(ob, arm->bonebase.first, NULL, clear_active_flag);
-
- nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- select_actionchannel_by_name(ob->action, nearBone->name, 1);
- }
- }
-
- /* in weightpaint we select the associated vertex group too */
- if (G.f & G_WEIGHTPAINT) {
- if (nearBone->flag & BONE_ACTIVE) {
- vertexgroup_select_by_name(OBACT, nearBone->name);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0); /* To force action/constraint ipo update */
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
-
- return nearBone!=NULL;
-}
-
-/* test==0: deselect all
- test==1: swap select (apply to all the opposite of current situation)
- test==2: only clear active tag
- test==3: swap select (no test / inverse selection status of all independently)
-*/
-void deselectall_posearmature (Object *ob, int test, int doundo)
-{
- bArmature *arm;
- bPoseChannel *pchan;
- int selectmode= 0;
-
- /* we call this from outliner too, but with OBACT set OK */
- if (ELEM(NULL, ob, ob->pose)) return;
- arm= get_armature(ob);
-
- /* Determine if we're selecting or deselecting */
- if (test==1) {
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
- if (pchan->bone->flag & BONE_SELECTED)
- break;
- }
- }
-
- if (pchan == NULL)
- selectmode= 1;
- }
- else if (test == 2)
- selectmode= 2;
-
- /* Set the flags accordingly */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
- if (test==3) {
- pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- pchan->bone->flag &= ~BONE_ACTIVE;
- }
- else {
- if (selectmode==0) pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE);
- else if (selectmode==1) pchan->bone->flag |= BONE_SELECTED;
- else pchan->bone->flag &= ~BONE_ACTIVE;
- }
- }
- }
-
- /* action editor */
- if (test == 3) {
- deselect_actionchannels(ob->action, 2); /* inverts selection */
- }
- else {
- deselect_actionchannels(ob->action, 0); /* deselects for sure */
- if (selectmode == 1)
- deselect_actionchannels(ob->action, 1); /* swaps */
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWACTION, 0);
-
- countall();
-
- if (doundo) {
- if (selectmode==1) BIF_undo_push("Select All");
- else BIF_undo_push("Deselect All");
- }
-}
-
-
-int bone_looper(Object *ob, Bone *bone, void *data,
- int (*bone_func)(Object *, Bone *, void *))
-{
- /* We want to apply the function bone_func to every bone
- * in an armature -- feed bone_looper the first bone and
- * a pointer to the bone_func and watch it go!. The int count
- * can be useful for counting bones with a certain property
- * (e.g. skinnable)
- */
- int count = 0;
-
- if (bone) {
- /* only do bone_func if the bone is non null */
- count += bone_func(ob, bone, data);
-
- /* try to execute bone_func for the first child */
- count += bone_looper(ob, bone->childbase.first, data, bone_func);
-
- /* try to execute bone_func for the next bone at this
- * depth of the recursion.
- */
- count += bone_looper(ob, bone->next, data, bone_func);
- }
-
- return count;
-}
-
-
-static int bone_skinnable(Object *ob, Bone *bone, void *datap)
-{
- /* Bones that are deforming
- * are regarded to be "skinnable" and are eligible for
- * auto-skinning.
- *
- * This function performs 2 functions:
- *
- * a) It returns 1 if the bone is skinnable.
- * If we loop over all bones with this
- * function, we can count the number of
- * skinnable bones.
- * b) If the pointer data is non null,
- * it is treated like a handle to a
- * bone pointer -- the bone pointer
- * is set to point at this bone, and
- * the pointer the handle points to
- * is incremented to point to the
- * next member of an array of pointers
- * to bones. This way we can loop using
- * this function to construct an array of
- * pointers to bones that point to all
- * skinnable bones.
- */
- Bone ***hbone;
- int a, segments;
- struct { Object *armob; void *list; int heat; } *data = datap;
-
- if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
- if (!(bone->flag & BONE_NO_DEFORM)) {
- if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
- segments = bone->segments;
- else
- segments = 1;
-
- if (data->list != NULL) {
- hbone = (Bone ***) &data->list;
-
- for (a=0; a<segments; a++) {
- **hbone = bone;
- ++*hbone;
- }
- }
- return segments;
- }
- }
- return 0;
-}
-
-static int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data)
-{
- /* This group creates a vertex group to ob that has the
- * same name as bone (provided the bone is skinnable).
- * If such a vertex group aleady exist the routine exits.
- */
- if (!(bone->flag & BONE_NO_DEFORM)) {
- if (!get_named_vertexgroup(ob,bone->name)) {
- add_defgroup_name(ob, bone->name);
- return 1;
- }
- }
- return 0;
-}
-
-static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
-{
- /* Bones that are deforming
- * are regarded to be "skinnable" and are eligible for
- * auto-skinning.
- *
- * This function performs 2 functions:
- *
- * a) If the bone is skinnable, it creates
- * a vertex group for ob that has
- * the name of the skinnable bone
- * (if one doesn't exist already).
- * b) If the pointer data is non null,
- * it is treated like a handle to a
- * bDeformGroup pointer -- the
- * bDeformGroup pointer is set to point
- * to the deform group with the bone's
- * name, and the pointer the handle
- * points to is incremented to point to the
- * next member of an array of pointers
- * to bDeformGroups. This way we can loop using
- * this function to construct an array of
- * pointers to bDeformGroups, all with names
- * of skinnable bones.
- */
- bDeformGroup ***hgroup, *defgroup;
- int a, segments;
- struct { Object *armob; void *list; int heat; } *data= datap;
-
- if (!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) {
- if (!(bone->flag & BONE_NO_DEFORM)) {
- if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
- segments = bone->segments;
- else
- segments = 1;
-
- if (!(defgroup = get_named_vertexgroup(ob, bone->name)))
- defgroup = add_defgroup_name(ob, bone->name);
-
- if (data->list != NULL) {
- hgroup = (bDeformGroup ***) &data->list;
-
- for (a=0; a<segments; a++) {
- **hgroup = defgroup;
- ++*hgroup;
- }
- }
- return segments;
- }
- }
- return 0;
-}
-
-static void add_vgroups__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- /* DerivedMesh mapFunc for getting final coords in weight paint mode */
-
- float (*verts)[3] = userData;
- VECCOPY(verts[index], co);
-}
-
-static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], int numbones, Bone **bonelist, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected, float scale)
-{
- /* Create vertex group weights from envelopes */
-
- Bone *bone;
- bDeformGroup *dgroup;
- float distance;
- int i, iflip, j;
-
- /* for each vertex in the mesh */
- for (i=0; i < mesh->totvert; i++) {
- iflip = (dgroupflip)? mesh_get_x_mirror_vert(ob, i): 0;
-
- /* for each skinnable bone */
- for (j=0; j < numbones; ++j) {
- if (!selected[j])
- continue;
-
- bone = bonelist[j];
- dgroup = dgrouplist[j];
-
- /* store the distance-factor from the vertex to the bone */
- distance = distfactor_to_bone (verts[i], root[j], tip[j],
- bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale);
-
- /* add the vert to the deform group if weight!=0.0 */
- if (distance!=0.0)
- add_vert_to_defgroup (ob, dgroup, i, distance, WEIGHT_REPLACE);
- else
- remove_vert_defgroup (ob, dgroup, i);
-
- /* do same for mirror */
- if (dgroupflip && dgroupflip[j] && iflip >= 0) {
- if (distance!=0.0)
- add_vert_to_defgroup (ob, dgroupflip[j], iflip, distance,
- WEIGHT_REPLACE);
- else
- remove_vert_defgroup (ob, dgroupflip[j], iflip);
- }
- }
- }
-}
-
-void add_verts_to_dgroups(Object *ob, Object *par, int heat, int mirror)
-{
- /* This functions implements the automatic computation of vertex group
- * weights, either through envelopes or using a heat equilibrium.
- *
- * This function can be called both when parenting a mesh to an armature,
- * or in weightpaint + posemode. In the latter case selection is taken
- * into account and vertex weights can be mirrored.
- *
- * The mesh vertex positions used are either the final deformed coords
- * from the derivedmesh in weightpaint mode, the final subsurf coords
- * when parenting, or simply the original mesh coords.
- */
-
- bArmature *arm;
- Bone **bonelist, *bone;
- bDeformGroup **dgrouplist, **dgroupflip;
- bDeformGroup *dgroup, *curdg;
- bPoseChannel *pchan;
- Mesh *mesh;
- Mat4 *bbone = NULL;
- float (*root)[3], (*tip)[3], (*verts)[3];
- int *selected;
- int numbones, vertsfilled = 0, i, j, segments = 0;
- int wpmode = (G.f & G_WEIGHTPAINT);
- struct { Object *armob; void *list; int heat; } looper_data;
-
- /* If the parent object is not an armature exit */
- arm = get_armature(par);
- if (!arm)
- return;
-
- looper_data.armob = par;
- looper_data.heat= heat;
- looper_data.list= NULL;
-
- /* count the number of skinnable bones */
- numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
-
- if (numbones == 0)
- return;
-
- /* create an array of pointer to bones that are skinnable
- * and fill it with all of the skinnable bones */
- bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist");
- looper_data.list= bonelist;
- bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
-
- /* create an array of pointers to the deform groups that
- * coorespond to the skinnable bones (creating them
- * as necessary. */
- dgrouplist = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgrouplist");
- dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip");
-
- looper_data.list= dgrouplist;
- bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable);
-
- /* create an array of root and tip positions transformed into
- * global coords */
- root = MEM_callocN(numbones*sizeof(float)*3, "root");
- tip = MEM_callocN(numbones*sizeof(float)*3, "tip");
- selected = MEM_callocN(numbones*sizeof(int), "selected");
-
- for (j=0; j < numbones; ++j) {
- bone = bonelist[j];
- dgroup = dgrouplist[j];
-
- /* handle bbone */
- if (heat) {
- if (segments == 0) {
- segments = 1;
- bbone = NULL;
-
- if ((par->pose) && (pchan=get_pose_channel(par->pose, bone->name))) {
- if (bone->segments > 1) {
- segments = bone->segments;
- bbone = b_bone_spline_setup(pchan, 1);
- }
- }
- }
-
- segments--;
- }
-
- /* compute root and tip */
- if (bbone) {
- VECCOPY(root[j], bbone[segments].mat[3]);
- Mat4MulVecfl(bone->arm_mat, root[j]);
- if ((segments+1) < bone->segments) {
- VECCOPY(tip[j], bbone[segments+1].mat[3])
- Mat4MulVecfl(bone->arm_mat, tip[j]);
- }
- else
- VECCOPY(tip[j], bone->arm_tail)
- }
- else {
- VECCOPY(root[j], bone->arm_head);
- VECCOPY(tip[j], bone->arm_tail);
- }
-
- Mat4MulVecfl(par->obmat, root[j]);
- Mat4MulVecfl(par->obmat, tip[j]);
-
- /* set selected */
- if (wpmode) {
- if ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED))
- selected[j] = 1;
- }
- else
- selected[j] = 1;
-
- /* find flipped group */
- if (mirror) {
- char name[32];
-
- BLI_strncpy(name, dgroup->name, 32);
- // 0 = don't strip off number extensions
- bone_flip_name(name, 0);
-
- for (curdg = ob->defbase.first; curdg; curdg=curdg->next) {
- if (!strcmp(curdg->name, name))
- break;
- }
-
- dgroupflip[j] = curdg;
- }
- }
-
- /* create verts */
- mesh = (Mesh*)ob->data;
- verts = MEM_callocN(mesh->totvert*sizeof(*verts), "closestboneverts");
-
- if (wpmode) {
- /* if in weight paint mode, use final verts from derivedmesh */
- DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
-
- if (dm->foreachMappedVert) {
- dm->foreachMappedVert(dm, add_vgroups__mapFunc, (void*)verts);
- vertsfilled = 1;
- }
-
- dm->release(dm);
- }
- else if (modifiers_findByType(ob, eModifierType_Subsurf)) {
- /* is subsurf on? Lets use the verts on the limit surface then.
- * = same amount of vertices as mesh, but vertices moved to the
- * subsurfed position, like for 'optimal'. */
- subsurf_calculate_limit_positions(mesh, verts);
- vertsfilled = 1;
- }
-
- /* transform verts to global space */
- for (i=0; i < mesh->totvert; i++) {
- if (!vertsfilled)
- VECCOPY(verts[i], mesh->mvert[i].co)
- Mat4MulVecfl(ob->obmat, verts[i]);
- }
-
- /* compute the weights based on gathered vertices and bones */
- if (heat) {
- heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip,
- root, tip, selected);
- }
- else {
- envelope_bone_weighting(ob, mesh, verts, numbones, bonelist, dgrouplist,
- dgroupflip, root, tip, selected, Mat4ToScalef(par->obmat));
- }
-
- /* free the memory allocated */
- MEM_freeN(bonelist);
- MEM_freeN(dgrouplist);
- MEM_freeN(dgroupflip);
- MEM_freeN(root);
- MEM_freeN(tip);
- MEM_freeN(selected);
- MEM_freeN(verts);
-}
-
-void create_vgroups_from_armature(Object *ob, Object *par)
-{
- /* Lets try to create some vertex groups
- * based on the bones of the parent armature.
- */
-
- bArmature *arm;
- short mode;
-
- /* If the parent object is not an armature exit */
- arm = get_armature(par);
- if (!arm)
- return;
-
- /* Prompt the user on whether/how they want the vertex groups
- * added to the child mesh */
- mode= pupmenu("Create Vertex Groups? %t|"
- "Don't Create Groups %x1|"
- "Name Groups %x2|"
- "Create From Envelopes %x3|"
- "Create From Bone Heat %x4|");
- switch (mode) {
- case 2:
- /* Traverse the bone list, trying to create empty vertex
- * groups cooresponding to the bone.
- */
- bone_looper(ob, arm->bonebase.first, NULL,
- add_defgroup_unique_bone);
- if (ob->type == OB_MESH)
- create_dverts(ob->data);
-
- break;
-
- case 3:
- case 4:
- /* Traverse the bone list, trying to create vertex groups
- * that are populated with the vertices for which the
- * bone is closest.
- */
- add_verts_to_dgroups(ob, par, (mode == 4), 0);
- break;
- }
-}
-
-static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr)
-{
- bArmature *arm= ob->data;
-
- if (arm->layer & bone->layer) {
- if (bone->flag & BONE_SELECTED) {
- bone->flag |= BONE_HIDDEN_P;
- bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE);
- }
- }
- return 0;
-}
-
-/* active object is armature */
-void hide_selected_pose_bones(void)
-{
- bArmature *arm= OBACT->data;
-
- if (!arm)
- return;
-
- bone_looper(OBACT, arm->bonebase.first, NULL,
- hide_selected_pose_bone);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- BIF_undo_push("Hide Bones");
-}
-
-static int hide_unselected_pose_bone(Object *ob, Bone *bone, void *ptr)
-{
- bArmature *arm= ob->data;
-
- if (arm->layer & bone->layer) {
- // hrm... typo here?
- if (~bone->flag & BONE_SELECTED) {
- bone->flag |= BONE_HIDDEN_P;
- bone->flag &= ~BONE_ACTIVE;
- }
- }
- return 0;
-}
-
-/* active object is armature */
-void hide_unselected_pose_bones(void)
-{
- bArmature *arm;
-
- arm=get_armature(OBACT);
-
- if (!arm)
- return;
-
- bone_looper(OBACT, arm->bonebase.first, NULL,
- hide_unselected_pose_bone);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- BIF_undo_push("Hide Unselected Bone");
-}
-
-static int show_pose_bone(Object *ob, Bone *bone, void *ptr)
-{
- bArmature *arm= ob->data;
-
- if (arm->layer & bone->layer) {
- if (bone->flag & BONE_HIDDEN_P) {
- bone->flag &= ~BONE_HIDDEN_P;
- bone->flag |= BONE_SELECTED;
- }
- }
-
- return 0;
-}
-
-/* active object is armature in posemode */
-void show_all_pose_bones(void)
-{
- bArmature *arm;
-
- arm=get_armature(OBACT);
-
- if (!arm)
- return;
-
- bone_looper(OBACT, arm->bonebase.first, NULL,
- show_pose_bone);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- BIF_undo_push("Reveal Bones");
-}
-
-
-/* ************* RENAMING DISASTERS ************ */
-
-/* note: there's a unique_editbone_name() too! */
-void unique_bone_name (bArmature *arm, char *name)
-{
- char tempname[64];
- int number;
- char *dot;
-
- if (get_named_bone(arm, name)) {
-
- /* Strip off the suffix, if it's a number */
- number= strlen(name);
- if(number && isdigit(name[number-1])) {
- dot= strrchr(name, '.'); // last occurrance
- if (dot)
- *dot=0;
- }
-
- for (number = 1; number <=999; number++) {
- sprintf (tempname, "%s.%03d", name, number);
- if (!get_named_bone(arm, tempname)) {
- BLI_strncpy (name, tempname, 32);
- return;
- }
- }
- }
-}
-
-#define MAXBONENAME 32
-/* helper call for armature_bone_rename */
-static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldname, char *newname)
-{
- bConstraint *curcon;
- bConstraintTarget *ct;
-
- for (curcon = conlist->first; curcon; curcon=curcon->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon);
- ListBase targets = {NULL, NULL};
-
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(curcon, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if (ct->tar == ob) {
- if (!strcmp(ct->subtarget, oldname) )
- BLI_strncpy(ct->subtarget, newname, MAXBONENAME);
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(curcon, &targets, 0);
- }
- }
-}
-
-/* called by UI for renaming a bone */
-/* warning: make sure the original bone was not renamed yet! */
-/* seems messy, but thats what you get with not using pointers but channel names :) */
-void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
-{
- Object *ob;
- Ipo *ipo;
- char newname[MAXBONENAME];
- char oldname[MAXBONENAME];
-
- /* names better differ! */
- if(strncmp(oldnamep, newnamep, MAXBONENAME)) {
-
- /* we alter newname string... so make copy */
- BLI_strncpy(newname, newnamep, MAXBONENAME);
- /* we use oldname for search... so make copy */
- BLI_strncpy(oldname, oldnamep, MAXBONENAME);
-
- /* now check if we're in editmode, we need to find the unique name */
- if ((G.obedit) && (G.obedit->data==arm)) {
- EditBone *eBone;
-
- eBone= editbone_name_exists(&G.edbo, oldname);
- if (eBone) {
- unique_editbone_name(&G.edbo, newname);
- BLI_strncpy(eBone->name, newname, MAXBONENAME);
- }
- else return;
- }
- else {
- Bone *bone= get_named_bone(arm, oldname);
-
- if (bone) {
- unique_bone_name (arm, newname);
- BLI_strncpy(bone->name, newname, MAXBONENAME);
- }
- else return;
- }
-
- /* do entire dbase - objects */
- for (ob= G.main->object.first; ob; ob= ob->id.next) {
- /* we have the object using the armature */
- if (arm==ob->data) {
- Object *cob;
- bAction *act;
- bActionChannel *achan;
- bActionStrip *strip;
-
- /* Rename action channel if necessary */
- act = ob->action;
- if (act && !act->id.lib) {
- /* Find the appropriate channel */
- achan= get_action_channel(act, oldname);
- if (achan)
- BLI_strncpy(achan->name, newname, MAXBONENAME);
- }
-
- /* Rename the pose channel, if it exists */
- if (ob->pose) {
- bPoseChannel *pchan = get_pose_channel(ob->pose, oldname);
- if (pchan)
- BLI_strncpy(pchan->name, newname, MAXBONENAME);
- }
-
- /* check all nla-strips too */
- for (strip= ob->nlastrips.first; strip; strip= strip->next) {
- /* Rename action channel if necessary */
- act = strip->act;
- if (act && !act->id.lib) {
- /* Find the appropriate channel */
- achan= get_action_channel(act, oldname);
- if (achan)
- BLI_strncpy(achan->name, newname, MAXBONENAME);
- }
- }
-
- /* Update any object constraints to use the new bone name */
- for (cob= G.main->object.first; cob; cob= cob->id.next) {
- if (cob->constraints.first)
- constraint_bone_name_fix(ob, &cob->constraints, oldname, newname);
- if (cob->pose) {
- bPoseChannel *pchan;
- for (pchan = cob->pose->chanbase.first; pchan; pchan=pchan->next) {
- constraint_bone_name_fix(ob, &pchan->constraints, oldname, newname);
- }
- }
- }
- }
-
- /* See if an object is parented to this armature */
- if (ob->parent && (ob->parent->data == arm)) {
- if (ob->partype==PARBONE) {
- /* bone name in object */
- if (!strcmp(ob->parsubstr, oldname))
- BLI_strncpy(ob->parsubstr, newname, MAXBONENAME);
- }
- }
-
- if (modifiers_usesArmature(ob, arm)) {
- bDeformGroup *dg;
- /* bone name in defgroup */
- for (dg=ob->defbase.first; dg; dg=dg->next) {
- if (!strcmp(dg->name, oldname))
- BLI_strncpy(dg->name, newname, MAXBONENAME);
- }
- }
- }
-
- /* do entire db - ipo's for the drivers */
- for (ipo= G.main->ipo.first; ipo; ipo= ipo->id.next) {
- IpoCurve *icu;
-
- /* check each curve's driver */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- IpoDriver *icd= icu->driver;
-
- if ((icd) && (icd->ob)) {
- ob= icd->ob;
-
- if (icu->driver->type == IPO_DRIVER_TYPE_NORMAL) {
- if (!strcmp(oldname, icd->name))
- BLI_strncpy(icd->name, newname, MAXBONENAME);
- }
- else {
- /* TODO: pydrivers need to be treated differently */
- }
- }
- }
- }
- }
-}
-
-/* context editmode object */
-void armature_flip_names(void)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
- char newname[32];
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
- if (ebone->flag & BONE_SELECTED) {
- BLI_strncpy(newname, ebone->name, sizeof(newname));
- bone_flip_name(newname, 1); // 1 = do strip off number extensions
- armature_bone_rename(G.obedit->data, ebone->name, newname);
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Flip names");
-}
-
-/* context: edtimode armature */
-void armature_autoside_names(short axis)
-{
- bArmature *arm= G.obedit->data;
- EditBone *ebone;
- char newname[32];
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer) {
- if (ebone->flag & BONE_SELECTED) {
- BLI_strncpy(newname, ebone->name, sizeof(newname));
- bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]);
- armature_bone_rename(G.obedit->data, ebone->name, newname);
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Auto-side name");
-}
-
-/* context: editmode armature */
-EditBone *armature_bone_get_mirrored(EditBone *ebo)
-{
- EditBone *eboflip= NULL;
- char name[32];
-
- BLI_strncpy(name, ebo->name, sizeof(name));
- bone_flip_name(name, 0); // 0 = don't strip off number extensions
-
- for (eboflip=G.edbo.first; eboflip; eboflip=eboflip->next) {
- if (ebo != eboflip) {
- if (!strcmp (name, eboflip->name))
- break;
- }
- }
-
- return eboflip;
-}
-
-/* if editbone (partial) selected, copy data */
-/* context; editmode armature, with mirror editing enabled */
-void transform_armature_mirror_update(void)
-{
- EditBone *ebo, *eboflip;
-
- for (ebo=G.edbo.first; ebo; ebo=ebo->next) {
- /* no layer check, correct mirror is more important */
- if (ebo->flag & (BONE_TIPSEL|BONE_ROOTSEL)) {
- eboflip= armature_bone_get_mirrored(ebo);
-
- if (eboflip) {
- /* we assume X-axis flipping for now */
- if (ebo->flag & BONE_TIPSEL) {
- EditBone *children;
-
- eboflip->tail[0]= -ebo->tail[0];
- eboflip->tail[1]= ebo->tail[1];
- eboflip->tail[2]= ebo->tail[2];
- eboflip->rad_tail= ebo->rad_tail;
-
- /* Also move connected children, in case children's name aren't mirrored properly */
- for (children=G.edbo.first; children; children=children->next) {
- if (children->parent == eboflip && children->flag & BONE_CONNECTED) {
- VECCOPY(children->head, eboflip->tail);
- children->rad_head = ebo->rad_tail;
- }
- }
- }
- if (ebo->flag & BONE_ROOTSEL) {
- eboflip->head[0]= -ebo->head[0];
- eboflip->head[1]= ebo->head[1];
- eboflip->head[2]= ebo->head[2];
- eboflip->rad_head= ebo->rad_head;
-
- /* Also move connected parent, in case parent's name isn't mirrored properly */
- if (eboflip->parent && eboflip->flag & BONE_CONNECTED)
- {
- EditBone *parent = eboflip->parent;
- VECCOPY(parent->tail, eboflip->head);
- parent->rad_tail = ebo->rad_head;
- }
- }
- if (ebo->flag & BONE_SELECTED) {
- eboflip->dist= ebo->dist;
- eboflip->roll= -ebo->roll;
- eboflip->xwidth= ebo->xwidth;
- eboflip->zwidth= ebo->zwidth;
- }
- }
- }
- }
-}
-
-
-/*****************************************************************************************************/
-/*************************************** SKELETON GENERATOR ******************************************/
-/*****************************************************************************************************/
-
-
-
-/**************************************** SUBDIVISION ALGOS ******************************************/
-
-EditBone * subdivideByAngle(ReebArc *arc, ReebNode *head, ReebNode *tail)
-{
- EditBone *lastBone = NULL;
- if (G.scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE)
- {
- ReebArcIterator iter;
- EmbedBucket *current = NULL;
- EmbedBucket *previous = NULL;
- EditBone *child = NULL;
- EditBone *parent = NULL;
- EditBone *root = NULL;
- float angleLimit = (float)cos(G.scene->toolsettings->skgen_angle_limit * M_PI / 180.0f);
-
- parent = add_editbone("Bone");
- parent->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- VECCOPY(parent->head, head->p);
-
- root = parent;
-
- for (initArcIterator(&iter, arc, head), previous = nextBucket(&iter), current = nextBucket(&iter);
- current;
- previous = current, current = nextBucket(&iter))
- {
- float vec1[3], vec2[3];
- float len1, len2;
-
- VecSubf(vec1, previous->p, parent->head);
- VecSubf(vec2, current->p, previous->p);
-
- len1 = Normalize(vec1);
- len2 = Normalize(vec2);
-
- if (len1 > 0.0f && len2 > 0.0f && Inpf(vec1, vec2) < angleLimit)
- {
- VECCOPY(parent->tail, previous->p);
-
- child = add_editbone("Bone");
- VECCOPY(child->head, parent->tail);
- child->parent = parent;
- child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
-
- parent = child; /* new child is next parent */
- }
- }
- VECCOPY(parent->tail, tail->p);
-
- /* If the bone wasn't subdivided, delete it and return NULL
- * to let subsequent subdivision methods do their thing.
- * */
- if (parent == root)
- {
- delete_bone(parent);
- parent = NULL;
- }
-
- lastBone = parent; /* set last bone in the chain */
- }
-
- return lastBone;
-}
-
-float calcVariance(ReebArc *arc, int start, int end, float v0[3], float n[3])
-{
- int len = 2 + abs(end - start);
-
- if (len > 2)
- {
- ReebArcIterator iter;
- EmbedBucket *bucket = NULL;
- float avg_t = 0.0f;
- float s_t = 0.0f;
- float s_xyz = 0.0f;
-
- /* First pass, calculate average */
- for (initArcIterator2(&iter, arc, start, end), bucket = nextBucket(&iter);
- bucket;
- bucket = nextBucket(&iter))
- {
- float v[3];
-
- VecSubf(v, bucket->p, v0);
- avg_t += Inpf(v, n);
- }
-
- avg_t /= Inpf(n, n);
- avg_t += 1.0f; /* adding start (0) and end (1) values */
- avg_t /= len;
-
- /* Second pass, calculate s_xyz and s_t */
- for (initArcIterator2(&iter, arc, start, end), bucket = nextBucket(&iter);
- bucket;
- bucket = nextBucket(&iter))
- {
- float v[3], d[3];
- float dt;
-
- VecSubf(v, bucket->p, v0);
- Projf(d, v, n);
- VecSubf(v, v, d);
-
- dt = VecLength(d) - avg_t;
-
- s_t += dt * dt;
- s_xyz += Inpf(v, v);
- }
-
- /* adding start(0) and end(1) values to s_t */
- s_t += (avg_t * avg_t) + (1 - avg_t) * (1 - avg_t);
-
- return s_xyz / s_t;
- }
- else
- {
- return 0;
- }
-}
-
-float calcDistance(ReebArc *arc, int start, int end, float head[3], float tail[3])
-{
- ReebArcIterator iter;
- EmbedBucket *bucket = NULL;
- float max_dist = 0;
-
- /* calculate maximum distance */
- for (initArcIterator2(&iter, arc, start, end), bucket = nextBucket(&iter);
- bucket;
- bucket = nextBucket(&iter))
- {
- float v1[3], v2[3], c[3];
- float dist;
-
- VecSubf(v1, head, tail);
- VecSubf(v2, bucket->p, tail);
-
- Crossf(c, v1, v2);
-
- dist = Inpf(c, c) / Inpf(v1, v1);
-
- max_dist = dist > max_dist ? dist : max_dist;
- }
-
-
- return max_dist;
-}
-
-EditBone * subdivideByCorrelation(ReebArc *arc, ReebNode *head, ReebNode *tail)
-{
- ReebArcIterator iter;
- float n[3];
- float ADAPTIVE_THRESHOLD = G.scene->toolsettings->skgen_correlation_limit;
- EditBone *lastBone = NULL;
-
- /* init iterator to get start and end from head */
- initArcIterator(&iter, arc, head);
-
- /* Calculate overall */
- VecSubf(n, arc->buckets[iter.end].p, head->p);
-
- if (G.scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION)
- {
- EmbedBucket *bucket = NULL;
- EmbedBucket *previous = NULL;
- EditBone *child = NULL;
- EditBone *parent = NULL;
- float normal[3] = {0, 0, 0};
- float avg_normal[3];
- int total = 0;
- int boneStart = iter.start;
-
- parent = add_editbone("Bone");
- parent->flag = BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- VECCOPY(parent->head, head->p);
-
- for (previous = nextBucket(&iter), bucket = nextBucket(&iter);
- bucket;
- previous = bucket, bucket = nextBucket(&iter))
- {
- float btail[3];
- float value = 0;
-
- if (G.scene->toolsettings->skgen_options & SKGEN_STICK_TO_EMBEDDING)
- {
- VECCOPY(btail, bucket->p);
- }
- else
- {
- float length;
-
- /* Calculate normal */
- VecSubf(n, bucket->p, parent->head);
- length = Normalize(n);
-
- total += 1;
- VecAddf(normal, normal, n);
- VECCOPY(avg_normal, normal);
- VecMulf(avg_normal, 1.0f / total);
-
- VECCOPY(btail, avg_normal);
- VecMulf(btail, length);
- VecAddf(btail, btail, parent->head);
- }
-
- if (G.scene->toolsettings->skgen_options & SKGEN_ADAPTIVE_DISTANCE)
- {
- value = calcDistance(arc, boneStart, iter.index, parent->head, btail);
- }
- else
- {
- float n[3];
-
- VecSubf(n, btail, parent->head);
- value = calcVariance(arc, boneStart, iter.index, parent->head, n);
- }
-
- if (value > ADAPTIVE_THRESHOLD)
- {
- VECCOPY(parent->tail, btail);
-
- child = add_editbone("Bone");
- VECCOPY(child->head, parent->tail);
- child->parent = parent;
- child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
-
- parent = child; // new child is next parent
- boneStart = iter.index; // start from end
-
- normal[0] = normal[1] = normal[2] = 0;
- total = 0;
- }
- }
-
- VECCOPY(parent->tail, tail->p);
-
- lastBone = parent; /* set last bone in the chain */
- }
-
- return lastBone;
-}
-
-float arcLengthRatio(ReebArc *arc)
-{
- float arcLength = 0.0f;
- float embedLength = 0.0f;
- int i;
-
- arcLength = VecLenf(arc->head->p, arc->tail->p);
-
- if (arc->bcount > 0)
- {
- /* Add the embedding */
- for ( i = 1; i < arc->bcount; i++)
- {
- embedLength += VecLenf(arc->buckets[i - 1].p, arc->buckets[i].p);
- }
- /* Add head and tail -> embedding vectors */
- embedLength += VecLenf(arc->head->p, arc->buckets[0].p);
- embedLength += VecLenf(arc->tail->p, arc->buckets[arc->bcount - 1].p);
- }
- else
- {
- embedLength = arcLength;
- }
-
- return embedLength / arcLength;
-}
-
-EditBone * subdivideByLength(ReebArc *arc, ReebNode *head, ReebNode *tail)
-{
- EditBone *lastBone = NULL;
- if ((G.scene->toolsettings->skgen_options & SKGEN_CUT_LENGTH) &&
- arcLengthRatio(arc) >= G.scene->toolsettings->skgen_length_ratio)
- {
- ReebArcIterator iter;
- EmbedBucket *bucket = NULL;
- EmbedBucket *previous = NULL;
- EditBone *child = NULL;
- EditBone *parent = NULL;
- float lengthLimit = G.scene->toolsettings->skgen_length_limit;
- int same = 0;
-
- parent = add_editbone("Bone");
- parent->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- VECCOPY(parent->head, head->p);
-
- initArcIterator(&iter, arc, head);
-
- bucket = nextBucket(&iter);
-
- while (bucket != NULL)
- {
- float *vec0 = NULL;
- float *vec1 = bucket->p;
-
- /* first bucket. Previous is head */
- if (previous == NULL)
- {
- vec0 = head->p;
- }
- /* Previous is a valid bucket */
- else
- {
- vec0 = previous->p;
- }
-
- /* If lengthLimit hits the current segment */
- if (VecLenf(vec1, parent->head) > lengthLimit)
- {
- if (same == 0)
- {
- float dv[3], off[3];
- float a, b, c, f;
-
- /* Solve quadratic distance equation */
- VecSubf(dv, vec1, vec0);
- a = Inpf(dv, dv);
-
- VecSubf(off, vec0, parent->head);
- b = 2 * Inpf(dv, off);
-
- c = Inpf(off, off) - (lengthLimit * lengthLimit);
-
- f = (-b + (float)sqrt(b * b - 4 * a * c)) / (2 * a);
-
- //printf("a %f, b %f, c %f, f %f\n", a, b, c, f);
-
- if (isnan(f) == 0 && f < 1.0f)
- {
- VECCOPY(parent->tail, dv);
- VecMulf(parent->tail, f);
- VecAddf(parent->tail, parent->tail, vec0);
- }
- else
- {
- VECCOPY(parent->tail, vec1);
- }
- }
- else
- {
- float dv[3];
-
- VecSubf(dv, vec1, vec0);
- Normalize(dv);
-
- VECCOPY(parent->tail, dv);
- VecMulf(parent->tail, lengthLimit);
- VecAddf(parent->tail, parent->tail, parent->head);
- }
-
- child = add_editbone("Bone");
- VECCOPY(child->head, parent->tail);
- child->parent = parent;
- child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
-
- parent = child; // new child is next parent
-
- same = 1; // mark as same
- }
- else
- {
- previous = bucket;
- bucket = nextBucket(&iter);
- same = 0; // Reset same
- }
- }
- VECCOPY(parent->tail, tail->p);
-
- lastBone = parent; /* set last bone in the chain */
- }
-
- return lastBone;
-}
-
-/***************************************** MAIN ALGORITHM ********************************************/
-
-void generateSkeletonFromReebGraph(ReebGraph *rg)
-{
- GHash *arcBoneMap = NULL;
- ReebArc *arc = NULL;
- ReebNode *node = NULL;
- Object *src = NULL;
- Object *dst = NULL;
-
- src = BASACT->object;
-
- if (G.obedit != NULL)
- {
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo
- }
-
- dst = add_object(OB_ARMATURE);
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
-
- /* Copy orientation from source */
- VECCOPY(dst->loc, src->obmat[3]);
- Mat4ToEul(src->obmat, dst->rot);
- Mat4ToSize(src->obmat, dst->size);
-
- where_is_object(G.obedit);
-
- make_editArmature();
-
- arcBoneMap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
-
- BLI_markdownSymmetry((BGraph*)rg, rg->nodes.first, G.scene->toolsettings->skgen_symmetry_limit);
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- EditBone *lastBone = NULL;
- ReebNode *head, *tail;
- int i;
-
- /* Find out the direction of the arc through simple heuristics (in order of priority) :
- *
- * 1- Arcs on primary symmetry axis (symmetry == 1) point up (head: high weight -> tail: low weight)
- * 2- Arcs starting on a primary axis point away from it (head: node on primary axis)
- * 3- Arcs point down (head: low weight -> tail: high weight)
- *
- * Finally, the arc direction is stored in its flag: 1 (low -> high), -1 (high -> low)
- */
-
- /* if arc is a symmetry axis, internal bones go up the tree */
- if (arc->symmetry_level == 1 && arc->tail->degree != 1)
- {
- head = arc->tail;
- tail = arc->head;
-
- arc->flag = -1; /* mark arc direction */
- }
- /* Bones point AWAY from the symmetry axis */
- else if (arc->head->symmetry_level == 1)
- {
- head = arc->head;
- tail = arc->tail;
-
- arc->flag = 1; /* mark arc direction */
- }
- else if (arc->tail->symmetry_level == 1)
- {
- head = arc->tail;
- tail = arc->head;
-
- arc->flag = -1; /* mark arc direction */
- }
- /* otherwise, always go from low weight to high weight */
- else
- {
- head = arc->head;
- tail = arc->tail;
-
- arc->flag = 1; /* mark arc direction */
- }
-
- /* Loop over subdivision methods */
- for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++)
- {
- switch(G.scene->toolsettings->skgen_subdivisions[i])
- {
- case SKGEN_SUB_LENGTH:
- lastBone = subdivideByLength(arc, head, tail);
- break;
- case SKGEN_SUB_ANGLE:
- lastBone = subdivideByAngle(arc, head, tail);
- break;
- case SKGEN_SUB_CORRELATION:
- lastBone = subdivideByCorrelation(arc, head, tail);
- break;
- }
- }
-
- if (lastBone == NULL)
- {
- EditBone *bone;
- bone = add_editbone("Bone");
- bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
-
- VECCOPY(bone->head, head->p);
- VECCOPY(bone->tail, tail->p);
-
- /* set first and last bone, since there's only one */
- lastBone = bone;
- }
-
- BLI_ghash_insert(arcBoneMap, arc, lastBone);
- }
-
- /* Second pass, setup parent relationship between arcs */
- for (node = rg->nodes.first; node; node = node->next)
- {
- ReebArc *incomingArc = NULL;
- int i;
-
- for (i = 0; i < node->degree; i++)
- {
- arc = (ReebArc*)node->arcs[i];
-
- /* if arc is incoming into the node */
- if ((arc->head == node && arc->flag == -1) || (arc->tail == node && arc->flag == 1))
- {
- if (incomingArc == NULL)
- {
- incomingArc = arc;
- /* loop further to make sure there's only one incoming arc */
- }
- else
- {
- /* skip this node if more than one incomingArc */
- incomingArc = NULL;
- break; /* No need to look further, we are skipping already */
- }
- }
- }
-
- if (incomingArc != NULL)
- {
- EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc);
-
- /* Look for outgoing arcs and parent their bones */
- for (i = 0; i < node->degree; i++)
- {
- arc = node->arcs[i];
-
- /* if arc is outgoing from the node */
- if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1))
- {
- EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc);
-
- /* find the root bone */
- while(childBone->parent != NULL)
- {
- childBone = childBone->parent;
- }
-
- childBone->parent = parentBone;
- childBone->flag |= BONE_CONNECTED;
- }
- }
- }
- }
-
- BLI_ghash_free(arcBoneMap, NULL, NULL);
-
- BIF_undo_push("Generate Skeleton");
-}
-
-void generateSkeleton(void)
-{
- ReebGraph *reebg;
-
- setcursor_space(SPACE_VIEW3D, CURSOR_WAIT);
-
- reebg = BIF_ReebGraphFromEditMesh();
-
- generateSkeletonFromReebGraph(reebg);
-
- REEB_freeGraph(reebg);
-
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
-}
diff --git a/source/blender/src/editconstraint.c b/source/blender/src/editconstraint.c
deleted file mode 100644
index 42972e4aa5d..00000000000
--- a/source/blender/src/editconstraint.c
+++ /dev/null
@@ -1,990 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_dynstr.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_text_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_ipo.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editconstraint.h"
-#include "BIF_poseobject.h"
-#include "BIF_interface.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "blendef.h"
-#include "nla.h"
-#include "mydevice.h"
-
-/* -------------- Get Active Constraint Data ---------------------- */
-
-ListBase *get_active_constraint_channels (Object *ob, int forcevalid)
-{
- char ipstr[64];
-
- if (ob == NULL)
- return NULL;
-
- /* See if we are a bone constraint */
- if (ob->flag & OB_POSEMODE) {
- bActionChannel *achan;
- bPoseChannel *pchan;
-
- pchan = get_active_posechannel(ob);
- if (pchan) {
- /* Make sure we have an action */
- if (ob->action == NULL) {
- if (forcevalid == 0)
- return NULL;
-
- ob->action= add_empty_action("Action");
- }
-
- /* Make sure we have an actionchannel */
- achan = get_action_channel(ob->action, pchan->name);
- if (achan == NULL) {
- if (forcevalid == 0)
- return NULL;
-
- achan = MEM_callocN (sizeof(bActionChannel), "ActionChannel");
-
- strcpy(achan->name, pchan->name);
- sprintf(ipstr, "%s.%s", ob->action->id.name+2, achan->name);
- ipstr[23]=0;
- achan->ipo= add_ipo(ipstr, ID_AC);
-
- BLI_addtail(&ob->action->chanbase, achan);
- }
-
- return &achan->constraintChannels;
- }
- else
- return NULL;
- }
- /* else we return object constraints */
- else {
- if (ob->ipoflag & OB_ACTION_OB) {
- bActionChannel *achan = get_action_channel(ob->action, "Object");
- if (achan)
- return &achan->constraintChannels;
- else
- return NULL;
- }
-
- return &ob->constraintChannels;
- }
-}
-
-
-/* if object in posemode, active bone constraints, else object constraints */
-ListBase *get_active_constraints (Object *ob)
-{
- if (ob == NULL)
- return NULL;
-
- if (ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan;
-
- pchan = get_active_posechannel(ob);
- if (pchan)
- return &pchan->constraints;
- }
- else
- return &ob->constraints;
-
- return NULL;
-}
-
-/* single constraint */
-bConstraint *get_active_constraint (Object *ob)
-{
- ListBase *lb= get_active_constraints(ob);
-
- if (lb) {
- bConstraint *con;
-
- for (con= lb->first; con; con=con->next) {
- if (con->flag & CONSTRAINT_ACTIVE)
- return con;
- }
- }
-
- return NULL;
-}
-
-/* single channel, for ipo */
-bConstraintChannel *get_active_constraint_channel (Object *ob)
-{
- bConstraint *con;
- bConstraintChannel *chan;
-
- if (ob->flag & OB_POSEMODE) {
- if (ob->action) {
- bPoseChannel *pchan;
-
- pchan = get_active_posechannel(ob);
- if (pchan) {
- for (con= pchan->constraints.first; con; con= con->next) {
- if (con->flag & CONSTRAINT_ACTIVE)
- break;
- }
-
- if (con) {
- bActionChannel *achan = get_action_channel(ob->action, pchan->name);
- if (achan) {
- for (chan= achan->constraintChannels.first; chan; chan= chan->next) {
- if (!strcmp(chan->name, con->name))
- break;
- }
- return chan;
- }
- }
- }
- }
- }
- else {
- for (con= ob->constraints.first; con; con= con->next) {
- if (con->flag & CONSTRAINT_ACTIVE)
- break;
- }
-
- if (con) {
- ListBase *lb= get_active_constraint_channels(ob, 0);
-
- if (lb) {
- for (chan= lb->first; chan; chan= chan->next) {
- if (!strcmp(chan->name, con->name))
- break;
- }
-
- return chan;
- }
- }
- }
-
- return NULL;
-}
-
-/* -------------- Constraint Management (Add New, Remove, Rename) -------------------- */
-
-/* Creates a new constraint, initialises its data, and returns it */
-bConstraint *add_new_constraint (short type)
-{
- bConstraint *con;
- bConstraintTypeInfo *cti;
-
- con = MEM_callocN(sizeof(bConstraint), "Constraint");
-
- /* Set up a generic constraint datablock */
- con->type = type;
- con->flag |= CONSTRAINT_EXPAND;
- con->enforce = 1.0F;
- strcpy(con->name, "Const");
-
- /* Load the data for it */
- cti = constraint_get_typeinfo(con);
- if (cti) {
- con->data = MEM_callocN(cti->size, cti->structName);
-
- /* only constraints that change any settings need this */
- if (cti->new_data)
- cti->new_data(con->data);
- }
-
- return con;
-}
-
-/* Adds the given constraint to the Object-level set of constraints for the given Object */
-void add_constraint_to_object (bConstraint *con, Object *ob)
-{
- ListBase *list;
- list = &ob->constraints;
-
- if (list) {
- unique_constraint_name(con, list);
- BLI_addtail(list, con);
-
- if (proxylocked_constraints_owner(ob, NULL))
- con->flag |= CONSTRAINT_PROXY_LOCAL;
-
- con->flag |= CONSTRAINT_ACTIVE;
- for (con= con->prev; con; con= con->prev)
- con->flag &= ~CONSTRAINT_ACTIVE;
- }
-}
-
-/* helper function for add_constriant - sets the last target for the active constraint */
-static void set_constraint_nth_target (bConstraint *con, Object *target, char subtarget[], int index)
-{
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
- int num_targets, i;
-
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
- num_targets= BLI_countlist(&targets);
-
- if (index < 0) {
- if (abs(index) < num_targets)
- index= num_targets - abs(index);
- else
- index= num_targets - 1;
- }
- else if (index >= num_targets) {
- index= num_targets - 1;
- }
-
- for (ct=targets.first, i=0; ct; ct= ct->next, i++) {
- if (i == index) {
- ct->tar= target;
- strcpy(ct->subtarget, subtarget);
- break;
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 0);
- }
-}
-
-/* context: active object in posemode, active channel, optional selected channel */
-void add_constraint (short only_IK)
-{
- Object *ob= OBACT, *obsel=NULL;
- bPoseChannel *pchanact=NULL, *pchansel=NULL;
- bConstraint *con=NULL;
- Base *base;
- short nr;
-
- /* paranoia checks */
- if ((ob==NULL) || (ob==G.obedit))
- return;
-
- if ((ob->pose) && (ob->flag & OB_POSEMODE)) {
- bArmature *arm= ob->data;
-
- /* find active channel */
- pchanact= get_active_posechannel(ob);
- if (pchanact==NULL)
- return;
-
- /* find selected bone */
- for (pchansel=ob->pose->chanbase.first; pchansel; pchansel=pchansel->next) {
- if (pchansel != pchanact) {
- if (pchansel->bone->flag & BONE_SELECTED) {
- if (pchansel->bone->layer & arm->layer)
- break;
- }
- }
- }
- }
-
- /* find selected object */
- for (base= FIRSTBASE; base; base= base->next) {
- if ((TESTBASE(base)) && (base->object!=ob))
- obsel= base->object;
- }
-
- /* the only_IK caller has checked for posemode! */
- if (only_IK) {
- for (con= pchanact->constraints.first; con; con= con->next) {
- if (con->type==CONSTRAINT_TYPE_KINEMATIC) break;
- }
- if (con) {
- error("Pose Channel already has IK");
- return;
- }
-
- if (pchansel)
- nr= pupmenu("Add IK Constraint%t|To Active Bone%x10");
- else if (obsel)
- nr= pupmenu("Add IK Constraint%t|To Active Object%x10");
- else
- nr= pupmenu("Add IK Constraint%t|To New Empty Object%x10|Without Target%x11");
- }
- else {
- if (pchanact) {
- if (pchansel)
- nr= pupmenu("Add Constraint to Active Bone%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18");
- else if ((obsel) && (obsel->type==OB_CURVE))
- nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17|Stretch To%x7|%l|Action%x16|Script%x18");
- else if (obsel)
- nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18");
- else
- nr= pupmenu("Add Constraint to New Empty Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18");
- }
- else {
- if ((obsel) && (obsel->type==OB_CURVE))
- nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17|%l|Action%x16|Script%x18");
- else if (obsel)
- nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|%l|Action%x16|Script%x18");
- else
- nr= pupmenu("Add Constraint to New Empty Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Limit Distance%x21|%l|Track To%x3|Floor%x4|Locked Track%x5|%l|Action%x16|Script%x18");
- }
- }
-
- if (nr < 1) return;
-
- /* handle IK separate */
- if (nr==10 || nr==11) {
- /* ik - prevent weird chains... */
- if (pchansel) {
- bPoseChannel *pchan= pchanact;
- while (pchan) {
- if (pchan==pchansel) break;
- pchan= pchan->parent;
- }
- if (pchan) {
- error("IK root cannot be linked to IK tip");
- return;
- }
-
- pchan= pchansel;
- while (pchan) {
- if (pchan==pchanact) break;
- pchan= pchan->parent;
- }
- if (pchan) {
- error("IK tip cannot be linked to IK root");
- return;
- }
- }
-
- con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC);
- BLI_addtail(&pchanact->constraints, con);
- unique_constraint_name(con, &pchanact->constraints);
- pchanact->constflag |= PCHAN_HAS_IK; /* for draw, but also for detecting while pose solving */
- if (nr==11)
- pchanact->constflag |= PCHAN_HAS_TARGET;
- if (proxylocked_constraints_owner(ob, pchanact))
- con->flag |= CONSTRAINT_PROXY_LOCAL;
- }
- else {
- /* normal constraints - add data */
- if (nr==1) con = add_new_constraint(CONSTRAINT_TYPE_LOCLIKE);
- else if (nr==2) con = add_new_constraint(CONSTRAINT_TYPE_ROTLIKE);
- else if (nr==3) con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO);
- else if (nr==4) con = add_new_constraint(CONSTRAINT_TYPE_MINMAX);
- else if (nr==5) con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK);
- else if (nr==6) {
- Curve *cu= obsel->data;
- cu->flag |= CU_PATH;
- con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH);
- }
- else if (nr==7) con = add_new_constraint(CONSTRAINT_TYPE_STRETCHTO);
- else if (nr==8) con = add_new_constraint(CONSTRAINT_TYPE_SIZELIKE);
- else if (nr==13) con = add_new_constraint(CONSTRAINT_TYPE_LOCLIMIT);
- else if (nr==14) con = add_new_constraint(CONSTRAINT_TYPE_ROTLIMIT);
- else if (nr==15) con = add_new_constraint(CONSTRAINT_TYPE_SIZELIMIT);
- else if (nr==16) {
- /* TODO: add a popup-menu to display list of available actions to use (like for pyconstraints) */
- con = add_new_constraint(CONSTRAINT_TYPE_ACTION);
- }
- else if (nr==17) {
- Curve *cu= obsel->data;
- cu->flag |= CU_PATH;
- con = add_new_constraint(CONSTRAINT_TYPE_CLAMPTO);
- }
- else if (nr==18) {
- char *menustr;
- int scriptint= 0;
-#ifndef DISABLE_PYTHON
- /* popup a list of usable scripts */
- menustr = buildmenu_pyconstraints(NULL, &scriptint);
- scriptint = pupmenu(menustr);
- MEM_freeN(menustr);
-
- /* only add constraint if a script was chosen */
- if (scriptint) {
- /* add constraint */
- con = add_new_constraint(CONSTRAINT_TYPE_PYTHON);
- validate_pyconstraint_cb(con->data, &scriptint);
-
- /* make sure target allowance is set correctly */
- BPY_pyconstraint_update(ob, con);
- }
-#endif
- }
- else if (nr==19) {
- con = add_new_constraint(CONSTRAINT_TYPE_CHILDOF);
-
- /* if this constraint is being added to a posechannel, make sure
- * the constraint gets evaluated in pose-space
- */
- if (pchanact) {
- con->ownspace = CONSTRAINT_SPACE_POSE;
- con->flag |= CONSTRAINT_SPACEONCE;
- }
- }
- else if (nr==20) con = add_new_constraint(CONSTRAINT_TYPE_TRANSFORM);
- else if (nr==21) con = add_new_constraint(CONSTRAINT_TYPE_DISTLIMIT);
-
- if (con==NULL) return; /* paranoia */
-
- if (pchanact) {
- BLI_addtail(&pchanact->constraints, con);
- unique_constraint_name(con, &pchanact->constraints);
- pchanact->constflag |= PCHAN_HAS_CONST; /* for draw */
- if (proxylocked_constraints_owner(ob, pchanact))
- con->flag |= CONSTRAINT_PROXY_LOCAL;
- }
- else {
- BLI_addtail(&ob->constraints, con);
- unique_constraint_name(con, &ob->constraints);
- if (proxylocked_constraints_owner(ob, NULL))
- con->flag |= CONSTRAINT_PROXY_LOCAL;
- }
- }
-
- /* set the target */
- if (pchansel) {
- set_constraint_nth_target(con, ob, pchansel->name, 0);
- }
- else if (obsel) {
- set_constraint_nth_target(con, obsel, "", 0);
- }
- else if (ELEM4(nr, 11, 13, 14, 15)==0) { /* add new empty as target */
- Base *base= BASACT, *newbase;
- Object *obt;
-
- obt= add_object(OB_EMPTY);
- /* set layers OK */
- newbase= BASACT;
- newbase->lay= base->lay;
- obt->lay= newbase->lay;
-
- /* transform cent to global coords for loc */
- if (pchanact) {
- if (only_IK)
- VecMat4MulVecfl(obt->loc, ob->obmat, pchanact->pose_tail);
- else
- VecMat4MulVecfl(obt->loc, ob->obmat, pchanact->pose_head);
- }
- else
- VECCOPY(obt->loc, ob->obmat[3]);
-
- set_constraint_nth_target(con, obt, "", 0);
-
- /* restore, add_object sets active */
- BASACT= base;
- base->flag |= SELECT;
- }
-
- /* active flag */
- con->flag |= CONSTRAINT_ACTIVE;
- for (con= con->prev; con; con= con->prev)
- con->flag &= ~CONSTRAINT_ACTIVE;
-
- DAG_scene_sort(G.scene); // sort order of objects
-
- if (pchanact) {
- ob->pose->flag |= POSE_RECALC; // sort pose channels
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
- }
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); // and all its relations
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
-
- if (only_IK)
- BIF_undo_push("Add IK Constraint");
- else
- BIF_undo_push("Add Constraint");
-
-}
-
-/* Remove all constraints from the active object */
-void ob_clear_constraints (void)
-{
- Object *ob= OBACT;
-
- /* paranoia checks */
- if ((ob==NULL) || (ob==G.obedit) || (ob->flag & OB_POSEMODE))
- return;
-
- /* get user permission */
- if (okee("Clear Constraints")==0)
- return;
-
- /* do freeing */
- free_constraints(&ob->constraints);
-
- /* do updates */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Clear Constraint(s)");
-}
-
-/* Rename the given constraint
- * - con already has the new name
- */
-void rename_constraint (Object *ob, bConstraint *con, char *oldname)
-{
- bConstraint *tcon;
- bConstraintChannel *conchan;
- ListBase *conlist= NULL;
- int from_object= 0;
- char *channame="";
-
- /* get context by searching for con (primitive...) */
- for (tcon= ob->constraints.first; tcon; tcon= tcon->next) {
- if (tcon==con)
- break;
- }
-
- if (tcon) {
- conlist= &ob->constraints;
- channame= "Object";
- from_object= 1;
- }
- else if (ob->pose) {
- bPoseChannel *pchan;
-
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- for (tcon= pchan->constraints.first; tcon; tcon= tcon->next) {
- if (tcon==con)
- break;
- }
- if (tcon)
- break;
- }
-
- if (tcon) {
- conlist= &pchan->constraints;
- channame= pchan->name;
- }
- }
-
- if (conlist==NULL) {
- printf("rename constraint failed\n"); /* should not happen in UI */
- return;
- }
-
- /* first make sure it's a unique name within context */
- unique_constraint_name (con, conlist);
-
- /* own channels */
- if (from_object) {
- for (conchan= ob->constraintChannels.first; conchan; conchan= conchan->next) {
- if ( strcmp(oldname, conchan->name)==0 )
- BLI_strncpy(conchan->name, con->name, sizeof(conchan->name));
- }
- }
-
- /* own action */
- if (ob->action) {
- bActionChannel *achan= get_action_channel(ob->action, channame);
- if (achan) {
- conchan= get_constraint_channel(&achan->constraintChannels, oldname);
- if (conchan)
- BLI_strncpy(conchan->name, con->name, sizeof(conchan->name));
- }
- }
-}
-
-
-/* ------------- Constraint Sanity Testing ------------------- */
-
-/* checks validity of object pointers, and NULLs,
- * if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag
- */
-static void test_constraints (Object *owner, const char substring[])
-{
- bConstraint *curcon;
- ListBase *conlist= NULL;
- int type;
-
- if (owner==NULL) return;
-
- /* Check parents */
- if (strlen(substring)) {
- switch (owner->type) {
- case OB_ARMATURE:
- type = CONSTRAINT_OBTYPE_BONE;
- break;
- default:
- type = CONSTRAINT_OBTYPE_OBJECT;
- break;
- }
- }
- else
- type = CONSTRAINT_OBTYPE_OBJECT;
-
- /* Get the constraint list for this object */
- switch (type) {
- case CONSTRAINT_OBTYPE_OBJECT:
- conlist = &owner->constraints;
- break;
- case CONSTRAINT_OBTYPE_BONE:
- {
- Bone *bone;
- bPoseChannel *chan;
-
- bone = get_named_bone( ((bArmature *)owner->data), substring );
- chan = get_pose_channel(owner->pose, substring);
- if (bone && chan) {
- conlist = &chan->constraints;
- }
- }
- break;
- }
-
- /* Check all constraints - is constraint valid? */
- if (conlist) {
- for (curcon = conlist->first; curcon; curcon=curcon->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- /* clear disabled-flag first */
- curcon->flag &= ~CONSTRAINT_DISABLE;
-
-#ifndef DISABLE_PYTHON
- /* Check specialised data (settings) for constraints that need this */
- if (curcon->type == CONSTRAINT_TYPE_PYTHON) {
- bPythonConstraint *data = curcon->data;
-
- /* is there are valid script? */
- if (data->text == NULL) {
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (BPY_is_pyconstraint(data->text)==0) {
- curcon->flag |= CONSTRAINT_DISABLE;
- } else {
- /* does the constraint require target input... also validates targets */
- BPY_pyconstraint_update(owner, curcon);
- }
- /* targets have already been checked for this */
- continue;
- }
- else
-#endif
- if (curcon->type == CONSTRAINT_TYPE_KINEMATIC) {
- bKinematicConstraint *data = curcon->data;
-
- /* bad: we need a separate set of checks here as poletarget is
- * optional... otherwise poletarget must exist too or else
- * the constraint is deemed invalid
- */
- if (exist_object(data->tar) == 0) {
- data->tar = NULL;
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (data->tar == owner) {
- if (!get_named_bone(get_armature(owner), data->subtarget)) {
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- }
-
- if (data->poletar) {
- if (exist_object(data->poletar) == 0) {
- data->poletar = NULL;
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (data->poletar == owner) {
- if (!get_named_bone(get_armature(owner), data->polesubtarget)) {
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- }
- }
-
- /* targets have already been checked for this */
- continue;
- }
- else if (curcon->type == CONSTRAINT_TYPE_ACTION) {
- bActionConstraint *data = curcon->data;
-
- /* validate action */
- if (data->act == NULL)
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (curcon->type == CONSTRAINT_TYPE_FOLLOWPATH) {
- bFollowPathConstraint *data = curcon->data;
-
- /* don't allow track/up axes to be the same */
- if (data->upflag==data->trackflag)
- curcon->flag |= CONSTRAINT_DISABLE;
- if (data->upflag+3==data->trackflag)
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
- bTrackToConstraint *data = curcon->data;
-
- /* don't allow track/up axes to be the same */
- if (data->reserved2==data->reserved1)
- curcon->flag |= CONSTRAINT_DISABLE;
- if (data->reserved2+3==data->reserved1)
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (curcon->type == CONSTRAINT_TYPE_LOCKTRACK) {
- bLockTrackConstraint *data = curcon->data;
-
- if (data->lockflag==data->trackflag)
- curcon->flag |= CONSTRAINT_DISABLE;
- if (data->lockflag+3==data->trackflag)
- curcon->flag |= CONSTRAINT_DISABLE;
- }
-
- /* Check targets for constraints */
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(curcon, &targets);
-
- /* disable and clear constraints targets that are incorrect */
- for (ct= targets.first; ct; ct= ct->next) {
- /* general validity checks (for those constraints that need this) */
- if (exist_object(ct->tar) == 0) {
- ct->tar = NULL;
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else if (ct->tar == owner) {
- if (!get_named_bone(get_armature(owner), ct->subtarget)) {
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- }
-
- /* target checks for specific constraints */
- if (ELEM(curcon->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO)) {
- if (ct->tar) {
- if (ct->tar->type != OB_CURVE) {
- ct->tar= NULL;
- curcon->flag |= CONSTRAINT_DISABLE;
- }
- else {
- Curve *cu= ct->tar->data;
-
- /* auto-set 'Path' setting on curve so this works */
- cu->flag |= CU_PATH;
- }
- }
- }
- }
-
- /* free any temporary targets */
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(curcon, &targets, 0);
- }
- }
- }
-}
-
-static void test_bonelist_constraints (Object *owner, ListBase *list)
-{
- Bone *bone;
-
- for (bone = list->first; bone; bone = bone->next) {
- test_constraints(owner, bone->name);
- test_bonelist_constraints(owner, &bone->childbase);
- }
-}
-
-void object_test_constraints (Object *owner)
-{
- test_constraints(owner, "");
-
- if (owner->type==OB_ARMATURE) {
- bArmature *arm= get_armature(owner);
-
- if (arm)
- test_bonelist_constraints(owner, &arm->bonebase);
- }
-}
-
-/* ********************** CONSTRAINT-SPECIFIC STUFF ********************* */
-/* ------------- PyConstraints ------------------ */
-
-/* this callback sets the text-file to be used for selected menu item */
-void validate_pyconstraint_cb (void *arg1, void *arg2)
-{
- bPythonConstraint *data = arg1;
- Text *text= NULL;
- int index = *((int *)arg2);
- int i;
-
- /* exception for no script */
- if (index) {
- /* innovative use of a for...loop to search */
- for (text=G.main->text.first, i=1; text && index!=i; i++, text=text->id.next);
- }
- data->text = text;
-}
-
-#ifndef DISABLE_PYTHON
-/* this returns a string for the list of usable pyconstraint script names */
-char *buildmenu_pyconstraints (Text *con_text, int *pyconindex)
-{
- DynStr *pupds= BLI_dynstr_new();
- Text *text;
- char *str;
- char buf[64];
- int i;
-
- /* add title first */
- sprintf(buf, "Scripts: %%t|[None]%%x0|");
- BLI_dynstr_append(pupds, buf);
-
- /* init active-index first */
- if (con_text == NULL)
- *pyconindex= 0;
-
- /* loop through markers, adding them */
- for (text=G.main->text.first, i=1; text; i++, text=text->id.next) {
- /* this is important to ensure that right script is shown as active */
- if (text == con_text) *pyconindex = i;
-
- /* only include valid pyconstraint scripts */
- if (BPY_is_pyconstraint(text)) {
- BLI_dynstr_append(pupds, text->id.name+2);
-
- sprintf(buf, "%%x%d", i);
- BLI_dynstr_append(pupds, buf);
-
- if (text->id.next)
- BLI_dynstr_append(pupds, "|");
- }
- }
-
- /* convert to normal MEM_malloc'd string */
- str= BLI_dynstr_get_cstring(pupds);
- BLI_dynstr_free(pupds);
-
- return str;
-}
-#endif /* DISABLE_PYTHON */
-
-/* this callback gets called when the 'refresh' button of a pyconstraint gets pressed */
-void update_pyconstraint_cb (void *arg1, void *arg2)
-{
- Object *owner= (Object *)arg1;
- bConstraint *con= (bConstraint *)arg2;
-#ifndef DISABLE_PYTHON
- if (owner && con)
- BPY_pyconstraint_update(owner, con);
-#endif
-}
-
-/* ------------- Child-Of Constraint ------------------ */
-
-/* ChildOf Constraint - set inverse callback */
-void childof_const_setinv (void *conv, void *unused)
-{
- bConstraint *con= (bConstraint *)conv;
- bChildOfConstraint *data= (bChildOfConstraint *)con->data;
- Object *ob= OBACT;
- bPoseChannel *pchan= NULL;
-
- /* try to find a pose channel */
- if (ob && ob->pose)
- pchan= get_active_posechannel(ob);
-
- /* calculate/set inverse matrix */
- if (pchan) {
- float pmat[4][4], cinf;
- float imat[4][4], tmat[4][4];
-
- /* make copy of pchan's original pose-mat (for use later) */
- Mat4CpyMat4(pmat, pchan->pose_mat);
-
- /* disable constraint for pose to be solved without it */
- cinf= con->enforce;
- con->enforce= 0.0f;
-
- /* solve pose without constraint */
- where_is_pose(ob);
-
- /* determine effect of constraint by removing the newly calculated
- * pchan->pose_mat from the original pchan->pose_mat, thus determining
- * the effect of the constraint
- */
- Mat4Invert(imat, pchan->pose_mat);
- Mat4MulMat4(tmat, imat, pmat);
- Mat4Invert(data->invmat, tmat);
-
- /* recalculate pose with new inv-mat */
- con->enforce= cinf;
- where_is_pose(ob);
- }
- else if (ob) {
- /* use what_does_parent to find inverse - just like for normal parenting.
- * NOTE: what_does_parent uses a static workob defined in object.c
- */
- what_does_parent(ob);
- Mat4Invert(data->invmat, workob.obmat);
- }
- else
- Mat4One(data->invmat);
-}
-
-/* ChildOf Constraint - clear inverse callback */
-void childof_const_clearinv (void *conv, void *unused)
-{
- bConstraint *con= (bConstraint *)conv;
- bChildOfConstraint *data= (bChildOfConstraint *)con->data;
-
- /* simply clear the matrix */
- Mat4One(data->invmat);
-}
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c
deleted file mode 100644
index c26c44103c0..00000000000
--- a/source/blender/src/editcurve.c
+++ /dev/null
@@ -1,4722 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include <stdlib.h>
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_dynstr.h"
-#include "BLI_rand.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_library.h"
-#include "BKE_ipo.h"
-#include "BKE_depsgraph.h"
-#include "BKE_curve.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_main.h"
-#include "BKE_key.h"
-
-#include "BIF_editmode_undo.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_editkey.h"
-#include "BIF_mywindow.h"
-#include "BIF_interface.h"
-#include "BIF_transform.h"
-#include "BIF_retopo.h"
-
-#include "BSE_view.h" /* For persp... */
-#include "BSE_edit.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_editobject.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "BDR_editcurve.h"
-/* still need to eradicate a few :( */
-#define callocstructN(x,y,name) (x*)MEM_callocN((y)* sizeof(x),name)
-
-
-ListBase editNurb;
-BPoint *lastselbp;
-int actnu; /* for selected */
-
-
-/* void freeNurblist(ListBase *lb); already declared in the kernel */
-
-float nurbcircle[8][2]= {
- {0.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {-1.0, 1.0},
- {0.0, 1.0}, { 1.0, 1.0}, { 1.0, 0.0}, { 1.0, -1.0}
-};
-
-
-/* this replaces the active flag used in uv/face mode */
-void set_actNurb(Nurb *nu)
-{
- if (nu==NULL) {
- actnu = -1;
- } else {
- actnu = BLI_findindex(&editNurb, nu);
- }
-}
-
-Nurb * get_actNurb( void )
-{
- return BLI_findlink(&editNurb, actnu);
-}
-
-
-/* ******************* SELECTION FUNCTIONS ********************* */
-
-/* returns 1 in case (de)selection was successful */
-static short select_beztriple(BezTriple *bezt, short selstatus, short flag, short hidden)
-{
- if(bezt) {
- if((bezt->hide==0) || (hidden==1)) {
- if(selstatus==1) { /* selects */
- bezt->f1 |= flag;
- bezt->f2 |= flag;
- bezt->f3 |= flag;
- return 1;
- }
- else { /* deselects */
- bezt->f1 &= ~flag;
- bezt->f2 &= ~flag;
- bezt->f3 &= ~flag;
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-/* returns 1 in case (de)selection was successful */
-static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden)
-{
- if(bp) {
- if((bp->hide==0) || (hidden==1)) {
- if(selstatus==1) {
- bp->f1 |= flag;
- return 1;
- }
- else {
- bp->f1 &= ~flag;
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-static short swap_selection_beztriple(BezTriple *bezt)
-{
- if(bezt->f2 & SELECT)
- return select_beztriple(bezt, DESELECT, 1, VISIBLE);
- else
- return select_beztriple(bezt, SELECT, 1, VISIBLE);
-}
-
-static short swap_selection_bpoint(BPoint *bp)
-{
- if(bp->f1 & SELECT)
- return select_bpoint(bp, DESELECT, 1, VISIBLE);
- else
- return select_bpoint(bp, SELECT, 1, VISIBLE);
-}
-
-short isNurbsel(Nurb *nu)
-{
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if( (bp->f1 & SELECT) ) return 1;
- bp++;
- }
- }
- return 0;
-}
-
-int isNurbsel_count(Nurb *nu)
-{
- BezTriple *bezt;
- BPoint *bp;
- int a, sel=0;
-
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if (BEZSELECTED_HIDDENHANDLES(bezt)) sel++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if( (bp->f1 & SELECT) ) sel++;
- bp++;
- }
- }
- return sel;
-}
-
-/* ******************* PRINTS ********************* */
-
-void printknots()
-{
- Nurb *nu;
- int a, num;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(isNurbsel(nu) && (nu->type & 7)==CU_NURBS) {
- if(nu->knotsu) {
- num= KNOTSU(nu);
- for(a=0;a<num;a++) printf("knotu %d: %f\n", a, nu->knotsu[a]);
- }
- if(nu->knotsv) {
- num= KNOTSV(nu);
- for(a=0;a<num;a++) printf("knotv %d: %f\n", a, nu->knotsv[a]);
- }
- }
- }
-}
-
-#if 0
-static void printweightsNurb__doPrint(void *userData, Nurb *nurb, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
-{
- char str[30];
-
- if (bp && (bp->f1 & SELECT)) {
- sprintf(str,"%2.2f", bp->vec[3]);
-
- cpack(0x737373);
- glRasterPos2i(x-1, y-1);
- BMF_DrawString(G.font, str);
-
- glRasterPos2i(x+1, y+1);
- BMF_DrawString(G.font, str);
-
- cpack(0xFFFFFF);
- glRasterPos2i(x, y);
- BMF_DrawString(G.font, str);
- }
-}
-static void printweightsNurb(void)
-{
- if(G.obedit==0) return;
-
- persp(PERSP_WIN);
-
- glDrawBuffer(GL_FRONT);
- nurbs_foreachScreenVert(printweightsNurb__doPrint, NULL);
- glDrawBuffer(GL_BACK);
-
- persp(PERSP_VIEW);
-}
-#endif
-
-
-/* ********************* LOAD and MAKE *************** */
-
-void load_editNurb()
-{
- /* load editNurb in object */
- Curve *cu= 0;
- Nurb *nu, *newnu;
- KeyBlock *actkey;
-
- if(G.obedit==0) return;
-
- if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
-
- G.totvert= count_curveverts(&editNurb);
-
- cu= G.obedit->data;
-
- /* are there keys? */
- actkey = ob_get_keyblock(G.obedit);
- if(actkey) {
- /* active key: the vertices */
-
- if(G.totvert) {
- if(actkey->data) MEM_freeN(actkey->data);
-
- actkey->data= MEM_callocN(cu->key->elemsize*G.totvert, "actkey->data");
- actkey->totelem= G.totvert;
-
- curve_to_key(cu, actkey, &editNurb);
- }
- }
-
- if(cu->key && actkey!=cu->key->refkey) {
- ;
- }
- else {
- freeNurblist(&(cu->nurb));
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- newnu= duplicateNurb(nu);
- BLI_addtail(&(cu->nurb), newnu);
-
- if((nu->type & 7)==CU_NURBS) {
- clamp_nurb_order_u(nu);
- }
- }
- }
-
- }
-
- set_actNurb(NULL);
-}
-
-void make_editNurb()
-{
- /* make copy of baseNurb in editNurb */
- Curve *cu=0;
- Nurb *nu, *newnu;
- KeyBlock *actkey;
-
- if(G.obedit==NULL) return;
-
- lastselbp= NULL; /* global for select row */
-
- if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- freeNurblist(&editNurb);
-
- cu= G.obedit->data;
- nu= cu->nurb.first;
-
- while(nu) {
- newnu= duplicateNurb(nu);
- test2DNurb(newnu); // after join, or any other creation of curve
- BLI_addtail(&editNurb, newnu);
- nu= nu->next;
- }
-
- actkey = ob_get_keyblock(G.obedit);
- if(actkey) {
- strcpy(G.editModeTitleExtra, "(Key) ");
- key_to_curve(actkey, cu, &editNurb);
- }
- }
- else G.obedit= NULL;
-
- countall();
- set_actNurb(NULL);
-}
-
-void remake_editNurb()
-{
-
- if(okee("Reload original data")==0) return;
-
- make_editNurb();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-
-void separate_nurb()
-{
- Nurb *nu, *nu1;
- Object *oldob;
- Base *base, *oldbase;
- Curve *cu;
- ListBase editnurbo;
-
- if( G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return;
-
- if(okee("Separate")==0) return;
-
- waitcursor(1);
-
- cu= G.obedit->data;
- if(cu->key) {
- error("Can't separate a curve with vertex keys");
- return;
- }
-
- /* we are going to trick everything as follows:
- * 1. duplicate base: this is the new one, remember old pointer
- * 2. set aside all NOT selected curves/nurbs
- * 3. load_ebaseNurb(): this will be the new base
- * 4. freelist and restore old nurbs
- */
-
- /* only edit-base selected */
- base= FIRSTBASE;
- while(base) {
- if(base->lay & G.vd->lay) {
- if(base->object==G.obedit) base->flag |= 1;
- else base->flag &= ~1;
- }
- base= base->next;
- }
-
- /* set aside: everything that is not selected */
- editnurbo.first= editnurbo.last= 0;
- nu= editNurb.first;
- while(nu) {
- nu1= nu->next;
- if(isNurbsel(nu)==0) {
- BLI_remlink(&editNurb, nu);
- BLI_addtail(&editnurbo, nu);
- }
- nu= nu1;
- }
-
- oldob= G.obedit;
- oldbase= BASACT;
-
- adduplicate(1, 0); /* no transform and zero so do get a linked dupli */
-
- G.obedit= BASACT->object; /* basact is set in adduplicate() */
-
- G.obedit->data= copy_curve(cu);
- /* because new curve is a copy: reduce user count */
- cu->id.us--;
-
- load_editNurb();
-
- BASACT->flag &= ~SELECT;
-
- if(editNurb.first) freeNurblist(&editNurb);
-
- editNurb= editnurbo;
-
- G.obedit= 0; /* displists behave different in edit mode */
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); /* this is the separated one */
- DAG_object_flush_update(G.scene, oldob, OB_RECALC_DATA); /* this is the original one */
-
- G.obedit= oldob;
- BASACT= oldbase;
- BASACT->flag |= SELECT;
-
- waitcursor(0);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- set_actNurb(NULL);
-}
-
-/* ******************* FLAGS ********************* */
-
-
-short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
-{
- /* return u!=-1: 1 row in u-direction selected. U has value between 0-pntsv
- * return v!=-1: 1 collumn in v-direction selected. V has value between 0-pntsu
- */
- BPoint *bp;
- int a, b, sel;
-
- *u= *v= -1;
-
- bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
- sel= 0;
- for(a=0; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & flag) sel++;
- }
- if(sel==nu->pntsu) {
- if(*u== -1) *u= b;
- else return 0;
- }
- else if(sel>1) return 0; /* because sel==1 is still ok */
- }
-
- for(a=0; a<nu->pntsu; a++) {
- sel= 0;
- bp= nu->bp+a;
- for(b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
- if(bp->f1 & flag) sel++;
- }
- if(sel==nu->pntsv) {
- if(*v== -1) *v= a;
- else return 0;
- }
- else if(sel>1) return 0;
- }
-
- if(*u==-1 && *v>-1) return 1;
- if(*v==-1 && *u>-1) return 1;
- return 0;
-}
-
-void setflagsNurb(short flag)
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( (nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- bezt->f1= bezt->f2= bezt->f3= flag;
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- bp->f1= flag;
- bp++;
- }
- }
- }
-}
-
-void rotateflagNurb(short flag, float *cent, float rotmat[][3])
-{
- /* all verts with (flag & 'flag') rotate */
- Nurb *nu;
- BPoint *bp;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_NURBS) {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
-
- while(a--) {
- if(bp->f1 & flag) {
- bp->vec[0]-=cent[0];
- bp->vec[1]-=cent[1];
- bp->vec[2]-=cent[2];
- Mat3MulVecfl(rotmat, bp->vec);
- bp->vec[0]+=cent[0];
- bp->vec[1]+=cent[1];
- bp->vec[2]+=cent[2];
- }
- bp++;
- }
- }
- }
-}
-
-
-void translateflagNurb(short flag, float *vec)
-{
- /* all verts with ('flag' & flag) translate */
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( (nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->f1 & flag) VecAddf(bezt->vec[0], bezt->vec[0], vec);
- if(bezt->f2 & flag) VecAddf(bezt->vec[1], bezt->vec[1], vec);
- if(bezt->f3 & flag) VecAddf(bezt->vec[2], bezt->vec[2], vec);
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->f1 & flag) VecAddf(bp->vec, bp->vec, vec);
- bp++;
- }
- }
-
- test2DNurb(nu);
- }
-}
-
-void weightflagNurb(short flag, float w, int mode) /* mode==0: replace, mode==1: multiply */
-{
- Nurb *nu;
- BPoint *bp;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_NURBS) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(bp->f1 & flag) {
- if(mode==1) bp->vec[3]*= w;
- else bp->vec[3]= w;
- }
- bp++;
- }
- }
- }
-}
-
-void deleteflagNurb(short flag)
-{
- Nurb *nu, *next;
- BPoint *bp, *bpn, *newbp;
- int a, b, newu, newv, sel;
-
- if(G.obedit && G.obedit->type==OB_SURF);
- else return;
-
- lastselbp= NULL;
-
- nu= editNurb.first;
- while(nu) {
- next= nu->next;
-
- /* is entire nurb selected */
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a) {
- a--;
- if(bp->f1 & flag);
- else break;
- bp++;
- }
- if(a==0) {
- BLI_remlink(&editNurb, nu);
- freeNurb(nu); nu=NULL;
- }
- else {
- /* is nurb in U direction selected */
- newv= nu->pntsv;
- bp= nu->bp;
- for(b=0; b<nu->pntsv; b++) {
- sel= 0;
- for(a=0; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & flag) sel++;
- }
- if(sel==nu->pntsu) {
- newv--;
- }
- else if(sel>=1) {
- /* don't delete */
- break;
- }
- }
- if(newv!=nu->pntsv && b==nu->pntsv) {
- /* delete */
- bp= nu->bp;
- bpn = newbp =
- (BPoint*) MEM_mallocN(newv * nu->pntsu * sizeof(BPoint), "deleteNurb");
- for(b=0; b<nu->pntsv; b++) {
- if((bp->f1 & flag)==0) {
- memcpy(bpn, bp, nu->pntsu*sizeof(BPoint));
- bpn+= nu->pntsu;
- }
- bp+= nu->pntsu;
- }
- nu->pntsv= newv;
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- clamp_nurb_order_v(nu);
-
- makeknots(nu, 2, nu->flagv>>1);
- }
- else {
- /* is the nurb in V direction selected */
- newu= nu->pntsu;
- for(a=0; a<nu->pntsu; a++) {
- bp= nu->bp+a;
- sel= 0;
- for(b=0; b<nu->pntsv; b++, bp+=nu->pntsu) {
- if(bp->f1 & flag) sel++;
- }
- if(sel==nu->pntsv) {
- newu--;
- }
- else if(sel>=1) {
- /* don't delete */
- break;
- }
- }
- if(newu!=nu->pntsu && a==nu->pntsu) {
- /* delete */
- bp= nu->bp;
- bpn = newbp =
- (BPoint*) MEM_mallocN(newu * nu->pntsv * sizeof(BPoint), "deleteNurb");
- for(b=0; b<nu->pntsv; b++) {
- for(a=0; a<nu->pntsu; a++, bp++) {
- if((bp->f1 & flag)==0) {
- *bpn= *bp;
- bpn++;
- }
- }
- }
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- if(newu==1 && nu->pntsv>1) { /* make a U spline */
- nu->pntsu= nu->pntsv;
- nu->pntsv= 1;
- SWAP(short, nu->orderu, nu->orderv);
- clamp_nurb_order_u(nu);
- if(nu->knotsv) MEM_freeN(nu->knotsv);
- nu->knotsv= NULL;
- }
- else {
- nu->pntsu= newu;
- clamp_nurb_order_u(nu);
- }
- makeknots(nu, 1, nu->flagu>>1);
- }
- }
- }
- nu= next;
- }
-}
-
-short extrudeflagNurb(int flag)
-{
- Nurb *nu;
- BPoint *bp, *bpn, *newbp;
- int ok= 0, a, u, v, len;
-
- if(G.obedit && G.obedit->type==OB_SURF);
- else return 0;
-
- nu= editNurb.first;
- while(nu) {
-
- if(nu->pntsv==1) {
- bp= nu->bp;
- a= nu->pntsu;
- while(a) {
- if(bp->f1 & flag);
- else break;
- bp++;
- a--;
- }
- if(a==0) {
- ok= 1;
- newbp =
- (BPoint*)MEM_mallocN(2 * nu->pntsu * sizeof(BPoint), "extrudeNurb1");
- memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint) );
- bp= newbp+ nu->pntsu;
- memcpy(bp, nu->bp, nu->pntsu*sizeof(BPoint) );
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- a= nu->pntsu;
- while(a--) {
- select_bpoint(bp, SELECT, flag, HIDDEN);
- select_bpoint(newbp, DESELECT, flag, HIDDEN);
- bp++;
- newbp++;
- }
-
- nu->pntsv= 2;
- nu->orderv= 2;
- makeknots(nu, 2, nu->flagv>>1);
- }
- }
- else {
- /* which row or collumn is selected */
-
- if( isNurbselUV(nu, &u, &v, flag) ) {
-
- /* deselect all */
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- select_bpoint(bp, DESELECT, flag, HIDDEN);
- bp++;
- }
-
- if(u==0 || u== nu->pntsv-1) { /* row in u-direction selected */
- ok= 1;
- newbp =
- (BPoint*) MEM_mallocN(nu->pntsu*(nu->pntsv + 1)
- * sizeof(BPoint), "extrudeNurb1");
- if(u==0) {
- len= nu->pntsv*nu->pntsu;
- memcpy(newbp+nu->pntsu, nu->bp, len*sizeof(BPoint) );
- memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint) );
- bp= newbp;
- }
- else {
- len= nu->pntsv*nu->pntsu;
- memcpy(newbp, nu->bp, len*sizeof(BPoint) );
- memcpy(newbp+len, nu->bp+len-nu->pntsu, nu->pntsu*sizeof(BPoint) );
- bp= newbp+len;
- }
-
- a= nu->pntsu;
- while(a--) {
- select_bpoint(bp, SELECT, flag, HIDDEN);
- bp++;
- }
-
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- nu->pntsv++;
- makeknots(nu, 2, nu->flagv>>1);
- }
- else if(v==0 || v== nu->pntsu-1) { /* collumn in v-direction selected */
- ok= 1;
- bpn = newbp =
- (BPoint*) MEM_mallocN((nu->pntsu + 1) * nu->pntsv * sizeof(BPoint), "extrudeNurb1");
- bp= nu->bp;
-
- for(a=0; a<nu->pntsv; a++) {
- if(v==0) {
- *bpn= *bp;
- bpn->f1 |= flag;
- bpn++;
- }
- memcpy(bpn, bp, nu->pntsu*sizeof(BPoint));
- bp+= nu->pntsu;
- bpn+= nu->pntsu;
- if(v== nu->pntsu-1) {
- *bpn= *(bp-1);
- bpn->f1 |= flag;
- bpn++;
- }
- }
-
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- nu->pntsu++;
- makeknots(nu, 1, nu->flagu>>1);
- }
- }
- }
- nu= nu->next;
- }
-
- return ok;
-}
-
-void adduplicateflagNurb(short flag)
-{
- Nurb *nu, *newnu;
- BezTriple *bezt, *bezt1;
- BPoint *bp, *bp1;
- int a, b, starta, enda, newu, newv;
- char *usel;
-
- nu= editNurb.last;
- while(nu) {
- if( (nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- for(a=0; a<nu->pntsu; a++) {
- enda= -1;
- starta= a;
- while( (bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag) ) {
- select_beztriple(bezt, DESELECT, flag, HIDDEN);
- enda=a;
- if(a>=nu->pntsu-1) break;
- a++;
- bezt++;
- }
- if(enda>=starta) {
- newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN");
- memcpy(newnu, nu, sizeof(Nurb));
- BLI_addtail(&editNurb, newnu);
- set_actNurb(newnu);
- newnu->pntsu= enda-starta+1;
- newnu->bezt=
- (BezTriple*)MEM_mallocN((enda - starta + 1) * sizeof(BezTriple), "adduplicateN");
- memcpy(newnu->bezt, nu->bezt+starta, newnu->pntsu*sizeof(BezTriple));
-
- b= newnu->pntsu;
- bezt1= newnu->bezt;
- while(b--) {
- select_beztriple(bezt1, SELECT, flag, HIDDEN);
- bezt1++;
- }
-
- if(nu->flagu & CU_CYCLIC) {
- if(starta!=0 || enda!=nu->pntsu-1) {
- newnu->flagu &= ~CU_CYCLIC;
- }
- }
- }
- bezt++;
- }
- }
- else if(nu->pntsv==1) { /* because UV Nurb has a different method for dupli */
- bp= nu->bp;
- for(a=0; a<nu->pntsu; a++) {
- enda= -1;
- starta= a;
- while(bp->f1 & flag) {
- select_bpoint(bp, DESELECT, flag, HIDDEN);
- enda= a;
- if(a>=nu->pntsu-1) break;
- a++;
- bp++;
- }
- if(enda>=starta) {
- newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN3");
- memcpy(newnu, nu, sizeof(Nurb));
- set_actNurb(newnu);
- BLI_addtail(&editNurb, newnu);
- newnu->pntsu= enda-starta+1;
- newnu->bp = (BPoint*)MEM_mallocN((enda-starta+1) * sizeof(BPoint), "adduplicateN4");
- memcpy(newnu->bp, nu->bp+starta, newnu->pntsu*sizeof(BPoint));
-
- b= newnu->pntsu;
- bp1= newnu->bp;
- while(b--) {
- select_bpoint(bp1, SELECT, flag, HIDDEN);
- bp1++;
- }
-
- if(nu->flagu & CU_CYCLIC) {
- if(starta!=0 || enda!=nu->pntsu-1) {
- newnu->flagu &= ~CU_CYCLIC;
- }
- }
-
- /* knots */
- newnu->knotsu= NULL;
- makeknots(newnu, 1, newnu->flagu>>1);
- }
- bp++;
- }
- }
- else {
- /* a rectangular area in nurb has to be selected */
- if(isNurbsel(nu)) {
- usel= MEM_callocN(nu->pntsu, "adduplicateN4");
- bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp++) {
- if(bp->f1 & flag) usel[b]++;
- }
- }
- newu= 0;
- newv= 0;
- for(a=0; a<nu->pntsu; a++) {
- if(usel[a]) {
- if(newv==0 || usel[a]==newv) {
- newv= usel[a];
- newu++;
- }
- else {
- newv= 0;
- break;
- }
- }
- }
- if(newu==0 || newv==0) {
- printf("Can't duplicate Nurb\n");
- }
- else {
-
- if(newu==1) SWAP(short, newu, newv);
-
- newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN5");
- memcpy(newnu, nu, sizeof(Nurb));
- BLI_addtail(&editNurb, newnu);
- set_actNurb(newnu);
- newnu->pntsu= newu;
- newnu->pntsv= newv;
- newnu->bp =
- (BPoint*)MEM_mallocN(newu * newv * sizeof(BPoint), "adduplicateN6");
- clamp_nurb_order_u(newnu);
- clamp_nurb_order_v(newnu);
-
- newnu->knotsu= newnu->knotsv= NULL;
-
- bp= newnu->bp;
- bp1= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp1++) {
- if(bp1->f1 & flag) {
- memcpy(bp, bp1, sizeof(BPoint));
- select_bpoint(bp1, DESELECT, flag, HIDDEN);
- bp++;
- }
- }
- }
- if (check_valid_nurb_u(newnu)) {
- if(nu->pntsu==newnu->pntsu && nu->knotsu) {
- newnu->knotsu= MEM_dupallocN( nu->knotsu );
- } else {
- makeknots(newnu, 1, newnu->flagu>>1);
- }
- }
- if (check_valid_nurb_v(newnu)) {
- if(nu->pntsv==newnu->pntsv && nu->knotsv) {
- newnu->knotsv= MEM_dupallocN( nu->knotsv );
- } else {
- makeknots(newnu, 2, newnu->flagv>>1);
- }
- }
- }
- MEM_freeN(usel);
- }
- }
-
- nu= nu->prev;
- }
-
- /* actnu changed */
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-
-void switchdirectionNurb2(void)
-{
- Nurb *nu;
-
- if(G.vd==0 || !(G.obedit->lay & G.vd->lay))
- return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( isNurbsel(nu) ) switchdirectionNurb(nu);
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Switch direction");
-}
-
-void switchdirection_knots(float *base, int tot)
-{
- float *fp1, *fp2, *tempf;
- int a;
-
- if(base==NULL || tot==0) return;
-
- /* reverse knots */
- a= tot;
- fp1= base;
- fp2= fp1+(a-1);
- a/= 2;
- while(fp1!=fp2 && a>0) {
- SWAP(float, *fp1, *fp2);
- a--;
- fp1++;
- fp2--;
- }
- /* and make in increasing order again */
- a= tot;
- fp1= base;
- fp2=tempf= MEM_mallocN(sizeof(float)*a, "switchdirect");
- while(a--) {
- fp2[0]= fabs(fp1[1]-fp1[0]);
- fp1++;
- fp2++;
- }
-
- a= tot-1;
- fp1= base;
- fp2= tempf;
- fp1[0]= 0.0;
- fp1++;
- while(a--) {
- fp1[0]= fp1[-1]+fp2[0];
- fp1++;
- fp2++;
- }
- MEM_freeN(tempf);
-}
-
-void setweightNurb(void)
-{
- static float weight= 1.0f;
- extern ListBase editNurb;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) {
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(nu->bezt) {
- for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT)
- bezt->weight= weight;
- }
- }
- else if(nu->bp) {
- for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
- if(bp->f1 & SELECT)
- bp->weight= weight;
- }
- }
- }
- }
- BIF_undo_push("Set Curve Weight");
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void setradiusNurb( void )
-{
- static float radius= 1.0f;
- extern ListBase editNurb;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- if(fbutton(&radius, 0.0001f, 10.0f, 10, 10, "Set Radius")) {
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(nu->bezt) {
- for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT)
- bezt->radius= radius;
- }
- }
- else if(nu->bp) {
- for(bp=nu->bp, a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
- if(bp->f1 & SELECT)
- bp->radius= radius;
- }
- }
- }
- }
- BIF_undo_push("Set Curve Radius");
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-}
-
-void smoothNurb( void )
-{
-
- extern ListBase editNurb;
- Nurb *nu;
- BezTriple *bezt, *beztOrig;
- BPoint *bp, *bpOrig;
- int a, i, change = 0;
-
- /* floats for smoothing */
- float val, newval, offset;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(nu->bezt) {
- change = 0;
- beztOrig = MEM_dupallocN( nu->bezt );
- for(bezt=nu->bezt+1, a=1; a<nu->pntsu-1; a++, bezt++) {
- if(bezt->f2 & SELECT) {
- for(i=0; i<3; i++) {
- val = bezt->vec[1][i];
- newval = ((beztOrig+(a-1))->vec[1][i] * 0.5) + ((beztOrig+(a+1))->vec[1][i] * 0.5);
- offset = (val*((1.0/6.0)*5)) + (newval*(1.0/6.0)) - val;
- /* offset handles */
- bezt->vec[1][i] += offset;
- bezt->vec[0][i] += offset;
- bezt->vec[2][i] += offset;
- }
- change = 1;
- }
- }
- MEM_freeN(beztOrig);
- if (change)
- calchandlesNurb(nu);
- } else if (nu->bp) {
- bpOrig = MEM_dupallocN( nu->bp );
- /* Same as above, keep these the same! */
- for(bp=nu->bp+1, a=1; a<nu->pntsu-1; a++, bp++) {
- if(bp->f1 & SELECT) {
- for(i=0; i<3; i++) {
- val = bp->vec[i];
- newval = ((bpOrig+(a-1))->vec[i] * 0.5) + ((bpOrig+(a+1))->vec[i] * 0.5);
- offset = (val*((1.0/6.0)*5)) + (newval*(1.0/6.0)) - val;
-
- bp->vec[i] += offset;
- }
- }
- }
- MEM_freeN(bpOrig);
- }
- }
- BIF_undo_push("Smooth Curve");
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-}
-
-/* TODO, make smoothing distance based */
-void smoothradiusNurb( void )
-{
- extern ListBase editNurb;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- /* use for smoothing */
- int last_sel;
- int start_sel, end_sel; /* selection indicies, inclusive */
- float start_rad, end_rad, fac, range;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(nu->bezt) {
-
- for (last_sel=0; last_sel < nu->pntsu; last_sel++) {
- /* loop over selection segments of a curve, smooth each */
-
- /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
- start_sel = end_sel = -1;
- for(bezt=nu->bezt+last_sel, a=last_sel; a<nu->pntsu; a++, bezt++) {
- if(bezt->f2 & SELECT) {
- start_sel = a;
- break;
- }
- }
- /* incase there are no other selected verts */
- end_sel = start_sel;
- for(bezt=nu->bezt+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bezt++) {
- if((bezt->f2 & SELECT)==0) {
- break;
- }
- end_sel = a;
- }
-
- if (start_sel == -1) {
- last_sel = nu->pntsu; /* next... */
- } else {
- last_sel = end_sel; /* before we modify it */
-
- /* now blend between start and end sel */
- start_rad = end_rad = -1.0;
-
- if (start_sel == end_sel) {
- /* simple, only 1 point selected */
- if (start_sel>0) start_rad = (nu->bezt+start_sel-1)->radius;
- if (end_sel!=-1 && end_sel < nu->pntsu) end_rad = (nu->bezt+start_sel+1)->radius;
-
- if (start_rad >= 0.0 && end_rad >= 0.0) (nu->bezt+start_sel)->radius = (start_rad + end_rad)/2;
- else if (start_rad >= 0.0) (nu->bezt+start_sel)->radius = start_rad;
- else if (end_rad >= 0.0) (nu->bezt+start_sel)->radius = end_rad;
- } else {
- /* if endpoints selected, then use them */
- if (start_sel==0) {
- start_rad = (nu->bezt+start_sel)->radius;
- start_sel++; /* we dont want to edit the selected endpoint */
- } else {
- start_rad = (nu->bezt+start_sel-1)->radius;
- }
- if (end_sel==nu->pntsu-1) {
- end_rad = (nu->bezt+end_sel)->radius;
- end_sel--; /* we dont want to edit the selected endpoint */
- } else {
- end_rad = (nu->bezt+end_sel+1)->radius;
- }
-
- /* Now Blend between the points */
- range = (float)(end_sel - start_sel) + 2.0f;
- for(bezt=nu->bezt+start_sel, a=start_sel; a<=end_sel; a++, bezt++) {
- fac = (float)(1+a-start_sel) / range;
- bezt->radius = start_rad*(1.0-fac) + end_rad*fac;
- }
- }
- }
- }
- } else if (nu->bp) {
- /* Same as above, keep these the same! */
- for (last_sel=0; last_sel < nu->pntsu; last_sel++) {
- /* loop over selection segments of a curve, smooth each */
-
- /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
- start_sel = end_sel = -1;
- for(bp=nu->bp+last_sel, a=last_sel; a<nu->pntsu; a++, bp++) {
- if(bp->f1 & SELECT) {
- start_sel = a;
- break;
- }
- }
- /* incase there are no other selected verts */
- end_sel = start_sel;
- for(bp=nu->bp+(start_sel+1), a=start_sel+1; a<nu->pntsu; a++, bp++) {
- if((bp->f1 & SELECT)==0) {
- break;
- }
- end_sel = a;
- }
-
- if (start_sel == -1) {
- last_sel = nu->pntsu; /* next... */
- } else {
- last_sel = end_sel; /* before we modify it */
-
- /* now blend between start and end sel */
- start_rad = end_rad = -1.0;
-
- if (start_sel == end_sel) {
- /* simple, only 1 point selected */
- if (start_sel>0) start_rad = (nu->bp+start_sel-1)->radius;
- if (end_sel!=-1 && end_sel < nu->pntsu) end_rad = (nu->bp+start_sel+1)->radius;
-
- if (start_rad >= 0.0 && end_rad >= 0.0) (nu->bp+start_sel)->radius = (start_rad + end_rad)/2;
- else if (start_rad >= 0.0) (nu->bp+start_sel)->radius = start_rad;
- else if (end_rad >= 0.0) (nu->bp+start_sel)->radius = end_rad;
- } else {
- /* if endpoints selected, then use them */
- if (start_sel==0) {
- start_rad = (nu->bp+start_sel)->radius;
- start_sel++; /* we dont want to edit the selected endpoint */
- } else {
- start_rad = (nu->bp+start_sel-1)->radius;
- }
- if (end_sel==nu->pntsu-1) {
- end_rad = (nu->bp+end_sel)->radius;
- end_sel--; /* we dont want to edit the selected endpoint */
- } else {
- end_rad = (nu->bp+end_sel+1)->radius;
- }
-
- /* Now Blend between the points */
- range = (float)(end_sel - start_sel) + 2.0f;
- for(bp=nu->bp+start_sel, a=start_sel; a<=end_sel; a++, bp++) {
- fac = (float)(1+a-start_sel) / range;
- bp->radius = start_rad*(1.0-fac) + end_rad*fac;
- }
- }
- }
- }
- }
- }
- BIF_undo_push("Smooth Curve Radius");
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-}
-
-
-
-/* **************** EDIT ************************ */
-
-/* next == 1 -> select next */
-/* next == -1 -> select previous */
-/* cont == 1 -> select continuously */
-/* selstatus, inverts behaviour */
-static void select_adjacent_cp(short next, short cont, short selstatus)
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
- short lastsel= 0, sel=0;
-
- if(next==0) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- lastsel=0;
- if((nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- if(next < 0) bezt= (nu->bezt + (a-1));
- while(a--) {
- if(a-abs(next) < 0) break;
- sel= 0;
- if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) {
- bezt+=next;
- if(!(bezt->f2 & SELECT) || (selstatus==0)) {
- sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
- if((sel==1) && (cont==0)) lastsel= 1;
- }
- }
- else {
- bezt+=next;
- lastsel= 0;
- }
- /* move around in zigzag way so that we go through each */
- bezt-=(next-next/abs(next));
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- if(next < 0) bp= (nu->bp + (a-1));
- while(a--) {
- if(a-abs(next) < 0) break;
- sel=0;
- if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) {
- bp+=next;
- if(!(bp->f1 & SELECT) || (selstatus==0)) {
- sel= select_bpoint(bp, selstatus, 1, VISIBLE);
- if((sel==1) && (cont==0)) lastsel= 1;
- }
- }
- else {
- bp+=next;
- lastsel= 0;
- }
- /* move around in zigzag way so that we go through each */
- bp-=(next-next/abs(next));
- }
- }
- }
-}
-
-static short nurb_has_selected_cps()
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(bezt->hide==0) {
- if((bezt->f1 & SELECT)
- || (bezt->f2 & SELECT)
- || (bezt->f3 & SELECT)) return 1;
- }
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if((bp->hide==0) && (bp->f1 & SELECT)) return 1;
- bp++;
- }
- }
- }
-
- return 0;
-}
-
-void deselectall_nurb()
-{
- if(!G.vd || !(G.obedit->lay & G.vd->lay))
- return;
-
- if(nurb_has_selected_cps()) { /* deselect all */
- selectend_nurb(FIRST, 0, DESELECT); /* set first control points as unselected */
- select_adjacent_cp(1, 1, DESELECT); /* cascade selection */
- }
- else { /* select all */
- selectend_nurb(FIRST, 0, SELECT); /* set first control points as selected */
- select_adjacent_cp(1, 1, SELECT); /* cascade selection */
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Deselect all");
-}
-
-void hideNurb(int swap)
-{
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a, sel;
-
- if(G.obedit==0) return;
-
- BIF_undo_push("Hide");
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- sel= 0;
- while(a--) {
- if(BEZSELECTED_HIDDENHANDLES(bezt)) {
- select_beztriple(bezt, DESELECT, 1, HIDDEN);
- bezt->hide= 1;
- }
- if(bezt->hide) sel++;
- bezt++;
- }
- if(sel==nu->pntsu) nu->hide= 1;
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- sel= 0;
- while(a--) {
- if(swap==0 && (bp->f1 & SELECT)) {
- select_bpoint(bp, DESELECT, 1, HIDDEN);
- bp->hide= 1;
- }
- else if(swap && (bp->f1 & SELECT)==0) {
- select_bpoint(bp, DESELECT, 1, HIDDEN);
- bp->hide= 1;
- }
- if(bp->hide) sel++;
- bp++;
- }
- if(sel==nu->pntsu*nu->pntsv) nu->hide= 1;
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-void revealNurb()
-{
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- if(G.obedit==0) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- nu->hide= 0;
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->hide) {
- select_beztriple(bezt, SELECT, 1, HIDDEN);
- bezt->hide= 0;
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->hide) {
- select_bpoint(bp, SELECT, 1, HIDDEN);
- bp->hide= 0;
- }
- bp++;
- }
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Reveal");
-
-}
-
-void selectswapNurb()
-{
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
-
- if(G.obedit==0) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->hide==0) {
- bezt->f2 ^= SELECT; /* always do the center point */
- if ((G.f & G_HIDDENHANDLES)==0) {
- bezt->f1 ^= SELECT;
- bezt->f3 ^= SELECT;
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- swap_selection_bpoint(bp);
- bp++;
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select swap");
-
-}
-
-/** Divide the line segments associated with the currently selected
- * curve nodes (Bezier or NURB). If there are no valid segment
- * selections within the current selection, nothing happens.
- *
- * @deffunc subdividenurb subdivideNurb(void)
- * @return Nothing
- * @param None
-*/
-void subdivideNurb()
-{
- Nurb *nu;
- BezTriple *prevbezt, *bezt, *beztnew, *beztn;
- BPoint *bp, *prevbp, *bpnew, *bpn;
- float vec[15];
- int a, b, sel, amount, *usel, *vsel;
-
- // printf("*** subdivideNurb: entering subdivide\n");
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- amount= 0;
- if((nu->type & 7)==CU_BEZIER) {
- /*
- Insert a point into a 2D Bezier curve.
- Endpoints are preserved. Otherwise, all selected and inserted points are
- newly created. Old points are discarded.
- */
- /* count */
- if(nu->flagu & CU_CYCLIC) {
- a= nu->pntsu;
- bezt= nu->bezt;
- prevbezt= bezt+(a-1);
- }
- else {
- a= nu->pntsu-1;
- prevbezt= nu->bezt;
- bezt= prevbezt+1;
- }
- while(a--) {
- if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) amount++;
- prevbezt= bezt;
- bezt++;
- }
-
- if(amount) {
- /* insert */
- beztnew =
- (BezTriple*)MEM_mallocN((amount + nu->pntsu) * sizeof(BezTriple), "subdivNurb");
- beztn= beztnew;
- if(nu->flagu & CU_CYCLIC) {
- a= nu->pntsu;
- bezt= nu->bezt;
- prevbezt= bezt+(a-1);
- }
- else {
- a= nu->pntsu-1;
- prevbezt= nu->bezt;
- bezt= prevbezt+1;
- }
- while(a--) {
- memcpy(beztn, prevbezt, sizeof(BezTriple));
- beztn++;
-
- if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) {
- memcpy(beztn, bezt, sizeof(BezTriple));
-
- /* midpoint subdividing */
- VecMidf(vec, prevbezt->vec[1], prevbezt->vec[2]);
- VecMidf(vec+3, prevbezt->vec[2], bezt->vec[0]);
- VecMidf(vec+6, bezt->vec[0], bezt->vec[1]);
-
- VecMidf(vec+9, vec, vec+3);
- VecMidf(vec+12, vec+3, vec+6);
-
- /* change handle of prev beztn */
- VECCOPY((beztn-1)->vec[2], vec);
- /* new point */
- VECCOPY(beztn->vec[0], vec+9);
- VecMidf(beztn->vec[1], vec+9, vec+12);
- VECCOPY(beztn->vec[2], vec+12);
- /* handle of next bezt */
- if(a==0 && (nu->flagu & CU_CYCLIC)) {VECCOPY(beztnew->vec[0], vec+6);}
- else {VECCOPY(bezt->vec[0], vec+6);}
-
- beztn->radius = (prevbezt->radius + bezt->radius)/2.0f;
- beztn->weight = (prevbezt->weight + bezt->weight)/2.0f;
-
- beztn++;
- }
-
- prevbezt= bezt;
- bezt++;
- }
- /* last point */
- if((nu->flagu & CU_CYCLIC)==0) memcpy(beztn, prevbezt, sizeof(BezTriple));
-
- MEM_freeN(nu->bezt);
- nu->bezt= beztnew;
- nu->pntsu+= amount;
-
- calchandlesNurb(nu);
- }
- } /* End of 'if((nu->type & 7)==CU_BEZIER)' */
- else if (nu->pntsv==1) {
- /*
- All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves
- are handled together with the regular NURB plane division, as it
- should be. I split it off just now, let's see if it is
- stable... nzc 30-5-'00
- */
- /* count */
- if(nu->flagu & CU_CYCLIC) {
- a= nu->pntsu;
- bp= nu->bp;
- prevbp= bp+(a-1);
- }
- else {
- a= nu->pntsu-1;
- prevbp= nu->bp;
- bp= prevbp+1;
- }
- while(a--) {
- if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount++;
- prevbp= bp;
- bp++;
- }
-
- if(amount) {
- /* insert */
- bpnew =
- (BPoint*)MEM_mallocN((amount + nu->pntsu) * sizeof(BPoint), "subdivNurb2");
- bpn= bpnew;
-
- if(nu->flagu & CU_CYCLIC) {
- a= nu->pntsu;
- bp= nu->bp;
- prevbp= bp+(a-1);
- }
- else {
- a= nu->pntsu-1;
- prevbp= nu->bp;
- bp= prevbp+1;
- }
- while(a--) {
- memcpy(bpn, prevbp, sizeof(BPoint));
- bpn++;
-
- if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) {
- // printf("*** subdivideNurb: insert 'linear' point\n");
- memcpy(bpn, bp, sizeof(BPoint));
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
-
- }
- prevbp= bp;
- bp++;
- }
- if((nu->flagu & CU_CYCLIC)==0) memcpy(bpn, prevbp, sizeof(BPoint)); /* last point */
-
- MEM_freeN(nu->bp);
- nu->bp= bpnew;
- nu->pntsu+= amount;
-
- if(nu->type & 4) {
- makeknots(nu, 1, nu->flagu>>1);
- }
- }
- } /* End of 'else if(nu->pntsv==1)' */
- else if((nu->type & 7)==CU_NURBS) {
- /* This is a very strange test ... */
- /**
- Subdivide NURB surfaces - nzc 30-5-'00 -
-
- Subdivision of a NURB curve can be effected by adding a
- control point (insertion of a knot), or by raising the
- degree of the functions used to build the NURB. The
- expression
-
- degree = #knots - #controlpoints + 1 (J Walter piece)
- degree = #knots - #controlpoints (Blender
- implementation)
- ( this is confusing.... what is true? Another concern
- is that the JW piece allows the curve to become
- explicitly 1st order derivative discontinuous, while
- this is not what we want here... )
-
- is an invariant for a single NURB curve. Raising the degree
- of the NURB is done elsewhere; the degree is assumed
- constant during this opration. Degree is a property shared
- by all controlpoints in a curve (even though it is stored
- per control point - this can be misleading).
- Adding a knot is done by searching for the place in the
- knot vector where a certain knot value must be inserted, or
- by picking an appropriate knot value between two existing
- ones. The number of controlpoints that is influenced by the
- insertion depends on the order of the curve. A certain
- minimum number of knots is needed to form high-order
- curves, as can be seen from the equation above. In Blender,
- currently NURBs may be up to 6th order, so we modify at
- most 6 points. One point is added. For an n-degree curve,
- n points are discarded, and n+1 points inserted
- (so effectively, n points are modified). (that holds for
- the JW piece, but it seems not for our NURBs)
- In practice, the knot spacing is copied, but the tail
- (the points following the insertion point) need to be
- offset to keep the knot series ascending. The knot series
- is always a series of monotonically ascending integers in
- Blender. When not enough control points are available to
- fit the order, duplicates of the endpoints are added as
- needed.
- */
- /* selection-arrays */
- usel= MEM_callocN(sizeof(int)*nu->pntsu, "subivideNurb3");
- vsel= MEM_callocN(sizeof(int)*nu->pntsv, "subivideNurb3");
- sel= 0;
-
- /* Count the number of selected points. */
- bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
- if(bp->f1 & SELECT) {
- usel[b]++;
- vsel[a]++;
- sel++;
- }
- bp++;
- }
- }
- if( sel == (nu->pntsu*nu->pntsv) ) { /* subdivide entire nurb */
- /* Global subdivision is a special case of partial
- subdivision. Strange it is considered separately... */
- bpn=bpnew= MEM_mallocN( (2*nu->pntsu-1)*(2*nu->pntsv-1)*sizeof(BPoint), "subdivideNurb4");
- bp= nu->bp;
- /* first subdivide rows */
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
- *bpn= *bp;
- bpn++;
- bp++;
- if(b<nu->pntsu-1) {
- *bpn= *bp;
- prevbp= bp-1;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
- }
- }
- bpn+= (2*nu->pntsu-1);
- }
- /* now insert new */
- bpn= bpnew+(2*nu->pntsu-1);
- bp= bpnew+(4*nu->pntsu-2);
- prevbp= bpnew;
- for(a=1; a<nu->pntsv; a++) {
-
- for(b=0; b<2*nu->pntsu-1; b++) {
- *bpn= *bp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
- bp++;
- prevbp++;
- }
- bp+= (2*nu->pntsu-1);
- bpn+= (2*nu->pntsu-1);
- prevbp+= (2*nu->pntsu-1);
- }
- MEM_freeN(nu->bp);
- nu->bp= bpnew;
- nu->pntsu= 2*nu->pntsu-1;
- nu->pntsv= 2*nu->pntsv-1;
- makeknots(nu, 1, nu->flagu>>1);
- makeknots(nu, 2, nu->flagv>>1);
- } /* End of 'if(sel== nu->pntsu*nu->pntsv)' (subdivide entire NURB) */
- else {
- /* subdivide in v direction? */
- sel= 0;
- for(a=0; a<nu->pntsv-1; a++) {
- if(vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel++;
- }
-
- if(sel) { /* V ! */
- bpn=bpnew= MEM_mallocN( (sel+nu->pntsv)*nu->pntsu*sizeof(BPoint), "subdivideNurb4");
- bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
- *bpn= *bp;
- bpn++;
- bp++;
- }
- if( (a<nu->pntsv-1) && vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu ) {
- prevbp= bp- nu->pntsu;
- for(b=0; b<nu->pntsu; b++) {
- /*
- This simple bisection must be replaces by a
- subtle resampling of a number of points. Our
- task is made slightly easier because each
- point in our curve is a separate data
- node. (is it?)
- */
- *bpn= *prevbp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
- prevbp++;
- bp++;
- }
- bp-= nu->pntsu;
- }
- }
- MEM_freeN(nu->bp);
- nu->bp= bpnew;
- nu->pntsv+= sel;
- makeknots(nu, 2, nu->flagv>>1);
- }
- else {
- /* or in u direction? */
- sel= 0;
- for(a=0; a<nu->pntsu-1; a++) {
- if(usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel++;
- }
-
- if(sel) { /* U ! */
- /* Inserting U points is sort of 'default' Flat curves only get */
- /* U points inserted in them. */
- bpn=bpnew= MEM_mallocN( (sel+nu->pntsu)*nu->pntsv*sizeof(BPoint), "subdivideNurb4");
- bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++) {
- *bpn= *bp;
- bpn++;
- bp++;
- if( (b<nu->pntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) {
- /*
- One thing that bugs me here is that the
- orders of things are not the same as in
- the JW piece. Also, this implies that we
- handle at most 3rd order curves? I miss
- some symmetry here...
- */
- prevbp= bp- 1;
- *bpn= *prevbp;
- bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0;
- bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0;
- bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0;
- bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0;
- bpn++;
- }
- }
- }
- MEM_freeN(nu->bp);
- nu->bp= bpnew;
- nu->pntsu+= sel;
- makeknots(nu, 1, nu->flagu>>1); /* shift knots
- forward */
- }
- }
- }
- MEM_freeN(usel);
- MEM_freeN(vsel);
-
- } /* End of 'if((nu->type & 7)==CU_NURBS)' */
- }
-
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Subdivide");
-
-}
-
-static void findnearestNurbvert__doClosest(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
-{
- struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; short dist, hpoint, select, mval[2]; } *data = userData;
-
- short flag;
- short temp;
-
- if (bp) {
- flag = bp->f1;
- } else {
- if (beztindex==0) {
- flag = bezt->f1;
- } else if (beztindex==1) {
- flag = bezt->f2;
- } else {
- flag = bezt->f3;
- }
- }
-
- temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
- if ((flag&1)==data->select) temp += 5;
- if (bezt && beztindex==1) temp += 3; /* middle points get a small disadvantage */
-
- if (temp<data->dist) {
- data->dist = temp;
-
- data->bp = bp;
- data->bezt = bezt;
- data->nurb = nu;
- data->hpoint = bezt?beztindex:0;
- }
-}
-
-static short findnearestNurbvert(short sel, Nurb **nurb, BezTriple **bezt, BPoint **bp)
-{
- /* sel==1: selected gets a disadvantage */
- /* in nurb and bezt or bp the nearest is written */
- /* return 0 1 2: handlepunt */
- struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; short dist, hpoint, select, mval[2]; } data = {0};
-
- data.dist = 100;
- data.hpoint = 0;
- data.select = sel;
- getmouseco_areawin(data.mval);
-
- nurbs_foreachScreenVert(findnearestNurbvert__doClosest, &data);
-
- *nurb = data.nurb;
- *bezt = data.bezt;
- *bp = data.bp;
-
- return data.hpoint;
-}
-
-
-static void findselectedNurbvert(Nurb **nu, BezTriple **bezt, BPoint **bp)
-{
- /* in nu and (bezt or bp) selected are written if there's 1 sel. */
- /* if more points selected in 1 spline: return only nu, bezt and bp are 0 */
- Nurb *nu1;
- BezTriple *bezt1;
- BPoint *bp1;
- int a;
-
- *nu= 0;
- *bezt= 0;
- *bp= 0;
- for(nu1= editNurb.first; nu1; nu1= nu1->next) {
- if((nu1->type & 7)==CU_BEZIER) {
- bezt1= nu1->bezt;
- a= nu1->pntsu;
- while(a--) {
- if( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
- if(*nu!=0 && *nu!= nu1) {
- *nu= 0;
- *bp= 0;
- *bezt= 0;
- return;
- }
- else if(*bezt || *bp) {
- *bp= 0;
- *bezt= 0;
- }
- else {
- *bezt= bezt1;
- *nu= nu1;
- }
- }
- bezt1++;
- }
- }
- else {
- bp1= nu1->bp;
- a= nu1->pntsu*nu1->pntsv;
- while(a--) {
- if( bp1->f1 & 1 ) {
- if(*nu!=0 && *nu!= nu1) {
- *bp= 0;
- *bezt= 0;
- *nu= 0;
- return;
- }
- else if(*bezt || *bp) {
- *bp= 0;
- *bezt= 0;
- }
- else {
- *bp= bp1;
- *nu= nu1;
- }
- }
- bp1++;
- }
- }
- }
-}
-
-int convertspline(short type, Nurb *nu)
-{
- BezTriple *bezt;
- BPoint *bp;
- int a, c, nr;
-
- if((nu->type & 7)==0) { /* Poly */
- if(type==CU_BEZIER) { /* to Bezier with vecthandles */
- nr= nu->pntsu;
- bezt =
- (BezTriple*)MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2");
- nu->bezt= bezt;
- a= nr;
- bp= nu->bp;
- while(a--) {
- VECCOPY(bezt->vec[1], bp->vec);
- bezt->f1=bezt->f2=bezt->f3= bp->f1;
- bezt->h1= bezt->h2= HD_VECT;
- bezt->weight= bp->weight;
- bezt->radius= bp->radius;
- bp++;
- bezt++;
- }
- MEM_freeN(nu->bp);
- nu->bp= 0;
- nu->pntsu= nr;
- nu->type &= ~7;
- nu->type |= 1;
- calchandlesNurb(nu);
- }
- else if(type==CU_NURBS) {
- nu->type &= ~7;
- nu->type+= 4;
- nu->orderu= 4;
- nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */
- nu->flagu += 4;
- makeknots(nu, 1, nu->flagu>>1);
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- bp->vec[3]= 1.0;
- bp++;
- }
- }
- }
- else if((nu->type & 7)==CU_BEZIER) { /* Bezier */
- if(type==0 || type==4) { /* to Poly or Nurb */
- nr= 3*nu->pntsu;
- nu->bp = MEM_callocN(nr * sizeof(BPoint), "setsplinetype");
- a= nu->pntsu;
- bezt= nu->bezt;
- bp= nu->bp;
- while(a--) {
- if(type==0 && bezt->h1==HD_VECT && bezt->h2==HD_VECT) {
- /* vector handle becomes 1 poly vertice */
- VECCOPY(bp->vec, bezt->vec[1]);
- bp->vec[3]= 1.0;
- bp->f1= bezt->f2;
- nr-= 2;
- bp->radius= bezt->radius;
- bp->weight= bezt->weight;
- bp++;
- }
- else {
- for(c=0;c<3;c++) {
- VECCOPY(bp->vec, bezt->vec[c]);
- bp->vec[3]= 1.0;
- if(c==0) bp->f1= bezt->f1;
- else if(c==1) bp->f1= bezt->f2;
- else bp->f1= bezt->f3;
- bp->radius= bezt->radius;
- bp->weight= bezt->weight;
- bp++;
- }
- }
- bezt++;
- }
- MEM_freeN(nu->bezt);
- nu->bezt= 0;
- nu->pntsu= nr;
- nu->pntsv= 1;
- nu->orderu= 4;
- nu->orderv= 1;
- nu->type &= ~7;
- nu->type+= type;
- if(nu->flagu & CU_CYCLIC) c= nu->orderu-1;
- else c= 0;
- if(type== 4) {
- nu->flagu &= CU_CYCLIC; /* disable all flags except for cyclic */
- nu->flagu += 4;
- makeknots(nu, 1, nu->flagu>>1);
- }
- }
- }
- else if( (nu->type & 7)==CU_NURBS) {
- if(type==0) { /* to Poly */
- nu->type &= ~7;
- if(nu->knotsu) MEM_freeN(nu->knotsu); /* python created nurbs have a knotsu of zero */
- nu->knotsu= NULL;
- if(nu->knotsv) MEM_freeN(nu->knotsv);
- nu->knotsv= NULL;
- }
- else if(type==CU_BEZIER) { /* to Bezier */
- nr= nu->pntsu/3;
-
- if(nr<2)
- return 1; /* conversion impossible */
- else {
- bezt = MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2");
- nu->bezt= bezt;
- a= nr;
- bp= nu->bp;
- while(a--) {
- VECCOPY(bezt->vec[0], bp->vec);
- bezt->f1= bp->f1;
- bp++;
- VECCOPY(bezt->vec[1], bp->vec);
- bezt->f2= bp->f1;
- bp++;
- VECCOPY(bezt->vec[2], bp->vec);
- bezt->f3= bp->f1;
- bezt->radius= bp->radius;
- bezt->weight= bp->weight;
- bp++;
- bezt++;
- }
- MEM_freeN(nu->bp);
- nu->bp= 0;
- MEM_freeN(nu->knotsu);
- nu->knotsu= NULL;
- nu->pntsu= nr;
- nu->type &= ~7;
- nu->type+= 1;
- }
- }
- }
- return 0;
-}
-
-void setsplinetype(short type)
-{
- Nurb *nu;
-
- if(type==CU_CARDINAL || type==CU_BSPLINE) {
- error("Not implemented yet");
- return;
- }
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
- if (convertspline(type, nu))
- error("no conversion possible");
- }
- }
- BIF_undo_push("Set spline type");
-
-}
-
-/* ******************** SKINNING LOFTING!!! ******************** */
-
-void rotate_direction_nurb(Nurb *nu)
-{
- BPoint *bp1, *bp2, *temp;
- int u, v;
-
- SWAP(short, nu->pntsu, nu->pntsv);
- SWAP(short, nu->orderu, nu->orderv);
- SWAP(short, nu->resolu, nu->resolv);
- SWAP(short, nu->flagu, nu->flagv);
-
- SWAP(float *, nu->knotsu, nu->knotsv);
- switchdirection_knots(nu->knotsv, KNOTSV(nu) );
-
- temp= MEM_dupallocN(nu->bp);
- bp1= nu->bp;
- for(v=0; v<nu->pntsv; v++) {
- for(u=0; u<nu->pntsu; u++, bp1++) {
- bp2= temp + (nu->pntsu-u-1)*(nu->pntsv) + v;
- *bp1= *bp2;
- }
- }
-
- MEM_freeN(temp);
-}
-
-int is_u_selected(Nurb *nu, int u)
-{
- BPoint *bp;
- int v;
-
- /* what about resolu == 2? */
- bp= nu->bp+u;
- for(v=0; v<nu->pntsv-1; v++, bp+=nu->pntsu) {
- if(v) if(bp->f1 & SELECT) return 1;
- }
-
- return 0;
-}
-
-/* ******************************** */
-
-typedef struct NurbSort {
- struct NurbSort *next, *prev;
- Nurb *nu;
- float vec[3];
-} NurbSort;
-
-static ListBase nsortbase= {0, 0};
-/* static NurbSort *nusmain; */ /* this var seems to go unused... at least in this file */
-
-void make_selection_list_nurb()
-{
- ListBase nbase= {0, 0};
- NurbSort *nus, *nustest, *headdo, *taildo;
- Nurb *nu;
- BPoint *bp;
- float dist, headdist, taildist;
- int a;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( isNurbsel(nu) ) {
-
- nus = (NurbSort*)MEM_callocN(sizeof(NurbSort), "sort");
- BLI_addhead(&nbase, nus);
- nus->nu= nu;
-
- bp= nu->bp;
- a= nu->pntsu;
- while(a--) {
- VecAddf(nus->vec, nus->vec, bp->vec);
- bp++;
- }
- VecMulf(nus->vec, 1.0/(float)nu->pntsu);
-
-
- }
- }
-
- /* just add the first one */
- nus= nbase.first;
- BLI_remlink(&nbase, nus);
- BLI_addtail( &nsortbase, nus);
-
- /* now add, either at head or tail, the closest one */
- while(nbase.first) {
-
- headdist= taildist= 1.0e30;
- headdo= taildo= 0;
-
- nustest= nbase.first;
- while(nustest) {
- dist= VecLenf(nustest->vec, ((NurbSort *)nsortbase.first)->vec);
-
- if(dist<headdist) {
- headdist= dist;
- headdo= nustest;
- }
- dist= VecLenf(nustest->vec, ((NurbSort *)nsortbase.last)->vec);
-
- if(dist<taildist) {
- taildist= dist;
- taildo= nustest;
- }
- nustest= nustest->next;
- }
-
- if(headdist<taildist) {
- BLI_remlink(&nbase, headdo);
- BLI_addhead(&nsortbase, headdo);
- }
- else {
- BLI_remlink(&nbase, taildo);
- BLI_addtail(&nsortbase, taildo);
- }
- }
-}
-
-void merge_2_nurb(Nurb *nu1, Nurb *nu2)
-{
- BPoint *bp, *bp1, *bp2, *temp;
- float len1, len2;
- int origu, u, v;
-
- /* first nurbs will be changed to make u = resolu-1 selected */
- /* 2nd nurbs will be changed to make u = 0 selected */
-
- /* first nurbs: u = resolu-1 selected */
-
- if( is_u_selected(nu1, nu1->pntsu-1) );
- else {
- rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
- else {
- rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
- else {
- rotate_direction_nurb(nu1);
- if( is_u_selected(nu1, nu1->pntsu-1) );
- else {
- /* rotate again, now its OK! */
- if(nu1->pntsv!=1) rotate_direction_nurb(nu1);
- return;
- }
- }
- }
- }
-
- /* 2nd nurbs: u = 0 selected */
- if( is_u_selected(nu2, 0) );
- else {
- rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
- else {
- rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
- else {
- rotate_direction_nurb(nu2);
- if( is_u_selected(nu2, 0) );
- else {
- /* rotate again, now its OK! */
- if(nu1->pntsu==1) rotate_direction_nurb(nu1);
- if(nu2->pntsv!=1) rotate_direction_nurb(nu2);
- return;
- }
- }
- }
- }
-
- if( nu1->pntsv != nu2->pntsv ) {
- error("Resolution doesn't match");
- return;
- }
-
- /* ok, now nu1 has the rightmost collumn and nu2 the leftmost collumn selected */
- /* maybe we need a 'v' flip of nu2? */
-
- bp1= nu1->bp+nu1->pntsu-1;
- bp2= nu2->bp;
- len1= 0.0;
-
- for(v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2+=nu2->pntsu) {
- len1+= VecLenf(bp1->vec, bp2->vec);
- }
-
- bp1= nu1->bp + nu1->pntsu-1;
- bp2= nu2->bp + nu2->pntsu*(nu2->pntsv-1);
- len2= 0.0;
-
- for(v=0; v<nu1->pntsv; v++, bp1+=nu1->pntsu, bp2-=nu2->pntsu) {
- len2+= VecLenf(bp1->vec, bp2->vec);
- }
-
- /* merge */
- origu= nu1->pntsu;
- nu1->pntsu+= nu2->pntsu;
- if(nu1->orderu<3) nu1->orderu++;
- if(nu1->orderv<3) nu1->orderv++;
- temp= nu1->bp;
- nu1->bp= MEM_mallocN(nu1->pntsu*nu1->pntsv*sizeof(BPoint), "mergeBP");
-
- bp= nu1->bp;
- bp1= temp;
-
- for(v=0; v<nu1->pntsv; v++) {
-
- /* switch direction? */
- if(len1<len2) bp2= nu2->bp + v*nu2->pntsu;
- else bp2= nu2->bp + (nu1->pntsv-v-1)*nu2->pntsu;
-
- for(u=0; u<nu1->pntsu; u++, bp++) {
- if(u<origu) {
- *bp= *bp1; bp1++;
- select_bpoint(bp, SELECT, 1, HIDDEN);
- }
- else {
- *bp= *bp2; bp2++;
- }
- }
- }
-
- if((nu1->type & 7)==4) {
- /* merge knots */
- makeknots(nu1, 1, nu1->flagu>>1);
-
- /* make knots, for merged curved for example */
- makeknots(nu1, 2, nu1->flagv>>1);
- }
-
- MEM_freeN(temp);
- BLI_remlink(&editNurb, nu2);
- freeNurb(nu2);
-}
-
-void merge_nurb()
-{
- NurbSort *nus1, *nus2;
- int ok= 1;
-
- make_selection_list_nurb();
-
- if(nsortbase.first == nsortbase.last) {
- BLI_freelistN(&nsortbase);
- error("Too few selections to merge");
- return;
- }
-
- nus1= nsortbase.first;
- nus2= nus1->next;
-
- /* resolution match, to avoid uv rotations */
- if(nus1->nu->pntsv==1) {
- if(nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsu==nus2->nu->pntsv);
- else ok= 0;
- }
- else if(nus2->nu->pntsv==1) {
- if(nus2->nu->pntsu==nus1->nu->pntsu || nus2->nu->pntsu==nus1->nu->pntsv);
- else ok= 0;
- }
- else if( nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsv==nus2->nu->pntsv);
- else if( nus1->nu->pntsu==nus2->nu->pntsv || nus1->nu->pntsv==nus2->nu->pntsu);
- else {
- ok= 0;
- }
-
- if(ok==0) {
- error("Resolution doesn't match");
- BLI_freelistN(&nsortbase);
- return;
- }
-
- while(nus2) {
- merge_2_nurb(nus1->nu, nus2->nu);
- nus2= nus2->next;
- }
-
- BLI_freelistN(&nsortbase);
-
- countall();
- set_actNurb(NULL);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Merge");
-
-}
-
-
-void addsegment_nurb()
-{
- /* joins 2 curves */
- Nurb *nu, *nu1=0, *nu2=0;
- BezTriple *bezt;
- BPoint *bp;
- float *fp, offset;
- int a;
-
- /* first decide if this is a surface merge! */
- if(G.obedit->type==OB_SURF) nu= editNurb.first;
- else nu= NULL;
-
- while(nu) {
- if( isNurbsel(nu) ) {
-
- if(nu->pntsu>1 && nu->pntsv>1) break;
- if(isNurbsel_count(nu)>1) break;
- if(isNurbsel_count(nu)==1) {
- /* only 1 selected, not first or last, a little complex, but intuitive */
- if(nu->pntsv==1) {
- if( (nu->bp->f1 & SELECT) || ((nu->bp+nu->pntsu-1)->f1 & SELECT));
- else break;
- }
- }
- }
- nu= nu->next;
- }
- if(nu) {
- merge_nurb();
- return;
- }
-
- /* find both nurbs and points, nu1 will be put behind nu2 */
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->flagu & CU_CYCLIC)==0) { /* not cyclic */
- if( (nu->type & 7)==CU_BEZIER ) {
- bezt= nu->bezt;
- if(nu1==0) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) nu1= nu;
- else {
- bezt= bezt+(nu->pntsu-1);
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- nu1= nu;
- switchdirectionNurb(nu);
- }
- }
- }
- else if(nu2==0) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- nu2= nu;
- switchdirectionNurb(nu);
- }
- else {
- bezt= bezt+(nu->pntsu-1);
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- nu2= nu;
- }
- }
- }
- else break;
- }
- else if(nu->pntsv==1) {
- bp= nu->bp;
- if(nu1==0) {
- if( bp->f1 & SELECT) nu1= nu;
- else {
- bp= bp+(nu->pntsu-1);
- if( bp->f1 & SELECT ) {
- nu1= nu;
- switchdirectionNurb(nu);
- }
- }
- }
- else if(nu2==0) {
- if( bp->f1 & SELECT ) {
- nu2= nu;
- switchdirectionNurb(nu);
- }
- else {
- bp= bp+(nu->pntsu-1);
- if( bp->f1 & SELECT ) {
- nu2= nu;
- }
- }
- }
- else break;
- }
- }
- }
-
- if((nu1 && nu2) && (nu1!=nu2)) {
- if( nu1->type==nu2->type) {
- if((nu1->type & 7)==CU_BEZIER) {
- bezt =
- (BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN");
- memcpy(bezt, nu2->bezt, nu2->pntsu*sizeof(BezTriple));
- memcpy(bezt+nu2->pntsu, nu1->bezt, nu1->pntsu*sizeof(BezTriple));
- MEM_freeN(nu1->bezt);
- nu1->bezt= bezt;
- nu1->pntsu+= nu2->pntsu;
- BLI_remlink(&editNurb, nu2);
- freeNurb(nu2); nu2= NULL;
- calchandlesNurb(nu1);
- }
- else {
- bp =
- (BPoint*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BPoint), "addsegmentN2");
- memcpy(bp, nu2->bp, nu2->pntsu*sizeof(BPoint) );
- memcpy(bp+nu2->pntsu, nu1->bp, nu1->pntsu*sizeof(BPoint));
- MEM_freeN(nu1->bp);
- nu1->bp= bp;
-
- a= nu1->pntsu+nu1->orderu;
-
- nu1->pntsu+= nu2->pntsu;
- BLI_remlink(&editNurb, nu2);
-
- /* now join the knots */
- if((nu1->type & 7)==4) {
- if(nu1->knotsu==NULL) {
- makeknots(nu1, 1, nu1->flagu>>1);
- }
- else {
- fp= MEM_mallocN(sizeof(float)*KNOTSU(nu1), "addsegment3");
- memcpy(fp, nu1->knotsu, sizeof(float)*a);
- MEM_freeN(nu1->knotsu);
- nu1->knotsu= fp;
-
-
- offset= nu1->knotsu[a-1] +1.0;
- fp= nu1->knotsu+a;
- for(a=0; a<nu2->pntsu; a++, fp++) {
- if(nu2->knotsu)
- *fp= offset+nu2->knotsu[a+1];
- else
- *fp = offset;
- }
- }
- }
- freeNurb(nu2); nu2= NULL;
- }
- }
-
- set_actNurb(NULL); /* for selected */
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Add segment");
-
- }
- else error("Can't make segment");
-}
-
-void mouse_nurb()
-{
- Nurb *nu;
- BezTriple *bezt=0;
- BPoint *bp=0;
- short hand;
-
- hand= findnearestNurbvert(1, &nu, &bezt, &bp);
-
- if(bezt || bp) {
- if((G.qual & LR_SHIFTKEY)==0) {
-
- setflagsNurb(0);
-
- if(bezt) {
-
- if(hand==1) select_beztriple(bezt, SELECT, 1, HIDDEN);
- else if(hand==0) bezt->f1|= SELECT;
- else bezt->f3|= SELECT;
- }
- else {
- lastselbp= bp;
- select_bpoint(bp, SELECT, 1, HIDDEN);
- }
-
- allqueue(REDRAWVIEW3D, 0);
- }
- else {
- if(bezt) {
- if(hand==1) {
- if(bezt->f2 & SELECT) select_beztriple(bezt, DESELECT, 1, HIDDEN);
- else select_beztriple(bezt, SELECT, 1, HIDDEN);
- } else if(hand==0) {
- bezt->f1 ^= SELECT;
- } else {
- bezt->f3 ^= SELECT;
- }
- }
- else {
- if(bp->f1 & SELECT) select_bpoint(bp, DESELECT, 1, HIDDEN);
- else {
- select_bpoint(bp, SELECT, 1, HIDDEN);
- lastselbp= bp;
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
-
- }
-
- countall();
- }
-
- rightmouse_transform();
-
- if(nu!=get_actNurb()) {
- set_actNurb(nu);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-
-}
-
-/* from what I can gather, the mode==0 magic number spins and bridges the nurbs based on the
- * orientation of the global 3d view (yuck yuck!) mode==1 does the same, but doesn't bridge up
- * up the new geometry, mode==2 now does the same as 0, but aligned to world axes, not the view.
-*/
-static void spin_nurb(float *dvec, short mode)
-{
- Nurb *nu;
- float *curs, si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3];
- float cent[3],bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
- float persmat[3][3], persinv[3][3];
- short a,ok;
-
- if(G.vd==0 || G.obedit==0 || G.obedit->type!=OB_SURF) return;
- if( (G.vd->lay & G.obedit->lay)==0 ) return;
-
- if (mode != 2) Mat3CpyMat4(persmat, G.vd->viewmat);
- else Mat3One(persmat);
- Mat3Inv(persinv, persmat);
-
- /* imat and center and size */
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat, bmat);
-
- curs= give_cursor();
- VECCOPY(cent, curs);
- VecSubf(cent, cent, G.obedit->obmat[3]);
- Mat3MulVecfl(imat,cent);
-
- if(dvec || mode==2) {
- n[0]=n[1]= 0.0;
- n[2]= 1.0;
- } else {
- n[0]= G.vd->viewinv[2][0];
- n[1]= G.vd->viewinv[2][1];
- n[2]= G.vd->viewinv[2][2];
- Normalize(n);
- }
-
- phi= M_PI/8.0;
- q[0]= cos(phi);
- si= sin(phi);
- q[1]= n[0]*si;
- q[2]= n[1]*si;
- q[3]= n[2]*si;
- QuatToMat3(q, cmat);
- Mat3MulMat3(tmat, cmat, bmat);
- Mat3MulMat3(rotmat, imat, tmat);
-
- Mat3One(scalemat1);
- scalemat1[0][0]= sqrt(2.0);
- scalemat1[1][1]= sqrt(2.0);
-
- Mat3MulMat3(tmat,persmat,bmat);
- Mat3MulMat3(cmat,scalemat1,tmat);
- Mat3MulMat3(tmat,persinv,cmat);
- Mat3MulMat3(scalemat1,imat,tmat);
-
- Mat3One(scalemat2);
- scalemat2[0][0]/= sqrt(2.0);
- scalemat2[1][1]/= sqrt(2.0);
-
- Mat3MulMat3(tmat,persmat,bmat);
- Mat3MulMat3(cmat,scalemat2,tmat);
- Mat3MulMat3(tmat,persinv,cmat);
- Mat3MulMat3(scalemat2,imat,tmat);
-
- ok= 1;
-
- for(a=0;a<7;a++) {
- if(mode==0 || mode==2) ok= extrudeflagNurb(1);
- else adduplicateflagNurb(1);
- if(ok==0) {
- error("Can't spin");
- break;
- }
- rotateflagNurb(1,cent,rotmat);
-
- if(mode==0 || mode==2) {
- if( (a & 1)==0 ) {
- rotateflagNurb(1,cent,scalemat1);
- weightflagNurb(1, 0.25*sqrt(2.0), 1);
- }
- else {
- rotateflagNurb(1,cent,scalemat2);
- weightflagNurb(1, 4.0/sqrt(2.0), 1);
- }
- }
- if(dvec) {
- Mat3MulVecfl(bmat,dvec);
- translateflagNurb(1,dvec);
- }
- }
-
- if(ok) {
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
- nu->orderv= 4;
- nu->flagv |= CU_CYCLIC;
- makeknots(nu, 2, nu->flagv>>1);
- }
- }
- }
-
-}
-
-/* external one, for undo */
-void spinNurb(float *dvec, short mode)
-{
- spin_nurb(dvec, mode);
- BIF_undo_push("Spin");
-}
-
-void addvert_Nurb(int mode)
-{
- Nurb *nu;
- BezTriple *bezt, *newbezt = NULL;
- BPoint *bp, *newbp = NULL;
- float *curs, mat[3][3],imat[3][3], temp[3];
-
- if(G.obedit==0 || G.vd == 0) return;
- if( (G.vd->lay & G.obedit->lay)==0 ) return;
-
- Mat3CpyMat4(mat, G.obedit->obmat);
- Mat3Inv(imat,mat);
-
- findselectedNurbvert(&nu, &bezt, &bp);
- if(bezt==0 && bp==0) return;
-
- if((nu->type & 7)==CU_BEZIER) {
- /* which bezpoint? */
- if(bezt== nu->bezt) { /* first */
- BEZ_DESEL(bezt);
- newbezt =
- (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
- memcpy(newbezt+1, bezt, nu->pntsu*sizeof(BezTriple));
- *newbezt= *bezt;
- BEZ_SEL(newbezt);
- if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
- else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
- VECCOPY(temp, bezt->vec[1]);
- MEM_freeN(nu->bezt);
- nu->bezt= newbezt;
- bezt= newbezt+1;
- }
- else if(bezt== (nu->bezt+nu->pntsu-1)) { /* last */
- BEZ_DESEL(bezt);
- newbezt =
- (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
- memcpy(newbezt, nu->bezt, nu->pntsu*sizeof(BezTriple));
- *(newbezt+nu->pntsu)= *bezt;
- VECCOPY(temp, bezt->vec[1]);
- MEM_freeN(nu->bezt);
- nu->bezt= newbezt;
- newbezt+= nu->pntsu;
- BEZ_SEL(newbezt);
- if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
- else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
- bezt= nu->bezt+nu->pntsu-1;
- }
- else bezt= 0;
-
- if(bezt) {
- nu->pntsu++;
-
- if(mode=='e') {
- VECCOPY(newbezt->vec[0], bezt->vec[0]);
- VECCOPY(newbezt->vec[1], bezt->vec[1]);
- VECCOPY(newbezt->vec[2], bezt->vec[2]);
- }
- else {
- curs= give_cursor();
-
- VECCOPY(newbezt->vec[1], curs);
- VecSubf(newbezt->vec[1],newbezt->vec[1],G.obedit->obmat[3]);
- Mat3MulVecfl(imat,newbezt->vec[1]);
- VecSubf(temp, newbezt->vec[1],temp);
- VecAddf(newbezt->vec[0], bezt->vec[0],temp);
- VecAddf(newbezt->vec[2], bezt->vec[2],temp);
- calchandlesNurb(nu);
- }
- }
- }
- else if(nu->pntsv==1) {
- /* which b-point? */
- if(bp== nu->bp) { /* first */
- bp->f1= 0;
- newbp =
- (BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb3");
- memcpy(newbp+1, bp, nu->pntsu*sizeof(BPoint));
- *newbp= *bp;
- newbp->f1= 1;
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- bp= newbp + 1;
- }
- else if(bp== (nu->bp+nu->pntsu-1)) { /* last */
- bp->f1= 0;
- newbp =
- (BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb4");
- memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint));
- *(newbp+nu->pntsu)= *bp;
- MEM_freeN(nu->bp);
- nu->bp= newbp;
- newbp+= nu->pntsu;
- newbp->f1= 1;
- bp= newbp - 1;
- }
- else bp= 0;
-
- if(bp) {
- nu->pntsu++;
-
- makeknots(nu, 1, nu->flagu>>1);
-
- if(mode=='e') {
- VECCOPY(newbp->vec, bp->vec);
- }
- else {
- curs= give_cursor();
-
- VECCOPY(newbp->vec, curs);
- VecSubf(newbp->vec, newbp->vec, G.obedit->obmat[3]);
- Mat3MulVecfl(imat,newbp->vec);
- newbp->vec[3]= 1.0;
- }
- }
- }
-
- retopo_do_all();
-
- test2DNurb(nu);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- if(mode=='e') {
- BIF_TransformSetUndo("Extrude");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
- }
- else while(get_mbut()&R_MOUSE) BIF_wait_for_statechange();
-
- if(mode!='e') {
- /* dependencies with other objects, should become event */
- BIF_undo_push("Add vertex");
-
- }
-}
-
-void extrude_nurb()
-{
- Nurb *nu;
- int ok= 0;
-
- if(G.obedit && G.obedit->type==OB_SURF) {
-
- /* first test: curve? */
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(nu->pntsv==1 && isNurbsel_count(nu)==1 ) break;
- }
- if(nu) {
- addvert_Nurb('e');
- } else {
- ok= extrudeflagNurb(1); /* '1'= flag */
-
- if(ok) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- countall();
- BIF_TransformSetUndo("Extrude");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
- }
- }
- }
-}
-
-
-
-void makecyclicNurb()
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- float *fp;
- int a, b, cyclmode=0;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( nu->pntsu>1 || nu->pntsv>1) {
- if( (nu->type & 7)==0 ) {
- a= nu->pntsu;
- bp= nu->bp;
- while(a--) {
- if( bp->f1 & SELECT ) {
- if(nu->flagu & CU_CYCLIC) nu->flagu &= ~CU_CYCLIC;
- else nu->flagu |= CU_CYCLIC;
- break;
- }
- bp++;
- }
- }
- else if( (nu->type & 7)==CU_BEZIER ) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- if(nu->flagu & CU_CYCLIC) nu->flagu &= ~CU_CYCLIC;
- else nu->flagu |= CU_CYCLIC;
- break;
- }
- bezt++;
- }
- calchandlesNurb(nu);
- }
- else if(nu->pntsv==1 && (nu->type & 7)==CU_NURBS) {
- if (nu->knotsu) { /* if check_valid_nurb_u fails the knotsu can be NULL */
- a= nu->pntsu;
- bp= nu->bp;
- while(a--) {
- if( bp->f1 & SELECT ) {
- if(nu->flagu & CU_CYCLIC) nu->flagu &= ~CU_CYCLIC;
- else {
- nu->flagu |= CU_CYCLIC;
- nu->flagu &= ~2; /* endpoint flag, fixme */
- fp= MEM_mallocN(sizeof(float)*KNOTSU(nu), "makecyclicN");
- b= (nu->orderu+nu->pntsu);
- memcpy(fp, nu->knotsu, sizeof(float)*b);
- MEM_freeN(nu->knotsu);
- nu->knotsu= fp;
-
- makeknots(nu, 1, 0); /* 1==u 0==uniform */
-
- }
- break;
- }
- bp++;
- }
- }
- }
- else if(nu->type==CU_NURBS) {
- if(cyclmode==0) {
- cyclmode= pupmenu("Toggle %t|cyclic U%x1|cyclic V%x2");
- if(cyclmode < 1) return;
- }
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
-
- if( bp->f1 & SELECT) {
- if(cyclmode==1 && nu->pntsu>1) {
- if(nu->flagu & CU_CYCLIC) nu->flagu &= ~CU_CYCLIC;
- else {
- nu->flagu |= CU_CYCLIC;
- if (check_valid_nurb_u(nu)) {
- fp= MEM_mallocN(sizeof(float)*KNOTSU(nu), "makecyclicN");
- b= (nu->orderu+nu->pntsu);
- if (nu->knotsu) { /* null if check_valid_nurb_u failed before but is valid now */
- memcpy(fp, nu->knotsu, sizeof(float)*b);
- MEM_freeN(nu->knotsu);
- }
- nu->knotsu= fp;
-
- makeknots(nu, 1, 0); /* 1==u 0==uniform */
- }
- }
- }
- if(cyclmode==2 && nu->pntsv>1) {
- if(nu->flagv & 1) nu->flagv--;
- else {
- nu->flagv++;
- if (check_valid_nurb_v(nu)) {
- fp= MEM_mallocN(sizeof(float)*KNOTSV(nu), "makecyclicN");
- b= (nu->orderv+nu->pntsv);
- if (nu->knotsv) { /* null if check_valid_nurb_v failed before but is valid now */
- memcpy(fp, nu->knotsv, sizeof(float)*b);
- MEM_freeN(nu->knotsv);
- }
- nu->knotsv= fp;
-
- makeknots(nu, 2, 0); /* 2==v 0==uniform */
- }
- }
- }
- break;
- }
- bp++;
- }
-
- }
- }
- }
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Cyclic");
-}
-
-void selectconnected_nurb()
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- findnearestNurbvert(1, &nu, &bezt, &bp);
- if(bezt) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if(G.qual & LR_SHIFTKEY) select_beztriple(bezt, DESELECT, 1, VISIBLE);
- else select_beztriple(bezt, SELECT, 1, VISIBLE);
- bezt++;
- }
- }
- else if(bp) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if(G.qual & LR_SHIFTKEY) select_bpoint(bp, DESELECT, 1, VISIBLE);
- else select_bpoint(bp, SELECT, 1, VISIBLE);
- bp++;
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select connected");
-
-}
-
-void selectrow_nurb()
-{
- static BPoint *last=0;
- static int direction=0;
- Nurb *nu;
- BPoint *bp;
- int u = 0, v = 0, a, b, ok=0;
-
- if(editNurb.first==0) return;
- if(G.obedit==NULL || G.obedit->type!=OB_SURF) return;
- if(lastselbp==NULL) return;
-
- /* find the correct nurb and toggle with u of v */
- for(nu= editNurb.first; nu; nu= nu->next) {
- bp= nu->bp;
- for(v=0; v<nu->pntsv; v++) {
- for(u=0; u<nu->pntsu; u++, bp++) {
- if(bp==lastselbp) {
- if(bp->f1 & SELECT) {
- ok= 1;
- break;
- }
- }
- }
- if(ok) break;
- }
- if(ok) {
- if(last==lastselbp) {
- direction= 1-direction;
- setflagsNurb(0);
- }
- last= lastselbp;
-
- bp= nu->bp;
- for(a=0; a<nu->pntsv; a++) {
- for(b=0; b<nu->pntsu; b++, bp++) {
- if(direction) {
- if(a==v) select_bpoint(bp, SELECT, 1, VISIBLE);
- }
- else {
- if(b==u) select_bpoint(bp, SELECT, 1, VISIBLE);
- }
- }
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- return;
- }
- }
- BIF_undo_push("Select Row");
-
-}
-
-/* (de)selects first or last of visible part of each Nurb depending on selFirst */
-/* selFirst: defines the end of which to select */
-/* doswap: defines if selection state of each first/last control point is swapped */
-/* selstatus: selection status in case doswap is false */
-void selectend_nurb(short selfirst, short doswap, short selstatus)
-{
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
- short sel;
-
- if(G.obedit==0) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- sel= 0;
- if((nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
-
- /* which point? */
- if(selfirst==0) { /* select last */
- bezt= (nu->bezt + (a-1));
- }
- else { /* select first */
- bezt= nu->bezt;
- }
-
- while(a--) {
- if(doswap) sel= swap_selection_beztriple(bezt);
- else sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
-
- if(sel==1) break;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
-
- /* which point? */
- if(selfirst==0) { /* select last */
- bp= (nu->bp + (a-1));
- }
- else{ /* select first */
- bp= nu->bp;
- }
-
- while(a--) {
- if (bp->hide == 0) {
- if(doswap) sel= swap_selection_bpoint(bp);
- else sel= select_bpoint(bp, selstatus, 1, VISIBLE);
-
- if(sel==1) break;
- }
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select/Deselect End");
-}
-
-void select_next_nurb()
-{
- if(G.obedit==0) return;
-
- select_adjacent_cp(1, 0, SELECT);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select Next");
-}
-
-void select_prev_nurb()
-{
- if(G.obedit==0) return;
-
- select_adjacent_cp(-1, 0, SELECT);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select Previous");
-}
-
-void select_more_nurb()
-{
- Nurb *nu;
- BPoint *bp, *tempbp;
- int a;
- short sel= 0;
- short *selbpoints;
-
- if(G.obedit==0) return;
-
- /* note that NURBS surface is a special case because we mimic */
- /* the behaviour of "select more" of mesh tools. */
- /* The algorithm is designed to work in planar cases so it */
- /* may not be optimal always (example: end of NURBS sphere) */
- if(G.obedit->type==OB_SURF) {
- for(nu= editNurb.first; nu; nu= nu->next) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- selbpoints= MEM_callocN(sizeof(short)*a-nu->pntsu, "selectlist");
- while(a > 0) {
- if((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & SELECT)) {
- /* upper control point */
- if(a%nu->pntsu != 0) {
- tempbp= bp-1;
- if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
- }
-
- /* left control point. select only if it is not selected already */
- if(a-nu->pntsu > 0) {
- sel= 0;
- tempbp= bp+nu->pntsu;
- if(!(tempbp->f1 & SELECT)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
- /* make sure selected bpoint is discarded */
- if(sel == 1) selbpoints[a-nu->pntsu]= 1;
- }
-
- /* right control point */
- if(a+nu->pntsu < nu->pntsu*nu->pntsv) {
- tempbp= bp-nu->pntsu;
- if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE);
- }
-
- /* lower control point. skip next bp in case selection was made */
- if(a%nu->pntsu != 1) {
- sel= 0;
- tempbp= bp+1;
- if(!(tempbp->f1 & 1)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE);
- if(sel) {
- bp++;
- a--;
- }
- }
- }
-
- bp++;
- a--;
- }
-
- MEM_freeN(selbpoints);
- }
- }
- else {
- select_adjacent_cp(1, 0, SELECT);
- select_adjacent_cp(-1, 0, SELECT);
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select More");
-}
-
-/* basic method: deselect if control point doesn't have all neighbours selected */
-void select_less_nurb()
-{
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int a;
- short sel= 0, lastsel= 0;
- short *selbpoints;
-
- if(G.obedit==0) return;
-
- if(G.obedit->type==OB_SURF) {
- for(nu= editNurb.first; nu; nu= nu->next) {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- selbpoints= MEM_callocN(sizeof(short)*a, "selectlist");
- while(a--) {
- if((bp->hide==0) && (bp->f1 & SELECT)) {
- sel= 0;
-
- /* check if neighbours have been selected */
- /* edges of surface are an exception */
- if((a+1)%nu->pntsu==0) sel++;
- else {
- bp--;
- if((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
- bp++;
- }
-
- if((a+1)%nu->pntsu==1) sel++;
- else {
- bp++;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
- bp--;
- }
-
- if(a+1 > nu->pntsu*nu->pntsv-nu->pntsu) sel++;
- else {
- bp-=nu->pntsu;
- if((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++;
- bp+=nu->pntsu;
- }
-
- if(a < nu->pntsu) sel++;
- else {
- bp+=nu->pntsu;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
- bp-=nu->pntsu;
- }
-
- if(sel!=4) {
- select_bpoint(bp, DESELECT, 1, VISIBLE);
- selbpoints[a]= 1;
- }
- }
- else lastsel= 0;
-
- bp++;
- }
-
- MEM_freeN(selbpoints);
- }
- }
- else {
- for(nu= editNurb.first; nu; nu= nu->next) {
- lastsel=0;
- /* check what type of curve/nurb it is */
- if((nu->type & 7)==CU_BEZIER) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- if((bezt->hide==0) && (bezt->f2 & SELECT)) {
- if(lastsel==1) sel= 1;
- else sel= 0;
-
- /* check if neighbours have been selected */
- /* first and last are exceptions */
- if(a==nu->pntsu-1) sel++;
- else {
- bezt--;
- if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
- bezt++;
- }
-
- if(a==0) sel++;
- else {
- bezt++;
- if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++;
- bezt--;
- }
-
- if(sel!=2) {
- select_beztriple(bezt, DESELECT, 1, VISIBLE);
- lastsel= 1;
- }
- else lastsel= 0;
- }
- else lastsel= 0;
-
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- if((lastsel==0) && (bp->hide==0) && (bp->f1 & SELECT)) {
- if(lastsel!=0) sel= 1;
- else sel= 0;
-
- /* first and last are exceptions */
- if(a==nu->pntsu*nu->pntsv-1) sel++;
- else {
- bp--;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
- bp++;
- }
-
- if(a==0) sel++;
- else {
- bp++;
- if((bp->hide==0) && (bp->f1 & SELECT)) sel++;
- bp--;
- }
-
- if(sel!=2) {
- select_bpoint(bp, DESELECT, 1, VISIBLE);
- lastsel= 1;
- }
- else lastsel= 0;
- }
- else lastsel= 0;
-
- bp++;
- }
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select Less");
-}
-
-/* this function could be moved elsewhere as it can be reused in other parts of the source needing randomized list */
-/* returns list containing -1 in indices that have been left out of the list. otherwise index contains reference */
-/* to next index. basically *list contains a linked list */
-static void generate_pickable_list(int *list, int size, int pickamount)
-{
- int i, j, removable;
-
- BLI_srand( BLI_rand() ); /* random seed */
-
- /* generate list in form 0->1, 1->2, 2->3, ... i-2->i-1, i->0 */
- for(i=0; i<size; i++) {
- if(i == size-1) list[i]= 0;
- else list[i]= i+1;
- }
-
- for(i=0; i<size-pickamount; i++) {
- removable= floor(BLI_frand()*(size-1)+0.5); /* with rounding. frand returns [0,1] */
-
- /* seek proper item as the one randomly selected might not be appropriate */
- for(j=0; j<size; j++, removable++) {
- if(list[removable] != -1) break;
- if(removable == size-1) removable= -1;
- }
-
- /* pick unwanted item out of the list */
- list[list[removable]]= -1; /* mark former last as invalid */
-
- if(list[removable] == size-1) list[removable]= 0;
- else list[removable]= list[removable]+1;
- }
-}
-
-void select_random_nurb()
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- static short randfac= 50;
- int amounttoselect, amountofcps, a, i, k= 0;
- int *itemstobeselected;
-
- if(!G.obedit) return;
-
- if(!button(&randfac,0, 100,"Percentage:")) return;
-
- if(randfac == 0) return;
-
- amountofcps= count_curveverts_without_handles(&editNurb);
- itemstobeselected= MEM_callocN(sizeof(int) * amountofcps, "selectitems");
- amounttoselect= floor(randfac * amountofcps / 100 + 0.5);
- generate_pickable_list(itemstobeselected, amountofcps, amounttoselect);
-
- /* select elements */
- for(i=1, nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(itemstobeselected[k] != -1) select_beztriple(bezt, SELECT, 1, VISIBLE);
- k++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(itemstobeselected[k] != -1) select_bpoint(bp, SELECT, 1, VISIBLE);
- k++;
- bp++;
- }
- }
- }
-
- MEM_freeN(itemstobeselected);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select Random");
-}
-
-void select_every_nth_nurb()
-{
- static short nfac= 2;
-
- if(!G.obedit) return;
-
- if(!button(&nfac, 2, 25,"N:")) return;
-
- select_adjacent_cp(nfac, 1, SELECT);
- select_adjacent_cp(-nfac, 1, SELECT);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Select Every Nth");
-}
-
-void adduplicate_nurb()
-{
-
- if(G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return;
-
- adduplicateflagNurb(1);
-
- countall();
- BIF_TransformSetUndo("Add Duplicate");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
-}
-
-void delNurb()
-{
- Nurb *nu, *next, *nu1;
- BezTriple *bezt, *bezt1, *bezt2;
- BPoint *bp, *bp1, *bp2;
- int a;
- short event, cut = 0;
-
- if(G.obedit==0 ) return;
- if(G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return;
-
- if(G.obedit->type==OB_SURF) event= pupmenu("Erase %t|Selected%x0|All%x2");
- else event= pupmenu("Erase %t|Selected%x0|Segment%x1|All%x2");
-
- if(event== -1) return;
-
- if(G.obedit->type==OB_SURF) {
- if(event==0) deleteflagNurb(1);
- else freeNurblist(&editNurb);
-
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Delete");
-
- return;
- }
-
- if(event==0) {
- /* first loop, can we remove entire pieces? */
- nu= editNurb.first;
- while(nu) {
- next= nu->next;
- if( (nu->type & 7)==CU_BEZIER ) {
- bezt= nu->bezt;
- a= nu->pntsu;
- if(a) {
- while(a) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) );
- else break;
- a--;
- bezt++;
- }
- if(a==0) {
- BLI_remlink(&editNurb, nu);
- freeNurb(nu); nu= NULL;
- }
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- if(a) {
- while(a) {
- if(bp->f1 & SELECT);
- else break;
- a--;
- bp++;
- }
- if(a==0) {
- BLI_remlink(&editNurb, nu);
- freeNurb(nu); nu= NULL;
- }
- }
- }
-
- /* Never allow the order to exceed the number of points
- - note, this is ok but changes unselected nurbs, disable for now */
- /*
- if ((nu!= NULL) && ((nu->type & 7)==CU_NURBS)) {
- clamp_nurb_order_u(nu);
- }
- */
- nu= next;
- }
- /* 2nd loop, delete small pieces: just for curves */
- nu= editNurb.first;
- while(nu) {
- next= nu->next;
- event= 0;
- if( (nu->type & 7)==CU_BEZIER ) {
- bezt= nu->bezt;
- for(a=0;a<nu->pntsu;a++) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- memmove(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple));
- nu->pntsu--;
- a--;
- event= 1;
- }
- else bezt++;
- }
- if(event) {
- bezt1 =
- (BezTriple*)MEM_mallocN((nu->pntsu) * sizeof(BezTriple), "delNurb");
- memcpy(bezt1, nu->bezt, (nu->pntsu)*sizeof(BezTriple) );
- MEM_freeN(nu->bezt);
- nu->bezt= bezt1;
- calchandlesNurb(nu);
- }
- }
- else if(nu->pntsv==1) {
- bp= nu->bp;
-
- for(a=0;a<nu->pntsu;a++) {
- if( bp->f1 & SELECT ) {
- memmove(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint));
- nu->pntsu--;
- a--;
- event= 1;
- }
- else {
- bp++;
- }
- }
- if(event) {
- bp1 = (BPoint*)MEM_mallocN(nu->pntsu * sizeof(BPoint), "delNurb2");
- memcpy(bp1, nu->bp, (nu->pntsu)*sizeof(BPoint) );
- MEM_freeN(nu->bp);
- nu->bp= bp1;
-
- /* Never allow the order to exceed the number of points\
- - note, this is ok but changes unselected nurbs, disable for now */
- /*
- if ((nu->type & 7)==CU_NURBS) {
- clamp_nurb_order_u(nu);
- }*/
- }
- makeknots(nu, 1, nu->flagu>>1);
- }
- nu= next;
- }
- }
- else if(event==1) { /* erase segment */
- /* find the 2 selected points */
- bezt1= bezt2= 0;
- bp1= bp2= 0;
- nu= editNurb.first;
- nu1= 0;
- while(nu) {
- next= nu->next;
- if( (nu->type & 7)==CU_BEZIER ) {
- bezt= nu->bezt;
- for(a=0; a<nu->pntsu-1; a++) {
- if( BEZSELECTED_HIDDENHANDLES(bezt) ) {
- bezt1= bezt;
- bezt2= bezt+1;
- if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ;
- else { /* maybe do not make cyclic */
- if(a==0 && (nu->flagu & CU_CYCLIC) ) {
- bezt2= bezt+(nu->pntsu-1);
- if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) {
- nu->flagu &= ~CU_CYCLIC;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Delete");
- }
- }
- return;
- }
- cut= a;
- nu1= nu;
- break;
- }
- bezt++;
- }
- }
- else if(nu->pntsv==1) {
- bp= nu->bp;
- for(a=0; a<nu->pntsu-1; a++) {
- if( bp->f1 & SELECT ) {
- bp1= bp;
- bp2= bp+1;
- if( bp2->f1 & 1 ) ;
- else { /* maybe do not make cyclic */
- if(a==0 && (nu->flagu & CU_CYCLIC) ) {
- bp2= bp+(nu->pntsu-1);
- if( bp2->f1 & SELECT ) {
- nu->flagu &= ~CU_CYCLIC;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Delete");
- }
- }
- return;
- }
- cut= a;
- nu1= nu;
- break;
- }
- bp++;
- }
- }
- if(nu1) break;
-
- nu= nu->next;
- }
- if(nu1) {
- if(bezt1) {
- if(nu1->pntsu==2) { /* remove completely */
- BLI_remlink(&editNurb, nu);
- freeNurb(nu); nu = NULL;
- }
- else if(nu1->flagu & CU_CYCLIC) { /* cyclic */
- bezt =
- (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb1");
- memcpy(bezt, nu1->bezt,(cut+1)*sizeof(BezTriple));
- a= nu1->pntsu-cut-1;
- memcpy(nu1->bezt, bezt2, a*sizeof(BezTriple));
- memcpy(nu1->bezt+a, bezt, (cut+1)*sizeof(BezTriple));
- nu1->flagu &= ~CU_CYCLIC;
- MEM_freeN(bezt);
- calchandlesNurb(nu);
- }
- else { /* add new curve */
-
-/* seems to be an error here... but where? (a can become zero) */
-
- nu =
- (Nurb*)MEM_mallocN(sizeof(Nurb), "delNurb2");
- memcpy(nu, nu1, sizeof(Nurb));
- BLI_addtail(&editNurb, nu);
- nu->bezt =
- (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb3");
- memcpy(nu->bezt, nu1->bezt,(cut+1)*sizeof(BezTriple));
- a= nu1->pntsu-cut-1;
-
- bezt =
- (BezTriple*)MEM_mallocN(a * sizeof(BezTriple), "delNurb4");
- memcpy(bezt, nu1->bezt+cut+1,a*sizeof(BezTriple));
- MEM_freeN(nu1->bezt);
- nu1->bezt= bezt;
- nu1->pntsu= a;
- nu->pntsu= cut+1;
-
-
- calchandlesNurb(nu);
- calchandlesNurb(nu1);
- }
- }
- else if(bp1) {
- if(nu1->pntsu==2) { /* remove completely */
- BLI_remlink(&editNurb, nu);
- freeNurb(nu); nu= NULL;
- }
- else if(nu1->flagu & CU_CYCLIC) { /* cyclic */
- bp =
- (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb5");
- memcpy(bp, nu1->bp,(cut+1)*sizeof(BPoint));
- a= nu1->pntsu-cut-1;
- memcpy(nu1->bp, bp2, a*sizeof(BPoint));
- memcpy(nu1->bp+a, bp, (cut+1)*sizeof(BPoint));
- nu1->flagu &= ~CU_CYCLIC;
- MEM_freeN(bp);
- }
- else { /* add new curve */
- nu = (Nurb*)MEM_mallocN(sizeof(Nurb), "delNurb6");
- memcpy(nu, nu1, sizeof(Nurb));
- BLI_addtail(&editNurb, nu);
- nu->bp =
- (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb7");
- memcpy(nu->bp, nu1->bp,(cut+1)*sizeof(BPoint));
- a= nu1->pntsu-cut-1;
- bp =
- (BPoint*)MEM_mallocN(a * sizeof(BPoint), "delNurb8");
- memcpy(bp, nu1->bp+cut+1,a*sizeof(BPoint));
- MEM_freeN(nu1->bp);
- nu1->bp= bp;
- nu1->pntsu= a;
- nu->pntsu= cut+1;
- }
- }
- }
- }
- else if(event==2) {
- freeNurblist(&editNurb);
- }
-
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Delete");
-
-}
-
-void nurb_set_smooth(short event)
-{
- Nurb *nu;
-
- if(G.obedit==0) return;
-
- if(G.obedit->type != OB_CURVE) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if(isNurbsel(nu)) {
- if(event==1) nu->flag |= CU_SMOOTH;
- else if(event==0) nu->flag &= ~CU_SMOOTH;
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-
- if(event==1) BIF_undo_push("Set Smooth");
- else if(event==0) BIF_undo_push("Set Solid");
-}
-
-int join_curve(int type)
-{
- Base *base, *nextb;
- Object *ob;
- Curve *cu;
- Nurb *nu, *newnu;
- BezTriple *bezt;
- BPoint *bp;
- ListBase tempbase;
- float imat[4][4], cmat[4][4];
- int a;
-
- ob= OBACT;
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return 0;
- }
-
- if(!G.vd || ob->type!=type) return 0;
- if(ob->lay & G.vd->lay); else return 0;
- tempbase.first= tempbase.last= 0;
-
- /* trasnform all selected curves inverse in obact */
- Mat4Invert(imat, ob->obmat);
-
- base= FIRSTBASE;
- while(base) {
- nextb= base->next;
- if TESTBASE(base) {
- if(base->object->type==type) {
- if(base->object != ob) {
-
- cu= base->object->data;
-
- if(cu->nurb.first) {
- /* watch it: switch order here really goes wrong */
- Mat4MulMat4(cmat, base->object->obmat, imat);
-
- nu= cu->nurb.first;
- while(nu) {
- newnu= duplicateNurb(nu);
- BLI_addtail(&tempbase, newnu);
-
- if( (bezt= newnu->bezt) ) {
- a= newnu->pntsu;
- while(a--) {
- Mat4MulVecfl(cmat, bezt->vec[0]);
- Mat4MulVecfl(cmat, bezt->vec[1]);
- Mat4MulVecfl(cmat, bezt->vec[2]);
- bezt++;
- }
- }
- if( (bp= newnu->bp) ) {
- a= newnu->pntsu*nu->pntsv;
- while(a--) {
- Mat4MulVecfl(cmat, bp->vec);
- bp++;
- }
- }
- nu= nu->next;
- }
- }
-
- free_and_unlink_base(base);
- }
- }
- }
- base= nextb;
- }
-
- cu= ob->data;
- addlisttolist(&cu->nurb, &tempbase);
-
- DAG_scene_sort(G.scene); // because we removed object(s), call before editmode!
-
- enter_editmode(EM_WAITCURSOR);
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Join");
- return 1;
-}
-
-
-
-Nurb *addNurbprim(int type, int stype, int newname)
-/* type: &8= 2D; 0=poly,1 bez, 4 nurb
- * stype: 0: 2/4 points curve
- * 1: 8 points circle
- * 2: 4x4 patch Nurb
- * 3: tube 4:sphere 5:donut
- * 6: 5 points, 5th order straight line (for anim path)
- */
-{
- static int xzproj= 0;
- Nurb *nu = NULL;
- BezTriple *bezt;
- BPoint *bp;
- float *curs, cent[3],vec[3],imat[3][3],mat[3][3];
- float fac,cmat[3][3], grid;
- int a, b;
-
- if (G.vd) grid = G.vd->grid;
- else grid = 1.0;
-
- /* imat and center and size */
- if(G.obedit) {
-
- Mat3CpyMat4(mat, G.obedit->obmat);
- curs= give_cursor();
- VECCOPY(cent, curs);
- cent[0]-= G.obedit->obmat[3][0];
- cent[1]-= G.obedit->obmat[3][1];
- cent[2]-= G.obedit->obmat[3][2];
-
- if (G.vd) {
- if ( !(newname) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(imat, G.vd->viewmat);
- else Mat3One(imat);
- Mat3MulVecfl(imat, cent);
- Mat3MulMat3(cmat, imat, mat);
- Mat3Inv(imat, cmat);
- }
- setflagsNurb(0);
- }
- else {
- Mat3One(imat);
- cent[0]= cent[1]= cent[2]= 0.0;
- }
-
- if ELEM5(stype, 0, 1, 2, 4, 6) {
- nu = (Nurb*)MEM_callocN(sizeof(Nurb), "addNurbprim");
- nu->type= type;
- nu->resolu= 4;
- nu->resolv= 4;
- }
-
- switch(stype) {
- case 0: /* curve */
- nu->resolu= 12; /* set as 4 above */
- if(newname) {
- rename_id((ID *)G.obedit, "Curve");
- rename_id((ID *)G.obedit->data, "Curve");
- }
- if((type & 7)==CU_BEZIER) {
- nu->pntsu= 2;
- nu->bezt =
- (BezTriple*)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1");
- bezt= nu->bezt;
- bezt->h1= bezt->h2= HD_ALIGN;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->radius = 1.0;
-
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->vec[1][0]+= -grid;
- bezt->vec[0][0]+= -1.5*grid;
- bezt->vec[0][1]+= -0.5*grid;
- bezt->vec[2][0]+= -0.5*grid;
- bezt->vec[2][1]+= 0.5*grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat, bezt->vec[a]);
-
- bezt++;
- bezt->h1= bezt->h2= HD_ALIGN;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->radius = bezt->weight = 1.0;
-
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->vec[1][0]+= grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat, bezt->vec[a]);
-
- calchandlesNurb(nu);
- }
- else {
-
- nu->pntsu= 4;
- nu->pntsv= 1;
- nu->orderu= 4;
- nu->bp= callocstructN(BPoint, 4, "addNurbprim3");
-
- bp= nu->bp;
- for(a=0;a<4;a++, bp++) {
- VECCOPY(bp->vec, cent);
- bp->vec[3]= 1.0;
- bp->f1= SELECT;
- bp->radius = bp->weight = 1.0;
- }
-
- bp= nu->bp;
- bp->vec[0]+= -1.5*grid;
- bp++;
- bp->vec[0]+= -grid;
- bp->vec[1]+= grid;
- bp++;
- bp->vec[0]+= grid;
- bp->vec[1]+= grid;
- bp++;
- bp->vec[0]+= 1.5*grid;
-
- bp= nu->bp;
- for(a=0;a<4;a++, bp++) Mat3MulVecfl(imat,bp->vec);
-
- if((type & 7)==4) {
- nu->knotsu= 0; /* makeknots allocates */
- makeknots(nu, 1, nu->flagu>>1);
- }
-
- }
- break;
- case 6: /* 5 point path */
- nu->pntsu= 5;
- nu->pntsv= 1;
- nu->orderu= 5;
- nu->flagu= 2; /* endpoint */
- nu->resolu= 8;
- nu->bp= callocstructN(BPoint, 5, "addNurbprim3");
-
- bp= nu->bp;
- for(a=0;a<5;a++, bp++) {
- VECCOPY(bp->vec, cent);
- bp->vec[3]= 1.0;
- bp->f1= SELECT;
- bp->radius = bp->weight = 1.0;
- }
-
- bp= nu->bp;
- bp->vec[0]+= -2.0*grid;
- bp++;
- bp->vec[0]+= -grid;
- bp++; bp++;
- bp->vec[0]+= grid;
- bp++;
- bp->vec[0]+= 2.0*grid;
-
- bp= nu->bp;
- for(a=0;a<5;a++, bp++) Mat3MulVecfl(imat,bp->vec);
-
- if((type & 7)==4) {
- nu->knotsu= 0; /* makeknots allocates */
- makeknots(nu, 1, nu->flagu>>1);
- }
-
- break;
- case 1: /* circle */
- nu->resolu= 12; /* set as 4 above */
- if(newname) {
- rename_id((ID *)G.obedit, "CurveCircle");
- rename_id((ID *)G.obedit->data, "CurveCircle");
- }
- if((type & 7)==CU_BEZIER) {
- nu->pntsu= 4;
- nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1");
- nu->flagu= CU_CYCLIC;
- bezt= nu->bezt;
-
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->h1= bezt->h2= HD_AUTO;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->vec[1][0]+= -grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
- bezt->radius = bezt->weight = 1.0;
-
- bezt++;
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->h1= bezt->h2= HD_AUTO;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->vec[1][1]+= grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
- bezt->radius = bezt->weight = 1.0;
-
- bezt++;
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->h1= bezt->h2= HD_AUTO;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->vec[1][0]+= grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
- bezt->radius = bezt->weight = 1.0;
-
- bezt++;
- for(a=0;a<3;a++) {
- VECCOPY(bezt->vec[a], cent);
- }
- bezt->h1= bezt->h2= HD_AUTO;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->vec[1][1]+= -grid;
- for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]);
- bezt->radius = bezt->weight = 1.0;
-
- calchandlesNurb(nu);
- }
- else if( (type & 7)==CU_NURBS ) { /* nurb */
- nu->pntsu= 8;
- nu->pntsv= 1;
- nu->orderu= 4;
- nu->bp= callocstructN(BPoint, 8, "addNurbprim6");
- nu->flagu= CU_CYCLIC;
- bp= nu->bp;
-
- for(a=0; a<8; a++) {
- bp->f1= SELECT;
- VECCOPY(bp->vec, cent);
-
- if(xzproj==0) {
- bp->vec[0]+= nurbcircle[a][0]*grid;
- bp->vec[1]+= nurbcircle[a][1]*grid;
- }
- else {
- bp->vec[0]+= 0.25*nurbcircle[a][0]*grid-.75*grid;
- bp->vec[2]+= 0.25*nurbcircle[a][1]*grid;
- }
- if(a & 1) bp->vec[3]= 0.25*sqrt(2.0);
- else bp->vec[3]= 1.0;
- Mat3MulVecfl(imat,bp->vec);
- bp->radius = bp->weight = 1.0;
-
- bp++;
- }
-
- makeknots(nu, 1, nu->flagu>>1);
- }
- break;
- case 2: /* 4x4 patch */
- if( (type & 7)==CU_NURBS ) { /* nurb */
- if(newname) {
- rename_id((ID *)G.obedit, "Surf");
- rename_id((ID *)G.obedit->data, "Surf");
- }
-
- nu->pntsu= 4;
- nu->pntsv= 4;
- nu->orderu= 4;
- nu->orderv= 4;
- nu->flag= CU_SMOOTH;
- nu->bp= callocstructN(BPoint, 4*4, "addNurbprim6");
- nu->flagu= 0;
- nu->flagv= 0;
- bp= nu->bp;
-
- for(a=0; a<4; a++) {
- for(b=0; b<4; b++) {
- VECCOPY(bp->vec, cent);
- bp->f1= SELECT;
- fac= (float)a -1.5;
- bp->vec[0]+= fac*grid;
- fac= (float)b -1.5;
- bp->vec[1]+= fac*grid;
- if(a==1 || a==2) if(b==1 || b==2) {
- bp->vec[2]+= grid;
- }
- Mat3MulVecfl(imat,bp->vec);
- bp->vec[3]= 1.0;
- bp++;
- }
- }
-
- makeknots(nu, 1, nu->flagu>>1);
- makeknots(nu, 2, nu->flagv>>1);
- }
- break;
- case 3: /* tube */
- if( (type & 7)==CU_NURBS ) {
- if(newname) {
- rename_id((ID *)G.obedit, "SurfTube");
- rename_id((ID *)G.obedit->data, "SurfTube");
- }
-
- nu= addNurbprim(4, 1, newname); /* circle */
- nu->resolu= 4;
- nu->flag= CU_SMOOTH;
- BLI_addtail(&editNurb, nu); /* temporal for extrude and translate */
- vec[0]=vec[1]= 0.0;
- vec[2]= -grid;
- Mat3MulVecfl(imat, vec);
- translateflagNurb(1, vec);
- extrudeflagNurb(1);
- vec[0]= -2*vec[0];
- vec[1]= -2*vec[1];
- vec[2]= -2*vec[2];
- translateflagNurb(1, vec);
-
- BLI_remlink(&editNurb, nu);
-
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a-- >0) {
- bp->f1 |= SELECT;
- bp++;
- }
- }
- break;
- case 4: /* sphere */
- if( (type & 7)==CU_NURBS ) {
- if(newname) {
- rename_id((ID *)G.obedit, "SurfSphere");
- rename_id((ID *)G.obedit->data, "SurfSphere");
- }
-
- nu->pntsu= 5;
- nu->pntsv= 1;
- nu->orderu= 3;
- nu->resolu= 4;
- nu->resolv= 4;
- nu->flag= CU_SMOOTH;
- nu->bp= callocstructN(BPoint, 5, "addNurbprim6");
- nu->flagu= 0;
- bp= nu->bp;
-
- for(a=0; a<5; a++) {
- bp->f1= SELECT;
- VECCOPY(bp->vec, cent);
- bp->vec[0]+= nurbcircle[a][0]*grid;
- bp->vec[2]+= nurbcircle[a][1]*grid;
- if(a & 1) bp->vec[3]= 0.5*sqrt(2.0);
- else bp->vec[3]= 1.0;
- Mat3MulVecfl(imat,bp->vec);
- bp++;
- }
- nu->flagu= 4;
- makeknots(nu, 1, nu->flagu>>1);
-
- BLI_addtail(&editNurb, nu); /* temporal for spin */
- if(newname && (U.flag & USER_ADD_VIEWALIGNED) == 0)
- spin_nurb(0, 2);
- else
- spin_nurb(0, 0);
-
- makeknots(nu, 2, nu->flagv>>1);
-
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a-- >0) {
- bp->f1 |= SELECT;
- bp++;
- }
- BLI_remlink(&editNurb, nu);
- }
- break;
- case 5: /* donut */
- if( (type & 7)==CU_NURBS ) {
- if(newname) {
- rename_id((ID *)G.obedit, "SurfDonut");
- rename_id((ID *)G.obedit->data, "SurfDonut");
- }
-
- xzproj= 1;
- nu= addNurbprim(4, 1, newname); /* circle */
- xzproj= 0;
- nu->resolu= 4;
- nu->resolv= 4;
- nu->flag= CU_SMOOTH;
- BLI_addtail(&editNurb, nu); /* temporal for extrude and translate */
- if(newname && (U.flag & USER_ADD_VIEWALIGNED) == 0)
- spin_nurb(0, 2);
- else
- spin_nurb(0, 0);
-
- BLI_remlink(&editNurb, nu);
-
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a-- >0) {
- bp->f1 |= SELECT;
- bp++;
- }
-
- }
- break;
- }
-
- /* always do: */
- nu->flag= CU_SMOOTH;
-
- test2DNurb(nu);
-
- return nu;
-}
-
-void default_curve_ipo(Curve *cu)
-{
- IpoCurve *icu;
- BezTriple *bezt;
-
- if(cu->ipo) return;
-
- cu->ipo= add_ipo("CurveIpo", ID_CU);
-
- icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
-
- icu->blocktype= ID_CU;
- icu->adrcode= CU_SPEED;
- icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ;
- set_icu_vars(icu);
-
- BLI_addtail( &(cu->ipo->curve), icu);
-
- icu->bezt= bezt= MEM_callocN(2*sizeof(BezTriple), "defaultipo");
- icu->totvert= 2;
-
- bezt->hide= IPO_BEZ;
- bezt->f1=bezt->f2= bezt->f3= SELECT;
- bezt->h1= bezt->h2= HD_AUTO;
- bezt++;
- bezt->vec[1][0]= 100.0;
- bezt->vec[1][1]= 1.0;
- bezt->hide= IPO_BEZ;
- bezt->f1=bezt->f2= bezt->f3= SELECT;
- bezt->h1= bezt->h2= HD_AUTO;
-
- calchandles_ipocurve(icu);
-}
-
-void add_primitiveCurve(int stype)
-{
- Nurb *nu;
- Curve *cu;
- int type, newname= 0;
-
- if(G.vd==0) return;
- if(G.scene->id.lib) return;
-
- /* this function also comes from an info window */
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
-
- if(stype>=10 && stype<20) type= CU_2D+1;
- else if(stype>=20 && stype<30) type= CU_2D+2;
- else if(stype>=30 && stype<40) type= CU_2D+3;
- else if(stype>=40 && stype<50) {
- if(stype==46) type= 4;
- else type= CU_2D+4;
- }
- else type= CU_2D;
-
- check_editmode(OB_CURVE);
-
- /* if no obedit: new object and enter editmode */
- if(G.obedit==NULL) {
- add_object_draw(OB_CURVE);
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
-
- where_is_object(G.obedit);
-
- make_editNurb();
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- newname= 1;
-
- cu= G.obedit->data;
- if(stype==46) {
- cu->flag |= (CU_3D+CU_PATH);
-
- default_curve_ipo(cu);
- }
- }
- else {
- cu= G.obedit->data;
- }
-
- if(cu->flag & CU_3D) type &= ~CU_2D;
-
- stype= (stype % 10);
-
- nu= addNurbprim(type, stype, newname); /* 2D */
-
- BLI_addtail(&editNurb, nu);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- countall();
-
- /* if a new object was created, it stores it in Curve, for reload original data and undo */
- if ( !(newname) || U.flag & USER_ADD_EDITMODE) {
- if(newname) load_editNurb();
- } else {
- exit_editmode(2);
- }
-
- allqueue(REDRAWALL, 0);
-
- BIF_undo_push("Add Curve");
-}
-
-void add_primitiveNurb(int type)
-{
- Nurb *nu;
- int newname= 0;
-
- if(G.scene->id.lib) return;
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
-
- check_editmode(OB_SURF);
-
- /* if no obedit: new object and enter editmode */
- if(G.obedit==0) {
- add_object_draw(OB_SURF);
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
-
- where_is_object(G.obedit);
-
- make_editNurb();
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- newname= 1;
- }
-
- nu= addNurbprim(4, type, newname);
- BLI_addtail(&editNurb,nu);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- countall();
-
- /* if a new object was created, it stores it in Curve, for reload original data and undo */
- if ( !(newname) || U.flag & USER_ADD_EDITMODE) {
- if(newname) load_editNurb();
- } else {
- exit_editmode(2);
- }
- allqueue(REDRAWALL, 0);
-
- BIF_undo_push("Add Surface");
-}
-
-
-
-void clear_tilt()
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- int a;
-
- if(okee("Clear tilt")==0) return;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if( nu->bezt ) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(BEZSELECTED_HIDDENHANDLES(bezt)) bezt->alfa= 0.0;
- bezt++;
- }
- }
- else if(nu->bp) {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) bp->alfa= 0.0;
- bp++;
- }
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Clear tilt");
-
-}
-
-int bezt_compare (const void *e1, const void *e2)
-{
- BezTriple *b1 = *((BezTriple**)e1);
- BezTriple *b2 = *((BezTriple**)e2);
-
- /* Check numerical values */
- float val = b1->vec[1][0] - b2->vec[1][0];
-
- if (val<0)
- return -1;
-
- if (val>0)
- return 1;
-
- /* Check selected flags : Ensures that selected keys will be listed first */
-
- if ((b1->f2 & SELECT) && !(b2->f2 & SELECT))
- return -1;
- if (!(b1->f2 & SELECT) && (b2->f2 & SELECT))
- return 1;
-
- return 0;
-}
-
-
-/* **************** undo for curves ************** */
-
-static void undoCurve_to_editCurve(void *lbv)
-{
- ListBase *lb= lbv;
- Nurb *nu, *newnu;
-
- freeNurblist(&editNurb);
-
- /* copy */
- for(nu= lb->first; nu; nu= nu->next) {
- newnu= duplicateNurb(nu);
- BLI_addtail(&editNurb, newnu);
- }
-}
-
-static void *editCurve_to_undoCurve(void)
-{
- ListBase *lb;
- Nurb *nu, *newnu;
-
- lb= MEM_callocN(sizeof(ListBase), "listbase undo");
-
- /* copy */
- for(nu= editNurb.first; nu; nu= nu->next) {
- newnu= duplicateNurb(nu);
- BLI_addtail(lb, newnu);
- }
- return lb;
-}
-
-static void free_undoCurve(void *lbv)
-{
- ListBase *lb= lbv;
-
- freeNurblist(lb);
- MEM_freeN(lb);
-}
-
-/* and this is all the undo system needs to know */
-void undo_push_curve(char *name)
-{
- undo_editmode_push(name, free_undoCurve, undoCurve_to_editCurve, editCurve_to_undoCurve, NULL);
-}
-
-
-
-/***/
diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c
deleted file mode 100644
index 8a07a4fddff..00000000000
--- a/source/blender/src/editdeform.c
+++ /dev/null
@@ -1,1085 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * Creator-specific support for vertex deformation groups
- * Added: apply deform function (ton)
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_cloth_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_depsgraph.h"
-#include "BKE_deform.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_interface.h"
-#include "BIF_editdeform.h"
-#include "BIF_editmesh.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_edit.h"
-
-#include "butspace.h"
-#include "mydevice.h"
-#include "editmesh.h"
-#include "multires.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* only in editmode */
-void sel_verts_defgroup (int select)
-{
- EditVert *eve;
- Object *ob;
- int i;
- MDeformVert *dvert;
-
- ob= G.obedit;
-
- if (!ob)
- return;
-
- switch (ob->type){
- case OB_MESH:
- for (eve=G.editMesh->verts.first; eve; eve=eve->next){
- dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT);
-
- if (dvert && dvert->totweight){
- for (i=0; i<dvert->totweight; i++){
- if (dvert->dw[i].def_nr == (ob->actdef-1)){
- if (select) eve->f |= SELECT;
- else eve->f &= ~SELECT;
-
- break;
- }
- }
- }
- }
- /* this has to be called, because this function operates on vertices only */
- if(select) EM_select_flush(); // vertices to edges/faces
- else EM_deselect_flush();
-
- break;
- case OB_LATTICE:
- if(editLatt->dvert) {
- BPoint *bp;
- int a, tot;
-
- dvert= editLatt->dvert;
-
- tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- for(a=0, bp= editLatt->def; a<tot; a++, bp++, dvert++) {
- for (i=0; i<dvert->totweight; i++){
- if (dvert->dw[i].def_nr == (ob->actdef-1)) {
- if(select) bp->f1 |= SELECT;
- else bp->f1 &= ~SELECT;
-
- break;
- }
- }
- }
- }
- break;
-
- default:
- break;
- }
-
- countall();
-
-}
-
-/* check if deform vertex has defgroup index */
-MDeformWeight *get_defweight (MDeformVert *dv, int defgroup)
-{
- int i;
-
- if (!dv || defgroup<0)
- return NULL;
-
- for (i=0; i<dv->totweight; i++){
- if (dv->dw[i].def_nr == defgroup)
- return dv->dw+i;
- }
- return NULL;
-}
-
-/* Ensures that mv has a deform weight entry for
- the specified defweight group */
-/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */
-MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup)
-{
- MDeformWeight *newdw;
-
- /* do this check always, this function is used to check for it */
- if (!dv || defgroup<0)
- return NULL;
-
- newdw = get_defweight (dv, defgroup);
- if (newdw)
- return newdw;
-
- newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight");
- if (dv->dw){
- memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
- MEM_freeN (dv->dw);
- }
- dv->dw=newdw;
-
- dv->dw[dv->totweight].weight=0.0f;
- dv->dw[dv->totweight].def_nr=defgroup;
- /* Group index */
-
- dv->totweight++;
-
- return dv->dw+(dv->totweight-1);
-}
-
-void add_defgroup (Object *ob)
-{
- add_defgroup_name (ob, "Group");
-}
-
-bDeformGroup *add_defgroup_name (Object *ob, char *name)
-{
- bDeformGroup *defgroup;
-
- if (!ob)
- return NULL;
-
- defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup");
-
- BLI_strncpy (defgroup->name, name, 32);
-
- BLI_addtail(&ob->defbase, defgroup);
- unique_vertexgroup_name(defgroup, ob);
-
- ob->actdef = BLI_countlist(&ob->defbase);
-
- return defgroup;
-}
-
-void duplicate_defgroup ( Object *ob )
-{
- bDeformGroup *dg, *cdg;
- char name[32], s[32];
- MDeformWeight *org, *cpy;
- MDeformVert *dvert;
- Mesh *me;
- int i, idg, icdg;
-
- if (ob->type != OB_MESH)
- return;
-
- dg = BLI_findlink (&ob->defbase, (ob->actdef-1));
- if (!dg)
- return;
-
- if (strstr(dg->name, "_copy")) {
- BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */
- } else {
- BLI_snprintf (name, 32, "%s_copy", dg->name);
- while (get_named_vertexgroup (ob, name)) {
- if ((strlen (name) + 6) > 32) {
- error ("Error: the name for the new group is > 32 characters");
- return;
- }
- strcpy (s, name);
- BLI_snprintf (name, 32, "%s_copy", s);
- }
- }
-
- cdg = copy_defgroup (dg);
- strcpy (cdg->name, name);
- unique_vertexgroup_name(cdg, ob);
-
- BLI_addtail (&ob->defbase, cdg);
-
- idg = (ob->actdef-1);
- ob->actdef = BLI_countlist (&ob->defbase);
- icdg = (ob->actdef-1);
-
- me = get_mesh (ob);
- if (!me->dvert)
- return;
-
- for (i = 0; i < me->totvert; i++) {
- dvert = me->dvert+i;
- org = get_defweight (dvert, idg);
- if (org) {
- cpy = verify_defweight (dvert, icdg);
- cpy->weight = org->weight;
- }
- }
-}
-
-static void del_defgroup_update_users(Object *ob, int id)
-{
- ExplodeModifierData *emd;
- ModifierData *md;
- ParticleSystem *psys;
- ClothModifierData *clmd;
- ClothSimSettings *clsim;
- int a;
-
- /* these cases don't use names to refer to vertex groups, so when
- * they get deleted the numbers get out of sync, this corrects that */
-
- if(ob->soft) {
- if(ob->soft->vertgroup == id)
- ob->soft->vertgroup= 0;
- else if(ob->soft->vertgroup > id)
- ob->soft->vertgroup--;
- }
-
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_Explode) {
- emd= (ExplodeModifierData*)md;
-
- if(emd->vgroup == id)
- emd->vgroup= 0;
- else if(emd->vgroup > id)
- emd->vgroup--;
- }
- else if(md->type == eModifierType_Cloth) {
- clmd= (ClothModifierData*)md;
- clsim= clmd->sim_parms;
-
- if(clsim) {
- if(clsim->vgroup_mass == id)
- clsim->vgroup_mass= 0;
- else if(clsim->vgroup_mass > id)
- clsim->vgroup_mass--;
-
- if(clsim->vgroup_bend == id)
- clsim->vgroup_bend= 0;
- else if(clsim->vgroup_bend > id)
- clsim->vgroup_bend--;
-
- if(clsim->vgroup_struct == id)
- clsim->vgroup_struct= 0;
- else if(clsim->vgroup_struct > id)
- clsim->vgroup_struct--;
- }
- }
- }
-
- for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- for(a=0; a<PSYS_TOT_VG; a++)
- if(psys->vgroup[a] == id)
- psys->vgroup[a]= 0;
- else if(psys->vgroup[a] > id)
- psys->vgroup[a]--;
- }
-}
-
-void del_defgroup_in_object_mode ( Object *ob )
-{
- bDeformGroup *dg;
- MDeformVert *dvert;
- Mesh *me;
- int i, e;
-
- if ((!ob) || (ob->type != OB_MESH))
- return;
-
- dg = BLI_findlink (&ob->defbase, (ob->actdef-1));
- if (!dg)
- return;
-
- me = get_mesh (ob);
- if (me->dvert) {
- for (i = 0; i < me->totvert; i++) {
- dvert = me->dvert + i;
- if (dvert) {
- if (get_defweight (dvert, (ob->actdef-1)))
- remove_vert_defgroup (ob, dg, i);
- }
- }
-
- for (i = 0; i < me->totvert; i++) {
- dvert = me->dvert+i;
- if (dvert) {
- for (e = 0; e < dvert->totweight; e++) {
- if (dvert->dw[e].def_nr > (ob->actdef-1))
- dvert->dw[e].def_nr--;
- }
- }
- }
- }
-
- del_defgroup_update_users(ob, ob->actdef);
-
- /* Update the active deform index if necessary */
- if (ob->actdef == BLI_countlist(&ob->defbase))
- ob->actdef--;
-
- /* Remove the group */
- BLI_freelinkN (&ob->defbase, dg);
-}
-
-void del_defgroup (Object *ob)
-{
- bDeformGroup *defgroup;
- int i;
-
- if (!ob)
- return;
-
- if (!ob->actdef)
- return;
-
- defgroup = BLI_findlink(&ob->defbase, ob->actdef-1);
- if (!defgroup)
- return;
-
- /* Make sure that no verts are using this group */
- remove_verts_defgroup(1);
-
- /* Make sure that any verts with higher indices are adjusted accordingly */
- if(ob->type==OB_MESH) {
- EditMesh *em = G.editMesh;
- EditVert *eve;
- MDeformVert *dvert;
-
- for (eve=em->verts.first; eve; eve=eve->next){
- dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT);
-
- if (dvert)
- for (i=0; i<dvert->totweight; i++)
- if (dvert->dw[i].def_nr > (ob->actdef-1))
- dvert->dw[i].def_nr--;
- }
- }
- else {
- BPoint *bp;
- MDeformVert *dvert= editLatt->dvert;
- int a, tot;
-
- if (dvert) {
- tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- for(a=0, bp= editLatt->def; a<tot; a++, bp++, dvert++) {
- for (i=0; i<dvert->totweight; i++){
- if (dvert->dw[i].def_nr > (ob->actdef-1))
- dvert->dw[i].def_nr--;
- }
- }
- }
- }
-
- del_defgroup_update_users(ob, ob->actdef);
-
- /* Update the active deform index if necessary */
- if (ob->actdef==BLI_countlist(&ob->defbase))
- ob->actdef--;
-
- /* Remove the group */
- BLI_freelinkN (&ob->defbase, defgroup);
-
- /* remove all dverts */
- if(ob->actdef==0) {
- if(ob->type==OB_MESH) {
- Mesh *me= ob->data;
- CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
- me->dvert= NULL;
- }
- else {
- if (editLatt->dvert) {
- MEM_freeN(editLatt->dvert);
- editLatt->dvert= NULL;
- }
- }
- }
-}
-
-void del_all_defgroups (Object *ob)
-{
- /* Sanity check */
- if (ob == NULL)
- return;
-
- /* Remove all DVerts */
- if (ob->type==OB_MESH) {
- Mesh *me= ob->data;
- CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert);
- me->dvert= NULL;
- }
- else {
- if (editLatt->dvert) {
- MEM_freeN(editLatt->dvert);
- editLatt->dvert= NULL;
- }
- }
-
- /* Remove all DefGroups */
- BLI_freelistN(&ob->defbase);
-
- /* Fix counters/indices */
- ob->actdef= 0;
-}
-
-void create_dverts(ID *id)
-{
- /* create deform verts
- */
-
- if( GS(id->name)==ID_ME) {
- Mesh *me= (Mesh *)id;
- me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert);
- }
- else if( GS(id->name)==ID_LT) {
- Lattice *lt= (Lattice *)id;
- lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert");
- }
-}
-
-/* for mesh in object mode
- lattice can be in editmode */
-void remove_vert_def_nr (Object *ob, int def_nr, int vertnum)
-{
- /* This routine removes the vertex from the deform
- * group with number def_nr.
- *
- * This routine is meant to be fast, so it is the
- * responsibility of the calling routine to:
- * a) test whether ob is non-NULL
- * b) test whether ob is a mesh
- * c) calculate def_nr
- */
-
- MDeformWeight *newdw;
- MDeformVert *dvert= NULL;
- int i;
-
- /* get the deform vertices corresponding to the
- * vertnum
- */
- if(ob->type==OB_MESH) {
- if( ((Mesh*)ob->data)->dvert )
- dvert = ((Mesh*)ob->data)->dvert + vertnum;
- }
- else if(ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
-
- if(ob==G.obedit)
- lt= editLatt;
-
- if(lt->dvert)
- dvert = lt->dvert + vertnum;
- }
-
- if(dvert==NULL)
- return;
-
- /* for all of the deform weights in the
- * deform vert
- */
- for (i=dvert->totweight - 1 ; i>=0 ; i--){
-
- /* if the def_nr is the same as the one
- * for our weight group then remove it
- * from this deform vert.
- */
- if (dvert->dw[i].def_nr == def_nr) {
- dvert->totweight--;
-
- /* if there are still other deform weights
- * attached to this vert then remove this
- * deform weight, and reshuffle the others
- */
- if (dvert->totweight) {
- newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight),
- "deformWeight");
- if (dvert->dw){
- memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i);
- memcpy (newdw+i, dvert->dw+i+1,
- sizeof(MDeformWeight)*(dvert->totweight-i));
- MEM_freeN (dvert->dw);
- }
- dvert->dw=newdw;
- }
- /* if there are no other deform weights
- * left then just remove the deform weight
- */
- else {
- MEM_freeN (dvert->dw);
- dvert->dw = NULL;
- break;
- }
- }
- }
-
-}
-
-/* for Mesh in Object mode */
-/* allows editmode for Lattice */
-void add_vert_defnr (Object *ob, int def_nr, int vertnum,
- float weight, int assignmode)
-{
- /* add the vert to the deform group with the
- * specified number
- */
- MDeformVert *dv= NULL;
- MDeformWeight *newdw;
- int i;
-
- /* get the vert */
- if(ob->type==OB_MESH) {
- if(((Mesh*)ob->data)->dvert)
- dv = ((Mesh*)ob->data)->dvert + vertnum;
- }
- else if(ob->type==OB_LATTICE) {
- Lattice *lt;
-
- if(ob==G.obedit)
- lt= editLatt;
- else
- lt= ob->data;
-
- if(lt->dvert)
- dv = lt->dvert + vertnum;
- }
-
- if(dv==NULL)
- return;
-
- /* Lets first check to see if this vert is
- * already in the weight group -- if so
- * lets update it
- */
- for (i=0; i<dv->totweight; i++){
-
- /* if this weight cooresponds to the
- * deform group, then add it using
- * the assign mode provided
- */
- if (dv->dw[i].def_nr == def_nr){
-
- switch (assignmode) {
- case WEIGHT_REPLACE:
- dv->dw[i].weight=weight;
- break;
- case WEIGHT_ADD:
- dv->dw[i].weight+=weight;
- if (dv->dw[i].weight >= 1.0)
- dv->dw[i].weight = 1.0;
- break;
- case WEIGHT_SUBTRACT:
- dv->dw[i].weight-=weight;
- /* if the weight is zero or less then
- * remove the vert from the deform group
- */
- if (dv->dw[i].weight <= 0.0)
- remove_vert_def_nr(ob, def_nr, vertnum);
- break;
- }
- return;
- }
- }
-
- /* if the vert wasn't in the deform group then
- * we must take a different form of action ...
- */
-
- switch (assignmode) {
- case WEIGHT_SUBTRACT:
- /* if we are subtracting then we don't
- * need to do anything
- */
- return;
-
- case WEIGHT_REPLACE:
- case WEIGHT_ADD:
- /* if we are doing an additive assignment, then
- * we need to create the deform weight
- */
- newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1),
- "deformWeight");
- if (dv->dw){
- memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight);
- MEM_freeN (dv->dw);
- }
- dv->dw=newdw;
-
- dv->dw[dv->totweight].weight=weight;
- dv->dw[dv->totweight].def_nr=def_nr;
-
- dv->totweight++;
- break;
- }
-}
-
-/* called while not in editmode */
-void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum,
- float weight, int assignmode)
-{
- /* add the vert to the deform group with the
- * specified assign mode
- */
- int def_nr;
-
- /* get the deform group number, exit if
- * it can't be found
- */
- def_nr = get_defgroup_num(ob, dg);
- if (def_nr < 0) return;
-
- /* if there's no deform verts then
- * create some
- */
- if(ob->type==OB_MESH) {
- if (!((Mesh*)ob->data)->dvert)
- create_dverts(ob->data);
- }
- else if(ob->type==OB_LATTICE) {
- if (!((Lattice*)ob->data)->dvert)
- create_dverts(ob->data);
- }
-
- /* call another function to do the work
- */
- add_vert_defnr (ob, def_nr, vertnum, weight, assignmode);
-}
-
-/* Only available in editmode */
-void assign_verts_defgroup (void)
-{
- extern float editbutvweight; /* buttons.c */
- Object *ob;
- EditVert *eve;
- bDeformGroup *dg, *eg;
- MDeformWeight *newdw;
- MDeformVert *dvert;
- int i, done;
-
- if(multires_level1_test()) return;
-
- ob= G.obedit;
-
- if (!ob)
- return;
-
- dg=BLI_findlink(&ob->defbase, ob->actdef-1);
- if (!dg){
- error ("No vertex group is active");
- return;
- }
-
- switch (ob->type){
- case OB_MESH:
- if (!CustomData_has_layer(&G.editMesh->vdata, CD_MDEFORMVERT))
- EM_add_data_layer(&G.editMesh->vdata, CD_MDEFORMVERT);
-
- /* Go through the list of editverts and assign them */
- for (eve=G.editMesh->verts.first; eve; eve=eve->next){
- dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT);
-
- if (dvert && (eve->f & 1)){
- done=0;
- /* See if this vert already has a reference to this group */
- /* If so: Change its weight */
- done=0;
- for (i=0; i<dvert->totweight; i++){
- eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
- /* Find the actual group */
- if (eg==dg){
- dvert->dw[i].weight=editbutvweight;
- done=1;
- break;
- }
- }
- /* If not: Add the group and set its weight */
- if (!done){
- newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight");
- if (dvert->dw){
- memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight);
- MEM_freeN (dvert->dw);
- }
- dvert->dw=newdw;
-
- dvert->dw[dvert->totweight].weight= editbutvweight;
- dvert->dw[dvert->totweight].def_nr= ob->actdef-1;
-
- dvert->totweight++;
-
- }
- }
- }
- break;
- case OB_LATTICE:
- {
- BPoint *bp;
- int a, tot;
-
- if(editLatt->dvert==NULL)
- create_dverts(&editLatt->id);
-
- tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- for(a=0, bp= editLatt->def; a<tot; a++, bp++) {
- if(bp->f1 & SELECT)
- add_vert_defnr (ob, ob->actdef-1, a, editbutvweight, WEIGHT_REPLACE);
- }
- }
- break;
- default:
- printf ("Assigning deformation groups to unknown object type\n");
- break;
- }
-
-}
-
-/* mesh object mode, lattice can be in editmode */
-void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum)
-{
- /* This routine removes the vertex from the specified
- * deform group.
- */
-
- int def_nr;
-
- /* if the object is NULL abort
- */
- if (!ob)
- return;
-
- /* get the deform number that cooresponds
- * to this deform group, and abort if it
- * can not be found.
- */
- def_nr = get_defgroup_num(ob, dg);
- if (def_nr < 0) return;
-
- /* call another routine to do the work
- */
- remove_vert_def_nr (ob, def_nr, vertnum);
-}
-
-/* for mesh in object mode lattice can be in editmode */
-static float get_vert_def_nr (Object *ob, int def_nr, int vertnum)
-{
- MDeformVert *dvert= NULL;
- int i;
-
- /* get the deform vertices corresponding to the
- * vertnum
- */
- if(ob->type==OB_MESH) {
- if( ((Mesh*)ob->data)->dvert )
- dvert = ((Mesh*)ob->data)->dvert + vertnum;
- }
- else if(ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
-
- if(ob==G.obedit)
- lt= editLatt;
-
- if(lt->dvert)
- dvert = lt->dvert + vertnum;
- }
-
- if(dvert==NULL)
- return 0.0f;
-
- for(i=dvert->totweight-1 ; i>=0 ; i--)
- if(dvert->dw[i].def_nr == def_nr)
- return dvert->dw[i].weight;
-
- return 0.0f;
-}
-
-/* mesh object mode, lattice can be in editmode */
-float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum)
-{
- int def_nr;
-
- if(!ob)
- return 0.0f;
-
- def_nr = get_defgroup_num(ob, dg);
- if(def_nr < 0) return 0.0f;
-
- return get_vert_def_nr (ob, def_nr, vertnum);
-}
-
-/* Only available in editmode */
-/* removes from active defgroup, if allverts==0 only selected vertices */
-void remove_verts_defgroup (int allverts)
-{
- Object *ob;
- EditVert *eve;
- MDeformVert *dvert;
- MDeformWeight *newdw;
- bDeformGroup *dg, *eg;
- int i;
-
- if(multires_level1_test()) return;
-
- ob= G.obedit;
-
- if (!ob)
- return;
-
- dg=BLI_findlink(&ob->defbase, ob->actdef-1);
- if (!dg){
- error ("No vertex group is active");
- return;
- }
-
- switch (ob->type){
- case OB_MESH:
- for (eve=G.editMesh->verts.first; eve; eve=eve->next){
- dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT);
-
- if (dvert && dvert->dw && ((eve->f & 1) || allverts)){
- for (i=0; i<dvert->totweight; i++){
- /* Find group */
- eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
- if (eg == dg){
- dvert->totweight--;
- if (dvert->totweight){
- newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight");
-
- if (dvert->dw){
- memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i);
- memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i));
- MEM_freeN (dvert->dw);
- }
- dvert->dw=newdw;
- }
- else{
- MEM_freeN (dvert->dw);
- dvert->dw=NULL;
- break;
- }
- }
- }
- }
- }
- break;
- case OB_LATTICE:
-
- if(editLatt->dvert) {
- BPoint *bp;
- int a, tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- for(a=0, bp= editLatt->def; a<tot; a++, bp++) {
- if(allverts || (bp->f1 & SELECT))
- remove_vert_defgroup (ob, dg, a);
- }
- }
- break;
-
- default:
- printf ("Removing deformation groups from unknown object type\n");
- break;
- }
-}
-
-/* Only available in editmode */
-/* removes from all defgroup, if allverts==0 only selected vertices */
-void remove_verts_defgroups(int allverts)
-{
- Object *ob;
- int actdef, defCount;
-
- if (multires_level1_test()) return;
-
- ob= G.obedit;
- if (ob == NULL) return;
-
- actdef= ob->actdef;
- defCount= BLI_countlist(&ob->defbase);
-
- if (defCount == 0) {
- error("Object has no vertex groups");
- return;
- }
-
- /* To prevent code redundancy, we just use remove_verts_defgroup, but that
- * only operates on the active vgroup. So we iterate through all groups, by changing
- * active group index
- */
- for (ob->actdef= 1; ob->actdef <= defCount; ob->actdef++)
- remove_verts_defgroup(allverts);
-
- ob->actdef= actdef;
-}
-
-void vertexgroup_select_by_name(Object *ob, char *name)
-{
- bDeformGroup *curdef;
- int actdef= 1;
-
- if(ob==NULL) return;
-
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){
- if (!strcmp(curdef->name, name)) {
- ob->actdef= actdef;
- return;
- }
- }
- ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */
-}
-
-/* This function provides a shortcut for adding/removing verts from
- * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes
- * and Lattices. (currently only restricted to those two)
- * It is only responsible for
- */
-void vgroup_assign_with_menu(void)
-{
- Object *ob= G.obedit;
- int defCount;
- int mode;
-
- /* prevent crashes */
- if (ob==NULL) return;
-
- defCount= BLI_countlist(&ob->defbase);
-
- /* give user choices of adding to current/new or removing from current */
- if (defCount && ob->actdef)
- mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3|Remove Selected from All Groups %x4");
- else
- mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1");
-
- /* handle choices */
- switch (mode) {
- case 1: /* add to new group */
- add_defgroup(ob);
- assign_verts_defgroup();
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Assign to vertex group");
- break;
- case 2: /* add to current group */
- assign_verts_defgroup();
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Assign to vertex group");
- break;
- case 3: /* remove from current group */
- remove_verts_defgroup(0);
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Remove from vertex group");
- break;
- case 4: /* remove from all groups */
- remove_verts_defgroups(0);
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Remove from all vertex groups");
- break;
- }
-}
-
-/* This function provides a shortcut for commonly used vertex group
- * functions - change weight (not implemented), change active group, delete active group,
- * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now).
- */
-void vgroup_operation_with_menu(void)
-{
- Object *ob= G.obedit;
- int defCount;
- int mode;
-
- /* prevent crashes and useless cases */
- if (ob==NULL) return;
-
- defCount= BLI_countlist(&ob->defbase);
- if (defCount == 0) return;
-
- /* give user choices of adding to current/new or removing from current */
- if (ob->actdef)
- mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3");
- else
- mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3");
-
- /* handle choices */
- switch (mode) {
- case 1: /* change active group*/
- {
- char *menustr= get_vertexgroup_menustr(ob);
- short nr;
-
- if (menustr) {
- nr= pupmenu(menustr);
-
- if ((nr >= 1) && (nr <= defCount))
- ob->actdef= nr;
-
- MEM_freeN(menustr);
- }
- allqueue(REDRAWBUTSALL, 0);
- }
- break;
- case 2: /* delete active group */
- {
- del_defgroup(ob);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Delete vertex group");
- }
- break;
- case 3: /* delete all groups */
- {
- del_all_defgroups(ob);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSEDIT, 1);
- BIF_undo_push("Delete all vertex groups");
- }
- break;
- }
-}
-
-/* ******************* other deform edit stuff ********** */
-
-void object_apply_deform(Object *ob)
-{
- notice("Apply Deformation now only availble in Modifier buttons");
-}
-
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c
deleted file mode 100644
index 53fb6dbffb1..00000000000
--- a/source/blender/src/editface.c
+++ /dev/null
@@ -1,1456 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#include <math.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_heap.h"
-#include "BLI_edgehash.h"
-#include "BLI_editVert.h"
-
-#include "MTC_matrixops.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_brush.h"
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_multires.h"
-#include "BKE_object.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_customdata.h"
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-#include "BSE_drawview.h" /* for backdrawview3d */
-
-#include "BIF_editsima.h"
-#include "BIF_editmesh.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_toolbox.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_space.h" /* for allqueue */
-#include "BIF_drawimage.h" /* for allqueue */
-
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-
-#include "GPU_draw.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "butspace.h"
-
-#include "BSE_trans_types.h"
-
-#include "BDR_unwrapper.h"
-#include "BDR_editobject.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-/* Pupmenu codes: */
-#define UV_CUBE_MAPPING 2
-#define UV_CYL_MAPPING 3
-#define UV_SPHERE_MAPPING 4
-#define UV_BOUNDS_MAPPING 5
-#define UV_RESET_MAPPING 6
-#define UV_WINDOW_MAPPING 7
-#define UV_UNWRAP_MAPPING 8
-#define UV_CYL_EX 32
-#define UV_SPHERE_EX 34
-
-/* Some macro tricks to make pupmenu construction look nicer :-)
- Sorry, just did it for fun. */
-
-#define _STR(x) " " #x
-#define STRING(x) _STR(x)
-
-#define MENUSTRING(string, code) string " %x" STRING(code)
-#define MENUTITLE(string) string " %t|"
-
-
-/* returns 0 if not found, otherwise 1 */
-int facesel_face_pick(Mesh *me, short *mval, unsigned int *index, short rect)
-{
- if (!me || me->totface==0)
- return 0;
-
- if (G.vd->flag & V3D_NEEDBACKBUFDRAW) {
- check_backbuf();
- persp(PERSP_VIEW);
- }
-
- if (rect) {
- /* sample rect to increase changes of selecting, so that when clicking
- on an edge in the backbuf, we can still select a face */
- int dist;
- *index = sample_backbuf_rect(mval, 3, 1, me->totface+1, &dist,0,NULL);
- }
- else
- /* sample only on the exact position */
- *index = sample_backbuf(mval[0], mval[1]);
-
- if ((*index)<=0 || (*index)>(unsigned int)me->totface)
- return 0;
-
- (*index)--;
-
- return 1;
-}
-
-/* only operates on the edit object - this is all thats needed at the moment */
-static void uv_calc_center_vector(float *result, Object *ob, EditMesh *em)
-{
- float min[3], max[3], *cursx;
-
- EditFace *efa;
- switch (G.vd->around)
- {
- case V3D_CENTER: /* bounding box center */
- min[0]= min[1]= min[2]= 1e20f;
- max[0]= max[1]= max[2]= -1e20f;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- DO_MINMAX(efa->v1->co, min, max);
- DO_MINMAX(efa->v2->co, min, max);
- DO_MINMAX(efa->v3->co, min, max);
- if(efa->v4) DO_MINMAX(efa->v4->co, min, max);
- }
- }
- VecMidf(result, min, max);
- break;
- case V3D_CURSOR: /*cursor center*/
- cursx= give_cursor();
- /* shift to objects world */
- result[0]= cursx[0]-ob->obmat[3][0];
- result[1]= cursx[1]-ob->obmat[3][1];
- result[2]= cursx[2]-ob->obmat[3][2];
- break;
- case V3D_LOCAL: /*object center*/
- case V3D_CENTROID: /* multiple objects centers, only one object here*/
- default:
- result[0]= result[1]= result[2]= 0.0;
- break;
- }
-}
-
-static void uv_calc_map_matrix(float result[][4], Object *ob, float upangledeg, float sideangledeg, float radius)
-{
- float rotup[4][4], rotside[4][4], viewmatrix[4][4], rotobj[4][4];
- float sideangle= 0.0, upangle= 0.0;
- int k;
-
- /* get rotation of the current view matrix */
- Mat4CpyMat4(viewmatrix,G.vd->viewmat);
- /* but shifting */
- for( k= 0; k< 4; k++) viewmatrix[3][k] =0.0;
-
- /* get rotation of the current object matrix */
- Mat4CpyMat4(rotobj,ob->obmat);
- /* but shifting */
- for( k= 0; k< 4; k++) rotobj[3][k] =0.0;
-
- Mat4Clr(*rotup);
- Mat4Clr(*rotside);
-
- /* compensate front/side.. against opengl x,y,z world definition */
- /* this is "kanonen gegen spatzen", a few plus minus 1 will do here */
- /* i wanted to keep the reason here, so we're rotating*/
- sideangle= M_PI * (sideangledeg + 180.0) /180.0;
- rotside[0][0]= (float)cos(sideangle);
- rotside[0][1]= -(float)sin(sideangle);
- rotside[1][0]= (float)sin(sideangle);
- rotside[1][1]= (float)cos(sideangle);
- rotside[2][2]= 1.0f;
-
- upangle= M_PI * upangledeg /180.0;
- rotup[1][1]= (float)cos(upangle)/radius;
- rotup[1][2]= -(float)sin(upangle)/radius;
- rotup[2][1]= (float)sin(upangle)/radius;
- rotup[2][2]= (float)cos(upangle)/radius;
- rotup[0][0]= (float)1.0/radius;
-
- /* calculate transforms*/
- Mat4MulSerie(result,rotup,rotside,viewmatrix,rotobj,NULL,NULL,NULL,NULL);
-}
-
-static void uv_calc_shift_project(float *target, float *shift, float rotmat[][4], int projectionmode, float *source, float *min, float *max)
-{
- float pv[3];
-
- VecSubf(pv, source, shift);
- Mat4MulVecfl(rotmat, pv);
-
- switch(projectionmode) {
- case B_UVAUTO_CYLINDER:
- tubemap(pv[0], pv[1], pv[2], &target[0],&target[1]);
- /* split line is always zero */
- if (target[0] >= 1.0f) target[0] -= 1.0f;
- break;
-
- case B_UVAUTO_SPHERE:
- spheremap(pv[0], pv[1], pv[2], &target[0],&target[1]);
- /* split line is always zero */
- if (target[0] >= 1.0f) target[0] -= 1.0f;
- break;
-
- case 3: /* ortho special case for BOUNDS */
- target[0] = -pv[0];
- target[1] = pv[2];
- break;
-
- case 4:
- {
- /* very special case for FROM WINDOW */
- float pv4[4], dx, dy, x= 0.0, y= 0.0;
-
- dx= G.vd->area->winx;
- dy= G.vd->area->winy;
-
- VecCopyf(pv4, source);
- pv4[3] = 1.0;
-
- /* rotmat is the object matrix in this case */
- Mat4MulVec4fl(rotmat,pv4);
-
- /* almost project_short */
- Mat4MulVec4fl(G.vd->persmat,pv4);
- if (fabs(pv4[3]) > 0.00001) { /* avoid division by zero */
- target[0] = dx/2.0 + (dx/2.0)*pv4[0]/pv4[3];
- target[1] = dy/2.0 + (dy/2.0)*pv4[1]/pv4[3];
- }
- else {
- /* scaling is lost but give a valid result */
- target[0] = dx/2.0 + (dx/2.0)*pv4[0];
- target[1] = dy/2.0 + (dy/2.0)*pv4[1];
- }
-
- /* G.vd->persmat seems to do this funky scaling */
- if(dx > dy) {
- y= (dx-dy)/2.0;
- dy = dx;
- }
- else {
- x= (dy-dx)/2.0;
- dx = dy;
- }
- target[0]= (x + target[0])/dx;
- target[1]= (y + target[1])/dy;
-
- }
- break;
-
- default:
- target[0] = 0.0;
- target[1] = 1.0;
- }
-
- /* we know the values here and may need min_max later */
- /* max requests independand from min; not fastest but safest */
- if(min) {
- min[0] = MIN2(target[0], min[0]);
- min[1] = MIN2(target[1], min[1]);
- }
- if(max) {
- max[0] = MAX2(target[0], max[0]);
- max[1] = MAX2(target[1], max[1]);
- }
-}
-
-static void correct_uv_aspect( void )
-{
- float aspx=1, aspy=1;
- EditMesh *em = G.editMesh;
- EditFace *efa = EM_get_actFace(1);
- MTFace *tface;
-
- if (efa) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- image_final_aspect(tface->tpage, &aspx, &aspy);
- }
-
- if (aspx != aspy) {
-
- EditMesh *em = G.editMesh;
- float scale;
-
- if (aspx > aspy) {
- scale = aspy/aspx;
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tface->uv[0][0] = ((tface->uv[0][0]-0.5)*scale)+0.5;
- tface->uv[1][0] = ((tface->uv[1][0]-0.5)*scale)+0.5;
- tface->uv[2][0] = ((tface->uv[2][0]-0.5)*scale)+0.5;
- if(efa->v4) {
- tface->uv[3][0] = ((tface->uv[3][0]-0.5)*scale)+0.5;
- }
- }
- }
- } else {
- scale = aspx/aspy;
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tface->uv[0][1] = ((tface->uv[0][1]-0.5)*scale)+0.5;
- tface->uv[1][1] = ((tface->uv[1][1]-0.5)*scale)+0.5;
- tface->uv[2][1] = ((tface->uv[2][1]-0.5)*scale)+0.5;
- if(efa->v4) {
- tface->uv[3][1] = ((tface->uv[3][1]-0.5)*scale)+0.5;
- }
- }
- }
- }
- }
-}
-
-void calculate_uv_map(unsigned short mapmode)
-{
- MTFace *tface;
- Object *ob;
- float dx, dy, rotatematrix[4][4], radius= 1.0, min[3], cent[3], max[3];
- float fac= 1.0, upangledeg= 0.0, sideangledeg= 90.0;
- int i, b, mi, n;
-
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- if(G.scene->toolsettings->uvcalc_mapdir==1) {
- upangledeg= 90.0;
- sideangledeg= 0.0;
- } else {
- upangledeg= 0.0;
- if(G.scene->toolsettings->uvcalc_mapalign==1) sideangledeg= 0.0;
- else sideangledeg= 90.0;
- }
-
- /* add uvs if there not here */
- if (!EM_texFaceCheck()) {
- if (em && em->faces.first)
- EM_add_data_layer(&em->fdata, CD_MTFACE);
-
- if (G.sima && G.sima->image) /* this is a bit of a kludge, but assume they want the image on their mesh when UVs are added */
- image_changed(G.sima, G.sima->image);
-
- if (!EM_texFaceCheck())
- return;
-
- /* select new UV's */
- if ((G.sima && G.sima->flag & SI_SYNC_UVSEL)==0) {
- for(efa=em->faces.first; efa; efa=efa->next) {
- MTFace *tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- simaFaceSel_Set(efa, tf);
- }
- }
- }
-
- ob=OBACT;
-
- switch(mapmode) {
- case B_UVAUTO_BOUNDS:
- min[0]= min[1]= 10000000.0;
- max[0]= max[1]= -10000000.0;
-
- cent[0] = cent[1] = cent[2] = 0.0;
- uv_calc_map_matrix(rotatematrix, ob, upangledeg, sideangledeg, 1.0f);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_calc_shift_project(tface->uv[0],cent,rotatematrix,3, efa->v1->co, min,max);
- uv_calc_shift_project(tface->uv[1],cent,rotatematrix,3, efa->v2->co, min,max);
- uv_calc_shift_project(tface->uv[2],cent,rotatematrix,3, efa->v3->co,min,max);
- if(efa->v4)
- uv_calc_shift_project(tface->uv[3],cent,rotatematrix,3, efa->v4->co,min,max);
- }
- }
-
- /* rescale UV to be in 1/1 */
- dx= (max[0]-min[0]);
- dy= (max[1]-min[1]);
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if(efa->v4) b= 3; else b= 2;
- for(; b>=0; b--) {
- tface->uv[b][0]= ((tface->uv[b][0]-min[0])*fac)/dx;
- tface->uv[b][1]= 1.0-fac+((tface->uv[b][1]-min[1])/* *fac */)/dy;
- }
- }
- }
- break;
-
- case B_UVAUTO_WINDOW:
- cent[0] = cent[1] = cent[2] = 0.0;
- Mat4CpyMat4(rotatematrix,ob->obmat);
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_calc_shift_project(tface->uv[0],cent,rotatematrix,4, efa->v1->co, NULL,NULL);
- uv_calc_shift_project(tface->uv[1],cent,rotatematrix,4, efa->v2->co, NULL,NULL);
- uv_calc_shift_project(tface->uv[2],cent,rotatematrix,4, efa->v3->co, NULL,NULL);
- if(efa->v4)
- uv_calc_shift_project(tface->uv[3],cent,rotatematrix,4, efa->v4->co, NULL,NULL);
- }
- }
- break;
-
- case B_UVAUTO_RESET:
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- default_uv(tface->uv, 1.0);
- }
- }
- break;
-
- case B_UVAUTO_CYLINDER:
- case B_UVAUTO_SPHERE:
- uv_calc_center_vector(cent, ob, em);
-
- if(mapmode==B_UVAUTO_CYLINDER) radius = G.scene->toolsettings->uvcalc_radius;
-
- /* be compatible to the "old" sphere/cylinder mode */
- if (G.scene->toolsettings->uvcalc_mapdir== 2)
- Mat4One(rotatematrix);
- else
- uv_calc_map_matrix(rotatematrix,ob,upangledeg,sideangledeg,radius);
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv_calc_shift_project(tface->uv[0],cent,rotatematrix,mapmode, efa->v1->co, NULL,NULL);
- uv_calc_shift_project(tface->uv[1],cent,rotatematrix,mapmode, efa->v2->co, NULL,NULL);
- uv_calc_shift_project(tface->uv[2],cent,rotatematrix,mapmode, efa->v3->co, NULL,NULL);
- n = 3;
- if(efa->v4) {
- uv_calc_shift_project(tface->uv[3],cent,rotatematrix,mapmode, efa->v4->co, NULL,NULL);
- n=4;
- }
-
- mi = 0;
- for (i = 1; i < n; i++)
- if (tface->uv[i][0] > tface->uv[mi][0]) mi = i;
-
- for (i = 0; i < n; i++) {
- if (i != mi) {
- dx = tface->uv[mi][0] - tface->uv[i][0];
- if (dx > 0.5) tface->uv[i][0] += 1.0;
- }
- }
- }
- }
-
- break;
-
- case B_UVAUTO_CUBE:
- {
- /* choose x,y,z axis for projetion depending on the largest normal */
- /* component, but clusters all together around the center of map */
- float no[3];
- short cox, coy;
- float *loc= ob->obmat[3];
- /*MVert *mv= me->mvert;*/
- float cubesize = G.scene->toolsettings->uvcalc_cubesize;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, no);
-
- no[0]= fabs(no[0]);
- no[1]= fabs(no[1]);
- no[2]= fabs(no[2]);
-
- cox=0; coy= 1;
- if(no[2]>=no[0] && no[2]>=no[1]);
- else if(no[1]>=no[0] && no[1]>=no[2]) coy= 2;
- else { cox= 1; coy= 2; }
-
- tface->uv[0][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v1->co[cox]);
- tface->uv[0][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v1->co[coy]);
- dx = floor(tface->uv[0][0]);
- dy = floor(tface->uv[0][1]);
- tface->uv[0][0] -= dx;
- tface->uv[0][1] -= dy;
- tface->uv[1][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v2->co[cox]);
- tface->uv[1][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v2->co[coy]);
- tface->uv[1][0] -= dx;
- tface->uv[1][1] -= dy;
- tface->uv[2][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v3->co[cox]);
- tface->uv[2][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v3->co[coy]);
- tface->uv[2][0] -= dx;
- tface->uv[2][1] -= dy;
- if(efa->v4) {
- tface->uv[3][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v4->co[cox]);
- tface->uv[3][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v4->co[coy]);
- tface->uv[3][0] -= dx;
- tface->uv[3][1] -= dy;
- }
- }
- }
- break;
- }
- default:
- if ((G.scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT)==0)
- correct_uv_aspect();
- return;
- } /* end switch mapmode */
-
- /* clipping and wrapping */
- if(G.sima && G.sima->flag & SI_CLIP_UV) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->f & SELECT)) continue;
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- dx= dy= 0;
- if(efa->v4) b= 3; else b= 2;
- for(; b>=0; b--) {
- while(tface->uv[b][0] + dx < 0.0) dx+= 0.5;
- while(tface->uv[b][0] + dx > 1.0) dx-= 0.5;
- while(tface->uv[b][1] + dy < 0.0) dy+= 0.5;
- while(tface->uv[b][1] + dy > 1.0) dy-= 0.5;
- }
-
- if(efa->v4) b= 3; else b= 2;
- for(; b>=0; b--) {
- tface->uv[b][0]+= dx;
- CLAMP(tface->uv[b][0], 0.0, 1.0);
-
- tface->uv[b][1]+= dy;
- CLAMP(tface->uv[b][1], 0.0, 1.0);
- }
- }
- }
-
- if ( (mapmode!=B_UVAUTO_BOUNDS) &&
- (mapmode!=B_UVAUTO_RESET) &&
- (G.scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT)==0
- ) {
- correct_uv_aspect();
- }
-
- BIF_undo_push("UV calculation");
-
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-/* last_sel, use em->act_face otherwise get the last selected face in the editselections
- * at the moment, last_sel is mainly useful for gaking sure the space image dosnt flicker */
-MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol, int sloppy)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa = NULL;
-
- if(!EM_texFaceCheck())
- return NULL;
-
- efa = EM_get_actFace(sloppy);
-
- if (efa) {
- if (mcol) {
- if (CustomData_has_layer(&em->fdata, CD_MCOL))
- *mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- else
- *mcol = NULL;
- }
- if (act_efa) *act_efa = efa;
- return CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- }
- if (act_efa) *act_efa= NULL;
- if(mcol) *mcol = NULL;
- return NULL;
-}
-
-void default_uv(float uv[][2], float size)
-{
- int dy;
-
- if(size>1.0) size= 1.0;
-
- dy= 1.0-size;
-
- uv[0][0]= 0;
- uv[0][1]= size+dy;
-
- uv[1][0]= 0;
- uv[1][1]= dy;
-
- uv[2][0]= size;
- uv[2][1]= dy;
-
- uv[3][0]= size;
- uv[3][1]= size+dy;
-}
-
-void make_tfaces(Mesh *me)
-{
- if(!me->mtface) {
- if(me->mr) {
- multires_add_layer(me, &me->mr->fdata, CD_MTFACE,
- CustomData_number_of_layers(&me->fdata, CD_MTFACE));
- }
- else {
- me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
- NULL, me->totface);
- }
- }
-}
-
-void reveal_tface()
-{
- Mesh *me;
- MFace *mface;
- int a;
-
- me= get_mesh(OBACT);
- if(me==0 || me->totface==0) return;
-
- mface= me->mface;
- a= me->totface;
- while(a--) {
- if(mface->flag & ME_HIDE) {
- mface->flag |= ME_FACE_SEL;
- mface->flag -= ME_HIDE;
- }
- mface++;
- }
-
- BIF_undo_push("Reveal face");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-void hide_tface()
-{
- Mesh *me;
- MFace *mface;
- int a;
-
- me= get_mesh(OBACT);
- if(me==0 || me->totface==0) return;
-
- if(G.qual & LR_ALTKEY) {
- reveal_tface();
- return;
- }
-
- mface= me->mface;
- a= me->totface;
- while(a--) {
- if(mface->flag & ME_HIDE);
- else {
- if(G.qual & LR_SHIFTKEY) {
- if( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE;
- }
- else {
- if( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE;
- }
- }
- if(mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL;
-
- mface++;
- }
-
- BIF_undo_push("Hide face");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-void select_linked_tfaces(int mode)
-{
- Object *ob;
- Mesh *me;
- short mval[2];
- unsigned int index=0;
-
- ob = OBACT;
- me = get_mesh(ob);
- if(me==0 || me->totface==0) return;
-
- if (mode==0 || mode==1) {
- if (!(ob->lay & G.vd->lay))
- error("The active object is not in this layer");
-
- getmouseco_areawin(mval);
- if (!facesel_face_pick(me, mval, &index, 1)) return;
- }
-
- select_linked_tfaces_with_seams(mode, me, index);
-}
-
-void deselectall_tface()
-{
- Mesh *me;
- MFace *mface;
- int a, sel;
-
- me= get_mesh(OBACT);
- if(me==0) return;
-
- mface= me->mface;
- a= me->totface;
- sel= 0;
- while(a--) {
- if(mface->flag & ME_HIDE);
- else if(mface->flag & ME_FACE_SEL) sel= 1;
- mface++;
- }
-
- mface= me->mface;
- a= me->totface;
- while(a--) {
- if(mface->flag & ME_HIDE);
- else {
- if(sel) mface->flag &= ~ME_FACE_SEL;
- else mface->flag |= ME_FACE_SEL;
- }
- mface++;
- }
-
- BIF_undo_push("(De)select all faces");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-void selectswap_tface(void)
-{
- Mesh *me;
- MFace *mface;
- int a;
-
- me= get_mesh(OBACT);
- if(me==0) return;
-
- mface= me->mface;
- a= me->totface;
- while(a--) {
- if(mface->flag & ME_HIDE);
- else {
- if(mface->flag & ME_FACE_SEL) mface->flag &= ~ME_FACE_SEL;
- else mface->flag |= ME_FACE_SEL;
- }
- mface++;
- }
-
- BIF_undo_push("Select inverse face");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-int minmax_tface(float *min, float *max)
-{
- Object *ob;
- Mesh *me;
- MFace *mf;
- MTFace *tf;
- MVert *mv;
- int a, ok=0;
- float vec[3], bmat[3][3];
-
- ob = OBACT;
- if (ob==0) return ok;
- me= get_mesh(ob);
- if(me==0 || me->mtface==0) return ok;
-
- Mat3CpyMat4(bmat, ob->obmat);
-
- mv= me->mvert;
- mf= me->mface;
- tf= me->mtface;
- for (a=me->totface; a>0; a--, mf++, tf++) {
- if (mf->flag & ME_HIDE || !(mf->flag & ME_FACE_SEL))
- continue;
-
- VECCOPY(vec, (mv+mf->v1)->co);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, ob->obmat[3]);
- DO_MINMAX(vec, min, max);
-
- VECCOPY(vec, (mv+mf->v2)->co);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, ob->obmat[3]);
- DO_MINMAX(vec, min, max);
-
- VECCOPY(vec, (mv+mf->v3)->co);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, ob->obmat[3]);
- DO_MINMAX(vec, min, max);
-
- if (mf->v4) {
- VECCOPY(vec, (mv+mf->v4)->co);
- Mat3MulVecfl(bmat, vec);
- VecAddf(vec, vec, ob->obmat[3]);
- DO_MINMAX(vec, min, max);
- }
- ok= 1;
- }
- return ok;
-}
-
-#define ME_SEAM_DONE 2 /* reuse this flag */
-
-static float edgetag_cut_cost(EditMesh *em, int e1, int e2, int vert)
-{
- EditVert *v = EM_get_vert_for_index(vert);
- EditEdge *eed1 = EM_get_edge_for_index(e1), *eed2 = EM_get_edge_for_index(e2);
- EditVert *v1 = EM_get_vert_for_index( (eed1->v1->tmp.l == vert)? eed1->v2->tmp.l: eed1->v1->tmp.l );
- EditVert *v2 = EM_get_vert_for_index( (eed2->v1->tmp.l == vert)? eed2->v2->tmp.l: eed2->v1->tmp.l );
- float cost, d1[3], d2[3];
-
- cost = VecLenf(v1->co, v->co);
- cost += VecLenf(v->co, v2->co);
-
- VecSubf(d1, v->co, v1->co);
- VecSubf(d2, v2->co, v->co);
-
- cost = cost + 0.5f*cost*(2.0f - fabs(d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2]));
-
- return cost;
-}
-
-static void edgetag_add_adjacent(EditMesh *em, Heap *heap, int mednum, int vertnum, int *nedges, int *edges, int *prevedge, float *cost)
-{
- int startadj, endadj = nedges[vertnum+1];
-
- for (startadj = nedges[vertnum]; startadj < endadj; startadj++) {
- int adjnum = edges[startadj];
- EditEdge *eedadj = EM_get_edge_for_index(adjnum);
- float newcost;
-
- if (eedadj->f2 & ME_SEAM_DONE)
- continue;
-
- newcost = cost[mednum] + edgetag_cut_cost(em, mednum, adjnum, vertnum);
-
- if (cost[adjnum] > newcost) {
- cost[adjnum] = newcost;
- prevedge[adjnum] = mednum;
- BLI_heap_insert(heap, newcost, SET_INT_IN_POINTER(adjnum));
- }
- }
-}
-
-void edgetag_context_set(EditEdge *eed, int val)
-{
- switch (G.scene->toolsettings->edge_mode) {
- case EDGE_MODE_TAG_SEAM:
- if (val) {eed->seam = 255;}
- else {eed->seam = 0;}
- break;
- case EDGE_MODE_TAG_SHARP:
- if (val) {eed->sharp = 1;}
- else {eed->sharp = 0;}
- break;
- case EDGE_MODE_TAG_CREASE:
- if (val) {eed->crease = 1.0f;}
- else {eed->crease = 0.0f;}
- break;
- case EDGE_MODE_TAG_BEVEL:
- if (val) {eed->bweight = 1.0f;}
- else {eed->bweight = 0.0f;}
- break;
- }
-}
-
-int edgetag_context_check(EditEdge *eed)
-{
- switch (G.scene->toolsettings->edge_mode) {
- case EDGE_MODE_TAG_SEAM:
- return eed->seam ? 1 : 0;
- case EDGE_MODE_TAG_SHARP:
- return eed->sharp ? 1 : 0;
- case EDGE_MODE_TAG_CREASE:
- return eed->crease ? 1 : 0;
- case EDGE_MODE_TAG_BEVEL:
- return eed->bweight ? 1 : 0;
- }
- return 0;
-}
-
-
-int edgetag_shortest_path(EditEdge *source, EditEdge *target)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditVert *ev;
-
- Heap *heap;
- float *cost;
- int a, totvert=0, totedge=0, *nedges, *edges, *prevedge, mednum = -1, nedgeswap = 0;
-
-
- /* we need the vert */
- for (ev= em->verts.first, totvert=0; ev; ev= ev->next) {
- ev->tmp.l = totvert;
- totvert++;
- }
-
- for (eed= em->edges.first; eed; eed = eed->next) {
- eed->f2 = 0;
- if (eed->h) {
- eed->f2 |= ME_SEAM_DONE;
- }
- eed->tmp.l = totedge;
- totedge++;
- }
-
- /* alloc */
- nedges = MEM_callocN(sizeof(*nedges)*totvert+1, "SeamPathNEdges");
- edges = MEM_mallocN(sizeof(*edges)*totedge*2, "SeamPathEdges");
- prevedge = MEM_mallocN(sizeof(*prevedge)*totedge, "SeamPathPrevious");
- cost = MEM_mallocN(sizeof(*cost)*totedge, "SeamPathCost");
-
- /* count edges, compute adjacent edges offsets and fill adjacent edges */
- for (eed= em->edges.first; eed; eed = eed->next) {
- nedges[eed->v1->tmp.l+1]++;
- nedges[eed->v2->tmp.l+1]++;
- }
-
- for (a=1; a<totvert; a++) {
- int newswap = nedges[a+1];
- nedges[a+1] = nedgeswap + nedges[a];
- nedgeswap = newswap;
- }
- nedges[0] = nedges[1] = 0;
-
- for (a=0, eed= em->edges.first; eed; a++, eed = eed->next) {
- edges[nedges[eed->v1->tmp.l+1]++] = a;
- edges[nedges[eed->v2->tmp.l+1]++] = a;
-
- cost[a] = 1e20f;
- prevedge[a] = -1;
- }
-
- /* regular dijkstra shortest path, but over edges instead of vertices */
- heap = BLI_heap_new();
- BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(source->tmp.l));
- cost[source->tmp.l] = 0.0f;
-
- EM_init_index_arrays(1, 1, 0);
-
-
- while (!BLI_heap_empty(heap)) {
- mednum = GET_INT_FROM_POINTER(BLI_heap_popmin(heap));
- eed = EM_get_edge_for_index( mednum );
-
- if (mednum == target->tmp.l)
- break;
-
- if (eed->f2 & ME_SEAM_DONE)
- continue;
-
- eed->f2 |= ME_SEAM_DONE;
-
- edgetag_add_adjacent(em, heap, mednum, eed->v1->tmp.l, nedges, edges, prevedge, cost);
- edgetag_add_adjacent(em, heap, mednum, eed->v2->tmp.l, nedges, edges, prevedge, cost);
- }
-
-
- MEM_freeN(nedges);
- MEM_freeN(edges);
- MEM_freeN(cost);
- BLI_heap_free(heap, NULL);
-
- for (eed= em->edges.first; eed; eed = eed->next) {
- eed->f2 &= ~ME_SEAM_DONE;
- }
-
- if (mednum != target->tmp.l) {
- MEM_freeN(prevedge);
- EM_free_index_arrays();
- return 0;
- }
-
- /* follow path back to source and mark as seam */
- if (mednum == target->tmp.l) {
- short allseams = 1;
-
- mednum = target->tmp.l;
- do {
- eed = EM_get_edge_for_index( mednum );
- if (!edgetag_context_check(eed)) {
- allseams = 0;
- break;
- }
- mednum = prevedge[mednum];
- } while (mednum != source->tmp.l);
-
- mednum = target->tmp.l;
- do {
- eed = EM_get_edge_for_index( mednum );
- if (allseams)
- edgetag_context_set(eed, 0);
- else
- edgetag_context_set(eed, 1);
- mednum = prevedge[mednum];
- } while (mednum != -1);
- }
-
- MEM_freeN(prevedge);
- EM_free_index_arrays();
- return 1;
-}
-
-static void seam_edgehash_insert_face(EdgeHash *ehash, MFace *mf)
-{
- BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL);
- BLI_edgehash_insert(ehash, mf->v2, mf->v3, NULL);
- if (mf->v4) {
- BLI_edgehash_insert(ehash, mf->v3, mf->v4, NULL);
- BLI_edgehash_insert(ehash, mf->v4, mf->v1, NULL);
- }
- else
- BLI_edgehash_insert(ehash, mf->v3, mf->v1, NULL);
-}
-
-void seam_mark_clear_tface(short mode)
-{
- Mesh *me;
- MFace *mf;
- MEdge *med;
- int a;
-
- me= get_mesh(OBACT);
- if(me==0 || me->totface==0) return;
-
- if (mode == 0)
- mode = pupmenu("Seams%t|Mark Border Seam %x1|Clear Seam %x2");
-
- if (mode != 1 && mode != 2)
- return;
-
- if (mode == 2) {
- EdgeHash *ehash = BLI_edgehash_new();
-
- for (a=0, mf=me->mface; a<me->totface; a++, mf++)
- if (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL))
- seam_edgehash_insert_face(ehash, mf);
-
- for (a=0, med=me->medge; a<me->totedge; a++, med++)
- if (BLI_edgehash_haskey(ehash, med->v1, med->v2))
- med->flag &= ~ME_SEAM;
-
- BLI_edgehash_free(ehash, NULL);
- }
- else {
- /* mark edges that are on both selected and deselected faces */
- EdgeHash *ehash1 = BLI_edgehash_new();
- EdgeHash *ehash2 = BLI_edgehash_new();
-
- for (a=0, mf=me->mface; a<me->totface; a++, mf++) {
- if ((mf->flag & ME_HIDE) || !(mf->flag & ME_FACE_SEL))
- seam_edgehash_insert_face(ehash1, mf);
- else
- seam_edgehash_insert_face(ehash2, mf);
- }
-
- for (a=0, med=me->medge; a<me->totedge; a++, med++)
- if (BLI_edgehash_haskey(ehash1, med->v1, med->v2) &&
- BLI_edgehash_haskey(ehash2, med->v1, med->v2))
- med->flag |= ME_SEAM;
-
- BLI_edgehash_free(ehash1, NULL);
- BLI_edgehash_free(ehash2, NULL);
- }
-
- if (G.rt == 8)
- unwrap_lscm(1);
-
- G.f |= G_DRAWSEAMS;
- BIF_undo_push("Mark Seam");
-
- object_tface_flags_changed(OBACT, 1);
-}
-
-void face_select()
-{
- Object *ob;
- Mesh *me;
- MFace *mface, *msel;
- short mval[2];
- unsigned int a, index;
-
- /* Get the face under the cursor */
- ob = OBACT;
- if (!(ob->lay & G.vd->lay)) {
- error("The active object is not in this layer");
- }
- me = get_mesh(ob);
- getmouseco_areawin(mval);
-
- if (!facesel_face_pick(me, mval, &index, 1)) return;
-
- msel= (((MFace*)me->mface)+index);
- if (msel->flag & ME_HIDE) return;
-
- /* clear flags */
- mface = me->mface;
- a = me->totface;
- if ((G.qual & LR_SHIFTKEY)==0) {
- while (a--) {
- mface->flag &= ~ME_FACE_SEL;
- mface++;
- }
- }
-
- me->act_face = (int)index;
-
- if (G.qual & LR_SHIFTKEY) {
- if (msel->flag & ME_FACE_SEL)
- msel->flag &= ~ME_FACE_SEL;
- else
- msel->flag |= ME_FACE_SEL;
- }
- else msel->flag |= ME_FACE_SEL;
-
- /* image window redraw */
-
- BIF_undo_push("Select UV face");
-
- object_tface_flags_changed(OBACT, 1);
-}
-
-void face_borderselect()
-{
- Mesh *me;
- MFace *mface;
- rcti rect;
- struct ImBuf *ibuf;
- unsigned int *rt;
- int a, sx, sy, index, val;
- char *selar;
-
- me= get_mesh(OBACT);
- if(me==0) return;
- if(me->totface==0) return;
-
- val= get_border(&rect, 3);
-
- /* why readbuffer here? shouldn't be necessary (maybe a flush or so) */
- glReadBuffer(GL_BACK);
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0); /* apple only */
-#endif
-
- if(val) {
- selar= MEM_callocN(me->totface+1, "selar");
-
- sx= (rect.xmax-rect.xmin+1);
- sy= (rect.ymax-rect.ymin+1);
- if(sx*sy<=0) return;
-
- ibuf = IMB_allocImBuf(sx,sy,32,IB_rect,0);
- rt = ibuf->rect;
- glReadPixels(rect.xmin+curarea->winrct.xmin, rect.ymin+curarea->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
-
- a= sx*sy;
- while(a--) {
- if(*rt) {
- index= framebuffer_to_index(*rt);
- if(index<=me->totface) selar[index]= 1;
- }
- rt++;
- }
-
- mface= me->mface;
- for(a=1; a<=me->totface; a++, mface++) {
- if(selar[a]) {
- if(mface->flag & ME_HIDE);
- else {
- if(val==LEFTMOUSE) mface->flag |= ME_FACE_SEL;
- else mface->flag &= ~ME_FACE_SEL;
- }
- }
- }
-
- IMB_freeImBuf(ibuf);
- MEM_freeN(selar);
-
- BIF_undo_push("Border Select UV face");
-
- object_tface_flags_changed(OBACT, 0);
- }
-#ifdef __APPLE__
- glReadBuffer(GL_BACK);
-#endif
-}
-
-void uv_autocalc_tface()
-{
- short mode, i=0, has_pymenu=0; /* pymenu must be bigger then UV_*_MAPPING */
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- char menu_number[3];
-
- /* uvmenu, will add python items */
- char uvmenu[4096]=MENUTITLE("UV Calculation")
- MENUSTRING("Unwrap", UV_UNWRAP_MAPPING) "|%l|"
-
- MENUSTRING("Cube Projection", UV_CUBE_MAPPING) "|"
- MENUSTRING("Cylinder from View", UV_CYL_MAPPING) "|"
- MENUSTRING("Sphere from View", UV_SPHERE_MAPPING) "|%l|"
-
- MENUSTRING("Project From View", UV_WINDOW_MAPPING) "|"
- MENUSTRING("Project from View (Bounds)",UV_BOUNDS_MAPPING) "|%l|"
-
- MENUSTRING("Reset", UV_RESET_MAPPING);
-#ifndef DISABLE_PYTHON
- /* note that we account for the 10 previous entries with i+10: */
- for (pym = BPyMenuTable[PYMENU_UVCALCULATION]; pym; pym = pym->next, i++) {
-
- if (!has_pymenu) {
- strcat(uvmenu, "|%l");
- has_pymenu = 1;
- }
-
- strcat(uvmenu, "|");
- strcat(uvmenu, pym->name);
- strcat(uvmenu, " %x");
- sprintf(menu_number, "%d", i+10);
- strcat(uvmenu, menu_number);
- }
-#endif
-
- mode= pupmenu(uvmenu);
-#ifndef DISABLE_PYTHON
- if (mode >= 10) {
- BPY_menu_do_python(PYMENU_UVCALCULATION, mode - 10);
- return;
- }
-#endif
- switch(mode) {
- case UV_CUBE_MAPPING:
- calculate_uv_map(B_UVAUTO_CUBE); break;
- case UV_CYL_MAPPING:
- calculate_uv_map(B_UVAUTO_CYLINDER); break;
- case UV_SPHERE_MAPPING:
- calculate_uv_map(B_UVAUTO_SPHERE); break;
- case UV_BOUNDS_MAPPING:
- calculate_uv_map(B_UVAUTO_BOUNDS); break;
- case UV_RESET_MAPPING:
- calculate_uv_map(B_UVAUTO_RESET); break;
- case UV_WINDOW_MAPPING:
- calculate_uv_map(B_UVAUTO_WINDOW); break;
- case UV_UNWRAP_MAPPING:
- unwrap_lscm(0); break;
- }
-}
-
-/* Texture Paint */
-
-void set_texturepaint() /* toggle */
-{
- Object *ob = OBACT;
- Mesh *me = 0;
-
- scrarea_queue_headredraw(curarea);
- if(ob==NULL) return;
-
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return;
- }
-
- me= get_mesh(ob);
-
- if(me)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if(G.f & G_TEXTUREPAINT) {
- G.f &= ~G_TEXTUREPAINT;
- GPU_paint_set_mipmap(1);
- }
- else if (me) {
- G.f |= G_TEXTUREPAINT;
-
- if(me->mtface==NULL)
- make_tfaces(me);
-
- brush_check_exists(&G.scene->toolsettings->imapaint.brush);
- GPU_paint_set_mipmap(0);
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-static void texpaint_project(Object *ob, float *model, float *proj, float *co, float *pco)
-{
- VECCOPY(pco, co);
- pco[3]= 1.0f;
-
- Mat4MulVecfl(ob->obmat, pco);
- Mat4MulVecfl((float(*)[4])model, pco);
- Mat4MulVec4fl((float(*)[4])proj, pco);
-}
-
-static void texpaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, float *co, float *w)
-{
- float pv1[4], pv2[4], pv3[4], h[3], divw;
- float model[16], proj[16], wmat[3][3], invwmat[3][3];
- GLint view[4];
-
- /* compute barycentric coordinates */
-
- /* get the needed opengl matrices */
- glGetIntegerv(GL_VIEWPORT, view);
- glGetFloatv(GL_MODELVIEW_MATRIX, model);
- glGetFloatv(GL_PROJECTION_MATRIX, proj);
- view[0] = view[1] = 0;
-
- /* project the verts */
- texpaint_project(ob, model, proj, v1, pv1);
- texpaint_project(ob, model, proj, v2, pv2);
- texpaint_project(ob, model, proj, v3, pv3);
-
- /* do inverse view mapping, see gluProject man page */
- h[0]= (co[0] - view[0])*2.0f/view[2] - 1;
- h[1]= (co[1] - view[1])*2.0f/view[3] - 1;
- h[2]= 1.0f;
-
- /* solve for (w1,w2,w3)/perspdiv in:
- h*perspdiv = Project*Model*(w1*v1 + w2*v2 + w3*v3) */
-
- wmat[0][0]= pv1[0]; wmat[1][0]= pv2[0]; wmat[2][0]= pv3[0];
- wmat[0][1]= pv1[1]; wmat[1][1]= pv2[1]; wmat[2][1]= pv3[1];
- wmat[0][2]= pv1[3]; wmat[1][2]= pv2[3]; wmat[2][2]= pv3[3];
-
- Mat3Inv(invwmat, wmat);
- Mat3MulVecfl(invwmat, h);
-
- VECCOPY(w, h);
-
- /* w is still divided by perspdiv, make it sum to one */
- divw= w[0] + w[1] + w[2];
- if(divw != 0.0f)
- VecMulf(w, 1.0f/divw);
-}
-
-/* compute uv coordinates of mouse in face */
-void texpaint_pick_uv(Object *ob, Mesh *mesh, unsigned int faceindex, short *xy, float *uv)
-{
- DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
- int *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
- MTFace *tface = dm->getFaceDataArray(dm, CD_MTFACE), *tf;
- int numfaces = dm->getNumFaces(dm), a;
- float p[2], w[3], absw, minabsw;
- MFace mf;
- MVert mv[4];
-
- minabsw = 1e10;
- uv[0] = uv[1] = 0.0;
-
- persp(PERSP_VIEW);
-
- /* test all faces in the derivedmesh with the original index of the picked face */
- for (a = 0; a < numfaces; a++) {
- if (index[a] == faceindex) {
- dm->getFace(dm, a, &mf);
-
- dm->getVert(dm, mf.v1, &mv[0]);
- dm->getVert(dm, mf.v2, &mv[1]);
- dm->getVert(dm, mf.v3, &mv[2]);
- if (mf.v4)
- dm->getVert(dm, mf.v4, &mv[3]);
-
- tf= &tface[a];
-
- p[0]= xy[0];
- p[1]= xy[1];
-
- if (mf.v4) {
- /* the triangle with the largest absolute values is the one
- with the most negative weights */
- texpaint_tri_weights(ob, mv[0].co, mv[1].co, mv[3].co, p, w);
- absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
- if(absw < minabsw) {
- uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[3][0]*w[2];
- uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[3][1]*w[2];
- minabsw = absw;
- }
-
- texpaint_tri_weights(ob, mv[1].co, mv[2].co, mv[3].co, p, w);
- absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
- if (absw < minabsw) {
- uv[0]= tf->uv[1][0]*w[0] + tf->uv[2][0]*w[1] + tf->uv[3][0]*w[2];
- uv[1]= tf->uv[1][1]*w[0] + tf->uv[2][1]*w[1] + tf->uv[3][1]*w[2];
- minabsw = absw;
- }
- }
- else {
- texpaint_tri_weights(ob, mv[0].co, mv[1].co, mv[2].co, p, w);
- absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]);
- if (absw < minabsw) {
- uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[2][0]*w[2];
- uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[2][1]*w[2];
- minabsw = absw;
- }
- }
- }
- }
-
- dm->release(dm);
-}
diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c
deleted file mode 100644
index a3b05a008c8..00000000000
--- a/source/blender/src/editfont.c
+++ /dev/null
@@ -1,1288 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <wchar.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MTC_matrixops.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_text_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_font.h"
-#include "BKE_object.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editfont.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-
-#include "BDR_editobject.h"
-
-#include "mydevice.h"
-
-#include "blendef.h"
-
-#define MAXTEXT 32766
-
-/* -- prototypes --------*/
-VFont *get_builtin_font(void);
-
-int textediting=0;
-
-extern struct SelBox *selboxes; /* from blenkernel/font.c */
-
-static char findaccent(char char1, unsigned int code)
-{
- char new= 0;
-
- if(char1=='a') {
- if(code=='`') new= 224;
- else if(code==39) new= 225;
- else if(code=='^') new= 226;
- else if(code=='~') new= 227;
- else if(code=='"') new= 228;
- else if(code=='o') new= 229;
- else if(code=='e') new= 230;
- else if(code=='-') new= 170;
- }
- else if(char1=='c') {
- if(code==',') new= 231;
- if(code=='|') new= 162;
- }
- else if(char1=='e') {
- if(code=='`') new= 232;
- else if(code==39) new= 233;
- else if(code=='^') new= 234;
- else if(code=='"') new= 235;
- }
- else if(char1=='i') {
- if(code=='`') new= 236;
- else if(code==39) new= 237;
- else if(code=='^') new= 238;
- else if(code=='"') new= 239;
- }
- else if(char1=='n') {
- if(code=='~') new= 241;
- }
- else if(char1=='o') {
- if(code=='`') new= 242;
- else if(code==39) new= 243;
- else if(code=='^') new= 244;
- else if(code=='~') new= 245;
- else if(code=='"') new= 246;
- else if(code=='/') new= 248;
- else if(code=='-') new= 186;
- else if(code=='e') new= 143;
- }
- else if(char1=='s') {
- if(code=='s') new= 167;
- }
- else if(char1=='u') {
- if(code=='`') new= 249;
- else if(code==39) new= 250;
- else if(code=='^') new= 251;
- else if(code=='"') new= 252;
- }
- else if(char1=='y') {
- if(code==39) new= 253;
- else if(code=='"') new= 255;
- }
- else if(char1=='A') {
- if(code=='`') new= 192;
- else if(code==39) new= 193;
- else if(code=='^') new= 194;
- else if(code=='~') new= 195;
- else if(code=='"') new= 196;
- else if(code=='o') new= 197;
- else if(code=='e') new= 198;
- }
- else if(char1=='C') {
- if(code==',') new= 199;
- }
- else if(char1=='E') {
- if(code=='`') new= 200;
- else if(code==39) new= 201;
- else if(code=='^') new= 202;
- else if(code=='"') new= 203;
- }
- else if(char1=='I') {
- if(code=='`') new= 204;
- else if(code==39) new= 205;
- else if(code=='^') new= 206;
- else if(code=='"') new= 207;
- }
- else if(char1=='N') {
- if(code=='~') new= 209;
- }
- else if(char1=='O') {
- if(code=='`') new= 210;
- else if(code==39) new= 211;
- else if(code=='^') new= 212;
- else if(code=='~') new= 213;
- else if(code=='"') new= 214;
- else if(code=='/') new= 216;
- else if(code=='e') new= 141;
- }
- else if(char1=='U') {
- if(code=='`') new= 217;
- else if(code==39) new= 218;
- else if(code=='^') new= 219;
- else if(code=='"') new= 220;
- }
- else if(char1=='Y') {
- if(code==39) new= 221;
- }
- else if(char1=='1') {
- if(code=='4') new= 188;
- if(code=='2') new= 189;
- }
- else if(char1=='3') {
- if(code=='4') new= 190;
- }
- else if(char1==':') {
- if(code=='-') new= 247;
- }
- else if(char1=='-') {
- if(code==':') new= 247;
- if(code=='|') new= 135;
- if(code=='+') new= 177;
- }
- else if(char1=='|') {
- if(code=='-') new= 135;
- if(code=='=') new= 136;
- }
- else if(char1=='=') {
- if(code=='|') new= 136;
- }
- else if(char1=='+') {
- if(code=='-') new= 177;
- }
-
- if(new) return new;
- else return char1;
-}
-
-wchar_t *copybuf=NULL;
-wchar_t *copybufinfo=NULL;
-
-static wchar_t *textbuf=NULL;
-static CharInfo *textbufinfo=NULL;
-static wchar_t *oldstr=NULL;
-static CharInfo *oldstrinfo=NULL;
-
-void update_string(Curve *cu)
-{
- int len;
-
- // Free the old curve string
- MEM_freeN(cu->str);
-
- // Calculate the actual string length in UTF-8 variable characters
- len = wcsleninu8(textbuf);
-
- // Alloc memory for UTF-8 variable char length string
- cu->str = MEM_callocN(len + sizeof(wchar_t), "str");
-
- // Copy the wchar to UTF-8
- wcs2utf8s(cu->str, textbuf);
-}
-
-static int insert_into_textbuf(Curve *cu, unsigned long c)
-{
- if (cu->len<MAXTEXT-1) {
- int x;
-
- for(x= cu->len; x>cu->pos; x--) textbuf[x]= textbuf[x-1];
- for(x= cu->len; x>cu->pos; x--) textbufinfo[x]= textbufinfo[x-1];
- textbuf[cu->pos]= c;
- textbufinfo[cu->pos] = cu->curinfo;
- textbufinfo[cu->pos].kern = 0;
- if (G.obedit->actcol>0)
- textbufinfo[cu->pos].mat_nr = G.obedit->actcol;
- else
- textbufinfo[cu->pos].mat_nr = 0;
-
- cu->pos++;
- cu->len++;
- textbuf[cu->len]='\0';
-
- update_string(cu);
-
- return 1;
- } else {
- return 0;
- }
-}
-
-void add_lorem(void)
-{
- char *p, *p2;
- int i;
- Curve *cu=G.obedit->data;
- static char* lastlorem;
-
- if (lastlorem)
- p= lastlorem;
- else
- p= BIF_lorem;
-
- i= rand()/(RAND_MAX/6)+4;
-
- for (p2=p; *p2 && i; p2++) {
- insert_into_textbuf(cu, *p2);
- if (*p2=='.') i--;
- }
- lastlorem = p2+1;
- if (strlen(lastlorem)<5) lastlorem = BIF_lorem;
-
- insert_into_textbuf(cu, '\n');
- insert_into_textbuf(cu, '\n');
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void load_3dtext_fs(char *file)
-{
- FILE *fp;
- int filelen;
- char *strp;
- Curve *cu=G.obedit->data;
-
- fp= fopen(file, "r");
- if (!fp) return;
-
- fseek(fp, 0L, SEEK_END);
- filelen = ftell(fp);
- fseek(fp, 0L, SEEK_SET);
-
- strp = MEM_callocN(filelen+4, "tempstr");
-
- filelen = fread(strp, 1, filelen, fp);
- fclose(fp);
- strp[filelen]= 0;
-
- if(cu->len+filelen<MAXTEXT)
- {
- int tmplen;
- wchar_t *mem = MEM_callocN((sizeof(wchar_t)*filelen)+(4*sizeof(wchar_t)), "temporary");
- tmplen = utf8towchar(mem, strp);
- wcscat(textbuf, mem);
- MEM_freeN(mem);
- cu->len += tmplen;
- cu->pos= cu->len;
- }
- MEM_freeN(strp);
-
- update_string(cu);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-VFont *get_builtin_font(void)
-{
- VFont *vf;
-
- for (vf= G.main->vfont.first; vf; vf= vf->id.next)
- if (BLI_streq(vf->name, "<builtin>"))
- return vf;
-
- return load_vfont("<builtin>");
-}
-
-
-void txt_export_to_object(struct Text *text)
-{
- ID *id;
- Curve *cu;
- struct TextLine *tmp;
- int nchars = 0;
-// char sdir[FILE_MAXDIR];
-// char sfile[FILE_MAXFILE];
-
- if(!text || !text->lines.first) return;
-
- id = (ID *)text;
-
- if (G.obedit && G.obedit->type==OB_FONT) return;
- check_editmode(OB_FONT);
-
- add_object(OB_FONT);
-
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
- where_is_object(G.obedit);
-
- cu= G.obedit->data;
-
-/*
-// renames object, careful with long filenames.
-
- if (text->name) {
- //ID *find_id(char *type, char *name)
- BLI_split_dirfile(text->name, sdir, sfile);
-// rename_id((ID *)G.obedit, sfile);
- rename_id((ID *)cu, sfile);
- id->us++;
- }
-*/
- cu->vfont= get_builtin_font();
- cu->vfont->id.us++;
-
- tmp= text->lines.first;
- while(cu->len<MAXTEXT && tmp) {
- nchars += strlen(tmp->line) + 1;
- tmp = tmp->next;
- }
-
- if(cu->str) MEM_freeN(cu->str);
- if(cu->strinfo) MEM_freeN(cu->strinfo);
-
- cu->str= MEM_mallocN(nchars+4, "str");
- cu->strinfo= MEM_callocN((nchars+4)*sizeof(CharInfo), "strinfo");
- cu->totbox= cu->actbox= 1;
- cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
- cu->tb[0].w = cu->tb[0].h = 0.0;
-
- tmp= text->lines.first;
- strcpy(cu->str, tmp->line);
- cu->len= strlen(tmp->line);
- cu->pos= cu->len;
-
- tmp= tmp->next;
-
- while(cu->len<MAXTEXT && tmp) {
- strcat(cu->str, "\n");
- strcat(cu->str, tmp->line);
- cu->len+= strlen(tmp->line) + 1;
- cu->pos= cu->len;
- tmp= tmp->next;
- }
-
- make_editText();
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-void txt_export_to_objects(struct Text *text)
-{
- ID *id;
- Curve *cu;
- struct TextLine *curline;
- int nchars;
- int linenum = 0;
- float offset[3] = {0.0,0.0,0.0};
-
- if(!text || !text->lines.first) return;
-
- id = (ID *)text;
-
- if (G.obedit && G.obedit->type==OB_FONT) return;
- check_editmode(OB_FONT);
-
- curline = text->lines.first;
- while(curline){
- /*skip lines with no text, but still make space for them*/
- if(curline->line[0] == '\0'){
- linenum++;
- curline = curline->next;
- continue;
- }
-
- nchars = 0;
- add_object(OB_FONT);
-
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
- where_is_object(G.obedit);
-
- /* Do the translation */
- offset[0] = 0;
- offset[1] = -linenum;
- offset[2] = 0;
-
- Mat4Mul3Vecfl(G.vd->viewinv,offset);
-
- G.obedit->loc[0] += offset[0];
- G.obedit->loc[1] += offset[1];
- G.obedit->loc[2] += offset[2];
- /* End Translation */
-
- cu= G.obedit->data;
-
- cu->vfont= get_builtin_font();
- cu->vfont->id.us++;
-
- nchars = strlen(curline->line) + 1;
-
- if(cu->str) MEM_freeN(cu->str);
- if(cu->strinfo) MEM_freeN(cu->strinfo);
-
- cu->str= MEM_mallocN(nchars+4, "str");
- cu->strinfo= MEM_callocN((nchars+4)*sizeof(CharInfo), "strinfo");
- cu->totbox= cu->actbox= 1;
- cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
- cu->tb[0].w = cu->tb[0].h = 0.0;
-
- strcpy(cu->str, curline->line);
- cu->len= strlen(curline->line);
- cu->pos= cu->len;
-
- make_editText();
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR);
-
- linenum++;
- curline = curline->next;
- }
- BIF_undo_push("Add Text as Objects");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static short next_word(Curve *cu)
-{
- short s;
- for (s=cu->pos; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
- (cu->str[s]!=1) && (cu->str[s]!='\r'); s++);
- if (cu->str[s]) return(s+1); else return(s);
-}
-
-static short prev_word(Curve *cu)
-{
- short s;
-
- if (cu->pos==0) return(0);
- for (s=cu->pos-2; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') &&
- (cu->str[s]!=1) && (cu->str[s]!='\r'); s--);
- if (cu->str[s]) return(s+1); else return(s);
-}
-
-
-
-static int killselection(int ins) /* 1 == new character */
-{
- int selend, selstart, direction;
- Curve *cu= G.obedit->data;
- int offset = 0;
- int getfrom;
-
- direction = getselection(&selstart, &selend);
- if (direction) {
- int size;
- if (ins) offset = 1;
- if (cu->pos >= selstart) cu->pos = selstart+offset;
- if ((direction == -1) && ins) {
- selstart++;
- selend++;
- }
- getfrom = selend+offset;
- if (ins==0) getfrom++;
- size = (cu->len * sizeof(wchar_t)) - (selstart * sizeof(wchar_t)) + (offset*sizeof(wchar_t));
- memmove(textbuf+selstart, textbuf+getfrom, size);
- memmove(textbufinfo+selstart, textbufinfo+getfrom, ((cu->len-selstart)+offset)*sizeof(CharInfo));
- cu->len -= (selend-selstart)+offset;
- cu->selstart = cu->selend = 0;
- }
- return(direction);
-}
-
-static void copyselection(void)
-{
- int selstart, selend;
-
- if (getselection(&selstart, &selend)) {
- memcpy(copybuf, textbuf+selstart, ((selend-selstart)+1)*sizeof(wchar_t));
- copybuf[(selend-selstart)+1]=0;
- memcpy(copybufinfo, textbufinfo+selstart, ((selend-selstart)+1)*sizeof(CharInfo));
- }
-}
-
-static void pasteselection(void)
-{
- Curve *cu= G.obedit->data;
-
- int len= wcslen(copybuf);
-
- // Verify that the copy buffer => [copy buffer len] + cu->len < MAXTEXT
- if(cu->len + len <= MAXTEXT)
- {
- if (len) {
- int size = (cu->len * sizeof(wchar_t)) - (cu->pos*sizeof(wchar_t)) + sizeof(wchar_t);
- memmove(textbuf+cu->pos+len, textbuf+cu->pos, size);
- memcpy(textbuf+cu->pos, copybuf, len * sizeof(wchar_t));
-
- memmove(textbufinfo+cu->pos+len, textbufinfo+cu->pos, (cu->len-cu->pos+1)*sizeof(CharInfo));
- memcpy(textbufinfo+cu->pos, copybufinfo, len*sizeof(CharInfo));
-
- cu->len += len;
- cu->pos += len;
- }
- }
- else
- {
- error("Text too long");
- }
-}
-
-int style_to_sel(int style, int toggle)
-{
- int selstart, selend;
- int i;
- Curve *cu;
-
- if (G.obedit && (G.obedit->type == OB_FONT)) {
- cu= G.obedit->data;
-
- if (getselection(&selstart, &selend)) {
- for (i=selstart; i<=selend; i++) {
- if (toggle==0) {
- textbufinfo[i].flag &= ~style;
- } else {
- textbufinfo[i].flag |= style;
- }
- }
- return 1;
- }
- }
- return 0;
-}
-
-int mat_to_sel(void) {
- int selstart, selend;
- int i;
- Curve *cu;
-
- if (G.obedit && (G.obedit->type == OB_FONT)) {
- cu= G.obedit->data;
-
- if (getselection(&selstart, &selend)) {
- for (i=selstart; i<=selend; i++) {
- textbufinfo[i].mat_nr = G.obedit->actcol;
- }
- return 1;
- }
- }
- return 0;
-}
-
-void do_textedit(unsigned short event, short val, unsigned long _ascii)
-{
- Curve *cu;
- static int accentcode= 0;
- int x, doit=0, cursmove=0;
- unsigned long ascii = _ascii;
- short kern;
-
- cu= G.obedit->data;
-
- if(ascii) {
-
- /* handle case like TAB (TAB==9) */
- if( (ascii > 31 && ascii < 254 && ascii != 127) || (ascii==13) || (ascii==10) || (ascii==8)) {
-
- if(accentcode) {
- if(cu->pos>0) textbuf[cu->pos-1]= findaccent(textbuf[cu->pos-1], ascii);
- accentcode= 0;
- }
- else if(cu->len<MAXTEXT-1) {
- if(G.qual & LR_ALTKEY ) {
-
- /* might become obsolete, apple has default values for this, other OS's too? */
-
- if(ascii=='t') ascii= 137;
- else if(ascii=='c') ascii= 169;
- else if(ascii=='f') ascii= 164;
- else if(ascii=='g') ascii= 176;
- else if(ascii=='l') ascii= 163;
- else if(ascii=='r') ascii= 174;
- else if(ascii=='s') ascii= 223;
- else if(ascii=='v') ascii= 1001;
- else if(ascii=='y') ascii= 165;
- else if(ascii=='.') ascii= 138;
- else if(ascii=='1') ascii= 185;
- else if(ascii=='2') ascii= 178;
- else if(ascii=='3') ascii= 179;
- else if(ascii=='%') ascii= 139;
- else if(ascii=='?') ascii= 191;
- else if(ascii=='!') ascii= 161;
- else if(ascii=='x') ascii= 215;
- else if(ascii=='>') ascii= 187;
- else if(ascii=='<') ascii= 171;
- }
- if(ascii==1001) {
- int file, filelen;
- char *strp;
-
-/* this should be solved by clipboard support */
-#ifdef __WIN32_DISABLED
- file= open("C:\\windows\\temp\\cutbuf", O_BINARY|O_RDONLY);
-#else
- file= open("/tmp/.cutbuffer", O_BINARY|O_RDONLY);
-#endif
- if(file>0) {
-
- filelen = BLI_filesize(file);
-
- strp= MEM_mallocN(filelen+4, "tempstr");
- read(file, strp, filelen);
- close(file);
- strp[filelen]= 0;
-
- if(cu->len+filelen<MAXTEXT) {
- int tmplen;
- wchar_t *mem = MEM_callocN((sizeof(wchar_t)*filelen)+(4*sizeof(wchar_t)), "temporary");
- tmplen = utf8towchar(mem, strp);
- wcscat(textbuf, mem);
- MEM_freeN(mem);
- cu->len += tmplen;
- cu->pos= cu->len;
- }
- MEM_freeN(strp);
- }
- }
- else {
- insert_into_textbuf(cu, ascii);
- }
- }
-
- killselection(1);
-
- doit= 1;
- }
- else
- {
- insert_into_textbuf(cu, ascii);
- doit = 1;
- }
- }
- else if(val) {
- cursmove= 0;
-
- switch(event) {
- case ENDKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- while(cu->pos<cu->len) {
- if( textbuf[cu->pos]==0) break;
- if( textbuf[cu->pos]=='\n') break;
- if( textbufinfo[cu->pos].flag & CU_WRAP ) break;
- cu->pos++;
- }
- cursmove=FO_CURS;
- break;
-
- case HOMEKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- while(cu->pos>0) {
- if( textbuf[cu->pos-1]=='\n') break;
- if( textbufinfo[cu->pos-1].flag & CU_WRAP ) break;
- cu->pos--;
- }
- cursmove=FO_CURS;
- break;
-
- case RETKEY:
- if(G.qual & LR_CTRLKEY) {
- insert_into_textbuf(cu, 1);
- if (textbuf[cu->pos]!='\n') insert_into_textbuf(cu, '\n');
- }
- else {
- insert_into_textbuf(cu, '\n');
- }
- cu->selstart = cu->selend = 0;
- doit= 1;
- break;
-
- case RIGHTARROWKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- if (G.qual & LR_CTRLKEY) {
- cu->pos= next_word(cu);
- cursmove= FO_CURS;
- }
- else if (G.qual & LR_ALTKEY) {
- kern = textbufinfo[cu->pos-1].kern;
- kern += 1;
- if (kern>20) kern = 20;
- textbufinfo[cu->pos-1].kern = kern;
- doit = 1;
- }
- else {
- cu->pos++;
- cursmove= FO_CURS;
- }
-
- break;
-
- case LEFTARROWKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- if (G.qual & LR_CTRLKEY) {
- cu->pos= prev_word(cu);
- cursmove= FO_CURS;
- }
- else if (G.qual & LR_ALTKEY) {
- kern = textbufinfo[cu->pos-1].kern;
- kern -= 1;
- if (kern<-20) kern = -20;
- textbufinfo[cu->pos-1].kern = kern;
- doit = 1;
- }
- else {
- cu->pos--;
- cursmove=FO_CURS;
- }
- break;
-
- case UPARROWKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- if(G.qual & LR_ALTKEY) {
- if (cu->pos && textbuf[cu->pos - 1] < 255) {
- textbuf[cu->pos - 1]++;
- doit= 1;
- }
- }
- else cursmove=FO_CURSUP;
- break;
-
- case PAGEUPKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- cursmove=FO_PAGEUP;
- break;
-
- case DOWNARROWKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- if(G.qual & LR_ALTKEY) {
- if (cu->pos && textbuf[cu->pos - 1] > 1) {
- textbuf[cu->pos - 1]--;
- doit= 1;
- }
- }
- else cursmove= FO_CURSDOWN;
- break;
-
- case PAGEDOWNKEY:
- if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1;
- cursmove=FO_PAGEDOWN;
- break;
-
- case BACKSPACEKEY:
- if(cu->len!=0) {
- if(G.qual & LR_ALTKEY) {
- if(cu->pos>0) accentcode= 1;
- }
- else if (G.qual & LR_CTRLKEY) {
- cu->len = cu->pos = 0;
- textbuf[0]= 0;
- doit= 1;
- }
- else {
- if (killselection(0)==0) {
- if (cu->pos>0) {
- for(x=cu->pos;x<=cu->len;x++) textbuf[x-1]= textbuf[x];
- for(x=cu->pos;x<=cu->len;x++) textbufinfo[x-1]= textbufinfo[x];
- cu->pos--;
- textbuf[--cu->len]='\0';
- doit=1;
- }
- } else doit=1;
- }
- }
- break;
-
- case DELKEY:
- if(cu->len!=0) {
- if (killselection(0)==0) {
- if(cu->pos<cu->len) {
- for(x=cu->pos;x<cu->len;x++) textbuf[x]= textbuf[x+1];
- for(x=cu->pos;x<cu->len;x++) textbufinfo[x]= textbufinfo[x+1];
- textbuf[--cu->len]='\0';
- doit=1;
- }
- } else doit=1;
- }
- break;
-
- case IKEY:
- if (G.qual & LR_CTRLKEY) {
- cu->curinfo.flag ^= CU_ITALIC;
- if (style_to_sel(CU_ITALIC, cu->curinfo.flag & CU_ITALIC)) doit= 1;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case BKEY:
- if (G.qual & LR_CTRLKEY) {
- cu->curinfo.flag ^= CU_BOLD;
- if (style_to_sel(CU_BOLD, cu->curinfo.flag & CU_BOLD)) doit= 1;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case UKEY:
- if (G.qual & LR_CTRLKEY) {
- cu->curinfo.flag ^= CU_UNDERLINE;
- if (style_to_sel(CU_UNDERLINE, cu->curinfo.flag & CU_UNDERLINE)) doit= 1;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
-
- case XKEY:
- if (G.qual & LR_CTRLKEY) {
- copyselection();
- killselection(0);
- doit= 1;
- }
- break;
-
- case CKEY:
- if (G.qual & LR_CTRLKEY) {
- copyselection();
- }
- break;
-
- case VKEY:
- if (G.qual & LR_CTRLKEY) {
- pasteselection();
- doit= 1;
- }
- break;
-
- }
-
- if(cursmove) {
- if ((G.qual & LR_SHIFTKEY)==0) {
- if (cu->selstart) {
- cu->selstart = cu->selend = 0;
- update_string(cu);
- text_to_curve(G.obedit, FO_SELCHANGE);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- if(cu->pos>cu->len) cu->pos= cu->len;
- else if(cu->pos>=MAXTEXT) cu->pos= MAXTEXT;
- else if(cu->pos<0) cu->pos= 0;
- }
- }
- if(doit || cursmove) {
-
- if (cu->pos) {
- cu->curinfo = textbufinfo[cu->pos-1];
- } else cu->curinfo = textbufinfo[0];
-
- if (G.obedit->totcol>0) {
- G.obedit->actcol = textbufinfo[cu->pos-1].mat_nr;
- }
- allqueue(REDRAWBUTSEDIT, 0);
- update_string(cu);
- text_to_curve(G.obedit, cursmove);
- if (cursmove && (G.qual & LR_SHIFTKEY)) {
- cu->selend = cu->pos;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- if(cursmove==0) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
-
- BIF_undo_push("Textedit");
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-void paste_unicodeText(char *filename)
-{
- Curve *cu= G.obedit->data;
- int filelen, doit= 0;
- char *strp;
- FILE *fp = NULL;
-
- fp= fopen(filename, "r");
-
- if(fp) {
-
- fseek( fp, 0L, SEEK_END );
- filelen = ftell( fp );
- fseek( fp, 0L, SEEK_SET );
-
- strp= MEM_mallocN(filelen+4, "tempstr");
- //fread() instead of read(),
- //because windows read() converts text to DOS \r\n linebreaks
- //causing double linebreaks in the 3d text
- filelen = fread(strp, 1, filelen, fp);
- fclose(fp);
- strp[filelen]= 0;
-
-
- if(cu->len+filelen<MAXTEXT)
- {
- int tmplen;
- wchar_t *mem = MEM_callocN((sizeof(wchar_t)*filelen)+(4*sizeof(wchar_t)), "temporary");
- tmplen = utf8towchar(mem, strp);
-// mem =utf8s2wc(strp);
- wcscat(textbuf, mem);
- MEM_freeN(mem);
- cu->len += tmplen;
- cu->pos= cu->len;
- }
- MEM_freeN(strp);
- doit = 1;
- }
- if(doit) {
- update_string(cu);
- text_to_curve(G.obedit, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Paste text");
- }
-}
-
-void paste_editText(void)
-{
- Curve *cu= G.obedit->data;
- int filelen, doit= 0;
- char *strp;
- FILE *fp = NULL;
-
-#ifdef WIN32
- fp= fopen("C:\\windows\\temp\\cutbuf.txt", "r");
-
-// The following is more likely to work on all Win32 installations.
-// suggested by Douglas Toltzman. Needs windows include files...
-/*
- char tempFileName[MAX_PATH];
- DWORD pathlen;
- static const char cutbufname[]="cutbuf.txt";
-
- if ((pathlen=GetTempPath(sizeof(tempFileName),tempFileName)) > 0 &&
- pathlen + sizeof(cutbufname) <= sizeof(tempFileName))
- {
- strcat(tempFileName,cutbufname);
- file= open(tempFileName, O_BINARY|O_RDONLY);
- }
-*/
-#else
- fp= fopen("/tmp/.cutbuffer", "r");
-#endif
-
- if(fp) {
-
- fseek(fp, 0L, SEEK_END);
- filelen = ftell( fp );
- fseek(fp, 0L, SEEK_SET);
-
- strp= MEM_mallocN(filelen+4, "tempstr");
- // fread() instead of read(),
- // because windows read() converts text to DOS \r\n linebreaks
- // causing double linebreaks in the 3d text
- filelen = fread(strp, 1, filelen, fp);
- fclose(fp);
- strp[filelen]= 0;
-
- if(cu->len+filelen<MAXTEXT) {
- int tmplen;
- wchar_t *mem = MEM_callocN((sizeof(wchar_t) * filelen) + (4 * sizeof(wchar_t)), "temporary");
- tmplen = utf8towchar(mem, strp);
- wcscat(textbuf, mem);
- MEM_freeN(mem);
- cu->len += tmplen;
- cu->pos= cu->len;
- }
- MEM_freeN(strp);
- doit = 1;
- }
- if(doit) {
- update_string(cu);
- text_to_curve(G.obedit, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Paste text");
- }
-}
-
-
-void make_editText(void)
-{
- Curve *cu;
- cu= G.obedit->data;
-
- if(textbuf==NULL) textbuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditbuf");
- if(textbufinfo==NULL) textbufinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "texteditbufinfo");
- if(copybuf==NULL) copybuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditcopybuf");
- if(copybufinfo==NULL) copybufinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "texteditcopybufinfo");
- if(oldstr==NULL) oldstr= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "oldstrbuf");
-
- // Convert the original text to wchar_t
- utf8towchar(textbuf, cu->str);
- wcscpy(oldstr, textbuf);
-
- cu->len= wcslen(textbuf);
-
- memcpy(textbufinfo, cu->strinfo, (cu->len)*sizeof(CharInfo));
-
- oldstrinfo= cu->strinfo;
- cu->strinfo= textbufinfo;
-
- if(cu->pos>cu->len) cu->pos= cu->len;
-
- if (cu->pos) {
- cu->curinfo = textbufinfo[cu->pos-1];
- } else cu->curinfo = textbufinfo[0];
-
- // Convert to UTF-8
- update_string(cu);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- textediting= 1;
- BIF_undo_push("Original");
-}
-
-
-void load_editText(void)
-{
- Curve *cu;
-
- cu= G.obedit->data;
-
- MEM_freeN(oldstr);
- oldstr= NULL;
- MEM_freeN(oldstrinfo);
- oldstrinfo= NULL;
-
- update_string(cu);
-
- cu->strinfo= MEM_callocN((cu->len+4)*sizeof(CharInfo), "texteditinfo");
- memcpy(cu->strinfo, textbufinfo, (cu->len)*sizeof(CharInfo));
-
- cu->len= strlen(cu->str);
-
- /* this memory system is weak... */
- MEM_freeN(textbuf);
- MEM_freeN(textbufinfo);
- textbuf= NULL;
- textbufinfo= NULL;
-
- if (selboxes) {
- MEM_freeN(selboxes);
- selboxes= NULL;
- }
-
- textediting= 0;
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-}
-
-
-void remake_editText(void)
-{
- Curve *cu;
-
- if(okee("Reload original text")==0) return;
-
- // Copy the oldstr to textbuf temporary global variable
- wcscpy(textbuf, oldstr);
-
- // Set the object length and position
- cu= G.obedit->data;
- cu->len= wcslen(textbuf);
- if(cu->pos>cu->len) cu->pos= cu->len;
-
- update_string(cu);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-
- BIF_undo_push("Reload");
-}
-
-
-void free_editText(void)
-{
- if(oldstr) MEM_freeN(oldstr);
- if(oldstrinfo) MEM_freeN(oldstrinfo);
- if(textbuf) MEM_freeN(textbuf);
- textbuf = oldstr = NULL;
- textbufinfo = oldstrinfo = NULL;
- textediting= 0;
-}
-
-
-void add_primitiveFont(int dummy_argument)
-{
- Curve *cu;
-
- if (G.obedit && G.obedit->type==OB_FONT) return;
- check_editmode(OB_FONT);
-
- add_object_draw(OB_FONT);
- base_init_from_view3d(BASACT, G.vd);
-
- where_is_object(BASACT->object);
-
- cu= BASACT->object->data;
-
- cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font();
- cu->vfont->id.us+=4;
- cu->str= MEM_mallocN(12, "str");
- strcpy(cu->str, "Text");
- cu->pos= 4;
- cu->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo");
- cu->totbox= cu->actbox= 1;
- cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
- cu->tb[0].w = cu->tb[0].h = 0.0;
-
- if (U.flag & USER_ADD_EDITMODE)
- enter_editmode(EM_WAITCURSOR);
-
- allqueue(REDRAWALL, 0);
-}
-
-void to_upper(void)
-{
- Curve *cu;
- int len, ok;
- wchar_t *str;
-
- if(G.obedit==0) {
- return;
- }
-
- ok= 0;
- cu= G.obedit->data;
-
- len= wcslen(textbuf);
- str= textbuf;
- while(len) {
- if( *str>=97 && *str<=122) {
- ok= 1;
- *str-= 32;
- }
- len--;
- str++;
- }
-
- if(ok==0) {
- len= wcslen(textbuf);
- str= textbuf;
- while(len) {
- if( *str>=65 && *str<=90) {
- *str+= 32;
- }
- len--;
- str++;
- }
- }
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("To upper");
-
- update_string(cu);
-}
-
-
-/* **************** undo for font object ************** */
-
-static void undoFont_to_editFont(void *strv)
-{
- Curve *cu= G.obedit->data;
- char *str= strv;
-
- cu->pos= *((short *)str);
- cu->len= *((short *)(str+2));
-
- memcpy(textbuf, str+4, (cu->len+1)*sizeof(wchar_t));
- memcpy(textbufinfo, str+4 + (cu->len+1)*sizeof(wchar_t), cu->len*sizeof(CharInfo));
-
- cu->selstart = cu->selend = 0;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- update_string(cu);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void *editFont_to_undoFont(void)
-{
- Curve *cu= G.obedit->data;
- char *str;
-
- // The undo buffer includes [MAXTEXT+6]=actual string and [MAXTEXT+4]*sizeof(CharInfo)=charinfo
- str= MEM_callocN((MAXTEXT+6)*sizeof(wchar_t) + (MAXTEXT+4)*sizeof(CharInfo), "string undo");
-
- // Copy the string and string information
- memcpy(str+4, textbuf, (cu->len+1)*sizeof(wchar_t));
- memcpy(str+4 + (cu->len+1)*sizeof(wchar_t), textbufinfo, cu->len*sizeof(CharInfo));
-
- *((short *)str)= cu->pos;
- *((short *)(str+2))= cu->len;
-
- return str;
-}
-
-static void free_undoFont(void *strv)
-{
- MEM_freeN(strv);
-}
-
-/* and this is all the undo system needs to know */
-void undo_push_font(char *name)
-{
- undo_editmode_push(name, free_undoFont, undoFont_to_editFont, editFont_to_undoFont, NULL);
-}
-
-
-
-/***/
diff --git a/source/blender/src/editgroup.c b/source/blender/src/editgroup.c
deleted file mode 100644
index e4906568f3b..00000000000
--- a/source/blender/src/editgroup.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_group_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_group.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#include "BIF_interface.h"
-#include "BIF_editgroup.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-void add_selected_to_group(Group *group)
-{
- Base *base;
-
- for(base=FIRSTBASE; base; base= base->next) {
- if TESTBASE(base) {
- add_to_group(group, base->object);
- base->object->flag |= OB_FROMGROUP;
- base->flag |= OB_FROMGROUP;
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- DAG_scene_sort(G.scene);
- BIF_undo_push("Add to Group");
-}
-
-void add_selected_to_act_ob_groups(void)
-{
- Object *ob= OBACT, *obt;
- Base *base;
- Group *group;
-
- if (!ob) return;
-
- /* linking to same group requires its own loop so we can avoid
- looking up the active objects groups each time */
-
- group= G.main->group.first;
- while(group) {
- if(object_in_group(ob, group)) {
- /* Assign groups to selected objects */
- base= FIRSTBASE;
- while(base) {
- if(TESTBASE(base)) {
- obt= base->object;
- add_to_group(group, obt);
- obt->flag |= OB_FROMGROUP;
- base->flag |= OB_FROMGROUP;
- }
- base= base->next;
- }
- }
- group= group->id.next;
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- DAG_scene_sort(G.scene);
- BIF_undo_push("Add to Active Objects Group");
-}
-
-
-void rem_selected_from_all_groups(void)
-{
- Base *base;
- Group *group;
-
- for(base=FIRSTBASE; base; base= base->next) {
- if TESTBASE(base) {
- group = NULL;
- while( (group = find_group(base->object, group)) ) {
- rem_from_group(group, base->object);
- }
- base->object->flag &= ~OB_FROMGROUP;
- base->flag &= ~OB_FROMGROUP;
- }
- }
-
- DAG_scene_sort(G.scene);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- BIF_undo_push("Remove from Group");
-}
-
-
-void rem_selected_from_group(void)
-{
- char menutext[30+(22*22)], *menupt;
- int i=0;
- short ret;
- Group *group= NULL;
- Object *ob;
- Base *base;
- Group *group_array[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
- /* UnSet Tags for Objects and Groups */
- for(group= G.main->group.first; group; group= group->id.next) {
- if(group->id.lib==NULL) {
- group->id.flag &= ~LIB_DOIT;
- }
- }
- for(ob=G.main->object.first; ob; ob= ob->id.next) {
- ob->id.flag &= ~LIB_DOIT;
- }
-
- /* Not tag selected objects */
- for(base=FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- base->object->id.flag |= LIB_DOIT;
- }
- }
-
- menupt = menutext;
- /* Build a list of groups that contain selected objects */
- for(group= G.main->group.first; group && i<24; group= group->id.next) {
- if(group->id.lib==NULL) {
- GroupObject *go;
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob->id.flag & LIB_DOIT) {
- group_array[i] = group;
- menupt += sprintf(menupt, "|%s", group->id.name+2);
- i++;
- break; /* Only want to know if this group should go in the list*/
- }
- }
- }
- }
-
- /* do we have any groups? */
- if (group_array[0] == NULL) {
- error("Object selection contains no groups");
- } else {
- ret = pupmenu(menutext);
- if (ret==-1) {
- return;
- } else {
- group = group_array[ret-1];
- for(base=FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- /* if we are removed and are not in any group, set our flag */
- if(rem_from_group(group, base->object) && find_group(base->object, NULL)==NULL) {
- base->object->flag &= ~OB_FROMGROUP;
- base->flag &= ~OB_FROMGROUP;
- }
- }
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- DAG_scene_sort(G.scene);
- BIF_undo_push("Remove from Group");
-}
-
-void group_operation_with_menu(void)
-{
- Group *group= NULL;
- int mode;
-
- /* are there existing groups? */
- for(group= G.main->group.first; group; group= group->id.next)
- if(group->id.lib==NULL)
- break;
-
- if(group)
- mode= pupmenu("Groups %t|Add to Existing Group %x3|Add to Active Objects Groups %x4|Add to New Group %x1|Remove from Group %x5|Remove from All Groups %x2");
- else
- mode= pupmenu("Groups %t|Add to New Group %x1|Remove from All Groups %x2");
-
- group_operation(mode);
-}
-
-void group_operation(int mode)
-{
- Group *group= NULL;
-
- /* are there existing groups? */
- for(group= G.main->group.first; group; group= group->id.next)
- if(group->id.lib==NULL)
- break;
-
- if(mode>0) {
- if(group==NULL || mode==1) group= add_group( "Group" );
- if(mode==3) {
- int tot= BLI_countlist(&G.main->group);
- char *strp= MEM_callocN(tot*32 + 32, "group menu"), *strp1;
-
- strp1= strp;
- for(tot=1, group= G.main->group.first; group; group= group->id.next, tot++) {
- if(group->id.lib==NULL) {
- strp1 += sprintf(strp1, "%s %%x%d|", group->id.name+2, tot);
- }
- }
- tot= pupmenu_col(strp, 20);
- MEM_freeN(strp);
- if(tot>0) group= BLI_findlink(&G.main->group, tot-1);
- else return;
- }
-
- if(mode==4) add_selected_to_act_ob_groups();
- else if(mode==1 || mode==3) add_selected_to_group(group);
- else if(mode==2) rem_selected_from_all_groups();
- else if(mode==5) rem_selected_from_group();
- }
-}
diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c
deleted file mode 100644
index 8335af21247..00000000000
--- a/source/blender/src/editimasel.c
+++ /dev/null
@@ -1,1183 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <sys/times.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_depsgraph.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_storage_types.h"
-
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
-
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_view3d_types.h"
-
-
-#include "BIF_filelist.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_imasel.h"
-#include "BIF_gl.h"
-#include "BIF_fsmenu.h"
-#include "BIF_editview.h"
-#include "BIF_toolbox.h"
-
-#include "BLO_readfile.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_drawimasel.h"
-#include "BSE_edit.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-/* for events */
-#define NOTACTIVE 0
-#define ACTIVATE 1
-#define INACTIVATE 2
-/* for state of file */
-#define ACTIVE 2
-
-static void imasel_select_objects(SpaceImaSel *simasel);
-
-static int imasel_has_func(SpaceImaSel *simasel)
-{
- if(simasel->returnfunc || simasel->returnfunc_event || simasel->returnfunc_args)
- return 1;
- return 0;
-}
-
-#if defined __BeOS
-static int fnmatch(const char *pattern, const char *string, int flags)
-{
- return 0;
-}
-#elif defined WIN32 && !defined _LIBC
- /* use fnmatch included in blenlib */
- #include "BLI_fnmatch.h"
-#else
- #include <fnmatch.h>
-#endif
-
-static void imasel_split_file(SpaceImaSel *simasel, char *s1)
-{
- char string[FILE_MAX], dir[FILE_MAX], file[FILE_MAX];
-
- BLI_strncpy(string, s1, sizeof(string));
-
- BLI_split_dirfile(string, dir, file);
-
- if(simasel->files) {
- BIF_filelist_free(simasel->files);
- }
- BLI_strncpy(simasel->file, file, sizeof(simasel->file));
- BLI_strncpy(simasel->dir, dir, sizeof(simasel->dir));
-
- BIF_filelist_setdir(simasel->files, dir);
-
- BLI_make_file_string(G.sce, simasel->dir, dir, "");
-}
-
-/**************** IMAGESELECT ******************************/
-
-/* the complete call; pulldown menu, and three callback types */
-static void activate_imageselect_(int type, char *title, char *file, short *menup, char *pupmenu,
- void (*func)(char *),
- void (*func_event)(unsigned short),
- void (*func_args)(char *, void *arg1, void *arg2),
- void *arg1, void *arg2)
-{
- SpaceImaSel *simasel;
- char group[24], name[FILE_MAX], temp[FILE_MAX];
-
- if(curarea==0) return;
- if(curarea->win==0) return;
-
- newspace(curarea, SPACE_IMASEL);
- scrarea_queue_winredraw(curarea);
-
- /* sometime double, when area already is SPACE_IMASEL with a different file name */
- if(curarea->headwin) addqueue(curarea->headwin, CHANGED, 1);
-
- name[2]= 0;
- BLI_strncpy(name, file, sizeof(name));
- BLI_convertstringcode(name, G.sce);
-
- simasel= curarea->spacedata.first;
-
- simasel->returnfunc= func;
- simasel->returnfunc_event= func_event;
- simasel->returnfunc_args= func_args;
- simasel->arg1= arg1;
- simasel->arg2= arg2;
-
- simasel->type= type;
- simasel->scrollpos = 0.0f;
-
- if(simasel->pupmenu)
- MEM_freeN(simasel->pupmenu);
- simasel->pupmenu= pupmenu;
- simasel->menup= menup;
-
- /* sfile->act is used for databrowse: double names of library objects */
- simasel->active_file= -1;
-
- if(!simasel->files) {
- simasel->files = BIF_filelist_new();
- }
-
- if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER)
- simasel->flag |= FILE_STRINGCODE;
- else
- simasel->flag &= ~FILE_STRINGCODE;
-
- if (U.uiflag & USER_HIDE_DOT)
- simasel->flag |= FILE_HIDE_DOT;
-
- if(type==FILE_MAIN) {
- char *groupname;
-
- BLI_strncpy(simasel->file, name+2, sizeof(simasel->file));
-
- groupname = BLO_idcode_to_name( GS(name) );
- if (groupname) {
- BLI_strncpy(simasel->dir, groupname, sizeof(simasel->dir) - 1);
- strcat(simasel->dir, "/");
- }
-
- /* free all */
- if (simasel->files) {
- BIF_filelist_freelib(simasel->files);
- BIF_filelist_free(simasel->files);
- BIF_filelist_setdir(simasel->files, simasel->dir);
- BIF_filelist_settype(simasel->files, type);
- }
- }
- else if(type==FILE_LOADLIB) {
-
- if( BIF_filelist_islibrary(simasel->files, temp, group) ) {
- /* force a reload of the library-filelist */
- BIF_filelist_free(simasel->files);
- BIF_filelist_freelib(simasel->files);
- BLI_strncpy(simasel->dir, name, sizeof(simasel->dir));
- BIF_filelist_setdir(simasel->files, simasel->dir);
- BIF_filelist_settype(simasel->files, type);
- }
- else {
- imasel_split_file(simasel, name);
- BIF_filelist_freelib(simasel->files);
- BIF_filelist_settype(simasel->files, type);
- }
- }
- else { /* FILE_BLENDER */
- imasel_split_file(simasel, name);
- BIF_filelist_settype(simasel->files, type);
-
- BLI_cleanup_dir(G.sce, simasel->dir);
-
- /* free: filelist and libfiledata became incorrect */
- BIF_filelist_freelib(simasel->files);
- }
- BLI_strncpy(simasel->title, title, sizeof(simasel->title));
- /* filetoname= 1; */ /* TODO: elubie - check what this means */
-}
-
-void activate_imageselect(int type, char *title, char *file, void (*func)(char *))
-{
- activate_imageselect_(type, title, file, NULL, NULL, func, NULL, NULL, NULL, NULL);
-}
-
-void activate_imageselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *))
-{
- activate_imageselect_(type, title, file, menup, pupmenu, func, NULL, NULL, NULL, NULL);
-}
-
-void activate_imageselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2)
-{
- activate_imageselect_(type, title, file, NULL, NULL, NULL, NULL, func, arg1, arg2);
-}
-
-void activate_databrowse_imasel(ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short))
-{
- ListBase *lb;
- SpaceImaSel *simasel;
- char str[32];
-
- if(id==NULL) {
- lb= wich_libbase(G.main, idcode);
- id= lb->first;
- }
-
- if(id) BLI_strncpy(str, id->name, sizeof(str));
- else return;
-
- activate_imageselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, func, NULL, NULL, NULL);
-
- simasel= curarea->spacedata.first;
- simasel->retval= retval;
- simasel->menup= menup;
-
- BIF_filelist_setipotype(simasel->files, fromcode);
- BIF_filelist_hasfunc(simasel->files, imasel_has_func(simasel));
-}
-
-
-static void set_active_file(SpaceImaSel *simasel, short x, short y)
-{
- short tilex, tiley;
- int active_tile;
- int active_file;
- int stridex;
- struct direntry* file;
- rcti viewrect = simasel->viewrect;
- int fileoffset;
- int rowoffset;
- int rowleftover;
- float scrollofs;
- int numfiles;
- int tilewidth = simasel->prv_w + TILE_BORDER_X*4;
- int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize;
-
- numfiles = BIF_filelist_numfiles(simasel->files);
-
- if (simasel->numtilesx > 0) {
- fileoffset = numfiles*(simasel->scrollpos / simasel->scrollarea) + 0.5;
- rowoffset = (fileoffset / simasel->numtilesx)*simasel->numtilesx;
- rowleftover = fileoffset % simasel->numtilesx;
- scrollofs = (float)tileheight*(float)rowleftover/(float)simasel->numtilesx;
-
- stridex = (viewrect.xmax - viewrect.xmin) / (tilewidth);
- tilex = ( (x-viewrect.xmin)) / (tilewidth);
- tiley = (viewrect.ymax - viewrect.ymin + scrollofs - y) / (tileheight);
- if (tilex >= simasel->numtilesx) tilex = simasel->numtilesx-1;
- if (tiley >= simasel->numtilesy+1) tiley = simasel->numtilesy;
- if (tilex < 0) tilex=0;
- if (tiley < 0) tiley = 0;
- active_tile = tilex + stridex*tiley;
- active_file = rowoffset + active_tile;
-
- if (active_file >= 0 && active_file < BIF_filelist_numfiles(simasel->files) )
- {
- simasel->active_file = active_file;
- if (simasel->selstate & ACTIVATE) {
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- file->flags |= ACTIVE;
- }
- } else {
- simasel->active_file = -1;
- }
- } else {
- simasel->active_file = -1;
- }
-}
-
-static void set_active_bookmark(SpaceImaSel *simasel, short y)
-{
- int nentries = fsmenu_get_nentries();
- short posy = simasel->bookmarkrect.ymax - TILE_BORDER_Y - y;
- simasel->active_bookmark = ((float)posy / (U.fontsize*3.0f/2.0f));
- if (simasel->active_bookmark < 0 || simasel->active_bookmark > nentries) {
- simasel->active_bookmark = -1;
- }
-}
-
-static void imasel_prevspace()
-{
- SpaceImaSel *simasel;
-
- simasel= curarea->spacedata.first;
-
- /* cleanup */
- if(simasel->spacetype==SPACE_IMASEL) {
- if(simasel->pupmenu) {
- MEM_freeN(simasel->pupmenu);
- simasel->pupmenu= NULL;
- }
- }
-
- if(simasel->next) {
-
- BLI_remlink(&curarea->spacedata, simasel);
- BLI_addtail(&curarea->spacedata, simasel);
-
- simasel= curarea->spacedata.first;
-
- if (simasel->spacetype == SPACE_SCRIPT) {
- SpaceScript *sc = (SpaceScript *)simasel;
- if (sc->script) sc->script->flags &=~SCRIPT_FILESEL;
- }
-
- newspace(curarea, simasel->spacetype);
- }
- else newspace(curarea, SPACE_INFO);
-}
-
-static void free_imasel_spec(char *dir)
-{
- /* all filesels with 'dir' are freed */
- bScreen *sc;
-
- sc= G.main->screen.first;
- while(sc) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_FILE) {
- SpaceImaSel *simasel= (SpaceImaSel*) sl;
- if (BLI_streq(simasel->dir, dir)) {
- BIF_filelist_free(simasel->files);
- }
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- sc= sc->id.next;
- }
-}
-
-static void do_library_append(SpaceImaSel *simasel)
-{
- Library *lib;
- char dir[FILE_MAX], group[32];
-
- if ( BIF_filelist_islibrary(simasel->files, dir, group)==0 ) {
- error("Not a library");
- } else if (!BIF_filelist_lib(simasel->files) ) {
- error("Library not loaded");
- } else if (group[0]==0) {
- error("Nothing indicated");
- } else if (BLI_streq(G.main->name, dir)) {
- error("Cannot use current file as library");
- } else {
- Object *ob;
- int idcode = BIF_groupname_to_code(group);
-
- if((simasel->flag & FILE_LINK)==0) {
- /* tag everything, all untagged data can be made local */
- ID *id;
- ListBase *lbarray[MAX_LIBARRAY];
- int a;
-
- a= set_listbasepointers(G.main, lbarray);
- while(a--) {
- for(id= lbarray[a]->first; id; id= id->next) id->flag |= LIB_APPEND_TAG;
- }
- }
-
- BIF_filelist_append_library(simasel->files, dir, simasel->file, simasel->flag, idcode);
-
- /* DISPLISTS? */
- ob= G.main->object.first;
- while(ob) {
- if(ob->id.lib) {
- ob->recalc |= OB_RECALC;
- }
- ob= ob->id.next;
- }
-
- /* and now find the latest append lib file */
- lib= G.main->library.first;
- while(lib) {
- if (BLI_streq(dir, lib->filename)) break;
- lib= lib->id.next;
- }
-
- /* make local */
- if(lib) {
- if((simasel->flag & FILE_LINK)==0)
- all_local(lib,1);
- }
-
- DAG_scene_sort(G.scene);
-
- /* in sfile->dir is the whole lib name */
- BLI_strncpy(G.lib, simasel->dir, sizeof(G.lib) );
-
- }
-}
-
-/* NOTE: this is called for file read, after the execfunc no UI memory is valid! */
-static void imasel_execute(SpaceImaSel *simasel)
-{
- struct direntry *file;
- char name[FILE_MAX];
- int a;
- int n;
-
- imasel_prevspace();
-
- if(simasel->type==FILE_LOADLIB) {
- if(simasel->flag & FILE_STRINGCODE) {
- if (!G.relbase_valid) {
- okee("You have to save the .blend file before using relative paths! Using absolute path instead.");
- simasel->flag &= ~FILE_STRINGCODE;
- }
- }
-
- do_library_append(simasel);
- BIF_undo_push("Append from file");
- allqueue(REDRAWALL, 1);
- }
- else if(imasel_has_func(simasel)) {
- fsmenu_insert_entry(simasel->dir, 1, 0);
-
- if(simasel->type==FILE_MAIN) { /* DATABROWSE */
- if (simasel->menup) { /* with value pointing to ID block index */
- int notfound = 1;
-
- /* Need special handling since hiding .* datablocks means that
- simasel->active_file is no longer the same as files->nr.
-
- Also, toggle HIDE_DOT on and off can make simasel->active_file not longer
- correct (meaning it doesn't point to the correct item in the filelist.
-
- simasel->file is always correct, so first with check if, for the item
- corresponding to simasel->active_file, the name is the same.
-
- If it isn't (or if simasel->active_file is not good), go over filelist and take
- the correct one.
-
- This means that selecting a datablock than hiding it makes it
- unselectable. Not really a problem.
-
- - theeth
- */
-
- *simasel->menup= -1;
- n = BIF_filelist_numfiles(simasel->files);
- if(simasel->files) {
- if( (simasel->active_file>=0) && (simasel->active_file < n) ) {
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- if ( strcmp(file->relname, simasel->file)==0) {
- notfound = 0;
- *simasel->menup= file->nr;
- }
- }
- if (notfound) {
- for(a=0; a<n; a++) {
- file = BIF_filelist_file(simasel->files, a);
- if( strcmp(file->relname, simasel->file)==0) {
- *simasel->menup= file->nr;
- break;
- }
- }
- }
- }
- }
- if(simasel->returnfunc_event)
- simasel->returnfunc_event(simasel->retval);
- else if(simasel->returnfunc_args)
- simasel->returnfunc_args(NULL, simasel->arg1, simasel->arg2);
- }
- else {
- if(strncmp(simasel->title, "Save", 4)==0) free_imasel_spec(simasel->dir);
- if(strncmp(simasel->title, "Export", 6)==0) free_imasel_spec(simasel->dir);
-
- BLI_strncpy(name, simasel->dir, sizeof(name));
- strcat(name, simasel->file);
-
- if(simasel->flag & FILE_STRINGCODE) {
- /* still weak, but we don't want saving files to make relative paths */
- if(G.relbase_valid && strncmp(simasel->title, "Save", 4)) {
- BLI_makestringcode(G.sce, name);
- } else {
- /* if we don't have a valid relative base (.blend file hasn't been saved yet)
- then we don't save the path as relative (for texture images, background image).
- Warning message not shown when saving files (doesn't make sense there)
- */
- if (strncmp(simasel->title, "Save", 4)) {
- printf("Relative path setting has been ignored because .blend file hasn't been saved yet.\n");
- }
- simasel->flag &= ~FILE_STRINGCODE;
- }
- }
- if(simasel->returnfunc)
- simasel->returnfunc(name);
- else if(simasel->returnfunc_args)
- simasel->returnfunc_args(name, simasel->arg1, simasel->arg2);
- }
- }
-}
-
-static void do_imasel_buttons(short event, SpaceImaSel *simasel)
-{
- char butname[FILE_MAX];
-
- if (event == B_FS_FILENAME) {
- if (strchr(simasel->file, '*') || strchr(simasel->file, '?') || strchr(simasel->file, '[')) {
- int i, match = FALSE;
- struct direntry *file;
- int n = BIF_filelist_numfiles(simasel->files);
- for (i = 2; i < n; i++) {
- file = BIF_filelist_file(simasel->files, i);
- if (fnmatch(simasel->file, file->relname, 0) == 0) {
- file->flags |= ACTIVE;
- match = TRUE;
- }
- }
- if (match) simasel->file[0] = '\0';
- if(simasel->type==FILE_MAIN) imasel_select_objects(simasel);
- scrarea_queue_winredraw(curarea);
- }
- }
- else if(event== B_FS_DIRNAME) {
-
- /* convienence shortcut '~' -> $HOME
- * If the first char is ~ then this is invalid on all OS's so its safe to replace with home */
- if ( simasel->dir[0] == '~' ) {
- if (simasel->dir[1] == '\0') {
- BLI_strncpy(simasel->dir, BLI_gethome(), sizeof(simasel->dir) );
- } else {
- /* replace ~ with home */
- char tmpstr[FILE_MAX];
- BLI_join_dirfile(tmpstr, BLI_gethome(), simasel->dir+1);
- BLI_strncpy(simasel->dir, tmpstr, sizeof(simasel->dir));
- }
- }
-
- /* reuse the butname vsariable */
- BLI_cleanup_dir(G.sce, simasel->dir);
-
- BLI_make_file_string(G.sce, butname, simasel->dir, "");
- BLI_strncpy(simasel->dir, butname, sizeof(simasel->dir));
-
- /* strip the trailing slash if its a real dir */
- if (strlen(butname)!=1)
- butname[strlen(butname)-1]=0;
-
- /* updating the directory in the filelist */
- BIF_filelist_setdir(simasel->files, simasel->dir);
-
- if(simasel->type & FILE_UNIX) {
- if (!BLI_exists(butname)) {
- if (okee("Makedir")) {
- BLI_recurdir_fileops(butname);
- if (!BLI_exists(butname)) {
- BIF_filelist_free(simasel->files);
- BIF_filelist_parent(simasel->files);
- BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80);
- }
- } else {
- BIF_filelist_free(simasel->files);
- BIF_filelist_parent(simasel->files);
- BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80);
- }
- }
- }
- BIF_filelist_free(simasel->files);
- simasel->file[0] = '\0';
- simasel->scrollpos = 0;
- simasel->active_file = -1;
- scrarea_queue_winredraw(curarea);
- }
- else if(event== B_FS_DIR_MENU) {
- char *selected= fsmenu_get_entry(simasel->menu-1);
-
- /* which string */
- if (selected) {
- BLI_strncpy(simasel->dir, selected, sizeof(simasel->dir));
- BLI_cleanup_dir(G.sce, simasel->dir);
- BIF_filelist_free(simasel->files);
- BIF_filelist_setdir(simasel->files, simasel->dir);
- simasel->file[0] = '\0';
- simasel->scrollpos = 0;
- simasel->active_file = -1;
- scrarea_queue_redraw(curarea);
- }
-
- simasel->active_file = -1;
-
- }
- else if(event== B_FS_PARDIR) {
- BIF_filelist_free(simasel->files);
- BIF_filelist_parent(simasel->files);
- BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80);
- simasel->file[0] = '\0';
- simasel->active_file = -1;
- simasel->scrollpos = 0;
- scrarea_queue_redraw(curarea);
- }
- else if(event== B_FS_LOAD) {
- if(simasel->type)
- imasel_execute(simasel);
- }
- else if(event== B_FS_CANCEL)
- imasel_prevspace();
- else if(event== B_FS_LIBNAME) {
- Library *lib= BLI_findlink(&G.main->library, simasel->menu);
- if(lib) {
- BLI_strncpy(simasel->dir, lib->filename, sizeof(simasel->dir));
- BLI_make_exist(simasel->dir);
- BLI_cleanup_dir(G.sce, simasel->dir);
- BIF_filelist_free(simasel->files);
- BIF_filelist_setdir(simasel->files, simasel->dir);
- simasel->file[0] = '\0';
- simasel->scrollpos = 0;
- simasel->active_file = -1;
- scrarea_queue_winredraw(curarea);
- }
- } else if(event== B_FS_BOOKMARK) {
- char name[FILE_MAX];
- BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs");
- fsmenu_insert_entry(simasel->dir, 1, 1);
- scrarea_queue_winredraw(curarea);
- fsmenu_write_file(name);
- }
-
-}
-
-static void imasel_home(ScrArea *sa, SpaceImaSel *simasel)
-{
- simasel->v2d.cur.xmin= simasel->v2d.cur.ymin= 0.0f;
- simasel->v2d.cur.xmax= sa->winx;
- simasel->v2d.cur.ymax= sa->winy;
-
- simasel->v2d.tot= simasel->v2d.cur;
- test_view2d(G.v2d, sa->winx, sa->winy);
-
-}
-
-static struct direntry* get_hilited_entry(SpaceImaSel *simasel)
-{
- struct direntry *file;
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- return file;
-}
-
-static void do_filescroll(SpaceImaSel *simasel)
-{
- short mval[2], oldy, yo;
- float scrollarea, scrollstep;
-
- /* for beauty */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- getmouseco_areawin(mval);
- oldy= yo= mval[1];
-
- while(get_mbut()&L_MOUSE) {
- getmouseco_areawin(mval);
-
- if(yo!=mval[1]) {
- scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- scrollstep = yo - mval[1];
- simasel->scrollpos += scrollstep;
-
- if (simasel->scrollpos<0)
- simasel->scrollpos=0;
- if (simasel->scrollpos > scrollarea - simasel->scrollheight)
- simasel->scrollpos = scrollarea - simasel->scrollheight;
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- yo= mval[1];
- }
- else BIF_wait_for_statechange();
- }
-
- /* for beauty */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
-}
-
-/* ******************* DATA SELECT ********************* */
-
-static void imasel_select_objects(SpaceImaSel *simasel)
-{
- Object *ob;
- Base *base;
- Scene *sce;
- struct direntry* file;
- int a;
- int totfile;
-
- /* only when F4 DATABROWSE */
- if(imasel_has_func(simasel)) return;
-
- totfile = BIF_filelist_numfiles(simasel->files);
-
- if( strcmp(simasel->dir, "Object/")==0 ) {
- for(a=0; a<totfile; a++) {
- file = BIF_filelist_file(simasel->files, a);
- ob= (Object *)file->poin;
-
- if(ob) {
- if(file->flags & ACTIVE) ob->flag |= SELECT;
- else ob->flag &= ~SELECT;
- }
-
- }
- base= FIRSTBASE;
- while(base) {
- base->flag= base->object->flag;
- base= base->next;
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- }
- else if( strcmp(simasel->dir, "Scene/")==0 ) {
-
- for(a=0; a<totfile; a++) {
- file = BIF_filelist_file(simasel->files, a);
- sce= (Scene *)file->poin;
- if(sce) {
- if(file->flags & ACTIVE) sce->r.scemode |= R_BG_RENDER;
- else sce->r.scemode &= ~R_BG_RENDER;
- }
-
- }
- allqueue(REDRAWBUTSSCENE, 0);
- }
-}
-
-static void active_imasel_object(SpaceImaSel *simasel)
-{
- Object *ob;
- struct direntry* file;
-
- /* only when F4 DATABROWSE */
- if(imasel_has_func(simasel)) return;
-
- if( strcmp(simasel->dir, "Object/")==0 ) {
- int n = BIF_filelist_numfiles(simasel->files);
- if(simasel->active_file >= 0 && simasel->active_file < n) {
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- ob= (Object *)file->poin;
-
- if(ob) {
- set_active_object(ob);
- if(BASACT && BASACT->object==ob) {
- BASACT->flag |= SELECT;
- file->flags |= ACTIVE;
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- scrarea_queue_winredraw(curarea);
- }
- }
- }
- }
-}
-
-
-
-void winqreadimaselspace(ScrArea *, void *, BWinEvent *);
-
-
-void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceImaSel *simasel;
-
- char str[FILE_MAXDIR+FILE_MAXFILE+12];
- short mval[2];
- short do_draw = 0;
- short do_headdraw = 0;
- int numfiles;
- struct direntry *file;
- float scrollstep = 0;
- float scrollarea;
-
- // if(val==0) return;
- simasel= curarea->spacedata.first;
-
- if (!simasel->files)
- return;
-
- if (BIF_filelist_empty(simasel->files))
- return;
-
- numfiles = BIF_filelist_numfiles(simasel->files);
-
- /* calc_scrollrcts(sa, &(simasel->v2d), sa->winx, sa->winy); */
- calc_imasel_rcts(simasel, sa->winx, sa->winy);
-
- /* prevent looping */
- if(simasel->selstate && !(get_mbut() & R_MOUSE)) simasel->selstate= 0;
-
- if(val) {
-
- if( event!=RETKEY && event!=PADENTER)
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- switch(event) {
-
- case UI_BUT_EVENT:
- do_imasel_buttons(val, simasel);
- break;
- case RENDERPREVIEW:
- do_draw= 1;
- /* draw_imasel_previews(sa, simasel); */
- break;
- case REDRAWIMASEL:
- do_draw= 1;
- break;
- case WHEELDOWNMOUSE:
- numfiles = BIF_filelist_numfiles(simasel->files);
- scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)*simasel->numtilesx;
- simasel->scrollpos += scrollstep;
- if (simasel->scrollpos > scrollarea - simasel->scrollheight)
- simasel->scrollpos = scrollarea - simasel->scrollheight;
- do_draw= 1;
- break;
- case WHEELUPMOUSE:
- numfiles = BIF_filelist_numfiles(simasel->files);
- scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)*simasel->numtilesx;
- simasel->scrollpos -= scrollstep;
- if (simasel->scrollpos<0)
- simasel->scrollpos=0;
- do_draw= 1;
- break;
- case PAGEUPKEY:
- numfiles = BIF_filelist_numfiles(simasel->files);
- scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)
- *simasel->numtilesx*simasel->numtilesy;
- simasel->scrollpos -= scrollstep;
- if (simasel->scrollpos<0)
- simasel->scrollpos=0;
- do_draw= 1;
- break;
- case PAGEDOWNKEY:
- numfiles = BIF_filelist_numfiles(simasel->files);
- scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin);
- scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)
- * simasel->numtilesx*simasel->numtilesy;
- simasel->scrollpos += scrollstep;
- if (simasel->scrollpos > scrollarea - simasel->scrollheight)
- simasel->scrollpos = scrollarea - simasel->scrollheight;
- do_draw= 1;
- break;
- case HOMEKEY:
- simasel->scrollpos=0;
- imasel_home(sa, simasel);
- do_draw= 1;
- break;
- case ENDKEY:
- simasel->scrollpos = simasel->scrollarea;
- do_draw= 1;
- break;
-
- case ESCKEY:
- BIF_filelist_free(simasel->files);
- imasel_prevspace();
- break;
- case PERIODKEY:
- BIF_filelist_free(simasel->files);
- simasel->active_file = -1;
- do_draw = 1;
- break;
- case LEFTMOUSE:
- case MIDDLEMOUSE:
- getmouseco_areawin(mval);
- if(mval[0]>simasel->v2d.vert.xmin && mval[0]<simasel->v2d.vert.xmax && mval[1]>simasel->v2d.vert.ymin && mval[1]<simasel->v2d.vert.ymax) {
- do_filescroll(simasel);
- }
- else if(mval[0]>simasel->viewrect.xmin && mval[0]<simasel->viewrect.xmax
- && mval[1]>simasel->viewrect.ymin && mval[1]<simasel->viewrect.ymax) {
- set_active_file(simasel, mval[0], mval[1]);
- if (simasel->active_file >= 0 && simasel->active_file < numfiles) {
- file = BIF_filelist_file(simasel->files, simasel->active_file);
-
- if(file && S_ISDIR(file->type)) {
- /* the path is too long and we are not going up! */
- if (strcmp(file->relname, ".") &&
- strcmp(file->relname, "..") &&
- strlen(simasel->dir) + strlen(file->relname) >= FILE_MAX )
- {
- error("Path too long, cannot enter this directory");
- } else {
- if (strcmp(file->relname, "..")==0) {
- /* avoids /../../ */
- BLI_parent_dir(simasel->dir);
- } else {
- strcat(simasel->dir, file->relname);
- strcat(simasel->dir,"/");
- simasel->file[0] = '\0';
- BLI_cleanup_dir(G.sce, simasel->dir);
- }
- BIF_filelist_setdir(simasel->files, simasel->dir);
- BIF_filelist_free(simasel->files);
- simasel->active_file = -1;
- simasel->scrollpos = 0;
- do_draw = 1;
- do_headdraw = 1;
- }
- }
- else if (file)
- {
- if (file->relname) {
- if (simasel->img) {
- IMB_freeImBuf(simasel->img);
- simasel->img = NULL;
- }
- BLI_strncpy(simasel->file, file->relname, FILE_MAXFILE);
- if(event==MIDDLEMOUSE && BIF_filelist_gettype(simasel->files))
- imasel_execute(simasel);
- }
-
- }
- if(BIF_filelist_gettype(simasel->files)==FILE_MAIN) {
- active_imasel_object(simasel);
- }
-
- do_draw = 1;
- }
- }
- else {
- simasel->active_file = -1;
- if (simasel->flag & FILE_BOOKMARKS) {
- if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) {
- int nentries = fsmenu_get_nentries();
-
- set_active_bookmark(simasel, mval[1]);
- if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) {
- char *selected= fsmenu_get_entry(simasel->active_bookmark);
- /* which string */
- if (selected) {
- BLI_strncpy(simasel->dir, selected, sizeof(simasel->dir));
- BLI_cleanup_dir(G.sce, simasel->dir);
- BIF_filelist_free(simasel->files);
- BIF_filelist_setdir(simasel->files, simasel->dir);
- simasel->file[0] = '\0';
- simasel->scrollpos = 0;
- simasel->active_file = -1;
- do_headdraw = 1;
- }
- }
- } else {
- simasel->active_bookmark = -1;
- }
- do_draw= 1;
- }
- }
- break;
- case RIGHTMOUSE:
- getmouseco_areawin(mval);
- if(mval[0]>simasel->viewrect.xmin && mval[0]<simasel->viewrect.xmax
- && mval[1]>simasel->viewrect.ymin && mval[1]<simasel->viewrect.ymax) {
- set_active_file(simasel, mval[0], mval[1]);
- if(simasel->active_file >=0 && simasel->active_file<numfiles) {
- simasel->selstate = NOTACTIVE;
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- if (file->flags & ACTIVE) {
- file->flags &= ~ACTIVE;
- simasel->selstate = INACTIVATE;
- }
- else {
- file->flags |= ACTIVE;
- simasel->selstate = ACTIVATE;
- }
- do_draw= 1;
- }
- }
- break;
- case MOUSEY:
- case MOUSEX:
- getmouseco_areawin(mval);
- if(mval[0]>simasel->viewrect.xmin && mval[0]<simasel->viewrect.xmax && mval[1]>simasel->viewrect.ymin && mval[1]<simasel->viewrect.ymax) {
- set_active_file(simasel, mval[0], mval[1]);
- simasel->active_bookmark = -1;
- if(simasel->active_file >=0 && simasel->active_file<numfiles) {
- file = BIF_filelist_file(simasel->files, simasel->active_file);
- if (simasel->selstate == INACTIVATE) {
- file->flags &= ~ACTIVE;
- }
- else if (simasel->selstate == ACTIVATE) {
- file->flags |= ACTIVE;
- }
- do_draw= 1;
- }
- } else {
- simasel->active_file = -1;
- if (simasel->flag & FILE_BOOKMARKS) {
- if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) {
- set_active_bookmark(simasel, mval[1]);
- } else {
- simasel->active_bookmark = -1;
- }
- do_draw= 1;
- }
- }
- break;
- case AKEY:
- BIF_filelist_swapselect(simasel->files);
- if(simasel->type==FILE_MAIN) imasel_select_objects(simasel);
- do_draw= 1;
- break;
- case BKEY:
- toggle_blockhandler(sa, IMASEL_HANDLER_IMAGE, UI_PNL_UNSTOW);
- scrarea_queue_winredraw(sa);
- break;
- case HKEY:
- simasel->flag ^= FILE_HIDE_DOT;
- BIF_filelist_free(simasel->files);
- do_draw= 1;
- do_headdraw= 1;
- break;
- case PKEY:
- if(G.qual & LR_SHIFTKEY) {
- extern char bprogname[]; /* usiblender.c */
-
- sprintf(str, "%s -a \"%s%s\"", bprogname, simasel->dir, simasel->file);
- system(str);
- }
- else
- {
- BIF_filelist_free(simasel->files);
- BIF_filelist_parent(simasel->files);
- BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80);
- simasel->file[0] = '\0';
- simasel->active_file = -1;
- simasel->scrollpos = 0;
- do_headdraw = 1;
- }
- do_draw = 1;
- break;
- case XKEY:
- getmouseco_areawin(mval);
- if (simasel->flag & FILE_BOOKMARKS) {
- if(mval[0]>simasel->bookmarkrect.xmin && mval[0]<simasel->bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]<simasel->bookmarkrect.ymax) {
- int nentries = fsmenu_get_nentries();
- set_active_bookmark(simasel, mval[1]);
- if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) {
- char name[FILE_MAX];
- BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs");
- fsmenu_remove_entry(simasel->active_bookmark);
- fsmenu_write_file(name);
- simasel->active_bookmark = -1;
- do_draw = 1;
- }
- }
- }
- break;
- }
- }
- else if(event==RIGHTMOUSE) {
- simasel->selstate = NOTACTIVE;
- if(simasel->type==FILE_MAIN) imasel_select_objects(simasel);
- }
- else if(event==LEFTMOUSE) {
- if(simasel->type==FILE_MAIN) {
- getmouseco_areawin(mval);
- set_active_file(simasel, mval[0], mval[1]);
- }
- }
- /* XXX, stupid patch, curarea can become undone
- * because of file loading... fixme zr
- */
- if(curarea) {
- if(do_draw) scrarea_queue_winredraw(curarea);
- if(do_headdraw) scrarea_queue_headredraw(curarea);
- }
-}
-
-
-/* copied from filesel.c */
-void clever_numbuts_imasel()
-{
- SpaceImaSel *simasel;
- char orgname[FILE_MAXDIR+FILE_MAXFILE+12];
- char filename[FILE_MAXDIR+FILE_MAXFILE+12];
- char newname[FILE_MAXDIR+FILE_MAXFILE+12];
- struct direntry *file;
- int len;
-
- simasel= curarea->spacedata.first;
-
- if(BIF_filelist_gettype(simasel->files)==FILE_MAIN) return;
-
- len = 110;
- file = get_hilited_entry(simasel);
-
- if (file != NULL && !(S_ISDIR(file->type))){
-
- BLI_make_file_string(G.sce, orgname, simasel->dir, file->relname);
- BLI_strncpy(filename, file->relname, sizeof(filename));
-
- add_numbut(0, TEX, "", 0, len, filename, "Rename File");
-
- if( do_clever_numbuts("Rename File", 1, REDRAW) ) {
- BLI_make_file_string(G.sce, newname, simasel->dir, filename);
-
- if( strcmp(orgname, newname) != 0 ) {
- BLI_rename(orgname, newname);
- BIF_filelist_free(simasel->files);
- }
- }
-
- scrarea_queue_winredraw(curarea);
- }
-}
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
deleted file mode 100644
index 6293e669aa1..00000000000
--- a/source/blender/src/editipo.c
+++ /dev/null
@@ -1,4731 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation, 2005. Full recode.
- * Roland Hess, 2007. Visual Key refactor.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-/* this code feels over-complex, mostly because I choose in the past to devise a system
- that converts the Ipo blocks (linked to Object, Material, etc), into a copy of that
- data which is being worked on; the 'editipo'.
- The editipo then can have 'ipokey' data, which is optimized for editing curves as if
- it were key positions. This is still a great feature to work with, which makes ipo editing
- in Blender still valuable. However, getting this beast under control was hard, even
- for me... (ton) */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_constraint_types.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_anim.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_object.h"
-
-#include "BIF_butspace.h"
-#include "BIF_editaction.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editkey.h"
-#include "BIF_editnla.h"
-#include "BIF_editseq.h"
-#include "BIF_editview.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_poseobject.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h" // for bezt_compare
-
-#include "BSE_trans_types.h"
-#include "BSE_editipo_types.h"
-#include "BSE_drawipo.h"
-#include "BSE_editipo.h"
-#include "BSE_edit.h"
-#include "BSE_drawview.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-#include "BSE_sequence.h"
-#include "BSE_seqaudio.h"
-#include "BSE_time.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "transform.h"
-
-extern int ob_ar[];
-extern int ma_ar[];
-extern int seq_ar[];
-extern int cu_ar[];
-extern int wo_ar[];
-extern int la_ar[];
-extern int cam_ar[];
-extern int snd_ar[];
-extern int ac_ar[];
-extern int co_ar[];
-extern int te_ar[];
-extern int fluidsim_ar[]; // NT
-extern int part_ar[];
-
-/* forwards */
-#define IPOTHRESH 0.9
-
-/* tests if only one editipo is active */
-static void check_active_editipo(void)
-{
- EditIpo *ei, *actei;
- int a;
-
- actei= G.sipo->editipo;
- if(actei) {
- for(a=0; a<G.sipo->totipo; a++, actei++) {
- if(actei->flag & IPO_ACTIVE)
- break;
- }
- if(actei==NULL) {
- /* set visible active */
- for(a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++) {
- if(ei->flag & IPO_VISIBLE)
- break;
- }
- if(ei==NULL) ei=G.sipo->editipo;
- ei->flag |= IPO_ACTIVE;
- if(ei->icu) ei->icu->flag |= IPO_ACTIVE;
- }
- else {
- /* make sure no others are active */
- for(a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++) {
- if(ei!=actei) {
- ei->flag &= ~IPO_ACTIVE;
- if(ei->icu) ei->icu->flag &= ~IPO_ACTIVE;
- }
- }
- }
- }
-}
-
-/* sets this ei channel active */
-static void set_active_editipo(EditIpo *actei)
-{
- EditIpo *ei;
- int a;
-
- for(a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++) {
- ei->flag &= ~IPO_ACTIVE;
- if(ei->icu) ei->icu->flag &= ~IPO_ACTIVE;
- }
- actei->flag |= IPO_ACTIVE;
- if(actei->icu) actei->icu->flag |= IPO_ACTIVE;
-}
-
-EditIpo *get_active_editipo(void)
-{
- EditIpo *ei;
- int a;
-
- if(G.sipo==NULL)
- return NULL;
-
- /* prevent confusing situations, like for sequencer */
- if(G.sipo->totipo==1) {
- ei= G.sipo->editipo;
- ei->flag |= IPO_ACTIVE;
- return ei;
- }
- for(a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++)
- if(ei->flag & IPO_ACTIVE)
- return ei;
-
- return NULL;
-}
-
-static void set_active_key(int index)
-{
- if(G.sipo->blocktype==ID_KE && G.sipo->from) {
- Object *ob= (Object *)G.sipo->from;
- Key *key= ob_get_key(ob);
-
- if(key) {
- KeyBlock *curkb;
-
- curkb= BLI_findlink(&key->block, index-1);
- if(curkb) {
- ob->shapenr= index;
- ob->shapeflag |= OB_SHAPE_TEMPLOCK;
-
- /* calc keypos */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- }
-}
-
-void editipo_changed(SpaceIpo *si, int doredraw)
-{
- EditIpo *ei;
- View2D *v2d;
- Key *key;
- KeyBlock *kb;
- int a, first=1;
-
- ei= si->editipo;
- if(ei==0)
- return;
-
- for(a=0; a<si->totipo; a++, ei++) {
-
- if(ei->icu) {
-
- /* twice because of ittererating new autohandle */
- calchandles_ipocurve(ei->icu);
- calchandles_ipocurve(ei->icu);
-
- if(ei->flag & IPO_VISIBLE) {
-
- boundbox_ipocurve(ei->icu, 0);
- sort_time_ipocurve(ei->icu);
- if(first) {
- si->v2d.tot= ei->icu->totrct;
- first= 0;
- }
- else BLI_union_rctf(&(si->v2d.tot), &(ei->icu->totrct));
- }
- }
- }
-
-
- v2d= &(si->v2d);
-
- /* keylines? */
- if(si->blocktype==ID_KE) {
- key= ob_get_key((Object *)G.sipo->from);
- if(key && key->block.first) {
- kb= key->block.first;
- if(kb->pos < v2d->tot.ymin) v2d->tot.ymin= kb->pos;
- kb= key->block.last;
- if(kb->pos > v2d->tot.ymax) v2d->tot.ymax= kb->pos;
- }
- }
-
- /* is there no curve? */
- if(first) {
- v2d->tot.xmin= (float)0.0;
- v2d->tot.xmax= (float)EFRA;
- v2d->tot.ymin= (float)-0.1;
- v2d->tot.ymax= (float)1.1;
-
- if(si->blocktype==ID_SEQ) {
- v2d->tot.xmin= (float)-5.0;
- v2d->tot.xmax= (float)105.0;
- v2d->tot.ymin= (float)-0.1;
- v2d->tot.ymax= (float)1.1;
- }
- }
-
- si->tot= v2d->tot;
-
- if(doredraw) {
- /* if you always call do_ipo: you get problems with insertkey, for example
- * when inserting only a 'loc' the 'ob->rot' value then is changed.
- */
-
- if(si->blocktype==ID_OB) {
- /* clear delta loc,rot,size (when free/delete ipo) */
- clear_delta_obipo(si->ipo);
-
- }
-
- do_ipo(si->ipo);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-
- if(si->blocktype==ID_OB) {
- Object *ob= (Object *)si->from;
- if(ob) DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWNLA, 0);
- }
-
- else if(si->blocktype==ID_MA) allqueue(REDRAWBUTSSHADING, 0);
- else if(si->blocktype==ID_TE) allqueue(REDRAWBUTSSHADING, 0);
- else if(si->blocktype==ID_WO) allqueue(REDRAWBUTSSHADING, 0);
- else if(si->blocktype==ID_LA) allqueue(REDRAWBUTSSHADING, 0);
-// else if(si->blocktype==ID_SO) allqueue(REDRAWBUTSSOUND, 0);
- else if(si->blocktype==ID_CA) {
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(si->blocktype==ID_SEQ) free_imbuf_seq_with_ipo(si->ipo);
- else if(si->blocktype==ID_PO) {
- Object *ob= OBACT;
- if(ob && ob->pose) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
- else if(si->blocktype==ID_KE) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(si->blocktype==ID_CU) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(si->blocktype==ID_PA){
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-
- if(si->showkey) make_ipokey();
-
- if(si->actname[0])
- synchronize_action_strips();
-}
-
-void scale_editipo(void)
-{
- /* comes from buttons, scale with G.sipo->tot rect */
-
- EditIpo *ei;
- BezTriple *bezt;
- float facx, facy;
- int a, b;
-
- facx= (G.sipo->tot.xmax-G.sipo->tot.xmin)/(G.sipo->v2d.tot.xmax-G.sipo->v2d.tot.xmin);
- facy= (G.sipo->tot.ymax-G.sipo->tot.ymin)/(G.sipo->v2d.tot.ymax-G.sipo->v2d.tot.ymin);
-
- ei= G.sipo->editipo;
- if(ei==0) return;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
-
- bezt->vec[0][0]= facx*(bezt->vec[0][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin;
- bezt->vec[1][0]= facx*(bezt->vec[1][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin;
- bezt->vec[2][0]= facx*(bezt->vec[2][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin;
-
- bezt->vec[0][1]= facy*(bezt->vec[0][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin;
- bezt->vec[1][1]= facy*(bezt->vec[1][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin;
- bezt->vec[2][1]= facy*(bezt->vec[2][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin;
-
- bezt++;
- }
- }
- }
-
- editipo_changed(G.sipo, 1);
-
- BIF_undo_push("Scale Edit Ipo");
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-static void make_ob_editipo(Object *ob, SpaceIpo *si)
-{
- EditIpo *ei;
- int a, len, colipo=0;
- char *name;
-
- if(ob->type==OB_MESH) colipo= 1;
-
- ei= si->editipo= MEM_callocN(OB_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= OB_TOTIPO;
-
- for(a=0; a<OB_TOTIPO; a++) {
- name = getname_ob_ei(ob_ar[a], colipo);
- strcpy(ei->name, name);
- ei->adrcode= ob_ar[a];
-
- if ELEM6(ei->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, OB_DROT_X, OB_DROT_Y, OB_DROT_Z) ei->disptype= IPO_DISPDEGR;
- else if(ei->adrcode==OB_LAY) ei->disptype= IPO_DISPBITS;
- else if(ei->adrcode==OB_TIME) ei->disptype= IPO_DISPTIME;
-
- ei->col= ipo_rainbow(a, OB_TOTIPO);
-
- if(colipo) {
- len= strlen(ei->name);
- if(len) {
- if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF;
- else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50;
- else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050;
- }
- }
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
-
- ei++;
- }
- //fprintf(stderr,"FSIMAKE_OPBJ call %d \n", si->totipo);
-}
-
-static void make_part_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- if(si->from==0) return;
-
- ei= si->editipo= MEM_callocN(PART_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= PART_TOTIPO;
-
- for(a=0; a<PART_TOTIPO; a++) {
- name = getname_part_ei(part_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= part_ar[a];
- ei->col= ipo_rainbow(a, PART_TOTIPO);
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-// copied from make_seq_editipo
-static void make_fluidsim_editipo(SpaceIpo *si, Object *ob) // NT
-{
- EditIpo *ei;
- int a;
- char *name;
- int numipos = FLUIDSIM_TOTIPO;
- int ipo_start_index = 0;
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- FluidsimSettings *fss= fluidmd->fss;
-
- // we don't need all fluid ipos for all types! - dg
- if(fss->type == OB_FLUIDSIM_CONTROL)
- {
- numipos = 4; // there are 4 fluid control ipos
- ipo_start_index = 9;
-
- }
- else if(fss->type == OB_FLUIDSIM_DOMAIN)
- {
- numipos = 5; // there are 5 ipos for fluid domains
- }
- else
- {
- numipos = 4; // there are 4 for the rest
- ipo_start_index = 5;
- }
-
- ei= si->editipo= MEM_callocN(numipos*sizeof(EditIpo), "fluidsim_editipo");
- si->totipo = numipos;
- for(a=ipo_start_index; a<ipo_start_index+numipos; a++) {
- //fprintf(stderr,"FSINAME %d %d \n",a,fluidsim_ar[a], (int)(getname_fluidsim_ei(fluidsim_ar[a])) );
- name = getname_fluidsim_ei(fluidsim_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= fluidsim_ar[a];
- ei->col= ipo_rainbow(a, numipos);
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag = ei->icu->flag;
- }
- //else { ei->flag |= IPO_VISIBLE; }
- //fprintf(stderr,"FSIMAKE eif%d,icuf%d icu%d %d|%d\n", ei->flag,ei->icu->flag, (int)ei->icu, IPO_VISIBLE,IPO_SELECT);
- //fprintf(stderr,"FSIMAKE eif%d icu%d %d|%d\n", ei->flag, (int)ei->icu, IPO_VISIBLE,IPO_SELECT);
- ei++;
- }
-}
-
-static void make_seq_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= si->editipo= MEM_callocN(SEQ_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= SEQ_TOTIPO;
-
-
- for(a=0; a<SEQ_TOTIPO; a++) {
- name = getname_seq_ei(seq_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= seq_ar[a];
-
- ei->col= ipo_rainbow(a, SEQ_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
- else ei->flag |= IPO_VISIBLE;
-
- ei++;
- }
-}
-
-static void make_cu_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= si->editipo= MEM_callocN(CU_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= CU_TOTIPO;
-
-
- for(a=0; a<CU_TOTIPO; a++) {
- name = getname_cu_ei(cu_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= cu_ar[a];
-
- ei->col= ipo_rainbow(a, CU_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
- else ei->flag |= IPO_VISIBLE;
-
- ei++;
- }
-}
-
-static void make_key_editipo(SpaceIpo *si)
-{
- Key *key;
- KeyBlock *kb=NULL;
- EditIpo *ei;
- int a;
-
- key= ob_get_key((Object *)G.sipo->from);
- if(key==NULL) return;
-
- si->totipo= BLI_countlist(&key->block);
- ei= si->editipo= MEM_callocN(si->totipo*sizeof(EditIpo), "editipo");
-
- for(a=0, kb= key->block.first; a<si->totipo; a++, ei++, kb= kb->next) {
-
- if(kb->name[0] != 0) strncpy(ei->name, kb->name, 31); // length both same
- ei->adrcode= kb->adrcode;
-
- ei->col= ipo_rainbow(a, KEY_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
- else if(a==0)
- if(key && key->type==KEY_NORMAL)
- ei->flag |= IPO_VISIBLE;
-
- /* active ipo is tied to active shape */
- {
- Object *ob= OBACT;
- if(a==ob->shapenr-1)
- set_active_editipo(ei);
- }
- }
-
- ei= si->editipo;
- if(key && key->type==KEY_RELATIVE) {
- strcpy(ei->name, "----");
- }
- else {
- ei->flag |= IPO_VISIBLE;
- }
-}
-
-static void make_mat_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a, len;
- char *name;
-
- if(si->from==0) return;
-
- ei= si->editipo= MEM_callocN(MA_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= MA_TOTIPO;
-
- for(a=0; a<MA_TOTIPO; a++) {
- name = getname_mat_ei(ma_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= ma_ar[a];
-
- if(ei->adrcode & MA_MAP1) {
- ei->adrcode-= MA_MAP1;
- ei->adrcode |= texchannel_to_adrcode(si->channel);
- }
- else {
- if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS;
- }
-
- ei->col= ipo_rainbow(a, MA_TOTIPO);
-
- len= strlen(ei->name);
- if(len) {
- if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF;
- else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50;
- else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050;
- }
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-static void make_texture_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a, len;
- char *name;
-
- if(si->from==0) return;
-
- ei= si->editipo= MEM_callocN(TE_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= TE_TOTIPO;
-
- for(a=0; a<TE_TOTIPO; a++) {
- name = getname_tex_ei(te_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= te_ar[a];
-
- ei->col= ipo_rainbow(a, TE_TOTIPO);
-
- len= strlen(ei->name);
- if(len) {
- if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF;
- else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50;
- else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050;
- }
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-static void make_world_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a, len;
- char *name;
-
- if(si->from==0) return;
-
- ei= si->editipo= MEM_callocN(WO_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= WO_TOTIPO;
-
- for(a=0; a<WO_TOTIPO; a++) {
- name = getname_world_ei(wo_ar[a]);
-
- strcpy(ei->name, name);
- ei->adrcode= wo_ar[a];
-
- if(ei->adrcode & MA_MAP1) {
- ei->adrcode-= MA_MAP1;
- ei->adrcode |= texchannel_to_adrcode(si->channel);
- }
- else {
- if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS;
- }
-
- ei->col= ipo_rainbow(a, WO_TOTIPO);
-
- len= strlen(ei->name);
- if(len) {
- if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF;
- else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50;
- else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050;
- }
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-static void make_lamp_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= si->editipo= MEM_callocN(LA_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= LA_TOTIPO;
-
- for(a=0; a<LA_TOTIPO; a++) {
- name = getname_la_ei(la_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= la_ar[a];
-
- if(ei->adrcode & MA_MAP1) {
- ei->adrcode-= MA_MAP1;
- ei->adrcode |= texchannel_to_adrcode(si->channel);
- }
-
- ei->col= ipo_rainbow(a, LA_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-static void make_camera_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= si->editipo= MEM_callocN(CAM_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= CAM_TOTIPO;
-
-
- for(a=0; a<CAM_TOTIPO; a++) {
- name = getname_cam_ei(cam_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= cam_ar[a];
-
- ei->col= ipo_rainbow(a, CAM_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-static int make_constraint_editipo(Ipo *ipo, EditIpo **si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= *si= MEM_callocN(CO_TOTIPO*sizeof(EditIpo), "editipo");
-
- for(a=0; a<CO_TOTIPO; a++) {
- name = getname_co_ei(co_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= co_ar[a];
-
- ei->col= ipo_rainbow(a, CO_TOTIPO);
-
- ei->icu= find_ipocurve(ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-
- return CO_TOTIPO;
-}
-
-static int make_bone_editipo(Ipo *ipo, EditIpo **si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= *si= MEM_callocN(AC_TOTIPO*sizeof(EditIpo), "editipo");
-
- for(a=0; a<AC_TOTIPO; a++) {
- name = getname_ac_ei(ac_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= ac_ar[a];
-
- ei->col= ipo_rainbow(a, AC_TOTIPO);
-
- ei->icu= find_ipocurve(ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-
- return AC_TOTIPO;
-}
-
-static void make_sound_editipo(SpaceIpo *si)
-{
- EditIpo *ei;
- int a;
- char *name;
-
- ei= si->editipo= MEM_callocN(SND_TOTIPO*sizeof(EditIpo), "editipo");
-
- si->totipo= SND_TOTIPO;
-
-
- for(a=0; a<SND_TOTIPO; a++) {
- name = getname_snd_ei(snd_ar[a]);
- strcpy(ei->name, name);
- ei->adrcode= snd_ar[a];
-
- ei->col= ipo_rainbow(a, SND_TOTIPO);
-
- ei->icu= find_ipocurve(si->ipo, ei->adrcode);
- if(ei->icu) {
- ei->flag= ei->icu->flag;
- }
-
- ei++;
- }
-}
-
-/* only called in test_editipo() below */
-static void make_editipo(void)
-{
- EditIpo *ei;
- Object *ob;
- rctf *rf;
- int a;
-
- if(G.sipo->editipo)
- MEM_freeN(G.sipo->editipo);
-
- G.sipo->editipo= NULL;
- G.sipo->totipo= 0;
-
- if(G.sipo->from==NULL) return;
-
- ob= OBACT;
-
- if(G.sipo->ipo) G.sipo->showkey= G.sipo->ipo->showkey;
-
- if(G.sipo->blocktype==ID_SEQ) {
- make_seq_editipo(G.sipo);
- }
- else if(G.sipo->blocktype==ID_WO) {
- make_world_editipo(G.sipo);
- }
- else if(G.sipo->blocktype==ID_OB) {
- if (ob) {
- ob->ipowin= ID_OB;
- make_ob_editipo(ob, G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_MA) {
- if (ob) {
- ob->ipowin= ID_MA;
- make_mat_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_CU) {
- if (ob) {
- ob->ipowin= ID_CU;
- make_cu_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_KE) {
- if (ob) {
- ob->ipowin= ID_KE;
- make_key_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_LA) {
- if (ob) {
- ob->ipowin= ID_LA;
- make_lamp_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_TE) {
- if (ob) {
- ob->ipowin= ID_TE;
- make_texture_editipo(G.sipo);
- }
- else if(G.scene->world && give_current_world_texture()) {
- make_texture_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_CA) {
- if (ob) {
- ob->ipowin= ID_CA;
- make_camera_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_SO) {
- if (ob) {
- ob->ipowin= ID_SO;
- make_sound_editipo(G.sipo);
- }
- }
- else if(G.sipo->blocktype==ID_CO){
- G.sipo->totipo = make_constraint_editipo(G.sipo->ipo, (EditIpo**)&G.sipo->editipo);
- if (ob) {
- ob->ipowin= ID_CO;
- }
- }
- else if(G.sipo->blocktype==ID_PO) {
-
- G.sipo->totipo = make_bone_editipo(G.sipo->ipo, (EditIpo**)&G.sipo->editipo);
- if (ob) {
- ob->ipowin= ID_PO;
- }
- }
- else if(G.sipo->blocktype==ID_FLUIDSIM) {
- if (ob) { // NT
- ob->ipowin= ID_FLUIDSIM;
- make_fluidsim_editipo(G.sipo, ob);
- }
- }
- else if(G.sipo->blocktype==ID_PA) {
- if (ob) {
- ob->ipowin= ID_PA;
- make_part_editipo(G.sipo);
- }
- }
-
- if(G.sipo->editipo==0) return;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->icu) ei->icu->flag= ei->flag;
- }
- editipo_changed(G.sipo, 0);
-
- /* sets globals, bad stuff but we need these variables in other parts of code */
- get_status_editipo();
-
-
- if (G.sipo->flag & SIPO_LOCK_VIEW) {
- rf= &(G.v2d->cur); /* view is locked, dont move it, just to sanity check */
- if(rf->xmin>=rf->xmax || rf->ymin>=rf->ymax) ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur);
- } else {
- if(G.sipo->ipo) {
- if (G.sipo->pin)
- rf= &(G.sipo->v2d.cur);
- else
- rf= &(G.sipo->ipo->cur);
-
- if(rf->xmin<rf->xmax && rf->ymin<rf->ymax) G.v2d->cur= *rf;
- else ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur);
- }
- else {
- ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur);
- }
- }
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-}
-
-/* evaluates context in the current UI */
-/* blocktype is type of ipo */
-/* from is the base pointer to find data to change (ob in case of action or pose) */
-/* bonename is for local bone ipos (constraint only now) */
-static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname, char *constname, char *bonename)
-{
- Object *ob= OBACT;
-
- *from= NULL;
- *ipo= NULL;
-
- if(blocktype==ID_CO) {
- if (ob) {
- bConstraintChannel *chan;
- bConstraint *con= get_active_constraint(ob);
-
- if(con) {
- *from= &ob->id;
-
- BLI_strncpy(constname, con->name, 32);
-
- /* a bit hackish, but we want con->ipo to work */
- if(con->flag & CONSTRAINT_OWN_IPO) {
- if(ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
- if(pchan) {
- BLI_strncpy(bonename, pchan->name, 32);
- *ipo= con->ipo;
- }
- }
- }
- else {
- chan= get_active_constraint_channel(ob);
- if(chan) {
- *ipo= chan->ipo;
- BLI_strncpy(constname, con->name, 32);
- }
-
- /* set actname if in posemode */
- if (ob->action) {
- if (ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
- if (pchan) {
- BLI_strncpy(actname, pchan->name, 32);
- BLI_strncpy(bonename, pchan->name, 32);
- }
- }
- else if (ob->ipoflag & OB_ACTION_OB)
- strcpy(actname, "Object");
- }
- else {
- if (ob->flag & OB_POSEMODE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
- if (pchan) {
- BLI_strncpy(actname, pchan->name, 32);
- BLI_strncpy(bonename, pchan->name, 32);
- }
- }
- }
- }
- }
- }
- }
- else if(blocktype==ID_PO) {
- if (ob && ob->action && ob->type==OB_ARMATURE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
-
- *from= (ID *)ob;
- if (pchan) {
- bActionChannel *achan;
-
- BLI_strncpy(actname, pchan->name, 32); /* also set when no channel yet */
-
- achan= get_action_channel(ob->action, pchan->name);
- if(achan)
- *ipo= achan->ipo;
- }
- }
-
- }
- else if(blocktype==ID_OB) {
- if(ob) {
- *from= (ID *)ob;
- if(ob->ipoflag & OB_ACTION_OB) {
- if (ob->action) {
- bActionChannel *achan= get_action_channel(ob->action, "Object");
- if(achan) {
- *ipo= achan->ipo;
- BLI_strncpy(actname, achan->name, 32);
- }
- }
- }
- else {
- *ipo= ob->ipo;
- }
- }
- }
- else if(blocktype==ID_SEQ) {
- Sequence *last_seq = get_last_seq();
-
- if(last_seq) {
- *from= (ID *)last_seq;
- *ipo= last_seq->ipo;
- }
- }
- else if(blocktype==ID_WO) {
- World *wo= G.scene->world;
- *from= (ID *)wo;
- if(wo) *ipo= wo->ipo;
- }
- else if(blocktype==ID_TE) {
- if(ob) {
- Tex *tex= give_current_texture(ob, ob->actcol);
- *from= (ID *)tex;
- if(tex) *ipo= tex->ipo;
- }
- else if(G.scene->world) {
- Tex *tex= give_current_world_texture();
- *from= (ID *)tex;
- if(tex) *ipo= tex->ipo;
- }
- }
- else if(blocktype==ID_MA) {
- if(ob) {
- Material *ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- *from= (ID *)ma;
- if(ma) *ipo= ma->ipo;
- }
- }
- else if(blocktype==ID_KE) {
- if(ob) {
- Key *key= ob_get_key(ob);
-
- if(ob->ipoflag & OB_ACTION_KEY) {
- if (ob->action) {
- bActionChannel *achan= get_action_channel(ob->action, "Shape");
- if(achan) {
- *ipo= achan->ipo;
- BLI_strncpy(actname, achan->name, 32);
- }
- }
- }
- else if(key) *ipo= key->ipo;
-
- *from= (ID *)ob;
- }
- }
- else if(blocktype==ID_CU) {
- if(ob && ob->type==OB_CURVE) {
- Curve *cu= ob->data;
- *from= (ID *)cu;
- *ipo= cu->ipo;
- }
- }
- else if(blocktype==ID_LA) {
- if(ob && ob->type==OB_LAMP) {
- Lamp *la= ob->data;
- *from= (ID *)la;
- *ipo= la->ipo;
- }
- }
- else if(blocktype==ID_CA) {
- if(ob && ob->type==OB_CAMERA) {
- Camera *ca= ob->data;
- *from= (ID *)ca;
- if(ca) *ipo= ca->ipo;
- }
- }
- else if(blocktype==ID_SO) {
-
- // if (G.buts && G.buts->mainb == BUTS_SOUND) {
- // bSound *sound = G.buts->lockpoin;
- // *from= (ID *)sound;
- // if(sound) *ipo= sound->ipo;
- // }
- }
- else if(blocktype==ID_FLUIDSIM) {
- if(ob)
- {
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- if(fluidmd) {
- FluidsimSettings *fss= fluidmd->fss;
- *from= (ID *)ob;
- if(fss) *ipo= fss->ipo;
- }
- }
- }
- else if(blocktype==ID_PA) {
- ParticleSystem *psys = psys_get_current(ob);
- if(psys){
- *from= (ID *)ob;
- *ipo= psys->part->ipo;
- }
- }
-}
-
-/* called on each redraw, check if editipo data has to be remade */
-/* if doit already set, it always makes (in case no ipo exists, we need to see the channels */
-void test_editipo(int doit)
-{
-
- if(G.sipo->pin==0) {
- Ipo *ipo;
- ID *from;
- char actname[32]="", constname[32]="", bonename[32]="";
-
- get_ipo_context(G.sipo->blocktype, &from, &ipo, actname, constname, bonename);
-
- if(G.sipo->ipo != ipo) {
- G.sipo->ipo= ipo;
- /* if lock we don't copy from ipo, this makes the UI jump around confusingly */
- if(G.v2d->flag & V2D_VIEWLOCK || G.sipo->flag & SIPO_LOCK_VIEW);
- else if(ipo) G.v2d->cur= ipo->cur;
- doit= 1;
- }
- if(G.sipo->from != from) {
- G.sipo->from= from;
- doit= 1;
- }
- if( strcmp(G.sipo->actname, actname)) {
- BLI_strncpy(G.sipo->actname, actname, 32);
- doit= 1;
- }
- if( strcmp(G.sipo->constname, constname)) {
- BLI_strncpy(G.sipo->constname, constname, 32);
- doit= 1;
- }
- if( strcmp(G.sipo->bonename, bonename)) {
- BLI_strncpy(G.sipo->bonename, bonename, 32);
- /* urmf; if bonename, then no action */
- if(bonename[0]) G.sipo->actname[0]= 0;
- doit= 1;
- }
-
- if(G.sipo->ipo)
- G.sipo->ipo->cur = G.v2d->cur;
-
- }
-
- if(G.sipo->editipo==NULL || doit) {
- make_editipo();
- }
-}
-
-/* ****************** EditIpo ************************ */
-
-int totipo_edit=0, totipo_sel=0, totipo_curve=0, totipo_vis=0, totipo_vert=0, totipo_vertsel=0, totipo_key=0, totipo_keysel=0;
-
-void get_status_editipo(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- BezTriple *bezt;
- int a, b;
-
- totipo_vis= 0;
- totipo_curve= 0;
- totipo_sel= 0;
- totipo_edit= 0;
- totipo_vert= 0;
- totipo_vertsel= 0;
- totipo_key= 0;
- totipo_keysel= 0;
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- ei= G.sipo->editipo;
- if(ei==0) return;
- for(a=0; a<G.sipo->totipo; a++) {
- if( ei->flag & IPO_VISIBLE ) {
- totipo_vis++;
- if(ei->flag & IPO_SELECT) totipo_sel++;
- if(ei->icu && ei->icu->totvert) totipo_curve++;
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
-
- /* if showkey: do count the vertices (for grab) */
- if(G.sipo->showkey==0) totipo_edit++;
-
- if(ei->icu) {
- if(ei->icu->bezt) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
- if(ei->icu->ipo==IPO_BEZ) {
- if(bezt->f1 & SELECT) totipo_vertsel++;
- if(bezt->f3 & SELECT) totipo_vertsel++;
- totipo_vert+= 2;
- }
- if(bezt->f2 & SELECT) totipo_vertsel++;
-
- totipo_vert++;
- bezt++;
- }
- }
- }
- }
- }
- ei++;
- }
-
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- while(ik) {
- totipo_key++;
- if(ik->flag & 1) totipo_keysel++;
- ik= ik->next;
- }
- }
-}
-
-/* synchronize editipo flag with icu flag and ipokey flags */
-void update_editipo_flags(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- int a;
-
- ei= G.sipo->editipo;
- if(ei) {
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->icu) ei->icu->flag= ei->flag;
- }
- }
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- while(ik) {
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- if(ik->flag & 1) {
- BEZ_SEL(ik->data[a]);
- }
- else {
- BEZ_DESEL(ik->data[a]);
- }
- }
- }
- ik= ik->next;
- }
- }
-}
-
-/* sort of enter/leave editmode for curves */
-void set_editflag_editipo(void)
-{
- EditIpo *ei;
- int a; /* , tot= 0, ok= 0; */
-
- /* after showkey immediately go to editing of selected points */
- if(G.sipo->showkey) {
- G.sipo->showkey= 0;
- if(G.sipo->ipo) G.sipo->ipo->showkey= 0;
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) ei->flag |= IPO_SELECT;
- scrarea_queue_headredraw(curarea);
- allqueue(REDRAWVIEW3D, 0);
- }
-
- get_status_editipo();
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->icu) {
- if(ei->flag & IPO_VISIBLE) {
-
- if(totipo_edit==0 && (ei->flag & IPO_SELECT)) {
- ei->flag |= IPO_EDIT;
- ei->icu->flag= ei->flag;
- }
- else if(totipo_edit && (ei->flag & IPO_EDIT)) {
- ei->flag -= IPO_EDIT;
- ei->icu->flag= ei->flag;
- }
- else if(totipo_vis==1) {
- if(ei->flag & IPO_EDIT) ei->flag -= IPO_EDIT;
- else ei->flag |= IPO_EDIT;
- ei->icu->flag= ei->flag;
- }
- }
- }
- }
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
-}
-
-static short findnearest_ipovert(IpoCurve **icu, BezTriple **bezt)
-{
- /* selected verts get a disadvantage */
- /* in icu and (bezt or bp) the nearest is written */
- /* return 0 1 2: handlepunt */
- EditIpo *ei;
- BezTriple *bezt1;
- int dist= 100, temp, a, b;
- short mval[2], hpoint=0, sco[3][2];
-
- *icu= 0;
- *bezt= 0;
-
- getmouseco_areawin(mval);
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu)) {
-
- if(ei->icu->bezt) {
- bezt1= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
-
- ipoco_to_areaco_noclip(G.v2d, bezt1->vec[0], sco[0]);
- ipoco_to_areaco_noclip(G.v2d, bezt1->vec[1], sco[1]);
- ipoco_to_areaco_noclip(G.v2d, bezt1->vec[2], sco[2]);
-
- if(ei->disptype==IPO_DISPBITS) {
- temp= abs(mval[0]- sco[1][0]);
- }
- else temp= abs(mval[0]- sco[1][0])+ abs(mval[1]- sco[1][1]);
-
- if( bezt1->f2 & SELECT) temp+=5;
- if(temp<dist) {
- hpoint= 1;
- *bezt= bezt1;
- dist= temp;
- *icu= ei->icu;
- }
-
- if(ei->disptype!=IPO_DISPBITS && ei->icu->ipo==IPO_BEZ) {
- /* middle points get an advantage */
- temp= -3+abs(mval[0]- sco[0][0])+ abs(mval[1]- sco[0][1]);
- if( bezt1->f1 & SELECT) temp+=5;
- if(temp<dist) {
- hpoint= 0;
- *bezt= bezt1;
- dist= temp;
- *icu= ei->icu;
- }
-
- temp= abs(mval[0]- sco[2][0])+ abs(mval[1]- sco[2][1]);
- if( bezt1->f3 & 1) temp+=5;
- if(temp<dist) {
- hpoint= 2;
- *bezt=bezt1;
- dist= temp;
- *icu= ei->icu;
- }
- }
- bezt1++;
- }
- }
- }
- }
-
- return hpoint;
-}
-
-void mouse_select_ipo(void)
-{
- Object *ob;
- KeyBlock *actkb=NULL;
- EditIpo *ei, *actei= 0;
- IpoCurve *icu;
- IpoKey *ik, *actik;
- BezTriple *bezt;
- TimeMarker *marker;
- float x, y, dist, mindist;
- int a, oldflag = 0, hand, ok;
- short mval[2], xo, yo;
-
- if(G.sipo->editipo==0) return;
-
- get_status_editipo();
- marker=find_nearest_marker(SCE_MARKERS, 1);
-
- /* map ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
- }
-
- if(G.sipo->showkey) {
- float pixelwidth;
-
- view2d_getscale(G.v2d, &pixelwidth, NULL);
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- actik= 0;
- mindist= 1000.0;
- ik= G.sipo->ipokey.first;
- while(ik) {
- dist= (float)(fabs(ik->val-x));
- if(ik->flag & SELECT) dist+= pixelwidth;
- if(dist < mindist) {
- actik= ik;
- mindist= dist;
- }
- ik= ik->next;
- }
- if(actik) {
- oldflag= actik->flag;
-
- if(G.qual & LR_SHIFTKEY);
- else deselectall_editipo();
-
- if(G.qual & LR_SHIFTKEY) {
- if(oldflag & 1) actik->flag &= ~1;
- else actik->flag |= 1;
- }
- else {
- actik->flag |= 1;
- }
- }
- }
- else if(totipo_edit) {
-
- hand= findnearest_ipovert(&icu, &bezt);
-
- if(G.qual & LR_SHIFTKEY) {
- if(bezt) {
- if(hand==1) {
- if(BEZSELECTED(bezt)) {
- BEZ_DESEL(bezt);
- }
- else {
- BEZ_SEL(bezt);
- }
- }
- else if(hand==0) {
- if(bezt->f1 & SELECT) bezt->f1 &= ~SELECT;
- else bezt->f1= SELECT;
- }
- else {
- if(bezt->f3 & SELECT) bezt->f3 &= ~SELECT;
- else bezt->f3= SELECT;
- }
- }
- }
- else {
- deselectall_editipo();
-
- if(bezt) {
- if(hand==1) {
- BEZ_SEL(bezt);
- }
- else if(hand==0) bezt->f1 |= SELECT;
- else bezt->f3 |= SELECT;
- }
- }
- }
- else if (marker) {
- /* select timeline marker */
- if ((G.qual & LR_SHIFTKEY)==0) {
- oldflag= marker->flag;
- deselect_markers(0, 0);
-
- if (oldflag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- }
- else {
- marker->flag |= SELECT;
- }
- }
- else {
-
- /* vertex keys ? */
- if(G.sipo->blocktype==ID_KE && G.sipo->from) {
- Key *key;
- KeyBlock *kb, *curkb;
- int i, index= 1;
-
- ob= (Object *)G.sipo->from;
- key= ob_get_key(ob);
- curkb= BLI_findlink(&key->block, ob->shapenr-1);
-
- ei= G.sipo->editipo;
- if(key->type==KEY_NORMAL || (ei->flag & IPO_VISIBLE)) {
- getmouseco_areawin(mval);
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- /* how much is 20 pixels? */
- mindist= (float)(20.0*(G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)curarea->winy);
-
- for(i=1, kb= key->block.first; kb; kb= kb->next, i++) {
- dist= (float)(fabs(kb->pos-y));
- if(kb==curkb) dist+= (float)0.01;
- if(dist < mindist) {
- actkb= kb;
- mindist= dist;
- index= i;
- }
- }
- if(actkb) {
- ok= TRUE;
- if(G.obedit && actkb!=curkb) {
- ok= okee("Copy key after leaving Edit Mode");
- }
- if(ok) {
- /* also does all keypos */
- deselectall_editipo();
- set_active_key(index);
- set_active_editipo(ei+index-1);
- }
- }
- }
- }
-
- /* select curve */
- if(actkb==NULL) {
- if(totipo_vis==1) {
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->icu) {
- if(ei->flag & IPO_VISIBLE) actei= ei;
- }
- }
- }
- else if(totipo_vis>1) {
- actei= select_proj_ipo(0, 0);
- }
-
- if(actei) oldflag= actei->flag;
-
- if(G.qual & LR_SHIFTKEY);
- else deselectall_editipo();
-
- if(actei) {
- if(G.qual & LR_SHIFTKEY) {
- if(oldflag & IPO_SELECT) actei->flag &= ~IPO_SELECT;
- else actei->flag |= IPO_SELECT;
- }
- else {
- actei->flag |= IPO_SELECT;
- }
- set_active_editipo(actei);
- }
- }
- }
-
- /* undo mapping of ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
- }
-
- update_editipo_flags();
-
- force_draw(0);
- BIF_undo_push("Select Ipo");
-
- if(G.sipo->showkey && G.sipo->blocktype==ID_OB) {
- ob= OBACT;
- if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0);
- }
- /* points inside of curve are drawn selected too */
- if(G.sipo->blocktype==ID_CU)
- allqueue(REDRAWVIEW3D, 0);
-
- getmouseco_areawin(mval);
- xo= mval[0];
- yo= mval[1];
-
- while (get_mbut() & ((U.flag & USER_LMOUSESELECT)?L_MOUSE:R_MOUSE)) {
- getmouseco_areawin(mval);
- if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
-
- if (marker) {
- transform_markers('g', 0);
- }
- else {
- if(actkb) move_keys(OBACT);
- else transform_ipo('g');
- }
-
- return;
- }
- BIF_wait_for_statechange();
- }
-}
-
-
-/* *********************************** */
-
-/* handling of right-hand channel/curve buttons in ipo window */
-void do_ipowin_buts(short event)
-{
- EditIpo *ei = NULL;
- int a;
-
- /* without shift, all other channels are made invisible */
- if((G.qual & LR_SHIFTKEY)==0) {
- if(event>G.sipo->totipo) return;
- ei = G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if(a!=event) ei->flag &= ~IPO_VISIBLE;
- else ei->flag |= IPO_VISIBLE;
- ei++;
- }
- }
-
- /* set active */
- if(event>=0 && event<G.sipo->totipo) {
- ei= G.sipo->editipo; // void pointer...
- set_active_editipo(ei+event);
- set_active_key(event+1); // only if there's a key, of course
- }
- scrarea_queue_winredraw(curarea);
-
- update_editipo_flags();
- get_status_editipo();
-
- if(G.sipo->showkey) {
- make_ipokey();
- if(G.sipo->blocktype==ID_OB) allqueue(REDRAWVIEW3D, 0);
- }
-
-}
-
-/* the fake buttons to the left of channel names, for select/deselect curves */
-void do_ipo_selectbuttons(void)
-{
- EditIpo *ei, *ei1;
- int a, nr;
- short mval[2];
-
- if(G.sipo->showkey) return;
-
- /* do not allow editipo here: convert editipos to selected */
- get_status_editipo();
- if(totipo_edit) {
- set_editflag_editipo();
- }
-
- /* which */
- getmouseco_areawin(mval);
-
- nr= -(mval[1]-curarea->winy+30-G.sipo->butofs-IPOBUTY)/IPOBUTY;
- if(G.sipo->blocktype==ID_KE) nr--; /* keys show something else in first channel */
-
- if(nr>=0 && nr<G.sipo->totipo) {
- ei= G.sipo->editipo;
- ei+= nr;
-
- set_active_editipo(ei);
- set_active_key(nr+1);
-
- if(ei->icu) {
- if((ei->flag & IPO_VISIBLE)==0) {
- ei->flag |= IPO_VISIBLE|IPO_SELECT;
- }
-
- if((G.qual & LR_SHIFTKEY)==0) {
- ei1= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- ei1->flag &= ~IPO_SELECT;
- ei1++;
- }
- }
-
- if(ei->flag & IPO_SELECT) {
- ei->flag &= ~IPO_SELECT;
- }
- else {
- ei->flag |= IPO_SELECT;
- }
-
- update_editipo_flags();
- scrarea_queue_winredraw(curarea);
- }
- }
- BIF_undo_push("Select Ipo curve");
-}
-
-/* ********************************* Inserting keys ********************************************* */
-
-/* depending type, it returns ipo, if needed it creates one */
-/* returns either action ipo or "real" ipo */
-/* arguments define full context;
- - *from has to be set always, to Object in case of Actions
- - blocktype defines available channels of Ipo struct (blocktype ID_OB can be in action too)
- - if actname, use this to locate actionchannel, and optional constname
- - if bonename, the constname is the ipo to the constraint
-*/
-
-/* note: check header_ipo.c, spaceipo_assign_ipo() too */
-Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname, char *bonename, short add)
-{
- /* lib-linked data is not appropriate here */
- if ((from==NULL) || (from->lib))
- return NULL;
-
- /* first check action ipos */
- if (actname && actname[0]) {
- Object *ob= (Object *)from;
- bActionChannel *achan;
-
- if (GS(from->name)!=ID_OB) {
- printf("called ipo system for action with wrong base pointer\n");
- return NULL;
- }
-
- if ((ob->action==NULL) && (add))
- ob->action= add_empty_action("Action");
-
- if (add)
- achan= verify_action_channel(ob->action, actname);
- else
- achan= get_action_channel(ob->action, actname);
-
- if (achan) {
- /* automatically assign achan to act-group based on pchan's grouping */
- if ((blocktype == ID_PO) && (add))
- verify_pchan2achan_grouping(ob->action, ob->pose, actname);
-
- /* constraint exception */
- if (blocktype==ID_CO) {
- bConstraintChannel *conchan;
-
- if (add)
- conchan= verify_constraint_channel(&achan->constraintChannels, constname);
- else
- conchan= get_constraint_channel(&achan->constraintChannels, constname);
-
- if (conchan) {
- if ((conchan->ipo==NULL) && (add))
- conchan->ipo= add_ipo("CoIpo", ID_CO);
- return conchan->ipo;
- }
- }
- else {
- if ((achan->ipo==NULL) && (add))
- achan->ipo= add_ipo("ActIpo", blocktype);
- return achan->ipo;
- }
- }
- }
- else {
- switch (GS(from->name)) {
- case ID_OB:
- {
- Object *ob= (Object *)from;
-
- /* constraint exception */
- if (blocktype==ID_CO) {
- /* check the local constraint ipo */
- if (bonename && bonename[0] && ob->pose) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, bonename);
- bConstraint *con;
-
- for (con= pchan->constraints.first; con; con= con->next) {
- if (strcmp(con->name, constname)==0)
- break;
- }
-
- if (con) {
- if ((con->ipo==NULL) && (add))
- con->ipo= add_ipo("CoIpo", ID_CO);
- return con->ipo;
- }
- }
- else { /* the actionchannel */
- bConstraintChannel *conchan;
-
- if (add)
- conchan= verify_constraint_channel(&ob->constraintChannels, constname);
- else
- conchan= get_constraint_channel(&ob->constraintChannels, constname);
-
- if (conchan) {
- if ((conchan->ipo==NULL) && (add))
- conchan->ipo= add_ipo("CoIpo", ID_CO);
- return conchan->ipo;
- }
- }
- }
- else if (blocktype==ID_OB) {
- if ((ob->ipo==NULL) && (add))
- ob->ipo= add_ipo("ObIpo", ID_OB);
- return ob->ipo;
- }
- else if (blocktype==ID_KE) {
- Key *key= ob_get_key((Object *)from);
-
- if (key) {
- if ((key->ipo==NULL) && (add))
- key->ipo= add_ipo("KeyIpo", ID_KE);
- return key->ipo;
- }
- return NULL;
- }
- else if (blocktype== ID_FLUIDSIM) {
- Object *ob= (Object *)from;
-
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- if(fluidmd) {
- FluidsimSettings *fss= fluidmd->fss;
-
- if ((fss->ipo==NULL) && (add))
- fss->ipo= add_ipo("FluidsimIpo", ID_FLUIDSIM);
- return fss->ipo;
- }
- }
- else if(blocktype== ID_PA) {
- Object *ob= (Object *)from;
- ParticleSystem *psys= psys_get_current(ob);
-
- if (psys) {
- if ((psys->part->ipo==NULL) && (add))
- psys->part->ipo= add_ipo("ParticleIpo", ID_PA);
- return psys->part->ipo;
- }
- return NULL;
- }
- }
- break;
- case ID_MA:
- {
- Material *ma= (Material *)from;
-
- if ((ma->ipo==NULL) && (add))
- ma->ipo= add_ipo("MatIpo", ID_MA);
- return ma->ipo;
- }
- break;
- case ID_TE:
- {
- Tex *tex= (Tex *)from;
-
- if ((tex->ipo==NULL) && (add))
- tex->ipo= add_ipo("TexIpo", ID_TE);
- return tex->ipo;
- }
- break;
- case ID_SEQ:
- {
- Sequence *seq= (Sequence *)from; /* note, sequence is mimicing Id */
-
- if ((seq->ipo==NULL) && (add))
- seq->ipo= add_ipo("SeqIpo", ID_SEQ);
- update_seq_ipo_rect(seq);
- return seq->ipo;
- }
- break;
- case ID_CU:
- {
- Curve *cu= (Curve *)from;
-
- if ((cu->ipo==NULL) && (add))
- cu->ipo= add_ipo("CuIpo", ID_CU);
- return cu->ipo;
- }
- break;
- case ID_WO:
- {
- World *wo= (World *)from;
-
- if ((wo->ipo==NULL) && (add))
- wo->ipo= add_ipo("WoIpo", ID_WO);
- return wo->ipo;
- }
- break;
- case ID_LA:
- {
- Lamp *la= (Lamp *)from;
-
- if ((la->ipo==NULL) && (add))
- la->ipo= add_ipo("LaIpo", ID_LA);
- return la->ipo;
- }
- break;
- case ID_CA:
- {
- Camera *ca= (Camera *)from;
-
- if ((ca->ipo==NULL) && (add))
- ca->ipo= add_ipo("CaIpo", ID_CA);
- return ca->ipo;
- }
- break;
- case ID_SO:
- {
- bSound *snd= (bSound *)from;
-
- if ((snd->ipo==NULL) && (add))
- snd->ipo= add_ipo("SndIpo", ID_SO);
- return snd->ipo;
- }
- }
- }
-
- return NULL;
-}
-
-/* returns and creates
- * Make sure functions check for NULL or they will crash!
- * */
-IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constname, char *bonename, int adrcode, short add)
-{
- Ipo *ipo;
- IpoCurve *icu= NULL;
-
- /* return 0 if lib */
- /* creates ipo too (if add) */
- ipo= verify_ipo(from, blocktype, actname, constname, bonename, add);
-
- if ((ipo) && (ipo->id.lib==NULL) && (from->lib==NULL)) {
- /* try to find matching curve */
- icu= find_ipocurve(ipo, adrcode);
-
- /* make a new one if none found (and can add) */
- if ((icu==NULL) && (add)) {
- icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
-
- icu->flag |= (IPO_VISIBLE|IPO_AUTO_HORIZ);
- if (ipo->curve.first==NULL)
- icu->flag |= IPO_ACTIVE; /* first one added active */
-
- icu->blocktype= blocktype;
- icu->adrcode= adrcode;
-
- set_icu_vars(icu);
-
- BLI_addtail(&ipo->curve, icu);
-
- switch (GS(from->name)) {
- case ID_SEQ: {
- Sequence *seq= (Sequence *)from;
-
- update_seq_icu_rects(seq);
- break;
- }
- }
- }
- }
-
- /* return ipo-curve */
- return icu;
-}
-
-
-void add_vert_ipo(void)
-{
- EditIpo *ei;
- float x, y;
- int val;
- short mval[2];
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
- if(G.sipo->showkey) {
- G.sipo->showkey= 0;
- free_ipokey(&G.sipo->ipokey);
- }
-
- getmouseco_areawin(mval);
-
- if(mval[0]>G.v2d->mask.xmax) return;
-
- ei= get_active_editipo();
- if(ei==NULL) {
- error("No active Ipo curve");
- return;
- }
- ei->flag |= IPO_VISIBLE; /* can happen it is active but not visible */
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
- /* convert click-time to ipo-time */
- if (NLA_IPO_SCALED) {
- x= get_action_frame(OBACT, x);
- }
-
- if(ei->icu==NULL) {
- if(G.sipo->from) {
- ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode, 1);
- if (ei->icu)
- ei->flag |= ei->icu->flag & IPO_AUTO_HORIZ; /* new curve could have been added, weak... */
- else
- error("Cannot create an IPO curve, you may be using libdata");
- }
- }
- if(ei->icu==NULL) return;
-
- if(ei->disptype==IPO_DISPBITS) {
- ei->icu->vartype= IPO_BITS;
- val= (int)floor(y-0.5);
- if(val<0) val= 0;
- y= (float)(1 << val);
- }
-
- insert_vert_icu(ei->icu, x, y, 0);
-
- /* to be sure: if icu was 0, or only 1 curve visible */
- ei->flag |= IPO_SELECT;
- ei->icu->flag= ei->flag;
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Add Ipo vertex");
-}
-
-
-void insertkey_editipo(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- ID *id;
- float *fp, cfra, *insertvals;
- int a, nr, ok, tot;
- short event;
-
- ei= get_active_editipo();
- if(ei && ei->icu && ei->icu->driver)
- event= pupmenu("Insert Curve %t|Default one-to-one mapping %x3");
- else if(G.sipo->showkey)
- event= pupmenu("Insert Key Vertices %t|Current Frame %x1|Selected Keys %x2");
- else
- event= pupmenu("Insert Key Vertices %t|Current Frame %x1");
-
- if(event<1) return;
-
- if(event==3) {
- IpoDriver *driver= ei->icu->driver;
-
- if(ei->icu->bezt) MEM_freeN(ei->icu->bezt);
- ei->icu->totvert= 0;
- ei->icu->bezt= NULL;
-
- insert_vert_icu(ei->icu, 0.0f, 0.0f, 0);
-
- if(ELEM3(driver->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) {
- if(ei->disptype==IPO_DISPDEGR)
- insert_vert_icu(ei->icu, 18.0f, 18.0f, 0);
- else
- insert_vert_icu(ei->icu, 18.0f, 1.0f, 0);
- }
- else
- insert_vert_icu(ei->icu, 1.0f, 1.0f, 0);
-
- ei->flag |= IPO_SELECT|IPO_VISIBLE;
- ei->icu->flag= ei->flag;
- ei->icu->extrap= IPO_DIR;
-
- do_ipo_buttons(B_IPOHOME);
- }
- else {
- ei= G.sipo->editipo;
- for(nr=0; nr<G.sipo->totipo; nr++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
-
- ok= 0;
- if(G.sipo->showkey) ok= 1;
- else if(ei->flag & IPO_SELECT) ok= 1;
-
- if(ok) {
- /* count amount */
- if(event==1) tot= 1;
- else {
- ik= G.sipo->ipokey.first;
- tot= 0;
- while(ik) {
- if(ik->flag & 1) tot++;
- ik= ik->next;
- }
- }
- if(tot) {
-
- /* correction for ob timeoffs */
- cfra= frame_to_float(CFRA);
- id= G.sipo->from;
- if(id && GS(id->name)==ID_OB ) {
- Object *ob= (Object *)id;
- if((ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0) ) {
- cfra-= give_timeoffset(ob)*G.scene->r.framelen;
- }
- }
- else if(id && GS(id->name)==ID_SEQ) {
- Sequence *last_seq = get_last_seq(); /* editsequence.c */
-
- if(last_seq && (last_seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) {
- cfra= (float)(100.0*(cfra-last_seq->startdisp)/((float)(last_seq->enddisp-last_seq->startdisp)));
- }
- }
-
- /* convert cfra to ipo-time */
- if (NLA_IPO_SCALED) {
- cfra= get_action_frame(OBACT, cfra);
- }
-
- insertvals= MEM_mallocN(sizeof(float)*2*tot, "insertkey_editipo");
- /* make sure icu->curval is correct */
- calc_ipo(G.sipo->ipo, cfra);
-
- if(event==1) {
- insertvals[0]= cfra;
-
- insertvals[1]= ei->icu->curval;
- }
- else {
- fp= insertvals;
- ik= G.sipo->ipokey.first;
- while(ik) {
- if(ik->flag & 1) {
- calc_ipo(G.sipo->ipo, ik->val);
-
- fp[0]= ik->val;
- fp[1]= ei->icu->curval;
- fp+= 2;
- }
- ik= ik->next;
- }
- }
- fp= insertvals;
- for(a=0; a<tot; a++, fp+=2) {
- insert_vert_icu(ei->icu, fp[0], fp[1], 0);
- }
-
- MEM_freeN(insertvals);
- calc_ipo(G.sipo->ipo, (float)CFRA);
- }
- }
- }
- }
- }
- BIF_undo_push("Insert Key Ipo");
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-}
-
-
-/* ****************************************************************************** */
-
-void add_duplicate_editipo(void)
-{
- Object *ob;
- EditIpo *ei;
- IpoCurve *icu;
- BezTriple *bezt, *beztn, *newb;
- int tot, a, b;
-
- get_status_editipo();
- if(totipo_vertsel==0) return;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
- icu= ei->icu;
-
- /* how many points */
- tot= 0;
- b= icu->totvert;
- bezt= icu->bezt;
- while(b--) {
- if(bezt->f2 & SELECT) tot++;
- bezt++;
- }
-
- if(tot) {
- icu->totvert+= tot;
- newb= beztn= MEM_mallocN(icu->totvert*sizeof(BezTriple), "bezt");
- bezt= icu->bezt;
- b= icu->totvert-tot;
- while(b--) {
- *beztn= *bezt;
- if(bezt->f2 & SELECT) {
- BEZ_DESEL(beztn);
- beztn++;
- *beztn= *bezt;
- }
- beztn++;
- bezt++;
- }
- MEM_freeN(icu->bezt);
- icu->bezt= newb;
-
- calchandles_ipocurve(icu);
- }
- }
- }
- }
-
- if(G.sipo->showkey) {
- make_ipokey();
- if(G.sipo->blocktype==ID_OB) {
- ob= OBACT;
- if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0);
- }
- }
- BIF_undo_push("Duplicate Ipo");
- transform_ipo('g');
-}
-
-void remove_doubles_ipo(void)
-{
- EditIpo *ei;
- IpoKey *ik, *ikn;
- BezTriple *bezt, *newb, *new1;
- float val;
- int mode, a, b;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
-
- /* OR the curve is selected OR in editmode OR in keymode */
- mode= 0;
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) mode= 1;
- else if(ei->flag & IPO_SELECT) mode= 2;
-
- if(mode) {
- bezt= ei->icu->bezt;
- newb= new1= MEM_mallocN(ei->icu->totvert*sizeof(BezTriple), "newbezt");
- *newb= *bezt;
- b= ei->icu->totvert-1;
- bezt++;
- while(b--) {
-
- /* can we remove? */
- if(mode==2 || (bezt->f2 & SELECT)) {
-
- /* are the points different? */
- if( fabs( bezt->vec[1][0]-newb->vec[1][0] ) > 0.9 ) {
- newb++;
- *newb= *bezt;
- }
- else {
- /* median */
- VecMidf(newb->vec[0], newb->vec[0], bezt->vec[0]);
- VecMidf(newb->vec[1], newb->vec[1], bezt->vec[1]);
- VecMidf(newb->vec[2], newb->vec[2], bezt->vec[2]);
-
- newb->h1= newb->h2= HD_FREE;
-
- ei->icu->totvert--;
- }
-
- }
- else {
- newb++;
- *newb= *bezt;
- }
- bezt++;
- }
-
- MEM_freeN(ei->icu->bezt);
- ei->icu->bezt= new1;
-
- calchandles_ipocurve(ei->icu);
- }
- }
- }
-
- editipo_changed(G.sipo, 1); /* makes ipokeys again! */
-
- /* remove double keys */
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- ikn= ik->next;
-
- while(ik && ikn) {
- if( (ik->flag & 1) && (ikn->flag & 1) ) {
- if( fabs(ik->val-ikn->val) < 0.9 ) {
- val= (float)((ik->val + ikn->val)/2.0);
-
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) ik->data[a]->vec[1][0]= val;
- if(ikn->data[a]) ikn->data[a]->vec[1][0]= val;
- }
- }
- }
- ik= ikn;
- ikn= ikn->next;
-
- }
-
- editipo_changed(G.sipo, 1); /* makes ipokeys agian! */
-
- }
- deselectall_editipo();
- BIF_undo_push("Remove Doubles (IPO)");
-}
-
-
-void clean_ipo(void)
-{
- EditIpo *ei;
- short ok;
- int b;
-
- ok= fbutton(&G.scene->toolsettings->clean_thresh,
- 0.0000001f, 1.0f, 0.001f, 0.1f,
- "Threshold");
- if (!ok) return;
-
- get_status_editipo();
-
- ei= G.sipo->editipo;
- for(b=0; b<G.sipo->totipo; b++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
-
- ok= 0;
- if(G.sipo->showkey) ok= 1;
- else if(totipo_vert && (ei->flag & IPO_EDIT)) ok= 2;
- else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok= 3;
-
- if(ok) {
- /* only clean if ok */
- clean_ipo_curve(ei->icu);
- }
- }
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Clean IPO");
-}
-
-void clean_ipo_curve(IpoCurve *icu)
-{
- BezTriple *old_bezts, *bezt, *beztn;
- BezTriple *lastb;
- int totCount, i;
- float thresh;
-
- /* check if any points */
- if (icu == NULL || icu->totvert <= 1)
- return;
-
- /* get threshold for match-testing */
- thresh= G.scene->toolsettings->clean_thresh;
-
- /* make a copy of the old BezTriples, and clear IPO curve */
- old_bezts = icu->bezt;
- totCount = icu->totvert;
- icu->bezt = NULL;
- icu->totvert = 0;
-
- /* now insert first keyframe, as it should be ok */
- bezt = old_bezts;
- insert_vert_icu(icu, bezt->vec[1][0], bezt->vec[1][1], 0);
-
- /* Loop through BezTriples, comparing them. Skip any that do
- * not fit the criteria for "ok" points.
- */
- for (i=1; i<totCount; i++) {
- float prev[2], cur[2], next[2];
-
- /* get BezTriples and their values */
- if (i < (totCount - 1)) {
- beztn = (old_bezts + (i+1));
- next[0]= beztn->vec[1][0]; next[1]= beztn->vec[1][1];
- }
- else {
- beztn = NULL;
- next[0] = next[1] = 0.0f;
- }
- lastb= (icu->bezt + (icu->totvert - 1));
- bezt= (old_bezts + i);
-
- /* get references for quicker access */
- prev[0] = lastb->vec[1][0]; prev[1] = lastb->vec[1][1];
- cur[0] = bezt->vec[1][0]; cur[1] = bezt->vec[1][1];
-
- /* check if current bezt occurs at same time as last ok */
- if (IS_EQT(cur[0], prev[0], thresh)) {
- /* If there is a next beztriple, and if occurs at the same time, only insert
- * if there is a considerable distance between the points, and also if the
- * current is further away than the next one is to the previous.
- */
- if (beztn && (IS_EQT(cur[0], next[0], thresh)) &&
- (IS_EQT(next[1], prev[1], thresh)==0))
- {
- /* only add if current is further away from previous */
- if (cur[1] > next[1]) {
- if (IS_EQT(cur[1], prev[1], thresh) == 0) {
- /* add new keyframe */
- insert_vert_icu(icu, cur[0], cur[1], 0);
- }
- }
- }
- else {
- /* only add if values are a considerable distance apart */
- if (IS_EQT(cur[1], prev[1], thresh) == 0) {
- /* add new keyframe */
- insert_vert_icu(icu, cur[0], cur[1], 0);
- }
- }
- }
- else {
- /* checks required are dependent on whether this is last keyframe or not */
- if (beztn) {
- /* does current have same value as previous and next? */
- if (IS_EQT(cur[1], prev[1], thresh) == 0) {
- /* add new keyframe*/
- insert_vert_icu(icu, cur[0], cur[1], 0);
- }
- else if (IS_EQT(cur[1], next[1], thresh) == 0) {
- /* add new keyframe */
- insert_vert_icu(icu, cur[0], cur[1], 0);
- }
- }
- else {
- /* add if value doesn't equal that of previous */
- if (IS_EQT(cur[1], prev[1], thresh) == 0) {
- /* add new keyframe */
- insert_vert_icu(icu, cur[0], cur[1], 0);
- }
- }
- }
- }
-
- /* now free the memory used by the old BezTriples */
- if (old_bezts)
- MEM_freeN(old_bezts);
-}
-
-
-/* temp struct used for smooth_ipo */
-typedef struct tSmooth_Bezt {
- float *h1, *h2, *h3; /* bezt->vec[0,1,2][1] */
-} tSmooth_Bezt;
-
-void smooth_ipo(void)
-{
- EditIpo *ei;
- short ok;
- int b;
-
- get_status_editipo();
-
- ei= G.sipo->editipo;
- for(b=0; b<G.sipo->totipo; b++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
- ok= 0;
- if(G.sipo->showkey) ok= 1;
- else if(totipo_vert && (ei->flag & IPO_EDIT)) ok= 2;
- else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok= 3;
-
- if(ok) {
- IpoCurve *icu= ei->icu;
- BezTriple *bezt;
- int i, x, totSel = 0;
-
- /* check if enough points */
- if (icu->totvert >= 3) {
- /* first loop through - count how many verts are selected, and fix up handles */
- bezt= icu->bezt;
- for (i=0; i < icu->totvert; i++, bezt++) {
- if (BEZSELECTED(bezt)) {
- /* line point's handles up with point's vertical position */
- bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1];
- if ((bezt->h1==HD_AUTO) || (bezt->h1==HD_VECT)) bezt->h1= HD_ALIGN;
- if ((bezt->h2==HD_AUTO) || (bezt->h2==HD_VECT)) bezt->h2= HD_ALIGN;
-
- /* add value to total */
- totSel++;
- }
- }
-
- /* if any points were selected, allocate tSmooth_Bezt points to work on */
- if (totSel >= 3) {
- tSmooth_Bezt *tarray, *tsb;
-
- /* allocate memory in one go */
- tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array");
-
- /* populate tarray with data of selected points */
- bezt= icu->bezt;
- for (i=0, x=0; (i < icu->totvert) && (x < totSel); i++, bezt++) {
- if (BEZSELECTED(bezt)) {
- /* tsb simply needs pointer to vec, and index */
- tsb->h1 = &bezt->vec[0][1];
- tsb->h2 = &bezt->vec[1][1];
- tsb->h3 = &bezt->vec[2][1];
-
- /* advance to the next tsb to populate */
- if (x < totSel- 1)
- tsb++;
- else
- break;
- }
- }
-
- /* calculate the new smoothed ipo's with weighted averages:
- * - this is done with two passes
- * - uses 5 points for each operation (which stores in the relevant handles)
- * - previous: w/a ratio = 3:5:2:1:1
- * - next: w/a ratio = 1:1:2:5:3
- */
-
- /* round 1: calculate previous and next */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* don't touch end points (otherwise, curves slowly explode) */
- if (ELEM(i, 0, (totSel-1)) == 0) {
- tSmooth_Bezt *tP1 = tsb - 1;
- tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
- tSmooth_Bezt *tN1 = tsb + 1;
- tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
-
- float p1 = *tP1->h2;
- float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
- float c1 = *tsb->h2;
- float n1 = *tN1->h2;
- float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
-
- /* calculate previous and next */
- *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
- *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
- }
- }
-
- /* round 2: calculate new values and reset handles */
- tsb= tarray;
- for (i=0; i < totSel; i++, tsb++) {
- /* calculate new position by averaging handles */
- *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
-
- /* reset handles now */
- *tsb->h1 = *tsb->h2;
- *tsb->h3 = *tsb->h2;
- }
-
- /* free memory required for tarray */
- MEM_freeN(tarray);
- }
- }
-
- /* recalculate handles */
- calchandles_ipocurve(icu);
- }
- }
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Smooth IPO");
-}
-
-void join_ipo_menu(void)
-{
- int mode = 0;
- mode= pupmenu("Join %t|All Selected %x1|Selected Doubles %x2");
-
- if (mode == -1) return;
-
- join_ipo(mode);
-}
-
-void join_ipo(int mode)
-{
- EditIpo *ei;
- IpoKey *ik;
- IpoCurve *icu;
- BezTriple *bezt, *beztn, *newb;
- float val;
- int tot, a, b;
-
- get_status_editipo();
-
- /* Mode events:
- * All Selected: 1
- * Selected Doubles: 2
- */
-
- if( mode==2 ) {
- remove_doubles_ipo();
- return;
- }
-
- /* first: multiple selected verts in 1 curve */
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
- icu= ei->icu;
-
- /* how many points */
- tot= 0;
- b= icu->totvert;
- bezt= icu->bezt;
- while(b--) {
- if(bezt->f2 & SELECT) tot++;
- bezt++;
- }
-
- if(tot>1) {
- tot--;
- icu->totvert-= tot;
-
- newb= MEM_mallocN(icu->totvert*sizeof(BezTriple), "bezt");
- /* the first point is the new one */
- beztn= newb+1;
- tot= 0;
-
- bezt= icu->bezt;
- b= icu->totvert+tot+1;
- while(b--) {
-
- if(bezt->f2 & SELECT) {
- if(tot==0) *newb= *bezt;
- else {
- VecAddf(newb->vec[0], newb->vec[0], bezt->vec[0]);
- VecAddf(newb->vec[1], newb->vec[1], bezt->vec[1]);
- VecAddf(newb->vec[2], newb->vec[2], bezt->vec[2]);
- }
- tot++;
- }
- else {
- *beztn= *bezt;
- beztn++;
- }
- bezt++;
- }
-
- VecMulf(newb->vec[0], (float)(1.0/((float)tot)));
- VecMulf(newb->vec[1], (float)(1.0/((float)tot)));
- VecMulf(newb->vec[2], (float)(1.0/((float)tot)));
-
- MEM_freeN(icu->bezt);
- icu->bezt= newb;
-
- sort_time_ipocurve(icu);
- calchandles_ipocurve(icu);
- }
- }
- }
- }
-
- /* next: in keymode: join multiple selected keys */
-
- editipo_changed(G.sipo, 1); /* makes ipokeys again! */
-
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- val= 0.0;
- tot= 0;
- while(ik) {
- if(ik->flag & 1) {
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- val+= ik->data[a]->vec[1][0];
- break;
- }
- }
- tot++;
- }
- ik= ik->next;
- }
- if(tot>1) {
- val/= (float)tot;
-
- ik= G.sipo->ipokey.first;
- while(ik) {
- if(ik->flag & 1) {
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- ik->data[a]->vec[1][0]= val;
- }
- }
- }
- ik= ik->next;
- }
- editipo_changed(G.sipo, 0);
- }
- }
- deselectall_editipo();
- BIF_undo_push("Join Ipo");
-}
-
-void ipo_snap_menu(void)
-{
- short event;
-
- event= pupmenu("Snap %t|Horizontal %x1|To Next %x2|To Frame %x3|To Current Frame%x4");
- if(event < 1) return;
-
- ipo_snap(event);
-}
-
-void ipo_snap(short event)
-{
- EditIpo *ei;
- BezTriple *bezt;
- float dx = 0.0;
- int a, b;
- short ok, ok2;
-
- /* events:
- * Horizontal : 1
- * To Next: 2
- * To Frame: 3
- * To Current Frame: 4
- */
-
- get_status_editipo();
-
- /* map ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
- }
-
- ei= G.sipo->editipo;
- for(b=0; b<G.sipo->totipo; b++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
-
- ok2= 0;
- if(G.sipo->showkey) ok2= 1;
- else if(totipo_vert && (ei->flag & IPO_EDIT)) ok2= 2;
- else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok2= 3;
-
- if(ok2) {
- bezt= ei->icu->bezt;
- a= ei->icu->totvert;
- while(a--) {
- ok= 0;
- if(totipo_vert) {
- if(bezt->f2 & SELECT) ok= 1;
- }
- else ok= 1;
-
- if(ok) {
- if(event==1) {
- bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1];
- if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN;
- if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN;
- }
- else if(event==2) {
- if(a) {
- bezt->vec[0][1]= bezt->vec[1][1]= bezt->vec[2][1]= (bezt+1)->vec[1][1];
- if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN;
- if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN;
- }
- }
- else if(event==3) {
- bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5));
- }
- else if(event==4) { /* to current frame */
-
- if(ok2==1 || ok2==2) {
-
- if(G.sipo->blocktype==ID_SEQ) {
- Sequence *seq;
-
- seq= (Sequence *)G.sipo->from;
- if(seq && (seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) {
- dx= (float)(CFRA-seq->startdisp);
- dx= (float)(100.0*dx/((float)(seq->enddisp-seq->startdisp)));
-
- dx-= bezt->vec[1][0];
- } else {
- dx= G.scene->r.framelen*CFRA - bezt->vec[1][0];
- }
- }
- else dx= G.scene->r.framelen*CFRA - bezt->vec[1][0];
-
- bezt->vec[0][0]+= dx;
- bezt->vec[1][0]+= dx;
- bezt->vec[2][0]+= dx;
- }
- }
- }
-
- bezt++;
- }
- calchandles_ipocurve(ei->icu);
- }
- }
- }
-
- /* undo mapping of ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Snap Ipo");
-}
-
-void ipo_mirror_menu(void)
-{
- int mode = 0;
- mode= pupmenu("Mirror Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis%x3");
-
- if (mode == -1) return;
-
- ipo_mirror(mode);
-}
-
-void ipo_mirror(short mode)
-{
- EditIpo *ei;
- BezTriple *bezt;
-
- int a, b;
- short ok, ok2, i;
- float diff;
-
- /* what's this for? */
- get_status_editipo();
-
- /* get edit ipo */
- ei= G.sipo->editipo;
- if (!ei) return;
-
- /* map ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
- }
-
- /* look throught ipo curves */
- for(b=0; b<G.sipo->totipo; b++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) {
-
- ok2= 0;
- if(G.sipo->showkey) ok2= 1;
- else if(totipo_vert && (ei->flag & IPO_EDIT)) ok2= 2;
- else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok2= 3;
-
- if(ok2) {
- bezt= ei->icu->bezt;
- a= ei->icu->totvert;
-
- /* loop through beztriples, mirroring them */
- while(a--) {
- ok= 0;
- if(totipo_vert) {
- if(bezt->f2 & SELECT) ok= 1;
- }
- else ok= 1;
-
- if(ok) {
- switch (mode) {
- case 1: /* mirror over current frame */
- {
- for (i=0; i<3; i++) {
- diff= ((float)CFRA - bezt->vec[i][0]);
- bezt->vec[i][0]= ((float)CFRA + diff);
- }
- }
- break;
- case 2: /* mirror over vertical axis (frame 0) */
- {
- for (i=0; i<3; i++) {
- diff= (0.0f - bezt->vec[i][0]);
- bezt->vec[i][0]= (0.0f + diff);
- }
- }
- break;
- case 3: /* mirror over horizontal axis */
- {
- for (i=0; i<3; i++) {
- diff= (0.0f - bezt->vec[i][1]);
- bezt->vec[i][1]= (0.0f + diff);
- }
- }
- break;
- }
- }
-
- bezt++;
- }
-
- /* sort out order and handles */
- sort_time_ipocurve(ei->icu);
- calchandles_ipocurve(ei->icu);
- }
- }
- }
-
- /* undo mapping of ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
- }
-
- /* cleanup and undo push */
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Mirror Ipo");
-}
-
-/*
- * When deleting an IPO curve from Python, check if the Ipo is being
- * edited and if so clear the pointer to the old curve.
- */
-
-void del_ipoCurve ( IpoCurve * icu )
-{
- int i;
- EditIpo *ei= G.sipo->editipo;
- if (!ei) return;
-
- for(i=0; i<G.sipo->totipo; i++, ei++) {
- if ( ei->icu == icu ) {
- ei->flag &= ~(IPO_SELECT | IPO_EDIT);
- ei->icu= NULL;
- return;
- }
- }
-}
-
-void del_ipo(int need_check)
-{
- EditIpo *ei;
- BezTriple *bezt, *bezt1;
- int a, b;
- int del, event;
-
- get_status_editipo();
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- if(totipo_edit==0 && totipo_sel==0 && totipo_vertsel==0) {
- if (need_check) {
- if(okee("Erase selected keys"))
- delete_key(OBACT);
- }
- else
- delete_key(OBACT);
- return;
- }
-
- if (need_check)
- if( okee("Erase selected")==0 ) return;
-
- // first round, can we delete entire parts?
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
-
- del= 0;
-
- if(G.sipo->showkey==0 && totipo_edit==0) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
- del= 1;
- }
- }
- else {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
- if(ei->icu->bezt) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- if(b) {
- while(b) {
- if( BEZSELECTED(bezt) );
- else break;
- b--;
- bezt++;
- }
- if(b==0) del= 1;
- }
- }
- }
- }
- }
-
- if(del) {
- if(ei->icu->driver==NULL) {
- BLI_remlink( &(G.sipo->ipo->curve), ei->icu);
-
- free_ipo_curve(ei->icu);
-
- ei->flag &= ~IPO_SELECT;
- ei->flag &= ~IPO_EDIT;
- ei->icu= NULL;
- }
- else {
- if(ei->icu->bezt) MEM_freeN(ei->icu->bezt);
- ei->icu->bezt= NULL;
- ei->icu->totvert= 0;
- ei->flag &= ~IPO_EDIT;
- }
- }
- }
-
- // 2nd round, small parts: just curves
- ei= G.sipo->editipo;
- for(b=0; b<G.sipo->totipo; b++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
-
- event= 0;
- if(ei->icu->bezt) {
-
- bezt= ei->icu->bezt;
- for(a=0; a<ei->icu->totvert; a++) {
- if( BEZSELECTED(bezt) ) {
- memmove(bezt, bezt+1, (ei->icu->totvert-a-1)*sizeof(BezTriple));
- ei->icu->totvert--;
- a--;
- event= 1;
- }
- else bezt++;
- }
- if(event) {
- if(ei->icu->totvert) {
- bezt1 = (BezTriple*) MEM_mallocN(ei->icu->totvert * sizeof(BezTriple), "delNurb");
- memcpy(bezt1, ei->icu->bezt, (ei->icu->totvert)*sizeof(BezTriple) );
- MEM_freeN(ei->icu->bezt);
- ei->icu->bezt= bezt1;
- }
- else {
- MEM_freeN(ei->icu->bezt);
- ei->icu->bezt= NULL;
- }
- }
- }
- }
- }
- }
-
- get_status_editipo(); /* count again */
- check_active_editipo();
- editipo_changed(G.sipo, 1);
-
- BIF_undo_push("Delete Ipo");
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-}
-
-/* ******************** copy paste buffer ******************** */
-ListBase ipocopybuf={0, 0};
-int totipocopybuf=0;
-
-void free_ipocopybuf(void)
-{
- IpoCurve *icu;
-
- while( (icu= ipocopybuf.first) ) {
- BLI_remlink(&ipocopybuf, icu);
- free_ipo_curve(icu);
- }
- totipocopybuf= 0;
-}
-
-void copy_editipo(void)
-{
- EditIpo *ei;
- IpoCurve *icu;
- int a;
-
- if(G.sipo->showkey) {
- error("cannot copy\n");
- return;
- }
-
- free_ipocopybuf();
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if( (ei->flag & IPO_EDIT) || (ei->flag & IPO_SELECT) ) {
- icu= MEM_callocN(sizeof(IpoCurve), "ipocopybuf");
- *icu= *(ei->icu);
- BLI_addtail(&ipocopybuf, icu);
- icu->bezt= MEM_dupallocN(icu->bezt);
- icu->driver= MEM_dupallocN(icu->driver);
-
- totipocopybuf++;
- }
- }
- }
-
- if(totipocopybuf==0) error("Copy buffer is empty");
-}
-
-void paste_editipo(void)
-{
- EditIpo *ei;
- IpoCurve *icu;
- int a;
-
- if (G.sipo->showkey) return;
-
- if (totipocopybuf==0) return;
- if (G.sipo->ipo==0) return;
- if (G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- get_status_editipo();
-
- if (totipo_vis==0) {
- error("No visible channels");
- return;
- }
- else if (totipo_vis!=totipocopybuf && totipo_sel!=totipocopybuf) {
- error("Incompatible paste");
- return;
- }
-
- icu= ipocopybuf.first;
-
- for (a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++) {
- if (ei->flag & IPO_VISIBLE) {
- /* don't attempt pasting if no valid buffer-curve to paste from anymore */
- if (icu == 0) return;
-
- /* if in editmode, paste keyframes */
- if (ei->flag & IPO_EDIT) {
- BezTriple *bezt;
- float offset= 0.0f;
- short offsetInit= 0;
- int i;
-
- /* make sure an ipo-curve exists (it may not, as this is an editipo) */
- ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode, 1);
- if (ei->icu == NULL) return;
-
- /* Copy selected beztriples from source icu onto this edit-icu,
- * with all added keyframes being offsetted by the difference between
- * the first source keyframe and the current frame.
- */
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- /* skip if not selected */
- if (BEZSELECTED(bezt) == 0) continue;
-
- /* initialise offset (if not already done) */
- if (offsetInit==0) {
- offset= CFRA - bezt->vec[1][0];
- offsetInit= 1;
- }
- /* temporarily apply offset to src beztriple while copying */
- bezt->vec[0][0] += offset;
- bezt->vec[1][0] += offset;
- bezt->vec[2][0] += offset;
-
- /* insert the keyframe */
- insert_bezt_icu(ei->icu, bezt);
-
- /* un-apply offset from src beztriple after copying */
- bezt->vec[0][0] -= offset;
- bezt->vec[1][0] -= offset;
- bezt->vec[2][0] -= offset;
- }
-
- /* recalculate handles of curve that data was pasted into */
- calchandles_ipocurve(ei->icu);
-
- /* advance to next copy/paste buffer ipo-curve */
- icu= icu->next;
- }
-
- /* otherwise paste entire curve data */
- else {
-
- /* make sure an ipo-curve exists (it may not, as this is an editipo) */
- ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode, 1);
- if (ei->icu==NULL) return;
-
- /* clear exisiting dynamic memory (keyframes, driver) */
- if (ei->icu->bezt) MEM_freeN(ei->icu->bezt);
- ei->icu->bezt= NULL;
- if (ei->icu->driver) MEM_freeN(ei->icu->driver);
- ei->icu->driver= NULL;
-
- ei->icu->totvert= icu->totvert;
- ei->icu->flag= ei->flag= icu->flag;
- ei->icu->extrap= icu->extrap;
- ei->icu->ipo= icu->ipo;
-
- /* make a copy of the source icu's data */
- if (icu->bezt)
- ei->icu->bezt= MEM_dupallocN(icu->bezt);
- if (icu->driver)
- ei->icu->driver= MEM_dupallocN(icu->driver);
-
- /* advance to next copy/paste buffer ipo-curve */
- icu= icu->next;
- }
- }
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Paste Ipo curves");
-}
-
-/* *********************** */
-
-
-static int find_other_handles(EditIpo *eicur, float ctime, BezTriple **beztar)
-{
- EditIpo *ei;
- BezTriple *bezt;
- int a, b, c= 1, totvert;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei!=eicur && ei->icu && (ei->flag & IPO_VISIBLE)) {
-
- bezt= ei->icu->bezt;
- totvert= ei->icu->totvert;
-
- for(b=0; b<totvert; b++, bezt++) {
- if( bezt->vec[1][0] < ctime+IPOTHRESH && bezt->vec[1][0] > ctime-IPOTHRESH) {
- if(c>2) return 0;
- beztar[c]= bezt;
- c++;
- }
- }
- }
- }
-
- if(c==3) return 1;
- return 0;
-}
-
-void set_speed_editipo(float speed)
-{
- EditIpo *ei;
- BezTriple *bezt, *beztar[3];
- float vec1[3], vec2[3];
- int a, b, totvert, didit=0, done_error = 0;
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- /* starting with 1 visible curve, selected point, associated points: do lencorr! */
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- bezt= ei->icu->bezt;
- totvert= ei->icu->totvert;
-
- for(b=0; b<totvert; b++, bezt++) {
- if(BEZSELECTED(bezt)) {
-
- beztar[0]= bezt;
-
- if( find_other_handles(ei, bezt->vec[1][0], beztar) ) {
- beztar[0]->h1= beztar[0]->h2= HD_ALIGN;
- beztar[1]->h1= beztar[1]->h2= HD_ALIGN;
- beztar[2]->h1= beztar[2]->h2= HD_ALIGN;
-
- vec1[0]= (beztar[0]->vec[1][1] - beztar[0]->vec[0][1]) / (beztar[0]->vec[1][0] - beztar[0]->vec[0][0]) ;
- vec2[0]= (beztar[0]->vec[1][1] - beztar[0]->vec[2][1]) / (beztar[0]->vec[2][0] - beztar[0]->vec[1][0]) ;
-
- vec1[1]= (beztar[1]->vec[1][1] - beztar[1]->vec[0][1]) / (beztar[1]->vec[1][0] - beztar[1]->vec[0][0]) ;
- vec2[1]= (beztar[1]->vec[1][1] - beztar[1]->vec[2][1]) / (beztar[1]->vec[2][0] - beztar[1]->vec[1][0]) ;
-
- vec1[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[0][1]) / (beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ;
- vec2[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[2][1]) / (beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ;
-
- Normalize(vec1);
- Normalize(vec2);
-
- VecMulf(vec1, speed);
- VecMulf(vec2, speed);
-
- beztar[0]->vec[0][1]= beztar[0]->vec[1][1] - vec1[0]*(beztar[0]->vec[1][0] - beztar[0]->vec[0][0]) ;
- beztar[0]->vec[2][1]= beztar[0]->vec[1][1] - vec2[0]*(beztar[0]->vec[2][0] - beztar[0]->vec[1][0]) ;
-
- beztar[1]->vec[0][1]= beztar[1]->vec[1][1] - vec1[1]*(beztar[1]->vec[1][0] - beztar[1]->vec[0][0]) ;
- beztar[1]->vec[2][1]= beztar[1]->vec[1][1] - vec2[1]*(beztar[1]->vec[2][0] - beztar[1]->vec[1][0]) ;
-
- beztar[2]->vec[0][1]= beztar[2]->vec[1][1] - vec1[2]*(beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ;
- beztar[2]->vec[2][1]= beztar[2]->vec[1][1] - vec2[2]*(beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ;
-
- didit= 1;
- }
- else {
- if (done_error==0) {
- error("Only works for 3 visible curves with handles");
- }
- done_error = 1;
- }
- }
- }
- break;
- }
- }
-
- if(didit==0) error("Did not set speed");
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Set speed IPO");
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
-
-}
-
-
-/* **************************************************** */
-
-/* IPOKEY:
- *
- * there are three ways to use this system:
- * 1. below: for drawing and editing in Ipo window
- * 2. for drawing key positions in View3D (see ipo.c and drawobject.c)
- * 3. editing keys in View3D (below and in editobject.c)
- *
- */
-
-
-void free_ipokey(ListBase *lb)
-{
- IpoKey *ik;
-
- ik= lb->first;
- while(ik) {
- if(ik->data) MEM_freeN(ik->data);
- ik= ik->next;
- }
- BLI_freelistN(lb);
-}
-
-
-void add_to_ipokey(ListBase *lb, BezTriple *bezt, int nr, int len)
-{
- IpoKey *ik, *ikn;
-
- ik= lb->first;
- while(ik) {
-
- if( ik->val==bezt->vec[1][0] ) {
- if(ik->data[nr]==0) { /* double points! */
- ik->data[nr]= bezt;
- if(bezt->f2 & SELECT) ik->flag= 1;
- return;
- }
- }
- else if(ik->val > bezt->vec[1][0]) break;
-
- ik= ik->next;
- }
-
- ikn= MEM_callocN(sizeof(IpoKey), "add_to_ipokey");
- if(ik) BLI_insertlinkbefore(lb, ik, ikn);
- else BLI_addtail(lb, ikn);
-
- ikn->data= MEM_callocN(sizeof(float *)*len, "add_to_ipokey");
- ikn->data[nr]= bezt;
- ikn->val= bezt->vec[1][0];
-
- if(bezt->f2 & SELECT) ikn->flag= 1;
-}
-
-void make_ipokey(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- ListBase *lb;
- BezTriple *bezt;
- int a, b, sel, desel, totvert;
-
- lb= &G.sipo->ipokey;
- free_ipokey(lb);
-
- ei= G.sipo->editipo;
- if(ei==0) return;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- bezt= ei->icu->bezt;
- totvert= ei->icu->totvert;
-
- for(b=0; b<totvert; b++, bezt++) {
- add_to_ipokey(lb, bezt, a, G.sipo->totipo);
- }
-
- ei->flag &= ~IPO_SELECT;
- ei->flag &= ~IPO_EDIT;
- ei->icu->flag= ei->flag;
- }
- }
-
- /* test selectflags & scaling */
- ik= lb->first;
- while(ik) {
- sel= desel= 0;
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- bezt= ik->data[a];
- if(bezt->f2 & SELECT) sel++;
- else desel++;
- }
- }
- if(sel && desel) sel= 0;
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- bezt= ik->data[a];
- if(sel) {
- BEZ_SEL(bezt);
- }
- else {
- BEZ_DESEL(bezt);
- }
- }
- }
- if(sel) ik->flag = 1;
- else ik->flag= 0;
-
- /* map ipo-keys for drawing/editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- ik->val= get_action_frame_inv(OBACT, ik->val);
- }
-
- ik= ik->next;
- }
-
- get_status_editipo();
-}
-
-void make_ipokey_transform(Object *ob, ListBase *lb, int sel)
-{
- IpoCurve *icu;
- BezTriple *bezt;
- IpoKey *ik;
- int a, adrcode = 0, ok, dloc=0, drot=0, dsize=0;
-
- if(ob->ipo==NULL) return;
- if(ob->ipo->showkey==0) return;
-
- /* test: are there delta curves? */
- icu= ob->ipo->curve.first;
- while(icu) {
- if(icu->flag & IPO_VISIBLE) {
- switch(icu->adrcode) {
- case OB_DLOC_X:
- case OB_DLOC_Y:
- case OB_DLOC_Z:
- dloc= 1;
- break;
- case OB_DROT_X:
- case OB_DROT_Y:
- case OB_DROT_Z:
- drot= 1;
- break;
- case OB_DSIZE_X:
- case OB_DSIZE_Y:
- case OB_DSIZE_Z:
- dsize= 1;
- break;
- }
- }
- icu= icu->next;
- }
-
- icu= ob->ipo->curve.first;
- while(icu) {
- if(icu->flag & IPO_VISIBLE) {
- ok= 0;
-
- switch(icu->adrcode) {
- case OB_DLOC_X:
- case OB_DLOC_Y:
- case OB_DLOC_Z:
- case OB_DROT_X:
- case OB_DROT_Y:
- case OB_DROT_Z:
- case OB_DSIZE_X:
- case OB_DSIZE_Y:
- case OB_DSIZE_Z:
- ok= 1;
- break;
-
- case OB_LOC_X:
- case OB_LOC_Y:
- case OB_LOC_Z:
- if(dloc==0) ok= 1;
- break;
- case OB_ROT_X:
- case OB_ROT_Y:
- case OB_ROT_Z:
- if(drot==0) ok= 1;
- break;
- case OB_SIZE_X:
- case OB_SIZE_Y:
- case OB_SIZE_Z:
- if(dsize==0) ok= 1;
- break;
- }
- if(ok) {
- for(a=0; a<OB_TOTIPO; a++) {
- if(icu->adrcode==ob_ar[a]) {
- adrcode= a;
- break;
- }
- }
-
- bezt= icu->bezt;
- a= icu->totvert;
- while(a--) {
- if(sel==0 || (bezt->f2 & SELECT)) {
- add_to_ipokey(lb, bezt, adrcode, OB_TOTIPO);
- }
- bezt++;
- }
- }
- }
- icu= icu->next;
- }
-
- if (NLA_IPO_SCALED) {
- for (ik= lb->first; ik; ik= ik->next) {
- /* map ipo-keys for drawing/editing if scaled ipo */
- ik->val= get_action_frame_inv(OBACT, ik->val);
- }
- }
-}
-
-void update_ipokey_val(void) /* after moving vertices */
-{
- IpoKey *ik;
- int a;
-
- ik= G.sipo->ipokey.first;
- while(ik) {
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) {
- ik->val= ik->data[a]->vec[1][0];
-
- /* map ipo-keys for drawing/editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- ik->val= get_action_frame_inv(OBACT, ik->val);
- }
- break;
- }
- }
- ik= ik->next;
- }
-}
-
-void set_tob_old(float *old, float *poin)
-{
- old[0]= *(poin);
- old[3]= *(poin-3);
- old[6]= *(poin+3);
-}
-
-void set_ipo_pointers_transob(IpoKey *ik, TransOb *tob)
-{
- BezTriple *bezt;
- int a, delta= 0;
-
- tob->locx= tob->locy= tob->locz= 0;
- tob->rotx= tob->roty= tob->rotz= 0;
- tob->sizex= tob->sizey= tob->sizez= 0;
-
- for(a=0; a<OB_TOTIPO; a++) {
- if(ik->data[a]) {
- bezt= ik->data[a];
-
- switch( ob_ar[a] ) {
- case OB_LOC_X:
- case OB_DLOC_X:
- tob->locx= &(bezt->vec[1][1]); break;
- case OB_LOC_Y:
- case OB_DLOC_Y:
- tob->locy= &(bezt->vec[1][1]); break;
- case OB_LOC_Z:
- case OB_DLOC_Z:
- tob->locz= &(bezt->vec[1][1]); break;
-
- case OB_DROT_X:
- delta= 1;
- case OB_ROT_X:
- tob->rotx= &(bezt->vec[1][1]); break;
- case OB_DROT_Y:
- delta= 1;
- case OB_ROT_Y:
- tob->roty= &(bezt->vec[1][1]); break;
- case OB_DROT_Z:
- delta= 1;
- case OB_ROT_Z:
- tob->rotz= &(bezt->vec[1][1]); break;
-
- case OB_SIZE_X:
- case OB_DSIZE_X:
- tob->sizex= &(bezt->vec[1][1]); break;
- case OB_SIZE_Y:
- case OB_DSIZE_Y:
- tob->sizey= &(bezt->vec[1][1]); break;
- case OB_SIZE_Z:
- case OB_DSIZE_Z:
- tob->sizez= &(bezt->vec[1][1]); break;
- }
- }
- }
-
- /* oldvals for e.g. undo */
- if(tob->locx) set_tob_old(tob->oldloc, tob->locx);
- if(tob->locy) set_tob_old(tob->oldloc+1, tob->locy);
- if(tob->locz) set_tob_old(tob->oldloc+2, tob->locz);
-
- /* store first oldrot, for mapping curves ('1'=10 degrees) and correct calculation */
- if(tob->rotx) set_tob_old(tob->oldrot+3, tob->rotx);
- if(tob->roty) set_tob_old(tob->oldrot+4, tob->roty);
- if(tob->rotz) set_tob_old(tob->oldrot+5, tob->rotz);
-
- /* store the first oldsize, this is not allowed to be dsize! */
- if(tob->sizex) set_tob_old(tob->oldsize+3, tob->sizex);
- if(tob->sizey) set_tob_old(tob->oldsize+4, tob->sizey);
- if(tob->sizez) set_tob_old(tob->oldsize+5, tob->sizez);
-
- tob->flag= TOB_IPO;
- if(delta) tob->flag |= TOB_IPODROT;
-}
-
-
-
-static int float_to_frame (float frame)
-{
- int to= (int) floor(0.5 + frame/G.scene->r.framelen );
-
- return to;
-}
-
-void movekey_ipo(int dir) /* only call external from view3d queue */
-{
- IpoKey *ik;
- float toframe = 0.0;
- int a;
-
- if(G.sipo->showkey==0) return;
-
- ik= G.sipo->ipokey.first;
- if (dir==-1) {
- while (ik && float_to_frame(ik->val)<CFRA) {
- toframe= ik->val;
- ik= ik->next;
- }
- } else {
- while (ik && float_to_frame(ik->val)<=CFRA) {
- ik= ik->next;
- }
- if (ik) toframe= ik->val;
- }
-
- a= float_to_frame(toframe);
-
- if (a!=CFRA && a>0) {
- CFRA= a;
-
- update_for_newframe();
- }
-
- BIF_undo_push("Move Key");
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-
-}
-
-void movekey_obipo(int dir) /* only call external from view3d queue */
-{
- Base *base;
- Object *ob;
- ListBase elems;
- IpoKey *ik;
- int a;
- float toframe= (float)CFRA;
-
- if (!G.vd)
- return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- ob= base->object;
- if(ob->ipo && ob->ipo->showkey) {
- elems.first= elems.last= 0;
- make_ipokey_transform(ob, &elems, 0);
-
- if(elems.first) {
- ik= elems.first;
- if (dir==-1) {
- while (ik && float_to_frame(ik->val)<CFRA) {
- toframe= ik->val;
- ik= ik->next;
- }
- } else {
- while (ik && float_to_frame(ik->val)<=CFRA) {
- ik= ik->next;
- }
- if (ik) toframe= ik->val;
- }
-
- free_ipokey(&elems);
- }
- }
- }
-
- base= base->next;
- }
-
- a= float_to_frame(toframe);
-
- if (a!=CFRA && a>0) {
- CFRA= a;
-
- update_for_newframe();
- }
-
- BIF_undo_push("Move Key");
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-
-}
-/* **************************************************** */
-/* IPO TRANSFORM TOOLS
- *
- * Only the helper functions are stored here these days. They are here as
- * there are heaps of ugly globals which the IPO editor relies on.
- * However, the actual transforms go through the transform system these days.
- */
-
-/* Helper function for make_ipo_transdata, which is reponsible for associating
- * source data with transform data
- */
-static void bezt_to_transdata (TransData *td, TransData2D *td2d, float *loc, float *cent, short selected, short onlytime)
-{
- /* New location from td gets dumped onto the old-location of td2d, which then
- * gets copied to the actual data at td2d->loc2d (bezt->vec[n])
- *
- * Due to NLA scaling, we apply NLA scaling to some of the verts here,
- * and then that scaling will be undone after transform is done.
- */
-
- if (NLA_IPO_SCALED) {
- td2d->loc[0] = get_action_frame_inv(OBACT, loc[0]);
- td2d->loc[1] = loc[1];
- td2d->loc[2] = 0.0f;
- td2d->loc2d = loc;
-
- /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
- td->loc = td2d->loc;
- td->center[0] = get_action_frame_inv(OBACT, cent[0]);
- td->center[1] = cent[1];
- td->center[2] = 0.0f;
-
- VECCOPY(td->iloc, td->loc);
- }
- else {
- td2d->loc[0] = loc[0];
- td2d->loc[1] = loc[1];
- td2d->loc[2] = 0.0f;
- td2d->loc2d = loc;
-
- /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
- td->loc = td2d->loc;
- VECCOPY(td->center, cent);
- VECCOPY(td->iloc, td->loc);
- }
-
- memset(td->axismtx, 0, sizeof(td->axismtx));
- td->axismtx[2][2] = 1.0f;
-
- td->ext= NULL; td->tdi= NULL; td->val= NULL;
-
- if (selected) {
- td->flag |= TD_SELECTED;
- td->dist= 0.0;
- }
- else
- td->dist= MAXFLOAT;
-
- if (onlytime)
- td->flag |= TD_TIMEONLY;
-
- Mat3One(td->mtx);
- Mat3One(td->smtx);
-}
-
-/* This function is called by createTransIpoData and remake_ipo_transdata to
- * create the TransData and TransData2D arrays for transform. The costly counting
- * stage is only performed for createTransIpoData case, and is indicated by t->total==-1;
- */
-void make_ipo_transdata (TransInfo *t)
-{
- TransData *td = NULL;
- TransData2D *td2d = NULL;
-
- EditIpo *ei;
- BezTriple *bezt;
- int a, b;
-
- /* countsel and propmode are used for proportional edit, which is not yet available */
- int count=0/*, countsel=0*/;
- /*int propmode = t->flag & T_PROP_EDIT;*/
-
- /* count data and allocate memory (if needed) */
- if (t->total == 0) {
- /* count data first */
- if (totipo_vertsel) {
- /* we're probably in editmode, so only selected verts */
- count= totipo_vertsel;
- }
- else if (totipo_edit==0 && totipo_sel!=0) {
- /* we're not in editmode, so entire curves get moved */
- ei= G.sipo->editipo;
- for (a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
- if (ei->icu->bezt && ei->icu->ipo==IPO_BEZ)
- count+= 3*ei->icu->totvert;
- else
- count+= ei->icu->totvert;
- }
- }
- if (count==0) return;
- }
- else {
- /* this case should not happen */
- return;
- }
-
- /* memory allocation */
- /*t->total= (propmode)? count: countsel;*/
- t->total= count;
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (IPO Editor)");
- /* for each 2d vert a 3d vector is allocated, so that they can be treated just as if they were 3d verts */
- t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransData2D (IPO Editor)");
- }
-
- td= t->data;
- td2d= t->data2d;
-
- /* add verts */
- if (totipo_vertsel) {
- /* we're probably in editmode, so only selected verts */
- ei= G.sipo->editipo;
- for (a=0; a<G.sipo->totipo; a++, ei++) {
- /* only consider those curves that are visible and are being edited/used for showkeys */
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if ( (ei->flag & IPO_EDIT) || G.sipo->showkey) {
- if (ei->icu->bezt) {
- short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0;
- bezt= ei->icu->bezt;
-
- for (b=0; b < ei->icu->totvert; b++, bezt++) {
- TransDataCurveHandleFlags *hdata = NULL;
- /* only include handles if selected, and interpolaton mode uses beztriples */
- if (ei->icu->ipo==IPO_BEZ) {
- if (bezt->f1 & SELECT) {
- hdata = initTransDataCurveHandes(td, bezt);
- bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime);
- }
- if (bezt->f3 & SELECT) {
- if (hdata==NULL) {
- hdata = initTransDataCurveHandes(td, bezt);
- }
- bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime);
- }
- }
-
- /* only include main vert if selected */
- if (bezt->f2 & SELECT) {
-
- if ((bezt->f1&SELECT)==0 && (bezt->f3&SELECT)==0) {
- if (hdata==NULL) {
- hdata = initTransDataCurveHandes(td, bezt);
- }
- }
-
- bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime);
- }
- }
- /* Sets handles based on the selection */
- testhandles_ipocurve(ei->icu);
- }
- }
- }
- }
- }
- else if (totipo_edit==0 && totipo_sel!=0) {
- /* we're not in editmode, so entire curves get moved */
- ei= G.sipo->editipo;
- for (a=0; a<G.sipo->totipo; a++, ei++) {
- /* only include curves that are visible and selected */
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
- if (ei->icu->bezt) {
- short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0;
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
-
- for (b=0; b < ei->icu->totvert; b++, bezt++) {
- /* only include handles if interpolation mode is bezier not bpoint */
- if (ei->icu->ipo==IPO_BEZ) {
- bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime);
- bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime);
- }
-
- /* always include the main handle */
- bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime);
- }
- }
- }
- }
- }
-}
-
-/* ------------------------ */
-
-/* struct for use in re-sorting BezTriples during IPO transform */
-typedef struct BeztMap {
- BezTriple *bezt;
- int oldIndex; /* index of bezt in icu->bezt array before sorting */
- int newIndex; /* index of bezt in icu->bezt array after sorting */
- short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */
-} BeztMap;
-
-
-/* This function converts an IpoCurve's BezTriple array to a BeztMap array
- * NOTE: this allocates memory that will need to get freed later
- */
-static BeztMap *bezt_to_beztmaps (BezTriple *bezts, int totvert)
-{
- BezTriple *bezt= bezts;
- BeztMap *bezm, *bezms;
- int i;
-
- /* allocate memory for this array */
- if (totvert==0 || bezts==NULL)
- return NULL;
- bezm= bezms= MEM_callocN(sizeof(BeztMap)*totvert, "BeztMaps");
-
- /* assign beztriples to beztmaps */
- for (i=0; i < totvert; i++, bezm++, bezt++) {
- bezm->bezt= bezt;
- bezm->oldIndex= i;
- bezm->newIndex= i;
- }
-
- return bezms;
-}
-
-/* This function copies the code of sort_time_ipocurve, but acts on BeztMap structs instead */
-static void sort_time_beztmaps (BeztMap *bezms, int totvert)
-{
- BeztMap *bezm;
- int i, ok= 1;
-
- /* keep repeating the process until nothing is out of place anymore */
- while (ok) {
- ok= 0;
-
- bezm= bezms;
- i= totvert;
- while (i--) {
- /* is current bezm out of order (i.e. occurs later than next)? */
- if (i > 0) {
- if (bezm->bezt->vec[1][0] > (bezm+1)->bezt->vec[1][0]) {
- bezm->newIndex++;
- (bezm+1)->newIndex--;
-
- SWAP(BeztMap, *bezm, *(bezm+1));
-
- ok= 1;
- }
- }
-
- /* do we need to check if the handles need to be swapped?
- * optimisation: this only needs to be performed in the first loop
- */
- if (bezm->swapHs == 0) {
- if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) &&
- (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) )
- {
- /* handles need to be swapped */
- bezm->swapHs = 1;
- }
- else {
- /* handles need to be cleared */
- bezm->swapHs = -1;
- }
- }
-
- bezm++;
- }
- }
-}
-
-/* This function firstly adjusts the pointers that the transdata has to each BezTriple*/
-static void beztmap_to_data (TransInfo *t, EditIpo *ei, BeztMap *bezms, int totvert)
-{
- BezTriple *bezts = ei->icu->bezt;
- BeztMap *bezm;
- TransData2D *td;
- int i, j;
- char *adjusted;
-
- /* dynamically allocate an array of chars to mark whether an TransData's
- * pointers have been fixed already, so that we don't override ones that are
- * already done
- */
- adjusted= MEM_callocN(t->total, "beztmap_adjusted_map");
-
- /* for each beztmap item, find if it is used anywhere */
- bezm= bezms;
- for (i= 0; i < totvert; i++, bezm++) {
- /* loop through transdata, testing if we have a hit
- * for the handles (vec[0]/vec[2]), we must also check if they need to be swapped...
- */
- td= t->data2d;
- for (j= 0; j < t->total; j++, td++) {
- /* skip item if already marked */
- if (adjusted[j] != 0) continue;
-
- if (totipo_vertsel) {
- /* only selected verts */
- if (ei->icu->ipo==IPO_BEZ) {
- if (bezm->bezt->f1 & SELECT) {
- if (td->loc2d == bezm->bezt->vec[0]) {
- if (bezm->swapHs == 1)
- td->loc2d= (bezts + bezm->newIndex)->vec[2];
- else
- td->loc2d= (bezts + bezm->newIndex)->vec[0];
- adjusted[j] = 1;
- }
- }
- if (bezm->bezt->f3 & SELECT) {
- if (td->loc2d == bezm->bezt->vec[2]) {
- if (bezm->swapHs == 1)
- td->loc2d= (bezts + bezm->newIndex)->vec[0];
- else
- td->loc2d= (bezts + bezm->newIndex)->vec[2];
- adjusted[j] = 1;
- }
- }
- }
- if (bezm->bezt->f2 & SELECT) {
- if (td->loc2d == bezm->bezt->vec[1]) {
- td->loc2d= (bezts + bezm->newIndex)->vec[1];
- adjusted[j] = 1;
- }
- }
- }
- else {
- /* whole curve */
- if (ei->icu->ipo==IPO_BEZ) {
- if (td->loc2d == bezm->bezt->vec[0]) {
- if (bezm->swapHs == 1)
- td->loc2d= (bezts + bezm->newIndex)->vec[2];
- else
- td->loc2d= (bezts + bezm->newIndex)->vec[0];
- adjusted[j] = 1;
- }
-
- if (td->loc2d == bezm->bezt->vec[2]) {
- if (bezm->swapHs == 1)
- td->loc2d= (bezts + bezm->newIndex)->vec[0];
- else
- td->loc2d= (bezts + bezm->newIndex)->vec[2];
- adjusted[j] = 1;
- }
- }
- if (td->loc2d == bezm->bezt->vec[1]) {
- td->loc2d= (bezts + bezm->newIndex)->vec[1];
- adjusted[j] = 1;
- }
- }
- }
-
- }
-
- /* free temp memory used for 'adjusted' array */
- MEM_freeN(adjusted);
-}
-
-/* This function is called by recalcData during the Transform loop to recalculate
- * the handles of curves and sort the keyframes so that the curves draw correctly.
- * It is only called if some keyframes have moved out of order.
- */
-void remake_ipo_transdata (TransInfo *t)
-{
- EditIpo *ei;
- int a;
-
- /* sort and reassign verts */
- ei= G.sipo->editipo;
- for (a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if (ei->icu->bezt) {
- BeztMap *bezm;
-
- /* adjust transform-data pointers */
- bezm= bezt_to_beztmaps(ei->icu->bezt, ei->icu->totvert);
- sort_time_beztmaps(bezm, ei->icu->totvert);
- beztmap_to_data(t, ei, bezm, ei->icu->totvert);
-
- /* re-sort actual beztriples (perhaps this could be done using the beztmaps to save time?) */
- sort_time_ipocurve(ei->icu);
-
- /* free mapping stuff */
- MEM_freeN(bezm);
-
- /* make sure handles are all set correctly */
- testhandles_ipocurve(ei->icu);
- }
- }
- }
-
- /* remake ipokeys */
- if (G.sipo->showkey) make_ipokey();
-}
-
-/* This function acts as the entrypoint for transforms in the IPO editor (as for
- * the Action and NLA editors). The actual transform loop is not here anymore.
- */
-void transform_ipo (int mode)
-{
- short tmode;
- short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
-
- /* data-validation */
- if (G.sipo->ipo && G.sipo->ipo->id.lib) return;
- if (G.sipo->editipo==0) return;
-
- /* convert ascii-based mode to transform system constants (mode) */
- switch (mode) {
- case 'g':
- tmode= TFM_TRANSLATION;
- break;
- case 'r':
- tmode= TFM_ROTATION;
- break;
- case 's':
- tmode= TFM_RESIZE;
- break;
- default:
- tmode= 0;
- return;
- }
-
- /* the transform system method involved depends on the selection */
- get_status_editipo();
- if (totipo_vertsel) {
- /* we're probably in editmode, so only selected verts - transform system */
- initTransform(tmode, context);
- Transform();
- }
- else if (totipo_edit==0 && totipo_sel!=0) {
- /* we're not in editmode, so entire curves get moved - transform system*/
- initTransform(tmode, context);
- Transform();
- }
- else {
- /* shapekey mode? special transform code */
- if (totipo_edit==0)
- move_keys(OBACT);
- return;
- }
-
- /* cleanup */
- editipo_changed(G.sipo, 1);
-}
-
-/**************************************************/
-
-void filter_sampledata(float *data, int sfra, int efra)
-{
- float *da;
- int a;
-
- da= data+1;
- for(a=sfra+1; a<efra; a++, da++) {
- da[0]=(float)( 0.25*da[-1] + 0.5*da[0] + 0.25*da[1]);
- }
-
-}
-
-void sampledata_to_ipocurve(float *data, int sfra, int efra, IpoCurve *icu)
-{
- BezTriple *bezt;
- float *da;
- int a, tot;
-
- filter_sampledata(data, sfra, efra);
- filter_sampledata(data, sfra, efra);
-
- icu->ipo= IPO_LIN;
-
- if(icu->bezt) MEM_freeN(icu->bezt);
- icu->bezt= NULL;
-
- tot= 1; /* first point */
- da= data+1;
- for(a=sfra+1; a<efra; a++, da++) {
- if( IS_EQ(da[0], da[1])==0 && IS_EQ(da[1], da[2])==0 ) tot++;
- }
-
- icu->totvert= tot;
- bezt= icu->bezt= MEM_callocN(tot*sizeof(BezTriple), "samplebezt");
- bezt->vec[1][0]= (float)sfra;
- bezt->vec[1][1]= data[0];
- bezt++;
- da= data+1;
- for(a=sfra+1; a<efra; a++, da++) {
- if( IS_EQ(da[0], da[1])==0 && IS_EQ(da[1], da[2])==0 ) {
- bezt->vec[1][0]= (float)a;
- bezt->vec[1][1]= da[0];
- bezt++;
- }
- }
-}
-
-void ipo_record(void)
-{
- /* only 1 or 2 active curves
- * make a copy (ESC)
- *
- * reference point is the current situation (or 0)
- * dx (dy) is the height correction factor
- * CTRL: start record
- */
- extern double tottime;
- EditIpo *ei, *ei1=0, *ei2=0;
- ScrArea *sa, *oldarea;
-// Ipo *ipo;
- Object *ob;
- void *poin;
- double swaptime;
- float or1, or2 = 0.0, fac, *data1, *data2;
- int type, a, afbreek=0, firsttime=1, cfrao, cfra, sfra, efra;
- unsigned short event = 0;
- short anim, val, xn, yn, mvalo[2], mval[2];
- char str[128];
-
- if(G.sipo->from==NULL) return;
- if(SFRA>=EFRA) return;
-
- anim= pupmenu("Record Mouse %t|Still %x1|Play Animation %x2");
- if(anim < 1) return;
- if(anim!=2) anim= 0;
-
- ob= OBACT;
- /* find the curves... */
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if(ei->flag & IPO_VISIBLE) {
-
- if(ei1==0) ei1= ei;
- else if(ei2==0) ei2= ei;
- else {
- error("Maximum 2 visible curves");
- return;
- }
- }
- ei++;
- }
-
- if(ei1==0) {
- error("Select 1 or 2 channels");
- return;
- }
-
- /* make curves ready, start values */
- if(ei1->icu==NULL)
- ei1->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei1->adrcode, 1);
- if(ei1->icu==NULL) return;
-
- poin= get_ipo_poin(G.sipo->from, ei1->icu, &type);
- if(poin) ei1->icu->curval= read_ipo_poin(poin, type);
- or1= ei1->icu->curval;
- ei1->icu->flag |= IPO_LOCK;
-
- if(ei2) {
- if(ei2->icu==NULL)
- ei2->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei2->adrcode, 1);
- if(ei2->icu==NULL) return;
-
- poin= get_ipo_poin(G.sipo->from, ei2->icu, &type);
- if(poin) ei2->icu->curval= read_ipo_poin(poin, type);
- or2= ei2->icu->curval;
- ei2->icu->flag |= IPO_LOCK;
- }
- fac= G.v2d->cur.ymax - G.v2d->cur.ymin;
- fac/= (float)curarea->winy;
-
- /* which area */
- oldarea= curarea;
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->win) {
- if(G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_LA) {
- if(sa->spacetype==SPACE_BUTS) break;
- }
- else {
- if(sa->spacetype==SPACE_VIEW3D) break;
- }
- }
- sa= sa->next;
- }
-
- if(sa) areawinset(sa->win);
-
- /* can we? */
- while(get_mbut()&L_MOUSE) BIF_wait_for_statechange();
- data1= MEM_callocN(sizeof(float)*(EFRA-SFRA+1), "data1");
- data2= MEM_callocN(sizeof(float)*(EFRA-SFRA+1), "data2");
-
- getmouseco_areawin(mvalo);
- xn= mvalo[0]; yn= mvalo[1];
- waitcursor(1);
-
- tottime= 0.0;
- swaptime= 1.0/FPS;
-
- cfrao= CFRA;
- cfra=efra= SFRA;
- sfra= EFRA;
-
- if (G.scene->audio.flag & AUDIO_SYNC) {
- audiostream_start(cfra);
- }
-
- while(afbreek==0) {
-
- getmouseco_areawin(mval);
-
- if(mval[0]!= mvalo[0] || mval[1]!=mvalo[1] || firsttime || (G.qual & LR_CTRLKEY)) {
- if(anim) CFRA= cfra;
- else firsttime= 0;
-
- set_timecursor(cfra);
-
- /* do ipo: first all, then the specific ones */
- if(anim==2) {
- do_ob_ipo(ob);
- do_ob_key(ob);
- }
-
- ei1->icu->curval= or1 + fac*(mval[0]-xn);
- if(ei2) ei2->icu->curval= or2 + fac*(mval[1]-yn);
-
- do_ipo_nocalc(G.sipo->ipo);
-
- if(G.qual & LR_CTRLKEY) {
- sprintf(str, "Recording... %d\n", cfra);
- data1[ cfra-SFRA ]= ei1->icu->curval;
- if(ei2) data2[ cfra-SFRA ]= ei2->icu->curval;
-
- sfra= MIN2(sfra, cfra);
- efra= MAX2(efra, cfra);
- }
- else sprintf(str, "Mouse Recording. Use Ctrl to start. LeftMouse or Space to end");
-
- do_ob_key(ob);
- ob->recalc |= OB_RECALC;
-
- headerprint(str);
-
- if(sa) scrarea_do_windraw(sa);
-
- /* minimal wait swaptime */
- tottime -= swaptime;
- while (update_time(cfra)) PIL_sleep_ms(1);
-
- screen_swapbuffers();
-
- tottime= 0.0;
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- if(anim || (G.qual & LR_CTRLKEY)) {
- if (G.scene->audio.flag & AUDIO_SYNC) {
- cfra = audiostream_pos();
- } else {
- cfra++;
- }
- if(cfra>EFRA) {
- cfra= SFRA;
- if (G.scene->audio.flag & AUDIO_SYNC) {
- audiostream_stop();
- audiostream_start( cfra );
- }
- }
- }
- }
-
- while(qtest()) {
- event= extern_qread(&val);
- if(val) {
- switch(event) {
- case LEFTMOUSE: case ESCKEY: case SPACEKEY: case RETKEY:
- afbreek= 1;
- break;
- }
- }
- if(afbreek) break;
- }
- }
-
- if(event!=ESCKEY) {
- sampledata_to_ipocurve(data1+sfra-SFRA, sfra, efra, ei1->icu);
- if(ei2) sampledata_to_ipocurve(data2+sfra-SFRA, sfra, efra, ei2->icu);
-
- /* not nice when this is on */
- if(G.sipo->showkey) {
- G.sipo->showkey= 0;
- free_ipokey(&G.sipo->ipokey);
- }
- }
- else {
- /* undo: start values */
- poin= get_ipo_poin(G.sipo->from, ei1->icu, &type);
- if(poin) write_ipo_poin(poin, type, or1);
- if(ei1->icu->bezt==NULL) {
- BLI_remlink( &(G.sipo->ipo->curve), ei1->icu);
- MEM_freeN(ei1->icu);
- ei1->icu= NULL;
- }
- if(ei2) {
- poin= get_ipo_poin(G.sipo->from, ei2->icu, &type);
- if(poin) write_ipo_poin(poin, type, or2);
- if(ei2->icu->bezt==NULL) {
- BLI_remlink( &(G.sipo->ipo->curve), ei2->icu);
- MEM_freeN(ei2->icu);
- ei2->icu= NULL;
- }
- }
- }
-
- if(ei1->icu) ei1->icu->flag &= ~IPO_LOCK;
- if(ei2 && ei2->icu) ei2->icu->flag &= ~IPO_LOCK;
-
- editipo_changed(G.sipo, 0);
- do_ipo(G.sipo->ipo);
- waitcursor(0);
- if (G.scene->audio.flag & AUDIO_SYNC) {
- audiostream_stop();
- }
-
- allqueue(REDRAWVIEW3D, 0);
- if(sa) scrarea_queue_headredraw(sa); /* headerprint */
- scrarea_queue_redraw(oldarea);
- CFRA= cfrao;
-
- /* for the time being? */
- update_for_newframe();
- BIF_undo_push("Ipo Record");
-
- MEM_freeN(data1);
- MEM_freeN(data2);
-}
-
-/* while transform, update for curves */
-void remake_object_ipos(Object *ob)
-{
- IpoCurve *icu;
-
- if (!ob)
- return;
- if (!ob->ipo)
- return;
-
- for (icu = ob->ipo->curve.first; icu; icu=icu->next){
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
-}
-
-/* Only delete the nominated keyframe from provided ipo-curve.
- * Not recommended to be used many times successively. For that
- * there is delete_ipo_keys().
- */
-void delete_icu_key(IpoCurve *icu, int index, short do_recalc)
-{
- /* firstly check that index is valid */
- if (index < 0)
- index *= -1;
- if (icu == NULL)
- return;
- if (index >= icu->totvert)
- return;
-
- /* Delete this key */
- memmove(&icu->bezt[index], &icu->bezt[index+1], sizeof(BezTriple)*(icu->totvert-index-1));
- icu->totvert--;
-
- /* recalc handles - only if it won't cause problems */
- if (do_recalc)
- calchandles_ipocurve(icu);
-}
-
-void delete_ipo_keys(Ipo *ipo)
-{
- IpoCurve *icu, *next;
- int i;
-
- if (ipo == NULL)
- return;
-
- for (icu= ipo->curve.first; icu; icu= next) {
- next = icu->next;
-
- /* Delete selected BezTriples */
- for (i=0; i<icu->totvert; i++) {
- if (icu->bezt[i].f2 & SELECT) {
- memmove(&icu->bezt[i], &icu->bezt[i+1], sizeof(BezTriple)*(icu->totvert-i-1));
- icu->totvert--;
- i--;
- }
- }
-
- /* Only delete if there isn't an ipo-driver still hanging around on an empty curve */
- if (icu->totvert==0 && icu->driver==NULL) {
- BLI_remlink(&ipo->curve, icu);
- free_ipo_curve(icu);
- }
- }
-}
-
-
-int add_trans_ipo_keys(Ipo *ipo, TransVert *tv, int tvtot)
-{
- int i;
- IpoCurve *icu;
-
- if (!ipo)
- return tvtot;
-
- for (icu=ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].f2 & 1){
- tv[tvtot+0].loc=icu->bezt[i].vec[0];
- tv[tvtot+1].loc=icu->bezt[i].vec[1];
- tv[tvtot+2].loc=icu->bezt[i].vec[2];
-
- memcpy (&tv[tvtot+0].oldloc, icu->bezt[i].vec[0], sizeof (float)*3);
- memcpy (&tv[tvtot+1].oldloc, icu->bezt[i].vec[1], sizeof (float)*3);
- memcpy (&tv[tvtot+2].oldloc, icu->bezt[i].vec[2], sizeof (float)*3);
- tvtot+=3;
- }
- }
- }
-
- return tvtot;
-}
-
-void duplicate_ipo_keys(Ipo *ipo)
-{
- IpoCurve *icu;
- int i;
- BezTriple *newbezt;
-
- if (!ipo)
- return;
-
- for (icu=ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- /* If a key is selected */
- if (icu->bezt[i].f2 & SELECT){
- /* Expand the list */
- newbezt = MEM_callocN(sizeof(BezTriple) * (icu->totvert+1), "beztriple");
- memcpy (newbezt, icu->bezt, sizeof(BezTriple) * (i+1));
- memcpy (newbezt+i+1, icu->bezt+i, sizeof(BezTriple));
- memcpy (newbezt+i+2, icu->bezt+i+1, sizeof (BezTriple) *(icu->totvert-(i+1)));
- icu->totvert++;
- MEM_freeN (icu->bezt);
- icu->bezt=newbezt;
- /* Unselect the current key*/
- BEZ_DESEL(&icu->bezt[i]);
- i++;
- /* Select the copied key */
- BEZ_SEL(&icu->bezt[i]);
- }
- }
- }
-}
-
-void move_to_frame(void)
-{
- EditIpo *ei;
- BezTriple *bezt;
- ID *id;
- float cfra;
- int a, b;
-
- if(G.sipo->editipo==0) return;
-
- ei= G.sipo->editipo;
-
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if(G.sipo->showkey || (ei->flag & IPO_EDIT)) {
-
- if(ei->icu->bezt) {
-
- b= ei->icu->totvert;
- bezt= ei->icu->bezt;
- while(b--) {
- if(BEZSELECTED(bezt)) {
-
- cfra= bezt->vec[1][0]/G.scene->r.framelen;
-
- id= G.sipo->from;
- if(id && GS(id->name)==ID_OB ) {
- Object *ob= (Object *)id;
- if((ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)!=0.0) ) {
- cfra+= give_timeoffset(ob)/G.scene->r.framelen;
- }
- }
- CFRA= (int)floor(cfra+0.5);
-
- if(CFRA < 1) CFRA= 1;
- update_for_newframe();
-
- break;
- }
- bezt++;
- }
- }
- }
- }
- }
- BIF_undo_push("Set frame to selected Ipo vertex");
-}
diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c
deleted file mode 100644
index 18faf7ea9e6..00000000000
--- a/source/blender/src/editipo_lib.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation, 2005. Full recode
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* ********** General calls (minimal dependencies) for editing Ipos in Blender ************* */
-
-#include <stdio.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_resources.h"
-
-#include "BSE_edit.h"
-#include "BSE_editipo_types.h"
-#include "BSE_editipo.h"
-#include "BSE_drawipo.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-char *ob_ic_names[OB_TOTNAM] = { "LocX", "LocY", "LocZ", "dLocX", "dLocY", "dLocZ",
- "RotX", "RotY", "RotZ", "dRotX", "dRotY", "dRotZ",
- "ScaleX", "ScaleY", "ScaleZ", "dScaleX", "dScaleY", "dScaleZ",
- "Layer", "Time", "ColR", "ColG", "ColB", "ColA",
- "FStreng", "FFall", "RDamp", "Damping", "Perm", "FMaxD" };
-
-char *co_ic_names[CO_TOTNAM] = { "Inf", "HeadTail" };
-char *mtex_ic_names[TEX_TOTNAM] = { "OfsX", "OfsY", "OfsZ", "SizeX", "SizeY", "SizeZ",
- "texR", "texG", "texB", "DefVar", "Col", "Nor", "Var",
- "Disp" };
-char *tex_ic_names[TE_TOTNAM] = { "NSize", "NDepth", "NType", "Turb", "Vnw1", "Vnw2",
- "Vnw3", "Vnw4", "MinkMExp", "DistM", "ColT", "iScale",
- "DistA", "MgType", "MgH", "Lacu", "Oct", "MgOff",
- "MgGain", "NBase1", "NBase2", "ColR", "ColG", "ColB", "Bright", "Contras"};
-char *ma_ic_names[MA_TOTNAM] = { "R", "G", "B", "SpecR", "SpecG", "SpecB", "MirR",
- "MirG", "MirB", "Ref", "Alpha", "Emit", "Amb", "Spec",
- "Hard", "SpTra", "Ior", "Mode", "HaSize", "Translu",
- "RayMir", "FresMir", "FresMirI", "FresTra", "FresTraI",
- "TraGlow" };
-char *seq_ic_names[SEQ_TOTNAM] = { "Fac" };
-char *cu_ic_names[CU_TOTNAM] = { "Speed" };
-char *key_ic_names[KEY_TOTNAM] = { "Speed", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5",
- "Key 6", "Key 7", "Key 8", "Key 9", "Key 10",
- "Key 11", "Key 12", "Key 13", "Key 14", "Key 15",
- "Key 16", "Key 17", "Key 18", "Key 19", "Key 20",
- "Key 21", "Key 22", "Key 23", "Key 24", "Key 25",
- "Key 26", "Key 27", "Key 28", "Key 29", "Key 30",
- "Key 31", "Key 32", "Key 33", "Key 34", "Key 35",
- "Key 36", "Key 37", "Key 38", "Key 39", "Key 40",
- "Key 41", "Key 42", "Key 43", "Key 44", "Key 45",
- "Key 46", "Key 47", "Key 48", "Key 49", "Key 50",
- "Key 51", "Key 52", "Key 53", "Key 54", "Key 55",
- "Key 56", "Key 57", "Key 58", "Key 59", "Key 60",
- "Key 61", "Key 62", "Key 63"};
-char *wo_ic_names[WO_TOTNAM] = { "HorR", "HorG", "HorB", "ZenR", "ZenG", "ZenB", "Expos",
- "Misi", "MisDi", "MisSta", "MisHi", "StarR", "StarB",
- "StarG", "StarDi", "StarSi" };
-char *la_ic_names[LA_TOTNAM] = { "Energ", "R", "G", "B", "Dist", "SpoSi", "SpoBl",
- "Quad1", "Quad2", "HaInt" };
-/* yafray: two curve names added, 'Apert' for aperture, and 'FDist' for focal distance */
-char *cam_ic_names[CAM_TOTNAM] = { "Lens", "ClSta", "ClEnd", "Apert", "FDist", "ShiftX", "ShiftY" };
-char *snd_ic_names[SND_TOTNAM] = { "Vol", "Pitch", "Pan", "Atten" };
-char *ac_ic_names[AC_TOTNAM] = {"LocX", "LocY", "LocZ", "ScaleX", "ScaleY",
- "ScaleZ", "QuatW", "QuatX", "QuatY", "QuatZ"};
-char *ic_name_empty[1] ={ "" };
-char *fluidsim_ic_names[FLUIDSIM_TOTNAM] = { "Fac-Visc", "Fac-Time", "GravX","GravY","GravZ", "VelX","VelY","VelZ", "Active", "AttrForceStr", "AttrForceRad", "VelForceStr", "VelForceRad" };
-char *part_ic_names[PART_TOTNAM] = { "E_Freq", "E_Life", "E_Speed", "E_Angular", "E_Size",
-"Angular", "Size", "Drag", "Brown", "Damp", "Length", "Clump",
-"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt",
-"FStreng", "FFall", "FMaxD", "F2Streng", "F2Fall", "F2MaxD"};
-
-/* gets the appropriate icon for the given blocktype */
-int geticon_ipo_blocktype(short blocktype)
-{
- switch (blocktype) {
- case ID_OB:
- return ICON_OBJECT;
- case ID_PO:
- return ICON_POSE_HLT;
- case ID_KE:
- return ICON_EDIT;
- case ID_MA:
- return ICON_MATERIAL;
- case ID_WO:
- return ICON_WORLD;
- case ID_CU:
- return ICON_CURVE;
- case ID_CA:
- return ICON_CAMERA;
- case ID_LA:
- return ICON_LAMP;
- case ID_TE:
- return ICON_TEXTURE;
- case ID_CO:
- return ICON_CONSTRAINT;
- case ID_FLUIDSIM:
- return ICON_WORLD; // uggh
- default:
- return 0; // what about blank icon?
- }
-}
-
-/* get name of ipo-curve
- * - icu should be valid pointer
- * - ob is only needed for a shapekey-related hack
- */
-char *getname_ipocurve(IpoCurve *icu, Object *ob)
-{
- switch (icu->blocktype) {
- case ID_OB:
- return getname_ob_ei(icu->adrcode, 0); /* dummy 2nd arg */
- case ID_PO:
- return getname_ac_ei(icu->adrcode);
- case ID_KE:
- {
- static char name[32];
- Key *key= ob_get_key(ob);
- KeyBlock *kb= key_get_keyblock(key, icu->adrcode);
-
- /* only return name if it has been set, otherwise use
- * default method using static string (Key #)
- */
- if ((kb) && (kb->name[0] != '\0'))
- return kb->name; /* return keyblock's name */
-
- /* in case keyblock is not named or no key/keyblock was found */
- sprintf(name, "Key %d", icu->adrcode);
- return name;
- }
-
- default: /* fixme - add all of the other types! */
- return NULL;
- }
-}
-
-char *getname_ac_ei(int nr)
-{
- switch(nr) {
- case AC_LOC_X:
- case AC_LOC_Y:
- case AC_LOC_Z:
- return ac_ic_names[nr-1];
- case AC_SIZE_X:
- case AC_SIZE_Y:
- case AC_SIZE_Z:
- return ac_ic_names[nr-10];
- case AC_QUAT_X:
- case AC_QUAT_Y:
- case AC_QUAT_Z:
- case AC_QUAT_W:
- return ac_ic_names[nr-19];
- default:
- return ic_name_empty[0]; /* empty */
- }
-}
-
-char *getname_co_ei(int nr)
-{
- switch(nr){
- case CO_ENFORCE:
- case CO_HEADTAIL:
- return co_ic_names[nr-1];
- }
- return ic_name_empty[0];
-}
-
-char *getname_ob_ei(int nr, int colipo)
-{
- if(nr>=OB_LOC_X && nr <= OB_PD_FMAXD) return ob_ic_names[nr-1];
-
- return ic_name_empty[0];
-}
-
-char *getname_tex_ei(int nr)
-{
- if(nr>=TE_NSIZE && nr<=TE_CONTRA) return tex_ic_names[nr-1];
-
- return ic_name_empty[0];
-}
-
-char *getname_mtex_ei(int nr)
-{
- if(nr>=MAP_OFS_X && nr<=MAP_DISP) return mtex_ic_names[nr-1];
-
- return ic_name_empty[0];
-}
-
-char *getname_mat_ei(int nr)
-{
- if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1)));
- else {
- if(nr>=MA_COL_R && nr<=MA_ADD) return ma_ic_names[nr-1];
- }
- return ic_name_empty[0];
-}
-
-char *getname_world_ei(int nr)
-{
- if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1)));
- else {
- if(nr>=WO_HOR_R && nr<=WO_STARSIZE) return wo_ic_names[nr-1];
- }
- return ic_name_empty[0];
-}
-
-char *getname_seq_ei(int nr)
-{
- if(nr == SEQ_FAC1) return seq_ic_names[nr-1];
- return ic_name_empty[0];
-}
-
-char *getname_cu_ei(int nr)
-{
- if(nr==CU_SPEED) return cu_ic_names[nr-1];
- return ic_name_empty[0];
-}
-
-char *getname_la_ei(int nr)
-{
- if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1)));
- else {
- if(nr>=LA_ENERGY && nr<=LA_HALOINT) return la_ic_names[nr-1];
- }
- return ic_name_empty[0];
-}
-
-char *getname_cam_ei(int nr)
-{
- if(nr>=CAM_LENS && nr<=CAM_SHIFT_Y) return cam_ic_names[nr-1];
- return ic_name_empty[0];
-}
-
-char *getname_snd_ei(int nr)
-{
- if(nr>=SND_VOLUME && nr<=SND_ATTEN) return snd_ic_names[nr-1];
- return ic_name_empty[0];
-}
-
-char *getname_fluidsim_ei(int nr)
-{
- if(nr <= FLUIDSIM_TOTIPO) return fluidsim_ic_names[nr-1];
- return ic_name_empty[0];
-}
-char *getname_part_ei(int nr)
-{
- if(nr <= PART_TOTIPO) return part_ic_names[nr-1];
- return ic_name_empty[0];
-}
-
-
-void boundbox_ipocurve(IpoCurve *icu, int selectedonly)
-{
- BezTriple *bezt;
- float vec[3]={0.0,0.0,0.0};
- float min[3], max[3];
- int a;
-
- if(icu->totvert) {
- INIT_MINMAX(min, max);
-
- if(icu->bezt ) {
- a= icu->totvert;
- bezt= icu->bezt;
- while(a--) {
- if(icu->vartype & IPO_BITS) {
- if((bezt->f2 & SELECT) || !selectedonly) {
- vec[0]= bezt->vec[1][0];
- vec[1]= 0.0;
- DO_MINMAX(vec, min, max);
-
- vec[1]= 16.0;
- DO_MINMAX(vec, min, max);
- }
- }
- else {
- if((bezt->f1 & SELECT) || !selectedonly) {
- if(icu->ipo==IPO_BEZ && a!=icu->totvert-1)
- DO_MINMAX(bezt->vec[0], min, max);
- }
- if((bezt->f2 & SELECT) || !selectedonly)
- DO_MINMAX(bezt->vec[1], min, max);
- if((bezt->f3 & SELECT) || !selectedonly) {
- if(icu->ipo==IPO_BEZ && a!=0)
- DO_MINMAX(bezt->vec[2], min, max);
- }
- }
-
- bezt++;
- }
- }
- if(min[0]==max[0]) max[0]= (float)(min[0]+1.0);
- if(min[1]==max[1]) max[1]= (float)(min[1]+0.1);
-
- icu->totrct.xmin= min[0];
- icu->totrct.ymin= min[1];
- icu->totrct.xmax= max[0];
- icu->totrct.ymax= max[1];
- }
- else {
- icu->totrct.xmin= icu->totrct.ymin= 0.0;
- icu->totrct.xmax= EFRA;
- icu->totrct.ymax= 1.0;
- }
-}
-
-void boundbox_ipo(Ipo *ipo, rctf *bb, int selectedonly)
-{
- IpoCurve *icu;
- int first= 1;
-
- icu= ipo->curve.first;
- while(icu) {
-
- boundbox_ipocurve(icu, selectedonly);
-
- if(first) {
- *bb= icu->totrct;
- first= 0;
- }
- else BLI_union_rctf(bb, &(icu->totrct));
-
- icu= icu->next;
- }
-}
-
-
-unsigned int ipo_rainbow(int cur, int tot)
-{
- float dfac, fac, sat;
-
- dfac= (float)(1.0/( (float)tot+1.0));
-
- /* this calculation makes 2 or 4 different cycles of rainbow colors */
- if(cur< tot/2) fac= (float)(cur*2.0f*dfac);
- else fac= (float)((cur-tot/2)*2.0f*dfac +dfac);
- if(tot > 32) fac= fac*1.95f;
- if(fac>1.0f) fac-= 1.0f;
-
- if(fac>0.5f && fac<0.8f) sat= 0.4f;
- else sat= 0.5f;
-
- return hsv_to_cpack(fac, sat, 1.0f);
-}
-
-/* exported to python, hrms... (ton) */
-int texchannel_to_adrcode(int channel)
-{
- switch(channel) {
- case 0: return MA_MAP1;
- case 1: return MA_MAP2;
- case 2: return MA_MAP3;
- case 3: return MA_MAP4;
- case 4: return MA_MAP5;
- case 5: return MA_MAP6;
- case 6: return MA_MAP7;
- case 7: return MA_MAP8;
- case 8: return MA_MAP9;
- case 9: return MA_MAP10;
- case 10: return MA_MAP11;
- case 11: return MA_MAP12;
- case 12: return MA_MAP13;
- case 13: return MA_MAP14;
- case 14: return MA_MAP15;
- case 15: return MA_MAP16;
- case 16: return MA_MAP17;
- case 17: return MA_MAP18;
- default: return 0;
- }
-}
-
-
-
-
diff --git a/source/blender/src/editipo_mods.c b/source/blender/src/editipo_mods.c
deleted file mode 100644
index 7e57d48b7fb..00000000000
--- a/source/blender/src/editipo_mods.c
+++ /dev/null
@@ -1,1412 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation, 2005. Full recode
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-/* ********** Selection and set Handle code for editing Ipos in Blender ************* */
-/*
- mouse_select_ipo() is in editipo.c
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_object_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_action.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editaction.h"
-#include "BIF_interface.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_edit.h"
-#include "BSE_editipo_types.h"
-#include "BSE_editipo.h"
-#include "BSE_drawipo.h"
-#include "BSE_trans_types.h"
-#include "BSE_time.h"
-
-#include "BDR_drawobject.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-extern int totipo_edit, totipo_sel, totipo_vertsel, totipo_vis;
-
-void ipo_toggle_showkey(void)
-{
- if(G.sipo->showkey) G.sipo->showkey= 0;
- else G.sipo->showkey= 1;
-
- free_ipokey(&G.sipo->ipokey);
- if(G.sipo->ipo) G.sipo->ipo->showkey= G.sipo->showkey;
-
- BIF_undo_push("Toggle Show Key Ipo");
-}
-
-void swap_selectall_editipo(void)
-{
- Object *ob;
- EditIpo *ei;
- IpoKey *ik;
- BezTriple *bezt;
- int a, b; /* , sel=0; */
-
- get_status_editipo();
-
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- while(ik) {
- if(totipo_vertsel) ik->flag &= ~1;
- else ik->flag |= 1;
- ik= ik->next;
- }
- update_editipo_flags();
-
- if(G.sipo->showkey && G.sipo->blocktype==ID_OB ) {
- ob= OBACT;
- if(ob && (ob->ipoflag & OB_DRAWKEY)) draw_object_ext(BASACT);
- }
- }
- else if(totipo_edit==0) {
- ei= G.sipo->editipo;
- if (ei){
- for(a=0; a<G.sipo->totipo; a++) {
- if( ei->flag & IPO_VISIBLE ) {
- if(totipo_sel) ei->flag &= ~IPO_SELECT;
- else ei->flag |= IPO_SELECT;
- }
- ei++;
- }
- update_editipo_flags();
- }
- get_status_editipo();
- }
- else {
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu )) {
- bezt= ei->icu->bezt;
- if(bezt) {
- b= ei->icu->totvert;
- while(b--) {
- if(totipo_vertsel) {
- BEZ_DESEL(bezt);
- }
- else {
- BEZ_SEL(bezt);
- }
- bezt++;
- }
- }
- }
- ei++;
- }
-
- }
-
- BIF_undo_push("Swap Select All Ipo");
- scrarea_queue_winredraw(curarea);
-
-}
-
-void swap_visible_editipo(void)
-{
- EditIpo *ei;
- Object *ob;
- int a; /* , sel=0; */
-
- get_status_editipo();
-
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if(totipo_vis==0) {
- if(ei->icu) {
- ei->flag |= IPO_VISIBLE;
- ei->flag |= IPO_SELECT;
- }
- }
- else
- ei->flag &= ~IPO_VISIBLE;
- ei++;
- }
-
- update_editipo_flags();
-
- if(G.sipo->showkey) {
-
- make_ipokey();
-
- ob= OBACT;
- if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0);
- }
-
- scrarea_queue_winredraw(curarea);
- BIF_undo_push("Swap Visible Ipo");
-}
-
-void deselectall_editipo(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- BezTriple *bezt;
- int a, b; /* , sel=0; */
-
- get_status_editipo();
-
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- while(ik) {
- ik->flag &= ~1;
- ik= ik->next;
- }
- update_editipo_flags();
-
- }
- else if(totipo_edit==0) {
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if( ei->flag & IPO_VISIBLE ) {
- ei->flag &= ~IPO_SELECT;
- }
- ei++;
- }
- update_editipo_flags();
- }
- else {
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu )) {
- if(ei->icu->bezt) {
- bezt= ei->icu->bezt;
- b= ei->icu->totvert;
- while(b--) {
- BEZ_DESEL(bezt);
- bezt++;
- }
- }
- }
- ei++;
- }
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-
-static int icu_keys_bezier_loop(IpoCurve *icu,
- int (*bezier_function)(BezTriple *),
- void (ipocurve_function)(struct IpoCurve *icu))
-{
- /* This loops through the beziers in the Ipocurve, and executes
- * the generic user provided 'bezier_function' on each one.
- * Optionally executes the generic function ipocurve_function on the
- * IPO curve after looping (eg. calchandles_ipocurve)
- */
-
- int b;
- BezTriple *bezt;
-
- b = icu->totvert;
- bezt = icu->bezt;
-
- /* if bezier_function has been specified
- * then loop through each bezier executing
- * it.
- */
-
- if (bezier_function != NULL) {
- while(b--) {
- /* exit with return code 1 if the bezier function
- * returns 1 (good for when you are only interested
- * in finding the first bezier that
- * satisfies a condition).
- */
- if (bezier_function(bezt)) return 1;
- bezt++;
- }
- }
-
- /* if ipocurve_function has been specified
- * then execute it
- */
- if (ipocurve_function != NULL)
- ipocurve_function(icu);
-
- return 0;
-
-}
-
-static int ipo_keys_bezier_loop(Ipo *ipo,
- int (*bezier_function)(BezTriple *),
- void (ipocurve_function)(struct IpoCurve *icu))
-{
- /* This loops through the beziers that are attached to
- * the selected keys on the Ipocurves of the Ipo, and executes
- * the generic user provided 'bezier_function' on each one.
- * Optionally executes the generic function ipocurve_function on a
- * IPO curve after looping (eg. calchandles_ipocurve)
- */
-
- IpoCurve *icu;
-
- if(ipo==NULL) return 0;
-
- /* Loop through each curve in the Ipo
- */
- for (icu=ipo->curve.first; icu; icu=icu->next){
- if (icu_keys_bezier_loop(icu,bezier_function, ipocurve_function))
- return 1;
- }
-
- return 0;
-}
-
-static int selected_bezier_loop(int (*looptest)(EditIpo *),
- int (*bezier_function)(BezTriple *),
- void (ipocurve_function)(struct IpoCurve *icu))
-{
- /* This loops through the beziers that are attached to
- * selected keys in editmode in the IPO window, and executes
- * the generic user-provided 'bezier_function' on each one
- * that satisfies the 'looptest' function. Optionally executes
- * the generic function ipocurve_function on a IPO curve
- * after looping (eg. calchandles_ipocurve)
- */
-
- EditIpo *ei;
- BezTriple *bezt;
- int a, b;
-
- /* Get the first Edit Ipo from the selected Ipos
- */
- ei= G.sipo->editipo;
-
- /* Loop throught all of the selected Ipo's
- */
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- /* Do a user provided test on the Edit Ipo
- * to determine whether we want to process it
- */
- if (looptest(ei)) {
- /* Loop through the selected
- * beziers on the Edit Ipo
- */
- bezt = ei->icu->bezt;
- b = ei->icu->totvert;
-
- /* if bezier_function has been specified
- * then loop through each bezier executing
- * it.
- */
- if (bezier_function != NULL) {
- while(b--) {
- /* exit with return code 1 if the bezier function
- * returns 1 (good for when you are only interested
- * in finding the first bezier that
- * satisfies a condition).
- */
- if (bezier_function(bezt)) return 1;
- bezt++;
- }
- }
-
- /* if ipocurve_function has been specified
- * then execute it
- */
- if (ipocurve_function != NULL)
- ipocurve_function(ei->icu);
- }
- /* nufte flourdje zim ploopydu <-- random dutch looking comment ;) */
- /* looks more like russian to me! (ton) */
- }
-
- return 0;
-}
-
-int select_bezier_add(BezTriple *bezt)
-{
- /* Select the bezier triple */
- BEZ_SEL(bezt);
- return 0;
-}
-
-int select_bezier_subtract(BezTriple *bezt)
-{
- /* Deselect the bezier triple */
- BEZ_DESEL(bezt);
- return 0;
-}
-
-int select_bezier_invert(BezTriple *bezt)
-{
- /* Invert the selection for the bezier triple */
- bezt->f2 ^= SELECT;
- if ( bezt->f2 & SELECT ) {
- bezt->f1 |= SELECT;
- bezt->f3 |= SELECT;
- }
- else {
- bezt->f1 &= ~SELECT;
- bezt->f3 &= ~SELECT;
- }
- return 0;
-}
-
-static int set_bezier_auto(BezTriple *bezt)
-{
- /* Sets the selected bezier handles to type 'auto'
- */
-
- /* is a handle selected? If so
- * set it to type auto
- */
- if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
- if(bezt->f1 & SELECT) bezt->h1= 1; /* the secret code for auto */
- if(bezt->f3 & SELECT) bezt->h2= 1;
-
- /* if the handles are not of the same type, set them
- * to type free
- */
- if(bezt->h1!=bezt->h2) {
- if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE;
- if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE;
- }
- }
- return 0;
-}
-
-static int set_bezier_vector(BezTriple *bezt)
-{
- /* Sets the selected bezier handles to type 'vector'
- */
-
- /* is a handle selected? If so
- * set it to type vector
- */
- if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
- if(bezt->f1 & SELECT) bezt->h1= 2; /* the code for vector */
- if(bezt->f3 & SELECT) bezt->h2= 2;
-
- /* if the handles are not of the same type, set them
- * to type free
- */
- if(bezt->h1!=bezt->h2) {
- if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE;
- if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE;
- }
- }
- return 0;
-}
-
-static int bezier_isfree(BezTriple *bezt)
-{
- /* queries whether the handle should be set
- * to type 'free' (I think)
- */
- if((bezt->f1 & SELECT) && bezt->h1) return 1;
- if((bezt->f3 & SELECT) && bezt->h2) return 1;
- return 0;
-}
-
-static int set_bezier_free(BezTriple *bezt)
-{
- /* Sets selected bezier handles to type 'free'
- */
- if(bezt->f1 & SELECT) bezt->h1= HD_FREE;
- if(bezt->f3 & SELECT) bezt->h2= HD_FREE;
- return 0;
-}
-
-static int set_bezier_align(BezTriple *bezt)
-{
- /* Sets selected bezier handles to type 'align'
- */
- if(bezt->f1 & SELECT) bezt->h1= HD_ALIGN;
- if(bezt->f3 & SELECT) bezt->h2= HD_ALIGN;
- return 0;
-}
-
-static int vis_edit_icu_bez(EditIpo *ei)
-{
- /* A 4 part test for an EditIpo :
- * is it a) visible
- * b) in edit mode
- * c) does it contain an Ipo Curve
- * d) does that ipo curve have a bezier
- *
- * (The reason why I don't just use the macro
- * is I need a pointer to a function.)
- */
- return (ISPOIN4(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu, icu->bezt));
-}
-
-void select_ipo_bezier_keys(Ipo *ipo, int selectmode)
-{
- /* Select all of the beziers in all
- * of the Ipo curves belonging to the
- * Ipo, using the selection mode.
- */
- switch (selectmode) {
- case SELECT_ADD:
- ipo_keys_bezier_loop(ipo, select_bezier_add, NULL);
- break;
- case SELECT_SUBTRACT:
- ipo_keys_bezier_loop(ipo, select_bezier_subtract, NULL);
- break;
- case SELECT_INVERT:
- ipo_keys_bezier_loop(ipo, select_bezier_invert, NULL);
- break;
- }
-}
-
-void select_icu_bezier_keys(IpoCurve *icu, int selectmode)
-{
- /* Select all of the beziers in all
- * of the Ipo curves belonging to the
- * Ipo, using the selection mode.
- */
- switch (selectmode) {
- case SELECT_ADD:
- icu_keys_bezier_loop(icu, select_bezier_add, NULL);
- break;
- case SELECT_SUBTRACT:
- icu_keys_bezier_loop(icu, select_bezier_subtract, NULL);
- break;
- case SELECT_INVERT:
- icu_keys_bezier_loop(icu, select_bezier_invert, NULL);
- break;
- }
-}
-
-void sethandles_ipo_keys(Ipo *ipo, int code)
-{
- /* this function lets you set bezier handles all to
- * one type for some Ipo's (e.g. with hotkeys through
- * the action window).
- */
-
- /* code==1: set autohandle */
- /* code==2: set vectorhandle */
- /* als code==3 (HD_ALIGN) toggelt het, vectorhandles worden HD_FREE */
-
- switch(code) {
- case 1:
- /*** Set to auto ***/
- ipo_keys_bezier_loop(ipo, set_bezier_auto,
- calchandles_ipocurve);
- break;
- case 2:
- /*** Set to vector ***/
- ipo_keys_bezier_loop(ipo, set_bezier_vector,
- calchandles_ipocurve);
- break;
- default:
- if ( ipo_keys_bezier_loop(ipo, bezier_isfree, NULL) ) {
- /*** Set to free ***/
- ipo_keys_bezier_loop(ipo, set_bezier_free,
- calchandles_ipocurve);
- }
- else {
- /*** Set to align ***/
- ipo_keys_bezier_loop(ipo, set_bezier_align,
- calchandles_ipocurve);
- }
- break;
- }
-}
-
-static int snap_bezier_nearest(BezTriple *bezt)
-{
- if(bezt->f2 & SELECT)
- bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5));
- return 0;
-}
-
-static int snap_bezier_nearestsec(BezTriple *bezt)
-{
- float secf = FPS;
- if(bezt->f2 & SELECT)
- bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]/secf + 0.5f) * secf);
- return 0;
-}
-
-static int snap_bezier_cframe(BezTriple *bezt)
-{
- if(bezt->f2 & SELECT)
- bezt->vec[1][0]= (float)CFRA;
- return 0;
-}
-
-static int snap_bezier_nearmarker(BezTriple *bezt)
-{
- if(bezt->f2 & SELECT)
- bezt->vec[1][0]= (float)find_nearest_marker_time(bezt->vec[1][0]);
-
- return 0;
-}
-
-void snap_ipo_keys(Ipo *ipo, short snaptype)
-{
- switch (snaptype) {
- case 1: /* snap to nearest frame */
- ipo_keys_bezier_loop(ipo, snap_bezier_nearest, calchandles_ipocurve);
- break;
- case 2: /* snap to current frame */
- ipo_keys_bezier_loop(ipo, snap_bezier_cframe, calchandles_ipocurve);
- break;
- case 3: /* snap to nearest marker */
- ipo_keys_bezier_loop(ipo, snap_bezier_nearmarker, calchandles_ipocurve);
- break;
- case 4: /* snap to nearest second */
- ipo_keys_bezier_loop(ipo, snap_bezier_nearestsec, calchandles_ipocurve);
- break;
- default: /* just in case */
- ipo_keys_bezier_loop(ipo, snap_bezier_nearest, calchandles_ipocurve);
- break;
- }
-}
-
-static int mirror_bezier_cframe(BezTriple *bezt)
-{
- float diff;
-
- if(bezt->f2 & SELECT) {
- diff= ((float)CFRA - bezt->vec[1][0]);
- bezt->vec[1][0]= ((float)CFRA + diff);
- }
-
- return 0;
-}
-
-static int mirror_bezier_yaxis(BezTriple *bezt)
-{
- float diff;
-
- if(bezt->f2 & SELECT) {
- diff= (0.0f - bezt->vec[1][0]);
- bezt->vec[1][0]= (0.0f + diff);
- }
-
- return 0;
-}
-
-static int mirror_bezier_xaxis(BezTriple *bezt)
-{
- float diff;
-
- if(bezt->f2 & SELECT) {
- diff= (0.0f - bezt->vec[1][1]);
- bezt->vec[1][1]= (0.0f + diff);
- }
-
- return 0;
-}
-
-static int mirror_bezier_marker(BezTriple *bezt)
-{
- static TimeMarker *marker;
- static short initialised = 0;
- float diff;
-
- /* In order for this mirror function to work without
- * any extra arguments being added, we use the case
- * of bezt==NULL to denote that we should find the
- * marker to mirror over. The static pointer is safe
- * to use this way, as it will be set to null after
- * each cycle in which this is called.
- */
-
- if (bezt) {
- /* mirroring time */
- if((bezt->f2 & SELECT) && (marker)) {
- diff= (marker->frame - bezt->vec[1][0]);
- bezt->vec[1][0]= (marker->frame + diff);
- }
- }
- else {
- /* initialisation time */
- if (initialised) {
- /* reset everything for safety */
- marker = NULL;
- initialised = 0;
- }
- else {
- /* try to find a marker */
- for (marker= G.scene->markers.first; marker; marker=marker->next) {
- if (marker->flag & SELECT) {
- initialised = 1;
- break;
- }
- }
-
- if (initialised == 0)
- marker = NULL;
- }
- }
-
- return 0;
-}
-
-void mirror_ipo_keys(Ipo *ipo, short mirror_type)
-{
- switch (mirror_type) {
- case 1: /* mirror over current frame */
- ipo_keys_bezier_loop(ipo, mirror_bezier_cframe, calchandles_ipocurve);
- break;
- case 2: /* mirror over frame 0 */
- ipo_keys_bezier_loop(ipo, mirror_bezier_yaxis, calchandles_ipocurve);
- break;
- case 3: /* mirror over value 0 */
- ipo_keys_bezier_loop(ipo, mirror_bezier_xaxis, calchandles_ipocurve);
- break;
- case 4: /* mirror over marker */
- mirror_bezier_marker(NULL);
- ipo_keys_bezier_loop(ipo, mirror_bezier_marker, calchandles_ipocurve);
- mirror_bezier_marker(NULL);
- break;
- default: /* just in case */
- ipo_keys_bezier_loop(ipo, mirror_bezier_yaxis, calchandles_ipocurve);
- break;
- }
-}
-
-/* This function is called to calculate the average location of the
- * selected keyframes, and place the current frame at that location.
- *
- * It must be called like so:
- * snap_cfra_ipo_keys(NULL, -1); // initialise the static vars first
- * for (ipo...) snap_cfra_ipo_keys(ipo, 0); // sum up keyframe times
- * snap_cfra_ipo_keys(NULL, 1); // set current frame after taking average
- */
-void snap_cfra_ipo_keys(Ipo *ipo, short mode)
-{
- static int cfra;
- static int tot;
-
- IpoCurve *icu;
- BezTriple *bezt;
- int a;
-
-
- if (mode == -1) {
- /* initialise a new snap-operation */
- cfra= 0;
- tot= 0;
- }
- else if (mode == 1) {
- /* set current frame - using average frame */
- if (tot != 0)
- CFRA = cfra / tot;
- }
- else {
- /* loop through keys in ipo, summing the frame
- * numbers of those that are selected
- */
- if (ipo == NULL)
- return;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- for (a=0, bezt=icu->bezt; a < icu->totvert; a++, bezt++) {
- if (BEZSELECTED(bezt)) {
- cfra += bezt->vec[1][0];
- tot++;
- }
- }
- }
- }
-}
-
-
-/* currently only used by some action editor tools, but may soon get used by ipo editor */
-/* restore = whether to map points back to ipo-time
- * only_keys = whether to only adjust the location of the center point of beztriples
- */
-void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore, short only_keys)
-{
- IpoCurve *icu;
- BezTriple *bezt;
- int a;
-
- if (ipo==NULL) return;
-
- /* loop through all ipo curves, adjusting the times of the selected keys */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- for (a=0, bezt=icu->bezt; a<icu->totvert; a++, bezt++) {
- /* are the times being adjusted for editing, or has editing finished */
- if (restore) {
- if (only_keys == 0) {
- bezt->vec[0][0]= get_action_frame(ob, bezt->vec[0][0]);
- bezt->vec[2][0]= get_action_frame(ob, bezt->vec[2][0]);
- }
- bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]);
- }
- else {
- if (only_keys == 0) {
- bezt->vec[0][0]= get_action_frame_inv(ob, bezt->vec[0][0]);
- bezt->vec[2][0]= get_action_frame_inv(ob, bezt->vec[2][0]);
- }
- bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]);
- }
- }
- }
-}
-
-static void ipo_curves_auto_horiz(void)
-{
- EditIpo *ei;
- int a, set= 1;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu))
- if(ei->flag & IPO_AUTO_HORIZ) set= 0;
- }
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
- if(set) ei->flag |= IPO_AUTO_HORIZ;
- else ei->flag &= ~IPO_AUTO_HORIZ;
- }
- }
- update_editipo_flags();
-}
-
-void sethandles_ipo(int code)
-{
- /* this function lets you set bezier handles all to
- * one type for some selected keys in edit mode in the
- * IPO window (e.g. with hotkeys)
- */
-
- /* code==1: set autohandle */
- /* code==2: set vectorhandle */
- /* als code==3 (HD_ALIGN) toggelt het, vectorhandles worden HD_FREE */
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
-
- switch(code) {
- case HD_AUTO:
- /*** Set to auto ***/
- selected_bezier_loop(vis_edit_icu_bez, set_bezier_auto,
- calchandles_ipocurve);
- break;
- case HD_VECT:
- /*** Set to vector ***/
- selected_bezier_loop(vis_edit_icu_bez, set_bezier_vector,
- calchandles_ipocurve);
- break;
- case HD_AUTO_ANIM:
- /* set to enforce autohandles to be horizontal on extremes */
- ipo_curves_auto_horiz();
-
- break;
- default:
- if (selected_bezier_loop(vis_edit_icu_bez, bezier_isfree, NULL) ) {
- /*** Set to free ***/
- selected_bezier_loop(vis_edit_icu_bez, set_bezier_free,
- calchandles_ipocurve);
- }
- else {
- /*** Set to align ***/
- selected_bezier_loop(vis_edit_icu_bez, set_bezier_align,
- calchandles_ipocurve);
- }
- break;
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Set handles Ipo");
-}
-
-
-static void set_ipocurve_constant(struct IpoCurve *icu) {
- /* Sets the type of the IPO curve to constant
- */
- icu->ipo= IPO_CONST;
-}
-
-static void set_ipocurve_linear(struct IpoCurve *icu) {
- /* Sets the type of the IPO curve to linear
- */
- icu->ipo= IPO_LIN;
-}
-
-static void set_ipocurve_bezier(struct IpoCurve *icu) {
- /* Sets the type of the IPO curve to bezier
- */
-
- /* dont regenerate hendels for bezier ipo curves */
- if (icu->ipo==IPO_BEZ) return;
-
- /* curve handels aren't generated for non bezier curve types */
- icu->ipo= IPO_BEZ;
- calchandles_ipocurve(icu);
-}
-
-
-void setipotype_ipo(Ipo *ipo, int code)
-{
- /* Sets the type of the each ipo curve in the
- * Ipo to a value based on the code
- */
- switch (code) {
- case 1:
- ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_constant);
- break;
- case 2:
- ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_linear);
- break;
- case 3:
- ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_bezier);
- break;
- }
-}
-
-void setexprap_ipoloop(Ipo *ipo, int code)
-{
- IpoCurve *icu;
-
- /* Loop through each curve in the Ipo */
- for (icu=ipo->curve.first; icu; icu=icu->next)
- icu->extrap= code;
-}
-
-void set_ipotype(void)
-{
- EditIpo *ei;
- int a;
- short event;
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
- if(G.sipo->showkey) return;
- get_status_editipo();
-
- if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) {
- Key *key= ob_get_key((Object *)G.sipo->from);
- Object *ob= OBACT;
- KeyBlock *kb;
-
- if(key==NULL) return;
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb==NULL) return;
-
- event= pupmenu("Key Type %t|Linear %x1|Cardinal %x2|B Spline %x3");
- if(event < 1) return;
-
- kb->type= 0;
- if(event==1) kb->type= KEY_LINEAR;
- if(event==2) kb->type= KEY_CARDINAL;
- if(event==3) kb->type= KEY_BSPLINE;
- }
- else {
- event= pupmenu("Ipo Type %t|Constant %x1|Linear %x2|Bezier %x3");
- if(event < 1) return;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) {
- if(event==1) ei->icu->ipo= IPO_CONST;
- else if(event==2) ei->icu->ipo= IPO_LIN;
- else ei->icu->ipo= IPO_BEZ;
- }
- }
- }
- BIF_undo_push("Set ipo type");
- scrarea_queue_winredraw(curarea);
-}
-
-void set_ipoextend(void)
-{
- short event= pupmenu("Ipo Extend Mode %t|Constant %x1|Extrapolation %x2|Cyclic %x3|Cyclic Extrapolation %x4");
-
- switch(event)
- {
- case 1:
- set_exprap_ipo(IPO_HORIZ);
- break;
- case 2:
- set_exprap_ipo(IPO_DIR);
- break;
- case 3:
- set_exprap_ipo(IPO_CYCL);
- break;
- case 4:
- set_exprap_ipo(IPO_CYCLX);
- break;
- }
-}
-
-void borderselect_ipo(void)
-{
- EditIpo *ei;
- IpoKey *ik;
- BezTriple *bezt;
- rcti rect;
- rctf rectf;
- int a, b, val;
- short mval[2];
-
- get_status_editipo();
-
- val= get_border(&rect, 3);
-
- if(val) {
- /* map ipo-points for editing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
- }
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- if(G.sipo->showkey) {
- ik= G.sipo->ipokey.first;
- while(ik) {
- if(rectf.xmin<ik->val && rectf.xmax>ik->val) {
- if(val==LEFTMOUSE) ik->flag |= 1;
- else ik->flag &= ~1;
- }
- ik= ik->next;
- }
- update_editipo_flags();
- }
- else if(totipo_edit==0) {
- if(rect.xmin<rect.xmax && rect.ymin<rect.ymax)
- select_proj_ipo(&rectf, val);
- }
- else {
- int selflag= (val==LEFTMOUSE) ? SELECT : 0;
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu)) {
- if(ei->icu->bezt) {
- b= ei->icu->totvert;
- bezt= ei->icu->bezt;
- while(b--) {
- if(BLI_in_rctf(&rectf, bezt->vec[0][0], bezt->vec[0][1]))
- bezt->f1 = selflag ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
- if(BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1]))
- bezt->f2 = selflag ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
- if(BLI_in_rctf(&rectf, bezt->vec[2][0], bezt->vec[2][1]))
- bezt->f3 = selflag ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
-
- bezt++;
- }
- }
- }
- }
- }
-
- /* undo mapping of ipo-points for drawing if scaled ipo */
- if (NLA_IPO_SCALED) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
- }
-
- BIF_undo_push("Border select Ipo");
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
-}
-
-
-
-void nextkey(ListBase *elems, int dir)
-{
- IpoKey *ik, *previk;
- int totsel;
-
- if(dir==1) ik= elems->last;
- else ik= elems->first;
- previk= 0;
- totsel= 0;
-
- while(ik) {
-
- if(ik->flag) totsel++;
-
- if(previk) {
- if(G.qual & LR_SHIFTKEY) {
- if(ik->flag) previk->flag= 1;
- }
- else previk->flag= ik->flag;
- }
-
- previk= ik;
- if(dir==1) ik= ik->prev;
- else ik= ik->next;
-
- if(G.qual & LR_SHIFTKEY);
- else if(ik==0) previk->flag= 0;
- }
-
- /* when no key select: */
- if(totsel==0) {
- if(dir==1) ik= elems->first;
- else ik= elems->last;
-
- if(ik) ik->flag= 1;
- }
-}
-
-
-void nextkey_ipo(int dir) /* call from ipo queue */
-{
- IpoKey *ik;
- int a;
-
- if(G.sipo->showkey==0) return;
-
- nextkey(&G.sipo->ipokey, dir);
-
- /* copy to beziers */
- ik= G.sipo->ipokey.first;
- while(ik) {
- for(a=0; a<G.sipo->totipo; a++) {
- if(ik->data[a]) ik->data[a]->f1= ik->data[a]->f2= ik->data[a]->f3= ik->flag;
- }
- ik= ik->next;
- }
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- if(G.sipo->blocktype == ID_OB) allqueue(REDRAWVIEW3D, 0);
-}
-
-void nextkey_obipo(int dir) /* only call external from view3d queue */
-{
- Base *base;
- Object *ob;
- ListBase elems;
- IpoKey *ik;
- int a;
-
- if (!G.vd) {
- error("Can't do this! Open a 3D window");
- return;
- }
-
- /* problem: this doesnt work when you mix dLoc keys with Loc keys */
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- ob= base->object;
- if( (ob->ipoflag & OB_DRAWKEY) && ob->ipo && ob->ipo->showkey) {
- elems.first= elems.last= 0;
- make_ipokey_transform(ob, &elems, 0);
-
- if(elems.first) {
-
- nextkey(&elems, dir);
-
- /* copy to beziers */
- ik= elems.first;
- while(ik) {
- for(a=0; a<OB_TOTIPO; a++) {
- if(ik->data[a]) ik->data[a]->f1= ik->data[a]->f2= ik->data[a]->f3= ik->flag;
- }
- ik= ik->next;
- }
-
- free_ipokey(&elems);
- }
- }
- }
-
- base= base->next;
- }
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-int is_ipo_key_selected(Ipo *ipo)
-{
- int i;
- IpoCurve *icu;
-
- if (!ipo)
- return 0;
-
- for (icu=ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++)
- if (BEZSELECTED(&icu->bezt[i]))
- return 1;
- }
-
- return 0;
-}
-
-void set_ipo_key_selection(Ipo *ipo, int sel)
-{
- int i;
- IpoCurve *icu;
-
- if (!ipo)
- return;
-
- for (icu=ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (sel == 2) {
- BEZ_INVSEL(&icu->bezt[i]);
- }
- else if (sel == 1){
- BEZ_SEL(&icu->bezt[i]);
- }
- else{
- BEZ_DESEL(&icu->bezt[i]);
- }
- }
- }
-}
-
-int fullselect_ipo_keys(Ipo *ipo)
-{
- int i;
- IpoCurve *icu;
- int tvtot = 0;
-
- if (!ipo)
- return tvtot;
-
- for (icu=ipo->curve.first; icu; icu=icu->next) {
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].f2 & SELECT){
- tvtot+=3;
- icu->bezt[i].f1 |= SELECT;
- icu->bezt[i].f3 |= SELECT;
- }
- }
- }
-
- return tvtot;
-}
-
-
-void borderselect_icu_key(IpoCurve *icu, float xmin, float xmax,
- int (*select_function)(BezTriple *))
-{
- /* Selects all bezier triples in the Ipocurve
- * between times xmin and xmax, using the selection
- * function.
- */
-
- int i;
-
- /* loop through all of the bezier triples in
- * the Ipocurve -- if the triple occurs between
- * times xmin and xmax then select it using the selection
- * function
- */
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] < xmax ){
- select_function(&(icu->bezt[i]));
- }
- }
-}
-
-void borderselect_ipo_key(Ipo *ipo, float xmin, float xmax, int selectmode)
-{
- /* Selects all bezier triples in each Ipocurve of the
- * Ipo between times xmin and xmax, using the selection mode.
- */
-
- IpoCurve *icu;
- int (*select_function)(BezTriple *);
-
- /* If the ipo is no good then return */
- if (!ipo)
- return;
-
- /* Set the selection function based on the
- * selection mode.
- */
- switch(selectmode) {
- case SELECT_ADD:
- select_function = select_bezier_add;
- break;
- case SELECT_SUBTRACT:
- select_function = select_bezier_subtract;
- break;
- case SELECT_INVERT:
- select_function = select_bezier_invert;
- break;
- default:
- return;
- }
-
- /* loop through all of the bezier triples in all
- * of the Ipocurves -- if the triple occurs between
- * times xmin and xmax then select it using the selection
- * function
- */
- for (icu=ipo->curve.first; icu; icu=icu->next){
- borderselect_icu_key(icu, xmin, xmax, select_function);
- }
-}
-
-void select_ipo_key(Ipo *ipo, float selx, int selectmode)
-{
- /* Selects all bezier triples in each Ipocurve of the
- * Ipo at time selx, using the selection mode.
- */
- int i;
- IpoCurve *icu;
- int (*select_function)(BezTriple *);
-
- /* If the ipo is no good then return */
- if (!ipo)
- return;
-
- /* Set the selection function based on the
- * selection mode.
- */
- switch(selectmode) {
- case SELECT_ADD:
- select_function = select_bezier_add;
- break;
- case SELECT_SUBTRACT:
- select_function = select_bezier_subtract;
- break;
- case SELECT_INVERT:
- select_function = select_bezier_invert;
- break;
- default:
- return;
- }
-
- /* loop through all of the bezier triples in all
- * of the Ipocurves -- if the triple occurs at
- * time selx then select it using the selection
- * function
- */
- for (icu=ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0]==selx){
- select_function(&(icu->bezt[i]));
- }
- }
- }
-}
-
-void select_icu_key(IpoCurve *icu, float selx, int selectmode)
-{
- /* Selects all bezier triples in the Ipocurve
- * at time selx, using the selection mode.
- * This is kind of sloppy the obvious similarities
- * with the above function, forgive me ...
- */
- int i;
- int (*select_function)(BezTriple *);
-
- /* If the icu is no good then return */
- if (!icu)
- return;
-
- /* Set the selection function based on the
- * selection mode.
- */
- switch(selectmode) {
- case SELECT_ADD:
- select_function = select_bezier_add;
- break;
- case SELECT_SUBTRACT:
- select_function = select_bezier_subtract;
- break;
- case SELECT_INVERT:
- select_function = select_bezier_invert;
- break;
- default:
- return;
- }
-
- /* loop through all of the bezier triples in
- * the Ipocurve -- if the triple occurs at
- * time selx then select it using the selection
- * function
- */
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0]==selx){
- select_function(&(icu->bezt[i]));
- }
- }
-}
-
-void set_exprap_ipo(int mode)
-{
- EditIpo *ei;
- int a;
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
- /* in case of keys: always ok */
-
- ei= G.sipo->editipo;
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
- if( (ei->flag & IPO_EDIT) || (ei->flag & IPO_SELECT) || (G.sipo->showkey) ) {
- ei->icu->extrap= mode;
- }
- }
- }
-
- editipo_changed(G.sipo, 1);
- BIF_undo_push("Set extrapolation Ipo");
-}
diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c
deleted file mode 100644
index dbabf9d19fb..00000000000
--- a/source/blender/src/editkey.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editkey.h"
-#include "BIF_editview.h"
-#include "BIF_keyframing.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_interface.h"
-
-#include "BSE_editipo.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_editobject.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-extern ListBase editNurb; /* in editcurve.c */
-
-/* temporary storage for slider values */
-/* pretty bad static stuff... is secured in drawaction.c though */
-float meshslidervals[256] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
- 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-
-static IpoCurve *get_key_icu(Ipo *ipo, int keynum)
-{
- /* return the Ipocurve that has the specified
- * keynum as ardcode -- return NULL if no such
- * curve exists.
- */
- IpoCurve *icu;
-
- if (!ipo)
- return NULL;
-
- for (icu = ipo->curve.first; icu ; icu = icu->next) {
- if (!icu->adrcode) continue;
- if (icu->adrcode == keynum) return icu;
- }
-
- return NULL;
-}
-
-BezTriple *get_bezt_icu_time(IpoCurve *icu, float *frame, float *val)
-{
- /* this function tries to find a bezier that is within
- * 0.25 time units from the specified frame. If there
- * are more than one such beziers, it returns the
- * closest one.
- */
- int i;
- float d, dmin = 0.25, newframe;
- BezTriple *bezt = NULL;
-
- newframe = *frame;
-
- for (i=0; i<icu->totvert; i++){
- d = fabs(icu->bezt[i].vec[1][0] - *frame);
- if (d < dmin) {
- dmin = d;
- newframe = icu->bezt[i].vec[1][0];
- *val = icu->bezt[i].vec[1][1];
- bezt = icu->bezt + i;
- }
- }
-
- *frame = newframe;
- return bezt;
-}
-
-static void rvk_slider_func(void *voidob, void *voidkeynum)
-{
- /* the callback for the rvk sliders ... copies the
- * value from the temporary array into a bezier at the
- * right frame on the right ipo curve (creating both the
- * ipo curve and the bezier if needed).
- */
- Object *ob= voidob;
- IpoCurve *icu=NULL;
- BezTriple *bezt=NULL;
- float cfra, rvkval;
- int keynum = (intptr_t) voidkeynum;
-
- cfra = frame_to_float(CFRA);
-
- /* ipo on action or ob? */
- if(ob->ipoflag & OB_ACTION_KEY)
- icu = verify_ipocurve(&ob->id, ID_KE, "Shape", NULL, NULL, keynum, 1);
- else
- icu = verify_ipocurve(&ob->id, ID_KE, NULL, NULL, NULL, keynum, 1);
-
- if (icu) {
- /* if the ipocurve exists, try to get a bezier
- * for this frame
- */
- bezt = get_bezt_icu_time(icu, &cfra, &rvkval);
-
- /* create the bezier triple if one doesn't exist,
- * otherwise modify it's value
- */
- if (bezt == NULL) {
- insert_vert_icu(icu, cfra, meshslidervals[keynum], 0);
- }
- else {
- bezt->vec[1][1] = meshslidervals[keynum];
- }
-
- /* make sure the Ipo's are properly process and
- * redraw as necessary
- */
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
-
- ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else error("Cannot edit this Shape Key");
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWACTION, 0);
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
-}
-
-static float getrvkval(Ipo *ipo, int keynum)
-{
- /* get the value of the rvk from the
- * ipo curve at the current time -- return 0
- * if no ipo curve exists
- */
- IpoCurve *icu=NULL;
- BezTriple *bezt=NULL;
- float rvkval = 0.0;
- float cfra;
-
- cfra = frame_to_float(CFRA);
- icu = get_key_icu(ipo, keynum);
- if (icu) {
- bezt = get_bezt_icu_time(icu, &cfra, &rvkval);
- if (!bezt) {
- rvkval = eval_icu(icu, cfra);
- }
- }
-
- return rvkval;
-
-}
-
-void make_rvk_slider(uiBlock *block, Object *ob, int keynum,
- int x, int y, int w, int h, char *tip)
-{
- /* create a slider for the rvk */
- uiBut *but;
- Ipo *ipo= NULL;
- Key *key= ob_get_key(ob);
- KeyBlock *kb;
- float min, max;
- int i;
-
- if(key==NULL) return;
-
- /* ipo on action or ob? */
- if(ob->ipoflag & OB_ACTION_KEY) {
- if(ob->action) {
- bActionChannel *achan;
-
- achan= get_action_channel(ob->action, "Shape");
- if(achan) ipo= achan->ipo;
- }
- }
- else ipo= key->ipo;
-
- /* global array */
- meshslidervals[keynum] = getrvkval(ipo, keynum);
-
- kb= key->block.first;
- for (i=0; i<keynum; ++i) kb = kb->next;
-
- if ( (kb->slidermin >= kb->slidermax) ) {
- kb->slidermin = 0.0;
- kb->slidermax = 1.0;
- }
-
- min = (kb->slidermin < meshslidervals[keynum]) ?
- kb->slidermin: meshslidervals[keynum];
-
- max = (kb->slidermax > meshslidervals[keynum]) ?
- kb->slidermax: meshslidervals[keynum];
-
- but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "",
- x, y , w, h,
- meshslidervals+keynum, min, max, 10, 2, tip);
-
- uiButSetFunc(but, rvk_slider_func, ob, (void *)(intptr_t)keynum);
- // no hilite, the winmatrix is not correct later on...
- uiButSetFlag(but, UI_NO_HILITE);
-
-}
-
-static void default_key_ipo(Key *key)
-{
- IpoCurve *icu;
- BezTriple *bezt;
-
- key->ipo= add_ipo("KeyIpo", ID_KE);
-
- icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
-
- icu->blocktype= ID_KE;
- icu->adrcode= KEY_SPEED;
- icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ;
- set_icu_vars(icu);
-
- BLI_addtail( &(key->ipo->curve), icu);
-
- icu->bezt= bezt= MEM_callocN(2*sizeof(BezTriple), "defaultipo");
- icu->totvert= 2;
-
- bezt->hide= IPO_BEZ;
- bezt->f1=bezt->f2= bezt->f3= SELECT;
- bezt->h1= bezt->h2= HD_AUTO;
- bezt++;
- bezt->vec[1][0]= 100.0;
- bezt->vec[1][1]= 1.0;
- bezt->hide= IPO_BEZ;
- bezt->f1=bezt->f2= bezt->f3= SELECT;
- bezt->h1= bezt->h2= HD_AUTO;
-
- calchandles_ipocurve(icu);
-}
-
-
-
-/* **************************************** */
-
-void mesh_to_key(Mesh *me, KeyBlock *kb)
-{
- MVert *mvert;
- float *fp;
- int a;
-
- if(me->totvert==0) return;
-
- if(kb->data) MEM_freeN(kb->data);
-
- kb->data= MEM_callocN(me->key->elemsize*me->totvert, "kb->data");
- kb->totelem= me->totvert;
-
- mvert= me->mvert;
- fp= kb->data;
- for(a=0; a<kb->totelem; a++, fp+=3, mvert++) {
- VECCOPY(fp, mvert->co);
-
- }
-}
-
-void key_to_mesh(KeyBlock *kb, Mesh *me)
-{
- MVert *mvert;
- float *fp;
- int a, tot;
-
- mvert= me->mvert;
- fp= kb->data;
-
- tot= MIN2(kb->totelem, me->totvert);
-
- for(a=0; a<tot; a++, fp+=3, mvert++) {
- VECCOPY(mvert->co, fp);
- }
-}
-
-static KeyBlock *add_keyblock(Key *key)
-{
- KeyBlock *kb;
- float curpos= -0.1;
- int tot;
-
- kb= key->block.last;
- if(kb) curpos= kb->pos;
-
- kb= MEM_callocN(sizeof(KeyBlock), "Keyblock");
- BLI_addtail(&key->block, kb);
- kb->type= KEY_CARDINAL;
- tot= BLI_countlist(&key->block);
- if(tot==1) strcpy(kb->name, "Basis");
- else sprintf(kb->name, "Key %d", tot-1);
- kb->adrcode= tot-1;
-
- key->totkey++;
- if(key->totkey==1) key->refkey= kb;
-
-
- if(key->type == KEY_RELATIVE)
- kb->pos= curpos+0.1;
- else {
- curpos= bsystem_time(0, (float)CFRA, 0.0);
- if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) {
- curpos /= 100.0;
- }
- kb->pos= curpos;
-
- sort_keys(key);
- }
- return kb;
-}
-
-void insert_meshkey(Mesh *me, short rel)
-{
- Key *key;
- KeyBlock *kb;
-
- if(me->key==NULL) {
- me->key= add_key( (ID *)me);
-
- if(rel)
- me->key->type = KEY_RELATIVE;
- else
- default_key_ipo(me->key);
- }
- key= me->key;
-
- kb= add_keyblock(key);
-
- mesh_to_key(me, kb);
-}
-
-/* ******************** */
-
-void latt_to_key(Lattice *lt, KeyBlock *kb)
-{
- BPoint *bp;
- float *fp;
- int a, tot;
-
- tot= lt->pntsu*lt->pntsv*lt->pntsw;
- if(tot==0) return;
-
- if(kb->data) MEM_freeN(kb->data);
-
- kb->data= MEM_callocN(lt->key->elemsize*tot, "kb->data");
- kb->totelem= tot;
-
- bp= lt->def;
- fp= kb->data;
- for(a=0; a<kb->totelem; a++, fp+=3, bp++) {
- VECCOPY(fp, bp->vec);
- }
-}
-
-void key_to_latt(KeyBlock *kb, Lattice *lt)
-{
- BPoint *bp;
- float *fp;
- int a, tot;
-
- bp= lt->def;
- fp= kb->data;
-
- tot= lt->pntsu*lt->pntsv*lt->pntsw;
- tot= MIN2(kb->totelem, tot);
-
- for(a=0; a<tot; a++, fp+=3, bp++) {
- VECCOPY(bp->vec, fp);
- }
-
-}
-
-/* exported to python... hrms, should not, use object levels! (ton) */
-void insert_lattkey(Lattice *lt, short rel)
-{
- Key *key;
- KeyBlock *kb;
-
- if(lt->key==NULL) {
- lt->key= add_key( (ID *)lt);
- default_key_ipo(lt->key);
- }
- key= lt->key;
-
- kb= add_keyblock(key);
-
- latt_to_key(lt, kb);
-}
-
-/* ******************************** */
-
-void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb)
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- float *fp;
- int a, tot;
-
- /* count */
- tot= count_curveverts(nurb);
- if(tot==0) return;
-
- if(kb->data) MEM_freeN(kb->data);
-
- kb->data= MEM_callocN(cu->key->elemsize*tot, "kb->data");
- kb->totelem= tot;
-
- nu= nurb->first;
- fp= kb->data;
- while(nu) {
-
- if(nu->bezt) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- VECCOPY(fp, bezt->vec[0]);
- fp+= 3;
- VECCOPY(fp, bezt->vec[1]);
- fp+= 3;
- VECCOPY(fp, bezt->vec[2]);
- fp+= 3;
- fp[0]= bezt->alfa;
- fp+= 3; /* alphas */
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- VECCOPY(fp, bp->vec);
- fp[3]= bp->alfa;
-
- fp+= 4;
- bp++;
- }
- }
- nu= nu->next;
- }
-}
-
-void key_to_curve(KeyBlock *kb, Curve *cu, ListBase *nurb)
-{
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- float *fp;
- int a, tot;
-
- nu= nurb->first;
- fp= kb->data;
-
- tot= count_curveverts(nurb);
-
- tot= MIN2(kb->totelem, tot);
-
- while(nu && tot>0) {
-
- if(nu->bezt) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a-- && tot>0) {
- VECCOPY(bezt->vec[0], fp);
- fp+= 3;
- VECCOPY(bezt->vec[1], fp);
- fp+= 3;
- VECCOPY(bezt->vec[2], fp);
- fp+= 3;
- bezt->alfa= fp[0];
- fp+= 3; /* alphas */
-
- tot-= 3;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a-- && tot>0) {
- VECCOPY(bp->vec, fp);
- bp->alfa= fp[3];
-
- fp+= 4;
- tot--;
- bp++;
- }
- }
- nu= nu->next;
- }
-}
-
-
-void insert_curvekey(Curve *cu, short rel)
-{
- Key *key;
- KeyBlock *kb;
-
- if(cu->key==NULL) {
- cu->key= add_key( (ID *)cu);
-
- if (rel)
- cu->key->type = KEY_RELATIVE;
- else
- default_key_ipo(cu->key);
- }
- key= cu->key;
-
- kb= add_keyblock(key);
-
- if(editNurb.first) curve_to_key(cu, kb, &editNurb);
- else curve_to_key(cu, kb, &cu->nurb);
-}
-
-
-/* ******************** */
-
-void insert_shapekey(Object *ob)
-{
- if(get_mesh(ob) && get_mesh(ob)->mr) {
- error("Cannot create shape keys on a multires mesh.");
- }
- else {
- Key *key;
-
- if(ob->type==OB_MESH) insert_meshkey(ob->data, 1);
- else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(ob->data, 1);
- else if(ob->type==OB_LATTICE) insert_lattkey(ob->data, 1);
-
- key= ob_get_key(ob);
- ob->shapenr= BLI_countlist(&key->block);
-
- BIF_undo_push("Add Shapekey");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-}
-
-void delete_key(Object *ob)
-{
- KeyBlock *kb, *rkb;
- Key *key;
- IpoCurve *icu;
-
- key= ob_get_key(ob);
- if(key==NULL) return;
-
- kb= BLI_findlink(&key->block, ob->shapenr-1);
-
- if(kb) {
- for(rkb= key->block.first; rkb; rkb= rkb->next)
- if(rkb->relative == ob->shapenr-1)
- rkb->relative= 0;
-
- BLI_remlink(&key->block, kb);
- key->totkey--;
- if(key->refkey== kb) key->refkey= key->block.first;
-
- if(kb->data) MEM_freeN(kb->data);
- MEM_freeN(kb);
-
- for(kb= key->block.first; kb; kb= kb->next) {
- if(kb->adrcode>=ob->shapenr)
- kb->adrcode--;
- }
-
- if(key->ipo) {
-
- for(icu= key->ipo->curve.first; icu; icu= icu->next) {
- if(icu->adrcode==ob->shapenr-1) {
- BLI_remlink(&key->ipo->curve, icu);
- free_ipo_curve(icu);
- break;
- }
- }
- for(icu= key->ipo->curve.first; icu; icu= icu->next)
- if(icu->adrcode>=ob->shapenr)
- icu->adrcode--;
- }
-
- if(ob->shapenr>1) ob->shapenr--;
- }
-
- if(key->totkey==0) {
- if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL;
- else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL;
- else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL;
-
- free_libblock_us(&(G.main->key), key);
- scrarea_queue_headredraw(curarea); /* ipo remove too */
- }
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
-
- BIF_undo_push("Delete Shapekey");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-void move_keys(Object *ob)
-{
- Key *key;
- KeyBlock *kb;
- float div, dy, oldpos, vec[3], dvec[3];
- int afbreek=0, firsttime= 1;
- unsigned short event = 0;
- short mval[2], val, xo, yo;
- char str[32];
-
- if(G.sipo->blocktype!=ID_KE) return;
-
- if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
- if(G.sipo->editipo==NULL) return;
-
- key= ob_get_key(ob);
- if(key==NULL) return;
-
- /* which kb is involved */
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- if(kb==NULL) return;
-
- oldpos= kb->pos;
-
- getmouseco_areawin(mval);
- xo= mval[0];
- yo= mval[1];
- dvec[0]=dvec[1]=dvec[2]= 0.0;
-
- while(afbreek==0) {
- getmouseco_areawin(mval);
- if(mval[0]!=xo || mval[1]!=yo || firsttime) {
- firsttime= 0;
-
- dy= (float)(mval[1]- yo);
-
- div= (float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- dvec[1]+= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div;
-
- VECCOPY(vec, dvec);
-
- apply_keyb_grid(vec, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
- apply_keyb_grid(vec+1, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
-
- kb->pos= oldpos+vec[1];
-
- sprintf(str, "Y: %.3f ", vec[1]);
- headerprint(str);
-
- xo= mval[0];
- yo= mval[1];
-
- force_draw(0);
- }
- else BIF_wait_for_statechange();
-
- while(qtest()) {
- event= extern_qread(&val);
- if(val) {
- switch(event) {
- case ESCKEY:
- case LEFTMOUSE:
- case SPACEKEY:
- afbreek= 1;
- break;
- default:
- arrows_move_cursor(event);
- }
- }
- }
- }
-
- if(event==ESCKEY) {
- kb->pos= oldpos;
- }
-
- sort_keys(key);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- /* for boundbox */
- editipo_changed(G.sipo, 0);
-
- BIF_undo_push("Move Shapekey(s)");
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- scrarea_queue_redraw(curarea);
-}
diff --git a/source/blender/src/editlattice.c b/source/blender/src/editlattice.c
deleted file mode 100644
index 06b092a30ac..00000000000
--- a/source/blender/src/editlattice.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * i.t.t. wat de naam doet vermoeden: ook algemene lattice (calc) functies
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editlattice.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_editkey.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_edit.h"
-
-#include "BDR_editobject.h"
-#include "BDR_drawobject.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "BKE_armature.h"
-
-/* ***************************** */
-
-void free_editLatt(void)
-{
- if(editLatt) {
- if(editLatt->def) MEM_freeN(editLatt->def);
- if(editLatt->dvert)
- free_dverts(editLatt->dvert, editLatt->pntsu*editLatt->pntsv*editLatt->pntsw);
-
- MEM_freeN(editLatt);
- editLatt= NULL;
- }
-}
-
-
-static void setflagsLatt(int flag)
-{
- BPoint *bp;
- int a;
-
- bp= editLatt->def;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- while(a--) {
- if(bp->hide==0) {
- bp->f1= flag;
- }
- bp++;
- }
-}
-
-
-
-void make_editLatt(void)
-{
- Lattice *lt;
- KeyBlock *actkey;
-
- free_editLatt();
-
- lt= G.obedit->data;
-
- actkey = ob_get_keyblock(G.obedit);
- if(actkey) {
- strcpy(G.editModeTitleExtra, "(Key) ");
- key_to_latt(actkey, lt);
- }
-
- editLatt= MEM_dupallocN(lt);
- editLatt->def= MEM_dupallocN(lt->def);
-
- if(lt->dvert) {
- int tot= lt->pntsu*lt->pntsv*lt->pntsw;
- editLatt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert");
- copy_dverts(editLatt->dvert, lt->dvert, tot);
- }
-
- BIF_undo_push("Original");
-}
-
-
-void load_editLatt(void)
-{
- Lattice *lt;
- KeyBlock *actkey;
- BPoint *bp;
- float *fp;
- int tot;
-
- lt= G.obedit->data;
-
- actkey = ob_get_keyblock(G.obedit);
- if(actkey) {
- /* active key: vertices */
- tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- if(actkey->data) MEM_freeN(actkey->data);
-
- fp=actkey->data= MEM_callocN(lt->key->elemsize*tot, "actkey->data");
- actkey->totelem= tot;
-
- bp= editLatt->def;
- while(tot--) {
- VECCOPY(fp, bp->vec);
- fp+= 3;
- bp++;
- }
- }
- else {
-
- MEM_freeN(lt->def);
-
- lt->def= MEM_dupallocN(editLatt->def);
-
- lt->flag= editLatt->flag;
-
- lt->pntsu= editLatt->pntsu;
- lt->pntsv= editLatt->pntsv;
- lt->pntsw= editLatt->pntsw;
-
- lt->typeu= editLatt->typeu;
- lt->typev= editLatt->typev;
- lt->typew= editLatt->typew;
- }
-
- if(lt->dvert) {
- free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
- lt->dvert= NULL;
- }
-
- if(editLatt->dvert) {
- int tot= lt->pntsu*lt->pntsv*lt->pntsw;
-
- lt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert");
- copy_dverts(lt->dvert, editLatt->dvert, tot);
- }
-
-}
-
-void remake_editLatt(void)
-{
- if(okee("Reload original data")==0) return;
-
- make_editLatt();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Reload original");
-}
-
-
-void deselectall_Latt(void)
-{
- BPoint *bp;
- int a;
-
- bp= editLatt->def;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- allqueue(REDRAWVIEW3D, 0);
-
- while(a--) {
- if(bp->hide==0) {
- if(bp->f1) {
- setflagsLatt(0);
- countall();
- BIF_undo_push("(De)select all");
- return;
- }
- }
- bp++;
- }
- setflagsLatt(1);
- countall();
- BIF_undo_push("(De)select all");
-}
-
-static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, int y)
-{
- struct { BPoint *bp; short dist, select, mval[2]; } *data = userData;
- float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
-
- if ((bp->f1 & SELECT)==data->select) temp += 5;
- if (temp<data->dist) {
- data->dist = temp;
-
- data->bp = bp;
- }
-}
-static BPoint *findnearestLattvert(int sel)
-{
- /* sel==1: selected gets a disadvantage */
- /* in nurb and bezt or bp the nearest is written */
- /* return 0 1 2: handlepunt */
- struct { BPoint *bp; short dist, select, mval[2]; } data = {0};
-
- data.dist = 100;
- data.select = sel;
- getmouseco_areawin(data.mval);
-
- lattice_foreachScreenVert(findnearestLattvert__doClosest, &data);
-
- return data.bp;
-}
-
-
-void mouse_lattice(void)
-{
- BPoint *bp=0;
-
- bp= findnearestLattvert(1);
-
- if(bp) {
- if((G.qual & LR_SHIFTKEY)==0) {
-
- setflagsLatt(0);
- bp->f1 |= SELECT;
-
- allqueue(REDRAWVIEW3D, 0);
- }
- else {
- bp->f1 ^= SELECT; /* swap */
- allqueue(REDRAWVIEW3D, 0);
- }
-
- countall();
- BIF_undo_push("Select");
- }
-
- rightmouse_transform();
-
-}
-
-
-/* **************** undo for lattice object ************** */
-
-typedef struct UndoLattice {
- BPoint *def;
- int pntsu, pntsv, pntsw;
-} UndoLattice;
-
-static void undoLatt_to_editLatt(void *data)
-{
- UndoLattice *ult= (UndoLattice*)data;
- int a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
-
- memcpy(editLatt->def, ult->def, a*sizeof(BPoint));
-}
-
-static void *editLatt_to_undoLatt(void)
-{
- UndoLattice *ult= MEM_callocN(sizeof(UndoLattice), "UndoLattice");
- ult->def= MEM_dupallocN(editLatt->def);
- ult->pntsu= editLatt->pntsu;
- ult->pntsv= editLatt->pntsv;
- ult->pntsw= editLatt->pntsw;
-
- return ult;
-}
-
-static void free_undoLatt(void *data)
-{
- UndoLattice *ult= (UndoLattice*)data;
-
- if(ult->def) MEM_freeN(ult->def);
- MEM_freeN(ult);
-}
-
-static int validate_undoLatt(void *data)
-{
- UndoLattice *ult= (UndoLattice*)data;
-
- return (ult->pntsu == editLatt->pntsu &&
- ult->pntsv == editLatt->pntsv &&
- ult->pntsw == editLatt->pntsw);
-}
-
-/* and this is all the undo system needs to know */
-void undo_push_lattice(char *name)
-{
- undo_editmode_push(name, free_undoLatt, undoLatt_to_editLatt, editLatt_to_undoLatt, validate_undoLatt);
-}
-
-
-
-/***/
diff --git a/source/blender/src/editmball.c b/source/blender/src/editmball.c
deleted file mode 100644
index 58c44fb2408..00000000000
--- a/source/blender/src/editmball.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_rand.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_transform.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editmball.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-extern short editbutflag;
-
-ListBase editelems= {0, 0};
-MetaElem *lastelem;
-
-/* this function is called, when MetaBall Object is
- * switched from object mode to edit mode */
-void make_editMball()
-{
- MetaBall *mb;
- MetaElem *ml, *newmb;
-
- BLI_freelistN(&editelems);
- lastelem= 0;
-
- mb= G.obedit->data;
- ml= mb->elems.first;
-
- while(ml) {
- newmb= MEM_dupallocN(ml);
- BLI_addtail(&editelems, newmb);
- if(ml->flag & SELECT) lastelem= newmb;
-
- ml= ml->next;
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
-
- countall();
-}
-
-/* this function is called, when MetaBall Object switched from
- * edit mode to object mode. List od MetaElements is copied
- * from editelems to to object->data structure (mb->elems) */
-void load_editMball()
-{
- /* load mball in object */
- MetaBall *mb;
- MetaElem *ml, *newml;
-
- if(G.obedit==NULL) return;
-
- mb= G.obedit->data;
- BLI_freelistN(&(mb->elems));
-
-
- ml= editelems.first;
- while(ml) {
- newml= MEM_dupallocN(ml);
- BLI_addtail(&(mb->elems), newml);
-
- ml= ml->next;
- }
-}
-
-/* add new MetaElement primitive */
-void add_primitiveMball(int dummy_argument)
-{
- MetaElem *ml;
- float *curs, mat[3][3], cent[3], imat[3][3], cmat[3][3];
- short newob= 0;
-
- if(G.scene->id.lib) return;
-
- /* this function also comes from an info window */
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
-
- check_editmode(OB_MBALL);
-
- /* if no obedit: new object and enter editmode */
- if(G.obedit==NULL) {
- add_object_draw(OB_MBALL);
- base_init_from_view3d(BASACT, G.vd);
- G.obedit= BASACT->object;
-
- where_is_object(G.obedit); // need now, for imat
-
- make_editMball();
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- newob= 1;
- }
-
- /* deselect */
- ml= editelems.first;
- while(ml) {
- ml->flag &= ~SELECT;
- ml= ml->next;
- }
-
- /* imat and center and size */
- Mat3CpyMat4(mat, G.obedit->obmat);
-
- curs= give_cursor();
- VECCOPY(cent, curs);
- cent[0]-= G.obedit->obmat[3][0];
- cent[1]-= G.obedit->obmat[3][1];
- cent[2]-= G.obedit->obmat[3][2];
-
- if (G.vd) {
- Mat3CpyMat4(imat, G.vd->viewmat);
- Mat3MulVecfl(imat, cent);
- Mat3MulMat3(cmat, imat, mat);
- Mat3Inv(imat,cmat);
-
- Mat3MulVecfl(imat, cent);
- }
-
- ml= MEM_callocN(sizeof(MetaElem), "metaelem");
- BLI_addtail(&editelems, ml);
-
- ml->x= cent[0];
- ml->y= cent[1];
- ml->z= cent[2];
- ml->quat[0]= 1.0;
- ml->quat[1]= 0.0;
- ml->quat[2]= 0.0;
- ml->quat[3]= 0.0;
- ml->rad= 2.0;
- ml->s= 2.0;
- ml->flag= SELECT | MB_SCALE_RAD;
-
- switch(dummy_argument) {
- case 1:
- ml->type = MB_BALL;
- ml->expx= ml->expy= ml->expz= 1.0;
- break;
- case 2:
- ml->type = MB_TUBE;
- ml->expx= ml->expy= ml->expz= 1.0;
- break;
- case 3:
- ml->type = MB_PLANE;
- ml->expx= ml->expy= ml->expz= 1.0;
- break;
- case 4:
- ml->type = MB_ELIPSOID;
- ml->expx= 1.2f;
- ml->expy= 0.8f;
- ml->expz= 1.0;
- break;
- case 5:
- ml->type = MB_CUBE;
- ml->expx= ml->expy= ml->expz= 1.0;
- break;
- default:
- break;
- }
-
- lastelem= ml;
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); // added ball can influence others
-
- countall();
-
- /* if a new object was created, it stores it in Mball, for reload original data and undo */
- if ( !(newob) || (U.flag & USER_ADD_EDITMODE)) {
- if(newob) load_editMball();
- } else {
- exit_editmode(2);
- }
-
- allqueue(REDRAWALL, 0);
- BIF_undo_push("Add MetaElem");
-}
-
-/* deselect all MetaElements */
-void deselectall_mball()
-{
- MetaElem *ml;
- int sel= 0;
-
- ml= editelems.first;
- while(ml) {
- if(ml->flag & SELECT) break;
- ml= ml->next;
- }
-
- if(ml) sel= 1;
-
- ml= editelems.first;
- while(ml) {
- if(sel) ml->flag &= ~SELECT;
- else ml->flag |= SELECT;
- ml= ml->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- countall();
- BIF_undo_push("Deselect MetaElem");
-}
-
-/* inverts metaball selection */
-void selectinverse_mball()
-{
- MetaElem *ml;
-
- ml= editelems.first;
- while(ml) {
- if(ml->flag & SELECT) ml->flag &= ~SELECT;
- else ml->flag |= SELECT;
- ml= ml->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- countall();
- BIF_undo_push("Invert MetaElem");
-}
-
-/* select random metaball selection */
-void selectrandom_mball()
-{
- MetaElem *ml;
- static short randfac= 50;
-
- if(!button(&randfac,0, 100,"Percentage:")) return;
-
- ml= editelems.first;
- BLI_srand( BLI_rand() ); /* random seed */
- while(ml) {
- if((BLI_frand() * 100) < randfac) ml->flag |= SELECT;
- ml= ml->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- countall();
- BIF_undo_push("Random MetaElem");
-}
-
-/* select MetaElement with mouse click (user can select radius circle or
- * stiffness circle) */
-void mouse_mball()
-{
- static MetaElem *startelem=0;
- MetaElem *ml, *act=0;
- int a, hits;
- unsigned int buffer[MAXPICKBUF];
-
- hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0);
-
- /* does startelem exist? */
- ml= editelems.first;
- while(ml) {
- if(ml==startelem) break;
- ml= ml->next;
- }
- if(ml==NULL) startelem= editelems.first;
-
- if(hits>0) {
- ml= startelem;
- while(ml) {
-
- for(a=0; a<hits; a++) {
- /* index converted for gl stuff */
- if(ml->selcol1==buffer[ 4 * a + 3 ]){
- ml->flag |= MB_SCALE_RAD;
- act= ml;
- }
- if(ml->selcol2==buffer[ 4 * a + 3 ]){
- ml->flag &= ~MB_SCALE_RAD;
- act= ml;
- }
-
- }
-
- if(act) break;
-
- ml= ml->next;
- if(ml==NULL) ml= editelems.first;
- if(ml==startelem) break;
- }
- if(act) {
- if((G.qual & LR_SHIFTKEY)==0) {
- deselectall_mball();
- if(act->flag & SELECT) deselectall_mball();
- act->flag |= SELECT;
- }
- else {
- if(act->flag & SELECT) {
- act->flag &= ~SELECT;
- }
- else act->flag |= SELECT;
- }
- lastelem= act;
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
-
- allqueue(REDRAWBUTSOBJECT, 0);
- countall();
- rightmouse_transform();
-}
-
-/* duplicate selected MetaElements */
-void adduplicate_mball()
-{
- MetaElem *ml, *newml;
-
- ml= editelems.last;
- while(ml) {
- if(ml->flag & SELECT) {
- newml= MEM_dupallocN(ml);
- BLI_addtail(&editelems, newml);
- lastelem= newml;
- ml->flag &= ~SELECT;
- }
- ml= ml->prev;
- }
-
- BIF_TransformSetUndo("Add Duplicate");
- countall();
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-/* Delete all selected MetaElems (not MetaBall) */
-void delete_mball()
-{
- MetaElem *ml, *next;
-
- if(okee("Erase selected")==0) return;
-
- ml= editelems.first;
- while(ml) {
- next= ml->next;
- if(ml->flag & SELECT) {
- if(lastelem==ml) lastelem= 0;
- BLI_remlink(&editelems, ml);
- MEM_freeN(ml);
- }
- ml= next;
- }
-
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- countall();
- BIF_undo_push("Delete MetaElem");
-}
-
-/* free all MetaElems from ListBase */
-void freeMetaElemlist(ListBase *lb)
-{
- MetaElem *ml, *next;
-
- if(lb==NULL) return;
-
- ml= lb->first;
- while(ml){
- next= ml->next;
- BLI_remlink(lb, ml);
- MEM_freeN(ml);
- ml= next;
- }
-
- lb->first= lb->last= NULL;
-
-}
-
-/* ************* undo for MetaBalls ************* */
-
-static void undoMball_to_editMball(void *lbv)
-{
- ListBase *lb= lbv;
- MetaElem *ml, *newml;
- unsigned int nr, lastmlnr= 0;
-
- /* we try to restore lastelem, which used in for example in button window */
- for(ml= editelems.first; ml; ml= ml->next, lastmlnr++)
- if(lastelem==ml) break;
-
- freeMetaElemlist(&editelems);
-
- /* copy 'undo' MetaElems to 'edit' MetaElems */
- ml= lb->first;
- while(ml){
- newml= MEM_dupallocN(ml);
- BLI_addtail(&editelems, newml);
- ml= ml->next;
- }
-
- for(nr=0, lastelem= editelems.first; lastelem; lastelem= lastelem->next, nr++)
- if(nr==lastmlnr) break;
-
- countall();
-}
-
-static void *editMball_to_undoMball(void)
-{
- ListBase *lb;
- MetaElem *ml, *newml;
-
- /* allocate memory for undo ListBase */
- lb= MEM_callocN(sizeof(ListBase), "listbase undo");
- lb->first= lb->last= NULL;
-
- /* copy contents of current ListBase to the undo ListBase */
- ml= editelems.first;
- while(ml){
- newml= MEM_dupallocN(ml);
- BLI_addtail(lb, newml);
- ml= ml->next;
- }
-
- return lb;
-}
-
-/* free undo ListBase of MetaElems */
-static void free_undoMball(void *lbv)
-{
- ListBase *lb= lbv;
-
- freeMetaElemlist(lb);
- MEM_freeN(lb);
-}
-
-/* this is undo system for MetaBalls */
-void undo_push_mball(char *name)
-{
- undo_editmode_push(name, free_undoMball, undoMball_to_editMball, editMball_to_undoMball, NULL);
-}
-
-/* Hide selected/unselected MetaElems */
-void hide_mball(char hide)
-{
- MetaElem *ml;
-
- ml= editelems.first;
-
- while(ml){
- if(hide){
- if(!(ml->flag & SELECT))
- ml->flag |= MB_HIDE;
- }
- else{
- if(ml->flag & SELECT)
- ml->flag |= MB_HIDE;
- }
- ml= ml->next;
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- countall();
- BIF_undo_push("Hide MetaElems");
-}
-
-/* Unhide all edited MetaElems */
-void reveal_mball(void)
-{
- MetaElem *ml;
-
- ml= editelems.first;
-
- while(ml){
- ml->flag &= ~MB_HIDE;
- ml= ml->next;
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- countall();
- BIF_undo_push("Unhide MetaElems");
-}
-
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
deleted file mode 100644
index a573ea85ca8..00000000000
--- a/source/blender/src/editmesh.c
+++ /dev/null
@@ -1,2374 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "DNA_customdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_screen_types.h"
-#include "DNA_key_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_dynstr.h"
-#include "BLI_rand.h"
-
-#include "BKE_DerivedMesh.h"
-#include "BKE_depsgraph.h"
-#include "BKE_cloth.h"
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_multires.h"
-#include "BKE_object.h"
-#include "BKE_pointcache.h"
-#include "BKE_softbody.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_editkey.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_retopo.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-
-#include "LBM_fluidsim.h"
-
-#include "multires.h"
-#include "mydevice.h"
-#include "blendef.h"
-
-/* own include */
-#include "editmesh.h"
-
-/*
-
-editmesh.c:
-- add/alloc/free data
-- hashtables
-- enter/exit editmode
-
-*/
-
-
-/* ***************** HASH ********************* */
-
-
-#define EDHASHSIZE (512*512)
-#define EDHASH(a, b) (a % EDHASHSIZE)
-
-
-/* ************ ADD / REMOVE / FIND ****************** */
-
-/* used to bypass normal calloc with fast one */
-static void *(*callocvert)(size_t, size_t) = calloc;
-static void *(*callocedge)(size_t, size_t) = calloc;
-static void *(*callocface)(size_t, size_t) = calloc;
-
-EditVert *addvertlist(float *vec, EditVert *example)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- static int hashnr= 0;
-
- eve= callocvert(sizeof(EditVert), 1);
- BLI_addtail(&em->verts, eve);
-
- if(vec) VECCOPY(eve->co, vec);
-
- eve->hash= hashnr++;
- if( hashnr>=EDHASHSIZE) hashnr= 0;
-
- /* new verts get keyindex of -1 since they did not
- * have a pre-editmode vertex order
- */
- eve->keyindex = -1;
-#ifdef WITH_VERSE
- createVerseVert(eve);
-#endif
-
- if(example) {
- CustomData_em_copy_data(&em->vdata, &em->vdata, example->data, &eve->data);
- eve->bweight = example->bweight;
- }
- else {
- CustomData_em_set_default(&em->vdata, &eve->data);
- }
-
- return eve;
-}
-
-void free_editvert (EditVert *eve)
-{
-#ifdef WITH_VERSE
- if(eve->vvert) {
- /* it prevents from removing all verse vertexes
- * during entering edit mode ... messy solution */
- if(G.editMesh->vnode)
- b_verse_send_vertex_delete(eve);
- else
- ((VerseVert*)eve->vvert)->vertex = NULL;
- }
-#endif
-
- EM_remove_selection(eve, EDITVERT);
- CustomData_em_free_block(&G.editMesh->vdata, &eve->data);
- if(eve->fast==0)
- free(eve);
-}
-
-
-EditEdge *findedgelist(EditVert *v1, EditVert *v2)
-{
- EditVert *v3;
- struct HashEdge *he;
-
- /* swap ? */
- if( v1 > v2) {
- v3= v2;
- v2= v1;
- v1= v3;
- }
-
- if(G.editMesh->hashedgetab==NULL)
- G.editMesh->hashedgetab= MEM_callocN(EDHASHSIZE*sizeof(struct HashEdge), "hashedgetab");
-
- he= G.editMesh->hashedgetab + EDHASH(v1->hash, v2->hash);
-
- while(he) {
-
- if(he->eed && he->eed->v1==v1 && he->eed->v2==v2) return he->eed;
-
- he= he->next;
- }
- return 0;
-}
-
-static void insert_hashedge(EditEdge *eed)
-{
- /* assuming that eed is not in the list yet, and that a find has been done before */
-
- struct HashEdge *first, *he;
-
- first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash);
-
- if( first->eed==0 ) {
- first->eed= eed;
- }
- else {
- he= &eed->hash;
- he->eed= eed;
- he->next= first->next;
- first->next= he;
- }
-}
-
-static void remove_hashedge(EditEdge *eed)
-{
- /* assuming eed is in the list */
-
- struct HashEdge *first, *he, *prev=NULL;
-
- he=first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash);
-
- while(he) {
- if(he->eed == eed) {
- /* remove from list */
- if(he==first) {
- if(first->next) {
- he= first->next;
- first->eed= he->eed;
- first->next= he->next;
- }
- else he->eed= 0;
- }
- else {
- prev->next= he->next;
- }
- return;
- }
- prev= he;
- he= he->next;
- }
-}
-
-EditEdge *addedgelist(EditVert *v1, EditVert *v2, EditEdge *example)
-{
- EditMesh *em = G.editMesh;
- EditVert *v3;
- EditEdge *eed;
- int swap= 0;
-
- if(v1==v2) return NULL;
- if(v1==NULL || v2==NULL) return NULL;
-
- /* swap ? */
- if(v1>v2) {
- v3= v2;
- v2= v1;
- v1= v3;
- swap= 1;
- }
-
- /* find in hashlist */
- eed= findedgelist(v1, v2);
-
- if(eed==NULL) {
-
- eed= (EditEdge *)callocedge(sizeof(EditEdge), 1);
- eed->v1= v1;
- eed->v2= v2;
- BLI_addtail(&em->edges, eed);
- eed->dir= swap;
- insert_hashedge(eed);
-
- /* copy edge data:
- rule is to do this with addedgelist call, before addfacelist */
- if(example) {
- eed->crease= example->crease;
- eed->bweight= example->bweight;
- eed->sharp = example->sharp;
- eed->seam = example->seam;
- eed->h |= (example->h & EM_FGON);
- }
- }
-
- return eed;
-}
-
-void remedge(EditEdge *eed)
-{
- EditMesh *em = G.editMesh;
-
- BLI_remlink(&em->edges, eed);
- remove_hashedge(eed);
-}
-
-void free_editedge(EditEdge *eed)
-{
- EM_remove_selection(eed, EDITEDGE);
- if(eed->fast==0){
- free(eed);
- }
-}
-
-void free_editface(EditFace *efa)
-{
-#ifdef WITH_VERSE
- if(efa->vface) {
- /* it prevents from removing all verse faces
- * during entering edit mode ... messy solution */
- if(G.editMesh->vnode)
- b_verse_send_face_delete(efa);
- else
- ((VerseFace*)efa->vface)->face = NULL;
- }
-#endif
- EM_remove_selection(efa, EDITFACE);
-
- if (G.editMesh->act_face==efa) {
- EM_set_actFace( G.editMesh->faces.first == efa ? NULL : G.editMesh->faces.first);
- }
-
- CustomData_em_free_block(&G.editMesh->fdata, &efa->data);
- if(efa->fast==0)
- free(efa);
-}
-
-void free_vertlist(ListBase *edve)
-{
- EditVert *eve, *next;
-
- if (!edve) return;
-
- eve= edve->first;
- while(eve) {
- next= eve->next;
- free_editvert(eve);
- eve= next;
- }
- edve->first= edve->last= NULL;
-}
-
-void free_edgelist(ListBase *lb)
-{
- EditEdge *eed, *next;
-
- eed= lb->first;
- while(eed) {
- next= eed->next;
- free_editedge(eed);
- eed= next;
- }
- lb->first= lb->last= NULL;
-}
-
-void free_facelist(ListBase *lb)
-{
- EditFace *efa, *next;
-
- efa= lb->first;
- while(efa) {
- next= efa->next;
- free_editface(efa);
- efa= next;
- }
- lb->first= lb->last= NULL;
-}
-
-EditFace *addfacelist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, EditFace *example, EditFace *exampleEdges)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditEdge *e1, *e2=0, *e3=0, *e4=0;
-
- /* added sanity check... seems to happen for some tools, or for enter editmode for corrupted meshes */
- if(v1==v4 || v2==v4 || v3==v4) v4= NULL;
-
- /* add face to list and do the edges */
- if(exampleEdges) {
- e1= addedgelist(v1, v2, exampleEdges->e1);
- e2= addedgelist(v2, v3, exampleEdges->e2);
- if(v4) e3= addedgelist(v3, v4, exampleEdges->e3);
- else e3= addedgelist(v3, v1, exampleEdges->e3);
- if(v4) e4= addedgelist(v4, v1, exampleEdges->e4);
- }
- else {
- e1= addedgelist(v1, v2, NULL);
- e2= addedgelist(v2, v3, NULL);
- if(v4) e3= addedgelist(v3, v4, NULL);
- else e3= addedgelist(v3, v1, NULL);
- if(v4) e4= addedgelist(v4, v1, NULL);
- }
-
- if(v1==v2 || v2==v3 || v1==v3) return NULL;
- if(e2==0) return NULL;
-
- efa= (EditFace *)callocface(sizeof(EditFace), 1);
- efa->v1= v1;
- efa->v2= v2;
- efa->v3= v3;
- efa->v4= v4;
-
- efa->e1= e1;
- efa->e2= e2;
- efa->e3= e3;
- efa->e4= e4;
-
- if(example) {
- efa->mat_nr= example->mat_nr;
- efa->flag= example->flag;
- CustomData_em_copy_data(&em->fdata, &em->fdata, example->data, &efa->data);
- }
- else {
- if (G.obedit && G.obedit->actcol)
- efa->mat_nr= G.obedit->actcol-1;
-
- CustomData_em_set_default(&em->fdata, &efa->data);
- }
-
- BLI_addtail(&em->faces, efa);
-
- if(efa->v4) {
- CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
- CalcCent4f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
- }
- else {
- CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
- CalcCent3f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co);
- }
-
-#ifdef WITH_VERSE
- createVerseFace(efa);
-#endif
-
- return efa;
-}
-
-/* ************************ end add/new/find ************ */
-
-/* ************************ Edit{Vert,Edge,Face} utilss ***************************** */
-
-/* some nice utility functions */
-
-EditVert *editedge_getOtherVert(EditEdge *eed, EditVert *eve)
-{
- if (eve==eed->v1) {
- return eed->v2;
- } else if (eve==eed->v2) {
- return eed->v1;
- } else {
- return NULL;
- }
-}
-
-EditVert *editedge_getSharedVert(EditEdge *eed, EditEdge *eed2)
-{
- if (eed->v1==eed2->v1 || eed->v1==eed2->v2) {
- return eed->v1;
- } else if (eed->v2==eed2->v1 || eed->v2==eed2->v2) {
- return eed->v2;
- } else {
- return NULL;
- }
-}
-
-int editedge_containsVert(EditEdge *eed, EditVert *eve)
-{
- return (eed->v1==eve || eed->v2==eve);
-}
-
-int editface_containsVert(EditFace *efa, EditVert *eve)
-{
- return (efa->v1==eve || efa->v2==eve || efa->v3==eve || (efa->v4 && efa->v4==eve));
-}
-
-int editface_containsEdge(EditFace *efa, EditEdge *eed)
-{
- return (efa->e1==eed || efa->e2==eed || efa->e3==eed || (efa->e4 && efa->e4==eed));
-}
-
-
-/* ************************ stuct EditMesh manipulation ***************************** */
-
-/* fake callocs for fastmalloc below */
-static void *calloc_fastvert(size_t size, size_t nr)
-{
- EditVert *eve= G.editMesh->curvert++;
- eve->fast= 1;
- return eve;
-}
-static void *calloc_fastedge(size_t size, size_t nr)
-{
- EditEdge *eed= G.editMesh->curedge++;
- eed->fast= 1;
- return eed;
-}
-static void *calloc_fastface(size_t size, size_t nr)
-{
- EditFace *efa= G.editMesh->curface++;
- efa->fast= 1;
- return efa;
-}
-
-/* allocate 1 chunk for all vertices, edges, faces. These get tagged to
- prevent it from being freed
-*/
-static void init_editmesh_fastmalloc(EditMesh *em, int totvert, int totedge, int totface)
-{
- if(totvert) em->allverts= MEM_callocN(totvert*sizeof(EditVert), "allverts");
- else em->allverts= NULL;
- em->curvert= em->allverts;
-
- if(totedge==0) totedge= 4*totface; // max possible
-
- if(totedge) em->alledges= MEM_callocN(totedge*sizeof(EditEdge), "alledges");
- else em->alledges= NULL;
- em->curedge= em->alledges;
-
- if(totface) em->allfaces= MEM_callocN(totface*sizeof(EditFace), "allfaces");
- else em->allfaces= NULL;
- em->curface= em->allfaces;
-
- callocvert= calloc_fastvert;
- callocedge= calloc_fastedge;
- callocface= calloc_fastface;
-}
-
-static void end_editmesh_fastmalloc(void)
-{
- callocvert= calloc;
- callocedge= calloc;
- callocface= calloc;
-}
-
-void free_editMesh(EditMesh *em)
-{
-#ifdef WITH_VERSE
- struct VNode *vnode=NULL;
-#endif
- if(em==NULL) return;
-
-#ifdef WITH_VERSE
- if(em->vnode) {
- vnode = (VNode*)em->vnode;
- em->vnode = NULL;
- }
-#endif
-
- if(em->verts.first) free_vertlist(&em->verts);
- if(em->edges.first) free_edgelist(&em->edges);
- if(em->faces.first) free_facelist(&em->faces);
- if(em->selected.first) BLI_freelistN(&(em->selected));
-
- CustomData_free(&em->vdata, 0);
- CustomData_free(&em->fdata, 0);
-
- if(em->derivedFinal) {
- if (em->derivedFinal!=em->derivedCage) {
- em->derivedFinal->needsFree= 1;
- em->derivedFinal->release(em->derivedFinal);
- }
- em->derivedFinal= NULL;
- }
- if(em->derivedCage) {
- em->derivedCage->needsFree= 1;
- em->derivedCage->release(em->derivedCage);
- em->derivedCage= NULL;
- }
-
-#ifdef WITH_VERSE
- if(vnode) {
- em->vnode = (void*)vnode;
- }
-#endif
-
- /* DEBUG: hashtabs are slowest part of enter/exit editmode. here a testprint */
-#if 0
- if(em->hashedgetab) {
- HashEdge *he, *hen;
- int a, used=0, max=0, nr;
- he= em->hashedgetab;
- for(a=0; a<EDHASHSIZE; a++, he++) {
- if(he->eed) used++;
- hen= he->next;
- nr= 0;
- while(hen) {
- nr++;
- hen= hen->next;
- }
- if(max<nr) max= nr;
- }
- printf("hastab used %d max %d\n", used, max);
- }
-#endif
- if(em->hashedgetab) MEM_freeN(em->hashedgetab);
- em->hashedgetab= NULL;
-
- if(em->allverts) MEM_freeN(em->allverts);
- if(em->alledges) MEM_freeN(em->alledges);
- if(em->allfaces) MEM_freeN(em->allfaces);
-
- em->allverts= em->curvert= NULL;
- em->alledges= em->curedge= NULL;
- em->allfaces= em->curface= NULL;
-
- mesh_octree_table(NULL, NULL, 'e');
-
- G.totvert= G.totface= 0;
-
- if(em->retopo_paint_data) retopo_free_paint_data(em->retopo_paint_data);
- em->retopo_paint_data= NULL;
- em->act_face = NULL;
-}
-
-/* on G.editMesh */
-static void editMesh_set_hash(void)
-{
- EditEdge *eed;
-
- G.editMesh->hashedgetab= NULL;
-
- for(eed=G.editMesh->edges.first; eed; eed= eed->next) {
- if( findedgelist(eed->v1, eed->v2)==NULL )
- insert_hashedge(eed);
- }
-
-}
-
-
-/* ************************ IN & OUT EDITMODE ***************************** */
-
-
-static void edge_normal_compare(EditEdge *eed, EditFace *efa1)
-{
- EditFace *efa2;
- float cent1[3], cent2[3];
- float inp;
-
- efa2 = eed->tmp.f;
- if(efa1==efa2) return;
-
- inp= efa1->n[0]*efa2->n[0] + efa1->n[1]*efa2->n[1] + efa1->n[2]*efa2->n[2];
- if(inp<0.999 && inp >-0.999) eed->f2= 1;
-
- if(efa1->v4) CalcCent4f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co, efa1->v4->co);
- else CalcCent3f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co);
- if(efa2->v4) CalcCent4f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co, efa2->v4->co);
- else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co);
-
- VecSubf(cent1, cent2, cent1);
- Normalize(cent1);
- inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2];
-
- if(inp < -0.001 ) eed->f1= 1;
-}
-
-#if 0
-typedef struct {
- EditEdge *eed;
- float noLen,no[3];
- int adjCount;
-} EdgeDrawFlagInfo;
-
-static int edgeDrawFlagInfo_cmp(const void *av, const void *bv)
-{
- const EdgeDrawFlagInfo *a = av;
- const EdgeDrawFlagInfo *b = bv;
-
- if (a->noLen<b->noLen) return -1;
- else if (a->noLen>b->noLen) return 1;
- else return 0;
-}
-#endif
-
-static void edge_drawflags(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed, *e1, *e2, *e3, *e4;
- EditFace *efa;
-
- /* - count number of times edges are used in faces: 0 en 1 time means draw edge
- * - edges more than 1 time used: in *tmp.f is pointer to first face
- * - check all faces, when normal differs to much: draw (flag becomes 1)
- */
-
- /* later on: added flags for 'cylinder' and 'sphere' intersection tests in old
- game engine (2.04)
- */
-
- recalc_editnormals();
-
- /* init */
- eve= em->verts.first;
- while(eve) {
- eve->f1= 1; /* during test it's set at zero */
- eve= eve->next;
- }
- eed= em->edges.first;
- while(eed) {
- eed->f2= eed->f1= 0;
- eed->tmp.f = 0;
- eed= eed->next;
- }
-
- efa= em->faces.first;
- while(efa) {
- e1= efa->e1;
- e2= efa->e2;
- e3= efa->e3;
- e4= efa->e4;
- if(e1->f2<4) e1->f2+= 1;
- if(e2->f2<4) e2->f2+= 1;
- if(e3->f2<4) e3->f2+= 1;
- if(e4 && e4->f2<4) e4->f2+= 1;
-
- if(e1->tmp.f == 0) e1->tmp.f = (void *) efa;
- if(e2->tmp.f == 0) e2->tmp.f = (void *) efa;
- if(e3->tmp.f ==0) e3->tmp.f = (void *) efa;
- if(e4 && (e4->tmp.f == 0)) e4->tmp.f = (void *) efa;
-
- efa= efa->next;
- }
-
- if(G.f & G_ALLEDGES) {
- efa= em->faces.first;
- while(efa) {
- if(efa->e1->f2>=2) efa->e1->f2= 1;
- if(efa->e2->f2>=2) efa->e2->f2= 1;
- if(efa->e3->f2>=2) efa->e3->f2= 1;
- if(efa->e4 && efa->e4->f2>=2) efa->e4->f2= 1;
-
- efa= efa->next;
- }
- }
- else {
-
- /* handle single-edges for 'test cylinder flag' (old engine) */
-
- eed= em->edges.first;
- while(eed) {
- if(eed->f2==1) eed->f1= 1;
- eed= eed->next;
- }
-
- /* all faces, all edges with flag==2: compare normal */
- efa= em->faces.first;
- while(efa) {
- if(efa->e1->f2==2) edge_normal_compare(efa->e1, efa);
- else efa->e1->f2= 1;
- if(efa->e2->f2==2) edge_normal_compare(efa->e2, efa);
- else efa->e2->f2= 1;
- if(efa->e3->f2==2) edge_normal_compare(efa->e3, efa);
- else efa->e3->f2= 1;
- if(efa->e4) {
- if(efa->e4->f2==2) edge_normal_compare(efa->e4, efa);
- else efa->e4->f2= 1;
- }
- efa= efa->next;
- }
-
- /* sphere collision flag */
-
- eed= em->edges.first;
- while(eed) {
- if(eed->f1!=1) {
- eed->v1->f1= eed->v2->f1= 0;
- }
- eed= eed->next;
- }
-
- }
-}
-
-static int editmesh_pointcache_edit(Object *ob, int totvert, PTCacheID *pid_p, float mat[][4], int load)
-{
- Cloth *cloth;
- SoftBody *sb;
- ClothModifierData *clmd;
- PTCacheID pid, tmpid;
- int cfra= (int)G.scene->r.cfra, found= 0;
-
- pid.cache= NULL;
-
- /* check for cloth */
- if(modifiers_isClothEnabled(ob)) {
- clmd= (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
- cloth= clmd->clothObject;
-
- BKE_ptcache_id_from_cloth(&tmpid, ob, clmd);
-
- /* verify vertex count and baked status */
- if(cloth && (totvert == cloth->numverts)) {
- if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) {
- pid= tmpid;
-
- if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE))
- found= 1;
- }
- }
- }
-
- /* check for softbody */
- if(!found && ob->soft) {
- sb= ob->soft;
-
- BKE_ptcache_id_from_softbody(&tmpid, ob, sb);
-
- /* verify vertex count and baked status */
- if(sb->bpoint && (totvert == sb->totpoint)) {
- if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) {
- pid= tmpid;
-
- if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE))
- found= 1;
- }
- }
- }
-
- /* if not making editmesh verify editing was active for this point cache */
- if(load) {
- if(found)
- pid.cache->flag &= ~PTCACHE_BAKE_EDIT_ACTIVE;
- else
- return 0;
- }
-
- /* check if we have cache for this frame */
- if(pid.cache && BKE_ptcache_id_exist(&pid, cfra)) {
- *pid_p = pid;
-
- if(load) {
- Mat4CpyMat4(mat, ob->obmat);
- }
- else {
- pid.cache->editframe= cfra;
- pid.cache->flag |= PTCACHE_BAKE_EDIT_ACTIVE;
- Mat4Invert(mat, ob->obmat); /* ob->imat is not up to date */
- }
-
- return 1;
- }
-
- return 0;
-}
-
-/* turns Mesh into editmesh */
-void make_editMesh()
-{
- Mesh *me= G.obedit->data;
- EditMesh *em= G.editMesh;
- MFace *mface;
- MVert *mvert;
- MSelect *mselect;
- KeyBlock *actkey;
- EditVert *eve, **evlist, *eve1, *eve2, *eve3, *eve4;
- EditFace *efa;
- EditEdge *eed;
- EditSelection *ese;
- PTCacheID pid;
- Cloth *cloth;
- SoftBody *sb;
- float cacheco[3], cachemat[4][4], *co;
- int tot, a, cacheedit= 0, eekadoodle= 0;
-
-#ifdef WITH_VERSE
- if(me->vnode){
- create_edit_mesh_from_geom_node(me->vnode);
- return;
- }
-#endif
-
- /* because of reload */
- free_editMesh(em);
-
- em->act_face = NULL;
- G.totvert= tot= me->totvert;
- G.totedge= me->totedge;
- G.totface= me->totface;
-
- if(tot==0) {
- countall();
- return;
- }
-
- /* initialize fastmalloc for editmesh */
- init_editmesh_fastmalloc(em, me->totvert, me->totedge, me->totface);
-
- actkey = ob_get_keyblock(G.obedit);
- if(actkey) {
- strcpy(G.editModeTitleExtra, "(Key) ");
- key_to_mesh(actkey, me);
- tot= actkey->totelem;
- /* undo-ing in past for previous editmode sessions gives corrupt 'keyindex' values */
- undo_editmode_clear();
- }
-
-
- /* make editverts */
- CustomData_copy(&me->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0);
- mvert= me->mvert;
-
- cacheedit= editmesh_pointcache_edit(G.obedit, tot, &pid, cachemat, 0);
-
- evlist= (EditVert **)MEM_mallocN(tot*sizeof(void *),"evlist");
- for(a=0; a<tot; a++, mvert++) {
-
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH) {
- cloth= ((ClothModifierData*)pid.data)->clothObject;
- VECCOPY(cacheco, cloth->verts[a].x)
- }
- else if(pid.type == PTCACHE_TYPE_SOFTBODY) {
- sb= (SoftBody*)pid.data;
- VECCOPY(cacheco, sb->bpoint[a].pos)
- }
-
- Mat4MulVecfl(cachemat, cacheco);
- co= cacheco;
- }
- else
- co= mvert->co;
-
- eve= addvertlist(co, NULL);
- evlist[a]= eve;
-
- // face select sets selection in next loop
- if( (FACESEL_PAINT_TEST)==0 )
- eve->f |= (mvert->flag & 1);
-
- if (mvert->flag & ME_HIDE) eve->h= 1;
- eve->no[0]= mvert->no[0]/32767.0;
- eve->no[1]= mvert->no[1]/32767.0;
- eve->no[2]= mvert->no[2]/32767.0;
-
- eve->bweight= ((float)mvert->bweight)/255.0f;
-
- /* lets overwrite the keyindex of the editvert
- * with the order it used to be in before
- * editmode
- */
- eve->keyindex = a;
-
- CustomData_to_em_block(&me->vdata, &em->vdata, a, &eve->data);
- }
-
- if(actkey && actkey->totelem!=me->totvert);
- else {
- MEdge *medge= me->medge;
-
- CustomData_copy(&me->edata, &em->edata, CD_MASK_EDITMESH, CD_CALLOC, 0);
- /* make edges */
- for(a=0; a<me->totedge; a++, medge++) {
- eed= addedgelist(evlist[medge->v1], evlist[medge->v2], NULL);
- /* eed can be zero when v1 and v2 are identical, dxf import does this... */
- if(eed) {
- eed->crease= ((float)medge->crease)/255.0f;
- eed->bweight= ((float)medge->bweight)/255.0f;
-
- if(medge->flag & ME_SEAM) eed->seam= 1;
- if(medge->flag & ME_SHARP) eed->sharp = 1;
- if(medge->flag & SELECT) eed->f |= SELECT;
- if(medge->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines!
- if(medge->flag & ME_HIDE) eed->h |= 1;
- if(G.scene->selectmode==SCE_SELECT_EDGE)
- EM_select_edge(eed, eed->f & SELECT); // force edge selection to vertices, seems to be needed ...
- CustomData_to_em_block(&me->edata,&em->edata, a, &eed->data);
- }
- }
-
- CustomData_copy(&me->fdata, &em->fdata, CD_MASK_EDITMESH, CD_CALLOC, 0);
-
- /* make faces */
- mface= me->mface;
-
- for(a=0; a<me->totface; a++, mface++) {
- eve1= evlist[mface->v1];
- eve2= evlist[mface->v2];
- if(!mface->v3) eekadoodle= 1;
- eve3= evlist[mface->v3];
- if(mface->v4) eve4= evlist[mface->v4]; else eve4= NULL;
-
- efa= addfacelist(eve1, eve2, eve3, eve4, NULL, NULL);
-
- if(efa) {
- CustomData_to_em_block(&me->fdata, &em->fdata, a, &efa->data);
-
- efa->mat_nr= mface->mat_nr;
- efa->flag= mface->flag & ~ME_HIDE;
-
- /* select and hide face flag */
- if(mface->flag & ME_HIDE) {
- efa->h= 1;
- } else {
- if (a==me->act_face) {
- EM_set_actFace(efa);
- }
-
- /* dont allow hidden and selected */
- if(mface->flag & ME_FACE_SEL) {
- efa->f |= SELECT;
-
- if(FACESEL_PAINT_TEST) {
- EM_select_face(efa, 1); /* flush down */
- }
- }
- }
- }
- }
- }
-
- if(eekadoodle)
- error("This Mesh has old style edgecodes, please put it in the bugtracker!");
-
- MEM_freeN(evlist);
-
- end_editmesh_fastmalloc(); // resets global function pointers
-
- if(me->mselect){
- //restore editselections
- EM_init_index_arrays(1,1,1);
- mselect = me->mselect;
-
- for(a=0; a<me->totselect; a++, mselect++){
- /*check if recorded selection is still valid, if so copy into editmesh*/
- if( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ){
- ese = MEM_callocN(sizeof(EditSelection), "Edit Selection");
- ese->type = mselect->type;
- if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(mselect->index); else
- if(ese->type == EDITEDGE) ese->data = EM_get_edge_for_index(mselect->index); else
- if(ese->type == EDITFACE) ese->data = EM_get_face_for_index(mselect->index);
- BLI_addtail(&(em->selected),ese);
- }
- }
- EM_free_index_arrays();
- }
- /* this creates coherent selections. also needed for older files */
- EM_selectmode_set();
- /* paranoia check to enforce hide rules */
- EM_hide_reset();
- /* sets helper flags which arent saved */
- EM_fgon_flags();
-
- if (EM_get_actFace(0)==NULL) {
- EM_set_actFace( G.editMesh->faces.first ); /* will use the first face, this is so we alwats have an active face */
- }
-
- /* vertex coordinates change with cache edit, need to recalc */
- if(cacheedit)
- recalc_editnormals();
-
- countall();
-}
-
-/* makes Mesh out of editmesh */
-void load_editMesh(void)
-{
- EditMesh *em = G.editMesh;
- Mesh *me= G.obedit->data;
- MVert *mvert, *oldverts;
- MEdge *medge;
- MFace *mface;
- MSelect *mselect;
- EditVert *eve;
- EditFace *efa, *efa_act;
- EditEdge *eed;
- EditSelection *ese;
- SoftBody *sb;
- Cloth *cloth;
- ClothModifierData *clmd;
- PTCacheID pid;
- float *fp, *newkey, *oldkey, nor[3], cacheco[3], cachemat[4][4];
- int i, a, ototvert, totedge=0, cacheedit= 0;
-
-#ifdef WITH_VERSE
- if(em->vnode) {
- struct VNode *vnode = (VNode*)em->vnode;
- ((VGeomData*)vnode->data)->editmesh = NULL;
- em->vnode = NULL;
- }
-#endif
-
- countall();
-
- /* this one also tests of edges are not in faces: */
- /* eed->f2==0: not in face, f2==1: draw it */
- /* eed->f1 : flag for dynaface (cylindertest, old engine) */
- /* eve->f1 : flag for dynaface (sphere test, old engine) */
- /* eve->f2 : being used in vertexnormals */
- edge_drawflags();
-
- eed= em->edges.first;
- while(eed) {
- totedge++;
- eed= eed->next;
- }
-
- /* new Vertex block */
- if(G.totvert==0) mvert= NULL;
- else mvert= MEM_callocN(G.totvert*sizeof(MVert), "loadeditMesh vert");
-
- /* new Edge block */
- if(totedge==0) medge= NULL;
- else medge= MEM_callocN(totedge*sizeof(MEdge), "loadeditMesh edge");
-
- /* new Face block */
- if(G.totface==0) mface= NULL;
- else mface= MEM_callocN(G.totface*sizeof(MFace), "loadeditMesh face");
-
- /* lets save the old verts just in case we are actually working on
- * a key ... we now do processing of the keys at the end */
- oldverts= me->mvert;
- ototvert= me->totvert;
-
- /* don't free this yet */
- CustomData_set_layer(&me->vdata, CD_MVERT, NULL);
-
- /* free custom data */
- CustomData_free(&me->vdata, me->totvert);
- CustomData_free(&me->edata, me->totedge);
- CustomData_free(&me->fdata, me->totface);
-
- /* add new custom data */
- me->totvert= G.totvert;
- me->totedge= totedge;
- me->totface= G.totface;
-
- CustomData_copy(&em->vdata, &me->vdata, CD_MASK_MESH, CD_CALLOC, me->totvert);
- CustomData_copy(&em->edata, &me->edata, CD_MASK_MESH, CD_CALLOC, me->totedge);
- CustomData_copy(&em->fdata, &me->fdata, CD_MASK_MESH, CD_CALLOC, me->totface);
-
- CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, mvert, me->totvert);
- CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, me->totedge);
- CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, mface, me->totface);
- mesh_update_customdata_pointers(me);
-
- /* the vertices, use ->tmp.l as counter */
- eve= em->verts.first;
- a= 0;
-
- /* check for point cache editing */
- cacheedit= editmesh_pointcache_edit(G.obedit, G.totvert, &pid, cachemat, 1);
-
- while(eve) {
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH) {
- clmd= (ClothModifierData*)pid.data;
- cloth= clmd->clothObject;
-
- /* assign position */
- VECCOPY(cacheco, cloth->verts[a].x)
- VECCOPY(cloth->verts[a].x, eve->co);
- Mat4MulVecfl(cachemat, cloth->verts[a].x);
-
- /* find plausible velocity, not physical correct but gives
- * nicer results when commented */
- VECSUB(cacheco, cloth->verts[a].x, cacheco);
- VecMulf(cacheco, clmd->sim_parms->stepsPerFrame*10.0f);
- VECADD(cloth->verts[a].v, cloth->verts[a].v, cacheco);
- }
- else if(pid.type == PTCACHE_TYPE_SOFTBODY) {
- sb= (SoftBody*)pid.data;
-
- /* assign position */
- VECCOPY(cacheco, sb->bpoint[a].pos)
- VECCOPY(sb->bpoint[a].pos, eve->co);
- Mat4MulVecfl(cachemat, sb->bpoint[a].pos);
-
- /* changing velocity for softbody doesn't seem to give
- * good results? */
-#if 0
- VECSUB(cacheco, sb->bpoint[a].pos, cacheco);
- VecMulf(cacheco, sb->minloops*10.0f);
- VECADD(sb->bpoint[a].vec, sb->bpoint[a].pos, cacheco);
-#endif
- }
-
- if(oldverts)
- VECCOPY(mvert->co, oldverts[a].co)
- }
- else
- VECCOPY(mvert->co, eve->co);
-
- mvert->mat_nr= 255; /* what was this for, halos? */
-
- /* vertex normal */
- VECCOPY(nor, eve->no);
- VecMulf(nor, 32767.0);
- VECCOPY(mvert->no, nor);
-
- /* note: it used to remove me->dvert when it was not in use, cancelled
- that... annoying when you have a fresh vgroup */
- CustomData_from_em_block(&em->vdata, &me->vdata, eve->data, a);
-
- eve->tmp.l = a++; /* counter */
-
- mvert->flag= 0;
- if(eve->f1==1) mvert->flag |= ME_SPHERETEST;
- mvert->flag |= (eve->f & SELECT);
- if (eve->h) mvert->flag |= ME_HIDE;
- mvert->bweight= (char)(255.0*eve->bweight);
-
-#ifdef WITH_VERSE
- if(eve->vvert) {
- ((VerseVert*)eve->vvert)->vertex = NULL;
- eve->vvert = NULL;
- }
-#endif
- eve= eve->next;
- mvert++;
- }
-
- /* write changes to cache */
- if(cacheedit) {
- if(pid.type == PTCACHE_TYPE_CLOTH)
- cloth_write_cache(G.obedit, pid.data, pid.cache->editframe);
- else if(pid.type == PTCACHE_TYPE_SOFTBODY)
- sbWriteCache(G.obedit, pid.cache->editframe);
- }
-
- /* the edges */
- a= 0;
- eed= em->edges.first;
- while(eed) {
- medge->v1= (unsigned int) eed->v1->tmp.l;
- medge->v2= (unsigned int) eed->v2->tmp.l;
-
- medge->flag= (eed->f & SELECT) | ME_EDGERENDER;
- if(eed->f2<2) medge->flag |= ME_EDGEDRAW;
- if(eed->f2==0) medge->flag |= ME_LOOSEEDGE;
- if(eed->sharp) medge->flag |= ME_SHARP;
- if(eed->seam) medge->flag |= ME_SEAM;
- if(eed->h & EM_FGON) medge->flag |= ME_FGON; // different defines yes
- if(eed->h & 1) medge->flag |= ME_HIDE;
-
- medge->crease= (char)(255.0*eed->crease);
- medge->bweight= (char)(255.0*eed->bweight);
- CustomData_from_em_block(&em->edata, &me->edata, eed->data, a);
-
- eed->tmp.l = a++;
-
- medge++;
- eed= eed->next;
- }
-
- /* the faces */
- a = 0;
- efa= em->faces.first;
- efa_act= EM_get_actFace(0);
- i = 0;
- me->act_face = -1;
- while(efa) {
- mface= &((MFace *) me->mface)[i];
-
- mface->v1= (unsigned int) efa->v1->tmp.l;
- mface->v2= (unsigned int) efa->v2->tmp.l;
- mface->v3= (unsigned int) efa->v3->tmp.l;
- if (efa->v4) mface->v4 = (unsigned int) efa->v4->tmp.l;
-
- mface->mat_nr= efa->mat_nr;
-
- mface->flag= efa->flag;
- /* bit 0 of flag is already taken for smooth... */
-
- if(efa->h) {
- mface->flag |= ME_HIDE;
- mface->flag &= ~ME_FACE_SEL;
- } else {
- if(efa->f & 1) mface->flag |= ME_FACE_SEL;
- else mface->flag &= ~ME_FACE_SEL;
- }
-
- /* mat_nr in vertex */
- if(me->totcol>1) {
- mvert= me->mvert+mface->v1;
- if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr;
- mvert= me->mvert+mface->v2;
- if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr;
- mvert= me->mvert+mface->v3;
- if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr;
- if(mface->v4) {
- mvert= me->mvert+mface->v4;
- if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr;
- }
- }
-
- /* watch: efa->e1->f2==0 means loose edge */
-
- if(efa->e1->f2==1) {
- efa->e1->f2= 2;
- }
- if(efa->e2->f2==1) {
- efa->e2->f2= 2;
- }
- if(efa->e3->f2==1) {
- efa->e3->f2= 2;
- }
- if(efa->e4 && efa->e4->f2==1) {
- efa->e4->f2= 2;
- }
-
- CustomData_from_em_block(&em->fdata, &me->fdata, efa->data, i);
-
- /* no index '0' at location 3 or 4 */
- test_index_face(mface, &me->fdata, i, efa->v4?4:3);
-
- if (efa_act == efa)
- me->act_face = a;
-
-#ifdef WITH_VERSE
- if(efa->vface) {
- ((VerseFace*)efa->vface)->face = NULL;
- efa->vface = NULL;
- }
-#endif
- efa->tmp.l = a++;
- i++;
- efa= efa->next;
- }
-
- /* patch hook indices and vertex parents */
- {
- Object *ob;
- ModifierData *md;
- EditVert **vertMap = NULL;
- int i,j;
-
- for (ob=G.main->object.first; ob; ob=ob->id.next) {
- if (ob->parent==G.obedit && ELEM(ob->partype, PARVERT1,PARVERT3)) {
-
- /* duplicate code from below, make it function later...? */
- if (!vertMap) {
- vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
-
- for (eve=em->verts.first; eve; eve=eve->next) {
- if (eve->keyindex!=-1)
- vertMap[eve->keyindex] = eve;
- }
- }
- if(ob->par1 < ototvert) {
- eve = vertMap[ob->par1];
- if(eve) ob->par1= eve->tmp.l;
- }
- if(ob->par2 < ototvert) {
- eve = vertMap[ob->par2];
- if(eve) ob->par2= eve->tmp.l;
- }
- if(ob->par3 < ototvert) {
- eve = vertMap[ob->par3];
- if(eve) ob->par3= eve->tmp.l;
- }
-
- }
- if (ob->data==me) {
- for (md=ob->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
-
- if (!vertMap) {
- vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
-
- for (eve=em->verts.first; eve; eve=eve->next) {
- if (eve->keyindex!=-1)
- vertMap[eve->keyindex] = eve;
- }
- }
-
- for (i=j=0; i<hmd->totindex; i++) {
- if(hmd->indexar[i] < ototvert) {
- eve = vertMap[hmd->indexar[i]];
-
- if (eve) {
- hmd->indexar[j++] = eve->tmp.l;
- }
- }
- else j++;
- }
-
- hmd->totindex = j;
- }
- }
- }
- }
-
- if (vertMap) MEM_freeN(vertMap);
- }
-
- /* are there keys? */
- if(me->key) {
- KeyBlock *currkey, *actkey = ob_get_keyblock(G.obedit);
-
- /* Lets reorder the key data so that things line up roughly
- * with the way things were before editmode */
- currkey = me->key->block.first;
- while(currkey) {
-
- fp= newkey= MEM_callocN(me->key->elemsize*G.totvert, "currkey->data");
- oldkey = currkey->data;
-
- eve= em->verts.first;
-
- i = 0;
- mvert = me->mvert;
- while(eve) {
- if (eve->keyindex >= 0 && eve->keyindex < currkey->totelem) { // valid old vertex
- if(currkey == actkey) {
- if (actkey == me->key->refkey) {
- VECCOPY(fp, mvert->co);
- }
- else {
- VECCOPY(fp, mvert->co);
- if(oldverts) {
- VECCOPY(mvert->co, oldverts[eve->keyindex].co);
- }
- }
- }
- else {
- if(oldkey) {
- VECCOPY(fp, oldkey + 3 * eve->keyindex);
- }
- }
- }
- else {
- VECCOPY(fp, mvert->co);
- }
- fp+= 3;
- ++i;
- ++mvert;
- eve= eve->next;
- }
- currkey->totelem= G.totvert;
- if(currkey->data) MEM_freeN(currkey->data);
- currkey->data = newkey;
-
- currkey= currkey->next;
- }
- }
-
- if(oldverts) MEM_freeN(oldverts);
-
- i = 0;
- for(ese=em->selected.first; ese; ese=ese->next) i++;
- me->totselect = i;
- if(i==0) mselect= NULL;
- else mselect= MEM_callocN(i*sizeof(MSelect), "loadeditMesh selections");
-
- if(me->mselect) MEM_freeN(me->mselect);
- me->mselect= mselect;
-
- for(ese=em->selected.first; ese; ese=ese->next){
- mselect->type = ese->type;
- if(ese->type == EDITVERT) mselect->index = ((EditVert*)ese->data)->tmp.l;
- else if(ese->type == EDITEDGE) mselect->index = ((EditEdge*)ese->data)->tmp.l;
- else if(ese->type == EDITFACE) mselect->index = ((EditFace*)ese->data)->tmp.l;
- mselect++;
- }
-
- /* to be sure: clear ->tmp.l pointers */
- eve= em->verts.first;
- while(eve) {
- eve->tmp.l = 0;
- eve= eve->next;
- }
-
- eed= em->edges.first;
- while(eed) {
- eed->tmp.l = 0;
- eed= eed->next;
- }
-
- efa= em->faces.first;
- while(efa) {
- efa->tmp.l = 0;
- efa= efa->next;
- }
-
- /* remake softbody of all users */
- if(me->id.us>1) {
- Base *base;
- for(base= G.scene->base.first; base; base= base->next)
- if(base->object->data==me)
- base->object->recalc |= OB_RECALC_DATA;
- }
-
- mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
-}
-
-void remake_editMesh(void)
-{
- make_editMesh();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0); /* needed to have nice cloth panels */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Undo all changes");
-}
-
-/* *************** (partial exit editmode) *************/
-
-
-void separatemenu(void)
-{
- short event;
-
- if(G.editMesh->verts.first==NULL) return;
-
- event = pupmenu("Separate %t|Selected%x1|All Loose Parts%x2|By Material%x3");
-
- if (event==0) return;
- waitcursor(1);
-
- switch (event) {
- case 1:
- separate_mesh();
- break;
- case 2:
- separate_mesh_loose();
- break;
- case 3:
- separate_material();
- break;
- }
- waitcursor(0);
-}
-
-void separate_material(void)
-{
- EditMesh *em = G.editMesh;
- unsigned char curr_mat;
- Mesh *me;
-
- if(multires_test()) return;
-
- me= get_mesh(G.obedit);
- if(me->key) {
- error("Can't separate with vertex keys");
- return;
- }
-
- if(G.obedit && em) {
- if(G.obedit->type == OB_MESH) {
- for (curr_mat = 1; curr_mat < G.obedit->totcol; ++curr_mat) {
- /* clear selection, we're going to use that to select material group */
- EM_clear_flag_all(SELECT);
- /* select the material */
- editmesh_select_by_material(curr_mat);
- /* and now separate */
- separate_mesh();
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-}
-
-void separate_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditMesh emcopy;
- EditVert *eve, *v1;
- EditEdge *eed, *e1;
- EditFace *efa, *vl1;
- Object *oldob;
- Mesh *me, *men;
- Base *base, *oldbase;
- ListBase edve, eded, edvl;
-#ifdef WITH_VERSE
- struct VNode *vnode = NULL;
-#endif
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- waitcursor(1);
-
- me= get_mesh(G.obedit);
- if(me->key) {
- error("Can't separate with vertex keys");
- return;
- }
-
- if(em->selected.first) BLI_freelistN(&(em->selected)); /* clear the selection order */
-
- EM_selectmode_set(); // enforce full consistant selection flags
-
- /* we are going to abuse the system as follows:
- * 1. add a duplicate object: this will be the new one, we remember old pointer
- * 2: then do a split if needed.
- * 3. put apart: all NOT selected verts, edges, faces
- * 4. call load_editMesh(): this will be the new object
- * 5. freelist and get back old verts, edges, facs
- */
-
- /* make only obedit selected */
- base= FIRSTBASE;
- while(base) {
- if(base->lay & G.vd->lay) {
- if(base->object==G.obedit) base->flag |= SELECT;
- else base->flag &= ~SELECT;
- }
- base= base->next;
- }
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode) {
- vnode = G.editMesh->vnode;
- G.editMesh->vnode = NULL;
- }
-#endif
- /* no test for split, split doesn't split when a loose part is selected */
- /* SPLIT: first make duplicate */
- adduplicateflag(SELECT);
-
-#ifdef WITH_VERSE
- if(vnode) {
- G.editMesh->vnode = vnode;
- }
-#endif
- /* SPLIT: old faces have 3x flag 128 set, delete these ones */
- delfaceflag(128);
-
- /* since we do tricky things with verts/edges/faces, this makes sure all is selected coherent */
- EM_selectmode_set();
-
- /* set apart: everything that is not selected */
- edve.first= edve.last= eded.first= eded.last= edvl.first= edvl.last= 0;
- eve= em->verts.first;
- while(eve) {
- v1= eve->next;
- if((eve->f & SELECT)==0) {
- BLI_remlink(&em->verts, eve);
- BLI_addtail(&edve, eve);
-#ifdef WITH_VERSE
- if(eve->vvert) {
- ((VerseVert*)eve->vvert)->vertex = NULL;
- eve->vvert = NULL;
- }
-#endif
- }
-
- eve= v1;
- }
- eed= em->edges.first;
- while(eed) {
- e1= eed->next;
- if((eed->f & SELECT)==0) {
- BLI_remlink(&em->edges, eed);
- BLI_addtail(&eded, eed);
- }
- eed= e1;
- }
- efa= em->faces.first;
- while(efa) {
- vl1= efa->next;
- if (efa == G.editMesh->act_face && (efa->f & SELECT)) {
- EM_set_actFace(NULL);
- }
-
- if((efa->f & SELECT)==0) {
- BLI_remlink(&em->faces, efa);
- BLI_addtail(&edvl, efa);
-#ifdef WITH_VERSE
- if(efa->vface) {
- ((VerseFace*)efa->vface)->face = NULL;
- efa->vface = NULL;
- }
-#endif
- }
- efa= vl1;
- }
-
- oldob= G.obedit;
- oldbase= BASACT;
-
-#ifdef WITH_VERSE
- if(G.obedit->vnode) {
- vnode = G.obedit->vnode;
- G.obedit->vnode = NULL;
- }
-#endif
- adduplicate(1, 0); /* notrans and a linked duplicate */
-
-#ifdef WITH_VERSE
- if(vnode) {
- G.obedit->vnode = vnode;
- }
-#endif
-
- G.obedit= BASACT->object; /* basact was set in adduplicate() */
-
- men= copy_mesh(me);
- set_mesh(G.obedit, men);
- /* because new mesh is a copy: reduce user count */
- men->id.us--;
-
- load_editMesh();
-
- BASACT->flag &= ~SELECT;
-
- /* we cannot free the original buffer... */
- emcopy= *G.editMesh;
- emcopy.allverts= NULL;
- emcopy.alledges= NULL;
- emcopy.allfaces= NULL;
- emcopy.derivedFinal= emcopy.derivedCage= NULL;
- memset(&emcopy.vdata, 0, sizeof(emcopy.vdata));
- memset(&emcopy.fdata, 0, sizeof(emcopy.fdata));
- free_editMesh(&emcopy);
-
- em->verts= edve;
- em->edges= eded;
- em->faces= edvl;
-
- /* hashedges are freed now, make new! */
- editMesh_set_hash();
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- G.obedit= oldob;
- BASACT= oldbase;
- BASACT->flag |= SELECT;
-
- waitcursor(0);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-}
-
-void separate_mesh_loose(void)
-{
- EditMesh *em = G.editMesh;
- EditMesh emcopy;
- EditVert *eve, *v1;
- EditEdge *eed, *e1;
- EditFace *efa, *vl1;
- Object *oldob=NULL;
- Mesh *me, *men;
- Base *base, *oldbase;
- ListBase edve, eded, edvl;
- int vertsep=0;
- short done=0, check=1;
-#ifdef WITH_VERSE
- struct VNode *vnode = NULL;
-#endif
-
- me= get_mesh(G.obedit);
-#ifdef WITH_VERSE
- if(me->vnode) {
- error("Can't separate a mesh shared at verse server");
- return;
- }
-#endif
- if(me->key) {
- error("Can't separate a mesh with vertex keys");
- return;
- }
-
- TEST_EDITMESH
- if(multires_test()) return;
- waitcursor(1);
-
- /* we are going to abuse the system as follows:
- * 1. add a duplicate object: this will be the new one, we remember old pointer
- * 2: then do a split if needed.
- * 3. put apart: all NOT selected verts, edges, faces
- * 4. call load_editMesh(): this will be the new object
- * 5. freelist and get back old verts, edges, facs
- */
-
- while(!done){
- vertsep=check=1;
-
- countall();
-
- /* make only obedit selected */
- base= FIRSTBASE;
- while(base) {
- if(base->lay & G.vd->lay) {
- if(base->object==G.obedit) base->flag |= SELECT;
- else base->flag &= ~SELECT;
- }
- base= base->next;
- }
-
- /*--------- Select connected-----------*/
-
- EM_clear_flag_all(SELECT);
-
- /* Select a random vert to start with */
- eve= em->verts.first;
- eve->f |= SELECT;
-
- while(check==1) {
- check= 0;
- eed= em->edges.first;
- while(eed) {
- if(eed->h==0) {
- if(eed->v1->f & SELECT) {
- if( (eed->v2->f & SELECT)==0 ) {
- eed->v2->f |= SELECT;
- vertsep++;
- check= 1;
- }
- }
- else if(eed->v2->f & SELECT) {
- if( (eed->v1->f & SELECT)==0 ) {
- eed->v1->f |= SELECT;
- vertsep++;
- check= SELECT;
- }
- }
- }
- eed= eed->next;
- }
- }
- /*----------End of select connected--------*/
-
-
- /* If the amount of vertices that is about to be split == the total amount
- of verts in the mesh, it means that there is only 1 unconnected object, so we don't have to separate
- */
- if(G.totvert==vertsep) done=1;
- else{
- /* No splitting: select connected goes fine */
-
- EM_select_flush(); // from verts->edges->faces
-
- /* set apart: everything that is not selected */
- edve.first= edve.last= eded.first= eded.last= edvl.first= edvl.last= 0;
- eve= em->verts.first;
- while(eve) {
- v1= eve->next;
- if((eve->f & SELECT)==0) {
- BLI_remlink(&em->verts, eve);
- BLI_addtail(&edve, eve);
-#ifdef WITH_VERSE
- if(eve->vvert) {
- b_verse_send_vertex_delete(eve);
- }
-#endif
- }
- eve= v1;
- }
- eed= em->edges.first;
- while(eed) {
- e1= eed->next;
- if( (eed->f & SELECT)==0 ) {
- BLI_remlink(&em->edges, eed);
- BLI_addtail(&eded, eed);
- }
- eed= e1;
- }
- efa= em->faces.first;
- while(efa) {
- vl1= efa->next;
- if( (efa->f & SELECT)==0 ) {
- BLI_remlink(&em->faces, efa);
- BLI_addtail(&edvl, efa);
-#ifdef WITH_VERSE
- if(efa->vface) {
- b_verse_send_face_delete(efa);
- }
-#endif
- }
- efa= vl1;
- }
-
- oldob= G.obedit;
- oldbase= BASACT;
-
-#ifdef WITH_VERSE
- if(G.obedit->vnode) {
- vnode = G.obedit->vnode;
- G.obedit->vnode = NULL;
- }
-#endif
- adduplicate(1, 0); /* notrans and a linked duplicate*/
-#ifdef WITH_VERSE
- if(vnode) {
- G.obedit->vnode = vnode;
- }
-#endif
-
- G.obedit= BASACT->object; /* basact was set in adduplicate() */
-
- men= copy_mesh(me);
- set_mesh(G.obedit, men);
- /* because new mesh is a copy: reduce user count */
- men->id.us--;
-
- load_editMesh();
-
- BASACT->flag &= ~SELECT;
-
- /* we cannot free the original buffer... */
- emcopy= *G.editMesh;
- emcopy.allverts= NULL;
- emcopy.alledges= NULL;
- emcopy.allfaces= NULL;
- emcopy.derivedFinal= emcopy.derivedCage= NULL;
- memset(&emcopy.vdata, 0, sizeof(emcopy.vdata));
- memset(&emcopy.fdata, 0, sizeof(emcopy.fdata));
- free_editMesh(&emcopy);
-
- em->verts= edve;
- em->edges= eded;
- em->faces= edvl;
-
- /* hashedges are freed now, make new! */
- editMesh_set_hash();
-
- G.obedit= oldob;
- BASACT= oldbase;
- BASACT->flag |= SELECT;
-
- }
- }
-
- /* unselect the vertices that we (ab)used for the separation*/
- EM_clear_flag_all(SELECT);
-
- waitcursor(0);
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-/* ******************************************** */
-
-/* *************** UNDO ***************************** */
-/* new mesh undo, based on pushing editmesh data itself */
-/* reuses same code as for global and curve undo... unify that (ton) */
-
-/* only one 'hack', to save memory it doesn't store the first push, but does a remake editmesh */
-
-/* a compressed version of editmesh data */
-
-typedef struct EditVertC
-{
- float no[3];
- float co[3];
- unsigned char f, h;
- short bweight;
- int keyindex;
-} EditVertC;
-
-typedef struct EditEdgeC
-{
- int v1, v2;
- unsigned char f, h, seam, sharp, pad;
- short crease, bweight, fgoni;
-} EditEdgeC;
-
-typedef struct EditFaceC
-{
- int v1, v2, v3, v4;
- unsigned char mat_nr, flag, f, h, fgonf;
- short pad1;
-} EditFaceC;
-
-typedef struct EditSelectionC{
- short type;
- int index;
-}EditSelectionC;
-
-typedef struct EM_MultiresUndo {
- int users;
- Multires *mr;
-} EM_MultiresUndo;
-
-typedef struct UndoMesh {
- EditVertC *verts;
- EditEdgeC *edges;
- EditFaceC *faces;
- EditSelectionC *selected;
- int totvert, totedge, totface, totsel;
- short selectmode;
- RetopoPaintData *retopo_paint_data;
- char retopo_mode;
- CustomData vdata, edata, fdata;
- EM_MultiresUndo *mru;
-} UndoMesh;
-
-/* for callbacks */
-
-static void free_undoMesh(void *umv)
-{
- UndoMesh *um= umv;
-
- if(um->verts) MEM_freeN(um->verts);
- if(um->edges) MEM_freeN(um->edges);
- if(um->faces) MEM_freeN(um->faces);
- if(um->selected) MEM_freeN(um->selected);
- if(um->retopo_paint_data) retopo_free_paint_data(um->retopo_paint_data);
- CustomData_free(&um->vdata, um->totvert);
- CustomData_free(&um->edata, um->totedge);
- CustomData_free(&um->fdata, um->totface);
- if(um->mru) {
- --um->mru->users;
- if(um->mru->users==0) {
- multires_free(um->mru->mr);
- um->mru->mr= NULL;
- MEM_freeN(um->mru);
- }
- }
- MEM_freeN(um);
-}
-
-static void *editMesh_to_undoMesh(void)
-{
- EditMesh *em= G.editMesh;
- UndoMesh *um;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- EditSelection *ese;
- EditVertC *evec=NULL;
- EditEdgeC *eedc=NULL;
- EditFaceC *efac=NULL;
- EditSelectionC *esec=NULL;
- int a;
-
- um= MEM_callocN(sizeof(UndoMesh), "undomesh");
-
- um->selectmode = G.scene->selectmode;
-
- for(eve=em->verts.first; eve; eve= eve->next) um->totvert++;
- for(eed=em->edges.first; eed; eed= eed->next) um->totedge++;
- for(efa=em->faces.first; efa; efa= efa->next) um->totface++;
- for(ese=em->selected.first; ese; ese=ese->next) um->totsel++;
- /* malloc blocks */
-
- if(um->totvert) evec= um->verts= MEM_callocN(um->totvert*sizeof(EditVertC), "allvertsC");
- if(um->totedge) eedc= um->edges= MEM_callocN(um->totedge*sizeof(EditEdgeC), "alledgesC");
- if(um->totface) efac= um->faces= MEM_callocN(um->totface*sizeof(EditFaceC), "allfacesC");
- if(um->totsel) esec= um->selected= MEM_callocN(um->totsel*sizeof(EditSelectionC), "allselections");
-
- if(um->totvert) CustomData_copy(&em->vdata, &um->vdata, CD_MASK_EDITMESH, CD_CALLOC, um->totvert);
- if(um->totedge) CustomData_copy(&em->edata, &um->edata, CD_MASK_EDITMESH, CD_CALLOC, um->totedge);
- if(um->totface) CustomData_copy(&em->fdata, &um->fdata, CD_MASK_EDITMESH, CD_CALLOC, um->totface);
-
- /* now copy vertices */
- a = 0;
- for(eve=em->verts.first; eve; eve= eve->next, evec++, a++) {
- VECCOPY(evec->co, eve->co);
- VECCOPY(evec->no, eve->no);
-
- evec->f= eve->f;
- evec->h= eve->h;
- evec->keyindex= eve->keyindex;
- eve->tmp.l = a; /*store index*/
- evec->bweight= (short)(eve->bweight*255.0);
-
- CustomData_from_em_block(&em->vdata, &um->vdata, eve->data, a);
- }
-
- /* copy edges */
- a = 0;
- for(eed=em->edges.first; eed; eed= eed->next, eedc++, a++) {
- eedc->v1= (int)eed->v1->tmp.l;
- eedc->v2= (int)eed->v2->tmp.l;
- eedc->f= eed->f;
- eedc->h= eed->h;
- eedc->seam= eed->seam;
- eedc->sharp= eed->sharp;
- eedc->crease= (short)(eed->crease*255.0);
- eedc->bweight= (short)(eed->bweight*255.0);
- eedc->fgoni= eed->fgoni;
- eed->tmp.l = a; /*store index*/
- CustomData_from_em_block(&em->edata, &um->edata, eed->data, a);
-
- }
-
- /* copy faces */
- a = 0;
- for(efa=em->faces.first; efa; efa= efa->next, efac++, a++) {
- efac->v1= (int)efa->v1->tmp.l;
- efac->v2= (int)efa->v2->tmp.l;
- efac->v3= (int)efa->v3->tmp.l;
- if(efa->v4) efac->v4= (int)efa->v4->tmp.l;
- else efac->v4= -1;
-
- efac->mat_nr= efa->mat_nr;
- efac->flag= efa->flag;
- efac->f= efa->f;
- efac->h= efa->h;
- efac->fgonf= efa->fgonf;
-
- efa->tmp.l = a; /*store index*/
-
- CustomData_from_em_block(&em->fdata, &um->fdata, efa->data, a);
- }
-
- a = 0;
- for(ese=em->selected.first; ese; ese=ese->next, esec++){
- esec->type = ese->type;
- if(ese->type == EDITVERT) a = esec->index = ((EditVert*)ese->data)->tmp.l;
- else if(ese->type == EDITEDGE) a = esec->index = ((EditEdge*)ese->data)->tmp.l;
- else if(ese->type == EDITFACE) a = esec->index = ((EditFace*)ese->data)->tmp.l;
- }
-
- um->retopo_paint_data= retopo_paint_data_copy(em->retopo_paint_data);
- um->retopo_mode= G.scene->toolsettings->retopo_mode;
-
- {
- Multires *mr= get_mesh(G.obedit)->mr;
- UndoMesh *prev= undo_editmode_get_prev(G.obedit);
-
- um->mru= NULL;
-
- if(mr) {
- if(prev && prev->mru && prev->mru->mr && prev->mru->mr->current == mr->current) {
- um->mru= prev->mru;
- ++um->mru->users;
- }
- else {
- um->mru= MEM_callocN(sizeof(EM_MultiresUndo), "EM_MultiresUndo");
- um->mru->users= 1;
- um->mru->mr= multires_copy(mr);
- }
- }
- }
-
- return um;
-}
-
-static void undoMesh_to_editMesh(void *umv)
-{
- UndoMesh *um= (UndoMesh*)umv;
- EditMesh *em= G.editMesh;
- EditVert *eve, **evar=NULL;
- EditEdge *eed;
- EditFace *efa;
- EditSelection *ese;
- EditVertC *evec;
- EditEdgeC *eedc;
- EditFaceC *efac;
- EditSelectionC *esec;
- int a=0;
-
-#ifdef WITH_VERSE
- struct VNode *vnode = G.editMesh->vnode;
- if(vnode) {
- /* send delete command to all verse vertexes and verse face ...
- * verse mesh will be recreated from new edit mesh */
- destroy_versemesh(vnode);
- }
-#endif
- G.scene->selectmode = um->selectmode;
-
- free_editMesh(G.editMesh);
-
- /* malloc blocks */
- memset(em, 0, sizeof(EditMesh));
-
- init_editmesh_fastmalloc(em, um->totvert, um->totedge, um->totface);
-
-#ifdef WITH_VERSE
- G.editMesh->vnode = vnode;
-#endif
-
- CustomData_free(&em->vdata, 0);
- CustomData_free(&em->edata, 0);
- CustomData_free(&em->fdata, 0);
-
- CustomData_copy(&um->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0);
- CustomData_copy(&um->edata, &em->edata, CD_MASK_EDITMESH, CD_CALLOC, 0);
- CustomData_copy(&um->fdata, &em->fdata, CD_MASK_EDITMESH, CD_CALLOC, 0);
-
- /* now copy vertices */
-
- if(um->totvert) evar= MEM_mallocN(um->totvert*sizeof(EditVert *), "vertex ar");
- for(a=0, evec= um->verts; a<um->totvert; a++, evec++) {
- eve= addvertlist(evec->co, NULL);
- evar[a]= eve;
-
- VECCOPY(eve->no, evec->no);
- eve->f= evec->f;
- eve->h= evec->h;
- eve->keyindex= evec->keyindex;
- eve->bweight= ((float)evec->bweight)/255.0f;
-
- CustomData_to_em_block(&um->vdata, &em->vdata, a, &eve->data);
- }
-
- /* copy edges */
- for(a=0, eedc= um->edges; a<um->totedge; a++, eedc++) {
- eed= addedgelist(evar[eedc->v1], evar[eedc->v2], NULL);
-
- eed->f= eedc->f;
- eed->h= eedc->h;
- eed->seam= eedc->seam;
- eed->sharp= eedc->sharp;
- eed->fgoni= eedc->fgoni;
- eed->crease= ((float)eedc->crease)/255.0f;
- eed->bweight= ((float)eedc->bweight)/255.0f;
- CustomData_to_em_block(&um->edata, &em->edata, a, &eed->data);
- }
-
- /* copy faces */
- for(a=0, efac= um->faces; a<um->totface; a++, efac++) {
- if(efac->v4 != -1)
- efa= addfacelist(evar[efac->v1], evar[efac->v2], evar[efac->v3], evar[efac->v4], NULL, NULL);
- else
- efa= addfacelist(evar[efac->v1], evar[efac->v2], evar[efac->v3], NULL, NULL ,NULL);
-
- efa->mat_nr= efac->mat_nr;
- efa->flag= efac->flag;
- efa->f= efac->f;
- efa->h= efac->h;
- efa->fgonf= efac->fgonf;
-
- CustomData_to_em_block(&um->fdata, &em->fdata, a, &efa->data);
- }
-
- end_editmesh_fastmalloc();
- if(evar) MEM_freeN(evar);
-
- G.totvert = um->totvert;
- G.totedge = um->totedge;
- G.totface = um->totface;
- /*restore stored editselections*/
- if(um->totsel){
- EM_init_index_arrays(1,1,1);
- for(a=0, esec= um->selected; a<um->totsel; a++, esec++){
- ese = MEM_callocN(sizeof(EditSelection), "Edit Selection");
- ese->type = esec->type;
- if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(esec->index); else
- if(ese->type == EDITEDGE) ese->data = EM_get_edge_for_index(esec->index); else
- if(ese->type == EDITFACE) ese->data = EM_get_face_for_index(esec->index);
- BLI_addtail(&(em->selected),ese);
- }
- EM_free_index_arrays();
- }
-
- retopo_free_paint();
- em->retopo_paint_data= retopo_paint_data_copy(um->retopo_paint_data);
- G.scene->toolsettings->retopo_mode= um->retopo_mode;
- if(G.scene->toolsettings->retopo_mode) {
- if(G.vd->depths) G.vd->depths->damaged= 1;
- retopo_queue_updates(G.vd);
- retopo_paint_view_update(G.vd);
- }
-
- {
- Mesh *me= get_mesh(G.obedit);
- multires_free(me->mr);
- me->mr= NULL;
- if(um->mru && um->mru->mr) me->mr= multires_copy(um->mru->mr);
- }
-}
-
-
-/* and this is all the undo system needs to know */
-void undo_push_mesh(char *name)
-{
- undo_editmode_push(name, free_undoMesh, undoMesh_to_editMesh, editMesh_to_undoMesh, NULL);
-}
-
-
-
-/* *************** END UNDO *************/
-
-static EditVert **g_em_vert_array = NULL;
-static EditEdge **g_em_edge_array = NULL;
-static EditFace **g_em_face_array = NULL;
-
-void EM_init_index_arrays(int forVert, int forEdge, int forFace)
-{
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- int i;
-
- if (forVert) {
- g_em_vert_array = MEM_mallocN(sizeof(*g_em_vert_array)*G.totvert, "em_v_arr");
-
- for (i=0,eve=G.editMesh->verts.first; eve; i++,eve=eve->next)
- g_em_vert_array[i] = eve;
- }
-
- if (forEdge) {
- g_em_edge_array = MEM_mallocN(sizeof(*g_em_edge_array)*G.totedge, "em_e_arr");
-
- for (i=0,eed=G.editMesh->edges.first; eed; i++,eed=eed->next)
- g_em_edge_array[i] = eed;
- }
-
- if (forFace) {
- g_em_face_array = MEM_mallocN(sizeof(*g_em_face_array)*G.totface, "em_f_arr");
-
- for (i=0,efa=G.editMesh->faces.first; efa; i++,efa=efa->next)
- g_em_face_array[i] = efa;
- }
-}
-
-void EM_free_index_arrays(void)
-{
- if (g_em_vert_array) MEM_freeN(g_em_vert_array);
- if (g_em_edge_array) MEM_freeN(g_em_edge_array);
- if (g_em_face_array) MEM_freeN(g_em_face_array);
- g_em_vert_array = NULL;
- g_em_edge_array = NULL;
- g_em_face_array = NULL;
-}
-
-EditVert *EM_get_vert_for_index(int index)
-{
- return g_em_vert_array?g_em_vert_array[index]:NULL;
-}
-
-EditEdge *EM_get_edge_for_index(int index)
-{
- return g_em_edge_array?g_em_edge_array[index]:NULL;
-}
-
-EditFace *EM_get_face_for_index(int index)
-{
- return g_em_face_array?g_em_face_array[index]:NULL;
-}
-
-/* can we edit UV's for this mesh?*/
-int EM_texFaceCheck(void)
-{
- /* some of these checks could be a touch overkill */
- if ( (G.obedit) &&
- (G.obedit->type == OB_MESH) &&
- (G.editMesh) &&
- (G.editMesh->faces.first) &&
- (CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)))
- return 1;
- return 0;
-}
-
-/* can we edit colors for this mesh?*/
-int EM_vertColorCheck(void)
-{
- /* some of these checks could be a touch overkill */
- if ( (G.obedit) &&
- (G.obedit->type == OB_MESH) &&
- (G.editMesh) &&
- (G.editMesh->faces.first) &&
- (CustomData_has_layer(&G.editMesh->fdata, CD_MCOL)))
- return 1;
- return 0;
-}
-
diff --git a/source/blender/src/editmesh_add.c b/source/blender/src/editmesh_add.c
deleted file mode 100644
index 16a5b049da2..00000000000
--- a/source/blender/src/editmesh_add.c
+++ /dev/null
@@ -1,1498 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-
-#include "BIF_editmesh.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BDR_editobject.h"
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-
-#include "blendef.h"
-#include "multires.h"
-#include "mydevice.h"
-
-#include "editmesh.h"
-
-/* bpymenu */
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-static float icovert[12][3] = {
- {0,0,-200},
- {144.72, -105.144,-89.443},
- {-55.277, -170.128,-89.443},
- {-178.885,0,-89.443},
- {-55.277,170.128,-89.443},
- {144.72,105.144,-89.443},
- {55.277,-170.128,89.443},
- {-144.72,-105.144,89.443},
- {-144.72,105.144,89.443},
- {55.277,170.128,89.443},
- {178.885,0,89.443},
- {0,0,200}
-};
-static short icoface[20][3] = {
- {1,0,2},
- {1,0,5},
- {2,0,3},
- {3,0,4},
- {4,0,5},
- {1,5,10},
- {2,1,6},
- {3,2,7},
- {4,3,8},
- {5,4,9},
- {10,1,6},
- {6,2,7},
- {7,3,8},
- {8,4,9},
- {9,5,10},
- {6,10,11},
- {7,6,11},
- {8,7,11},
- {9,8,11},
- {10,9,11}
-};
-
-static void get_view_aligned_coordinate(float *fp)
-{
- float dvec[3];
- short mx, my, mval[2];
-
- getmouseco_areawin(mval);
- mx= mval[0];
- my= mval[1];
-
- project_short_noclip(fp, mval);
-
- initgrabz(fp[0], fp[1], fp[2]);
-
- if(mval[0]!=IS_CLIPPED) {
- window_to_3d(dvec, mval[0]-mx, mval[1]-my);
- VecSubf(fp, fp, dvec);
- }
-}
-
-void add_click_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1;
- float min[3], max[3];
- int done= 0;
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- INIT_MINMAX(min, max);
-
- for(v1= em->verts.first;v1; v1=v1->next) {
- if(v1->f & SELECT) {
- DO_MINMAX(v1->co, min, max);
- done= 1;
- }
- }
-
- /* call extrude? */
- if(done) {
- EditEdge *eed;
- float vec[3], cent[3], mat[3][3];
- float nor[3]= {0.0, 0.0, 0.0};
-
- /* check for edges that are half selected, use for rotation */
- done= 0;
- for(eed= em->edges.first; eed; eed= eed->next) {
- if( (eed->v1->f & SELECT)+(eed->v2->f & SELECT) == SELECT ) {
- if(eed->v1->f & SELECT) VecSubf(vec, eed->v1->co, eed->v2->co);
- else VecSubf(vec, eed->v2->co, eed->v1->co);
- VecAddf(nor, nor, vec);
- done= 1;
- }
- }
- if(done) Normalize(nor);
-
- /* center */
- VecAddf(cent, min, max);
- VecMulf(cent, 0.5f);
- VECCOPY(min, cent);
-
- Mat4MulVecfl(G.obedit->obmat, min); // view space
- get_view_aligned_coordinate(min);
- Mat4Invert(G.obedit->imat, G.obedit->obmat);
- Mat4MulVecfl(G.obedit->imat, min); // back in object space
-
- VecSubf(min, min, cent);
-
- /* calculate rotation */
- Mat3One(mat);
- if(done) {
- float dot;
-
- VECCOPY(vec, min);
- Normalize(vec);
- dot= INPR(vec, nor);
-
- if( fabs(dot)<0.999) {
- float cross[3], si, q1[4];
-
- Crossf(cross, nor, vec);
- Normalize(cross);
- dot= 0.5f*saacos(dot);
- si= (float)sin(dot);
- q1[0]= (float)cos(dot);
- q1[1]= cross[0]*si;
- q1[2]= cross[1]*si;
- q1[3]= cross[2]*si;
-
- QuatToMat3(q1, mat);
- }
- }
-
- extrudeflag(SELECT, nor);
- rotateflag(SELECT, cent, mat);
- translateflag(SELECT, min);
-
- recalc_editnormals();
- }
- else {
- float mat[3][3],imat[3][3];
- float *curs= give_cursor();
-
- eve= addvertlist(0, NULL);
-
- Mat3CpyMat4(mat, G.obedit->obmat);
- Mat3Inv(imat, mat);
-
- VECCOPY(eve->co, curs);
- VecSubf(eve->co, eve->co, G.obedit->obmat[3]);
-
- Mat3MulVecfl(imat, eve->co);
-
- eve->f= SELECT;
- }
-
- retopo_do_all();
-
- countall();
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode) {
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
- }
-#endif
-
- BIF_undo_push("Add vertex/edge/face");
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- while(get_mbut()&R_MOUSE);
-
-}
-
-/* selected faces get hidden edges */
-static void make_fgon(int make)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditEdge *eed;
- EditVert *eve;
- float *nor=NULL; // reference
- int done=0;
-
- if(!make) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- efa->fgonf= 0;
- efa->e1->h &= ~EM_FGON;
- efa->e2->h &= ~EM_FGON;
- efa->e3->h &= ~EM_FGON;
- if(efa->e4) efa->e4->h &= ~EM_FGON;
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- EM_fgon_flags(); // redo flags and indices for fgons
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Clear FGon");
- return;
- }
-
- /* tagging edges. rule is:
- - edge used by exactly 2 selected faces
- - no vertices allowed with only tagged edges (return)
- - face normals are allowed to difffer
-
- */
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0; // amount of selected
- eed->f2= 0; // amount of unselected
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- if(nor==NULL) nor= efa->n;
- if(efa->e1->f1 < 3) efa->e1->f1++;
- if(efa->e2->f1 < 3) efa->e2->f1++;
- if(efa->e3->f1 < 3) efa->e3->f1++;
- if(efa->e4 && efa->e4->f1 < 3) efa->e4->f1++;
- }
- else {
- if(efa->e1->f2 < 3) efa->e1->f2++;
- if(efa->e2->f2 < 3) efa->e2->f2++;
- if(efa->e3->f2 < 3) efa->e3->f2++;
- if(efa->e4 && efa->e4->f2 < 3) efa->e4->f2++;
- }
- }
- // now eed->f1 becomes tagged edge
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f1==2 && eed->f2==0) eed->f1= 1;
- else eed->f1= 0;
- }
-
- // no vertices allowed with only tagged edges
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f1) {
- eed->v1->f1 |= 1;
- eed->v2->f1 |= 1;
- }
- else {
- eed->v1->f1 |= 2;
- eed->v2->f1 |= 2;
- }
- }
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f1==1) break;
- }
- if(eve) {
- error("Cannot make polygon with interior vertices");
- return;
- }
-
- // check for faces
- if(nor==NULL) {
- error("No faces selected to make FGon");
- return;
- }
-
- // and there we go
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f1) {
- eed->h |= EM_FGON;
- done= 1;
- }
- }
-
- if(done==0) {
- error("Didn't find FGon to create");
- }
- else {
- EM_fgon_flags(); // redo flags and indices for fgons
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Make FGon");
- }
-}
-
-/* precondition; 4 vertices selected, check for 4 edges and create face */
-static EditFace *addface_from_edges(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed, *eedar[4]={NULL, NULL, NULL, NULL};
- EditVert *v1=NULL, *v2=NULL, *v3=NULL, *v4=NULL;
- int a;
-
- /* find the 4 edges */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if( (eed->f & SELECT) || (eed->v1->f & eed->v2->f & SELECT) ) {
- if(eedar[0]==NULL) eedar[0]= eed;
- else if(eedar[1]==NULL) eedar[1]= eed;
- else if(eedar[2]==NULL) eedar[2]= eed;
- else eedar[3]= eed;
-
- }
- }
-
-
- if(eedar[3]) {
- /* first 2 points */
- v1= eedar[0]->v1;
- v2= eedar[0]->v2;
-
- /* find the 2 edges connected to first edge */
- for(a=1; a<4; a++) {
- if( eedar[a]->v1 == v2) v3= eedar[a]->v2;
- else if(eedar[a]->v2 == v2) v3= eedar[a]->v1;
- else if( eedar[a]->v1 == v1) v4= eedar[a]->v2;
- else if(eedar[a]->v2 == v1) v4= eedar[a]->v1;
- }
-
- /* verify if last edge exists */
- if(v3 && v4) {
- for(a=1; a<4; a++) {
- if( eedar[a]->v1==v3 && eedar[a]->v2==v4) break;
- if( eedar[a]->v2==v3 && eedar[a]->v1==v4) break;
- }
- if(a!=4) {
- return addfacelist(v1, v2, v3, v4, NULL, NULL);
- }
- }
- }
- return NULL;
-}
-
-/* this also allows to prevent triangles being made in quads */
-static int compareface_overlaps(EditFace *vl1, EditFace *vl2)
-{
- EditVert *v1, *v2, *v3, *v4;
- int equal= 0;
-
- v1= vl2->v1;
- v2= vl2->v2;
- v3= vl2->v3;
- v4= vl2->v4;
-
- if(vl1==vl2) return 0;
-
- if(v4==NULL && vl1->v4==NULL) {
- if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1) equal++;
- if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2) equal++;
- if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3) equal++;
- }
- else {
- if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1 || vl1->v4==v1) equal++;
- if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2 || vl1->v4==v2) equal++;
- if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3 || vl1->v4==v3) equal++;
- if(vl1->v1==v4 || vl1->v2==v4 || vl1->v3==v4 || vl1->v4==v4) equal++;
- }
-
- if(v4 && vl1->v4) {
- if(equal==4) return 1;
- }
- else
- if(equal>=3) return 1;
-
- return 0;
-}
-
-/* checks for existance, and for tria overlapping inside quad */
-static EditFace *exist_face_overlaps(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, efatest;
-
- efatest.v1= v1;
- efatest.v2= v2;
- efatest.v3= v3;
- efatest.v4= v4;
-
- efa= em->faces.first;
- while(efa) {
- if(compareface_overlaps(&efatest, efa)) return efa;
- efa= efa->next;
- }
- return NULL;
-}
-
-/* will be new face smooth or solid? depends on smoothness of face neighbours
- * of new face, if function return 1, then new face will be smooth, when functio
- * will return zero, then new face will be solid */
-static void fix_new_face(EditFace *eface)
-{
- struct EditMesh *em = G.editMesh;
- struct EditFace *efa;
- struct EditEdge *eed=NULL;
- struct EditVert *v1 = eface->v1, *v2 = eface->v2, *v3 = eface->v3, *v4 = eface->v4;
- struct EditVert *ev1=NULL, *ev2=NULL;
- short smooth=0; /* "total smoothnes" of faces in neighbourhood */
- short coef; /* "weight" of smoothness */
- short count=0; /* number of edges with same direction as eface */
- short vi00=0, vi01=0, vi10=0, vi11=0; /* vertex indexes */
-
- efa = em->faces.first;
-
- while(efa) {
-
- if(efa==eface) {
- efa = efa->next;
- continue;
- }
-
- coef = 0;
- ev1 = ev2 = NULL;
- eed = NULL;
-
- if(efa->v1==v1 || efa->v2==v1 || efa->v3==v1 || efa->v4==v1) {
- ev1 = v1;
- coef++;
- }
- if(efa->v1==v2 || efa->v2==v2 || efa->v3==v2 || efa->v4==v2) {
- if(ev1) ev2 = v2;
- else ev1 = v2;
- coef++;
- }
- if(efa->v1==v3 || efa->v2==v3 || efa->v3==v3 || efa->v4==v3) {
- if(coef<2) {
- if(ev1) ev2 = v3;
- else ev1 = v3;
- }
- coef++;
- }
- if((v4) && (efa->v1==v4 || efa->v2==v4 || efa->v3==v4 || efa->v4==v4)) {
- if(ev1 && coef<2) ev2 = v4;
- coef++;
- }
-
- /* "democracy" of smoothness */
- if(efa->flag & ME_SMOOTH)
- smooth += coef;
- else
- smooth -= coef;
-
- /* try to find edge using vertexes ev1 and ev2 */
- if((ev1) && (ev2) && (ev1!=ev2)) eed = findedgelist(ev1, ev2);
-
- /* has bordering edge of efa same direction as edge of eface ? */
- if(eed) {
- if(eed->v1==v1) vi00 = 1;
- else if(eed->v1==v2) vi00 = 2;
- else if(eed->v1==v3) vi00 = 3;
- else if(v4 && eed->v1==v4) vi00 = 4;
-
- if(eed->v2==v1) vi01 = 1;
- else if(eed->v2==v2) vi01 = 2;
- else if(eed->v2==v3) vi01 = 3;
- else if(v4 && eed->v2==v4) vi01 = 4;
-
- if(v4) {
- if(vi01==1 && vi00==4) vi00 = 0;
- if(vi01==4 && vi00==1) vi01 = 0;
- }
- else {
- if(vi01==1 && vi00==3) vi00 = 0;
- if(vi01==3 && vi00==1) vi01 = 0;
- }
-
- if(eed->v1==efa->v1) vi10 = 1;
- else if(eed->v1==efa->v2) vi10 = 2;
- else if(eed->v1==efa->v3) vi10 = 3;
- else if(efa->v4 && eed->v1==efa->v4) vi10 = 4;
-
- if(eed->v2==efa->v1) vi11 = 1;
- else if(eed->v2==efa->v2) vi11 = 2;
- else if(eed->v2==efa->v3) vi11 = 3;
- else if(efa->v4 && eed->v2==efa->v4) vi11 = 4;
-
- if(efa->v4) {
- if(vi11==1 && vi10==4) vi10 = 0;
- if(vi11==4 && vi10==1) vi11 = 0;
- }
- else {
- if(vi11==1 && vi10==3) vi10 = 0;
- if(vi11==3 && vi10==1) vi11 = 0;
- }
-
- if(((vi00>vi01) && (vi10>vi11)) ||
- ((vi00<vi01) && (vi10<vi11)))
- count++;
- else
- count--;
- }
-
- efa = efa->next;
- }
-
- /* set up smoothness according voting of face in neighbourhood */
- if(smooth >= 0)
- eface->flag |= ME_SMOOTH;
- else
- eface->flag &= ~ME_SMOOTH;
-
- /* flip face, when too much "face normals" in neighbourhood is different */
- if(count > 0) {
- flipface(eface);
-#ifdef WITH_VERSE
- if(eface->vface) {
- struct VNode *vnode;
- struct VLayer *vlayer;
- vnode = (VNode*)((Mesh*)G.obedit->data)->vnode;
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
- add_item_to_send_queue(&(vlayer->queue), (void*)eface->vface, VERSE_FACE);
- }
-#endif
- }
-}
-
-void addfaces_from_edgenet(void)
-{
- EditVert *eve1, *eve2, *eve3, *eve4;
- EditMesh *em= G.editMesh;
-
- for(eve1= em->verts.first; eve1; eve1= eve1->next) {
- for(eve2= em->verts.first; (eve1->f & 1) && eve2; eve2= eve2->next) {
- if(findedgelist(eve1,eve2)) {
- for(eve3= em->verts.first; (eve2->f & 1) && eve3; eve3= eve3->next) {
- if((eve2!=eve3 && (eve3->f & 1) && findedgelist(eve1,eve3))) {
- EditEdge *sh_edge= NULL;
- EditVert *sh_vert= NULL;
-
- sh_edge= findedgelist(eve2,eve3);
-
- if(sh_edge) { /* Add a triangle */
- if(!exist_face_overlaps(eve1,eve2,eve3,NULL))
- fix_new_face(addfacelist(eve1,eve2,eve3,NULL,NULL,NULL));
- }
- else { /* Check for a shared vertex */
- for(eve4= em->verts.first; eve4; eve4= eve4->next) {
- if(eve4!=eve1 && eve4!=eve2 && eve4!=eve3 && (eve4->f & 1) &&
- !findedgelist(eve1,eve4) && findedgelist(eve2,eve4) &&
- findedgelist(eve3,eve4)) {
- sh_vert= eve4;
- break;
- }
- }
-
- if(sh_vert) {
- if(sh_vert) {
- if(!exist_face_overlaps(eve1,eve2,eve4,eve3))
- fix_new_face(addfacelist(eve1,eve2,eve4,eve3,NULL,NULL));
- }
- }
- }
- }
- }
- }
- }
- }
-
- countall();
-
- EM_select_flush();
-
- BIF_undo_push("Add faces");
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-void addedgeface_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *neweve[4];
- EditEdge *eed;
- EditFace *efa;
- short amount=0;
-
- if( (G.vd->lay & G.obedit->lay)==0 ) return;
- if(multires_test()) return;
-
- /* how many selected ? */
- if(G.scene->selectmode & SCE_SELECT_EDGE) {
- /* in edge mode finding selected vertices means flushing down edge codes... */
- /* can't make face with only edge selection info... */
- EM_selectmode_set();
- }
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
- amount++;
- if(amount>4) break;
- neweve[amount-1]= eve;
- }
- }
-
- if(amount==2) {
- eed= addedgelist(neweve[0], neweve[1], NULL);
- EM_select_edge(eed, 1);
- BIF_undo_push("Add edge");
- allqueue(REDRAWVIEW3D, 0);
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- return;
- }
- else if(amount > 4) {
-
-#ifndef DISABLE_PYTHON
- /* Python Menu */
- BPyMenu *pym;
-#endif
- char menu_number[3];
- int i=0, has_pymenu=0, ret;
-
- /* facemenu, will add python items */
- char facemenu[4096]= "Make Faces%t|Auto%x1|Make FGon%x2|Clear FGon%x3";
-
-#ifndef DISABLE_PYTHON
- /* note that we account for the 10 previous entries with i+4: */
- for (pym = BPyMenuTable[PYMENU_MESHFACEKEY]; pym; pym = pym->next, i++) {
-
- if (!has_pymenu) {
- strcat(facemenu, "|%l");
- has_pymenu = 1;
- }
-
- strcat(facemenu, "|");
- strcat(facemenu, pym->name);
- strcat(facemenu, " %x");
- sprintf(menu_number, "%d", i+4);
- strcat(facemenu, menu_number);
- }
-#endif
- ret= pupmenu(facemenu);
-
- if(ret==1) addfaces_from_edgenet();
- else if(ret==2) make_fgon(1);
- else if(ret==3) make_fgon(0);
-#ifndef DISABLE_PYTHON
- else if (ret >= 4) {
- BPY_menu_do_python(PYMENU_MESHFACEKEY, ret - 4);
- return;
- }
-#endif
- return;
- }
- else if(amount<2) {
- error("Incorrect number of vertices to make edge/face");
- return;
- }
-
- efa= NULL; // check later
-
- if(amount==3) {
-
- if(exist_face_overlaps(neweve[0], neweve[1], neweve[2], NULL)==0) {
- efa= addfacelist(neweve[0], neweve[1], neweve[2], 0, NULL, NULL);
- EM_select_face(efa, 1);
- }
- else error("The selected vertices already form a face");
- }
- else if(amount==4) {
- /* this test survives when theres 2 triangles */
- if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) {
- int tria= 0;
-
- /* remove trias if they exist, 4 cases.... */
- if(exist_face(neweve[0], neweve[1], neweve[2], NULL)) tria++;
- if(exist_face(neweve[0], neweve[1], neweve[3], NULL)) tria++;
- if(exist_face(neweve[0], neweve[2], neweve[3], NULL)) tria++;
- if(exist_face(neweve[1], neweve[2], neweve[3], NULL)) tria++;
-
- if(tria==2) join_triangles();
- else if(exist_face_overlaps(neweve[0], neweve[1], neweve[2], neweve[3])==0) {
- /* If there are 4 Verts, But more selected edges, we need to call addfaces_from_edgenet */
- EditEdge *eedcheck;
- int count;
- count = 0;
- for(eedcheck= em->edges.first; eedcheck; eedcheck= eedcheck->next) {
- if(eedcheck->f & SELECT) {
- count++;
- }
- }
-
- if(count++ > 4){
- addfaces_from_edgenet();
- return;
- } else {
- /* if 4 edges exist, we just create the face, convex or not */
- efa= addface_from_edges();
- if(efa==NULL) {
-
- /* the order of vertices can be anything, 6 cases to check */
- if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) {
- efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[2]->co, neweve[3]->co, neweve[1]->co) ) {
- efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) {
- efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[1]->co, neweve[3]->co, neweve[2]->co) ) {
- efa= addfacelist(neweve[0], neweve[1], neweve[3], neweve[2], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[3]->co, neweve[2]->co, neweve[1]->co) ) {
- efa= addfacelist(neweve[0], neweve[3], neweve[2], neweve[1], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[3]->co, neweve[1]->co, neweve[2]->co) ) {
- efa= addfacelist(neweve[0], neweve[3], neweve[1], neweve[2], NULL, NULL);
- }
- else printf("cannot find nice quad from concave set of vertices\n");
- }
- }
- }
- else error("The selected vertices already form a face");
- }
- else error("The selected vertices already form a face");
- }
-
- if(efa) {
- EM_select_face(efa, 1);
-
- fix_new_face(efa);
-
- recalc_editnormals();
- BIF_undo_push("Add face");
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-
-void adduplicate_mesh(void)
-{
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- waitcursor(1);
-
- adduplicateflag(SELECT);
-
- waitcursor(0);
- countall();
-
- /* We need to force immediate calculation here because
- * transform may use derived objects (which are now stale).
- *
- * This shouldn't be necessary, derived queries should be
- * automatically building this data if invalid. Or something.
- */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- object_handle_update(G.obedit);
-
- BIF_TransformSetUndo("Add Duplicate");
- initTransform(TFM_TRANSLATION, CTX_NO_PET);
- Transform();
-}
-
-/* check whether an object to add mesh to exists, if not, create one
-* returns 1 if new object created, else 0 */
-int confirm_objectExists( Mesh **me, float mat[][3] )
-{
- int newob = 0;
-
- /* deselectall */
- EM_clear_flag_all(SELECT);
-
- /* if no obedit: new object and enter editmode */
- if(G.obedit==NULL) {
- /* add_object actually returns an object ! :-)
- But it also stores the added object struct in
- G.scene->basact->object (BASACT->object) */
-
- add_object_draw(OB_MESH);
-
- G.obedit= BASACT->object;
-
- where_is_object(G.obedit);
-
- make_editMesh();
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- newob= 1;
- }
- *me = G.obedit->data;
-
- /* imat and center and size */
- Mat3CpyMat4(mat, G.obedit->obmat);
-
- return newob;
-}
-
-// HACK: these can also be found in cmoview.tga.c, but are here so that they can be found by linker
-// this hack is only used so that scons+mingw + split-sources hack works
- // ------------------------------- start copied code
-/* these are not the monkeys you are looking for */
-int monkeyo= 4;
-int monkeynv= 271;
-int monkeynf= 250;
-signed char monkeyv[271][3]= {
-{-71,21,98},{-63,12,88},{-57,7,74},{-82,-3,79},{-82,4,92},
-{-82,17,100},{-92,21,102},{-101,12,95},{-107,7,83},
-{-117,31,84},{-109,31,95},{-96,31,102},{-92,42,102},
-{-101,50,95},{-107,56,83},{-82,66,79},{-82,58,92},
-{-82,46,100},{-71,42,98},{-63,50,88},{-57,56,74},
-{-47,31,72},{-55,31,86},{-67,31,97},{-66,31,99},
-{-70,43,100},{-82,48,103},{-93,43,105},{-98,31,105},
-{-93,20,105},{-82,31,106},{-82,15,103},{-70,20,100},
-{-127,55,95},{-127,45,105},{-127,-87,94},{-127,-41,100},
-{-127,-24,102},{-127,-99,92},{-127,52,77},{-127,73,73},
-{-127,115,-70},{-127,72,-109},{-127,9,-106},{-127,-49,-45},
-{-101,-24,72},{-87,-56,73},{-82,-89,73},{-80,-114,68},
-{-85,-121,67},{-104,-124,71},{-127,-126,74},{-71,-18,68},
-{-46,-5,69},{-21,19,57},{-17,55,76},{-36,62,80},
-{-64,77,88},{-86,97,94},{-107,92,97},{-119,63,96},
-{-106,53,99},{-111,39,98},{-101,12,95},{-79,2,90},
-{-64,8,86},{-47,24,83},{-45,38,83},{-50,48,85},
-{-72,56,92},{-95,60,97},{-127,-98,94},{-113,-92,94},
-{-112,-107,91},{-119,-113,89},{-127,-114,88},{-127,-25,96},
-{-127,-18,95},{-114,-19,95},{-111,-29,96},{-116,-37,95},
-{-76,-6,86},{-48,7,80},{-34,26,77},{-32,48,84},
-{-39,53,93},{-71,70,102},{-87,82,107},{-101,79,109},
-{-114,55,108},{-111,-13,104},{-100,-57,91},{-95,-90,88},
-{-93,-105,85},{-97,-117,81},{-106,-119,81},{-127,-121,82},
-{-127,6,93},{-127,27,98},{-85,61,95},{-106,18,96},
-{-110,27,97},{-112,-88,94},{-117,-57,96},{-127,-57,96},
-{-127,-42,95},{-115,-35,100},{-110,-29,102},{-113,-17,100},
-{-122,-16,100},{-127,-26,106},{-121,-19,104},{-115,-20,104},
-{-113,-29,106},{-117,-32,103},{-127,-37,103},{-94,-40,71},
-{-106,-31,91},{-104,-40,91},{-97,-32,71},{-127,-112,88},
-{-121,-111,88},{-115,-105,91},{-115,-95,93},{-127,-100,84},
-{-115,-96,85},{-115,-104,82},{-121,-109,81},{-127,-110,81},
-{-105,28,100},{-103,20,99},{-84,55,97},{-92,54,99},
-{-73,51,99},{-55,45,89},{-52,37,88},{-53,25,87},
-{-66,13,92},{-79,8,95},{-98,14,100},{-104,38,100},
-{-100,48,100},{-97,46,97},{-102,38,97},{-96,16,97},
-{-79,11,93},{-68,15,90},{-57,27,86},{-56,36,86},
-{-59,43,87},{-74,50,96},{-91,51,98},{-84,52,96},
-{-101,22,96},{-102,29,96},{-113,59,78},{-102,85,79},
-{-84,88,76},{-65,71,71},{-40,58,63},{-25,52,59},
-{-28,21,48},{-50,0,53},{-71,-12,60},{-127,115,37},
-{-127,126,-10},{-127,-25,-86},{-127,-59,24},{-127,-125,59},
-{-127,-103,44},{-127,-73,41},{-127,-62,36},{-18,30,7},
-{-17,41,-6},{-28,34,-56},{-68,56,-90},{-33,-6,9},
-{-51,-16,-21},{-45,-1,-55},{-84,7,-85},{-97,-45,52},
-{-104,-53,33},{-90,-91,49},{-95,-64,50},{-85,-117,51},
-{-109,-97,47},{-111,-69,46},{-106,-121,56},{-99,-36,55},
-{-100,-29,60},{-101,-22,64},{-100,-50,21},{-89,-40,-34},
-{-83,-19,-69},{-69,111,-49},{-69,119,-9},{-69,109,30},
-{-68,67,55},{-34,52,43},{-46,58,36},{-45,90,7},
-{-25,72,16},{-25,79,-15},{-45,96,-25},{-45,87,-57},
-{-25,69,-46},{-48,42,-75},{-65,3,-70},{-22,42,-26},
-{-75,-22,19},{-72,-25,-27},{-13,52,-30},{-28,-18,-16},
-{6,-13,-42},{37,7,-55},{46,41,-54},{31,65,-54},
-{4,61,-40},{3,53,-37},{25,56,-50},{35,37,-52},
-{28,10,-52},{5,-5,-39},{-21,-9,-17},{-9,46,-28},
-{-6,39,-37},{-14,-3,-27},{6,0,-47},{25,12,-57},
-{31,32,-57},{23,46,-56},{4,44,-46},{-19,37,-27},
-{-20,22,-35},{-30,12,-35},{-22,11,-35},{-19,2,-35},
-{-23,-2,-35},{-34,0,-9},{-35,-3,-22},{-35,5,-24},
-{-25,26,-27},{-13,31,-34},{-13,30,-41},{-23,-2,-41},
-{-18,2,-41},{-21,10,-41},{-29,12,-41},{-19,22,-41},
-{6,42,-53},{25,44,-62},{34,31,-63},{28,11,-62},
-{7,0,-54},{-14,-2,-34},{-5,37,-44},{-13,14,-42},
-{-7,8,-43},{1,16,-47},{-4,22,-45},{3,30,-48},
-{8,24,-49},{15,27,-50},{12,35,-50},{4,56,-62},
-{33,60,-70},{48,38,-64},{41,7,-68},{6,-11,-63},
-{-26,-16,-42},{-17,49,-49},
-};
-
-signed char monkeyf[250][4]= {
-{27,4,5,26}, {25,4,5,24}, {3,6,5,4}, {1,6,5,2}, {5,6,7,4},
-{3,6,7,2}, {5,8,7,6}, {3,8,7,4}, {7,8,9,6},
-{5,8,9,4}, {7,10,9,8}, {5,10,9,6}, {9,10,11,8},
-{7,10,11,6}, {9,12,11,10}, {7,12,11,8}, {11,6,13,12},
-{5,4,13,12}, {3,-2,13,12}, {-3,-4,13,12}, {-5,-10,13,12},
-{-11,-12,14,12}, {-13,-18,14,13}, {-19,4,5,13}, {10,12,4,4},
-{10,11,9,9}, {8,7,9,9}, {7,5,6,6}, {6,3,4,4},
-{5,1,2,2}, {4,-1,0,0}, {3,-3,-2,-2}, {22,67,68,23},
-{20,65,66,21}, {18,63,64,19}, {16,61,62,17}, {14,59,60,15},
-{12,19,48,57}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47},
-{18,19,48,47}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47},
-{18,19,48,47}, {18,-9,-8,47}, {18,27,45,46}, {26,55,43,44},
-{24,41,42,54}, {22,39,40,23}, {20,37,38,21}, {18,35,36,19},
-{16,33,34,17}, {14,31,32,15}, {12,39,30,13}, {11,48,45,38},
-{8,36,-19,9}, {8,-20,44,47}, {42,45,46,43}, {18,19,40,39},
-{16,17,38,37}, {14,15,36,35}, {32,44,43,33}, {12,33,32,42},
-{19,44,43,42}, {40,41,42,-27}, {8,9,39,-28}, {15,43,42,16},
-{13,43,42,14}, {11,43,42,12}, {9,-30,42,10}, {37,12,38,-32},
-{-33,37,45,46}, {-33,40,41,39}, {38,40,41,37}, {36,40,41,35},
-{34,40,41,33}, {36,39,38,37}, {35,40,39,38}, {1,2,14,21},
-{1,2,40,13}, {1,2,40,39}, {1,24,12,39}, {-34,36,38,11},
-{35,38,36,37}, {-37,8,35,37}, {-11,-12,-45,40}, {-11,-12,39,38},
-{-11,-12,37,36}, {-11,-12,35,34}, {33,34,40,41}, {33,34,38,39},
-{33,34,36,37}, {33,-52,34,35}, {33,37,36,34}, {33,35,34,34},
-{8,7,37,36}, {-32,7,35,46}, {-34,-33,45,46}, {4,-33,43,34},
-{-34,-33,41,42}, {-34,-33,39,40}, {-34,-33,37,38}, {-34,-33,35,36},
-{-34,-33,33,34}, {-34,-33,31,32}, {-34,-4,28,30}, {-5,-34,28,27},
-{-35,-44,36,27}, {26,35,36,45}, {24,25,44,45}, {25,23,44,42},
-{25,24,41,40}, {25,24,39,38}, {25,24,37,36}, {25,24,35,34},
-{25,24,33,32}, {25,24,31,30}, {15,24,29,38}, {25,24,27,26},
-{23,12,37,26}, {11,12,35,36}, {-86,-59,36,-80}, {-60,-61,36,35},
-{-62,-63,36,35}, {-64,-65,36,35}, {-66,-67,36,35}, {-68,-69,36,35},
-{-70,-71,36,35}, {-72,-73,36,35}, {-74,-75,36,35}, {42,43,53,58},
-{40,41,57,56}, {38,39,55,57}, {-81,-80,37,56}, {-83,-82,55,52},
-{-85,-84,51,49}, {-87,-86,48,49}, {47,50,51,48}, {46,48,51,49},
-{43,46,49,44}, {-92,-91,45,42}, {-23,49,50,-20}, {-94,40,48,-24},
-{-96,-22,48,49}, {-97,48,21,-90}, {-100,36,50,23}, {22,49,48,-100},
-{-101,47,46,22}, {21,45,35,25}, {33,34,44,41}, {13,14,28,24},
-{-107,26,30,-106}, {14,46,45,15}, {14,44,43,-110}, {-111,42,23,-110},
-{6,7,45,46}, {45,44,47,46}, {45,46,47,48}, {47,46,49,48},
-{17,49,47,48}, {17,36,46,48}, {35,36,44,45}, {35,36,40,43},
-{35,36,38,39}, {-4,-3,37,35}, {-123,34,33,1}, {-9,-8,-7,-6},
-{-10,-7,32,-125}, {-127,-11,-126,-126}, {-7,-6,5,31}, {4,5,33,30},
-{4,39,33,32}, {4,35,32,38}, {20,21,39,38}, {4,37,38,5},
-{-11,-10,36,3}, {-11,15,14,35}, {13,16,34,34}, {-13,14,13,13},
-{-3,1,30,29}, {-3,28,29,1}, {-2,31,28,-1}, {12,13,27,30},
-{-2,26,12,12}, {35,29,42,36}, {34,35,36,33}, {32,35,36,31},
-{30,35,36,29}, {28,35,36,27}, {26,35,36,25}, {34,39,38,35},
-{32,39,38,33}, {30,39,38,31}, {28,39,38,29}, {26,39,38,27},
-{25,31,32,38}, {-18,-17,45,44}, {-18,17,28,44}, {-24,-20,42,-23},
-{11,35,27,14}, {25,28,39,41}, {37,41,40,38}, {34,40,36,35},
-{32,40,39,33}, {30,39,31,40}, {21,29,39,22}, {-31,37,28,4},
-{-32,33,35,36}, {32,33,34,34}, {18,35,36,48}, {34,25,40,35},
-{24,25,38,39}, {24,25,36,37}, {24,25,34,35}, {24,25,32,33},
-{24,13,41,31}, {17,11,41,35}, {15,16,34,35}, {13,14,34,35},
-{11,12,34,35}, {9,10,34,35}, {7,8,34,35}, {26,25,37,36},
-{35,36,37,38}, {37,36,39,38}, {37,38,39,40}, {25,31,36,39},
-{18,34,35,30}, {17,22,30,33}, {19,29,21,20}, {16,26,29,17},
-{24,29,28,25}, {22,31,28,23}, {20,31,30,21}, {18,31,30,19},
-{16,30,17,17}, {-21,-22,35,34}, {-21,-22,33,32}, {-21,-22,31,30},
-{-21,-22,29,28}, {-21,-22,27,26}, {-28,-22,25,31}, {24,28,29,30},
-{23,24,26,27}, {23,24,25,25}, {-69,-35,-32,27}, {-70,26,25,-66},
-{-68,-67,24,-33},
-};
- // ------------------------------- end copied code
-
-
-void make_prim(int type, float imat[3][3], int tot, int seg,
- int subdiv, float dia, float d, int ext, int fill,
- float cent[3])
-{
- /*
- * type - for the type of shape
- * dia - the radius for cone,sphere cylinder etc.
- * d - depth for the cone
- * ext - ?
- * fill - end capping, and option to fill in circle
- * cent[3] - center of the data.
- * */
-
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1=NULL, *v2, *v3, *v4=NULL, *vtop, *vdown;
- float phi, phid, vec[3];
- float q[4], cmat[3][3], nor[3]= {0.0, 0.0, 0.0};
- short a, b;
-
- phid= 2*M_PI/tot;
- phi= .25*M_PI;
-
- switch(type) {
- case 10: /* grid */
- /* clear flags */
- eve= em->verts.first;
- while(eve) {
- eve->f= 0;
- eve= eve->next;
- }
- /* one segment first: the X axis */
- phi= 1.0;
- phid= 2.0/((float)tot-1);
- for(a=0;a<tot;a++) {
- vec[0]= cent[0]+dia*phi;
- vec[1]= cent[1]- dia;
- vec[2]= cent[2];
- Mat3MulVecfl(imat,vec);
- eve= addvertlist(vec, NULL);
- eve->f= 1+2+4;
- if (a) {
- addedgelist(eve->prev, eve, NULL);
- }
- phi-=phid;
- }
- /* extrude and translate */
- vec[0]= vec[2]= 0.0;
- vec[1]= dia*phid;
- Mat3MulVecfl(imat, vec);
- for(a=0;a<seg-1;a++) {
- extrudeflag_vert(2, nor); // nor unused
- translateflag(2, vec);
- }
- break;
- case 11: /* UVsphere */
-
- /* clear all flags */
- eve= em->verts.first;
- while(eve) {
- eve->f= 0;
- eve= eve->next;
- }
-
- /* one segment first */
- phi= 0;
- phid/=2;
- for(a=0; a<=tot; a++) {
- vec[0]= dia*sin(phi);
- vec[1]= 0.0;
- vec[2]= dia*cos(phi);
- eve= addvertlist(vec, NULL);
- eve->f= 1+2+4;
- if(a==0) v1= eve;
- else addedgelist(eve->prev, eve, NULL);
- phi+= phid;
- }
-
- /* extrude and rotate */
- phi= M_PI/seg;
- q[0]= cos(phi);
- q[3]= sin(phi);
- q[1]=q[2]= 0;
- QuatToMat3(q, cmat);
-
- for(a=0; a<seg; a++) {
- extrudeflag_vert(2, nor); // nor unused
- rotateflag(2, v1->co, cmat);
- }
-
- removedoublesflag(4, 0, 0.0001);
-
- /* and now do imat */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- VecAddf(eve->co,eve->co,cent);
- Mat3MulVecfl(imat,eve->co);
- }
- eve= eve->next;
- }
- break;
- case 12: /* Icosphere */
- {
- EditVert *eva[12];
- EditEdge *eed;
-
- /* clear all flags */
- eve= em->verts.first;
- while(eve) {
- eve->f= 0;
- eve= eve->next;
- }
- dia/=200;
- for(a=0;a<12;a++) {
- vec[0]= dia*icovert[a][0];
- vec[1]= dia*icovert[a][1];
- vec[2]= dia*icovert[a][2];
- eva[a]= addvertlist(vec, NULL);
- eva[a]->f= 1+2;
- }
- for(a=0;a<20;a++) {
- EditFace *evtemp;
- v1= eva[ icoface[a][0] ];
- v2= eva[ icoface[a][1] ];
- v3= eva[ icoface[a][2] ];
- evtemp = addfacelist(v1, v2, v3, 0, NULL, NULL);
- evtemp->e1->f = 1+2;
- evtemp->e2->f = 1+2;
- evtemp->e3->f = 1+2;
- }
-
- dia*=200;
- for(a=1; a<subdiv; a++) esubdivideflag(2, dia, 0,1,0);
- /* and now do imat */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & 2) {
- VecAddf(eve->co,eve->co,cent);
- Mat3MulVecfl(imat,eve->co);
- }
- eve= eve->next;
- }
-
- // Clear the flag 2 from the edges
- for(eed=em->edges.first;eed;eed=eed->next){
- if(eed->f & 2){
- eed->f &= !2;
- }
- }
- }
- break;
- case 13: /* Monkey */
- {
- //extern int monkeyo, monkeynv, monkeynf;
- //extern signed char monkeyf[][4];
- //extern signed char monkeyv[][3];
- EditVert **tv= MEM_mallocN(sizeof(*tv)*monkeynv*2, "tv");
- int i;
-
- for (i=0; i<monkeynv; i++) {
- float v[3];
- v[0]= (monkeyv[i][0]+127)/128.0, v[1]= monkeyv[i][1]/128.0, v[2]= monkeyv[i][2]/128.0;
- tv[i]= addvertlist(v, NULL);
- tv[i]->f |= SELECT;
- tv[monkeynv+i]= (fabs(v[0]= -v[0])<0.001)?tv[i]:addvertlist(v, NULL);
- tv[monkeynv+i]->f |= SELECT;
- }
- for (i=0; i<monkeynf; i++) {
- addfacelist(tv[monkeyf[i][0]+i-monkeyo], tv[monkeyf[i][1]+i-monkeyo], tv[monkeyf[i][2]+i-monkeyo], (monkeyf[i][3]!=monkeyf[i][2])?tv[monkeyf[i][3]+i-monkeyo]:NULL, NULL, NULL);
- addfacelist(tv[monkeynv+monkeyf[i][2]+i-monkeyo], tv[monkeynv+monkeyf[i][1]+i-monkeyo], tv[monkeynv+monkeyf[i][0]+i-monkeyo], (monkeyf[i][3]!=monkeyf[i][2])?tv[monkeynv+monkeyf[i][3]+i-monkeyo]:NULL, NULL, NULL);
- }
-
- MEM_freeN(tv);
-
- /* and now do imat */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
- VecAddf(eve->co,eve->co,cent);
- Mat3MulVecfl(imat,eve->co);
- }
- }
- recalc_editnormals();
- }
- break;
- default: /* all types except grid, sphere... */
- if(ext==0 && type!=7) d= 0;
-
- /* vertices */
- vtop= vdown= v1= v2= 0;
- for(b=0; b<=ext; b++) {
- for(a=0; a<tot; a++) {
-
- vec[0]= cent[0]+dia*sin(phi);
- vec[1]= cent[1]+dia*cos(phi);
- vec[2]= cent[2]+d;
-
- Mat3MulVecfl(imat, vec);
- eve= addvertlist(vec, NULL);
- eve->f= SELECT;
- if(a==0) {
- if(b==0) v1= eve;
- else v2= eve;
- }
- phi+=phid;
- }
- d= -d;
- }
- /* center vertices */
- /* type 7, a cone can only have 1 one side filled
- * if the cone has no capping, dont add vtop */
- if((fill && type>1) || type == 7) {
- VECCOPY(vec,cent);
- vec[2]-= -d;
- Mat3MulVecfl(imat,vec);
- vdown= addvertlist(vec, NULL);
- if((ext || type==7) && fill) {
- VECCOPY(vec,cent);
- vec[2]-= d;
- Mat3MulVecfl(imat,vec);
- vtop= addvertlist(vec, NULL);
- }
- } else {
- vdown= v1;
- vtop= v2;
- }
- if(vtop) vtop->f= SELECT;
- if(vdown) vdown->f= SELECT;
-
- /* top and bottom face */
- if(fill || type==7) {
- if(tot==4 && (type==0 || type==1)) {
- v3= v1->next->next;
- if(ext) v4= v2->next->next;
-
- addfacelist(v3, v1->next, v1, v3->next, NULL, NULL);
- if(ext) addfacelist(v2, v2->next, v4, v4->next, NULL, NULL);
-
- }
- else {
- v3= v1;
- v4= v2;
- for(a=1; a<tot; a++) {
- addfacelist(vdown, v3, v3->next, 0, NULL, NULL);
- v3= v3->next;
- if(ext && fill) {
- addfacelist(vtop, v4, v4->next, 0, NULL, NULL);
- v4= v4->next;
- }
- }
- if(type>1) {
- addfacelist(vdown, v3, v1, 0, NULL, NULL);
- if(ext) addfacelist(vtop, v4, v2, 0, NULL, NULL);
- }
- }
- }
- else if(type==4) { /* we need edges for a circle */
- v3= v1;
- for(a=1;a<tot;a++) {
- addedgelist(v3, v3->next, NULL);
- v3= v3->next;
- }
- addedgelist(v3, v1, NULL);
- }
- /* side faces */
- if(ext) {
- v3= v1;
- v4= v2;
- for(a=1; a<tot; a++) {
- addfacelist(v3, v3->next, v4->next, v4, NULL, NULL);
- v3= v3->next;
- v4= v4->next;
- }
- addfacelist(v3, v1, v2, v4, NULL, NULL);
- }
- else if(type==7 && fill) {
- /* add the bottom flat area of the cone
- * if capping is disabled dont bother */
- v3= v1;
- for(a=1; a<tot; a++) {
- addfacelist(vtop, v3->next, v3, 0, NULL, NULL);
- v3= v3->next;
- }
- addfacelist(vtop, v1, v3, 0, NULL, NULL);
- }
- }
- /* simple selection flush OK, based on fact it's a single model */
- EM_select_flush(); /* flushes vertex -> edge -> face selection */
-
- if(type!=0 && type!=13)
- righthandfaces(1); /* otherwise monkey has eyes in wrong direction */
-}
-
-void add_primitiveMesh(int type)
-{
- Mesh *me;
- float *curs, d, dia, phi, phid, cent[3], imat[3][3], mat[3][3];
- float cmat[3][3];
- static int tot=32, seg=32, subdiv=2,
- /* so each type remembers its fill setting */
- fill_circle=0, fill_cone=1, fill_cylinder=1;
-
- int ext=0, fill=0, totoud, newob=0;
- char *undostr="Add Primitive";
- char *name=NULL;
-
- if(G.scene->id.lib) return;
-
- /* this function also comes from an info window */
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
- if(G.vd==0) return;
-
- if (G.obedit && G.obedit->type==OB_MESH && multires_test()) return;
-
- /* if editmode exists for other type, it exits */
- check_editmode(OB_MESH);
-
- if(G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) {
- G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT);
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
- }
-
- totoud= tot; /* store, and restore when cube/plane */
-
- dia= G.vd->grid;
- d= G.vd->grid;
-
- /* ext==extrudeflag, tot==amount of vertices in basis */
- switch(type) {
- case 0: /* plane */
- tot= 4;
- ext= 0;
- fill= 1;
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Plane";
- undostr="Add Plane";
- break;
- case 1: /* cube */
- tot= 4;
- ext= 1;
- fill= 1;
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Cube";
- undostr="Add Cube";
- break;
- case 4: /* circle */
- add_numbut(0, NUM|INT, "Vertices:", 3, 500, &tot, NULL);
- add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL);
- add_numbut(2, TOG|INT, "Fill", 0, 0, &(fill_circle), NULL);
- if (!(do_clever_numbuts("Add Circle", 3, REDRAW))) return;
- ext= 0;
- fill = fill_circle;
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Circle";
- undostr="Add Circle";
- break;
- case 5: /* cylinder */
- d*=2;
- add_numbut(0, NUM|INT, "Vertices:", 2, 500, &tot, NULL);
- add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL);
- add_numbut(2, NUM|FLO, "Depth:", 0.001*G.vd->grid, 100*G.vd->grid, &d, NULL);
- add_numbut(3, TOG|INT, "Cap Ends", 0, 0, &(fill_cylinder), NULL);
- if (!(do_clever_numbuts("Add Cylinder", 4, REDRAW))) return;
- ext= 1;
- fill = fill_cylinder;
- d/=2;
- newob = confirm_objectExists( &me, mat );
- if(newob) {
- if (fill) name = "Cylinder";
- else name = "Tube";
- }
- undostr="Add Cylinder";
- break;
- case 7: /* cone */
- d*=2;
- add_numbut(0, NUM|INT, "Vertices:", 2, 500, &tot, NULL);
- add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL);
- add_numbut(2, NUM|FLO, "Depth:", 0.001*G.vd->grid, 100*G.vd->grid, &d, NULL);
- add_numbut(3, TOG|INT, "Cap End", 0, 0, &(fill_cone), NULL);
- if (!(do_clever_numbuts("Add Cone", 4, REDRAW))) return;
- d/=2;
- ext= 0;
- fill = fill_cone;
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Cone";
- undostr="Add Cone";
- break;
- case 10: /* grid */
- add_numbut(0, NUM|INT, "X res:", 3, 1000, &tot, NULL);
- add_numbut(1, NUM|INT, "Y res:", 3, 1000, &seg, NULL);
- if (!(do_clever_numbuts("Add Grid", 2, REDRAW))) return;
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Grid";
- undostr="Add Grid";
- break;
- case 11: /* UVsphere */
- add_numbut(0, NUM|INT, "Segments:", 3, 500, &seg, NULL);
- add_numbut(1, NUM|INT, "Rings:", 3, 500, &tot, NULL);
- add_numbut(2, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL);
-
- if (!(do_clever_numbuts("Add UV Sphere", 3, REDRAW))) return;
-
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Sphere";
- undostr="Add UV Sphere";
- break;
- case 12: /* Icosphere */
- add_numbut(0, NUM|INT, "Subdivision:", 1, 8, &subdiv, NULL);
- add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL);
- if (!(do_clever_numbuts("Add Ico Sphere", 2, REDRAW))) return;
-
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Sphere";
- undostr="Add Ico Sphere";
- break;
- case 13: /* Monkey */
- newob = confirm_objectExists( &me, mat );
- if(newob) name = "Suzanne";
- undostr="Add Monkey";
- break;
- default:
- newob = confirm_objectExists( &me, mat );
- break;
- }
-
- if( name!=NULL ) {
- rename_id((ID *)G.obedit, name );
- rename_id((ID *)me, name );
- }
-
- d = -d;
- curs= give_cursor();
- VECCOPY(cent, curs);
- cent[0]-= G.obedit->obmat[3][0];
- cent[1]-= G.obedit->obmat[3][1];
- cent[2]-= G.obedit->obmat[3][2];
-
- if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(imat, G.vd->viewmat);
- else Mat3One(imat);
- Mat3MulVecfl(imat, cent);
- Mat3MulMat3(cmat, imat, mat);
- Mat3Inv(imat,cmat);
-
-
- if(type == 0 || type == 1) /* plane, cube (diameter of 1.41 makes it unit size) */
- dia *= sqrt(2.0);
-
- phid= 2*M_PI/tot;
- phi= .25*M_PI;
-
- make_prim(type, imat, tot, seg, subdiv, dia, d, ext, fill, cent);
-
- if(type<2) tot = totoud;
-
- /* simple selection flush OK, based on fact it's a single model */
- EM_select_flush(); // flushes vertex -> edge -> face selection
-
- if(type!=0 && type!=13) righthandfaces(1); /* otherwise monkey has eyes in wrong direction... */
- countall();
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- /* if a new object was created, it stores it in Mesh, for reload original data and undo */
- if ( !(newob) || U.flag & USER_ADD_EDITMODE) {
- if(newob) load_editMesh();
- } else {
- exit_editmode(2);
- }
-
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
- allqueue(REDRAWALL, 0);
-
- BIF_undo_push(undostr);
-}
-
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c
deleted file mode 100644
index cace0d350b0..00000000000
--- a/source/blender/src/editmesh_lib.c
+++ /dev/null
@@ -1,2311 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
-
-editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data
-
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editmesh.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_edit.h"
-
-#include "editmesh.h"
-
-/* this replaces the active flag used in uv/face mode */
-void EM_set_actFace(EditFace *efa)
-{
- G.editMesh->act_face = efa;
-}
-
-EditFace * EM_get_actFace(int sloppy)
-{
- if (G.editMesh->act_face) {
- return G.editMesh->act_face;
- } else if (sloppy) {
- EditFace *efa= NULL;
- EditSelection *ese;
-
- ese = G.editMesh->selected.last;
- for (; ese; ese=ese->prev){
- if(ese->type == EDITFACE) {
- efa = (EditFace *)ese->data;
-
- if (efa->h) efa= NULL;
- else break;
- }
- }
- if (efa==NULL) {
- for (efa= G.editMesh->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT)
- break;
- }
- }
- return efa; /* can still be null */
- }
- return NULL;
-}
-
-int EM_get_actSelection(EditSelection *ese)
-{
- EditSelection *ese_last = G.editMesh->selected.last;
- EditFace *efa = EM_get_actFace(0);
-
- ese->next = ese->prev = NULL;
-
- if (ese_last) {
- if (ese_last->type == EDITFACE) { /* if there is an active face, use it over the last selected face */
- if (efa) {
- ese->data = (void *)efa;
- } else {
- ese->data = ese_last->data;
- }
- ese->type = EDITFACE;
- } else {
- ese->data = ese_last->data;
- ese->type = ese_last->type;
- }
- } else if (efa) { /* no */
- ese->data = (void *)efa;
- ese->type = EDITFACE;
- } else {
- ese->data = NULL;
- return 0;
- }
- return 1;
-}
-
-/* ********* Selection History ************ */
-static int EM_check_selection(void *data)
-{
- EditSelection *ese;
-
- for(ese = G.editMesh->selected.first; ese; ese = ese->next){
- if(ese->data == data) return 1;
- }
-
- return 0;
-}
-
-void EM_remove_selection(void *data, int type)
-{
- EditSelection *ese;
- for(ese=G.editMesh->selected.first; ese; ese = ese->next){
- if(ese->data == data){
- BLI_freelinkN(&(G.editMesh->selected),ese);
- break;
- }
- }
-}
-
-void EM_store_selection(void *data, int type)
-{
- EditSelection *ese;
- if(!EM_check_selection(data)){
- ese = (EditSelection*) MEM_callocN( sizeof(EditSelection), "Edit Selection");
- ese->type = type;
- ese->data = data;
- BLI_addtail(&(G.editMesh->selected),ese);
- }
-}
-
-void EM_validate_selections(void)
-{
- EditSelection *ese, *nextese;
- EditMesh *em = G.editMesh;
- ese = em->selected.first;
- while(ese){
- nextese = ese->next;
- if(ese->type == EDITVERT && !(((EditVert*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese);
- else if(ese->type == EDITEDGE && !(((EditEdge*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese);
- else if(ese->type == EDITFACE && !(((EditFace*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese);
- ese = nextese;
- }
-}
-
-static void EM_strip_selections(void)
-{
- EditSelection *ese, *nextese;
- if(!(G.scene->selectmode & SCE_SELECT_VERTEX)){
- ese = G.editMesh->selected.first;
- while(ese){
- nextese = ese->next;
- if(ese->type == EDITVERT) BLI_freelinkN(&(G.editMesh->selected),ese);
- ese = nextese;
- }
- }
- if(!(G.scene->selectmode & SCE_SELECT_EDGE)){
- ese=G.editMesh->selected.first;
- while(ese){
- nextese = ese->next;
- if(ese->type == EDITEDGE) BLI_freelinkN(&(G.editMesh->selected), ese);
- ese = nextese;
- }
- }
- if(!(G.scene->selectmode & SCE_SELECT_FACE)){
- ese=G.editMesh->selected.first;
- while(ese){
- nextese = ese->next;
- if(ese->type == EDITFACE) BLI_freelinkN(&(G.editMesh->selected), ese);
- ese = nextese;
- }
- }
-}
-
-/* generic way to get data from an EditSelection type
-These functions were written to be used by the Modifier widget when in Rotate about active mode,
-but can be used anywhere.
-EM_editselection_center
-EM_editselection_normal
-EM_editselection_plane
-*/
-void EM_editselection_center(float *center, EditSelection *ese)
-{
- if (ese->type==EDITVERT) {
- EditVert *eve= ese->data;
- VecCopyf(center, eve->co);
- } else if (ese->type==EDITEDGE) {
- EditEdge *eed= ese->data;
- VecAddf(center, eed->v1->co, eed->v2->co);
- VecMulf(center, 0.5);
- } else if (ese->type==EDITFACE) {
- EditFace *efa= ese->data;
- VecCopyf(center, efa->cent);
- }
-}
-
-void EM_editselection_normal(float *normal, EditSelection *ese)
-{
- if (ese->type==EDITVERT) {
- EditVert *eve= ese->data;
- VecCopyf(normal, eve->no);
- } else if (ese->type==EDITEDGE) {
- EditEdge *eed= ese->data;
- float plane[3]; /* need a plane to correct the normal */
- float vec[3]; /* temp vec storage */
-
- VecAddf(normal, eed->v1->no, eed->v2->no);
- VecSubf(plane, eed->v2->co, eed->v1->co);
-
- /* the 2 vertex normals will be close but not at rightangles to the edge
- for rotate about edge we want them to be at right angles, so we need to
- do some extra colculation to correct the vert normals,
- we need the plane for this */
- Crossf(vec, normal, plane);
- Crossf(normal, plane, vec);
- Normalize(normal);
-
- } else if (ese->type==EDITFACE) {
- EditFace *efa= ese->data;
- VecCopyf(normal, efa->n);
- }
-}
-
-/* Calculate a plane that is rightangles to the edge/vert/faces normal
-also make the plane run allong an axis that is related to the geometry,
-because this is used for the manipulators Y axis.*/
-void EM_editselection_plane(float *plane, EditSelection *ese)
-{
- if (ese->type==EDITVERT) {
- EditVert *eve= ese->data;
- float vec[3]={0,0,0};
-
- if (ese->prev) { /*use previously selected data to make a usefull vertex plane */
- EM_editselection_center(vec, ese->prev);
- VecSubf(plane, vec, eve->co);
- } else {
- /* make a fake plane thats at rightangles to the normal
- we cant make a crossvec from a vec thats the same as the vec
- unlikely but possible, so make sure if the normal is (0,0,1)
- that vec isnt the same or in the same direction even.*/
- if (eve->no[0]<0.5) vec[0]=1;
- else if (eve->no[1]<0.5) vec[1]=1;
- else vec[2]=1;
- Crossf(plane, eve->no, vec);
- }
- } else if (ese->type==EDITEDGE) {
- EditEdge *eed= ese->data;
-
- /*the plane is simple, it runs allong the edge
- however selecting different edges can swap the direction of the y axis.
- this makes it less likely for the y axis of the manipulator
- (running along the edge).. to flip less often.
- at least its more pradictable */
- if (eed->v2->co[1] > eed->v1->co[1]) /*check which to do first */
- VecSubf(plane, eed->v2->co, eed->v1->co);
- else
- VecSubf(plane, eed->v1->co, eed->v2->co);
-
- } else if (ese->type==EDITFACE) {
- EditFace *efa= ese->data;
- float vec[3];
- if (efa->v4) { /*if its a quad- set the plane along the 2 longest edges.*/
- float vecA[3], vecB[3];
- VecSubf(vecA, efa->v4->co, efa->v3->co);
- VecSubf(vecB, efa->v1->co, efa->v2->co);
- VecAddf(plane, vecA, vecB);
-
- VecSubf(vecA, efa->v1->co, efa->v4->co);
- VecSubf(vecB, efa->v2->co, efa->v3->co);
- VecAddf(vec, vecA, vecB);
- /*use the biggest edge length*/
- if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2])
- VecCopyf(plane, vec);
- } else {
- /*start with v1-2 */
- VecSubf(plane, efa->v1->co, efa->v2->co);
-
- /*test the edge between v2-3, use if longer */
- VecSubf(vec, efa->v2->co, efa->v3->co);
- if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2])
- VecCopyf(plane, vec);
-
- /*test the edge between v1-3, use if longer */
- VecSubf(vec, efa->v3->co, efa->v1->co);
- if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2])
- VecCopyf(plane, vec);
- }
- }
- Normalize(plane);
-}
-
-
-
-void EM_select_face(EditFace *efa, int sel)
-{
- if(sel) {
- efa->f |= SELECT;
- efa->e1->f |= SELECT;
- efa->e2->f |= SELECT;
- efa->e3->f |= SELECT;
- if(efa->e4) efa->e4->f |= SELECT;
- efa->v1->f |= SELECT;
- efa->v2->f |= SELECT;
- efa->v3->f |= SELECT;
- if(efa->v4) efa->v4->f |= SELECT;
- }
- else {
- efa->f &= ~SELECT;
- efa->e1->f &= ~SELECT;
- efa->e2->f &= ~SELECT;
- efa->e3->f &= ~SELECT;
- if(efa->e4) efa->e4->f &= ~SELECT;
- efa->v1->f &= ~SELECT;
- efa->v2->f &= ~SELECT;
- efa->v3->f &= ~SELECT;
- if(efa->v4) efa->v4->f &= ~SELECT;
- }
-}
-
-void EM_select_edge(EditEdge *eed, int sel)
-{
- if(sel) {
- eed->f |= SELECT;
- eed->v1->f |= SELECT;
- eed->v2->f |= SELECT;
- }
- else {
- eed->f &= ~SELECT;
- eed->v1->f &= ~SELECT;
- eed->v2->f &= ~SELECT;
- }
-}
-
-void EM_select_face_fgon(EditFace *efa, int val)
-{
- EditMesh *em = G.editMesh;
- short index=0;
-
- if(efa->fgonf==0) EM_select_face(efa, val);
- else {
- if(efa->e1->fgoni) index= efa->e1->fgoni;
- if(efa->e2->fgoni) index= efa->e2->fgoni;
- if(efa->e3->fgoni) index= efa->e3->fgoni;
- if(efa->v4 && efa->e4->fgoni) index= efa->e4->fgoni;
-
- if(index==0) printf("wrong fgon select\n");
-
- // select all ngon faces with index
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->fgonf) {
- if(efa->e1->fgoni==index || efa->e2->fgoni==index ||
- efa->e3->fgoni==index || (efa->e4 && efa->e4->fgoni==index) ) {
- EM_select_face(efa, val);
- }
- }
- }
- }
-}
-
-
-/* only vertices */
-int faceselectedOR(EditFace *efa, int flag)
-{
- if ((efa->v1->f | efa->v2->f | efa->v3->f | (efa->v4?efa->v4->f:0))&flag) {
- return 1;
- } else {
- return 0;
- }
-}
-
-// replace with (efa->f & SELECT)
-int faceselectedAND(EditFace *efa, int flag)
-{
- if ((efa->v1->f & efa->v2->f & efa->v3->f & (efa->v4?efa->v4->f:flag))&flag) {
- return 1;
- } else {
- return 0;
- }
-}
-
-int EM_nfaces_selected(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- int count= 0;
-
- for (efa= em->faces.first; efa; efa= efa->next)
- if (efa->f & SELECT)
- count++;
-
- return count;
-}
-
-#if 0
-static int EM_nedges(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- int count= 0;
-
- for (eed= em->edges.first; eed; eed= eed->next) count++;
- return count;
-}
-#endif
-
-int EM_nvertices_selected(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- int count= 0;
-
- for (eve= em->verts.first; eve; eve= eve->next)
- if (eve->f & SELECT)
- count++;
-
- return count;
-}
-
-void EM_clear_flag_all(int flag)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- for (eve= em->verts.first; eve; eve= eve->next) eve->f &= ~flag;
- for (eed= em->edges.first; eed; eed= eed->next) eed->f &= ~flag;
- for (efa= em->faces.first; efa; efa= efa->next) efa->f &= ~flag;
-
- if(flag & SELECT) BLI_freelistN(&(G.editMesh->selected));
-}
-
-void EM_set_flag_all(int flag)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- for (eve= em->verts.first; eve; eve= eve->next) if(eve->h==0) eve->f |= flag;
- for (eed= em->edges.first; eed; eed= eed->next) if(eed->h==0) eed->f |= flag;
- for (efa= em->faces.first; efa; efa= efa->next) if(efa->h==0) efa->f |= flag;
-
-}
-
-/* flush for changes in vertices only */
-void EM_deselect_flush(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->f & eed->v2->f & SELECT);
- else eed->f &= ~SELECT;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->v4) {
- if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT );
- else efa->f &= ~SELECT;
- }
- else {
- if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT );
- else efa->f &= ~SELECT;
- }
- }
-}
-
-
-/* flush selection to edges & faces */
-
-/* this only based on coherent selected vertices, for example when adding new
- objects. call clear_flag_all() before you select vertices to be sure it ends OK!
-
-*/
-
-void EM_select_flush(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->f & eed->v2->f & SELECT) eed->f |= SELECT;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->v4) {
- if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT ) efa->f |= SELECT;
- }
- else {
- if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT ) efa->f |= SELECT;
- }
- }
-}
-
-/* when vertices or edges can be selected, also make fgon consistant */
-static void check_fgons_selection()
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, *efan;
- EditEdge *eed;
- ListBase *lbar;
- int sel, desel, index, totfgon= 0;
-
- /* count amount of fgons */
- for(eed= em->edges.first; eed; eed= eed->next)
- if(eed->fgoni>totfgon) totfgon= eed->fgoni;
-
- if(totfgon==0) return;
-
- lbar= MEM_callocN((totfgon+1)*sizeof(ListBase), "listbase array");
-
- /* put all fgons in lbar */
- for(efa= em->faces.first; efa; efa= efan) {
- efan= efa->next;
- index= efa->e1->fgoni;
- if(index==0) index= efa->e2->fgoni;
- if(index==0) index= efa->e3->fgoni;
- if(index==0 && efa->e4) index= efa->e4->fgoni;
- if(index) {
- BLI_remlink(&em->faces, efa);
- BLI_addtail(&lbar[index], efa);
- }
- }
-
- /* now check the fgons */
- for(index=1; index<=totfgon; index++) {
- /* we count on vertices/faces/edges being set OK, so we only have to set ngon itself */
- sel= desel= 0;
- for(efa= lbar[index].first; efa; efa= efa->next) {
- if(efa->e1->fgoni==0) {
- if(efa->e1->f & SELECT) sel++;
- else desel++;
- }
- if(efa->e2->fgoni==0) {
- if(efa->e2->f & SELECT) sel++;
- else desel++;
- }
- if(efa->e3->fgoni==0) {
- if(efa->e3->f & SELECT) sel++;
- else desel++;
- }
- if(efa->e4 && efa->e4->fgoni==0) {
- if(efa->e4->f & SELECT) sel++;
- else desel++;
- }
-
- if(sel && desel) break;
- }
-
- if(sel && desel) sel= 0;
- else if(sel) sel= 1;
- else sel= 0;
-
- /* select/deselect and put back */
- for(efa= lbar[index].first; efa; efa= efa->next) {
- if(sel) efa->f |= SELECT;
- else efa->f &= ~SELECT;
- }
- addlisttolist(&em->faces, &lbar[index]);
- }
-
- MEM_freeN(lbar);
-}
-
-
-/* flush to edges & faces */
-
-/* based on select mode it selects edges/faces
- assumed is that verts/edges/faces were properly selected themselves
- with the calls above
-*/
-
-void EM_selectmode_flush(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
-
- // flush to edges & faces
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->f & eed->v2->f & SELECT) eed->f |= SELECT;
- else eed->f &= ~SELECT;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->v4) {
- if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT) efa->f |= SELECT;
- else efa->f &= ~SELECT;
- }
- else {
- if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT) efa->f |= SELECT;
- else efa->f &= ~SELECT;
- }
- }
- }
- // flush to faces
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e4) {
- if(efa->e1->f & efa->e2->f & efa->e3->f & efa->e4->f & SELECT) efa->f |= SELECT;
- else efa->f &= ~SELECT;
- }
- else {
- if(efa->e1->f & efa->e2->f & efa->e3->f & SELECT) efa->f |= SELECT;
- else efa->f &= ~SELECT;
- }
- }
- }
- // make sure selected faces have selected edges too, for extrude (hack?)
- else if(G.scene->selectmode & SCE_SELECT_FACE) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) EM_select_face(efa, 1);
- }
- }
-
- if(!(G.scene->selectmode & SCE_SELECT_FACE))
- check_fgons_selection();
-
-}
-
-void EM_convertsel(short oldmode, short selectmode)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- /*clear flags*/
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1 = 0;
- for(eed= em->edges.first; eed; eed= eed->next) eed->f1 = 0;
- for(efa= em->faces.first; efa; efa= efa->next) efa->f1 = 0;
-
- /*have to find out what the selectionmode was previously*/
- if(oldmode == SCE_SELECT_VERTEX) {
- if(selectmode == SCE_SELECT_EDGE){
- /*select all edges associated with every selected vertex*/
- for(eed= em->edges.first; eed; eed= eed->next){
- if(eed->v1->f&SELECT) eed->f1 = 1;
- else if(eed->v2->f&SELECT) eed->f1 = 1;
- }
-
- for(eed= em->edges.first; eed; eed= eed->next){
- if(eed->f1 == 1) EM_select_edge(eed,1);
- }
- }
- else if(selectmode == SCE_SELECT_FACE){
- /*select all faces associated with every selected vertex*/
- for(efa= em->faces.first; efa; efa= efa->next){
- if(efa->v1->f&SELECT) efa->f1 = 1;
- else if(efa->v2->f&SELECT) efa->f1 = 1;
- else if(efa->v3->f&SELECT) efa->f1 = 1;
- else{
- if(efa->v4){
- if(efa->v4->f&SELECT) efa->f1 =1;
- }
- }
- }
- for(efa= em->faces.first; efa; efa= efa->next){
- if(efa->f1 == 1) EM_select_face(efa,1);
- }
- }
- }
-
- if(oldmode == SCE_SELECT_EDGE){
- if(selectmode == SCE_SELECT_FACE){
- for(efa= em->faces.first; efa; efa= efa->next){
- if(efa->e1->f&SELECT) efa->f1 = 1;
- else if(efa->e2->f&SELECT) efa->f1 = 1;
- else if(efa->e3->f&SELECT) efa->f1 = 1;
- else if(efa->e4){
- if(efa->e4->f&SELECT) efa->f1 = 1;
- }
- }
- for(efa= em->faces.first; efa; efa= efa->next){
- if(efa->f1 == 1) EM_select_face(efa,1);
- }
- }
- }
-
- check_fgons_selection();
-}
-
-/* when switching select mode, makes sure selection is consistant for editing */
-/* also for paranoia checks to make sure edge or face mode works */
-void EM_selectmode_set(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- EM_strip_selections(); /*strip EditSelections from em->selected that are not relevant to new mode*/
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- /* vertices -> edges -> faces */
- for (eed= em->edges.first; eed; eed= eed->next) eed->f &= ~SELECT;
- for (efa= em->faces.first; efa; efa= efa->next) efa->f &= ~SELECT;
-
- EM_select_flush();
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- /* deselect vertices, and select again based on edge select */
- for(eve= em->verts.first; eve; eve= eve->next) eve->f &= ~SELECT;
- for(eed= em->edges.first; eed; eed= eed->next)
- if(eed->f & SELECT) EM_select_edge(eed, 1);
- /* selects faces based on edge status */
- EM_selectmode_flush();
- }
- else if(G.scene->selectmode & SCE_SELECT_FACE) {
- /* deselect eges, and select again based on face select */
- for(eed= em->edges.first; eed; eed= eed->next) EM_select_edge(eed, 0);
-
- for(efa= em->faces.first; efa; efa= efa->next)
- if(efa->f & SELECT) EM_select_face(efa, 1);
- }
-}
-
-/* paranoia check, actually only for entering editmode. rule:
-- vertex hidden, always means edge is hidden too
-- edge hidden, always means face is hidden too
-- face hidden, dont change anything
-*/
-void EM_hide_reset(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
-
- for(eed= em->edges.first; eed; eed= eed->next)
- if(eed->v1->h || eed->v2->h) eed->h |= 1;
-
- for(efa= em->faces.first; efa; efa= efa->next)
- if((efa->e1->h & 1) || (efa->e2->h & 1) || (efa->e3->h & 1) || (efa->e4 && (efa->e4->h & 1)))
- efa->h= 1;
-
-}
-
-void EM_data_interp_from_verts(EditVert *v1, EditVert *v2, EditVert *eve, float fac)
-{
- EditMesh *em= G.editMesh;
- void *src[2];
- float w[2];
-
- if (v1->data && v2->data) {
- src[0]= v1->data;
- src[1]= v2->data;
- w[0] = 1.0f-fac;
- w[1] = fac;
-
- CustomData_em_interp(&em->vdata, src, w, NULL, 2, eve->data);
- }
-}
-
-void EM_data_interp_from_faces(EditFace *efa1, EditFace *efa2, EditFace *efan, int i1, int i2, int i3, int i4)
-{
- EditMesh *em= G.editMesh;
- float w[2][4][4];
- void *src[2];
- int count = (efa2)? 2: 1;
-
- if (efa1->data) {
- /* set weights for copying from corners directly to other corners */
- memset(w, 0, sizeof(w));
-
- w[i1/4][0][i1%4]= 1.0f;
- w[i2/4][1][i2%4]= 1.0f;
- w[i3/4][2][i3%4]= 1.0f;
- if (i4 != -1)
- w[i4/4][3][i4%4]= 1.0f;
-
- src[0]= efa1->data;
- src[1]= (efa2)? efa2->data: NULL;
-
- CustomData_em_interp(&em->fdata, src, NULL, (float*)w, count, efan->data);
- }
-}
-
-EditFace *EM_face_from_faces(EditFace *efa1, EditFace *efa2, int i1, int i2, int i3, int i4)
-{
- EditFace *efan;
- EditVert **v[2];
-
- v[0]= &efa1->v1;
- v[1]= (efa2)? &efa2->v1: NULL;
-
- efan= addfacelist(v[i1/4][i1%4], v[i2/4][i2%4], v[i3/4][i3%4],
- (i4 == -1)? 0: v[i4/4][i4%4], efa1, NULL);
-
- EM_data_interp_from_faces(efa1, efa2, efan, i1, i2, i3, i4);
-
- return efan;
-}
-
-static void update_data_blocks(CustomData *olddata, CustomData *data)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- EditVert *eve;
- void *block;
-
- if (data == &G.editMesh->vdata) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- block = NULL;
- CustomData_em_set_default(data, &block);
- CustomData_em_copy_data(olddata, data, eve->data, &block);
- CustomData_em_free_block(olddata, &eve->data);
- eve->data= block;
- }
- }
- else if (data == &G.editMesh->fdata) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- block = NULL;
- CustomData_em_set_default(data, &block);
- CustomData_em_copy_data(olddata, data, efa->data, &block);
- CustomData_em_free_block(olddata, &efa->data);
- efa->data= block;
- }
- }
-}
-
-void EM_add_data_layer(CustomData *data, int type)
-{
- CustomData olddata;
-
- olddata= *data;
- olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL;
- CustomData_add_layer(data, type, CD_CALLOC, NULL, 0);
-
- update_data_blocks(&olddata, data);
- if (olddata.layers) MEM_freeN(olddata.layers);
-}
-
-void EM_free_data_layer(CustomData *data, int type)
-{
- CustomData olddata;
-
- olddata= *data;
- olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL;
- CustomData_free_layer_active(data, type, 0);
-
- update_data_blocks(&olddata, data);
- if (olddata.layers) MEM_freeN(olddata.layers);
-}
-
-/* ******** EXTRUDE ********* */
-
-static void add_normal_aligned(float *nor, float *add)
-{
- if( INPR(nor, add) < -0.9999f)
- VecSubf(nor, nor, add);
- else
- VecAddf(nor, nor, add);
-}
-
-static void set_edge_directions_f2(int val)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- int do_all= 1;
-
- /* edge directions are used for extrude, to detect direction of edges that make new faces */
- /* we have set 'f2' flags in edges that need to get a direction set (e.g. get new face) */
- /* the val argument differs... so we need it as arg */
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- do_all= 0;
- if(efa->e1->f2<val) {
- if(efa->e1->v1 == efa->v1) efa->e1->dir= 0;
- else efa->e1->dir= 1;
- }
- if(efa->e2->f2<val) {
- if(efa->e2->v1 == efa->v2) efa->e2->dir= 0;
- else efa->e2->dir= 1;
- }
- if(efa->e3->f2<val) {
- if(efa->e3->v1 == efa->v3) efa->e3->dir= 0;
- else efa->e3->dir= 1;
- }
- if(efa->e4 && efa->e4->f2<val) {
- if(efa->e4->v1 == efa->v4) efa->e4->dir= 0;
- else efa->e4->dir= 1;
- }
- }
- }
- /* ok, no faces done... then we at least set it for exterior edges */
- if(do_all) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e1->v1 == efa->v1) efa->e1->dir= 0;
- else efa->e1->dir= 1;
- if(efa->e2->v1 == efa->v2) efa->e2->dir= 0;
- else efa->e2->dir= 1;
- if(efa->e3->v1 == efa->v3) efa->e3->dir= 0;
- else efa->e3->dir= 1;
- if(efa->e4) {
- if(efa->e4->v1 == efa->v4) efa->e4->dir= 0;
- else efa->e4->dir= 1;
- }
- }
- }
-}
-
-/* individual face extrude */
-/* will use vertex normals for extrusion directions, so *nor is unaffected */
-short extrudeflag_face_indiv(short flag, float *nor)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1, *v2, *v3, *v4;
- EditEdge *eed;
- EditFace *efa, *nextfa;
-
- if(G.obedit==0 || get_mesh(G.obedit)==0) return 0;
-
- /* selected edges with 1 or more selected face become faces */
- /* selected faces each makes new faces */
- /* always remove old faces, keeps volumes manifold */
- /* select the new extrusion, deselect old */
-
- /* step 1; init, count faces in edges */
- recalc_editnormals();
-
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; // new select flag
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f2= 0; // amount of unselected faces
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT);
- else {
- efa->e1->f2++;
- efa->e2->f2++;
- efa->e3->f2++;
- if(efa->e4) efa->e4->f2++;
- }
- }
-
- /* step 2: make new faces from faces */
- for(efa= em->faces.last; efa; efa= efa->prev) {
- if(efa->f & SELECT) {
- v1= addvertlist(efa->v1->co, efa->v1);
- v2= addvertlist(efa->v2->co, efa->v2);
- v3= addvertlist(efa->v3->co, efa->v3);
-
- v1->f1= v2->f1= v3->f1= 1;
- VECCOPY(v1->no, efa->n);
- VECCOPY(v2->no, efa->n);
- VECCOPY(v3->no, efa->n);
- if(efa->v4) {
- v4= addvertlist(efa->v4->co, efa->v4);
- v4->f1= 1;
- VECCOPY(v4->no, efa->n);
- }
- else v4= NULL;
-
- /* side faces, clockwise */
- addfacelist(efa->v2, v2, v1, efa->v1, efa, NULL);
- addfacelist(efa->v3, v3, v2, efa->v2, efa, NULL);
- if(efa->v4) {
- addfacelist(efa->v4, v4, v3, efa->v3, efa, NULL);
- addfacelist(efa->v1, v1, v4, efa->v4, efa, NULL);
- }
- else {
- addfacelist(efa->v1, v1, v3, efa->v3, efa, NULL);
- }
- /* top face */
- addfacelist(v1, v2, v3, v4, efa, NULL);
- }
- }
-
- /* step 3: remove old faces */
- efa= em->faces.first;
- while(efa) {
- nextfa= efa->next;
- if(efa->f & SELECT) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextfa;
- }
-
- /* step 4: redo selection */
- EM_clear_flag_all(SELECT);
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f1) eve->f |= SELECT;
- }
-
- EM_select_flush();
-
- return 'n';
-}
-
-
-/* extrudes individual edges */
-/* nor is filled with constraint vector */
-short extrudeflag_edges_indiv(short flag, float *nor)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- for(eve= em->verts.first; eve; eve= eve->next) eve->tmp.v = NULL;
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->tmp.f = NULL;
- eed->f2= ((eed->f & flag)!=0);
- }
-
- set_edge_directions_f2(2);
-
- /* sample for next loop */
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->e1->tmp.f = efa;
- efa->e2->tmp.f = efa;
- efa->e3->tmp.f = efa;
- if(efa->e4) efa->e4->tmp.f = efa;
- }
- /* make the faces */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f & flag) {
- if(eed->v1->tmp.v == NULL)
- eed->v1->tmp.v = addvertlist(eed->v1->co, eed->v1);
- if(eed->v2->tmp.v == NULL)
- eed->v2->tmp.v = addvertlist(eed->v2->co, eed->v2);
-
- if(eed->dir==1)
- addfacelist(eed->v1, eed->v2,
- eed->v2->tmp.v, eed->v1->tmp.v,
- eed->tmp.f, NULL);
- else
- addfacelist(eed->v2, eed->v1,
- eed->v1->tmp.v, eed->v2->tmp.v,
- eed->tmp.f, NULL);
-
- /* for transform */
- if(eed->tmp.f) {
- efa = eed->tmp.f;
- if (efa->f & SELECT) add_normal_aligned(nor, efa->n);
- }
- }
- }
- Normalize(nor);
-
- /* set correct selection */
- EM_clear_flag_all(SELECT);
- for(eve= em->verts.last; eve; eve= eve->prev) {
- if(eve->tmp.v) {
- eve->tmp.v->f |= flag;
- }
- }
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->f & eed->v2->f & flag) eed->f |= flag;
- }
-
- if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // g is grab
- return 'n'; // n is for normal constraint
-}
-
-/* extrudes individual vertices */
-short extrudeflag_verts_indiv(short flag, float *nor)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
-
- /* make the edges */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & flag) {
- eve->tmp.v = addvertlist(eve->co, eve);
- addedgelist(eve, eve->tmp.v, NULL);
- }
- else eve->tmp.v = NULL;
- }
-
- /* set correct selection */
- EM_clear_flag_all(SELECT);
-
- for(eve= em->verts.last; eve; eve= eve->prev)
- if (eve->tmp.v)
- eve->tmp.v->f |= flag;
-
- return 'g'; // g is grab
-}
-
-
-/* this is actually a recode of extrudeflag(), using proper edge/face select */
-/* hurms, doesnt use 'flag' yet, but its not called by primitive making stuff anyway */
-static short extrudeflag_edge(short flag, float *nor)
-{
- /* all select edges/faces: extrude */
- /* old select is cleared, in new ones it is set */
- EditMesh *em = G.editMesh;
- EditVert *eve, *nextve;
- EditEdge *eed, *nexted;
- EditFace *efa, *nextfa, *efan;
- short del_old= 0;
- ModifierData *md;
-
- if(G.obedit==0 || get_mesh(G.obedit)==0) return 0;
-
- md = G.obedit->modifiers.first;
-
- /* selected edges with 0 or 1 selected face become faces */
- /* selected faces generate new faces */
-
- /* if *one* selected face has edge with unselected face; remove old selected faces */
-
- /* if selected edge is not used anymore; remove */
- /* if selected vertex is not used anymore: remove */
-
- /* select the new extrusion, deselect old */
-
-
- /* step 1; init, count faces in edges */
- recalc_editnormals();
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- eve->tmp.v = NULL;
- eve->f1= 0;
- }
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0; // amount of unselected faces
- eed->f2= 0; // amount of selected faces
- if(eed->f & SELECT) {
- eed->v1->f1= 1; // we call this 'selected vertex' now
- eed->v2->f1= 1;
- }
- eed->tmp.f = NULL; // here we tuck face pointer, as sample
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- efa->e1->f2++;
- efa->e2->f2++;
- efa->e3->f2++;
- if(efa->e4) efa->e4->f2++;
-
- // sample for next loop
- efa->e1->tmp.f = efa;
- efa->e2->tmp.f = efa;
- efa->e3->tmp.f = efa;
- if(efa->e4) efa->e4->tmp.f = efa;
- }
- else {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
-
- /* If a mirror modifier with clipping is on, we need to adjust some
- * of the cases above to handle edges on the line of symmetry.
- */
- for (; md; md=md->next) {
- if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- float mtx[4][4];
- if (mmd->mirror_ob) {
- float imtx[4][4];
- Mat4Invert(imtx, mmd->mirror_ob->obmat);
- Mat4MulMat4(mtx, G.obedit->obmat, imtx);
- }
-
- for (eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2 == 1) {
- float co1[3], co2[3];
-
- VecCopyf(co1, eed->v1->co);
- VecCopyf(co2, eed->v2->co);
-
- if (mmd->mirror_ob) {
- VecMat4MulVecfl(co1, mtx, co1);
- VecMat4MulVecfl(co2, mtx, co2);
- }
-
- if (mmd->flag & MOD_MIR_AXIS_X)
- if ( (fabs(co1[0]) < mmd->tolerance) &&
- (fabs(co2[0]) < mmd->tolerance) )
- ++eed->f2;
-
- if (mmd->flag & MOD_MIR_AXIS_Y)
- if ( (fabs(co1[1]) < mmd->tolerance) &&
- (fabs(co2[1]) < mmd->tolerance) )
- ++eed->f2;
-
- if (mmd->flag & MOD_MIR_AXIS_Z)
- if ( (fabs(co1[2]) < mmd->tolerance) &&
- (fabs(co2[2]) < mmd->tolerance) )
- ++eed->f2;
- }
- }
- }
- }
- }
-
- set_edge_directions_f2(2);
-
- /* step 1.5: if *one* selected face has edge with unselected face; remove old selected faces */
- for(efa= em->faces.last; efa; efa= efa->prev) {
- if(efa->f & SELECT) {
- if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1 || (efa->e4 && efa->e4->f1)) {
- del_old= 1;
- break;
- }
- }
- }
-
- /* step 2: make new faces from edges */
- for(eed= em->edges.last; eed; eed= eed->prev) {
- if(eed->f & SELECT) {
- if(eed->f2<2) {
- if(eed->v1->tmp.v == NULL)
- eed->v1->tmp.v = addvertlist(eed->v1->co, eed->v1);
- if(eed->v2->tmp.v == NULL)
- eed->v2->tmp.v = addvertlist(eed->v2->co, eed->v2);
-
- /* if del_old, the preferred normal direction is exact
- * opposite as for keep old faces
- */
- if(eed->dir!=del_old)
- addfacelist(eed->v1, eed->v2,
- eed->v2->tmp.v, eed->v1->tmp.v,
- eed->tmp.f, NULL);
- else
- addfacelist(eed->v2, eed->v1,
- eed->v1->tmp.v, eed->v2->tmp.v,
- eed->tmp.f, NULL);
- }
- }
- }
-
- /* step 3: make new faces from faces */
- for(efa= em->faces.last; efa; efa= efa->prev) {
- if(efa->f & SELECT) {
- if (efa->v1->tmp.v == NULL)
- efa->v1->tmp.v = addvertlist(efa->v1->co, efa->v1);
- if (efa->v2->tmp.v ==NULL)
- efa->v2->tmp.v = addvertlist(efa->v2->co, efa->v2);
- if (efa->v3->tmp.v ==NULL)
- efa->v3->tmp.v = addvertlist(efa->v3->co, efa->v3);
- if (efa->v4 && (efa->v4->tmp.v == NULL))
- efa->v4->tmp.v = addvertlist(efa->v4->co, efa->v4);
-
- if(del_old==0) { // keep old faces means flipping normal
- if(efa->v4)
- efan = addfacelist(efa->v4->tmp.v, efa->v3->tmp.v,
- efa->v2->tmp.v, efa->v1->tmp.v, efa, efa);
- else
- efan = addfacelist(efa->v3->tmp.v, efa->v2->tmp.v,
- efa->v1->tmp.v, NULL, efa, efa);
- }
- else {
- if(efa->v4)
- efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v,
- efa->v3->tmp.v, efa->v4->tmp.v, efa, efa);
- else
- efan = addfacelist(efa->v1->tmp.v, efa->v2->tmp.v,
- efa->v3->tmp.v, NULL, efa, efa);
- }
-
- if (G.editMesh->act_face == efa) {
- G.editMesh->act_face = efan;
- }
-
- /* for transform */
- add_normal_aligned(nor, efa->n);
- }
- }
-
- if(del_old) {
-
- /* step 4: remove old faces, if del_old */
- efa= em->faces.first;
- while(efa) {
- nextfa= efa->next;
- if(efa->f & SELECT) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextfa;
- }
-
-
- /* step 5: remove selected unused edges */
- /* start tagging again */
- for(eed= em->edges.first; eed; eed= eed->next) eed->f1=0;
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->e1->f1= 1;
- efa->e2->f1= 1;
- efa->e3->f1= 1;
- if(efa->e4) efa->e4->f1= 1;
- }
- /* remove */
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
- if(eed->f & SELECT) {
- if(eed->f1==0) {
- remedge(eed);
- free_editedge(eed);
- }
- }
- eed= nexted;
- }
-
- /* step 6: remove selected unused vertices */
- for(eed= em->edges.first; eed; eed= eed->next)
- eed->v1->f1= eed->v2->f1= 0;
-
- eve= em->verts.first;
- while(eve) {
- nextve= eve->next;
- if(eve->f1) {
- // hack... but we need it for step 7, redoing selection
- if(eve->tmp.v) eve->tmp.v->tmp.v= eve->tmp.v;
-
- BLI_remlink(&em->verts, eve);
- free_editvert(eve);
- }
- eve= nextve;
- }
- }
-
- Normalize(nor); // translation normal grab
-
- /* step 7: redo selection */
- EM_clear_flag_all(SELECT);
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->tmp.v) {
- eve->tmp.v->f |= SELECT;
- }
- }
-
- EM_select_flush();
-
- if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // grab
- return 'n'; // normal constraint
-}
-
-short extrudeflag_vert(short flag, float *nor)
-{
- /* all verts/edges/faces with (f & 'flag'): extrude */
- /* from old verts, 'flag' is cleared, in new ones it is set */
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1, *v2, *v3, *v4, *nextve;
- EditEdge *eed, *e1, *e2, *e3, *e4, *nexted;
- EditFace *efa, *efa2, *nextvl;
- short sel=0, del_old= 0, is_face_sel=0;
- ModifierData *md;
-
- if(G.obedit==0 || get_mesh(G.obedit)==0) return 0;
-
- md = G.obedit->modifiers.first;
-
- /* clear vert flag f1, we use this to detect a loose selected vertice */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & flag) eve->f1= 1;
- else eve->f1= 0;
- eve= eve->next;
- }
- /* clear edges counter flag, if selected we set it at 1 */
- eed= em->edges.first;
- while(eed) {
- if( (eed->v1->f & flag) && (eed->v2->f & flag) ) {
- eed->f2= 1;
- eed->v1->f1= 0;
- eed->v2->f1= 0;
- }
- else eed->f2= 0;
-
- eed->f1= 1; /* this indicates it is an 'old' edge (in this routine we make new ones) */
- eed->tmp.f = NULL; /* used as sample */
-
- eed= eed->next;
- }
-
- /* we set a flag in all selected faces, and increase the associated edge counters */
-
- efa= em->faces.first;
- while(efa) {
- efa->f1= 0;
-
- if(faceselectedAND(efa, flag)) {
- e1= efa->e1;
- e2= efa->e2;
- e3= efa->e3;
- e4= efa->e4;
-
- if(e1->f2 < 3) e1->f2++;
- if(e2->f2 < 3) e2->f2++;
- if(e3->f2 < 3) e3->f2++;
- if(e4 && e4->f2 < 3) e4->f2++;
-
- efa->f1= 1;
- is_face_sel= 1; // for del_old
- }
- else if(faceselectedOR(efa, flag)) {
- e1= efa->e1;
- e2= efa->e2;
- e3= efa->e3;
- e4= efa->e4;
-
- if( (e1->v1->f & flag) && (e1->v2->f & flag) ) e1->f1= 2;
- if( (e2->v1->f & flag) && (e2->v2->f & flag) ) e2->f1= 2;
- if( (e3->v1->f & flag) && (e3->v2->f & flag) ) e3->f1= 2;
- if( e4 && (e4->v1->f & flag) && (e4->v2->f & flag) ) e4->f1= 2;
- }
-
- // sample for next loop
- efa->e1->tmp.f = efa;
- efa->e2->tmp.f = efa;
- efa->e3->tmp.f = efa;
- if(efa->e4) efa->e4->tmp.f = efa;
-
- efa= efa->next;
- }
-
- set_edge_directions_f2(3);
-
- /* the current state now is:
- eve->f1==1: loose selected vertex
-
- eed->f2==0 : edge is not selected, no extrude
- eed->f2==1 : edge selected, is not part of a face, extrude
- eed->f2==2 : edge selected, is part of 1 face, extrude
- eed->f2==3 : edge selected, is part of more faces, no extrude
-
- eed->f1==0: new edge
- eed->f1==1: edge selected, is part of selected face, when eed->f==3: remove
- eed->f1==2: edge selected, part of a partially selected face
-
- efa->f1==1 : duplicate this face
- */
-
- /* If a mirror modifier with clipping is on, we need to adjust some
- * of the cases above to handle edges on the line of symmetry.
- */
- for (; md; md=md->next) {
- if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- float mtx[4][4];
- if (mmd->mirror_ob) {
- float imtx[4][4];
- Mat4Invert(imtx, mmd->mirror_ob->obmat);
- Mat4MulMat4(mtx, G.obedit->obmat, imtx);
- }
-
- for (eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2 == 2) {
- float co1[3], co2[3];
-
- VecCopyf(co1, eed->v1->co);
- VecCopyf(co2, eed->v2->co);
-
- if (mmd->mirror_ob) {
- VecMat4MulVecfl(co1, mtx, co1);
- VecMat4MulVecfl(co2, mtx, co2);
- }
-
- if (mmd->flag & MOD_MIR_AXIS_X)
- if ( (fabs(co1[0]) < mmd->tolerance) &&
- (fabs(co2[0]) < mmd->tolerance) )
- ++eed->f2;
-
- if (mmd->flag & MOD_MIR_AXIS_Y)
- if ( (fabs(co1[1]) < mmd->tolerance) &&
- (fabs(co2[1]) < mmd->tolerance) )
- ++eed->f2;
- if (mmd->flag & MOD_MIR_AXIS_Z)
- if ( (fabs(co1[2]) < mmd->tolerance) &&
- (fabs(co2[2]) < mmd->tolerance) )
- ++eed->f2;
- }
- }
- }
- }
- }
-
- /* copy all selected vertices, */
- /* write pointer to new vert in old struct at eve->tmp.v */
- eve= em->verts.last;
- while(eve) {
- eve->f &= ~128; /* clear, for later test for loose verts */
- if(eve->f & flag) {
- sel= 1;
- v1= addvertlist(0, NULL);
-
- VECCOPY(v1->co, eve->co);
- v1->f= eve->f;
- eve->f-= flag;
- eve->tmp.v = v1;
- }
- else eve->tmp.v = 0;
- eve= eve->prev;
- }
-
- if(sel==0) return 0;
-
- /* all edges with eed->f2==1 or eed->f2==2 become faces */
-
- /* if del_old==1 then extrude is in partial geometry, to keep it manifold.
- verts with f1==0 and (eve->f & 128)==0) are removed
- edges with eed->f2>2 are removed
- faces with efa->f1 are removed
- if del_old==0 the extrude creates a volume.
- */
-
- /* find if we delete old faces */
- if(is_face_sel) {
- for(eed= em->edges.first; eed; eed= eed->next) {
- if( (eed->f2==1 || eed->f2==2) ) {
- if(eed->f1==2) {
- del_old= 1;
- break;
- }
- }
- }
- }
-
- eed= em->edges.last;
- while(eed) {
- nexted= eed->prev;
- if( eed->f2<3) {
- eed->v1->f |= 128; /* = no loose vert! */
- eed->v2->f |= 128;
- }
- if( (eed->f2==1 || eed->f2==2) ) {
-
- /* if del_old, the preferred normal direction is exact opposite as for keep old faces */
- if(eed->dir != del_old)
- efa2 = addfacelist(eed->v1, eed->v2,
- eed->v2->tmp.v, eed->v1->tmp.v,
- eed->tmp.f, NULL);
- else
- efa2 = addfacelist(eed->v2, eed->v1,
- eed->v1->tmp.v, eed->v2->tmp.v,
- eed->tmp.f, NULL);
-
- /* Needs smarter adaption of existing creases.
- * If addedgelist is used, make sure seams are set to 0 on these
- * new edges, since we do not want to add any seams on extrusion.
- */
- efa2->e1->crease= eed->crease;
- efa2->e2->crease= eed->crease;
- efa2->e3->crease= eed->crease;
- if(efa2->e4) efa2->e4->crease= eed->crease;
- }
-
- eed= nexted;
- }
- if(del_old) {
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
- if(eed->f2==3 && eed->f1==1) {
- remedge(eed);
- free_editedge(eed);
- }
- eed= nexted;
- }
- }
- /* duplicate faces, if necessary remove old ones */
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- if(efa->f1 & 1) {
-
- v1 = efa->v1->tmp.v;
- v2 = efa->v2->tmp.v;
- v3 = efa->v3->tmp.v;
- if(efa->v4)
- v4 = efa->v4->tmp.v;
- else
- v4= 0;
-
- /* hmm .. not sure about edges here */
- if(del_old==0) // if we keep old, we flip normal
- efa2= addfacelist(v3, v2, v1, v4, efa, efa);
- else
- efa2= addfacelist(v1, v2, v3, v4, efa, efa);
-
- /* for transform */
- add_normal_aligned(nor, efa->n);
-
- if(del_old) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- }
- efa= nextvl;
- }
-
- Normalize(nor); // for grab
-
- /* for all vertices with eve->tmp.v!=0
- if eve->f1==1: make edge
- if flag!=128 : if del_old==1: remove
- */
- eve= em->verts.last;
- while(eve) {
- nextve= eve->prev;
- if(eve->tmp.v) {
- if(eve->f1==1) addedgelist(eve, eve->tmp.v, NULL);
- else if( (eve->f & 128)==0) {
- if(del_old) {
- BLI_remlink(&em->verts,eve);
- free_editvert(eve);
- eve= NULL;
- }
- }
- }
- if(eve) {
- eve->f &= ~128;
- }
- eve= nextve;
- }
- // since its vertex select mode now, it also deselects higher order
- EM_selectmode_flush();
-
- if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // g is grab, for correct undo print
- return 'n';
-}
-
-/* generic extrude */
-short extrudeflag(short flag, float *nor)
-{
- if(G.scene->selectmode & SCE_SELECT_VERTEX)
- return extrudeflag_vert(flag, nor);
- else
- return extrudeflag_edge(flag, nor);
-
-}
-
-void rotateflag(short flag, float *cent, float rotmat[][3])
-{
- /* all verts with (flag & 'flag') rotate */
- EditMesh *em = G.editMesh;
- EditVert *eve;
-
- eve= em->verts.first;
- while(eve) {
- if(eve->f & flag) {
- eve->co[0]-=cent[0];
- eve->co[1]-=cent[1];
- eve->co[2]-=cent[2];
- Mat3MulVecfl(rotmat,eve->co);
- eve->co[0]+=cent[0];
- eve->co[1]+=cent[1];
- eve->co[2]+=cent[2];
- }
- eve= eve->next;
- }
-}
-
-void translateflag(short flag, float *vec)
-{
- /* all verts with (flag & 'flag') translate */
- EditMesh *em = G.editMesh;
- EditVert *eve;
-
- eve= em->verts.first;
- while(eve) {
- if(eve->f & flag) {
- eve->co[0]+=vec[0];
- eve->co[1]+=vec[1];
- eve->co[2]+=vec[2];
- }
- eve= eve->next;
- }
-}
-
-/* helper call for below */
-static EditVert *adduplicate_vertex(EditVert *eve, int flag)
-{
- /* FIXME: copy deformation weight from eve ok here? */
- EditVert *v1= addvertlist(eve->co, eve);
-
- v1->f= eve->f;
- eve->f-= flag;
- eve->f|= 128;
-
- eve->tmp.v = v1;
-
- return v1;
-}
-
-/* old selection has flag 128 set, and flag 'flag' cleared
-new selection has flag 'flag' set */
-void adduplicateflag(int flag)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1, *v2, *v3, *v4;
- EditEdge *eed, *newed;
- EditFace *efa, *newfa, *act_efa = EM_get_actFace(0);
-
- EM_clear_flag_all(128);
- EM_selectmode_set(); // paranoia check, selection now is consistant
-
- /* vertices first */
- for(eve= em->verts.last; eve; eve= eve->prev) {
-
- if(eve->f & flag)
- adduplicate_vertex(eve, flag);
- else
- eve->tmp.v = NULL;
- }
-
- /* copy edges, note that vertex selection can be independent of edge */
- for(eed= em->edges.last; eed; eed= eed->prev) {
- if( eed->f & flag ) {
- v1 = eed->v1->tmp.v;
- if(v1==NULL) v1= adduplicate_vertex(eed->v1, flag);
- v2 = eed->v2->tmp.v;
- if(v2==NULL) v2= adduplicate_vertex(eed->v2, flag);
-
- newed= addedgelist(v1, v2, eed);
-
- newed->f= eed->f;
- eed->f -= flag;
- eed->f |= 128;
- }
- }
-
- /* then duplicate faces, again create new vertices if needed */
- for(efa= em->faces.last; efa; efa= efa->prev) {
- if(efa->f & flag) {
- v1 = efa->v1->tmp.v;
- if(v1==NULL) v1= adduplicate_vertex(efa->v1, flag);
- v2 = efa->v2->tmp.v;
- if(v2==NULL) v2= adduplicate_vertex(efa->v2, flag);
- v3 = efa->v3->tmp.v;
- if(v3==NULL) v3= adduplicate_vertex(efa->v3, flag);
- if(efa->v4) {
- v4 = efa->v4->tmp.v;
- if(v4==NULL) v4= adduplicate_vertex(efa->v4, flag);
- }
- else v4= NULL;
-
- newfa= addfacelist(v1, v2, v3, v4, efa, efa);
-
- if (efa==act_efa) {
- EM_set_actFace(newfa);
- }
-
- newfa->f= efa->f;
- efa->f -= flag;
- efa->f |= 128;
- }
- }
-
- EM_fgon_flags(); // redo flags and indices for fgons
-}
-
-void delfaceflag(int flag)
-{
- EditMesh *em = G.editMesh;
- /* delete all faces with 'flag', including loose edges and loose vertices */
- /* this is maybe a bit weird, but this function is used for 'split' and 'separate' */
- /* in remaining vertices/edges 'flag' is cleared */
- EditVert *eve,*nextve;
- EditEdge *eed, *nexted;
- EditFace *efa,*nextvl;
-
- /* to detect loose edges, we put f2 flag on 1 */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f & flag) eed->f2= 1;
- else eed->f2= 0;
- }
-
- /* delete faces */
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- if(efa->f & flag) {
-
- efa->e1->f2= 1;
- efa->e2->f2= 1;
- efa->e3->f2= 1;
- if(efa->e4) {
- efa->e4->f2= 1;
- }
-
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
-
- /* all remaining faces: make sure we keep the edges */
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->e1->f2= 0;
- efa->e2->f2= 0;
- efa->e3->f2= 0;
- if(efa->e4) {
- efa->e4->f2= 0;
- }
- }
-
- /* remove tagged edges, and clear remaining ones */
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
-
- if(eed->f2==1) {
- remedge(eed);
- free_editedge(eed);
- }
- else {
- eed->f &= ~flag;
- eed->v1->f &= ~flag;
- eed->v2->f &= ~flag;
- }
- eed= nexted;
- }
-
- /* vertices with 'flag' now are the loose ones, and will be removed */
- eve= em->verts.first;
- while(eve) {
- nextve= eve->next;
- if(eve->f & flag) {
- BLI_remlink(&em->verts, eve);
- free_editvert(eve);
- }
- eve= nextve;
- }
-
-}
-
-/* ********************* */
-#if 0
-static int check_vnormal_flip(float *n, float *vnorm)
-{
- float inp;
-
- inp= n[0]*vnorm[0]+n[1]*vnorm[1]+n[2]*vnorm[2];
-
- /* angles 90 degrees: dont flip */
- if(inp> -0.000001) return 0;
-
- return 1;
-}
-#endif
-
-void flipface(EditFace *efa)
-{
- if(efa->v4) {
- SWAP(EditVert *, efa->v2, efa->v4);
- SWAP(EditEdge *, efa->e1, efa->e4);
- SWAP(EditEdge *, efa->e2, efa->e3);
- EM_data_interp_from_faces(efa, NULL, efa, 0, 3, 2, 1);
- }
- else {
- SWAP(EditVert *, efa->v2, efa->v3);
- SWAP(EditEdge *, efa->e1, efa->e3);
- efa->e2->dir= 1-efa->e2->dir;
- EM_data_interp_from_faces(efa, NULL, efa, 0, 2, 1, 3);
- }
-
- if(efa->v4) CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
- else CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
-}
-
-
-void flip_editnormals(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- efa= em->faces.first;
- while(efa) {
- if( efa->f & SELECT ){
- flipface(efa);
- }
- efa= efa->next;
- }
-
- /* update vertex normals too */
- recalc_editnormals();
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-}
-
-/* does face centers too */
-void recalc_editnormals(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditVert *eve;
-
- for(eve= em->verts.first; eve; eve=eve->next) {
- eve->no[0] = eve->no[1] = eve->no[2] = 0.0;
- }
-
- for(efa= em->faces.first; efa; efa=efa->next) {
- if(efa->v4) {
- CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n);
- CalcCent4f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
- VecAddf(efa->v4->no, efa->v4->no, efa->n);
- }
- else {
- CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
- CalcCent3f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co);
- }
- VecAddf(efa->v1->no, efa->v1->no, efa->n);
- VecAddf(efa->v2->no, efa->v2->no, efa->n);
- VecAddf(efa->v3->no, efa->v3->no, efa->n);
- }
-
- /* following Mesh convention; we use vertex coordinate itself for normal in this case */
- for(eve= em->verts.first; eve; eve=eve->next) {
- if (Normalize(eve->no)==0.0) {
- VECCOPY(eve->no, eve->co);
- Normalize(eve->no);
- }
- }
-}
-
-int compareface(EditFace *vl1, EditFace *vl2)
-{
- EditVert *v1, *v2, *v3, *v4;
-
- if(vl1->v4 && vl2->v4) {
- v1= vl2->v1;
- v2= vl2->v2;
- v3= vl2->v3;
- v4= vl2->v4;
-
- if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1 || vl1->v4==v1) {
- if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2 || vl1->v4==v2) {
- if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3 || vl1->v4==v3) {
- if(vl1->v1==v4 || vl1->v2==v4 || vl1->v3==v4 || vl1->v4==v4) {
- return 1;
- }
- }
- }
- }
- }
- else if(vl1->v4==0 && vl2->v4==0) {
- v1= vl2->v1;
- v2= vl2->v2;
- v3= vl2->v3;
-
- if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1) {
- if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2) {
- if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3) {
- return 1;
- }
- }
- }
- }
-
- return 0;
-}
-
-/* checks for existance, not tria overlapping inside quad */
-EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, efatest;
-
- efatest.v1= v1;
- efatest.v2= v2;
- efatest.v3= v3;
- efatest.v4= v4;
-
- efa= em->faces.first;
- while(efa) {
- if(compareface(&efatest, efa)) return efa;
- efa= efa->next;
- }
- return NULL;
-}
-
-/* evaluate if entire quad is a proper convex quad */
-int convex(float *v1, float *v2, float *v3, float *v4)
-{
- float nor[3], nor1[3], nor2[3], vec[4][2];
-
- /* define projection, do both trias apart, quad is undefined! */
- CalcNormFloat(v1, v2, v3, nor1);
- CalcNormFloat(v1, v3, v4, nor2);
- nor[0]= ABS(nor1[0]) + ABS(nor2[0]);
- nor[1]= ABS(nor1[1]) + ABS(nor2[1]);
- nor[2]= ABS(nor1[2]) + ABS(nor2[2]);
-
- if(nor[2] >= nor[0] && nor[2] >= nor[1]) {
- vec[0][0]= v1[0]; vec[0][1]= v1[1];
- vec[1][0]= v2[0]; vec[1][1]= v2[1];
- vec[2][0]= v3[0]; vec[2][1]= v3[1];
- vec[3][0]= v4[0]; vec[3][1]= v4[1];
- }
- else if(nor[1] >= nor[0] && nor[1]>= nor[2]) {
- vec[0][0]= v1[0]; vec[0][1]= v1[2];
- vec[1][0]= v2[0]; vec[1][1]= v2[2];
- vec[2][0]= v3[0]; vec[2][1]= v3[2];
- vec[3][0]= v4[0]; vec[3][1]= v4[2];
- }
- else {
- vec[0][0]= v1[1]; vec[0][1]= v1[2];
- vec[1][0]= v2[1]; vec[1][1]= v2[2];
- vec[2][0]= v3[1]; vec[2][1]= v3[2];
- vec[3][0]= v4[1]; vec[3][1]= v4[2];
- }
-
- /* linetests, the 2 diagonals have to instersect to be convex */
- if( IsectLL2Df(vec[0], vec[2], vec[1], vec[3]) > 0 ) return 1;
- return 0;
-}
-
-
-/* ********************* Fake Polgon support (FGon) ***************** */
-
-
-/* results in:
- - faces having ->fgonf flag set (also for draw)
- - edges having ->fgoni index set (for select)
-*/
-
-float EM_face_area(EditFace *efa)
-{
- if(efa->v4) return AreaQ3Dfl(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
- else return AreaT3Dfl(efa->v1->co, efa->v2->co, efa->v3->co);
-}
-
-float EM_face_perimeter(EditFace *efa)
-{
- if(efa->v4) return
- VecLenf(efa->v1->co, efa->v2->co)+
- VecLenf(efa->v2->co, efa->v3->co)+
- VecLenf(efa->v3->co, efa->v4->co)+
- VecLenf(efa->v4->co, efa->v1->co);
-
- else return
- VecLenf(efa->v1->co, efa->v2->co)+
- VecLenf(efa->v2->co, efa->v3->co)+
- VecLenf(efa->v3->co, efa->v1->co);
-}
-
-void EM_fgon_flags(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, *efan, *efamax;
- EditEdge *eed;
- ListBase listb={NULL, NULL};
- float size, maxsize;
- short done, curindex= 1;
-
- // for each face with fgon edge AND not fgon flag set
- for(eed= em->edges.first; eed; eed= eed->next) eed->fgoni= 0; // index
- for(efa= em->faces.first; efa; efa= efa->next) efa->fgonf= 0; // flag
-
- // for speed & simplicity, put fgon face candidates in new listbase
- efa= em->faces.first;
- while(efa) {
- efan= efa->next;
- if( (efa->e1->h & EM_FGON) || (efa->e2->h & EM_FGON) ||
- (efa->e3->h & EM_FGON) || (efa->e4 && (efa->e4->h & EM_FGON)) ) {
- BLI_remlink(&em->faces, efa);
- BLI_addtail(&listb, efa);
- }
- efa= efan;
- }
-
- // find an undone face with fgon edge
- for(efa= listb.first; efa; efa= efa->next) {
- if(efa->fgonf==0) {
-
- // init this face
- efa->fgonf= EM_FGON;
- if(efa->e1->h & EM_FGON) efa->e1->fgoni= curindex;
- if(efa->e2->h & EM_FGON) efa->e2->fgoni= curindex;
- if(efa->e3->h & EM_FGON) efa->e3->fgoni= curindex;
- if(efa->e4 && (efa->e4->h & EM_FGON)) efa->e4->fgoni= curindex;
-
- // we search for largest face, to give facedot drawing rights
- maxsize= EM_face_area(efa);
- efamax= efa;
-
- // now flush curendex over edges and set faceflags
- done= 1;
- while(done==1) {
- done= 0;
-
- for(efan= listb.first; efan; efan= efan->next) {
- if(efan->fgonf==0) {
- // if one if its edges has index set, do other too
- if( (efan->e1->fgoni==curindex) || (efan->e2->fgoni==curindex) ||
- (efan->e3->fgoni==curindex) || (efan->e4 && (efan->e4->fgoni==curindex)) ) {
-
- efan->fgonf= EM_FGON;
- if(efan->e1->h & EM_FGON) efan->e1->fgoni= curindex;
- if(efan->e2->h & EM_FGON) efan->e2->fgoni= curindex;
- if(efan->e3->h & EM_FGON) efan->e3->fgoni= curindex;
- if(efan->e4 && (efan->e4->h & EM_FGON)) efan->e4->fgoni= curindex;
-
- size= EM_face_area(efan);
- if(size>maxsize) {
- efamax= efan;
- maxsize= size;
- }
- done= 1;
- }
- }
- }
- }
-
- efamax->fgonf |= EM_FGON_DRAW;
- curindex++;
-
- }
- }
-
- // put fgon face candidates back in listbase
- efa= listb.first;
- while(efa) {
- efan= efa->next;
- BLI_remlink(&listb, efa);
- BLI_addtail(&em->faces, efa);
- efa= efan;
- }
-
- // remove fgon flags when edge not in fgon (anymore)
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->fgoni==0) eed->h &= ~EM_FGON;
- }
-
-}
-
-/* editmesh vertmap, copied from intern.mesh.c
- * if do_face_idx_array is 0 it means we need to run it as well as freeing
- * */
-
-UvVertMap *make_uv_vert_map_EM(int selected, int do_face_idx_array, float *limit)
-{
- EditMesh *em = G.editMesh;
- EditVert *ev;
- EditFace *efa;
- int totverts;
-
- /* vars from original func */
- UvVertMap *vmap;
- UvMapVert *buf;
- MTFace *tf;
- unsigned int a;
- int i, totuv, nverts;
-
- if (do_face_idx_array)
- EM_init_index_arrays(0, 0, 1);
-
- /* we need the vert */
- for (ev= em->verts.first, totverts=0; ev; ev= ev->next, totverts++) {
- ev->tmp.l = totverts;
- }
-
- totuv = 0;
-
- /* generate UvMapVert array */
- for (efa= em->faces.first; efa; efa= efa->next)
- if(!selected || ((!efa->h) && (efa->f & SELECT)))
- totuv += (efa->v4)? 4: 3;
-
- if(totuv==0) {
- if (do_face_idx_array)
- EM_free_index_arrays();
- return NULL;
- }
- vmap= (UvVertMap*)MEM_callocN(sizeof(*vmap), "UvVertMap");
- if (!vmap) {
- if (do_face_idx_array)
- EM_free_index_arrays();
- return NULL;
- }
-
- vmap->vert= (UvMapVert**)MEM_callocN(sizeof(*vmap->vert)*totverts, "UvMapVert*");
- buf= vmap->buf= (UvMapVert*)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvMapVert");
-
- if (!vmap->vert || !vmap->buf) {
- free_uv_vert_map(vmap);
- if (do_face_idx_array)
- EM_free_index_arrays();
- return NULL;
- }
-
- for (a=0, efa= em->faces.first; efa; a++, efa= efa->next) {
- if(!selected || ((!efa->h) && (efa->f & SELECT))) {
- nverts= (efa->v4)? 4: 3;
-
- for(i=0; i<nverts; i++) {
- buf->tfindex= i;
- buf->f= a;
- buf->separate = 0;
-
- buf->next= vmap->vert[(*(&efa->v1 + i))->tmp.l];
- vmap->vert[(*(&efa->v1 + i))->tmp.l]= buf;
-
- buf++;
- }
- }
- }
-
- /* sort individual uvs for each vert */
- for(a=0, ev=em->verts.first; ev; a++, ev= ev->next) {
- UvMapVert *newvlist= NULL, *vlist=vmap->vert[a];
- UvMapVert *iterv, *v, *lastv, *next;
- float *uv, *uv2, uvdiff[2];
-
- while(vlist) {
- v= vlist;
- vlist= vlist->next;
- v->next= newvlist;
- newvlist= v;
-
- efa = EM_get_face_for_index(v->f);
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv = tf->uv[v->tfindex];
-
- lastv= NULL;
- iterv= vlist;
-
- while(iterv) {
- next= iterv->next;
- efa = EM_get_face_for_index(iterv->f);
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- uv2 = tf->uv[iterv->tfindex];
-
- Vec2Subf(uvdiff, uv2, uv);
-
- if(fabs(uv[0]-uv2[0]) < limit[0] && fabs(uv[1]-uv2[1]) < limit[1]) {
- if(lastv) lastv->next= next;
- else vlist= next;
- iterv->next= newvlist;
- newvlist= iterv;
- }
- else
- lastv=iterv;
-
- iterv= next;
- }
-
- newvlist->separate = 1;
- }
-
- vmap->vert[a]= newvlist;
- }
-
- if (do_face_idx_array)
- EM_free_index_arrays();
-
- return vmap;
-}
-
-UvMapVert *get_uv_map_vert_EM(UvVertMap *vmap, unsigned int v)
-{
- return vmap->vert[v];
-}
-
-void free_uv_vert_map_EM(UvVertMap *vmap)
-{
- if (vmap) {
- if (vmap->vert) MEM_freeN(vmap->vert);
- if (vmap->buf) MEM_freeN(vmap->buf);
- MEM_freeN(vmap);
- }
-}
-
diff --git a/source/blender/src/editmesh_loop.c b/source/blender/src/editmesh_loop.c
deleted file mode 100644
index dfd18e208fb..00000000000
--- a/source/blender/src/editmesh_loop.c
+++ /dev/null
@@ -1,951 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
-
-editmesh_loop: tools with own drawing subloops, select, knife, subdiv
-
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_ghash.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_cursors.h"
-#include "BIF_editmesh.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-#include "BSE_drawview.h"
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "PIL_time.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "editmesh.h"
-
-/* next 2 includes for knife tool... shouldnt be! (ton) */
-#include "GHOST_C-api.h"
-#include "winlay.h"
-
-
-/* New LoopCut */
-static void edgering_sel(EditEdge *startedge, int select, int previewlines)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
- EditVert *v[2][2];
- float co[2][3];
- int looking= 1,i;
-
- /* in eed->f1 we put the valence (amount of faces in edge) */
- /* in eed->f2 we put tagged flag as correct loop */
- /* in efa->f1 we put tagged flag as correct to select */
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- eed->f2= 0;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->f1= 0;
- if(efa->h==0) {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
-
- // tag startedge OK
- startedge->f2= 1;
-
- while(looking) {
- looking= 0;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e4 && efa->f1==0 && efa->h == 0) { // not done quad
- if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { // valence ok
-
- // if edge tagged, select opposing edge and mark face ok
- if(efa->e1->f2) {
- efa->e3->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- else if(efa->e2->f2) {
- efa->e4->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e3->f2) {
- efa->e1->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e4->f2) {
- efa->e2->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- }
- }
- }
- }
-
- if(previewlines > 0 && select == 0){
- persp(PERSP_VIEW);
- glPushMatrix();
- mymultmatrix(G.obedit->obmat);
- //glColor3ub(0, 255, 255);
- //glBegin(GL_LINES);
- //glVertex3f(nearest->v1->co[0],nearest->v1->co[1],nearest->v1->co[2]);
- //glVertex3f(nearest->v2->co[0],nearest->v2->co[1],nearest->v2->co[2]);
- //glEnd();
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->v4 == NULL) { continue; }
- if(efa->h == 0){
- if(efa->e1->f2 == 1){
- if(efa->e1->h == 1 || efa->e3->h == 1 )
- continue;
-
- v[0][0] = efa->v1;
- v[0][1] = efa->v2;
- v[1][0] = efa->v4;
- v[1][1] = efa->v3;
- } else if(efa->e2->f2 == 1){
- if(efa->e2->h == 1 || efa->e4->h == 1)
- continue;
- v[0][0] = efa->v2;
- v[0][1] = efa->v3;
- v[1][0] = efa->v1;
- v[1][1] = efa->v4;
- } else { continue; }
-
- for(i=1;i<=previewlines;i++){
- co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0];
- co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1];
- co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2];
-
- co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0];
- co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1];
- co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2];
- glColor3ub(255, 0, 255);
- glBegin(GL_LINES);
- glVertex3f(co[0][0],co[0][1],co[0][2]);
- glVertex3f(co[1][0],co[1][1],co[1][2]);
- glEnd();
- }
- }
- }
- glPopMatrix();
- } else {
-
- /* (de)select the edges */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2) EM_select_edge(eed, select);
- }
- }
-}
-void CutEdgeloop(int numcuts)
-{
- EditMesh *em = G.editMesh;
- EditEdge *nearest=NULL, *eed;
- float fac;
- int keys = 0, holdnum=0, selectmode, dist;
- short mvalo[2] = {0,0}, mval[2];
- short event, val, choosing=1, cancel=0, cuthalf = 0, smooth=0;
- short hasHidden = 0;
- char msg[128];
-
- selectmode = G.scene->selectmode;
-
- if(G.scene->selectmode & SCE_SELECT_FACE){
- G.scene->selectmode = SCE_SELECT_EDGE;
- EM_selectmode_set();
- }
-
-
- BIF_undo_push("Loopcut Begin");
- while(choosing && !cancel){
- getmouseco_areawin(mval);
- if (mval[0] != mvalo[0] || mval[1] != mvalo[1]) {
- mvalo[0] = mval[0];
- mvalo[1] = mval[1];
- dist= 50;
- nearest = findnearestedge(&dist); // returns actual distance in dist
- scrarea_do_windraw(curarea); // after findnearestedge, backbuf!
-
- sprintf(msg,"Number of Cuts: %d",numcuts);
- if(smooth){
- sprintf(msg,"%s (S)mooth: on",msg);
- } else {
- sprintf(msg,"%s (S)mooth: off",msg);
- }
-
- headerprint(msg);
- /* Need to figure preview */
- if(nearest){
- edgering_sel(nearest, 0, numcuts);
- }
- screen_swapbuffers();
-
- /* backbuffer refresh for non-apples (no aux) */
-#ifndef __APPLE__
- if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
- backdrawview3d(0);
- }
-#endif
- }
- else PIL_sleep_ms(10); // idle
-
-
- while(qtest())
- {
- val=0;
- event= extern_qread(&val);
- if(val && (event == MOUSEX || event == MOUSEY)){ ; }
- else if(val && ((event==LEFTMOUSE || event==RETKEY) || (event == MIDDLEMOUSE || event==PADENTER)))
- {
- if(event == MIDDLEMOUSE){
- cuthalf = 1;
- }
- if (nearest==NULL)
- cancel = 1;
- choosing=0;
- mvalo[0] = -1;
- }
- else if(val && (event==ESCKEY || event==RIGHTMOUSE ))
- {
- choosing=0;
- cancel = 1;
- mvalo[0] = -1;
- }
- else if(val && (event==PADPLUSKEY || event==WHEELUPMOUSE))
- {
- numcuts++;
- mvalo[0] = -1;
- }
- else if(val && (event==PADMINUS || event==WHEELDOWNMOUSE))
- {
- if(numcuts > 1){
- numcuts--;
- mvalo[0] = -1;
- }
- }
- else if(val && event==SKEY)
- {
- if(smooth){smooth=0;}
- else { smooth=1; }
- mvalo[0] = -1;
- }
-
- else if(val){
- holdnum = -1;
- switch(event){
- case PAD9:
- case NINEKEY:
- holdnum = 9; break;
- case PAD8:
- case EIGHTKEY:
- holdnum = 8;break;
- case PAD7:
- case SEVENKEY:
- holdnum = 7;break;
- case PAD6:
- case SIXKEY:
- holdnum = 6;break;
- case PAD5:
- case FIVEKEY:
- holdnum = 5;break;
- case PAD4:
- case FOURKEY:
- holdnum = 4;break;
- case PAD3:
- case THREEKEY:
- holdnum = 3; break;
- case PAD2:
- case TWOKEY:
- holdnum = 2;break;
- case PAD1:
- case ONEKEY:
- holdnum = 1; break;
- case PAD0:
- case ZEROKEY:
- holdnum = 0;break;
- case BACKSPACEKEY:
- holdnum = -2;break;
- }
- if(holdnum >= 0 && numcuts*10 < 130){
- if(keys == 0){ // first level numeric entry
- if(holdnum > 0){
- numcuts = holdnum;
- keys++;
- }
- } else if(keys > 0){//highrt level numeric entry
- numcuts *= 10;
- numcuts += holdnum;
- keys++;
- }
- } else if (holdnum == -2){// backspace
- if (keys > 1){
- numcuts /= 10;
- keys--;
- } else {
- numcuts=1;
- keys = 0;
- }
- }
- mvalo[0] = -1;
- break;
- } // End Numeric Entry
- } //End while(qtest())
- } // End Choosing
- scrarea_queue_winredraw(curarea);
-
- if(cancel){
- return;
- }
- /* clean selection */
- for(eed=em->edges.first; eed; eed = eed->next){
- EM_select_edge(eed,0);
- }
- /* select edge ring */
- edgering_sel(nearest, 1, 0);
-
- /* now cut the loops */
- if(smooth){
- fac= 1.0f;
- if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
- fac= 0.292f*fac;
- esubdivideflag(SELECT,fac,B_SMOOTH,numcuts,SUBDIV_SELECT_LOOPCUT);
- } else {
- esubdivideflag(SELECT,0,0,numcuts,SUBDIV_SELECT_LOOPCUT);
- }
- /* if this was a single cut, enter edgeslide mode */
- if(numcuts == 1 && hasHidden == 0){
- if(cuthalf)
- EdgeSlide(1,0.0);
- else {
- if(EdgeSlide(0,0.0) == -1){
- BIF_undo();
- }
- }
- }
-
- if(G.scene->selectmode != selectmode){
- G.scene->selectmode = selectmode;
- EM_selectmode_set();
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
-#endif
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- return;
-}
-
-
-/* *************** LOOP SELECT ************* */
-#if 0
-static short edgeFaces(EditEdge *e)
-{
- EditMesh *em = G.editMesh;
- EditFace *search=NULL;
- short count = 0;
-
- search = em->faces.first;
- while(search){
- if((search->e1 == e || search->e2 == e) || (search->e3 == e || search->e4 == e))
- count++;
- search = search->next;
- }
- return count;
-}
-#endif
-
-/* this utility function checks to see if 2 edit edges share a face,
- returns 1 if they do
- returns 0 if they do not, or if the function is passed the same edge 2 times
-*/
-short sharesFace(EditEdge* e1, EditEdge* e2)
-{
- EditMesh *em = G.editMesh;
- EditFace *search=NULL;
-
- search = em->faces.first;
- if (e1 == e2){
- return 0 ;
- }
- while(search){
- if(
- ((search->e1 == e1 || search->e2 == e1) || (search->e3 == e1 || search->e4 == e1)) &&
- ((search->e1 == e2 || search->e2 == e2) || (search->e3 == e2 || search->e4 == e2))
- ) {
- return 1;
- }
- search = search->next;
- }
- return 0;
-}
-
-
-/* ***************** TRAIL ************************
-
-Read a trail of mouse coords and return them as an array of CutCurve structs
-len returns number of mouse coords read before commiting with RETKEY
-It is up to the caller to free the block when done with it,
-
-XXX Is only used here, so local inside this file (ton)
- */
-
-#define TRAIL_POLYLINE 1 /* For future use, They don't do anything yet */
-#define TRAIL_FREEHAND 2
-#define TRAIL_MIXED 3 /* (1|2) */
-#define TRAIL_AUTO 4
-#define TRAIL_MIDPOINTS 8
-
-typedef struct CutCurve {
- float x;
- float y;
-} CutCurve;
-
-static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash *gh)
-{
- CutCurve *curve,*temp;
- EditVert *snapvert;
- float *scr, mval[2]={0.0,0.0}, lastx=0, lasty=0, lockx=0, locky=0;
- int i=0, j, blocks=1, lasti=0;
- int dist, tolerance;
- short event, val, qual, vsnap=0, ldown=0, restart=0, rubberband=0;
- short mval1[2], lockaxis=0, oldmode;
-
- *len=0;
- tolerance = 75;
-
- curve=(CutCurve *)MEM_callocN(1024*sizeof(CutCurve), "MouseTrail");
-
- if (!curve) {
- printf("failed to allocate memory in get_mouse_trail()\n");
- return(NULL);
- }
- mywinset(curarea->win);
-
-
- if(cutmode != KNIFE_MULTICUT){
- /*redraw backbuffer if in zbuffered selection mode but not vertex selection*/
- if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
- oldmode = G.scene->selectmode;
- G.scene->selectmode = SCE_SELECT_VERTEX;
- backdrawview3d(0);
- G.scene->selectmode = oldmode;
- }
- glDrawBuffer(GL_FRONT);
- headerprint("(LMB) draw, (Ctrl held while drawing) snap to vertex, (MMB) constrain to x/y screen axis, (Enter) cut "
- "(with Ctrl to select cut line), (Esc) cancel");
- }
- else{
- glDrawBuffer(GL_FRONT);
- headerprint("(LMB) draw, (MMB) constrain to x/y screen axis, (Enter) cut (with Ctrl to select cut line), (Esc) cancel");
- }
- bglFlush();
-
- persp(PERSP_WIN);
-
- glColor3ub(255, 0, 255);
-
- while(TRUE) {
-
- event=extern_qread(&val); /* Enter or RMB indicates finish */
- if(val) {
- if(event==RETKEY || event==PADENTER) break;
- }
-
- if( event==ESCKEY || event==RIGHTMOUSE ) {
- if (curve) MEM_freeN(curve);
- *len=0;
- bglFlush();
- glDrawBuffer(GL_BACK);
- return(NULL);
- }
-
- if (rubberband) { /* rubberband mode, undraw last rubberband */
- glLineWidth(2.0);
- sdrawXORline((int)curve[i-1].x, (int)curve[i-1].y,(int)mval[0],(int) mval[1]);
- glLineWidth(1.0);
- glFlush();
- rubberband=0;
- }
-
- /*handle vsnap*/
- vsnap = 0;
- if(cutmode != KNIFE_MULTICUT){
- qual = get_qual();
- if(qual & LR_CTRLKEY) vsnap = 1;
- }
-
- if(vsnap){
- persp(PERSP_VIEW);
- dist = tolerance;
- snapvert = findnearestvert(&dist, SELECT, 0);
- glColor3ub(255, 0, 255);
- glDrawBuffer(GL_FRONT);
- persp(PERSP_WIN);
- if(snapvert && (dist < tolerance)){
- scr = BLI_ghash_lookup(gh, snapvert);
- mval[0] = scr[0];
- mval[1] = scr[1];
- }
- else{
- getmouseco_areawin(mval1);
- mval[0] = (float)mval1[0];
- mval[1] = (float)mval1[1];
- }
- }
-
- else{
- getmouseco_areawin(mval1);
- mval[0] = (float)mval1[0];
- mval[1] = (float)mval1[1];
- }
-
-
- if (lockaxis==1) mval[1]=locky;
- if (lockaxis==2) mval[0]=lockx;
-
- if ( ((i==0) || (mval[0]!=curve[i-1].x) || (mval[1]!=curve[i-1].y))
- && (get_mbut() & L_MOUSE) ){ /* record changes only, if LMB down */
-
- lastx=curve[i].x=mval[0];
- lasty=curve[i].y=mval[1];
-
- lockaxis=0;
-
- i++;
-
- ldown=1;
- if (restart) {
- for(j=1;j<i;j++) sdrawXORline((int)curve[j-1].x, (int)curve[j-1].y, (int)curve[j].x, (int)curve[j].y);
- if (rubberband) sdrawXORline((int)curve[j].x, (int)curve[j].y, (int)mval[0], (int)mval[1]);
- glFlush();
- rubberband=0;
- lasti=i=0;
- restart=0;
- ldown=0;
- }
- }
-
- if ((event==MIDDLEMOUSE)&&(get_mbut()&M_MOUSE)&&(i)){/*MMB Down*/
- /*determine which axis to lock to, or clear if locked */
- if (lockaxis) lockaxis=0;
- else if (abs(curve[i-1].x-mval[0]) > abs(curve[i-1].y-mval[1])) lockaxis=1;
- else lockaxis=2;
-
- if (lockaxis) {
- lockx=lastx;
- locky=lasty;
- }
- }
-
- if ((i>1)&&(i!=lasti)) { /*Draw recorded part of curve */
- sdrawline((int)curve[i-2].x, (int)curve[i-2].y, (int)curve[i-1].x, (int)curve[i-1].y);
- bglFlush();
- }
-
- if ((i==lasti)&&(i>0)) { /*Draw rubberband */
- glLineWidth(2.0);
- sdrawXORline((int)curve[i-1].x, (int)curve[i-1].y,(int)mval[0], (int)mval[1]);
- glLineWidth(1.0);
- bglFlush();
- rubberband=1;
- }
- lasti=i;
-
- if (i>=blocks*1024) { /* reallocate data if out of room */
- temp=curve;
- curve=(CutCurve *)MEM_callocN((blocks+1)*1024*sizeof(CutCurve), "MouseTrail");
- if (!curve) {
- printf("failed to re-allocate memory in get_mouse_trail()\n");
- return(NULL);
- }
- memcpy(curve, temp, blocks*1024*sizeof(CutCurve));
- blocks++;
- MEM_freeN(temp);
- }
- }
-
- bglFlush();
- glDrawBuffer(GL_BACK);
- persp(PERSP_VIEW);
-
- *len=i;
-
- return(curve);
-}
-
-
-
-
-/* ******************************************************************** */
-/* Knife Subdivide Tool. Subdivides edges intersected by a mouse trail
- drawn by user.
-
- Currently mapped to KKey when in MeshEdit mode.
- Usage:
- Hit Shift K, Select Centers or Exact
- Hold LMB down to draw path, hit RETKEY.
- ESC cancels as expected.
-
- Contributed by Robert Wenzlaff (Det. Thorn).
-*/
-
-/* prototype */
-static float seg_intersect(struct EditEdge * e, CutCurve *c, int len, char mode, struct GHash *gh);
-
-void KnifeSubdivide(char mode)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditVert *eve;
- CutCurve *curve;
- Window *win;
-
- struct GHash *gh;
- int oldcursor, len=0;
- float isect=0.0;
- short numcuts=1;
- float *scr, co[4];
-
- if (G.obedit==0) return;
-
- if (EM_nvertices_selected() < 2) {
- error("No edges are selected to operate on");
- return;
- }
-
- if (mode==KNIFE_PROMPT) {
- short val= pupmenu("Cut Type %t|Exact Line%x1|Midpoints%x2|Multicut%x3");
- if(val<1) return;
- mode = val; // warning, mode is char, pupmenu returns -1 with ESC
- }
-
- if(mode == KNIFE_MULTICUT) {
- if(button(&numcuts, 2, 128, "Number of Cuts:")==0) return;
- }
-
- /* Set a knife cursor here */
- oldcursor=get_cursor();
-
- win=winlay_get_active_window();
-
- SetBlenderCursor(BC_KNIFECURSOR);
-
- for(eed=em->edges.first; eed; eed= eed->next) eed->tmp.fp = 0.0; /*store percentage of edge cut for KNIFE_EXACT here.*/
-
- /*the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer*/
- gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
- for(eve=em->verts.first; eve; eve=eve->next){
- scr = MEM_mallocN(sizeof(float)*2, "Vertex Screen Coordinates");
- VECCOPY(co, eve->co);
- co[3]= 1.0;
- Mat4MulVec4fl(G.obedit->obmat, co);
- project_float(co,scr);
- BLI_ghash_insert(gh, eve, scr);
- eve->f1 = 0; /*store vertex intersection flag here*/
-
- }
-
- curve=get_mouse_trail(&len, TRAIL_MIXED, mode, gh);
-
- if (curve && len && mode){
- eed= em->edges.first;
- while(eed) {
- if( eed->v1->f & eed->v2->f & SELECT ){ // NOTE: uses vertex select, subdiv doesnt do edges yet
- isect=seg_intersect(eed, curve, len, mode, gh);
- if (isect) eed->f2= 1;
- else eed->f2=0;
- eed->tmp.fp= isect;
- //printf("isect=%i\n", isect);
- }
- else {
- eed->f2=0;
- eed->f1=0;
- }
- eed= eed->next;
- }
-
- if(mode==KNIFE_EXACT) esubdivideflag(SELECT, 0, B_KNIFE|B_PERCENTSUBD,1,SUBDIV_SELECT_ORIG);
- else if (mode==KNIFE_MIDPOINT) esubdivideflag(SELECT, 0, B_KNIFE,1,SUBDIV_SELECT_ORIG);
- else if (mode==KNIFE_MULTICUT) esubdivideflag(SELECT, 0, B_KNIFE,numcuts,SUBDIV_SELECT_ORIG);
-
- eed=em->edges.first;
- while(eed){
- eed->f2=0;
- eed->f1=0;
- eed=eed->next;
- }
- }
- /* Return to old cursor and flags...*/
-
- addqueue(curarea->win, REDRAW, 0);
- window_set_cursor(win, oldcursor);
- BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN);
- if (curve) MEM_freeN(curve);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- BIF_undo_push("Knife");
-}
-
-/* seg_intersect() Determines if and where a mouse trail intersects an EditEdge */
-
-static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct GHash *gh)
-{
-#define MAXSLOPE 100000
- float x11, y11, x12=0, y12=0, x2max, x2min, y2max;
- float y2min, dist, lastdist=0, xdiff2, xdiff1;
- float m1, b1, m2, b2, x21, x22, y21, y22, xi;
- float yi, x1min, x1max, y1max, y1min, perc=0;
- float *scr;
- float threshold;
- int i;
-
- //threshold = 0.000001; /*tolerance for vertex intersection*/
- threshold = G.scene->toolsettings->select_thresh / 100;
-
- /* Get screen coords of verts */
- scr = BLI_ghash_lookup(gh, e->v1);
- x21=scr[0];
- y21=scr[1];
-
- scr = BLI_ghash_lookup(gh, e->v2);
- x22=scr[0];
- y22=scr[1];
-
- xdiff2=(x22-x21);
- if (xdiff2) {
- m2=(y22-y21)/xdiff2;
- b2= ((x22*y21)-(x21*y22))/xdiff2;
- }
- else {
- m2=MAXSLOPE; /* Verticle slope */
- b2=x22;
- }
-
- /*check for *exact* vertex intersection first*/
- if(mode!=KNIFE_MULTICUT){
- for (i=0; i<len; i++){
- if (i>0){
- x11=x12;
- y11=y12;
- }
- else {
- x11=c[i].x;
- y11=c[i].y;
- }
- x12=c[i].x;
- y12=c[i].y;
-
- /*test e->v1*/
- if((x11 == x21 && y11 == y21) || (x12 == x21 && y12 == y21)){
- e->v1->f1 = 1;
- perc = 0;
- return(perc);
- }
- /*test e->v2*/
- else if((x11 == x22 && y11 == y22) || (x12 == x22 && y12 == y22)){
- e->v2->f1 = 1;
- perc = 0;
- return(perc);
- }
- }
- }
-
- /*now check for edge interesect (may produce vertex intersection as well)*/
- for (i=0; i<len; i++){
- if (i>0){
- x11=x12;
- y11=y12;
- }
- else {
- x11=c[i].x;
- y11=c[i].y;
- }
- x12=c[i].x;
- y12=c[i].y;
-
- /* Perp. Distance from point to line */
- if (m2!=MAXSLOPE) dist=(y12-m2*x12-b2);/* /sqrt(m2*m2+1); Only looking for */
- /* change in sign. Skip extra math */
- else dist=x22-x12;
-
- if (i==0) lastdist=dist;
-
- /* if dist changes sign, and intersect point in edge's Bound Box*/
- if ((lastdist*dist)<=0){
- xdiff1=(x12-x11); /* Equation of line between last 2 points */
- if (xdiff1){
- m1=(y12-y11)/xdiff1;
- b1= ((x12*y11)-(x11*y12))/xdiff1;
- }
- else{
- m1=MAXSLOPE;
- b1=x12;
- }
- x2max=MAX2(x21,x22)+0.001; /* prevent missed edges */
- x2min=MIN2(x21,x22)-0.001; /* due to round off error */
- y2max=MAX2(y21,y22)+0.001;
- y2min=MIN2(y21,y22)-0.001;
-
- /* Found an intersect, calc intersect point */
- if (m1==m2){ /* co-incident lines */
- /* cut at 50% of overlap area*/
- x1max=MAX2(x11, x12);
- x1min=MIN2(x11, x12);
- xi= (MIN2(x2max,x1max)+MAX2(x2min,x1min))/2.0;
-
- y1max=MAX2(y11, y12);
- y1min=MIN2(y11, y12);
- yi= (MIN2(y2max,y1max)+MAX2(y2min,y1min))/2.0;
- }
- else if (m2==MAXSLOPE){
- xi=x22;
- yi=m1*x22+b1;
- }
- else if (m1==MAXSLOPE){
- xi=x12;
- yi=m2*x12+b2;
- }
- else {
- xi=(b1-b2)/(m2-m1);
- yi=(b1*m2-m1*b2)/(m2-m1);
- }
-
- /* Intersect inside bounding box of edge?*/
- if ((xi>=x2min)&&(xi<=x2max)&&(yi<=y2max)&&(yi>=y2min)){
- /*test for vertex intersect that may be 'close enough'*/
- if(mode!=KNIFE_MULTICUT){
- if(xi <= (x21 + threshold) && xi >= (x21 - threshold)){
- if(yi <= (y21 + threshold) && yi >= (y21 - threshold)){
- e->v1->f1 = 1;
- perc = 0;
- break;
- }
- }
- if(xi <= (x22 + threshold) && xi >= (x22 - threshold)){
- if(yi <= (y22 + threshold) && yi >= (y22 - threshold)){
- e->v2->f1 = 1;
- perc = 0;
- break;
- }
- }
- }
- if ((m2<=1.0)&&(m2>=-1.0)) perc = (xi-x21)/(x22-x21);
- else perc=(yi-y21)/(y22-y21); /*lower slope more accurate*/
- //isect=32768.0*(perc+0.0000153); /* Percentage in 1/32768ths */
- break;
- }
- }
- lastdist=dist;
- }
- return(perc);
-}
-
-void LoopMenu() /* Called by KKey */
-{
- short ret;
-
- ret=pupmenu("Loop/Cut Menu %t|Loop Cut (CTRL-R)%x2|"
- "Knife (Exact) %x3|Knife (Midpoints)%x4|Knife (Multicut)%x5");
-
- switch (ret){
- case 2:
- CutEdgeloop(1);
- break;
- case 3:
- KnifeSubdivide(KNIFE_EXACT);
- break;
- case 4:
- KnifeSubdivide(KNIFE_MIDPOINT);
- break;
- case 5:
- KnifeSubdivide(KNIFE_MULTICUT);
- break;
- }
-
-}
-
diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c
deleted file mode 100644
index 3dbbe7d7336..00000000000
--- a/source/blender/src/editmesh_mods.c
+++ /dev/null
@@ -1,4457 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
-
-editmesh_mods.c, UI level access, no geometry changes
-
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "MTC_matrixops.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_rand.h"
-
-#include "BKE_displist.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_editmesh.h"
-#include "BIF_resources.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_editsima.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-
-#include "BSE_drawview.h"
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "RE_render_ext.h" /* externtex */
-
-#include "multires.h"
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "editmesh.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* ****************************** MIRROR **************** */
-
-void EM_select_mirrored(void)
-{
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
- v1= editmesh_get_x_mirror_vert(G.obedit, eve->co);
- if(v1) {
- eve->f &= ~SELECT;
- v1->f |= SELECT;
- }
- }
- }
- }
-}
-
-void EM_automerge(int update) {
- int len;
- if ((G.scene->automerge) &&
- (G.obedit && G.obedit->type==OB_MESH) &&
- (((Mesh*)G.obedit->data)->mr==NULL)
- ) {
- len = removedoublesflag(1, 1, G.scene->toolsettings->doublimit);
- if (len) {
- G.totvert -= len; /* saves doing a countall */
- if (update) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- }
- }
-}
-
-/* ****************************** SELECTION ROUTINES **************** */
-
-unsigned int em_solidoffs=0, em_wireoffs=0, em_vertoffs=0; /* set in drawobject.c ... for colorindices */
-
-/* facilities for border select and circle select */
-static char *selbuf= NULL;
-
-/* opengl doesn't support concave... */
-static void draw_triangulated(short mcords[][2], short tot)
-{
- ListBase lb={NULL, NULL};
- DispList *dl;
- float *fp;
- int a;
-
- /* make displist */
- dl= MEM_callocN(sizeof(DispList), "poly disp");
- dl->type= DL_POLY;
- dl->parts= 1;
- dl->nr= tot;
- dl->verts= fp= MEM_callocN(tot*3*sizeof(float), "poly verts");
- BLI_addtail(&lb, dl);
-
- for(a=0; a<tot; a++, fp+=3) {
- fp[0]= (float)mcords[a][0];
- fp[1]= (float)mcords[a][1];
- }
-
- /* do the fill */
- filldisplist(&lb, &lb);
-
- /* do the draw */
- dl= lb.first; /* filldisplist adds in head of list */
- if(dl->type==DL_INDEX3) {
- int *index;
-
- a= dl->parts;
- fp= dl->verts;
- index= dl->index;
- glBegin(GL_TRIANGLES);
- while(a--) {
- glVertex3fv(fp+3*index[0]);
- glVertex3fv(fp+3*index[1]);
- glVertex3fv(fp+3*index[2]);
- index+= 3;
- }
- glEnd();
- }
-
- freedisplist(&lb);
-}
-
-
-/* reads rect, and builds selection array for quick lookup */
-/* returns if all is OK */
-int EM_init_backbuf_border(short xmin, short ymin, short xmax, short ymax)
-{
- struct ImBuf *buf;
- unsigned int *dr;
- int a;
-
- if(G.obedit==NULL || G.vd->drawtype<OB_SOLID || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 0;
- if(em_vertoffs==0) return 0;
-
- buf= read_backbuf(xmin, ymin, xmax, ymax);
- if(buf==NULL) return 0;
-
- dr = buf->rect;
-
- /* build selection lookup */
- selbuf= MEM_callocN(em_vertoffs+1, "selbuf");
-
- a= (xmax-xmin+1)*(ymax-ymin+1);
- while(a--) {
- if(*dr>0 && *dr<=em_vertoffs)
- selbuf[*dr]= 1;
- dr++;
- }
- IMB_freeImBuf(buf);
- return 1;
-}
-
-int EM_check_backbuf(unsigned int index)
-{
- if(selbuf==NULL) return 1;
- if(index>0 && index<=em_vertoffs)
- return selbuf[index];
- return 0;
-}
-
-void EM_free_backbuf(void)
-{
- if(selbuf) MEM_freeN(selbuf);
- selbuf= NULL;
-}
-
-/* mcords is a polygon mask
- - grab backbuffer,
- - draw with black in backbuffer,
- - grab again and compare
- returns 'OK'
-*/
-int EM_mask_init_backbuf_border(short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
-{
- unsigned int *dr, *drm;
- struct ImBuf *buf, *bufmask;
- int a;
-
- /* method in use for face selecting too */
- if(G.obedit==NULL) {
- if(FACESEL_PAINT_TEST);
- else return 0;
- }
- else if(G.vd->drawtype<OB_SOLID || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 0;
-
- if(em_vertoffs==0) return 0;
-
- buf= read_backbuf(xmin, ymin, xmax, ymax);
- if(buf==NULL) return 0;
-
- dr = buf->rect;
-
- /* draw the mask */
-#ifdef __APPLE__
- glDrawBuffer(GL_AUX0);
-#endif
- glDisable(GL_DEPTH_TEST);
-
- persp(PERSP_WIN);
- glColor3ub(0, 0, 0);
-
- /* yah, opengl doesn't do concave... tsk! */
- draw_triangulated(mcords, tot);
-
- glBegin(GL_LINE_LOOP); /* for zero sized masks, lines */
- for(a=0; a<tot; a++) glVertex2s(mcords[a][0], mcords[a][1]);
- glEnd();
-
- persp(PERSP_VIEW);
- glFinish(); /* to be sure readpixels sees mask */
-
- glDrawBuffer(GL_BACK);
-
- /* grab mask */
- bufmask= read_backbuf(xmin, ymin, xmax, ymax);
- drm = bufmask->rect;
- if(bufmask==NULL) return 0; /* only when mem alloc fails, go crash somewhere else! */
-
- /* build selection lookup */
- selbuf= MEM_callocN(em_vertoffs+1, "selbuf");
-
- a= (xmax-xmin+1)*(ymax-ymin+1);
- while(a--) {
- if(*dr>0 && *dr<=em_vertoffs && *drm==0) selbuf[*dr]= 1;
- dr++; drm++;
- }
- IMB_freeImBuf(buf);
- IMB_freeImBuf(bufmask);
- return 1;
-
-}
-
-/* circle shaped sample area */
-int EM_init_backbuf_circle(short xs, short ys, short rads)
-{
- struct ImBuf *buf;
- unsigned int *dr;
- short xmin, ymin, xmax, ymax, xc, yc;
- int radsq;
-
- /* method in use for face selecting too */
- if(G.obedit==NULL) {
- if(FACESEL_PAINT_TEST);
- else return 0;
- }
- else if(G.vd->drawtype<OB_SOLID || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 0;
- if(em_vertoffs==0) return 0;
-
- xmin= xs-rads; xmax= xs+rads;
- ymin= ys-rads; ymax= ys+rads;
- buf= read_backbuf(xmin, ymin, xmax, ymax);
- if(buf==NULL) return 0;
-
- dr = buf->rect;
-
- /* build selection lookup */
- selbuf= MEM_callocN(em_vertoffs+1, "selbuf");
- radsq= rads*rads;
- for(yc= -rads; yc<=rads; yc++) {
- for(xc= -rads; xc<=rads; xc++, dr++) {
- if(xc*xc + yc*yc < radsq) {
- if(*dr>0 && *dr<=em_vertoffs) selbuf[*dr]= 1;
- }
- }
- }
-
- IMB_freeImBuf(buf);
- return 1;
-
-}
-
-static void findnearestvert__doClosest(void *userData, EditVert *eve, int x, int y, int index)
-{
- struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } *data = userData;
-
- if (data->pass==0) {
- if (index<=data->lastIndex)
- return;
- } else {
- if (index>data->lastIndex)
- return;
- }
-
- if (data->dist>3) {
- int temp = abs(data->mval[0] - x) + abs(data->mval[1]- y);
- if ((eve->f&1) == data->select) {
- if (data->strict == 1)
- return;
- else
- temp += 5;
- }
-
- if (temp<data->dist) {
- data->dist = temp;
- data->closest = eve;
- data->closestIndex = index;
- }
- }
-}
-
-
-
-
-static unsigned int findnearestvert__backbufIndextest(unsigned int index){
- EditVert *eve = BLI_findlink(&G.editMesh->verts, index-1);
- if(eve && (eve->f & SELECT)) return 0;
- return 1;
-}
-/**
- * findnearestvert
- *
- * dist (in/out): minimal distance to the nearest and at the end, actual distance
- * sel: selection bias
- * if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts
- * if 0, unselected vertice are given the bias
- * strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
- */
-EditVert *findnearestvert(int *dist, short sel, short strict)
-{
- short mval[2];
-
- getmouseco_areawin(mval);
- if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)){
- int distance;
- unsigned int index;
- EditVert *eve;
-
- if(strict) index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, strict, findnearestvert__backbufIndextest);
- else index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, 0, NULL);
-
- eve = BLI_findlink(&G.editMesh->verts, index-1);
-
- if(eve && distance < *dist) {
- *dist = distance;
- return eve;
- } else {
- return NULL;
- }
-
- }
- else {
- struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } data;
- static int lastSelectedIndex=0;
- static EditVert *lastSelected=NULL;
-
- if (lastSelected && BLI_findlink(&G.editMesh->verts, lastSelectedIndex)!=lastSelected) {
- lastSelectedIndex = 0;
- lastSelected = NULL;
- }
-
- data.lastIndex = lastSelectedIndex;
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.select = sel;
- data.dist = *dist;
- data.strict = strict;
- data.closest = NULL;
- data.closestIndex = 0;
-
- data.pass = 0;
- mesh_foreachScreenVert(findnearestvert__doClosest, &data, 1);
-
- if (data.dist>3) {
- data.pass = 1;
- mesh_foreachScreenVert(findnearestvert__doClosest, &data, 1);
- }
-
- *dist = data.dist;
- lastSelected = data.closest;
- lastSelectedIndex = data.closestIndex;
-
- return data.closest;
- }
-}
-
-/* returns labda for closest distance v1 to line-piece v2-v3 */
-static float labda_PdistVL2Dfl( float *v1, float *v2, float *v3)
-{
- float rc[2], len;
-
- rc[0]= v3[0]-v2[0];
- rc[1]= v3[1]-v2[1];
- len= rc[0]*rc[0]+ rc[1]*rc[1];
- if(len==0.0f)
- return 0.0f;
-
- return ( rc[0]*(v1[0]-v2[0]) + rc[1]*(v1[1]-v2[1]) )/len;
-}
-
-/* note; uses G.vd, so needs active 3d window */
-static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
-{
- struct { float mval[2]; int dist; EditEdge *closest; } *data = userData;
- float v1[2], v2[2];
- int distance;
-
- v1[0] = x0;
- v1[1] = y0;
- v2[0] = x1;
- v2[1] = y1;
-
- distance= PdistVL2Dfl(data->mval, v1, v2);
-
- if(eed->f & SELECT) distance+=5;
- if(distance < data->dist) {
- if(G.vd->flag & V3D_CLIPPING) {
- float labda= labda_PdistVL2Dfl(data->mval, v1, v2);
- float vec[3];
-
- vec[0]= eed->v1->co[0] + labda*(eed->v2->co[0] - eed->v1->co[0]);
- vec[1]= eed->v1->co[1] + labda*(eed->v2->co[1] - eed->v1->co[1]);
- vec[2]= eed->v1->co[2] + labda*(eed->v2->co[2] - eed->v1->co[2]);
- Mat4MulVecfl(G.obedit->obmat, vec);
-
- if(view3d_test_clipping(G.vd, vec)==0) {
- data->dist = distance;
- data->closest = eed;
- }
- }
- else {
- data->dist = distance;
- data->closest = eed;
- }
- }
-}
-EditEdge *findnearestedge(int *dist)
-{
- short mval[2];
-
- getmouseco_areawin(mval);
-
- if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
- int distance;
- unsigned int index = sample_backbuf_rect(mval, 50, em_solidoffs, em_wireoffs, &distance,0, NULL);
- EditEdge *eed = BLI_findlink(&G.editMesh->edges, index-1);
-
- if (eed && distance<*dist) {
- *dist = distance;
- return eed;
- } else {
- return NULL;
- }
- }
- else {
- struct { float mval[2]; int dist; EditEdge *closest; } data;
-
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.dist = *dist;
- data.closest = NULL;
-
- mesh_foreachScreenEdge(findnearestedge__doClosest, &data, 2);
-
- *dist = data.dist;
- return data.closest;
- }
-}
-
-static void findnearestface__getDistance(void *userData, EditFace *efa, int x, int y, int index)
-{
- struct { short mval[2]; int dist; EditFace *toFace; } *data = userData;
-
- if (efa==data->toFace) {
- int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
-
- if (temp<data->dist)
- data->dist = temp;
- }
-}
-static void findnearestface__doClosest(void *userData, EditFace *efa, int x, int y, int index)
-{
- struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } *data = userData;
-
- if (data->pass==0) {
- if (index<=data->lastIndex)
- return;
- } else {
- if (index>data->lastIndex)
- return;
- }
-
- if (data->dist>3) {
- int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y);
-
- if (temp<data->dist) {
- data->dist = temp;
- data->closest = efa;
- data->closestIndex = index;
- }
- }
-}
-static EditFace *findnearestface(int *dist)
-{
- short mval[2];
-
- getmouseco_areawin(mval);
-
- if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
- unsigned int index = sample_backbuf(mval[0], mval[1]);
- EditFace *efa = BLI_findlink(&G.editMesh->faces, index-1);
-
- if (efa) {
- struct { short mval[2]; int dist; EditFace *toFace; } data;
-
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.dist = 0x7FFF; /* largest short */
- data.toFace = efa;
-
- mesh_foreachScreenFace(findnearestface__getDistance, &data);
-
- if(G.scene->selectmode == SCE_SELECT_FACE || data.dist<*dist) { /* only faces, no dist check */
- *dist= data.dist;
- return efa;
- }
- }
-
- return NULL;
- }
- else {
- struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } data;
- static int lastSelectedIndex=0;
- static EditFace *lastSelected=NULL;
-
- if (lastSelected && BLI_findlink(&G.editMesh->faces, lastSelectedIndex)!=lastSelected) {
- lastSelectedIndex = 0;
- lastSelected = NULL;
- }
-
- data.lastIndex = lastSelectedIndex;
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.dist = *dist;
- data.closest = NULL;
- data.closestIndex = 0;
-
- data.pass = 0;
- mesh_foreachScreenFace(findnearestface__doClosest, &data);
-
- if (data.dist>3) {
- data.pass = 1;
- mesh_foreachScreenFace(findnearestface__doClosest, &data);
- }
-
- *dist = data.dist;
- lastSelected = data.closest;
- lastSelectedIndex = data.closestIndex;
-
- return data.closest;
- }
-}
-
-/* for interactivity, frontbuffer draw in current window */
-static void draw_dm_mapped_vert__mapFunc(void *theVert, int index, float *co, float *no_f, short *no_s)
-{
- if (EM_get_vert_for_index(index)==theVert) {
- bglVertex3fv(co);
- }
-}
-static void draw_dm_mapped_vert(DerivedMesh *dm, EditVert *eve)
-{
- EM_init_index_arrays(1, 0, 0);
- bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, draw_dm_mapped_vert__mapFunc, eve);
- bglEnd();
- EM_free_index_arrays();
-}
-
-static int draw_dm_mapped_edge__setDrawOptions(void *theEdge, int index)
-{
- return EM_get_edge_for_index(index)==theEdge;
-}
-static void draw_dm_mapped_edge(DerivedMesh *dm, EditEdge *eed)
-{
- EM_init_index_arrays(0, 1, 0);
- dm->drawMappedEdges(dm, draw_dm_mapped_edge__setDrawOptions, eed);
- EM_free_index_arrays();
-}
-
-static void draw_dm_mapped_face_center__mapFunc(void *theFace, int index, float *cent, float *no)
-{
- if (EM_get_face_for_index(index)==theFace) {
- bglVertex3fv(cent);
- }
-}
-static void draw_dm_mapped_face_center(DerivedMesh *dm, EditFace *efa)
-{
- EM_init_index_arrays(0, 0, 1);
- bglBegin(GL_POINTS);
- dm->foreachMappedFaceCenter(dm, draw_dm_mapped_face_center__mapFunc, efa);
- bglEnd();
- EM_free_index_arrays();
-}
-
-static void unified_select_draw(EditVert *eve, EditEdge *eed, EditFace *efa)
-{
- DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- glDrawBuffer(GL_FRONT);
-
- persp(PERSP_VIEW);
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_set_clipping(G.vd);
-
- glPushMatrix();
- mymultmatrix(G.obedit->obmat);
-
- /* face selected */
- if(efa) {
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- if(efa->f & SELECT) BIF_ThemeColor(TH_VERTEX_SELECT);
- else BIF_ThemeColor(TH_VERTEX);
-
- bglBegin(GL_POINTS);
- bglVertex3fv(efa->v1->co);
- bglVertex3fv(efa->v2->co);
- bglVertex3fv(efa->v3->co);
- if(efa->v4) bglVertex3fv(efa->v4->co);
- bglEnd();
- }
-
- if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) {
- if(efa->fgonf==0) {
- BIF_ThemeColor((efa->f & SELECT)?TH_EDGE_SELECT:TH_WIRE);
-
- draw_dm_mapped_edge(dm, efa->e1);
- draw_dm_mapped_edge(dm, efa->e2);
- draw_dm_mapped_edge(dm, efa->e3);
- if (efa->e4) {
- draw_dm_mapped_edge(dm, efa->e4);
- }
- }
- }
-
- if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) {
- if(efa->fgonf==0) {
- glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE));
- BIF_ThemeColor((efa->f & SELECT)?TH_FACE_DOT:TH_WIRE);
-
- draw_dm_mapped_face_center(dm, efa);
- }
- }
- }
- /* edge selected */
- if(eed) {
- if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) {
- BIF_ThemeColor((eed->f & SELECT)?TH_EDGE_SELECT:TH_WIRE);
-
- draw_dm_mapped_edge(dm, eed);
- }
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- BIF_ThemeColor((eed->f & SELECT)?TH_VERTEX_SELECT:TH_VERTEX);
-
- draw_dm_mapped_vert(dm, eed->v1);
- draw_dm_mapped_vert(dm, eed->v2);
- }
- }
- if(eve) {
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- BIF_ThemeColor((eve->f & SELECT)?TH_VERTEX_SELECT:TH_VERTEX);
-
- draw_dm_mapped_vert(dm, eve);
- }
- }
-
- glPointSize(1.0);
- glPopMatrix();
-
- bglFlush();
- glDrawBuffer(GL_BACK);
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
- /* signal that frontbuf differs from back */
- curarea->win_swap= WIN_FRONT_OK;
-
- dm->release(dm);
-}
-
-
-/* best distance based on screen coords.
- use g.scene->selectmode to define how to use
- selected vertices and edges get disadvantage
- return 1 if found one
-*/
-static int unified_findnearest(EditVert **eve, EditEdge **eed, EditFace **efa)
-{
- int dist= 75;
-
- *eve= NULL;
- *eed= NULL;
- *efa= NULL;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX)
- *eve= findnearestvert(&dist, SELECT, 0);
- if(G.scene->selectmode & SCE_SELECT_FACE)
- *efa= findnearestface(&dist);
-
- dist-= 20; /* since edges select lines, we give dots advantage of 20 pix */
- if(G.scene->selectmode & SCE_SELECT_EDGE)
- *eed= findnearestedge(&dist);
-
- /* return only one of 3 pointers, for frontbuffer redraws */
- if(*eed) {
- *efa= NULL; *eve= NULL;
- }
- else if(*efa) {
- *eve= NULL;
- }
-
- return (*eve || *eed || *efa);
-}
-
-/* this as a way to compare the ares, perim of 2 faces thay will scale to different sizes
- *0.5 so smaller faces arnt ALWAYS selected with a thresh of 1.0 */
-#define SCALE_CMP(a,b) ((a+a*thresh >= b) && (a-(a*thresh*0.5) <= b))
-
-/* **************** GROUP SELECTS ************** */
-/* selects new faces/edges/verts based on the
- existing selection
-
-FACES GROUP
- mode 1: same material
- mode 2: same image
- mode 3: same area
- mode 4: same perimeter
- mode 5: same normal
- mode 6: same co-planer
-*/
-int facegroup_select(short mode)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, *base_efa=NULL;
- unsigned int selcount=0; /*count how many new faces we select*/
-
- /*deselcount, count how many deselected faces are left, so we can bail out early
- also means that if there are no deselected faces, we can avoid a lot of looping */
- unsigned int deselcount=0;
-
- short ok=0;
- float thresh=G.scene->toolsettings->select_thresh;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (!efa->h) {
- if (efa->f & SELECT) {
- efa->f1=1;
- ok=1;
- } else {
- efa->f1=0;
- deselcount++; /* a deselected face we may select later */
- }
- }
- }
-
- if (!ok || !deselcount) /* no data selected OR no more data to select */
- return 0;
-
- /*if mode is 3 then record face areas, 4 record perimeter */
- if (mode==3) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->tmp.fp= EM_face_area(efa);
- }
- } else if (mode==4) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->tmp.fp= EM_face_perimeter(efa);
- }
- }
-
- for(base_efa= em->faces.first; base_efa; base_efa= base_efa->next) {
- if (base_efa->f1) { /* This was one of the faces originaly selected */
- if (mode==1) { /* same material */
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (
- !(efa->f & SELECT) &&
- !efa->h &&
- base_efa->mat_nr == efa->mat_nr
- ) {
- EM_select_face(efa, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==2) { /* same image */
- MTFace *tf, *base_tf;
-
- base_tf = (MTFace*)CustomData_em_get(&em->fdata, base_efa->data,
- CD_MTFACE);
-
- if(!base_tf)
- return selcount;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->f & SELECT) && !efa->h) {
- tf = (MTFace*)CustomData_em_get(&em->fdata, efa->data,
- CD_MTFACE);
-
- if(base_tf->tpage == tf->tpage) {
- EM_select_face(efa, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- } else if (mode==3 || mode==4) { /* same area OR same perimeter, both use the same temp var */
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (
- (!(efa->f & SELECT) && !efa->h) &&
- SCALE_CMP(base_efa->tmp.fp, efa->tmp.fp)
- ) {
- EM_select_face(efa, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==5) { /* same normal */
- float angle;
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->f & SELECT) && !efa->h) {
- angle= VecAngle2(base_efa->n, efa->n);
- if (angle/180.0<=thresh) {
- EM_select_face(efa, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- } else if (mode==6) { /* same planer */
- float angle, base_dot, dot;
- base_dot= Inpf(base_efa->cent, base_efa->n);
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->f & SELECT) && !efa->h) {
- angle= VecAngle2(base_efa->n, efa->n);
- if (angle/180.0<=thresh) {
- dot=Inpf(efa->cent, base_efa->n);
- if (fabs(base_dot-dot) <= thresh) {
- EM_select_face(efa, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- }
- }
- }
- } /* end base_efa loop */
- return selcount;
-}
-
-
-/*
-EDGE GROUP
- mode 1: same length
- mode 2: same direction
- mode 3: same number of face users
- mode 4: similar face angles.
- mode 5: similar crease
- mode 6: similar seam
- mode 7: similar sharp
-*/
-
-/* this function is only used by edgegroup_select's edge angle */
-
-
-
-static int edgegroup_select__internal(short mode)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed, *base_eed=NULL;
- unsigned int selcount=0; /* count how many new edges we select*/
-
- /*count how many visible selected edges there are,
- so we can return when there are none left */
- unsigned int deselcount=0;
-
- short ok=0;
- float thresh=G.scene->toolsettings->select_thresh;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (!eed->h) {
- if (eed->f & SELECT) {
- eed->f1=1;
- ok=1;
- } else {
- eed->f1=0;
- deselcount++;
- }
- /* set all eed->tmp.l to 0 we use it later.
- for counting face users*/
- eed->tmp.l=0;
- eed->f2=0; /* only for mode 4, edge animations */
- }
- }
-
- if (!ok || !deselcount) /* no data selected OR no more data to select*/
- return 0;
-
- if (mode==1) { /*store length*/
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (!eed->h) /* dont calc data for hidden edges*/
- eed->tmp.fp= VecLenf(eed->v1->co, eed->v2->co);
- }
- } else if (mode==3) { /*store face users*/
- EditFace *efa;
- /* cound how many faces each edge uses use tmp->l */
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->e1->tmp.l++;
- efa->e2->tmp.l++;
- efa->e3->tmp.l++;
- if (efa->e4) efa->e4->tmp.l++;
- }
- } else if (mode==4) { /*store edge angles */
- EditFace *efa;
- int j;
- /* cound how many faces each edge uses use tmp.l */
- for(efa= em->faces.first; efa; efa= efa->next) {
- /* here we use the edges temp data to assign a face
- if a face has alredy been assigned (eed->f2==1)
- we calculate the angle between the current face and
- the edges previously found face.
- store the angle in eed->tmp.fp (loosing the face eed->tmp.f)
- but tagging eed->f2==2, so we know not to look at it again.
- This only works for edges that connect to 2 faces. but its good enough
- */
-
- /* se we can loop through face edges*/
- j=0;
- eed= efa->e1;
- while (j<4) {
- if (j==1) eed= efa->e2;
- else if (j==2) eed= efa->e3;
- else if (j==3) {
- eed= efa->e4;
- if (!eed)
- break;
- } /* done looping */
-
- if (!eed->h) { /* dont calc data for hidden edges*/
- if (eed->f2==2)
- break;
- else if (eed->f2==0) /* first access, assign the face */
- eed->tmp.f= efa;
- else if (eed->f2==1) /* second, we assign the angle*/
- eed->tmp.fp= VecAngle2(eed->tmp.f->n, efa->n)/180;
- eed->f2++; /* f2==0 no face assigned. f2==1 one face found. f2==2 angle calculated.*/
- }
- j++;
- }
- }
- }
-
- for(base_eed= em->edges.first; base_eed; base_eed= base_eed->next) {
- if (base_eed->f1) {
- if (mode==1) { /* same length */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- SCALE_CMP(base_eed->tmp.fp, eed->tmp.fp)
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==2) { /* same direction */
- float base_dir[3], dir[3], angle;
- VecSubf(base_dir, base_eed->v1->co, base_eed->v2->co);
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (!(eed->f & SELECT) && !eed->h) {
- VecSubf(dir, eed->v1->co, eed->v2->co);
- angle= VecAngle2(base_dir, dir);
-
- if (angle>90) /* use the smallest angle between the edges */
- angle= fabs(angle-180.0f);
-
- if (angle/90.0<=thresh) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- } else if (mode==3) { /* face users */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- base_eed->tmp.l==eed->tmp.l
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==4 && base_eed->f2==2) { /* edge angles, f2==2 means the edge has an angle. */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- eed->f2==2 &&
- (fabs(base_eed->tmp.fp-eed->tmp.fp)<=thresh)
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==5) { /* edge crease */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- (fabs(base_eed->crease-eed->crease) <= thresh)
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==6) { /* edge seam */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- (eed->seam == base_eed->seam)
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==7) { /* edge sharp */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (
- !(eed->f & SELECT) &&
- !eed->h &&
- (eed->sharp == base_eed->sharp)
- ) {
- EM_select_edge(eed, 1);
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- }
- }
- return selcount;
-}
-/* wrap the above function but do selection flushing edge to face */
-int edgegroup_select(short mode)
-{
- int selcount = edgegroup_select__internal(mode);
-
- if (selcount) {
- /* Could run a generic flush function,
- * but the problem is only that all edges of a face
- * can be selected without the face becoming selected */
- EditMesh *em = G.editMesh;
- EditFace *efa;
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (efa->v4) {
- if (efa->e1->f&SELECT && efa->e2->f&SELECT && efa->e3->f&SELECT && efa->e4->f&SELECT)
- efa->f |= SELECT;
- } else {
- if (efa->e1->f&SELECT && efa->e2->f&SELECT && efa->e3->f&SELECT)
- efa->f |= SELECT;
- }
- }
- }
- return selcount;
-}
-
-
-
-/*
-VERT GROUP
- mode 1: same normal
- mode 2: same number of face users
- mode 3: same vertex groups
-*/
-int vertgroup_select(short mode)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *base_eve=NULL;
-
- unsigned int selcount=0; /* count how many new edges we select*/
-
- /*count how many visible selected edges there are,
- so we can return when there are none left */
- unsigned int deselcount=0;
-
- short ok=0;
- float thresh=G.scene->toolsettings->select_thresh;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if (!eve->h) {
- if (eve->f & SELECT) {
- eve->f1=1;
- ok=1;
- } else {
- eve->f1=0;
- deselcount++;
- }
- /* set all eve->tmp.l to 0 we use them later.*/
- eve->tmp.l=0;
- }
-
- }
-
- if (!ok || !deselcount) /* no data selected OR no more data to select*/
- return 0;
-
-
- if (mode==2) { /* store face users */
- EditFace *efa;
-
- /* count how many faces each edge uses use tmp->l */
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->v1->tmp.l++;
- efa->v2->tmp.l++;
- efa->v3->tmp.l++;
- if (efa->v4) efa->v4->tmp.l++;
- }
- }
-
-
- for(base_eve= em->verts.first; base_eve; base_eve= base_eve->next) {
- if (base_eve->f1) {
-
- if (mode==1) { /* same normal */
- float angle;
- for(eve= em->verts.first; eve; eve= eve->next) {
- if (!(eve->f & SELECT) && !eve->h) {
- angle= VecAngle2(base_eve->no, eve->no);
- if (angle/180.0<=thresh) {
- eve->f |= SELECT;
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- }
- } else if (mode==2) { /* face users */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if (
- !(eve->f & SELECT) &&
- !eve->h &&
- base_eve->tmp.l==eve->tmp.l
- ) {
- eve->f |= SELECT;
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- }
- }
- } else if (mode==3) { /* vertex groups */
- MDeformVert *dvert, *base_dvert;
- short i, j; /* weight index */
-
- base_dvert= CustomData_em_get(&em->vdata, base_eve->data,
- CD_MDEFORMVERT);
-
- if (!base_dvert || base_dvert->totweight == 0)
- return selcount;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- dvert= CustomData_em_get(&em->vdata, eve->data,
- CD_MDEFORMVERT);
-
- if (dvert && !(eve->f & SELECT) && !eve->h && dvert->totweight) {
- /* do the extra check for selection in the following if, so were not
- checking verts that may be alredy selected */
- for (i=0; base_dvert->totweight >i && !(eve->f & SELECT); i++) {
- for (j=0; dvert->totweight >j; j++) {
- if (base_dvert->dw[i].def_nr==dvert->dw[j].def_nr) {
- eve->f |= SELECT;
- selcount++;
- deselcount--;
- if (!deselcount) /*have we selected all posible faces?, if so return*/
- return selcount;
- break;
- }
- }
- }
- }
- }
- }
- }
- } /* end basevert loop */
- return selcount;
-}
-
-/* EditMode menu triggered from space.c by pressing Shift+G
-handles face/edge vert context and
-facegroup_select/edgegroup_select/vertgroup_select do all the work
-*/
-
-void select_mesh_group_menu()
-{
- short ret;
- int selcount, first_item=1, multi=0;
- char str[512] = "Select Similar "; /* total max length is 404 at the moment */
-
- if (!ELEM3(G.scene->selectmode, SCE_SELECT_VERTEX, SCE_SELECT_EDGE, SCE_SELECT_FACE)) {
- multi=1;
- }
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if (multi) strcat(str, "%t|Vertices%x-1|");
- else strcat(str, "Vertices %t|");
- strcat(str, " Normal %x1| Face Users %x2| Shared Vertex Groups%x3");
- first_item=0;
- }
-
- if(G.scene->selectmode & SCE_SELECT_EDGE) {
- if (multi) {
- if (first_item) strcat(str, "%t|Edges%x-1|");
- else strcat(str, "|%l|Edges%x-1|");
- } else strcat(str, "Edges %t|");
-
- strcat(str, " Length %x10| Direction %x20| Face Users%x30| Face Angle%x40| Crease%x50| Seam%x60| Sharp%x70");
- first_item=0;
- }
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- if (multi) {
- strcat(str, "|%l|Faces%x-1|");
- } else strcat(str, "Faces %t|");
- strcat(str, " Material %x100| Image %x200| Area %x300| Perimeter %x400| Normal %x500| Co-Planar %x600");
-
- }
-
- ret= pupmenu(str);
- if (ret<1) return;
-
- if (ret<10) {
- selcount= vertgroup_select(ret);
- if (selcount) { /* update if data was selected */
- EM_select_flush(); /* so that selected verts, go onto select faces */
- G.totvertsel += selcount;
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Similar Vertices");
- }
- return;
- }
-
- if (ret<100) {
- selcount= edgegroup_select(ret/10);
-
- if (selcount) { /* update if data was selected */
- /*EM_select_flush();*/ /* dont use because it can end up selecting more edges and is not usefull*/
- G.totedgesel+=selcount;
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Similar Edges");
- }
- return;
- }
-
- if (ret<1000) {
- selcount= facegroup_select(ret/100);
- if (selcount) { /* update if data was selected */
- G.totfacesel+=selcount;
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Similar Faces");
- }
- return;
- }
-}
-
-int mesh_layers_menu_charlen(CustomData *data, int type)
-{
- int i, len = 0;
- /* see if there is a duplicate */
- for(i=0; i<data->totlayer; i++) {
- if((&data->layers[i])->type == type) {
- /* we could count the chars here but we'll just assumeme each
- * is 32 chars with some room for the menu text - 40 should be fine */
- len+=40;
- }
- }
- return len;
-}
-
-/* this function adds menu text into an existing string.
- * this string's size should be allocated with mesh_layers_menu_charlen */
-void mesh_layers_menu_concat(CustomData *data, int type, char *str) {
- int i, count = 0;
- char *str_pt = str;
- CustomDataLayer *layer;
-
- /* see if there is a duplicate */
- for(i=0; i<data->totlayer; i++) {
- layer = &data->layers[i];
- if(layer->type == type) {
- str_pt += sprintf(str_pt, "%s%%x%d|", layer->name, count);
- count++;
- }
- }
-}
-
-int mesh_layers_menu(CustomData *data, int type) {
- int ret;
- char *str_pt, *str;
-
- str_pt = str = MEM_mallocN(mesh_layers_menu_charlen(data, type) + 18, "layer menu");
- str[0] = '\0';
-
- str_pt += sprintf(str_pt, "Layers%%t|");
-
- mesh_layers_menu_concat(data, type, str_pt);
-
- ret = pupmenu(str);
- MEM_freeN(str);
- return ret;
-}
-
-void EM_mesh_copy_edge(short type)
-{
- EditMesh *em = G.editMesh;
- EditSelection *ese;
- short change=0;
-
- EditEdge *eed, *eed_act;
- float vec[3], vec_mid[3], eed_len, eed_len_act;
-
- if (!em) return;
-
- ese = em->selected.last;
- if (!ese) return;
-
- eed_act = (EditEdge*)ese->data;
-
- switch (type) {
- case 1: /* copy crease */
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) {
- eed->crease = eed_act->crease;
- change = 1;
- }
- }
- break;
- case 2: /* copy bevel weight */
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act && eed->bweight != eed_act->bweight) {
- eed->bweight = eed_act->bweight;
- change = 1;
- }
- }
- break;
-
- case 3: /* copy length */
- eed_len_act = VecLenf(eed_act->v1->co, eed_act->v2->co);
- for(eed=em->edges.first; eed; eed=eed->next) {
- if (eed->f & SELECT && eed != eed_act) {
-
- eed_len = VecLenf(eed->v1->co, eed->v2->co);
-
- if (eed_len == eed_len_act) continue;
- /* if this edge is zero length we cont do anything with it*/
- if (eed_len == 0.0f) continue;
- if (eed_len_act == 0.0f) {
- VecAddf(vec_mid, eed->v1->co, eed->v2->co);
- VecMulf(vec_mid, 0.5);
- VECCOPY(eed->v1->co, vec_mid);
- VECCOPY(eed->v2->co, vec_mid);
- } else {
- /* copy the edge length */
- VecAddf(vec_mid, eed->v1->co, eed->v2->co);
- VecMulf(vec_mid, 0.5);
-
- /* SCALE 1 */
- VecSubf(vec, eed->v1->co, vec_mid);
- VecMulf(vec, eed_len_act/eed_len);
- VecAddf(eed->v1->co, vec, vec_mid);
-
- /* SCALE 2 */
- VecSubf(vec, eed->v2->co, vec_mid);
- VecMulf(vec, eed_len_act/eed_len);
- VecAddf(eed->v2->co, vec, vec_mid);
- }
- change = 1;
- }
- }
-
- if (change)
- recalc_editnormals();
-
- break;
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Copy Edge Attribute");
- }
-}
-
-void EM_mesh_copy_face(short type)
-{
- EditMesh *em = G.editMesh;
- short change=0;
-
- EditFace *efa, *efa_act;
- MTFace *tf, *tf_act = NULL;
- MCol *mcol, *mcol_act = NULL;
- if (!em) return;
- efa_act = EM_get_actFace(0);
-
- if (!efa_act) return;
-
- tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE);
- mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL);
-
- switch (type) {
- case 1: /* copy material */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) {
- efa->mat_nr = efa_act->mat_nr;
- change = 1;
- }
- }
- break;
- case 2: /* copy image */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
- }
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (tf_act->tpage) {
- tf->tpage = tf_act->tpage;
- tf->mode |= TF_TEX;
- } else {
- tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
- }
- tf->tile= tf_act->tile;
- change = 1;
- }
- }
- break;
-
- case 3: /* copy UV's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
- }
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, tf_act->uv, sizeof(tf->uv));
- change = 1;
- }
- }
- break;
- case 4: /* mode's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
- }
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->mode= tf_act->mode;
- change = 1;
- }
- }
- break;
- case 5: /* copy transp's */
- if (!tf_act) {
- error("mesh has no uv/image layers");
- return;
- }
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->transp= tf_act->transp;
- change = 1;
- }
- }
- break;
-
- case 6: /* copy vcols's */
- if (!mcol_act) {
- error("mesh has no color layers");
- return;
- } else {
- /* guess the 4th color if needs be */
- float val =- 1;
-
- if (!efa_act->v4) {
- /* guess the othe vale, we may need to use it
- *
- * Modifying the 4th value of the mcol is ok here since its not seen
- * on a triangle
- * */
- val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->r = (char)val;
-
- val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->g = (char)val;
-
- val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255);
- (mcol_act+3)->b = (char)val;
- }
-
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT && efa != efa_act) {
- /* TODO - make copy from tri to quad guess the 4th vert */
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- memcpy(mcol, mcol_act, sizeof(MCol)*4);
- change = 1;
- }
- }
- }
- break;
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- if (type==3) {
- allqueue(REDRAWIMAGE, 0);
- }
-
- BIF_undo_push("Copy Face Attribute");
- }
-}
-
-
-void EM_mesh_copy_face_layer(short type)
-{
- EditMesh *em = G.editMesh;
- short change=0;
-
- EditFace *efa;
- MTFace *tf, *tf_from;
- MCol *mcol, *mcol_from;
-
- if (!em) return;
-
- switch(type) {
- case 7:
- case 8:
- case 9:
- if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) {
- error("mesh does not have multiple uv/image layers");
- return;
- } else {
- int layer_orig_idx, layer_idx;
-
- layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE);
- if (layer_idx<0) return;
-
- /* warning, have not updated mesh pointers however this is not needed since we swicth back */
- layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE);
- if (layer_idx==layer_orig_idx)
- return;
-
- /* get the tfaces */
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx);
- /* store the tfaces in our temp */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- }
- }
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx);
- }
- break;
-
- case 10: /* select vcol layers - make sure this stays in sync with above code */
- if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) {
- error("mesh does not have multiple color layers");
- return;
- } else {
- int layer_orig_idx, layer_idx;
-
- layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL);
- if (layer_idx<0) return;
-
- /* warning, have not updated mesh pointers however this is not needed since we swicth back */
- layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL);
- if (layer_idx==layer_orig_idx)
- return;
-
- /* get the tfaces */
- CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx);
- /* store the tfaces in our temp */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- }
- }
- CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx);
-
- }
- break;
- }
-
- /* layer copy only - sanity checks done above */
- switch (type) {
- case 7: /* copy UV's only */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, tf_from->uv, sizeof(tf->uv));
- change = 1;
- }
- }
- break;
- case 8: /* copy image settings only */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (tf_from->tpage) {
- tf->tpage = tf_from->tpage;
- tf->mode |= TF_TEX;
- } else {
- tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
- }
- tf->tile= tf_from->tile;
- change = 1;
- }
- }
- break;
- case 9: /* copy all tface info */
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf_from = (MTFace *)efa->tmp.p; /* not active but easier to use this way */
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv));
- tf->tpage = tf_from->tpage;
- tf->mode = tf_from->mode;
- tf->transp = tf_from->transp;
- change = 1;
- }
- }
- break;
- case 10:
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- mcol_from = (MCol *)efa->tmp.p;
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- memcpy(mcol, mcol_from, sizeof(MCol)*4);
- change = 1;
- }
- }
- break;
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Copy Face Layer");
- }
-}
-
-
-/* ctrl+c in mesh editmode */
-void mesh_copy_menu(void)
-{
- EditMesh *em = G.editMesh;
- EditSelection *ese;
- int ret;
- if (!em) return;
-
- ese = em->selected.last;
-
- /* Faces can have a NULL ese, so dont return on a NULL ese here */
-
- if(ese && ese->type == EDITVERT) {
- /* EditVert *ev, *ev_act = (EditVert*)ese->data;
- ret= pupmenu(""); */
- } else if(ese && ese->type == EDITEDGE) {
- ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Bevel Weight%x2|Length%x3");
- if (ret<1) return;
-
- EM_mesh_copy_edge(ret);
-
- } else if(ese==NULL || ese->type == EDITFACE) {
- ret= pupmenu(
- "Copy Face Selected%t|"
- "Active Material%x1|Active Image%x2|Active UV Coords%x3|"
- "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|"
-
- "TexFace UVs from layer%x7|"
- "TexFace Images from layer%x8|"
- "TexFace All from layer%x9|"
- "Vertex Colors from layer%x10");
- if (ret<1) return;
-
- if (ret<=6) {
- EM_mesh_copy_face(ret);
- } else {
- EM_mesh_copy_face_layer(ret);
- }
- }
-}
-
-
-/* **************** LOOP SELECTS *************** */
-
-/* selects quads in loop direction of indicated edge */
-/* only flush over edges with valence <= 2 */
-void faceloop_select(EditEdge *startedge, int select)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
- int looking= 1;
-
- /* in eed->f1 we put the valence (amount of faces in edge) */
- /* in eed->f2 we put tagged flag as correct loop */
- /* in efa->f1 we put tagged flag as correct to select */
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- eed->f2= 0;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->f1= 0;
- if(efa->h==0) {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
-
- /* tag startedge OK*/
- startedge->f2= 1;
-
- while(looking) {
- looking= 0;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0 && efa->e4 && efa->f1==0) { /* not done quad */
- if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { /* valence ok */
-
- /* if edge tagged, select opposing edge and mark face ok */
- if(efa->e1->f2) {
- efa->e3->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- else if(efa->e2->f2) {
- efa->e4->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e3->f2) {
- efa->e1->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e4->f2) {
- efa->e2->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- }
- }
- }
- }
-
- /* (de)select the faces */
- if(select!=2) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f1) EM_select_face(efa, select);
- }
- }
-}
-
-
-/* helper for edgeloop_select, checks for eed->f2 tag in faces */
-static int edge_not_in_tagged_face(EditEdge *eed)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- if(efa->e1==eed || efa->e2==eed || efa->e3==eed || efa->e4==eed) { /* edge is in face */
- if(efa->e1->f2 || efa->e2->f2 || efa->e3->f2 || (efa->e4 && efa->e4->f2)) { /* face is tagged */
- return 0;
- }
- }
- }
- }
- return 1;
-}
-
-/* selects or deselects edges that:
-- if edges has 2 faces:
- - has vertices with valence of 4
- - not shares face with previous edge
-- if edge has 1 face:
- - has vertices with valence 4
- - not shares face with previous edge
- - but also only 1 face
-- if edge no face:
- - has vertices with valence 2
-*/
-static void edgeloop_select(EditEdge *starteed, int select)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- int looking= 1;
-
- /* in f1 we put the valence (amount of edges in a vertex, or faces in edge) */
- /* in eed->f2 and efa->f1 we put tagged flag as correct loop */
- for(eve= em->verts.first; eve; eve= eve->next) {
- eve->f1= 0;
- eve->f2= 0;
- }
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- eed->f2= 0;
- if((eed->h & 1)==0) { /* fgon edges add to valence too */
- eed->v1->f1++; eed->v2->f1++;
- }
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->f1= 0;
- if(efa->h==0) {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
-
- /* looped edges & vertices get tagged f2 */
- starteed->f2= 1;
- if(starteed->v1->f1<5) starteed->v1->f2= 1;
- if(starteed->v2->f1<5) starteed->v2->f2= 1;
- /* sorry, first edge isnt even ok */
- if(starteed->v1->f2==0 && starteed->v2->f2==0) looking= 0;
-
- while(looking) {
- looking= 0;
-
- /* find correct valence edges which are not tagged yet, but connect to tagged one */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0 && eed->f2==0) { /* edge not hidden, not tagged */
- if( (eed->v1->f1<5 && eed->v1->f2) || (eed->v2->f1<5 && eed->v2->f2)) { /* valence of vertex OK, and is tagged */
- /* new edge is not allowed to be in face with tagged edge */
- if(edge_not_in_tagged_face(eed)) {
- if(eed->f1==starteed->f1) { /* same amount of faces */
- looking= 1;
- eed->f2= 1;
- if(eed->v2->f1<5) eed->v2->f2= 1;
- if(eed->v1->f1<5) eed->v1->f2= 1;
- }
- }
- }
- }
- }
- }
- /* and we do the select */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2) EM_select_edge(eed, select);
- }
-}
-
-/*
- Almostly exactly the same code as faceloop select
-*/
-static void edgering_select(EditEdge *startedge, int select){
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
- int looking= 1;
-
- /* in eed->f1 we put the valence (amount of faces in edge) */
- /* in eed->f2 we put tagged flag as correct loop */
- /* in efa->f1 we put tagged flag as correct to select */
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- eed->f2= 0;
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->f1= 0;
- if(efa->h==0) {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
-
- /* tag startedge OK */
- startedge->f2= 1;
-
- while(looking) {
- looking= 0;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e4 && efa->f1==0 && !efa->h) { /* not done quad */
- if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { /* valence ok */
-
- /* if edge tagged, select opposing edge and mark face ok */
- if(efa->e1->f2) {
- efa->e3->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- else if(efa->e2->f2) {
- efa->e4->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e3->f2) {
- efa->e1->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- if(efa->e4->f2) {
- efa->e2->f2= 1;
- efa->f1= 1;
- looking= 1;
- }
- }
- }
- }
- }
-
- /* (de)select the edges */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f2) EM_select_edge(eed, select);
- }
-}
-
-void loop_multiselect(int looptype)
-{
- EditEdge *eed;
- EditEdge **edarray;
- int edindex, edfirstcount;
-
- /*edarray = MEM_mallocN(sizeof(*edarray)*G.totedgesel,"edge array");*/
- edarray = MEM_mallocN(sizeof(EditEdge*)*G.totedgesel,"edge array");
- edindex = 0;
- edfirstcount = G.totedgesel;
-
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(eed->f&SELECT){
- edarray[edindex] = eed;
- edindex += 1;
- }
- }
-
- if(looptype){
- for(edindex = 0; edindex < edfirstcount; edindex +=1){
- eed = edarray[edindex];
- edgering_select(eed,SELECT);
- }
- countall();
- EM_selectmode_flush();
- BIF_undo_push("Edge Ring Multi-Select");
- }
- else{
- for(edindex = 0; edindex < edfirstcount; edindex +=1){
- eed = edarray[edindex];
- edgeloop_select(eed,SELECT);
- }
- countall();
- EM_selectmode_flush();
- BIF_undo_push("Edge Loop Multi-Select");
- }
- MEM_freeN(edarray);
- allqueue(REDRAWVIEW3D,0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-}
-
-/* ***************** MAIN MOUSE SELECTION ************** */
-
-/* just to have the functions nice together */
-
-static void mouse_mesh_loop(void)
-{
- EditEdge *eed;
- int select= 1;
- int dist= 50;
-
- eed= findnearestedge(&dist);
- if(eed) {
- if (G.scene->toolsettings->edge_mode == EDGE_MODE_SELECT) {
- if((G.qual & LR_SHIFTKEY)==0) EM_clear_flag_all(SELECT);
-
- if((eed->f & SELECT)==0) select=1;
- else if(G.qual & LR_SHIFTKEY) select=0;
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- faceloop_select(eed, select);
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- if(G.qual == (LR_CTRLKEY | LR_ALTKEY) || G.qual == (LR_CTRLKEY | LR_ALTKEY |LR_SHIFTKEY))
- edgering_select(eed, select);
- else if(G.qual & LR_ALTKEY)
- edgeloop_select(eed, select);
- }
- else if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if(G.qual == (LR_CTRLKEY | LR_ALTKEY) || G.qual == (LR_CTRLKEY | LR_ALTKEY |LR_SHIFTKEY))
- edgering_select(eed, select);
- else if(G.qual & LR_ALTKEY)
- edgeloop_select(eed, select);
- }
-
- /* frontbuffer draw of last selected only */
- unified_select_draw(NULL, eed, NULL);
-
- EM_selectmode_flush();
- countall();
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- } else { /*(G.scene->toolsettings->edge_mode == EDGE_MODE_TAG_*)*/
- int act = (edgetag_context_check(eed)==0);
- int path = 0;
-
- if (G.qual == (LR_SHIFTKEY | LR_ALTKEY) && G.editMesh->selected.last) {
- EditSelection *ese = G.editMesh->selected.last;
-
- if(ese && ese->type == EDITEDGE) {
- EditEdge *eed_act;
- eed_act = (EditEdge*)ese->data;
- if (eed_act != eed) {
- /* If shift is pressed we need to use the last active edge, (if it exists) */
- if (edgetag_shortest_path(eed_act, eed)) {
- EM_remove_selection(eed_act, EDITEDGE);
- EM_select_edge(eed_act, 0);
- path = 1;
- }
- }
- }
- }
- if (path==0) {
- edgetag_context_set(eed, act); /* switch the edge option */
- }
-
- if (act) {
- if ((eed->f & SELECT)==0) {
- EM_select_edge(eed, 1);
- EM_selectmode_flush();
- countall();
- }
- /* even if this is selected it may not be in the selection list */
- EM_store_selection(eed, EDITEDGE);
- } else {
- if (eed->f & SELECT) {
- EM_select_edge(eed, 0);
- /* logic is differnt from above here since if this was selected we dont know if its in the selection list or not */
- EM_remove_selection(eed, EDITEDGE);
-
- EM_selectmode_flush();
- countall();
- }
- }
-
- switch (G.scene->toolsettings->edge_mode) {
- case EDGE_MODE_TAG_SEAM:
- G.f |= G_DRAWSEAMS;
- break;
- case EDGE_MODE_TAG_SHARP:
- G.f |= G_DRAWSHARP;
- break;
- case EDGE_MODE_TAG_CREASE:
- G.f |= G_DRAWCREASES;
- break;
- case EDGE_MODE_TAG_BEVEL:
- G.f |= G_DRAWBWEIGHTS;
- break;
- }
-
- unified_select_draw(NULL, eed, NULL);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
-
- }
-}
-
-
-/* here actual select happens */
-void mouse_mesh(void)
-{
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- if(G.qual & LR_ALTKEY) mouse_mesh_loop();
- else if(unified_findnearest(&eve, &eed, &efa)) {
-
- if((G.qual & LR_SHIFTKEY)==0) EM_clear_flag_all(SELECT);
-
- if(efa) {
- /* set the last selected face */
- EM_set_actFace(efa);
-
- if( (efa->f & SELECT)==0 ) {
- EM_store_selection(efa, EDITFACE);
- EM_select_face_fgon(efa, 1);
- }
- else if(G.qual & LR_SHIFTKEY) {
- EM_remove_selection(efa, EDITFACE);
- EM_select_face_fgon(efa, 0);
- }
- }
- else if(eed) {
- if((eed->f & SELECT)==0) {
- EM_store_selection(eed, EDITEDGE);
- EM_select_edge(eed, 1);
- }
- else if(G.qual & LR_SHIFTKEY) {
- EM_remove_selection(eed, EDITEDGE);
- EM_select_edge(eed, 0);
- }
- }
- else if(eve) {
- if((eve->f & SELECT)==0) {
- eve->f |= SELECT;
- EM_store_selection(eve, EDITVERT);
- }
- else if(G.qual & LR_SHIFTKEY){
- EM_remove_selection(eve, EDITVERT);
- eve->f &= ~SELECT;
- }
- }
-
- /* frontbuffer draw of last selected only */
- unified_select_draw(eve, eed, efa);
-
- EM_selectmode_flush();
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck()) {
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0); /* for the texture face panel */
- }
- if (efa && efa->mat_nr != G.obedit->actcol-1) {
- G.obedit->actcol= efa->mat_nr+1;
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_MA);
- }
- }
-
- rightmouse_transform();
-}
-
-
-void selectconnected_mesh_all(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *v1,*v2;
- EditEdge *eed;
- short done=1, toggle=0;
-
- if(em->edges.first==0) return;
-
- while(done==1) {
- done= 0;
-
- toggle++;
- if(toggle & 1) eed= em->edges.first;
- else eed= em->edges.last;
-
- while(eed) {
- v1= eed->v1;
- v2= eed->v2;
- if(eed->h==0) {
- if(v1->f & SELECT) {
- if( (v2->f & SELECT)==0 ) {
- v2->f |= SELECT;
- done= 1;
- }
- }
- else if(v2->f & SELECT) {
- if( (v1->f & SELECT)==0 ) {
- v1->f |= SELECT;
- done= 1;
- }
- }
- }
- if(toggle & 1) eed= eed->next;
- else eed= eed->prev;
- }
- }
-
- /* now use vertex select flag to select rest */
- EM_select_flush();
-
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Connected (All)");
-}
-
-void selectconnected_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *v1, *v2;
- EditEdge *eed;
- EditFace *efa;
- short done=1, sel, toggle=0;
-
- if(em->edges.first==0) return;
-
- if( unified_findnearest(&eve, &eed, &efa)==0 ) {
- /* error("Nothing indicated "); */ /* this is mostly annoying, eps with occluded geometry */
- return;
- }
-
- sel= 1;
- if(G.qual & LR_SHIFTKEY) sel=0;
-
- /* clear test flags */
- for(v1= em->verts.first; v1; v1= v1->next) v1->f1= 0;
-
- /* start vertex/face/edge */
- if(eve) eve->f1= 1;
- else if(eed) eed->v1->f1= eed->v2->f1= 1;
- else efa->v1->f1= efa->v2->f1= efa->v3->f1= 1;
-
- /* set flag f1 if affected */
- while(done==1) {
- done= 0;
- toggle++;
-
- if(toggle & 1) eed= em->edges.first;
- else eed= em->edges.last;
-
- while(eed) {
- v1= eed->v1;
- v2= eed->v2;
-
- if(eed->h==0) {
- if(v1->f1 && v2->f1==0) {
- v2->f1= 1;
- done= 1;
- }
- else if(v1->f1==0 && v2->f1) {
- v1->f1= 1;
- done= 1;
- }
- }
-
- if(toggle & 1) eed= eed->next;
- else eed= eed->prev;
- }
- }
-
- /* now use vertex f1 flag to select/deselect */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->f1 && eed->v2->f1)
- EM_select_edge(eed, sel);
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->v1->f1 && efa->v2->f1 && efa->v3->f1 && (efa->v4==NULL || efa->v4->f1))
- EM_select_face(efa, sel);
- }
- /* no flush needed, connected geometry is done */
-
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- BIF_undo_push("Select Linked");
-
-}
-
-/* for use with selectconnected_delimit_mesh only! */
-#define is_edge_delimit_ok(eed) ((eed->tmp.l == 1) && (eed->seam==0))
-#define is_face_tag(efa) is_edge_delimit_ok(efa->e1) || is_edge_delimit_ok(efa->e2) || is_edge_delimit_ok(efa->e3) || (efa->v4 && is_edge_delimit_ok(efa->e4))
-
-#define face_tag(efa)\
- if(efa->v4) efa->tmp.l= efa->e1->tmp.l= efa->e2->tmp.l= efa->e3->tmp.l= efa->e4->tmp.l= 1;\
- else efa->tmp.l= efa->e1->tmp.l= efa->e2->tmp.l= efa->e3->tmp.l= 1;
-
-/* all - 1) use all faces for extending the selection 2) only use the mouse face
- * sel - 1) select 0) deselect
- * */
-static void selectconnected_delimit_mesh__internal(short all, short sel)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- short done=1, change=0;
- int dist = 75;
- EditEdge *eed;
- if(em->faces.first==0) return;
-
- /* flag all edges as off*/
- for(eed= em->edges.first; eed; eed= eed->next)
- eed->tmp.l=0;
-
- if (all) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- face_tag(efa);
- } else {
- efa->tmp.l = 0;
- }
- }
- } else {
- EditFace *efa_mouse = findnearestface(&dist);
-
- if( !efa_mouse ) {
- /* error("Nothing indicated "); */ /* this is mostly annoying, eps with occluded geometry */
- return;
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- efa->tmp.l = 0;
- }
- efa_mouse->tmp.l = 1;
- face_tag(efa_mouse);
- }
-
- while(done==1) {
- done= 0;
- /* simple algo - select all faces that have a selected edge
- * this intern selects the edge, repeat until nothing is left to do */
- for(efa= em->faces.first; efa; efa= efa->next) {
- if ((efa->tmp.l == 0) && (!efa->h)) {
- if (is_face_tag(efa)) {
- face_tag(efa);
- done= 1;
- }
- }
- }
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (efa->tmp.l) {
- if (sel) {
- if (!(efa->f & SELECT)) {
- EM_select_face(efa, 1);
- change = 1;
- }
- } else {
- if (efa->f & SELECT) {
- EM_select_face(efa, 0);
- change = 1;
- }
- }
- }
- }
-
- if (!change)
- return;
-
- if (!sel) /* make sure de-selecting faces didnt de-select the verts/edges connected to selected faces, this is common with boundries */
- for(efa= em->faces.first; efa; efa= efa->next)
- if (efa->f & SELECT)
- EM_select_face(efa, 1);
-
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- BIF_undo_push("Select Linked Delimeted");
-
-}
-
-#undef is_edge_delimit_ok
-#undef is_face_tag
-#undef face_tag
-
-void selectconnected_delimit_mesh(void)
-{
- selectconnected_delimit_mesh__internal(0, ((G.qual & LR_SHIFTKEY)==0));
-}
-void selectconnected_delimit_mesh_all(void)
-{
- selectconnected_delimit_mesh__internal(1, 1);
-}
-
-
-/* swap is 0 or 1, if 1 it hides not selected */
-void hide_mesh(int swap)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- int a;
-
- if(G.obedit==0) return;
-
- /* hide happens on least dominant select mode, and flushes up, not down! (helps preventing errors in subsurf) */
- /* - vertex hidden, always means edge is hidden too
- - edge hidden, always means face is hidden too
- - face hidden, only set face hide
- - then only flush back down what's absolute hidden
- */
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if((eve->f & SELECT)!=swap) {
- eve->f &= ~SELECT;
- eve->h= 1;
- }
- }
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->v1->h || eed->v2->h) {
- eed->h |= 1;
- eed->f &= ~SELECT;
- }
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e1->h & 1 || efa->e2->h & 1 || efa->e3->h & 1 || (efa->e4 && efa->e4->h & 1)) {
- efa->h= 1;
- efa->f &= ~SELECT;
- }
- }
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if((eed->f & SELECT)!=swap) {
- eed->h |= 1;
- EM_select_edge(eed, 0);
- }
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->e1->h & 1 || efa->e2->h & 1 || efa->e3->h & 1 || (efa->e4 && efa->e4->h & 1)) {
- efa->h= 1;
- efa->f &= ~SELECT;
- }
- }
- }
- else {
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if((efa->f & SELECT)!=swap) {
- efa->h= 1;
- EM_select_face(efa, 0);
- }
- }
- }
-
- /* flush down, only whats 100% hidden */
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(eed= em->edges.first; eed; eed= eed->next) eed->f1= 0;
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h) a= 1; else a= 2;
- efa->e1->f1 |= a;
- efa->e2->f1 |= a;
- efa->e3->f1 |= a;
- if(efa->e4) efa->e4->f1 |= a;
- /* When edges are not delt with in their own loop, we need to explicitly re-selct select edges that are joined to unselected faces */
- if (swap && (G.scene->selectmode == SCE_SELECT_FACE) && (efa->f & SELECT)) {
- EM_select_face(efa, 1);
- }
- }
- }
-
- if(G.scene->selectmode >= SCE_SELECT_EDGE) {
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f1==1) eed->h |= 1;
- if(eed->h & 1) a= 1; else a= 2;
- eed->v1->f1 |= a;
- eed->v2->f1 |= a;
- }
- }
-
- if(G.scene->selectmode >= SCE_SELECT_VERTEX) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f1==1) eve->h= 1;
- }
- }
-
- G.totedgesel= G.totfacesel= G.totvertsel= 0;
- allqueue(REDRAWVIEW3D, 0);
- if(EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Hide");
-}
-
-
-void reveal_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- if(G.obedit==0) return;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h) {
- eve->h= 0;
- eve->f |= SELECT;
- }
- }
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h & 1) {
- eed->h &= ~1;
- if(G.scene->selectmode & SCE_SELECT_VERTEX);
- else EM_select_edge(eed, 1);
- }
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h) {
- efa->h= 0;
- if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_VERTEX));
- else EM_select_face(efa, 1);
- }
- }
-
- EM_fgon_flags(); /* redo flags and indices for fgons */
- EM_selectmode_flush();
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Reveal");
-}
-
-void hide_tface_uv(int swap)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- /* call the mesh function if we are in mesh sync sel */
- if (G.sima->flag & SI_SYNC_UVSEL) {
- hide_mesh(swap);
- return;
- }
-
- if(swap) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (G.sima->flag & SI_SELACTFACE) {
- /* Pretend face mode */
- if (( (efa->v4==NULL &&
- ( tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) == (TF_SEL1|TF_SEL2|TF_SEL3) ) ||
- ( tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) == (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) ) == 0) {
-
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- efa->f &= ~SELECT;
- /* must re-select after */
- efa->e1->f &= ~SELECT;
- efa->e2->f &= ~SELECT;
- efa->e3->f &= ~SELECT;
- if(efa->e4) efa->e4->f &= ~SELECT;
- } else {
- EM_select_face(efa, 0);
- }
- }
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- } else if (G.scene->selectmode == SCE_SELECT_FACE) {
- if((tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3))==0) {
- if(!efa->v4)
- EM_select_face(efa, 0);
- else if(!(tface->flag & TF_SEL4))
- EM_select_face(efa, 0);
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- } else {
- /* EM_deselect_flush will deselect the face */
- if((tface->flag & TF_SEL1)==0) efa->v1->f &= ~SELECT;
- if((tface->flag & TF_SEL2)==0) efa->v2->f &= ~SELECT;
- if((tface->flag & TF_SEL3)==0) efa->v3->f &= ~SELECT;
- if((efa->v4) && (tface->flag & TF_SEL4)==0) efa->v4->f &= ~SELECT;
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- }
- }
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (G.sima->flag & SI_SELACTFACE) {
- if ( (efa->v4==NULL &&
- ( tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) == (TF_SEL1|TF_SEL2|TF_SEL3) ) ||
- ( tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) == (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4) ) {
-
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- efa->f &= ~SELECT;
- /* must re-select after */
- efa->e1->f &= ~SELECT;
- efa->e2->f &= ~SELECT;
- efa->e3->f &= ~SELECT;
- if(efa->e4) efa->e4->f &= ~SELECT;
- } else {
- EM_select_face(efa, 0);
- }
- }
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- } else if (G.scene->selectmode == SCE_SELECT_FACE) {
- if(tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3))
- EM_select_face(efa, 0);
- else if(efa->v4 && tface->flag & TF_SEL4)
- EM_select_face(efa, 0);
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- } else {
- /* EM_deselect_flush will deselect the face */
- if(tface->flag & TF_SEL1) efa->v1->f &= ~SELECT;
- if(tface->flag & TF_SEL2) efa->v2->f &= ~SELECT;
- if(tface->flag & TF_SEL3) efa->v3->f &= ~SELECT;
- if((efa->v4) && tface->flag & TF_SEL4) efa->v4->f &= ~SELECT;
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- }
- }
- }
-
-
- /*deselects too many but ok for now*/
- if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_VERTEX)) {
- EM_deselect_flush();
- }
-
- if (G.scene->selectmode==SCE_SELECT_FACE) {
- /* de-selected all edges from faces that were de-selected.
- * now make sure all faces that are selected also have selected edges */
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->f & SELECT) {
- EM_select_face(efa, 1);
- }
- }
- }
-
- EM_validate_selections();
-
- BIF_undo_push("Hide UV");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-void reveal_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- /* call the mesh function if we are in mesh sync sel */
- if (G.sima->flag & SI_SYNC_UVSEL) {
- reveal_mesh();
- return;
- }
-
- if (G.sima->flag & SI_SELACTFACE) {
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->h) && !(efa->f & SELECT)) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- EM_select_face(efa, 1);
- tface->flag |= TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4;
- }
- }
- } else {
- /* enable adjacent faces to have disconnected UV selections if sticky is disabled */
- if (G.sima->sticky == SI_STICKY_DISABLE) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->h) && !(efa->f & SELECT)) {
- /* All verts must be unselected for the face to be selected in the UV view */
- if ((efa->v1->f&SELECT)==0 && (efa->v2->f&SELECT)==0 && (efa->v3->f&SELECT)==0 && (efa->v4==0 || (efa->v4->f&SELECT)==0)) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tface->flag |= TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4;
- /* Cant use EM_select_face here because it unselects the verts
- * and we cant tell if the face was totally unselected or not */
- /*EM_select_face(efa, 1);
- *
- * See Loop with EM_select_face() below... */
- efa->f |= SELECT;
- }
- }
- }
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->h) && !(efa->f & SELECT)) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if ((efa->v1->f & SELECT)==0) {tface->flag |= TF_SEL1;}
- if ((efa->v2->f & SELECT)==0) {tface->flag |= TF_SEL2;}
- if ((efa->v3->f & SELECT)==0) {tface->flag |= TF_SEL3;}
- if ((efa->v4 && (efa->v4->f & SELECT)==0)) {tface->flag |= TF_SEL4;}
- efa->f |= SELECT;
- }
- }
- }
-
- /* Select all edges and verts now */
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* we only selected the face flags, and didnt changes edges or verts, fix this now */
- if (!(efa->h) && (efa->f & SELECT)) {
- EM_select_face(efa, 1);
- }
- }
- EM_select_flush();
- }
- } else if (G.scene->selectmode == SCE_SELECT_FACE) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->h) && !(efa->f & SELECT)) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- efa->f |= SELECT;
- tface->flag |= TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4;
- }
- }
-
- /* Select all edges and verts now */
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* we only selected the face flags, and didnt changes edges or verts, fix this now */
- if (!(efa->h) && (efa->f & SELECT)) {
- EM_select_face(efa, 1);
- }
- }
-
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (!(efa->h) && !(efa->f & SELECT)) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if ((efa->v1->f & SELECT)==0) {tface->flag |= TF_SEL1;}
- if ((efa->v2->f & SELECT)==0) {tface->flag |= TF_SEL2;}
- if ((efa->v3->f & SELECT)==0) {tface->flag |= TF_SEL3;}
- if ((efa->v4 && (efa->v4->f & SELECT)==0)) {tface->flag |= TF_SEL4;}
- efa->f |= SELECT;
- }
- }
-
- /* Select all edges and verts now */
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* we only selected the face flags, and didnt changes edges or verts, fix this now */
- if (!(efa->h) && (efa->f & SELECT)) {
- EM_select_face(efa, 1);
- }
- }
- }
-
- BIF_undo_push("Reveal UV");
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-void select_faces_by_numverts(int numverts)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- /* Selects trias/qiads or isolated verts, and edges that do not have 2 neighboring
- * faces
- */
-
- /* for loose vertices/edges, we first select all, loop below will deselect */
- if(numverts==5)
- EM_set_flag_all(SELECT);
- else if(G.scene->selectmode!=SCE_SELECT_FACE) {
- error("Only works in face selection mode");
- return;
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if (efa->e4) {
- EM_select_face(efa, (numverts==4) );
- }
- else {
- EM_select_face(efa, (numverts==3) );
- }
- }
-
- countall();
- addqueue(curarea->win, REDRAW, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- if (numverts==3)
- BIF_undo_push("Select Triangles");
- else if (numverts==4)
- BIF_undo_push("Select Quads");
- else
- BIF_undo_push("Select non-Triangles/Quads");
-}
-
-void select_sharp_edges(void)
-{
- /* Find edges that have exactly two neighboring faces,
- * check the angle between those faces, and if angle is
- * small enough, select the edge
- */
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
- EditFace **efa1;
- EditFace **efa2;
- intptr_t edgecount = 0, i;
- static short sharpness = 135;
- float fsharpness;
-
- if(G.scene->selectmode==SCE_SELECT_FACE) {
- error("Doesn't work in face selection mode");
- return;
- }
-
- if(button(&sharpness,0, 180,"Max Angle:")==0) return;
- /* if faces are at angle 'sharpness', then the face normals
- * are at angle 180.0 - 'sharpness' (convert to radians too)
- */
- fsharpness = ((180.0 - sharpness) * M_PI) / 180.0;
-
- i=0;
- /* count edges, use tmp.l */
- eed= em->edges.first;
- while(eed) {
- edgecount++;
- eed->tmp.l = i;
- eed= eed->next;
- ++i;
- }
-
- /* for each edge, we want a pointer to two adjacent faces */
- efa1 = MEM_callocN(edgecount*sizeof(EditFace *),
- "pairs of edit face pointers");
- efa2 = MEM_callocN(edgecount*sizeof(EditFace *),
- "pairs of edit face pointers");
-
-#define face_table_edge(eed) { \
- i = eed->tmp.l; \
- if (i != -1) { \
- if (efa1[i]) { \
- if (efa2[i]) { \
- /* invalidate, edge has more than two neighbors */ \
- eed->tmp.l = -1; \
- } \
- else { \
- efa2[i] = efa; \
- } \
- } \
- else { \
- efa1[i] = efa; \
- } \
- } \
- }
-
- /* find the adjacent faces of each edge, we want only two */
- efa= em->faces.first;
- while(efa) {
- face_table_edge(efa->e1);
- face_table_edge(efa->e2);
- face_table_edge(efa->e3);
- if (efa->e4) {
- face_table_edge(efa->e4);
- }
- efa= efa->next;
- }
-
-#undef face_table_edge
-
- eed = em->edges.first;
- while(eed) {
- i = eed->tmp.l;
- if (i != -1) {
- /* edge has two or less neighboring faces */
- if ( (efa1[i]) && (efa2[i]) ) {
- /* edge has exactly two neighboring faces, check angle */
- float angle;
- angle = saacos(efa1[i]->n[0]*efa2[i]->n[0] +
- efa1[i]->n[1]*efa2[i]->n[1] +
- efa1[i]->n[2]*efa2[i]->n[2]);
- if (fabs(angle) >= fsharpness)
- EM_select_edge(eed, 1);
- }
- }
-
- eed= eed->next;
- }
-
- MEM_freeN(efa1);
- MEM_freeN(efa2);
-
- countall();
- addqueue(curarea->win, REDRAW, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- BIF_undo_push("Select Sharp Edges");
-}
-
-void select_linked_flat_faces(void)
-{
- /* Find faces that are linked to selected faces that are
- * relatively flat (angle between faces is higher than
- * specified angle)
- */
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
- EditFace **efa1;
- EditFace **efa2;
- intptr_t edgecount = 0, i, faceselcount=0, faceselcountold=0;
- static short sharpness = 135;
- float fsharpness;
-
- if(G.scene->selectmode!=SCE_SELECT_FACE) {
- error("Only works in face selection mode");
- return;
- }
-
- if(button(&sharpness,0, 180,"Min Angle:")==0) return;
- /* if faces are at angle 'sharpness', then the face normals
- * are at angle 180.0 - 'sharpness' (convert to radians too)
- */
- fsharpness = ((180.0 - sharpness) * M_PI) / 180.0;
-
- i=0;
- /* count edges, use tmp.l */
- eed= em->edges.first;
- while(eed) {
- edgecount++;
- eed->tmp.l = i;
- eed= eed->next;
- ++i;
- }
-
- /* for each edge, we want a pointer to two adjacent faces */
- efa1 = MEM_callocN(edgecount*sizeof(EditFace *),
- "pairs of edit face pointers");
- efa2 = MEM_callocN(edgecount*sizeof(EditFace *),
- "pairs of edit face pointers");
-
-#define face_table_edge(eed) { \
- i = eed->tmp.l; \
- if (i != -1) { \
- if (efa1[i]) { \
- if (efa2[i]) { \
- /* invalidate, edge has more than two neighbors */ \
- eed->tmp.l = -1; \
- } \
- else { \
- efa2[i] = efa; \
- } \
- } \
- else { \
- efa1[i] = efa; \
- } \
- } \
- }
-
- /* find the adjacent faces of each edge, we want only two */
- efa= em->faces.first;
- while(efa) {
- face_table_edge(efa->e1);
- face_table_edge(efa->e2);
- face_table_edge(efa->e3);
- if (efa->e4) {
- face_table_edge(efa->e4);
- }
-
- /* while were at it, count the selected faces */
- if (efa->f & SELECT) ++faceselcount;
-
- efa= efa->next;
- }
-
-#undef face_table_edge
-
- eed= em->edges.first;
- while(eed) {
- i = eed->tmp.l;
- if (i != -1) {
- /* edge has two or less neighboring faces */
- if ( (efa1[i]) && (efa2[i]) ) {
- /* edge has exactly two neighboring faces, check angle */
- float angle;
- angle = saacos(efa1[i]->n[0]*efa2[i]->n[0] +
- efa1[i]->n[1]*efa2[i]->n[1] +
- efa1[i]->n[2]*efa2[i]->n[2]);
- /* invalidate: edge too sharp */
- if (fabs(angle) >= fsharpness)
- eed->tmp.l = -1;
- }
- else {
- /* invalidate: less than two neighbors */
- eed->tmp.l = -1;
- }
- }
-
- eed= eed->next;
- }
-
-#define select_flat_neighbor(eed) { \
- i = eed->tmp.l; \
- if (i!=-1) { \
- if (! (efa1[i]->f & SELECT) ) { \
- EM_select_face(efa1[i], 1); \
- ++faceselcount; \
- } \
- if (! (efa2[i]->f & SELECT) ) { \
- EM_select_face(efa2[i], 1); \
- ++faceselcount; \
- } \
- } \
- }
-
- while (faceselcount != faceselcountold) {
- faceselcountold = faceselcount;
-
- efa= em->faces.first;
- while(efa) {
- if (efa->f & SELECT) {
- select_flat_neighbor(efa->e1);
- select_flat_neighbor(efa->e2);
- select_flat_neighbor(efa->e3);
- if (efa->e4) {
- select_flat_neighbor(efa->e4);
- }
- }
- efa= efa->next;
- }
- }
-
-#undef select_flat_neighbor
-
- MEM_freeN(efa1);
- MEM_freeN(efa2);
-
- countall();
- addqueue(curarea->win, REDRAW, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Linked Flat Faces");
-}
-
-void select_non_manifold(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- /* Selects isolated verts, and edges that do not have 2 neighboring
- * faces
- */
-
- if(G.scene->selectmode==SCE_SELECT_FACE) {
- error("Doesn't work in face selection mode");
- return;
- }
-
- eve= em->verts.first;
- while(eve) {
- /* this will count how many edges are connected
- * to this vert */
- eve->f1= 0;
- eve= eve->next;
- }
-
- eed= em->edges.first;
- while(eed) {
- /* this will count how many faces are connected to
- * this edge */
- eed->f1= 0;
- /* increase edge count for verts */
- ++eed->v1->f1;
- ++eed->v2->f1;
- eed= eed->next;
- }
-
- efa= em->faces.first;
- while(efa) {
- /* increase face count for edges */
- ++efa->e1->f1;
- ++efa->e2->f1;
- ++efa->e3->f1;
- if (efa->e4)
- ++efa->e4->f1;
- efa= efa->next;
- }
-
- /* select verts that are attached to an edge that does not
- * have 2 neighboring faces */
- eed= em->edges.first;
- while(eed) {
- if (eed->h==0 && eed->f1 != 2) {
- EM_select_edge(eed, 1);
- }
- eed= eed->next;
- }
-
- /* select isolated verts */
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- eve= em->verts.first;
- while(eve) {
- if (eve->f1 == 0) {
- if (!eve->h) eve->f |= SELECT;
- }
- eve= eve->next;
- }
- }
-
- countall();
- addqueue(curarea->win, REDRAW, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select Non Manifold");
-}
-
-void selectswap_mesh(void) /* UI level */
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0) {
- if(eve->f & SELECT) eve->f &= ~SELECT;
- else eve->f|= SELECT;
- }
- }
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- EM_select_edge(eed, !(eed->f & SELECT));
- }
- }
- }
- else {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- EM_select_face(efa, !(efa->f & SELECT));
- }
- }
- }
-
- EM_selectmode_flush();
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- BIF_undo_push("Select Swap");
-
-}
-
-void deselectall_mesh(void) /* this toggles!!!, UI level */
-{
-
- if(G.obedit->lay & G.vd->lay) {
-
- if( EM_nvertices_selected() ) {
- EM_clear_flag_all(SELECT);
- BIF_undo_push("Deselect All");
- }
- else {
- EM_set_flag_all(SELECT);
- BIF_undo_push("Select All");
- }
-
- countall();
-
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-void EM_select_more(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) eve->f1= 1;
- else eve->f1 = 0;
- }
-
- /* set f1 flags in vertices to select 'more' */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- if (eed->v1->f & SELECT)
- eed->v2->f1 = 1;
- if (eed->v2->f & SELECT)
- eed->v1->f1 = 1;
- }
- }
-
- /* new selected edges, but not in facemode */
- if(G.scene->selectmode <= SCE_SELECT_EDGE) {
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- if(eed->v1->f1 && eed->v2->f1) EM_select_edge(eed, 1);
- }
- }
- }
- /* new selected faces */
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- if(efa->v1->f1 && efa->v2->f1 && efa->v3->f1 && (efa->v4==NULL || efa->v4->f1))
- EM_select_face(efa, 1);
- }
- }
-}
-
-void select_more(void)
-{
- EM_select_more();
-
- countall();
- addqueue(curarea->win, REDRAW, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Select More");
-}
-
-void EM_select_less(void)
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- EditFace *efa;
-
- if(G.scene->selectmode <= SCE_SELECT_EDGE) {
- /* eed->f1 == 1: edge with a selected and deselected vert */
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- if(eed->h==0) {
-
- if ( !(eed->v1->f & SELECT) && (eed->v2->f & SELECT) )
- eed->f1= 1;
- if ( (eed->v1->f & SELECT) && !(eed->v2->f & SELECT) )
- eed->f1= 1;
- }
- }
-
- /* deselect edges with flag set */
- for(eed= em->edges.first; eed; eed= eed->next) {
- if (eed->h==0 && eed->f1 == 1) {
- EM_select_edge(eed, 0);
- }
- }
- EM_deselect_flush();
-
- }
- else {
- /* deselect faces with 1 or more deselect edges */
- /* eed->f1 == mixed selection edge */
- for(eed= em->edges.first; eed; eed= eed->next) eed->f1= 0;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- if(efa->f & SELECT) {
- efa->e1->f1 |= 1;
- efa->e2->f1 |= 1;
- efa->e3->f1 |= 1;
- if(efa->e4) efa->e4->f1 |= 1;
- }
- else {
- efa->e1->f1 |= 2;
- efa->e2->f1 |= 2;
- efa->e3->f1 |= 2;
- if(efa->e4) efa->e4->f1 |= 2;
- }
- }
- }
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- if(efa->e1->f1==3 || efa->e2->f1==3 || efa->e3->f1==3 || (efa->e4 && efa->e4->f1==3)) {
- EM_select_face(efa, 0);
- }
- }
- }
- EM_selectmode_flush();
-
- }
-}
-
-void select_less(void)
-{
- EM_select_less();
-
- countall();
- BIF_undo_push("Select Less");
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-}
-
-
-void selectrandom_mesh(void) /* randomly selects a user-set % of vertices/edges/faces */
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- static short randfac = 50;
-
- if(G.obedit==NULL || (G.obedit->lay & G.vd->lay)==0) return;
-
- /* Get the percentage of vertices to randomly select as 'randfac' */
- if(button(&randfac,0, 100,"Percentage:")==0) return;
-
- BLI_srand( BLI_rand() ); /* random seed */
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0) {
- if ( (BLI_frand() * 100) < randfac)
- eve->f |= SELECT;
- }
- }
- EM_selectmode_flush();
- countall();
- BIF_undo_push("Select Random: Vertices");
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- if ( (BLI_frand() * 100) < randfac)
- EM_select_edge(eed, 1);
- }
- }
- EM_selectmode_flush();
- countall();
- BIF_undo_push("Select Random:Edges");
- }
- else {
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0) {
- if ( (BLI_frand() * 100) < randfac)
- EM_select_face(efa, 1);
- }
- }
-
- EM_selectmode_flush();
- countall();
- BIF_undo_push("Select Random:Faces");
- }
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-}
-
-void editmesh_select_by_material(int index)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- for (efa=em->faces.first; efa; efa= efa->next) {
- if (efa->mat_nr==index) {
- EM_select_face(efa, 1);
- }
- }
-
- EM_selectmode_flush();
-}
-
-void editmesh_deselect_by_material(int index)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- for (efa=em->faces.first; efa; efa= efa->next) {
- if (efa->mat_nr==index) {
- EM_select_face(efa, 0);
- }
- }
-
- EM_selectmode_flush();
-}
-
-void EM_selectmode_menu(void)
-{
- int val;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) pupmenu_set_active(1);
- else if(G.scene->selectmode & SCE_SELECT_EDGE) pupmenu_set_active(2);
- else pupmenu_set_active(3);
-
- val= pupmenu("Select Mode%t|Vertices|Edges|Faces");
-
-
- if(val>0) {
- if(val==1){
- G.scene->selectmode= SCE_SELECT_VERTEX;
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Vertex");
- }
- else if(val==2){
- if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_EDGE);
- G.scene->selectmode= SCE_SELECT_EDGE;
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Edge");
- }
-
- else{
- if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_FACE);
- G.scene->selectmode= SCE_SELECT_FACE;
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Vertex");
- }
-
- allqueue(REDRAWVIEW3D, 1);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- }
-}
-
-/* ************************* SEAMS AND EDGES **************** */
-
-void editmesh_mark_seam(int clear)
-{
- EditMesh *em= G.editMesh;
- EditEdge *eed;
-
- if(multires_level1_test()) return;
-
- /* auto-enable seams drawing */
- if(clear==0) {
- if(!(G.f & G_DRAWSEAMS)) {
- G.f |= G_DRAWSEAMS;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
-
- if(clear) {
- eed= em->edges.first;
- while(eed) {
- if((eed->h==0) && (eed->f & SELECT)) {
- eed->seam = 0;
- }
- eed= eed->next;
- }
- BIF_undo_push("Mark Seam");
- }
- else {
- eed= em->edges.first;
- while(eed) {
- if((eed->h==0) && (eed->f & SELECT)) {
- eed->seam = 1;
- }
- eed= eed->next;
- }
- BIF_undo_push("Clear Seam");
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void editmesh_mark_sharp(int set)
-{
- EditMesh *em= G.editMesh;
- EditEdge *eed;
-
-#if 0
- /* auto-enable sharp edge drawing */
- if(set) {
- if(!(G.f & G_DRAWSEAMS)) {
- G.f |= G_DRAWSEAMS;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
-#endif
-
- if(multires_level1_test()) return;
-
- if(set) {
- eed= em->edges.first;
- while(eed) {
- if(!eed->h && (eed->f & SELECT)) eed->sharp = 1;
- eed = eed->next;
- }
- } else {
- eed= em->edges.first;
- while(eed) {
- if(!eed->h && (eed->f & SELECT)) eed->sharp = 0;
- eed = eed->next;
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void BME_Menu() {
- short ret;
- ret= pupmenu("BME modeller%t|Select Edges of Vert%x1");
-
- switch(ret)
- {
- case 1:
- //BME_edges_of_vert();
- break;
- }
-}
-
-
-
-void Vertex_Menu() {
- short ret;
- ret= pupmenu("Vertex Specials%t|Remove Doubles%x1|Merge%x2|Smooth %x3|Select Vertex Path%x4|Blend From Shape%x5|Propagate To All Shapes%x6");
-
- switch(ret)
- {
- case 1:
- notice("Removed %d Vertices", removedoublesflag(1, 0, G.scene->toolsettings->doublimit));
- BIF_undo_push("Remove Doubles");
- break;
- case 2:
- mergemenu();
- break;
- case 3:
- vertexsmooth();
- break;
- case 4:
- pathselect();
- BIF_undo_push("Select Vertex Path");
- break;
- case 5:
- shape_copy_select_from();
- break;
- case 6:
- shape_propagate();
- break;
- }
- /* some items crashed because this is in the original W menu but not here. should really manage this better */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-
-void Edge_Menu() {
- short ret;
-
- ret= pupmenu("Edge Specials%t|Mark Seam %x1|Clear Seam %x2|Rotate Edge CW%x3|Rotate Edge CCW%x4|Loopcut%x6|Edge Slide%x5|Edge Loop Select%x7|Edge Ring Select%x8|Loop to Region%x9|Region to Loop%x10|Mark Sharp%x11|Clear Sharp%x12");
-
- switch(ret)
- {
- case 1:
- editmesh_mark_seam(0);
- break;
- case 2:
- editmesh_mark_seam(1);
- break;
- case 3:
- edge_rotate_selected(2);
- break;
- case 4:
- edge_rotate_selected(1);
- break;
- case 5:
- EdgeSlide(0,0.0);
- BIF_undo_push("EdgeSlide");
- break;
- case 6:
- CutEdgeloop(1);
- BIF_undo_push("Loopcut New");
- break;
- case 7:
- loop_multiselect(0);
- break;
- case 8:
- loop_multiselect(1);
- break;
- case 9:
- loop_to_region();
- break;
- case 10:
- region_to_loop();
- break;
- case 11:
- editmesh_mark_sharp(1);
- BIF_undo_push("Mark Sharp");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 12:
- editmesh_mark_sharp(0);
- BIF_undo_push("Clear Sharp");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- }
- /* some items crashed because this is in the original W menu but not here. should really manage this better */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-void Face_Menu() {
- short ret;
- ret= pupmenu(
- "Face Specials%t|Flip Normals%x1|Bevel%x2|Shade Smooth%x3|Shade Flat%x4|"
- "Triangulate (Ctrl T)%x5|Quads from Triangles (Alt J)%x6|Flip Triangle Edges (Ctrl Shift F)%x7|%l|"
- "Face Mode Set%x8|Face Mode Clear%x9|%l|"
- "UV Rotate (Shift - CCW)%x10|UV Mirror (Shift - Switch Axis)%x11|"
- "Color Rotate (Shift - CCW)%x12|Color Mirror (Shift - Switch Axis)%x13");
-
- switch(ret)
- {
- case 1:
- flip_editnormals();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Flip Normals");
- allqueue(REDRAWVIEW3D, 0);
- break;
- case 2:
- bevel_menu();
- break;
- case 3:
- mesh_set_smooth_faces(1);
- break;
- case 4:
- mesh_set_smooth_faces(0);
- break;
-
- case 5: /* Quads to Tris */
- convert_to_triface(0);
- allqueue(REDRAWVIEW3D, 0);
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 6: /* Tris to Quads */
- join_triangles();
- break;
- case 7: /* Flip triangle edges */
- edge_flip();
- break;
- case 8:
- mesh_set_face_flags(1);
- break;
- case 9:
- mesh_set_face_flags(0);
- break;
-
- /* uv texface options */
- case 10:
- mesh_rotate_uvs();
- break;
- case 11:
- mesh_mirror_uvs();
- break;
- case 12:
- mesh_rotate_colors();
- break;
- case 13:
- mesh_mirror_colors();
- break;
- }
- /* some items crashed because this is in the original W menu but not here. should really manage this better */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-
-/* **************** NORMALS ************** */
-
-void righthandfaces(int select) /* makes faces righthand turning */
-{
- EditMesh *em = G.editMesh;
- EditEdge *eed, *ed1, *ed2, *ed3, *ed4;
- EditFace *efa, *startvl;
- float maxx, nor[3], cent[3];
- int totsel, found, foundone, direct, turn, tria_nr;
-
- /* based at a select-connected to witness loose objects */
-
- /* count per edge the amount of faces */
-
- /* find the ultimate left, front, upper face (not manhattan dist!!) */
- /* also evaluate both triangle cases in quad, since these can be non-flat */
-
- /* put normal to the outside, and set the first direction flags in edges */
-
- /* then check the object, and set directions / direction-flags: but only for edges with 1 or 2 faces */
- /* this is in fact the 'select connected' */
-
- /* in case (selected) faces were not done: start over with 'find the ultimate ...' */
-
- waitcursor(1);
-
- eed= em->edges.first;
- while(eed) {
- eed->f2= 0; /* edge direction */
- eed->f1= 0; /* counter */
- eed= eed->next;
- }
-
- /* count faces and edges */
- totsel= 0;
- efa= em->faces.first;
- while(efa) {
- if(select==0 || (efa->f & SELECT) ) {
- efa->f1= 1;
- totsel++;
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->v4) efa->e4->f1++;
- }
- else efa->f1= 0;
-
- efa= efa->next;
- }
-
- while(totsel>0) {
- /* from the outside to the inside */
-
- efa= em->faces.first;
- startvl= NULL;
- maxx= -1.0e10;
- tria_nr= 0;
-
- while(efa) {
- if(efa->f1) {
- CalcCent3f(cent, efa->v1->co, efa->v2->co, efa->v3->co);
- cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2];
-
- if(cent[0]>maxx) {
- maxx= cent[0];
- startvl= efa;
- tria_nr= 0;
- }
- if(efa->v4) {
- CalcCent3f(cent, efa->v1->co, efa->v3->co, efa->v4->co);
- cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2];
-
- if(cent[0]>maxx) {
- maxx= cent[0];
- startvl= efa;
- tria_nr= 1;
- }
- }
- }
- efa= efa->next;
- }
-
- if (startvl==NULL)
- startvl= em->faces.first;
-
- /* set first face correct: calc normal */
-
- if(tria_nr==1) {
- CalcNormFloat(startvl->v1->co, startvl->v3->co, startvl->v4->co, nor);
- CalcCent3f(cent, startvl->v1->co, startvl->v3->co, startvl->v4->co);
- } else {
- CalcNormFloat(startvl->v1->co, startvl->v2->co, startvl->v3->co, nor);
- CalcCent3f(cent, startvl->v1->co, startvl->v2->co, startvl->v3->co);
- }
- /* first normal is oriented this way or the other */
- if(select) {
- if(select==2) {
- if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipface(startvl);
- }
- else {
- if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl);
- }
- }
- else if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl);
-
-
- eed= startvl->e1;
- if(eed->v1==startvl->v1) eed->f2= 1;
- else eed->f2= 2;
-
- eed= startvl->e2;
- if(eed->v1==startvl->v2) eed->f2= 1;
- else eed->f2= 2;
-
- eed= startvl->e3;
- if(eed->v1==startvl->v3) eed->f2= 1;
- else eed->f2= 2;
-
- eed= startvl->e4;
- if(eed) {
- if(eed->v1==startvl->v4) eed->f2= 1;
- else eed->f2= 2;
- }
-
- startvl->f1= 0;
- totsel--;
-
- /* test normals */
- found= 1;
- direct= 1;
- while(found) {
- found= 0;
- if(direct) efa= em->faces.first;
- else efa= em->faces.last;
- while(efa) {
- if(efa->f1) {
- turn= 0;
- foundone= 0;
-
- ed1= efa->e1;
- ed2= efa->e2;
- ed3= efa->e3;
- ed4= efa->e4;
-
- if(ed1->f2) {
- if(ed1->v1==efa->v1 && ed1->f2==1) turn= 1;
- if(ed1->v2==efa->v1 && ed1->f2==2) turn= 1;
- foundone= 1;
- }
- else if(ed2->f2) {
- if(ed2->v1==efa->v2 && ed2->f2==1) turn= 1;
- if(ed2->v2==efa->v2 && ed2->f2==2) turn= 1;
- foundone= 1;
- }
- else if(ed3->f2) {
- if(ed3->v1==efa->v3 && ed3->f2==1) turn= 1;
- if(ed3->v2==efa->v3 && ed3->f2==2) turn= 1;
- foundone= 1;
- }
- else if(ed4 && ed4->f2) {
- if(ed4->v1==efa->v4 && ed4->f2==1) turn= 1;
- if(ed4->v2==efa->v4 && ed4->f2==2) turn= 1;
- foundone= 1;
- }
-
- if(foundone) {
- found= 1;
- totsel--;
- efa->f1= 0;
-
- if(turn) {
- if(ed1->v1==efa->v1) ed1->f2= 2;
- else ed1->f2= 1;
- if(ed2->v1==efa->v2) ed2->f2= 2;
- else ed2->f2= 1;
- if(ed3->v1==efa->v3) ed3->f2= 2;
- else ed3->f2= 1;
- if(ed4) {
- if(ed4->v1==efa->v4) ed4->f2= 2;
- else ed4->f2= 1;
- }
-
- flipface(efa);
-
- }
- else {
- if(ed1->v1== efa->v1) ed1->f2= 1;
- else ed1->f2= 2;
- if(ed2->v1==efa->v2) ed2->f2= 1;
- else ed2->f2= 2;
- if(ed3->v1==efa->v3) ed3->f2= 1;
- else ed3->f2= 2;
- if(ed4) {
- if(ed4->v1==efa->v4) ed4->f2= 1;
- else ed4->f2= 2;
- }
- }
- }
- }
- if(direct) efa= efa->next;
- else efa= efa->prev;
- }
- direct= 1-direct;
- }
- }
-
- recalc_editnormals();
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- waitcursor(0);
-}
-
-
-/* ********** ALIGN WITH VIEW **************** */
-
-
-static void editmesh_calc_selvert_center(float cent_r[3])
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- int nsel= 0;
-
- cent_r[0]= cent_r[1]= cent_r[0]= 0.0;
-
- for (eve= em->verts.first; eve; eve= eve->next) {
- if (eve->f & SELECT) {
- cent_r[0]+= eve->co[0];
- cent_r[1]+= eve->co[1];
- cent_r[2]+= eve->co[2];
- nsel++;
- }
- }
-
- if (nsel) {
- cent_r[0]/= nsel;
- cent_r[1]/= nsel;
- cent_r[2]/= nsel;
- }
-}
-
-static int mface_is_selected(MFace *mf)
-{
- return (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL));
-}
-
- /* XXX, code for both these functions should be abstract,
- * then unified, then written for other things (like objects,
- * which would use same as vertices method), then added
- * to interface! Hoera! - zr
- */
-void faceselect_align_view_to_selected(View3D *v3d, Mesh *me, int axis)
-{
- float norm[3];
- int i, totselected = 0;
-
- norm[0]= norm[1]= norm[2]= 0.0;
- for (i=0; i<me->totface; i++) {
- MFace *mf= ((MFace*) me->mface) + i;
-
- if (mface_is_selected(mf)) {
- float *v1, *v2, *v3, fno[3];
-
- v1= me->mvert[mf->v1].co;
- v2= me->mvert[mf->v2].co;
- v3= me->mvert[mf->v3].co;
- if (mf->v4) {
- float *v4= me->mvert[mf->v4].co;
- CalcNormFloat4(v1, v2, v3, v4, fno);
- } else {
- CalcNormFloat(v1, v2, v3, fno);
- }
-
- norm[0]+= fno[0];
- norm[1]+= fno[1];
- norm[2]+= fno[2];
-
- totselected++;
- }
- }
-
- if (totselected == 0)
- error("No faces selected.");
- else
- view3d_align_axis_to_vector(v3d, axis, norm);
-}
-
-/* helper for below, to survive non-uniform scaled objects */
-static void face_getnormal_obspace(EditFace *efa, float *fno)
-{
- float vec[4][3];
-
- VECCOPY(vec[0], efa->v1->co);
- Mat4Mul3Vecfl(G.obedit->obmat, vec[0]);
- VECCOPY(vec[1], efa->v2->co);
- Mat4Mul3Vecfl(G.obedit->obmat, vec[1]);
- VECCOPY(vec[2], efa->v3->co);
- Mat4Mul3Vecfl(G.obedit->obmat, vec[2]);
- if(efa->v4) {
- VECCOPY(vec[3], efa->v4->co);
- Mat4Mul3Vecfl(G.obedit->obmat, vec[3]);
-
- CalcNormFloat4(vec[0], vec[1], vec[2], vec[3], fno);
- }
- else CalcNormFloat(vec[0], vec[1], vec[2], fno);
-}
-
-
-void editmesh_align_view_to_selected(View3D *v3d, int axis)
-{
- EditMesh *em = G.editMesh;
- int nselverts= EM_nvertices_selected();
- float norm[3]={0.0, 0.0, 0.0}; /* used for storing the mesh normal */
-
- if (nselverts==0) {
- error("No faces or vertices selected.");
- }
- else if (EM_nfaces_selected()) {
- EditFace *efa;
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (faceselectedAND(efa, SELECT)) {
- float fno[3];
-
- face_getnormal_obspace(efa, fno);
- norm[0]+= fno[0];
- norm[1]+= fno[1];
- norm[2]+= fno[2];
- }
- }
-
- view3d_align_axis_to_vector(v3d, axis, norm);
- }
- else if (nselverts>2) {
- float cent[3];
- EditVert *eve, *leve= NULL;
-
- editmesh_calc_selvert_center(cent);
- for (eve= em->verts.first; eve; eve= eve->next) {
- if (eve->f & SELECT) {
- if (leve) {
- float tno[3];
- CalcNormFloat(cent, leve->co, eve->co, tno);
-
- /* XXX, fixme, should be flipped intp a
- * consistent direction. -zr
- */
- norm[0]+= tno[0];
- norm[1]+= tno[1];
- norm[2]+= tno[2];
- }
- leve= eve;
- }
- }
-
- Mat4Mul3Vecfl(G.obedit->obmat, norm);
- view3d_align_axis_to_vector(v3d, axis, norm);
- }
- else if (nselverts==2) { /* Align view to edge (or 2 verts) */
- EditVert *eve, *leve= NULL;
-
- for (eve= em->verts.first; eve; eve= eve->next) {
- if (eve->f & SELECT) {
- if (leve) {
- norm[0]= leve->co[0] - eve->co[0];
- norm[1]= leve->co[1] - eve->co[1];
- norm[2]= leve->co[2] - eve->co[2];
- break; /* we know there are only 2 verts so no need to keep looking */
- }
- leve= eve;
- }
- }
- Mat4Mul3Vecfl(G.obedit->obmat, norm);
- view3d_align_axis_to_vector(v3d, axis, norm);
- }
- else if (nselverts==1) { /* Align view to vert normal */
- EditVert *eve;
-
- for (eve= em->verts.first; eve; eve= eve->next) {
- if (eve->f & SELECT) {
- norm[0]= eve->no[0];
- norm[1]= eve->no[1];
- norm[2]= eve->no[2];
- break; /* we know this is the only selected vert, so no need to keep looking */
- }
- }
- Mat4Mul3Vecfl(G.obedit->obmat, norm);
- view3d_align_axis_to_vector(v3d, axis, norm);
- }
-}
-
-/* **************** VERTEX DEFORMS *************** */
-
-void vertexsmooth(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *eve_mir = NULL;
- EditEdge *eed;
- float *adror, *adr, fac;
- float fvec[3];
- int teller=0;
- ModifierData *md= G.obedit->modifiers.first;
-
- if(G.obedit==0) return;
-
- /* count */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) teller++;
- eve= eve->next;
- }
- if(teller==0) return;
-
- adr=adror= (float *)MEM_callocN(3*sizeof(float *)*teller, "vertsmooth");
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- eve->tmp.p = (void*)adr;
- eve->f1= 0;
- eve->f2= 0;
- adr+= 3;
- }
- eve= eve->next;
- }
-
- /* if there is a mirror modifier with clipping, flag the verts that
- * are within tolerance of the plane(s) of reflection
- */
- for (; md; md=md->next) {
- if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- for (eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
-
- switch(mmd->axis){
- case 0:
- if (fabs(eve->co[0]) < mmd->tolerance)
- eve->f2 |= 1;
- break;
- case 1:
- if (fabs(eve->co[1]) < mmd->tolerance)
- eve->f2 |= 2;
- break;
- case 2:
- if (fabs(eve->co[2]) < mmd->tolerance)
- eve->f2 |= 4;
- break;
- }
- }
- }
- }
- }
- }
-
- eed= em->edges.first;
- while(eed) {
- if( (eed->v1->f & SELECT) || (eed->v2->f & SELECT) ) {
- fvec[0]= (eed->v1->co[0]+eed->v2->co[0])/2.0;
- fvec[1]= (eed->v1->co[1]+eed->v2->co[1])/2.0;
- fvec[2]= (eed->v1->co[2]+eed->v2->co[2])/2.0;
-
- if((eed->v1->f & SELECT) && eed->v1->f1<255) {
- eed->v1->f1++;
- VecAddf(eed->v1->tmp.p, eed->v1->tmp.p, fvec);
- }
- if((eed->v2->f & SELECT) && eed->v2->f1<255) {
- eed->v2->f1++;
- VecAddf(eed->v2->tmp.p, eed->v2->tmp.p, fvec);
- }
- }
- eed= eed->next;
- }
-
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- if(eve->f1) {
-
- if (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR) {
- eve_mir= editmesh_get_x_mirror_vert(G.obedit, eve->co);
- }
-
- adr = eve->tmp.p;
- fac= 0.5/(float)eve->f1;
-
- eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
- eve->co[1]= 0.5*eve->co[1]+fac*adr[1];
- eve->co[2]= 0.5*eve->co[2]+fac*adr[2];
-
-
- /* clip if needed by mirror modifier */
- if (eve->f2) {
- if (eve->f2 & 1) {
- eve->co[0]= 0.0f;
- }
- if (eve->f2 & 2) {
- eve->co[1]= 0.0f;
- }
- if (eve->f2 & 4) {
- eve->co[2]= 0.0f;
- }
- }
-
- if (eve_mir) {
- eve_mir->co[0]=-eve->co[0];
- eve_mir->co[1]= eve->co[1];
- eve_mir->co[2]= eve->co[2];
- }
-
- }
- eve->tmp.p= NULL;
- }
- eve= eve->next;
- }
- MEM_freeN(adror);
-
- recalc_editnormals();
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_verseverts_with_editverts(G.editMesh->vnode);
-#endif
- BIF_undo_push("Vertex Smooth");
-}
-
-void vertexnoise(void)
-{
- EditMesh *em = G.editMesh;
- Material *ma;
- Tex *tex;
- EditVert *eve;
- float b2, ofs, vec[3];
-
- if(G.obedit==0) return;
-
- ma= give_current_material(G.obedit, G.obedit->actcol);
- if(ma==0 || ma->mtex[0]==0 || ma->mtex[0]->tex==0) {
- return;
- }
- tex= ma->mtex[0]->tex;
-
- ofs= tex->turbul/200.0;
-
- eve= (struct EditVert *)em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
-
- if(tex->type==TEX_STUCCI) {
-
- b2= BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]);
- if(tex->stype) ofs*=(b2*b2);
- vec[0]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0]+ofs, eve->co[1], eve->co[2]));
- vec[1]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1]+ofs, eve->co[2]));
- vec[2]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]+ofs));
-
- VecAddf(eve->co, eve->co, vec);
- }
- else {
- float tin, dum;
- externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum);
- eve->co[2]+= 0.05*tin;
- }
- }
- eve= eve->next;
- }
-
- recalc_editnormals();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_verseverts_with_editverts(G.editMesh->vnode);
-#endif
- BIF_undo_push("Vertex Noise");
-}
-
-void vertices_to_sphere(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- Object *ob= OBACT;
- float *curs, len, vec[3], cent[3], fac, facm, imat[3][3], bmat[3][3];
- int tot;
- short perc=100;
-
- if(ob==0) return;
- TEST_EDITMESH
-
- if(button(&perc, 1, 100, "Percentage:")==0) return;
-
- fac= perc/100.0;
- facm= 1.0-fac;
-
- Mat3CpyMat4(bmat, ob->obmat);
- Mat3Inv(imat, bmat);
-
- /* center */
- curs= give_cursor();
- cent[0]= curs[0]-ob->obmat[3][0];
- cent[1]= curs[1]-ob->obmat[3][1];
- cent[2]= curs[2]-ob->obmat[3][2];
- Mat3MulVecfl(imat, cent);
-
- len= 0.0;
- tot= 0;
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- tot++;
- len+= VecLenf(cent, eve->co);
- }
- eve= eve->next;
- }
- len/=tot;
-
- if(len==0.0) len= 10.0;
-
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- vec[0]= eve->co[0]-cent[0];
- vec[1]= eve->co[1]-cent[1];
- vec[2]= eve->co[2]-cent[2];
-
- Normalize(vec);
-
- eve->co[0]= fac*(cent[0]+vec[0]*len) + facm*eve->co[0];
- eve->co[1]= fac*(cent[1]+vec[1]*len) + facm*eve->co[1];
- eve->co[2]= fac*(cent[2]+vec[2]*len) + facm*eve->co[2];
-
- }
- eve= eve->next;
- }
-
- recalc_editnormals();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_verseverts_with_editverts(G.editMesh->vnode);
-#endif
- BIF_undo_push("To Sphere");
-}
-
diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c
deleted file mode 100644
index 76f1443616f..00000000000
--- a/source/blender/src/editmesh_tools.c
+++ /dev/null
@@ -1,7206 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Johnny Matthews, Geoffrey Bantle.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
-
-editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise in mods.c
-
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-#include "DNA_mesh_types.h"
-#include "DNA_material_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_key_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_rand.h"
-#include "BLI_ghash.h"
-#include "BLI_linklist.h"
-#include "BLI_heap.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-#include "BKE_bmesh.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_cursors.h"
-#include "BIF_editmesh.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_resources.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-#include "transform.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-
-#include "BSE_view.h"
-#include "BSE_edit.h"
-
-#include "blendef.h"
-#include "multires.h"
-#include "mydevice.h"
-
-#include "editmesh.h"
-
-#include "MTC_vectorops.h"
-
-#include "PIL_time.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* local prototypes ---------------*/
-void bevel_menu(void);
-static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa);
-
-/********* qsort routines *********/
-
-
-typedef struct xvertsort {
- float x;
- EditVert *v1;
-} xvertsort;
-
-static int vergxco(const void *v1, const void *v2)
-{
- const xvertsort *x1=v1, *x2=v2;
-
- if( x1->x > x2->x ) return 1;
- else if( x1->x < x2->x) return -1;
- return 0;
-}
-
-struct facesort {
- uintptr_t x;
- struct EditFace *efa;
-};
-
-
-static int vergface(const void *v1, const void *v2)
-{
- const struct facesort *x1=v1, *x2=v2;
-
- if( x1->x > x2->x ) return 1;
- else if( x1->x < x2->x) return -1;
- return 0;
-}
-
-
-/* *********************************** */
-
-void convert_to_triface(int direction)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, *efan, *next;
- float fac;
-
- if(multires_test()) return;
-
- efa= em->faces.last;
- while(efa) {
- next= efa->prev;
- if(efa->v4) {
- if(efa->f & SELECT) {
- /* choose shortest diagonal for split */
- fac= VecLenf(efa->v1->co, efa->v3->co) - VecLenf(efa->v2->co, efa->v4->co);
- /* this makes sure exact squares get split different in both cases */
- if( (direction==0 && fac<FLT_EPSILON) || (direction && fac>0.0f) ) {
- efan= EM_face_from_faces(efa, NULL, 0, 1, 2, -1);
- if(efa->f & SELECT) EM_select_face(efan, 1);
- efan= EM_face_from_faces(efa, NULL, 0, 2, 3, -1);
- if(efa->f & SELECT) EM_select_face(efan, 1);
- }
- else {
- efan= EM_face_from_faces(efa, NULL, 0, 1, 3, -1);
- if(efa->f & SELECT) EM_select_face(efan, 1);
- efan= EM_face_from_faces(efa, NULL, 1, 2, 3, -1);
- if(efa->f & SELECT) EM_select_face(efan, 1);
- }
-
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- }
- efa= next;
- }
-
- EM_fgon_flags(); // redo flags and indices for fgons
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
- BIF_undo_push("Convert Quads to Triangles");
-
-}
-
-int removedoublesflag(short flag, short automerge, float limit) /* return amount */
-{
- /*
- flag - Test with vert->flags
- automerge - Alternative operation, merge unselected into selected.
- Used for "Auto Weld" mode. warning.
- limit - Quick manhattan distance between verts.
- */
-
- EditMesh *em = G.editMesh;
- /* all verts with (flag & 'flag') are being evaluated */
- EditVert *eve, *v1, *nextve;
- EditEdge *eed, *e1, *nexted;
- EditFace *efa, *nextvl;
- xvertsort *sortblock, *sb, *sb1;
- struct facesort *vlsortblock, *vsb, *vsb1;
- int a, b, test, amount;
-
- if(multires_test()) return 0;
-
-
- /* flag 128 is cleared, count */
-
- /* Normal non weld operation */
- eve= em->verts.first;
- amount= 0;
- while(eve) {
- eve->f &= ~128;
- if(eve->h==0 && (automerge || (eve->f & flag))) amount++;
- eve= eve->next;
- }
- if(amount==0) return 0;
-
- /* allocate memory and qsort */
- sb= sortblock= MEM_mallocN(sizeof(xvertsort)*amount,"sortremovedoub");
- eve= em->verts.first;
- while(eve) {
- if(eve->h==0 && (automerge || (eve->f & flag))) {
- sb->x= eve->co[0]+eve->co[1]+eve->co[2];
- sb->v1= eve;
- sb++;
- }
- eve= eve->next;
- }
- qsort(sortblock, amount, sizeof(xvertsort), vergxco);
-
-
- /* test for doubles */
- sb= sortblock;
- if (automerge) {
- for(a=0; a<amount; a++, sb++) {
- eve= sb->v1;
- if( (eve->f & 128)==0 ) {
- sb1= sb+1;
- for(b=a+1; b<amount && (eve->f & 128)==0; b++, sb1++) {
- if(sb1->x - sb->x > limit) break;
-
- /* when automarge, only allow unselected->selected */
- v1= sb1->v1;
- if( (v1->f & 128)==0 ) {
- if ((eve->f & flag)==0 && (v1->f & flag)==1) {
- if( (float)fabs(v1->co[0]-eve->co[0])<=limit &&
- (float)fabs(v1->co[1]-eve->co[1])<=limit &&
- (float)fabs(v1->co[2]-eve->co[2])<=limit)
- { /* unique bit */
- eve->f|= 128;
- eve->tmp.v = v1;
- }
- } else if( (eve->f & flag)==1 && (v1->f & flag)==0 ) {
- if( (float)fabs(v1->co[0]-eve->co[0])<=limit &&
- (float)fabs(v1->co[1]-eve->co[1])<=limit &&
- (float)fabs(v1->co[2]-eve->co[2])<=limit)
- { /* unique bit */
- v1->f|= 128;
- v1->tmp.v = eve;
- }
- }
- }
- }
- }
- }
- } else {
- for(a=0; a<amount; a++, sb++) {
- eve= sb->v1;
- if( (eve->f & 128)==0 ) {
- sb1= sb+1;
- for(b=a+1; b<amount; b++, sb1++) {
- /* first test: simpel dist */
- if(sb1->x - sb->x > limit) break;
- v1= sb1->v1;
-
- /* second test: is vertex allowed */
- if( (v1->f & 128)==0 ) {
- if( (float)fabs(v1->co[0]-eve->co[0])<=limit &&
- (float)fabs(v1->co[1]-eve->co[1])<=limit &&
- (float)fabs(v1->co[2]-eve->co[2])<=limit)
- {
- v1->f|= 128;
- v1->tmp.v = eve;
- }
- }
- }
- }
- }
- }
- MEM_freeN(sortblock);
-
- if (!automerge)
- for(eve = em->verts.first; eve; eve=eve->next)
- if((eve->f & flag) && (eve->f & 128))
- EM_data_interp_from_verts(eve, eve->tmp.v, eve->tmp.v, 0.5f);
-
- /* test edges and insert again */
- eed= em->edges.first;
- while(eed) {
- eed->f2= 0;
- eed= eed->next;
- }
- eed= em->edges.last;
- while(eed) {
- nexted= eed->prev;
-
- if(eed->f2==0) {
- if( (eed->v1->f & 128) || (eed->v2->f & 128) ) {
- remedge(eed);
-
- if(eed->v1->f & 128) eed->v1 = eed->v1->tmp.v;
- if(eed->v2->f & 128) eed->v2 = eed->v2->tmp.v;
- e1= addedgelist(eed->v1, eed->v2, eed);
-
- if(e1) {
- e1->f2= 1;
- if(eed->f & SELECT)
- e1->f |= SELECT;
- }
- if(e1!=eed) free_editedge(eed);
- }
- }
- eed= nexted;
- }
-
- /* first count amount of test faces */
- efa= (struct EditFace *)em->faces.first;
- amount= 0;
- while(efa) {
- efa->f1= 0;
- if(efa->v1->f & 128) efa->f1= 1;
- else if(efa->v2->f & 128) efa->f1= 1;
- else if(efa->v3->f & 128) efa->f1= 1;
- else if(efa->v4 && (efa->v4->f & 128)) efa->f1= 1;
-
- if(efa->f1==1) amount++;
- efa= efa->next;
- }
-
- /* test faces for double vertices, and if needed remove them */
- efa= (struct EditFace *)em->faces.first;
- while(efa) {
- nextvl= efa->next;
- if(efa->f1==1) {
-
- if(efa->v1->f & 128) efa->v1= efa->v1->tmp.v;
- if(efa->v2->f & 128) efa->v2= efa->v2->tmp.v;
- if(efa->v3->f & 128) efa->v3= efa->v3->tmp.v;
- if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->tmp.v;
-
- test= 0;
- if(efa->v1==efa->v2) test+=1;
- if(efa->v2==efa->v3) test+=2;
- if(efa->v3==efa->v1) test+=4;
- if(efa->v4==efa->v1) test+=8;
- if(efa->v3==efa->v4) test+=16;
- if(efa->v2==efa->v4) test+=32;
-
- if(test) {
- if(efa->v4) {
- if(test==1 || test==2) {
- efa->v2= efa->v3;
- efa->v3= efa->v4;
- efa->v4= 0;
-
- EM_data_interp_from_faces(efa, NULL, efa, 0, 2, 3, 3);
-
- test= 0;
- }
- else if(test==8 || test==16) {
- efa->v4= 0;
- test= 0;
- }
- else {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- amount--;
- }
- }
- else {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- amount--;
- }
- }
-
- if(test==0) {
- /* set edge pointers */
- efa->e1= findedgelist(efa->v1, efa->v2);
- efa->e2= findedgelist(efa->v2, efa->v3);
- if(efa->v4==0) {
- efa->e3= findedgelist(efa->v3, efa->v1);
- efa->e4= 0;
- }
- else {
- efa->e3= findedgelist(efa->v3, efa->v4);
- efa->e4= findedgelist(efa->v4, efa->v1);
- }
- }
- }
- efa= nextvl;
- }
-
- /* double faces: sort block */
- /* count again, now all selected faces */
- amount= 0;
- efa= em->faces.first;
- while(efa) {
- efa->f1= 0;
- if(faceselectedOR(efa, 1)) {
- efa->f1= 1;
- amount++;
- }
- efa= efa->next;
- }
-
- if(amount) {
- /* double faces: sort block */
- vsb= vlsortblock= MEM_mallocN(sizeof(struct facesort)*amount, "sortremovedoub");
- efa= em->faces.first;
- while(efa) {
- if(efa->f1 & 1) {
- if(efa->v4) vsb->x= (uintptr_t) MIN4( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3, (uintptr_t)efa->v4);
- else vsb->x= (uintptr_t) MIN3( (uintptr_t)efa->v1, (uintptr_t)efa->v2, (uintptr_t)efa->v3);
-
- vsb->efa= efa;
- vsb++;
- }
- efa= efa->next;
- }
-
- qsort(vlsortblock, amount, sizeof(struct facesort), vergface);
-
- vsb= vlsortblock;
- for(a=0; a<amount; a++) {
- efa= vsb->efa;
- if( (efa->f1 & 128)==0 ) {
- vsb1= vsb+1;
-
- for(b=a+1; b<amount; b++) {
-
- /* first test: same pointer? */
- if(vsb->x != vsb1->x) break;
-
- /* second test: is test permitted? */
- efa= vsb1->efa;
- if( (efa->f1 & 128)==0 ) {
- if( compareface(efa, vsb->efa)) efa->f1 |= 128;
-
- }
- vsb1++;
- }
- }
- vsb++;
- }
-
- MEM_freeN(vlsortblock);
-
- /* remove double faces */
- efa= (struct EditFace *)em->faces.first;
- while(efa) {
- nextvl= efa->next;
- if(efa->f1 & 128) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
- }
-
- /* remove double vertices */
- a= 0;
- eve= (struct EditVert *)em->verts.first;
- while(eve) {
- nextve= eve->next;
- if(automerge || eve->f & flag) {
- if(eve->f & 128) {
- a++;
- BLI_remlink(&em->verts, eve);
- free_editvert(eve);
- }
- }
- eve= nextve;
- }
-
-#ifdef WITH_VERSE
- if((a>0) && (G.editMesh->vnode)) {
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
- }
-#endif
-
- return a; /* amount */
-}
-
-/* called from buttons */
-static void xsortvert_flag__doSetX(void *userData, EditVert *eve, int x, int y, int index)
-{
- xvertsort *sortblock = userData;
-
- sortblock[index].x = x;
-}
-void xsortvert_flag(int flag)
-{
- EditMesh *em = G.editMesh;
- /* all verts with (flag & 'flag') are sorted */
- EditVert *eve;
- xvertsort *sortblock;
- ListBase tbase;
- int i, amount = BLI_countlist(&em->verts);
-
- if(multires_test()) return;
-
- sortblock = MEM_callocN(sizeof(xvertsort)*amount,"xsort");
- for (i=0,eve=em->verts.first; eve; i++,eve=eve->next)
- if(eve->f & flag)
- sortblock[i].v1 = eve;
- mesh_foreachScreenVert(xsortvert_flag__doSetX, sortblock, 0);
- qsort(sortblock, amount, sizeof(xvertsort), vergxco);
-
- /* make temporal listbase */
- tbase.first= tbase.last= 0;
- for (i=0; i<amount; i++) {
- eve = sortblock[i].v1;
-
- if (eve) {
- BLI_remlink(&em->verts, eve);
- BLI_addtail(&tbase, eve);
- }
- }
-
- addlisttolist(&em->verts, &tbase);
-
- MEM_freeN(sortblock);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- BIF_undo_push("Xsort");
-
-}
-
-/* called from buttons */
-void hashvert_flag(int flag)
-{
- /* switch vertex order using hash table */
- EditMesh *em = G.editMesh;
- EditVert *eve;
- struct xvertsort *sortblock, *sb, onth, *newsort;
- ListBase tbase;
- int amount, a, b;
-
- if(multires_test()) return;
-
- /* count */
- eve= em->verts.first;
- amount= 0;
- while(eve) {
- if(eve->f & flag) amount++;
- eve= eve->next;
- }
- if(amount==0) return;
-
- /* allocate memory */
- sb= sortblock= (struct xvertsort *)MEM_mallocN(sizeof(struct xvertsort)*amount,"sortremovedoub");
- eve= em->verts.first;
- while(eve) {
- if(eve->f & flag) {
- sb->v1= eve;
- sb++;
- }
- eve= eve->next;
- }
-
- BLI_srand(1);
-
- sb= sortblock;
- for(a=0; a<amount; a++, sb++) {
- b= (int)(amount*BLI_drand());
- if(b>=0 && b<amount) {
- newsort= sortblock+b;
- onth= *sb;
- *sb= *newsort;
- *newsort= onth;
- }
- }
-
- /* make temporal listbase */
- tbase.first= tbase.last= 0;
- sb= sortblock;
- while(amount--) {
- eve= sb->v1;
- BLI_remlink(&em->verts, eve);
- BLI_addtail(&tbase, eve);
- sb++;
- }
-
- addlisttolist(&em->verts, &tbase);
-
- MEM_freeN(sortblock);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
- BIF_undo_push("Hash");
-
-}
-
-/* generic extern called extruder */
-void extrude_mesh(void)
-{
- float nor[3]= {0.0, 0.0, 0.0};
- short nr, transmode= 0;
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if(G.totvertsel==0) nr= 0;
- else if(G.totvertsel==1) nr= 4;
- else if(G.totedgesel==0) nr= 4;
- else if(G.totfacesel==0)
- nr= pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
- else if(G.totfacesel==1)
- nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
- else
- nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4");
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- if (G.totedgesel==0) nr = 0;
- else if (G.totedgesel==1) nr = 3;
- else if(G.totfacesel==0) nr = 3;
- else if(G.totfacesel==1)
- nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3");
- else
- nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
- }
- else {
- if (G.totfacesel == 0) nr = 0;
- else if (G.totfacesel == 1) nr = 1;
- else
- nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2");
- }
-
- if(nr<1) return;
-
- if(nr==1) transmode= extrudeflag(SELECT, nor);
- else if(nr==4) transmode= extrudeflag_verts_indiv(SELECT, nor);
- else if(nr==3) transmode= extrudeflag_edges_indiv(SELECT, nor);
- else transmode= extrudeflag_face_indiv(SELECT, nor);
-
- if(transmode==0) {
- error("No valid selection");
- }
- else {
- EM_fgon_flags();
- countall();
-
- /* We need to force immediate calculation here because
- * transform may use derived objects (which are now stale).
- *
- * This shouldn't be necessary, derived queries should be
- * automatically building this data if invalid. Or something.
- */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- object_handle_update(G.obedit);
-
- /* individual faces? */
- BIF_TransformSetUndo("Extrude");
- if(nr==2) {
- initTransform(TFM_SHRINKFATTEN, CTX_NO_PET|CTX_NO_MIRROR);
- Transform();
- }
- else {
- initTransform(TFM_TRANSLATION, CTX_NO_PET|CTX_NO_MIRROR);
- if(transmode=='n') {
- Mat4MulVecfl(G.obedit->obmat, nor);
- VecSubf(nor, nor, G.obedit->obmat[3]);
- BIF_setSingleAxisConstraint(nor, "along normal");
- }
- Transform();
- }
- }
-
-}
-
-void split_mesh(void)
-{
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- if(okee(" Split ")==0) return;
-
- waitcursor(1);
-
- /* make duplicate first */
- adduplicateflag(SELECT);
- /* old faces have flag 128 set, delete them */
- delfaceflag(128);
- recalc_editnormals();
-
- waitcursor(0);
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- BIF_undo_push("Split");
-
-}
-
-void extrude_repeat_mesh(int steps, float offs)
-{
- float dvec[3], tmat[3][3], bmat[3][3], nor[3]= {0.0, 0.0, 0.0};
- short a;
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- /* dvec */
- dvec[0]= G.vd->persinv[2][0];
- dvec[1]= G.vd->persinv[2][1];
- dvec[2]= G.vd->persinv[2][2];
- Normalize(dvec);
- dvec[0]*= offs;
- dvec[1]*= offs;
- dvec[2]*= offs;
-
- /* base correction */
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(tmat, bmat);
- Mat3MulVecfl(tmat, dvec);
-
- for(a=0; a<steps; a++) {
- extrudeflag(SELECT, nor);
- translateflag(SELECT, dvec);
- }
-
- recalc_editnormals();
-
- EM_fgon_flags();
- countall();
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- BIF_undo_push("Extrude Repeat");
-}
-
-void spin_mesh(int steps, float degr, float *dvec, int mode)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve,*nextve;
- float nor[3]= {0.0, 0.0, 0.0};
- float *curs, si,n[3],q[4],cmat[3][3],imat[3][3], tmat[3][3];
- float cent[3],bmat[3][3];
- float phi;
- short a,ok;
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- /* imat and center and size */
- Mat3CpyMat4(bmat, G.obedit->obmat);
- Mat3Inv(imat,bmat);
-
- curs= give_cursor();
- VECCOPY(cent, curs);
- cent[0]-= G.obedit->obmat[3][0];
- cent[1]-= G.obedit->obmat[3][1];
- cent[2]-= G.obedit->obmat[3][2];
- Mat3MulVecfl(imat, cent);
-
- phi= degr*M_PI/360.0;
- phi/= steps;
- if(G.scene->toolsettings->editbutflag & B_CLOCKWISE) phi= -phi;
-
- if(dvec) {
- n[0]= G.vd->viewinv[1][0];
- n[1]= G.vd->viewinv[1][1];
- n[2]= G.vd->viewinv[1][2];
- } else {
- n[0]= G.vd->viewinv[2][0];
- n[1]= G.vd->viewinv[2][1];
- n[2]= G.vd->viewinv[2][2];
- }
- Normalize(n);
-
- q[0]= (float)cos(phi);
- si= (float)sin(phi);
- q[1]= n[0]*si;
- q[2]= n[1]*si;
- q[3]= n[2]*si;
- QuatToMat3(q, cmat);
-
- Mat3MulMat3(tmat,cmat,bmat);
- Mat3MulMat3(bmat,imat,tmat);
-
- if(mode==0) if(G.scene->toolsettings->editbutflag & B_KEEPORIG) adduplicateflag(1);
- ok= 1;
-
- for(a=0;a<steps;a++) {
- if(mode==0) ok= extrudeflag(SELECT, nor);
- else adduplicateflag(SELECT);
- if(ok==0) {
- error("No valid vertices are selected");
- break;
- }
- rotateflag(SELECT, cent, bmat);
- if(dvec) {
- Mat3MulVecfl(bmat,dvec);
- translateflag(SELECT, dvec);
- }
- }
-
- if(ok==0) {
- /* no vertices or only loose ones selected, remove duplicates */
- eve= em->verts.first;
- while(eve) {
- nextve= eve->next;
- if(eve->f & SELECT) {
- BLI_remlink(&em->verts,eve);
- free_editvert(eve);
- }
- eve= nextve;
- }
- }
- recalc_editnormals();
-
- EM_fgon_flags();
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-
- if(dvec==NULL) BIF_undo_push("Spin");
-}
-
-void screw_mesh(int steps, int turns)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve,*v1=0,*v2=0;
- EditEdge *eed;
- float dvec[3], nor[3];
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- /* clear flags */
- eve= em->verts.first;
- while(eve) {
- eve->f1= 0;
- eve= eve->next;
- }
- /* edges set flags in verts */
- eed= em->edges.first;
- while(eed) {
- if(eed->v1->f & SELECT) {
- if(eed->v2->f & SELECT) {
- /* watch: f1 is a byte */
- if(eed->v1->f1<2) eed->v1->f1++;
- if(eed->v2->f1<2) eed->v2->f1++;
- }
- }
- eed= eed->next;
- }
- /* find two vertices with eve->f1==1, more or less is wrong */
- eve= em->verts.first;
- while(eve) {
- if(eve->f1==1) {
- if(v1==0) v1= eve;
- else if(v2==0) v2= eve;
- else {
- v1=0;
- break;
- }
- }
- eve= eve->next;
- }
- if(v1==0 || v2==0) {
- error("You have to select a string of connected vertices too");
- return;
- }
-
- /* calculate dvec */
- dvec[0]= ( (v1->co[0]- v2->co[0]) )/(steps);
- dvec[1]= ( (v1->co[1]- v2->co[1]) )/(steps);
- dvec[2]= ( (v1->co[2]- v2->co[2]) )/(steps);
-
- VECCOPY(nor, G.obedit->obmat[2]);
-
- if(nor[0]*dvec[0]+nor[1]*dvec[1]+nor[2]*dvec[2]>0.000) {
- dvec[0]= -dvec[0];
- dvec[1]= -dvec[1];
- dvec[2]= -dvec[2];
- }
-
- spin_mesh(turns*steps, turns*360, dvec, 0);
-
- BIF_undo_push("Spin");
-}
-
-
-static void erase_edges(ListBase *l)
-{
- EditEdge *ed, *nexted;
-
- ed = (EditEdge *) l->first;
- while(ed) {
- nexted= ed->next;
- if( (ed->v1->f & SELECT) || (ed->v2->f & SELECT) ) {
- remedge(ed);
- free_editedge(ed);
- }
- ed= nexted;
- }
-}
-
-static void erase_faces(ListBase *l)
-{
- EditFace *f, *nextf;
-
- f = (EditFace *) l->first;
-
- while(f) {
- nextf= f->next;
- if( faceselectedOR(f, SELECT) ) {
- BLI_remlink(l, f);
- free_editface(f);
- }
- f = nextf;
- }
-}
-
-static void erase_vertices(ListBase *l)
-{
- EditVert *v, *nextv;
-
- v = (EditVert *) l->first;
- while(v) {
- nextv= v->next;
- if(v->f & 1) {
- BLI_remlink(l, v);
- free_editvert(v);
- }
- v = nextv;
- }
-}
-
-void delete_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa, *nextvl;
- EditVert *eve,*nextve;
- EditEdge *eed,*nexted;
- short event;
- int count;
- char *str="Erase";
-
- TEST_EDITMESH
- if(multires_test()) return;
-
- event= pupmenu("Erase %t|Vertices%x10|Edges%x1|Faces%x2|All%x3|Edges & Faces%x4|Only Faces%x5|Edge Loop%x6");
- if(event<1) return;
-
- if(event==10 ) {
- str= "Erase Vertices";
- erase_edges(&em->edges);
- erase_faces(&em->faces);
- erase_vertices(&em->verts);
- }
- else if(event==6) {
- if(!EdgeLoopDelete())
- return;
-
- str= "Erase Edge Loop";
- }
- else if(event==4) {
- str= "Erase Edges & Faces";
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- /* delete only faces with 1 or more edges selected */
- count= 0;
- if(efa->e1->f & SELECT) count++;
- if(efa->e2->f & SELECT) count++;
- if(efa->e3->f & SELECT) count++;
- if(efa->e4 && (efa->e4->f & SELECT)) count++;
- if(count) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
- if(eed->f & SELECT) {
- remedge(eed);
- free_editedge(eed);
- }
- eed= nexted;
- }
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- event=0;
- if( efa->v1->f & SELECT) event++;
- if( efa->v2->f & SELECT) event++;
- if( efa->v3->f & SELECT) event++;
- if(efa->v4 && (efa->v4->f & SELECT)) event++;
-
- if(event>1) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
- }
- else if(event==1) {
- str= "Erase Edges";
- // faces first
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- event=0;
- if( efa->e1->f & SELECT) event++;
- if( efa->e2->f & SELECT) event++;
- if( efa->e3->f & SELECT) event++;
- if(efa->e4 && (efa->e4->f & SELECT)) event++;
-
- if(event) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
- if(eed->f & SELECT) {
- remedge(eed);
- free_editedge(eed);
- }
- eed= nexted;
- }
- /* to remove loose vertices: */
- eed= em->edges.first;
- while(eed) {
- if( eed->v1->f & SELECT) eed->v1->f-=SELECT;
- if( eed->v2->f & SELECT) eed->v2->f-=SELECT;
- eed= eed->next;
- }
- eve= em->verts.first;
- while(eve) {
- nextve= eve->next;
- if(eve->f & SELECT) {
- BLI_remlink(&em->verts,eve);
- free_editvert(eve);
- }
- eve= nextve;
- }
-
- }
- else if(event==2) {
- str="Erase Faces";
- delfaceflag(SELECT);
- }
- else if(event==3) {
- str= "Erase All";
- if(em->verts.first) free_vertlist(&em->verts);
- if(em->edges.first) free_edgelist(&em->edges);
- if(em->faces.first) free_facelist(&em->faces);
- if(em->selected.first) BLI_freelistN(&(em->selected));
- }
- else if(event==5) {
- str= "Erase Only Faces";
- efa= em->faces.first;
- while(efa) {
- nextvl= efa->next;
- if(efa->f & SELECT) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- efa= nextvl;
- }
- }
-
- EM_fgon_flags(); // redo flags and indices for fgons
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push(str);
-}
-
-
-/* Got this from scanfill.c. You will need to juggle around the
- * callbacks for the scanfill.c code a bit for this to work. */
-void fill_mesh(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve,*v1;
- EditEdge *eed,*e1,*nexted;
- EditFace *efa,*nextvl, *efan;
- short ok;
-
- if(G.obedit==0 || (G.obedit->type!=OB_MESH)) return;
- if(multires_test()) return;
-
- waitcursor(1);
-
- /* copy all selected vertices */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT) {
- v1= BLI_addfillvert(eve->co);
- eve->tmp.v= v1;
- v1->tmp.v= eve;
- v1->xs= 0; // used for counting edges
- }
- eve= eve->next;
- }
- /* copy all selected edges */
- eed= em->edges.first;
- while(eed) {
- if( (eed->v1->f & SELECT) && (eed->v2->f & SELECT) ) {
- e1= BLI_addfilledge(eed->v1->tmp.v, eed->v2->tmp.v);
- e1->v1->xs++;
- e1->v2->xs++;
- }
- eed= eed->next;
- }
- /* from all selected faces: remove vertices and edges to prevent doubles */
- /* all edges add values, faces subtract,
- then remove edges with vertices ->xs<2 */
- efa= em->faces.first;
- ok= 0;
- while(efa) {
- nextvl= efa->next;
- if( faceselectedAND(efa, 1) ) {
- efa->v1->tmp.v->xs--;
- efa->v2->tmp.v->xs--;
- efa->v3->tmp.v->xs--;
- if(efa->v4) efa->v4->tmp.v->xs--;
- ok= 1;
-
- }
- efa= nextvl;
- }
- if(ok) { /* there are faces selected */
- eed= filledgebase.first;
- while(eed) {
- nexted= eed->next;
- if(eed->v1->xs<2 || eed->v2->xs<2) {
- BLI_remlink(&filledgebase,eed);
- }
- eed= nexted;
- }
- }
-
- if(BLI_edgefill(0, (G.obedit && G.obedit->actcol)?(G.obedit->actcol-1):0)) {
- efa= fillfacebase.first;
- while(efa) {
- /* normals default pointing up */
- efan= addfacelist(efa->v3->tmp.v, efa->v2->tmp.v,
- efa->v1->tmp.v, 0, NULL, NULL);
- if(efan) EM_select_face(efan, 1);
- efa= efa->next;
- }
- }
-
- BLI_end_edgefill();
-
- waitcursor(0);
- EM_select_flush();
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- BIF_undo_push("Fill");
-}
-/*GB*/
-/*-------------------------------------------------------------------------------*/
-/*--------------------------- Edge Based Subdivide ------------------------------*/
-
-#define EDGENEW 2
-#define FACENEW 2
-#define EDGEINNER 4
-#define EDGEOLD 8
-
-/*used by faceloop cut to select only edges valid for edge slide*/
-#define DOUBLEOPFILL 16
-
-/* calculates offset for co, based on fractal, sphere or smooth settings */
-static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float perc)
-{
- float vec1[3], fac;
-
- if(beauty & B_SMOOTH) {
- /* we calculate an offset vector vec1[], to be added to *co */
- float len, fac, nor[3], nor1[3], nor2[3];
-
- VecSubf(nor, edge->v1->co, edge->v2->co);
- len= 0.5f*Normalize(nor);
-
- VECCOPY(nor1, edge->v1->no);
- VECCOPY(nor2, edge->v2->no);
-
- /* cosine angle */
- fac= nor[0]*nor1[0] + nor[1]*nor1[1] + nor[2]*nor1[2] ;
-
- vec1[0]= fac*nor1[0];
- vec1[1]= fac*nor1[1];
- vec1[2]= fac*nor1[2];
-
- /* cosine angle */
- fac= -nor[0]*nor2[0] - nor[1]*nor2[1] - nor[2]*nor2[2] ;
-
- vec1[0]+= fac*nor2[0];
- vec1[1]+= fac*nor2[1];
- vec1[2]+= fac*nor2[2];
-
- vec1[0]*= rad*len;
- vec1[1]*= rad*len;
- vec1[2]*= rad*len;
-
- co[0] += vec1[0];
- co[1] += vec1[1];
- co[2] += vec1[2];
- }
- else {
- if(rad > 0.0) { /* subdivide sphere */
- Normalize(co);
- co[0]*= rad;
- co[1]*= rad;
- co[2]*= rad;
- }
- else if(rad< 0.0) { /* fractal subdivide */
- fac= rad* VecLenf(edge->v1->co, edge->v2->co);
- vec1[0]= fac*(float)(0.5-BLI_drand());
- vec1[1]= fac*(float)(0.5-BLI_drand());
- vec1[2]= fac*(float)(0.5-BLI_drand());
- VecAddf(co, co, vec1);
- }
-
- }
-}
-
-/* assumes in the edge is the correct interpolated vertices already */
-/* percent defines the interpolation, rad and beauty are for special options */
-/* results in new vertex with correct coordinate, vertex normal and weight group info */
-static EditVert *subdivide_edge_addvert(EditEdge *edge, float rad, int beauty, float percent)
-{
- EditVert *ev;
- float co[3];
-
- co[0] = (edge->v2->co[0]-edge->v1->co[0])*percent + edge->v1->co[0];
- co[1] = (edge->v2->co[1]-edge->v1->co[1])*percent + edge->v1->co[1];
- co[2] = (edge->v2->co[2]-edge->v1->co[2])*percent + edge->v1->co[2];
-
- /* offset for smooth or sphere or fractal */
- alter_co(co, edge, rad, beauty, percent);
-
- /* clip if needed by mirror modifier */
- if (edge->v1->f2) {
- if ( edge->v1->f2 & edge->v2->f2 & 1) {
- co[0]= 0.0f;
- }
- if ( edge->v1->f2 & edge->v2->f2 & 2) {
- co[1]= 0.0f;
- }
- if ( edge->v1->f2 & edge->v2->f2 & 4) {
- co[2]= 0.0f;
- }
- }
-
- ev = addvertlist(co, NULL);
-
- /* vert data (vgroups, ..) */
- EM_data_interp_from_verts(edge->v1, edge->v2, ev, percent);
-
- /* normal */
- ev->no[0] = (edge->v2->no[0]-edge->v1->no[0])*percent + edge->v1->no[0];
- ev->no[1] = (edge->v2->no[1]-edge->v1->no[1])*percent + edge->v1->no[1];
- ev->no[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2];
- Normalize(ev->no);
-
- return ev;
-}
-
-static void flipvertarray(EditVert** arr, short size)
-{
- EditVert *hold;
- int i;
-
- for(i=0; i<size/2; i++) {
- hold = arr[i];
- arr[i] = arr[size-i-1];
- arr[size-i-1] = hold;
- }
-}
-
-static void facecopy(EditFace *source, EditFace *target)
-{
- EditMesh *em= G.editMesh;
- float *v1 = source->v1->co, *v2 = source->v2->co, *v3 = source->v3->co;
- float *v4 = source->v4? source->v4->co: NULL;
- float w[4][4];
-
- CustomData_em_copy_data(&em->fdata, &em->fdata, source->data, &target->data);
-
- target->mat_nr = source->mat_nr;
- target->flag = source->flag;
- target->h = source->h;
-
- InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v1->co, w[0]);
- InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v2->co, w[1]);
- InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v3->co, w[2]);
- if (target->v4)
- InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v4->co, w[3]);
-
- CustomData_em_interp(&em->fdata, &source->data, NULL, (float*)w, 1, target->data);
-}
-
-static void fill_quad_single(EditFace *efa, struct GHash *gh, int numcuts, int seltype)
-{
- EditEdge *cedge=NULL;
- EditVert *v[4], **verts;
- EditFace *hold;
- short start=0, end, left, right, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;}
- else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;}
- else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;}
- else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;}
-
- // Point verts to the array of new verts for cedge
- verts = BLI_ghash_lookup(gh, cedge);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);}
- end = (start+1)%4;
- left = (start+2)%4;
- right = (start+3)%4;
-
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- |---*---*---|
- | |
- | |
- | |
- -------------
- left right
-
- where start,end,left, right are indexes of EditFace->v1, etc (stored in v)
- and 0,1,2... are the indexes of the new verts stored in verts
-
- We will fill this case like this or this depending on even or odd cuts
-
- |---*---*---| |---*---|
- | / \ | | / \ |
- | / \ | | / \ |
- |/ \| |/ \|
- ------------- ---------
- */
-
- // Make center face
- if(vertsize % 2 == 0) {
- hold = addfacelist(verts[(vertsize-1)/2],verts[((vertsize-1)/2)+1],v[left],v[right], NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- hold->e4->f2 |= EDGEINNER;
- }else{
- hold = addfacelist(verts[(vertsize-1)/2],v[left],v[right],NULL, NULL,NULL);
- hold->e1->f2 |= EDGEINNER;
- hold->e3->f2 |= EDGEINNER;
- }
- facecopy(efa,hold);
-
- // Make side faces
- for(i=0;i<(vertsize-1)/2;i++) {
- hold = addfacelist(verts[i],verts[i+1],v[right],NULL,NULL,NULL);
- facecopy(efa,hold);
- if(i+1 != (vertsize-1)/2) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e2->f2 |= EDGEINNER;
- }
- }
- hold = addfacelist(verts[vertsize-2-i],verts[vertsize-1-i],v[left],NULL,NULL,NULL);
- facecopy(efa,hold);
- if(i+1 != (vertsize-1)/2) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e3->f2 |= EDGEINNER;
- }
- }
- }
-}
-
-static void fill_tri_single(EditFace *efa, struct GHash *gh, int numcuts, int seltype)
-{
- EditEdge *cedge=NULL;
- EditVert *v[3], **verts;
- EditFace *hold;
- short start=0, end, op, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
-
- if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;}
- else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;}
- else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;}
-
- // Point verts to the array of new verts for cedge
- verts = BLI_ghash_lookup(gh, cedge);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);}
- end = (start+1)%3;
- op = (start+2)%3;
-
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- |---*---*---|
- \ |
- \ |
- \ |
- \ |
- \ |
- \ |
- |op
-
- where start,end,op are indexes of EditFace->v1, etc (stored in v)
- and 0,1,2... are the indexes of the new verts stored in verts
-
- We will fill this case like this or this depending on even or odd cuts
-
- 3 2 1 0
- |---*---*---|
- \ \ \ |
- \ \ \ |
- \ \ \ |
- \ \ \|
- \ \\|
- \ |
- |op
- */
-
- // Make side faces
- for(i=0;i<(vertsize-1);i++) {
- hold = addfacelist(verts[i],verts[i+1],v[op],NULL,NULL,NULL);
- if(i+1 != vertsize-1) {
- if(seltype == SUBDIV_SELECT_INNER) {
- hold->e2->f2 |= EDGEINNER;
- }
- }
- facecopy(efa,hold);
- }
-}
-
-static void fill_quad_double_op(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[2]={NULL, NULL};
- EditVert *v[4], **verts[2];
- EditFace *hold;
- short start=0, end, left, right, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT) { cedge[0] = efa->e1; cedge[1] = efa->e3; start = 0;}
- else if(efa->e2->f & SELECT) { cedge[0] = efa->e2; cedge[1] = efa->e4; start = 1;}
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- end = (start+1)%4;
- left = (start+2)%4;
- right = (start+3)%4;
- if(verts[1][0] != v[left]) {flipvertarray(verts[1],numcuts+2);}
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- |---*---*---|
- | |
- | |
- | |
- |---*---*---|
- 0 1 2 3
- left right
-
- We will fill this case like this or this depending on even or odd cuts
-
- |---*---*---|
- | | | |
- | | | |
- | | | |
- |---*---*---|
- */
-
- // Make side faces
- for(i=0;i<vertsize-1;i++) {
- hold = addfacelist(verts[0][i],verts[0][i+1],verts[1][vertsize-2-i],verts[1][vertsize-1-i],NULL,NULL);
- if(i < vertsize-2) {
- hold->e2->f2 |= EDGEINNER;
- hold->e2->f2 |= DOUBLEOPFILL;
- }
- facecopy(efa,hold);
- }
-}
-
-static void fill_quad_double_adj_path(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[2]={NULL, NULL};
- EditVert *v[4], **verts[2];
- EditFace *hold;
- short start=0, start2=0, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1;}
- if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2;}
- if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3;}
- if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0;}
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);}
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- start2 0|---*---*---|
- | |
- 1* |
- | |
- 2* |
- | |
- end2 3|-----------|
-
- We will fill this case like this or this depending on even or odd cuts
- |---*---*---|
- | / / / |
- * / / |
- | / / |
- * / |
- | / |
- |-----------|
- */
-
- // Make outside tris
- hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL);
- /* when ctrl is depressed, only want verts on the cutline selected */
- if (G.qual != LR_CTRLKEY)
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- hold = addfacelist(verts[0][0],verts[1][vertsize-1],v[(start2+2)%4],NULL,NULL,NULL);
- /* when ctrl is depressed, only want verts on the cutline selected */
- if (G.qual != LR_CTRLKEY)
- hold->e1->f2 |= EDGEINNER;
- facecopy(efa,hold);
- //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) {
- // hold->e1->h |= EM_FGON;
- //}
- // Make side faces
-
- for(i=0;i<numcuts;i++) {
- hold = addfacelist(verts[0][i],verts[0][i+1],verts[1][vertsize-1-(i+1)],verts[1][vertsize-1-i],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- }
- //EM_fgon_flags();
-
-}
-
-static void fill_quad_double_adj_fan(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[2]={NULL, NULL};
- EditVert *v[4], *op=NULL, **verts[2];
- EditFace *hold;
- short start=0, start2=0, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;}
- if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;}
- if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;}
- if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;}
-
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);}
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- start2 0|---*---*---|
- | |
- 1* |
- | |
- 2* |
- | |
- end2 3|-----------|op
-
- We will fill this case like this or this (warning horrible ascii art follows)
- |---*---*---|
- | \ \ \ |
- *---\ \ \ |
- | \ \ \ \|
- *---- \ \ \ |
- | --- \\\|
- |-----------|
- */
-
- for(i=0;i<=numcuts;i++) {
- hold = addfacelist(op,verts[1][numcuts-i],verts[1][numcuts-i+1],NULL,NULL,NULL);
- hold->e1->f2 |= EDGEINNER;
- facecopy(efa,hold);
-
- hold = addfacelist(op,verts[0][i],verts[0][i+1],NULL,NULL,NULL);
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- }
-}
-
-static void fill_quad_double_adj_inner(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[2]={NULL, NULL};
- EditVert *v[4], *op=NULL, **verts[2],**inner;
- EditFace *hold;
- short start=0, start2=0, vertsize,i;
- float co[3];
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;}
- if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;}
- if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;}
- if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;}
-
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);}
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- start2 0|---*---*---|
- | |
- 1* |
- | |
- 2* |
- | |
- end2 3|-----------|op
-
- We will fill this case like this or this (warning horrible ascii art follows)
- |---*-----*---|
- | * / |
- * \ / |
- | * |
- | / \ |
- * \ |
- | \ |
- |-------------|
- */
-
- // Add Inner Vert(s)
- inner = MEM_mallocN(sizeof(EditVert*)*numcuts,"New inner verts");
-
- for(i=0;i<numcuts;i++) {
- co[0] = (verts[0][numcuts-i]->co[0] + verts[1][i+1]->co[0] ) / 2 ;
- co[1] = (verts[0][numcuts-i]->co[1] + verts[1][i+1]->co[1] ) / 2 ;
- co[2] = (verts[0][numcuts-i]->co[2] + verts[1][i+1]->co[2] ) / 2 ;
- inner[i] = addvertlist(co, NULL);
- inner[i]->f2 |= EDGEINNER;
-
- EM_data_interp_from_verts(verts[0][numcuts-i], verts[1][i+1], inner[i], 0.5f);
- }
-
- // Add Corner Quad
- hold = addfacelist(verts[0][numcuts+1],verts[1][1],inner[0],verts[0][numcuts],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- // Add Bottom Quads
- hold = addfacelist(verts[0][0],verts[0][1],inner[numcuts-1],op,NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
-
- hold = addfacelist(op,inner[numcuts-1],verts[1][numcuts],verts[1][numcuts+1],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
-
- //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) {
- // hold->e1->h |= EM_FGON;
- //}
- // Add Fill Quads (if # cuts > 1)
-
- for(i=0;i<numcuts-1;i++) {
- hold = addfacelist(inner[i],verts[1][i+1],verts[1][i+2],inner[i+1],NULL,NULL);
- hold->e1->f2 |= EDGEINNER;
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
-
- hold = addfacelist(inner[i],inner[i+1],verts[0][numcuts-1-i],verts[0][numcuts-i],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- hold->e4->f2 |= EDGEINNER;
- facecopy(efa,hold);
-
- //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) {
- // hold->e1->h |= EM_FGON;
- //}
- }
-
- //EM_fgon_flags();
-
- MEM_freeN(inner);
-}
-
-static void fill_tri_double(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[2]={NULL, NULL};
- EditVert *v[3], **verts[2];
- EditFace *hold;
- short start=0, start2=0, vertsize,i;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
-
- if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1;}
- if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2;}
- if(efa->e3->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e1; start = 2; start2 = 0;}
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);}
- /*
- We should have something like this now
-
- end start
- 3 2 1 0
- start2 0|---*---*---|
- | /
- 1* /
- | /
- 2* /
- | /
- end2 3|
-
- We will fill this case like this or this depending on even or odd cuts
- |---*---*---|
- | / / /
- * / /
- | / /
- * /
- | /
- |
- */
-
- // Make outside tri
- hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL);
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- // Make side faces
-
- for(i=0;i<numcuts;i++) {
- hold = addfacelist(verts[0][i],verts[0][i+1],verts[1][vertsize-1-(i+1)],verts[1][vertsize-1-i],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- }
-}
-
-static void fill_quad_triple(EditFace *efa, struct GHash *gh, int numcuts)
-{
- EditEdge *cedge[3]={0};
- EditVert *v[4], **verts[3];
- EditFace *hold;
- short start=0, start2=0, start3=0, vertsize, i, repeats;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(!(efa->e1->f & SELECT)) {
- cedge[0] = efa->e2;
- cedge[1] = efa->e3;
- cedge[2] = efa->e4;
- start = 1;start2 = 2;start3 = 3;
- }
- if(!(efa->e2->f & SELECT)) {
- cedge[0] = efa->e3;
- cedge[1] = efa->e4;
- cedge[2] = efa->e1;
- start = 2;start2 = 3;start3 = 0;
- }
- if(!(efa->e3->f & SELECT)) {
- cedge[0] = efa->e4;
- cedge[1] = efa->e1;
- cedge[2] = efa->e2;
- start = 3;start2 = 0;start3 = 1;
- }
- if(!(efa->e4->f & SELECT)) {
- cedge[0] = efa->e1;
- cedge[1] = efa->e2;
- cedge[2] = efa->e3;
- start = 0;start2 = 1;start3 = 2;
- }
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, cedge[0]);
- verts[1] = BLI_ghash_lookup(gh, cedge[1]);
- verts[2] = BLI_ghash_lookup(gh, cedge[2]);
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);}
- if(verts[2][0] != v[start3]) {flipvertarray(verts[2],numcuts+2);}
- /*
- We should have something like this now
-
- start2
- 3 2 1 0
- start3 0|---*---*---|3
- | |
- 1* *2
- | |
- 2* *1
- | |
- 3|-----------|0 start
-
- We will fill this case like this or this depending on even or odd cuts
- there are a couple of differences. For odd cuts, there is a tri in the
- middle as well as 1 quad at the bottom (not including the extra quads
- for odd cuts > 1
-
- For even cuts, there is a quad in the middle and 2 quads on the bottom
-
- they are numbered here for clarity
-
- 1 outer tris and bottom quads
- 2 inner tri or quad
- 3 repeating quads
-
- |---*---*---*---|
- |1/ / \ \ 1|
- |/ 3 / \ 3 \|
- * / 2 \ *
- | / \ |
- |/ \ |
- *---------------*
- | 3 |
- | |
- *---------------*
- | |
- | 1 |
- | |
- |---------------|
-
- |---*---*---*---*---|
- | 1/ / \ \ 1|
- | / / \ \ |
- |/ 3 / \ 3 \|
- * / \ *
- | / \ |
- | / 2 \ |
- |/ \|
- *-------------------*
- | |
- | 3 |
- | |
- *-------------------*
- | |
- | 1 |
- | |
- *-------------------*
- | |
- | 1 |
- | |
- |-------------------|
-
- */
-
- // Make outside tris
- hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL);
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- hold = addfacelist(verts[1][vertsize-2],verts[1][vertsize-1],verts[2][1],NULL,NULL,NULL);
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa,hold);
- // Make bottom quad
- hold = addfacelist(verts[0][0],verts[0][1],verts[2][vertsize-2],verts[2][vertsize-1],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- //If it is even cuts, add the 2nd lower quad
- if(numcuts % 2 == 0) {
- hold = addfacelist(verts[0][1],verts[0][2],verts[2][vertsize-3],verts[2][vertsize-2],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- // Also Make inner quad
- hold = addfacelist(verts[1][numcuts/2],verts[1][(numcuts/2)+1],verts[2][numcuts/2],verts[0][(numcuts/2)+1],NULL,NULL);
- hold->e3->f2 |= EDGEINNER;
- //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) {
- // hold->e3->h |= EM_FGON;
- //}
- facecopy(efa,hold);
- repeats = (numcuts / 2) -1;
- } else {
- // Make inner tri
- hold = addfacelist(verts[1][(numcuts/2)+1],verts[2][(numcuts/2)+1],verts[0][(numcuts/2)+1],NULL,NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) {
- // hold->e2->h |= EM_FGON;
- //}
- facecopy(efa,hold);
- repeats = ((numcuts+1) / 2)-1;
- }
-
- // cuts for 1 and 2 do not have the repeating quads
- if(numcuts < 3) {repeats = 0;}
- for(i=0;i<repeats;i++) {
- //Make side repeating Quads
- hold = addfacelist(verts[1][i+1],verts[1][i+2],verts[0][vertsize-i-3],verts[0][vertsize-i-2],NULL,NULL);
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- hold = addfacelist(verts[1][vertsize-i-3],verts[1][vertsize-i-2],verts[2][i+1],verts[2][i+2],NULL,NULL);
- hold->e4->f2 |= EDGEINNER;
- facecopy(efa,hold);
- }
- // Do repeating bottom quads
- for(i=0;i<repeats;i++) {
- if(numcuts % 2 == 1) {
- hold = addfacelist(verts[0][1+i],verts[0][2+i],verts[2][vertsize-3-i],verts[2][vertsize-2-i],NULL,NULL);
- } else {
- hold = addfacelist(verts[0][2+i],verts[0][3+i],verts[2][vertsize-4-i],verts[2][vertsize-3-i],NULL,NULL);
- }
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa,hold);
- }
- //EM_fgon_flags();
-}
-
-static void fill_quad_quadruple(EditFace *efa, struct GHash *gh, int numcuts, float rad, int beauty)
-{
- EditVert **verts[4], ***innerverts;
- EditFace *hold;
- EditEdge temp;
- short vertsize, i, j;
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, efa->e1);
- verts[1] = BLI_ghash_lookup(gh, efa->e2);
- verts[2] = BLI_ghash_lookup(gh, efa->e3);
- verts[3] = BLI_ghash_lookup(gh, efa->e4);
-
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != efa->v1) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);}
- if(verts[2][0] == efa->v3) {flipvertarray(verts[2],numcuts+2);}
- if(verts[3][0] == efa->v4) {flipvertarray(verts[3],numcuts+2);}
- /*
- We should have something like this now
- 1
-
- 3 2 1 0
- 0|---*---*---|0
- | |
- 1* *1
- 2 | | 4
- 2* *2
- | |
- 3|---*---*---|3
- 3 2 1 0
-
- 3
- // we will fill a 2 dim array of editvert*s to make filling easier
- // the innervert order is shown
-
- 0 0---1---2---3
- | | | |
- 1 0---1---2---3
- | | | |
- 2 0---1---2---3
- | | | |
- 3 0---1---2---3
-
- */
- innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"quad-quad subdiv inner verts outer array");
- for(i=0;i<numcuts+2;i++) {
- innerverts[i] = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"quad-quad subdiv inner verts inner array");
- }
-
- // first row is e1 last row is e3
- for(i=0;i<numcuts+2;i++) {
- innerverts[0][i] = verts[0][(numcuts+1)-i];
- innerverts[numcuts+1][i] = verts[2][(numcuts+1)-i];
- }
-
- for(i=1;i<=numcuts;i++) {
- /* we create a fake edge for the next loop */
- temp.v2 = innerverts[i][0] = verts[1][i];
- temp.v1 = innerverts[i][numcuts+1] = verts[3][i];
-
- for(j=1;j<=numcuts;j++) {
- float percent= (float)j/(float)(numcuts+1);
-
- innerverts[i][(numcuts+1)-j]= subdivide_edge_addvert(&temp, rad, beauty, percent);
- }
- }
- // Fill with faces
- for(i=0;i<numcuts+1;i++) {
- for(j=0;j<numcuts+1;j++) {
- hold = addfacelist(innerverts[i][j+1],innerverts[i][j],innerverts[i+1][j],innerverts[i+1][j+1],NULL,NULL);
- hold->e1->f2 = EDGENEW;
- hold->e2->f2 = EDGENEW;
- hold->e3->f2 = EDGENEW;
- hold->e4->f2 = EDGENEW;
-
- if(i != 0) { hold->e1->f2 |= EDGEINNER; }
- if(j != 0) { hold->e2->f2 |= EDGEINNER; }
- if(i != numcuts) { hold->e3->f2 |= EDGEINNER; }
- if(j != numcuts) { hold->e4->f2 |= EDGEINNER; }
-
- facecopy(efa,hold);
- }
- }
- // Clean up our dynamic multi-dim array
- for(i=0;i<numcuts+2;i++) {
- MEM_freeN(innerverts[i]);
- }
- MEM_freeN(innerverts);
-}
-
-static void fill_tri_triple(EditFace *efa, struct GHash *gh, int numcuts, float rad, int beauty)
-{
- EditVert **verts[3], ***innerverts;
- short vertsize, i, j;
- EditFace *hold;
- EditEdge temp;
-
- // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
- verts[0] = BLI_ghash_lookup(gh, efa->e1);
- verts[1] = BLI_ghash_lookup(gh, efa->e2);
- verts[2] = BLI_ghash_lookup(gh, efa->e3);
-
- //This is the index size of the verts array
- vertsize = numcuts+2;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0][0] != efa->v1) {flipvertarray(verts[0],numcuts+2);}
- if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);}
- if(verts[2][0] != efa->v3) {flipvertarray(verts[2],numcuts+2);}
- /*
- We should have something like this now
- 3
-
- 3 2 1 0
- 0|---*---*---|3
- | /
- 1 1* *2
- | /
- 2* *1 2
- | /
- 3|/
- 0
-
- we will fill a 2 dim array of editvert*s to make filling easier
-
- 3
-
- 0 0---1---2---3---4
- | / | / |/ | /
- 1 0---1----2---3
- 1 | / | / | /
- 2 0----1---2 2
- | / | /
- |/ |/
- 3 0---1
- | /
- |/
- 4 0
-
- */
-
- innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"tri-tri subdiv inner verts outer array");
- for(i=0;i<numcuts+2;i++) {
- innerverts[i] = MEM_mallocN(sizeof(EditVert*)*((numcuts+2)-i),"tri-tri subdiv inner verts inner array");
- }
- //top row is e3 backwards
- for(i=0;i<numcuts+2;i++) {
- innerverts[0][i] = verts[2][(numcuts+1)-i];
- }
-
- for(i=1;i<=numcuts+1;i++) {
- //fake edge, first vert is from e1, last is from e2
- temp.v1= innerverts[i][0] = verts[0][i];
- temp.v2= innerverts[i][(numcuts+1)-i] = verts[1][(numcuts+1)-i];
-
- for(j=1;j<(numcuts+1)-i;j++) {
- float percent= (float)j/(float)((numcuts+1)-i);
-
- innerverts[i][((numcuts+1)-i)-j]= subdivide_edge_addvert(&temp, rad, beauty, 1-percent);
- }
- }
-
- // Now fill the verts with happy little tris :)
- for(i=0;i<=numcuts+1;i++) {
- for(j=0;j<(numcuts+1)-i;j++) {
- //We always do the first tri
- hold = addfacelist(innerverts[i][j+1],innerverts[i][j],innerverts[i+1][j],NULL,NULL,NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- if(i != 0) { hold->e1->f2 |= EDGEINNER; }
- if(j != 0) { hold->e2->f2 |= EDGEINNER; }
- if(j+1 != (numcuts+1)-i) {hold->e3->f2 |= EDGEINNER;}
-
- facecopy(efa,hold);
- //if there are more to come, we do the 2nd
- if(j+1 <= numcuts-i) {
- hold = addfacelist(innerverts[i+1][j],innerverts[i+1][j+1],innerverts[i][j+1],NULL,NULL,NULL);
- facecopy(efa,hold);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- }
- }
- }
-
- // Clean up our dynamic multi-dim array
- for(i=0;i<numcuts+2;i++) {
- MEM_freeN(innerverts[i]);
- }
- MEM_freeN(innerverts);
-}
-
-//Next two fill types are for knife exact only and are provided to allow for knifing through vertices
-//This means there is no multicut!
-static void fill_quad_doublevert(EditFace *efa, int v1, int v2){
- EditFace *hold;
- /*
- Depending on which two vertices have been knifed through (v1 and v2), we
- triangulate like the patterns below.
- X-------| |-------X
- | \ | | / |
- | \ | | / |
- | \ | | / |
- --------X X--------
- */
-
- if(v1 == 1 && v2 == 3){
- hold= addfacelist(efa->v1, efa->v2, efa->v3, 0, efa, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa, hold);
-
- hold= addfacelist(efa->v1, efa->v3, efa->v4, 0, efa, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e1->f2 |= EDGEINNER;
- facecopy(efa, hold);
- }
- else{
- hold= addfacelist(efa->v1, efa->v2, efa->v4, 0, efa, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e2->f2 |= EDGEINNER;
- facecopy(efa, hold);
-
- hold= addfacelist(efa->v2, efa->v3, efa->v4, 0, efa, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa, hold);
- }
-}
-
-static void fill_quad_singlevert(EditFace *efa, struct GHash *gh)
-{
- EditEdge *cedge=NULL;
- EditVert *v[4], **verts;
- EditFace *hold;
- short start=0, end, left, right, vertsize;
-
- v[0] = efa->v1;
- v[1] = efa->v2;
- v[2] = efa->v3;
- v[3] = efa->v4;
-
- if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;}
- else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;}
- else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;}
- else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;}
-
- // Point verts to the array of new verts for cedge
- verts = BLI_ghash_lookup(gh, cedge);
- //This is the index size of the verts array
- vertsize = 3;
-
- // Is the original v1 the same as the first vert on the selected edge?
- // if not, the edge is running the opposite direction in this face so flip
- // the array to the correct direction
-
- if(verts[0] != v[start]) {flipvertarray(verts,3);}
- end = (start+1)%4;
- left = (start+2)%4;
- right = (start+3)%4;
-
-/*
- We should have something like this now
-
- end start
- 2 1 0
- |-----*-----|
- | |
- | |
- | |
- -------------
- left right
-
- where start,end,left, right are indexes of EditFace->v1, etc (stored in v)
- and 0,1,2 are the indexes of the new verts stored in verts. We fill like
- this, depending on whether its vertex 'left' or vertex 'right' thats
- been knifed through...
-
- |---*---| |---*---|
- | / | | \ |
- | / | | \ |
- |/ | | \|
- X-------- --------X
-*/
-
- if(v[left]->f1){
- //triangle is composed of cutvert, end and left
- hold = addfacelist(verts[1],v[end],v[left],NULL, NULL,NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e3->f2 |= EDGEINNER;
- facecopy(efa, hold);
-
- //quad is composed of cutvert, left, right and start
- hold = addfacelist(verts[1],v[left],v[right],v[start], NULL, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e4->f2 |= EDGENEW;
- hold->e1->f2 |= EDGEINNER;
- facecopy(efa, hold);
- }
- else if(v[right]->f1){
- //triangle is composed of cutvert, right and start
- hold = addfacelist(verts[1],v[right],v[start], NULL, NULL, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e1->f2 |= EDGEINNER;
- facecopy(efa, hold);
- //quad is composed of cutvert, end, left, right
- hold = addfacelist(verts[1],v[end], v[left], v[right], NULL, NULL);
- hold->e1->f2 |= EDGENEW;
- hold->e2->f2 |= EDGENEW;
- hold->e3->f2 |= EDGENEW;
- hold->e4->f2 |= EDGENEW;
- hold->e4->f2 |= EDGEINNER;
- facecopy(efa, hold);
- }
-
-}
-
-// This function takes an example edge, the current point to create and
-// the total # of points to create, then creates the point and return the
-// editvert pointer to it.
-static EditVert *subdivideedgenum(EditEdge *edge, int curpoint, int totpoint, float rad, int beauty)
-{
- EditVert *ev;
- float percent;
-
- if (beauty & (B_PERCENTSUBD) && totpoint == 1)
- //percent=(float)(edge->tmp.l)/32768.0f;
- percent= edge->tmp.fp;
- else
- percent= (float)curpoint/(float)(totpoint+1);
-
- ev= subdivide_edge_addvert(edge, rad, beauty, percent);
- ev->f = edge->v1->f;
-
- return ev;
-}
-
-void esubdivideflag(int flag, float rad, int beauty, int numcuts, int seltype)
-{
- EditMesh *em = G.editMesh;
- EditFace *ef;
- EditEdge *eed, *cedge, *sort[4];
- EditVert *eve, **templist;
- struct GHash *gh;
- float length[4], v1mat[3], v2mat[3], v3mat[3], v4mat[3];
- int i, j, edgecount, touchcount, facetype,hold;
- ModifierData *md= G.obedit->modifiers.first;
-
- if(multires_test()) return;
-
- //Set faces f1 to 0 cause we need it later
- for(ef=em->faces.first;ef;ef = ef->next) ef->f1 = 0;
- for(eve=em->verts.first; eve; eve=eve->next) {
- if(!(beauty & B_KNIFE)) /* knife sets this flag for vertex cuts */
- eve->f1 = 0;
- eve->f2 = 0;
- }
-
- for (; md; md=md->next) {
- if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- for (eve= em->verts.first; eve; eve= eve->next) {
- eve->f2= 0;
- switch(mmd->axis){
- case 0:
- if (fabs(eve->co[0]) < mmd->tolerance)
- eve->f2 |= 1;
- break;
- case 1:
- if (fabs(eve->co[1]) < mmd->tolerance)
- eve->f2 |= 2;
- break;
- case 2:
- if (fabs(eve->co[2]) < mmd->tolerance)
- eve->f2 |= 4;
- break;
- }
- }
- }
- }
- }
-
- //Flush vertex flags upward to the edges
- for(eed = em->edges.first;eed;eed = eed->next) {
- //if(eed->f & flag && eed->v1->f == eed->v2->f) {
- // eed->f |= eed->v1->f;
- // }
- eed->f2 = 0;
- if(eed->f & flag) {
- eed->f2 |= EDGEOLD;
- }
- }
-
- // We store an array of verts for each edge that is subdivided,
- // we put this array as a value in a ghash which is keyed by the EditEdge*
-
- // Now for beauty subdivide deselect edges based on length
- if(beauty & B_BEAUTY) {
- for(ef = em->faces.first;ef;ef = ef->next) {
- if(!ef->v4) {
- continue;
- }
- if(ef->f & SELECT) {
- VECCOPY(v1mat, ef->v1->co);
- VECCOPY(v2mat, ef->v2->co);
- VECCOPY(v3mat, ef->v3->co);
- VECCOPY(v4mat, ef->v4->co);
- Mat4Mul3Vecfl(G.obedit->obmat, v1mat);
- Mat4Mul3Vecfl(G.obedit->obmat, v2mat);
- Mat4Mul3Vecfl(G.obedit->obmat, v3mat);
- Mat4Mul3Vecfl(G.obedit->obmat, v4mat);
-
- length[0] = VecLenf(v1mat, v2mat);
- length[1] = VecLenf(v2mat, v3mat);
- length[2] = VecLenf(v3mat, v4mat);
- length[3] = VecLenf(v4mat, v1mat);
- sort[0] = ef->e1;
- sort[1] = ef->e2;
- sort[2] = ef->e3;
- sort[3] = ef->e4;
-
-
- // Beauty Short Edges
- if(beauty & B_BEAUTY_SHORT) {
- for(j=0;j<2;j++) {
- hold = -1;
- for(i=0;i<4;i++) {
- if(length[i] < 0) {
- continue;
- } else if(hold == -1) {
- hold = i;
- } else {
- if(length[hold] < length[i]) {
- hold = i;
- }
- }
- }
- sort[hold]->f &= ~SELECT;
- sort[hold]->f2 |= EDGENEW;
- length[hold] = -1;
- }
- }
-
- // Beauty Long Edges
- else {
- for(j=0;j<2;j++) {
- hold = -1;
- for(i=0;i<4;i++) {
- if(length[i] < 0) {
- continue;
- } else if(hold == -1) {
- hold = i;
- } else {
- if(length[hold] > length[i]) {
- hold = i;
- }
- }
- }
- sort[hold]->f &= ~SELECT;
- sort[hold]->f2 |= EDGENEW;
- length[hold] = -1;
- }
- }
- }
- }
- }
-
- gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
-
- // If we are knifing, We only need the selected edges that were cut, so deselect if it was not cut
- if(beauty & B_KNIFE) {
- for(eed= em->edges.first;eed;eed=eed->next) {
- if( eed->tmp.fp == 0 ) {
- EM_select_edge(eed,0);
- }
- }
- }
- // So for each edge, if it is selected, we allocate an array of size cuts+2
- // so we can have a place for the v1, the new verts and v2
- for(eed=em->edges.first;eed;eed = eed->next) {
- if(eed->f & flag) {
- templist = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"vertlist");
- templist[0] = eed->v1;
- for(i=0;i<numcuts;i++) {
- // This function creates the new vert and returns it back
- // to the array
- templist[i+1] = subdivideedgenum(eed, i+1, numcuts, rad, beauty);
- //while we are here, we can copy edge info from the original edge
- cedge = addedgelist(templist[i],templist[i+1],eed);
- // Also set the edge f2 to EDGENEW so that we can use this info later
- cedge->f2 = EDGENEW;
- }
- templist[i+1] = eed->v2;
- //Do the last edge too
- cedge = addedgelist(templist[i],templist[i+1],eed);
- cedge->f2 = EDGENEW;
- // Now that the edge is subdivided, we can put its verts in the ghash
- BLI_ghash_insert(gh, eed, templist);
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- // Now for each face in the mesh we need to figure out How many edges were cut
- // and which filling method to use for that face
- for(ef = em->faces.first;ef;ef = ef->next) {
- edgecount = 0;
- facetype = 3;
- if(ef->e1->f & flag) {edgecount++;}
- if(ef->e2->f & flag) {edgecount++;}
- if(ef->e3->f & flag) {edgecount++;}
- if(ef->v4) {
- facetype = 4;
- if(ef->e4->f & flag) {edgecount++;}
- }
- if(facetype == 4) {
- switch(edgecount) {
- case 0:
- if(beauty & B_KNIFE && numcuts == 1){
- /*Test for when knifing through two opposite verts but no edges*/
- touchcount = 0;
- if(ef->v1->f1) touchcount++;
- if(ef->v2->f1) touchcount++;
- if(ef->v3->f1) touchcount++;
- if(ef->v4->f1) touchcount++;
- if(touchcount == 2){
- if(ef->v1->f1 && ef->v3->f1){
- ef->f1 = SELECT;
- fill_quad_doublevert(ef, 1, 3);
- }
- else if(ef->v2->f1 && ef->v4->f1){
- ef->f1 = SELECT;
- fill_quad_doublevert(ef, 2, 4);
- }
- }
- }
- break;
-
- case 1:
- if(beauty & B_KNIFE && numcuts == 1){
- /*Test for when knifing through an edge and one vert*/
- touchcount = 0;
- if(ef->v1->f1) touchcount++;
- if(ef->v2->f1) touchcount++;
- if(ef->v3->f1) touchcount++;
- if(ef->v4->f1) touchcount++;
-
- if(touchcount == 1){
- if( (ef->e1->f & flag && ( !ef->e1->v1->f1 && !ef->e1->v2->f1 )) ||
- (ef->e2->f & flag && ( !ef->e2->v1->f1 && !ef->e2->v2->f1 )) ||
- (ef->e3->f & flag && ( !ef->e3->v1->f1 && !ef->e3->v2->f1 )) ||
- (ef->e4->f & flag && ( !ef->e4->v1->f1 && !ef->e4->v2->f1 )) ){
-
- ef->f1 = SELECT;
- fill_quad_singlevert(ef, gh);
- }
- else{
- ef->f1 = SELECT;
- fill_quad_single(ef, gh, numcuts, seltype);
- }
- }
- else{
- ef->f1 = SELECT;
- fill_quad_single(ef, gh, numcuts, seltype);
- }
- }
- else{
- ef->f1 = SELECT;
- fill_quad_single(ef, gh, numcuts, seltype);
- }
- break;
- case 2: ef->f1 = SELECT;
- // if there are 2, we check if edge 1 and 3 are either both on or off that way
- // we can tell if the selected pair is Adjacent or Opposite of each other
- if((ef->e1->f & flag && ef->e3->f & flag) ||
- (ef->e2->f & flag && ef->e4->f & flag)) {
- fill_quad_double_op(ef, gh, numcuts);
- }else{
- switch(G.scene->toolsettings->cornertype) {
- case 0: fill_quad_double_adj_path(ef, gh, numcuts); break;
- case 1: fill_quad_double_adj_inner(ef, gh, numcuts); break;
- case 2: fill_quad_double_adj_fan(ef, gh, numcuts); break;
- }
-
- }
- break;
- case 3: ef->f1 = SELECT;
- fill_quad_triple(ef, gh, numcuts);
- break;
- case 4: ef->f1 = SELECT;
- fill_quad_quadruple(ef, gh, numcuts, rad, beauty);
- break;
- }
- } else {
- switch(edgecount) {
- case 0: break;
- case 1: ef->f1 = SELECT;
- fill_tri_single(ef, gh, numcuts, seltype);
- break;
- case 2: ef->f1 = SELECT;
- fill_tri_double(ef, gh, numcuts);
- break;
- case 3: ef->f1 = SELECT;
- fill_tri_triple(ef, gh, numcuts, rad, beauty);
- break;
- }
- }
- }
-
- // Delete Old Edges and Faces
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(BLI_ghash_haskey(gh,eed)) {
- eed->f1 = SELECT;
- } else {
- eed->f1 = 0;
- }
- }
- free_tagged_edges_faces(em->edges.first, em->faces.first);
-
- if(seltype == SUBDIV_SELECT_ORIG && G.qual != LR_CTRLKEY) {
- /* bugfix: vertex could get flagged as "not-selected"
- // solution: clear flags before, not at the same time as setting SELECT flag -dg
- */
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(!(eed->f2 & EDGENEW || eed->f2 & EDGEOLD)) {
- eed->f &= !flag;
- EM_select_edge(eed,0);
- }
- }
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(eed->f2 & EDGENEW || eed->f2 & EDGEOLD) {
- eed->f |= flag;
- EM_select_edge(eed,1);
- }
- }
- } else if ((seltype == SUBDIV_SELECT_INNER || seltype == SUBDIV_SELECT_INNER_SEL)|| G.qual == LR_CTRLKEY) {
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(eed->f2 & EDGEINNER) {
- eed->f |= flag;
- EM_select_edge(eed,1);
- if(eed->v1->f & EDGEINNER) eed->v1->f |= SELECT;
- if(eed->v2->f & EDGEINNER) eed->v2->f |= SELECT;
- }else{
- eed->f &= !flag;
- EM_select_edge(eed,0);
- }
- }
- } else if(seltype == SUBDIV_SELECT_LOOPCUT){
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(eed->f2 & DOUBLEOPFILL){
- eed->f |= flag;
- EM_select_edge(eed,1);
- }else{
- eed->f &= !flag;
- EM_select_edge(eed,0);
- }
- }
- }
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eed = em->edges.first;eed;eed = eed->next) {
- if(eed->f & SELECT) {
- eed->v1->f |= SELECT;
- eed->v2->f |= SELECT;
- }
- }
- }
-
- //fix hide flags for edges. First pass, hide edges of hidden faces
- for(ef=em->faces.first; ef; ef=ef->next){
- if(ef->h){
- ef->e1->h |= 1;
- ef->e2->h |= 1;
- ef->e3->h |= 1;
- if(ef->e4) ef->e4->h |= 1;
- }
- }
- //second pass: unhide edges of visible faces adjacent to hidden faces
- for(ef=em->faces.first; ef; ef=ef->next){
- if(ef->h == 0){
- ef->e1->h &= ~1;
- ef->e2->h &= ~1;
- ef->e3->h &= ~1;
- if(ef->e4) ef->e4->h &= ~1;
- }
- }
-
- // Free the ghash and call MEM_freeN on all the value entries to return
- // that memory
- BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN);
-
- EM_selectmode_flush();
- for(ef=em->faces.first;ef;ef = ef->next) {
- if(ef->e4) {
- if( (ef->e1->f & SELECT && ef->e2->f & SELECT) &&
- (ef->e3->f & SELECT && ef->e4->f & SELECT) ) {
- ef->f |= SELECT;
- }
- } else {
- if( (ef->e1->f & SELECT && ef->e2->f & SELECT) && ef->e3->f & SELECT) {
- ef->f |= SELECT;
- }
- }
- }
-
- recalc_editnormals();
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-}
-
-static int count_selected_edges(EditEdge *ed)
-{
- int totedge = 0;
- while(ed) {
- ed->tmp.p = 0;
- if( ed->f & SELECT ) totedge++;
- ed= ed->next;
- }
- return totedge;
-}
-
-/* hurms, as if this makes code readable! It's pointerpointer hiding... (ton) */
-typedef EditFace *EVPtr;
-typedef EVPtr EVPTuple[2];
-
-/** builds EVPTuple array efaa of face tuples (in fact pointers to EditFaces)
- sharing one edge.
- arguments: selected edge list, face list.
- Edges will also be tagged accordingly (see eed->f2) */
-
-static int collect_quadedges(EVPTuple *efaa, EditEdge *eed, EditFace *efa)
-{
- EditEdge *e1, *e2, *e3;
- EVPtr *evp;
- int i = 0;
-
- /* run through edges, if selected, set pointer edge-> facearray */
- while(eed) {
- eed->f2= 0;
- eed->f1= 0;
- if( eed->f & SELECT ) {
- eed->tmp.p = (EditVert *) (&efaa[i]);
- i++;
- }
- else eed->tmp.p = NULL;
-
- eed= eed->next;
- }
-
-
- /* find edges pointing to 2 faces by procedure:
-
- - run through faces and their edges, increase
- face counter e->f1 for each face
- */
-
- while(efa) {
- efa->f1= 0;
- if(efa->v4==0 && (efa->f & SELECT)) { /* if selected triangle */
- e1= efa->e1;
- e2= efa->e2;
- e3= efa->e3;
- if(e1->f2<3 && e1->tmp.p) {
- if(e1->f2<2) {
- evp= (EVPtr *) e1->tmp.p;
- evp[(int)e1->f2] = efa;
- }
- e1->f2+= 1;
- }
- if(e2->f2<3 && e2->tmp.p) {
- if(e2->f2<2) {
- evp= (EVPtr *) e2->tmp.p;
- evp[(int)e2->f2]= efa;
- }
- e2->f2+= 1;
- }
- if(e3->f2<3 && e3->tmp.p) {
- if(e3->f2<2) {
- evp= (EVPtr *) e3->tmp.p;
- evp[(int)e3->f2]= efa;
- }
- e3->f2+= 1;
- }
- }
- else {
- /* set to 3 to make sure these are not flipped or joined */
- efa->e1->f2= 3;
- efa->e2->f2= 3;
- efa->e3->f2= 3;
- if (efa->e4) efa->e4->f2= 3;
- }
-
- efa= efa->next;
- }
- return i;
-}
-
-
-/* returns vertices of two adjacent triangles forming a quad
- - can be righthand or lefthand
-
- 4-----3
- |\ |
- | \ 2 | <- efa1
- | \ |
- efa-> | 1 \ |
- | \|
- 1-----2
-
-*/
-#define VTEST(face, num, other) \
- (face->v##num != other->v1 && face->v##num != other->v2 && face->v##num != other->v3)
-
-static void givequadverts(EditFace *efa, EditFace *efa1, EditVert **v1, EditVert **v2, EditVert **v3, EditVert **v4, int *vindex)
-{
- if VTEST(efa, 1, efa1) {
- *v1= efa->v1;
- *v2= efa->v2;
- vindex[0]= 0;
- vindex[1]= 1;
- }
- else if VTEST(efa, 2, efa1) {
- *v1= efa->v2;
- *v2= efa->v3;
- vindex[0]= 1;
- vindex[1]= 2;
- }
- else if VTEST(efa, 3, efa1) {
- *v1= efa->v3;
- *v2= efa->v1;
- vindex[0]= 2;
- vindex[1]= 0;
- }
-
- if VTEST(efa1, 1, efa) {
- *v3= efa1->v1;
- *v4= efa1->v2;
- vindex[2]= 0;
- vindex[3]= 1;
- }
- else if VTEST(efa1, 2, efa) {
- *v3= efa1->v2;
- *v4= efa1->v3;
- vindex[2]= 1;
- vindex[3]= 2;
- }
- else if VTEST(efa1, 3, efa) {
- *v3= efa1->v3;
- *v4= efa1->v1;
- vindex[2]= 2;
- vindex[3]= 0;
- }
- else
- *v3= *v4= NULL;
-}
-
-/* Helper functions for edge/quad edit features*/
-static void untag_edges(EditFace *f)
-{
- f->e1->f1 = 0;
- f->e2->f1 = 0;
- f->e3->f1 = 0;
- if (f->e4) f->e4->f1 = 0;
-}
-
-/** remove and free list of tagged edges and faces */
-static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa)
-{
- EditMesh *em= G.editMesh;
- EditEdge *nexted;
- EditFace *nextvl;
-
- while(efa) {
- nextvl= efa->next;
- if(efa->f1) {
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- }
- else
- /* avoid deleting edges that are still in use */
- untag_edges(efa);
- efa= nextvl;
- }
-
- while(eed) {
- nexted= eed->next;
- if(eed->f1) {
- remedge(eed);
- free_editedge(eed);
- }
- eed= nexted;
- }
-}
-
-/* note; the EM_selectmode_set() calls here illustrate how badly constructed it all is... from before the
- edge/face flags, with very mixed results.... */
-void beauty_fill(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *v1, *v2, *v3, *v4;
- EditEdge *eed, *nexted;
- EditEdge dia1, dia2;
- EditFace *efa, *w;
- // void **efaar, **efaa;
- EVPTuple *efaar;
- EVPtr *efaa;
- float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2;
- int totedge, ok, notbeauty=8, onedone, vindex[4];
-
- if(multires_test()) return;
-
- /* - all selected edges with two faces
- * - find the faces: store them in edges (using datablock)
- * - per edge: - test convex
- * - test edge: flip?
- * - if true: remedge, addedge, all edges at the edge get new face pointers
- */
-
- EM_selectmode_set(); // makes sure in selectmode 'face' the edges of selected faces are selected too
-
- totedge = count_selected_edges(em->edges.first);
- if(totedge==0) return;
-
- /* temp block with face pointers */
- efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "beautyfill");
-
- while (notbeauty) {
- notbeauty--;
-
- ok = collect_quadedges(efaar, em->edges.first, em->faces.first);
-
- /* there we go */
- onedone= 0;
-
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
-
- /* f2 is set in collect_quadedges() */
- if(eed->f2==2 && eed->h==0) {
-
- efaa = (EVPtr *) eed->tmp.p;
-
- /* none of the faces should be treated before, nor be part of fgon */
- ok= 1;
- efa= efaa[0];
- if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0;
- if(efa->fgonf) ok= 0;
- efa= efaa[1];
- if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0;
- if(efa->fgonf) ok= 0;
-
- if(ok) {
- /* test convex */
- givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex);
- if(v1 && v2 && v3 && v4) {
- if( convex(v1->co, v2->co, v3->co, v4->co) ) {
-
- /* test edges */
- if( (v1) > (v3) ) {
- dia1.v1= v3;
- dia1.v2= v1;
- }
- else {
- dia1.v1= v1;
- dia1.v2= v3;
- }
-
- if( (v2) > (v4) ) {
- dia2.v1= v4;
- dia2.v2= v2;
- }
- else {
- dia2.v1= v2;
- dia2.v2= v4;
- }
-
- /* testing rule:
- * the area divided by the total edge lengths
- */
-
- len1= VecLenf(v1->co, v2->co);
- len2= VecLenf(v2->co, v3->co);
- len3= VecLenf(v3->co, v4->co);
- len4= VecLenf(v4->co, v1->co);
- len5= VecLenf(v1->co, v3->co);
- len6= VecLenf(v2->co, v4->co);
-
- opp1= AreaT3Dfl(v1->co, v2->co, v3->co);
- opp2= AreaT3Dfl(v1->co, v3->co, v4->co);
-
- fac1= opp1/(len1+len2+len5) + opp2/(len3+len4+len5);
-
- opp1= AreaT3Dfl(v2->co, v3->co, v4->co);
- opp2= AreaT3Dfl(v2->co, v4->co, v1->co);
-
- fac2= opp1/(len2+len3+len6) + opp2/(len4+len1+len6);
-
- ok= 0;
- if(fac1 > fac2) {
- if(dia2.v1==eed->v1 && dia2.v2==eed->v2) {
- eed->f1= 1;
- efa= efaa[0];
- efa->f1= 1;
- efa= efaa[1];
- efa->f1= 1;
-
- w= EM_face_from_faces(efaa[0], efaa[1],
- vindex[0], vindex[1], 4+vindex[2], -1);
- w->f |= SELECT;
-
-
- w= EM_face_from_faces(efaa[0], efaa[1],
- vindex[0], 4+vindex[2], 4+vindex[3], -1);
- w->f |= SELECT;
-
- onedone= 1;
- }
- }
- else if(fac1 < fac2) {
- if(dia1.v1==eed->v1 && dia1.v2==eed->v2) {
- eed->f1= 1;
- efa= efaa[0];
- efa->f1= 1;
- efa= efaa[1];
- efa->f1= 1;
-
-
- w= EM_face_from_faces(efaa[0], efaa[1],
- vindex[1], 4+vindex[2], 4+vindex[3], -1);
- w->f |= SELECT;
-
-
- w= EM_face_from_faces(efaa[0], efaa[1],
- vindex[0], 4+vindex[1], 4+vindex[3], -1);
- w->f |= SELECT;
-
- onedone= 1;
- }
- }
- }
- }
- }
-
- }
- eed= nexted;
- }
-
- free_tagged_edges_faces(em->edges.first, em->faces.first);
-
- if(onedone==0) break;
-
- EM_selectmode_set(); // new edges/faces were added
- }
-
- MEM_freeN(efaar);
-
- EM_select_flush();
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
- BIF_undo_push("Beauty Fill");
-}
-
-
-/* ******************** BEGIN TRIANGLE TO QUAD ************************************* */
-static float measure_facepair(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, float limit){
-
- /*gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would make*/
- /*Note: this is more complicated than it needs to be and should be cleaned up...*/
- float measure = 0.0, noA1[3], noA2[3], noB1[3], noB2[3], normalADiff, normalBDiff,
- edgeVec1[3], edgeVec2[3], edgeVec3[3], edgeVec4[3], diff,
- minarea, maxarea, areaA, areaB;
-
- /*First Test: Normal difference*/
- CalcNormFloat(v1->co, v2->co, v3->co, noA1);
- CalcNormFloat(v1->co, v3->co, v4->co, noA2);
-
- if(noA1[0] == noA2[0] && noA1[1] == noA2[1] && noA1[2] == noA2[2]) normalADiff = 0.0;
- else normalADiff = VecAngle2(noA1, noA2);
- //if(!normalADiff) normalADiff = 179;
- CalcNormFloat(v2->co, v3->co, v4->co, noB1);
- CalcNormFloat(v4->co, v1->co, v2->co, noB2);
-
- if(noB1[0] == noB2[0] && noB1[1] == noB2[1] && noB1[2] == noB2[2]) normalBDiff = 0.0;
- else normalBDiff = VecAngle2(noB1, noB2);
- //if(!normalBDiff) normalBDiff = 179;
-
- measure += (normalADiff/360) + (normalBDiff/360);
- if(measure > limit) return measure;
-
- /*Second test: Colinearity*/
- VecSubf(edgeVec1, v1->co, v2->co);
- VecSubf(edgeVec2, v2->co, v3->co);
- VecSubf(edgeVec3, v3->co, v4->co);
- VecSubf(edgeVec4, v4->co, v1->co);
-
- diff = 0.0;
-
- diff = (
- fabs(VecAngle2(edgeVec1, edgeVec2) - 90) +
- fabs(VecAngle2(edgeVec2, edgeVec3) - 90) +
- fabs(VecAngle2(edgeVec3, edgeVec4) - 90) +
- fabs(VecAngle2(edgeVec4, edgeVec1) - 90)) / 360;
- if(!diff) return 0.0;
-
- measure += diff;
- if(measure > limit) return measure;
-
- /*Third test: Concavity*/
- areaA = AreaT3Dfl(v1->co, v2->co, v3->co) + AreaT3Dfl(v1->co, v3->co, v4->co);
- areaB = AreaT3Dfl(v2->co, v3->co, v4->co) + AreaT3Dfl(v4->co, v1->co, v2->co);
-
- if(areaA <= areaB) minarea = areaA;
- else minarea = areaB;
-
- if(areaA >= areaB) maxarea = areaA;
- else maxarea = areaB;
-
- if(!maxarea) measure += 1;
- else measure += (1 - (minarea / maxarea));
-
- return measure;
-}
-
-#define T2QUV_LIMIT 0.005
-#define T2QCOL_LIMIT 3
-static int compareFaceAttribs(EditFace *f1, EditFace *f2, EditEdge *eed)
-{
- /*Test to see if the per-face attributes for the joining edge match within limit*/
- MTFace *tf1, *tf2;
- unsigned int *col1, *col2;
- short i,attrok=0, flag = G.scene->toolsettings->editbutflag, fe1[2], fe2[2];
-
- tf1 = CustomData_em_get(&G.editMesh->fdata, f1->data, CD_MTFACE);
- tf2 = CustomData_em_get(&G.editMesh->fdata, f2->data, CD_MTFACE);
-
- col1 = CustomData_em_get(&G.editMesh->fdata, f1->data, CD_MCOL);
- col2 = CustomData_em_get(&G.editMesh->fdata, f2->data, CD_MCOL);
-
- /*store indices for faceedges*/
- f1->v1->f1 = 0;
- f1->v2->f1 = 1;
- f1->v3->f1 = 2;
-
- fe1[0] = eed->v1->f1;
- fe1[1] = eed->v2->f1;
-
- f2->v1->f1 = 0;
- f2->v2->f1 = 1;
- f2->v3->f1 = 2;
-
- fe2[0] = eed->v1->f1;
- fe2[1] = eed->v2->f1;
-
- /*compare faceedges for each face attribute. Additional per face attributes can be added later*/
- /*do UVs*/
- if(flag & B_JOINTRIA_UV){
-
- if(tf1 == NULL || tf2 == NULL) attrok |= B_JOINTRIA_UV;
- else if(tf1->tpage != tf2->tpage); /*do nothing*/
- else{
- for(i = 0; i < 2; i++){
- if(tf1->uv[fe1[i]][0] + T2QUV_LIMIT > tf2->uv[fe2[i]][0] && tf1->uv[fe1[i]][0] - T2QUV_LIMIT < tf2->uv[fe2[i]][0] &&
- tf1->uv[fe1[i]][1] + T2QUV_LIMIT > tf2->uv[fe2[i]][1] && tf1->uv[fe1[i]][1] - T2QUV_LIMIT < tf2->uv[fe2[i]][1]) attrok |= B_JOINTRIA_UV;
- }
- }
- }
-
- /*do VCOLs*/
- if(flag & B_JOINTRIA_VCOL){
- if(!col1 || !col2) attrok |= B_JOINTRIA_VCOL;
- else{
- char *f1vcol, *f2vcol;
- for(i = 0; i < 2; i++){
- f1vcol = (char *)&(col1[fe1[i]]);
- f2vcol = (char *)&(col2[fe2[i]]);
-
- /*compare f1vcol with f2vcol*/
- if( f1vcol[1] + T2QCOL_LIMIT > f2vcol[1] && f1vcol[1] - T2QCOL_LIMIT < f2vcol[1] &&
- f1vcol[2] + T2QCOL_LIMIT > f2vcol[2] && f1vcol[2] - T2QCOL_LIMIT < f2vcol[2] &&
- f1vcol[3] + T2QCOL_LIMIT > f2vcol[3] && f1vcol[3] - T2QCOL_LIMIT < f2vcol[3]) attrok |= B_JOINTRIA_VCOL;
- }
- }
- }
-
- if( ((attrok & B_JOINTRIA_UV) == (flag & B_JOINTRIA_UV)) && ((attrok & B_JOINTRIA_VCOL) == (flag & B_JOINTRIA_VCOL)) ) return 1;
- return 0;
-}
-
-static int fplcmp(const void *v1, const void *v2)
-{
- const EditEdge *e1= *((EditEdge**)v1), *e2=*((EditEdge**)v2);
-
- if( e1->crease > e2->crease) return 1;
- else if( e1->crease < e2->crease) return -1;
-
- return 0;
-}
-
-/*Bitflags for edges.*/
-#define T2QDELETE 1
-#define T2QCOMPLEX 2
-#define T2QJOIN 4
-void join_triangles(void)
-{
- EditMesh *em=G.editMesh;
- EditVert *v1, *v2, *v3, *v4, *eve;
- EditEdge *eed, **edsortblock = NULL, **edb = NULL;
- EditFace *efa;
- EVPTuple *efaar = NULL;
- EVPtr *efaa = NULL;
- float *creases = NULL;
- float measure; /*Used to set tolerance*/
- float limit = G.scene->toolsettings->jointrilimit;
- int i, ok, totedge=0, totseledge=0, complexedges, vindex[4];
-
- /*test for multi-resolution data*/
- if(multires_test()) return;
-
- /*if we take a long time on very dense meshes we want waitcursor to display*/
- waitcursor(1);
-
- totseledge = count_selected_edges(em->edges.first);
- if(totseledge==0) return;
-
- /*abusing crease value to store weights for edge pairs. Nasty*/
- for(eed=em->edges.first; eed; eed=eed->next) totedge++;
- if(totedge) creases = MEM_callocN(sizeof(float) * totedge, "Join Triangles Crease Array");
- for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++){
- creases[i] = eed->crease;
- eed->crease = 0.0;
- }
-
- /*clear temp flags*/
- for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = eve->f2 = 0;
- for(eed=em->edges.first; eed; eed=eed->next) eed->f2 = eed->f1 = 0;
- for(efa=em->faces.first; efa; efa=efa->next) efa->f1 = efa->tmp.l = 0;
-
- /*For every selected 2 manifold edge, create pointers to its two faces.*/
- efaar= (EVPTuple *) MEM_callocN(totseledge * sizeof(EVPTuple), "Tri2Quad");
- ok = collect_quadedges(efaar, em->edges.first, em->faces.first);
- complexedges = 0;
-
- if(ok){
-
-
- /*clear tmp.l flag and store number of faces that are selected and coincident to current face here.*/
- for(eed=em->edges.first; eed; eed=eed->next){
- /* eed->f2 is 2 only if this edge is part of exactly two
- triangles, and both are selected, and it has EVPTuple assigned */
- if(eed->f2 == 2){
- efaa= (EVPtr *) eed->tmp.p;
- efaa[0]->tmp.l++;
- efaa[1]->tmp.l++;
- }
- }
-
- for(eed=em->edges.first; eed; eed=eed->next){
- if(eed->f2 == 2){
- efaa= (EVPtr *) eed->tmp.p;
- v1 = v2 = v3 = v4 = NULL;
- givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex);
- if(v1 && v2 && v3 && v4){
- /*test if simple island first. This mimics 2.42 behaviour and the tests are less restrictive.*/
- if(efaa[0]->tmp.l == 1 && efaa[1]->tmp.l == 1){
- if( convex(v1->co, v2->co, v3->co, v4->co) ){
- eed->f1 |= T2QJOIN;
- efaa[0]->f1 = 1; //mark for join
- efaa[1]->f1 = 1; //mark for join
- }
- }
- else{
-
- /* The face pair is part of a 'complex' island, so the rules for dealing with it are more involved.
- Depending on what options the user has chosen, this face pair can be 'thrown out' based upon the following criteria:
-
- 1: the two faces do not share the same material
- 2: the edge joining the two faces is marked as sharp.
- 3: the two faces UV's do not make a good match
- 4: the two faces Vertex colors do not make a good match
-
- If the face pair passes all the applicable tests, it is then given a 'weight' with the measure_facepair() function.
- This measures things like concavity, colinearity ect. If this weight is below the threshold set by the user
- the edge joining them is marked as being 'complex' and will be compared against other possible pairs which contain one of the
- same faces in the current pair later.
-
- This technique is based upon an algorithm that Campbell Barton developed for his Tri2Quad script that was previously part of
- the python scripts bundled with Blender releases.
- */
-
- if(G.scene->toolsettings->editbutflag & B_JOINTRIA_SHARP && eed->sharp); /*do nothing*/
- else if(G.scene->toolsettings->editbutflag & B_JOINTRIA_MAT && efaa[0]->mat_nr != efaa[1]->mat_nr); /*do nothing*/
- else if(((G.scene->toolsettings->editbutflag & B_JOINTRIA_UV) || (G.scene->toolsettings->editbutflag & B_JOINTRIA_VCOL)) &&
- compareFaceAttribs(efaa[0], efaa[1], eed) == 0); /*do nothing*/
- else{
- measure = measure_facepair(v1, v2, v3, v4, limit);
- if(measure < limit){
- complexedges++;
- eed->f1 |= T2QCOMPLEX;
- eed->crease = measure; /*we dont mark edges for join yet*/
- }
- }
- }
- }
- }
- }
-
- /*Quicksort the complex edges according to their weighting*/
- if(complexedges){
- edsortblock = edb = MEM_callocN(sizeof(EditEdge*) * complexedges, "Face Pairs quicksort Array");
- for(eed = em->edges.first; eed; eed=eed->next){
- if(eed->f1 & T2QCOMPLEX){
- *edb = eed;
- edb++;
- }
- }
- qsort(edsortblock, complexedges, sizeof(EditEdge*), fplcmp);
- /*now go through and mark the edges who get the highest weighting*/
- for(edb=edsortblock, i=0; i < complexedges; edb++, i++){
- efaa = (EVPtr *)((*edb)->tmp.p); /*suspect!*/
- if( !efaa[0]->f1 && !efaa[1]->f1){
- efaa[0]->f1 = 1; //mark for join
- efaa[1]->f1 = 1; //mark for join
- (*edb)->f1 |= T2QJOIN;
- }
- }
- }
-
- /*finally go through all edges marked for join (simple and complex) and create new faces*/
- for(eed=em->edges.first; eed; eed=eed->next){
- if(eed->f1 & T2QJOIN){
- efaa= (EVPtr *)eed->tmp.p;
- v1 = v2 = v3 = v4 = NULL;
- givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex);
- if((v1 && v2 && v3 && v4) && (exist_face(v1, v2, v3, v4)==0)){ /*exist_face is very slow! Needs to be adressed.*/
- /*flag for delete*/
- eed->f1 |= T2QDELETE;
- /*create new quad and select*/
- efa = EM_face_from_faces(efaa[0], efaa[1], vindex[0], vindex[1], 4+vindex[2], 4+vindex[3]);
- EM_select_face(efa,1);
- }
- else{
- efaa[0]->f1 = 0;
- efaa[1]->f1 = 0;
- }
- }
- }
- }
-
- /*free data and cleanup*/
- if(creases){
- for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++) eed->crease = creases[i];
- MEM_freeN(creases);
- }
- for(eed=em->edges.first; eed; eed=eed->next){
- if(eed->f1 & T2QDELETE) eed->f1 = 1;
- else eed->f1 = 0;
- }
- free_tagged_edges_faces(em->edges.first, em->faces.first);
- if(efaar) MEM_freeN(efaar);
- if(edsortblock) MEM_freeN(edsortblock);
-
- EM_selectmode_flush();
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- #ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
- #endif
- waitcursor(0);
- BIF_undo_push("Convert Triangles to Quads");
-}
-/* ******************** END TRIANGLE TO QUAD ************************************* */
-
-#define FACE_MARKCLEAR(f) (f->f1 = 1)
-
-/* quick hack, basically a copy of beauty_fill */
-void edge_flip(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *v1, *v2, *v3, *v4;
- EditEdge *eed, *nexted;
- EditFace *efa, *w;
- //void **efaar, **efaa;
- EVPTuple *efaar;
- EVPtr *efaa;
- int totedge, ok, vindex[4];
-
- /* - all selected edges with two faces
- * - find the faces: store them in edges (using datablock)
- * - per edge: - test convex
- * - test edge: flip?
- - if true: remedge, addedge, all edges at the edge get new face pointers
- */
-
- EM_selectmode_flush(); // makes sure in selectmode 'face' the edges of selected faces are selected too
-
- totedge = count_selected_edges(em->edges.first);
- if(totedge==0) return;
-
- /* temporary array for : edge -> face[1], face[2] */
- efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "edgeflip");
-
- ok = collect_quadedges(efaar, em->edges.first, em->faces.first);
-
- eed= em->edges.first;
- while(eed) {
- nexted= eed->next;
-
- if(eed->f2==2) { /* points to 2 faces */
-
- efaa= (EVPtr *) eed->tmp.p;
-
- /* don't do it if flagged */
-
- ok= 1;
- efa= efaa[0];
- if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0;
- efa= efaa[1];
- if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0;
-
- if(ok) {
- /* test convex */
- givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex);
-
-/*
- 4-----3 4-----3
- |\ | | /|
- | \ 1 | | 1 / |
- | \ | -> | / |
- | 0 \ | | / 0 |
- | \| |/ |
- 1-----2 1-----2
-*/
- /* make new faces */
- if (v1 && v2 && v3) {
- if( convex(v1->co, v2->co, v3->co, v4->co) ) {
- if(exist_face(v1, v2, v3, v4)==0) {
- /* outch this may break seams */
- w= EM_face_from_faces(efaa[0], efaa[1], vindex[0],
- vindex[1], 4+vindex[2], -1);
-
- EM_select_face(w, 1);
-
- /* outch this may break seams */
- w= EM_face_from_faces(efaa[0], efaa[1], vindex[0],
- 4+vindex[2], 4+vindex[3], -1);
-
- EM_select_face(w, 1);
- }
- /* tag as to-be-removed */
- FACE_MARKCLEAR(efaa[1]);
- FACE_MARKCLEAR(efaa[0]);
- eed->f1 = 1;
-
- } /* endif test convex */
- }
- }
- }
- eed= nexted;
- }
-
- /* clear tagged edges and faces: */
- free_tagged_edges_faces(em->edges.first, em->faces.first);
-
- MEM_freeN(efaar);
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
- BIF_undo_push("Flip Triangle Edges");
-
-}
-
-static void edge_rotate(EditEdge *eed,int dir)
-{
- EditMesh *em = G.editMesh;
- EditVert **verts[2];
- EditFace *face[2], *efa, *newFace[2];
- EditEdge **edges[2], **hiddenedges, *srchedge;
- int facecount, p1, p2, p3, p4, fac1, fac2, i, j;
- int numhidden, numshared, p[2][4];
-
- /* check to make sure that the edge is only part of 2 faces */
- facecount = 0;
- for(efa = em->faces.first;efa;efa = efa->next) {
- if((efa->e1 == eed || efa->e2 == eed) || (efa->e3 == eed || efa->e4 == eed)) {
- if(facecount >= 2) {
- /* more than two faces with this edge */
- return;
- }
- else {
- face[facecount] = efa;
- facecount++;
- }
- }
- }
-
- if(facecount < 2)
- return;
-
- /* how many edges does each face have */
- if(face[0]->e4) fac1= 4;
- else fac1= 3;
-
- if(face[1]->e4) fac2= 4;
- else fac2= 3;
-
- /* make a handy array for verts and edges */
- verts[0]= &face[0]->v1;
- edges[0]= &face[0]->e1;
- verts[1]= &face[1]->v1;
- edges[1]= &face[1]->e1;
-
- /* we don't want to rotate edges between faces that share more than one edge */
- numshared= 0;
- for(i=0; i<fac1; i++)
- for(j=0; j<fac2; j++)
- if (edges[0][i] == edges[1][j])
- numshared++;
-
- if(numshared > 1)
- return;
-
- /* coplaner faces only please */
- if(Inpf(face[0]->n,face[1]->n) <= 0.000001)
- return;
-
- /* we want to construct an array of vertex indicis in both faces, starting at
- the last vertex of the edge being rotated.
- - first we find the two vertices that lie on the rotating edge
- - then we make sure they are ordered according to the face vertex order
- - and then we construct the array */
- p1= p2= p3= p4= 0;
-
- for(i=0; i<4; i++) {
- if(eed->v1 == verts[0][i]) p1 = i;
- if(eed->v2 == verts[0][i]) p2 = i;
- if(eed->v1 == verts[1][i]) p3 = i;
- if(eed->v2 == verts[1][i]) p4 = i;
- }
-
- if((p1+1)%fac1 == p2)
- SWAP(int, p1, p2);
- if((p3+1)%fac2 == p4)
- SWAP(int, p3, p4);
-
- for (i = 0; i < 4; i++) {
- p[0][i]= (p1 + i)%fac1;
- p[1][i]= (p3 + i)%fac2;
- }
-
- /* create an Array of the Edges who have h set prior to rotate */
- numhidden = 0;
- for(srchedge = em->edges.first;srchedge;srchedge = srchedge->next)
- if(srchedge->h && ((srchedge->v1->f & SELECT) || (srchedge->v2->f & SELECT)))
- numhidden++;
-
- hiddenedges = MEM_mallocN(sizeof(EditVert*)*numhidden+1, "RotateEdgeHiddenVerts");
- if(!hiddenedges) {
- error("Malloc Was not happy!");
- return;
- }
-
- numhidden = 0;
- for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next)
- if(srchedge->h && (srchedge->v1->f & SELECT || srchedge->v2->f & SELECT))
- hiddenedges[numhidden++] = srchedge;
-
- /* create the 2 new faces */
- if(fac1 == 3 && fac2 == 3) {
- /* no need of reverse setup */
-
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
- }
- else if(fac1 == 4 && fac2 == 3) {
- if(dir == 1) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
- } else if (dir == 2) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]);
- newFace[1]= EM_face_from_faces(face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1);
-
- verts[0][p[0][2]]->f |= SELECT;
- verts[1][p[1][1]]->f |= SELECT;
- }
- }
- else if(fac1 == 3 && fac2 == 4) {
- if(dir == 1) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
- } else if (dir == 2) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]);
-
- verts[0][p[0][1]]->f |= SELECT;
- verts[1][p[1][2]]->f |= SELECT;
- }
-
- }
- else if(fac1 == 4 && fac2 == 4) {
- if(dir == 1) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
- } else if (dir == 2) {
- newFace[0]= EM_face_from_faces(face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]);
- newFace[1]= EM_face_from_faces(face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]);
-
- verts[0][p[0][2]]->f |= SELECT;
- verts[1][p[1][2]]->f |= SELECT;
- }
- }
- else
- return; /* This should never happen */
-
- if(dir == 1 || (fac1 == 3 && fac2 == 3)) {
- verts[0][p[0][1]]->f |= SELECT;
- verts[1][p[1][1]]->f |= SELECT;
- }
-
- /* copy old edge's flags to new center edge*/
- for(srchedge=em->edges.first;srchedge;srchedge=srchedge->next) {
- if((srchedge->v1->f & SELECT) && (srchedge->v2->f & SELECT)) {
- srchedge->f = eed->f;
- srchedge->h = eed->h;
- srchedge->dir = eed->dir;
- srchedge->seam = eed->seam;
- srchedge->crease = eed->crease;
- srchedge->bweight = eed->bweight;
- }
- }
-
- /* resetting hidden flag */
- for(numhidden--; numhidden>=0; numhidden--)
- hiddenedges[numhidden]->h= 1;
-
- /* check for orhphan edges */
- for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next)
- srchedge->f1= -1;
-
- /* cleanup */
- MEM_freeN(hiddenedges);
-
- /* get rid of the old edge and faces*/
- remedge(eed);
- free_editedge(eed);
- BLI_remlink(&em->faces, face[0]);
- free_editface(face[0]);
- BLI_remlink(&em->faces, face[1]);
- free_editface(face[1]);
-}
-
-/* only accepts 1 selected edge, or 2 selected faces */
-void edge_rotate_selected(int dir)
-{
- EditEdge *eed;
- EditFace *efa;
- short edgeCount = 0;
-
- /*clear new flag for new edges, count selected edges */
- for(eed= G.editMesh->edges.first; eed; eed= eed->next) {
- eed->f1= 0;
- eed->f2 &= ~2;
- if(eed->f & SELECT) edgeCount++;
- }
-
- if(edgeCount>1) {
- /* more selected edges, check faces */
- for(efa= G.editMesh->faces.first; efa; efa= efa->next) {
- if(efa->f & SELECT) {
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- }
- edgeCount= 0;
- for(eed= G.editMesh->edges.first; eed; eed= eed->next) {
- if(eed->f1==2) edgeCount++;
- }
- if(edgeCount==1) {
- for(eed= G.editMesh->edges.first; eed; eed= eed->next) {
- if(eed->f1==2) {
- edge_rotate(eed,dir);
- break;
- }
- }
- }
- else error("Select one edge or two adjacent faces");
- }
- else if(edgeCount==1) {
- for(eed= G.editMesh->edges.first; eed; eed= eed->next) {
- if(eed->f & SELECT) {
- EM_select_edge(eed, 0);
- edge_rotate(eed,dir);
- break;
- }
- }
- }
- else error("Select one edge or two adjacent faces");
-
-
- /* flush selected vertices (again) to edges/faces */
- EM_select_flush();
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode)
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
-#endif
-
- BIF_undo_push("Rotate Edge");
-}
-
-/******************* BEVEL CODE STARTS HERE ********************/
-
-static void bevel_displace_vec(float *midvec, float *v1, float *v2, float *v3, float d, float no[3])
-{
- float a[3], c[3], n_a[3], n_c[3], mid[3], ac, ac2, fac;
-
- VecSubf(a, v1, v2);
- VecSubf(c, v3, v2);
-
- Crossf(n_a, a, no);
- Normalize(n_a);
- Crossf(n_c, no, c);
- Normalize(n_c);
-
- Normalize(a);
- Normalize(c);
- ac = Inpf(a, c);
-
- if (ac == 1 || ac == -1) {
- midvec[0] = midvec[1] = midvec[2] = 0;
- return;
- }
- ac2 = ac * ac;
- fac = (float)sqrt((ac2 + 2*ac + 1)/(1 - ac2) + 1);
- VecAddf(mid, n_c, n_a);
- Normalize(mid);
- VecMulf(mid, d * fac);
- VecAddf(mid, mid, v2);
- VecCopyf(midvec, mid);
-}
-
-/* Finds the new point using the sinus law to extrapolate a triangle
- Lots of sqrts which would not be good for a real time algo
- Using the mid point of the extrapolation of both sides
- Useless for coplanar quads, but that doesn't happen too often */
-static void fix_bevel_wrap(float *midvec, float *v1, float *v2, float *v3, float *v4, float d, float no[3])
-{
- float a[3], b[3], c[3], l_a, l_b, l_c, s_a, s_b, s_c, Pos1[3], Pos2[3], Dir[3];
-
- VecSubf(a, v3, v2);
- l_a = Normalize(a);
- VecSubf(b, v4, v3);
- Normalize(b);
- VecSubf(c, v1, v2);
- Normalize(c);
-
- s_b = Inpf(a, c);
- s_b = (float)sqrt(1 - (s_b * s_b));
- s_a = Inpf(b, c);
- s_a = (float)sqrt(1 - (s_a * s_a));
- VecMulf(a, -1);
- s_c = Inpf(a, b);
- s_c = (float)sqrt(1 - (s_c * s_c));
-
- l_b = s_b * l_a / s_a;
- l_c = s_c * l_a / s_a;
-
- VecMulf(b, l_b);
- VecMulf(c, l_c);
-
- VecAddf(Pos1, v2, c);
- VecAddf(Pos2, v3, b);
-
- VecAddf(Dir, Pos1, Pos2);
- VecMulf(Dir, 0.5);
-
- bevel_displace_vec(midvec, v3, Dir, v2, d, no);
-
-}
-
-
-static char detect_wrap(float *o_v1, float *o_v2, float *v1, float *v2, float *no)
-{
- float o_a[3], a[3], o_c[3], c[3];
-
- VecSubf(o_a, o_v1, o_v2);
- VecSubf(a, v1, v2);
-
- Crossf(o_c, o_a, no);
- Crossf(c, a, no);
-
- if (Inpf(c, o_c) <= 0)
- return 1;
- else
- return 0;
-}
-
-// Detects and fix a quad wrapping after the resize
-// Arguments are the orginal verts followed by the final verts and then the bevel size and the normal
-static void fix_bevel_quad_wrap(float *o_v1, float *o_v2, float *o_v3, float *o_v4, float *v1, float *v2, float *v3, float *v4, float d, float *no)
-{
- float vec[3];
- char wrap[4];
-
- // Quads can wrap partially. Watch out
- wrap[0] = detect_wrap(o_v1, o_v2, v1, v2, no); // Edge 1-2
- wrap[1] = detect_wrap(o_v2, o_v3, v2, v3, no); // Edge 2-3
- wrap[2] = detect_wrap(o_v3, o_v4, v3, v4, no); // Edge 3-4
- wrap[3] = detect_wrap(o_v4, o_v1, v4, v1, no); // Edge 4-1
-
- // Edge 1 inverted
- if (wrap[0] == 1 && wrap[1] == 0 && wrap[2] == 0 && wrap[3] == 0) {
- fix_bevel_wrap(vec, o_v2, o_v3, o_v4, o_v1, d, no);
- VECCOPY(v1, vec);
- VECCOPY(v2, vec);
- }
- // Edge 2 inverted
- else if (wrap[0] == 0 && wrap[1] == 1 && wrap[2] == 0 && wrap[3] == 0) {
- fix_bevel_wrap(vec, o_v3, o_v4, o_v1, o_v2, d, no);
- VECCOPY(v2, vec);
- VECCOPY(v3, vec);
- }
- // Edge 3 inverted
- else if (wrap[0] == 0 && wrap[1] == 0 && wrap[2] == 1 && wrap[3] == 0) {
- fix_bevel_wrap(vec, o_v4, o_v1, o_v2, o_v3, d, no);
- VECCOPY(v3, vec);
- VECCOPY(v4, vec);
- }
- // Edge 4 inverted
- else if (wrap[0] == 0 && wrap[1] == 0 && wrap[2] == 0 && wrap[3] == 1) {
- fix_bevel_wrap(vec, o_v1, o_v2, o_v3, o_v4, d, no);
- VECCOPY(v4, vec);
- VECCOPY(v1, vec);
- }
- // Edge 2 and 4 inverted
- else if (wrap[0] == 0 && wrap[1] == 1 && wrap[2] == 0 && wrap[3] == 1) {
- VecAddf(vec, v2, v3);
- VecMulf(vec, 0.5);
- VECCOPY(v2, vec);
- VECCOPY(v3, vec);
- VecAddf(vec, v1, v4);
- VecMulf(vec, 0.5);
- VECCOPY(v1, vec);
- VECCOPY(v4, vec);
- }
- // Edge 1 and 3 inverted
- else if (wrap[0] == 1 && wrap[1] == 0 && wrap[2] == 1 && wrap[3] == 0) {
- VecAddf(vec, v1, v2);
- VecMulf(vec, 0.5);
- VECCOPY(v1, vec);
- VECCOPY(v2, vec);
- VecAddf(vec, v3, v4);
- VecMulf(vec, 0.5);
- VECCOPY(v3, vec);
- VECCOPY(v4, vec);
- }
- // Totally inverted
- else if (wrap[0] == 1 && wrap[1] == 1 && wrap[2] == 1 && wrap[3] == 1) {
- VecAddf(vec, v1, v2);
- VecAddf(vec, vec, v3);
- VecAddf(vec, vec, v4);
- VecMulf(vec, 0.25);
- VECCOPY(v1, vec);
- VECCOPY(v2, vec);
- VECCOPY(v3, vec);
- VECCOPY(v4, vec);
- }
-
-}
-
-// Detects and fix a tri wrapping after the resize
-// Arguments are the orginal verts followed by the final verts and the normal
-// Triangles cannot wrap partially (not in this situation
-static void fix_bevel_tri_wrap(float *o_v1, float *o_v2, float *o_v3, float *v1, float *v2, float *v3, float *no)
-{
- if (detect_wrap(o_v1, o_v2, v1, v2, no)) {
- float vec[3];
- VecAddf(vec, o_v1, o_v2);
- VecAddf(vec, vec, o_v3);
- VecMulf(vec, 1.0f/3.0f);
- VECCOPY(v1, vec);
- VECCOPY(v2, vec);
- VECCOPY(v3, vec);
- }
-}
-
-static void bevel_shrink_faces(float d, int flag)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- float vec[3], no[3], v1[3], v2[3], v3[3], v4[3];
-
- /* move edges of all faces with efa->f1 & flag closer towards their centers */
- efa= em->faces.first;
- while (efa) {
- if (efa->f1 & flag) {
- VECCOPY(v1, efa->v1->co);
- VECCOPY(v2, efa->v2->co);
- VECCOPY(v3, efa->v3->co);
- VECCOPY(no, efa->n);
- if (efa->v4 == NULL) {
- bevel_displace_vec(vec, v1, v2, v3, d, no);
- VECCOPY(efa->v2->co, vec);
- bevel_displace_vec(vec, v2, v3, v1, d, no);
- VECCOPY(efa->v3->co, vec);
- bevel_displace_vec(vec, v3, v1, v2, d, no);
- VECCOPY(efa->v1->co, vec);
-
- fix_bevel_tri_wrap(v1, v2, v3, efa->v1->co, efa->v2->co, efa->v3->co, no);
- } else {
- VECCOPY(v4, efa->v4->co);
- bevel_displace_vec(vec, v1, v2, v3, d, no);
- VECCOPY(efa->v2->co, vec);
- bevel_displace_vec(vec, v2, v3, v4, d, no);
- VECCOPY(efa->v3->co, vec);
- bevel_displace_vec(vec, v3, v4, v1, d, no);
- VECCOPY(efa->v4->co, vec);
- bevel_displace_vec(vec, v4, v1, v2, d, no);
- VECCOPY(efa->v1->co, vec);
-
- fix_bevel_quad_wrap(v1, v2, v3, v4, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, d, no);
- }
- }
- efa= efa->next;
- }
-}
-
-static void bevel_shrink_draw(float d, int flag)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- float vec[3], no[3], v1[3], v2[3], v3[3], v4[3], fv1[3], fv2[3], fv3[3], fv4[3];
-
- /* move edges of all faces with efa->f1 & flag closer towards their centers */
- efa= em->faces.first;
- while (efa) {
- VECCOPY(v1, efa->v1->co);
- VECCOPY(v2, efa->v2->co);
- VECCOPY(v3, efa->v3->co);
- VECCOPY(no, efa->n);
- if (efa->v4 == NULL) {
- bevel_displace_vec(vec, v1, v2, v3, d, no);
- VECCOPY(fv2, vec);
- bevel_displace_vec(vec, v2, v3, v1, d, no);
- VECCOPY(fv3, vec);
- bevel_displace_vec(vec, v3, v1, v2, d, no);
- VECCOPY(fv1, vec);
-
- fix_bevel_tri_wrap(v1, v2, v3, fv1, fv2, fv3, no);
-
- glBegin(GL_LINES);
- glVertex3fv(fv1);
- glVertex3fv(fv2);
- glEnd();
- glBegin(GL_LINES);
- glVertex3fv(fv2);
- glVertex3fv(fv3);
- glEnd();
- glBegin(GL_LINES);
- glVertex3fv(fv1);
- glVertex3fv(fv3);
- glEnd();
- } else {
- VECCOPY(v4, efa->v4->co);
- bevel_displace_vec(vec, v4, v1, v2, d, no);
- VECCOPY(fv1, vec);
- bevel_displace_vec(vec, v1, v2, v3, d, no);
- VECCOPY(fv2, vec);
- bevel_displace_vec(vec, v2, v3, v4, d, no);
- VECCOPY(fv3, vec);
- bevel_displace_vec(vec, v3, v4, v1, d, no);
- VECCOPY(fv4, vec);
-
- fix_bevel_quad_wrap(v1, v2, v3, v4, fv1, fv2, fv3, fv4, d, no);
-
- glBegin(GL_LINES);
- glVertex3fv(fv1);
- glVertex3fv(fv2);
- glEnd();
- glBegin(GL_LINES);
- glVertex3fv(fv2);
- glVertex3fv(fv3);
- glEnd();
- glBegin(GL_LINES);
- glVertex3fv(fv3);
- glVertex3fv(fv4);
- glEnd();
- glBegin(GL_LINES);
- glVertex3fv(fv1);
- glVertex3fv(fv4);
- glEnd();
- }
- efa= efa->next;
- }
-}
-
-static void bevel_mesh(float bsize, int allfaces)
-{
- EditMesh *em = G.editMesh;
-//#define BEV_DEBUG
-/* Enables debug printfs and assigns material indices: */
-/* 2 = edge quad */
-/* 3 = fill polygon (vertex clusters) */
-
- EditFace *efa, *example; //, *nextvl;
- EditEdge *eed, *eed2;
- EditVert *neweve[1024], *eve, *eve2, *eve3, *v1, *v2, *v3, *v4; //, *eve4;
- //short found4, search;
- //float f1, f2, f3, f4;
- float cent[3], min[3], max[3];
- int a, b, c;
- float limit= 0.001f;
-
- if(multires_test()) return;
-
- waitcursor(1);
-
- removedoublesflag(1, 0, limit);
-
- /* tag all original faces */
- efa= em->faces.first;
- while (efa) {
- efa->f1= 0;
- if (faceselectedAND(efa, 1)||allfaces) {
- efa->f1= 1;
- efa->v1->f |= 128;
- efa->v2->f |= 128;
- efa->v3->f |= 128;
- if (efa->v4) efa->v4->f |= 128;
- }
- efa->v1->f &= ~64;
- efa->v2->f &= ~64;
- efa->v3->f &= ~64;
- if (efa->v4) efa->v4->f &= ~64;
-
- efa= efa->next;
- }
-
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: split\n");
-#endif
-
- efa= em->faces.first;
- while (efa) {
- if (efa->f1 & 1) {
- efa->f1-= 1;
- v1= addvertlist(efa->v1->co, efa->v1);
- v1->f= efa->v1->f & ~128;
- efa->v1->tmp.v = v1;
-
- v1= addvertlist(efa->v2->co, efa->v2);
- v1->f= efa->v2->f & ~128;
- efa->v2->tmp.v = v1;
-
- v1= addvertlist(efa->v3->co, efa->v3);
- v1->f= efa->v3->f & ~128;
- efa->v3->tmp.v = v1;
-
- if (efa->v4) {
- v1= addvertlist(efa->v4->co, efa->v4);
- v1->f= efa->v4->f & ~128;
- efa->v4->tmp.v = v1;
- }
-
- /* Needs better adaption of creases? */
- addedgelist(efa->e1->v1->tmp.v,
- efa->e1->v2->tmp.v,
- efa->e1);
- addedgelist(efa->e2->v1->tmp.v,
- efa->e2->v2->tmp.v,
- efa->e2);
- addedgelist(efa->e3->v1->tmp.v,
- efa->e3->v2->tmp.v,
- efa->e3);
- if (efa->e4) addedgelist(efa->e4->v1->tmp.v,
- efa->e4->v2->tmp.v,
- efa->e4);
-
- if(efa->v4) {
- v1 = efa->v1->tmp.v;
- v2 = efa->v2->tmp.v;
- v3 = efa->v3->tmp.v;
- v4 = efa->v4->tmp.v;
- addfacelist(v1, v2, v3, v4, efa,NULL);
- } else {
- v1= efa->v1->tmp.v;
- v2= efa->v2->tmp.v;
- v3= efa->v3->tmp.v;
- addfacelist(v1, v2, v3, 0, efa,NULL);
- }
-
- efa= efa-> next;
- } else {
- efa= efa->next;
- }
- }
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if( (efa->v1->f & 128) && (efa->v2->f & 128) && (efa->v3->f & 128) ) {
- if(efa->v4==NULL || (efa->v4->f & 128)) efa->f |= 128;
- }
- }
-
- delfaceflag(128); // works with face flag now
-
- /* tag all faces for shrink*/
- efa= em->faces.first;
- while (efa) {
- if (faceselectedAND(efa, 1)||allfaces) {
- efa->f1= 2;
- }
- efa= efa->next;
- }
-
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: make edge quads\n");
-#endif
-
- /* find edges that are on each other and make quads between them */
-
- eed= em->edges.first;
- while(eed) {
- eed->f2= eed->f1= 0;
- if ( ((eed->v1->f & eed->v2->f) & 1) || allfaces)
- eed->f1 |= 4; /* original edges */
- eed->tmp.v = 0;
- eed= eed->next;
- }
-
- eed= em->edges.first;
- while (eed) {
- if ( ((eed->f1 & 2)==0) && (eed->f1 & 4) ) {
- eed2= em->edges.first;
- while (eed2) {
- if ( (eed2 != eed) && ((eed2->f1 & 2)==0) && (eed->f1 & 4) ) {
- if (
- (eed->v1 != eed2->v1) &&
- (eed->v1 != eed2->v2) &&
- (eed->v2 != eed2->v1) &&
- (eed->v2 != eed2->v2) && (
- ( VecCompare(eed->v1->co, eed2->v1->co, limit) &&
- VecCompare(eed->v2->co, eed2->v2->co, limit) ) ||
- ( VecCompare(eed->v1->co, eed2->v2->co, limit) &&
- VecCompare(eed->v2->co, eed2->v1->co, limit) ) ) )
- {
-
-#ifdef BEV_DEBUG
- fprintf(stderr, "bevel_mesh: edge quad\n");
-#endif
-
- eed->f1 |= 2; /* these edges are finished */
- eed2->f1 |= 2;
-
- example= NULL;
- efa= em->faces.first; /* search example face (for mat_nr, ME_SMOOTH, ...) */
- while (efa) {
- if ( (efa->e1 == eed) ||
- (efa->e2 == eed) ||
- (efa->e3 == eed) ||
- (efa->e4 && (efa->e4 == eed)) ) {
- example= efa;
- efa= NULL;
- }
- if (efa) efa= efa->next;
- }
-
- neweve[0]= eed->v1; neweve[1]= eed->v2;
- neweve[2]= eed2->v1; neweve[3]= eed2->v2;
-
- if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) {
- efa= NULL;
-
- if (VecCompare(eed->v1->co, eed2->v2->co, limit)) {
- efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], example,NULL);
- } else {
- efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], example,NULL);
- }
-
- if(efa) {
- float inp;
- CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n);
- inp= efa->n[0]*G.vd->viewmat[0][2] + efa->n[1]*G.vd->viewmat[1][2] + efa->n[2]*G.vd->viewmat[2][2];
- if(inp < 0.0) flipface(efa);
-#ifdef BEV_DEBUG
- efa->mat_nr= 1;
-#endif
- } else fprintf(stderr,"bevel_mesh: error creating face\n");
- }
- eed2= NULL;
- }
- }
- if (eed2) eed2= eed2->next;
- }
- }
- eed= eed->next;
- }
-
- eed= em->edges.first;
- while(eed) {
- eed->f2= eed->f1= 0;
- eed->f1= 0;
- eed->v1->f1 &= ~1;
- eed->v2->f1 &= ~1;
- eed->tmp.v = 0;
- eed= eed->next;
- }
-
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: find clusters\n");
-#endif
-
- /* Look for vertex clusters */
-
- eve= em->verts.first;
- while (eve) {
- eve->f &= ~(64|128);
- eve->tmp.v = NULL;
- eve= eve->next;
- }
-
- /* eve->f: 128: first vertex in a list (->tmp.v) */
- /* 64: vertex is in a list */
-
- eve= em->verts.first;
- while (eve) {
- eve2= em->verts.first;
- eve3= NULL;
- while (eve2) {
- if ((eve2 != eve) && ((eve2->f & (64|128))==0)) {
- if (VecCompare(eve->co, eve2->co, limit)) {
- if ((eve->f & (128|64)) == 0) {
- /* fprintf(stderr,"Found vertex cluster:\n *\n *\n"); */
- eve->f |= 128;
- eve->tmp.v = eve2;
- eve3= eve2;
- } else if ((eve->f & 64) == 0) {
- /* fprintf(stderr," *\n"); */
- if (eve3) eve3->tmp.v = eve2;
- eve2->f |= 64;
- eve3= eve2;
- }
- }
- }
- eve2= eve2->next;
- if (!eve2) {
- if (eve3) eve3->tmp.v = NULL;
- }
- }
- eve= eve->next;
- }
-
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: shrink faces\n");
-#endif
-
- bevel_shrink_faces(bsize, 2);
-
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: fill clusters\n");
-#endif
-
- /* Make former vertex clusters faces */
-
- eve= em->verts.first;
- while (eve) {
- eve->f &= ~64;
- eve= eve->next;
- }
-
- eve= em->verts.first;
- while (eve) {
- if (eve->f & 128) {
- eve->f &= ~128;
- a= 0;
- neweve[a]= eve;
- eve2 = eve->tmp.v;
- while (eve2) {
- a++;
- neweve[a]= eve2;
- eve2 = eve2->tmp.v;
- }
- a++;
- efa= NULL;
- if (a>=3) {
- example= NULL;
- efa= em->faces.first; /* search example face */
- while (efa) {
- if ( (efa->v1 == neweve[0]) ||
- (efa->v2 == neweve[0]) ||
- (efa->v3 == neweve[0]) ||
- (efa->v4 && (efa->v4 == neweve[0])) ) {
- example= efa;
- efa= NULL;
- }
- if (efa) efa= efa->next;
- }
-#ifdef BEV_DEBUG
- fprintf(stderr,"bevel_mesh: Making %d-gon\n", a);
-#endif
- if (a>4) {
- cent[0]= cent[1]= cent[2]= 0.0;
- INIT_MINMAX(min, max);
- for (b=0; b<a; b++) {
- VecAddf(cent, cent, neweve[b]->co);
- DO_MINMAX(neweve[b]->co, min, max);
- }
- cent[0]= (min[0]+max[0])/2;
- cent[1]= (min[1]+max[1])/2;
- cent[2]= (min[2]+max[2])/2;
- eve2= addvertlist(cent, NULL);
- eve2->f |= 1;
- eed= em->edges.first;
- while (eed) {
- c= 0;
- for (b=0; b<a; b++)
- if ((neweve[b]==eed->v1) || (neweve[b]==eed->v2)) c++;
- if (c==2) {
- if(exist_face(eed->v1, eed->v2, eve2, 0)==0) {
- efa= addfacelist(eed->v1, eed->v2, eve2, 0, example,NULL);
-#ifdef BEV_DEBUG
- efa->mat_nr= 2;
-#endif
- }
- }
- eed= eed->next;
- }
- } else if (a==4) {
- if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) {
- /* the order of vertices can be anything, three cases to check */
- if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) {
- efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[2]->co, neweve[3]->co, neweve[1]->co) ) {
- efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], NULL, NULL);
- }
- else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) {
- efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL);
- }
- }
- }
- else if (a==3) {
- if(exist_face(neweve[0], neweve[1], neweve[2], 0)==0)
- efa= addfacelist(neweve[0], neweve[1], neweve[2], 0, example, NULL);
- }
- if(efa) {
- float inp;
- CalcNormFloat(neweve[0]->co, neweve[1]->co, neweve[2]->co, efa->n);
- inp= efa->n[0]*G.vd->viewmat[0][2] + efa->n[1]*G.vd->viewmat[1][2] + efa->n[2]*G.vd->viewmat[2][2];
- if(inp < 0.0) flipface(efa);
-#ifdef BEV_DEBUG
- efa->mat_nr= 2;
-#endif
- }
- }
- }
- eve= eve->next;
- }
-
- eve= em->verts.first;
- while (eve) {
- eve->f1= 0;
- eve->f &= ~(128|64);
- eve->tmp.v= NULL;
- eve= eve->next;
- }
-
- recalc_editnormals();
- waitcursor(0);
- countall();
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- removedoublesflag(1, 0, limit);
-
- /* flush selected vertices to edges/faces */
- EM_select_flush();
-
-#undef BEV_DEBUG
-}
-
-static void bevel_mesh_recurs(float bsize, short recurs, int allfaces)
-{
- float d;
- short nr;
-
- d= bsize;
- for (nr=0; nr<recurs; nr++) {
- bevel_mesh(d, allfaces);
- if (nr==0) d /= 3; else d /= 2;
- }
-}
-
-void bevel_menu(void) {
- BME_Mesh *bm;
- BME_TransData_Head *td;
- TransInfo *t;
- int options, res, gbm_free = 0;
-
- t = BIF_GetTransInfo();
- if (!G.editBMesh) {
- G.editBMesh = MEM_callocN(sizeof(*(G.editBMesh)),"bevel_menu() G.editBMesh");
- gbm_free = 1;
- }
-
- G.editBMesh->options = BME_BEVEL_RUNNING | BME_BEVEL_SELECT;
- G.editBMesh->res = 1;
-
- while(G.editBMesh->options & BME_BEVEL_RUNNING) {
- options = G.editBMesh->options;
- res = G.editBMesh->res;
- bm = BME_editmesh_to_bmesh(G.editMesh);
- BIF_undo_push("Pre-Bevel");
- free_editMesh(G.editMesh);
- BME_bevel(bm,0.1f,res,options,0,0,&td);
- BME_bmesh_to_editmesh(bm, td);
- EM_selectmode_flush();
- G.editBMesh->bm = bm;
- G.editBMesh->td = td;
- initTransform(TFM_BEVEL,CTX_BMESH);
- Transform();
- BME_free_transdata(td);
- BME_free_mesh(bm);
- if (t->state != TRANS_CONFIRM) {
- BIF_undo();
- }
- if (options == G.editBMesh->options) {
- G.editBMesh->options &= ~BME_BEVEL_RUNNING;
- }
- }
-
- if (gbm_free) {
- MEM_freeN(G.editBMesh);
- G.editBMesh = NULL;
- }
-}
-
-
-void bevel_menu_old()
-{
- char Finished = 0, Canceled = 0, str[100], Recalc = 0;
- short mval[2], oval[2], curval[2], event = 0, recurs = 1, nr;
- float vec[3], d, drawd=0.0, center[3], fac = 1;
-
- getmouseco_areawin(mval);
- oval[0] = mval[0]; oval[1] = mval[1];
-
- // Silly hackish code to initialise the variable (warning if not done)
- // while still drawing in the first iteration (and without using another variable)
- curval[0] = mval[0] + 1; curval[1] = mval[1] + 1;
-
- // Init grabz for window to vec conversions
- initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
- window_to_3d(center, mval[0], mval[1]);
-
- if(button(&recurs, 1, 4, "Recursion:")==0) return;
-
- for (nr=0; nr<recurs-1; nr++) {
- if (nr==0) fac += 1.0f/3.0f; else fac += 1.0f/(3 * nr * 2.0f);
- }
-
- EM_set_flag_all(SELECT);
-
- SetBlenderCursor(SYSCURSOR);
-
- while (Finished == 0)
- {
- getmouseco_areawin(mval);
- if (mval[0] != curval[0] || mval[1] != curval[1] || (Recalc == 1))
- {
- Recalc = 0;
- curval[0] = mval[0];
- curval[1] = mval[1];
-
- window_to_3d(vec, mval[0]-oval[0], mval[1]-oval[1]);
- d = Normalize(vec) / 10;
-
-
- drawd = d * fac;
- if (G.qual & LR_CTRLKEY)
- drawd = (float) floor(drawd * 10.0f)/10.0f;
- if (G.qual & LR_SHIFTKEY)
- drawd /= 10;
-
- /*------------- Preview lines--------------- */
-
- /* uses callback mechanism to draw it all in current area */
- scrarea_do_windraw(curarea);
-
- /* set window matrix to perspective, default an area returns with buttons transform */
- persp(PERSP_VIEW);
- /* make a copy, for safety */
- glPushMatrix();
- /* multiply with the object transformation */
- mymultmatrix(G.obedit->obmat);
-
- glColor3ub(255, 255, 0);
-
- // PREVIEW CODE GOES HERE
- bevel_shrink_draw(drawd, 2);
-
- /* restore matrix transform */
- glPopMatrix();
-
- sprintf(str, "Bevel Size: %.4f LMB to confirm, RMB to cancel, SPACE to input directly.", drawd);
- headerprint(str);
-
- /* this also verifies other area/windows for clean swap */
- screen_swapbuffers();
-
- persp(PERSP_WIN);
-
- glDrawBuffer(GL_FRONT);
-
- BIF_ThemeColor(TH_WIRE);
-
- setlinestyle(3);
- glBegin(GL_LINE_STRIP);
- glVertex2sv(mval);
- glVertex2sv(oval);
- glEnd();
- setlinestyle(0);
-
- persp(PERSP_VIEW);
- bglFlush(); // flush display for frontbuffer
- glDrawBuffer(GL_BACK);
- }
- while(qtest()) {
- short val=0;
- event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle
-
- /* val==0 on key-release event */
- if(val && (event==ESCKEY || event==RIGHTMOUSE || event==LEFTMOUSE || event==RETKEY || event==ESCKEY)) {
- if (event==RIGHTMOUSE || event==ESCKEY)
- Canceled = 1;
- Finished = 1;
- }
- else if (val && event==SPACEKEY) {
- if (fbutton(&d, 0.000, 10.000, 10, 0, "Width:")!=0) {
- drawd = d * fac;
- Finished = 1;
- }
- }
- else if (val) {
- /* On any other keyboard event, recalc */
- Recalc = 1;
- }
-
- }
- }
- if (Canceled==0) {
- SetBlenderCursor(BC_WAITCURSOR);
- bevel_mesh_recurs(drawd/fac, recurs, 1);
- righthandfaces(1);
- SetBlenderCursor(SYSCURSOR);
- BIF_undo_push("Bevel");
- }
-}
-
-/* *********** END BEVEL *********/
-typedef struct SlideUv {
- float origuv[2];
- float *uv_up, *uv_down;
- //float *fuv[4];
- LinkNode *fuv_list;
-} SlideUv;
-
-typedef struct SlideVert {
- EditEdge *up,*down;
- EditVert origvert;
-} SlideVert;
-
-int EdgeLoopDelete(void) {
-
- /* temporal flag setting so we keep UVs when deleting edge loops,
- * this is a bit of a hack but it works how you would want in almost all cases */
- short uvcalc_flag_orig = G.scene->toolsettings->uvcalc_flag;
- G.scene->toolsettings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
-
- if(!EdgeSlide(1, 1)) {
- return 0;
- }
-
- /* restore uvcalc flag */
- G.scene->toolsettings->uvcalc_flag = uvcalc_flag_orig;
-
- EM_select_more();
- removedoublesflag(1,0, 0.001);
- EM_select_flush();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- return 1;
-}
-
-int EdgeSlide(short immediate, float imperc)
-{
- NumInput num;
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL;
- EditVert *ev, *nearest;
- LinkNode *edgelist = NULL, *vertlist=NULL, *look;
- GHash *vertgh;
-
- SlideVert *tempsv;
- float perc = 0, percp = 0,vertdist, projectMat[4][4], viewMat[4][4];
- float shiftlabda= 0.0f,len = 0.0f;
- int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0;
- int wasshift = 0;
-
- /* UV correction vars */
- GHash **uvarray= NULL;
- int uvlay_tot= CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
- int uvlay_idx;
- SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
- float uv_tmp[2];
- LinkNode *fuv_link;
-
- short event, draw=1;
- short mval[2], mvalo[2];
- char str[128];
- float labda = 0.0f;
-
- initNumInput(&num);
-
- view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat);
-
- mvalo[0] = -1; mvalo[1] = -1;
- numsel =0;
-
- // Get number of selected edges and clear some flags
- for(eed=em->edges.first;eed;eed=eed->next) {
- eed->f1 = 0;
- eed->f2 = 0;
- if(eed->f & SELECT) numsel++;
- }
-
- for(ev=em->verts.first;ev;ev=ev->next) {
- ev->f1 = 0;
- }
-
- //Make sure each edge only has 2 faces
- // make sure loop doesn't cross face
- for(efa=em->faces.first;efa;efa=efa->next) {
- int ct = 0;
- if(efa->e1->f & SELECT) {
- ct++;
- efa->e1->f1++;
- if(efa->e1->f1 > 2) {
- error("3+ face edge");
- return 0;
- }
- }
- if(efa->e2->f & SELECT) {
- ct++;
- efa->e2->f1++;
- if(efa->e2->f1 > 2) {
- error("3+ face edge");
- return 0;
- }
- }
- if(efa->e3->f & SELECT) {
- ct++;
- efa->e3->f1++;
- if(efa->e3->f1 > 2) {
- error("3+ face edge");
- return 0;
- }
- }
- if(efa->e4 && efa->e4->f & SELECT) {
- ct++;
- efa->e4->f1++;
- if(efa->e4->f1 > 2) {
- error("3+ face edge");
- return 0;
- }
- }
- // Make sure loop is not 2 edges of same face
- if(ct > 1) {
- error("loop crosses itself");
- return 0;
- }
- }
- // Get # of selected verts
- for(ev=em->verts.first;ev;ev=ev->next) {
- if(ev->f & SELECT) vertsel++;
- }
-
- // Test for multiple segments
- if(vertsel > numsel+1) {
- error("Was not a single edge loop");
- return 0;
- }
-
- // Get the edgeloop in order - mark f1 with SELECT once added
- for(eed=em->edges.first;eed;eed=eed->next) {
- if((eed->f & SELECT) && !(eed->f1 & SELECT)) {
- // If this is the first edge added, just put it in
- if(!edgelist) {
- BLI_linklist_prepend(&edgelist,eed);
- numadded++;
- first = eed;
- last = eed;
- eed->f1 = SELECT;
- } else {
- if(editedge_getSharedVert(eed, last)) {
- BLI_linklist_append(&edgelist,eed);
- eed->f1 = SELECT;
- numadded++;
- last = eed;
- } else if(editedge_getSharedVert(eed, first)) {
- BLI_linklist_prepend(&edgelist,eed);
- eed->f1 = SELECT;
- numadded++;
- first = eed;
- }
- }
- }
- if(eed->next == NULL && numadded != numsel) {
- eed=em->edges.first;
- timesthrough++;
- }
-
- // It looks like there was an unexpected case - Hopefully should not happen
- if(timesthrough >= numsel*2) {
- BLI_linklist_free(edgelist,NULL);
- error("could not order loop");
- return 0;
- }
- }
-
- // Put the verts in order in a linklist
- look = edgelist;
- while(look) {
- eed = look->link;
- if(!vertlist) {
- if(look->next) {
- temp = look->next->link;
-
- //This is the first entry takes care of extra vert
- if(eed->v1 != temp->v1 && eed->v1 != temp->v2) {
- BLI_linklist_append(&vertlist,eed->v1);
- eed->v1->f1 = 1;
- } else {
- BLI_linklist_append(&vertlist,eed->v2);
- eed->v2->f1 = 1;
- }
- } else {
- //This is the case that we only have 1 edge
- BLI_linklist_append(&vertlist,eed->v1);
- eed->v1->f1 = 1;
- }
- }
- // for all the entries
- if(eed->v1->f1 != 1) {
- BLI_linklist_append(&vertlist,eed->v1);
- eed->v1->f1 = 1;
- } else if(eed->v2->f1 != 1) {
- BLI_linklist_append(&vertlist,eed->v2);
- eed->v2->f1 = 1;
- }
- look = look->next;
- }
-
- // populate the SlideVerts
-
- vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
- look = vertlist;
- while(look) {
- i=0;
- j=0;
- ev = look->link;
- tempsv = (struct SlideVert*)MEM_mallocN(sizeof(struct SlideVert),"SlideVert");
- tempsv->up = NULL;
- tempsv->down = NULL;
- tempsv->origvert.co[0] = ev->co[0];
- tempsv->origvert.co[1] = ev->co[1];
- tempsv->origvert.co[2] = ev->co[2];
- tempsv->origvert.no[0] = ev->no[0];
- tempsv->origvert.no[1] = ev->no[1];
- tempsv->origvert.no[2] = ev->no[2];
- // i is total edges that vert is on
- // j is total selected edges that vert is on
-
- for(eed=em->edges.first;eed;eed=eed->next) {
- if(eed->v1 == ev || eed->v2 == ev) {
- i++;
- if(eed->f & SELECT) {
- j++;
- }
- }
- }
- // If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges
- if(i == 4 && j == 2) {
- for(eed=em->edges.first;eed;eed=eed->next) {
- if(editedge_containsVert(eed, ev)) {
- if(!(eed->f & SELECT)) {
- if(!tempsv->up) {
- tempsv->up = eed;
- } else if (!(tempsv->down)) {
- tempsv->down = eed;
- }
- }
- }
- }
- }
- // If it is on the end of the loop, it touches 1 selected and as least 2 more unselected
- if(i >= 3 && j == 1) {
- for(eed=em->edges.first;eed;eed=eed->next) {
- if(editedge_containsVert(eed, ev) && eed->f & SELECT) {
- for(efa = em->faces.first;efa;efa=efa->next) {
- if(editface_containsEdge(efa, eed)) {
- if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
- if(!tempsv->up) {
- tempsv->up = efa->e1;
- } else if (!(tempsv->down)) {
- tempsv->down = efa->e1;
- }
- }
- if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
- if(!tempsv->up) {
- tempsv->up = efa->e2;
- } else if (!(tempsv->down)) {
- tempsv->down = efa->e2;
- }
- }
- if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
- if(!tempsv->up) {
- tempsv->up = efa->e3;
- } else if (!(tempsv->down)) {
- tempsv->down = efa->e3;
- }
- }
- if(efa->e4) {
- if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
- if(!tempsv->up) {
- tempsv->up = efa->e4;
- } else if (!(tempsv->down)) {
- tempsv->down = efa->e4;
- }
- }
- }
-
- }
- }
- }
- }
- }
- if(i > 4 && j == 2) {
- BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
- BLI_linklist_free(vertlist,NULL);
- BLI_linklist_free(edgelist,NULL);
- return 0;
- }
- BLI_ghash_insert(vertgh,ev,tempsv);
-
- look = look->next;
- }
-
- // make sure the UPs nad DOWNs are 'faceloops'
- // Also find the nearest slidevert to the cursor
- getmouseco_areawin(mval);
- look = vertlist;
- nearest = NULL;
- vertdist = -1;
- while(look) {
- tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
-
- if(!tempsv->up || !tempsv->down) {
- error("Missing rails");
- BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
- BLI_linklist_free(vertlist,NULL);
- BLI_linklist_free(edgelist,NULL);
- return 0;
- }
-
- if(G.f & G_DRAW_EDGELEN) {
- if(!(tempsv->up->f & SELECT)) {
- tempsv->up->f |= SELECT;
- tempsv->up->f2 |= 16;
- } else {
- tempsv->up->f2 |= ~16;
- }
- if(!(tempsv->down->f & SELECT)) {
- tempsv->down->f |= SELECT;
- tempsv->down->f2 |= 16;
- } else {
- tempsv->down->f2 |= ~16;
- }
- }
-
- if(look->next != NULL) {
- SlideVert *sv;
-
- sv = BLI_ghash_lookup(vertgh,(EditVert*)look->next->link);
-
- if(sv) {
- float tempdist, co[2];
-
- if(!sharesFace(tempsv->up,sv->up)) {
- EditEdge *swap;
- swap = sv->up;
- sv->up = sv->down;
- sv->down = swap;
- }
-
- view3d_project_float(curarea, tempsv->origvert.co, co, projectMat);
-
- tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1] - mval[1],2));
-
- if(vertdist < 0) {
- vertdist = tempdist;
- nearest = (EditVert*)look->link;
- } else if ( tempdist < vertdist ) {
- vertdist = tempdist;
- nearest = (EditVert*)look->link;
- }
- }
- }
-
-
-
- look = look->next;
- }
-
-
- if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
- int maxnum = 0;
- uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
- suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */
- suv = NULL;
-
- for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
-
- uvarray[uvlay_idx] = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
-
- for(ev=em->verts.first;ev;ev=ev->next) {
- ev->tmp.l = 0;
- }
- look = vertlist;
- while(look) {
- float *uv_new;
- tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
-
- ev = look->link;
- suv = NULL;
- for(efa = em->faces.first;efa;efa=efa->next) {
- if (ev->tmp.l != -1) { /* test for self, in this case its invalid */
- int k=-1; /* face corner */
-
- /* Is this vert in the faces corner? */
- if (efa->v1==ev) k=0;
- else if (efa->v2==ev) k=1;
- else if (efa->v3==ev) k=2;
- else if (efa->v4 && efa->v4==ev) k=3;
-
- if (k != -1) {
- MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx);
- EditVert *ev_up, *ev_down;
-
- uv_new = tf->uv[k];
-
- if (ev->tmp.l) {
- if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001 || fabs(suv->origuv[1]-uv_new[1])) {
- ev->tmp.l = -1; /* Tag as invalid */
- BLI_linklist_free(suv->fuv_list,NULL);
- suv->fuv_list = NULL;
- BLI_ghash_remove(uvarray[uvlay_idx],ev, NULL, NULL);
- suv = NULL;
- break;
- }
- } else {
- ev->tmp.l = 1;
- suv = suv_last;
-
- suv->fuv_list = NULL;
- suv->uv_up = suv->uv_down = NULL;
- suv->origuv[0] = uv_new[0];
- suv->origuv[1] = uv_new[1];
-
- BLI_linklist_prepend(&suv->fuv_list, uv_new);
- BLI_ghash_insert(uvarray[uvlay_idx],ev,suv);
-
- suv_last++; /* advance to next slide UV */
- maxnum++;
- }
-
- /* Now get the uvs along the up or down edge if we can */
- if (suv) {
- if (!suv->uv_up) {
- ev_up = editedge_getOtherVert(tempsv->up,ev);
- if (efa->v1==ev_up) suv->uv_up = tf->uv[0];
- else if (efa->v2==ev_up) suv->uv_up = tf->uv[1];
- else if (efa->v3==ev_up) suv->uv_up = tf->uv[2];
- else if (efa->v4 && efa->v4==ev_up) suv->uv_up = tf->uv[3];
- }
- if (!suv->uv_down) { /* if the first face was apart of the up edge, it cant be apart of the down edge */
- ev_down = editedge_getOtherVert(tempsv->down,ev);
- if (efa->v1==ev_down) suv->uv_down = tf->uv[0];
- else if (efa->v2==ev_down) suv->uv_down = tf->uv[1];
- else if (efa->v3==ev_down) suv->uv_down = tf->uv[2];
- else if (efa->v4 && efa->v4==ev_down) suv->uv_down = tf->uv[3];
- }
-
- /* Copy the pointers to the face UV's */
- BLI_linklist_prepend(&suv->fuv_list, uv_new);
- }
- }
- }
- }
- look = look->next;
- }
- } /* end uv layer loop */
- } /* end uvlay_tot */
-
-
-
- // we should have enough info now to slide
-
- len = 0.0f;
-
- percp = -1;
- while(draw) {
- /* For the % calculation */
- short mval[2];
- float rc[2];
- float v2[2], v3[2];
- EditVert *centerVert, *upVert, *downVert;
-
- getmouseco_areawin(mval);
-
- if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) {
- PIL_sleep_ms(10);
- } else {
- char *p = str;;
-
- mvalo[0] = mval[0];
- mvalo[1] = mval[1];
-
-
- tempsv = BLI_ghash_lookup(vertgh,nearest);
-
- centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
- upVert = editedge_getOtherVert(tempsv->up, centerVert);
- downVert = editedge_getOtherVert(tempsv->down, centerVert);
-
- view3d_project_float(curarea, upVert->co, v2, projectMat);
- view3d_project_float(curarea, downVert->co, v3, projectMat);
-
- /* Determine the % on which the loop should be cut */
-
- rc[0]= v3[0]-v2[0];
- rc[1]= v3[1]-v2[1];
- len= rc[0]*rc[0]+ rc[1]*rc[1];
- if (len==0) {len = 0.0001;}
-
- if ((G.qual & LR_SHIFTKEY)==0) {
- wasshift = 0;
- labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len;
- }
- else {
- if (wasshift==0) {
- wasshift = 1;
- shiftlabda = labda;
- }
- labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda;
- }
-
-
- if(labda<=0.0) labda=0.0;
- else if(labda>=1.0)labda=1.0;
-
- perc=((1-labda)*2)-1;
-
- if(G.qual == 0) {
- perc *= 100;
- perc = floor(perc);
- perc /= 100;
- } else if (G.qual == LR_CTRLKEY) {
- perc *= 10;
- perc = floor(perc);
- perc /= 10;
- }
-
- if(prop == 0) {
- len = VecLenf(upVert->co,downVert->co)*((perc+1)/2);
- if(flip == 1) {
- len = VecLenf(upVert->co,downVert->co) - len;
- }
- }
-
- if (hasNumInput(&num))
- {
- applyNumInput(&num, &perc);
-
- if (prop)
- {
- perc = MIN2(perc, 1);
- perc = MAX2(perc, -1);
- }
- else
- {
- len = MIN2(perc, VecLenf(upVert->co,downVert->co));
- len = MAX2(len, 0);
- }
- }
-
- //Adjust Edgeloop
- if(immediate) {
- perc = imperc;
- }
- percp = perc;
- if(prop) {
- look = vertlist;
- while(look) {
- EditVert *tempev;
- ev = look->link;
- tempsv = BLI_ghash_lookup(vertgh,ev);
-
- tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
- VecLerpf(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
-
- if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
- for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
- suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
- if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
- Vec2Lerpf(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc));
- fuv_link = suv->fuv_list;
- while (fuv_link) {
- VECCOPY2D(((float *)fuv_link->link), uv_tmp);
- fuv_link = fuv_link->next;
- }
- }
- }
- }
-
- look = look->next;
- }
- }
- else {
- //Non prop code
- look = vertlist;
- while(look) {
- float newlen;
- ev = look->link;
- tempsv = BLI_ghash_lookup(vertgh,ev);
- newlen = (len / VecLenf(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co));
- if(newlen > 1.0) {newlen = 1.0;}
- if(newlen < 0.0) {newlen = 0.0;}
- if(flip == 0) {
- VecLerpf(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
- if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
- /* dont do anything if no UVs */
- for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
- suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
- if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
- Vec2Lerpf(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen));
- fuv_link = suv->fuv_list;
- while (fuv_link) {
- VECCOPY2D(((float *)fuv_link->link), uv_tmp);
- fuv_link = fuv_link->next;
- }
- }
- }
- }
- } else{
- VecLerpf(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
-
- if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
- /* dont do anything if no UVs */
- for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
- suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
- if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
- Vec2Lerpf(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen));
- fuv_link = suv->fuv_list;
- while (fuv_link) {
- VECCOPY2D(((float *)fuv_link->link), uv_tmp);
- fuv_link = fuv_link->next;
- }
- }
- }
- }
- }
- look = look->next;
- }
-
- }
-
- // Highlight the Control Edges
- scrarea_do_windraw(curarea);
- persp(PERSP_VIEW);
- glPushMatrix();
- mymultmatrix(G.obedit->obmat);
-
- glColor3ub(0, 255, 0);
- glBegin(GL_LINES);
- glVertex3fv(upVert->co);
- glVertex3fv(downVert->co);
- glEnd();
-
- if(prop == 0) {
- // draw start edge for non-prop
- glPointSize(5);
- glBegin(GL_POINTS);
- glColor3ub(255,0,255);
- if(flip) {
- glVertex3fv(upVert->co);
- } else {
- glVertex3fv(downVert->co);
- }
- glEnd();
- }
-
-
- glPopMatrix();
-
- if(prop) {
- p += sprintf(str, "(P)ercentage: ");
- } else {
- p += sprintf(str, "Non (P)rop Length: ");
- }
-
- if (hasNumInput(&num))
- {
- char num_str[20];
-
- outputNumInput(&num, num_str);
- p += sprintf(p, "%s", num_str);
- }
- else
- {
- if (prop)
- {
- p += sprintf(p, "%f", perc);
- }
- else
- {
- p += sprintf(p, "%f", len);
- }
- }
-
-
- if (prop == 0) {
- p += sprintf(p, ", Press (F) to flip control side");
- }
-
- headerprint(str);
- screen_swapbuffers();
- }
- if(!immediate) {
- while(qtest()) {
- short val=0;
- event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle
-
- /* val==0 on key-release event */
- if (val) {
- if(ELEM(event, ESCKEY, RIGHTMOUSE)) {
- prop = 1; // Go back to prop mode
- imperc = 0; // This is the % that gets set for immediate
- immediate = 1; //Run through eval code 1 more time
- cancel = 1; // Return -1
- mvalo[0] = -1;
- } else if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)) {
- draw = 0; // End looping now
- } else if(event==MIDDLEMOUSE) {
- perc = 0;
- immediate = 1;
- } else if(event==PKEY) {
- initNumInput(&num); /* reset num input */
- if (prop) {
- prop = 0;
- num.flag |= NUM_NO_NEGATIVE;
- }
- else {
- prop = 1;
- }
- mvalo[0] = -1;
- } else if(event==FKEY) {
- (flip == 1) ? (flip = 0):(flip = 1);
- mvalo[0] = -1;
- } else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges
- look = vertlist;
- while(look) {
- if(nearest == (EditVert*)look->link) {
- if(look->next == NULL) {
- nearest = (EditVert*)vertlist->link;
- } else {
- nearest = (EditVert*)look->next->link;
- }
- mvalo[0] = -1;
- break;
- }
- look = look->next;
- }
- } else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges
- look = vertlist;
- while(look) {
- if(look->next) {
- if(look->next->link == nearest) {
- nearest = (EditVert*)look->link;
- mvalo[0] = -1;
- break;
- }
- } else {
- if((EditVert*)vertlist->link == nearest) {
- nearest = look->link;
- mvalo[0] = -1;
- break;
- }
- }
- look = look->next;
- }
- }
-
- if (handleNumInput(&num, event))
- {
- mvalo[0] = -1; /* NEED A BETTER WAY TO TRIGGER REDRAW */
- }
- }
-
- }
- } else {
- draw = 0;
- }
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
-
-
- if(G.f & G_DRAW_EDGELEN) {
- look = vertlist;
- while(look) {
- tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
- if(tempsv != NULL) {
- tempsv->up->f &= !SELECT;
- tempsv->down->f &= !SELECT;
- }
- look = look->next;
- }
- }
-
- force_draw(0);
-
- if(!immediate)
- EM_automerge(0);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- scrarea_queue_winredraw(curarea);
-
- //BLI_ghash_free(edgesgh, freeGHash, NULL);
- BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
- BLI_linklist_free(vertlist,NULL);
- BLI_linklist_free(edgelist,NULL);
-
- if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
- for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
- BLI_ghash_free(uvarray[uvlay_idx], NULL, NULL);
- }
- MEM_freeN(uvarray);
- MEM_freeN(slideuvs);
-
- suv = suv_last-1;
- while (suv >= slideuvs) {
- if (suv->fuv_list) {
- BLI_linklist_free(suv->fuv_list,NULL);
- }
- suv--;
- }
-
- allqueue(REDRAWIMAGE, 0);
- }
-
- if(cancel == 1) {
- return -1;
- }
- else {
-#ifdef WITH_VERSE
- if(G.editMesh->vnode) {
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
- }
-#endif
- }
- return 1;
-}
-
-/* -------------------- More tools ------------------ */
-
-void mesh_set_face_flags(short mode)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- short m_tex=0, m_tiles=0, m_shared=0,
- m_light=0, m_invis=0, m_collision=0,
- m_twoside=0, m_obcolor=0, m_halo=0,
- m_billboard=0, m_shadow=0, m_text=0,
- m_sort=0;
- short flag = 0, change = 0;
-
- if (!EM_texFaceCheck()) {
- error("not a mesh with uv/image layers");
- return;
- }
-
- add_numbut(0, TOG|SHO, "Texture", 0, 0, &m_tex, NULL);
- add_numbut(1, TOG|SHO, "Tiles", 0, 0, &m_tiles, NULL);
- add_numbut(2, TOG|SHO, "Light", 0, 0, &m_light, NULL);
- add_numbut(3, TOG|SHO, "Invisible", 0, 0, &m_invis, NULL);
- add_numbut(4, TOG|SHO, "Collision", 0, 0, &m_collision, NULL);
- add_numbut(5, TOG|SHO, "Shared", 0, 0, &m_shared, NULL);
- add_numbut(6, TOG|SHO, "Twoside", 0, 0, &m_twoside, NULL);
- add_numbut(7, TOG|SHO, "ObColor", 0, 0, &m_obcolor, NULL);
- add_numbut(8, TOG|SHO, "Halo", 0, 0, &m_halo, NULL);
- add_numbut(9, TOG|SHO, "Billboard", 0, 0, &m_billboard, NULL);
- add_numbut(10, TOG|SHO, "Shadow", 0, 0, &m_shadow, NULL);
- add_numbut(11, TOG|SHO, "Text", 0, 0, &m_text, NULL);
- add_numbut(12, TOG|SHO, "Sort", 0, 0, &m_sort, NULL);
-
- if (!do_clever_numbuts((mode ? "Set Flags" : "Clear Flags"), 13, REDRAW))
- return;
-
- /* these 2 cant both be on */
- if (mode) /* are we seeting*/
- if (m_halo)
- m_billboard = 0;
-
- if (m_tex) flag |= TF_TEX;
- if (m_tiles) flag |= TF_TILES;
- if (m_shared) flag |= TF_SHAREDCOL;
- if (m_light) flag |= TF_LIGHT;
- if (m_invis) flag |= TF_INVISIBLE;
- if (m_collision) flag |= TF_DYNAMIC;
- if (m_twoside) flag |= TF_TWOSIDE;
- if (m_obcolor) flag |= TF_OBCOL;
- if (m_halo) flag |= TF_BILLBOARD;
- if (m_billboard) flag |= TF_BILLBOARD2;
- if (m_shadow) flag |= TF_SHADOW;
- if (m_text) flag |= TF_BMFONT;
- if (m_sort) flag |= TF_ALPHASORT;
-
- if (flag==0)
- return;
-
- efa= em->faces.first;
- while(efa) {
- if(efa->f & SELECT) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (mode) tface->mode |= flag;
- else tface->mode &= ~flag;
- change = 1;
- }
- efa= efa->next;
- }
-
- if (change) {
- BIF_undo_push((mode ? "Set Flags" : "Clear Flags"));
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-void mesh_set_smooth_faces(short event)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- if(G.obedit==0) return;
-
- if(G.obedit->type != OB_MESH) return;
-
- efa= em->faces.first;
- while(efa) {
- if(efa->f & SELECT) {
- if(event==1) efa->flag |= ME_SMOOTH;
- else if(event==0) efa->flag &= ~ME_SMOOTH;
- }
- efa= efa->next;
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-
- if(event==1) BIF_undo_push("Set Smooth");
- else if(event==0) BIF_undo_push("Set Solid");
-}
-
-/* helper to find edge for edge_rip */
-static float mesh_rip_edgedist(float mat[][4], float *co1, float *co2, short *mval)
-{
- float vec1[3], vec2[3], mvalf[2];
-
- view3d_project_float(curarea, co1, vec1, mat);
- view3d_project_float(curarea, co2, vec2, mat);
- mvalf[0]= (float)mval[0];
- mvalf[1]= (float)mval[1];
-
- return PdistVL2Dfl(mvalf, vec1, vec2);
-}
-
-/* helper for below */
-static void mesh_rip_setface(EditFace *sefa)
-{
- /* put new vertices & edges in best face */
- if(sefa->v1->tmp.v) sefa->v1= sefa->v1->tmp.v;
- if(sefa->v2->tmp.v) sefa->v2= sefa->v2->tmp.v;
- if(sefa->v3->tmp.v) sefa->v3= sefa->v3->tmp.v;
- if(sefa->v4 && sefa->v4->tmp.v) sefa->v4= sefa->v4->tmp.v;
-
- sefa->e1= addedgelist(sefa->v1, sefa->v2, sefa->e1);
- sefa->e2= addedgelist(sefa->v2, sefa->v3, sefa->e2);
- if(sefa->v4) {
- sefa->e3= addedgelist(sefa->v3, sefa->v4, sefa->e3);
- sefa->e4= addedgelist(sefa->v4, sefa->v1, sefa->e4);
- }
- else
- sefa->e3= addedgelist(sefa->v3, sefa->v1, sefa->e3);
-
-}
-
-/* based on mouse cursor position, it defines how is being ripped */
-void mesh_rip(void)
-{
- extern void faceloop_select(EditEdge *startedge, int select);
- EditMesh *em = G.editMesh;
- EditVert *eve, *nextve;
- EditEdge *eed, *seed= NULL;
- EditFace *efa, *sefa= NULL;
- float projectMat[4][4], viewMat[4][4], vec[3], dist, mindist;
- short doit= 1, mval[2],propmode,prop;
-
- propmode = G.scene->prop_mode;
- G.scene->prop_mode = 0;
- prop = G.scene->proportional;
- G.scene->proportional = 0;
-
- /* select flush... vertices are important */
- EM_selectmode_set();
-
- getmouseco_areawin(mval);
- view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat);
-
- /* find best face, exclude triangles and break on face select or faces with 2 edges select */
- mindist= 1000000.0f;
- for(efa= em->faces.first; efa; efa=efa->next) {
- if( efa->f & 1)
- break;
- if(efa->v4 && faceselectedOR(efa, SELECT) ) {
- int totsel=0;
-
- if(efa->e1->f & SELECT) totsel++;
- if(efa->e2->f & SELECT) totsel++;
- if(efa->e3->f & SELECT) totsel++;
- if(efa->e4->f & SELECT) totsel++;
-
- if(totsel>1)
- break;
- view3d_project_float(curarea, efa->cent, vec, projectMat);
- dist= sqrt( (vec[0]-mval[0])*(vec[0]-mval[0]) + (vec[1]-mval[1])*(vec[1]-mval[1]) );
- if(dist<mindist) {
- mindist= dist;
- sefa= efa;
- }
- }
- }
-
- if(efa) {
- error("Can't perform ripping with faces selected this way");
- return;
- }
- if(sefa==NULL) {
- error("No proper selection or faces included");
- return;
- }
-
-
- /* duplicate vertices, new vertices get selected */
- for(eve = em->verts.last; eve; eve= eve->prev) {
- eve->tmp.v = NULL;
- if(eve->f & SELECT) {
- eve->tmp.v = addvertlist(eve->co, eve);
- eve->f &= ~SELECT;
- eve->tmp.v->f |= SELECT;
- }
- }
-
- /* find the best candidate edge */
- /* or one of sefa edges is selected... */
- if(sefa->e1->f & SELECT) seed= sefa->e2;
- if(sefa->e2->f & SELECT) seed= sefa->e1;
- if(sefa->e3->f & SELECT) seed= sefa->e2;
- if(sefa->e4 && sefa->e4->f & SELECT) seed= sefa->e3;
-
- /* or we do the distance trick */
- if(seed==NULL) {
- mindist= 1000000.0f;
- if(sefa->e1->v1->tmp.v || sefa->e1->v2->tmp.v) {
- dist = mesh_rip_edgedist(projectMat,
- sefa->e1->v1->co,
- sefa->e1->v2->co, mval);
- if(dist<mindist) {
- seed= sefa->e1;
- mindist= dist;
- }
- }
- if(sefa->e2->v1->tmp.v || sefa->e2->v2->tmp.v) {
- dist = mesh_rip_edgedist(projectMat,
- sefa->e2->v1->co,
- sefa->e2->v2->co, mval);
- if(dist<mindist) {
- seed= sefa->e2;
- mindist= dist;
- }
- }
- if(sefa->e3->v1->tmp.v || sefa->e3->v2->tmp.v) {
- dist= mesh_rip_edgedist(projectMat,
- sefa->e3->v1->co,
- sefa->e3->v2->co, mval);
- if(dist<mindist) {
- seed= sefa->e3;
- mindist= dist;
- }
- }
- if(sefa->e4 && (sefa->e4->v1->tmp.v || sefa->e4->v2->tmp.v)) {
- dist= mesh_rip_edgedist(projectMat,
- sefa->e4->v1->co,
- sefa->e4->v2->co, mval);
- if(dist<mindist) {
- seed= sefa->e4;
- mindist= dist;
- }
- }
- }
-
- if(seed==NULL) { // never happens?
- error("No proper edge found to start");
- return;
- }
-
- faceloop_select(seed, 2); // tmp abuse for finding all edges that need duplicated, returns OK faces with f1
-
- /* duplicate edges in the loop, with at least 1 vertex selected, needed for selection flip */
- for(eed = em->edges.last; eed; eed= eed->prev) {
- eed->tmp.v = NULL;
- if((eed->v1->tmp.v) || (eed->v2->tmp.v)) {
- EditEdge *newed;
-
- newed= addedgelist(eed->v1->tmp.v?eed->v1->tmp.v:eed->v1,
- eed->v2->tmp.v?eed->v2->tmp.v:eed->v2, eed);
- if(eed->f & SELECT) {
- eed->f &= ~SELECT;
- newed->f |= SELECT;
- }
- eed->tmp.v = (EditVert *)newed;
- }
- }
-
- /* first clear edges to help finding neighbours */
- for(eed = em->edges.last; eed; eed= eed->prev) eed->f1= 0;
-
- /* put new vertices & edges && flag in best face */
- mesh_rip_setface(sefa);
-
- /* starting with neighbours of best face, we loop over the seam */
- sefa->f1= 2;
- doit= 1;
- while(doit) {
- doit= 0;
-
- for(efa= em->faces.first; efa; efa=efa->next) {
- /* new vert in face */
- if (efa->v1->tmp.v || efa->v2->tmp.v ||
- efa->v3->tmp.v || (efa->v4 && efa->v4->tmp.v)) {
- /* face is tagged with loop */
- if(efa->f1==1) {
- mesh_rip_setface(efa);
- efa->f1= 2;
- doit= 1;
- }
- }
- }
- }
-
- /* remove loose edges, that were part of a ripped face */
- for(eve = em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(eed = em->edges.last; eed; eed= eed->prev) eed->f1= 0;
- for(efa= em->faces.first; efa; efa=efa->next) {
- efa->e1->f1= 1;
- efa->e2->f1= 1;
- efa->e3->f1= 1;
- if(efa->e4) efa->e4->f1= 1;
- }
-
- for(eed = em->edges.last; eed; eed= seed) {
- seed= eed->prev;
- if(eed->f1==0) {
- if(eed->v1->tmp.v || eed->v2->tmp.v ||
- (eed->v1->f & SELECT) || (eed->v2->f & SELECT)) {
- remedge(eed);
- free_editedge(eed);
- eed= NULL;
- }
- }
- if(eed) {
- eed->v1->f1= 1;
- eed->v2->f1= 1;
- }
- }
-
- /* and remove loose selected vertices, that got duplicated accidentally */
- for(eve = em->verts.first; eve; eve= nextve) {
- nextve= eve->next;
- if(eve->f1==0 && (eve->tmp.v || (eve->f & SELECT))) {
- BLI_remlink(&em->verts,eve);
- free_editvert(eve);
- }
- }
-
- countall(); // apparently always needed when adding stuff, derived mesh
-
-#ifdef WITH_VERSE
- if(G.editMesh->vnode) {
- sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
- sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
- }
-#endif
-
- BIF_TransformSetUndo("Rip");
- initTransform(TFM_TRANSLATION, 0);
- Transform();
-
- G.scene->prop_mode = propmode;
- G.scene->proportional = prop;
-}
-
-void shape_propagate(){
- EditMesh *em = G.editMesh;
- EditVert *ev = NULL;
- Mesh* me = (Mesh*)G.obedit->data;
- Key* ky = NULL;
- KeyBlock* kb = NULL;
- Base* base=NULL;
-
-
- if(me->key){
- ky = me->key;
- } else {
- error("Object Has No Key");
- return;
- }
-
- if(ky->block.first){
- for(ev = em->verts.first; ev ; ev = ev->next){
- if(ev->f & SELECT){
- for(kb=ky->block.first;kb;kb = kb->next){
- float *data;
- data = kb->data;
- VECCOPY(data+(ev->keyindex*3),ev->co);
- }
- }
- }
- } else {
- error("Object Has No Blendshapes");
- return;
- }
-
- //TAG Mesh Objects that share this data
- for(base = G.scene->base.first; base; base = base->next){
- if(base->object && base->object->data == me){
- base->object->recalc = OB_RECALC_DATA;
- }
- }
-
- BIF_undo_push("Propagate Blendshape Verts");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- return;
-}
-
-void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock)
-{
- EditMesh *em = G.editMesh;
- EditVert *ev = NULL;
- short mval[2], curval[2], event = 0, finished = 0, canceled = 0, fullcopy=0 ;
- float perc = 0;
- char str[64];
- float *data, *odata;
-
- data = fromBlock->data;
- odata = thisBlock->data;
-
- getmouseco_areawin(mval);
- curval[0] = mval[0] + 1; curval[1] = mval[1] + 1;
-
- while (finished == 0)
- {
- getmouseco_areawin(mval);
- if (mval[0] != curval[0] || mval[1] != curval[1])
- {
-
- if(mval[0] > curval[0])
- perc += 0.1;
- else if(mval[0] < curval[0])
- perc -= 0.1;
-
- if(perc < 0) perc = 0;
- if(perc > 1) perc = 1;
-
- curval[0] = mval[0];
- curval[1] = mval[1];
-
- if(fullcopy == 1){
- perc = 1;
- }
-
- for(ev = em->verts.first; ev ; ev = ev->next){
- if(ev->f & SELECT){
- VecLerpf(ev->co,odata+(ev->keyindex*3),data+(ev->keyindex*3),perc);
- }
- }
- sprintf(str,"Blending at %d%c MMB to Copy at 100%c",(int)(perc*100),'%','%');
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- headerprint(str);
- force_draw(0);
-
- if(fullcopy == 1){
- break;
- }
-
- } else {
- PIL_sleep_ms(10);
- }
-
- while(qtest()) {
- short val=0;
- event= extern_qread(&val);
- if(val){
- if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)){
- finished = 1;
- }
- else if (event == MIDDLEMOUSE){
- fullcopy = 1;
- }
- else if (ELEM3(event,ESCKEY,RIGHTMOUSE,RIGHTMOUSE)){
- canceled = 1;
- finished = 1;
- }
- }
- }
- }
- if(!canceled)
- BIF_undo_push("Copy Blendshape Verts");
- else
- for(ev = em->verts.first; ev ; ev = ev->next){
- if(ev->f & SELECT){
- VECCOPY(ev->co, odata+(ev->keyindex*3));
- }
- }
- return;
-}
-
-
-
-void shape_copy_select_from()
-{
- Mesh* me = (Mesh*)G.obedit->data;
- EditMesh *em = G.editMesh;
- EditVert *ev = NULL;
- int totverts = 0,curshape = G.obedit->shapenr;
-
- Key* ky = NULL;
- KeyBlock *kb = NULL,*thisBlock = NULL;
- int maxlen=32, nr=0, a=0;
- char *menu;
-
- if(me->key){
- ky = me->key;
- } else {
- error("Object Has No Key");
- return;
- }
-
- if(ky->block.first){
- for(kb=ky->block.first;kb;kb = kb->next){
- maxlen += 40; // Size of a block name
- if(a == curshape-1){
- thisBlock = kb;
- }
-
- a++;
- }
- a=0;
- menu = MEM_callocN(maxlen, "Copy Shape Menu Text");
- strcpy(menu, "Copy Vert Positions from Shape %t|");
- for(kb=ky->block.first;kb;kb = kb->next){
- if(a != curshape-1){
- sprintf(menu,"%s %s %cx%d|",menu,kb->name,'%',a);
- }
- a++;
- }
- nr = pupmenu_col(menu, 20);
- MEM_freeN(menu);
- } else {
- error("Object Has No Blendshapes");
- return;
- }
-
- a = 0;
-
- for(kb=ky->block.first;kb;kb = kb->next){
- if(a == nr){
-
- for(ev = em->verts.first;ev;ev = ev->next){
- totverts++;
- }
-
- if(me->totvert != totverts){
- error("Shape Has had Verts Added/Removed, please cycle editmode before copying");
- return;
- }
- shape_copy_from_lerp(thisBlock,kb);
-
- return;
- }
- a++;
- }
- return;
-}
-
-/* Collection Routines|Currently used by the improved merge code*/
-/* buildEdge_collection() creates a list of lists*/
-/* these lists are filled with edges that are topologically connected.*/
-/* This whole tool needs to be redone, its rather poorly implemented...*/
-
-typedef struct Collection{
- struct Collection *next, *prev;
- int index;
- ListBase collectionbase;
-} Collection;
-
-typedef struct CollectedEdge{
- struct CollectedEdge *next, *prev;
- EditEdge *eed;
-} CollectedEdge;
-
-#define MERGELIMIT 0.000001
-
-static void build_edgecollection(ListBase *allcollections)
-{
- EditEdge *eed;
- Collection *edgecollection, *newcollection;
- CollectedEdge *newedge;
-
- int currtag = 1;
- short ebalanced = 0;
- short collectionfound = 0;
-
- for (eed=G.editMesh->edges.first; eed; eed = eed->next){
- eed->tmp.l = 0;
- eed->v1->tmp.l = 0;
- eed->v2->tmp.l = 0;
- }
-
- /*1st pass*/
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(eed->f&SELECT){
- eed->v1->tmp.l = currtag;
- eed->v2->tmp.l = currtag;
- currtag +=1;
- }
- }
-
- /*2nd pass - Brute force. Loop through selected faces until there are no 'unbalanced' edges left (those with both vertices 'tmp.l' tag matching */
- while(ebalanced == 0){
- ebalanced = 1;
- for(eed=G.editMesh->edges.first; eed; eed = eed->next){
- if(eed->f&SELECT){
- if(eed->v1->tmp.l != eed->v2->tmp.l) /*unbalanced*/{
- if(eed->v1->tmp.l > eed->v2->tmp.l && eed->v2->tmp.l !=0) eed->v1->tmp.l = eed->v2->tmp.l;
- else if(eed->v1 != 0) eed->v2->tmp.l = eed->v1->tmp.l;
- ebalanced = 0;
- }
- }
- }
- }
-
- /*3rd pass, set all the edge flags (unnessecary?)*/
- for(eed=G.editMesh->edges.first; eed; eed = eed->next){
- if(eed->f&SELECT) eed->tmp.l = eed->v1->tmp.l;
- }
-
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(eed->f&SELECT){
- if(allcollections->first){
- for(edgecollection = allcollections->first; edgecollection; edgecollection=edgecollection->next){
- if(edgecollection->index == eed->tmp.l){
- newedge = MEM_mallocN(sizeof(CollectedEdge), "collected edge");
- newedge->eed = eed;
- BLI_addtail(&(edgecollection->collectionbase), newedge);
- collectionfound = 1;
- break;
- }
- else collectionfound = 0;
- }
- }
- if(allcollections->first == NULL || collectionfound == 0){
- newcollection = MEM_mallocN(sizeof(Collection), "element collection");
- newcollection->index = eed->tmp.l;
- newcollection->collectionbase.first = 0;
- newcollection->collectionbase.last = 0;
-
- newedge = MEM_mallocN(sizeof(CollectedEdge), "collected edge");
- newedge->eed = eed;
-
- BLI_addtail(&(newcollection->collectionbase), newedge);
- BLI_addtail(allcollections, newcollection);
- }
- }
-
- }
-}
-
-static void freecollections(ListBase *allcollections)
-{
- struct Collection *curcollection;
-
- for(curcollection = allcollections->first; curcollection; curcollection = curcollection->next)
- BLI_freelistN(&(curcollection->collectionbase));
- BLI_freelistN(allcollections);
-}
-
-/*Begin UV Edge Collapse Code
- Like Edge subdivide, Edge Collapse should handle UV's intelligently, but since UV's are a per-face attribute, normal edge collapse will fail
- in areas such as the boundries of 'UV islands'. So for each edge collection we need to build a set of 'welded' UV vertices and edges for it.
- The welded UV edges can then be sorted and collapsed.
-*/
-typedef struct wUV{
- struct wUV *next, *prev;
- ListBase nodes;
- float u, v; /*cached copy of UV coordinates pointed to by nodes*/
- EditVert *eve;
- int f;
-} wUV;
-
-typedef struct wUVNode{
- struct wUVNode *next, *prev;
- float *u; /*pointer to original tface data*/
- float *v; /*pointer to original tface data*/
-} wUVNode;
-
-typedef struct wUVEdge{
- struct wUVEdge *next, *prev;
- float v1uv[2], v2uv[2]; /*nasty.*/
- struct wUV *v1, *v2; /*oriented same as editedge*/
- EditEdge *eed;
- int f;
-} wUVEdge;
-
-typedef struct wUVEdgeCollect{ /*used for grouping*/
- struct wUVEdgeCollect *next, *prev;
- wUVEdge *uved;
- int id;
-} wUVEdgeCollect;
-
-static void append_weldedUV(EditFace *efa, EditVert *eve, int tfindex, ListBase *uvverts)
-{
- wUV *curwvert, *newwvert;
- wUVNode *newnode;
- int found;
- MTFace *tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
-
- found = 0;
-
- for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){
- if(curwvert->eve == eve && curwvert->u == tf->uv[tfindex][0] && curwvert->v == tf->uv[tfindex][1]){
- newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node");
- newnode->u = &(tf->uv[tfindex][0]);
- newnode->v = &(tf->uv[tfindex][1]);
- BLI_addtail(&(curwvert->nodes), newnode);
- found = 1;
- break;
- }
- }
-
- if(!found){
- newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node");
- newnode->u = &(tf->uv[tfindex][0]);
- newnode->v = &(tf->uv[tfindex][1]);
-
- newwvert = MEM_callocN(sizeof(wUV), "Welded UV Vert");
- newwvert->u = *(newnode->u);
- newwvert->v = *(newnode->v);
- newwvert->eve = eve;
-
- BLI_addtail(&(newwvert->nodes), newnode);
- BLI_addtail(uvverts, newwvert);
-
- }
-}
-
-static void build_weldedUVs(ListBase *uvverts)
-{
- EditFace *efa;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- if(efa->v1->f1) append_weldedUV(efa, efa->v1, 0, uvverts);
- if(efa->v2->f1) append_weldedUV(efa, efa->v2, 1, uvverts);
- if(efa->v3->f1) append_weldedUV(efa, efa->v3, 2, uvverts);
- if(efa->v4 && efa->v4->f1) append_weldedUV(efa, efa->v4, 3, uvverts);
- }
-}
-
-static void append_weldedUVEdge(EditFace *efa, EditEdge *eed, ListBase *uvedges)
-{
- wUVEdge *curwedge, *newwedge;
- int v1tfindex, v2tfindex, found;
- MTFace *tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
-
- found = 0;
-
- if(eed->v1 == efa->v1) v1tfindex = 0;
- else if(eed->v1 == efa->v2) v1tfindex = 1;
- else if(eed->v1 == efa->v3) v1tfindex = 2;
- else /* if(eed->v1 == efa->v4) */ v1tfindex = 3;
-
- if(eed->v2 == efa->v1) v2tfindex = 0;
- else if(eed->v2 == efa->v2) v2tfindex = 1;
- else if(eed->v2 == efa->v3) v2tfindex = 2;
- else /* if(eed->v2 == efa->v4) */ v2tfindex = 3;
-
- for(curwedge=uvedges->first; curwedge; curwedge=curwedge->next){
- if(curwedge->eed == eed && curwedge->v1uv[0] == tf->uv[v1tfindex][0] && curwedge->v1uv[1] == tf->uv[v1tfindex][1] && curwedge->v2uv[0] == tf->uv[v2tfindex][0] && curwedge->v2uv[1] == tf->uv[v2tfindex][1]){
- found = 1;
- break; //do nothing, we don't need another welded uv edge
- }
- }
-
- if(!found){
- newwedge = MEM_callocN(sizeof(wUVEdge), "Welded UV Edge");
- newwedge->v1uv[0] = tf->uv[v1tfindex][0];
- newwedge->v1uv[1] = tf->uv[v1tfindex][1];
- newwedge->v2uv[0] = tf->uv[v2tfindex][0];
- newwedge->v2uv[1] = tf->uv[v2tfindex][1];
- newwedge->eed = eed;
-
- BLI_addtail(uvedges, newwedge);
- }
-}
-
-static void build_weldedUVEdges(ListBase *uvedges, ListBase *uvverts)
-{
- wUV *curwvert;
- wUVEdge *curwedge;
- EditFace *efa;
-
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- if(efa->e1->f1) append_weldedUVEdge(efa, efa->e1, uvedges);
- if(efa->e2->f1) append_weldedUVEdge(efa, efa->e2, uvedges);
- if(efa->e3->f1) append_weldedUVEdge(efa, efa->e3, uvedges);
- if(efa->e4 && efa->e4->f1) append_weldedUVEdge(efa, efa->e4, uvedges);
- }
-
-
- //link vertices: for each uvedge, search uvverts to populate v1 and v2 pointers
- for(curwedge=uvedges->first; curwedge; curwedge=curwedge->next){
- for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){
- if(curwedge->eed->v1 == curwvert->eve && curwedge->v1uv[0] == curwvert->u && curwedge->v1uv[1] == curwvert->v){
- curwedge->v1 = curwvert;
- break;
- }
- }
- for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){
- if(curwedge->eed->v2 == curwvert->eve && curwedge->v2uv[0] == curwvert->u && curwedge->v2uv[1] == curwvert->v){
- curwedge->v2 = curwvert;
- break;
- }
- }
- }
-}
-
-static void free_weldedUVs(ListBase *uvverts)
-{
- wUV *curwvert;
- for(curwvert = uvverts->first; curwvert; curwvert=curwvert->next) BLI_freelistN(&(curwvert->nodes));
- BLI_freelistN(uvverts);
-}
-
-static void collapse_edgeuvs(void)
-{
- ListBase uvedges, uvverts, allcollections;
- wUVEdge *curwedge;
- wUVNode *curwnode;
- wUVEdgeCollect *collectedwuve, *newcollectedwuve;
- Collection *wuvecollection, *newcollection;
- int curtag, balanced, collectionfound= 0, vcount;
- float avg[2];
-
- if (!EM_texFaceCheck())
- return;
-
- uvverts.first = uvverts.last = uvedges.first = uvedges.last = allcollections.first = allcollections.last = NULL;
-
- build_weldedUVs(&uvverts);
- build_weldedUVEdges(&uvedges, &uvverts);
-
- curtag = 0;
-
- for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){
- curwedge->v1->f = curtag;
- curwedge->v2->f = curtag;
- curtag +=1;
- }
-
- balanced = 0;
- while(!balanced){
- balanced = 1;
- for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){
- if(curwedge->v1->f != curwedge->v2->f){
- if(curwedge->v1->f > curwedge->v2->f) curwedge->v1->f = curwedge->v2->f;
- else curwedge->v2->f = curwedge->v1->f;
- balanced = 0;
- }
- }
- }
-
- for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next) curwedge->f = curwedge->v1->f;
-
-
- for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){
- if(allcollections.first){
- for(wuvecollection = allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){
- if(wuvecollection->index == curwedge->f){
- newcollectedwuve = MEM_callocN(sizeof(wUVEdgeCollect), "Collected Welded UV Edge");
- newcollectedwuve->uved = curwedge;
- BLI_addtail(&(wuvecollection->collectionbase), newcollectedwuve);
- collectionfound = 1;
- break;
- }
-
- else collectionfound = 0;
- }
- }
- if(allcollections.first == NULL || collectionfound == 0){
- newcollection = MEM_callocN(sizeof(Collection), "element collection");
- newcollection->index = curwedge->f;
- newcollection->collectionbase.first = 0;
- newcollection->collectionbase.last = 0;
-
- newcollectedwuve = MEM_callocN(sizeof(wUVEdgeCollect), "Collected Welded UV Edge");
- newcollectedwuve->uved = curwedge;
-
- BLI_addtail(&(newcollection->collectionbase), newcollectedwuve);
- BLI_addtail(&allcollections, newcollection);
- }
- }
-
- for(wuvecollection=allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){
-
- vcount = avg[0] = avg[1] = 0;
-
- for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){
- avg[0] += collectedwuve->uved->v1uv[0];
- avg[1] += collectedwuve->uved->v1uv[1];
-
- avg[0] += collectedwuve->uved->v2uv[0];
- avg[1] += collectedwuve->uved->v2uv[1];
-
- vcount +=2;
-
- }
-
- avg[0] /= vcount; avg[1] /= vcount;
-
- for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){
- for(curwnode=collectedwuve->uved->v1->nodes.first; curwnode; curwnode=curwnode->next){
- *(curwnode->u) = avg[0];
- *(curwnode->v) = avg[1];
- }
- for(curwnode=collectedwuve->uved->v2->nodes.first; curwnode; curwnode=curwnode->next){
- *(curwnode->u) = avg[0];
- *(curwnode->v) = avg[1];
- }
- }
- }
-
- free_weldedUVs(&uvverts);
- BLI_freelistN(&uvedges);
- freecollections(&allcollections);
-}
-
-/*End UV Edge collapse code*/
-
-static void collapseuvs(EditVert *mergevert)
-{
- EditFace *efa;
- MTFace *tf;
- int uvcount;
- float uvav[2];
-
- if (!EM_texFaceCheck())
- return;
-
- uvcount = 0;
- uvav[0] = 0;
- uvav[1] = 0;
-
- for(efa = G.editMesh->faces.first; efa; efa=efa->next){
- tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
-
- if(efa->v1->f1 && ELEM(mergevert, NULL, efa->v1)) {
- uvav[0] += tf->uv[0][0];
- uvav[1] += tf->uv[0][1];
- uvcount += 1;
- }
- if(efa->v2->f1 && ELEM(mergevert, NULL, efa->v2)){
- uvav[0] += tf->uv[1][0];
- uvav[1] += tf->uv[1][1];
- uvcount += 1;
- }
- if(efa->v3->f1 && ELEM(mergevert, NULL, efa->v3)){
- uvav[0] += tf->uv[2][0];
- uvav[1] += tf->uv[2][1];
- uvcount += 1;
- }
- if(efa->v4 && efa->v4->f1 && ELEM(mergevert, NULL, efa->v4)){
- uvav[0] += tf->uv[3][0];
- uvav[1] += tf->uv[3][1];
- uvcount += 1;
- }
- }
-
- if(uvcount > 0) {
- uvav[0] /= uvcount;
- uvav[1] /= uvcount;
-
- for(efa = G.editMesh->faces.first; efa; efa=efa->next){
- tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
-
- if(efa->v1->f1){
- tf->uv[0][0] = uvav[0];
- tf->uv[0][1] = uvav[1];
- }
- if(efa->v2->f1){
- tf->uv[1][0] = uvav[0];
- tf->uv[1][1] = uvav[1];
- }
- if(efa->v3->f1){
- tf->uv[2][0] = uvav[0];
- tf->uv[2][1] = uvav[1];
- }
- if(efa->v4 && efa->v4->f1){
- tf->uv[3][0] = uvav[0];
- tf->uv[3][1] = uvav[1];
- }
- }
- }
-}
-
-int collapseEdges(void)
-{
- EditVert *eve;
- EditEdge *eed;
-
- ListBase allcollections;
- CollectedEdge *curredge;
- Collection *edgecollection;
-
- int totedges, groupcount, mergecount,vcount;
- float avgcount[3];
-
- allcollections.first = 0;
- allcollections.last = 0;
-
- mergecount = 0;
-
- if(multires_test()) return 0;
-
- build_edgecollection(&allcollections);
- groupcount = BLI_countlist(&allcollections);
-
-
- for(edgecollection = allcollections.first; edgecollection; edgecollection = edgecollection->next){
- totedges = BLI_countlist(&(edgecollection->collectionbase));
- mergecount += totedges;
- avgcount[0] = 0; avgcount[1] = 0; avgcount[2] = 0;
-
- vcount = 0;
-
- for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){
- avgcount[0] += ((EditEdge*)curredge->eed)->v1->co[0];
- avgcount[1] += ((EditEdge*)curredge->eed)->v1->co[1];
- avgcount[2] += ((EditEdge*)curredge->eed)->v1->co[2];
-
- avgcount[0] += ((EditEdge*)curredge->eed)->v2->co[0];
- avgcount[1] += ((EditEdge*)curredge->eed)->v2->co[1];
- avgcount[2] += ((EditEdge*)curredge->eed)->v2->co[2];
-
- vcount +=2;
- }
-
- avgcount[0] /= vcount; avgcount[1] /=vcount; avgcount[2] /= vcount;
-
- for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){
- VECCOPY(((EditEdge*)curredge->eed)->v1->co,avgcount);
- VECCOPY(((EditEdge*)curredge->eed)->v2->co,avgcount);
- }
-
- if (EM_texFaceCheck()) {
- /*uv collapse*/
- for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0;
- for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0;
- for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){
- curredge->eed->v1->f1 = 1;
- curredge->eed->v2->f1 = 1;
- curredge->eed->f1 = 1;
- }
- collapse_edgeuvs();
- }
-
- }
- freecollections(&allcollections);
- removedoublesflag(1, 0, MERGELIMIT);
- /*get rid of this!*/
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- return mergecount;
-}
-
-int merge_firstlast(int first, int uvmerge)
-{
- EditVert *eve,*mergevert;
- EditSelection *ese;
-
- if(multires_test()) return 0;
-
- /* do sanity check in mergemenu in edit.c ?*/
- if(first == 0){
- ese = G.editMesh->selected.last;
- mergevert= (EditVert*)ese->data;
- }
- else{
- ese = G.editMesh->selected.first;
- mergevert = (EditVert*)ese->data;
- }
-
- if(mergevert->f&SELECT){
- for (eve=G.editMesh->verts.first; eve; eve=eve->next){
- if (eve->f&SELECT)
- VECCOPY(eve->co,mergevert->co);
- }
- }
-
- if(uvmerge && CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)){
-
- for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0;
- for(eve=G.editMesh->verts.first; eve; eve=eve->next){
- if(eve->f&SELECT) eve->f1 = 1;
- }
- collapseuvs(mergevert);
- }
-
- countall();
- return removedoublesflag(1, 0, MERGELIMIT);
-}
-
-int merge_target(int target, int uvmerge)
-{
- EditVert *eve;
-
- if(multires_test()) return 0;
-
- if(target) snap_sel_to_curs();
- else snap_to_center();
-
- if(uvmerge && CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)){
- for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0;
- for(eve=G.editMesh->verts.first; eve; eve=eve->next){
- if(eve->f&SELECT) eve->f1 = 1;
- }
- collapseuvs(NULL);
- }
-
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- return removedoublesflag(1, 0, MERGELIMIT);
-
-}
-#undef MERGELIMIT
-
-typedef struct PathNode{
- int u;
- int visited;
- ListBase edges;
-} PathNode;
-
-typedef struct PathEdge{
- struct PathEdge *next, *prev;
- int v;
- float w;
-} PathEdge;
-
-void pathselect(void)
-{
- EditVert *eve, *s, *t;
- EditEdge *eed;
- EditSelection *ese;
- PathEdge *newpe, *currpe;
- PathNode *currpn;
- PathNode *Q;
- int v, *previous, pathvert, pnindex; /*pnindex redundant?*/
- int unbalanced, totnodes;
- short physical;
- float *cost;
- Heap *heap; /*binary heap for sorting pointers to PathNodes based upon a 'cost'*/
-
- s = t = NULL;
-
- countall(); /*paranoid?*/
-
- ese = ((EditSelection*)G.editMesh->selected.last);
- if(ese && ese->type == EDITVERT && ese->prev && ese->prev->type == EDITVERT){
- physical= pupmenu("Distance Method? %t|Edge Length%x1|Topological%x0");
-
- t = (EditVert*)ese->data;
- s = (EditVert*)ese->prev->data;
-
- /*need to find out if t is actually reachable by s....*/
- for(eve=G.editMesh->verts.first; eve; eve=eve->next){
- eve->f1 = 0;
- }
-
- s->f1 = 1;
-
- unbalanced = 1;
- totnodes = 1;
- while(unbalanced){
- unbalanced = 0;
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(!eed->h){
- if(eed->v1->f1 && !eed->v2->f1){
- eed->v2->f1 = 1;
- totnodes++;
- unbalanced = 1;
- }
- else if(eed->v2->f1 && !eed->v1->f1){
- eed->v1->f1 = 1;
- totnodes++;
- unbalanced = 1;
- }
- }
- }
- }
-
-
-
- if(s->f1 && t->f1){ /*t can be reached by s*/
- Q = MEM_callocN(sizeof(PathNode)*totnodes, "Path Select Nodes");
- totnodes = 0;
- for(eve=G.editMesh->verts.first; eve; eve=eve->next){
- if(eve->f1){
- Q[totnodes].u = totnodes;
- Q[totnodes].edges.first = 0;
- Q[totnodes].edges.last = 0;
- Q[totnodes].visited = 0;
- eve->tmp.p = &(Q[totnodes]);
- totnodes++;
- }
- else eve->tmp.p = NULL;
- }
-
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(!eed->h){
- if(eed->v1->f1){
- currpn = ((PathNode*)eed->v1->tmp.p);
-
- newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge");
- newpe->v = ((PathNode*)eed->v2->tmp.p)->u;
- if(physical){
- newpe->w = VecLenf(eed->v1->co, eed->v2->co);
- }
- else newpe->w = 1;
- newpe->next = 0;
- newpe->prev = 0;
- BLI_addtail(&(currpn->edges), newpe);
- }
- if(eed->v2->f1){
- currpn = ((PathNode*)eed->v2->tmp.p);
- newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge");
- newpe->v = ((PathNode*)eed->v1->tmp.p)->u;
- if(physical){
- newpe->w = VecLenf(eed->v1->co, eed->v2->co);
- }
- else newpe->w = 1;
- newpe->next = 0;
- newpe->prev = 0;
- BLI_addtail(&(currpn->edges), newpe);
- }
- }
- }
-
- heap = BLI_heap_new();
- cost = MEM_callocN(sizeof(float)*totnodes, "Path Select Costs");
- previous = MEM_callocN(sizeof(int)*totnodes, "PathNode indices");
-
- for(v=0; v < totnodes; v++){
- cost[v] = 1000000;
- previous[v] = -1; /*array of indices*/
- }
-
- pnindex = ((PathNode*)s->tmp.p)->u;
- cost[pnindex] = 0;
- BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(pnindex));
-
- while( !BLI_heap_empty(heap) ){
-
- pnindex = GET_INT_FROM_POINTER(BLI_heap_popmin(heap));
- currpn = &(Q[pnindex]);
-
- if(currpn == (PathNode*)t->tmp.p) /*target has been reached....*/
- break;
-
- for(currpe=currpn->edges.first; currpe; currpe=currpe->next){
- if(!Q[currpe->v].visited){
- if( cost[currpe->v] > (cost[currpn->u ] + currpe->w) ){
- cost[currpe->v] = cost[currpn->u] + currpe->w;
- previous[currpe->v] = currpn->u;
- Q[currpe->v].visited = 1;
- BLI_heap_insert(heap, cost[currpe->v], SET_INT_IN_POINTER(currpe->v));
- }
- }
- }
- }
-
- pathvert = ((PathNode*)t->tmp.p)->u;
- while(pathvert != -1){
- for(eve=G.editMesh->verts.first; eve; eve=eve->next){
- if(eve->f1){
- if( ((PathNode*)eve->tmp.p)->u == pathvert) eve->f |= SELECT;
- }
- }
- pathvert = previous[pathvert];
- }
-
- for(v=0; v < totnodes; v++) BLI_freelistN(&(Q[v].edges));
- MEM_freeN(Q);
- MEM_freeN(cost);
- MEM_freeN(previous);
- BLI_heap_free(heap, NULL);
- EM_select_flush();
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- }
- }
- else{
- error("Path Selection requires that exactly two vertices be selected");
- return;
- }
-}
-
-void region_to_loop(void)
-{
- EditEdge *eed;
- EditFace *efa;
-
- if(G.totfacesel){
- for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0;
-
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- if(efa->f&SELECT){
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4)
- efa->e4->f1++;
- }
- }
-
- EM_clear_flag_all(SELECT);
-
- for(eed=G.editMesh->edges.first; eed; eed=eed->next){
- if(eed->f1 == 1) EM_select_edge(eed, 1);
- }
-
- G.scene->selectmode = SCE_SELECT_EDGE;
- EM_selectmode_set();
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Face Region to Edge Loop");
-
- }
-}
-
-static int validate_loop(Collection *edgecollection)
-{
- EditEdge *eed;
- EditFace *efa;
- CollectedEdge *curredge;
-
- /*1st test*/
- for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){
- curredge->eed->v1->f1 = 0;
- curredge->eed->v2->f1 = 0;
- }
- for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){
- curredge->eed->v1->f1++;
- curredge->eed->v2->f1++;
- }
- for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){
- if(curredge->eed->v1->f1 > 2) return(0); else
- if(curredge->eed->v2->f1 > 2) return(0);
- }
-
- /*2nd test*/
- for(eed = G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- efa->e1->f1++;
- efa->e2->f1++;
- efa->e3->f1++;
- if(efa->e4) efa->e4->f1++;
- }
- for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){
- if(curredge->eed->f1 > 2) return(0);
- }
- return(1);
-}
-
-static int loop_bisect(Collection *edgecollection){
-
- EditFace *efa, *sf1, *sf2;
- EditEdge *eed, *sed;
- CollectedEdge *curredge;
- int totsf1, totsf2, unbalanced,balancededges;
-
- for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = eed->f2 = 0;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next) efa->f1 = 0;
-
- for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next) curredge->eed->f1 = 1;
-
- sf1 = sf2 = NULL;
- sed = ((CollectedEdge*)edgecollection->collectionbase.first)->eed;
-
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- if(sf2) break;
- else if(sf1){
- if(efa->e1 == sed || efa->e2 == sed || efa->e3 == sed || ( (efa->e4) ? efa->e4 == sed : 0) ) sf2 = efa;
- }
- else{
- if(efa->e1 == sed || efa->e2 == sed || efa->e3 == sed || ( (efa->e4) ? efa->e4 == sed : 0) ) sf1 = efa;
- }
- }
-
- if(sf1==NULL || sf2==NULL)
- return(-1);
-
- if(!(sf1->e1->f1)) sf1->e1->f2 = 1;
- if(!(sf1->e2->f1)) sf1->e2->f2 = 1;
- if(!(sf1->e3->f1)) sf1->e3->f2 = 1;
- if(sf1->e4 && !(sf1->e4->f1)) sf1->e4->f2 = 1;
- sf1->f1 = 1;
- totsf1 = 1;
-
- if(!(sf2->e1->f1)) sf2->e1->f2 = 2;
- if(!(sf2->e2->f1)) sf2->e2->f2 = 2;
- if(!(sf2->e3->f1)) sf2->e3->f2 = 2;
- if(sf2->e4 && !(sf2->e4->f1)) sf2->e4->f2 = 2;
- sf2->f1 = 2;
- totsf2 = 1;
-
- /*do sf1*/
- unbalanced = 1;
- while(unbalanced){
- unbalanced = 0;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- balancededges = 0;
- if(efa->f1 == 0){
- if(efa->e1->f2 == 1 || efa->e2->f2 == 1 || efa->e3->f2 == 1 || ( (efa->e4) ? efa->e4->f2 == 1 : 0) ){
- balancededges += efa->e1->f2 = (efa->e1->f1) ? 0 : 1;
- balancededges += efa->e2->f2 = (efa->e2->f1) ? 0 : 1;
- balancededges += efa->e3->f2 = (efa->e3->f1) ? 0 : 1;
- if(efa->e4) balancededges += efa->e4->f2 = (efa->e4->f1) ? 0 : 1;
- if(balancededges){
- unbalanced = 1;
- efa->f1 = 1;
- totsf1++;
- }
- }
- }
- }
- }
-
- /*do sf2*/
- unbalanced = 1;
- while(unbalanced){
- unbalanced = 0;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- balancededges = 0;
- if(efa->f1 == 0){
- if(efa->e1->f2 == 2 || efa->e2->f2 == 2 || efa->e3->f2 == 2 || ( (efa->e4) ? efa->e4->f2 == 2 : 0) ){
- balancededges += efa->e1->f2 = (efa->e1->f1) ? 0 : 2;
- balancededges += efa->e2->f2 = (efa->e2->f1) ? 0 : 2;
- balancededges += efa->e3->f2 = (efa->e3->f1) ? 0 : 2;
- if(efa->e4) balancededges += efa->e4->f2 = (efa->e4->f1) ? 0 : 2;
- if(balancededges){
- unbalanced = 1;
- efa->f1 = 2;
- totsf2++;
- }
- }
- }
- }
- }
-
- if(totsf1 < totsf2) return(1);
- else return(2);
-}
-
-void loop_to_region(void)
-{
- EditFace *efa;
- ListBase allcollections={NULL,NULL};
- Collection *edgecollection;
- int testflag;
-
- build_edgecollection(&allcollections);
-
- for(edgecollection = (Collection *)allcollections.first; edgecollection; edgecollection=edgecollection->next){
- if(validate_loop(edgecollection)){
- testflag = loop_bisect(edgecollection);
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){
- if(efa->f1 == testflag){
- if(efa->f&SELECT) EM_select_face(efa, 0);
- else EM_select_face(efa,1);
- }
- }
- }
- }
-
- for(efa=G.editMesh->faces.first; efa; efa=efa->next){ /*fix this*/
- if(efa->f&SELECT) EM_select_face(efa,1);
- }
-
- countall();
- freecollections(&allcollections);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- BIF_undo_push("Edge Loop to Face Region");
-}
-
-
-/* texface and vertex color editmode tools for the face menu */
-
-void mesh_rotate_uvs(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- short change = 0, ccw;
- MTFace *tf;
- float u1, v1;
-
- if (!EM_texFaceCheck()) {
- error("mesh has no uv/image layers");
- return;
- }
-
- ccw = (G.qual == LR_SHIFTKEY);
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- u1= tf->uv[0][0];
- v1= tf->uv[0][1];
-
- if (ccw) {
- if(efa->v4) {
- tf->uv[0][0]= tf->uv[3][0];
- tf->uv[0][1]= tf->uv[3][1];
-
- tf->uv[3][0]= tf->uv[2][0];
- tf->uv[3][1]= tf->uv[2][1];
- } else {
- tf->uv[0][0]= tf->uv[2][0];
- tf->uv[0][1]= tf->uv[2][1];
- }
-
- tf->uv[2][0]= tf->uv[1][0];
- tf->uv[2][1]= tf->uv[1][1];
-
- tf->uv[1][0]= u1;
- tf->uv[1][1]= v1;
- } else {
- tf->uv[0][0]= tf->uv[1][0];
- tf->uv[0][1]= tf->uv[1][1];
-
- tf->uv[1][0]= tf->uv[2][0];
- tf->uv[1][1]= tf->uv[2][1];
-
- if(efa->v4) {
- tf->uv[2][0]= tf->uv[3][0];
- tf->uv[2][1]= tf->uv[3][1];
-
- tf->uv[3][0]= u1;
- tf->uv[3][1]= v1;
- }
- else {
- tf->uv[2][0]= u1;
- tf->uv[2][1]= v1;
- }
- }
- change = 1;
- }
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Rotate UV face");
- }
-}
-
-void mesh_mirror_uvs(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- short change = 0, altaxis;
- MTFace *tf;
- float u1, v1;
-
- if (!EM_texFaceCheck()) {
- error("mesh has no uv/image layers");
- return;
- }
-
- altaxis = (G.qual == LR_SHIFTKEY);
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (altaxis) {
- u1= tf->uv[1][0];
- v1= tf->uv[1][1];
- if(efa->v4) {
-
- tf->uv[1][0]= tf->uv[2][0];
- tf->uv[1][1]= tf->uv[2][1];
-
- tf->uv[2][0]= u1;
- tf->uv[2][1]= v1;
-
- u1= tf->uv[3][0];
- v1= tf->uv[3][1];
-
- tf->uv[3][0]= tf->uv[0][0];
- tf->uv[3][1]= tf->uv[0][1];
-
- tf->uv[0][0]= u1;
- tf->uv[0][1]= v1;
- }
- else {
- tf->uv[1][0]= tf->uv[2][0];
- tf->uv[1][1]= tf->uv[2][1];
- tf->uv[2][0]= u1;
- tf->uv[2][1]= v1;
- }
-
- } else {
- u1= tf->uv[0][0];
- v1= tf->uv[0][1];
- if(efa->v4) {
-
- tf->uv[0][0]= tf->uv[1][0];
- tf->uv[0][1]= tf->uv[1][1];
-
- tf->uv[1][0]= u1;
- tf->uv[1][1]= v1;
-
- u1= tf->uv[3][0];
- v1= tf->uv[3][1];
-
- tf->uv[3][0]= tf->uv[2][0];
- tf->uv[3][1]= tf->uv[2][1];
-
- tf->uv[2][0]= u1;
- tf->uv[2][1]= v1;
- }
- else {
- tf->uv[0][0]= tf->uv[1][0];
- tf->uv[0][1]= tf->uv[1][1];
- tf->uv[1][0]= u1;
- tf->uv[1][1]= v1;
- }
- }
- change = 1;
- }
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Mirror UV face");
- }
-}
-
-void mesh_rotate_colors(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- short change = 0, ccw;
- MCol tmpcol, *mcol;
- if (!EM_vertColorCheck()) {
- error("mesh has no color layers");
- return;
- }
-
- ccw = (G.qual == LR_SHIFTKEY);
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- tmpcol= mcol[0];
-
- if (ccw) {
- if(efa->v4) {
- mcol[0]= mcol[3];
- mcol[3]= mcol[2];
- } else {
- mcol[0]= mcol[2];
- }
- mcol[2]= mcol[1];
- mcol[1]= tmpcol;
- } else {
- mcol[0]= mcol[1];
- mcol[1]= mcol[2];
-
- if(efa->v4) {
- mcol[2]= mcol[3];
- mcol[3]= tmpcol;
- }
- else
- mcol[2]= tmpcol;
- }
- change = 1;
- }
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Rotate Color face");
- }
-}
-
-void mesh_mirror_colors(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- short change = 0, altaxis;
- MCol tmpcol, *mcol;
- if (!EM_vertColorCheck()) {
- error("mesh has no color layers");
- return;
- }
-
- altaxis = (G.qual == LR_SHIFTKEY);
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- if (efa->f & SELECT) {
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
- if (altaxis) {
- tmpcol= mcol[1];
- mcol[1]= mcol[2];
- mcol[2]= tmpcol;
-
- if(efa->v4) {
- tmpcol= mcol[0];
- mcol[0]= mcol[3];
- mcol[3]= tmpcol;
- }
- } else {
- tmpcol= mcol[0];
- mcol[0]= mcol[1];
- mcol[1]= tmpcol;
-
- if(efa->v4) {
- tmpcol= mcol[2];
- mcol[2]= mcol[3];
- mcol[3]= tmpcol;
- }
- }
- change = 1;
- }
- }
-
- if (change) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Mirror Color face");
- }
-}
diff --git a/source/blender/src/editmode_undo.c b/source/blender/src/editmode_undo.c
deleted file mode 100644
index 7893dac2408..00000000000
--- a/source/blender/src/editmode_undo.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "BKE_utildefines.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_interface.h"
-#include "BIF_screen.h"
-#include "BIF_resources.h"
-#include "BIF_toolbox.h"
-#include "BIF_space.h"
-
-#include "BDR_editcurve.h"
-
-#include "BSE_edit.h"
-
-#include "mydevice.h"
-
-/* ***************** generic editmode undo system ********************* */
-/*
-
-Add this in your local code:
-
-void undo_editmode_push(char *name,
- void (*freedata)(void *), // pointer to function freeing data
- void (*to_editmode)(void *), // data to editmode conversion
- void * (*from_editmode)(void)) // editmode to data conversion
- int (*validate_undo)(void *)) // check if undo data is still valid
-
-
-Further exported for UI is:
-
-void undo_editmode_step(int step); // undo and redo
-void undo_editmode_clear(void) // free & clear all data
-void undo_editmode_menu(void) // history menu
-
-
-*/
-/* ********************************************************************* */
-
-/* local prototypes --------------- */
- void undo_editmode_step(int step); // undo and redo
- void undo_editmode_clear(void); // free & clear all data
- void undo_editmode_menu(void); // history menu
- void undo_editmode_push(char *name, void (*freedata)(void *),
- void (*to_editmode)(void *), void *(*from_editmode)(void),
- int (*validate_undo)(void *));
- struct uiBlock *editmode_undohistorymenu(void *arg_unused);
-
-
-
-#define MAXUNDONAME 64
-typedef struct UndoElem {
- struct UndoElem *next, *prev;
- ID id; // copy of editmode object ID
- Object *ob; // pointer to edited object
- int type; // type of edited object
- void *undodata;
- uintptr_t undosize;
- char name[MAXUNDONAME];
- void (*freedata)(void *);
- void (*to_editmode)(void *);
- void * (*from_editmode)(void);
- int (*validate_undo)(void *);
-} UndoElem;
-
-static ListBase undobase={NULL, NULL};
-static UndoElem *curundo= NULL;
-
-
-/* ********************* xtern api calls ************* */
-
-static void undo_restore(UndoElem *undo)
-{
- if(undo) {
- waitcursor(1);
- undo->to_editmode(undo->undodata);
- waitcursor(0);
-
- countall();
- }
-}
-
-/* name can be a dynamic string */
-void undo_editmode_push(char *name, void (*freedata)(void *),
- void (*to_editmode)(void *), void *(*from_editmode)(void),
- int (*validate_undo)(void *))
-{
- UndoElem *uel;
- int nr;
- uintptr_t memused, totmem, maxmem;
-
- /* at first here was code to prevent an "original" key to be insterted twice
- this was giving conflicts for example when mesh changed due to keys or apply */
-
- /* remove all undos after (also when curundo==NULL) */
- while(undobase.last != curundo) {
- uel= undobase.last;
- uel->freedata(uel->undodata);
- BLI_freelinkN(&undobase, uel);
- }
-
- /* make new */
- curundo= uel= MEM_callocN(sizeof(UndoElem), "undo file");
- strncpy(uel->name, name, MAXUNDONAME-1);
- BLI_addtail(&undobase, uel);
-
- uel->freedata= freedata;
- uel->to_editmode= to_editmode;
- uel->from_editmode= from_editmode;
- uel->validate_undo= validate_undo;
-
- /* limit amount to the maximum amount*/
- nr= 0;
- uel= undobase.last;
- while(uel) {
- nr++;
- if(nr==U.undosteps) break;
- uel= uel->prev;
- }
- if(uel) {
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
- first->freedata(first->undodata);
- BLI_freelinkN(&undobase, first);
- }
- }
-
- /* copy */
- memused= MEM_get_memory_in_use();
- curundo->undodata= curundo->from_editmode();
- curundo->undosize= MEM_get_memory_in_use() - memused;
- curundo->ob= G.obedit;
- curundo->id= G.obedit->id;
- curundo->type= G.obedit->type;
-
- if(U.undomemory != 0) {
- /* limit to maximum memory (afterwards, we can't know in advance) */
- totmem= 0;
- maxmem= ((uintptr_t)U.undomemory)*1024*1024;
-
- uel= undobase.last;
- while(uel && uel->prev) {
- totmem+= uel->undosize;
- if(totmem>maxmem) break;
- uel= uel->prev;
- }
-
- if(uel) {
- if(uel->prev && uel->prev->prev)
- uel= uel->prev;
-
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
- first->freedata(first->undodata);
- BLI_freelinkN(&undobase, first);
- }
- }
- }
-}
-
-/* helper to remove clean other objects from undo stack */
-static void undo_clean_stack(void)
-{
- UndoElem *uel, *next;
- int mixed= 0;
-
- /* global undo changes pointers, so we also allow identical names */
- /* side effect: when deleting/renaming object and start editing new one with same name */
-
- uel= undobase.first;
- while(uel) {
- next= uel->next;
-
- /* for when objects are converted, renamed, or global undo changes pointers... */
- if(uel->type==G.obedit->type && strcmp(uel->id.name, G.obedit->id.name)==0 &&
- (!uel->validate_undo || uel->validate_undo(uel->undodata))) {
- uel->ob= G.obedit;
- }
- else {
- mixed= 1;
- uel->freedata(uel->undodata);
- BLI_freelinkN(&undobase, uel);
- }
-
- uel= next;
- }
-
- if(mixed) curundo= undobase.last;
-}
-
-/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */
-void undo_editmode_step(int step)
-{
-
- /* prevent undo to happen on wrong object, stack can be a mix */
- undo_clean_stack();
-
- if(step==0) {
- undo_restore(curundo);
- }
- else if(step==1) {
-
- if(curundo==NULL || curundo->prev==NULL) error("No more steps to undo");
- else {
- if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
- curundo= curundo->prev;
- undo_restore(curundo);
- }
- }
- else {
- /* curundo has to remain current situation! */
-
- if(curundo==NULL || curundo->next==NULL) error("No more steps to redo");
- else {
- undo_restore(curundo->next);
- curundo= curundo->next;
- if(G.f & G_DEBUG) printf("redo %s\n", curundo->name);
- }
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void undo_editmode_clear(void)
-{
- UndoElem *uel;
-
- uel= undobase.first;
- while(uel) {
- uel->freedata(uel->undodata);
- uel= uel->next;
- }
- BLI_freelistN(&undobase);
- curundo= NULL;
-}
-
-/* based on index nr it does a restore */
-static void undo_number(int nr)
-{
- UndoElem *uel;
- int a=1;
-
- for(uel= undobase.first; uel; uel= uel->next, a++) {
- if(a==nr) break;
- }
- curundo= uel;
- undo_editmode_step(0);
-}
-
-/* ************** for interaction with menu/pullown */
-
-void undo_editmode_menu(void)
-{
- UndoElem *uel;
- DynStr *ds= BLI_dynstr_new();
- short event;
- char *menu;
-
- undo_clean_stack(); // removes other objects from it
-
- BLI_dynstr_append(ds, "Editmode Undo History %t");
-
- for(uel= undobase.first; uel; uel= uel->next) {
- BLI_dynstr_append(ds, "|");
- BLI_dynstr_append(ds, uel->name);
- }
-
- menu= BLI_dynstr_get_cstring(ds);
- BLI_dynstr_free(ds);
-
- event= pupmenu_col(menu, 20);
- MEM_freeN(menu);
-
- if(event>0) undo_number(event);
-}
-
-static void do_editmode_undohistorymenu(void *arg, int event)
-{
-
- if(G.obedit==NULL || event<1) return;
-
- if (event==1) {
- if(G.obedit->type==OB_MESH) remake_editMesh();
- }
- else undo_number(event-1);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-uiBlock *editmode_undohistorymenu(void *arg_unused)
-{
- uiBlock *block;
- UndoElem *uel;
- short yco = 20, menuwidth = 120;
- short item=2;
-
- undo_clean_stack(); // removes other objects from it
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_undohistorymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_editmode_undohistorymenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo All Changes", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- for(uel= undobase.first; uel; uel= uel->next, item++) {
- if (uel==curundo) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, uel->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, (float)item, "");
- if (uel==curundo) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void *undo_editmode_get_prev(Object *ob)
-{
- UndoElem *ue= undobase.last;
- if(ue && ue->prev && ue->prev->ob==ob) return ue->prev->undodata;
- return NULL;
-}
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c
deleted file mode 100644
index 179ea41d5ad..00000000000
--- a/source/blender/src/editnla.c
+++ /dev/null
@@ -1,2085 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL *****
- *
- * This file is a horrible mess: An attmept to cram some
- * final functionality into blender before it is too late.
- *
- * Hopefully it can be tidied up at a later date...
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "PIL_time.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-
-#include "DNA_action_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_action.h"
-#include "BKE_blender.h"
-#include "BKE_depsgraph.h"
-#include "BKE_group.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_nla.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_butspace.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-#include "BIF_editview.h"
-#include "BIF_toolbox.h"
-#include "BIF_editnla.h"
-#include "BIF_editaction.h"
-#include "BIF_transform.h"
-
-#include "BSE_editipo.h"
-#include "BSE_editnla_types.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_drawipo.h"
-#include "BSE_editaction_types.h"
-#include "BSE_trans_types.h"
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BDR_editobject.h"
-#include "BSE_drawnla.h"
-#include "BSE_time.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/* Note: A lot of these pretty much duplicate the behaviour of the
-action windows. The functions should be shared, not copy-pasted */
-
-static void mouse_nla(int selectmode);
-static Base *get_nearest_nlachannel_ob_key (float *index, short *sel);
-static bAction *get_nearest_nlachannel_ac_key (float *index, short *sel);
-static Base *get_nearest_nlastrip (bActionStrip **rstrip, short *sel);
-static void mouse_nlachannels(short mval[2]);
-
-/* ******************** SPACE: NLA ********************** */
-
-void shift_nlastrips_up(void) {
-
- Base *base;
- bActionStrip *strip, *prevstrip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- for (strip = base->object->nlastrips.first;
- strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT) {
- if ( (prevstrip = strip->prev) ) {
- if (prevstrip->prev)
- prevstrip->prev->next = strip;
- if (strip->next)
- strip->next->prev = prevstrip;
- strip->prev = prevstrip->prev;
- prevstrip->next = strip->next;
- strip->next = prevstrip;
- prevstrip->prev = strip;
-
- if (prevstrip == base->object->nlastrips.first)
- base->object->nlastrips.first = strip;
- if (strip == base->object->nlastrips.last)
- base->object->nlastrips.last = prevstrip;
-
- strip = prevstrip;
- }
- else {
- break;
- }
- }
- }
- }
- BIF_undo_push("Shift NLA strip");
- allqueue (REDRAWNLA, 0);
-
-}
-
-void shift_nlastrips_down(void) {
-
- Base *base;
- bActionStrip *strip, *nextstrip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- for (strip = base->object->nlastrips.last;
- strip; strip=strip->prev){
- if (strip->flag & ACTSTRIP_SELECT) {
- if ( (nextstrip = strip->next) ) {
- if (nextstrip->next)
- nextstrip->next->prev = strip;
- if (strip->prev)
- strip->prev->next = nextstrip;
- strip->next = nextstrip->next;
- nextstrip->prev = strip->prev;
- strip->prev = nextstrip;
- nextstrip->next = strip;
-
- if (nextstrip == base->object->nlastrips.last)
- base->object->nlastrips.last = strip;
- if (strip == base->object->nlastrips.first)
- base->object->nlastrips.first = nextstrip;
-
- strip = nextstrip;
- }
- else {
- break;
- }
- }
- }
- }
-
- BIF_undo_push("Shift NLA strips");
- allqueue (REDRAWNLA, 0);
-}
-
-void synchronize_action_strips(void)
-{
- Base *base;
- Object *ob;
- bActionStrip *strip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- /* get object first */
- ob= base->object;
-
- /* step 1: adjust strip-lengths */
- // FIXME: this seems very buggy
- for (strip = ob->nlastrips.last; strip; strip=strip->prev) {
- if (strip->flag & ACTSTRIP_LOCK_ACTION) {
- float actstart, actend;
-
- calc_action_range(strip->act, &actstart, &actend, 1);
-
- if ((strip->actstart!=actstart) || (strip->actend!=actend)) {
- float offset = strip->scale * (actstart - strip->actstart);
- float actlen = actend - actstart;
-
- strip->start += offset;
- strip->end = (strip->scale * strip->repeat * actlen) + strip->start;
-
- strip->actstart= actstart;
- strip->actend= actend;
- }
- }
- }
-
- /* step 2: adjust blendin/out values for each strip if option is turned on */
- for (strip= ob->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_AUTO_BLENDS) {
- bActionStrip *prev= strip->prev;
- bActionStrip *next= strip->next;
- float pr[2], nr[2];
-
- strip->blendin = 0.0f;
- strip->blendout = 0.0f;
-
- /* setup test ranges */
- if (prev && next) {
- /* init range for previous strip */
- pr[0]= prev->start;
- pr[1]= prev->end;
-
- /* init range for next strip */
- nr[0]= next->start;
- nr[1]= next->end;
- }
- else if (prev) {
- /* next strip's range is same as previous strip's range */
- pr[0] = nr[0] = prev->start;
- pr[1] = nr[1] = prev->end;
- }
- else if (next) {
- /* previous strip's range is same as next strip's range */
- pr[0] = nr[0] = next->start;
- pr[1] = nr[1] = next->end;
- }
- else {
- /* there shouldn't be any more strips to loop through for this operation */
- break;
- }
-
- /* test various cases */
- if ( IN_RANGE(pr[1], strip->start, strip->end) &&
- (IN_RANGE(pr[0], strip->start, strip->end)==0) )
- {
- /* previous strip intersects start of current */
-
- if ( IN_RANGE(nr[1], strip->start, strip->end) &&
- (IN_RANGE(nr[0], strip->start, strip->end)==0) )
- {
- /* next strip also intersects start of current */
- if (nr[1] < pr[1])
- strip->blendin= nr[1] - strip->start;
- else
- strip->blendin= pr[1] - strip->start;
- }
- else if (IN_RANGE(nr[0], strip->start, strip->end) &&
- (IN_RANGE(nr[1], strip->start, strip->end)==0))
- {
- /* next strip intersects end of current */
- strip->blendout= strip->end - nr[0];
- strip->blendin= pr[1] - strip->start;
- }
- else {
- /* only previous strip intersects current */
- strip->blendin= pr[1] - strip->start;
- }
- }
- else if (IN_RANGE(pr[0], strip->start, strip->end) &&
- (IN_RANGE(pr[1], strip->start, strip->end)==0) )
- {
- /* previous strip intersects end of current */
-
- if ( IN_RANGE(nr[0], strip->start, strip->end) &&
- (IN_RANGE(nr[1], strip->start, strip->end)==0) )
- {
- /* next strip also intersects end of current */
- if (nr[1] > pr[1])
- strip->blendout= strip->end - nr[0];
- else
- strip->blendout= strip->end - pr[0];
- }
- else if (IN_RANGE(nr[1], strip->start, strip->end) &&
- (IN_RANGE(nr[0], strip->start, strip->end)==0))
- {
- /* next strip intersects start of current */
- strip->blendin= nr[1] - strip->start;
- strip->blendout= strip->end - pr[0];
- }
- else {
- /* only previous strip intersects current */
- strip->blendout= strip->end - pr[0];
- }
- }
- else if (IN_RANGE(nr[1], strip->start, strip->end) &&
- (IN_RANGE(nr[0], strip->start, strip->end)==0) )
- {
- /* next strip intersects start of current */
-
- if ( IN_RANGE(pr[1], strip->start, strip->end) &&
- (IN_RANGE(pr[0], strip->start, strip->end)==0) )
- {
- /* previous strip also intersects start of current */
- if (pr[1] < nr[1])
- strip->blendin= pr[1] - strip->start;
- else
- strip->blendin= nr[1] - strip->start;
- }
- else if (IN_RANGE(pr[0], strip->start, strip->end) &&
- (IN_RANGE(pr[1], strip->start, strip->end)==0))
- {
- /* previous strip intersects end of current */
- strip->blendout= strip->end - pr[0];
- strip->blendin= nr[1] - strip->start;
- }
- else {
- /* only next strip intersects current */
- strip->blendin= nr[1] - strip->start;
- }
- }
- else if (IN_RANGE(nr[0], strip->start, strip->end) &&
- (IN_RANGE(nr[1], strip->start, strip->end)==0) )
- {
- /* next strip intersects end of current */
-
- if ( IN_RANGE(pr[0], strip->start, strip->end) &&
- (IN_RANGE(pr[1], strip->start, strip->end)==0) )
- {
- /* previous strip also intersects end of current */
- if (pr[1] > nr[1])
- strip->blendout= strip->end - pr[0];
- else
- strip->blendout= strip->end - nr[0];
- }
- else if (IN_RANGE(pr[1], strip->start, strip->end) &&
- (IN_RANGE(pr[0], strip->start, strip->end)==0))
- {
- /* previous strip intersects start of current */
- strip->blendin= pr[1] - strip->start;
- strip->blendout= strip->end - nr[0];
- }
- else {
- /* only next strip intersects current */
- strip->blendout= strip->end - nr[0];
- }
- }
-
- /* make sure blending stays in ranges */
- CLAMP(strip->blendin, 0, (strip->end-strip->start));
- CLAMP(strip->blendout, 0, (strip->end-strip->start));
- }
- }
- }
-
-}
-
-void reset_action_strips(int val)
-{
- Base *base;
- bActionStrip *strip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
- if (strip->flag & ACTSTRIP_SELECT) {
- switch (val) {
- case 1:
- {
- /* clear scaling - reset to 1.0 without touching keys */
- float actlen= (strip->actend - strip->actstart);
-
- strip->scale= 1.0f;
- strip->end= (strip->repeat * actlen) + strip->start;
- }
- break;
- case 2:
- {
- /* reset action-range */
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
- }
- break;
- case 3:
- {
- /* apply scale to keys - scale is reset to 1.0f, but keys stay at the same times */
- bActionChannel *achan;
-
- if (strip->act) {
- for (achan= strip->act->chanbase.first; achan; achan= achan->next) {
- actstrip_map_ipo_keys(base->object, achan->ipo, 0, 0);
- }
-
- /* now we can reset scale */
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
- strip->scale= 1.0f;
- strip->end = (strip->repeat * (strip->actend - strip->actstart)) + strip->start;
- }
- }
- break;
- }
- base->object->ctime= -1234567.0f; // evil!
- DAG_object_flush_update(G.scene, base->object, OB_RECALC_OB|OB_RECALC_DATA);
- }
- }
- }
- BIF_undo_push("Reset NLA strips");
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWACTION, 0);
- allqueue (REDRAWNLA, 0);
-}
-
-void snap_action_strips(int snap_mode)
-{
- Base *base;
- bActionStrip *strip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- /* object has ipo - these keyframes should be able to be snapped, even if strips are collapsed */
- if (base->object->ipo) {
- snap_ipo_keys(base->object->ipo, snap_mode);
- }
-
- /* object is collapsed - action and nla strips not shown/editable */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* snap action strips */
- for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
- if (strip->flag & ACTSTRIP_SELECT) {
- if (snap_mode==1) {
- /* nearest frame */
- strip->start= (float)floor(strip->start+0.5);
- strip->end= (float)floor(strip->end+0.5);
- }
- else if (snap_mode==2) {
- /* current frame */
- float diff;
- if (CFRA < strip->start) {
- diff = (strip->start - CFRA);
- strip->start -= diff;
- strip->end -= diff;
- }
- else {
- diff = (CFRA - strip->start);
- strip->start += diff;
- strip->end += diff;
- }
- }
- else if (snap_mode==3) {
- /* nearest second */
- float secf = (float)FPS;
- strip->start= (float)(floor(strip->start/secf + 0.5f) * secf);
- strip->end= (float)(floor(strip->end/secf + 0.5f) * secf);
- }
- }
- }
-
- /* object has action */
- if (base->object->action) {
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
-
- /* filter action data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, base->object->action, ACTCONT_ACTION);
-
- /* snap to frame */
- for (ale= act_data.first; ale; ale= ale->next) {
- actstrip_map_ipo_keys(base->object, ale->key_data, 0, 1);
- snap_ipo_keys(ale->key_data, snap_mode);
- actstrip_map_ipo_keys(base->object, ale->key_data, 1, 1);
- }
- BLI_freelistN(&act_data);
-
- remake_action_ipos(base->object->action);
- }
- }
- BIF_undo_push("Snap NLA strips");
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REMAKEIPO, 0);
- allqueue (REDRAWIPO, 0);
- allqueue (REDRAWACTION, 0);
- allqueue (REDRAWNLA, 0);
-}
-
-static void set_active_strip(Object *ob, bActionStrip *act)
-{
- bActionStrip *strip;
-
- /* make sure all other strips are not active */
- for (strip = ob->nlastrips.first; strip; strip=strip->next)
- strip->flag &= ~ACTSTRIP_ACTIVE;
-
- /* act is new active strip */
- if (act) {
- /* set active flag for this strip */
- act->flag |= ACTSTRIP_ACTIVE;
-
- /* check if active action will still be the same one */
- if (ob->action != act->act) {
- /* clear object's links with its current action (if present) */
- if (ob->action) {
- ob->action->id.us--;
- }
-
- /* only set object's action to active strip's action if possible */
- if (act->act->id.lib) {
- ob->action= NULL;
- }
- else {
- ob->action= act->act;
- id_us_plus(&ob->action->id);
- }
-
- /* request redrawing in relevant spaces */
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-
- /* when only showing action (i.e. nla-override off),
- * reset pose to restpose for armatures
- */
- if ((ob->nlaflag & OB_NLA_OVERRIDE)==0) {
- if (ob->type == OB_ARMATURE)
- rest_pose(ob->pose);
- }
-
- /* flush depsgraph */
- ob->ctime= -1234567.0f; // evil!
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
- }
- }
-}
-
-void convert_nla(void)
-{
- bActionStrip *strip;
- Object *ob= OBACT;
- char str[128];
- short event;
-
- if ((ob==NULL)||(ob->action==NULL)) {
- error("Need active Object to convert Action to NLA Strip");
- return;
- }
-
- sprintf(str, "Convert Action%%t|%s to NLA Strip%%x1", ob->action->id.name+2);
- event = pupmenu(str);
-
- if (event==1) {
- if (ob->action) {
- deselect_nlachannel_keys(0);
- strip = convert_action_to_strip(ob); //creates a new NLA strip from the action in given object
- set_active_strip(ob, strip);
- BIF_undo_push("Convert NLA");
- allqueue (REDRAWNLA, 0);
- }
- }
-}
-
-static void add_nla_block(short event)
-{
- Object *ob= OBACT;
- bAction *act=NULL;
- bActionStrip *strip;
- int cur;
-
- if (event!=-1){
- for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){
- if (cur==event){
- break;
- }
- }
- }
-
- /* Bail out if no action was chosen */
- if (!act){
- return;
- }
-
- /* Initialize the new action block */
- strip = MEM_callocN(sizeof(bActionStrip), "bActionStrip");
-
- deselect_nlachannel_keys(0);
-
- /* Link the action to the strip */
- strip->act = act;
- id_us_plus(&act->id);
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
- strip->start = (float)G.scene->r.cfra; /* could be mval[0] another time... */
- strip->end = (float)strip->start + (strip->actend-strip->actstart);
- /* simple prevention of zero strips */
- if(strip->start>strip->end-2)
- strip->end= strip->start+100;
- strip->repeat = strip->scale= 1.0f;
-
- strip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION;
-
- find_stridechannel(ob, strip);
- set_active_strip(ob, strip);
- strip->object= group_get_member_with_action(ob->dup_group, act);
- if(strip->object)
- id_lib_extern(&strip->object->id); /* checks lib data, sets correct flag for saving then */
-
- if(ob->nlastrips.first == NULL)
- ob->nlaflag |= OB_NLA_OVERRIDE;
-
- BLI_addtail(&ob->nlastrips, strip);
-
- BIF_undo_push("Add NLA strip");
-}
-
-static void add_nla_block_by_name(char name[32], Object *ob, short hold, short add, float repeat)
-{
- bAction *act=NULL;
- bActionStrip *strip;
- int cur;
-
- if (name){
- for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){
- if (strcmp(name,act->id.name)==0) {
- break;
- }
- }
- }
-
- /* Bail out if no action was chosen */
- if (!act){
- return;
- }
-
- /* Initialize the new action block */
- strip = MEM_callocN(sizeof(bActionStrip), "bActionStrip");
- strip->scale= 1.0f;
-
- deselect_nlachannel_keys(0);
-
- /* Link the action to the strip */
- strip->act = act;
- calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
- strip->start = (float)G.scene->r.cfra; /* could be mval[0] another time... */
- strip->end = (float)strip->start + (strip->actend-strip->actstart);
- /* simple prevention of zero strips */
- if(strip->start>strip->end-2)
- strip->end= strip->start+100;
-
- strip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION; //|ACTSTRIP_USEMATCH;
-
- if (hold==1)
- strip->flag = strip->flag|ACTSTRIP_HOLDLASTFRAME;
-
- if (add==1)
- strip->mode = ACTSTRIPMODE_ADD;
-
- find_stridechannel(ob, strip);
-
- set_active_strip(ob, strip);
-
- strip->repeat = repeat;
-
- act->id.us++;
-
- if(ob->nlastrips.first == NULL)
- ob->nlaflag |= OB_NLA_OVERRIDE;
-
- BLI_addtail(&ob->nlastrips, strip);
-}
-
-static void add_nla_databrowse_callback(unsigned short val)
-{
- /* val is not used, databrowse needs it to optional pass an event */
- short event;
-
- if(OBACT==NULL) return;
-
- event= G.snla->menunr; /* set by databrowse or pupmenu */
-
- add_nla_block(event);
-}
-
-/* Adds strip to to active Object */
-void add_nlablock(void)
-{
- Object *ob= OBACT;
- short event;
- short nr=0;
- char *str, title[64];
-
- if(ob==NULL) {
- error("Need active Object to add NLA strips");
- return;
- }
-
- sprintf(title, "Add Action strip to: %s", ob->id.name+2);
-
- /* Popup action menu */
- IDnames_to_pupstring(&str, title, NULL, &G.main->action, (ID *)G.scene, &nr);
-
- if(nr==-2) {
- MEM_freeN(str);
-
- activate_databrowse((ID *)NULL, ID_AC, 0, 0, &G.snla->menunr,
- add_nla_databrowse_callback );
-
- return;
- }
- else {
- event = pupmenu_col(str, 20);
- MEM_freeN(str);
- add_nla_block(event);
- }
-}
-
-/* Creates a new action, and makes a new actionstrip of that */
-void add_empty_nlablock(void)
-{
- Object *ob= OBACT;
- bAction *act= NULL;
- bActionStrip *strip;
-
- /* check for active object first - will add strip to active object */
- if (ob == NULL)
- return;
-
- /* make new action */
- if ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE))
- act= add_empty_action("ObAction");
- else
- act= add_empty_action("Action");
-
- /* make a new strip for it */
- add_nla_block_by_name(act->id.name, ob, 0, 1, 1.0f);
- strip= ob->nlastrips.last;
-
- /* change some settings of the strip - try to avoid bad scaling */
- if ((EFRA-CFRA) < 100) {
- strip->flag |= ACTSTRIP_AUTO_BLENDS;
- strip->flag &= ~ACTSTRIP_LOCK_ACTION;
- strip->actstart = (float)CFRA;
- strip->actend = (float)(CFRA + 100);
-
- strip->start = (float)CFRA;
- strip->end = (float)(CFRA + 100);
- }
- else {
- strip->flag |= ACTSTRIP_AUTO_BLENDS;
- strip->flag &= ~ACTSTRIP_LOCK_ACTION;
- strip->actstart = (float)CFRA;
- strip->actend = (float)EFRA;
-
- strip->start = (float)CFRA;
- strip->end = (float)EFRA;
- }
-
- BIF_undo_push("Add NLA strip");
-}
-
-/* Adds strip to to active Object */
-static void relink_active_strip(void)
-{
- Object *ob= OBACT;
- bActionStrip *strip;
- bAction *act;
- short event;
- short cur;
- char *str;
-
- if(ob==NULL) return;
- if(ob->nlaflag & OB_NLA_COLLAPSED) return;
-
- for (strip = ob->nlastrips.first; strip; strip=strip->next)
- if(strip->flag & ACTSTRIP_ACTIVE)
- break;
-
- if(strip==NULL) return;
-
- /* Popup action menu */
- IDnames_to_pupstring(&str, "Relink Action strip", NULL, &G.main->action, (ID *)G.scene, NULL);
- if(str) {
- event = pupmenu_col(str, 20);
- MEM_freeN(str);
-
- for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){
- if (cur==event){
- break;
- }
- }
-
- if(act) {
- if(strip->act) strip->act->id.us--;
- strip->act = act;
- id_us_plus(&act->id);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
- }
-}
-
-
-
-/* Left hand side of channels display, selects objects */
-static void mouse_nlachannels(short mval[2])
-{
- bActionStrip *strip= NULL;
- Base *base;
- Object *ob=NULL;
- float x,y;
- int click, obclick=0, actclick=0;
- int wsize;
-
- wsize = (count_nla_levels ()*(NLACHANNELHEIGHT+NLACHANNELSKIP));
- wsize+= NLACHANNELHEIGHT/2;
-
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- click = (int)floor( ((float)wsize - y) / (NLACHANNELHEIGHT+NLACHANNELSKIP));
-
- if (click<0)
- return;
-
- for (base = G.scene->base.first; base; base=base->next){
- if (nla_filter(base)) {
- ob= base->object;
-
- /* See if this is a base selected */
- if (click==0) {
- obclick= 1;
- break;
- }
- click--;
-
- /* see if any strips under object */
- if ((ob->nlaflag & OB_NLA_COLLAPSED)==0) {
- /* See if this is an action */
- if (ob->action){
- if (click==0) {
- actclick= 1;
- break;
- }
- click--;
- }
-
- /* See if this is an nla strip */
- if(ob->nlastrips.first) {
- for (strip = ob->nlastrips.first; strip; strip=strip->next){
- if (click==0) break;
- click--;
- }
- if (strip && click==0) break;
- }
- }
- }
- }
-
- if (!base)
- return;
-
- /* Handle object strip selection */
- if (G.qual & LR_SHIFTKEY) {
- if (base->flag & SELECT) base->flag &= ~SELECT;
- else base->flag |= SELECT;
- }
- else {
- deselect_nlachannels (0); // Auto clear
- base->flag |= SELECT;
- }
- ob->flag= base->flag;
-
- if(base!=BASACT) set_active_base(base);
-
- if(actclick) /* de-activate all strips */
- set_active_strip(ob, NULL);
- else if(strip) {
- if(mval[0] >= (NLAWIDTH-16)) /* toggle strip muting */
- strip->flag ^= ACTSTRIP_MUTE;
- else /* set action */
- set_active_strip(ob, strip);
- }
-
- /* icon toggles beside strip */
- if (obclick && mval[0]<20) {
- /* collapse option for NLA object strip */
- ob->nlaflag ^= OB_NLA_COLLAPSED;
- }
- else if(obclick && mval[0]<36) {
- /* override option for NLA */
- ob->nlaflag ^= OB_NLA_OVERRIDE;
- }
- else if((obclick) && (ob->ipo) && (mval[0] >= (NLAWIDTH-16))) {
- /* mute Object IPO-block */
- ob->ipo->muteipo = (ob->ipo->muteipo)? 0: 1;
- }
-
- ob->ctime= -1234567.0f; // eveil!
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-
-}
-
-void deselect_nlachannel_keys (int test)
-{
- Base *base;
- int sel=1;
- bActionChannel *chan;
- bActionStrip *strip;
- bConstraintChannel *conchan;
-
- /* Determine if this is selection or deselection */
- if (test){
- for (base=G.scene->base.first; base && sel; base=base->next){
- /* Test object ipos */
- if (is_ipo_key_selected(base->object->ipo)){
- sel = 0;
- break;
- }
-
- /* Test object constraint ipos */
- if (sel){
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){
- if (is_ipo_key_selected(conchan->ipo)){
- sel=0;
- break;
- }
- }
- }
-
- /* check if collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Test action ipos */
- if (sel){
- if (base->object->action){
- for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
- if (is_ipo_key_selected(chan->ipo)){
- sel=0;
- break;
- }
-
- /* Test action constraints */
- if (sel){
- for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){
- if (is_ipo_key_selected(conchan->ipo)){
- sel=0;
- break;
- }
- }
- }
- }
- }
- }
-
- /* Test NLA strips */
- if (sel){
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT){
- sel = 0;
- break;
- }
- }
- }
- }
- }
- else
- sel=0;
-
-
- /* Set the flags */
- for (base=G.scene->base.first; base; base=base->next){
- /* Set the object ipos */
- set_ipo_key_selection(base->object->ipo, sel);
-
- /* Set the object constraint ipos */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){
- set_ipo_key_selection(conchan->ipo, sel);
- }
-
- /* check if collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Set the action ipos */
- if (base->object->action){
- for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
- set_ipo_key_selection(chan->ipo, sel);
- /* Set the action constraint ipos */
- for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next)
- set_ipo_key_selection(conchan->ipo, sel);
- }
- }
-
- /* Set the nlastrips */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- if (sel)
- strip->flag |= ACTSTRIP_SELECT;
- else
- strip->flag &= ~ACTSTRIP_SELECT;
- }
- }
-}
-
-/* very bad call! */
-static void recalc_all_ipos(void)
-{
- Ipo *ipo;
- IpoCurve *icu;
-
- /* Go to each ipo */
- for (ipo=G.main->ipo.first; ipo; ipo=ipo->id.next){
- for (icu = ipo->curve.first; icu; icu=icu->next){
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
- }
-}
-
-void transform_nlachannel_keys(int mode, int dummy)
-{
- short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
-
- switch (mode) {
- case 'g':
- {
- initTransform(TFM_TIME_TRANSLATE, context);
- Transform();
- }
- break;
- case 's':
- {
- initTransform(TFM_TIME_SCALE, context);
- Transform();
- }
- break;
- case 'e':
- {
- initTransform(TFM_TIME_EXTEND, context);
- Transform();
- }
- break;
- }
-}
-
-void delete_nlachannel_keys(void)
-{
- Base *base;
- bActionChannel *chan;
- bConstraintChannel *conchan;
- bActionStrip *strip, *nextstrip;
-
- for (base = G.scene->base.first; base; base=base->next){
- /* Delete object ipos */
- delete_ipo_keys(base->object->ipo);
-
- /* Delete object constraint keys */
- for(conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
- delete_ipo_keys(conchan->ipo);
-
- /* skip actions and nlastrips if object collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Delete NLA strips */
- for (strip = base->object->nlastrips.first; strip; strip=nextstrip){
- nextstrip=strip->next;
- if (strip->flag & ACTSTRIP_SELECT){
- free_actionstrip(strip);
- BLI_remlink(&base->object->nlastrips, strip);
- MEM_freeN(strip);
- }
- }
-
- /* Delete action ipos */
- if (base->object->action){
- for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
- if (EDITABLE_ACHAN(chan))
- delete_ipo_keys(chan->ipo);
-
- /* Delete action constraint keys */
- for(conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){
- if (EDITABLE_CONCHAN(conchan))
- delete_ipo_keys(conchan->ipo);
- }
- }
- }
- }
-
- recalc_all_ipos(); // bad
- synchronize_action_strips();
-
- BIF_undo_push("Delete NLA keys");
- allspace(REMAKEIPO,0);
- allqueue (REDRAWVIEW3D, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-void duplicate_nlachannel_keys(void)
-{
- Base *base;
- bActionChannel *chan;
- bConstraintChannel *conchan;
- bActionStrip *strip, *laststrip;
-
- /* Find selected items */
- for (base = G.scene->base.first; base; base=base->next){
- /* Duplicate object keys */
- duplicate_ipo_keys(base->object->ipo);
-
- /* Duplicate object constraint keys */
- for(conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
- duplicate_ipo_keys(conchan->ipo);
-
- /* skip actions and nlastrips if object collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Duplicate nla strips */
- laststrip = base->object->nlastrips.last;
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT){
- bActionStrip *newstrip;
-
- copy_actionstrip(&newstrip, &strip);
-
- BLI_addtail(&base->object->nlastrips, newstrip);
-
- strip->flag &= ~ACTSTRIP_SELECT;
- newstrip->flag |= ACTSTRIP_SELECT;
- set_active_strip(base->object, newstrip);
-
- }
- if (strip==laststrip)
- break;
- }
-
- /* Duplicate actionchannel keys */
- if (base->object->action){
- for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
- if (EDITABLE_ACHAN(chan))
- duplicate_ipo_keys(chan->ipo);
-
- /* Duplicate action constraint keys */
- for(conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (EDITABLE_CONCHAN(conchan))
- duplicate_ipo_keys(conchan->ipo);
- }
- }
- }
- }
-
- BIF_undo_push("Duplicate NLA");
- transform_nlachannel_keys ('g', 0);
-}
-
-void borderselect_nla(void)
-{
- Base *base;
- rcti rect;
- rctf rectf;
- int val, selectmode;
- short mval[2];
- float ymin, ymax;
- bActionStrip *strip;
- bConstraintChannel *conchan;
-
- if ( (val = get_border (&rect, 3)) ){
- if (val == LEFTMOUSE)
- selectmode = SELECT_ADD;
- else
- selectmode = SELECT_SUBTRACT;
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax-2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- ymax = (float)count_nla_levels();
- ymax *= (float)(NLACHANNELHEIGHT+NLACHANNELSKIP);
- ymax += (float)(NLACHANNELHEIGHT+NLACHANNELSKIP)/2;
-
- for (base=G.scene->base.first; base; base=base->next){
- if (nla_filter(base)) {
-
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- /* Check object ipos */
- if (base->object->ipo){
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax)))
- borderselect_ipo_key(base->object->ipo, rectf.xmin, rectf.xmax,
- selectmode);
- }
- /* Check object constraint ipos */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax)))
- borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax,
- selectmode);
- }
-
- ymax=ymin;
-
- /* skip actions and nlastrips if object collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Check action ipos */
- if (base->object->action){
- bActionChannel *chan;
- float xmin, xmax;
-
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- /* if action is mapped in NLA, it returns a correction */
- xmin= get_action_frame(base->object, rectf.xmin);
- xmax= get_action_frame(base->object, rectf.xmax);
-
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){
- for (chan=base->object->action->chanbase.first; chan; chan=chan->next){
- borderselect_ipo_key(chan->ipo, xmin, xmax, selectmode);
- /* Check action constraint ipos */
- for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next)
- borderselect_ipo_key(conchan->ipo, xmin, xmax, selectmode);
- }
- }
-
- ymax=ymin;
- } /* End of if action */
-
- /* Skip nlastrips */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
- //
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){
- if (!((rectf.xmax<strip->start) || (rectf.xmin>strip->end))){
- if (val==1)
- strip->flag |= ACTSTRIP_SELECT;
- else
- strip->flag &= ~ACTSTRIP_SELECT;
- }
- }
-
- ymax=ymin;
- }
- }
- }
- BIF_undo_push("Border select NLA");
- allqueue(REDRAWMARKER, 0);
- }
-}
-
-/* right hand side of window, does ipokeys, actionkeys or strips */
-static void mouse_nla(int selectmode)
-{
- Base *base;
- bAction *act;
- bActionChannel *chan;
- bActionStrip *rstrip;
- bConstraintChannel *conchan;
- TimeMarker *marker;
- float selx;
- short mval[2];
- short sel, isdone=0;
-
- getmouseco_areawin (mval);
-
- /* Try object ipo or ob-constraint ipo selection */
- base= get_nearest_nlachannel_ob_key(&selx, &sel);
- marker=find_nearest_marker(SCE_MARKERS, 1);
- if (base) {
- isdone= 1;
-
- if (selectmode == SELECT_REPLACE){
- deselect_nlachannel_keys(0);
- selectmode = SELECT_ADD;
- }
-
- select_ipo_key(base->object->ipo, selx, selectmode);
-
- /* Try object constraint selection */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
- select_ipo_key(conchan->ipo, selx, selectmode);
- }
- else if (marker) {
- /* marker */
- if (selectmode == SELECT_REPLACE) {
- deselect_markers(0, 0);
- marker->flag |= SELECT;
- }
- else if (selectmode == SELECT_INVERT) {
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- }
- else if (selectmode == SELECT_ADD)
- marker->flag |= SELECT;
- else if (selectmode == SELECT_SUBTRACT)
- marker->flag &= ~SELECT;
-
- std_rmouse_transform(transform_markers);
-
- allqueue(REDRAWMARKER, 0);
- }
- else {
- /* Try action ipo selection */
- act= get_nearest_nlachannel_ac_key(&selx, &sel);
- if (act) {
- isdone= 1;
-
- if (selectmode == SELECT_REPLACE){
- deselect_nlachannel_keys(0);
- selectmode = SELECT_ADD;
- }
-
- for (chan=act->chanbase.first; chan; chan=chan->next) {
- select_ipo_key(chan->ipo, selx, selectmode);
- /* Try action constraint selection */
- for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next)
- select_ipo_key(conchan->ipo, selx, selectmode);
- }
- }
- else {
-
- /* Try nla strip selection */
- base= get_nearest_nlastrip(&rstrip, &sel);
- if (base){
- isdone= 1;
-
- if (!(G.qual & LR_SHIFTKEY)){
- deselect_nlachannel_keys(0);
- sel = 0;
- }
-
- if (sel)
- rstrip->flag &= ~ACTSTRIP_SELECT;
- else
- rstrip->flag |= ACTSTRIP_SELECT;
-
- set_active_strip(base->object, rstrip);
-
- if(base!=BASACT) set_active_base(base);
- }
- }
- }
-
- if(isdone) {
- std_rmouse_transform(transform_nlachannel_keys);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWNLA, 0);
- }
-}
-
-/* This function is currently more complicated than it seems like it should be.
-* However, this will be needed once the nla strip timeline is more complex */
-static Base *get_nearest_nlastrip (bActionStrip **rstrip, short *sel)
-{
- Base *base, *firstbase=NULL;
- bActionStrip *strip, *firststrip=NULL, *foundstrip=NULL;
- rctf rectf;
- float ymin, ymax;
- short mval[2];
- short foundsel = 0;
-
- getmouseco_areawin (mval);
-
- mval[0]-=7;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
-
- mval[0]+=14;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- ymax = (float)count_nla_levels();
- ymax *= (float)(NLACHANNELHEIGHT + NLACHANNELSKIP);
- ymax += (float)(NLACHANNELHEIGHT / 2);
-
- for (base = G.scene->base.first; base; base=base->next){
- if (nla_filter(base)) {
-
- /* Skip object ipos */
- ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- /* check if skip strips if collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Skip action ipos */
- if (base->object->action)
- ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- /* the strips */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next){
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
- /* Do Ytest */
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){
- /* Do XTest */
- if (!((rectf.xmax<strip->start) || (rectf.xmin>strip->end))){
- if (!firstbase){
- firstbase=base;
- firststrip=strip;
- *sel = strip->flag & ACTSTRIP_SELECT;
- }
-
- if (strip->flag & ACTSTRIP_SELECT){
- if (!foundsel){
- foundsel=1;
- foundstrip = strip;
- }
- }
- else if (foundsel && strip != foundstrip){
- *rstrip=strip;
- *sel = 0;
- return base;
- }
- }
- }
- ymax=ymin;
- }
- }
- }
- *rstrip=firststrip;
- return firstbase;
-}
-
-static Base *get_nearest_nlachannel_ob_key (float *index, short *sel)
-{
- Base *base;
- IpoCurve *icu;
- Base *firstbase=NULL;
- bConstraintChannel *conchan;
- int foundsel=0;
- float firstvertx=-1, foundx=-1;
- int i;
- short mval[2];
- float ymin, ymax;
- rctf rectf;
-
- *index=0;
-
- getmouseco_areawin (mval);
-
- mval[0]-=7;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
-
- mval[0]+=14;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- ymax = (float)count_nla_levels();
- ymax *= (float)(NLACHANNELHEIGHT + NLACHANNELSKIP);
- ymax += (float)(NLACHANNELHEIGHT / 2);
-
- *sel=0;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if (nla_filter(base)) {
- ymin= ymax - (NLACHANNELHEIGHT + NLACHANNELSKIP);
-
- /* Handle object ipo selection */
- if (base->object->ipo){
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){
- for (icu=base->object->ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0] > rectf.xmin && icu->bezt[i].vec[1][0] <= rectf.xmax ){
- if (!firstbase){
- firstbase=base;
- firstvertx=icu->bezt[i].vec[1][0];
- *sel = icu->bezt[i].f2 & 1;
- }
-
- if (icu->bezt[i].f2 & 1){
- if (!foundsel){
- foundsel=1;
- foundx = icu->bezt[i].vec[1][0];
- }
- }
- else if (foundsel && icu->bezt[i].vec[1][0] != foundx){
- *index=icu->bezt[i].vec[1][0];
- *sel = 0;
- return base;
- }
- }
- }
- }
- }
- }
- /* Handle object constraint ipos */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){
- if ( !((ymax < rectf.ymin) || (ymin > rectf.ymax)) && conchan->ipo){
- for (icu=conchan->ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0] > rectf.xmin && icu->bezt[i].vec[1][0] <= rectf.xmax ){
- if (!firstbase){
- firstbase=base;
- firstvertx=icu->bezt[i].vec[1][0];
- *sel = icu->bezt[i].f2 & 1;
- }
-
- if (icu->bezt[i].f2 & 1){
- if (!foundsel){
- foundsel=1;
- foundx = icu->bezt[i].vec[1][0];
- }
- }
- else if (foundsel && icu->bezt[i].vec[1][0] != foundx){
- *index=icu->bezt[i].vec[1][0];
- *sel = 0;
- return base;
- }
- }
- }
- }
- }
- }
-
- ymax=ymin;
-
- /* Skip actions and nlastrips if object is collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Skip action ipos */
- if (base->object->action){
- ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP);
- }
- /* Skip nlastrips */
- ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP)*BLI_countlist(&base->object->nlastrips);
- }
- }
-
- *index=firstvertx;
- return firstbase;
-}
-
-static bAction *get_nearest_nlachannel_ac_key (float *index, short *sel)
-{
- Base *base;
- IpoCurve *icu;
- bAction *firstact=NULL;
- bActionChannel *chan;
- bConstraintChannel *conchan;
- rctf rectf;
- float firstvert=-1, foundx=-1;
- float ymin, ymax, xmin, xmax;
- int i;
- int foundsel=0;
- short mval[2];
-
- *index=0;
-
- getmouseco_areawin (mval);
-
- mval[0]-=7;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
-
- mval[0]+=14;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- ymax = (float)count_nla_levels();
- ymax *= (float)(NLACHANNELHEIGHT + NLACHANNELSKIP);
- ymax += (float)(NLACHANNELHEIGHT / 2);
-
- *sel=0;
-
- for (base=G.scene->base.first; base; base=base->next){
- /* Handle object ipo selection */
- if (nla_filter(base)) {
-
- /* Skip object ipo and ob-constraint ipo */
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
-
- /* skip this object if it is collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- ymax=ymin;
-
- /* Handle action ipos */
- if (base->object->action){
- bAction *act= base->object->action;
-
- /* if action is mapped in NLA, it returns a correction */
- xmin= get_action_frame(base->object, rectf.xmin);
- xmax= get_action_frame(base->object, rectf.xmax);
-
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
- if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){
- for (chan=act->chanbase.first; chan; chan=chan->next){
- if(chan->ipo) {
- for (icu=chan->ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] <= xmax ){
- if (!firstact){
- firstact= act;
- firstvert=icu->bezt[i].vec[1][0];
- *sel = icu->bezt[i].f2 & 1;
- }
-
- if (icu->bezt[i].f2 & 1){
- if (!foundsel){
- foundsel=1;
- foundx = icu->bezt[i].vec[1][0];
- }
- }
- else if (foundsel && icu->bezt[i].vec[1][0] != foundx){
- *index=icu->bezt[i].vec[1][0];
- *sel = 0;
- return act;
- }
- }
- }
- }
- }
-
- for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){
- ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
- if ( !((ymax < rectf.ymin) || (ymin > rectf.ymax)) && conchan->ipo){
- for (icu=conchan->ipo->curve.first; icu; icu=icu->next){
- for (i=0; i<icu->totvert; i++){
- if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] <= xmax ){
- if (!firstact){
- firstact=base->object->action;
- firstvert=icu->bezt[i].vec[1][0];
- *sel = icu->bezt[i].f2 & 1;
- }
-
- if (icu->bezt[i].f2 & 1){
- if (!foundsel){
- foundsel=1;
- foundx = icu->bezt[i].vec[1][0];
- }
- }
- else if (foundsel && icu->bezt[i].vec[1][0] != foundx){
- *index=icu->bezt[i].vec[1][0];
- *sel = 0;
- return base->object->action;
- }
- }
- }
- }
- }
- ymax=ymin;
- }
-
-
- }
- }
- ymax=ymin;
- }
-
- /* Skip nlastrips */
- ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP)*BLI_countlist(&base->object->nlastrips);
- }
- }
-
- *index=firstvert;
- return firstact;
-}
-
-void deselect_nlachannels(int test)
-{
- Base *base;
- int sel = 1;
-
- if (test){
- for (base=G.scene->base.first; base; base=base->next){
- /* Check base flags for previous selection */
- if (base->flag & SELECT){
- sel=0;
- break;
- }
- }
- }
- else
- sel = 0;
-
- /* Select objects */
- for (base=G.scene->base.first; base; base=base->next){
- if (sel){
- if (nla_filter(base))
- base->flag |= SELECT;
- }
- else
- base->flag &= ~SELECT;
-
- base->object->flag= base->flag;
- }
-}
-
-static Object *get_object_from_active_strip(void) {
-
- Base *base;
- bActionStrip *strip;
-
- for (base=G.scene->base.first; base; base=base->next) {
- if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) {
- for (strip = base->object->nlastrips.first;
- strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT) {
- return base->object;
- }
- }
- }
- }
- return NULL;
-}
-
-
-void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceNla *snla = curarea->spacedata.first;
- int doredraw= 0;
- short mval[2];
- float dx,dy;
- int cfra;
- short mousebut = L_MOUSE;
- Object *ob; //in shift-B / bake
-
- if (curarea->win==0) return;
- if (!snla) return;
-
- if(val) {
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- getmouseco_areawin(mval);
-
- switch(event) {
- case UI_BUT_EVENT:
- do_nlabuts(val); // in drawnla.c
- break;
-
- case HOMEKEY:
- do_nla_buttons(B_NLAHOME);
- break;
-
- case EQUALKEY:
- shift_nlastrips_up();
- break;
-
- case PAGEUPKEY:
- if (G.qual & LR_CTRLKEY)
- shift_nlastrips_up();
- else {
- nextprev_marker(1);
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- case MINUSKEY:
- shift_nlastrips_down();
- break;
-
- case PAGEDOWNKEY:
- if (G.qual & LR_CTRLKEY)
- shift_nlastrips_down();
- else {
- nextprev_marker(-1);
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- case AKEY:
- if (G.qual & LR_SHIFTKEY){
- add_nlablock();
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWVIEW3D, 0);
- }
- else if (G.qual & LR_CTRLKEY) {
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- }
- else{
- if (mval[0]>=NLAWIDTH)
- deselect_nlachannel_keys(1);
- else{
- deselect_nlachannels(1);
- allqueue (REDRAWVIEW3D, 0);
- }
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
- BIF_undo_push("(De)select all NLA");
- }
- break;
-
- case BKEY:
- if (G.qual & LR_SHIFTKEY){
- bake_all_to_action();
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWVIEW3D, 0);
- BIF_undo_push("Bake All To Action");
- ob = get_object_from_active_strip();
- //build_match_caches(ob);
- }
- else if (G.qual & LR_CTRLKEY)
- borderselect_markers();
- else
- borderselect_nla();
- break;
-
- case CKEY:
- if(G.qual==LR_CTRLKEY) {
- if(okee("Copy Modifiers"))
- copy_action_modifiers();
- }
- else convert_nla();
- break;
-
- case DKEY:
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY) && mval[0]>=NLAWIDTH) {
- duplicate_marker();
- }
- else if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){
- duplicate_nlachannel_keys();
- update_for_newframe_muted();
- }
-
- break;
-
- case EKEY:
- if (mval[0] >= NLAWIDTH) {
- transform_nlachannel_keys ('e', 0);
- update_for_newframe_muted();
- }
- break;
-
- case GKEY:
- if (mval[0]>=NLAWIDTH) {
- if (G.qual & LR_CTRLKEY) {
- transform_markers('g', 0);
- }
- else {
- transform_nlachannel_keys ('g', 0);
- update_for_newframe_muted();
- }
- }
- break;
-
- case MKEY:
- /* marker operations */
- if (G.qual == 0)
- add_marker(CFRA);
- else if (G.qual == LR_CTRLKEY)
- rename_marker();
- else
- break;
- allqueue(REDRAWMARKER, 0);
- break;
-
- case NKEY:
- if(G.qual==0) {
- toggle_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- scrarea_queue_winredraw(curarea);
- }
- else if (G.qual & LR_SHIFTKEY) {
- add_empty_nlablock();
- }
- break;
- case LKEY:
- relink_active_strip();
- break;
-
- case PKEY:
- if (G.qual & LR_CTRLKEY) /* set preview range */
- anim_previewrange_set();
- else if (G.qual & LR_ALTKEY) /* clear preview range */
- anim_previewrange_clear();
- allqueue(REDRAWMARKER, 0);
- break;
-
- case SKEY:
- if (G.qual==LR_ALTKEY) {
- val= pupmenu("Action Strip Scale%t|Reset Strip Scale%x1|Remap Action Start/End%x2|Apply Scale%x3");
- if (val > 0)
- reset_action_strips(val);
- }
- else if (G.qual & LR_SHIFTKEY) {
- if (snla->flag & SNLA_DRAWTIME)
- val= pupmenu("Snap To%t|Nearest Second%x3|Current Time%x2");
- else
- val= pupmenu("Snap To%t|Nearest Frame%x1|Current Frame%x2");
- if (ELEM3(val, 1, 2, 3))
- snap_action_strips(val);
- }
- else {
- if (mval[0]>=NLAWIDTH)
- transform_nlachannel_keys ('s', 0);
- update_for_newframe_muted();
- }
- break;
-
- case TKEY:
- if (G.qual & LR_CTRLKEY) {
- val= pupmenu("Time value%t|Frames %x1|Seconds%x2");
-
- if (val > 0) {
- if (val == 2) snla->flag |= SNLA_DRAWTIME;
- else snla->flag &= ~SNLA_DRAWTIME;
-
- doredraw= 1;
- }
- }
- break;
-
- case DELKEY:
- case XKEY:
- if (mval[0] >= NLAWIDTH) {
- /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
- if (G.qual == LR_SHIFTKEY) {
- if (okee("Erase selected marker(s)?"))
- remove_marker();
- }
- else {
- if (okee("Erase selected?")) {
- delete_nlachannel_keys();
- update_for_newframe_muted();
- }
- }
-
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
- * based on user preference USER_LMOUSESELECT
- */
- case LEFTMOUSE:
- if(view2dmove(LEFTMOUSE))
- break; // only checks for sliders
- else if (mval[0]>=snla->v2d.mask.xmin) {
- do {
- getmouseco_areawin(mval);
-
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- cfra= (int)(dx+0.5f);
- if(cfra< 1) cfra= 1;
-
- if( cfra!=CFRA ) {
- CFRA= cfra;
- update_for_newframe();
- force_draw_all(0);
- }
- else PIL_sleep_ms(30);
-
- } while(get_mbut() & mousebut);
- break;
- }
- /* else pass on! */
- case RIGHTMOUSE:
- if (mval[0]>=snla->v2d.mask.xmin) {
- if(G.qual & LR_SHIFTKEY)
- mouse_nla(SELECT_INVERT);
- else
- mouse_nla(SELECT_REPLACE);
- }
- else
- mouse_nlachannels(mval);
- break;
-
- case PADPLUSKEY:
- view2d_zoom(G.v2d, 0.1154f, sa->winx, sa->winy);
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case PADMINUS:
- view2d_zoom(G.v2d, -0.15f, sa->winx, sa->winy);
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- }
- }
-
- if(doredraw) scrarea_queue_winredraw(curarea);
-}
-
-void bake_all_to_action(void)
-{
- Object *ob;
- bAction *newAction;
- Ipo *ipo;
- ID *id;
- short hold, add;
- float repeat;
-
- /* burn object-level motion into a new action */
- ob = get_object_from_active_strip();
- if (ob) {
- if (ob->flag&OB_ARMATURE) {
- //newAction = bake_obIPO_to_action(ob);
- newAction = NULL;
- if (newAction) {
- /* unlink the object's IPO */
- ipo=ob->ipo;
- if (ipo) {
- id = &ipo->id;
- if (id->us > 0)
- id->us--;
- ob->ipo = NULL;
- }
-
- /* add the new Action to NLA as a strip */
- hold=1;
- add=1;
- repeat=1.0;
- printf("about to add nla block...\n");
- add_nla_block_by_name(newAction->id.name, ob, hold, add, repeat);
- BIF_undo_push("Add NLA strip");
- }
- }
- }
-}
-
-void copy_action_modifiers(void)
-{
- bActionStrip *strip, *actstrip;
- Object *ob= OBACT;
-
- if(ob==NULL)
- return;
-
- /* active strip */
- for (actstrip=ob->nlastrips.first; actstrip; actstrip=actstrip->next)
- if(actstrip->flag & ACTSTRIP_ACTIVE)
- break;
- if(actstrip==NULL)
- return;
-
- /* copy to selected items */
- for (strip=ob->nlastrips.first; strip; strip=strip->next){
- if (strip->flag & ACTSTRIP_SELECT) {
- if(strip!=actstrip) {
- if (strip->modifiers.first)
- BLI_freelistN(&strip->modifiers);
- if (actstrip->modifiers.first)
- duplicatelist (&strip->modifiers, &actstrip->modifiers);
- }
- }
- }
-
- BIF_undo_push("Copy Action Modifiers");
- allqueue(REDRAWNLA, 0);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-}
-
diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c
deleted file mode 100644
index 8fb47510485..00000000000
--- a/source/blender/src/editnode.c
+++ /dev/null
@@ -1,2694 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): David Millan Escriva, Juho Vepsäläinen
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_action_types.h"
-#include "DNA_color_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_node_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_colortools.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_texture.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_cursors.h"
-#include "BIF_editview.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_renderwin.h"
-#include "BIF_space.h"
-#include "BIF_scrarea.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_storage_types.h"
-
-#include "BDR_editobject.h"
-#include "BDR_gpencil.h"
-
-#include "RE_pipeline.h"
-#include "IMB_imbuf_types.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "PIL_time.h"
-#include "mydevice.h"
-#include "winlay.h"
-
-
-/* currently called from BIF_preview_changed */
-void snode_tag_dirty(SpaceNode *snode)
-{
- bNode *node;
-
- if(snode->treetype==NTREE_SHADER) {
- if(snode->nodetree) {
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->type==SH_NODE_OUTPUT)
- node->lasty= 0;
- }
- snode->flag |= SNODE_DO_PREVIEW; /* this adds an afterqueue on a redraw, to allow button previews to work first */
- }
- }
- allqueue(REDRAWNODE, 1);
-}
-
-static void shader_node_previewrender(ScrArea *sa, SpaceNode *snode)
-{
- bNode *node;
-
- if(snode->id==NULL) return;
- if( ((Material *)snode->id )->use_nodes==0 ) return;
-
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->type==SH_NODE_OUTPUT) {
- if(node->flag & NODE_DO_OUTPUT) {
- if(node->lasty<PREVIEW_RENDERSIZE-2) {
- RenderInfo ri;
-// int test= node->lasty;
-
- ri.curtile = 0;
- ri.tottile = 0;
- ri.rect = NULL;
- ri.pr_rectx = PREVIEW_RENDERSIZE;
- ri.pr_recty = PREVIEW_RENDERSIZE;
-
- BIF_previewrender(snode->id, &ri, NULL, PR_DO_RENDER); /* sends redraw event */
- if(ri.rect) MEM_freeN(ri.rect);
-
- /* when not finished... */
- if(ri.curtile<ri.tottile)
- addafterqueue(sa->win, RENDERPREVIEW, 1);
-// if(test!=node->lasty)
-// printf("node rendered to %d\n", node->lasty);
-
- break;
- }
- }
- }
- }
-}
-
-
-static void snode_handle_recalc(SpaceNode *snode)
-{
- if(snode->treetype==NTREE_SHADER) {
- BIF_preview_changed(ID_MA); /* signals buttons windows and node editors */
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- if(G.scene->use_nodes) {
- snode->nodetree->timecursor= set_timecursor;
- G.afbreek= 0;
- snode->nodetree->test_break= blender_test_break;
-
- BIF_store_spare();
-
- ntreeCompositExecTree(snode->nodetree, &G.scene->r, 1); /* 1 is do_previews */
-
- snode->nodetree->timecursor= NULL;
- snode->nodetree->test_break= NULL;
- waitcursor(0);
-
- allqueue(REDRAWIMAGE, 1);
- if(G.scene->r.scemode & R_DOCOMP) {
- BIF_redraw_render_rect(); /* seems to screwup display? */
- mywinset(curarea->win);
- }
- }
-
- allqueue(REDRAWNODE, 1);
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- ntreeTexUpdatePreviews(snode->nodetree);
- }
-}
-
-static void shader_node_event(SpaceNode *snode, short event)
-{
- switch(event) {
- case B_REDR:
- allqueue(REDRAWNODE, 1);
- break;
- default:
- /* B_NODE_EXEC */
- snode_handle_recalc(snode);
- break;
-
- }
-}
-
-static int image_detect_file_sequence(int *start_p, int *frames_p, char *str)
-{
- SpaceFile *sfile;
- char name[FILE_MAX], head[FILE_MAX], tail[FILE_MAX], filename[FILE_MAX];
- int a, frame, totframe, found, minframe;
- unsigned short numlen;
-
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==NULL || sfile->filelist==NULL)
- return 0;
-
- /* find first frame */
- found= 0;
- minframe= 0;
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- BLI_strncpy(name, sfile->filelist[a].relname, sizeof(name));
- frame= BLI_stringdec(name, head, tail, &numlen);
-
- if(!found || frame < minframe) {
- BLI_strncpy(filename, name, sizeof(name));
- minframe= frame;
- found= 1;
- }
- }
- }
-
- /* not one frame found */
- if(!found)
- return 0;
-
- /* counter number of following frames */
- found= 1;
- totframe= 0;
-
- for(frame=minframe; found; frame++) {
- found= 0;
- BLI_strncpy(name, filename, sizeof(name));
- BLI_stringenc(name, head, tail, numlen, frame);
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if(strcmp(sfile->filelist[a].relname, name) == 0) {
- found= 1;
- totframe++;
- break;
- }
- }
- }
- }
-
- if(totframe > 1) {
- BLI_strncpy(str, sfile->dir, sizeof(name));
- strcat(str, filename);
-
- *start_p= minframe;
- *frames_p= totframe;
- return 1;
- }
-
- return 0;
-}
-
-static void load_node_image(char *str) /* called from fileselect */
-{
- SpaceNode *snode= curarea->spacedata.first;
- bNode *node= nodeGetActive(snode->edittree);
- Image *ima= NULL;
- ImageUser *iuser= node->storage;
- char filename[FILE_MAX];
- int start=0, frames=0, sequence;
-
- sequence= image_detect_file_sequence(&start, &frames, filename);
- if(sequence)
- str= filename;
-
- ima= BKE_add_image_file(str);
- if(ima) {
- if(node->id)
- node->id->us--;
-
- node->id= &ima->id;
- id_us_plus(node->id);
-
- BLI_strncpy(node->name, node->id->name+2, 21);
-
- if(sequence) {
- ima->source= IMA_SRC_SEQUENCE;
- iuser->frames= frames;
- iuser->offset= start-1;
- }
-
- BKE_image_signal(ima, node->storage, IMA_SIGNAL_RELOAD);
-
- NodeTagChanged(snode->edittree, node);
- snode_handle_recalc(snode);
- allqueue(REDRAWNODE, 0);
- }
-}
-
-static void set_node_imagepath(char *str) /* called from fileselect */
-{
- SpaceNode *snode= curarea->spacedata.first;
- bNode *node= nodeGetActive(snode->edittree);
- BLI_strncpy(((NodeImageFile *)node->storage)->name, str, sizeof( ((NodeImageFile *)node->storage)->name ));
-}
-
-static bNode *snode_get_editgroup(SpaceNode *snode)
-{
- bNode *gnode;
-
- /* get the groupnode */
- for(gnode= snode->nodetree->nodes.first; gnode; gnode= gnode->next)
- if(gnode->flag & NODE_GROUP_EDIT)
- break;
- return gnode;
-}
-
-/* node has to be of type 'render layers' */
-/* is a bit clumsy copying renderdata here... scene nodes use render size of current render */
-static void composite_node_render(SpaceNode *snode, bNode *node)
-{
- RenderData rd;
- Scene *scene= NULL;
- int scemode, actlay;
-
- /* the button press won't show up otherwise, button hilites disabled */
- force_draw(0);
-
- if(node->id && node->id!=(ID *)G.scene) {
- scene= G.scene;
- set_scene_bg((Scene *)node->id);
- rd= G.scene->r;
- G.scene->r.xsch= scene->r.xsch;
- G.scene->r.ysch= scene->r.ysch;
- G.scene->r.size= scene->r.size;
- G.scene->r.mode &= ~(R_BORDER|R_DOCOMP);
- G.scene->r.mode |= scene->r.mode & R_BORDER;
- G.scene->r.border= scene->r.border;
- G.scene->r.cfra= scene->r.cfra;
- }
-
- scemode= G.scene->r.scemode;
- actlay= G.scene->r.actlay;
-
- G.scene->r.scemode |= R_SINGLE_LAYER|R_COMP_RERENDER;
- G.scene->r.actlay= node->custom1;
-
- BIF_do_render(0);
-
- G.scene->r.scemode= scemode;
- G.scene->r.actlay= actlay;
-
- node->custom2= 0;
-
- if(scene) {
- G.scene->r= rd;
- set_scene_bg(scene);
- }
-}
-
-static void composit_node_event(SpaceNode *snode, short event)
-{
-
- switch(event) {
- case B_REDR:
- allqueue(REDRAWNODE, 1);
- break;
- case B_NODE_LOADIMAGE:
- {
- bNode *node= nodeGetActive(snode->edittree);
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if(node->id)
- strcpy(name, ((Image *)node->id)->name);
- else strcpy(name, U.textudir);
- if (G.qual & LR_CTRLKEY) {
- activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image);
- } else {
- activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image);
- }
- break;
- }
- case B_NODE_SETIMAGE:
- {
- bNode *node= nodeGetActive(snode->edittree);
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- strcpy(name, ((NodeImageFile *)node->storage)->name);
- if (G.qual & LR_CTRLKEY) {
- activate_imageselect(FILE_SPECIAL, "SELECT OUTPUT DIR", name, set_node_imagepath);
- } else {
- activate_fileselect(FILE_SPECIAL, "SELECT OUTPUT DIR", name, set_node_imagepath);
- }
- break;
- }
- case B_NODE_TREE_EXEC:
- snode_handle_recalc(snode);
- break;
- default:
- /* B_NODE_EXEC */
- {
- bNode *node= BLI_findlink(&snode->edittree->nodes, event-B_NODE_EXEC);
- if(node) {
- NodeTagChanged(snode->edittree, node);
- /* don't use NodeTagIDChanged, it gives far too many recomposites for image, scene layers, ... */
-
- /* not the best implementation of the world... but we need it to work now :) */
- if(node->type==CMP_NODE_R_LAYERS && node->custom2) {
- /* add event for this window (after render curarea can be changed) */
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
-
- composite_node_render(snode, node);
- snode_handle_recalc(snode);
-
- /* add another event, a render can go fullscreen and open new window */
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
- }
- else {
- node= snode_get_editgroup(snode);
- if(node)
- NodeTagIDChanged(snode->nodetree, node->id);
-
- snode_handle_recalc(snode);
- }
- }
- }
- }
-}
-
-static void texture_node_event(SpaceNode *snode, short event)
-{
- switch(event) {
- case B_REDR:
- allqueue(REDRAWNODE, 1);
- break;
- case B_NODE_LOADIMAGE:
- {
- bNode *node= nodeGetActive(snode->edittree);
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if(node->id)
- strcpy(name, ((Image *)node->id)->name);
- else strcpy(name, U.textudir);
- if (G.qual & LR_CTRLKEY) {
- activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image);
- } else {
- activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image);
- }
- break;
- }
- default:
- /* B_NODE_EXEC */
- ntreeTexCheckCyclics( snode->nodetree );
- snode_handle_recalc(snode);
- allqueue(REDRAWNODE, 1);
- break;
- }
-}
-
-
-/* assumes nothing being done in ntree yet, sets the default in/out node */
-/* called from shading buttons or header */
-void node_shader_default(Material *ma)
-{
- bNode *in, *out;
- bNodeSocket *fromsock, *tosock;
-
- /* but lets check it anyway */
- if(ma->nodetree) {
- printf("error in shader initialize\n");
- return;
- }
-
- ma->nodetree= ntreeAddTree(NTREE_SHADER);
-
- out= nodeAddNodeType(ma->nodetree, SH_NODE_OUTPUT, NULL, NULL);
- out->locx= 300.0f; out->locy= 300.0f;
-
- in= nodeAddNodeType(ma->nodetree, SH_NODE_MATERIAL, NULL, NULL);
- in->locx= 10.0f; in->locy= 300.0f;
- nodeSetActive(ma->nodetree, in);
-
- /* only a link from color to color */
- fromsock= in->outputs.first;
- tosock= out->inputs.first;
- nodeAddLink(ma->nodetree, in, fromsock, out, tosock);
-
- ntreeSolveOrder(ma->nodetree); /* needed for pointers */
-}
-
-/* assumes nothing being done in ntree yet, sets the default in/out node */
-/* called from shading buttons or header */
-void node_composit_default(Scene *sce)
-{
- bNode *in, *out;
- bNodeSocket *fromsock, *tosock;
-
- /* but lets check it anyway */
- if(sce->nodetree) {
- printf("error in composit initialize\n");
- return;
- }
-
- sce->nodetree= ntreeAddTree(NTREE_COMPOSIT);
-
- out= nodeAddNodeType(sce->nodetree, CMP_NODE_COMPOSITE, NULL, NULL);
- out->locx= 300.0f; out->locy= 400.0f;
-
- in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_LAYERS, NULL, NULL);
- in->locx= 10.0f; in->locy= 400.0f;
- nodeSetActive(sce->nodetree, in);
-
- /* links from color to color */
- fromsock= in->outputs.first;
- tosock= out->inputs.first;
- nodeAddLink(sce->nodetree, in, fromsock, out, tosock);
-
- ntreeSolveOrder(sce->nodetree); /* needed for pointers */
-
- ntreeCompositForceHidden(sce->nodetree);
-}
-
-/* assumes nothing being done in ntree yet, sets the default in/out node */
-/* called from shading buttons or header */
-void node_texture_default(Tex *tx)
-{
- bNode *in, *out;
- bNodeSocket *fromsock, *tosock;
-
- /* but lets check it anyway */
- if(tx->nodetree) {
- printf("error in texture initialize\n");
- return;
- }
-
- tx->nodetree= ntreeAddTree(NTREE_TEXTURE);
-
- out= nodeAddNodeType(tx->nodetree, TEX_NODE_OUTPUT, NULL, NULL);
- out->locx= 300.0f; out->locy= 300.0f;
-
- in= nodeAddNodeType(tx->nodetree, TEX_NODE_CHECKER, NULL, NULL);
- in->locx= 10.0f; in->locy= 300.0f;
- nodeSetActive(tx->nodetree, in);
-
- fromsock= in->outputs.first;
- tosock= out->inputs.first;
- nodeAddLink(tx->nodetree, in, fromsock, out, tosock);
-
- ntreeSolveOrder(tx->nodetree); /* needed for pointers */
- ntreeTexUpdatePreviews(tx->nodetree);
-}
-
-/* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */
-void snode_set_context(SpaceNode *snode)
-{
- Object *ob= OBACT;
- bNode *node= NULL;
-
- snode->nodetree= NULL;
- snode->id= snode->from= NULL;
-
- if(snode->treetype==NTREE_SHADER) {
- /* need active object, or we allow pinning... */
- if(ob) {
- Material *ma= give_current_material(ob, ob->actcol);
- if(ma) {
- snode->from= material_from(ob, ob->actcol);
- snode->id= &ma->id;
- snode->nodetree= ma->nodetree;
- }
- }
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- snode->from= NULL;
- snode->id= &G.scene->id;
-
- /* bit clumsy but reliable way to see if we draw first time */
- if(snode->nodetree==NULL)
- ntreeCompositForceHidden(G.scene->nodetree);
-
- snode->nodetree= G.scene->nodetree;
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- if(ob) {
- Tex *tx= give_current_texture(ob, ob->actcol);
- if(tx) {
- snode->from= (ID*)ob; /* please check this; i have no idea what 'from' is. */
- snode->id= &tx->id;
- snode->nodetree= tx->nodetree;
- }
- }
- }
-
- /* find editable group */
- if(snode->nodetree)
- for(node= snode->nodetree->nodes.first; node; node= node->next)
- if(node->flag & NODE_GROUP_EDIT)
- break;
-
- if(node && node->id)
- snode->edittree= (bNodeTree *)node->id;
- else
- snode->edittree= snode->nodetree;
-}
-
-/* on activate image viewer, check if we show it */
-static void node_active_image(Image *ima)
-{
- ScrArea *sa;
- SpaceImage *sima= NULL;
-
- /* find an imagewindow showing render result */
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- sima= sa->spacedata.first;
- if(sima->image && sima->image->source!=IMA_SRC_VIEWER)
- break;
- }
- }
- if(sa && sima) {
- sima->image= ima;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
-}
-
-
-static void node_set_active(SpaceNode *snode, bNode *node)
-{
-
- nodeSetActive(snode->edittree, node);
-
- if(node->type!=NODE_GROUP) {
-
- /* tree specific activate calls */
- if(snode->treetype==NTREE_SHADER) {
-
- /* when we select a material, active texture is cleared, for buttons */
- if(node->id && GS(node->id->name)==ID_MA)
- nodeClearActiveID(snode->edittree, ID_TE);
- if(node->id)
- BIF_preview_changed(-1); /* temp hack to force texture preview to update */
-
- allqueue(REDRAWBUTSSHADING, 1);
- allqueue(REDRAWIPO, 0);
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- /* make active viewer, currently only 1 supported... */
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
- bNode *tnode;
- int was_output= node->flag & NODE_DO_OUTPUT;
-
- for(tnode= snode->edittree->nodes.first; tnode; tnode= tnode->next)
- if( ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- tnode->flag &= ~NODE_DO_OUTPUT;
-
- node->flag |= NODE_DO_OUTPUT;
- if(was_output==0) {
- bNode *gnode;
-
- NodeTagChanged(snode->edittree, node);
-
- /* if inside group, tag entire group */
- gnode= snode_get_editgroup(snode);
- if(gnode)
- NodeTagIDChanged(snode->nodetree, gnode->id);
-
- snode_handle_recalc(snode);
- }
-
- /* addnode() doesnt link this yet... */
- node->id= (ID *)BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
- }
- else if(node->type==CMP_NODE_IMAGE) {
- if(node->id)
- node_active_image((Image *)node->id);
- }
- else if(node->type==CMP_NODE_R_LAYERS) {
- if(node->id==NULL || node->id==(ID *)G.scene) {
- G.scene->r.actlay= node->custom1;
- allqueue(REDRAWBUTSSCENE, 0);
- }
- }
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- if(node->id)
- BIF_preview_changed(-1);
- allqueue(REDRAWBUTSSHADING, 1);
- allqueue(REDRAWIPO, 0);
- }
- }
-}
-
-void snode_make_group_editable(SpaceNode *snode, bNode *gnode)
-{
- bNode *node;
-
- /* make sure nothing has group editing on */
- for(node= snode->nodetree->nodes.first; node; node= node->next)
- node->flag &= ~NODE_GROUP_EDIT;
-
- if(gnode==NULL) {
- /* with NULL argument we do a toggle */
- if(snode->edittree==snode->nodetree)
- gnode= nodeGetActive(snode->nodetree);
- }
-
- if(gnode && gnode->type==NODE_GROUP && gnode->id) {
- if(gnode->id->lib) {
- if(okee("Make Group Local"))
- ntreeMakeLocal((bNodeTree *)gnode->id);
- else
- return;
- }
- gnode->flag |= NODE_GROUP_EDIT;
- snode->edittree= (bNodeTree *)gnode->id;
-
- /* deselect all other nodes, so we can also do grabbing of entire subtree */
- for(node= snode->nodetree->nodes.first; node; node= node->next)
- node->flag &= ~SELECT;
- gnode->flag |= SELECT;
-
- }
- else
- snode->edittree= snode->nodetree;
-
- ntreeSolveOrder(snode->nodetree);
-
- /* finally send out events for new active node */
- if(snode->treetype==NTREE_SHADER) {
- allqueue(REDRAWBUTSSHADING, 0);
-
- BIF_preview_changed(-1); /* temp hack to force texture preview to update */
- }
-
- allqueue(REDRAWNODE, 0);
-}
-
-void node_ungroup(SpaceNode *snode)
-{
- bNode *gnode;
-
- /* are we inside of a group? */
- gnode= snode_get_editgroup(snode);
- if(gnode)
- snode_make_group_editable(snode, NULL);
-
- gnode= nodeGetActive(snode->edittree);
- if(gnode==NULL) return;
-
- if(gnode->type!=NODE_GROUP)
- error("Not a group");
- else {
- if(nodeGroupUnGroup(snode->edittree, gnode)) {
-
- BIF_undo_push("Deselect all nodes");
- allqueue(REDRAWNODE, 0);
- }
- else
- error("Can't ungroup");
- }
-}
-
-/* when links in groups change, inputs/outputs change, nodes added/deleted... */
-static void snode_verify_groups(SpaceNode *snode)
-{
- bNode *gnode;
-
- gnode= snode_get_editgroup(snode);
-
- /* does all materials */
- if(gnode)
- nodeVerifyGroup((bNodeTree *)gnode->id);
-
-}
-
-static void node_addgroup(SpaceNode *snode)
-{
- bNodeTree *ngroup;
- int tot= 0, offs, val;
- char *strp;
-
- if(snode->edittree!=snode->nodetree) {
- error("Can not add a Group in a Group");
- return;
- }
-
- /* construct menu with choices */
- for(ngroup= G.main->nodetree.first; ngroup; ngroup= ngroup->id.next) {
- if(ngroup->type==snode->treetype)
- tot++;
- }
- if(tot==0) {
- error("No groups available in database");
- return;
- }
- strp= MEM_mallocN(32*tot+32, "menu");
- strcpy(strp, "Add Group %t");
- offs= strlen(strp);
-
- for(tot=0, ngroup= G.main->nodetree.first; ngroup; ngroup= ngroup->id.next, tot++) {
- if(ngroup->type==snode->treetype)
- offs+= sprintf(strp+offs, "|%s %%x%d", ngroup->id.name+2, tot);
- }
-
- val= pupmenu(strp);
- if(val>=0) {
- ngroup= BLI_findlink(&G.main->nodetree, val);
- if(ngroup) {
- bNode *node= nodeAddNodeType(snode->edittree, NODE_GROUP, ngroup, NULL);
-
- /* generics */
- if(node) {
- float locx, locy;
- short mval[2];
-
- node_deselectall(snode, 0);
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &locx, &locy);
-
- node->locx= locx;
- node->locy= locy + 60.0f; // arbitrary.. so its visible
- node->flag |= SELECT;
-
- id_us_plus(node->id);
-
- node_set_active(snode, node);
- BIF_undo_push("Add Node");
- }
- }
- }
- MEM_freeN(strp);
-}
-
-
-/* ************************** Node generic ************** */
-
-/* allows to walk the list in order of visibility */
-static bNode *next_node(bNodeTree *ntree)
-{
- static bNode *current=NULL, *last= NULL;
-
- if(ntree) {
- /* set current to the first selected node */
- for(current= ntree->nodes.last; current; current= current->prev)
- if(current->flag & NODE_SELECT)
- break;
-
- /* set last to the first unselected node */
- for(last= ntree->nodes.last; last; last= last->prev)
- if((last->flag & NODE_SELECT)==0)
- break;
-
- if(current==NULL)
- current= last;
-
- return NULL;
- }
- /* no nodes, or we are ready */
- if(current==NULL)
- return NULL;
-
- /* now we walk the list backwards, but we always return current */
- if(current->flag & NODE_SELECT) {
- bNode *node= current;
-
- /* find previous selected */
- current= current->prev;
- while(current && (current->flag & NODE_SELECT)==0)
- current= current->prev;
-
- /* find first unselected */
- if(current==NULL)
- current= last;
-
- return node;
- }
- else {
- bNode *node= current;
-
- /* find previous unselected */
- current= current->prev;
- while(current && (current->flag & NODE_SELECT))
- current= current->prev;
-
- return node;
- }
-
- return NULL;
-}
-
-/* is rct in visible part of node? */
-static bNode *visible_node(SpaceNode *snode, rctf *rct)
-{
- bNode *tnode;
-
- for(next_node(snode->edittree); (tnode=next_node(NULL));) {
- if(BLI_isect_rctf(&tnode->totr, rct, NULL))
- break;
- }
- return tnode;
-}
-
-void snode_home(ScrArea *sa, SpaceNode *snode)
-{
- bNode *node;
- int first= 1;
-
- snode->v2d.cur.xmin= snode->v2d.cur.ymin= 0.0f;
- snode->v2d.cur.xmax= sa->winx;
- snode->v2d.cur.xmax= sa->winy;
-
- if(snode->edittree) {
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(first) {
- first= 0;
- snode->v2d.cur= node->totr;
- }
- else {
- BLI_union_rctf(&snode->v2d.cur, &node->totr);
- }
- }
- }
- snode->v2d.tot= snode->v2d.cur;
-
- snode->xof = snode->yof = 0.0;
-
- test_view2d(G.v2d, sa->winx, sa->winy);
-
-}
-
-void snode_zoom_out(ScrArea *sa)
-{
- float dx;
-
- dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin-= dx;
- G.v2d->cur.xmax+= dx;
- dx= (float)(0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin));
- G.v2d->cur.ymin-= dx;
- G.v2d->cur.ymax+= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
-}
-
-void snode_zoom_in(ScrArea *sa)
-{
- float dx;
-
- dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- dx= (float)(0.1154*(G.v2d->cur.ymax-G.v2d->cur.ymin));
- G.v2d->cur.ymin+= dx;
- G.v2d->cur.ymax-= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
-}
-
-static void snode_bg_viewmove(SpaceNode *snode)
-{
- ScrArea *sa;
- Image *ima;
- ImBuf *ibuf;
- Window *win;
- short mval[2], mvalo[2];
- short rectx, recty, xmin, xmax, ymin, ymax, pad;
- int oldcursor;
-
- ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
- ibuf= BKE_image_get_ibuf(ima, NULL);
-
- sa = snode->area;
-
- if(ibuf) {
- rectx = ibuf->x;
- recty = ibuf->y;
- } else {
- rectx = recty = 1;
- }
-
- pad = 10;
- xmin = -(sa->winx/2) - rectx/2 + pad;
- xmax = sa->winx/2 + rectx/2 - pad;
- ymin = -(sa->winy/2) - recty/2 + pad;
- ymax = sa->winy/2 + recty/2 - pad;
-
- getmouseco_sc(mvalo);
-
- /* store the old cursor to temporarily change it */
- oldcursor=get_cursor();
- win=winlay_get_active_window();
-
- SetBlenderCursor(BC_NSEW_SCROLLCURSOR);
-
- while(get_mbut()&(L_MOUSE|M_MOUSE)) {
-
- getmouseco_sc(mval);
-
- if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) {
-
- snode->xof -= (mvalo[0]-mval[0]);
- snode->yof -= (mvalo[1]-mval[1]);
-
- /* prevent dragging image outside of the window and losing it! */
- CLAMP(snode->xof, xmin, xmax);
- CLAMP(snode->yof, ymin, ymax);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else BIF_wait_for_statechange();
- }
-
- window_set_cursor(win, oldcursor);
-}
-
-static void reset_sel_socket(SpaceNode *snode, int in_out)
-{
- bNode *node;
- bNodeSocket *sock;
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(in_out & SOCK_IN) {
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_SEL) sock->flag&= ~SOCK_SEL;
- }
- if(in_out & SOCK_OUT) {
- for(sock= node->outputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_SEL) sock->flag&= ~SOCK_SEL;
- }
- }
-}
-
-/* checks mouse position, and returns found node/socket */
-/* type is SOCK_IN and/or SOCK_OUT */
-static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, int in_out)
-{
- bNode *node;
- bNodeSocket *sock;
- rctf rect;
- short mval[2];
-
- getmouseco_areawin(mval);
-
- /* check if we click in a socket */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
-
- areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin);
-
- rect.xmin -= NODE_SOCKSIZE+3;
- rect.ymin -= NODE_SOCKSIZE+3;
- rect.xmax = rect.xmin + 2*NODE_SOCKSIZE+6;
- rect.ymax = rect.ymin + 2*NODE_SOCKSIZE+6;
-
- if (!(node->flag & NODE_HIDDEN)) {
- /* extra padding inside and out - allow dragging on the text areas too */
- if (in_out == SOCK_IN) {
- rect.xmax += NODE_SOCKSIZE;
- rect.xmin -= NODE_SOCKSIZE*4;
- } else if (in_out == SOCK_OUT) {
- rect.xmax += NODE_SOCKSIZE*4;
- rect.xmin -= NODE_SOCKSIZE;
- }
- }
-
- if(in_out & SOCK_IN) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
- if(node == visible_node(snode, &rect)) {
- *nodep= node;
- *sockp= sock;
- return 1;
- }
- }
- }
- }
- }
- if(in_out & SOCK_OUT) {
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- if(BLI_in_rctf(&rect, sock->locx, sock->locy)) {
- if(node == visible_node(snode, &rect)) {
- *nodep= node;
- *sockp= sock;
- return 1;
- }
- }
- }
- }
- }
- }
- return 0;
-}
-
-/* ********************* transform ****************** */
-
-/* releases on event, only intern (for extern see below) */
-/* we need argument ntree to allow operations on edittree or nodetree */
-static void transform_nodes(bNodeTree *ntree, char mode, char *undostr)
-{
- bNode *node;
- float mxstart, mystart, mx, my, *oldlocs, *ol;
- int cont=1, tot=0, cancel=0, firsttime=1;
- short mval[2], mvalo[2];
-
- /* count total */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & SELECT) tot++;
-
- if(tot==0) return;
-
- /* store oldlocs */
- ol= oldlocs= MEM_mallocN(sizeof(float)*2*tot, "oldlocs transform");
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- ol[0]= node->locx; ol[1]= node->locy;
- ol+= 2;
- }
- }
-
- getmouseco_areawin(mvalo);
- areamouseco_to_ipoco(G.v2d, mvalo, &mxstart, &mystart);
-
- while(cont) {
-
- getmouseco_areawin(mval);
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) {
-
- firsttime= 0;
-
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- for(ol= oldlocs, node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- node->locx= ol[0] + mx-mxstart;
- node->locy= ol[1] + my-mystart;
- ol+= 2;
- }
- }
-
- force_draw(0);
- }
- else
- PIL_sleep_ms(10);
-
- while (qtest()) {
- short val;
- unsigned short event= extern_qread(&val);
-
- switch (event) {
- case LEFTMOUSE:
- case SPACEKEY:
- case RETKEY:
- cont=0;
- break;
- case ESCKEY:
- case RIGHTMOUSE:
- if(val) {
- cancel=1;
- cont=0;
- }
- break;
- default:
- if(val) arrows_move_cursor(event);
- break;
- }
- }
-
- }
-
- if(cancel) {
- for(ol= oldlocs, node= ntree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- node->locx= ol[0];
- node->locy= ol[1];
- ol+= 2;
- }
- }
-
- }
- else
- BIF_undo_push(undostr);
-
- allqueue(REDRAWNODE, 1);
- MEM_freeN(oldlocs);
-}
-
-/* external call, also for callback */
-void node_transform_ext(int mode, int unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
-
- transform_nodes(snode->edittree, 'g', "Move Node");
-}
-
-
-/* releases on event, only 1 node */
-static void scale_node(SpaceNode *snode, bNode *node)
-{
- float mxstart, mystart, mx, my, oldwidth;
- int cont=1, cancel=0;
- short mval[2], mvalo[2];
-
- /* store old */
- if(node->flag & NODE_HIDDEN)
- oldwidth= node->miniwidth;
- else
- oldwidth= node->width;
-
- getmouseco_areawin(mvalo);
- areamouseco_to_ipoco(G.v2d, mvalo, &mxstart, &mystart);
-
- while(cont) {
-
- getmouseco_areawin(mval);
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
-
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- if(node->flag & NODE_HIDDEN) {
- node->miniwidth= oldwidth + mx-mxstart;
- CLAMP(node->miniwidth, 0.0f, 100.0f);
- }
- else {
- node->width= oldwidth + mx-mxstart;
- CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth);
- }
-
- force_draw(0);
- }
- else
- PIL_sleep_ms(10);
-
- while (qtest()) {
- short val;
- unsigned short event= extern_qread(&val);
-
- switch (event) {
- case LEFTMOUSE:
- case SPACEKEY:
- case RETKEY:
- cont=0;
- break;
- case ESCKEY:
- case RIGHTMOUSE:
- if(val) {
- cancel=1;
- cont=0;
- }
- break;
- }
- }
-
- }
-
- if(cancel) {
- node->width= oldwidth;
- }
- else
- BIF_undo_push("Scale Node");
-
- allqueue(REDRAWNODE, 1);
-
- if(snode->nodetree->type == NTREE_TEXTURE)
- ntreeTexUpdatePreviews(snode->nodetree);
-}
-
-/* ******************** rename ******************* */
-
-void node_rename(SpaceNode *snode)
-{
- bNode *node, *rename_node;
- short found_node= 0;
-
- /* check if a node is selected */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- found_node= 1;
- break;
- }
- }
-
- if(found_node) {
- rename_node= nodeGetActive(snode->edittree);
- node_rename_but((char *)rename_node->username);
- BIF_undo_push("Rename Node");
-
- allqueue(REDRAWNODE, 1);
- }
-}
-
-/* ********************** select ******************** */
-
-/* used in buttons to check context, also checks for edited groups */
-bNode *editnode_get_active_idnode(bNodeTree *ntree, short id_code)
-{
- return nodeGetActiveID(ntree, id_code);
-}
-
-/* used in buttons to check context, also checks for edited groups */
-Material *editnode_get_active_material(Material *ma)
-{
- if(ma && ma->use_nodes && ma->nodetree) {
- bNode *node= editnode_get_active_idnode(ma->nodetree, ID_MA);
- if(node)
- return (Material *)node->id;
- else
- return NULL;
- }
- return ma;
-}
-
-/* used in buttons to check context, also checks for edited groups */
-bNode *editnode_get_active(bNodeTree *ntree)
-{
- bNode *node;
-
- /* check for edited group */
- for(node= ntree->nodes.first; node; node= node->next)
- if(node->flag & NODE_GROUP_EDIT)
- break;
- if(node)
- return nodeGetActive((bNodeTree *)node->id);
- else
- return nodeGetActive(ntree);
-}
-
-
-/* no undo here! */
-void node_deselectall(SpaceNode *snode, int swap)
-{
- bNode *node;
-
- if(swap) {
- for(node= snode->edittree->nodes.first; node; node= node->next)
- if(node->flag & SELECT)
- break;
- if(node==NULL) {
- for(node= snode->edittree->nodes.first; node; node= node->next)
- node->flag |= SELECT;
- allqueue(REDRAWNODE, 0);
- return;
- }
- /* else pass on to deselect */
- }
-
- for(node= snode->edittree->nodes.first; node; node= node->next)
- node->flag &= ~SELECT;
-
- allqueue(REDRAWNODE, 0);
-}
-
-int node_has_hidden_sockets(bNode *node)
-{
- bNodeSocket *sock;
-
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_HIDDEN)
- return 1;
- for(sock= node->outputs.first; sock; sock= sock->next)
- if(sock->flag & SOCK_HIDDEN)
- return 1;
- return 0;
-}
-
-
-static void node_hide_unhide_sockets(SpaceNode *snode, bNode *node)
-{
- bNodeSocket *sock;
-
- /* unhide all */
- if( node_has_hidden_sockets(node) ) {
- for(sock= node->inputs.first; sock; sock= sock->next)
- sock->flag &= ~SOCK_HIDDEN;
- for(sock= node->outputs.first; sock; sock= sock->next)
- sock->flag &= ~SOCK_HIDDEN;
- }
- else {
- bNode *gnode= snode_get_editgroup(snode);
-
- /* hiding inside group should not break links in other group users */
- if(gnode) {
- nodeGroupSocketUseFlags((bNodeTree *)gnode->id);
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_IN_USE))
- if(sock->link==NULL)
- sock->flag |= SOCK_HIDDEN;
- for(sock= node->outputs.first; sock; sock= sock->next)
- if(!(sock->flag & SOCK_IN_USE))
- if(nodeCountSocketLinks(snode->edittree, sock)==0)
- sock->flag |= SOCK_HIDDEN;
- }
- else {
- /* hide unused sockets */
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->link==NULL)
- sock->flag |= SOCK_HIDDEN;
- }
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(nodeCountSocketLinks(snode->edittree, sock)==0)
- sock->flag |= SOCK_HIDDEN;
- }
- }
- }
-
- allqueue(REDRAWNODE, 1);
- snode_verify_groups(snode);
- BIF_undo_push("Hide/Unhide sockets");
-
-}
-
-static int do_header_node(SpaceNode *snode, bNode *node, float mx, float my)
-{
- rctf totr= node->totr;
-
- totr.ymin= totr.ymax-20.0f;
-
- totr.xmax= totr.xmin+15.0f;
- if(BLI_in_rctf(&totr, mx, my)) {
- node->flag |= NODE_HIDDEN;
- allqueue(REDRAWNODE, 0);
- return 1;
- }
-
- totr.xmax= node->totr.xmax;
- totr.xmin= totr.xmax-18.0f;
- if(node->typeinfo->flag & NODE_PREVIEW) {
- if(BLI_in_rctf(&totr, mx, my)) {
- node->flag ^= NODE_PREVIEW;
- allqueue(REDRAWNODE, 0);
- return 1;
- }
- totr.xmin-=18.0f;
- }
- if(node->type == NODE_GROUP) {
- if(BLI_in_rctf(&totr, mx, my)) {
- snode_make_group_editable(snode, node);
- return 1;
- }
- totr.xmin-=18.0f;
- }
- if(node->typeinfo->flag & NODE_OPTIONS) {
- if(BLI_in_rctf(&totr, mx, my)) {
- node->flag ^= NODE_OPTIONS;
- allqueue(REDRAWNODE, 0);
- return 1;
- }
- totr.xmin-=18.0f;
- }
- /* hide unused sockets */
- if(BLI_in_rctf(&totr, mx, my)) {
- node_hide_unhide_sockets(snode, node);
- }
-
-
- totr= node->totr;
- totr.xmin= totr.xmax-10.0f;
- totr.ymax= totr.ymin+10.0f;
- if(BLI_in_rctf(&totr, mx, my)) {
- scale_node(snode, node);
- return 1;
- }
- return 0;
-}
-
-static int do_header_hidden_node(SpaceNode *snode, bNode *node, float mx, float my)
-{
- rctf totr= node->totr;
-
- totr.xmax= totr.xmin+15.0f;
- if(BLI_in_rctf(&totr, mx, my)) {
- node->flag &= ~NODE_HIDDEN;
- allqueue(REDRAWNODE, 0);
- return 1;
- }
-
- totr.xmax= node->totr.xmax;
- totr.xmin= node->totr.xmax-15.0f;
- if(BLI_in_rctf(&totr, mx, my)) {
- scale_node(snode, node);
- return 1;
- }
- return 0;
-}
-
-static void node_link_viewer(SpaceNode *snode, bNode *tonode)
-{
- bNode *node;
-
- /* context check */
- if(tonode==NULL || tonode->outputs.first==NULL)
- return;
- if( ELEM(tonode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- return;
-
- /* get viewer */
- for(node= snode->edittree->nodes.first; node; node= node->next)
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- if(node->flag & NODE_DO_OUTPUT)
- break;
-
- if(node) {
- bNodeLink *link;
-
- /* get link to viewer */
- for(link= snode->edittree->links.first; link; link= link->next)
- if(link->tonode==node)
- break;
-
- if(link) {
- link->fromnode= tonode;
- link->fromsock= tonode->outputs.first;
- NodeTagChanged(snode->edittree, node);
-
- snode_handle_recalc(snode);
- }
- }
-}
-
-
-void node_active_link_viewer(SpaceNode *snode)
-{
- bNode *node= editnode_get_active(snode->edittree);
- if(node)
- node_link_viewer(snode, node);
-}
-
-/* return 0: nothing done */
-static int node_mouse_select(SpaceNode *snode, unsigned short event)
-{
- bNode *node;
- float mx, my;
- short mval[2];
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
-
- for(next_node(snode->edittree); (node=next_node(NULL));) {
-
- /* first check for the headers or scaling widget */
- if(node->flag & NODE_HIDDEN) {
- if(do_header_hidden_node(snode, node, mx, my))
- return 1;
- }
- else {
- if(do_header_node(snode, node, mx, my))
- return 1;
- }
-
- /* node body */
- if(BLI_in_rctf(&node->totr, mx, my))
- break;
- }
- if(node) {
- if((G.qual & LR_SHIFTKEY)==0)
- node_deselectall(snode, 0);
-
- if(G.qual & LR_SHIFTKEY) {
- if(node->flag & SELECT)
- node->flag &= ~SELECT;
- else
- node->flag |= SELECT;
- }
- else
- node->flag |= SELECT;
-
- node_set_active(snode, node);
-
- /* viewer linking */
- if(G.qual & LR_CTRLKEY)
- node_link_viewer(snode, node);
-
- /* not so nice (no event), but function below delays redraw otherwise */
- force_draw(0);
-
- std_rmouse_transform(node_transform_ext); /* does undo push for select */
-
- return 1;
- }
- return 0;
-}
-
-/* return 0, nothing done */
-static int node_mouse_groupheader(SpaceNode *snode)
-{
- bNode *gnode;
- float mx, my;
- short mval[2];
-
- gnode= snode_get_editgroup(snode);
- if(gnode==NULL) return 0;
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
-
- /* click in header or outside? */
- if(BLI_in_rctf(&gnode->totr, mx, my)==0) {
- rctf rect= gnode->totr;
-
- rect.ymax += NODE_DY;
- if(BLI_in_rctf(&rect, mx, my)==0)
- snode_make_group_editable(snode, NULL); /* toggles, so exits editmode */
- else
- transform_nodes(snode->nodetree, 'g', "Move group");
-
- return 1;
- }
- return 0;
-}
-
-static int node_socket_hilights(SpaceNode *snode, int in_out)
-{
- bNode *node;
- bNodeSocket *sock, *tsock, *socksel= NULL;
- float mx, my;
- short mval[2], redraw= 0;
-
- if(snode->edittree==NULL) return 0;
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
-
- /* deselect socks */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- for(sock= node->inputs.first; sock; sock= sock->next) {
- if(sock->flag & SELECT) {
- sock->flag &= ~SELECT;
- redraw++;
- socksel= sock;
- }
- }
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(sock->flag & SELECT) {
- sock->flag &= ~SELECT;
- redraw++;
- socksel= sock;
- }
- }
- }
-
- if(find_indicated_socket(snode, &node, &tsock, in_out)) {
- tsock->flag |= SELECT;
- if(redraw==1 && tsock==socksel) redraw= 0;
- else redraw= 1;
- }
-
- return redraw;
-}
-
-void node_border_select(SpaceNode *snode)
-{
- bNode *node;
- rcti rect;
- rctf rectf;
- short val, mval[2];
-
- if ( (val = get_border(&rect, 3)) ) {
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(BLI_isect_rctf(&rectf, &node->totr, NULL)) {
- if(val==LEFTMOUSE)
- node->flag |= SELECT;
- else
- node->flag &= ~SELECT;
- }
- }
- allqueue(REDRAWNODE, 1);
- BIF_undo_push("Border select nodes");
- }
-}
-
-/* ****************** Add *********************** */
-
-void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag)
-{
- bNodeSocket *sock, *sockfrom[8];
- bNode *node, *nodefrom[8];
- int totsock= 0, socktype=0;
-
- if(node_to==NULL || node_to->inputs.first==NULL)
- return;
-
- /* no inputs for node allowed (code it) */
-
- /* connect first 1 socket type now */
- for(sock= node_to->inputs.first; sock; sock= sock->next)
- if(socktype<sock->type)
- socktype= sock->type;
-
-
- /* find potential sockets, max 8 should work */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if((node->flag & flag) && node!=node_to) {
- for(sock= node->outputs.first; sock; sock= sock->next) {
- if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
- sockfrom[totsock]= sock;
- nodefrom[totsock]= node;
- totsock++;
- if(totsock>7)
- break;
- }
- }
- }
- if(totsock>7)
- break;
- }
-
- /* now just get matching socket types and create links */
- for(sock= node_to->inputs.first; sock; sock= sock->next) {
- int a;
-
- for(a=0; a<totsock; a++) {
- if(sockfrom[a]) {
- if(sock->type==sockfrom[a]->type && sock->type==socktype) {
- nodeAddLink(snode->edittree, nodefrom[a], sockfrom[a], node_to, sock);
- sockfrom[a]= NULL;
- break;
- }
- }
- }
- }
-
- ntreeSolveOrder(snode->edittree);
-}
-
-/* can be called from menus too, but they should do own undopush and redraws */
-bNode *node_add_node(SpaceNode *snode, int type, float locx, float locy)
-{
- bNode *node= NULL, *gnode;
-
- node_deselectall(snode, 0);
-
- if(type>=NODE_DYNAMIC_MENU) {
- node= nodeAddNodeType(snode->edittree, type, NULL, NULL);
- }
- else if(type>=NODE_GROUP_MENU) {
- if(snode->edittree!=snode->nodetree) {
- error("Can not add a Group in a Group");
- return NULL;
- }
- else {
- bNodeTree *ngroup= BLI_findlink(&G.main->nodetree, type-NODE_GROUP_MENU);
- if(ngroup)
- node= nodeAddNodeType(snode->edittree, NODE_GROUP, ngroup, NULL);
- }
- }
- else
- node= nodeAddNodeType(snode->edittree, type, NULL, NULL);
-
- /* generics */
- if(node) {
- node->locx= locx;
- node->locy= locy + 60.0f; // arbitrary.. so its visible
- node->flag |= SELECT;
-
- gnode= snode_get_editgroup(snode);
- if(gnode) {
- node->locx -= gnode->locx;
- node->locy -= gnode->locy;
- }
-
- snode_verify_groups(snode);
- node_set_active(snode, node);
-
- if(node->id)
- id_us_plus(node->id);
-
- if(snode->nodetree->type==NTREE_COMPOSIT)
- ntreeCompositForceHidden(snode->edittree);
-
- NodeTagChanged(snode->edittree, node);
- }
-
- if(snode->nodetree->type==NTREE_TEXTURE) {
- ntreeTexCheckCyclics(snode->edittree);
- ntreeTexUpdatePreviews(snode->edittree);
- }
-
- return node;
-}
-
-void node_mute(SpaceNode *snode)
-{
- bNode *node;
-
- /* no disabling inside of groups */
- if(snode_get_editgroup(snode))
- return;
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if(node->inputs.first && node->outputs.first) {
- if(node->flag & NODE_MUTED)
- node->flag &= ~NODE_MUTED;
- else
- node->flag |= NODE_MUTED;
- }
- }
- }
-
- allqueue(REDRAWNODE, 0);
- BIF_undo_push("Enable/Disable nodes");
-
-}
-
-void node_adduplicate(SpaceNode *snode)
-{
-
- ntreeCopyTree(snode->edittree, 1); /* 1 == internally selected nodes */
-
- ntreeSolveOrder(snode->edittree);
- snode_verify_groups(snode);
- snode_handle_recalc(snode);
-
- transform_nodes(snode->edittree, 'g', "Duplicate");
-}
-
-#if 0
-static void node_insert_convertor(SpaceNode *snode, bNodeLink *link)
-{
- bNode *newnode= NULL;
-
- if(link->fromsock->type==SOCK_RGBA && link->tosock->type==SOCK_VALUE) {
- if(snode->edittree->type==NTREE_SHADER)
- newnode= node_add_node(snode, SH_NODE_RGBTOBW, 0.0f, 0.0f);
- else if(snode->edittree->type==NTREE_COMPOSIT)
- newnode= node_add_node(snode, CMP_NODE_RGBTOBW, 0.0f, 0.0f);
- else
- newnode= NULL;
- }
- else if(link->fromsock->type==SOCK_VALUE && link->tosock->type==SOCK_RGBA) {
- if(snode->edittree->type==NTREE_SHADER)
- newnode= node_add_node(snode, SH_NODE_VALTORGB, 0.0f, 0.0f);
- else if(snode->edittree->type==NTREE_COMPOSIT)
- newnode= node_add_node(snode, CMP_NODE_VALTORGB, 0.0f, 0.0f);
- else
- newnode= NULL;
- }
-
- if(newnode) {
- /* dangerous assumption to use first in/out socks, but thats fine for now */
- newnode->flag |= NODE_HIDDEN;
- newnode->locx= 0.5f*(link->fromsock->locx + link->tosock->locx);
- newnode->locy= 0.5f*(link->fromsock->locy + link->tosock->locy) + HIDDEN_RAD;
-
- nodeAddLink(snode->edittree, newnode, newnode->outputs.first, link->tonode, link->tosock);
- link->tonode= newnode;
- link->tosock= newnode->inputs.first;
- }
-}
-
-#endif
-
-static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeLink *link)
-{
- bNodeLink *tlink;
- bNodeSocket *sock;
-
- if(tsock && nodeCountSocketLinks(snode->edittree, link->tosock) > tsock->limit) {
-
- for(tlink= snode->edittree->links.first; tlink; tlink= tlink->next) {
- if(link!=tlink && tlink->tosock==link->tosock)
- break;
- }
- if(tlink) {
- /* is there a free input socket with same type? */
- for(sock= tlink->tonode->inputs.first; sock; sock= sock->next) {
- if(sock->type==tlink->fromsock->type)
- if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit)
- break;
- }
- if(sock) {
- tlink->tosock= sock;
- sock->flag &= ~SOCK_HIDDEN;
- }
- else {
- nodeRemLink(snode->edittree, tlink);
- }
- }
- }
-}
-
-/* loop that adds a nodelink, called by function below */
-/* in_out = starting socket */
-static int node_add_link_drag(SpaceNode *snode, bNode *node, bNodeSocket *sock, int in_out)
-{
- bNode *tnode;
- bNodeSocket *tsock= NULL;
- bNodeLink *link= NULL;
- short mval[2], mvalo[2], firsttime=1; /* firsttime reconnects a link broken by caller */
-
- /* we make a temporal link */
- if(in_out==SOCK_OUT)
- link= nodeAddLink(snode->edittree, node, sock, NULL, NULL);
- else
- link= nodeAddLink(snode->edittree, NULL, NULL, node, sock);
-
- getmouseco_areawin(mvalo);
- while (get_mbut() & L_MOUSE) {
-
- getmouseco_areawin(mval);
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) {
- firsttime= 0;
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- if(in_out==SOCK_OUT) {
- if(find_indicated_socket(snode, &tnode, &tsock, SOCK_IN)) {
- if(nodeFindLink(snode->edittree, sock, tsock)==NULL) {
- if(tnode!=node && link->tonode!=tnode && link->tosock!= tsock) {
- link->tonode= tnode;
- link->tosock= tsock;
- ntreeSolveOrder(snode->edittree); /* for interactive red line warning */
- }
- }
- }
- else {
- link->tonode= NULL;
- link->tosock= NULL;
- }
- }
- else {
- if(find_indicated_socket(snode, &tnode, &tsock, SOCK_OUT)) {
- if(nodeFindLink(snode->edittree, sock, tsock)==NULL) {
- if(nodeCountSocketLinks(snode->edittree, tsock) < tsock->limit) {
- if(tnode!=node && link->fromnode!=tnode && link->fromsock!= tsock) {
- link->fromnode= tnode;
- link->fromsock= tsock;
- ntreeSolveOrder(snode->edittree); /* for interactive red line warning */
- }
- }
- }
- }
- else {
- link->fromnode= NULL;
- link->fromsock= NULL;
- }
- }
- /* hilight target sockets only */
- node_socket_hilights(snode, in_out==SOCK_OUT?SOCK_IN:SOCK_OUT);
-
- force_draw(0);
- }
- else BIF_wait_for_statechange();
- }
-
- /* remove link? */
- if(link->tonode==NULL || link->fromnode==NULL) {
- nodeRemLink(snode->edittree, link);
- }
- else {
- /* send changed events for original tonode and new */
- if(link->tonode)
- NodeTagChanged(snode->edittree, link->tonode);
-
- /* we might need to remove a link */
- if(in_out==SOCK_OUT) node_remove_extra_links(snode, tsock, link);
- }
-
- ntreeSolveOrder(snode->edittree);
- snode_verify_groups(snode);
- snode_handle_recalc(snode);
-
- allqueue(REDRAWNODE, 0);
- BIF_undo_push("Add link");
-
- return 1;
-}
-
-/* return 1 when socket clicked */
-static int node_add_link(SpaceNode *snode)
-{
- bNode *node;
- bNodeLink *link;
- bNodeSocket *sock;
-
- /* output indicated? */
- if(find_indicated_socket(snode, &node, &sock, SOCK_OUT)) {
- if(nodeCountSocketLinks(snode->edittree, sock)<sock->limit)
- return node_add_link_drag(snode, node, sock, SOCK_OUT);
- else {
- /* find if we break a link */
- for(link= snode->edittree->links.first; link; link= link->next) {
- if(link->fromsock==sock)
- break;
- }
- if(link) {
- node= link->tonode;
- sock= link->tosock;
- nodeRemLink(snode->edittree, link);
- return node_add_link_drag(snode, node, sock, SOCK_IN);
- }
- }
- }
- /* or an input? */
- else if(find_indicated_socket(snode, &node, &sock, SOCK_IN)) {
- if(nodeCountSocketLinks(snode->edittree, sock)<sock->limit)
- return node_add_link_drag(snode, node, sock, SOCK_IN);
- else {
- /* find if we break a link */
- for(link= snode->edittree->links.first; link; link= link->next) {
- if(link->tosock==sock)
- break;
- }
- if(link) {
- /* send changed event to original tonode */
- if(link->tonode)
- NodeTagChanged(snode->edittree, link->tonode);
-
- node= link->fromnode;
- sock= link->fromsock;
- nodeRemLink(snode->edittree, link);
- return node_add_link_drag(snode, node, sock, SOCK_OUT);
- }
- }
- }
-
- return 0;
-}
-
-void node_delete(SpaceNode *snode)
-{
- bNode *node, *next;
- bNodeSocket *sock;
-
- for(node= snode->edittree->nodes.first; node; node= next) {
- next= node->next;
- if(node->flag & SELECT) {
- /* set selin and selout NULL if the sockets belong to a node to be deleted */
- for(sock= node->inputs.first; sock; sock= sock->next)
- if(snode->edittree->selin == sock) snode->edittree->selin= NULL;
-
- for(sock= node->outputs.first; sock; sock= sock->next)
- if(snode->edittree->selout == sock) snode->edittree->selout= NULL;
-
- /* check id user here, nodeFreeNode is called for free dbase too */
- if(node->id)
- node->id->us--;
- nodeFreeNode(snode->edittree, node);
- }
- }
-
- snode_verify_groups(snode);
- snode_handle_recalc(snode);
- BIF_undo_push("Delete nodes");
- allqueue(REDRAWNODE, 1);
-}
-
-void node_hide(SpaceNode *snode)
-{
- bNode *node;
- int nothidden=0, ishidden=0;
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if(node->flag & NODE_HIDDEN)
- ishidden++;
- else
- nothidden++;
- }
- }
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & SELECT) {
- if( (ishidden && nothidden) || ishidden==0)
- node->flag |= NODE_HIDDEN;
- else
- node->flag &= ~NODE_HIDDEN;
- }
- }
- BIF_undo_push("Hide nodes");
- allqueue(REDRAWNODE, 1);
-}
-
-void node_insert_key(SpaceNode *snode)
-{
- bNode *node= editnode_get_active(snode->edittree);
-
- if(node == NULL)
- return;
-
- if(node->type==CMP_NODE_TIME) {
- if(node->custom1<node->custom2) {
-
- CurveMapping *cumap= node->storage;
- float fval, curval;
-
- curval= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
- fval= curvemapping_evaluateF(cumap, 0, curval);
-
- if(fbutton(&fval, 0.0f, 1.0f, 10, 10, "Insert Value")) {
- curvemap_insert(cumap->cm, curval, fval);
-
- BIF_undo_push("Insert key in Time node");
- allqueue(REDRAWNODE, 1);
- }
- }
- }
-}
-
-void node_select_linked(SpaceNode *snode, int out)
-{
- bNodeLink *link;
- bNode *node;
-
- /* NODE_TEST is the free flag */
- for(node= snode->edittree->nodes.first; node; node= node->next)
- node->flag &= ~NODE_TEST;
-
- for(link= snode->edittree->links.first; link; link= link->next) {
- if(out) {
- if(link->fromnode->flag & NODE_SELECT)
- link->tonode->flag |= NODE_TEST;
- }
- else {
- if(link->tonode->flag & NODE_SELECT)
- link->fromnode->flag |= NODE_TEST;
- }
- }
-
- for(node= snode->edittree->nodes.first; node; node= node->next)
- if(node->flag & NODE_TEST)
- node->flag |= NODE_SELECT;
-
- BIF_undo_push("Select Linked nodes");
- allqueue(REDRAWNODE, 1);
-}
-
-/* makes a link between selected output and input sockets */
-void node_make_link(SpaceNode *snode)
-{
- bNode *fromnode, *tonode;
- bNodeLink *link;
- bNodeSocket *outsock= snode->edittree->selout;
- bNodeSocket *insock= snode->edittree->selin;
-
- if(!insock || !outsock) return;
- if(nodeFindLink(snode->edittree, outsock, insock)) return;
-
- if(nodeFindNode(snode->edittree, outsock, &fromnode, NULL) &&
- nodeFindNode(snode->edittree, insock, &tonode, NULL)) {
- link= nodeAddLink(snode->edittree, fromnode, outsock, tonode, insock);
- NodeTagChanged(snode->edittree, tonode);
- node_remove_extra_links(snode, insock, link);
- }
- else return;
-
- ntreeSolveOrder(snode->edittree);
- snode_verify_groups(snode);
- snode_handle_recalc(snode);
-
- allqueue(REDRAWNODE, 0);
- BIF_undo_push("Make Link Between Sockets");
-}
-
-static void node_border_link_delete(SpaceNode *snode)
-{
- rcti rect;
- short val, mval[2], mvalo[2];
-
- /* to make this work more friendly, we first wait for a mouse move */
- getmouseco_areawin(mvalo);
- while (get_mbut() & L_MOUSE) {
- getmouseco_areawin(mval);
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1])
- break;
- else BIF_wait_for_statechange();
- }
- if((get_mbut() & L_MOUSE)==0)
- return;
-
- /* now change cursor and draw border */
- setcursor_space(SPACE_NODE, CURSOR_VPAINT);
-
- if ( (val = get_border(&rect, 2)) ) {
- if(rect.xmin<rect.xmax && rect.ymin<rect.ymax) {
- //#define NODE_MAXPICKBUF 256
- bNodeLink *link, *next;
- GLuint buffer[256];
- rctf rectf;
- int code=0, hits;
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(&snode->v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(&snode->v2d, mval, &rectf.xmax, &rectf.ymax);
-
- glLoadIdentity();
- myortho2(rectf.xmin, rectf.xmax, rectf.ymin, rectf.ymax);
-
- glSelectBuffer(256, buffer);
- glRenderMode(GL_SELECT);
- glInitNames();
- glPushName(-1);
-
- /* draw links */
- for(link= snode->edittree->links.first; link; link= link->next) {
- glLoadName(code++);
- node_draw_link(snode, link);
- }
-
- hits= glRenderMode(GL_RENDER);
- glPopName();
- if(hits>0) {
- int a;
- for(a=0; a<hits; a++) {
- bNodeLink *link= BLI_findlink(&snode->edittree->links, buffer[ (4 * a) + 3]);
- if(link)
- link->fromnode= NULL; /* first tag for delete, otherwise indices are wrong */
- }
- for(link= snode->edittree->links.first; link; link= next) {
- next= link->next;
- if(link->fromnode==NULL) {
- NodeTagChanged(snode->edittree, link->tonode);
- nodeRemLink(snode->edittree, link);
- }
- }
- ntreeSolveOrder(snode->edittree);
- snode_verify_groups(snode);
- snode_handle_recalc(snode);
- }
- allqueue(REDRAWNODE, 0);
- BIF_undo_push("Erase links");
- }
- }
-
- setcursor_space(SPACE_NODE, CURSOR_STD);
-}
-
-/* goes over all scenes, reads render layerss */
-void node_read_renderlayers(SpaceNode *snode)
-{
- Scene *scene;
- bNode *node;
-
- /* first tag scenes unread */
- for(scene= G.main->scene.first; scene; scene= scene->id.next)
- scene->id.flag |= LIB_DOIT;
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
- ID *id= node->id;
- if(id==NULL) id= (ID *)G.scene;
- if(id->flag & LIB_DOIT) {
- RE_ReadRenderResult(G.scene, (Scene *)id);
- ntreeCompositTagRender((Scene *)id);
- id->flag &= ~LIB_DOIT;
- }
- }
- }
-
- /* own render result should be read/allocated */
- if(G.scene->id.flag & LIB_DOIT)
- RE_ReadRenderResult(G.scene, G.scene);
-
- snode_handle_recalc(snode);
-}
-
-void node_read_fullsamplelayers(SpaceNode *snode)
-{
- Render *re= RE_NewRender(G.scene->id.name);
-
- waitcursor(1);
-
- BIF_init_render_callbacks(re, 1);
- RE_MergeFullSample(re, G.scene, snode->nodetree);
- BIF_end_render_callbacks();
-
- allqueue(REDRAWNODE, 1);
- allqueue(REDRAWIMAGE, 1);
-
- waitcursor(0);
-}
-
-/* called from header_info, when deleting a scene
- * goes over all scenes other than the input, checks if they have
- * render layer nodes referencing the to-be-deleted scene, and
- * resets them to NULL. */
-void clear_scene_in_nodes(Scene *sce)
-{
- Scene *sce1;
- bNode *node;
-
- sce1= G.main->scene.first;
- while(sce1) {
- if(sce1!=sce) {
- if (sce1->nodetree) {
- for(node= sce1->nodetree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS) {
- Scene *nodesce= (Scene *)node->id;
-
- if (nodesce==sce) node->id = NULL;
- }
- }
- }
- }
- sce1= sce1->id.next;
- }
-}
-
-
-/* gets active viewer user */
-struct ImageUser *ntree_get_active_iuser(bNodeTree *ntree)
-{
- bNode *node;
-
- if(ntree)
- for(node= ntree->nodes.first; node; node= node->next)
- if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))
- if(node->flag & NODE_DO_OUTPUT)
- return node->storage;
- return NULL;
-}
-
-void imagepaint_composite_tags(bNodeTree *ntree, Image *image, ImageUser *iuser)
-{
- bNode *node;
-
- if(ntree==NULL)
- return;
-
- /* search for renderresults */
- if(image->type==IMA_TYPE_R_RESULT) {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
- /* imageuser comes from ImageWin, so indexes are offset 1 */
- if(node->custom1==iuser->layer-1)
- NodeTagChanged(ntree, node);
- }
- }
- }
- else {
- for(node= ntree->nodes.first; node; node= node->next) {
- if(node->id== &image->id)
- NodeTagChanged(ntree, node);
- }
- }
-}
-
-/* ********************** */
-
-void node_make_group(SpaceNode *snode)
-{
- bNode *gnode;
-
- if(snode->edittree!=snode->nodetree) {
- error("Can not add a new Group in a Group");
- return;
- }
-
- /* for time being... is too complex to handle */
- if(snode->treetype==NTREE_COMPOSIT) {
- for(gnode=snode->nodetree->nodes.first; gnode; gnode= gnode->next) {
- if(gnode->flag & SELECT)
- if(gnode->type==CMP_NODE_R_LAYERS)
- break;
- }
- if(gnode) {
- error("Can not add RenderLayer in a Group");
- return;
- }
- }
-
- gnode= nodeMakeGroupFromSelected(snode->nodetree);
- if(gnode==NULL) {
- error("Can not make Group");
- }
- else {
- nodeSetActive(snode->nodetree, gnode);
- ntreeSolveOrder(snode->nodetree);
- allqueue(REDRAWNODE, 0);
- BIF_undo_push("Make Node Group");
- }
-}
-
-/* ******************** main event loop ****************** */
-
-/* special version to prevent overlapping buttons, has a bit of hack... */
-/* yes, check for example composit_node_event(), file window use... */
-static int node_uiDoBlocks(ScrArea *sa, short event)
-{
- SpaceNode *snode= sa->spacedata.first;
- ListBase *lb= &sa->uiblocks;
- ListBase listb= *lb;
- uiBlock *block;
- bNode *node;
- rctf rect;
- void *prev, *next;
- int retval= UI_NOTHING;
- short mval[2];
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin);
-
- /* this happens after filesel usage... */
- if(lb->first==NULL) {
- return UI_NOTHING;
- }
-
- /* evil hack: try to do grease-pencil floating panel (like for nodes) */
- block= uiGetBlock("nodes_panel_gpencil", sa);
- if (block) {
- /* try to process events here... if failed, just carry on */
- /* when there's menus, the prev pointer becomes zero! */
- prev= ((struct Link *)block)->prev;
- next= ((struct Link *)block)->next;
- ((struct Link *)block)->prev= NULL;
- ((struct Link *)block)->next= NULL;
-
- lb->first= lb->last= block;
- retval= uiDoBlocks(lb, event, 1);
-
- ((struct Link *)block)->prev= prev;
- ((struct Link *)block)->next= next;
-
- *lb= listb;
-
- /* if something happened, get the heck outta here */
- if (retval != UI_NOTHING)
- return retval;
- }
-
-
- rect.xmin -= 2.0f;
- rect.ymin -= 2.0f;
- rect.xmax = rect.xmin + 4.0f;
- rect.ymax = rect.ymin + 4.0f;
-
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- char str[32];
-
- /* retreive unique block name, see also drawnode.c */
- sprintf(str, "node buttons %p", node);
- block= uiGetBlock(str, sa);
-
- if(block) {
- if(node == visible_node(snode, &rect)) {
-
- /* when there's menus, the prev pointer becomes zero! */
- prev= ((struct Link *)block)->prev;
- next= ((struct Link *)block)->next;
- ((struct Link *)block)->prev= NULL;
- ((struct Link *)block)->next= NULL;
-
- lb->first= lb->last= block;
- retval= uiDoBlocks(lb, event, 1);
-
- ((struct Link *)block)->prev= prev;
- ((struct Link *)block)->next= next;
-
- break;
- }
- }
- }
-
- *lb= listb;
-
- return retval;
-}
-
-void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- SpaceNode *snode= spacedata;
- bNode *actnode;
- bNodeSocket *actsock;
- unsigned short event= evt->event;
- short val= evt->val, doredraw=0, fromlib= 0;
-
- if(sa->win==0) return;
-
- if(snode->nodetree==NULL) {
- /* no other events should be handled, but floating panels still should get handled */
- uiDoBlocks(&curarea->uiblocks, event, 1);
- return;
- }
-
- if(val) {
- if( node_uiDoBlocks(sa, event)!=UI_NOTHING ) event= 0;
-
- fromlib= (snode->id && snode->id->lib);
-
- switch(event) {
- case LEFTMOUSE:
- if(gpencil_do_paint(sa, L_MOUSE)) {
- return;
- }
- else if(fromlib) {
- if(node_mouse_groupheader(snode)==0)
- node_mouse_select(snode, event);
- }
- else {
-
- if(G.qual & LR_CTRLKEY)
- if(gesture())
- break;
-
- if(node_add_link(snode)==0)
- if(node_mouse_groupheader(snode)==0)
- if(node_mouse_select(snode, event)==0)
- node_border_link_delete(snode);
- }
- break;
-
- case RIGHTMOUSE:
- if(gpencil_do_paint(sa, R_MOUSE)) {
- return;
- }
- else if(find_indicated_socket(snode, &actnode, &actsock, SOCK_IN)) {
- if(actsock->flag & SOCK_SEL) {
- snode->edittree->selin= NULL;
- actsock->flag&= ~SOCK_SEL;
- }
- else {
- snode->edittree->selin= actsock;
- reset_sel_socket(snode, SOCK_IN);
- actsock->flag|= SOCK_SEL;
- }
- }
- else if(find_indicated_socket(snode, &actnode, &actsock, SOCK_OUT)) {
- if(actsock->flag & SOCK_SEL) {
- snode->edittree->selout= NULL;
- actsock->flag&= ~SOCK_SEL;
- }
- else {
- snode->edittree->selout= actsock;
- reset_sel_socket(snode, SOCK_OUT);
- actsock->flag|= SOCK_SEL;
- }
- }
- else if(!node_mouse_select(snode, event))
- toolbox_n();
-
- break;
- case MIDDLEMOUSE:
- if((snode->flag & SNODE_BACKDRAW) && (snode->treetype==NTREE_COMPOSIT)
- && (G.qual==LR_SHIFTKEY)) {
- snode_bg_viewmove(snode);
- } else {
- view2dmove(event);
- }
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
-
- case MOUSEY:
- doredraw= node_socket_hilights(snode, SOCK_IN|SOCK_OUT);
- break;
-
- case UI_BUT_EVENT:
- /* future: handlerize this! */
- if(snode->treetype==NTREE_SHADER)
- shader_node_event(snode, val);
- else if(snode->treetype==NTREE_COMPOSIT)
- composit_node_event(snode, val);
- else if(snode->treetype==NTREE_TEXTURE)
- texture_node_event(snode, val);
- break;
-
- case RENDERPREVIEW:
- if(snode->treetype==NTREE_SHADER)
- shader_node_previewrender(sa, snode);
- break;
-
- case PADPLUSKEY:
- snode_zoom_in(sa);
- doredraw= 1;
- break;
- case PADMINUS:
- snode_zoom_out(sa);
- doredraw= 1;
- break;
- case HOMEKEY:
- snode_home(sa, snode);
- doredraw= 1;
- break;
- case TABKEY:
- if(fromlib) fromlib= -1;
- else snode_make_group_editable(snode, NULL);
- break;
-
- case AKEY:
- if(G.qual==LR_SHIFTKEY) {
- if(fromlib) fromlib= -1;
- else toolbox_n_add();
- }
- else if(G.qual==0) {
- node_deselectall(snode, 1);
- BIF_undo_push("Deselect all nodes");
- }
- break;
- case BKEY:
- if(G.qual==0)
- node_border_select(snode);
- break;
- case CKEY: /* sort again, showing cyclics */
- ntreeSolveOrder(snode->edittree);
- doredraw= 1;
- break;
- case DKEY:
- if(G.qual==LR_SHIFTKEY) {
- if(fromlib) fromlib= -1;
- else node_adduplicate(snode);
- }
- break;
- case EKEY:
- snode_handle_recalc(snode);
- break;
- case FKEY:
- node_make_link(snode);
- break;
- case GKEY:
- if(fromlib) fromlib= -1;
- else {
- if(G.qual==LR_CTRLKEY) {
- if(okee("Make Group"))
- node_make_group(snode);
- }
- else if(G.qual==LR_ALTKEY) {
- if(okee("Ungroup"))
- node_ungroup(snode);
- }
- else if(G.qual==LR_SHIFTKEY) {
- node_addgroup(snode);
- }
- else
- transform_nodes(snode->edittree, 'g', "Move Node");
- }
- break;
- case HKEY:
- node_hide(snode);
- break;
- case IKEY:
- node_insert_key(snode);
- break;
- case LKEY:
- node_select_linked(snode, G.qual==LR_SHIFTKEY);
- break;
- case MKEY:
- node_mute(snode);
- break;
- case RKEY:
- if(G.qual==LR_CTRLKEY) {
- node_rename(snode);
- }
- else if(G.qual==LR_SHIFTKEY) {
- if(okee("Read saved Full Sample Layers"))
- node_read_fullsamplelayers(snode);
- }
- else {
- if(okee("Read saved Render Layers"))
- node_read_renderlayers(snode);
- }
- break;
- case DELKEY:
- case XKEY:
- if(G.qual==LR_ALTKEY) {
- gpencil_delete_menu();
- }
- else {
- if(fromlib) fromlib= -1;
- else node_delete(snode);
- }
- break;
- }
- }
-
- if(fromlib==-1)
- error_libdata();
- if(doredraw)
- scrarea_queue_winredraw(sa);
- if(doredraw==2)
- scrarea_queue_headredraw(sa);
-}
-
-
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
deleted file mode 100644
index 4a70e89dd07..00000000000
--- a/source/blender/src/editobject.c
+++ /dev/null
@@ -1,6091 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/**
- * Theorie: (matrices) A x B x C == A x ( B x C x Binv) x B
- * ofwel: OB x PAR x EDIT = OB x (PAR x EDIT x PARinv) x PAR
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-
-
-#include "IMB_imbuf_types.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_group_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_object_force.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_property_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_world_types.h"
-#include "DNA_modifier_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_ghash.h"
-#include "BLI_rand.h"
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_customdata.h"
-#include "BKE_blender.h"
-#include "BKE_booleanops.h"
-#include "BKE_cloth.h"
-#include "BKE_curve.h"
-#include "BKE_displist.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_ipo.h"
-#include "BKE_image.h"
-#include "BKE_key.h"
-#include "BKE_lattice.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_multires.h"
-#include "BKE_nla.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_property.h"
-#include "BKE_sca.h"
-#include "BKE_scene.h"
-#include "BKE_softbody.h"
-#include "BKE_subsurf.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_modifier.h"
-
-#include "BIF_butspace.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_editfont.h"
-#include "BIF_editlattice.h"
-#include "BIF_editmesh.h"
-#include "BIF_editoops.h"
-#include "BIF_editparticle.h"
-#include "BIF_editview.h"
-#include "BIF_editarmature.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_toets.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_filesel.h" /* For activate_databrowse() */
-#include "BSE_view.h"
-#include "BSE_drawview.h"
-#include "BSE_trans_types.h"
-#include "BSE_editipo_types.h"
-
-#include "BDR_vpaint.h"
-#include "BDR_sculptmode.h"
-#include "BDR_editface.h"
-#include "BDR_editmball.h"
-#include "BDR_editobject.h"
-#include "BDR_drawobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_unwrapper.h"
-#include "BDR_gpencil.h"
-
-#include <time.h>
-#include "mydevice.h"
-#include "nla.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "BIF_transform.h"
-
-#include "BIF_poseobject.h"
-
-
-/* --------------------------------- */
-
-void exit_paint_modes(void)
-{
- if(G.f & G_VERTEXPAINT) set_vpaint();
- if(G.f & G_TEXTUREPAINT) set_texturepaint();
- if(G.f & G_WEIGHTPAINT) set_wpaint();
- if(G.f & G_SCULPTMODE) set_sculptmode();
- if(G.f & G_PARTICLEEDIT) PE_set_particle_edit();
-
- G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE+G_PARTICLEEDIT);
-}
-
-void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff */
-{
- Object *ob;
-
- exit_paint_modes();
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
-
- if ELEM3(curarea->spacetype, SPACE_VIEW3D, SPACE_BUTS, SPACE_INFO) {
- if (G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */
- ob= add_object(type);
- set_active_base(BASACT);
- base_init_from_view3d(BASACT, G.vd);
-
- /* only undo pushes on objects without editmode... */
- if(type==OB_EMPTY) BIF_undo_push("Add Empty");
- else if(type==OB_LAMP) {
- BIF_undo_push("Add Lamp");
- reshadeall_displist(); /* only frees */
- }
- else if(type==OB_LATTICE) BIF_undo_push("Add Lattice");
- else if(type==OB_CAMERA) BIF_undo_push("Add Camera");
-
- allqueue(REDRAWVIEW3D, 0);
- }
-
- redraw_test_buttons(OBACT);
-
- allqueue(REDRAWALL, 0);
-
- deselect_all_area_oops();
- set_select_flag_oops();
-
- DAG_scene_sort(G.scene);
- allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
-}
-
-void add_objectLamp(short type)
-{
- Lamp *la;
-
- /* this function also comes from an info window */
- if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return;
-
- if(G.obedit==0) {
- add_object_draw(OB_LAMP);
- base_init_from_view3d(BASACT, G.vd);
- }
-
- la = BASACT->object->data;
- la->type = type;
-
- allqueue(REDRAWALL, 0);
-}
-
-/* remove base from a specific scene */
-/* note: now unlinks constraints as well */
-void free_and_unlink_base_from_scene(Scene *scene, Base *base)
-{
- BLI_remlink(&scene->base, base);
- free_libblock_us(&G.main->object, base->object);
- MEM_freeN(base);
-}
-
-/* remove base from the current scene */
-void free_and_unlink_base(Base *base)
-{
- if (base==BASACT)
- BASACT= NULL;
- free_and_unlink_base_from_scene(G.scene, base);
-}
-
-void delete_obj(int ok)
-{
- Base *base;
- int islamp= 0;
-
- if(G.obedit) return;
- if(G.scene->id.lib) return;
-
- base= FIRSTBASE;
- while(base) {
- Base *nbase= base->next;
-
- if TESTBASE(base) {
- if(ok==0) {
- /* Shift Del is global delete */
- if (G.qual & LR_SHIFTKEY) {
- if(!okee("Erase selected Object(s) Globally")) return;
- ok= 2;
- } else {
- if(!okee("Erase selected Object(s)")) return;
- ok= 1;
- }
- }
-
- exit_paint_modes();
-
- if(base->object->type==OB_LAMP) islamp= 1;
-#ifdef WITH_VERSE
- if(base->object->vnode) b_verse_delete_object(base->object);
-#endif
- if (ok==2) {
- Scene *scene;
- Base *base_other;
-
- for (scene= G.main->scene.first; scene; scene= scene->id.next) {
- if (scene != G.scene && !(scene->id.lib)) {
- base_other= object_in_scene( base->object, scene );
- if (base_other) {
- if (base_other == scene->basact) scene->basact= NULL; /* in case the object was active */
- free_and_unlink_base_from_scene( scene, base_other );
- }
- }
- }
- }
-
- /* remove from current scene only */
- free_and_unlink_base(base);
- }
-
- base= nbase;
- }
- countall();
-
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
-
- if(islamp) reshadeall_displist(); /* only frees displist */
-
- redraw_test_buttons(OBACT);
- allqueue(REDRAWVIEW3D, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWDATASELECT, 0);
- allspace(OOPS_TEST, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-
- DAG_scene_sort(G.scene);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- BIF_undo_push("Delete object(s)");
-}
-
-static int return_editmesh_indexar(int *tot, int **indexar, float *cent)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- int *index, nr, totvert=0;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) totvert++;
- }
- if(totvert==0) return 0;
-
- *indexar= index= MEM_mallocN(4*totvert, "hook indexar");
- *tot= totvert;
- nr= 0;
- cent[0]= cent[1]= cent[2]= 0.0;
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
- *index= nr; index++;
- VecAddf(cent, cent, eve->co);
- }
- nr++;
- }
-
- VecMulf(cent, 1.0f/(float)totvert);
-
- return totvert;
-}
-
-static int return_editmesh_vgroup(char *name, float *cent)
-{
- EditMesh *em = G.editMesh;
- MDeformVert *dvert;
- EditVert *eve;
- int i, totvert=0;
-
- cent[0]= cent[1]= cent[2]= 0.0;
-
- if(G.obedit->actdef) {
-
- /* find the vertices */
- for(eve= em->verts.first; eve; eve= eve->next) {
- dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
-
- if(dvert) {
- for(i=0; i<dvert->totweight; i++){
- if(dvert->dw[i].def_nr == (G.obedit->actdef-1)) {
- totvert++;
- VecAddf(cent, cent, eve->co);
- }
- }
- }
- }
- if(totvert) {
- bDeformGroup *defGroup = BLI_findlink(&G.obedit->defbase, G.obedit->actdef-1);
- strcpy(name, defGroup->name);
- VecMulf(cent, 1.0f/(float)totvert);
- return 1;
- }
- }
-
- return 0;
-}
-
-static void select_editmesh_hook(HookModifierData *hmd)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- int index=0, nr=0;
-
- for(eve= em->verts.first; eve; eve= eve->next, nr++) {
- if(nr==hmd->indexar[index]) {
- eve->f |= SELECT;
- if(index < hmd->totindex-1) index++;
- }
- }
- EM_select_flush();
-}
-
-static int return_editlattice_indexar(int *tot, int **indexar, float *cent)
-{
- BPoint *bp;
- int *index, nr, totvert=0, a;
-
- /* count */
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(bp->hide==0) totvert++;
- }
- bp++;
- }
-
- if(totvert==0) return 0;
-
- *indexar= index= MEM_mallocN(4*totvert, "hook indexar");
- *tot= totvert;
- nr= 0;
- cent[0]= cent[1]= cent[2]= 0.0;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(bp->hide==0) {
- *index= nr; index++;
- VecAddf(cent, cent, bp->vec);
- }
- }
- bp++;
- nr++;
- }
-
- VecMulf(cent, 1.0f/(float)totvert);
-
- return totvert;
-}
-
-static void select_editlattice_hook(HookModifierData *hmd)
-{
- BPoint *bp;
- int index=0, nr=0, a;
-
- /* count */
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(hmd->indexar[index]==nr) {
- bp->f1 |= SELECT;
- if(index < hmd->totindex-1) index++;
- }
- nr++;
- bp++;
- }
-}
-
-static int return_editcurve_indexar(int *tot, int **indexar, float *cent)
-{
- extern ListBase editNurb;
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int *index, a, nr, totvert=0;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->f1 & SELECT) totvert++;
- if(bezt->f2 & SELECT) totvert++;
- if(bezt->f3 & SELECT) totvert++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) totvert++;
- bp++;
- }
- }
- }
- if(totvert==0) return 0;
-
- *indexar= index= MEM_mallocN(4*totvert, "hook indexar");
- *tot= totvert;
- nr= 0;
- cent[0]= cent[1]= cent[2]= 0.0;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(bezt->f1 & SELECT) {
- *index= nr; index++;
- VecAddf(cent, cent, bezt->vec[0]);
- }
- nr++;
- if(bezt->f2 & SELECT) {
- *index= nr; index++;
- VecAddf(cent, cent, bezt->vec[1]);
- }
- nr++;
- if(bezt->f3 & SELECT) {
- *index= nr; index++;
- VecAddf(cent, cent, bezt->vec[2]);
- }
- nr++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- *index= nr; index++;
- VecAddf(cent, cent, bp->vec);
- }
- nr++;
- bp++;
- }
- }
- }
-
- VecMulf(cent, 1.0f/(float)totvert);
-
- return totvert;
-}
-
-/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place
- * apply-size-rot or object center for eg */
-static void ignore_parent_tx( Object *ob ) {
- Object *ob_child;
- /* a change was made, adjust the children to compensate */
- for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) {
- if (ob_child->parent == ob) {
- apply_obmat(ob_child);
- what_does_parent(ob_child);
- Mat4Invert(ob_child->parentinv, workob.obmat);
- }
- }
-}
-
-static void select_editcurve_hook(HookModifierData *hmd)
-{
- extern ListBase editNurb;
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- int index=0, a, nr=0;
-
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(nr == hmd->indexar[index]) {
- bezt->f1 |= SELECT;
- if(index<hmd->totindex-1) index++;
- }
- nr++;
- if(nr == hmd->indexar[index]) {
- bezt->f2 |= SELECT;
- if(index<hmd->totindex-1) index++;
- }
- nr++;
- if(nr == hmd->indexar[index]) {
- bezt->f3 |= SELECT;
- if(index<hmd->totindex-1) index++;
- }
- nr++;
-
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(nr == hmd->indexar[index]) {
- bp->f1 |= SELECT;
- if(index<hmd->totindex-1) index++;
- }
- nr++;
- bp++;
- }
- }
- }
-}
-
-void hook_select(HookModifierData *hmd)
-{
- if(G.obedit->type==OB_MESH) select_editmesh_hook(hmd);
- else if(G.obedit->type==OB_LATTICE) select_editlattice_hook(hmd);
- else if(G.obedit->type==OB_CURVE) select_editcurve_hook(hmd);
- else if(G.obedit->type==OB_SURF) select_editcurve_hook(hmd);
-}
-
-int hook_getIndexArray(int *tot, int **indexar, char *name, float *cent_r)
-{
- *indexar= NULL;
- *tot= 0;
- name[0]= 0;
-
- switch(G.obedit->type) {
- case OB_MESH:
- /* check selected vertices first */
- if( return_editmesh_indexar(tot, indexar, cent_r)) return 1;
- else return return_editmesh_vgroup(name, cent_r);
- case OB_CURVE:
- case OB_SURF:
- return return_editcurve_indexar(tot, indexar, cent_r);
- case OB_LATTICE:
- return return_editlattice_indexar(tot, indexar, cent_r);
- default:
- return 0;
- }
-}
-
-void add_hook_menu(void)
-{
- int mode;
-
- if(G.obedit==NULL) return;
-
- if(modifiers_findByType(G.obedit, eModifierType_Hook))
- mode= pupmenu("Hooks %t|Add, To New Empty %x1|Add, To Selected Object %x2|Remove... %x3|Reassign... %x4|Select... %x5|Clear Offset...%x6");
- else
- mode= pupmenu("Hooks %t|Add, New Empty %x1|Add, To Selected Object %x2");
-
- if(mode<1) return;
-
- /* do operations */
- add_hook(mode);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-
- BIF_undo_push("Add hook");
-}
-
-void add_hook(int mode)
-{
- ModifierData *md = NULL;
- HookModifierData *hmd = NULL;
- Object *ob=NULL;
-
- if(G.obedit==NULL) return;
-
- /* preconditions */
- if(mode==2) { /* selected object */
- Base *base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- ob= base->object;
- break;
- }
- }
- base= base->next;
- }
- if(ob==NULL) {
- error("Requires selected Object");
- return;
- }
- }
- else if(mode!=1) {
- int maxlen=0, a, nr;
- char *cp;
-
- /* make pupmenu with hooks */
- for(md=G.obedit->modifiers.first; md; md= md->next) {
- if (md->type==eModifierType_Hook)
- maxlen+=32;
- }
-
- if(maxlen==0) {
- error("Object has no hooks yet");
- return;
- }
-
- cp= MEM_callocN(maxlen+32, "temp string");
- if(mode==3) strcpy(cp, "Remove %t|");
- else if(mode==4) strcpy(cp, "Reassign %t|");
- else if(mode==5) strcpy(cp, "Select %t|");
- else if(mode==6) strcpy(cp, "Clear Offset %t|");
-
- for(md=G.obedit->modifiers.first; md; md= md->next) {
- if (md->type==eModifierType_Hook) {
- strcat(cp, md->name);
- strcat(cp, " |");
- }
- }
-
- nr= pupmenu(cp);
- MEM_freeN(cp);
-
- if(nr<1) return;
-
- a= 1;
- for(md=G.obedit->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- if(a==nr) break;
- a++;
- }
- }
-
- hmd = (HookModifierData*) md;
- ob= hmd->object;
- }
-
- /* do it, new hooks or reassign */
- if(mode==1 || mode==2 || mode==4) {
- float cent[3];
- int tot, ok, *indexar;
- char name[32];
-
- ok = hook_getIndexArray(&tot, &indexar, name, cent);
-
- if(ok==0) {
- error("Requires selected vertices or active Vertex Group");
- }
- else {
-
- if(mode==1) {
- Base *base= BASACT, *newbase;
-
- ob= add_object(OB_EMPTY);
- /* set layers OK */
- newbase= BASACT;
- newbase->lay= base->lay;
- ob->lay= newbase->lay;
-
- /* transform cent to global coords for loc */
- VecMat4MulVecfl(ob->loc, G.obedit->obmat, cent);
-
- /* restore, add_object sets active */
- BASACT= base;
- }
- /* if mode is 2 or 4, ob has been set */
-
- /* new hook */
- if(mode==1 || mode==2) {
- ModifierData *md = G.obedit->modifiers.first;
-
- while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) {
- md = md->next;
- }
-
- hmd = (HookModifierData*) modifier_new(eModifierType_Hook);
- BLI_insertlinkbefore(&G.obedit->modifiers, md, hmd);
- sprintf(hmd->modifier.name, "Hook-%s", ob->id.name+2);
- }
- else if (hmd->indexar) MEM_freeN(hmd->indexar); /* reassign, hook was set */
-
- hmd->object= ob;
- hmd->indexar= indexar;
- VECCOPY(hmd->cent, cent);
- hmd->totindex= tot;
- BLI_strncpy(hmd->name, name, 32);
-
- if(mode==1 || mode==2) {
- /* matrix calculus */
- /* vert x (obmat x hook->imat) x hook->obmat x ob->imat */
- /* (parentinv ) */
-
- where_is_object(ob);
-
- Mat4Invert(ob->imat, ob->obmat);
- /* apparently this call goes from right to left... */
- Mat4MulSerie(hmd->parentinv, ob->imat, G.obedit->obmat, NULL,
- NULL, NULL, NULL, NULL, NULL);
- }
- }
- }
- else if(mode==3) { /* remove */
- BLI_remlink(&G.obedit->modifiers, md);
- modifier_free(md);
- }
- else if(mode==5) { /* select */
- hook_select(hmd);
- }
- else if(mode==6) { /* clear offset */
- where_is_object(ob); /* ob is hook->parent */
-
- Mat4Invert(ob->imat, ob->obmat);
- /* this call goes from right to left... */
- Mat4MulSerie(hmd->parentinv, ob->imat, G.obedit->obmat, NULL,
- NULL, NULL, NULL, NULL, NULL);
- }
-
- DAG_scene_sort(G.scene);
-}
-
-void make_track(void)
-{
- Base *base;
- short mode=0;
-
- if(G.scene->id.lib) return;
- if(G.obedit) {
- return;
- }
- if(BASACT==0) return;
-
- mode= pupmenu("Make Track %t|TrackTo Constraint %x1|LockTrack Constraint %x2|Old Track %x3");
- if (mode == 0){
- return;
- }
- else if (mode == 1){
- bConstraint *con;
- bTrackToConstraint *data;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO);
- strcpy (con->name, "AutoTrack");
-
- data = con->data;
- data->tar = BASACT->object;
- base->object->recalc |= OB_RECALC;
-
- /* Lamp and Camera track differently by default */
- if (base->object->type == OB_LAMP || base->object->type == OB_CAMERA) {
- data->reserved1 = TRACK_nZ;
- data->reserved2 = UP_Y;
- }
-
- add_constraint_to_object(con, base->object);
- }
- }
- base= base->next;
- }
-
- }
- else if (mode == 2){
- bConstraint *con;
- bLockTrackConstraint *data;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK);
- strcpy (con->name, "AutoTrack");
-
- data = con->data;
- data->tar = BASACT->object;
- base->object->recalc |= OB_RECALC;
-
- /* Lamp and Camera track differently by default */
- if (base->object->type == OB_LAMP || base->object->type == OB_CAMERA) {
- data->trackflag = TRACK_nZ;
- data->lockflag = LOCK_Y;
- }
-
- add_constraint_to_object(con, base->object);
- }
- }
- base= base->next;
- }
-
- }
- else if (mode == 3){
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- base->object->track= BASACT->object;
- base->object->recalc |= OB_RECALC;
- }
- }
- base= base->next;
- }
- }
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
- DAG_scene_sort(G.scene);
-
- BIF_undo_push("Make Track");
-}
-
-void apply_obmat(Object *ob)
-{
- float mat[3][3], imat[3][3], tmat[3][3];
-
- /* from obmat to loc rot size */
-
- if(ob==0) return;
- Mat3CpyMat4(mat, ob->obmat);
-
- VECCOPY(ob->loc, ob->obmat[3]);
- /* Quats arnt used yet */
- /*if(ob->transflag & OB_QUAT) {
- Mat3ToQuat(mat, ob->quat);
- QuatToMat3(ob->quat, tmat);
- }
- else {*/
- Mat3ToEul(mat, ob->rot);
- EulToMat3(ob->rot, tmat);
- /*}*/
- Mat3Inv(imat, tmat);
-
- Mat3MulMat3(tmat, imat, mat);
-
- ob->size[0]= tmat[0][0];
- ob->size[1]= tmat[1][1];
- ob->size[2]= tmat[2][2];
-
-}
-
-void clear_parent(void)
-{
- Object *par;
- Base *base;
- int mode;
-
- if(G.obedit) return;
- if(G.scene->id.lib) return;
-
- mode= pupmenu("OK? %t|Clear Parent %x1|Clear and Keep Transformation (Clear Track) %x2|Clear Parent Inverse %x3");
-
- if(mode<1) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- par= NULL;
- if(mode==1 || mode==2) {
- par= base->object->parent;
- base->object->parent= NULL;
- base->object->recalc |= OB_RECALC;
-
- if(mode==2) {
- base->object->track= NULL;
- apply_obmat(base->object);
- }
- }
- else if(mode==3) {
- Mat4One(base->object->parentinv);
- base->object->recalc |= OB_RECALC;
- }
- }
- base= base->next;
- }
-
- DAG_scene_sort(G.scene);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Clear Parent");
-}
-
-void clear_track(void)
-{
- Base *base;
- int mode;
-
- if(G.obedit) return;
- if(G.scene->id.lib) return;
-
- mode= pupmenu("OK? %t|Clear Track %x1| Clear Track and Keep Transform %x2");
-
- if(mode<1) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- base->object->track= NULL;
- base->object->recalc |= OB_RECALC;
-
- if(mode==2) {
- apply_obmat(base->object);
- }
- }
- base= base->next;
- }
-
- DAG_scene_sort(G.scene);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Clear Track");
-}
-
-void clear_object(char mode)
-{
- Base *base;
- Object *ob;
- float *v1, *v3, mat[3][3];
- int armature_clear= 0;
- char *str=NULL;
-
- if(G.obedit) return;
- if(G.scene->id.lib) return;
-
- if(mode=='r') str= "Clear rotation";
- else if(mode=='g') str= "Clear location";
- else if(mode=='s') str= "Clear scale";
- else if(mode=='o') str= "Clear origin";
- else return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- ob= base->object;
-
- if ((ob->flag & OB_POSEMODE)) {
- /* only clear pose transforms if:
- * - with a mesh in weightpaint mode, it's related armature needs to be cleared
- * - with clearing transform of object being edited at the time
- */
- if ((G.f & G_WEIGHTPAINT) || (ob==OBACT)) {
- clear_armature(ob, mode);
- armature_clear= 1; /* silly system to prevent another dag update, so no action applied */
- }
- }
- else if((G.f & G_WEIGHTPAINT)==0) {
- /* only clear transforms of 'normal' (not armature) object if:
- * - not in weightpaint mode or editmode
- * - if that object's transform locks are not enabled (this is done on a per-channel basis)
- */
- if (mode=='r') {
- /* eulers can only get cleared if they are not protected */
- if ((ob->protectflag & OB_LOCK_ROTX)==0)
- ob->rot[0]= ob->drot[0]= 0.0f;
- if ((ob->protectflag & OB_LOCK_ROTY)==0)
- ob->rot[1]= ob->drot[1]= 0.0f;
- if ((ob->protectflag & OB_LOCK_ROTZ)==0)
- ob->rot[2]= ob->drot[2]= 0.0f;
-
- /* quats here are not really used anymore anywhere, so it probably doesn't
- * matter to not clear them whether the euler-based rotation is used
- */
- /*QuatOne(ob->quat);
- QuatOne(ob->dquat);*/
-
-#ifdef WITH_VERSE
- if(ob->vnode) {
- struct VNode *vnode = (VNode*)ob->vnode;
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
- b_verse_send_transformation(ob);
- }
-#endif
-
- }
- else if (mode=='g') {
- if ((ob->protectflag & OB_LOCK_LOCX)==0)
- ob->loc[0]= ob->dloc[0]= 0.0f;
- if ((ob->protectflag & OB_LOCK_LOCY)==0)
- ob->loc[1]= ob->dloc[1]= 0.0f;
- if ((ob->protectflag & OB_LOCK_LOCZ)==0)
- ob->loc[2]= ob->dloc[2]= 0.0f;
-
-#ifdef WITH_VERSE
- if(ob->vnode) {
- struct VNode *vnode = (VNode*)ob->vnode;
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
- b_verse_send_transformation(ob);
- }
-#endif
-
- }
- else if (mode=='s') {
- if ((ob->protectflag & OB_LOCK_SCALEX)==0) {
- ob->dsize[0]= 0.0f;
- ob->size[0]= 1.0f;
- }
- if ((ob->protectflag & OB_LOCK_SCALEY)==0) {
- ob->dsize[1]= 0.0f;
- ob->size[1]= 1.0f;
- }
- if ((ob->protectflag & OB_LOCK_SCALEZ)==0) {
- ob->dsize[2]= 0.0f;
- ob->size[2]= 1.0f;
- }
-#ifdef WITH_VERSE
- if(ob->vnode) {
- struct VNode *vnode = (VNode*)ob->vnode;
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
- b_verse_send_transformation(ob);
- }
-#endif
-
- }
- else if(mode=='o') {
- if(ob->parent) {
- v1= ob->loc;
- v3= ob->parentinv[3];
-
- Mat3CpyMat4(mat, ob->parentinv);
- VECCOPY(v3, v1);
- v3[0]= -v3[0];
- v3[1]= -v3[1];
- v3[2]= -v3[2];
- Mat3MulVecfl(mat, v3);
- }
- }
-
- ob->recalc |= OB_RECALC_OB;
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- if(armature_clear==0) /* in this case flush was done */
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- BIF_undo_push(str);
-}
-
-void reset_slowparents(void)
-{
- /* back to original locations */
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if(base->object->parent) {
- if(base->object->partype & PARSLOW) {
- base->object->partype -= PARSLOW;
- where_is_object(base->object);
- base->object->partype |= PARSLOW;
- }
- }
- base= base->next;
- }
-}
-
-void set_slowparent(void)
-{
- Base *base;
-
- if( okee("Set slow parent")==0 ) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base->object->parent) base->object->partype |= PARSLOW;
- }
- base= base->next;
- }
- BIF_undo_push("Slow parent");
-}
-
-void make_vertex_parent(void)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- Base *base;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- Object *par, *ob;
- int a, v1=0, v2=0, v3=0, v4=0, nr=1;
-
- /* we need 1 to 3 selected vertices */
-
- if(G.obedit->type==OB_MESH) {
- eve= em->verts.first;
- while(eve) {
- if(eve->f & 1) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
- else break;
- }
- nr++;
- eve= eve->next;
- }
- }
- else if ELEM(G.obedit->type, OB_SURF, OB_CURVE) {
- extern ListBase editNurb;
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- if(BEZSELECTED_HIDDENHANDLES(bezt)) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
- else break;
- }
- nr++;
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
- else break;
- }
- nr++;
- bp++;
- }
- }
- nu= nu->next;
- }
- }
- else if(G.obedit->type==OB_LATTICE) {
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- bp= editLatt->def;
- while(a--) {
- if(bp->f1 & SELECT) {
- if(v1==0) v1= nr;
- else if(v2==0) v2= nr;
- else if(v3==0) v3= nr;
- else if(v4==0) v4= nr;
- else break;
- }
- nr++;
- bp++;
- }
- }
-
- if(v4 || !((v1 && v2==0 && v3==0) || (v1 && v2 && v3)) ) {
- error("Select either 1 or 3 vertices to parent to");
- return;
- }
-
- if(okee("Make vertex parent")==0) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
-
- ob= base->object;
- ob->recalc |= OB_RECALC;
- par= BASACT->object->parent;
-
- while(par) {
- if(par==ob) break;
- par= par->parent;
- }
- if(par) {
- error("Loop in parents");
- }
- else {
- ob->parent= BASACT->object;
- if(v3) {
- ob->partype= PARVERT3;
- ob->par1= v1-1;
- ob->par2= v2-1;
- ob->par3= v3-1;
-
- /* inverse parent matrix */
- what_does_parent(ob);
- Mat4Invert(ob->parentinv, workob.obmat);
- clear_workob();
- }
- else {
- ob->partype= PARVERT1;
- ob->par1= v1-1;
-
- /* inverse parent matrix */
- what_does_parent(ob);
- Mat4Invert(ob->parentinv, workob.obmat);
- clear_workob();
- }
- }
- }
- }
- base= base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
-
- DAG_scene_sort(G.scene);
- /* BIF_undo_push(str); not, conflicts with editmode undo... */
-}
-
-static Object *group_objects_menu(Group *group)
-{
- GroupObject *go;
- int len= 0;
- short a, nr;
- char *str;
-
- for(go= group->gobject.first; go; go= go->next) {
- if(go->ob)
- len++;
- }
- if(len==0) return NULL;
-
- str= MEM_callocN(40+32*len, "menu");
-
- strcpy(str, "Make Proxy for: %t");
- a= strlen(str);
- for(nr=1, go= group->gobject.first; go; go= go->next, nr++) {
- a+= sprintf(str+a, "|%s %%x%d", go->ob->id.name+2, nr);
- }
-
- a= pupmenu_col(str, 20);
- MEM_freeN(str);
- if(a>0) {
- go= BLI_findlink(&group->gobject, a-1);
- return go->ob;
- }
- return NULL;
-}
-
-
-/* adds empty object to become local replacement data of a library-linked object */
-void make_proxy(void)
-{
- Object *ob= OBACT;
- Object *gob= NULL;
-
- if(G.scene->id.lib) return;
- if(ob==NULL) return;
-
-
- if(ob->dup_group && ob->dup_group->id.lib) {
- gob= ob;
- /* gives menu with list of objects in group */
- ob= group_objects_menu(ob->dup_group);
- }
- else if(ob->id.lib) {
- if(okee("Make Proxy Object")==0)
- return;
- }
- else {
- error("Can only make proxy for a referenced object or group");
- return;
- }
-
- if(ob) {
- Object *newob;
- Base *newbase, *oldbase= BASACT;
- char name[32];
-
- newob= add_object(OB_EMPTY);
- if(gob)
- strcpy(name, gob->id.name+2);
- else
- strcpy(name, ob->id.name+2);
- strcat(name, "_proxy");
- rename_id(&newob->id, name);
-
- /* set layers OK */
- newbase= BASACT; /* add_object sets active... */
- newbase->lay= oldbase->lay;
- newob->lay= newbase->lay;
-
- /* remove base, leave user count of object, it gets linked in object_make_proxy */
- if(gob==NULL) {
- BLI_remlink(&G.scene->base, oldbase);
- MEM_freeN(oldbase);
- }
- object_make_proxy(newob, ob, gob);
-
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, newob, OB_RECALC);
- allqueue(REDRAWALL, 0);
- BIF_undo_push("Make Proxy Object");
- }
-}
-
-int test_parent_loop(Object *par, Object *ob)
-{
- /* test if 'ob' is a parent somewhere in par's parents */
-
- if(par==0) return 0;
- if(ob == par) return 1;
-
- return test_parent_loop(par->parent, ob);
-
-}
-
-void make_parent(void)
-{
- Base *base;
- Object *par;
- bPoseChannel *pchan= NULL;
- short qual, mode=0;
-
- if(G.scene->id.lib) return;
- if(G.obedit) {
- if ELEM4(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) make_vertex_parent();
- else if (G.obedit->type==OB_ARMATURE) make_bone_parent();
- return;
- }
- if(BASACT==0) return;
-
- qual= G.qual;
- par= BASACT->object;
-
- if(par->type == OB_LATTICE){
- mode= pupmenu("Make Parent %t|Normal Parent %x1|Lattice Deform %x2");
- if(mode<=0){
- return;
- }
- else if(mode==1) {
- mode= PAROBJECT;
- }
- else if(mode==2) {
- mode= PARSKEL;
- }
- }
- else if(par->type == OB_CURVE){
- mode= pupmenu("Make Parent %t|Normal Parent %x1|Follow Path %x2|Curve Deform %x3|Path Constraint %x4");
- if(mode<=0){
- return;
- }
- else if(mode==1) {
- mode= PAROBJECT;
- }
- else if(mode==2) {
- Curve *cu= par->data;
-
- mode= PAROBJECT;
- if((cu->flag & CU_PATH)==0) {
- cu->flag |= CU_PATH|CU_FOLLOW;
- makeDispListCurveTypes(par, 0); /* force creation of path data */
- }
- else cu->flag |= CU_FOLLOW;
- }
- else if(mode==3) {
- mode= PARSKEL;
- }
- else if(mode==4) {
- bConstraint *con;
- bFollowPathConstraint *data;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- float cmat[4][4], vec[3];
-
- con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH);
- strcpy (con->name, "AutoPath");
-
- data = con->data;
- data->tar = BASACT->object;
-
- add_constraint_to_object(con, base->object);
-
- get_constraint_target_matrix(con, 0, CONSTRAINT_OBTYPE_OBJECT, NULL, cmat, G.scene->r.cfra - give_timeoffset(base->object));
- VecSubf(vec, base->object->obmat[3], cmat[3]);
-
- base->object->loc[0] = vec[0];
- base->object->loc[1] = vec[1];
- base->object->loc[2] = vec[2];
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_scene_sort(G.scene);
- BIF_undo_push("Make Parent");
- return;
- }
- }
- else if(par->type == OB_ARMATURE){
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
- if(ELEM(base->object->type, OB_MESH, OB_LATTICE)) {
- if(par->flag & OB_POSEMODE)
- mode= pupmenu("Make Parent To%t|Bone %x1|Armature %x2|Object %x3");
- else
- mode= pupmenu("Make Parent To%t|Armature %x2|Object %x3");
- break;
- }
- else {
- if(par->flag & OB_POSEMODE)
- mode= pupmenu("Make Parent To %t|Bone %x1|Object %x3");
- else
- mode= pupmenu("Make Parent To %t|Object %x3");
- break;
- }
- }
- }
- base= base->next;
- }
-
- switch (mode){
- case 1:
- mode=PARBONE;
- pchan= get_active_posechannel(par);
-
- if(pchan==NULL) {
- error("No active Bone");
- allqueue(REDRAWVIEW3D, 0);
- return;
- }
-
- break;
- case 2:
- mode=PARSKEL;
- break;
- case 3:
- mode=PAROBJECT;
- break;
- default:
- return;
- }
- }
- else {
- if(qual & LR_SHIFTKEY) {
- if(okee("Make parent without inverse")==0) return;
- }
- else {
- if(qual & LR_ALTKEY) {
- if(okee("Make vertex parent")==0) return;
- }
- else if(okee("Make parent")==0) return;
-
- /* now we'll clearparentandkeeptransform all objects */
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT && base->object->parent) {
- base->object->parent= NULL;
- apply_obmat(base->object);
- }
- }
- base= base->next;
- }
- }
- }
-
- par->recalc |= OB_RECALC_OB;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base!=BASACT) {
-
- if( test_parent_loop(par, base->object) ) {
- error("Loop in parents");
- }
- else {
-
- base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA;
-
- /* the ifs below are horrible code (ton) */
-
- if (par->type==OB_ARMATURE) {
- base->object->partype= mode;
- if (pchan)
- strcpy (base->object->parsubstr, pchan->name);
- else
- base->object->parsubstr[0]=0;
- }
- else {
- if(qual & LR_ALTKEY) {
- base->object->partype= PARVERT1;
- }
- else if(ELEM(par->type, OB_CURVE, OB_LATTICE)) {
- base->object->partype= mode;
- }
- else {
- base->object->partype= PAROBJECT;
- }
- }
-
- base->object->parent= par;
-
- /* calculate inverse parent matrix? */
- if( (qual & LR_SHIFTKEY) ) {
- /* not... */
- Mat4One(base->object->parentinv);
- memset(base->object->loc, 0, 3*sizeof(float));
- }
- else {
- if(mode==PARSKEL && base->object->type==OB_MESH && par->type == OB_ARMATURE) {
- /* Prompt the user as to whether he wants to
- * add some vertex groups based on the bones
- * in the parent armature.
- */
- create_vgroups_from_armature(base->object,
- par);
-
- base->object->partype= PAROBJECT;
- what_does_parent(base->object);
- Mat4One (base->object->parentinv);
- base->object->partype= mode;
- }
- else
- what_does_parent(base->object);
- Mat4Invert(base->object->parentinv, workob.obmat);
- }
- }
- }
- }
- base= base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-
- DAG_scene_sort(G.scene);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- BIF_undo_push("make Parent");
-}
-
-
-void enter_editmode(int wc)
-{
- Base *base;
- Object *ob;
- Mesh *me;
- bArmature *arm;
- int ok= 0;
-
- if(G.scene->id.lib) return;
- base= BASACT;
- if(base==0) return;
- if((G.vd==NULL || (base->lay & G.vd->lay))==0) return;
-
- strcpy(G.editModeTitleExtra, "");
-
- ob= base->object;
- if(ob->data==0) return;
-
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return;
- }
-
- if(wc) waitcursor(1);
-
- if(ob->type==OB_MESH) {
- me= get_mesh(ob);
- if( me==0 ) return;
- if(me->pv) mesh_pmv_off(ob, me);
- ok= 1;
- G.obedit= ob;
- make_editMesh();
- allqueue(REDRAWBUTSLOGIC, 0);
- /*if(G.f & G_FACESELECT) allqueue(REDRAWIMAGE, 0);*/
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- }
- if (ob->type==OB_ARMATURE){
- arm= base->object->data;
- if (!arm) return;
- /*
- * The function object_data_is_libdata make a problem here, the
- * check for ob->proxy return 0 and let blender enter to edit mode
- * this causa a crash when you try leave the edit mode.
- * The problem is that i can't remove the ob->proxy check from
- * object_data_is_libdata that prevent the bugfix #6614, so
- * i add this little hack here.
- */
- if(arm->id.lib) {
- error_libdata();
- return;
- }
- ok=1;
- G.obedit=ob;
- make_editArmature();
- /* to ensure all goes in restposition and without striding */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC);
-
- allqueue (REDRAWVIEW3D,0);
- }
- else if(ob->type==OB_FONT) {
- G.obedit= ob;
- ok= 1;
- make_editText();
- }
- else if(ob->type==OB_MBALL) {
- G.obedit= ob;
- ok= 1;
- make_editMball();
- }
- else if(ob->type==OB_LATTICE) {
- G.obedit= ob;
- ok= 1;
- make_editLatt();
- }
- else if(ob->type==OB_SURF || ob->type==OB_CURVE) {
- ok= 1;
- G.obedit= ob;
- make_editNurb();
- }
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- countall();
-
- if(ok) {
- setcursor_space(SPACE_VIEW3D, CURSOR_EDIT);
-
- allqueue(REDRAWVIEW3D, 1);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- }
- else G.obedit= NULL;
-
- if(wc) waitcursor(0);
-
- scrarea_queue_headredraw(curarea);
-}
-
-void exit_editmode(int flag) /* freedata==0 at render, 1= freedata, 2= do undo buffer too */
-{
- Object *ob;
- int freedata = flag & EM_FREEDATA;
-
- if(G.obedit==NULL) return;
-
- if(flag & EM_WAITCURSOR) waitcursor(1);
- if(G.obedit->type==OB_MESH) {
-
- /* temporal */
- countall();
-
- if(EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- if(retopo_mesh_paint_check())
- retopo_end_okee();
-
- if(G.totvert>MESH_MAX_VERTS) {
- error("Too many vertices");
- return;
- }
- load_editMesh();
-
- if(freedata) free_editMesh(G.editMesh);
-
- if(G.f & G_WEIGHTPAINT)
- mesh_octree_table(G.obedit, NULL, 'e');
- }
- else if (G.obedit->type==OB_ARMATURE){
- load_editArmature();
- if (freedata) free_editArmature();
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- extern ListBase editNurb;
- load_editNurb();
- if(freedata) freeNurblist(&editNurb);
- }
- else if(G.obedit->type==OB_FONT && freedata) {
- load_editText();
- }
- else if(G.obedit->type==OB_LATTICE) {
- load_editLatt();
- if(freedata) free_editLatt();
- }
- else if(G.obedit->type==OB_MBALL) {
- extern ListBase editelems;
- load_editMball();
- if(freedata) BLI_freelistN(&editelems);
- }
-
- ob= G.obedit;
-
- /* for example; displist make is different in editmode */
- if(freedata) G.obedit= NULL;
-
- if(ob->type==OB_MESH && get_mesh(ob)->mr)
- multires_edge_level_update(ob, get_mesh(ob));
-
- /* also flush ob recalc, doesn't take much overhead, but used for particles */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
-
- if(freedata) {
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
-
- scrarea_queue_headredraw(curarea);
-
- if(G.obedit==NULL && (flag & EM_FREEUNDO))
- BIF_undo_push("Editmode");
-
- if(flag & EM_WAITCURSOR) waitcursor(0);
-}
-
-void check_editmode(int type)
-{
-
- if (G.obedit==0 || G.obedit->type==type) return;
-
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */
-}
-
-/* 0 == do center, 1 == center new, 2 == center cursor */
-
-void docenter(int centermode)
-{
- EditMesh *em = G.editMesh;
- Base *base;
- Object *ob;
- Mesh *me, *tme;
- Curve *cu;
-/* BezTriple *bezt;
- BPoint *bp; */
- Nurb *nu, *nu1;
- EditVert *eve;
- float cent[3], centn[3], min[3], max[3], omat[3][3];
- int a, total= 0;
-
- /* keep track of what is changed */
- int tot_change=0, tot_lib_error=0, tot_key_error=0, tot_multiuser_arm_error=0;
- MVert *mvert;
-
- if(G.scene->id.lib || G.vd==NULL) return;
-
- cent[0]= cent[1]= cent[2]= 0.0;
-
- if(G.obedit) {
-
- INIT_MINMAX(min, max);
-
- if(G.obedit->type==OB_MESH) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(G.vd->around==V3D_CENTROID) {
- total++;
- VECADD(cent, cent, eve->co);
- }
- else {
- DO_MINMAX(eve->co, min, max);
- }
- }
-
- if(G.vd->around==V3D_CENTROID) {
- VecMulf(cent, 1.0f/(float)total);
- }
- else {
- cent[0]= (min[0]+max[0])/2.0f;
- cent[1]= (min[1]+max[1])/2.0f;
- cent[2]= (min[2]+max[2])/2.0f;
- }
-
- for(eve= em->verts.first; eve; eve= eve->next) {
- VecSubf(eve->co, eve->co, cent);
- }
-
- recalc_editnormals();
- tot_change++;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- }
-
- /* reset flags */
- for (base=FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base)
- base->object->flag &= ~OB_DONE;
- }
-
- for (me= G.main->mesh.first; me; me= me->id.next) {
- me->flag &= ~ME_ISDONE;
- }
-
- base= FIRSTBASE;
- while(base) {
-
- if TESTBASELIB(base) {
- if((base->object->flag & OB_DONE)==0) {
- base->object->flag |= OB_DONE;
-
- if(base->object->id.lib) {
- tot_lib_error++;
- }
- else if(G.obedit==0 && (me=get_mesh(base->object)) ) {
-
- if(me->key) {
- /*error("Can't change the center of a mesh with vertex keys");
- return;*/
- tot_key_error++;
- } else if (me->id.lib) {
- tot_lib_error++;
- } else {
- if(centermode==2) {
- VECCOPY(cent, give_cursor());
- Mat4Invert(base->object->imat, base->object->obmat);
- Mat4MulVecfl(base->object->imat, cent);
- } else {
- INIT_MINMAX(min, max);
- mvert= me->mvert;
- for(a=0; a<me->totvert; a++, mvert++) {
- DO_MINMAX(mvert->co, min, max);
- }
-
- cent[0]= (min[0]+max[0])/2.0f;
- cent[1]= (min[1]+max[1])/2.0f;
- cent[2]= (min[2]+max[2])/2.0f;
- }
-
- mvert= me->mvert;
- for(a=0; a<me->totvert; a++, mvert++) {
- VecSubf(mvert->co, mvert->co, cent);
- }
- me->flag |= ME_ISDONE;
-
- if(centermode) {
- Mat3CpyMat4(omat, base->object->obmat);
-
- VECCOPY(centn, cent);
- Mat3MulVecfl(omat, centn);
- base->object->loc[0]+= centn[0];
- base->object->loc[1]+= centn[1];
- base->object->loc[2]+= centn[2];
-
- where_is_object(base->object);
- ignore_parent_tx(base->object);
-
- /* other users? */
- ob= G.main->object.first;
- while(ob) {
- if((ob->flag & OB_DONE)==0) {
- tme= get_mesh(ob);
-
- if(tme==me) {
-
- ob->flag |= OB_DONE;
- ob->recalc= OB_RECALC_OB|OB_RECALC_DATA;
-
- Mat3CpyMat4(omat, ob->obmat);
- VECCOPY(centn, cent);
- Mat3MulVecfl(omat, centn);
- ob->loc[0]+= centn[0];
- ob->loc[1]+= centn[1];
- ob->loc[2]+= centn[2];
-
- where_is_object(ob);
- ignore_parent_tx(ob);
-
- if(tme && (tme->flag & ME_ISDONE)==0) {
- mvert= tme->mvert;
- for(a=0; a<tme->totvert; a++, mvert++) {
- VecSubf(mvert->co, mvert->co, cent);
- }
- tme->flag |= ME_ISDONE;
- }
- }
- }
-
- ob= ob->id.next;
- }
- }
- tot_change++;
- }
- }
- else if ELEM(base->object->type, OB_CURVE, OB_SURF) {
-
- /* totally weak code here... (ton) */
- if(G.obedit==base->object) {
- extern ListBase editNurb;
- nu1= editNurb.first;
- cu= G.obedit->data;
- }
- else {
- cu= base->object->data;
- nu1= cu->nurb.first;
- }
-
- if (cu->id.lib) {
- tot_lib_error++;
- } else {
- if(centermode==2) {
- VECCOPY(cent, give_cursor());
- Mat4Invert(base->object->imat, base->object->obmat);
- Mat4MulVecfl(base->object->imat, cent);
-
- /* don't allow Z change if curve is 2D */
- if( !( cu->flag & CU_3D ) )
- cent[2] = 0.0;
- } else {
- INIT_MINMAX(min, max);
-
- nu= nu1;
- while(nu) {
- minmaxNurb(nu, min, max);
- nu= nu->next;
- }
-
- cent[0]= (min[0]+max[0])/2.0f;
- cent[1]= (min[1]+max[1])/2.0f;
- cent[2]= (min[2]+max[2])/2.0f;
- }
-
- nu= nu1;
- while(nu) {
- if( (nu->type & 7)==1) {
- a= nu->pntsu;
- while (a--) {
- VecSubf(nu->bezt[a].vec[0], nu->bezt[a].vec[0], cent);
- VecSubf(nu->bezt[a].vec[1], nu->bezt[a].vec[1], cent);
- VecSubf(nu->bezt[a].vec[2], nu->bezt[a].vec[2], cent);
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- while (a--)
- VecSubf(nu->bp[a].vec, nu->bp[a].vec, cent);
- }
- nu= nu->next;
- }
-
- if(centermode && G.obedit==0) {
- Mat3CpyMat4(omat, base->object->obmat);
-
- Mat3MulVecfl(omat, cent);
- base->object->loc[0]+= cent[0];
- base->object->loc[1]+= cent[1];
- base->object->loc[2]+= cent[2];
-
- where_is_object(base->object);
- ignore_parent_tx(base->object);
- }
-
- tot_change++;
- if(G.obedit) {
- if (centermode==0) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- break;
- }
- }
- }
- else if(base->object->type==OB_FONT) {
- /* get from bb */
-
- cu= base->object->data;
-
- if(cu->bb==0) {
- /* do nothing*/
- } else if (cu->id.lib) {
- tot_lib_error++;
- } else {
- cu->xof= -0.5f*( cu->bb->vec[4][0] - cu->bb->vec[0][0]);
- cu->yof= -0.5f -0.5f*( cu->bb->vec[0][1] - cu->bb->vec[2][1]); /* extra 0.5 is the height of above line */
-
- /* not really ok, do this better once! */
- cu->xof /= cu->fsize;
- cu->yof /= cu->fsize;
-
- allqueue(REDRAWBUTSEDIT, 0);
- tot_change++;
- }
- }
- else if(base->object->type==OB_ARMATURE) {
- bArmature *arm = base->object->data;
-
- if (arm->id.lib) {
- tot_lib_error++;
- } else if(arm->id.us>1) {
- /*error("Can't apply to a multi user armature");
- return;*/
- tot_multiuser_arm_error++;
- } else {
- /* Function to recenter armatures in editarmature.c
- * Bone + object locations are handled there.
- */
- docenter_armature(base->object, centermode);
- tot_change++;
-
- where_is_object(base->object);
- ignore_parent_tx(base->object);
-
- if(G.obedit)
- break;
- }
- }
- base->object->recalc= OB_RECALC_OB|OB_RECALC_DATA;
- }
- }
- base= base->next;
- }
- if (tot_change) {
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Do Center");
- }
-
- /* Warn if any errors occured */
- if (tot_lib_error+tot_key_error+tot_multiuser_arm_error) {
- char err[512];
- sprintf(err, "Warning %i Object(s) Not Centered, %i Changed:", tot_lib_error+tot_key_error+tot_multiuser_arm_error, tot_change);
-
- if (tot_lib_error)
- sprintf(err+strlen(err), "|%i linked library objects", tot_lib_error);
- if (tot_key_error)
- sprintf(err+strlen(err), "|%i mesh key object(s)", tot_key_error);
- if (tot_multiuser_arm_error)
- sprintf(err+strlen(err), "|%i multiuser armature object(s)", tot_multiuser_arm_error);
-
- error(err);
- }
-}
-
-void docenter_new(void)
-{
- if(G.scene->id.lib) return;
-
- if(G.obedit) {
- error("Unable to center new in Edit Mode");
- }
- else {
- docenter(1);
- }
-}
-
-void docenter_cursor(void)
-{
- if(G.scene->id.lib) return;
-
- if(G.obedit) {
- error("Unable to center cursor in Edit Mode");
- }
- else {
- docenter(2);
- }
-}
-
-void movetolayer(void)
-{
- Base *base;
- unsigned int lay= 0, local;
- int islamp= 0;
-
- if(G.scene->id.lib) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) lay |= base->lay;
- base= base->next;
- }
- if(lay==0) return;
- lay &= 0xFFFFFF;
-
- if(lay==0) return;
-
- if(G.vd->localview) {
- /* now we can move out of localview. */
- if (!okee("Move from localview")) return;
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- lay= base->lay & ~G.vd->lay;
- base->lay= lay;
- base->object->lay= lay;
- base->object->flag &= ~SELECT;
- base->flag &= ~SELECT;
- if(base->object->type==OB_LAMP) islamp= 1;
- }
- base= base->next;
- }
- } else {
- if( movetolayer_buts(&lay, NULL)==0 ) return;
-
- /* normal non localview operation */
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- /* upper byte is used for local view */
- local= base->lay & 0xFF000000;
- base->lay= lay + local;
- base->object->lay= lay;
- if(base->object->type==OB_LAMP) islamp= 1;
- }
- base= base->next;
- }
- }
- if(islamp) reshadeall_displist(); /* only frees */
-
- /* warning, active object may be hidden now */
-
- countall();
- DAG_scene_sort(G.scene);
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 0);
-
- BIF_undo_push("Move to layer");
-}
-
-/* THIS IS BAD CODE! do not bring back before it has a real implementation (ton) */
-void split_font()
-{
- Object *ob = OBACT;
- Base *oldbase = BASACT;
- Curve *cu= ob->data;
- char *p= cu->str;
- int slen= strlen(p);
- int i;
-
- for (i = 0; i<=slen; p++, i++) {
- adduplicate(1, U.dupflag);
- cu= OBACT->data;
- cu->sepchar = i+1;
- text_to_curve(OBACT, 0); /* pass 1: only one letter, adapt position */
- text_to_curve(OBACT, 0); /* pass 2: remake */
- freedisplist(&OBACT->disp);
- makeDispListCurveTypes(OBACT, 0);
-
- OBACT->flag &= ~SELECT;
- BASACT->flag &= ~SELECT;
- oldbase->flag |= SELECT;
- oldbase->object->flag |= SELECT;
- set_active_base(oldbase);
- }
-}
-
-static void helpline(short *mval, int *center2d)
-{
-
- /* helpline, copied from transform.c actually */
- persp(PERSP_WIN);
- glDrawBuffer(GL_FRONT);
-
- BIF_ThemeColor(TH_WIRE);
-
- setlinestyle(3);
- glBegin(GL_LINE_STRIP);
- glVertex2sv(mval);
- glVertex2iv((GLint *)center2d);
- glEnd();
- setlinestyle(0);
-
- persp(PERSP_VIEW);
- bglFlush(); // flush display for frontbuffer
- glDrawBuffer(GL_BACK);
-
-
-}
-
-/* context: ob = lamp */
-/* code should be replaced with proper (custom) transform handles for lamp properties */
-static void spot_interactive(Object *ob, int mode)
-{
- Lamp *la= ob->data;
- float transfac, dx, dy, ratio, origval;
- int keep_running= 1, center2d[2];
- short mval[2], mvalo[2];
-
- getmouseco_areawin(mval);
- getmouseco_areawin(mvalo);
-
- project_int(ob->obmat[3], center2d);
- if( center2d[0] > 100000 ) { /* behind camera */
- center2d[0]= curarea->winx/2;
- center2d[1]= curarea->winy/2;
- }
-
- helpline(mval, center2d);
-
- /* ratio is like scaling */
- dx = (float)(center2d[0] - mval[0]);
- dy = (float)(center2d[1] - mval[1]);
- transfac = (float)sqrt( dx*dx + dy*dy);
- if(transfac==0.0f) transfac= 1.0f;
-
- if(mode==1)
- origval= la->spotsize;
- else if(mode==2)
- origval= la->dist;
- else if(mode==3)
- origval= la->clipsta;
- else
- origval= la->clipend;
-
- while (keep_running>0) {
-
- getmouseco_areawin(mval);
-
- /* essential for idling subloop */
- if(mval[0]==mvalo[0] && mval[1]==mvalo[1]) {
- PIL_sleep_ms(2);
- }
- else {
- char str[32];
-
- dx = (float)(center2d[0] - mval[0]);
- dy = (float)(center2d[1] - mval[1]);
- ratio = (float)(sqrt( dx*dx + dy*dy))/transfac;
-
- /* do the trick */
-
- if(mode==1) { /* spot */
- la->spotsize = ratio*origval;
- CLAMP(la->spotsize, 1.0f, 180.0f);
- sprintf(str, "Spot size %.2f\n", la->spotsize);
- }
- else if(mode==2) { /* dist */
- la->dist = ratio*origval;
- CLAMP(la->dist, 0.01f, 5000.0f);
- sprintf(str, "Distance %.2f\n", la->dist);
- }
- else if(mode==3) { /* sta */
- la->clipsta = ratio*origval;
- CLAMP(la->clipsta, 0.001f, 5000.0f);
- sprintf(str, "Distance %.2f\n", la->clipsta);
- }
- else if(mode==4) { /* end */
- la->clipend = ratio*origval;
- CLAMP(la->clipend, 0.1f, 5000.0f);
- sprintf(str, "Clip End %.2f\n", la->clipend);
- }
-
- /* cleanup */
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- /* handle shaded mode */
- shade_buttons_change_3d();
-
- /* DRAW */
- headerprint(str);
- force_draw_plus(SPACE_BUTS, 0);
-
- helpline(mval, center2d);
- }
-
- while( qtest() ) {
- short val;
- unsigned short event= extern_qread(&val);
-
- switch (event){
- case ESCKEY:
- case RIGHTMOUSE:
- keep_running= 0;
- break;
- case LEFTMOUSE:
- case SPACEKEY:
- case PADENTER:
- case RETKEY:
- if(val)
- keep_running= -1;
- break;
- }
- }
- }
-
- if(keep_running==0) {
- if(mode==1)
- la->spotsize= origval;
- else if(mode==2)
- la->dist= origval;
- else if(mode==3)
- la->clipsta= origval;
- else
- la->clipend= origval;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- BIF_preview_changed(ID_LA);
-}
-
-
-void special_editmenu(void)
-{
- static short numcuts= 2;
- Object *ob= OBACT;
- float fac;
- int nr,ret;
- short randfac;
-
- if(ob==NULL) return;
-
- if(G.obedit==NULL) {
-
- if(ob->flag & OB_POSEMODE) {
- pose_special_editmenu();
- }
- else if(FACESEL_PAINT_TEST) {
- Mesh *me= get_mesh(ob);
- MTFace *tface;
- MFace *mface;
- int a;
-
- if(me==0 || me->mtface==0) return;
-
- nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5| TwoSide%x6|Clr Tex%x7| Shared%x8| Light%x9| Invisible%x10| Collision%x11| TwoSide%x12");
-
- tface= me->mtface;
- mface= me->mface;
- for(a=me->totface; a>0; a--, tface++, mface++) {
- if(mface->flag & ME_FACE_SEL) {
- switch(nr) {
- case 1:
- tface->mode |= TF_TEX; break;
- case 2:
- tface->mode |= TF_SHAREDCOL; break;
- case 3:
- tface->mode |= TF_LIGHT; break;
- case 4:
- tface->mode |= TF_INVISIBLE; break;
- case 5:
- tface->mode |= TF_DYNAMIC; break;
- case 6:
- tface->mode |= TF_TWOSIDE; break;
- case 7:
- tface->mode &= ~TF_TEX;
- tface->tpage= 0;
- break;
- case 8:
- tface->mode &= ~TF_SHAREDCOL; break;
- case 9:
- tface->mode &= ~TF_LIGHT; break;
- case 10:
- tface->mode &= ~TF_INVISIBLE; break;
- case 11:
- tface->mode &= ~TF_DYNAMIC; break;
- case 12:
- tface->mode &= ~TF_TWOSIDE; break;
- }
- }
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Change texture face");
- }
- else if(G.f & G_VERTEXPAINT) {
- Mesh *me= get_mesh(ob);
-
- if(me==0 || (me->mcol==NULL && me->mtface==NULL) ) return;
-
- nr= pupmenu("Specials%t|Shared VertexCol%x1");
- if(nr==1) {
-
- do_shared_vertexcol(me);
-
- BIF_undo_push("Shared VertexCol");
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- else if(G.f & G_WEIGHTPAINT) {
- Object *par= modifiers_isDeformedByArmature(ob);
-
- if(par && (par->flag & OB_POSEMODE)) {
- nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
-
- if(nr==1 || nr==2)
- pose_adds_vgroups(ob, (nr == 2));
- }
- }
- else if(G.f & G_PARTICLEEDIT) {
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEditSettings *pset = PE_settings();
-
- if(!psys)
- return;
-
- if(G.scene->selectmode & SCE_SELECT_POINT)
- nr= pupmenu("Specials%t|Rekey%x1|Subdivide%x2|Select First%x3|Select Last%x4|Remove Doubles%x5");
- else
- nr= pupmenu("Specials%t|Rekey%x1|Remove Doubles%x5");
-
- switch(nr) {
- case 1:
- if(button(&pset->totrekey, 2, 100, "Number of Keys:")==0) return;
- waitcursor(1);
- PE_rekey();
- break;
- case 2:
- PE_subdivide();
- break;
- case 3:
- PE_select_root();
- break;
- case 4:
- PE_select_tip();
- break;
- case 5:
- PE_remove_doubles();
- break;
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- if(nr>0) waitcursor(0);
- }
- else {
- Base *base, *base_select= NULL;
-
- /* Get the active object mesh. */
- Mesh *me= get_mesh(ob);
-
- /* Booleans, if the active object is a mesh... */
- if (me && ob->id.lib==NULL) {
-
- /* Bring up a little menu with the boolean operation choices on. */
- nr= pupmenu("Boolean Tools%t|Intersect%x1|Union%x2|Difference%x3|Add Intersect Modifier%x4|Add Union Modifier%x5|Add Difference Modifier%x6");
-
- if (nr > 0) {
- /* user has made a choice of a menu element.
- All of the boolean functions require 2 mesh objects
- we search through the object list to find the other
- selected item and make sure it is distinct and a mesh. */
-
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- if(base->object != ob) base_select= base;
- }
- }
-
- if (base_select) {
- if (get_mesh(base_select->object)) {
- if(nr <= 3){
- waitcursor(1);
- ret = NewBooleanMesh(BASACT,base_select,nr);
- if (ret==0) {
- error("An internal error occurred");
- } else if(ret==-1) {
- error("Selected meshes must have faces to perform boolean operations");
- } else if (ret==-2) {
- error("Both meshes must be a closed mesh");
- }
- else BIF_undo_push("Boolean");
- waitcursor(0);
- } else {
- BooleanModifierData *bmd = NULL;
- bmd = (BooleanModifierData *)modifier_new(eModifierType_Boolean);
- BLI_addtail(&ob->modifiers, bmd);
- bmd->object = base_select->object;
- bmd->modifier.mode |= eModifierMode_Realtime;
- switch(nr){
- case 4: bmd->operation = eBooleanModifierOp_Intersect; break;
- case 5: bmd->operation = eBooleanModifierOp_Union; break;
- case 6: bmd->operation = eBooleanModifierOp_Difference; break;
- }
- do_common_editbuts(B_CHANGEDEP);
- BIF_undo_push("Add Boolean modifier");
- }
- } else {
- error("Please select 2 meshes");
- }
- } else {
- error("Please select 2 meshes");
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- }
- else if (ob->type == OB_LAMP) {
- Lamp *la= ob->data;
- if(la->type==LA_SPOT) {
- short nr= pupmenu("Lamp Tools%t|Spot Size%x1|Distance%x2|Clip Start%x3|Clip End%x4");
- if(nr>0)
- spot_interactive(ob, nr);
- }
- }
- else if (ob->type == OB_FONT) {
- /* removed until this gets a decent implementation (ton) */
-/* nr= pupmenu("Split %t|Characters%x1");
- if (nr > 0) {
- switch(nr) {
- case 1: split_font();
- }
- }
-*/
- }
- }
- }
- else if(G.obedit->type==OB_MESH) {
- /* This is all that is needed, since all other functionality is in Ctrl+ V/E/F but some users didnt like, so for now have the old/big menu */
- /*
- nr= pupmenu("Subdivide Mesh%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x4");
- switch(nr) {
- case 1:
- waitcursor(1);
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, 1, 0);
-
- BIF_undo_push("ESubdivide Single");
- break;
- case 2:
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- waitcursor(1);
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, numcuts, 0);
- BIF_undo_push("ESubdivide");
- break;
- case 3:
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- randfac= 10;
- if(button(&randfac, 1, 100, "Rand fac:")==0) return;
- waitcursor(1);
- fac= -( (float)randfac )/100;
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag, numcuts, 0);
- BIF_undo_push("Subdivide Fractal");
- break;
-
- case 4:
- fac= 1.0f;
- if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
- fac= 0.292f*fac;
-
- waitcursor(1);
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
- BIF_undo_push("Subdivide Smooth");
- break;
- }
- */
-
- nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Blend From Shape%x16|Propagate To All Shapes%x17|Select Vertex Path%x18");
-
- switch(nr) {
- case 1:
- waitcursor(1);
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, 1, 0);
-
- BIF_undo_push("ESubdivide Single");
- break;
- case 2:
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- waitcursor(1);
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, numcuts, 0);
- BIF_undo_push("ESubdivide");
- break;
- case 3:
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- randfac= 10;
- if(button(&randfac, 1, 100, "Rand fac:")==0) return;
- waitcursor(1);
- fac= -( (float)randfac )/100;
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag, numcuts, 0);
- BIF_undo_push("Subdivide Fractal");
- break;
-
- case 12: /* smooth */
- /* if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; */
- fac= 1.0f;
- if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
- fac= 0.292f*fac;
-
- waitcursor(1);
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
- BIF_undo_push("Subdivide Smooth");
- break;
-
- case 4:
- mergemenu();
- break;
- case 5:
- notice("Removed %d Vertices", removedoublesflag(1, 0, G.scene->toolsettings->doublimit));
- BIF_undo_push("Remove Doubles");
- break;
- case 6:
- hide_mesh(0);
- break;
- case 7:
- reveal_mesh();
- break;
- case 8:
- selectswap_mesh();
- break;
- case 9:
- flip_editnormals();
- BIF_undo_push("Flip Normals");
- break;
- case 10:
- vertexsmooth();
- break;
- case 11:
- bevel_menu();
- break;
- case 14:
- mesh_set_smooth_faces(1);
- break;
- case 15:
- mesh_set_smooth_faces(0);
- break;
- case 16:
- shape_copy_select_from();
- break;
- case 17:
- shape_propagate();
- break;
- case 18:
- pathselect();
- BIF_undo_push("Select Vertex Path");
- break;
- }
-
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
-
- if(nr>0) waitcursor(0);
-
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
-
- nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight%x3|Set Radius%x4|Smooth%x5|Smooth Radius%x6");
-
- switch(nr) {
- case 1:
- subdivideNurb();
- break;
- case 2:
- switchdirectionNurb2();
- break;
- case 3:
- setweightNurb();
- break;
- case 4:
- setradiusNurb();
- break;
- case 5:
- smoothNurb();
- break;
- case 6:
- smoothradiusNurb();
- break;
- }
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- else if(G.obedit->type==OB_ARMATURE) {
- nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Switch Direction%x7|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6");
- if(nr==1)
- subdivide_armature(1);
- if(nr==2) {
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- waitcursor(1);
- subdivide_armature(numcuts);
- }
- else if(nr==3)
- armature_flip_names();
- else if(ELEM3(nr, 4, 5, 6)) {
- armature_autoside_names(nr-4);
- }
- else if(nr == 7)
- switch_direction_armature();
- }
- else if(G.obedit->type==OB_LATTICE) {
- static float weight= 1.0f;
- if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) {
- int a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- BPoint *bp= editLatt->def;
-
- while(a--) {
- if(bp->f1 & SELECT)
- bp->weight= weight;
- bp++;
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
-
-}
-
-static void curvetomesh(Object *ob)
-{
- Curve *cu;
- DispList *dl;
-
- ob->flag |= OB_DONE;
- cu= ob->data;
-
- dl= cu->disp.first;
- if(dl==0) makeDispListCurveTypes(ob, 0); /* force creation */
-
- nurbs_to_mesh(ob); /* also does users */
- if (ob->type != OB_MESH) {
- error("can't convert curve to mesh");
- } else {
- object_free_modifiers(ob);
- }
-}
-
-void convertmenu(void)
-{
- Base *base, *basen=NULL, *basact, *basedel=NULL;
- Object *obact, *ob, *ob1;
- Curve *cu;
- Nurb *nu;
- MetaBall *mb;
- Mesh *me;
- int ok=0, nr = 0, a;
-
- if(G.scene->id.lib) return;
-
- obact= OBACT;
- if (obact == NULL) return;
- if(!obact->flag & SELECT) return;
- if(G.obedit) return;
-
- basact= BASACT; /* will be restored */
-
- if(obact->type==OB_FONT) {
- nr= pupmenu("Convert Font to%t|Curve%x1|Curve (Single filling group)%x2|Mesh%x3");
- if(nr>0) ok= 1;
- }
- else if(obact->type==OB_MBALL) {
- nr= pupmenu("Convert Metaball to%t|Mesh (keep original)%x1|Mesh (Delete Original)%x2");
- if(nr>0) ok= 1;
- }
- else if(obact->type==OB_CURVE) {
- nr= pupmenu("Convert Curve to%t|Mesh");
- if(nr>0) ok= 1;
- }
- else if(obact->type==OB_SURF) {
- nr= pupmenu("Convert Nurbs Surface to%t|Mesh");
- if(nr>0) ok= 1;
- }
- else if(obact->type==OB_MESH) {
- nr= pupmenu("Convert Modifiers to%t|Mesh (Keep Original)%x1|Mesh (Delete Original)%x2");
- if(nr>0) ok= 1;
- }
- if(ok==0) return;
-
- /* don't forget multiple users! */
-
- /* reset flags */
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- base->object->flag &= ~OB_DONE;
- }
- base= base->next;
- }
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
-
- ob= base->object;
-
- if(ob->flag & OB_DONE);
- else if(ob->type==OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */
- DerivedMesh *dm;
-
- basedel = base;
-
- ob->flag |= OB_DONE;
-
- ob1= copy_object(ob);
- ob1->recalc |= OB_RECALC;
-
- basen= MEM_mallocN(sizeof(Base), "duplibase");
- *basen= *base;
- BLI_addhead(&G.scene->base, basen); /* addhead: otherwise eternal loop */
- basen->object= ob1;
- basen->flag |= SELECT;
- base->flag &= ~SELECT;
- ob->flag &= ~SELECT;
-
- /* decrement original mesh's usage count */
- me= ob1->data;
- me->id.us--;
-
- /* make a new copy of the mesh */
- ob1->data= copy_mesh(me);
- G.totmesh++;
-
- /* make new mesh data from the original copy */
- dm= mesh_get_derived_final(ob1, CD_MASK_MESH);
- /* dm= mesh_create_derived_no_deform(ob1, NULL); this was called original (instead of get_derived). man o man why! (ton) */
-
- DM_to_mesh(dm, ob1->data);
-
- dm->release(dm);
- object_free_modifiers(ob1); /* after derivedmesh calls! */
-
- /* If the original object is active then make this object active */
- if (ob == obact) {
- set_active_base( basen );
- basact = basen;
- }
- }
- else if(ob->type==OB_FONT) {
- ob->flag |= OB_DONE;
-
- ob->type= OB_CURVE;
- cu= ob->data;
-
- if(cu->vfont) {
- cu->vfont->id.us--;
- cu->vfont= 0;
- }
- if(cu->vfontb) {
- cu->vfontb->id.us--;
- cu->vfontb= 0;
- }
- if(cu->vfonti) {
- cu->vfonti->id.us--;
- cu->vfonti= 0;
- }
- if(cu->vfontbi) {
- cu->vfontbi->id.us--;
- cu->vfontbi= 0;
- }
- /* other users */
- if(cu->id.us>1) {
- ob1= G.main->object.first;
- while(ob1) {
- if(ob1->data==cu) {
- ob1->type= OB_CURVE;
- ob1->recalc |= OB_RECALC;
- }
- ob1= ob1->id.next;
- }
- }
- if (nr==2 || nr==3) {
- nu= cu->nurb.first;
- while(nu) {
- nu->charidx= 0;
- nu= nu->next;
- }
- }
- if (nr==3) {
- curvetomesh(ob);
- }
- }
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- if(nr==1) {
- curvetomesh(ob);
- }
- }
- else if(ob->type==OB_MBALL) {
-
- if(nr==1 || nr == 2) {
- ob= find_basis_mball(ob);
-
- if(ob->disp.first && !(ob->flag&OB_DONE)) {
- basedel = base;
-
- ob->flag |= OB_DONE;
-
- ob1= copy_object(ob);
- ob1->recalc |= OB_RECALC;
-
- basen= MEM_mallocN(sizeof(Base), "duplibase");
- *basen= *base;
- BLI_addhead(&G.scene->base, basen); /* addhead: othwise eternal loop */
- basen->object= ob1;
- basen->flag |= SELECT;
- basedel->flag &= ~SELECT;
- ob->flag &= ~SELECT;
-
- mb= ob1->data;
- mb->id.us--;
-
- ob1->data= add_mesh("Mesh");
- G.totmesh++;
- ob1->type= OB_MESH;
-
- me= ob1->data;
- me->totcol= mb->totcol;
- if(ob1->totcol) {
- me->mat= MEM_dupallocN(mb->mat);
- for(a=0; a<ob1->totcol; a++) id_us_plus((ID *)me->mat[a]);
- }
-
- mball_to_mesh(&ob->disp, ob1->data);
-
- /* So we can see the wireframe */
- BASACT= basen;
-
- /* If the original object is active then make this object active */
- if (ob == obact) {
- set_active_base( basen );
- basact = basen;
- }
-
- }
- }
- }
- }
- base= base->next;
- if(basedel != NULL && nr == 2) {
- if(basedel==basact)
- basact= NULL;
- free_and_unlink_base(basedel);
- }
- basedel = NULL;
- }
-
- /* delete object should renew depsgraph */
- if(nr==2)
- DAG_scene_sort(G.scene);
-
- /* texspace and normals */
- if(!basen) BASACT= base;
-
- enter_editmode(EM_WAITCURSOR);
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */
- BASACT= basact;
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allspace(OOPS_TEST, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Convert Object");
-
- DAG_scene_sort(G.scene);
-}
-
-/* Change subdivision or particle properties of mesh object ob, if level==-1
- * then toggle subsurf, else set to level set allows to toggle multiple
- * selections */
-
-static void object_has_subdivision_particles(Object *ob, int *havesubdiv, int *havepart, int depth)
-{
- if(ob->type==OB_MESH) {
- if(modifiers_findByType(ob, eModifierType_Subsurf))
- *havesubdiv= 1;
- if(modifiers_findByType(ob, eModifierType_ParticleSystem))
- *havepart= 1;
- }
-
- if(ob->dup_group && depth <= 4) {
- GroupObject *go;
-
- for(go= ob->dup_group->gobject.first; go; go= go->next)
- object_has_subdivision_particles(go->ob, havesubdiv, havepart, depth+1);
- }
-}
-
-static void object_flip_subdivison_particles(Object *ob, int *set, int level, int mode, int particles, int depth)
-{
- ModifierData *md;
-
- if(ob->type==OB_MESH) {
- if(particles) {
- for(md=ob->modifiers.first; md; md=md->next) {
- if(md->type == eModifierType_ParticleSystem) {
- ParticleSystemModifierData *psmd = (ParticleSystemModifierData*)md;
-
- if(*set == -1)
- *set= psmd->modifier.mode&(mode);
-
- if (*set)
- psmd->modifier.mode &= ~(mode);
- else
- psmd->modifier.mode |= (mode);
- }
- }
- }
- else {
- md = modifiers_findByType(ob, eModifierType_Subsurf);
-
- if (md) {
- SubsurfModifierData *smd = (SubsurfModifierData*) md;
-
- if (level == -1) {
- if(*set == -1)
- *set= smd->modifier.mode&(mode);
-
- if (*set)
- smd->modifier.mode &= ~(mode);
- else
- smd->modifier.mode |= (mode);
- } else {
- smd->levels = level;
- }
- }
- else if(depth == 0 && *set != 0) {
- SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf);
-
- BLI_addtail(&ob->modifiers, smd);
-
- if (level!=-1) {
- smd->levels = level;
- }
-
- if(*set == -1)
- *set= 1;
- }
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
-
- if(ob->dup_group && depth<=4) {
- GroupObject *go;
-
- for(go= ob->dup_group->gobject.first; go; go= go->next)
- object_flip_subdivison_particles(go->ob, set, level, mode, particles, depth+1);
- }
-}
-
-/* Change subdivision properties of mesh object ob, if
-* level==-1 then toggle subsurf, else set to level.
-*/
-
-void flip_subdivison(int level)
-{
- Base *base;
- int set= -1;
- int mode, pupmode, particles= 0, havesubdiv= 0, havepart= 0;
-
- if(G.qual & LR_ALTKEY)
- mode= eModifierMode_Realtime;
- else
- mode= eModifierMode_Render|eModifierMode_Realtime;
-
- if(level == -1) {
- if (G.obedit) {
- object_has_subdivision_particles(G.obedit, &havesubdiv, &havepart, 0);
- } else {
- for(base= G.scene->base.first; base; base= base->next) {
- if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) {
- object_has_subdivision_particles(base->object, &havesubdiv, &havepart, 0);
- }
- }
- }
- }
- else
- havesubdiv= 1;
-
- if(havesubdiv && havepart) {
- pupmode= pupmenu("Switch%t|Subsurf %x1|Particle Systems %x2");
- if(pupmode <= 0)
- return;
- else if(pupmode == 2)
- particles= 1;
- }
- else if(havepart)
- particles= 1;
-
- if (G.obedit) {
- object_flip_subdivison_particles(G.obedit, &set, level, mode, particles, 0);
- } else {
- for(base= G.scene->base.first; base; base= base->next) {
- if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) {
- object_flip_subdivison_particles(base->object, &set, level, mode, particles, 0);
- }
- }
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- if(particles)
- BIF_undo_push("Switch particles on/off");
- else
- BIF_undo_push("Switch subsurf on/off");
-}
-
-static void copymenu_properties(Object *ob)
-{
- bProperty *prop;
- Base *base;
- int nr, tot=0;
- char *str;
-
- prop= ob->prop.first;
- while(prop) {
- tot++;
- prop= prop->next;
- }
-
- if(tot==0) {
- error("No properties in the active object to copy");
- return;
- }
-
- str= MEM_callocN(50 + 33*tot, "copymenu prop");
-
- strcpy(str, "Copy Property %t|Replace All|Merge All|%l");
-
- tot= 0;
- prop= ob->prop.first;
- while(prop) {
- tot++;
- strcat(str, "|");
- strcat(str, prop->name);
- prop= prop->next;
- }
-
- nr= pupmenu(str);
-
- if ( nr==1 || nr==2 ) {
- base= FIRSTBASE;
- while(base) {
- if((base != BASACT) && TESTBASELIB(base)) {
- if (nr==1) { /* replace */
- copy_properties( &base->object->prop, &ob->prop );
- } else {
- for(prop = ob->prop.first; prop; prop= prop->next ) {
- set_ob_property(base->object, prop);
- }
- }
- }
- base= base->next;
- }
- } else if(nr>0) {
- prop = BLI_findlink(&ob->prop, nr-4); /* account for first 3 menu items & menu index starting at 1*/
-
- if(prop) {
- for(base= FIRSTBASE; base; base= base->next) {
- if((base != BASACT) && TESTBASELIB(base)) {
- set_ob_property(base->object, prop);
- }
- }
- }
- }
- MEM_freeN(str);
- allqueue(REDRAWVIEW3D, 0);
-
- BIF_undo_push("Copy properties");
-}
-
-static void copymenu_logicbricks(Object *ob)
-{
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if(base->object != ob) {
- if(TESTBASELIB(base)) {
-
- /* first: free all logic */
- free_sensors(&base->object->sensors);
- unlink_controllers(&base->object->controllers);
- free_controllers(&base->object->controllers);
- unlink_actuators(&base->object->actuators);
- free_actuators(&base->object->actuators);
-
- /* now copy it, this also works without logicbricks! */
- clear_sca_new_poins_ob(ob);
- copy_sensors(&base->object->sensors, &ob->sensors);
- copy_controllers(&base->object->controllers, &ob->controllers);
- copy_actuators(&base->object->actuators, &ob->actuators);
- set_sca_new_poins_ob(base->object);
-
- /* some menu settings */
- base->object->scavisflag= ob->scavisflag;
- base->object->scaflag= ob->scaflag;
-
- /* set the initial state */
- base->object->state= ob->state;
- base->object->init_state= ob->init_state;
- }
- }
- base= base->next;
- }
- BIF_undo_push("Copy logic");
-}
-
-static void copymenu_modifiers(Object *ob)
-{
- Base *base;
- int i, event;
- char str[512];
- char *errorstr= NULL;
-
- strcpy(str, "Copy Modifiers %t");
-
- sprintf(str+strlen(str), "|All%%x%d|%%l", NUM_MODIFIER_TYPES);
-
- for (i=eModifierType_None+1; i<NUM_MODIFIER_TYPES; i++) {
- ModifierTypeInfo *mti = modifierType_getInfo(i);
-
- if(ELEM3(i, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance)) continue;
-
- if(i == eModifierType_Collision)
- continue;
-
- if ( (mti->flags&eModifierTypeFlag_AcceptsCVs) ||
- (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) {
- sprintf(str+strlen(str), "|%s%%x%d", mti->name, i);
- }
- }
-
- event = pupmenu(str);
- if(event<=0) return;
-
- for (base= FIRSTBASE; base; base= base->next) {
- if(base->object != ob) {
- if(TESTBASELIB(base)) {
- ModifierData *md;
-
- base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA;
-
- if (base->object->type==ob->type) {
- /* copy all */
- if (event==NUM_MODIFIER_TYPES) {
- object_free_modifiers(base->object);
-
- for (md=ob->modifiers.first; md; md=md->next) {
- ModifierData *nmd = NULL;
-
- if(ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance)) continue;
-
- if(md->type == eModifierType_Collision)
- continue;
-
- nmd = modifier_new(md->type);
- modifier_copyData(md, nmd);
- BLI_addtail(&base->object->modifiers, nmd);
- }
-
- copy_object_particlesystems(base->object, ob);
- copy_object_softbody(base->object, ob);
- } else {
- /* copy specific types */
- ModifierData *md, *mdn;
-
- /* remove all with type 'event' */
- for (md=base->object->modifiers.first; md; md=mdn) {
- mdn= md->next;
- if(md->type==event) {
- BLI_remlink(&base->object->modifiers, md);
- modifier_free(md);
- }
- }
-
- /* copy all with type 'event' */
- for (md=ob->modifiers.first; md; md=md->next) {
- if (md->type==event) {
-
- mdn = modifier_new(event);
- BLI_addtail(&base->object->modifiers, mdn);
-
- modifier_copyData(md, mdn);
- }
- }
-
- if(event == eModifierType_ParticleSystem) {
- object_free_particlesystems(base->object);
- copy_object_particlesystems(base->object, ob);
- }
- else if(event == eModifierType_Softbody) {
- object_free_softbody(base->object);
- copy_object_softbody(base->object, ob);
- }
- }
- }
- else
- errorstr= "Did not copy modifiers to other Object types";
- }
- }
- }
-
- if(errorstr) notice(errorstr);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- DAG_scene_sort(G.scene);
-
- BIF_undo_push("Copy modifiers");
-}
-
-/* both pointers should exist */
-static void copy_texture_space(Object *to, Object *ob)
-{
- float *poin1= NULL, *poin2= NULL;
- int texflag= 0;
-
- if(ob->type==OB_MESH) {
- texflag= ((Mesh *)ob->data)->texflag;
- poin2= ((Mesh *)ob->data)->loc;
- }
- else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
- texflag= ((Curve *)ob->data)->texflag;
- poin2= ((Curve *)ob->data)->loc;
- }
- else if(ob->type==OB_MBALL) {
- texflag= ((MetaBall *)ob->data)->texflag;
- poin2= ((MetaBall *)ob->data)->loc;
- }
- else
- return;
-
- if(to->type==OB_MESH) {
- ((Mesh *)to->data)->texflag= texflag;
- poin1= ((Mesh *)to->data)->loc;
- }
- else if (ELEM3(to->type, OB_CURVE, OB_SURF, OB_FONT)) {
- ((Curve *)to->data)->texflag= texflag;
- poin1= ((Curve *)to->data)->loc;
- }
- else if(to->type==OB_MBALL) {
- ((MetaBall *)to->data)->texflag= texflag;
- poin1= ((MetaBall *)to->data)->loc;
- }
- else
- return;
-
- memcpy(poin1, poin2, 9*sizeof(float)); /* this was noted in DNA_mesh, curve, mball */
-
- if(to->type==OB_MESH) ;
- else if(to->type==OB_MBALL) tex_space_mball(to);
- else tex_space_curve(to->data);
-
-}
-
-void copy_attr(short event)
-{
- Object *ob;
- Base *base;
- Curve *cu, *cu1;
- Nurb *nu;
- int do_scene_sort= 0;
-
- if(G.scene->id.lib) return;
-
- if(!(ob=OBACT)) return;
-
- if(G.obedit) {
- /* obedit_copymenu(); */
- return;
- }
- if(event==9) {
- copymenu_properties(ob);
- return;
- }
- else if(event==10) {
- copymenu_logicbricks(ob);
- return;
- }
- else if(event==24) {
- copymenu_modifiers(ob);
- return;
- }
-
- base= FIRSTBASE;
- while(base) {
- if(base != BASACT) {
- if(TESTBASELIB(base)) {
- base->object->recalc |= OB_RECALC_OB;
-
- if(event==1) { /* loc */
- VECCOPY(base->object->loc, ob->loc);
- VECCOPY(base->object->dloc, ob->dloc);
- }
- else if(event==2) { /* rot */
- VECCOPY(base->object->rot, ob->rot);
- VECCOPY(base->object->drot, ob->drot);
- /* Quats arnt used yet */
- /*VECCOPY(base->object->quat, ob->quat);
- VECCOPY(base->object->dquat, ob->dquat);*/
- }
- else if(event==3) { /* size */
- VECCOPY(base->object->size, ob->size);
- VECCOPY(base->object->dsize, ob->dsize);
- }
- else if(event==4) { /* drawtype */
- base->object->dt= ob->dt;
- base->object->dtx= ob->dtx;
- base->object->empty_drawtype= ob->empty_drawtype;
- base->object->empty_drawsize= ob->empty_drawsize;
- }
- else if(event==5) { /* time offs */
- base->object->sf= ob->sf;
- }
- else if(event==6) { /* dupli */
- base->object->dupon= ob->dupon;
- base->object->dupoff= ob->dupoff;
- base->object->dupsta= ob->dupsta;
- base->object->dupend= ob->dupend;
-
- base->object->transflag &= ~OB_DUPLI;
- base->object->transflag |= (ob->transflag & OB_DUPLI);
-
- base->object->dup_group= ob->dup_group;
- if(ob->dup_group)
- id_us_plus((ID *)ob->dup_group);
- }
- else if(event==7) { /* mass */
- base->object->mass= ob->mass;
- }
- else if(event==8) { /* damping */
- base->object->damping= ob->damping;
- base->object->rdamping= ob->rdamping;
- }
- else if(event==11) { /* all physical attributes */
- base->object->gameflag = ob->gameflag;
- base->object->inertia = ob->inertia;
- base->object->formfactor = ob->formfactor;
- base->object->damping= ob->damping;
- base->object->rdamping= ob->rdamping;
- base->object->mass= ob->mass;
- if (ob->gameflag & OB_BOUNDS) {
- base->object->boundtype = ob->boundtype;
- }
- base->object->margin= ob->margin;
- base->object->bsoft= copy_bulletsoftbody(ob->bsoft);
-
- }
- else if(event==17) { /* tex space */
- copy_texture_space(base->object, ob);
- }
- else if(event==18) { /* font settings */
-
- if(base->object->type==ob->type) {
- cu= ob->data;
- cu1= base->object->data;
-
- cu1->spacemode= cu->spacemode;
- cu1->spacing= cu->spacing;
- cu1->linedist= cu->linedist;
- cu1->shear= cu->shear;
- cu1->fsize= cu->fsize;
- cu1->xof= cu->xof;
- cu1->yof= cu->yof;
- cu1->textoncurve= cu->textoncurve;
- cu1->wordspace= cu->wordspace;
- cu1->ulpos= cu->ulpos;
- cu1->ulheight= cu->ulheight;
- if(cu1->vfont) cu1->vfont->id.us--;
- cu1->vfont= cu->vfont;
- id_us_plus((ID *)cu1->vfont);
- if(cu1->vfontb) cu1->vfontb->id.us--;
- cu1->vfontb= cu->vfontb;
- id_us_plus((ID *)cu1->vfontb);
- if(cu1->vfonti) cu1->vfonti->id.us--;
- cu1->vfonti= cu->vfonti;
- id_us_plus((ID *)cu1->vfonti);
- if(cu1->vfontbi) cu1->vfontbi->id.us--;
- cu1->vfontbi= cu->vfontbi;
- id_us_plus((ID *)cu1->vfontbi);
-
- text_to_curve(base->object, 0); /* needed? */
-
-
- strcpy(cu1->family, cu->family);
-
- base->object->recalc |= OB_RECALC_DATA;
- }
- }
- else if(event==19) { /* bevel settings */
-
- if ELEM(base->object->type, OB_CURVE, OB_FONT) {
- cu= ob->data;
- cu1= base->object->data;
-
- cu1->bevobj= cu->bevobj;
- cu1->taperobj= cu->taperobj;
- cu1->width= cu->width;
- cu1->bevresol= cu->bevresol;
- cu1->ext1= cu->ext1;
- cu1->ext2= cu->ext2;
-
- base->object->recalc |= OB_RECALC_DATA;
- }
- }
- else if(event==25) { /* curve resolution */
-
- if ELEM(base->object->type, OB_CURVE, OB_FONT) {
- cu= ob->data;
- cu1= base->object->data;
-
- cu1->resolu= cu->resolu;
- cu1->resolu_ren= cu->resolu_ren;
-
- nu= cu1->nurb.first;
-
- while(nu) {
- nu->resolu= cu1->resolu;
- nu= nu->next;
- }
-
- base->object->recalc |= OB_RECALC_DATA;
- }
- }
- else if(event==21){
- if (base->object->type==OB_MESH) {
- ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf);
-
- if (md) {
- ModifierData *tmd = modifiers_findByType(base->object, eModifierType_Subsurf);
-
- if (!tmd) {
- tmd = modifier_new(eModifierType_Subsurf);
- BLI_addtail(&base->object->modifiers, tmd);
- }
-
- modifier_copyData(md, tmd);
- base->object->recalc |= OB_RECALC_DATA;
- }
- }
- }
- else if(event==22) {
- /* Copy the constraint channels over */
- copy_constraints(&base->object->constraints, &ob->constraints);
- if (U.dupflag& USER_DUP_IPO)
- copy_constraint_channels(&base->object->constraintChannels, &ob->constraintChannels);
- else
- clone_constraint_channels (&base->object->constraintChannels, &ob->constraintChannels);
-
- do_scene_sort= 1;
- }
- else if(event==23) {
- base->object->softflag= ob->softflag;
- if(base->object->soft) sbFree(base->object->soft);
-
- base->object->soft= copy_softbody(ob->soft);
-
- if (!modifiers_findByType(base->object, eModifierType_Softbody)) {
- BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody));
- }
- }
- else if(event==26) {
- copy_nlastrips(&base->object->nlastrips, &ob->nlastrips);
- }
- else if(event==27) { /* autosmooth */
- if (base->object->type==OB_MESH) {
- Mesh *me= ob->data;
- Mesh *cme= base->object->data;
- cme->smoothresh= me->smoothresh;
- if(me->flag & ME_AUTOSMOOTH)
- cme->flag |= ME_AUTOSMOOTH;
- else
- cme->flag &= ~ME_AUTOSMOOTH;
- }
- }
- else if(event==28) { /* UV orco */
- if ELEM(base->object->type, OB_CURVE, OB_SURF) {
- cu= ob->data;
- cu1= base->object->data;
-
- if(cu->flag & CU_UV_ORCO)
- cu1->flag |= CU_UV_ORCO;
- else
- cu1->flag &= ~CU_UV_ORCO;
- }
- }
- else if(event==29) { /* protected bits */
- base->object->protectflag= ob->protectflag;
- }
- else if(event==30) { /* index object */
- base->object->index= ob->index;
- }
- else if(event==31) { /* object color */
- QUATCOPY(base->object->col, ob->col);
- }
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- if(do_scene_sort)
- DAG_scene_sort(G.scene);
-
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- if(event==20) {
- allqueue(REDRAWBUTSOBJECT, 0);
- }
-
- BIF_undo_push("Copy Attributes");
-}
-
-void copy_attr_menu()
-{
- Object *ob;
- short event;
- char str[512];
-
- if(!(ob=OBACT)) return;
-
- if (G.obedit) {
- if (ob->type == OB_MESH)
- mesh_copy_menu();
- return;
- }
-
- /* Object Mode */
-
- /* If you change this menu, don't forget to update the menu in header_view3d.c
- * view3d_edit_object_copyattrmenu() and in toolbox.c
- */
-
- strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|Object Color%x31|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
-
- strcat (str, "|Object Constraints%x22");
- strcat (str, "|NLA Strips%x26");
-
- if (OB_SUPPORT_MATERIAL(ob)) {
- strcat(str, "|Texture Space%x17");
- }
-
- if(ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
- if(ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19|UV Orco%x28");
-
- if((ob->type == OB_FONT) || (ob->type == OB_CURVE)) {
- strcat(str, "|Curve Resolution%x25");
- }
-
- if(ob->type==OB_MESH){
- strcat(str, "|Subsurf Settings%x21|AutoSmooth%x27");
- }
-
- if(ob->soft) strcat(str, "|Soft Body Settings%x23");
-
- strcat(str, "|Pass Index%x30");
-
- if(ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF){
- strcat(str, "|Modifiers ...%x24");
- }
-
- event= pupmenu(str);
- if(event<= 0) return;
-
- copy_attr(event);
-}
-
-
-void link_to_scene(unsigned short nr)
-{
- Scene *sce= (Scene*) BLI_findlink(&G.main->scene, G.curscreen->scenenr-1);
- Base *base, *nbase;
-
- if(sce==0) return;
- if(sce->id.lib) return;
-
- base= FIRSTBASE;
- while(base) {
- if(TESTBASE(base)) {
-
- nbase= MEM_mallocN( sizeof(Base), "newbase");
- *nbase= *base;
- BLI_addhead( &(sce->base), nbase);
- id_us_plus((ID *)base->object);
- }
- base= base->next;
- }
-}
-
-void make_links_menu()
-{
- Object *ob;
- short event=0;
- char str[140];
-
- if(!(ob=OBACT)) return;
-
- strcpy(str, "Make Links %t|To Scene...%x1|%l|Object Ipo%x4");
-
- if(ob->type==OB_MESH)
- strcat(str, "|Mesh Data%x2|Materials%x3");
- else if(ob->type==OB_CURVE)
- strcat(str, "|Curve Data%x2|Materials%x3");
- else if(ob->type==OB_FONT)
- strcat(str, "|Text Data%x2|Materials%x3");
- else if(ob->type==OB_SURF)
- strcat(str, "|Surface Data%x2|Materials%x3");
- else if(ob->type==OB_MBALL)
- strcat(str, "|Materials%x3");
- else if(ob->type==OB_CAMERA)
- strcat(str, "|Camera Data%x2");
- else if(ob->type==OB_LAMP)
- strcat(str, "|Lamp Data%x2");
- else if(ob->type==OB_LATTICE)
- strcat(str, "|Lattice Data%x2");
- else if(ob->type==OB_ARMATURE)
- strcat(str, "|Armature Data%x2");
-
- event= pupmenu(str);
-
- if(event<= 0) return;
-
- make_links(event);
-}
-
-void make_links(short event)
-{
- Object *ob, *obt;
- Base *base, *nbase, *sbase;
- Scene *sce = NULL;
- ID *id;
- int a;
- short nr=0;
- char *strp;
-
- if(!(ob=OBACT)) return;
-
- if(event==1) {
- IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), 0, &nr);
-
- if(nr == -2) {
- MEM_freeN(strp);
-
- activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE, &(G.curscreen->scenenr), link_to_scene );
-
- return;
- }
- else {
- event= pupmenu_col(strp, 20);
- MEM_freeN(strp);
-
- if(event<= 0) return;
-
- nr= 1;
- sce= G.main->scene.first;
- while(sce) {
- if(nr==event) break;
- nr++;
- sce= sce->id.next;
- }
- if(sce==G.scene) {
- error("This is the current scene");
- return;
- }
- if(sce==0 || sce->id.lib) return;
-
- /* remember: is needed below */
- event= 1;
- }
- }
-
- /* All non group linking */
- base= FIRSTBASE;
- while(base) {
- if(event==1 || base != BASACT) {
-
- obt= base->object;
-
- if(TESTBASE(base)) {
-
- if(event==1) { /* to scene */
-
- /* test if already linked */
- sbase= sce->base.first;
- while(sbase) {
- if(sbase->object==base->object) break;
- sbase= sbase->next;
- }
- if(sbase) { /* remove */
- base= base->next;
- continue;
- }
-
- nbase= MEM_mallocN( sizeof(Base), "newbase");
- *nbase= *base;
- BLI_addhead( &(sce->base), nbase);
- id_us_plus((ID *)base->object);
- }
- }
- if(TESTBASELIB(base)) {
- if(event==2 || event==5) { /* obdata */
- if(ob->type==obt->type) {
-
- id= obt->data;
- id->us--;
-
- id= ob->data;
- id_us_plus(id);
- obt->data= id;
-
- /* if amount of material indices changed: */
- test_object_materials(obt->data);
-
- obt->recalc |= OB_RECALC_DATA;
- }
- }
- else if(event==4) { /* ob ipo */
- if(obt->ipo) obt->ipo->id.us--;
- obt->ipo= ob->ipo;
- if(obt->ipo) {
- id_us_plus((ID *)obt->ipo);
- do_ob_ipo(obt);
- }
- }
- else if(event==6) {
- if(ob->dup_group) ob->dup_group->id.us--;
- obt->dup_group= ob->dup_group;
- if(obt->dup_group) {
- id_us_plus((ID *)obt->dup_group);
- obt->transflag |= OB_DUPLIGROUP;
- }
- }
- else if(event==3) { /* materials */
-
- /* new approach, using functions from kernel */
- for(a=0; a<ob->totcol; a++) {
- Material *ma= give_current_material(ob, a+1);
- assign_material(obt, ma, a+1); /* also works with ma==NULL */
- }
- }
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSHEAD, 0);
-
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- BIF_undo_push("Create links");
-}
-
-static void apply_objects_internal( int apply_scale, int apply_rot )
-{
- Base *base, *basact;
- Object *ob;
- bArmature *arm;
- Mesh *me;
- Curve *cu;
- Nurb *nu;
- BPoint *bp;
- BezTriple *bezt;
- MVert *mvert;
- float mat[3][3];
- int a, change = 0;
-
- if (!apply_scale && !apply_rot) {
- /* do nothing? */
- error("Nothing to do!");
- return;
- }
- /* first check if we can execute */
- for (base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- ob= base->object;
- if(ob->type==OB_MESH) {
- me= ob->data;
-
- if(me->id.us>1) {
- error("Can't apply to a multi user mesh, doing nothing.");
- return;
- }
- if(me->key) {
- error("Can't apply to a mesh with vertex keys, doing nothing.");
- return;
- }
- }
- else if (ob->type==OB_ARMATURE) {
- arm= ob->data;
-
- if(arm->id.us>1) {
- error("Can't apply to a multi user armature, doing nothing.");
- return;
- }
- }
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- cu= ob->data;
-
- if(cu->id.us>1) {
- error("Can't apply to a multi user curve, doing nothing.");
- return;
- }
- if(cu->key) {
- error("Can't apply to a curve with vertex keys, doing nothing.");
- return;
- }
- }
- }
- }
-
- /* now execute */
- basact= BASACT;
- base= FIRSTBASE;
- for (base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- ob= base->object;
-
- if(ob->type==OB_MESH) {
- if (apply_scale && apply_rot)
- object_to_mat3(ob, mat);
- else if (apply_scale)
- object_scale_to_mat3(ob, mat);
- else
- object_rot_to_mat3(ob, mat);
-
- me= ob->data;
-
- /* see checks above */
-
- mvert= me->mvert;
- for(a=0; a<me->totvert; a++, mvert++) {
- Mat3MulVecfl(mat, mvert->co);
- }
- if (apply_scale)
- ob->size[0]= ob->size[1]= ob->size[2]= 1.0;
- if (apply_rot)
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0;
- /*QuatOne(ob->quat);*/ /* Quats arnt used yet */
-
- where_is_object(ob);
-
- /* texspace and normals */
- BASACT= base;
- enter_editmode(EM_WAITCURSOR);
- BIF_undo_push("Applied object"); /* editmode undo itself */
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */
- BASACT= basact;
-
- change = 1;
- }
- else if (ob->type==OB_ARMATURE) {
- if (apply_scale && apply_rot)
- object_to_mat3(ob, mat);
- else if (apply_scale)
- object_scale_to_mat3(ob, mat);
- else
- object_rot_to_mat3(ob, mat);
- arm= ob->data;
-
- /* see checks above */
- apply_rot_armature(ob, mat);
-
- /* Reset the object's transforms */
- if (apply_scale)
- ob->size[0]= ob->size[1]= ob->size[2]= 1.0;
- if (apply_rot)
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0;
- /*QuatOne(ob->quat); (not used anymore)*/
-
- where_is_object(ob);
-
- change = 1;
- }
- else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- float scale;
- if (apply_scale && apply_rot)
- object_to_mat3(ob, mat);
- else if (apply_scale)
- object_scale_to_mat3(ob, mat);
- else
- object_rot_to_mat3(ob, mat);
- scale = Mat3ToScalef(mat);
- cu= ob->data;
-
- /* see checks above */
-
- nu= cu->nurb.first;
- while(nu) {
- if( (nu->type & 7)==1) {
- a= nu->pntsu;
- bezt= nu->bezt;
- while(a--) {
- Mat3MulVecfl(mat, bezt->vec[0]);
- Mat3MulVecfl(mat, bezt->vec[1]);
- Mat3MulVecfl(mat, bezt->vec[2]);
- bezt->radius *= scale;
- bezt++;
- }
- }
- else {
- a= nu->pntsu*nu->pntsv;
- bp= nu->bp;
- while(a--) {
- Mat3MulVecfl(mat, bp->vec);
- bp++;
- }
- }
- nu= nu->next;
- }
- if (apply_scale)
- ob->size[0]= ob->size[1]= ob->size[2]= 1.0;
- if (apply_rot)
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0;
- /*QuatOne(ob->quat); (quats arnt used anymore)*/
-
- where_is_object(ob);
-
- /* texspace and normals */
- BASACT= base;
- enter_editmode(EM_WAITCURSOR);
- BIF_undo_push("Applied object"); /* editmode undo itself */
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */
- BASACT= basact;
-
- change = 1;
- } else {
- continue;
- }
-
- ignore_parent_tx(ob);
- }
- }
- if (change) {
- allqueue(REDRAWVIEW3D, 0);
- if (apply_scale && apply_rot)
- BIF_undo_push("Apply Objects Scale & Rotation");
- else if (apply_scale)
- BIF_undo_push("Apply Objects Scale");
- else
- BIF_undo_push("Apply Objects Rotation");
- }
-}
-
-void apply_objects_locrot(void)
-{
- apply_objects_internal(1, 1);
-}
-
-void apply_objects_scale(void)
-{
- apply_objects_internal(1, 0);
-}
-
-void apply_objects_rot(void)
-{
- apply_objects_internal(0, 1);
-}
-
-void apply_objects_visual_tx( void )
-{
- Base *base;
- Object *ob;
- int change = 0;
-
- for (base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- ob= base->object;
- where_is_object(ob);
- VECCOPY(ob->loc, ob->obmat[3]);
- Mat4ToSize(ob->obmat, ob->size);
- Mat4ToEul(ob->obmat, ob->rot);
-
- where_is_object(ob);
-
- change = 1;
- }
- }
- if (change) {
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Apply Objects Visual Transform");
- }
-}
-
-void apply_object( void )
-{
- Object *ob;
- int evt;
- if(G.scene->id.lib) return;
- if(G.obedit) return;
-
- if(G.qual & LR_SHIFTKEY) {
- ob= OBACT;
- if(ob==0) return;
-
- if(ob->transflag & OB_DUPLI) {
- make_duplilist_real();
- }
- else {
- if(okee("Apply deformation")) {
- object_apply_deform(ob);
- BIF_undo_push("Apply deformation");
- }
- }
- allqueue(REDRAWVIEW3D, 0);
-
- }
- else {
- ob= OBACT;
- if(ob==0) return;
-
- if ((ob->pose) && (ob->flag & OB_POSEMODE))
- evt = pupmenu("Apply Object%t|Current Pose as RestPose%x3");
- else
- evt = pupmenu("Apply Object%t|Scale and Rotation to ObData%x1|Visual Transform to Objects Loc/Scale/Rot%x2|Scale to ObData%x4|Rotation to ObData%x5");
- if (evt==-1) return;
-
- switch (evt) {
- case 1:
- apply_objects_locrot();
- break;
- case 2:
- apply_objects_visual_tx();
- break;
- case 3:
- apply_armature_pose2bones();
- break;
- case 4:
- apply_objects_scale();
- break;
- case 5:
- apply_objects_rot();
- break;
- }
- }
-}
-
-
-
-/* ************ GENERAL *************** */
-
-
-/* now only used in 2d spaces, like ipo, nla, sima... */
-void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert)
-{
- /* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */
- int ctrl;
-
- if(invert) {
- if(G.qual & LR_CTRLKEY) ctrl= 0;
- else ctrl= 1;
- }
- else ctrl= (G.qual & LR_CTRLKEY);
-
- if(ctrl && (G.qual & LR_SHIFTKEY)) {
- if(fac3!= 0.0) *val= fac3*floor(*val/fac3 +.5);
- }
- else if(ctrl) {
- if(fac2!= 0.0) *val= fac2*floor(*val/fac2 +.5);
- }
- else {
- if(fac1!= 0.0) *val= fac1*floor(*val/fac1 +.5);
- }
-}
-
-int cylinder_intersect_test(void)
-{
- EditMesh *em = G.editMesh;
- float *oldloc, speed[3], s, t, labda, labdacor, dist, len, len2, axis[3], *base, rc[3], n[3], o[3];
- EditVert *v1;
-
- v1= em->verts.first;
-
- base= v1->co;
- v1= v1->next;
- VecSubf(axis, v1->co, base);
-
- v1= v1->next;
- oldloc= v1->co;
- v1= v1->next;
- VecSubf(speed, v1->co, oldloc);
-
- VecSubf(rc, oldloc, base);
-
- /* the axis */
- len2= Normalize(axis);
-
- Crossf(n, speed, axis);
- len= Normalize(n);
- if(len==0.0) return 0;
-
- dist= fabs( rc[0]*n[0] + rc[1]*n[1] + rc[2]*n[2] );
-
- if( dist>=G.scene->editbutsize ) return 0;
-
- Crossf(o, rc, axis);
- t= -(o[0]*n[0] + o[1]*n[1] + o[2]*n[2])/len;
-
- Crossf(o, n, axis);
- s= fabs(sqrt(G.scene->editbutsize*G.scene->editbutsize-dist*dist) / (o[0]*speed[0] + o[1]*speed[1] + o[2]*speed[2]));
-
- labdacor= t-s;
- labda= t+s;
-
- /* two cases with no intersection point */
- if(labdacor>=1.0 && labda>=1.0) return 0;
- if(labdacor<=0.0 && labda<=0.0) return 0;
-
- /* calc normal */
- /* intersection: */
-
- rc[0]= oldloc[0] + labdacor*speed[0] - base[0];
- rc[1]= oldloc[1] + labdacor*speed[1] - base[1];
- rc[2]= oldloc[2] + labdacor*speed[2] - base[2];
-
- s= (rc[0]*axis[0] + rc[1]*axis[1] + rc[2]*axis[2]) ;
-
- if(s<0.0 || s>len2) return 0;
-
- n[0]= (rc[0] - s*axis[0]);
- n[1]= (rc[1] - s*axis[1]);
- n[2]= (rc[2] - s*axis[2]);
-
- printf("var1: %f, var2: %f, var3: %f\n", labdacor, len2, s);
- printf("var1: %f, var2: %f, var3: %f\n", rc[0], rc[1], rc[2]);
- printf("var1: %f, var2: %f, var3: %f\n", n[0], n[1], n[2]);
-
- return 1;
-}
-
-int sphere_intersect_test(void)
-{
- EditMesh *em = G.editMesh;
- float *oldloc, speed[3], labda, labdacor, len, bsq, u, disc, *base, rc[3];
- EditVert *v1;
-
- v1= em->verts.first;
- base= v1->co;
-
- v1= v1->next;
- oldloc= v1->co;
-
- v1= v1->next;
- VecSubf(speed, v1->co, oldloc);
- len= Normalize(speed);
- if(len==0.0) return 0;
-
- VecSubf(rc, oldloc, base);
- bsq= rc[0]*speed[0] + rc[1]*speed[1] + rc[2]*speed[2];
- u= rc[0]*rc[0] + rc[1]*rc[1] + rc[2]*rc[2] - G.scene->editbutsize*G.scene->editbutsize;
-
- disc= bsq*bsq - u;
-
- if(disc>=0.0) {
- disc= sqrt(disc);
- labdacor= (-bsq - disc)/len; /* entry point */
- labda= (-bsq + disc)/len;
-
- printf("var1: %f, var2: %f, var3: %f\n", labdacor, labda, G.scene->editbutsize);
- }
- else return 0;
-
- /* intersection and normal */
- rc[0]= oldloc[0] + labdacor*speed[0] - base[0];
- rc[1]= oldloc[1] + labdacor*speed[1] - base[1];
- rc[2]= oldloc[2] + labdacor*speed[2] - base[2];
-
-
- return 1;
-}
-
-
-void std_rmouse_transform(void (*xf_func)(int, int))
-{
- short mval[2];
- short xo, yo;
- short timer=0;
- short mousebut;
- short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
-
- /* check for left mouse select/right mouse select */
-
- if(curarea->spacetype==SPACE_NODE)
- mousebut = L_MOUSE|R_MOUSE;
- else if (U.flag & USER_LMOUSESELECT)
- mousebut = L_MOUSE;
- else
- mousebut = R_MOUSE;
-
- getmouseco_areawin(mval);
- xo= mval[0];
- yo= mval[1];
-
- while(get_mbut() & mousebut) {
- getmouseco_areawin(mval);
- if(abs(mval[0]-xo)+abs(mval[1]-yo) > 10) {
- if(curarea->spacetype==SPACE_VIEW3D) {
- initTransform(TFM_TRANSLATION, context);
- Transform();
- }
- else if(curarea->spacetype==SPACE_IMAGE) {
- initTransform(TFM_TRANSLATION, context);
- Transform();
- }
- else if(xf_func)
- xf_func('g', 0);
-
- while(get_mbut() & mousebut) BIF_wait_for_statechange();
- return;
- }
- else {
- PIL_sleep_ms(10);
- timer++;
- if(timer>=10*U.tb_rightmouse) {
- if(curarea->spacetype==SPACE_VIEW3D) {
- toolbox_n();
- return;
- }
- }
- }
- }
- /* if gets here it's a select */
- BIF_undo_push("Select");
-}
-
-void rightmouse_transform(void)
-{
- std_rmouse_transform(NULL);
-}
-
-
-/* ************************************** */
-
-
-static void single_object_users__forwardModifierLinks(void *userData, Object *ob, Object **obpoin)
-{
- ID_NEW(*obpoin);
-}
-void single_object_users(int flag)
-{
- Base *base;
- Object *ob, *obn;
-
- clear_sca_new_poins(); /* sensor/contr/act */
-
- /* duplicate (must set newid) */
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
-
- if( (base->flag & flag)==flag ) {
- if(ob->id.lib==NULL && ob->id.us>1) {
- /* base gets copy of object */
- obn= copy_object(ob);
- base->object= obn;
- ob->id.us--;
- }
- }
- base= base->next;
- }
-
- ID_NEW(G.scene->camera);
- if(G.vd) ID_NEW(G.vd->camera);
-
- /* object pointers */
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
- if(ob->id.lib==NULL) {
- relink_constraints(&base->object->constraints);
- if (base->object->pose){
- bPoseChannel *chan;
- for (chan = base->object->pose->chanbase.first; chan; chan=chan->next){
- relink_constraints(&chan->constraints);
- }
- }
- modifiers_foreachObjectLink(base->object, single_object_users__forwardModifierLinks, NULL);
-
- ID_NEW(ob->parent);
- ID_NEW(ob->track);
- }
- base= base->next;
- }
-
- set_sca_new_poins();
-}
-
-void new_id_matar(Material **matar, int totcol)
-{
- ID *id;
- int a;
-
- for(a=0; a<totcol; a++) {
- id= (ID *)matar[a];
- if(id && id->lib==0) {
- if(id->newid) {
- matar[a]= (Material *)id->newid;
- id_us_plus(id->newid);
- id->us--;
- }
- else if(id->us>1) {
- matar[a]= copy_material(matar[a]);
- id->us--;
- id->newid= (ID *)matar[a];
- }
- }
- }
-}
-
-void single_obdata_users(int flag)
-{
- Object *ob;
- Lamp *la;
- Curve *cu;
- Camera *cam;
- Base *base;
- Mesh *me;
- ID *id;
- int a;
-
-#ifdef WITH_VERSE
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
- if(ob->vnode) {
- error("Can't make data single user, when data are shared at verse server");
- return;
- }
- base = base->next;
- }
-#endif
-
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
- if(ob->id.lib==NULL && (base->flag & flag)==flag ) {
- id= ob->data;
-
- if(id && id->us>1 && id->lib==0) {
- ob->recalc= OB_RECALC_DATA;
-
- switch(ob->type) {
- case OB_LAMP:
- if(id && id->us>1 && id->lib==NULL) {
- ob->data= la= copy_lamp(ob->data);
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) {
- ID_NEW(la->mtex[a]->object);
- }
- }
- }
- break;
- case OB_CAMERA:
- ob->data= copy_camera(ob->data);
- break;
- case OB_MESH:
- me= ob->data= copy_mesh(ob->data);
- if(me && me->key)
- ipo_idnew(me->key->ipo); /* drivers */
- break;
- case OB_MBALL:
- ob->data= copy_mball(ob->data);
- break;
- case OB_CURVE:
- case OB_SURF:
- case OB_FONT:
- ob->data= cu= copy_curve(ob->data);
- ID_NEW(cu->bevobj);
- ID_NEW(cu->taperobj);
- break;
- case OB_LATTICE:
- ob->data= copy_lattice(ob->data);
- break;
- case OB_ARMATURE:
- ob->recalc |= OB_RECALC_DATA;
- ob->data= copy_armature(ob->data);
- armature_rebuild_pose(ob, ob->data);
- break;
- default:
- printf("ERROR single_obdata_users: %s\n", id->name);
- error("Read console");
- return;
- }
-
- id->us--;
- id->newid= ob->data;
-
- }
-
- id= (ID *)ob->action;
- if (id && id->us>1 && id->lib==NULL){
- if(id->newid){
- ob->action= (bAction *)id->newid;
- id_us_plus(id->newid);
- }
- else {
- ob->action= copy_action(ob->action);
- id->us--;
- id->newid=(ID *)ob->action;
- }
- }
- id= (ID *)ob->ipo;
- if(id && id->us>1 && id->lib==NULL) {
- if(id->newid) {
- ob->ipo= (Ipo *)id->newid;
- id_us_plus(id->newid);
- }
- else {
- ob->ipo= copy_ipo(ob->ipo);
- id->us--;
- id->newid= (ID *)ob->ipo;
- }
- ipo_idnew(ob->ipo); /* drivers */
- }
- /* other ipos */
- switch(ob->type) {
- case OB_LAMP:
- la= ob->data;
- if(la->ipo && la->ipo->id.us>1) {
- la->ipo->id.us--;
- la->ipo= copy_ipo(la->ipo);
- ipo_idnew(la->ipo); /* drivers */
- }
- break;
- case OB_CAMERA:
- cam= ob->data;
- if(cam->ipo && cam->ipo->id.us>1) {
- cam->ipo->id.us--;
- cam->ipo= copy_ipo(cam->ipo);
- ipo_idnew(cam->ipo); /* drivers */
- }
- break;
- }
-
- }
- base= base->next;
- }
-
- me= G.main->mesh.first;
- while(me) {
- ID_NEW(me->texcomesh);
- me= me->id.next;
- }
-}
-
-void single_ipo_users(int flag)
-{
- Object *ob;
- Base *base;
- ID *id;
-
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
- if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
- ob->recalc= OB_RECALC_DATA;
-
- id= (ID *)ob->ipo;
- if(id && id->us>1 && id->lib==NULL) {
- ob->ipo= copy_ipo(ob->ipo);
- id->us--;
- ipo_idnew(ob->ipo); /* drivers */
- }
- }
- base= base->next;
- }
-}
-
-void single_mat_users(int flag)
-{
- Object *ob;
- Base *base;
- Material *ma, *man;
- Tex *tex;
- int a, b;
-
-
- base= FIRSTBASE;
- while(base) {
- ob= base->object;
- if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
-
- for(a=1; a<=ob->totcol; a++) {
- ma= give_current_material(ob, a);
- if(ma) {
- /* do not test for LIB_NEW: this functions guaranteed delivers single_users! */
-
- if(ma->id.us>1) {
- man= copy_material(ma);
-
- man->id.us= 0;
- assign_material(ob, man, a);
-
- if(ma->ipo) {
- man->ipo= copy_ipo(ma->ipo);
- ma->ipo->id.us--;
- ipo_idnew(ma->ipo); /* drivers */
- }
-
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
- tex= ma->mtex[b]->tex;
- if(tex->id.us>1) {
- ma->mtex[b]->tex= copy_texture(tex);
- tex->id.us--;
- }
- }
- }
-
- }
- }
- }
- }
- base= base->next;
- }
-}
-
-void do_single_tex_user(Tex **from)
-{
- Tex *tex, *texn;
-
- tex= *from;
- if(tex==0) return;
-
- if(tex->id.newid) {
- *from= (Tex *)tex->id.newid;
- id_us_plus(tex->id.newid);
- tex->id.us--;
- }
- else if(tex->id.us>1) {
- texn= copy_texture(tex);
- tex->id.newid= (ID *)texn;
- tex->id.us--;
- *from= texn;
- }
-
-}
-
-void single_tex_users_expand()
-{
- /* only when 'parent' blocks are LIB_NEW */
- Material *ma;
- Lamp *la;
- World *wo;
- int b;
-
- ma= G.main->mat.first;
- while(ma) {
- if(ma->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
- do_single_tex_user( &(ma->mtex[b]->tex) );
- }
- }
- }
- ma= ma->id.next;
- }
-
- la= G.main->lamp.first;
- while(la) {
- if(la->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(la->mtex[b] && la->mtex[b]->tex) {
- do_single_tex_user( &(la->mtex[b]->tex) );
- }
- }
- }
- la= la->id.next;
- }
- wo= G.main->world.first;
- while(wo) {
- if(wo->id.flag & LIB_NEW) {
- for(b=0; b<MAX_MTEX; b++) {
- if(wo->mtex[b] && wo->mtex[b]->tex) {
- do_single_tex_user( &(wo->mtex[b]->tex) );
- }
- }
- }
- wo= wo->id.next;
- }
-}
-
-void single_mat_users_expand(void)
-{
- /* only when 'parent' blocks are LIB_NEW */
-
- Object *ob;
- Mesh *me;
- Curve *cu;
- MetaBall *mb;
- Material *ma;
- int a;
-
- ob= G.main->object.first;
- while(ob) {
- if(ob->id.flag & LIB_NEW) {
- new_id_matar(ob->mat, ob->totcol);
- }
- ob= ob->id.next;
- }
-
- me= G.main->mesh.first;
- while(me) {
- if(me->id.flag & LIB_NEW) {
- new_id_matar(me->mat, me->totcol);
- }
- me= me->id.next;
- }
-
- cu= G.main->curve.first;
- while(cu) {
- if(cu->id.flag & LIB_NEW) {
- new_id_matar(cu->mat, cu->totcol);
- }
- cu= cu->id.next;
- }
-
- mb= G.main->mball.first;
- while(mb) {
- if(mb->id.flag & LIB_NEW) {
- new_id_matar(mb->mat, mb->totcol);
- }
- mb= mb->id.next;
- }
-
- /* material imats */
- ma= G.main->mat.first;
- while(ma) {
- if(ma->id.flag & LIB_NEW) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
- ID_NEW(ma->mtex[a]->object);
- }
- }
- }
- ma= ma->id.next;
- }
-}
-
-void single_user(void)
-{
- int nr;
-
- if(G.scene->id.lib) return;
-
- clear_id_newpoins();
-
- nr= pupmenu("Make Single User%t|Object|Object & ObData|Object & ObData & Materials+Tex|Materials+Tex|Ipos");
- if(nr>0) {
-
- if(nr==1) single_object_users(1);
-
- else if(nr==2) {
- single_object_users(1);
- single_obdata_users(1);
- }
- else if(nr==3) {
- single_object_users(1);
- single_obdata_users(1);
- single_mat_users(1); /* also tex */
-
- }
- else if(nr==4) {
- single_mat_users(1);
- }
- else if(nr==5) {
- single_ipo_users(1);
- }
-
-
- clear_id_newpoins();
-
- countall();
- allqueue(REDRAWALL, 0);
- BIF_undo_push("Single user");
- }
-}
-
-/* ************************************************************* */
-
-/* helper for below, ma was checked to be not NULL */
-static void make_local_makelocalmaterial(Material *ma)
-{
- ID *id;
- int b;
-
- make_local_material(ma);
-
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
- make_local_texture(ma->mtex[b]->tex);
- }
- }
-
- id= (ID *)ma->ipo;
- if(id && id->lib) make_local_ipo(ma->ipo);
-
- /* nodetree? XXX */
-}
-
-void make_local_menu(void)
-{
- int mode;
-
- /* If you modify this menu, please remember to update view3d_edit_object_makelocalmenu
- * in header_view3d.c and the menu in toolbox.c
- */
-
- if(G.scene->id.lib) return;
-
- mode = pupmenu("Make Local%t|Selected Objects %x1|Selected Objects and Data %x2|All %x3");
-
- if (mode <= 0) return;
-
- make_local(mode);
-}
-
-void make_local(int mode)
-{
- Base *base;
- Object *ob;
- bActionStrip *strip;
- ParticleSystem *psys;
- Material *ma, ***matarar;
- Lamp *la;
- Curve *cu;
- ID *id;
- int a, b;
-
- /* WATCH: the function new_id(..) re-inserts the id block!!! */
- if(G.scene->id.lib) return;
-
- if(mode==3) {
- all_local(NULL, 0); /* NULL is all libs */
- allqueue(REDRAWALL, 0);
- return;
- }
- else if(mode<1) return;
-
- clear_id_newpoins();
-
- base= FIRSTBASE;
- while(base) {
- if( TESTBASE(base) ) {
- ob= base->object;
- if(ob->id.lib) {
- make_local_object(ob);
- }
- }
- base= base->next;
- }
-
- /* maybe object pointers */
- base= FIRSTBASE;
- while(base) {
- if( TESTBASE(base) ) {
- ob= base->object;
- if(ob->id.lib==NULL) {
- ID_NEW(ob->parent);
- ID_NEW(ob->track);
- }
- }
- base= base->next;
- }
-
- base= FIRSTBASE;
- while(base) {
- if( TESTBASE(base) ) {
- ob= base->object;
- id= ob->data;
-
- if(id && mode>1) {
-
- switch(ob->type) {
- case OB_LAMP:
- make_local_lamp((Lamp *)id);
-
- la= ob->data;
- id= (ID *)la->ipo;
- if(id && id->lib) make_local_ipo(la->ipo);
-
- break;
- case OB_CAMERA:
- make_local_camera((Camera *)id);
- break;
- case OB_MESH:
- make_local_mesh((Mesh *)id);
- make_local_key( ((Mesh *)id)->key );
- break;
- case OB_MBALL:
- make_local_mball((MetaBall *)id);
- break;
- case OB_CURVE:
- case OB_SURF:
- case OB_FONT:
- cu= (Curve *)id;
- make_local_curve(cu);
- id= (ID *)cu->ipo;
- if(id && id->lib) make_local_ipo(cu->ipo);
- make_local_key( cu->key );
- break;
- case OB_LATTICE:
- make_local_lattice((Lattice *)id);
- make_local_key( ((Lattice *)id)->key );
- break;
- case OB_ARMATURE:
- make_local_armature ((bArmature *)id);
- break;
- }
-
- for(psys=ob->particlesystem.first; psys; psys=psys->next)
- make_local_particlesettings(psys->part);
- }
- id= (ID *)ob->ipo;
- if(id && id->lib) make_local_ipo(ob->ipo);
-
- id= (ID *)ob->action;
- if(id && id->lib) make_local_action(ob->action);
-
- for(strip=ob->nlastrips.first; strip; strip=strip->next) {
- if(strip->act && strip->act->id.lib)
- make_local_action(strip->act);
- }
- }
- base= base->next;
- }
-
- if(mode>1) {
- base= FIRSTBASE;
- while(base) {
- if( TESTBASE(base) ) {
- ob= base->object;
- if(ob->type==OB_LAMP) {
- la= ob->data;
- for(b=0; b<MAX_MTEX; b++) {
- if(la->mtex[b] && la->mtex[b]->tex) {
- make_local_texture(la->mtex[b]->tex);
- }
- }
- }
- else {
-
- for(a=0; a<ob->totcol; a++) {
- ma= ob->mat[a];
- if(ma)
- make_local_makelocalmaterial(ma);
- }
-
- matarar= (Material ***)give_matarar(ob);
- if (matarar) {
- for(a=0; a<ob->totcol; a++) {
- ma= (*matarar)[a];
- if(ma)
- make_local_makelocalmaterial(ma);
- }
- }
- }
- }
- base= base->next;
- }
- }
-
- allqueue(REDRAWALL, 0);
- BIF_undo_push("Make local");
-}
-
-static void copy_object__forwardModifierLinks(void *userData, Object *ob,
- ID **idpoin)
-{
- /* this is copied from ID_NEW; it might be better to have a macro */
- if(*idpoin && (*idpoin)->newid) *idpoin = (*idpoin)->newid;
-}
-
-
-/* after copying objects, copied data should get new pointers */
-static void copy_object_set_idnew(int dupflag)
-{
- Base *base;
- Object *ob;
- Material *ma, *mao;
- ID *id;
- Ipo *ipo;
- bActionStrip *strip;
- int a;
-
- /* check object pointers */
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- ob= base->object;
- relink_constraints(&ob->constraints);
- if (ob->pose){
- bPoseChannel *chan;
- for (chan = ob->pose->chanbase.first; chan; chan=chan->next){
- relink_constraints(&chan->constraints);
- }
- }
- modifiers_foreachIDLink(ob, copy_object__forwardModifierLinks, NULL);
- ID_NEW(ob->parent);
- ID_NEW(ob->track);
- ID_NEW(ob->proxy);
- ID_NEW(ob->proxy_group);
-
- for(strip= ob->nlastrips.first; strip; strip= strip->next) {
- bActionModifier *amod;
- for(amod= strip->modifiers.first; amod; amod= amod->next)
- ID_NEW(amod->ob);
- }
- }
- }
-
- /* materials */
- if( dupflag & USER_DUP_MAT) {
- mao= G.main->mat.first;
- while(mao) {
- if(mao->id.newid) {
-
- ma= (Material *)mao->id.newid;
-
- if(dupflag & USER_DUP_TEX) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
- id= (ID *)ma->mtex[a]->tex;
- if(id) {
- ID_NEW_US(ma->mtex[a]->tex)
- else ma->mtex[a]->tex= copy_texture(ma->mtex[a]->tex);
- id->us--;
- }
- }
- }
- }
- id= (ID *)ma->ipo;
- if(id) {
- ID_NEW_US(ma->ipo)
- else ma->ipo= copy_ipo(ma->ipo);
- id->us--;
- }
- }
- mao= mao->id.next;
- }
- }
-
- /* lamps */
- if( dupflag & USER_DUP_IPO) {
- Lamp *la= G.main->lamp.first;
- while(la) {
- if(la->id.newid) {
- Lamp *lan= (Lamp *)la->id.newid;
- id= (ID *)lan->ipo;
- if(id) {
- ID_NEW_US(lan->ipo)
- else lan->ipo= copy_ipo(lan->ipo);
- id->us--;
- }
- }
- la= la->id.next;
- }
- }
-
- /* ipos */
- ipo= G.main->ipo.first;
- while(ipo) {
- if(ipo->id.lib==NULL && ipo->id.newid) {
- Ipo *ipon= (Ipo *)ipo->id.newid;
- IpoCurve *icu;
- for(icu= ipon->curve.first; icu; icu= icu->next) {
- if(icu->driver) {
- ID_NEW(icu->driver->ob);
- }
- }
- }
- ipo= ipo->id.next;
- }
-
- set_sca_new_poins();
-
- clear_id_newpoins();
-
-}
-
-/* This function duplicated the current visible selection, its used by Duplicate and Linked Duplicate
-Alt+D/Shift+D as well as Pythons Object.Duplicate(), it takes
-mode:
- 0: Duplicate with transform, Redraw.
- 1: Duplicate, no transform, Redraw
- 2: Duplicate, no transform, no redraw (Only used by python)
-if true the user will not be dropped into grab mode directly after and..
-dupflag: a flag made from constants declared in DNA_userdef_types.h
- The flag tells adduplicate() weather to copy data linked to the object, or to reference the existing data.
- U.dupflag for default operations or you can construct a flag as python does
- if the dupflag is 0 then no data will be copied (linked duplicate) */
-
-void adduplicate(int mode, int dupflag)
-{
- Base *base, *basen;
- Material ***matarar;
- Object *ob, *obn;
- ID *id;
- int a, didit;
-
- if(G.scene->id.lib) return;
- clear_id_newpoins();
- clear_sca_new_poins(); /* sensor/contr/act */
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
-
- ob= base->object;
- if(ob->flag & OB_POSEMODE) {
- ; /* nothing? */
- }
- else {
- obn= copy_object(ob);
- obn->recalc |= OB_RECALC;
-
- basen= MEM_mallocN(sizeof(Base), "duplibase");
- *basen= *base;
- BLI_addhead(&G.scene->base, basen); /* addhead: prevent eternal loop */
- basen->object= obn;
- base->flag &= ~SELECT;
-
- if(basen->flag & OB_FROMGROUP) {
- Group *group;
- for(group= G.main->group.first; group; group= group->id.next) {
- if(object_in_group(ob, group))
- add_to_group(group, obn);
- }
- obn->flag |= OB_FROMGROUP; /* this flag is unset with copy_object() */
- }
-
- if(BASACT==base) BASACT= basen;
-
- /* duplicates using userflags */
-
- if(dupflag & USER_DUP_IPO) {
- bConstraintChannel *chan;
- id= (ID *)obn->ipo;
-
- if(id) {
- ID_NEW_US( obn->ipo)
- else obn->ipo= copy_ipo(obn->ipo);
- id->us--;
- }
- /* Handle constraint ipos */
- for (chan=obn->constraintChannels.first; chan; chan=chan->next){
- id= (ID *)chan->ipo;
- if(id) {
- ID_NEW_US( chan->ipo)
- else chan->ipo= copy_ipo(chan->ipo);
- id->us--;
- }
- }
- }
- if(dupflag & USER_DUP_ACT){ /* Not buttons in the UI to modify this, add later? */
- id= (ID *)obn->action;
- if (id){
- ID_NEW_US(obn->action)
- else{
- obn->action= copy_action(obn->action);
- }
- id->us--;
- }
- }
- if(dupflag & USER_DUP_MAT) {
- for(a=0; a<obn->totcol; a++) {
- id= (ID *)obn->mat[a];
- if(id) {
- ID_NEW_US(obn->mat[a])
- else obn->mat[a]= copy_material(obn->mat[a]);
- id->us--;
- }
- }
- }
-
- id= obn->data;
- didit= 0;
-
- switch(obn->type) {
- case OB_MESH:
- if(dupflag & USER_DUP_MESH) {
- ID_NEW_US2( obn->data )
- else {
- obn->data= copy_mesh(obn->data);
-
- if(obn->fluidsimSettings) {
- obn->fluidsimSettings->orgMesh = (Mesh *)obn->data;
- }
-
- didit= 1;
- }
- id->us--;
- }
- break;
- case OB_CURVE:
- if(dupflag & USER_DUP_CURVE) {
- ID_NEW_US2(obn->data )
- else {
- obn->data= copy_curve(obn->data);
- didit= 1;
- }
- id->us--;
- }
- break;
- case OB_SURF:
- if(dupflag & USER_DUP_SURF) {
- ID_NEW_US2( obn->data )
- else {
- obn->data= copy_curve(obn->data);
- didit= 1;
- }
- id->us--;
- }
- break;
- case OB_FONT:
- if(dupflag & USER_DUP_FONT) {
- ID_NEW_US2( obn->data )
- else {
- obn->data= copy_curve(obn->data);
- didit= 1;
- }
- id->us--;
- }
- break;
- case OB_MBALL:
- if(dupflag & USER_DUP_MBALL) {
- ID_NEW_US2(obn->data )
- else {
- obn->data= copy_mball(obn->data);
- didit= 1;
- }
- id->us--;
- }
- break;
- case OB_LAMP:
- if(dupflag & USER_DUP_LAMP) {
- ID_NEW_US2(obn->data )
- else obn->data= copy_lamp(obn->data);
- id->us--;
- }
- break;
-
- case OB_ARMATURE:
- obn->recalc |= OB_RECALC_DATA;
- if(obn->pose) obn->pose->flag |= POSE_RECALC;
-
- if(dupflag & USER_DUP_ARM) {
- ID_NEW_US2(obn->data )
- else {
- obn->data= copy_armature(obn->data);
- armature_rebuild_pose(obn, obn->data);
- didit= 1;
- }
- id->us--;
- }
-
- break;
-
- case OB_LATTICE:
- if(dupflag!=0) {
- ID_NEW_US2(obn->data )
- else obn->data= copy_lattice(obn->data);
- id->us--;
- }
- break;
- case OB_CAMERA:
- if(dupflag!=0) {
- ID_NEW_US2(obn->data )
- else obn->data= copy_camera(obn->data);
- id->us--;
- }
- break;
- }
-
- if(dupflag & USER_DUP_MAT) {
- matarar= give_matarar(obn);
- if(didit && matarar) {
- for(a=0; a<obn->totcol; a++) {
- id= (ID *)(*matarar)[a];
- if(id) {
- ID_NEW_US( (*matarar)[a] )
- else (*matarar)[a]= copy_material((*matarar)[a]);
-
- id->us--;
- }
- }
- }
- }
-#ifdef WITH_VERSE
- /* send new created object to verse server,
- * when original object was linked with object node */
- if(ob->vnode) {
- b_verse_duplicate_object(((VNode*)ob->vnode)->session, ob, obn);
- }
-#endif
- }
-
- }
- base= base->next;
- }
-
- copy_object_set_idnew(dupflag);
-
- DAG_scene_sort(G.scene);
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- countall();
- if(mode==0) {
- BIF_TransformSetUndo("Add Duplicate");
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- }
- set_active_base(BASACT);
- if(mode!=2) { /* mode of 2 is used by python to avoid unrequested redraws */
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0); /* also oops */
- allqueue(REDRAWIPO, 0); /* also oops */
- }
-}
-
-void make_object_duplilist_real(Base *base)
-{
- Base *basen;
- Object *ob;
- ListBase *lb;
- DupliObject *dob;
-
- if(!base && !(base = BASACT))
- return;
-
- if(!(base->object->transflag & OB_DUPLI))
- return;
-
- lb= object_duplilist(G.scene, base->object);
-
- for(dob= lb->first; dob; dob= dob->next) {
- ob= copy_object(dob->ob);
- /* font duplis can have a totcol without material, we get them from parent
- * should be implemented better...
- */
- if(ob->mat==NULL) ob->totcol= 0;
-
- basen= MEM_dupallocN(base);
- basen->flag &= ~OB_FROMDUPLI;
- BLI_addhead(&G.scene->base, basen); /* addhead: othwise eternal loop */
- basen->object= ob;
- ob->ipo= NULL; /* make sure apply works */
- ob->parent= ob->track= NULL;
- ob->disp.first= ob->disp.last= NULL;
- ob->transflag &= ~OB_DUPLI;
-
- Mat4CpyMat4(ob->obmat, dob->mat);
- apply_obmat(ob);
- }
-
- copy_object_set_idnew(0);
-
- free_object_duplilist(lb);
-
- base->object->transflag &= ~OB_DUPLI;
-}
-
-void make_duplilist_real()
-{
- Base *base;
- /* extern ListBase duplilist; */
-
- if(okee("Make dupli objects real")==0) return;
-
- clear_id_newpoins();
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- make_object_duplilist_real(base);
- }
- base= base->next;
- }
-
- DAG_scene_sort(G.scene);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Make duplicates real");
-}
-
-void selectlinks_menu(void)
-{
- Object *ob;
- int nr;
-
- ob= OBACT;
- if(ob==0) return;
-
- /* If you modify this menu, please remember to update view3d_select_linksmenu
- * in header_view3d.c and the menu in toolbox.c
- */
- nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4|DupliGroup%x5|ParticleSystem%x6");
-
- if (nr <= 0) return;
-
- selectlinks(nr);
-}
-
-void selectlinks(int nr)
-{
- Object *ob;
- Base *base;
- void *obdata = NULL;
- Ipo *ipo = NULL;
- Material *mat = NULL, *mat1;
- Tex *tex=0;
- int a, b;
- short changed = 0;
- /* events (nr):
- * Object Ipo: 1
- * ObData: 2
- * Current Material: 3
- * Current Texture: 4
- * DupliGroup: 5
- * PSys: 6
- */
-
-
- ob= OBACT;
- if(ob==0) return;
-
- if(nr==1) {
- ipo= ob->ipo;
- if(ipo==0) return;
- }
- else if(nr==2) {
- if(ob->data==0) return;
- obdata= ob->data;
- }
- else if(nr==3 || nr==4) {
- mat= give_current_material(ob, ob->actcol);
- if(mat==0) return;
- if(nr==4) {
- if(mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex;
- if(tex==0) return;
- }
- }
- else if(nr==5) {
- if(ob->dup_group==NULL) return;
- }
- else if(nr==6) {
- if(ob->particlesystem.first==NULL) return;
- }
- else return;
-
- base= FIRSTBASE;
- while(base) {
- if (BASE_SELECTABLE(base) && !(base->flag & SELECT)) {
- if(nr==1) {
- if(base->object->ipo==ipo) base->flag |= SELECT;
- changed = 1;
- }
- else if(nr==2) {
- if(base->object->data==obdata) base->flag |= SELECT;
- changed = 1;
- }
- else if(nr==3 || nr==4) {
- ob= base->object;
-
- for(a=1; a<=ob->totcol; a++) {
- mat1= give_current_material(ob, a);
- if(nr==3) {
- if(mat1==mat) base->flag |= SELECT;
- changed = 1;
- }
- else if(mat1 && nr==4) {
- for(b=0; b<MAX_MTEX; b++) {
- if(mat1->mtex[b]) {
- if(tex==mat1->mtex[b]->tex) {
- base->flag |= SELECT;
- changed = 1;
- break;
- }
- }
- }
- }
- }
- }
- else if(nr==5) {
- if(base->object->dup_group==ob->dup_group) {
- base->flag |= SELECT;
- changed = 1;
- }
- }
- else if(nr==6) {
- /* loop through other, then actives particles*/
- ParticleSystem *psys;
- ParticleSystem *psys_act;
-
- for(psys=base->object->particlesystem.first; psys; psys=psys->next) {
- for(psys_act=ob->particlesystem.first; psys_act; psys_act=psys_act->next) {
- if (psys->part == psys_act->part) {
- base->flag |= SELECT;
- changed = 1;
- break;
- }
- }
-
- if (base->flag & SELECT) {
- break;
- }
- }
- }
- base->object->flag= base->flag;
- }
- base= base->next;
- }
-
- if (changed) {
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Select linked");
- countall();
- }
-}
-
-void image_aspect(void)
-{
- /* all selected objects with an image map: scale in image aspect */
- Base *base;
- Object *ob;
- Material *ma;
- Tex *tex;
- float x, y, space;
- int a, b, done;
-
- if(G.obedit) return;
- if(G.scene->id.lib) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- ob= base->object;
- done= 0;
-
- for(a=1; a<=ob->totcol; a++) {
- ma= give_current_material(ob, a);
- if(ma) {
- for(b=0; b<MAX_MTEX; b++) {
- if(ma->mtex[b] && ma->mtex[b]->tex) {
- tex= ma->mtex[b]->tex;
- if(tex->type==TEX_IMAGE && tex->ima) {
- ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, NULL);
-
- /* texturespace */
- space= 1.0;
- if(ob->type==OB_MESH) {
- float size[3];
- mesh_get_texspace(ob->data, NULL, NULL, size);
- space= size[0]/size[1];
- }
- else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
- Curve *cu= ob->data;
- space= cu->size[0]/cu->size[1];
- }
-
- x= ibuf->x/space;
- y= ibuf->y;
-
- if(x>y) ob->size[0]= ob->size[1]*x/y;
- else ob->size[1]= ob->size[0]*y/x;
-
- done= 1;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
- }
- if(done) break;
- }
- }
- if(done) break;
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Image aspect");
-}
-
-void set_ob_ipoflags(void)
-{
- Base *base;
- int set= 1;
-
- if (!G.vd) {
- error("Can't do this! Open a 3D window");
- return;
- }
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base->object->ipoflag & OB_DRAWKEY) {
- set= 0;
- break;
- }
- }
- base= base->next;
- }
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(set) {
- base->object->ipoflag |= OB_DRAWKEY;
- if(base->object->ipo) base->object->ipo->showkey= 1;
- }
- else {
- base->object->ipoflag &= ~OB_DRAWKEY;
- if(base->object->ipo) base->object->ipo->showkey= 0;
- }
- }
- base= base->next;
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-}
-
-void select_select_keys(void)
-{
- Base *base;
- IpoCurve *icu;
- BezTriple *bezt;
- int a;
-
- if (!G.vd) {
- error("Can't do this! Open a 3D window");
- return;
- }
-
- if(G.scene->id.lib) return;
-
- if(okee("Show and select all keys")==0) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base->object->ipo) {
- base->object->ipoflag |= OB_DRAWKEY;
- base->object->ipo->showkey= 1;
- icu= base->object->ipo->curve.first;
- while(icu) {
- a= icu->totvert;
- bezt= icu->bezt;
- while(a--) {
- bezt->f1 |= SELECT;
- bezt->f2 |= SELECT;
- bezt->f3 |= SELECT;
- bezt++;
- }
- icu= icu->next;
- }
- }
- }
- base= base->next;
- }
-
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-
- BIF_undo_push("Select keys");
-
-}
-
-
-int vergbaseco(const void *a1, const void *a2)
-{
- Base **x1, **x2;
-
- x1= (Base **) a1;
- x2= (Base **) a2;
-
- if( (*x1)->sy > (*x2)->sy ) return 1;
- else if( (*x1)->sy < (*x2)->sy) return -1;
- else if( (*x1)->sx > (*x2)->sx ) return 1;
- else if( (*x1)->sx < (*x2)->sx ) return -1;
-
- return 0;
-}
-
-
-void auto_timeoffs(void)
-{
- Base *base, **basesort, **bs;
- float start, delta;
- int tot=0, a;
- short offset=25;
-
- if(BASACT==0 || G.vd==NULL) return;
- if(button(&offset, 0, 1000,"Total time")==0) return;
-
- /* make array of all bases, xco yco (screen) */
- base= FIRSTBASE;
- while(base) {
- if(TESTBASELIB(base)) {
- tot++;
- }
- base= base->next;
- }
-
- delta= (float)offset/(float)tot;
- start= OBACT->sf;
-
- bs= basesort= MEM_mallocN(sizeof(void *)*tot,"autotimeoffs");
- base= FIRSTBASE;
-
- while(base) {
- if(TESTBASELIB(base)) {
- *bs= base;
- bs++;
- }
- base= base->next;
- }
- qsort(basesort, tot, sizeof(void *), vergbaseco);
-
- bs= basesort;
- for(a=0; a<tot; a++) {
-
- (*bs)->object->sf= start;
- start+= delta;
-
- bs++;
- }
- MEM_freeN(basesort);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-void ofs_timeoffs(void)
-{
- Base *base;
- float offset=0.0f;
-
- if(BASACT==0 || G.vd==NULL) return;
-
- if(fbutton(&offset, -10000.0f, 10000.0f, 10, 10, "Offset")==0) return;
-
- /* make array of all bases, xco yco (screen) */
- base= FIRSTBASE;
- while(base) {
- if(TESTBASELIB(base)) {
- base->object->sf += offset;
- if (base->object->sf < -MAXFRAMEF) base->object->sf = -MAXFRAMEF;
- else if (base->object->sf > MAXFRAMEF) base->object->sf = MAXFRAMEF;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-
-void rand_timeoffs(void)
-{
- Base *base;
- float rand=0.0f;
-
- if(BASACT==0 || G.vd==NULL) return;
-
- if(fbutton(&rand, 0.0f, 10000.0f, 10, 10, "Randomize")==0) return;
-
- rand *= 2;
-
- base= FIRSTBASE;
- while(base) {
- if(TESTBASELIB(base)) {
- base->object->sf += (BLI_drand()-0.5) * rand;
- if (base->object->sf < -MAXFRAMEF) base->object->sf = -MAXFRAMEF;
- else if (base->object->sf > MAXFRAMEF) base->object->sf = MAXFRAMEF;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-
-void texspace_edit(void)
-{
- Base *base;
- int nr=0;
-
- /* first test if from visible and selected objects
- * texspacedraw is set:
- */
-
- if(G.obedit) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- break;
- }
- base= base->next;
- }
-
- if(base==0) {
- return;
- }
-
- nr= pupmenu("Texture Space %t|Grab/Move%x1|Size%x2");
- if(nr<1) return;
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- base->object->dtx |= OB_TEXSPACE;
- }
- base= base->next;
- }
-
-
- if(nr==1) {
- initTransform(TFM_TRANSLATION, CTX_TEXTURE);
- Transform();
- }
- else if(nr==2) {
- initTransform(TFM_RESIZE, CTX_TEXTURE);
- Transform();
- }
- else if(nr==3) {
- initTransform(TFM_ROTATION, CTX_TEXTURE);
- Transform();
- }
-}
-
-/* ******************************************************************** */
-/* Mirror function in Edit Mode */
-
-void mirrormenu(void)
-{
- if(G.f & G_PARTICLEEDIT) {
- PE_mirror_x(0);
- }
- else {
- initTransform(TFM_MIRROR, CTX_NO_PET);
- Transform();
- }
-}
-
-void hookmenu(void)
-{
- /* only called in object mode */
- short event, changed=0;
- Object *ob;
- Base *base;
- ModifierData *md;
- HookModifierData *hmd;
-
- event= pupmenu("Modify Hooks for Selected...%t|Reset Offset%x1|Recenter at Cursor%x2");
- if (event==-1) return;
- if (event==2 && !(G.vd)) {
- error("Cannot perform this operation without a 3d view");
- return;
- }
-
- for (base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB(base) {
- for (md = base->object->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- ob = base->object;
- hmd = (HookModifierData*) md;
-
- /*
- * Copied from modifiers_cursorHookCenter and
- * modifiers_clearHookOffset, should consolidate
- * */
-
- if (event==1) {
- if(hmd->object) {
- Mat4Invert(hmd->object->imat, hmd->object->obmat);
- Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL);
-
- changed= 1;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- } else {
- float *curs = give_cursor();
- float bmat[3][3], imat[3][3];
-
- where_is_object(ob);
-
- Mat3CpyMat4(bmat, ob->obmat);
- Mat3Inv(imat, bmat);
-
- curs= give_cursor();
- hmd->cent[0]= curs[0]-ob->obmat[3][0];
- hmd->cent[1]= curs[1]-ob->obmat[3][1];
- hmd->cent[2]= curs[2]-ob->obmat[3][2];
- Mat3MulVecfl(imat, hmd->cent);
-
- changed= 1;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
- }
- }
-
- if (changed) {
- if (event==1)
- BIF_undo_push("Clear hook offset for selected");
- else if (event==2)
- BIF_undo_push("Hook cursor center for selected");
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-}
-
-/*
- * Returns true if the Object is a from an external blend file (libdata)
- */
-int object_is_libdata(Object *ob)
-{
- if (!ob) return 0;
- if (ob->proxy) return 0;
- if (ob->id.lib) return 1;
- return 0;
-}
-
-
-/*
- * Returns true if the Object data is a from an external blend file (libdata)
- */
-int object_data_is_libdata(Object *ob)
-{
- if (!ob) return 0;
- if (ob->proxy) return 0;
- if (ob->id.lib) return 1;
- if (!ob->data) return 0;
- if (((ID *)ob->data)->lib) return 1;
- return 0;
-}
-
-void hide_objects(int select)
-{
- Base *base;
- short changed = 0, changed_act = 0;
- for(base = FIRSTBASE; base; base=base->next){
- if ((base->lay & G.vd->lay) && (TESTBASELIB(base)==select)) {
- base->flag &= ~SELECT;
- base->object->flag = base->flag;
- base->object->restrictflag |= OB_RESTRICT_VIEW;
- changed = 1;
- if (base==BASACT) {
- BASACT= NULL;
- changed_act = 1;
- }
- }
- }
- if (changed) {
- if(select) BIF_undo_push("Hide Selected Objects");
- else if(select) BIF_undo_push("Hide Unselected Objects");
- DAG_scene_sort(G.scene);
- allqueue(REDRAWVIEW3D,0);
- allqueue(REDRAWOOPS,0);
- allqueue(REDRAWDATASELECT,0);
- if (changed_act) { /* these spaces depend on the active object */
- allqueue(REDRAWBUTSALL,0);
- allqueue(REDRAWIPO,0);
- allqueue(REDRAWACTION,0);
- }
- countall();
- }
-}
-
-void show_objects(void)
-{
- Base *base;
- int changed = 0;
- for(base = FIRSTBASE; base; base=base->next){
- if((base->lay & G.vd->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) {
- base->flag |= SELECT;
- base->object->flag = base->flag;
- base->object->restrictflag &= ~OB_RESTRICT_VIEW;
- changed = 1;
- }
- }
- if (changed) {
- BIF_undo_push("Unhide Objects");
- DAG_scene_sort(G.scene);
- allqueue(REDRAWVIEW3D,0);
- allqueue(REDRAWOOPS,0);
- countall();
- }
-}
diff --git a/source/blender/src/editoops.c b/source/blender/src/editoops.c
deleted file mode 100644
index 48abb490e94..00000000000
--- a/source/blender/src/editoops.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_material_types.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-
-#include "BKE_global.h"
-#include "BKE_scene.h"
-#include "BKE_library.h"
-#include "BKE_material.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_editoops.h"
-#include "BIF_editview.h"
-#include "BIF_drawscene.h"
-#include "BIF_mywindow.h"
-#include "BIF_toolbox.h"
-#include "BIF_interface.h"
-
-#include "BDR_editobject.h"
-
-#include "BSE_edit.h"
-#include "BSE_drawipo.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-
-typedef struct TransOops {
- float *loc;
- float oldloc[2];
-} TransOops;
-
-struct ID *idt;
-
-
-static void oops_to_select_objects(void)
-{
- Oops *oops;
- Base *base;
- Object *ob;
-
- if(G.soops==0) return;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->type==ID_OB) {
- ob= (Object *)oops->id;
- if ((ob->restrictflag & OB_RESTRICT_VIEW)==0) {
- if(oops->flag & SELECT) ob->flag |= SELECT;
- else ob->flag &= ~SELECT;
- }
- }
- }
- oops= oops->next;
- }
- base= FIRSTBASE;
- while(base) {
- if(base->flag != base->object->flag) {
- base->flag= base->object->flag;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-void swap_select_all_oops(void)
-{
- Oops *oops;
- int sel= 0;
-
- if(G.soops==0) return;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & SELECT) {
- sel= 1;
- break;
- }
- }
- oops= oops->next;
- }
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(sel) oops->flag &= ~SELECT;
- else oops->flag |= SELECT;
- }
- oops= oops->next;
- }
-
- oops_to_select_objects(); /* also redraw */
-
- G.soops->lockpoin= NULL;
-}
-
-/* never used... check CVS 1.12 for the code */
-/* static void select_swap_oops(void) */
-
-static void deselect_all_oops(void)
-{
- Oops *oops;
-
- if(G.soops==0) return;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- oops->flag &= ~SELECT;
- }
- oops= oops->next;
- }
- G.soops->lockpoin= NULL;
-}
-
-void set_select_flag_oops(void) /* all areas */
-{
- SpaceOops *so;
- ScrArea *sa;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_OOPS) {
- so= sa->spacedata.first;
- so->flag |= SO_NEWSELECTED;
- }
- sa= sa->next;
- }
- if(G.soops) G.soops->lockpoin= NULL;
-}
-
-void deselect_all_area_oops(void) /* all areas */
-{
- SpaceOops *so;
- Oops *oops;
- ScrArea *sa;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_OOPS) {
- so= sa->spacedata.first;
-
- oops= so->oops.first;
- while(oops) {
- oops->flag &= ~SELECT;
- oops= oops->next;
- }
- }
- sa= sa->next;
- }
-
- if(G.soops) G.soops->lockpoin= NULL;
-}
-
-void transform_oops(int mode, int context)
-{
- TransOops *transmain, *tv;
- Oops *oops;
- float dx, dy, div, dvec[3], cent[3], min[3], max[3];
- float sizefac, size[2], xref=1.0, yref=1.0;
- int a, tot= 0, midtog= 0;
- unsigned short event = 0;
- short firsttime= 1, proj = 0, afbreek=0, xc, yc, xo, yo, xn, yn, mval[2];
- short val;
- char str[32];
-
- if(G.soops==0) return;
-
- /* which oopses... */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & SELECT) {
- tot++;
- }
- }
- oops= oops->next;
- }
-
- if(tot==0) return;
-
- G.moving= 1;
-
- INIT_MINMAX(min, max);
-
- tv=transmain= MEM_callocN(tot*sizeof(TransOops), "transmain");
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & SELECT) {
- tv->loc= &oops->x;
- tv->oldloc[0]= tv->loc[0];
- tv->oldloc[1]= tv->loc[1];
- DO_MINMAX2(tv->loc, min, max);
- tv++;
- }
- }
- oops= oops->next;
- }
-
- cent[0]= (min[0]+max[0])/2.0;
- cent[1]= (min[1]+max[1])/2.0;
-
- ipoco_to_areaco_noclip(G.v2d, cent, mval);
- xc= mval[0];
- yc= mval[1];
-
- getmouseco_areawin(mval);
- xo= xn= mval[0];
- yo= yn= mval[1];
- dvec[0]= dvec[1]= 0.0;
-
- sizefac= sqrt( (float)((yc-yn)*(yc-yn)+(xn-xc)*(xn-xc)) );
- if(sizefac<2.0) sizefac= 2.0;
-
- while(afbreek==0) {
- getmouseco_areawin(mval);
- if(mval[0]!=xo || mval[1]!=yo || firsttime) {
-
- if(mode=='g') {
-
- dx= mval[0]- xo;
- dy= mval[1]- yo;
-
- div= G.v2d->mask.xmax-G.v2d->mask.xmin;
- dvec[0]+= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/div;
-
- div= G.v2d->mask.ymax-G.v2d->mask.ymin;
- dvec[1]+= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div;
-
- if(midtog) dvec[proj]= 0.0;
-
- tv= transmain;
- for(a=0; a<tot; a++, tv++) {
-
- tv->loc[0]= tv->oldloc[0]+dvec[0];
- tv->loc[1]= tv->oldloc[1]+dvec[1];
-
- }
-
- sprintf(str, "X: %.2f Y: %.2f ", dvec[0], dvec[1]);
- headerprint(str);
- }
- else if(mode=='s') {
- size[0]=size[1]= (sqrt( (float)((yc-mval[1])*(yc-mval[1])+(mval[0]-xc)*(mval[0]-xc)) ))/sizefac;
-
- if(midtog) size[proj]= 1.0;
- size[0]*= xref;
- size[1]*= yref;
-
- tv= transmain;
- for(a=0; a<tot; a++, tv++) {
-
- tv->loc[0]= size[0]*(tv->oldloc[0]-cent[0])+ cent[0];
- tv->loc[1]= size[1]*(tv->oldloc[1]-cent[1])+ cent[1];
-
- }
-
- sprintf(str, "sizeX: %.3f sizeY: %.3f ", size[0], size[1]);
- headerprint(str);
- }
-
-
- xo= mval[0];
- yo= mval[1];
-
- force_draw(0);
-
- firsttime= 0;
-
- }
- else BIF_wait_for_statechange();
-
- while(qtest()) {
- event= extern_qread(&val);
- if(val) {
- switch(event) {
- case ESCKEY:
- case RIGHTMOUSE:
- case LEFTMOUSE:
- case SPACEKEY:
- case RETKEY:
- afbreek= 1;
- break;
- case MIDDLEMOUSE:
-
- midtog= ~midtog;
- if(midtog) {
- if( abs(mval[0]-xn) > abs(mval[1]-yn)) proj= 1;
- else proj= 0;
- firsttime= 1;
- }
-
- break;
- default:
- arrows_move_cursor(event);
- }
- }
- if(afbreek) break;
- }
- }
-
- if(event==ESCKEY || event==RIGHTMOUSE) {
- tv= transmain;
- for(a=0; a<tot; a++, tv++) {
- tv->loc[0]= tv->oldloc[0];
- tv->loc[1]= tv->oldloc[1];
- }
- }
- MEM_freeN(transmain);
-
- G.moving= 0;
-
- scrarea_queue_redraw(curarea);
-}
-
-static Oops *find_nearest_oops(void)
-{
- Oops *oops;
- float x, y;
- short mval[2];
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide == 0) {
- if(oops->x <=x && oops->x+OOPSX >= x) {
- if(oops->y <=y && oops->y+OOPSY >= y) {
- return oops;
- }
- }
- }
- oops= oops->next;
- }
- return 0;
-}
-
-static void do_activate_oops(Oops *oops)
-{
- Base *base;
- Object *ob;
-
- switch(oops->type) {
- case ID_SCE:
- if(oops->id) set_scene((Scene *)oops->id);
- break;
- case ID_OB:
- base= FIRSTBASE;
- while(base) {
- if(base->object == (Object *)oops->id) break;
- base= base->next;
- }
- if(base) {
- if(G.obedit==NULL) set_active_base(base); /* editview.c */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 1);
- }
- break;
- case ID_MA:
- ob= OBACT;
- if(ob && oops->id) {
- assign_material(ob, (Material *)oops->id, ob->actcol);
- allqueue(REDRAWBUTSSHADING, 0);
- scrarea_queue_winredraw(curarea);
- }
- break;
-
- case ID_IM:
- if(oops->id && G.sima) {
- /* only set if the new image isnt alredy active */
- if ((ID *)G.sima->image != oops->id) {
- G.sima->image = (Image *)oops->id;
- allqueue(REDRAWIMAGE, 0);
- scrarea_queue_winredraw(curarea);
- }
- }
- break;
- /*
- case ID_IP:
- if(oops->id && G.sipo) {
- *//* only set if the new ipo isnt alredy active *//*
- if ((ID *)G.sipo->ipo != oops->id) {
- G.sipo->ipo = (Ipo *)oops->id;
- allqueue(REDRAWIPO, 0);
- scrarea_queue_winredraw(curarea);
- }
- }
- break;
- */
- }
-}
-
-void mouse_select_oops(void)
-{
- Oops *oops;
- extern float oopslastx, oopslasty; /* oops.c */
-
- if(G.soops==0) return;
-
- /* which oopses... */
- oops= G.soops->oops.first;
-
- oops= find_nearest_oops();
- if(oops==0) return;
-
- if((G.qual & LR_SHIFTKEY)==0) deselect_all_oops();
-
- if(oops) {
- /* last_seq= seq; */
-
- if(G.qual==0) {
- oops->flag |= SELECT;
- }
- else {
- if(oops->flag & SELECT) {
- oops->flag &= ~SELECT;
- }
- else {
- oops->flag |= SELECT;
- }
- }
-
- oopslastx= oops->x;
- oopslasty= oops->y;
-
- if(G.qual & LR_CTRLKEY) do_activate_oops(oops);
- G.soops->lockpoin= oops;
- }
-
- oops_to_select_objects(); /* also redraw */
- scrarea_queue_headredraw(curarea);
-
- force_draw(1);
-
- std_rmouse_transform(transform_oops);
-}
-
-void borderselect_oops(void)
-{
- Oops *oops;
- rcti rect;
- rctf rectf, rq;
- int val;
- short mval[2];
-
- if(G.soops==0) return;
-
- val= get_border(&rect, 3);
-
- if(val) {
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide == 0) {
-
- rq.xmin= oops->x;
- rq.xmax= oops->x+OOPSX;
- rq.ymin= oops->y;
- rq.ymax= oops->y+OOPSY;
-
- if(BLI_isect_rctf(&rq, &rectf, 0)) {
- if(val==LEFTMOUSE) {
- oops->flag |= SELECT;
- }
- else {
- oops->flag &= ~SELECT;
- }
- }
- }
- oops= oops->next;
- }
-
- oops_to_select_objects(); /* also redraw */
- }
-}
-
-static void select_oops_lib(ID *id)
-{
- Oops *oops;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->id->lib== (Library *)id) oops->flag |= OOPS_DOSELECT;
- }
- oops= oops->next;
- }
-}
-
-void select_linked_oops(void)
-{
- Oops *oops;
- OopsLink *ol;
-
- if(G.soops==0) return;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & SELECT) {
- if(oops->type==ID_LI) select_oops_lib(oops->id);
- ol= oops->link.first;
- while(ol) {
- if(ol->to && ol->to->hide==0) ol->to->flag |= OOPS_DOSELECT;
- ol= ol->next;
- }
- }
- }
- oops= oops->next;
- }
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & OOPS_DOSELECT) {
- oops->flag |= SELECT;
- oops->flag &= ~OOPS_DOSELECT;
- }
- }
- oops= oops->next;
- }
-
- oops_to_select_objects(); /* also redraw */
-
-}
-
-void select_backlinked_oops(void)
-{
- Oops *oops;
- OopsLink *ol;
-
- if(G.soops==0) return;
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if( (oops->flag & SELECT)==0) {
- ol= oops->link.first;
- while(ol) {
- if(ol->to && ol->to->hide==0) {
- if(ol->to->flag & SELECT) oops->flag |= OOPS_DOSELECT;
- }
- ol= ol->next;
- }
- }
- }
- oops= oops->next;
- }
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- if(oops->flag & OOPS_DOSELECT) {
- oops->flag |= SELECT;
- oops->flag &= ~OOPS_DOSELECT;
- }
- }
- oops= oops->next;
- }
-
- oops_to_select_objects(); /* also redraw */
-
-}
-
-
-void clever_numbuts_oops()
-{
- Oops *oops;
- Object *ob;
- char str1[10];
- static char naam[256];
- static char naam2[256];
- static short doit;
- int len;
-
- if(G.soops->lockpoin) {
- oops= G.soops->lockpoin;
- ob = (Object *)oops->id;
- if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
- else strcpy(naam, oops->id->name);
-
- strcpy(naam2, naam+2);
- str1[0]= oops->id->name[0];
- str1[1]= oops->id->name[1];
- str1[2]= ':';
- str1[3]= 0;
- if(strcmp(str1, "SC:")==0) strcpy(str1, "SCE:");
- else if(strcmp(str1, "SR:")==0) strcpy(str1, "SCR:");
-
-// if( GS(id->name)==ID_IP) len= 110;
-// else len= 120;
- len = 110;
-
- add_numbut(0, TEX, str1, 0, len, naam2, "Rename Object");
- if((oops->type==ID_OB || oops->type==ID_ME) && ob->type != OB_EMPTY) {
- // add_numbut(1, TEX, str1, 0, len, naam2, "Name Object");
- add_numbut(1, TOG|SHO, "Rename Linked Data", 0, 0, &doit, "Rename corresponding Datablock as well");
- do_clever_numbuts("Rename Datablock", 2, REDRAW);
- } else {
- do_clever_numbuts("Rename Datablock", 1, REDRAW);
- }
-
- rename_id((ID *)oops->id, naam2);
- }
-}
diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c
deleted file mode 100644
index 21192d50333..00000000000
--- a/source/blender/src/editparticle.c
+++ /dev/null
@@ -1,3194 +0,0 @@
-/* editparticle.c
- *
- *
- * $Id: editparticle.c $
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 by Janne Karhu.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_bad_level_calls.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_depsgraph.h"
-
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#include "BSE_edit.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-#include "BLI_kdtree.h"
-#include "BLI_rand.h"
-
-#include "PIL_time.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_editparticle.h"
-#include "BIF_editview.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_radialcontrol.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_view.h"
-
-#include "BDR_editobject.h" //rightmouse_transform()
-#include "BDR_drawobject.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-static void ParticleUndo_clear(ParticleSystem *psys);
-
-#define LOOP_PARTICLES(i,pa) for(i=0, pa=psys->particles; i<totpart; i++, pa++)
-#define LOOP_KEYS(k,key) if(psys->edit)for(k=0, key=psys->edit->keys[i]; k<pa->totkey; k++, key++)
-
-void PE_free_particle_edit(ParticleSystem *psys)
-{
- ParticleEdit *edit=psys->edit;
- int i, totpart=psys->totpart;
-
- if(edit==0) return;
-
- ParticleUndo_clear(psys);
-
- if(edit->keys){
- for(i=0; i<totpart; i++){
- if(edit->keys[i])
- MEM_freeN(edit->keys[i]);
- }
- MEM_freeN(edit->keys);
- }
-
- if(edit->mirror_cache)
- MEM_freeN(edit->mirror_cache);
-
- if(edit->emitter_cosnos){
- MEM_freeN(edit->emitter_cosnos);
- edit->emitter_cosnos=0;
- }
-
- if(edit->emitter_field){
- BLI_kdtree_free(edit->emitter_field);
- edit->emitter_field=0;
- }
-
- MEM_freeN(edit);
-
- psys->edit=NULL;
-}
-/************************************************/
-/* Edit Mode Helpers */
-/************************************************/
-int PE_can_edit(ParticleSystem *psys)
-{
- return (psys && psys->edit && (G.f & G_PARTICLEEDIT));
-}
-
-ParticleEditSettings *PE_settings()
-{
- return &G.scene->toolsettings->particle;
-}
-
-void PE_change_act(void *ob_v, void *act_v)
-{
- Object *ob = ob_v;
- ParticleSystem *psys;
- short act = *((short*)act_v) - 1;
-
- if((psys=psys_get_current(ob)))
- psys->flag &= ~PSYS_CURRENT;
-
- if(act>=0){
- if((psys=BLI_findlink(&ob->particlesystem,act))) {
- psys->flag |= PSYS_CURRENT;
-
- if(psys_check_enabled(ob, psys)) {
- if(G.f & G_PARTICLEEDIT && !psys->edit)
- PE_create_particle_edit(ob, psys);
- PE_recalc_world_cos(ob, psys);
- }
- }
- }
-}
-
-/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */
-ParticleSystem *PE_get_current(Object *ob)
-{
- ParticleSystem *psys;
-
- if(ob==NULL)
- return NULL;
-
- psys= ob->particlesystem.first;
- while(psys){
- if(psys->flag & PSYS_CURRENT)
- break;
- psys=psys->next;
- }
-
- if(psys==NULL && ob->particlesystem.first){
- psys=ob->particlesystem.first;
- psys->flag |= PSYS_CURRENT;
- }
-
- if(psys && psys_check_enabled(ob, psys) && ob == OBACT && (G.f & G_PARTICLEEDIT))
- if(psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED)
- if(psys->edit == NULL)
- PE_create_particle_edit(ob, psys);
-
- return psys;
-}
-/* returns -1 if no system has PSYS_CURRENT flag */
-short PE_get_current_num(Object *ob)
-{
- short num=0;
- ParticleSystem *psys = ob->particlesystem.first;
-
- while(psys){
- if(psys->flag & PSYS_CURRENT)
- return num;
- num++;
- psys=psys->next;
- }
-
- return -1;
-}
-
-void PE_hide_keys_time(ParticleSystem *psys, float cfra)
-{
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleEditSettings *pset=PE_settings();
- int i,k,totpart=psys->totpart;
-
- if(pset->draw_timed && G.scene->selectmode==SCE_SELECT_POINT){
- LOOP_PARTICLES(i,pa){
- LOOP_KEYS(k,key){
- if(fabs(cfra-*key->time) < pset->draw_timed)
- key->flag &= ~PEK_HIDE;
- else{
- key->flag |= PEK_HIDE;
- key->flag &= ~PEK_SELECT;
- }
- }
- }
- }
- else{
- LOOP_PARTICLES(i,pa){
- LOOP_KEYS(k,key){
- key->flag &= ~PEK_HIDE;
- }
- }
- }
-}
-
-static int key_inside_circle(short mco[2], float rad, float co[3], float *distance)
-{
- float dx,dy,dist;
- short vertco[2];
-
- project_short(co,vertco);
-
- if (vertco[0]==IS_CLIPPED)
- return 0;
-
- dx=(float)(mco[0]-vertco[0]);
- dy=(float)(mco[1]-vertco[1]);
- dist=(float)sqrt((double)(dx*dx + dy*dy));
-
- if(dist<=rad){
- if(distance) *distance=dist;
- return 1;
- }
- else
- return 0;
-}
-static int key_inside_rect(rcti *rect, float co[3])
-{
- short vertco[2];
-
- project_short(co,vertco);
-
- if (vertco[0]==IS_CLIPPED)
- return 0;
-
- if(vertco[0] > rect->xmin && vertco[0] < rect->xmax &&
- vertco[1] > rect->ymin && vertco[1] < rect->ymax)
- return 1;
- else
- return 0;
-}
-static int test_key_depth(float *co, bglMats *mats){
- double ux, uy, uz;
- float depth;
- short wco[3], x,y;
-
- if((G.vd->drawtype<=OB_WIRE) || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 1;
-
- gluProject(co[0],co[1],co[2], mats->modelview, mats->projection,
- (GLint *)mats->viewport, &ux, &uy, &uz );
-
- project_short(co,wco);
-
- if (wco[0]==IS_CLIPPED)
- return 0;
-
- x=wco[0];
- y=wco[1];
-
- if(G.vd->depths && x<G.vd->depths->w && y<G.vd->depths->h){
- /* the 0.0001 is an experimental threshold to make selecting keys right next to a surface work better */
- if((float)uz - 0.0001 > G.vd->depths->depths[y*G.vd->depths->w+x])
- return 0;
- else
- return 1;
- }
- else{
- x+= (short)curarea->winrct.xmin;
- y+= (short)curarea->winrct.ymin;
-
- glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
-
- if((float)uz - 0.0001 > depth)
- return 0;
- else
- return 1;
- }
-}
-
-static int particle_is_selected(ParticleSystem *psys, ParticleData *pa)
-{
- ParticleEditKey *key;
- int sel, i, k;
-
- if(pa->flag&PARS_HIDE) return 0;
-
- sel=0;
- i= pa - psys->particles;
- LOOP_KEYS(k,key)
- if(key->flag&PEK_SELECT)
- return 1;
-
- return 0;
-}
-
-/*-----iterators over editable particles-----*/
-static void for_mouse_hit_keys(int nearest, ParticleSystem *psys, void (*func)(ParticleSystem *psys, int pa_index, int key_index, void *userData), void *userData){
- /* these are allways the first in this userData */
- struct { short *mval; float rad; rcti *rect;} *data = userData;
- ParticleData *pa;
- ParticleEditKey *key;
- bglMats mats;
- int i,k, totpart, nearest_pa=-1, nearest_key=-1;
- float dist=data->rad;
-
- if(psys==0 || G.scene->selectmode==SCE_SELECT_PATH) return;
-
- totpart=psys->totpart;
-
- bgl_get_mats(&mats);
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
-
- if(G.scene->selectmode==SCE_SELECT_END){
- key=psys->edit->keys[i]+pa->totkey-1;
-
- if(nearest){
- if(key_inside_circle(data->mval,dist,key->world_co,&dist) && test_key_depth(key->world_co,&mats)){
- nearest_pa=i;
- nearest_key=pa->totkey-1;
- }
- }
- else if(((data->mval)?
- key_inside_circle(data->mval,data->rad,key->world_co,0):
- key_inside_rect(data->rect,key->world_co)) && test_key_depth(key->world_co,&mats))
- func(psys,i,pa->totkey-1,userData);
- }
- else{
- key=psys->edit->keys[i];
-
- LOOP_KEYS(k,key){
- if(key->flag&PEK_HIDE) continue;
-
- if(nearest){
- if(key_inside_circle(data->mval,dist,key->world_co,&dist) && test_key_depth(key->world_co,&mats)){
- nearest_pa=i;
- nearest_key=k;
- }
- }
- else if(((data->mval)?
- key_inside_circle(data->mval,data->rad,key->world_co,0):
- key_inside_rect(data->rect,key->world_co)) && test_key_depth(key->world_co,&mats))
- func(psys,i,k,userData);
- }
- }
- }
- if(nearest && nearest_pa>-1){
- func(psys,nearest_pa,nearest_key,userData);
- }
-}
-static void foreach_mouse_hit_element(int selected, ParticleSystem *psys,void (*func)(ParticleSystem *psys, int index, void *userData), void *userData){
- /* these are allways the first in this userData */
- struct { short *mval; float rad; rcti* rect; float dist;} *data = userData;
- ParticleData *pa;
- ParticleEditKey *key;
- bglMats mats;
- int i,k, totpart;
-
- if(psys==0) return;
-
- totpart=psys->totpart;
-
- bgl_get_mats(&mats);
-
- if(G.scene->selectmode==SCE_SELECT_PATH)
- selected=0;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
-
- if(G.scene->selectmode==SCE_SELECT_END){
- key=psys->edit->keys[i]+pa->totkey-1;
- if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats))
- func(psys,i,userData);
- }
- else{
- LOOP_KEYS(k,key){
- if(key->flag&PEK_HIDE) continue;
-
- if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)){
- func(psys,i,userData);
- break;
- }
- }
- }
- }
-}
-static void foreach_mouse_hit_key(int selected, ParticleSystem *psys,void (*func)(ParticleSystem *psys, float mat[][4], float imat[][4], int bel_index, int key_index, void *userData), void *userData){
- /* these are allways the first in this userData */
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist;} *data = userData;
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleSystemModifierData *psmd=0;
- bglMats mats;
- int i,k, totpart;
- float mat[4][4], imat[4][4];
-
- if(psys==0) return;
-
- psmd=psys_get_modifier(data->ob,psys);
-
- totpart=psys->totpart;
-
- bgl_get_mats(&mats);
-
- if(G.scene->selectmode==SCE_SELECT_PATH)
- selected=0;
-
- Mat4One(imat);
- Mat4One(mat);
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
-
- psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, pa, mat);
- //psys_geometry_mat(psmd->dm,pa,tmat);
- //Mat4MulMat4(mat,tmat,data->ob->obmat);
- Mat4Invert(imat,mat);
-
- if(G.scene->selectmode==SCE_SELECT_END){
- key=psys->edit->keys[i]+pa->totkey-1;
- if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats))
- func(psys,mat,imat,i,pa->totkey-1,userData);
- }
- else{
- LOOP_KEYS(k,key){
- if(key->flag&PEK_HIDE) continue;
-
- if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)){
- func(psys,mat,imat,i,k,userData);
- }
- }
- }
- }
-}
-static void foreach_selected_element(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int index, void *userData), void *userData){
- ParticleData *pa;
- int i,totpart;
-
- if(psys==0) return;
-
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa)
- if(particle_is_selected(psys, pa))
- func(psys,i,userData);
-}
-static void foreach_selected_key(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int pa_index, int key_index, void *userData), void *userData){
- ParticleData *pa;
- ParticleEditKey *key;
- int i,k,totpart;
-
- if(psys==0) return;
-
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag&PARS_HIDE) continue;
-
- key=psys->edit->keys[i];
- LOOP_KEYS(k,key){
- if(key->flag&PEK_SELECT)
- func(psys,i,k,userData);
- }
- }
-}
-void PE_foreach_element(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int index, void *userData), void *userData)
-{
- int i,totpart;
-
- if(psys==0) return;
-
- totpart=psys->totpart;
-
- for(i=0; i<totpart; i++)
- func(psys,i,userData);
-}
-static int count_selected_keys(ParticleSystem *psys)
-{
- ParticleData *pa;
- ParticleEditKey *key;
- int i,k,totpart,sel=0;
-
- if(psys==0) return 0;
-
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag&PARS_HIDE) continue;
-
- key=psys->edit->keys[i];
- if(G.scene->selectmode==SCE_SELECT_POINT){
- for(k=0; k<pa->totkey; k++,key++){
- if(key->flag&PEK_SELECT)
- sel++;
- }
- }
- else if(G.scene->selectmode==SCE_SELECT_END){
- key+=pa->totkey-1;
- if(key->flag&PEK_SELECT)
- sel++;
- }
- }
- return sel;
-}
-
-/************************************************/
-/* Particle Edit Mirroring */
-/************************************************/
-
-static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleSystemModifierData *psmd;
- KDTree *tree;
- KDTreeNearest nearest;
- float mat[4][4], co[3];
- int i, index, totpart;
-
- edit= psys->edit;
- psmd= psys_get_modifier(ob, psys);
- totpart= psys->totpart;
-
- tree= BLI_kdtree_new(totpart);
-
- /* insert particles into kd tree */
- LOOP_PARTICLES(i,pa) {
- psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
- BLI_kdtree_insert(tree, i, co, NULL);
- }
-
- BLI_kdtree_balance(tree);
-
- /* lookup particles and set in mirror cache */
- if(!edit->mirror_cache)
- edit->mirror_cache= MEM_callocN(sizeof(int)*totpart, "PE mirror cache");
-
- LOOP_PARTICLES(i,pa) {
- psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
- co[0]= -co[0];
-
- index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest);
-
- /* this needs a custom threshold still, duplicated for editmode mirror */
- if(index != -1 && index != i && (nearest.dist <= 0.0002f))
- edit->mirror_cache[i]= index;
- else
- edit->mirror_cache[i]= -1;
- }
-
- /* make sure mirrors are in two directions */
- LOOP_PARTICLES(i,pa) {
- if(edit->mirror_cache[i]) {
- index= edit->mirror_cache[i];
- if(edit->mirror_cache[index] != i)
- edit->mirror_cache[i]= -1;
- }
- }
-
- BLI_kdtree_free(tree);
-}
-
-static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa)
-{
- HairKey *hkey, *mhkey;
- ParticleEditKey *key, *mkey;
- ParticleEdit *edit;
- float mat[4][4], mmat[4][4], immat[4][4];
- int i, mi, k;
-
- edit= psys->edit;
- i= pa - psys->particles;
-
- /* find mirrored particle if needed */
- if(!mpa) {
- if(!edit->mirror_cache)
- PE_update_mirror_cache(ob, psys);
-
- mi= edit->mirror_cache[i];
- if(mi == -1)
- return;
- mpa= psys->particles + mi;
- }
- else
- mi= mpa - psys->particles;
-
- /* make sure they have the same amount of keys */
- if(pa->totkey != mpa->totkey) {
- if(mpa->hair) MEM_freeN(mpa->hair);
- if(edit->keys[mi]) MEM_freeN(edit->keys[mi]);
-
- mpa->hair= MEM_dupallocN(pa->hair);
- edit->keys[mi]= MEM_dupallocN(edit->keys[i]);
- mpa->totkey= pa->totkey;
-
- mhkey= mpa->hair;
- mkey= edit->keys[mi];
- for(k=0; k<mpa->totkey; k++, mkey++, mhkey++) {
- mkey->co= mhkey->co;
- mkey->time= &mhkey->time;
- mkey->flag &= PEK_SELECT;
- }
- }
-
- /* mirror positions and tags */
- psys_mat_hair_to_orco(ob, dm, psys->part->from, pa, mat);
- psys_mat_hair_to_orco(ob, dm, psys->part->from, mpa, mmat);
- Mat4Invert(immat, mmat);
-
- hkey=pa->hair;
- mhkey=mpa->hair;
- key= edit->keys[i];
- mkey= edit->keys[mi];
- for(k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
- VECCOPY(mhkey->co, hkey->co);
- Mat4MulVecfl(mat, mhkey->co);
- mhkey->co[0]= -mhkey->co[0];
- Mat4MulVecfl(immat, mhkey->co);
-
- if(key->flag & PEK_TAG)
- mkey->flag |= PEK_TAG;
- }
-
- if(pa->flag & PARS_TAG)
- mpa->flag |= PARS_TAG;
- if(pa->flag & PARS_EDIT_RECALC)
- mpa->flag |= PARS_EDIT_RECALC;
-}
-
-static void PE_apply_mirror(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleSystemModifierData *psmd;
- int i, totpart;
-
- edit= psys->edit;
- psmd= psys_get_modifier(ob, psys);
- totpart= psys->totpart;
-
- /* we delay settings the PARS_EDIT_RECALC for mirrored particles
- * to avoid doing mirror twice */
- LOOP_PARTICLES(i,pa) {
- if(pa->flag & PARS_EDIT_RECALC) {
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
-
- if(edit->mirror_cache[i] != -1)
- psys->particles[edit->mirror_cache[i]].flag &= ~PARS_EDIT_RECALC;
- }
- }
-
- LOOP_PARTICLES(i,pa)
- if(pa->flag & PARS_EDIT_RECALC)
- if(edit->mirror_cache[i] != -1)
- psys->particles[edit->mirror_cache[i]].flag |= PARS_EDIT_RECALC;
-
- edit->totkeys= psys_count_keys(psys);
-}
-
-/************************************************/
-/* Edit Calculation */
-/************************************************/
-/* tries to stop edited particles from going through the emitter's surface */
-static void PE_deflect_emitter(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleEditSettings *pset = PE_settings();
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- int i,k,totpart,index;
- float *vec, *nor, dvec[3], dot, dist_1st;
- float hairimat[4][4], hairmat[4][4];
-
- if(psys==0)
- return;
-
- if((pset->flag & PE_DEFLECT_EMITTER)==0)
- return;
-
- edit=psys->edit;
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, hairmat);
-
- LOOP_KEYS(k,key){
- Mat4MulVecfl(hairmat, key->co);
- }
- //}
-
- //LOOP_PARTICLES(i,pa){
- key=psys->edit->keys[i]+1;
-
- dist_1st=VecLenf((key-1)->co,key->co);
- dist_1st*=0.75f*pset->emitterdist;
-
- for(k=1; k<pa->totkey; k++, key++){
- index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL);
-
- vec=edit->emitter_cosnos +index*6;
- nor=vec+3;
-
- VecSubf(dvec, key->co, vec);
-
- dot=Inpf(dvec,nor);
- VECCOPY(dvec,nor);
-
- if(dot>0.0f){
- if(dot<dist_1st){
- Normalize(dvec);
- VecMulf(dvec,dist_1st-dot);
- VecAddf(key->co,key->co,dvec);
- }
- }
- else{
- Normalize(dvec);
- VecMulf(dvec,dist_1st-dot);
- VecAddf(key->co,key->co,dvec);
- }
- if(k==1)
- dist_1st*=1.3333f;
- }
- //}
-
- //LOOP_PARTICLES(i,pa){
-
- Mat4Invert(hairimat,hairmat);
-
- LOOP_KEYS(k,key){
- Mat4MulVecfl(hairimat, key->co);
- }
- }
-}
-/* force set distances between neighbouring keys */
-void PE_apply_lengths(ParticleSystem *psys)
-{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleEditSettings *pset=PE_settings();
- int i,k,totpart;
- float dv1[3];
-
- if(psys==0)
- return;
-
- if((pset->flag & PE_KEEP_LENGTHS)==0)
- return;
-
- edit=psys->edit;
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- for(k=1, key=edit->keys[i] + 1; k<pa->totkey; k++, key++){
- VecSubf(dv1, key->co, (key - 1)->co);
- Normalize(dv1);
- VecMulf(dv1, (key - 1)->length);
- VecAddf(key->co, (key - 1)->co, dv1);
- }
- }
-}
-/* try to find a nice solution to keep distances between neighbouring keys */
-static void PE_iterate_lengths(ParticleSystem *psys)
-{
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
- ParticleEditSettings *pset=PE_settings();
- int i, j, k,totpart;
- float tlen;
- float dv0[3] = {0.0f, 0.0f, 0.0f};
- float dv1[3] = {0.0f, 0.0f, 0.0f};
- float dv2[3] = {0.0f, 0.0f, 0.0f};
-
- if(psys==0)
- return;
-
- if((pset->flag & PE_KEEP_LENGTHS)==0)
- return;
-
- edit=psys->edit;
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(!(pa->flag & PARS_EDIT_RECALC))
- continue;
-
- for(j=1; j<pa->totkey; j++){
- float mul = 1.0f / (float)pa->totkey;
-
- if(pset->flag & PE_LOCK_FIRST){
- key = edit->keys[i] + 1;
- k = 1;
- dv1[0] = dv1[1] = dv1[2] = 0.0;
- }
- else{
- key = edit->keys[i];
- k = 0;
- dv0[0] = dv0[1] = dv0[2] = 0.0;
- }
-
- for(; k<pa->totkey; k++, key++){
- if(k){
- VecSubf(dv0, (key - 1)->co, key->co);
- tlen = Normalize(dv0);
- VecMulf(dv0, (mul * (tlen - (key - 1)->length)));
- }
-
- if(k < pa->totkey - 1){
- VecSubf(dv2, (key + 1)->co, key->co);
- tlen = Normalize(dv2);
- VecMulf(dv2, mul * (tlen - key->length));
- }
-
- if(k){
- VecAddf((key-1)->co,(key-1)->co,dv1);
- }
-
- VECADD(dv1,dv0,dv2);
- }
- }
- }
-}
-/* set current distances to be kept between neighbouting keys */
-static void recalc_lengths(ParticleSystem *psys)
-{
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
-
- if(psys==0)
- return;
-
- totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- key = psys->edit->keys[i];
- for(k=0; k<pa->totkey-1; k++, key++){
- key->length = VecLenf(key->co, (key + 1)->co);
- }
- }
-}
-/* calculate and store key locations in world coordinates */
-void PE_recalc_world_cos(Object *ob, ParticleSystem *psys)
-{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
- ParticleData *pa;
- ParticleEditKey *key;
- int i, k, totpart;
- float hairmat[4][4];
-
- if(psys==0)
- return;
-
- totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
-
- LOOP_KEYS(k,key){
- VECCOPY(key->world_co,key->co);
- Mat4MulVecfl(hairmat, key->world_co);
- }
- }
-}
-/* calculate a tree for finding nearest emitter's vertice */
-static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
-{
- DerivedMesh *dm=psys_get_modifier(ob,psys)->dm;
- ParticleEdit *edit = psys->edit;
- MFace *mface;
- MVert *mvert;
- float *vec, *nor;
- int i, totface, totvert;
-
- if(edit->emitter_cosnos)
- MEM_freeN(edit->emitter_cosnos);
-
- BLI_kdtree_free(edit->emitter_field);
-
- totface=dm->getNumFaces(dm);
- totvert=dm->getNumVerts(dm);
-
- edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos");
-
- edit->emitter_field= BLI_kdtree_new(totface);
-
- vec=edit->emitter_cosnos;
- nor=vec+3;
-
- mvert=dm->getVertDataArray(dm,CD_MVERT);
- for(i=0; i<totface; i++, vec+=6, nor+=6){
- mface=dm->getFaceData(dm,i,CD_MFACE);
-
- mvert=dm->getVertData(dm,mface->v1,CD_MVERT);
- VECCOPY(vec,mvert->co);
- VECCOPY(nor,mvert->no);
-
- mvert=dm->getVertData(dm,mface->v2,CD_MVERT);
- VECADD(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
-
- mvert=dm->getVertData(dm,mface->v3,CD_MVERT);
- VECADD(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
-
- if (mface->v4){
- mvert=dm->getVertData(dm,mface->v4,CD_MVERT);
- VECADD(vec,vec,mvert->co);
- VECADD(nor,nor,mvert->no);
-
- VecMulf(vec,0.25);
- }
- else
- VecMulf(vec,0.3333f);
-
- Normalize(nor);
-
- BLI_kdtree_insert(edit->emitter_field, i, vec, NULL);
- }
-
- BLI_kdtree_balance(edit->emitter_field);
-}
-
-void PE_update_selection(Object *ob, int useflag)
-{
- ParticleSystem *psys= PE_get_current(ob);
- ParticleEdit *edit= psys->edit;
- ParticleEditSettings *pset= PE_settings();
- ParticleSettings *part= psys->part;
- ParticleData *pa;
- HairKey *hkey;
- ParticleEditKey *key;
- float cfra= CFRA;
- int i, k, totpart;
-
- totpart= psys->totpart;
-
- /* flag all particles to be updated if not using flag */
- if(!useflag)
- LOOP_PARTICLES(i,pa)
- pa->flag |= PARS_EDIT_RECALC;
-
- /* flush edit key flag to hair key flag to preserve selection
- * on save */
- LOOP_PARTICLES(i,pa) {
- key = edit->keys[i];
-
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++)
- hkey->editflag= key->flag;
- }
-
- psys_cache_paths(ob, psys, CFRA, 1);
-
- if(part->childtype && (pset->flag & PE_SHOW_CHILD))
- psys_cache_child_paths(ob, psys, cfra, 1);
-
- /* disable update flag */
- LOOP_PARTICLES(i,pa)
- pa->flag &= ~PARS_EDIT_RECALC;
-}
-
-void PE_update_object(Object *ob, int useflag)
-{
- ParticleSystem *psys= PE_get_current(ob);
- ParticleEditSettings *pset= PE_settings();
- ParticleSettings *part= psys->part;
- ParticleData *pa;
- float cfra= CFRA;
- int i, totpart= psys->totpart;
-
- /* flag all particles to be updated if not using flag */
- if(!useflag)
- LOOP_PARTICLES(i,pa)
- pa->flag |= PARS_EDIT_RECALC;
-
- /* do post process on particle edit keys */
- PE_iterate_lengths(psys);
- PE_deflect_emitter(ob,psys);
- PE_apply_lengths(psys);
- if(pset->flag & PE_X_MIRROR)
- PE_apply_mirror(ob,psys);
- PE_recalc_world_cos(ob,psys);
- PE_hide_keys_time(psys,cfra);
-
- /* regenerate path caches */
- psys_cache_paths(ob, psys, cfra, 1);
-
- if(part->childtype && (pset->flag & PE_SHOW_CHILD))
- psys_cache_child_paths(ob, psys, cfra, 1);
-
- /* disable update flag */
- LOOP_PARTICLES(i,pa)
- pa->flag &= ~PARS_EDIT_RECALC;
-}
-
-/* initialize needed data for bake edit */
-void PE_create_particle_edit(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit=psys->edit;
- ParticleData *pa;
- ParticleEditKey *key;
- HairKey *hkey;
- int i,k, totpart=psys->totpart, alloc=1;
-
- if((psys->flag & PSYS_EDITED)==0)
- return;
-
- if(edit){
- int newtotkeys = psys_count_keys(psys);
- if(newtotkeys == edit->totkeys)
- alloc=0;
- }
-
- if(alloc){
- if(edit){
- error("ParticleEdit exists allready! Poke jahka!");
- PE_free_particle_edit(psys);
- }
-
- edit=psys->edit=MEM_callocN(sizeof(ParticleEdit), "PE_create_particle_edit");
-
- edit->keys=MEM_callocN(totpart*sizeof(ParticleEditKey*),"ParticleEditKey array");
-
- LOOP_PARTICLES(i,pa){
- key = edit->keys[i] = MEM_callocN(pa->totkey*sizeof(ParticleEditKey),"ParticleEditKeys");
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, key++){
- key->co = hkey->co;
- key->time = &hkey->time;
- key->flag= hkey->editflag;
- }
- }
-
- edit->totkeys = psys_count_keys(psys);
- }
-
- recalc_lengths(psys);
- recalc_emitter_field(ob, psys);
- PE_recalc_world_cos(ob, psys);
-
- if(alloc) {
- ParticleUndo_clear(psys);
- PE_undo_push("Original");
- }
-}
-
-/* toggle particle mode on & off */
-void PE_set_particle_edit(void)
-{
- Object *ob= OBACT;
- ParticleSystem *psys = PE_get_current(ob);
-
- scrarea_queue_headredraw(curarea);
-
- //if(!ob || ob->id.lib) return; /* is the id.lib test needed? -jahka*/
- if(ob==0 || psys==0) return;
-
- if(psys==0){
- if(ob->particlesystem.first){
- psys=ob->particlesystem.first;
- psys->flag |= PSYS_CURRENT;
- }
- else
- return;
- }
-
- if((G.f & G_PARTICLEEDIT)==0){
- if(psys && psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) {
- if(psys_check_enabled(ob, psys)) {
- if(psys->edit==0)
- PE_create_particle_edit(ob, psys);
- PE_recalc_world_cos(ob, psys);
- }
- }
-
- G.f |= G_PARTICLEEDIT;
- }
- else{
- G.f &= ~G_PARTICLEEDIT;
- }
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1); /* including header */
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-/************************************************/
-/* Edit Selections */
-/************************************************/
-/*-----selection callbacks-----*/
-static void select_key(ParticleSystem *psys, int pa_index, int key_index, void *userData)
-{
- struct { short *mval; float rad; rcti* rect; int select; } *data = userData;
- ParticleData *pa = psys->particles + pa_index;
- ParticleEditKey *key = psys->edit->keys[pa_index] + key_index;
-
- if(data->select)
- key->flag|=PEK_SELECT;
- else
- key->flag&=~PEK_SELECT;
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void select_keys(ParticleSystem *psys, int pa_index, int key_index, void *userData)
-{
- struct { short *mval; float rad; rcti* rect; int select; } *data = userData;
- ParticleData *pa = psys->particles + pa_index;
- ParticleEditKey *key = psys->edit->keys[pa_index];
- int k;
-
- for(k=0; k<pa->totkey; k++,key++){
- if(data->select)
- key->flag|=PEK_SELECT;
- else
- key->flag&=~PEK_SELECT;
- }
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void toggle_key_select(ParticleSystem *psys, int pa_index, int key_index, void *userData)
-{
- ParticleData *pa = psys->particles + pa_index;
-
- if(psys->edit->keys[pa_index][key_index].flag&PEK_SELECT)
- psys->edit->keys[pa_index][key_index].flag&=~PEK_SELECT;
- else
- psys->edit->keys[pa_index][key_index].flag|=PEK_SELECT;
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void select_root(ParticleSystem *psys, int index, void *userData)
-{
- psys->edit->keys[index]->flag |= PEK_SELECT;
-}
-
-static void select_tip(ParticleSystem *psys, int index, void *userData)
-{
- ParticleData *pa = psys->particles + index;
- ParticleEditKey *key = psys->edit->keys[index] + pa->totkey-1;
-
- key->flag |= PEK_SELECT;
-}
-static void select_more_keys(ParticleSystem *psys, int index, void *userData)
-{
- ParticleEdit *edit = psys->edit;
- ParticleData *pa = psys->particles+index;
- ParticleEditKey *key;
- int k;
-
- for(k=0,key=edit->keys[index]; k<pa->totkey; k++,key++){
- if(key->flag&PEK_SELECT) continue;
-
- if(k==0){
- if((key+1)->flag&PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
- }
- else if(k==pa->totkey-1){
- if((key-1)->flag&PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
- }
- else{
- if(((key-1)->flag | (key+1)->flag) & PEK_SELECT)
- key->flag |= PEK_TO_SELECT;
- }
- }
-
- for(k=0,key=edit->keys[index]; k<pa->totkey; k++,key++){
- if(key->flag&PEK_TO_SELECT){
- key->flag &= ~PEK_TO_SELECT;
- key->flag |= PEK_SELECT;
- }
- }
-}
-
-static void select_less_keys(ParticleSystem *psys, int index, void *userData)
-{
- ParticleEdit *edit = psys->edit;
- ParticleData *pa = psys->particles+index;
- ParticleEditKey *key;
- int k;
-
- for(k=0,key=edit->keys[index]; k<pa->totkey; k++,key++){
- if((key->flag&PEK_SELECT)==0) continue;
-
- if(k==0){
- if(((key+1)->flag&PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
- }
- else if(k==pa->totkey-1){
- if(((key-1)->flag&PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
- }
- else{
- if((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0)
- key->flag |= PEK_TO_SELECT;
- }
- }
-
- for(k=0,key=edit->keys[index]; k<pa->totkey; k++,key++){
- if(key->flag&PEK_TO_SELECT)
- key->flag &= ~(PEK_TO_SELECT|PEK_SELECT);
- }
-}
-
-/*-----using above callbacks-----*/
-void PE_deselectall(void)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit = 0;
- ParticleData *pa;
- ParticleEditKey *key;
- int i,k,totpart, sel = 0;
-
- if(!PE_can_edit(psys)) return;
-
- edit = psys->edit;
-
- totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k,key){
- if(key->flag&PEK_SELECT){
- sel = 1;
- key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
-
- if(sel==0){
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k,key){
- if(!(key->flag & PEK_SELECT)) {
- key->flag |= PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
- }
-
- PE_update_selection(ob, 1);
-
- BIF_undo_push("(De)select all keys");
- allqueue(REDRAWVIEW3D, 1);
-}
-void PE_mouse_particles(void)
-{
- struct { short *mval; float rad; rcti* rect; int select; } data;
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit = 0;
- ParticleData *pa;
- ParticleEditKey *key;
- short mval[2];
- int i,k,totpart;
-
- if(!PE_can_edit(psys)) return;
-
- edit = psys->edit;
-
- totpart = psys->totpart;
-
- bglFlush();
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
- persp(PERSP_VIEW);
-
- if(G.qual != LR_SHIFTKEY)
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
- LOOP_KEYS(k,key){
- if(key->flag & PEK_SELECT) {
- key->flag &= ~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
-
- getmouseco_areawin(mval);
-
- data.mval=mval;
- data.rad=75.0f;
- data.rect=0;
- data.select=0;
-
- for_mouse_hit_keys(1,psys,toggle_key_select,&data);
-
- PE_update_selection(ob, 1);
-
- rightmouse_transform();
-
- allqueue(REDRAWVIEW3D, 1);
-}
-void PE_select_root()
-{
- Object *ob=OBACT;
- ParticleSystem *psys = PE_get_current(ob);
-
- if(!PE_can_edit(psys)) return;
-
- PE_foreach_element(psys,select_root,NULL);
- BIF_undo_push("Select first");
-}
-void PE_select_tip()
-{
- Object *ob=OBACT;
- ParticleSystem *psys = PE_get_current(ob);
-
- if(!PE_can_edit(psys)) return;
-
- PE_foreach_element(psys,select_tip,NULL);
- BIF_undo_push("Select last");
-}
-void PE_select_linked(void)
-{
- struct { short *mval; float rad; rcti* rect; int select; } data;
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- short mval[2];
-
- if(!PE_can_edit(psys)) return;
-
- getmouseco_areawin(mval);
-
- data.mval=mval;
- data.rad=75.0f;
- data.rect=0;
- data.select=(G.qual != LR_SHIFTKEY);
-
- for_mouse_hit_keys(1,psys,select_keys,&data);
-
- PE_update_selection(ob, 1);
-
- BIF_undo_push("Select linked keys");
-
- allqueue(REDRAWVIEW3D, 1);
- return;
-}
-void PE_borderselect(void)
-{
- struct { short *mval; float rad; rcti* rect; int select; } data;
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- rcti rect;
- int val;
-
- if(!PE_can_edit(psys)) return;
-
- setlinestyle(2);
- val= get_border(&rect, 3);
- setlinestyle(0);
-
- if(val==0) return;
-
- data.mval=0;
- data.rect=&rect;
- data.select=(val==LEFTMOUSE);
-
- for_mouse_hit_keys(0,psys,select_key,&data);
-
- PE_update_selection(ob, 1);
-
- BIF_undo_push("Select keys");
-
- allqueue(REDRAWVIEW3D, 1);
- return;
-}
-void PE_selectionCB(short selecting, Object *editobj, short *mval, float rad)
-{
- struct { short *mval; float rad; rcti* rect; int select; } data;
- ParticleSystem *psys = PE_get_current(OBACT);
-
- if(!PE_can_edit(psys)) return;
-
- data.mval=mval;
- data.rad=rad;
- data.rect=0;
- data.select=(selecting==LEFTMOUSE);
-
- for_mouse_hit_keys(0,psys,select_key,&data);
-
- draw_sel_circle(0, 0, 0, 0, 0); /* signal */
- force_draw(0);
-}
-void PE_do_lasso_select(short mcords[][2], short moves, short select)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleSystemModifierData *psmd;
- ParticleEdit *edit;
- ParticleData *pa;
- ParticleEditKey *key;
- float co[3], mat[4][4];
- short vertco[2];
- int i, k, totpart;
-
- if(!PE_can_edit(psys)) return;
-
- psmd= psys_get_modifier(ob, psys);
- edit=psys->edit;
- totpart=psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag & PARS_HIDE) continue;
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
-
- if(G.scene->selectmode==SCE_SELECT_POINT){
- LOOP_KEYS(k,key){
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- project_short(co,vertco);
- if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])){
- if(select && !(key->flag & PEK_SELECT)) {
- key->flag|=PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- else if(key->flag & PEK_SELECT) {
- key->flag&=~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
- }
- else if(G.scene->selectmode==SCE_SELECT_END){
- key = edit->keys[i] + pa->totkey - 1;
-
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- project_short(co,vertco);
- if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])){
- if(select && !(key->flag & PEK_SELECT)) {
- key->flag|=PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- else if(key->flag & PEK_SELECT) {
- key->flag&=~PEK_SELECT;
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
- }
-
- PE_update_selection(ob, 1);
-
- BIF_undo_push("Lasso select particles");
-
- allqueue(REDRAWVIEW3D, 1);
-}
-void PE_hide(int mode)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit;
- ParticleEditKey *key;
- ParticleData *pa;
- int i, k, totpart;
-
- if(!PE_can_edit(psys)) return;
-
- edit = psys->edit;
- totpart = psys->totpart;
-
- if(mode == 0){ /* reveal all particles */
- LOOP_PARTICLES(i, pa){
- if(pa->flag & PARS_HIDE) {
- pa->flag &= ~PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
-
- LOOP_KEYS(k, key)
- key->flag |= PEK_SELECT;
- }
- }
- }
- else if(mode == 1){ /* hide unselected particles */
- LOOP_PARTICLES(i, pa) {
- if(!particle_is_selected(psys, pa)) {
- pa->flag |= PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
-
- LOOP_KEYS(k, key)
- key->flag &= ~PEK_SELECT;
- }
- }
- }
- else{ /* hide selected particles */
- LOOP_PARTICLES(i, pa) {
- if(particle_is_selected(psys, pa)) {
- pa->flag |= PARS_HIDE;
- pa->flag |= PARS_EDIT_RECALC;
-
- LOOP_KEYS(k, key)
- key->flag &= ~PEK_SELECT;
- }
- }
- }
-
- PE_update_selection(ob, 1);
- BIF_undo_push("(Un)hide elements");
-
- allqueue(REDRAWVIEW3D, 1);
-}
-void PE_select_less(void)
-{
- ParticleSystem *psys = PE_get_current(OBACT);
-
- if(!PE_can_edit(psys)) return;
-
- PE_foreach_element(psys,select_less_keys,NULL);
-
- BIF_undo_push("Select less");
- allqueue(REDRAWVIEW3D, 1);
-}
-void PE_select_more(void)
-{
- ParticleSystem *psys = PE_get_current(OBACT);
-
- if(!PE_can_edit(psys)) return;
-
- PE_foreach_element(psys,select_more_keys,NULL);
-
- BIF_undo_push("Select more");
- allqueue(REDRAWVIEW3D, 1);
-}
-/************************************************/
-/* Edit Rekey */
-/************************************************/
-static void rekey_element(ParticleSystem *psys, int index, void *userData)
-{
- struct { Object *ob; float dval; } *data = userData;
- ParticleData *pa = psys->particles + index;
- ParticleEdit *edit = psys->edit;
- ParticleEditSettings *pset = PE_settings();
- ParticleKey state;
- HairKey *key, *new_keys;
- ParticleEditKey *ekey;
- float dval, sta, end;
- int k;
-
- pa->flag |= PARS_REKEY;
-
- key = new_keys = MEM_callocN(pset->totrekey * sizeof(HairKey),"Hair re-key keys");
-
- /* root and tip stay the same */
- VECCOPY(key->co, pa->hair->co);
- VECCOPY((key + pset->totrekey - 1)->co, (pa->hair + pa->totkey - 1)->co);
-
- sta = key->time = pa->hair->time;
- end = (key + pset->totrekey - 1)->time = (pa->hair + pa->totkey - 1)->time;
- dval = (end - sta) / (float)(pset->totrekey - 1);
-
- /* interpolate new keys from old ones */
- for(k=1,key++; k<pset->totrekey-1; k++,key++) {
- state.time = (float)k / (float)(pset->totrekey-1);
- psys_get_particle_on_path(data->ob, psys, index, &state, 0);
- VECCOPY(key->co, state.co);
- key->time = sta + k * dval;
- }
-
- /* replace keys */
- if(pa->hair)
- MEM_freeN(pa->hair);
- pa->hair = new_keys;
-
- pa->totkey=pset->totrekey;
-
- if(edit->keys[index])
- MEM_freeN(edit->keys[index]);
- ekey = edit->keys[index] = MEM_callocN(pa->totkey * sizeof(ParticleEditKey),"Hair re-key edit keys");
-
- for(k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
- ekey->co = key->co;
- ekey->time = &key->time;
- }
-
- pa->flag &= ~PARS_REKEY;
- pa->flag |= PARS_EDIT_RECALC;
-}
-void PE_rekey(void)
-{
- Object *ob=OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEditSettings *pset = PE_settings();
- struct { Object *ob; float dval; } data;
-
- if(!PE_can_edit(psys)) return;
-
- data.ob = ob;
- data.dval = 1.0f / (float)(pset->totrekey-1);
-
- foreach_selected_element(psys,rekey_element,&data);
-
- psys->edit->totkeys = psys_count_keys(psys);
-
- recalc_lengths(psys);
-
- PE_update_object(ob, 1);
-
- BIF_undo_push("Re-key particles");
-}
-static void rekey_element_to_time(int index, float path_time)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit=0;
- ParticleData *pa;
- ParticleKey state;
- HairKey *new_keys, *key;
- ParticleEditKey *ekey;
- int k;
-
- if(psys==0) return;
-
- edit = psys->edit;
-
- pa = psys->particles + index;
-
- pa->flag |= PARS_REKEY;
-
- key = new_keys = MEM_dupallocN(pa->hair);
-
- /* interpolate new keys from old ones (roots stay the same) */
- for(k=1, key++; k < pa->totkey; k++, key++) {
- state.time = path_time * (float)k / (float)(pa->totkey-1);
- psys_get_particle_on_path(ob, psys, index, &state, 0);
- VECCOPY(key->co, state.co);
- }
-
- /* replace hair keys */
- if(pa->hair)
- MEM_freeN(pa->hair);
- pa->hair = new_keys;
-
- /* update edit pointers */
- for(k=0, key=pa->hair, ekey=edit->keys[index]; k<pa->totkey; k++, key++, ekey++) {
- ekey->co = key->co;
- ekey->time = &key->time;
- }
-
- pa->flag &= ~PARS_REKEY;
-}
-static int remove_tagged_elements(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit = psys->edit;
- ParticleEditSettings *pset = PE_settings();
- ParticleData *pa, *npa=0, *new_pars=0;
- ParticleEditKey **key, **nkey=0, **new_keys=0;
- ParticleSystemModifierData *psmd;
- int i, totpart, new_totpart = psys->totpart, removed = 0;
-
- if(pset->flag & PE_X_MIRROR) {
- /* mirror tags */
- psmd = psys_get_modifier(ob, psys);
- totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa)
- if(pa->flag & PARS_TAG)
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
- }
-
- for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
- if(pa->flag & PARS_TAG) {
- new_totpart--;
- removed++;
- }
- }
-
- if(new_totpart != psys->totpart) {
- if(new_totpart) {
- npa = new_pars = MEM_callocN(new_totpart * sizeof(ParticleData), "ParticleData array");
- nkey = new_keys = MEM_callocN(new_totpart * sizeof(ParticleEditKey *), "ParticleEditKey array");
- }
-
- pa = psys->particles;
- key = edit->keys;
- for(i=0; i<psys->totpart; i++, pa++, key++) {
- if(pa->flag & PARS_TAG) {
- if(*key)
- MEM_freeN(*key);
- if(pa->hair)
- MEM_freeN(pa->hair);
- }
- else {
- memcpy(npa, pa, sizeof(ParticleData));
- memcpy(nkey, key, sizeof(ParticleEditKey*));
- npa++;
- nkey++;
- }
- }
-
- if(psys->particles) MEM_freeN(psys->particles);
- psys->particles = new_pars;
-
- if(edit->keys) MEM_freeN(edit->keys);
- edit->keys = new_keys;
-
- if(edit->mirror_cache) {
- MEM_freeN(edit->mirror_cache);
- edit->mirror_cache = NULL;
- }
-
- psys->totpart = new_totpart;
-
- edit->totkeys = psys_count_keys(psys);
- }
-
- return removed;
-}
-static void remove_tagged_keys(Object *ob, ParticleSystem *psys)
-{
- ParticleEdit *edit = psys->edit;
- ParticleEditSettings *pset = PE_settings();
- ParticleData *pa;
- HairKey *key, *nkey, *new_keys=0;
- ParticleEditKey *ekey;
- ParticleSystemModifierData *psmd;
- int i, k, totpart = psys->totpart;
- short new_totkey;
-
- if(pset->flag & PE_X_MIRROR) {
- /* mirror key tags */
- psmd = psys_get_modifier(ob, psys);
-
- LOOP_PARTICLES(i,pa) {
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG) {
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
- break;
- }
- }
- }
- }
-
- LOOP_PARTICLES(i,pa) {
- new_totkey = pa->totkey;
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG)
- new_totkey--;
- }
- /* we can't have elements with less than two keys*/
- if(new_totkey < 2)
- pa->flag |= PARS_TAG;
- }
- remove_tagged_elements(ob, psys);
-
- totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa) {
- new_totkey = pa->totkey;
- LOOP_KEYS(k,ekey) {
- if(ekey->flag & PEK_TAG)
- new_totkey--;
- }
- if(new_totkey != pa->totkey) {
- key = pa->hair;
- nkey = new_keys = MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys");
-
- for(k=0, ekey=edit->keys[i]; k<new_totkey; k++, key++, nkey++, ekey++) {
- while(ekey->flag & PEK_TAG && key < pa->hair + pa->totkey) {
- key++;
- ekey++;
- }
-
- if(key < pa->hair + pa->totkey) {
- VECCOPY(nkey->co, key->co);
- nkey->time = key->time;
- nkey->weight = key->weight;
- }
- }
- if(pa->hair)
- MEM_freeN(pa->hair);
-
- pa->hair = new_keys;
-
- pa->totkey=new_totkey;
-
- if(edit->keys[i])
- MEM_freeN(edit->keys[i]);
- ekey = edit->keys[i] = MEM_callocN(new_totkey*sizeof(ParticleEditKey), "particle edit keys");
-
- for(k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) {
- ekey->co = key->co;
- ekey->time = &key->time;
- }
- }
- }
-
- edit->totkeys = psys_count_keys(psys);
-}
-/* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */
-static void subdivide_element(ParticleSystem *psys, int index, void *userData)
-{
- struct { Object *ob; } *data = userData;
- ParticleEdit *edit = psys->edit;
- ParticleData *pa = psys->particles + index;
-
- ParticleKey state;
- HairKey *key, *nkey, *new_keys;
- ParticleEditKey *ekey, *nekey, *new_ekeys;
-
- int k;
- short totnewkey=0;
- float endtime;
-
- for(k=0, ekey=edit->keys[index]; k<pa->totkey-1; k++,ekey++){
- if(ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT)
- totnewkey++;
- }
-
- if(totnewkey==0) return;
-
- pa->flag |= PARS_REKEY;
-
- nkey = new_keys = MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys");
- nekey = new_ekeys = MEM_callocN((pa->totkey+totnewkey)*(sizeof(ParticleEditKey)),"Hair subdivide edit keys");
- endtime = pa->hair[pa->totkey-1].time;
-
- for(k=0, key=pa->hair, ekey=edit->keys[index]; k<pa->totkey-1; k++, key++, ekey++){
-
- memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(ParticleEditKey));
-
- nekey->co = nkey->co;
- nekey->time = &nkey->time;
-
- nkey++;
- nekey++;
-
- if(ekey->flag & PEK_SELECT && (ekey+1)->flag & PEK_SELECT){
- nkey->time= (key->time + (key+1)->time)*0.5f;
- state.time = (endtime != 0.0f)? nkey->time/endtime: 0.0f;
- psys_get_particle_on_path(data->ob, psys, index, &state, 0);
- VECCOPY(nkey->co, state.co);
-
- nekey->co= nkey->co;
- nekey->time= &nkey->time;
- nekey->flag |= PEK_SELECT;
-
- nekey++;
- nkey++;
- }
- }
- /*tip still not copied*/
- memcpy(nkey,key,sizeof(HairKey));
- memcpy(nekey,ekey,sizeof(ParticleEditKey));
-
- nekey->co = nkey->co;
- nekey->time = &nkey->time;
-
- if(pa->hair)
- MEM_freeN(pa->hair);
- pa->hair = new_keys;
-
- if(edit->keys[index])
- MEM_freeN(edit->keys[index]);
-
- edit->keys[index] = new_ekeys;
-
- pa->totkey += totnewkey;
- pa->flag |= PARS_EDIT_RECALC;
- pa->flag &= ~PARS_REKEY;
-}
-void PE_subdivide(void)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- struct { Object *ob; } data;
-
- if(!PE_can_edit(psys)) return;
-
- data.ob= ob;
- PE_foreach_element(psys,subdivide_element,&data);
-
- psys->edit->totkeys = psys_count_keys(psys);
-
- recalc_lengths(psys);
- PE_recalc_world_cos(ob, psys);
-
- PE_update_object(ob, 1);
-
- BIF_undo_push("Subdivide hair(s)");
-}
-void PE_remove_doubles(void)
-{
- Object *ob=OBACT;
- ParticleSystem *psys=PE_get_current(ob);
- ParticleEditSettings *pset=PE_settings();
- ParticleData *pa;
- ParticleEdit *edit;
- ParticleSystemModifierData *psmd;
- KDTree *tree;
- KDTreeNearest nearest[10];
- float mat[4][4], co[3];
- int i, n, totn, removed, totpart, flag, totremoved;
-
- if(!PE_can_edit(psys)) return;
-
- edit= psys->edit;
- psmd= psys_get_modifier(ob, psys);
- totremoved= 0;
-
- do {
- removed= 0;
-
- totpart= psys->totpart;
- tree=BLI_kdtree_new(totpart);
-
- /* insert particles into kd tree */
- LOOP_PARTICLES(i,pa) {
- if(particle_is_selected(psys, pa)) {
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
- BLI_kdtree_insert(tree, i, co, NULL);
- }
- }
-
- BLI_kdtree_balance(tree);
-
- /* tag particles to be removed */
- LOOP_PARTICLES(i,pa) {
- if(particle_is_selected(psys, pa)) {
- psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat);
- VECCOPY(co, pa->hair[0].co);
- Mat4MulVecfl(mat, co);
-
- totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest);
-
- for(n=0; n<totn; n++) {
- /* this needs a custom threshold still */
- if(nearest[n].index > i && nearest[n].dist < 0.0002f) {
- if(!(pa->flag & PARS_TAG)) {
- pa->flag |= PARS_TAG;
- removed++;
- }
- }
- }
- }
- }
-
- BLI_kdtree_free(tree);
-
- /* remove tagged particles - don't do mirror here! */
- flag= pset->flag;
- pset->flag &= ~PE_X_MIRROR;
- remove_tagged_elements(ob, psys);
- pset->flag= flag;
- totremoved += removed;
- } while(removed);
-
- if(totremoved)
- notice("Removed: %d", totremoved);
-
- PE_recalc_world_cos(ob, psys);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Remove double particles");
-}
-
-static void PE_radialcontrol_callback(const int mode, const int val)
-{
- ParticleEditSettings *pset = PE_settings();
-
- if(pset->brushtype>=0) {
- ParticleBrushData *brush= &pset->brush[pset->brushtype];
-
- if(mode == RADIALCONTROL_SIZE)
- brush->size = val;
- else if(mode == RADIALCONTROL_STRENGTH)
- brush->strength = val;
- }
-
- (*PE_radialcontrol()) = NULL;
-}
-
-RadialControl **PE_radialcontrol(void)
-{
- static RadialControl *rc = NULL;
- return &rc;
-}
-
-void PE_radialcontrol_start(const int mode)
-{
- ParticleEditSettings *pset = PE_settings();
- int orig= 1;
-
- if(pset->brushtype>=0) {
- ParticleBrushData *brush= &pset->brush[pset->brushtype];
-
- if(mode == RADIALCONTROL_SIZE)
- orig = brush->size;
- else if(mode == RADIALCONTROL_STRENGTH)
- orig = brush->strength;
-
- if(mode != RADIALCONTROL_NONE)
- (*PE_radialcontrol())= radialcontrol_start(mode, PE_radialcontrol_callback, orig, 100, 0);
- }
-}
-
-/************************************************/
-/* Edit Brushes */
-/************************************************/
-static void brush_comb(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData)
-{
- struct {Object *ob; short *mval; float rad; rcti* rect; float dist; float *dvec; float combfac;} *data = userData;
- ParticleData *pa= &psys->particles[pa_index];
- ParticleEditSettings *pset= PE_settings();
- HairKey *key = pa->hair + key_index;
- float cvec[3], fac;
-
- if(pset->flag & PE_LOCK_FIRST && key_index == 0) return;
-
- fac = (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac);
-
- VECCOPY(cvec,data->dvec);
- Mat4Mul3Vecfl(imat,cvec);
- VecMulf(cvec, fac);
- VECADD(key->co, key->co, cvec);
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void brush_cut(ParticleSystem *psys, int index, void *userData)
-{
- struct { short *mval; float rad; rcti* rect; int selected; float cutfac; bglMats mats;} *data = userData;
- ParticleData *pa= &psys->particles[index];
- ParticleCacheKey *key = psys->pathcache[index];
- float rad2, cut_time = 1.0;
- float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv;
- int k, cut, keys = (int)pow(2.0, (double)psys->part->draw_step);
- short vertco[2];
-
- /* blunt scissors */
- if(BLI_frand() > data->cutfac) return;
-
- rad2 = data->rad * data->rad;
-
- cut=0;
-
- project_short_noclip(key->co, vertco);
- x0 = (float)vertco[0];
- x1 = (float)vertco[1];
-
- o0 = (float)data->mval[0];
- o1 = (float)data->mval[1];
-
- xo0 = x0 - o0;
- xo1 = x1 - o1;
-
- /* check if root is inside circle */
- if(xo0*xo0 + xo1*xo1 < rad2 && test_key_depth(key->co,&(data->mats))) {
- cut_time = -1.0f;
- cut = 1;
- }
- else {
- /* calculate path time closest to root that was inside the circle */
- for(k=1, key++; k<=keys; k++, key++){
- project_short_noclip(key->co, vertco);
-
- if(test_key_depth(key->co,&(data->mats)) == 0) {
- x0 = (float)vertco[0];
- x1 = (float)vertco[1];
-
- xo0 = x0 - o0;
- xo1 = x1 - o1;
- continue;
- }
-
- v0 = (float)vertco[0] - x0;
- v1 = (float)vertco[1] - x1;
-
- dv = v0*v0 + v1*v1;
-
- d = (v0*xo1 - v1*xo0);
-
- d = dv * rad2 - d*d;
-
- if(d > 0.0f) {
- d = sqrt(d);
-
- cut_time = -(v0*xo0 + v1*xo1 + d);
-
- if(cut_time > 0.0f) {
- cut_time /= dv;
-
- if(cut_time < 1.0f) {
- cut_time += (float)(k-1);
- cut_time /= (float)keys;
- cut = 1;
- break;
- }
- }
- }
-
- x0 = (float)vertco[0];
- x1 = (float)vertco[1];
-
- xo0 = x0 - o0;
- xo1 = x1 - o1;
- }
- }
-
- if(cut) {
- if(cut_time < 0.0f) {
- pa->flag |= PARS_TAG;
- }
- else {
- rekey_element_to_time(index, cut_time);
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
-}
-static void brush_length(ParticleSystem *psys, int index, void *userData)
-{
- struct { short *mval; float rad; rcti* rect; float dist; float growfac; } *data = userData;
- ParticleData *pa = &psys->particles[index];
- HairKey *key;
- float dvec[3],pvec[3];
- int k;
-
- key = pa->hair;
- VECCOPY(pvec,key->co);
-
- for(k=1, key++; k<pa->totkey; k++,key++){
- VECSUB(dvec,key->co,pvec);
- VECCOPY(pvec,key->co);
- VecMulf(dvec,data->growfac);
- VECADD(key->co,(key-1)->co,dvec);
- }
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void brush_puff(ParticleSystem *psys, int index, void *userData)
-{
- struct { short *mval; float rad; rcti* rect; float dist;
- Object *ob; DerivedMesh *dm; float pufffac; int invert; } *data = userData;
- ParticleData *pa = &psys->particles[index];
- ParticleEdit *edit = psys->edit;
- HairKey *key;
- float mat[4][4], imat[4][4];
- float lastco[3], rootco[3], co[3], nor[3], kco[3], dco[3], fac, length;
- int k;
-
- psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, pa, mat);
- Mat4Invert(imat,mat);
-
- /* find root coordinate and normal on emitter */
- key = pa->hair;
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
-
- index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL);
- if(index == -1) return;
-
- VECCOPY(rootco, co);
- VecCopyf(nor, &psys->edit->emitter_cosnos[index*6+3]);
- Normalize(nor);
- length= 0.0f;
-
- fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac);
- fac *= 0.025f;
- if(data->invert)
- fac= -fac;
-
- for(k=1, key++; k<pa->totkey; k++, key++){
- /* compute position as if hair was standing up straight */
- VECCOPY(lastco, co);
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- length += VecLenf(lastco, co);
-
- VECADDFAC(kco, rootco, nor, length);
-
- /* blend between the current and straight position */
- VECSUB(dco, kco, co);
- VECADDFAC(co, co, dco, fac);
-
- VECCOPY(key->co, co);
- Mat4MulVecfl(imat, key->co);
- }
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-static void brush_smooth_get(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData)
-{
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} *data = userData;
- ParticleData *pa= &psys->particles[pa_index];
- HairKey *key = pa->hair + key_index;
-
- if(key_index){
- float dvec[3];
-
- VecSubf(dvec,key->co,(key-1)->co);
- Mat4Mul3Vecfl(mat,dvec);
- VECADD(data->vec,data->vec,dvec);
- data->tot++;
- }
-}
-static void brush_smooth_do(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData)
-{
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} *data = userData;
- ParticleData *pa= &psys->particles[pa_index];
- HairKey *key = pa->hair + key_index;
- float vec[3], dvec[3];
-
- if(key_index){
- VECCOPY(vec,data->vec);
- Mat4Mul3Vecfl(imat,vec);
-
- VecSubf(dvec,key->co,(key-1)->co);
-
- VECSUB(dvec,vec,dvec);
- VecMulf(dvec,data->smoothfac);
-
- VECADD(key->co,key->co,dvec);
- }
-
- pa->flag |= PARS_EDIT_RECALC;
-}
-#define EXPERIMENTAL_DEFORM_ONLY_PAINTING 1
-static void brush_add(Object *ob, ParticleSystem *psys, short *mval, short number)
-{
- ParticleData *add_pars = MEM_callocN(number*sizeof(ParticleData),"ParticleData add");
- ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys);
- ParticleEditSettings *pset= PE_settings();
- ParticleEdit *edit = psys->edit;
- int i, k, n = 0, totpart = psys->totpart;
- short mco[2];
- short dmx = 0, dmy = 0;
- float co1[3], co2[3], min_d, imat[4][4];
- float framestep, timestep = psys_get_timestep(psys->part);
- short size = pset->brush[PE_BRUSH_ADD].size;
- short size2 = size*size;
-#if EXPERIMENTAL_DEFORM_ONLY_PAINTING
- DerivedMesh *dm=0;
-#endif
- Mat4Invert(imat,ob->obmat);
-
- BLI_srandom(psys->seed+mval[0]+mval[1]);
-
- /* painting onto the deformed mesh, could be an option? */
-#if EXPERIMENTAL_DEFORM_ONLY_PAINTING
- if (psmd->dm->deformedOnly)
- dm = psmd->dm;
- else
- dm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH);
-#endif
- for(i=0; i<number; i++){
- if(number>1){
- dmx=dmy=size;
- while(dmx*dmx+dmy*dmy>size2){
- dmx=(short)((2.0f*BLI_frand()-1.0f)*size);
- dmy=(short)((2.0f*BLI_frand()-1.0f)*size);
- }
- }
-
- mco[0] = mval[0] + dmx;
- mco[1] = mval[1] + dmy;
- viewline(mco, co1, co2);
-
- Mat4MulVecfl(imat,co1);
- Mat4MulVecfl(imat,co2);
- min_d=2.0;
-
- /* warning, returns the derived mesh face */
-#if EXPERIMENTAL_DEFORM_ONLY_PAINTING
- if(psys_intersect_dm(ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) {
- add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,add_pars[n].num,add_pars[n].fuv,NULL);
- n++;
- }
-#else
-#if 0
- if (psmd->dm->deformedOnly) {
- if(psys_intersect_dm(ob,psmd->dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)){
- n++;
- }
- } else {
- /* we need to test against the cage mesh, because 1) its faster and 2) then we can avoid converting the fuv back which is not simple */
- if(psys_intersect_dm(ob,psmd->dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)){
- MFace *mface;
- float fuv_mod[3] = {0.0, 0.0, 0.0};
- OrigSpaceFace *osface;
-
- mface= psmd->dm->getFaceData(psmd->dm,add_pars[n].num,CD_MFACE);
- osface= psmd->dm->getFaceData(psmd->dm, add_pars[n].num, CD_ORIGSPACE);
-
- add_pars[n].fuv[2]=0.0;
-
- /* use the original index for num and the derived index for num_dmcache */
- add_pars[n].num_dmcache = add_pars[n].num;
- add_pars[n].num = *(int *)psmd->dm->getFaceData(psmd->dm, add_pars[n].num, CD_ORIGINDEX);
-
- /* This is totally unaceptable code (fakeing mesh dara) but changing the target function isnt really nice either, do this temporarily */
- if (1) { /* Evilness*/
- MFace mface_fake;
- MVert mvert_fake[4];
- //int test1,test2;
- //test1 = add_pars[n].num_dmcache;
- //test2 = add_pars[n].num;
-
- mvert_fake[0].co[2] = mvert_fake[1].co[2] = mvert_fake[2].co[2] = mvert_fake[3].co[2] = 0.0;
-
- mface_fake.v1 = 0;
- mface_fake.v2 = 1;
- mface_fake.v3 = 2;
-
- if (mface->v4) {
- mface_fake.v4 = 3;
- } else {
- mface_fake.v4 = 0;
- }
-
- Vec2Copyf(mvert_fake[0].co, osface->uv[0]);
- Vec2Copyf(mvert_fake[1].co, osface->uv[1]);
- Vec2Copyf(mvert_fake[2].co, osface->uv[2]);
- Vec2Copyf(mvert_fake[3].co, osface->uv[3]);
- //printf("before %f %f %i %i\n", add_pars[n].fuv[0], add_pars[n].fuv[1], test1, test2);
- psys_interpolate_face(&mvert_fake, &mface_fake, NULL, &add_pars[n].fuv, &fuv_mod, NULL, NULL, NULL);
-
- /* Apply as the UV */
- Vec2Copyf(add_pars[n].fuv, fuv_mod);
- //printf("after %f %f\n", add_pars[n].fuv[0], add_pars[n].fuv[1]);
- }
- /* Make a fake face, for calculating the derived face's fuv on the original face */
- //PointInFace2DUV(mface->v4, osface->uv[0], osface->uv[1], osface->uv[2], osface->uv[3], add_pars[n].fuv, fuv_mod);
- //Vec2Copyf(add_pars[n].fuv, fuv_mod);
-
- n++;
- }
- }
-#endif
-#endif
- }
- if(n){
- int newtotpart=totpart+n;
- float hairmat[4][4], cur_co[3];
- KDTree *tree=0;
- ParticleData *pa, *new_pars = MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new");
- ParticleEditKey *ekey, **key, **new_keys = MEM_callocN(newtotpart*sizeof(ParticleEditKey *),"ParticleEditKey array new");
- HairKey *hkey;
-
- /* save existing elements */
- memcpy(new_pars, psys->particles, totpart * sizeof(ParticleData));
- memcpy(new_keys, edit->keys, totpart * sizeof(ParticleEditKey*));
-
- /* change old arrays to new ones */
- if(psys->particles) MEM_freeN(psys->particles);
- psys->particles = new_pars;
-
- if(edit->keys) MEM_freeN(edit->keys);
- edit->keys = new_keys;
-
- if(edit->mirror_cache) {
- MEM_freeN(edit->mirror_cache);
- edit->mirror_cache = NULL;
- }
-
- /* create tree for interpolation */
- if(pset->flag & PE_INTERPOLATE_ADDED && psys->totpart){
- tree=BLI_kdtree_new(psys->totpart);
-
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
- psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,cur_co,0,0,0,0,0);
- BLI_kdtree_insert(tree, i, cur_co, NULL);
- }
-
- BLI_kdtree_balance(tree);
- }
-
- psys->totpart = newtotpart;
-
- /* create new elements */
- pa = psys->particles + totpart;
- key = edit->keys + totpart;
-
- for(i=totpart; i<newtotpart; i++, pa++, key++){
- memcpy(pa, add_pars + i - totpart, sizeof(ParticleData));
- pa->hair = MEM_callocN(pset->totaddkey * sizeof(HairKey), "BakeKey key add");
- ekey = *key = MEM_callocN(pset->totaddkey * sizeof(ParticleEditKey), "ParticleEditKey add");
- pa->totkey = pset->totaddkey;
-
- for(k=0, hkey=pa->hair; k<pa->totkey; k++, hkey++, ekey++) {
- ekey->co = hkey->co;
- ekey->time = &hkey->time;
- }
-
- pa->size= 1.0f;
- initialize_particle(pa,i,ob,psys,psmd);
- reset_particle(pa,psys,psmd,ob,0.0,1.0,0,0,0);
- pa->flag |= PARS_EDIT_RECALC;
- if(pset->flag & PE_X_MIRROR)
- pa->flag |= PARS_TAG; /* signal for duplicate */
-
- framestep = pa->lifetime/(float)(pset->totaddkey-1);
-
- if(tree){
- HairKey *hkey;
- ParticleKey key[3];
- KDTreeNearest ptn[3];
- int w, maxw;
- float maxd, mind, dd, totw=0.0, weight[3];
-
- psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,0,0);
- maxw = BLI_kdtree_find_n_nearest(tree,3,co1,NULL,ptn);
-
- maxd = ptn[maxw-1].dist;
- mind = ptn[0].dist;
- dd = maxd - mind;
-
- for(w=0; w<maxw; w++){
- weight[w] = (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd));
- totw += weight[w];
- }
- for(;w<3; w++){
- weight[w] = 0.0f;
- }
-
- for(w=0; w<maxw; w++)
- weight[w] /= totw;
-
- for(k=0; k<pset->totaddkey; k++) {
- hkey = pa->hair + k;
- hkey->time = pa->time + k * framestep;
-
- key[0].time = hkey->time/ 100.0f;
- psys_get_particle_on_path(ob, psys, ptn[0].index, key, 0);
- VecMulf(key[0].co, weight[0]);
-
- if(maxw>1) {
- key[1].time = key[0].time;
- psys_get_particle_on_path(ob, psys, ptn[1].index, key + 1, 0);
- VecMulf(key[1].co, weight[1]);
- VECADD(key[0].co, key[0].co, key[1].co);
-
- if(maxw>2) {
- key[2].time = key[0].time;
- psys_get_particle_on_path(ob, psys, ptn[2].index, key + 2, 0);
- VecMulf(key[2].co, weight[2]);
- VECADD(key[0].co, key[0].co, key[2].co);
- }
- }
-
- if(k==0)
- VECSUB(co1, pa->state.co, key[0].co);
-
- VECADD(pa->hair[k].co, key[0].co, co1);
-
- pa->hair[k].time = key[0].time;
- }
- }
- else{
- for(k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
- VECADDFAC(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep);
- pa->hair[k].time += k * framestep;
- }
- }
- for(k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) {
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat);
- Mat4Invert(imat,hairmat);
- Mat4MulVecfl(imat, hkey->co);
- }
- }
- edit->totkeys = psys_count_keys(psys);
-
- if(tree)
- BLI_kdtree_free(tree);
- }
- if(add_pars)
- MEM_freeN(add_pars);
-
-/* painting onto the deformed mesh, could be an option? */
-#if EXPERIMENTAL_DEFORM_ONLY_PAINTING
- if (!psmd->dm->deformedOnly)
- dm->release(dm);
-#endif
-}
-static void brush_weight(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData)
-{
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float weightfac;} *data = userData;
- ParticleData *pa;
-
- /* roots have full weight allways */
- if(key_index) {
- pa= &psys->particles[pa_index];
- pa->hair[key_index].weight = data->weightfac;
- pa->flag |= PARS_EDIT_RECALC;
- }
-}
-
-/* returns 0 if no brush was used */
-int PE_brush_particles(void)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit;
- ParticleEditSettings *pset = PE_settings();
- ParticleSystemModifierData *psmd;
- ParticleBrushData *brush;
- float vec1[3], vec2[3];
- short mval[2], mvalo[2], firsttime = 1, dx, dy;
- int selected = 0, flip, removed = 0;
-
- if(!PE_can_edit(psys)) return 0;
-
- edit = psys->edit;
- psmd= psys_get_modifier(ob, psys);
-
- flip= (get_qual() == LR_SHIFTKEY);
-
- if(pset->brushtype<0) return 0;
- brush= &pset->brush[pset->brushtype];
-
- initgrabz(ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2]);
-
- getmouseco_areawin(mvalo);
-
- mval[0] = mvalo[0]; mval[1] = mvalo[1];
-
- while(get_mbut() & L_MOUSE){
- bglFlush();
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
- persp(PERSP_VIEW);
-
- dx=mval[0]-mvalo[0];
- dy=mval[1]-mvalo[1];
- if(((pset->brushtype == PE_BRUSH_ADD) ?
- (sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0))
- || firsttime){
- firsttime = 0;
-
- selected = (short)count_selected_keys(psys);
-
- switch(pset->brushtype){
- case PE_BRUSH_COMB:
- {
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float *dvec; float combfac;} data;
-
- data.ob = ob;
- data.mval = mval;
- data.rad = (float)brush->size;
-
- data.combfac = (float)(brush->strength - 50) / 50.0f;
- if(data.combfac < 0.0f)
- data.combfac = 1.0f - 9.0f * data.combfac;
- else
- data.combfac = 1.0f - data.combfac;
-
- Mat4Invert(ob->imat, ob->obmat);
-
- window_to_3d(vec1, mvalo[0], mvalo[1]);
- window_to_3d(vec2, mval[0], mval[1]);
- VECSUB(vec1, vec2, vec1);
- data.dvec = vec1;
-
- foreach_mouse_hit_key(selected, psys,brush_comb, &data);
- break;
- }
- case PE_BRUSH_CUT:
- {
- struct { short *mval; float rad; rcti* rect; int selected; float cutfac; bglMats mats;} data;
-
- data.mval = mval;
- data.rad = (float)brush->size;
-
- data.selected = selected;
-
- data.cutfac = (float)(brush->strength / 100.0f);
-
- bgl_get_mats(&(data.mats));
-
- if(selected)
- foreach_selected_element(psys, brush_cut, &data);
- else
- PE_foreach_element(psys, brush_cut, &data);
-
- removed= remove_tagged_elements(ob, psys);
- if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
- break;
- }
- case PE_BRUSH_LENGTH:
- {
- struct { short *mval; float rad; rcti* rect; float dist; float growfac; } data;
-
- data.mval = mval;
-
- data.rad = (float)brush->size;
- data.growfac = (float)brush->strength / 5000.0f;
-
- if(brush->invert ^ flip)
- data.growfac = 1.0f - data.growfac;
- else
- data.growfac = 1.0f + data.growfac;
-
- foreach_mouse_hit_element(selected, psys, brush_length, &data);
-
- if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
- break;
- }
- case PE_BRUSH_PUFF:
- {
- struct { short *mval; float rad; rcti* rect; float dist;
- Object *ob; DerivedMesh *dm; float pufffac; int invert; } data;
-
- data.ob = ob;
- data.dm = psmd->dm;
- data.mval = mval;
- data.rad = (float)brush->size;
-
- data.pufffac = (float)(brush->strength - 50) / 50.0f;
- if(data.pufffac < 0.0f)
- data.pufffac = 1.0f - 9.0f * data.pufffac;
- else
- data.pufffac = 1.0f - data.pufffac;
-
- data.invert= (brush->invert ^ flip);
- Mat4Invert(ob->imat, ob->obmat);
-
- foreach_mouse_hit_element(selected, psys, brush_puff, &data);
- break;
- }
- case PE_BRUSH_ADD:
- if(psys->part->from==PART_FROM_FACE){
- brush_add(ob, psys, mval, brush->strength);
- if(pset->flag & PE_KEEP_LENGTHS)
- recalc_lengths(psys);
- }
- break;
- case PE_BRUSH_WEIGHT:
- {
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float weightfac;} data;
-
- data.ob = ob;
- data.mval = mval;
- data.rad = (float)brush->size;
-
- data.weightfac = (float)(brush->strength / 100.0f);
-
- foreach_mouse_hit_key(selected, psys, brush_weight, &data);
- break;
- }
- case PE_BRUSH_SMOOTH:
- {
- struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} data;
-
- data.ob = ob;
- data.mval = mval;
- data.rad = (float)brush->size;
-
- data.vec[0] = data.vec[1] = data.vec[2] = 0.0f;
- data.tot = 0;
-
- data.smoothfac = (float)(brush->strength / 100.0f);
-
- Mat4Invert(ob->imat, ob->obmat);
-
- foreach_mouse_hit_key(selected, psys, brush_smooth_get, &data);
-
- if(data.tot){
- VecMulf(data.vec, 1.0f / (float)data.tot);
- foreach_mouse_hit_key(selected, psys, brush_smooth_do, &data);
- }
-
- break;
- }
- }
- if((pset->flag & PE_KEEP_LENGTHS)==0)
- recalc_lengths(psys);
-
- if(pset->brushtype == PE_BRUSH_ADD || removed) {
- if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR))
- PE_mirror_x(1);
- PE_recalc_world_cos(ob,psys);
- psys_free_path_cache(psys);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else
- PE_update_object(ob, 1);
-
- mvalo[0] = mval[0];
- mvalo[1] = mval[1];
- }
-
- force_draw(0);
-
- PIL_sleep_ms(10);
-
- getmouseco_areawin(mval);
- }
- allqueue(REDRAWVIEW3D, 1);
-
- BIF_undo_push("Brush edit particles");
-
- return 1;
-}
-static void set_delete_particle(ParticleSystem *psys, int index, void *userData)
-{
- psys->particles[index].flag |= PARS_TAG;
-}
-static void set_delete_particle_key(ParticleSystem *psys, int pa_index, int key_index, void *userData)
-{
- psys->edit->keys[pa_index][key_index].flag |= PEK_TAG;
-}
-void PE_delete_particle(void)
-{
- Object *ob=OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- short event=0;
-
- if(!PE_can_edit(psys)) return;
-
- event= pupmenu("Erase %t|Particle%x2|Key%x1");
-
- if(event<1) return;
-
- if(event==1){
- foreach_selected_key(psys, set_delete_particle_key, 0);
- remove_tagged_keys(ob, psys);
- recalc_lengths(psys);
- }
- else if(event==2){
- foreach_selected_element(psys, set_delete_particle, 0);
- remove_tagged_elements(ob, psys);
- recalc_lengths(psys);
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Delete particles/keys");
-}
-
-void PE_mirror_x(int tagged)
-{
- Object *ob=OBACT;
- Mesh *me= (Mesh*)(ob->data);
- ParticleSystemModifierData *psmd;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleEdit *edit;
- ParticleData *pa, *newpa, *new_pars;
- ParticleEditKey *ekey, **newkey, **key, **new_keys;
- HairKey *hkey;
- int *mirrorfaces;
- int i, k, rotation, totpart, newtotpart;
-
- if(!PE_can_edit(psys)) return;
-
- edit= psys->edit;
- psmd= psys_get_modifier(ob, psys);
-
- mirrorfaces= mesh_get_x_mirror_faces(ob);
-
- if(!edit->mirror_cache)
- PE_update_mirror_cache(ob, psys);
-
- totpart= psys->totpart;
- newtotpart= psys->totpart;
- LOOP_PARTICLES(i,pa) {
- if(pa->flag&PARS_HIDE) continue;
-
- if(!tagged) {
- if(particle_is_selected(psys, pa)) {
- if(edit->mirror_cache[i] != -1) {
- /* already has a mirror, don't need to duplicate */
- PE_mirror_particle(ob, psmd->dm, psys, pa, NULL);
- continue;
- }
- else
- pa->flag |= PARS_TAG;
- }
- }
-
- if((pa->flag & PARS_TAG) && mirrorfaces[pa->num*2] != -1)
- newtotpart++;
- }
-
- if(newtotpart != psys->totpart) {
- /* allocate new arrays and copy existing */
- new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new");
- new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey*), "ParticleEditKey new");
-
- memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData));
- memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*));
-
- if(psys->particles) MEM_freeN(psys->particles);
- psys->particles= new_pars;
-
- if(edit->keys) MEM_freeN(edit->keys);
- edit->keys= new_keys;
-
- if(edit->mirror_cache) {
- MEM_freeN(edit->mirror_cache);
- edit->mirror_cache= NULL;
- }
-
- psys->totpart= newtotpart;
-
- /* create new elements */
- pa= psys->particles;
- newpa= psys->particles + totpart;
- key= edit->keys;
- newkey= edit->keys + totpart;
-
- for(i=0; i<totpart; i++, pa++, key++) {
- if(pa->flag&PARS_HIDE) continue;
-
- if(!(pa->flag & PARS_TAG) || mirrorfaces[pa->num*2] == -1)
- continue;
-
- /* duplicate */
- *newpa= *pa;
- if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair);
- if(pa->keys) newpa->keys= MEM_dupallocN(pa->keys);
- if(*key) *newkey= MEM_dupallocN(*key);
-
- /* rotate weights according to vertex index rotation */
- rotation= mirrorfaces[pa->num*2+1];
- newpa->fuv[0]= pa->fuv[2];
- newpa->fuv[1]= pa->fuv[1];
- newpa->fuv[2]= pa->fuv[0];
- newpa->fuv[3]= pa->fuv[3];
- while(rotation-- > 0)
- if(me->mface[pa->num].v4)
- SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3])
- else
- SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2])
-
- /* assign face inddex */
- newpa->num= mirrorfaces[pa->num*2];
- newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL);
-
- /* update edit key pointers */
- ekey= *newkey;
- for(k=0, hkey=newpa->hair; k<newpa->totkey; k++, hkey++, ekey++) {
- ekey->co= hkey->co;
- ekey->time= &hkey->time;
- }
-
- /* map key positions as mirror over x axis */
- PE_mirror_particle(ob, psmd->dm, psys, pa, newpa);
-
- newpa++;
- newkey++;
- }
-
- edit->totkeys = psys_count_keys(psys);
- }
-
- for(pa=psys->particles, i=0; i<psys->totpart; i++, pa++)
- pa->flag &= ~PARS_TAG;
-
- MEM_freeN(mirrorfaces);
-
- if(!tagged) {
- PE_recalc_world_cos(ob,psys);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- BIF_undo_push("Mirror particles");
- }
-}
-
-void PE_selectbrush_menu(void)
-{
- ParticleEditSettings *pset= PE_settings();
- int val;
-
- pupmenu_set_active(pset->brushtype);
-
- val= pupmenu("Select Brush%t|None %x0|Comb %x1|Smooth %x7|Weight %x6|Add %x5|Length %x3|Puff %x4|Cut %x2");
-
- if(val>=0) {
- pset->brushtype= val-1;
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/************************************************/
-/* Particle Edit Undo */
-/************************************************/
-static void free_ParticleUndo(ParticleUndo *undo)
-{
- ParticleData *pa;
- int i;
-
- for(i=0, pa=undo->particles; i<undo->totpart; i++, pa++) {
- if(pa->hair)
- MEM_freeN(pa->hair);
- if(undo->keys[i])
- MEM_freeN(undo->keys[i]);
- }
- if(undo->keys)
- MEM_freeN(undo->keys);
-
- if(undo->particles)
- MEM_freeN(undo->particles);
-
- //if(undo->emitter_cosnos)
- // MEM_freeN(undo->emitter_cosnos);
-}
-static void make_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo)
-{
- ParticleData *pa,*upa;
- int i;
-
- undo->totpart = psys->totpart;
- undo->totkeys = psys->edit->totkeys;
-
- upa = undo->particles = MEM_dupallocN(psys->particles);
- undo->keys = MEM_dupallocN(psys->edit->keys);
-
- for(i=0, pa=psys->particles; i<undo->totpart; i++, pa++, upa++) {
- upa->hair = MEM_dupallocN(pa->hair);
- undo->keys[i] = MEM_dupallocN(psys->edit->keys[i]);
- /* no need to update edit key->co & key->time pointers here */
- }
-}
-static void get_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo)
-{
- ParticleData *pa, *upa;
- ParticleEditKey *key;
- HairKey *hkey;
- int i, k, totpart = psys->totpart;
-
- LOOP_PARTICLES(i,pa) {
- if(pa->hair)
- MEM_freeN(pa->hair);
-
- if(psys->edit->keys[i])
- MEM_freeN(psys->edit->keys[i]);
- }
- if(psys->particles)
- MEM_freeN(psys->particles);
- if(psys->edit->keys)
- MEM_freeN(psys->edit->keys);
- if(psys->edit->mirror_cache) {
- MEM_freeN(psys->edit->mirror_cache);
- psys->edit->mirror_cache= NULL;
- }
-
- pa = psys->particles = MEM_dupallocN(undo->particles);
- psys->edit->keys = MEM_dupallocN(undo->keys);
-
- for(i=0,upa=undo->particles; i<undo->totpart; i++, upa++, pa++){
- hkey = pa->hair = MEM_dupallocN(upa->hair);
- key = psys->edit->keys[i] = MEM_dupallocN(undo->keys[i]);
- for(k=0; k<pa->totkey; k++, hkey++, key++) {
- key->co = hkey->co;
- key->time = &hkey->time;
- }
- }
-
- psys->totpart = undo->totpart;
- psys->edit->totkeys = undo->totkeys;
-}
-void PE_undo_push(char *str)
-{
- ParticleSystem *psys = PE_get_current(OBACT);
- ParticleEdit *edit = 0;
- ParticleUndo *undo;
- int nr;
-
- if(!PE_can_edit(psys)) return;
- edit = psys->edit;
-
- /* remove all undos after (also when curundo==NULL) */
- while(edit->undo.last != edit->curundo) {
- undo= edit->undo.last;
- BLI_remlink(&edit->undo, undo);
- free_ParticleUndo(undo);
- MEM_freeN(undo);
- }
-
- /* make new */
- edit->curundo= undo= MEM_callocN(sizeof(ParticleUndo), "particle undo file");
- strncpy(undo->name, str, 64-1);
- BLI_addtail(&edit->undo, undo);
-
- /* and limit amount to the maximum */
- nr= 0;
- undo= edit->undo.last;
- while(undo) {
- nr++;
- if(nr==U.undosteps) break;
- undo= undo->prev;
- }
- if(undo) {
- while(edit->undo.first!=undo) {
- ParticleUndo *first= edit->undo.first;
- BLI_remlink(&edit->undo, first);
- free_ParticleUndo(first);
- MEM_freeN(first);
- }
- }
-
- /* copy */
- make_ParticleUndo(psys,edit->curundo);
-}
-void PE_undo_step(int step)
-{
- ParticleSystem *psys = PE_get_current(OBACT);
- ParticleEdit *edit = 0;
-
- if(!PE_can_edit(psys)) return;
- edit=psys->edit;
-
- if(step==0) {
- get_ParticleUndo(psys,edit->curundo);
- }
- else if(step==1) {
-
- if(edit->curundo==NULL || edit->curundo->prev==NULL) error("No more steps to undo");
- else {
- if(G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name);
- edit->curundo= edit->curundo->prev;
- get_ParticleUndo(psys, edit->curundo);
- }
- }
- else {
- /* curundo has to remain current situation! */
-
- if(edit->curundo==NULL || edit->curundo->next==NULL) error("No more steps to redo");
- else {
- get_ParticleUndo(psys, edit->curundo->next);
- edit->curundo= edit->curundo->next;
- if(G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name);
- }
- }
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-static void ParticleUndo_number(ParticleEdit *edit, int nr)
-{
- ParticleUndo *undo;
- int a=1;
-
- for(undo= edit->undo.first; undo; undo= undo->next, a++) {
- if(a==nr) break;
- }
- edit->curundo= undo;
- PE_undo_step(0);
-}
-static void ParticleUndo_clear(ParticleSystem *psys)
-{
- ParticleUndo *undo;
- ParticleEdit *edit;
-
- if(psys==0) return;
-
- edit = psys->edit;
-
- if(edit==0) return;
-
- undo= edit->undo.first;
- while(undo) {
- free_ParticleUndo(undo);
- undo= undo->next;
- }
- BLI_freelistN(&edit->undo);
- edit->curundo= NULL;
-}
-void PE_undo(void)
-{
- PE_undo_step(1);
-}
-void PE_redo(void)
-{
- PE_undo_step(-1);
-}
-void PE_undo_menu(void)
-{
- ParticleSystem *psys = PE_get_current(OBACT);
- ParticleEdit *edit = 0;
- ParticleUndo *undo;
- DynStr *ds;
- short event;
- char *menu;
-
- if(!PE_can_edit(psys)) return;
- edit = psys->edit;
-
- ds= BLI_dynstr_new();
-
- BLI_dynstr_append(ds, "Particlemode Undo History %t");
-
- for(undo= edit->undo.first; undo; undo= undo->next) {
- BLI_dynstr_append(ds, "|");
- BLI_dynstr_append(ds, undo->name);
- }
-
- menu= BLI_dynstr_get_cstring(ds);
- BLI_dynstr_free(ds);
-
- event= pupmenu_col(menu, 20);
- MEM_freeN(menu);
-
- if(event>0) ParticleUndo_number(edit,event);
-}
-
-void PE_get_colors(char sel[4], char nosel[4])
-{
- BIF_GetThemeColor3ubv(TH_EDGE_SELECT, sel);
- BIF_GetThemeColor3ubv(TH_WIRE, nosel);
-}
-
-int PE_minmax(float *min, float *max)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleSystemModifierData *psmd;
- ParticleData *pa;
- ParticleEditKey *key;
- float co[3], mat[4][4];
- int i, k, totpart, ok = 0;
-
- if(!PE_can_edit(psys)) return ok;
-
- psmd= psys_get_modifier(ob, psys);
- totpart= psys->totpart;
-
- LOOP_PARTICLES(i,pa){
- if(pa->flag&PARS_HIDE) continue;
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
-
- LOOP_KEYS(k,key){
- if(key->flag&PEK_SELECT) {
- VECCOPY(co, key->co);
- Mat4MulVecfl(mat, co);
- DO_MINMAX(co, min, max);
- ok= 1;
- }
- }
- }
-
- if(!ok) {
- minmax_object(ob, min, max);
- ok= 1;
- }
-
- return ok;
-}
-
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
deleted file mode 100644
index 3cc306c8ea9..00000000000
--- a/source/blender/src/editscreen.c
+++ /dev/null
@@ -1,3843 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * All screen functions that are related to the interface
- * handling and drawing. Might be split up as well later...
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "nla.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h> /* isprint */
-#include <stdio.h>
-#include <math.h>
-
-#include "GHOST_Types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_action_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BLO_writefile.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_blender.h"
-#include "BKE_screen.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_cursors.h"
-#include "BIF_drawscene.h"
-#include "BIF_editsound.h"
-#include "BIF_glutil.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_mainqueue.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_renderwin.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-#include "BIF_keyval.h"
-#include "BIF_resources.h"
-
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_seqaudio.h"
-#include "BSE_view.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "winlay.h"
-
-/* TIPS:
- *
- * - WATCH THE EDGES, VERTICES HAVE TO BE IN ORDER...
- (lowest pointer first). Otherwise unpredictable effects!
- * - problem: flags here are not nicely implemented. After usage
- always reset to zero.
- */
-
-/* comment added to test orange branch */
-
-static void testareas(void);
-static void area_autoplayscreen(void);
-static void wait_for_event(void);
-
-
-/* ********* Globals *********** */
-
-static Window *mainwin= NULL;
-static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1;
-static short dodrawscreen= 1;
-static ScrArea *areawinar[MAXWIN];
-static ScrArea *g_activearea= NULL;
-short winqueue_break= 0;
-ScrArea *curarea= 0;
-
-/* prototypes -------------------*/
-int afterqtest(short win, unsigned short evt);
-unsigned short screen_qread(short *val, char *ascii);
-void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii);
-static void drawscredge_area(ScrArea *sa);
-
-/**********************************************************************/
-
-extern int textediting;
-
-static void screen_set_cursor(bScreen *sc)
-{
- if (sc->winakt>3) {
- ScrArea *sa= areawinar[sc->winakt];
-
- set_cursor(sa->cursor);
- } else {
- set_cursor(CURSOR_STD);
- }
-}
-
-void waitcursor(int val)
-{
- if(G.curscreen) {
- if(val) {
- set_cursor(CURSOR_WAIT);
- } else {
- screen_set_cursor(G.curscreen);
- }
- }
-}
-
-static int choose_cursor(ScrArea *sa)
-{
- if (sa->spacetype==SPACE_VIEW3D) {
- if(G.obedit) return CURSOR_EDIT;
- else if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))
- return CURSOR_VPAINT;
- else if(FACESEL_PAINT_TEST) return CURSOR_FACESEL;
- else if(G.f & G_SCULPTMODE) return CURSOR_EDIT;
- else if(G.f & G_PARTICLEEDIT) return CURSOR_EDIT;
- else return CURSOR_STD;
- }
- else if (sa->spacetype==SPACE_TEXT) {
- return CURSOR_TEXTEDIT;
- }
- else {
- return CURSOR_STD;
- }
-}
-
-void wich_cursor(ScrArea *sa)
-{
- sa->cursor= choose_cursor(sa);
-
- /* well... the waitcursor() is not a state, so this call will cancel it out */
- if(get_cursor()!=CURSOR_WAIT)
- screen_set_cursor(G.curscreen);
-}
-
-
-void setcursor_space(int spacetype, short cur)
-{
- bScreen *sc;
- ScrArea *sa;
-
- for (sc= G.main->screen.first; sc; sc= sc->id.next)
- for (sa= sc->areabase.first; sa; sa= sa->next)
- if(sa->spacetype==spacetype)
- sa->cursor= cur;
-
- screen_set_cursor(G.curscreen);
-}
-
-
-/* ********* IN/OUT ************* */
-
-void getmouseco_sc(short *mval) /* screen coordinates */
-{
- getmouse(mval);
-}
-
-/* mouse_cursor called during a script (via Window.QHandle) need
- * this function for getmouseco_areawin to work: */
-void set_g_activearea(ScrArea *sa)
-{
- if (sa) g_activearea = sa;
-}
-
-void getmouseco_areawin(short *mval) /* internal area coordinates */
-{
- getmouseco_sc(mval);
-
- if(g_activearea && g_activearea->win) {
- mval[0]-= g_activearea->winrct.xmin;
- mval[1]-= g_activearea->winrct.ymin;
- }
-}
-
-void getmouseco_headwin(short *mval) /* internal area coordinates */
-{
- getmouseco_sc(mval);
-
- if(g_activearea && g_activearea->headwin) {
- mval[0]-= g_activearea->headrct.xmin;
- mval[1]-= g_activearea->headrct.ymin;
- }
-}
-
-void headerprint(char *str)
-{
- if(curarea->headertype) {
- areawinset(curarea->headwin);
-
- headerbox(curarea);
-
- BIF_ThemeColor(TH_MENU_TEXT); /* better than cpack(0x0) color no? (desoto) */
- glRasterPos2i(20+curarea->headbutofs, 6);
- BMF_DrawString(G.font, str);
-
- curarea->head_swap= WIN_BACK_OK;
- areawinset(curarea->win);
- }
- else {
- // dunno... thats for later (ton)
- }
-}
-
-/* *********** STUFF ************** */
-
-static int scredge_is_horizontal(ScrEdge *se)
-{
- return (se->v1->vec.y == se->v2->vec.y);
-}
-
-static ScrEdge *screen_find_active_scredge(bScreen *sc, short *mval)
-{
- ScrEdge *se;
-
- for (se= sc->edgebase.first; se; se= se->next) {
- if (scredge_is_horizontal(se)) {
- short min, max;
- min= MIN2(se->v1->vec.x, se->v2->vec.x);
- max= MAX2(se->v1->vec.x, se->v2->vec.x);
-
- if (abs(mval[1]-se->v1->vec.y)<=2 && mval[0] >= min && mval[0]<=max)
- return se;
- }
- else {
- short min, max;
- min= MIN2(se->v1->vec.y, se->v2->vec.y);
- max= MAX2(se->v1->vec.y, se->v2->vec.y);
-
- if (abs(mval[0]-se->v1->vec.x)<=2 && mval[1] >= min && mval[1]<=max)
- return se;
- }
- }
-
- return NULL;
-}
-
-void areawinset(short win)
-{
- if(win>3) {
- curarea= areawinar[win];
- if(curarea==0) {
- printf("error in areawinar %d ,areawinset\n", win);
- return;
- }
-
- BIF_SetTheme(curarea);
-
- switch(curarea->spacetype) {
- case SPACE_VIEW3D:
- G.vd= curarea->spacedata.first;
- break;
- case SPACE_IPO:
- G.sipo= curarea->spacedata.first;
- G.v2d= &G.sipo->v2d;
- break;
- case SPACE_BUTS:
- G.buts= curarea->spacedata.first;
- G.v2d= &G.buts->v2d;
- break;
- case SPACE_SEQ: {
- SpaceSeq *sseq= curarea->spacedata.first;
- G.v2d= &sseq->v2d;
- break;
- }
- case SPACE_OOPS:
- G.soops= curarea->spacedata.first;
- G.v2d= &G.soops->v2d;
- break;
- case SPACE_IMAGE:
- G.sima= curarea->spacedata.first;
- G.v2d= &G.sima->v2d;
- break;
- case SPACE_SOUND:
- G.ssound= curarea->spacedata.first;
- G.v2d= &G.ssound->v2d;
- break;
- case SPACE_ACTION:
- G.saction= curarea->spacedata.first;
- G.v2d= &G.saction->v2d;
- break;
- case SPACE_NLA:
- G.snla= curarea->spacedata.first;
- G.v2d= &G.snla->v2d;
- break;
- case SPACE_TIME:
- {
- SpaceTime *stime= curarea->spacedata.first;
- G.v2d= &stime->v2d;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= curarea->spacedata.first;
- G.v2d= &snode->v2d;
- }
- break;
- case SPACE_IMASEL:
- {
- SpaceImaSel *simasel= curarea->spacedata.first;
- G.v2d= &simasel->v2d;
- }
- default:
- break;
- }
- }
-
- if(win) mywinset(win);
-}
-
-#define SCR_BACK 0.55
-#define SCR_ROUND 12
-
-void headerbox(ScrArea *area)
-{
- float width= area->winx;
- int active=0;
-
- glClearColor(SCR_BACK, SCR_BACK, SCR_BACK, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- active= area_is_active_area(area);
-
- if(active) BIF_ThemeColor(TH_HEADER);
- else BIF_ThemeColor(TH_HEADERDESEL);
-
- /* weird values here... is because of window matrix that centers buttons */
- if(area->headertype==HEADERTOP) {
- uiSetRoundBox(3);
- uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active);
- }
- else {
- uiSetRoundBox(12);
- uiRoundBoxEmboss(-0.5+area->headbutofs, -3.5, width-1.5+area->headbutofs, HEADERY+10, SCR_ROUND, active);
- }
-
- uiSetRoundBox(15);
-}
-
-int area_is_active_area(ScrArea *area)
-{
- return (g_activearea && area==g_activearea);
-}
-
-void scrarea_do_headdraw(ScrArea *area)
-{
- if (area->headertype) {
- areawinset(area->headwin);
-
- headerbox(area);
-
- /* we make scissor test slightly smaller not to destroy rounded headers */
- glScissor(area->headrct.xmin+5, area->headrct.ymin, area->winx-10, HEADERY);
-
- switch(area->spacetype) {
- case SPACE_FILE: file_buttons(); break;
- case SPACE_INFO: info_buttons(); break;
- case SPACE_VIEW3D: view3d_buttons(); break;
- case SPACE_IPO: ipo_buttons(); break;
- case SPACE_BUTS: buts_buttons(); break;
- case SPACE_SEQ: seq_buttons(); break;
- case SPACE_IMAGE: image_buttons(); break;
- case SPACE_IMASEL: imasel_buttons(); break;
- case SPACE_OOPS: oops_buttons(); break;
- case SPACE_TEXT: text_buttons(); break;
- case SPACE_SCRIPT:script_buttons(); break;
- case SPACE_SOUND: sound_buttons(); break;
- case SPACE_ACTION: action_buttons(); break;
- case SPACE_NLA: nla_buttons(); break;
- case SPACE_TIME: time_buttons(area); break;
- case SPACE_NODE: node_buttons(area); break;
- }
- uiClearButLock();
-
- //glScissor(area->winrct.xmin, area->winrct.xmax, area->winx, area->winy);
- area->head_swap= WIN_BACK_OK;
- }
-}
-void scrarea_do_headchange(ScrArea *area)
-{
- float ofs= area->headbutofs;
-
- if (area->headertype==HEADERDOWN) {
- bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -3.375, area->headrct.ymax-area->headrct.ymin-3.375+1.0);
- } else if (area->headertype==HEADERTOP) {
- bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -2.375-1.0, area->headrct.ymax-area->headrct.ymin-2.375);
- }
-}
-
-
-static void openheadwin(ScrArea *sa);
-static void closeheadwin(ScrArea *sa);
-
-static void scrarea_change_headertype(ScrArea *sa, int newtype)
-{
- sa->headertype= newtype;
-
- if (!newtype) {
- if (sa->headwin) {
- uiFreeBlocksWin(&sa->uiblocks, sa->headwin);
- closeheadwin(sa);
- }
- } else {
- if (!sa->headwin) {
- openheadwin(sa);
- }
- }
-
- testareas();
- mainqenter(DRAWEDGES, 1);
- winqueue_break= 1;
-}
-
-static void headmenu(ScrArea *sa)
-{
- short val= pupmenu("Header %t|Top%x2|Bottom %x1|No Header %x0");
-
- if(val> -1) {
- scrarea_change_headertype(sa, val);
- }
-}
-
-static void addqueue_ext(short win, unsigned short event, short val, char ascii)
-{
- if (win<4 || !areawinar[win]) {
- /* other win ids are for mainwin & renderwin */
- }
- else {
- BWinEvent evt;
-
- memset(&evt, 0, sizeof(evt));
- evt.event= event;
- evt.val= val;
- evt.ascii= ascii;
-
- bwin_qadd(win, &evt);
- }
-}
-
-void addqueue(short win, unsigned short event, short val)
-{
- addqueue_ext(win, event, val, 0);
-}
-
-void scrarea_queue_winredraw(ScrArea *area)
-{
- addqueue(area->win, REDRAW, 1);
-}
-void scrarea_queue_headredraw(ScrArea *area)
-{
- if (area->headwin) addqueue(area->headwin, REDRAW, 1);
-}
-void scrarea_queue_redraw(ScrArea *area)
-{
- scrarea_queue_winredraw(area);
- scrarea_queue_headredraw(area);
-}
-
-static void scrollheader(ScrArea *area);
-static void scrarea_dispatch_header_events(ScrArea *sa)
-{
- ScrArea *tempsa;
- BWinEvent evt;
- short do_redraw=0, do_change=0;
-
- areawinset(sa->headwin);
-
- while(bwin_qread(sa->headwin, &evt)) {
- if(evt.val) {
- if( uiDoBlocks(&curarea->uiblocks, evt.event, 1)!=UI_NOTHING ) evt.event= 0;
-
- switch(evt.event) {
- case UI_BUT_EVENT:
- do_headerbuttons(evt.val);
- break;
-
- case LEFTMOUSE:
- if (G.qual & LR_CTRLKEY) {
- window_lower(mainwin);
- } else {
- window_raise(mainwin);
- }
- break;
-
- case MIDDLEMOUSE:
- scrollheader(sa);
- break;
- case RIGHTMOUSE:
- headmenu(sa);
- break;
- case REDRAW:
- do_redraw= 1;
- break;
- case CHANGED:
- sa->head_swap= 0;
- do_change= 1;
- do_redraw= 1;
- break;
- default:
- if (winqueue_break == 0) {
- scrarea_do_winhandle(sa, &evt);
- if (winqueue_break == 0) areawinset(sa->headwin);
- }
- }
-
- if(winqueue_break) return;
- }
- }
-
- /* test: does window still exist? */
- tempsa= areawinar[sa->headwin];
- if(tempsa==0) return;
-
- /* this functional separation does not work as well as i expected... */
- if(do_change) scrarea_do_headchange(sa);
- if(do_redraw) scrarea_do_headdraw(sa);
-}
-
-static void scrarea_dispatch_events(ScrArea *sa)
-{
- ScrArea *tempsa;
- BWinEvent evt;
- short do_redraw=0, do_change=0;
-
- if(sa!=curarea || sa->win!=mywinget()) areawinset(sa->win);
-
- while(bwin_qread(sa->win, &evt)) {
- if(evt.event==REDRAW) {
- do_redraw= 1;
- }
- else if(evt.event==CHANGED) {
- sa->win_swap= 0;
- do_change= 1;
- do_redraw= 1;
- }
- else {
- scrarea_do_winhandle(sa, &evt);
- }
-
- if(winqueue_break) return;
- }
-
- /* test: does window still exist */
- tempsa= areawinar[sa->win];
- if(tempsa==0) return;
-
- if (do_change || do_redraw) {
- areawinset(sa->win);
- if(do_change)
- scrarea_do_winchange(curarea);
- if(do_redraw)
- scrarea_do_windraw(curarea);
- }
-}
-
-/***/
-
-
-void markdirty_all()
-{
- ScrArea *sa;
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->win) {
- scrarea_queue_winredraw(sa);
- sa->win_swap &= ~WIN_FRONT_OK;
- }
- if(sa->headwin) {
- scrarea_queue_headredraw(sa);
- sa->head_swap &= ~WIN_FRONT_OK;
- }
- }
-}
-
-/* but no redraw! */
-void markdirty_all_back(void)
-{
- ScrArea *sa;
-
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->win) {
- sa->win_swap &= ~WIN_BACK_OK;
- }
- if(sa->headwin) {
- sa->head_swap &= ~WIN_BACK_OK;
- }
- }
-
- /* if needed; backbuffer selection redraw */
- if(G.vd) G.vd->flag |= V3D_NEEDBACKBUFDRAW;
-
-}
-
-void markdirty_win_back(short winid)
-{
- ScrArea *sa= areawinar[winid];
- if(sa) {
- if(sa->win==winid) sa->win_swap &= ~WIN_BACK_OK;
- else sa->head_swap &= ~WIN_BACK_OK;
- }
-}
-
-
-int is_allowed_to_change_screen(bScreen *new)
-{
- /* not when curscreen is full
- * not when obedit && old->scene!=new->scene
- */
-
- if(new==0) return 0;
- if(G.curscreen->full != SCREENNORMAL) return 0;
- if(curarea->full) return 0;
- if(G.obedit) {
- if(G.curscreen->scene!=new->scene) return 0;
- }
- return 1;
-}
-
-void splash(void *data, int datasize, char *string)
-{
- ImBuf *bbuf;
- int oldwin;
- short val;
-
- bbuf= IMB_ibImageFromMemory((int *)data, datasize, IB_rect);
-
- if (bbuf) {
- oldwin = mywinget();
- mywinset(G.curscreen->mainwin);
-
- if (string) {
- int x, y, maxy;
- unsigned int *rect;
-
- rect = bbuf->rect;
- maxy = MIN2(bbuf->y, 18);
-
- for (y = 0; y < maxy; y++) {
- for (x = 0; x < bbuf->x; x++) {
- *rect = 0xffffffff;
- rect++;
- }
- }
- }
- glDrawBuffer(GL_FRONT);
-
- uiDrawBoxShadow(200, (prefsizx-bbuf->x)/2, (prefsizy-bbuf->y)/2, (prefsizx+bbuf->x)/2, (prefsizy+bbuf->y)/2);
-
- glRasterPos2i((prefsizx-bbuf->x)/2, (prefsizy-bbuf->y)/2);
- glDrawPixels(bbuf->x, bbuf->y, GL_RGBA, GL_UNSIGNED_BYTE, bbuf->rect);
-
- if (string) {
- void *font;
- int width;
-
- if (BMF_GetStringWidth(font= G.font, string) > bbuf->x)
- if (BMF_GetStringWidth(font= G.fonts, string) > bbuf->x)
- font= G.fontss;
-
- width= BMF_GetStringWidth(font, string);
-
- glColor3ub(0, 0, 0);
- glRasterPos2i((prefsizx-width)/2, (prefsizy-bbuf->y)/2 + 6);
- BMF_DrawString(font, string);
- }
-
- bglFlush();
- glDrawBuffer(GL_BACK);
-
- IMB_freeImBuf(bbuf);
-
- // flush input buffers ....
- // this might break some things
-
- while (get_mbut()) {
- BIF_wait_for_statechange();
- }
- while(qtest()) {
- extern_qread(&val);
- }
-
- wait_for_event();
-
- mywinset(oldwin);
- markdirty_all();
- mainqenter(DRAWEDGES, 1);
- }
-}
-
-static void moveareas(ScrEdge *edge);
-static void joinarea_interactive(ScrArea *area, ScrEdge *onedge);
-static void splitarea_interactive(ScrArea *area, ScrEdge *onedge);
-static ScrArea *test_edge_area(ScrArea *sa, ScrEdge *se);
-static ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2);
-
-static int isjoinable(ScrArea *area, ScrEdge *onedge)
-{
- struct ScrArea *sa1 = area, *sa2;
- struct ScrEdge *se;
-
- sa1 = test_edge_area(sa1, onedge);
- if(sa1==0) return 0;
-
- /* find directions with same edge */
- sa2= G.curscreen->areabase.first;
- while(sa2) {
- if(sa2 != sa1) {
- se= screen_findedge(G.curscreen, sa2->v1, sa2->v2);
- if(onedge==se) return 1;
- se= screen_findedge(G.curscreen, sa2->v2, sa2->v3);
- if(onedge==se) return 1;
- se= screen_findedge(G.curscreen, sa2->v3, sa2->v4);
- if(onedge==se) return 1;
- se= screen_findedge(G.curscreen, sa2->v4, sa2->v1);
- if(onedge==se) return 1;
- }
- sa2= sa2->next;
- }
-
- return 0;
-}
-
-static void screen_edge_edit_event(ScrArea *actarea, ScrEdge *actedge, short evt, short val)
-{
- if (val) {
- // don't allow users to edit full screens
- if (actarea && actarea->full)
- return;
-
- if (evt==LEFTMOUSE) {
- moveareas(actedge);
- } else if (evt==MIDDLEMOUSE || evt==RIGHTMOUSE) {
- int edgeop;
- char str[64] = "Split Area%x1|";
-
- if(isjoinable(actarea, actedge)) strcat(str, "Join Areas%x2|");
- if (actarea->headertype) strcat(str, "No Header%x3");
- else strcat(str, "Add Header%x3");
-
- edgeop= pupmenu(str);
- if (edgeop==1) splitarea_interactive(actarea, actedge);
- else if (edgeop==2) joinarea_interactive(actarea, actedge);
- else if (edgeop==3) scrarea_change_headertype(actarea,
- actarea->headertype?0:HEADERDOWN);
- }
- else blenderqread(evt, val); // global hotkeys
- }
-}
-
-/***/
-
-extern void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey);
-void test_scale_screen(bScreen *);
-
-static void resize_screens(int x, int y, int w, int h) {
- prefstax= x;
- prefstay= y;
- prefsizx= w;
- prefsizy= h;
-
- test_scale_screen(G.curscreen);
- testareas();
-}
-
-static void init_mainwin(void)
-{
- int orx, ory, sizex, sizey;
-
- glEnable(GL_SCISSOR_TEST);
-
- window_get_position(mainwin, &orx, &ory);
- window_get_size(mainwin, &sizex, &sizey);
-
- /* XXX, temporary stupid fix for minimize at windows */
- if (!sizex && !sizey) {
- return;
- }
-
- mywindow_init_mainwin(mainwin, orx, ory, sizex, sizey);
- resize_screens(orx, ory, sizex, sizey);
-}
-
-/***/
-
-static short afterqueue[MAXQUEUE][3];
-static int nafterqitems= 0;
-
-void addafterqueue(short win, unsigned short evt, short val)
-{
- if (nafterqitems<MAXQUEUE) {
- int a;
-
- /* only one afterqueue event of each type */
- for(a=0; a<nafterqitems; a++) {
- if(afterqueue[a][0]==win && afterqueue[a][1]==evt) {
- afterqueue[a][2]= val;
- return;
- }
- }
- afterqueue[nafterqitems][0]= win;
- afterqueue[nafterqitems][1]= evt;
- afterqueue[nafterqitems][2]= val;
- nafterqitems++;
- }
-}
-
-static void append_afterqueue(void)
-{
- while (nafterqitems) {
- short win= afterqueue[nafterqitems-1][0];
- unsigned short evt= afterqueue[nafterqitems-1][1];
- short val= afterqueue[nafterqitems-1][2];
-
- addqueue(win, evt, val);
-
- nafterqitems--;
- }
-}
-
-/* check for event in afterqueue, used in force_draw in space.c */
-int afterqtest(short win, unsigned short evt)
-{
- int a;
-
- for(a=0; a<nafterqitems; a++) {
- if(afterqueue[a][0]==win && afterqueue[a][1]==evt) return 1;
- }
- return 0;
-}
-
-
-static char ext_load_str[256]= {0, 0};
-
-static short ext_reshape= 0, ext_redraw=0, ext_inputchange=0, ext_mousemove=0, ext_undopush=0;
-
-static void flush_extqd_events(void) {
- if (ext_inputchange) {
- mainqenter(INPUTCHANGE, ext_inputchange);
- } else if (ext_reshape) {
- mainqenter(RESHAPE, ext_redraw);
- } else if (ext_redraw) {
- mainqenter(REDRAW, ext_redraw);
- } else if (ext_undopush) {
- mainqenter(UNDOPUSH, ext_undopush);
- } else if (ext_mousemove) {
- short mouse[2];
-
- getmouseco_sc(mouse);
-
- mainqenter(MOUSEX, mouse[0]);
- mainqenter(MOUSEY, mouse[1]);
- }
-
- ext_inputchange= ext_reshape= ext_redraw= ext_mousemove= ext_undopush= 0;
-}
-
-int qtest(void)
-{
- if (!mainqtest()) {
- winlay_process_events(0);
- }
-
- return mainqtest();
-}
-
- /* return true if events are waiting anywhere */
-int anyqtest(void)
-{
- ScrArea *sa;
-
- if (nafterqitems || qtest()) return 1;
-
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if (bwin_qtest(sa->win)) return 1;
- if (sa->headwin && bwin_qtest(sa->headwin)) return 1;
- }
-
- return 0;
-}
-
-static void wait_for_event(void)
-{
- while (!mainqtest()) {
- winlay_process_events(1);
- }
-}
-
-unsigned short screen_qread(short *val, char *ascii)
-{
- unsigned short event;
-
- wait_for_event();
-
- event= mainqread(val, ascii);
-
- if(event==RIGHTSHIFTKEY || event==LEFTSHIFTKEY) {
- if(*val) G.qual |= LR_SHIFTKEY;
- else G.qual &= ~LR_SHIFTKEY;
- }
- else if(event==RIGHTALTKEY || event==LEFTALTKEY) {
- if(*val) G.qual |= LR_ALTKEY;
- else G.qual &= ~LR_ALTKEY;
- }
- else if(event==RIGHTCTRLKEY || event==LEFTCTRLKEY) {
- if(*val) G.qual |= LR_CTRLKEY;
- else G.qual &= ~LR_CTRLKEY;
- }
- else if(event==COMMANDKEY) { // OSX
- if(*val) G.qual |= LR_COMMANDKEY;
- else G.qual &= ~LR_COMMANDKEY;
- }
-
- return event;
-}
-
-unsigned short extern_qread_ext(short *val, char *ascii)
-{
- /* stores last INPUTCHANGE and last REDRAW */
- unsigned short event;
-
- event= screen_qread(val, ascii);
- if(event==RESHAPE) ext_reshape= *val;
- else if(event==REDRAW) ext_redraw= *val;
- else if(event==UNDOPUSH) ext_undopush= *val;
- else if(event==INPUTCHANGE) ext_inputchange= *val;
- else if(event==MOUSEY || event==MOUSEX) ext_mousemove= 1;
- else if((G.qual & (LR_CTRLKEY|LR_ALTKEY)) && event==F3KEY) {
- if(*val) {
- BIF_screendump(0);
- return ESCKEY; /* go out of menu, if that was set */
- }
- }
-
- return event;
-}
-unsigned short extern_qread(short *val)
-{
- char ascii;
- return extern_qread_ext(val, &ascii);
-}
-
-int blender_test_break(void)
-{
- if (!G.background) {
- static double ltime= 0;
- double curtime= PIL_check_seconds_timer();
-
- /* only check for breaks every 10 milliseconds
- * if we get called more often.
- */
- if ((curtime-ltime)>.001) {
- ltime= curtime;
-
- while(qtest()) {
- short val;
- if (extern_qread(&val) == ESCKEY) {
- G.afbreek= 1;
- }
- }
- }
- }
-
- return (G.afbreek==1);
-}
-
-void reset_autosave(void)
-{
- if(U.flag & USER_AUTOSAVE) {
- window_set_timer(mainwin, U.savetime*60*1000, AUTOSAVE_FILE);
- }
-}
-
-/* ************ handlers ************** */
-
-/* don't know yet how the handlers will evolve, for simplicity
-i choose for an array with eventcodes, this saves in a file!
-*/
-void add_screenhandler(bScreen *sc, short eventcode, short val)
-{
- short a;
-
- // find empty spot
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- if( sc->handler[a]==eventcode ) {
- sc->handler[a+1]= val;
- break;
- }
- else if( sc->handler[a]==0) {
- sc->handler[a]= eventcode;
- sc->handler[a+1]= val;
- break;
- }
- }
- if(a==SCREEN_MAXHANDLER) printf("error; max (4) screen handlers reached!\n");
-}
-
-void rem_screenhandler(bScreen *sc, short eventcode)
-{
- short a;
-
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- if( sc->handler[a]==eventcode) {
- sc->handler[a]= 0;
- break;
- }
- }
-}
-
-int has_screenhandler(bScreen *sc, short eventcode)
-{
- short a;
-
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- if( sc->handler[a]==eventcode) {
- return 1;
- }
- }
- return 0;
-}
-
-static void animated_screen(bScreen *sc, short val)
-{
- if ((val & TIME_WITH_SEQ_AUDIO)) {
- if(CFRA>=PEFRA) {
- CFRA= PSFRA;
- audiostream_stop();
- audiostream_start( CFRA );
- }
- else {
- int cfra = audiostream_pos();
- if(cfra <= CFRA) CFRA++;
- else CFRA= cfra;
- }
- }
- else {
- CFRA++;
- if(CFRA > PEFRA) CFRA= PSFRA;
- }
-
- update_for_newframe_nodraw(1);
-
- if(val & TIME_ALL_3D_WIN)
- allqueue(REDRAWVIEW3D, 0);
- else if(val & TIME_LEFTMOST_3D_WIN) {
- ScrArea *sa= sc->areabase.first, *samin=NULL;
- int min= 10000;
- for(; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- if(sa->winrct.xmin - sa->winrct.ymin < min) {
- samin= sa;
- min= sa->winrct.xmin - sa->winrct.ymin;
- }
- }
- }
- if(samin) scrarea_queue_winredraw(samin);
- }
- if(val & TIME_ALL_ANIM_WIN) allqueue(REDRAWANIM, 0);
- if(val & TIME_ALL_BUTS_WIN) allqueue(REDRAWBUTSALL, 0);
- if(val & TIME_SEQ) {
- allqueue(REDRAWSEQ, 0);
- }
-
- allqueue(REDRAWTIME, 0);
-}
-
-/* because we still have to cope with subloops, this function is called
-in viewmove() for example too */
-
-/* returns 1 if something was handled */
-/* restricts to frames-per-second setting for frequency of updates */
-int do_screenhandlers(bScreen *sc)
-{
- static double ltime=0.0;
- double swaptime, time;
- short a, done= 0;
-
- time = PIL_check_seconds_timer();
- swaptime= 1.0/FPS;
-
- /* only now do the handlers */
- if(swaptime < time-ltime || ltime==0.0) {
-
- ltime= time;
-
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- switch(sc->handler[a]) {
- case SCREEN_HANDLER_ANIM:
- animated_screen(sc, sc->handler[a+1]);
- done= 1;
- break;
- case SCREEN_HANDLER_PYTHON:
- done= 1;
- break;
- case SCREEN_HANDLER_VERSE:
-#ifdef WITH_VERSE
- b_verse_update();
-#endif
-
- done= 1;
- break;
- }
- }
- }
- else if( qtest()==0) PIL_sleep_ms(5); // 5 milliseconds pause, for idle
-
- /* separate check for if we need to add to afterqueue */
- /* is only to keep mainqueue awqke */
- for(a=0; a<SCREEN_MAXHANDLER; a+=2) {
- if(sc->handler[a]) {
- ScrArea *sa= sc->areabase.first;
- if(sa->headwin) addafterqueue(sa->headwin, SCREEN_HANDLER, 1);
- else addafterqueue(sa->win, SCREEN_HANDLER, 1);
- }
- }
-
- return done;
-}
-
-/* ****** end screen handlers ************ */
-
-static void drawscreen(void)
-{
- ScrArea *sa;
-
- mywinset(G.curscreen->mainwin);
- myortho2(-0.375, (float)G.curscreen->sizex-0.375, -0.375, (float)G.curscreen->sizey-0.375);
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- drawscredge_area(sa);
- sa= sa->next;
- }
-
- /* this double draw patch seems to be needed for certain sgi's (octane, indigo2) */
-#if defined(__sgi) || defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__)
- glDrawBuffer(GL_FRONT);
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- drawscredge_area(sa);
- sa= sa->next;
- }
-
- glDrawBuffer(GL_BACK);
-#endif
-}
-
-static void screen_dispatch_events(void) {
- int events_remaining= 1;
- ScrArea *sa;
-
- window_make_active(mainwin); // added it here instead of screenmain (ton)
-
- while (events_remaining) {
- events_remaining= 0;
-
- winqueue_break= 0;
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- /* first check header, then rest. Header sometimes has initialization code */
- if (sa->headwin && bwin_qtest(sa->headwin)) {
- scrarea_dispatch_header_events(sa);
- events_remaining= 1;
- }
- if (winqueue_break) break;
-
- if (bwin_qtest(sa->win)) {
- scrarea_dispatch_events(sa);
- events_remaining= 1;
- }
- if (winqueue_break) break;
- }
-
- if (winqueue_break) break;
- }
-
- /* winqueue_break isnt the best of all solutions... but it is called on switching screens,
- so drawing should wait for all redraw/init events to be handled */
- if (winqueue_break==0) {
- if (dodrawscreen) {
- drawscreen();
- dodrawscreen= 0;
- }
-
- screen_swapbuffers();
- do_screenhandlers(G.curscreen);
- }
-}
-
-static ScrArea *screen_find_area_for_pt(bScreen *sc, short *mval)
-{
- ScrArea *sa;
-
- /* hotspot area of 1 pixel extra */
-
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- if( sa->totrct.xmin + 1 < mval[0] )
- if( sa->totrct.ymin + 1 < mval[1] )
- if( sa->totrct.xmax - 1 > mval[0] )
- if( sa->totrct.ymax - 1 > mval[1] )
- return sa;
- }
- return NULL;
-}
-
-/* ugly yah, will disappear on better event system */
-/* is called from interface.c after button events */
-static char delayed_undo_name[64];
-void screen_delayed_undo_push(char *name)
-{
- strncpy(delayed_undo_name, name, 63);
- mainqenter(UNDOPUSH, 1);
-}
-
-void screenmain(void)
-{
- int has_input= 1;
- int firsttime = 1;
- int onload_script = 0;
-
- window_make_active(mainwin);
-
- while (1) {
- unsigned short event;
- short val, towin;
- char ascii;
-
- flush_extqd_events();
- if (nafterqitems && !qtest()) {
- append_afterqueue();
- event= val= ascii= 0;
- } else {
- event= screen_qread(&val, &ascii);
- }
-
- // window_make_active(mainwin); // (only for inputchange, removed, (ton))
-
- if (event==INPUTCHANGE) {
- window_make_active(mainwin);
- G.qual= get_qual();
- }
-
- /* If the main window is active, find the current active ScrArea
- * underneath the mouse cursor, updating the headers & cursor for
- * the appropriate internal window if things have changed.
- *
- * If the main window is not active, deactivate the internal
- * window.
- */
- if (has_input || g_activearea==NULL || G.curscreen->winakt) {
- ScrArea *newactarea;
- int newactwin;
- short mval[2];
-
- getmouseco_sc(mval);
- newactarea= screen_find_area_for_pt(G.curscreen, mval);
-
- if (newactarea) {
- if (BLI_in_rcti(&newactarea->headrct, mval[0], mval[1])) {
- newactwin= newactarea->headwin;
- set_cursor(CURSOR_STD);
- } else {
- newactwin= newactarea->win;
- }
- } else {
- newactwin= 0;
- }
-
- if (newactarea && (newactarea != g_activearea)) {
- if (g_activearea) scrarea_queue_headredraw(g_activearea);
- scrarea_queue_headredraw(newactarea);
- if (!(BLI_in_rcti(&newactarea->headrct, mval[0], mval[1]))) /* header always gets std cursor */
- set_cursor(newactarea->cursor);
- g_activearea= newactarea;
- }
- /* when you move mouse from header to window, buttons can remain hilited otherwise */
- if(newactwin != G.curscreen->winakt) {
- if (g_activearea) scrarea_queue_headredraw(g_activearea);
- }
- G.curscreen->winakt= newactwin;
-
- if (G.curscreen->winakt) {
- areawinset(G.curscreen->winakt);
- if (!(BLI_in_rcti(&newactarea->headrct, mval[0], mval[1]))) /* header always gets std cursor */
- set_cursor(choose_cursor(g_activearea));
- }
- }
- else {
- if (g_activearea) {
- scrarea_queue_headredraw(g_activearea);
- }
- g_activearea= NULL;
- G.curscreen->winakt= 0;
- }
-
- towin= 0;
- if (event==WINCLOSE) {
- exit_usiblender();
- }
- else if (event==DRAWEDGES) {
- dodrawscreen= 1;
- }
- else if (event==RESHAPE) {
- init_mainwin();
- markdirty_all();
- dodrawscreen= 1;
- }
- else if (event==REDRAW) {
- markdirty_all();
- dodrawscreen= 1;
- }
- else if( event==UNDOPUSH) {
- BIF_undo_push(delayed_undo_name);
- }
- else if (event==AUTOSAVE_FILE) {
- BIF_write_autosave();
- }
- else if (event==LOAD_FILE) {
- BIF_read_file(ext_load_str);
- sound_initialize_sounds();
- }
-#ifndef DISABLE_PYTHON
- else if ((event==ONLOAD_SCRIPT) && BPY_has_onload_script()) {
- /* event queued in setup_app_data() in blender.c, where G.f is checked */
- onload_script = 1;
- firsttime = 1; /* see last 'if' in this function */
- }
-#endif
- else {
- towin= 1;
- }
-
- if (!g_activearea) {
- towin= 0;
- }
- else if (event==QKEY) {
- /* Temp place to print mem debugging info ctrl+alt+shift + qkey */
- if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- MEM_printmemlist_stats();
- }
-
- else if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT);
- else {
- if(val && (G.qual == LR_CTRLKEY)) {
- if(okee("Quit Blender")) exit_usiblender();
- }
- towin= 0;
- }
- }
- else if (event==RIGHTARROWKEY) {
- if(textediting==0 && val && (G.qual & LR_CTRLKEY)) {
- bScreen *sc= G.curscreen->id.next;
-
- /* if screen is last, set it to first */
- if(sc == NULL)
- sc= G.main->screen.first;
-
- if(is_allowed_to_change_screen(sc)) setscreen(sc);
- g_activearea= NULL;
- towin= 0;
- }
- }
- else if (event==LEFTARROWKEY) {
- if(textediting==0 && val && (G.qual & LR_CTRLKEY)) {
- bScreen *sc= G.curscreen->id.prev;
-
- /* if screen is first, set it to last */
- if(sc == NULL)
- sc= G.main->screen.last;
-
- if(is_allowed_to_change_screen(sc)) setscreen(sc);
- g_activearea= NULL;
- towin= 0;
- }
- }
- else if (!G.curscreen->winakt) {
- ScrEdge *actedge;
- short mval[2];
-
- getmouseco_sc(mval);
- actedge= screen_find_active_scredge(G.curscreen, mval);
-
- if (actedge) {
- if (scredge_is_horizontal(actedge)) {
- set_cursor(CURSOR_Y_MOVE);
- } else {
- set_cursor(CURSOR_X_MOVE);
- }
- // this does global hotkeys too
- screen_edge_edit_event(g_activearea, actedge, event, val);
- } else {
- set_cursor(CURSOR_STD);
- }
-
- towin= 0;
- }
- else if (event==ZKEY) {
- if(val && G.qual==(LR_ALTKEY|LR_SHIFTKEY|LR_CTRLKEY)) {
- extern void set_debug_swapbuffers_ovveride(bScreen *sc, int mode);
-
- int which= pupmenu("Swapbuffers%t|Simple|Debug|DebugSwap|Redraw|Default|KillSwap");
-
- switch (which) {
- case 1: set_debug_swapbuffers_ovveride(G.curscreen, 's'); break;
- case 2: set_debug_swapbuffers_ovveride(G.curscreen, 'd'); break;
- case 3: set_debug_swapbuffers_ovveride(G.curscreen, 'f'); break;
- case 4: set_debug_swapbuffers_ovveride(G.curscreen, 'r'); break;
- case 5: set_debug_swapbuffers_ovveride(G.curscreen, 0); break;
- case 6:
- if (g_activearea) {
- g_activearea->head_swap= 0;
- g_activearea->win_swap= 0;
- }
- break;
- }
- towin= 0;
- }
- }
- else if (event==SPACEKEY) {
- if ((g_activearea->spacetype!=SPACE_TEXT) &&
- ( !((g_activearea->spacetype==SPACE_VIEW3D) && ((G.obedit) && G.obedit->type==OB_FONT)) ) &&
- val &&
- (G.qual & LR_SHIFTKEY)) {
- area_fullscreen();
- g_activearea= NULL;
- towin= 0;
- }
- else {
- if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT||g_activearea->spacetype==SPACE_SEQ);
- else if(G.qual==0) {
- if(val) toolbox_n();
- towin= 0;
- }
- }
- }
- else if(ELEM(event, UPARROWKEY, DOWNARROWKEY)) {
- if(val && (G.qual & LR_CTRLKEY)) {
- area_fullscreen();
- g_activearea= NULL;
- towin= 0;
- }
- }
-
- if (towin && event) {
- if (blenderqread(event, val)) // the global keys
- addqueue_ext(G.curscreen->winakt, event, val, ascii);
- }
-
- /* only process subwindow queue's once the
- * main queue has been emptyied.
- */
- event= qtest();
- if (event==0 || event==EXECUTE) {
- screen_dispatch_events();
- }
-
- if(G.f & G_DEBUG) {
- GLenum error = glGetError();
- if (error)
- printf("GL error: %s\n", gluErrorString(error));
- }
- /* Bizar hack. The event queue has mutated... */
- if ( (firsttime) && (event == 0) ) {
-#ifndef DISABLE_PYTHON
- if (onload_script) {
- /* OnLoad scriptlink */
- BPY_do_pyscript(&G.scene->id, SCRIPT_ONLOAD);
- onload_script = 0;
- } else
-#endif
- if (G.fileflags & G_FILE_AUTOPLAY) {
- // SET AUTOPLAY in G.flags for
- // other fileloads
-
- G.flags |= G_FILE_AUTOPLAY;
- area_autoplayscreen();
-
- // Let The Games Begin
- // fake a 'p' keypress
-
- mainqenter(PKEY, 1);
- } else {
- extern char datatoc_splash_jpg[];
- extern int datatoc_splash_jpg_size;
-
- //if (! ((G.main->versionfile >= G.version)
- // || G.save_over)) {
- splash((void *)datatoc_splash_jpg,
- datatoc_splash_jpg_size, NULL);
- //}
- }
- firsttime = 0;
- }
- }
-}
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
-void mainwindow_toggle_fullscreen(int fullscreen)
-{
- if (fullscreen) U.uiflag |= USER_FLIPFULLSCREEN;
- else U.uiflag &= ~USER_FLIPFULLSCREEN;
-
- window_toggle_fullscreen(mainwin, fullscreen);
-}
-#endif
-
-void mainwindow_raise(void)
-{
- if(mainwin)
- window_raise(mainwin);
-}
-
-void mainwindow_make_active(void)
-{
- if(mainwin)
- window_make_active(mainwin);
-}
-
-void mainwindow_close(void)
-{
- if(mainwin)
- window_destroy(mainwin);
- mainwin= NULL;
-}
-
-void mainwindow_set_filename_to_title(char *filename)
-{
- char str[FILE_MAXDIR + FILE_MAXFILE];
- char dir[FILE_MAXDIR];
- char file[FILE_MAXFILE];
-
- BLI_split_dirfile_basic(filename, dir, file);
-
- if(BLI_streq(file, ".B.blend") || filename[0] =='\0')
- sprintf(str, "Blender");
- else
- sprintf(str, "Blender [%s]", filename);
-
- window_set_title(mainwin, str);
-}
-
-/* ********* AREAS ************* */
-
-void setprefsize(int stax, int stay, int sizx, int sizy, int maximized)
-{
- int scrwidth, scrheight;
-
- winlay_get_screensize(&scrwidth, &scrheight);
-
- if(sizx<320) sizx= 320;
- if(sizy<256) sizy= 256;
-
- if(stay+sizy>scrheight) {
- fprintf(stderr," height prob \n");
- sizy= scrheight-stay;
- }
-
- if(sizx<320 || sizy<256) {
- printf("ERROR: illegal prefsize\n");
- return;
- }
-
- prefstax= stax;
- prefstay= stay;
- prefsizx= sizx;
- prefsizy= sizy;
-
- start_maximized= maximized;
-}
-
-
-static ScrVert *screen_addvert(bScreen *sc, short x, short y)
-{
- ScrVert *sv= MEM_callocN(sizeof(ScrVert), "addscrvert");
- sv->vec.x= x;
- sv->vec.y= y;
-
- BLI_addtail(&sc->vertbase, sv);
- return sv;
-}
-
-static void sortscrvert(ScrVert **v1, ScrVert **v2)
-{
- ScrVert *tmp;
-
- if (*v1 > *v2) {
- tmp= *v1;
- *v1= *v2;
- *v2= tmp;
- }
-}
-
-static ScrEdge *screen_addedge(bScreen *sc, ScrVert *v1, ScrVert *v2)
-{
- ScrEdge *se= MEM_callocN(sizeof(ScrEdge), "addscredge");
-
- sortscrvert(&v1, &v2);
- se->v1= v1;
- se->v2= v2;
-
- BLI_addtail(&sc->edgebase, se);
- return se;
-}
-
-static ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2)
-{
- ScrEdge *se;
-
- sortscrvert(&v1, &v2);
- for (se= sc->edgebase.first; se; se= se->next)
- if(se->v1==v1 && se->v2==v2)
- return se;
-
- return NULL;
-}
-
-static void removedouble_scrverts(void)
-{
- ScrVert *v1, *verg;
- ScrEdge *se;
- ScrArea *sa;
-
- verg= G.curscreen->vertbase.first;
- while(verg) {
- if(verg->newv==0) { /* !!! */
- v1= verg->next;
- while(v1) {
- if(v1->newv==0) { /* !?! */
- if(v1->vec.x==verg->vec.x && v1->vec.y==verg->vec.y) {
- /* printf("doublevert\n"); */
- v1->newv= verg;
- }
- }
- v1= v1->next;
- }
- }
- verg= verg->next;
- }
-
- /* replace pointers in edges and faces */
- se= G.curscreen->edgebase.first;
- while(se) {
- if(se->v1->newv) se->v1= se->v1->newv;
- if(se->v2->newv) se->v2= se->v2->newv;
- /* edges changed: so.... */
- sortscrvert(&(se->v1), &(se->v2));
- se= se->next;
- }
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->v1->newv) sa->v1= sa->v1->newv;
- if(sa->v2->newv) sa->v2= sa->v2->newv;
- if(sa->v3->newv) sa->v3= sa->v3->newv;
- if(sa->v4->newv) sa->v4= sa->v4->newv;
- sa= sa->next;
- }
-
- /* remove */
- verg= G.curscreen->vertbase.first;
- while(verg) {
- v1= verg->next;
- if(verg->newv) {
- BLI_remlink(&G.curscreen->vertbase, verg);
- MEM_freeN(verg);
- }
- verg= v1;
- }
-
-}
-
-static void removenotused_scrverts(void)
-{
- ScrVert *sv, *svn;
- ScrEdge *se;
-
- /* we assume edges are ok */
-
- se= G.curscreen->edgebase.first;
- while(se) {
- se->v1->flag= 1;
- se->v2->flag= 1;
- se= se->next;
- }
-
- sv= G.curscreen->vertbase.first;
- while(sv) {
- svn= sv->next;
- if(sv->flag==0) {
- BLI_remlink(&G.curscreen->vertbase, sv);
- MEM_freeN(sv);
- }
- else sv->flag= 0;
- sv= svn;
- }
-}
-
-static void removedouble_scredges(void)
-{
- ScrEdge *verg, *se, *sn;
-
- /* compare */
- verg= G.curscreen->edgebase.first;
- while(verg) {
- se= verg->next;
- while(se) {
- sn= se->next;
- if(verg->v1==se->v1 && verg->v2==se->v2) {
- BLI_remlink(&G.curscreen->edgebase, se);
- MEM_freeN(se);
- }
- se= sn;
- }
- verg= verg->next;
- }
-}
-
-static void removenotused_scredges(void)
-{
- ScrEdge *se, *sen;
- ScrArea *sa;
- int a=0;
-
- /* sets flags when edge is used in area */
- sa= G.curscreen->areabase.first;
- while(sa) {
- se= screen_findedge(G.curscreen, sa->v1, sa->v2);
- if(se==0) printf("error: area %d edge 1 bestaat niet\n", a);
- else se->flag= 1;
- se= screen_findedge(G.curscreen, sa->v2, sa->v3);
- if(se==0) printf("error: area %d edge 2 bestaat niet\n", a);
- else se->flag= 1;
- se= screen_findedge(G.curscreen, sa->v3, sa->v4);
- if(se==0) printf("error: area %d edge 3 bestaat niet\n", a);
- else se->flag= 1;
- se= screen_findedge(G.curscreen, sa->v4, sa->v1);
- if(se==0) printf("error: area %d edge 4 bestaat niet\n", a);
- else se->flag= 1;
- sa= sa->next;
- a++;
- }
- se= G.curscreen->edgebase.first;
- while(se) {
- sen= se->next;
- if(se->flag==0) {
- BLI_remlink(&G.curscreen->edgebase, se);
- MEM_freeN(se);
- }
- else se->flag= 0;
- se= sen;
- }
-}
-
-void calc_arearcts(ScrArea *sa)
-{
-
- if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1;
- else sa->totrct.xmin= sa->v1->vec.x;
- if(sa->v4->vec.x<G.curscreen->sizex-1) sa->totrct.xmax= sa->v4->vec.x-1;
- else sa->totrct.xmax= sa->v4->vec.x;
-
- if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1;
- else sa->totrct.ymin= sa->v1->vec.y;
- if(sa->v2->vec.y<G.curscreen->sizey-1) sa->totrct.ymax= sa->v2->vec.y-1;
- else sa->totrct.ymax= sa->v2->vec.y;
-
- sa->winrct= sa->totrct;
- sa->headrct= sa->totrct;
- if(sa->headertype) {
- if(sa->headertype==HEADERDOWN) {
- sa->headrct.ymax= sa->headrct.ymin+HEADERY;
- sa->winrct.ymin= sa->headrct.ymax+1;
- }
- else if(sa->headertype==HEADERTOP) {
- sa->headrct.ymin= sa->headrct.ymax-HEADERY;
- sa->winrct.ymax= sa->headrct.ymin-1;
- }
- }
- else {
- sa->headrct.ymax= sa->headrct.ymin;
- }
- if(sa->winrct.ymin>sa->winrct.ymax) sa->winrct.ymin= sa->winrct.ymax;
-
- /* for speedup */
- sa->winx= sa->winrct.xmax-sa->winrct.xmin+1;
- sa->winy= sa->winrct.ymax-sa->winrct.ymin+1;
-}
-
-static void openheadwin(ScrArea *sa)
-{
- sa->headwin= myswinopen(G.curscreen->mainwin,
- sa->headrct.xmin, sa->headrct.xmax, sa->headrct.ymin, sa->headrct.ymax);
-
- glMatrixMode(GL_MODELVIEW);
-
- areawinar[sa->headwin]= sa; /* otherwise addqueue does not work */
-
- scrarea_do_headchange(sa); /* headchange is no callback, apply right away. this is for render-to-imagewindow... this can be called on startup by sequencer, which invokes redraw before all events are handled. bad stuff... */
- addqueue(sa->headwin, CHANGED, 1);
-}
-
-static void openareawin(ScrArea *sa)
-{
- sa->win= myswinopen(G.curscreen->mainwin,
- sa->winrct.xmin, sa->winrct.xmax, sa->winrct.ymin, sa->winrct.ymax);
-
- areawinar[sa->win]= sa; /* otherwise addqueue does not work */
- addqueue(sa->win, CHANGED, 1);
-}
-
-static void closeheadwin(ScrArea *sa)
-{
- if(sa->headwin) mywinclose(sa->headwin);
- sa->headwin= 0;
-}
-
-static void closeareawin(ScrArea *sa)
-{
- uiFreeBlocksWin(&sa->uiblocks, sa->win);
-
- if(sa->win) mywinclose(sa->win);
- sa->win= 0;
-}
-
-static void del_area(ScrArea *sa)
-{
- closeareawin(sa);
- closeheadwin(sa);
-
- freespacelist(sa);
-
- uiFreeBlocks(&sa->uiblocks);
- uiFreePanels(&sa->panels);
-#ifndef DISABLE_PYTHON
- BPY_free_scriptlink(&sa->scriptlink);
-#endif
- if(sa==curarea) curarea= NULL;
- if(sa==g_activearea) g_activearea= NULL;
-}
-
-/* sa2 to sa1, we swap spaces for fullscreen to keep all allocated data */
-static void copy_areadata(ScrArea *sa1, ScrArea *sa2, int swap_space)
-{
- Panel *pa1, *pa2, *patab;
- ScriptLink *slink1 = &sa1->scriptlink, *slink2 = &sa2->scriptlink;
-
- sa1->headertype= sa2->headertype;
- sa1->spacetype= sa2->spacetype;
- Mat4CpyMat4(sa1->winmat, sa2->winmat);
-
- if(swap_space) {
- SWAP(ListBase, sa1->spacedata, sa2->spacedata);
- /* exception: ensure preview is reset */
- if(sa1->spacetype==SPACE_VIEW3D)
- BIF_view3d_previewrender_free(sa1->spacedata.first);
- }
- else {
- freespacelist(sa1);
- duplicatespacelist(sa1, &sa1->spacedata, &sa2->spacedata);
- }
-
- BLI_freelistN(&sa1->panels);
- duplicatelist(&sa1->panels, &sa2->panels);
-
- /* space handler script links */
- if (slink1->totscript) {
- MEM_freeN(slink1->scripts);
- MEM_freeN(slink1->flag);
- slink1->totscript = 0;
- }
- if (slink2->totscript) {
- slink1->scripts = MEM_dupallocN(slink2->scripts);
- slink1->flag = MEM_dupallocN(slink2->flag);
- slink1->totscript = slink2->totscript;
- }
-
- /* copy pointers */
- pa1= sa1->panels.first;
- while(pa1) {
-
- patab= sa1->panels.first;
- pa2= sa2->panels.first;
- while(patab) {
- if( pa1->paneltab == pa2) {
- pa1->paneltab = patab;
- break;
- }
- patab= patab->next;
- pa2= pa2->next;
- }
- pa1= pa1->next;
- }
-}
-
-static ScrArea *screen_addarea(bScreen *sc, ScrVert *v1, ScrVert *v2, ScrVert *v3, ScrVert *v4, short headertype, short spacetype)
-{
- ScrArea *sa= MEM_callocN(sizeof(ScrArea), "addscrarea");
- sa->cursor= CURSOR_STD;
- sa->v1= v1;
- sa->v2= v2;
- sa->v3= v3;
- sa->v4= v4;
- sa->headertype= headertype;
- sa->spacetype= spacetype;
-
- calc_arearcts(sa);
-
- if (sa->headertype) openheadwin(sa);
- openareawin(sa);
-
- BLI_addtail(&sc->areabase, sa);
- return sa;
-}
-
-static int rcti_eq(rcti *a, rcti *b) {
- return ((a->xmin==b->xmin && a->xmax==b->xmax) &&
- (a->ymin==b->ymin && a->ymax==b->ymax));
-}
-
-static void testareas(void)
-{
- ScrArea *sa, *next;
-
- /* test for header, if removed, or moved */
- /* test for window, if removed, or moved */
-
- for(sa= G.curscreen->areabase.first; sa; sa= next) {
- rcti oldhr= sa->headrct;
- rcti oldwr= sa->winrct;
-
- next= sa->next;
-
- calc_arearcts(sa);
-
- /* ilegally scaled down area.... */
- if(sa->totrct.xmin>=sa->totrct.xmax || sa->totrct.ymin>=sa->totrct.ymax) {
- del_area(sa);
- BLI_remlink(&G.curscreen->areabase, sa);
- MEM_freeN(sa);
- printf("Warning, removed zero sized window from screen %s\n", G.curscreen->id.name+2);
- }
- else {
- /* test header */
- if (sa->headwin) {
- if (!rcti_eq(&oldhr, &sa->headrct)) {
- mywinposition(sa->headwin, sa->headrct.xmin, sa->headrct.xmax, sa->headrct.ymin, sa->headrct.ymax);
- addqueue(sa->headwin, CHANGED, 1);
- }
-
- if(sa->headbutlen<sa->winx) {
- sa->headbutofs= 0;
- addqueue(sa->headwin, CHANGED, 1);
- }
- else if(sa->headbutofs+sa->winx > sa->headbutlen) {
- sa->headbutofs= sa->headbutlen-sa->winx;
- addqueue(sa->headwin, CHANGED, 1);
- }
- }
-
- if (!rcti_eq(&oldwr, &sa->winrct)) {
- SpaceLink *sl= sa->spacedata.first;
-
- mywinposition(sa->win, sa->winrct.xmin, sa->winrct.xmax, sa->winrct.ymin, sa->winrct.ymax);
- addqueue(sa->win, CHANGED, 1);
-
- /* exception handling... probably we need generic event */
- for(; sl; sl= sl->next)
- if(sl->spacetype==SPACE_VIEW3D)
- BIF_view3d_previewrender_free((View3D *)sl);
- }
- }
- }
-
- /* remake global windowarray */
- memset(areawinar, 0, sizeof(void *)*MAXWIN);
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- areawinar[sa->headwin]= sa;
- areawinar[sa->win]= sa;
- }
-
- /* test if winakt is OK */
- if( areawinar[G.curscreen->winakt]==0) G.curscreen->winakt= 0;
-}
-
-static ScrArea *test_edge_area(ScrArea *sa, ScrEdge *se)
-{
- /* test if edge is in area, if not,
- then find an area that has it */
-
- ScrEdge *se1=0, *se2=0, *se3=0, *se4=0;
-
- if(sa) {
- se1= screen_findedge(G.curscreen, sa->v1, sa->v2);
- se2= screen_findedge(G.curscreen, sa->v2, sa->v3);
- se3= screen_findedge(G.curscreen, sa->v3, sa->v4);
- se4= screen_findedge(G.curscreen, sa->v4, sa->v1);
- }
- if(se1!=se && se2!=se && se3!=se && se4!=se) {
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- /* a bit optimise? */
- if(se->v1==sa->v1 || se->v1==sa->v2 || se->v1==sa->v3 || se->v1==sa->v4) {
- se1= screen_findedge(G.curscreen, sa->v1, sa->v2);
- se2= screen_findedge(G.curscreen, sa->v2, sa->v3);
- se3= screen_findedge(G.curscreen, sa->v3, sa->v4);
- se4= screen_findedge(G.curscreen, sa->v4, sa->v1);
- if(se1==se || se2==se || se3==se || se4==se) return sa;
- }
- sa= sa->next;
- }
- }
-
- return sa; /* is null when not find */
-}
-
-ScrArea *closest_bigger_area(void)
-{
- ScrArea *sa, *big=0;
- float cent[3], vec[3],len, len1, len2, len3, dist=1000;
- short mval[2];
-
- getmouseco_sc(mval);
-
- cent[0]= mval[0];
- cent[1]= mval[1];
- cent[2]= vec[2]= 0;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa!=curarea) {
- if(sa->winy>=curarea->winy) {
-
- /* mimimum of the 4 corners */
- vec[0]= sa->v1->vec.x; vec[1]= sa->v1->vec.y;
- len= VecLenf(vec, cent);
- vec[0]= sa->v2->vec.x; vec[1]= sa->v2->vec.y;
- len1= VecLenf(vec, cent);
- vec[0]= sa->v3->vec.x; vec[1]= sa->v3->vec.y;
- len2= VecLenf(vec, cent);
- vec[0]= sa->v4->vec.x; vec[1]= sa->v4->vec.y;
- len3= VecLenf(vec, cent);
-
- len= MIN4(len, len1, len2, len3);
-
- /* plus center */
- vec[0]= (sa->v2->vec.x+sa->v3->vec.x)/2;
- vec[1]= (sa->v1->vec.y+sa->v2->vec.y)/2;
-
- len+= 0.5*VecLenf(vec, cent);
-
- /* min size */
- len-= sa->winy+sa->winx;
-
- if(len<dist) {
- dist= len;
- big= sa;
- }
- }
- }
- sa= sa->next;
- }
-
- if(big) return big;
- else return curarea;
-}
-
-/* ************ SCREEN MANAGEMENT ************** */
-
-static int statechanged= 0;
-void BIF_wait_for_statechange(void)
-{
- if (!statechanged) {
- /* Safety, don't wait more than 0.1 seconds */
- double stime= PIL_check_seconds_timer();
- while (!statechanged) {
- winlay_process_events(1);
- if ((PIL_check_seconds_timer()-stime)>0.1) break;
- }
- statechanged= 0;
- }
- else PIL_sleep_ms(3); /* statechanged can be set '1' while holding mousebutton, causing locks */
-
-}
-void getmouse(short *mval)
-{
- winlay_process_events(0);
- window_get_mouse(mainwin, mval);
-}
-short get_qual(void)
-{
- winlay_process_events(0);
- return window_get_qual(mainwin);
-}
-short get_mbut(void)
-{
- winlay_process_events(0);
- return window_get_mbut(mainwin);
-}
-
-/* return values of tablet data related functions are documented
- * in the Window struct, ghostwinlay.c */
-float get_pressure(void)
-{
- winlay_process_events(0);
- return window_get_pressure(mainwin);
-}
-void get_tilt(float *xtilt, float *ytilt)
-{
- winlay_process_events(0);
- window_get_tilt(mainwin, xtilt, ytilt);
-}
-short get_activedevice(void)
-{
- winlay_process_events(0);
- return window_get_activedevice(mainwin);
-}
-
-void getndof(float *sbval)
-{
- winlay_process_events(0);
- window_get_ndof(mainwin, sbval);
-}
-
-void filterNDOFvalues(float *sbval)
-{
- int i=0;
- float max = 0.0;
-
- for (i =0; i<6;i++)
- if (fabs(sbval[i]) > max)
- max = fabs(sbval[i]);
- for (i =0; i<6;i++)
- if (fabs(sbval[i]) != max )
- sbval[i]=0.0;
-}
-
-void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii)
-{
-
- statechanged= 1;
-
- /* accept the extended ascii set (ton) */
- if( !val || ascii<32 ) {
- ascii= '\0';
- }
-
- mainqenter_ext(evt, val, ascii);
-}
-
-/* ScrVert ordering in a ScrArea:
-
-2---------3
-| |
-| |
-1---------4
-
-*/
-
-static bScreen *addscreen(char *name) /* use setprefsize() if you want something else than a full windpw */
-{
- /* this function sets variabele G.curscreen,
- * that global is about used everywhere!
- */
- bScreen *sc;
- ScrVert *sv1, *sv2, *sv3, *sv4;
- short startx, starty, endx, endy;
-
- sc= G.curscreen= alloc_libblock(&G.main->screen, ID_SCR, name);
-
- if (!prefsizx) {
- prefstax= 0;
- prefstay= 0;
-
- winlay_get_screensize(&prefsizx, &prefsizy);
- }
-
- startx= prefstax;
- starty= prefstay;
- endx= prefstax+prefsizx-1;
- endy= prefstay+prefsizy-1;
-
- sc->startx= startx; sc->starty= starty;
- sc->endx= endx; sc->endy= endy;
- sc->sizex= sc->endx-sc->startx+1;
- sc->sizey= sc->endy-sc->starty+1;
-
- sc->scene= G.scene;
-
- if (!mainwin) {
- if (G.windowstate == G_WINDOWSTATE_FULLSCREEN)
- mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, G_WINDOWSTATE_FULLSCREEN);
- else
- mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized);
-
- if (!mainwin) {
- printf("ERROR: Unable to open Blender window\n");
- exit(1);
- }
-
- window_set_handler(mainwin, add_to_mainqueue, NULL);
- window_open_ndof(mainwin); /* needs to occur once the mainwin handler is set */
- init_mainwin();
- mywinset(1);
-
- /* for visual speed, but still needed? */
- glClearColor(.55, .55, .55, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- window_swap_buffers(mainwin);
-
- /* this is unneeded and with large monitors can be a
- * pain so commenting out */
- /* warp_pointer(sc->sizex/2, sc->sizey/2); */
-
- mainqenter(REDRAW, 1);
- }
-
- sc->mainwin= 1;
-
- sv1= screen_addvert(sc, 0, 0);
- sv2= screen_addvert(sc, 0, sc->endy-sc->starty);
- sv3= screen_addvert(sc, sc->sizex-1, sc->sizey-1);
- sv4= screen_addvert(sc, sc->sizex-1, 0);
-
- screen_addedge(sc, sv1, sv2);
- screen_addedge(sc, sv2, sv3);
- screen_addedge(sc, sv3, sv4);
- screen_addedge(sc, sv4, sv1);
-
- screen_addarea(sc, sv1, sv2, sv3, sv4, HEADERDOWN, SPACE_INFO);
-
- G.curscreen= sc;
-
- return sc;
-}
-
-void setscreen(bScreen *sc)
-{
- bScreen *sc1;
- ScrArea *sa;
- short mval[2];
-
- if(sc->full) { /* find associated full */
- sc1= G.main->screen.first;
- while(sc1) {
- sa= sc1->areabase.first;
- if(sa->full==sc) {
- sc= sc1;
- break;
- }
- sc1= sc1->id.next;
- }
- if(sc1==0) printf("setscreen error\n");
- }
-
- /* de-activate G.curscreen */
- if (G.curscreen && G.curscreen != sc) {
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->win) mywinclose(sa->win);
- sa->win= 0;
- if(sa->headwin) mywinclose(sa->headwin);
- sa->headwin= 0;
-
- uiFreeBlocks(&sa->uiblocks);
-
- sa= sa->next;
- }
- }
- else if(G.curscreen) markdirty_all(); /* at least redraw */
-
- if (G.curscreen != sc) {
- mywinset(sc->mainwin);
- }
-
- G.curscreen= sc;
-
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- /* XXX, fixme zr */
-/* if (sa->win || sa->headwin) */
-/* printf("error in setscreen (win): %d, %d\n", sa->win, sa->headwin); */
- if (!sa->win)
- openareawin(sa);
- if (!sa->headwin && sa->headertype)
- openheadwin(sa);
- }
-
- /* recalculate winakt */
- getmouseco_sc(mval);
-
- test_scale_screen(sc);
- testareas();
-
- for(sa= sc->areabase.first; sa; sa= sa->next) {
- SpaceLink *sl;
-
- for(sl= sa->spacedata.first; sl; sl= sl->next) {
- sl->area= sa;
-
- if(sl->spacetype==SPACE_OOPS) {
- SpaceOops *soops= (SpaceOops *) sl;
-
- /* patch for old files */
- if(soops->v2d.cur.xmin==soops->v2d.cur.xmax) {
- init_v2d_oops(sa, soops);
- }
- }
- else if(sl->spacetype==SPACE_BUTS) {
- SpaceButs *sbuts= (SpaceButs *)sl;
- sbuts->re_align= 1; // force an align call, maybe new panels were added, also for after file reading
- }
- }
-
- sa->cursor= CURSOR_STD;
- }
-
- if(G.scene!=sc->scene)
- set_scene(sc->scene);
-
- countall();
-
- G.curscreen->winakt= 0;
- curarea= sc->areabase.first;
-
- mainqenter(DRAWEDGES, 1);
- dodrawscreen= 1; /* patch! even gets lost,,,? */
-
- winqueue_break= 1; /* means leave queue everywhere */
-}
-
-static void splitarea(ScrArea *sa, char dir, float fac);
-
-void area_fullscreen(void) /* with curarea */
-{
- /* this function toggles: if area is full then the parent will be restored */
- bScreen *sc, *oldscreen;
- ScrArea *sa, *newa, *old;
- short headertype, fulltype;
-
- if(curarea->full) {
- sc= curarea->full; /* the old screen */
- fulltype = sc->full;
-
- // refuse to go out of SCREENAUTOPLAY as long as G_FLAGS_AUTOPLAY
- // is set
-
- if (fulltype != SCREENAUTOPLAY || (G.flags & G_FILE_AUTOPLAY) == 0) {
- sc->full= 0;
-
- /* find old area */
- old= sc->areabase.first;
- while(old) {
- if(old->full) break;
- old= old->next;
- }
- if(old==0) {error("something wrong in areafullscreen"); return;}
-
- if (fulltype == SCREENAUTOPLAY) {
- // in autoplay screens the headers are disabled by
- // default. So use the old headertype instead
- headertype = old->headertype;
- } else {
- // normal fullscreen. Use current headertype
- headertype = curarea->headertype;
- }
-
- copy_areadata(old, curarea, 1); /* 1 = swap spacelist */
- old->headertype = headertype;
-
- old->full= 0;
-
- unlink_screen(G.curscreen);
- free_libblock(&G.main->screen, G.curscreen);
- G.curscreen= NULL;
-
- setscreen(sc);
- }
-
- }
- else {
- /* is there only 1 area? */
- if(G.curscreen->areabase.first==G.curscreen->areabase.last) return;
- if(curarea->spacetype==SPACE_INFO) return;
-
- G.curscreen->full = SCREENFULL;
-
- old= curarea;
- oldscreen= G.curscreen;
- sc= addscreen("temp"); /* this sets G.curscreen */
-
- splitarea( (ScrArea *)sc->areabase.first, 'h', 0.99);
- newa= sc->areabase.first;
- newspace(newa->next, SPACE_INFO);
-
- curarea= old;
- G.curscreen= oldscreen; /* needed because of setscreen */
-
- /* copy area */
- copy_areadata(newa, curarea, 1); /* 1 = swap spacelist */
-
- curarea->full= oldscreen;
- newa->full= oldscreen;
- newa->next->full= oldscreen;
-
- setscreen(sc);
- wich_cursor(newa);
- }
-
- /* there's also events in queue for this, but we call fullscreen for render output
- now, and that doesn't go back to queue. Bad code, but doesn't hurt... (ton) */
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- scrarea_do_headchange(sa);
- scrarea_do_winchange(sa);
- }
- /* bad code #2: setscreen() ends with first area active. fullscreen render assumes this too */
- curarea= sc->areabase.first;
-
- retopo_force_update();
-}
-
-static void area_autoplayscreen(void)
-{
- bScreen *sc, *oldscreen;
- ScrArea *newa, *old, *sa;
-
- if (curarea->full) {
- area_fullscreen();
- }
-
- if (curarea->full == NULL) {
- sa = G.curscreen->areabase.first;
- while (sa) {
- if (sa->spacetype == SPACE_VIEW3D) {
- break;
- }
- sa= sa->next;
- }
-
- if (sa) {
- areawinset(sa->win);
- G.curscreen->full = SCREENAUTOPLAY;
-
- old= curarea;
- oldscreen= G.curscreen;
- sc= addscreen("temp"); /* this sets G.curscreen */
-
- newa= sc->areabase.first;
-
- curarea= old;
- G.curscreen= oldscreen; /* because of setscreen */
-
- /* copy area settings */
- copy_areadata(newa, curarea, 1); /* swap spacedata */
- newa->headertype= 0;
-
- curarea->full= oldscreen;
- newa->full= oldscreen;
-
- setscreen(sc);
- wich_cursor(newa);
- }
- }
-}
-
-static void copy_screen(bScreen *to, bScreen *from)
-{
- ScrVert *s1, *s2;
- ScrEdge *se;
- ScrArea *sa, *saf;
-
- /* free 'to' */
- free_screen(to);
- winqueue_break= 1; /* leave queues everywhere */
-
- duplicatelist(&to->vertbase, &from->vertbase);
- duplicatelist(&to->edgebase, &from->edgebase);
- duplicatelist(&to->areabase, &from->areabase);
-
- s1= from->vertbase.first;
- s2= to->vertbase.first;
- while(s1) {
- s1->newv= s2;
- s2= s2->next;
- s1= s1->next;
- }
- se= to->edgebase.first;
- while(se) {
- se->v1= se->v1->newv;
- se->v2= se->v2->newv;
- sortscrvert(&(se->v1), &(se->v2));
- se= se->next;
- }
-
- sa= to->areabase.first;
- saf= from->areabase.first;
- while(sa) {
- sa->v1= sa->v1->newv;
- sa->v2= sa->v2->newv;
- sa->v3= sa->v3->newv;
- sa->v4= sa->v4->newv;
- sa->win= 0;
- sa->headwin= 0;
-
- sa->spacedata.first= sa->spacedata.last= NULL;
- sa->uiblocks.first= sa->uiblocks.last= NULL;
- sa->panels.first= sa->panels.last= NULL;
- sa->scriptlink.totscript= 0;
-
- copy_areadata(sa, saf, 0);
-
- sa= sa->next;
- saf= saf->next;
- }
-
- /* put at zero (needed?) */
- s1= from->vertbase.first;
- while(s1) {
- s1->newv= 0;
- s1= s1->next;
- }
-}
-
-void duplicate_screen(void)
-{
- bScreen *sc, *oldscreen;
-
- if(G.curscreen->full != SCREENNORMAL) return;
-
- /* make new screen: */
-
- oldscreen= G.curscreen;
- sc= addscreen(oldscreen->id.name+2); /* this sets G.curscreen */
- copy_screen(sc, oldscreen);
-
- G.curscreen= oldscreen;
- setscreen(sc);
-
-}
-
-
-/* ************ END SCREEN MANAGEMENT ************** */
-/* ************ JOIN/SPLIT/MOVE ************** */
-
-typedef struct point{
- float x,y;
-}_point;
-
-/* draw vertical shape visualising future joining (left as well
- * right direction of future joining) */
-static void draw_horizontal_join_shape(ScrArea *sa, char dir)
-{
- _point points[10];
- short i;
- float w, h;
- float width = sa->v3->vec.x - sa->v1->vec.x;
- float height = sa->v3->vec.y - sa->v1->vec.y;
-
- if(height<width) {
- h = height/8;
- w = height/4;
- }
- else {
- h = width/8;
- w = width/4;
- }
-
- points[0].x = sa->v1->vec.x;
- points[0].y = sa->v1->vec.y + height/2;
-
- points[1].x = sa->v1->vec.x;
- points[1].y = sa->v1->vec.y;
-
- points[2].x = sa->v4->vec.x - w;
- points[2].y = sa->v4->vec.y;
-
- points[3].x = sa->v4->vec.x - w;
- points[3].y = sa->v4->vec.y + height/2 - 2*h;
-
- points[4].x = sa->v4->vec.x - 2*w;
- points[4].y = sa->v4->vec.y + height/2;
-
- points[5].x = sa->v4->vec.x - w;
- points[5].y = sa->v4->vec.y + height/2 + 2*h;
-
- points[6].x = sa->v3->vec.x - w;
- points[6].y = sa->v3->vec.y;
-
- points[7].x = sa->v2->vec.x;
- points[7].y = sa->v2->vec.y;
-
- points[8].x = sa->v4->vec.x;
- points[8].y = sa->v4->vec.y + height/2 - h;
-
- points[9].x = sa->v4->vec.x;
- points[9].y = sa->v4->vec.y + height/2 + h;
-
- if(dir=='l') {
- /* when direction is left, then we flip direction of arrow */
- float cx = sa->v1->vec.x + width;
- for(i=0;i<10;i++) {
- points[i].x -= cx;
- points[i].x = -points[i].x;
- points[i].x += sa->v1->vec.x;
- }
- }
-
- glBegin(GL_POLYGON);
- for(i=0;i<5;i++)
- glVertex2f(points[i].x, points[i].y);
- glEnd();
- glBegin(GL_POLYGON);
- for(i=4;i<8;i++)
- glVertex2f(points[i].x, points[i].y);
- glVertex2f(points[0].x, points[0].y);
- glEnd();
-
- glRectf(points[2].x, points[2].y, points[8].x, points[8].y);
- glRectf(points[6].x, points[6].y, points[9].x, points[9].y);
-}
-
-/* draw vertical shape visualising future joining (up/down direction) */
-static void draw_vertical_join_shape(ScrArea *sa, char dir)
-{
- _point points[10];
- short i;
- float w, h;
- float width = sa->v3->vec.x - sa->v1->vec.x;
- float height = sa->v3->vec.y - sa->v1->vec.y;
-
- if(height<width) {
- h = height/4;
- w = height/8;
- }
- else {
- h = width/4;
- w = width/8;
- }
-
- points[0].x = sa->v1->vec.x + width/2;
- points[0].y = sa->v3->vec.y;
-
- points[1].x = sa->v2->vec.x;
- points[1].y = sa->v2->vec.y;
-
- points[2].x = sa->v1->vec.x;
- points[2].y = sa->v1->vec.y + h;
-
- points[3].x = sa->v1->vec.x + width/2 - 2*w;
- points[3].y = sa->v1->vec.y + h;
-
- points[4].x = sa->v1->vec.x + width/2;
- points[4].y = sa->v1->vec.y + 2*h;
-
- points[5].x = sa->v1->vec.x + width/2 + 2*w;
- points[5].y = sa->v1->vec.y + h;
-
- points[6].x = sa->v4->vec.x;
- points[6].y = sa->v4->vec.y + h;
-
- points[7].x = sa->v3->vec.x;
- points[7].y = sa->v3->vec.y;
-
- points[8].x = sa->v1->vec.x + width/2 - w;
- points[8].y = sa->v1->vec.y;
-
- points[9].x = sa->v1->vec.x + width/2 + w;
- points[9].y = sa->v1->vec.y;
-
- if(dir=='u') {
- /* when direction is up, then we flip direction of arrow */
- float cy = sa->v1->vec.y + height;
- for(i=0;i<10;i++) {
- points[i].y -= cy;
- points[i].y = -points[i].y;
- points[i].y += sa->v1->vec.y;
- }
- }
-
- glBegin(GL_POLYGON);
- for(i=0;i<5;i++)
- glVertex2f(points[i].x, points[i].y);
- glEnd();
- glBegin(GL_POLYGON);
- for(i=4;i<8;i++)
- glVertex2f(points[i].x, points[i].y);
- glVertex2f(points[0].x, points[0].y);
- glEnd();
-
- glRectf(points[2].x, points[2].y, points[8].x, points[8].y);
- glRectf(points[6].x, points[6].y, points[9].x, points[9].y);
-}
-
-/* draw join shape due to direction of joining */
-static void draw_join_shape(ScrArea *sa, char dir)
-{
- if(dir=='u' || dir=='d')
- draw_vertical_join_shape(sa, dir);
- else
- draw_horizontal_join_shape(sa, dir);
-}
-
-/* draw screen area darker with arrow (visualisation of future joining) */
-static void scrarea_draw_shape_dark(ScrArea *sa, char dir)
-{
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- glColor4ub(0, 0, 0, 105);
- draw_join_shape(sa, dir);
- glDisable(GL_BLEND);
-}
-
-/* draw screen area ligher with arrow shape ("eraser" of previous dark shape) */
-static void scrarea_draw_shape_light(ScrArea *sa, char dir)
-{
- glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA);
- glEnable(GL_BLEND);
- /* value 181 was hardly computed: 181~105 */
- glColor4ub(255, 255, 255, 181);
- draw_join_shape(sa, dir);
- glDisable(GL_BLEND);
-}
-
-static void joinarea_interactive(ScrArea *area, ScrEdge *onedge)
-{
- struct ScrArea *sa1 = area, *sa2, *scr;
- struct ScrArea *up=0, *down=0, *right=0, *left=0;
- struct ScrEdge *se;
- unsigned short event;
- short ok=0, val=0, mval[2];
- char dir=0;
-
- sa1 = test_edge_area(sa1, onedge);
- if(sa1==0) return;
-
- /* find directions with same edge */
- sa2= G.curscreen->areabase.first;
- while(sa2) {
- if(sa2 != sa1) {
- se= screen_findedge(G.curscreen, sa2->v1, sa2->v2);
- if(onedge==se) right= sa2;
- se= screen_findedge(G.curscreen, sa2->v2, sa2->v3);
- if(onedge==se) down= sa2;
- se= screen_findedge(G.curscreen, sa2->v3, sa2->v4);
- if(onedge==se) left= sa2;
- se= screen_findedge(G.curscreen, sa2->v4, sa2->v1);
- if(onedge==se) up= sa2;
- }
- sa2= sa2->next;
- }
-
- if(left) val++;
- if(up) val++;
- if(right) val++;
- if(down) val++;
-
- if(val==0) return;
- else if(val==1) {
- if(left) {
- right = sa1;
- sa2 = left;
- dir = 'h';
- }
- else if(right) {
- left = sa1;
- sa2 = right;
- dir = 'h';
- }
- else if(up) {
- down = sa1;
- sa2= up;
- dir = 'v';
- }
- else if(down) {
- up = sa1;
- sa2 = down;
- dir = 'v';
- }
- }
-
- mywinset(G.curscreen->mainwin);
-
- /* initial set up screen area asigned for destroying */
- scr = sa2;
-
- /* set up standard cursor */
- set_cursor(CURSOR_STD);
-
- /* should already have a good matrix */
- glReadBuffer(GL_FRONT);
- glDrawBuffer(GL_FRONT);
-
- /* to prevent flickering after clicking at "Join Areas " */
- getmouseco_sc(mval);
- if(dir=='h') {
- if(scr==left && mval[0]>=onedge->v1->vec.x) scr = right;
- else if(scr==right && mval[0]<onedge->v1->vec.x) scr = left;
- }
- else if(dir=='v') {
- if(scr==down && mval[1]>=onedge->v1->vec.y) scr = up;
- else if(scr==up && mval[1]<onedge->v1->vec.y) scr = down;
- }
-
- /* draw scr screen area with dark shape */
- if(scr==left)
- scrarea_draw_shape_dark(scr,'r');
- else if(scr==right)
- scrarea_draw_shape_dark(scr,'l');
- else if(scr==up)
- scrarea_draw_shape_dark(scr,'d');
- else if(scr==down)
- scrarea_draw_shape_dark(scr,'u');
- bglFlush();
-
- /* "never ending loop" of interactive selection */
- while(!ok) {
- getmouseco_sc(mval);
-
- /* test if position of mouse is on the "different side" of
- * "joining edge" */
- if(dir=='h') {
- if(scr==left && mval[0]>=onedge->v1->vec.x) {
- scrarea_draw_shape_light(scr,'r');
- scr = right;
- scrarea_draw_shape_dark(scr,'l');
- }
- else if(scr==right && mval[0]<onedge->v1->vec.x) {
- scrarea_draw_shape_light(scr,'l');
- scr = left;
- scrarea_draw_shape_dark(scr,'r');
- }
- }
- else if(dir=='v') {
- if(scr==down && mval[1]>=onedge->v1->vec.y) {
- scrarea_draw_shape_light(scr,'u');
- scr = up;
- scrarea_draw_shape_dark(scr,'d');
- }
- else if(scr==up && mval[1]<onedge->v1->vec.y){
- scrarea_draw_shape_light(scr,'d');
- scr = down;
- scrarea_draw_shape_dark(scr,'u');
- }
- }
-
-
- /* get pressed keys and mouse buttons */
- event = extern_qread(&val);
-
- /* confirm joining of two screen areas */
- if(val && event==LEFTMOUSE) ok= 1;
-
- /* cancel joining of joining */
- if(val && (event==ESCKEY || event==RIGHTMOUSE)) ok= -1;
-
- bglFlush();
- }
-
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
-
- /* joining af screen areas was confirmed ... proceed joining */
- if(ok==1) {
- if(sa2!=scr) {
- sa1 = sa2;
- sa2 = scr;
- }
-
- if(sa2==left) {
- sa1->v1= sa2->v1;
- sa1->v2= sa2->v2;
- screen_addedge(G.curscreen, sa1->v2, sa1->v3);
- screen_addedge(G.curscreen, sa1->v1, sa1->v4);
- }
- else if(sa2==up) {
- sa1->v2= sa2->v2;
- sa1->v3= sa2->v3;
- screen_addedge(G.curscreen, sa1->v1, sa1->v2);
- screen_addedge(G.curscreen, sa1->v3, sa1->v4);
- }
- else if(sa2==right) {
- sa1->v3= sa2->v3;
- sa1->v4= sa2->v4;
- screen_addedge(G.curscreen, sa1->v2, sa1->v3);
- screen_addedge(G.curscreen, sa1->v1, sa1->v4);
- }
- else if(sa2==down) {
- sa1->v1= sa2->v1;
- sa1->v4= sa2->v4;
- screen_addedge(G.curscreen, sa1->v1, sa1->v2);
- screen_addedge(G.curscreen, sa1->v3, sa1->v4);
- }
-
- del_area(sa2);
- BLI_remlink(&G.curscreen->areabase, sa2);
- MEM_freeN(sa2);
-
- removedouble_scredges();
- removenotused_scredges();
- removenotused_scrverts();
-
- testareas();
- mainqenter(DRAWEDGES, 1);
-
- /* test cursor en inputwindow */
- mainqenter(MOUSEY, -1);
- }
-}
-
-static short testsplitpoint(ScrArea *sa, char dir, float fac)
-/* return 0: no split possible */
-/* else return (integer) screencoordinate split point */
-{
- short x, y;
-
- /* area big enough? */
- if(sa->v4->vec.x- sa->v1->vec.x <= 2*AREAMINX) return 0;
- if(sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY) return 0;
-
- /* to be sure */
- if(fac<0.0) fac= 0.0;
- if(fac>1.0) fac= 1.0;
-
- if(dir=='h') {
- y= sa->v1->vec.y+ fac*(sa->v2->vec.y- sa->v1->vec.y);
-
- if(sa->v2->vec.y==G.curscreen->sizey-1 && sa->v2->vec.y- y < HEADERY)
- y= sa->v2->vec.y- HEADERY;
-
- else if(sa->v1->vec.y==0 && y- sa->v1->vec.y < HEADERY)
- y= sa->v1->vec.y+ HEADERY;
-
- else if(y- sa->v1->vec.y < AREAMINY) y= sa->v1->vec.y+ AREAMINY;
- else if(sa->v2->vec.y- y < AREAMINY) y= sa->v2->vec.y- AREAMINY;
- else y-= (y % AREAGRID);
-
- return y;
- }
- else {
- x= sa->v1->vec.x+ fac*(sa->v4->vec.x- sa->v1->vec.x);
- if(x- sa->v1->vec.x < AREAMINX) x= sa->v1->vec.x+ AREAMINX;
- else if(sa->v4->vec.x- x < AREAMINX) x= sa->v4->vec.x- AREAMINX;
- else x-= (x % AREAGRID);
-
- return x;
- }
-}
-
-static void splitarea(ScrArea *sa, char dir, float fac)
-{
- bScreen *sc;
- ScrArea *newa=NULL;
- ScrVert *sv1, *sv2;
- short split;
-
- if(sa==0) return;
-
- split= testsplitpoint(sa, dir, fac);
- if(split==0) return;
-
- sc= G.curscreen;
-
- areawinset(sa->win);
-
- if(dir=='h') {
- /* new vertices */
- sv1= screen_addvert(sc, sa->v1->vec.x, split);
- sv2= screen_addvert(sc, sa->v4->vec.x, split);
-
- /* new edges */
- screen_addedge(sc, sa->v1, sv1);
- screen_addedge(sc, sv1, sa->v2);
- screen_addedge(sc, sa->v3, sv2);
- screen_addedge(sc, sv2, sa->v4);
- screen_addedge(sc, sv1, sv2);
-
- /* new areas: top */
- newa= screen_addarea(sc, sv1, sa->v2, sa->v3, sv2, sa->headertype, sa->spacetype);
- copy_areadata(newa, sa, 0);
-
- /* area below */
- sa->v2= sv1;
- sa->v3= sv2;
-
- }
- else {
- /* new vertices */
- sv1= screen_addvert(sc, split, sa->v1->vec.y);
- sv2= screen_addvert(sc, split, sa->v2->vec.y);
-
- /* new edges */
- screen_addedge(sc, sa->v1, sv1);
- screen_addedge(sc, sv1, sa->v4);
- screen_addedge(sc, sa->v2, sv2);
- screen_addedge(sc, sv2, sa->v3);
- screen_addedge(sc, sv1, sv2);
-
- /* new areas: left */
- newa= screen_addarea(sc, sa->v1, sa->v2, sv2, sv1, sa->headertype, sa->spacetype);
- copy_areadata(newa, sa, 0);
-
- /* area right */
- sa->v1= sv1;
- sa->v2= sv2;
- }
-
- if(sa->spacetype==SPACE_BUTS) {
- addqueue(sa->win, UI_BUT_EVENT, B_BUTSHOME);
- addqueue(newa->win, UI_BUT_EVENT, B_BUTSHOME);
- }
-
- /* remove double vertices en edges */
- removedouble_scrverts();
- removedouble_scredges();
- removenotused_scredges();
-
- mainqenter(DRAWEDGES, 1);
- dodrawscreen= 1; /* patch! event gets lost,,,? */
- testareas();
-}
-
-static void scrarea_draw_splitpoint(ScrArea *sa, char dir, float fac)
-{
- int split= testsplitpoint(sa, dir, fac);
-
- if (split) {
- if(dir=='h') {
- sdrawXORline(sa->totrct.xmin, split, sa->totrct.xmax, split);
- sdrawXORline(sa->totrct.xmin, split-1, sa->totrct.xmax, split-1);
- } else {
- sdrawXORline(split, sa->totrct.ymin, split, sa->totrct.ymax);
- sdrawXORline(split-1, sa->totrct.ymin, split-1, sa->totrct.ymax);
- }
- }
-}
-
-static void splitarea_interactive(ScrArea *area, ScrEdge *onedge)
-{
- ScrArea *scr, *sa= area;
- float fac= 0.0;
- unsigned short event;
- short ok= 0, val, split = 0, mval[2], mvalo[2]= {-1, -1}, first= 1;
- char dir;
-
- if(sa->win==0) return;
- if(sa->full) return;
- if(myswinopen_allowed()==0) {
- error("Max amount of subwindows reached");
- return;
- }
-
- dir= scredge_is_horizontal(onedge)?'v':'h';
-
- mywinset(G.curscreen->mainwin);
- /* should already have a good matrix */
- glReadBuffer(GL_FRONT);
- glDrawBuffer(GL_FRONT);
-
- /* keep track of grid and minsize */
- while(ok==0) {
- getmouseco_sc(mval);
-
- /* this part of code allows to choose, what window will be splited */
- /* cursor is out of the current ScreenArea */
- if((mval[0] < sa->v1->vec.x) || (mval[0] > sa->v3->vec.x) ||
- (mval[1] < sa->v1->vec.y) || (mval[1] > sa->v3->vec.y)){
- scr= (ScrArea*)G.curscreen->areabase.first;
- while(scr){
- if((mval[0] > scr->v1->vec.x) && (mval[0] < scr->v4->vec.x) &&
- (mval[1] < scr->v2->vec.y) && (mval[1] > scr->v1->vec.y)){
- /* test: is ScreenArea enough big for splitting */
- short tsplit= testsplitpoint(scr, dir, fac);
- if(tsplit){
- split = tsplit;
- /* delete old line from previous ScreenArea */
- if(!first) scrarea_draw_splitpoint(sa, dir, fac);
- sa= scr;
- first= 1;
- break;
- }
- }
- scr= scr->next;
- }
- }
-
- if (first || (dir=='v' && mval[0]!=mvalo[0]) || (dir=='h' && mval[1]!=mvalo[1])) {
- if (!first) {
- scrarea_draw_splitpoint(sa, dir, fac);
- }
-
- if(dir=='h') {
- fac= mval[1]- (sa->v1->vec.y);
- fac/= sa->v2->vec.y- sa->v1->vec.y;
- } else {
- fac= mval[0]- sa->v1->vec.x;
- fac/= sa->v4->vec.x- sa->v1->vec.x;
- }
-
- split= testsplitpoint(sa, dir, fac);
- if (split) {
- scrarea_draw_splitpoint(sa, dir, fac);
- } else {
- ok= -1;
- }
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- first= 0;
- }
-
- event= extern_qread(&val);
-
- /* change direction of splitting between horizontal and vertical
- * patch was offered by Guillaume */
- if(val && (event==TABKEY || event==MIDDLEMOUSE)) {
- scrarea_draw_splitpoint(sa, dir, fac);
- if(dir=='h') {
- dir='v';
- set_cursor(CURSOR_Y_MOVE);
- } else {
- dir='h';
- set_cursor(CURSOR_X_MOVE);
- }
- first= 1;
- }
-
- if(val && event==LEFTMOUSE) {
- if(dir=='h') {
- fac= split- (sa->v1->vec.y);
- fac/= sa->v2->vec.y- sa->v1->vec.y;
- }
- else {
- fac= split- sa->v1->vec.x;
- fac/= sa->v4->vec.x- sa->v1->vec.x;
- }
- ok= 1;
- }
- if(val && (event==ESCKEY || event==RIGHTMOUSE)) {
- ok= -1;
- }
- bglFlush();
- }
-
- if (!first) {
- scrarea_draw_splitpoint(sa, dir, fac);
- bglFlush();
- }
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
-
- if(ok==1) {
- splitarea(sa, dir, fac);
- mainqenter(DRAWEDGES, 1);
- dodrawscreen= 1; /* patch! event gets lost,,,? */
- }
-}
-
-View3D *find_biggest_view3d(void)
-{
- ScrArea *sa= find_biggest_area_of_type(SPACE_VIEW3D);
-
- if (sa) {
- return (View3D*) sa->spacedata.first;
- } else {
- return NULL;
- }
-}
-
-ScrArea *find_biggest_area_of_type(int spacecode)
-{
- ScrArea *sa, *biggest= NULL;
- int bigsize= 0;
-
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if (spacecode==0 || sa->spacetype==spacecode) {
- int x= sa->v3->vec.x - sa->v1->vec.x;
- int y= sa->v3->vec.y - sa->v1->vec.y;
- int size= x*x + y*y;
-
- if (!biggest || size>bigsize) {
- biggest= sa;
- bigsize= size;
- }
- }
- }
-
- return biggest;
-}
-
-ScrArea *find_biggest_area(void)
-{
- return find_biggest_area_of_type(0);
-}
-
-static void select_connected_scredge(bScreen *sc, ScrEdge *edge)
-{
- ScrEdge *se;
- ScrVert *sv;
- int oneselected;
- char dir;
-
- /* select connected, only in the right direction */
- /* 'dir' is the direction of EDGE */
-
- if(edge->v1->vec.x==edge->v2->vec.x) dir= 'v';
- else dir= 'h';
-
- sv= sc->vertbase.first;
- while(sv) {
- sv->flag= 0;
- sv= sv->next;
- }
-
- edge->v1->flag= 1;
- edge->v2->flag= 1;
-
- oneselected= 1;
- while(oneselected) {
- se= sc->edgebase.first;
- oneselected= 0;
- while(se) {
- if(se->v1->flag + se->v2->flag==1) {
- if(dir=='h') if(se->v1->vec.y==se->v2->vec.y) {
- se->v1->flag= se->v2->flag= 1;
- oneselected= 1;
- }
- if(dir=='v') if(se->v1->vec.x==se->v2->vec.x) {
- se->v1->flag= se->v2->flag= 1;
- oneselected= 1;
- }
- }
- se= se->next;
- }
- }
-}
-
-void test_scale_screen(bScreen *sc)
-/* test if screen vertices should be scaled */
-/* also check offset */
-{
- ScrVert *sv=0;
- ScrEdge *se;
- ScrArea *sa, *san;
- int yval;
- float facx, facy, tempf, min[2], max[2];
-
- sc->startx= prefstax;
- sc->starty= prefstay;
- sc->endx= prefstax+prefsizx-1;
- sc->endy= prefstay+prefsizy-1;
-
- /* calculate size */
- sv= sc->vertbase.first;
- min[0]= min[1]= 0.0;
- max[0]= sc->sizex;
- max[1]= sc->sizey;
- while(sv) {
- min[0]= MIN2(min[0], sv->vec.x);
- min[1]= MIN2(min[1], sv->vec.y);
- max[0]= MAX2(max[0], sv->vec.x);
- max[1]= MAX2(max[1], sv->vec.y);
- sv= sv->next;
- }
-
- /* always make 0.0 left under */
- sv= sc->vertbase.first;
- while(sv) {
- sv->vec.x -= min[0];
- sv->vec.y -= min[1];
- sv= sv->next;
- }
-
-
- sc->sizex= max[0]-min[0];
- sc->sizey= max[1]-min[1];
-
- if(sc->sizex!= prefsizx || sc->sizey!= prefsizy) {
- facx= prefsizx;
- facx/= (float)sc->sizex;
- facy= prefsizy;
- facy/= (float)sc->sizey;
-
- /* make sure it fits! */
- sv= sc->vertbase.first;
- while(sv) {
- tempf= ((float)sv->vec.x)*facx;
- sv->vec.x= (short)(tempf+0.5);
- sv->vec.x+= AREAGRID-1;
- sv->vec.x-= (sv->vec.x % AREAGRID);
-
- CLAMP(sv->vec.x, 0, prefsizx);
-
- tempf= ((float)sv->vec.y )*facy;
- sv->vec.y= (short)(tempf+0.5);
- sv->vec.y+= AREAGRID-1;
- sv->vec.y-= (sv->vec.y % AREAGRID);
-
- CLAMP(sv->vec.y, 0, prefsizy);
-
- sv= sv->next;
- }
-
- sc->sizex= prefsizx;
- sc->sizey= prefsizy;
- }
-
- /* test for collapsed areas. This could happen in some blender version... */
- sa= sc->areabase.first;
- while(sa) {
- san= sa->next;
- if(sa->v1==sa->v2 || sa->v3==sa->v4 || sa->v2==sa->v3) {
- del_area(sa);
- BLI_remlink(&sc->areabase, sa);
- MEM_freeN(sa);
- }
- sa= san;
- }
-
- /* make each window at least HEADERY high */
- sa= sc->areabase.first;
- while(sa) {
-
- if(sa->v1->vec.y+HEADERY > sa->v2->vec.y) {
- /* lower edge */
- se= screen_findedge(sc, sa->v4, sa->v1);
- if(se && sa->v1!=sa->v2 ) {
- select_connected_scredge(sc, se);
-
- /* all selected vertices get the right offset */
- yval= sa->v2->vec.y-HEADERY;
- sv= sc->vertbase.first;
- while(sv) {
- /* if is a collapsed area */
- if(sv!=sa->v2 && sv!=sa->v3) {
- if(sv->flag) sv->vec.y= yval;
- }
- sv= sv->next;
- }
- }
- }
-
- sa= sa->next;
- }
-
-}
-
-static void draw_front_xor_dirdist_line(char dir, int dist, int start, int end)
-{
- if (dir=='h') {
- sdrawXORline(start, dist, end, dist);
- sdrawXORline(start, dist+1, end, dist+1);
- } else {
- sdrawXORline(dist, start, dist, end);
- sdrawXORline(dist+1, start, dist+1, end);
- }
-}
-
-static void moveareas(ScrEdge *edge)
-{
- ScrVert *v1;
- ScrArea *sa;
- short mvalo[2], mval_prev=-1;
- short edge_start, edge_end, edge_position;
- short bigger, smaller, headery, areaminy;
- int delta, doit;
- char dir;
-
- if(edge->border) return;
-
- dir= scredge_is_horizontal(edge)?'h':'v';
-
- select_connected_scredge(G.curscreen, edge);
-
- edge_position= (dir=='h')?edge->v1->vec.y:edge->v1->vec.x;
- edge_start= 10000;
- edge_end= -10000;
- for (v1= G.curscreen->vertbase.first; v1; v1= v1->next) {
- if (v1->flag) {
- if (dir=='h') {
- edge_start= MIN2(edge_start, v1->vec.x);
- edge_end= MAX2(edge_end, v1->vec.x);
- } else {
- edge_start= MIN2(edge_start, v1->vec.y);
- edge_end= MAX2(edge_end, v1->vec.y);
- }
- }
- }
-
- /* now all verices with 'flag==1' are the ones that can be moved. */
- /* we check all areas and test for free space with MINSIZE */
- bigger= smaller= 10000;
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(dir=='h') { /* if top or down edge selected, test height */
- if(sa->headertype) {
- headery= HEADERY;
- areaminy= AREAMINY;
- }
- else {
- headery= 0;
- areaminy= AREAMINY; /*areaminy= EDGEWIDTH;*/
- }
-
- if(sa->v1->flag && sa->v4->flag) {
- int y1;
- if(sa->v2->vec.y==G.curscreen->sizey-1) /* top edge */
- y1= sa->v2->vec.y - sa->v1->vec.y-headery-EDGEWIDTH;
- else
- y1= sa->v2->vec.y - sa->v1->vec.y-areaminy;
- bigger= MIN2(bigger, y1);
- }
- else if(sa->v2->flag && sa->v3->flag) {
- int y1;
- if(sa->v1->vec.y==0) /* bottom edge */
- y1= sa->v2->vec.y - sa->v1->vec.y-headery-EDGEWIDTH;
- else
- y1= sa->v2->vec.y - sa->v1->vec.y-areaminy;
- smaller= MIN2(smaller, y1);
- }
- }
- else { /* if left or right edge selected, test width */
- if(sa->v1->flag && sa->v2->flag) {
- int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX;
- bigger= MIN2(bigger, x1);
- }
- else if(sa->v3->flag && sa->v4->flag) {
- int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX;
- smaller= MIN2(smaller, x1);
- }
- }
- sa= sa->next;
- }
-
- mywinset(G.curscreen->mainwin);
-
- glReadBuffer(GL_FRONT);
- glDrawBuffer(GL_FRONT);
-
- doit= delta= 0;
- getmouseco_sc(mvalo);
- draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end);
-
- while (!doit) {
- short val;
- unsigned short event= extern_qread(&val);
-
- if (event==MOUSEY) {
- short mval[2];
-
- getmouseco_sc(mval);
- if ((dir=='h' && mval_prev != mval[1]) || (dir=='v' && mval_prev != mval[0])) {
- /* update the previous val with this one for comparison next loop */
- if (dir=='h') mval_prev = mval[1];
- else mval_prev = mval[0];
-
- draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end);
-
- delta= (dir=='h')?(mval[1]-mvalo[1]):(mval[0]-mvalo[0]);
- delta= CLAMPIS(delta, -smaller, bigger);
- draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end);
- bglFlush();
- }
- }
- else if (event==LEFTMOUSE) {
- doit= 1;
- }
- else if (val) {
- if (ELEM(event, ESCKEY, RIGHTMOUSE))
- doit= -1;
- else if (ELEM(event, SPACEKEY, RETKEY))
- doit= 1;
- }
- else BIF_wait_for_statechange();
-
- }
- draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end);
- bglFlush();
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_BACK);
-
- if (doit==1) {
- for (v1= G.curscreen->vertbase.first; v1; v1= v1->next) {
- if (v1->flag) {
- /* that way a nice AREAGRID */
- if((dir=='v') && v1->vec.x>0 && v1->vec.x<G.curscreen->sizex-1) {
- v1->vec.x+= delta;
- if(delta != bigger && delta != -smaller) v1->vec.x-= (v1->vec.x % AREAGRID);
- }
- if((dir=='h') && v1->vec.y>0 && v1->vec.y<G.curscreen->sizey-1) {
- v1->vec.y+= delta;
-
- v1->vec.y+= AREAGRID-1;
- v1->vec.y-= (v1->vec.y % AREAGRID);
-
- /* prevent too small top header */
- if(v1->vec.y > G.curscreen->sizey-HEADERY)
- v1->vec.y= G.curscreen->sizey-HEADERY;
- }
- }
- v1->flag= 0;
- }
-
- removedouble_scrverts();
- removedouble_scredges();
- testareas();
- }
-
- mainqenter(DRAWEDGES, 1);
- dodrawscreen= 1; /* patch! event gets lost,,,? */
-}
-
-static void scrollheader(ScrArea *area)
-{
- short mval[2], mvalo[2];
-
- if(area->headbutlen<area->winx) {
- area->headbutofs= 0;
- }
- else if(area->headbutofs+area->winx > area->headbutlen) {
- area->headbutofs= area->headbutlen-area->winx;
- }
-
- getmouseco_sc(mvalo);
-
- while(get_mbut() & M_MOUSE) {
- getmouseco_sc(mval);
- if(mval[0]!=mvalo[0]) {
- area->headbutofs-= (mval[0]-mvalo[0]);
-
- if(area->headbutlen-area->winx < area->headbutofs) area->headbutofs= area->headbutlen-area->winx;
- if(area->headbutofs<0) area->headbutofs= 0;
-
- scrarea_do_headchange(area);
- scrarea_do_headdraw(area);
-
- screen_swapbuffers();
-
- mvalo[0]= mval[0];
- } else {
- BIF_wait_for_statechange();
- }
- }
-}
-
-int select_area(int spacetype)
-{
- /* call from edit routines, when there are more areas
- * of type 'spacetype', you can indicate an area manually
- */
- ScrArea *sa, *sact = NULL;
- int tot=0;
- unsigned short event = 0;
- short val, mval[2];
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==spacetype) {
- sact= sa;
- tot++;
- }
- sa= sa->next;
- }
-
- if(tot==0) {
- error("Can't do this! Open correct window");
- return 0;
- }
-
- if(tot==1) {
- if(curarea!=sact) areawinset(sact->win);
- return 1;
- }
- else if(tot>1) {
- set_cursor(CURSOR_HELP);
- while(1) {
- event= extern_qread(&val);
-
- if (val) {
- if(event==ESCKEY) break;
- if(event==LEFTMOUSE) break;
- if(event==SPACEKEY) break;
- } else {
- BIF_wait_for_statechange();
- }
- }
- screen_set_cursor(G.curscreen);
-
- /* recalculate winakt */
- getmouseco_sc(mval);
-
- if(event==LEFTMOUSE) {
- ScrArea *sa= screen_find_area_for_pt(G.curscreen, mval);
-
- if (sa &&sa->spacetype==spacetype) {
- G.curscreen->winakt= sa->win;
- areawinset(G.curscreen->winakt);
- } else {
- error("Wrong window");
- return 0;
- }
- }
- }
-
- if(event==LEFTMOUSE) return 1;
- else return 0;
-}
-
-/* ************ END JOIN/SPLIT/MOVE ************** */
-/* **************** DRAW SCREENEDGES ***************** */
-
-
-void draw_area_emboss(ScrArea *sa)
-{
-
- /* set transp line */
- glEnable( GL_BLEND );
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-
- /* right */
- glColor4ub(0,0,0, 50);
- sdrawline(sa->winx-1, 0, sa->winx-1, sa->winy-1);
-
- /* bottom */
- if(sa->headertype!=HEADERDOWN) {
- glColor4ub(0,0,0, 80);
- sdrawline(0, 0, sa->winx-1, 0);
- }
-
- /* top */
- if(sa->headertype!=HEADERTOP) {
- glColor4ub(255,255,255, 60);
- sdrawline(0, sa->winy-1, sa->winx-1, sa->winy-1);
- }
- /* left */
- glColor4ub(255,255,255, 50);
- sdrawline(0, 0, 0, sa->winy);
-
- glDisable( GL_BLEND );
-}
-
-
-void drawscredge_area(ScrArea *sa)
-{
- short x1= sa->v1->vec.x;
- short y1= sa->v1->vec.y;
- short x2= sa->v3->vec.x;
- short y2= sa->v3->vec.y;
-
- /* this to fill the (undrawn) edge area with back color first */
- glColor3f(SCR_BACK,SCR_BACK,SCR_BACK);
- sdrawline(x2, y1, x2, y2);
- sdrawline(x1, y1, x2, y1);
-
- cpack(0x0);
-
- /* Simple hack to make sure round corners arntdrawn with the minimal theme,
- * Nothing wrong with it IMHO, but just be aware its used so the following
- * if's never compare true with HEADERTOP or HEADERDOWN */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
- sa->headertype = -sa->headertype;
-
- /* right border area */
- if(sa->headertype==HEADERTOP) sdrawline(x2, y1, x2, y2-SCR_ROUND+1);
- else if(sa->headertype==HEADERDOWN) sdrawline(x2, y1+SCR_ROUND-1, x2, y2);
- else sdrawline(x2, y1, x2, y2);
-
- /* left border area */
- if(x1>0) { // otherwise it draws the emboss of window over
- if(sa->headertype==HEADERTOP) sdrawline(x1, y1, x1, y2-SCR_ROUND+1);
- else if(sa->headertype==HEADERDOWN) sdrawline(x1, y1+SCR_ROUND-1, x1, y2);
- else sdrawline(x1, y1, x1, y2);
- }
- /* top border area */
- if(sa->headertype==HEADERTOP) sdrawline(x1+SCR_ROUND-3, y2, x2-SCR_ROUND+3, y2);
- else sdrawline(x1, y2, x2, y2);
-
- /* bottom border area */
- if(sa->headertype==HEADERDOWN) sdrawline(x1+SCR_ROUND-3, y1, x2-SCR_ROUND+3, y1);
- else sdrawline(x1, y1, x2, y1);
-
- /* restore real header type */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
- sa->headertype = -sa->headertype;
-}
-
-/* ********************************* */
-
-/* for depgraph updating, all layers visible in a screen */
-unsigned int screen_view3d_layers(void)
-{
- ScrArea *sa;
- int layer= G.scene->lay; /* as minimum this */
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D)
- layer |= ((View3D *)sa->spacedata.first)->lay;
- }
- return layer;
-}
-
-bScreen *default_twosplit()
-{
- bScreen *sc= addscreen("screen");
- ScrArea *sa;
-
- splitarea( (ScrArea *)sc->areabase.first, 'h', 0.99);
- sa= sc->areabase.first;
- newspace(sa, SPACE_VIEW3D);
- newspace(sa->next, SPACE_INFO);
-
- return sc;
-}
-
-void initscreen(void)
-{
- default_twosplit();
-}
-
-static int curcursor;
-
-int get_cursor(void) {
- return curcursor;
-}
-
-void set_cursor(int curs) {
- if (G.background == 0) {
- if (curs!=curcursor) {
- curcursor= curs;
- window_set_cursor(mainwin, curs);
- }
- }
-}
-
-void unlink_screen(bScreen *sc) {
- ScrArea *sa;
-
- for (sa= sc->areabase.first; sa; sa= sa->next)
- del_area(sa);
-}
-
-void warp_pointer(int x, int y)
-{
- window_warp_pointer(mainwin, x, y);
-}
-
-void set_timecursor(int nr)
-{
- /* 10 8x8 digits */
- static char number_bitmaps[10][8]= {
- {0, 56, 68, 68, 68, 68, 68, 56},
- {0, 24, 16, 16, 16, 16, 16, 56},
- {0, 60, 66, 32, 16, 8, 4, 126},
- {0, 124, 32, 16, 56, 64, 66, 60},
- {0, 32, 48, 40, 36, 126, 32, 32},
- {0, 124, 4, 60, 64, 64, 68, 56},
- {0, 56, 4, 4, 60, 68, 68, 56},
- {0, 124, 64, 32, 16, 8, 8, 8},
- {0, 60, 66, 66, 60, 66, 66, 60},
- {0, 56, 68, 68, 120, 64, 68, 56}
- };
- unsigned char mask[16][2];
- unsigned char bitmap[16][2];
- int i, idx;
-
- memset(&bitmap, 0x00, sizeof(bitmap));
- memset(&mask, 0xFF, sizeof(mask));
-
- /* print number bottom right justified */
- for (idx= 3; nr && idx>=0; idx--) {
- char *digit= number_bitmaps[nr%10];
- int x = idx%2;
- int y = idx/2;
-
- for (i=0; i<8; i++)
- bitmap[i + y*8][x]= digit[i];
- nr/= 10;
- }
-
- curcursor= CURSOR_NONE;
- window_set_custom_cursor(mainwin, mask, bitmap, 7, 7);
- BIF_renderwin_set_custom_cursor(mask, bitmap);
-}
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
deleted file mode 100644
index d16e3f28671..00000000000
--- a/source/blender/src/editseq.c
+++ /dev/null
@@ -1,3988 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include <sys/types.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_storage_types.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_ipo_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_sound_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_plugin_types.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-
-#include "BIF_space.h"
-#include "BIF_interface.h"
-#include "BIF_screen.h"
-#include "BIF_drawseq.h"
-#include "BIF_editseq.h"
-#include "BIF_mywindow.h"
-#include "BIF_toolbox.h"
-#include "BIF_writemovie.h"
-#include "BIF_editview.h"
-#include "BIF_scrarea.h"
-#include "BIF_editsound.h"
-#include "BIF_imasel.h"
-
-#include "BSE_edit.h"
-#include "BSE_sequence.h"
-#include "BSE_seqeffects.h"
-#include "BSE_filesel.h"
-#include "BSE_drawipo.h"
-#include "BSE_seqaudio.h"
-#include "BSE_time.h"
-
-#include "BDR_editobject.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-static Sequence *_last_seq=0;
-static int _last_seq_init=0;
-
-#ifdef WIN32
-char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "c:\\";
-#else
-char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "/";
-#endif
-
-char last_sounddir[FILE_MAXDIR+FILE_MAXFILE]= "";
-
-#define SEQ_DESEL ~(SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL)
-
-typedef struct TransSeq {
- int start, machine;
- int startstill, endstill;
- int startdisp, enddisp;
- int startofs, endofs;
- int final_left, final_right;
- int len;
-} TransSeq;
-
-Sequence *get_last_seq()
-{
- if(!_last_seq_init) {
- Editing *ed;
- Sequence *seq;
- Sequence *l_sel = NULL;
- Sequence *l_act = NULL;
-
- ed= G.scene->ed;
- if(!ed) return NULL;
-
- for(seq= ed->seqbasep->first; seq; seq=seq->next) {
- if(seq->flag & SEQ_ACTIVE)
- l_act = seq;
- if(seq->flag & SELECT)
- l_sel = seq;
- }
-
- if (l_act) {
- _last_seq = l_act;
- } else {
- _last_seq = l_sel;
- }
-
- if (_last_seq) {
- _last_seq->flag |= SEQ_ACTIVE;
- }
-
- _last_seq_init = 1;
- }
-
- return _last_seq;
-}
-
-void set_last_seq(Sequence *seq)
-{
- if (_last_seq_init && _last_seq) {
- _last_seq->flag &= ~SEQ_ACTIVE;
- }
-
- _last_seq = seq;
- _last_seq_init = 1;
-
- if (_last_seq) {
- _last_seq->flag |= SEQ_ACTIVE;
- }
-}
-
-void clear_last_seq()
-{
- if (_last_seq_init && _last_seq) {
- _last_seq->flag &= ~SEQ_ACTIVE;
- }
- _last_seq = NULL;
- _last_seq_init = 0;
-}
-
-Sequence *get_forground_frame_seq(int frame)
-{
- Editing *ed;
- Sequence *seq, *best_seq=NULL;
- int best_machine = -1;
- ed= G.scene->ed;
- if(!ed) return NULL;
-
- for (seq=ed->seqbasep->first; seq; seq= seq->next) {
- if(seq->startdisp > frame || seq->enddisp <= frame)
- continue;
- /* only use elements you can see - not */
- if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) {
- if (seq->machine > best_machine) {
- best_seq = seq;
- best_machine = seq->machine;
- }
- }
- }
- return best_seq;
-}
-
-/* seq funcs's for transforming internally
- notice the difference between start/end and left/right.
-
- left and right are the bounds at which the sequence is rendered,
-start and end are from the start and fixed length of the sequence.
-*/
-int seq_tx_get_start(Sequence *seq) {
- return seq->start;
-}
-int seq_tx_get_end(Sequence *seq)
-{
- return seq->start+seq->len;
-}
-
-int seq_tx_get_final_left(Sequence *seq, int metaclip)
-{
- if (metaclip && seq->tmp) {
- /* return the range clipped by the parents range */
- return MAX2( seq_tx_get_final_left(seq, 0), seq_tx_get_final_left((Sequence *)seq->tmp, 1) );
- } else {
- return (seq->start - seq->startstill) + seq->startofs;
- }
-
-}
-int seq_tx_get_final_right(Sequence *seq, int metaclip)
-{
- if (metaclip && seq->tmp) {
- /* return the range clipped by the parents range */
- return MIN2( seq_tx_get_final_right(seq, 0), seq_tx_get_final_right((Sequence *)seq->tmp, 1) );
- } else {
- return ((seq->start+seq->len) + seq->endstill) - seq->endofs;
- }
-}
-
-void seq_tx_set_final_left(Sequence *seq, int val)
-{
- if (val < (seq)->start) {
- seq->startstill = abs(val - (seq)->start);
- (seq)->startofs = 0;
- } else {
- seq->startofs = abs(val - (seq)->start);
- seq->startstill = 0;
- }
-}
-
-void seq_tx_set_final_right(Sequence *seq, int val)
-{
- if (val > (seq)->start + (seq)->len) {
- seq->endstill = abs(val - (seq->start + (seq)->len));
- (seq)->endofs = 0;
- } else {
- seq->endofs = abs(val - ((seq)->start + (seq)->len));
- seq->endstill = 0;
- }
-}
-
-/* check if one side can be transformed */
-int seq_tx_check_left(Sequence *seq)
-{
- if (seq->flag & SELECT) {
- if (seq->flag & SEQ_LEFTSEL)
- return 1;
- else if (seq->flag & SEQ_RIGHTSEL)
- return 0;
-
- return 1; /* selected and neither left or right handles are, so let us move both */
- }
- return 0;
-}
-
-int seq_tx_check_right(Sequence *seq)
-{
- if (seq->flag & SELECT) {
- if (seq->flag & SEQ_RIGHTSEL)
- return 1;
- else if (seq->flag & SEQ_LEFTSEL)
- return 0;
-
- return 1; /* selected and neither left or right handles are, so let us move both */
- }
- return 0;
-}
-
-/* used so we can do a quick check for single image seq
- since they work a bit differently to normal image seq's (during transform) */
-int check_single_seq(Sequence *seq)
-{
- if ( seq->len==1 && (seq->type == SEQ_IMAGE || seq->type == SEQ_COLOR))
- return 1;
- else
- return 0;
-}
-
-static void fix_single_image_seq(Sequence *seq)
-{
- int left, start, offset;
- if (!check_single_seq(seq))
- return;
-
- /* make sure the image is always at the start since there is only one,
- adjusting its start should be ok */
- left = seq_tx_get_final_left(seq, 0);
- start = seq->start;
- if (start != left) {
- offset = left - start;
- seq_tx_set_final_left( seq, seq_tx_get_final_left(seq, 0) - offset );
- seq_tx_set_final_right( seq, seq_tx_get_final_right(seq, 0) - offset );
- seq->start += offset;
- }
-}
-
-static void change_plugin_seq(char *str) /* called from fileselect */
-{
- struct SeqEffectHandle sh;
- Sequence *last_seq= get_last_seq();
-
- if(last_seq && last_seq->type != SEQ_PLUGIN) return;
-
- sh = get_sequence_effect(last_seq);
- sh.free(last_seq);
- sh.init_plugin(last_seq, str);
-
- last_seq->machine = MAX3(last_seq->seq1->machine,
- last_seq->seq2->machine,
- last_seq->seq3->machine);
-
- if( test_overlap_seq(last_seq) ) shuffle_seq(last_seq);
-
- BIF_undo_push("Load/Change Plugin, Sequencer");
-}
-
-
-void boundbox_seq(void)
-{
- Sequence *seq;
- Editing *ed;
- float min[2], max[2];
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- min[0]= 0.0;
- max[0]= EFRA+1;
- min[1]= 0.0;
- max[1]= 8.0;
-
- seq= ed->seqbasep->first;
- while(seq) {
-
- if( min[0] > seq->startdisp-1) min[0]= seq->startdisp-1;
- if( max[0] < seq->enddisp+1) max[0]= seq->enddisp+1;
- if( max[1] < seq->machine+2.0) max[1]= seq->machine+2.0;
-
- seq= seq->next;
- }
-
- G.v2d->tot.xmin= min[0];
- G.v2d->tot.xmax= max[0];
- G.v2d->tot.ymin= min[1];
- G.v2d->tot.ymax= max[1];
-
-}
-
-int sequence_is_free_transformable(Sequence * seq)
-{
- return seq->type < SEQ_EFFECT
- || (get_sequence_effect_num_inputs(seq->type) == 0);
-}
-
-char mouse_cfra_side( int frame ) {
- short mval[2];
- float xmouse, ymouse;
- getmouseco_areawin(mval);
-
- /* choose the side based on which side of the playhead the mouse is on */
- areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse);
- return (xmouse > frame) ? 'R' : 'L';
-}
-
-Sequence *find_neighboring_sequence(Sequence *test, int lr, int sel) {
-/* looks to the left on lr==1, to the right on lr==2
- sel - 0==unselected, 1==selected, -1==done care*/
- Sequence *seq;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- if (sel>0) sel = SELECT;
-
- seq= ed->seqbasep->first;
- while(seq) {
- if( (seq!=test) &&
- (test->machine==seq->machine) &&
- (test->depth==seq->depth) &&
- ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel==0 && (seq->flag & SELECT)==0) ))
- {
- switch (lr) {
- case 1:
- if (test->startdisp == (seq->enddisp)) {
- return seq;
- }
- break;
- case 2:
- if (test->enddisp == (seq->startdisp)) {
- return seq;
- }
- break;
- }
- }
- seq= seq->next;
- }
- return NULL;
-}
-
-Sequence *find_next_prev_sequence(Sequence *test, int lr, int sel) {
-/* looks to the left on lr==1, to the right on lr==2
- sel - 0==unselected, 1==selected, -1==done care*/
- Sequence *seq,*best_seq = NULL;
- Editing *ed;
-
- int dist, best_dist;
- best_dist = MAXFRAME*2;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- if (sel) sel = SELECT;
-
- seq= ed->seqbasep->first;
- while(seq) {
- if( (seq!=test) &&
- (test->machine==seq->machine) &&
- (test->depth==seq->depth) &&
- ((sel == -1) || (sel==(seq->flag & SELECT))))
- {
- dist = MAXFRAME*2;
-
- switch (lr) {
- case 1:
- if (seq->enddisp <= test->startdisp) {
- dist = test->enddisp - seq->startdisp;
- }
- break;
- case 2:
- if (seq->startdisp >= test->enddisp) {
- dist = seq->startdisp - test->enddisp;
- }
- break;
- }
-
- if (dist==0) {
- best_seq = seq;
- break;
- } else if (dist < best_dist) {
- best_dist = dist;
- best_seq = seq;
- }
- }
- seq= seq->next;
- }
- return best_seq; /* can be null */
-}
-
-
-Sequence *find_nearest_seq(int *hand)
-{
- Sequence *seq;
- Editing *ed;
- float x, y;
- short mval[2];
- float pixelx;
- float handsize;
- float displen;
- View2D *v2d = G.v2d;
- *hand= 0;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
- seq= ed->seqbasep->first;
-
- while(seq) {
- if(seq->machine == (int)y) {
- /* check for both normal strips, and strips that have been flipped horizontally */
- if( ((seq->startdisp < seq->enddisp) && (seq->startdisp<=x && seq->enddisp>=x)) ||
- ((seq->startdisp > seq->enddisp) && (seq->startdisp>=x && seq->enddisp<=x)) )
- {
- if(sequence_is_free_transformable(seq)) {
-
- /* clamp handles to defined size in pixel space */
-
- handsize = seq->handsize;
- displen = (float)abs(seq->startdisp - seq->enddisp);
-
- if (displen / pixelx > 16) { /* dont even try to grab the handles of small strips */
- /* Set the max value to handle to 1/3 of the total len when its less then 28.
- * This is important because otherwise selecting handles happens even when you click in the middle */
-
- if ((displen/3) < 30*pixelx) {
- handsize = displen/3;
- } else {
- CLAMP(handsize, 7*pixelx, 30*pixelx);
- }
-
- if( handsize+seq->startdisp >=x )
- *hand= 1;
- else if( -handsize+seq->enddisp <=x )
- *hand= 2;
- }
- }
- return seq;
- }
- }
- seq= seq->next;
- }
- return 0;
-}
-
-void update_seq_ipo_rect(Sequence * seq)
-{
- float start;
- float end;
-
- if (!seq || !seq->ipo) {
- return;
- }
- start = -5.0;
- end = 105.0;
-
- /* Adjust IPO window to sequence and
- avoid annoying snap-back to startframe
- when Lock Time is on */
- if (G.v2d->flag & V2D_VIEWLOCK) {
- if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- start = -5.0 + seq->startdisp;
- end = 5.0 + seq->enddisp;
- } else {
- start = (float)G.scene->r.sfra - 0.1;
- end = G.scene->r.efra;
- }
- }
-
- seq->ipo->cur.xmin= start;
- seq->ipo->cur.xmax= end;
-}
-
-void update_seq_icu_rects(Sequence * seq)
-{
- IpoCurve *icu= NULL;
- struct SeqEffectHandle sh;
-
- if (!seq || !seq->ipo) {
- return;
- }
-
- if(!(seq->type & SEQ_EFFECT)) {
- return;
- }
-
- sh = get_sequence_effect(seq);
-
- for(icu= seq->ipo->curve.first; icu; icu= icu->next) {
- sh.store_icu_yrange(seq, icu->adrcode, &icu->ymin, &icu->ymax);
- }
-}
-
-int test_overlap_seq(Sequence *test)
-{
- Sequence *seq;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq!=test) {
- if(test->machine==seq->machine) {
- if(test->depth==seq->depth) {
- if( (test->enddisp <= seq->startdisp) || (test->startdisp >= seq->enddisp) );
- else return 1;
- }
- }
- }
- seq= seq->next;
- }
- return 0;
-}
-
-void shuffle_seq(Sequence *test)
-{
- Editing *ed;
- Sequence *seq;
- int a, start;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- /* is there more than 1 select: only shuffle y */
- a=0;
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq->flag & SELECT) a++;
- seq= seq->next;
- }
-
- if(a<2 && test->type==SEQ_IMAGE) {
- start= test->start;
-
- for(a= 1; a<50; a++) {
- test->start= start+a;
- calc_sequence(test);
- if( test_overlap_seq(test)==0) return;
- test->start= start-a;
- calc_sequence(test);
- if( test_overlap_seq(test)==0) return;
- }
- test->start= start;
- }
-
- test->machine++;
- calc_sequence(test);
- while( test_overlap_seq(test) ) {
- if(test->machine >= MAXSEQ) {
- error("There is no more space to add a sequence strip");
-
- BLI_remlink(ed->seqbasep, test);
- free_sequence(test);
- return;
- }
- test->machine++;
- calc_sequence(test);
- }
-}
-
-static int seq_is_parent(Sequence *par, Sequence *seq)
-{
- return ((par->seq1 == seq) || (par->seq2 == seq) || (par->seq3 == seq));
-}
-
-static int seq_is_predecessor(Sequence *pred, Sequence *seq)
-{
- if (!pred) return 0;
- if(pred == seq) return 0;
- else if(seq_is_parent(pred, seq)) return 1;
- else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;
- else if(pred->seq2 && seq_is_predecessor(pred->seq2, seq)) return 1;
- else if(pred->seq3 && seq_is_predecessor(pred->seq3, seq)) return 1;
-
- return 0;
-}
-
-static void deselect_all_seq(void)
-{
- Sequence *seq;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- WHILE_SEQ(ed->seqbasep) {
- seq->flag &= SEQ_DESEL;
- }
- END_SEQ
-
- BIF_undo_push("(De)select all Strips, Sequencer");
-}
-
-static void recurs_sel_seq(Sequence *seqm)
-{
- Sequence *seq;
-
- seq= seqm->seqbase.first;
- while(seq) {
-
- if(seqm->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL)) seq->flag &= SEQ_DESEL;
- else if(seqm->flag & SELECT) seq->flag |= SELECT;
- else seq->flag &= SEQ_DESEL;
-
- if(seq->seqbase.first) recurs_sel_seq(seq);
-
- seq= seq->next;
- }
-}
-
-void select_single_seq(Sequence *seq, int deselect_all)
-{
- if(deselect_all)
- deselect_all_seq();
- set_last_seq(seq);
-
- if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
- if(seq->strip)
- strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
- }
- else if((seq->type==SEQ_HD_SOUND) || (seq->type==SEQ_RAM_SOUND)) {
- if(seq->strip)
- strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
- }
- seq->flag|= SELECT;
- recurs_sel_seq(seq);
-}
-
-void swap_select_seq(void)
-{
- Sequence *seq;
- Editing *ed;
- int sel=0;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) sel= 1;
- }
- END_SEQ
-
- WHILE_SEQ(ed->seqbasep) {
- /* always deselect all to be sure */
- seq->flag &= SEQ_DESEL;
- if(sel==0) seq->flag |= SELECT;
- }
- END_SEQ
-
- allqueue(REDRAWSEQ, 0);
- BIF_undo_push("Swap Selected Strips, Sequencer");
-
-}
-
-void select_channel_direction(Sequence *test,int lr) {
-/* selects all strips in a channel to one direction of the passed strip */
- Sequence *seq;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq!=test) {
- if (test->machine==seq->machine) {
- if(test->depth==seq->depth) {
- if (((lr==1)&&(test->startdisp > (seq->startdisp)))||((lr==2)&&(test->startdisp < (seq->startdisp)))) {
- seq->flag |= SELECT;
- recurs_sel_seq(seq);
- }
- }
- }
- }
- seq= seq->next;
- }
- test->flag |= SELECT;
- recurs_sel_seq(test);
-}
-
-void select_dir_from_last(int lr)
-{
- Sequence *seq=get_last_seq();
- if (seq==NULL)
- return;
-
- select_channel_direction(seq,lr);
- allqueue(REDRAWSEQ, 0);
-
- if (lr==1) BIF_undo_push("Select Strips to the Left, Sequencer");
- else BIF_undo_push("Select Strips to the Right, Sequencer");
-}
-
-void select_surrounding_handles(Sequence *test)
-{
- Sequence *neighbor;
-
- neighbor=find_neighboring_sequence(test, 1, -1);
- if (neighbor) {
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_RIGHTSEL;
- }
- neighbor=find_neighboring_sequence(test, 2, -1);
- if (neighbor) {
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_LEFTSEL;
- }
- test->flag |= SELECT;
-}
-
-void select_surround_from_last()
-{
- Sequence *seq=get_last_seq();
-
- if (seq==NULL)
- return;
-
- select_surrounding_handles(seq);
- allqueue(REDRAWSEQ, 0);
- BIF_undo_push("Select Surrounding Handles, Sequencer");
-}
-
-void select_neighbor_from_last(int lr)
-{
- Sequence *seq=get_last_seq();
- Sequence *neighbor;
- int change = 0;
- if (seq) {
- neighbor=find_neighboring_sequence(seq, lr, -1);
- if (neighbor) {
- switch (lr) {
- case 1:
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_RIGHTSEL;
- seq->flag |= SEQ_LEFTSEL;
- break;
- case 2:
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_LEFTSEL;
- seq->flag |= SEQ_RIGHTSEL;
- break;
- }
- seq->flag |= SELECT;
- change = 1;
- }
- }
- if (change) {
- allqueue(REDRAWSEQ, 0);
-
- if (lr==1) BIF_undo_push("Select Left Handles, Sequencer");
- else BIF_undo_push("Select Right Handles, Sequencer");
- }
-}
-
-void mouse_select_seq(void)
-{
- Sequence *seq,*neighbor;
- int hand,seldir;
- TimeMarker *marker;
-
- marker=find_nearest_marker(SCE_MARKERS, 1);
-
- if (marker) {
- int oldflag;
- /* select timeline marker */
- if (G.qual & LR_SHIFTKEY) {
- oldflag= marker->flag;
- if (oldflag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- }
- else {
- deselect_markers(0, 0);
- marker->flag |= SELECT;
- }
- allqueue(REDRAWMARKER, 0);
- force_draw(0);
-
- BIF_undo_push("Select Strips, Sequencer");
-
- } else {
-
- seq= find_nearest_seq(&hand);
- if(!(G.qual & LR_SHIFTKEY)&&!(G.qual & LR_ALTKEY)&&!(G.qual & LR_CTRLKEY)) deselect_all_seq();
-
- if(seq) {
- set_last_seq(seq);
-
- if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
- if(seq->strip) {
- strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
- }
- } else
- if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) {
- if(seq->strip) {
- strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
- }
- }
-
- if((G.qual & LR_SHIFTKEY) && (seq->flag & SELECT)) {
- if(hand==0) seq->flag &= SEQ_DESEL;
- else if(hand==1) {
- if(seq->flag & SEQ_LEFTSEL)
- seq->flag &= ~SEQ_LEFTSEL;
- else seq->flag |= SEQ_LEFTSEL;
- }
- else if(hand==2) {
- if(seq->flag & SEQ_RIGHTSEL)
- seq->flag &= ~SEQ_RIGHTSEL;
- else seq->flag |= SEQ_RIGHTSEL;
- }
- }
- else {
- seq->flag |= SELECT;
- if(hand==1) seq->flag |= SEQ_LEFTSEL;
- if(hand==2) seq->flag |= SEQ_RIGHTSEL;
- }
-
- /* On Ctrl-Alt selection, select the strip and bordering handles */
- if ((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) {
- if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
- seq->flag |= SELECT;
- select_surrounding_handles(seq);
-
- /* Ctrl signals Left, Alt signals Right
- First click selects adjacent handles on that side.
- Second click selects all strips in that direction.
- If there are no adjacent strips, it just selects all in that direction. */
- } else if (((G.qual & LR_CTRLKEY) || (G.qual & LR_ALTKEY)) && (seq->flag & SELECT)) {
-
- if (G.qual & LR_CTRLKEY) seldir=1;
- else seldir=2;
- neighbor=find_neighboring_sequence(seq, seldir, -1);
- if (neighbor) {
- switch (seldir) {
- case 1:
- if ((seq->flag & SEQ_LEFTSEL)&&(neighbor->flag & SEQ_RIGHTSEL)) {
- if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
- select_channel_direction(seq,1);
- } else {
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_RIGHTSEL;
- seq->flag |= SEQ_LEFTSEL;
- }
- break;
- case 2:
- if ((seq->flag & SEQ_RIGHTSEL)&&(neighbor->flag & SEQ_LEFTSEL)) {
- if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
- select_channel_direction(seq,2);
- } else {
- neighbor->flag |= SELECT;
- recurs_sel_seq(neighbor);
- neighbor->flag |= SEQ_LEFTSEL;
- seq->flag |= SEQ_RIGHTSEL;
- }
- break;
- }
- } else {
- if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq();
- select_channel_direction(seq,seldir);
- }
- }
-
- recurs_sel_seq(seq);
- }
- force_draw_plus(SPACE_BUTS, 0);
-
- if(get_last_seq()) {
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- }
-
- BIF_undo_push("Select Strips, Sequencer");
-
- std_rmouse_transform(transform_seq_nomarker);
- }
-
- /* marker transform */
- if (marker) {
- short mval[2], xo, yo;
- getmouseco_areawin(mval);
- xo= mval[0];
- yo= mval[1];
-
- while(get_mbut()&R_MOUSE) {
- getmouseco_areawin(mval);
- if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
- transform_markers('g', 0);
- allqueue(REDRAWMARKER, 0);
- return;
- }
- BIF_wait_for_statechange();
- }
- }
-}
-
-
-Sequence *alloc_sequence(ListBase *lb, int cfra, int machine)
-{
- Sequence *seq;
-
- /*ed= G.scene->ed;*/
-
- seq= MEM_callocN( sizeof(Sequence), "addseq");
- BLI_addtail(lb, seq);
-
- set_last_seq(seq);
-
- *( (short *)seq->name )= ID_SEQ;
- seq->name[2]= 0;
-
- seq->flag= SELECT;
- seq->start= cfra;
- seq->machine= machine;
- seq->mul= 1.0;
- seq->blend_opacity = 100.0;
-
- return seq;
-}
-
-static Sequence *sfile_to_sequence(SpaceFile *sfile, int cfra, int machine, int last)
-{
- Sequence *seq;
- Strip *strip;
- StripElem *se;
- int totsel, a;
- char name[160];
-
- /* are there selected files? */
- totsel= 0;
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if( (sfile->filelist[a].type & S_IFDIR)==0 ) {
- totsel++;
- }
- }
- }
-
- if(last) {
- /* if not, a file handed to us? */
- if(totsel==0 && sfile->file[0]) totsel= 1;
- }
-
- if(totsel==0) return 0;
-
- /* make seq */
- seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- seq->len= totsel;
-
- if(totsel==1) {
- seq->startstill= 25;
- seq->endstill= 24;
- }
-
- calc_sequence(seq);
-
- if(sfile->flag & FILE_STRINGCODE) {
- strcpy(name, sfile->dir);
- BLI_makestringcode(G.sce, name);
- } else {
- strcpy(name, sfile->dir);
- }
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totsel;
- strip->us= 1;
- strncpy(strip->dir, name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(totsel*sizeof(StripElem), "stripelem");
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if( (sfile->filelist[a].type & S_IFDIR)==0 ) {
- strncpy(se->name, sfile->filelist[a].relname, FILE_MAXFILE-1);
- se++;
- }
- }
- }
- /* no selected file: */
- if(totsel==1 && se==strip->stripdata) {
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
- }
-
- /* last active name */
- strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
-
- return seq;
-}
-
-
-static int sfile_to_mv_sequence_load(SpaceFile *sfile, int cfra,
- int machine, int index )
-{
- Sequence *seq;
- struct anim *anim;
- Strip *strip;
- StripElem *se;
- int totframe;
- char name[160];
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- totframe= 0;
-
- strncpy(str, sfile->dir, FILE_MAXDIR-1);
- if(index<0)
- strncat(str, sfile->file, FILE_MAXDIR-1);
- else
- strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1);
-
- /* is it a movie? */
- anim = openanim(str, IB_rect);
- if(anim==0) {
- error("The selected file is not a movie or "
- "FFMPEG-support not compiled in!");
- return(cfra);
- }
-
- totframe= IMB_anim_get_duration(anim);
-
- /* make seq */
- seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- seq->len= totframe;
- seq->type= SEQ_MOVIE;
- seq->anim= anim;
- seq->anim_preseek = IMB_anim_get_preseek(anim);
-
- calc_sequence(seq);
-
- if(sfile->flag & FILE_STRINGCODE) {
- strcpy(name, sfile->dir);
- BLI_makestringcode(G.sce, name);
- } else {
- strcpy(name, sfile->dir);
- }
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name movie in first strip */
- if(index<0)
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
- else
- strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1);
-
- /* last active name */
- strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
- return(cfra+totframe);
-}
-
-static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine)
-{
- int a, totsel;
-
- totsel= 0;
- for(a= 0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if ((sfile->filelist[a].type & S_IFDIR)==0) {
- totsel++;
- }
- }
- }
-
- if((totsel==0) && (sfile->file[0])) {
- cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, -1);
- return;
- }
-
- if(totsel==0) return;
-
- /* ok. check all the select file, and load it. */
- for(a= 0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if ((sfile->filelist[a].type & S_IFDIR)==0) {
- /* load and update current frame. */
- cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, a);
- }
- }
- }
-}
-
-static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile,
- int cfra, int machine)
-{
- Sequence *seq;
- bSound *sound;
- Strip *strip;
- StripElem *se;
- double totframe;
- char name[160];
- char str[256];
-
- totframe= 0.0;
-
- strncpy(str, sfile->dir, FILE_MAXDIR-1);
- strncat(str, sfile->file, FILE_MAXFILE-1);
-
- sound= sound_new_sound(str);
- if (!sound || sound->sample->type == SAMPLE_INVALID) {
- error("Unsupported audio format");
- return 0;
- }
- if (sound->sample->bits != 16) {
- error("Only 16 bit audio is supported");
- return 0;
- }
- sound->id.us=1;
- sound->flags |= SOUND_FLAGS_SEQUENCE;
- audio_makestream(sound);
-
- totframe= (int) ( ((float)(sound->streamlen-1)/
- ( (float)G.scene->audio.mixrate*4.0 ))* FPS);
-
- /* make seq */
- seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- seq->len= totframe;
- seq->type= SEQ_RAM_SOUND;
- seq->sound = sound;
-
- calc_sequence(seq);
-
- if(sfile->flag & FILE_STRINGCODE) {
- strcpy(name, sfile->dir);
- BLI_makestringcode(G.sce, name);
- } else {
- strcpy(name, sfile->dir);
- }
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name sound in first strip */
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
-
- /* last active name */
- strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
-
- return seq;
-}
-
-static int sfile_to_hdsnd_sequence_load(SpaceFile *sfile, int cfra,
- int machine, int index)
-{
- Sequence *seq;
- struct hdaudio *hdaudio;
- Strip *strip;
- StripElem *se;
- int totframe;
- char name[160];
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- totframe= 0;
-
- strncpy(str, sfile->dir, FILE_MAXDIR-1);
- if(index<0)
- strncat(str, sfile->file, FILE_MAXDIR-1);
- else
- strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1);
-
- /* is it a sound file? */
- hdaudio = sound_open_hdaudio(str);
- if(hdaudio==0) {
- error("The selected file is not a sound file or "
- "FFMPEG-support not compiled in!");
- return(cfra);
- }
-
- totframe= sound_hdaudio_get_duration(hdaudio, FPS);
-
- /* make seq */
- seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- seq->len= totframe;
- seq->type= SEQ_HD_SOUND;
- seq->hdaudio= hdaudio;
-
- calc_sequence(seq);
-
- if(sfile->flag & FILE_STRINGCODE) {
- strcpy(name, sfile->dir);
- BLI_makestringcode(G.sce, name);
- } else {
- strcpy(name, sfile->dir);
- }
-
- /* strip and stripdata */
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= totframe;
- strip->us= 1;
- strncpy(strip->dir, name, FILE_MAXDIR-1);
- strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
-
- /* name movie in first strip */
- if(index<0)
- strncpy(se->name, sfile->file, FILE_MAXFILE-1);
- else
- strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1);
-
- /* last active name */
- strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
- return(cfra+totframe);
-}
-
-static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine)
-{
- int totsel, a;
-
- totsel= 0;
- for(a= 0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if((sfile->filelist[a].type & S_IFDIR)==0) {
- totsel++;
- }
- }
- }
-
- if((totsel==0) && (sfile->file[0])) {
- cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, -1);
- return;
- }
-
- if(totsel==0) return;
-
- /* ok, check all the select file, and load it. */
- for(a= 0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- if((sfile->filelist[a].type & S_IFDIR)==0) {
- /* load and update current frame. */
- cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, a);
- }
- }
- }
-}
-
-
-static void add_image_strips(char *name)
-{
- SpaceFile *sfile;
- struct direntry *files;
- float x, y;
- int a, totfile, cfra, machine;
- short mval[2];
-
- deselect_all_seq();
-
- /* restore windowmatrices */
- areawinset(curarea->win);
- drawseqspace(curarea, curarea->spacedata.first);
-
- /* search sfile */
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==0) return;
-
- /* where will it be */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- waitcursor(1);
-
- /* also read contents of directories */
- files= sfile->filelist;
- totfile= sfile->totfile;
- sfile->filelist= 0;
- sfile->totfile= 0;
-
- for(a=0; a<totfile; a++) {
- if(files[a].flags & ACTIVE) {
- if( (files[a].type & S_IFDIR) ) {
- strncat(sfile->dir, files[a].relname, FILE_MAXFILE-1);
- strcat(sfile->dir,"/");
- read_dir(sfile);
-
- /* select all */
- swapselect_file(sfile);
-
- if ( sfile_to_sequence(sfile, cfra, machine, 0) ) machine++;
-
- parent(sfile);
- }
- }
- }
-
- sfile->filelist= files;
- sfile->totfile= totfile;
-
- /* read directory itself */
- sfile_to_sequence(sfile, cfra, machine, 1);
-
- waitcursor(0);
-
- BIF_undo_push("Add Image Strip, Sequencer");
- transform_seq_nomarker('g', 0);
-
-}
-
-static void add_movie_strip(char *name)
-{
- SpaceFile *sfile;
- float x, y;
- int cfra, machine;
- short mval[2];
-
- deselect_all_seq();
-
- /* restore windowmatrices */
- areawinset(curarea->win);
- drawseqspace(curarea, curarea->spacedata.first);
-
- /* search sfile */
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==0) return;
-
- /* where will it be */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- waitcursor(1);
-
- /* read directory itself */
- sfile_to_mv_sequence(sfile, cfra, machine);
-
- waitcursor(0);
-
- BIF_undo_push("Add Movie Strip, Sequencer");
- transform_seq_nomarker('g', 0);
-
-}
-
-static void add_movie_and_hdaudio_strip(char *name)
-{
- SpaceFile *sfile;
- float x, y;
- int cfra, machine;
- short mval[2];
-
- deselect_all_seq();
-
- /* restore windowmatrices */
- areawinset(curarea->win);
- drawseqspace(curarea, curarea->spacedata.first);
-
- /* search sfile */
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==0) return;
-
- /* where will it be */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- waitcursor(1);
-
- /* read directory itself */
- sfile_to_hdsnd_sequence(sfile, cfra, machine);
- sfile_to_mv_sequence(sfile, cfra, machine);
-
- waitcursor(0);
-
- BIF_undo_push("Add Movie and HD-Audio Strip, Sequencer");
- transform_seq_nomarker('g', 0);
-
-}
-
-static void add_sound_strip_ram(char *name)
-{
- SpaceFile *sfile;
- float x, y;
- int cfra, machine;
- short mval[2];
-
- deselect_all_seq();
-
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if (sfile==0) return;
-
- /* where will it be */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- waitcursor(1);
-
- sfile_to_ramsnd_sequence(sfile, cfra, machine);
-
- waitcursor(0);
-
- BIF_undo_push("Add Sound (RAM) Strip, Sequencer");
- transform_seq_nomarker('g', 0);
-}
-
-static void add_sound_strip_hd(char *name)
-{
- SpaceFile *sfile;
- float x, y;
- int cfra, machine;
- short mval[2];
-
- deselect_all_seq();
-
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if (sfile==0) return;
-
- /* where will it be */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- waitcursor(1);
-
- sfile_to_hdsnd_sequence(sfile, cfra, machine);
-
- waitcursor(0);
-
- BIF_undo_push("Add Sound (HD) Strip, Sequencer");
- transform_seq_nomarker('g', 0);
-}
-
-static void add_scene_strip(short event)
-{
- Sequence *seq;
- Strip *strip;
- float x, y;
- int cfra, machine;
- short mval[2];
-
- if(event> -1) {
- int nr= 1;
- Scene * sce= G.main->scene.first;
- while(sce) {
- if( event==nr) break;
- nr++;
- sce= sce->id.next;
- }
- if(sce) {
-
- deselect_all_seq();
-
- /* where ? */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- seq->type= SEQ_SCENE;
- seq->scene= sce;
- seq->sfra= sce->r.sfra;
- seq->len= sce->r.efra - sce->r.sfra + 1;
-
- seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strncpy(seq->name + 2, sce->id.name + 2,
- sizeof(seq->name) - 2);
- strip->len= seq->len;
- strip->us= 1;
-
- BIF_undo_push("Add Scene Strip, Sequencer");
- transform_seq_nomarker('g', 0);
- }
- }
-}
-
-#if 0
-static void reload_sound_strip(char *name)
-{
- Editing *ed;
- Sequence *seq, *seqact;
- SpaceFile *sfile;
- Sequence *last_seq= get_last_seq();
-
- ed= G.scene->ed;
-
- if(last_seq==0 || last_seq->type!=SEQ_SOUND) return;
- seqact= last_seq; /* last_seq changes in alloc_sequence */
-
- /* search sfile */
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==0) return;
-
- waitcursor(1);
-
- seq = sfile_to_snd_sequence(sfile, seqact->start, seqact->machine);
- printf("seq->type: %i\n", seq->type);
- if(seq && seq!=seqact) {
- /* i'm not sure about this one, seems to work without it -- sgefant */
- free_strip(seqact->strip);
-
- seqact->strip= seq->strip;
-
- seqact->len= seq->len;
- calc_sequence(seqact);
-
- seq->strip= 0;
- free_sequence(seq);
- BLI_remlink(ed->seqbasep, seq);
-
- seq= ed->seqbasep->first;
-
- }
-
- waitcursor(0);
-
- allqueue(REDRAWSEQ, 0);
-}
-#endif
-
-static void reload_image_strip(char *name)
-{
- Editing *ed;
- Sequence *seq, *seqact;
- SpaceFile *sfile;
- Sequence *last_seq= get_last_seq();
-
- ed= G.scene->ed;
-
- if(last_seq==0 || last_seq->type!=SEQ_IMAGE) return;
- seqact= last_seq; /* last_seq changes in alloc_sequence */
-
- /* search sfile */
- sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
- if(sfile==0) return;
-
- waitcursor(1);
-
- seq= sfile_to_sequence(sfile, seqact->start, seqact->machine, 1);
- if(seq && seq!=seqact) {
- free_strip(seqact->strip);
-
- seqact->strip= seq->strip;
-
- seqact->len= seq->len;
- calc_sequence(seqact);
-
- seq->strip= 0;
- free_sequence(seq);
- BLI_remlink(ed->seqbasep, seq);
-
- update_changed_seq_and_deps(seqact, 1, 1);
- }
- waitcursor(0);
-
- allqueue(REDRAWSEQ, 0);
-}
-
-static int event_to_efftype(int event)
-{
- if(event==2) return SEQ_CROSS;
- if(event==3) return SEQ_GAMCROSS;
- if(event==4) return SEQ_ADD;
- if(event==5) return SEQ_SUB;
- if(event==6) return SEQ_MUL;
- if(event==7) return SEQ_ALPHAOVER;
- if(event==8) return SEQ_ALPHAUNDER;
- if(event==9) return SEQ_OVERDROP;
- if(event==10) return SEQ_PLUGIN;
- if(event==13) return SEQ_WIPE;
- if(event==14) return SEQ_GLOW;
- if(event==15) return SEQ_TRANSFORM;
- if(event==16) return SEQ_COLOR;
- if(event==17) return SEQ_SPEED;
- return 0;
-}
-
-static int seq_effect_find_selected(Editing *ed, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3)
-{
- Sequence *seq1= 0, *seq2= 0, *seq3= 0, *seq;
-
- if (!activeseq)
- seq2= get_last_seq();
-
- for(seq=ed->seqbasep->first; seq; seq=seq->next) {
- if(seq->flag & SELECT) {
- if (seq->type == SEQ_RAM_SOUND
- || seq->type == SEQ_HD_SOUND) {
- error("Can't apply effects to "
- "audio sequence strips");
- return 0;
- }
- if((seq != activeseq) && (seq != seq2)) {
- if(seq2==0) seq2= seq;
- else if(seq1==0) seq1= seq;
- else if(seq3==0) seq3= seq;
- else {
- error("Can't apply effect to more than 3 sequence strips");
- return 0;
- }
- }
- }
- }
-
- /* make sequence selection a little bit more intuitive
- for 3 strips: the last-strip should be sequence3 */
- if (seq3 != 0 && seq2 != 0) {
- Sequence *tmp = seq2;
- seq2 = seq3;
- seq3 = tmp;
- }
-
-
- switch(get_sequence_effect_num_inputs(type)) {
- case 0:
- *selseq1 = *selseq2 = *selseq3 = 0;
- return 1;
- case 1:
- if(seq2==0) {
- error("Need at least one selected sequence strip");
- return 0;
- }
- if(seq1==0) seq1= seq2;
- if(seq3==0) seq3= seq2;
- case 2:
- if(seq1==0 || seq2==0) {
- error("Need 2 selected sequence strips");
- return 0;
- }
- if(seq3==0) seq3= seq2;
- }
-
- if (seq1==NULL && seq2==NULL && seq3==NULL) return 0;
-
- *selseq1= seq1;
- *selseq2= seq2;
- *selseq3= seq3;
-
- return 1;
-}
-
-static int add_seq_effect(int type, char *str)
-{
- Editing *ed;
- Sequence *newseq, *seq1, *seq2, *seq3;
- Strip *strip;
- float x, y;
- int cfra, machine;
- short mval[2];
- struct SeqEffectHandle sh;
-
- if(G.scene->ed==0) return 0;
- ed= G.scene->ed;
-
- if(!seq_effect_find_selected(ed, NULL, event_to_efftype(type), &seq1, &seq2, &seq3))
- return 0;
-
- deselect_all_seq();
-
- /* where will it be (cfra is not realy needed) */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &x, &y);
- cfra= (int)(x+0.5);
- machine= (int)(y+0.5);
-
- /* allocate and initialize */
- newseq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine);
- newseq->type= event_to_efftype(type);
-
- sh = get_sequence_effect(newseq);
-
- newseq->seq1= seq1;
- newseq->seq2= seq2;
- newseq->seq3= seq3;
-
- sh.init(newseq);
-
- if (!seq1) {
- newseq->len= 1;
- newseq->startstill= 25;
- newseq->endstill= 24;
- }
-
- calc_sequence(newseq);
-
- newseq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
- strip->len= newseq->len;
- strip->us= 1;
- if(newseq->len>0)
- strip->stripdata= MEM_callocN(newseq->len*sizeof(StripElem), "stripelem");
-
- /* initialize plugin */
- if(newseq->type == SEQ_PLUGIN) {
- sh.init_plugin(newseq, str);
-
- if(newseq->plugin==0) {
- BLI_remlink(ed->seqbasep, newseq);
- free_sequence(newseq);
- set_last_seq(NULL);
- return 0;
- }
- }
-
- /* set find a free spot to but the strip */
- if (newseq->seq1) {
- newseq->machine= MAX3(newseq->seq1->machine,
- newseq->seq2->machine,
- newseq->seq3->machine);
- }
- if(test_overlap_seq(newseq)) shuffle_seq(newseq);
-
- update_changed_seq_and_deps(newseq, 1, 1);
-
- /* push undo and go into grab mode */
- if(newseq->type == SEQ_PLUGIN) {
- BIF_undo_push("Add Plugin Strip, Sequencer");
- } else {
- BIF_undo_push("Add Effect Strip, Sequencer");
- }
-
- transform_seq_nomarker('g', 0);
-
- return 1;
-}
-
-static void load_plugin_seq(char *str) /* called from fileselect */
-{
- add_seq_effect(10, str);
-}
-
-void add_sequence(int type)
-{
- Editing *ed;
- short event;
- char *str;
-
- if (type >= 0){
- /* bypass pupmenu for calls from menus (aphex) */
- switch(type){
- case SEQ_SCENE:
- event = 101;
- break;
- case SEQ_IMAGE:
- event = 1;
- break;
- case SEQ_MOVIE:
- event = 102;
- break;
- case SEQ_RAM_SOUND:
- event = 103;
- break;
- case SEQ_HD_SOUND:
- event = 104;
- break;
- case SEQ_MOVIE_AND_HD_SOUND:
- event = 105;
- break;
- case SEQ_PLUGIN:
- event = 10;
- break;
- case SEQ_CROSS:
- event = 2;
- break;
- case SEQ_ADD:
- event = 4;
- break;
- case SEQ_SUB:
- event = 5;
- break;
- case SEQ_ALPHAOVER:
- event = 7;
- break;
- case SEQ_ALPHAUNDER:
- event = 8;
- break;
- case SEQ_GAMCROSS:
- event = 3;
- break;
- case SEQ_MUL:
- event = 6;
- break;
- case SEQ_OVERDROP:
- event = 9;
- break;
- case SEQ_WIPE:
- event = 13;
- break;
- case SEQ_GLOW:
- event = 14;
- break;
- case SEQ_TRANSFORM:
- event = 15;
- break;
- case SEQ_COLOR:
- event = 16;
- break;
- case SEQ_SPEED:
- event = 17;
- break;
- default:
- event = 0;
- break;
- }
- }
- else {
- event= pupmenu("Add Sequence Strip%t"
- "|Image Sequence%x1"
- "|Movie%x102"
-#ifdef WITH_FFMPEG
- "|Movie + Audio (HD)%x105"
- "|Audio (RAM)%x103"
- "|Audio (HD)%x104"
-#else
- "|Audio (Wav)%x103"
-#endif
- "|Scene%x101"
- "|Plugin%x10"
- "|Cross%x2"
- "|Gamma Cross%x3"
- "|Add%x4"
- "|Sub%x5"
- "|Mul%x6"
- "|Alpha Over%x7"
- "|Alpha Under%x8"
- "|Alpha Over Drop%x9"
- "|Wipe%x13"
- "|Glow%x14"
- "|Transforms%x15"
- "|Color Generator%x16"
- "|Speed Control%x17");
- }
-
- if(event<1) return;
-
- if(G.scene->ed==0) {
- ed= G.scene->ed= MEM_callocN( sizeof(Editing), "addseq");
- ed->seqbasep= &ed->seqbase;
- }
- else ed= G.scene->ed;
-
- switch(event) {
- case 1:
- /* Image Dosnt work at the moment - TODO */
- //if(G.qual & LR_CTRLKEY)
- // activate_imageselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips);
- //else
- activate_fileselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips);
- break;
- case 105:
- activate_fileselect(FILE_SPECIAL, "Select Movie+Audio", last_imagename, add_movie_and_hdaudio_strip);
- break;
- case 102:
-
- activate_fileselect(FILE_SPECIAL, "Select Movie", last_imagename, add_movie_strip);
- break;
- case 101:
- /* new menu: */
- IDnames_to_pupstring(&str, NULL, NULL, &G.main->scene, (ID *)G.scene, NULL);
-
- add_scene_strip(pupmenu_col(str, 20));
-
- MEM_freeN(str);
-
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- if(get_last_seq()==0 &&
- get_sequence_effect_num_inputs( event_to_efftype(event))> 0)
- error("Need at least one active sequence strip");
- else if(event==10)
- activate_fileselect(FILE_SPECIAL, "Select Plugin", U.plugseqdir, load_plugin_seq);
- else
- add_seq_effect(event, NULL);
-
- break;
- case 103:
- if (!last_sounddir[0]) strncpy(last_sounddir, U.sounddir, FILE_MAXDIR-1);
- activate_fileselect(FILE_SPECIAL, "Select Audio (RAM)", last_sounddir, add_sound_strip_ram);
- break;
- case 104:
- if (!last_sounddir[0]) strncpy(last_sounddir, U.sounddir, FILE_MAXDIR-1);
- activate_fileselect(FILE_SPECIAL, "Select Audio (HD)", last_sounddir, add_sound_strip_hd);
- break;
- }
-}
-
-void change_sequence(void)
-{
- Sequence *last_seq= get_last_seq();
- Scene *sce;
- short event;
-
- if(last_seq==0) return;
-
- if(last_seq->type & SEQ_EFFECT) {
- event = pupmenu("Change Effect%t"
- "|Switch A <-> B %x1"
- "|Switch B <-> C %x10"
- "|Plugin%x11"
- "|Recalculate%x12"
- "|Cross%x2"
- "|Gamma Cross%x3"
- "|Add%x4"
- "|Sub%x5"
- "|Mul%x6"
- "|Alpha Over%x7"
- "|Alpha Under%x8"
- "|Alpha Over Drop%x9"
- "|Wipe%x13"
- "|Glow%x14"
- "|Transform%x15"
- "|Color Generator%x16"
- "|Speed Control%x17");
- if(event > 0) {
- if(event==1) {
- SWAP(Sequence *,last_seq->seq1,last_seq->seq2);
- }
- else if(event==10) {
- SWAP(Sequence *,last_seq->seq2,last_seq->seq3);
- }
- else if(event==11) {
- activate_fileselect(
- FILE_SPECIAL, "Select Plugin",
- U.plugseqdir, change_plugin_seq);
- }
- else if(event==12);
- /* recalculate: only new_stripdata */
- else {
- /* free previous effect and init new effect */
- struct SeqEffectHandle sh;
-
- if (get_sequence_effect_num_inputs(
- last_seq->type)
- < get_sequence_effect_num_inputs(
- event_to_efftype(event))) {
- error("New effect needs more "
- "input strips!");
- } else {
- sh = get_sequence_effect(last_seq);
- sh.free(last_seq);
-
- last_seq->type
- = event_to_efftype(event);
-
- sh = get_sequence_effect(last_seq);
- sh.init(last_seq);
- }
- }
-
- update_changed_seq_and_deps(last_seq, 0, 1);
- allqueue(REDRAWSEQ, 0);
- BIF_undo_push("Change Strip Effect, Sequencer");
- }
- }
- else if(last_seq->type == SEQ_IMAGE) {
- if(okee("Change images")) {
- activate_fileselect(FILE_SPECIAL,
- "Select Images",
- last_imagename,
- reload_image_strip);
- }
- }
- else if(last_seq->type == SEQ_MOVIE) {
- ;
- }
- else if(last_seq->type == SEQ_SCENE) {
- event= pupmenu("Change Scene%t|Update Start and End");
-
- if(event==1) {
- sce= last_seq->scene;
-
- last_seq->len= sce->r.efra - sce->r.sfra + 1;
- last_seq->sfra= sce->r.sfra;
-
- /* bad code to change seq->len? update_changed_seq_and_deps() expects the strip->len to be OK */
- new_tstripdata(last_seq);
-
- update_changed_seq_and_deps(last_seq, 1, 1);
-
- allqueue(REDRAWSEQ, 0);
- }
- }
-
-}
-
-void reload_sequence(void)
-{
- Editing *ed= G.scene->ed;
- Sequence *seq;
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) {
- update_changed_seq_and_deps(seq, 0, 1);
- }
- }
- END_SEQ
- allqueue(REDRAWSEQ, 0);
-}
-
-void reassign_inputs_seq_effect()
-{
- Editing *ed= G.scene->ed;
- Sequence *seq1, *seq2, *seq3, *last_seq = get_last_seq();
-
- if(last_seq==0 || !(last_seq->type & SEQ_EFFECT)) return;
- if(ed==0) return;
-
- if(!seq_effect_find_selected(ed, last_seq, last_seq->type, &seq1, &seq2, &seq3))
- return;
-
- /* see reassigning would create a cycle */
- if(seq_is_predecessor(seq1, last_seq) || seq_is_predecessor(seq2, last_seq) ||
- seq_is_predecessor(seq3, last_seq)) {
- error("Can't reassign inputs: no cycles allowed");
- return;
- }
-
- last_seq->seq1 = seq1;
- last_seq->seq2 = seq2;
- last_seq->seq3 = seq3;
-
- update_changed_seq_and_deps(last_seq, 1, 1);
-
- allqueue(REDRAWSEQ, 0);
-}
-
-static Sequence *del_seq_find_replace_recurs(Sequence *seq)
-{
- Sequence *seq1, *seq2, *seq3;
-
- /* try to find a replacement input sequence, and flag for later deletion if
- no replacement can be found */
-
- if(!seq)
- return NULL;
- else if(!(seq->type & SEQ_EFFECT))
- return ((seq->flag & SELECT)? NULL: seq);
- else if(!(seq->flag & SELECT)) {
- /* try to find replacement for effect inputs */
- seq1= del_seq_find_replace_recurs(seq->seq1);
- seq2= del_seq_find_replace_recurs(seq->seq2);
- seq3= del_seq_find_replace_recurs(seq->seq3);
-
- if(seq1==seq->seq1 && seq2==seq->seq2 && seq3==seq->seq3);
- else if(seq1 || seq2 || seq3) {
- seq->seq1= (seq1)? seq1: (seq2)? seq2: seq3;
- seq->seq2= (seq2)? seq2: (seq1)? seq1: seq3;
- seq->seq3= (seq3)? seq3: (seq1)? seq1: seq2;
-
- update_changed_seq_and_deps(seq, 1, 1);
- }
- else
- seq->flag |= SELECT; /* mark for delete */
- }
-
- if (seq->flag & SELECT) {
- if((seq1 = del_seq_find_replace_recurs(seq->seq1))) return seq1;
- if((seq2 = del_seq_find_replace_recurs(seq->seq2))) return seq2;
- if((seq3 = del_seq_find_replace_recurs(seq->seq3))) return seq3;
- else return NULL;
- }
- else
- return seq;
-}
-
-static void recurs_del_seq_flag(ListBase *lb, short flag, short deleteall)
-{
- Sequence *seq, *seqn;
- Sequence *last_seq = get_last_seq();
-
- seq= lb->first;
- while(seq) {
- seqn= seq->next;
- if((seq->flag & flag) || deleteall) {
- if(seq->type==SEQ_RAM_SOUND && seq->sound)
- seq->sound->id.us--;
-
- BLI_remlink(lb, seq);
- if(seq==last_seq) set_last_seq(0);
- if(seq->type==SEQ_META) recurs_del_seq_flag(&seq->seqbase, flag, 1);
- if(seq->ipo) seq->ipo->id.us--;
- free_sequence(seq);
- }
- seq= seqn;
- }
-}
-
-void del_seq(void)
-{
- Sequence *seq;
- MetaStack *ms;
- Editing *ed;
- int nothingSelected = TRUE;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- seq=get_last_seq();
- if (seq && seq->flag & SELECT) { /* avoid a loop since this is likely to be selected */
- nothingSelected = FALSE;
- } else {
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if (seq->flag & SELECT) {
- nothingSelected = FALSE;
- break;
- }
- }
- }
-
- if(nothingSelected || okee("Erase selected")==0) return;
-
- /* free imbufs of all dependent strips */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if(seq->flag & SELECT)
- update_changed_seq_and_deps(seq, 1, 0);
-
- /* for effects, try to find a replacement input */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT))
- del_seq_find_replace_recurs(seq);
-
- /* delete all selected strips */
- recurs_del_seq_flag(ed->seqbasep, SELECT, 0);
-
- /* updates lengths etc */
- seq= ed->seqbasep->first;
- while(seq) {
- calc_sequence(seq);
- seq= seq->next;
- }
-
- /* free parent metas */
- ms= ed->metastack.last;
- while(ms) {
- ms->parseq->strip->len= 0; /* force new alloc */
- calc_sequence(ms->parseq);
- ms= ms->prev;
- }
-
- BIF_undo_push("Delete Strip(s), Sequencer");
- allqueue(REDRAWSEQ, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-static Sequence *dupli_seq(Sequence *seq)
-{
- Sequence *seqn = MEM_dupallocN(seq);
-
- seq->tmp = seqn;
-
- seqn->strip= MEM_dupallocN(seq->strip);
-
- if(seqn->ipo) seqn->ipo->id.us++;
-
- seqn->strip->tstripdata = 0;
- seqn->strip->tstripdata_startstill = 0;
- seqn->strip->tstripdata_endstill = 0;
- seqn->strip->ibuf_startstill = 0;
- seqn->strip->ibuf_endstill = 0;
-
- if (seq->strip->crop) {
- seqn->strip->crop = MEM_dupallocN(seq->strip->crop);
- }
-
- if (seq->strip->transform) {
- seqn->strip->transform = MEM_dupallocN(seq->strip->transform);
- }
-
- if (seq->strip->proxy) {
- seqn->strip->proxy = MEM_dupallocN(seq->strip->proxy);
- }
-
- if (seq->strip->color_balance) {
- seqn->strip->color_balance
- = MEM_dupallocN(seq->strip->color_balance);
- }
-
- if(seq->type==SEQ_META) {
- seqn->strip->stripdata = 0;
-
- seqn->seqbase.first= seqn->seqbase.last= 0;
- /* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */
- /* - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);*/
- } else if(seq->type == SEQ_SCENE) {
- seqn->strip->stripdata = 0;
- } else if(seq->type == SEQ_MOVIE) {
- seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- seqn->anim= 0;
- } else if(seq->type == SEQ_RAM_SOUND) {
- seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- seqn->sound->id.us++;
- } else if(seq->type == SEQ_HD_SOUND) {
- seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- seqn->hdaudio = 0;
- } else if(seq->type == SEQ_IMAGE) {
- seqn->strip->stripdata =
- MEM_dupallocN(seq->strip->stripdata);
- } else if(seq->type >= SEQ_EFFECT) {
- if(seq->seq1 && seq->seq1->tmp) seqn->seq1= seq->seq1->tmp;
- if(seq->seq2 && seq->seq2->tmp) seqn->seq2= seq->seq2->tmp;
- if(seq->seq3 && seq->seq3->tmp) seqn->seq3= seq->seq3->tmp;
-
- if (seq->type & SEQ_EFFECT) {
- struct SeqEffectHandle sh;
- sh = get_sequence_effect(seq);
- if(sh.copy)
- sh.copy(seq, seqn);
- }
-
- seqn->strip->stripdata = 0;
-
- } else {
- fprintf(stderr, "Aiiiiekkk! sequence type not "
- "handled in duplicate!\nExpect a crash"
- " now...\n");
- }
-
- seqn->flag &= ~SEQ_ACTIVE;
-
- return seqn;
-}
-
-static Sequence * deep_dupli_seq(Sequence * seq)
-{
- Sequence * seqn = dupli_seq(seq);
- if (seq->type == SEQ_META) {
- Sequence * s;
- for(s= seq->seqbase.first; s; s = s->next) {
- Sequence * n = deep_dupli_seq(s);
- if (n) {
- BLI_addtail(&seqn->seqbase, n);
- }
- }
- }
- return seqn;
-}
-
-
-static void recurs_dupli_seq(ListBase *old, ListBase *new)
-{
- Sequence *seq;
- Sequence *seqn = 0;
- Sequence *last_seq = get_last_seq();
-
- for(seq= old->first; seq; seq= seq->next) {
- seq->tmp= NULL;
- if(seq->flag & SELECT) {
- seqn = dupli_seq(seq);
- if (seqn) { /*should never fail */
- seq->flag &= SEQ_DESEL;
- seqn->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL+SEQ_LOCK);
-
- BLI_addtail(new, seqn);
- if(seq->type==SEQ_META)
- recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);
-
- if (seq == last_seq) {
- set_last_seq(seqn);
- }
- }
- }
- }
-}
-
-static Sequence * cut_seq_hard(Sequence * seq, int cutframe)
-{
- TransSeq ts;
- Sequence *seqn = 0;
- int skip_dup = FALSE;
-
- /* backup values */
- ts.start= seq->start;
- ts.machine= seq->machine;
- ts.startstill= seq->startstill;
- ts.endstill= seq->endstill;
- ts.startdisp= seq->startdisp;
- ts.enddisp= seq->enddisp;
- ts.startofs= seq->anim_startofs;
- ts.endofs= seq->anim_endofs;
- ts.len= seq->len;
-
- /* First Strip! */
- /* strips with extended stillfames before */
-
- if ((seq->startstill) && (cutframe <seq->start)) {
- /* don't do funny things with METAs ... */
- if (seq->type == SEQ_META) {
- skip_dup = TRUE;
- seq->startstill = seq->start - cutframe;
- } else {
- seq->start= cutframe -1;
- seq->startstill= cutframe -seq->startdisp -1;
- seq->anim_endofs += seq->len - 1;
- seq->endstill= 0;
- }
- }
- /* normal strip */
- else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) {
- seq->endofs = 0;
- seq->endstill = 0;
- seq->anim_endofs += (seq->start+seq->len) - cutframe;
- }
- /* strips with extended stillframes after */
- else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) {
- seq->endstill -= seq->enddisp - cutframe;
- /* don't do funny things with METAs ... */
- if (seq->type == SEQ_META) {
- skip_dup = TRUE;
- }
- }
-
- reload_sequence_new_file(seq);
- calc_sequence(seq);
-
- if (!skip_dup) {
- /* Duplicate AFTER the first change */
- seqn = deep_dupli_seq(seq);
- }
-
- if (seqn) {
- seqn->flag |= SELECT;
-
- /* Second Strip! */
- /* strips with extended stillframes before */
- if ((seqn->startstill) && (cutframe == seqn->start + 1)) {
- seqn->start = ts.start;
- seqn->startstill= ts.start- cutframe;
- seqn->anim_endofs = ts.endofs;
- seqn->endstill = ts.endstill;
- }
-
- /* normal strip */
- else if ((cutframe>=seqn->start)&&(cutframe<=(seqn->start+seqn->len))) {
- seqn->start = cutframe;
- seqn->startstill = 0;
- seqn->startofs = 0;
- seqn->anim_startofs += cutframe - ts.start;
- seqn->anim_endofs = ts.endofs;
- seqn->endstill = ts.endstill;
- }
-
- /* strips with extended stillframes after */
- else if (((seqn->start+seqn->len) < cutframe) && (seqn->endstill)) {
- seqn->start = cutframe;
- seqn->startofs = 0;
- seqn->anim_startofs += ts.len-1;
- seqn->endstill = ts.enddisp - cutframe -1;
- seqn->startstill = 0;
- }
-
- reload_sequence_new_file(seqn);
- calc_sequence(seqn);
- }
- return seqn;
-}
-
-static Sequence * cut_seq_soft(Sequence * seq, int cutframe)
-{
- TransSeq ts;
- Sequence *seqn = 0;
- int skip_dup = FALSE;
-
- /* backup values */
- ts.start= seq->start;
- ts.machine= seq->machine;
- ts.startstill= seq->startstill;
- ts.endstill= seq->endstill;
- ts.startdisp= seq->startdisp;
- ts.enddisp= seq->enddisp;
- ts.startofs= seq->startofs;
- ts.endofs= seq->endofs;
- ts.len= seq->len;
-
- /* First Strip! */
- /* strips with extended stillfames before */
-
- if ((seq->startstill) && (cutframe <seq->start)) {
- /* don't do funny things with METAs ... */
- if (seq->type == SEQ_META) {
- skip_dup = TRUE;
- seq->startstill = seq->start - cutframe;
- } else {
- seq->start= cutframe -1;
- seq->startstill= cutframe -seq->startdisp -1;
- seq->endofs = seq->len - 1;
- seq->endstill= 0;
- }
- }
- /* normal strip */
- else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) {
- seq->endofs = (seq->start+seq->len) - cutframe;
- }
- /* strips with extended stillframes after */
- else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) {
- seq->endstill -= seq->enddisp - cutframe;
- /* don't do funny things with METAs ... */
- if (seq->type == SEQ_META) {
- skip_dup = TRUE;
- }
- }
-
- calc_sequence(seq);
-
- if (!skip_dup) {
- /* Duplicate AFTER the first change */
- seqn = deep_dupli_seq(seq);
- }
-
- if (seqn) {
- seqn->flag |= SELECT;
-
- /* Second Strip! */
- /* strips with extended stillframes before */
- if ((seqn->startstill) && (cutframe == seqn->start + 1)) {
- seqn->start = ts.start;
- seqn->startstill= ts.start- cutframe;
- seqn->endofs = ts.endofs;
- seqn->endstill = ts.endstill;
- }
-
- /* normal strip */
- else if ((cutframe>=seqn->start)&&(cutframe<=(seqn->start+seqn->len))) {
- seqn->startstill = 0;
- seqn->startofs = cutframe - ts.start;
- seqn->endofs = ts.endofs;
- seqn->endstill = ts.endstill;
- }
-
- /* strips with extended stillframes after */
- else if (((seqn->start+seqn->len) < cutframe) && (seqn->endstill)) {
- seqn->start = cutframe - ts.len +1;
- seqn->startofs = ts.len-1;
- seqn->endstill = ts.enddisp - cutframe -1;
- seqn->startstill = 0;
- }
-
- calc_sequence(seqn);
- }
- return seqn;
-}
-
-
-/* like duplicate, but only duplicate and cut overlapping strips,
- * strips to the left of the cutframe are ignored and strips to the right are moved into the new list */
-static int cut_seq_list(ListBase *old, ListBase *new, int cutframe,
- Sequence * (*cut_seq)(Sequence *, int))
-{
- int did_something = FALSE;
- Sequence *seq, *seq_next;
-
- seq= old->first;
-
- while(seq) {
- seq_next = seq->next; /* we need this because we may remove seq */
-
- seq->tmp= NULL;
- if(seq->flag & SELECT) {
- if(cutframe > seq->startdisp &&
- cutframe < seq->enddisp) {
- Sequence * seqn = cut_seq(seq, cutframe);
- if (seqn) {
- BLI_addtail(new, seqn);
- }
- did_something = TRUE;
- } else if (seq->enddisp <= cutframe) {
- /* do nothing */
- } else if (seq->startdisp >= cutframe) {
- /* move into new list */
- BLI_remlink(old, seq);
- BLI_addtail(new, seq);
- }
- }
- seq = seq_next;
- }
- return did_something;
-}
-
-void seq_cut(int cutframe, int hard_cut)
-{
- Editing *ed;
- ListBase newlist;
- char side;
- int did_something;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- newlist.first= newlist.last= NULL;
-
- if (hard_cut) {
- did_something = cut_seq_list(
- ed->seqbasep, &newlist, cutframe, cut_seq_hard);
- } else {
- did_something = cut_seq_list(
- ed->seqbasep, &newlist, cutframe, cut_seq_soft);
- }
-
- if (newlist.first) { /* got new strips ? */
- Sequence *seq;
- addlisttolist(ed->seqbasep, &newlist);
-
-
- /* change the selection, not strictly needed but nice */
- side = mouse_cfra_side(cutframe);
-
- WHILE_SEQ(ed->seqbasep) {
- if (side=='L') {
- if ( seq->startdisp >= cutframe ) {
- seq->flag &= ~SELECT;
- }
- } else {
- if ( seq->enddisp <= cutframe ) {
- seq->flag &= ~SELECT;
- }
- }
- }
- END_SEQ;
-
- /* as last: */
- sort_seq();
- }
- if (did_something) {
- allqueue(REDRAWSEQ, 0);
- BIF_undo_push("Cut Strips, Sequencer");
- }
-}
-
-void add_duplicate_seq(void)
-{
- Editing *ed;
- ListBase new;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- new.first= new.last= 0;
-
- recurs_dupli_seq(ed->seqbasep, &new);
- addlisttolist(ed->seqbasep, &new);
-
- BIF_undo_push("Add Duplicate, Sequencer");
- transform_seq_nomarker('g', 0);
-}
-
-int insert_gap(int gap, int cfra)
-{
- Sequence *seq;
- Editing *ed;
- int done=0;
-
- /* all strips >= cfra are shifted */
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- WHILE_SEQ(ed->seqbasep) {
- if(seq->startdisp >= cfra) {
- seq->start+= gap;
- calc_sequence(seq);
- done= 1;
- }
- }
- END_SEQ
-
- return done;
-}
-
-void touch_seq_files(void)
-{
- Sequence *seq;
- Editing *ed;
- char str[256];
-
- /* touch all strips with movies */
- ed= G.scene->ed;
- if(ed==0) return;
-
- if(okee("Touch and print selected movies")==0) return;
-
- waitcursor(1);
-
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) {
- if(seq->type==SEQ_MOVIE) {
- if(seq->strip && seq->strip->stripdata) {
- BLI_make_file_string(G.sce, str, seq->strip->dir, seq->strip->stripdata->name);
- BLI_touch(seq->name);
- }
- }
-
- }
- }
- END_SEQ
-
- waitcursor(0);
-}
-
-void set_filter_seq(void)
-{
- Sequence *seq;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- if(okee("Set Deinterlace")==0) return;
-
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) {
- if(seq->type==SEQ_MOVIE) {
- seq->flag |= SEQ_FILTERY;
- reload_sequence_new_file(seq);
- }
-
- }
- }
- END_SEQ
-
-}
-
-void seq_remap_paths(void)
-{
- Sequence *seq, *last_seq = get_last_seq();
- Editing *ed;
- char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX];
-
- ed= G.scene->ed;
- if(ed==NULL || last_seq==NULL)
- return;
-
- BLI_strncpy(from, last_seq->strip->dir, FILE_MAX);
- if (0==sbutton(from, 0, sizeof(from)-1, "From: "))
- return;
-
- strcpy(to, from);
- if (0==sbutton(to, 0, sizeof(to)-1, "To: "))
- return;
-
- if (strcmp(to, from)==0)
- return;
-
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) {
- if(strncmp(seq->strip->dir, from, strlen(from))==0) {
- printf("found %s\n", seq->strip->dir);
-
- /* strip off the beginning */
- stripped[0]= 0;
- BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX);
-
- /* new path */
- BLI_strncpy(seq->strip->dir, to, FILE_MAX);
- strcat(seq->strip->dir, stripped);
- printf("new %s\n", seq->strip->dir);
- }
- }
- }
- END_SEQ
-
- BIF_undo_push("Remap Paths, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-
-void no_gaps(void)
-{
- Editing *ed;
- int cfra, first= 0, done;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- for(cfra= CFRA; cfra<=EFRA; cfra++) {
- if(first==0) {
- if( evaluate_seq_frame(cfra) ) first= 1;
- }
- else {
- done= 1;
- while( evaluate_seq_frame(cfra) == 0) {
- done= insert_gap(-1, cfra);
- if(done==0) break;
- }
- if(done==0) break;
- }
- }
-
- BIF_undo_push("No Gaps, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-
-/* ****************** META ************************* */
-
-void make_meta(void)
-{
- Sequence *seq, *seqm, *next;
- Editing *ed;
- int tot;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- /* is there more than 1 select */
- tot= 0;
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq->flag & SELECT) {
- tot++;
- if (seq->type == SEQ_RAM_SOUND) {
- error("Can't make Meta Strip from audio");
- return;
- }
- }
- seq= seq->next;
- }
- if(tot < 1) return;
-
- if(okee("Make Meta Strip")==0) return;
-
- /* test relationships */
- seq= ed->seqbasep->first;
- while(seq) {
- if(seq->flag & SELECT) {
- if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 &&
- (seq->seq1->flag & SELECT)==0) tot= 0;
- if(seq->seq2 &&
- (seq->seq2->flag & SELECT)==0) tot= 0;
- if(seq->seq3 &&
- (seq->seq3->flag & SELECT)==0) tot= 0;
- }
- }
- else if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 &&
- (seq->seq1->flag & SELECT)) tot= 0;
- if(seq->seq2 &&
- (seq->seq2->flag & SELECT)) tot= 0;
- if(seq->seq3 &&
- (seq->seq3->flag & SELECT)) tot= 0;
- }
- if(tot==0) break;
- seq= seq->next;
- }
- if(tot==0) {
- error("Please select all related strips");
- return;
- }
-
- /* remove all selected from main list, and put in meta */
-
- seqm= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, 1, 1);
- seqm->type= SEQ_META;
- seqm->flag= SELECT;
-
- seq= ed->seqbasep->first;
- while(seq) {
- next= seq->next;
- if(seq!=seqm && (seq->flag & SELECT)) {
- BLI_remlink(ed->seqbasep, seq);
- BLI_addtail(&seqm->seqbase, seq);
- }
- seq= next;
- }
- calc_sequence(seqm);
-
- seqm->strip= MEM_callocN(sizeof(Strip), "metastrip");
- seqm->strip->len= seqm->len;
- seqm->strip->us= 1;
-
- if( test_overlap_seq(seqm) ) shuffle_seq(seqm);
-
- BIF_undo_push("Make Meta Strip, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-static int seq_depends_on_meta(Sequence *seq, Sequence *seqm)
-{
- if (seq == seqm) return 1;
- else if (seq->seq1 && seq_depends_on_meta(seq->seq1, seqm)) return 1;
- else if (seq->seq2 && seq_depends_on_meta(seq->seq2, seqm)) return 1;
- else if (seq->seq3 && seq_depends_on_meta(seq->seq3, seqm)) return 1;
- else return 0;
-}
-
-void un_meta(void)
-{
- Editing *ed;
- Sequence *seq, *last_seq = get_last_seq();
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- if(last_seq==0 || last_seq->type!=SEQ_META) return;
-
- if(okee("Un Meta Strip")==0) return;
-
- addlisttolist(ed->seqbasep, &last_seq->seqbase);
-
- last_seq->seqbase.first= 0;
- last_seq->seqbase.last= 0;
-
- BLI_remlink(ed->seqbasep, last_seq);
- free_sequence(last_seq);
-
- /* emtpy meta strip, delete all effects depending on it */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if((seq->type & SEQ_EFFECT) && seq_depends_on_meta(seq, last_seq))
- seq->flag |= SEQ_FLAG_DELETE;
-
- recurs_del_seq_flag(ed->seqbasep, SEQ_FLAG_DELETE, 0);
-
- /* test for effects and overlap */
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT) {
- seq->flag &= ~SEQ_OVERLAP;
- if( test_overlap_seq(seq) ) {
- shuffle_seq(seq);
- }
- }
- }
- END_SEQ;
-
- sort_seq();
-
- BIF_undo_push("Un-Make Meta Strip, Sequencer");
- allqueue(REDRAWSEQ, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-void exit_meta(void)
-{
- Sequence *seq;
- MetaStack *ms;
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- if(ed->metastack.first==0) return;
-
- ms= ed->metastack.last;
- BLI_remlink(&ed->metastack, ms);
-
- ed->seqbasep= ms->oldbasep;
-
- /* recalc all: the meta can have effects connected to it */
- seq= ed->seqbasep->first;
- while(seq) {
- calc_sequence(seq);
- seq= seq->next;
- }
-
- set_last_seq(ms->parseq);
-
- ms->parseq->flag |= SELECT;
- recurs_sel_seq(ms->parseq);
-
- MEM_freeN(ms);
- allqueue(REDRAWSEQ, 0);
- allqueue(REDRAWOOPS, 0);
-
- BIF_undo_push("Exit Meta Strip, Sequence");
-}
-
-
-void enter_meta(void)
-{
- MetaStack *ms;
- Editing *ed;
- Sequence *last_seq= get_last_seq();
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- if(last_seq==0 || last_seq->type!=SEQ_META || (last_seq->flag & SELECT)==0) {
- exit_meta();
- return;
- }
-
- ms= MEM_mallocN(sizeof(MetaStack), "metastack");
- BLI_addtail(&ed->metastack, ms);
- ms->parseq= last_seq;
- ms->oldbasep= ed->seqbasep;
-
- ed->seqbasep= &last_seq->seqbase;
-
- set_last_seq(NULL);
- allqueue(REDRAWSEQ, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Enter Meta Strip, Sequence");
-}
-
-
-/* ****************** END META ************************* */
-
-static int seq_get_snaplimit(void)
-{
- /* fake mouse coords to get the snap value
- a bit lazy but its only done once pre transform */
- float xmouse, ymouse, x;
- short mval[2] = {24, 0}; /* 24 screen px snap */
- areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse);
- x = xmouse;
- mval[0] = 0;
- areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse);
- return (int)(x - xmouse);
-}
-
-/* use to impose limits when dragging/extending - so impossible situations dont happen */
-static void transform_grab_xlimits(Sequence *seq, int leftflag, int rightflag)
-{
- if(leftflag) {
- if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_final_right(seq, 0)) {
- seq_tx_set_final_left(seq, seq_tx_get_final_right(seq, 0)-1);
- }
-
- if (check_single_seq(seq)==0) {
- if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_end(seq)) {
- seq_tx_set_final_left(seq, seq_tx_get_end(seq)-1);
- }
-
- /* dosnt work now - TODO */
- /*
- if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq, 0)) {
- int ofs;
- ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq, 0);
- seq->start -= ofs;
- seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) + ofs );
- }*/
-
- }
- }
-
- if(rightflag) {
- if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_final_left(seq, 0)) {
- seq_tx_set_final_right(seq, seq_tx_get_final_left(seq, 0)+1);
- }
-
- if (check_single_seq(seq)==0) {
- if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_start(seq)) {
- seq_tx_set_final_right(seq, seq_tx_get_start(seq)+1);
- }
- }
- }
-
- /* sounds cannot be extended past their endpoints */
- if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) {
- seq->startstill= 0;
- seq->endstill= 0;
- }
-}
-
-static int can_transform_seq_test_func(Sequence * seq)
-{
- if((seq->flag & SELECT) && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- return BUILD_SEQAR_COUNT_CURRENT | BUILD_SEQAR_COUNT_CHILDREN;
- }
- if ((seq->depth==0 && seq->flag & SEQ_LOCK) && !(seq->type & SEQ_EFFECT)) {
- if (seq->type != SEQ_META) {
- return BUILD_SEQAR_COUNT_NOTHING;
- } else {
- return BUILD_SEQAR_COUNT_CURRENT;
- }
- }
- return BUILD_SEQAR_COUNT_CURRENT | BUILD_SEQAR_COUNT_CHILDREN;
-}
-
-void transform_seq(int mode, int context)
-{
- SpaceSeq *sseq= curarea->spacedata.first;
- Sequence *seq, *last_seq;
- Editing *ed;
- float dx, dy, dvec[2], div;
- TransSeq *transmain, *ts;
- int totstrip=0, firsttime=1, afbreek=0, midtog= 0, proj= 0;
- int ix, iy; /* these values are used for storing the mouses offset from its original location */
- int ix_old = 0;
- unsigned short event = 0;
- short mval[2], val, xo, yo, xn, yn;
- char str[32];
- char side= 'L'; /* for extend mode only - use to know which side to extend on */
- char marker_moved=0; /* if we mvoed a marker, redraw all marker views */
- /* used for extend in a number of places */
- int cfra = CFRA;
-
- /* for snapping */
- char snapskip = 0, snap, snap_old= 0;
- int snapdist_max = seq_get_snaplimit();
- /* at the moment there are only 4 possible snap points,
- - last_seq (start,end)
- - selected bounds (start/end)
- - last_seq (next/prev)
- - current frame */
- int snap_points[4], snap_point_num = 0;
- int j; /* loop on snap_points */
-
- /* for markers */
- int *oldframe = NULL, totmark=0, a;
- TimeMarker *marker;
-
- /* looping on sequences, WHILE_SEQ macro allocates memory each time */
- int totseq_index, seq_index;
- Sequence **seqar = 0;
-
- if(mode!='g' && mode!='e') return; /* from gesture */
-
- /* which seqs are involved */
- ed= G.scene->ed;
- if(ed==0) return;
-
- /* Build the sequence array once, be sure to free it */
- build_seqar_cb( ed->seqbasep, &seqar, &totseq_index,
- can_transform_seq_test_func );
-
- if (seqar) {
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if((seq->flag & SELECT) && !(seq->depth==0 && seq->flag & SEQ_LOCK))
- totstrip++;
- /* only needed for extend but can set here anyway since were alredy looping */
- seq->tmp= NULL;
- }
- }
-
- /* for extending we need the metastrip clipped left/right values, set the metastrips as parents in seq->tmp */
- if (mode=='e') {
- Sequence *meta_seq;
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if (seq->type == SEQ_META) {
- for (meta_seq = seq->seqbase.first; meta_seq; meta_seq= meta_seq->next){
- meta_seq->tmp= (void *)seq;
- }
- }
- }
- }
-
-
- if (sseq->flag & SEQ_MARKER_TRANS) {
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) totmark++;
- }
- }
-
- if(totstrip==0 && totmark==0) {
- if(seqar) MEM_freeN(seqar);
- return;
- }
-
- G.moving= 1;
-
- last_seq = get_last_seq();
-
- ts=transmain= MEM_callocN(totstrip*sizeof(TransSeq), "transseq");
-
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if((seq->flag & SELECT) && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- ts->start= seq->start;
- ts->machine= seq->machine;
- ts->startstill= seq->startstill;
- ts->endstill= seq->endstill;
- ts->startofs= seq->startofs;
- ts->endofs= seq->endofs;
-
- /* for extend only */
- if (mode=='e') {
- ts->final_left = seq_tx_get_final_left(seq, 1);
- ts->final_right = seq_tx_get_final_right(seq, 1);
- }
- ts++;
- }
- }
-
- getmouseco_areawin(mval);
-
- /* choose the side based on which side of the playhead the mouse is on */
- if (mode=='e')
- side = mouse_cfra_side(cfra);
-
- /* Markers */
- if (sseq->flag & SEQ_MARKER_TRANS && totmark) {
- oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
- for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) {
- if (mode=='e') {
-
- /* when extending, invalidate markers on the other side by using an invalid frame value */
- if ((side == 'L' && marker->frame > cfra) || (side == 'R' && marker->frame < cfra)) {
- oldframe[a] = MAXFRAME+1;
- } else {
- oldframe[a]= marker->frame;
- }
- } else {
- oldframe[a]= marker->frame;
- }
- a++;
- }
- }
- }
-
- xo=xn= mval[0];
- yo=yn= mval[1];
- dvec[0]= dvec[1]= 0.0;
-
- while(afbreek==0) {
- getmouseco_areawin(mval);
- G.qual = get_qual();
- snap = (G.qual & LR_CTRLKEY) ? 1 : 0;
-
- if(mval[0]!=xo || mval[1]!=yo || firsttime || snap != snap_old) {
- if (firsttime) {
- snap_old = snap;
- firsttime= 0;
- }
-
- /* run for either grab or extend */
- dx= mval[0]- xo;
- dy= mval[1]- yo;
-
- div= G.v2d->mask.xmax-G.v2d->mask.xmin;
- dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/div;
-
- div= G.v2d->mask.ymax-G.v2d->mask.ymin;
- dy= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div;
-
- if(G.qual & LR_SHIFTKEY) {
- if(dx>1.0) dx= 1.0; else if(dx<-1.0) dx= -1.0;
- }
-
- dvec[0]+= dx;
- dvec[1]+= dy;
-
- if(midtog) dvec[proj]= 0.0;
- ix= floor(dvec[0]+0.5);
- iy= floor(dvec[1]+0.5);
-
- ts= transmain;
-
- /* SNAP! use the active Seq */
- snap = G.qual & LR_CTRLKEY ? 1 : 0;
-
- if (!snap) {
- snapskip = 0;
- } else {
- int dist;
- int snap_ofs= 0;
- int snap_dist= snapdist_max;
-
- /* Get sequence points to snap to the markers */
-
- snap_point_num=0;
- if (last_seq && (last_seq->flag & SELECT)) { /* active seq bounds */
- if(seq_tx_check_left(last_seq))
- snap_points[snap_point_num++] = seq_tx_get_final_left(last_seq, 0);
- if(seq_tx_check_right(last_seq))
- snap_points[snap_point_num++] = seq_tx_get_final_right(last_seq, 0);
-
- }
- if (totstrip > 1) { /* selection bounds */
- int bounds_left = MAXFRAME*2;
- int bounds_right = -(MAXFRAME*2);
-
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if(seq->flag & SELECT) {
- if(seq_tx_check_left(seq))
- bounds_left = MIN2(bounds_left, seq_tx_get_final_left(seq, 0));
- if(seq_tx_check_right(seq))
- bounds_right = MAX2(bounds_right,seq_tx_get_final_right(seq, 0));
- }
- }
-
- /* its possible there were no points to set on either side */
- if (bounds_left != MAXFRAME*2)
- snap_points[snap_point_num++] = bounds_left;
- if (bounds_right != -(MAXFRAME*2))
- snap_points[snap_point_num++] = bounds_right;
- }
-
-
- /* Define so we can snap to other points without hassle */
-
-#define TESTSNAP(test_frame)\
- for(j=0; j<snap_point_num; j++) {\
- /* see if this beats the current best snap point */\
- dist = abs(snap_points[j] - test_frame);\
- if (dist < snap_dist) {\
- snap_ofs = test_frame - snap_points[j];\
- snap_dist = dist;\
- }\
- }
-
-
- /* Detect the best marker to snap to! */
- for(a=0, marker= G.scene->markers.first; marker; a++, marker= marker->next) {
-
- /* dont snap to a marker on the wrong extend side */
- if (mode=='e' && ((side == 'L' && marker->frame > cfra) || (side == 'R' && marker->frame < cfra)))
- continue;
-
- /* when we are moving markers, dont snap to selected markers, durr */
- if ((sseq->flag & SEQ_MARKER_TRANS)==0 || (marker->flag & SELECT)==0) {
-
- /* loop over the sticky points - max 4 */
- TESTSNAP(marker->frame);
- if (snap_dist == 0) break; /* alredy snapped? - stop looking */
- }
- }
-
- if (snap_dist) {
- TESTSNAP(cfra);
- }
-
- /* check seq's next to the active also - nice for quick snapping */
- if (snap_dist && last_seq && seq_tx_check_left(last_seq)) {
- seq = find_next_prev_sequence(last_seq, 1, 0); /* left */
- if(seq && !seq_tx_check_right(seq))
- TESTSNAP(seq_tx_get_final_right(seq, 0));
- }
-
- if (snap_dist && last_seq && seq_tx_check_right(last_seq)) {
- seq = find_next_prev_sequence(last_seq, 2, 0); /* right */
- if(seq && !seq_tx_check_left(seq))
- TESTSNAP(seq_tx_get_final_left(seq, 0));
- }
-
-#undef TESTSNAP
-
- if (abs(ix_old-ix) >= snapdist_max) {
- /* mouse has moved out of snap range */
- snapskip = 0;
- } else if (snap_dist==0) {
- /* nowhere to move, dont do anything */
- snapskip = 1;
- } else if (snap_dist < snapdist_max) {
- /* do the snapping by adjusting the mouse offset value */
- ix = ix_old + snap_ofs;
- }
- }
-
- if (mode=='g' && !snapskip) {
- /* Grab */
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- int myofs;
- /* flag, ignores lefsel/rightsel for nested strips */
- int sel_flag = (seq->depth==0) ? seq->flag : seq->flag & ~(SEQ_LEFTSEL+SEQ_RIGHTSEL);
-
- // SEQ_DEBUG_INFO(seq);
-
- /* X Transformation */
- if((seq->depth==0) && (sel_flag & SEQ_LEFTSEL)) {
- myofs = (ts->startofs - ts->startstill);
- seq_tx_set_final_left(seq, ts->start + (myofs + ix));
- }
- if((seq->depth==0) && (sel_flag & SEQ_RIGHTSEL)) {
- myofs = (ts->endstill - ts->endofs);
- seq_tx_set_final_right(seq, ts->start + seq->len + (myofs + ix));
- }
- transform_grab_xlimits(seq, sel_flag & SEQ_LEFTSEL, sel_flag & SEQ_RIGHTSEL);
-
- if( (sel_flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0 ) {
- if(sequence_is_free_transformable(seq)) seq->start= ts->start+ ix;
-
- /* Y Transformation */
- if(seq->depth==0) seq->machine= ts->machine+ iy;
-
- if(seq->machine<1) seq->machine= 1;
- else if(seq->machine>= MAXSEQ) seq->machine= MAXSEQ;
- }
- calc_sequence(seq);
- ts++;
- }
- }
-
- /* Markers */
- if (sseq->flag & SEQ_MARKER_TRANS) {
- for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) {
- marker->frame= oldframe[a] + ix;
- marker_moved=1;
- a++;
- }
- }
- }
-
- /* Extend, grabs one side of the current frame */
- } else if (mode=='e' && !snapskip) {
- int myofs; /* offset from start of the seq clip */
- int xnew, final_left, final_right; /* just to store results from seq_tx_get_final_left/right */
-
- /* we dont use seq side selection flags for this,
- instead we need to calculate which sides to move
- based on its initial position from the cursor */
- int move_left, move_right;
-
- /* Extend, Similar to grab but operate on one side of the cursor */
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- /* only move the contents of the metastrip otherwise the transformation is applied twice */
- if (sequence_is_free_transformable(seq) && seq->type != SEQ_META) {
-
- move_left = move_right = 0;
-
- //SEQ_DEBUG_INFO(seq);
-
- final_left = seq_tx_get_final_left(seq, 1);
- final_right = seq_tx_get_final_right(seq, 1);
-
- /* Only X Axis moving */
-
- /* work out which sides to move first */
- if (side=='L') {
- if (final_left <= cfra || ts->final_left <= cfra) move_left = 1;
- if (final_right <= cfra || ts->final_right <= cfra) move_right = 1;
- } else {
- if (final_left >= cfra || ts->final_left >= cfra) move_left = 1;
- if (final_right >= cfra || ts->final_right >= cfra) move_right = 1;
- }
-
- if (move_left && move_right) {
- /* simple move - dont need to do anything complicated */
- seq->start= ts->start+ ix;
- } else {
- if (side=='L') {
- if (move_left) {
-
- /* Similar to other funcs */
- myofs = (ts->startofs - ts->startstill);
- xnew = ts->start + (ix + myofs);
-
- /* make sure the we dont resize down to 0 or less in size
- also include the startstill so the contense dosnt go outside the bounds,
- if the seq->startofs is 0 then its ignored */
-
- /* TODO remove, add check to transform_grab_xlimits, works ok for now */
- if (xnew + seq->startstill > final_right-1) {
- xnew = (final_right-1) - seq->startstill;
- }
- /* Note, this is the only case where the start needs to be adjusted
- since its not needed when modifying the end or when moving the entire sequence */
- //seq->start = ts->start+ix; // This works when xnew is not clamped, line below takes clamping into account
- seq->start= xnew - myofs; /* TODO see above */
- /* done with unique stuff */
-
- seq_tx_set_final_left(seq, xnew);
- transform_grab_xlimits(seq, 1, 0);
-
- /* Special case again - setting the end back to what it was */
- seq_tx_set_final_right(seq, final_right);
- }
- if (move_right) {
- myofs = (ts->endstill - ts->endofs);
- xnew = ts->start + seq->len + (myofs + ix);
- seq_tx_set_final_right(seq, xnew);
- transform_grab_xlimits(seq, 0, 1);
- }
- } else { /* R */
- if (move_left) {
- myofs = (ts->startofs - ts->startstill);
- xnew = ts->start + (myofs + ix);
- seq_tx_set_final_left(seq, xnew);
- transform_grab_xlimits(seq, 1, 0);
- }
- if (move_right) {
- myofs = (ts->endstill - ts->endofs);
- xnew = ts->start + seq->len + (myofs + ix);
- seq_tx_set_final_right(seq, xnew);
- transform_grab_xlimits(seq, 0, 1);
- }
- }
- }
- }
- calc_sequence(seq);
- ts++;
- }
- }
-
- /* markers */
- if (sseq->flag & SEQ_MARKER_TRANS) {
- for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {\
- if (marker->flag & SELECT) {
- if(oldframe[a] != MAXFRAME+1) {
- marker->frame= oldframe[a] + ix;
- marker_moved=1;
- }
- a++;
- }
- }
- }
- }
-
- sprintf(str, "X: %d Y: %d ", ix, iy);
- headerprint(str);
-
- /* remember the last value for snapping,
- only set if we are not currently snapped,
- prevents locking on a keyframe */
- if (!snapskip)
- ix_old = ix;
-
- /* just to tell if ctrl was pressed, this means we get a recalc when pressing ctrl */
- snap_old = snap;
-
- /* rememver last mouse values so we can skip transform when nothing happens */
- xo= mval[0];
- yo= mval[1];
-
- /* test for effect and overlap */
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if((seq->depth==0) && (seq->flag & SELECT) && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- seq->flag &= ~SEQ_OVERLAP;
- if( test_overlap_seq(seq) ) {
- seq->flag |= SEQ_OVERLAP;
- }
- }
- else if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq);
- else if(seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq);
- else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq);
- }
- }
- /* warning, drawing should NEVER use WHILE_SEQ,
- if it does the seq->depth value will be messed up and
- overlap checks with metastrips will give incorrect results */
- force_draw_plus(SPACE_BUTS, 0);
-
- }
- else BIF_wait_for_statechange();
-
- while(qtest()) {
- event= extern_qread(&val);
- if(val) {
- switch(event) {
- case ESCKEY:
- case LEFTMOUSE:
- case RIGHTMOUSE:
- case SPACEKEY:
- case RETKEY:
- afbreek= 1;
- break;
- case XKEY:
- if(!(midtog && (proj == 0))) {
- midtog= ~midtog;
- }
- if(midtog) {
- proj= 1;
- firsttime= 1;
- }
- break;
- case YKEY:
- if(!(midtog && (proj == 1))) {
- midtog= ~midtog;
- }
- if(midtog) {
- proj= 0;
- firsttime= 1;
- }
- break;
- case MIDDLEMOUSE:
- midtog= ~midtog;
- if(midtog) {
- if( abs(mval[0]-xn) > abs(mval[1]-yn)) proj= 1;
- else proj= 0;
- firsttime= 1;
- }
- break;
- default:
- arrows_move_cursor(event);
- }
- }
- if(afbreek) break;
- }
- }
-
- if((event==ESCKEY) || (event==RIGHTMOUSE)) {
-
- ts= transmain;
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
- if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- seq->start= ts->start;
- seq->machine= ts->machine;
- seq->startstill= ts->startstill;
- seq->endstill= ts->endstill;
- seq->startofs= ts->startofs;
- seq->endofs= ts->endofs;
-
- calc_sequence(seq);
- seq->flag &= ~SEQ_OVERLAP;
-
- ts++;
- } else if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq);
- else if(seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq);
- else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq);
- }
- }
-
- /* Markers */
- if (sseq->flag & SEQ_MARKER_TRANS) {
- for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
- if (marker->flag & SELECT) {
- if(oldframe[a] != MAXFRAME+1) {
- marker->frame= oldframe[a];
- }
- a++;
- }
- }
- marker_moved = 0;
- }
- } else {
-
- /* images, effects and overlap */
- for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) {
-
- /* fixes single image strips - makes sure their start is not out of bounds
- ideally this would be done during transform since data is rendered at that time
- however it ends up being a lot messier! - Campbell */
- fix_single_image_seq(seq);
-
- if(seq->type == SEQ_META) {
- calc_sequence(seq);
- seq->flag &= ~SEQ_OVERLAP;
- if( test_overlap_seq(seq) ) shuffle_seq(seq);
- }
- else if(seq->flag & SELECT) {
- calc_sequence(seq);
- seq->flag &= ~SEQ_OVERLAP;
- if( test_overlap_seq(seq) ) shuffle_seq(seq);
- }
- else if(seq->type & SEQ_EFFECT) calc_sequence(seq);
- }
-
- /* as last: */
- sort_seq();
- }
-
- /* free sequence array */
- if(seqar) MEM_freeN(seqar);
-
- G.moving= 0;
- MEM_freeN(transmain);
-
- if (sseq->flag & SEQ_MARKER_TRANS && totmark)
- MEM_freeN(oldframe);
-
- if (mode=='g')
- BIF_undo_push("Transform Grab, Sequencer");
- else if (mode=='e')
- BIF_undo_push("Transform Extend, Sequencer");
-
- if (marker_moved)
- allqueue(REDRAWMARKER, 0);
- else
- allqueue(REDRAWSEQ, 0);
-}
-
-/* since grab can move markers, we must turn this off before adding a new sequence
- I am not so happy with this, but the baddness in contained here - Campbell */
-void transform_seq_nomarker(int mode, int context) {
- SpaceSeq *sseq= curarea->spacedata.first;
- int flag_back;
- if (!sseq) return; /* should never happen */
- flag_back = sseq->flag;
- sseq->flag &= ~SEQ_MARKER_TRANS;
-
- transform_seq(mode, context);
-
- sseq->flag = flag_back;
-}
-
-void seq_separate_images(void)
-{
- Editing *ed;
- Sequence *seq, *seq_new, *seq_next;
- Strip *strip_new;
- StripElem *se, *se_new;
- int start_ofs, cfra, frame_end;
- static int step= 1;
-
- add_numbut(0, NUM|INT, "Image Duration:", 1, 256, &step, NULL);
- if (!do_clever_numbuts("Separate Images", 1, REDRAW))
- return;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- seq= ed->seqbasep->first;
-
- while (seq) {
- if((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) {
- /* remove seq so overlap tests dont conflict,
- see free_sequence below for the real free'ing */
- seq_next = seq->next;
- BLI_remlink(ed->seqbasep, seq);
- if(seq->ipo) seq->ipo->id.us--;
-
- start_ofs = cfra = seq_tx_get_final_left(seq, 0);
- frame_end = seq_tx_get_final_right(seq, 0);
-
- while (cfra < frame_end) {
- /* new seq */
- se = give_stripelem(seq, cfra);
-
- seq_new= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, start_ofs, seq->machine);
- seq_new->type= SEQ_IMAGE;
- seq_new->len = 1;
- seq_new->endstill = step-1;
-
- /* new strip */
- seq_new->strip= strip_new= MEM_callocN(sizeof(Strip)*1, "strip");
- strip_new->len= 1;
- strip_new->us= 1;
- strncpy(strip_new->dir, seq->strip->dir, FILE_MAXDIR-1);
-
- /* new stripdata */
- strip_new->stripdata= se_new= MEM_callocN(sizeof(StripElem)*1, "stripelem");
- strncpy(se_new->name, se->name, FILE_MAXFILE-1);
- calc_sequence(seq_new);
- seq_new->flag &= ~SEQ_OVERLAP;
- if (test_overlap_seq(seq_new)) {
- shuffle_seq(seq_new);
- }
-
- cfra++;
- start_ofs += step;
- }
-
- free_sequence(seq);
- seq = seq->next;
- } else {
- seq = seq->next;
- }
- }
-
- /* as last: */
- sort_seq();
- BIF_undo_push("Separate Image Strips, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-/* run recursivly to select linked */
-static int select_more_less_seq__internal(int sel, int linked) {
- Editing *ed;
- Sequence *seq, *neighbor;
- int change=0;
- int isel;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- if (sel) {
- sel = SELECT;
- isel = 0;
- } else {
- sel = 0;
- isel = SELECT;
- }
-
- if (!linked) {
- /* if not linked we only want to touch each seq once, newseq */
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- seq->tmp = NULL;
- }
- }
-
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if((int)(seq->flag & SELECT) == sel) {
- if ((linked==0 && seq->tmp)==0) {
- /* only get unselected nabours */
- neighbor = find_neighboring_sequence(seq, 1, isel);
- if (neighbor) {
- if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
- else neighbor->flag &= ~SELECT;
- if (linked==0) neighbor->tmp = (Sequence *)1;
- change = 1;
- }
- neighbor = find_neighboring_sequence(seq, 2, isel);
- if (neighbor) {
- if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);}
- else neighbor->flag &= ~SELECT;
- if (linked==0) neighbor->tmp = (void *)1;
- change = 1;
- }
- }
- }
- }
-
- return change;
-}
-
-void select_less_seq(void)
-{
- if (select_more_less_seq__internal(0, 0)) {
- BIF_undo_push("Select Less, Sequencer");
- allqueue(REDRAWSEQ, 0);
- }
-}
-
-void select_more_seq(void)
-{
- if (select_more_less_seq__internal(1, 0)) {
- BIF_undo_push("Select More, Sequencer");
- allqueue(REDRAWSEQ, 0);
- }
-}
-
-/* TODO not all modes supported - if you feel like being picky, add them! ;) */
-void select_linked_seq(int mode) {
- Editing *ed;
- Sequence *seq, *mouse_seq;
- int selected, hand;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- /* replace current selection */
- if (mode==0 || mode==2) {
- /* this works like UV, not mesh */
- if (mode==0) {
- mouse_seq= find_nearest_seq(&hand);
- if (!mouse_seq)
- return; /* user error as with mesh?? */
-
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- seq->flag &= ~SELECT;
- }
- mouse_seq->flag |= SELECT;
- recurs_sel_seq(mouse_seq);
- }
-
- selected = 1;
- while (selected) {
- selected = select_more_less_seq__internal(1, 1);
- }
- BIF_undo_push("Select Linked, Sequencer");
- allqueue(REDRAWSEQ, 0);
- }
- /* TODO - more modes... */
-}
-
-void seq_snap_menu(void)
-{
- short event;
-
- event= pupmenu("Snap %t|To Current Frame%x1");
- if(event < 1) return;
-
- seq_snap(event);
-}
-
-void seq_snap(short event)
-{
- Editing *ed;
- Sequence *seq;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- /* problem: contents of meta's are all shifted to the same position... */
-
- /* also check metas */
- WHILE_SEQ(ed->seqbasep) {
- if (seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK) &&
- sequence_is_free_transformable(seq)) {
- if((seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0) {
- seq->start= CFRA-seq->startofs+seq->startstill;
- } else {
- if(seq->flag & SEQ_LEFTSEL) {
- seq_tx_set_final_left(seq, CFRA);
- } else { /* SEQ_RIGHTSEL */
- seq_tx_set_final_right(seq, CFRA);
- }
- transform_grab_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL);
- }
- calc_sequence(seq);
- }
- }
- END_SEQ
-
- /* test for effects and overlap */
- WHILE_SEQ(ed->seqbasep) {
- if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) {
- seq->flag &= ~SEQ_OVERLAP;
- if( test_overlap_seq(seq) ) {
- shuffle_seq(seq);
- }
- }
- else if(seq->type & SEQ_EFFECT) {
- if(seq->seq1 && (seq->seq1->flag & SELECT))
- calc_sequence(seq);
- else if(seq->seq2 && (seq->seq2->flag & SELECT))
- calc_sequence(seq);
- else if(seq->seq3 && (seq->seq3->flag & SELECT))
- calc_sequence(seq);
- }
- }
- END_SEQ;
-
- /* as last: */
- sort_seq();
-
- BIF_undo_push("Snap Strips, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-void seq_mute_sel(int mute) {
- Editing *ed;
- Sequence *seq;
-
- ed= G.scene->ed;
- if(!ed) return;
-
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if ((seq->flag & SEQ_LOCK)==0) {
- if (mute==-1) { /* hide unselected */
- if ((seq->flag & SELECT)==0) {
- seq->flag |= SEQ_MUTE;
- }
- } else if (seq->flag & SELECT) {
- if (mute) seq->flag |= SEQ_MUTE;
- else seq->flag &= ~SEQ_MUTE;
- }
- }
- }
- BIF_undo_push(mute?"Mute Strips, Sequencer":"UnMute Strips, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-void seq_lock_sel(int lock) {
- Editing *ed;
- Sequence *seq;
-
- ed= G.scene->ed;
- if(!ed) return;
-
- for(seq= ed->seqbasep->first; seq; seq= seq->next) {
- if ((seq->flag & SELECT)) {
- if (lock) seq->flag |= SEQ_LOCK;
- else seq->flag &= ~SEQ_LOCK;
- }
- }
- BIF_undo_push(lock?"Lock Strips, Sequencer":"Unlock Strips, Sequencer");
- allqueue(REDRAWSEQ, 0);
-}
-
-void borderselect_seq(void)
-{
- Sequence *seq;
- Editing *ed;
- rcti rect;
- rctf rectf, rq;
- int val;
- short mval[2];
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- val= get_border(&rect, 3);
-
- if(val) {
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- seq= ed->seqbasep->first;
- while(seq) {
-
- if(seq->startstill) rq.xmin= seq->start;
- else rq.xmin= seq->startdisp;
- rq.ymin= seq->machine+0.2;
- if(seq->endstill) rq.xmax= seq->start+seq->len;
- else rq.xmax= seq->enddisp;
- rq.ymax= seq->machine+0.8;
-
- if(BLI_isect_rctf(&rq, &rectf, 0)) {
- if(val==LEFTMOUSE) {
- seq->flag |= SELECT;
- }
- else {
- seq->flag &= ~SELECT;
- }
- recurs_sel_seq(seq);
- }
-
- seq= seq->next;
- }
-
- BIF_undo_push("Border Select, Sequencer");
- addqueue(curarea->win, REDRAW, 1);
- }
-}
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c
deleted file mode 100644
index 7fc76dd5202..00000000000
--- a/source/blender/src/editsima.c
+++ /dev/null
@@ -1,2863 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h" // only for uvedit_selectionCB() (struct Object)
-#include "DNA_packedFile_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_colortools.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_image.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_object.h"
-#include "BKE_packedFile.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_drawimage.h"
-#include "BIF_editview.h"
-#include "BIF_editsima.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-#include "BIF_writeimage.h"
-#include "BIF_editmesh.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BSE_node.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_editobject.h"
-#include "BDR_unwrapper.h"
-
-#include "BMF_Api.h"
-
-#include "RE_pipeline.h"
-
-#include "blendef.h"
-#include "multires.h"
-#include "mydevice.h"
-#include "editmesh.h"
-
-/* local prototypes */
-static void sel_uvco_inside_radius(short , EditFace *efa, MTFace *, int , float *, float *, short);
-void uvedit_selectionCB(short , Object *, short *, float ); /* used in edit.c*/
-
-void object_uvs_changed(Object *ob)
-{
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void object_tface_flags_changed(Object *ob, int updateButtons)
-{
- if (updateButtons) allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-int is_uv_tface_editing_allowed_silent(void)
-{
- if(!EM_texFaceCheck()) return 0;
- if(G.sima->mode!=SI_TEXTURE) return 0;
- if(multires_level1_test()) return 0;
- return 1;
-}
-
-int is_uv_tface_editing_allowed(void)
-{
- if(!G.obedit) error("Enter Edit Mode to perform this action");
-
- return is_uv_tface_editing_allowed_silent();
-}
-
-void get_connected_limit_tface_uv(float *limit)
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- if(ibuf && ibuf->x > 0 && ibuf->y > 0) {
- limit[0]= 0.05/(float)ibuf->x;
- limit[1]= 0.05/(float)ibuf->y;
- }
- else
- limit[0]= limit[1]= 0.05/256.0;
-}
-
-void be_square_tface_uv(EditMesh *em)
-{
- EditFace *efa;
- MTFace *tface;
- /* if 1 vertex selected: doit (with the selected vertex) */
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->v4) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0)) {
- if( tface->uv[1][0] == tface->uv[2][0] ) {
- tface->uv[1][1]= tface->uv[0][1];
- tface->uv[3][0]= tface->uv[0][0];
- }
- else {
- tface->uv[1][0]= tface->uv[0][0];
- tface->uv[3][1]= tface->uv[0][1];
- }
-
- }
- if (simaUVSel_Check(efa, tface, 1)) {
- if( tface->uv[2][1] == tface->uv[3][1] ) {
- tface->uv[2][0]= tface->uv[1][0];
- tface->uv[0][1]= tface->uv[1][1];
- }
- else {
- tface->uv[2][1]= tface->uv[1][1];
- tface->uv[0][0]= tface->uv[1][0];
- }
-
- }
- if (simaUVSel_Check(efa, tface, 2)) {
- if( tface->uv[3][0] == tface->uv[0][0] ) {
- tface->uv[3][1]= tface->uv[2][1];
- tface->uv[1][0]= tface->uv[2][0];
- }
- else {
- tface->uv[3][0]= tface->uv[2][0];
- tface->uv[1][1]= tface->uv[2][1];
- }
- }
- if (simaUVSel_Check(efa, tface, 3)) {
- if( tface->uv[0][1] == tface->uv[1][1] ) {
- tface->uv[0][0]= tface->uv[3][0];
- tface->uv[2][1]= tface->uv[3][1];
- }
- else {
- tface->uv[0][1]= tface->uv[3][1];
- tface->uv[2][0]= tface->uv[3][0];
- }
-
- }
- }
- }
- }
-}
-
-void transform_aspect_ratio_tface_uv(float *aspx, float *aspy)
-{
- int w, h;
- float xuser_asp, yuser_asp;
-
- if(G.sima && G.sima->image) {
- image_pixel_aspect(G.sima->image, &xuser_asp, &yuser_asp);
-
- transform_width_height_tface_uv(&w, &h);
- *aspx= (float)w/256.0f * xuser_asp;
- *aspy= (float)h/256.0f * yuser_asp;
- }
- else {
- *aspx= 1.0f;
- *aspy= 1.0f;
- }
-}
-
-void transform_width_height_tface_uv(int *width, int *height)
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
-
- if(ibuf) {
- *width= ibuf->x;
- *height= ibuf->y;
- }
- else {
- *width= 256;
- *height= 256;
- }
-}
-
-void mirrormenu_tface_uv(void)
-{
- float mat[3][3];
- short mode= 0;
-
- Mat3One(mat);
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- mode= pupmenu("Mirror%t|X Axis%x1|Y Axis%x2|");
-
- if(mode==-1) return;
-
- if (mode == 1) {
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[0], " on X axis");
- Transform();
- }
- else {
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[1], " on Y axis");
- Transform();
- }
-
- BIF_undo_push("Mirror UV");
-}
-
-void weld_align_tface_uv(char tool)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- float cent[2], min[2], max[2];
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- INIT_MINMAX2(min, max);
-
- if(tool == 'a') {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0))
- DO_MINMAX2(tface->uv[0], min, max)
- if (simaUVSel_Check(efa, tface, 1))
- DO_MINMAX2(tface->uv[1], min, max)
- if (simaUVSel_Check(efa, tface, 2))
- DO_MINMAX2(tface->uv[2], min, max)
- if (efa->v4 && simaUVSel_Check(efa, tface, 3))
- DO_MINMAX2(tface->uv[3], min, max)
- }
- }
-
- tool= (max[0]-min[0] >= max[1]-min[1])? 'y': 'x';
- }
-
- cent_tface_uv(cent, 0);
-
- if(tool == 'x' || tool == 'w') {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0))
- tface->uv[0][0]= cent[0];
- if (simaUVSel_Check(efa, tface, 1))
- tface->uv[1][0]= cent[0];
- if (simaUVSel_Check(efa, tface, 2))
- tface->uv[2][0]= cent[0];
- if (efa->v4 && simaUVSel_Check(efa, tface, 3))
- tface->uv[3][0]= cent[0];
- }
- }
- }
-
- if(tool == 'y' || tool == 'w') {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0))
- tface->uv[0][1]= cent[1];
- if (simaUVSel_Check(efa, tface, 1))
- tface->uv[1][1]= cent[1];
- if (simaUVSel_Check(efa, tface, 2))
- tface->uv[2][1]= cent[1];
- if (efa->v4 && simaUVSel_Check(efa, tface, 3))
- tface->uv[3][1]= cent[1];
- }
- }
- }
-
- object_uvs_changed(OBACT);
-}
-
-// just for averaging UV's
-typedef struct UVVertAverage {
- float uv[2];
- int count;
-} UVVertAverage;
-
-void stitch_vert_uv_tface(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditVert *eve;
- MTFace *tface;
- int count;
- UVVertAverage *uv_average, *uvav;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- // index and count verts
- for (count=0, eve=em->verts.first; eve; count++, eve= eve->next) {
- eve->tmp.l = count;
- }
-
- uv_average = MEM_callocN(sizeof(UVVertAverage) * count, "Stitch");
-
- // gather uv averages per vert
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0)) {
- uvav = uv_average + efa->v1->tmp.l;
- uvav->count++;
- uvav->uv[0] += tface->uv[0][0];
- uvav->uv[1] += tface->uv[0][1];
- }
- if (simaUVSel_Check(efa, tface, 1)) {
- uvav = uv_average + efa->v2->tmp.l;
- uvav->count++;
- uvav->uv[0] += tface->uv[1][0];
- uvav->uv[1] += tface->uv[1][1];
- }
- if (simaUVSel_Check(efa, tface, 2)) {
- uvav = uv_average + efa->v3->tmp.l;
- uvav->count++;
- uvav->uv[0] += tface->uv[2][0];
- uvav->uv[1] += tface->uv[2][1];
- }
- if (efa->v4 && simaUVSel_Check(efa, tface, 3)) {
- uvav = uv_average + efa->v4->tmp.l;
- uvav->count++;
- uvav->uv[0] += tface->uv[3][0];
- uvav->uv[1] += tface->uv[3][1];
- }
- }
- }
-
- // apply uv welding
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0)) {
- uvav = uv_average + efa->v1->tmp.l;
- tface->uv[0][0] = uvav->uv[0]/uvav->count;
- tface->uv[0][1] = uvav->uv[1]/uvav->count;
- }
- if (simaUVSel_Check(efa, tface, 1)) {
- uvav = uv_average + efa->v2->tmp.l;
- tface->uv[1][0] = uvav->uv[0]/uvav->count;
- tface->uv[1][1] = uvav->uv[1]/uvav->count;
- }
- if (simaUVSel_Check(efa, tface, 2)) {
- uvav = uv_average + efa->v3->tmp.l;
- tface->uv[2][0] = uvav->uv[0]/uvav->count;
- tface->uv[2][1] = uvav->uv[1]/uvav->count;
- }
- if (efa->v4 && simaUVSel_Check(efa, tface, 3)) {
- uvav = uv_average + efa->v4->tmp.l;
- tface->uv[3][0] = uvav->uv[0]/uvav->count;
- tface->uv[3][1] = uvav->uv[1]/uvav->count;
- }
- }
- }
- MEM_freeN(uv_average);
- object_uvs_changed(OBACT);
-}
-
-void weld_align_menu_tface_uv(void)
-{
- short mode= 0;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- mode= pupmenu("Weld/Align%t|Weld%x1|Align Auto%x2|Align X%x3|Align Y%x4");
-
- if(mode==-1) return;
- if(mode==1) weld_align_tface_uv('w');
- else if(mode==2) weld_align_tface_uv('a');
- else if(mode==3) weld_align_tface_uv('x');
- else if(mode==4) weld_align_tface_uv('y');
-
- if(mode==1) BIF_undo_push("Weld UV");
- else if(ELEM3(mode, 2, 3, 4)) BIF_undo_push("Align UV");
-}
-
-void select_invert_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- if (G.sima->flag & SI_SYNC_UVSEL) {
- /* Warning, this is not that good (calling editmode stuff from UV),
- TODO look into changing it */
- selectswap_mesh();
- return;
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- tface->flag ^= TF_SEL1;
- tface->flag ^= TF_SEL2;
- tface->flag ^= TF_SEL3;
- if(efa->v4) tface->flag ^= TF_SEL4;
- }
- }
- }
- BIF_undo_push("Select Inverse UV");
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-void select_swap_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- int sel=0;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- if (G.sima->flag & SI_SYNC_UVSEL) {
- deselectall_mesh();
- return;
- } else {
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if(tface->flag & (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4)) {
- sel= 1;
- break;
- }
- }
- }
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if(efa->v4) {
- if(sel) tface->flag &= ~(TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4);
- else tface->flag |= (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4);
- }
- else {
- if(sel) tface->flag &= ~(TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4);
- else tface->flag |= (TF_SEL1+TF_SEL2+TF_SEL3);
- }
- }
- }
- }
- BIF_undo_push("Select swap");
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-static int msel_hit(float *limit, unsigned int *hitarray, unsigned int vertexid, float **uv, float *uv2, int sticky)
-{
- int i;
- for(i=0; i< 4; i++) {
- if(hitarray[i] == vertexid) {
- if(sticky == 2) {
- if(fabs(uv[i][0]-uv2[0]) < limit[0] &&
- fabs(uv[i][1]-uv2[1]) < limit[1])
- return 1;
- }
- else return 1;
- }
- }
- return 0;
-}
-
-static void find_nearest_uv_edge(MTFace **nearesttf, EditFace **nearestefa, int *nearestedge)
-{
- EditMesh *em= G.editMesh;
- MTFace *tf;
- EditFace *efa;
- float mvalf[2], v1[2], v2[2];
- int i, nverts, mindist, dist, uval1[2], uval2[2];
- short mval[2];
-
- getmouseco_areawin(mval);
- mvalf[0]= mval[0];
- mvalf[1]= mval[1];
-
- mindist= 0x7FFFFFF;
- *nearesttf= NULL;
- *nearestefa= NULL;
- *nearestedge= 0;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if(simaFaceDraw_Check(efa, tf)) {
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- uvco_to_areaco_noclip(tf->uv[i], uval1);
- uvco_to_areaco_noclip(tf->uv[(i+1)%nverts], uval2);
-
- v1[0]= uval1[0];
- v1[1]= uval1[1];
- v2[0]= uval2[0];
- v2[1]= uval2[1];
-
- dist= PdistVL2Dfl(mvalf, v1, v2);
- if (dist < mindist) {
- *nearesttf= tf;
- *nearestefa= efa;
- *nearestedge= i;
- mindist= dist;
- }
- }
- }
- }
-}
-
-static void find_nearest_tface(MTFace **nearesttf, EditFace **nearestefa)
-{
- EditMesh *em= G.editMesh;
- MTFace *tf;
- EditFace *efa;
- int i, nverts, mindist, dist, fcenter[2], uval[2];
- short mval[2];
-
- getmouseco_areawin(mval);
-
- mindist= 0x7FFFFFF;
- *nearesttf= NULL;
- *nearestefa= NULL;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- fcenter[0]= fcenter[1]= 0;
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- uvco_to_areaco_noclip(tf->uv[i], uval);
- fcenter[0] += uval[0];
- fcenter[1] += uval[1];
- }
-
- fcenter[0] /= nverts;
- fcenter[1] /= nverts;
-
- dist= abs(mval[0]- fcenter[0])+ abs(mval[1]- fcenter[1]);
- if (dist < mindist) {
- *nearesttf= tf;
- *nearestefa= efa;
- mindist= dist;
- }
- }
- }
-}
-
-static int nearest_uv_between(MTFace *tf, int nverts, int id, short *mval, int *uval)
-{
- float m[3], v1[3], v2[3], c1, c2;
- int id1, id2;
-
- id1= (id+nverts-1)%nverts;
- id2= (id+nverts+1)%nverts;
-
- m[0] = (float)(mval[0]-uval[0]);
- m[1] = (float)(mval[1]-uval[1]);
- Vec2Subf(v1, tf->uv[id1], tf->uv[id]);
- Vec2Subf(v2, tf->uv[id2], tf->uv[id]);
-
- /* m and v2 on same side of v-v1? */
- c1= v1[0]*m[1] - v1[1]*m[0];
- c2= v1[0]*v2[1] - v1[1]*v2[0];
-
- if (c1*c2 < 0.0f)
- return 0;
-
- /* m and v1 on same side of v-v2? */
- c1= v2[0]*m[1] - v2[1]*m[0];
- c2= v2[0]*v1[1] - v2[1]*v1[0];
-
- return (c1*c2 >= 0.0f);
-}
-
-void find_nearest_uv(MTFace **nearesttf, EditFace **nearestefa, unsigned int *nearestv, int *nearestuv)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- MTFace *tf;
- int i, nverts, mindist, dist, uval[2];
- short mval[2];
-
- getmouseco_areawin(mval);
-
- mindist= 0x7FFFFFF;
- if (nearesttf) *nearesttf= NULL;
- if (nearestefa) *nearestefa= NULL;
-
- if (nearestv) {
- EditVert *ev;
- for (i=0, ev=em->verts.first; ev; ev = ev->next, i++)
- ev->tmp.l = i;
- }
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- uvco_to_areaco_noclip(tf->uv[i], uval);
- dist= abs(mval[0]-uval[0]) + abs(mval[1]-uval[1]);
-
- if (simaUVSel_Check(efa, tf, i))
- dist += 5;
-
- if(dist<=mindist) {
- if(dist==mindist)
- if (!nearest_uv_between(tf, nverts, i, mval, uval))
- continue;
-
- mindist= dist;
- *nearestuv= i;
-
- if (nearesttf) *nearesttf= tf;
- if (nearestefa) *nearestefa= efa;
- if (nearestv) {
- if (i==0) *nearestv= efa->v1->tmp.l;
- else if (i==1) *nearestv= efa->v2->tmp.l;
- else if (i==2) *nearestv= efa->v3->tmp.l;
- else *nearestv= efa->v4->tmp.l;
- }
- }
- }
- }
- }
-}
-
-void mouse_select_sima(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tf, *nearesttf;
- EditFace *nearestefa=NULL;
- int a, selectsticky, edgeloop, actface, nearestuv, nearestedge, i, shift, island=0;
- char sticky= 0;
- int flush = 0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
- unsigned int hitv[4], nearestv;
- float *hituv[4], limit[2];
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- get_connected_limit_tface_uv(limit);
-
- edgeloop= G.qual & LR_ALTKEY;
- shift= G.qual & LR_SHIFTKEY;
-
- if (G.sima->flag & SI_SYNC_UVSEL) {
- /* copy from mesh */
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- actface= 1;
- sticky= 0;
- } else {
- actface= G.scene->selectmode & SCE_SELECT_FACE;
- sticky= 2;
- }
- } else {
- /* normal operation */
- actface= G.sima->selectmode == SI_SELECT_FACE;
- island= G.sima->selectmode == SI_SELECT_ISLAND;
-
- switch(G.sima->sticky) {
- case SI_STICKY_LOC:
- sticky=2;
- break;
- case SI_STICKY_DISABLE:
- sticky=0;
- break;
- case SI_STICKY_VERTEX:
- if(G.qual & LR_CTRLKEY) {
- sticky=0;
- } else {
- sticky=1;
- }
- break;
- }
- }
-
- if(edgeloop) {
- find_nearest_uv_edge(&nearesttf, &nearestefa, &nearestedge);
- if(nearesttf==NULL)
- return;
-
- select_edgeloop_tface_uv(nearestefa, nearestedge, shift, &flush);
- }
- else if(actface) {
- find_nearest_tface(&nearesttf, &nearestefa);
- if(nearesttf==NULL)
- return;
-
- EM_set_actFace(nearestefa);
-
- for (i=0; i<4; i++)
- hituv[i]= nearesttf->uv[i];
-
- hitv[0]= nearestefa->v1->tmp.l;
- hitv[1]= nearestefa->v2->tmp.l;
- hitv[2]= nearestefa->v3->tmp.l;
-
- if (nearestefa->v4) hitv[3]= nearestefa->v4->tmp.l;
- else hitv[3]= 0xFFFFFFFF;
- }
- else if (island) {
-
- }
- else {
- find_nearest_uv(&nearesttf, &nearestefa, &nearestv, &nearestuv);
- if(nearesttf==NULL)
- return;
-
- if(sticky) {
- for(i=0; i<4; i++)
- hitv[i]= 0xFFFFFFFF;
- hitv[nearestuv]= nearestv;
- hituv[nearestuv]= nearesttf->uv[nearestuv];
- }
- }
-
- if (island) {
- if(shift) select_linked_tface_uv(1);
- else select_linked_tface_uv(0);
- }
- else if(!edgeloop && shift) {
- /* (de)select face */
- if(actface) {
- if(simaFaceSel_Check(nearestefa, nearesttf)) {
- simaFaceSel_UnSet(nearestefa, nearesttf);
- selectsticky= 0;
- }
- else {
- simaFaceSel_Set(nearestefa, nearesttf);
- selectsticky= 1;
- }
- flush = -1;
- }
- /* (de)select uv node */
- else {
- if (simaUVSel_Check(nearestefa, nearesttf, nearestuv)) {
- simaUVSel_UnSet(nearestefa, nearesttf, nearestuv);
- selectsticky= 0;
- }
- else {
- simaUVSel_Set(nearestefa, nearesttf, nearestuv);
- selectsticky= 1;
- }
- flush = 1;
- }
-
- /* (de)select sticky uv nodes */
- if(sticky || actface) {
- EditVert *ev;
-
- for (a=0, ev=em->verts.first; ev; ev = ev->next, a++)
- ev->tmp.l = a;
-
- /* deselect */
- if(selectsticky==0) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- /*if(nearesttf && tf!=nearesttf) tf->flag &=~ TF_ACTIVE;*/ /* TODO - deal with editmesh active face */
- if (!sticky) continue;
-
- if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky))
- simaUVSel_UnSet(efa, tf, 0);
- if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky))
- simaUVSel_UnSet(efa, tf, 1);
- if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky))
- simaUVSel_UnSet(efa, tf, 2);
- if (efa->v4)
- if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky))
- simaUVSel_UnSet(efa, tf, 3);
- }
- }
- flush = -1;
- }
- /* select */
- else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if (!sticky) continue;
- if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky))
- simaUVSel_Set(efa, tf, 0);
- if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky))
- simaUVSel_Set(efa, tf, 1);
- if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky))
- simaUVSel_Set(efa, tf, 2);
- if (efa->v4)
- if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky))
- simaUVSel_Set(efa, tf, 3);
- }
- }
-
- if (actface)
- EM_set_actFace(nearestefa);
-
- flush = 1;
- }
- }
- }
- else if(!edgeloop) {
- /* select face and deselect other faces */
- if(actface) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- simaFaceSel_UnSet(efa, tf);
- }
- if(nearesttf) {
- simaFaceSel_Set(nearestefa, nearesttf);
- EM_set_actFace(nearestefa);
- }
-
- }
-
- /* deselect uvs, and select sticky uvs */
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if(!actface) simaFaceSel_UnSet(efa, tf);
- if(!sticky) continue;
-
- if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky))
- simaUVSel_Set(efa, tf, 0);
- if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky))
- simaUVSel_Set(efa, tf, 1);
- if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky))
- simaUVSel_Set(efa, tf, 2);
- if(efa->v4)
- if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky))
- simaUVSel_Set(efa, tf, 3);
- flush= 1;
- }
- }
-
- if(!actface) {
- simaUVSel_Set(nearestefa, nearesttf, nearestuv);
- flush= 1;
- }
- }
-
- force_draw(1);
-
- if (G.sima->flag & SI_SYNC_UVSEL) {
- /* flush for mesh selection */
- if (G.scene->selectmode != SCE_SELECT_FACE) {
- if (flush==1) EM_select_flush();
- else if (flush==-1) EM_deselect_flush();
- }
- allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */
- }
-
- BIF_undo_push("Select UV");
- rightmouse_transform();
-}
-
-void borderselect_sima(short whichuvs)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- rcti rect;
- rctf rectf;
- int val, ok = 1;
- short mval[2], select;
-
- if( is_uv_tface_editing_allowed()==0) return;
-
- val= get_border(&rect, 3);
- select = (val==LEFTMOUSE) ? 1 : 0;
-
- if(val) {
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- if (draw_uvs_face_check() && whichuvs != UV_SELECT_PINNED) {
- float cent[2];
- ok = 0;
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* assume not touched */
- efa->tmp.l = 0;
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- uv_center(tface->uv, cent, (void *)efa->v4);
- if(BLI_in_rctf(&rectf, cent[0], cent[1])) {
- efa->tmp.l = ok = 1;
- }
- }
- }
- /* (de)selects all tagged faces and deals with sticky modes */
- if (ok)
- uvface_setsel__internal(select);
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (whichuvs == UV_SELECT_ALL || (G.sima->flag & SI_SYNC_UVSEL) ) {
- /* SI_SYNC_UVSEL - cant do pinned selection */
- if(BLI_in_rctf(&rectf, tface->uv[0][0], tface->uv[0][1])) {
- if(select) simaUVSel_Set(efa, tface, 0);
- else simaUVSel_UnSet(efa, tface, 0);
- }
- if(BLI_in_rctf(&rectf, tface->uv[1][0], tface->uv[1][1])) {
- if(select) simaUVSel_Set(efa, tface, 1);
- else simaUVSel_UnSet(efa, tface, 1);
- }
- if(BLI_in_rctf(&rectf, tface->uv[2][0], tface->uv[2][1])) {
- if(select) simaUVSel_Set(efa, tface, 2);
- else simaUVSel_UnSet(efa, tface, 2);
- }
- if(efa->v4 && BLI_in_rctf(&rectf, tface->uv[3][0], tface->uv[3][1])) {
- if(select) simaUVSel_Set(efa, tface, 3);
- else simaUVSel_UnSet(efa, tface, 3);
- }
- } else if (whichuvs == UV_SELECT_PINNED) {
- if ((tface->unwrap & TF_PIN1) &&
- BLI_in_rctf(&rectf, tface->uv[0][0], tface->uv[0][1])) {
-
- if(select) simaUVSel_Set(efa, tface, 0);
- else simaUVSel_UnSet(efa, tface, 0);
- }
- if ((tface->unwrap & TF_PIN2) &&
- BLI_in_rctf(&rectf, tface->uv[1][0], tface->uv[1][1])) {
-
- if(select) simaUVSel_Set(efa, tface, 1);
- else simaUVSel_UnSet(efa, tface, 1);
- }
- if ((tface->unwrap & TF_PIN3) &&
- BLI_in_rctf(&rectf, tface->uv[2][0], tface->uv[2][1])) {
-
- if(select) simaUVSel_Set(efa, tface, 2);
- else simaUVSel_UnSet(efa, tface, 2);
- }
- if ((efa->v4) && (tface->unwrap & TF_PIN4) && BLI_in_rctf(&rectf, tface->uv[3][0], tface->uv[3][1])) {
- if(select) simaUVSel_Set(efa, tface, 3);
- else simaUVSel_UnSet(efa, tface, 3);
- }
- }
- }
- }
- }
- if (ok) {
- /* make sure newly selected vert selection is updated*/
- if (G.sima->flag & SI_SYNC_UVSEL) {
- if (G.scene->selectmode != SCE_SELECT_FACE) {
- if (select) EM_select_flush();
- else EM_deselect_flush();
- }
- }
- allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */
-
- BIF_undo_push("Border select UV");
- scrarea_queue_winredraw(curarea);
- }
- }
-}
-
-int snap_uv_sel_to_curs(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- short change = 0;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0)) VECCOPY2D(tface->uv[0], G.v2d->cursor);
- if (simaUVSel_Check(efa, tface, 1)) VECCOPY2D(tface->uv[1], G.v2d->cursor);
- if (simaUVSel_Check(efa, tface, 2)) VECCOPY2D(tface->uv[2], G.v2d->cursor);
- if (efa->v4)
- if (simaUVSel_Check(efa, tface, 3)) VECCOPY2D(tface->uv[3], G.v2d->cursor);
- change = 1;
- }
- }
- return change;
-}
-
-int snap_uv_sel_to_adj_unsel(void)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- EditVert *eve;
- MTFace *tface;
- short change = 0;
- int count = 0;
- float *coords;
- short *usercount, users;
-
- /* set all verts to -1 : an unused index*/
- for (eve= em->verts.first; eve; eve= eve->next)
- eve->tmp.l=-1;
-
- /* index every vert that has a selected UV using it, but only once so as to
- * get unique indicies and to count how much to malloc */
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0) && efa->v1->tmp.l==-1) efa->v1->tmp.l= count++;
- if (simaUVSel_Check(efa, tface, 1) && efa->v2->tmp.l==-1) efa->v2->tmp.l= count++;
- if (simaUVSel_Check(efa, tface, 2) && efa->v3->tmp.l==-1) efa->v3->tmp.l= count++;
- if (efa->v4)
- if (simaUVSel_Check(efa, tface, 3) && efa->v4->tmp.l==-1) efa->v4->tmp.l= count++;
- change = 1;
-
- /* optional speedup */
- efa->tmp.p = tface;
- } else {
- efa->tmp.p = NULL;
- }
- }
-
- coords = MEM_callocN(sizeof(float)*count*2, "snap to adjacent coords");
- usercount = MEM_callocN(sizeof(short)*count, "snap to adjacent counts");
-
- /* add all UV coords from visible, unselected UV coords as well as counting them to average later */
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- /* is this an unselected UV we can snap to? */
- if (efa->v1->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 0))) {
- coords[efa->v1->tmp.l*2] += tface->uv[0][0];
- coords[(efa->v1->tmp.l*2)+1] += tface->uv[0][1];
- usercount[efa->v1->tmp.l]++;
- change = 1;
- }
- if (efa->v2->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 1))) {
- coords[efa->v2->tmp.l*2] += tface->uv[1][0];
- coords[(efa->v2->tmp.l*2)+1] += tface->uv[1][1];
- usercount[efa->v2->tmp.l]++;
- change = 1;
- }
- if (efa->v3->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 2))) {
- coords[efa->v3->tmp.l*2] += tface->uv[2][0];
- coords[(efa->v3->tmp.l*2)+1] += tface->uv[2][1];
- usercount[efa->v3->tmp.l]++;
- change = 1;
- }
-
- if (efa->v4) {
- if (efa->v4->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 3))) {
- coords[efa->v4->tmp.l*2] += tface->uv[3][0];
- coords[(efa->v4->tmp.l*2)+1] += tface->uv[3][1];
- usercount[efa->v4->tmp.l]++;
- change = 1;
- }
- }
- }
- }
-
- /* no other verts selected, bail out */
- if (!change) {
- MEM_freeN(coords);
- MEM_freeN(usercount);
- return change;
- }
-
- /* copy the averaged unselected UVs back to the selected UVs */
- for (efa= em->faces.first; efa; efa= efa->next) {
-// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-// if (simaFaceDraw_Check(efa, tface)) {
- if ((tface=(MTFace *)efa->tmp.p)) {
-
- if ( simaUVSel_Check(efa, tface, 0) &&
- efa->v1->tmp.l >= 0 &&
- (users = usercount[efa->v1->tmp.l])
- ) {
- tface->uv[0][0] = coords[efa->v1->tmp.l*2] / users;
- tface->uv[0][1] = coords[(efa->v1->tmp.l*2)+1] / users;
- }
-
- if ( simaUVSel_Check(efa, tface, 1) &&
- efa->v2->tmp.l >= 0 &&
- (users = usercount[efa->v2->tmp.l])
- ) {
- tface->uv[1][0] = coords[efa->v2->tmp.l*2] / users;
- tface->uv[1][1] = coords[(efa->v2->tmp.l*2)+1] / users;
- }
-
- if ( simaUVSel_Check(efa, tface, 2) &&
- efa->v3->tmp.l >= 0 &&
- (users = usercount[efa->v3->tmp.l])
- ) {
- tface->uv[2][0] = coords[efa->v3->tmp.l*2] / users;
- tface->uv[2][1] = coords[(efa->v3->tmp.l*2)+1] / users;
- }
-
- if (efa->v4) {
- if ( simaUVSel_Check(efa, tface, 3) &&
- efa->v4->tmp.l >= 0 &&
- (users = usercount[efa->v4->tmp.l])
- ) {
- tface->uv[3][0] = coords[efa->v4->tmp.l*2] / users;
- tface->uv[3][1] = coords[(efa->v4->tmp.l*2)+1] / users;
- }
- }
- }
- }
-
- MEM_freeN(coords);
- MEM_freeN(usercount);
- return change;
-}
-
-void snap_coord_to_pixel(float *uvco, float w, float h)
-{
- uvco[0] = ((float) ((int)((uvco[0]*w) + 0.5))) / w;
- uvco[1] = ((float) ((int)((uvco[1]*h) + 0.5))) / h;
-}
-
-int snap_uv_sel_to_pixels(void) /* warning, sanity checks must alredy be done */
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
- int wi, hi;
- float w, h;
- short change = 0;
-
- transform_width_height_tface_uv(&wi, &hi);
- w = (float)wi;
- h = (float)hi;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (simaUVSel_Check(efa, tface, 0)) snap_coord_to_pixel(tface->uv[0], w, h);
- if (simaUVSel_Check(efa, tface, 1)) snap_coord_to_pixel(tface->uv[1], w, h);
- if (simaUVSel_Check(efa, tface, 2)) snap_coord_to_pixel(tface->uv[2], w, h);
- if (efa->v4)
- if (simaUVSel_Check(efa, tface, 3)) snap_coord_to_pixel(tface->uv[3], w, h);
- change = 1;
- }
- }
- return change;
-}
-
-void snap_uv_curs_to_pixels(void)
-{
- int wi, hi;
- float w, h;
-
- transform_width_height_tface_uv(&wi, &hi);
- w = (float)wi;
- h = (float)hi;
- snap_coord_to_pixel(G.v2d->cursor, w, h);
-}
-
-int snap_uv_curs_to_sel(void)
-{
- if( is_uv_tface_editing_allowed()==0 ) return 0;
- return cent_tface_uv(G.v2d->cursor, 0);
-}
-
-void snap_menu_sima(void)
-{
- short event;
- if( is_uv_tface_editing_allowed()==0 || !G.v2d) return; /* !G.v2d should never happen */
-
- event = pupmenu("Snap %t|Selection -> Pixels%x1|Selection -> Cursor%x2|Selection -> Adjacent Unselected%x3|Cursor -> Selection%x4|Cursor -> Pixel%x5");
- switch (event) {
- case 1:
- if (snap_uv_sel_to_pixels()) {
- BIF_undo_push("Snap UV Selection to Pixels");
- object_uvs_changed(OBACT);
- }
- break;
- case 2:
- if (snap_uv_sel_to_curs()) {
- BIF_undo_push("Snap UV Selection to Cursor");
- object_uvs_changed(OBACT);
- }
- break;
- case 3:
- if (snap_uv_sel_to_adj_unsel()) {
- BIF_undo_push("Snap UV Selection to Cursor");
- object_uvs_changed(OBACT);
- }
- break;
- case 4:
- if (snap_uv_curs_to_sel())
- allqueue(REDRAWIMAGE, 0);
- break;
- case 5:
- snap_uv_curs_to_pixels();
- scrarea_queue_winredraw(curarea);
- break;
- }
-}
-
-
-/** This is an ugly function to set the Tface selection flags depending
- * on whether its UV coordinates are inside the normalized
- * area with radius rad and offset offset. These coordinates must be
- * normalized to 1.0
- * Just for readability...
- */
-
-static void sel_uvco_inside_radius(short sel, EditFace *efa, MTFace *tface, int index, float *offset, float *ell, short select_index)
-{
- // normalized ellipse: ell[0] = scaleX,
- // [1] = scaleY
-
- float *uv = tface->uv[index];
- float x, y, r2;
-
- x = (uv[0] - offset[0]) * ell[0];
- y = (uv[1] - offset[1]) * ell[1];
-
- r2 = x * x + y * y;
- if (r2 < 1.0) {
- if (sel == LEFTMOUSE) simaUVSel_Set(efa, tface, select_index);
- else simaUVSel_UnSet(efa, tface, select_index);
- }
-}
-
-// see below:
-/** gets image dimensions of the 2D view 'v' */
-static void getSpaceImageDimension(SpaceImage *sima, float *xy)
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
-
- if (ibuf) {
- xy[0] = ibuf->x * sima->zoom;
- xy[1] = ibuf->y * sima->zoom;
- } else {
- xy[0] = 256 * sima->zoom;
- xy[1] = 256 * sima->zoom;
- }
-}
-
-/** Callback function called by circle_selectCB to enable
- * brush select in UV editor.
- */
-
-void uvedit_selectionCB(short selecting, Object *editobj, short *mval, float rad)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- float offset[2];
- MTFace *tface;
- float ellipse[2]; // we need to deal with ellipses, as
- // non square textures require for circle
- // selection. this ellipse is normalized; r = 1.0
-
- getSpaceImageDimension(curarea->spacedata.first, ellipse);
- ellipse[0] /= rad;
- ellipse[1] /= rad;
-
- areamouseco_to_ipoco(G.v2d, mval, &offset[0], &offset[1]);
-
- if (selecting) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- sel_uvco_inside_radius(selecting, efa, tface, 0, offset, ellipse, 0);
- sel_uvco_inside_radius(selecting, efa, tface, 1, offset, ellipse, 1);
- sel_uvco_inside_radius(selecting, efa, tface, 2, offset, ellipse, 2);
- if (efa->v4)
- sel_uvco_inside_radius(selecting, efa, tface, 3, offset, ellipse, 3);
- }
-
- if(G.f & G_DRAWFACES) { /* full redraw only if necessary */
- draw_sel_circle(0, 0, 0, 0, 0); /* signal */
- force_draw(0);
- }
- else { /* force_draw() is no good here... */
- glDrawBuffer(GL_FRONT);
- draw_uvs_sima();
- bglFlush();
- glDrawBuffer(GL_BACK);
- }
-
-
- if (selecting == LEFTMOUSE) EM_select_flush();
- else EM_deselect_flush();
-
- if (G.sima->lock && (G.sima->flag & SI_SYNC_UVSEL))
- force_draw_plus(SPACE_VIEW3D, 0);
- }
-}
-
-
-void mouseco_to_curtile(void)
-{
- float fx, fy;
- short mval[2];
-
- if( is_uv_tface_editing_allowed()==0) return;
-
- if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) {
-
- G.sima->flag |= SI_EDITTILE;
-
- while(get_mbut()&L_MOUSE) {
-
- calc_image_view(G.sima, 'f');
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &fx, &fy);
-
- if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) {
-
- fx= (fx)*G.sima->image->xrep;
- fy= (fy)*G.sima->image->yrep;
-
- mval[0]= fx;
- mval[1]= fy;
-
- G.sima->curtile= mval[1]*G.sima->image->xrep + mval[0];
- }
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
-
- G.sima->flag &= ~SI_EDITTILE;
-
- image_set_tile(G.sima, 2);
-
- allqueue(REDRAWVIEW3D, 0);
- scrarea_queue_winredraw(curarea);
- }
-}
-
-/* Could be used for other 2D views also */
-void mouseco_to_cursor_sima(void)
-{
- short mval[2];
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &G.v2d->cursor[0], &G.v2d->cursor[1]);
- scrarea_queue_winredraw(curarea);
-}
-
-void stitch_limit_uv_tface(void)
-{
- MTFace *tf;
- int a, vtot;
- float newuv[2], limit[2], pixellimit;
- UvMapVert *vlist, *iterv;
- EditMesh *em = G.editMesh;
- EditVert *ev;
- EditFace *efa;
-
- struct UvVertMap *vmap;
-
-
- if(is_uv_tface_editing_allowed()==0)
- return;
- if(G.sima->flag & SI_SYNC_UVSEL) {
- error("Can't stitch when Sync Mesh Selection is enabled");
- return;
- }
-
- pixellimit= 20.0f;
- add_numbut(0, NUM|FLO, "Limit:", 0.1, 1000.0, &pixellimit, NULL);
- if (!do_clever_numbuts("Stitch UVs", 1, REDRAW))
- return;
-
- if(G.sima->image) {
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
-
- if(ibuf && ibuf->x > 0 && ibuf->y > 0) {
- limit[0]= pixellimit/(float)ibuf->x;
- limit[1]= pixellimit/(float)ibuf->y;
- }
- else
- limit[0]= limit[1]= pixellimit/256.0;
- }
- else
- limit[0]= limit[1]= pixellimit/256.0;
-
- /*vmap= make_uv_vert_map(me->mface, tf, me->totface, me->totvert, 1, limit);*/
- EM_init_index_arrays(0, 0, 1);
- vmap= make_uv_vert_map_EM(1, 0, limit);
- if(vmap == NULL)
- return;
-
- for(a=0, ev= em->verts.first; ev; a++, ev= ev->next) {
- vlist= get_uv_map_vert_EM(vmap, a);
-
- while(vlist) {
- newuv[0]= 0; newuv[1]= 0;
- vtot= 0;
-
- for(iterv=vlist; iterv; iterv=iterv->next) {
- if((iterv != vlist) && iterv->separate)
- break;
- efa = EM_get_face_for_index(iterv->f);
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- if (tf->flag & TF_SEL_MASK(iterv->tfindex)) {
- newuv[0] += tf->uv[iterv->tfindex][0];
- newuv[1] += tf->uv[iterv->tfindex][1];
- vtot++;
- }
- }
-
- if (vtot > 1) {
- newuv[0] /= vtot; newuv[1] /= vtot;
-
- for(iterv=vlist; iterv; iterv=iterv->next) {
- if((iterv != vlist) && iterv->separate)
- break;
- efa = EM_get_face_for_index(iterv->f);
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (tf->flag & TF_SEL_MASK(iterv->tfindex)) {
- tf->uv[iterv->tfindex][0]= newuv[0];
- tf->uv[iterv->tfindex][1]= newuv[1];
- }
- }
- }
- vlist= iterv;
- }
- }
-
- free_uv_vert_map_EM(vmap);
- EM_free_index_arrays();
-
- if(G.sima->flag & SI_BE_SQUARE) be_square_tface_uv(em);
-
- BIF_undo_push("Stitch UV");
-
- object_uvs_changed(OBACT);
-}
-
-void select_linked_tface_uv(int mode) /* TODO */
-{
- EditMesh *em= G.editMesh;
- EditFace *efa, *nearestefa=NULL;
- MTFace *tf, *nearesttf=NULL;
- UvVertMap *vmap;
- UvMapVert *vlist, *iterv, *startv;
- unsigned int *stack, stacksize= 0, nearestv;
- char *flag;
- int a, nearestuv, i, nverts, j;
- float limit[2];
- if(is_uv_tface_editing_allowed()==0)
- return;
-
- if(G.sima->flag & SI_SYNC_UVSEL) {
- error("Can't select linked when Sync Mesh Selection is enabled");
- return;
- }
-
- if (mode == 2) {
- nearesttf= NULL;
- nearestuv= 0;
- }
- if (mode!=2) {
- find_nearest_uv(&nearesttf, &nearestefa, &nearestv, &nearestuv);
- if(nearesttf==NULL)
- return;
- }
-
- get_connected_limit_tface_uv(limit);
- vmap= make_uv_vert_map_EM(1, 1, limit);
- if(vmap == NULL)
- return;
-
- stack= MEM_mallocN(sizeof(*stack)* BLI_countlist(&em->faces), "UvLinkStack");
- flag= MEM_callocN(sizeof(*flag)*BLI_countlist(&em->faces), "UvLinkFlag");
-
- if (mode == 2) {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) {
- stack[stacksize]= a;
- stacksize++;
- flag[a]= 1;
- }
- }
- }
- } else {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if(tf == nearesttf) {
- stack[stacksize]= a;
- stacksize++;
- flag[a]= 1;
- break;
- }
- }
- }
-
- while(stacksize > 0) {
- stacksize--;
- a= stack[stacksize];
-
- for (j=0, efa= em->faces.first; efa; efa= efa->next, j++) {
- if (j==a) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- break;
- }
- }
-
- nverts= efa->v4? 4: 3;
-
- for(i=0; i<nverts; i++) {
- /* make_uv_vert_map_EM sets verts tmp.l to the indicies */
- vlist= get_uv_map_vert_EM(vmap, (*(&efa->v1 + i))->tmp.l);
-
- startv= vlist;
-
- for(iterv=vlist; iterv; iterv=iterv->next) {
- if(iterv->separate)
- startv= iterv;
- if(iterv->f == a)
- break;
- }
-
- for(iterv=startv; iterv; iterv=iterv->next) {
- if((startv != iterv) && (iterv->separate))
- break;
- else if(!flag[iterv->f]) {
- flag[iterv->f]= 1;
- stack[stacksize]= iterv->f;;
- stacksize++;
- }
- }
- }
- }
-
- if(mode==0 || mode==2) {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if(flag[a])
- tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- else
- tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- }
- else if(mode==1) {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- if(flag[a]) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (efa->v4) {
- if((tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)))
- break;
- }
- else if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3))
- break;
- }
- }
-
- if (efa) {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- if(flag[a]) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- }
- }
- else {
- for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) {
- if(flag[a]) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
- }
- }
- }
-
- MEM_freeN(stack);
- MEM_freeN(flag);
- free_uv_vert_map_EM(vmap);
-
- BIF_undo_push("Select linked UV");
- scrarea_queue_winredraw(curarea);
-}
-
-void unlink_selection(void)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- if(G.sima->flag & SI_SYNC_UVSEL) {
- error("Can't select unlinked when Sync Mesh Selection is enabled");
- return;
- }
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if(efa->v4) {
- if(~tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- } else {
- if(~tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3))
- tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3);
- }
- }
- }
-
- BIF_undo_push("Unlink UV selection");
- scrarea_queue_winredraw(curarea);
-}
-
-/* this function sets the selection on tagged faces
- * This is needed because setting the selection on a face is done in
- * a number of places but it also needs to respect the sticky modes
- * for the UV verts - dealing with the sticky modes is best done in a seperate function
- *
- * de-selects faces that have been tagged on efa->tmp.l
- */
-void uvface_setsel__internal(short select)
-{
-
- /* All functions calling this should call
- * draw_uvs_face_check()
- */
-
-
- /* selecting UV Faces with some modes requires us to change
- * the selection in other faces (depending on the stickt mode)
- *
- * This only needs to be done when the Mesh is not used for selection
- * (So for sticky modes - vertex or location based)
- * */
-
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tf;
- int nverts, i;
-
- if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_VERTEX) {
- /* tag all verts as untouched,
- * then touch the ones that have a face center in the loop
- * and select all MTFace UV's that use a touched vert */
-
- EditVert *eve;
-
- for (eve= em->verts.first; eve; eve= eve->next)
- eve->tmp.l = 0;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->tmp.l) {
- if (efa->v4) {
- efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= efa->v4->tmp.l=1;
- } else {
- efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= 1;
- }
- }
- }
- /* now select tagged verts */
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- if ((*(&efa->v1 + i))->tmp.l) {
- if (select) {
- simaUVSel_Set(efa, tf, i);
- } else {
- simaUVSel_UnSet(efa, tf, i);
- }
- }
- }
- }
- } else if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_LOC) {
- EditFace *efa_vlist;
- MTFace *tf_vlist;
- UvMapVert *start_vlist=NULL, *vlist_iter;
- struct UvVertMap *vmap;
- float limit[2];
- int efa_index;
- //EditVert *eve; /* removed vert counting for now */
- //int a;
-
- get_connected_limit_tface_uv(limit);
-
- EM_init_index_arrays(0, 0, 1);
- vmap= make_uv_vert_map_EM(0, 0, limit);
-
- /* verts are numbered above in make_uv_vert_map_EM, make sure this stays true! */
- /*for (a=0, eve= em->verts.first; eve; a++, eve= eve->next)
- eve->tmp.l = a; */
-
- if(vmap == NULL)
- return;
-
- for (efa_index=0, efa= em->faces.first; efa; efa_index++, efa= efa->next) {
- if (efa->tmp.l) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- if (select) {
- simaUVSel_Set(efa, tf, i);
- } else {
- simaUVSel_UnSet(efa, tf, i);
- }
-
- vlist_iter= get_uv_map_vert_EM(vmap, (*(&efa->v1 + i))->tmp.l);
-
- while (vlist_iter) {
- if (vlist_iter->separate)
- start_vlist = vlist_iter;
-
- if (efa_index == vlist_iter->f) {
- break;
- }
- vlist_iter = vlist_iter->next;
- }
-
- vlist_iter = start_vlist;
- while (vlist_iter) {
-
- if (vlist_iter != start_vlist && vlist_iter->separate)
- break;
-
- if (efa_index != vlist_iter->f) {
- efa_vlist = EM_get_face_for_index(vlist_iter->f);
- tf_vlist = CustomData_em_get(&em->fdata, efa_vlist->data, CD_MTFACE);
-
- if (select) {
- simaUVSel_Set(efa_vlist, tf_vlist, vlist_iter->tfindex);
- } else {
- simaUVSel_UnSet(efa_vlist, tf_vlist, vlist_iter->tfindex);
- }
- }
- vlist_iter = vlist_iter->next;
- }
- }
- }
- }
- EM_free_index_arrays();
- free_uv_vert_map_EM(vmap);
-
- } else { /* SI_STICKY_DISABLE or G.sima->flag & SI_SYNC_UVSEL */
- for (efa= em->faces.first; efa; efa= efa->next) {
- if (efa->tmp.l) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (select) {
- simaFaceSel_Set(efa, tf);
- } else {
- simaFaceSel_UnSet(efa, tf);
- }
- }
- }
- }
-}
-
-void pin_tface_uv(int mode)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if(mode ==1) {
- if(simaUVSel_Check(efa, tface, 0)) tface->unwrap |= TF_PIN1;
- if(simaUVSel_Check(efa, tface, 1)) tface->unwrap |= TF_PIN2;
- if(simaUVSel_Check(efa, tface, 2)) tface->unwrap |= TF_PIN3;
- if(efa->v4)
- if(simaUVSel_Check(efa, tface, 3)) tface->unwrap |= TF_PIN4;
- }
- else if (mode ==0) {
- if(simaUVSel_Check(efa, tface, 0)) tface->unwrap &= ~TF_PIN1;
- if(simaUVSel_Check(efa, tface, 1)) tface->unwrap &= ~TF_PIN2;
- if(simaUVSel_Check(efa, tface, 2)) tface->unwrap &= ~TF_PIN3;
- if(efa->v4)
- if(simaUVSel_Check(efa, tface, 3)) tface->unwrap &= ~TF_PIN4;
- }
- }
- }
-
- BIF_undo_push("Pin UV");
- scrarea_queue_winredraw(curarea);
-}
-
-void select_pinned_tface_uv(void)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- MTFace *tface;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tface)) {
- if (tface->unwrap & TF_PIN1) simaUVSel_Set(efa, tface, 0);
- if (tface->unwrap & TF_PIN2) simaUVSel_Set(efa, tface, 1);
- if (tface->unwrap & TF_PIN3) simaUVSel_Set(efa, tface, 2);
- if(efa->v4) {
- if (tface->unwrap & TF_PIN4) simaUVSel_Set(efa, tface, 3);
- }
-
- }
- }
-
- if (G.sima->flag & SI_SYNC_UVSEL) {
- allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */
- }
-
- BIF_undo_push("Select Pinned UVs");
- scrarea_queue_winredraw(curarea);
-}
-
-/* UV edge loop select, follows same rules as editmesh */
-
-static void uv_vertex_loop_flag(UvMapVert *first)
-{
- UvMapVert *iterv;
- int count= 0;
-
- for(iterv=first; iterv; iterv=iterv->next) {
- if(iterv->separate && iterv!=first)
- break;
-
- count++;
- }
-
- if(count < 5)
- first->flag= 1;
-}
-
-static UvMapVert *uv_vertex_map_get(UvVertMap *vmap, EditFace *efa, int a)
-{
- UvMapVert *iterv, *first;
-
- first= get_uv_map_vert_EM(vmap, (*(&efa->v1 + a))->tmp.l);
-
- for(iterv=first; iterv; iterv=iterv->next) {
- if(iterv->separate)
- first= iterv;
- if(iterv->f == efa->tmp.l)
- return first;
- }
-
- return NULL;
-}
-
-static int uv_edge_tag_faces(UvMapVert *first1, UvMapVert *first2, int *totface)
-{
- UvMapVert *iterv1, *iterv2;
- EditFace *efa;
- int tot = 0;
-
- /* count number of faces this edge has */
- for(iterv1=first1; iterv1; iterv1=iterv1->next) {
- if(iterv1->separate && iterv1 != first1)
- break;
-
- for(iterv2=first2; iterv2; iterv2=iterv2->next) {
- if(iterv2->separate && iterv2 != first2)
- break;
-
- if(iterv1->f == iterv2->f) {
- /* if face already tagged, don't do this edge */
- efa= EM_get_face_for_index(iterv1->f);
- if(efa->f1)
- return 0;
-
- tot++;
- break;
- }
- }
- }
-
- if(*totface == 0) /* start edge */
- *totface= tot;
- else if(tot != *totface) /* check for same number of faces as start edge */
- return 0;
-
- /* tag the faces */
- for(iterv1=first1; iterv1; iterv1=iterv1->next) {
- if(iterv1->separate && iterv1 != first1)
- break;
-
- for(iterv2=first2; iterv2; iterv2=iterv2->next) {
- if(iterv2->separate && iterv2 != first2)
- break;
-
- if(iterv1->f == iterv2->f) {
- efa= EM_get_face_for_index(iterv1->f);
- efa->f1= 1;
- break;
- }
- }
- }
-
- return 1;
-}
-
-void select_edgeloop_tface_uv(EditFace *startefa, int starta, int shift, int *flush)
-{
- EditMesh *em= G.editMesh;
- EditVert *eve;
- EditFace *efa;
- MTFace *tface;
- UvVertMap *vmap;
- UvMapVert *iterv1, *iterv2;
- float limit[2];
- int a, count, looking, nverts, starttotface, select;
-
- if( is_uv_tface_editing_allowed()==0 ) return;
-
- /* setup */
- EM_init_index_arrays(0, 0, 1);
-
- get_connected_limit_tface_uv(limit);
- vmap= make_uv_vert_map_EM(0, 0, limit);
-
- for(count=0, eve=em->verts.first; eve; count++, eve= eve->next)
- eve->tmp.l = count;
-
- for(count=0, efa= em->faces.first; efa; count++, efa= efa->next) {
- if(!shift) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- simaFaceSel_UnSet(efa, tface);
- }
-
- efa->tmp.l= count;
- efa->f1= 0;
- }
-
- /* set flags for first face and verts */
- nverts= (startefa->v4)? 4: 3;
- iterv1= uv_vertex_map_get(vmap, startefa, starta);
- iterv2= uv_vertex_map_get(vmap, startefa, (starta+1)%nverts);
- uv_vertex_loop_flag(iterv1);
- uv_vertex_loop_flag(iterv2);
-
- starttotface= 0;
- uv_edge_tag_faces(iterv1, iterv2, &starttotface);
-
- /* sorry, first edge isnt even ok */
- if(iterv1->flag==0 && iterv2->flag==0) looking= 0;
- else looking= 1;
-
- /* iterate */
- while(looking) {
- looking= 0;
-
- /* find correct valence edges which are not tagged yet, but connect to tagged one */
- for(efa= em->faces.first; efa; efa=efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- if(!efa->f1 && simaFaceDraw_Check(efa, tface)) {
- nverts= (efa->v4)? 4: 3;
- for(a=0; a<nverts; a++) {
- /* check face not hidden and not tagged */
- iterv1= uv_vertex_map_get(vmap, efa, a);
- iterv2= uv_vertex_map_get(vmap, efa, (a+1)%nverts);
-
- /* check if vertex is tagged and has right valence */
- if(iterv1->flag || iterv2->flag) {
- if(uv_edge_tag_faces(iterv1, iterv2, &starttotface)) {
- looking= 1;
- efa->f1= 1;
-
- uv_vertex_loop_flag(iterv1);
- uv_vertex_loop_flag(iterv2);
- break;
- }
- }
- }
- }
- }
- }
-
- /* do the actual select/deselect */
- nverts= (startefa->v4)? 4: 3;
- iterv1= uv_vertex_map_get(vmap, startefa, starta);
- iterv2= uv_vertex_map_get(vmap, startefa, (starta+1)%nverts);
- iterv1->flag= 1;
- iterv2->flag= 1;
-
- if(shift) {
- tface= CustomData_em_get(&em->fdata, startefa->data, CD_MTFACE);
- if(simaUVSel_Check(startefa, tface, starta) && simaUVSel_Check(startefa, tface, starta))
- select= 0;
- else
- select= 1;
- }
- else
- select= 1;
-
- if(select) *flush= 1;
- else *flush= -1;
-
- for(efa= em->faces.first; efa; efa=efa->next) {
- tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- nverts= (efa->v4)? 4: 3;
- for(a=0; a<nverts; a++) {
- iterv1= uv_vertex_map_get(vmap, efa, a);
-
- if(iterv1->flag) {
- if(select) simaUVSel_Set(efa, tface, a);
- else simaUVSel_UnSet(efa, tface, a);
- }
- }
- }
-
- /* cleanup */
- free_uv_vert_map_EM(vmap);
- EM_free_index_arrays();
-}
-
-int minmax_tface_uv(float *min, float *max)
-{
- EditMesh *em= G.editMesh;
- EditFace *efa;
- MTFace *tf;
- int sel;
-
- if( is_uv_tface_editing_allowed()==0 ) return 0;
-
- INIT_MINMAX2(min, max);
-
- sel= 0;
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if (simaUVSel_Check(efa, tf, 0)) { DO_MINMAX2(tf->uv[0], min, max); sel = 1; }
- if (simaUVSel_Check(efa, tf, 1)) { DO_MINMAX2(tf->uv[1], min, max); sel = 1; }
- if (simaUVSel_Check(efa, tf, 2)) { DO_MINMAX2(tf->uv[2], min, max); sel = 1; }
- if (efa->v4 && (simaUVSel_Check(efa, tf, 3))) { DO_MINMAX2(tf->uv[3], min, max); sel = 1; }
- }
- }
- return sel;
-}
-
-int cent_tface_uv(float *cent, int mode)
-{
- float min[2], max[2];
- short change= 0;
-
- if (mode==0) {
- if (minmax_tface_uv(min, max))
- change = 1;
-
- } else if (mode==1) {
- EditFace *efa;
- MTFace *tf;
- INIT_MINMAX2(min, max);
-
- for (efa= G.editMesh->faces.first; efa; efa= efa->next) {
- tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- if (simaUVSel_Check(efa, tf, 0)) { DO_MINMAX2(tf->uv[0], min, max); change= 1;}
- if (simaUVSel_Check(efa, tf, 1)) { DO_MINMAX2(tf->uv[1], min, max); change= 1;}
- if (simaUVSel_Check(efa, tf, 2)) { DO_MINMAX2(tf->uv[2], min, max); change= 1;}
- if (efa->v4 && (simaUVSel_Check(efa, tf, 3))) { DO_MINMAX2(tf->uv[3], min, max); change= 1;}
- }
- }
- }
-
- if (change) {
- cent[0]= (min[0]+max[0])/2.0;
- cent[1]= (min[1]+max[1])/2.0;
- return 1;
- }
- return 0;
-}
-
-static void sima_show_info(int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf)
-{
- short ofs;
- char str[256];
-
- ofs= sprintf(str, "X: %d Y: %d ", x, y);
- if(cp)
- ofs+= sprintf(str+ofs, "| R: %d G: %d B: %d A: %d ", cp[0], cp[1], cp[2], cp[3]);
- if(fp) {
- if(channels==4)
- ofs+= sprintf(str+ofs, "| R: %.3f G: %.3f B: %.3f A: %.3f ", fp[0], fp[1], fp[2], fp[3]);
- else if(channels==1)
- ofs+= sprintf(str+ofs, "| Val: %.3f ", fp[0]);
- else if(channels==3)
- ofs+= sprintf(str+ofs, "| R: %.3f G: %.3f B: %.3f ", fp[0], fp[1], fp[2]);
- }
- if(zp)
- ofs+= sprintf(str+ofs, "| Z: %.4f ", 0.5+0.5*( ((float)*zp)/(float)0x7fffffff));
- if(zpf)
- ofs+= sprintf(str+ofs, "| Z: %.3f ", *zpf);
-
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- glColor4f(.0,.0,.0,.25);
- glRectf(0.0, 0.0, curarea->winx, 30.0);
- glDisable(GL_BLEND);
-
- glColor3ub(255, 255, 255);
- glRasterPos2i(10, 10);
-
- BMF_DrawString(G.fonts, str);
-
-}
-
-void sima_sample_color(void)
-{
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- float fx, fy;
- short mval[2], mvalo[2], firsttime=1;
-
- if(ibuf==NULL)
- return;
-
- calc_image_view(G.sima, 'f');
- getmouseco_areawin(mvalo);
-
- while(get_mbut() & L_MOUSE) {
-
- getmouseco_areawin(mval);
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) {
- firsttime= 0;
- areamouseco_to_ipoco(G.v2d, mval, &fx, &fy);
-
- if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) {
- float *fp= NULL, *zpf= NULL;
- float vec[3];
- int *zp= NULL;
- char *cp= NULL;
-
- int x= (int) (fx*ibuf->x);
- int y= (int) (fy*ibuf->y);
-
- if(x>=ibuf->x) x= ibuf->x-1;
- if(y>=ibuf->y) y= ibuf->y-1;
-
- if(ibuf->rect)
- cp= (char *)(ibuf->rect + y*ibuf->x + x);
- if(ibuf->zbuf)
- zp= ibuf->zbuf + y*ibuf->x + x;
- if(ibuf->zbuf_float)
- zpf= ibuf->zbuf_float + y*ibuf->x + x;
- if(ibuf->rect_float)
- fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
-
- if(fp==NULL) {
- fp= vec;
- vec[0]= (float)cp[0]/255.0f;
- vec[1]= (float)cp[1]/255.0f;
- vec[2]= (float)cp[2]/255.0f;
- }
-
- if(G.sima->cumap) {
-
- if(ibuf->channels==4) {
- if(G.qual & LR_CTRLKEY) {
- curvemapping_set_black_white(G.sima->cumap, NULL, fp);
- curvemapping_do_ibuf(G.sima->cumap, ibuf);
- }
- else if(G.qual & LR_SHIFTKEY) {
- curvemapping_set_black_white(G.sima->cumap, fp, NULL);
- curvemapping_do_ibuf(G.sima->cumap, ibuf);
- }
- }
- }
-
- {
- ScrArea *sa, *cur= curarea;
-
- node_curvemap_sample(fp); /* sends global to node editor */
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_NODE) {
- areawinset(sa->win);
- scrarea_do_windraw(sa);
- }
- }
- node_curvemap_sample(NULL); /* clears global in node editor */
- curarea= cur;
- }
-
- areawinset(curarea->win);
- scrarea_do_windraw(curarea);
- myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
- glLoadIdentity();
-
- sima_show_info(ibuf->channels, x, y, cp, (ibuf->rect_float)?fp:NULL, zp, zpf);
-
- screen_swapbuffers();
-
- }
- }
- BIF_wait_for_statechange();
- }
-
- scrarea_queue_winredraw(curarea);
-
-}
-
-/* Image functions */
-
-static void load_image_filesel(char *str) /* called from fileselect */
-{
- Image *ima= NULL;
-
- ima= BKE_add_image_file(str);
- if(ima) {
- BKE_image_signal(ima, &G.sima->iuser, IMA_SIGNAL_RELOAD);
- image_changed(G.sima, ima);
- }
- BIF_undo_push("Load image UV");
- allqueue(REDRAWIMAGE, 0);
-}
-
-static void replace_image_filesel(char *str) /* called from fileselect */
-{
- if (!G.sima->image)
- return;
-
- strncpy(G.sima->image->name, str, sizeof(G.sima->image->name)-1); /* we cant do much if the str is longer then 240 :/ */
- BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_RELOAD);
- BIF_undo_push("Replace image UV");
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static void save_image_doit(char *name)
-{
- Image *ima= G.sima->image;
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- int len;
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- if (ibuf) {
- BLI_strncpy(str, name, sizeof(str));
-
- BLI_convertstringcode(str, G.sce);
- BLI_convertstringframe(str, G.scene->r.cfra);
-
-
- if(G.scene->r.scemode & R_EXTENSION) {
- BKE_add_image_extension(str, G.sima->imtypenr);
- BKE_add_image_extension(name, G.sima->imtypenr);
- }
-
- if (saveover(str)) {
-
- /* enforce user setting for RGB or RGBA, but skip BW */
- if(G.scene->r.planes==32)
- ibuf->depth= 32;
- else if(G.scene->r.planes==24)
- ibuf->depth= 24;
-
- waitcursor(1);
- if(G.sima->imtypenr==R_MULTILAYER) {
- RenderResult *rr= BKE_image_get_renderresult(ima);
- if(rr) {
- RE_WriteRenderResult(rr, str, G.scene->r.quality);
-
- BLI_strncpy(ima->name, name, sizeof(ima->name));
- BLI_strncpy(ibuf->name, str, sizeof(ibuf->name));
-
- /* should be function? nevertheless, saving only happens here */
- for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next)
- ibuf->userflags &= ~IB_BITMAPDIRTY;
-
- }
- else error("Did not write, no Multilayer Image");
- }
- else if (BKE_write_ibuf(ibuf, str, G.sima->imtypenr, G.scene->r.subimtype, G.scene->r.quality)) {
- BLI_strncpy(ima->name, name, sizeof(ima->name));
- BLI_strncpy(ibuf->name, str, sizeof(ibuf->name));
-
- ibuf->userflags &= ~IB_BITMAPDIRTY;
-
- /* change type? */
- if( ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER)) {
- ima->source= IMA_SRC_FILE;
- ima->type= IMA_TYPE_IMAGE;
- }
- if(ima->type==IMA_TYPE_R_RESULT)
- ima->type= IMA_TYPE_IMAGE;
-
- /* name image as how we saved it */
- len= strlen(str);
- while (len > 0 && str[len - 1] != '/' && str[len - 1] != '\\') len--;
- rename_id(&ima->id, str+len);
- }
- else {
- error("Couldn't write image: %s", str);
- }
-
- allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSSHADING, 0);
-
- waitcursor(0);
- }
- }
-}
-
-void open_image_sima(short imageselect)
-{
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if(G.sima->image)
- strcpy(name, G.sima->image->name);
- else
- strcpy(name, U.textudir);
-
- if(imageselect)
- activate_imageselect(FILE_SPECIAL, "Open Image", name, load_image_filesel);
- else
- activate_fileselect(FILE_SPECIAL, "Open Image", name, load_image_filesel);
-}
-
-void replace_image_sima(short imageselect)
-{
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if(G.sima->image)
- strcpy(name, G.sima->image->name);
- else
- strcpy(name, U.textudir);
-
- if(imageselect)
- activate_imageselect(FILE_SPECIAL, "Replace Image", name, replace_image_filesel);
- else
- activate_fileselect(FILE_SPECIAL, "Replace Image", name, replace_image_filesel);
-}
-
-
-static char *filesel_imagetype_string(Image *ima)
-{
- char *strp, *str= MEM_callocN(14*32, "menu for filesel");
-
- strp= str;
- str += sprintf(str, "Save Image as: %%t|");
- str += sprintf(str, "Targa %%x%d|", R_TARGA);
- str += sprintf(str, "Targa Raw %%x%d|", R_RAWTGA);
- str += sprintf(str, "PNG %%x%d|", R_PNG);
- str += sprintf(str, "BMP %%x%d|", R_BMP);
- str += sprintf(str, "Jpeg %%x%d|", R_JPEG90);
- str += sprintf(str, "Iris %%x%d|", R_IRIS);
- if(G.have_libtiff)
- str += sprintf(str, "Tiff %%x%d|", R_TIFF);
- str += sprintf(str, "Radiance HDR %%x%d|", R_RADHDR);
- str += sprintf(str, "Cineon %%x%d|", R_CINEON);
- str += sprintf(str, "DPX %%x%d|", R_DPX);
-#ifdef WITH_OPENEXR
- str += sprintf(str, "OpenEXR %%x%d|", R_OPENEXR);
- /* saving sequences of multilayer won't work, they copy buffers */
- if(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER);
- else str += sprintf(str, "MultiLayer %%x%d|", R_MULTILAYER);
-#endif
- return strp;
-}
-
-/* always opens fileselect */
-void save_as_image_sima(void)
-{
- Image *ima = G.sima->image;
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if (ima) {
- strcpy(name, ima->name);
-
- if (ibuf) {
- char *strp;
-
- strp= filesel_imagetype_string(ima);
-
- /* cant save multilayer sequence, ima->rr isn't valid for a specific frame */
- if(ima->rr && !(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER))
- G.sima->imtypenr= R_MULTILAYER;
- else if(ima->type==IMA_TYPE_R_RESULT)
- G.sima->imtypenr= G.scene->r.imtype;
- else G.sima->imtypenr= BKE_ftype_to_imtype(ibuf->ftype);
-
- activate_fileselect_menu(FILE_SPECIAL, "Save Image", name, strp, &G.sima->imtypenr, save_image_doit);
- }
- }
-}
-
-/* if exists, saves over without fileselect */
-void save_image_sima(void)
-{
- Image *ima = G.sima->image;
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- if (ima) {
- strcpy(name, ima->name);
-
- if (ibuf) {
- if (BLI_exists(ibuf->name)) {
- if(BKE_image_get_renderresult(ima))
- G.sima->imtypenr= R_MULTILAYER;
- else
- G.sima->imtypenr= BKE_ftype_to_imtype(ibuf->ftype);
-
- save_image_doit(ibuf->name);
- }
- else
- save_as_image_sima();
- }
- }
-}
-
-void save_image_sequence_sima(void)
-{
- ImBuf *ibuf;
- int tot= 0;
- char di[FILE_MAX], fi[FILE_MAX];
-
- if(G.sima->image==NULL)
- return;
- if(G.sima->image->source!=IMA_SRC_SEQUENCE)
- return;
- if(G.sima->image->type==IMA_TYPE_MULTILAYER) {
- error("Cannot save Multilayer Sequences");
- return;
- }
-
- /* get total */
- for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next)
- if(ibuf->userflags & IB_BITMAPDIRTY)
- tot++;
-
- if(tot==0) {
- notice("No Images have been changed");
- return;
- }
- /* get a filename for menu */
- for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next)
- if(ibuf->userflags & IB_BITMAPDIRTY)
- break;
-
- BLI_strncpy(di, ibuf->name, FILE_MAX);
- BLI_splitdirstring(di, fi);
-
- sprintf(fi, "%d Image(s) will be saved in %s", tot, di);
- if(okee(fi)) {
-
- for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next) {
- if(ibuf->userflags & IB_BITMAPDIRTY) {
- char name[FILE_MAX];
- BLI_strncpy(name, ibuf->name, sizeof(name));
-
- BLI_convertstringcode(name, G.sce);
-
- if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) {
- error("Could not write image", name);
- break;
- }
- printf("Saved: %s\n", ibuf->name);
- ibuf->userflags &= ~IB_BITMAPDIRTY;
- }
- }
- }
-}
-
-void reload_image_sima(void)
-{
- if (G.sima ) {
- BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_RELOAD);
- /* image_changed(G.sima, 0); - do we really need this? */
- }
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_preview_changed(ID_TE);
-}
-
-void new_image_sima(void)
-{
- static int width= 1024, height= 1024;
- static short uvtestgrid= 0;
- static int floatbuf=0;
- static float color[] = {0, 0, 0, 1};
- char name[22];
- Image *ima;
-
- strcpy(name, "Untitled");
-
- add_numbut(0, TEX, "Name:", 0, 21, name, NULL);
- add_numbut(1, NUM|INT, "Width:", 1, 16384, &width, NULL);
- add_numbut(2, NUM|INT, "Height:", 1, 16384, &height, NULL);
- add_numbut(3, COL, "", 0, 0, &color, NULL);
- add_numbut(4, NUM|FLO, "Alpha:", 0.0, 1.0, &color[3], NULL);
- add_numbut(5, TOG|SHO, "UV Test Grid", 0, 0, &uvtestgrid, NULL);
- add_numbut(6, TOG|INT, "32 bit Float", 0, 0, &floatbuf, NULL);
- if (!do_clever_numbuts("New Image", 7, REDRAW))
- return;
-
- ima = BKE_add_image_size(width, height, name, floatbuf, uvtestgrid, color);
- image_changed(G.sima, ima);
- BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
- BIF_undo_push("Add image");
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void pack_image_sima()
-{
- Image *ima = G.sima->image;
-
- if (ima) {
- if(ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE) {
- if (ima->packedfile) {
- if (G.fileflags & G_AUTOPACK)
- if (okee("Disable AutoPack?"))
- G.fileflags &= ~G_AUTOPACK;
-
- if ((G.fileflags & G_AUTOPACK) == 0) {
- unpackImage(ima, PF_ASK);
- BIF_undo_push("Unpack image");
- }
- }
- else {
- ImBuf *ibuf= imagewindow_get_ibuf(G.sima);
- if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- if(okee("Can't pack painted image. Use Repack as PNG?"))
- BKE_image_memorypack(ima);
- }
- else {
- ima->packedfile = newPackedFile(ima->name);
- BIF_undo_push("Pack image");
- }
- }
-
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- }
-}
-
-
-
-/* goes over all ImageUsers, and sets frame numbers if auto-refresh is set */
-void BIF_image_update_frame(void)
-{
- Tex *tex;
-
- /* texture users */
- for(tex= G.main->tex.first; tex; tex= tex->id.next) {
- if(tex->type==TEX_IMAGE && tex->ima)
- if(ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
- if(tex->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_imanr(&tex->iuser, G.scene->r.cfra, 0);
-
- }
- /* image window, compo node users */
- if(G.curscreen) {
- ScrArea *sa;
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- View3D *v3d= sa->spacedata.first;
- if(v3d->bgpic)
- if(v3d->bgpic->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_imanr(&v3d->bgpic->iuser, G.scene->r.cfra, 0);
- }
- else if(sa->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= sa->spacedata.first;
- if(sima->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_imanr(&sima->iuser, G.scene->r.cfra, 0);
- }
- else if(sa->spacetype==SPACE_NODE) {
- SpaceNode *snode= sa->spacedata.first;
- if((snode->treetype==NTREE_COMPOSIT) && (snode->nodetree)) {
- bNode *node;
- for(node= snode->nodetree->nodes.first; node; node= node->next) {
- if(node->id && node->type==CMP_NODE_IMAGE) {
- Image *ima= (Image *)node->id;
- ImageUser *iuser= node->storage;
- if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
- if(iuser->flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0);
- }
- }
- }
- }
- }
- }
-}
-
-extern int EM_texFaceCheck(void); /* from editmesh.c */
-/* called to assign images to UV faces */
-void image_changed(SpaceImage *sima, Image *image)
-{
- MTFace *tface;
- EditMesh *em = G.editMesh;
- EditFace *efa;
- /*ImBuf *ibuf = NULL;*/
- short change = 0;
-
- if(sima->mode!=SI_TEXTURE)
- return;
-
- /* skip assigning these procedural images... */
- if(image && (image->type==IMA_TYPE_R_RESULT || image->type==IMA_TYPE_COMPOSITE)) {
- return;
- } else if ((G.obedit) &&
- (G.obedit->type == OB_MESH) &&
- (G.editMesh) &&
- (G.editMesh->faces.first)
- ) {
-
- if(!is_uv_tface_editing_allowed())
- return;
-
- /* Add a UV layer if there is none, editmode only */
- if ( !CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE) ) {
- EM_add_data_layer(&em->fdata, CD_MTFACE);
- CustomData_set_layer_active(&em->fdata, CD_MTFACE, 0); /* always zero because we have no other UV layers */
- change = 1; /* so we update the object, incase no faces are selected */
-
- /* BIF_undo_push("New UV Texture"); - undo should be done by whatever changes the image */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-
-#if 0
- if(image)
- ibuf = BKE_image_get_ibuf(image, NULL);
-#endif
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (efa->h==0 && efa->f & SELECT) {
- if (image) {
- tface->tpage= image;
- tface->mode |= TF_TEX;
-
- if(image->tpageflag & IMA_TILES) tface->mode |= TF_TILES;
- else tface->mode &= ~TF_TILES;
-
- if(image->id.us==0) id_us_plus(&image->id);
- else id_lib_extern(&image->id);
-#if 0 /* GE People dont like us messing with their face modes */
- if (tface->transp==TF_ADD) {} /* they obviously know what they are doing! - leave as is */
- else if (ibuf && ibuf->depth == 32) tface->transp = TF_ALPHA;
- else tface->transp = TF_SOLID;
-#endif
- } else {
- tface->tpage= NULL;
- tface->mode &= ~TF_TEX;
-#if 0
- tface->transp = TF_SOLID;
-#endif
- }
- change = 1;
- }
- }
- }
-
- /* change the space image after because simaFaceDraw_Check uses the space image
- * to check if the face is displayed in UV-localview */
- sima->image = image;
-
- if(sima->image==NULL)
- sima->flag &= ~SI_DRAWTOOL;
-
- if (change)
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-void image_pixel_aspect(Image *image, float *x, float *y)
-{
- *x = *y = 1.0;
-
- if( (image == NULL) ||
- (image->type == IMA_TYPE_R_RESULT) ||
- (image->type == IMA_TYPE_COMPOSITE) ||
- (image->tpageflag & IMA_TILES) ||
- (image->aspx==0.0 || image->aspy==0.0)
- ) {
- return;
- }
-
- /* x is always 1 */
- *y = image->aspy / image->aspx;
-}
-
-void image_final_aspect(Image *image, float *x, float *y)
-{
- *x = *y = 1.0;
-
- if( (image == NULL) ||
- (image->type == IMA_TYPE_R_RESULT) ||
- (image->type == IMA_TYPE_COMPOSITE) ||
- (image->tpageflag & IMA_TILES) ||
- (image->aspx==0.0 || image->aspy==0.0)
- ) {
- return;
- } else {
- ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- if (ibuf && ibuf->x && ibuf->y) {
- *y = (image->aspy * ibuf->y) / (image->aspx * ibuf->x);
- } else {
- /* x is always 1 */
- *y = image->aspy / image->aspx;
- }
- }
-}
-
-/* Face selection tests - Keep these together */
-
-/* this checks weather a face is drarn without the local image check */
-int simaFaceDraw_Check_nolocal( EditFace *efa )
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- return (efa->h==0);
- } else {
- return (efa->h==0 && efa->f & SELECT);
- }
- return 0;
-}
-
-int simaFaceDraw_Check( EditFace *efa, MTFace *tf )
-{
- if (G.sima && G.sima->flag & SI_LOCAL_UV) {
- if (tf->tpage==G.sima->image) {
- return simaFaceDraw_Check_nolocal(efa);
- } else {
- return 0;
- }
- } else {
- return simaFaceDraw_Check_nolocal(efa);
- }
-}
-
-int simaFaceSel_Check( struct EditFace *efa, struct MTFace *tf )
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- return (efa->f & SELECT);
- } else {
- return (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4));
- }
-}
-
-void simaFaceSel_Set( struct EditFace *efa, struct MTFace *tf )
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- EM_select_face(efa, 1);
- } else {
- tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
-}
-
-void simaFaceSel_UnSet( struct EditFace *efa, struct MTFace *tf )
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- EM_select_face(efa, 0);
- } else {
- tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
- }
-}
-
-int simaUVSel_Check( struct EditFace *efa, struct MTFace *tf, int i)
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- return efa->f & SELECT;
- } else {
- return (*(&efa->v1 + i))->f & SELECT;
- }
- } else {
- return tf->flag & TF_SEL_MASK(i);
- }
-}
-
-void simaUVSel_Set( struct EditFace *efa, struct MTFace *tf, int i)
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- EM_select_face(efa, 1);
- } else {
- (*(&efa->v1 + i))->f |= SELECT;
- }
- } else {
- tf->flag |= TF_SEL_MASK(i);
- }
-}
-
-void simaUVSel_UnSet( struct EditFace *efa, struct MTFace *tf, int i)
-{
- if (G.sima && G.sima->flag & SI_SYNC_UVSEL) {
- if (G.scene->selectmode == SCE_SELECT_FACE) {
- EM_select_face(efa, 0);
- } else {
- (*(&efa->v1 + i))->f &= ~SELECT;
- }
- } else {
- tf->flag &= ~TF_SEL_MASK(i);
- }
-}
-
diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c
deleted file mode 100644
index 95b3a3d3021..00000000000
--- a/source/blender/src/editsound.c
+++ /dev/null
@@ -1,1077 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <fcntl.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#define __USE_XOPEN /* Needed for swab on linux */
-#include <unistd.h>
-#undef __USE_XOPEN
-#else
-
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_packedFile_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_sound.h"
-#include "BKE_library.h"
-#include "BKE_packedFile.h"
-
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_editsound.h"
-#include "BIF_mywindow.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "BDR_editobject.h"
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-#include "SND_C-api.h"
-#include "SND_DependKludge.h"
-
-#include "SYS_System.h"
-
-#include "PIL_time.h"
-
-
-/* this might move to the external header */
-static SND_SceneHandle ghSoundScene=NULL;
-static SND_AudioDeviceInterfaceHandle ghAudioDeviceInterface=NULL;
-
-/* que? why only here? because of the type define? */
-//static bSound *sound_find_sound(char *id_name);
-static void sound_read_wav_data(bSound * sound, PackedFile * pf);
-void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-/* void sound_stop_all_sounds(void); already in BIF_editsound.h */
-
-
-
-/* Right. Now for some implementation: */
-void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- SpaceSound *ssound= spacedata;
- unsigned short event= evt->event;
- short val= evt->val;
- float dx, dy;
- int doredraw= 0, cfra, first = 0;
- short mval[2], nr;
- short mousebut = L_MOUSE;
-
- if(curarea->win==0) return;
-
- if(val) {
-
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- switch(event) {
- case LEFTMOUSE:
- ssound->flag |= SND_CFRA_NUM;
- do {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- cfra = (int)(dx+0.5f);
- if(cfra< 1) cfra= 1;
-
- if( cfra!=CFRA || first )
- {
- first= 0;
- CFRA= cfra;
- update_for_newframe();
- force_draw_all(0);
- }
- else PIL_sleep_ms(30);
-
- } while(get_mbut() & mousebut);
- ssound->flag &= ~SND_CFRA_NUM;
-
- doredraw= 1;
-
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- case RIGHTMOUSE:
- {
- TimeMarker *marker;
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- marker = find_nearest_marker(SCE_MARKERS, 0);
- if (marker) {
- if ((G.qual & LR_SHIFTKEY)==0)
- deselect_markers(0, 0);
-
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- }
-
- force_draw(0);
- std_rmouse_transform(transform_markers);
- }
- break;
-
- case PADPLUSKEY:
- dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case PADMINUS:
- dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin-= dx;
- G.v2d->cur.xmax+= dx;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case HOMEKEY:
- do_sound_buttons(B_SOUNDHOME);
- break;
-
- case PAGEUPKEY: /* cfra to next marker */
- nextprev_marker(1);
- break;
- case PAGEDOWNKEY: /* cfra to prev marker */
- nextprev_marker(-1);
- break;
-
- case AKEY: /* select/deselect all */
- deselect_markers(1, 0);
-
- allqueue(REDRAWMARKER, 0);
- break;
-
- case BKEY: /* borderselect markers */
- borderselect_markers();
- break;
-
- case DKEY: /* duplicate selected marker(s) */
- if (G.qual & LR_SHIFTKEY) {
- duplicate_marker();
-
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- case GKEY:
- transform_markers('g', 0);
- break;
-
- case MKEY: /* add marker or rename first selected */
- if (G.qual & LR_CTRLKEY)
- rename_marker();
- else
- add_marker(CFRA);
-
- allqueue(REDRAWMARKER, 0);
- break;
-
- case TKEY: /* toggle time display */
- nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
- if (nr>0) {
- if(nr==1) ssound->flag |= SND_DRAWFRAMES;
- else ssound->flag &= ~SND_DRAWFRAMES;
- doredraw= 1;
- }
-
- break;
-
- case DELKEY: /* delete selected markers */
- case XKEY:
- if (okee("Erase selected")) {
- remove_marker();
- allqueue(REDRAWMARKER, 0);
- }
- break;
- }
- }
-
- if(doredraw)
- scrarea_queue_winredraw(curarea);
-}
-
-
-
-void sound_initialize_sounds(void)
-{
- bSound *sound;
-
- if(ghSoundScene) {
- for(sound=G.main->sound.first; sound; sound=sound->id.next) {
- if(sound->snd_sound) {
- SND_RemoveSound(ghSoundScene, sound->snd_sound);
- sound->snd_sound = NULL;
- }
- }
-
- /* clear the soundscene */
- SND_RemoveAllSounds(ghSoundScene);
- SND_RemoveAllSamples(ghSoundScene);
- }
-
- /* initialize sample blocks (doesnt call audio system, needs to be done once after load */
- sound = G.main->sound.first;
- while (sound) {
- sound_sample_is_null(sound);
- sound = (bSound *) sound->id.next;
- }
-}
-
-
-
-bSound *sound_make_copy(bSound *originalsound)
-{
- bSound *sound = NULL;
- char name[160];
- int len;
-
- if(ghSoundScene==NULL) sound_init_audio();
-
- /* only copy sounds that are sounds */
- if (originalsound)
- {
- /* do some name magic */
- strcpy(name, originalsound->name);
- len = strlen(name);
- while ((len > 0) && (name[len - 1] != '/') && (name[len - 1] != '\\'))
- len--;
-
- /* allocate the needed memory */
- sound = alloc_libblock(&G.main->sound, ID_SO, name + len);
-
- /* create a soundobject */
- sound->snd_sound = SND_CreateSound();
-
- /* set the samplename */
- strcpy(sound->name, name);
- SND_SetSampleName(sound->snd_sound, sound->name);
-
- /* add the new object to the soundscene */
- SND_AddSound(ghSoundScene, sound->snd_sound);
-
- /* and copy the data from the original */
- sound->attenuation = originalsound->attenuation;
- sound->distance = originalsound->distance;
- sound->max_gain = originalsound->max_gain;
- sound->min_gain = originalsound->min_gain;
- sound->newpackedfile = originalsound->newpackedfile;
- sound->panning = originalsound->panning;
- sound->pitch = originalsound->pitch;
- sound->sample = originalsound->sample;
- sound->volume = originalsound->volume;
-
- if (originalsound->flags & SOUND_FLAGS_3D)
- sound->flags |= SOUND_FLAGS_3D;
- else
- sound->flags &= ~SOUND_FLAGS_3D;
- }
-
- return sound;
-}
-
-
-
-void sound_initialize_sample(bSound *sound)
-{
- if(ghSoundScene==NULL) sound_init_audio();
-
- if (sound && sound->sample == NULL)
- sound_sample_is_null(sound);
-}
-
-
-static void sound_read_wav_data(bSound *sound, PackedFile *pf)
-{
- int i, temp;
- short shortbuf, *temps;
- int longbuf;
- char buffer[25];
- char *data = NULL;
- char *tempc;
- bSample *sample = NULL;
- int channels, rate, bits, len;
-
- /* prepare for the worst... */
- sound->sample->type = SAMPLE_INVALID;
-
- rewindPackedFile(pf);
-
- /* check to see if it is a file in "RIFF WAVE fmt" format */
- if (readPackedFile(pf, buffer, 16) != 16) {
- if (G.f & G_DEBUG) printf("File too short\n");
- return;
- }
-
- if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) {
- readPackedFile(pf, &i, 4);// start of data
- if(G.order==B_ENDIAN)
- SWITCH_INT(i);
-
- /* read the sampleformat */
- readPackedFile(pf, &shortbuf, 2);
- if(G.order==B_ENDIAN) {
- SWITCH_SHORT(shortbuf);
- }
-
- /* read the number of channels */
- readPackedFile(pf, &shortbuf, 2);
-
- if(G.order==B_ENDIAN) {
- SWITCH_SHORT(shortbuf);
- }
-
- /* check the number of channels */
- if(shortbuf != 1 && shortbuf != 2) {
- if (G.f & G_DEBUG) printf("Unsupported number of channels\n");
- return;
- }
- channels = shortbuf;
-
- /* read the samplerate */
- readPackedFile(pf, &longbuf, 4);
-
-
- if(G.order==B_ENDIAN)
- SWITCH_INT(longbuf);
- rate = longbuf;
-
- /* read the bitrate */
- // Ton's way
- readPackedFile(pf, &temp, 4);
-
- if(G.order==B_ENDIAN)
- SWITCH_INT(temp);
-
- if(channels && rate)
- bits= 8*temp/(rate * channels);
-
- // Frank's way
-
- readPackedFile(pf, &shortbuf, 2);
- readPackedFile(pf, &shortbuf, 2);
- if(G.order==B_ENDIAN) {
- SWITCH_SHORT(shortbuf);
- }
- bits = shortbuf;
-
- seekPackedFile(pf, i-16, SEEK_CUR);
- readPackedFile(pf, buffer, 4);
- /* check if we have a 'data' chunk */
- while(memcmp(buffer, "data", 4)!=0) {
- if (readPackedFile(pf, &i, 4) != 4)
- break;
-
- if(G.order==B_ENDIAN)
- SWITCH_INT(i);
-
- seekPackedFile(pf, i, SEEK_CUR);
- if (readPackedFile(pf, buffer, 4) != 4)
- break;
- }
-
- /* guess not */
- if (memcmp(buffer, "data", 4) !=0) {
- if (G.f & G_DEBUG) printf("No data found\n");
- }
- /* or maybe we do! */
- else {
- readPackedFile(pf, &longbuf, 4);
- if(G.order==B_ENDIAN) SWITCH_INT(longbuf);
-
- /* handle 8 and 16 bit samples differently */
- /* intrr: removed, longbuf is length in bytes, not samples */
- if (bits == 16)
- data = (char *)MEM_mallocN(longbuf, "sample data");
- else
- data = (char *)MEM_mallocN(longbuf*2, "sample data");
-
- len = longbuf /*/ 4.0*/; /* for some strange reason the sample length is off by a factor of 4... */
- /* intrr's comment: Funny eh, how one 16-bit stereo sample is 4 bytes? :-) */
-
- if(data) {
- readPackedFile(pf, data, len);
- /* data is only used to draw! */
- if (bits == 8) {
- temps = (short *) data;
- tempc = (char *) data;
- for (i = len - 1; i >= 0; i--)
- temps[i] = tempc[i] << 8;
- }
- else {
- if(G.order==B_ENDIAN) {
- swab(data, data, len);
- }
- }
- /* fill the sound with the found data */
- sample = sound->sample;
- sample->channels = channels;
- sample->rate = rate;
- sample->bits = bits;
- sample->len = len;
- sample->data = data;
- sample->type = SAMPLE_WAV;
- }
- }
- }
- else {
- sound->sample->type = SAMPLE_INVALID;
- if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name);
- }
-}
-
-
-
-/* ugly, but it works (for now) */
-static int sound_get_filetype_from_header(bSound *sound, PackedFile *pf)
-{
- int filetype = SAMPLE_INVALID;
- int i;
- char buffer[25];
- short shortbuf;
-
- rewindPackedFile(pf);
-
- if (readPackedFile(pf, buffer, 16) != 16) {
- if (G.f & G_DEBUG) printf("File too short\n");
- return filetype;
- }
-
- if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) {
- readPackedFile(pf, &i, 4);
- if(G.order==B_ENDIAN)
- SWITCH_INT(i);
-
- /* read the sampleformat */
- readPackedFile(pf, &shortbuf, 2);
- if(G.order==B_ENDIAN) {
- char s_i, *p_i;
- p_i= (char *)&(shortbuf);
- s_i= p_i[0];
- p_i[0]= p_i[1];
- p_i[1]= s_i;
- }
-
- if (shortbuf == SND_WAVE_FORMAT_PCM) {
- filetype = SAMPLE_WAV;
- }
- else
- /* only fmod supports compressed wav */
-#ifdef USE_FMOD
- {
- /* and only valid publishers may use compressed wav */
- switch (shortbuf)
- {
- case SND_WAVE_FORMAT_ADPCM:
- case SND_WAVE_FORMAT_ALAW:
- case SND_WAVE_FORMAT_MULAW:
- case SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM:
- case SND_WAVE_FORMAT_CONTROL_RES_VQLPC:
- case SND_WAVE_FORMAT_GSM_610:
- case SND_WAVE_FORMAT_MPEG3:
- filetype = SAMPLE_WAV;
- break;
- default:
-#endif
- {
- filetype = SAMPLE_INVALID;
- if (G.f & G_DEBUG) printf("Unsupported wav compression\n");
- }
- }
-#ifdef USE_FMOD
- }
- }
- else if (!memcmp(buffer, "OggS", 4)) {
- filetype = SAMPLE_OGG_VORBIS;
- }
- else if ((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "", 2))) {
- filetype = SAMPLE_MP3;
- }
-#endif
- else {
- filetype = SAMPLE_INVALID;
- if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name);
- }
-
- return filetype;
-}
-
-
-
-static int check_filetype(bSound *sound, PackedFile *pf)
-{
-// char* pdest;
- sound->sample->type = SAMPLE_INVALID;
-/*
- // parse the name for the extension to see what kind of sample it is
- pdest = strrchr(sound->sample->name, '.');
-
- // a simple check to see what kind of sample we're dealing with
- if (stricmp(pdest, ".wav") == 0)
- sound->sample->type = SAMPLE_WAV;
-
-#ifdef USE_FMOD
- if (stricmp(pdest, ".mp2") == 0)
- sound->sample->type = SAMPLE_MP2;
- if (stricmp(pdest, ".mp3") == 0)
- sound->sample->type = SAMPLE_MP3;
- if (stricmp(pdest, ".ogg") == 0)
- sound->sample->type = SAMPLE_OGG_VORBIS;
- if (stricmp(pdest, ".raw") == 0)
- sound->sample->type = SAMPLE_RAW;
- if (stricmp(pdest, ".wma") == 0)
- sound->sample->type = SAMPLE_WMA;
- if (stricmp(pdest, ".asf") == 0)
- sound->sample->type = SAMPLE_ASF;
-#endif
-*/
- sound->sample->type = sound_get_filetype_from_header(sound, pf);
-
- /* get some info from the sample */
- switch (sound->sample->type) {
- case SAMPLE_WAV:
- {
- sound_read_wav_data(sound, pf);
- break;
- }
- case SAMPLE_OGG_VORBIS:
- case SAMPLE_MP3:
- case SAMPLE_MP2:
- case SAMPLE_RAW:
- case SAMPLE_WMA:
- case SAMPLE_ASF:
- break;
- default:
- {
- if (G.f & G_DEBUG) printf("No valid sample: %s\n", sound->name);
- break;
- }
- }
-
- return sound->sample->type;
-}
-
-
-
-int sound_load_sample(bSound *sound)
-{
- int result = FALSE;
- PackedFile *pf;
- int freePF = FALSE;
- int buffer = -1;
-
- if(ghSoundScene==NULL) sound_init_audio();
-
- /* check the sample (valid?) */
- if (sound->sample->type == SAMPLE_UNKNOWN || sound->snd_sound == NULL) {
- /* find... */
- pf = sound_find_packedfile(sound);
-
- /* ...or create a (temp)packedfile */
- if (pf == NULL) {
- pf = newPackedFile(sound->name);
-
- /* if autopack is off, free the pf afterwards */
- if ((G.fileflags & G_AUTOPACK) == 0)
- freePF = TRUE;
- }
-
- /* if we have a valid pf... */
- if (pf) {
- /* check the content of the pf */
- check_filetype(sound, pf);
-
- /* check if the sampletype is supported */
- if (sound->sample->type != SAMPLE_INVALID && sound->sample->type != SAMPLE_UNKNOWN) {
- /* register the sample at the audiodevice */
- buffer = SND_AddSample(ghSoundScene, sound->sample->name, pf->data, pf->size);
-
- /* create a soundobject */
- sound->snd_sound = SND_CreateSound();
- SND_SetSampleName(sound->snd_sound, sound->sample->name);
-
- /* add the soundobject to the soundscene */
- if (SND_CheckBuffer(ghSoundScene, sound->snd_sound))
- SND_AddSound(ghSoundScene, sound->snd_sound);
- else
- if (G.f & G_DEBUG) printf("error: sample didn't load properly\n");
-
- /* if it was places in buffer[0] or higher, it succeeded */
- if (buffer >= 0)
- result = TRUE;
- }
- /* if not, free the pf */
- else {
- freePF = TRUE;
- }
-
- /* if you want it freed, make it so */
- if (freePF) {
- freePackedFile(pf);
- pf = NULL;
- }
- /* or else connect the pf to the sound and sample */
-// else {
- sound->newpackedfile = pf;
- sound->sample->packedfile = pf;
-// }
- }
- else {
- if (G.f & G_DEBUG) printf("%s: File not found!\n", sound->name);
- sound->sample->type = SAMPLE_INVALID;
- }
- }
- /* if the sample ain't invalid, we're ready to go! */
- else if (sound->sample->type != SAMPLE_INVALID) {
- result = TRUE;
- }
-
- return result;
-}
-
-
-
-bSound *sound_new_sound(char *name)
-{
- bSound *sound = NULL;
- int len, file;
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- if(ghSoundScene==NULL) sound_init_audio();
-
- if (!G.scene->audio.mixrate) G.scene->audio.mixrate = 44100;
- /* convert the name to absolute path */
- strcpy(str, name);
- BLI_convertstringcode(str, G.sce);
-
- /* check if the sample on disk can be opened */
- file = open(str, O_BINARY|O_RDONLY);
-
- if (file != -1) {
- close(file);
-
-
- /* do some name magic */
- len = strlen(name);
- while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\')
- len--;
-
- /* allocate some memory for the sound */
- sound = alloc_libblock(&G.main->sound, ID_SO, name + len);
- strcpy(sound->name, name);
-
- /* intialize and check the sample */
- sound_initialize_sample(sound);
-
- /* load the sample & check if this blender supports the sound format */
-// sound_load_sample(sound);
-
- if (sound->sample->type == SAMPLE_INVALID) {
- free_libblock(&G.main->sound, sound);
- sound = NULL;
- }
- else
- {
- sound->volume = 1.0;
- sound->attenuation = 1.0;
- sound->distance = 1.0;
- sound->min_gain = 0.0;
- sound->max_gain = 1.0;
- }
- }
-
- return (sound);
-}
-
-
-
-int sound_set_sample(bSound *sound, bSample *sample)
-{
- int result = TRUE;
-
- if(ghSoundScene==NULL) sound_init_audio();
-
- /* delete the soundobject */
- if (sound->snd_sound) {
- SND_RemoveSound(ghSoundScene, sound->snd_sound);
- sound->snd_sound = NULL;
- }
-
- /* connect the sample to the sound */
- sound->sample = sample;
- sound->newpackedfile = NULL;
-
- if (sound->sample) {
-
- /* and set the right pf */
- sound->newpackedfile = sample->packedfile;
-
- /* if the sampletype is unknown initialize it */
- if (sound->sample->type == SAMPLE_UNKNOWN) {
- sound_initialize_sample(sound);
-
- /* load the sample & check if this blender supports the sound format */
- if (!sound_load_sample(sound)) {
- result = FALSE;
- }
- }
- }
-
- return result;
-}
-
-
-
-bSample *sound_new_sample(bSound *sound)
-{
- char samplename[FILE_MAX];
- bSample *sample = NULL;
- int len;
- char *name;
-
- if (sound != NULL) {
- name = sound->name;
- len = strlen(name);
- /* do some name magic */
- while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\')
- len--;
-
- /* allocate the memory for the sample */
- sample = MEM_callocN(sizeof(bSample), "sample");
- BLI_strncpy(sample->id.name+2, name+len, 20);
- BLI_addtail(samples, sample); /* samples is ugly global */
-
- sample->data = &sample->fakedata[0];
- sample->type = SAMPLE_UNKNOWN;
-
- /* some default settings. We get divide by zero if these values are not set */
- sample->channels = 1;
- sample->rate = 44100;
- sample->bits = 16;
- sample->alindex = SAMPLE_INVALID;
-
- /* convert sound->name to abolute filename */
- /* TODO: increase sound->name, sample->name and strip->name to FILE_MAX, to avoid
- cutting off sample name here - elubie */
- BLI_strncpy(samplename, sound->name, FILE_MAX);
- BLI_convertstringcode(samplename, G.sce);
- BLI_strncpy(sample->name, samplename, FILE_MAXDIR);
-
- /* connect the pf to the sample */
- if (sound->newpackedfile)
- sample->packedfile = sound->newpackedfile;
- else
- sample->packedfile = sound_find_packedfile(sound);
- }
-
- return(sample);
-}
-
-
-
-/* find a sample that might already be loaded */
-bSample *sound_find_sample(bSound *sound)
-{
- bSample *sample;
- char name[FILE_MAXDIR + FILE_MAXFILE];
- char samplename[FILE_MAXDIR + FILE_MAXFILE];
-
- // convert sound->name to abolute filename
- strcpy(name, sound->name);
- BLI_convertstringcode(name, G.sce);
-
- /* search through the list of loaded samples */
- sample = samples->first;
- while (sample) {
- strcpy(samplename, sample->name);
- BLI_convertstringcode(samplename, G.sce);
-
- if (strcmp(name, samplename) == 0) {
- break;
- }
- sample = sample->id.next;
- }
-
- return (sample);
-}
-
-
-
-int sound_sample_is_null(bSound *sound)
-{
- int result = FALSE;
- bSample *sample;
-
- if(ghSoundScene==NULL) sound_init_audio();
-
- /* find the right sample or else create one */
- if (sound->sample == NULL) {
- /* find... */
- sample = sound_find_sample(sound);
-
- /* or a new one? */
- if (sample == NULL)
- sample = sound_new_sample(sound);
-
- if (sound_set_sample(sound, sample))
- result = TRUE;
- }
-
- return result;
-}
-
-
-
-void sound_stop_all_sounds(void)
-{
-#if GAMEBLENDER == 1
- if(ghSoundScene) {
- SND_StopAllSounds(ghSoundScene);
- SND_Proceed(ghAudioDeviceInterface, ghSoundScene);
- }
-#endif
-}
-
-
-
-void sound_end_all_sounds(void)
-{
-#if GAMEBLENDER == 1
- bSound *sound;
-
- if(ghSoundScene) {
- for(sound=G.main->sound.first; sound; sound=sound->id.next) {
- if(sound->snd_sound) {
- SND_RemoveSound(ghSoundScene, sound->snd_sound);
- sound->snd_sound = NULL;
- }
- }
-
- sound_stop_all_sounds();
- SND_RemoveAllSounds(ghSoundScene);
- }
-#endif
-}
-
-
-
-void sound_play_sound(bSound *sound)
-{
-#if GAMEBLENDER == 1
- if(ghSoundScene==NULL) sound_init_audio();
-
- /* first check if we want sound or not */
- SND_IsPlaybackWanted(ghSoundScene);
-
- /* stop all previous sounds */
- SND_StopAllSounds(ghSoundScene);
-
- if (sound != NULL && sound->sample != NULL)
- {
- /* load the sample if needed */
- if (sound_load_sample(sound))
- {
- /* set all kinds of parameters */
- SND_SetListenerGain(ghSoundScene, G.listener->gain);
- SND_SetDopplerFactor(ghSoundScene, G.listener->dopplerfactor);
- SND_SetDopplerVelocity(ghSoundScene, G.listener->dopplervelocity);
-
- SND_SetGain((SND_ObjectHandle)sound->snd_sound, (sound->volume));
- SND_SetPitch((SND_ObjectHandle)sound->snd_sound, (exp((sound->pitch / 12.0) * log(2.0))));
-
- if (sound->flags & SOUND_FLAGS_LOOP)
- {
- SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_NORMAL);
-#ifdef SOUND_UNDER_DEVELOPMENT
-/* SND_SetLoopPoints((SND_ObjectHandle)sound->snd_sound, sound->loopstart, sound->loopend);
-*/
-#endif
- if (sound->flags & SOUND_FLAGS_BIDIRECTIONAL_LOOP)
- SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_BIDIRECTIONAL);
- else
- SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_NORMAL);
-
- }
- else
- {
- SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_OFF);
- }
-
- if (sound->flags & SOUND_FLAGS_3D)
- {
- SND_SetRollOffFactor((SND_ObjectHandle)sound->snd_sound, sound->attenuation);
- SND_SetReferenceDistance((SND_ObjectHandle)sound->snd_sound, sound->distance);
- SND_SetMinimumGain((SND_ObjectHandle)sound->snd_sound, sound->min_gain);
- SND_SetMaximumGain((SND_ObjectHandle)sound->snd_sound, sound->max_gain);
- }
- else
- {
- SND_SetRollOffFactor((SND_ObjectHandle)sound->snd_sound, 0);
- SND_SetReferenceDistance((SND_ObjectHandle)sound->snd_sound, 1);
- SND_SetMinimumGain((SND_ObjectHandle)sound->snd_sound, 1);
- SND_SetMaximumGain((SND_ObjectHandle)sound->snd_sound, 1);
- }
-
- if (G.f & G_DEBUG) printf("Set pitch to: %f\n", SND_GetPitch((SND_ObjectHandle)sound->snd_sound));
- if (G.f & G_DEBUG) printf("Set gain to: %f\n", SND_GetGain((SND_ObjectHandle)sound->snd_sound));
- if (G.f & G_DEBUG) printf("Set looping to: %d\n", SND_GetLoopMode((SND_ObjectHandle)sound->snd_sound));
-
- /* play the sound */
- SND_StartSound(ghSoundScene, (SND_ObjectHandle)sound->snd_sound);
-
- /* update the device */
- SND_Proceed(ghAudioDeviceInterface, ghSoundScene);
- }
- }
- else
- {
- if (G.f & G_DEBUG)
- {
- printf("uninitialized sound !\n");
- if (sound)
- {
- printf("sound: %p\n", sound);
- if (sound->sample)
- {
- printf("sample: %p\n", sound->sample);
- if (sound->snd_sound)
- printf("hSoundObject: %p\n", sound->snd_sound);
- }
- }
- else
- {
- printf("sound == NULL\n");
- }
- }
- }
-#endif
-}
-
-
-#if 0
-static bSound *sound_find_sound(char *id_name)
-{
- bSound *sound;
-
- // look for sound with same *id* name
- sound = G.main->sound.first;
- while (sound)
- {
- if (strcmp(sound->id.name + 2, id_name) == 0)
- break;
-
- sound = sound->id.next;
- }
-
- return sound;
-}
-#endif
-
-void sound_init_audio(void)
-{
- int noaudio;
- SYS_SystemHandle hSystem = NULL;
-
- if(ghSoundScene==NULL) {
- hSystem = SYS_GetSystem();
- noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0);
-
- if (noaudio)/*(noaudio) intrr: disable game engine audio (openal) */
- SND_SetDeviceType(snd_e_dummydevice);
-
- ghAudioDeviceInterface = SND_GetAudioDevice();
- ghSoundScene = SND_CreateScene(ghAudioDeviceInterface);
- // also called after read new file, but doesnt work when no audio initialized
- sound_initialize_sounds();
- }
-}
-
-
-int sound_get_mixrate(void)
-{
- return MIXRATE;
-}
-
-
-void sound_exit_audio(void)
-{
- if(ghSoundScene) {
- SND_DeleteScene(ghSoundScene);
- SND_ReleaseDevice();
- ghSoundScene = NULL;
- }
-}
diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c
deleted file mode 100644
index 2c37a0eb20f..00000000000
--- a/source/blender/src/edittime.c
+++ /dev/null
@@ -1,1019 +0,0 @@
-/**
- * $Id: BIF_edittime.c
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_ipo.h"
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_library.h"
-
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_editaction.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "BDR_editobject.h"
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-#include "PIL_time.h"
-
-/* declarations */
-void winqreadtimespace(ScrArea *, void *, BWinEvent *);
-
-/* ************* Marker API **************** */
-
-/* add TimeMarker at curent frame */
-void add_marker(int frame)
-{
- TimeMarker *marker;
-
- /* two markers can't be at the same place */
- for(marker= G.scene->markers.first; marker; marker= marker->next)
- if(marker->frame == frame) return;
- /* deselect all */
- for(marker= G.scene->markers.first; marker; marker= marker->next)
- marker->flag &= ~SELECT;
-
- marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
- marker->flag= SELECT;
- marker->frame= frame;
- BLI_addtail(&(G.scene->markers), marker);
-
- BIF_undo_push("Add Marker");
-}
-
-
-
-/* remove selected TimeMarkers */
-void remove_marker(void)
-{
- TimeMarker *marker, *nmarker;
- short changed= 0;
-
- for(marker= G.scene->markers.first; marker; marker= nmarker) {
- nmarker= marker->next;
- if(marker->flag & SELECT) {
- BLI_freelinkN(&(G.scene->markers), marker);
- changed= 1;
- }
- }
-
- if (changed)
- BIF_undo_push("Remove Marker");
-}
-
-/* rename first selected TimeMarker */
-void rename_marker(void)
-{
- TimeMarker *marker;
- char name[64];
-
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) {
- strcpy(name, marker->name);
- if (sbutton(name, 0, sizeof(name)-1, "Name: "))
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- break;
- }
- }
-
-// BIF_undo_push("Rename Marker");
-}
-
-/* duplicate selected TimeMarkers */
-void duplicate_marker(void)
-{
- TimeMarker *marker, *newmarker;
-
- /* go through the list of markers, duplicate selected markers and add duplicated copies
- * to the begining of the list (unselect original markers) */
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT){
- /* unselect selected marker */
- marker->flag &= ~SELECT;
- /* create and set up new marker */
- newmarker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
- newmarker->flag= SELECT;
- newmarker->frame= marker->frame;
- BLI_strncpy(newmarker->name, marker->name, sizeof(marker->name));
- /* new marker is added to the begining of list */
- BLI_addhead(&(G.scene->markers), newmarker);
- }
- }
-
- transform_markers('g', 0);
-}
-
-void transform_markers(int mode, int smode) // mode and smode unused here, for callback
-{
- SpaceLink *slink= curarea->spacedata.first;
- SpaceTime *stime= curarea->spacedata.first;
- SpaceAction *saction = curarea->spacedata.first;
- ListBase *markers;
- TimeMarker *marker, *selmarker=NULL;
- float dx, fac;
- int a, ret_val= 0, totmark=0, *oldframe, offs, firsttime=1;
- unsigned short event;
- short val, pmval[2], mval[2], mvalo[2];
- char str[32];
-
- /* hack for pose-markers in action editor */
- if ((slink->spacetype == SPACE_ACTION) && (saction->flag & SACTION_POSEMARKERS_MOVE)) {
- if (saction->action)
- markers= &saction->action->markers;
- else
- markers= NULL;
- }
- else
- markers= &G.scene->markers;
-
- for (marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT) totmark++;
- }
- if (totmark==0) return;
-
- oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
- for (a=0, marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT) {
- oldframe[a]= marker->frame;
- selmarker= marker; // used for headerprint
- a++;
- }
- }
-
- dx= G.v2d->mask.xmax-G.v2d->mask.xmin;
- dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/dx;
-
- getmouseco_areawin(pmval);
- mvalo[0]= pmval[0];
-
- while (ret_val == 0) {
- getmouseco_areawin(mval);
-
- if (mval[0] != mvalo[0] || firsttime) {
- mvalo[0]= mval[0];
- firsttime= 0;
-
- fac= (((float)(mval[0] - pmval[0]))*dx);
-
- if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND))
- apply_keyb_grid(&fac, 0.0, FPS, 0.1*FPS, 0);
- else
- apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
- offs= (int)fac;
-
- for (a=0, marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT) {
- marker->frame= oldframe[a] + offs;
- a++;
- }
- }
-
- if (totmark==1) {
- /* we print current marker value */
- if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
- if (stime->flag & TIME_DRAWFRAMES)
- sprintf(str, "Marker %d offset %d", selmarker->frame, offs);
- else
- sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
- }
- else if (slink->spacetype == SPACE_ACTION) {
- if (saction->flag & SACTION_DRAWTIME)
- sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
- else
- sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
- }
- else {
- sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
- }
- }
- else {
- /* we only print the offset */
- if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
- if (stime->flag & TIME_DRAWFRAMES)
- sprintf(str, "Marker offset %d ", offs);
- else
- sprintf(str, "Marker offset %.2f ", FRA2TIME(offs));
- }
- else if (slink->spacetype == SPACE_ACTION) {
- if (saction->flag & SACTION_DRAWTIME)
- sprintf(str, "Marker offset %.2f ", FRA2TIME(offs));
- else
- sprintf(str, "Marker offset %.2f ", (double)(offs));
- }
- else {
- sprintf(str, "Marker offset %.2f ", (double)(offs));
- }
- }
- headerprint(str);
-
- force_draw(0); // areas identical to this, 0 = no header
- }
- else PIL_sleep_ms(10); // idle
-
- /* emptying queue and reading events */
- while ( qtest() ) {
- event= extern_qread(&val);
-
- if (val) {
- if (ELEM(event, ESCKEY, RIGHTMOUSE)) ret_val= 2;
- else if (ELEM3(event, LEFTMOUSE, RETKEY, SPACEKEY)) ret_val= 1;
- }
- }
- }
-
- /* restore? */
- if (ret_val==2) {
- for (a=0, marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT) {
- marker->frame= oldframe[a];
- a++;
- }
- }
- }
- else {
- BIF_undo_push("Move Markers");
- }
- MEM_freeN(oldframe);
- allqueue(REDRAWMARKER, 0);
-}
-
-/* select/deselect all TimeMarkers
- * test - based on current selections?
- * sel - selection status to set all markers to if blanket apply status
- */
-void deselect_markers(short test, short sel)
-{
- TimeMarker *marker;
-
- /* check if need to find out whether to how to select markers */
- if (test) {
- /* dependant on existing selection */
- /* determine if select all or deselect all */
- sel = 1;
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (marker->flag & SELECT) {
- sel = 0;
- break;
- }
- }
-
- /* do selection */
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (sel == 2) {
- marker->flag ^= SELECT;
- }
- else if (sel == 1) {
- if ((marker->flag & SELECT)==0)
- marker->flag |= SELECT;
- }
- else {
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- }
- }
- }
- else {
- /* not dependant on existing selection */
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (sel==2) {
- marker->flag ^= SELECT;
- }
- else if (sel==1) {
- if ((marker->flag & SELECT)==0)
- marker->flag |= SELECT;
- }
- else {
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- }
- }
- }
-}
-
-static void borderselect_markers_func(float xmin, float xmax, int selectmode)
-{
- TimeMarker *marker;
-
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if ((marker->frame > xmin) && (marker->frame <= xmax)) {
- switch (selectmode) {
- case SELECT_ADD:
- if ((marker->flag & SELECT) == 0)
- marker->flag |= SELECT;
- break;
- case SELECT_SUBTRACT:
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- break;
- }
- }
- }
-}
-
-/* border-select markers */
-void borderselect_markers(void)
-{
- rcti rect;
- rctf rectf;
- int val, selectmode;
- short mval[2];
-
- if ( (val = get_border(&rect, 3)) ){
- if (val == LEFTMOUSE)
- selectmode = SELECT_ADD;
- else
- selectmode = SELECT_SUBTRACT;
-
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax-2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- /* do markers */
- borderselect_markers_func(rectf.xmin, rectf.xmax, selectmode);
-
- BIF_undo_push("Border Select Markers");
- allqueue(REDRAWMARKER, 0);
- }
-}
-
-void nextprev_marker(short dir)
-{
- TimeMarker *marker, *cur=NULL, *first, *last;
- int mindist= MAXFRAME, dist;
-
- first= last= G.scene->markers.first;
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- /* find closest to current frame first */
- dist= (marker->frame/G.scene->r.framelen) - CFRA;
- if(dir==1 && dist>0 && dist<mindist) {
- mindist= dist;
- cur= marker;
- }
- else if(dir==-1 && dist<0 && -dist<mindist) {
- mindist= -dist;
- cur= marker;
- }
- /* find first/last */
- if(marker->frame > last->frame) last= marker;
- if(marker->frame < first->frame) first= marker;
- }
-
- if(cur==NULL) {
- if(dir==1) cur= first;
- else cur= last;
- }
- if(cur) {
- CFRA= cur->frame/G.scene->r.framelen;
- update_for_newframe();
- allqueue(REDRAWALL, 0);
- }
-}
-
-void get_minmax_markers(short sel, float *first, float *last)
-{
- TimeMarker *marker;
- ListBase *markers;
- float min, max;
- int selcount = 0;
-
- markers= &(G.scene->markers);
-
- if (sel)
- for (marker= markers->first; marker; marker= marker->next) {
- if (marker->flag & SELECT)
- selcount++;
- }
- else {
- selcount= BLI_countlist(markers);
- }
-
- if (markers->first && markers->last) {
- min= ((TimeMarker *)markers->first)->frame;
- max= ((TimeMarker *)markers->last)->frame;
- }
- else {
- *first = 0.0f;
- *last = 0.0f;
- return;
- }
-
- if (selcount > 1) {
- for (marker= markers->first; marker; marker= marker->next) {
- if (sel) {
- if (marker->flag & SELECT) {
- if (marker->frame < min)
- min= marker->frame;
- else if (marker->frame > max)
- max= marker->frame;
- }
- }
- else {
- if (marker->frame < min)
- min= marker->frame;
- else if (marker->frame > max)
- max= marker->frame;
- }
- }
- }
-
- *first= min;
- *last= max;
-}
-
-TimeMarker *find_nearest_marker(ListBase *markers, int clip_y)
-{
- TimeMarker *marker;
- float xmin, xmax;
- rctf rectf;
- short mval[2];
-
- getmouseco_areawin (mval);
-
- /* first clip selection in Y */
- if ((clip_y) && (mval[1] > 30))
- return NULL;
-
- mval[0]-=7;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]+=14;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- xmin= rectf.xmin;
- xmax= rectf.xmax;
-
- for (marker= markers->first; marker; marker= marker->next) {
- if ((marker->frame > xmin) && (marker->frame <= xmax)) {
- return marker;
- }
- }
-
- return NULL;
-}
-
-/* Adds a marker to list of cfra elems */
-void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
-{
- CfraElem *ce, *cen;
-
- /* should this one only be considered if it is selected? */
- if ((only_sel) && ((marker->flag & SELECT)==0))
- return;
-
- /* try to find a previous cfra elem */
- ce= lb->first;
- while(ce) {
-
- if( ce->cfra==marker->frame ) {
- /* do because of double keys */
- if(marker->flag & SELECT) ce->sel= marker->flag;
- return;
- }
- else if(ce->cfra > marker->frame) break;
-
- ce= ce->next;
- }
-
- cen= MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem");
- if(ce) BLI_insertlinkbefore(lb, ce, cen);
- else BLI_addtail(lb, cen);
-
- cen->cfra= marker->frame;
- cen->sel= marker->flag;
-}
-
-/* This function makes a list of all the markers. The only_sel
- * argument is used to specify whether only the selected markers
- * are added.
- */
-void make_marker_cfra_list(ListBase *lb, short only_sel)
-{
- TimeMarker *marker;
-
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- add_marker_to_cfra_elem(lb, marker, only_sel);
- }
-}
-
-int find_nearest_marker_time(float dx)
-{
- TimeMarker *marker, *nearest= NULL;
- float dist, min_dist= 1000000;
-
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- dist = ABS((float)marker->frame - dx);
- if(dist < min_dist){
- min_dist= dist;
- nearest= marker;
- }
- }
-
- if(nearest) return nearest->frame;
- else return (int)floor(dx);
-}
-
-/* *********** End Markers - Markers API *************** */
-/* select/deselect TimeMarker at current frame */
-static void select_timeline_marker_frame(int frame, unsigned char shift)
-{
- TimeMarker *marker;
- int select=0;
-
- for(marker= G.scene->markers.first; marker; marker= marker->next) {
- /* if Shift is not set, then deselect Markers */
- if(!shift) marker->flag &= ~SELECT;
- /* this way a not-shift select will allways give 1 selected marker */
- if((marker->frame == frame) && (!select)) {
- if(marker->flag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- select = 1;
- }
- }
-}
-
-/* *********** end Markers - TimeLine *************** */
-
-/* set the animation preview range of scene */
-void anim_previewrange_set()
-{
- rcti rect;
- rctf rectf;
- short val, mval[2];
-
- /* set range by drawing border-select rectangle */
- if ( (val = get_border(&rect, 5)) ) {
- /* get frame numbers */
- mval[0]= rect.xmin;
- mval[1]= rect.ymin+2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax-2;
- areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
-
- /* set preview-range */
- if (rectf.xmin < 1) rectf.xmin = 1.0f;
- if (rectf.xmax < 1) rectf.xmax = 1.0f;
- G.scene->r.psfra= rectf.xmin;
- G.scene->r.pefra= rectf.xmax;
-
- BIF_undo_push("Set anim-preview range");
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSALL, 0);
- }
-}
-
-/* clear the animation preview range for scene */
-void anim_previewrange_clear()
-{
- G.scene->r.psfra = 0;
- G.scene->r.pefra = 0;
-
- BIF_undo_push("Clear anim-preview range");
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSALL, 0);
-}
-
-/* ************ end Animation Preview Range ********** */
-
-
-static int float_to_frame(float frame)
-{
- int to= (int) floor(0.5 + frame/G.scene->r.framelen );
-
- return to;
-}
-
-static float find_closest_cfra_elem(ListBase elems, int dir, float closest)
-{
- CfraElem *ce;
-
- for(ce= elems.first; ce; ce= ce->next) {
- if (dir==-1) {
- if( float_to_frame(ce->cfra)<CFRA) {
- if ((ce->cfra > closest) || (closest == CFRA)) {
- closest= ce->cfra;
- }
- }
- }
- else {
- if(float_to_frame(ce->cfra)>CFRA) {
- if ((ce->cfra < closest) || (closest == CFRA)) {
- closest= ce->cfra;
- }
- }
- }
- }
- return closest;
-}
-
-void nextprev_timeline_key(short dir)
-{
- /*mostly copied from drawobject.c, draw_object() AND editipo.c, movekey_obipo() */
- Object *ob;
- bActionChannel *achan;
- bAction *act;
- ListBase elems;
- float closest= CFRA;
- int a;
-
- if (OBACT) {
- ob = OBACT;
-
- if(ob) {
- if(ob!=G.obedit) {
- if(ob->ipo) {
- /* convert the ipo to a list of 'current frame elements' */
-
- elems.first= elems.last= NULL;
- make_cfra_list(ob->ipo, &elems);
-
- closest= find_closest_cfra_elem(elems, dir, closest);
-
- BLI_freelistN(&elems);
- }
-
- if(ob->action) {
- act = ob->action;
- /* go through each channel in the action */
- for (achan=act->chanbase.first; achan; achan=achan->next){
- /* convert the ipo to a list of 'current frame elements' */
-
- if(achan->ipo) {
- elems.first= elems.last= NULL;
- make_cfra_list(achan->ipo, &elems);
-
- closest= find_closest_cfra_elem(elems, dir, closest);
-
- BLI_freelistN(&elems);
- }
- }
- }
-
- for(a=0; a<ob->totcol; a++) {
- Material *ma= give_current_material(ob, a+1);
- if(ma && ma->ipo) {
- elems.first= elems.last= NULL;
- make_cfra_list(ma->ipo, &elems);
-
- closest= find_closest_cfra_elem(elems, dir, closest);
-
- BLI_freelistN(&elems);
- }
- }
- }
- }
-
- a= float_to_frame(closest);
-
- if (a!=CFRA) {
- CFRA= a;
- update_for_newframe();
- }
-
- BIF_undo_push("Next/Prev Key");
- allqueue(REDRAWALL, 0);
- }
-}
-
-/* return the current marker for this frame,
-we can have more then 1 marker per frame, this just returns the first :/ */
-TimeMarker *get_frame_marker(int frame)
-{
- TimeMarker *marker, *best_marker = NULL;
- int best_frame = -MAXFRAME*2;
- for (marker= G.scene->markers.first; marker; marker= marker->next) {
- if (marker->frame==frame) {
- return marker;
- }
-
- if ( marker->frame > best_frame && marker->frame < frame) {
- best_marker = marker;
- best_frame = marker->frame;
- }
- }
-
- return best_marker;
-}
-
-
-void timeline_frame_to_center(void)
-{
- float dtime;
-
- dtime= CFRA*(G.scene->r.framelen) - (G.v2d->cur.xmin + G.v2d->cur.xmax)/2.0;
- G.v2d->cur.xmin += dtime;
- G.v2d->cur.xmax += dtime;
- scrarea_queue_winredraw(curarea);
-}
-
-/* copy of this is actually in editscreen.c, but event based */
-static void timeline_force_draw(short val)
-{
- ScrArea *sa, *tempsa, *samin= NULL;
- int dodraw;
-
- if(val & TIME_LEFTMOST_3D_WIN) {
- ScrArea *sa= G.curscreen->areabase.first;
- int min= 10000;
- for(; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_VIEW3D) {
- if(sa->winrct.xmin - sa->winrct.ymin < min) {
- samin= sa;
- min= sa->winrct.xmin - sa->winrct.ymin;
- }
- }
- }
- }
-
- tempsa= curarea;
- sa= G.curscreen->areabase.first;
- while(sa) {
- dodraw= 0;
- if(sa->spacetype==SPACE_VIEW3D) {
- if(sa==samin || (val & TIME_ALL_3D_WIN)) dodraw= 1;
- }
- else if(ELEM5(sa->spacetype, SPACE_NLA, SPACE_IPO, SPACE_SEQ, SPACE_ACTION, SPACE_SOUND)) {
- if(val & TIME_ALL_ANIM_WIN) dodraw= 1;
- }
- else if(sa->spacetype==SPACE_BUTS) {
- if(val & TIME_ALL_BUTS_WIN) dodraw= 2;
- }
- else if(sa->spacetype==SPACE_IMAGE) {
- if (val & TIME_ALL_IMAGE_WIN) dodraw = 1;
- }
- else if(sa->spacetype==SPACE_SEQ) {
- if (val & TIME_SEQ) dodraw = 1;
- }
- else if(sa->spacetype==SPACE_TIME) dodraw= 2;
-
- if(dodraw) {
- areawinset(sa->win);
- scrarea_do_windraw(sa);
- if(dodraw==2) scrarea_do_headdraw(sa);
- }
- sa= sa->next;
- }
- areawinset(tempsa->win);
-
- screen_swapbuffers();
-
-}
-
-/* ***************************** */
-
-/* Right. Now for some implementation: */
-void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- SpaceTime *stime= spacedata;
- unsigned short event= evt->event;
- short val= evt->val;
- float dx, dy;
- int doredraw= 0, cfra, first = 0;
- short mval[2], nr;
- short mousebut = L_MOUSE;
-
- if(sa->win==0) return;
-
- if(val) {
-
- if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- switch(event) {
- case LEFTMOUSE:
- stime->flag |= TIME_CFRA_NUM;
- do {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- cfra = (int)(dx+0.5f);
- if(cfra< MINFRAME) cfra= MINFRAME;
-
- if( cfra!=CFRA || first )
- {
- first= 0;
- CFRA= cfra;
- update_for_newframe_nodraw(0); // 1= nosound
- timeline_force_draw(stime->redraws);
- }
- else PIL_sleep_ms(30);
-
- } while(get_mbut() & mousebut);
-
- stime->flag &= ~TIME_CFRA_NUM;
- allqueue(REDRAWALL, 0);
- break;
-
- case RIGHTMOUSE: /* select/deselect marker */
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
-
- cfra= find_nearest_marker_time(dx);
-
- if (G.qual && LR_SHIFTKEY)
- select_timeline_marker_frame(cfra, 1);
- else
- select_timeline_marker_frame(cfra, 0);
-
- force_draw(0);
- std_rmouse_transform(transform_markers);
-
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- case PADPLUSKEY:
- dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case PADMINUS:
- dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin));
- G.v2d->cur.xmin-= dx;
- G.v2d->cur.xmax+= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- doredraw= 1;
- break;
- case HOMEKEY:
- first= G.scene->r.sfra;
- if(first >= G.scene->r.efra) first= G.scene->r.efra;
- G.v2d->cur.xmin=G.v2d->tot.xmin= (float)first-2;
- G.v2d->cur.xmax=G.v2d->tot.xmax= (float)G.scene->r.efra+2;
- doredraw= 1;
- break;
-
- case PAGEUPKEY: /* next keyframe */
- if(G.qual==LR_CTRLKEY)
- nextprev_timeline_key(1);
- else
- nextprev_marker(1);
- break;
- case PAGEDOWNKEY: /* prev keyframe */
- if(G.qual==LR_CTRLKEY)
- nextprev_timeline_key(-1);
- else
- nextprev_marker(-1);
- break;
-
- case AKEY:
- /* deselect all TimeMarkers */
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- break;
- case BKEY:
- /* borderselect markers */
- borderselect_markers();
- break;
- case DKEY:
- if(G.qual==LR_SHIFTKEY)
- duplicate_marker();
- break;
- case CKEY:
- timeline_frame_to_center();
- break;
- case GKEY: /* move marker */
- transform_markers('g', 0);
- break;
- case EKEY: /* set end frame */
- if (G.scene->r.psfra) {
- if (CFRA < G.scene->r.psfra)
- G.scene->r.psfra= CFRA;
- G.scene->r.pefra= CFRA;
- }
- else
- G.scene->r.efra = CFRA;
- allqueue(REDRAWALL, 1);
- break;
- case MKEY: /* add, rename marker */
- if (G.qual & LR_CTRLKEY)
- rename_marker();
- else
- add_marker(CFRA);
- allqueue(REDRAWMARKER, 0);
- break;
- case PKEY: /* preview-range stuff */
- if (G.qual & LR_CTRLKEY) /* set preview range */
- anim_previewrange_set();
- else if (G.qual & LR_ALTKEY) /* clear preview range */
- anim_previewrange_clear();
- break;
- case SKEY: /* set start frame */
- if (G.scene->r.psfra) {
- if (G.scene->r.pefra < CFRA)
- G.scene->r.pefra= CFRA;
- G.scene->r.psfra= CFRA;
- }
- else
- G.scene->r.sfra = CFRA;
- allqueue(REDRAWALL, 1);
- break;
- case TKEY: /* popup menu */
- nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
- if (nr>0) {
- if(nr==1) stime->flag |= TIME_DRAWFRAMES;
- else stime->flag &= ~TIME_DRAWFRAMES;
- doredraw= 1;
- }
- break;
- case DELKEY:
- case XKEY:
- if( okee("Erase selected")==0 ) break;
-
- remove_marker();
- allqueue(REDRAWMARKER, 0);
- break;
- }
- }
-
- if(doredraw)
- scrarea_queue_winredraw(sa);
-}
-
-
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
deleted file mode 100644
index f95b56fe5b0..00000000000
--- a/source/blender/src/editview.c
+++ /dev/null
@@ -1,2914 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * cursor/gestures/selecteren
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "IMB_imbuf.h"
-#include "PIL_time.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_group_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_ipo_types.h" /* for fly mode recording */
-#include "DNA_node_types.h" /* for fly mode recording */
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_rand.h" /* random object selection */
-
-#include "BKE_armature.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_lattice.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_object.h" /* fly mode where_is_object to get camera location */
-#include "BKE_particle.h"
-#include "BKE_utildefines.h"
-#include "BKE_customdata.h"
-
-#include "BIF_drawimage.h"
-#include "BIF_butspace.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editparticle.h"
-#include "BIF_editgroup.h"
-#include "BIF_editmesh.h"
-#include "BIF_editoops.h"
-#include "BIF_editsima.h"
-#include "BIF_editview.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h" /* use only so fly mode can preview when its done */
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_editobject.h" /* For headerprint */
-#include "BDR_sculptmode.h"
-#include "BDR_vpaint.h"
-#include "BDR_editface.h"
-#include "BDR_drawobject.h"
-#include "BDR_editcurve.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h" /* give_cursor() */
-#include "BSE_editipo.h"
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-
-#include "editmesh.h" /* borderselect uses it... */
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "BIF_transform.h"
-#include "BIF_toets.h" /* persptoetsen */
-
-extern ListBase editNurb; /* originally from exports.h, memory from editcurve.c*/
-/* editmball.c */
-extern ListBase editelems;
-
-/* fly mode uses this */
-extern void setcameratoview3d(void);
-
-/* local prototypes */
-
-void EM_backbuf_checkAndSelectVerts(EditMesh *em, int select)
-{
- EditVert *eve;
- int index= em_wireoffs;
-
- for(eve= em->verts.first; eve; eve= eve->next, index++) {
- if(eve->h==0) {
- if(EM_check_backbuf(index)) {
- eve->f = select?(eve->f|1):(eve->f&~1);
- }
- }
- }
-}
-
-void EM_backbuf_checkAndSelectEdges(EditMesh *em, int select)
-{
- EditEdge *eed;
- int index= em_solidoffs;
-
- for(eed= em->edges.first; eed; eed= eed->next, index++) {
- if(eed->h==0) {
- if(EM_check_backbuf(index)) {
- EM_select_edge(eed, select);
- }
- }
- }
-}
-
-void EM_backbuf_checkAndSelectFaces(EditMesh *em, int select)
-{
- EditFace *efa;
- int index= 1;
-
- for(efa= em->faces.first; efa; efa= efa->next, index++) {
- if(efa->h==0) {
- if(EM_check_backbuf(index)) {
- EM_select_face_fgon(efa, select);
- }
- }
- }
-}
-
-void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select)
-{
- MFace *mface = me->mface;
- int a;
-
- if (mface) {
- for(a=1; a<=me->totface; a++, mface++) {
- if(EM_check_backbuf(a)) {
- mface->flag = select?(mface->flag|ME_FACE_SEL):(mface->flag&~ME_FACE_SEL);
- }
- }
- }
-}
-
-void arrows_move_cursor(unsigned short event)
-{
- short mval[2];
-
- getmouseco_sc(mval);
-
- if(event==UPARROWKEY) {
- warp_pointer(mval[0], mval[1]+1);
- } else if(event==DOWNARROWKEY) {
- warp_pointer(mval[0], mval[1]-1);
- } else if(event==LEFTARROWKEY) {
- warp_pointer(mval[0]-1, mval[1]);
- } else if(event==RIGHTARROWKEY) {
- warp_pointer(mval[0]+1, mval[1]);
- }
-}
-
-/* simple API for object selection, rather than just using the flag
- * this takes into account the 'restrict selection in 3d view' flag.
- * deselect works always, the restriction just prevents selection */
-void select_base_v3d(Base *base, short mode)
-{
- if (base) {
- if (mode==BA_SELECT) {
- if (!(base->object->restrictflag & OB_RESTRICT_SELECT))
- if (mode==BA_SELECT) base->flag |= SELECT;
- }
- else if (mode==BA_DESELECT) {
- base->flag &= ~SELECT;
- }
- }
-}
-
-/* *********************** GESTURE AND LASSO ******************* */
-
-/* helper also for borderselect */
-static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
-{
- return BLI_in_rcti(rect, x1, y1) && BLI_in_rcti(rect, x2, y2);
-}
-
-static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
-{
- int d1, d2, d3, d4;
-
- /* check points in rect */
- if(edge_fully_inside_rect(rect, x1, y1, x2, y2)) return 1;
-
- /* check points completely out rect */
- if(x1<rect->xmin && x2<rect->xmin) return 0;
- if(x1>rect->xmax && x2>rect->xmax) return 0;
- if(y1<rect->ymin && y2<rect->ymin) return 0;
- if(y1>rect->ymax && y2>rect->ymax) return 0;
-
- /* simple check lines intersecting. */
- d1= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymin );
- d2= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymax );
- d3= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymax );
- d4= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymin );
-
- if(d1<0 && d2<0 && d3<0 && d4<0) return 0;
- if(d1>0 && d2>0 && d3>0 && d4>0) return 0;
-
- return 1;
-}
-
-
-#define MOVES_GESTURE 50
-#define MOVES_LASSO 500
-
-int lasso_inside(short mcords[][2], short moves, short sx, short sy)
-{
- /* we do the angle rule, define that all added angles should be about zero or 2*PI */
- float angletot=0.0, len, dot, ang, cross, fp1[2], fp2[2];
- int a;
- short *p1, *p2;
-
- if(sx==IS_CLIPPED)
- return 0;
-
- p1= mcords[moves-1];
- p2= mcords[0];
-
- /* first vector */
- fp1[0]= (float)(p1[0]-sx);
- fp1[1]= (float)(p1[1]-sy);
- len= sqrt(fp1[0]*fp1[0] + fp1[1]*fp1[1]);
- fp1[0]/= len;
- fp1[1]/= len;
-
- for(a=0; a<moves; a++) {
- /* second vector */
- fp2[0]= (float)(p2[0]-sx);
- fp2[1]= (float)(p2[1]-sy);
- len= sqrt(fp2[0]*fp2[0] + fp2[1]*fp2[1]);
- fp2[0]/= len;
- fp2[1]/= len;
-
- /* dot and angle and cross */
- dot= fp1[0]*fp2[0] + fp1[1]*fp2[1];
- ang= fabs(saacos(dot));
-
- cross= (float)((p1[1]-p2[1])*(p1[0]-sx) + (p2[0]-p1[0])*(p1[1]-sy));
-
- if(cross<0.0) angletot-= ang;
- else angletot+= ang;
-
- /* circulate */
- fp1[0]= fp2[0]; fp1[1]= fp2[1];
- p1= p2;
- p2= mcords[a+1];
- }
-
- if( fabs(angletot) > 4.0 ) return 1;
- return 0;
-}
-
-/* edge version for lasso select. we assume boundbox check was done */
-int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1)
-{
- short v1[2], v2[2];
- int a;
-
- if(x0==IS_CLIPPED || x1==IS_CLIPPED)
- return 0;
-
- v1[0] = x0, v1[1] = y0;
- v2[0] = x1, v2[1] = y1;
-
- /* check points in lasso */
- if(lasso_inside(mcords, moves, v1[0], v1[1])) return 1;
- if(lasso_inside(mcords, moves, v2[0], v2[1])) return 1;
-
- /* no points in lasso, so we have to intersect with lasso edge */
-
- if( IsectLL2Ds(mcords[0], mcords[moves-1], v1, v2) > 0) return 1;
- for(a=0; a<moves-1; a++) {
- if( IsectLL2Ds(mcords[a], mcords[a+1], v1, v2) > 0) return 1;
- }
-
- return 0;
-}
-
-
-/* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN)
- and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK
-*/
-static void do_lasso_select_pose(Object *ob, short mcords[][2], short moves, short select)
-{
- bPoseChannel *pchan;
- float vec[3];
- short sco1[2], sco2[2];
-
- if(ob->type!=OB_ARMATURE || ob->pose==NULL) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- VECCOPY(vec, pchan->pose_head);
- Mat4MulVecfl(ob->obmat, vec);
- project_short(vec, sco1);
- VECCOPY(vec, pchan->pose_tail);
- Mat4MulVecfl(ob->obmat, vec);
- project_short(vec, sco2);
-
- if(lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
- if(select) pchan->bone->flag |= BONE_SELECTED;
- else pchan->bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED);
- }
- }
-}
-
-
-static void do_lasso_select_objects(short mcords[][2], short moves, short select)
-{
- Base *base;
-
- for(base= G.scene->base.first; base; base= base->next) {
- if(base->lay & G.vd->lay) {
- project_short(base->object->obmat[3], &base->sx);
- if(lasso_inside(mcords, moves, base->sx, base->sy)) {
-
- if(select) select_base_v3d(base, BA_SELECT);
- else select_base_v3d(base, BA_DESELECT);
- base->object->flag= base->flag;
- }
- if(base->object->flag & OB_POSEMODE) {
- do_lasso_select_pose(base->object, mcords, moves, select);
- }
- }
- }
-}
-
-void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves)
-{
- short a;
-
- rect->xmin= rect->xmax= mcords[0][0];
- rect->ymin= rect->ymax= mcords[0][1];
-
- for(a=1; a<moves; a++) {
- if(mcords[a][0]<rect->xmin) rect->xmin= mcords[a][0];
- else if(mcords[a][0]>rect->xmax) rect->xmax= mcords[a][0];
- if(mcords[a][1]<rect->ymin) rect->ymin= mcords[a][1];
- else if(mcords[a][1]>rect->ymax) rect->ymax= mcords[a][1];
- }
-}
-
-static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
-{
- struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
- eve->f = data->select?(eve->f|1):(eve->f&~1);
- }
-}
-static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
-{
- struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData;
-
- if (EM_check_backbuf(em_solidoffs+index)) {
- if (data->pass==0) {
- if ( edge_fully_inside_rect(data->rect, x0, y0, x1, y1) &&
- lasso_inside(data->mcords, data->moves, x0, y0) &&
- lasso_inside(data->mcords, data->moves, x1, y1)) {
- EM_select_edge(eed, data->select);
- data->done = 1;
- }
- } else {
- if (lasso_inside_edge(data->mcords, data->moves, x0, y0, x1, y1)) {
- EM_select_edge(eed, data->select);
- }
- }
- }
-}
-static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
-{
- struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
- EM_select_face_fgon(efa, data->select);
- }
-}
-
-static void do_lasso_select_mesh(short mcords[][2], short moves, short select)
-{
- struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } data;
- EditMesh *em = G.editMesh;
- rcti rect;
- int bbsel;
-
- lasso_select_boundbox(&rect, mcords, moves);
-
- data.rect = &rect;
- data.mcords = mcords;
- data.moves = moves;
- data.select = select;
- data.done = 0;
- data.pass = 0;
-
- bbsel= EM_mask_init_backbuf_border(mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if (bbsel) {
- EM_backbuf_checkAndSelectVerts(em, select);
- } else {
- mesh_foreachScreenVert(do_lasso_select_mesh__doSelectVert, &data, 1);
- }
- }
- if(G.scene->selectmode & SCE_SELECT_EDGE) {
- /* Does both bbsel and non-bbsel versions (need screen cos for both) */
-
- data.pass = 0;
- mesh_foreachScreenEdge(do_lasso_select_mesh__doSelectEdge, &data, 0);
-
- if (data.done==0) {
- data.pass = 1;
- mesh_foreachScreenEdge(do_lasso_select_mesh__doSelectEdge, &data, 0);
- }
- }
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- if (bbsel) {
- EM_backbuf_checkAndSelectFaces(em, select);
- } else {
- mesh_foreachScreenFace(do_lasso_select_mesh__doSelectFace, &data);
- }
- }
-
- EM_free_backbuf();
- EM_selectmode_flush();
-}
-
-/* this is an exception in that its the only lasso that dosnt use the 3d view (uses space image view) */
-static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
- MTFace *tf;
- int screenUV[2], nverts, i, ok = 1;
- rcti rect;
-
- lasso_select_boundbox(&rect, mcords, moves);
-
- if (draw_uvs_face_check()) { /* Face Center Sel */
- float cent[2];
- ok = 0;
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* assume not touched */
- efa->tmp.l = 0;
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if ((select) != (simaFaceSel_Check(efa, tf))) {
- uv_center(tf->uv, cent, (void *)efa->v4);
- uvco_to_areaco_noclip(cent, screenUV);
- if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) {
- efa->tmp.l = ok = 1;
- }
- }
- }
- /* (de)selects all tagged faces and deals with sticky modes */
- if (ok)
- uvface_setsel__internal(select);
-
- } else { /* Vert Sel*/
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- nverts= efa->v4? 4: 3;
- for(i=0; i<nverts; i++) {
- if ((select) != (simaUVSel_Check(efa, tf, i))) {
- uvco_to_areaco_noclip(tf->uv[i], screenUV);
- if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) {
- if (select) {
- simaUVSel_Set(efa, tf, i);
- } else {
- simaUVSel_UnSet(efa, tf, i);
- }
- }
- }
- }
- }
- }
- }
- if (ok && G.sima->flag & SI_SYNC_UVSEL) {
- if (select) EM_select_flush();
- else EM_deselect_flush();
- }
-}
-
-static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
-{
- struct { short (*mcords)[2]; short moves; short select; } *data = userData;
-
- if (lasso_inside(data->mcords, data->moves, x, y)) {
- if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- } else {
- if (G.f & G_HIDDENHANDLES) {
- /* can only be beztindex==0 here since handles are hidden */
- bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
- } else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
- } else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
- } else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
- }
- }
- }
- }
-}
-static void do_lasso_select_curve(short mcords[][2], short moves, short select)
-{
- struct { short (*mcords)[2]; short moves; short select; } data;
-
- data.mcords = mcords;
- data.moves = moves;
- data.select = select;
-
- nurbs_foreachScreenVert(do_lasso_select_curve__doSelect, &data);
-}
-
-static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x, int y)
-{
- struct { short (*mcords)[2]; short moves; short select; } *data = userData;
-
- if (lasso_inside(data->mcords, data->moves, x, y)) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- }
-}
-static void do_lasso_select_lattice(short mcords[][2], short moves, short select)
-{
- struct { short (*mcords)[2]; short moves; short select; } data;
-
- data.mcords = mcords;
- data.moves = moves;
- data.select = select;
-
- lattice_foreachScreenVert(do_lasso_select_lattice__doSelect, &data);
-}
-
-static void do_lasso_select_armature(short mcords[][2], short moves, short select)
-{
- EditBone *ebone;
- float vec[3];
- short sco1[2], sco2[2], didpoint;
-
- for (ebone=G.edbo.first; ebone; ebone=ebone->next) {
-
- VECCOPY(vec, ebone->head);
- Mat4MulVecfl(G.obedit->obmat, vec);
- project_short(vec, sco1);
- VECCOPY(vec, ebone->tail);
- Mat4MulVecfl(G.obedit->obmat, vec);
- project_short(vec, sco2);
-
- didpoint= 0;
- if(lasso_inside(mcords, moves, sco1[0], sco1[1])) {
- if(select) ebone->flag |= BONE_ROOTSEL;
- else ebone->flag &= ~BONE_ROOTSEL;
- didpoint= 1;
- }
- if(lasso_inside(mcords, moves, sco2[0], sco2[1])) {
- if(select) ebone->flag |= BONE_TIPSEL;
- else ebone->flag &= ~BONE_TIPSEL;
- didpoint= 1;
- }
- /* if one of points selected, we skip the bone itself */
- if(didpoint==0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) {
- if(select) ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED;
- else ebone->flag &= ~(BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
- }
- }
- countall(); /* abused for flushing selection */
-}
-
-static void do_lasso_select_facemode(short mcords[][2], short moves, short select)
-{
- Mesh *me;
- rcti rect;
-
- me= get_mesh(OBACT);
- if(me==NULL || me->mtface==NULL) return;
- if(me->totface==0) return;
-
- em_vertoffs= me->totface+1; /* max index array */
-
- lasso_select_boundbox(&rect, mcords, moves);
- EM_mask_init_backbuf_border(mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
-
- EM_backbuf_checkAndSelectTFaces(me, select);
-
- EM_free_backbuf();
-
- object_tface_flags_changed(OBACT, 0);
-}
-
-static void do_lasso_select_node(short mcords[][2], short moves, short select)
-{
- SpaceNode *snode = curarea->spacedata.first;
-
- bNode *node;
- rcti rect;
- short node_cent[2];
- float node_centf[2];
-
- lasso_select_boundbox(&rect, mcords, moves);
-
- /* store selection in temp test flag */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
-
- node_centf[0] = (node->totr.xmin+node->totr.xmax)/2;
- node_centf[1] = (node->totr.ymin+node->totr.ymax)/2;
-
- ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent);
- if (BLI_in_rcti(&rect, node_cent[0], node_cent[1]) && lasso_inside(mcords, moves, node_cent[0], node_cent[1])) {
- if (select) {
- node->flag |= SELECT;
- } else {
- node->flag &= ~SELECT;
- }
- }
- }
- allqueue(REDRAWNODE, 1);
- BIF_undo_push("Lasso select nodes");
-}
-
-static void do_lasso_select(short mcords[][2], short moves, short select)
-{
- if(curarea->spacetype==SPACE_NODE) {
- do_lasso_select_node(mcords, moves, select);
- } else {
- if(G.obedit==NULL) {
- if(FACESEL_PAINT_TEST)
- do_lasso_select_facemode(mcords, moves, select);
- else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))
- ;
- else if(G.f & G_PARTICLEEDIT)
- PE_do_lasso_select(mcords, moves, select);
- else
- do_lasso_select_objects(mcords, moves, select);
- }
- else if(G.obedit->type==OB_MESH) {
- if(curarea->spacetype==SPACE_VIEW3D) {
- do_lasso_select_mesh(mcords, moves, select);
- } else if (EM_texFaceCheck()){
- do_lasso_select_mesh_uv(mcords, moves, select);
- }
- } else if(G.obedit->type==OB_CURVE || G.obedit->type==OB_SURF)
- do_lasso_select_curve(mcords, moves, select);
- else if(G.obedit->type==OB_LATTICE)
- do_lasso_select_lattice(mcords, moves, select);
- else if(G.obedit->type==OB_ARMATURE)
- do_lasso_select_armature(mcords, moves, select);
- }
- BIF_undo_push("Lasso select");
-
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- allqueue(REDRAWVIEW3D, 0);
- countall();
-}
-
-/* un-draws and draws again */
-static void draw_lasso_select(short mcords[][2], short moves, short end)
-{
- int a;
-
- setlinestyle(2);
- /* clear draw */
- if(moves>1) {
- for(a=1; a<=moves-1; a++) {
- sdrawXORline(mcords[a-1][0], mcords[a-1][1], mcords[a][0], mcords[a][1]);
- }
- sdrawXORline(mcords[moves-1][0], mcords[moves-1][1], mcords[0][0], mcords[0][1]);
- }
- if(!end) {
- /* new draw */
- for(a=1; a<=moves; a++) {
- sdrawXORline(mcords[a-1][0], mcords[a-1][1], mcords[a][0], mcords[a][1]);
- }
- sdrawXORline(mcords[moves][0], mcords[moves][1], mcords[0][0], mcords[0][1]);
- }
- setlinestyle(0);
-}
-
-
-static char interpret_move(short mcord[][2], int count)
-{
- float x1, x2, y1, y2, d1, d2, inp, sq, mouse[MOVES_GESTURE][2];
- int i, j, dir = 0;
-
- if (count <= 10) return ('g');
-
- /* from short to float (drawing is with shorts) */
- for(j=0; j<count; j++) {
- mouse[j][0]= mcord[j][0];
- mouse[j][1]= mcord[j][1];
- }
-
- /* new method:
- *
- * starting from end points, calculate center with maximum distance
- * dependant at the angle s / g / r is defined
- */
-
-
- /* filter */
-
- for( j = 3 ; j > 0; j--){
- x1 = mouse[1][0];
- y1 = mouse[1][1];
- for (i = 2; i < count; i++){
- x2 = mouse[i-1][0];
- y2 = mouse[i-1][1];
- mouse[i-1][0] = ((x1 + mouse[i][0]) /4.0) + (x2 / 2.0);
- mouse[i-1][1] = ((y1 + mouse[i][1]) /4.0) + (y2 / 2.0);
- x1 = x2;
- y1 = y2;
- }
- }
-
- /* make overview of directions */
- for (i = 0; i <= count - 2; i++){
- x1 = mouse[i][0] - mouse[i + 1][0];
- y1 = mouse[i][1] - mouse[i + 1][1];
-
- if (x1 < -0.5){
- if (y1 < -0.5) dir |= 32;
- else if (y1 > 0.5) dir |= 128;
- else dir |= 64;
- } else if (x1 > 0.5){
- if (y1 < -0.5) dir |= 8;
- else if (y1 > 0.5) dir |= 2;
- else dir |= 4;
- } else{
- if (y1 < -0.5) dir |= 16;
- else if (y1 > 0.5) dir |= 1;
- else dir |= 0;
- }
- }
-
- /* move all crosses to the right */
- for (i = 7; i>=0 ; i--){
- if (dir & 128) dir = (dir << 1) + 1;
- else break;
- }
- dir &= 255;
- for (i = 7; i>=0 ; i--){
- if ((dir & 1) == 0) dir >>= 1;
- else break;
- }
-
- /* in theory: 1 direction: straight line
- * multiple sequential directions: circle
- * non-sequential, and 1 bit set in upper 4 bits: size
- */
- switch(dir){
- case 1:
- return ('g');
- break;
- case 3:
- case 7:
- x1 = mouse[0][0] - mouse[count >> 1][0];
- y1 = mouse[0][1] - mouse[count >> 1][1];
- x2 = mouse[count >> 1][0] - mouse[count - 1][0];
- y2 = mouse[count >> 1][1] - mouse[count - 1][1];
- d1 = (x1 * x1) + (y1 * y1);
- d2 = (x2 * x2) + (y2 * y2);
- sq = sqrt(d1);
- x1 /= sq;
- y1 /= sq;
- sq = sqrt(d2);
- x2 /= sq;
- y2 /= sq;
- inp = (x1 * x2) + (y1 * y2);
- /*printf("%f\n", inp);*/
- if (inp > 0.9) return ('g');
- else return ('r');
- break;
- case 15:
- case 31:
- case 63:
- case 127:
- case 255:
- return ('r');
- break;
- default:
- /* for size at least one of the higher bits has to be set */
- if (dir < 16) return ('r');
- else return ('s');
- }
-
- return (0);
-}
-
-
-/* return 1 to denote gesture did something, also does lasso */
-int gesture(void)
-{
- unsigned short event=0;
- int i= 1, end= 0, a;
- short mcords[MOVES_LASSO][2]; /* the larger size */
- short mval[2], val, timer=0, mousebut, lasso=0, maxmoves;
-
- if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
- else mousebut = L_MOUSE;
-
- /* check for lasso */
- if(G.qual & LR_CTRLKEY) {
- if(curarea->spacetype==SPACE_VIEW3D) {
- if(G.obedit==NULL) {
- if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) return 0;
- }
- lasso= 1;
- } else if (curarea->spacetype==SPACE_IMAGE) {
- if(G.obedit) {
- lasso= 1;
- }
- } else if (curarea->spacetype==SPACE_NODE) {
- lasso= 1;
- }
- }
-
- glDrawBuffer(GL_FRONT);
- persp(PERSP_WIN); /* ortho at pixel level */
-
- getmouseco_areawin(mval);
-
- mcords[0][0] = mval[0];
- mcords[0][1] = mval[1];
-
- if(lasso) maxmoves= MOVES_LASSO;
- else maxmoves= MOVES_GESTURE;
-
- while(get_mbut() & mousebut) {
-
- if(qtest()) event= extern_qread(&val);
- else if(i==1) {
- /* not drawing yet... check for toolbox */
- PIL_sleep_ms(10);
- timer++;
- if(timer>=10*U.tb_leftmouse) {
- glDrawBuffer(GL_BACK); /* !! */
- toolbox_n();
- return 1;
- }
- }
-
- switch (event) {
- case MOUSEY:
- getmouseco_areawin(mval);
- if( abs(mval[0]-mcords[i-1][0])>3 || abs(mval[1]-mcords[i-1][1])>3 ) {
- mcords[i][0] = mval[0];
- mcords[i][1] = mval[1];
-
- if(i) {
- if(lasso) draw_lasso_select(mcords, i, 0);
- else sdrawXORline(mcords[i-1][0], mcords[i-1][1], mcords[i][0], mcords[i][1]);
- bglFlush();
- }
- i++;
- }
- break;
- case MOUSEX:
- break;
- case LEFTMOUSE:
- break;
- default:
- if(event) end= 1; /* blender returns 0 */
- break;
- }
- if (i == maxmoves || end == 1) break;
- }
-
- /* clear */
- if(lasso) draw_lasso_select(mcords, i, 1);
- else for(a=1; a<i; a++) {
- sdrawXORline(mcords[a-1][0], mcords[a-1][1], mcords[a][0], mcords[a][1]);
- }
-
- persp(PERSP_VIEW);
- glDrawBuffer(GL_BACK);
-
- if (i > 2) {
- if(lasso) do_lasso_select(mcords, i, (G.qual & LR_SHIFTKEY)==0);
- else {
- i = interpret_move(mcords, i);
-
- if(i) {
- if(curarea->spacetype==SPACE_IPO) transform_ipo(i);
- else if(curarea->spacetype==SPACE_OOPS) transform_oops('g', 0);
- else {
- int context;
-
- if(curarea->spacetype==SPACE_IMAGE) context= CTX_NONE;
- else context= CTX_NONE;
-
- if(i=='g') {
- initTransform(TFM_TRANSLATION, context);
- Transform();
- }
- else if(i=='r') {
- initTransform(TFM_ROTATION, context);
- Transform();
- }
- else {
- initTransform(TFM_RESIZE, context);
- Transform();
- }
- }
- }
- }
- return 1;
- }
- return 0;
-}
-
-void mouse_cursor(void)
-{
- float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3];
- short mval[2], mx, my, lr_click=0;
-
- if(gesture()) return;
-
- getmouseco_areawin(mval);
-
- mx= mval[0];
- my= mval[1];
-
- fp= give_cursor();
-
- if(G.obedit && ((G.qual & LR_CTRLKEY) || get_mbut()&R_MOUSE )) lr_click= 1;
- VECCOPY(oldcurs, fp);
-
- project_short_noclip(fp, mval);
-
- initgrabz(fp[0], fp[1], fp[2]);
-
- if(mval[0]!=IS_CLIPPED) {
-
- window_to_3d(dvec, mval[0]-mx, mval[1]-my);
- VecSubf(fp, fp, dvec);
-
- }
- else {
-
- dx= ((float)(mx-(curarea->winx/2)))*G.vd->zfac/(curarea->winx/2);
- dy= ((float)(my-(curarea->winy/2)))*G.vd->zfac/(curarea->winy/2);
-
- fz= G.vd->persmat[0][3]*fp[0]+ G.vd->persmat[1][3]*fp[1]+ G.vd->persmat[2][3]*fp[2]+ G.vd->persmat[3][3];
- fz= fz/G.vd->zfac;
-
- fp[0]= (G.vd->persinv[0][0]*dx + G.vd->persinv[1][0]*dy+ G.vd->persinv[2][0]*fz)-G.vd->ofs[0];
- fp[1]= (G.vd->persinv[0][1]*dx + G.vd->persinv[1][1]*dy+ G.vd->persinv[2][1]*fz)-G.vd->ofs[1];
- fp[2]= (G.vd->persinv[0][2]*dx + G.vd->persinv[1][2]*dy+ G.vd->persinv[2][2]*fz)-G.vd->ofs[2];
- }
-
- allqueue(REDRAWVIEW3D, 1);
-
- if(lr_click) {
- if(G.obedit->type==OB_MESH) add_click_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) addvert_Nurb(0);
- else if (G.obedit->type==OB_ARMATURE) addvert_armature();
- VECCOPY(fp, oldcurs);
- }
-
-}
-
-void deselectall(void) /* is toggle */
-{
- Base *base;
- int a=0, ok=0;
-
- base= FIRSTBASE;
- while(base) {
- /* is there a visible selected object */
- if(base->lay & G.vd->lay &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0 &&
- (base->object->restrictflag & OB_RESTRICT_SELECT)==0
- ) {
- if (base->flag & SELECT) {
- ok= a= 1;
- break;
- } else {
- ok=1;
- }
- }
- base= base->next;
- }
-
- if (!ok) return;
-
- base= FIRSTBASE;
- while(base) {
- if(base->lay & G.vd->lay &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0 &&
- (base->object->restrictflag & OB_RESTRICT_SELECT)==0
- ) {
- if(a)
- select_base_v3d(base, BA_DESELECT);
- else
- select_base_v3d(base, BA_SELECT);
- base->object->flag= base->flag;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWNLA, 0);
-
- countall();
- BIF_undo_push("(De)select all");
-}
-
-/* inverts object selection */
-void selectswap(void)
-{
- Base *base;
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->lay & G.vd->lay &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0
- ) {
- if TESTBASE(base)
- select_base_v3d(base, BA_DESELECT);
- else
- select_base_v3d(base, BA_SELECT);
- base->object->flag= base->flag;
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWNLA, 0);
-
- countall();
- BIF_undo_push("Select Inverse");
-}
-
-/* inverts object selection */
-void selectrandom(void)
-{
- Base *base;
- static short randfac = 50;
- if(button(&randfac,0, 100,"Percentage:")==0) return;
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->lay & G.vd->lay &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0
- ) {
- if (!TESTBASE(base) && ( (BLI_frand() * 100) < randfac)) {
- select_base_v3d(base, BA_SELECT);
- base->object->flag= base->flag;
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWNLA, 0);
-
- countall();
- BIF_undo_push("Select Random");
-}
-
-/* selects all objects of a particular type, on currently visible layers */
-void selectall_type(short obtype)
-{
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if((base->lay & G.vd->lay) &&
- (base->object->type == obtype) &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0
- ) {
- select_base_v3d(base, BA_SELECT);
- base->object->flag= base->flag;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWNLA, 0);
-
- countall();
- BIF_undo_push("Select all per type");
-}
-/* selects all objects on a particular layer */
-void selectall_layer(unsigned int layernum)
-{
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if(base->lay == (1<< (layernum -1)) &&
- (base->object->restrictflag & OB_RESTRICT_VIEW)==0
- ) {
- select_base_v3d(base, BA_SELECT);
- base->object->flag= base->flag;
- }
- base= base->next;
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWNLA, 0);
-
- countall();
- BIF_undo_push("Select all per layer");
-}
-
-static void deselectall_except(Base *b) /* deselect all except b */
-{
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if (base->flag & SELECT) {
- if(b!=base) {
- select_base_v3d(base, BA_DESELECT);
- base->object->flag= base->flag;
- }
- }
- base= base->next;
- }
-}
-
-#if 0
-/* smart function to sample a rect spiralling outside, nice for backbuf selection */
-static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo)
-{
- Base *base;
- unsigned int *bufmin,*bufmax;
- int a,b,rc,tel,aantal,dirvec[4][2],maxob;
- unsigned int retval=0;
-
- base= LASTBASE;
- if(base==0) return 0;
- maxob= base->selcol;
-
- aantal= (size-1)/2;
- rc= 0;
-
- dirvec[0][0]= 1;
- dirvec[0][1]= 0;
- dirvec[1][0]= 0;
- dirvec[1][1]= -size;
- dirvec[2][0]= -1;
- dirvec[2][1]= 0;
- dirvec[3][0]= 0;
- dirvec[3][1]= size;
-
- bufmin= buf;
- bufmax= buf+ size*size;
- buf+= aantal*size+ aantal;
-
- for(tel=1;tel<=size;tel++) {
-
- for(a=0;a<2;a++) {
- for(b=0;b<tel;b++) {
-
- if(*buf && *buf<=maxob && *buf!=dontdo) return *buf;
- if( *buf==dontdo ) retval= dontdo; /* if only color dontdo is available, still return dontdo */
-
- buf+= (dirvec[rc][0]+dirvec[rc][1]);
-
- if(buf<bufmin || buf>=bufmax) return retval;
- }
- rc++;
- rc &= 3;
- }
- }
- return retval;
-}
-#endif
-
-void set_active_base(Base *base)
-{
- Base *tbase;
-
- /* activating a non-mesh, should end a couple of modes... */
- if(base && base->object->type!=OB_MESH)
- exit_paint_modes();
-
- /* sets scene->basact */
- BASACT= base;
-
- if(base) {
-
- /* signals to buttons */
- redraw_test_buttons(base->object);
-
- /* signal to ipo */
- allqueue(REDRAWIPO, base->object->ipowin);
-
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWNODE, 0);
-
- /* signal to action */
- select_actionchannel_by_name(base->object->action, "Object", 1);
-
- /* disable temporal locks */
- for(tbase=FIRSTBASE; tbase; tbase= tbase->next) {
- if(base!=tbase && (tbase->object->shapeflag & OB_SHAPE_TEMPLOCK)) {
- tbase->object->shapeflag &= ~OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, tbase->object, OB_RECALC_DATA);
- }
- }
- }
-}
-
-void set_active_object(Object *ob)
-{
- Base *base;
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->object==ob) {
- set_active_base(base);
- return;
- }
- }
-}
-
-static void select_all_from_groups(Base *basact)
-{
- Group *group;
- GroupObject *go;
- int deselect= basact->flag & SELECT;
-
- for(group= G.main->group.first; group; group= group->id.next) {
- if(object_in_group(basact->object, group)) {
- for(go= group->gobject.first; go; go= go->next) {
- if(deselect) go->ob->flag &= ~SELECT;
- else {
- if ((go->ob->restrictflag & OB_RESTRICT_SELECT)==0 &&
- (go->ob->restrictflag & OB_RESTRICT_VIEW)==0)
- go->ob->flag |= SELECT;
- }
- }
- }
- }
- /* sync bases */
- for(basact= G.scene->base.first; basact; basact= basact->next) {
- if(basact->object->flag & SELECT)
- select_base_v3d(basact, BA_SELECT);
- else
- select_base_v3d(basact, BA_DESELECT);
- }
-}
-
-/* The max number of menu items in an object select menu */
-#define SEL_MENU_SIZE 22
-
-static Base *mouse_select_menu(unsigned int *buffer, int hits, short *mval)
-{
- Base *baseList[SEL_MENU_SIZE]={NULL}; /*baseList is used to store all possible bases to bring up a menu */
- Base *base;
- short baseCount = 0;
- char menuText[20 + SEL_MENU_SIZE*32] = "Select Object%t"; /* max ob name = 22 */
- char str[32];
-
- for(base=FIRSTBASE; base; base= base->next) {
- if BASE_SELECTABLE(base) {
- baseList[baseCount] = NULL;
-
- /* two selection methods, the CTRL select uses max dist of 15 */
- if(buffer) {
- int a;
- for(a=0; a<hits; a++) {
- /* index was converted */
- if(base->selcol==buffer[ (4 * a) + 3 ]) baseList[baseCount] = base;
- }
- }
- else {
- int temp, dist=15;
-
- project_short(base->object->obmat[3], &base->sx);
-
- temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]);
- if(temp<dist ) baseList[baseCount] = base;
- }
-
- if(baseList[baseCount]) {
- if (baseCount < SEL_MENU_SIZE) {
- baseList[baseCount] = base;
- sprintf(str, "|%s %%x%d", base->object->id.name+2, baseCount+1); /* max ob name == 22 */
- strcat(menuText, str);
- baseCount++;
- }
- }
- }
- }
-
- if(baseCount<=1) return baseList[0];
- else {
- baseCount = pupmenu(menuText);
-
- if (baseCount != -1) { /* If nothing is selected then dont do anything */
- return baseList[baseCount-1];
- }
- else return NULL;
- }
-}
-
-/* we want a select buffer with bones, if there are... */
-/* so check three selection levels and compare */
-static short mixed_bones_object_selectbuffer(unsigned int *buffer, short *mval)
-{
- int offs;
- short a, hits15, hits9=0, hits5=0;
- short has_bones15=0, has_bones9=0, has_bones5=0;
-
- hits15= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-14, mval[1]-14, mval[0]+14, mval[1]+14);
- if(hits15>0) {
- for(a=0; a<hits15; a++) if(buffer[4*a+3] & 0xFFFF0000) has_bones15= 1;
-
- offs= 4*hits15;
- hits9= view3d_opengl_select(buffer+offs, MAXPICKBUF-offs, mval[0]-9, mval[1]-9, mval[0]+9, mval[1]+9);
- if(hits9>0) {
- for(a=0; a<hits9; a++) if(buffer[offs+4*a+3] & 0xFFFF0000) has_bones9= 1;
-
- offs+= 4*hits9;
- hits5= view3d_opengl_select(buffer+offs, MAXPICKBUF-offs, mval[0]-5, mval[1]-5, mval[0]+5, mval[1]+5);
- if(hits5>0) {
- for(a=0; a<hits5; a++) if(buffer[offs+4*a+3] & 0xFFFF0000) has_bones5= 1;
- }
- }
-
- if(has_bones5) {
- offs= 4*hits15 + 4*hits9;
- memcpy(buffer, buffer+offs, 4*offs);
- return hits5;
- }
- if(has_bones9) {
- offs= 4*hits15;
- memcpy(buffer, buffer+offs, 4*offs);
- return hits9;
- }
- if(has_bones15) {
- return hits15;
- }
-
- if(hits5>0) {
- offs= 4*hits15 + 4*hits9;
- memcpy(buffer, buffer+offs, 4*offs);
- return hits5;
- }
- if(hits9>0) {
- offs= 4*hits15;
- memcpy(buffer, buffer+offs, 4*offs);
- return hits9;
- }
- return hits15;
- }
-
- return 0;
-}
-
-void mouse_select(void)
-{
- Base *base, *startbase=NULL, *basact=NULL, *oldbasact=NULL;
- unsigned int buffer[4*MAXPICKBUF];
- int temp, a, dist=100;
- short hits, mval[2];
-
- /* always start list from basact in wire mode */
- startbase= FIRSTBASE;
- if(BASACT && BASACT->next) startbase= BASACT->next;
-
- getmouseco_areawin(mval);
-
- /* This block uses the control key to make the object selected by its center point rather then its contents */
- if(G.obedit==0 && (G.qual & LR_CTRLKEY)) {
-
- /* note; shift+alt goes to group-flush-selecting */
- if(G.qual == (LR_ALTKEY|LR_CTRLKEY))
- basact= mouse_select_menu(NULL, 0, mval);
- else {
- base= startbase;
- while(base) {
- if BASE_SELECTABLE(base) {
- project_short(base->object->obmat[3], &base->sx);
-
- temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]);
- if(base==BASACT) temp+=10;
- if(temp<dist ) {
-
- dist= temp;
- basact= base;
- }
- }
- base= base->next;
-
- if(base==0) base= FIRSTBASE;
- if(base==startbase) break;
- }
- }
- }
- else {
- /* if objects have posemode set, the bones are in the same selection buffer */
-
- hits= mixed_bones_object_selectbuffer(buffer, mval);
-
- if(hits>0) {
- int has_bones= 0;
-
- for(a=0; a<hits; a++) if(buffer[4*a+3] & 0xFFFF0000) has_bones= 1;
-
- /* note; shift+alt goes to group-flush-selecting */
- if(has_bones==0 && (G.qual == LR_ALTKEY))
- basact= mouse_select_menu(buffer, hits, mval);
- else {
- static short lastmval[2]={-100, -100};
- int donearest= 0;
-
- /* define if we use solid nearest select or not */
- if(G.vd->drawtype>OB_WIRE) {
- donearest= 1;
- if( ABS(mval[0]-lastmval[0])<3 && ABS(mval[1]-lastmval[1])<3) {
- if(!has_bones) /* hrms, if theres bones we always do nearest */
- donearest= 0;
- }
- }
- lastmval[0]= mval[0]; lastmval[1]= mval[1];
-
- if(donearest) {
- unsigned int min= 0xFFFFFFFF;
- int selcol= 0, notcol=0;
-
-
- if(has_bones) {
- /* we skip non-bone hits */
- for(a=0; a<hits; a++) {
- if( min > buffer[4*a+1] && (buffer[4*a+3] & 0xFFFF0000) ) {
- min= buffer[4*a+1];
- selcol= buffer[4*a+3] & 0xFFFF;
- }
- }
- }
- else {
- /* only exclude active object when it is selected... */
- if(BASACT && (BASACT->flag & SELECT) && hits>1) notcol= BASACT->selcol;
-
- for(a=0; a<hits; a++) {
- if( min > buffer[4*a+1] && notcol!=(buffer[4*a+3] & 0xFFFF)) {
- min= buffer[4*a+1];
- selcol= buffer[4*a+3] & 0xFFFF;
- }
- }
- }
-
- base= FIRSTBASE;
- while(base) {
- if(base->lay & G.vd->lay) {
- if(base->selcol==selcol) break;
- }
- base= base->next;
- }
- if(base) basact= base;
- }
- else {
-
- base= startbase;
- while(base) {
- /* skip objects with select restriction, to prevent prematurely ending this loop
- * with an un-selectable choice */
- if (base->object->restrictflag & OB_RESTRICT_SELECT) {
- base=base->next;
- if(base==NULL) base= FIRSTBASE;
- if(base==startbase) break;
- }
-
- if(base->lay & G.vd->lay) {
- for(a=0; a<hits; a++) {
- if(has_bones) {
- /* skip non-bone objects */
- if((buffer[4*a+3] & 0xFFFF0000)) {
- if(base->selcol== (buffer[(4*a)+3] & 0xFFFF))
- basact= base;
- }
- }
- else {
- if(base->selcol== (buffer[(4*a)+3] & 0xFFFF))
- basact= base;
- }
- }
- }
-
- if(basact) break;
-
- base= base->next;
- if(base==NULL) base= FIRSTBASE;
- if(base==startbase) break;
- }
- }
- }
-
- if(has_bones && basact) {
- if( do_pose_selectbuffer(basact, buffer, hits) ) { /* then bone is found */
-
- /* we make the armature selected:
- not-selected active object in posemode won't work well for tools */
- basact->flag|= SELECT;
- basact->object->flag= basact->flag;
-
- /* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
- if(G.f & G_WEIGHTPAINT) {
- /* prevent activating */
- basact= NULL;
- }
- }
- /* prevent bone selecting to pass on to object selecting */
- if(basact==BASACT)
- basact= NULL;
- }
- }
- }
-
- /* so, do we have something selected? */
- if(basact) {
-
- if(G.obedit) {
- /* only do select */
- deselectall_except(basact);
- select_base_v3d(basact, BA_SELECT);
- }
- /* also prevent making it active on mouse selection */
- else if BASE_SELECTABLE(basact) {
-
- oldbasact= BASACT;
- BASACT= basact;
-
- if((G.qual & LR_SHIFTKEY)==0) {
- deselectall_except(basact);
- select_base_v3d(basact, BA_SELECT);
- }
- else if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)) {
- select_all_from_groups(basact);
- }
- else {
- if(basact->flag & SELECT) {
- if(basact==oldbasact)
- select_base_v3d(basact, BA_DESELECT);
- }
- else select_base_v3d(basact, BA_SELECT);
- }
-
- /* copy */
- basact->object->flag= basact->flag;
-
- if(oldbasact != basact) {
- set_active_base(basact);
- }
-
- /* for visual speed, only in wire mode */
- if(G.vd->drawtype==OB_WIRE) {
- /* however, not for posemodes */
- if(basact->object->flag & OB_POSEMODE);
- else if(oldbasact && (oldbasact->object->flag & OB_POSEMODE));
- else {
- if(oldbasact && oldbasact != basact && (oldbasact->lay & G.vd->lay))
- draw_object_ext(oldbasact);
- draw_object_ext(basact);
- }
- }
-
- allqueue(REDRAWBUTSLOGIC, 0);
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWHEADERS, 0); /* To force display update for the posebutton */
- }
- /* also because multiple 3d windows can be open */
- allqueue(REDRAWVIEW3D, 0);
-
- }
-
- countall();
-
- rightmouse_transform(); /* does undo push! */
-}
-
-/* ------------------------------------------------------------------------- */
-
-int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2)
-{
- int radsq= rad*rad;
- float v1[2], v2[2], v3[2];
-
- /* check points in circle itself */
- if( (x1-centx)*(x1-centx) + (y1-centy)*(y1-centy) <= radsq ) return 1;
- if( (x2-centx)*(x2-centx) + (y2-centy)*(y2-centy) <= radsq ) return 1;
-
- /* pointdistline */
- v3[0]= centx;
- v3[1]= centy;
- v1[0]= x1;
- v1[1]= y1;
- v2[0]= x2;
- v2[1]= y2;
-
- if( PdistVL2Dfl(v3, v1, v2) < (float)rad ) return 1;
-
- return 0;
-}
-
-static void do_nurbs_box_select__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
-{
- struct { rcti *rect; int select; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y)) {
- if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- } else {
- if (G.f & G_HIDDENHANDLES) {
- /* can only be beztindex==0 here since handles are hidden */
- bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
- } else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
- } else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
- } else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
- }
- }
- }
- }
-}
-static void do_nurbs_box_select(rcti *rect, int select)
-{
- struct { rcti *rect; int select; } data;
-
- data.rect = rect;
- data.select = select;
-
- nurbs_foreachScreenVert(do_nurbs_box_select__doSelect, &data);
-}
-
-static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, int y)
-{
- struct { rcti *rect; int select; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y)) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- }
-}
-static void do_lattice_box_select(rcti *rect, int select)
-{
- struct { rcti *rect; int select, pass, done; } data;
-
- data.rect = rect;
- data.select = select;
-
- lattice_foreachScreenVert(do_lattice_box_select__doSelect, &data);
-}
-
-static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
-{
- struct { rcti *rect; short select, pass, done; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y)) {
- eve->f = data->select?(eve->f|1):(eve->f&~1);
- }
-}
-static void do_mesh_box_select__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
-{
- struct { rcti *rect; short select, pass, done; } *data = userData;
-
- if(EM_check_backbuf(em_solidoffs+index)) {
- if (data->pass==0) {
- if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
- EM_select_edge(eed, data->select);
- data->done = 1;
- }
- } else {
- if (edge_inside_rect(data->rect, x0, y0, x1, y1)) {
- EM_select_edge(eed, data->select);
- }
- }
- }
-}
-static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
-{
- struct { rcti *rect; short select, pass, done; } *data = userData;
-
- if (BLI_in_rcti(data->rect, x, y)) {
- EM_select_face_fgon(efa, data->select);
- }
-}
-static void do_mesh_box_select(rcti *rect, int select)
-{
- struct { rcti *rect; short select, pass, done; } data;
- EditMesh *em = G.editMesh;
- int bbsel;
-
- data.rect = rect;
- data.select = select;
- data.pass = 0;
- data.done = 0;
-
- bbsel= EM_init_backbuf_border(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if (bbsel) {
- EM_backbuf_checkAndSelectVerts(em, select);
- } else {
- mesh_foreachScreenVert(do_mesh_box_select__doSelectVert, &data, 1);
- }
- }
- if(G.scene->selectmode & SCE_SELECT_EDGE) {
- /* Does both bbsel and non-bbsel versions (need screen cos for both) */
-
- data.pass = 0;
- mesh_foreachScreenEdge(do_mesh_box_select__doSelectEdge, &data, 0);
-
- if (data.done==0) {
- data.pass = 1;
- mesh_foreachScreenEdge(do_mesh_box_select__doSelectEdge, &data, 0);
- }
- }
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- if(bbsel) {
- EM_backbuf_checkAndSelectFaces(em, select);
- } else {
- mesh_foreachScreenFace(do_mesh_box_select__doSelectFace, &data);
- }
- }
-
- EM_free_backbuf();
-
- EM_selectmode_flush();
-}
-
-/**
- * Does the 'borderselect' command. (Select verts based on selecting with a
- * border: key 'b'). All selecting seems to be done in the get_border part.
- */
-void borderselect(void)
-{
- rcti rect;
- Base *base;
- MetaElem *ml;
- unsigned int buffer[4*MAXPICKBUF];
- int a, index;
- short hits, val;
-
- if(G.obedit==NULL && (FACESEL_PAINT_TEST)) {
- face_borderselect();
- return;
- }
- else if(G.obedit==NULL && (G.f & G_PARTICLEEDIT)) {
- PE_borderselect();
- return;
- }
-
- a = 0;
-#ifdef __APPLE__
- a = is_a_really_crappy_intel_card();
-#endif
- if (!a) setlinestyle(2);
- val= get_border(&rect, 3);
- if (!a) setlinestyle(0);
-
- if(val==0) {
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
- return;
- }
-
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- do_mesh_box_select(&rect, (val==LEFTMOUSE));
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- do_nurbs_box_select(&rect, val==LEFTMOUSE);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(G.obedit->type==OB_MBALL) {
- hits= view3d_opengl_select(buffer, MAXPICKBUF, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
-
- ml= editelems.first;
-
- while(ml) {
- for(a=0; a<hits; a++) {
- if(ml->selcol1==buffer[ (4 * a) + 3 ]) {
- ml->flag |= MB_SCALE_RAD;
- if(val==LEFTMOUSE) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
- break;
- }
- if(ml->selcol2==buffer[ (4 * a) + 3 ]) {
- ml->flag &= ~MB_SCALE_RAD;
- if(val==LEFTMOUSE) ml->flag |= SELECT;
- else ml->flag &= ~SELECT;
- break;
- }
- }
- ml= ml->next;
- }
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(G.obedit->type==OB_ARMATURE) {
- EditBone *ebone;
-
- /* clear flag we use to detect point was affected */
- for(ebone= G.edbo.first; ebone; ebone= ebone->next)
- ebone->flag &= ~BONE_DONE;
-
- hits= view3d_opengl_select(buffer, MAXPICKBUF, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
-
- /* first we only check points inside the border */
- for (a=0; a<hits; a++){
- index = buffer[(4*a)+3];
- if (index!=-1) {
- ebone = BLI_findlink(&G.edbo, index & ~(BONESEL_ANY));
- if (index & BONESEL_TIP) {
- ebone->flag |= BONE_DONE;
- if (val==LEFTMOUSE) ebone->flag |= BONE_TIPSEL;
- else ebone->flag &= ~BONE_TIPSEL;
- }
-
- if (index & BONESEL_ROOT) {
- ebone->flag |= BONE_DONE;
- if (val==LEFTMOUSE) ebone->flag |= BONE_ROOTSEL;
- else ebone->flag &= ~BONE_ROOTSEL;
- }
- }
- }
-
- /* now we have to flush tag from parents... */
- for(ebone= G.edbo.first; ebone; ebone= ebone->next) {
- if(ebone->parent && (ebone->flag & BONE_CONNECTED)) {
- if(ebone->parent->flag & BONE_DONE)
- ebone->flag |= BONE_DONE;
- }
- }
-
- /* only select/deselect entire bones when no points where in the rect */
- for (a=0; a<hits; a++){
- index = buffer[(4*a)+3];
- if (index!=-1) {
- ebone = BLI_findlink(&G.edbo, index & ~(BONESEL_ANY));
- if (index & BONESEL_BONE) {
- if(!(ebone->flag & BONE_DONE)) {
- if (val==LEFTMOUSE)
- ebone->flag |= (BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED);
- else
- ebone->flag &= ~(BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED);
- }
- }
- }
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(G.obedit->type==OB_LATTICE) {
- do_lattice_box_select(&rect, val==LEFTMOUSE);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else { /* no editmode, unified for bones and objects */
- Bone *bone;
- unsigned int *vbuffer=NULL; /* selection buffer */
- unsigned int *col; /* color in buffer */
- short selecting = 0;
- Object *ob= OBACT;
- int bone_only;
-
- if((ob) && (ob->flag & OB_POSEMODE))
- bone_only= 1;
- else
- bone_only= 0;
-
- if (val==LEFTMOUSE)
- selecting = 1;
-
- /* selection buffer now has bones potentially too, so we add MAXPICKBUF */
- vbuffer = MEM_mallocN(4 * (G.totobj+MAXPICKBUF) * sizeof(unsigned int), "selection buffer");
- hits= view3d_opengl_select(vbuffer, 4*(G.totobj+MAXPICKBUF), rect.xmin, rect.ymin, rect.xmax, rect.ymax);
- /*
- LOGIC NOTES (theeth):
- The buffer and ListBase have the same relative order, which makes the selection
- very simple. Loop through both data sets at the same time, if the color
- is the same as the object, we have a hit and can move to the next color
- and object pair, if not, just move to the next object,
- keeping the same color until we have a hit.
-
- The buffer order is defined by OGL standard, hopefully no stupid GFX card
- does it incorrectly.
- */
-
- if (hits>0) { /* no need to loop if there's no hit */
- base= FIRSTBASE;
- col = vbuffer + 3;
- while(base && hits) {
- Base *next = base->next;
- if(base->lay & G.vd->lay) {
- while (base->selcol == (*col & 0xFFFF)) { /* we got an object */
-
- if(*col & 0xFFFF0000) { /* we got a bone */
- bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY));
- if(bone) {
- if(selecting) {
- bone->flag |= BONE_SELECTED;
- select_actionchannel_by_name(base->object->action, bone->name, 1);
- }
- else {
- bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED);
- select_actionchannel_by_name(base->object->action, bone->name, 0);
- }
- }
- }
- else if(!bone_only) {
- if (selecting)
- select_base_v3d(base, BA_SELECT);
- else
- select_base_v3d(base, BA_DESELECT);
-
- base->object->flag= base->flag;
- }
-
- col+=4; /* next color */
- hits--;
- if(hits==0) break;
- }
- }
-
- base= next;
- }
- }
- /* frontbuffer flush */
- bglFlush();
-
- MEM_freeN(vbuffer);
-
- allqueue(REDRAWDATASELECT, 0);
- allqueue(REDRAWBUTSLOGIC, 0);
- allqueue(REDRAWNLA, 0);
- }
-
- countall();
-
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWINFO, 0);
-
- BIF_undo_push("Border select");
-
-} /* end of borderselect() */
-
-/* ------------------------------------------------------------------------- */
-
-/** The following functions are quick & dirty callback functions called
- * on the Circle select function (press B twice in Editmode)
- * They were torn out of the circle_select to make the latter more reusable
- * The callback version of circle_select (called circle_selectCB) was moved
- * to edit.c because of it's (wanted) generality.
-
- XXX These callback functions are still dirty, because they call globals...
- */
-
-static void mesh_selectionCB__doSelectVert(void *userData, EditVert *eve, int x, int y, int index)
-{
- struct { short select, mval[2]; float radius; } *data = userData;
- int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
-
- if (r<=data->radius) {
- eve->f = data->select?(eve->f|1):(eve->f&~1);
- }
-}
-static void mesh_selectionCB__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index)
-{
- struct { short select, mval[2]; float radius; } *data = userData;
-
- if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
- EM_select_edge(eed, data->select);
- }
-}
-static void mesh_selectionCB__doSelectFace(void *userData, EditFace *efa, int x, int y, int index)
-{
- struct { short select, mval[2]; float radius; } *data = userData;
- int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
-
- if (r<=data->radius) {
- EM_select_face_fgon(efa, data->select);
- }
-}
-static void mesh_selectionCB(int selecting, Object *editobj, short *mval, float rad)
-{
- struct { short select, mval[2]; float radius; } data;
- EditMesh *em = G.editMesh;
- int bbsel;
-
- if(!G.obedit && (FACESEL_PAINT_TEST)) {
- Mesh *me = get_mesh(OBACT);
-
- if (me) {
- em_vertoffs= me->totface+1; /* max index array */
-
- bbsel= EM_init_backbuf_circle(mval[0], mval[1], (short)(rad+1.0));
- EM_backbuf_checkAndSelectTFaces(me, selecting==LEFTMOUSE);
- EM_free_backbuf();
-
- object_tface_flags_changed(OBACT, 0);
- }
-
- return;
- }
-
- bbsel= EM_init_backbuf_circle(mval[0], mval[1], (short)(rad+1.0));
-
- data.select = (selecting==LEFTMOUSE);
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.radius = rad;
-
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- if(bbsel) {
- EM_backbuf_checkAndSelectVerts(em, selecting==LEFTMOUSE);
- } else {
- mesh_foreachScreenVert(mesh_selectionCB__doSelectVert, &data, 1);
- }
- }
-
- if(G.scene->selectmode & SCE_SELECT_EDGE) {
- if (bbsel) {
- EM_backbuf_checkAndSelectEdges(em, selecting==LEFTMOUSE);
- } else {
- mesh_foreachScreenEdge(mesh_selectionCB__doSelectEdge, &data, 0);
- }
- }
-
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- if(bbsel) {
- EM_backbuf_checkAndSelectFaces(em, selecting==LEFTMOUSE);
- } else {
- mesh_foreachScreenFace(mesh_selectionCB__doSelectFace, &data);
- }
- }
-
- EM_free_backbuf();
- EM_selectmode_flush();
-}
-
-
-static void nurbscurve_selectionCB__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
-{
- struct { short select, mval[2]; float radius; } *data = userData;
- int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
-
- if (r<=data->radius) {
- if (bp) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- } else {
- if (beztindex==0) {
- bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT);
- } else if (beztindex==1) {
- bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT);
- } else {
- bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT);
- }
- }
- }
-}
-static void nurbscurve_selectionCB(int selecting, Object *editobj, short *mval, float rad)
-{
- struct { short select, mval[2]; float radius; } data;
-
- data.select = (selecting==LEFTMOUSE);
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.radius = rad;
-
- nurbs_foreachScreenVert(nurbscurve_selectionCB__doSelect, &data);
-}
-
-
-static void latticecurve_selectionCB__doSelect(void *userData, BPoint *bp, int x, int y)
-{
- struct { short select, mval[2]; float radius; } *data = userData;
- int mx = x - data->mval[0], my = y - data->mval[1];
- float r = sqrt(mx*mx + my*my);
-
- if (r<=data->radius) {
- bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT);
- }
-}
-static void lattice_selectionCB(int selecting, Object *editobj, short *mval, float rad)
-{
- struct { short select, mval[2]; float radius; } data;
-
- data.select = (selecting==LEFTMOUSE);
- data.mval[0] = mval[0];
- data.mval[1] = mval[1];
- data.radius = rad;
-
- lattice_foreachScreenVert(latticecurve_selectionCB__doSelect, &data);
-}
-
-/** Callbacks for selection in Editmode */
-
-void obedit_selectionCB(short selecting, Object *editobj, short *mval, float rad)
-{
- switch(editobj->type) {
- case OB_MESH:
- mesh_selectionCB(selecting, editobj, mval, rad);
- break;
- case OB_CURVE:
- case OB_SURF:
- nurbscurve_selectionCB(selecting, editobj, mval, rad);
- break;
- case OB_LATTICE:
- lattice_selectionCB(selecting, editobj, mval, rad);
- break;
- default:
- return;
- }
-
- draw_sel_circle(0, 0, 0, 0, 0); /* signal */
- force_draw(0);
-}
-
-void set_render_border(void)
-{
- rcti rect;
- short val;
-
- val= get_border(&rect, 3);
- if(val) {
- rctf vb;
-
- calc_viewborder(G.vd, &vb);
-
- G.scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
- G.scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
- G.scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin);
- G.scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin);
-
- CLAMP(G.scene->r.border.xmin, 0.0, 1.0);
- CLAMP(G.scene->r.border.ymin, 0.0, 1.0);
- CLAMP(G.scene->r.border.xmax, 0.0, 1.0);
- CLAMP(G.scene->r.border.ymax, 0.0, 1.0);
-
- allqueue(REDRAWVIEWCAM, 1);
-
- /* drawing a border surrounding the entire camera view switches off border rendering
- * or the border covers no pixels */
- if ((G.scene->r.border.xmin <= 0.0 && G.scene->r.border.xmax >= 1.0 &&
- G.scene->r.border.ymin <= 0.0 && G.scene->r.border.ymax >= 1.0) ||
- (G.scene->r.border.xmin == G.scene->r.border.xmax ||
- G.scene->r.border.ymin == G.scene->r.border.ymax ))
- {
- G.scene->r.mode &= ~R_BORDER;
- } else {
- G.scene->r.mode |= R_BORDER;
- }
-
- allqueue(REDRAWBUTSSCENE, 1);
- }
-}
-
-void view3d_border_zoom(void)
-{
- View3D *v3d = G.vd;
-
- /* Zooms in on a border drawn by the user */
- rcti rect;
- short val;
- float dvec[3], vb[2], xscale, yscale, scale;
-
-
- /* SMOOTHVIEW */
- float new_dist;
- float new_ofs[3];
-
- /* ZBuffer depth vars */
- bglMats mats;
- float depth, depth_close= MAXFLOAT;
- int had_depth = 0;
- double cent[2], p[3];
- int xs, ys;
-
- /* Get the border input */
- val = get_border(&rect, 3);
- if(!val) return;
-
- /* Get Z Depths, needed for perspective, nice for ortho */
- bgl_get_mats(&mats);
- draw_depth(curarea, (void *)v3d, NULL);
-
- /* force updating */
- if (v3d->depths) {
- had_depth = 1;
- v3d->depths->damaged = 1;
- }
-
- view3d_update_depths(v3d);
-
- /* Constrain rect to depth bounds */
- if (rect.xmin < 0) rect.xmin = 0;
- if (rect.ymin < 0) rect.ymin = 0;
- if (rect.xmax >= v3d->depths->w) rect.xmax = v3d->depths->w-1;
- if (rect.ymax >= v3d->depths->h) rect.ymax = v3d->depths->h-1;
-
- /* Find the closest Z pixel */
- for (xs=rect.xmin; xs < rect.xmax; xs++) {
- for (ys=rect.ymin; ys < rect.ymax; ys++) {
- depth= v3d->depths->depths[ys*v3d->depths->w+xs];
- if(depth < v3d->depths->depth_range[1] && depth > v3d->depths->depth_range[0]) {
- if (depth_close > depth) {
- depth_close = depth;
- }
- }
- }
- }
-
- if (had_depth==0) {
- MEM_freeN(v3d->depths->depths);
- v3d->depths->depths = NULL;
- }
- v3d->depths->damaged = 1;
-
- cent[0] = (((double)rect.xmin)+((double)rect.xmax)) / 2;
- cent[1] = (((double)rect.ymin)+((double)rect.ymax)) / 2;
-
- if (v3d->persp==V3D_PERSP) {
- double p_corner[3];
-
- /* no depths to use, we cant do anything! */
- if (depth_close==MAXFLOAT)
- return;
-
- /* convert border to 3d coordinates */
- if (( !gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, mats.viewport, &p[0], &p[1], &p[2])) ||
- ( !gluUnProject((double)rect.xmin, (double)rect.ymin, depth_close, mats.modelview, mats.projection, mats.viewport, &p_corner[0], &p_corner[1], &p_corner[2])))
- return;
-
- dvec[0] = p[0]-p_corner[0];
- dvec[1] = p[1]-p_corner[1];
- dvec[2] = p[2]-p_corner[2];
-
- new_dist = VecLength(dvec);
- if(new_dist <= v3d->near*1.5) new_dist= v3d->near*1.5;
-
- new_ofs[0] = -p[0];
- new_ofs[1] = -p[1];
- new_ofs[2] = -p[2];
-
- } else { /* othographic */
- /* find the current window width and height */
- vb[0] = v3d->area->winx;
- vb[1] = v3d->area->winy;
-
- new_dist = v3d->dist;
-
- /* convert the drawn rectangle into 3d space */
- if (depth_close!=MAXFLOAT && gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, mats.viewport, &p[0], &p[1], &p[2])) {
- new_ofs[0] = -p[0];
- new_ofs[1] = -p[1];
- new_ofs[2] = -p[2];
- } else {
- /* We cant use the depth, fallback to the old way that dosnt set the center depth */
- new_ofs[0] = v3d->ofs[0];
- new_ofs[1] = v3d->ofs[1];
- new_ofs[2] = v3d->ofs[2];
-
- initgrabz(-new_ofs[0], -new_ofs[1], -new_ofs[2]);
-
- window_to_3d(dvec, (rect.xmin+rect.xmax-vb[0])/2, (rect.ymin+rect.ymax-vb[1])/2);
- /* center the view to the center of the rectangle */
- VecSubf(new_ofs, new_ofs, dvec);
- }
-
- /* work out the ratios, so that everything selected fits when we zoom */
- xscale = ((rect.xmax-rect.xmin)/vb[0]);
- yscale = ((rect.ymax-rect.ymin)/vb[1]);
- scale = (xscale >= yscale)?xscale:yscale;
-
- /* zoom in as required, or as far as we can go */
- new_dist = ((new_dist*scale) >= 0.001*v3d->grid)? new_dist*scale:0.001*v3d->grid;
- }
-
- smooth_view(v3d, new_ofs, NULL, &new_dist, NULL);
-}
-
-void fly(void)
-{
- /*
- fly mode - Shift+F
- a fly loop where the user can move move the view as if they are flying
- */
- float speed=0.0, /* the speed the view is moving per redraw */
- mat[3][3], /* 3x3 copy of the view matrix so we can move allong the view axis */
- dvec[3]={0,0,0}, /* this is the direction thast added to the view offset per redraw */
- dvec_old[3]={0,0,0}, /* old for some lag */
- dvec_tmp[3]={0,0,0}, /* old for some lag */
- dvec_lag=0.0, /* old for some lag */
-
- /* Camera Uprighting variables */
- roll, /* similar to the angle between the camera's up and the Z-up, but its very rough so just roll*/
- upvec[3]={0,0,0}, /* stores the view's up vector */
-
- dist_backup, /* backup the views distance since we use a zero dist for fly mode */
- rot_backup[4], /* backup the views quat incase the user cancels flying in non camera mode */
- ofs_backup[3], /* backup the views offset incase the user cancels flying in non camera mode */
- moffset[2], /* mouse offset from the views center */
- tmp_quat[4], /* used for rotating the view */
- winxf, winyf, /* scale the mouse movement by this value - scales mouse movement to the view size */
- time_redraw, time_redraw_clamped, time_wheel; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */
-
- /* time_lastwheel is used to accelerate when using the mousewheel a lot */
- double time_current, time_lastdraw, time_currwheel, time_lastwheel;
-
- short val, /* used for toets to see if a buttons pressed */
- cent_orig[2], /* view center */
- cent[2], /* view center modified */
- mval[2], /* mouse location */
- action=0, /* while zero stay in fly mode and wait for action, also used to see if we accepted or canceled 1:ok 2:Cancel */
- xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */
- unsigned short
- toets; /* for reading the event */
- unsigned char
- apply_rotation= 1, /* if the user presses shift they can look about without movinf the direction there looking*/
- axis= 2, /* Axis index to move allong by default Z to move allong the view */
- persp_backup, /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
- pan_view=0; /* if true, pan the view instead of rotating */
-
- /* relative view axis locking - xlock, zlock
- 0; disabled
- 1; enabled but not checking because mouse hasnt moved outside the margin since locking was checked an not needed
- when the mouse moves, locking is set to 2 so checks are done.
- 2; mouse moved and checking needed, if no view altering is donem its changed back to 1 */
- short xlock=0, zlock=0;
- float xlock_momentum=0.0f, zlock_momentum=0.0f; /* nicer dynamics */
-
- /* for recording */
- int playing_anim = has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
- int cfra = -1; /*so the first frame always has a key added */
- char *actname="";
-
- if(curarea->spacetype!=SPACE_VIEW3D) return;
-
- if(G.vd->persp==V3D_CAMOB && G.vd->camera->id.lib) {
- error("Cannot fly a camera from an external library");
- return;
- }
-
- if(G.vd->ob_centre) {
- error("Cannot fly when the view is locked to an object");
- return;
- }
-
-
- /* detect weather to start with Z locking */
- upvec[0]=1; upvec[1]=0; upvec[2]=0;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- if (fabs(upvec[2]) < 0.1)
- zlock = 1;
- upvec[0]=0; upvec[1]=0; upvec[2]=0;
-
- persp_backup= G.vd->persp;
- dist_backup= G.vd->dist;
- if (G.vd->persp==V3D_CAMOB) {
- if(G.vd->camera->constraints.first) {
- error("Cannot fly an object with constraints");
- return;
- }
-
- /* store the origoinal camera loc and rot */
- VECCOPY(ofs_backup, G.vd->camera->loc);
- VECCOPY(rot_backup, G.vd->camera->rot);
-
- where_is_object(G.vd->camera);
- VECCOPY(G.vd->ofs, G.vd->camera->obmat[3]);
- VecMulf(G.vd->ofs, -1.0f); /*flip the vector*/
-
- G.vd->dist=0.0;
- G.vd->viewbut=0;
-
- /* used for recording */
- if(G.vd->camera->ipoflag & OB_ACTION_OB)
- actname= "Object";
-
- } else {
- /* perspective or ortho */
- if (G.vd->persp==V3D_ORTHO)
- G.vd->persp= V3D_PERSP; /*if ortho projection, make perspective */
- QUATCOPY(rot_backup, G.vd->viewquat);
- VECCOPY(ofs_backup, G.vd->ofs);
- G.vd->dist= 0.0;
-
- upvec[2]=dist_backup; /*x and y are 0*/
- Mat3MulVecfl(mat, upvec);
- VecSubf(G.vd->ofs, G.vd->ofs, upvec);
- /*Done with correcting for the dist*/
- }
-
- /* the dist defines a vector that is infront of the offset
- to rotate the view about.
- this is no good for fly mode because we
- want to rotate about the viewers center.
- but to correct the dist removal we must
- alter offset so the view dosent jump. */
-
- xmargin= (short)((float)(curarea->winx)/20.0);
- ymargin= (short)((float)(curarea->winy)/20.0);
-
- cent_orig[0]= curarea->winrct.xmin+(curarea->winx)/2;
- cent_orig[1]= curarea->winrct.ymin+(curarea->winy)/2;
-
- warp_pointer(cent_orig[0], cent_orig[1]);
-
- /* we have to rely on events to give proper mousecoords after a warp_pointer */
- mval[0]= cent[0]= (curarea->winx)/2;
- mval[1]= cent[1]= (curarea->winy)/2;
- /* window size minus margin - use this to get the mouse range for rotation */
- winxf= (float)(curarea->winx)-(xmargin*2);
- winyf= (float)(curarea->winy)-(ymargin*2);
-
-
- time_lastdraw= time_lastwheel= PIL_check_seconds_timer();
-
- G.vd->flag2 |= V3D_FLYMODE; /* so we draw the corner margins */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- while(action==0) { /* keep flying, no acton taken */
- while(qtest()) {
- toets= extern_qread(&val);
-
- if(val) {
- if(toets==MOUSEY) getmouseco_areawin(mval);
- else if(toets==ESCKEY || toets==RIGHTMOUSE) {
- action= 2; /* Canceled */
- break;
- } else if(toets==SPACEKEY || toets==LEFTMOUSE) {
- action= 1; /* Accepted */
- break;
- } else if(toets==PADPLUSKEY || toets==EQUALKEY || toets==WHEELUPMOUSE) {
- time_currwheel= PIL_check_seconds_timer();
- time_wheel = (float)(time_currwheel - time_lastwheel);
- time_lastwheel = time_currwheel;
- /*printf("Wheel %f\n", time_wheel);*/
- /*Mouse wheel delays range from 0.5==slow to 0.01==fast*/
- time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */
-
- if (speed<0) speed=0;
- else {
- if (G.qual & LR_SHIFTKEY)
- speed+= G.vd->grid*time_wheel*0.1;
- else
- speed+= G.vd->grid*time_wheel;
- }
-
- } else if(toets==PADMINUS || toets==MINUSKEY || toets==WHEELDOWNMOUSE) {
- time_currwheel= PIL_check_seconds_timer();
- time_wheel = (float)(time_currwheel - time_lastwheel);
- time_lastwheel = time_currwheel;
- time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */
-
- if (speed>0) speed=0;
- else {
- if (G.qual & LR_SHIFTKEY)
- speed-= G.vd->grid*time_wheel*0.1;
- else
- speed-= G.vd->grid*time_wheel;
- }
-
- } else if (toets==MIDDLEMOUSE) {
- /* make it so the camera direction dosent follow the view
- good for flying backwards! - Only when MMB is held */
-
- /*apply_rotation=0;*/
- pan_view= 1;
-
- /* impliment WASD keys */
- } else if(toets==WKEY) {
- if (speed<0) speed=-speed; /* flip speed rather then stopping, game like motion */
- else speed+= G.vd->grid; /* increse like mousewheel if were alredy moving in that difection*/
- axis= 2;
- } else if(toets==SKEY) { /*SAME as above but flipped */
- if (speed>0) speed=-speed;
- else speed-= G.vd->grid;
- axis= 2;
-
- } else if(toets==AKEY) {
- if (speed<0) speed=-speed;
- axis= 0;
- } else if(toets==DKEY) {
- if (speed>0) speed=-speed;
- axis= 0;
- } else if(toets==FKEY) {
- if (speed<0) speed=-speed;
- axis= 1;
- } else if(toets==RKEY) {
- if (speed>0) speed=-speed;
- axis= 1;
-
- /* axis locking */
- } else if(toets==XKEY) {
- if (xlock) xlock=0;
- else {
- xlock = 2;
- xlock_momentum = 0.0;
- }
- } else if(toets==ZKEY) {
- if (zlock) zlock=0;
- else {
- zlock = 2;
- zlock_momentum = 0.0;
- }
- }
-
- } else {
- /* mouse buttons lifted */
- if (toets==MIDDLEMOUSE && pan_view) {
- /*apply_rotation=1;*/
- warp_pointer(cent_orig[0], cent_orig[1]);
- pan_view= 0;
- }
- }
- }
- if(action != 0) break;
-
- moffset[0]= mval[0]-cent[0];
- moffset[1]= mval[1]-cent[1];
-
- /* enforce a view margin */
- if (moffset[0]>xmargin) moffset[0]-=xmargin;
- else if (moffset[0]<-xmargin)moffset[0]+=xmargin;
- else moffset[0]=0;
-
- if (moffset[1]>ymargin) moffset[1]-=ymargin;
- else if (moffset[1]<-ymargin)moffset[1]+=ymargin;
- else moffset[1]=0;
-
- /* scale the mouse offset so the distance the mouse moves isnt linear */
- if (moffset[0]) {
- moffset[0]= moffset[0]/winxf;
- moffset[0]= moffset[0]*fabs(moffset[0]);
- }
-
- if (moffset[1]) {
- moffset[1]= moffset[1]/winyf;
- moffset[1]= moffset[1]*fabs(moffset[1]);
- }
-
- /* Should we redraw? */
- if(speed!=0.0 || moffset[0] || moffset[1] || zlock || xlock || dvec[0] || dvec[1] || dvec[2] ) {
-
- time_current= PIL_check_seconds_timer();
- time_redraw= (float)(time_current-time_lastdraw);
- time_redraw_clamped= MIN2(0.05, time_redraw); /* clamt the redraw time to avoid jitter in roll correction */
- time_lastdraw= time_current;
- /*fprintf(stderr, "%f\n", time_redraw);*/ /* 0.002 is a small redraw 0.02 is larger */
-
- /* Scale the time to use shift to scale the speed down- just like
- shift slows many other areas of blender down */
- if (G.qual & LR_SHIFTKEY)
- speed= speed * (1-time_redraw_clamped);
-
- Mat3CpyMat4(mat, G.vd->viewinv);
-
- if (pan_view) {
- /* pan only */
- dvec_tmp[0]= -moffset[0];
- dvec_tmp[1]= -moffset[1];
- dvec_tmp[2]= 0;
-
- if (G.qual & LR_SHIFTKEY) {
- dvec_tmp[0] *= 0.1;
- dvec_tmp[1] *= 0.1;
- }
-
- Mat3MulVecfl(mat, dvec_tmp);
- VecMulf(dvec_tmp, time_redraw*200.0 * G.vd->grid);
-
- } else {
- /* rotate about the X axis- look up/down */
- if (moffset[1]) {
- upvec[0]=1;
- upvec[1]=0;
- upvec[2]=0;
- Mat3MulVecfl(mat, upvec);
- VecRotToQuat( upvec, (float)moffset[1]*-time_redraw*20, tmp_quat); /* Rotate about the relative up vec */
- QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat);
-
- if (xlock) xlock = 2; /*check for rotation*/
- if (zlock) zlock = 2;
- xlock_momentum= 0.0;
- }
-
- /* rotate about the Y axis- look left/right */
- if (moffset[0]) {
-
- if (zlock) {
- upvec[0]=0;
- upvec[1]=0;
- upvec[2]=1;
- } else {
- upvec[0]=0;
- upvec[1]=1;
- upvec[2]=0;
- Mat3MulVecfl(mat, upvec);
- }
-
- VecRotToQuat( upvec, (float)moffset[0]*time_redraw*20, tmp_quat); /* Rotate about the relative up vec */
- QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat);
-
- if (xlock) xlock = 2;/*check for rotation*/
- if (zlock) zlock = 2;
- }
-
- if (zlock==2) {
- upvec[0]=1;
- upvec[1]=0;
- upvec[2]=0;
- Mat3MulVecfl(mat, upvec);
-
- /*make sure we have some z rolling*/
- if (fabs(upvec[2]) > 0.00001) {
- roll= upvec[2]*5;
- upvec[0]=0; /*rotate the view about this axis*/
- upvec[1]=0;
- upvec[2]=1;
-
- Mat3MulVecfl(mat, upvec);
- VecRotToQuat( upvec, roll*time_redraw_clamped*zlock_momentum*0.1, tmp_quat); /* Rotate about the relative up vec */
- QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat);
-
- zlock_momentum += 0.05;
- } else {
- zlock=1; /* dont check until the view rotates again */
- zlock_momentum= 0.0;
- }
- }
-
- if (xlock==2 && moffset[1]==0) { /*only apply xcorrect when mouse isnt applying x rot*/
- upvec[0]=0;
- upvec[1]=0;
- upvec[2]=1;
- Mat3MulVecfl(mat, upvec);
- /*make sure we have some z rolling*/
- if (fabs(upvec[2]) > 0.00001) {
- roll= upvec[2]*-5;
-
- upvec[0]=1; /*rotate the view about this axis*/
- upvec[1]=0;
- upvec[2]=0;
-
- Mat3MulVecfl(mat, upvec);
-
- VecRotToQuat( upvec, roll*time_redraw_clamped*xlock_momentum*0.1, tmp_quat); /* Rotate about the relative up vec */
- QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat);
-
- xlock_momentum += 0.05;
- } else {
- xlock=1; /* see above */
- xlock_momentum= 0.0;
- }
- }
-
-
- if (apply_rotation) {
- /* Normal operation */
- /* define dvec, view direction vector */
- dvec_tmp[0]= dvec_tmp[1]= dvec_tmp[2]= 0;
- /* move along the current axis */
- dvec_tmp[axis]= 1.0f;
-
- Mat3MulVecfl(mat, dvec_tmp);
-
- VecMulf(dvec_tmp, speed*time_redraw*0.25);
- }
- }
-
- /* impose a directional lag */
- dvec_lag = 1.0/(1+(time_redraw*5));
- dvec[0] = dvec_tmp[0]*(1-dvec_lag) + dvec_old[0]*dvec_lag;
- dvec[1] = dvec_tmp[1]*(1-dvec_lag) + dvec_old[1]*dvec_lag;
- dvec[2] = dvec_tmp[2]*(1-dvec_lag) + dvec_old[2]*dvec_lag;
-
-
- if (G.vd->persp==V3D_CAMOB) {
- if (G.vd->camera->protectflag & OB_LOCK_LOCX)
- dvec[0] = 0.0;
- if (G.vd->camera->protectflag & OB_LOCK_LOCY)
- dvec[1] = 0.0;
- if (G.vd->camera->protectflag & OB_LOCK_LOCZ)
- dvec[2] = 0.0;
- }
-
- VecAddf(G.vd->ofs, G.vd->ofs, dvec);
- if (zlock && xlock)
- headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X on/Z on, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB");
- else if (zlock)
- headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X off/Z on, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB");
- else if (xlock)
- headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X on/Z off, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB");
- else
- headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X off/Z off, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB");
-
- do_screenhandlers(G.curscreen); /* advance the next frame */
-
- /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */
- if (G.vd->persp==V3D_CAMOB) {
- G.vd->persp= V3D_PERSP; /*set this so setviewmatrixview3d uses the ofs and quat instead of the camera */
- setviewmatrixview3d();
- setcameratoview3d();
- G.vd->persp= V3D_CAMOB;
-
- /* record the motion */
- if (IS_AUTOKEY_MODE(NORMAL) && (!playing_anim || cfra != G.scene->r.cfra)) {
- cfra = G.scene->r.cfra;
-
- if (xlock || zlock || moffset[0] || moffset[1]) {
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_X, 0);
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Y, 0);
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Z, 0);
- }
- if (speed) {
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_X, 0);
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Y, 0);
- insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z, 0);
- }
- }
- }
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- } else
- /*were not redrawing but we need to update the time else the view will jump */
- time_lastdraw= PIL_check_seconds_timer();
- /* end drawing */
- VECCOPY(dvec_old, dvec);
- }
-
- G.vd->dist= dist_backup;
-
- /* Revert to original view? */
- if (action == 2) { /* action == 2 means the user pressed Esc of RMB, and not to apply view to camera */
- if (persp_backup==V3D_CAMOB) { /* a camera view */
- G.vd->viewbut=1;
- VECCOPY(G.vd->camera->loc, ofs_backup);
- VECCOPY(G.vd->camera->rot, rot_backup);
- DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB);
- } else {
- /* Non Camera we need to reset the view back to the original location bacause the user canceled*/
- QUATCOPY(G.vd->viewquat, rot_backup);
- VECCOPY(G.vd->ofs, ofs_backup);
- G.vd->persp= persp_backup;
- }
- }
- else if (persp_backup==V3D_CAMOB) { /* camera */
- float mat3[3][3];
- Mat3CpyMat4(mat3, G.vd->camera->obmat);
- Mat3ToCompatibleEul(mat3, G.vd->camera->rot, rot_backup);
-
- DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB);
-
- if (IS_AUTOKEY_MODE(NORMAL)) {
- allqueue(REDRAWIPO, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWTIME, 0);
- }
- }
- else { /* not camera */
- /* Apply the fly mode view */
- /*restore the dist*/
- upvec[0]= upvec[1]= 0;
- upvec[2]=dist_backup; /*x and y are 0*/
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecAddf(G.vd->ofs, G.vd->ofs, upvec);
- /*Done with correcting for the dist */
- }
-
- G.vd->flag2 &= ~V3D_FLYMODE;
- allqueue(REDRAWVIEW3D, 0);
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); /* not working at the moment not sure why */
-}
-
-void view3d_edit_clipping(View3D *v3d)
-{
-
- if(v3d->flag & V3D_CLIPPING) {
- v3d->flag &= ~V3D_CLIPPING;
- scrarea_queue_winredraw(curarea);
- if(v3d->clipbb) MEM_freeN(v3d->clipbb);
- v3d->clipbb= NULL;
- }
- else {
- rcti rect;
- double mvmatrix[16];
- double projmatrix[16];
- double xs, ys, p[3];
- GLint viewport[4];
- short val;
-
- /* get border in window coords */
- setlinestyle(2);
- val= get_border(&rect, 3);
- setlinestyle(0);
- if(val==0) return;
-
- v3d->flag |= V3D_CLIPPING;
- v3d->clipbb= MEM_callocN(sizeof(BoundBox), "clipbb");
-
- /* convert border to 3d coordinates */
-
- /* Get the matrices needed for gluUnProject */
- glGetIntegerv(GL_VIEWPORT, viewport);
- glGetDoublev(GL_MODELVIEW_MATRIX, mvmatrix);
- glGetDoublev(GL_PROJECTION_MATRIX, projmatrix);
-
- /* near zero floating point values can give issues with gluUnProject
- in side view on some implementations */
- if(fabs(mvmatrix[0]) < 1e-6) mvmatrix[0]= 0.0;
- if(fabs(mvmatrix[5]) < 1e-6) mvmatrix[5]= 0.0;
-
- /* Set up viewport so that gluUnProject will give correct values */
- viewport[0] = 0;
- viewport[1] = 0;
-
- /* four clipping planes and bounding volume */
- /* first do the bounding volume */
- for(val=0; val<4; val++) {
-
- xs= (val==0||val==3)?rect.xmin:rect.xmax;
- ys= (val==0||val==1)?rect.ymin:rect.ymax;
-
- gluUnProject(xs, ys, 0.0, mvmatrix, projmatrix, viewport, &p[0], &p[1], &p[2]);
- VECCOPY(v3d->clipbb->vec[val], p);
-
- gluUnProject(xs, ys, 1.0, mvmatrix, projmatrix, viewport, &p[0], &p[1], &p[2]);
- VECCOPY(v3d->clipbb->vec[4+val], p);
- }
-
- /* then plane equations */
- for(val=0; val<4; val++) {
-
- CalcNormFloat(v3d->clipbb->vec[val], v3d->clipbb->vec[val==3?0:val+1], v3d->clipbb->vec[val+4],
- v3d->clip[val]);
-
- v3d->clip[val][3]= - v3d->clip[val][0]*v3d->clipbb->vec[val][0]
- - v3d->clip[val][1]*v3d->clipbb->vec[val][1]
- - v3d->clip[val][2]*v3d->clipbb->vec[val][2];
- }
- }
-}
-
diff --git a/source/blender/src/eventdebug.c b/source/blender/src/eventdebug.c
deleted file mode 100644
index c21b2bee81b..00000000000
--- a/source/blender/src/eventdebug.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#include "mydevice.h"
-#include "blendef.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-char *event_to_string(short);
-
-char *event_to_string(short evt) {
-#define smap(evt) case evt: return #evt
- switch (evt) {
- default: return "<unknown>";
- smap(CHANGED);
- smap(DRAWEDGES);
- smap(BACKBUFDRAW);
- smap(EXECUTE);
- smap(LOAD_FILE);
- smap(RESHAPE);
- smap(UI_BUT_EVENT);
- smap(REDRAWVIEW3D);
- smap(REDRAWVIEWCAM);
- smap(REDRAWHEADERS);
- smap(REDRAWVIEW3D_Z);
- smap(REDRAWALL);
- smap(REDRAWINFO);
- smap(RENDERPREVIEW);
- smap(REDRAWIPO);
- smap(REDRAWDATASELECT);
- smap(REDRAWSEQ);
- smap(REDRAWIMAGE);
- smap(REDRAWOOPS);
- smap(REDRAWIMASEL);
- smap(AFTERIMASELIMA);
- smap(AFTERIMASELGET);
- smap(AFTERIMAWRITE);
- smap(IMALEFTMOUSE);
- smap(AFTERPIBREAD);
- smap(REDRAWTEXT);
- smap(REDRAWSCRIPT);
- smap(REDRAWACTION);
- smap(LEFTMOUSE);
- smap(MIDDLEMOUSE);
- smap(RIGHTMOUSE);
- smap(MOUSEX);
- smap(MOUSEY);
- smap(TIMER0);
- smap(TIMER1);
- smap(TIMER2);
- smap(TIMER3);
- smap(KEYBD);
- smap(RAWKEYBD);
- smap(REDRAW);
- smap(INPUTCHANGE);
- smap(QFULL);
- smap(WINFREEZE);
- smap(WINTHAW);
- smap(WINCLOSE);
- smap(WINQUIT);
- smap(Q_FIRSTTIME);
- smap(AKEY);
- smap(BKEY);
- smap(CKEY);
- smap(DKEY);
- smap(EKEY);
- smap(FKEY);
- smap(GKEY);
- smap(HKEY);
- smap(IKEY);
- smap(JKEY);
- smap(KKEY);
- smap(LKEY);
- smap(MKEY);
- smap(NKEY);
- smap(OKEY);
- smap(PKEY);
- smap(QKEY);
- smap(RKEY);
- smap(SKEY);
- smap(TKEY);
- smap(UKEY);
- smap(VKEY);
- smap(WKEY);
- smap(XKEY);
- smap(YKEY);
- smap(ZKEY);
- smap(ZEROKEY);
- smap(ONEKEY);
- smap(TWOKEY);
- smap(THREEKEY);
- smap(FOURKEY);
- smap(FIVEKEY);
- smap(SIXKEY);
- smap(SEVENKEY);
- smap(EIGHTKEY);
- smap(NINEKEY);
- smap(CAPSLOCKKEY);
- smap(LEFTCTRLKEY);
- smap(LEFTALTKEY);
- smap(RIGHTALTKEY);
- smap(RIGHTCTRLKEY);
- smap(RIGHTSHIFTKEY);
- smap(LEFTSHIFTKEY);
- smap(ESCKEY);
- smap(TABKEY);
- smap(RETKEY);
- smap(SPACEKEY);
- smap(LINEFEEDKEY);
- smap(BACKSPACEKEY);
- smap(DELKEY);
- smap(SEMICOLONKEY);
- smap(PERIODKEY);
- smap(COMMAKEY);
- smap(QUOTEKEY);
- smap(ACCENTGRAVEKEY);
- smap(MINUSKEY);
- smap(SLASHKEY);
- smap(BACKSLASHKEY);
- smap(EQUALKEY);
- smap(LEFTBRACKETKEY);
- smap(RIGHTBRACKETKEY);
- smap(LEFTARROWKEY);
- smap(DOWNARROWKEY);
- smap(RIGHTARROWKEY);
- smap(UPARROWKEY);
- smap(PAD0);
- smap(PAD1);
- smap(PAD2);
- smap(PAD3);
- smap(PAD4);
- smap(PAD5);
- smap(PAD6);
- smap(PAD7);
- smap(PAD8);
- smap(PAD9);
- smap(PADPERIOD);
- smap(PADSLASHKEY);
- smap(PADASTERKEY);
- smap(PADMINUS);
- smap(PADENTER);
- smap(PADPLUSKEY);
- smap(F1KEY);
- smap(F2KEY);
- smap(F3KEY);
- smap(F4KEY);
- smap(F5KEY);
- smap(F6KEY);
- smap(F7KEY);
- smap(F8KEY);
- smap(F9KEY);
- smap(F10KEY);
- smap(F11KEY);
- smap(F12KEY);
- smap(PAUSEKEY);
- smap(INSERTKEY);
- smap(HOMEKEY);
- smap(PAGEUPKEY);
- smap(PAGEDOWNKEY);
- smap(ENDKEY);
- smap(REDRAWNLA);
- smap(ONLOAD_SCRIPT);
- }
- #undef smap
-}
diff --git a/source/blender/src/filelist.c b/source/blender/src/filelist.c
deleted file mode 100644
index c2c0f00885f..00000000000
--- a/source/blender/src/filelist.c
+++ /dev/null
@@ -1,1109 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-/* global includes */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#include <direct.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_linklist.h"
-#include "BLI_storage_types.h"
-
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BIF_filelist.h"
-#include "BKE_library.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BLO_readfile.h"
-
-#include "DNA_space_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_ID.h"
-#include "DNA_object_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_thumbs.h"
-
-#include "PIL_time.h"
-
-#include "datatoc.h"
-
-/* Elubie: VERY, really very ugly and evil! Remove asap!!! */
-/* for state of file */
-#define ACTIVE 2
-
-/* max length of library group name within filesel */
-#define GROUP_MAX 32
-
-typedef struct FileList
-{
- struct direntry *filelist;
- int *fidx;
-
- int numfiles;
- int numfiltered;
- char dir[FILE_MAX];
- short type;
- short ipotype;
- struct BlendHandle *libfiledata;
- int has_func;
- short prv_w;
- short prv_h;
- short hide_dot;
- unsigned int filter;
-} FileList;
-
-int BIF_groupname_to_code(char *group)
-{
- char buf[32];
- char *lslash;
-
- BLI_strncpy(buf, group, 31);
- lslash= BLI_last_slash(buf);
- if (lslash)
- lslash[0]= '\0';
-
- return BLO_idcode_from_name(buf);
-}
-
-
-#define SPECIAL_IMG_SIZE 48
-#define SPECIAL_IMG_ROWS 4
-#define SPECIAL_IMG_COLS 4
-
-#define SPECIAL_IMG_FOLDER 0
-#define SPECIAL_IMG_PARENT 1
-#define SPECIAL_IMG_REFRESH 2
-#define SPECIAL_IMG_BLENDFILE 3
-#define SPECIAL_IMG_SOUNDFILE 4
-#define SPECIAL_IMG_MOVIEFILE 5
-#define SPECIAL_IMG_PYTHONFILE 6
-#define SPECIAL_IMG_TEXTFILE 7
-#define SPECIAL_IMG_FONTFILE 8
-#define SPECIAL_IMG_UNKNOWNFILE 9
-#define SPECIAL_IMG_MAX SPECIAL_IMG_UNKNOWNFILE + 1
-
-static ImBuf* gSpecialFileImages[SPECIAL_IMG_MAX];
-
-
-/* ******************* SORT ******************* */
-
-static int compare_name(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- return (BLI_strcasecmp(entry1->relname,entry2->relname));
-}
-
-static int compare_date(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1;
- if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1;
-
- else return BLI_strcasecmp(entry1->relname,entry2->relname);
-}
-
-static int compare_size(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- if ( entry1->s.st_size < entry2->s.st_size) return 1;
- if ( entry1->s.st_size > entry2->s.st_size) return -1;
- else return BLI_strcasecmp(entry1->relname,entry2->relname);
-}
-
-static int compare_extension(const void *a1, const void *a2) {
- const struct direntry *entry1=a1, *entry2=a2;
- char *sufix1, *sufix2;
- char *nil="";
-
- if (!(sufix1= strstr (entry1->relname, ".blend.gz")))
- sufix1= strrchr (entry1->relname, '.');
- if (!(sufix2= strstr (entry2->relname, ".blend.gz")))
- sufix2= strrchr (entry2->relname, '.');
- if (!sufix1) sufix1= nil;
- if (!sufix2) sufix2= nil;
-
- /* type is is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (-1);
-
- return (BLI_strcasecmp(sufix1, sufix2));
-}
-
-void BIF_filelist_filter(FileList* filelist)
-{
- char dir[FILE_MAX], group[GROUP_MAX];
- int num_filtered = 0;
- int i, j;
-
- if (!filelist->filelist)
- return;
-
- if ( ( (filelist->type == FILE_LOADLIB) && BIF_filelist_islibrary(filelist, dir, group))
- || (filelist->type == FILE_MAIN) ) {
- filelist->filter = 0;
- }
-
- if (!filelist->filter) {
- if (filelist->fidx) {
- MEM_freeN(filelist->fidx);
- filelist->fidx = NULL;
- }
- filelist->fidx = (int *)MEM_callocN(filelist->numfiles*sizeof(int), "filteridx");
- for (i = 0; i < filelist->numfiles; ++i) {
- filelist->fidx[i] = i;
- }
- filelist->numfiltered = filelist->numfiles;
- return;
- }
-
- // How many files are left after filter ?
- for (i = 0; i < filelist->numfiles; ++i) {
- if (filelist->filelist[i].flags & filelist->filter) {
- num_filtered++;
- }
- else if (filelist->filelist[i].type & S_IFDIR) {
- if (filelist->filter & FOLDERFILE) {
- num_filtered++;
- }
- }
- }
-
- if (filelist->fidx) {
- MEM_freeN(filelist->fidx);
- filelist->fidx = NULL;
- }
- filelist->fidx = (int *)MEM_callocN(num_filtered*sizeof(int), "filteridx");
- filelist->numfiltered = num_filtered;
-
- for (i = 0, j=0; i < filelist->numfiles; ++i) {
- if (filelist->filelist[i].flags & filelist->filter) {
- filelist->fidx[j++] = i;
- }
- else if (filelist->filelist[i].type & S_IFDIR) {
- if (filelist->filter & FOLDERFILE) {
- filelist->fidx[j++] = i;
- }
- }
- }
-}
-
-void BIF_filelist_init_icons()
-{
- short x, y, k;
- ImBuf *bbuf;
- ImBuf *ibuf;
- bbuf = IMB_ibImageFromMemory((int *)datatoc_prvicons, datatoc_prvicons_size, IB_rect);
- if (bbuf) {
- for (y=0; y<SPECIAL_IMG_ROWS; y++) {
- for (x=0; x<SPECIAL_IMG_COLS; x++) {
- int tile = SPECIAL_IMG_COLS*y + x;
- if (tile < SPECIAL_IMG_MAX) {
- ibuf = IMB_allocImBuf(SPECIAL_IMG_SIZE, SPECIAL_IMG_SIZE, 32, IB_rect, 0);
- for (k=0; k<SPECIAL_IMG_SIZE; k++) {
- memcpy(&ibuf->rect[k*SPECIAL_IMG_SIZE], &bbuf->rect[(k+y*SPECIAL_IMG_SIZE)*SPECIAL_IMG_SIZE*SPECIAL_IMG_COLS+x*SPECIAL_IMG_SIZE], SPECIAL_IMG_SIZE*sizeof(int));
- }
- gSpecialFileImages[tile] = ibuf;
- }
- }
- }
- IMB_freeImBuf(bbuf);
- }
-
-}
-
-void BIF_filelist_free_icons()
-{
- int i;
- for (i=0; i < SPECIAL_IMG_MAX; ++i) {
- IMB_freeImBuf(gSpecialFileImages[i]);
- gSpecialFileImages[i] = NULL;
- }
-}
-
-struct FileList* BIF_filelist_new()
-{
- FileList* p = MEM_callocN( sizeof(FileList), "filelist" );
- p->filelist = 0;
- p->numfiles = 0;
- p->dir[0] = '\0';
- p->libfiledata = 0;
- p->type = 0;
- p->has_func = 0;
- p->filter = 0;
- return p;
-}
-
-struct FileList* BIF_filelist_copy(struct FileList* filelist)
-{
- FileList* p = BIF_filelist_new();
- BLI_strncpy(p->dir, filelist->dir, FILE_MAX);
- p->filelist = NULL;
- p->fidx = NULL;
- p->type = filelist->type;
- p->ipotype = filelist->ipotype;
- p->has_func = filelist->has_func;
-
- return p;
-}
-
-void BIF_filelist_free(struct FileList* filelist)
-{
- int i;
-
- if (!filelist) {
- printf("Attemtping to delete empty filelist.\n");
- return;
- }
-
- if (filelist->fidx) {
- MEM_freeN(filelist->fidx);
- filelist->fidx = NULL;
- }
-
- for (i = 0; i < filelist->numfiles; ++i) {
- if (filelist->filelist[i].image) {
- IMB_freeImBuf(filelist->filelist[i].image);
- }
- filelist->filelist[i].image = 0;
- if (filelist->filelist[i].relname)
- MEM_freeN(filelist->filelist[i].relname);
- filelist->filelist[i].relname = 0;
- if (filelist->filelist[i].string)
- MEM_freeN(filelist->filelist[i].string);
- filelist->filelist[i].string = 0;
- }
-
- filelist->numfiles = 0;
- free(filelist->filelist);
- filelist->filelist = 0;
- filelist->filter = 0;
- filelist->numfiltered =0;
-}
-
-void BIF_filelist_freelib(struct FileList* filelist)
-{
- if(filelist->libfiledata)
- BLO_blendhandle_close(filelist->libfiledata);
- filelist->libfiledata= 0;
-}
-
-struct BlendHandle *BIF_filelist_lib(struct FileList* filelist)
-{
- return filelist->libfiledata;
-}
-
-int BIF_filelist_numfiles(struct FileList* filelist)
-{
- return filelist->numfiltered;
-}
-
-const char * BIF_filelist_dir(struct FileList* filelist)
-{
- return filelist->dir;
-}
-
-void BIF_filelist_setdir(struct FileList* filelist, const char *dir)
-{
- BLI_strncpy(filelist->dir, dir, FILE_MAX);
-}
-
-void BIF_filelist_imgsize(struct FileList* filelist, short w, short h)
-{
- filelist->prv_w = w;
- filelist->prv_h = h;
-}
-
-void BIF_filelist_loadimage(struct FileList* filelist, int index)
-{
- ImBuf *imb = NULL;
- int imgwidth = filelist->prv_w;
- int imgheight = filelist->prv_h;
- short ex, ey, dx, dy;
- float scaledx, scaledy;
- int fidx = 0;
-
- if ( (index < 0) || (index >= filelist->numfiltered) ) {
- return;
- }
- fidx = filelist->fidx[index];
-
- if (!filelist->filelist[fidx].image)
- {
- if (filelist->type != FILE_MAIN)
- {
- if ( filelist->filelist[fidx].flags & IMAGEFILE ) {
- imb = IMB_thumb_manage(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL, THB_SOURCE_IMAGE);
- } else if ( filelist->filelist[fidx].flags & MOVIEFILE ) {
- imb = IMB_thumb_manage(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL, THB_SOURCE_MOVIE);
- if (!imb) {
- /* remember that file can't be loaded via IMB_open_anim */
- filelist->filelist[fidx].flags &= ~MOVIEFILE;
- filelist->filelist[fidx].flags |= MOVIEFILE_ICON;
- }
- }
- if (imb) {
- if (imb->x > imb->y) {
- scaledx = (float)imgwidth;
- scaledy = ( (float)imb->y/(float)imb->x )*imgwidth;
- }
- else {
- scaledy = (float)imgheight;
- scaledx = ( (float)imb->x/(float)imb->y )*imgheight;
- }
- ex = (short)scaledx;
- ey = (short)scaledy;
-
- dx = imgwidth - ex;
- dy = imgheight - ey;
-
- IMB_scaleImBuf(imb, ex, ey);
-
- }
- filelist->filelist[fidx].image = imb;
-
- }
- }
-}
-
-struct ImBuf * BIF_filelist_getimage(struct FileList* filelist, int index)
-{
- ImBuf* ibuf = NULL;
- int fidx = 0;
- if ( (index < 0) || (index >= filelist->numfiltered) ) {
- return NULL;
- }
- fidx = filelist->fidx[index];
- ibuf = filelist->filelist[fidx].image;
-
- if (ibuf == NULL) {
- struct direntry *file = &filelist->filelist[fidx];
- if (file->type & S_IFDIR) {
- if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT];
- } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH];
- } else {
- ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER];
- }
- } else {
- ibuf = gSpecialFileImages[SPECIAL_IMG_UNKNOWNFILE];
- }
-
- if (file->flags & BLENDERFILE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
- } else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
- } else if (file->flags & SOUNDFILE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_SOUNDFILE];
- } else if (file->flags & PYSCRIPTFILE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_PYTHONFILE];
- } else if (file->flags & FTFONTFILE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_FONTFILE];
- } else if (file->flags & TEXTFILE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_TEXTFILE];
- }
- }
- return ibuf;
-}
-
-struct direntry * BIF_filelist_file(struct FileList* filelist, int index)
-{
- int fidx = 0;
-
- if ( (index < 0) || (index >= filelist->numfiltered) ) {
- return NULL;
- }
- fidx = filelist->fidx[index];
-
- return &filelist->filelist[fidx];
-}
-
-int BIF_filelist_find(struct FileList* filelist, char *file)
-{
- int index = -1;
- int i;
- int fidx = -1;
-
- if (!filelist->fidx)
- return fidx;
-
-
- for (i = 0; i < filelist->numfiles; ++i) {
- if ( strcmp(filelist->filelist[i].relname, file) == 0) {
- index = i;
- break;
- }
- }
-
- for (i = 0; i < filelist->numfiltered; ++i) {
- if (filelist->fidx[i] == index) {
- fidx = i;
- break;
- }
- }
- return fidx;
-}
-
-void BIF_filelist_hidedot(struct FileList* filelist, short hide)
-{
- filelist->hide_dot = hide;
-}
-
-void BIF_filelist_setfilter(struct FileList* filelist, unsigned int filter)
-{
- filelist->filter = filter;
-}
-
-void BIF_filelist_readdir(struct FileList* filelist)
-{
- char wdir[FILE_MAX];
- int finished = 0;
-
- if (!filelist) return;
- filelist->fidx = 0;
- filelist->filelist = 0;
-
- if(filelist->type==FILE_MAIN) {
- BIF_filelist_from_main(filelist);
- finished = 1;
- } else if(filelist->type==FILE_LOADLIB) {
- BLI_cleanup_dir(G.sce, filelist->dir);
- BIF_filelist_from_library(filelist);
- if(filelist->libfiledata) {
- finished = 1;
- }
- }
-
- if (!finished) {
- BLI_getwdN(wdir);
-
- BLI_cleanup_dir(G.sce, filelist->dir);
- BLI_hide_dot_files(filelist->hide_dot);
- filelist->numfiles = BLI_getdir(filelist->dir, &(filelist->filelist));
-
- chdir(wdir);
- BIF_filelist_setfiletypes(filelist, G.have_quicktime);
- BIF_filelist_filter(filelist);
-
- }
-}
-
-int BIF_filelist_empty(struct FileList* filelist)
-{
- return filelist->filelist == 0;
-}
-
-void BIF_filelist_parent(struct FileList* filelist)
-{
- BLI_parent_dir(filelist->dir);
- BLI_make_exist(filelist->dir);
- BIF_filelist_readdir(filelist);
-}
-
-void BIF_filelist_setfiletypes(struct FileList* filelist, short has_quicktime)
-{
- struct direntry *file;
- int num;
-
- file= filelist->filelist;
-
- for(num=0; num<filelist->numfiles; num++, file++) {
- file->flags= 0;
- file->type= file->s.st_mode; /* restore the mess below */
-
- /* Don't check extensions for directories */
- if (file->type & S_IFDIR)
- continue;
-
-
-
- if(BLO_has_bfile_extension(file->relname)) {
- file->flags |= BLENDERFILE;
- if(filelist->type==FILE_LOADLIB) {
- char name[FILE_MAXDIR+FILE_MAXFILE];
- BLI_strncpy(name, filelist->dir, sizeof(name));
- strcat(name, file->relname);
-
- /* prevent current file being used as acceptable dir */
- if (BLI_streq(G.main->name, name)==0) {
- file->type &= ~S_IFMT;
- file->type |= S_IFDIR;
- }
- }
- } else if(BLI_testextensie(file->relname, ".py")) {
- file->flags |= PYSCRIPTFILE;
- } else if(BLI_testextensie(file->relname, ".txt")) {
- file->flags |= TEXTFILE;
- } else if( BLI_testextensie(file->relname, ".ttf")
- || BLI_testextensie(file->relname, ".ttc")
- || BLI_testextensie(file->relname, ".pfb")
- || BLI_testextensie(file->relname, ".otf")
- || BLI_testextensie(file->relname, ".otc")) {
- file->flags |= FTFONTFILE;
- } else if (has_quicktime){
- if( BLI_testextensie(file->relname, ".int")
- || BLI_testextensie(file->relname, ".inta")
- || BLI_testextensie(file->relname, ".jpg")
- || BLI_testextensie(file->relname, ".jpeg")
- || BLI_testextensie(file->relname, ".tga")
- || BLI_testextensie(file->relname, ".rgb")
- || BLI_testextensie(file->relname, ".rgba")
- || BLI_testextensie(file->relname, ".bmp")
- || BLI_testextensie(file->relname, ".png")
- || BLI_testextensie(file->relname, ".iff")
- || BLI_testextensie(file->relname, ".lbm")
- || BLI_testextensie(file->relname, ".gif")
- || BLI_testextensie(file->relname, ".psd")
- || BLI_testextensie(file->relname, ".tif")
- || BLI_testextensie(file->relname, ".tiff")
- || BLI_testextensie(file->relname, ".pct")
- || BLI_testextensie(file->relname, ".pict")
- || BLI_testextensie(file->relname, ".pntg") //macpaint
- || BLI_testextensie(file->relname, ".qtif")
- || BLI_testextensie(file->relname, ".sgi")
- || BLI_testextensie(file->relname, ".hdr")
-#ifdef WITH_DDS
- || BLI_testextensie(file->relname, ".dds")
-#endif
-#ifdef WITH_OPENEXR
- || BLI_testextensie(file->relname, ".exr")
-#endif
- ) {
- file->flags |= IMAGEFILE;
- }
- else if(BLI_testextensie(file->relname, ".avi")
- || BLI_testextensie(file->relname, ".flc")
- || BLI_testextensie(file->relname, ".mov")
- || BLI_testextensie(file->relname, ".movie")
- || BLI_testextensie(file->relname, ".mp4")
- || BLI_testextensie(file->relname, ".m4v")
- || BLI_testextensie(file->relname, ".mv")) {
- file->flags |= MOVIEFILE;
- }
- else if(BLI_testextensie(file->relname, ".wav")) {
- file->flags |= SOUNDFILE;
- }
- } else { // no quicktime
- if(BLI_testextensie(file->relname, ".int")
- || BLI_testextensie(file->relname, ".inta")
- || BLI_testextensie(file->relname, ".jpg")
- || BLI_testextensie(file->relname, ".tga")
- || BLI_testextensie(file->relname, ".rgb")
- || BLI_testextensie(file->relname, ".rgba")
- || BLI_testextensie(file->relname, ".bmp")
- || BLI_testextensie(file->relname, ".png")
- || BLI_testextensie(file->relname, ".iff")
- || BLI_testextensie(file->relname, ".tif")
- || BLI_testextensie(file->relname, ".tiff")
- || BLI_testextensie(file->relname, ".hdr")
-#ifdef WITH_DDS
- || BLI_testextensie(file->relname, ".dds")
-#endif
-#ifdef WITH_OPENEXR
- || BLI_testextensie(file->relname, ".exr")
-#endif
- || BLI_testextensie(file->relname, ".lbm")
- || BLI_testextensie(file->relname, ".sgi")) {
- file->flags |= IMAGEFILE;
- }
- else if(BLI_testextensie(file->relname, ".avi")
- || BLI_testextensie(file->relname, ".mp4")
- || BLI_testextensie(file->relname, ".mv")) {
- file->flags |= MOVIEFILE;
- }
- else if(BLI_testextensie(file->relname, ".wav")) {
- file->flags |= SOUNDFILE;
- }
- }
- }
-}
-
-void BIF_filelist_swapselect(struct FileList* filelist)
-{
- struct direntry *file;
- int num, act= 0;
-
- file= filelist->filelist;
- for(num=0; num<filelist->numfiles; num++, file++) {
- if(file->flags & ACTIVE) {
- act= 1;
- break;
- }
- }
- file= filelist->filelist+2;
- for(num=2; num<filelist->numfiles; num++, file++) {
- if(act) file->flags &= ~ACTIVE;
- else file->flags |= ACTIVE;
- }
-}
-
-int BIF_filelist_islibrary(struct FileList* filelist, char* dir, char* group)
-{
- /* return ok when a blenderfile, in dir is the filename,
- * in group the type of libdata
- */
- int len;
- char *fd;
-
- strcpy(dir, filelist->dir);
- len= strlen(dir);
- if(len<7) return 0;
- if( dir[len-1] != '/' && dir[len-1] != '\\') return 0;
-
- group[0]= 0;
- dir[len-1]= 0;
-
- /* Find the last slash */
- fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\');
-
- if(fd==0) return 0;
- *fd= 0;
- if(BLO_has_bfile_extension(fd+1)) {
- *fd= '/';
- }
- else {
- char *gp = fd+1; // in case we have a .blend file, gp points to the group
-
- /* Find the last slash */
- fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\');
- if (!fd || !BLO_has_bfile_extension(fd+1)) return 0;
-
- /* now we know that we are in a blend file and it is safe to
- assume that gp actually points to a group */
- BLI_strncpy(group, gp, GROUP_MAX);
- }
- return 1;
-}
-
-void BIF_filelist_from_library(struct FileList* filelist)
-{
- LinkNode *l, *names, *previews;
- struct ImBuf* ima;
- int ok, i, nnames, idcode;
- char filename[FILE_MAXDIR+FILE_MAXFILE];
- char dir[FILE_MAX], group[GROUP_MAX];
-
- filelist->type = FILE_LOADLIB;
-
- /* name test */
- ok= BIF_filelist_islibrary(filelist, dir, group);
- if (!ok) {
- /* free */
- if(filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata);
- filelist->libfiledata= 0;
- return;
- }
-
- BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI
-
- /* there we go */
- /* for the time being only read filedata when libfiledata==0 */
- if (filelist->libfiledata==0) {
- filelist->libfiledata= BLO_blendhandle_from_file(dir);
- if(filelist->libfiledata==0) return;
- }
-
- idcode= BIF_groupname_to_code(group);
-
- // memory for strings is passed into filelist[i].relname
- // and free'd in freefilelist
- previews = NULL;
- if (idcode) {
- previews= BLO_blendhandle_get_previews(filelist->libfiledata, idcode);
- names= BLO_blendhandle_get_datablock_names(filelist->libfiledata, idcode);
- /* ugh, no rewind, need to reopen */
- BLO_blendhandle_close(filelist->libfiledata);
- filelist->libfiledata= BLO_blendhandle_from_file(dir);
-
- } else {
- names= BLO_blendhandle_get_linkable_groups(filelist->libfiledata);
- }
-
- nnames= BLI_linklist_length(names);
-
- filelist->numfiles= nnames + 2;
- filelist->filelist= malloc(filelist->numfiles * sizeof(*filelist->filelist));
- memset(filelist->filelist, 0, filelist->numfiles * sizeof(*filelist->filelist));
-
- filelist->filelist[0].relname= BLI_strdup(".");
- filelist->filelist[0].type |= S_IFDIR;
- filelist->filelist[1].relname= BLI_strdup("..");
- filelist->filelist[1].type |= S_IFDIR;
-
- for (i=0, l= names; i<nnames; i++, l= l->next) {
- char *blockname= l->link;
-
- filelist->filelist[i + 2].relname= BLI_strdup(blockname);
- if (!idcode)
- filelist->filelist[i + 2].type |= S_IFDIR;
- }
-
- if(previews) {
- for (i=0, l= previews; i<nnames; i++, l= l->next) {
- PreviewImage *img= l->link;
-
- if (img) {
- unsigned int w = img->w[PREVIEW_MIPMAP_LARGE];
- unsigned int h = img->h[PREVIEW_MIPMAP_LARGE];
- unsigned int *rect = img->rect[PREVIEW_MIPMAP_LARGE];
-
- /* first allocate imbuf for copying preview into it */
- if (w > 0 && h > 0 && rect) {
- ima = IMB_allocImBuf(w, h, 32, IB_rect, 0);
- memcpy(ima->rect, rect, w*h*sizeof(unsigned int));
- filelist->filelist[i + 2].image = ima;
- filelist->filelist[i + 2].flags = IMAGEFILE;
- }
- }
- }
- }
-
- BLI_linklist_free(names, free);
- if (previews) BLI_linklist_free(previews, (void(*)(void*)) MEM_freeN);
-
- BIF_filelist_sort(filelist, FILE_SORTALPHA);
-
- BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change
-
- filelist->filter = 0;
- BIF_filelist_filter(filelist);
-}
-
-void BIF_filelist_append_library(struct FileList *filelist, char *dir, char *file, short flag, int idcode)
-{
- BLO_library_append_(&filelist->libfiledata, filelist->filelist, filelist->numfiles, dir, file, flag, idcode);
-}
-
-void BIF_filelist_from_main(struct FileList *filelist)
-{
- ID *id;
- struct direntry *files, *firstlib = NULL;
- ListBase *lb;
- int a, fake, idcode, ok, totlib, totbl;
-
- filelist->type = FILE_MAIN;
-
- if(filelist->dir[0]=='/') filelist->dir[0]= 0;
-
- if(filelist->dir[0]) {
- idcode= BIF_groupname_to_code(filelist->dir);
- if(idcode==0) filelist->dir[0]= 0;
- }
-
- if( filelist->dir[0]==0) {
-
- /* make directories */
- filelist->numfiles= 23;
- filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry));
-
- for(a=0; a<filelist->numfiles; a++) {
- memset( &(filelist->filelist[a]), 0 , sizeof(struct direntry));
- filelist->filelist[a].type |= S_IFDIR;
- }
-
- filelist->filelist[0].relname= BLI_strdup("..");
- filelist->filelist[1].relname= BLI_strdup(".");
- filelist->filelist[2].relname= BLI_strdup("Scene");
- filelist->filelist[3].relname= BLI_strdup("Object");
- filelist->filelist[4].relname= BLI_strdup("Mesh");
- filelist->filelist[5].relname= BLI_strdup("Curve");
- filelist->filelist[6].relname= BLI_strdup("Metaball");
- filelist->filelist[7].relname= BLI_strdup("Material");
- filelist->filelist[8].relname= BLI_strdup("Texture");
- filelist->filelist[9].relname= BLI_strdup("Image");
- filelist->filelist[10].relname= BLI_strdup("Ika");
- filelist->filelist[11].relname= BLI_strdup("Wave");
- filelist->filelist[12].relname= BLI_strdup("Lattice");
- filelist->filelist[13].relname= BLI_strdup("Lamp");
- filelist->filelist[14].relname= BLI_strdup("Camera");
- filelist->filelist[15].relname= BLI_strdup("Ipo");
- filelist->filelist[16].relname= BLI_strdup("World");
- filelist->filelist[17].relname= BLI_strdup("Screen");
- filelist->filelist[18].relname= BLI_strdup("VFont");
- filelist->filelist[19].relname= BLI_strdup("Text");
- filelist->filelist[20].relname= BLI_strdup("Armature");
- filelist->filelist[21].relname= BLI_strdup("Action");
- filelist->filelist[22].relname= BLI_strdup("NodeTree");
- BIF_filelist_sort(filelist, FILE_SORTALPHA);
- }
- else {
-
- /* make files */
- idcode= BIF_groupname_to_code(filelist->dir);
-
- lb= wich_libbase(G.main, idcode );
- if(lb==0) return;
-
- id= lb->first;
- filelist->numfiles= 0;
- while(id) {
-
- if(filelist->has_func && idcode==ID_IP) {
- if(filelist->ipotype== ((Ipo *)id)->blocktype) filelist->numfiles++;
- }
- else if (!filelist->hide_dot || id->name[2] != '.') {
- filelist->numfiles++;
- }
-
- id= id->next;
- }
-
- if(!filelist->has_func) filelist->numfiles+= 2;
- filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry));
-
- files = filelist->filelist;
-
- if(!filelist->has_func) {
- memset( &(filelist->filelist[0]), 0 , sizeof(struct direntry));
- filelist->filelist[0].relname= BLI_strdup(".");
- filelist->filelist[0].type |= S_IFDIR;
- memset( &(filelist->filelist[1]), 0 , sizeof(struct direntry));
- filelist->filelist[1].relname= BLI_strdup("..");
- filelist->filelist[1].type |= S_IFDIR;
-
- files+= 2;
- }
-
- id= lb->first;
- totlib= totbl= 0;
-
- while(id) {
-
- ok= 0;
- if(filelist->has_func && idcode==ID_IP) {
- if(filelist->ipotype== ((Ipo *)id)->blocktype) ok= 1;
- }
- else ok= 1;
-
- if(ok) {
- /* TODO: hide dot files - elubie */
- memset( files, 0 , sizeof(struct direntry));
- if(id->lib==NULL)
- files->relname= BLI_strdup(id->name+2);
- else {
- files->relname= MEM_mallocN(FILE_MAXDIR+FILE_MAXFILE+32, "filename for lib");
- sprintf(files->relname, "%s | %s", id->lib->name, id->name+2);
- }
- /* files->type |= S_IFDIR; */
- if(!filelist->has_func) { /* F4 DATA BROWSE */
- if(idcode==ID_OB) {
- if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVE;
- }
- else if(idcode==ID_SCE) {
- if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVE;
- }
- }
- files->nr= totbl+1;
- files->poin= id;
- fake= id->flag & LIB_FAKEUSER;
- if(idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) {
- files->flags |= IMAGEFILE;
- }
- if(id->lib && fake) sprintf(files->extra, "LF %d", id->us);
- else if(id->lib) sprintf(files->extra, "L %d", id->us);
- else if(fake) sprintf(files->extra, "F %d", id->us);
- else sprintf(files->extra, " %d", id->us);
-
- if(id->lib) {
- if(totlib==0) firstlib= files;
- totlib++;
- }
-
- files++;
- totbl++;
- }
-
- id= id->next;
- }
-
- /* only qsort of library blocks */
- if(totlib>1) {
- qsort(firstlib, totlib, sizeof(struct direntry), compare_name);
- }
- }
- filelist->filter = 0;
- BIF_filelist_filter(filelist);
-}
-
-
-void BIF_filelist_settype(struct FileList* filelist, int type)
-{
- filelist->type = type;
-}
-
-short BIF_filelist_gettype(struct FileList* filelist)
-{
- return filelist->type;
-}
-
-void BIF_filelist_sort(struct FileList* filelist, short sort)
-{
- struct direntry *file;
- int num;/* , act= 0; */
-
- switch(sort) {
- case FILE_SORTALPHA:
- qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_name);
- break;
- case FILE_SORTDATE:
- qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_date);
- break;
- case FILE_SORTSIZE:
- qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_size);
- break;
- case FILE_SORTEXTENS:
- qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_extension);
- }
-
- file= filelist->filelist;
- for(num=0; num<filelist->numfiles; num++, file++) {
- file->flags &= ~HILITE;
- }
- BIF_filelist_filter(filelist);
-}
-
-
-void BIF_filelist_setipotype(struct FileList* filelist, short ipotype)
-{
- filelist->ipotype = ipotype;
-}
-
-void BIF_filelist_hasfunc(struct FileList* filelist, int has_func)
-{
- filelist->has_func = has_func;
-}
-
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
deleted file mode 100644
index ee1fc523395..00000000000
--- a/source/blender/src/filesel.c
+++ /dev/null
@@ -1,2649 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#ifdef WIN32
-#include <io.h>
-#include <direct.h>
-#include "BLI_winstuff.h"
-#else
-#include <unistd.h>
-#include <sys/times.h>
-#endif
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_linklist.h"
-#include "BLI_storage_types.h"
-#include "BLI_dynstr.h"
-
-#include "IMB_imbuf.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_action.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_font.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editview.h"
-#include "BIF_filelist.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-
-#include "BLO_readfile.h"
-
-#include "BDR_editcurve.h"
-#include "BDR_editobject.h"
-
-#include "BSE_filesel.h"
-#include "BSE_view.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "nla.h"
-
-#include "BIF_fsmenu.h" /* include ourselves */
-
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif
-
-#if defined __BeOS
-static int fnmatch(const char *pattern, const char *string, int flags)
-{
- return 0;
-}
-#elif defined WIN32 && !defined _LIBC
- /* use fnmatch included in blenlib */
- #include "BLI_fnmatch.h"
-#else
- #include <fnmatch.h>
-#endif
-
-#ifndef WIN32
-#include <sys/param.h>
-#endif
-
-#define FILESELHEAD 60
-#define FILESEL_DY 16
-
-/* for events */
-#define NOTACTIVE 0
-#define ACTIVATE 1
-#define INACTIVATE 2
-/* for state of file */
-#define ACTIVE 2
-
-#define STARTSWITH(x, y) (strncmp(x, y, sizeof(x) - 1) == 0)
-
-/* button events */
-#define B_FS_FILENAME 1
-#define B_FS_DIRNAME 2
-#define B_FS_DIR_MENU 3
-#define B_FS_PARDIR 4
-#define B_FS_LOAD 5
-#define B_FS_CANCEL 6
-#define B_FS_LIBNAME 7
-
-/* max length of library group name within filesel */
-#define GROUP_MAX 32
-
-static int is_a_library(SpaceFile *sfile, char *dir, char *group);
-static void do_library_append(SpaceFile *sfile);
-static void library_to_filelist(SpaceFile *sfile);
-static void filesel_select_objects(struct SpaceFile *sfile);
-static void active_file_object(struct SpaceFile *sfile);
-static int groupname_to_code(char *group);
-
-extern void countall(void);
-
-/* very bad local globals */
-
-static rcti scrollrct, textrct, bar;
-static int filebuty1, filebuty2, page_ofs, collumwidth, selecting=0;
-static int filetoname= 0;
-static float pixels_to_ofs;
-static char otherdir[FILE_MAX];
-static ScrArea *otherarea;
-
-/* ******************* SORT ******************* */
-
-static int compare_name(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- return (BLI_strcasecmp(entry1->relname,entry2->relname));
-}
-
-static int compare_date(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1;
- if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1;
-
- else return BLI_strcasecmp(entry1->relname,entry2->relname);
-}
-
-static int compare_size(const void *a1, const void *a2)
-{
- const struct direntry *entry1=a1, *entry2=a2;
-
- /* type is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
-
- if ( entry1->s.st_size < entry2->s.st_size) return 1;
- if ( entry1->s.st_size > entry2->s.st_size) return -1;
- else return BLI_strcasecmp(entry1->relname,entry2->relname);
-}
-
-static int compare_extension(const void *a1, const void *a2) {
- const struct direntry *entry1=a1, *entry2=a2;
- char *sufix1, *sufix2;
- char *nil="";
-
- if (!(sufix1= strstr (entry1->relname, ".blend.gz")))
- sufix1= strrchr (entry1->relname, '.');
- if (!(sufix2= strstr (entry2->relname, ".blend.gz")))
- sufix2= strrchr (entry2->relname, '.');
- if (!sufix1) sufix1= nil;
- if (!sufix2) sufix2= nil;
-
- /* type is is equal to stat.st_mode */
-
- if (S_ISDIR(entry1->type)){
- if (S_ISDIR(entry2->type)==0) return (-1);
- } else{
- if (S_ISDIR(entry2->type)) return (1);
- }
- if (S_ISREG(entry1->type)){
- if (S_ISREG(entry2->type)==0) return (-1);
- } else{
- if (S_ISREG(entry2->type)) return (1);
- }
- if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1);
- if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
-
- /* make sure "." and ".." are always first */
- if( strcmp(entry1->relname, ".")==0 ) return (-1);
- if( strcmp(entry2->relname, ".")==0 ) return (1);
- if( strcmp(entry1->relname, "..")==0 ) return (-1);
- if( strcmp(entry2->relname, "..")==0 ) return (-1);
-
- return (BLI_strcasecmp(sufix1, sufix2));
-}
-
-/* **************************************** */
-static int filesel_has_func(SpaceFile *sfile)
-{
- if(sfile->returnfunc || sfile->returnfunc_event || sfile->returnfunc_args)
- return 1;
- return 0;
-}
-
-void filesel_statistics(SpaceFile *sfile, int *totfile, int *selfile, float *totlen, float *sellen)
-{
- double len;
- int a;
-
- *totfile= *selfile= 0;
- *totlen= *sellen= 0;
-
- if(sfile->filelist==0) return;
-
- for(a=0; a<sfile->totfile; a++) {
- if( (sfile->filelist[a].type & S_IFDIR)==0 ) {
- (*totfile) ++;
-
- len = sfile->filelist[a].s.st_size;
- (*totlen) += (float)(len/1048576.0);
-
- if(sfile->filelist[a].flags & ACTIVE) {
- (*selfile) ++;
- (*sellen) += (float)(len/1048576.0);
- }
- }
- }
-}
-
-/* *************** HELP FUNCTIONS ******************* */
-
-
-/* not called when browsing .blend itself */
-void test_flags_file(SpaceFile *sfile)
-{
- struct direntry *file;
- int num;
-
- file= sfile->filelist;
-
- for(num=0; num<sfile->totfile; num++, file++) {
- file->flags= 0;
- file->type= file->s.st_mode; /* restore the mess below */
-
- /* Don't check extensions for directories */
- if (file->type & S_IFDIR)
- continue;
-
- if(sfile->type==FILE_BLENDER || sfile->type==FILE_LOADLIB) {
- if(BLO_has_bfile_extension(file->relname)) {
- file->flags |= BLENDERFILE;
-
- if(sfile->type==FILE_LOADLIB) {
- char name[FILE_MAX];
- BLI_strncpy(name, sfile->dir, sizeof(name));
- strcat(name, file->relname);
-
- /* prevent current file being used as acceptable dir */
- if (BLI_streq(G.main->name, name)==0) {
- file->type &= ~S_IFMT;
- file->type |= S_IFDIR;
- }
- }
- }
- } else if (sfile->type==FILE_SPECIAL || sfile->type==FILE_LOADFONT){
- if(BLI_testextensie(file->relname, ".py")) {
- file->flags |= PYSCRIPTFILE;
- } else if( BLI_testextensie(file->relname, ".ttf")
- || BLI_testextensie(file->relname, ".ttc")
- || BLI_testextensie(file->relname, ".pfb")
- || BLI_testextensie(file->relname, ".otf")
- || BLI_testextensie(file->relname, ".otc")) {
- file->flags |= FTFONTFILE;
- } else if (G.have_libtiff &&
- (BLI_testextensie(file->relname, ".tif")
- || BLI_testextensie(file->relname, ".tiff"))) {
- file->flags |= IMAGEFILE;
- } else if (BLI_testextensie(file->relname, ".exr")) {
- file->flags |= IMAGEFILE;
- } else if (G.have_quicktime){
- if( BLI_testextensie(file->relname, ".jpg")
- || BLI_testextensie(file->relname, ".jpeg")
- || BLI_testextensie(file->relname, ".hdr")
- || BLI_testextensie(file->relname, ".exr")
- || BLI_testextensie(file->relname, ".tga")
- || BLI_testextensie(file->relname, ".rgb")
- || BLI_testextensie(file->relname, ".bmp")
- || BLI_testextensie(file->relname, ".png")
-#ifdef WITH_DDS
- || BLI_testextensie(file->relname, ".dds")
-#endif
- || BLI_testextensie(file->relname, ".iff")
- || BLI_testextensie(file->relname, ".lbm")
- || BLI_testextensie(file->relname, ".gif")
- || BLI_testextensie(file->relname, ".psd")
- || BLI_testextensie(file->relname, ".tif")
- || BLI_testextensie(file->relname, ".tiff")
- || BLI_testextensie(file->relname, ".pct")
- || BLI_testextensie(file->relname, ".pict")
- || BLI_testextensie(file->relname, ".pntg") //macpaint
- || BLI_testextensie(file->relname, ".qtif")
- || BLI_testextensie(file->relname, ".cin")
- || BLI_testextensie(file->relname, ".dpx")
- || BLI_testextensie(file->relname, ".sgi")) {
- file->flags |= IMAGEFILE;
- }
- else if(BLI_testextensie(file->relname, ".avi")
- || BLI_testextensie(file->relname, ".flc")
- || BLI_testextensie(file->relname, ".dv")
- || BLI_testextensie(file->relname, ".mov")
- || BLI_testextensie(file->relname, ".movie")
- || BLI_testextensie(file->relname, ".mv")) {
- file->flags |= MOVIEFILE;
- }
- } else { // no quicktime
- if(BLI_testextensie(file->relname, ".jpg")
- || BLI_testextensie(file->relname, ".hdr")
- || BLI_testextensie(file->relname, ".exr")
- || BLI_testextensie(file->relname, ".tga")
- || BLI_testextensie(file->relname, ".rgb")
- || BLI_testextensie(file->relname, ".bmp")
- || BLI_testextensie(file->relname, ".png")
-#ifdef WITH_DDS
- || BLI_testextensie(file->relname, ".dds")
-#endif
- || BLI_testextensie(file->relname, ".iff")
- || BLI_testextensie(file->relname, ".lbm")
- || BLI_testextensie(file->relname, ".cin")
- || BLI_testextensie(file->relname, ".dpx")
- || BLI_testextensie(file->relname, ".sgi")) {
- file->flags |= IMAGEFILE;
- }
- else if(BLI_testextensie(file->relname, ".avi")
- || BLI_testextensie(file->relname, ".mv")) {
- file->flags |= MOVIEFILE;
- }
- else if(BLI_testextensie(file->relname, ".wav")) {
- file->flags |= SOUNDFILE;
- }
- }
- }
- }
-}
-
-
-void sort_filelist(SpaceFile *sfile)
-{
- struct direntry *file;
- int num;/* , act= 0; */
-
- switch(sfile->sort) {
- case FILE_SORTALPHA:
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name);
- break;
- case FILE_SORTDATE:
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_date);
- break;
- case FILE_SORTSIZE:
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_size);
- break;
- case FILE_SORTEXTENS:
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_extension);
- }
-
- sfile->act= -1;
-
- file= sfile->filelist;
- for(num=0; num<sfile->totfile; num++, file++) {
- file->flags &= ~HILITE;
- }
-
-}
-
-void read_dir(SpaceFile *sfile)
-{
- int num, len;
- char wdir[FILE_MAX];
-
- /* sfile->act is used for example in databrowse: double names of library objects */
- sfile->act= -1;
-
- if(sfile->type==FILE_MAIN) {
- main_to_filelist(sfile);
- return;
- }
- else if(sfile->type==FILE_LOADLIB) {
- library_to_filelist(sfile);
- if(sfile->libfiledata) return;
- }
-
- BLI_hide_dot_files(sfile->flag & FILE_HIDE_DOT);
-
- BLI_getwdN(wdir);
- sfile->totfile= BLI_getdir(sfile->dir, &(sfile->filelist));
- chdir(wdir);
-
- if(sfile->sort!=FILE_SORTALPHA) sort_filelist(sfile);
-
- sfile->maxnamelen= 0;
-
- for (num=0; num<sfile->totfile; num++) {
-
- len = BMF_GetStringWidth(G.font, sfile->filelist[num].relname);
- if (len > sfile->maxnamelen) sfile->maxnamelen = len;
-
- if(filetoname) {
- if(strcmp(sfile->file, sfile->filelist[num].relname)==0) {
-
- sfile->ofs= num-( sfile->collums*(curarea->winy-FILESELHEAD-20)/(2*FILESEL_DY));
- filetoname= 0;
- }
- }
- }
- test_flags_file(sfile);
-
- filetoname= 0;
-}
-
-void freefilelist(SpaceFile *sfile)
-{
- int num;
-
- num= sfile->totfile-1;
-
- if (sfile->filelist==0) return;
-
- for(; num>=0; num--){
- MEM_freeN(sfile->filelist[num].relname);
-
- if (sfile->filelist[num].string) MEM_freeN(sfile->filelist[num].string);
- }
- free(sfile->filelist);
- sfile->filelist= 0;
-}
-
-static void split_sfile(SpaceFile *sfile, char *s1)
-{
- char string[FILE_MAX], dir[FILE_MAX], file[FILE_MAX];
-
- BLI_strncpy(string, s1, sizeof(string));
-
- BLI_split_dirfile(string, dir, file);
-
- if(sfile->filelist) {
- if(strcmp(dir, sfile->dir)!=0) {
- freefilelist(sfile);
- }
- else test_flags_file(sfile);
- }
- BLI_strncpy(sfile->file, file, sizeof(sfile->file));
-
- BLI_make_file_string(G.sce, sfile->dir, dir, "");
-}
-
-
-void parent(SpaceFile *sfile)
-{
- /* if databrowse: no parent */
- if(sfile->type==FILE_MAIN && filesel_has_func(sfile)) return;
-
- BLI_parent_dir(sfile->dir);
-
- if (sfile->type!=FILE_MAIN && (sfile->dir[0]=='\0'))
-#ifdef WIN32
- get_default_root(sfile->dir);
-#else
- strcpy(sfile->dir,"/");
-#endif
-
- /* to be sure */
- BLI_make_exist(sfile->dir);
-
- freefilelist(sfile);
- sfile->ofs= 0;
- scrarea_queue_winredraw(curarea);
-}
-
-void swapselect_file(SpaceFile *sfile)
-{
- struct direntry *file;
- int num, act= 0;
-
- file= sfile->filelist;
- for(num=0; num<sfile->totfile; num++, file++) {
- if(file->flags & ACTIVE) {
- act= 1;
- break;
- }
- }
- file= sfile->filelist+2;
- for(num=2; num<sfile->totfile; num++, file++) {
- if(act) file->flags &= ~ACTIVE;
- else file->flags |= ACTIVE;
- }
-}
-
-static int find_active_file(SpaceFile *sfile, short x, short y)
-{
- int ofs, act;
-
- if(y > textrct.ymax) y= textrct.ymax;
- if(y <= textrct.ymin) y= textrct.ymin+1;
-
- ofs= (x-textrct.xmin)/collumwidth;
- if(ofs<0) ofs= 0;
- ofs*= (textrct.ymax-textrct.ymin);
-
- act= sfile->ofs+ (ofs+textrct.ymax-y)/FILESEL_DY;
-
- if(act<0 || act>=sfile->totfile)
- act= -1;
-
- return act;
-}
-
-
-/* ********************** DRAW ******************************* */
-
-static void calc_file_rcts(SpaceFile *sfile)
-{
- int tot, h, len;
- float fac, start, totfile;
-
- scrollrct.xmin= 15;
- scrollrct.xmax= 35;
- scrollrct.ymin= 10;
- scrollrct.ymax= curarea->winy-10-FILESELHEAD;
-
- textrct.xmin= scrollrct.xmax+10;
- textrct.xmax= curarea->winx-10;
- textrct.ymin= scrollrct.ymin;
- textrct.ymax= scrollrct.ymax;
-
- if(textrct.xmax-textrct.xmin <60) textrct.xmax= textrct.xmin+60;
-
- len= (textrct.ymax-textrct.ymin) % FILESEL_DY;
- textrct.ymin+= len;
- scrollrct.ymin+= len;
-
- filebuty1= curarea->winy-FILESELHEAD;
- filebuty2= filebuty1+FILESELHEAD/2 -6;
-
-
- /* amount of collums */
- len= sfile->maxnamelen+25;
-
- if(sfile->type==FILE_MAIN) len+= 100;
- else if(sfile->flag & FILE_SHOWSHORT) len+= 100;
- else len+= 380;
-
- sfile->collums= (textrct.xmax-textrct.xmin)/len;
-
- if(sfile->collums<1) sfile->collums= 1;
- else if(sfile->collums>8) sfile->collums= 8;
-
- /* this flag aint yet defined in user menu, needed? */
-// if((U.flag & USER_FSCOLLUM)==0) sfile->collums= 1;
-
- collumwidth= (textrct.xmax-textrct.xmin)/sfile->collums;
-
-
- totfile= sfile->totfile + 0.5f;
-
- tot= (int)(FILESEL_DY*totfile);
- if(tot) fac= ((float)sfile->collums*(scrollrct.ymax-scrollrct.ymin))/( (float)tot);
- else fac= 1.0;
-
- if(sfile->ofs<0) sfile->ofs= 0;
-
- if(tot) start= ( (float)sfile->ofs)/(totfile);
- else start= 0.0;
- if(fac>1.0) fac= 1.0f;
-
- if(start+fac>1.0) {
- sfile->ofs= (short)ceil((1.0-fac)*totfile);
- start= ( (float)sfile->ofs)/(totfile);
- fac= 1.0f-start;
- }
-
- bar.xmin= scrollrct.xmin+2;
- bar.xmax= scrollrct.xmax-2;
- h= (scrollrct.ymax-scrollrct.ymin)-4;
- bar.ymax= (int)(scrollrct.ymax-2- start*h);
- bar.ymin= (int)(bar.ymax- fac*h);
-
- pixels_to_ofs= (totfile)/(float)(h+3);
- page_ofs= (int)(fac*totfile);
-}
-
-int filescrollselect= 0;
-
-static void draw_filescroll(SpaceFile *sfile)
-{
-
- if(scrollrct.ymin+10 >= scrollrct.ymax) return;
-
- BIF_ThemeColor(TH_BACK);
- glRecti(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax);
-
- uiEmboss(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax, 1);
-
- BIF_ThemeColor(TH_HEADER);
- glRecti(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2);
-
- uiEmboss(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2, filescrollselect);
-
-}
-
-static void linerect(int id, int x, int y)
-{
- if(id & ACTIVE) {
- if(id & HILITE) BIF_ThemeColorShade(TH_HILITE, 20);
- else BIF_ThemeColor(TH_HILITE);
- }
- else if(id & HILITE) BIF_ThemeColorShade(TH_BACK, 20);
- else BIF_ThemeColor(TH_BACK);
-
- glRects(x-17, y-3, x+collumwidth-21, y+11);
-
-}
-
-static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
-{
- int boxcol=0;
- char *s;
-
- boxcol= files->flags & (HILITE + ACTIVE);
-
- if(boxcol) {
- linerect(boxcol, x, y);
- }
-
- // this is where the little boxes in the file view are being drawn according to the file type
- if(files->flags & BLENDERFILE) {
- cpack(0xA0A0);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & PSXFILE) {
- cpack(0xA060B0);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & IMAGEFILE) {
- cpack(0xF08040);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & MOVIEFILE) {
- cpack(0x70A070);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & PYSCRIPTFILE) {
- cpack(0x4477dd);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & SOUNDFILE) {
- cpack(0xa0a000);
- glRects(x-14, y, x-8, y+7);
- }
- else if(files->flags & FTFONTFILE) {
- cpack(0xff2371);
- glRects(x-14, y, x-8, y+7);
- }
-
- if(S_ISDIR(files->type)) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
-
- s = files->string;
- if(s) {
- glRasterPos2i(x, y);
-#ifdef WITH_ICONV
- {
- struct LANGMenuEntry *lme;
- lme = find_language(U.language);
-
- if ((lme !=NULL) && (!strcmp(lme->code, "ja_JP") ||
- !strcmp(lme->code, "zh_CN")))
- {
- BIF_RasterPos((float)x, (float)y);
-#ifdef WIN32
- BIF_DrawString(G.font, files->relname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8));
-#else
- BIF_DrawString(G.font, files->relname, (U.transopts & USER_TR_MENUS));
-#endif
- } else {
- BMF_DrawString(G.font, files->relname);
- }
- }
-#else
- BMF_DrawString(G.font, files->relname);
-#endif /* WITH_ICONV */
-
- x += sfile->maxnamelen + 100;
-
- glRasterPos2i(x - BMF_GetStringWidth(G.font, files->size), y);
- BMF_DrawString(G.font, files->size);
-
- if(sfile->flag & FILE_SHOWSHORT) return;
-
-#ifndef WIN32
- /* rwx rwx rwx */
- x += 20; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->mode1);
-
- x += 30; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->mode2);
-
- x += 30; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->mode3);
-
- /* owner time date */
- x += 30; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->owner);
-#endif
-
- x += 60; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->time);
-
- x += 50; glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->date);
- }
- else {
- glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->relname);
-
- if(files->nr) { /* extra info */
- x+= sfile->maxnamelen+20;
- glRasterPos2i(x, y);
- BMF_DrawString(G.font, files->extra);
- }
- }
-}
-
-
-static int calc_filesel_line(SpaceFile *sfile, int nr, int *valx, int *valy)
-{
- /* get screen coordinate of a line */
- int val, coll;
-
- nr-= sfile->ofs;
-
- /* amount of lines */
- val= (textrct.ymax-textrct.ymin)/FILESEL_DY;
- if (val == 0) coll = 0;
- else coll= nr/val;
- nr -= coll*val;
-
- *valy= textrct.ymax-FILESEL_DY+3 - nr*FILESEL_DY;
- *valx= coll*collumwidth + textrct.xmin+20;
-
- if(nr<0 || coll > sfile->collums) return 0;
- return 1;
-}
-
-static void set_active_file(SpaceFile *sfile, int act)
-{
- struct direntry *file;
- int num, redraw= 0;
- unsigned int newflag;
- int old=0, newi=0;
-
- file= sfile->filelist;
- if(file==0) return;
-
- for(num=0; num<sfile->totfile; num++, file++) {
- if(num==act) {
-
- if(selecting && num>1) {
- newflag= HILITE | (file->flags & ~ACTIVE);
- if(selecting==ACTIVATE) newflag |= ACTIVE;
-
- if(file->flags != newflag) redraw|= 1;
- file->flags= newflag;
- }
- else {
- if(file->flags & HILITE);
- else {
- file->flags |= HILITE;
- redraw|= 2;
- newi= num;
- }
- }
- }
- else {
- if(file->flags & HILITE) {
- file->flags &= ~HILITE;
- redraw|= 2;
- old= num;
- }
- }
-
- }
- // removed frontbuffer draw here
- if(redraw) {
- scrarea_queue_winredraw(curarea);
- }
-}
-
-
-static void draw_filetext(SpaceFile *sfile)
-{
- struct direntry *files;
- int a, x, y;
- short mval[2];
-
- if(textrct.ymin+10 >= textrct.ymax) return;
-
-
- /* box */
- BIF_ThemeColor(TH_BACK);
- glRecti(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax);
-
- /* collums */
- x= textrct.xmin+collumwidth;
- for(a=1; a<sfile->collums; a++, x+= collumwidth) {
- cpack(0x303030);
- sdrawline(x, textrct.ymin, x, textrct.ymax);
- cpack(0xB0B0B0);
- sdrawline(x+1, textrct.ymin, x+1, textrct.ymax);
- }
-
- if(sfile->filelist==0) return;
-
- /* test: if mouse is not in area: clear HILITE */
- getmouseco_areawin(mval);
-
- if(mval[0]<0 || mval[0]>curarea->winx) {
- files= sfile->filelist+sfile->ofs;
- for(a= sfile->ofs; a<sfile->totfile; a++, files++) files->flags &= ~HILITE;
- }
-
- files= sfile->filelist+sfile->ofs;
- for(a= sfile->ofs; a<sfile->totfile; a++, files++) {
-
- if( calc_filesel_line(sfile, a, &x, &y)==0 ) break;
- print_line(sfile, files, x, y);
- }
-
- /* clear drawing errors, with text at the right hand side: */
- BIF_ThemeColor(TH_HEADER);
- glRecti(textrct.xmax, textrct.ymin, textrct.xmax+10, textrct.ymax);
- uiEmboss(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax, 1);
-}
-
-static char *library_string(void)
-{
- Library *lib;
- char *str;
- int nr=0, tot= BLI_countlist(&G.main->library);
-
- if(tot==0) return NULL;
- str= MEM_callocN(tot*(FILE_MAXDIR+FILE_MAX), "filesel lib menu");
-
- for(tot=0, lib= G.main->library.first; lib; lib= lib->id.next, nr++) {
- tot+= sprintf(str+tot, "%s %%x%d|", lib->name, nr);
- }
- return str;
-}
-
-void drawfilespace(ScrArea *sa, void *spacedata)
-{
- SpaceFile *sfile;
- uiBlock *block;
- float col[3];
- int act, loadbutton;
- short mval[2];
- char name[20];
- char *menu, *strp= NULL;
-
- myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
-
- BIF_GetThemeColor3fv(TH_HEADER, col); // basic undrawn color is border
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- sfile= sa->spacedata.first;
- if(sfile->filelist==NULL) {
- read_dir(sfile);
-
- calc_file_rcts(sfile);
-
- /* calculate act */
- getmouseco_areawin(mval);
- act= find_active_file(sfile, mval[0], mval[1]);
- if(act>=0 && act<sfile->totfile)
- sfile->filelist[act].flags |= HILITE;
- }
- else calc_file_rcts(sfile);
-
- /* check if we load library, extra button */
- if(sfile->type==FILE_LOADLIB)
- strp= library_string();
-
- /* HEADER */
- sprintf(name, "win %d", sa->win);
- block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->win);
-
- /* browse 1 datablock */
- uiSetButLock( sfile->type==FILE_MAIN && filesel_has_func(sfile), NULL);
-
- /* space available for load/save buttons? */
- loadbutton= MAX2(80, 20+BMF_GetStringWidth(G.font, sfile->title));
- if(textrct.xmax-textrct.xmin > loadbutton+20) {
- if(sfile->title[0]==0) loadbutton= 0;
- }
- else loadbutton= 0;
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, B_FS_DIRNAME,"", textrct.xmin + (strp?20:0), filebuty2, textrct.xmax-textrct.xmin-loadbutton - (strp?20:0), 21, sfile->dir, 0.0, (float)FILE_MAXDIR-1, 0, 0, "Directory, enter a directory and press enter to create it, Substitute ~ for home"); /* Directory input */
- if(loadbutton) {
- uiSetCurFont(block, UI_HELV);
- uiDefBut(block, BUT, B_FS_LOAD, sfile->title, textrct.xmax-loadbutton, filebuty2, loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, B_FS_FILENAME,"", textrct.xmin, filebuty1, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "File, increment version number with (+/-)"); /* File input */
- if(loadbutton) {
- uiSetCurFont(block, UI_HELV);
- uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", textrct.xmax-loadbutton, filebuty1, loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "");
- }
- uiBlockEndAlign(block);
-
- menu= fsmenu_build_menu();
- if(menu[0]) /* happens when no .Bfs is there, and first time browse */
- uiDefButS(block, MENU, B_FS_DIR_MENU, menu, scrollrct.xmin, filebuty1, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, "");
- MEM_freeN(menu);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_FS_PARDIR, "P", scrollrct.xmin, filebuty2, scrollrct.xmax-scrollrct.xmin, 21, 0, 0, 0, 0, 0, "Move to the parent directory (PKEY)");
- if(strp) {
- uiDefIconTextButS(block, MENU, B_FS_LIBNAME, ICON_LIBRARY_DEHLT, strp, scrollrct.xmin+20, filebuty2, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, "");
- MEM_freeN(strp);
- }
-
- uiDrawBlock(block);
-
- draw_filescroll(sfile);
- draw_filetext(sfile);
-
- /* others diskfree etc ? */
- scrarea_queue_headredraw(sa);
-
- myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
- draw_area_emboss(sa);
-
- sa->win_swap= WIN_BACK_OK;
-}
-
-
-static void do_filescroll(SpaceFile *sfile)
-{
- short mval[2], oldy, yo;
-
- calc_file_rcts(sfile);
-
- filescrollselect= 1;
-
- /* for beauty */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- getmouseco_areawin(mval);
- oldy= yo= mval[1];
-
- while(get_mbut()&L_MOUSE) {
- getmouseco_areawin(mval);
-
- if(yo!=mval[1]) {
- int dy= floor(0.5+((float)(oldy-mval[1]))*pixels_to_ofs);
-
- if(dy) {
- sfile->ofs+= dy;
- if(sfile->ofs<0) {
- sfile->ofs= 0;
- oldy= mval[1];
- }
- else oldy= floor(0.5+ (float)oldy - (float)dy/pixels_to_ofs);
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- }
-
- yo= mval[1];
- }
- else BIF_wait_for_statechange();
- }
- filescrollselect= 0;
-
- /* for beauty */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
-}
-
-static void do_filescrollwheel(SpaceFile *sfile, int move)
-{
- // by phase
- int lines, rt;
-
- calc_file_rcts(sfile);
-
- lines = (int)(textrct.ymax-textrct.ymin)/FILESEL_DY;
- rt = lines * sfile->collums;
-
- if(sfile->totfile > rt) {
- sfile->ofs+= move;
- if( sfile->ofs + rt > sfile->totfile + 1)
- sfile->ofs = sfile->totfile - rt + 1;
- }
-
- if(sfile->ofs<0) {
- sfile->ofs= 0;
- }
-}
-
-/* the complete call; pulldown menu, and three callback types */
-static void activate_fileselect_(int type, char *title, char *file, short *menup, char *pupmenu,
- void (*func)(char *),
- void (*func_event)(unsigned short),
- void (*func_args)(char *, void *arg1, void *arg2),
- void *arg1, void *arg2)
-{
- SpaceFile *sfile;
- char group[GROUP_MAX], name[FILE_MAX], temp[FILE_MAX];
-
- if(curarea==0) return;
- if(curarea->win==0) return;
-
- newspace(curarea, SPACE_FILE);
- scrarea_queue_winredraw(curarea);
-
- /* sometime double, when area already is SPACE_FILE with a different file name */
- if(curarea->headwin) addqueue(curarea->headwin, CHANGED, 1);
-
- name[2]= 0;
- BLI_strncpy(name, file, sizeof(name));
- BLI_convertstringcode(name, G.sce);
-
- sfile= curarea->spacedata.first;
-
- sfile->returnfunc= func;
- sfile->returnfunc_event= func_event;
- sfile->returnfunc_args= func_args;
- sfile->arg1= arg1;
- sfile->arg2= arg2;
-
- sfile->type= type;
- sfile->ofs= 0;
-
- if(sfile->pupmenu)
- MEM_freeN(sfile->pupmenu);
- sfile->pupmenu= pupmenu;
- sfile->menup= menup;
-
- /* sfile->act is used for databrowse: double names of library objects */
- sfile->act= -1;
-
- if(G.relbase_valid && U.flag & USER_RELPATHS && type != FILE_BLENDER)
- sfile->flag |= FILE_STRINGCODE;
- else
- sfile->flag &= ~FILE_STRINGCODE;
-
- if (U.uiflag & USER_HIDE_DOT)
- sfile->flag |= FILE_HIDE_DOT;
-
- if(type==FILE_MAIN) {
- char *groupname;
-
- BLI_strncpy(sfile->file, name+2, sizeof(sfile->file));
-
- groupname = BLO_idcode_to_name( GS(name) );
- if (groupname) {
- BLI_strncpy(sfile->dir, groupname, sizeof(sfile->dir) - 1);
- strcat(sfile->dir, "/");
- }
-
- /* free all */
- if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
- sfile->libfiledata= 0;
-
- freefilelist(sfile);
- }
- else if(type==FILE_LOADLIB) {
- BLI_strncpy(sfile->dir, name, sizeof(sfile->dir));
- BLI_cleanup_dir(G.sce, sfile->dir);
- if( is_a_library(sfile, temp, group) ) {
- /* force a reload of the library-filelist */
- freefilelist(sfile);
- }
- else {
- split_sfile(sfile, name);
- if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
- sfile->libfiledata= NULL;
- }
- }
- else { /* FILE_BLENDER or FILE_LOADFONT */
- split_sfile(sfile, name); /* test filelist too */
- BLI_cleanup_dir(G.sce, sfile->dir);
-
- /* free: filelist and libfiledata became incorrect */
- if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
- sfile->libfiledata= 0;
- }
- BLI_strncpy(sfile->title, title, sizeof(sfile->title));
- filetoname= 1;
-}
-
-void activate_fileselect(int type, char *title, char *file, void (*func)(char *))
-{
- activate_fileselect_(type, title, file, NULL, NULL, func, NULL, NULL, NULL, NULL);
-}
-
-void activate_fileselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *))
-{
- activate_fileselect_(type, title, file, menup, pupmenu, func, NULL, NULL, NULL, NULL);
-}
-
-void activate_fileselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2)
-{
- activate_fileselect_(type, title, file, NULL, NULL, NULL, NULL, func, arg1, arg2);
-}
-
-void activate_databrowse(ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short))
-{
- ListBase *lb;
- SpaceFile *sfile;
- char str[32];
-
- if(id==NULL) {
- lb= wich_libbase(G.main, idcode);
- id= lb->first;
- }
-
- if(id) BLI_strncpy(str, id->name, sizeof(str));
- else return;
-
- activate_fileselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, func, NULL, NULL, NULL);
-
- sfile= curarea->spacedata.first;
- sfile->retval= retval;
- sfile->ipotype= fromcode;
-}
-
-void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short *menup, void (*func)(char *, void *, void *), void *arg1, void *arg2)
-{
- ListBase *lb;
- SpaceFile *sfile;
- char str[32];
-
- if(id==NULL) {
- lb= wich_libbase(G.main, idcode);
- id= lb->first;
- }
-
- if(id) BLI_strncpy(str, id->name, sizeof(str));
- else return;
-
- activate_fileselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, NULL, func, arg1, arg2);
-
- sfile= curarea->spacedata.first;
- sfile->ipotype= fromcode;
-}
-
-/* resets a previous file space type */
-/* is used when opening a filebrowser directly from windowtype_pupmenu,
- since in that case we don't want any load/save/append/link action
-*/
-void reset_filespace(ScrArea *sa)
-{
- if (sa->spacetype == SPACE_FILE) {
- SpaceFile *sfile= sa->spacedata.first;
-
- if(sfile->type==FILE_MAIN) {
- freefilelist(sfile);
- } else {
- sfile->type= FILE_UNIX;
- }
-
- sfile->returnfunc= NULL;
- sfile->title[0]= 0;
- if(sfile->filelist) test_flags_file(sfile);
- }
-}
-
-void filesel_prevspace()
-{
- SpaceFile *sfile= curarea->spacedata.first;
-
- /* cleanup */
- if(sfile->spacetype==SPACE_FILE) {
- if(sfile->pupmenu) {
- MEM_freeN(sfile->pupmenu);
- sfile->pupmenu= NULL;
- }
- }
-
- if(sfile->next) {
-
- BLI_remlink(&curarea->spacedata, sfile);
- BLI_addtail(&curarea->spacedata, sfile);
-
- sfile= curarea->spacedata.first;
-
- if (sfile->spacetype == SPACE_SCRIPT) {
- SpaceScript *sc = (SpaceScript *)sfile;
- if (sc->script) sc->script->flags &=~SCRIPT_FILESEL;
- }
-
- newspace(curarea, sfile->spacetype);
- }
- else newspace(curarea, SPACE_INFO);
-}
-
-static int countselect(SpaceFile *sfile)
-{
- int a, count=0;
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- count++;
- }
- }
- return count;
-}
-
-static int getotherdir(void)
-{
- ScrArea *sa;
- SpaceFile *sfile=0;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa!=curarea) {
- if(sa->spacetype==SPACE_FILE) {
-
- /* already found one */
- if(sfile) return 0;
-
- sfile= sa->spacedata.first;
-
- if(sfile->type & FILE_UNIX) {
- otherarea= sa;
- BLI_make_file_string(G.sce, otherdir, sfile->dir, "");
- }
- else sfile= 0;
- }
- }
- sa= sa->next;
- }
- if(sfile) return 1;
- return 0;
-}
-
-static void reread_other_fs(void)
-{
- SpaceFile *sfile;
-
- /* watch it: only call when getotherdir returned OK */
-
- sfile= otherarea->spacedata.first;
- freefilelist(sfile);
- scrarea_queue_winredraw(otherarea);
-}
-
-
-void free_filesel_spec(char *dir)
-{
- /* all filesels with 'dir' are freed */
- bScreen *sc;
-
- sc= G.main->screen.first;
- while(sc) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_FILE) {
- SpaceFile *sfile= (SpaceFile*) sl;
- if (BLI_streq(sfile->dir, dir)) {
- freefilelist(sfile);
- }
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- sc= sc->id.next;
- }
-}
-
-/* NOTE: this is called for file read, after the execfunc no UI memory is valid! */
-static void filesel_execute(SpaceFile *sfile)
-{
- struct direntry *files;
- char name[FILE_MAX];
- int a;
-
- /* check for added length of dir and filename - annoying, but now that dir names can already be FILE_MAX
- we need to prevent overwriting. Alternative of shortening the name behind the user's back is greater evil
- - elubie */
- if (strlen(sfile->dir) + strlen(sfile->file) >= FILE_MAX) {
- okee("File and Directory name together are too long. Please use shorter names.");
- return;
- }
-
-#ifdef WIN32
- if ( (sfile->type!=FILE_LOADLIB) && (sfile->type!=FILE_MAIN) ) {
- if (!check_file_chars(sfile->file)) {
- error("You have illegal characters in the filename. Check console for more info.");
- printf("Characters '*?:|\"<>\\/' are illegal in a filename.\n");
- return;
- }
- }
-#endif
-
- filesel_prevspace();
-
- if(sfile->type==FILE_LOADLIB) {
- if(sfile->flag & FILE_STRINGCODE) {
- if (!G.relbase_valid) {
- okee("You have to save the .blend file before using relative paths! Using absolute path instead.");
- sfile->flag &= ~FILE_STRINGCODE;
- }
- }
-
- do_library_append(sfile);
-
- BIF_undo_push( ((sfile->flag & FILE_LINK)==0) ? "Append from file" : "Link from file");
-
- allqueue(REDRAWALL, 1);
- }
- else if(filesel_has_func(sfile)) {
- fsmenu_insert_entry(sfile->dir, 1, 0);
-
- if(sfile->type==FILE_MAIN) { /* DATABROWSE */
- if (sfile->menup) { /* with value pointing to ID block index */
- int notfound = 1;
-
- /* Need special handling since hiding .* datablocks means that
- sfile->act is no longer the same as files->nr.
-
- Also, toggle HIDE_DOT on and off can make sfile->act not longer
- correct (meaning it doesn't point to the correct item in the filelist.
-
- sfile->file is always correct, so first with check if, for the item
- corresponding to sfile->act, the name is the same.
-
- If it isn't (or if sfile->act is not good), go over filelist and take
- the correct one.
-
- This means that selecting a datablock than hiding it makes it
- unselectable. Not really a problem.
-
- - theeth
- */
-
- *sfile->menup= -1;
-
- if(sfile->act>=0 && sfile->act<sfile->totfile) {
- if(sfile->filelist) {
- files= sfile->filelist+sfile->act;
- if ( strcmp(files->relname, sfile->file)==0) {
- notfound = 0;
- *sfile->menup= files->nr;
- }
- }
- }
- if (notfound) {
- for(a=0; a<sfile->totfile; a++) {
- if( strcmp(sfile->filelist[a].relname, sfile->file)==0) {
- *sfile->menup= sfile->filelist[a].nr;
- break;
- }
- }
- }
- }
- if(sfile->returnfunc_event)
- sfile->returnfunc_event(sfile->retval);
- else if(sfile->returnfunc_args)
- sfile->returnfunc_args(NULL, sfile->arg1, sfile->arg2);
- }
- else {
- if(strncmp(sfile->title, "Save", 4)==0) free_filesel_spec(sfile->dir);
- if(strncmp(sfile->title, "Export", 6)==0) free_filesel_spec(sfile->dir);
-
- BLI_strncpy(name, sfile->dir, sizeof(name));
- strcat(name, sfile->file);
-
- if(sfile->flag & FILE_STRINGCODE) {
- /* still weak, but we don't want saving files to make relative paths */
- if(G.relbase_valid && strncmp(sfile->title, "Save", 4)) {
- BLI_makestringcode(G.sce, name);
- } else {
- /* if we don't have a valid relative base (.blend file hasn't been saved yet)
- then we don't save the path as relative (for texture images, background image).
- Warning message not shown when saving files (doesn't make sense there)
- */
- if (strncmp(sfile->title, "Save", 4)) {
- printf("Relative path setting has been ignored because .blend file hasn't been saved yet.\n");
- }
- sfile->flag &= ~FILE_STRINGCODE;
- }
- }
- if(sfile->returnfunc)
- sfile->returnfunc(name);
- else if(sfile->returnfunc_args)
- sfile->returnfunc_args(name, sfile->arg1, sfile->arg2);
- }
- }
-}
-
-static void do_filesel_buttons(short event, SpaceFile *sfile)
-{
- char butname[FILE_MAX];
-
- if (event == B_FS_FILENAME) {
- if (strchr(sfile->file, '*') || strchr(sfile->file, '?') || strchr(sfile->file, '[')) {
- int i, match = FALSE;
-
- for (i = 2; i < sfile->totfile; i++) {
- if (fnmatch(sfile->file, sfile->filelist[i].relname, 0) == 0) {
- sfile->filelist[i].flags |= ACTIVE;
- match = TRUE;
- }
- }
- if (match) sfile->file[0] = '\0';
- if(sfile->type==FILE_MAIN) filesel_select_objects(sfile);
- scrarea_queue_winredraw(curarea);
- }
- }
- else if(event== B_FS_DIRNAME) {
- /* reuse the butname variable */
-
- /* convienence shortcut '~' -> $HOME
- * If the first char is ~ then this is invalid on all OS's so its safe to replace with home */
- if ( sfile->dir[0] == '~' ) {
- if (sfile->dir[1] == '\0') {
- BLI_strncpy(sfile->dir, BLI_gethome(), sizeof(sfile->dir) );
- } else {
- /* replace ~ with home */
- char tmpstr[FILE_MAX];
- BLI_join_dirfile(tmpstr, BLI_gethome(), sfile->dir+1);
- BLI_strncpy(sfile->dir, tmpstr, sizeof(sfile->dir));
- }
- }
-
- BLI_cleanup_dir(G.sce, sfile->dir);
-
- BLI_make_file_string(G.sce, butname, sfile->dir, "");
- BLI_strncpy(sfile->dir, butname, sizeof(sfile->dir));
-
- /* strip the trailing slash if its a real dir */
- BLI_del_slash(butname);
-
- if(sfile->type & FILE_UNIX) {
- if (butname[0] != '\0' && !BLI_exists(butname)) {
- if (okee("Makedir")) {
- BLI_recurdir_fileops(butname);
- if (!BLI_exists(butname)) parent(sfile);
- } else parent(sfile);
- }
- }
- freefilelist(sfile);
- sfile->ofs= 0;
- scrarea_queue_winredraw(curarea);
- }
- else if(event== B_FS_DIR_MENU) {
- char *selected= fsmenu_get_entry(sfile->menu-1);
-
- /* which string */
- if (selected) {
- BLI_strncpy(sfile->dir, selected, sizeof(sfile->dir));
- BLI_make_exist(sfile->dir);
- BLI_cleanup_dir(G.sce, sfile->dir);
- freefilelist(sfile);
- sfile->ofs= 0;
- scrarea_queue_winredraw(curarea);
- }
-
- sfile->act= -1;
-
- }
- else if(event== B_FS_PARDIR)
- parent(sfile);
- else if(event== B_FS_LOAD) {
- if(sfile->type)
- filesel_execute(sfile);
- }
- else if(event== B_FS_CANCEL)
- filesel_prevspace();
- else if(event== B_FS_LIBNAME) {
- Library *lib= BLI_findlink(&G.main->library, sfile->menu);
- if(lib) {
- BLI_strncpy(sfile->dir, lib->filename, sizeof(sfile->dir));
- BLI_make_exist(sfile->dir);
- BLI_cleanup_dir(G.sce, sfile->dir);
-
- /* forced re-reading the blend file */
- if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
- sfile->libfiledata= 0;
-
- freefilelist(sfile);
- sfile->ofs= 0;
- scrarea_queue_winredraw(curarea);
- sfile->act= -1;
- }
- }
-
-}
-
-/****/
-
-typedef void (*ReplaceFP)(ID *oldblock, ID *newblock);
-
-static void change_id_link(void *linkpv, void *newlinkv) {
- ID **linkp= (ID**) linkpv;
- ID *newlink= newlinkv;
-
- if (*linkp) {
- (*linkp)->us--;
- }
- (*linkp)= newlink;
- if (newlink) {
- id_us_plus(newlink);
- }
-}
-
-static void replace_image(ID *oldblock, ID *newblock) {
- Image *oldima= (Image*) oldblock;
- Image *newima= (Image*) newblock;
- bScreen *sc;
- Scene *sce;
- Tex *tex;
- Mesh *me;
-
- for (tex= G.main->tex.first; tex; tex= tex->id.next) {
- if (tex->env && tex->env->type == ENV_LOAD && tex->env->ima == oldima)
- change_id_link(&tex->env->ima, newima);
- if (tex->ima == oldima)
- change_id_link(&tex->ima, newima);
- }
-
- for (sce= G.main->scene.first; sce; sce= sce->id.next) {
- if (sce->ima == oldima)
- change_id_link(&sce->ima, newima);
- }
-
- for (sc= G.main->screen.first; sc; sc= sc->id.next) {
- ScrArea *sa;
-
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- SpaceLink *sl;
-
- for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if (sl->spacetype == SPACE_VIEW3D) {
- View3D *v3d= (View3D*) sl;
- BGpic *bgp= v3d->bgpic;
-
- if (bgp && bgp->ima == oldima)
- change_id_link(&bgp->ima, newima);
- } else if (sl->spacetype == SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage*) sl;
-
- if (sima->image == oldima)
- change_id_link(&sima->image, newima);
- }
- }
- }
- }
-
- for (me= G.main->mesh.first; me; me= me->id.next) {
- int i, a;
- MTFace *tface;
-
- for(i=0; i<me->fdata.totlayer; i++) {
- if(me->fdata.layers[i].type == CD_MTFACE) {
- tface= (MTFace*)me->fdata.layers[i].data;
-
- for (a=0; a<me->totface; a++, tface++) {
- if (tface->tpage == oldima) {
- /* not change_id_link, tpage's aren't owners :(
- * see hack below.
- */
- tface->tpage= newima;
- }
- }
- }
- }
- }
-
- /* Nasty hack, necessary because tpages don't act
- * as a user, so there lots of image user count
- * munging occurs... this will ensure the image
- * really dies.
- */
- oldima->id.us= 0;
-}
-
-static void replace_material(ID *oldblock, ID *newblock)
-{
- Material *old= (Material*) oldblock;
- Material *new= (Material*) newblock;
- Material ***matarar;
- ID *id;
- Object *ob;
- int a;
-
- ob= G.main->object.first;
- while(ob) {
- if(ob->totcol && ob->id.lib==0) {
- matarar= give_matarar(ob);
- for(a=1; a<=ob->totcol; a++) {
- if(ob->mat[a-1] == old) {
- if(old) old->id.us--;
- id_us_plus((ID *)new);
- ob->mat[a-1]= new;
- }
- id= ob->data;
- if( (*matarar)[a-1] == old && id->lib==0) {
- if(old) old->id.us--;
- id_us_plus((ID *)new);
- (*matarar)[a-1]= new;
- }
- }
- }
- ob= ob->id.next;
- }
-}
-
-static ReplaceFP get_id_replace_function(int idcode) {
- switch (idcode) {
- case ID_MA:
- return &replace_material;
- case ID_IM:
- return &replace_image;
- default:
- return NULL;
- }
-}
-
-static void databrowse_replace(SpaceFile *sfile, int idcode)
-{
- ReplaceFP replace_func= get_id_replace_function(idcode);
-
- if (!replace_func) {
- error("Replacing %s blocks is unsupported", BLO_idcode_to_name(idcode));
- } else if (sfile->act==-1) {
- error("Select target with leftmouse");
- } else {
- ID *target= (ID*) sfile->filelist[sfile->act].poin;
-
- if (target) {
- char buf[128];
-
- sprintf(buf, "Replace with %s: %s", BLO_idcode_to_name(idcode), target->name+2);
-
- if (okee(buf)) {
- int i;
-
- for (i = 0; i <sfile->totfile; i++)
- if ((sfile->filelist[i].flags&ACTIVE) && sfile->filelist[i].poin!=target)
- replace_func(sfile->filelist[i].poin, target);
- }
- }
- }
-
- freefilelist(sfile);
- scrarea_queue_winredraw(curarea);
-}
-
-static void fs_fake_users(SpaceFile *sfile)
-{
- ID *id;
- int a;
-
- /* only for F4 DATABROWSE */
- if(filesel_has_func(sfile)) return;
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & ACTIVE) {
- id= (ID *)sfile->filelist[a].poin;
- if(id) {
- if( id->flag & LIB_FAKEUSER) {
- id->flag -= LIB_FAKEUSER;
- id->us--;
- }
- else {
- id->flag |= LIB_FAKEUSER;
- id->us++;
- }
- }
- }
- }
- freefilelist(sfile);
- scrarea_queue_winredraw(curarea);
-}
-
-
-static int get_hilited_entry(SpaceFile *sfile)
-{
- int a;
-
- for(a=0; a<sfile->totfile; a++) {
- if(sfile->filelist[a].flags & HILITE) {
- return a;
- }
- }
- return -1;
-}
-
-
-void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- static int acto=0;
- SpaceFile *sfile;
- int act, do_draw= 0, i, test, ret = 0;
- short qual, mval[2];
- char str[FILE_MAX+12];
-
- sfile= curarea->spacedata.first;
- if(sfile==0) return;
- if(sfile->filelist==0) {
- return;
- }
-
- if(curarea->win==0) return;
- calc_file_rcts(sfile);
- getmouseco_areawin(mval);
-
- /* prevent looping */
- if(selecting && !(get_mbut() & R_MOUSE)) selecting= 0;
-
- if(val) {
-
- if( event!=RETKEY && event!=PADENTER)
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- switch(event) {
-
- case UI_BUT_EVENT:
- do_filesel_buttons(val, sfile);
- break;
-
- case WHEELDOWNMOUSE:
- do_filescrollwheel(sfile, U.wheellinescroll);
- act= find_active_file(sfile, mval[0], mval[1]);
- set_active_file(sfile, act);
- do_draw= 1;
- break;
- case WHEELUPMOUSE:
- do_filescrollwheel(sfile, -U.wheellinescroll);
- act= find_active_file(sfile, mval[0], mval[1]);
- set_active_file(sfile, act);
- do_draw= 1;
- break;
-
- case LEFTMOUSE:
- case MIDDLEMOUSE:
- if(mval[0]>scrollrct.xmin && mval[0]<scrollrct.xmax && mval[1]>scrollrct.ymin && mval[1]<scrollrct.ymax) {
- do_filescroll(sfile);
- }
- else if(mval[0]>textrct.xmin && mval[0]<textrct.xmax && mval[1]>textrct.ymin && mval[1]<textrct.ymax) {
-
- /* sfile->act is used in databrowse: double names of library objects */
-
- sfile->act= act= find_active_file(sfile, mval[0], mval[1]);
-
- if(act>=0 && act<sfile->totfile) {
- if(S_ISDIR(sfile->filelist[act].type)) {
- /* the path is too long and we are not going up! */
- if (strcmp(sfile->filelist[act].relname, ".") &&
- strcmp(sfile->filelist[act].relname, "..") &&
- strlen(sfile->dir) + strlen(sfile->filelist[act].relname) >= FILE_MAX )
- {
- error("Path too long, cannot enter this directory");
- } else {
- if (strcmp(sfile->filelist[act].relname, "..")==0) {
- /* avoids /../../ */
- BLI_parent_dir(sfile->dir);
- } else {
- strcat(sfile->dir, sfile->filelist[act].relname);
- strcat(sfile->dir,"/");
- BLI_cleanup_dir(G.sce, sfile->dir);
- }
- freefilelist(sfile);
- sfile->ofs= 0;
- do_draw= 1;
- }
- } else {
- if( strcmp(sfile->file, sfile->filelist[act].relname)) {
- BLI_strncpy(sfile->file, sfile->filelist[act].relname, sizeof(sfile->file));
- do_draw = 1;
-
-#ifdef INTERNATIONAL
- if (sfile->type==FILE_LOADFONT && event!=MIDDLEMOUSE) {
- /* Font Preview */
- char tmpstr[240];
- if (sfile->f_fp) {
- sprintf (tmpstr, "%s%s", sfile->dir, sfile->file);
-
- if (!FTF_GetNewFont ((const unsigned char *)tmpstr, 0, U.fontsize)) {
- error ("No font file");
- }
- }
- }
-#endif
- }
- if(event==MIDDLEMOUSE && sfile->type) filesel_execute(sfile);
- }
- }
- }
- break;
- case RIGHTMOUSE:
- act= find_active_file(sfile, mval[0], mval[1]);
- acto= act;
- if(act>=0 && act<sfile->totfile) {
-
- if (sfile->filelist[act].flags & ACTIVE) {
- sfile->filelist[act].flags &= ~ACTIVE;
- selecting = INACTIVATE;
- }
- else {
- test= sfile->filelist[act].relname[0];
- if (act>=2 || test!='.') sfile->filelist[act].flags |= ACTIVE;
-
- selecting = ACTIVATE;
- }
- do_draw= 1;
- }
- break;
- case MOUSEY:
- act= find_active_file(sfile, mval[0], mval[1]);
- if (act!=acto) {
- set_active_file(sfile, act);
- }
- if(selecting && act!=acto) {
-
- while(1) {
- if (acto >= 2 && acto < sfile->totfile) {
- if (selecting == ACTIVATE) sfile->filelist[acto].flags |= ACTIVE;
- else if (selecting == INACTIVATE) sfile->filelist[acto].flags &= ~ACTIVE;
- }
- if (acto < act) acto++;
- else if (acto > act) acto--;
- else break;
-
- }
-
- }
- acto= act;
- break;
-
- case PAGEUPKEY:
- sfile->ofs-= page_ofs;
- do_draw= 1;
- break;
- case PAGEDOWNKEY:
- sfile->ofs+= page_ofs;
- do_draw= 1;
- break;
- case HOMEKEY:
- sfile->ofs= 0;
- do_draw= 1;
- break;
- case ENDKEY:
- sfile->ofs= sfile->totfile;
- do_draw= 1;
- break;
-
- case AKEY:
- swapselect_file(sfile);
- if(sfile->type==FILE_MAIN) filesel_select_objects(sfile);
- do_draw= 1;
- break;
-
- case BKEY:
- case CKEY:
- case LKEY:
- if(event==LKEY && sfile->type==FILE_MAIN && (G.qual & LR_CTRLKEY)) {
- databrowse_replace(sfile, groupname_to_code(sfile->dir));
- break;
- }
- /* pass */
- case MKEY:
- if(sfile->type==FILE_MAIN) break;
-
- if(!countselect(sfile)) {
- error("No files selected");
- break;
- }
-
- if(!getotherdir()) {
- error("No second fileselect");
- break;
- }
-
- if (!strcmp(sfile->dir, otherdir)) {
- error("Same directories");
- break;
- }
-
- if(event==BKEY) sprintf(str, "Backup to %s", otherdir);
- else if(event==CKEY) sprintf(str, "Copy to %s", otherdir);
- else if(event==LKEY) sprintf(str, "Linked copy to %s", otherdir);
- else if(event==MKEY) sprintf(str, "Move to %s", otherdir);
-
- if (!okee(str)) break;
-
- for (i = 0; i<sfile->totfile; i++){
- if (sfile->filelist[i].flags & ACTIVE) {
- BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[i].relname);
-
- if(event==CKEY) ret= BLI_copy_fileops(str, otherdir);
- else if(event==LKEY) ret= BLI_link(str, otherdir);
- else if(event==MKEY) ret= BLI_move(str, otherdir);
-
- if (ret) {error("Command failed, see console"); break;}
- else sfile->filelist[i].flags &= ~ACTIVE;
- }
- }
- do_draw= 1;
- if(event==BKEY || event==MKEY)
- freefilelist(sfile);
-
- reread_other_fs();
-
- break;
-
- case XKEY:
- if(sfile->type==FILE_BLENDER) {
- test = get_hilited_entry(sfile);
-
- if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){
- BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[test].relname);
-
- if( okee("Remove %s", str) ) {
- ret = BLI_delete(str, 0, 0);
- if (ret) {
- error("Command failed, see console");
- } else {
- freefilelist(sfile);
- do_draw= 1;
- }
- }
- }
- }
- break;
-
- case RKEY:
- if(sfile->type==FILE_MAIN) {
- databrowse_replace(sfile, groupname_to_code(sfile->dir));
- break;
- }
- /* pass to TKEY! */
-
- case TKEY:
- if(sfile->type==FILE_MAIN) break;
-
- if(!countselect(sfile)) {
- error("No files selected");
- break;
- }
-
- if(event==TKEY) sprintf(str, "Touch");
- else if(event==RKEY) sprintf(str, "Remove from %s", sfile->dir);
-
- qual= G.qual; /* because after okee() you released the SHIFT */
- if (!okee(str)) break;
-
- for (i = 0; i <sfile->totfile; i++) {
- if (sfile->filelist[i].flags & ACTIVE) {
- BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[i].relname);
-
- if(event==TKEY) ret= BLI_touch(str);
- else if(event==RKEY) {
- if(qual & LR_SHIFTKEY) ret= BLI_delete(str, 0, 1);
- else if(S_ISDIR(sfile->filelist[i].type)) ret= BLI_delete(str, 1, 0);
- else ret= BLI_delete(str, 0, 0);
- }
-
- if (ret) {error("Command failed, see console"); break;}
- else sfile->filelist[i].flags &= ~ACTIVE;
- }
- }
- do_draw= 1;
- freefilelist(sfile);
-
- break;
-
- case PKEY:
- if(G.qual & LR_SHIFTKEY) {
- extern char bprogname[]; /* usiblender.c */
-#ifdef WIN32
- sprintf(str, "%s -a \"%s%s\"", bprogname, sfile->dir, sfile->file);
-#else
- sprintf(str, "\"%s\" -a \"%s%s\"", bprogname, sfile->dir, sfile->file);
-#endif
- system(str);
- }
- else
- parent(sfile);
-
- break;
-
- case IKEY:
- if(sfile->type==FILE_MAIN) break;
-
- sprintf(str, "$IMAGEEDITOR %s%s", sfile->dir, sfile->file);
- system(str);
- break;
-
- case EKEY:
- if(sfile->type==FILE_MAIN) break;
-
- sprintf(str, "$WINEDITOR %s%s", sfile->dir, sfile->file);
- system(str);
- break;
-
- case FKEY:
- if(sfile->type==FILE_MAIN) {
- fs_fake_users(sfile);
- }
- break;
- case HKEY:
- sfile->flag ^= FILE_HIDE_DOT;
- BLI_hide_dot_files(sfile->flag & FILE_HIDE_DOT);
- freefilelist(sfile);
- scrarea_queue_winredraw(curarea);
- break;
- case PADPLUSKEY:
- case EQUALKEY:
- if (G.qual & LR_CTRLKEY) BLI_newname(sfile->file, +100);
- else if (G.qual & LR_SHIFTKEY) BLI_newname(sfile->file, +10);
- else BLI_newname(sfile->file, +1);
-
- do_draw= 1;
- break;
-
- case PADMINUS:
- case MINUSKEY:
- if (G.qual & LR_CTRLKEY) BLI_newname(sfile->file, -100);
- else if (G.qual & LR_SHIFTKEY) BLI_newname(sfile->file, -10);
- else BLI_newname(sfile->file, -1);
-
- do_draw= 1;
- break;
-
- case BACKSLASHKEY:
- case SLASHKEY:
- if(sfile->type==FILE_MAIN) break;
-
-#ifdef WIN32
- BLI_strncpy(sfile->dir, "\\", sizeof(sfile->dir));
-#else
- BLI_strncpy(sfile->dir, "/", sizeof(sfile->dir));
-#endif
- freefilelist(sfile);
- sfile->ofs= 0;
- do_draw= 1;
- break;
- case PERIODKEY:
- freefilelist(sfile);
- do_draw= 1;
- break;
- case ESCKEY:
- filesel_prevspace();
- break;
- case PADENTER:
- case RETKEY:
- if(sfile->type) filesel_execute(sfile);
- break;
- }
- }
- else if(event==RIGHTMOUSE) {
- selecting = NOTACTIVE;
- if(sfile->type==FILE_MAIN) filesel_select_objects(sfile);
- }
- else if(event==LEFTMOUSE) {
- if(sfile->type==FILE_MAIN) active_file_object(sfile);
- }
-
- /* XXX, stupid patch, curarea can become undone
- * because of file loading... fixme zr
- */
- if(do_draw && curarea) scrarea_queue_winredraw(curarea);
-}
-
-
-
-
-/* ************* LIBRARY FILESEL ******************* */
-
-static int groupname_to_code(char *group)
-{
- char buf[GROUP_MAX];
- char *lslash;
-
- BLI_strncpy(buf, group, GROUP_MAX);
- lslash= BLI_last_slash(buf);
- if (lslash)
- lslash[0]= '\0';
-
- return BLO_idcode_from_name(buf);
-}
-
-static int is_a_library(SpaceFile *sfile, char *dir, char *group)
-{
- /* return ok when a blenderfile, in dir is the filename,
- * in group the type of libdata
- */
- int len;
- char *fd;
-
- strcpy(dir, sfile->dir);
- len= strlen(dir);
- if(len<7) return 0;
- if( dir[len-1] != '/' && dir[len-1] != '\\') return 0;
-
- group[0]= 0;
- dir[len-1]= 0;
-
- /* Find the last slash */
- fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\');
-
- if(fd==0) return 0;
- *fd= 0;
- if(BLO_has_bfile_extension(fd+1)) {
- /* the last part of the dir is a .blend file, no group follows */
- *fd= '/'; /* put back the removed slash separating the dir and the .blend file name */
- }
- else {
- char *gp = fd+1; // in case we have a .blend file, gp points to the group
-
- /* Find the last slash */
- fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\');
- if (!fd || !BLO_has_bfile_extension(fd+1)) return 0;
-
- /* now we know that we are in a blend file and it is safe to
- assume that gp actually points to a group */
- if (BLI_streq("Screen", gp)==0)
- BLI_strncpy(group, gp, GROUP_MAX);
- }
- return 1;
-}
-
-static void do_library_append(SpaceFile *sfile)
-{
- Library *lib;
- char dir[FILE_MAX], group[GROUP_MAX];
-
- if ( is_a_library(sfile, dir, group)==0 ) {
- error("Not a library");
- } else if (!sfile->libfiledata) {
- error("Library not loaded");
- } else if (group[0]==0) {
- error("Nothing indicated");
- } else if (BLI_streq(G.main->name, dir)) {
- error("Cannot use current file as library");
- } else {
- Object *ob;
- int idcode = groupname_to_code(group);
-
- if((sfile->flag & FILE_LINK)==0)
- /* tag everything, all untagged data can be made local */
- flag_all_listbases_ids(LIB_APPEND_TAG, 1);
-
- BLO_library_append(sfile, dir, idcode);
-
- /* DISPLISTS? */
- ob= G.main->object.first;
- while(ob) {
- if(ob->id.lib) {
- ob->recalc |= OB_RECALC;
- }
- ob= ob->id.next;
- }
-
- /* and now find the latest append lib file */
- lib= G.main->library.first;
- while(lib) {
- if (BLI_streq(dir, lib->filename)) break;
- lib= lib->id.next;
- }
-
- /* make local */
- if(lib && (sfile->flag & FILE_LINK)==0) {
- all_local(lib, 1);
- /* important we unset, otherwise these object wont
- * link into other scenes from this blend file */
- flag_all_listbases_ids(LIB_APPEND_TAG, 0);
- }
-
- DAG_scene_sort(G.scene);
-
- /* in sfile->dir is the whole lib name */
- BLI_strncpy(G.lib, sfile->dir, sizeof(G.lib) );
- }
-}
-
-static void library_to_filelist(SpaceFile *sfile)
-{
- LinkNode *l, *names;
- int ok, i, nnames, idcode;
- char filename[FILE_MAX];
- char dir[FILE_MAX], group[GROUP_MAX];
-
- /* name test */
- ok= is_a_library(sfile, dir, group);
- if (!ok) {
- /* free */
- if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata);
- sfile->libfiledata= 0;
- return;
- }
-
- BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI
-
- /* there we go */
- /* for the time being only read filedata when libfiledata==0 */
- if (sfile->libfiledata==0) {
- sfile->libfiledata= BLO_blendhandle_from_file(dir); // this sets G.sce, we dont want it
-
- if(sfile->libfiledata==0) return;
- }
-
- idcode= groupname_to_code(group);
-
- // memory for strings is passed into filelist[i].relname
- // and free'd in freefilelist
- if (idcode) {
- names= BLO_blendhandle_get_datablock_names(sfile->libfiledata, idcode);
- } else {
- names= BLO_blendhandle_get_linkable_groups(sfile->libfiledata);
- }
-
- nnames= BLI_linklist_length(names);
-
- sfile->totfile= nnames + 2;
- sfile->filelist= malloc(sfile->totfile * sizeof(*sfile->filelist));
- memset(sfile->filelist, 0, sfile->totfile * sizeof(*sfile->filelist));
-
- sfile->filelist[0].relname= BLI_strdup(".");
- sfile->filelist[0].type |= S_IFDIR;
- sfile->filelist[1].relname= BLI_strdup("..");
- sfile->filelist[1].type |= S_IFDIR;
-
- for (i=0, l= names; i<nnames; i++, l= l->next) {
- char *blockname= BLI_strdup(l->link);
-
- sfile->filelist[i + 2].relname= blockname;
- if (!idcode)
- sfile->filelist[i + 2].type |= S_IFDIR;
- }
-
- BLI_linklist_free(names, free);
-
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name);
-
- sfile->maxnamelen= 0;
- for(i=0; i<sfile->totfile; i++) {
- int len = BMF_GetStringWidth(G.font, sfile->filelist[i].relname);
- if (len > sfile->maxnamelen)
- sfile->maxnamelen = len;
- }
-
- BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change
-
-}
-
-/* ******************* DATA SELECT ********************* */
-
-static void filesel_select_objects(SpaceFile *sfile)
-{
- Object *ob;
- Base *base;
- Scene *sce;
- int a;
-
- /* only when F4 DATABROWSE */
- if(filesel_has_func(sfile)) return;
-
- if( strcmp(sfile->dir, "Object/")==0 ) {
- for(a=0; a<sfile->totfile; a++) {
-
- ob= (Object *)sfile->filelist[a].poin;
-
- if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) {
- if(sfile->filelist[a].flags & ACTIVE) ob->flag |= SELECT;
- else ob->flag &= ~SELECT;
- }
-
- }
- base= FIRSTBASE;
- while(base) {
- base->flag= base->object->flag;
- base= base->next;
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- }
- else if( strcmp(sfile->dir, "Scene/")==0 ) {
-
- for(a=0; a<sfile->totfile; a++) {
-
- sce= (Scene *)sfile->filelist[a].poin;
- if(sce) {
- if(sfile->filelist[a].flags & ACTIVE) sce->r.scemode |= R_BG_RENDER;
- else sce->r.scemode &= ~R_BG_RENDER;
- }
-
- }
- allqueue(REDRAWBUTSSCENE, 0);
- }
-}
-
-static void active_file_object(SpaceFile *sfile)
-{
- Object *ob;
-
- /* only when F4 DATABROWSE */
- if(filesel_has_func(sfile)) return;
-
- if( strcmp(sfile->dir, "Object/")==0 ) {
- if(sfile->act >= 0 && sfile->act < sfile->totfile) {
-
- ob= (Object *)sfile->filelist[sfile->act].poin;
-
- if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) {
- set_active_object(ob);
- if(BASACT && BASACT->object==ob) {
- BASACT->flag |= SELECT;
- sfile->filelist[sfile->act].flags |= ACTIVE;
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- scrarea_queue_winredraw(curarea);
- }
- }
- }
- }
-}
-
-
-void main_to_filelist(SpaceFile *sfile)
-{
- ID *id;
- struct direntry *files, *firstlib = NULL;
- ListBase *lb;
- int a, fake, idcode, len, ok, totlib, totbl;
- short hide = 0;
-
- if (sfile->flag & FILE_HIDE_DOT)
- hide = 1;
-
- if(sfile->dir[0]=='/') sfile->dir[0]= 0;
-
- if(sfile->dir[0]) {
- idcode= groupname_to_code(sfile->dir);
- if(idcode==0) sfile->dir[0]= 0;
- }
-
- if( sfile->dir[0]==0) {
-
- /* make directories */
- sfile->totfile= 24;
- sfile->filelist= (struct direntry *)malloc(sfile->totfile * sizeof(struct direntry));
-
- for(a=0; a<sfile->totfile; a++) {
- memset( &(sfile->filelist[a]), 0 , sizeof(struct direntry));
- sfile->filelist[a].type |= S_IFDIR;
- }
-
- sfile->filelist[0].relname= BLI_strdup("..");
- sfile->filelist[1].relname= BLI_strdup(".");
- sfile->filelist[2].relname= BLI_strdup("Scene");
- sfile->filelist[3].relname= BLI_strdup("Group");
- sfile->filelist[4].relname= BLI_strdup("Object");
- sfile->filelist[5].relname= BLI_strdup("Mesh");
- sfile->filelist[6].relname= BLI_strdup("Curve");
- sfile->filelist[7].relname= BLI_strdup("Metaball");
- sfile->filelist[8].relname= BLI_strdup("Material");
- sfile->filelist[9].relname= BLI_strdup("Texture");
- sfile->filelist[10].relname= BLI_strdup("Image");
- sfile->filelist[11].relname= BLI_strdup("Wave");
- sfile->filelist[12].relname= BLI_strdup("Lattice");
- sfile->filelist[13].relname= BLI_strdup("Lamp");
- sfile->filelist[14].relname= BLI_strdup("Camera");
- sfile->filelist[15].relname= BLI_strdup("Ipo");
- sfile->filelist[16].relname= BLI_strdup("World");
- sfile->filelist[17].relname= BLI_strdup("Screen");
- sfile->filelist[18].relname= BLI_strdup("VFont");
- sfile->filelist[19].relname= BLI_strdup("Text");
- sfile->filelist[20].relname= BLI_strdup("Armature");
- sfile->filelist[21].relname= BLI_strdup("Action");
- sfile->filelist[22].relname= BLI_strdup("NodeTree");
- sfile->filelist[23].relname= BLI_strdup("Brush");
-
- qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name);
- }
- else {
-
- /* make files */
- idcode= groupname_to_code(sfile->dir);
-
- lb= wich_libbase(G.main, idcode );
- if(lb==0) return;
-
- id= lb->first;
- sfile->totfile= 0;
- while(id) {
- if(filesel_has_func(sfile) && idcode==ID_IP) {
- if(sfile->ipotype== ((Ipo *)id)->blocktype) sfile->totfile++;
- }
- else if (hide==0 || id->name[2] != '.')
- sfile->totfile++;
-
- id= id->next;
- }
-
- if(!filesel_has_func(sfile)) sfile->totfile+= 2;
- sfile->filelist= (struct direntry *)malloc(sfile->totfile * sizeof(struct direntry));
-
- files= sfile->filelist;
-
- if(!filesel_has_func(sfile)) {
- memset( &(sfile->filelist[0]), 0 , sizeof(struct direntry));
- sfile->filelist[0].relname= BLI_strdup(".");
- sfile->filelist[0].type |= S_IFDIR;
- memset( &(sfile->filelist[1]), 0 , sizeof(struct direntry));
- sfile->filelist[1].relname= BLI_strdup("..");
- sfile->filelist[1].type |= S_IFDIR;
-
- files+= 2;
- }
-
- id= lb->first;
- totlib= totbl= 0;
-
- while(id) {
-
- ok= 0;
- if(filesel_has_func(sfile) && idcode==ID_IP) {
- if(sfile->ipotype== ((Ipo *)id)->blocktype) ok= 1;
- }
- else ok= 1;
-
- if(ok) {
-
- if (hide==0 || id->name[2] != '.') {
- memset( files, 0 , sizeof(struct direntry));
- if(id->lib==NULL)
- files->relname= BLI_strdup(id->name+2);
- else {
- char tmp[FILE_MAX], fi[FILE_MAXFILE];
- BLI_strncpy(tmp, id->lib->name, FILE_MAX);
- BLI_splitdirstring(tmp, fi);
- files->relname= MEM_mallocN(FILE_MAXFILE+32, "filename for lib");
- sprintf(files->relname, "%s / %s", fi, id->name+2);
- }
-
- if(!filesel_has_func(sfile)) { /* F4 DATA BROWSE */
- if(idcode==ID_OB) {
- if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVE;
- }
- else if(idcode==ID_SCE) {
- if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVE;
- }
- }
- files->nr= totbl+1;
- files->poin= id;
- fake= id->flag & LIB_FAKEUSER;
-
- if(id->lib && fake) sprintf(files->extra, "LF %d", id->us);
- else if(id->lib) sprintf(files->extra, "L %d", id->us);
- else if(fake) sprintf(files->extra, "F %d", id->us);
- else sprintf(files->extra, " %d", id->us);
-
- if(id->lib) {
- if(totlib==0) firstlib= files;
- totlib++;
- }
-
- files++;
- }
- totbl++;
- }
-
- id= id->next;
- }
-
- /* only qsort of libraryblokken */
- if(totlib>1) {
- qsort(firstlib, totlib, sizeof(struct direntry), compare_name);
- }
- }
-
- sfile->maxnamelen= 0;
- for(a=0; a<sfile->totfile; a++) {
- len = BMF_GetStringWidth(G.font, sfile->filelist[a].relname);
- if (len > sfile->maxnamelen) sfile->maxnamelen = len;
-
- if(filetoname) {
- if( strcmp(sfile->file, sfile->filelist[a].relname)==0) {
- sfile->ofs= a-( sfile->collums*(curarea->winy-FILESELHEAD-10)/(2*FILESEL_DY));
- filetoname= 0;
- if(filesel_has_func(sfile)) sfile->filelist[a].flags |= ACTIVE;
- }
- }
- }
-}
-
-
-void clever_numbuts_filesel()
-{
- SpaceFile *sfile;
- char orgname[FILE_MAX+12];
- char filename[FILE_MAX+12];
- char newname[FILE_MAX+12];
- int test;
- int len;
-
- sfile= curarea->spacedata.first;
-
- if(sfile->type==FILE_MAIN) return;
-
- len = 110;
- test = get_hilited_entry(sfile);
-
- if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){
- BLI_make_file_string(G.sce, orgname, sfile->dir, sfile->filelist[test].relname);
- BLI_strncpy(filename, sfile->filelist[test].relname, sizeof(filename));
-
- add_numbut(0, TEX, "", 0, len, filename, "Rename File");
-
- if( do_clever_numbuts("Rename File", 1, REDRAW) ) {
- BLI_make_file_string(G.sce, newname, sfile->dir, filename);
-
- if( strcmp(orgname, newname) != 0 ) {
- BLI_rename(orgname, newname);
- freefilelist(sfile);
- }
- }
-
- scrarea_queue_winredraw(curarea);
- }
-}
-
diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c
deleted file mode 100644
index 9c3116e53db..00000000000
--- a/source/blender/src/fluidsim.c
+++ /dev/null
@@ -1,1142 +0,0 @@
-/**
- * fluidsim.c
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) Blender Foundation
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-#include "MEM_guardedalloc.h"
-
-/* types */
-#include "DNA_curve_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_threads.h"
-#include "BLI_arithb.h"
-#include "MTC_matrixops.h"
-
-#include "BKE_customdata.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_fluidsim.h"
-#include "BKE_global.h"
-#include "BKE_modifier.h"
-#include "BKE_main.h"
-#include "BKE_key.h"
-#include "BKE_scene.h"
-#include "BKE_object.h"
-#include "BKE_softbody.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_ipo.h"
-#include "LBM_fluidsim.h"
-// warning - double elbeem.h in intern/extern...
-#include "elbeem.h"
-
-#include "BLI_editVert.h"
-#include "BIF_editdeform.h"
-#include "BIF_gl.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_cursors.h"
-#include "BIF_interface.h"
-#include "BSE_headerbuttons.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include <sys/stat.h>
-
-#ifdef WIN32 /* Windos */
-//#include "BLI_winstuff.h"
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
-/* from header info.c */
-extern int start_progress_bar(void);
-extern void end_progress_bar(void);
-extern int progress_bar(float done, char *busy_info);
-
-double fluidsimViscosityPreset[6] = {
- -1.0, /* unused */
- -1.0, /* manual */
- 1.0e-6, /* water */
- 5.0e-5, /* some (thick) oil */
- 2.0e-3, /* ca. honey */
- -1.0 /* end */
-};
-
-char* fluidsimViscosityPresetString[6] = {
- "UNUSED", /* unused */
- "UNUSED", /* manual */
- " = 1.0 * 10^-6", /* water */
- " = 5.0 * 10^-5", /* some (thick) oil */
- " = 2.0 * 10^-3", /* ca. honey */
- "INVALID" /* end */
-};
-
-/* enable/disable overall compilation */
-#ifndef DISABLE_ELBEEM
-
-
-/* ********************** fluid sim settings struct functions ********************** */
-
-/* helper function */
-void fluidsimGetGeometryObjFilename(struct Object *ob, char *dst) { //, char *srcname) {
- //snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
- snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
-}
-
-
-
-
-/* ******************************************************************************** */
-/* ********************** fluid sim channel helper functions ********************** */
-/* ******************************************************************************** */
-
-// no. of entries for the two channel sizes
-#define CHANNEL_FLOAT 1
-#define CHANNEL_VEC 3
-
-#define FS_FREE_ONECHANNEL(c,str) { \
- if(c){ MEM_freeN(c); c=NULL; } \
-} // end ONE CHANN, debug: fprintf(stderr,"freeing " str " \n");
-
-#define FS_FREE_CHANNELS { \
- FS_FREE_ONECHANNEL(timeAtIndex,"timeAtIndex");\
- FS_FREE_ONECHANNEL(timeAtFrame,"timeAtFrame");\
- FS_FREE_ONECHANNEL(channelDomainTime,"channelDomainTime"); \
- FS_FREE_ONECHANNEL(channelDomainGravity,"channelDomainGravity");\
- FS_FREE_ONECHANNEL(channelDomainViscosity,"channelDomainViscosity");\
- for(i=0;i<256;i++) { \
- FS_FREE_ONECHANNEL(channelObjMove[i][0],"channelObjMove0"); \
- FS_FREE_ONECHANNEL(channelObjMove[i][1],"channelObjMove1"); \
- FS_FREE_ONECHANNEL(channelObjMove[i][2],"channelObjMove2"); \
- FS_FREE_ONECHANNEL(channelObjInivel[i],"channelObjInivel"); \
- FS_FREE_ONECHANNEL(channelObjActive[i],"channelObjActive"); \
- FS_FREE_ONECHANNEL(channelAttractforceStrength[i],"channelAttractforceStrength"); \
- FS_FREE_ONECHANNEL(channelAttractforceRadius[i],"channelAttractforceRadius"); \
- FS_FREE_ONECHANNEL(channelVelocityforceStrength[i],"channelVelocityforceStrength"); \
- FS_FREE_ONECHANNEL(channelVelocityforceRadius[i],"channelVelocityforceRadius"); \
- } \
-} // end FS FREE CHANNELS
-
-
-// simplify channels before printing
-// for API this is done anyway upon init
-#if 0
-static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char *str, int entries)
-{
- int i,j;
- int channelSize = paramsize;
-
- if(entries==3) {
- elbeemSimplifyChannelVec3( channel, &channelSize);
- } else if(entries==1) {
- elbeemSimplifyChannelFloat( channel, &channelSize);
- } else {
- // invalid, cant happen?
- }
-
- fprintf(file, " CHANNEL %s = \n", str);
- for(i=0; i<channelSize;i++) {
- fprintf(file," ");
- for(j=0;j<=entries;j++) { // also print time value
- fprintf(file," %f ", channel[i*(entries+1)+j] );
- if(j==entries-1){ fprintf(file," "); }
- }
- fprintf(file," \n");
- }
-
- fprintf(file, " ; \n" );
-}
-#endif
-
-static void fluidsimInitChannel(float **setchannel, int size, float *time,
- int *icuIds, float *defaults, Ipo* ipo, int entries) {
- int i,j;
- IpoCurve* icus[3];
- char *cstr = NULL;
- float *channel = NULL;
- float aniFrlen = G.scene->r.framelen;
- int current_frame = G.scene->r.cfra;
- if((entries<1) || (entries>3)) {
- printf("fluidsimInitChannel::Error - invalid no. of entries: %d\n",entries);
- entries = 1;
- }
-
- cstr = "fluidsiminit_channelfloat";
- if(entries>1) cstr = "fluidsiminit_channelvec";
- channel = MEM_callocN( size* (entries+1)* sizeof(float), cstr );
-
- if(ipo) {
- for(j=0; j<entries; j++) icus[j] = find_ipocurve(ipo, icuIds[j] );
- } else {
- for(j=0; j<entries; j++) icus[j] = NULL;
- }
-
- for(j=0; j<entries; j++) {
- if(icus[j]) {
- for(i=1; i<=size; i++) {
- /* Bugfix to make python drivers working
- // which uses Blender.get("curframe")
- */
- G.scene->r.cfra = floor(aniFrlen*((float)i));
-
- calc_icu(icus[j], aniFrlen*((float)i) );
- channel[(i-1)*(entries+1) + j] = icus[j]->curval;
- }
- } else {
- for(i=1; i<=size; i++) { channel[(i-1)*(entries+1) + j] = defaults[j]; }
- }
- //printf("fluidsimInitChannel entry:%d , ",j); for(i=1; i<=size; i++) { printf(" val%d:%f ",i, channel[(i-1)*(entries+1) + j] ); } printf(" \n"); // DEBUG
- }
- // set time values
- for(i=1; i<=size; i++) {
- channel[(i-1)*(entries+1) + entries] = time[i];
- }
- G.scene->r.cfra = current_frame;
- *setchannel = channel;
-}
-
-static void fluidsimInitMeshChannel(float **setchannel, int size, Object *obm, int vertices, float *time, int modifierIndex) {
- float *channel = NULL;
- int mallsize = size* (3*vertices+1);
- int frame,i;
- int numVerts=0, numTris=0;
- int setsize = 3*vertices+1;
-
- channel = MEM_callocN( mallsize* sizeof(float), "fluidsim_meshchannel" );
-
- //fprintf(stderr,"\n\nfluidsimInitMeshChannel size%d verts%d mallsize%d \n\n\n",size,vertices,mallsize);
- for(frame=1; frame<=size; frame++) {
- float *verts=NULL;
- int *tris=NULL;
- G.scene->r.cfra = frame;
- scene_update_for_newframe(G.scene, G.scene->lay);
-
- initElbeemMesh(obm, &numVerts, &verts, &numTris, &tris, 1, modifierIndex);
- //fprintf(stderr,"\nfluidsimInitMeshChannel frame%d verts%d/%d \n\n",frame,vertices,numVerts);
- for(i=0; i<3*vertices;i++) {
- channel[(frame-1)*setsize + i] = verts[i];
- //fprintf(stdout," frame%d vert%d=%f \n",frame,i,verts[i]);
- //if(i%3==2) fprintf(stdout,"\n");
- }
- channel[(frame-1)*setsize + setsize-1] = time[frame];
-
- MEM_freeN(verts);
- MEM_freeN(tris);
- }
- *setchannel = channel;
-}
-
-
-/* ******************************************************************************** */
-/* ********************** simulation thread ************************* */
-/* ******************************************************************************** */
-
-static volatile int globalBakeState = 0; // 0 everything ok, -1 abort simulation, -2 sim error, 1 sim done
-static volatile int globalBakeFrame = 0;
-static volatile int g_break= 0;
-
-// run simulation in seperate thread
-static void *fluidsimSimulateThread(void *unused) { // *ptr) {
- //char* fnameCfgPath = (char*)(ptr);
- int ret=0;
-
- ret = elbeemSimulate();
- BLI_lock_thread(LOCK_CUSTOM1);
- if(globalBakeState==0) {
- if(ret==0) {
- // if no error, set to normal exit
- globalBakeState = 1;
- } else {
- // simulation failed, display error
- globalBakeState = -2;
- }
- }
- BLI_unlock_thread(LOCK_CUSTOM1);
- return NULL;
-}
-
-
-int runSimulationCallback(void *data, int status, int frame) {
- //elbeemSimulationSettings *settings = (elbeemSimulationSettings*)data;
- //printf("elbeem blender cb s%d, f%d, domainid:%d \n", status,frame, settings->domainId ); // DEBUG
- int state = 0;
- if(status==FLUIDSIM_CBSTATUS_NEWFRAME) {
- BLI_lock_thread(LOCK_CUSTOM1);
- globalBakeFrame = frame-1;
- BLI_unlock_thread(LOCK_CUSTOM1);
- }
-
- //if((frameCounter==3) && (!frameStop)) { frameStop=1; return 1; }
-
- BLI_lock_thread(LOCK_CUSTOM1);
- state = globalBakeState;
- BLI_unlock_thread(LOCK_CUSTOM1);
-
- if(state!=0) {
- return FLUIDSIM_CBRET_ABORT;
- }
-
- return FLUIDSIM_CBRET_CONTINUE;
-}
-
-
-/* ******************************************************************************** */
-/* ********************** write fluidsim config to file ************************* */
-/* ******************************************************************************** */
-
-void fluidsimBake(struct Object *ob)
-{
- FILE *fileCfg;
- int i;
- struct Object *fsDomain = NULL;
- FluidsimSettings *domainSettings;
- struct Object *obit = NULL; /* object iterator */
- Base *base;
- int origFrame = G.scene->r.cfra;
- char debugStrBuffer[256];
- int dirExist = 0;
- int gridlevels = 0;
- int simAborted = 0; // was the simulation aborted by user?
- int doExportOnly = 0;
- char *exportEnvStr = "BLENDER_ELBEEMEXPORTONLY";
- const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp
- //char *channelNames[3] = { "translation","rotation","scale" };
-
- char *suffixConfig = "fluidsim.cfg";
- char *suffixSurface = "fluidsurface";
- char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings
- char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings
- char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access
- int outStringsChanged = 0; // modified? copy back before baking
- int haveSomeFluid = 0; // check if any fluid objects are set
-
- // config vars, inited before either export or run...
- double calcViscosity = 0.0;
- int noFrames;
- double aniFrameTime;
- float aniFrlen;
- int channelObjCount;
- float *bbStart = NULL;
- float *bbSize = NULL;
- float domainMat[4][4];
- float invDomMat[4][4];
- // channel data
- int allchannelSize; // fixed by no. of frames
- int startFrame = 1; // dont use G.scene->r.sfra here, always start with frame 1
- // easy frame -> sim time calc
- float *timeAtFrame=NULL, *timeAtIndex=NULL;
- // domain
- float *channelDomainTime = NULL;
- float *channelDomainViscosity = NULL;
- float *channelDomainGravity = NULL;
- // objects (currently max. 256 objs)
- float *channelObjMove[256][3]; // object movments , 0=trans, 1=rot, 2=scale
- float *channelObjInivel[256]; // initial velocities
- float *channelObjActive[256]; // obj active channel
-
- /* fluid control channels */
- float *channelAttractforceStrength[256];
- float *channelAttractforceRadius[256];
- float *channelVelocityforceStrength[256];
- float *channelVelocityforceRadius[256];
- FluidsimModifierData *fluidmd = NULL;
- Mesh *mesh = NULL;
-
- if(getenv(strEnvName)) {
- int dlevel = atoi(getenv(strEnvName));
- elbeemSetDebugLevel(dlevel);
- snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
- elbeemDebugOut(debugStrBuffer);
- }
- if(getenv(exportEnvStr)) {
- doExportOnly = atoi(getenv(exportEnvStr));
- snprintf(debugStrBuffer,256,"fluidsimBake::msg: Exporting mode set to '%d' due to envvar '%s'\n",doExportOnly, exportEnvStr);
- elbeemDebugOut(debugStrBuffer);
- }
-
- // make sure it corresponds to startFrame setting
- // old: noFrames = G.scene->r.efra - G.scene->r.sfra +1;
- noFrames = G.scene->r.efra - 0;
- if(noFrames<=0) {
- pupmenu("Fluidsim Bake Error%t|No frames to export - check your animation range settings. Aborted%x0");
- return;
- }
-
- /* no object pointer, find in selected ones.. */
- if(!ob) {
- for(base=G.scene->base.first; base; base= base->next) {
- if ((base)->flag & SELECT)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
-
- if(fluidmdtmp && (base->object->type==OB_MESH))
- {
- if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN)
- {
- ob = base->object;
- break;
- }
- }
- }
- }
- // no domains found?
- if(!ob) return;
- }
-
- channelObjCount = 0;
- for(base=G.scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE) )
- {
- channelObjCount++;
- }
- }
-
- if (channelObjCount>=255) {
- pupmenu("Fluidsim Bake Error%t|Cannot bake with more then 256 objects");
- return;
- }
-
- /* check if there's another domain... */
- for(base=G.scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&(obit->type==OB_MESH))
- {
- if(fluidmdtmp->fss->type == OB_FLUIDSIM_DOMAIN)
- {
- if(obit != ob)
- {
- pupmenu("Fluidsim Bake Error%t|There should be only one domain object! Aborted%x0");
- return;
- }
- }
- }
- }
-
- // check if theres any fluid
- // abort baking if not...
- for(base=G.scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- ((fluidmdtmp->fss->type == OB_FLUIDSIM_FLUID) ||
- (fluidmdtmp->fss->type == OB_FLUIDSIM_INFLOW) ))
- {
- haveSomeFluid = 1;
- break;
- }
- }
- if(!haveSomeFluid) {
- pupmenu("Fluidsim Bake Error%t|No fluid objects in scene... Aborted%x0");
- return;
- }
-
- /* these both have to be valid, otherwise we wouldnt be here */
- /* dont use ob here after...*/
- fsDomain = ob;
- fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- domainSettings = fluidmd->fss;
- ob = NULL;
- mesh = fsDomain->data;
-
- // calculate bounding box
- fluid_get_bb(mesh->mvert, mesh->totvert, fsDomain->obmat, domainSettings->bbStart, domainSettings->bbSize);
-
- // reset last valid frame
- domainSettings->lastgoodframe = -1;
-
- /* rough check of settings... */
- if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
- snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
- elbeemDebugOut(debugStrBuffer);
- domainSettings->previewresxyz = domainSettings->resolutionxyz;
- }
- // set adaptive coarsening according to resolutionxyz
- // this should do as an approximation, with in/outflow
- // doing this more accurate would be overkill
- // perhaps add manual setting?
- if(domainSettings->maxRefine <0) {
- if(domainSettings->resolutionxyz>128) {
- gridlevels = 2;
- } else
- if(domainSettings->resolutionxyz>64) {
- gridlevels = 1;
- } else {
- gridlevels = 0;
- }
- } else {
- gridlevels = domainSettings->maxRefine;
- }
- snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
- elbeemDebugOut(debugStrBuffer);
-
- // prepare names...
- strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR);
- strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR);
- BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no
-
- strcpy(targetFile, targetDir);
- strcat(targetFile, suffixConfig);
- if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file
- // make sure all directories exist
- // as the bobjs use the same dir, this only needs to be checked
- // for the cfg output
- BLI_make_existing_file(targetFile);
-
- // check selected directory
- // simply try to open cfg file for writing to test validity of settings
- fileCfg = fopen(targetFile, "w");
- if(fileCfg) {
- dirExist = 1; fclose(fileCfg);
- // remove cfg dummy from directory test
- if(!doExportOnly) { BLI_delete(targetFile, 0,0); }
- }
-
- if((strlen(targetDir)<1) || (!dirExist)) {
- char blendDir[FILE_MAXDIR+FILE_MAXFILE], blendFile[FILE_MAXDIR+FILE_MAXFILE];
- // invalid dir, reset to current/previous
- strcpy(blendDir, G.sce);
- BLI_splitdirstring(blendDir, blendFile);
- if(strlen(blendFile)>6){
- int len = strlen(blendFile);
- if( (blendFile[len-6]=='.')&& (blendFile[len-5]=='b')&& (blendFile[len-4]=='l')&&
- (blendFile[len-3]=='e')&& (blendFile[len-2]=='n')&& (blendFile[len-1]=='d') ){
- blendFile[len-6] = '\0';
- }
- }
- // todo... strip .blend ?
- snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
-
- snprintf(debugStrBuffer,256,"fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
- elbeemDebugOut(debugStrBuffer);
- outStringsChanged=1;
- }
-
- // check if modified output dir is ok
- if(outStringsChanged) {
- char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256];
- int selection=0;
- strcpy(dispmsg,"Output settings set to: '");
- strcat(dispmsg, newSurfdataPath);
- strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0");
-
- // ask user if thats what he/she wants...
- selection = pupmenu(dispmsg);
- if(selection<1) return; // 0 from menu, or -1 aborted
- strcpy(targetDir, newSurfdataPath);
- strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR);
- BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no
- }
-
- // --------------------------------------------------------------------------------------------
- // dump data for start frame
- // CHECK more reasonable to number frames according to blender?
- // dump data for frame 0
- G.scene->r.cfra = startFrame;
- scene_update_for_newframe(G.scene, G.scene->lay);
-
- // init common export vars for both file export and run
- for(i=0; i<256; i++) {
- channelObjMove[i][0] = channelObjMove[i][1] = channelObjMove[i][2] = NULL;
- channelObjInivel[i] = NULL;
- channelObjActive[i] = NULL;
- channelAttractforceStrength[i] = NULL;
- channelAttractforceRadius[i] = NULL;
- channelVelocityforceStrength[i] = NULL;
- channelVelocityforceRadius[i] = NULL;
- }
- allchannelSize = G.scene->r.efra; // always use till last frame
- aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames;
- // blender specific - scale according to map old/new settings in anim panel:
- aniFrlen = G.scene->r.framelen;
- if(domainSettings->viscosityMode==1) {
- /* manual mode, visc=value/(10^-vexp) */
- calcViscosity = (1.0/pow(10.0,domainSettings->viscosityExponent)) * domainSettings->viscosityValue;
- } else {
- calcViscosity = fluidsimViscosityPreset[ domainSettings->viscosityMode ];
- }
-
- bbStart = domainSettings->bbStart;
- bbSize = domainSettings->bbSize;
-
- // always init
- { int timeIcu[1] = { FLUIDSIM_TIME };
- float timeDef[1] = { 1. };
- int gravIcu[3] = { FLUIDSIM_GRAV_X, FLUIDSIM_GRAV_Y, FLUIDSIM_GRAV_Z };
- float gravDef[3];
- int viscIcu[1] = { FLUIDSIM_VISC };
- float viscDef[1] = { 1. };
-
- gravDef[0] = domainSettings->gravx;
- gravDef[1] = domainSettings->gravy;
- gravDef[2] = domainSettings->gravz;
-
- // time channel is a bit special, init by hand...
- timeAtIndex = MEM_callocN( (allchannelSize+1)*1*sizeof(float), "fluidsiminit_timeatindex");
- for(i=0; i<=G.scene->r.efra; i++) {
- timeAtIndex[i] = (float)(i-startFrame);
- }
- fluidsimInitChannel( &channelDomainTime, allchannelSize, timeAtIndex, timeIcu,timeDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB
- // time channel is a multiplicator for aniFrameTime
- if(channelDomainTime) {
- for(i=0; i<allchannelSize; i++) {
- channelDomainTime[i*2+0] = aniFrameTime * channelDomainTime[i*2+0];
- if(channelDomainTime[i*2+0]<0.) channelDomainTime[i*2+0] = 0.;
- }
- }
- timeAtFrame = MEM_callocN( (allchannelSize+1)*1*sizeof(float), "fluidsiminit_timeatframe");
- timeAtFrame[0] = timeAtFrame[1] = domainSettings->animStart; // start at index 1
- if(channelDomainTime) {
- for(i=2; i<=allchannelSize; i++) {
- timeAtFrame[i] = timeAtFrame[i-1]+channelDomainTime[(i-1)*2+0];
- }
- } else {
- for(i=2; i<=allchannelSize; i++) { timeAtFrame[i] = timeAtFrame[i-1]+aniFrameTime; }
- }
-
- fluidsimInitChannel( &channelDomainViscosity, allchannelSize, timeAtFrame, viscIcu,viscDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB
- if(channelDomainViscosity) {
- for(i=0; i<allchannelSize; i++) { channelDomainViscosity[i*2+0] = calcViscosity * channelDomainViscosity[i*2+0]; }
- }
- fluidsimInitChannel( &channelDomainGravity, allchannelSize, timeAtFrame, gravIcu,gravDef, domainSettings->ipo, CHANNEL_VEC );
- } // domain channel init
-
- // init obj movement channels
- channelObjCount=0;
- for(base=G.scene->base.first; base; base= base->next)
- {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
-
- if( fluidmdtmp &&
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE) ) {
-
- // cant use fluidsimInitChannel for obj channels right now, due
- // to the special DXXX channels, and the rotation specialities
- IpoCurve *icuex[3][3];
- //IpoCurve *par_icuex[3][3];
- int icuIds[3][3] = {
- {OB_LOC_X, OB_LOC_Y, OB_LOC_Z},
- {OB_ROT_X, OB_ROT_Y, OB_ROT_Z},
- {OB_SIZE_X, OB_SIZE_Y, OB_SIZE_Z}
- };
- // relative ipos
- IpoCurve *icudex[3][3];
- //IpoCurve *par_icudex[3][3];
- int icudIds[3][3] = {
- {OB_DLOC_X, OB_DLOC_Y, OB_DLOC_Z},
- {OB_DROT_X, OB_DROT_Y, OB_DROT_Z},
- {OB_DSIZE_X, OB_DSIZE_Y, OB_DSIZE_Z}
- };
- int j,k;
- float vals[3] = {0.0,0.0,0.0};
- int o = channelObjCount;
- int inivelIcu[3] = { FLUIDSIM_VEL_X, FLUIDSIM_VEL_Y, FLUIDSIM_VEL_Z };
- float inivelDefs[3];
- int activeIcu[1] = { FLUIDSIM_ACTIVE };
- float activeDefs[1] = { 1 }; // default to on
-
- inivelDefs[0] = fluidmdtmp->fss->iniVelx;
- inivelDefs[1] = fluidmdtmp->fss->iniVely;
- inivelDefs[2] = fluidmdtmp->fss->iniVelz;
-
- // check & init loc,rot,size
- for(j=0; j<3; j++) {
- for(k=0; k<3; k++) {
- icuex[j][k] = find_ipocurve(obit->ipo, icuIds[j][k] );
- icudex[j][k] = find_ipocurve(obit->ipo, icudIds[j][k] );
- //if(obit->parent) {
- //par_icuex[j][k] = find_ipocurve(obit->parent->ipo, icuIds[j][k] );
- //par_icudex[j][k] = find_ipocurve(obit->parent->ipo, icudIds[j][k] );
- //}
- }
- }
-
- for(j=0; j<3; j++) {
- channelObjMove[o][j] = MEM_callocN( allchannelSize*4*sizeof(float), "fluidsiminit_objmovchannel");
- for(i=1; i<=allchannelSize; i++) {
-
- for(k=0; k<3; k++) {
- if(icuex[j][k]) {
- // IPO exists, use it ...
- calc_icu(icuex[j][k], aniFrlen*((float)i) );
- vals[k] = icuex[j][k]->curval;
- if(obit->parent) {
- // add parent transform, multiply scaling, add trafo&rot
- //calc_icu(par_icuex[j][k], aniFrlen*((float)i) );
- //if(j==2) { vals[k] *= par_icuex[j][k]->curval; }
- //else { vals[k] += par_icuex[j][k]->curval; }
- }
- } else {
- // use defaults from static values
- float setval=0.0;
- if(j==0) {
- setval = obit->loc[k];
- if(obit->parent){ setval += obit->parent->loc[k]; }
- } else if(j==1) {
- setval = ( 180.0*obit->rot[k] )/( 10.0*M_PI );
- if(obit->parent){ setval = ( 180.0*(obit->rot[k]+obit->parent->rot[k]) )/( 10.0*M_PI ); }
- } else {
- setval = obit->size[k];
- if(obit->parent){ setval *= obit->parent->size[k]; }
- }
- vals[k] = setval;
- }
- if(icudex[j][k]) {
- calc_icu(icudex[j][k], aniFrlen*((float)i) );
- //vals[k] += icudex[j][k]->curval;
- // add transform, multiply scaling, add trafo&rot
- if(j==2) { vals[k] *= icudex[j][k]->curval; }
- else { vals[k] += icudex[j][k]->curval; }
- if(obit->parent) {
- // add parent transform, multiply scaling, add trafo&rot
- //calc_icu(par_icuex[j][k], aniFrlen*((float)i) );
- //if(j==2) { vals[k] *= par_icudex[j][k]->curval; }
- //else { vals[k] += par_icudex[j][k]->curval; }
- }
- }
- } // k
-
- for(k=0; k<3; k++) {
- float set = vals[k];
- if(j==1) { // rot is downscaled by 10 for ipo !?
- set = 360.0 - (10.0*set);
- }
- channelObjMove[o][j][(i-1)*4 + k] = set;
- } // k
- channelObjMove[o][j][(i-1)*4 + 3] = timeAtFrame[i];
- }
- }
-
- {
- int attrFSIcu[1] = { FLUIDSIM_ATTR_FORCE_STR };
- int attrFRIcu[1] = { FLUIDSIM_ATTR_FORCE_RADIUS };
- int velFSIcu[1] = { FLUIDSIM_VEL_FORCE_STR };
- int velFRIcu[1] = { FLUIDSIM_VEL_FORCE_RADIUS };
-
- float attrFSDefs[1];
- float attrFRDefs[1];
- float velFSDefs[1];
- float velFRDefs[1];
-
- attrFSDefs[0] = fluidmdtmp->fss->attractforceStrength;
- attrFRDefs[0] = fluidmdtmp->fss->attractforceRadius;
- velFSDefs[0] = fluidmdtmp->fss->velocityforceStrength;
- velFRDefs[0] = fluidmdtmp->fss->velocityforceRadius;
-
- fluidsimInitChannel( &channelAttractforceStrength[o], allchannelSize, timeAtFrame, attrFSIcu,attrFSDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel( &channelAttractforceRadius[o], allchannelSize, timeAtFrame, attrFRIcu,attrFRDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel( &channelVelocityforceStrength[o], allchannelSize, timeAtFrame, velFSIcu,velFSDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- fluidsimInitChannel( &channelVelocityforceRadius[o], allchannelSize, timeAtFrame, velFRIcu,velFRDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
- }
-
- fluidsimInitChannel( &channelObjInivel[o], allchannelSize, timeAtFrame, inivelIcu,inivelDefs, fluidmdtmp->fss->ipo, CHANNEL_VEC );
- fluidsimInitChannel( &channelObjActive[o], allchannelSize, timeAtFrame, activeIcu,activeDefs, fluidmdtmp->fss->ipo, CHANNEL_FLOAT );
-
-
- channelObjCount++;
-
- }
- }
-
- // init trafo matrix
- MTC_Mat4CpyMat4(domainMat, fsDomain->obmat);
- if(!Mat4Invert(invDomMat, domainMat)) {
- snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n");
- elbeemDebugOut(debugStrBuffer);
- // FIXME add fatal msg
- FS_FREE_CHANNELS;
- return;
- }
-
-
- // --------------------------------------------------------------------------------------------
- // start writing / exporting
- strcpy(targetFile, targetDir);
- strcat(targetFile, suffixConfig);
- if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file
- // make sure these directories exist as well
- if(outStringsChanged) {
- BLI_make_existing_file(targetFile);
- }
-
- if(!doExportOnly) {
- ListBase threads;
-
- // perform simulation with El'Beem api and threads
- elbeemSimulationSettings fsset;
- elbeemResetSettings(&fsset);
- fsset.version = 1;
-
- // setup global settings
- for(i=0 ; i<3; i++) fsset.geoStart[i] = bbStart[i];
- for(i=0 ; i<3; i++) fsset.geoSize[i] = bbSize[i];
-
- // simulate with 50^3
- fsset.resolutionxyz = (int)domainSettings->resolutionxyz;
- fsset.previewresxyz = (int)domainSettings->previewresxyz;
- // 10cm water domain
- fsset.realsize = domainSettings->realsize;
- fsset.viscosity = calcViscosity;
- // earth gravity
- fsset.gravity[0] = domainSettings->gravx;
- fsset.gravity[1] = domainSettings->gravy;
- fsset.gravity[2] = domainSettings->gravz;
- // simulate 5 frames, each 0.03 seconds, output to ./apitest_XXX.bobj.gz
- fsset.animStart = domainSettings->animStart;
- fsset.aniFrameTime = aniFrameTime;
- fsset.noOfFrames = noFrames; // is otherwise subtracted in parser
- strcpy(targetFile, targetDir);
- strcat(targetFile, suffixSurface);
- // defaults for compressibility and adaptive grids
- fsset.gstar = domainSettings->gstar;
- fsset.maxRefine = domainSettings->maxRefine; // check <-> gridlevels
- fsset.generateParticles = domainSettings->generateParticles;
- fsset.numTracerParticles = domainSettings->generateTracers;
- fsset.surfaceSmoothing = domainSettings->surfaceSmoothing;
- fsset.surfaceSubdivs = domainSettings->surfaceSubdivs;
- fsset.farFieldSize = domainSettings->farFieldSize;
- strcpy( fsset.outputPath, targetFile);
-
- // domain channels
- fsset.channelSizeFrameTime =
- fsset.channelSizeViscosity =
- fsset.channelSizeGravity = allchannelSize;
- fsset.channelFrameTime = channelDomainTime;
- fsset.channelViscosity = channelDomainViscosity;
- fsset.channelGravity = channelDomainGravity;
-
- fsset.runsimCallback = &runSimulationCallback;
- fsset.runsimUserData = &fsset;
-
- if( (domainSettings->typeFlags&OB_FSBND_NOSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_NOSLIP;
- else if((domainSettings->typeFlags&OB_FSBND_PARTSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_PARTSLIP;
- else if((domainSettings->typeFlags&OB_FSBND_FREESLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_FREESLIP;
- fsset.domainobsPartslip = domainSettings->partSlipValue;
- fsset.generateVertexVectors = (domainSettings->domainNovecgen==0);
-
- // init blender trafo matrix
- // fprintf(stderr,"elbeemInit - mpTrafo:\n");
- { int j;
- for(i=0; i<4; i++) {
- for(j=0; j<4; j++) {
- fsset.surfaceTrafo[i*4+j] = invDomMat[j][i];
- // fprintf(stderr,"elbeemInit - mpTrafo %d %d = %f (%d) \n", i,j, fsset.surfaceTrafo[i*4+j] , (i*4+j) );
- }
- } }
-
- // init solver with settings
- elbeemInit();
- elbeemAddDomain(&fsset);
-
- // init objects
- channelObjCount = 0;
- for(base=G.scene->base.first; base; base= base->next) {
- FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(base->object, eModifierType_Fluidsim);
- obit = base->object;
- //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG
- if( fluidmdtmp && // if has to match 3 places! // CHECKMATCH
- (obit->type==OB_MESH) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN) &&
- (fluidmdtmp->fss->type != OB_FLUIDSIM_PARTICLE))
- {
- float *verts=NULL;
- int *tris=NULL;
- int numVerts=0, numTris=0;
- int o = channelObjCount;
- int deform = (fluidmdtmp->fss->domainNovecgen); // misused value
- // todo - use blenderInitElbeemMesh
- int modifierIndex = modifiers_indexInObject(obit, (ModifierData *)fluidmdtmp);
-
- elbeemMesh fsmesh;
- elbeemResetMesh( &fsmesh );
- fsmesh.type = fluidmdtmp->fss->type;
- // get name of object for debugging solver
- fsmesh.name = obit->id.name;
-
- initElbeemMesh(obit, &numVerts, &verts, &numTris, &tris, 0, modifierIndex);
- fsmesh.numVertices = numVerts;
- fsmesh.numTriangles = numTris;
- fsmesh.vertices = verts;
- fsmesh.triangles = tris;
-
- fsmesh.channelSizeTranslation =
- fsmesh.channelSizeRotation =
- fsmesh.channelSizeScale =
- fsmesh.channelSizeInitialVel =
- fsmesh.channelSizeActive = allchannelSize;
-
- fsmesh.channelTranslation = channelObjMove[o][0];
- fsmesh.channelRotation = channelObjMove[o][1];
- fsmesh.channelScale = channelObjMove[o][2];
- fsmesh.channelActive = channelObjActive[o];
- if( (fsmesh.type == OB_FLUIDSIM_FLUID) ||
- (fsmesh.type == OB_FLUIDSIM_INFLOW)) {
- fsmesh.channelInitialVel = channelObjInivel[o];
- fsmesh.localInivelCoords = ((fluidmdtmp->fss->typeFlags&OB_FSINFLOW_LOCALCOORD)?1:0);
- }
-
- if( (fluidmdtmp->fss->typeFlags&OB_FSBND_NOSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP;
- else if((fluidmdtmp->fss->typeFlags&OB_FSBND_PARTSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_PARTSLIP;
- else if((fluidmdtmp->fss->typeFlags&OB_FSBND_FREESLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_FREESLIP;
- fsmesh.obstaclePartslip = fluidmdtmp->fss->partSlipValue;
- fsmesh.volumeInitType = fluidmdtmp->fss->volumeInitType;
- fsmesh.obstacleImpactFactor = fluidmdtmp->fss->surfaceSmoothing; // misused value
-
- if(fsmesh.type == OB_FLUIDSIM_CONTROL)
- {
- // control fluids will get exported as whole
- deform = 1;
-
- fsmesh.cpsTimeStart = fluidmdtmp->fss->cpsTimeStart;
- fsmesh.cpsTimeEnd = fluidmdtmp->fss->cpsTimeEnd;
- fsmesh.cpsQuality = fluidmdtmp->fss->cpsQuality;
- fsmesh.obstacleType = (fluidmdtmp->fss->flag & OB_FLUIDSIM_REVERSE);
-
- fsmesh.channelSizeAttractforceRadius =
- fsmesh.channelSizeVelocityforceStrength =
- fsmesh.channelSizeVelocityforceRadius =
- fsmesh.channelSizeAttractforceStrength = allchannelSize;
-
- fsmesh.channelAttractforceStrength = channelAttractforceStrength[o];
- fsmesh.channelAttractforceRadius = channelAttractforceRadius[o];
- fsmesh.channelVelocityforceStrength = channelVelocityforceStrength[o];
- fsmesh.channelVelocityforceRadius = channelVelocityforceRadius[o];
- }
- else
- {
- // set channels to 0
- fsmesh.channelAttractforceStrength =
- fsmesh.channelAttractforceRadius =
- fsmesh.channelVelocityforceStrength =
- fsmesh.channelVelocityforceRadius = NULL;
- }
-
- // animated meshes
- if(deform) {
- fsmesh.channelSizeVertices = allchannelSize;
- fluidsimInitMeshChannel( &fsmesh.channelVertices, allchannelSize, obit, numVerts, timeAtFrame, modifierIndex);
- G.scene->r.cfra = startFrame;
- scene_update_for_newframe(G.scene, G.scene->lay);
- // remove channels
- fsmesh.channelTranslation =
- fsmesh.channelRotation =
- fsmesh.channelScale = NULL;
- }
-
- elbeemAddMesh(&fsmesh);
-
- if(verts) MEM_freeN(verts);
- if(tris) MEM_freeN(tris);
- if(fsmesh.channelVertices) MEM_freeN(fsmesh.channelVertices);
- channelObjCount++;
- } // valid mesh
- } // objects
- //domainSettings->type = OB_FLUIDSIM_DOMAIN; // enable for bake display again
- //fsDomain->fluidsimFlag = OB_FLUIDSIM_ENABLE; // disable during bake
-
- // set to neutral, -1 means user abort, -2 means init error
- globalBakeState = 0;
- globalBakeFrame = 0;
- BLI_init_threads(&threads, fluidsimSimulateThread, 1);
- BLI_insert_thread(&threads, targetFile);
-
- {
- int done = 0;
- unsigned short event=0;
- short val;
- float noFramesf = (float)noFrames;
- float percentdone = 0.0;
- int lastRedraw = -1;
-
- g_break= 0;
- G.afbreek= 0; /* blender_test_break uses this global */
-
- start_progress_bar();
-
- while(done==0) {
- char busy_mess[80];
-
- waitcursor(1);
-
- // lukep we add progress bar as an interim mesure
- percentdone = globalBakeFrame / noFramesf;
- sprintf(busy_mess, "baking fluids %d / %d |||", globalBakeFrame, (int) noFramesf);
- progress_bar(percentdone, busy_mess );
-
- // longer delay to prevent frequent redrawing
- PIL_sleep_ms(2000);
-
- BLI_lock_thread(LOCK_CUSTOM1);
- if(globalBakeState != 0) done = 1; // 1=ok, <0=error/abort
- BLI_unlock_thread(LOCK_CUSTOM1);
-
- if (!G.background) {
- g_break= blender_test_break();
-
- if(g_break)
- {
- // abort...
- BLI_lock_thread(LOCK_CUSTOM1);
-
- if(domainSettings)
- domainSettings->lastgoodframe = startFrame+globalBakeFrame;
-
- done = -1;
- globalBakeFrame = 0;
- globalBakeState = -1;
- simAborted = 1;
- BLI_unlock_thread(LOCK_CUSTOM1);
- break;
- }
- }
-
- // redraw the 3D for showing progress once in a while...
- if(lastRedraw!=globalBakeFrame) {
- ScrArea *sa;
- G.scene->r.cfra = startFrame+globalBakeFrame;
- lastRedraw = globalBakeFrame;
- update_for_newframe_muted();
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype == SPACE_VIEW3D) { scrarea_do_windraw(sa); }
- sa= sa->next;
- }
- screen_swapbuffers();
- } // redraw
- }
- end_progress_bar();
- }
- BLI_end_threads(&threads);
- } // El'Beem API init, thread creation
- // --------------------------------------------------------------------------------------------
- else
- { // write config file to be run with command line simulator
- pupmenu("Fluidsim Bake Message%t|Config file export not supported.%x0");
- } // config file export done!
-
- // --------------------------------------------------------------------------------------------
- FS_FREE_CHANNELS;
-
- // go back to "current" blender time
- waitcursor(0);
-
- if(globalBakeState >= 0)
- {
- if(domainSettings)
- domainSettings->lastgoodframe = startFrame+globalBakeFrame;
- }
-
- G.scene->r.cfra = origFrame;
- scene_update_for_newframe(G.scene, G.scene->lay);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-
- if(!simAborted) {
- char fsmessage[512];
- char elbeemerr[256];
- strcpy(fsmessage,"Fluidsim Bake Error: ");
- // check if some error occurred
- if(globalBakeState==-2) {
- strcat(fsmessage,"Failed to initialize [Msg: ");
-
- elbeemGetErrorString(elbeemerr);
- strcat(fsmessage,elbeemerr);
-
- strcat(fsmessage,"] |OK%x0");
- pupmenu(fsmessage);
- } // init error
- }
-
- // elbeemFree();
-}
-
-void fluidsimFreeBake(struct Object *ob)
-{
- /* not implemented yet */
-}
-
-
-#else /* DISABLE_ELBEEM */
-
-/* compile dummy functions for disabled fluid sim */
-
-FluidsimSettings *fluidsimSettingsNew(struct Object *srcob) {
- return NULL;
-}
-
-void fluidsimSettingsFree(FluidsimSettings *fss) {
-}
-
-FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) {
- return NULL;
-}
-
-/* only compile dummy functions */
-void fluidsimBake(struct Object *ob) {
-}
-
-void fluidsimFreeBake(struct Object *ob) {
-}
-
-#endif /* DISABLE_ELBEEM */
-
diff --git a/source/blender/src/fsmenu.c b/source/blender/src/fsmenu.c
deleted file mode 100644
index fc98c054478..00000000000
--- a/source/blender/src/fsmenu.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_linklist.h"
-#include "BLI_dynstr.h"
-#include "BIF_usiblender.h"
-
-
-#include "BIF_fsmenu.h" /* include ourselves */
-
-
-/* FSMENU HANDLING */
-
- /* FSMenuEntry's without paths indicate seperators */
-typedef struct _FSMenuEntry FSMenuEntry;
-struct _FSMenuEntry {
- FSMenuEntry *next;
-
- char *path;
- short save;
-};
-
-static FSMenuEntry *fsmenu= 0;
-
-int fsmenu_get_nentries(void)
-{
- FSMenuEntry *fsme;
- int count= 0;
-
- for (fsme= fsmenu; fsme; fsme= fsme->next)
- count++;
-
- return count;
-}
-int fsmenu_is_entry_a_seperator(int idx)
-{
- FSMenuEntry *fsme;
-
- for (fsme= fsmenu; fsme && idx; fsme= fsme->next)
- idx--;
-
- return (fsme && !fsme->path)?1:0;
-}
-char *fsmenu_get_entry(int idx)
-{
- FSMenuEntry *fsme;
-
- for (fsme= fsmenu; fsme && idx; fsme= fsme->next)
- idx--;
-
- return fsme?fsme->path:NULL;
-}
-char *fsmenu_build_menu(void)
-{
- DynStr *ds= BLI_dynstr_new();
- FSMenuEntry *fsme;
- char *menustr;
-
- for (fsme= fsmenu; fsme; fsme= fsme->next) {
- if (!fsme->path) {
- /* clean consecutive seperators and ignore trailing ones */
- if (fsme->next) {
- if (fsme->next->path) {
- BLI_dynstr_append(ds, "%l|");
- } else {
- FSMenuEntry *next= fsme->next;
- fsme->next= next->next;
- MEM_freeN(next);
- }
- }
- } else {
- if (fsme->save) {
- BLI_dynstr_append(ds, "o ");
- } else {
- BLI_dynstr_append(ds, " ");
- }
- BLI_dynstr_append(ds, fsme->path);
- if (fsme->next) BLI_dynstr_append(ds, "|");
- }
- }
-
- menustr= BLI_dynstr_get_cstring(ds);
- BLI_dynstr_free(ds);
- return menustr;
-}
-static FSMenuEntry *fsmenu_get_last_separator(void)
-{
- FSMenuEntry *fsme, *lsep=NULL;
-
- for (fsme= fsmenu; fsme; fsme= fsme->next)
- if (!fsme->path)
- lsep= fsme;
-
- return lsep;
-}
-
-static FSMenuEntry *fsmenu_get_first_separator(void)
-{
- FSMenuEntry *fsme, *lsep=NULL;
-
- for (fsme= fsmenu; fsme; fsme= fsme->next)
- if (!fsme->path) {
- lsep= fsme;
- break;
- }
-
- return lsep;
-}
-
-void fsmenu_insert_entry(char *path, int sorted, short save)
-{
- FSMenuEntry *prev;
- FSMenuEntry *fsme;
-
- if (save) {
- prev = fsmenu_get_first_separator();
- } else {
- prev = fsmenu_get_last_separator();
- }
- fsme= prev?prev->next:fsmenu;
-
- for (; fsme; prev= fsme, fsme= fsme->next) {
- if (fsme->path) {
- if (BLI_streq(path, fsme->path)) {
- return;
- } else if (sorted && strcmp(path, fsme->path)<0) {
- break;
- }
- } else {
- // if we're bookmarking this, file should come
- // before the last separator, only automatically added
- // current dir go after the last sep.
- if (save) {
- break;
- }
- }
- }
-
- fsme= MEM_mallocN(sizeof(*fsme), "fsme");
- fsme->path= BLI_strdup(path);
- fsme->save = save;
-
- if (prev) {
- fsme->next= prev->next;
- prev->next= fsme;
- } else {
- fsme->next= fsmenu;
- fsmenu= fsme;
- }
-}
-void fsmenu_append_separator(void)
-{
- if (fsmenu) {
- FSMenuEntry *fsme= fsmenu;
-
- while (fsme->next) fsme= fsme->next;
-
- fsme->next= MEM_mallocN(sizeof(*fsme), "fsme");
- fsme->next->next= NULL;
- fsme->next->path= NULL;
- }
-}
-void fsmenu_remove_entry(int idx)
-{
- FSMenuEntry *prev= NULL, *fsme= fsmenu;
-
- for (fsme= fsmenu; fsme && idx; prev= fsme, fsme= fsme->next)
- idx--;
-
- if (fsme) {
- /* you should only be able to remove entries that were
- not added by default, like windows drives.
- also separators (where path == NULL) shouldn't be removed */
- if (fsme->save && fsme->path) {
-
- /* remove fsme from list */
- if (prev) {
- prev->next= fsme->next;
- } else {
- fsmenu= fsme->next;
- }
- /* free entry */
- MEM_freeN(fsme->path);
- MEM_freeN(fsme);
- }
- }
-}
-
-void fsmenu_write_file(const char *filename)
-{
- FSMenuEntry *fsme= fsmenu;
-
- FILE *fp = fopen(filename, "w");
- if (!fp) return;
-
- for (fsme= fsmenu; fsme; fsme= fsme->next) {
- if (fsme->path && fsme->save) {
- fprintf(fp, "%s\n", fsme->path);
- }
- }
- fclose(fp);
-}
-
-void fsmenu_free(void)
-{
- FSMenuEntry *fsme= fsmenu;
-
- while (fsme) {
- FSMenuEntry *n= fsme->next;
-
- if (fsme->path) MEM_freeN(fsme->path);
- MEM_freeN(fsme);
-
- fsme= n;
- }
-}
-
-
-
diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c
deleted file mode 100644
index 9388ac93543..00000000000
--- a/source/blender/src/ghostwinlay.c
+++ /dev/null
@@ -1,1004 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_userdef_types.h" /* U.flag & TWOBUTTONMOUSE */
-
-#include "BLI_blenlib.h"
-
-#include "GHOST_C-api.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_usiblender.h"
-#include "BIF_cursors.h"
-
-#include "PIL_dynlib.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "winlay.h"
-
-#include <math.h>
-
-
-#ifdef __APPLE__
-#include <OpenGL/OpenGL.h>
-#define __CARBONSOUND__
- /* XXX BIG WARNING: carbon.h should not be included in blender/src code, it conflicts with struct ID */
-#define ID ID_
-#include <Carbon/Carbon.h>
-
-/*declarations*/
-int checkAppleVideoCard(void);
-void getMacAvailableBounds(short *, short *, short *, short *);
-
-#endif
-///
-
-struct _Window {
- GHOST_WindowHandle ghostwin;
-
- /* Handler and private data for handler */
- WindowHandlerFP handler;
- void *user_data;
-
- /* Window state */
- int size[2], position[2];
- int active, visible;
-
- /* Last known mouse/button/qualifier state */
- int lmouse[2];
- int lqual; /* (LR_SHFTKEY, LR_CTRLKEY, LR_ALTKEY, LR_COMMANDKEY) */
- int lmbut; /* (L_MOUSE, M_MOUSE, R_MOUSE) */
-
- /* xtilt and ytilt represent how much the pen is tilted away from
- * vertically upright in either the X or Y direction, with X and Y the
- * axes of the tablet surface.
- * In other words, Xtilt and Ytilt are components of a vector created by projecting
- * the pen's angle in 3D space vertically downwards on to the XY plane
- * --Matt
- */
- float pressure; /* tablet pressure - 0.0 (no pressure) to 1.0 (full pressure) */
- /* mouse clicks and non-contacting stylus buttons generate pressure of 0.0. */
- float xtilt, ytilt; /* tablet tilt value - x and y components of 3D angle
- * ranging from 0.0 (pen upright) to 1.0 (pen fully leaning over) */
- short activedevice; /* Active input device currently in use (DEV_MOUSE, DEV_STYLUS, DEV_ERASER) */
-
-
- /* Tracks the faked mouse button, if non-zero it is
- * the event number of the last faked button.
- */
- int faked_mbut;
-
- /* Last known ndof device state
- * note that the ghost device manager
- * can handle any number of devices, but ghostwinlay can't
- */
- float ndof[7]; /* tx, ty, tz, rx, ry, rz, dt */
-
- GHOST_TimerTaskHandle timer;
- int timer_event;
-};
-
-///
-
-#ifdef __APPLE__
-
-/* to avoid killing small end comps, we want to allow
- blender to start maximised if all the followings are true :
- - Renderer is OpenGL capable
- - Hardware acceleration
- - VRAM > 16 Mo
-
- we will bail out if VRAM is less than 8Mo
- */
-
-static int macPrefState = 0;
-
-int checkAppleVideoCard(void) {
- long theErr;
- unsigned long display_mask;
- CGLRendererInfoObj rend;
- long nrend;
- int j;
- long value;
- long maxvram = 0; /* we get always more than 1 renderer, check one, at least, has 8 Mo */
-
- display_mask = CGDisplayIDToOpenGLDisplayMask (CGMainDisplayID() );
-
- theErr = CGLQueryRendererInfo( display_mask, &rend, &nrend);
- if (theErr == 0) {
- theErr = CGLDescribeRenderer (rend, 0, kCGLRPRendererCount, &nrend);
- if (theErr == 0) {
- for (j = 0; j < nrend; j++) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value);
- if (value > maxvram)
- maxvram = value;
- if ((theErr == 0) && (value >= 20000000)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value);
- if ((theErr == 0) && (value != 0)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value);
- if ((theErr == 0) && (value != 0)) {
- /*fprintf(stderr,"make it big\n");*/
- CGLDestroyRendererInfo (rend);
- macPrefState = 8;
- return 1;
- }
- }
- }
- }
- }
- }
- if (maxvram < 7500000 ) { /* put a standard alert and quit*/
- SInt16 junkHit;
- char inError[] = "* Not enough VRAM ";
- char inText[] = "* blender needs at least 8Mb ";
- inError[0] = 16;
- inText[0] = 28;
-
- fprintf(stderr, " vram is %li . not enough, aborting\n", maxvram);
- StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit);
- abort();
- }
- CGLDestroyRendererInfo (rend);
- return 0;
-}
-
-void getMacAvailableBounds(short *top, short *left, short *bottom, short *right) {
- Rect outAvailableRect;
-
- GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);
-
- *top = outAvailableRect.top;
- *left = outAvailableRect.left;
- *bottom = outAvailableRect.bottom;
- *right = outAvailableRect.right;
-}
-
-#endif
-
-
-static GHOST_SystemHandle g_system= 0;
-
- /* Some simple ghost <-> blender conversions */
-
-static GHOST_TStandardCursor convert_cursor(int curs) {
- switch(curs) {
- default:
- case CURSOR_STD: return GHOST_kStandardCursorDefault;
- case CURSOR_VPAINT: return GHOST_kStandardCursorRightArrow;
- case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
- case CURSOR_WAIT: return GHOST_kStandardCursorWait;
- case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
- case CURSOR_HELP: return GHOST_kStandardCursorHelp;
- case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
- case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
- case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
- }
-}
-
-static int convert_mbut(GHOST_TButtonMask but) {
- if (but == GHOST_kButtonMaskLeft) {
- return LEFTMOUSE;
- } else if (but == GHOST_kButtonMaskRight) {
- return RIGHTMOUSE;
- } else {
- return MIDDLEMOUSE;
- }
-}
-
-static int convert_key(GHOST_TKey key) {
- if (key>=GHOST_kKeyA && key<=GHOST_kKeyZ) {
- return (AKEY + ((int) key - GHOST_kKeyA));
- } else if (key>=GHOST_kKey0 && key<=GHOST_kKey9) {
- return (ZEROKEY + ((int) key - GHOST_kKey0));
- } else if (key>=GHOST_kKeyNumpad0 && key<=GHOST_kKeyNumpad9) {
- return (PAD0 + ((int) key - GHOST_kKeyNumpad0));
- } else if (key>=GHOST_kKeyF1 && key<=GHOST_kKeyF12) {
- return (F1KEY + ((int) key - GHOST_kKeyF1));
- } else {
- switch (key) {
- case GHOST_kKeyBackSpace: return BACKSPACEKEY;
- case GHOST_kKeyTab: return TABKEY;
- case GHOST_kKeyLinefeed: return LINEFEEDKEY;
- case GHOST_kKeyClear: return 0;
- case GHOST_kKeyEnter: return RETKEY;
-
- case GHOST_kKeyEsc: return ESCKEY;
- case GHOST_kKeySpace: return SPACEKEY;
- case GHOST_kKeyQuote: return QUOTEKEY;
- case GHOST_kKeyComma: return COMMAKEY;
- case GHOST_kKeyMinus: return MINUSKEY;
- case GHOST_kKeyPeriod: return PERIODKEY;
- case GHOST_kKeySlash: return SLASHKEY;
-
- case GHOST_kKeySemicolon: return SEMICOLONKEY;
- case GHOST_kKeyEqual: return EQUALKEY;
-
- case GHOST_kKeyLeftBracket: return LEFTBRACKETKEY;
- case GHOST_kKeyRightBracket: return RIGHTBRACKETKEY;
- case GHOST_kKeyBackslash: return BACKSLASHKEY;
- case GHOST_kKeyAccentGrave: return ACCENTGRAVEKEY;
-
- case GHOST_kKeyLeftShift: return LEFTSHIFTKEY;
- case GHOST_kKeyRightShift: return RIGHTSHIFTKEY;
- case GHOST_kKeyLeftControl: return LEFTCTRLKEY;
- case GHOST_kKeyRightControl: return RIGHTCTRLKEY;
- case GHOST_kKeyCommand: return COMMANDKEY;
- case GHOST_kKeyLeftAlt: return LEFTALTKEY;
- case GHOST_kKeyRightAlt: return RIGHTALTKEY;
-
- case GHOST_kKeyCapsLock: return CAPSLOCKKEY;
- case GHOST_kKeyNumLock: return 0;
- case GHOST_kKeyScrollLock: return 0;
-
- case GHOST_kKeyLeftArrow: return LEFTARROWKEY;
- case GHOST_kKeyRightArrow: return RIGHTARROWKEY;
- case GHOST_kKeyUpArrow: return UPARROWKEY;
- case GHOST_kKeyDownArrow: return DOWNARROWKEY;
-
- case GHOST_kKeyPrintScreen: return 0;
- case GHOST_kKeyPause: return PAUSEKEY;
-
- case GHOST_kKeyInsert: return INSERTKEY;
- case GHOST_kKeyDelete: return DELKEY;
- case GHOST_kKeyHome: return HOMEKEY;
- case GHOST_kKeyEnd: return ENDKEY;
- case GHOST_kKeyUpPage: return PAGEUPKEY;
- case GHOST_kKeyDownPage: return PAGEDOWNKEY;
-
- case GHOST_kKeyNumpadPeriod: return PADPERIOD;
- case GHOST_kKeyNumpadEnter: return PADENTER;
- case GHOST_kKeyNumpadPlus: return PADPLUSKEY;
- case GHOST_kKeyNumpadMinus: return PADMINUS;
- case GHOST_kKeyNumpadAsterisk: return PADASTERKEY;
- case GHOST_kKeyNumpadSlash: return PADSLASHKEY;
-
- case GHOST_kKeyGrLess: return GRLESSKEY;
-
- case GHOST_kKeyUnknown: return UNKNOWNKEY;
-
- default:
- return 0;
- }
- }
-}
-
- /***/
-
-
-static Window *window_new(GHOST_WindowHandle ghostwin)
-{
- Window *win= MEM_callocN(sizeof(*win), "Window");
- win->ghostwin= ghostwin;
-
- return win;
-}
-
-static void window_handle(Window *win, short event, short val)
-{
- if (win->handler) {
- win->handler(win, win->user_data, event, val, 0);
- }
-}
-
-static void window_handle_ext(Window *win, short event, short val, short extra)
-{
- if (win->handler) {
- win->handler(win, win->user_data, event, val, extra);
- }
-}
-
-static void window_free(Window *win)
-{
- MEM_freeN(win);
-}
-
- /***/
-
-static Window *active_gl_window= NULL;
-
-Window *window_open(char *title, int posx, int posy, int sizex, int sizey, int start_maximized)
-{
- GHOST_WindowHandle ghostwin;
- GHOST_TWindowState inital_state;
- int scr_w, scr_h;
- int i;
-
- winlay_get_screensize(&scr_w, &scr_h);
- posy= (scr_h-posy-sizey);
-
- if (start_maximized == G_WINDOWSTATE_FULLSCREEN)
- inital_state = start_maximized?GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal;
- else
- inital_state = start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal;
-#ifdef __APPLE__
- inital_state += macPrefState;
-#endif
-
- ghostwin= GHOST_CreateWindow(g_system,
- title,
- posx, posy, sizex, sizey,
- inital_state,
- GHOST_kDrawingContextTypeOpenGL,
- 0 /* no stereo */);
-
- if (ghostwin) {
- Window *win= window_new(ghostwin);
-
- if (win) {
- GHOST_SetWindowUserData(ghostwin, win);
-
- win->position[0]= posx;
- win->position[1]= posy;
- win->size[0]= sizex;
- win->size[1]= sizey;
-
- win->lmouse[0]= win->size[0]/2;
- win->lmouse[1]= win->size[1]/2;
-
- for (i = 0; i < 7; ++i)
- win->ndof[i] = 0;
-
-
- } else {
- GHOST_DisposeWindow(g_system, ghostwin);
- }
-
- return win;
- } else {
- return NULL;
- }
-}
-
-void window_set_handler(Window *win, WindowHandlerFP handler, void *user_data)
-{
- win->handler= handler;
- win->user_data= user_data;
-}
-
-static void window_timer_proc(GHOST_TimerTaskHandle timer, GHOST_TUns64 time)
-{
- Window *win= GHOST_GetTimerTaskUserData(timer);
-
- win->handler(win, win->user_data, win->timer_event, 0, 0);
-}
-
-void window_set_timer(Window *win, int delay_ms, int event)
-{
- if (win->timer) GHOST_RemoveTimer(g_system, win->timer);
-
- win->timer_event= event;
- win->timer= GHOST_InstallTimer(g_system, delay_ms, delay_ms, window_timer_proc, win);
-}
-
-void window_destroy(Window *win) {
- if (active_gl_window==win) {
- active_gl_window= NULL;
- }
-
- if (win->timer) {
- GHOST_RemoveTimer(g_system, win->timer);
- win->timer= NULL;
- }
-
- GHOST_DisposeWindow(g_system, win->ghostwin);
- window_free(win);
-}
-
-void window_set_cursor(Window *win, int curs) {
- if (curs==CURSOR_NONE) {
- GHOST_SetCursorVisibility(win->ghostwin, 0);
- } else {
- GHOST_SetCursorVisibility(win->ghostwin, 1);
-
- /* detect if we use system cursor or Blender cursor */
- switch(curs) {
- case CURSOR_TEXTEDIT:
- SetBlenderCursor(BC_TEXTEDITCURSOR);
- break;
- case CURSOR_VPAINT:
- SetBlenderCursor(BC_PAINTBRUSHCURSOR);
- break;
- default:
- GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
- }
- }
-}
-
-void window_set_custom_cursor(Window *win, unsigned char mask[16][2],
- unsigned char bitmap[16][2], int hotx, int hoty) {
- GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
-}
-
-void window_set_custom_cursor_ex(Window *win, BCursor *cursor, int useBig) {
- if (useBig) {
- GHOST_SetCustomCursorShapeEx(win->ghostwin,
- (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
- cursor->big_sizex,cursor->big_sizey,
- cursor->big_hotx,cursor->big_hoty,
- cursor->fg_color, cursor->bg_color);
- } else {
- GHOST_SetCustomCursorShapeEx(win->ghostwin,
- (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
- cursor->small_sizex,cursor->small_sizey,
- cursor->small_hotx,cursor->small_hoty,
- cursor->fg_color, cursor->bg_color);
- }
-}
-
-void window_make_active(Window *win) {
- if (win != active_gl_window) {
- win->lmbut= 0; /* keeps hanging when mousepressed while other window opened */
- active_gl_window= win;
- GHOST_ActivateWindowDrawingContext(win->ghostwin);
- }
-}
-
-void window_swap_buffers(Window *win) {
-#ifdef _WIN32
- // adding a glFinish() here is to prevent Geforce in 'full scene antialias' mode
- // from antialising the Blender window. Officially a swapbuffers does a glFinish
- // itself, so this feels really like a hack... but it won't harm. (ton)
- //
- // moved it here from ghost because it is a performance killer for the game engine,
- // glFinish forces synchronization with the graphics card and calling it is strongly
- // discouraged for good performance. (brecht)
- //
- glFinish();
-#endif
-
- GHOST_SwapWindowBuffers(win->ghostwin);
-}
-
-static int query_qual(char qual) {
- GHOST_TModifierKeyMask left, right;
- int val= 0;
-
- if (qual=='s') {
- left= GHOST_kModifierKeyLeftShift;
- right= GHOST_kModifierKeyRightShift;
- } else if (qual=='c') {
- left= GHOST_kModifierKeyLeftControl;
- right= GHOST_kModifierKeyRightControl;
- } else if (qual=='C') {
- left= right= GHOST_kModifierKeyCommand;
- } else {
- left= GHOST_kModifierKeyLeftAlt;
- right= GHOST_kModifierKeyRightAlt;
- }
-
- GHOST_GetModifierKeyState(g_system, left, &val);
- if (!val)
- GHOST_GetModifierKeyState(g_system, right, &val);
-
- return val;
-}
-
-static int change_bit(int val, int bit, int to_on) {
- return to_on?(val|bit):(val&~bit);
-}
-
-static void update_tablet_data(Window *win, GHOST_WindowHandle ghostwin) {
- const GHOST_TabletData *td= GHOST_GetTabletData(ghostwin);
-
- /* if there's tablet data from an active tablet device then use it,
- * otherwise set all tablet related data to default */
- if ((td != NULL) && ELEM(td->Active, DEV_STYLUS, DEV_ERASER)) {
- win->activedevice = (short)td->Active;
- win->pressure = td->Pressure;
- win->xtilt = td->Xtilt;
- win->ytilt = td->Ytilt;
- } else {
- win->activedevice = DEV_MOUSE;
- win->pressure = 1.0;
- win->xtilt = win->ytilt = 0.0;
- }
-}
-
-
-static int event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
-{
- GHOST_TEventType type= GHOST_GetEventType(evt);
-
- if (type == GHOST_kEventQuit) {
- exit_usiblender();
- } else {
- GHOST_WindowHandle ghostwin= GHOST_GetEventWindow(evt);
- GHOST_TEventDataPtr data= GHOST_GetEventData(evt);
- Window *win;
-
- if (!ghostwin) {
- // XXX - should be checked, why are we getting an event here, and
- // what is it?
-
- return 1;
- } else if (!GHOST_ValidWindow(g_system, ghostwin)) {
- // XXX - should be checked, why are we getting an event here, and
- // what is it?
-
- return 1;
- } else {
- win= GHOST_GetWindowUserData(ghostwin);
- }
-
- switch (type) {
-
- case GHOST_kEventNDOFMotion: {
- // update ndof device data, and dispatch motion event
-
- GHOST_TEventNDOFData *sb= data;
-
- // no scaling per sfgoros patch
- win->ndof[0] = sb->tx;
- win->ndof[1] = sb->ty;
- win->ndof[2] = sb->tz;
- win->ndof[3] = sb->rx;
- win->ndof[4] = sb->ry;
- win->ndof[5] = sb->rz;
- win->ndof[6] = sb->delta;
- // printf(" motion capted %f %f %f %f %f %f %f \n", win->ndof[0], win->ndof[1], win->ndof[2],
- // win->ndof[3], win->ndof[4], win->ndof[5], win->ndof[6]);
-
-
- // window_handle(win, NDOFMOTION, win->ndof[6]);
-
- // start interaction for larger than teeny-tiny motions
- // if (fabs(win->ndof[0] > 0.003f) ||
- // fabs(win->ndof[1] > 0.003f) ||
- // fabs(win->ndof[2] > 0.003f) ||
- // fabs(win->ndof[3] > 0.003f) ||
- // fabs(win->ndof[4] > 0.003f) ||
- // fabs(win->ndof[5] > 0.003f)) {
- window_handle(win, NDOFMOTION, 1);
- // printf("ok\n");
- // }
-;
- break;
- }
- case GHOST_kEventNDOFButton: {
- GHOST_TEventNDOFData *sb= data;
-
-// printf("this is a button %i\n", sb->buttons);
- window_handle(win, NDOFBUTTON, sb->buttons);
- break;
- }
- case GHOST_kEventCursorMove: {
- if(win->active == 1) {
- GHOST_TEventCursorData *cd= data;
-
- int cx, cy;
-
- GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy);
- win->lmouse[0]= cx;
- win->lmouse[1]= (win->size[1]-1) - cy;
-
- update_tablet_data(win, ghostwin);
- window_handle(win, MOUSEX, win->lmouse[0]);
- window_handle(win, MOUSEY, win->lmouse[1]);
- }
- break;
- }
- case GHOST_kEventButtonDown:
- case GHOST_kEventButtonUp: {
- GHOST_TEventButtonData *bd= data;
- int val= (type==GHOST_kEventButtonDown);
- int bbut= convert_mbut(bd->button);
-
- if (bbut==LEFTMOUSE) {
- if (val) {
- if (win->lqual & LR_COMMANDKEY) {
- bbut= win->faked_mbut= RIGHTMOUSE;
- } else if ((win->lqual & LR_ALTKEY) && (U.flag & USER_TWOBUTTONMOUSE)) {
- /* finally, it actually USES the userpref! :) -intrr */
- bbut= win->faked_mbut= MIDDLEMOUSE;
- }
- } else {
- if (win->faked_mbut) {
- bbut= win->faked_mbut;
- win->faked_mbut= 0;
- }
- }
- }
-
- if (bbut==LEFTMOUSE) {
- win->lmbut= change_bit(win->lmbut, L_MOUSE, val);
- } else if (bbut==MIDDLEMOUSE) {
- win->lmbut= change_bit(win->lmbut, M_MOUSE, val);
- } else {
- win->lmbut= change_bit(win->lmbut, R_MOUSE, val);
- }
-
- update_tablet_data(win, ghostwin);
- window_handle(win, bbut, val);
-
- break;
- }
-
- case GHOST_kEventKeyDown:
- case GHOST_kEventKeyUp: {
- GHOST_TEventKeyData *kd= data;
- int val= (type==GHOST_kEventKeyDown);
- int bkey= convert_key(kd->key);
-
- if (bkey) {
- if (bkey==LEFTSHIFTKEY || bkey==RIGHTSHIFTKEY) {
- win->lqual= change_bit(win->lqual, LR_SHIFTKEY, val);
- } else if (bkey==LEFTCTRLKEY || bkey==RIGHTCTRLKEY) {
- win->lqual= change_bit(win->lqual, LR_CTRLKEY, val);
- } else if (bkey==LEFTALTKEY || bkey==RIGHTALTKEY) {
- win->lqual= change_bit(win->lqual, LR_ALTKEY, val);
- } else if (bkey==COMMANDKEY) {
- win->lqual= change_bit(win->lqual, LR_COMMANDKEY, val);
- }
-
- window_handle_ext(win, bkey, val, kd->ascii);
- }
-
- break;
- }
-
- case GHOST_kEventWheel: {
- GHOST_TEventWheelData* wheelData = (GHOST_TEventWheelData*) data;
- if (wheelData->z > 0) {
- window_handle(win, WHEELUPMOUSE, 1);
- } else {
- window_handle(win, WHEELDOWNMOUSE, 1);
- }
- break;
- }
-
- case GHOST_kEventWindowDeactivate:
- case GHOST_kEventWindowActivate: {
- win->active= (type==GHOST_kEventWindowActivate);
- window_handle(win, INPUTCHANGE, win->active);
-
- if (win->active) {
- if ((win->lqual & LR_SHIFTKEY) && !query_qual('s')) {
- win->lqual= change_bit(win->lqual, LR_SHIFTKEY, 0);
- window_handle(win, LEFTSHIFTKEY, 0);
- }
- if ((win->lqual & LR_CTRLKEY) && !query_qual('c')) {
- win->lqual= change_bit(win->lqual, LR_CTRLKEY, 0);
- window_handle(win, LEFTCTRLKEY, 0);
- }
- if ((win->lqual & LR_ALTKEY) && !query_qual('a')) {
- win->lqual= change_bit(win->lqual, LR_ALTKEY, 0);
- window_handle(win, LEFTALTKEY, 0);
- }
- if ((win->lqual & LR_COMMANDKEY) && !query_qual('C')) {
- win->lqual= change_bit(win->lqual, LR_COMMANDKEY, 0);
- window_handle(win, LR_COMMANDKEY, 0);
- }
-
- /*
- * XXX quick hack so OSX version works better
- * when the window is clicked on (focused).
- *
- * it used to pass on the old win->lmouse value,
- * which causes a wrong click in Blender.
- * Actually, a 'focus' click should not be passed
- * on to blender... (ton)
- */
- if(1) { /* enables me to add locals */
- int cx, cy, wx, wy;
- GHOST_GetCursorPosition(g_system, &wx, &wy);
-
- GHOST_ScreenToClient(win->ghostwin, wx, wy, &cx, &cy);
- win->lmouse[0]= cx;
- win->lmouse[1]= (win->size[1]-1) - cy;
- window_handle(win, MOUSEX, win->lmouse[0]);
- window_handle(win, MOUSEY, win->lmouse[1]);
- }
- }
-
- break;
- }
- case GHOST_kEventWindowClose: {
- window_handle(win, WINCLOSE, 1);
- break;
- }
- case GHOST_kEventWindowUpdate: {
- window_handle(win, REDRAW, 1);
- break;
- }
- case GHOST_kEventWindowSize: {
- GHOST_RectangleHandle client_rect;
- int l, t, r, b, scr_w, scr_h;
-
- client_rect= GHOST_GetClientBounds(win->ghostwin);
- GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
-
- GHOST_DisposeRectangle(client_rect);
-
- winlay_get_screensize(&scr_w, &scr_h);
- win->position[0]= l;
- win->position[1]= scr_h - b - 1;
- win->size[0]= r-l;
- win->size[1]= b-t;
-
- window_handle(win, RESHAPE, 1);
- break;
- }
- case GHOST_kEventUnknown:
- case GHOST_kEventQuit:
- case GHOST_kNumEventTypes:
- break;
- }
- }
-
- return 1;
-}
-
-void window_get_ndof(Window* win, float* sbval) {
- int i;
- for (i = 0; i < 7; ++i) {
- *sbval++ = win->ndof[i];
- }
-}
-
-char *window_get_title(Window *win) {
- char *title= GHOST_GetTitle(win->ghostwin);
- char *mem_title= BLI_strdup(title);
- free(title);
-
- return mem_title;
-}
-
-void window_set_title(Window *win, char *title) {
- GHOST_SetTitle(win->ghostwin, title);
-}
-
-short window_get_qual(Window *win)
-{
- int qual= 0;
-
- if( query_qual('s')) qual |= LR_SHIFTKEY;
- if( query_qual('a')) qual |= LR_ALTKEY;
- if( query_qual('c')) qual |= LR_CTRLKEY;
- return qual;
-// return win->lqual;
-}
-
-short window_get_mbut(Window *win) {
- return win->lmbut;
-}
-
-void window_get_mouse(Window *win, short *mval) {
- mval[0]= win->lmouse[0];
- mval[1]= win->lmouse[1];
-}
-
-float window_get_pressure(Window *win) {
- return win->pressure;
-}
-
-void window_get_tilt(Window *win, float *xtilt, float *ytilt) {
- *xtilt= win->xtilt;
- *ytilt= win->ytilt;
-}
-
-short window_get_activedevice(Window *win) {
- return win->activedevice;
-}
-
-void window_get_position(Window *win, int *posx_r, int *posy_r) {
- *posx_r= win->position[0];
- *posy_r= win->position[1];
-}
-
-void window_get_size(Window *win, int *width_r, int *height_r) {
- *width_r= win->size[0];
- *height_r= win->size[1];
-}
-
-void window_set_size(Window *win, int width, int height) {
- GHOST_SetClientSize(win->ghostwin, width, height);
-}
-
-void window_lower(Window *win) {
- GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderBottom);
-}
-
-void window_raise(Window *win) {
- GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderTop);
-#ifdef _WIN32
- markdirty_all(); /* to avoid redraw errors in fullscreen mode (aphex) */
-#endif
-}
-
-#if 0
-//#ifdef _WIN32 //FULLSCREEN
-void window_toggle_fullscreen(Window *win, int fullscreen) {
- /* these two lines make sure front and backbuffer are equal. for swapbuffers */
- markdirty_all();
- screen_swapbuffers();
-
- if(fullscreen)
- GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateFullScreen);
- else
- GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateMaximized);
-}
-#endif
-
-void window_warp_pointer(Window *win, int x, int y) {
- int oldx=x, oldy=y;
-
- y= win->size[1] - y - 1;
- GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y);
- GHOST_SetCursorPosition(g_system, x, y);
-
- /* on OSX (for example) the setcursor doesnt create event */
- win->lmouse[0]= oldx;
- win->lmouse[1]= oldy;
-}
-
-void window_queue_redraw(Window *win) {
- GHOST_InvalidateWindow(win->ghostwin); // ghost will send back a redraw to blender
-}
-
-/***/
-
-void winlay_process_events(int wait_for_event) {
- GHOST_ProcessEvents(g_system, wait_for_event);
- GHOST_DispatchEvents(g_system);
-}
-
-void winlay_get_screensize(int *width_r, int *height_r) {
- unsigned int uiwidth;
- unsigned int uiheight;
-
- if (!g_system) {
- GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(event_proc, NULL);
-
- g_system= GHOST_CreateSystem();
- GHOST_AddEventConsumer(g_system, consumer);
- }
-
- GHOST_GetMainDisplayDimensions(g_system, &uiwidth, &uiheight);
- *width_r= uiwidth;
- *height_r= uiheight;
-}
-
-Window *winlay_get_active_window(void) {
- return active_gl_window;
-}
-
-#ifdef _WIN32
-#define PATH_SEP "\\"
-#else
-#define PATH_SEP "/"
-#endif
-
-
-void window_open_ndof(Window* win)
-{
- char *inst_path, *plug_path;
- const char *plug_dir = "plugins";
- const char *plug_name = "3DxNdofBlender.plug";
- PILdynlib *ndofLib;
-
- // build the plugin path
- plug_path = NULL;
- inst_path = get_install_dir(); // path to main blender exec/bundle
- if (inst_path) {
- // assume the ndof plugin is located in the plug-in dir
- size_t len = strlen(inst_path) + strlen(plug_dir) + strlen(PATH_SEP)*2
- + strlen(plug_name) + 1;
- plug_path = MEM_mallocN(len, "ndofpluginpath");
- if (plug_path) {
- strncpy(plug_path, inst_path, len);
- strcat(plug_path, PATH_SEP);
- strcat(plug_path, plug_dir);
- strcat(plug_path, PATH_SEP);
- strcat(plug_path, plug_name);
- }
- MEM_freeN(inst_path);
- }
-
- ndofLib = PIL_dynlib_open(plug_path);
-
- /* On systems where blender is installed in /usr/bin/blender, ~/.blender/plugins/ is a better place to look */
- if (ndofLib==NULL) {
-
- if (plug_path) {
- MEM_freeN(plug_path);
- }
-
- inst_path = BLI_gethome();
- if (inst_path) {
- size_t len = strlen(inst_path) + strlen(plug_dir) + strlen(PATH_SEP)*2
- + strlen(plug_name) + 1;
-
- if (!strstr(inst_path, ".blender")) {
- len += strlen(".blender") + strlen(PATH_SEP);
- }
-
- plug_path = MEM_mallocN(len, "ndofpluginpath");
- if (plug_path) {
- strncpy(plug_path, inst_path, len);
- strcat(plug_path, PATH_SEP);
- if (!strstr(inst_path, ".blender")) {
- strcat(plug_path, ".blender");
- strcat(plug_path, PATH_SEP);
- }
- strcat(plug_path, plug_dir);
- strcat(plug_path, PATH_SEP);
- strcat(plug_path, plug_name);
- }
- }
-
- ndofLib = PIL_dynlib_open(plug_path);
- }
-
-
-
-#if 0
- fprintf(stderr, "plugin path=%s; ndofLib=%p\n", plug_path, (void*)ndofLib);
-#endif
-
- if (plug_path)
- MEM_freeN(plug_path);
-
- if (ndofLib) {
- G.ndofdevice = 0 - GHOST_OpenNDOF(g_system, win->ghostwin,
- PIL_dynlib_find_symbol(ndofLib, "ndofInit"),
- PIL_dynlib_find_symbol(ndofLib, "ndofShutdown"),
- PIL_dynlib_find_symbol(ndofLib, "ndofOpen"));
-
- }
- else {
- GHOST_OpenNDOF(g_system, win->ghostwin, 0, 0, 0);
- G.ndofdevice = -1;
- }
- }
-
-char *getClipboard(int flag) {
- return (char*)GHOST_getClipboard(flag);
-}
-
-void putClipboard(char *buffer, int flag) {
- GHOST_putClipboard((GHOST_TInt8*)buffer, flag);
-}
diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c
deleted file mode 100644
index 497443edffd..00000000000
--- a/source/blender/src/gpencil.c
+++ /dev/null
@@ -1,2137 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "DNA_listBase.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_gpencil_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_blender.h"
-#include "BKE_armature.h"
-#include "BKE_curve.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_butspace.h"
-#include "BIF_drawseq.h"
-#include "BIF_editarmature.h"
-#include "BIF_editview.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_toets.h"
-
-#include "BDR_gpencil.h"
-#include "BIF_drawgpencil.h"
-
-#include "BDR_editobject.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-
-#include "PIL_time.h" /* sleep */
-#include "mydevice.h"
-
-/* ************************************************** */
-/* GENERAL STUFF */
-
-/* --------- Memory Management ------------ */
-
-/* Free strokes belonging to a gp-frame */
-void free_gpencil_strokes (bGPDframe *gpf)
-{
- bGPDstroke *gps, *gpsn;
-
- /* error checking */
- if (gpf == NULL) return;
-
- /* free strokes */
- for (gps= gpf->strokes.first; gps; gps= gpsn) {
- gpsn= gps->next;
-
- /* free stroke memory arrays, then stroke itself */
- if (gps->points) MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
- }
-}
-
-/* Free all of a gp-layer's frames */
-void free_gpencil_frames (bGPDlayer *gpl)
-{
- bGPDframe *gpf, *gpfn;
-
- /* error checking */
- if (gpl == NULL) return;
-
- /* free frames */
- for (gpf= gpl->frames.first; gpf; gpf= gpfn) {
- gpfn= gpf->next;
-
- /* free strokes and their associated memory */
- free_gpencil_strokes(gpf);
- BLI_freelinkN(&gpl->frames, gpf);
- }
-}
-
-/* Free all of the gp-layers for a viewport (list should be &gpd->layers or so) */
-void free_gpencil_layers (ListBase *list)
-{
- bGPDlayer *gpl, *gpln;
-
- /* error checking */
- if (list == NULL) return;
-
- /* delete layers*/
- for (gpl= list->first; gpl; gpl= gpln) {
- gpln= gpl->next;
-
- /* free layers and their data */
- free_gpencil_frames(gpl);
- BLI_freelinkN(list, gpl);
- }
-}
-
-/* Free gp-data and all it's related data */
-void free_gpencil_data (bGPdata *gpd)
-{
- /* free layers then data itself */
- free_gpencil_layers(&gpd->layers);
- MEM_freeN(gpd);
-}
-
-/* -------- Container Creation ---------- */
-
-/* add a new gp-frame to the given layer */
-bGPDframe *gpencil_frame_addnew (bGPDlayer *gpl, int cframe)
-{
- bGPDframe *gpf, *gf;
- short state=0;
-
- /* error checking */
- if ((gpl == NULL) || (cframe <= 0))
- return NULL;
-
- /* allocate memory for this frame */
- gpf= MEM_callocN(sizeof(bGPDframe), "bGPDframe");
- gpf->framenum= cframe;
-
- /* find appropriate place to add frame */
- if (gpl->frames.first) {
- for (gf= gpl->frames.first; gf; gf= gf->next) {
- /* check if frame matches one that is supposed to be added */
- if (gf->framenum == cframe) {
- state= -1;
- break;
- }
-
- /* if current frame has already exceeded the frame to add, add before */
- if (gf->framenum > cframe) {
- BLI_insertlinkbefore(&gpl->frames, gf, gpf);
- state= 1;
- break;
- }
- }
- }
-
- /* check whether frame was added successfully */
- if (state == -1) {
- MEM_freeN(gpf);
- printf("Error: frame (%d) existed already for this layer \n", cframe);
- }
- else if (state == 0) {
- /* add to end then! */
- BLI_addtail(&gpl->frames, gpf);
- }
-
- /* return frame */
- return gpf;
-}
-
-/* add a new gp-layer and make it the active layer */
-bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
-{
- bGPDlayer *gpl;
-
- /* check that list is ok */
- if (gpd == NULL)
- return NULL;
-
- /* allocate memory for frame and add to end of list */
- gpl= MEM_callocN(sizeof(bGPDlayer), "bGPDlayer");
-
- /* add to datablock */
- BLI_addtail(&gpd->layers, gpl);
-
- /* set basic settings */
- gpl->color[3]= 0.9f;
- gpl->thickness = 3;
-
- /* auto-name */
- sprintf(gpl->info, "GP_Layer");
- BLI_uniquename(&gpd->layers, gpl, "GP_Layer", offsetof(bGPDlayer, info[0]), 128);
-
- /* make this one the active one */
- gpencil_layer_setactive(gpd, gpl);
-
- /* return layer */
- return gpl;
-}
-
-/* add a new gp-datablock */
-bGPdata *gpencil_data_addnew (void)
-{
- bGPdata *gpd;
-
- /* allocate memory for a new block */
- gpd= MEM_callocN(sizeof(bGPdata), "GreasePencilData");
-
- /* initial settings */
- gpd->flag = (GP_DATA_DISPINFO|GP_DATA_EXPAND);
-
- return gpd;
-}
-
-/* -------- Data Duplication ---------- */
-
-/* make a copy of a given gpencil frame */
-bGPDframe *gpencil_frame_duplicate (bGPDframe *src)
-{
- bGPDstroke *gps, *gpsd;
- bGPDframe *dst;
-
- /* error checking */
- if (src == NULL)
- return NULL;
-
- /* make a copy of the source frame */
- dst= MEM_dupallocN(src);
-
- /* copy strokes */
- dst->strokes.first = dst->strokes.last= NULL;
- for (gps= src->strokes.first; gps; gps= gps->next) {
- /* make copy of source stroke, then adjust pointer to points too */
- gpsd= MEM_dupallocN(gps);
- gpsd->points= MEM_dupallocN(gps->points);
-
- BLI_addtail(&dst->strokes, gpsd);
- }
-
- /* return new frame */
- return dst;
-}
-
-/* make a copy of a given gpencil layer */
-bGPDlayer *gpencil_layer_duplicate (bGPDlayer *src)
-{
- bGPDframe *gpf, *gpfd;
- bGPDlayer *dst;
-
- /* error checking */
- if (src == NULL)
- return NULL;
-
- /* make a copy of source layer */
- dst= MEM_dupallocN(src);
-
- /* copy frames */
- dst->frames.first= dst->frames.last= NULL;
- for (gpf= src->frames.first; gpf; gpf= gpf->next) {
- /* make a copy of source stroke */
- gpfd= gpencil_frame_duplicate(gpf);
- BLI_addtail(&dst->frames, gpfd);
- }
-
- /* return new layer */
- return dst;
-}
-
-/* make a copy of a given gpencil datablock */
-bGPdata *gpencil_data_duplicate (bGPdata *src)
-{
- bGPDlayer *gpl, *gpld;
- bGPdata *dst;
-
- /* error checking */
- if (src == NULL)
- return NULL;
-
- /* make a copy of the base-data */
- dst= MEM_dupallocN(src);
-
- /* copy layers */
- dst->layers.first= dst->layers.last= NULL;
- for (gpl= src->layers.first; gpl; gpl= gpl->next) {
- /* make a copy of source layer and its data */
- gpld= gpencil_layer_duplicate(gpl);
- BLI_addtail(&dst->layers, gpld);
- }
-
- /* return new */
- return dst;
-}
-
-/* ----------- GP-Datablock API ------------- */
-
-/* get the appropriate bGPdata from the active/given context */
-bGPdata *gpencil_data_getactive (ScrArea *sa)
-{
- /* error checking */
- if ((sa == NULL) && (curarea == NULL))
- return NULL;
- if (sa == NULL)
- sa= curarea;
-
- /* handle depending on spacetype */
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- View3D *v3d= sa->spacedata.first;
- return v3d->gpd;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
- return snode->gpd;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
-
- /* only applicable for image modes */
- if (sseq->mainb)
- return sseq->gpd;
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
- return sima->gpd;
- }
- break;
- }
-
- /* nothing found */
- return NULL;
-}
-
-/* set bGPdata for the active/given context, and return success/fail */
-short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd)
-{
- /* error checking */
- if ((sa == NULL) && (curarea == NULL))
- return 0;
- if (gpd == NULL)
- return 0;
- if (sa == NULL)
- sa= curarea;
-
- /* handle depending on spacetype */
- // TODO: someday we should have multi-user data, so no need to loose old data
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- View3D *v3d= sa->spacedata.first;
-
- /* free the existing block */
- if (v3d->gpd)
- free_gpencil_data(v3d->gpd);
- v3d->gpd= gpd;
-
- return 1;
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= sa->spacedata.first;
-
- /* free the existing block */
- if (snode->gpd)
- free_gpencil_data(snode->gpd);
- snode->gpd= gpd;
-
- /* set special settings */
- gpd->flag |= GP_DATA_VIEWALIGN;
-
- return 1;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= sa->spacedata.first;
-
- /* only applicable if right mode */
- if (sseq->mainb) {
- /* free the existing block */
- if (sseq->gpd)
- free_gpencil_data(sseq->gpd);
- sseq->gpd= gpd;
-
- return 1;
- }
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= sa->spacedata.first;
-
- if (sima->gpd)
- free_gpencil_data(sima->gpd);
- sima->gpd= gpd;
-
- return 1;
- }
- break;
- }
-
- /* failed to add */
- return 0;
-}
-
-/* return the ScrArea that has the given GP-datablock
- * - assumes that only searching in current screen
- * - is based on GP-datablocks only being able to
- * exist for one area at a time (i.e. not multiuser)
- */
-ScrArea *gpencil_data_findowner (bGPdata *gpd)
-{
- ScrArea *sa;
-
- /* error checking */
- if (gpd == NULL)
- return NULL;
-
- /* loop over all scrareas for current screen, and check if that area has this gpd */
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- /* use get-active func to see if match */
- if (gpencil_data_getactive(sa) == gpd)
- return sa;
- }
-
- /* not found */
- return NULL;
-}
-
-/* -------- GP-Frame API ---------- */
-
-/* delete the last stroke of the given frame */
-void gpencil_frame_delete_laststroke (bGPDframe *gpf)
-{
- bGPDstroke *gps= (gpf) ? gpf->strokes.last : NULL;
-
- /* error checking */
- if (ELEM(NULL, gpf, gps))
- return;
-
- /* free the stroke and its data */
- MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
-}
-
-/* -------- GP-Layer API ---------- */
-
-/* get the appropriate gp-frame from a given layer
- * - this sets the layer's actframe var (if allowed to)
- * - extension beyond range (if first gp-frame is after all frame in interest and cannot add)
- */
-bGPDframe *gpencil_layer_getframe (bGPDlayer *gpl, int cframe, short addnew)
-{
- bGPDframe *gpf = NULL;
- short found = 0;
-
- /* error checking */
- if (gpl == NULL) return NULL;
- if (cframe <= 0) cframe = 1;
-
- /* check if there is already an active frame */
- if (gpl->actframe) {
- gpf= gpl->actframe;
-
- /* do not allow any changes to layer's active frame if layer is locked */
- if (gpl->flag & GP_LAYER_LOCKED)
- return gpf;
- /* do not allow any changes to actframe if frame has painting tag attached to it */
- if (gpf->flag & GP_FRAME_PAINT)
- return gpf;
-
- /* try to find matching frame */
- if (gpf->framenum < cframe) {
- for (; gpf; gpf= gpf->next) {
- if (gpf->framenum == cframe) {
- found= 1;
- break;
- }
- else if ((gpf->next) && (gpf->next->framenum > cframe)) {
- found= 1;
- break;
- }
- }
-
- /* set the appropriate frame */
- if (addnew) {
- if ((found) && (gpf->framenum == cframe))
- gpl->actframe= gpf;
- else
- gpl->actframe= gpencil_frame_addnew(gpl, cframe);
- }
- else if (found)
- gpl->actframe= gpf;
- else
- gpl->actframe= gpl->frames.last;
- }
- else {
- for (; gpf; gpf= gpf->prev) {
- if (gpf->framenum <= cframe) {
- found= 1;
- break;
- }
- }
-
- /* set the appropriate frame */
- if (addnew) {
- if ((found) && (gpf->framenum == cframe))
- gpl->actframe= gpf;
- else
- gpl->actframe= gpencil_frame_addnew(gpl, cframe);
- }
- else if (found)
- gpl->actframe= gpf;
- else
- gpl->actframe= gpl->frames.first;
- }
- }
- else if (gpl->frames.first) {
- /* check which of the ends to start checking from */
- const int first= ((bGPDframe *)(gpl->frames.first))->framenum;
- const int last= ((bGPDframe *)(gpl->frames.last))->framenum;
-
- if (abs(cframe-first) > abs(cframe-last)) {
- /* find gp-frame which is less than or equal to cframe */
- for (gpf= gpl->frames.last; gpf; gpf= gpf->prev) {
- if (gpf->framenum <= cframe) {
- found= 1;
- break;
- }
- }
- }
- else {
- /* find gp-frame which is less than or equal to cframe */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if (gpf->framenum <= cframe) {
- found= 1;
- break;
- }
- }
- }
-
- /* set the appropriate frame */
- if (addnew) {
- if ((found) && (gpf->framenum == cframe))
- gpl->actframe= gpf;
- else
- gpl->actframe= gpencil_frame_addnew(gpl, cframe);
- }
- else if (found)
- gpl->actframe= gpf;
- else {
- /* unresolved errogenous situation! */
- printf("Error: cannot find appropriate gp-frame \n");
- /* gpl->actframe should still be NULL */
- }
- }
- else {
- /* currently no frames (add if allowed to) */
- if (addnew)
- gpl->actframe= gpencil_frame_addnew(gpl, cframe);
- else {
- /* don't do anything... this may be when no frames yet! */
- /* gpl->actframe should still be NULL */
- }
- }
-
- /* return */
- return gpl->actframe;
-}
-
-/* delete the given frame from a layer */
-void gpencil_layer_delframe (bGPDlayer *gpl, bGPDframe *gpf)
-{
- /* error checking */
- if (ELEM(NULL, gpl, gpf))
- return;
-
- /* free the frame and its data */
- free_gpencil_strokes(gpf);
- BLI_freelinkN(&gpl->frames, gpf);
- gpl->actframe = NULL;
-}
-
-/* get the active gp-layer for editing */
-bGPDlayer *gpencil_layer_getactive (bGPdata *gpd)
-{
- bGPDlayer *gpl;
-
- /* error checking */
- if (ELEM(NULL, gpd, gpd->layers.first))
- return NULL;
-
- /* loop over layers until found (assume only one active) */
- for (gpl=gpd->layers.first; gpl; gpl=gpl->next) {
- if (gpl->flag & GP_LAYER_ACTIVE)
- return gpl;
- }
-
- /* no active layer found */
- return NULL;
-}
-
-/* set the active gp-layer */
-void gpencil_layer_setactive (bGPdata *gpd, bGPDlayer *active)
-{
- bGPDlayer *gpl;
-
- /* error checking */
- if (ELEM3(NULL, gpd, gpd->layers.first, active))
- return;
-
- /* loop over layers deactivating all */
- for (gpl=gpd->layers.first; gpl; gpl=gpl->next)
- gpl->flag &= ~GP_LAYER_ACTIVE;
-
- /* set as active one */
- active->flag |= GP_LAYER_ACTIVE;
-}
-
-/* delete the active gp-layer */
-void gpencil_layer_delactive (bGPdata *gpd)
-{
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
-
- /* error checking */
- if (ELEM(NULL, gpd, gpl))
- return;
-
- /* free layer */
- free_gpencil_frames(gpl);
- BLI_freelinkN(&gpd->layers, gpl);
-}
-
-/* ************************************************** */
-/* GREASE-PENCIL EDITING - Tools */
-
-/* --------- Data Deletion ---------- */
-
-/* delete the last stroke on the active layer */
-void gpencil_delete_laststroke (bGPdata *gpd)
-{
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- gpencil_frame_delete_laststroke(gpf);
-}
-
-/* delete the active frame */
-void gpencil_delete_actframe (bGPdata *gpd)
-{
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
-
- gpencil_layer_delframe(gpl, gpf);
-}
-
-
-
-/* delete various grase-pencil elements
- * mode: 1 - last stroke
- * 2 - active frame
- * 3 - active layer
- */
-void gpencil_delete_operation (short mode)
-{
- bGPdata *gpd;
-
- /* get datablock to work on */
- gpd= gpencil_data_getactive(NULL);
- if (gpd == NULL) return;
-
- switch (mode) {
- case 1: /* last stroke */
- gpencil_delete_laststroke(gpd);
- break;
- case 2: /* active frame */
- gpencil_delete_actframe(gpd);
- break;
- case 3: /* active layer */
- gpencil_layer_delactive(gpd);
- break;
- }
-
- /* redraw and undo-push */
- BIF_undo_push("GPencil Delete");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* display a menu for deleting different grease-pencil elements */
-void gpencil_delete_menu (void)
-{
- bGPdata *gpd= gpencil_data_getactive(NULL);
- short mode;
-
- /* only show menu if it will be relevant */
- if (gpd == NULL) return;
-
- mode= pupmenu("Grease Pencil Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3");
- if (mode <= 0) return;
-
- gpencil_delete_operation(mode);
-}
-
-/* --------- Data Conversion ---------- */
-
-/* convert the coordinates from the given stroke point into 3d-coordinates */
-static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float p3d[3])
-{
- if (gps->flag & GP_STROKE_3DSPACE) {
- /* directly use 3d-coordinates */
- VecCopyf(p3d, &pt->x);
- }
- else {
- short mval[2], mx, my;
- float *fp= give_cursor();
- float dvec[3];
-
- /* get screen coordinate */
- if (gps->flag & GP_STROKE_2DSPACE) {
- View2D *v2d= spacelink_get_view2d(curarea->spacedata.first);
- ipoco_to_areaco_noclip(v2d, &pt->x, mval);
- }
- else {
- mval[0]= (short)(pt->x / 1000 * curarea->winx);
- mval[1]= (short)(pt->y / 1000 * curarea->winy);
- }
- mx= mval[0];
- my= mval[1];
-
- /* convert screen coordinate to 3d coordinates
- * - method taken from editview.c - mouse_cursor()
- */
- project_short_noclip(fp, mval);
- window_to_3d(dvec, mval[0]-mx, mval[1]-my);
- VecSubf(p3d, fp, dvec);
- }
-}
-
-/* --- */
-
-/* convert stroke to 3d path */
-static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
-{
- bGPDspoint *pt;
- Nurb *nu;
- BPoint *bp;
- int i;
-
- /* create new 'nurb' within the curve */
- nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_path(nurb)");
-
- nu->pntsu= gps->totpoints;
- nu->pntsv= 1;
- nu->orderu= gps->totpoints;
- nu->flagu= 2; /* endpoint */
- nu->resolu= 32;
-
- nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints");
-
- /* add points */
- for (i=0, pt=gps->points, bp=nu->bp; i < gps->totpoints; i++, pt++, bp++) {
- float p3d[3];
-
- /* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3d);
- VecCopyf(bp->vec, p3d);
-
- /* set settings */
- bp->f1= SELECT;
- bp->radius = bp->weight = pt->pressure * gpl->thickness;
- }
-
- /* add nurb to curve */
- BLI_addtail(&cu->nurb, nu);
-}
-
-/* convert stroke to 3d bezier */
-static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu)
-{
- bGPDspoint *pt;
- Nurb *nu;
- BezTriple *bezt;
- int i;
-
- /* create new 'nurb' within the curve */
- nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_bezier(nurb)");
-
- nu->pntsu= gps->totpoints;
- nu->resolu= 12;
- nu->resolv= 12;
- nu->type= CU_BEZIER;
- nu->bezt = (BezTriple *)MEM_callocN(gps->totpoints*sizeof(BezTriple), "bezts");
-
- /* add points */
- for (i=0, pt=gps->points, bezt=nu->bezt; i < gps->totpoints; i++, pt++, bezt++) {
- float p3d[3];
-
- /* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3d);
-
- /* TODO: maybe in future the handles shouldn't be in same place */
- VecCopyf(bezt->vec[0], p3d);
- VecCopyf(bezt->vec[1], p3d);
- VecCopyf(bezt->vec[2], p3d);
-
- /* set settings */
- bezt->h1= bezt->h2= HD_FREE;
- bezt->f1= bezt->f2= bezt->f3= SELECT;
- bezt->radius = bezt->weight = pt->pressure * gpl->thickness * 0.1f;
- }
-
- /* must calculate handles or else we crash */
- calchandlesNurb(nu);
-
- /* add nurb to curve */
- BLI_addtail(&cu->nurb, nu);
-}
-
-/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
-static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, short mode)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
- bGPDstroke *gps;
- Object *ob;
- Curve *cu;
-
- /* error checking */
- if (ELEM3(NULL, gpd, gpl, gpf))
- return;
-
- /* only convert if there are any strokes on this layer's frame to convert */
- if (gpf->strokes.first == NULL)
- return;
-
- /* init the curve object (remove rotation and get curve data from it)
- * - must clear transforms set on object, as those skew our results
- */
- add_object_draw(OB_CURVE);
- ob= OBACT;
- ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
- cu= ob->data;
- cu->flag |= CU_3D;
-
- /* rename object and curve to layer name */
- rename_id((ID *)ob, gpl->info);
- rename_id((ID *)cu, gpl->info);
-
- /* add points to curve */
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- switch (mode) {
- case 1:
- gp_stroke_to_path(gpl, gps, cu);
- break;
- case 2:
- gp_stroke_to_bezier(gpl, gps, cu);
- break;
- }
- }
-}
-
-/* --- */
-
-/* convert a stroke to a bone chain */
-static void gp_stroke_to_bonechain (bGPDlayer *gpl, bGPDstroke *gps, bArmature *arm, ListBase *bones)
-{
- EditBone *ebo, *prev=NULL;
- bGPDspoint *pt, *ptn;
- int i;
-
- /* add each segment separately */
- for (i=0, pt=gps->points, ptn=gps->points+1; i < (gps->totpoints-1); prev=ebo, i++, pt++, ptn++) {
- float p3da[3], p3db[3];
-
- /* get coordinates to add at */
- gp_strokepoint_convertcoords(gps, pt, p3da);
- gp_strokepoint_convertcoords(gps, ptn, p3db);
-
- /* allocate new bone */
- ebo= MEM_callocN(sizeof(EditBone), "eBone");
-
- VecCopyf(ebo->head, p3da);
- VecCopyf(ebo->tail, p3db);
-
- /* add new bone - note: sync with editarmature.c::add_editbone() */
- {
- BLI_strncpy(ebo->name, "Stroke", 32);
- unique_editbone_name(bones, ebo->name);
-
- BLI_addtail(bones, ebo);
-
- if (i > 0)
- {
- ebo->flag |= BONE_CONNECTED;
- }
- ebo->weight= 1.0f;
- ebo->dist= 0.25f;
- ebo->xwidth= 0.1f;
- ebo->zwidth= 0.1f;
- ebo->ease1= 1.0f;
- ebo->ease2= 1.0f;
- ebo->rad_head= pt->pressure * gpl->thickness * 0.1f;
- ebo->rad_tail= ptn->pressure * gpl->thickness * 0.1f;
- ebo->segments= 1;
- ebo->layer= arm->layer;
- }
-
- /* set parenting */
- ebo->parent= prev;
- }
-}
-
-/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
-static void gp_layer_to_armature (bGPdata *gpd, bGPDlayer *gpl, short mode)
-{
- bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0);
- bGPDstroke *gps;
- Object *ob;
- bArmature *arm;
- ListBase bones = {0,0};
-
- /* error checking */
- if (ELEM3(NULL, gpd, gpl, gpf))
- return;
-
- /* only convert if there are any strokes on this layer's frame to convert */
- if (gpf->strokes.first == NULL)
- return;
-
- /* init the armature object (remove rotation and assign armature data to it)
- * - must clear transforms set on object, as those skew our results
- */
- add_object_draw(OB_ARMATURE);
- ob= OBACT;
- ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
- ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
- arm= ob->data;
-
- /* rename object and armature to layer name */
- rename_id((ID *)ob, gpl->info);
- rename_id((ID *)arm, gpl->info);
-
- /* convert segments to bones, strokes to bone chains */
- for (gps= gpf->strokes.first; gps; gps= gps->next) {
- gp_stroke_to_bonechain(gpl, gps, arm, &bones);
- }
-
- /* adjust roll of bones
- * - set object as EditMode object, but need to clear afterwards!
- * - use 'align to world z-up' option
- */
- {
- /* set our data as if we're in editmode to fool auto_align_armature() */
- G.obedit= ob;
- G.edbo.first = bones.first;
- G.edbo.last = bones.last;
-
- /* WARNING: need to make sure this magic number doesn't change */
- auto_align_armature(2);
-
- /* clear editbones (not needed anymore) */
- G.edbo.first= G.edbo.last= NULL;
- G.obedit= NULL;
- }
-
- /* flush editbones to armature */
- editbones_to_armature(&bones, ob);
- if (bones.first) BLI_freelistN(&bones);
-}
-
-/* --- */
-
-/* convert grease-pencil strokes to another representation
- * mode: 1 - Active layer to path
- * 2 - Active layer to bezier
- * 3 - Active layer to armature
- */
-void gpencil_convert_operation (short mode)
-{
- bGPdata *gpd;
- float *fp= give_cursor();
-
- /* get datablock to work on */
- gpd= gpencil_data_getactive(NULL);
- if (gpd == NULL) return;
-
- /* initialise 3d-cursor correction globals */
- initgrabz(fp[0], fp[1], fp[2]);
-
- /* handle selection modes */
- switch (mode) {
- case 1: /* active layer only (to path) */
- case 2: /* active layer only (to bezier) */
- {
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- gp_layer_to_curve(gpd, gpl, mode);
- }
- break;
- case 3: /* active layer only (to armature) */
- {
- bGPDlayer *gpl= gpencil_layer_getactive(gpd);
- gp_layer_to_armature(gpd, gpl, mode);
- }
- break;
- }
-
- /* redraw and undo-push */
- BIF_undo_push("GPencil Convert");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-/* display a menu for converting grease-pencil strokes */
-void gpencil_convert_menu (void)
-{
- bGPdata *gpd= gpencil_data_getactive(NULL);
- short mode;
-
- /* only show menu if it will be relevant */
- if (gpd == NULL) return;
-
- mode= pupmenu("Grease Pencil Convert %t|Active Layer To Path%x1|Active Layer to Bezier%x2|Active Layer to Armature%x3");
- if (mode <= 0) return;
-
- gpencil_convert_operation(mode);
-}
-
-/* ************************************************** */
-/* GREASE-PENCIL EDITING MODE - Painting */
-
-/* ---------- 'Globals' and Defines ----------------- */
-
-/* maximum sizes of gp-session buffer */
-#define GP_STROKE_BUFFER_MAX 5000
-
-/* Macros for accessing sensitivity thresholds... */
- /* minimum number of pixels mouse should move before new point created */
-#define MIN_MANHATTEN_PX (U.gp_manhattendist)
- /* minimum length of new segment before new point can be added */
-#define MIN_EUCLIDEAN_PX (U.gp_euclideandist)
-
-/* macro to test if only converting endpoints - only for use when converting! */
-#define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (G.qual & LR_CTRLKEY))
-
-/* ------ */
-
-/* Temporary 'Stroke' Operation data */
-typedef struct tGPsdata {
- ScrArea *sa; /* area where painting originated */
- View2D *v2d; /* needed for GP_STROKE_2DSPACE */
-
- ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */
- struct IBufViewSettings {
- int offsx, offsy; /* offsets */
- int sizex, sizey; /* dimensions to use as scale-factor */
- } im2d_settings; /* needed for GP_STROKE_2DIMAGE */
-
- bGPdata *gpd; /* gp-datablock layer comes from */
- bGPDlayer *gpl; /* layer we're working on */
- bGPDframe *gpf; /* frame we're working on */
-
- short status; /* current status of painting */
- short paintmode; /* mode for painting */
-
- short mval[2]; /* current mouse-position */
- short mvalo[2]; /* previous recorded mouse-position */
-
- float pressure; /* current stylus pressure */
- float opressure; /* previous stylus pressure */
-
- short radius; /* radius of influence for eraser */
-} tGPsdata;
-
-/* values for tGPsdata->status */
-enum {
- GP_STATUS_NORMAL = 0, /* running normally */
- GP_STATUS_ERROR, /* something wasn't correctly set up */
- GP_STATUS_DONE /* painting done */
-};
-
-/* values for tGPsdata->paintmode */
-enum {
- GP_PAINTMODE_DRAW = 0,
- GP_PAINTMODE_ERASER
-};
-
-/* Return flags for adding points to stroke buffer */
-enum {
- GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */
- GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */
- GP_STROKEADD_NORMAL, /* point was successfully added */
- GP_STROKEADD_FULL /* cannot add any more points to buffer */
-};
-
-/* ---------- Stroke Editing ------------ */
-
-/* clear the session buffers (call this before AND after a paint operation) */
-static void gp_session_validatebuffer (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
-
- /* clear memory of buffer (or allocate it if starting a new session) */
- if (gpd->sbuffer)
- memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX);
- else
- gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer");
-
- /* reset indices */
- gpd->sbuffer_size = 0;
-
- /* reset flags */
- gpd->sbuffer_sflag= 0;
-}
-
-/* check if the current mouse position is suitable for adding a new point */
-static short gp_stroke_filtermval (tGPsdata *p, short mval[2], short pmval[2])
-{
- short dx= abs(mval[0] - pmval[0]);
- short dy= abs(mval[1] - pmval[1]);
-
- /* check if mouse moved at least certain distance on both axes (best case) */
- if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
- return 1;
-
- /* check if the distance since the last point is significant enough */
- // future optimisation: sqrt here may be too slow?
- else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX)
- return 1;
-
- /* mouse 'didn't move' */
- else
- return 0;
-}
-
-/* convert screen-coordinates to buffer-coordinates */
-static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[])
-{
- bGPdata *gpd= p->gpd;
-
- /* in 3d-space - pt->x/y/z are 3 side-by-side floats */
- if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) {
- const short mx=mval[0], my=mval[1];
- float *fp= give_cursor();
- float dvec[3];
-
- /* Current method just converts each point in screen-coordinates to
- * 3D-coordinates using the 3D-cursor as reference. In general, this
- * works OK, but it could of course be improved.
- *
- * TODO:
- * - investigate using nearest point(s) on a previous stroke as
- * reference point instead or as offset, for easier stroke matching
- * - investigate projection onto geometry (ala retopo)
- */
-
- /* method taken from editview.c - mouse_cursor() */
- project_short_noclip(fp, mval);
- window_to_3d(dvec, mval[0]-mx, mval[1]-my);
- VecSubf(out, fp, dvec);
- }
-
- /* 2d - on 'canvas' (assume that p->v2d is set) */
- else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) {
- float x, y;
-
- areamouseco_to_ipoco(p->v2d, mval, &x, &y);
-
- out[0]= x;
- out[1]= y;
- }
-
- /* 2d - on image 'canvas' (assume that p->v2d is set) */
- else if (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) {
- int sizex, sizey, offsx, offsy;
-
- /* get stored settings
- * - assume that these have been set already (there are checks that set sane 'defaults' just in case)
- */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- out[0]= (float)(mval[0] - offsx) / (float)sizex;
- out[1]= (float)(mval[1] - offsy) / (float)sizey;
- }
-
- /* 2d - relative to screen (viewport area) */
- else {
- out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000;
- out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000;
- }
-}
-
-/* add current stroke-point to buffer (returns whether point was successfully added) */
-static short gp_stroke_addpoint (tGPsdata *p, short mval[2], float pressure)
-{
- bGPdata *gpd= p->gpd;
- tGPspoint *pt;
-
- /* check if still room in buffer */
- if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX)
- return GP_STROKEADD_OVERFLOW;
-
- /* get pointer to destination point */
- pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size);
-
- /* store settings */
- pt->x= mval[0];
- pt->y= mval[1];
- pt->pressure= pressure;
-
- /* increment counters */
- gpd->sbuffer_size++;
-
- /* check if another operation can still occur */
- if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX)
- return GP_STROKEADD_FULL;
- else
- return GP_STROKEADD_NORMAL;
-}
-
-/* smooth a stroke (in buffer) before storing it */
-static void gp_stroke_smooth (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- int i=0, cmx=gpd->sbuffer_size;
-
- /* only smooth if smoothing is enabled, and we're not doing a straight line */
- if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || GP_BUFFER2STROKE_ENDPOINTS)
- return;
-
- /* don't try if less than 2 points in buffer */
- if ((cmx <= 2) || (gpd->sbuffer == NULL))
- return;
-
- /* apply weighting-average (note doing this along path sequentially does introduce slight error) */
- for (i=0; i < gpd->sbuffer_size; i++) {
- tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i);
- tGPspoint *pb= (i-1 > 0)?(pc-1):(pc);
- tGPspoint *pa= (i-2 > 0)?(pc-2):(pb);
- tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc);
- tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd);
-
- pc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x);
- pc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y);
- }
-}
-
-/* simplify a stroke (in buffer) before storing it
- * - applies a reverse Chaikin filter
- * - code adapted from etch-a-ton branch (editarmature_sketch.c)
- */
-static void gp_stroke_simplify (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- tGPspoint *old_points= (tGPspoint *)gpd->sbuffer;
- short num_points= gpd->sbuffer_size;
- short flag= gpd->sbuffer_sflag;
- short i, j;
-
- /* only simplify if simlification is enabled, and we're not doing a straight line */
- if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || GP_BUFFER2STROKE_ENDPOINTS)
- return;
-
- /* don't simplify if less than 4 points in buffer */
- if ((num_points <= 2) || (old_points == NULL))
- return;
-
- /* clear buffer (but don't free mem yet) so that we can write to it
- * - firstly set sbuffer to NULL, so a new one is allocated
- * - secondly, reset flag after, as it gets cleared auto
- */
- gpd->sbuffer= NULL;
- gp_session_validatebuffer(p);
- gpd->sbuffer_sflag = flag;
-
-/* macro used in loop to get position of new point
- * - used due to the mixture of datatypes in use here
- */
-#define GP_SIMPLIFY_AVPOINT(offs, sfac) \
- { \
- co[0] += (float)(old_points[offs].x * sfac); \
- co[1] += (float)(old_points[offs].y * sfac); \
- pressure += old_points[offs].pressure * sfac; \
- }
-
- for (i = 0, j = 0; i < num_points; i++)
- {
- if (i - j == 3)
- {
- float co[2], pressure;
- short mco[2];
-
- /* initialise values */
- co[0]= 0;
- co[1]= 0;
- pressure = 0;
-
- /* using macro, calculate new point */
- GP_SIMPLIFY_AVPOINT(j, -0.25f);
- GP_SIMPLIFY_AVPOINT(j+1, 0.75f);
- GP_SIMPLIFY_AVPOINT(j+2, 0.75f);
- GP_SIMPLIFY_AVPOINT(j+3, -0.25f);
-
- /* set values for adding */
- mco[0]= (short)co[0];
- mco[1]= (short)co[1];
-
- /* ignore return values on this... assume to be ok for now */
- gp_stroke_addpoint(p, mco, pressure);
-
- j += 2;
- }
- }
-
- /* free old buffer */
- MEM_freeN(old_points);
-}
-
-
-/* make a new stroke from the buffer data */
-static void gp_stroke_newfrombuffer (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
- bGPDstroke *gps;
- bGPDspoint *pt;
- tGPspoint *ptc;
- int i, totelem;
-
- /* get total number of points to allocate space for:
- * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints
- * - otherwise, do whole stroke
- */
- if (GP_BUFFER2STROKE_ENDPOINTS)
- totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size;
- else
- totelem = gpd->sbuffer_size;
-
- /* exit with error if no valid points from this stroke */
- if (totelem == 0) {
- if (G.f & G_DEBUG)
- printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size);
- return;
- }
-
- /* allocate memory for a new stroke */
- gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
-
- /* allocate enough memory for a continuous array for storage points */
- pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points");
-
- /* copy appropriate settings for stroke */
- gps->totpoints= totelem;
- gps->thickness= p->gpl->thickness;
- gps->flag= gpd->sbuffer_sflag;
-
- /* copy points from the buffer to the stroke */
- if (GP_BUFFER2STROKE_ENDPOINTS) {
- /* 'Draw Mode' + Ctrl-Modifier - only endpoints */
- {
- /* first point */
- ptc= gpd->sbuffer;
-
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
-
- pt++;
- }
-
- if (totelem == 2) {
- /* last point if applicable */
- ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1);
-
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
- }
- }
- else {
- /* convert all points (normal behaviour) */
- for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) {
- /* convert screen-coordinates to appropriate coordinates (and store them) */
- gp_stroke_convertcoords(p, &ptc->x, &pt->x);
-
- /* copy pressure */
- pt->pressure= ptc->pressure;
-
- pt++;
- }
- }
-
- /* add stroke to frame */
- BLI_addtail(&p->gpf->strokes, gps);
-}
-
-/* --- 'Eraser' for 'Paint' Tool ------ */
-
-/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */
-static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i)
-{
- bGPDspoint *pt_tmp= gps->points;
- bGPDstroke *gsn = NULL;
-
- /* if stroke only had two points, get rid of stroke */
- if (gps->totpoints == 2) {
- /* free stroke points, then stroke */
- MEM_freeN(pt_tmp);
- BLI_freelinkN(&gpf->strokes, gps);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-
- /* if last segment, just remove segment from the stroke */
- else if (i == gps->totpoints - 2) {
- /* allocate new points array, and assign most of the old stroke there */
- gps->totpoints--;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-
- /* if first segment, just remove segment from the stroke */
- else if (i == 0) {
- /* allocate new points array, and assign most of the old stroke there */
- gps->totpoints--;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* no break here, as there might still be stuff to remove in this stroke */
- return 0;
- }
-
- /* segment occurs in 'middle' of stroke, so split */
- else {
- /* duplicate stroke, and assign 'later' data to that stroke */
- gsn= MEM_dupallocN(gps);
- gsn->prev= gsn->next= NULL;
- BLI_insertlinkafter(&gpf->strokes, gps, gsn);
-
- gsn->totpoints= gps->totpoints - i;
- gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points");
- memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints);
-
- /* adjust existing stroke */
- gps->totpoints= i;
- gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points");
- memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i);
-
- /* free temp buffer */
- MEM_freeN(pt_tmp);
-
- /* nothing left in stroke, so stop */
- return 1;
- }
-}
-
-/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */
-static short gp_stroke_eraser_strokeinside (short mval[], short mvalo[], short rad, short x0, short y0, short x1, short y1)
-{
- /* simple within-radius check for now */
- if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1))
- return 1;
-
- /* not inside */
- return 0;
-}
-
-/* eraser tool - evaluation per stroke */
-static void gp_stroke_eraser_dostroke (tGPsdata *p, short mval[], short mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps)
-{
- bGPDspoint *pt1, *pt2;
- short x0=0, y0=0, x1=0, y1=0;
- short xyval[2];
- int i;
-
- if (gps->totpoints == 0) {
- /* just free stroke */
- if (gps->points)
- MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
- }
- else if (gps->totpoints == 1) {
- /* get coordinates */
- if (gps->flag & GP_STROKE_3DSPACE) {
- project_short(&gps->points->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DSPACE) {
- ipoco_to_areaco_noclip(p->v2d, &gps->points->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DIMAGE) {
- int offsx, offsy, sizex, sizey;
-
- /* get stored settings */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- x0= (short)((gps->points->x * sizex) + offsx);
- y0= (short)((gps->points->y * sizey) + offsy);
- }
- else {
- x0= (short)(gps->points->x / 1000 * p->sa->winx);
- y0= (short)(gps->points->y / 1000 * p->sa->winy);
- }
-
- /* do boundbox check first */
- if (BLI_in_rcti(rect, x0, y0)) {
- /* only check if point is inside */
- if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) {
- /* free stroke */
- MEM_freeN(gps->points);
- BLI_freelinkN(&gpf->strokes, gps);
- }
- }
- }
- else {
- /* loop over the points in the stroke, checking for intersections
- * - an intersection will require the stroke to be split
- */
- for (i=0; (i+1) < gps->totpoints; i++) {
- /* get points to work with */
- pt1= gps->points + i;
- pt2= gps->points + i + 1;
-
- /* get coordinates */
- if (gps->flag & GP_STROKE_3DSPACE) {
- project_short(&pt1->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
-
- project_short(&pt2->x, xyval);
- x1= xyval[0];
- y1= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DSPACE) {
- ipoco_to_areaco_noclip(p->v2d, &pt1->x, xyval);
- x0= xyval[0];
- y0= xyval[1];
-
- ipoco_to_areaco_noclip(p->v2d, &pt2->x, xyval);
- x1= xyval[0];
- y1= xyval[1];
- }
- else if (gps->flag & GP_STROKE_2DIMAGE) {
- int offsx, offsy, sizex, sizey;
-
- /* get stored settings */
- sizex= p->im2d_settings.sizex;
- sizey= p->im2d_settings.sizey;
- offsx= p->im2d_settings.offsx;
- offsy= p->im2d_settings.offsy;
-
- /* calculate new points */
- x0= (short)((pt1->x * sizex) + offsx);
- y0= (short)((pt1->y * sizey) + offsy);
-
- x1= (short)((pt2->x * sizex) + offsx);
- y1= (short)((pt2->y * sizey) + offsy);
- }
- else {
- x0= (short)(pt1->x / 1000 * p->sa->winx);
- y0= (short)(pt1->y / 1000 * p->sa->winy);
- x1= (short)(pt2->x / 1000 * p->sa->winx);
- y1= (short)(pt2->y / 1000 * p->sa->winy);
- }
-
- /* check that point segment of the boundbox of the eraser stroke */
- if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) {
- /* check if point segment of stroke had anything to do with
- * eraser region (either within stroke painted, or on its lines)
- * - this assumes that linewidth is irrelevant
- */
- if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) {
- /* if function returns true, break this loop (as no more point to check) */
- if (gp_stroke_eraser_splitdel(gpf, gps, i))
- break;
- }
- }
- }
- }
-}
-
-/* erase strokes which fall under the eraser strokes */
-static void gp_stroke_doeraser (tGPsdata *p)
-{
- bGPDframe *gpf= p->gpf;
- bGPDstroke *gps, *gpn;
- rcti rect;
-
- /* rect is rectangle of eraser */
- rect.xmin= p->mval[0] - p->radius;
- rect.ymin= p->mval[1] - p->radius;
- rect.xmax= p->mval[0] + p->radius;
- rect.ymax= p->mval[1] + p->radius;
-
- /* loop over strokes, checking segments for intersections */
- for (gps= gpf->strokes.first; gps; gps= gpn) {
- gpn= gps->next;
- gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps);
- }
-}
-
-/* ---------- 'Paint' Tool ------------ */
-
-/* init new painting session */
-static void gp_session_initpaint (tGPsdata *p)
-{
- /* clear previous data (note: is on stack) */
- memset(p, 0, sizeof(tGPsdata));
-
- /* make sure the active view (at the starting time) is a 3d-view */
- if (curarea == NULL) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No active view for painting \n");
- return;
- }
- switch (curarea->spacetype) {
- /* supported views first */
- case SPACE_VIEW3D:
- {
- View3D *v3d= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
-
- /* check that gpencil data is allowed to be drawn */
- if ((v3d->flag2 & V3D_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- case SPACE_NODE:
- {
- SpaceNode *snode= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
- p->v2d= &snode->v2d;
-
- /* check that gpencil data is allowed to be drawn */
- if ((snode->flag & SNODE_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= curarea->spacedata.first;
-
- /* set current area */
- p->sa= curarea;
- p->v2d= &sseq->v2d;
-
- /* check that gpencil data is allowed to be drawn */
- if (sseq->mainb == 0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n");
- return;
- }
- if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- case SPACE_IMAGE:
- {
- SpaceImage *sima= curarea->spacedata.first;
-
- /* set the current area */
- p->sa= curarea;
- p->v2d= &sima->v2d;
- p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
-
- /* check that gpencil data is allowed to be drawn */
- if ((sima->flag & SI_DISPGP)==0) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: In active view, Grease Pencil not shown \n");
- return;
- }
- }
- break;
- /* unsupported views */
- default:
- {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Active view not appropriate for Grease Pencil drawing \n");
- return;
- }
- break;
- }
-
- /* get gp-data */
- p->gpd= gpencil_data_getactive(p->sa);
- if (p->gpd == NULL) {
- short ok;
-
- p->gpd= gpencil_data_addnew();
- ok= gpencil_data_setactive(p->sa, p->gpd);
-
- /* most of the time, the following check isn't needed */
- if (ok == 0) {
- /* free gpencil data as it can't be used */
- free_gpencil_data(p->gpd);
- p->gpd= NULL;
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Could not assign newly created Grease Pencil data to active area \n");
- return;
- }
- }
-
- /* set edit flags */
- G.f |= G_GREASEPENCIL;
-
- /* clear out buffer (stored in gp-data) in case something contaminated it */
- gp_session_validatebuffer(p);
-
- /* set 'default' im2d_settings just in case something that uses this doesn't set it */
- p->im2d_settings.sizex= 1;
- p->im2d_settings.sizey= 1;
-}
-
-/* cleanup after a painting session */
-static void gp_session_cleanup (tGPsdata *p)
-{
- bGPdata *gpd= p->gpd;
-
- /* error checking */
- if (gpd == NULL)
- return;
-
- /* free stroke buffer */
- if (gpd->sbuffer) {
- MEM_freeN(gpd->sbuffer);
- gpd->sbuffer= NULL;
- }
-
- /* clear flags */
- gpd->sbuffer_size= 0;
- gpd->sbuffer_sflag= 0;
-}
-
-/* init new stroke */
-static void gp_paint_initstroke (tGPsdata *p, short paintmode)
-{
- /* get active layer (or add a new one if non-existent) */
- p->gpl= gpencil_layer_getactive(p->gpd);
- if (p->gpl == NULL)
- p->gpl= gpencil_layer_addnew(p->gpd);
- if (p->gpl->flag & GP_LAYER_LOCKED) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: Cannot paint on locked layer \n");
- return;
- }
-
- /* get active frame (add a new one if not matching frame) */
- p->gpf= gpencil_layer_getframe(p->gpl, CFRA, 1);
- if (p->gpf == NULL) {
- p->status= GP_STATUS_ERROR;
- if (G.f & G_DEBUG)
- printf("Error: No frame created (gpencil_paint_init) \n");
- return;
- }
- else
- p->gpf->flag |= GP_FRAME_PAINT;
-
- /* set 'eraser' for this stroke if using eraser */
- p->paintmode= paintmode;
- if (p->paintmode == GP_PAINTMODE_ERASER)
- p->gpd->sbuffer_sflag |= GP_STROKE_ERASER;
-
- /* check if points will need to be made in view-aligned space */
- if (p->gpd->flag & GP_DATA_VIEWALIGN) {
- switch (p->sa->spacetype) {
- case SPACE_VIEW3D:
- {
- float *fp= give_cursor();
- initgrabz(fp[0], fp[1], fp[2]);
-
- p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE;
- }
- break;
- case SPACE_NODE:
- {
- p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
- }
- break;
- case SPACE_SEQ:
- {
- SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first;
- int rectx, recty;
- float zoom, zoomx, zoomy;
-
- /* set draw 2d-stroke flag */
- p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE;
-
- /* calculate zoom factor */
- zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom));
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp);
- zoomy = zoom;
- }
- else
- zoomx = zoomy = zoom;
-
- /* calculate rect size to use to calculate the size of the drawing area
- * - We use the size of the output image not the size of the ibuf being shown
- * as it is too messy getting the ibuf (and could be too slow). This should be
- * a reasonable for most cases anyway.
- */
- rectx= (G.scene->r.size * G.scene->r.xsch) / 100;
- recty= (G.scene->r.size * G.scene->r.ysch) / 100;
-
- /* set offset and scale values for opertations to use */
- p->im2d_settings.sizex= (int)(zoomx * rectx);
- p->im2d_settings.sizey= (int)(zoomy * recty);
- p->im2d_settings.offsx= (int)((p->sa->winx-p->im2d_settings.sizex)/2 + sseq->xof);
- p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof);
- }
- break;
- case SPACE_IMAGE:
- {
- /* check if any ibuf available */
- if (p->ibuf)
- p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
- }
- break;
- }
- }
-}
-
-/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */
-static void gp_paint_strokeend (tGPsdata *p)
-{
- /* check if doing eraser or not */
- if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) {
- /* smooth stroke before transferring? */
- gp_stroke_smooth(p);
-
- /* simplify stroke before transferring? */
- gp_stroke_simplify(p);
-
- /* transfer stroke to frame */
- gp_stroke_newfrombuffer(p);
- }
-
- /* clean up buffer now */
- gp_session_validatebuffer(p);
-}
-
-/* finish off stroke painting operation */
-static void gp_paint_cleanup (tGPsdata *p)
-{
- /* finish off a stroke */
- gp_paint_strokeend(p);
-
- /* "unlock" frame */
- p->gpf->flag &= ~GP_FRAME_PAINT;
-
- /* add undo-push so stroke can be undone */
- /* FIXME: currently disabled, as it's impossible to get this working nice
- * as gpenci data is on currently screen-level (which isn't saved to undo files)
- */
- //BIF_undo_push("GPencil Stroke");
-
- /* force redraw after drawing action */
- force_draw_plus(SPACE_ACTION, 0);
-}
-
-/* -------- */
-
-/* main call to paint a new stroke */
-short gpencil_paint (short mousebutton, short paintmode)
-{
- tGPsdata p;
- short ok = GP_STROKEADD_NORMAL;
-
- /* init paint-data */
- gp_session_initpaint(&p);
- if (p.status == GP_STATUS_ERROR) {
- gp_session_cleanup(&p);
- return 0;
- }
- gp_paint_initstroke(&p, paintmode);
- if (p.status == GP_STATUS_ERROR) {
- gp_session_cleanup(&p);
- return 0;
- }
-
- /* set cursor to indicate drawing */
- setcursor_space(p.sa->spacetype, CURSOR_VPAINT);
-
- /* init drawing-device settings */
- getmouseco_areawin(p.mval);
- p.pressure = get_pressure();
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
-
- /* radius for eraser circle is defined in userprefs now */
- // TODO: make this more easily tweaked...
- p.radius= U.gp_eraser;
-
- /* start drawing eraser-circle (if applicable) */
- if (paintmode == GP_PAINTMODE_ERASER)
- draw_sel_circle(p.mval, NULL, p.radius, p.radius, 0); // draws frontbuffer, but sets backbuf again
-
- /* only allow painting of single 'dots' if:
- * - pressure is not excessive (as it can be on some windows tablets)
- * - draw-mode for active datablock is turned on
- * - not erasing
- */
- if (paintmode != GP_PAINTMODE_ERASER) {
- if (!(p.pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) {
- gp_stroke_addpoint(&p, p.mval, p.pressure);
- }
- }
-
- /* paint loop */
- do {
- /* get current user input */
- getmouseco_areawin(p.mval);
- p.pressure = get_pressure();
-
- /* only add current point to buffer if mouse moved (otherwise wait until it does) */
- if (paintmode == GP_PAINTMODE_ERASER) {
- /* do 'live' erasing now */
- gp_stroke_doeraser(&p);
-
- draw_sel_circle(p.mval, p.mvalo, p.radius, p.radius, 0);
- force_draw(0);
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
- }
- else if (gp_stroke_filtermval(&p, p.mval, p.mvalo)) {
- /* try to add point */
- ok= gp_stroke_addpoint(&p, p.mval, p.pressure);
-
- /* handle errors while adding point */
- if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) {
- /* finish off old stroke */
- gp_paint_strokeend(&p);
-
- /* start a new stroke, starting from previous point */
- gp_stroke_addpoint(&p, p.mvalo, p.opressure);
- ok= gp_stroke_addpoint(&p, p.mval, p.pressure);
- }
- else if (ok == GP_STROKEADD_INVALID) {
- /* the painting operation cannot continue... */
- error("Cannot paint stroke");
- p.status = GP_STATUS_ERROR;
-
- if (G.f & G_DEBUG)
- printf("Error: Grease-Pencil Paint - Add Point Invalid \n");
- break;
- }
- force_draw(0);
-
- p.mvalo[0]= p.mval[0];
- p.mvalo[1]= p.mval[1];
- p.opressure= p.pressure;
- }
- else
- BIF_wait_for_statechange();
-
- /* do mouse checking at the end, so don't check twice, and potentially
- * miss a short tap
- */
- } while (get_mbut() & mousebutton);
-
- /* clear edit flags */
- G.f &= ~G_GREASEPENCIL;
-
- /* restore cursor to indicate end of drawing */
- setcursor_space(p.sa->spacetype, CURSOR_STD);
-
- /* check size of buffer before cleanup, to determine if anything happened here */
- if (paintmode == GP_PAINTMODE_ERASER) {
- ok= 1; /* assume that we did something... */
- draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0);
- }
- else
- ok= p.gpd->sbuffer_size;
-
- /* cleanup */
- gp_paint_cleanup(&p);
- gp_session_cleanup(&p);
-
- /* done! return if a stroke was successfully added */
- return ok;
-}
-
-
-/* All event (loops) handling checking if stroke drawing should be initiated
- * should call this function.
- */
-short gpencil_do_paint (ScrArea *sa, short mbut)
-{
- bGPdata *gpd = gpencil_data_getactive(sa);
- short retval= 0;
-
- /* check if possible to do painting */
- if (gpd == NULL)
- return 0;
-
- /* currently, we will only 'paint' if:
- * 1. draw-mode on gpd is set (for accessibility reasons)
- * a) single dots are only available by this method if a single click is made
- * b) a straight line is drawn if ctrl-modifier is held (check is done when stroke is converted!)
- * 2. if shift-modifier is held + lmb -> 'quick paint'
- *
- * OR
- *
- * draw eraser stroke if:
- * 1. using the eraser on a tablet
- * 2. draw-mode on gpd is set (for accessiblity reasons)
- * (eraser is mapped to right-mouse)
- * 3. Alt + 'select' mouse-button
- * i.e. if LMB = select: Alt-LMB
- * if RMB = select: Alt-RMB
- */
- if (get_activedevice() == 2) {
- /* eraser on a tablet - always try to erase strokes */
- retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
- }
- else if (gpd->flag & GP_DATA_EDITPAINT) {
- /* try to paint/erase */
- if (mbut == L_MOUSE)
- retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW);
- else if (mbut == R_MOUSE)
- retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
- }
- else if (!(gpd->flag & GP_DATA_LMBPLOCK)) {
- /* try to paint/erase as not locked */
- if ((G.qual == LR_SHIFTKEY) && (mbut == L_MOUSE)) {
- retval = gpencil_paint(mbut, GP_PAINTMODE_DRAW);
- }
- else if (G.qual == LR_ALTKEY) {
- if ((U.flag & USER_LMOUSESELECT) && (mbut == L_MOUSE))
- retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
- else if (!(U.flag & USER_LMOUSESELECT) && (mbut == R_MOUSE))
- retval = gpencil_paint(mbut, GP_PAINTMODE_ERASER);
- }
- }
-
- /* return result of trying to paint */
- return retval;
-}
-
-/* ************************************************** */
diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c
deleted file mode 100644
index 7e6b314f296..00000000000
--- a/source/blender/src/hddaudio.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Peter Schlaile <peter [at] schlaile [dot] de> 2005
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <fcntl.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WITH_FFMPEG
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/rational.h>
-#if LIBAVFORMAT_VERSION_INT < (49 << 16)
-#define FFMPEG_OLD_FRAME_RATE 1
-#else
-#define FFMPEG_CODEC_IS_POINTER 1
-#endif
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BIF_editsound.h"
-
-#include "blendef.h"
-
-#ifdef WITH_FFMPEG
-extern void do_init_ffmpeg();
-#endif
-
-struct hdaudio {
- int sample_rate;
- int channels;
- int audioStream;
-
-#ifdef WITH_FFMPEG
- char * filename;
- AVCodec *pCodec;
- AVFormatContext *pFormatCtx;
- AVCodecContext *pCodecCtx;
- int frame_position;
- int frame_duration;
- int frame_alloc_duration;
- int decode_pos;
- int frame_size;
- short * decode_cache;
- short * decode_cache_zero;
- short * resample_cache;
- int decode_cache_size;
- int target_channels;
- int target_rate;
- int resample_samples_written;
- int resample_samples_in;
- ReSampleContext *resampler;
-#else
-
-
-#endif
-};
-
-#ifdef WITH_FFMPEG
-#ifdef FFMPEG_CODEC_IS_POINTER
-static AVCodecContext* get_codec_from_stream(AVStream* stream)
-{
- return stream->codec;
-}
-#else
-static AVCodecContext* get_codec_from_stream(AVStream* stream)
-{
- return &stream->codec;
-}
-#endif
-#endif
-
-struct hdaudio * sound_open_hdaudio(char * filename)
-{
-#ifdef WITH_FFMPEG
- struct hdaudio * rval;
- int i, audioStream;
-
- AVCodec *pCodec;
- AVFormatContext *pFormatCtx;
- AVCodecContext *pCodecCtx;
-
- do_init_ffmpeg();
-
- if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) {
- return 0;
- }
-
- if(av_find_stream_info(pFormatCtx)<0) {
- av_close_input_file(pFormatCtx);
- return 0;
- }
-
- dump_format(pFormatCtx, 0, filename, 0);
-
-
- /* Find the first audio stream */
- audioStream=-1;
- for(i=0; i<pFormatCtx->nb_streams; i++)
- if(get_codec_from_stream(pFormatCtx->streams[i])
- ->codec_type == CODEC_TYPE_AUDIO)
- {
- audioStream=i;
- break;
- }
-
- if(audioStream == -1) {
- av_close_input_file(pFormatCtx);
- return 0;
- }
-
- pCodecCtx = get_codec_from_stream(pFormatCtx->streams[audioStream]);
-
- /* Find the decoder for the audio stream */
- pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
- if(pCodec == NULL) {
- av_close_input_file(pFormatCtx);
- return 0;
- }
-
- if(avcodec_open(pCodecCtx, pCodec)<0) {
- av_close_input_file(pFormatCtx);
- return 0;
- }
-
- if (pCodecCtx->channels > 2) {
- fprintf(stderr, "Sorry, audio file has too many channels."
- " Will fix in future, but resampler doesn't support "
- "this.\n");
- avcodec_close(pCodecCtx);
- av_close_input_file(pFormatCtx);
- return 0;
- }
-
- rval = (struct hdaudio *)MEM_mallocN(sizeof(struct hdaudio),
- "hdaudio struct");
-
- rval->filename = strdup(filename);
- rval->sample_rate = pCodecCtx->sample_rate;
- rval->channels = pCodecCtx->channels;
-
- rval->pFormatCtx = pFormatCtx;
- rval->pCodecCtx = pCodecCtx;
- rval->pCodec = pCodec;
- rval->audioStream = audioStream;
- rval->frame_position = -10;
-
- rval->frame_duration = AV_TIME_BASE / 10;
- rval->frame_alloc_duration = AV_TIME_BASE;
- rval->decode_cache_size =
- (long long) rval->sample_rate * rval->channels
- * rval->frame_alloc_duration / AV_TIME_BASE
- * 2;
-
- rval->decode_cache = (short*) MEM_mallocN(
- rval->decode_cache_size * sizeof(short)
- + AVCODEC_MAX_AUDIO_FRAME_SIZE,
- "hdaudio decode cache");
- rval->decode_cache_zero = rval->decode_cache;
- rval->decode_pos = 0;
- rval->target_channels = -1;
- rval->target_rate = -1;
- rval->resampler = 0;
- rval->resample_cache = 0;
- rval->resample_samples_written = 0;
- rval->resample_samples_in = 0;
- return rval;
-#else
- return 0;
-#endif
-}
-
-struct hdaudio * sound_copy_hdaudio(struct hdaudio * c)
-{
-#ifdef WITH_FFMPEG
- return sound_open_hdaudio(c->filename);
-#else
- return 0;
-#endif
-}
-
-long sound_hdaudio_get_duration(struct hdaudio * hdaudio, double frame_rate)
-{
-#ifdef WITH_FFMPEG
- return hdaudio->pFormatCtx->duration * frame_rate / AV_TIME_BASE;
-#else
- return 0;
-#endif
-}
-
-#ifdef WITH_FFMPEG
-static void sound_hdaudio_extract_small_block(
- struct hdaudio * hdaudio,
- short * target_buffer,
- int sample_position /* units of target_rate */,
- int target_rate,
- int target_channels,
- int nb_samples /* in target */)
-{
- AVPacket packet;
- int frame_position;
- int frame_size = (long long) target_rate
- * hdaudio->frame_duration / AV_TIME_BASE;
- int in_frame_size = (long long) hdaudio->sample_rate
- * hdaudio->frame_duration / AV_TIME_BASE;
- int rate_conversion =
- (target_rate != hdaudio->sample_rate)
- || (target_channels != hdaudio->channels);
- int sample_ofs = target_channels * (sample_position % frame_size);
-
- frame_position = sample_position / frame_size;
-
- if (hdaudio == 0) return;
-
- if (rate_conversion) {
- if (hdaudio->resampler &&
- (hdaudio->target_rate != target_rate
- || hdaudio->target_channels != target_channels)) {
- audio_resample_close(hdaudio->resampler);
- hdaudio->resampler = 0;
- }
- if (!hdaudio->resampler) {
- hdaudio->resampler = audio_resample_init(
- target_channels, hdaudio->channels,
- target_rate, hdaudio->sample_rate);
- hdaudio->target_rate = target_rate;
- hdaudio->target_channels = target_channels;
- if (hdaudio->resample_cache) {
- MEM_freeN(hdaudio->resample_cache);
- }
-
-
- hdaudio->resample_cache = (short*) MEM_mallocN(
- (long long)
- hdaudio->target_channels
- * frame_size * 2
- * sizeof(short),
- "hdaudio resample cache");
- if (frame_position == hdaudio->frame_position) {
- hdaudio->resample_samples_in =
- in_frame_size * 7 / 4;
- hdaudio->resample_samples_written
- = audio_resample(
- hdaudio->resampler,
- hdaudio->resample_cache,
- hdaudio->decode_cache_zero,
- in_frame_size * 7 / 4);
- }
- }
- }
-
- if (frame_position == hdaudio->frame_position + 1
- && in_frame_size * hdaudio->channels <= hdaudio->decode_pos) {
- int bl_size = in_frame_size * hdaudio->channels;
- int decode_pos = hdaudio->decode_pos;
-
- hdaudio->frame_position = frame_position;
-
- memmove(hdaudio->decode_cache,
- hdaudio->decode_cache + bl_size,
- (decode_pos - bl_size) * sizeof(short));
-
- decode_pos -= bl_size;
-
- if (decode_pos < hdaudio->decode_cache_size) {
- memset(hdaudio->decode_cache + decode_pos, 0,
- (hdaudio->decode_cache_size - decode_pos)
- * sizeof(short));
-
- while(av_read_frame(
- hdaudio->pFormatCtx, &packet) >= 0) {
- int data_size;
- int len;
- uint8_t *audio_pkt_data;
- int audio_pkt_size;
-
- if(packet.stream_index
- != hdaudio->audioStream) {
- av_free_packet(&packet);
- continue;
- }
-
- audio_pkt_data = packet.data;
- audio_pkt_size = packet.size;
-
- while (audio_pkt_size > 0) {
- len = avcodec_decode_audio(
- hdaudio->pCodecCtx,
- hdaudio->decode_cache
- + decode_pos,
- &data_size,
- audio_pkt_data,
- audio_pkt_size);
- if (len <= 0) {
- audio_pkt_size = 0;
- break;
- }
-
- audio_pkt_size -= len;
- audio_pkt_data += len;
-
- if (data_size <= 0) {
- continue;
- }
-
- decode_pos += data_size / sizeof(short);
- if (decode_pos + data_size
- / sizeof(short)
- > hdaudio->decode_cache_size) {
- break;
- }
- }
- av_free_packet(&packet);
-
- if (decode_pos + data_size / sizeof(short)
- > hdaudio->decode_cache_size) {
- break;
- }
- }
- }
-
- if (rate_conversion) {
- int written = hdaudio->resample_samples_written
- * target_channels;
- int ofs = target_channels * frame_size;
- int recycle = written - ofs;
- int next_in = in_frame_size
- + (3.0/4.0
- - (double) recycle / (double)
- (frame_size * target_channels)
- ) * in_frame_size;
-
- memmove(hdaudio->resample_cache,
- hdaudio->resample_cache + ofs,
- recycle * sizeof(short));
-
- hdaudio->resample_samples_written
- = audio_resample(
- hdaudio->resampler,
- hdaudio->resample_cache + recycle,
- hdaudio->decode_cache_zero
- + hdaudio->resample_samples_in
- * hdaudio->channels
- - bl_size,
- next_in)
- + recycle / target_channels;
-
- hdaudio->resample_samples_in = next_in;
- }
-
- hdaudio->decode_pos = decode_pos;
- }
-
- if (frame_position != hdaudio->frame_position) {
- long decode_pos = 0;
- long long st_time = hdaudio->pFormatCtx
- ->streams[hdaudio->audioStream]->start_time;
- double time_base =
- av_q2d(hdaudio->pFormatCtx
- ->streams[hdaudio->audioStream]->time_base);
- long long pos = (long long) frame_position * AV_TIME_BASE
- * hdaudio->frame_duration / AV_TIME_BASE;
-
- long long seek_pos;
-
- hdaudio->frame_position = frame_position;
-
- if (st_time == AV_NOPTS_VALUE) {
- st_time = 0;
- }
-
- pos += st_time * AV_TIME_BASE * time_base;
-
- /* seek a little bit before the target position,
- (ffmpeg seek algorithm doesn't seem to work always as
- specified...)
- */
-
- seek_pos = pos - (AV_TIME_BASE
- * hdaudio->frame_duration
- / AV_TIME_BASE / 10);
- if (seek_pos < 0) {
- seek_pos = pos;
- }
-
- av_seek_frame(hdaudio->pFormatCtx, -1,
- seek_pos,
- AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);
- avcodec_flush_buffers(hdaudio->pCodecCtx);
-
- memset(hdaudio->decode_cache, 0,
- hdaudio->decode_cache_size * sizeof(short));
-
- hdaudio->decode_cache_zero = hdaudio->decode_cache;
-
- while(av_read_frame(hdaudio->pFormatCtx, &packet) >= 0) {
- int data_size;
- int len;
- uint8_t *audio_pkt_data;
- int audio_pkt_size;
-
- if(packet.stream_index != hdaudio->audioStream) {
- av_free_packet(&packet);
- continue;
- }
-
- audio_pkt_data = packet.data;
- audio_pkt_size = packet.size;
-
- if (!hdaudio->decode_cache_zero
- && audio_pkt_size > 0) {
- long long diff;
-
- if (packet.pts == AV_NOPTS_VALUE) {
- fprintf(stderr,
- "hdaudio: audio "
- "pts=NULL audio "
- "distortion!\n");
- diff = 0;
- } else {
- long long pts = packet.pts;
- long long spts = (long long) (
- pos / time_base / AV_TIME_BASE
- + 0.5);
- diff = spts - pts;
- if (diff < 0) {
- fprintf(stderr,
- "hdaudio: "
- "negative seek: "
- "%lld < %lld "
- "(pos=%lld) "
- "audio distortion!!\n",
- spts, pts, pos);
- diff = 0;
- }
- }
-
-
- diff *= hdaudio->sample_rate * time_base;
- diff *= hdaudio->channels;
-
- if (diff > hdaudio->decode_cache_size / 2) {
- fprintf(stderr,
- "hdaudio: audio "
- "diff too large!!\n");
- diff = 0;
- }
-
- hdaudio->decode_cache_zero
- = hdaudio->decode_cache + diff;
- }
-
- while (audio_pkt_size > 0) {
- len = avcodec_decode_audio(
- hdaudio->pCodecCtx,
- hdaudio->decode_cache
- + decode_pos,
- &data_size,
- audio_pkt_data,
- audio_pkt_size);
- if (len <= 0) {
- audio_pkt_size = 0;
- break;
- }
-
- audio_pkt_size -= len;
- audio_pkt_data += len;
-
- if (data_size <= 0) {
- continue;
- }
-
- decode_pos += data_size / sizeof(short);
- if (decode_pos + data_size
- / sizeof(short)
- > hdaudio->decode_cache_size) {
- break;
- }
- }
-
- av_free_packet(&packet);
-
- if (decode_pos + data_size / sizeof(short)
- > hdaudio->decode_cache_size) {
- break;
- }
- }
- if (rate_conversion) {
- hdaudio->resample_samples_written
- = audio_resample(hdaudio->resampler,
- hdaudio->resample_cache,
- hdaudio->decode_cache_zero,
- in_frame_size * 7 / 4);
- hdaudio->resample_samples_in =
- in_frame_size * 7 / 4;
- }
- hdaudio->decode_pos = decode_pos;
- }
-
- memcpy(target_buffer, (rate_conversion
- ? hdaudio->resample_cache
- : hdaudio->decode_cache_zero) + sample_ofs,
- nb_samples * target_channels * sizeof(short));
-}
-#endif
-
-
-void sound_hdaudio_extract(struct hdaudio * hdaudio,
- short * target_buffer,
- int sample_position /* units of target_rate */,
- int target_rate,
- int target_channels,
- int nb_samples /* in target */)
-{
-#ifdef WITH_FFMPEG
- long long max_samples = (long long) target_rate
- * hdaudio->frame_duration / AV_TIME_BASE / 4;
-
- while (nb_samples > max_samples) {
- sound_hdaudio_extract_small_block(hdaudio, target_buffer,
- sample_position,
- target_rate,
- target_channels,
- max_samples);
- target_buffer += max_samples * target_channels;
- sample_position += max_samples;
- nb_samples -= max_samples;
- }
- if (nb_samples > 0) {
- sound_hdaudio_extract_small_block(hdaudio, target_buffer,
- sample_position,
- target_rate,
- target_channels,
- nb_samples);
- }
-#else
-
-#endif
-}
-
-void sound_close_hdaudio(struct hdaudio * hdaudio)
-{
-#ifdef WITH_FFMPEG
-
- if (hdaudio) {
- avcodec_close(hdaudio->pCodecCtx);
- av_close_input_file(hdaudio->pFormatCtx);
- MEM_freeN (hdaudio->decode_cache);
- if (hdaudio->resample_cache) {
- MEM_freeN(hdaudio->resample_cache);
- }
- free(hdaudio->filename);
- MEM_freeN (hdaudio);
- }
-#else
-
-#endif
-}
-
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
deleted file mode 100644
index 0cd5fcba271..00000000000
--- a/source/blender/src/header_action.c
+++ /dev/null
@@ -1,1789 +0,0 @@
-/**
- * header_action.c oct-2003
- *
- * Functions to draw the "Action Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): 2007, Joshua Leung (Action Editor recode)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ID.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_editaction.h"
-#include "BIF_interface.h"
-#include "BIF_language.h"
-#include "BIF_poseobject.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-
-#include "BDR_drawaction.h"
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "nla.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-/* ------------------------------- */
-/* enums declaring constants that are used as menu event codes */
-
-enum {
- ACTMENU_VIEW_CENTERVIEW= 0,
- ACTMENU_VIEW_AUTOUPDATE,
- ACTMENU_VIEW_PLAY3D,
- ACTMENU_VIEW_PLAYALL,
- ACTMENU_VIEW_ALL,
- ACTMENU_VIEW_MAXIMIZE,
- ACTMENU_VIEW_LOCK,
- ACTMENU_VIEW_SLIDERS,
- ACTMENU_VIEW_NEXTMARKER,
- ACTMENU_VIEW_PREVMARKER,
- ACTMENU_VIEW_NEXTKEYFRAME,
- ACTMENU_VIEW_PREVKEYFRAME,
- ACTMENU_VIEW_TIME,
- ACTMENU_VIEW_NOHIDE,
- ACTMENU_VIEW_TRANSDELDUPS,
- ACTMENU_VIEW_HORIZOPTIMISE,
- ACTMENU_VIEW_GCOLORS,
- ACTMENU_VIEW_PREVRANGESET,
- ACTMENU_VIEW_PREVRANGECLEAR,
- ACTMENU_VIEW_PREVRANGEAUTO
-};
-
-enum {
- ACTMENU_SEL_BORDER = 0,
- ACTMENU_SEL_BORDERC,
- ACTMENU_SEL_BORDERM,
- ACTMENU_SEL_ALL_KEYS,
- ACTMENU_SEL_ALL_CHAN,
- ACTMENU_SEL_ALL_MARKERS,
- ACTMENU_SEL_INVERSE_KEYS,
- ACTMENU_SEL_INVERSE_MARKERS,
- ACTMENU_SEL_INVERSE_CHANNELS,
- ACTMENU_SEL_LEFTKEYS,
- ACTMENU_SEL_RIGHTKEYS
-};
-
-enum {
- ACTMENU_SEL_COLUMN_KEYS = 1,
- ACTMENU_SEL_COLUMN_CFRA,
- ACTMENU_SEL_COLUMN_MARKERSCOLUMN,
- ACTMENU_SEL_COLUMN_MARKERSBETWEEN
-};
-
-enum {
- ACTMENU_CHANNELS_OPENLEVELS = 0,
- ACTMENU_CHANNELS_CLOSELEVELS,
- ACTMENU_CHANNELS_EXPANDALL,
- ACTMENU_CHANNELS_SHOWACHANS,
- ACTMENU_CHANNELS_DELETE
-};
-
-enum {
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP = 0,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM
-};
-
-enum {
- ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE = 0,
- ACTMENU_CHANNELS_GROUP_ADD_TONEW,
- ACTMENU_CHANNELS_GROUP_REMOVE,
- ACTMENU_CHANNELS_GROUP_SYNCPOSE
-};
-
-enum {
- ACTMENU_CHANNELS_SETTINGS_TOGGLE = 0,
- ACTMENU_CHANNELS_SETTINGS_ENABLE,
- ACTMENU_CHANNELS_SETTINGS_DISABLE,
-};
-
-enum {
- ACTMENU_KEY_DUPLICATE = 0,
- ACTMENU_KEY_DELETE,
- ACTMENU_KEY_CLEAN,
- ACTMENU_KEY_SAMPLEKEYS,
- ACTMENU_KEY_INSERTKEY
-};
-
-enum {
- ACTMENU_KEY_TRANSFORM_MOVE = 0,
- ACTMENU_KEY_TRANSFORM_SCALE,
- ACTMENU_KEY_TRANSFORM_SLIDE,
- ACTMENU_KEY_TRANSFORM_EXTEND
-};
-
-enum {
- ACTMENU_KEY_HANDLE_AUTO = 0,
- ACTMENU_KEY_HANDLE_ALIGN,
- ACTMENU_KEY_HANDLE_FREE,
- ACTMENU_KEY_HANDLE_VECTOR
-};
-
-enum {
- ACTMENU_KEY_INTERP_CONST = 0,
- ACTMENU_KEY_INTERP_LINEAR,
- ACTMENU_KEY_INTERP_BEZIER
-};
-
-enum {
- ACTMENU_KEY_EXTEND_CONST = 0,
- ACTMENU_KEY_EXTEND_EXTRAPOLATION,
- ACTMENU_KEY_EXTEND_CYCLIC,
- ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION
-};
-
-enum {
- ACTMENU_KEY_SNAP_NEARFRAME = 1,
- ACTMENU_KEY_SNAP_CURFRAME,
- ACTMENU_KEY_SNAP_NEARMARK,
- ACTMENU_KEY_SNAP_NEARTIME,
- ACTMENU_KEY_SNAP_CFRA2KEY,
-};
-
-enum {
- ACTMENU_KEY_MIRROR_CURFRAME = 1,
- ACTMENU_KEY_MIRROR_YAXIS,
- ACTMENU_KEY_MIRROR_XAXIS,
- ACTMENU_KEY_MIRROR_MARKER
-};
-
-enum {
- ACTMENU_MARKERS_ADD = 0,
- ACTMENU_MARKERS_DUPLICATE,
- ACTMENU_MARKERS_DELETE,
- ACTMENU_MARKERS_NAME,
- ACTMENU_MARKERS_MOVE,
- ACTMENU_MARKERS_LOCALADD,
- ACTMENU_MARKERS_LOCALRENAME,
- ACTMENU_MARKERS_LOCALDELETE,
- ACTMENU_MARKERS_LOCALMOVE
-};
-
-/* ------------------------------- */
-/* macros for easier state testing (only for use here) */
-
-/* test if active action editor is showing any markers */
-#define G_SACTION_HASMARKERS \
- ((G.saction->action && G.saction->action->markers.first) \
- || (G.scene->markers.first))
-
-/* ------------------------------- */
-
-void do_action_buttons(unsigned short event)
-{
- Object *ob= OBACT;
-
- switch(event) {
- case B_ACTHOME: /* HOMEKEY in Action Editor */
- /* Find X extents */
- G.v2d->cur.xmin = 0;
- G.v2d->cur.ymin=-SCROLLB;
-
- if (G.saction->action) {
- float extra;
-
- calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0);
- if (G.saction->pin==0 && ob) {
- G.v2d->cur.xmin= get_action_frame_inv(ob, G.v2d->cur.xmin);
- G.v2d->cur.xmax= get_action_frame_inv(ob, G.v2d->cur.xmax);
- }
- extra= 0.05*(G.v2d->cur.xmax - G.v2d->cur.xmin);
- G.v2d->cur.xmin-= extra;
- G.v2d->cur.xmax+= extra;
-
- if (G.v2d->cur.xmin==G.v2d->cur.xmax) {
- G.v2d->cur.xmax= -5;
- G.v2d->cur.xmax= 100;
- }
- }
- else { /* shapekeys and/or no action */
- G.v2d->cur.xmin= -5.0;
- G.v2d->cur.xmax= 65.0;
- }
-
- G.v2d->cur.ymin= -75.0;
- G.v2d->cur.ymax= 5.0;
-
- G.v2d->tot= G.v2d->cur;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
-
- addqueue (curarea->win, REDRAW, 1);
-
- break;
-
- /* copy/paste/paste-flip buttons in 3d-view header in PoseMode */
- case B_ACTCOPY:
- copy_posebuf();
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_ACTPASTE:
- paste_posebuf(0);
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_ACTPASTEFLIP:
- paste_posebuf(1);
- allqueue(REDRAWVIEW3D, 1);
- break;
-
- /* copy/paste buttons in Action Editor header */
- case B_ACTCOPYKEYS:
- if (G.saction->mode == SACTCONT_GPENCIL)
- copy_gpdata();
- else
- copy_actdata();
- break;
- case B_ACTPASTEKEYS:
- if (G.saction->mode == SACTCONT_GPENCIL)
- paste_gpdata();
- else
- paste_actdata();
- break;
-
- case B_ACTPIN: /* __PINFAKE */
-/* if (G.saction->flag & SACTION_PIN) {
- if (G.saction->action)
- G.saction->action->id.us ++;
- }
- else {
- if (G.saction->action)
- G.saction->action->id.us --;
- }
-*/ /* end PINFAKE */
- allqueue(REDRAWACTION, 1);
- break;
- }
-}
-
-static void do_action_viewmenu(void *arg, int event)
-{
- extern int play_anim(int mode);
-
- switch(event) {
- case ACTMENU_VIEW_CENTERVIEW: /* Center View to Current Frame */
- center_currframe();
- break;
- case ACTMENU_VIEW_AUTOUPDATE: /* Update Automatically */
- if (BTST(G.saction->lock, 0))
- G.saction->lock = BCLR(G.saction->lock, 0);
- else
- G.saction->lock = BSET(G.saction->lock, 0);
- break;
- case ACTMENU_VIEW_PLAY3D: /* Play Back Animation */
- play_anim(0);
- break;
- case ACTMENU_VIEW_PLAYALL: /* Play Back Animation in All */
- play_anim(1);
- break;
- case ACTMENU_VIEW_ALL: /* View All */
- do_action_buttons(B_ACTHOME);
- break;
- case ACTMENU_VIEW_LOCK:
- G.v2d->flag ^= V2D_VIEWLOCK;
- if (G.v2d->flag & V2D_VIEWLOCK)
- view2d_do_locks(curarea, 0);
- break;
- case ACTMENU_VIEW_SLIDERS: /* Show sliders (when applicable) */
- G.saction->flag ^= SACTION_SLIDERS;
- break;
- case ACTMENU_VIEW_MAXIMIZE: /* Maximize Window */
- /* using event B_FULL */
- break;
- case ACTMENU_VIEW_NEXTMARKER: /* Jump to next marker */
- nextprev_marker(1);
- break;
- case ACTMENU_VIEW_PREVMARKER: /* Jump to previous marker */
- nextprev_marker(-1);
- break;
- case ACTMENU_VIEW_TIME: /* switch between frames and seconds display */
- G.saction->flag ^= SACTION_DRAWTIME;
- break;
- case ACTMENU_VIEW_NOHIDE: /* Show hidden channels */
- G.saction->flag ^= SACTION_NOHIDE;
- break;
- case ACTMENU_VIEW_NEXTKEYFRAME: /* Jump to next keyframe */
- nextprev_action_keyframe(1);
- break;
- case ACTMENU_VIEW_PREVKEYFRAME: /* Jump to previous keyframe */
- nextprev_action_keyframe(-1);
- break;
- case ACTMENU_VIEW_TRANSDELDUPS: /* Don't delete duplicate/overlapping keyframes after transform */
- G.saction->flag ^= SACTION_NOTRANSKEYCULL;
- break;
- case ACTMENU_VIEW_HORIZOPTIMISE: /* Include keyframes not in view (horizontally) when preparing to draw */
- G.saction->flag ^= SACTION_HORIZOPTIMISEON;
- break;
- case ACTMENU_VIEW_GCOLORS: /* Draw grouped-action channels using its group's color */
- G.saction->flag ^= SACTION_NODRAWGCOLORS;
- break;
- case ACTMENU_VIEW_PREVRANGESET: /* Set preview range */
- anim_previewrange_set();
- break;
- case ACTMENU_VIEW_PREVRANGECLEAR: /* Clear preview range */
- anim_previewrange_clear();
- break;
- case ACTMENU_VIEW_PREVRANGEAUTO: /* Auto preview-range length */
- action_previewrange_set(G.saction->action);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *action_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_viewmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Center View to Current Frame|C", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_CENTERVIEW, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.saction->flag & SACTION_DRAWTIME) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Show Frames|Ctrl T", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_TIME, "");
- }
- else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Show Seconds|Ctrl T", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_TIME, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.saction->mode == SACTCONT_GPENCIL) {
- // this option may get removed in future
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Cull Out-of-View Keys (Time)|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_HORIZOPTIMISE, "");
- }
- else {
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Show Sliders|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_SLIDERS, "");
-
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Show Hidden Channels|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_NOHIDE, "");
-
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT,
- "Use Group Colors|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_GCOLORS, "");
-
- // this option may get removed in future
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Cull Out-of-View Keys (Time)|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_HORIZOPTIMISE, "");
-
- uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT,
- "AutoMerge Keyframes|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_TRANSDELDUPS, "");
- }
-
-
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_LOCK, "");
-
- uiDefIconTextBut(block, BUTM, 1, BTST(G.saction->lock, 0)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Update Automatically|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_AUTOUPDATE, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Jump To Next Marker|PageUp", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTMARKER, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Jump To Prev Marker|PageDown", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVMARKER, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Jump To Next Keyframe|Ctrl PageUp", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTKEYFRAME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Jump To Prev Keyframe|Ctrl PageDown", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVKEYFRAME, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Play Back Animation|Alt A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_PLAY3D, "");
- //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- // "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20,
- // menuwidth, 19, NULL, 0.0, 0.0, 1,
- // ACTMENU_VIEW_PLAYALL, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Set Preview Range|Ctrl P", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_PREVRANGESET, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Clear Preview Range|Alt P", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_PREVRANGECLEAR, "");
-
- if ((G.saction->mode == SACTCONT_ACTION) && (G.saction->action)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Preview Range from Action Length|Ctrl Alt P", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_PREVRANGEAUTO, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "View All|Home", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1,
- ACTMENU_VIEW_ALL, "");
-
- if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1,
- "Maximize Window|Ctrl UpArrow", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_VIEW_MAXIMIZE, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1,
- "Tile Window|Ctrl DownArrow", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_VIEW_MAXIMIZE, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_action_selectmenu_columnmenu(void *arg, int event)
-{
- switch (event) {
- case ACTMENU_SEL_COLUMN_MARKERSBETWEEN:
- markers_selectkeys_between();
- break;
- case ACTMENU_SEL_COLUMN_KEYS:
- column_select_action_keys(1);
- break;
- case ACTMENU_SEL_COLUMN_MARKERSCOLUMN:
- column_select_action_keys(2);
- break;
- case ACTMENU_SEL_COLUMN_CFRA:
- column_select_action_keys(3);
- break;
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *action_selectmenu_columnmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_selectmenu_columnmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_selectmenu_columnmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "On Selected Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_COLUMN_KEYS, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "On Current Frame|Ctrl K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_COLUMN_CFRA, "");
-
- if (G_SACTION_HASMARKERS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_COLUMN_MARKERSCOLUMN, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_COLUMN_MARKERSBETWEEN, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_selectmenu(void *arg, int event)
-{
- SpaceAction *saction;
- bAction *act;
- Key *key;
-
- saction = curarea->spacedata.first;
- if (saction == NULL) return;
-
- act = saction->action;
- key = get_action_mesh_key();
-
- switch(event)
- {
- case ACTMENU_SEL_BORDER: /* Border Select */
- borderselect_action();
- break;
-
- case ACTMENU_SEL_BORDERC: /* Border Select */
- borderselect_actionchannels();
- break;
-
- case ACTMENU_SEL_BORDERM: /* Border Select */
- borderselect_markers();
- break;
-
- case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */
- deselect_action_keys(1, 1);
- BIF_undo_push("(De)Select Keys");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- break;
-
- case ACTMENU_SEL_ALL_CHAN: /* Select/Deselect All Channels */
- deselect_action_channels(1);
- BIF_undo_push("(De)Select Action Channels");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- break;
-
- case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */
- deselect_markers(1, 0);
- BIF_undo_push("(De)Select Markers");
- allqueue(REDRAWMARKER, 0);
- break;
-
- case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */
- deselect_action_keys(0, 2);
- BIF_undo_push("Inverse Keys");
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- break;
-
- case ACTMENU_SEL_INVERSE_CHANNELS: /* invert selection status of channels */
- deselect_action_channels(2);
- BIF_undo_push("Inverse Action Channels");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- break;
-
- case ACTMENU_SEL_INVERSE_MARKERS: /* invert selection of markers */
- deselect_markers(0, 2);
- BIF_undo_push("Inverse Action Channels");
- allqueue(REDRAWMARKER, 0);
- break;
-
- case ACTMENU_SEL_LEFTKEYS:
- selectkeys_leftright(1, SELECT_REPLACE);
- break;
-
- case ACTMENU_SEL_RIGHTKEYS:
- selectkeys_leftright(0, SELECT_REPLACE);
- break;
- }
-}
-
-static uiBlock *action_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_selectmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Border Select Keys|B", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_BORDER, "");
- if (G_SACTION_HASMARKERS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Border Select Markers|Ctrl B", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_BORDERM, "");
- }
- if (G.saction->mode != SACTCONT_SHAPEKEY) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Border Select Channels|B", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_BORDERC, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Select/Deselect All Keys|A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_ALL_KEYS, "");
- if (G_SACTION_HASMARKERS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Select/Deselect All Markers|Ctrl A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_ALL_MARKERS, "");
- }
- if (G.saction->mode != SACTCONT_SHAPEKEY) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Select/Deselect All Channels|A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_ALL_CHAN, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Inverse Keys|Ctrl I", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_INVERSE_KEYS, "");
- if (G_SACTION_HASMARKERS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Inverse Markers|Ctrl Shift I", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_INVERSE_MARKERS, "");
- }
- if (G.saction->mode != SACTCONT_SHAPEKEY) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Inverse All Channels|Ctrl I", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_INVERSE_CHANNELS, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Back In Time|Alt RMB", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_LEFTKEYS, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Ahead In Time|Alt RMB", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_SEL_RIGHTKEYS, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, action_selectmenu_columnmenu,
- NULL, ICON_RIGHTARROW_THIN, "Column Select Keys", 0, yco-=20, 120, 20, "");
-
- if (curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-
-static void do_action_channelmenu_posmenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN:
- rearrange_action_channels(REARRANGE_ACTCHAN_DOWN);
- break;
- case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP:
- rearrange_action_channels(REARRANGE_ACTCHAN_UP);
- break;
- case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP:
- rearrange_action_channels(REARRANGE_ACTCHAN_TOP);
- break;
- case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM:
- rearrange_action_channels(REARRANGE_ACTCHAN_BOTTOM);
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_channelmenu_posmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_channelmenu_posmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_channelmenu_posmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Move Up|Shift Page Up", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Move Down|Shift Page Down", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Move to Top|Ctrl Shift Page Up", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Move to Bottom|Ctrl Shift Page Down", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_channelmenu_groupmenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE:
- action_groups_group(0);
- break;
- case ACTMENU_CHANNELS_GROUP_ADD_TONEW:
- action_groups_group(1);
- break;
- case ACTMENU_CHANNELS_GROUP_REMOVE:
- action_groups_ungroup();
- break;
- case ACTMENU_CHANNELS_GROUP_SYNCPOSE: /* Syncronise Pose-data and Action-data */
- sync_pchan2achan_grouping();
- break;
- }
-}
-
-static uiBlock *action_channelmenu_groupmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_channelmenu_groupmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_channelmenu_groupmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Add to Active Group|Shift G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Add to New Group|Ctrl Shift G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_GROUP_ADD_TONEW, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Remove From Group|Alt G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_GROUP_REMOVE, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Synchronise with Armature", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_GROUP_SYNCPOSE, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_channelmenu_settingsmenu(void *arg, int event)
-{
- setflag_action_channels(event);
-}
-
-static uiBlock *action_channelmenu_settingsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_channelmenu_settingsmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_channelmenu_settingsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Toggle a Setting|Shift W", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_SETTINGS_TOGGLE, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Enable a Setting|Ctrl Shift W", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_SETTINGS_ENABLE, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Disable a Setting|Alt W", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_CHANNELS_SETTINGS_DISABLE, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_channelmenu(void *arg, int event)
-{
- SpaceAction *saction;
-
- saction = curarea->spacedata.first;
- if (saction == NULL) return;
-
- switch(event)
- {
- case ACTMENU_CHANNELS_OPENLEVELS: /* Unfold selected channels one step */
- openclose_level_action(1);
- break;
- case ACTMENU_CHANNELS_CLOSELEVELS: /* Fold selected channels one step */
- openclose_level_action(-1);
- break;
- case ACTMENU_CHANNELS_EXPANDALL: /* Expands all channels */
- expand_all_action();
- break;
- case ACTMENU_CHANNELS_SHOWACHANS: /* Unfold groups that are hiding selected achans */
- expand_obscuregroups_action();
- break;
- case ACTMENU_CHANNELS_DELETE: /* Deletes selected channels */
- delete_action_channels();
- break;
- }
-}
-
-static uiBlock *action_channelmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_channelmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_channelmenu, NULL);
-
- uiDefIconTextBlockBut(block, action_channelmenu_groupmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Grouping", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_channelmenu_posmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Ordering", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Settings", 0, yco-=20, 120, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Delete|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Toggle Show Hierachy|~", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_EXPANDALL, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Show Group-Hidden Channels|Shift ~", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_SHOWACHANS, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Expand One Level|Ctrl NumPad+", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_OPENLEVELS, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Collapse One Level|Ctrl NumPad-", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_CLOSELEVELS, "");
-
- if (curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-/* note: uses do_action_channelmenu too... */
-static uiBlock *action_gplayermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_gplayermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_channelmenu, NULL);
-
- uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Settings", 0, yco-=20, 120, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Delete|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, "");
-
- if (curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_action_keymenu_transformmenu(void *arg, int event)
-{
- switch (event)
- {
- case ACTMENU_KEY_TRANSFORM_MOVE:
- transform_action_keys('g', 0);
- break;
- case ACTMENU_KEY_TRANSFORM_SCALE:
- transform_action_keys('s', 0);
- break;
- case ACTMENU_KEY_TRANSFORM_SLIDE:
- transform_action_keys('t', 0);
- break;
- case ACTMENU_KEY_TRANSFORM_EXTEND:
- transform_action_keys('e', 0);
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_keymenu_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_transformmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_TRANSFORM_MOVE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Grab/Extend from Frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_TRANSFORM_EXTEND, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_TRANSFORM_SCALE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Time Slide|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_TRANSFORM_SLIDE, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu_handlemenu(void *arg, int event)
-{
- switch (event) {
- case ACTMENU_KEY_HANDLE_AUTO:
- sethandles_action_keys(HD_AUTO);
- break;
-
- case ACTMENU_KEY_HANDLE_ALIGN:
- case ACTMENU_KEY_HANDLE_FREE:
- /* OK, this is kinda dumb, need to fix the
- * toggle crap in sethandles_ipo_keys()
- */
- sethandles_action_keys(HD_ALIGN);
- break;
-
- case ACTMENU_KEY_HANDLE_VECTOR:
- sethandles_action_keys(HD_VECT);
- break;
- }
-}
-
-static uiBlock *action_keymenu_handlemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_handlemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_handlemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Auto|Shift H", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_HANDLE_AUTO, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Aligned|H", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_HANDLE_ALIGN, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Free|H", 0, yco-=20, menuwidth,
- 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_HANDLE_FREE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Vector|V", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_HANDLE_VECTOR, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu_intpolmenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_KEY_INTERP_CONST:
- action_set_ipo_flags(SET_IPO_MENU, SET_IPO_CONSTANT);
- break;
- case ACTMENU_KEY_INTERP_LINEAR:
- action_set_ipo_flags(SET_IPO_MENU, SET_IPO_LINEAR);
- break;
- case ACTMENU_KEY_INTERP_BEZIER:
- action_set_ipo_flags(SET_IPO_MENU, SET_IPO_BEZIER);
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_keymenu_intpolmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_intpolmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_intpolmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Constant|Shift T, 1", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_INTERP_CONST, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Linear|Shift T, 2", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_INTERP_LINEAR, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Bezier|Shift T, 3", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_INTERP_BEZIER, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu_extendmenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_KEY_EXTEND_CONST:
- action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CONSTANT);
- break;
- case ACTMENU_KEY_EXTEND_EXTRAPOLATION:
- action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_EXTRAPOLATION);
- break;
- case ACTMENU_KEY_EXTEND_CYCLIC:
- action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLIC);
- break;
- case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION:
- action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLICEXTRAPOLATION);
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_keymenu_extendmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_extendmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_extendmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Constant", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_EXTEND_CONST, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Extrapolation", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_EXTEND_EXTRAPOLATION, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Cyclic", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_EXTEND_CYCLIC, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Cyclic Extrapolation", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu_snapmenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_KEY_SNAP_NEARFRAME:
- case ACTMENU_KEY_SNAP_CURFRAME:
- case ACTMENU_KEY_SNAP_NEARMARK:
- case ACTMENU_KEY_SNAP_NEARTIME:
- snap_action_keys(event);
- break;
-
- case ACTMENU_KEY_SNAP_CFRA2KEY:
- snap_cfra_action();
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_keymenu_snapmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_snapmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_snapmenu, NULL);
-
- if (G.saction->flag & SACTION_DRAWTIME) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Key -> Nearest Second|Shift S, 1", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_NEARTIME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Key -> Current Time|Shift S, 2", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_CURFRAME, "");
-
- }
- else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Key -> Nearest Frame|Shift S, 1", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_NEARFRAME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Key -> Current Frame|Shift S, 2", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_CURFRAME, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Key -> Nearest Marker|Shift S, 3", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_NEARMARK, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Current Frame -> Key|Ctrl Shift S", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SNAP_NEARMARK, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu_mirrormenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_KEY_MIRROR_CURFRAME:
- case ACTMENU_KEY_MIRROR_YAXIS:
- mirror_action_keys(event);
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *action_keymenu_mirrormenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu_mirrormenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_action_keymenu_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Current Frame|Shift M, 1", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_MIRROR_CURFRAME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Vertical Axis|Shift M, 2", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_MIRROR_YAXIS, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Horizontal Axis|Shift M, 3", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_MIRROR_XAXIS, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Selected Marker|Shift M, 4", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_MIRROR_MARKER, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_action_keymenu(void *arg, int event)
-{
- SpaceAction *saction;
- bAction *act;
- Key *key;
-
- saction = curarea->spacedata.first;
- if (!saction) return;
-
- act = saction->action;
- key = get_action_mesh_key();
-
- switch(event)
- {
- case ACTMENU_KEY_DUPLICATE:
- duplicate_action_keys();
- break;
- case ACTMENU_KEY_DELETE:
- delete_action_keys();
- break;
- case ACTMENU_KEY_CLEAN:
- clean_action();
- break;
- case ACTMENU_KEY_SAMPLEKEYS:
- sample_action_keys();
- break;
- case ACTMENU_KEY_INSERTKEY:
- insertkey_action();
- break;
- }
-}
-
-static uiBlock *action_keymenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_keymenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_keymenu, NULL);
-
- uiDefIconTextBlockBut(block, action_keymenu_transformmenu,
- NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_snapmenu,
- NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_mirrormenu,
- NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Insert Key|I", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_INSERTKEY, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Duplicate|Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DUPLICATE, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Delete|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DELETE, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Clean Action|O", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_CLEAN, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Sample Keys|Alt O", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_SAMPLEKEYS, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_handlemenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Handle Type", 0, yco-=20, 120, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_extendmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Extend Mode", 0, yco-=20, 120, 20, "");
- uiDefIconTextBlockBut(block, action_keymenu_intpolmenu,
- NULL, ICON_RIGHTARROW_THIN,
- "Interpolation Mode", 0, yco-=20, 120, 20, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-/* note: uses do_action_keymenu too! */
-static uiBlock *action_framemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_framemenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_keymenu, NULL);
-
- uiDefIconTextBlockBut(block, action_keymenu_transformmenu,
- NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_snapmenu,
- NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBlockBut(block, action_keymenu_mirrormenu,
- NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Duplicate|Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DUPLICATE, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Delete|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DELETE, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_action_markermenu(void *arg, int event)
-{
- switch(event)
- {
- case ACTMENU_MARKERS_ADD:
- add_marker(CFRA);
- break;
- case ACTMENU_MARKERS_DUPLICATE:
- duplicate_marker();
- break;
- case ACTMENU_MARKERS_DELETE:
- remove_marker();
- break;
- case ACTMENU_MARKERS_NAME:
- rename_marker();
- break;
- case ACTMENU_MARKERS_MOVE:
- transform_markers('g', 0);
- break;
-
- case ACTMENU_MARKERS_LOCALADD:
- action_add_localmarker(G.saction->action, CFRA);
- break;
- case ACTMENU_MARKERS_LOCALDELETE:
- action_remove_localmarkers(G.saction->action);
- break;
- case ACTMENU_MARKERS_LOCALRENAME:
- action_rename_localmarker(G.saction->action);
- break;
- case ACTMENU_MARKERS_LOCALMOVE:
- G.saction->flag |= SACTION_POSEMARKERS_MOVE;
- transform_markers('g', 0);
- G.saction->flag &= ~SACTION_POSEMARKERS_MOVE;
- break;
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *action_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "action_markermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_action_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, "");
-
- if (G.saction->mode == SACTCONT_ACTION) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, "");
- }
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void action_buttons(void)
-{
- uiBlock *block;
- short xco, xmax;
- char name[256];
- Object *ob;
- ID *from;
-
- if (G.saction == NULL)
- return;
-
- /* copied from drawactionspace.... */
- // FIXME: do for gpencil too?
- if (!G.saction->pin) {
- if (OBACT)
- G.saction->action = OBACT->action;
- else
- G.saction->action= NULL;
- }
-
- sprintf(name, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, name,
- UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if (area_is_active_area(curarea))
- uiBlockSetCol(block, TH_HEADER);
- else
- uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_ACTION;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco, 0, XIC+10, YIC,
- &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays Current Window Type. "
- "Click for menu of available types.");
-
- xco += XIC + 14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if (curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Show pulldown menus");
- }
- else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if ((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, action_viewmenu, NULL,
- "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, action_selectmenu, NULL,
- "Select", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- if ((G.saction->action) && (G.saction->mode==SACTCONT_ACTION)) {
- xmax= GetButStringLength("Channel");
- uiDefPulldownBut(block, action_channelmenu, NULL,
- "Channel", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
- else if (G.saction->mode==SACTCONT_GPENCIL) {
- xmax= GetButStringLength("Channel");
- uiDefPulldownBut(block, action_gplayermenu, NULL,
- "Channel", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block, action_markermenu, NULL,
- "Marker", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- if (G.saction->mode == SACTCONT_GPENCIL) {
- xmax= GetButStringLength("Frame");
- uiDefPulldownBut(block, action_framemenu, NULL,
- "Frame", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- }
- else {
- xmax= GetButStringLength("Key");
- uiDefPulldownBut(block, action_keymenu, NULL,
- "Key", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* MODE SELECTOR */
- uiDefButC(block, MENU, B_REDR,
- "Editor Mode %t|Action Editor %x0|ShapeKey Editor %x1|Grease Pencil %x2",
- xco,0,90,YIC, &(G.saction->mode), 0, 1, 0, 0,
- "Editing modes for this editor");
-
-
- xco += (90 + 8);
-
- /* MODE-DEPENDENT DRAWING */
- if (G.saction->mode != SACTCONT_GPENCIL) {
- /* NAME ETC */
- ob= OBACT;
- from = (ID *)ob;
-
- xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin,
- B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action,
- from, &(G.saction->actnr), B_ACTALONE,
- B_ACTLOCAL, B_ACTIONDELETE, 0, B_KEEPDATA);
-
- uiClearButLock();
-
- xco += 8;
- }
-
-
- /* COPY PASTE */
- uiBlockBeginAlign(block);
- if (curarea->headertype==HEADERTOP) {
- uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYUP, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer");
- uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer");
- }
- else {
- uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer");
- uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer");
- }
- uiBlockEndAlign(block);
- xco += (XIC + 8);
-
-
- if (G.saction->mode != SACTCONT_GPENCIL) {
- /* draw AUTOSNAP */
- if (G.saction->flag & SACTION_DRAWTIME) {
- uiDefButC(block, MENU, B_REDR,
- "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3",
- xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0,
- "Auto-snapping mode for keyframes when transforming");
- }
- else {
- uiDefButC(block, MENU, B_REDR,
- "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3",
- xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0,
- "Auto-snapping mode for keyframes when transforming");
- }
-
- xco += (70 + 8);
- }
-
- /* draw LOCK */
- uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco, 0, XIC, YIC,
- &(G.saction->lock), 0, 0, 0, 0,
- "Updates other affected window spaces automatically "
- "to reflect changes in real time");
-
- /* always as last */
- curarea->headbutlen = xco + 2*XIC;
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c
deleted file mode 100644
index 1e2890f4f2b..00000000000
--- a/source/blender/src/header_buttonswin.c
+++ /dev/null
@@ -1,732 +0,0 @@
-/**
- * header_buttonswin.c oct-2003
- *
- * Functions to draw the "Buttons Window" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_ID.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-
-#include "BIF_editconstraint.h"
-#include "BIF_interface.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_butspace.h"
-
-#include "BKE_armature.h"
-#include "BKE_blender.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_node.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_headerbuttons.h"
-
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "butspace.h"
-
-Material matcopybuf;
-
-void clear_matcopybuf(void)
-{
- memset(&matcopybuf, 0, sizeof(Material));
-}
-
-void free_matcopybuf(void)
-{
- extern MTex mtexcopybuf; /* buttons.c */
- int a;
-
- for(a=0; a<MAX_MTEX; a++) {
- if(matcopybuf.mtex[a]) {
- MEM_freeN(matcopybuf.mtex[a]);
- matcopybuf.mtex[a]= NULL;
- }
- }
-
- if(matcopybuf.ramp_col) MEM_freeN(matcopybuf.ramp_col);
- if(matcopybuf.ramp_spec) MEM_freeN(matcopybuf.ramp_spec);
-
- matcopybuf.ramp_col= NULL;
- matcopybuf.ramp_spec= NULL;
-
- if(matcopybuf.nodetree) {
- ntreeFreeTree(matcopybuf.nodetree);
- MEM_freeN(matcopybuf.nodetree);
- matcopybuf.nodetree= NULL;
- }
- default_mtex(&mtexcopybuf);
-}
-
-void do_buts_buttons(short event)
-{
- static short matcopied=0;
- MTex *mtex;
- Material *ma;
- ID id;
- int a;
- float dx, dy;
- if(curarea->win==0) return;
-
- switch(event) {
- case B_BUTSHOME:
- uiSetPanel_view2d(curarea);
- G.v2d->cur= G.v2d->tot;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
-
- /* we always put in left/top */
- dy= G.v2d->tot.ymax - G.v2d->cur.ymax;
- G.v2d->cur.ymin += dy;
- G.v2d->cur.ymax += dy;
- dx= G.v2d->tot.xmin - G.v2d->cur.xmin;
- G.v2d->cur.xmin += dx;
- G.v2d->cur.xmax += dx;
-
- scrarea_queue_winredraw(curarea);
- break;
- case B_BUTSPREVIEW:
- BIF_preview_changed(ID_TE);
- G.buts->oldkeypress = 0;
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
- case B_CONTEXT_SWITCH:
- G.buts->oldkeypress = 0;
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
- case B_MATCOPY:
- if(G.buts->lockpoin) {
- ma= G.buts->lockpoin;
- if(matcopied) free_matcopybuf();
-
- memcpy(&matcopybuf, ma, sizeof(Material));
- if(matcopybuf.ramp_col) matcopybuf.ramp_col= MEM_dupallocN(matcopybuf.ramp_col);
- if(matcopybuf.ramp_spec) matcopybuf.ramp_spec= MEM_dupallocN(matcopybuf.ramp_spec);
-
- for(a=0; a<MAX_MTEX; a++) {
- mtex= matcopybuf.mtex[a];
- if(mtex) {
- matcopybuf.mtex[a]= MEM_dupallocN(mtex);
- }
- }
- matcopybuf.nodetree= ntreeCopyTree(ma->nodetree, 0);
- matcopybuf.preview= NULL;
- matcopied= 1;
- }
- break;
- case B_MATPASTE:
- if(matcopied && G.buts->lockpoin) {
- ma= G.buts->lockpoin;
-
- /* free current mat */
- if(ma->ramp_col) MEM_freeN(ma->ramp_col);
- if(ma->ramp_spec) MEM_freeN(ma->ramp_spec);
- for(a=0; a<MAX_MTEX; a++) {
- mtex= ma->mtex[a];
- if(mtex && mtex->tex) mtex->tex->id.us--;
- if(mtex) MEM_freeN(mtex);
- }
-
- if(ma->nodetree) {
- ntreeFreeTree(ma->nodetree);
- MEM_freeN(ma->nodetree);
- }
-
- id= (ma->id);
- memcpy(ma, &matcopybuf, sizeof(Material));
- (ma->id)= id;
-
- if(matcopybuf.ramp_col) ma->ramp_col= MEM_dupallocN(matcopybuf.ramp_col);
- if(matcopybuf.ramp_spec) ma->ramp_spec= MEM_dupallocN(matcopybuf.ramp_spec);
-
- for(a=0; a<MAX_MTEX; a++) {
- mtex= ma->mtex[a];
- if(mtex) {
- ma->mtex[a]= MEM_dupallocN(mtex);
- if(mtex->tex) id_us_plus((ID *)mtex->tex);
- }
- }
-
- ma->nodetree= ntreeCopyTree(matcopybuf.nodetree, 0);
-
- BIF_preview_changed(ID_MA);
- BIF_undo_push("Paste material settings");
- scrarea_queue_winredraw(curarea);
- }
- break;
- }
-}
-
-void buttons_active_id(ID **id, ID **idfrom)
-{
- Object *ob= OBACT;
- Material *ma;
-
- *id= NULL;
- *idfrom= (ID *)ob;
-
- if(G.buts->mainb==CONTEXT_SCENE) {
- int tab= G.buts->tab[CONTEXT_SCENE];
-
- if(tab==TAB_SCENE_RENDER) *id= (ID *)G.scene;
- else if(tab==TAB_SCENE_SOUND) {
- ID *search;
-
- // validate lockpoin, maybe its not a sound
- if (G.buts->lockpoin) {
- search = G.main->sound.first;
- while (search) {
- if (search == G.buts->lockpoin) {
- break;
- }
- search = search->next;
- }
- if (search == NULL) {
- *id = G.main->sound.first;
- } else {
- *id = search;
- }
- }
- else {
- *id = G.main->sound.first;
- }
-
- }
- }
- else if(G.buts->mainb==CONTEXT_SHADING) {
- int tab= G.buts->tab[CONTEXT_SHADING];
-
- if(tab==TAB_SHADING_LAMP) {
- if(ob && ob->type==OB_LAMP) {
- *id= ob->data;
- }
- }
- else if(tab==TAB_SHADING_MAT) {
- if(ob && (ob->type<OB_LAMP) && ob->type) {
- *id= (ID *)give_current_material(ob, ob->actcol);
- *idfrom= material_from(ob, ob->actcol);
- }
- }
- else if(tab==TAB_SHADING_WORLD) {
- *id= (ID *)G.scene->world;
- *idfrom= (ID *)G.scene;
- }
- else if(tab==TAB_SHADING_TEX) {
- MTex *mtex;
-
- if(G.buts->mainbo==G.buts->mainb && G.buts->tabo!=tab) {
- if(G.buts->tabo==TAB_SHADING_LAMP) G.buts->texfrom= 2;
- else if(G.buts->tabo==TAB_SHADING_WORLD) G.buts->texfrom= 1;
- else if(G.buts->tabo==TAB_SHADING_MAT) G.buts->texfrom= 0;
- }
-
- if(G.buts->texfrom==0) {
- if(ob && ob->type<OB_LAMP && ob->type) {
- bNode *node= NULL;
-
- ma= give_current_material(ob, ob->actcol);
- if(ma && ma->use_nodes)
- node= editnode_get_active_idnode(ma->nodetree, ID_TE);
-
- if(node) {
- *idfrom= NULL;
- *id= node->id;
- }
- else {
- ma= editnode_get_active_material(ma);
- *idfrom= (ID *)ma;
- if(ma) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex) *id= (ID *)mtex->tex;
- }
- }
- }
- }
- else if(G.buts->texfrom==1) {
- World *wrld= G.scene->world;
- *idfrom= (ID *)wrld;
- if(wrld) {
- mtex= wrld->mtex[ wrld->texact];
- if(mtex) *id= (ID *)mtex->tex;
- }
- }
- else if(G.buts->texfrom==2) {
- Lamp *la;
- if(ob && ob->type==OB_LAMP) {
- la= ob->data;
- *idfrom= (ID *)la;
- mtex= la->mtex[ la->texact];
- if(mtex) *id= (ID *)mtex->tex;
- }
- }
- else if(G.buts->texfrom==3) {
- if(G.f & G_SCULPTMODE) {
- if(G.scene->sculptdata.texact != -1) {
- mtex= G.scene->sculptdata.mtex[G.scene->sculptdata.texact];
- if(mtex) *id= (ID*)mtex->tex;
- }
- } else {
- Brush *brush= G.scene->toolsettings->imapaint.brush;
- if (brush) {
- mtex= brush->mtex[brush->texact];
- if(mtex) *id= (ID*)mtex->tex;
- }
- }
- }
- }
- }
- else if(G.buts->mainb==CONTEXT_OBJECT || G.buts->mainb==CONTEXT_LOGIC) {
- if(ob) {
- *idfrom= (ID *)G.scene;
- *id= (ID *)ob;
- }
- }
- else if(G.buts->mainb==CONTEXT_EDITING) {
- if(ob && ob->data) {
- *id= ob->data;
- }
- }
-}
-
-static void do_buts_view_shadingmenu(void *arg, int event)
-{
- G.buts->mainb = CONTEXT_SHADING;
-
- allqueue(REDRAWBUTSALL, 0);
-}
-
-
-static uiBlock *buts_view_shadingmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "buts_view_shadingmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_buts_view_shadingmenu, NULL);
-
- if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Lamp|F5",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_LAMP, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Lamp|F5",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_LAMP, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Material|F5",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_MAT, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Material|F5",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_MAT, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Texture|F6",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_TEX, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Texture|F6",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_TEX, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_RAD)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Radiosity",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_RAD, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Radiosity",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_RAD, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "World|F8",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_WORLD, 1.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "World|F8",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_WORLD, 1.0, 0, 10, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_buts_view_scenemenu(void *arg, int event)
-{
- G.buts->mainb = CONTEXT_SCENE;
-
- allqueue(REDRAWBUTSALL, 0);
-}
-
-
-static uiBlock *buts_view_scenemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "buts_view_scenemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_buts_view_scenemenu, NULL);
-
- if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_RENDER)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Render|F10",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_RENDER, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Render|F10",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_RENDER, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_SEQUENCER)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Sequencer",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SEQUENCER, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Sequencer",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SEQUENCER, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_ANIM)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Animation",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_ANIM, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Animation",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_ANIM, 0.0, 0, 10, "");
- }
-
- if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND)) {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Sound",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SOUND, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Sound",
- 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SOUND, 0.0, 0, 10, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_buts_view_alignmenu(void *arg, int event)
-{
- SpaceButs *sbuts= curarea->spacedata.first;
-
- switch(event) {
- case 0: /* panel alignment */
- case 1:
- case 2:
- sbuts->align= event;
- if(event) {
- uiAlignPanelStep(curarea, 1.0);
- do_buts_buttons(B_BUTSHOME);
- }
- break;
- }
-
- allqueue(REDRAWBUTSALL, 0);
-}
-
-
-static uiBlock *buts_view_alignmenu(void *arg_unused)
-{
- SpaceButs *sbuts= curarea->spacedata.first;
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "buts_view_alignmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_buts_view_alignmenu, NULL);
-
- if (sbuts->align == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- if (sbuts->align == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Vertical", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Vertical", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- if (sbuts->align == 0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Free", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Free", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_buts_viewmenu(void *arg, int event)
-{
- SpaceButs *sbuts= curarea->spacedata.first;
-
- switch(event) {
- case 1: /* zoom in */
- view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy);
- break;
- case 2: /* zoom out */
- view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy);
- break;
- case 3: /* View All */
- do_buts_buttons(B_BUTSHOME);
- break;
- case 4: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 10: /* empty for the context events */
- break;
- }
- allqueue(REDRAWBUTSALL, 0);
-}
-
-static uiBlock *buts_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "buts_viewmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_buts_viewmenu, NULL);
-
- if(G.buts->mainb==CONTEXT_LOGIC) {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Logic|F4",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), CONTEXT_LOGIC, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Logic|F4",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), CONTEXT_LOGIC, 0.0, 0, 10, "");
- }
-
- if(G.buts->mainb==CONTEXT_SCRIPT) {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Script",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_SCRIPT, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Script",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_SCRIPT, 0.0, 0, 10, "");
- }
-
- uiDefIconTextBlockBut(block, buts_view_shadingmenu, NULL, ICON_RIGHTARROW_THIN, "Shading", 0, yco-=20, 120, 19, "");
-
- if(G.buts->mainb==CONTEXT_OBJECT) {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Object|F7",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_OBJECT, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Object|F7",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_OBJECT, 0.0, 0, 10, "");
- }
-
- if(G.buts->mainb==CONTEXT_EDITING) {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Editing|F9",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_EDITING, 0.0, 0, 10, "");
- } else {
- uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Editing|F9",
- 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_EDITING, 0.0, 0, 10, "");
- }
-
- uiDefIconTextBlockBut(block, buts_view_scenemenu, NULL, ICON_RIGHTARROW_THIN, "Scene", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, buts_view_alignmenu, NULL, ICON_RIGHTARROW_THIN, "Align", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void buts_buttons(void)
-{
- uiBlock *block;
- ID *id, *idfrom;
- short xco, xmax, t_base= 0;
- char naam[20];
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_BUTS;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco, 0, XIC+10, YIC,
- &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays Current Window Type. "
- "Click for menu of available types.");
-
- xco += XIC + 14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if (curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Show pulldown menus");
- }
- else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("Panels");
- uiDefPulldownBut(block, buts_viewmenu, NULL,
- "Panels", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
-
- /* FULL WINDOW */
-// if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
-// else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
-
- /* HOME */
-// uiDefIconBut(block, BUT, B_BUTSHOME, ICON_HOME, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms window to home view showing all items (HOMEKEY)");
-// xco+=XIC;
-
- uiBlockBeginAlign(block);
- uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_GAME, xco, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_LOGIC, 0, 0, "Logic (F4) ");
- uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCRIPT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SCRIPT, 0, 0, "Script ");
- uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL_DEHLT,xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SHADING, 0, 0, "Shading (F5) ");
- uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_OBJECT, 0, 0, "Object (F7) ");
- uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_EDIT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_EDITING, 0, 0, "Editing (F9) ");
- uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE_DEHLT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SCENE, 0, 0, "Scene (F10) ");
-
- xco+= XIC;
-
- /* select the context to be drawn, per contex/tab the actual context is tested */
- uiBlockSetEmboss(block, UI_EMBOSS); // normal
- switch(G.buts->mainb) {
- case CONTEXT_SCENE:
- uiBlockBeginAlign(block);
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons ");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SEQUENCE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SEQUENCER, 0, 0, "Sequencer buttons ");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_ANIM, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_ANIM, 0, 0, "Anim/playback buttons");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SOUND, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SOUND, 0, 0, "Sound block buttons");
-
- break;
- case CONTEXT_OBJECT:
- uiBlockBeginAlign(block);
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_OBJECT, 0, 0, "Object buttons ");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PHYSICS, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PHYSICS, 0, 0, "Physics buttons");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PARTICLES, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PARTICLE, 0, 0, "Particle buttons");
-
- break;
- case CONTEXT_SHADING:
- uiBlockBeginAlign(block);
- uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_LAMP, 0, 0, "Lamp buttons");
- uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_MAT, 0, 0, "Material buttons");
- uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_TEX, 0, 0, "Texture buttons(F6)");
- uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_RADIO,xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_RAD, 0, 0, "Radiosity buttons");
- uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_WORLD, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_WORLD, 0, 0, "World buttons");
-
- break;
- case CONTEXT_EDITING:
-
- break;
- case CONTEXT_SCRIPT:
-
- break;
- case CONTEXT_LOGIC:
-
- break;
- }
-
- uiBlockEndAlign(block);
-
- xco+=XIC;
- uiDefButI(block, NUM, B_NEWFRAME, "", (xco+20),0,60,YIC, &(G.scene->r.cfra), 1.0, MAXFRAMEF, 0, 0, "Displays Current Frame of animation. Click to change.");
- xco+= 80;
-
- buttons_active_id(&id, &idfrom);
- G.buts->lockpoin= id;
-
- /* always do as last */
- uiDrawBlock(block);
- curarea->headbutlen= xco;
-}
diff --git a/source/blender/src/header_filesel.c b/source/blender/src/header_filesel.c
deleted file mode 100644
index f21b4be5725..00000000000
--- a/source/blender/src/header_filesel.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * header_filesel.c oct-2003
- *
- * Functions to draw the "File Browser" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_ID.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_language.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BLI_blenlib.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-void do_file_buttons(short event)
-{
- SpaceFile *sfile;
-
- if(curarea->win==0) return;
- sfile= curarea->spacedata.first;
-
- switch(event) {
- case B_SORTFILELIST:
- sort_filelist(sfile);
- scrarea_queue_winredraw(curarea);
- break;
- case B_RELOADDIR:
- freefilelist(sfile);
- scrarea_queue_winredraw(curarea);
- break;
- }
-
-}
-
-void file_buttons(void)
-{
- SpaceFile *sfile;
- uiBlock *block;
- float df, totlen, sellen;
- short xco, xcotitle;
- int totfile, selfile;
- char naam[256];
-
- sfile= curarea->spacedata.first;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_FILE;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
-
- xco+= XIC+22;
-
- /* FULL WINDOW */
- if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
- else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
-
- /* SORT TYPE */
- xco+=XIC;
- uiBlockBeginAlign(block);
- uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTALPHA, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically");
- uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTBYEXT, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 3.0, 0, 0, "Sorts files by extension");
- uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTTIME, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 1.0, 0, 0, "Sorts files by time");
- uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 2.0, 0, 0, "Sorts files by size");
- uiBlockEndAlign(block);
-
- cpack(0x0);
- xco+=XIC+10;
-
- xcotitle= xco;
- xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & USER_TR_BUTTONS));
-
- if(sfile->pupmenu && sfile->menup) {
- uiDefButS(block, MENU, B_NOP, sfile->pupmenu, xco+10,0,90,20, sfile->menup, 0, 0, 0, 0, "");
- xco+= 100;
- }
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, ICONTOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info");
- uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files");
- uiBlockEndAlign(block);
-
- if(sfile->type==FILE_BLENDER) {
- xco+=20;
- } else {
- uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
- xco+=90;
- }
-
- if(sfile->type==FILE_LOADLIB) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Copies selected data into current project");
- uiDefButBitS(block, TOG, FILE_LINK, B_REDR, "Link", xco+=100,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Creates a link to selected data from current project");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, FILE_AUTOSELECT, B_REDR, "Autosel", xco+=125,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Autoselect imported objects");
- uiDefButBitS(block, TOG, FILE_ACTIVELAY, B_REDR, "Active Layer", xco+=65,0,80,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) in active layer");
- uiDefButBitS(block, TOG, FILE_ATCURSOR, B_REDR, "At Cursor", xco+=80,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) at cursor, use centroid if more than one object is selected");
- uiBlockEndAlign(block);
-
- xco+= 100; // scroll
-
- } else if(sfile->type==FILE_BLENDER) {
- uiDefButBitI(block, TOGN, G_FILE_NO_UI, B_REDR, "Load UI", xco+=XIC,0,80,YIC, &G.fileflags, 0, 0, 0, 0, "Load the UI setup as well as the scene data");
-
- xco+= 100; // scroll
- }
- #ifdef INTERNATIONAL
- else if(sfile->type==FILE_LOADFONT) {
- uiDefIconButBitS(block, TOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_FONTPREVIEW, xco+= XIC, 0, XIC, YIC, &sfile->f_fp, 0, 0, 0, 0, "Activate font preview");
- if (sfile->f_fp)
- uiDefButC(block, FTPREVIEW, 0, "Font preview", xco+= XIC, 0, 100, YIC, sfile->fp_str, (float)0, (float)16, 0, 0, "Font preview");
-
- xco+= 100; // scroll
- }
- #endif
-
- uiDrawBlock(block);
-
- glRasterPos2f((float)xcotitle, 5.0);
- BIF_RasterPos((float)xcotitle, 5.0); // stupid texture fonts
- BIF_ThemeColor(TH_TEXT);
- BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & USER_TR_BUTTONS));
-
- if(sfile->type==FILE_UNIX) {
- df= BLI_diskfree(sfile->dir)/(1048576.0);
-
- filesel_statistics(sfile, &totfile, &selfile, &totlen, &sellen);
-
- sprintf(naam, "Free: %.3f MB Files: (%d) %d (%.3f) %.3f MB", df, selfile,totfile, sellen, totlen);
-
- cpack(0x0);
- glRasterPos2f((float)xco, 5.0);
- BIF_RasterPos((float)xco, 5.0); // texture fonts
-
- BIF_DrawString(G.font, naam, 0);
- }
-
- /* always do as last */
- curarea->headbutlen= xco+2*XIC;
-}
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
deleted file mode 100644
index cf8f3c5c99d..00000000000
--- a/source/blender/src/header_image.c
+++ /dev/null
@@ -1,1352 +0,0 @@
-/**
- * header_image.c oct-2003
- *
- * Functions to draw the "UV/Image Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_brush_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_customdata_types.h" /* for UV layer menu */
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "BDR_drawmesh.h"
-#include "BDR_unwrapper.h"
-
-#include "BKE_brush.h"
-#include "BKE_colortools.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-#include "BLI_editVert.h" /* for UV layer menu */
-#include "BKE_customdata.h" /* ditto */
-
-#include "BIF_butspace.h"
-#include "BIF_drawimage.h"
-#include "BIF_editsima.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_transform.h"
-#include "BIF_toolbox.h"
-#include "BIF_editmesh.h"
-
-#include "BSE_drawview.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_trans_types.h"
-#include "BSE_edit.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "IMB_imbuf_types.h"
-
-#include "RE_pipeline.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
-
-void do_image_buttons(unsigned short event)
-{
- ToolSettings *settings= G.scene->toolsettings;
- ID *id, *idtest;
- int nr;
-
- if(curarea->win==0) return;
-
- if(event<=100) {
- if(event<=50) do_global_buttons2(event);
- else do_global_buttons(event);
- return;
- }
-
- switch(event) {
- case B_SIMAPIN:
- allqueue (REDRAWIMAGE, 0);
- break;
- case B_SIMAGEHOME:
- image_home();
- break;
-
- case B_SIMABROWSE:
- if(G.sima->imanr== -2) {
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
- &G.sima->imanr, do_image_buttons);
- } else {
- activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
- &G.sima->imanr, do_image_buttons);
- }
- return;
- }
- if(G.sima->imanr < 0) break;
-
- nr= 1;
- id= (ID *)G.sima->image;
-
- idtest= BLI_findlink(&G.main->image, G.sima->imanr-1);
- if(idtest==NULL) { /* no new */
- return;
- }
-
- if(idtest!=id) {
- G.sima->image= (Image *)idtest;
- if(idtest->us==0) idtest->us= 1;
- BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
- allqueue(REDRAWIMAGE, 0);
- }
- /* also when image is the same: assign! 0==no tileflag: */
- image_changed(G.sima, (Image *)idtest);
- BIF_undo_push("Assign image UV");
-
- break;
- case B_SIMAGETILE:
- image_set_tile(G.sima, 1); /* 1: only tileflag */
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_SIMA3DVIEWDRAW:
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_SIMA_REDR_IMA_3D:
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- break;
- case B_SIMAGEPAINTTOOL:
- if(G.sima->flag & SI_DRAWTOOL)
- /* add new brush if none exists */
- brush_check_exists(&G.scene->toolsettings->imapaint.brush);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_SIMAPACKIMA:
- pack_image_sima();
- break;
-
- case B_SIMA_REPACK:
- BKE_image_memorypack(G.sima->image);
- allqueue(REDRAWIMAGE, 0);
- break;
-
- case B_SIMA_USE_ALPHA:
- G.sima->flag &= ~(SI_SHOW_ALPHA|SI_SHOW_ZBUF);
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- break;
- case B_SIMA_SHOW_ALPHA:
- G.sima->flag &= ~(SI_USE_ALPHA|SI_SHOW_ZBUF);
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- break;
- case B_SIMA_SHOW_ZBUF:
- G.sima->flag &= ~(SI_SHOW_ALPHA|SI_USE_ALPHA);
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- break;
- case B_SIMARELOAD:
- reload_image_sima();
- break;
- case B_SIMAGELOAD:
- open_image_sima(0);
- break;
- case B_SIMANAME:
- if(G.sima->image) {
- Image *ima;
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- /* name in ima has been changed by button! */
- BLI_strncpy(str, G.sima->image->name, sizeof(str));
- ima= BKE_add_image_file(str);
- if(ima) {
- BKE_image_signal(ima, &G.sima->iuser, IMA_SIGNAL_RELOAD);
- image_changed(G.sima, ima);
- }
- BIF_undo_push("Load image");
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_SIMAMULTI:
- if(G.sima && G.sima->image) {
- BKE_image_multilayer_index(G.sima->image->rr, &G.sima->iuser);
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_TRANS_IMAGE:
- image_editvertex_buts(NULL);
- break;
- case B_CURSOR_IMAGE:
- image_editcursor_buts(NULL);
- break;
-
- case B_TWINANIM:
- {
- Image *ima;
- int nr;
-
- ima = G.sima->image;
- if (ima) {
- if(ima->flag & IMA_TWINANIM) {
- nr= ima->xrep*ima->yrep;
- if(ima->twsta>=nr) ima->twsta= 1;
- if(ima->twend>=nr) ima->twend= nr-1;
- if(ima->twsta>ima->twend) ima->twsta= 1;
- }
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- }
- case B_SIMACLONEBROWSE:
- if(settings->imapaint.brush) {
- Brush *brush= settings->imapaint.brush;
-
- if(G.sima->menunr== -2) {
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE,
- &G.sima->menunr, do_image_buttons);
- } else {
- activate_databrowse((ID *)brush->clone.image, ID_IM, 0, B_SIMACLONEBROWSE,
- &G.sima->menunr, do_image_buttons);
- }
- break;
- }
- if(G.sima->menunr < 0) break;
-
- if(brush_clone_image_set_nr(brush, G.sima->menunr))
- allqueue(REDRAWIMAGE, 0);
- }
- break;
-
- case B_SIMACLONEDELETE:
- if (settings->imapaint.brush)
- if (brush_clone_image_delete(settings->imapaint.brush))
- allqueue(REDRAWIMAGE, 0);
- break;
-
- case B_SIMABRUSHCHANGE:
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case B_SIMACURVES:
- curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
- allqueue(REDRAWIMAGE, 0);
- break;
-
- case B_SIMARANGE:
- curvemapping_set_black_white(G.sima->cumap, NULL, NULL);
- curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
- allqueue(REDRAWIMAGE, 0);
- break;
-
- case B_SIMABRUSHBROWSE:
- if(G.sima->menunr==-2) {
- activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_SIMABRUSHBROWSE, &G.sima->menunr, do_global_buttons);
- break;
- }
- else if(G.sima->menunr < 0) break;
-
- if(brush_set_nr(&settings->imapaint.brush, G.sima->menunr)) {
- BIF_undo_push("Browse Brush");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- break;
- case B_SIMABRUSHDELETE:
- if(brush_delete(&settings->imapaint.brush)) {
- BIF_undo_push("Unlink Brush");
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case B_KEEPDATA:
- brush_toggled_fake_user(settings->imapaint.brush);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case B_SIMABRUSHLOCAL:
- if(settings->imapaint.brush && settings->imapaint.brush->id.lib) {
- if(okee("Make local")) {
- make_local_brush(settings->imapaint.brush);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- break;
- case B_SIMABTEXBROWSE:
- if(settings->imapaint.brush) {
- Brush *brush= settings->imapaint.brush;
-
- if(G.sima->menunr==-2) {
- MTex *mtex= brush->mtex[brush->texact];
- ID *id= (ID*)((mtex)? mtex->tex: NULL);
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons);
- } else {
- activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons);
- }
- break;
- }
- else if(G.sima->menunr < 0) break;
-
- if(brush_texture_set_nr(brush, G.sima->menunr)) {
- BIF_undo_push("Browse Brush Texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- break;
- case B_SIMABTEXDELETE:
- if(settings->imapaint.brush) {
- if (brush_texture_delete(settings->imapaint.brush)) {
- BIF_undo_push("Unlink Brush Texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- break;
- case B_SIMA_PLAY:
- play_anim(0);
- break;
- case B_SIMA_RECORD:
- imagespace_composite_flipbook(curarea);
- break;
- }
-}
-
-static void do_image_buttons_set_uvlayer_callback(void *act, void *data)
-{
- CustomData_set_layer_active(&G.editMesh->fdata, CD_MTFACE, *((int *)act));
-
- BIF_undo_push("Set Active UV Texture");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-static void do_image_view_viewnavmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* Zoom In */
- image_viewzoom(PADPLUSKEY, 0);
- break;
- case 2: /* Zoom Out */
- image_viewzoom(PADMINUS, 0);
- break;
- case 3: /* Zoom 8:1 */
- image_viewzoom(PAD8, 0);
- break;
- case 4: /* Zoom 4:1 */
- image_viewzoom(PAD4, 0);
- break;
- case 5: /* Zoom 2:1 */
- image_viewzoom(PAD2, 0);
- break;
- case 6: /* Zoom 1:1 */
- image_viewzoom(PAD1, 0);
- break;
- case 7: /* Zoom 1:2 */
- image_viewzoom(PAD2, 1);
- break;
- case 8: /* Zoom 1:4 */
- image_viewzoom(PAD4, 1);
- break;
- case 9: /* Zoom 1:8 */
- image_viewzoom(PAD8, 1);
- break;
- }
- allqueue(REDRAWIMAGE, 0);
-}
-
-static uiBlock *image_view_viewnavmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_view_viewnavmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_view_viewnavmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:8|Shift+NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:4|Shift+NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:2|Shift+NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:1|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 2:1|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 4:1|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 8:1|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_image_viewmenu(void *arg, int event)
-{
-
- switch(event) {
- case 0: /* Update Automatically */
- if(G.sima->lock) G.sima->lock = 0;
- else G.sima->lock = 1;
- break;
- case 1: /* View All */
- do_image_buttons(B_SIMAGEHOME);
- break;
- case 2: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 4: /* Realtime Panel... */
- add_blockhandler(curarea, IMAGE_HANDLER_VIEW_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 7: /* Properties Panel */
- add_blockhandler(curarea, IMAGE_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 8: /* Paint Panel... */
- add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
- break;
- case 9:
- image_viewcenter();
- break;
- case 11: /* Curves Panel... */
- add_blockhandler(curarea, IMAGE_HANDLER_CURVES, UI_PNL_UNSTOW);
- break;
- case 12: /* composite preview */
- toggle_blockhandler(curarea, IMAGE_HANDLER_PREVIEW, 0);
- scrarea_queue_winredraw(curarea);
- break;
- case 13: /* Realtime Panel... */
- add_blockhandler(curarea, IMAGE_HANDLER_GAME_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 14: /* Draw active image UV's only*/
- G.sima->flag ^= SI_LOCAL_UV;
- allqueue(REDRAWIMAGE, 0);
- break;
- case 15: /* Grease Pencil... */
- add_blockhandler(curarea, IMAGE_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *image_viewmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_image_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Real-time Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
- if (G.sima->image && (G.sima->flag & SI_DRAWTOOL)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Composite Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- if(G.sima->flag & SI_LOCAL_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- if(!(G.sima->flag & SI_LOCAL_UV)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, image_view_viewnavmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
-
- if(G.sima->lock) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_image_selectmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0: /* Border Select */
- borderselect_sima(UV_SELECT_ALL);
- break;
- case 8: /* Border Select Pinned */
- borderselect_sima(UV_SELECT_PINNED);
- break;
- case 1: /* Select/Deselect All */
- select_swap_tface_uv();
- break;
- case 9: /* Select Inverse */
- select_invert_tface_uv();
- break;
- case 2: /* Unlink Selection */
- unlink_selection();
- break;
- case 3: /* Linked UVs */
- select_linked_tface_uv(2);
- break;
- case 6: /* Toggle Active Face Select */
- if(G.sima->flag & SI_SELACTFACE)
- G.sima->flag &= ~SI_SELACTFACE;
- else
- G.sima->flag |= SI_SELACTFACE;
- allqueue(REDRAWIMAGE, 0);
- break;
- case 7: /* Pinned UVs */
- select_pinned_tface_uv();
- break;
- }
-}
-
-static uiBlock *image_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_image_selectmenu, NULL);
-
-
- if ((G.sima->flag & SI_SYNC_UVSEL)==0 || (G.sima->flag & SI_SYNC_UVSEL && (G.scene->selectmode != SCE_SELECT_FACE))) {
- if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Pinned|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unlink Selection|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pinned UVs|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked UVs|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_image_image_rtmappingmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* UV Co-ordinates */
- G.sima->image->flag &= ~IMA_REFLECT;
- break;
- case 1: /* Reflection */
- G.sima->image->flag |= IMA_REFLECT;
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *image_image_rtmappingmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_image_rtmappingmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_image_rtmappingmenu, NULL);
-
- if (G.sima->image->flag & IMA_REFLECT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Co-ordinates", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Reflection", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Co-ordinates", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Reflection", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_image_imagemenu(void *arg, int event)
-{
- /* events >=20 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 20) BPY_menu_do_python(PYMENU_IMAGE, event - 20);
-#endif
- switch(event)
- {
- case 0:
- open_image_sima((G.qual==LR_CTRLKEY));
- break;
- case 1:
- replace_image_sima((G.qual==LR_CTRLKEY));
- break;
- case 2:
- pack_image_sima();
- break;
- case 4: /* Texture Painting */
- brush_check_exists(&G.scene->toolsettings->imapaint.brush);
- if(G.sima->flag & SI_DRAWTOOL) G.sima->flag &= ~SI_DRAWTOOL;
- else G.sima->flag |= SI_DRAWTOOL;
- allqueue(REDRAWBUTSSHADING, 0);
- break;
- case 5:
- save_as_image_sima();
- break;
- case 6:
- reload_image_sima();
- break;
- case 7:
- new_image_sima();
- break;
- case 8:
- save_image_sima();
- break;
- case 9:
- save_image_sequence_sima();
- break;
- case 10:
- BKE_image_memorypack(G.sima->image);
- allqueue(REDRAWIMAGE, 0);
- break;
- }
-}
-
-static uiBlock *image_imagemenu(void *arg_unused)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
- uiBlock *block;
- short yco= 0, menuwidth=150;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "image_imagemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_image_imagemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New...|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.sima->image) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- if(G.sima->image->source==IMA_SRC_SEQUENCE)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Changed Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.sima->image->packedfile) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- }
-
- /* only for dirty && specific image types */
- if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- if( ELEM(G.sima->image->source, IMA_SRC_FILE, IMA_SRC_GENERATED))
- if(G.sima->image->type!=IMA_TYPE_MULTILAYER)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image as PNG", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=7, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.sima->flag & SI_DRAWTOOL) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Texture Painting", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Texture Painting", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=7, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, image_image_rtmappingmenu, NULL, ICON_RIGHTARROW_THIN, "Realtime Texture Mapping", 0, yco-=20, 120, 19, "");
- // uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Realtime Texture Animation|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- }
-#ifndef DISABLE_PYTHON
- /* note that we acount for the N previous entries with i+20: */
- for (pym = BPyMenuTable[PYMENU_IMAGE]; pym; pym = pym->next, i++) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i+20,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-static void do_image_uvs_showhidemenu(void *arg, int event)
-{
- switch(event) {
- case 4: /* show hidden faces */
- reveal_tface_uv();
- break;
- case 5: /* hide selected faces */
- hide_tface_uv(0);
- break;
- case 6: /* hide deselected faces */
- hide_tface_uv(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *image_uvs_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_image_uvs_propfalloffmenu(void *arg, int event)
-{
- G.scene->prop_mode= event;
- allqueue(REDRAWVIEW3D, 1);
-}
-
-static uiBlock *image_uvs_propfalloffmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_propfalloffmenu, NULL);
-
- if (G.scene->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, "");
- if (G.scene->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, "");
- if (G.scene->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, "");
- if (G.scene->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, "");
- if (G.scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
- if (G.scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_image_uvs_transformmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* Grab */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- break;
- case 1: /* Rotate */
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- break;
- case 2: /* Scale */
- initTransform(TFM_RESIZE, CTX_NONE);
- Transform();
- break;
- }
-}
-
-static uiBlock *image_uvs_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_image_uvs_mirrormenu(void *arg, int event)
-{
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event) {
- case 0: /* X axis */
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[0], " on global X axis");
- Transform();
- break;
- case 1: /* Y axis */
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[1], " on global Y axis");
- Transform();
- break;
- }
-
- BIF_undo_push("Mirror UV");
-}
-
-static uiBlock *image_uvs_mirrormenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Axis|M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Axis|M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_image_uvs_weldalignmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* Weld */
- weld_align_tface_uv('w');
- break;
- case 1: /* Align Auto */
- weld_align_tface_uv('a');
- break;
- case 2: /* Align X */
- weld_align_tface_uv('x');
- break;
- case 3: /* Align Y */
- weld_align_tface_uv('y');
- break;
- }
-
- if(event==0) BIF_undo_push("Weld UV");
- else if(ELEM3(event, 1, 2, 3)) BIF_undo_push("Align UV");
-}
-
-static uiBlock *image_uvs_weldalignmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_weldalignmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_weldalignmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Weld|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Auto|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align X|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Y|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-#ifndef DISABLE_PYTHON
-static void do_image_uvs_scriptsmenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_UV, event);
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-static uiBlock *image_uvs_scriptsmenu (void *args_unused)
-{
- uiBlock *block;
- BPyMenu *pym;
- int i= 0;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvs_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_image_uvs_scriptsmenu, NULL);
-
- /* note that we acount for the N previous entries with i+20: */
- for (pym = BPyMenuTable[PYMENU_UV]; pym; pym = pym->next, i++) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-static void do_image_uvsmenu(void *arg, int event)
-{
-
- switch(event) {
-// case 0: /* UV Transform Properties Panel... */
-// add_blockhandler(curarea, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_UNSTOW);
-// break;
- case 1: /* UVs Constrained Rectangular */
- if(G.sima->flag & SI_BE_SQUARE) G.sima->flag &= ~SI_BE_SQUARE;
- else G.sima->flag |= SI_BE_SQUARE;
- break;
- case 2: /* UVs Clipped to Image Size */
- if(G.sima->flag & SI_CLIP_UV) G.sima->flag &= ~SI_CLIP_UV;
- else G.sima->flag |= SI_CLIP_UV;
- break;
- case 3: /* Limit Stitch UVs */
- stitch_limit_uv_tface();
- break;
- case 4: /* Stitch UVs */
- stitch_vert_uv_tface();
- break;
- case 5: /* Proportional Edit (toggle) */
- if(G.scene->proportional)
- G.scene->proportional= 0;
- else
- G.scene->proportional= 1;
- break;
- case 7: /* UVs Snap to Pixel */
- G.sima->flag ^= SI_PIXELSNAP;
- break;
- case 8:
- pin_tface_uv(1);
- break;
- case 9:
- pin_tface_uv(0);
- break;
- case 10:
- unwrap_lscm(0);
- break;
- case 11:
- if(G.sima->flag & SI_LIVE_UNWRAP) G.sima->flag &= ~SI_LIVE_UNWRAP;
- else G.sima->flag |= SI_LIVE_UNWRAP;
- break;
- case 12:
- minimize_stretch_tface_uv();
- break;
- case 13:
- pack_charts_tface_uv();
- break;
- case 14:
- average_charts_tface_uv();
- break;
- }
-}
-
-static uiBlock *image_uvsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "image_uvsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_image_uvsmenu, NULL);
-
- //uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- if(G.sima->flag & SI_PIXELSNAP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-
- if(G.sima->flag & SI_BE_SQUARE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Quads Constrained Rectangular|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Quads Constrained Rectangular|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- if(G.sima->flag & SI_CLIP_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Layout Clipped to Image Size|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Layout Clipped to Image Size|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.sima->flag & SI_LIVE_UNWRAP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Live Unwrap Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Live Unwrap Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unwrap|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpin|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pin|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Islands|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Average Islands Scale|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Minimize Stretch|Ctrl V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Limit Stitch...|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Stitch|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, image_uvs_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, image_uvs_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, image_uvs_weldalignmenu, NULL, ICON_RIGHTARROW_THIN, "Weld/Align", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.scene->proportional)
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefIconTextBlockBut(block, image_uvs_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, image_uvs_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Faces", 0, yco-=20, menuwidth, 19, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, image_uvs_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void image_buttons(void)
-{
- Image *ima;
- ImBuf *ibuf;
- uiBlock *block;
- short xco, xmax;
- char naam[256], *menuname;
- char is_render; /* true if the image is a render or composite */
-
- int allow_pin= B_SIMAPIN;
-
- /* This should not be a static var */
- static int headerbuttons_packdummy;
-
-
- is_render = ((G.sima->image!=NULL) && ((G.sima->image->type == IMA_TYPE_R_RESULT) || (G.sima->image->type == IMA_TYPE_COMPOSITE)));
-
- headerbuttons_packdummy = 0;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- what_image(G.sima);
- ima= G.sima->image;
- ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser);
-
- curarea->butspacetype= SPACE_IMAGE;
-
- xco = 8;
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Current Window Type. Click for menu of available types.");
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
-
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, image_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) {
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, image_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- menuname= "Image*";
- else
- menuname= "Image";
- xmax= GetButStringLength(menuname);
- uiDefPulldownBut(block, image_imagemenu, NULL, menuname, xco, -2, xmax-3, 24, "");
- xco+= xmax;
- if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) {
- xmax= GetButStringLength("UVs");
- uiDefPulldownBut(block, image_uvsmenu, NULL, "UVs", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
- }
-
- /* other buttons: */
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- if (is_render)
- allow_pin = 0;
-
- xco= 8 + std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
-
- if( ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
-
- if (ima->packedfile) {
- headerbuttons_packdummy = 1;
- }
- if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
- else
- uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
-
- xco+= XIC+8;
- }
-
- /* UV EditMode buttons, not painting or rencering or compositing */
- if ( EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0 && !is_render) {
- uiBut *ubut;
- int layercount;
-
- uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE,
- "Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1",
- xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0,
- "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period)");
- xco+= XIC + 18;
-
-
- uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_EDIT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync UV and Mesh Selection");
- xco+= XIC+8;
- if (G.sima->flag & SI_SYNC_UVSEL) {
- uiBlockBeginAlign(block);
-
- /* B_SEL_VERT & B_SEL_FACE are not defined here which is a bit bad, BUT it works even if image editor is fullscreen */
- uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL,
- xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)");
- /* no edge */
- /*uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode (Ctrl Tab 2)");
- xco+= XIC; */
- uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL,
- xco+=XIC,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)");
- uiBlockEndAlign(block);
-
- } else {
- uiBlockBeginAlign(block);
-
- uiDefIconButS(block, ROW, B_REDR, ICON_VERTEXSEL,
- xco,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_VERTEX, 0, 0, "UV vertex select mode");
- uiDefIconButS(block, ROW, B_REDR, ICON_FACESEL,
- xco+=XIC,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_FACE, 0, 0, "UV Face select mode");
- uiDefIconButS(block, ROW, B_REDR, ICON_MESH,
- xco+=XIC,0,XIC,YIC, &G.sima->selectmode, 0.0, SI_SELECT_ISLAND, 0, 0, "UV Island select mode");
- uiBlockEndAlign(block);
-
- /* would use these if const's could go in strings
- * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */
- ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
- "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2",
- xco+=XIC+10,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0,
- "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)");
-
- }
- xco+= XIC + 16;
-
- /* Snap copied right out of view3d header */
- uiBlockBeginAlign(block);
-
- if (G.scene->snap_flag & SCE_SNAP) {
- uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)");
- xco+= XIC;
- uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
- xco+= 70;
- } else {
- uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");
- xco+= XIC;
- }
-
- uiBlockEndAlign(block);
- xco+= 10;
- /* end snap */
-
- /* Layer Menu */
- layercount = CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
- if (layercount>1 && layercount < 12) { /* could allow any number but limit of 11 means no malloc needed */
- static int act;
- char str_menu[384], *str_pt; /*384 allows for 11 layers */
-
-
- act = CustomData_get_active_layer(&G.editMesh->fdata, CD_MTFACE);
-
- /*str_pt = (char *)MEM_mallocN(layercount*40 , "uvmenu"); str[0]='\0';*/
- str_pt = str_menu;
- str_pt[0]='\0';
- mesh_layers_menu_concat(&G.editMesh->fdata, CD_MTFACE, str_pt);
- ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
- uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL);
-
- /*MEM_freeN(str);*/
- xco+= 90;
- }
- }
-
- if (ima) {
- RenderResult *rr= BKE_image_get_renderresult(ima);
-
- xco+= 8;
-
- if(rr) {
- uiBlockBeginAlign(block);
- uiblock_layer_pass_buttons(block, rr, &G.sima->iuser, B_REDR, xco, 0, 160);
- uiBlockEndAlign(block);
- xco+= 166;
- }
- uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enable image painting");
-
- xco+= XIC+8;
-
- uiBlockBeginAlign(block);
- if(ibuf==NULL || ibuf->channels==4) {
- uiDefIconButBitI(block, TOG, SI_USE_ALPHA, B_SIMA_USE_ALPHA, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha");
- xco+= XIC;
- uiDefIconButBitI(block, TOG, SI_SHOW_ALPHA, B_SIMA_SHOW_ALPHA, ICON_DOT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws only alpha");
- xco+= XIC;
- }
- if(ibuf) {
- if(ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)) {
- uiDefIconButBitI(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values (mapped from camera clip start to end)");
- xco+= XIC;
- }
- }
- xco+= 8;
-
- uiBlockBeginAlign(block);
- if(ima->type==IMA_TYPE_COMPOSITE) {
- uiDefIconBut(block, BUT, B_SIMA_RECORD, ICON_REC, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Record Composite");
- xco+= XIC;
- }
- if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
- uiDefIconBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play");
- xco+= XIC;
- }
- uiBlockEndAlign(block);
- xco+= 8;
- }
-
- /* draw LOCK */
- uiDefIconButS(block, ICONTOG, 0, ICON_UNLOCKED, xco,0,XIC,YIC, &(G.sima->lock), 0, 0, 0, 0, "Updates other affected window spaces automatically to reflect changes in real time");
-
- /* Always do this last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
-
diff --git a/source/blender/src/header_imasel.c b/source/blender/src/header_imasel.c
deleted file mode 100644
index f66bb882367..00000000000
--- a/source/blender/src/header_imasel.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- * header_imasel.c oct-2003
- *
- * Functions to draw the "Image Browser" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BIF_filelist.h"
-#include "BIF_gl.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_language.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BSE_headerbuttons.h"
-
-#include "blendef.h"
-
-
-void do_imasel_buttons(short event)
-{
- SpaceImaSel *simasel;
-
- simasel= curarea->spacedata.first;
-
- if(curarea->win==0) return;
-
- switch(event) {
- case B_SORTIMASELLIST:
- BIF_filelist_sort(simasel->files, simasel->sort);
- scrarea_queue_winredraw(curarea);
- break;
-
- case B_RELOADIMASELDIR:
- BIF_filelist_free(simasel->files);
- scrarea_queue_winredraw(curarea);
- break;
- case B_FILTERIMASELDIR:
- if (simasel->flag & FILE_FILTER) {
- BIF_filelist_setfilter(simasel->files,simasel->filter);
- BIF_filelist_filter(simasel->files);
- scrarea_queue_winredraw(curarea);
- } else {
- BIF_filelist_setfilter(simasel->files,0);
- BIF_filelist_filter(simasel->files);
- scrarea_queue_winredraw(curarea);
- }
- break;
- }
-}
-
-void imasel_buttons(void)
-{
- SpaceImaSel *simasel;
- uiBlock *block;
- short xco, xcotitle;
- char naam[256];
- char dir[FILE_MAX], group[32];
- short type;
- int do_filter = 0;
-
- simasel= curarea->spacedata.first;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_IMASEL;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
-
- xco+= XIC+22;
-
- /* FULL WINDOW */
- if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "");
- else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "");
-
- /* SORT TYPE */
- xco+=XIC;
- uiBlockBeginAlign(block);
- uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTALPHA, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically");
- uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTBYEXT, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 3.0, 0, 0, "Sorts files by extension");
- uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTTIME, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 1.0, 0, 0, "Sorts files by time");
- uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 2.0, 0, 0, "Sorts files by size");
- uiBlockEndAlign(block);
-
- cpack(0x0);
- xco+=XIC+10;
-
- type = simasel->type;
-
- if (type != FILE_MAIN) {
- uiDefIconButBitS(block, TOG, FILE_BOOKMARKS, B_RELOADIMASELDIR, ICON_BOOKMARKS,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Toggles Bookmarks on/off");
- xco+=XIC+10;
- }
- xcotitle= xco;
- xco+= BIF_GetStringWidth(G.font, simasel->title, (U.transopts & USER_TR_BUTTONS));
-
- if(simasel->pupmenu && simasel->menup) {
- uiDefButS(block, MENU, B_NOP, simasel->pupmenu, xco+10,0,90,20, simasel->menup, 0, 0, 0, 0, "");
- xco+= 100;
- }
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADIMASELDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Hides dot files");
- uiBlockEndAlign(block);
- xco+=20;
-
- if(!simasel->files) {
- simasel->files = BIF_filelist_new();
- }
-
- if (type == FILE_LOADLIB) {
- do_filter = !BIF_filelist_islibrary(simasel->files, dir, group);
- } else {
- do_filter = (type != FILE_MAIN);
- }
- if ( do_filter ) {
- uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_SORTBYEXT,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Filter files");
- if (simasel->flag & FILE_FILTER) {
- xco+=4;
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_IMAGE_COL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show images");
- uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_BLENDER,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show .blend files");
- uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_SEQUENCE,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show movies");
- uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_PYTHON,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show python scripts");
- uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_SYNTAX,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show fonts");
- uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_SOUND,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show sound files");
- uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_TEXT,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show text files");
- uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILESEL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show folders");
- uiBlockEndAlign(block);
- }
- }
-
- if(simasel->type==FILE_BLENDER) {
- xco+=20;
- } else {
- uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file");
- xco+=90;
- }
-
- if(simasel->type==FILE_LOADLIB) {
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Copies selected data into current project");
- uiDefButBitS(block, TOG, FILE_LINK, B_REDR, "Link", xco+=100,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Creates a link to selected data from current project");
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, FILE_AUTOSELECT, B_REDR, "Autosel", xco+=125,0,65,YIC, &simasel->flag, 0, 0, 0, 0, "Autoselect imported objects");
- uiDefButBitS(block, TOG, FILE_ACTIVELAY, B_REDR, "Active Layer", xco+=65,0,80,YIC, &simasel->flag, 0, 0, 0, 0, "Append object(s) in active layer");
- uiDefButBitS(block, TOG, FILE_ATCURSOR, B_REDR, "At Cursor", xco+=80,0,65,YIC, &simasel->flag, 0, 0, 0, 0, "Append object(s) at cursor, use centroid if more than one object is selected");
- uiBlockEndAlign(block);
-
- xco+= 100; // scroll
-
- } else if(simasel->type==FILE_BLENDER) {
- uiDefButBitI(block, TOGN, G_FILE_NO_UI, B_REDR, "Load UI", xco+=XIC,0,80,YIC, &G.fileflags, 0, 0, 0, 0, "Load the UI setup as well as the scene data");
-
- xco+= 100; // scroll
- }
-
- glRasterPos2f((float)xcotitle, 5.0);
- BIF_RasterPos((float)xcotitle, 5.0); // stupid texture fonts
- BIF_ThemeColor(TH_TEXT);
- BIF_DrawString(uiBlockGetCurFont(block), simasel->title, (U.transopts & USER_TR_BUTTONS));
-
- /* always do as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c
deleted file mode 100644
index b6bd00d2ad6..00000000000
--- a/source/blender/src/header_info.c
+++ /dev/null
@@ -1,2423 +0,0 @@
-/**
- * header_info.c oct-2003
- *
- * Functions to draw the "User Preferences" window header
- * and handle user events sent to it.
- *
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_group_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_object_types.h"
-#include "DNA_packedFile_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_world_types.h"
-
-#include "BDR_editcurve.h"
-#include "BDR_editmball.h"
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-#include "BDR_vpaint.h"
-
-#include "BIF_editarmature.h"
-#include "BIF_editfont.h"
-#include "BIF_editmesh.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_language.h"
-#include "BIF_mainqueue.h"
-#include "BIF_meshtools.h"
-#include "BIF_previewrender.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-#include "BIF_writeimage.h"
-#include "BIF_drawscene.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BKE_blender.h"
-#include "BKE_colortools.h"
-#include "BKE_depsgraph.h"
-#include "BKE_exotic.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_packedFile.h"
-#include "BKE_scene.h"
-#include "BKE_world.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_bpath.h"
-#include "BLO_writefile.h"
-
-#include "BSE_editipo.h"
-#include "BSE_filesel.h"
-#include "BIF_imasel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-#include "BSE_sequence.h"
-#include "BSE_edit.h"
-#include "BSE_time.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "GPU_extensions.h"
-#include "GPU_material.h"
-
-#include "blendef.h"
-#include "interface.h"
-#include "mydevice.h"
-
-extern char versionstr[]; /* from blender.c */
-
-/*----------------------------------*/
-/* Progress bar vars and functions: */
-
-/* strubi shamelessly abused the status line as a progress bar...
- * feel free to kill him after release */
-
-static int g_progress_bar = 0;
-static char *g_progress_info = 0;
-static float g_done;
-
-int start_progress_bar(void)
-{
- g_progress_bar = 1;
- return 1; // we never fail (yet)
-}
-
-void end_progress_bar(void)
-{
- g_progress_bar = 0;
-}
-
-static void update_progress_bar(float done, char *info)
-{
- g_done = done;
- g_progress_info = info;
-}
-
-/** Progress bar
- 'done': a value between 0.0 and 1.0, showing progress
- 'info': a info text what is currently being done
-
- Make sure that the progress bar is always called with:
- done = 0.0 first
- and
- done = 1.0 last -- or alternatively use:
-
- start_progressbar();
- do_stuff_and_callback_progress_bar();
- end_progressbar();
-*/
-
-int progress_bar(float done, char *busy_info)
-{
- ScrArea *sa;
- short val;
-
- /* User break (ESC) */
- while (qtest()) {
- if (extern_qread(&val) == ESCKEY)
- return 0;
- }
- if (done == 0.0) {
- start_progress_bar();
- } else if (done > 0.99) {
- end_progress_bar();
- }
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if (sa->spacetype == SPACE_INFO) {
- update_progress_bar(done, busy_info);
-
- curarea = sa;
-
- scrarea_do_headdraw(curarea);
- areawinset(curarea->win);
- sa->head_swap= WIN_BACK_OK;
- screen_swapbuffers();
- }
- sa = sa->next;
- }
- return 1;
-}
-/* -- End of progress bar definitions ------- */
-
-extern char temp_dir[]; /* XXXXX BAD BAD BAD from exotic.c */
-
-void write_vrml_fs()
-{
- if(G.obedit) {
- error("Can't save VRML. Press TAB to leave EditMode");
- }
- else {
- if(temp_dir[0]==0) strcpy(temp_dir, G.sce);
-
- activate_fileselect(FILE_SPECIAL, "Export VRML 1.0", temp_dir, write_vrml);
- }
-}
-
-void write_dxf_fs()
-{
- if(G.obedit) {
- error("Can't save DXF. Press TAB to leave EditMode");
- }
- else {
-
- if(temp_dir[0]==0) strcpy(temp_dir, G.sce);
-
- activate_fileselect(FILE_SPECIAL, "Export DXF", temp_dir, write_dxf);
- }
-}
-
-void write_stl_fs()
-{
- if(G.obedit) {
- error("Can't save STL. Press TAB to leave EditMode");
- }
- else {
-
- if(temp_dir[0]==0) strcpy(temp_dir, G.sce);
-
- activate_fileselect(FILE_SPECIAL, "Export STL", temp_dir, write_stl);
- }
-}
-/* ------------ */
-
-int buttons_do_unpack()
-{
- int how;
- char menu[2048];
- char *line = menu;
- int ret_value = RET_OK, count = 0;
-
- count = countPackedFiles();
-
- if(!count) {
- pupmenu("No packed files. Autopack disabled");
- return ret_value;
- }
- if (count == 1)
- line += sprintf(line, "Unpack 1 file%%t");
- else
- line += sprintf(line, "Unpack %d files%%t", count);
-
- line += sprintf(line, "|Use files in current directory (create when necessary)%%x%d", PF_USE_LOCAL);
- line += sprintf(line, "|Write files to current directory (overwrite existing files)%%x%d", PF_WRITE_LOCAL);
- line += sprintf(line, "|%%l|Use files in original location (create when necessary)%%x%d", PF_USE_ORIGINAL);
- line += sprintf(line, "|Write files to original location (overwrite existing files)%%x%d", PF_WRITE_ORIGINAL);
- line += sprintf(line, "|%%l|Disable AutoPack, keep all packed files %%x%d", PF_KEEP);
- line += sprintf(line, "|Ask for each file %%x%d", PF_ASK);
-
- how = pupmenu(menu);
-
- if(how == -1)
- ret_value = RET_CANCEL;
- else {
- if (how != PF_KEEP) unpackAll(how);
- G.fileflags &= ~G_AUTOPACK;
- }
-
- return ret_value;
-}
-
-/* here, because of all creator stuff */
-
-Scene *copy_scene(Scene *sce, int level)
-{
- /*
- * level 0: empty, only copy minimal stuff
- * level 1: all objects shared
- * level 2: all object-data shared
- * level 3: full copy
- */
-
- Scene *scen;
- Base *base, *obase;
-
- if (level==0) { /* Add Empty, minimal copy */
- ListBase lb;
- scen= add_scene(sce->id.name+2);
-
- lb= scen->r.layers;
- scen->r= sce->r;
- scen->r.layers= lb;
-
- } else {
- /* level 1+, but not level 0 */
- scen= copy_libblock(sce);
- duplicatelist(&(scen->base), &(sce->base));
-
- clear_id_newpoins();
-
- id_us_plus((ID *)scen->world);
- id_us_plus((ID *)scen->set);
-
- scen->ed= NULL;
- scen->radio= NULL;
- scen->theDag= NULL;
- scen->toolsettings= MEM_dupallocN(sce->toolsettings);
-
- duplicatelist(&(scen->markers), &(sce->markers));
- duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
- duplicatelist(&(scen->r.layers), &(sce->r.layers));
-
- scen->nodetree= ntreeCopyTree(sce->nodetree, 0);
-
- obase= sce->base.first;
- base= scen->base.first;
- while(base) {
- id_us_plus(&base->object->id);
- if(obase==sce->basact) scen->basact= base;
-
- obase= obase->next;
- base= base->next;
- }
-#ifndef DISABLE_PYTHON
- BPY_copy_scriptlink(&sce->scriptlink);
-#endif
- /* sculpt data */
- sce->sculptdata.session = NULL;
- if (sce->sculptdata.cumap) {
- int a;
- scen->sculptdata.cumap = curvemapping_copy(sce->sculptdata.cumap);
- scen->sculptdata.session = NULL; /* this is only for temp data storage anyway */
- for(a=0; a<MAX_MTEX; ++a) {
- if (sce->sculptdata.mtex[a]) {
- scen->sculptdata.mtex[a]= MEM_dupallocN(sce->sculptdata.mtex[a]);
- }
- }
- }
- }
-
- // make a private copy of the avicodecdata
-
- if (sce->r.avicodecdata) {
-
- scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
- scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
- scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
- }
-
- // make a private copy of the qtcodecdata
-
- if (sce->r.qtcodecdata) {
- scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
- scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
- }
-
-
- if(level==0 || level==1) return scen;
-
- /* level 2 */
- G.scene= scen;
-
- single_object_users(0);
-
- /* camera */
- ID_NEW(G.scene->camera);
-
- /* level 3 */
- if(level>=3) {
- if(scen->world) {
- id_us_plus(&scen->world->id);
- scen->world= copy_world(scen->world);
- }
- single_obdata_users(0);
- single_mat_users_expand();
- single_tex_users_expand();
-
- scen->radio= MEM_dupallocN(sce->radio);
-
- }
-
- clear_id_newpoins();
- return scen;
-}
-
-void do_info_buttons(unsigned short event)
-{
- bScreen *sc, *oldscreen;
- Scene *sce, *sce1;
- ScrArea *sa;
- int nr;
-
- switch(event) {
- case B_INFOSCR: /* menu select screen */
-
- if( G.curscreen->screennr== -2) {
- if(curarea->winy <50) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
- activate_databrowse((ID *)G.curscreen, ID_SCR, 0, B_INFOSCR,
- &G.curscreen->screennr, do_info_buttons);
- return;
- }
- if( G.curscreen->screennr < 0) return;
-
- sc= G.main->screen.first;
- nr= 1;
- while(sc) {
- if(nr==G.curscreen->screennr) {
- if(is_allowed_to_change_screen(sc)) setscreen(sc);
- else error("Unable to perform function in EditMode");
- break;
- }
- nr++;
- sc= sc->id.next;
- }
- /* last item: NEW SCREEN */
- if(sc==0) {
- nr= pupmenu("New Screen%t|Empty%x1|Duplicate%x2");
-
- if(nr==1) default_twosplit();
- if(nr==2) duplicate_screen();
- }
- break;
- case B_INFODELSCR:
-/*do this event only with buttons, so it can never be called with full-window*/
-
- if(G.curscreen->id.prev) sc= G.curscreen->id.prev;
- else if(G.curscreen->id.next) sc= G.curscreen->id.next;
- else return;
- if(okee("Delete current screen")) {
- /* find new G.curscreen */
-
- oldscreen= G.curscreen;
- setscreen(sc); /* this test if sc has a full */
- unlink_screen(oldscreen);
- free_libblock(&G.main->screen, oldscreen);
- }
- scrarea_queue_headredraw(curarea);
-
- break;
- case B_INFOSCE: /* menu select scene */
-
- if( G.curscreen->scenenr== -2) {
- if(curarea->winy <50) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
- activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE,
- &G.curscreen->scenenr, do_info_buttons);
- return;
- }
- if( G.curscreen->scenenr < 0) return;
-
- sce= G.main->scene.first;
- nr= 1;
- while(sce) {
- if(nr==G.curscreen->scenenr) {
- if(sce!=G.scene) set_scene(sce);
- break;
- }
- nr++;
- sce= sce->id.next;
- }
- /* last item: NEW SCENE */
- if(sce==0) {
- nr= pupmenu("Add scene%t|Empty%x0|Link Objects%x1|Link ObData%x2|Full Copy%x3");
- if(nr<0) return;
- sce= copy_scene(G.scene, nr);
- set_scene(sce);
- }
- countall();
- BIF_preview_changed(ID_TE);
-
- break;
- case B_INFODELSCE:
-
- if(G.scene->id.prev) sce= G.scene->id.prev;
- else if(G.scene->id.next) sce= G.scene->id.next;
- else return;
- if(okee("Delete current scene")) {
- /* Note, anything besides free_libblock needs to be added in
- * Python Scene.c for Blender.Scene.Unlink() */
-
-
- /* exit modes... could become single call once */
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR);
- exit_paint_modes();
-
- /* check all sets */
- for (sce1= G.main->scene.first; sce1; sce1= sce1->id.next) {
- if(sce1->set == G.scene) sce1->set= 0;
- }
-
- /* check all sequences */
- clear_scene_in_allseqs(G.scene);
-
- /* check render layer nodes in other scenes */
- clear_scene_in_nodes(G.scene);
-
- /* al screens */
-
- for (sc= G.main->screen.first; sc; sc= sc->id.next ) {
- if(sc->scene == G.scene) sc->scene= sce;
- }
- free_libblock(&G.main->scene, G.scene);
- set_scene(sce);
- countall();
- }
-
- break;
- }
-}
-
-static void check_packAll()
-{
- // first check for dirty images
- Image *ima;
-
- for(ima = G.main->image.first; ima; ima= ima->id.next) {
- if (ima->ibufs.first) { /* XXX FIX */
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
-
- if (ibuf && (ibuf->userflags &= IB_BITMAPDIRTY))
- break;
- }
- }
-
- if (ima == NULL || okee("Some images are painted on. These changes will be lost. Continue ?")) {
- packAll();
- G.fileflags |= G_AUTOPACK;
- }
-}
-
-#ifdef _WIN32
-static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir)
-{
- char source_filename[FILE_MAX];
- char dest_filename[FILE_MAX];
-
- strcpy( source_filename, source_dir );
- strcat( source_filename, dll_filename );
-
- strcpy( dest_filename, dest_dir );
- strcat( dest_filename, dll_filename );
-
- if(!BLI_exists(dest_filename)) {
- BLI_copy_fileops( source_filename, dest_filename );
- }
-}
-
-static void copy_all_game_dlls(char *str)
-{
-#define GAME_DLL_COUNT 7
- char *game_dll_list[GAME_DLL_COUNT]={"gnu_gettext.dll", "libpng.dll", "libtiff.dll", "pthreadVC2.dll", "python25.dll", "SDL.dll", "zlib.dll"};
-
- char dest_dir[FILE_MAX];
- char source_dir[FILE_MAX];
- int i;
-
- strcpy(source_dir, get_install_dir());
- strcat(source_dir, "\\");
- BLI_split_dirfile_basic(str, dest_dir, NULL);
-
- for (i= 0; i< GAME_DLL_COUNT; i++) {
- copy_game_dll(game_dll_list[i], source_dir, dest_dir );
- };
-}
-#endif
-
-static int write_runtime(char *str, char *exename)
-{
- char *freestr= NULL;
- char *ext = 0;
-
-#ifdef _WIN32
- ext = ".exe";
-#endif
-
-#ifdef __APPLE__
- ext = ".app";
-#endif
- if (ext && (!BLI_testextensie(str, ext))) {
- freestr= MEM_mallocN(strlen(str) + strlen(ext) + 1, "write_runtime_check");
- sprintf(freestr,"%s%s", str, ext);
- str= freestr;
- }
-
- if (!BLI_exists(str) || saveover(str))
- BLO_write_runtime(str, exename);
-
- if (freestr)
- MEM_freeN(freestr);
-
- return 0;
-}
-
-static void write_runtime_check_dynamic(char *str)
-{
- write_runtime(str, "blenderdynplayer.exe");
-}
-
-static void write_runtime_check(char *str)
-{
- char player[128];
-
- strcpy(player, "blenderplayer");
-
-#ifdef _WIN32
- strcat(player, ".exe");
-#endif
-
-#ifdef __APPLE__
- strcat(player, ".app");
-#endif
-
- write_runtime(str, player);
-
-#ifdef _WIN32
- // get a list of the .DLLs in the Blender folder and copy all of these to the destination folder if they don't exist
- copy_all_game_dlls(str);
-#endif
-}
-
-
-/* end keyed functions */
-
-/************************** MAIN MENU *****************************/
-/************************** FILE *****************************/
-
-
-static void do_info_file_importmenu(void *arg, int event)
-{
- ScrArea *sa;
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= find_biggest_area_of_type(SPACE_SCRIPT);
- if (!sa) sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
-#ifndef DISABLE_PYTHON
- /* events >=3 are registered bpython scripts */
- if (event >= 3) {
- BPY_menu_do_python(PYMENU_IMPORT, event - 3);
- BIF_undo_push("Import file");
- } else
-#endif
- {
- switch(event) {
-
- case 0: /* DXF */
- activate_fileselect(FILE_BLENDER, "Import DXF", G.sce, BIF_read_file);
- break;
- case 1: /* VRML 1.0 */
- activate_fileselect(FILE_BLENDER, "Import VRML 1.0", G.sce, BIF_read_file);
- break;
- case 2: /* STL */
- activate_fileselect(FILE_BLENDER, "Import STL", G.sce, BIF_read_file);
- break;
-
- }
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_file_importmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_file_importmenu, NULL);
- //uiBlockSetXOfs(block, -50); // offset to parent button
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "VRML 1.0...",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "DXF...",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "STL...",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, "");
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for (pym = BPyMenuTable[PYMENU_IMPORT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+3, pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_info_file_exportmenu(void *arg, int event)
-{
- ScrArea *sa;
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= find_biggest_area_of_type(SPACE_SCRIPT);
- if (!sa) sa= closest_bigger_area();
- areawinset(sa->win);
- }
-#ifndef DISABLE_PYTHON
- /* events >=3 are registered bpython scripts */
- if (event >= 3) BPY_menu_do_python(PYMENU_EXPORT, event - 3);
- else
-#endif
- switch(event) {
-
- case 0:
- write_vrml_fs();
- break;
- case 1:
- write_dxf_fs();
- break;
- case 2:
- write_stl_fs();
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_file_exportmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "exportmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_file_exportmenu, NULL);
- //uiBlockSetXOfs(block, -50); // offset to parent button
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "VRML 1.0...|Ctrl F2",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "DXF...|Shift F2",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "STL...",
- 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- /* note that we acount for the 3 previous entries with i+3: */
- for (pym = BPyMenuTable[PYMENU_EXPORT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i+3,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-#ifdef WITH_VERSE
-
-extern ListBase session_list;
-
-static void do_verse_filemenu(void *arg, int event)
-{
- char address[64]; /* lenght of domain name is 63 characters or less */
- VerseSession *session = NULL;
- ScrArea *sa;
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- switch(event) {
- case 0:
- waitcursor(1);
- printf("Connecting to localhost!\n");
- b_verse_connect("localhost");
- waitcursor(0);
- break;
- case 1:
- address[0] = '\0';
- if(sbutton(address, 0, 63, "Server:")) {
- waitcursor(1);
- printf("Connecting to %s\n", address);
- b_verse_connect(address);
- waitcursor(0);
- }
- break;
- case 2:
- session = session_menu();
- if(session) {
- printf("Disconnecting session: %s!\n", session->address);
- end_verse_session(session);
- }
- break;
- case 3:
- printf("Disconnecting all sessions!\n");
- end_all_verse_sessions();
- break;
- case 4:
- printf("sending get to master server\n");
- b_verse_ms_get();
- break;
- }
-}
-
-static uiBlock *verse_filemenu(void *unusedargs)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "verse_filemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_verse_filemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect to localhost", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect ...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- if(session_list.first != NULL) {
- if(session_list.first != session_list.last) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect ...",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect all",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- }
- else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- }
-
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Get Servers", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif
-
-static void do_info_filemenu(void *arg, int event)
-{
- ScrArea *sa;
- char dir[FILE_MAX];
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- /* these are no defines, easier this way, the codes are in the function below */
- switch(event) {
- case 0:
- if (okee("Erase All")) {
- if (!BIF_read_homefile(0))
- error("No file ~/.B.blend");
- }
- break;
- case 1: /* open */
- activate_fileselect(FILE_BLENDER, "Open", G.sce, BIF_read_file);
- break;
- case 3: /* append */
- activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0);
- break;
- case 4: /* save */
- BLI_strncpy(dir, G.sce, FILE_MAX);
- untitled(dir);
- activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file);
- break;
- case 5:
- BLI_strncpy(dir, G.sce, FILE_MAX);
- if (untitled(dir)) {
- activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file);
- } else {
- BIF_write_file(dir);
- free_filesel_spec(dir);
- }
- break;
- case 6: /* save image */
- BIF_save_rendered_image_fs();
- break;
- case 7:
- activate_imageselect(FILE_LOADLIB, "Load Library", G.lib, 0);
- break;
- case 22: /* save runtime */
- activate_fileselect(FILE_SPECIAL, "Save Runtime", "", write_runtime_check);
- break;
- case 23: /* save dynamic runtime */
- activate_fileselect(FILE_SPECIAL, "Save Dynamic Runtime", "", write_runtime_check_dynamic);
- break;
- case 24:
- BIF_screendump(0);
- break;
- case 25:
- BIF_screendump(1);
- break;
- case 13:
- exit_usiblender();
- break;
- case 15: /* recover previous session */
- {
- extern short winqueue_break; /* editscreen.c */
- int save_over, retval = 0;
- char str[FILE_MAX];
- char scestr[FILE_MAX];
-
- BLI_strncpy(scestr, G.sce, FILE_MAX); /* temporal store */
- save_over = G.save_over;
- BLI_make_file_string("/", str, btempdir, "quit.blend");
- retval = BKE_read_file(str, NULL);
-
- /*we successfully loaded a blend file, get sure that
- pointcache works */
- if (retval!=0) G.relbase_valid = 1;
-
- G.save_over = save_over;
- strcpy(G.sce, scestr);
-
- winqueue_break= 1; /* leave queues everywhere */
-
- BKE_reset_undo();
- BKE_write_undo("Original"); /* save current state */
- refresh_interface_font();
- }
- break;
- case 31: /* save default settings */
- BIF_write_homefile();
- break;
- case 32:
- if (okee("Erase All")) {
- if (!BIF_read_homefile(1))
- error("Can't read data from memory!");
- }
- break;
- case 35: /* compress toggle */
- U.flag ^= (USER_FILECOMPRESS);
- break;
- }
-
- allqueue(REDRAWINFO, 0);
-}
-
-static void do_info_operecentmenu(void *arg, int event)
-{
- struct RecentFile *recent;
-
- if(event==0 && G.sce[0]) {
- BIF_read_file(G.sce);
- }
- else { /* Global */
- recent = BLI_findlink(&(G.recent_files), event-1);
- BIF_read_file(recent->filename);
- }
-}
-
-static uiBlock *info_openrecentmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120, i;
- struct RecentFile *recent;
-
- block= uiNewBlock(&curarea->uiblocks, "info_openrecentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_operecentmenu, NULL);
-
- if (G.sce[0]) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, G.sce, 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- }
-
- for (recent = G.recent_files.first, i=0; i<U.recent_files && recent; recent = recent->next, i++) {
- if (strcmp(recent->filename, G.sce)!=0) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, recent->filename, 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, i+1, "");
- }
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_info_externalfiles(void *arg, int event)
-{
- switch (event) {
-
- case 1: /* pack data */
- check_packAll();
- break;
-#if 0
- case 2: /* unpack to current dir */
- unpackAll(PF_WRITE_LOCAL);
- G.fileflags &= ~G_AUTOPACK;
- break;
-#endif
- case 3: /* unpack data */
- if (buttons_do_unpack() != RET_CANCEL) {
- /* Clear autopack bit only if user selected one of the unpack options */
- G.fileflags &= ~G_AUTOPACK;
- }
- break;
- case 10: /* make all paths relative */
- if (G.relbase_valid) {
- int tot,changed,failed,linked;
- char str[512];
- char txtname[24]; /* text block name */
- txtname[0] = '\0';
- makeFilesRelative(txtname, &tot, &changed, &failed, &linked);
- if (failed) sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked);
- else sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked);
- pupmenu(str);
- } else {
- pupmenu("Can't set relative paths with an unsaved blend file");
- }
- break;
- case 11: /* make all paths absolute */
- {
- int tot,changed,failed,linked;
- char str[512];
- char txtname[24]; /* text block name */
- txtname[0] = '\0';
- makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked);
- sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked);
- if (failed) sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked);
- else sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked);
-
- pupmenu(str);
- }
- break;
- case 12: /* check images exist */
- {
- char txtname[24]; /* text block name */
- txtname[0] = '\0';
-
- /* run the missing file check */
- checkMissingFiles( txtname );
-
- if (txtname[0] == '\0') {
- okee("No external files missing");
- } else {
- char str[128];
- sprintf(str, "Missing files listed in Text \"%s\"", txtname );
- error(str);
- }
- }
- break;
- case 13: /* search for referenced files that are not available */
- if(curarea->spacetype==SPACE_INFO) {
- ScrArea *sa;
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
- activate_fileselect(FILE_SPECIAL, "Find Missing Files", "", findMissingFiles);
- break;
- }
-
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_externalfiles(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "info_externalfiles", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_externalfiles, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into .blend file", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
-#if 0
- uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Removes all packed files from the project and saves them to the current directory");
-#endif
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack into Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Absolute", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static uiBlock *info_filemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco=0;
- short menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "info_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_filemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Ctrl X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-#ifdef WITH_VERSE
- uiDefIconTextBlockBut(block, verse_filemenu, NULL, ICON_RIGHTARROW_THIN, "Verse", 0, yco-=20, menuwidth, 19, "");
-#endif
- uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...|F2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- if(U.flag & USER_FILECOMPRESS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Rendered Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
-#if GAMEBLENDER == 1
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
-#ifdef _WIN32
-// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
-#endif
-#endif
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, "");
-
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-/**************************** ADD ******************************/
-
-void do_info_add_meshmenu(void *arg, int event)
-{
-#ifndef DISABLE_PYTHON
- if (event>=20) {
- BPY_menu_do_python(PYMENU_ADDMESH, event - 20);
- } else
-#endif
- {
- switch(event) {
- case 0:
- /* Plane */
- add_primitiveMesh(0);
- break;
- case 1:
- /* Cube */
- add_primitiveMesh(1);
- break;
- case 2:
- /* Circle */
- add_primitiveMesh(4);
- break;
- case 3:
- /* UVsphere */
- add_primitiveMesh(11);
- break;
- case 4:
- /* IcoSphere */
- add_primitiveMesh(12);
- break;
- case 5:
- /* Cylinder */
- add_primitiveMesh(5);
- break;
- case 7:
- /* Cone */
- add_primitiveMesh(7);
- break;
- case 8:
- /* Grid */
- add_primitiveMesh(10);
- break;
- case 9:
- /* Monkey */
- add_primitiveMesh(13);
- break;
- default:
- break;
- }
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_add_meshmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
-
- /* Python Menu */
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i=0;
-
- block= uiNewBlock(&curarea->uiblocks, "add_meshmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_meshmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plane|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UVsphere", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "IcoSphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cylinder|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cone|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grid|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Monkey|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 9, "");
-
-#ifndef DISABLE_PYTHON
- pym = BPyMenuTable[PYMENU_ADDMESH];
- if (pym) {
- uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for (; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, i+20, pym->tooltip?pym->tooltip:pym->filename);
- }
- }
-#endif
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_info_add_curvemenu(void *arg, int event)
-{
-
- switch(event) {
- case 0:
- /* Bezier Curve */
- add_primitiveCurve(10);
- break;
- case 1:
- /* Bezier Circle */
- add_primitiveCurve(11);
- break;
- case 2:
- /* NURB Curve */
- add_primitiveCurve(40);
- break;
- case 3:
- /* NURB Circle */
- add_primitiveCurve(41);
- break;
- case 4:
- /* Path */
- add_primitiveCurve(46);
- break;
- default:
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_add_curvemenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "add_curvemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_curvemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Path|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-
-void do_info_add_surfacemenu(void *arg, int event)
-{
-
- switch(event) {
- case 0:
- /* Curve */
- add_primitiveNurb(0);
- break;
- case 1:
- /* Circle */
- add_primitiveNurb(1);
- break;
- case 2:
- /* Surface */
- add_primitiveNurb(2);
- break;
- case 3:
- /* Tube */
- add_primitiveNurb(3);
- break;
- case 4:
- /* Sphere */
- add_primitiveNurb(4);
- break;
- case 5:
- /* Donut */
- add_primitiveNurb(5);
- break;
- default:
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_add_surfacemenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_surfacemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Surface|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Tube", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Sphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Donut|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_info_add_metamenu(void *arg, int event)
-{
-
- switch(event) {
- case 0:
- /* Ball */
- add_primitiveMball(1);
- break;
- case 1:
- /* Tube */
- add_primitiveMball(2);
- break;
- case 2:
- /* Plane */
- add_primitiveMball(3);
- break;
- case 3:
- /* Elipsoid */
- add_primitiveMball(4);
- break;
- case 4:
- /* Cube */
- add_primitiveMball(5);
- break;
- default:
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-
-static uiBlock *info_add_metamenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short xco= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "add_metamenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_metamenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,"Meta Ball|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Tube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Ellipsoid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_info_add_lampmenu(void *arg, int event)
-{
-
- switch(event) {
- case 0: /* lamp */
- add_objectLamp(LA_LOCAL);
- break;
- case 1: /* sun */
- add_objectLamp(LA_SUN);
- break;
- case 2: /* spot */
- add_objectLamp(LA_SPOT);
- break;
- case 3: /* hemi */
- add_objectLamp(LA_HEMI);
- break;
- case 4: /* area */
- add_objectLamp(LA_AREA);
- break;
- case 5: /* YafRay photon lamp */
- if (G.scene->r.renderer==R_YAFRAY)
- add_objectLamp(LA_YF_PHOTON);
- break;
- default:
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_add_lampmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "add_lampmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_lampmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Sun|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spot|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hemi|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Area|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, "");
- if (G.scene->r.renderer==R_YAFRAY)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Photon|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_info_add_groupmenu(void *arg, int event)
-{
- Object *ob;
-
- add_object_draw(OB_EMPTY);
- ob= OBACT;
-
- ob->dup_group= BLI_findlink(&G.main->group, event);
- if(ob->dup_group) {
- id_us_plus((ID *)ob->dup_group);
- ob->transflag |= OB_DUPLIGROUP;
- DAG_scene_sort(G.scene);
- }
-}
-
-
-static uiBlock *info_add_groupmenu(void *arg_unused)
-{
- Group *group;
- uiBlock *block;
- short yco= 0;
- int a;
-
- block= uiNewBlock(&curarea->uiblocks, "add_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_add_groupmenu, NULL);
-
- for(a=0, group= G.main->group.first; group; group= group->id.next, a++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, group->id.name+2, 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, a, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_info_addmenu(void *arg, int event)
-{
-#ifndef DISABLE_PYTHON
- if (event>=20) {
- BPY_menu_do_python(PYMENU_ADD, event - 20);
- } else
-#endif
- {
- switch(event) {
- case 0:
- /* Mesh */
- break;
- case 1:
- /* Curve */
- break;
- case 2:
- /* Surface */
- break;
- case 3:
- /* Metaball */
- break;
- case 4:
- /* Text (argument is discarded) */
- add_primitiveFont(event);
- break;
- case 5:
- /* Empty */
- add_object_draw(OB_EMPTY);
- break;
- case 6:
- /* Camera */
- add_object_draw(OB_CAMERA);
- break;
- case 8:
- /* Armature */
- add_primitiveArmature(OB_ARMATURE);
- break;
- case 9:
- /* Lattice */
- add_object_draw(OB_LATTICE);
- break;
- case 10:
- /* group instance not yet */
- break;
- default:
- break;
- }
- }
- allqueue(REDRAWINFO, 0);
-}
-
-
-static uiBlock *info_addmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i=0;
- short yco= 0;
-
- block= uiNewBlock(&curarea->uiblocks, "addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_addmenu, NULL);
-
- uiDefIconTextBlockBut(block, info_add_meshmenu, NULL, ICON_RIGHTARROW_THIN, "Mesh", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, info_add_curvemenu, NULL, ICON_RIGHTARROW_THIN, "Curve", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, info_add_surfacemenu, NULL, ICON_RIGHTARROW_THIN, "Surface", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, info_add_metamenu, NULL, ICON_RIGHTARROW_THIN, "Meta", 0, yco-=20, 120, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, info_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBlockBut(block, info_add_lampmenu, NULL, ICON_RIGHTARROW_THIN, "Lamp", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 9, "");
-
-#ifndef DISABLE_PYTHON
- pym = BPyMenuTable[PYMENU_ADD];
- if (pym) {
- uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 1620, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for (; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, i+20, pym->tooltip?pym->tooltip:pym->filename);
- }
- }
-#endif
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-/************************** GAME *****************************/
-
-void do_info_game_glslmenu(void *arg, int event)
-{
- switch (event) {
- case G_FILE_GLSL_NO_LIGHTS:
- case G_FILE_GLSL_NO_SHADERS:
- case G_FILE_GLSL_NO_SHADOWS:
- case G_FILE_GLSL_NO_RAMPS:
- case G_FILE_GLSL_NO_NODES:
- case G_FILE_GLSL_NO_EXTRA_TEX:
- G.fileflags ^= event;
- GPU_materials_free();
- allqueue(REDRAWINFO, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- default:
- break;
- }
-}
-
-static uiBlock *info_game_glslmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=160;
- int check;
-
- block= uiNewBlock(&curarea->uiblocks, "game_glslmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_game_glslmenu, NULL);
-
- check = (G.fileflags & G_FILE_GLSL_NO_LIGHTS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Lights", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_LIGHTS,
- "Enable using lights in GLSL materials.");
- check = (G.fileflags & G_FILE_GLSL_NO_SHADERS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Shaders", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_SHADERS,
- "Enable using shaders other than Lambert in GLSL materials");
- check = (G.fileflags & G_FILE_GLSL_NO_SHADOWS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Shadows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_SHADOWS,
- "Enable using shadows in GLSL materials");
- check = (G.fileflags & G_FILE_GLSL_NO_RAMPS)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Ramps", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_RAMPS,
- "Enable using ramps in GLSL materials");
- check = (G.fileflags & G_FILE_GLSL_NO_NODES)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Nodes", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_NODES,
- "Enable using nodes in GLSL materials.");
- check = (G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX)? ICON_CHECKBOX_DEHLT: ICON_CHECKBOX_HLT;
- uiDefIconTextBut(block, BUTM, 1, check, "Enable Extra Textures", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GLSL_NO_EXTRA_TEX,
- "Enable using texture channels other than Col and Alpha in GLSL materials.");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_info_gamemenu(void *arg, int event)
-{
- switch (event) {
- case G_FILE_ENABLE_ALL_FRAMES:
- case G_FILE_DISPLAY_LISTS:
- case G_FILE_SHOW_FRAMERATE:
- case G_FILE_SHOW_DEBUG_PROPS:
- case G_FILE_AUTOPLAY:
- case G_FILE_GAME_TO_IPO:
- case G_FILE_SHOW_PHYSICS:
- G.fileflags ^= event;
- break;
- case G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL:
- G.fileflags &= ~(G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL);
- break;
- case G_FILE_GAME_MAT:
- G.fileflags |= G_FILE_GAME_MAT;
- G.fileflags &= ~G_FILE_GAME_MAT_GLSL;
- break;
- case G_FILE_GAME_MAT_GLSL:
- if(!GPU_extensions_minimum_support())
- error("GLSL not supported with this graphics card or driver.");
- G.fileflags |= (G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL);
- break;
- default:
- ; /* ignore the rest */
- }
-}
-
-static uiBlock *info_gamemenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
- short menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "gamemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_gamemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, B_STARTGAME, ICON_BLANK1, "Start Game|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, "");
-
-
- if(G.fileflags & G_FILE_ENABLE_ALL_FRAMES) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES, "");
- }
-
- if(G.fileflags & G_FILE_GAME_TO_IPO) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, "");
- } else {
-
- if(G.fileflags & G_FILE_DISPLAY_LISTS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, "");
- }
-
- if(G.fileflags & G_FILE_SHOW_FRAMERATE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE, "");
- }
-
-
- if(G.fileflags & G_FILE_SHOW_PHYSICS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Physics Visualization", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_PHYSICS, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Physics Visualization", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_PHYSICS, "");
- }
-
- if(G.fileflags & G_FILE_SHOW_DEBUG_PROPS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, "");
-
- if(!(G.fileflags & G_FILE_GAME_MAT)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Texture Face Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Texture Face Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL, "");
- }
-
- if((G.fileflags & G_FILE_GAME_MAT) && !(G.fileflags & G_FILE_GAME_MAT_GLSL)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Blender Multitexture Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Blender Multitexture Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, "");
- }
-
- if((G.fileflags & G_FILE_GAME_MAT) && (G.fileflags & G_FILE_GAME_MAT_GLSL)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Blender GLSL Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Blender GLSL Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT_GLSL, "");
- }
-
- uiDefIconTextBlockBut(block, info_game_glslmenu, NULL, ICON_RIGHTARROW_THIN, "GLSL Material Settings", 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, "");
-
- if(G.fileflags & G_FILE_AUTOPLAY) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY, "");
- }
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 70);
-
- return block;
-}
-/************************** TIMELINE *****************************/
-
-static void do_info_timelinemenu(void *arg, int event)
-{
- /* needed to check for valid selected objects */
- Base *base=NULL;
- Object *ob=NULL;
- //char file[FILE_MAXDIR+FILE_MAXFILE];
-
- base= BASACT;
- if (base) ob= base->object;
-
- switch(event) {
- case 1:
- /* Show Keyframes */
- if (!ob) error("Select an object before showing its keyframes");
- else set_ob_ipoflags();
- break;
- case 2:
- /* Show and select Keyframes */
- if (!ob) error("Select an object before showing and selecting its keyframes");
- else select_select_keys();
- break;
- case 3:
- /* select next keyframe */
- if (!ob) error("Select an object before selecting its next keyframe");
- else nextkey_obipo(1);
- break;
- case 4:
- /* select previous keyframe */
- if (!ob) error("Select an object before selecting its previous keyframe");
- else nextkey_obipo(-1);
- break;
- case 5:
- /* next keyframe */
- if (!ob) error("Select an object before going to its next keyframe");
- else movekey_obipo(1);
- break;
- case 6:
- /* previous keyframe */
- if (!ob) error("Select an object before going to its previous keyframe");
- else movekey_obipo(-1);
- break;
- case 7:
- /* next frame */
- CFRA++;
- update_for_newframe();
- break;
- case 8:
- /* previous frame */
- CFRA--;
- if(CFRA<1) CFRA=1;
- update_for_newframe();
- break;
- case 9:
- /* forward 10 frames */
- CFRA+= 10;
- update_for_newframe();
- break;
- case 10:
- /* back 10 frames */
- CFRA-= 10;
- if(CFRA<1) CFRA=1;
- update_for_newframe();
- break;
- case 11:
- /* end frame */
- CFRA= EFRA;
- update_for_newframe();
- break;
- case 12:
- /* start frame */
- CFRA= SFRA;
- update_for_newframe();
- break;
- case 13:
- /* previous keyframe */
- nextprev_timeline_key(-1);
- break;
- case 14:
- /* next keyframe */
- nextprev_timeline_key(1);
- break;
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_timelinemenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- char str[26];
- short yco= 0;
- short menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "timelinemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_timelinemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Keyframes|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show and Select Keyframes|Shift K",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Next Keyframe|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Previous Keyframe|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Ob-Keyframe|Shift PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Ob-Keyframe|Shift PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Keyframe|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Keyframe|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Frame|RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Frame|LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- sprintf(str, "Forward %d Frames|UpArrow", G.scene->jumpframe);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- sprintf(str, "Back %d Frames|DownArrow", G.scene->jumpframe);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "End Frame|Shift RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Start Frame|Shift LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-/************************** RENDER *****************************/
-
-void do_info_render_bakemenu(void *arg, int event)
-{
- switch (event) {
- case 6:
- G.scene->r.bake_flag ^= event;
- break;
- default:
- objects_bake_render_ui(event);
- }
-
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_render_bakemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=160;
-
- block= uiNewBlock(&curarea->uiblocks, "render_bakemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_render_bakemenu, NULL);
-
- if(G.scene->r.bake_flag & R_BAKE_TO_ACTIVE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Full Render|Ctrl Alt B, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ambient Occlusion|Ctrl Alt B, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Normals|Ctrl Alt B, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Only|Ctrl Alt B, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Displacement|Ctrl Alt B, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_info_rendermenu(void *arg, int event)
-{
- ScrArea *sa;
- extern void playback_anim();
-
- /* events >=10 are registered bpython scripts */
- if (event >= 10) {
- if(curarea->spacetype==SPACE_INFO) {
- sa= find_biggest_area_of_type(SPACE_SCRIPT);
- if (!sa) sa= closest_bigger_area();
- areawinset(sa->win);
- }
-#ifndef DISABLE_PYTHON
- BPY_menu_do_python(PYMENU_RENDER, event - 10);
- BIF_undo_push("Rendering Script");
-#endif
- }
- else {
- switch(event) {
-
- case 0:
- BIF_do_render(0);
- break;
- case 1:
- BIF_do_render(1);
- break;
-
- /* note: dont use select_area() for setting active areas for opengl render */
- /* its hackish and instable... code here was removed */
-
- case 4:
- BIF_toggle_render_display();
- break;
- case 5:
- playback_anim();
- break;
- case 6:
- /* dodgy hack turning on SHIFT key to do a proper render border select
- set_render_border(); only works when 3d window active
-
- This code copied from toolbox.c, only works when 3d window is cameraview */
-
- if(select_area(SPACE_VIEW3D)) {
- mainqenter(LEFTSHIFTKEY, 1);
- mainqenter(BKEY, 1);
- mainqenter(BKEY, 0);
- mainqenter(EXECUTE, 1);
- mainqenter(LEFTSHIFTKEY, 0);
- }
-
- break;
-
- case 7:
- extern_set_butspace(F10KEY, 0);
- break;
- }
- }
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_rendermenu(void *arg_unused)
-{
- uiBlock *block;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- short yco= 0;
- short menuwidth=120;
- int i=0;
-
- block= uiNewBlock(&curarea->uiblocks, "rendermenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_rendermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Current Frame|F12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Animation|Ctrl F12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, info_render_bakemenu, NULL, ICON_RIGHTARROW_THIN, "Bake Render Meshes", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Render Buffer|F11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Rendered Animation|Ctrl F11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Render Border|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Settings|F10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for (pym = BPyMenuTable[PYMENU_RENDER]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-/************************** HELP *****************************/
-
-static void do_info_help_websitesmenu(void *arg, int event)
-{
-#ifndef DISABLE_PYTHON
- BPY_menu_do_python(PYMENU_HELPWEBSITES, event);
-#endif
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static uiBlock *info_help_websitesmenu(void *arg_unused)
-{
- uiBlock *block;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- short yco = 20, menuwidth = 120;
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "info_help_websitesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_help_websitesmenu, NULL);
-#ifndef DISABLE_PYTHON
- for (pym = BPyMenuTable[PYMENU_HELPWEBSITES]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_info_help_systemmenu(void *arg, int event)
-{
- /* events >=10 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 10) BPY_menu_do_python(PYMENU_HELPSYSTEM, event - 10);
- else
-#endif
- {
- switch(event) {
-
- case 1: /* Benchmark */
- /* dodgy hack turning on CTRL ALT SHIFT key to do a benchmark
- * rather than copying lines and lines of code from toets.c :(
- */
-
- if(select_area(SPACE_VIEW3D)) {
- mainqenter(LEFTSHIFTKEY, 1);
- mainqenter(LEFTCTRLKEY, 1);
- mainqenter(LEFTALTKEY, 1);
- mainqenter(TKEY, 1);
- mainqenter(TKEY, 0);
- mainqenter(EXECUTE, 1);
- mainqenter(LEFTSHIFTKEY, 0);
- mainqenter(LEFTCTRLKEY, 0);
- mainqenter(LEFTALTKEY, 0);
- }
- break;
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static uiBlock *info_help_systemmenu(void *arg_unused)
-{
- uiBlock *block;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- short yco = 20, menuwidth = 120;
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "info_help_systemmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_info_help_systemmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Benchmark", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-#ifndef DISABLE_PYTHON
- for (pym = BPyMenuTable[PYMENU_HELPSYSTEM]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_info_helpmenu(void *arg, int event)
-{
- ScrArea *sa;
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= find_biggest_area_of_type(SPACE_SCRIPT);
- if (!sa) sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- /* events >=10 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 10) BPY_menu_do_python(PYMENU_HELP, event - 10);
- else
-#endif
- {
- switch(event) {
-
- case 0: /* About Blender */
- break;
- }
- }
-
- allqueue(REDRAWINFO, 0);
-}
-
-static uiBlock *info_helpmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0;
- short menuwidth=120;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "info_helpmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_info_helpmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, B_SHOWSPLASH, ICON_BLANK1, "About Blender...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for (pym = BPyMenuTable[PYMENU_HELP]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, info_help_websitesmenu, NULL, ICON_RIGHTARROW_THIN, "Websites", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, info_help_systemmenu, NULL, ICON_RIGHTARROW_THIN, "System", 0, yco-=20, 120, 19, "");
-
- uiBlockSetDirection(block, UI_DOWN);
- uiTextBoundsBlock(block, 80);
-
- return block;
-}
-
-/************************** END MAIN MENU *****************************/
-/* ugly global yes, for renderwin.c to write to */
-char info_time_str[32]="";
-
-static void info_text(int x, int y)
-{
- Object *ob= OBACT;
- extern float hashvectf[];
- uintptr_t mem_in_use, mmap_in_use;
- unsigned int swatch_color;
- float fac1, fac2, fac3;
- char infostr[300], memstr[64];
- char *headerstr, *s;
- int hsize;
-
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
-
- s= memstr + sprintf(memstr," | Mem:%.2fM ", ((mem_in_use-mmap_in_use)>>10)/1024.0);
- if(mmap_in_use)
- sprintf(s,"(%.2fM) ", ((mmap_in_use)>>10)/1024.0);
-
-
- if(G.obedit) {
- s = infostr;
-
- s+= sprintf(s, "%s", G.editModeTitleExtra);
- if(G.obedit->type==OB_MESH) {
- if(G.scene->selectmode & SCE_SELECT_VERTEX)
- s+= sprintf(s,"Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
- G.totvertsel, G.totvert, G.totedgesel, G.totedge, G.totfacesel, G.totface);
- else if(G.scene->selectmode & SCE_SELECT_EDGE)
- s+= sprintf(s,"Ed:%d-%d | Fa:%d-%d",
- G.totedgesel, G.totedge, G.totfacesel, G.totface);
- else
- s+= sprintf(s,"Fa:%d-%d", G.totfacesel, G.totface);
- }
- else if(G.obedit->type==OB_ARMATURE) {
- s+= sprintf(s,"Ve:%d-%d | Bo:%d-%d", G.totvertsel, G.totvert, G.totbonesel, G.totbone);
- }
- else {
- s+= sprintf(s,"Ve:%d-%d", G.totvertsel, G.totvert);
- }
-
- strcat(s, memstr);
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- sprintf(infostr,"Bo:%d-%d %s",
- G.totbonesel, G.totbone, memstr);
- }
- else {
- sprintf(infostr,"Ve:%d | Fa:%d | Ob:%d-%d | La:%d %s | Time:%s | ",
- G.totvert, G.totface, G.totobj, G.totobjsel, G.totlamp, memstr, info_time_str);
- }
- if(ob) {
- strcat(infostr, ob->id.name+2);
- }
-
- if (g_progress_bar && g_progress_info) {
- headerstr= g_progress_info;
- } else {
- headerstr= versionstr;
- }
-
- if (g_progress_bar) {
- hsize = 4 + (138.0 * g_done);
- fac1 = 0.5 * g_done; /* do some rainbow colors on progress */
- fac2 = 1.0;
- fac3 = 0.9;
- } else {
- hsize= 30+BIF_GetStringWidth(G.font, headerstr, (U.transopts & USER_TR_BUTTONS));
-
- /* promise! Never change these lines again! (zr & ton did!) */
- fac1= fabs(hashvectf[ 2*G.version+4]);
- fac2= 0.5+0.1*hashvectf[ G.version+3];
- fac3= 0.7;
- }
-
- swatch_color= hsv_to_cpack(fac1, fac2, fac3);
-
- cpack( swatch_color );
- glRecti(x-24, y-6, x-30+hsize, y+14);
-
- glColor3ub(0, 0, 0); /* makes text black colored rect */
-
- glRasterPos2i(x, y);
- BIF_RasterPos(x, y);
-
- BIF_DrawString(G.font, headerstr, (U.transopts & USER_TR_MENUS));
- hsize= BIF_GetStringWidth(G.font, headerstr, (U.transopts & USER_TR_BUTTONS));
-
- BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */
-
- glRasterPos2i(x+hsize+10, y);
- BIF_RasterPos(x+hsize+10, y);
-
- BIF_DrawString(G.font, infostr, (U.transopts & USER_TR_MENUS));
-}
-
-void info_buttons(void)
-{
- uiBlock *block;
- short xco= 42;
- int xmax;
-
- block= uiNewBlock(&curarea->uiblocks, "header info", UI_EMBOSSN, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
-
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- /* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted
- * menu is drawn wider than it should be. The ypos of -1 is to make it properly fill the
- * height of the header */
- xmax= GetButStringLength("File");
- uiDefPulldownBut(block, info_filemenu, NULL, "File", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Add");
- uiDefPulldownBut(block, info_addmenu, NULL, "Add", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Timeline");
- uiDefPulldownBut(block, info_timelinemenu, NULL, "Timeline", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Game");
- uiDefPulldownBut(block, info_gamemenu, NULL, "Game", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Render");
- uiDefPulldownBut(block, info_rendermenu, NULL, "Render", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Help");
- uiDefPulldownBut(block, info_helpmenu, NULL, "Help", xco, -1, xmax-3, 22, "");
- xco+= xmax;
-
- }
-
- /* pack icon indicates a packed file */
-
- if (G.fileflags & G_AUTOPACK) {
- uiBlockSetEmboss(block, UI_EMBOSSN);
- uiDefIconBut(block, LABEL, 0, ICON_PACKAGE, xco, 0, XIC, YIC, &G.fileflags, 0.0, 0.0, 0, 0, "Indicates this is a Packed file. See File menu.");
- xco += XIC;
- }
-
- if (curarea->full == 0) {
- curarea->butspacetype= SPACE_INFO;
- uiBlockSetEmboss(block, UI_EMBOSS);
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), 8,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
-
- /* STD SCREEN BUTTONS */
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_INFOSCR, ID_SCR, 0, (ID *)G.curscreen, 0, &G.curscreen->screennr, 1, 1, B_INFODELSCR, 0, 0);
-
- xco +=8;
-
- /* STD SCENE BUTTONS */
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_INFOSCE, ID_SCE, 0, (ID *)G.scene, 0, &G.curscreen->scenenr, 1, 1, B_INFODELSCE, 0, 0);
- }
- else xco= 430;
-
-BIF_SetScale(block->aspect);
- info_text(xco+24, 6);
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- uiDefIconBut(block, BUT, B_SHOWSPLASH, ICON_BLENDER, xco+2, 0,XIC,YIC, 0, 0, 0, 0, 0, "Click to display Splash Screen");
-
- /* always do as last */
- curarea->headbutlen= xco+2*XIC;
-
-#if 0
-// #ifdef _WIN32 // FULLSCREEN
- if(U.uiflag & USER_FLIPFULLSCREEN) {
- uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW,
- (short)(curarea->winx-XIC-5), 0,XIC,YIC,
- 0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
- } else {
- uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_FULLSCREEN,
- (short)(curarea->winx-XIC-5), 0,XIC,YIC,
- 0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */
- }
-#endif
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c
deleted file mode 100644
index 27549a5b502..00000000000
--- a/source/blender/src/header_ipo.c
+++ /dev/null
@@ -1,1433 +0,0 @@
-/**
- * header_ipo.c oct-2003
- *
- * Functions to draw the "Ipo Curve Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_action_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_ID.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_space_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_action.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_blenlib.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_editipo_types.h"
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "BIF_editaction.h"
-#include "BIF_editconstraint.h"
-#include "BIF_interface.h"
-#include "BIF_mainqueue.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "nla.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-extern int totipo_edit, totipo_sel;
-
-/* headerbutton call, assuming full context is set */
-/* it aligns with editipo.c, verify_ipo */
-void spaceipo_assign_ipo(SpaceIpo *si, Ipo *ipo)
-{
- if(si->from==NULL || si->from->lib) return;
-
- if(ipo) ipo->id.us++;
-
- /* first check action ipos */
- if(si->actname && si->actname[0]) {
- Object *ob= (Object *)si->from;
- bActionChannel *achan;
-
- if(ob->action) {
- achan= verify_action_channel(ob->action, si->actname);
-
- if(achan) {
- /* constraint exception */
- if(si->blocktype==ID_CO) {
- bConstraintChannel *conchan= get_constraint_channel(&achan->constraintChannels, si->constname);
- if(conchan) {
- if(conchan->ipo)
- conchan->ipo->id.us--;
- conchan->ipo= ipo;
- }
- }
- else {
- if(achan->ipo)
- achan->ipo->id.us--;
- achan->ipo= ipo;
- }
- }
- }
- }
- else {
- switch(GS(si->from->name)) {
- case ID_OB:
- {
- Object *ob= (Object *)si->from;
- /* constraint exception */
- if(si->blocktype==ID_CO) {
- /* check the local constraint ipo */
- if(si->bonename && si->bonename[0] && ob->pose) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, si->bonename);
- bConstraint *con;
-
- for(con= pchan->constraints.first; con; con= con->next)
- if(strcmp(con->name, si->constname)==0)
- break;
- if(con) {
- if(con->ipo)
- con->ipo->id.us--;
- con->ipo= ipo;
- }
- }
- else {
- bConstraintChannel *conchan= get_constraint_channel(&ob->constraintChannels, si->constname);
- if(conchan) {
- if(conchan->ipo)
- conchan->ipo->id.us--;
- conchan->ipo= ipo;
- }
- }
- }
- else if(si->blocktype==ID_FLUIDSIM) { // NT
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
- if( fluidmd && fluidmd->fss &&
- (fluidmd->fss->ipo) ) {
- // decrement users counter
- fluidmd->fss->ipo->id.us--;
- }
- fluidmd->fss->ipo = ipo;
- }
- else if(si->blocktype==ID_PA) {
- ParticleSystem *psys=psys_get_current(ob);
- if(psys){
- if(psys->part->ipo){
- psys->part->ipo->id.us--;
- }
- psys->part->ipo = ipo;
- }
- }
- else if(si->blocktype==ID_OB) {
- if(ob->ipo)
- ob->ipo->id.us--;
- ob->ipo= ipo;
- }
- }
- break;
- case ID_MA:
- {
- Material *ma= (Material *)si->from;
-
- if(ma->ipo)
- ma->ipo->id.us--;
- ma->ipo= ipo;
- }
- break;
- case ID_TE:
- {
- Tex *tex= (Tex *)si->from;
-
- if(tex->ipo)
- tex->ipo->id.us--;
- tex->ipo= ipo;
- }
- break;
- case ID_SEQ:
- {
- Sequence *seq= (Sequence *)si->from; /* note, sequence is mimicing Id */
-
- if(seq->ipo)
- seq->ipo->id.us--;
- seq->ipo= ipo;
- }
- break;
- case ID_CU:
- {
- Curve *cu= (Curve *)si->from;
-
- if(cu->ipo)
- cu->ipo->id.us--;
- cu->ipo= ipo;
- }
- break;
- case ID_KE:
- {
- Key *key= (Key *)si->from;
-
- if(key->ipo)
- key->ipo->id.us--;
- key->ipo= ipo;
- }
- break;
- case ID_WO:
- {
- World *wo= (World *)si->from;
-
- if(wo->ipo)
- wo->ipo->id.us--;
- wo->ipo= ipo;
- }
- break;
- case ID_LA:
- {
- Lamp *la= (Lamp *)si->from;
-
- if(la->ipo)
- la->ipo->id.us--;
- la->ipo= ipo;
- }
- break;
- case ID_CA:
- {
- Camera *ca= (Camera *)si->from;
-
- if(ca->ipo)
- ca->ipo->id.us--;
- ca->ipo= ipo;
- }
- break;
- case ID_SO:
- {
- bSound *snd= (bSound *)si->from;
-
- if(snd->ipo)
- snd->ipo->id.us--;
- snd->ipo= ipo;
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWBUTSALL, 0);
-
-}
-
-
-static void do_ipo_editmenu_transformmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0: /* grab/move */
- transform_ipo('g');
- break;
- case 1: /* rotate */
- transform_ipo('r');
- break;
- case 2: /* scale */
- transform_ipo('s');
- break;
- }
-}
-
-static uiBlock *ipo_editmenu_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_ipo_editmenu_snapmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* Horizontal */
- case 2: /* To Next */
- case 3: /* To Frame */
- case 4: /* To Current Frame */
- ipo_snap(event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *ipo_editmenu_snapmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_snapmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Horizontal|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Next|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Frame|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Current Frame|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_ipo_editmenu_mirrormenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* mirror over current frame */
- case 2: /* mirror over frame 0 */
- case 3: /* mirror over horizontal axis */
- ipo_mirror(event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *ipo_editmenu_mirrormenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Current Frame|Shift M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Vertical Axis|Shift M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Horizontal Axis|Shift M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_ipo_editmenu_joinmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* All Selected */
- case 2: /* Selected Doubles */
- join_ipo(event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *ipo_editmenu_joinmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_joinmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_joinmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Selected|Ctrl J, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Doubles|Ctrl J, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_ipo_editmenu_keymenu(void *arg, int event)
-{
- Key *key;
- KeyBlock *kb;
- Object *ob= OBACT;
-
- if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) {
- key= ob_get_key((Object *)G.sipo->from);
- if(key==NULL) return;
-
- kb= BLI_findlink(&key->block, ob->shapenr-1);
- kb->type= 0;
- switch(event){
- case 0:
- kb->type= KEY_LINEAR;
- break;
- case 1:
- kb->type= KEY_CARDINAL;
- break;
- case 2:
- kb->type= KEY_BSPLINE;
- break;
- }
- }
-}
-
-static uiBlock *ipo_editmenu_keymenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_keymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_keymenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linear|T, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cardinal|T, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "BSpline|T, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-
-}
-
-static void do_ipo_editmenu_handlemenu(void *arg, int event)
-{
- switch(event){
- case 0:
- sethandles_ipo(HD_AUTO);
- break;
- case 1:
- case 2:
- sethandles_ipo(HD_ALIGN);
- break;
- case 3:
- sethandles_ipo(HD_VECT);
- break;
- case 4:
- sethandles_ipo(HD_AUTO_ANIM);
- break;
- }
-}
-
-static uiBlock *ipo_editmenu_handlemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_handlemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_handlemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Clamped|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Aligned|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Free|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_ipo_editmenu_intpolmenu(void *arg, int event)
-{
- EditIpo *ei;
- int a;
-
- get_status_editipo();
-
- ei = G.sipo->editipo;
-
- switch(event)
- {
- case 0:
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) {
- ei->icu->ipo= IPO_CONST;
- }
- }
- break;
- case 1:
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) {
- ei->icu->ipo= IPO_LIN;
- }
- }
- break;
- case 2:
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) {
- ei->icu->ipo= IPO_BEZ;
- }
- }
- break;
- }
-
- scrarea_queue_winredraw(curarea);
-}
-
-static uiBlock *ipo_editmenu_intpolmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_intpolmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_intpolmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant|T, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linear|T, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier|T, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_ipo_editmenu_extendmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- do_ipo_buttons(B_IPOCONT);
- break;
- case 1:
- do_ipo_buttons(B_IPOEXTRAP);
- break;
- case 2:
- do_ipo_buttons(B_IPOCYCLIC);
- break;
- case 3:
- do_ipo_buttons(B_IPOCYCLICX);
- break;
- }
-}
-
-static uiBlock *ipo_editmenu_extendmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_extendmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu_extendmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant|E, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrapolation|E, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic|E, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic Extrapolation|E, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-
-static void do_ipo_editmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- del_ipo(1);
- break;
- case 1:
- add_duplicate_editipo();
- break;
- case 2:
- ipo_record();
- break;
- case 3:
- mainqenter(IKEY, 1);
- break;
- case 4 :
- add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 5:
- //join_ipo();
- break;
- case 6:
- /*IPO Editmode*/
- set_editflag_editipo();
- break;
- case 7:
- sethandles_ipo(HD_AUTO_ANIM);
- break;
- case 8: /* clean ipo */
- clean_ipo();
- break;
- case 9: /* smooth ipo */
- smooth_ipo();
- break;
- }
-}
-
-static uiBlock *ipo_editmenu(void *arg_unused)
-{
- uiBlock *block;
- EditIpo *ei;
- short yco= 0, menuwidth=120;
- int a,isedit = 0;
-
- get_status_editipo();
-
- ei = G.sipo->editipo;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_ipo_editmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefIconTextBlockBut(block, ipo_editmenu_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
-
- uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefIconTextBlockBut(block, ipo_editmenu_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- /*Look to see if any ipos are being edited, so there can be a check next to the menu option*/
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->icu) {
- if(ei->flag & IPO_VISIBLE) {
- if(totipo_edit && (ei->flag & IPO_EDIT)) {
- isedit = 1;
- break;
- }
- }
- }
- }
- if(isedit)
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Edit Selected|TAB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Edit Selected|TAB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- ei = get_active_editipo();
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(ei && ei->icu && ei->icu->driver)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert 1:1 Curve...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Record Mouse Movement|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clean IPO Curves|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth IPO Curves|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, ipo_editmenu_joinmenu, NULL, ICON_RIGHTARROW_THIN, "Join", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Clamped Handles|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-
- if (!G.sipo->showkey){
- uiDefIconTextBlockBut(block, ipo_editmenu_extendmenu, NULL, ICON_RIGHTARROW_THIN, "Extend Mode", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, ipo_editmenu_intpolmenu, NULL, ICON_RIGHTARROW_THIN, "Interpolation Mode ", 0, yco-=20, 120, 20, "");
- if(ei != NULL && (ei->flag & IPO_EDIT))
- uiDefIconTextBlockBut(block, ipo_editmenu_handlemenu, NULL, ICON_RIGHTARROW_THIN, "Handle Type", 0, yco-=20, 120, 19, "");
- if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0)
- uiDefIconTextBlockBut(block, ipo_editmenu_keymenu, NULL, ICON_RIGHTARROW_THIN, "Key Type", 0, yco-=20, 120, 19, "");
- }
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_ipo_viewmenu(void *arg, int event)
-{
- extern int play_anim(int mode);
-
- switch(event)
- {
- case 1:
- do_ipo_buttons(B_IPOHOME);
- break;
- case 2:
- ipo_toggle_showkey();
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case 3:
- move_to_frame();
- break;
- case 4:
- mainqenter(PADPLUSKEY,1);
- break;
- case 5:
- mainqenter(PADMINUS,1);
- break;
- case 6: /* Play Animation */
- play_anim(0);
- break;
- case 7: /* Play Animation in All */
- play_anim(1);
- break;
- case 8:
- add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 9:
- G.v2d->flag ^= V2D_VIEWLOCK;
- if(G.v2d->flag & V2D_VIEWLOCK)
- view2d_do_locks(curarea, 0);
- break;
- case 10: /* center view to current frame */
- center_currframe();
- scrarea_queue_winredraw(curarea);
- break;
- case 11:
- do_ipo_buttons(B_IPOVIEWCENTER);
- break;
- case 12:
- G.sipo->flag ^= SIPO_LOCK_VIEW;
- break;
- case 13: /* Set Preview Range */
- anim_previewrange_set();
- break;
- case 14: /* Clear Preview Range */
- anim_previewrange_clear();
- break;
- case 15: /* AutoMerge Keyframes */
- G.sipo->flag ^= SIPO_NOTRANSKEYCULL;
- break;
- }
-}
-
-static uiBlock *ipo_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- EditIpo *ei;
- short yco= 0, menuwidth=120;
-
- ei = get_active_editipo();
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_ipo_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Channel Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
- if (G.sipo->showkey)
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiDefIconTextBut(block, BUTM, 1, (G.sipo->flag & SIPO_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT,
- "AutoMerge Keyframes|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation|Alt A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation in 3D View|Alt Shift A", 0, yco-=20,
- // menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Preview Range|Ctrl P", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Preview Range|Alt P", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center on Current Frame|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- if (G.sipo->flag & SIPO_LOCK_VIEW)
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Lock View Area", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Lock View Area", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
-
- if (ei != NULL && (ei->flag & IPO_EDIT)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Current Frame to Selected|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,20, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_ipo_selectmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- borderselect_ipo();
- break;
- case 1:
- swap_selectall_editipo();
- break;
- case 2:
- borderselect_markers();
- allqueue(REDRAWMARKER, 0);
- break;
- case 3:
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- break;
- }
-}
-
-static uiBlock *ipo_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_ipo_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Markers|Ctrl B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_ipo_markermenu(void *arg, int event)
-{
- switch(event)
- {
- case 1:
- add_marker(CFRA);
- break;
- case 2:
- duplicate_marker();
- break;
- case 3:
- remove_marker();
- break;
- case 4:
- rename_marker();
- break;
- case 5:
- transform_markers('g', 0);
- break;
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *ipo_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_ipo_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static char *ipo_modeselect_pup(void)
-{
- Object *ob= OBACT;
- static char formatstring[] = "|%s %%x%d %%i%d";
- static char string[1024];
- char *str = string;
-
- str += sprintf(str, "Ipo type: %%t");
-
- if(ob)
- str += sprintf(str,formatstring, "Object",ID_OB, ICON_OBJECT);
-
- if(ob && give_current_material(ob, ob->actcol)) // check for material
- str += sprintf(str,formatstring, "Material",ID_MA, ICON_MATERIAL);
-
- if(G.scene->world)
- str += sprintf(str,formatstring, "World",ID_WO, ICON_WORLD);
-
- if(ob && ob->type==OB_CURVE)
- str += sprintf(str,formatstring, "Path",ID_CU, ICON_CURVE);
-
- if(ob && ob->type==OB_CAMERA)
- str += sprintf(str,formatstring, "Camera",ID_CA, ICON_CAMERA);
-
- if(ob && ob->type==OB_LAMP)
- str += sprintf(str,formatstring, "Lamp",ID_LA, ICON_LAMP);
-
- if((ob && give_current_texture(ob, ob->actcol))||(give_current_world_texture()))
- str += sprintf(str,formatstring, "Texture",ID_TE, ICON_TEXTURE);
-
- if(ob){
- FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
-
- if ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE)
- str += sprintf(str,formatstring, "Shape",ID_KE, ICON_EDIT);
- if (ob->type==OB_ARMATURE)
- str += sprintf(str,formatstring, "Pose",ID_PO, ICON_POSE_HLT);
-#ifdef __CON_IPO
- str += sprintf(str,formatstring, "Constraint",ID_CO, ICON_CONSTRAINT);
-#endif
- if(fluidmd) {
- str += sprintf(str,formatstring,"Fluidsim",ID_FLUIDSIM, ICON_WORLD);
- }
-
- if(ob->particlesystem.first) {
- str += sprintf(str,formatstring,"Particles",ID_PA, ICON_PARTICLES);
- }
- }
-
- str += sprintf(str,formatstring, "Sequence",ID_SEQ, ICON_SEQUENCE);
-
- return (string);
-}
-
-void do_ipo_buttons(short event)
-{
- EditIpo *ei;
- View2D *v2d;
- rcti rect;
- Object *ob= OBACT;
- float xmin, ymin, dx, dy;
- int a, val, first;
- short mval[2];
-
- if(curarea->win==0) return;
-
- switch(event) {
- case B_IPOVIEWCENTER:
- case B_IPOHOME:
-
- /* boundbox */
-
- v2d= &(G.sipo->v2d);
- first= 1;
-
- ei= G.sipo->editipo;
- if(ei==0) return;
-
- /* map ipo-points for drawing if scaled ipo */
- if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0);
- }
-
- for(a=0; a<G.sipo->totipo; a++, ei++) {
- if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
-
- boundbox_ipocurve(ei->icu, (event==B_IPOVIEWCENTER));
-
- if(first) {
- v2d->tot= ei->icu->totrct;
- first= 0;
- }
- else BLI_union_rctf(&(v2d->tot), &(ei->icu->totrct));
- }
- }
-
- /* undo mapping of ipo-points for drawing if scaled ipo */
- if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) {
- actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0);
- }
-
- /* speciale home */
- if(G.qual & LR_SHIFTKEY) {
- v2d->tot.xmin= SFRA;
- v2d->tot.xmax= EFRA;
- }
-
- /* zoom out a bit */
- dx= 0.10*(v2d->tot.xmax-v2d->tot.xmin);
- dy= 0.10*(v2d->tot.ymax-v2d->tot.ymin);
-
- if(dx<v2d->min[0]) dx= v2d->min[0];
- if(dy<v2d->min[1]) dy= v2d->min[1];
-
- v2d->cur.xmin= v2d->tot.xmin- dx;
- v2d->cur.xmax= v2d->tot.xmax+ dx;
- v2d->cur.ymin= v2d->tot.ymin- dy;
- v2d->cur.ymax= v2d->tot.ymax+ dy;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- if(G.sipo->ipo) G.sipo->ipo->cur = G.v2d->cur;
-
- scrarea_queue_winredraw(curarea);
- break;
- case B_IPOBORDER:
- val= get_border(&rect, 3);
- if(val) {
- mval[0]= rect.xmin;
- mval[1]= rect.ymin;
- areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin);
- mval[0]= rect.xmax;
- mval[1]= rect.ymax;
- areamouseco_to_ipoco(G.v2d, mval, &(G.v2d->cur.xmax), &(G.v2d->cur.ymax));
- G.v2d->cur.xmin= xmin;
- G.v2d->cur.ymin= ymin;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- scrarea_queue_winredraw(curarea);
- }
- break;
-
- case B_IPOPIN:
- allqueue (REDRAWIPO, 0);
- break;
-
- case B_IPOCOPY:
- copy_editipo();
- break;
- case B_IPOPASTE:
- paste_editipo();
- break;
- case B_IPOCONT:
- set_exprap_ipo(IPO_HORIZ);
- break;
- case B_IPOEXTRAP:
- set_exprap_ipo(IPO_DIR);
- break;
- case B_IPOCYCLIC:
- set_exprap_ipo(IPO_CYCL);
- break;
- case B_IPOCYCLICX:
- set_exprap_ipo(IPO_CYCLX);
- break;
- case B_IPOMAIN:
- /* pass 1 to enforce a refresh when there's no Ipo */
- test_editipo(1);
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- if(ob) ob->ipowin= G.sipo->blocktype;
- break;
- case B_IPOSHOWKEY:
- /* reverse value because of winqread */
- G.sipo->showkey= 1-G.sipo->showkey;
- ipo_toggle_showkey();
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_VIEW2DZOOM:
- view2dzoom(event);
- scrarea_queue_headredraw(curarea);
- break;
- case B_IPO_ACTION_OB:
- if(ob && G.sipo->from && G.sipo->pin==0) {
- if(ob->ipoflag & OB_ACTION_OB) { /* check if channel exists, and flip ipo link */
- bActionChannel *achan;
-
- if(has_ipo_code(ob->ipo, OB_LAY))
- notice("Note: Layer Ipo doesn't work in Actions");
-
- if(ob->action==NULL)
- ob->action= add_empty_action("ObAction");
- achan= verify_action_channel(ob->action, "Object");
- if(achan->ipo==NULL && ob->ipo) {
- achan->ipo= ob->ipo;
- ob->ipo= NULL;
- }
-
- /* object constraints */
- if(ob->constraintChannels.first) {
- free_constraint_channels(&achan->constraintChannels);
- achan->constraintChannels= ob->constraintChannels;
- ob->constraintChannels.first= ob->constraintChannels.last= NULL;
- }
- }
- else if(ob->action) {
- bActionChannel *achan= get_action_channel(ob->action, "Object");
- if(achan) {
-
- if(achan->ipo && ob->ipo==NULL) {
- ob->ipo= achan->ipo;
- achan->ipo= NULL;
- }
-
- /* object constraints */
- if(achan->constraintChannels.first) {
- free_constraint_channels(&ob->constraintChannels);
- ob->constraintChannels= achan->constraintChannels;
- achan->constraintChannels.first= achan->constraintChannels.last= NULL;
- }
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNLA, 0);
- }
- break;
-
- case B_IPO_ACTION_KEY:
- if(ob && G.sipo->from && G.sipo->pin==0) {
- Key *key= ob_get_key(ob);
- if(key) {
- if(ob->ipoflag & OB_ACTION_KEY) { /* check if channel exists, and flip ipo link */
- bActionChannel *achan;
-
- if(ob->action==NULL)
- ob->action= add_empty_action("ShapeAction");
- achan= verify_action_channel(ob->action, "Shape");
- if(achan->ipo==NULL && key->ipo) {
- achan->ipo= key->ipo;
- key->ipo= NULL;
- }
- }
- else if(ob->action) {
- bActionChannel *achan= get_action_channel(ob->action, "Shape");
- if(achan) {
- if(achan->ipo && key->ipo==NULL) {
- key->ipo= achan->ipo;
- achan->ipo= NULL;
- }
- }
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNLA, 0);
- }
- }
- break;
- case B_IPOVIEWALL:
- /* set visible active */
- for(a=0, ei=G.sipo->editipo; a<G.sipo->totipo; a++, ei++) {
- if (ei->icu) ei->flag |= IPO_VISIBLE;
- else ei->flag &= ~IPO_VISIBLE;
- }
- break;
- case B_IPOREDRAW:
- DAG_object_flush_update(G.scene, ob, OB_RECALC);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- break;
- }
-}
-
-void ipo_buttons(void)
-{
- Object *ob;
- EditIpo *ei;
- uiBlock *block;
- short xco,xmax;
- char naam[20];
- int icon=0, allow_pin= B_IPOPIN;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_IPO;
-
- xco = 8;
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
- xco+= XIC+14;
-
- test_editipo(0); /* test if current editipo is OK, make_editipo sets v2d->cur */
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- /* pull down menus */
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- ei = get_active_editipo();
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block,ipo_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+=xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- xco+=xmax;
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block,ipo_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
- xco+=xmax;
-
- if (G.sipo->showkey) {
- xmax= GetButStringLength("Key");
- uiDefPulldownBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, "");
- }
- else if(ei != NULL && (ei->flag & IPO_EDIT)) {
- xmax= GetButStringLength("Point");
- uiDefPulldownBut(block,ipo_editmenu, NULL, "Point", xco, -2, xmax-3, 24, "");
- }
- else {
- xmax= GetButStringLength("Curve");
- uiDefPulldownBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, "");
- }
- xco+=xmax;
- }
-
- /* end of pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- ob= OBACT;
-
- /* action switch option, only when active object is there and no pin */
- uiSetButLock(G.sipo->pin, "Can't change because of pinned data");
-
- /* define whether ipos are on Object or on action */
- if(ob) {
- static short fake1= 1;
-
- uiBlockBeginAlign(block);
-
- if(G.sipo->blocktype==ID_OB) {
- uiDefIconButBitS(block, TOG, OB_ACTION_OB, B_IPO_ACTION_OB, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not");
- xco+= XIC;
- }
- else if(G.sipo->blocktype==ID_KE) {
- uiDefIconButBitS(block, TOG, OB_ACTION_KEY, B_IPO_ACTION_KEY, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not");
- xco+= XIC;
- }
- else if(G.sipo->blocktype==ID_CO) {
-
- if(ob->pose==NULL)
- uiDefIconButBitS(block, TOG, OB_ACTION_OB, B_IPO_ACTION_OB, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not");
- else {
- bConstraint *con= get_active_constraint(ob);
- if(con)
- uiDefIconButBitS(block, TOGN, CONSTRAINT_OWN_IPO, B_IPOREDRAW, ICON_ACTION, xco,0,XIC,YIC, &con->flag, 0, 0, 0, 0,
- (con->flag & CONSTRAINT_OWN_IPO)?"Ipo is connected to Constraint itself":"Ipo is connected to Pose Action"
- );
- }
- xco+= XIC;
- }
- else if(G.sipo->blocktype==ID_PO) { /* only to indicate we have action ipos */
- uiSetButLock(1, "Pose Action Ipo cannot be switched");
- uiDefIconButS(block, TOG, 1, ICON_ACTION, xco,0,XIC,YIC, &fake1, 0, 0, 0, 0, "Ipo is connected to Pose Action");
- xco+= XIC;
- }
- uiClearButLock();
- }
-
- /* ipo muting */
- if (G.sipo->ipo) {
- uiDefIconButS(block, ICONTOG, 1, ICON_MUTE_IPO_OFF, xco,0,XIC,YIC, &(G.sipo->ipo->muteipo), 0, 0, 0, 0, "Mute IPO-block");
- xco += XIC;
- }
-
- /* mainmenu, only when data is there and no pin */
- uiSetButLock(G.sipo->pin, "Can't change because of pinned data");
-
- if (G.sipo->blocktype == ID_OB)
- icon = ICON_OBJECT;
- else if (G.sipo->blocktype == ID_MA)
- icon = ICON_MATERIAL;
- else if (G.sipo->blocktype == ID_WO)
- icon = ICON_WORLD;
- else if (G.sipo->blocktype == ID_CU)
- icon = ICON_ANIM;
- else if (G.sipo->blocktype == ID_CA)
- icon = ICON_CAMERA;
- else if (G.sipo->blocktype == ID_LA)
- icon = ICON_LAMP;
- else if (G.sipo->blocktype == ID_KE)
- icon = ICON_EDIT;
- else if (G.sipo->blocktype == ID_PO)
- icon = ICON_POSE_HLT;
- else if (G.sipo->blocktype == ID_CO)
- icon = ICON_CONSTRAINT;
- else if (G.sipo->blocktype == ID_SEQ)
- icon = ICON_SEQUENCE;
- else if(G.sipo->blocktype == ID_TE)
- icon = ICON_TEXTURE;
- else if(G.sipo->blocktype == ID_FLUIDSIM)
- icon = ICON_WORLD;
- else if(G.sipo->blocktype == ID_PA)
- icon = ICON_PARTICLES;
-
- uiDefIconTextButS(block, MENU, B_IPOMAIN, icon, ipo_modeselect_pup(), xco,0,100,20, &(G.sipo->blocktype), 0, 0, 0, 0, "Show IPO type");
-
- xco += 85;
-
- if(G.sipo->blocktype==ID_MA) {
- uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Material texture.");
- xco-= 4;
- }
- if(G.sipo->blocktype==ID_WO) {
- uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active World texture.");
- xco-= 4;
- }
-
- if(G.sipo->blocktype==ID_LA) {
- uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Lamp texture. ");
- xco-= 4;
- }
-
- uiBlockEndAlign(block);
-
- uiClearButLock();
-
- /* if(G.sipo->blocktype==ID_SEQ)
- allow_pin= 0; */
- xco= std_libbuttons(block, (short)(xco+1.5*XIC), 0, allow_pin, &G.sipo->pin, B_IPOBROWSE, ID_IP,
- G.sipo->blocktype, (ID*)G.sipo->ipo, G.sipo->from, &(G.sipo->menunr), B_IPOALONE, B_IPOLOCAL, B_IPODELETE, 0, B_KEEPDATA);
-
- /* COPY PASTE */
- xco-= XIC/2;
- uiBlockBeginAlign(block);
- if(curarea->headertype==HEADERTOP) {
- uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer");
- uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, ERROR_LIBDATA_MESSAGE);
- uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer");
- }
- else {
- uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer");
- uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, ERROR_LIBDATA_MESSAGE);
- uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer");
- }
- uiBlockEndAlign(block);
- xco+=XIC/2;
-
- uiClearButLock();
-
- /* ZOOMBORDER */
- uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area (Shift B)");
-
- xco+=XIC/2;
-
- /* draw LOCK */
- uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.sipo->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time");
-
- /* always do as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_nla.c b/source/blender/src/header_nla.c
deleted file mode 100644
index d0031b2db7c..00000000000
--- a/source/blender/src/header_nla.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/**
- * header_nla.c oct-2003
- *
- * Functions to draw the "NLA Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_ID.h"
-#include "DNA_nla_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_editnla.h"
-#include "BIF_editaction.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-//#include "nla.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-void do_nla_buttons(unsigned short event)
-{
- View2D *v2d;
-
- switch(event){
- case B_NLAHOME:
- // Find X extents
- v2d= &(G.snla->v2d);
-
- /* i tried to understand nla/action drawing to reveil a 'tot' rect, impossible code! (ton) */
- v2d->cur.xmin = G.scene->r.sfra-5;
- v2d->cur.xmax = G.scene->r.efra+5;
- v2d->cur.ymin= -SCROLLB;
- v2d->cur.ymax= 5; // at least stuff is visiable then?
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- addqueue (curarea->win, REDRAW, 1);
- break;
- }
-}
-
-
-static void do_nla_viewmenu(void *arg, int event)
-{
- extern int play_anim(int mode);
-
- switch(event) {
- case 0: /* Update Automatically */
- if(BTST(G.snla->lock, 0)) G.snla->lock = BCLR(G.snla->lock, 0);
- else G.snla->lock = BSET(G.snla->lock, 0);
- break;
- case 1: /* Play Back Animation */
- play_anim(0);
- break;
- case 2: /* Play Back Animation in 3D View */
- play_anim(1);
- break;
- case 3: /* View All */
- do_nla_buttons(B_NLAHOME);
- break;
- case 4: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 5: /* Update automatically */
- G.v2d->flag ^= V2D_VIEWLOCK;
- if(G.v2d->flag & V2D_VIEWLOCK)
- view2d_do_locks(curarea, 0);
- break;
- case 6: /* Show all objects that have keyframes? */
- G.snla->flag ^= SNLA_ALLKEYED;
- break;
- case 7: /* Show timing in Frames or Seconds */
- G.snla->flag ^= SNLA_DRAWTIME;
- break;
- case 8: /* Set Preview Range */
- anim_previewrange_set();
- break;
- case 9: /* Clear Preview Range */
- anim_previewrange_clear();
- break;
- case 10: /* AutoMerge Keyframes */
- G.snla->flag ^= SNLA_NOTRANSKEYCULL;
- break;
- }
-}
-
-static uiBlock *nla_viewmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_nla_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, (G.snla->flag & SNLA_ALLKEYED)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT,
- "Only Objects On Visible Layers|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- if (G.snla->flag & SNLA_DRAWTIME) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- }
-
- uiDefIconTextBut(block, BUTM, 1, (G.snla->flag & SNLA_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT,
- "AutoMerge Keyframes|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(BTST(G.snla->lock, 0)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Preview Range|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Preview Range|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_nla_selectmenu(void *arg, int event)
-{
-
- switch(event)
- {
- case 0: /* Border Select */
- borderselect_nla();
- break;
- case 1: /* Select/Deselect All Keys */
- deselect_nlachannel_keys(1);
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
- break;
- case 2: /* Select/Deselect All Channel */
- deselect_nlachannels(1);
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
- break;
- case 3: /* Select/Deselect All Markers */
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- break;
- case 4: /* Borderselect markers */
- borderselect_markers();
- break;
- }
-}
-
-static uiBlock *nla_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_nla_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Markers|Ctrl B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Keys|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Channels", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_nla_strip_snapmenu(void *arg, int event)
-{
- snap_action_strips(event);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
-}
-
-static uiBlock *nla_strip_snapmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_strip_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_nla_strip_snapmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nearest Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Current Frame|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_nla_strip_transformmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* grab/move */
- transform_nlachannel_keys('g', 0);
- update_for_newframe_muted();
- break;
- case 1: /* scale */
- transform_nlachannel_keys('s', 0);
- update_for_newframe_muted();
- break;
- case 2: /* extend */
- transform_nlachannel_keys('e', 0);
- update_for_newframe_muted();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *nla_strip_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_strip_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_nla_strip_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Extend from Frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_nla_stripmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0: /* Strip Properties */
- add_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 1: /* Add Action Strip */
- add_nlablock();
- break;
- case 2: /* Duplicate */
- duplicate_nlachannel_keys();
- update_for_newframe_muted();
- break;
- case 3: /* Delete Strips */
- if (okee("Erase selected strips and/or keys")) {
- delete_nlachannel_keys ();
- update_for_newframe_muted();
- }
- break;
- case 5: /* Convert Action to NLA Strip */
- convert_nla();
- break;
- case 6: /* Move Up */
- shift_nlastrips_up();
- break;
- case 7: /* Move Down */
- shift_nlastrips_down();
- break;
- case 8: /* reset scale */
- reset_action_strips(1);
- break;
- case 9: /* reset start/end of action */
- reset_action_strips(2);
- break;
- case 10: /* add new action as new action strip */
- add_empty_nlablock();
- break;
- case 11: /* apply scale */
- reset_action_strips(3);
- break;
- }
-}
-
-static uiBlock *nla_stripmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_stripmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_nla_stripmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strip Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, nla_strip_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
- uiDefIconTextBlockBut(block, nla_strip_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Strip Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Action Start/End|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Strip Scaling|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Action Strip|Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Blank Action Strip|Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Action to NLA Strip|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Down|Ctrl Page Down", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Up|Ctrl Page Up", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_nla_markermenu(void *arg, int event)
-{
- switch(event)
- {
- case 1:
- add_marker(CFRA);
- break;
- case 2:
- duplicate_marker();
- break;
- case 3:
- remove_marker();
- break;
- case 4:
- rename_marker();
- break;
- case 5:
- transform_markers('g', 0);
- break;
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *nla_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "nla_markermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_nla_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void nla_buttons(void)
-{
- SpaceNla *snla;
- short xco, xmax;
- char naam[20];
- uiBlock *block;
-
- snla= curarea->spacedata.first;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_NLA;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
-
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, nla_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, nla_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block, nla_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Strip");
- uiDefPulldownBut(block, nla_stripmenu, NULL, "Strip", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
-
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
-
- /* draw AUTOSNAP */
- xco += 8;
-
- if (G.snla->flag & SNLA_DRAWTIME) {
- uiDefButS(block, MENU, B_REDR,
- "Auto-Snap Strips/Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3",
- xco,0,70,YIC, &(G.snla->autosnap), 0, 1, 0, 0,
- "Auto-snapping mode for strips and keyframes when transforming");
- }
- else {
- uiDefButS(block, MENU, B_REDR,
- "Auto-Snap Strips/Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3",
- xco,0,70,YIC, &(G.snla->autosnap), 0, 1, 0, 0,
- "Auto-snapping mode for strips and keyframes when transforming");
- }
-
- xco += (70 + 8);
-
- xco += 8;
-
- uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco,0,XIC,YIC, &(snla->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time");
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c
deleted file mode 100644
index 2bd028766d1..00000000000
--- a/source/blender/src/header_node.c
+++ /dev/null
@@ -1,803 +0,0 @@
-/**
- *
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): David Millan Escriva, Juho Vepsäläinen
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "DNA_ID.h"
-#include "DNA_material_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_butspace.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_node.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
-
-void do_node_buttons(ScrArea *sa, unsigned short event)
-{
- SpaceNode *snode= sa->spacedata.first;
- Material *ma;
- Tex *tx;
-
- switch(event) {
- case B_NODE_USEMAT:
- ma= (Material *)snode->id;
- if(ma) {
- if(ma->use_nodes && ma->nodetree==NULL) {
- node_shader_default(ma);
- snode_set_context(snode);
- }
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- }
- break;
-
- case B_NODE_USESCENE:
- if(G.scene->use_nodes) {
- if(G.scene->nodetree==NULL)
- node_composit_default(G.scene);
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
- }
- snode_set_context(snode);
- allqueue(REDRAWNODE, 0);
- break;
-
- case B_NODE_USETEX:
- tx = (Tex *)snode->id;
- if(tx) {
- tx->type = 0;
- if(tx->use_nodes && tx->nodetree==NULL) {
- node_texture_default(tx);
- snode_set_context(snode);
- }
- BIF_preview_changed(ID_TE);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- }
- break;
- }
-}
-
-static void do_node_viewmenu(void *arg, int event)
-{
- SpaceNode *snode= curarea->spacedata.first;
-
- switch(event) {
- case 1: /* Zoom in */
- snode_zoom_in(curarea);
- break;
- case 2: /* View all */
- snode_zoom_out(curarea);
- break;
- case 3: /* View all */
- snode_home(curarea, snode);
- break;
- case 4: /* Grease Pencil */
- add_blockhandler(curarea, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- }
- allqueue(REDRAWNODE, 0);
-}
-
-static uiBlock *node_viewmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "node_viewmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_node_viewmenu, NULL);
-
- if (snode->nodetree) {
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_node_selectmenu(void *arg, int event)
-{
- SpaceNode *snode= curarea->spacedata.first;
-
- /* functions in editnode.c assume there's a tree */
- if(snode->nodetree==NULL)
- return;
-
- switch(event) {
- case 1: /* border select */
- node_border_select(snode);
- break;
- case 2: /* select/deselect all */
- node_deselectall(snode, 1);
- break;
- case 3: /* select linked in */
- node_select_linked(snode, 0);
- break;
- case 4: /* select linked out */
- node_select_linked(snode, 1);
- break;
- }
- allqueue(REDRAWNODE, 0);
-}
-
-static uiBlock *node_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "node_selectmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_node_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked From|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked To|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_node_addmenu(void *arg, int event)
-{
- SpaceNode *snode= curarea->spacedata.first;
- bNode *node;
- float locx, locy;
- short mval[2];
-
- /* store selection in temp test flag */
- for(node= snode->edittree->nodes.first; node; node= node->next) {
- if(node->flag & NODE_SELECT) node->flag |= NODE_TEST;
- else node->flag &= ~NODE_TEST;
- }
-
- toolbox_mousepos(mval, 0 ); /* get initial mouse position */
- areamouseco_to_ipoco(G.v2d, mval, &locx, &locy);
- node= node_add_node(snode, event, locx, locy);
-
- /* uses test flag */
- snode_autoconnect(snode, node, NODE_TEST);
-
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
-
- BIF_undo_push("Add Node");
-
-}
-
-static void node_make_addmenu(SpaceNode *snode, int nodeclass, uiBlock *block)
-{
- bNodeTree *ntree;
- int tot= 0, a;
- short yco= 0, menuwidth=120;
-
- ntree = snode->nodetree;
- if(ntree) {
- /* mostly taken from toolbox.c, node_add_sublevel() */
- if(ntree) {
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= G.main->nodetree.first;
- for(; ngroup; ngroup= ngroup->id.next)
- if(ngroup->type==ntree->type)
- tot++;
- }
- else {
- bNodeType *type = ntree->alltypes.first;
- while(type) {
- if(type->nclass == nodeclass)
- tot++;
- type= type->next;
- }
- }
- }
-
- if(tot==0) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- return;
- }
-
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= G.main->nodetree.first;
- for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) {
- if(ngroup->type==ntree->type) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, (ngroup->id.name+2), 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, NODE_GROUP_MENU+tot, "");
- a++;
- }
- }
- }
- else {
- bNodeType *type;
- int script=0;
- for(a=0, type= ntree->alltypes.first; type; type=type->next) {
- if( type->nclass == nodeclass ) {
- if(type->type == NODE_DYNAMIC) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, NODE_DYNAMIC_MENU+script, "");
- script++;
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0,
- yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, type->type, "");
- }
- a++;
- }
- }
- }
- } else {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- return;
- }
-}
-
-static uiBlock *node_add_inputmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_inputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_INPUT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_outputmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_outputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_OUTPUT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_colormenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_colormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_OP_COLOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_vectormenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_vectormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_OP_VECTOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_filtermenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_filtermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_OP_FILTER, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_convertermenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_convertermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_CONVERTOR, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_mattemenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_mattemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_MATTE, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_distortmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_distortmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_DISTORT, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_patternmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_patternmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_PATTERN, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_texturemenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_texturemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_TEXTURE, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-static uiBlock *node_add_groupmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_GROUP, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static uiBlock *node_add_dynamicmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
-
- block= uiNewBlock(&curarea->uiblocks, "node_add_dynamicmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- node_make_addmenu(snode, NODE_CLASS_OP_DYNAMIC, block);
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static uiBlock *node_addmenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "node_addmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_node_addmenu, NULL);
-
- if(snode->treetype==NTREE_SHADER) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_dynamicmenu, NULL, ICON_RIGHTARROW_THIN, "Dynamic", 0, yco-=20, 120, 19, "");
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_filtermenu, NULL, ICON_RIGHTARROW_THIN, "Filter", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_mattemenu, NULL, ICON_RIGHTARROW_THIN, "Matte", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
-
- } else if(snode->treetype==NTREE_TEXTURE) {
- uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_patternmenu, NULL, ICON_RIGHTARROW_THIN, "Patterns", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_texturemenu, NULL, ICON_RIGHTARROW_THIN, "Textures", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
- }
- else
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_node_nodemenu(void *arg, int event)
-{
- SpaceNode *snode= curarea->spacedata.first;
- int fromlib=0;
-
- /* functions in editnode.c assume there's a tree */
- if(snode->nodetree==NULL)
- return;
- fromlib= (snode->id && snode->id->lib);
-
- switch(event) {
- case 1: /* grab/move */
- node_transform_ext(0,0);
- break;
- case 2: /* duplicate */
- if(fromlib) fromlib= -1;
- else node_adduplicate(snode);
- break;
- case 3: /* delete */
- if(fromlib) fromlib= -1;
- else node_delete(snode);
- break;
- case 4: /* make group */
- node_make_group(snode);
- break;
- case 5: /* ungroup */
- node_ungroup(snode);
- break;
- case 6: /* edit group */
- if(fromlib) fromlib= -1;
- else snode_make_group_editable(snode, NULL);
- break;
- case 7: /* hide/unhide */
- node_hide(snode);
- break;
- case 8: /* read saved render layers */
- node_read_renderlayers(snode);
- break;
- case 9: /* show cyclic */
- ntreeSolveOrder(snode->edittree);
- break;
- case 10: /* execute */
- addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
- break;
- case 11: /* make link */
- node_make_link(snode);
- break;
- case 12: /* rename */
- node_rename(snode);
- break;
- case 13: /* read saved full sample layers */
- node_read_fullsamplelayers(snode);
- break;
- case 14: /* connect viewer */
- node_active_link_viewer(snode);
- break;
-
- }
-
- if(fromlib==-1) error_libdata();
- allqueue(REDRAWNODE, 0);
-}
-
-static uiBlock *node_nodemenu(void *arg_unused)
-{
- SpaceNode *snode= curarea->spacedata.first;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "node_nodemenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_node_nodemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Link|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ungroup|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edit Group|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide/Unhide|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(snode->treetype==NTREE_COMPOSIT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Execute Composite|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Render Results|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Full Sample Results|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect Node to Viewer|Ctrl RMB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Cyclic Dependencies|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void node_buttons(ScrArea *sa)
-{
- SpaceNode *snode= sa->spacedata.first;
- uiBlock *block;
- short xco, xmax;
- char name[256];
-
- sprintf(name, "header %d", sa->headwin);
- block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->headwin);
-
- if(area_is_active_area(sa)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- sa->butspacetype= SPACE_NODE;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco, 0, XIC+10, YIC,
- &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays Current Window Type");
-
- xco += XIC + 14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if (sa->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_RIGHT, xco,2,XIC,YIC-2,
- &(sa->flag), 0, 0, 0, 0, "Show pulldown menus");
- }
- else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_DOWN, xco,2,XIC,YIC-2,
- &(sa->flag), 0, 0, 0, 0, "Hide pulldown menus");
- }
- xco+=XIC;
-
- if((sa->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, node_viewmenu, NULL,
- "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, node_selectmenu, NULL,
- "Select", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Add");
- uiDefPulldownBut(block, node_addmenu, NULL,
- "Add", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Node");
- uiDefPulldownBut(block, node_nodemenu, NULL,
- "Node", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* main type choosing */
- uiBlockBeginAlign(block);
- uiDefIconButI(block, ROW, B_REDR, ICON_MATERIAL_DEHLT, xco,2,XIC,YIC-2,
- &(snode->treetype), 2, 0, 0, 0, "Material Nodes");
- xco+= XIC;
- uiDefIconButI(block, ROW, B_REDR, ICON_IMAGE_DEHLT, xco,2,XIC,YIC-2,
- &(snode->treetype), 2, 1, 0, 0, "Composite Nodes");
- xco+= XIC;
- uiDefIconButI(block, ROW, B_REDR, ICON_TEXTURE_DEHLT, xco,2,XIC,YIC-2,
- &(snode->treetype), 2, 2, 0, 0, "Texture Nodes");
- xco+= 2*XIC;
- uiBlockEndAlign(block);
-
- /* find and set the context */
- snode_set_context(snode);
-
- if(snode->treetype==NTREE_SHADER) {
- if(snode->from) {
- /* 0, NULL -> pin */
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_MATBROWSE, ID_MA, 1, snode->id, snode->from, &(snode->menunr),
- B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA);
-
- if(snode->id) {
- Material *ma= (Material *)snode->id;
- uiDefButC(block, TOG, B_NODE_USEMAT, "Use Nodes", xco+5,0,70,19, &ma->use_nodes, 0.0f, 0.0f, 0, 0, "");
- xco+=80;
- }
- }
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- uiDefButS(block, TOG, B_NODE_USESCENE, "Use Nodes", xco+5,0,70,19, &G.scene->use_nodes, 0.0f, 0.0f, 0, 0, "Indicate this Scene will use Nodes and execute them while editing");
- xco+= 80;
- uiDefButBitI(block, TOG, R_COMP_FREE, B_NOP, "Free Unused", xco+5,0,80,19, &G.scene->r.scemode, 0.0f, 0.0f, 0, 0, "Free Nodes that are not used while composite");
- xco+= 80;
- uiDefButBitS(block, TOG, SNODE_BACKDRAW, REDRAWNODE, "Backdrop", xco+5,0,80,19, &snode->flag, 0.0f, 0.0f, 0, 0, "Use active Viewer Node output as backdrop");
- xco+= 80;
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- if(snode->from) {
-
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr),
- B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
-
- if(snode->id) {
- Tex *tx= (Tex *)snode->id;
- uiDefButC(block, TOG, B_NODE_USETEX, "Use Nodes", xco+5,0,70,19, &tx->use_nodes, 0.0f, 0.0f, 0, 0, "");
- xco+=80;
- }
- }
- }
-
- /* always as last */
- sa->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c
deleted file mode 100644
index b839029c139..00000000000
--- a/source/blender/src/header_oops.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: not all of this file anymore.
- *
- * Contributor(s): Blender Foundation.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-
-#include "DNA_ID.h"
-#include "DNA_oops_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_editoops.h"
-#include "BIF_oops.h"
-#include "BIF_outliner.h"
-#include "BIF_space.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_drawoops.h"
-#include "BSE_headerbuttons.h"
-
-#include "blendef.h"
-
-#include "BKE_depsgraph.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-static int viewmovetemp = 0;
-
-void do_oops_buttons(short event)
-{
- float dx, dy;
-
- /* used for maximize hack */
- int win_width, win_height;
- float aspect_win, aspect_oops, oops_width, oops_height, oops_x_mid, oops_y_mid;
-
-
- if(curarea->win==0) return;
-
- if (event == B_NEWOOPS) {
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- G.soops->lockpoin= 0;
- } else { /* must be either B_OOPSHOME or B_OOPSVIEWSEL */
- init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset
- if (event == B_OOPSHOME) {
- boundbox_oops(0); /* Test all oops blocks */
- } else {
- boundbox_oops(1); /* Test only selected oops blocks */
- }
-
-
- /* Hack to work with test_view2d in drawipo.c
- Modify the bounding box so it is maximized to the window aspect
- so viewing all oops blocks isnt limited to hoz/vert only.
- Cant modify drawipo.c because many other functions use this hos/vert operation - Campbell*/
-
- win_width= curarea->winrct.xmax - curarea->winrct.xmin;
- win_height= curarea->winrct.ymax - curarea->winrct.ymin;
-
- oops_width = G.v2d->tot.xmax - G.v2d->tot.xmin;
- oops_height = G.v2d->tot.ymax - G.v2d->tot.ymin;
-
- oops_x_mid = (G.v2d->tot.xmax + G.v2d->tot.xmin)*0.5;
- oops_y_mid = (G.v2d->tot.ymax + G.v2d->tot.ymin)*0.5;
- /* wide windows will be above 1, skinny below 1 */
- aspect_win= (float)win_width / (float)win_height;
- aspect_oops = (float)oops_width / (float)oops_height;
- if (aspect_win>aspect_oops) {/* the window is wider then the oops bounds, increase the oops width */
- G.v2d->tot.xmin = oops_x_mid - ((oops_x_mid-G.v2d->tot.xmin) * (aspect_win/aspect_oops) ); /* scale the min */
- G.v2d->tot.xmax = oops_x_mid + ((G.v2d->tot.xmax-oops_x_mid) * (aspect_win/aspect_oops) );/* scale the max */
- } else { /* the window is skinnier then the oops bounds, increase the oops height */
- G.v2d->tot.ymin = oops_y_mid - ((oops_y_mid-G.v2d->tot.ymin) * (aspect_oops/aspect_win) ); /* scale the min */
- G.v2d->tot.ymax = oops_y_mid + ((G.v2d->tot.ymax-oops_y_mid) * (aspect_oops/aspect_win) );/* scale the max */
- }
-
- /* maybe we should restore the correct values? - do next of its needed */
- /* end hack */
-
-
-
- G.v2d->cur= G.v2d->tot;
- dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
- dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
- G.v2d->cur.xmin-= dx;
- G.v2d->cur.xmax+= dx;
- G.v2d->cur.ymin-= dy;
- G.v2d->cur.ymax+= dy;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- }
-}
-
-static void do_oops_viewmenu(void *arg, int event)
-{
- SpaceOops *soops= curarea->spacedata.first;
-
- switch(event) {
- case 0: /* Shuffle Selected Blocks */
- shuffle_oops();
- break;
- case 1: /* Shrink Selected Blocks */
- shrink_oops();
- break;
- case 2: /* View All */
- do_oops_buttons(B_OOPSHOME);
- break;
- case 3: /* View All */
- do_oops_buttons(B_OOPSVIEWSEL);
- break;
- case 4: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 5: /* show outliner */
- if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER;
- else soops->type= SO_OOPS;
- init_v2d_oops(curarea, soops);
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- break;
- case 6:
- outliner_toggle_visible(curarea);
- break;
- case 7:
- outliner_show_hierarchy(curarea);
- break;
- case 8:
- outliner_show_active(curarea);
- break;
- case 9:
- outliner_one_level(curarea, 1);
- break;
- case 10:
- outliner_one_level(curarea, -1);
- break;
-#ifdef SHOWDEPGRAPH
- case 11:
- // show deps
- {
- SpaceOops *soops= curarea->spacedata.first;
- if(soops->type==SO_OOPS) {
- soops->type= SO_DEPSGRAPH;
- soops->deps_flags = DAG_RL_ALL_BUT_DATA_MASK;
- } else
- soops->type= SO_OOPS;
- init_v2d_oops(curarea, soops);
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- }
- break;
-#endif
- case 12:
- if (soops->flag & SO_HIDE_RESTRICTCOLS) soops->flag &= ~SO_HIDE_RESTRICTCOLS;
- else soops->flag |= SO_HIDE_RESTRICTCOLS;
- break;
- }
-}
-
-static uiBlock *oops_viewmenu(void *arg_unused)
-{
- SpaceOops *soops= curarea->spacedata.first;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_oops_viewmenu, NULL);
-
- if(soops->type==SO_OOPS) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-#ifdef SHOWDEPGRAPH
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-#endif
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- }
-#ifdef SHOWDEPGRAPH
- else if(soops->type==SO_DEPSGRAPH) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- }
-#endif
- else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (soops->flag & SO_HIDE_RESTRICTCOLS)
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Restriction Columns", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Restriction Columns", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-
-static void do_oops_selectmenu(void *arg, int event)
-{
-
- switch(event)
- {
- case 0: /* Border Select */
- borderselect_oops();
- break;
- case 1: /* Select/Deselect All */
- swap_select_all_oops();
- break;
- case 2: /* Linked to Selected */
- select_linked_oops();
- break;
- case 3: /* Users of Selected */
- select_backlinked_oops();
- break;
- }
-}
-
-static uiBlock *oops_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_oops_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_oops_blockmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0: /* grab/move */
- transform_oops('g', 0);
- break;
- case 1: /* scale */
- transform_oops('s', 0);
- break;
- }
-}
-
-static uiBlock *oops_blockmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_oops_blockmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_oops_searchmenu(void *arg, int event)
-{
- int search_flags = OL_FIND, again = 0;
-
- switch(event)
- {
- case 0: /* plain new find */
- search_flags = OL_FIND;
- break;
- case 1: /* case sensitive */
- search_flags = OL_FIND_CASE;
- break;
- case 2: /* full search */
- search_flags = OL_FIND_COMPLETE;
- break;
- case 3: /* full case sensitive */
- search_flags = OL_FIND_COMPLETE_CASE;
- break;
- case 4: /* again */
- again = 1;
- break;
- default: /* nothing valid */
- return;
- }
-
- /* run search */
- outliner_find_panel(curarea, again, search_flags);
-}
-
-static uiBlock *oops_searchmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "oops_searchmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_oops_searchmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find (Case Sensitive)|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Complete|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Complete (Case Sensitive)|Ctrl Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Again|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void oops_buttons(void)
-{
- SpaceOops *soops;
- Oops *oops;
- uiBlock *block;
- short xco, xmax;
- char naam[256];
-
- soops= curarea->spacedata.first;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_OOPS;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
-
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- if(soops->type==SO_OOPS) {
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Block");
- uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- }
- else {
- xmax= GetButStringLength("Search");
- uiDefPulldownBut(block, oops_searchmenu, NULL, "Search", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- if(soops->type==SO_OOPS) {
- /* ZOOM and BORDER */
- uiBlockBeginAlign(block);
- uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)");
- uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
- uiBlockEndAlign(block);
-
- xco+= 8;
-
- /* VISIBLE */
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, OOPS_LAY, B_NEWOOPS, "Layer", (short)(xco+=XIC),0,XIC+20,YIC, &soops->visiflag, 0, 0, 0, 0, "Only show object datablocks on visible layers");
- xco+= 20;
- uiDefIconButBitS(block, TOG, OOPS_SCE, B_NEWOOPS, ICON_SCENE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene datablocks");
- uiDefIconButBitS(block, TOG, OOPS_OB, B_NEWOOPS, ICON_OBJECT_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object datablocks");
- uiDefIconButBitS(block, TOG, OOPS_ME, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh datablocks");
- uiDefIconButBitS(block, TOG, OOPS_CU, B_NEWOOPS, ICON_CURVE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font datablocks");
- uiDefIconButBitS(block, TOG, OOPS_MB, B_NEWOOPS, ICON_MBALL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball datablocks");
- uiDefIconButBitS(block, TOG, OOPS_LT, B_NEWOOPS, ICON_LATTICE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice datablocks");
- uiDefIconButBitS(block, TOG, OOPS_LA, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp datablocks");
- uiDefIconButBitS(block, TOG, OOPS_MA, B_NEWOOPS, ICON_MATERIAL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material datablocks");
- uiDefIconButBitS(block, TOG, OOPS_TE, B_NEWOOPS, ICON_TEXTURE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture datablocks");
- uiDefIconButBitS(block, TOG, OOPS_IP, B_NEWOOPS, ICON_IPO_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo datablocks");
- uiDefIconButBitS(block, TOG, OOPS_IM, B_NEWOOPS, ICON_IMAGE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks");
- uiDefIconButBitS(block, TOG, OOPS_GR, B_NEWOOPS, ICON_CIRCLE_DEHLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Group datablocks");
- uiDefIconButBitS(block, TOG, OOPS_LI, B_NEWOOPS, ICON_LIBRARY_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks");
- uiDefIconButBitS(block, TOG, OOPS_CA, B_NEWOOPS, ICON_CAMERA_DEHLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Camera datablocks");
- uiDefIconButBitS(block, TOG, OOPS_AR, B_NEWOOPS, ICON_ARMATURE, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Armature datablocks");
-
- uiBlockEndAlign(block);
-
- /* name */
- if(G.soops->lockpoin) {
- oops= G.soops->lockpoin;
- if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
- else strcpy(naam, oops->id->name);
-
- cpack(0x0);
- BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */
- BIF_SetScale(1.0);
- glRasterPos2i(xco+=XIC+10, 5);
- BIF_RasterPos(xco+=XIC+10, 5);
- BIF_DrawString(G.font, naam, 0);
-
- }
- }
-#ifdef SHOWDEPGRAPH
- else if(soops->type==SO_DEPSGRAPH) {
- // cpack colors : 0x00FF00 0xFF0000 0xFFFF00 0x000000 0x0000FF 0x00FFFF
- static unsigned char colr[21] ={0x00, 0xFF, 0x00,
- 0x00, 0x00, 0xFF,
- 0x00, 0xFF, 0xFF,
- 0x00, 0x00, 0x00,
- 0xFF, 0x00, 0x00,
- 0xFF, 0xFF, 0x00,
- 0xFF, 0x00, 0x00};
-
- uiDefButC( block, COL, 0, "", (short)(xco+=10),0, 5,YIC, colr, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|2, B_REDR, "parent", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "parent");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+3, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|1, B_REDR, "data", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "data");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+6, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|3, B_REDR, "track", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "track");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+9, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|4, B_REDR, "path", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "path");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+12, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|5, B_REDR, "cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "constraint");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+15, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|6, B_REDR, "hook.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "hook");
- uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+18, 0, 1, 0, 0, "");
- uiDefButS( block, TOG|BIT|7, B_REDR, "d cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "d cons");
- }
-#endif
- else {
- if(G.main->library.first)
-#ifdef WITH_VERSE
- uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, "");
-#else
- uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, "");
-#endif /* WITH_VERSE */
- else
-#ifdef WITH_VERSE
- uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, "");
-#else
- uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, "");
-#endif /* WITH_VERSE */
- }
-
- /* always do as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
-
-
diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c
deleted file mode 100644
index 2bf58fb2873..00000000000
--- a/source/blender/src/header_script.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/**
- * header_script.c nov-2003
- *
- * Functions to draw the "Script Window" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Willian P. Germano.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BLI_blenlib.h"
-
-#include "BSE_headerbuttons.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_sca.h"
-#include "BSE_filesel.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* ********************** SCRIPT ****************************** */
-
-/* action executed after clicking in Scripts menu */
-#ifndef DISABLE_PYTHON
-static void do_scripts_submenus(void *int_arg, int event)
-{
- int menutype = (intptr_t)int_arg;
-
- BPY_menu_do_python (menutype, event);
-
- //allqueue(REDRAWSCRIPT, 0);
-}
-
-static uiBlock *script_scripts_submenus(void *int_menutype)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
- BPyMenu *pym;
- int i = 0, menutype = (intptr_t)int_menutype;
-
- if ((menutype < 0) || (menutype > PYMENU_SCRIPTS_MENU_TOTAL))
- return NULL;
-
- block= uiNewBlock(&curarea->uiblocks, "scriptsscriptssubmenus", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_scripts_submenus, int_menutype);
-
- for (pym = BPyMenuTable[menutype]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_script_scriptsmenu(void *arg, int event)
-{
- ScrArea *sa;
-
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- /* these are no defines, easier this way, the codes are in the function below */
- switch(event) {
- case 0: /* update menus */
- if (BPY_path_update()==0) {
- error("Invalid scripts dir: check console");
- }
- break;
- }
-
-// allqueue(REDRAWSCRIPT, 0);
-}
-
-/* Scripts menu */
-static uiBlock *script_scriptsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 0, menuwidth = 120;
- int i;
-
- block= uiNewBlock(&curarea->uiblocks, "script_scriptsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL);
-
- for (i = 0; i < PYMENU_SCRIPTS_MENU_TOTAL; i++) {
- uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(intptr_t)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Update Menus", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "Use when a scripts folder or its contents are modified");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-void do_script_buttons(unsigned short event)
-{
- SpaceScript *sc= curarea->spacedata.first;
- ID *id, *idtest;
- int nr= 1;
- Script *script = sc->script;
-
-#ifndef DISABLE_PYTHON
- if (!sc) return;
- if (sc->spacetype != SPACE_SCRIPT) return;
-
- switch (event) {
- case B_SCRIPTBROWSE:
- if (sc->menunr==-2) {
- activate_databrowse((ID *)script, ID_SCR, 0, B_SCRIPTBROWSE,
- &sc->menunr, do_script_buttons);
- break;
- }
-
- if(sc->menunr < 0) break;
-
- nr = 1;
- id = (ID *)script;
-
- idtest= G.main->script.first;
- while(idtest) {
- if(nr==sc->menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest!=id) {
- sc->script= (Script *)idtest;
-
- allqueue(REDRAWSCRIPT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- break;
- case B_SCRIPT2PREV:
- if(sc->next) {
- BLI_remlink(&curarea->spacedata, sc);
- BLI_addtail(&curarea->spacedata, sc);
- sc = curarea->spacedata.first;
- newspace(curarea, sc->spacetype);
- }
- break;
- }
-#endif
- return;
-}
-
-void script_buttons(void)
-{
- uiBlock *block;
- SpaceScript *sc= curarea->spacedata.first;
- short xco = 8, xmax;
- char naam[256];
-
- if (!sc || sc->spacetype != SPACE_SCRIPT) return;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_SCRIPT;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0,
- SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu"
- " of available types.");
- xco += XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
-#ifndef DISABLE_PYTHON
- /* pull down menus */
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("Scripts");
- uiDefPulldownBut(block,script_scriptsmenu, NULL, "Scripts", xco, 0, xmax, 20, "");
- xco+=xmax;
- }
-#endif
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- uiBlockBeginAlign(block);
- uiDefIconBut(block, BUT, B_SCRIPT2PREV, ICON_GO_LEFT, xco+=XIC, 0, XIC, YIC,
- 0, 0, 0, 0, 0, "Returns to previous window");
-
- /* FULL WINDOW */
- if(curarea->full)
- uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco+=XIC,0,XIC,YIC, 0, 0,
- 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
- else
- uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco+=XIC,0,XIC,YIC, 0, 0,
- 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
- uiBlockEndAlign(block);
-
- /* STD SCRIPT BUTTONS */
- xco += 2*XIC;
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_SCRIPTBROWSE, ID_SCRIPT, 0, (ID*)sc->script, 0, &(sc->menunr), 0, 0, 0, 0, 0);
-
- /* always as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
-
-
-/* ********************** SCRIPT ****************************** */
-
diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c
deleted file mode 100644
index 8138918877f..00000000000
--- a/source/blender/src/header_seq.c
+++ /dev/null
@@ -1,794 +0,0 @@
-/**
- * header_seq.c oct-2003
- *
- * Functions to draw the "Video Sequence Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-
-#include "DNA_ID.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_space_types.h"
-#include "BLI_blenlib.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BIF_drawseq.h"
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_editseq.h"
-#include "BSE_drawipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_sequence.h"
-#include "BSE_time.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-static int viewmovetemp = 0;
-
-static void do_seq_viewmenu(void *arg, int event)
-{
- extern int play_anim(int mode);
- Sequence * last_seq = get_last_seq();
- SpaceSeq * sseq = curarea->spacedata.first;
-
- switch(event)
- {
- case 1: /* Play Back Animation */
- play_anim(0);
- break;
- case 2: /* Play Back Animation in All */
- play_anim(1);
- break;
- case 3:
- seq_home();
- break;
- case 4:
- if(last_seq) {
- CFRA= last_seq->startdisp;
- G.v2d->cur.xmin= last_seq->startdisp- (last_seq->len/20);
- G.v2d->cur.xmax= last_seq->enddisp+ (last_seq->len/20);
- update_for_newframe();
- }
- break;
- case 5: /* Lock time */
- G.v2d->flag ^= V2D_VIEWLOCK;
- if (G.v2d->flag & V2D_VIEWLOCK) {
- view2d_do_locks(curarea, 0);
- }
- break;
- case 6: /* Draw time/frames */
- sseq->flag ^= SEQ_DRAWFRAMES;
- break;
- case 7: /* Grease Pencil */
- add_blockhandler(curarea, SEQ_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- }
-}
-
-static uiBlock *seq_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
- SpaceSeq * sseq = curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_seq_viewmenu, NULL);
-
- if (sseq->mainb) {
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL,
- "Grease Pencil...", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
- if (sseq->mainb == 0) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Play Back Animation "
- "in all Sequence Areas|Alt A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Play Back Animation "
- "in this window|Alt A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Play Back Animation in all "
- "3D Views and Sequence Areas|Alt Shift A",
- 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
-
- /* Lock Time */
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- /* Draw time or frames.*/
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(sseq->flag & SEQ_DRAWFRAMES)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
-
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_seq_selectmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- borderselect_seq();
- break;
- case 1:
- swap_select_seq();
- break;
- case 2:
- select_dir_from_last(1);
- break;
- case 3:
- select_dir_from_last(2);
- break;
- case 4:
- select_surround_from_last();
- break;
- case 5:
- select_neighbor_from_last(1);
- break;
- case 6:
- select_neighbor_from_last(2);
- break;
- case 7:
- select_linked_seq(2);
- break;
- case 8:
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- break;
- }
-}
-
-static uiBlock *seq_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_seq_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strips to the Left", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strips to the Right", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surrounding Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Left Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Right Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Strips|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_seq_addmenu_effectmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- add_sequence(SEQ_ADD);
- break;
- case 1:
- add_sequence(SEQ_SUB);
- break;
- case 2:
- add_sequence(SEQ_MUL);
- break;
- case 3:
- add_sequence(SEQ_CROSS);
- break;
- case 4:
- add_sequence(SEQ_GAMCROSS);
- break;
- case 5:
- add_sequence(SEQ_ALPHAOVER);
- break;
- case 6:
- add_sequence(SEQ_ALPHAUNDER);
- break;
- case 7:
- add_sequence(SEQ_OVERDROP);
- break;
- case 8:
- add_sequence(SEQ_PLUGIN);
- break;
- case 9:
- add_sequence(SEQ_WIPE);
- break;
- case 10:
- add_sequence(SEQ_GLOW);
- break;
- case 11:
- add_sequence(SEQ_TRANSFORM);
- break;
- case 12:
- add_sequence(SEQ_COLOR);
- break;
- case 13:
- add_sequence(SEQ_SPEED);
- break;
- }
-}
-
-static uiBlock *seq_addmenu_effectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_addmenu_effectmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_seq_addmenu_effectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subtract", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Multiply", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cross", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Gamma Cross", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Under", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over Drop", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Wipe", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Glow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Color Generator", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Speed Control", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plugin...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-
-static void do_seq_addmenu(void *arg, int event)
-{
- switch(event)
- {
- case 0:
- add_sequence(SEQ_IMAGE);
- break;
- case 1:
- add_sequence(SEQ_MOVIE);
- break;
- case 2:
- add_sequence(SEQ_RAM_SOUND);
- break;
- case 3:
- add_sequence(SEQ_HD_SOUND);
- break;
- case 4:
- add_sequence(SEQ_SCENE);
- break;
- case 5:
- add_sequence(SEQ_MOVIE_AND_HD_SOUND);
- break;
- }
-}
-
-static uiBlock *seq_addmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_seq_addmenu, NULL);
-
- uiDefIconTextBlockBut(block, seq_addmenu_effectmenu, NULL, ICON_RIGHTARROW_THIN, "Effect", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
-#ifdef WITH_FFMPEG
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (RAM)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-#else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (Wav)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-#endif
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scene", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-#ifdef WITH_FFMPEG
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie + Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_seq_editmenu(void *arg, int event)
-{
- SpaceSeq *sseq;
-
- sseq= curarea->spacedata.first;
-
- switch(event)
- {
- case 1: /* Change Strip... */
- change_sequence();
- break;
- case 2: /* Make Meta Strip */
- make_meta();
- break;
- case 3: /* Separate Meta Strip */
- un_meta();
- break;
- case 4: /* former Properties... */
- break;
- case 5: /* Duplicate */
- add_duplicate_seq();
- break;
- case 6: /* Delete */
- del_seq();
- break;
- case 7: /* Grab/Extend */
- transform_seq('e', 0);
- break;
- case 8:
- set_filter_seq();
- break;
- case 9:
- enter_meta();
- break;
- case 10:
- exit_meta();
- break;
- case 11: /* grab/move */
- transform_seq('g', 0);
- break;
- case 12: /* Snap to Current Frame */
- seq_snap(event);
- break;
- case 13: /* Cut at Current Frame */
- seq_cut(CFRA, 1);
- break;
- case 14:
- reassign_inputs_seq_effect();
- break;
- case 15:
- seq_remap_paths();
- break;
- case 16:
- seq_separate_images();
- break;
- case 17:
- reload_sequence();
- break;
- case 18:
- seq_lock_sel(1);
- break;
- case 19:
- seq_lock_sel(0);
- break;
- case 20:
- seq_mute_sel(1);
- break;
- case 21:
- seq_mute_sel(0);
- break;
- case 22:
- seq_mute_sel(0);
- break;
- case 23:
- seq_cut(CFRA, 0);
- break;
- }
-}
-
-static uiBlock *seq_editmenu(void *arg_unused)
-{
- uiBlock *block;
- Editing *ed;
- short yco= 0, menuwidth=120;
- Sequence * last_seq = get_last_seq();
-
- ed = G.scene->ed;
-
- block= uiNewBlock(&curarea->uiblocks, "seq_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_seq_editmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Extend from frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap to Current Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut (hard) at Current Frame|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut (soft) at Current Frame|Shift-K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate Images to Strips|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- if (last_seq != NULL && last_seq->type != SEQ_MOVIE) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(last_seq->type >= SEQ_EFFECT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Effect...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reassign Inputs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- }
- else if(last_seq->type == SEQ_IMAGE) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Image...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Scene...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- if(last_seq->type==SEQ_IMAGE)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remap Paths...|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
-
- }
-
- if (last_seq != NULL && last_seq->type == SEQ_MOVIE) {
-/* uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Filter Y|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); */
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remap Paths...|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
- }
-
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Meta Strip...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate Meta Strip...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- if ((ed != NULL) && (ed->metastack.first > 0)){
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enter/Exit Meta Strip|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- }
- else {
- if (last_seq != NULL && last_seq->type == SEQ_META) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enter/Exit Meta Strip|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- }
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload Strip Data...|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lock Strips...|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unlock Strips...|Alt-Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mute Strips...|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unmute Strips...|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mute Deselected Strips...|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_seq_markermenu(void *arg, int event)
-{
- SpaceSeq *sseq= curarea->spacedata.first;
-
- switch(event)
- {
- case 1:
- add_marker(CFRA);
- break;
- case 2:
- duplicate_marker();
- break;
- case 3:
- remove_marker();
- break;
- case 4:
- rename_marker();
- break;
- case 5:
- transform_markers('g', 0);
- break;
- case 6:
- sseq->flag ^= SEQ_MARKER_TRANS;
- break;
-
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *seq_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- SpaceSeq *sseq= curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_seq_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|Ctrl Alt M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, (sseq->flag & SEQ_MARKER_TRANS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Transform Markers", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- } else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_seq_buttons(short event)
-{
- Editing *ed;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- switch(event) {
- case B_HOME:
- seq_home();
- break;
- case B_SEQCLEAR:
- free_imbuf_seq();
- allqueue(REDRAWSEQ, 1);
- break;
- }
-}
-
-void seq_buttons()
-{
- SpaceSeq *sseq;
- short xco;
- char naam[20];
- uiBlock *block;
- short xmax;
-
- sseq= curarea->spacedata.first;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_SEQ;
-
- xco = 8;
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
-
- /* pull down menus */
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block,seq_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+=xmax;
- if (sseq->mainb == 0) {
- xmax= GetButStringLength("Select");
- uiDefPulldownBut(block,seq_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- xco+=xmax;
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block,seq_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
- xco+=xmax;
-
- xmax= GetButStringLength("Add");
- uiDefPulldownBut(block, seq_addmenu, NULL, "Add", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Strip");
- uiDefPulldownBut(block, seq_editmenu, NULL, "Strip", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- /* end of pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
-
- /* IMAGE */
- uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SEQ_SEQUENCER,
- "Image Preview: %t"
- "|Sequence %x0"
- "|Image Preview %x1"
- "|Luma Waveform %x2"
- "|Chroma Vectorscope %x3"
- "|Histogram %x4",
- xco,0,XIC+10,YIC, &sseq->mainb, 0.0, 3.0,
- 0, 0,
- "Shows the sequence output image preview");
-
- xco+= 8 + XIC+10;
-
- if(sseq->mainb) {
- int minchan = 0;
-
- /* CHANNEL shown in image preview */
-
- if (G.scene->ed && ((Editing*)G.scene->ed)->metastack.first)
- minchan = -BLI_countlist(&((Editing*)G.scene->ed)->metastack);
-
- uiDefButS(block, NUM, B_REDR, "Chan:",
- xco, 0, 3.5 * XIC,YIC,
- &sseq->chanshown, minchan, MAXSEQ, 0, 0,
- "The channel number shown in the image preview. 0 is the result of all strips combined.");
-
- xco+= 8 + XIC*3.5;
-
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- uiDefButS(block, MENU, B_REDR,
- "Show zebra: %t"
- "|Z 110 %x110"
- "|Z 100 %x100"
- "|Z 95 %x95"
- "|Z 90 %x90"
- "|Z 70 %x70"
- "|Z Off %x0",
- xco,0,3.0 * XIC, YIC, &sseq->zebra,
- 0,0,0,0,
- "Show overexposed "
- "areas with zebra stripes");
-
- xco+= 8 + XIC*3.0;
-
- uiDefButBitI(block, TOG, SEQ_DRAW_SAFE_MARGINS,
- B_REDR, "T",
- xco,0,XIC,YIC, &sseq->flag,
- 0, 0, 0, 0,
- "Draw title safe margins in preview");
- xco+= 8 + XIC;
- }
-
- if (sseq->mainb == SEQ_DRAW_IMG_WAVEFORM) {
- uiDefButBitI(block, TOG, SEQ_DRAW_COLOR_SEPERATED,
- B_REDR, "CS",
- xco,0,XIC,YIC, &sseq->flag,
- 0, 0, 0, 0,
- "Seperate color channels in preview");
- xco+= 8 + XIC;
- }
- } else {
- /* ZOOM and BORDER */
- uiDefIconButI(block, TOG, B_VIEW2DZOOM,
- ICON_VIEWZOOM,
- xco,0,XIC,YIC, &viewmovetemp,
- 0, 0, 0, 0,
- "Zooms view in and out (Ctrl MiddleMouse)");
- xco += XIC;
- uiDefIconBut(block, BUT, B_IPOBORDER,
- ICON_BORDERMOVE,
- xco,0,XIC,YIC, 0,
- 0, 0, 0, 0,
- "Zooms view to fit area");
- xco += 8 + XIC;
- }
-
- uiDefBut(block, BUT, B_SEQCLEAR, "Refresh", xco,0,3*XIC,YIC, 0, 0, 0, 0, 0, "Clears all buffered images in memory");
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_sound.c b/source/blender/src/header_sound.c
deleted file mode 100644
index a3817bd5df3..00000000000
--- a/source/blender/src/header_sound.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/**
- * header_sound.c oct-2003
- *
- * Functions to draw the "Audio Timeline" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BIF_editsound.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_butspace.h"
-
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_time.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-void do_sound_buttons(unsigned short event)
-{
- ID *id, *idtest;
- int nr;
- char name[256];
-
- switch(event) {
-
- case B_SOUNDBROWSE:
- if(G.ssound->sndnr== -2) {
- activate_databrowse((ID *)G.ssound->sound, ID_SO, 0,
- B_SOUNDBROWSE, &G.ssound->sndnr, do_sound_buttons);
- return;
- }
- if (G.ssound->sndnr < 0) break;
- if (G.ssound->sndnr == 32766) {
- if (G.ssound && G.ssound->sound) strcpy(name, G.ssound->sound->name);
- else strcpy(name, U.sounddir);
- activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name,
- load_space_sound);
- } else {
- nr= 1;
- id= (ID *)G.ssound->sound;
-
- idtest= G.main->sound.first;
- while(idtest) {
- if(nr==G.ssound->sndnr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
-
- if(idtest==0) { /* no new */
- return;
- }
-
- if(idtest!=id) {
- G.ssound->sound= (bSound *)idtest;
- if(idtest->us==0) idtest->us= 1;
- allqueue(REDRAWSOUND, 0);
- }
- }
-
- break;
- case B_SOUNDBROWSE2:
- id = (ID *)G.buts->lockpoin;
- if(G.buts->texnr == -2) {
- activate_databrowse(id, ID_SO, 0, B_SOUNDBROWSE2,
- &G.buts->texnr, do_sound_buttons);
- return;
- }
- if (G.buts->texnr < 0) break;
- if (G.buts->texnr == 32766) {
- if (id) strcpy(name, ((bSound *)id)->name);
- else strcpy(name, U.sounddir);
- activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, load_sound_buttons);
- }
- else {
- nr= 1;
-
- idtest= G.main->sound.first;
- while (idtest) {
- if(nr == G.buts->texnr) {
- break;
- }
- nr++;
- idtest = idtest->next;
- }
-
- if (idtest == 0) { /* geen new */
- return;
- }
-
- if (idtest != id) {
- G.buts->lockpoin = (bSound *)idtest;
- if(idtest->us==0) idtest->us= 1;
- allqueue(REDRAWBUTSSCENE, 0);
- }
- }
- break;
-
- case B_SOUNDHOME:
- if(G.ssound->sound==NULL) {
- G.v2d->tot.xmin= G.scene->r.sfra;
- G.v2d->tot.xmax= G.scene->r.efra;
- }
- G.v2d->cur= G.v2d->tot;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- view2d_do_locks(curarea, V2D_LOCK_COPY);
- scrarea_queue_winredraw(curarea);
- break;
- }
-}
-
-static void do_sound_viewmenu(void *arg, int event)
-{
- extern int play_anim(int mode);
-
- switch(event) {
- case 1: /* Play Back Animation */
- play_anim(0);
- break;
- case 2: /* Play Back Animation in All */
- play_anim(1);
- break;
- case 3: /* View All */
- do_sound_buttons(B_SOUNDHOME);
- break;
- case 4: /* Maximize Window */
- /* using event B_FULL */
- break;
- case 5: /* jump to next marker */
- nextprev_marker(1);
- break;
- case 6: /* jump to previous marker */
- nextprev_marker(-1);
- break;
- case 7:
- G.v2d->flag ^= V2D_VIEWLOCK;
- if(G.v2d->flag & V2D_VIEWLOCK)
- view2d_do_locks(curarea, 0);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *sound_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "sound_viewmenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_sound_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
- "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- if (!curarea->full)
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else
- uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_sound_markermenu(void *arg, int event)
-{
- switch(event)
- {
- case 1:
- add_marker(CFRA);
- break;
- case 2:
- duplicate_marker();
- break;
- case 3:
- remove_marker();
- break;
- case 4:
- rename_marker();
- break;
- case 5:
- transform_markers('g', 0);
- break;
- }
-
- allqueue(REDRAWMARKER, 0);
-}
-
-static uiBlock *sound_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "sound_markermenu",
- UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_sound_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-
-void sound_buttons(void)
-{
- uiBlock *block;
- short xco, xmax;
- char naam[256];
- char ch[20];
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_SOUND;
-
- xco = 8;
-
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D,
- windowtype_pup(), xco, 0, XIC+10, YIC,
- &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays Current Window Type. "
- "Click for menu of available types.");
-
- xco += XIC + 14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if (curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Show pulldown menus");
- }
- else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU,
- ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0,
- "Hide pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, sound_viewmenu, NULL,
- "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block, sound_markermenu, NULL,
- "Marker", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco= std_libbuttons(block, xco+8, 0, 0, NULL, B_SOUNDBROWSE, ID_SO, 0, (ID *)G.ssound->sound, 0, &(G.ssound->sndnr), 1, 0, 0, 0, 0);
-
- if(G.ssound->sound) {
- bSound *sound= G.ssound->sound;
-
- if (sound->sample && sound->sample->len)
- {
- if (sound->sample->channels == 1)
- strcpy(ch, "Mono");
- else if (sound->sample->channels == 2)
- strcpy(ch, "Stereo");
- else
- strcpy(ch, "Unknown");
-
- sprintf(naam, "Sample: %s, %d bit, %d Hz, %d samples", ch, sound->sample->bits, sound->sample->rate, sound->sample->len);
- cpack(0x0);
- glRasterPos2i(xco+10, 5);
- BMF_DrawString(uiBlockGetCurFont(block), naam);
- }
- else
- {
- sprintf(naam, "No sample info available.");
- cpack(0x0);
- glRasterPos2i(xco+10, 5);
- BMF_DrawString(uiBlockGetCurFont(block), naam);
- }
-
- }
-
- /* always as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
-
-/* the next two functions are also called from fileselect: */
-
-void load_space_sound(char *str)
-{
- bSound *sound;
-
- sound= sound_new_sound(str);
- if (sound) {
- if (G.ssound) {
- G.ssound->sound= sound;
- }
- } else {
- error("Not a valid sample: %s", str);
- }
-
- allqueue(REDRAWSOUND, 0);
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-void load_sound_buttons(char *str)
-{
- bSound *sound;
-
- sound= sound_new_sound(str);
- if (sound) {
- if (curarea && curarea->spacetype==SPACE_BUTS) {
- if (G.buts->mainb == CONTEXT_SCENE) {
- if( G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND )
- G.buts->lockpoin = sound;
- }
- }
- }
- else {
- error("Not a valid sample: %s", str);
- }
-
- allqueue(REDRAWBUTSSCENE, 0);
-}
diff --git a/source/blender/src/header_text.c b/source/blender/src/header_text.c
deleted file mode 100644
index 9268642db2f..00000000000
--- a/source/blender/src/header_text.c
+++ /dev/null
@@ -1,1111 +0,0 @@
-/**
- * header_text.c oct-2003
- *
- * Functions to draw the "Text Editor" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-/* file time checking */
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifndef _WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#include "BLI_winstuff.h"
-#endif
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-#include "MEM_guardedalloc.h"
-
-#include "BSE_headerbuttons.h"
-
-#include "DNA_ID.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_text_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_action_types.h"
-
-#include "BIF_gl.h" /* for glRasterPos2i */
-#include "BIF_drawtext.h"
-#include "BIF_interface.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_sca.h"
-#include "BKE_text.h"
-#include "BKE_depsgraph.h"
-
-#include "BSE_filesel.h"
-
-#include "BLI_blenlib.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "blendef.h"
-#include "mydevice.h"
-
-extern void redraw_alltext(void); /* defined in drawtext.c */
-
-void do_text_buttons(unsigned short event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- ID *id, *idtest;
- int nr= 1;
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- switch (event) {
- case B_TEXTBROWSE:
- if (st->menunr==-2) {
- activate_databrowse((ID *)st->text, ID_TXT, 0, B_TEXTBROWSE,
- &st->menunr, do_text_buttons);
- break;
- }
- if(st->menunr < 0) break;
-
- text= st->text;
-
- nr= 1;
- id= (ID *)text;
-
- if (st->menunr==32767) {
- st->text= (Text *)add_empty_text( "Text" );
-
- st->top= 0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- else if (st->menunr==32766) {
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- return;
- }
- else {
- idtest= G.main->text.first;
- while(idtest) {
- if(nr==st->menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new text */
- activate_fileselect(FILE_SPECIAL, "Open Text File",
- G.sce, add_text_fs);
- return;
- }
- if(idtest!=id) {
- st->text= (Text *)idtest;
- st->top= 0;
-
- pop_space_text(st);
- if (st->showsyntax) txt_format_text(st);
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
- }
- break;
-
- case B_TEXTDELETE:
- {
- text= st->text;
- if (!text) return;
-
- /* make the previous text active, if its not there make the next text active */
- if (st->text->id.prev) {
- st->text = st->text->id.prev;
- pop_space_text(st);
- } else if (st->text->id.next) {
- st->text = st->text->id.next;
- pop_space_text(st);
- }
-
-#ifndef DISABLE_PYTHON
- BPY_clear_bad_scriptlinks(text);
- BPY_free_pyconstraint_links(text);
- free_text_controllers(text);
-#endif
- unlink_text(text);
- free_libblock(&G.main->text, text);
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
-
- /*for if any object constraints were changed.*/
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Delete Text");
- }
- break;
-
-/*
- case B_TEXTSTORE:
- st->text->flags ^= TXT_ISEXT;
-
- allqueue(REDRAWHEADERS, 0);
- break;
-*/
- case B_TEXTLINENUM:
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
-
- case B_TEXTFONT:
- switch(st->font_id) {
- case 0:
- st->lheight= 12; break;
- case 1:
- st->lheight= 15;
- break;
- }
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
-
- break;
- case B_TAB_NUMBERS:
- if (st->showsyntax) txt_format_text(st);
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case B_SYNTAX:
- if (st->showsyntax) txt_format_text(st);
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case B_TEXTPLUGINS:
- allqueue(REDRAWHEADERS, 0);
- break;
- case B_WORDWRAP:
- st->left= 0;
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- }
-}
-#ifndef DISABLE_PYTHON
-static void do_text_template_scriptsmenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_SCRIPTTEMPLATE, event);
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-static uiBlock *text_template_scriptsmenu (void *args_unused)
-{
- uiBlock *block;
- BPyMenu *pym;
- int i= 0;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_template_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_template_scriptsmenu, NULL);
-
- /* note that we acount for the N previous entries with i+20: */
- for (pym = BPyMenuTable[PYMENU_SCRIPTTEMPLATE]; pym; pym = pym->next, i++) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_text_plugin_scriptsmenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_TEXTPLUGIN, event);
-
- allqueue(REDRAWIMAGE, 0);
-}
-
-static uiBlock *text_plugin_scriptsmenu (void *args_unused)
-{
- uiBlock *block;
- BPyMenu *pym;
- int i= 0;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_plugin_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_plugin_scriptsmenu, NULL);
-
- /* note that we acount for the N previous entries with i+20: */
- for (pym = BPyMenuTable[PYMENU_TEXTPLUGIN]; pym; pym = pym->next, i++) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif
-
-/* action executed after clicking in File menu */
-static void do_text_filemenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text= st->text;
-
- switch(event) {
- case 1:
- st->text= add_empty_text( "Text" );
- st->top=0;
-
- allqueue(REDRAWTEXT, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
- case 2:
- activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs);
- break;
- case 3:
-#ifndef DISABLE_PYTHON
- if (text->compiled) BPY_free_compiled_text(text);
- text->compiled = NULL;
-#endif
- if (okee("Reopen Text")) {
- if (!reopen_text(text)) {
- error("Could not reopen file");
- }
- if (st->showsyntax) txt_format_text(st);
- }
- break;
- case 5:
- text->flags |= TXT_ISMEM;
- case 4:
- txt_write_file(text);
- break;
- case 6:
- text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
- MEM_freeN(text->name);
- text->name= NULL;
- break;
- case 7:
- run_python_script(st);
- break;
- case 8:
-#ifndef DISABLE_PYTHON
- {
- Object *ob;
- bConstraint *con;
- short update;
-
- /* check all pyconstraints */
- for (ob= G.main->object.first; ob; ob= ob->id.next) {
- update = 0;
- if (ob->type==OB_ARMATURE && ob->pose) {
- bPoseChannel *pchan;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- for (con = pchan->constraints.first; con; con= con->next) {
- if (con->type==CONSTRAINT_TYPE_PYTHON) {
- bPythonConstraint *data = con->data;
- if (data->text==text) BPY_pyconstraint_update(ob, con);
- update = 1;
-
- }
- }
- }
- }
- for (con = ob->constraints.first; con; con= con->next) {
- if (con->type==CONSTRAINT_TYPE_PYTHON) {
- bPythonConstraint *data = con->data;
- if (data->text==text) BPY_pyconstraint_update(ob, con);
- update = 1;
- }
- }
-
- if (update) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
-#endif
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* action executed after clicking in Edit menu */
-static void do_text_editmenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text= st->text;
-
- switch(event) {
- case 1:
- txt_do_undo(text);
- pop_space_text(st);
- break;
- case 2:
- txt_do_redo(text);
- pop_space_text(st);
- break;
- case 3:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_copy_clipboard(text);
- txt_cut_sel(text);
- pop_space_text(st);
- break;
- case 4:
- //txt_copy_sel(text);
- txt_copy_clipboard(text);
- break;
- case 5:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- txt_paste_clipboard(text);
- if (st->showsyntax) txt_format_text(st);
- break;
- case 6:
- txt_print_cutbuffer();
- break;
- case 7:
- jumptoline_interactive(st);
- break;
- case 8:
- case 9:
- find_and_replace(st, 0);
- break;
- case 10:
- find_and_replace(st, 1);
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* action executed after clicking in View menu */
-static void do_text_editmenu_viewmenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- switch(event) {
- case 1:
- txt_move_bof(text, 0);
- pop_space_text(st);
- break;
- case 2:
- txt_move_eof(text, 0);
- pop_space_text(st);
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* action executed after clicking in Select menu */
-static void do_text_editmenu_selectmenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- switch(event) {
- case 1:
- txt_sel_all(text);
- break;
- case 2:
- txt_sel_line(text);
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* action executed after clicking in Markers menu */
-static void do_text_editmenu_markermenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
- TextMarker *mrk;
- int lineno;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- switch(event) {
- case 1:
- txt_clear_markers(text, 0, 0);
- break;
- case 2:
- lineno= txt_get_span(text->lines.first, text->curl);
- mrk= text->markers.first;
- while (mrk && (mrk->lineno<lineno || (mrk->lineno==lineno && mrk->start <= text->curc)))
- mrk= mrk->next;
- if (!mrk) mrk= text->markers.first;
- if (mrk) {
- txt_move_to(text, mrk->lineno, mrk->start, 0);
- txt_move_to(text, mrk->lineno, mrk->end, 1);
- }
- break;
- case 3:
- lineno= txt_get_span(text->lines.first, text->curl);
- mrk= text->markers.last;
- while (mrk && (mrk->lineno>lineno || (mrk->lineno==lineno && mrk->end > text->curc)))
- mrk= mrk->prev;
- if (!mrk) mrk= text->markers.last;
- if (mrk) {
- txt_move_to(text, mrk->lineno, mrk->start, 0);
- txt_move_to(text, mrk->lineno, mrk->end, 1);
- }
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* action executed after clicking in Format menu */
-static void do_text_formatmenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- switch(event) {
- case 3:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if (txt_has_sel(text)) {
- txt_order_cursors(text);
- indent(text);
- break;
- }
- else {
- txt_add_char(text, '\t');
- break;
- }
- case 4:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if ( txt_has_sel(text)) {
- txt_order_cursors(text);
- unindent(text);
- break;
- }
- break;
- case 5:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if ( txt_has_sel(text)) {
- txt_order_cursors(text);
- comment(text);
- if (st->showsyntax) txt_format_text(st);
- break;
- }
- break;
- case 6:
- if (text && text->id.lib) {
- error_libdata();
- break;
- }
- if ( txt_has_sel(text)) {
- txt_order_cursors(text);
- uncomment(text);
- if (st->showsyntax) txt_format_text(st);
- break;
- }
- break;
- default:
- break;
- }
-
- redraw_alltext();
-}
-
-/* View menu */
-static uiBlock *text_editmenu_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_editmenu_viewmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_editmenu_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Top of File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bottom of File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-/* Select menu */
-static uiBlock *text_editmenu_selectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_editmenu_selectmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_editmenu_selectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select All|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Line", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-/* Select menu */
-static uiBlock *text_editmenu_markermenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_editmenu_markermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_editmenu_markermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Marker", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-void do_text_formatmenu_convert(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- switch(event) {
- case 1: convert_tabs(st, 0); break;
- case 2: convert_tabs(st, 1); break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *text_formatmenu_convert(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "do_text_formatmenu_convert", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_formatmenu_convert, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Spaces", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "Converts script whitespace to spaces based on Tab:");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Tabs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "Converts script whitespace to tabs based on Tab:");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-/* Format menu */
-static uiBlock *text_formatmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_formatmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_text_formatmenu, NULL);
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Indent|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unindent|Shift Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Comment", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Uncomment|Ctrl Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, text_formatmenu_convert, NULL, ICON_RIGHTARROW_THIN, "Convert whitespace", 0, yco-=20, menuwidth, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-
-/* action executed after clicking in Object to 3d Sub Menu */
-void do_text_editmenu_to3dmenu(void *arg, int event)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text;
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- switch(event) {
- case 1: txt_export_to_object(text); break;
- case 2: txt_export_to_objects(text); break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* Object to 3d Sub Menu */
-static uiBlock *text_editmenu_to3dmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "do_text_editmenu_to3dmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_text_editmenu_to3dmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "One Object | Alt-M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "One Object Per Line", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-
-/* Edit menu */
-static uiBlock *text_editmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_text_editmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo|Ctrl Shift Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut|Alt X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Print Cut Buffer", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, text_editmenu_viewmenu, NULL, ICON_RIGHTARROW_THIN, "View|Alt Shift V ", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, text_editmenu_selectmenu, NULL, ICON_RIGHTARROW_THIN, "Select|Alt Shift S ", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, text_editmenu_markermenu, NULL, ICON_RIGHTARROW_THIN, "Markers", 0, yco-=20, 120, 19, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump...|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find And Replace...|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Next|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, text_editmenu_to3dmenu, NULL, ICON_RIGHTARROW_THIN, "Text to 3d Object", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-/* File menu */
-static uiBlock *text_filemenu(void *arg_unused)
-{
- SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */
- Text *text= st->text;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "text_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_text_filemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- if(text) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reopen|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-
- if (text->name)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Internal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Run Python Script|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-#ifndef DISABLE_PYTHON
- if (BPY_is_pyconstraint(text))
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Refresh All PyConstraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-#endif
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-
-#ifndef DISABLE_PYTHON
- uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-
-/* text sync functions */
-
-/* returns 0 if file on disk is the same or Text is in memory only
- returns 1 if file has been modified on disk since last local edit
- returns 2 if file on disk has been deleted
- -1 is returned if an error occurs
-*/
-static int txt_file_modified(Text *text)
-{
- struct stat st;
- int result;
- char file[FILE_MAXDIR+FILE_MAXFILE];
-
- if (!text || !text->name)
- return 0;
-
- BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_convertstringcode(file, G.sce);
-
- if (!BLI_exists(file))
- return 2;
-
- result = stat(file, &st);
-
- if(result == -1)
- return -1;
-
- if((st.st_mode & S_IFMT) != S_IFREG)
- return -1;
-
- if (st.st_mtime > text->mtime)
- return 1;
-
- return 0;
-}
-
-static void txt_ignore_modified(Text *text) {
- struct stat st;
- int result;
- char file[FILE_MAXDIR+FILE_MAXFILE];
-
- if (!text || !text->name) return;
-
- BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
- BLI_convertstringcode(file, G.sce);
-
- if (!BLI_exists(file)) return;
-
- result = stat(file, &st);
-
- if(result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
- return;
-
- text->mtime= st.st_mtime;
-}
-
-static short do_modification_check(SpaceText *st_v) {
- SpaceText *st = (SpaceText *)st_v;
- Text *text= st->text;
-
- switch (txt_file_modified(text)) {
- case 1:
- /* Modified locally and externally, ahhh. Offer more possibilites. */
- if (text->flags & TXT_ISDIRTY) {
- switch (pupmenu("File Modified Outside and Inside Blender %t|Load outside changes (ignore local changes) %x0|Save local changes (ignore outside changes) %x1|Make text internal (separate copy) %x2")) {
- case 0:
- reopen_text(text);
- if (st->showsyntax) txt_format_text(st);
- return 1;
- case 1:
- txt_write_file(text);
- return 1;
- case 2:
- text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
- MEM_freeN(text->name);
- text->name= NULL;
- return 1;
- }
- } else {
- switch (pupmenu("File Modified Outside Blender %t|Reload from disk %x0|Make text internal (separate copy) %x1|Ignore %x2")) {
- case 0:
-#ifndef DISABLE_PYTHON
- if (text->compiled) BPY_free_compiled_text(text);
- text->compiled = NULL;
-#endif
- reopen_text(text);
- if (st->showsyntax) txt_format_text(st);
- return 1;
- case 1:
- text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
- MEM_freeN(text->name);
- text->name= NULL;
- return 1;
- case 2:
- txt_ignore_modified(text);
- return 1;
- }
- }
- break;
- case 2:
- switch (pupmenu("File Deleted Outside Blender %t|Make text internal %x0|Recreate file %x1")) {
- case 0:
- text->flags |= TXT_ISMEM | TXT_ISDIRTY | TXT_ISTMP;
- MEM_freeN(text->name);
- text->name= NULL;
- return 1;
- case 1:
- txt_write_file(text);
- return 1;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-static void do_modification_func(void *st_v, void *dummy)
-{
- if (do_modification_check((SpaceText *)st_v))
- redraw_alltext();
-}
-
-/* header */
-#define HEADER_PATH_MAX 260
-void text_buttons(void)
-{
- uiBlock *block;
- SpaceText *st= curarea->spacedata.first;
- Text *text;
- short xco, xmax;
- char naam[256], fname[HEADER_PATH_MAX], headtxt[HEADER_PATH_MAX+17];
- int len;
-
- if (st==NULL || st->spacetype != SPACE_TEXT) return;
-
- text = st->text;
-
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_TEXT;
-
- xco = 8;
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- /* pull down menus */
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- xmax= GetButStringLength("Text");
- uiDefPulldownBut(block,text_filemenu, NULL, "Text", xco, 0, xmax, 20, "");
- xco+=xmax;
-
- if(text) {
- xmax= GetButStringLength("Edit");
- uiDefPulldownBut(block,text_editmenu, NULL, "Edit", xco, 0, xmax, 20, "");
- xco+=xmax;
-
- xmax= GetButStringLength("Format");
- uiDefPulldownBut(block,text_formatmenu, NULL, "Format", xco, 0, xmax, 20, "");
- xco+=xmax;
- }
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco += 10;
-
- /* FULL WINDOW */
- uiBlockBeginAlign(block);
- if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)");
- else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)");
-
- uiDefIconButI(block, ICONTOG, B_TEXTLINENUM, ICON_LONGDISPLAY, xco+=XIC,0,XIC,YIC, &st->showlinenrs, 0, 0, 0, 0, "Displays line numbers");
- uiDefIconButI(block, ICONTOG, B_WORDWRAP, ICON_WORDWRAP, xco+=XIC,0,XIC,YIC, &st->wordwrap, 0, 0, 0, 0, "Enables word wrap");
- uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables syntax highlighting");
- uiDefIconButI(block, ICONTOG, B_TEXTPLUGINS, ICON_PYTHON, xco+=XIC,0,XIC,YIC, &st->doplugins, 0, 0, 0, 0, "Enables Python text plugins");
- uiBlockEndAlign(block);
-
- /* Warning button if text is out of date*/
- if (text && txt_file_modified(text)) {
- uiBut *bt;
- xco+= XIC;
- uiBlockSetCol(block, TH_REDALERT);
- bt= uiDefIconBut(block, BUT, B_NOP, ICON_HELP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "External text is out of sync, click for options to resolve the conflict");
- uiButSetFunc(bt, do_modification_func, (void *)st, NULL);
- uiBlockSetCol(block, TH_AUTO);
- }
-
- /* STD TEXT BUTTONS */
- xco+= 2*XIC;
- xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXTBROWSE, ID_TXT, 0, (ID*)st->text, 0, &(st->menunr), 0, 0, B_TEXTDELETE, 0, 0);
- xco+=XIC;
-
- /*
- if (st->text) {
- if (st->text->flags & TXT_ISDIRTY && (st->text->flags & TXT_ISEXT || !(st->text->flags & TXT_ISMEM)))
- uiDefIconBut(block, BUT,0, ICON_ERROR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "The text has been changed");
- if (st->text->flags & TXT_ISEXT)
- uiDefBut(block, BUT,B_TEXTSTORE, ICON(), xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Stores text in project file");
- else
- uiDefBut(block, BUT,B_TEXTSTORE, ICON(), xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Disables storing of text in project file");
- xco+=10;
- }
- */
-
-
- if(st->font_id>1) st->font_id= 0;
- uiDefButI(block, MENU, B_TEXTFONT, "Screen 12 %x0|Screen 15%x1", xco,0,100,YIC, &st->font_id, 0, 0, 0, 0, "Displays available fonts");
- xco+=110;
-
- uiDefButI(block, NUM, B_TAB_NUMBERS, "Tab:", xco, 0, XIC+50, YIC, &st->tabnumber, 2, 8, 0, 0, "Set spacing of Tab");
- xco+= XIC+50;
-
- /* File info */
- if (text) {
- if (text->name) {
- len = strlen(text->name);
- if (len > HEADER_PATH_MAX-1)
- len = HEADER_PATH_MAX-1;
- strncpy(fname, text->name, len);
- fname[len]='\0';
- if (text->flags & TXT_ISDIRTY)
- sprintf(headtxt, "File: *%s (unsaved)", fname);
- else
- sprintf(headtxt, "File: %s", fname);
- } else {
- sprintf(headtxt, text->id.lib?"Text: External":"Text: Internal");
- }
- BIF_ThemeColor(TH_MENU_TEXT);
- glRasterPos2i(xco+=XIC, 5);
- BMF_DrawString(G.font, headtxt);
- xco += BMF_GetStringWidth(G.font, headtxt);
- }
-
- /* always as last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-}
diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c
deleted file mode 100644
index e2caf97df05..00000000000
--- a/source/blender/src/header_view3d.c
+++ /dev/null
@@ -1,5937 +0,0 @@
-/*
- * header_view3d.c oct-2003
- *
- * Functions to draw the "3D Viewport" window header
- * and handle user events sent to it.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_ID.h"
-#include "DNA_image_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_text_types.h" /* for space handlers */
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h" /* U.smooth_viewtx */
-
-#include "BKE_action.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_effect.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-#include "BKE_utildefines.h" /* for VECCOPY */
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_view.h"
-#include "BSE_drawview.h"
-
-#include "BDR_editcurve.h"
-#include "BDR_editface.h"
-#include "BDR_editmball.h"
-#include "BDR_editobject.h"
-#include "BDR_sculptmode.h"
-#include "BDR_imagepaint.h"
-#include "BDR_vpaint.h"
-
-#include "BIF_editlattice.h"
-#include "BIF_editarmature.h"
-#include "BIF_editparticle.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_editfont.h"
-#include "BIF_editgroup.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_editview.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_mainqueue.h"
-#include "BIF_meshtools.h"
-#include "BIF_poselib.h"
-#include "BIF_poseobject.h"
-#include "BIF_radialcontrol.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_transform.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "blendef.h"
-#include "multires.h"
-#include "mydevice.h"
-#include "butspace.h"
-
-#include "BIF_poseobject.h"
-
-/* View3d->modeselect
- * This is a bit of a dodgy hack to enable a 'mode' menu with icons+labels
- * rather than those buttons.
- * I know the implementation's not good - it's an experiment to see if this
- * approach would work well
- *
- * This can be cleaned when I make some new 'mode' icons.
- */
-
-#define V3D_OBJECTMODE_SEL ICON_OBJECT
-#define V3D_EDITMODE_SEL ICON_EDITMODE_HLT
-#define V3D_SCULPTMODE_SEL ICON_SCULPTMODE_HLT
-#define V3D_FACESELECT_SEL ICON_FACESEL_HLT /* this is not a mode anymore - just a switch */
-#define V3D_VERTEXPAINTMODE_SEL ICON_VPAINT_HLT
-#define V3D_TEXTUREPAINTMODE_SEL ICON_TPAINT_HLT
-#define V3D_WEIGHTPAINTMODE_SEL ICON_WPAINT_HLT
-#define V3D_POSEMODE_SEL ICON_POSE_HLT
-#define V3D_PARTICLEEDITMODE_SEL ICON_ANIM
-
-#define TEST_EDITMESH if(G.obedit==0) return; \
- if( (G.vd->lay & G.obedit->lay)==0 ) return;
-
-void do_layer_buttons(short event)
-{
- static int oldlay= 1;
-
- if(G.vd==0) return;
- if(G.vd->localview) return;
-
- if(event==-1 && (G.qual & LR_CTRLKEY)) {
- G.vd->scenelock= !G.vd->scenelock;
- do_view3d_buttons(B_SCENELOCK);
- } else if (event<0) {
- if(G.vd->lay== (1<<20)-1) {
- if(event==-2 || G.qual & LR_SHIFTKEY) G.vd->lay= oldlay;
- }
- else {
- oldlay= G.vd->lay;
- G.vd->lay= (1<<20)-1;
- }
-
- if(G.vd->scenelock) handle_view3d_lock();
- scrarea_queue_winredraw(curarea);
-
- /* new layers might need unflushed events events */
- DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */
- }
- else {
- if(G.qual & LR_ALTKEY) {
- if(event<11) event+= 10;
- }
- if(G.qual & LR_SHIFTKEY) {
- if(G.vd->lay & (1<<event)) G.vd->lay -= (1<<event);
- else G.vd->lay += (1<<event);
- }
- do_view3d_buttons(event+B_LAY);
- }
- /* redraw seems double: but the queue nicely handles that */
- scrarea_queue_headredraw(curarea);
-
- if(curarea->spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */
- if(G.vd->drawtype == OB_SHADED) reshadeall_displist();
- allqueue(REDRAWNLA, 0);
-}
-
-static void do_view3d_view_camerasmenu(void *arg, int event)
-{
- Base *base;
- int i=1;
-
- if (event == 1) {
- /* Set Active Object as Active Camera */
- /* ugly hack alert */
- G.qual |= LR_CTRLKEY;
- persptoetsen(PAD0);
- G.qual &= ~LR_CTRLKEY;
- } else {
- /* store settings of current view before allowing overwriting with camera view */
- /* this is a copy of the code in toets.c */
- if(G.vd->persp != V3D_CAMOB) {
- QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
- G.vd->lview= G.vd->view;
- G.vd->lpersp= G.vd->persp;
- }
-
- for( base = FIRSTBASE; base; base = base->next ) {
- if (base->object->type == OB_CAMERA) {
- i++;
-
- if (event==i) {
-
- if (G.vd->camera == base->object && G.vd->persp==V3D_CAMOB)
- return;
-
- if (U.smooth_viewtx) {
- /* move 3d view to camera view */
- float orig_ofs[3], orig_lens = G.vd->lens;
- VECCOPY(orig_ofs, G.vd->ofs);
-
- if (G.vd->camera && G.vd->persp==V3D_CAMOB)
- view_settings_from_ob(G.vd->camera, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens);
-
- G.vd->camera = base->object;
- handle_view3d_lock();
- G.vd->persp= V3D_CAMOB;
- G.vd->view= 0;
-
- smooth_view_to_camera(G.vd);
-
- /* restore values */
- VECCOPY(G.vd->ofs, orig_ofs);
- G.vd->lens = orig_lens;
- } else {
- G.vd->camera= base->object;
- handle_view3d_lock();
- G.vd->persp= V3D_CAMOB;
- G.vd->view= 0;
- }
- break;
- }
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_view_camerasmenu(void *arg_unused)
-{
- Base *base;
- uiBlock *block;
- short yco= 0, menuwidth=120;
- int i=1;
- char camname[48];
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_view_camerasmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- for( base = FIRSTBASE; base; base = base->next ) {
- if (base->object->type == OB_CAMERA) {
- i++;
-
- strcpy(camname, base->object->id.name+2);
- if (base->object == G.scene->camera) strcat(camname, " (Active)");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, "");
- }
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_view_cameracontrolsmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* Orbit Left */
- persptoetsen(PAD4);
- break;
- case 1: /* Orbit Right */
- persptoetsen(PAD6);
- break;
- case 2: /* Orbit Up */
- persptoetsen(PAD8);
- break;
- case 3: /* Orbit Down */
- persptoetsen(PAD2);
- break;
- case 4: /* Pan left */
- /* ugly hack alert */
- G.qual |= LR_CTRLKEY;
- persptoetsen(PAD4);
- G.qual &= ~LR_CTRLKEY;
- break;
- case 5: /* Pan right */
- /* ugly hack alert */
- G.qual |= LR_CTRLKEY;
- persptoetsen(PAD6);
- G.qual &= ~LR_CTRLKEY;
- break;
- case 6: /* Pan up */
- /* ugly hack alert */
- G.qual |= LR_CTRLKEY;
- persptoetsen(PAD8);
- G.qual &= ~LR_CTRLKEY;
- break;
- case 7: /* Pan down */
- /* ugly hack alert */
- G.qual |= LR_CTRLKEY;
- persptoetsen(PAD2);
- G.qual &= ~LR_CTRLKEY;
- break;
- case 8: /* Zoom In */
- persptoetsen(PADPLUSKEY);
- break;
- case 9: /* Zoom Out */
- persptoetsen(PADMINUS);
- break;
- case 10: /* Reset Zoom */
- persptoetsen(PADENTER);
- break;
- case 11: /* Camera Fly mode */
- fly();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_view_cameracontrolsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_view_alignviewmenu(void *arg, int event)
-{
- View3D *v3d= curarea->spacedata.first;
- float *curs;
-
- switch(event) {
-
- case 0: /* Align View to Selected (edit/faceselect mode) */
- case 1:
- case 2:
- if ((G.obedit) && (G.obedit->type == OB_MESH)) {
- editmesh_align_view_to_selected(v3d, event + 1);
- } else if (FACESEL_PAINT_TEST) {
- Object *obact= OBACT;
- if (obact && obact->type==OB_MESH) {
- Mesh *me= obact->data;
-
- if (me->mtface) {
- faceselect_align_view_to_selected(v3d, me, event + 1);
- addqueue(v3d->area->win, REDRAW, 1);
- }
- }
- }
- break;
- case 3: /* Center View to Cursor */
- curs= give_cursor();
- G.vd->ofs[0]= -curs[0];
- G.vd->ofs[1]= -curs[1];
- G.vd->ofs[2]= -curs[2];
- scrarea_queue_winredraw(curarea);
- break;
- case 4: /* Align Active Camera to View */
- /* This ugly hack is a symptom of the nasty persptoetsen function,
- * but at least it works for now.
- */
- G.qual |= LR_CTRLKEY|LR_ALTKEY;
- persptoetsen(PAD0);
- G.qual &= ~(LR_CTRLKEY|LR_ALTKEY);
- break;
- case 5: /* Align View to Selected (object mode) */
- mainqenter(PADASTERKEY, 1);
- break;
- case 6: /* Center View and Cursor to Origin */
- view3d_home(1);
- curs= give_cursor();
- curs[0]=curs[1]=curs[2]= 0.0;
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_view_alignviewmenu(void *arg_unused)
-{
-/* static short tog=0; */
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_view_alignviewmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- if (((G.obedit) && (G.obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-#ifndef DISABLE_PYTHON
-static void do_view3d_view_spacehandlers(void *arg, int event)
-{
- Text *text = G.main->text.first;
- unsigned short menu_evt_num = 0;
-
- if (event > 0) {
- while (text) {
- if (++menu_evt_num == event) {
-
- if (BPY_has_spacehandler(text, curarea))
- BPY_del_spacehandler(text, curarea);
- else
- BPY_add_spacehandler(text, curarea, SPACE_VIEW3D);
-
- break;
- }
- text = text->id.next;
- }
- }
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-static uiBlock *view3d_view_spacehandlers(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
- Text *text = G.main->text.first;
- ScrArea *sa = curarea;
- unsigned short handlertype;
- int icontype, slinks_num = 0;
- unsigned short menu_evt_num = 0;
- char menustr[64];
- static char msg_tog_on[] = "Click to enable";
- static char msg_tog_off[]= "Click to disable";
- char *tip = NULL;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_view_spacehandlers", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_view_spacehandlers, NULL);
-
- while (text) {
- menu_evt_num++;
- handlertype = BPY_is_spacehandler(text, SPACE_VIEW3D);
-
- if (handlertype) {
- slinks_num++;
-
- /* mark text as script, so we can remove its link if its header
- * becomes corrupt and it's not recognized anymore */
- if (!(text->flags & TXT_ISSCRIPT)) text->flags |= TXT_ISSCRIPT;
-
- if (handlertype == SPACEHANDLER_VIEW3D_EVENT)
- BLI_strncpy(menustr, "Event: ", 8);
- else
- BLI_strncpy(menustr, "Draw: ", 8);
- BLI_strncpy(menustr+7, text->id.name+2, 22);
-
- if (BPY_has_spacehandler(text, sa)) {
- icontype = ICON_CHECKBOX_HLT;
- tip = msg_tog_off;
- }
- else {
- icontype = ICON_CHECKBOX_DEHLT;
- tip = msg_tog_on;
- }
-
- uiDefIconTextBut(block, BUTM, 1, icontype, menustr, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, menu_evt_num, tip);
- }
- else if (text->flags & TXT_ISSCRIPT) {
- /* if bit set, text was a space handler, but its header got corrupted,
- * so we need to remove the link here */
- BPY_del_spacehandler(text, sa);
- text->flags &=~TXT_ISSCRIPT;
- }
-
- text = text->id.next;
- }
-
- if (slinks_num == 0) {
- uiDefIconTextBut(block, BUTM, 1, ICON_SCRIPT, "None Available", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, -1, "None of the texts in the Text Editor is a 3D View space handler");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-static void do_view3d_viewmenu(void *arg, int event)
-{
- View3D *v3d= curarea->spacedata.first;
-
- switch(event) {
- case 0: /* User */
- G.vd->viewbut = 0;
- G.vd->persp = V3D_PERSP;
- break;
- case 1: /* Camera */
- persptoetsen(PAD0);
- break;
- case 2: /* Top */
- persptoetsen(PAD7);
- break;
- case 3: /* Front */
- persptoetsen(PAD1);
- break;
- case 4: /* Side */
- persptoetsen(PAD3);
- break;
- case 5: /* Perspective */
- G.vd->persp=V3D_PERSP;
- break;
- case 6: /* Orthographic */
- G.vd->persp=V3D_ORTHO;
- break;
- case 7: /* Local View */
- G.vd->localview= 1;
- initlocalview();
- break;
- case 8: /* Global View */
- G.vd->localview= 0;
- endlocalview(curarea);
- break;
- case 9: /* View All (Home) */
- view3d_home(0);
- break;
- case 11: /* View Selected */
- centerview();
- break;
- case 13: /* Play Back Animation */
- play_anim(0);
- break;
- case 15: /* Background Image... */
- add_blockhandler(curarea, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW);
- break;
- case 16: /* View Panel */
- add_blockhandler(curarea, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
- break;
- case 17: /* Set Clipping Border */
- view3d_edit_clipping(v3d);
- break;
- case 18: /* render preview */
- toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
- break;
- case 19: /* zoom within border */
- view3d_border_zoom();
- break;
- case 20: /* Transform Space Panel */
- add_blockhandler(curarea, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW);
- break;
- case 21: /* Grease Pencil */
- add_blockhandler(curarea, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
- break;
- case 22: /* View all layers */
- do_layer_buttons(-2);
- break;
- }
- allqueue(REDRAWVIEW3D, 1);
-}
-
-static uiBlock *view3d_viewmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
- View3D *v3d= curarea->spacedata.first;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Orientations...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if ((G.vd->viewbut == 0) && !(G.vd->persp == V3D_CAMOB)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- if (G.vd->persp == V3D_CAMOB) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- if (G.vd->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
- if (G.vd->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
- if (G.vd->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-
- uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.vd->persp==V3D_PERSP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
- if(G.vd->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.vd->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(v3d->flag & V3D_CLIPPING)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
- else
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
- if (v3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
- if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
- else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-void do_view3d_select_object_typemenu(void *arg, int event)
-{
-
- extern void selectall_type(short obtype);
-
- switch(event) {
- case 1: /* Mesh */
- selectall_type(OB_MESH);
- break;
- case 2: /* Curve */
- selectall_type(OB_CURVE);
- break;
- case 3: /* Surface */
- selectall_type(OB_SURF);
- break;
- case 4: /* Meta */
- selectall_type(OB_MBALL);
- break;
- case 5: /* Armature */
- selectall_type(OB_ARMATURE);
- break;
- case 6: /* Lattice */
- selectall_type(OB_LATTICE);
- break;
- case 7: /* Text */
- selectall_type(OB_FONT);
- break;
- case 8: /* Empty */
- selectall_type(OB_EMPTY);
- break;
- case 9: /* Camera */
- selectall_type(OB_CAMERA);
- break;
- case 10: /* Lamp */
- selectall_type(OB_LAMP);
- break;
- case 20:
- do_layer_buttons(-2);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_object_typemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_select_object_typemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_select_object_layermenu(void *arg, int event)
-{
- extern void selectall_layer(unsigned int layernum);
-
- switch(event) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- selectall_layer(event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_object_layermenu(void *arg_unused)
-{
- uiBlock *block;
- short xco= 0, yco = 20, menuwidth = 22;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_layermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_select_object_layermenu, NULL);
-
- uiDefBut(block, BUTM, 1, "1", xco, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, BUTM, 1, "2", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefBut(block, BUTM, 1, "3", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefBut(block, BUTM, 1, "4", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefBut(block, BUTM, 1, "5", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- xco += 6;
- uiDefBut(block, BUTM, 1, "6", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefBut(block, BUTM, 1, "7", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefBut(block, BUTM, 1, "8", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefBut(block, BUTM, 1, "9", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefBut(block, BUTM, 1, "10", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- xco = 0;
- uiDefBut(block, BUTM, 1, "11", xco, yco-=24, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefBut(block, BUTM, 1, "12", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefBut(block, BUTM, 1, "13", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefBut(block, BUTM, 1, "14", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiDefBut(block, BUTM, 1, "15", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- xco += 6;
- uiDefBut(block, BUTM, 1, "16", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefBut(block, BUTM, 1, "17", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefBut(block, BUTM, 1, "18", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefBut(block, BUTM, 1, "19", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefBut(block, BUTM, 1, "20", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- /*uiTextBoundsBlock(block, 100);*/
- return block;
-}
-
-void do_view3d_select_object_linkedmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* Object Ipo */
- case 2: /* ObData */
- case 3: /* Current Material */
- case 4: /* Current Texture */
- selectlinks(event);
- break;
- }
- countall();
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_object_linkedmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_linkedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_select_object_linkedmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Shift L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData|Shift L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Material|Shift L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture|Shift L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_select_object_groupedmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* Children */
- case 2: /* Immediate Children */
- case 3: /* Parent */
- case 4: /* Siblings */
- case 5: /* Type */
- case 6: /* Objects on Shared Layers */
- case 7: /* Objects in Same Group */
- case 8: /* Object Hooks*/
- case 9: /* Object PassIndex*/
- case 10: /* Object Color*/
- case 11: /* Game Properties*/
- select_object_grouped((short)event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_object_groupedmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_groupedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_select_object_groupedmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Children|Shift G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Immediate Children|Shift G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Parent|Shift G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Siblings (Shared Parent)|Shift G, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects of Same Type|Shift G, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift G, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects in Same Group|Shift G, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Hooks|Shift G, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object PassIndex|Shift G, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Color|Shift G, 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Game Properties|Shift G, Alt+1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_select_objectmenu(void *arg, int event)
-{
- switch(event) {
-
- case 0: /* border select */
- borderselect();
- break;
- case 1: /* Select/Deselect All */
- deselectall();
- break;
- case 2: /* inverse */
- selectswap();
- break;
- case 3: /* random */
- selectrandom();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_objectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_select_object_typemenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Type", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_select_meshmenu(void *arg, int event)
-{
-/* extern void borderselect(void);*/
-
- switch(event) {
-
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_mesh();
- break;
- case 3: /* Inverse */
- selectswap_mesh();
- break;
- case 4: /* select linked vertices */
- selectconnected_mesh_all();
- break;
- case 5: /* select random */
- selectrandom_mesh();
- break;
- case 7: /* select more */
- select_more();
- break;
- case 8: /* select less */
- select_less();
- break;
- case 9: /* select non-manifold */
- select_non_manifold();
- break;
- case 11: /* select triangles */
- select_faces_by_numverts(3);
- break;
- case 12: /* select quads */
- select_faces_by_numverts(4);
- break;
- case 13: /* select non-triangles/quads */
- select_faces_by_numverts(5);
- break;
- case 14: /* select sharp edges */
- select_sharp_edges();
- break;
- case 15: /* select linked flat faces */
- select_linked_flat_faces();
- break;
-
- case 16: /* path select */
- pathselect();
- BIF_undo_push("Path Select");
- break;
- case 17: /* edge loop select */
- loop_multiselect(0);
- break;
- case 18: /* edge ring select */
- loop_multiselect(1);
- break;
- case 19: /* loop to region */
- loop_to_region();
- break;
- case 20: /* region to loop */
- region_to_loop();
- break;
- case 21: /* Select grouped */
- select_mesh_group_menu();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static uiBlock *view3d_select_meshmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_meshmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Non-Manifold|Ctrl Alt Shift M",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Sharp Edges|Ctrl Alt Shift S",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Linked Flat Faces|Ctrl Alt Shift F",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Triangles|Ctrl Alt Shift 3",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Quads|Ctrl Alt Shift 4",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Non-Triangles/Quads|Ctrl Alt Shift 5",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Similar to Selection...|Shift G",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Vertices|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vertex Path|W Alt 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Loop|Ctrl E 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Ring|Ctrl E 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6,
- menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop to Region|Ctrl E 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Region to Loop|Ctrl E 9", 0, yco-=20, menuwidth, 20, NULL, 0.0, 0.0, 1, 20, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_select_curvemenu(void *arg, int event)
-{
-/* extern void borderselect(void);*/
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_nurb();
- break;
- case 3: /* Inverse */
- selectswapNurb();
- break;
- /* select connected control points */
- /*case 4:
- G.qual |= LR_CTRLKEY;
- select_connected_nurb();
- G.qual &= ~LR_CTRLKEY;
- break;*/
- case 5: /* select row (nurb) */
- selectrow_nurb();
- break;
- case 7: /* select/deselect first */
- selectend_nurb(FIRST, 1, DESELECT);
- break;
- case 8: /* select/deselect last */
- selectend_nurb(LAST, 1, DESELECT);
- break;
- case 9: /* select more */
- select_more_nurb();
- break;
- case 10: /* select less */
- select_less_nurb();
- break;
- case 11: /* select next */
- select_next_nurb();
- break;
- case 12: /* select previous */
- select_prev_nurb();
- break;
- case 13: /* select random */
- select_random_nurb();
- break;
- case 14: /* select every nth */
- select_every_nth_nurb();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static uiBlock *view3d_select_curvemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_curvemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Every Nth", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-
- if (OBACT->type == OB_SURF) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Control Point Row|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- }
- else {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect First", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Next", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Previous", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */
- /*uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Control Points|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");*/
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_select_metaballmenu(void *arg, int event)
-{
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_mball();
- break;
- case 3: /* Inverse */
- selectinverse_mball();
- break;
- case 4: /* Select Random */
- selectrandom_mball();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static uiBlock *view3d_select_metaballmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_metaballmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_select_latticemenu(void *arg, int event)
-{
-/* extern void borderselect(void);*/
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_Latt();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_latticemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_latticemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_select_armaturemenu(void *arg, int event)
-{
-/* extern void borderselect(void);*/
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_armature(1, 1);
- break;
- case 3: /* Swap Select All */
- deselectall_armature(3, 1);
- break;
- case 4: /* Select parent */
- armature_select_hierarchy(BONE_SELECT_PARENT, 0);
- break;
- case 5: /* Select child */
- armature_select_hierarchy(BONE_SELECT_CHILD, 0);
- break;
- case 6: /* Extend Select parent */
- armature_select_hierarchy(BONE_SELECT_PARENT, 1);
- break;
- case 7: /* Extend Select child */
- armature_select_hierarchy(BONE_SELECT_CHILD, 1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_armaturemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_armaturemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_select_pose_armaturemenu(void *arg, int event)
-{
-/* extern void borderselect(void);*/
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_posearmature(OBACT, 1, 1);
- break;
- case 3: /* Select Target(s) of Constraint(s) */
- pose_select_constraint_target();
- break;
- case 5: /* Swap Select All */
- deselectall_posearmature(OBACT, 3, 1);
- break;
- case 6: /* Select parent */
- pose_select_hierarchy(BONE_SELECT_PARENT, 0);
- break;
- case 7: /* Select child */
- pose_select_hierarchy(BONE_SELECT_CHILD, 0);
- break;
- case 8: /* Extend Select parent */
- pose_select_hierarchy(BONE_SELECT_PARENT, 1);
- break;
- case 9: /* Extend Select child */
- pose_select_hierarchy(BONE_SELECT_CHILD, 1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_pose_armaturemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_select_faceselmenu(void *arg, int event)
-{
- /* events >= 6 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6);
-#endif
-
- switch(event) {
- case 0: /* border select */
- borderselect();
- break;
- case 2: /* Select/Deselect all */
- deselectall_tface();
- break;
- case 3: /* Select Inverse */
- selectswap_tface();
- break;
- case 4: /* Select Linked */
- select_linked_tfaces(2);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_faceselmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_faceselmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Faces|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- /* note that we account for the 6 previous entries with i+6: */
- for (pym = BPyMenuTable[PYMENU_FACESELECT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, i+6,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_edit_snapmenu(void *arg, int event)
-{
- switch (event) {
- case 1: /*Selection to grid*/
- snap_sel_to_grid();
- BIF_undo_push("Snap selection to grid");
- break;
- case 2: /*Selection to cursor*/
- snap_sel_to_curs();
- BIF_undo_push("Snap selection to cursor");
- break;
- case 3: /*Selection to center of selection*/
- snap_to_center();
- BIF_undo_push("Snap selection to center");
- break;
- case 4: /*Cursor to selection*/
- snap_curs_to_sel();
- break;
- case 5: /*Cursor to grid*/
- snap_curs_to_grid();
- break;
- case 6: /*Cursor to Active*/
- snap_curs_to_active();
- BIF_undo_push("Snap selection to center");
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_snapmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_snapmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Grid|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Cursor|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Selection|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Active|Shift S, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_transform_moveaxismenu(void *arg, int event)
-{
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event)
- {
- case 0: /* X Global */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[0], " X");
- Transform();
- break;
- case 1: /* Y Global */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[1], " Y");
- Transform();
- break;
- case 2: /* Z Global */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[2], " Z");
- Transform();
- break;
- case 3: /* X Local */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setLocalAxisConstraint('X', " X");
- Transform();
- break;
- case 4: /* Y Local */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setLocalAxisConstraint('Y', " Y");
- Transform();
- break;
- case 5: /* Z Local */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- BIF_setLocalAxisConstraint('Z', " Z");
- Transform();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_transform_moveaxismenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_transform_moveaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_transform_moveaxismenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|G, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|G, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|G, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|G, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|G, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|G, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_transform_rotateaxismenu(void *arg, int event)
-{
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event)
- {
- case 0: /* X Global */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[0], " X");
- Transform();
- break;
- case 1: /* Y Global */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[1], " Y");
- Transform();
- break;
- case 2: /* Z Global */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[2], " Z");
- Transform();
- break;
- case 3: /* X Local */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setLocalAxisConstraint('X', " X");
- Transform();
- break;
- case 4: /* Y Local */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setLocalAxisConstraint('Y', " Y");
- Transform();
- break;
- case 5: /* Z Local */
- initTransform(TFM_ROTATION, CTX_NONE);
- BIF_setLocalAxisConstraint('Z', " Z");
- Transform();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_transform_rotateaxismenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_transform_rotateaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_transform_rotateaxismenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|R, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|R, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|R, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|R, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|R, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|R, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_transform_scaleaxismenu(void *arg, int event)
-{
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event)
- {
- case 0: /* X Global */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[0], " X");
- Transform();
- break;
- case 1: /* Y Global */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[1], " Y");
- Transform();
- break;
- case 2: /* Z Global */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setSingleAxisConstraint(mat[2], " Z");
- Transform();
- break;
- case 3: /* X Local */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setLocalAxisConstraint('X', " X");
- Transform();
- break;
- case 4: /* Y Local */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setLocalAxisConstraint('X', " X");
- Transform();
- break;
- case 5: /* Z Local */
- initTransform(TFM_RESIZE, CTX_NONE);
- BIF_setLocalAxisConstraint('X', " X");
- Transform();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_transform_scaleaxismenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_transform_scaleaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_transform_scaleaxismenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|S, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|S, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|S, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|S, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|S, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|S, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_transformmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- break;
- case 2:
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- break;
- case 3:
- initTransform(TFM_RESIZE, CTX_NONE);
- Transform();
- break;
- case 4:
- image_aspect();
- break;
- case 5:
- initTransform(TFM_TOSPHERE, CTX_NONE);
- Transform();
- break;
- case 6:
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 7:
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 8:
- initTransform(TFM_PUSHPULL, CTX_NONE);
- Transform();
- break;
- case 9:
- if (G.obedit) {
- if (G.obedit->type == OB_MESH)
- initTransform(TFM_SHRINKFATTEN, CTX_NONE);
- Transform();
- } else error("Only meshes can be shrinked/fattened");
- break;
- case 10:
- docenter(0);
- break;
- case 11:
- docenter_new();
- break;
- case 12:
- docenter_cursor();
- break;
- case 13:
- initTransform(TFM_TILT, CTX_NONE);
- Transform();
- break;
- case 14:
- initTransform(TFM_CURVE_SHRINKFATTEN, CTX_NONE);
- Transform();
- break;
- case 15:
- G.scene->snap_flag &= ~SCE_SNAP;
- break;
- case 16:
- G.scene->snap_flag |= SCE_SNAP;
- break;
- case 17:
- G.scene->snap_target = SCE_SNAP_TARGET_CLOSEST;
- break;
- case 18:
- G.scene->snap_target = SCE_SNAP_TARGET_CENTER;
- break;
- case 19:
- G.scene->snap_target = SCE_SNAP_TARGET_MEDIAN;
- break;
- case 20:
- G.scene->snap_target = SCE_SNAP_TARGET_ACTIVE;
- break;
- case 21:
- alignmenu();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBlockBut(block, view3d_transform_moveaxismenu, NULL, ICON_RIGHTARROW_THIN, "Grab/Move on Axis", 0, yco-=20, 120, 19, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBlockBut(block, view3d_transform_rotateaxismenu, NULL, ICON_RIGHTARROW_THIN, "Rotate on Axis", 0, yco-=20, 120, 19, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBlockBut(block, view3d_transform_scaleaxismenu, NULL, ICON_RIGHTARROW_THIN, "Scale on Axis", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.obedit) {
- if (G.obedit->type == OB_MESH)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- else if (G.obedit->type == OB_CURVE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Radius|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- }
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Sphere|Ctrl Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- if (G.obedit) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl Shift Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Push/Pull|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- if (!G.obedit) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale to Image Aspect Ratio|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData to Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- if (!G.obedit) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center New", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align to Transform Orientation|Ctrl Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
- }
-
- if (BIF_snappingSupported())
- {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (G.scene->snap_flag & SCE_SNAP)
- {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- }
- else
- {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- }
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- switch(G.scene->snap_target)
- {
- case SCE_SNAP_TARGET_CLOSEST:
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
- break;
- case SCE_SNAP_TARGET_CENTER:
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
- break;
- case SCE_SNAP_TARGET_MEDIAN:
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
- break;
- case SCE_SNAP_TARGET_ACTIVE:
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
- break;
- }
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_object_mirrormenu(void *arg, int event)
-{
- switch(event) {
- case 0:
- initTransform(TFM_MIRROR, CTX_NO_PET);
- Transform();
- break;
- case 1:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('X', " on X axis");
- Transform();
- break;
- case 2:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Y', " on Y axis");
- Transform();
- break;
- case 3:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Z', " on Z axis");
- Transform();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_object_mirrormenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_object_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_object_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_transformmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* clear origin */
- clear_object('o');
- break;
- case 1: /* clear scale */
- clear_object('s');
- break;
- case 2: /* clear rotation */
- clear_object('r');
- break;
- case 3: /* clear location */
- clear_object('g');
- break;
- case 4:
- if(OBACT) object_apply_deform(OBACT);
- break;
- case 5: /* make duplis real */
- make_duplilist_real();
- break;
- case 6: /* apply scale/rotation or deformation */
- apply_objects_locrot();
- break;
- case 7: /* apply visual matrix to objects loc/size/rot */
- apply_objects_visual_tx();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Duplicates Real|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_makelocalmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- case 2:
- case 3:
- make_local(event);
- break;
- }
-}
-
-static uiBlock *view3d_edit_object_makelocalmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_makelocalmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_makelocalmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects|L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects and Data|L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All|L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_makelinksmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- case 2:
- case 3:
- case 4:
- make_links((short)event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
-{
- Object *ob=NULL;
-
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_makelinksmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_makelinksmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Scene...|Ctrl L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Ctrl L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- if ((ob=OBACT)) {
-
- if(ob->type==OB_MESH) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- } else if(ob->type==OB_CURVE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- } else if(ob->type==OB_FONT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- } else if(ob->type==OB_SURF) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- } else if(ob->type==OB_MBALL) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- } else if(ob->type==OB_CAMERA) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- } else if(ob->type==OB_LAMP) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- } else if(ob->type==OB_LATTICE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- } else if(ob->type==OB_ARMATURE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- }
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_singleusermenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* Object */
- single_object_users(1);
- break;
- case 2: /* Object & ObData */
- single_object_users(1);
- single_obdata_users(1);
- break;
- case 3: /* Object & ObData & Materials+Tex */
- single_object_users(1);
- single_obdata_users(1);
- single_mat_users(1); /* also tex */
- break;
- case 4: /* Materials+Tex */
- single_mat_users(1);
- break;
- case 5: /* Ipo */
- single_ipo_users(1);
- break;
- }
-
- clear_id_newpoins();
- countall();
-
- allqueue(REDRAWALL, 0);
-}
-
-static uiBlock *view3d_edit_object_singleusermenu(void *arg_unused)
-{
-
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_singleusermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_singleusermenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object|U, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData|U, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData & Materials+Tex|U, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ipos|U, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_copyattrmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 29:
- case 30:
- copy_attr((short)event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
-{
- Object *ob=NULL;
-
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_copyattrmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_copyattrmenu, NULL);
-
- ob= OBACT;
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Location|Ctrl C, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotation|Ctrl C, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Size|Ctrl C, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Drawtype|Ctrl C, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Time Offset|Ctrl C, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dupli|Ctrl C, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Physical Attributes|Ctrl C, 11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Protected Transform |Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 29, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Constraints|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NLA Strips|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 26, "");
-
- if (ob) {
-
- if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
- (ob->type == OB_FONT) || (ob->type == OB_MBALL)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Space|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- }
-
- if(ob->type == OB_FONT) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Font Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
- }
- if(ob->type == OB_CURVE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
- }
-
- if(ob->type==OB_MESH) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subsurf Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Modifiers ...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Pass Index|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 30, "");
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-
-static void do_view3d_edit_object_parentmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* clear parent */
- clear_parent();
- break;
- case 1: /* make parent */
- make_parent();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_parentmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_groupmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- case 2:
- case 3:
- group_operation(event);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_groupmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_groupmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to Existing Group|Ctrl G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to New Group|Ctrl G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_trackmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* clear track */
- clear_track();
- break;
- case 1: /* make track */
- make_track();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_trackmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_trackmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_constraintsmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* add constraint */
- add_constraint(0);
- break;
- case 2: /* clear constraint */
- ob_clear_constraints();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_constraintsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_constraintsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_constraintsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_object_showhidemenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 0: /* show objects */
- show_objects();
- break;
- case 1: /* hide selected objects */
- hide_objects(1);
- break;
- case 2: /* hide deselected objects */
- hide_objects(0);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-#ifndef DISABLE_PYTHON
-static void do_view3d_edit_object_scriptsmenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_OBJECT, event);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_object_scriptsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
- BPyMenu *pym;
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "v3d_eobject_pymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_object_scriptsmenu, NULL);
-
- for (pym = BPyMenuTable[PYMENU_OBJECT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-#ifdef WITH_VERSE
-extern ListBase session_list;
-#endif
-
-static void do_view3d_edit_objectmenu(void *arg, int event)
-{
-#ifdef WITH_VERSE
- struct VerseSession *session=NULL;
-
- /* needed to check for valid selected objects */
- Base *base=NULL;
- Object *ob=NULL;
-
- base= BASACT;
- if (base) ob= base->object;
-#endif
-
-
- switch(event) {
-
- case 0: /* transform properties*/
- mainqenter(NKEY, 1);
- break;
- case 1: /* delete */
- delete_context_selected();
- break;
- case 2: /* duplicate */
- duplicate_context_selected();
- break;
- case 3: /* duplicate linked */
- adduplicate(0, 0);
- break;
- case 5: /* make single user */
- single_user();
- break;
- case 7: /* boolean operation */
- special_editmenu();
- break;
- case 8: /* join objects */
- join_menu();
- break;
- case 9: /* convert object type */
- convertmenu();
- break;
- case 10: /* move to layer */
- movetolayer();
- break;
- case 11: /* insert keyframe */
- common_insertkey();
- break;
- case 15: /* Object Panel */
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- break;
- case 16: /* make proxy object*/
- make_proxy();
- break;
-#ifdef WITH_VERSE
- case 17: /* Share Object at Verse server */
- if(session_list.first != session_list.last) session = session_menu();
- else session = session_list.first;
- if(session) b_verse_push_object(session, ob);
- break;
-#endif
- case 18: /* delete keyframe */
- common_deletekey();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_objectmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL);
-
-#ifdef WITH_VERSE
- if(session_list.first != NULL) {
- Base *base = BASACT;
- Object *ob = NULL;
- if (base) ob= base->object;
-
- if(ob && (ob->type == OB_MESH) && (!ob->vnode)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
- }
-#endif
-
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear/Apply", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Proxy|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (OBACT && OBACT->type == OB_MESH) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Objects", 0, yco-=20, 120, 19, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-
-static void do_view3d_edit_propfalloffmenu(void *arg, int event)
-{
-
- G.scene->prop_mode= event;
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-static uiBlock *view3d_edit_propfalloffmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL);
-
- if (G.scene->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, "");
- if (G.scene->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, "");
- if (G.scene->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, "");
- if (G.scene->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, "");
- if (G.scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, "");
- if (G.scene->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, "");
- if (G.scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
- else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-
-void do_view3d_edit_mesh_verticesmenu(void *arg, int event)
-{
-
- switch(event) {
- int count;
-
- case 0: /* make vertex parent */
- make_parent();
- break;
- case 1: /* remove doubles */
- count= removedoublesflag(1, 0, G.scene->toolsettings->doublimit);
- notice("Removed: %d", count);
- if (count) { /* only undo and redraw if an action is taken */
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Rem Doubles");
- }
- break;
- case 2: /* smooth */
- vertexsmooth();
- break;
- case 3: /* separate */
- separate_mesh();
- break;
- case 4: /*split */
- split_mesh();
- break;
- case 5: /*merge */
- mergemenu();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 6: /* add hook */
- add_hook_menu();
- break;
- case 7: /* rip */
- mesh_rip();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_verticesmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_verticesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_verticesmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rip|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Split|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth|W, Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles|W, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-extern void editmesh_mark_sharp(int set); /* declared in editmesh_mods.c */
-
-void do_view3d_edit_mesh_edgesmenu(void *arg, int event)
-{
- float fac;
- short randfac;
-
- switch(event) {
-
- case 0: /* subdivide smooth */
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag | B_SMOOTH,1,0);
- BIF_undo_push("Subdivide Smooth");
- break;
- case 1: /*subdivide fractal */
- randfac= 10;
- if(button(&randfac, 1, 100, "Rand fac:")==0) return;
- fac= -( (float)randfac )/100;
- esubdivideflag(1, fac, G.scene->toolsettings->editbutflag,1,0);
- BIF_undo_push("Subdivide Fractal");
- break;
- case 2: /* subdivide */
- esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag,1,0);
- BIF_undo_push("Subdivide");
- break;
- case 3: /* knife subdivide */
- KnifeSubdivide(KNIFE_PROMPT);
- break;
- case 4: /* Loop subdivide */
- CutEdgeloop(1);
- break;
- case 5: /* Make Edge/Face */
- addedgeface_mesh();
- break;
- case 6:
- bevel_menu();
- break;
- case 7: /* Mark Seam */
- editmesh_mark_seam(0);
- break;
- case 8: /* Clear Seam */
- editmesh_mark_seam(1);
- break;
- case 9: /* Crease SubSurf */
- if(!multires_level1_test()) {
- initTransform(TFM_CREASE, CTX_EDGE);
- Transform();
- }
- break;
- case 10: /* Rotate Edge */
- edge_rotate_selected(2);
- break;
- case 11: /* Rotate Edge */
- edge_rotate_selected(1);
- break;
- case 12: /* Edgeslide */
- EdgeSlide(0,0.0);
- break;
- case 13: /* Edge Loop Delete */
- if(EdgeLoopDelete()) {
- countall();
- BIF_undo_push("Erase Edge Loop");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- break;
- case 14: /*Collapse Edges*/
- collapseEdges();
- BIF_undo_push("Collapse");
- break;
- case 15:
- editmesh_mark_sharp(1);
- BIF_undo_push("Mark Sharp");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 16:
- editmesh_mark_sharp(0);
- BIF_undo_push("Clear Sharp");
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 17: /* Adjust Bevel Weight */
- if(!multires_level1_test()) {
- initTransform(TFM_BWEIGHT, CTX_EDGE);
- Transform();
- }
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_edgesmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_edgesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel|W, Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop Subdivide...|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide...|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Fractal|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Smooth|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CCW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_mesh_facesmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* Fill Faces */
- fill_mesh();
- break;
- case 1: /* Beauty Fill Faces */
- beauty_fill();
- break;
- case 2: /* Quads to Tris */
- convert_to_triface(0);
- allqueue(REDRAWVIEW3D, 0);
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 3: /* Tris to Quads */
- join_triangles();
- break;
- case 4: /* Flip triangle edges */
- edge_flip();
- break;
- case 5: /* Make Edge/Face */
- addedgeface_mesh();
- break;
- case 6: /* Set Smooth */
- mesh_set_smooth_faces(1);
- break;
- case 7: /* Set Solid */
- mesh_set_smooth_faces(0);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_facesmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_facesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_facesmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Beautify Fill|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Quads to Triangles|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Triangles to Quads|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Smooth|W, Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Solid|W, Alt 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_mesh_normalsmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* flip */
- flip_editnormals();
- break;
- case 1: /* recalculate inside */
- righthandfaces(2);
- break;
- case 2: /* recalculate outside */
- righthandfaces(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_normalsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_normalsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_normalsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Outside|Ctrl N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Inside|Ctrl Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip|W, 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_mirrormenu(void *arg, int event)
-{
- float mat[3][3];
-
- Mat3One(mat);
-
- switch(event) {
- case 0:
- initTransform(TFM_MIRROR, CTX_NO_PET);
- Transform();
- break;
- case 1:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[0], " on global X axis");
- Transform();
- break;
- case 2:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[1], " on global Y axis");
- Transform();
- break;
- case 3:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setSingleAxisConstraint(mat[2], "on global Z axis");
- Transform();
- break;
- case 4:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('X', " on local X axis");
- Transform();
- break;
- case 5:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Y', " on local Y axis");
- Transform();
- break;
- case 6:
- initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
- BIF_setLocalAxisConstraint('Z', " on local Z axis");
- Transform();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mirrormenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_mesh_showhidemenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 0: /* show hidden vertices */
- reveal_mesh();
- break;
- case 1: /* hide selected vertices */
- hide_mesh(0);
- break;
- case 2: /* hide deselected vertices */
- hide_mesh(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-#ifndef DISABLE_PYTHON
-static void do_view3d_edit_mesh_scriptsmenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_MESH, event);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mesh_scriptsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
- BPyMenu *pym;
- int i = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "v3d_emesh_pymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL);
-
- for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-static void do_view3d_edit_meshmenu(void *arg, int event)
-{
-#ifdef WITH_VERSE
- struct VerseSession *session;
-#endif
-
- switch(event) {
-
- case 0: /* Undo Editing */
- BIF_undo();
- break;
- case 1: /* Redo Editing */
- BIF_redo();
- break;
- case 2: /* transform properties */
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, 0);
- break;
- case 4: /* insert keyframe */
- common_insertkey();
- break;
- case 5: /* Extrude */
- extrude_mesh();
- break;
- case 6: /* duplicate */
- duplicate_context_selected();
- break;
- case 7: /* make edge face */
- addedgeface_mesh();
- break;
- case 8: /* delete */
- delete_context_selected();
- break;
- case 9: /* Shrink/Fatten Along Normals */
- initTransform(TFM_SHRINKFATTEN, CTX_NONE);
- Transform();
- break;
- case 10: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 11: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 12: /* proportional edit (toggle) */
- if(G.scene->proportional) G.scene->proportional= 0;
- else G.scene->proportional= 1;
- break;
- case 13: /* automerge edit (toggle) */
- if(G.scene->automerge) G.scene->automerge= 0;
- else G.scene->automerge= 1;
- break;
-#ifdef WITH_VERSE
- case 14:
- if(session_list.first != session_list.last) session = session_menu();
- else session = session_list.first;
- if(session) b_verse_push_object(session, G.obedit);
- break;
-#endif
- case 15:
- uv_autocalc_tface();
- break;
- case 16: /* delete keyframe */
- common_deletekey();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_meshmenu(void *arg_unused)
-{
-
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_meshmenu, NULL);
-
-#ifdef WITH_VERSE
- if((session_list.first != NULL) && (!G.obedit->vnode)) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
-#endif
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo Editing|Ctrl Shift Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_mesh_verticesmenu, NULL, ICON_RIGHTARROW_THIN, "Vertices", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mesh_edgesmenu, NULL, ICON_RIGHTARROW_THIN, "Edges", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Faces", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mesh_normalsmenu, NULL, ICON_RIGHTARROW_THIN, "Normals", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
-
-
- if(G.scene->proportional) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- }
- uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- /* PITA but we should let users know that automerge cant work with multires :/ */
- uiDefIconTextBut(block, BUTM, 1,
- G.scene->automerge ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT,
- ((Mesh*)G.obedit->data)->mr ? "AutoMerge Editing (disabled by multires)" : "AutoMerge Editing",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_mesh_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Vertices", 0, yco-=20, 120, 19, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_edit_curve_controlpointsmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* tilt */
- initTransform(TFM_TILT, CTX_NONE);
- Transform();
- break;
- case 1: /* clear tilt */
- clear_tilt();
- break;
- case 2: /* Free */
- sethandlesNurb(3);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 3: /* vector */
- sethandlesNurb(2);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 4: /* smooth */
- sethandlesNurb(1);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 5: /* make vertex parent */
- make_parent();
- break;
- case 6: /* add hook */
- add_hook_menu();
- break;
- case 7:
- separate_nurb();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_curve_controlpointsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_controlpointsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_curve_controlpointsmenu, NULL);
-
- if (OBACT->type == OB_CURVE) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Tilt|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Automatic|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Free/Aligned|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_curve_segmentsmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* subdivide */
- subdivideNurb();
- break;
- case 1: /* switch direction */
- switchdirectionNurb2();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_curve_segmentsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_segmentsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_curve_segmentsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Direction", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_curve_showhidemenu(void *arg, int event)
-{
- switch(event) {
- case 10: /* show hidden control points */
- revealNurb();
- break;
- case 11: /* hide selected control points */
- hideNurb(0);
- break;
- case 12: /* hide deselected control points */
- hideNurb(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_curve_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_curve_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|Alt Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- if (OBACT->type == OB_SURF) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Control Points|Alt Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-static void do_view3d_edit_curvemenu(void *arg, int event)
-{
- switch(event) {
-
- case 0: /* Undo Editing */
- remake_editNurb();
- break;
- case 1: /* transformation properties */
- mainqenter(NKEY, 1);
- break;
- case 2: /* insert keyframe */
- common_insertkey();
- break;
- case 4: /* extrude */
- if (OBACT->type == OB_CURVE) {
- addvert_Nurb('e');
- } else if (OBACT->type == OB_SURF) {
- extrude_nurb();
- }
- break;
- case 5: /* duplicate */
- duplicate_context_selected();
- break;
- case 6: /* make segment */
- addsegment_nurb();
- break;
- case 7: /* toggle cyclic */
- makecyclicNurb();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- break;
- case 8: /* delete */
- delete_context_selected();
- break;
- case 9: /* proportional edit (toggle) */
- if(G.scene->proportional) G.scene->proportional= 0;
- else G.scene->proportional= 1;
- break;
- case 13: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 14: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 15:
- uv_autocalc_tface();
- break;
- case 16: /* delete keyframe */
- common_deletekey();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_curvemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_curvemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload Original|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Segment|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Cyclic|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_curve_controlpointsmenu, NULL, ICON_RIGHTARROW_THIN, "Control Points", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_curve_segmentsmenu, NULL, ICON_RIGHTARROW_THIN, "Segments", 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.scene->proportional) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- }
- uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, menuwidth, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_curve_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Control Points", 0, yco-=20, menuwidth, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_edit_mball_showhidemenu(void *arg, int event)
-{
- switch(event) {
- case 10: /* show hidden control points */
- reveal_mball();
- break;
- case 11: /* hide selected control points */
- hide_mball(0);
- break;
- case 12: /* hide deselected control points */
- hide_mball(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_mball_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mball_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_mball_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-static void do_view3d_edit_metaballmenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* undo */
- BIF_undo();
- break;
- case 2: /* redo */
- BIF_redo();
- break;
- case 3: /* duplicate */
- duplicate_context_selected();
- break;
- case 4: /* delete */
- delete_context_selected();
- break;
- case 5: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 6: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 7: /* Transform Properties */
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, 0);
- break;
- case 8:
- uv_autocalc_tface();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_metaballmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_metaballmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo Editing|Shift Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_mball_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Hide MetaElems", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_edit_text_charsmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* copyright */
- do_textedit(0,0,169);
- break;
- case 1: /* registered trademark */
- do_textedit(0,0,174);
- break;
- case 2: /* degree sign */
- do_textedit(0,0,176);
- break;
- case 3: /* Multiplication Sign */
- do_textedit(0,0,215);
- break;
- case 4: /* Circle */
- do_textedit(0,0,138);
- break;
- case 5: /* superscript 1 */
- do_textedit(0,0,185);
- break;
- case 6: /* superscript 2 */
- do_textedit(0,0,178);
- break;
- case 7: /* superscript 3 */
- do_textedit(0,0,179);
- break;
- case 8: /* double >> */
- do_textedit(0,0,187);
- break;
- case 9: /* double << */
- do_textedit(0,0,171);
- break;
- case 10: /* Promillage */
- do_textedit(0,0,139);
- break;
- case 11: /* dutch florin */
- do_textedit(0,0,164);
- break;
- case 12: /* british pound */
- do_textedit(0,0,163);
- break;
- case 13: /* japanese yen*/
- do_textedit(0,0,165);
- break;
- case 14: /* german S */
- do_textedit(0,0,223);
- break;
- case 15: /* spanish question mark */
- do_textedit(0,0,191);
- break;
- case 16: /* spanish exclamation mark */
- do_textedit(0,0,161);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_text_charsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_text_charsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_text_charsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copyright|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Registered Trademark|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Degree Sign|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Multiplication Sign|Alt x", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|Alt .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 1|Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 2|Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 3|Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double >>|Alt >", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double <<|Alt <", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Promillage|Alt %", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dutch Florin|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "British Pound|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Japanese Yen|Alt Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "German S|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Question Mark|Alt ?", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Exclamation Mark|Alt !", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static void do_view3d_edit_textmenu(void *arg, int event)
-{
- switch(event) {
-
- case 0: /* Undo Editing */
- remake_editText();
- break;
- case 1: /* paste from file buffer */
- paste_editText();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_textmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_textmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_textmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste From Buffer File|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_text_charsmenu, NULL, ICON_RIGHTARROW_THIN, "Special Characters", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-static void do_view3d_edit_latticemenu(void *arg, int event)
-{
- switch(event) {
-
- case 0: /* Undo Editing */
- remake_editLatt();
- break;
- case 2: /* insert keyframe */
- common_insertkey();
- break;
- case 3: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 4: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 5: /* proportional edit (toggle) */
- if(G.scene->proportional) G.scene->proportional= 0;
- else G.scene->proportional= 1;
- break;
- case 6:
- uv_autocalc_tface();
- break;
- case 7: /* delete keyframe */
- common_deletekey();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_latticemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_latticemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(G.scene->proportional) {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- } else {
- uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- }
- uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_edit_armature_parentmenu(void *arg, int event)
-{
- switch(event) {
- case 1:
- make_bone_parent();
- break;
- case 2:
- clear_bone_parent();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_armature_parentmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armature_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_armature_parentmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_edit_armature_rollmenu(void *arg, int event)
-{
- if (event == 1 || event == 2)
- /* set roll based on aligning z-axis */
- auto_align_armature(event);
- else if (event == 3) {
- /* interactively set bone roll */
- initTransform(TFM_BONE_ROLL, CTX_NONE);
- Transform();
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_edit_armature_rollmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armature_rollmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_edit_armature_rollmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Roll (Z-Axis Up)|Ctrl N, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Roll to Cursor|Ctrl N, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Roll|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_edit_armaturemenu(void *arg, int event)
-{
- static short numcuts= 2;
-
- switch(event) {
- case 0: /* Undo Editing */
- remake_editArmature();
- break;
- case 1: /* transformation properties */
- mainqenter(NKEY, 1);
- break;
- case 3: /* extrude */
- extrude_armature(0);
- break;
- case 4: /* duplicate */
- duplicate_context_selected();
- break;
- case 5: /* delete */
- delete_context_selected();
- break;
- case 6: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 7: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- case 10: /* forked! */
- extrude_armature(1);
- break;
- case 12: /* subdivide */
- subdivide_armature(1);
- break;
- case 13: /* flip left and right names */
- armature_flip_names();
- break;
- case 15: /* subdivide multi */
- if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
- waitcursor(1);
- subdivide_armature(numcuts);
- break;
- case 16: /* Alt-S transform (BoneSize) */
- initTransform(TFM_BONESIZE, CTX_NONE);
- Transform();
- break;
- case 17: /* move to layer */
- pose_movetolayer();
- break;
- case 18: /* merge bones */
- merge_armature();
- break;
- case 19: /* auto-extensions */
- case 20:
- case 21:
- armature_autoside_names(event-19);
- break;
- case 22: /* separate */
- separate_armature();
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-#ifndef DISABLE_PYTHON
-static void do_view3d_scripts_armaturemenu(void *arg, int event)
-{
- BPY_menu_do_python(PYMENU_ARMATURE, event);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_scripts_armaturemenu(void *args_unused)
-{
- uiBlock *block;
- BPyMenu *pym;
- int i= 0;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_scripts_armaturemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_scripts_armaturemenu, NULL);
-
- /* note that we acount for the N previous entries with i+20: */
- for (pym = BPyMenuTable[PYMENU_ARMATURE]; pym; pym = pym->next, i++) {
-
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
- NULL, 0.0, 0.0, 1, i,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-#endif /* DISABLE_PYTHON */
-
-static void do_view3d_armature_settingsmenu(void *arg, int event)
-{
- setflag_armature(event);
-}
-
-static uiBlock *view3d_armature_settingsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_armature_settingsmenu",
- UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_armature_settingsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle a Setting|Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Enable a Setting|Ctrl Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disable a Setting|Alt W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
-
- return block;
-}
-
-static uiBlock *view3d_edit_armaturemenu(void *arg_unused)
-{
- bArmature *arm= G.obedit->data;
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_edit_armaturemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_edit_armature_rollmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Roll", 0, yco-=20, 120, 19, "");
-
- if (arm->drawtype==ARM_ENVELOPE)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Envelope Distance|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- else if (arm->drawtype==ARM_B_BONE)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale B-Bone Width|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- if (arm->flag & ARM_MIRROR_EDIT)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude Forked|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill Between Joints|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Multi|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Left & Right Names|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Left-Right|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Front-Back|W, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Top-Bottom|W, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_edit_armature_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_armature_settingsmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Settings", 0, yco-=20, 120, 19, "");
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_scripts_armaturemenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
-#endif
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_view3d_pose_armature_transformmenu(void *arg, int event)
-{
- Object *ob= OBACT;
-
- switch(event) {
- case 0: /* clear origin */
- clear_object('o');
- break;
- case 1: /* clear scale */
- clear_object('s');
- break;
- case 2: /* clear rotation */
- clear_object('r');
- break;
- case 3: /* clear location */
- clear_object('g');
- break;
- case 4: /* clear user transform */
- rest_pose(ob->pose);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Pose, Clear User Transform");
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_transformmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_transformmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_showhidemenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 0: /* show hidden bones */
- show_all_pose_bones();
- break;
- case 1: /* hide selected bones */
- hide_selected_pose_bones();
- break;
- case 2: /* hide deselected bones */
- hide_unselected_pose_bones();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_ikmenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 1:
- pose_add_IK();
- break;
- case 2:
- pose_clear_IK();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_ikmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_ikmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_ikmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add IK to Bone...|Shift I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear IK...|Ctrl Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_constraintsmenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 1:
- add_constraint(0);
- break;
- case 2:
- pose_clear_constraints();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_constraintsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_constraintsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_constraintsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint to Bone...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_groupmenu(void *arg, int event)
-{
- switch (event) {
- case 1:
- pose_assign_to_posegroup(1);
- break;
- case 2:
- pose_assign_to_posegroup(0);
- break;
- case 3:
- pose_add_posegroup();
- break;
- case 4:
- pose_remove_from_posegroups();
- break;
- case 5:
- pose_remove_posegroup();
- break;
- }
-}
-
-static uiBlock *view3d_pose_armature_groupmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_groupmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Selected to Active Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Selected to Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add New Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Active Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_motionpathsmenu(void *arg, int event)
-{
-
- switch(event) {
-
- case 1:
- pose_calculate_path(OBACT);
- break;
- case 2:
- pose_clear_paths(OBACT);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_motionpathsmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_motionpathsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_motionpathsmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Calculate Paths|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear All Paths|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armature_poselibmenu(void *arg, int event)
-{
- Object *ob= OBACT;
-
- switch(event) {
- case 1:
- poselib_preview_poses(ob, 0);
- break;
- case 2:
- poselib_add_current_pose(ob, 0);
- break;
- case 3:
- poselib_rename_pose(ob);
- break;
- case 4:
- poselib_remove_pose(ob, NULL);
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armature_poselibmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_poselibmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armature_poselibmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Browse Poses|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add/Replace Pose|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose|Ctrl Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Pose|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_pose_armaturemenu(void *arg, int event)
-{
- Object *ob;
- ob=OBACT;
-
- switch(event) {
- case 0: /* transform properties */
- mainqenter(NKEY, 1);
- break;
- case 1: /* copy current pose */
- copy_posebuf();
- break;
- case 2: /* paste pose */
- paste_posebuf(0);
- break;
- case 3: /* paste flipped pose */
- paste_posebuf(1);
- break;
- case 4: /* insert keyframe */
- common_insertkey();
- break;
- case 5:
- pose_copy_menu();
- break;
- case 9:
- pose_flip_names();
- break;
- case 13:
- if(ob && (ob->flag & OB_POSEMODE)) {
- bArmature *arm= ob->data;
- if( (arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) {
- initTransform(TFM_BONESIZE, CTX_NONE);
- Transform();
- break;
- }
- }
- break;
- case 14: /* move bone to layer / change armature layer */
- pose_movetolayer();
- break;
- case 15:
- pose_relax();
- break;
- case 16: /* auto-extensions for bones */
- case 17:
- case 18:
- pose_autoside_names(event-16);
- break;
- case 19: /* assign pose as restpose */
- apply_armature_pose2bones();
- break;
- case 20: /* delete keyframe */
- common_deletekey();
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_pose_armaturemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_pose_armaturemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_pose_armature_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear Transform", 0, yco-=20, 120, 19, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Envelope Distance|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Pose as Restpose|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Current Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Flipped Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_pose_armature_poselibmenu, NULL, ICON_RIGHTARROW_THIN, "Pose Library", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_pose_armature_motionpathsmenu, NULL, ICON_RIGHTARROW_THIN, "Motion Paths", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_pose_armature_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Groups", 0, yco-=20, 120, 19, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_pose_armature_ikmenu, NULL, ICON_RIGHTARROW_THIN, "Inverse Kinematics", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_pose_armature_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Left-Right|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Front-Back|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "AutoName Top-Bottom|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip L/R Names|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_pose_armature_showhidemenu,
- NULL, ICON_RIGHTARROW_THIN, "Show/Hide Bones", 0, yco-=20, 120, 19, "");
- uiDefIconTextBlockBut(block, view3d_armature_settingsmenu,
- NULL, ICON_RIGHTARROW_THIN, "Bone Settings", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-/* vertex paint menu */
-static void do_view3d_vpaintmenu(void *arg, int event)
-{
- /* events >= 3 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 3) BPY_menu_do_python(PYMENU_VERTEXPAINT, event - 3);
-#endif
- switch(event) {
- case 0: /* undo vertex painting */
- BIF_undo();
- break;
- case 1: /* set vertex colors/weight */
- if(FACESEL_PAINT_TEST)
- clear_vpaint_selectedfaces();
- else /* we know were in vertex paint mode */
- clear_vpaint();
- break;
- case 2:
- make_vertexcol(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_vpaintmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i=0;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_vpaintmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Shaded Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
-#ifndef DISABLE_PYTHON
- /* note that we account for the 3 previous entries with i+3:
- even if the last item isnt displayed, it dosent matter */
- for (pym = BPyMenuTable[PYMENU_VERTEXPAINT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, i+3,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-
-/* texture paint menu (placeholder, no items yet??) */
-static void do_view3d_tpaintmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* undo image painting */
- undo_imagepaint_step(1);
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_tpaintmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_tpaintmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Texture Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-
-static void do_view3d_wpaintmenu(void *arg, int event)
-{
- Object *ob= OBACT;
-
- /* events >= 3 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 4) BPY_menu_do_python(PYMENU_WEIGHTPAINT, event - 4);
-#endif
- switch(event) {
- case 0: /* undo weight painting */
- BIF_undo();
- break;
- case 1: /* set vertex colors/weight */
- clear_wpaint_selectedfaces();
- break;
- case 2: /* vgroups from envelopes */
- pose_adds_vgroups(ob, 0);
- break;
- case 3: /* vgroups from bone heat */
- pose_adds_vgroups(ob, 1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_wpaintmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120, menunr=1;
-#ifndef DISABLE_PYTHON
- BPyMenu *pym;
-#endif
- int i=0;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_wpaintmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Heat Weights to Vertex Groups|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Envelopes to Vertex Groups|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- if (FACESEL_PAINT_TEST) {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Weight|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- menunr++;
- }
-
-#ifndef DISABLE_PYTHON
- /* note that we account for the 4 previous entries with i+4:
- even if the last item isnt displayed, it dosent matter */
- for (pym = BPyMenuTable[PYMENU_WEIGHTPAINT]; pym; pym = pym->next, i++) {
- uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 1, i+4,
- pym->tooltip?pym->tooltip:pym->filename);
- }
-#endif
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_sculpt_inputmenu(void *arg, int event)
-{
- SculptData *sd= &G.scene->sculptdata;
- short val;
-
- switch(event) {
- case 0:
- sd->flags ^= SCULPT_INPUT_SMOOTH;
- BIF_undo_push("Smooth stroke");
- break;
- case 1:
- val= sd->tablet_size;
- if(button(&val,0,10,"Tablet Size:")==0) return;
- sd->tablet_size= val;
- BIF_undo_push("Tablet size");
- break;
- case 2:
- val= sd->tablet_strength;
- if(button(&val,0,10,"Tablet Strength:")==0) return;
- sd->tablet_strength= val;
- BIF_undo_push("Tablet strength");
- break;
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void do_view3d_sculptmenu(void *arg, int event)
-{
- SculptData *sd= &G.scene->sculptdata;
- BrushData *br= sculptmode_brush();
-
- switch(event) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- sd->brush_type= event+1;
- BIF_undo_push("Brush type");
- break;
- case 7:
- br->flag ^= SCULPT_BRUSH_AIRBRUSH;
- BIF_undo_push("Airbrush");
- break;
- case 8:
- sd->symm ^= SYMM_X;
- BIF_undo_push("X Symmetry");
- break;
- case 9:
- sd->symm ^= SYMM_Y;
- BIF_undo_push("Y Symmetry");
- break;
- case 10:
- sd->symm ^= SYMM_Z;
- BIF_undo_push("Z Symmetry");
- break;
- case 11:
- if(G.vd)
- G.vd->pivot_last= !G.vd->pivot_last;
- break;
- case 12:
- sd->flags ^= SCULPT_DRAW_FAST;
- BIF_undo_push("Partial Redraw");
- break;
- case 13:
- sd->flags ^= SCULPT_DRAW_BRUSH;
- BIF_undo_push("Draw Brush");
- break;
- case 14:
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- break;
- case 15:
- sculpt_radialcontrol_start(RADIALCONTROL_ROTATION);
- break;
- case 16:
- sculpt_radialcontrol_start(RADIALCONTROL_STRENGTH);
- break;
- case 17:
- sculpt_radialcontrol_start(RADIALCONTROL_SIZE);
- break;
- case 18:
- br->dir= br->dir==1 ? 2 : 1;
- BIF_undo_push("Add/Sub");
- break;
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-uiBlock *view3d_sculpt_inputmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth= 120;
- SculptData *sd= &G.scene->sculptdata;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_sculpt_inputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_sculpt_inputmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_INPUT_SMOOTH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth Stroke|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Size Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Strength Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-uiBlock *view3d_sculptmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth= 120;
- SculptData *sd= &G.scene->sculptdata;
- const BrushData *br= sculptmode_brush();
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_sculptmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_sculptmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Sculpt Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBlockBut(block, view3d_sculpt_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input Settings", 0, yco-=20, 120, 19, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
- uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
- if(G.vd)
- uiDefIconTextBut(block, BUTM, 1, (G.vd->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Brush|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strengthen Brush|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Brush|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_Z ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Z Symmetry|Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_Y ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Y Symmetry|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_X ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "X Symmetry|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-
- if(sd->brush_type!=GRAB_BRUSH) {
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, (br->flag & SCULPT_BRUSH_AIRBRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Airbrush|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-
- if(sd->brush_type!=SMOOTH_BRUSH && sd->brush_type!=FLATTEN_BRUSH) {
- uiDefIconTextBut(block, BUTM, 1, (br->dir==1 ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Add|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
- }
- }
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==FLATTEN_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Flatten|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw|D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-static void do_view3d_facesel_showhidemenu(void *arg, int event)
-{
- switch(event) {
- case 4: /* show hidden faces */
- reveal_tface();
- break;
- case 5: /* hide selected faces */
- hide_tface();
- break;
- case 6: /* hide deselected faces */
- G.qual |= LR_SHIFTKEY;
- hide_tface();
- G.qual &= ~LR_SHIFTKEY;
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_facesel_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_facesel_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-static void do_view3d_faceselmenu(void *arg, int event)
-{
- switch(event) {
- case 0: /* set vertex colors */
- clear_vpaint_selectedfaces();
- break;
- case 1: /* mark border seam */
- seam_mark_clear_tface(1);
- break;
- case 2: /* clear seam */
- seam_mark_clear_tface(2);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-static uiBlock *view3d_faceselmenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_faceselmenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Border Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_facesel_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Faces", 0, yco-=20, 120, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_select_particlemenu(void *arg, int event)
-{
- /* events >= 6 are registered bpython scripts */
-#ifndef DISABLE_PYTHON
- if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6);
-#endif
- switch(event) {
- case 0:
- PE_borderselect();
- break;
- case 1:
- PE_deselectall();
- break;
- case 2:
- PE_select_root();
- break;
- case 3:
- PE_select_tip();
- break;
- case 4:
- PE_select_more();
- break;
- case 5:
- PE_select_less();
- break;
- case 7:
- PE_select_linked();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_select_particlemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco= 0, menuwidth=120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_select_particlemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_select_particlemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
- uiDefBut(block, SEPR, 0, "",
- 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked|L",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Last|W, 4",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select First|W, 3",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-
- uiDefBut(block, SEPR, 0, "",
- 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
- return block;
-}
-
-void do_view3d_particle_showhidemenu(void *arg, int event)
-{
- switch(event) {
- case 1: /* show hidden */
- PE_hide(0);
- break;
- case 2: /* hide selected */
- PE_hide(2);
- break;
- case 3: /* hide deselected */
- PE_hide(1);
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static uiBlock *view3d_particle_showhidemenu(void *arg_unused)
-{
- uiBlock *block;
- short yco = 20, menuwidth = 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_particle_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetButmFunc(block, do_view3d_particle_showhidemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H",
- 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-
- uiBlockSetDirection(block, UI_RIGHT);
- uiTextBoundsBlock(block, 60);
- return block;
-}
-
-void do_view3d_particlemenu(void *arg, int event)
-{
- ParticleEditSettings *pset= PE_settings();
-
- switch(event) {
- case 1:
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- break;
- case 2:
- if(button(&pset->totrekey, 2, 100, "Number of Keys:")==0) return;
- PE_rekey();
- break;
- case 3:
- PE_subdivide();
- break;
- case 4:
- PE_delete_particle();
- break;
- case 5:
- PE_mirror_x(0);
- break;
- case 6:
- pset->flag ^= PE_X_MIRROR;
- break;
- case 7:
- PE_remove_doubles();
- break;
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-uiBlock *view3d_particlemenu(void *arg_unused)
-{
- uiBlock *block;
- ParticleEditSettings *pset= PE_settings();
- short yco= 0, menuwidth= 120;
-
- block= uiNewBlock(&curarea->uiblocks, "view3d_particlemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
- uiBlockSetButmFunc(block, do_view3d_particlemenu, NULL);
-
- uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles|W, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
- if(G.scene->selectmode & SCE_SELECT_POINT)
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rekey|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
- uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
- uiDefIconTextBlockBut(block, view3d_particle_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Particles", 0, yco-=20, menuwidth, 19, "");
-
- if(curarea->headertype==HEADERTOP) {
- uiBlockSetDirection(block, UI_DOWN);
- }
- else {
- uiBlockSetDirection(block, UI_TOP);
- uiBlockFlipOrder(block);
- }
-
- uiTextBoundsBlock(block, 50);
-
- return block;
-}
-
-
-static char *view3d_modeselect_pup(void)
-{
- Object *ob= OBACT;
- static char string[1024];
- static char formatstr[] = "|%s %%x%d %%i%d";
- char *str = string;
-
- str += sprintf(str, "Mode: %%t");
-
- str += sprintf(str, formatstr, "Object Mode", V3D_OBJECTMODE_SEL, ICON_OBJECT);
-
- if(ob==NULL) return string;
-
- /* if active object is editable */
- if ( ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE)
- || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
- || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
-
- str += sprintf(str, formatstr, "Edit Mode", V3D_EDITMODE_SEL, ICON_EDITMODE_HLT);
- }
-
- if (ob->type == OB_MESH) {
-
- str += sprintf(str, formatstr, "Sculpt Mode", V3D_SCULPTMODE_SEL, ICON_SCULPTMODE_HLT);
- /*str += sprintf(str, formatstr, "Face Select", V3D_FACESELECTMODE_SEL, ICON_FACESEL_HLT);*/
- str += sprintf(str, formatstr, "Vertex Paint", V3D_VERTEXPAINTMODE_SEL, ICON_VPAINT_HLT);
- str += sprintf(str, formatstr, "Texture Paint", V3D_TEXTUREPAINTMODE_SEL, ICON_TPAINT_HLT);
- str += sprintf(str, formatstr, "Weight Paint", V3D_WEIGHTPAINTMODE_SEL, ICON_WPAINT_HLT);
- }
-
-
- /* if active object is an armature */
- if (ob->type==OB_ARMATURE) {
- str += sprintf(str, formatstr, "Pose Mode", V3D_POSEMODE_SEL, ICON_POSE_HLT);
- }
-
- if (ob->particlesystem.first) {
- str += sprintf(str, formatstr, "Particle Mode", V3D_PARTICLEEDITMODE_SEL, ICON_PHYSICS);
- }
-
- return (string);
-}
-
-
-static char *drawtype_pup(void)
-{
- static char string[512];
- char *str = string;
-
- str += sprintf(str, "%s", "Draw type: %t");
- str += sprintf(str, "%s", "|Bounding Box %x1");
- str += sprintf(str, "%s", "|Wireframe %x2");
- str += sprintf(str, "%s", "|Solid %x3");
- str += sprintf(str, "%s", "|Shaded %x4");
- str += sprintf(str, "%s", "|Textured %x5");
- return string;
-}
-static char *around_pup(void)
-{
- static char string[512];
- char *str = string;
-
- str += sprintf(str, "%s", "Pivot: %t");
- str += sprintf(str, "%s", "|Bounding Box Center %x0");
- str += sprintf(str, "%s", "|Median Point %x3");
- str += sprintf(str, "%s", "|3D Cursor %x1");
- str += sprintf(str, "%s", "|Individual Centers %x2");
- if ((G.obedit) && (G.obedit->type == OB_MESH))
- str += sprintf(str, "%s", "|Active Vert/Edge/Face %x4");
- else
- str += sprintf(str, "%s", "|Active Object %x4");
- return string;
-}
-
-static char *ndof_pup(void)
-{
- static char string[512];
- char *str = string;
-
- str += sprintf(str, "%s", "ndof mode: %t");
- str += sprintf(str, "%s", "|turntable %x0");
- str += sprintf(str, "%s", "|fly %x1");
- str += sprintf(str, "%s", "|transform %x2");
- return string;
-}
-
-
-static char *snapmode_pup(void)
-{
- static char string[512];
- char *str = string;
-
- str += sprintf(str, "%s", "Snap Element: %t");
- str += sprintf(str, "%s", "|Vertex%x0");
- str += sprintf(str, "%s", "|Edge%x1");
- str += sprintf(str, "%s", "|Face%x2");
- return string;
-}
-
-static char *propfalloff_pup(void)
-{
- static char string[512];
- char *str = string;
-
- str += sprintf(str, "%s", "Falloff: %t");
- str += sprintf(str, "%s", "|Smooth Falloff%x0");
- str += sprintf(str, "%s", "|Sphere Falloff%x1");
- str += sprintf(str, "%s", "|Root Falloff%x2");
- str += sprintf(str, "%s", "|Sharp Falloff%x3");
- str += sprintf(str, "%s", "|Linear Falloff%x4");
- str += sprintf(str, "%s", "|Random Falloff%x6");
- str += sprintf(str, "%s", "|Constant, No Falloff%x5");
- return string;
-}
-
-
-void do_view3d_buttons(short event)
-{
- Object *ob= OBACT;
- int bit;
-
- /* watch it: if curarea->win does not exist, check that when calling direct drawing routines */
-
- switch(event) {
- case B_HOME:
- view3d_home(0);
- break;
- case B_SCENELOCK:
- if(G.vd->scenelock) {
- G.vd->lay= G.scene->lay;
- /* seek for layact */
- bit= 0;
- while(bit<32) {
- if(G.vd->lay & (1<<bit)) {
- G.vd->layact= 1<<bit;
- break;
- }
- bit++;
- }
- G.vd->camera= G.scene->camera;
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- }
- break;
-
- case B_VIEWBUT:
-
- if(G.vd->viewbut==1) persptoetsen(PAD7);
- else if(G.vd->viewbut==2) persptoetsen(PAD1);
- else if(G.vd->viewbut==3) persptoetsen(PAD3);
- break;
-
- case B_PERSP:
-
- if(G.vd->persp==V3D_CAMOB) persptoetsen(PAD0);
- else {
- if (G.vd->persp==V3D_ORTHO) G.vd->persp = V3D_PERSP;
- else if (G.vd->persp==V3D_PERSP) G.vd->persp = V3D_ORTHO;
- persptoetsen(PAD5);
- }
-
- break;
- case B_VIEWRENDER:
- if (curarea->spacetype==SPACE_VIEW3D) {
- BIF_do_ogl_render(curarea->spacedata.first, G.qual!=0 );
- }
- break;
- case B_STARTGAME:
- if (select_area(SPACE_VIEW3D)) {
- start_game();
- }
- break;
- case B_MODESELECT:
- if (G.vd->modeselect == V3D_OBJECTMODE_SEL) {
-
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(ob) exit_posemode(); /* exit posemode for active object */
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
- }
- else if (G.vd->modeselect == V3D_EDITMODE_SEL) {
- if(!G.obedit) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- enter_editmode(EM_WAITCURSOR);
- BIF_undo_push("Original"); /* here, because all over code enter_editmode is abused */
- }
- }
- else if (G.vd->modeselect == V3D_SCULPTMODE_SEL) {
- if (!(G.f & G_SCULPTMODE)) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(G.obedit) exit_editmode(2); /* exit editmode and undo */
-
- set_sculptmode();
- }
- }
- else if (G.vd->modeselect == V3D_VERTEXPAINTMODE_SEL) {
- if (!(G.f & G_VERTEXPAINT)) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- set_vpaint();
- }
- }
- else if (G.vd->modeselect == V3D_TEXTUREPAINTMODE_SEL) {
- if (!(G.f & G_TEXTUREPAINT)) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- set_texturepaint();
- }
- }
- else if (G.vd->modeselect == V3D_WEIGHTPAINTMODE_SEL) {
- if (!(G.f & G_WEIGHTPAINT) && (ob && ob->type == OB_MESH) ) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- set_wpaint();
- }
- }
- else if (G.vd->modeselect == V3D_POSEMODE_SEL) {
-
- if (ob) {
- G.vd->flag &= ~V3D_MODE;
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- enter_posemode();
- }
- }
- else if(G.vd->modeselect == V3D_PARTICLEEDITMODE_SEL){
- if (!(G.f & G_PARTICLEEDIT)) {
- G.vd->flag &= ~V3D_MODE;
- exit_paint_modes();
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */
-
- PE_set_particle_edit();
- }
- }
- allqueue(REDRAWVIEW3D, 1);
- break;
-
- case B_AROUND:
- handle_view3d_around(); /* copies to other 3d windows */
- allqueue(REDRAWVIEW3D, 1);
- break;
-
- case B_SEL_VERT:
- if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0)
- G.scene->selectmode= SCE_SELECT_VERTEX;
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Vertex");
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */
- break;
- case B_SEL_EDGE:
- if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0){
- if( (G.scene->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX){
- if(G.qual==LR_CTRLKEY) EM_convertsel(SCE_SELECT_VERTEX,SCE_SELECT_EDGE);
- }
- G.scene->selectmode = SCE_SELECT_EDGE;
- }
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Edge");
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */
- break;
- case B_SEL_FACE:
- if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0){
- if( ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)){
- if(G.qual==LR_CTRLKEY) EM_convertsel((G.scene->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE);
- }
- G.scene->selectmode = SCE_SELECT_FACE;
- }
- EM_selectmode_set();
- countall();
- BIF_undo_push("Selectmode Set: Face");
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */
- break;
-
- case B_SEL_PATH:
- G.scene->selectmode= SCE_SELECT_PATH;
- BIF_undo_push("Selectmode Set: Path");
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_SEL_POINT:
- G.scene->selectmode = SCE_SELECT_POINT;
- BIF_undo_push("Selectmode Set: Point");
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_SEL_END:
- G.scene->selectmode = SCE_SELECT_END;
- BIF_undo_push("Selectmode Set: End point");
- allqueue(REDRAWVIEW3D, 1);
- break;
-
- case B_MAN_TRANS:
- if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0)
- G.vd->twtype= V3D_MANIP_TRANSLATE;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_MAN_ROT:
- if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0)
- G.vd->twtype= V3D_MANIP_ROTATE;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_MAN_SCALE:
- if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0)
- G.vd->twtype= V3D_MANIP_SCALE;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_NDOF:
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_MAN_MODE:
- allqueue(REDRAWVIEW3D, 1);
- break;
- case B_VIEW_BUTSEDIT:
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 1);
- break;
-
- default:
-
- if(event>=B_LAY && event<B_LAY+31) {
- if(G.vd->lay!=0 && (G.qual & LR_SHIFTKEY)) {
-
- /* but do find active layer */
-
- bit= event-B_LAY;
- if( G.vd->lay & (1<<bit)) G.vd->layact= 1<<bit;
- else {
- if( (G.vd->lay & G.vd->layact) == 0) {
- bit= 0;
- while(bit<32) {
- if(G.vd->lay & (1<<bit)) {
- G.vd->layact= 1<<bit;
- break;
- }
- bit++;
- }
- }
- }
- }
- else {
- bit= event-B_LAY;
- G.vd->lay= 1<<bit;
- G.vd->layact= G.vd->lay;
- scrarea_queue_headredraw(curarea);
- }
-
- if(G.vd->scenelock) handle_view3d_lock();
-
- scrarea_queue_winredraw(curarea);
- countall();
-
- /* new layers might need unflushed events events */
- DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNLA, 0);
- }
- break;
- }
-}
-
-static void view3d_header_pulldowns(uiBlock *block, short *xcoord)
-{
- Object *ob= OBACT;
- short xmax, xco= *xcoord;
-
- /* pull down menus */
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- /* compensate for local mode when setting up the viewing menu/iconrow values */
- if(G.vd->view==7) G.vd->viewbut= 1;
- else if(G.vd->view==1) G.vd->viewbut= 2;
- else if(G.vd->view==3) G.vd->viewbut= 3;
- else G.vd->viewbut= 0;
-
-
- /* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted
- * menu is drawn wider than it should be. The ypos of -2 is to make it properly fill the
- * height of the header */
-
- xmax= GetButStringLength("View");
- uiDefPulldownBut(block, view3d_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
- xco+= xmax;
-
- xmax= GetButStringLength("Select");
- if (G.obedit) {
- if (ob && ob->type == OB_MESH) {
- uiDefPulldownBut(block, view3d_select_meshmenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- } else if (ob && (ob->type == OB_CURVE || ob->type == OB_SURF)) {
- uiDefPulldownBut(block, view3d_select_curvemenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- } else if (ob && ob->type == OB_FONT) {
- uiDefPulldownBut(block, view3d_select_meshmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
- } else if (ob && ob->type == OB_MBALL) {
- uiDefPulldownBut(block, view3d_select_metaballmenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- } else if (ob && ob->type == OB_LATTICE) {
- uiDefPulldownBut(block, view3d_select_latticemenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- } else if (ob && ob->type == OB_ARMATURE) {
- uiDefPulldownBut(block, view3d_select_armaturemenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- }
- } else if (FACESEL_PAINT_TEST) {
- if (ob && ob->type == OB_MESH) {
- uiDefPulldownBut(block, view3d_select_faceselmenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- }
- } else if ((G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_WEIGHTPAINT)) {
- uiDefBut(block, LABEL,0,"", xco, 0, xmax, 20, 0, 0, 0, 0, 0, "");
- } else if (G.f & G_PARTICLEEDIT) {
- uiDefPulldownBut(block, view3d_select_particlemenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- } else {
-
- if (ob && (ob->flag & OB_POSEMODE))
- uiDefPulldownBut(block, view3d_select_pose_armaturemenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- else
- uiDefPulldownBut(block, view3d_select_objectmenu, NULL, "Select", xco,-2, xmax-3, 24, "");
- }
- xco+= xmax;
-
- if (G.obedit) {
- if (ob && ob->type == OB_MESH) {
- xmax= GetButStringLength("Mesh");
- uiDefPulldownBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_CURVE) {
- xmax= GetButStringLength("Curve");
- uiDefPulldownBut(block, view3d_edit_curvemenu, NULL, "Curve", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_SURF) {
- xmax= GetButStringLength("Surface");
- uiDefPulldownBut(block, view3d_edit_curvemenu, NULL, "Surface", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_FONT) {
- xmax= GetButStringLength("Text");
- uiDefPulldownBut(block, view3d_edit_textmenu, NULL, "Text", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_MBALL) {
- xmax= GetButStringLength("Metaball");
- uiDefPulldownBut(block, view3d_edit_metaballmenu, NULL, "Metaball", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_LATTICE) {
- xmax= GetButStringLength("Lattice");
- uiDefPulldownBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- } else if (ob && ob->type == OB_ARMATURE) {
- xmax= GetButStringLength("Armature");
- uiDefPulldownBut(block, view3d_edit_armaturemenu, NULL, "Armature", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
-
- }
- else if (G.f & G_WEIGHTPAINT) {
- xmax= GetButStringLength("Paint");
- uiDefPulldownBut(block, view3d_wpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- else if (G.f & G_VERTEXPAINT) {
- xmax= GetButStringLength("Paint");
- uiDefPulldownBut(block, view3d_vpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- else if (G.f & G_TEXTUREPAINT) {
- xmax= GetButStringLength("Paint");
- uiDefPulldownBut(block, view3d_tpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- else if( G.f & G_SCULPTMODE) {
- xmax= GetButStringLength("Sculpt");
- uiDefPulldownBut(block, view3d_sculptmenu, NULL, "Sculpt", xco, -2, xmax-3, 24, "");
- xco+= xmax;
- }
- else if (FACESEL_PAINT_TEST) {
- if (ob && ob->type == OB_MESH) {
- xmax= GetButStringLength("Face");
- uiDefPulldownBut(block, view3d_faceselmenu, NULL, "Face", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- }
- else if(G.f & G_PARTICLEEDIT) {
- xmax= GetButStringLength("Particle");
- uiDefPulldownBut(block, view3d_particlemenu, NULL, "Particle", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- else {
- if (ob && (ob->flag & OB_POSEMODE)) {
- xmax= GetButStringLength("Pose");
- uiDefPulldownBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- else {
- xmax= GetButStringLength("Object");
- uiDefPulldownBut(block, view3d_edit_objectmenu, NULL, "Object", xco,-2, xmax-3, 24, "");
- xco+= xmax;
- }
- }
-
- *xcoord= xco;
-}
-
-static int view3d_layer_icon(int but_lay, int ob_lay, int used_lay)
-{
- if (but_lay & ob_lay)
- return ICON_LAYER_ACTIVE;
- else if (but_lay & used_lay)
- return ICON_LAYER_USED;
- else
- return ICON_BLANK1;
-}
-
-void view3d_buttons(void)
-{
- uiBlock *block;
- Object *ob= OBACT;
- int a;
- short xco = 0;
-
- block= uiNewBlock(&curarea->uiblocks, "header view3d", UI_EMBOSS, UI_HELV, curarea->headwin);
-
- if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
- else uiBlockSetCol(block, TH_HEADERDESEL);
-
- curarea->butspacetype= SPACE_VIEW3D;
-
- xco = 8;
- uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
- xco+= XIC+14;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- if(curarea->flag & HEADER_NO_PULLDOWN) {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
- } else {
- uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
- xco,2,XIC,YIC-2,
- &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
- }
- uiBlockSetEmboss(block, UI_EMBOSS);
- xco+=XIC;
-
- if((curarea->flag & HEADER_NO_PULLDOWN)==0)
- view3d_header_pulldowns(block, &xco);
-
- /* other buttons: */
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- /* mode */
- G.vd->modeselect = V3D_OBJECTMODE_SEL;
-
- if (G.obedit) G.vd->modeselect = V3D_EDITMODE_SEL;
- else if(ob && (ob->flag & OB_POSEMODE)) G.vd->modeselect = V3D_POSEMODE_SEL;
- else if (G.f & G_SCULPTMODE) G.vd->modeselect = V3D_SCULPTMODE_SEL;
- else if (G.f & G_WEIGHTPAINT) G.vd->modeselect = V3D_WEIGHTPAINTMODE_SEL;
- else if (G.f & G_VERTEXPAINT) G.vd->modeselect = V3D_VERTEXPAINTMODE_SEL;
- else if (G.f & G_TEXTUREPAINT) G.vd->modeselect = V3D_TEXTUREPAINTMODE_SEL;
- /*else if(G.f & G_FACESELECT) G.vd->modeselect = V3D_FACESELECTMODE_SEL;*/
- else if(G.f & G_PARTICLEEDIT) G.vd->modeselect = V3D_PARTICLEEDITMODE_SEL;
-
- G.vd->flag &= ~V3D_MODE;
-
- /* not sure what the G.vd->flag is useful for now... modeselect is confusing */
- if(G.obedit) G.vd->flag |= V3D_EDITMODE;
- if(ob && (ob->flag & OB_POSEMODE)) G.vd->flag |= V3D_POSEMODE;
- if(G.f & G_VERTEXPAINT) G.vd->flag |= V3D_VERTEXPAINT;
- if(G.f & G_WEIGHTPAINT) G.vd->flag |= V3D_WEIGHTPAINT;
- if (G.f & G_TEXTUREPAINT) G.vd->flag |= V3D_TEXTUREPAINT;
- if(FACESEL_PAINT_TEST) G.vd->flag |= V3D_FACESELECT;
-
- uiDefIconTextButS(block, MENU, B_MODESELECT, (G.vd->modeselect),view3d_modeselect_pup() ,
- xco,0,126,20, &(G.vd->modeselect), 0, 0, 0, 0, "Mode (Hotkeys: Tab, V, Ctrl Tab)");
-
- xco+= 126+8;
-
- /* DRAWTYPE */
- uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_BBOX, drawtype_pup(), xco,0,XIC+10,YIC, &(G.vd->drawtype), 1.0, 5.0, 0, 0, "Viewport Shading (Hotkeys: Z, Shift Z, Alt Z)");
-
- /* around */
- xco+= XIC+18;
-
- uiBlockBeginAlign(block);
-
- if(retopo_mesh_paint_check()) {
- RetopoPaintData *rpd= get_retopo_paint_data();
- if(rpd) {
- ToolSettings *ts= G.scene->toolsettings;
-
- uiDefButC(block,ROW,B_REDR,"Pen",xco,0,40,20,&ts->retopo_paint_tool,6.0,RETOPO_PEN,0,0,"");
- xco+=40;
- uiDefButC(block,ROW,B_REDR,"Line",xco,0,40,20,&ts->retopo_paint_tool,6.0,RETOPO_LINE,0,0,"");
- xco+=40;
- uiDefButC(block,ROW,B_REDR,"Ellipse",xco,0,60,20,&ts->retopo_paint_tool,6.0,RETOPO_ELLIPSE,0,0,"");
- xco+=65;
-
- uiBlockBeginAlign(block);
- if(ts->retopo_paint_tool == RETOPO_PEN) {
- uiDefButC(block,TOG,B_NOP,"Hotspot",xco,0,60,20, &ts->retopo_hotspot, 0,0,0,0,"Show hotspots at line ends to allow line continuation");
- xco+=80;
- }
- else if(ts->retopo_paint_tool == RETOPO_LINE) {
- uiDefButC(block,NUM,B_NOP,"LineDiv",xco,0,80,20,&ts->line_div,1,50,0,0,"Subdivisions per retopo line");
- xco+=80;
- }
- else if(ts->retopo_paint_tool == RETOPO_ELLIPSE) {
- uiDefButC(block,NUM,B_NOP,"EllDiv",xco,0,80,20,&ts->ellipse_div,3,50,0,0,"Subdivisions per retopo ellipse");
- xco+=80;
- }
- xco+=5;
-
- uiBlockEndAlign(block);
- }
- } else {
- if (G.obedit==NULL && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) {
- uiDefIconButBitI(block, TOG, G_FACESELECT, B_VIEW_BUTSEDIT, ICON_FACESEL_HLT,xco,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)");
- xco+= XIC+10;
- } else {
- /* Manipulators arnt used in weight paint mode */
- char *str_menu;
- uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.vd->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period, Ctrl Period, Alt Period)");
-
- xco+= XIC+10;
-
- uiDefIconButBitS(block, TOG, V3D_ALIGN, B_AROUND, ICON_ALIGN,
- xco,0,XIC,YIC,
- &G.vd->flag, 0, 0, 0, 0, "Move object centers only");
- uiBlockEndAlign(block);
-
- xco+= XIC+8;
-
- uiBlockBeginAlign(block);
-
- /* NDOF */
- if (G.ndofdevice ==0 ) {
- uiDefIconTextButC(block, ICONTEXTROW,B_NDOF, ICON_NDOF_TURN, ndof_pup(), xco,0,XIC+10,YIC, &(G.vd->ndofmode), 0, 3.0, 0, 0, "Ndof mode");
-
- xco+= XIC+10;
-
- uiDefIconButC(block, TOG, B_NDOF, ICON_NDOF_DOM,
- xco,0,XIC,YIC,
- &G.vd->ndoffilter, 0, 1, 0, 0, "dominant axis");
- uiBlockEndAlign(block);
-
- xco+= XIC+8;
- }
- uiBlockEndAlign(block);
-
- /* Transform widget / manipulators */
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, V3D_USE_MANIPULATOR, B_REDR, ICON_MANIPUL,xco,0,XIC,YIC, &G.vd->twflag, 0, 0, 0, 0, "Use 3d transform manipulator (Ctrl Space)");
- xco+= XIC;
-
-
- if(G.vd->twflag & V3D_USE_MANIPULATOR) {
- uiDefIconButBitS(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode (Ctrl Alt G)");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode (Ctrl Alt R)");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode (Ctrl Alt S)");
- xco+= XIC;
- }
-
- if (G.vd->twmode > (BIF_countTransformOrientation() - 1) + V3D_MANIP_CUSTOM) {
- G.vd->twmode = 0;
- }
-
- str_menu = BIF_menustringTransformOrientation("Orientation");
- uiDefButS(block, MENU, B_MAN_MODE, str_menu,xco,0,70,YIC, &G.vd->twmode, 0, 0, 0, 0, "Transform Orientation (ALT+Space)");
- MEM_freeN(str_menu);
-
- xco+= 70;
- uiBlockEndAlign(block);
- xco+= 8;
- }
-
- /* LAYERS */
- if(G.obedit==NULL && G.vd->localview==0) {
- int ob_lay = ob ? ob->lay : 0;
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++) {
- uiDefIconButBitI(block, TOG, 1<<a, B_LAY+a, view3d_layer_icon(1<<a, ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
- }
- for(a=0; a<5; a++) {
- uiDefIconButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, view3d_layer_icon(1<<(a+10), ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
- }
- xco+= 5;
- uiBlockBeginAlign(block);
- for(a=5; a<10; a++) {
- uiDefIconButBitI(block, TOG, 1<<a, B_LAY+a, view3d_layer_icon(1<<a, ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), (short)(YIC/2),(short)(XIC/2),(short)(YIC/2), &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
- }
- for(a=5; a<10; a++) {
- uiDefIconButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, view3d_layer_icon(1<<(a+10), ob_lay, G.vd->lay_used), (short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)");
- }
- uiBlockEndAlign(block);
-
- xco+= (a-2)*(XIC/2)+3;
-
- /* LOCK */
- uiDefIconButS(block, ICONTOG, B_SCENELOCK, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.vd->scenelock), 0, 0, 0, 0, "Locks Active Camera and layers to Scene (Ctrl `)");
- xco+= XIC+10;
-
- }
-
- /* proportional falloff */
- if((G.obedit && (G.obedit->type == OB_MESH || G.obedit->type == OB_CURVE || G.obedit->type == OB_SURF || G.obedit->type == OB_LATTICE)) || G.f & G_PARTICLEEDIT) {
-
- uiBlockBeginAlign(block);
- uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_PROP_OFF, "Proportional %t|Off %x0|On %x1|Connected %x2", xco,0,XIC+10,YIC, &(G.scene->proportional), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkeys: O, Alt O) ");
- xco+= XIC+10;
-
- if(G.scene->proportional) {
- uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SMOOTHCURVE, propfalloff_pup(), xco,0,XIC+10,YIC, &(G.scene->prop_mode), 0.0, 0.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) ");
- xco+= XIC+10;
- }
- uiBlockEndAlign(block);
- xco+= 10;
- }
-
- /* Snap */
- if (BIF_snappingSupported()) {
- uiBlockBeginAlign(block);
-
- if (G.scene->snap_flag & SCE_SNAP) {
- uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, SCE_SNAP_ROTATE, B_REDR, ICON_SNAP_NORMAL,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Align rotation with the snapping target");
- xco+= XIC;
- uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_VERTEXSEL, snapmode_pup(), xco,0,XIC+10,YIC, &(G.scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode");
- xco+= XIC;
- uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
- xco+= 70;
- } else {
- uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");
- xco+= XIC;
- }
-
- uiBlockEndAlign(block);
- xco+= 10;
- }
-
- /* selection modus */
- if(G.obedit && (G.obedit->type == OB_MESH)) {
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode (Ctrl Tab 2)");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)");
- xco+= XIC;
- uiBlockEndAlign(block);
- if(G.vd->drawtype > OB_WIRE) {
- uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,0,XIC,YIC, &G.vd->flag, 1.0, 0.0, 0, 0, "Occlude background geometry");
- xco+= XIC;
- }
- uiBlockEndAlign(block);
- xco+= 20;
- }
- else if(G.f & G_PARTICLEEDIT) {
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Path edit mode");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Point select mode");
- xco+= XIC;
- uiDefIconButBitS(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Tip select mode");
- xco+= XIC;
- uiBlockEndAlign(block);
- if(G.vd->drawtype > OB_WIRE) {
- uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,0,XIC,YIC, &G.vd->flag, 1.0, 0.0, 0, 0, "Limit selection to visible (clipped with depth buffer)");
- xco+= XIC;
- }
- uiBlockEndAlign(block);
- xco+= 20;
- }
-
- uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE_DEHLT, xco,0,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (Ctrl Click for anim)");
-
-
- if (ob && (ob->flag & OB_POSEMODE)) {
- xco+= XIC/2;
- uiBlockBeginAlign(block);
- if(curarea->headertype==HEADERTOP) {
- uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYUP,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Copies the current pose to the buffer");
- uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEUP,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Pastes the pose from the buffer");
- uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPUP,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Pastes the mirrored pose from the buffer");
- }
- else {
- uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYDOWN,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Copies the current pose to the buffer");
- uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEDOWN,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Pastes the pose from the buffer");
- uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPDOWN,
- xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0,
- "Pastes the mirrored pose from the buffer");
- }
- uiBlockEndAlign(block);
- }
- }
-
- /* Always do this last */
- curarea->headbutlen= xco+2*XIC;
-
- uiDrawBlock(block);
-
-}
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
deleted file mode 100644
index f4135071e3e..00000000000
--- a/source/blender/src/headerbuttons.c
+++ /dev/null
@@ -1,2161 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include <sys/types.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_storage_types.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_packedFile_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_constraint_types.h"
-
-#include "BKE_utildefines.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_blender.h"
-#include "BKE_brush.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_exotic.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_lattice.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_object.h"
-#include "BKE_packedFile.h"
-#include "BKE_sca.h"
-#include "BKE_scene.h"
-#include "BKE_texture.h"
-#include "BKE_text.h"
-#include "BKE_world.h"
-
-#include "BLO_readfile.h"
-#include "BLO_writefile.h"
-
-#include "BIF_drawimage.h"
-#include "BIF_drawoops.h"
-#include "BIF_drawscene.h"
-#include "BIF_drawtext.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editfont.h"
-#include "BIF_editlattice.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmesh.h"
-#include "BIF_editsima.h"
-#include "BIF_editsound.h"
-#include "BIF_gl.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_mainqueue.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-#include "BIF_previewrender.h"
-#include "BIF_writeimage.h"
-#include "BIF_butspace.h"
-
-#include "BSE_edit.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-#include "BSE_sequence.h"
-#include "BSE_editipo.h"
-#include "BSE_drawipo.h"
-
-#include "BDR_vpaint.h"
-#include "BDR_editface.h"
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_editmball.h"
-#include "BDR_sculptmode.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "GPU_draw.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "interface.h"
-#include "nla.h" /* __NLA : To be removed later */
-#include "butspace.h" // test_idbutton
-
-#include "BIF_poseobject.h"
-
-#include "SYS_System.h"
-
- /* WATCH IT: always give all headerbuttons for same window the same name
- * event B_REDR is a standard redraw
- *
- */
-
-char *windowtype_pup(void)
-{
- return(
- "Window type:%t" //14
- "|3D View %x1" //30
-
- "|%l" // 33
-
- "|Ipo Curve Editor %x2" //54
- "|Action Editor %x12" //73
- "|NLA Editor %x13" //94
-
- "|%l" //97
-
- "|UV/Image Editor %x6" //117
-
- "|Video Sequence Editor %x8" //143
- "|Timeline %x15" //163
- "|Audio Window %x11" //163
- "|Text Editor %x9" //179
-
- "|%l" //192
-
-
- "|User Preferences %x7" //213
- "|Outliner %x3" //232
- "|Buttons Window %x4" //251
- "|Node Editor %x16"
- "|%l" //254
-
- "|Image Browser %x10" //273
- "|File Browser %x5" //290
-
- "|%l" //293
-
- "|Scripts Window %x14"//313
- );
-}
-
-int GetButStringLength(char *str) {
- int rt;
-
- rt= BIF_GetStringWidth(G.font, str, (U.transopts & USER_TR_BUTTONS));
-
- return rt + 15;
-}
-
-/* ********************** GLOBAL ****************************** */
-
-int std_libbuttons(uiBlock *block, short xco, short yco,
- int pin, short *pinpoin, int browse, short id_code, short special, ID *id,
- ID *parid, short *menupoin, int users, int lib,
- int del, int autobut, int keepbut)
-{
- ListBase *lb;
- uiBut *but;
- int len, oldcol, add_addbutton=0;
- char *str=NULL, str1[10];
-
- uiBlockBeginAlign(block);
- oldcol= uiBlockGetCol(block);
-
- if(id && pin) {
- uiDefIconButS(block, ICONTOG, pin, ICON_PIN_DEHLT, xco,yco,XIC,YIC, pinpoin, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what object is selected");
- xco+= XIC;
- }
- /* browse menu */
- if(browse) {
- char *extrastr= NULL;
-
- if(ELEM4(id_code, ID_MA, ID_TE, ID_BR, ID_PA)) add_addbutton= 1;
-
- lb= wich_libbase(G.main, id_code);
-
- if(id && id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1);
-
- if (pin && *pinpoin) {
- uiBlockSetCol(block, TH_BUT_SETTING2);
- }
-
- if (ELEM8( id_code, ID_SCE, ID_SCR, ID_MA, ID_TE, ID_WO, ID_IP, ID_AC, ID_BR) || id_code == ID_PA) extrastr= "ADD NEW %x 32767";
- else if (id_code==ID_TXT) extrastr= "OPEN NEW %x 32766 |ADD NEW %x 32767";
- else if (id_code==ID_SO) extrastr= "OPEN NEW %x 32766";
-
- uiSetButLock(G.scene->id.lib!=0, ERROR_LIBDATA_MESSAGE);
- if( id_code==ID_SCE || id_code==ID_SCR ) uiClearButLock();
-
- if(curarea->spacetype==SPACE_BUTS)
- uiSetButLock(id_code!=ID_SCR && G.obedit!=0 && G.buts->mainb==CONTEXT_EDITING, "Cannot perform in EditMode");
-
- if(parid) uiSetButLock(parid->lib!=0, ERROR_LIBDATA_MESSAGE);
-
- if (lb) {
- if( id_code==ID_IP)
- IPOnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin, G.sipo->blocktype);
- else if(browse!=B_SIMABROWSE && id_code==ID_IM )
- IMAnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin);
- else
- IDnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin);
- }
-
- uiDefButS(block, MENU, browse, str, xco,yco,XIC,YIC, menupoin, 0, 0, 0, 0, "Browses existing choices or adds NEW");
- xco+= XIC;
-
- uiClearButLock();
-
- MEM_freeN(str);
- }
-
- uiBlockSetCol(block, oldcol);
-
- if(id) { /* text button with name */
-
- /* name */
- if(id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1);
- /* Pinned data ? */
- if (pin && *pinpoin) {
- uiBlockSetCol(block, TH_BUT_SETTING2);
- }
- /* Redalert overrides pin color */
- if(id->us<=0) uiBlockSetCol(block, TH_REDALERT);
-
- uiSetButLock(id->lib!=0, ERROR_LIBDATA_MESSAGE);
-
- if(GS(id->name)==ID_SCE) strcpy(str1, "SCE:");
- else if(GS(id->name)==ID_SCE) strcpy(str1, "SCR:");
- else if(GS(id->name)==ID_MA) {
- if( ((Material *)id)->use_nodes )
- strcpy(str1, "NT:");
- else
- strcpy(str1, "MA:");
- }
- else {
- str1[0]= id->name[0];
- str1[1]= id->name[1];
- str1[2]= ':';
- str1[3]= 0;
- }
-
- if( GS(id->name)==ID_IP) len= 110;
- else if((yco) && (GS(id->name)==ID_AC)) len= 100; // comes from button panel (poselib)
- else if(yco) len= 140; // comes from button panel
- else len= 120;
-
- but= uiDefBut(block, TEX, B_IDNAME, str1,xco, yco, (short)len, YIC, id->name+2, 0.0, 21.0, 0, 0, "Displays current Datablock name. Click to change.");
- uiButSetFunc(but, test_idbutton_cb, id->name, NULL);
-
- uiClearButLock();
-
- xco+= len;
-
- if(id->lib) {
-
- if(id->flag & LIB_INDIRECT) uiDefIconBut(block, BUT, 0, ICON_DATALIB,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Indirect Library Datablock. Cannot change.");
- else uiDefIconBut(block, BUT, lib, ICON_PARLIB, xco,yco,XIC,YIC, 0, 0, 0, 0, 0,
- lib?"Direct linked Library Datablock. Click to make local.":"Direct linked Library Datablock, cannot make local."
- );
-
- xco+= XIC;
- }
-
-
- if(users && id->us>1) {
- uiSetButLock (pin && *pinpoin, "Can't make pinned data single-user");
-
- sprintf(str1, "%d", id->us);
- if(id->us<10) {
-
- uiDefBut(block, BUT, users, str1, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
- xco+= XIC;
- }
- else {
- uiDefBut(block, BUT, users, str1, xco, yco, XIC+10, YIC, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
- xco+= XIC+10;
- }
-
- uiClearButLock();
-
- }
-
- if(del) {
- uiSetButLock (pin && *pinpoin, "Can't unlink pinned data");
- if(parid && parid->lib);
- else {
- uiDefIconBut(block, BUT, del, ICON_X, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Deletes link to this Datablock");
- xco+= XIC;
- }
-
- uiClearButLock();
- }
-
- if(autobut) {
- if(parid && parid->lib);
- else {
- uiDefIconBut(block, BUT, autobut, ICON_AUTO,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Generates an automatic name");
- xco+= XIC;
- }
-
-
- }
- if(keepbut) {
- uiDefButBitS(block, TOG, LIB_FAKEUSER, keepbut, "F", xco,yco,XIC,YIC, &id->flag, 0, 0, 0, 0, "Saves this datablock even if it has no users");
- xco+= XIC;
- }
- }
- else if(add_addbutton) { /* "add new" button */
- uiBlockSetCol(block, oldcol);
- if(parid) uiSetButLock(parid->lib!=0, ERROR_LIBDATA_MESSAGE);
- uiDefButS(block, TOG, browse, "Add New" ,xco, yco, 110, YIC, menupoin, (float)*menupoin, 32767.0, 0, 0, "Add new data block");
- xco+= 110;
- }
- //xco+=XIC;
-
- uiBlockSetCol(block, oldcol);
- uiBlockEndAlign(block);
-
- return xco;
-}
-
-
-/* results in fully updated anim system */
-static void do_update_for_newframe(int mute, int events)
-{
- extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */
-
- if(events) {
- allqueue(REDRAWALL, 0);
- }
-
- /* this function applies the changes too */
- scene_update_for_newframe(G.scene, screen_view3d_layers()); /* BKE_scene.h */
-
- if ( (CFRA>1) && (!mute) && (G.scene->audio.flag & AUDIO_SCRUB))
- audiostream_scrub( CFRA );
-
- /* 3d window, preview */
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
-
- /* all movie/sequence images */
- BIF_image_update_frame();
-
- /* composite */
- if(G.scene->use_nodes && G.scene->nodetree)
- ntreeCompositTagAnimated(G.scene->nodetree);
-
- /* update animated texture nodes */
- {
- Tex *tex;
- for(tex= G.main->tex.first; tex; tex= tex->id.next)
- if( tex->use_nodes && tex->nodetree ) {
- ntreeTexTagAnimated( tex->nodetree );
- }
- }
-}
-
-void update_for_newframe(void)
-{
- do_update_for_newframe(0, 1);
-}
-
-void update_for_newframe_muted(void)
-{
- do_update_for_newframe(1, 1);
-}
-
-/* used by new animated UI playback */
-void update_for_newframe_nodraw(int nosound)
-{
- do_update_for_newframe(nosound, 0);
-}
-
-
-static void show_splash(void)
-{
- extern char datatoc_splash_jpg[];
- extern int datatoc_splash_jpg_size;
- char *string = NULL;
-
-#ifdef NAN_BUILDINFO
- char buffer[1024];
- extern char * build_date;
- extern char * build_time;
- extern char * build_rev;
- extern char * build_platform;
- extern char * build_type;
-
- string = &buffer[0];
- sprintf(string,"Built on %s %s, Rev-%s Version %s %s", build_date, build_time, build_rev, build_platform, build_type);
-#endif
-
- splash((void *)datatoc_splash_jpg, datatoc_splash_jpg_size, string);
-}
-
-
-/* Functions for user preferences fileselect windows */
-
-/* yafray: export dir select */
-static void filesel_u_yfexportdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.yfexportdir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_fontdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.fontdir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_textudir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.textudir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_plugtexdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.plugtexdir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_plugseqdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.plugseqdir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_renderdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.renderdir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-#ifndef DISABLE_PYTHON
-static void filesel_u_pythondir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.pythondir, dir);
- allqueue(REDRAWALL, 0);
-
- /* act on the change */
- if (BPY_path_update()==0) {
- error("Invalid scripts dir: check console");
- }
-}
-#endif
-
-static void filesel_u_sounddir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.sounddir, dir);
- allqueue(REDRAWALL, 0);
-}
-
-static void filesel_u_tempdir(char *name)
-{
- char dir[FILE_MAXDIR], file[FILE_MAXFILE];
-
- BLI_cleanup_dir(G.sce, name);
- BLI_split_dirfile(name, dir, file);
-
- strcpy(U.tempdir, dir);
- BLI_where_is_temp( btempdir, 1 );
-
- allqueue(REDRAWALL, 0);
-}
-
-/* END Functions for user preferences fileselect windows */
-
-
-void do_global_buttons(unsigned short event)
-{
- ListBase *lb;
- Object *ob;
- Material *ma;
- MTex *mtex;
- Ipo *ipo;
- Lamp *la;
- World *wrld;
- bAction *act;
- ID *id, *idtest, *from=NULL;
- ScrArea *sa;
- Brush *br;
- int nr= 1;
-
-#ifdef INTERNATIONAL
- char buf[FILE_MAX];
-#endif
-
- ob= OBACT;
-
- id= NULL; /* id at null for texbrowse */
-
-
- switch(event) {
-
- case B_NEWFRAME:
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
-
- update_for_newframe();
- break;
- case B_REDR:
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- break;
- case B_REDRCURW3D:
- allqueue(REDRAWVIEW3D, 0);
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- break;
- case B_EDITBROWSE:
- if(ob==NULL) return;
- if(ob->id.lib) return;
- id= ob->data;
- if(id==NULL) return;
-
- if(G.buts->menunr== -2) {
- activate_databrowse((ID *)G.buts->lockpoin, GS(id->name), 0, B_EDITBROWSE, &G.buts->menunr, do_global_buttons);
- return;
- }
- if(G.buts->menunr < 0) return;
-
- lb= wich_libbase(G.main, GS(id->name));
- idtest= lb->first;
- while(idtest) {
- if(nr==G.buts->menunr) {
- if(idtest!=id) {
- id->us--;
- id_us_plus(idtest);
-
- ob->data= idtest;
-
- test_object_materials(idtest);
-
- if( GS(idtest->name)==ID_CU ) {
- test_curve_type(ob);
- }
- else if( ob->type==OB_ARMATURE) {
- armature_rebuild_pose(ob, ob->data);
- }
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION,0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNLA,0);
- }
- break;
- }
- nr++;
- idtest= idtest->next;
- }
-
- break;
- case B_MESHBROWSE:
- if(ob==0) return;
- if(ob->id.lib) return;
-
- id= ob->data;
- if(id==0) id= G.main->mesh.first;
- if(id==0) return;
-
- if(G.buts->menunr== -2) {
- activate_databrowse((ID *)G.buts->lockpoin, GS(id->name), 0, B_MESHBROWSE, &G.buts->menunr, do_global_buttons);
- return;
- }
- if(G.buts->menunr < 0) return;
-
-
- idtest= G.main->mesh.first;
- while(idtest) {
- if(nr==G.buts->menunr) {
- set_mesh(ob, (Mesh *)idtest);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- BIF_undo_push("Browse Mesh");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION,0);
- allqueue(REDRAWIPO, 0);
-
- break;
- }
- nr++;
- idtest= idtest->next;
- }
-
- break;
- case B_MATBROWSE:
- {
- void *lockpoin= NULL;
- short *menunr= 0;
-
- /* this is called now from Node editor too, buttons might not exist */
- if(curarea->spacetype==SPACE_NODE) {
- SpaceNode *snode= curarea->spacedata.first;
- menunr= &snode->menunr;
- lockpoin= snode->id;
- }
- else if(G.buts) {
- menunr= &G.buts->menunr;
- lockpoin= G.buts->lockpoin;
- }
- else return;
-
- if(*menunr== -2) {
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel((ID *)lockpoin, ID_MA, 0, B_MATBROWSE, menunr, do_global_buttons);
- }
- else {
- activate_databrowse((ID *)lockpoin, ID_MA, 0, B_MATBROWSE, menunr, do_global_buttons);
- }
- return;
- }
-
- if(*menunr < 0) return;
-
- if(0) { /* future pin */
-
- }
- else {
-
- ma= give_current_material(ob, ob->actcol);
- nr= 1;
-
- id= (ID *)ma;
-
- idtest= G.main->mat.first;
- while(idtest) {
- if(nr== *menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new mat */
- if(id) idtest= (ID *)copy_material((Material *)id);
- else {
- idtest= (ID *)add_material("Material");
- }
- idtest->us--;
- }
- if(idtest!=id) {
- assign_material(ob, (Material *)idtest, ob->actcol);
-
- BIF_undo_push("Browse Material");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWNODE, 0);
- BIF_preview_changed(ID_MA);
- }
-
- }
- }
- break;
- case B_MATDELETE:
- if(0) { /* future pin */
-
- }
- else {
- ma= give_current_material(ob, ob->actcol);
- if(ma) {
- assign_material(ob, 0, ob->actcol);
- BIF_undo_push("Unlink Material");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
- BIF_preview_changed(ID_MA);
- }
- }
- break;
- case B_TEXDELETE:
- if(G.buts->pin) {
-
- }
- else {
- if(G.buts->texfrom==0) { /* from mat */
- ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- if(ma) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- ma->mtex[ ma->texact ]= NULL;
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- BIF_preview_changed(ID_MA);
- }
- }
- }
- else if(G.buts->texfrom==1) { /* from world */
- wrld= G.scene->world;
- if(wrld) {
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- wrld->mtex[ wrld->texact ]= NULL;
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- BIF_preview_changed(ID_WO);
- }
- }
- }
- else if(G.buts->texfrom==2) { /* from lamp */
- la= ob->data;
- if(la && ob->type==OB_LAMP) { /* to be sure */
- mtex= la->mtex[ la->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- la->mtex[ la->texact ]= NULL;
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- BIF_preview_changed(ID_LA);
- }
- }
- }
- else { /* from brush */
- br= G.scene->toolsettings->imapaint.brush;
- if(G.f & G_SCULPTMODE) {
- sculptmode_rem_tex(NULL, NULL);
- allqueue(REDRAWBUTSSHADING, 0);
- } else if(br) {
- mtex= br->mtex[ br->texact ];
- if(mtex) {
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- br->mtex[ br->texact ]= NULL;
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWIPO, 0);
- /*BIF_preview_changed(ID_BR);*/
- }
- }
- }
- BIF_undo_push("Unlink Texture");
- }
- break;
- case B_EXTEXBROWSE:
- case B_TEXBROWSE:
- {
- void *lockpoin = NULL;
- short *menunr = 0;
-
- /* this is called now from Node editor too, buttons might not exist */
- if(curarea->spacetype==SPACE_NODE) {
- SpaceNode *snode = curarea->spacedata.first;
- menunr = &snode->menunr;
- lockpoin = snode->id;
- }
- else if(G.buts) {
- menunr = &G.buts->texnr;
- lockpoin = G.buts->lockpoin;
- }
- else return;
-
- if(*menunr == -2) {
-
- id= lockpoin;
- if(event==B_EXTEXBROWSE) {
- id= NULL;
- ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- if(ma) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex) id= (ID *)mtex->tex;
- }
- }
- if(G.qual & LR_CTRLKEY) {
- activate_databrowse_imasel((ID*)lockpoin, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons);
- }
- else {
- activate_databrowse((ID*)lockpoin, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons);
- }
- return;
- }
- if(*menunr < 0) break;
-
- if(G.buts && G.buts->pin) {
-
- }
- else {
- id= NULL;
-
- ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- if(ma) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex) id= (ID *)mtex->tex;
- }
-
- idtest= G.main->tex.first;
- while(idtest) {
- if(nr==*menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new tex */
- if(id) idtest= (ID *)copy_texture((Tex *)id);
- else idtest= (ID *)add_texture("Tex");
- idtest->us--;
- }
- if(idtest!=id && ma) {
-
- if( ma->mtex[ma->texact]==0) ma->mtex[ma->texact]= add_mtex();
-
- ma->mtex[ ma->texact ]->tex= (Tex *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Browse Texture");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNODE, 0);
- BIF_preview_changed(ID_MA);
- }
- }
- break;
- }
- case B_ACTIONDELETE:
- /* only available when not pinned */
- if (G.saction->pin == 0) {
- act= ob->action;
-
- /* decrement user-count of action (as ob no longer uses it) */
- if (act)
- act->id.us--;
-
- /* make sure object doesn't hold reference to it anymore */
- ob->action=NULL;
- if (ob->pose) { /* clear flag (POSE_LOC/ROT/SIZE), also used for draw colors */
- bPoseChannel *pchan;
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next)
- pchan->flag= 0;
- }
-
- BIF_undo_push("Unlink Action");
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case B_ACTIONBROWSE:
- if (!ob)
- break;
- act=ob->action;
- id= (ID *)act;
-
- if (G.saction->actnr== -2){
- activate_databrowse((ID *)G.saction->action, ID_AC, 0, B_ACTIONBROWSE, &G.saction->actnr, do_global_buttons);
- return;
- }
-
- if (G.saction->actnr < 0) break;
-
- /* See if we have selected a valid action */
- for (idtest= G.main->action.first; idtest; idtest= idtest->next) {
- if (nr==G.saction->actnr)
- break;
- nr++;
- }
-
- if (G.saction->pin) {
- if (idtest == NULL) {
- /* assign new/copy of pinned action only - messy as it doesn't assign to any obj's */
- if (G.saction->action)
- G.saction->action= (bAction *)copy_action(G.saction->action);
- else
- G.saction->action= (bAction *)add_empty_action("PinnedAction");
- }
- else {
- G.saction->action= (bAction *)idtest;
- }
- allqueue(REDRAWACTION, 0);
- }
- else {
- /* Store current action */
- if (idtest == NULL) {
- /* 'Add New' option:
- * - make a copy of an exisiting action
- * - or make a new empty action if no existing action
- */
- if (act) {
- idtest= (ID *)copy_action(act);
- }
- else {
- if ((ob->ipo) && (ob->ipoflag & OB_ACTION_OB)==0) {
- /* object ipo - like if B_IPO_ACTION_OB is triggered */
- bActionChannel *achan;
-
- if (has_ipo_code(ob->ipo, OB_LAY))
- notice("Note: Layer Ipo doesn't work in Actions");
-
- ob->ipoflag |= OB_ACTION_OB;
-
- act = add_empty_action("ObAction");
- idtest=(ID *)act;
-
-
- achan= verify_action_channel(act, "Object");
- achan->flag = (ACHAN_HILIGHTED|ACHAN_SELECTED|ACHAN_EXPANDED|ACHAN_SHOWIPO);
-
- if (achan->ipo==NULL) {
- achan->ipo= ob->ipo;
- ob->ipo= NULL;
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- }
-
- /* object constraints */
- if (ob->constraintChannels.first) {
- free_constraint_channels(&achan->constraintChannels);
- achan->constraintChannels= ob->constraintChannels;
- ob->constraintChannels.first= ob->constraintChannels.last= NULL;
- }
- }
- else if (ELEM(ob->type, OB_MESH, OB_LATTICE) && ob_get_key(ob)) {
- /* shapekey - like if B_IPO_ACTION_KEY is triggered */
- bActionChannel *achan;
- Key *key= ob_get_key(ob);
-
- ob->ipoflag |= OB_ACTION_KEY;
-
- act = add_empty_action("ShapeAction");
- idtest=(ID *)act;
-
- achan= verify_action_channel(act, "Shape");
- achan->flag = (ACHAN_HILIGHTED|ACHAN_SELECTED|ACHAN_EXPANDED|ACHAN_SHOWIPO);
-
- if ((achan->ipo==NULL) && (key->ipo)) {
- achan->ipo= key->ipo;
- key->ipo= NULL;
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- }
- }
- else {
- /* a plain action */
- idtest=(ID *)add_empty_action("Action");
- }
- }
- idtest->us--;
- }
-
-
- if ((idtest!=id) && (ob)) {
- act= (bAction *)idtest;
-
- ob->action= act;
- id_us_plus(idtest);
-
- if (id) id->us--;
-
- /* Update everything */
- BIF_undo_push("Browse Action");
- do_global_buttons (B_NEWFRAME);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
-
- break;
- case B_IPOBROWSE:
-
- ipo= G.sipo->ipo;
- from= G.sipo->from;
- id= (ID *)ipo;
- if(from==NULL) return;
-
- if(G.sipo->menunr== -2) {
- activate_databrowse((ID *)G.sipo->ipo, ID_IP, G.sipo->blocktype, B_IPOBROWSE, &G.sipo->menunr, do_global_buttons);
- return;
- }
-
- if(G.sipo->menunr < 0) break;
-
- idtest= G.main->ipo.first;
- while(idtest) {
- if( ((Ipo *)idtest)->blocktype == G.sipo->blocktype) {
- if(nr==G.sipo->menunr) {
- break;
- }
- nr++;
- }
- idtest= idtest->next;
- }
-
- if(G.sipo->pin) {
- if(idtest) {
- G.sipo->ipo= (Ipo *)idtest;
- allspace(REMAKEIPO, 0); // in fact it should only do this one, but there is no function for it
- }
- }
- else {
- // assign the ipo to ...
-
- if(idtest==0) {
- if(ipo) idtest= (ID *)copy_ipo(ipo);
- else {
- nr= G.sipo->blocktype;
- if(nr==ID_OB) idtest= (ID *)add_ipo("ObIpo", ID_OB);
- else if(nr==ID_CO) idtest= (ID *)add_ipo("CoIpo", ID_CO);
- else if(nr==ID_PO) idtest= (ID *)add_ipo("ActIpo", nr);
- else if(nr==ID_MA) idtest= (ID *)add_ipo("MatIpo", nr);
- else if(nr==ID_TE) idtest= (ID *)add_ipo("TexIpo", nr);
- else if(nr==ID_SEQ) idtest= (ID *)add_ipo("MatSeq", nr);
- else if(nr==ID_CU) idtest= (ID *)add_ipo("CuIpo", nr);
- else if(nr==ID_KE) idtest= (ID *)add_ipo("KeyIpo", nr);
- else if(nr==ID_WO) idtest= (ID *)add_ipo("WoIpo", nr);
- else if(nr==ID_LA) idtest= (ID *)add_ipo("LaIpo", nr);
- else if(nr==ID_CA) idtest= (ID *)add_ipo("CaIpo", nr);
- else if(nr==ID_SO) idtest= (ID *)add_ipo("SndIpo", nr);
- else if(nr==ID_FLUIDSIM) idtest= (ID *)add_ipo("FluidsimIpo", nr);
- else if(nr==ID_PA) idtest= (ID *)add_ipo("PaIpo", nr);
- else error("Warn bugtracker!");
- }
- idtest->us--;
- }
- if(idtest!=id && from) {
- spaceipo_assign_ipo(G.sipo, (Ipo *)idtest);
-
- BIF_undo_push("Browse Ipo");
- }
- }
- break;
- case B_IPODELETE:
- ipo= G.sipo->ipo;
- from= G.sipo->from;
-
- spaceipo_assign_ipo(G.sipo, NULL);
-
- editipo_changed(G.sipo, 1); /* doredraw */
-
- BIF_undo_push("Unlink Ipo");
-
- break;
- case B_WORLDBROWSE:
-
- if(G.buts->menunr==-2) {
- activate_databrowse((ID *)G.scene->world, ID_WO, 0, B_WORLDBROWSE, &G.buts->menunr, do_global_buttons);
- break;
- }
-
- if(G.buts->menunr < 0) break;
- /* no lock */
-
- wrld= G.scene->world;
- nr= 1;
-
- id= (ID *)wrld;
-
- idtest= G.main->world.first;
- while(idtest) {
- if(nr==G.buts->menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new world */
- if(id) idtest= (ID *)copy_world((World *)id);
- else idtest= (ID *)add_world("World");
- idtest->us--;
- }
- if(idtest!=id) {
- G.scene->world= (World *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Browse World");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_WO);
- }
- break;
- case B_WORLDDELETE:
- if(G.scene->world) {
- G.scene->world->id.us--;
- G.scene->world= NULL;
-
- BIF_undo_push("Unlink World");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- }
-
- break;
- case B_WTEXBROWSE:
-
- if(G.buts->texnr== -2) {
- id= NULL;
- wrld= G.scene->world;
- if(wrld) {
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex) id= (ID *)mtex->tex;
- }
-
- activate_databrowse((ID *)id, ID_TE, 0, B_WTEXBROWSE, &G.buts->texnr, do_global_buttons);
- return;
- }
- if(G.buts->texnr < 0) break;
-
- if(G.buts->pin) {
-
- }
- else {
- id= NULL;
-
- wrld= G.scene->world;
- if(wrld) {
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex) id= (ID *)mtex->tex;
- }
-
- idtest= G.main->tex.first;
- while(idtest) {
- if(nr==G.buts->texnr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new tex */
- if(id) idtest= (ID *)copy_texture((Tex *)id);
- else idtest= (ID *)add_texture("Tex");
- idtest->us--;
- }
- if(idtest!=id && wrld) {
-
- if( wrld->mtex[wrld->texact]==0) {
- wrld->mtex[wrld->texact]= add_mtex();
- wrld->mtex[wrld->texact]->texco= TEXCO_VIEW;
- }
- wrld->mtex[ wrld->texact ]->tex= (Tex *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Texture browse");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_WO);
- }
- }
- break;
- case B_LAMPBROWSE:
- /* no lock */
- if(ob==0) return;
- if(ob->type!=OB_LAMP) return;
-
- if(G.buts->menunr== -2) {
- activate_databrowse((ID *)G.buts->lockpoin, ID_LA, 0, B_LAMPBROWSE, &G.buts->menunr, do_global_buttons);
- return;
- }
- if(G.buts->menunr < 0) break;
-
- la= ob->data;
- nr= 1;
- id= (ID *)la;
-
- idtest= G.main->lamp.first;
- while(idtest) {
- if(nr==G.buts->menunr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* no new lamp */
- return;
- }
- if(idtest!=id) {
- ob->data= (Lamp *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Lamp browse");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_LA);
- }
- break;
-
- case B_LTEXBROWSE:
-
- if(ob==0) return;
- if(ob->type!=OB_LAMP) return;
-
- if(G.buts->texnr== -2) {
- id= NULL;
- la= ob->data;
- mtex= la->mtex[ la->texact ];
- if(mtex) id= (ID *)mtex->tex;
-
- activate_databrowse(id, ID_TE, 0, B_LTEXBROWSE, &G.buts->texnr, do_global_buttons);
- return;
- }
- if(G.buts->texnr < 0) break;
-
- if(G.buts->pin) {
-
- }
- else {
- id= NULL;
-
- la= ob->data;
- mtex= la->mtex[ la->texact ];
- if(mtex) id= (ID *)mtex->tex;
-
- idtest= G.main->tex.first;
- while(idtest) {
- if(nr==G.buts->texnr) {
- break;
- }
- nr++;
- idtest= idtest->next;
- }
- if(idtest==0) { /* new tex */
- if(id) idtest= (ID *)copy_texture((Tex *)id);
- else idtest= (ID *)add_texture("Tex");
- idtest->us--;
- }
- if(idtest!=id && la) {
-
- if( la->mtex[la->texact]==0) {
- la->mtex[la->texact]= add_mtex();
- la->mtex[la->texact]->texco= TEXCO_GLOB;
- }
- la->mtex[ la->texact ]->tex= (Tex *)idtest;
- id_us_plus(idtest);
- if(id) id->us--;
-
- BIF_undo_push("Texture Browse");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_preview_changed(ID_LA);
- }
- }
- break;
-
- case B_IMAGEDELETE:
- if(G.sima->image && (G.sima->image->type == IMA_TYPE_R_RESULT || G.sima->image->type == IMA_TYPE_COMPOSITE)) {
- /* Run if G.sima is render, remove the render and display the meshes image if it exists */
- G.sima->image= NULL;
- what_image(G.sima);
- allqueue(REDRAWIMAGE, 0);
- } else {
- /* Run on non render images, unlink normally */
- image_changed(G.sima, NULL);
- BIF_undo_push("Unlink Image");
- allqueue(REDRAWIMAGE, 0);
- }
- break;
-
- case B_AUTOMATNAME:
- /* this is called now from Node editor too, buttons might not exist */
- if(curarea->spacetype==SPACE_NODE) {
- SpaceNode *snode= curarea->spacedata.first;
- automatname((Material *)snode->id);
- }
- else if(G.buts) {
- automatname(G.buts->lockpoin);
- }
- else return;
-
- BIF_undo_push("Auto name");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWOOPS, 0);
- break;
- case B_AUTOTEXNAME:
- if(G.buts->mainb==CONTEXT_SHADING) {
- if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX) {
- autotexname(G.buts->lockpoin);
- }
- else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT) {
- ma= G.buts->lockpoin;
- if(ma->mtex[ ma->texact]) autotexname(ma->mtex[ma->texact]->tex);
- }
- else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD) {
- wrld= G.buts->lockpoin;
- if(wrld->mtex[ wrld->texact]) autotexname(wrld->mtex[wrld->texact]->tex);
- }
- else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP) {
- la= G.buts->lockpoin;
- if(la->mtex[ la->texact]) autotexname(la->mtex[la->texact]->tex);
- }
- BIF_undo_push("Auto name");
- allqueue(REDRAWBUTSSHADING, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- else if(G.buts->mainb==CONTEXT_EDITING) {
- SculptData *sd= &G.scene->sculptdata;
- if(sd && sd->texact != -1) {
- if(sd->mtex[sd->texact]) autotexname(sd->mtex[sd->texact]->tex);
-
- BIF_undo_push("Auto name");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- }
- break;
-
- case B_RESETAUTOSAVE:
- reset_autosave();
- allqueue(REDRAWINFO, 0);
- break;
- case B_SOUNDTOGGLE:
- SYS_WriteCommandLineInt(SYS_GetSystem(), "noaudio", (U.gameflags & USER_DISABLE_SOUND));
- break;
- case B_SHOWSPLASH:
- show_splash();
- break;
- case B_MIPMAPCHANGED:
- GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_GLRESLIMITCHANGED:
- GPU_free_images(); /* force reloading with new res limit */
- allqueue(REDRAWVIEW3D, 0);
- break;
- case B_NEWSPACE:
- newspace(curarea, curarea->butspacetype);
- reset_filespace(curarea);
- reset_imaselspace(curarea);
- break;
- case B_LOADTEMP: /* is button from space.c */
- BIF_read_autosavefile();
- break;
-
- case B_USERPREF:
- allqueue(REDRAWINFO, 0);
- break;
-
- case B_DRAWINFO: /* is button from space.c *info* */
- allqueue(REDRAWVIEW3D, 0);
- break;
-
- case B_PLAINMENUS: /* is button from space.c *info* */
- reset_toolbox();
- break;
-
- case B_FLIPINFOMENU: /* is button from space.c *info* */
- scrarea_queue_headredraw(curarea);
- break;
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
- case B_FLIPFULLSCREEN:
- if(U.uiflag & USER_FLIPFULLSCREEN)
- U.uiflag &= ~USER_FLIPFULLSCREEN;
- else
- U.uiflag |= USER_FLIPFULLSCREEN;
- mainwindow_toggle_fullscreen((U.uiflag & USER_FLIPFULLSCREEN));
- break;
-#endif
-
- /* Fileselect windows for user preferences file paths */
-
- /* yafray: xml export dir. select */
- case B_YAFRAYDIRFILESEL: /* space.c */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT YFEXPORT PATH", U.yfexportdir, filesel_u_yfexportdir);
- break;
-
- case B_FONTDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT FONT PATH", U.fontdir, filesel_u_fontdir);
- break;
-
- case B_TEXTUDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT TEXTURE PATH", U.textudir, filesel_u_textudir);
- break;
-
- case B_PLUGTEXDIRFILESEL: /* is button form space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT TEX PLUGIN PATH", U.plugtexdir, filesel_u_plugtexdir);
- break;
-
- case B_PLUGSEQDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT SEQ PLUGIN PATH", U.plugseqdir, filesel_u_plugseqdir);
- break;
-
- case B_RENDERDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT RENDER PATH", U.renderdir, filesel_u_renderdir);
- break;
-#ifndef DISABLE_PYTHON
- case B_PYMENUEVAL: /* is button from space.c *info* */
- waitcursor( 1 ); /* can take some time */
- if (BPY_path_update() == 0) { /* re-eval scripts registration in menus */
- waitcursor( 0 );
- error("Invalid scripts dir: check console");
- }
- waitcursor( 0 );
- break;
- case B_PYTHONDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT SCRIPT PATH", U.pythondir, filesel_u_pythondir);
- break;
-#endif
- case B_SOUNDDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT SOUND PATH", U.sounddir, filesel_u_sounddir);
- break;
-
- case B_TEMPDIRFILESEL: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_SPECIAL, "SELECT TEMP FILE PATH", U.tempdir, filesel_u_tempdir);
- break;
-
- /* END Fileselect windows for user preferences file paths */
-
-#ifdef INTERNATIONAL
- case B_LOADUIFONT: /* is button from space.c *info* */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
- BLI_make_file_string("/", buf, U.fontdir, U.fontname);
- activate_fileselect(FILE_SPECIAL, "LOAD UI FONT", buf, set_interface_font);
- break;
-
- case B_SETLANGUAGE: /* is button from space.c *info* */
- lang_setlanguage();
- allqueue(REDRAWALL, 0);
- break;
-
- case B_SETFONTSIZE: /* is button from space.c *info* */
- refresh_interface_font();
- FTF_SetSize(U.fontsize);
- allqueue(REDRAWALL, 0);
- break;
-
- case B_SETTRANSBUTS: /* is button from space.c *info* */
- allqueue(REDRAWALL, 0);
- break;
-
- case B_RESTOREFONT: /* is button from space.c *info* */
- U.fontsize= 0;
- start_interface_font();
- allqueue(REDRAWALL, 0);
- break;
-
- case B_USETEXTUREFONT: /* is button from space.c *info* */
- refresh_interface_font();
- allqueue(REDRAWALL, 0);
- break;
-
- case B_DOLANGUIFONT: /* is button from space.c *info* */
- if(U.transopts & USER_DOTRANSLATE)
- start_interface_font();
- else
- G.ui_international = FALSE;
- allqueue(REDRAWALL, 0);
- break;
-#endif
-
- case B_FULL:
- if(curarea->spacetype!=SPACE_INFO) {
- area_fullscreen();
- }
- break;
-
- case B_IDNAME:
- /* changing a metaballs name, sadly enough,
- * can require it to be updated because its
- * basis might have changed... -zr
- */
- if (ob && ob->type==OB_MBALL) {
- DAG_scene_sort(G.scene);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- /* redraw because name has changed: new pup */
- scrarea_queue_headredraw(curarea);
- allqueue(REDRAWINFO, 1);
- allqueue(REDRAWOOPS, 1);
- allqueue(REDRAWACTION, 1);
- allqueue(REDRAWNLA, 1);
- allqueue(REDRAWVIEW3D, 1);
- /* name scene also in set PUPmenu */
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWHEADERS, 0);
- break;
-
- case B_KEEPDATA:
- /* keep datablock. similar to pressing FKEY in a fileselect window
- * maybe we can move that stuff to a seperate function? -- sg
- */
- if (curarea->spacetype==SPACE_BUTS) {
- id= (ID *)G.buts->lockpoin;
- } else if(curarea->spacetype==SPACE_IPO) {
- id = (ID *)G.sipo->ipo;
- } else if(curarea->spacetype==SPACE_NODE) {
- id = ((SpaceNode *)curarea->spacedata.first)->id;
- } else if(curarea->spacetype==SPACE_ACTION) {
- id= (ID *)G.saction->action;
- }/* similar for other spacetypes ? */
- if (id) {
- /* flag was already toggled, just need to update user count */
- if(id->flag & LIB_FAKEUSER)
- id->us++;
- else
- id->us--;
- }
- allqueue(REDRAWHEADERS, 0);
-
- break;
-
- }
-}
-
-
-void do_global_buttons2(short event)
-{
- Base *base;
- Object *ob;
- Material *ma;
- MTex *mtex;
- Mesh *me;
- Curve *cu;
- MetaBall *mb;
- Ipo *ipo;
- Lamp *la;
- Lattice *lt;
- World *wrld;
- ID *idfrom;
- bAction *act;
- Brush *br;
-
- /* general: Single User is allowed when from==LOCAL
- * Make Local is allowed when (from==LOCAL && id==LIB)
- */
-
- if(event<B_LOCAL_ALONE) return;
-
- ob= OBACT;
-
- switch(event) {
-
- case B_LAMPALONE:
- if(ob && ob->id.lib==0) {
- la= ob->data;
- if(la->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_lamp(la);
- la->id.us--;
- }
- }
- }
- break;
- case B_LAMPLOCAL:
- if(ob && ob->id.lib==0) {
- la= ob->data;
- if(la->id.lib) {
- if(okee("Make local")) {
- make_local_lamp(la);
- }
- }
- }
- break;
-
- case B_ARMLOCAL:
- if (ob&&ob->id.lib==0){
- bArmature *arm=ob->data;
- if (arm->id.lib){
- if(okee("Make local")) {
- make_local_armature(arm);
- }
- }
- }
- break;
- case B_ARMALONE:
- if(ob && ob->id.lib==0) {
- bArmature *arm=ob->data;
- if(arm->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_armature(arm);
- armature_rebuild_pose(ob, ob->data);
- arm->id.us--;
- }
- }
- }
- break;
- case B_ACTLOCAL:
- if(ob && ob->id.lib==0) {
- act= ob->action;
- if(act->id.lib) {
- if(okee("Make local")) {
- make_local_action(act);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- }
- break;
- case B_ACTALONE:
- if(ob && ob->id.lib==0) {
- act= ob->action;
-
- if(act->id.us>1) {
- if(okee("Single user")) {
- ob->action=copy_action(act);
- act->id.us--;
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- }
- break;
-
- case B_CAMERAALONE:
- if(ob && ob->id.lib==0) {
- Camera *ca= ob->data;
- if(ca->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_camera(ca);
- ca->id.us--;
- }
- }
- }
- break;
- case B_CAMERALOCAL:
- if(ob && ob->id.lib==0) {
- Camera *ca= ob->data;
- if(ca->id.lib) {
- if(okee("Make local")) {
- make_local_camera(ca);
- }
- }
- }
- break;
- case B_WORLDALONE:
- wrld= G.scene->world;
- if(wrld->id.us>1) {
- if(okee("Single user")) {
- G.scene->world= copy_world(wrld);
- wrld->id.us--;
- }
- }
- break;
- case B_WORLDLOCAL:
- wrld= G.scene->world;
- if(wrld && wrld->id.lib) {
- if(okee("Make local")) {
- make_local_world(wrld);
- }
- }
- break;
-
- case B_LATTALONE:
- if(ob && ob->id.lib==0) {
- lt= ob->data;
- if(lt->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_lattice(lt);
- lt->id.us--;
- }
- }
- }
- break;
- case B_LATTLOCAL:
- if(ob && ob->id.lib==0) {
- lt= ob->data;
- if(lt->id.lib) {
- if(okee("Make local")) {
- make_local_lattice(lt);
- }
- }
- }
- break;
-
- case B_MATALONE:
- if(ob==0) return;
- ma= give_current_material(ob, ob->actcol);
- idfrom= material_from(ob, ob->actcol);
- if(idfrom && idfrom->lib==0) {
- if(ma->id.us>1) {
- if(okee("Single user")) {
- ma= copy_material(ma);
- ma->id.us= 0;
- assign_material(ob, ma, ob->actcol);
- }
- }
- }
- break;
- case B_MATLOCAL:
- if(ob==0) return;
- idfrom= material_from(ob, ob->actcol);
- if(idfrom->lib==0) {
- ma= give_current_material(ob, ob->actcol);
- if(ma && ma->id.lib) {
- if(okee("Make local")) {
- make_local_material(ma);
- }
- }
- }
- break;
-
- case B_MESHLOCAL:
- if(ob && ob->id.lib==0) {
- me= ob->data;
- if(me && me->id.lib) {
- if(okee("Make local")) {
- make_local_mesh(me);
- make_local_key( me->key );
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
- break;
-
- case B_MBALLALONE:
- if(ob && ob->id.lib==0) {
- mb= ob->data;
- if(mb->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_mball(mb);
- mb->id.us--;
- if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
- break;
- case B_MBALLLOCAL:
- if(ob && ob->id.lib==0) {
- mb= ob->data;
- if(mb->id.lib) {
- if(okee("Make local")) {
- make_local_mball(mb);
- }
- }
- }
- break;
-
- case B_CURVEALONE:
- if(ob && ob->id.lib==0) {
- cu= ob->data;
- if(cu->id.us>1) {
- if(okee("Single user")) {
- ob->data= copy_curve(cu);
- cu->id.us--;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
- break;
- case B_CURVELOCAL:
- if(ob && ob->id.lib==0) {
- cu= ob->data;
- if(cu->id.lib) {
- if(okee("Make local")) {
- make_local_curve(cu);
- make_local_key( cu->key );
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- }
- break;
-
- case B_TEXALONE:
- if(G.buts->texfrom==0) { /* from mat */
- if(ob==0) return;
- ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- if(ma && ma->id.lib==0) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex->tex && mtex->tex->id.us>1) {
- if(okee("Single user")) {
- mtex->tex->id.us--;
- mtex->tex= copy_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==1) { /* from world */
- wrld= G.scene->world;
- if(wrld->id.lib==0) {
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex->tex && mtex->tex->id.us>1) {
- if(okee("Single user")) {
- mtex->tex->id.us--;
- mtex->tex= copy_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==2) { /* from lamp */
- if(ob==0 || ob->type!=OB_LAMP) return;
- la= ob->data;
- if(la->id.lib==0) {
- mtex= la->mtex[ la->texact ];
- if(mtex->tex && mtex->tex->id.us>1) {
- if(okee("Single user")) {
- mtex->tex->id.us--;
- mtex->tex= copy_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==3) { /* from brush */
- br= G.scene->toolsettings->imapaint.brush;
- if(br==0) return;
- if(br->id.lib==0) {
- mtex= br->mtex[ br->texact ];
- if(mtex->tex && mtex->tex->id.us>1) {
- if(okee("Single user")) {
- mtex->tex->id.us--;
- mtex->tex= copy_texture(mtex->tex);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- }
- }
- break;
- case B_TEXLOCAL:
- if(G.buts->texfrom==0) { /* from mat */
- if(ob==0) return;
- ma= give_current_material(ob, ob->actcol);
- ma= editnode_get_active_material(ma);
- if(ma && ma->id.lib==0) {
- mtex= ma->mtex[ ma->texact ];
- if(mtex->tex && mtex->tex->id.lib) {
- if(okee("Make local")) {
- make_local_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==1) { /* from world */
- wrld= G.scene->world;
- if(wrld->id.lib==0) {
- mtex= wrld->mtex[ wrld->texact ];
- if(mtex->tex && mtex->tex->id.lib) {
- if(okee("Make local")) {
- make_local_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==2) { /* from lamp */
- if(ob==0 || ob->type!=OB_LAMP) return;
- la= ob->data;
- if(la->id.lib==0) {
- mtex= la->mtex[ la->texact ];
- if(mtex->tex && mtex->tex->id.lib) {
- if(okee("Make local")) {
- make_local_texture(mtex->tex);
- }
- }
- }
- }
- else if(G.buts->texfrom==3) { /* from brush */
- br= G.scene->toolsettings->imapaint.brush;
- if(br==0) return;
- if(br->id.lib==0) {
- mtex= br->mtex[ br->texact ];
- if(mtex->tex && mtex->tex->id.lib) {
- if(okee("Make local")) {
- make_local_texture(mtex->tex);
- allqueue(REDRAWIMAGE, 0);
- }
- }
- }
- }
- break;
-
- case B_IPOALONE:
- ipo= G.sipo->ipo;
- idfrom= G.sipo->from;
-
- if(idfrom && idfrom->lib==NULL) {
- if(ipo->id.us>1) {
- if(okee("Single user")) {
- ipo= copy_ipo(ipo);
- ipo->id.us= 0; /* assign_ipo adds users, copy_ipo sets to 1 */
- spaceipo_assign_ipo(G.sipo, ipo);
- allqueue(REDRAWIPO, 0);
- }
- }
- }
- break;
- case B_IPOLOCAL:
- ipo= G.sipo->ipo;
- idfrom= G.sipo->from;
-
- if(idfrom && idfrom->lib==0) {
- if(ipo->id.lib) {
- if(okee("Make local")) {
- make_local_ipo(ipo);
- allqueue(REDRAWIPO, 0);
- }
- }
- }
- break;
-
- case B_OBALONE:
- if(G.scene->id.lib==0) {
- if(ob->id.us>1) {
- if(okee("Single user")) {
- base= FIRSTBASE;
- while(base) {
- if(base->object==ob) {
- base->object= copy_object(ob);
- ob->id.us--;
- allqueue(REDRAWVIEW3D, 0);
- break;
- }
- base= base->next;
- }
- }
- }
- }
- break;
- case B_OBLOCAL:
- if(G.scene->id.lib==0) {
- if(ob->id.lib) {
- if(okee("Make local")) {
- make_local_object(ob);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
- break;
- case B_MESHALONE:
- if(ob && ob->id.lib==0) {
-
- me= ob->data;
-
- if(me && me->id.us>1) {
- if(okee("Single user")) {
- Mesh *men= copy_mesh(me);
- men->id.us= 0;
-
- set_mesh(ob, men);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
- break;
- }
-
- BIF_undo_push("Make single user or local");
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWOOPS, 0);
-}
-
-/* ******************** GENERAL ********************** */
-
-void do_headerbuttons(short event)
-{
-
- if(event<=50) do_global_buttons2(event);
- else if(event<=100) do_global_buttons(event);
- else if(event<200) do_view3d_buttons(event);
- else if(event<250) do_ipo_buttons(event);
- else if(event<300) do_oops_buttons(event);
- else if(event<350) do_info_buttons(event);
- else if(event<400) do_image_buttons(event);
- else if(event<450) do_buts_buttons(event);
- else if(event<500) do_imasel_buttons(event);
- else if(event<525) do_text_buttons(event);
- else if(event<550) do_script_buttons(event);
- else if(event<600) do_file_buttons(event);
- else if(event<650) do_seq_buttons(event);
- else if(event<700) do_sound_buttons(event);
- else if(event<750) do_action_buttons(event);
- else if(event<800) do_time_buttons(curarea, event);
- else if(event<850) do_nla_buttons(event);
- else if(event<900) do_node_buttons(curarea, event);
- else if(event>=REDRAWVIEW3D) allqueue(event, 0);
-}
-
diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c
deleted file mode 100644
index 149dbf1d026..00000000000
--- a/source/blender/src/imagepaint.c
+++ /dev/null
@@ -1,929 +0,0 @@
-/**
- * $Id$
- * imagepaint.c
- *
- * Functions to paint images in 2D and 3D.
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Jens Ole Wund (bjornmose)
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-#include "PIL_time.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "DNA_brush_types.h"
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_brush.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-
-#include "BDR_imagepaint.h"
-#include "BDR_vpaint.h"
-
-#include "GPU_draw.h"
-
-#include "GHOST_Types.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
-
-/* Defines and Structs */
-
-#define IMAPAINT_CHAR_TO_FLOAT(c) (c/255.0f)
-
-#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { c[0]=FTOCHAR(f[0]); \
- c[1]=FTOCHAR(f[1]); c[2]=FTOCHAR(f[2]); }
-#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { f[0]=IMAPAINT_CHAR_TO_FLOAT(c[0]); \
- f[1]=IMAPAINT_CHAR_TO_FLOAT(c[1]); f[2]=IMAPAINT_CHAR_TO_FLOAT(c[2]); }
-#define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b)
-
-#define IMAPAINT_TILE_BITS 6
-#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
-#define IMAPAINT_TILE_NUMBER(size) (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS)
-
-#define MAXUNDONAME 64
-
-typedef struct ImagePaintState {
- Brush *brush;
- short tool, blend;
- Image *image;
- ImBuf *canvas;
- ImBuf *clonecanvas;
- short clonefreefloat;
- char *warnpackedfile;
- char *warnmultifile;
-
- /* texture paint only */
- Object *ob;
- Mesh *me;
- int faceindex;
- float uv[2];
-} ImagePaintState;
-
-typedef struct UndoTile {
- struct UndoTile *next, *prev;
- ID id;
- void *rect;
- int x, y;
-} UndoTile;
-
-typedef struct UndoElem {
- struct UndoElem *next, *prev;
- char name[MAXUNDONAME];
- unsigned long undosize;
-
- ImBuf *ibuf;
- ListBase tiles;
-} UndoElem;
-
-typedef struct ImagePaintPartialRedraw {
- int x1, y1, x2, y2;
- int enabled;
-} ImagePaintPartialRedraw;
-
-static ListBase undobase = {NULL, NULL};
-static UndoElem *curundo = NULL;
-static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0};
-
-/* UNDO */
-
-/* internal functions */
-
-static void undo_copy_tile(UndoTile *tile, ImBuf *tmpibuf, ImBuf *ibuf, int restore)
-{
- /* copy or swap contents of tile->rect and region in ibuf->rect */
- IMB_rectcpy(tmpibuf, ibuf, 0, 0, tile->x*IMAPAINT_TILE_SIZE,
- tile->y*IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
-
- if(ibuf->rect_float) SWAP(void*, tmpibuf->rect_float, tile->rect)
- else SWAP(void*, tmpibuf->rect, tile->rect)
-
- if(restore)
- IMB_rectcpy(ibuf, tmpibuf, tile->x*IMAPAINT_TILE_SIZE,
- tile->y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
-}
-
-static void undo_restore(UndoElem *undo)
-{
- Image *ima = NULL;
- ImBuf *ibuf, *tmpibuf;
- UndoTile *tile;
-
- if(!undo)
- return;
-
- tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
- IB_rectfloat|IB_rect, 0);
-
- for(tile=undo->tiles.first; tile; tile=tile->next) {
- /* find image based on name, pointer becomes invalid with global undo */
- if(ima && strcmp(tile->id.name, ima->id.name)==0);
- else {
- for(ima=G.main->image.first; ima; ima=ima->id.next)
- if(strcmp(tile->id.name, ima->id.name)==0)
- break;
- }
-
- ibuf= BKE_image_get_ibuf(ima, NULL);
-
- if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
- continue;
-
- undo_copy_tile(tile, tmpibuf, ibuf, 1);
-
- GPU_free_image(ima); /* force OpenGL reload */
- if(ibuf->rect_float)
- imb_freerectImBuf(ibuf); /* force recreate of char rect */
- }
-
- IMB_freeImBuf(tmpibuf);
-}
-
-static void undo_free(UndoElem *undo)
-{
- UndoTile *tile;
-
- for(tile=undo->tiles.first; tile; tile=tile->next)
- MEM_freeN(tile->rect);
- BLI_freelistN(&undo->tiles);
-}
-
-static void undo_imagepaint_push_begin(char *name)
-{
- UndoElem *uel;
- int nr;
-
- /* Undo push is split up in begin and end, the reason is that as painting
- * happens more tiles are added to the list, and at the very end we know
- * how much memory the undo used to remove old undo elements */
-
- /* remove all undos after (also when curundo==NULL) */
- while(undobase.last != curundo) {
- uel= undobase.last;
- undo_free(uel);
- BLI_freelinkN(&undobase, uel);
- }
-
- /* make new */
- curundo= uel= MEM_callocN(sizeof(UndoElem), "undo file");
- BLI_addtail(&undobase, uel);
-
- /* name can be a dynamic string */
- strncpy(uel->name, name, MAXUNDONAME-1);
-
- /* limit amount to the maximum amount*/
- nr= 0;
- uel= undobase.last;
- while(uel) {
- nr++;
- if(nr==U.undosteps) break;
- uel= uel->prev;
- }
- if(uel) {
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
- undo_free(first);
- BLI_freelinkN(&undobase, first);
- }
- }
-}
-
-static void undo_imagepaint_push_end()
-{
- UndoElem *uel;
- unsigned long totmem, maxmem;
-
- if(U.undomemory != 0) {
- /* limit to maximum memory (afterwards, we can't know in advance) */
- totmem= 0;
- maxmem= ((unsigned long)U.undomemory)*1024*1024;
-
- uel= undobase.last;
- while(uel) {
- totmem+= uel->undosize;
- if(totmem>maxmem) break;
- uel= uel->prev;
- }
-
- if(uel) {
- while(undobase.first!=uel) {
- UndoElem *first= undobase.first;
- undo_free(first);
- BLI_freelinkN(&undobase, first);
- }
- }
- }
-}
-
-/* external functions */
-
-/* 1= an undo, -1 is a redo. */
-void undo_imagepaint_step(int step)
-{
- UndoElem *undo;
-
- if(step==1) {
- if(curundo==NULL) error("No more steps to undo");
- else {
- if(G.f & G_DEBUG) printf("undo %s\n", curundo->name);
- undo_restore(curundo);
- curundo= curundo->prev;
- }
- }
- else if(step==-1) {
- if((curundo!=NULL && curundo->next==NULL) || undobase.first==NULL) error("No more steps to redo");
- else {
- undo= (curundo && curundo->next)? curundo->next: undobase.first;
- undo_restore(undo);
- curundo= undo;
- if(G.f & G_DEBUG) printf("redo %s\n", undo->name);
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void undo_imagepaint_clear(void)
-{
- UndoElem *uel;
-
- uel= undobase.first;
- while(uel) {
- undo_free(uel);
- uel= uel->next;
- }
-
- BLI_freelistN(&undobase);
- curundo= NULL;
-}
-
-/* Imagepaint Partial Redraw & Dirty Region */
-
-static void imapaint_clear_partial_redraw()
-{
- memset(&imapaintpartial, 0, sizeof(imapaintpartial));
-}
-
-static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int h)
-{
- ImBuf *tmpibuf;
- UndoTile *tile;
- int srcx= 0, srcy= 0, origx, allocsize;
-
- IMB_rectclip(ibuf, NULL, &x, &y, &srcx, &srcy, &w, &h);
-
- if (w == 0 || h == 0)
- return;
-
- if (!imapaintpartial.enabled) {
- imapaintpartial.x1 = x;
- imapaintpartial.y1 = y;
- imapaintpartial.x2 = x+w;
- imapaintpartial.y2 = y+h;
- imapaintpartial.enabled = 1;
- }
- else {
- imapaintpartial.x1 = MIN2(imapaintpartial.x1, x);
- imapaintpartial.y1 = MIN2(imapaintpartial.y1, y);
- imapaintpartial.x2 = MAX2(imapaintpartial.x2, x+w);
- imapaintpartial.y2 = MAX2(imapaintpartial.y2, y+h);
- }
-
- w = ((x + w - 1) >> IMAPAINT_TILE_BITS);
- h = ((y + h - 1) >> IMAPAINT_TILE_BITS);
- origx = (x >> IMAPAINT_TILE_BITS);
- y = (y >> IMAPAINT_TILE_BITS);
-
- tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
- IB_rectfloat|IB_rect, 0);
-
- for (; y <= h; y++) {
- for (x=origx; x <= w; x++) {
- for(tile=curundo->tiles.first; tile; tile=tile->next)
- if(tile->x == x && tile->y == y && strcmp(tile->id.name, ima->id.name)==0)
- break;
-
- if(!tile) {
- tile= MEM_callocN(sizeof(UndoTile), "ImaUndoTile");
- tile->id= ima->id;
- tile->x= x;
- tile->y= y;
-
- allocsize= IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE*4;
- allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
- tile->rect= MEM_mapallocN(allocsize, "ImaUndoRect");
-
- undo_copy_tile(tile, tmpibuf, ibuf, 0);
- curundo->undosize += allocsize;
-
- BLI_addtail(&curundo->tiles, tile);
- }
- }
- }
-
- ibuf->userflags |= IB_BITMAPDIRTY;
-
- IMB_freeImBuf(tmpibuf);
-}
-
-static void imapaint_image_update(Image *image, ImBuf *ibuf, short texpaint)
-{
- if(ibuf->rect_float)
- imb_freerectImBuf(ibuf); /* force recreate of char rect */
- if(ibuf->mipmap[0])
- imb_freemipmapImBuf(ibuf);
-
- /* todo: should set_tpage create ->rect? */
- if(texpaint || G.sima->lock) {
- int w = imapaintpartial.x2 - imapaintpartial.x1;
- int h = imapaintpartial.y2 - imapaintpartial.y1;
- GPU_paint_update_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h);
- }
-}
-
-/* note; gets called for both 2d image paint and 3d texture paint. in the
- latter case image may be NULL and G.sima may not exist */
-static void imapaint_redraw(int final, int texpaint, Image *image)
-{
- if(final) {
- if(texpaint)
- allqueue(REDRAWIMAGE, 0);
- else if(!G.sima->lock) {
- if(image)
- GPU_free_image(image); /* force OpenGL reload */
- allqueue(REDRAWVIEW3D, 0);
- }
- allqueue(REDRAWHEADERS, 0);
-
- if(!texpaint && image) {
- /* after paint, tag Image or RenderResult nodes changed */
- if(G.scene->nodetree) {
- imagepaint_composite_tags(G.scene->nodetree, image, &G.sima->iuser);
- }
- /* signal composite (hurmf, need an allqueue?) */
- if(G.sima->lock) {
- ScrArea *sa;
- for(sa=G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_NODE) {
- if(((SpaceNode *)sa->spacedata.first)->treetype==NTREE_COMPOSIT) {
- addqueue(sa->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
- break;
- }
- }
- }
- }
- }
- }
- else if(!texpaint && G.sima->lock)
- force_draw_plus(SPACE_VIEW3D, 0);
- else
- force_draw(0);
-}
-
-/* Image Paint Operations */
-
-static void imapaint_ibuf_get_set_rgb(ImBuf *ibuf, int x, int y, short torus, short set, float *rgb)
-{
- if (torus) {
- x %= ibuf->x;
- if (x < 0) x += ibuf->x;
- y %= ibuf->y;
- if (y < 0) y += ibuf->y;
- }
-
- if (ibuf->rect_float) {
- float *rrgbf = ibuf->rect_float + (ibuf->x*y + x)*4;
-
- if (set) IMAPAINT_FLOAT_RGB_COPY(rrgbf, rgb)
- else IMAPAINT_FLOAT_RGB_COPY(rgb, rrgbf)
- }
- else {
- char *rrgb = (char*)ibuf->rect + (ibuf->x*y + x)*4;
-
- if (set) IMAPAINT_FLOAT_RGB_TO_CHAR(rrgb, rgb)
- else IMAPAINT_CHAR_RGB_TO_FLOAT(rgb, rrgb)
- }
-}
-
-static int imapaint_ibuf_add_if(ImBuf *ibuf, unsigned int x, unsigned int y, float *outrgb, short torus)
-{
- float inrgb[3];
-
- if ((x >= ibuf->x) || (y >= ibuf->y)) {
- if (torus) imapaint_ibuf_get_set_rgb(ibuf, x, y, 1, 0, inrgb);
- else return 0;
- }
- else imapaint_ibuf_get_set_rgb(ibuf, x, y, 0, 0, inrgb);
-
- outrgb[0] += inrgb[0];
- outrgb[1] += inrgb[1];
- outrgb[2] += inrgb[2];
-
- return 1;
-}
-
-static void imapaint_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, short torus)
-{
- int x, y, count, xi, yi, xo, yo;
- int out_off[2], in_off[2], dim[2];
- float outrgb[3];
-
- dim[0] = ibufb->x;
- dim[1] = ibufb->y;
- in_off[0] = pos[0];
- in_off[1] = pos[1];
- out_off[0] = out_off[1] = 0;
-
- if (!torus) {
- IMB_rectclip(ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
- &out_off[1], &dim[0], &dim[1]);
-
- if ((dim[0] == 0) || (dim[1] == 0))
- return;
- }
-
- for (y=0; y < dim[1]; y++) {
- for (x=0; x < dim[0]; x++) {
- /* get input pixel */
- xi = in_off[0] + x;
- yi = in_off[1] + y;
-
- count = 1;
- imapaint_ibuf_get_set_rgb(ibuf, xi, yi, torus, 0, outrgb);
-
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi , outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi-1, yi+1, outrgb, torus);
-
- count += imapaint_ibuf_add_if(ibuf, xi , yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi , yi+1, outrgb, torus);
-
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi-1, outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi , outrgb, torus);
- count += imapaint_ibuf_add_if(ibuf, xi+1, yi+1, outrgb, torus);
-
- outrgb[0] /= count;
- outrgb[1] /= count;
- outrgb[2] /= count;
-
- /* write into brush buffer */
- xo = out_off[0] + x;
- yo = out_off[1] + y;
- imapaint_ibuf_get_set_rgb(ibufb, xo, yo, 0, 1, outrgb);
- }
- }
-}
-
-static void imapaint_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos)
-{
- IMB_rectblend_torus(ibufb, ibuf, 0, 0, pos[0], pos[1],
- ibufb->x, ibufb->y, IMB_BLEND_COPY_RGB);
-}
-
-static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos)
-{
- /* note: allocImbuf returns zero'd memory, so regions outside image will
- have zero alpha, and hence not be blended onto the image */
- int w=ibufb->x, h=ibufb->y, destx=0, desty=0, srcx=pos[0], srcy=pos[1];
- ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags, 0);
-
- IMB_rectclip(clonebuf, ibuf, &destx, &desty, &srcx, &srcy, &w, &h);
- IMB_rectblend(clonebuf, ibuf, destx, desty, srcx, srcy, w, h,
- IMB_BLEND_COPY_RGB);
- IMB_rectblend(clonebuf, ibufb, destx, desty, destx, desty, w, h,
- IMB_BLEND_COPY_ALPHA);
-
- return clonebuf;
-}
-
-static void imapaint_convert_brushco(ImBuf *ibufb, float *pos, int *ipos)
-{
- ipos[0]= (int)(pos[0] - ibufb->x/2);
- ipos[1]= (int)(pos[1] - ibufb->y/2);
-}
-
-static int imapaint_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *pos)
-{
- ImagePaintState *s= ((ImagePaintState*)state);
- ImBuf *clonebuf= NULL;
- short torus= s->brush->flag & BRUSH_TORUS;
- short blend= s->blend;
- float *offset= s->brush->clone.offset;
- float liftpos[2];
- int bpos[2], blastpos[2], bliftpos[2];
-
- imapaint_convert_brushco(ibufb, pos, bpos);
-
- /* lift from canvas */
- if(s->tool == PAINT_TOOL_SOFTEN) {
- imapaint_lift_soften(s->canvas, ibufb, bpos, torus);
- }
- else if(s->tool == PAINT_TOOL_SMEAR) {
- if (lastpos[0]==pos[0] && lastpos[1]==pos[1])
- return 0;
-
- imapaint_convert_brushco(ibufb, lastpos, blastpos);
- imapaint_lift_smear(s->canvas, ibufb, blastpos);
- }
- else if(s->tool == PAINT_TOOL_CLONE && s->clonecanvas) {
- liftpos[0]= pos[0] - offset[0]*s->canvas->x;
- liftpos[1]= pos[1] - offset[1]*s->canvas->y;
-
- imapaint_convert_brushco(ibufb, liftpos, bliftpos);
- clonebuf= imapaint_lift_clone(s->clonecanvas, ibufb, bliftpos);
- }
-
- imapaint_dirty_region(s->image, s->canvas, bpos[0], bpos[1], ibufb->x, ibufb->y);
-
- /* blend into canvas */
- if(torus)
- IMB_rectblend_torus(s->canvas, (clonebuf)? clonebuf: ibufb,
- bpos[0], bpos[1], 0, 0, ibufb->x, ibufb->y, blend);
- else
- IMB_rectblend(s->canvas, (clonebuf)? clonebuf: ibufb,
- bpos[0], bpos[1], 0, 0, ibufb->x, ibufb->y, blend);
-
- if(clonebuf) IMB_freeImBuf(clonebuf);
-
- return 1;
-}
-
-/* 2D ImagePaint */
-
-static void imapaint_compute_uvco(short *mval, float *uv)
-{
- areamouseco_to_ipoco(G.v2d, mval, &uv[0], &uv[1]);
-}
-
-/* 3D TexturePaint */
-
-int facesel_face_pick(Mesh *me, short *mval, unsigned int *index, short rect);
-void texpaint_pick_uv(Object *ob, Mesh *mesh, unsigned int faceindex, short *xy, float *mousepos);
-
-static int texpaint_break_stroke(float *prevuv, float *fwuv, float *bkuv, float *uv)
-{
- float d1[2], d2[2];
- float mismatch = Vec2Lenf(fwuv, uv);
- float len1 = Vec2Lenf(prevuv, fwuv);
- float len2 = Vec2Lenf(bkuv, uv);
-
- Vec2Subf(d1, fwuv, prevuv);
- Vec2Subf(d2, uv, bkuv);
-
- return ((Inp2f(d1, d2) < 0.0f) || (mismatch > MAX2(len1, len2)*2));
-}
-
-/* ImagePaint Common */
-
-static int imapaint_canvas_set(ImagePaintState *s, Image *ima)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL);
-
- /* verify that we can paint and set canvas */
- if(ima->packedfile && ima->rr) {
- s->warnpackedfile = ima->id.name + 2;
- return 0;
- }
- else if(ibuf && ibuf->channels!=4) {
- s->warnmultifile = ima->id.name + 2;
- return 0;
- }
- else if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
- return 0;
-
- s->image= ima;
- s->canvas= ibuf;
-
- /* set clone canvas */
- if(s->tool == PAINT_TOOL_CLONE) {
- ima= s->brush->clone.image;
- ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL);
-
- if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
- return 0;
-
- s->clonecanvas= ibuf;
-
- if(s->canvas->rect_float && !s->clonecanvas->rect_float) {
- /* temporarily add float rect for cloning */
- IMB_float_from_rect(s->clonecanvas);
- s->clonefreefloat= 1;
- }
- else if(!s->canvas->rect_float && !s->clonecanvas->rect)
- IMB_rect_from_float(s->clonecanvas);
- }
-
- return 1;
-}
-
-static void imapaint_canvas_free(ImagePaintState *s)
-{
- if (s->clonefreefloat)
- imb_freerectfloatImBuf(s->clonecanvas);
-}
-
-static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter, Image *image, short texpaint, float *uv, double time, int update, float pressure)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(image, G.sima?&G.sima->iuser:NULL);
- float pos[2];
-
- if(!ibuf)
- return 0;
-
- pos[0] = uv[0]*ibuf->x;
- pos[1] = uv[1]*ibuf->y;
-
- brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0);
-
- if (brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s)) {
- if (update)
- imapaint_image_update(image, ibuf, texpaint);
- return 1;
- }
- else return 0;
-}
-
-static void imapaint_paint_stroke(ImagePaintState *s, BrushPainter *painter, short texpaint, short *prevmval, short *mval, double time, float pressure)
-{
- Image *newimage = NULL;
- float fwuv[2], bkuv[2], newuv[2];
- unsigned int newfaceindex;
- int breakstroke = 0, redraw = 0;
-
- if (texpaint) {
- /* pick new face and image */
- if ( facesel_face_pick(s->me, mval, &newfaceindex, 0) &&
- ((G.f & G_FACESELECT)==0 || (s->me->mface+newfaceindex)->flag & ME_FACE_SEL)
- ) {
- ImBuf *ibuf;
-
- newimage = (Image*)((s->me->mtface+newfaceindex)->tpage);
- ibuf= BKE_image_get_ibuf(newimage, G.sima?&G.sima->iuser:NULL);
-
- if(ibuf && ibuf->rect)
- texpaint_pick_uv(s->ob, s->me, newfaceindex, mval, newuv);
- else {
- newimage = NULL;
- newuv[0] = newuv[1] = 0.0f;
- }
- }
- else
- newuv[0] = newuv[1] = 0.0f;
-
- /* see if stroke is broken, and if so finish painting in old position */
- if (s->image) {
- texpaint_pick_uv(s->ob, s->me, s->faceindex, mval, fwuv);
- texpaint_pick_uv(s->ob, s->me, newfaceindex, prevmval, bkuv);
-
- if (newimage == s->image)
- breakstroke= texpaint_break_stroke(s->uv, fwuv, bkuv, newuv);
- else
- breakstroke= 1;
- }
- else
- fwuv[0]= fwuv[1]= 0.0f;
-
- if (breakstroke) {
- texpaint_pick_uv(s->ob, s->me, s->faceindex, mval, fwuv);
- redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint,
- fwuv, time, 1, pressure);
- imapaint_clear_partial_redraw();
- brush_painter_break_stroke(painter);
- }
-
- /* set new canvas */
- if (newimage && (newimage != s->image))
- if (!imapaint_canvas_set(s, newimage))
- newimage = NULL;
-
- /* paint in new image */
- if (newimage) {
- if (breakstroke)
- redraw|= imapaint_paint_sub_stroke(s, painter, newimage,
- texpaint, bkuv, time, 0, pressure);
- redraw|= imapaint_paint_sub_stroke(s, painter, newimage, texpaint,
- newuv, time, 1, pressure);
- }
-
- /* update state */
- s->image = newimage;
- s->faceindex = newfaceindex;
- s->uv[0] = newuv[0];
- s->uv[1] = newuv[1];
- }
- else {
- imapaint_compute_uvco(mval, newuv);
- redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint, newuv,
- time, 1, pressure);
- }
-
- if (redraw) {
- imapaint_redraw(0, texpaint, NULL);
- imapaint_clear_partial_redraw();
- }
-}
-
-void imagepaint_paint(short mousebutton, short texpaint)
-{
- ImagePaintState s;
- BrushPainter *painter;
- ToolSettings *settings= G.scene->toolsettings;
- short prevmval[2], mval[2];
- double time;
- float pressure;
-
- if(!settings->imapaint.brush)
- return;
-
- /* initialize state */
- memset(&s, 0, sizeof(s));
- s.brush = settings->imapaint.brush;
- s.tool = settings->imapaint.tool;
- if(texpaint && (s.tool == PAINT_TOOL_CLONE))
- s.tool = PAINT_TOOL_DRAW;
- s.blend = s.brush->blend;
-
- if(texpaint) {
- s.ob = OBACT;
- if (!s.ob || !(s.ob->lay & G.vd->lay)) return;
- s.me = get_mesh(s.ob);
- if (!s.me) return;
-
- persp(PERSP_VIEW);
- }
- else {
- s.image = G.sima->image;
-
- if(!imapaint_canvas_set(&s, G.sima->image)) {
- if(s.warnmultifile)
- error("Image requires 4 color channels to paint");
- if(s.warnpackedfile)
- error("Packed MultiLayer files cannot be painted");
- return;
- }
- }
-
- settings->imapaint.flag |= IMAGEPAINT_DRAWING;
- undo_imagepaint_push_begin("Image Paint");
-
- /* create painter and paint once */
- painter= brush_painter_new(s.brush);
-
- getmouseco_areawin(mval);
-
- pressure = get_pressure();
- s.blend = (get_activedevice() == 2)? BRUSH_BLEND_ERASE_ALPHA: s.brush->blend;
-
- time= PIL_check_seconds_timer();
- prevmval[0]= mval[0];
- prevmval[1]= mval[1];
-
- /* special exception here for too high pressure values on first touch in
- windows for some tablets */
- if (!((s.brush->flag & (BRUSH_ALPHA_PRESSURE|BRUSH_SIZE_PRESSURE|
- BRUSH_SPACING_PRESSURE|BRUSH_RAD_PRESSURE)) && (get_activedevice() != 0) && (pressure >= 0.99f)))
- imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure);
-
- /* paint loop */
- do {
- getmouseco_areawin(mval);
-
- pressure = get_pressure();
- s.blend = (get_activedevice() == 2)? BRUSH_BLEND_ERASE_ALPHA: s.brush->blend;
-
- time= PIL_check_seconds_timer();
-
- if((mval[0] != prevmval[0]) || (mval[1] != prevmval[1])) {
- imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure);
- prevmval[0]= mval[0];
- prevmval[1]= mval[1];
- }
- else if (s.brush->flag & BRUSH_AIRBRUSH)
- imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure);
- else
- BIF_wait_for_statechange();
-
- /* do mouse checking at the end, so don't check twice, and potentially
- miss a short tap */
- } while(get_mbut() & mousebutton);
-
- /* clean up */
- settings->imapaint.flag &= ~IMAGEPAINT_DRAWING;
- imapaint_canvas_free(&s);
- brush_painter_free(painter);
-
- imapaint_redraw(1, texpaint, s.image);
- undo_imagepaint_push_end();
-
- if (texpaint) {
- if (s.warnmultifile)
- error("Image requires 4 color channels to paint: %s", s.warnmultifile);
- if(s.warnpackedfile)
- error("Packed MultiLayer files cannot be painted %s", s.warnpackedfile);
-
- persp(PERSP_WIN);
- }
-}
-
-void imagepaint_pick(short mousebutton)
-{
- ToolSettings *settings= G.scene->toolsettings;
- Brush *brush= settings->imapaint.brush;
-
- if(brush && (settings->imapaint.tool == PAINT_TOOL_CLONE)) {
- if(brush->clone.image) {
- short prevmval[2], mval[2];
- float lastmousepos[2], mousepos[2];
-
- getmouseco_areawin(prevmval);
-
- while(get_mbut() & mousebutton) {
- getmouseco_areawin(mval);
-
- if((prevmval[0] != mval[0]) || (prevmval[1] != mval[1]) ) {
- /* mouse moved, so move the clone image */
- imapaint_compute_uvco(prevmval, lastmousepos);
- imapaint_compute_uvco(mval, mousepos);
-
- brush->clone.offset[0] += mousepos[0] - lastmousepos[0];
- brush->clone.offset[1] += mousepos[1] - lastmousepos[1];
-
- force_draw(0);
-
- prevmval[0]= mval[0];
- prevmval[1]= mval[1];
- }
- }
- }
- }
- else if(brush)
- sample_vpaint();
-}
-
diff --git a/source/blender/src/imasel.c b/source/blender/src/imasel.c
deleted file mode 100644
index f502445d329..00000000000
--- a/source/blender/src/imasel.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include "BLI_winstuff.h"
-#include <io.h>
-#include <direct.h>
-#endif
-#include <fcntl.h>
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_imasel.h"
-#include "BIF_filelist.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-
-void free_imasel(SpaceImaSel *simasel)
-{
- /* do not free imasel itself */
- if(simasel->files) {
- BIF_filelist_freelib(simasel->files);
- BIF_filelist_free(simasel->files);
- MEM_freeN(simasel->files);
- simasel->files = NULL;
- }
- if (simasel->img) {
- IMB_freeImBuf(simasel->img);
- }
- if(simasel->pupmenu) {
- MEM_freeN(simasel->pupmenu);
- simasel->pupmenu = NULL;
- }
-}
-
-/* resets a previous imagebrowser space type */
-/* is used when opening an imagebrowser directly from windowtype_pupmenu,
- since in that case we don't want any load/save/append/link action
-*/
-void reset_imaselspace(ScrArea *sa)
-{
- if(sa->spacetype==SPACE_IMASEL) {
- SpaceImaSel *simasel= sa->spacedata.first;
- if(simasel->type==FILE_MAIN) {
- if (simasel->files) {
- BIF_filelist_free(simasel->files);
- BIF_filelist_settype(simasel->files, FILE_MAIN);
- }
- } else {
- if (simasel->files) {
- simasel->type= FILE_UNIX;
- BIF_filelist_settype(simasel->files, simasel->type);
- }
- }
- simasel->returnfunc= NULL;
- simasel->title[0]= 0;
- }
-}
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
deleted file mode 100644
index 7417218f253..00000000000
--- a/source/blender/src/interface.c
+++ /dev/null
@@ -1,6808 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
- a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt
-
- */
-
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif // INTERNATIONAL
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_color_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_object_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_vfont_types.h"
-
-#include "BKE_blender.h"
-#include "BKE_colortools.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_cursors.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_glutil.h"
-#include "BIF_editfont.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_butspace.h"
-#include "BIF_previewrender.h"
-
-#include "BSE_view.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h" /* for BPY_button_eval */
-#endif
-
-#include "GHOST_Types.h" /* for tablet data */
-
-#include "mydevice.h"
-#include "interface.h"
-#include "blendef.h"
-#include "winlay.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-#define INSIDE_BLOCK 1
-#define INSIDE_PANEL_HEADER 2
-#define INSIDE_PANEL_SCALE 3
-
-/* naming conventions:
- *
- * uiBlahBlah() external function
- * ui_blah_blah() internal function
- */
-
-/***/
-/* ************ GLOBALS ************* */
-
-float UIwinmat[4][4];
-static int UIlock= 0, UIafterval;
-static char *UIlockstr=NULL;
-
-static void (*UIafterfunc_butm)(void *arg, int event);
-static void (*UIafterfunc_but)(void *arg1, void *arg2);
-static void *UIafterfunc_arg1, *UIafterfunc_arg2;
-
-static uiFont UIfont[UI_ARRAY]; // no init needed
-uiBut *UIbuttip;
-
-static ColorBand but_copypaste_coba;
-
-/* ************* PROTOTYPES ***************** */
-
-static void ui_set_but_val(uiBut *but, double value);
-static void ui_do_but_tip(uiBut *buttip);
-
-/* ****************************** */
-
-static int uibut_contains_pt(uiBut *but, short *pt)
-{
- return ((but->x1<pt[0] && but->x2>=pt[0]) &&
- (but->y1<pt[1] && but->y2>=pt[1]));
-}
-
-static void uibut_do_func(uiBut *but)
-{
- if (but->func) {
- but->func(but->func_arg1, but->func_arg2);
- }
-}
-
-/* ************* window matrix ************** */
-
-
-void ui_graphics_to_window(int win, float *x, float *y) /* for rectwrite */
-{
- float gx, gy;
- int sx, sy;
- int getsizex, getsizey;
-
- bwin_getsize(win, &getsizex, &getsizey);
- bwin_getsuborigin(win, &sx, &sy);
-
- gx= *x;
- gy= *y;
- *x= ((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0]));
- *y= ((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1]));
-}
-
-void ui_graphics_to_window_rct(int win, rctf *graph, rcti *winr)
-{
- float gx, gy;
- int sx, sy;
- int getsizex, getsizey;
-
- bwin_getsize(win, &getsizex, &getsizey);
- bwin_getsuborigin(win, &sx, &sy);
-
- gx= graph->xmin;
- gy= graph->ymin;
- winr->xmin= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0]));
- winr->ymin= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1]));
- gx= graph->xmax;
- gy= graph->ymax;
- winr->xmax= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0]));
- winr->ymax= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1]));
-}
-
-
-void ui_window_to_graphics(int win, float *x, float *y) /* for mouse cursor */
-{
- float a, b, c, d, e, f, px, py;
- int getsizex, getsizey;
-
- bwin_getsize(win, &getsizex, &getsizey);
-
- a= .5*((float)getsizex)*UIwinmat[0][0];
- b= .5*((float)getsizex)*UIwinmat[1][0];
- c= .5*((float)getsizex)*(1.0+UIwinmat[3][0]);
-
- d= .5*((float)getsizey)*UIwinmat[0][1];
- e= .5*((float)getsizey)*UIwinmat[1][1];
- f= .5*((float)getsizey)*(1.0+UIwinmat[3][1]);
-
- px= *x;
- py= *y;
-
- *y= (a*(py-f) + d*(c-px))/(a*e-d*b);
- *x= (px- b*(*y)- c)/a;
-
-}
-
-
-/* ************* SAVE UNDER ************ */
-
-/* new method:
-
-OverDraw *ui_begin_overdraw(int minx, int miny, int maxx, int maxy);
-- enforces mainwindow to become active
-- grabs copy from frontbuffer, pastes in back
-
-void ui_flush_overdraw(OverDraw *od);
-- copies backbuffer to front
-
-void ui_refresh_overdraw(Overdraw *od);
-- pastes in back copy of frontbuffer again for fresh drawing
-
-void ui_end_overdraw(OverDraw *od);
-- puts back on frontbuffer saved image
-- frees copy
-- sets back active blender area
-- signals backbuffer to be corrupt (sel buffer!)
-
-*/
-
-/* frontbuffer updates now glCopyPixels too, with block->flush rect */
-
-/* new idea for frontbuffer updates:
-
-- hilites: with blended poly?
-
-- full updates... thats harder, but:
- - copy original
- - before draw, always paste to backbuf
- - flush
- - always end with redraw event for full update
-
-*/
-
-static void myglCopyPixels(int a, int b, int c, int d, int e)
-{
- if(G.rt==2) {
- unsigned int *buf= MEM_mallocN(4*c*d, "temp glcopypixels");
- glReadPixels(a, b, c, d, GL_RGBA, GL_UNSIGNED_BYTE, buf);
- glDrawPixels(c, d, GL_RGBA, GL_UNSIGNED_BYTE, buf);
- MEM_freeN(buf);
- }
- else glCopyPixels(a, b, c, d, e);
-}
-
-typedef struct {
- short x, y, sx, sy, oldwin;
- unsigned int *rect;
-} uiOverDraw;
-
-
-static uiOverDraw *ui_begin_overdraw(int minx, int miny, int maxx, int maxy)
-{
- uiOverDraw *od=NULL;
-
- // dirty patch removed for sun and sgi to mywindow.c commented out
-
- /* clip with actual window size */
- if(minx < 0) minx= 0;
- if(miny < 0) miny= 0;
- if(maxx >= G.curscreen->sizex) maxx= G.curscreen->sizex-1;
- if(maxy >= G.curscreen->sizey) maxy= G.curscreen->sizey-1;
-
- if(minx<maxx && miny<maxy) {
- od= MEM_callocN(sizeof(uiOverDraw), "overdraw");
-
- od->x= minx;
- od->y= miny;
- od->sx= maxx-minx;
- od->sy= maxy-miny;
- od->rect= MEM_mallocN(od->sx*od->sy*4, "temp_frontbuffer_image");
-
- od->oldwin= mywinget();
- mywinset(G.curscreen->mainwin);
- /* grab front */
- glReadBuffer(GL_FRONT);
- glReadPixels(od->x, od->y, od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect);
- glReadBuffer(GL_BACK);
- /* paste in back */
- glDisable(GL_DITHER);
- glRasterPos2f(od->x, od->y);
- glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect);
- glEnable(GL_DITHER);
- }
-
- return od;
-}
-
-static void ui_flush_overdraw(uiOverDraw *od)
-{
-
- if(od==NULL) return;
- glDisable(GL_DITHER);
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_FRONT);
- glRasterPos2s(od->x, od->y);
- myglCopyPixels(od->x, od->y, od->sx, od->sy, GL_COLOR);
- glEnable(GL_DITHER);
- bglFlush();
- glDrawBuffer(GL_BACK);
-}
-
-/* special flush version to enable transparent menus */
-static void ui_block_flush_overdraw(uiBlock *block)
-{
-
- if(block->flag & UI_BLOCK_LOOP) {
- char col[4];
-
- BIF_GetThemeColor4ubv(TH_MENU_BACK, col);
- if(col[3]!=255) {
- uiBut *bt;
- uiOverDraw *od= block->overdraw;
-
- /* completely draw all! */
- glRasterPos2s(od->x, od->y);
- glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect);
-
- uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag);
- for (bt= block->buttons.first; bt; bt= bt->next) {
- ui_draw_but(bt);
- }
- }
- }
-
- ui_flush_overdraw(block->overdraw);
-}
-
-static void ui_end_overdraw(uiOverDraw *od)
-{
- if(od==NULL) return;
-
- glDisable(GL_DITHER);
-
- // clear in back
- glRasterPos2s(od->x, od->y);
- glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect);
-
- // clear in front
- glDrawBuffer(GL_FRONT);
- glRasterPos2s(od->x, od->y);
- glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect);
-
- bglFlush();
- glDrawBuffer(GL_BACK);
- glEnable(GL_DITHER);
-
- if(od->oldwin) mywinset(od->oldwin);
-
- MEM_freeN(od->rect);
- MEM_freeN(od);
-
- markdirty_all_back(); // sets flags only
-}
-
-/* ****************** live updates for hilites and button presses *********** */
-
-void ui_block_flush_back(uiBlock *block)
-{
- int minx, miny, sizex, sizey;
-
- /* note; this routine also has to work for block loop */
- if(block->needflush==0) return;
-
- /* exception, when we cannot use backbuffer for draw... */
- if(block->flag & UI_BLOCK_FRONTBUFFER) {
- bglFlush();
- glDrawBuffer(GL_BACK);
- block->needflush= 0;
- return;
- }
-
- /* copy pixels works on window coords, so we move to window space */
-
- ui_graphics_to_window(block->win, &block->flush.xmin, &block->flush.ymin);
- ui_graphics_to_window(block->win, &block->flush.xmax, &block->flush.ymax);
- minx= floor(block->flush.xmin);
- miny= floor(block->flush.ymin);
- sizex= ceil(block->flush.xmax-block->flush.xmin);
- sizey= ceil(block->flush.ymax-block->flush.ymin);
-
- if(sizex>0 && sizey>0) {
- glPushMatrix();
- mywinset(G.curscreen->mainwin);
-
- glDisable(GL_DITHER);
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_FRONT);
- glRasterPos2i(minx, miny);
-#ifdef __sun__
- myglCopyPixels(minx, miny+1, sizex, sizey, GL_COLOR);
-#else
- myglCopyPixels(minx, miny, sizex, sizey, GL_COLOR);
-#endif
- glEnable(GL_DITHER);
- bglFlush();
- glDrawBuffer(GL_BACK);
-
- mywinset(block->win);
- glPopMatrix();
-
- markdirty_win_back(block->win);
- }
-
- block->needflush= 0;
-}
-
-/* merge info for live updates in frontbuf */
-void ui_block_set_flush(uiBlock *block, uiBut *but)
-{
- /* clear signal */
- if(but==NULL) {
- block->needflush= 0;
-
- block->flush.xmin= 0.0;
- block->flush.xmax= 0.0;
- }
- else {
- /* exception, when we cannot use backbuffer for draw... */
- if(block->flag & UI_BLOCK_FRONTBUFFER) {
- glDrawBuffer(GL_FRONT);
- }
- else if(block->needflush==0) {
- /* first rect */
- block->flush.xmin= but->x1;
- block->flush.xmax= but->x2;
- block->flush.ymin= but->y1;
- block->flush.ymax= but->y2;
-
- }
- else {
- /* union of rects */
- if(block->flush.xmin > but->x1) block->flush.xmin= but->x1;
- if(block->flush.xmax < but->x2) block->flush.xmax= but->x2;
- if(block->flush.ymin > but->y1) block->flush.ymin= but->y1;
- if(block->flush.ymax < but->y2) block->flush.ymax= but->y2;
- }
-
- block->needflush= 1;
-
- }
-}
-
-/* ******************* copy and paste ******************** */
-
-/* c = copy, v = paste */
-/* return 1 when something changed */
-static int ui_but_copy_paste(uiBut *but, char mode)
-{
- void *poin;
- char buf[UI_MAX_DRAW_STR+1]= {0};
- double val;
- float f[3];
-
- if(mode=='v' && but->lock) return 0;
- poin= but->poin;
-
- if(mode=='v') {
- /* extract first line from clipboard in case of multi-line copies */
- char *p = getClipboard(0);
- if(p) {
- int i = 0;
- while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR) {
- buf[i++]=*p;
- p++;
- }
- buf[i]= 0;
- }
- }
-
- /* numeric value */
- if ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI) {
-
- if(poin==NULL);
- else if(mode=='c') {
- sprintf(buf, "%f", ui_get_but_val(but));
- putClipboard(buf, 0);
- }
- else {
- if (sscanf(buf, " %lf ", &val) == 1) {
- ui_set_but_val(but, val);
- uibut_do_func(but);
- ui_check_but(but);
- return 1;
- }
- }
- }
-
- /* RGB triple */
- else if(but->type==COL) {
-
- if(poin==NULL);
- else if(mode=='c') {
- if(but->pointype==FLO) {
- float *fp= (float *) poin;
- sprintf(buf, "[%f, %f, %f]", fp[0], fp[1], fp[2]);
- putClipboard(buf, 0);
- }
- else if (but->pointype==CHA) {
- char *cp= (char *) poin;
- f[0]= (float)(cp[0]/255.0);
- f[1]= (float)(cp[1]/255.0);
- f[2]= (float)(cp[2]/255.0);
- sprintf(buf, "[%f, %f, %f]", f[0], f[1], f[2]);
- putClipboard(buf, 0);
- }
-
- }
- else {
- if(but->pointype==FLO) {
- float *fp= (float *) poin;
- if (sscanf(buf, "[%f, %f, %f]", &f[0], &f[1], &f[2]) == 3) {
- fp[0]= f[0];
- fp[1]= f[1];
- fp[2]= f[2];
- return 1;
- }
- }
- else if (but->pointype==CHA) {
- char *cp= (char *) poin;
- if (sscanf(buf, "[%f, %f, %f]", &f[0], &f[1], &f[2]) == 3) {
- cp[0]= (char)(f[0]*255.0);
- cp[1]= (char)(f[1]*255.0);
- cp[2]= (char)(f[2]*255.0);
- return 1;
- }
- }
-
- }
- }
-
- /* text/string data */
- else if(but->type==TEX) {
- if(poin==NULL);
- else if(mode=='c') {
- strncpy(buf, but->poin, but->max);
- buf[(int)but->max]= 0;
- putClipboard(buf, 0);
- }
- else {
- char backstr[UI_MAX_DRAW_STR];
- /* give butfunc the original text too */
- /* feature used for bone renaming, channels, etc */
- if(but->func_arg2==NULL) {
- strncpy(backstr, but->poin, UI_MAX_DRAW_STR);
- but->func_arg2= backstr;
- }
- strncpy(but->poin, buf, but->max);
- uibut_do_func(but);
- ui_check_but(but);
- return 1;
- }
- }
-
- /* ID name string (eg. OB:Object = "Object") */
- else if(but->type==IDPOIN) {
- if(mode=='c') {
- ID *id= *but->idpoin_idpp;
- if(id) {
- strncpy(buf, id->name+2, 22);
- buf[22]= 0;
- putClipboard(buf, 0);
- }
- }
- else {
- but->idpoin_func(buf, but->idpoin_idpp);
- ui_check_but(but);
- return 1;
- }
- }
-
- /* colorband (not supported by system clipboard) */
- else if(but->type==BUT_COLORBAND) {
- if(mode=='c') {
- if (!but->poin) {
- return 0;
- }
- memcpy( &but_copypaste_coba, but->poin, sizeof(ColorBand) );
- } else {
- if (but_copypaste_coba.tot==0) {
- return 0;
- }
- if (!but->poin) {
- but->poin= MEM_callocN( sizeof(ColorBand), "colorband");
- }
- memcpy( but->poin, &but_copypaste_coba, sizeof(ColorBand) );
- return 1;
- }
- }
-
- return 0;
-}
-
-/* ******************* block calc ************************* */
-
-/* only for pulldowns */
-void uiTextBoundsBlock(uiBlock *block, int addval)
-{
- uiBut *bt;
- int i = 0, j, x1addval= 0, nextcol;
-
- bt= block->buttons.first;
- while(bt) {
- if(bt->type!=SEPR) {
- int transopts= (U.transopts & USER_TR_BUTTONS);
- if(bt->type==TEX || bt->type==IDPOIN) transopts= 0;
- j= BIF_GetStringWidth(bt->font, bt->drawstr, transopts);
-
- if(j > i) i = j;
- }
- bt= bt->next;
- }
-
- /* cope with multi collumns */
- bt= block->buttons.first;
- while(bt) {
- if(bt->next && bt->x1 < bt->next->x1)
- nextcol= 1;
- else nextcol= 0;
-
- bt->x1 = x1addval;
- bt->x2 = bt->x1 + i + addval;
-
- ui_check_but(bt); // clips text again
-
- if(nextcol)
- x1addval+= i + addval;
-
- bt= bt->next;
- }
-}
-
-
-void uiBoundsBlock(uiBlock *block, int addval)
-{
- uiBut *bt;
- int xof;
-
- if(block==NULL)
- return;
-
- if(block->buttons.first==NULL) {
- if(block->panel) {
- block->minx= 0.0; block->maxx= block->panel->sizex;
- block->miny= 0.0; block->maxy= block->panel->sizey;
- }
- }
- else {
-
- block->minx= block->miny= 10000;
- block->maxx= block->maxy= -10000;
-
- bt= block->buttons.first;
- while(bt) {
- if(bt->x1 < block->minx) block->minx= bt->x1;
- if(bt->y1 < block->miny) block->miny= bt->y1;
-
- if(bt->x2 > block->maxx) block->maxx= bt->x2;
- if(bt->y2 > block->maxy) block->maxy= bt->y2;
-
- bt= bt->next;
- }
-
- block->minx -= addval;
- block->miny -= addval;
- block->maxx += addval;
- block->maxy += addval;
- }
-
- /* hardcoded exception... but that one is annoying with larger safety */
- bt= block->buttons.first;
- if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10;
- else xof= 40;
-
- block->safety.xmin= block->minx-xof;
- block->safety.ymin= block->miny-xof;
- block->safety.xmax= block->maxx+xof;
- block->safety.ymax= block->maxy+xof;
-}
-
-static void ui_positionblock(uiBlock *block, uiBut *but)
-{
- /* position block relative to but */
- uiBut *bt;
- rctf butrct;
- float aspect;
- int xsize, ysize, xof=0, yof=0, center;
- short dir1= 0, dir2=0;
-
- /* first transform to screen coords, assuming matrix is stil OK */
- /* the UIwinmat is in panelspace */
-
- butrct.xmin= but->x1; butrct.xmax= but->x2;
- butrct.ymin= but->y1; butrct.ymax= but->y2;
-
- ui_graphics_to_window(block->win, &butrct.xmin, &butrct.ymin);
- ui_graphics_to_window(block->win, &butrct.xmax, &butrct.ymax);
- block->parentrct= butrct; // will use that for pulldowns later
-
- /* calc block rect */
- if(block->buttons.first) {
- block->minx= block->miny= 10000;
- block->maxx= block->maxy= -10000;
-
- bt= block->buttons.first;
- while(bt) {
- if(bt->x1 < block->minx) block->minx= bt->x1;
- if(bt->y1 < block->miny) block->miny= bt->y1;
-
- if(bt->x2 > block->maxx) block->maxx= bt->x2;
- if(bt->y2 > block->maxy) block->maxy= bt->y2;
-
- bt= bt->next;
- }
- }
- else {
- /* we're nice and allow empty blocks too */
- block->minx= block->miny= 0;
- block->maxx= block->maxy= 20;
- }
-
- aspect= (float)(block->maxx - block->minx + 4);
- ui_graphics_to_window(block->win, &block->minx, &block->miny);
- ui_graphics_to_window(block->win, &block->maxx, &block->maxy);
-
- //block->minx-= 2.0; block->miny-= 2.0;
- //block->maxx+= 2.0; block->maxy+= 2.0;
-
- xsize= block->maxx - block->minx+4; // 4 for shadow
- ysize= block->maxy - block->miny+4;
- aspect/= (float)xsize;
-
- if(but) {
- short left=0, right=0, top=0, down=0;
-
- if(block->direction & UI_CENTER) center= ysize/2;
- else center= 0;
-
- if( butrct.xmin-xsize > 0.0) left= 1;
- if( butrct.xmax+xsize < G.curscreen->sizex) right= 1;
- if( butrct.ymin-ysize+center > 0.0) down= 1;
- if( butrct.ymax+ysize-center < G.curscreen->sizey) top= 1;
-
- dir1= block->direction & UI_DIRECTION;
-
- /* secundary directions */
- if(dir1 & (UI_TOP|UI_DOWN)) {
- if(dir1 & UI_LEFT) dir2= UI_LEFT;
- else if(dir1 & UI_RIGHT) dir2= UI_RIGHT;
- dir1 &= (UI_TOP|UI_DOWN);
- }
-
- if(dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN;
- if(dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT;
-
- /* no space at all? dont change */
- if(left || right) {
- if(dir1==UI_LEFT && left==0) dir1= UI_RIGHT;
- if(dir1==UI_RIGHT && right==0) dir1= UI_LEFT;
- /* this is aligning, not append! */
- if(dir2==UI_LEFT && right==0) dir2= UI_RIGHT;
- if(dir2==UI_RIGHT && left==0) dir2= UI_LEFT;
- }
- if(down || top) {
- if(dir1==UI_TOP && top==0) dir1= UI_DOWN;
- if(dir1==UI_DOWN && down==0) dir1= UI_TOP;
- if(dir2==UI_TOP && top==0) dir2= UI_DOWN;
- if(dir2==UI_DOWN && down==0) dir2= UI_TOP;
- }
-
- if(dir1==UI_LEFT) {
- xof= butrct.xmin - block->maxx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
- else yof= butrct.ymax - block->maxy+center;
- }
- else if(dir1==UI_RIGHT) {
- xof= butrct.xmax - block->minx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
- else yof= butrct.ymax - block->maxy+center;
- }
- else if(dir1==UI_TOP) {
- yof= butrct.ymax - block->miny;
- if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
- else xof= butrct.xmin - block->minx;
- // changed direction?
- if((dir1 & block->direction)==0) {
- if(block->direction & UI_SHIFT_FLIPPED)
- xof+= dir2==UI_LEFT?25:-25;
- uiBlockFlipOrder(block);
- }
- }
- else if(dir1==UI_DOWN) {
- yof= butrct.ymin - block->maxy;
- if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx;
- else xof= butrct.xmin - block->minx;
- // changed direction?
- if((dir1 & block->direction)==0) {
- if(block->direction & UI_SHIFT_FLIPPED)
- xof+= dir2==UI_LEFT?25:-25;
- uiBlockFlipOrder(block);
- }
- }
-
- /* and now we handle the exception; no space below or to top */
- if(top==0 && down==0) {
- if(dir1==UI_LEFT || dir1==UI_RIGHT) {
- // align with bottom of screen
- yof= ysize;
- }
- }
-
- /* or no space left or right */
- if(left==0 && right==0) {
- if(dir1==UI_TOP || dir1==UI_DOWN) {
- // align with left size of screen
- xof= -block->minx+5;
- }
- }
-
- // apply requested offset in the block
- xof += block->xofs/block->aspect;
- yof += block->yofs/block->aspect;
-
- }
-
- /* apply */
-
- for(bt= block->buttons.first; bt; bt= bt->next) {
-
- ui_graphics_to_window(block->win, &bt->x1, &bt->y1);
- ui_graphics_to_window(block->win, &bt->x2, &bt->y2);
-
- bt->x1 += xof;
- bt->x2 += xof;
- bt->y1 += yof;
- bt->y2 += yof;
-
- bt->aspect= 1.0;
- // ui_check_but recalculates drawstring size in pixels
- ui_check_but(bt);
- }
-
- block->minx += xof;
- block->miny += yof;
- block->maxx += xof;
- block->maxy += yof;
-
- /* safety calculus */
- if(but) {
- float midx= (block->parentrct.xmin+block->parentrct.xmax)/2.0;
- float midy= (block->parentrct.ymin+block->parentrct.ymax)/2.0;
-
- /* when you are outside parent button, safety there should be smaller */
-
- // parent button to left
- if( midx < block->minx ) block->safety.xmin= block->minx-3;
- else block->safety.xmin= block->minx-40;
- // parent button to right
- if( midx > block->maxx ) block->safety.xmax= block->maxx+3;
- else block->safety.xmax= block->maxx+40;
-
- // parent button on bottom
- if( midy < block->miny ) block->safety.ymin= block->miny-3;
- else block->safety.ymin= block->miny-40;
- // parent button on top
- if( midy > block->maxy ) block->safety.ymax= block->maxy+3;
- else block->safety.ymax= block->maxy+40;
-
- // exception for switched pulldowns...
- if(dir1 && (dir1 & block->direction)==0) {
- if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3;
- if(dir2==UI_LEFT) block->safety.xmin= block->minx-3;
- }
- block->direction= dir1;
- }
- else {
- block->safety.xmin= block->minx-40;
- block->safety.ymin= block->miny-40;
- block->safety.xmax= block->maxx+40;
- block->safety.ymax= block->maxy+40;
- }
-
-}
-
-
-void ui_autofill(uiBlock *block)
-{
- uiBut *but;
- float *maxw, *maxh, startx = 0, starty, height = 0;
- float totmaxh;
- int rows=0, /* cols=0, */ i, lasti;
-
- /* first count rows */
- but= block->buttons.last;
- rows= but->x1+1;
-
- /* calculate max width / height for each row */
- maxw= MEM_callocN(sizeof(float)*rows, "maxw");
- maxh= MEM_callocN(sizeof(float)*rows, "maxh");
- but= block->buttons.first;
- while(but) {
- i= but->x1;
- if( maxh[i] < but->y2) maxh[i]= but->y2;
- maxw[i] += but->x2;
- but= but->next;
- }
-
- totmaxh= 0.0;
- for(i=0; i<rows; i++) totmaxh+= maxh[i];
-
- /* apply widths/heights */
- starty= block->maxy;
- but= block->buttons.first;
- lasti= -1;
- while(but) {
- // signal for aligning code
- but->flag |= UI_BUT_ALIGN_DOWN;
-
- i= but->x1;
-
- if(i!=lasti) {
- startx= block->minx;
- height= (maxh[i]*(block->maxy-block->miny))/totmaxh;
- starty-= height;
- lasti= i;
- }
-
- but->y1= starty+but->aspect;
- but->y2= but->y1+height-but->aspect;
-
- but->x2= (but->x2*(block->maxx-block->minx))/maxw[i];
- but->x1= startx+but->aspect;
-
- startx+= but->x2;
- but->x2+= but->x1-but->aspect;
-
- ui_check_but(but);
-
- but= but->next;
- }
-
- uiBlockEndAlign(block);
-
- MEM_freeN(maxw); MEM_freeN(maxh);
- block->autofill= 0;
-}
-
-/* ************** LINK LINE DRAWING ************* */
-
-/* link line drawing is not part of buttons or theme.. so we stick with it here */
-
-static void ui_draw_linkline(uiBut *but, uiLinkLine *line)
-{
- float vec1[2], vec2[2];
-
- if(line->from==NULL || line->to==NULL) return;
-
- vec1[0]= (line->from->x1+line->from->x2)/2.0;
- vec1[1]= (line->from->y1+line->from->y2)/2.0;
- vec2[0]= (line->to->x1+line->to->x2)/2.0;
- vec2[1]= (line->to->y1+line->to->y2)/2.0;
-
- if(line->flag & UI_SELECT) BIF_ThemeColorShade(but->themecol, 80);
- else glColor3ub(0,0,0);
- fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]);
-}
-
-static void ui_draw_links(uiBlock *block)
-{
- uiBut *but;
- uiLinkLine *line;
-
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- line= but->link->lines.first;
- while(line) {
- ui_draw_linkline(but, line);
- line= line->next;
- }
- }
- but= but->next;
- }
-}
-
-/* ************** BLOCK DRAWING FUNCTION ************* */
-
-
-void uiDrawBlock(uiBlock *block)
-{
- uiBut *but;
- short testmouse=0, mouse[2];
-
- /* we set this only once */
- glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-
- /* handle pending stuff */
- if(block->autofill) ui_autofill(block);
- if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0);
- if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
-
- /* we set active flag on a redraw again */
- if((block->flag & UI_BLOCK_LOOP)==0) {
- testmouse= 1;
- Mat4CpyMat4(UIwinmat, block->winmat);
- }
-
- uiPanelPush(block); // panel matrix
-
- if(block->flag & UI_BLOCK_LOOP) {
- uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag);
- }
- else {
- if(block->panel) ui_draw_panel(block);
- }
-
- if(block->drawextra) block->drawextra(curarea, block);
-
- if(testmouse) /* do it after panel push, otherwise coords are wrong */
- uiGetMouse(block->win, mouse);
-
- for (but= block->buttons.first; but; but= but->next) {
-
- if(testmouse && uibut_contains_pt(but, mouse))
- but->flag |= UI_ACTIVE;
-
- ui_draw_but(but);
- }
-
- ui_draw_links(block);
-
- uiPanelPop(block); // matrix restored
-}
-
-/* ************* MENUBUTS *********** */
-
-typedef struct {
- char *str;
- int retval;
- int icon;
-} MenuEntry;
-
-typedef struct {
- char *instr;
- char *title;
- int titleicon;
-
- MenuEntry *items;
- int nitems, itemssize;
-} MenuData;
-
-static MenuData *menudata_new(char *instr) {
- MenuData *md= MEM_mallocN(sizeof(*md), "MenuData");
-
- md->instr= instr;
- md->title= NULL;
- md->titleicon= 0;
- md->items= NULL;
- md->nitems= md->itemssize= 0;
-
- return md;
-}
-
-static void menudata_set_title(MenuData *md, char *title, int titleicon) {
- if (!md->title)
- md->title= title;
- if (!md->titleicon)
- md->titleicon= titleicon;
-}
-
-static void menudata_add_item(MenuData *md, char *str, int retval, int icon) {
- if (md->nitems==md->itemssize) {
- int nsize= md->itemssize?(md->itemssize<<1):1;
- MenuEntry *oitems= md->items;
-
- md->items= MEM_mallocN(nsize*sizeof(*md->items), "md->items");
- if (oitems) {
- memcpy(md->items, oitems, md->nitems*sizeof(*md->items));
- MEM_freeN(oitems);
- }
-
- md->itemssize= nsize;
- }
-
- md->items[md->nitems].str= str;
- md->items[md->nitems].retval= retval;
- md->items[md->nitems].icon= icon;
- md->nitems++;
-}
-
-static void menudata_free(MenuData *md) {
- MEM_freeN(md->instr);
- if (md->items)
- MEM_freeN(md->items);
- MEM_freeN(md);
-}
-
- /**
- * Parse menu description strings, string is of the
- * form "[sss%t|]{(sss[%xNN]|), (%l|)}", ssss%t indicates the
- * menu title, sss or sss%xNN indicates an option,
- * if %xNN is given then NN is the return value if
- * that option is selected otherwise the return value
- * is the index of the option (starting with 1). %l
- * indicates a seperator.
- *
- * @param str String to be parsed.
- * @retval new menudata structure, free with menudata_free()
- */
-static MenuData *decompose_menu_string(char *str)
-{
- char *instr= BLI_strdup(str);
- MenuData *md= menudata_new(instr);
- char *nitem= NULL, *s= instr;
- int nicon=0, nretval= 1, nitem_is_title= 0;
-
- while (1) {
- char c= *s;
-
- if (c=='%') {
- if (s[1]=='x') {
- nretval= atoi(s+2);
-
- *s= '\0';
- s++;
- } else if (s[1]=='t') {
- nitem_is_title= 1;
-
- *s= '\0';
- s++;
- } else if (s[1]=='l') {
- nitem= "%l";
- s++;
- } else if (s[1]=='i') {
- nicon= atoi(s+2);
-
- *s= '\0';
- s++;
- }
- } else if (c=='|' || c=='\0') {
- if (nitem) {
- *s= '\0';
-
- if (nitem_is_title) {
- menudata_set_title(md, nitem, nicon);
- nitem_is_title= 0;
- } else {
- /* prevent separator to get a value */
- if(nitem[0]=='%' && nitem[1]=='l')
- menudata_add_item(md, nitem, -1, nicon);
- else
- menudata_add_item(md, nitem, nretval, nicon);
- nretval= md->nitems+1;
- }
-
- nitem= NULL;
- nicon= 0;
- }
-
- if (c=='\0')
- break;
- } else if (!nitem)
- nitem= s;
-
- s++;
- }
-
- return md;
-}
-
-static void ui_set_name_menu(uiBut *but, int value)
-{
- MenuData *md;
- int i;
-
- md= decompose_menu_string(but->str);
- for (i=0; i<md->nitems; i++)
- if (md->items[i].retval==value)
- strcpy(but->drawstr, md->items[i].str);
-
- menudata_free(md);
-}
-
-static void ui_warp_pointer(short x, short y)
-{
- /* OSX has very poor mousewarp support, it sends events;
- this causes a menu being pressed immediately ... */
- #ifndef __APPLE__
- warp_pointer(x, y);
- #endif
-}
-
-#define TBOXH 20
-static int ui_do_but_MENU(uiBut *but)
-{
- uiBlock *block;
- uiBut *bt;
- ListBase listb={NULL, NULL}, lb;
- double fvalue;
- int width, height=0, a, xmax, starty;
- short startx;
- int columns=1, rows=0, boxh, event;
- short x1, y1, active= -1;
- short mval[2];
- MenuData *md;
-
- but->flag |= UI_SELECT;
- ui_draw_but(but);
- ui_block_flush_back(but->block); // flush because this button creates own blocks loop
-
- block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
-
- md= decompose_menu_string(but->str);
-
- /* columns and row calculation */
- columns= (md->nitems+20)/20;
- if (columns<1) columns= 1;
-
- if(columns>8) columns= (md->nitems+25)/25;
-
- rows= (int) md->nitems/columns;
- if (rows<1) rows= 1;
-
- while (rows*columns<md->nitems) rows++;
-
- /* prevent scaling up of pupmenu */
- if (but->aspect < 1.0f) but->aspect = 1.0f;
-
- /* size and location */
- if(md->title)
- width= 1.5*but->aspect*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS));
- else
- width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= but->aspect*BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS));
- if ( md->items[a].icon) xmax += 20*but->aspect;
- if(xmax>width) width= xmax;
- }
-
- width+= 10;
- if (width < (but->x2 - but->x1)) width = (but->x2 - but->x1);
- if (width<50) width=50;
-
- boxh= TBOXH;
-
- height= rows*boxh;
- if (md->title) height+= boxh;
-
- getmouseco_sc(mval);
-
- /* find active item */
- fvalue= ui_get_but_val(but);
- for(active=0; active<md->nitems; active++) {
- if( md->items[active].retval== (int)fvalue ) break;
- }
- /* no active item? */
- if(active==md->nitems) {
- if(md->title) active= -1;
- else active= 0;
- }
-
- /* for now disabled... works confusing because you think it's a title or so.... */
- active= -1;
-
- /* here we go! */
- startx= but->x1;
- starty= but->y1;
-
- if(md->title) {
- uiBut *bt;
- uiSetCurFont(block, block->font+1);
- if (md->titleicon) {
- uiDefIconTextBut(block, LABEL, 0, md->titleicon, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
- } else {
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
- }
- uiSetCurFont(block, block->font);
-
- }
-
- for(a=0; a<md->nitems; a++) {
-
- x1= but->x1 + width*((int)(md->nitems-a-1)/rows);
- y1= but->y1 - boxh*(rows - ((md->nitems - a - 1)%rows)) + (rows*boxh);
-
- if (strcmp(md->items[md->nitems-a-1].str, "%l")==0) {
- uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, "");
- }
- else if(md->items[md->nitems-a-1].icon) {
- uiBut *bt= uiDefIconTextBut(block, BUTM|but->pointype, but->retval, md->items[md->nitems-a-1].icon ,md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), but->poin, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
- if(active==a) bt->flag |= UI_ACTIVE;
- }
- else {
- uiBut *bt= uiDefBut(block, BUTM|but->pointype, but->retval, md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), but->poin, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, "");
- if(active==a) bt->flag |= UI_ACTIVE;
- }
- }
-
- /* the code up here has flipped locations, because of change of preferred order */
- /* thats why we have to switch list order too, to make arrowkeys work */
-
- lb.first= lb.last= NULL;
- bt= block->buttons.first;
- while(bt) {
- uiBut *next= bt->next;
- BLI_remlink(&block->buttons, bt);
- BLI_addhead(&lb, bt);
- bt= next;
- }
- block->buttons= lb;
-
- /* and lets go */
- block->direction= UI_TOP;
- ui_positionblock(block, but);
-
- /* blocks can come (and get scaled) from a normal window, now we go to screenspace */
- block->win= G.curscreen->mainwin;
- for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win;
- bwin_getsinglematrix(block->win, block->winmat);
-
- event= uiDoBlocks(&listb, 0, 1);
-
- menudata_free(md);
-
- but->flag &= ~UI_SELECT;
- ui_check_but(but);
- /* no draw of button now, for floating panels the matrix now is invalid...
- the button still is active, and will be redrawn in main loop to de-activate it */
- /* but, if no hilites, we send redraw to queue */
- if(but->flag & UI_NO_HILITE)
- addqueue(but->block->winq, REDRAW, 1);
-
- uibut_do_func(but);
-
- /* return no existing event, because the menu sends events instead */
- return -1;
-}
-
-/* ********************** NEXT/PREV for arrowkeys etc ************** */
-
-static uiBut *ui_but_prev(uiBut *but)
-{
- while(but->prev) {
- but= but->prev;
- if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
- }
- return NULL;
-}
-
-static uiBut *ui_but_next(uiBut *but)
-{
- while(but->next) {
- but= but->next;
- if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
- }
- return NULL;
-}
-
-static uiBut *ui_but_first(uiBlock *block)
-{
- uiBut *but;
-
- but= block->buttons.first;
- while(but) {
- if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
- but= but->next;
- }
- return NULL;
-}
-
-static uiBut *ui_but_last(uiBlock *block)
-{
- uiBut *but;
-
- but= block->buttons.last;
- while(but) {
- if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but;
- but= but->prev;
- }
- return NULL;
-}
-
-
-/* ************* IN-BUTTON TEXT SELECTION/EDITING ************* */
-
-static short ui_delete_selection_edittext(uiBut *but)
-{
- int x;
- short deletedwidth=0;
- char *str;
-
- str= (char *)but->poin;
-
- deletedwidth = (but->selend - but->selsta);
-
- for(x=0; x< strlen(str); x++) {
- if (but->selend + x <= strlen(str) ) {
- str[but->selsta + x]= str[but->selend + x];
- } else {
- str[but->selsta + x]= '\0';
- break;
- }
- }
- but->pos = but->selend = but->selsta;
-
- return deletedwidth;
-}
-
-static void ui_set_cursor_pos_edittext(uiBut *but, short sx)
-{
- char backstr[UI_MAX_DRAW_STR];
-
- BLI_strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR);
- but->pos= strlen(backstr)-but->ofs;
-
- while((but->aspect*BIF_GetStringWidth(but->font, backstr+but->ofs, 0) + but->x1) > sx) {
- if (but->pos <= 0) break;
- but->pos--;
- backstr[but->pos+but->ofs] = 0;
- }
-
- but->pos -= strlen(but->str);
- but->pos += but->ofs;
- if(but->pos<0) but->pos= 0;
-}
-
-
-/* ************* EVENTS ************* */
-
-void uiGetMouse(int win, short *adr)
-{
- int x, y;
- float xwin, ywin;
-
- getmouseco_sc(adr);
- if (win == G.curscreen->mainwin) return;
-
- bwin_getsuborigin(win, &x, &y);
-
- adr[0]-= x;
- adr[1]-= y;
-
- xwin= adr[0];
- ywin= adr[1];
-
- ui_window_to_graphics(win, &xwin, &ywin);
-
- adr[0]= (short)(xwin+0.5);
- adr[1]= (short)(ywin+0.5);
-}
-
-static void ui_is_but_sel(uiBut *but)
-{
- double value;
- int lvalue;
- short push=0, true=1;
-
- value= ui_get_but_val(but);
-
- if( but->type==TOGN || but->type==ICONTOGN) true= 0;
-
- if( but->bit ) {
- lvalue= (int)value;
- if( BTST(lvalue, (but->bitnr)) ) push= true;
- else push= !true;
- }
- else {
- switch(but->type) {
- case BUT:
- push= 0;
- break;
- case KEYEVT:
- if (value==-1) push= 1;
- break;
- case TOG:
- case TOGR:
- case TOG3:
- case BUT_TOGDUAL:
- case ICONTOG:
- if(value!=but->min) push= 1;
- break;
- case ICONTOGN:
- case TOGN:
- if(value==0.0) push= 1;
- break;
- case ROW:
- if(value == but->max) push= 1;
- break;
- case COL:
- push= 1;
- break;
- default:
- push= 2;
- break;
- }
- }
-
- if(push==2);
- else if(push==1) but->flag |= UI_SELECT;
- else but->flag &= ~UI_SELECT;
-}
-
-static int ui_do_but_BUT(uiBut *but)
-{
- int activated;
-
- do {
- int oflag= but->flag;
- short mval[2];
-
- uiGetMouse(mywinget(), mval);
-
- if (uibut_contains_pt(but, mval))
- but->flag |= UI_SELECT;
- else
- but->flag &= ~UI_SELECT;
-
- if (but->flag != oflag) {
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
-
- PIL_sleep_ms(10);
- } while (get_mbut() & L_MOUSE);
-
- activated= (but->flag & UI_SELECT);
-
- if(activated) {
- UIafterfunc_but= but->func;
- UIafterfunc_arg1= but->func_arg1;
- UIafterfunc_arg2= but->func_arg2;
- /* no more uibut_do_func(but); this button calls fileselecting windows */
- }
-
- but->flag &= ~UI_SELECT;
- ui_draw_but(but);
-
- return activated?but->retval:0;
-}
-
-static int ui_do_but_KEYEVT(uiBut *but)
-{
- unsigned short event= 0;
- short val;
-
- /* flag for ui_check_but */
- ui_set_but_val(but, -1);
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- do {
- event= extern_qread(&val);
- } while (!event || !val || ELEM(event, MOUSEX, MOUSEY));
-
- if (!key_event_to_string(event)[0]) event= 0;
-
- ui_set_but_val(but, (double) event);
- ui_check_but(but);
- ui_draw_but(but);
-
- return (event!=0);
-}
-
-static int ui_do_but_TOG(uiBlock *block, uiBut *but, int qual)
-{
- uiBut *bt;
- double value;
- int w, lvalue, push;
-
- /* local hack... */
- if(but->type==BUT_TOGDUAL && qual==LR_CTRLKEY) {
- if(but->pointype==SHO)
- but->poin += 2;
- else if(but->pointype==INT)
- but->poin += 4;
- }
-
- value= ui_get_but_val(but);
- lvalue= (int)value;
-
- if(but->bit) {
- w= BTST(lvalue, but->bitnr);
- if(w) lvalue = BCLR(lvalue, but->bitnr);
- else lvalue = BSET(lvalue, but->bitnr);
-
- if(but->type==TOGR) {
- if( (get_qual() & LR_SHIFTKEY)==0 ) {
- lvalue= 1<<(but->bitnr);
-
- ui_set_but_val(but, (double)lvalue);
-
- bt= block->buttons.first;
- while(bt) {
- if( bt!=but && bt->poin==but->poin ) {
- ui_is_but_sel(bt);
- ui_draw_but(bt);
- }
- bt= bt->next;
- }
- }
- else {
- if(lvalue==0) lvalue= 1<<(but->bitnr);
- }
- }
-
- ui_set_but_val(but, (double)lvalue);
- if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
- // no frontbuffer draw for this one
- if(but->type==BUT_TOGDUAL);
- else if((but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
- }
- else {
-
- if(value==0.0) push= 1;
- else push= 0;
-
- if(but->type==TOGN || but->type==ICONTOGN) push= !push;
- ui_set_but_val(but, (double)push);
- if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but);
- // no frontbuffer draw for this one
- if((but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
- }
-
- /* end local hack... */
- if(but->type==BUT_TOGDUAL && qual==LR_CTRLKEY) {
- if(but->pointype==SHO)
- but->poin -= 2;
- else if(but->pointype==INT)
- but->poin -= 4;
- }
-
- /* no while loop...this button is used for viewmove */
-
- uibut_do_func(but);
-
- return but->retval;
-}
-
-static int ui_do_but_ROW(uiBlock *block, uiBut *but)
-{
- uiBut *bt;
-
- ui_set_but_val(but, but->max);
- ui_draw_but(but);
-
- bt= block->buttons.first;
- while(bt) {
- if( bt!=but && bt->type==ROW ) {
- if(bt->min==but->min) {
- ui_is_but_sel(bt);
- ui_draw_but(bt);
- }
- }
- bt= bt->next;
- }
- return but->retval;
-}
-
-/* return 1 if char ch is special character otherwise
- * it returns 0 */
-static short test_special_char(char ch)
-{
- switch(ch) {
- case '\\':
- case '/':
- case '~':
- case '!':
- case '@':
- case '#':
- case '$':
- case '%':
- case '^':
- case '&':
- case '*':
- case '(':
- case ')':
- case '+':
- case '=':
- case '{':
- case '}':
- case '[':
- case ']':
- case ':':
- case ';':
- case '\'':
- case '\"':
- case '<':
- case '>':
- case ',':
- case '.':
- case '?':
- case '_':
- case '-':
- case ' ':
- return 1;
- break;
- default:
- break;
- }
- return 0;
-}
-
-static int ui_do_but_TEX(uiBut *but)
-{
- unsigned short dev;
- short x, y, mval[2], len=0, dodraw, selextend=0;
- char *str, backstr[UI_MAX_DRAW_STR];
- short capturing, sx, sy, prevx;
-
- str= (char *)but->poin;
-
- but->flag |= UI_SELECT;
-
- uiGetMouse(mywinget(), mval);
-
- /* set cursor pos to the end of the text */
- but->pos = strlen(str);
- but->selsta = 0;
- but->selend = strlen(but->drawstr) - strlen(but->str);
-
- /* backup */
- BLI_strncpy(backstr, but->poin, UI_MAX_DRAW_STR);
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- while (get_mbut() & L_MOUSE) BIF_wait_for_statechange();
- len= strlen(str);
-
- but->min= 0.0;
-
- capturing = TRUE;
- while(capturing) {
- char ascii;
- short val;
-
- dodraw= 0;
- dev = extern_qread_ext(&val, &ascii);
-
- if(dev==INPUTCHANGE) break;
- else if(get_mbut() & R_MOUSE) break;
- else if(get_mbut() & L_MOUSE) {
- uiGetMouse(mywinget(), mval);
- sx = mval[0]; sy = mval[1];
-
- if ((but->y1 <= sy) && (sy <= but->y2) && (but->x1 <= sx) && (sx <= but->x2)) {
- ui_set_cursor_pos_edittext(but, mval[0]);
-
- but->selsta = but->selend = but->pos;
-
- /* drag text select */
- prevx= mval[0];
- while (get_mbut() & L_MOUSE) {
- uiGetMouse(mywinget(), mval);
-
- if(prevx!=mval[0]) {
-
- if (mval[0] > sx) selextend = EXTEND_RIGHT;
- else if (mval[0] < sx) selextend = EXTEND_LEFT;
-
- ui_set_cursor_pos_edittext(but, mval[0]);
-
- if (selextend == EXTEND_RIGHT) but->selend = but->pos;
- if (selextend == EXTEND_LEFT) but->selsta = but->pos;
-
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
- PIL_sleep_ms(10);
- }
- dodraw= 1;
- } else break;
- }
- else if(dev==ESCKEY) break;
- else if(dev==MOUSEX) val= 0;
- else if(dev==MOUSEY) val= 0;
-
- /* cut, copy, paste selected text */
- /* mainqread discards ascii values < 32, so can't do this cleanly within the if(ascii) block*/
- else if ( (val) &&
- ((G.qual & LR_COMMANDKEY) || (G.qual & LR_CTRLKEY)) &&
- ((dev==XKEY) || (dev==CKEY) || (dev==VKEY)) ) {
-
- char buf[UI_MAX_DRAW_STR+1]={0};
-
- /* paste */
- if (dev==VKEY) {
-
- /* extract the first line from the clipboard */
- char *p = getClipboard(0);
- if(p) {
- int i = 0;
- while (*p && *p!='\r' && *p!='\n' && i<UI_MAX_DRAW_STR) {
- buf[i++]=*p;
- p++;
- }
- buf[i]= 0;
-
- /* paste over the current selection */
- if ((but->selend - but->selsta) > 0) {
- len -= ui_delete_selection_edittext(but);
- }
-
- for (y=0; y<strlen(buf); y++)
- {
- /* add contents of buffer */
- if(len < but->max) {
- for(x= but->max; x>but->pos; x--)
- str[x]= str[x-1];
- str[but->pos]= buf[y];
- but->pos++;
- len++;
- str[len]= '\0';
- }
- }
- if (strlen(buf) > 0) dodraw= 1;
- }
- }
- /* cut & copy */
- else if ( (dev==XKEY) || (dev==CKEY) ) {
- /* copy the contents to the clipboard */
- for(x= but->selsta; x <= but->selend; x++) {
- if (x==but->selend)
- buf[x] = '\0';
- else
- buf[(x - but->selsta)] = str[x];
- }
- putClipboard(buf, 0);
-
- /* for cut only, delete the selection afterwards */
- if (dev==XKEY) {
- if ((but->selend - but->selsta) > 0) {
- len -= ui_delete_selection_edittext(but);
-
- if (len < 0) len = 0;
- dodraw=1;
- }
- }
- }
- }
- else if((ascii)){
-
- if(len-(but->selend - but->selsta)+1 <= but->max) {
-
- /* type over the current selection */
- if ((but->selend - but->selsta) > 0) {
- len -= ui_delete_selection_edittext(but);
- }
-
- if(len < but->max) {
- for(x= but->max; x>but->pos; x--)
- str[x]= str[x-1];
- str[but->pos]= ascii;
- but->pos++;
- len++;
- str[len]= '\0';
- dodraw= 1;
- }
- }
- }
- else if(val) {
-
- switch (dev) {
-
- case RIGHTARROWKEY:
- /* if there's a selection */
- if ((but->selend - but->selsta) > 0) {
- /* extend the selection based on the first direction taken */
- if(G.qual & LR_SHIFTKEY) {
- if (!selextend) {
- selextend = EXTEND_RIGHT;
- }
- if (selextend == EXTEND_RIGHT) {
- but->selend++;
- if (but->selend > len) but->selend = len;
- } else if (selextend == EXTEND_LEFT) {
- but->selsta++;
- /* if the selection start has gone past the end,
- * flip them so they're in sync again */
- if (but->selsta == but->selend) {
- but->pos = but->selsta;
- selextend = EXTEND_RIGHT;
- }
- }
- } else {
- but->selsta = but->pos = but->selend;
- selextend = 0;
- }
- } else {
- if(G.qual & LR_SHIFTKEY) {
- /* make a selection, starting from the cursor position */
- but->selsta = but->pos;
-
- but->pos++;
- if(but->pos>strlen(str)) but->pos= strlen(str);
-
- but->selend = but->pos;
- } else if(G.qual & LR_CTRLKEY) {
- /* jump betweenn special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while(but->pos < len) {
- but->pos++;
- if(test_special_char(str[but->pos])) break;
- }
- } else {
- but->pos++;
- if(but->pos>strlen(str)) but->pos= strlen(str);
- }
- }
- dodraw= 1;
- break;
-
- case LEFTARROWKEY:
- /* if there's a selection */
- if ((but->selend - but->selsta) > 0) {
- /* extend the selection based on the first direction taken */
- if(G.qual & LR_SHIFTKEY) {
- if (!selextend) {
- selextend = EXTEND_LEFT;
- }
- if (selextend == EXTEND_LEFT) {
- but->selsta--;
- if (but->selsta < 0) but->selsta = 0;
- } else if (selextend == EXTEND_RIGHT) {
- but->selend--;
- /* if the selection start has gone past the end,
- * flip them so they're in sync again */
- if (but->selsta == but->selend) {
- but->pos = but->selsta;
- selextend = EXTEND_LEFT;
- }
- }
- } else {
- but->pos = but->selend = but->selsta;
- selextend = 0;
- }
- } else {
- if(G.qual & LR_SHIFTKEY) {
- /* make a selection, starting from the cursor position */
- but->selend = but->pos;
-
- but->pos--;
- if(but->pos<0) but->pos= 0;
-
- but->selsta = but->pos;
- } else if(G.qual & LR_CTRLKEY) {
- /* jump betweenn special characters (/,\,_,-, etc.),
- * look at function test_special_char() for complete
- * list of special character, ctr -> */
- while(but->pos > 0){
- but->pos--;
- if(test_special_char(str[but->pos])) break;
- }
- } else {
- if(but->pos>0) but->pos--;
- }
- }
- dodraw= 1;
- break;
-
- case DOWNARROWKEY:
- case ENDKEY:
- if(G.qual & LR_SHIFTKEY) {
- but->selsta = but->pos;
- but->selend = strlen(str);
- selextend = EXTEND_RIGHT;
- } else {
- but->selsta = but->selend = but->pos= strlen(str);
- }
- dodraw= 1;
- break;
-
- case UPARROWKEY:
- case HOMEKEY:
- if(G.qual & LR_SHIFTKEY) {
- but->selend = but->pos;
- but->selsta = 0;
- selextend = EXTEND_LEFT;
- } else {
- but->selsta = but->selend = but->pos= 0;
- }
- dodraw= 1;
- break;
-
- case PADENTER:
- case RETKEY:
- capturing = FALSE;
- break;
-
- case DELKEY:
- if ((but->selend - but->selsta) > 0) {
- len -= ui_delete_selection_edittext(but);
-
- if (len < 0) len = 0;
- dodraw=1;
- }
- else if(but->pos>=0 && but->pos<strlen(str)) {
- for(x=but->pos; x<=strlen(str); x++)
- str[x]= str[x+1];
- str[--len]='\0';
- dodraw= 1;
- }
- break;
-
- case BACKSPACEKEY:
- if(len!=0) {
- if ((but->selend - but->selsta) > 0) {
- len -= ui_delete_selection_edittext(but);
-
- if (len < 0) len = 0;
- dodraw=1;
- }
- else if(get_qual() & LR_SHIFTKEY) {
- str[0]= 0;
- but->pos= 0;
- len= 0;
- dodraw= 1;
- }
- else if(but->pos>0) {
- for(x=but->pos; x<=strlen(str); x++)
- str[x-1]= str[x];
- but->pos--;
- str[--len]='\0';
- dodraw= 1;
- }
- }
- break;
-
- case TABKEY:
- if(but->autocomplete_func) {
- but->autocomplete_func(str, but->autofunc_arg);
- but->pos= strlen(str);
- len= but->pos;
- dodraw= 1;
- }
- else capturing= FALSE;
-
- break;
- }
- }
-
-
- if(dodraw) {
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
- }
-
- if(dev==ESCKEY) strcpy(but->poin, backstr);
- but->pos= -1;
- but->flag &= ~UI_SELECT;
-
- if(dev!=ESCKEY) {
- /* give butfunc the original text too */
- /* feature used for bone renaming, channels, etc */
- if(but->func_arg2==NULL) but->func_arg2= backstr;
- uibut_do_func(but);
- }
-
- ui_check_but(but);
- ui_draw_but(but);
-
- if(dev==TABKEY) addqueue(but->win, G.qual?BUT_PREV:BUT_NEXT, 1);
-
- if(dev!=ESCKEY) return but->retval;
- else return B_NOP; // prevent event to be passed on
-}
-
-
-static int ui_act_as_text_but(uiBut *but)
-{
- void *but_func;
- double value;
- float min, max;
- int temp, retval, textleft;
- char str[UI_MAX_DRAW_STR], *point;
-
- /* this function is abused for tab-cycling */
- if(but->type==TEX)
- return ui_do_but_TEX(but);
-
- value= ui_get_but_val(but);
- if( but->pointype==FLO ) {
- if(but->a2) { /* amount of digits defined */
- if(but->a2==1) sprintf(str, "%.1f", value);
- else if(but->a2==2) sprintf(str, "%.2f", value);
- else if(but->a2==3) sprintf(str, "%.3f", value);
- else sprintf(str, "%.4f", value);
- }
- else sprintf(str, "%.3f", value);
- }
- else {
- sprintf(str, "%d", (int)value);
- }
- /* store values before calling as text button */
- point= but->poin;
- but->poin= str;
- but_func= but->func;
- but->func= NULL;
- min= but->min;
- max= but->max;
- but->min= 0.0;
- but->max= UI_MAX_DRAW_STR - 1; /* for py strings evaluation */
- temp= but->type;
- but->type= TEX;
- textleft= but->flag & UI_TEXT_LEFT;
- but->flag |= UI_TEXT_LEFT;
- ui_check_but(but);
-
- retval= ui_do_but_TEX(but);
-
- /* restore values */
- but->type= temp;
- but->poin= point;
- but->func= but_func;
- but->min= min;
- but->max= max;
- if(textleft==0) but->flag &= ~UI_TEXT_LEFT;
-
-#ifndef DISABLE_PYTHON
- if(BPY_button_eval(str, &value)) {
- /* Uncomment this if you want to see an error message (and annoy users) */
- /* error("Invalid Python expression, check console");*/
- value = 0.0f; /* Zero out value on error */
-
- if(str[0])
- retval = B_NOP; /* invalidate return value if eval failed, except when string was null */
- }
-#else
- value=atof(str);
-#endif
-
- if(but->pointype!=FLO) value= (int)value;
-
- if(but->type==NUMABS) value= fabs(value);
- if(value<min) value= min;
- if(value>max) value= max;
-
- ui_set_but_val(but, value);
- ui_check_but(but);
- ui_draw_but(but);
-
- return retval;
-}
-
-static int ui_do_but_NUM(uiBut *but)
-{
- double value, butrange;
- float deler, fstart, f, tempf, pressure;
- int lvalue, temp, orig_x; /* , firsttime=1; */
- short retval=0, qual, sx, mval[2], pos=0;
-
- but->flag |= UI_SELECT;
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- uiGetMouse(mywinget(), mval);
- value= ui_get_but_val(but);
-
- sx= mval[0];
- orig_x = sx; /* Store so we can scale the rate of change by the dist the mouse is from its original xlocation */
- butrange= (but->max - but->min);
- fstart= (butrange == 0.0)? 0.0f: (value - but->min)/butrange;
- f= fstart;
-
- temp= (int)value;
- tempf= value;
-
- if(get_qual() & LR_SHIFTKEY) { /* make it textbut */
- if( ui_act_as_text_but(but) ) retval= but->retval;
- }
- else {
- retval= but->retval;
- /* firsttime: this button can be approached with enter as well */
-
- /* drag-lock - prevent unwanted scroll adjustments */
- /* change last value (now 3) to adjust threshold in pixels */
- while (get_mbut() & L_MOUSE & ( abs(mval[0]-sx) <= 3) ) {
- uiGetMouse(mywinget(), mval);
- }
- sx = mval[0]; /* ignore mouse movement within drag-lock */
-
- while (get_mbut() & L_MOUSE) {
- qual= get_qual();
- pressure = get_pressure();
-
- uiGetMouse(mywinget(), mval);
-
- deler= 500;
- if( but->pointype!=FLO ) {
-
- if( (but->max-but->min)<100 ) deler= 200.0;
- if( (but->max-but->min)<25 ) deler= 50.0;
- }
-
- if(qual & LR_SHIFTKEY) deler*= 10.0;
- if(qual & LR_ALTKEY) deler*= 20.0;
-
- /* de-sensitise based on tablet pressure */
- if (ELEM(get_activedevice(), DEV_STYLUS, DEV_ERASER)) deler /= pressure;
-
- if(mval[0] != sx) {
- if( but->pointype==FLO && but->max-but->min > 11) {
- /* non linear change in mouse input- good for high precicsion */
- f+= (((float)(mval[0]-sx))/deler) * (fabs(orig_x-mval[0])*0.002);
- } else if ( but->pointype!=FLO && but->max-but->min > 129) { /* only scale large int buttons */
- /* non linear change in mouse input- good for high precicsionm ints need less fine tuning */
- f+= (((float)(mval[0]-sx))/deler) * (fabs(orig_x-mval[0])*0.004);
- } else {
- /*no scaling */
- f+= ((float)(mval[0]-sx))/deler ;
- }
-
- if(f>1.0) f= 1.0;
- if(f<0.0) f= 0.0;
- sx= mval[0];
- tempf= ( but->min + f*(but->max-but->min));
-
- if( but->pointype!=FLO ) {
-
- temp= floor(tempf+.5);
-
- if(tempf==but->min || tempf==but->max);
- else if(qual & LR_CTRLKEY) {
- if(qual & LR_SHIFTKEY) temp= 100*(temp/100);
- else temp= 10*(temp/10);
- }
- if( temp>=but->min && temp<=but->max) {
-
- value= ui_get_but_val(but);
- lvalue= (int)value;
-
- if(temp != lvalue ) {
- pos= 1;
- ui_set_but_val(but, (double)temp);
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- uibut_do_func(but);
- }
- }
-
- }
- else {
- temp= 0;
- if(qual & LR_CTRLKEY) {
- if(qual & LR_SHIFTKEY) {
- if(tempf==but->min || tempf==but->max);
- else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf);
- else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf);
- else tempf= floor(tempf);
- }
- else {
- if(tempf==but->min || tempf==but->max);
- else if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf);
- else if(but->max-but->min < 21.0) tempf= floor(tempf);
- else tempf= 10.0*floor(tempf/10.0);
- }
- }
-
- if( tempf>=but->min && tempf<=but->max) {
- value= ui_get_but_val(but);
-
- if(tempf != value ) {
- pos= 1;
- ui_set_but_val(but, tempf);
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
- }
-
- }
- }
- BIF_wait_for_statechange();
- }
-
- /* click on the side arrows to increment/decrement, click inside
- * to edit the value directly */
- if(pos==0) { /* plus 1 or minus 1 */
- if( but->pointype!=FLO ) {
-
- if(sx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
- temp--;
- if( temp>=but->min && temp<=but->max) ui_set_but_val(but, (double)temp);
- }
- else if(sx > (but->x1 + (2*(but->x2 - but->x1)/3) + 3)) {
- temp++;
- if( temp>=but->min && temp<=but->max) ui_set_but_val(but, (double)temp);
- }
- else {
- if( ui_act_as_text_but(but) ); else retval= 0;
- }
- }
- else {
-
- if(sx < (but->x1 + (but->x2 - but->x1)/3 - 3)) {
- tempf-= 0.01*but->a1;
- if (tempf < but->min) tempf = but->min;
- ui_set_but_val(but, tempf);
- }
- else if(sx > but->x1 + (2*((but->x2 - but->x1)/3) + 3)) {
- tempf+= 0.01*but->a1;
- if (tempf < but->min) tempf = but->min;
- ui_set_but_val(but, tempf);
- }
- else {
- if( ui_act_as_text_but(but) ); else retval= 0;
- }
- }
- }
- }
-
- but->flag &= ~UI_SELECT;
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- uibut_do_func(but);
-
- return retval;
-}
-
-static int ui_do_but_TOG3(uiBut *but)
-{
-
- if( but->pointype==SHO ) {
- short *sp= (short *)but->poin;
-
- if( BTST(sp[1], but->bitnr)) {
- sp[1]= BCLR(sp[1], but->bitnr);
- sp[0]= BCLR(sp[0], but->bitnr);
- }
- else if( BTST(sp[0], but->bitnr)) {
- sp[1]= BSET(sp[1], but->bitnr);
- } else {
- sp[0]= BSET(sp[0], but->bitnr);
- }
- }
- else {
- if( BTST(*(but->poin+2), but->bitnr)) {
- *(but->poin+2)= BCLR(*(but->poin+2), but->bitnr);
- *(but->poin)= BCLR(*(but->poin), but->bitnr);
- }
- else if( BTST(*(but->poin), but->bitnr)) {
- *(but->poin+2)= BSET(*(but->poin+2), but->bitnr);
- } else {
- *(but->poin)= BSET(*(but->poin), but->bitnr);
- }
- }
-
- ui_is_but_sel(but);
- ui_draw_but(but);
-
- return but->retval;
-}
-
-static int ui_do_but_ICONROW(uiBut *but)
-{
- ListBase listb= {NULL, NULL};
- uiBlock *block;
- int a;
- short event;
-
- but->flag |= UI_SELECT;
- ui_draw_but(but);
- ui_block_flush_back(but->block); // flush because this button creates own blocks loop
-
- /* here we go! */
- block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
-
- for(a=(int)but->min; a<=(int)but->max; a++) {
- uiDefIconBut(block, BUTM|but->pointype, but->retval, but->icon+(a-but->min), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, but->poin, (float)a, 0.0, 0, 0, "");
- }
- block->direction= UI_TOP;
- ui_positionblock(block, but);
-
- /* the block is made with but-win, but is handled in mainwin space...
- this is needs better implementation */
- block->win= G.curscreen->mainwin;
-
- event= uiDoBlocks(&listb, 0, 1);
-
- but->flag &= ~UI_SELECT;
- ui_check_but(but);
- ui_draw_but(but);
-
- if (event & UI_RETURN_OK) {
- return but->retval;
- } else {
- return 0;
- }
-}
-
-static int ui_do_but_ICONTEXTROW(uiBut *but)
-{
- uiBlock *block;
- ListBase listb={NULL, NULL};
- int width, a, xmax, ypos;
- MenuData *md;
- short event;
- but->flag |= UI_SELECT;
- ui_draw_but(but);
- ui_block_flush_back(but->block); // flush because this button creates own blocks loop
-
- block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
-
- md= decompose_menu_string(but->str);
-
- /* size and location */
- /* expand menu width to fit labels */
- if(md->title)
- width= 2*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS));
- else
- width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS));
- if(xmax>width) width= xmax;
- }
-
- width+= 30;
- if (width<50) width=50;
-
- ypos = 1;
-
- /* loop through the menu options and draw them out with icons & text labels */
- for(a=0; a<md->nitems; a++) {
-
- /* add a space if there's a separator (%l) */
- if (strcmp(md->items[a].str, "%l")==0) {
- ypos +=3;
- }
- else {
- uiDefIconTextBut(block, BUTM|but->pointype, but->retval, (short)((but->icon)+(md->items[a].retval-but->min)), md->items[a].str, 0, ypos,(short)width, 19, but->poin, (float) md->items[a].retval, 0.0, 0, 0, "");
- ypos += 20;
- }
- }
-
- if(md->title) {
- uiBut *bt;
- uiSetCurFont(block, block->font+1);
- bt= uiDefBut(block, LABEL, 0, md->title, 0, ypos, (short)width, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiSetCurFont(block, block->font);
- bt->flag= UI_TEXT_LEFT;
- }
-
- block->direction= UI_TOP;
- ui_positionblock(block, but);
-
- /* the block is made with but-win, but is handled in mainwin space...
- this is needs better implementation */
- block->win= G.curscreen->mainwin;
-
- uiBoundsBlock(block, 3);
-
- event = uiDoBlocks(&listb, 0, 1);
-
- menudata_free(md);
-
- but->flag &= ~UI_SELECT;
- ui_check_but(but);
- ui_draw_but(but);
-
- if (event & UI_RETURN_OK) {
- uibut_do_func(but);
- return but->retval;
- } else {
- return 0;
- }
-}
-
-static int ui_do_but_IDPOIN(uiBut *but)
-{
- char str[UI_MAX_DRAW_STR];
- ID *id;
-
- id= *but->idpoin_idpp;
- if(id) strcpy(str, id->name+2);
- else str[0]= 0;
-
- but->type= TEX;
- but->poin= str;
- but->min= 0.0;
- but->max= 22.0;
- ui_check_but(but);
- ui_do_but_TEX(but);
- but->poin= NULL;
- but->type= IDPOIN;
-
- but->idpoin_func(str, but->idpoin_idpp);
- ui_check_but(but);
- ui_draw_but(but);
-
- return but->retval;
-}
-
-static int ui_do_but_SLI(uiBut *but)
-{
- float f, fstart, tempf = 0.0, deler, value;
- int sx, h, temp, pos=0, lvalue, redraw;
- short mval[2], qual;
-
- value= ui_get_but_val(but);
- uiGetMouse(mywinget(), mval);
-
- sx= mval[0];
- h= but->y2-but->y1;
- fstart= but->max-but->min;
- fstart= (value - but->min)/fstart;
- temp= 32767;
-
- if( but->type==NUMSLI) deler= ( (but->x2-but->x1)/2 - 5.0*but->aspect);
- else if( but->type==HSVSLI) deler= ( (but->x2-but->x1)/2 - 5.0*but->aspect);
- else deler= (but->x2-but->x1- 5.0*but->aspect);
-
-
- while (get_mbut() & L_MOUSE) {
-
- qual= get_qual();
- uiGetMouse(mywinget(), mval);
-
- f= (float)(mval[0]-sx)/deler +fstart;
-
- if (qual & LR_SHIFTKEY) {
- f= (f-fstart)/10.0 + fstart;
- }
-
- CLAMP(f, 0.0, 1.0);
- tempf= but->min+f*(but->max-but->min);
- temp= floor(tempf+.5);
-
- if(qual & LR_CTRLKEY) {
- if(tempf==but->min || tempf==but->max);
- else if( but->pointype==FLO ) {
-
- if(qual & LR_SHIFTKEY) {
- if(tempf==but->min || tempf==but->max);
- else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf);
- else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf);
- else tempf= floor(tempf);
- }
- else {
- if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf);
- else if(but->max-but->min < 21.0) tempf= floor(tempf);
- else tempf= 10.0*floor(tempf/10.0);
- }
- }
- else {
- temp= 10*(temp/10);
- tempf= temp;
- }
- }
-
- value= ui_get_but_val(but);
- lvalue= floor(value+0.5);
-
- if( but->pointype!=FLO )
- redraw= (temp != lvalue);
- else
- redraw= (tempf != value);
-
- if (redraw) {
- pos= 1;
- ui_set_but_val(but, tempf);
- ui_check_but(but);
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- if(but->a1) { /* color number */
- uiBut *bt= but->prev;
- while(bt) {
- if(bt->a2 == but->a1) ui_draw_but(bt);
- bt= bt->prev;
- }
- bt= but->next;
- while(bt) {
- if(bt->a2 == but->a1) ui_draw_but(bt);
- bt= bt->next;
- }
- }
- /* save current window matrix (global UIwinmat)
- because button callback function MIGHT change it
- - which has until now occured through the Python API
- */
- /* This is really not possible atm... nothing in Blender
- supports such functionality even now. Calling function
- callbacks while using a button screws up the UI (ton)
- */
- /* Mat4CpyMat4(curmatrix, UIwinmat);
- uibut_do_func(but);
- Mat4CpyMat4(UIwinmat, curmatrix); */
- }
- else BIF_wait_for_statechange();
- }
-
-
- if(temp!=32767 && pos==0) { /* plus 1 or minus 1 */
-
- if( but->type==SLI) f= (float)(mval[0]-but->x1)/(but->x2-but->x1-h);
- else f= (float)(mval[0]- (but->x1+but->x2)/2)/( (but->x2-but->x1)/2 - h);
-
- f= but->min+f*(but->max-but->min);
-
- if( but->pointype!=FLO ) {
-
- if(f<temp) temp--;
- else temp++;
- if( temp>=but->min && temp<=but->max)
- ui_set_but_val(but, (float)temp);
-
- }
- else {
-
- if(f<tempf) tempf-=.01;
- else tempf+=.01;
- if( tempf>=but->min && tempf<=but->max)
- ui_set_but_val(but, tempf);
-
- }
- }
- ui_check_but(but);
- ui_draw_but(but);
- uibut_do_func(but);
- ui_block_flush_back(but->block);
-
- return but->retval;
-}
-
-static int ui_do_but_NUMSLI(uiBut *but)
-{
- short mval[2];
-
- /* first define if it's a slider or textbut */
- uiGetMouse(mywinget(), mval);
-
- if(mval[0]>= -6+(but->x1+but->x2)/2 ) { /* slider */
- but->flag |= UI_SELECT;
- ui_draw_but(but);
- ui_do_but_SLI(but);
- but->flag &= ~UI_SELECT;
- }
- else {
- ui_act_as_text_but(but);
- uibut_do_func(but); // this is done in ui_do_but_SLI() not in ui_act_as_text_but()
- }
-
- while(get_mbut() & L_MOUSE) BIF_wait_for_statechange();
-
- ui_draw_but(but);
-
- /* hsv patch */
- if(but->type==HSVSLI) {
-
- if(but->str[0]=='H') {
- ui_draw_but(but->next);
- ui_draw_but(but->next->next);
- }
- else if(but->str[0]=='S') {
- ui_draw_but(but->next);
- ui_draw_but(but->prev);
- }
- else if(but->str[0]=='V') {
- ui_draw_but(but->prev);
- ui_draw_but(but->prev->prev);
- }
- }
-
- return but->retval;
-}
-
-/* event denotes if we make first item active or not */
-static uiBlock *ui_do_but_BLOCK(uiBut *but, int event)
-{
- uiBlock *block;
- uiBut *bt;
-
- but->flag |= UI_SELECT;
- ui_draw_but(but);
-
- block= but->block_func(but->poin);
- block->parent= but->block; /* allows checking for nested pulldowns */
-
- block->xofs = -2; /* for proper alignment */
-
- /* only used for automatic toolbox, so can set the shift flag */
- if(but->flag & UI_MAKE_TOP) {
- block->direction= UI_TOP|UI_SHIFT_FLIPPED;
- uiBlockFlipOrder(block);
- }
- if(but->flag & UI_MAKE_DOWN) block->direction= UI_DOWN|UI_SHIFT_FLIPPED;
- if(but->flag & UI_MAKE_LEFT) block->direction |= UI_LEFT;
- if(but->flag & UI_MAKE_RIGHT) block->direction |= UI_RIGHT;
-
- ui_positionblock(block, but);
- block->flag |= UI_BLOCK_LOOP;
-
- /* blocks can come (and get scaled) from a normal window, now we go to screenspace */
- block->win= G.curscreen->mainwin;
- for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win;
- bwin_getsinglematrix(block->win, block->winmat);
-
- /* postpone draw, this will cause a new window matrix, first finish all other buttons */
- block->flag |= UI_BLOCK_REDRAW;
-
- if(event!=MOUSEX && event!=MOUSEY && event!=LEFTMOUSE && but->type==BLOCK) {
- bt= ui_but_first(block);
- if(bt) bt->flag |= UI_ACTIVE;
- }
-
- but->flag &= ~UI_SELECT;
- uibut_do_func(but);
-
- if(but->retval)
- addqueue(curarea->win, UI_BUT_EVENT, (short)but->retval);
-
- return block;
-}
-
-static int ui_do_but_BUTM(uiBut *but)
-{
- /* draw 'pushing-in' when clicked on for use as a normal button in a panel */
- do {
- int oflag= but->flag;
- short mval[2];
-
- uiGetMouse(mywinget(), mval);
-
- if (uibut_contains_pt(but, mval))
- but->flag |= UI_SELECT;
- else
- but->flag &= ~UI_SELECT;
-
- if (but->flag != oflag) {
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
-
- PIL_sleep_ms(10);
- } while (get_mbut() & L_MOUSE);
-
- ui_set_but_val(but, but->min);
- UIafterfunc_butm= but->butm_func;
- UIafterfunc_arg1= but->butm_func_arg;
- UIafterval= but->a2;
-
- uibut_do_func(but);
-
- but->flag &= ~UI_SELECT;
- ui_draw_but(but);
-
- return but->retval;
-}
-
-static int ui_do_but_LABEL(uiBut *but)
-{
- uibut_do_func(but);
- return but->retval;
-}
-
-static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval)
-{
- uiBut *bt;
-
- /* find button to link to */
- for (bt= block->buttons.first; bt; bt= bt->next)
- if(bt!=but && uibut_contains_pt(bt, mval))
- break;
-
- if (bt) {
- if (but->type==LINK && bt->type==INLINK) {
- if( but->link->tocode == (int)bt->min ) {
- return bt;
- }
- }
- else if(but->type==INLINK && bt->type==LINK) {
- if( bt->link->tocode == (int)but->min ) {
- return bt;
- }
- }
- }
-
- return NULL;
-}
-
-static int ui_is_a_link(uiBut *from, uiBut *to)
-{
- uiLinkLine *line;
- uiLink *link;
-
- link= from->link;
- if(link) {
- line= link->lines.first;
- while(line) {
- if(line->from==from && line->to==to) return 1;
- line= line->next;
- }
- }
- return 0;
-}
-
-static uiBut *ui_find_inlink(uiBlock *block, void *poin)
-{
- uiBut *but;
-
- but= block->buttons.first;
- while(but) {
- if(but->type==INLINK) {
- if(but->poin == poin) return but;
- }
- but= but->next;
- }
- return NULL;
-}
-
-static void ui_add_link_line(ListBase *listb, uiBut *but, uiBut *bt)
-{
- uiLinkLine *line;
-
- line= MEM_callocN(sizeof(uiLinkLine), "linkline");
- BLI_addtail(listb, line);
- line->from= but;
- line->to= bt;
-}
-
-uiBut *uiFindInlink(uiBlock *block, void *poin)
-{
- return ui_find_inlink(block, poin);
-}
-
-void uiComposeLinks(uiBlock *block)
-{
- uiBut *but, *bt;
- uiLink *link;
- void ***ppoin;
- int a;
-
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK) {
- link= but->link;
-
- /* for all pointers in the array */
- if(link) {
- if(link->ppoin) {
- ppoin= link->ppoin;
- for(a=0; a < *(link->totlink); a++) {
- bt= ui_find_inlink(block, (*ppoin)[a] );
- if(bt) {
- ui_add_link_line(&link->lines, but, bt);
- }
- }
- }
- else if(link->poin) {
- bt= ui_find_inlink(block, *(link->poin) );
- if(bt) {
- ui_add_link_line(&link->lines, but, bt);
- }
- }
- }
- }
- but= but->next;
- }
-}
-
-static void ui_add_link(uiBut *from, uiBut *to)
-{
- /* in 'from' we have to add a link to 'to' */
- uiLink *link;
- void **oldppoin;
- int a;
-
- if(ui_is_a_link(from, to)) {
- printf("already exists\n");
- return;
- }
-
- link= from->link;
-
- /* are there more pointers allowed? */
- if(link->ppoin) {
- oldppoin= *(link->ppoin);
-
- (*(link->totlink))++;
- *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link");
-
- for(a=0; a< (*(link->totlink))-1; a++) {
- (*(link->ppoin))[a]= oldppoin[a];
- }
- (*(link->ppoin))[a]= to->poin;
-
- if(oldppoin) MEM_freeN(oldppoin);
- }
- else {
- *(link->poin)= to->poin;
- }
-
-}
-
-static int ui_do_but_LINK(uiBlock *block, uiBut *but)
-{
- /*
- * This button only visualizes, the dobutton mode
- * can add a new link, but then the whole system
- * should be redrawn/initialized.
- *
- */
- uiBut *bt=0, *bto=NULL;
- short sval[2], mval[2], mvalo[2], first= 1;
-
- uiGetMouse(curarea->win, sval);
- mvalo[0]= sval[0];
- mvalo[1]= sval[1];
-
- while (get_mbut() & L_MOUSE) {
- uiGetMouse(curarea->win, mval);
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || first) {
- /* clear completely, because of drawbuttons */
- bt= ui_get_valid_link_button(block, but, mval);
- if(bt) {
- bt->flag |= UI_ACTIVE;
- ui_draw_but(bt);
- }
- if(bto && bto!=bt) {
- bto->flag &= ~UI_ACTIVE;
- ui_draw_but(bto);
- }
- bto= bt;
-
- if (!first) {
- glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]);
- }
- glutil_draw_front_xor_line(sval[0], sval[1], mval[0], mval[1]);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- first= 0;
- }
- else BIF_wait_for_statechange();
- }
-
- if (!first) {
- glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]);
- }
-
- if(bt) {
- if(but->type==LINK) ui_add_link(but, bt);
- else ui_add_link(bt, but);
-
- scrarea_queue_winredraw(curarea);
- }
-
- return 0;
-}
-
-/* picker sizes S hsize, F full size, D spacer, B button/pallette height */
-#define SPICK 110.0
-#define FPICK 180.0
-#define DPICK 6.0
-#define BPICK 24.0
-
-#define UI_PALETTE_TOT 16
-/* note; in tot+1 the old color is stored */
-static float palette[UI_PALETTE_TOT+1][3]= {
-{0.93, 0.83, 0.81}, {0.88, 0.89, 0.73}, {0.69, 0.81, 0.57}, {0.51, 0.76, 0.64},
-{0.37, 0.56, 0.61}, {0.33, 0.29, 0.55}, {0.46, 0.21, 0.51}, {0.40, 0.12, 0.18},
-{1.0, 1.0, 1.0}, {0.85, 0.85, 0.85}, {0.7, 0.7, 0.7}, {0.56, 0.56, 0.56},
-{0.42, 0.42, 0.42}, {0.28, 0.28, 0.28}, {0.14, 0.14, 0.14}, {0.0, 0.0, 0.0}
-};
-
-/* for picker, while editing hsv */
-static void ui_set_but_hsv(uiBut *but)
-{
- float col[3];
-
- hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2);
- ui_set_but_vectorf(but, col);
-}
-
-static void update_picker_hex(uiBlock *block, float *rgb)
-{
- uiBut *bt;
- char col[16];
-
- sprintf(col, "%02X%02X%02X", (unsigned int)(rgb[0]*255.0), (unsigned int)(rgb[1]*255.0), (unsigned int)(rgb[2]*255.0));
-
- // this updates button strings, is hackish... but button pointers are on stack of caller function
-
- for(bt= block->buttons.first; bt; bt= bt->next) {
- if(strcmp(bt->str, "Hex: ")==0) {
- strcpy(bt->poin, col);
- ui_check_but(bt);
- break;
- }
- }
-}
-
-static void update_picker_buts_hsv(uiBlock *block, float *hsv, char *poin)
-{
- uiBut *bt;
- float r, g, b;
- float rgb[3];
-
- // this updates button strings, is hackish... but button pointers are on stack of caller function
- hsv_to_rgb(hsv[0], hsv[1], hsv[2], &r, &g, &b);
-
- rgb[0] = r; rgb[1] = g; rgb[2] = b;
- update_picker_hex(block, rgb);
-
- for(bt= block->buttons.first; bt; bt= bt->next) {
- if(bt->type==HSVCUBE) {
- VECCOPY(bt->hsv, hsv);
- ui_set_but_hsv(bt);
- }
- else if(bt->str[1]==' ') {
- if(bt->str[0]=='R') {
- ui_set_but_val(bt, r);
- }
- else if(bt->str[0]=='G') {
- ui_set_but_val(bt, g);
- }
- else if(bt->str[0]=='B') {
- ui_set_but_val(bt, b);
- }
- else if(bt->str[0]=='H') {
- ui_set_but_val(bt, hsv[0]);
- }
- else if(bt->str[0]=='S') {
- ui_set_but_val(bt, hsv[1]);
- }
- else if(bt->str[0]=='V') {
- ui_set_but_val(bt, hsv[2]);
- }
- }
- }
-}
-
-static void update_picker_buts_hex(uiBlock *block, char *hexcol)
-{
- uiBut *bt;
- float r=0, g=0, b=0;
- float h, s, v;
-
-
- // this updates button strings, is hackish... but button pointers are on stack of caller function
- hex_to_rgb(hexcol, &r, &g, &b);
- rgb_to_hsv(r, g, b, &h, &s, &v);
-
- for(bt= block->buttons.first; bt; bt= bt->next) {
- if(bt->type==HSVCUBE) {
- bt->hsv[0] = h;
- bt->hsv[1] = s;
- bt->hsv[2] = v;
- ui_set_but_hsv(bt);
- }
- else if(bt->str[1]==' ') {
- if(bt->str[0]=='R') {
- ui_set_but_val(bt, r);
- }
- else if(bt->str[0]=='G') {
- ui_set_but_val(bt, g);
- }
- else if(bt->str[0]=='B') {
- ui_set_but_val(bt, b);
- }
- else if(bt->str[0]=='H') {
- ui_set_but_val(bt, h);
- }
- else if(bt->str[0]=='S') {
- ui_set_but_val(bt, s);
- }
- else if(bt->str[0]=='V') {
- ui_set_but_val(bt, v);
- }
- }
- }
-}
-
-
-
-/* bt1 is palette but, col1 is original color */
-/* callback to copy from/to palette */
-static void do_palette_cb(void *bt1, void *col1)
-{
- uiBut *but1= (uiBut *)bt1;
- uiBut *but;
- float *col= (float *)col1;
- float *fp, hsv[3];
-
- fp= (float *)but1->poin;
-
- if( (get_qual() & LR_CTRLKEY) ) {
- VECCOPY(fp, col);
- }
- else {
- VECCOPY(col, fp);
- }
-
- rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
- update_picker_buts_hsv(but1->block, hsv, but1->poin);
- update_picker_hex(but1->block, col);
-
- for (but= but1->block->buttons.first; but; but= but->next) {
- ui_check_but(but);
- ui_draw_but(but);
- }
- but= but1->block->buttons.first;
- ui_block_flush_back(but->block);
-}
-
-/* bt1 is num but, hsv1 is pointer to original color in hsv space*/
-/* callback to handle changes in num-buts in picker */
-static void do_palette1_cb(void *bt1, void *hsv1)
-{
- uiBut *but1= (uiBut *)bt1;
- uiBut *but;
- float *hsv= (float *)hsv1;
- float *fp= NULL;
-
- if(but1->str[1]==' ') {
- if(but1->str[0]=='R') fp= (float *)but1->poin;
- else if(but1->str[0]=='G') fp= ((float *)but1->poin)-1;
- else if(but1->str[0]=='B') fp= ((float *)but1->poin)-2;
- }
- if(fp) {
- rgb_to_hsv(fp[0], fp[1], fp[2], hsv, hsv+1, hsv+2);
- }
- update_picker_buts_hsv(but1->block, hsv, but1->poin);
-
- for (but= but1->block->buttons.first; but; but= but->next) {
- ui_check_but(but);
- ui_draw_but(but);
- }
-
- but= but1->block->buttons.first;
- ui_block_flush_back(but->block);
-
-}
-
-/* bt1 is num but, col1 is pointer to original color */
-/* callback to handle changes in num-buts in picker */
-static void do_palette2_cb(void *bt1, void *col1)
-{
- uiBut *but1= (uiBut *)bt1;
- uiBut *but;
- float *rgb= (float *)col1;
- float *fp= NULL;
-
- if(but1->str[1]==' ') {
- if(but1->str[0]=='H') fp= (float *)but1->poin;
- else if(but1->str[0]=='S') fp= ((float *)but1->poin)-1;
- else if(but1->str[0]=='V') fp= ((float *)but1->poin)-2;
- }
- if(fp) {
- hsv_to_rgb(fp[0], fp[1], fp[2], rgb, rgb+1, rgb+2);
- }
- update_picker_buts_hsv(but1->block, fp, but1->poin);
-
- for (but= but1->block->buttons.first; but; but= but->next) {
- ui_check_but(but);
- ui_draw_but(but);
- }
-
- but= but1->block->buttons.first;
- ui_block_flush_back(but->block);
-
-}
-
-static void do_palette_hex_cb(void *bt1, void *hexcl)
-{
- uiBut *but1= (uiBut *)bt1;
- uiBut *but;
- char *hexcol= (char *)hexcl;
-
- update_picker_buts_hex(but1->block, hexcol);
-
- for (but= but1->block->buttons.first; but; but= but->next) {
- ui_check_but(but);
- ui_draw_but(but);
- }
-
- but= but1->block->buttons.first;
- ui_block_flush_back(but->block);
-}
-
-
-/* used for both 3d view and image window */
-static void do_palette_sample_cb(void *bt1, void *col1) /* frontbuf */
-{
- uiBut *but1= (uiBut *)bt1;
- uiBut *but;
- float tempcol[4];
- int x=0, y=0;
- short mval[2];
- float hsv[3];
- short capturing;
- int oldcursor;
- Window *win;
- unsigned short dev;
-
- oldcursor=get_cursor();
- win=winlay_get_active_window();
-
- while (get_mbut() & L_MOUSE) BIF_wait_for_statechange();
-
- SetBlenderCursor(BC_EYEDROPPER_CURSOR);
-
- /* loop and wait for a mouse click */
- capturing = TRUE;
- while(capturing) {
- char ascii;
- short val;
-
- dev = extern_qread_ext(&val, &ascii);
-
- if(dev==INPUTCHANGE) break;
- if(get_mbut() & R_MOUSE) break;
- else if(get_mbut() & L_MOUSE) {
- uiGetMouse(mywinget(), mval);
- x= mval[0]; y= mval[1];
-
- capturing = FALSE;
- break;
- }
- else if(dev==ESCKEY) break;
- }
- window_set_cursor(win, oldcursor);
-
- if(capturing) return;
-
- if(x<0 || y<0) return;
-
- /* if we've got a glick, use OpenGL to sample the color under the mouse pointer */
- glReadBuffer(GL_FRONT);
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol);
- glReadBuffer(GL_BACK);
-
- /* and send that color back to the picker */
- rgb_to_hsv(tempcol[0], tempcol[1], tempcol[2], hsv, hsv+1, hsv+2);
- update_picker_buts_hsv(but1->block, hsv, but1->poin);
- update_picker_hex(but1->block, tempcol);
-
- for (but= but1->block->buttons.first; but; but= but->next) {
- ui_check_but(but);
- ui_draw_but(but);
- }
-
- but= but1->block->buttons.first;
- ui_block_flush_back(but->block);
-}
-
-
-/* color picker, Gimp version. mode: 'f' = floating panel, 'p' = popup */
-/* col = read/write to, hsv/old/hexcol = memory for temporal use */
-void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval)
-{
- uiBut *bt;
- float h, offs;
- int a;
-
- VECCOPY(old, col); // old color stored there, for palette_cb to work
-
- // the cube intersection
- bt= uiDefButF(block, HSVCUBE, retval, "", 0,DPICK+BPICK,FPICK,FPICK, col, 0.0, 0.0, 2, 0, "");
- uiButSetFlag(bt, UI_NO_HILITE);
-
- bt= uiDefButF(block, HSVCUBE, retval, "", 0,0,FPICK,BPICK, col, 0.0, 0.0, 3, 0, "");
- uiButSetFlag(bt, UI_NO_HILITE);
-
- // palette
-
- uiBlockSetEmboss(block, UI_EMBOSSP);
-
- bt=uiDefButF(block, COL, retval, "", FPICK+DPICK, 0, BPICK,BPICK, old, 0.0, 0.0, -1, 0, "Old color, click to restore");
- uiButSetFunc(bt, do_palette_cb, bt, col);
- uiDefButF(block, COL, retval, "", FPICK+DPICK, BPICK+DPICK, BPICK,60-BPICK-DPICK, col, 0.0, 0.0, -1, 0, "Active color");
-
- h= (DPICK+BPICK+FPICK-64)/(UI_PALETTE_TOT/2.0);
- uiBlockBeginAlign(block);
- for(a= -1+UI_PALETTE_TOT/2; a>=0; a--) {
- bt= uiDefButF(block, COL, retval, "", FPICK+DPICK, 65.0+(float)a*h, BPICK/2, h, palette[a+UI_PALETTE_TOT/2], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette");
- uiButSetFunc(bt, do_palette_cb, bt, col);
- bt= uiDefButF(block, COL, retval, "", FPICK+DPICK+BPICK/2, 65.0+(float)a*h, BPICK/2, h, palette[a], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette");
- uiButSetFunc(bt, do_palette_cb, bt, col);
- }
- uiBlockEndAlign(block);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
-
- // buttons
- rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2);
- sprintf(hexcol, "%02X%02X%02X", (unsigned int)(col[0]*255.0), (unsigned int)(col[1]*255.0), (unsigned int)(col[2]*255.0));
-
- offs= FPICK+2*DPICK+BPICK;
-
- /* note; made this a TOG now, with NULL pointer. Is because BUT now gets handled with a afterfunc */
- bt= uiDefIconTextBut(block, TOG, UI_RETURN_OK, ICON_EYEDROPPER, "Sample", offs+55, 170, 85, 20, NULL, 0, 0, 0, 0, "Sample the color underneath the following mouse click (ESC or RMB to cancel)");
- uiButSetFunc(bt, do_palette_sample_cb, bt, col);
- uiButSetFlag(bt, UI_TEXT_LEFT);
-
- bt= uiDefBut(block, TEX, retval, "Hex: ", offs, 140, 140, 20, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
- uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol);
-
- uiBlockBeginAlign(block);
- bt= uiDefButF(block, NUMSLI, retval, "R ", offs, 110, 140,20, col, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette1_cb, bt, hsv);
- bt= uiDefButF(block, NUMSLI, retval, "G ", offs, 90, 140,20, col+1, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette1_cb, bt, hsv);
- bt= uiDefButF(block, NUMSLI, retval, "B ", offs, 70, 140,20, col+2, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette1_cb, bt, hsv);
-
- uiBlockBeginAlign(block);
- bt= uiDefButF(block, NUMSLI, retval, "H ", offs, 40, 140,20, hsv, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette2_cb, bt, col);
- bt= uiDefButF(block, NUMSLI, retval, "S ", offs, 20, 140,20, hsv+1, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette2_cb, bt, col);
- bt= uiDefButF(block, NUMSLI, retval, "V ", offs, 0, 140,20, hsv+2, 0.0, 1.0, 10, 3, "");
- uiButSetFunc(bt, do_palette2_cb, bt, col);
- uiBlockEndAlign(block);
-}
-
-static int ui_do_but_COL(uiBut *but)
-{
- uiBlock *block;
- uiBut *bt;
- ListBase listb={NULL, NULL};
- float hsv[3], old[3], *poin= NULL, colstore[3];
- static char hexcol[128];
- short event;
-
- // signal to prevent calling up color picker
- if(but->a1 == -1) {
- uibut_do_func(but);
- return but->retval;
- }
-
- // enable char button too, use temporal colstore for color
- if(but->pointype!=FLO) {
- if(but->pointype==CHA) {
- ui_get_but_vectorf(but, colstore);
- poin= colstore;
- }
- else return but->retval;
- }
- else poin= (float *)but->poin;
-
- block= uiNewBlock(&listb, "colorpicker", UI_EMBOSS, UI_HELV, but->win);
- block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW;
- block->themecol= TH_BUT_NUM;
-
- uiBlockPickerButtons(block, poin, hsv, old, hexcol, 'p', 0);
-
- /* and lets go */
- block->direction= UI_TOP;
- ui_positionblock(block, but);
- uiBoundsBlock(block, 3);
-
- /* blocks can come from a normal window, but we go to screenspace */
- block->win= G.curscreen->mainwin;
- for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win;
- bwin_getsinglematrix(block->win, block->winmat);
-
- event= uiDoBlocks(&listb, 0, 1);
-
- if(but->pointype==CHA) ui_set_but_vectorf(but, colstore);
-
- uibut_do_func(but);
- return but->retval;
-
-}
-
-static int ui_do_but_HSVCUBE(uiBut *but)
-{
- uiBut *bt;
- float x, y;
- short mval[2], mvalo[2];
-
- mvalo[0]= mvalo[1]= -32000;
-
- /* we work on persistant hsv, to prevent it being converted back and forth all the time */
-
- while (get_mbut() & L_MOUSE) {
-
- uiGetMouse(mywinget(), mval);
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- /* relative position within box */
- x= ((float)mval[0]-but->x1)/(but->x2-but->x1);
- y= ((float)mval[1]-but->y1)/(but->y2-but->y1);
- CLAMP(x, 0.0, 1.0);
- CLAMP(y, 0.0, 1.0);
-
- if(but->a1==0) {
- but->hsv[0]= x;
- but->hsv[2]= y;
- // hsv_to_rgb(x, s, y, col, col+1, col+2);
- }
- else if(but->a1==1) {
- but->hsv[0]= x;
- but->hsv[1]= y;
- // hsv_to_rgb(x, y, v, col, col+1, col+2);
- }
- else if(but->a1==2) {
- but->hsv[2]= x;
- but->hsv[1]= y;
- // hsv_to_rgb(h, y, x, col, col+1, col+2);
- }
- else {
- but->hsv[0]= x;
- // hsv_to_rgb(x, s, v, col, col+1, col+2);
- }
-
- ui_set_but_hsv(but); // converts to rgb
-
- // update button values and strings
- update_picker_buts_hsv(but->block, but->hsv, but->poin);
-// update_picker_buts_hex(but->block, but->hsv);
-
- /* we redraw the entire block */
- for (bt= but->block->buttons.first; bt; bt= bt->next) {
- if(but->poin == bt->poin) VECCOPY(bt->hsv, but->hsv);
- ui_check_but(bt);
- ui_draw_but(bt);
- }
- ui_block_flush_back(but->block);
- }
- else BIF_wait_for_statechange();
- }
-
- return but->retval;
-}
-
-#ifdef INTERNATIONAL
-
-static int ui_do_but_CHARTAB(uiBut *but)
-{
- /* Variables */
- short mval[2];
- float sx, sy, ex, ey;
- float width, height;
- float butw, buth;
- int x, y, cs, che;
-
- /* Check the position */
- uiGetMouse(mywinget(), mval);
-
- /* Calculate the size of the button */
- width = abs(but->x2 - but->x1);
- height = abs(but->y2 - but->y1);
-
- butw = floor(width / 12);
- buth = floor(height / 6);
-
- /* Initialize variables */
- sx = but->x1;
- ex = but->x1 + butw;
- sy = but->y1 + height - buth;
- ey = but->y1 + height;
-
- cs = G.charstart;
-
- /* And the character is */
- x = (int) ((mval[0] / butw) - 0.5);
- y = (int) (6 - ((mval[1] / buth) - 0.5));
-
- che = cs + (y*12) + x;
-
- if(che > G.charmax)
- che = 0;
-
- if(G.obedit)
- {
- do_textedit(0,0,che);
- }
-
- return but->retval;
-}
-
-#endif
-
-static int vergcband(const void *a1, const void *a2)
-{
- const CBData *x1=a1, *x2=a2;
-
- if( x1->pos > x2->pos ) return 1;
- else if( x1->pos < x2->pos) return -1;
- return 0;
-}
-
-
-static void do_colorband_evt(ColorBand *coba)
-{
- int a;
-
- if(coba==NULL) return;
-
- if(coba->tot<2) return;
-
- for(a=0; a<coba->tot; a++) coba->data[a].cur= a;
- qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
- for(a=0; a<coba->tot; a++) {
- if(coba->data[a].cur==coba->cur) {
- if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */
- coba->cur= a;
- break;
- }
- }
-}
-
-static int ui_do_but_COLORBAND(uiBut *but)
-{
- ColorBand *coba= (ColorBand *)but->poin;
- CBData *cbd;
- float dx, width= but->x2-but->x1;
- int a;
- int mindist= 12, xco;
- short mval[2], mvalo[2];
-
- uiGetMouse(mywinget(), mvalo);
-
- if(G.qual & LR_CTRLKEY) {
- /* insert new key on mouse location */
- if(coba->tot < MAXCOLORBAND-1) {
- float pos= ((float)(mvalo[0] - but->x1))/width;
- float col[4];
-
- do_colorband(coba, pos, col); /* executes it */
-
- coba->tot++;
- coba->cur= coba->tot-1;
-
- coba->data[coba->cur].r= col[0];
- coba->data[coba->cur].g= col[1];
- coba->data[coba->cur].b= col[2];
- coba->data[coba->cur].a= col[3];
- coba->data[coba->cur].pos= pos;
-
- do_colorband_evt(coba);
- }
- }
- else {
-
- /* first, activate new key when mouse is close */
- for(a=0, cbd= coba->data; a<coba->tot; a++, cbd++) {
- xco= but->x1 + (cbd->pos*width);
- xco= ABS(xco-mvalo[0]);
- if(a==coba->cur) xco+= 5; // selected one disadvantage
- if(xco<mindist) {
- coba->cur= a;
- mindist= xco;
- }
- }
-
- cbd= coba->data + coba->cur;
-
- while(get_mbut() & L_MOUSE) {
- uiGetMouse(mywinget(), mval);
- if(mval[0]!=mvalo[0]) {
- dx= mval[0]-mvalo[0];
- dx/= width;
- cbd->pos+= dx;
- CLAMP(cbd->pos, 0.0, 1.0);
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- do_colorband_evt(coba);
- cbd= coba->data + coba->cur; /* because qsort */
-
- mvalo[0]= mval[0];
- }
- BIF_wait_for_statechange();
- }
- }
-
- return but->retval;
-}
-
-/* button is presumed square */
-/* if mouse moves outside of sphere, it does negative normal */
-static int ui_do_but_NORMAL(uiBut *but)
-{
- float dx, dy, rad, radsq, mrad, *fp= (float *)but->poin;
- int firsttime=1;
- short mval[2], mvalo[2], mvals[2], mvaldx, mvaldy;
-
- rad= (but->x2 - but->x1);
- radsq= rad*rad;
-
- if(fp[2]>0.0f) {
- mvaldx= (rad*fp[0]);
- mvaldy= (rad*fp[1]);
- }
- else if(fp[2]> -1.0f) {
- mrad= rad/sqrt(fp[0]*fp[0] + fp[1]*fp[1]);
-
- mvaldx= 2.0f*mrad*fp[0] - (rad*fp[0]);
- mvaldy= 2.0f*mrad*fp[1] - (rad*fp[1]);
- }
- else mvaldx= mvaldy= 0;
-
- uiGetMouse(mywinget(), mvalo);
- mvals[0]= mvalo[0];
- mvals[1]= mvalo[1];
-
- while(get_mbut() & L_MOUSE) {
-
- uiGetMouse(mywinget(), mval);
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) {
- firsttime= 0;
-
- dx= (float)(mval[0]+mvaldx-mvals[0]);
- dy= (float)(mval[1]+mvaldy-mvals[1]);
-
- mrad= dx*dx+dy*dy;
- if(mrad < radsq) { /* inner circle */
- fp[0]= dx;
- fp[1]= dy;
- fp[2]= sqrt( radsq-dx*dx-dy*dy );
- }
- else { /* outer circle */
-
- mrad= rad/sqrt(mrad); // veclen
-
- dx*= (2.0f*mrad - 1.0f);
- dy*= (2.0f*mrad - 1.0f);
-
- mrad= dx*dx+dy*dy;
- if(mrad < radsq) {
- fp[0]= dx;
- fp[1]= dy;
- fp[2]= -sqrt( radsq-dx*dx-dy*dy );
- }
- }
- Normalize(fp);
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
- BIF_wait_for_statechange();
- }
-
- return but->retval;
-}
-
-static int ui_do_but_CURVE(uiBut *but)
-{
- CurveMapping *cumap= (CurveMapping *)but->poin;
- CurveMap *cuma= cumap->cm+cumap->cur;
- CurveMapPoint *cmp= cuma->curve;
- float fx, fy, zoomx, zoomy, offsx, offsy;
- float dist, mindist= 200.0f; // 14 pixels radius
- int a, sel= -1, retval= but->retval;
- short mval[2], mvalo[2];
-
- uiGetMouse(mywinget(), mval);
-
- /* calculate offset and zoom */
- zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin);
- zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin);
- offsx= cumap->curr.xmin;
- offsy= cumap->curr.ymin;
-
- if(G.qual & LR_CTRLKEY) {
-
- fx= ((float)mval[0] - but->x1)/zoomx + offsx;
- fy= ((float)mval[1] - but->y1)/zoomy + offsy;
-
- curvemap_insert(cuma, fx, fy);
- curvemapping_changed(cumap, 0);
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
-
-
- /* check for selecting of a point */
- cmp= cuma->curve; /* ctrl adds point, new malloc */
- for(a=0; a<cuma->totpoint; a++) {
- fx= but->x1 + zoomx*(cmp[a].x-offsx);
- fy= but->y1 + zoomy*(cmp[a].y-offsy);
- dist= (fx-mval[0])*(fx-mval[0]) + (fy-mval[1])*(fy-mval[1]);
- if(dist < mindist) {
- sel= a;
- mindist= dist;
- }
- }
-
- if (sel == -1) {
- /* if the click didn't select anything, check if it's clicked on the
- * curve itself, and if so, add a point */
- fx= ((float)mval[0] - but->x1)/zoomx + offsx;
- fy= ((float)mval[1] - but->y1)/zoomy + offsy;
-
- cmp= cuma->table;
-
- /* loop through the curve segment table and find what's near the mouse.
- * 0.05 is kinda arbitrary, but seems to be what works nicely. */
- for(a=0; a<=CM_TABLE; a++) {
- if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) {
-
- curvemap_insert(cuma, fx, fy);
- curvemapping_changed(cumap, 0);
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- /* reset cmp back to the curve points again, rather than drawing segments */
- cmp= cuma->curve;
-
- /* find newly added point and make it 'sel' */
- for(a=0; a<cuma->totpoint; a++) {
- if (cmp[a].x == fx) sel = a;
- }
-
- break;
- }
- }
- }
-
- /* ok, we move a point */
- if(sel!= -1) {
- int moved_point;
- int moved_mouse= 0;
-
- /* deselect all if this one is deselect. except if we hold shift */
- if((G.qual & LR_SHIFTKEY)==0 && (cmp[sel].flag & SELECT)==0)
- for(a=0; a<cuma->totpoint; a++)
- cmp[a].flag &= ~SELECT;
- cmp[sel].flag |= SELECT;
-
- /* draw to show select updates */
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- /* while move mouse, do move points around */
- while(get_mbut() & L_MOUSE) {
-
- uiGetMouse(mywinget(), mvalo);
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
- moved_mouse= 1; /* for selection */
- moved_point= 0; /* for ctrl grid, can't use orig coords because of sorting */
-
- fx= (mvalo[0]-mval[0])/zoomx;
- fy= (mvalo[1]-mval[1])/zoomy;
- for(a=0; a<cuma->totpoint; a++) {
- if(cmp[a].flag & SELECT) {
- float origx= cmp[a].x, origy= cmp[a].y;
- cmp[a].x+= fx;
- cmp[a].y+= fy;
- if( (get_qual() & LR_SHIFTKEY) ) {
- cmp[a].x= 0.125f*floor(0.5f + 8.0f*cmp[a].x);
- cmp[a].y= 0.125f*floor(0.5f + 8.0f*cmp[a].y);
- }
- if(cmp[a].x!=origx || cmp[a].y!=origy)
- moved_point= 1;
- }
- }
- curvemapping_changed(cumap, 0); /* no remove doubles */
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- if(moved_point) {
- mval[0]= mvalo[0];
- mval[1]= mvalo[1];
- }
- }
- BIF_wait_for_statechange();
- }
-
- if(moved_mouse==0) {
- /* deselect all, select one */
- if((G.qual & LR_SHIFTKEY)==0) {
- for(a=0; a<cuma->totpoint; a++)
- cmp[a].flag &= ~SELECT;
- cmp[sel].flag |= SELECT;
- }
- }
- else
- curvemapping_changed(cumap, 1); /* remove doubles */
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- }
- else {
- /* we move the view */
- retval= B_NOP;
-
- while(get_mbut() & L_MOUSE) {
-
- uiGetMouse(mywinget(), mvalo);
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
- fx= (mvalo[0]-mval[0])/zoomx;
- fy= (mvalo[1]-mval[1])/zoomy;
-
- /* clamp for clip */
- if(cumap->flag & CUMA_DO_CLIP) {
- if(cumap->curr.xmin-fx < cumap->clipr.xmin)
- fx= cumap->curr.xmin - cumap->clipr.xmin;
- else if(cumap->curr.xmax-fx > cumap->clipr.xmax)
- fx= cumap->curr.xmax - cumap->clipr.xmax;
- if(cumap->curr.ymin-fy < cumap->clipr.ymin)
- fy= cumap->curr.ymin - cumap->clipr.ymin;
- else if(cumap->curr.ymax-fy > cumap->clipr.ymax)
- fy= cumap->curr.ymax - cumap->clipr.ymax;
- }
- cumap->curr.xmin-=fx;
- cumap->curr.ymin-=fy;
- cumap->curr.xmax-=fx;
- cumap->curr.ymax-=fy;
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
-
- mval[0]= mvalo[0];
- mval[1]= mvalo[1];
- }
- }
- BIF_wait_for_statechange();
- }
-
- return retval;
-}
-
-/* ************************************************ */
-
-void uiSetButLock(int val, char *lockstr)
-{
- UIlock |= val;
- if (val) UIlockstr= lockstr;
-}
-
-void uiClearButLock()
-{
- UIlock= 0;
- UIlockstr= NULL;
-}
-
-/* *************************************************************** */
-
-static void setup_file(uiBlock *block)
-{
- uiBut *but;
- FILE *fp;
-
- fp= fopen("butsetup","w");
- if(fp==NULL);
- else {
- but= block->buttons.first;
- while(but) {
- ui_check_but(but);
- fprintf(fp,"%d,%d,%d,%d %s %s\n", (int)but->x1, (int)but->y1, (int)( but->x2-but->x1), (int)(but->y2-but->y1), but->str, but->tip);
- but= but->next;
- }
- fclose(fp);
- }
-}
-
-
-static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent)
-{
- short dx, dy, mval[2], mvalo[2], didit=0;
-
- getmouseco_sc(mvalo);
- while(TRUE) {
- if( !(get_mbut() & L_MOUSE) ) break;
-
- getmouseco_sc(mval);
- dx= (mval[0]-mvalo[0]);
- dy= (mval[1]-mvalo[1]);
-
- if(dx!=0 || dy!=0) {
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- cpack(0xc0c0c0);
- glRectf(but->x1-2, but->y1-2, but->x2+2, but->y2+2);
-
- if((uevent->qual & LR_SHIFTKEY)==0) {
- but->x1 += dx;
- but->y1 += dy;
- }
- but->x2 += dx;
- but->y2 += dy;
-
- ui_draw_but(but);
- ui_block_flush_back(but->block);
- didit= 1;
-
- }
- /* idle for this poor code */
- else PIL_sleep_ms(30);
- }
- if(didit) setup_file(block);
-}
-
-
-/* is called when LEFTMOUSE is pressed or released
- * return: butval or zero
- */
-static int ui_do_button(uiBlock *block, uiBut *but, uiEvent *uevent)
-{
- int retval= 0;
-
- if(but->lock) {
- if (but->lockstr) {
- error("%s", but->lockstr);
- return 0;
- }
- }
- else {
- if( but->pointype ) { /* there's a pointer needed */
- if(but->poin==0 ) {
- printf("DoButton pointer error: %s\n",but->str);
- return 0;
- }
- }
- }
-
- if(G.rt==1 && (uevent->qual & LR_CTRLKEY)) {
- edit_but(block, but, uevent);
- return 0;
- }
-
- block->flag |= UI_BLOCK_BUSY;
-
- switch(but->type) {
- case BUT:
- if(uevent->val) retval= ui_do_but_BUT(but);
- break;
-
- case KEYEVT:
- if(uevent->val) retval= ui_do_but_KEYEVT(but);
- break;
-
- case TOG:
- case TOGR:
- case ICONTOG:
- case ICONTOGN:
- case TOGN:
- case BUT_TOGDUAL:
- if(uevent->val) {
- retval= ui_do_but_TOG(block, but, uevent->qual);
- }
- break;
-
- case ROW:
- if(uevent->val) retval= ui_do_but_ROW(block, but);
- break;
-
- case SCROLL:
- /* DrawBut(b, 1); */
- /* do_scrollbut(b); */
- /* DrawBut(b,0); */
- break;
-
- case NUM:
- case NUMABS:
- if(uevent->val) retval= ui_do_but_NUM(but);
- break;
-
- case SLI:
- case NUMSLI:
- case HSVSLI:
- if(uevent->val) retval= ui_do_but_NUMSLI(but);
- break;
-
- case ROUNDBOX:
- case LABEL:
- if(uevent->val) retval= ui_do_but_LABEL(but);
- break;
-
- case TOG3:
- if(uevent->val) retval= ui_do_but_TOG3(but);
- break;
-
- case TEX:
- if(uevent->val) retval= ui_do_but_TEX(but);
- break;
-
- case MENU:
- if(uevent->val) retval= ui_do_but_MENU(but);
- break;
-
- case ICONROW:
- if(uevent->val) retval= ui_do_but_ICONROW(but);
- break;
-
- case ICONTEXTROW:
- if(uevent->val) retval= ui_do_but_ICONTEXTROW(but);
- break;
-
- case IDPOIN:
- if(uevent->val) retval= ui_do_but_IDPOIN(but);
- break;
-
- case BLOCK:
- case PULLDOWN:
- if(uevent->val) {
- ui_do_but_BLOCK(but, uevent->event);
- retval= 0;
- if(block->auto_open==0) block->auto_open= 1;
- }
- break;
-
- case BUTM:
- retval= ui_do_but_BUTM(but);
- break;
-
- case LINK:
- case INLINK:
- retval= ui_do_but_LINK(block, but);
- break;
-
- case COL:
- if(uevent->val) retval= ui_do_but_COL(but);
- break;
-
- case HSVCUBE:
- retval= ui_do_but_HSVCUBE(but);
- break;
- case BUT_COLORBAND:
- retval= ui_do_but_COLORBAND(but);
- break;
- case BUT_NORMAL:
- retval= ui_do_but_NORMAL(but);
- break;
- case BUT_CURVE:
- retval= ui_do_but_CURVE(but);
- break;
-
-#ifdef INTERNATIONAL
- case CHARTAB:
- retval= ui_do_but_CHARTAB(but);
- break;
-#endif
- }
-
- block->flag &= ~UI_BLOCK_BUSY;
-
- return retval;
-}
-
-static void ui_delete_active_linkline(uiBlock *block)
-{
- uiBut *but;
- uiLink *link;
- uiLinkLine *line, *nline;
- int a, b;
-
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- line= but->link->lines.first;
- while(line) {
-
- nline= line->next;
-
- if(line->flag & UI_SELECT) {
- BLI_remlink(&but->link->lines, line);
-
- link= line->from->link;
-
- /* are there more pointers allowed? */
- if(link->ppoin) {
-
- if(*(link->totlink)==1) {
- *(link->totlink)= 0;
- MEM_freeN(*(link->ppoin));
- *(link->ppoin)= NULL;
- }
- else {
- b= 0;
- for(a=0; a< (*(link->totlink)); a++) {
-
- if( (*(link->ppoin))[a] != line->to->poin ) {
- (*(link->ppoin))[b]= (*(link->ppoin))[a];
- b++;
- }
- }
- (*(link->totlink))--;
- }
- }
- else {
- *(link->poin)= NULL;
- }
-
- MEM_freeN(line);
- }
- line= nline;
- }
- }
- but= but->next;
- }
-
- /* temporal! these buttons can be everywhere... */
- allqueue(REDRAWBUTSLOGIC, 0);
-}
-
-static void ui_do_active_linklines(uiBlock *block, short *mval)
-{
- uiBut *but;
- uiLinkLine *line, *act= NULL;
- float mindist= 12.0, fac, v1[2], v2[2], v3[3];
- int foundone= 0;
-
- if(mval) {
- v1[0]= mval[0];
- v1[1]= mval[1];
-
- /* find a line close to the mouse */
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- foundone= 1;
- line= but->link->lines.first;
- while(line) {
- v2[0]= line->from->x2;
- v2[1]= (line->from->y1+line->from->y2)/2.0;
- v3[0]= line->to->x1;
- v3[1]= (line->to->y1+line->to->y2)/2.0;
-
- fac= PdistVL2Dfl(v1, v2, v3);
- if(fac < mindist) {
- mindist= fac;
- act= line;
- }
- line= line->next;
- }
- }
- but= but->next;
- }
- }
-
- /* check for a 'found one' to prevent going to 'frontbuffer' mode.
- this slows done gfx quite some, and at OSX the 'finish' forces a swapbuffer */
- if(foundone) {
- glDrawBuffer(GL_FRONT);
-
- /* draw */
- but= block->buttons.first;
- while(but) {
- if(but->type==LINK && but->link) {
- line= but->link->lines.first;
- while(line) {
- if(line==act) {
- if((line->flag & UI_SELECT)==0) {
- line->flag |= UI_SELECT;
- ui_draw_linkline(but, line);
- }
- }
- else if(line->flag & UI_SELECT) {
- line->flag &= ~UI_SELECT;
- ui_draw_linkline(but, line);
- }
- line= line->next;
- }
- }
- but= but->next;
- }
- bglFlush();
- glDrawBuffer(GL_BACK);
- }
-}
-
-
-/* only to be used to prevent an 'outside' event when using nested pulldowns */
-/* only one checks:
- - while mouse moves in triangular area defined old mouse position and left/right side of new menu
- - only for 1 second
-
- return 0: check outside
-*/
-static int ui_mouse_motion_towards_block(uiBlock *block, uiEvent *uevent)
-{
- short mvalo[2], dx, dy, domx, domy;
- int counter=0;
-
- if((block->direction & UI_TOP) || (block->direction & UI_DOWN)) return 0;
- if(uevent->event!= MOUSEX && uevent->event!= MOUSEY) return 0;
-
- /* calculate dominant direction */
- domx= ( -uevent->mval[0] + (block->maxx+block->minx)/2 );
- domy= ( -uevent->mval[1] + (block->maxy+block->miny)/2 );
- /* we need some accuracy */
- if( abs(domx)<4 ) return 0;
-
- uiGetMouse(mywinget(), mvalo);
-
- while(TRUE) {
- uiGetMouse(mywinget(), uevent->mval);
-
- /* check inside, if so return */
- if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) {
- if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) {
- return 1;
- }
- }
-
- /* check direction */
- dx= uevent->mval[0] - mvalo[0];
- dy= uevent->mval[1] - mvalo[1];
-
- if( abs(dx)+abs(dy)>4 ) { // threshold
- /* menu to right */
- if(domx>0) {
- int fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->maxy +20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->minx);
- if( (fac>0)) {
- // printf("Left outside 1, Fac %d\n", fac);
- return 0;
- }
-
- fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->miny-20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->minx);
- if( (fac<0)) {
- //printf("Left outside 2, Fac %d\n", fac);
- return 0;
- }
- }
- else {
- int fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->maxy+20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->maxx);
- if( (fac<0)) {
- // printf("Left outside 1, Fac %d\n", fac);
- return 0;
- }
-
- fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->miny-20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->maxx);
- if( (fac>0)) {
- // printf("Left outside 2, Fac %d\n", fac);
- return 0;
- }
- }
- }
-
- /* idle for this poor code */
- PIL_sleep_ms(10);
- counter++;
- if(counter > 100) {
- //printf("left because of timer (1 sec)\n");
- return 0;
- }
- }
-
- return 0;
-}
-
-
-static void ui_set_ftf_font(float aspect)
-{
-
-#ifdef INTERNATIONAL
- if(aspect<1.15) {
- FTF_SetFontSize('l');
- }
- else if(aspect<1.59) {
- FTF_SetFontSize('m');
- }
- else {
- FTF_SetFontSize('s');
- }
-#endif
-}
-
-static void ui_but_next_edittext(uiBlock *block)
-{
- uiBut *but, *actbut;
-
- for(actbut= block->buttons.first; actbut; actbut= actbut->next) {
- /* label and roundbox can overlap real buttons (backdrops...) */
- if(actbut->type!=LABEL && actbut->type!=ROUNDBOX)
- if(actbut->flag & UI_ACTIVE) break;
- }
- if(actbut) {
- /* ensure all buttons are cleared, label/roundbox overlap */
- for(but= block->buttons.first; but; but= but->next)
- but->flag &= ~(UI_ACTIVE|UI_SELECT);
-
- for(but= actbut->next; but; but= but->next) {
- if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
- but->flag |= UI_ACTIVE;
- return;
- }
- }
- for(but= block->buttons.first; but!=actbut; but= but->next) {
- if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
- but->flag |= UI_ACTIVE;
- return;
- }
- }
- }
-}
-
-static void ui_but_prev_edittext(uiBlock *block)
-{
- uiBut *but, *actbut;
-
- for(actbut= block->buttons.first; actbut; actbut= actbut->next) {
- /* label and roundbox can overlap real buttons (backdrops...) */
- if(actbut->type!=LABEL && actbut->type!=ROUNDBOX)
- if(actbut->flag & UI_ACTIVE) break;
- }
- if(actbut) {
- /* ensure all buttons are cleared, label/roundbox overlap */
- for(but= block->buttons.first; but; but= but->next)
- but->flag &= ~(UI_ACTIVE|UI_SELECT);
-
- for(but= actbut->prev; but; but= but->prev) {
- if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
- but->flag |= UI_ACTIVE;
- return;
- }
- }
- for(but= block->buttons.last; but!=actbut; but= but->prev) {
- if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
- but->flag |= UI_ACTIVE;
- return;
- }
- }
- }
-}
-
-/* ******************************************************* */
-
-/* nasty but safe way to store screendump rect */
-static int scr_x=0, scr_y=0, scr_sizex=0, scr_sizey=0;
-
-static void ui_set_screendump_bbox(uiBlock *block)
-{
- if(block) {
- scr_x= block->minx;
- scr_y= block->miny;
- scr_sizex= block->maxx - block->minx;
- scr_sizey= block->maxy - block->miny;
- }
- else {
- scr_sizex= scr_sizey= 0;
- }
-}
-
-/* used for making screenshots for menus, called in screendump.c */
-int uiIsMenu(int *x, int *y, int *sizex, int *sizey)
-{
- if(scr_sizex!=0 && scr_sizey!=0) {
- *x= scr_x;
- *y= scr_y;
- *sizex= scr_sizex;
- *sizey= scr_sizey;
- return 1;
- }
-
- return 0;
-}
-/* ******************************************************* */
-
-/* return:
- * UI_NOTHING pass event to other ui's
- * UI_CONT don't pass event to other ui's
- * UI_RETURN something happened, return, swallow event
- */
-static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
-{
- uiBut *but, *bt;
- int butevent, event, retval=UI_NOTHING, count, act=0;
- int inside= 0, active=0;
-
- if(block->win != mywinget()) return UI_NOTHING;
-
- /* filter some unwanted events */
- /* btw: we allow event==0 for first time in menus, draws the hilited item */
- if(uevent==0 || uevent->event==LEFTSHIFTKEY || uevent->event==RIGHTSHIFTKEY) return UI_NOTHING;
- if(uevent->event==UI_BUT_EVENT) return UI_NOTHING;
-
- if(block->flag & UI_BLOCK_ENTER_OK) {
- if((uevent->event==RETKEY || uevent->event==PADENTER) && uevent->val) {
- // printf("qual: %d %d %d\n", uevent->qual, get_qual(), G.qual);
- if ((G.qual & LR_SHIFTKEY) == 0) {
- return UI_RETURN_OK;
- }
- }
- }
-
- ui_set_ftf_font(block->aspect); // sets just a pointer in ftf lib... the button dont have ftf handles
- ui_set_screendump_bbox(block);
-
- // added this for panels in windows with buttons...
- // maybe speed optimize should require test
- if((block->flag & UI_BLOCK_LOOP)==0) {
- glMatrixMode(GL_PROJECTION);
- bwin_load_winmatrix(block->win, block->winmat);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
-
- Mat4CpyMat4(UIwinmat, block->winmat);
- uiPanelPush(block); // push matrix; no return without pop!
-
- uiGetMouse(mywinget(), uevent->mval); /* transformed mouseco */
-
- /* check boundbox and panel events */
- if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) {
-
- // inside block
- if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) inside= INSIDE_BLOCK;
-
- if(block->panel && block->panel->paneltab==NULL) {
-
- /* clicked at panel header? */
- if( block->panel->flag & PNL_CLOSEDX) {
- if(block->minx <= uevent->mval[0] && block->minx+PNL_HEADER >= uevent->mval[0])
- inside= INSIDE_PANEL_HEADER;
- }
- else if( (block->maxy <= uevent->mval[1]) && (block->maxy+PNL_HEADER >= uevent->mval[1]) ) {
- inside= INSIDE_PANEL_HEADER;
- }
- else if( block->panel->control & UI_PNL_SCALE) {
- if( (block->maxx-PNL_HEADER <= uevent->mval[0]))
- if( (block->miny+PNL_HEADER >= uevent->mval[1]) && inside )
- inside= INSIDE_PANEL_SCALE;
- }
-
- if (inside) { // this stuff should move to do_panel
-
- if(uevent->event==LEFTMOUSE) {
- if(ELEM(inside, INSIDE_PANEL_HEADER, INSIDE_PANEL_SCALE)) {
- uiPanelPop(block); // pop matrix; no return without pop!
- if(inside==INSIDE_PANEL_HEADER)
- ui_do_panel(block, uevent);
- else
- ui_scale_panel(block);
- return UI_EXIT_LOOP; // exit loops because of moving panels
- }
- }
- else if(uevent->event==ESCKEY) {
- if(block->handler) {
- rem_blockhandler(curarea, block->handler);
- addqueue(curarea->win, REDRAW, 1);
- }
- }
- else if(uevent->event==PADPLUSKEY || uevent->event==PADMINUS) {
- int zoom=0;
-
- /* if panel is closed, only zoom if mouse is over the header */
- if ((block->panel->flag & PNL_CLOSEDX) || (block->panel->flag & PNL_CLOSEDY)) {
- if (inside == INSIDE_PANEL_HEADER)
- zoom=1;
- } else if (inside >= INSIDE_BLOCK)
- zoom=1;
-
- if(zoom) {
- SpaceLink *sl= curarea->spacedata.first;
- if(curarea->spacetype!=SPACE_BUTS) {
- if(!(block->panel->control & UI_PNL_SCALE)) {
- if(uevent->event==PADPLUSKEY) sl->blockscale+= 0.1;
- else sl->blockscale-= 0.1;
- CLAMP(sl->blockscale, 0.6, 1.0);
- addqueue(block->winq, REDRAW, 1);
- retval= UI_RETURN_OK;
- }
- }
- }
-
- }
- }
- }
- }
-
- /* inside menus, scrollwheel acts as arrow */
- if(block->flag & UI_BLOCK_LOOP) {
- if(uevent->event==WHEELUPMOUSE) uevent->event= UPARROWKEY;
- if(uevent->event==WHEELDOWNMOUSE) uevent->event= DOWNARROWKEY;
- }
-
- switch(uevent->event) {
- case LEFTARROWKEY: /* closing sublevels of pulldowns */
- if(uevent->val && (block->flag & UI_BLOCK_LOOP) && block->parent) {
- return UI_RETURN_OUT;
- }
- break;
-
- case RIGHTARROWKEY: /* opening sublevels of pulldowns */
- if(uevent->val && (block->flag & UI_BLOCK_LOOP)) {
- for(but= block->buttons.first; but; but= but->next) {
- if(but->flag & UI_ACTIVE) {
- if(but->type==BLOCK) {
- but->flag &= ~UI_MOUSE_OVER;
- uevent->event= BUT_ACTIVATE;
- }
- break;
- }
- }
- if(but==NULL) { /* no item active, we make first active */
- if(block->direction & UI_TOP) but= ui_but_last(block);
- else but= ui_but_first(block);
- if(but) {
- but->flag |= UI_ACTIVE;
- ui_draw_but(but);
- }
- }
- }
- break;
-
- case UPARROWKEY:
- case DOWNARROWKEY:
- if(inside || (block->flag & UI_BLOCK_LOOP)) {
- /* arrowkeys: only handle for block_loop blocks */
- event= 0;
- if(block->flag & UI_BLOCK_LOOP)
- event= uevent->event;
- if(event && uevent->val) {
-
- for(but= block->buttons.first; but; but= but->next) {
- but->flag &= ~UI_MOUSE_OVER;
-
- if(but->flag & UI_ACTIVE) {
- but->flag &= ~UI_ACTIVE;
- ui_draw_but(but);
-
- if(event==UPARROWKEY) {
- if(block->direction & UI_TOP) bt= ui_but_next(but);
- else bt= ui_but_prev(but);
- }
- else {
- if(block->direction & UI_TOP) bt= ui_but_prev(but);
- else bt= ui_but_next(but);
- }
-
- if(bt) {
- bt->flag |= UI_ACTIVE;
- ui_draw_but(bt);
- break;
- }
- }
- }
-
- /* nothing done */
- if(but==NULL) {
- if(event==UPARROWKEY) {
- if(block->direction & UI_TOP) but= ui_but_first(block);
- else but= ui_but_last(block);
- }
- else {
- if(block->direction & UI_TOP) but= ui_but_last(block);
- else but= ui_but_first(block);
- }
- if(but) {
- but->flag |= UI_ACTIVE;
- ui_draw_but(but);
- }
- }
- retval= UI_CONT;
- }
- }
- break;
-
- case ONEKEY: case PAD1:
- act= 1;
- case TWOKEY: case PAD2:
- if(act==0) act= 2;
- case THREEKEY: case PAD3:
- if(act==0) act= 3;
- case FOURKEY: case PAD4:
- if(act==0) act= 4;
- case FIVEKEY: case PAD5:
- if(act==0) act= 5;
- case SIXKEY: case PAD6:
- if(act==0) act= 6;
- case SEVENKEY: case PAD7:
- if(act==0) act= 7;
- case EIGHTKEY: case PAD8:
- if(act==0) act= 8;
- case NINEKEY: case PAD9:
- if(act==0) act= 9;
- case ZEROKEY: case PAD0:
- if(act==0) act= 10;
-
- if( block->flag & UI_BLOCK_NUMSELECT ) {
-
- if(get_qual() & LR_ALTKEY) act+= 10;
-
- count= 0;
- for(but= block->buttons.first; but; but= but->next) {
- int doit= 0;
-
- if(but->type!=LABEL && but->type!=SEPR) count++;
- /* exception for menus like layer buts, with button aligning they're not drawn in order */
- if(but->type==TOGR) {
- if(but->bitnr==act-1) doit= 1;
- } else if(count==act) doit=1;
-
- if(doit) {
- but->flag |= UI_ACTIVE;
- if(uevent->val==1) ui_draw_but(but);
- else if(block->flag & UI_BLOCK_RET_1) { /* to make UI_BLOCK_RET_1 working */
- uevent->event= RETKEY;
- uevent->val= 1;
- //addqueue(block->winq, RIGHTARROWKEY, 1); (why! (ton))
- }
- else {
- uevent->event= LEFTMOUSE; /* to make sure the button is handled further on */
- uevent->val= 1;
- }
- }
- else if(but->flag & UI_ACTIVE) {
- but->flag &= ~UI_ACTIVE;
- ui_draw_but(but);
- }
- }
- }
- break;
- case BUT_NEXT:
- ui_but_next_edittext(block);
- break;
- case BUT_PREV:
- ui_but_prev_edittext(block);
- break;
- case BUT_ACTIVATE:
- for(but= block->buttons.first; but; but= but->next) {
- if(but->retval==uevent->val) but->flag |= UI_ACTIVE;
- }
- break;
- case VKEY:
- case CKEY:
- if(uevent->val && (uevent->qual & (LR_CTRLKEY|LR_COMMANDKEY))) {
- for(but= block->buttons.first; but; but= but->next) {
- if(but->type!=LABEL && but->type!=ROUNDBOX) {
- if(but->flag & UI_ACTIVE) {
- int doit=0;
-
- if(uevent->event==VKEY) doit= ui_but_copy_paste(but, 'v');
- else ui_but_copy_paste(but, 'c');
-
- if(doit) {
- ui_draw_but(but);
-
- if(but->retval) addqueue(block->winq, UI_BUT_EVENT, (short)but->retval);
- if((but->type==NUMSLI && but->a1) || (but->type==COL)) addqueue(block->winq, REDRAW, 1); // col button update
-
- BIF_undo_push(but->str);
- }
- // but we do return, to prevent passing event through other queues */
- if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK);
- else if(but->retval) retval= UI_RETURN_OK;
- break;
- }
- }
- }
- }
- break;
-
-
-#ifdef INTERNATIONAL
- //HACK to let the chartab button react to the mousewheel and PGUP/PGDN keys
- case WHEELUPMOUSE:
- case PAGEUPKEY:
- for(but= block->buttons.first; but; but= but->next)
- {
- if(but->type == CHARTAB && (but->flag & UI_MOUSE_OVER))
- {
- G.charstart = G.charstart - (12*6);
- if(G.charstart < 0)
- G.charstart = 0;
- if(G.charstart < G.charmin)
- G.charstart = G.charmin;
- ui_draw_but(but);
-
- //Really nasty... to update the num button from the same butblock
- for(bt= block->buttons.first; bt; bt= bt->next)
- {
- if(ELEM(bt->type, NUM, NUMABS)) {
- ui_check_but(bt);
- ui_draw_but(bt);
- }
- }
- retval=UI_CONT;
- break;
- }
- }
- break;
-
- case WHEELDOWNMOUSE:
- case PAGEDOWNKEY:
- for(but= block->buttons.first; but; but= but->next)
- {
- if(but->type == CHARTAB && (but->flag & UI_MOUSE_OVER))
- {
- G.charstart = G.charstart + (12*6);
- if(G.charstart > (0xffff - 12*6))
- G.charstart = 0xffff - (12*6);
- if(G.charstart > G.charmax - 12*6)
- G.charstart = G.charmax - 12*6;
- ui_draw_but(but);
-
- for(bt= block->buttons.first; bt; bt= bt->next)
- {
- if(ELEM(bt->type, NUM, NUMABS)) {
- ui_check_but(bt);
- ui_draw_but(bt);
- }
- }
-
- but->flag |= UI_ACTIVE;
- retval=UI_RETURN_OK;
- break;
- }
- }
- break;
-#endif
-
- case PADENTER:
- case RETKEY: // prevent treating this as mousemove. for example when you enter at popup
- if(block->flag & UI_BLOCK_LOOP) break;
-
- default:
-
- for(but= block->buttons.first; but; but= but->next) {
-
- // active flag clear, it can have been set with number keys or arrows, prevents next loop from wrong selection on click
- if(uevent->event==LEFTMOUSE) but->flag &= ~UI_ACTIVE;
-
- but->flag &= ~UI_MOUSE_OVER;
-
- /* check boundbox */
- if (uibut_contains_pt(but, uevent->mval)) {
- but->flag |= UI_MOUSE_OVER;
- UIbuttip= but;
- }
- /* hilite case 1 */
- if(but->flag & UI_MOUSE_OVER) {
- if( (but->flag & UI_ACTIVE)==0) {
- but->flag |= UI_ACTIVE;
- if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
- }
- }
- /* hilite case 2 */
- if(but->flag & UI_ACTIVE) {
- if( (but->flag & UI_MOUSE_OVER)==0) {
- /* we dont clear active flag until mouse move, for Menu buttons to remain showing active item when opened */
- if (uevent->event==MOUSEY) {
- but->flag &= ~UI_ACTIVE;
- if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
- }
- }
- else if(but->type==BLOCK || but->type==MENU || but->type==PULLDOWN || but->type==ICONTEXTROW) { // automatic opens block button (pulldown)
- int time;
- if(uevent->event!=LEFTMOUSE ) {
- if(block->auto_open==2) time= 1; // test for toolbox
- else if(block->auto_open) time= 5*U.menuthreshold2;
- else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
- else time= -1;
-
- for (; time>0; time--) {
- if (qtest()) break;
- else PIL_sleep_ms(20);
- }
-
- if(time==0) {
- uevent->val= 1; // otherwise buttons dont react
- ui_do_button(block, but, uevent);
- }
- }
- }
- if(but->flag & UI_ACTIVE) active= 1;
- }
- }
-
- /* if there are no active buttons... otherwise clear lines */
- if(active) ui_do_active_linklines(block, 0);
- else ui_do_active_linklines(block, uevent->mval);
-
- }
-
- /* middlemouse exception, not for regular blocks */
- if( (block->flag & UI_BLOCK_LOOP) && uevent->event==MIDDLEMOUSE) uevent->event= LEFTMOUSE;
-
- /* the final dobutton */
- for(but= block->buttons.first; but; but= but->next) {
- if(but->flag & UI_ACTIVE) {
-
- /* UI_BLOCK_RET_1: not return when val==0 */
-
- if(uevent->val || (block->flag & UI_BLOCK_RET_1)==0) {
- if ELEM6(uevent->event, LEFTMOUSE, PADENTER, RETKEY, BUT_ACTIVATE, BUT_NEXT, BUT_PREV) {
- /* when mouse outside, don't do button */
- if(inside || uevent->event!=LEFTMOUSE) {
- if ELEM(uevent->event, BUT_NEXT, BUT_PREV) {
- butevent= ui_act_as_text_but(but);
- uibut_do_func(but);
- }
- else
- butevent= ui_do_button(block, but, uevent);
-
- /* add undo pushes if... */
- if( !(block->flag & UI_BLOCK_LOOP)) {
- if(!G.obedit) {
- if ELEM5(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX);
- else {
- /* define which string to use for undo */
- if ELEM(but->type, LINK, INLINK) screen_delayed_undo_push("Add button link");
- else if ELEM(but->type, MENU, ICONTEXTROW) screen_delayed_undo_push(but->drawstr);
- else if(but->drawstr[0]) screen_delayed_undo_push(but->drawstr);
- else screen_delayed_undo_push(but->tip);
- }
- }
- }
-
- if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent);
-
- /* i doubt about the next line! */
- /* if(but->func) mywinset(block->win); */
-
- if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK);
- else
- if (butevent) retval= UI_RETURN_OK;
- }
- }
- }
- }
- }
-
- /* flush to frontbuffer */
- if((block->flag & UI_BLOCK_LOOP)==0) { // no loop, might need total flush in uidoblocks()
- ui_block_flush_back(block);
- }
-
- uiPanelPop(block); // pop matrix; no return without pop!
-
-
- /* the linkines... why not make buttons from it? Speed? Memory? */
- if(uevent->val && (uevent->event==XKEY || uevent->event==DELKEY))
- ui_delete_active_linkline(block);
-
- /* here we check return conditions for menus */
- if(block->flag & UI_BLOCK_LOOP) {
-
- if(inside==0 && uevent->val==1) {
- if ELEM3(uevent->event, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) {
- if(BLI_in_rctf(&block->parentrct, (float)uevent->mval[0], (float)uevent->mval[1]));
- else return UI_RETURN_OUT;
- }
- }
-
- if(uevent->event==ESCKEY && uevent->val==1) return UI_RETURN_CANCEL;
-
- if((uevent->event==RETKEY || uevent->event==PADENTER) && uevent->val==1) return UI_RETURN_OK;
-
- /* check outside */
- if(inside==0 && movemouse_quit) {
- uiBlock *tblock= NULL;
-
- /* check for all parent rects, enables arrowkeys to be used */
- if(uevent->event!=MOUSEX && uevent->event!=MOUSEY) {
- for(tblock=block->parent; tblock; tblock= tblock->parent) {
- if( BLI_in_rctf(&tblock->parentrct, (float)uevent->mval[0], (float)uevent->mval[1]))
- break;
- else if( BLI_in_rctf(&tblock->safety, (float)uevent->mval[0], (float)uevent->mval[1]))
- break;
- }
- }
- /* strict check, and include the parent rect */
- if(tblock);
- else if( BLI_in_rctf(&block->parentrct, (float)uevent->mval[0], (float)uevent->mval[1]));
- else if( ui_mouse_motion_towards_block(block, uevent));
- else if( BLI_in_rctf(&block->safety, (float)uevent->mval[0], (float)uevent->mval[1]));
- else return UI_RETURN_OUT;
- }
- }
-
- return retval;
-}
-
-static uiOverDraw *ui_draw_but_tip(uiBut *but)
-{
- uiOverDraw *od;
- float x1, x2, y1, y2;
- rctf tip_bbox;
-
- BIF_GetBoundingBox(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS), &tip_bbox);
-
- x1= (but->x1+but->x2)/2;
- x2= x1+but->aspect*((tip_bbox.xmax-tip_bbox.xmin) + 8);
- y2= but->y1-10;
- y1= y2-but->aspect*((tip_bbox.ymax+(tip_bbox.ymax-tip_bbox.ymin)));
-
-
- /* for pulldown menus it doesnt work */
- if(mywinget()==G.curscreen->mainwin);
- else {
- ui_graphics_to_window(mywinget(), &x1, &y1);
- ui_graphics_to_window(mywinget(), &x2, &y2);
- }
-
- if(x2 > G.curscreen->sizex) {
- x1 -= x2-G.curscreen->sizex;
- x2= G.curscreen->sizex;
- }
- if(y1 < 0) {
- y1 += 36;
- y2 += 36;
- }
-
- od= ui_begin_overdraw((int)(x1-1), (int)(y1-2), (int)(x2+4), (int)(y2+4));
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- glColor4ub(0, 0, 0, 20);
-
- gl_round_box(GL_POLYGON, x1+3, y1-1, x2+1, y2-2, 2.0);
- gl_round_box(GL_POLYGON, x1+3, y1-2, x2+2, y2-2, 3.0);
-
- glColor4ub(0, 0, 0, 8);
-
- gl_round_box(GL_POLYGON, x1+3, y1-3, x2+3, y2-3, 4.0);
- gl_round_box(GL_POLYGON, x1+3, y1-4, x2+4, y2-3, 5.0);
-
- glDisable(GL_BLEND);
-
- glColor3ub(0xFF, 0xFF, 0xDD);
- glRectf(x1, y1, x2, y2);
-
- glColor3ub(0,0,0);
- /* set the position for drawing text +4 in from the left edge, and leaving an equal gap between the top of the background box
- * and the top of the string's tip_bbox, and the bottom of the background box, and the bottom of the string's tip_bbox
- */
- ui_rasterpos_safe(x1+4, ((y2-tip_bbox.ymax)+(y1+tip_bbox.ymin))/2 - tip_bbox.ymin, but->aspect);
- BIF_SetScale(1.0);
-
- BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS));
-
- ui_flush_overdraw(od); /* to show it in the frontbuffer */
- return od;
-}
-
-/* inside this function no global UIbuttip... qread is not safe */
-static void ui_do_but_tip(uiBut *buttip)
-{
- uiOverDraw *od;
- int time;
-
- if (buttip && buttip->tip && buttip->tip[0]) {
- /* Pause for a moment to see if we
- * should really display the tip
- * or if the user will keep moving
- * the pointer.
- */
- for (time= 0; time<25; time++) {
- if (anyqtest())
- return;
- else
- PIL_sleep_ms(20);
- }
-
- /* Display the tip, and keep it displayed
- * as long as the mouse remains on top
- * of the button that owns it.
- */
- Mat4CpyMat4(UIwinmat, buttip->block->winmat); // get rid of uiwinmat once...
- uiPanelPush(buttip->block); // panel matrix
- od= ui_draw_but_tip(buttip);
-
- if(od) {
- while (1) {
- char ascii;
- short val;
- unsigned short evt= extern_qread_ext(&val, &ascii);
-
- if (evt==MOUSEX || evt==MOUSEY) {
- short mouse[2];
- uiGetMouse(od->oldwin, mouse);
-
- if (!uibut_contains_pt(buttip, mouse))
- break;
- } else {
- mainqpushback(evt, val, ascii);
- break;
- }
- }
-
- ui_end_overdraw(od);
- }
-
- uiPanelPop(buttip->block); // panel matrix
- /* still the evil global.... */
- UIbuttip= NULL;
- }
-}
-
-/* returns UI_NOTHING, if nothing happened */
-int uiDoBlocks(ListBase *lb, int event, int movemouse_quit)
-{
- /* return when: firstblock != BLOCK_LOOP
- *
- * 'cont' is used to make sure you can press another button while a looping menu
- * is active. otherwise you have to press twice...
- */
-
- uiBlock *block, *first;
- uiEvent uevent;
- int retval= UI_NOTHING, cont= 1;
-
- if(lb->first==0) return UI_NOTHING;
-
- /* for every pixel both x and y events are generated, overloads the system! */
- if(event==MOUSEX) return UI_NOTHING;
-
- UIbuttip= NULL;
- UIafterfunc_butm= NULL; /* to prevent infinite loops, this shouldnt be a global! */
- UIafterfunc_but= NULL; /* to prevent infinite loops, this shouldnt be a global! */
- UIafterfunc_arg1= UIafterfunc_arg2= NULL;
-
- uevent.qual= G.qual;
- uevent.event= event;
- uevent.val= 1;
-
- /* this is a caching mechanism, to prevent too many calls to glFrontBuffer and glFlush, which slows down interface */
- block= lb->first;
- while(block) {
- ui_block_set_flush(block, NULL); // clears all flushing info
- block= block->next;
- }
-
- /* main loop, needed when you click outside a looping block (menu) then it uses that
- event to immediately evaluate the other uiBlocks again. */
- while(cont) {
-
- /* first loop, for the normal blocks */
- block= lb->first;
- while(block) {
-
- /* for pupmenus, the bgnpupdraw sets (and later restores) the active
- window. Then mousecoords get transformed OK.
- It looks double... but a call to ui_do_block otherwise doesnt get handled properly
- */
- if(block->flag & UI_BLOCK_REDRAW) {
- if( block->flag & UI_BLOCK_LOOP) {
- block->overdraw= ui_begin_overdraw((int)block->minx-1, (int)block->miny-10, (int)block->maxx+10, (int)block->maxy+1);
- }
- block->in_use= 1; // is always a menu
- uiDrawBlock(block);
- block->flag &= ~UI_BLOCK_REDRAW;
- }
-
- block->in_use= 1; // bit awkward, but now we can detect if frontbuf flush should be set
- retval |= ui_do_block(block, &uevent, movemouse_quit); /* we 'or' because 2nd loop can return to here, and we we want 'out' to return */
- block->in_use= 0;
- if(retval & UI_EXIT_LOOP) break;
-
- /* now a new block could be created for menus, this is
- inserted in the beginning of a list */
-
- /* is there a flush cached? */
- if(block->needflush) {
- ui_block_flush_overdraw(block);
- block->needflush= 0;
- }
-
- /* to make sure the matrix of the panel works for menus too */
- if(retval==UI_CONT || (retval & UI_RETURN)) break;
- first= lb->first; if(first->flag & UI_BLOCK_LOOP) break;
-
- block= block->next;
- }
-
- /* second loop, for menus (looping blocks). works for sub->menus too */
- block= lb->first;
- if(block==NULL || (block->flag & UI_BLOCK_LOOP)==0) cont= 0;
-
- while( (block= lb->first) && (block->flag & UI_BLOCK_LOOP)) {
- if(block->auto_open==0) block->auto_open= 1;
-
- /* this here, for menu buts */
- if(block->flag & UI_BLOCK_REDRAW) {
-
- if( block->flag & UI_BLOCK_LOOP) {
- block->overdraw= ui_begin_overdraw((int)block->minx-1, (int)block->miny-6, (int)block->maxx+6, (int)block->maxy+1);
- }
- uiDrawBlock(block);
- block->flag &= ~UI_BLOCK_REDRAW;
- ui_flush_overdraw(block->overdraw);
- block->needflush= 0;
- }
-
- uevent.event= extern_qread(&uevent.val);
- uevent.qual= G.qual;
-
- if(uevent.event) {
- block->in_use= 1; // bit awkward, but now we can detect if frontbuf flush should be set
- retval= ui_do_block(block, &uevent, movemouse_quit);
- block->in_use= 0;
-
- if(block->needflush) { // flush (old menu) now, maybe new menu was opened
- ui_block_flush_overdraw(block);
- block->needflush= 0;
- }
-
- if(retval & UI_RETURN) {
- ui_end_overdraw(block->overdraw);
- BLI_remlink(lb, block);
- uiFreeBlock(block);
- }
- if(retval & (UI_RETURN_OK|UI_RETURN_CANCEL)) {
- /* free other menus */
- while( (block= lb->first) && (block->flag & UI_BLOCK_LOOP)) {
- ui_end_overdraw(block->overdraw);
- BLI_remlink(lb, block);
- uiFreeBlock(block);
- }
- }
- }
-
- /* tooltip */
- if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) {
- if(U.flag & USER_TOOLTIPS) ui_do_but_tip(UIbuttip);
- }
- }
-
- /* else it does the first part of this loop again, maybe another menu needs to be opened */
- if(retval==UI_CONT || (retval & UI_RETURN_OK)) cont= 0;
- }
-
- /* clears screendump boundbox, call before afterfunc! */
- ui_set_screendump_bbox(NULL);
-
- /* afterfunc is used for fileloading too, so after this call, the blocks pointers are invalid */
- if(retval & UI_RETURN_OK) {
- if(UIafterfunc_butm) {
- mywinset(curarea->win);
- UIafterfunc_butm(UIafterfunc_arg1, UIafterval);
- UIafterfunc_butm= NULL;
- }
- if(UIafterfunc_but) {
- mywinset(curarea->win);
- UIafterfunc_but(UIafterfunc_arg1, UIafterfunc_arg2);
- UIafterfunc_but= NULL;
- }
- }
-
- /* tooltip */
- if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) {
- if(U.flag & USER_TOOLTIPS) ui_do_but_tip(UIbuttip);
- }
-
- return retval;
-}
-
-/* ************** DATA *************** */
-
-/* for buttons pointing to color for example */
-void ui_get_but_vectorf(uiBut *but, float *vec)
-{
- void *poin;
-
- poin= but->poin;
-
- if( but->pointype == CHA ) {
- char *cp= (char *)poin;
- vec[0]= ((float)cp[0])/255.0;
- vec[1]= ((float)cp[1])/255.0;
- vec[2]= ((float)cp[2])/255.0;
- }
- else if( but->pointype == FLO ) {
- float *fp= (float *)poin;
- VECCOPY(vec, fp);
- }
-}
-/* for buttons pointing to color for example */
-void ui_set_but_vectorf(uiBut *but, float *vec)
-{
- void *poin;
-
- poin= but->poin;
-
- if( but->pointype == CHA ) {
- char *cp= (char *)poin;
- cp[0]= (char)(0.5 +vec[0]*255.0);
- cp[1]= (char)(0.5 +vec[1]*255.0);
- cp[2]= (char)(0.5 +vec[2]*255.0);
- }
- else if( but->pointype == FLO ) {
- float *fp= (float *)poin;
- VECCOPY(fp, vec);
- }
-}
-
-double ui_get_but_val(uiBut *but)
-{
- void *poin;
- double value = 0.0;
-
- if(but->poin==NULL) return 0.0;
- poin= but->poin;
-
- if(but->type== HSVSLI) {
- float h, s, v, *fp= (float *) poin;
-
- rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
-
- switch(but->str[0]) {
- case 'H': value= h; break;
- case 'S': value= s; break;
- case 'V': value= v; break;
- }
-
- }
- else if( but->pointype == CHA ) {
- value= *(char *)poin;
- }
- else if( but->pointype == SHO ) {
- value= *(short *)poin;
- }
- else if( but->pointype == INT ) {
- value= *(int *)poin;
- }
- else if( but->pointype == FLO ) {
- value= *(float *)poin;
- }
-
- return value;
-}
-
-static void ui_set_but_val(uiBut *but, double value)
-{
- void *poin;
-
- if(but->pointype==0) return;
- poin= but->poin;
-
- /* value is a hsv value: convert to rgb */
- if( but->type==HSVSLI ) {
- float h, s, v, *fp= (float *)but->poin;
-
- rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v);
-
- switch(but->str[0]) {
- case 'H': h= value; break;
- case 'S': s= value; break;
- case 'V': v= value; break;
- }
-
- hsv_to_rgb(h, s, v, fp, fp+1, fp+2);
-
- }
- else if( but->pointype==CHA )
- *((char *)poin)= (char)floor(value+0.5);
- else if( but->pointype==SHO ) {
- /* gcc 3.2.1 seems to have problems
- * casting a double like 32772.0 to
- * a short so we cast to an int, then
- to a short */
- int gcckludge;
- gcckludge = (int) floor(value+0.5);
- *((short *)poin)= (short) gcckludge;
- }
- else if( but->pointype==INT )
- *((int *)poin)= (int)floor(value+0.5);
- else if( but->pointype==FLO ) {
- float fval= (float)value;
- if(fval>= -0.00001f && fval<= 0.00001f) fval= 0.0f; /* prevent negative zero */
- *((float *)poin)= fval;
- }
-
- /* update select flag */
- ui_is_but_sel(but);
-
-}
-
-void uiSetCurFont(uiBlock *block, int index)
-{
-
- ui_set_ftf_font(block->aspect);
-
- if(block->aspect<0.60) {
- block->curfont= UIfont[index].xl;
- }
- else if(block->aspect<1.15) {
- block->curfont= UIfont[index].large;
- }
- else if(block->aspect<1.59) {
- block->curfont= UIfont[index].medium;
- }
- else {
- block->curfont= UIfont[index].small;
- }
-
- if(block->curfont==NULL) block->curfont= UIfont[index].large;
- if(block->curfont==NULL) block->curfont= UIfont[index].medium;
- if(block->curfont==NULL) printf("error block no font %s\n", block->name);
-
-}
-
-/* called by node editor */
-void *uiSetCurFont_ext(float aspect)
-{
- void *curfont;
-
- ui_set_ftf_font(aspect);
-
- if(aspect<0.60) {
- curfont= UIfont[0].xl;
- }
- else if(aspect<1.15) {
- curfont= UIfont[0].large;
- }
- else if(aspect<1.59) {
- curfont= UIfont[0].medium;
- }
- else {
- curfont= UIfont[0].small;
- }
-
- if(curfont==NULL) curfont= UIfont[0].large;
- if(curfont==NULL) curfont= UIfont[0].medium;
-
- return curfont;
-}
-
-void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small)
-{
- if(index>=UI_ARRAY) return;
-
- UIfont[index].xl= xl;
- UIfont[index].large= large;
- UIfont[index].medium= medium;
- UIfont[index].small= small;
-}
-
-static void ui_free_link(uiLink *link)
-{
- if(link) {
- BLI_freelistN(&link->lines);
- MEM_freeN(link);
- }
-}
-
-static void ui_free_but(uiBut *but)
-{
- if(but->str && but->str != but->strdata) MEM_freeN(but->str);
- ui_free_link(but->link);
-
- MEM_freeN(but);
-}
-
-void uiFreeBlock(uiBlock *block)
-{
- uiBut *but;
-
- if(block->flag & UI_BLOCK_BUSY) printf("attempt to free busy buttonblock: %p\n", block);
-
- while( (but= block->buttons.first) ) {
- BLI_remlink(&block->buttons, but);
- ui_free_but(but);
- }
-
- if(block->panel) block->panel->active= 0;
-
-
- MEM_freeN(block);
- UIbuttip= NULL;
-}
-
-void uiFreeBlocks(ListBase *lb)
-{
- uiBlock *block;
-
- while( (block= lb->first) ) {
- BLI_remlink(lb, block);
- uiFreeBlock(block);
- }
-}
-
-void uiFreeBlocksWin(ListBase *lb, int win)
-{
- uiBlock *block, *blockn;
-
- block= lb->first;
- while(block) {
- blockn= block->next;
- if(block->win==win) {
- BLI_remlink(lb, block);
- uiFreeBlock(block);
- }
- block= blockn;
- }
-}
-
-uiBlock *uiNewBlock(ListBase *lb, char *name, short dt, short font, short win)
-{
- uiBlock *block;
-
- /* each listbase only has one block with this name */
- if(lb) {
- for (block= lb->first; block; block= block->next)
- if (BLI_streq(block->name, name))
- break;
- if (block) {
- BLI_remlink(lb, block);
- uiFreeBlock(block);
- }
- }
-
- block= MEM_callocN(sizeof(uiBlock), "uiBlock");
- if(lb) BLI_addhead(lb, block); /* at the beginning of the list! for dynamical menus/blocks */
-
- strcpy(block->name, name);
- /* draw win */
- block->win= win;
- /* window where queue event should be added, pretty weak this way!
- this is because the 'mainwin' pup menu's */
- block->winq= mywinget();
- block->dt= dt;
- block->themecol= TH_AUTO;
-
- /* aspect */
- bwin_getsinglematrix(win, block->winmat);
-
- if (win==G.curscreen->mainwin) {
- block->aspect= 1.0;
- block->auto_open= 2;
- } else {
- int getsizex, getsizey;
-
- bwin_getsize(win, &getsizex, &getsizey);
- /* TODO - investigate why block->winmat[0][0] is negative
- * in the image view when viewRedrawForce is called */
- block->aspect= 2.0/fabs( (getsizex)*block->winmat[0][0]);
- }
-
- uiSetCurFont(block, font);
-
- UIbuttip= NULL;
- UIlock= 0;
-
- return block;
-}
-
-uiBlock *uiGetBlock(char *name, ScrArea *sa)
-{
- uiBlock *block= sa->uiblocks.first;
-
- while(block) {
- if( strcmp(name, block->name)==0 ) return block;
- block= block->next;
- }
-
- return NULL;
-}
-
-void ui_check_but(uiBut *but)
-{
- /* if something changed in the button */
- ID *id;
- double value;
- float okwidth;
- int transopts= (U.transopts & USER_TR_BUTTONS);
- short pos;
-
- ui_is_but_sel(but);
-
- if(but->type==TEX || but->type==IDPOIN) transopts= 0;
-
- /* test for min and max, icon sliders, etc */
- switch( but->type ) {
- case NUM:
- case SLI:
- case SCROLL:
- case NUMSLI:
- case HSVSLI:
- value= ui_get_but_val(but);
- if(value < but->min) value= but->min;
- if(value > but->max) value= but->max;
- ui_set_but_val(but, value);
- break;
-
- case NUMABS:
- value= fabs( ui_get_but_val(but) );
- if(value < but->min) value= but->min;
- if(value > but->max) value= but->max;
- ui_set_but_val(but, value);
- break;
-
- case ICONTOG:
- case ICONTOGN:
- if(but->flag & UI_SELECT) but->iconadd= 1;
- else but->iconadd= 0;
- break;
-
- case ICONROW:
- value= ui_get_but_val(but);
- but->iconadd= (int)value- (int)(but->min);
- break;
-
- case ICONTEXTROW:
- value= ui_get_but_val(but);
- but->iconadd= (int)value- (int)(but->min);
- break;
- }
-
-
- /* safety is 4 to enable small number buttons (like 'users') */
- if(but->type==NUMSLI || but->type==HSVSLI)
- okwidth= -4 + (but->x2 - but->x1)/2.0;
- else
- okwidth= -4 + (but->x2 - but->x1);
-
- /* name: */
- switch( but->type ) {
-
- case MENU:
- case ICONTEXTROW:
-
- if(but->x2 - but->x1 > 24) {
- value= ui_get_but_val(but);
- ui_set_name_menu(but, (int)value);
- }
- break;
-
- case NUM:
- case NUMSLI:
- case HSVSLI:
- case NUMABS:
-
- value= ui_get_but_val(but);
-
- if( but->pointype==FLO ) {
- if(but->a2) { /* amount of digits defined */
- if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);
- else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value);
- else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value);
- else sprintf(but->drawstr, "%s%.4f", but->str, value);
- }
- else {
- if(but->max<10.001) sprintf(but->drawstr, "%s%.3f", but->str, value);
- else sprintf(but->drawstr, "%s%.2f", but->str, value);
- }
- }
- else {
- sprintf(but->drawstr, "%s%d", but->str, (int)value);
- }
- break;
-
- case LABEL:
- if( but->pointype==FLO && but->poin) {
- value= ui_get_but_val(but);
- if(but->a2) { /* amount of digits defined */
- if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value);
- else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value);
- else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value);
- else sprintf(but->drawstr, "%s%.4f", but->str, value);
- }
- else {
- sprintf(but->drawstr, "%s%.2f", but->str, value);
- }
- }
- else strcpy(but->drawstr, but->str);
-
- break;
-
- case IDPOIN:
- id= *(but->idpoin_idpp);
- strcpy(but->drawstr, but->str);
- if(id) strcat(but->drawstr, id->name+2);
- break;
-
- case TEX:
- strcpy(but->drawstr, but->str);
- strcat(but->drawstr, but->poin);
- break;
-
- case KEYEVT:
- strcpy(but->drawstr, but->str);
- if (but->flag & UI_SELECT) {
- strcat(but->drawstr, "Press a key");
- } else {
- strcat(but->drawstr, key_event_to_string((short) ui_get_but_val(but)));
- }
- break;
- case BUT_TOGDUAL:
- /* trying to get the dual-icon to left of text... not very nice */
- if(but->str[0]) {
- strcpy(but->drawstr, " ");
- strcpy(but->drawstr+2, but->str);
- }
- break;
- default:
- strcpy(but->drawstr, but->str);
-
- }
-
- if(but->drawstr[0]) {
- but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, transopts);
- // here should be check for less space for icon offsets...
- if(but->type==MENU) okwidth -= 15;
- }
- else
- but->strwidth= 0;
-
- /* automatic width */
- if(but->x2==0.0f && but->x1 > 0.0f) {
- but->x2= (but->x1+but->strwidth+6);
- }
-
- if(but->strwidth==0) but->drawstr[0]= 0;
- else if(but->type==BUTM || but->type==BLOCK); // no clip string, uiTextBoundsBlock is used (hack!)
- else {
-
- /* calc but->ofs, to draw the string shorter if too long */
- but->ofs= 0;
- while(but->strwidth > (int)okwidth ) {
-
- if ELEM3(but->type, NUM, NUMABS, TEX) { // only these cut off left
- but->ofs++;
- but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, transopts);
-
- /* textbut exception */
- if(but->pos != -1) {
- pos= but->pos+strlen(but->str);
- if(pos-1 < but->ofs) {
- pos= but->ofs-pos+1;
- but->ofs -= pos;
- if(but->ofs<0) {
- but->ofs= 0;
- pos--;
- }
- but->drawstr[ strlen(but->drawstr)-pos ]= 0;
- }
- }
- }
- else {
- but->drawstr[ strlen(but->drawstr)-1 ]= 0;
- but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, transopts);
- }
-
- if(but->strwidth < 10) break;
- }
- }
-}
-
-static int ui_auto_themecol(uiBut *but)
-{
-
- switch(but->type) {
- case BUT:
- return TH_BUT_ACTION;
- case ROW:
- case TOG:
- case TOG3:
- case TOGR:
- case TOGN:
- case BUT_TOGDUAL:
- return TH_BUT_SETTING;
- case SLI:
- case NUM:
- case NUMSLI:
- case NUMABS:
- case HSVSLI:
- return TH_BUT_NUM;
- case TEX:
- return TH_BUT_TEXTFIELD;
- case PULLDOWN:
- case BLOCK:
- case MENU:
- case BUTM:
- // (weak!) detect if it is a blockloop
- if(but->block->dt == UI_EMBOSSP) return TH_MENU_ITEM;
- return TH_BUT_POPUP;
- case ROUNDBOX:
- return TH_PANEL;
- default:
- return TH_BUT_NEUTRAL;
- }
-}
-
-void uiBlockBeginAlign(uiBlock *block)
-{
- /* if other align was active, end it */
- if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
-
- block->flag |= UI_BUT_ALIGN_DOWN;
- /* buttons declared after this call will this align flag */
-}
-
-static int buts_are_horiz(uiBut *but1, uiBut *but2)
-{
- float dx, dy;
-
- dx= fabs( but1->x2 - but2->x1);
- dy= fabs( but1->y1 - but2->y2);
-
- if(dx > dy) return 0;
- return 1;
-}
-
-void uiBlockEndAlign(uiBlock *block)
-{
- uiBut *prev, *but=NULL, *next;
- int flag= 0, cols=0, rows=0;
- int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
-
- if ( !(ELEM3(theme, TH_MINIMAL, TH_SHADED, TH_ROUNDED)) ) {
- block->flag &= ~UI_BUT_ALIGN; // all 4 flags
- return;
- }
-
- /* auto align:
- - go back to first button of align start (ALIGN_DOWN)
- - compare triples, and define flags
- */
- prev= block->buttons.last;
- while(prev) {
- if( (prev->flag & UI_BUT_ALIGN_DOWN)) but= prev;
- else break;
-
- if(but && but->next) {
- if(buts_are_horiz(but, but->next)) cols++;
- else rows++;
- }
-
- prev= prev->prev;
- }
- if(but==NULL) return;
-
- /* rows==0: 1 row, cols==0: 1 collumn */
-
- /* note; how it uses 'flag' in loop below (either set it, or OR it) is confusing */
- prev= NULL;
- while(but) {
- next= but->next;
-
- /* clear old flag */
- but->flag &= ~UI_BUT_ALIGN_DOWN;
-
- if(flag==0) { /* first case */
- if(next) {
- if(buts_are_horiz(but, next)) {
- if(rows==0)
- flag= UI_BUT_ALIGN_RIGHT;
- else
- flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT;
- }
- else {
- flag= UI_BUT_ALIGN_DOWN;
- }
- }
- }
- else if(next==NULL) { /* last case */
- if(prev) {
- if(buts_are_horiz(prev, but)) {
- if(rows==0)
- flag= UI_BUT_ALIGN_LEFT;
- else
- flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT;
- }
- else flag= UI_BUT_ALIGN_TOP;
- }
- }
- else if(buts_are_horiz(but, next)) {
- /* check if this is already second row */
- if( prev && buts_are_horiz(prev, but)==0) {
- flag |= UI_BUT_ALIGN_TOP;
- /* exception case: bottom row */
- if(rows>0) {
- uiBut *bt= but;
- while(bt) {
- if(bt->next && buts_are_horiz(bt, bt->next)==0 ) break;
- bt= bt->next;
- }
- if(bt==0) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT;
- }
- }
- else flag |= UI_BUT_ALIGN_LEFT;
- }
- else {
- if(cols==0) {
- flag |= UI_BUT_ALIGN_TOP;
- }
- else { /* next button switches to new row */
- if( (flag & UI_BUT_ALIGN_TOP)==0) { /* stil top row */
- if(prev)
- flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT;
- else
- flag |= UI_BUT_ALIGN_DOWN;
- }
- else
- flag |= UI_BUT_ALIGN_TOP;
- }
- }
-
- but->flag |= flag;
-
- /* merge coordinates */
- if(prev) {
- // simple cases
- if(rows==0) {
- but->x1= (prev->x2+but->x1)/2.0;
- prev->x2= but->x1;
- }
- else if(cols==0) {
- but->y2= (prev->y1+but->y2)/2.0;
- prev->y1= but->y2;
- }
- else {
- if(buts_are_horiz(prev, but)) {
- but->x1= (prev->x2+but->x1)/2.0;
- prev->x2= but->x1;
- /* copy height too */
- but->y2= prev->y2;
- }
- else if(prev->prev && buts_are_horiz(prev->prev, prev)==0) {
- /* the previous button is a single one in its row */
- but->y2= (prev->y1+but->y2)/2.0;
- prev->y1= but->y2;
- }
- else {
- /* the previous button is not a single one in its row */
- but->y2= prev->y1;
- }
- }
- }
-
- prev= but;
- but= next;
- }
-
- block->flag &= ~UI_BUT_ALIGN; // all 4 flags
-}
-
-#if 0
-static void uiBlockEndAligno(uiBlock *block)
-{
- uiBut *but;
-
- /* correct last defined button */
- but= block->buttons.last;
- if(but) {
- /* vertical align case */
- if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_DOWN) ) {
- but->flag &= ~UI_BUT_ALIGN_DOWN;
- }
- /* horizontal align case */
- if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT) ) {
- but->flag &= ~UI_BUT_ALIGN_RIGHT;
- }
- /* else do nothing, manually provided flags */
- }
- block->flag &= ~UI_BUT_ALIGN; // all 4 flags
-}
-#endif
-
-/*
-ui_def_but is the function that draws many button types
-
-for float buttons:
- "a1" Click Step (how much to change the value each click)
- "a2" Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4,
- all greater values will be clamped to 4.
-
-*/
-static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- uiBut *but;
- short slen;
-
- if(type & BUTPOIN) { /* a pointer is required */
- if(poin==NULL) {
- /* if pointer is zero, button is removed and not drawn */
- BIF_ThemeColor(block->themecol);
- glRects(x1, y1, x1+x2, y1+y2);
- return NULL;
- }
- }
-
- but= MEM_callocN(sizeof(uiBut), "uiBut");
-
- but->type= type & BUTTYPE;
- but->pointype= type & BUTPOIN;
- but->bit= type & BIT;
- but->bitnr= type & 31;
- but->icon = 0;
-
- BLI_addtail(&block->buttons, but);
-
- but->retval= retval;
- if( strlen(str)>=UI_MAX_NAME_STR-1 ) {
- but->str= MEM_callocN( strlen(str)+2, "uiDefBut");
- strcpy(but->str, str);
- }
- else {
- but->str= but->strdata;
- strcpy(but->str, str);
- }
- but->x1= x1;
- but->y1= y1;
- if(block->autofill) {
- but->x2= x2;
- but->y2= y2;
- }
- else {
- but->x2= (x1+x2);
- but->y2= (y1+y2);
- }
- but->poin= poin;
- but->min= min;
- but->max= max;
- but->a1= a1;
- but->a2= a2;
- but->tip= tip;
-
- but->font= block->curfont;
-
- but->lock= UIlock;
- but->lockstr= UIlockstr;
-
- but->aspect= block->aspect;
- but->win= block->win;
- but->block= block; // pointer back, used for frontbuffer status, and picker
-
- if(block->themecol==TH_AUTO) but->themecol= ui_auto_themecol(but);
- else but->themecol= block->themecol;
-
- if (but->type==BUTM) {
- but->butm_func= block->butm_func;
- but->butm_func_arg= block->butm_func_arg;
- } else {
- but->func= block->func;
- but->func_arg1= block->func_arg1;
- but->func_arg2= block->func_arg2;
- }
-
- ui_set_embossfunc(but, block->dt);
-
- but->pos= -1; /* cursor invisible */
-
- if(ELEM(but->type, NUM, NUMABS)) { /* add a space to name */
- slen= strlen(but->str);
- if(slen>0 && slen<UI_MAX_NAME_STR-2) {
- if(but->str[slen-1]!=' ') {
- but->str[slen]= ' ';
- but->str[slen+1]= 0;
- }
- }
- }
-
- if(but->type==HSVCUBE) { /* hsv buttons temp storage */
- float rgb[3];
- ui_get_but_vectorf(but, rgb);
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2);
- }
-
- if ELEM8(but->type, HSVSLI , NUMSLI, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM) {
- but->flag |= UI_TEXT_LEFT;
- }
-
- if(but->type==BUT_TOGDUAL) {
- but->flag |= UI_ICON_LEFT;
- }
-
- if(but->type==ROUNDBOX)
- but->flag |= UI_NO_HILITE;
-
- but->flag |= (block->flag & UI_BUT_ALIGN);
- if(block->flag & UI_BLOCK_NO_HILITE)
- but->flag |= UI_NO_HILITE;
-
- return but;
-}
-
-uiBut *uiDefBut(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
-
- ui_check_but(but);
-
- return but;
-}
-
- /* if _x_ is a power of two (only one bit) return the power,
- * otherwise return -1.
- * (1<<findBitIndex(x))==x for powers of two.
- */
-static int findBitIndex(unsigned int x) {
- if (!x || (x&(x-1))!=0) { /* x&(x-1) strips lowest bit */
- return -1;
- } else {
- int idx= 0;
-
- if (x&0xFFFF0000) idx+=16, x>>=16;
- if (x&0xFF00) idx+=8, x>>=8;
- if (x&0xF0) idx+=4, x>>=4;
- if (x&0xC) idx+=2, x>>=2;
- if (x&0x2) idx+=1;
-
- return idx;
- }
-}
-
-/* autocomplete helper functions */
-struct AutoComplete {
- int maxlen;
- char *truncate;
- char *startname;
-};
-
-AutoComplete *autocomplete_begin(char *startname, int maxlen)
-{
- AutoComplete *autocpl;
-
- autocpl= MEM_callocN(sizeof(AutoComplete), "AutoComplete");
- autocpl->maxlen= maxlen;
- autocpl->truncate= MEM_callocN(sizeof(char)*maxlen, "AutoCompleteTruncate");
- autocpl->startname= startname;
-
- return autocpl;
-}
-
-void autocomplete_do_name(AutoComplete *autocpl, const char *name)
-{
- char *truncate= autocpl->truncate;
- char *startname= autocpl->startname;
- int a;
-
- for(a=0; a<autocpl->maxlen-1; a++) {
- if(startname[a]==0 || startname[a]!=name[a])
- break;
- }
- /* found a match */
- if(startname[a]==0) {
- /* first match */
- if(truncate[0]==0)
- BLI_strncpy(truncate, name, autocpl->maxlen);
- else {
- /* remove from truncate what is not in bone->name */
- for(a=0; a<autocpl->maxlen-1; a++) {
- if(truncate[a]!=name[a])
- truncate[a]= 0;
- }
- }
- }
-}
-
-void autocomplete_end(AutoComplete *autocpl, char *autoname)
-{
- if(autocpl->truncate[0])
- BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen);
- else
- BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen);
-
- MEM_freeN(autocpl->truncate);
- MEM_freeN(autocpl);
-}
-
-/* autocomplete callback for ID buttons */
-static void autocomplete_id(char *str, void *arg_v)
-{
- int blocktype= (intptr_t)arg_v;
- ListBase *listb= wich_libbase(G.main, blocktype);
-
- if(listb==NULL) return;
-
- /* search if str matches the beginning of an ID struct */
- if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, 22);
- ID *id;
-
- for(id= listb->first; id; id= id->next)
- autocomplete_do_name(autocpl, id->name+2);
-
- autocomplete_end(autocpl, str);
- }
-}
-
-static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
- return NULL;
- } else {
- return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
- }
-}
-uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-
-uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip);
-
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
-
- ui_check_but(but);
-
- return but;
-}
-static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
- return NULL;
- } else {
- return uiDefIconBut(block, type|BIT|bitIdx, retval, icon, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
- }
-}
-
-uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-
-/* Button containing both string label and icon */
-uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
-
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
-
- but->flag|= UI_ICON_LEFT;
-
- ui_check_but(but);
-
- return but;
-}
-static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
-{
- int bitIdx= findBitIndex(bit);
- if (bitIdx==-1) {
- return NULL;
- } else {
- return uiDefIconTextBut(block, type|BIT|bitIdx, retval, icon, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
- }
-}
-
-uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
-{
- return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
-}
-
-/* END Button containing both string label and icon */
-
-void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, int flag)
-{
- block->minx= minx;
- block->maxx= minx+sizex;
- block->miny= miny;
- block->maxy= miny+sizey;
-
- block->autofill= flag; /* also check for if it has to be done */
-
-}
-
-void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to)
-{
- uiLink *link;
-
- link= but->link= MEM_callocN(sizeof(uiLink), "new uilink");
-
- link->poin= poin;
- link->ppoin= ppoin;
- link->totlink= tot;
- link->fromcode= from;
- link->tocode= to;
-}
-
-/* cruft to make uiBlock and uiBut private */
-
-int uiBlocksGetYMin(ListBase *lb)
-{
- uiBlock *block;
- int min= 0;
-
- for (block= lb->first; block; block= block->next)
- if (block==lb->first || block->miny<min)
- min= block->miny;
-
- return min;
-}
-
-int uiBlockGetCol(uiBlock *block)
-{
- return block->themecol;
-}
-void uiBlockSetCol(uiBlock *block, int col)
-{
- block->themecol= col;
-}
-void uiBlockSetEmboss(uiBlock *block, int emboss)
-{
- block->dt= emboss;
-}
-void uiBlockSetDirection(uiBlock *block, int direction)
-{
- block->direction= direction;
-}
-
-/* this call escapes if there's alignment flags */
-void uiBlockFlipOrder(uiBlock *block)
-{
- ListBase lb;
- uiBut *but, *next;
- float centy, miny=10000, maxy= -10000;
-
-// if(U.uiflag & USER_PLAINMENUS)
-// return;
-
- for(but= block->buttons.first; but; but= but->next) {
- if(but->flag & UI_BUT_ALIGN) return;
- if(but->y1 < miny) miny= but->y1;
- if(but->y2 > maxy) maxy= but->y2;
- }
- /* mirror trick */
- centy= (miny+maxy)/2.0;
- for(but= block->buttons.first; but; but= but->next) {
- but->y1 = centy-(but->y1-centy);
- but->y2 = centy-(but->y2-centy);
- SWAP(float, but->y1, but->y2);
- }
-
- /* also flip order in block itself, for example for arrowkey */
- lb.first= lb.last= NULL;
- but= block->buttons.first;
- while(but) {
- next= but->next;
- BLI_remlink(&block->buttons, but);
- BLI_addtail(&lb, but);
- but= next;
- }
- block->buttons= lb;
-}
-
-
-void uiBlockSetFlag(uiBlock *block, int flag)
-{
- block->flag= flag;
-}
-void uiBlockSetXOfs(uiBlock *block, int xofs)
-{
- block->xofs= xofs;
-}
-void* uiBlockGetCurFont(uiBlock *block)
-{
- return block->curfont;
-}
-
-void uiButSetFlag(uiBut *but, int flag)
-{
- but->flag|= flag;
-}
-void uiButClearFlag(uiBut *but, int flag)
-{
- but->flag&= ~flag;
-}
-
-int uiButGetRetVal(uiBut *but)
-{
- return but->retval;
-}
-
-/* Call this function BEFORE adding buttons to the block */
-void uiBlockSetButmFunc(uiBlock *block, void (*menufunc)(void *arg, int event), void *arg)
-{
- block->butm_func= menufunc;
- block->butm_func_arg= arg;
-}
-
-void uiBlockSetFunc(uiBlock *block, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2)
-{
- block->func= func;
- block->func_arg1= arg1;
- block->func_arg2= arg2;
-}
-
-void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)())
-{
- block->drawextra= func;
-}
-
-void uiButSetFunc(uiBut *but, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2)
-{
- but->func= func;
- but->func_arg1= arg1;
- but->func_arg2= arg2;
-}
-
-void uiButSetCompleteFunc(uiBut *but, void (*func)(char *str, void *arg), void *arg)
-{
- but->autocomplete_func= func;
- but->autofunc_arg= arg;
-}
-
-
-uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, short x1, short y1, short x2, short y2, void *idpp, char *tip)
-{
- uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip);
- but->idpoin_func= func;
- but->idpoin_idpp= (ID**) idpp;
- ui_check_but(but);
-
- if(blocktype)
- uiButSetCompleteFunc(but, autocomplete_id, (void *)(intptr_t)blocktype);
-
- return but;
-}
-
-uiBut *uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip)
-{
- uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->block_func= func;
- ui_check_but(but);
- return but;
-}
-
-uiBut *uiDefPulldownBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip)
-{
- uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
- but->block_func= func;
- ui_check_but(but);
- return but;
-}
-
-/* Block button containing both string label and icon */
-uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip)
-{
- uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
-
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
-
- but->flag|= UI_ICON_LEFT;
- but->flag|= UI_ICON_RIGHT;
-
- but->block_func= func;
- ui_check_but(but);
-
- return but;
-}
-
-/* Block button containing icon */
-uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip)
-{
- uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip);
-
- but->icon= (BIFIconID) icon;
- but->flag|= UI_HAS_ICON;
-
- but->flag|= UI_ICON_LEFT;
- but->flag|= UI_ICON_RIGHT;
-
- but->block_func= func;
- ui_check_but(but);
-
- return but;
-}
-
-void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip)
-{
- uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip);
- ui_check_but(but);
-}
-
-/* ******************** PUPmenu ****************** */
-
-static int pupmenu_set= 0;
-
-void pupmenu_set_active(int val)
-{
- pupmenu_set= val;
-}
-
-/* value== -1 read, otherwise set */
-static int pupmenu_memory(char *str, int value)
-{
- static char mem[256], first=1;
- int val=0, nr=0;
-
- if(first) {
- memset(mem, 0, 256);
- first= 0;
- }
- while(str[nr]) {
- val+= str[nr];
- nr++;
- }
-
- if(value >= 0) mem[ val & 255 ]= value;
- else return mem[ val & 255 ];
-
- return 0;
-}
-
-#define PUP_LABELH 6
-short pupmenu(char *instr)
-{
- uiBlock *block;
- ListBase listb= {NULL, NULL};
- int event;
- short lastselected, width, height=0, mousexmove = 0, mouseymove, xmax, ymax, mval[2], val= -1;
- short a, startx, starty, endx, endy, boxh=TBOXH, x1, y1;
- MenuData *md;
-
- /* block stuff first, need to know the font */
- block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->themecol= TH_MENU_ITEM;
-
- md= decompose_menu_string(instr);
-
- /* size and location, title slightly bigger for bold */
- if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & USER_TR_BUTTONS));
- else width= 0;
- for(a=0; a<md->nitems; a++) {
- char *name= md->items[a].str;
-
- xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & USER_TR_BUTTONS));
- if(xmax>width) width= xmax;
-
- if( strcmp(name, "%l")==0) height+= PUP_LABELH;
- else height+= boxh;
- }
-
- width+= 10;
-
- xmax = G.curscreen->sizex;
- ymax = G.curscreen->sizey;
-
- getmouseco_sc(mval);
-
- /* set first item */
- lastselected= 0;
- if(pupmenu_set) {
- lastselected= pupmenu_set-1;
- pupmenu_set= 0;
- }
- else if(md->nitems>1) {
- lastselected= pupmenu_memory(instr, -1);
- }
-
- startx= mval[0]-(0.8*(width));
- starty= mval[1]-height+boxh/2;
- if(lastselected>=0 && lastselected<md->nitems) {
- for(a=0; a<md->nitems; a++) {
- if(a==lastselected) break;
- if( strcmp(md->items[a].str, "%l")==0) starty+= PUP_LABELH;
- else starty+=boxh;
- }
-
- //starty= mval[1]-height+boxh/2+lastselected*boxh;
- }
-
- mouseymove= 0;
-
- if(startx<10) startx= 10;
- if(starty<10) {
- mouseymove= 10-starty;
- starty= 10;
- }
-
- endx= startx+width;
- endy= starty+height;
- if(endx>xmax) {
- endx= xmax-10;
- startx= endx-width;
- }
- if(endy>ymax-20) {
- mouseymove= ymax-endy-20;
- endy= ymax-20;
- starty= endy-height;
-
- }
-
- if(mouseymove) {
- ui_warp_pointer(mval[0], mouseymove+mval[1]);
- mousexmove= mval[0];
- mouseymove= mval[1];
- }
-
- /* here we go! */
- if(md->title) {
- uiBut *bt;
- char titlestr[256];
- uiSetCurFont(block, UI_HELVB);
-
- if (md->titleicon) {
- width+= 20;
- sprintf(titlestr, " %s", md->title);
- uiDefIconTextBut(block, LABEL, 0, md->titleicon, titlestr, startx, (short)(starty+height), width, boxh, NULL, 0.0, 0.0, 0, 0, "");
- } else {
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+height), width, boxh, NULL, 0.0, 0.0, 0, 0, "");
- bt->flag= UI_TEXT_LEFT;
- }
- uiSetCurFont(block, UI_HELV);
- }
-
- y1= starty + height - boxh;
- x1= startx;
-
- for(a=0; a<md->nitems; a++) {
- char *name= md->items[a].str;
-
- if( strcmp(name, "%l")==0) {
- uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
- y1 -= PUP_LABELH;
- }
- else {
- uiDefButS(block, BUTM, B_NOP, name, x1, y1, width, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= boxh;
- }
- }
-
- uiBoundsBlock(block, 1);
-
- event= uiDoBlocks(&listb, 0, 1);
-
- /* calculate last selected */
- if(event & UI_RETURN_OK) {
- lastselected= 0;
- for(a=0; a<md->nitems; a++) {
- if(val==md->items[a].retval) lastselected= a;
- }
-
- pupmenu_memory(instr, lastselected);
- }
- menudata_free(md);
-
- if(mouseymove && (event & UI_RETURN_OUT)==0) ui_warp_pointer(mousexmove, mouseymove);
- return val;
-}
-
-short pupmenu_col(char *instr, int maxrow)
-{
- uiBlock *block;
- ListBase listb= {NULL, NULL};
- int columns, rows;
- short mousemove[2], mval[2], event;
- int width, height, xmax, ymax, val= -1;
- int a, startx, starty, endx, endy, boxh=TBOXH, x1, y1;
- MenuData *md;
-
- block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->themecol= TH_MENU_ITEM;
-
- md= decompose_menu_string(instr);
-
- /* collumns and row calculation */
- columns= (md->nitems+maxrow)/maxrow;
- if (columns<1) columns= 1;
-
- if(columns > 8) {
- maxrow += 5;
- columns= (md->nitems+maxrow)/maxrow;
- }
-
- rows= (int) md->nitems/columns;
- if (rows<1) rows= 1;
-
- while (rows*columns<(md->nitems+columns) ) rows++;
-
- /* size and location */
- if(md->title) {
- width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & USER_TR_BUTTONS));
- width /= columns;
- }
- else width= 0;
-
- for(a=0; a<md->nitems; a++) {
- xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & USER_TR_BUTTONS));
- if(xmax>width) width= xmax;
- }
-
- width+= 10;
- if (width<50) width=50;
-
- boxh= TBOXH;
-
- height= rows*boxh;
- if (md->title) height+= boxh;
-
- xmax = G.curscreen->sizex;
- ymax = G.curscreen->sizey;
-
- getmouseco_sc(mval);
-
- /* find active item */
-#if 0
- fvalue= ui_get_but_val(but);
- for(a=0; a<md->nitems; a++) {
- if( md->items[a].retval== (int)fvalue ) break;
- }
-#endif
- /* no active item? */
- if(a==md->nitems) {
- if(md->title) a= -1;
- else a= 0;
- }
-
- if(a>0)
- startx = mval[0]-width/2 - ((int)(a)/rows)*width;
- else
- startx= mval[0]-width/2;
- starty = mval[1]-height + boxh/2 + ((a)%rows)*boxh;
-
- if (md->title) starty+= boxh;
-
- mousemove[0]= mousemove[1]= 0;
-
- if(startx<10) {
- mousemove[0]= 10-startx;
- startx= 10;
- }
- if(starty<10) {
- mousemove[1]= 10-starty;
- starty= 10;
- }
-
- endx= startx+width*columns;
- endy= starty+height;
-
- if(endx>xmax) {
- mousemove[0]= xmax-endx-10;
- endx= xmax-10;
- startx= endx-width*columns;
- }
- if(endy>ymax) {
- mousemove[1]= ymax-endy-10;
- endy= ymax-10;
- starty= endy-height;
- }
-
- ui_warp_pointer(mval[0]+mousemove[0], mval[1]+mousemove[1]);
-
- mousemove[0]= mval[0];
- mousemove[1]= mval[1];
-
- /* here we go! */
-
- if(md->title) {
- uiBut *bt;
- uiSetCurFont(block, UI_HELVB);
- bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), columns*(short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, "");
- uiSetCurFont(block, UI_HELV);
- bt->flag= UI_TEXT_LEFT;
- }
-
- for(a=0; a<md->nitems; a++) {
- char *name= md->items[a].str;
-
- int icon = md->items[a].icon;
-
- x1= startx + width*((int)a/rows);
- y1= starty - boxh*(a%rows) + (rows-1)*boxh;
-
- if( strcmp(name, "%l")==0){
- uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, "");
- y1 -= PUP_LABELH;
- }
- else if (icon) {
- uiDefIconButI(block, BUTM, B_NOP, icon, x1, y1, width+16, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= boxh;
- }
- else {
- uiDefButI(block, BUTM, B_NOP, name, x1, y1, width, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, "");
- y1 -= boxh;
- }
- //uiDefButI(block, BUTM, B_NOP, md->items[a].str, x1, y1, (short)(width-(rows>1)), (short)(boxh-1), &val, (float)md->items[a].retval, 0.0, 0, 0, "");
- }
-
- uiBoundsBlock(block, 1);
-
- event= uiDoBlocks(&listb, 0, 1);
-
- menudata_free(md);
-
- if((event & UI_RETURN_OUT)==0) ui_warp_pointer(mousemove[0], mousemove[1]);
-
- return val;
-}
-
diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c
deleted file mode 100644
index 8cb0619835e..00000000000
--- a/source/blender/src/interface_panel.c
+++ /dev/null
@@ -1,1964 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
- a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt
-
- */
-
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-
-#include "BKE_blender.h"
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-
-#include "BIF_drawimage.h"
-#include "BIF_previewrender.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_butspace.h"
-#include "BIF_language.h"
-
-#include "BSE_view.h"
-
-#include "mydevice.h"
-#include "interface.h"
-#include "blendef.h"
-
-// globals
-extern float UIwinmat[4][4];
-
-
-
-/* --------- generic helper drawng calls ---------------- */
-
-
-#define UI_RB_ALPHA 16
-static int roundboxtype= 15;
-
-void uiSetRoundBox(int type)
-{
- /* Not sure the roundbox function is the best place to change this
- * if this is undone, its not that big a deal, only makes curves edges
- * square for the */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
- roundboxtype= 0;
- else
- roundboxtype= type;
-
- /* flags to set which corners will become rounded:
-
- 1------2
- | |
- 8------4
- */
-
-}
-
-void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad)
-{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
- int a;
-
- /* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
- }
-
- glBegin(mode);
-
- /* start with corner right-bottom */
- if(roundboxtype & 4) {
- glVertex2f( maxx-rad, miny);
- for(a=0; a<7; a++) {
- glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]);
- }
- glVertex2f( maxx, miny+rad);
- }
- else glVertex2f( maxx, miny);
-
- /* corner right-top */
- if(roundboxtype & 2) {
- glVertex2f( maxx, maxy-rad);
- for(a=0; a<7; a++) {
- glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]);
- }
- glVertex2f( maxx-rad, maxy);
- }
- else glVertex2f( maxx, maxy);
-
- /* corner left-top */
- if(roundboxtype & 1) {
- glVertex2f( minx+rad, maxy);
- for(a=0; a<7; a++) {
- glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
- }
- glVertex2f( minx, maxy-rad);
- }
- else glVertex2f( minx, maxy);
-
- /* corner left-bottom */
- if(roundboxtype & 8) {
- glVertex2f( minx, miny+rad);
- for(a=0; a<7; a++) {
- glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]);
- }
- glVertex2f( minx+rad, miny);
- }
- else glVertex2f( minx, miny);
-
- glEnd();
-}
-
-static void round_box_shade_col(float *col1, float *col2, float fac)
-{
- float col[3];
-
- col[0]= (fac*col1[0] + (1.0-fac)*col2[0]);
- col[1]= (fac*col1[1] + (1.0-fac)*col2[1]);
- col[2]= (fac*col1[2] + (1.0-fac)*col2[2]);
-
- glColor3fv(col);
-}
-
-/* linear horizontal shade within button or in outline */
-void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
-{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
- float div= maxy-miny;
- float coltop[3], coldown[3], color[4];
- int a;
-
- /* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
- }
- /* get current color, needs to be outside of glBegin/End */
- glGetFloatv(GL_CURRENT_COLOR, color);
-
- /* 'shade' defines strength of shading */
- coltop[0]= color[0]+shadetop; if(coltop[0]>1.0) coltop[0]= 1.0;
- coltop[1]= color[1]+shadetop; if(coltop[1]>1.0) coltop[1]= 1.0;
- coltop[2]= color[2]+shadetop; if(coltop[2]>1.0) coltop[2]= 1.0;
- coldown[0]= color[0]+shadedown; if(coldown[0]<0.0) coldown[0]= 0.0;
- coldown[1]= color[1]+shadedown; if(coldown[1]<0.0) coldown[1]= 0.0;
- coldown[2]= color[2]+shadedown; if(coldown[2]<0.0) coldown[2]= 0.0;
-
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
- glShadeModel(GL_SMOOTH);
- glBegin(mode);
- }
-
- /* start with corner right-bottom */
- if(roundboxtype & 4) {
-
- round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f( maxx-rad, miny);
-
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, vec[a][1]/div);
- glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]);
- }
-
- round_box_shade_col(coltop, coldown, rad/div);
- glVertex2f( maxx, miny+rad);
- }
- else {
- round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f( maxx, miny);
- }
-
- /* corner right-top */
- if(roundboxtype & 2) {
-
- round_box_shade_col(coltop, coldown, (div-rad)/div);
- glVertex2f( maxx, maxy-rad);
-
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])/div);
- glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]);
- }
- round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f( maxx-rad, maxy);
- }
- else {
- round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f( maxx, maxy);
- }
-
- /* corner left-top */
- if(roundboxtype & 1) {
-
- round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f( minx+rad, maxy);
-
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (div-vec[a][1])/div);
- glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
- }
-
- round_box_shade_col(coltop, coldown, (div-rad)/div);
- glVertex2f( minx, maxy-rad);
- }
- else {
- round_box_shade_col(coltop, coldown, 1.0);
- glVertex2f( minx, maxy);
- }
-
- /* corner left-bottom */
- if(roundboxtype & 8) {
-
- round_box_shade_col(coltop, coldown, rad/div);
- glVertex2f( minx, miny+rad);
-
- for(a=0; a<7; a++) {
- round_box_shade_col(coltop, coldown, (rad-vec[a][1])/div);
- glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]);
- }
-
- round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f( minx+rad, miny);
- }
- else {
- round_box_shade_col(coltop, coldown, 0.0);
- glVertex2f( minx, miny);
- }
-
- glEnd();
- glShadeModel(GL_FLAT);
-}
-
-/* only for headers */
-static void gl_round_box_topshade(float minx, float miny, float maxx, float maxy, float rad)
-{
- float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
- char col[7]= {140, 165, 195, 210, 230, 245, 255};
- int a;
- char alpha=255;
-
- if(roundboxtype & UI_RB_ALPHA) alpha= 128;
-
- /* mult */
- for(a=0; a<7; a++) {
- vec[a][0]*= rad; vec[a][1]*= rad;
- }
-
- /* shades from grey->white->grey */
- glBegin(GL_LINE_STRIP);
-
- if(roundboxtype & 3) {
- /* corner right-top */
- glColor4ub(140, 140, 140, alpha);
- glVertex2f( maxx, maxy-rad);
- for(a=0; a<7; a++) {
- glColor4ub(col[a], col[a], col[a], alpha);
- glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]);
- }
- glColor4ub(225, 225, 225, alpha);
- glVertex2f( maxx-rad, maxy);
-
-
- /* corner left-top */
- glVertex2f( minx+rad, maxy);
- for(a=0; a<7; a++) {
- glColor4ub(col[6-a], col[6-a], col[6-a], alpha);
- glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
- }
- glVertex2f( minx, maxy-rad);
- }
- else {
- glColor4ub(225, 225, 225, alpha);
- glVertex2f( minx, maxy);
- glVertex2f( maxx, maxy);
- }
-
- glEnd();
-}
-
-/* for headers and floating panels */
-void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad, int active)
-{
- float color[4];
-
- if(roundboxtype & UI_RB_ALPHA) {
- glGetFloatv(GL_CURRENT_COLOR, color);
- color[3]= 0.5;
- glColor4fv(color);
- glEnable( GL_BLEND );
- }
-
- /* solid part */
- //if(active)
- // gl_round_box_shade(GL_POLYGON, minx, miny, maxx, maxy, rad, 0.10, -0.05);
- // else
- /* shading doesnt work for certain buttons yet (pulldown) need smarter buffer caching (ton) */
- gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad);
-
- /* set antialias line */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
- }
-
- /* top shade */
- gl_round_box_topshade(minx+1, miny+1, maxx-1, maxy-1, rad);
-
- /* total outline */
- if(roundboxtype & UI_RB_ALPHA) glColor4ub(0,0,0, 128); else glColor4ub(0,0,0, 200);
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
-
- glDisable( GL_LINE_SMOOTH );
-
- /* bottom shade for header down */
- if((roundboxtype & 12)==12) {
- glColor4ub(0,0,0, 80);
- fdrawline(minx+rad-1.0, miny+1.0, maxx-rad+1.0, miny+1.0);
- }
- glDisable( GL_BLEND );
-}
-
-
-/* plain antialiased unfilled rectangle */
-void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
-{
- float color[4];
-
- if(roundboxtype & UI_RB_ALPHA) {
- glGetFloatv(GL_CURRENT_COLOR, color);
- color[3]= 0.5;
- glColor4fv(color);
- glEnable( GL_BLEND );
- }
-
- /* set antialias line */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
- }
-
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
-
- glDisable( GL_BLEND );
- glDisable( GL_LINE_SMOOTH );
-}
-
-
-
-/* plain antialiased filled box */
-void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad)
-{
- float color[4];
-
- if(roundboxtype & UI_RB_ALPHA) {
- glGetFloatv(GL_CURRENT_COLOR, color);
- color[3]= 0.5;
- glColor4fv(color);
- glEnable( GL_BLEND );
- }
-
- /* solid part */
- gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad);
-
- /* set antialias line */
- if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
- }
-
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
-
- glDisable( GL_BLEND );
- glDisable( GL_LINE_SMOOTH );
-}
-
-
-/* ************** panels ************* */
-
-static void copy_panel_offset(Panel *pa, Panel *papar)
-{
- /* with respect to sizes... papar is parent */
-
- pa->ofsx= papar->ofsx;
- pa->ofsy= papar->ofsy + papar->sizey-pa->sizey;
-}
-
-
-
-/* global... but will be NULLed after each 'newPanel' call */
-static char *panel_tabbed=NULL, *group_tabbed=NULL;
-
-void uiNewPanelTabbed(char *panelname, char *groupname)
-{
- panel_tabbed= panelname;
- group_tabbed= groupname;
-}
-
-/* another global... */
-static int pnl_control= UI_PNL_TRANSP;
-
-void uiPanelControl(int control)
-{
- pnl_control= control;
-}
-
-/* another global... */
-static int pnl_handler= 0;
-
-void uiSetPanelHandler(int handler)
-{
- pnl_handler= handler;
-}
-
-
-/* ofsx/ofsy only used for new panel definitions */
-/* return 1 if visible (create buttons!) */
-int uiNewPanel(ScrArea *sa, uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey)
-{
- Panel *pa;
-
- /* check if Panel exists, then use that one */
- pa= sa->panels.first;
- while(pa) {
- if( strncmp(pa->panelname, panelname, UI_MAX_NAME_STR)==0) {
- if( strncmp(pa->tabname, tabname, UI_MAX_NAME_STR)==0) {
- break;
- }
- }
- pa= pa->next;
- }
-
- if(pa) {
- /* scale correction */
- if(pa->control & UI_PNL_SCALE);
- else {
- pa->sizex= sizex;
- if(pa->sizey != sizey) {
- pa->ofsy+= (pa->sizey - sizey); // check uiNewPanelHeight()
- pa->sizey= sizey;
- }
- }
- }
- else {
-
- /* new panel */
- pa= MEM_callocN(sizeof(Panel), "new panel");
- BLI_addtail(&sa->panels, pa);
- strncpy(pa->panelname, panelname, UI_MAX_NAME_STR);
- strncpy(pa->tabname, tabname, UI_MAX_NAME_STR);
-
- pa->ofsx= ofsx & ~(PNL_GRID-1);
- pa->ofsy= ofsy & ~(PNL_GRID-1);
- pa->sizex= sizex;
- pa->sizey= sizey;
-
- /* make new Panel tabbed? */
- if(panel_tabbed && group_tabbed) {
- Panel *papar;
- for(papar= sa->panels.first; papar; papar= papar->next) {
- if(papar->active && papar->paneltab==NULL) {
- if( strncmp(panel_tabbed, papar->panelname, UI_MAX_NAME_STR)==0) {
- if( strncmp(group_tabbed, papar->tabname, UI_MAX_NAME_STR)==0) {
- pa->paneltab= papar;
- copy_panel_offset(pa, papar);
- break;
- }
- }
- }
- }
- }
- }
-
- block->panel= pa;
- block->handler= pnl_handler;
- pa->active= 1;
- pa->control= pnl_control;
-
- /* global control over this feature; UI_PNL_TO_MOUSE only called for hotkey panels */
- if(U.uiflag & USER_PANELPINNED);
- else if(pnl_control & UI_PNL_TO_MOUSE) {
- short mval[2];
-
- Mat4CpyMat4(UIwinmat, block->winmat); // can be first event here
- uiGetMouse(block->win, mval);
- pa->ofsx= mval[0]-pa->sizex/2;
- pa->ofsy= mval[1]-pa->sizey/2;
-
- if(pa->flag & PNL_CLOSED) pa->flag &= ~PNL_CLOSED;
- }
-
- if(pnl_control & UI_PNL_UNSTOW) {
- if(pa->flag & PNL_CLOSEDY) {
- pa->flag &= ~PNL_CLOSED;
- }
- }
-
- /* clear ugly globals */
- panel_tabbed= group_tabbed= NULL;
- pnl_handler= 0;
- pnl_control= UI_PNL_TRANSP; // back to default
-
- if(block->panel->paneltab) return 0;
- if(block->panel->flag & PNL_CLOSED) return 0;
-
- /* the 'return 0' above makes this to be in end. otherwise closes panels show wrong title */
- pa->drawname[0]= 0;
-
- return 1;
-}
-
-void uiFreePanels(ListBase *lb)
-{
- Panel *panel;
-
- while( (panel= lb->first) ) {
- BLI_remlink(lb, panel);
- MEM_freeN(panel);
- }
-}
-
-void uiNewPanelHeight(uiBlock *block, int sizey)
-{
- if(sizey<64) sizey= 64;
-
- if(block->panel) {
- block->panel->ofsy+= (block->panel->sizey - sizey);
- block->panel->sizey= sizey;
- }
-}
-
-void uiNewPanelTitle(uiBlock *block, char *str)
-{
- if(block->panel)
- BLI_strncpy(block->panel->drawname, str, UI_MAX_NAME_STR);
-}
-
-static int panel_has_tabs(Panel *panel)
-{
- Panel *pa= curarea->panels.first;
-
- if(panel==NULL) return 0;
-
- while(pa) {
- if(pa->active && pa->paneltab==panel) {
- return 1;
- }
- pa= pa->next;
- }
- return 0;
-}
-
-static void ui_scale_panel_block(uiBlock *block)
-{
- uiBut *but;
- float facx= 1.0, facy= 1.0;
- int centerx= 0, topy=0, tabsy=0;
-
- if(block->panel==NULL) return;
-
- if(block->autofill) ui_autofill(block);
- /* buttons min/max centered, offset calculated */
- uiBoundsBlock(block, 0);
-
- if( block->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) {
- facx= (block->panel->sizex - (2*PNL_SAFETY))/( block->maxx-block->minx );
- }
- else centerx= (block->panel->sizex-( block->maxx-block->minx ) - 2*PNL_SAFETY)/2;
-
- // tabsy= PNL_HEADER*panel_has_tabs(block->panel);
- if( (block->maxy-block->miny) > block->panel->sizey - 2*PNL_SAFETY - tabsy) {
- facy= (block->panel->sizey - (2*PNL_SAFETY) - tabsy)/( block->maxy-block->miny );
- }
- else topy= (block->panel->sizey- 2*PNL_SAFETY - tabsy) - ( block->maxy-block->miny ) ;
-
- but= block->buttons.first;
- while(but) {
- but->x1= PNL_SAFETY+centerx+ facx*(but->x1-block->minx);
- but->y1= PNL_SAFETY+topy + facy*(but->y1-block->miny);
- but->x2= PNL_SAFETY+centerx+ facx*(but->x2-block->minx);
- but->y2= PNL_SAFETY+topy + facy*(but->y2-block->miny);
- if(facx!=1.0) ui_check_but(but); /* for strlen */
- but= but->next;
- }
-
- block->maxx= block->panel->sizex;
- block->maxy= block->panel->sizey;
- block->minx= block->miny= 0.0;
-
-}
-
-// for 'home' key
-void uiSetPanel_view2d(ScrArea *sa)
-{
- Panel *pa;
- float minx=10000, maxx= -10000, miny=10000, maxy= -10000;
- int done=0;
-
- pa= sa->panels.first;
- while(pa) {
- if(pa->active && pa->paneltab==NULL) {
- done= 1;
- if(pa->ofsx < minx) minx= pa->ofsx;
- if(pa->ofsx+pa->sizex > maxx) maxx= pa->ofsx+pa->sizex;
- if(pa->ofsy < miny) miny= pa->ofsy;
- if(pa->ofsy+pa->sizey+PNL_HEADER > maxy) maxy= pa->ofsy+pa->sizey+PNL_HEADER;
- }
- pa= pa->next;
- }
- if(done) {
- G.v2d->tot.xmin= minx-PNL_DIST;
- G.v2d->tot.xmax= maxx+PNL_DIST;
- G.v2d->tot.ymin= miny-PNL_DIST;
- G.v2d->tot.ymax= maxy+PNL_DIST;
- }
- else {
- uiBlock *block;
-
- G.v2d->tot.xmin= 0;
- G.v2d->tot.xmax= 1280;
- G.v2d->tot.ymin= 0;
- G.v2d->tot.ymax= 228;
-
- /* no panels, but old 'loose' buttons, as in old logic editor */
- for(block= sa->uiblocks.first; block; block= block->next) {
- if(block->win==sa->win) {
- if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx;
- if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx;
- if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny;
- if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy;
- }
- }
- }
-
-}
-
-// make sure the panels are not outside 'tot' area
-void uiMatchPanel_view2d(ScrArea *sa)
-{
- Panel *pa;
- int done=0;
-
- pa= sa->panels.first;
- while(pa) {
- if(pa->active && pa->paneltab==NULL) {
- done= 1;
- if(pa->ofsx < G.v2d->tot.xmin) G.v2d->tot.xmin= pa->ofsx;
- if(pa->ofsx+pa->sizex > G.v2d->tot.xmax)
- G.v2d->tot.xmax= pa->ofsx+pa->sizex;
- if(pa->ofsy < G.v2d->tot.ymin) G.v2d->tot.ymin= pa->ofsy;
- if(pa->ofsy+pa->sizey+PNL_HEADER > G.v2d->tot.ymax)
- G.v2d->tot.ymax= pa->ofsy+pa->sizey+PNL_HEADER;
- }
- pa= pa->next;
- }
- if(done==0) {
- uiBlock *block;
- /* no panels, but old 'loose' buttons, as in old logic editor */
- for(block= sa->uiblocks.first; block; block= block->next) {
- if(block->win==sa->win) {
- if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx;
- if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx;
- if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny;
- if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy;
- }
- }
- }
-}
-
-/* extern used by previewrender */
-void uiPanelPush(uiBlock *block)
-{
- glPushMatrix();
- if(block->panel) {
- glTranslatef((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0);
- i_translate((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0, UIwinmat);
- }
-}
-
-void uiPanelPop(uiBlock *block)
-{
- glPopMatrix();
- Mat4CpyMat4(UIwinmat, block->winmat);
-}
-
-uiBlock *uiFindOpenPanelBlockName(ListBase *lb, char *name)
-{
- uiBlock *block;
-
- for(block= lb->first; block; block= block->next) {
- if(block->panel && block->panel->active && block->panel->paneltab==NULL) {
- if(block->panel->flag & PNL_CLOSED);
- else if(strncmp(name, block->panel->panelname, UI_MAX_NAME_STR)==0) break;
- }
- }
- return block;
-}
-
-static void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3)
-{
- // we draw twice, anti polygons not widely supported...
- glBegin(GL_POLYGON);
- glVertex2f(x1, y1);
- glVertex2f(x2, y2);
- glVertex2f(x3, y3);
- glEnd();
-
- /* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
-
- glBegin(GL_LINE_LOOP);
- glVertex2f(x1, y1);
- glVertex2f(x2, y2);
- glVertex2f(x3, y3);
- glEnd();
-
- glDisable( GL_LINE_SMOOTH );
- glDisable( GL_BLEND );
-}
-
-/* triangle 'icon' for panel header */
-void ui_draw_tria_icon(float x, float y, float aspect, char dir)
-{
- if(dir=='h') {
- ui_draw_anti_tria( x, y+1, x, y+10.0, x+8, y+6.25);
- }
- else {
- ui_draw_anti_tria( x-2, y+9, x+8-2, y+9, x+4.25-2, y+1);
- }
-}
-
-void ui_draw_anti_x(float x1, float y1, float x2, float y2)
-{
-
- /* set antialias line */
- glEnable( GL_LINE_SMOOTH );
- glEnable( GL_BLEND );
-
- glLineWidth(2.0);
-
- fdrawline(x1, y1, x2, y2);
- fdrawline(x1, y2, x2, y1);
-
- glLineWidth(1.0);
-
- glDisable( GL_LINE_SMOOTH );
- glDisable( GL_BLEND );
-
-}
-
-/* x 'icon' for panel header */
-static void ui_draw_x_icon(float x, float y)
-{
- BIF_ThemeColor(TH_TEXT_HI);
-
- ui_draw_anti_x( x, y, x+9.375, y+9.375);
-
-}
-
-#if 0
-static void ui_set_panel_pattern(char dir)
-{
- static int firsttime= 1;
- static GLubyte path[4*32], patv[4*32];
- int a,b,i=0;
-
- if(firsttime) {
- firsttime= 0;
- for(a=0; a<128; a++) patv[a]= 0x33;
- for(a=0; a<8; a++) {
- for(b=0; b<4; b++) path[i++]= 0xff; /* 1 scanlines */
- for(b=0; b<12; b++) path[i++]= 0x0; /* 3 lines */
- }
- }
- glEnable(GL_POLYGON_STIPPLE);
- if(dir=='h') glPolygonStipple(path);
- else glPolygonStipple(patv);
-}
-#endif
-
-static char *ui_block_cut_str(uiBlock *block, char *str, short okwidth)
-{
- short width, ofs=strlen(str);
- static char str1[128];
-
- if(ofs>127) return str;
-
- width= block->aspect*BIF_GetStringWidth(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
-
- if(width <= okwidth) return str;
- strcpy(str1, str);
-
- while(width > okwidth && ofs>0) {
- ofs--;
- str1[ofs]= 0;
-
- width= block->aspect*BIF_GetStringWidth(block->curfont, str1, 0);
-
- if(width < 10) break;
- }
- return str1;
-}
-
-
-#define PNL_ICON 20
-#define PNL_DRAGGER 20
-
-
-static void ui_draw_panel_header(uiBlock *block)
-{
- Panel *pa, *panel= block->panel;
- float width;
- int a, nr= 1, pnl_icons;
- char *activename= panel->drawname[0]?panel->drawname:panel->panelname;
- char *panelname, *str;
-
- /* count */
- pa= curarea->panels.first;
- while(pa) {
- if(pa->active) {
- if(pa->paneltab==panel) nr++;
- }
- pa= pa->next;
- }
-
- pnl_icons= PNL_ICON+8;
- if(panel->control & UI_PNL_CLOSE) pnl_icons+= PNL_ICON;
-
- if(nr==1) {
- // full header
- BIF_ThemeColorShade(TH_HEADER, -30);
- uiSetRoundBox(3);
- uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
-
- /* active tab */
- /* draw text label */
- BIF_ThemeColor(TH_TEXT_HI);
- ui_rasterpos_safe(4.0f+block->minx+pnl_icons, block->maxy+5.0f, block->aspect);
- BIF_DrawString(block->curfont, activename, (U.transopts & USER_TR_BUTTONS));
- return;
- }
-
- // tabbed, full header brighter
- //BIF_ThemeColorShade(TH_HEADER, 0);
- //uiSetRoundBox(3);
- //uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
-
- a= 0;
- width= (panel->sizex - 3 - pnl_icons - PNL_ICON)/nr;
- pa= curarea->panels.first;
- while(pa) {
- panelname= pa->drawname[0]?pa->drawname:pa->panelname;
- if(a == 0)
- activename= panelname;
-
- if(pa->active==0);
- else if(pa==panel) {
- /* active tab */
-
- /* draw the active tab */
- uiSetRoundBox(3);
- BIF_ThemeColorShade(TH_HEADER, -3);
- uiRoundBox(2+pnl_icons+a*width, panel->sizey-1, pnl_icons+(a+1)*width, panel->sizey+PNL_HEADER-3, 8);
-
- /* draw the active text label */
- BIF_ThemeColor(TH_TEXT);
- ui_rasterpos_safe(16+pnl_icons+a*width, panel->sizey+4, block->aspect);
- if(panelname != activename && strstr(panelname, activename) == panelname)
- str= ui_block_cut_str(block, panelname+strlen(activename), (short)(width-10));
- else
- str= ui_block_cut_str(block, panelname, (short)(width-10));
- BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
-
- a++;
- }
- else if(pa->paneltab==panel) {
- /* draw an inactive tab */
- uiSetRoundBox(3);
- BIF_ThemeColorShade(TH_HEADER, -60);
- uiRoundBox(2+pnl_icons+a*width, panel->sizey, pnl_icons+(a+1)*width, panel->sizey+PNL_HEADER-3, 8);
-
- /* draw an inactive tab label */
- BIF_ThemeColorShade(TH_TEXT_HI, -40);
- ui_rasterpos_safe(16+pnl_icons+a*width, panel->sizey+4, block->aspect);
- if(panelname != activename && strstr(panelname, activename) == panelname)
- str= ui_block_cut_str(block, panelname+strlen(activename), (short)(width-10));
- else
- str= ui_block_cut_str(block, panelname, (short)(width-10));
- BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS));
-
- a++;
- }
- pa= pa->next;
- }
-
- // dragger
- /*
- uiSetRoundBox(15);
- BIF_ThemeColorShade(TH_HEADER, -70);
- uiRoundBox(panel->sizex-PNL_ICON+5, panel->sizey+5, panel->sizex-5, panel->sizey+PNL_HEADER-5, 5);
- */
-
-}
-
-static void ui_draw_panel_scalewidget(uiBlock *block)
-{
- float xmin, xmax, dx;
- float ymin, ymax, dy;
-
- xmin= block->maxx-PNL_HEADER+2;
- xmax= block->maxx-3;
- ymin= block->miny+3;
- ymax= block->miny+PNL_HEADER-2;
-
- dx= 0.5f*(xmax-xmin);
- dy= 0.5f*(ymax-ymin);
-
- glEnable(GL_BLEND);
- glColor4ub(255, 255, 255, 50);
- fdrawline(xmin, ymin, xmax, ymax);
- fdrawline(xmin+dx, ymin, xmax, ymax-dy);
-
- glColor4ub(0, 0, 0, 50);
- fdrawline(xmin, ymin+block->aspect, xmax, ymax+block->aspect);
- fdrawline(xmin+dx, ymin+block->aspect, xmax, ymax-dy+block->aspect);
- glDisable(GL_BLEND);
-}
-
-void ui_draw_panel(uiBlock *block)
-{
- Panel *panel= block->panel;
- int ofsx;
- char *panelname= panel->drawname[0]?panel->drawname:panel->panelname;
-
- if(panel->paneltab) return;
-
- /* if the panel is minimized vertically:
- * (------)
- */
- if(panel->flag & PNL_CLOSEDY) {
- /* draw a little rounded box, the size of the header */
- uiSetRoundBox(15);
- BIF_ThemeColorShade(TH_HEADER, -30);
- uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
-
- /* title */
- ofsx= PNL_ICON+8;
- if(panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON;
- BIF_ThemeColor(TH_TEXT_HI);
- ui_rasterpos_safe(4+block->minx+ofsx, block->maxy+5, block->aspect);
- BIF_DrawString(block->curfont, panelname, (U.transopts & USER_TR_BUTTONS));
-
- /* border */
- if(panel->flag & PNL_SELECT) {
- BIF_ThemeColorShade(TH_HEADER, -120);
- uiRoundRect(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
- }
- /* if it's being overlapped by a panel being dragged */
- if(panel->flag & PNL_OVERLAP) {
- BIF_ThemeColor(TH_TEXT_HI);
- uiRoundRect(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
- }
-
- }
- /* if the panel is minimized horizontally:
- * /-\
- * |
- * |
- * |
- * \_/
- */
- else if(panel->flag & PNL_CLOSEDX) {
- char str[4];
- int a, end, ofs;
-
- /* draw a little rounded box, the size of the header, rotated 90 deg */
- uiSetRoundBox(15);
- BIF_ThemeColorShade(TH_HEADER, -30);
- uiRoundBox(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8);
-
- /* title, only the initial character for now */
- BIF_ThemeColor(TH_TEXT_HI);
- str[1]= 0;
- end= strlen(panelname);
- ofs= 20;
- for(a=0; a<end; a++) {
- str[0]= panelname[a];
- if( isupper(str[0]) ) {
- ui_rasterpos_safe(block->minx+5, block->maxy-ofs, block->aspect);
- BIF_DrawString(block->curfont, str, 0);
- ofs+= 15;
- }
- }
-
- /* border */
- if(panel->flag & PNL_SELECT) {
- BIF_ThemeColorShade(TH_HEADER, -120);
- uiRoundRect(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8);
- }
- if(panel->flag & PNL_OVERLAP) {
- BIF_ThemeColor(TH_TEXT_HI);
- uiRoundRect(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8);
- }
-
- }
- /* an open panel */
- else {
- /* all panels now... */
- if(panel->control & UI_PNL_SOLID) {
- BIF_ThemeColorShade(TH_HEADER, -30);
-
- uiSetRoundBox(3);
- uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
-
- glEnable(GL_BLEND);
- BIF_ThemeColor4(TH_PANEL);
-
- uiSetRoundBox(12);
- /* bad code... but its late :) */
- if(strcmp(block->name, "image_panel_preview")==0)
- uiRoundRect(block->minx, block->miny, block->maxx, block->maxy, 8);
- else
- uiRoundBox(block->minx, block->miny, block->maxx, block->maxy, 8);
-
- // glRectf(block->minx, block->miny, block->maxx, block->maxy);
-
- /* shadow */
- /*
- glColor4ub(0, 0, 0, 40);
-
- fdrawline(block->minx+2, block->miny-1, block->maxx+1, block->miny-1);
- fdrawline(block->maxx+1, block->miny-1, block->maxx+1, block->maxy+7);
-
- glColor4ub(0, 0, 0, 10);
-
- fdrawline(block->minx+3, block->miny-2, block->maxx+2, block->miny-2);
- fdrawline(block->maxx+2, block->miny-2, block->maxx+2, block->maxy+6);
-
- */
-
- glDisable(GL_BLEND);
- }
- /* floating panel */
- else if(panel->control & UI_PNL_TRANSP) {
- BIF_ThemeColorShade(TH_HEADER, -30);
- uiSetRoundBox(3);
- uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8);
-
- glEnable(GL_BLEND);
- BIF_ThemeColor4(TH_PANEL);
- glRectf(block->minx, block->miny, block->maxx, block->maxy);
-
- glDisable(GL_BLEND);
- }
-
- /* draw the title, tabs, etc in the header */
- ui_draw_panel_header(block);
-
- /* in some occasions, draw a border */
- if(panel->flag & PNL_SELECT) {
- if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15);
- else uiSetRoundBox(3);
-
- BIF_ThemeColorShade(TH_HEADER, -120);
- uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 8);
- }
- if(panel->flag & PNL_OVERLAP) {
- if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15);
- else uiSetRoundBox(3);
-
- BIF_ThemeColor(TH_TEXT_HI);
- uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 8);
- }
-
- if(panel->control & UI_PNL_SCALE)
- ui_draw_panel_scalewidget(block);
-
- /* and a soft shadow-line for now */
- /*
- glEnable( GL_BLEND );
- glColor4ub(0, 0, 0, 50);
- fdrawline(block->maxx, block->miny, block->maxx, block->maxy+PNL_HEADER/2);
- fdrawline(block->minx, block->miny, block->maxx, block->miny);
- glDisable(GL_BLEND);
- */
-
- }
-
- /* draw optional close icon */
-
- ofsx= 6;
- if(panel->control & UI_PNL_CLOSE) {
-
- ui_draw_x_icon(block->minx+2+ofsx, block->maxy+5);
- ofsx= 22;
- }
-
- /* draw collapse icon */
-
- BIF_ThemeColor(TH_TEXT_HI);
-
- if(panel->flag & PNL_CLOSEDY)
- ui_draw_tria_icon(block->minx+6+ofsx, block->maxy+5, block->aspect, 'h');
- else if(panel->flag & PNL_CLOSEDX)
- ui_draw_tria_icon(block->minx+7, block->maxy+2, block->aspect, 'h');
- else
- ui_draw_tria_icon(block->minx+6+ofsx, block->maxy+5, block->aspect, 'v');
-
-
-}
-
-static void ui_redraw_select_panel(ScrArea *sa)
-{
- /* only for beauty, make sure the panel thats moved is on top */
- /* better solution later? */
- uiBlock *block;
-
- for(block= sa->uiblocks.first; block; block= block->next) {
- if(block->panel && (block->panel->flag & PNL_SELECT)) {
- uiDrawBlock(block);
- }
- }
-
-}
-
-
-/* ------------ panel alignment ---------------- */
-
-
-/* this function is needed because uiBlock and Panel itself dont
-change sizey or location when closed */
-static int get_panel_real_ofsy(Panel *pa)
-{
- if(pa->flag & PNL_CLOSEDY) return pa->ofsy+pa->sizey;
- else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDY)) return pa->ofsy+pa->sizey;
- else return pa->ofsy;
-}
-
-static int get_panel_real_ofsx(Panel *pa)
-{
- if(pa->flag & PNL_CLOSEDX) return pa->ofsx+PNL_HEADER;
- else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx+PNL_HEADER;
- else return pa->ofsx+pa->sizex;
-}
-
-
-typedef struct PanelSort {
- Panel *pa, *orig;
-} PanelSort;
-
-/* note about sorting;
- the sortcounter has a lower value for new panels being added.
- however, that only works to insert a single panel, when more new panels get
- added the coordinates of existing panels and the previously stored to-be-insterted
- panels do not match for sorting */
-
-static int find_leftmost_panel(const void *a1, const void *a2)
-{
- const PanelSort *ps1=a1, *ps2=a2;
-
- if( ps1->pa->ofsx > ps2->pa->ofsx) return 1;
- else if( ps1->pa->ofsx < ps2->pa->ofsx) return -1;
- else if( ps1->pa->sortcounter > ps2->pa->sortcounter) return 1;
- else if( ps1->pa->sortcounter < ps2->pa->sortcounter) return -1;
-
- return 0;
-}
-
-
-static int find_highest_panel(const void *a1, const void *a2)
-{
- const PanelSort *ps1=a1, *ps2=a2;
-
- if( ps1->pa->ofsy < ps2->pa->ofsy) return 1;
- else if( ps1->pa->ofsy > ps2->pa->ofsy) return -1;
- else if( ps1->pa->sortcounter > ps2->pa->sortcounter) return 1;
- else if( ps1->pa->sortcounter < ps2->pa->sortcounter) return -1;
-
- return 0;
-}
-
-/* this doesnt draw */
-/* returns 1 when it did something */
-int uiAlignPanelStep(ScrArea *sa, float fac)
-{
- SpaceButs *sbuts= sa->spacedata.first;
- Panel *pa;
- PanelSort *ps, *panelsort, *psnext;
- static int sortcounter= 0;
- int a, tot=0, done;
-
- if(sa->spacetype!=SPACE_BUTS) {
- return 0;
- }
-
- /* count active, not tabbed Panels */
- for(pa= sa->panels.first; pa; pa= pa->next) {
- if(pa->active && pa->paneltab==NULL) tot++;
- }
-
- if(tot==0) return 0;
-
- /* extra; change close direction? */
- for(pa= sa->panels.first; pa; pa= pa->next) {
- if(pa->active && pa->paneltab==NULL) {
- if( (pa->flag & PNL_CLOSEDX) && (sbuts->align==BUT_VERTICAL) )
- pa->flag ^= PNL_CLOSED;
-
- else if( (pa->flag & PNL_CLOSEDY) && (sbuts->align==BUT_HORIZONTAL) )
- pa->flag ^= PNL_CLOSED;
-
- }
- }
-
- panelsort= MEM_callocN( tot*sizeof(PanelSort), "panelsort");
-
- /* fill panelsort array */
- ps= panelsort;
- for(pa= sa->panels.first; pa; pa= pa->next) {
- if(pa->active && pa->paneltab==NULL) {
- ps->pa= MEM_dupallocN(pa);
- ps->orig= pa;
- ps++;
- }
- }
-
- if(sbuts->align==BUT_VERTICAL)
- qsort(panelsort, tot, sizeof(PanelSort), find_highest_panel);
- else
- qsort(panelsort, tot, sizeof(PanelSort), find_leftmost_panel);
-
-
- /* no smart other default start loc! this keeps switching f5/f6/etc compatible */
- ps= panelsort;
- ps->pa->ofsx= 0;
- ps->pa->ofsy= 0;
-
- for(a=0 ; a<tot-1; a++, ps++) {
- psnext= ps+1;
-
- if(sbuts->align==BUT_VERTICAL) {
- psnext->pa->ofsx = ps->pa->ofsx;
- psnext->pa->ofsy = get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-PNL_HEADER-PNL_DIST;
- }
- else {
- psnext->pa->ofsx = get_panel_real_ofsx(ps->pa)+PNL_DIST;
- psnext->pa->ofsy = ps->pa->ofsy + ps->pa->sizey - psnext->pa->sizey;
- }
- }
-
- /* we interpolate */
- done= 0;
- ps= panelsort;
- for(a=0; a<tot; a++, ps++) {
- if( (ps->pa->flag & PNL_SELECT)==0) {
- if( (ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) {
- ps->orig->ofsx= floor(0.5 + fac*ps->pa->ofsx + (1.0-fac)*ps->orig->ofsx);
- ps->orig->ofsy= floor(0.5 + fac*ps->pa->ofsy + (1.0-fac)*ps->orig->ofsy);
- done= 1;
- }
- }
- }
-
- /* copy locations to tabs */
- for(pa= sa->panels.first; pa; pa= pa->next) {
- if(pa->paneltab && pa->active) {
- copy_panel_offset(pa, pa->paneltab);
- }
- }
-
- /* set counter, used for sorting with newly added panels */
- sortcounter++;
- for(pa= sa->panels.first; pa; pa= pa->next) {
- if(pa->active) pa->sortcounter= sortcounter;
- }
-
- /* free panelsort array */
- ps= panelsort;
- for(a=0; a<tot; a++, ps++) {
- MEM_freeN(ps->pa);
- }
- MEM_freeN(panelsort);
-
- return done;
-}
-
-
-static void ui_animate_panels(ScrArea *sa)
-{
- double time=0, ltime;
- float result= 0.0, fac= 0.2;
-
- ltime = PIL_check_seconds_timer();
-
- /* for max 1 second, interpolate positions */
- while(TRUE) {
-
- if( uiAlignPanelStep(sa, fac) ) {
- /* warn: this re-allocs uiblocks! */
- scrarea_do_windraw(curarea);
- ui_redraw_select_panel(curarea);
- screen_swapbuffers();
- }
- else {
- addqueue(curarea->win, REDRAW,1 ); // because 'Animate' is also called as redraw
- break;
- }
-
- if(result >= 1.0) break;
-
- if(result==0.0) { // firsttime
- time = PIL_check_seconds_timer()-ltime;
- if(time > 0.5) fac= 0.7;
- else if(time > 0.2) fac= 0.5;
- else if(time > 0.1) fac= 0.4;
- else if(time > 0.05) fac= 0.3; // 11 steps
- }
-
- result= fac + (1.0-fac)*result;
-
- if(result > 0.98) {
- result= 1.0;
- fac= 1.0;
- }
- }
-}
-
-/* only draws blocks with panels */
-void uiDrawBlocksPanels(ScrArea *sa, int re_align)
-{
- uiBlock *block;
- Panel *panot, *panew, *patest;
-
- /* scaling contents */
- block= sa->uiblocks.first;
- while(block) {
- if(block->panel) ui_scale_panel_block(block);
- block= block->next;
- }
-
- /* consistancy; are panels not made, whilst they have tabs */
- for(panot= sa->panels.first; panot; panot= panot->next) {
- if(panot->active==0) { // not made
-
- for(panew= sa->panels.first; panew; panew= panew->next) {
- if(panew->active) {
- if(panew->paneltab==panot) { // panew is tab in notmade pa
- break;
- }
- }
- }
- /* now panew can become the new parent, check all other tabs */
- if(panew) {
- for(patest= sa->panels.first; patest; patest= patest->next) {
- if(patest->paneltab == panot) {
- patest->paneltab= panew;
- }
- }
- panot->paneltab= panew;
- panew->paneltab= NULL;
- addqueue(sa->win, REDRAW, 1); // the buttons panew were not made
- }
- }
- }
-
- /* re-align */
- if(re_align) uiAlignPanelStep(sa, 1.0);
-
- if(sa->spacetype!=SPACE_BUTS) {
- SpaceLink *sl= sa->spacedata.first;
- for(block= sa->uiblocks.first; block; block= block->next) {
- if(block->panel && block->panel->active && block->panel->paneltab == NULL) {
- float dx=0.0, dy=0.0, minx, miny, maxx, maxy, miny_panel;
-
- minx= sl->blockscale*block->panel->ofsx;
- maxx= sl->blockscale*(block->panel->ofsx+block->panel->sizex);
- miny= sl->blockscale*(block->panel->ofsy+block->panel->sizey);
- maxy= sl->blockscale*(block->panel->ofsy+block->panel->sizey+PNL_HEADER);
- miny_panel= sl->blockscale*(block->panel->ofsy);
-
- /* check to see if snapped panels have been left out in the open by resizing a window
- * and if so, offset them back to where they belong */
- if (block->panel->snap) {
- if (((block->panel->snap) & PNL_SNAP_RIGHT) &&
- (maxx < (float)sa->winx)) {
-
- dx = sa->winx-maxx;
- block->panel->ofsx+= dx/sl->blockscale;
- }
- if (((block->panel->snap) & PNL_SNAP_TOP) &&
- (maxy < (float)sa->winy)) {
-
- dy = sa->winy-maxy;
- block->panel->ofsy+= dy/sl->blockscale;
- }
-
- /* reset these vars with updated panel offset distances */
- minx= sl->blockscale*block->panel->ofsx;
- maxx= sl->blockscale*(block->panel->ofsx+block->panel->sizex);
- miny= sl->blockscale*(block->panel->ofsy+block->panel->sizey);
- maxy= sl->blockscale*(block->panel->ofsy+block->panel->sizey+PNL_HEADER);
- miny_panel= sl->blockscale*(block->panel->ofsy);
- } else
- /* reset to no snapping */
- block->panel->snap = PNL_SNAP_NONE;
-
-
- /* clip panels (headers) for non-butspace situations (maybe make optimized event later) */
-
- /* check left and right edges */
- if (minx < PNL_SNAP_DIST) {
- dx = -minx;
- block->panel->snap |= PNL_SNAP_LEFT;
- }
- else if (maxx > ((float)sa->winx - PNL_SNAP_DIST)) {
- dx= sa->winx-maxx;
- block->panel->snap |= PNL_SNAP_RIGHT;
- }
- if( minx + dx < 0.0) dx= -minx; // when panel cant fit, put it fixed here
-
- /* check top and bottom edges */
- if ((miny_panel < PNL_SNAP_DIST) && (miny_panel > -PNL_SNAP_DIST)) {
- dy= -miny_panel;
- block->panel->snap |= PNL_SNAP_BOTTOM;
- }
- if(miny < PNL_SNAP_DIST) {
- dy= -miny;
- block->panel->snap |= PNL_SNAP_BOTTOM;
- }
- else if(maxy > ((float)sa->winy - PNL_SNAP_DIST)) {
- dy= sa->winy-maxy;
- block->panel->snap |= PNL_SNAP_TOP;
- }
- if( miny + dy < 0.0) dy= -miny; // when panel cant fit, put it fixed here
-
-
- block->panel->ofsx+= dx/sl->blockscale;
- block->panel->ofsy+= dy/sl->blockscale;
-
- /* copy locations */
- for(patest= sa->panels.first; patest; patest= patest->next) {
- if(patest->paneltab==block->panel) copy_panel_offset(patest, block->panel);
- }
-
- }
- }
- }
-
- /* draw */
- block= sa->uiblocks.first;
- while(block) {
- if(block->panel) uiDrawBlock(block);
- block= block->next;
- }
-
-}
-
-
-
-/* ------------ panel merging ---------------- */
-
-static void check_panel_overlap(ScrArea *sa, Panel *panel)
-{
- Panel *pa= sa->panels.first;
-
- /* also called with panel==NULL for clear */
-
- while(pa) {
- pa->flag &= ~PNL_OVERLAP;
- if(panel && (pa != panel)) {
- if(pa->paneltab==NULL && pa->active) {
- float safex= 0.2, safey= 0.2;
-
- if( pa->flag & PNL_CLOSEDX) safex= 0.05;
- else if(pa->flag & PNL_CLOSEDY) safey= 0.05;
- else if( panel->flag & PNL_CLOSEDX) safex= 0.05;
- else if(panel->flag & PNL_CLOSEDY) safey= 0.05;
-
- if( pa->ofsx > panel->ofsx- safex*panel->sizex)
- if( pa->ofsx+pa->sizex < panel->ofsx+ (1.0+safex)*panel->sizex)
- if( pa->ofsy > panel->ofsy- safey*panel->sizey)
- if( pa->ofsy+pa->sizey < panel->ofsy+ (1.0+safey)*panel->sizey)
- pa->flag |= PNL_OVERLAP;
- }
- }
-
- pa= pa->next;
- }
-}
-
-static void test_add_new_tabs(ScrArea *sa)
-{
- Panel *pa, *pasel=NULL, *palap=NULL;
- /* search selected and overlapped panel */
-
- pa= sa->panels.first;
- while(pa) {
- if(pa->active) {
- if(pa->flag & PNL_SELECT) pasel= pa;
- if(pa->flag & PNL_OVERLAP) palap= pa;
- }
- pa= pa->next;
- }
-
- if(pasel && palap==NULL) {
-
- /* copy locations */
- pa= sa->panels.first;
- while(pa) {
- if(pa->paneltab==pasel) {
- copy_panel_offset(pa, pasel);
- }
- pa= pa->next;
- }
- }
-
- if(pasel==NULL || palap==NULL) return;
-
- /* the overlapped panel becomes a tab */
- palap->paneltab= pasel;
-
- /* the selected panel gets coords of overlapped one */
- copy_panel_offset(pasel, palap);
-
- /* and its tabs */
- pa= sa->panels.first;
- while(pa) {
- if(pa->paneltab == pasel) {
- copy_panel_offset(pa, palap);
- }
- pa= pa->next;
- }
-
- /* but, the overlapped panel already can have tabs too! */
- pa= sa->panels.first;
- while(pa) {
- if(pa->paneltab == palap) {
- pa->paneltab = pasel;
- }
- pa= pa->next;
- }
-}
-
-/* ------------ panel drag ---------------- */
-
-
-static void ui_drag_panel(uiBlock *block, int doscale)
-{
- Panel *panel= block->panel;
- short align=0, first=1, dx=0, dy=0, dxo=0, dyo=0, mval[2], mvalo[2];
- short ofsx, ofsy, sizex, sizey;
-
- if(curarea->spacetype==SPACE_BUTS) {
- SpaceButs *sbuts= curarea->spacedata.first;
- align= sbuts->align;
- }
-
- uiGetMouse(block->win, mvalo);
- ofsx= block->panel->ofsx;
- ofsy= block->panel->ofsy;
- sizex= block->panel->sizex;
- sizey= block->panel->sizey;
-
- panel->flag |= PNL_SELECT;
-
- /* exception handling, 3d window preview panel */
- if(block->drawextra==BIF_view3d_previewdraw)
- BIF_view3d_previewrender_clear(curarea);
-
- while(TRUE) {
-
- if( !(get_mbut() & L_MOUSE) ) break;
-
- /* first clip for window, no dragging outside */
- getmouseco_areawin(mval);
- if( mval[0]>0 && mval[0]<curarea->winx && mval[1]>0 && mval[1]<curarea->winy) {
- uiGetMouse(mywinget(), mval);
- dx= (mval[0]-mvalo[0]) & ~(PNL_GRID-1);
- dy= (mval[1]-mvalo[1]) & ~(PNL_GRID-1);
- }
-
- if(dx!=dxo || dy!=dyo || first || align) {
- dxo= dx; dyo= dy;
- first= 0;
-
- if(doscale) {
- panel->sizex = MAX2(sizex+dx, UI_PANEL_MINX);
-
- if(sizey-dy < UI_PANEL_MINY) {
- dy= -UI_PANEL_MINY+sizey;
- }
- panel->sizey = sizey-dy;
-
- panel->ofsy= ofsy+dy;
-
- }
- else {
- /* reset the panel snapping, to allow dragging away from snapped edges */
- panel->snap = PNL_SNAP_NONE;
-
- panel->ofsx = ofsx+dx;
- panel->ofsy = ofsy+dy;
- check_panel_overlap(curarea, panel);
-
- if(align) uiAlignPanelStep(curarea, 0.2);
- }
-
- /* warn: this re-allocs blocks! */
- scrarea_do_windraw(curarea);
- ui_redraw_select_panel(curarea);
- screen_swapbuffers();
-
- /* so, we find the new block */
- block= curarea->uiblocks.first;
- while(block) {
- if(block->panel == panel) break;
- block= block->next;
- }
- // temporal debug
- if(block==NULL) {
- printf("block null while panel drag, should not happen\n");
- }
-
- /* restore */
- Mat4CpyMat4(UIwinmat, block->winmat);
-
- /* idle for align */
- if(dx==dxo && dy==dyo) PIL_sleep_ms(30);
- }
- /* idle for this poor code */
- else PIL_sleep_ms(30);
- }
-
- test_add_new_tabs(curarea); // also copies locations of tabs in dragged panel
-
- panel->flag &= ~PNL_SELECT;
- check_panel_overlap(curarea, NULL); // clears
-
- if(align==0) addqueue(block->win, REDRAW, 1);
- else ui_animate_panels(curarea);
-
- /* exception handling, 3d window preview panel */
- if(block->drawextra==BIF_view3d_previewdraw)
- BIF_view3d_previewrender_signal(curarea, PR_DISPRECT);
- else if(strcmp(block->name, "image_panel_preview")==0)
- image_preview_event(2);
-}
-
-
-static void ui_panel_untab(uiBlock *block)
-{
- Panel *panel= block->panel, *pa, *panew=NULL;
- short nr, mval[2], mvalo[2];
-
- /* while hold mouse, check for movement, then untab */
-
- uiGetMouse(block->win, mvalo);
- while(TRUE) {
-
- if( !(get_mbut() & L_MOUSE) ) break;
- uiGetMouse(mywinget(), mval);
-
- if( abs(mval[0]-mvalo[0]) + abs(mval[1]-mvalo[1]) > 6 ) {
- /* find new parent panel */
- nr= 0;
- pa= curarea->panels.first;
- while(pa) {
- if(pa->paneltab==panel) {
- panew= pa;
- nr++;
- }
- pa= pa->next;
- }
-
- /* make old tabs point to panew */
- if(panew==NULL) printf("panel untab: shouldnt happen\n");
- panew->paneltab= NULL;
-
- pa= curarea->panels.first;
- while(pa) {
- if(pa->paneltab==panel) {
- pa->paneltab= panew;
- }
- pa= pa->next;
- }
-
- ui_drag_panel(block, 0);
- break;
-
- }
- /* idle for this poor code */
- else PIL_sleep_ms(50);
-
- }
-
-}
-
-/* ------------ panel events ---------------- */
-
-
-static void panel_clicked_tabs(uiBlock *block, int mousex)
-{
- Panel *pa, *tabsel=NULL, *panel= block->panel;
- int nr= 1, a, width, ofsx;
-
- ofsx= PNL_ICON;
- if(block->panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON;
-
-
- /* count */
- pa= curarea->panels.first;
- while(pa) {
- if(pa!=panel) {
- if(pa->active && pa->paneltab==panel) nr++;
- }
- pa= pa->next;
- }
-
- if(nr==1) return;
-
- /* find clicked tab, mouse in panel coords */
- a= 0;
- width= (int)((float)(panel->sizex - ofsx-10)/nr);
- pa= curarea->panels.first;
- while(pa) {
- if(pa==panel || (pa->active && pa->paneltab==panel)) {
- if( (mousex > ofsx+a*width) && (mousex < ofsx+(a+1)*width) ) {
- tabsel= pa;
- break;
- }
- a++;
- }
- pa= pa->next;
- }
-
- if(tabsel) {
-
- if(tabsel == panel) {
- ui_panel_untab(block);
- }
- else {
- /* tabsel now becomes parent for all others */
- panel->paneltab= tabsel;
- tabsel->paneltab= NULL;
-
- pa= curarea->panels.first;
- while(pa) {
- if(pa->paneltab == panel) pa->paneltab = tabsel;
- pa= pa->next;
- }
-
- addqueue(curarea->win, REDRAW, 1);
-
- /* panels now differ size.. */
- if(curarea->spacetype==SPACE_BUTS) {
- SpaceButs *sbuts= curarea->spacedata.first;
- if(sbuts->align)
- uiAlignPanelStep(curarea, 1.0);
- }
- }
- }
-
-}
-
-/* disabled /deprecated now, panels minimise in place */
-#if 0
-static void stow_unstow(uiBlock *block)
-{
- SpaceLink *sl= curarea->spacedata.first;
- Panel *pa;
- int ok=0, x, y, width;
-
- if(block->panel->flag & PNL_CLOSEDY) { // flag has been set how it should become!
-
- width= (curarea->winx-320)/sl->blockscale;
- if(width<5) width= 5;
-
- /* find empty spot in bottom */
- for(y=4; y<100; y+= PNL_HEADER+4) {
- for(x=4; x<width; x+= 324) {
- ok= 1;
- /* check overlap with other panels */
- for(pa=curarea->panels.first; pa; pa=pa->next) {
- if(pa!=block->panel && pa->active && pa->paneltab==NULL) {
- if( abs(pa->ofsx-x)<320 ) {
- if( abs(pa->ofsy+pa->sizey-y)<PNL_HEADER+4) ok= 0;
- }
- }
- }
-
- if(ok) break;
- }
- if(ok) break;
- }
- if(ok==0) printf("still primitive code... fix!\n");
-
- block->panel->old_ofsx= block->panel->ofsx;
- block->panel->old_ofsy= block->panel->ofsy;
-
- block->panel->ofsx= x;
- block->panel->ofsy= y-block->panel->sizey;
-
- }
- else {
- block->panel->ofsx= block->panel->old_ofsx;
- block->panel->ofsy= block->panel->old_ofsy;
-
- }
- /* copy locations */
- for(pa= curarea->panels.first; pa; pa= pa->next) {
- if(pa->paneltab==block->panel) copy_panel_offset(pa, block->panel);
- }
-
-}
-#endif
-
-
-/* this function is supposed to call general window drawing too */
-/* also it supposes a block has panel, and isnt a menu */
-void ui_do_panel(uiBlock *block, uiEvent *uevent)
-{
- Panel *pa;
- int align= 0;
-
- if(curarea->spacetype==SPACE_BUTS) {
- SpaceButs *sbuts= curarea->spacedata.first;
- align= sbuts->align;
- }
-
- /* mouse coordinates in panel space! */
-
- if(uevent->event==LEFTMOUSE && block->panel->paneltab==NULL) {
- int button= 0;
-
- /* check open/collapsed button */
- if(block->panel->flag & PNL_CLOSEDX) {
- if(uevent->mval[1] >= block->maxy) button= 1;
- }
- else if(block->panel->control & UI_PNL_CLOSE) {
- if(uevent->mval[0] <= block->minx+PNL_ICON-2) button= 2;
- else if(uevent->mval[0] <= block->minx+2*PNL_ICON+2) button= 1;
- }
- else if(uevent->mval[0] <= block->minx+PNL_ICON+2) {
- button= 1;
- }
-
- if(button) {
-
- if(button==2) { // close
- rem_blockhandler(curarea, block->handler);
- addqueue(curarea->win, REDRAW, 1);
- }
- else { // collapse
-
- if(block->panel->flag & PNL_CLOSED) {
- block->panel->flag &= ~PNL_CLOSED;
- /* snap back up so full panel aligns with screen edge */
- if (block->panel->snap & PNL_SNAP_BOTTOM)
- block->panel->ofsy= 0;
- }
- else if(align==BUT_HORIZONTAL) block->panel->flag |= PNL_CLOSEDX;
- else {
- /* snap down to bottom screen edge*/
- block->panel->flag |= PNL_CLOSEDY;
- if (block->panel->snap & PNL_SNAP_BOTTOM)
- block->panel->ofsy= -block->panel->sizey;
- }
-
- for(pa= curarea->panels.first; pa; pa= pa->next) {
- if(pa->paneltab==block->panel) {
- if(block->panel->flag & PNL_CLOSED) pa->flag |= PNL_CLOSED;
- else pa->flag &= ~PNL_CLOSED;
- }
- }
- }
- if(align==0) addqueue(block->win, REDRAW, 1);
- else ui_animate_panels(curarea);
-
- }
- else if(block->panel->flag & PNL_CLOSED) {
- ui_drag_panel(block, 0);
- }
- /* check if clicked in tabbed area */
- else if(uevent->mval[0] < block->maxx-PNL_ICON-3 && panel_has_tabs(block->panel)) {
- panel_clicked_tabs(block, uevent->mval[0]);
- }
- else {
- ui_drag_panel(block, 0);
- }
- }
-}
-
-/* panel with scaling widget */
-void ui_scale_panel(uiBlock *block)
-{
- if(block->panel->flag & PNL_CLOSED)
- return;
-
- ui_drag_panel(block, 1);
-}
-
-
diff --git a/source/blender/src/keyframing.c b/source/blender/src/keyframing.c
deleted file mode 100644
index d9c729e7df6..00000000000
--- a/source/blender/src/keyframing.c
+++ /dev/null
@@ -1,2104 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2008, Blender Foundation
- * This is a new part of Blender (with some old code)
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "DNA_listBase.h"
-#include "DNA_ID.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_blender.h"
-#include "BKE_main.h"
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_constraint.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_object.h"
-#include "BKE_material.h"
-
-#include "BIF_keyframing.h"
-#include "BIF_butspace.h"
-#include "BIF_editaction.h"
-#include "BIF_editkey.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_poseobject.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_toets.h"
-
-#include "BSE_editipo.h"
-#include "BSE_node.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-#include "blendef.h"
-
-#include "PIL_time.h" /* sleep */
-#include "mydevice.h"
-
-/* ************************************************** */
-/* LOCAL TYPES AND DEFINES */
-
-/* -------------- Keying Sets ------------------- */
-
-/* keying set - a set of channels that will be keyframed together */
-// TODO: move this to a header to allow custom sets someday?
-typedef struct bKeyingSet {
- /* callback func to consider if keyingset should be included
- * (by default, if this is undefined, item will be shown)
- */
- short (*include_cb)(struct bKeyingSet *, const char *);
-
- char name[48]; /* name of keyingset */
- int blocktype; /* blocktype that all channels belong to */ // in future, this may be eliminated
- short flag; /* flags to use when setting keyframes */
-
- short chan_num; /* number of channels to insert keyframe in */
- short adrcodes[32]; /* adrcodes for channels to insert keys for (ideally would be variable-len, but limit of 32 will suffice) */
-} bKeyingSet;
-
-/* keying set context - an array of keying sets and the number of them */
-typedef struct bKeyingContext {
- bKeyingSet *keyingsets; /* array containing the keyingsets of interest */
- bKeyingSet *lastused; /* item that was chosen last time*/
- int tot; /* number of keyingsets in */
-} bKeyingContext;
-
-
-/* ----------- Common KeyData Sources ------------ */
-
-/* temporary struct to gather data combos to keyframe */
-typedef struct bCommonKeySrc {
- struct bCommonKeySrc *next, *prev;
-
- /* general data/destination-source settings */
- ID *id; /* id-block this comes from */
- char *actname; /* name of action channel */
- char *constname; /* name of constraint channel */
-
- /* general destination source settings */
- Ipo *ipo; /* ipo-block that id-block has (optional) */
- bAction *act; /* action-block that id-block has (optional) */
-
- /* pose-level settings */
- bPoseChannel *pchan; /* pose channel */
-
- /* buttons-window settings */
- int map; /* offset to apply to certain adrcodes */
-} bCommonKeySrc;
-
-/* ************************************************** */
-/* KEYFRAME INSERTION */
-
-/* -------------- BezTriple Insertion -------------------- */
-
-/* threshold for inserting keyframes - threshold here should be good enough for now, but should become userpref */
-#define BEZT_INSERT_THRESH 0.00001
-
-/* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_icu)
- * Returns the index to insert at (data already at that index will be offset if replace is 0)
- */
-static int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short *replace)
-{
- int start=0, end=arraylen;
- int loopbreaker= 0, maxloop= arraylen * 2;
-
- /* initialise replace-flag first */
- *replace= 0;
-
- /* sneaky optimisations (don't go through searching process if...):
- * - keyframe to be added is to be added out of current bounds
- * - keyframe to be added would replace one of the existing ones on bounds
- */
- if ((arraylen <= 0) || (array == NULL)) {
- printf("Warning: binarysearch_bezt_index encountered invalid array \n");
- return 0;
- }
- else {
- /* check whether to add before/after/on */
- float framenum;
-
- /* 'First' Keyframe (when only one keyframe, this case is used) */
- framenum= array[0].vec[1][0];
- if (IS_EQT(frame, framenum, BEZT_INSERT_THRESH)) {
- *replace = 1;
- return 0;
- }
- else if (frame < framenum)
- return 0;
-
- /* 'Last' Keyframe */
- framenum= array[(arraylen-1)].vec[1][0];
- if (IS_EQT(frame, framenum, BEZT_INSERT_THRESH)) {
- *replace= 1;
- return (arraylen - 1);
- }
- else if (frame > framenum)
- return arraylen;
- }
-
-
- /* most of the time, this loop is just to find where to put it
- * 'loopbreaker' is just here to prevent infinite loops
- */
- for (loopbreaker=0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) {
- /* compute and get midpoint */
- int mid = (start + end) / 2;
- float midfra= array[mid].vec[1][0];
-
- /* check if exactly equal to midpoint */
- if (IS_EQT(frame, midfra, BEZT_INSERT_THRESH)) {
- *replace = 1;
- return mid;
- }
-
- /* repeat in upper/lower half */
- if (frame > midfra)
- start= mid + 1;
- else if (frame < midfra)
- end= mid - 1;
- }
-
- /* print error if loop-limit exceeded */
- if (loopbreaker == (maxloop-1)) {
- printf("Error: binarysearch_bezt_index was taking too long \n");
-
- // include debug info
- printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);
- }
-
- /* not found, so return where to place it */
- return start;
-}
-
-/* This function adds a given BezTriple to an IPO-Curve. It will allocate
- * memory for the array if needed, and will insert the BezTriple into a
- * suitable place in chronological order.
- *
- * NOTE: any recalculate of the IPO-Curve that needs to be done will need to
- * be done by the caller.
- */
-int insert_bezt_icu (IpoCurve *icu, BezTriple *bezt)
-{
- BezTriple *newb;
- int i= 0;
-
- if (icu->bezt == NULL) {
- icu->bezt= MEM_callocN(sizeof(BezTriple), "beztriple");
- *(icu->bezt)= *bezt;
- icu->totvert= 1;
- }
- else {
- short replace = -1;
- i = binarysearch_bezt_index(icu->bezt, bezt->vec[1][0], icu->totvert, &replace);
-
- if (replace) {
- /* sanity check: 'i' may in rare cases exceed arraylen */
- if ((i >= 0) && (i < icu->totvert))
- *(icu->bezt + i) = *bezt;
- }
- else {
- /* add new */
- newb= MEM_callocN((icu->totvert+1)*sizeof(BezTriple), "beztriple");
-
- /* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */
- if (i > 0)
- memcpy(newb, icu->bezt, i*sizeof(BezTriple));
-
- /* add beztriple to paste at index i */
- *(newb + i)= *bezt;
-
- /* add the beztriples that occur after the beztriple to be pasted (originally in icu) */
- if (i < icu->totvert)
- memcpy(newb+i+1, icu->bezt+i, (icu->totvert-i)*sizeof(BezTriple));
-
- /* replace (+ free) old with new */
- MEM_freeN(icu->bezt);
- icu->bezt= newb;
-
- icu->totvert++;
- }
- }
-
- /* we need to return the index, so that some tools which do post-processing can
- * detect where we added the BezTriple in the array
- */
- return i;
-}
-
-/* This function is a wrapper for insert_bezt_icu, and should be used when
- * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere
- * else yet.
- *
- * 'fast' - is only for the python API where importing BVH's would take an extreamly long time.
- */
-void insert_vert_icu (IpoCurve *icu, float x, float y, short fast)
-{
- BezTriple beztr;
- int a, h1, h2;
-
- /* set all three points, for nicer start position */
- memset(&beztr, 0, sizeof(BezTriple));
- beztr.vec[0][0]= x;
- beztr.vec[0][1]= y;
- beztr.vec[1][0]= x;
- beztr.vec[1][1]= y;
- beztr.vec[2][0]= x;
- beztr.vec[2][1]= y;
- beztr.hide= IPO_BEZ;
- beztr.f1= beztr.f2= beztr.f3= SELECT;
- beztr.h1= beztr.h2= HD_AUTO;
-
- /* add temp beztriple to keyframes */
- a= insert_bezt_icu(icu, &beztr);
- if (!fast) calchandles_ipocurve(icu);
-
- /* set handletype */
- if (icu->totvert > 2) {
- BezTriple *bezt;
-
- h1= h2= HD_AUTO;
- bezt= (icu->bezt + a);
-
- if (a > 0) h1= (bezt-1)->h2;
- if (a < icu->totvert-1) h2= (bezt+1)->h1;
-
- bezt->h1= h1;
- bezt->h2= h2;
-
- if (!fast) calchandles_ipocurve(icu);
- }
-}
-
-/* ------------------- Get Data ------------------------ */
-
-/* Get pointer to use to get values from */
-// FIXME: this should not be possible with Data-API
-static void *get_context_ipo_poin (ID *id, int blocktype, char *actname, char *constname, IpoCurve *icu, int *vartype)
-{
- switch (blocktype) {
- case ID_PO: /* posechannel */
- if (GS(id->name)==ID_OB) {
- Object *ob= (Object *)id;
- bPoseChannel *pchan= get_pose_channel(ob->pose, actname);
-
- if (pchan) {
- *vartype= IPO_FLOAT;
- return get_pchan_ipo_poin(pchan, icu->adrcode);
- }
- }
- break;
-
- case ID_CO: /* constraint */
- if ((GS(id->name)==ID_OB) && (constname && constname[0])) {
- Object *ob= (Object *)id;
- bConstraint *con;
-
- /* assume that we only want the influence (as only used for Constraint Channels) */
- if ((ob->ipoflag & OB_ACTION_OB) && !strcmp(actname, "Object")) {
- for (con= ob->constraints.first; con; con= con->next) {
- if (strcmp(constname, con->name)==0) {
- *vartype= IPO_FLOAT;
- return &con->enforce;
- }
- }
- }
- else if (ob->pose) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, actname);
-
- if (pchan) {
- for (con= pchan->constraints.first; con; con= con->next) {
- if (strcmp(constname, con->name)==0) {
- *vartype= IPO_FLOAT;
- return &con->enforce;
- }
- }
- }
- }
- }
- break;
-
- case ID_OB: /* object */
- /* hack: layer channels for object need to be keyed WITHOUT localview flag...
- * tsk... tsk... why must we just dump bitflags upon users :/
- */
- if ((GS(id->name)==ID_OB) && (icu->adrcode==OB_LAY)) {
- Object *ob= (Object *)id;
- static int layer = 0;
-
- /* init layer to be the object's layer var, then remove local view from it */
- layer = ob->lay;
- layer &= 0xFFFFFF;
- *vartype= IPO_INT_BIT;
-
- /* return pointer to this static var
- * - assumes that this pointer won't be stored for use later, so may not be threadsafe
- * if multiple keyframe calls are made, but that is unlikely to happen in the near future
- */
- return (void *)(&layer);
- }
- /* no break here for other ob channel-types - as they can be done normally */
-
- default: /* normal data-source */
- return get_ipo_poin(id, icu, vartype);
- }
-
- /* not valid... */
- return NULL;
-}
-
-
-/* -------------- 'Smarter' Keyframing Functions -------------------- */
-/* return codes for new_key_needed */
-enum {
- KEYNEEDED_DONTADD = 0,
- KEYNEEDED_JUSTADD,
- KEYNEEDED_DELPREV,
- KEYNEEDED_DELNEXT
-} eKeyNeededStatus;
-
-/* This helper function determines whether a new keyframe is needed */
-/* Cases where keyframes should not be added:
- * 1. Keyframe to be added bewteen two keyframes with similar values
- * 2. Keyframe to be added on frame where two keyframes are already situated
- * 3. Keyframe lies at point that intersects the linear line between two keyframes
- */
-static short new_key_needed (IpoCurve *icu, float cFrame, float nValue)
-{
- BezTriple *bezt=NULL, *prev=NULL;
- int totCount, i;
- float valA = 0.0f, valB = 0.0f;
-
- /* safety checking */
- if (icu == NULL) return KEYNEEDED_JUSTADD;
- totCount= icu->totvert;
- if (totCount == 0) return KEYNEEDED_JUSTADD;
-
- /* loop through checking if any are the same */
- bezt= icu->bezt;
- for (i=0; i<totCount; i++) {
- float prevPosi=0.0f, prevVal=0.0f;
- float beztPosi=0.0f, beztVal=0.0f;
-
- /* get current time+value */
- beztPosi= bezt->vec[1][0];
- beztVal= bezt->vec[1][1];
-
- if (prev) {
- /* there is a keyframe before the one currently being examined */
-
- /* get previous time+value */
- prevPosi= prev->vec[1][0];
- prevVal= prev->vec[1][1];
-
- /* keyframe to be added at point where there are already two similar points? */
- if (IS_EQ(prevPosi, cFrame) && IS_EQ(beztPosi, cFrame) && IS_EQ(beztPosi, prevPosi)) {
- return KEYNEEDED_DONTADD;
- }
-
- /* keyframe between prev+current points ? */
- if ((prevPosi <= cFrame) && (cFrame <= beztPosi)) {
- /* is the value of keyframe to be added the same as keyframes on either side ? */
- if (IS_EQ(prevVal, nValue) && IS_EQ(beztVal, nValue) && IS_EQ(prevVal, beztVal)) {
- return KEYNEEDED_DONTADD;
- }
- else {
- float realVal;
-
- /* get real value of curve at that point */
- realVal= eval_icu(icu, cFrame);
-
- /* compare whether it's the same as proposed */
- if (IS_EQ(realVal, nValue))
- return KEYNEEDED_DONTADD;
- else
- return KEYNEEDED_JUSTADD;
- }
- }
-
- /* new keyframe before prev beztriple? */
- if (cFrame < prevPosi) {
- /* A new keyframe will be added. However, whether the previous beztriple
- * stays around or not depends on whether the values of previous/current
- * beztriples and new keyframe are the same.
- */
- if (IS_EQ(prevVal, nValue) && IS_EQ(beztVal, nValue) && IS_EQ(prevVal, beztVal))
- return KEYNEEDED_DELNEXT;
- else
- return KEYNEEDED_JUSTADD;
- }
- }
- else {
- /* just add a keyframe if there's only one keyframe
- * and the new one occurs before the exisiting one does.
- */
- if ((cFrame < beztPosi) && (totCount==1))
- return KEYNEEDED_JUSTADD;
- }
-
- /* continue. frame to do not yet passed (or other conditions not met) */
- if (i < (totCount-1)) {
- prev= bezt;
- bezt++;
- }
- else
- break;
- }
-
- /* Frame in which to add a new-keyframe occurs after all other keys
- * -> If there are at least two existing keyframes, then if the values of the
- * last two keyframes and the new-keyframe match, the last existing keyframe
- * gets deleted as it is no longer required.
- * -> Otherwise, a keyframe is just added. 1.0 is added so that fake-2nd-to-last
- * keyframe is not equal to last keyframe.
- */
- bezt= (icu->bezt + (icu->totvert - 1));
- valA= bezt->vec[1][1];
-
- if (prev)
- valB= prev->vec[1][1];
- else
- valB= bezt->vec[1][1] + 1.0f;
-
- if (IS_EQ(valA, nValue) && IS_EQ(valA, valB))
- return KEYNEEDED_DELPREV;
- else
- return KEYNEEDED_JUSTADD;
-}
-
-/* ------------------ 'Visual' Keyframing Functions ------------------ */
-
-/* internal status codes for visualkey_can_use */
-enum {
- VISUALKEY_NONE = 0,
- VISUALKEY_LOC,
- VISUALKEY_ROT
-};
-
-/* This helper function determines if visual-keyframing should be used when
- * inserting keyframes for the given channel. As visual-keyframing only works
- * on Object and Pose-Channel blocks, this should only get called for those
- * blocktypes, when using "standard" keying but 'Visual Keying' option in Auto-Keying
- * settings is on.
- */
-static short visualkey_can_use (ID *id, int blocktype, char *actname, char *constname, int adrcode)
-{
- Object *ob= NULL;
- bConstraint *con= NULL;
- short searchtype= VISUALKEY_NONE;
-
- /* validate data */
- if ((id == NULL) || (GS(id->name)!=ID_OB) || !(ELEM(blocktype, ID_OB, ID_PO)))
- return 0;
-
- /* get first constraint and determine type of keyframe constraints to check for*/
- ob= (Object *)id;
-
- if (blocktype == ID_OB) {
- con= ob->constraints.first;
-
- if (ELEM3(adrcode, OB_LOC_X, OB_LOC_Y, OB_LOC_Z))
- searchtype= VISUALKEY_LOC;
- else if (ELEM3(adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z))
- searchtype= VISUALKEY_ROT;
- }
- else if (blocktype == ID_PO) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, actname);
- con= pchan->constraints.first;
-
- if (ELEM3(adrcode, AC_LOC_X, AC_LOC_Y, AC_LOC_Z))
- searchtype= VISUALKEY_LOC;
- else if (ELEM4(adrcode, AC_QUAT_W, AC_QUAT_X, AC_QUAT_Y, AC_QUAT_Z))
- searchtype= VISUALKEY_ROT;
- }
-
- /* only search if a searchtype and initial constraint are available */
- if (searchtype && con) {
- for (; con; con= con->next) {
- /* only consider constraint if it is not disabled, and has influence */
- if (con->flag & CONSTRAINT_DISABLE) continue;
- if (con->enforce == 0.0f) continue;
-
- /* some constraints may alter these transforms */
- switch (con->type) {
- /* multi-transform constraints */
- case CONSTRAINT_TYPE_CHILDOF:
- return 1;
- case CONSTRAINT_TYPE_TRANSFORM:
- return 1;
- case CONSTRAINT_TYPE_FOLLOWPATH:
- return 1;
- case CONSTRAINT_TYPE_KINEMATIC:
- return 1;
-
- /* single-transform constraits */
- case CONSTRAINT_TYPE_TRACKTO:
- if (searchtype==VISUALKEY_ROT) return 1;
- break;
- case CONSTRAINT_TYPE_ROTLIMIT:
- if (searchtype==VISUALKEY_ROT) return 1;
- break;
- case CONSTRAINT_TYPE_LOCLIMIT:
- if (searchtype==VISUALKEY_LOC) return 1;
- break;
- case CONSTRAINT_TYPE_ROTLIKE:
- if (searchtype==VISUALKEY_ROT) return 1;
- break;
- case CONSTRAINT_TYPE_DISTLIMIT:
- if (searchtype==VISUALKEY_LOC) return 1;
- break;
- case CONSTRAINT_TYPE_LOCLIKE:
- if (searchtype==VISUALKEY_LOC) return 1;
- break;
- case CONSTRAINT_TYPE_LOCKTRACK:
- if (searchtype==VISUALKEY_ROT) return 1;
- break;
- case CONSTRAINT_TYPE_MINMAX:
- if (searchtype==VISUALKEY_LOC) return 1;
- break;
-
- default:
- break;
- }
- }
- }
-
- /* when some condition is met, this function returns, so here it can be 0 */
- return 0;
-}
-
-/* This helper function extracts the value to use for visual-keyframing
- * In the event that it is not possible to perform visual keying, try to fall-back
- * to using the poin method. Assumes that all data it has been passed is valid.
- */
-static float visualkey_get_value (ID *id, int blocktype, char *actname, char *constname, int adrcode, IpoCurve *icu)
-{
- Object *ob;
- void *poin = NULL;
- int index, vartype;
-
- /* validate situtation */
- if ((id==NULL) || (GS(id->name)!=ID_OB) || (ELEM(blocktype, ID_OB, ID_PO)==0))
- return 0.0f;
-
- /* get object */
- ob= (Object *)id;
-
- /* only valid for objects or posechannels */
- if (blocktype == ID_OB) {
- /* parented objects are not supported, as the effects of the parent
- * are included in the matrix, which kindof beats the point
- */
- if (ob->parent == NULL) {
- /* only Location or Rotation keyframes are supported now */
- if (ELEM3(adrcode, OB_LOC_X, OB_LOC_Y, OB_LOC_Z)) {
- /* assumes that OB_LOC_Z > OB_LOC_Y > OB_LOC_X */
- index= adrcode - OB_LOC_X;
-
- return ob->obmat[3][index];
- }
- else if (ELEM3(adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) {
- float eul[3];
-
- /* assumes that OB_ROT_Z > OB_ROT_Y > OB_ROT_X */
- index= adrcode - OB_ROT_X;
-
- Mat4ToEul(ob->obmat, eul);
- return eul[index]*(5.72958f);
- }
- }
- }
- else if (blocktype == ID_PO) {
- bPoseChannel *pchan;
- float tmat[4][4];
-
- /* get data to use */
- pchan= get_pose_channel(ob->pose, actname);
-
- /* Although it is not strictly required for this particular space conversion,
- * arg1 must not be null, as there is a null check for the other conversions to
- * be safe. Therefore, the active object is passed here, and in many cases, this
- * will be what owns the pose-channel that is getting this anyway.
- */
- Mat4CpyMat4(tmat, pchan->pose_mat);
- constraint_mat_convertspace(ob, pchan, tmat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL);
-
- /* Loc, Rot/Quat keyframes are supported... */
- if (ELEM3(adrcode, AC_LOC_X, AC_LOC_Y, AC_LOC_Z)) {
- /* assumes that AC_LOC_Z > AC_LOC_Y > AC_LOC_X */
- index= adrcode - AC_LOC_X;
-
- /* only use for non-connected bones */
- if ((pchan->bone->parent) && !(pchan->bone->flag & BONE_CONNECTED))
- return tmat[3][index];
- else if (pchan->bone->parent == NULL)
- return tmat[3][index];
- }
- else if (ELEM4(adrcode, AC_QUAT_W, AC_QUAT_X, AC_QUAT_Y, AC_QUAT_Z)) {
- float trimat[3][3], quat[4];
-
- /* assumes that AC_QUAT_Z > AC_QUAT_Y > AC_QUAT_X > AC_QUAT_W */
- index= adrcode - AC_QUAT_W;
-
- Mat3CpyMat4(trimat, tmat);
- Mat3ToQuat_is_ok(trimat, quat);
-
- return quat[index];
- }
- }
-
- /* as the function hasn't returned yet, try reading from poin */
- poin= get_context_ipo_poin(id, blocktype, actname, constname, icu, &vartype);
- if (poin)
- return read_ipo_poin(poin, vartype);
- else
- return 0.0;
-}
-
-
-/* ------------------------- Insert Key API ------------------------- */
-
-/* Main Keyframing API call:
- * Use this when validation of necessary animation data isn't necessary as it
- * already exists. It will insert a keyframe using the current value being keyframed.
- *
- * The flag argument is used for special settings that alter the behaviour of
- * the keyframe insertion. These include the 'visual' keyframing modes, quick refresh,
- * and extra keyframe filtering.
- */
-short insertkey (ID *id, int blocktype, char *actname, char *constname, int adrcode, short flag)
-{
- IpoCurve *icu;
-
- /* get ipo-curve */
- icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode, 1);
-
- /* only continue if we have an ipo-curve to add keyframe to */
- if (icu) {
- float cfra = frame_to_float(CFRA);
- float curval= 0.0f;
-
- /* apply special time tweaking */
- if (GS(id->name) == ID_OB) {
- Object *ob= (Object *)id;
-
- /* apply NLA-scaling (if applicable) */
- if (actname && actname[0])
- cfra= get_action_frame(ob, cfra);
-
- /* ancient time-offset cruft */
- if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) {
- /* actually frametofloat calc again! */
- cfra-= give_timeoffset(ob)*G.scene->r.framelen;
- }
- }
-
- /* obtain value to give keyframe */
- if ( (flag & INSERTKEY_MATRIX) &&
- (visualkey_can_use(id, blocktype, actname, constname, adrcode)) )
- {
- /* visual-keying is only available for object and pchan datablocks, as
- * it works by keyframing using a value extracted from the final matrix
- * instead of using the kt system to extract a value.
- */
- curval= visualkey_get_value(id, blocktype, actname, constname, adrcode, icu);
- }
- else {
- void *poin;
- int vartype;
-
- /* get pointer to data to read from */
- poin = get_context_ipo_poin(id, blocktype, actname, constname, icu, &vartype);
- if (poin == NULL) {
- printf("Insert Key: No pointer to variable obtained \n");
- return 0;
- }
-
- /* use kt's read_poin function to extract value (kt->read_poin should
- * exist in all cases, but it never hurts to check)
- */
- curval= read_ipo_poin(poin, vartype);
- }
-
- /* only insert keyframes where they are needed */
- if (flag & INSERTKEY_NEEDED) {
- short insert_mode;
-
- /* check whether this curve really needs a new keyframe */
- insert_mode= new_key_needed(icu, cfra, curval);
-
- /* insert new keyframe at current frame */
- if (insert_mode)
- insert_vert_icu(icu, cfra, curval, (flag & INSERTKEY_FAST));
-
- /* delete keyframe immediately before/after newly added */
- switch (insert_mode) {
- case KEYNEEDED_DELPREV:
- delete_icu_key(icu, icu->totvert-2, 1);
- break;
- case KEYNEEDED_DELNEXT:
- delete_icu_key(icu, 1, 1);
- break;
- }
-
- /* only return success if keyframe added */
- if (insert_mode)
- return 1;
- }
- else {
- /* just insert keyframe */
- insert_vert_icu(icu, cfra, curval, (flag & INSERTKEY_FAST));
-
- /* return success */
- return 1;
- }
- }
-
- /* return failure */
- return 0;
-}
-
-
-/* ************************************************** */
-/* KEYFRAME DELETION */
-
-/* Main Keyframing API call:
- * Use this when validation of necessary animation data isn't necessary as it
- * already exists. It will delete a keyframe at the current frame.
- *
- * The flag argument is used for special settings that alter the behaviour of
- * the keyframe deletion. These include the quick refresh options.
- */
-short deletekey (ID *id, int blocktype, char *actname, char *constname, int adrcode, short flag)
-{
- Ipo *ipo;
- IpoCurve *icu;
-
- /* get ipo-curve
- * Note: here is one of the places where we don't want new ipo + ipo-curve added!
- * so 'add' var must be 0
- */
- ipo= verify_ipo(id, blocktype, actname, constname, NULL, 0);
- icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode, 0);
-
- /* only continue if we have an ipo-curve to remove keyframes from */
- if (icu) {
- float cfra = frame_to_float(CFRA);
- short found = -1;
- int i;
-
- /* apply special time tweaking */
- if (GS(id->name) == ID_OB) {
- Object *ob= (Object *)id;
-
- /* apply NLA-scaling (if applicable) */
- if (actname && actname[0])
- cfra= get_action_frame(ob, cfra);
-
- /* ancient time-offset cruft */
- if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) {
- /* actually frametofloat calc again! */
- cfra-= give_timeoffset(ob)*G.scene->r.framelen;
- }
- }
-
- /* try to find index of beztriple to get rid of */
- i = binarysearch_bezt_index(icu->bezt, cfra, icu->totvert, &found);
- if (found) {
- /* delete the key at the index (will sanity check + do recalc afterwards ) */
- delete_icu_key(icu, i, 1);
-
- /* Only delete curve too if there isn't an ipo-driver still hanging around on an empty curve */
- if (icu->totvert==0 && icu->driver==NULL) {
- BLI_remlink(&ipo->curve, icu);
- free_ipo_curve(icu);
- }
-
- /* return success */
- return 1;
- }
- }
-
- /* return failure */
- return 0;
-}
-
-/* ************************************************** */
-/* COMMON KEYFRAME MANAGEMENT (common_insertkey/deletekey) */
-
-/* mode for common_modifykey */
-enum {
- COMMONKEY_MODE_INSERT = 0,
- COMMONKEY_MODE_DELETE,
-} eCommonModifyKey_Modes;
-
-/* ------------- KeyingSet Defines ------------ */
-/* Note: these must all be named with the defks_* prefix, otherwise the template macro will not work! */
-
-/* macro for defining keyingset contexts */
-#define KSC_TEMPLATE(ctx_name) {&defks_##ctx_name[0], NULL, sizeof(defks_##ctx_name)/sizeof(bKeyingSet)}
-
-/* --- */
-
-/* check if option not available for deleting keys */
-static short incl_non_del_keys (bKeyingSet *ks, const char mode[])
-{
- /* as optimisation, assume that it is sufficient to check only first letter
- * of mode (int comparison should be faster than string!)
- */
- //if (strcmp(mode, "Delete")==0)
- if (mode && mode[0]=='D')
- return 0;
-
- return 1;
-}
-
-/* Object KeyingSets ------ */
-
-/* check if include shapekey entry */
-static short incl_v3d_ob_shapekey (bKeyingSet *ks, const char mode[])
-{
- Object *ob= (G.obedit)? (G.obedit) : (OBACT);
- char *newname= NULL;
-
- if(ob==NULL)
- return 0;
-
- /* not available for delete mode */
- if (strcmp(mode, "Delete")==0)
- return 0;
-
- /* check if is geom object that can get shapekeys */
- switch (ob->type) {
- /* geometry? */
- case OB_MESH: newname= "Mesh"; break;
- case OB_CURVE: newname= "Curve"; break;
- case OB_SURF: newname= "Surface"; break;
- case OB_LATTICE: newname= "Lattice"; break;
-
- /* not geometry! */
- default:
- return 0;
- }
-
- /* if ks is shapekey entry (this could be callled for separator before too!) */
- if (ks->flag == -3)
- sprintf(ks->name, newname);
-
- /* if it gets here, it's ok */
- return 1;
-}
-
-/* array for object keyingset defines */
-bKeyingSet defks_v3d_object[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "Loc", ID_OB, 0, 3, {OB_LOC_X,OB_LOC_Y,OB_LOC_Z}},
- {NULL, "Rot", ID_OB, 0, 3, {OB_ROT_X,OB_ROT_Y,OB_ROT_Z}},
- {NULL, "Scale", ID_OB, 0, 3, {OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "LocRot", ID_OB, 0, 6,
- {OB_LOC_X,OB_LOC_Y,OB_LOC_Z,
- OB_ROT_X,OB_ROT_Y,OB_ROT_Z}},
-
- {NULL, "LocScale", ID_OB, 0, 6,
- {OB_LOC_X,OB_LOC_Y,OB_LOC_Z,
- OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}},
-
- {NULL, "LocRotScale", ID_OB, 0, 9,
- {OB_LOC_X,OB_LOC_Y,OB_LOC_Z,
- OB_ROT_X,OB_ROT_Y,OB_ROT_Z,
- OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}},
-
- {NULL, "RotScale", ID_OB, 0, 6,
- {OB_ROT_X,OB_ROT_Y,OB_ROT_Z,
- OB_SIZE_X,OB_SIZE_Y,OB_SIZE_Z}},
-
- {incl_non_del_keys, "%l", 0, -1, 0, {0}}, // separator
-
- {incl_non_del_keys, "VisualLoc", ID_OB, INSERTKEY_MATRIX, 3, {OB_LOC_X,OB_LOC_Y,OB_LOC_Z}},
- {incl_non_del_keys, "VisualRot", ID_OB, INSERTKEY_MATRIX, 3, {OB_ROT_X,OB_ROT_Y,OB_ROT_Z}},
-
- {incl_non_del_keys, "VisualLocRot", ID_OB, INSERTKEY_MATRIX, 6,
- {OB_LOC_X,OB_LOC_Y,OB_LOC_Z,
- OB_ROT_X,OB_ROT_Y,OB_ROT_Z}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Layer", ID_OB, 0, 1, {OB_LAY}}, // icky option...
- {NULL, "Available", ID_OB, -2, 0, {0}},
-
- {incl_v3d_ob_shapekey, "%l%l", 0, -1, 0, {0}}, // separator (linked to shapekey entry)
- {incl_v3d_ob_shapekey, "<ShapeKey>", ID_OB, -3, 0, {0}}
-};
-
-/* PoseChannel KeyingSets ------ */
-
-/* array for posechannel keyingset defines */
-bKeyingSet defks_v3d_pchan[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "Loc", ID_PO, 0, 3, {AC_LOC_X,AC_LOC_Y,AC_LOC_Z}},
- {NULL, "Rot", ID_PO, 0, 4, {AC_QUAT_W,AC_QUAT_X,AC_QUAT_Y,AC_QUAT_Z}},
- {NULL, "Scale", ID_PO, 0, 3, {AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "LocRot", ID_PO, 0, 7,
- {AC_LOC_X,AC_LOC_Y,AC_LOC_Z,AC_QUAT_W,
- AC_QUAT_X,AC_QUAT_Y,AC_QUAT_Z}},
-
- {NULL, "LocScale", ID_PO, 0, 6,
- {AC_LOC_X,AC_LOC_Y,AC_LOC_Z,
- AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}},
-
- {NULL, "LocRotScale", ID_PO, 0, 10,
- {AC_LOC_X,AC_LOC_Y,AC_LOC_Z,AC_QUAT_W,AC_QUAT_X,
- AC_QUAT_Y,AC_QUAT_Z,AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}},
-
- {NULL, "RotScale", ID_PO, 0, 7,
- {AC_QUAT_W,AC_QUAT_X,AC_QUAT_Y,AC_QUAT_Z,
- AC_SIZE_X,AC_SIZE_Y,AC_SIZE_Z}},
-
- {incl_non_del_keys, "%l", 0, -1, 0, {0}}, // separator
-
- {incl_non_del_keys, "VisualLoc", ID_PO, INSERTKEY_MATRIX, 3, {AC_LOC_X,AC_LOC_Y,AC_LOC_Z}},
- {incl_non_del_keys, "VisualRot", ID_PO, INSERTKEY_MATRIX, 4, {AC_QUAT_W,AC_QUAT_X,AC_QUAT_Y,AC_QUAT_Z}},
-
- {incl_non_del_keys, "VisualLocRot", ID_PO, INSERTKEY_MATRIX, 7,
- {AC_LOC_X,AC_LOC_Y,AC_LOC_Z,AC_QUAT_W,
- AC_QUAT_X,AC_QUAT_Y,AC_QUAT_Z}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_PO, -2, 0, {0}}
-};
-
-/* Material KeyingSets ------ */
-
-/* array for material keyingset defines */
-bKeyingSet defks_buts_shading_mat[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "RGB", ID_MA, 0, 3, {MA_COL_R,MA_COL_G,MA_COL_B}},
- {NULL, "Alpha", ID_MA, 0, 1, {MA_ALPHA}},
- {NULL, "Halo Size", ID_MA, 0, 1, {MA_HASIZE}},
- {NULL, "Mode", ID_MA, 0, 1, {MA_MODE}}, // evil bitflags
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "All Color", ID_MA, 0, 18,
- {MA_COL_R,MA_COL_G,MA_COL_B,
- MA_ALPHA,MA_HASIZE, MA_MODE,
- MA_SPEC_R,MA_SPEC_G,MA_SPEC_B,
- MA_REF,MA_EMIT,MA_AMB,MA_SPEC,MA_HARD,
- MA_MODE,MA_TRANSLU,MA_ADD}},
-
- {NULL, "All Mirror", ID_MA, 0, 5,
- {MA_RAYM,MA_FRESMIR,MA_FRESMIRI,
- MA_FRESTRA,MA_FRESTRAI}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Ofs", ID_MA, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}},
- {NULL, "Size", ID_MA, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}},
-
- {NULL, "All Mapping", ID_MA, COMMONKEY_ADDMAP, 14,
- {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z,
- MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z,
- MAP_R,MAP_G,MAP_B,MAP_DVAR,
- MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_MA, -2, 0, {0}}
-};
-
-/* World KeyingSets ------ */
-
-/* array for world keyingset defines */
-bKeyingSet defks_buts_shading_wo[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "Zenith RGB", ID_WO, 0, 3, {WO_ZEN_R,WO_ZEN_G,WO_ZEN_B}},
- {NULL, "Horizon RGB", ID_WO, 0, 3, {WO_HOR_R,WO_HOR_G,WO_HOR_B}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Mist", ID_WO, 0, 4, {WO_MISI,WO_MISTDI,WO_MISTSTA,WO_MISTHI}},
- {NULL, "Stars", ID_WO, 0, 5, {WO_STAR_R,WO_STAR_G,WO_STAR_B,WO_STARDIST,WO_STARSIZE}},
-
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Ofs", ID_WO, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}},
- {NULL, "Size", ID_WO, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}},
-
- {NULL, "All Mapping", ID_WO, COMMONKEY_ADDMAP, 14,
- {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z,
- MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z,
- MAP_R,MAP_G,MAP_B,MAP_DVAR,
- MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_WO, -2, 0, {0}}
-};
-
-/* Lamp KeyingSets ------ */
-
-/* array for lamp keyingset defines */
-bKeyingSet defks_buts_shading_la[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "RGB", ID_LA, 0, 3, {LA_COL_R,LA_COL_G,LA_COL_B}},
- {NULL, "Energy", ID_LA, 0, 1, {LA_ENERGY}},
- {NULL, "Spot Size", ID_LA, 0, 1, {LA_SPOTSI}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Ofs", ID_LA, COMMONKEY_ADDMAP, 3, {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z}},
- {NULL, "Size", ID_LA, COMMONKEY_ADDMAP, 3, {MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z}},
-
- {NULL, "All Mapping", ID_LA, COMMONKEY_ADDMAP, 14,
- {MAP_OFS_X,MAP_OFS_Y,MAP_OFS_Z,
- MAP_SIZE_X,MAP_SIZE_Y,MAP_SIZE_Z,
- MAP_R,MAP_G,MAP_B,MAP_DVAR,
- MAP_COLF,MAP_NORF,MAP_VARF,MAP_DISP}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_LA, -2, 0, {0}}
-};
-
-/* Texture KeyingSets ------ */
-
-/* array for texture keyingset defines */
-bKeyingSet defks_buts_shading_tex[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "Clouds", ID_TE, 0, 5,
- {TE_NSIZE,TE_NDEPTH,TE_NTYPE,
- TE_MG_TYP,TE_N_BAS1}},
-
- {NULL, "Marble", ID_TE, 0, 7,
- {TE_NSIZE,TE_NDEPTH,TE_NTYPE,
- TE_TURB,TE_MG_TYP,TE_N_BAS1,TE_N_BAS2}},
-
- {NULL, "Stucci", ID_TE, 0, 5,
- {TE_NSIZE,TE_NTYPE,TE_TURB,
- TE_MG_TYP,TE_N_BAS1}},
-
- {NULL, "Wood", ID_TE, 0, 6,
- {TE_NSIZE,TE_NTYPE,TE_TURB,
- TE_MG_TYP,TE_N_BAS1,TE_N_BAS2}},
-
- {NULL, "Magic", ID_TE, 0, 2, {TE_NDEPTH,TE_TURB}},
-
- {NULL, "Blend", ID_TE, 0, 1, {TE_MG_TYP}},
-
- {NULL, "Musgrave", ID_TE, 0, 6,
- {TE_MG_TYP,TE_MGH,TE_MG_LAC,
- TE_MG_OCT,TE_MG_OFF,TE_MG_GAIN}},
-
- {NULL, "Voronoi", ID_TE, 0, 9,
- {TE_VNW1,TE_VNW2,TE_VNW3,TE_VNW4,
- TE_VNMEXP,TE_VN_DISTM,TE_VN_COLT,
- TE_ISCA,TE_NSIZE}},
-
- {NULL, "Distorted Noise", ID_TE, 0, 4,
- {TE_MG_OCT,TE_MG_OFF,TE_MG_GAIN,TE_DISTA}},
-
- {NULL, "Color Filter", ID_TE, 0, 5,
- {TE_COL_R,TE_COL_G,TE_COL_B,TE_BRIGHT,TE_CONTRA}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_TE, -2, 0, {0}}
-};
-
-/* Object Buttons KeyingSets ------ */
-
-/* check if include particles entry */
-static short incl_buts_ob (bKeyingSet *ks, const char mode[])
-{
- Object *ob= OBACT;
- /* only if object is mesh type */
-
- if(ob==NULL) return 0;
- return (ob->type == OB_MESH);
-}
-
-/* array for texture keyingset defines */
-bKeyingSet defks_buts_object[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {incl_buts_ob, "Surface Damping", ID_OB, 0, 1, {OB_PD_SDAMP}},
- {incl_buts_ob, "Random Damping", ID_OB, 0, 1, {OB_PD_RDAMP}},
- {incl_buts_ob, "Permeability", ID_OB, 0, 1, {OB_PD_PERM}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Force Strength", ID_OB, 0, 1, {OB_PD_FSTR}},
- {NULL, "Force Falloff", ID_OB, 0, 1, {OB_PD_FFALL}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_OB, -2, 0, {0}} // this will include ob-transforms too!
-};
-
-/* Camera Buttons KeyingSets ------ */
-
-/* check if include internal-renderer entry */
-static short incl_buts_cam1 (bKeyingSet *ks, const char mode[])
-{
- /* only if renderer is internal renderer */
- return (G.scene->r.renderer==R_INTERN);
-}
-
-/* check if include external-renderer entry */
-static short incl_buts_cam2 (bKeyingSet *ks, const char mode[])
-{
- /* only if renderer is internal renderer */
- return (G.scene->r.renderer!=R_INTERN);
-}
-
-/* array for camera keyingset defines */
-bKeyingSet defks_buts_cam[] =
-{
- /* include_cb, name, blocktype, flag, chan_num, adrcodes */
- {NULL, "Lens", ID_CA, 0, 1, {CAM_LENS}},
- {NULL, "Clipping", ID_CA, 0, 2, {CAM_STA,CAM_END}},
- {NULL, "Focal Distance", ID_CA, 0, 1, {CAM_YF_FDIST}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
-
- {incl_buts_cam2, "Aperture", ID_CA, 0, 1, {CAM_YF_APERT}},
- {incl_buts_cam1, "Viewplane Shift", ID_CA, 0, 2, {CAM_SHIFT_X,CAM_SHIFT_Y}},
-
- {NULL, "%l", 0, -1, 0, {0}}, // separator
-
- {NULL, "Available", ID_CA, -2, 0, {0}}
-};
-
-/* --- */
-
-/* Keying Context Defines - Must keep in sync with enumeration (eKS_Contexts) */
-bKeyingContext ks_contexts[] =
-{
- KSC_TEMPLATE(v3d_object),
- KSC_TEMPLATE(v3d_pchan),
-
- KSC_TEMPLATE(buts_shading_mat),
- KSC_TEMPLATE(buts_shading_wo),
- KSC_TEMPLATE(buts_shading_la),
- KSC_TEMPLATE(buts_shading_tex),
-
- KSC_TEMPLATE(buts_object),
- KSC_TEMPLATE(buts_cam)
-};
-
-/* Keying Context Enumeration - Must keep in sync with definitions*/
-typedef enum eKS_Contexts {
- KSC_V3D_OBJECT = 0,
- KSC_V3D_PCHAN,
-
- KSC_BUTS_MAT,
- KSC_BUTS_WO,
- KSC_BUTS_LA,
- KSC_BUTS_TEX,
-
- KSC_BUTS_OB,
- KSC_BUTS_CAM,
-
- /* make sure this last one remains untouched! */
- KSC_TOT_TYPES
-} eKS_Contexts;
-
-
-/* ---------------- KeyingSet Tools ------------------- */
-
-/* helper for commonkey_context_get() - get keyingsets for 3d-view */
-static void commonkey_context_getv3d (ListBase *sources, bKeyingContext **ksc)
-{
- Object *ob;
- IpoCurve *icu;
-
- if ((OBACT) && (OBACT->flag & OB_POSEMODE)) {
- bPoseChannel *pchan;
-
- /* pose-level */
- ob= OBACT;
- *ksc= &ks_contexts[KSC_V3D_PCHAN];
- set_pose_keys(ob); /* sets pchan->flag to POSE_KEY if bone selected, and clears if not */
-
- /* loop through posechannels */
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- if (pchan->flag & POSE_KEY) {
- bCommonKeySrc *cks;
-
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set id-block to key to, and action */
- cks->id= (ID *)ob;
- cks->act= ob->action;
-
- /* set pchan */
- cks->pchan= pchan;
- cks->actname= pchan->name;
- }
- }
- }
- else {
- Base *base;
-
- /* object-level */
- *ksc= &ks_contexts[KSC_V3D_OBJECT];
-
- /* loop through bases */
- for (base= FIRSTBASE; base; base= base->next) {
- if (TESTBASELIB(base)) {
- bCommonKeySrc *cks;
-
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set id-block to key to */
- ob= base->object;
- cks->id= (ID *)ob;
-
- /* when ob's keyframes are in an action, default to using 'Object' as achan name */
- if (ob->ipoflag & OB_ACTION_OB)
- cks->actname= "Object";
-
- /* set ipo-flags */
- // TODO: add checks for lib-linked data
- if ((ob->ipo) || (ob->action)) {
- if (ob->ipo) {
- cks->ipo= ob->ipo;
- }
- else {
- bActionChannel *achan;
-
- cks->act= ob->action;
- achan= get_action_channel(ob->action, cks->actname);
-
- if (achan && achan->ipo)
- cks->ipo= achan->ipo;
- }
- /* cks->ipo can be NULL while editing */
- if(cks->ipo) {
- /* deselect all ipo-curves */
- for (icu= cks->ipo->curve.first; icu; icu= icu->next) {
- icu->flag &= ~IPO_SELECT;
- }
- }
- }
- }
- }
- }
-}
-
-/* helper for commonkey_context_get() - get keyingsets for buttons window */
-static void commonkey_context_getsbuts (ListBase *sources, bKeyingContext **ksc)
-{
- bCommonKeySrc *cks;
-
- /* check on tab-type */
- switch (G.buts->mainb) {
- case CONTEXT_SHADING: /* ------------- Shading buttons ---------------- */
- /* subtabs include "Material", "Texture", "Lamp", "World"*/
- switch (G.buts->tab[CONTEXT_SHADING]) {
- case TAB_SHADING_MAT: /* >------------- Material Tab -------------< */
- {
- Material *ma= editnode_get_active_material(G.buts->lockpoin);
-
- if (ma) {
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set data */
- cks->id= (ID *)ma;
- cks->ipo= ma->ipo;
- cks->map= texchannel_to_adrcode(ma->texact);
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_MAT];
- return;
- }
- }
- break;
- case TAB_SHADING_WORLD: /* >------------- World Tab -------------< */
- {
- World *wo= G.buts->lockpoin;
-
- if (wo) {
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set data */
- cks->id= (ID *)wo;
- cks->ipo= wo->ipo;
- cks->map= texchannel_to_adrcode(wo->texact);
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_WO];
- return;
- }
- }
- break;
- case TAB_SHADING_LAMP: /* >------------- Lamp Tab -------------< */
- {
- Lamp *la= G.buts->lockpoin;
-
- if (la) {
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set data */
- cks->id= (ID *)la;
- cks->ipo= la->ipo;
- cks->map= texchannel_to_adrcode(la->texact);
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_LA];
- return;
- }
- }
- break;
- case TAB_SHADING_TEX: /* >------------- Texture Tab -------------< */
- {
- Tex *tex= G.buts->lockpoin;
-
- if (tex) {
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set data */
- cks->id= (ID *)tex;
- cks->ipo= tex->ipo;
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_TEX];
- return;
- }
- }
- break;
- }
- break;
-
- case CONTEXT_OBJECT: /* ------------- Object buttons ---------------- */
- {
- Object *ob= OBACT;
-
- if (ob) {
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set id-block to key to */
- cks->id= (ID *)ob;
- cks->ipo= ob->ipo;
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_OB];
- return;
- }
- }
- break;
-
- case CONTEXT_EDITING: /* ------------- Editing buttons ---------------- */
- {
- Object *ob= OBACT;
-
- if ((ob) && (ob->type==OB_CAMERA) && (G.buts->lockpoin)) { /* >---------------- camera buttons ---------------< */
- Camera *ca= G.buts->lockpoin;
-
- /* add new keyframing destination */
- cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");
- BLI_addtail(sources, cks);
-
- /* set id-block to key to */
- cks->id= (ID *)ca;
- cks->ipo= ca->ipo;
-
- /* set keyingsets */
- *ksc= &ks_contexts[KSC_BUTS_CAM];
- return;
- }
- }
- break;
- }
-
- /* if nothing happened... */
- *ksc= NULL;
-}
-
-
-/* get keyingsets for appropriate context */
-static void commonkey_context_get (ScrArea *sa, short mode, ListBase *sources, bKeyingContext **ksc)
-{
- /* check view type */
- switch (sa->spacetype) {
- /* 3d view - first one tested as most often used */
- case SPACE_VIEW3D:
- {
- commonkey_context_getv3d(sources, ksc);
- }
- break;
-
- /* buttons view */
- case SPACE_BUTS:
- {
- commonkey_context_getsbuts(sources, ksc);
- }
- break;
-
- /* spaces with their own methods */
- case SPACE_IPO:
- if (mode == COMMONKEY_MODE_INSERT)
- insertkey_editipo();
- return;
- case SPACE_ACTION:
- if (mode == COMMONKEY_MODE_INSERT)
- insertkey_action();
- return;
-
- /* timeline view - keyframe buttons */
- case SPACE_TIME:
- {
- ScrArea *sab;
- int bigarea= 0;
-
- /* try to find largest 3d-view available
- * (mostly of the time, this is what when user will want this,
- * as it's a standard feature in all other apps)
- */
- sab= find_biggest_area_of_type(SPACE_VIEW3D);
- if (sab) {
- commonkey_context_getv3d(sources, ksc);
- return;
- }
-
- /* if not found, sab is now NULL, so perform own biggest area test */
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- int area= sa->winx * sa->winy;
-
- if (sa->spacetype != SPACE_TIME) {
- if ( (!sab) || (area > bigarea) ) {
- sab= sa;
- bigarea= area;
- }
- }
- }
-
- /* use whichever largest area was found (it shouldn't be a time window) */
- if (sab)
- commonkey_context_get(sab, mode, sources, ksc);
- }
- break;
- }
-}
-
-/* flush updates after all operations */
-static void commonkey_context_finish (ListBase *sources)
-{
- /* check view type */
- switch (curarea->spacetype) {
- /* 3d view - first one tested as most often used */
- case SPACE_VIEW3D:
- {
- /* either pose or object level */
- if (OBACT && (OBACT->pose)) {
- Object *ob= OBACT;
-
- /* recalculate ipo handles, etc. */
- if (ob->action)
- remake_action_ipos(ob->action);
-
- /* recalculate bone-paths on adding new keyframe? */
- // TODO: currently, there is no setting to turn this on/off globally
- if (ob->pose->flag & POSE_RECALCPATHS)
- pose_recalculate_paths(ob);
- }
- else {
- bCommonKeySrc *cks;
-
- /* loop over bases (as seen in sources) */
- for (cks= sources->first; cks; cks= cks->next) {
- Object *ob= (Object *)cks->id;
-
- /* simply set recalc flag */
- ob->recalc |= OB_RECALC_OB;
- }
- }
- }
- break;
- }
-}
-
-/* flush refreshes after undo */
-static void commonkey_context_refresh (void)
-{
- /* check view type */
- switch (curarea->spacetype) {
- /* 3d view - first one tested as most often used */
- case SPACE_VIEW3D:
- {
- /* do refreshes */
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
-
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWMARKER, 0);
- }
- break;
-
- /* buttons window */
- case SPACE_BUTS:
- {
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWMARKER, 0);
- }
- break;
- }
-}
-
-/* --- */
-
-/* Build menu-string of available keying-sets (allocates memory for string)
- * NOTE: mode must not be longer than 64 chars
- */
-static char *build_keyingsets_menu (bKeyingContext *ksc, const char mode[48])
-{
- DynStr *pupds= BLI_dynstr_new();
- bKeyingSet *ks;
- char buf[64];
- char *str;
- int i, n;
-
- /* add title first */
- BLI_snprintf(buf, 64, "%s Key %%t|", mode);
- BLI_dynstr_append(pupds, buf);
-
- /* loop through keyingsets, adding them */
- for (ks=ksc->keyingsets, i=0, n=1; i < ksc->tot; ks++, i++, n++) {
- /* check if keyingset can be used */
- if (ks->flag == -1) {
- /* optional separator? */
- if (ks->include_cb) {
- if (ks->include_cb(ks, mode)) {
- BLI_snprintf( buf, 64, "%s%s", ks->name, ((n < ksc->tot)?"|":"") );
- BLI_dynstr_append(pupds, buf);
- }
- }
- else {
- BLI_snprintf( buf, 64, "%%l%s", ((n < ksc->tot)?"|":"") );
- BLI_dynstr_append(pupds, buf);
- }
- }
- else if ( (ks->include_cb==NULL) || (ks->include_cb(ks, mode)) ) {
- /* entry can be included */
- BLI_dynstr_append(pupds, ks->name);
-
- /* check if special "shapekey" entry */
- if (ks->flag == -3)
- BLI_snprintf( buf, 64, "%%x0%s", ((n < ksc->tot)?"|":"") );
- else
- BLI_snprintf( buf, 64, "%%x%d%s", n, ((n < ksc->tot)?"|":"") );
- BLI_dynstr_append(pupds, buf);
- }
- }
-
- /* convert to normal MEM_malloc'd string */
- str= BLI_dynstr_get_cstring(pupds);
- BLI_dynstr_free(pupds);
-
- return str;
-}
-
-/* Get the keying set that was chosen by the user from the menu */
-static bKeyingSet *get_keyingset_fromcontext (bKeyingContext *ksc, short index)
-{
- /* check if index is valid */
- if (ELEM(NULL, ksc, ksc->keyingsets))
- return NULL;
- if ((index < 1) || (index > ksc->tot))
- return NULL;
-
- /* index starts from 1, and should directly correspond to keyingset in array */
- return (bKeyingSet *)(ksc->keyingsets + (index - 1));
-}
-
-/* ---------------- Keyframe Management API -------------------- */
-
-/* Display a menu for handling the insertion of keyframes based on the active view */
-// TODO: add back an option for repeating last keytype
-void common_modifykey (short mode)
-{
- ListBase dsources = {NULL, NULL};
- bKeyingContext *ksc= NULL;
- bCommonKeySrc *cks;
- bKeyingSet *ks = NULL;
- char *menustr, buf[64];
- short menu_nr;
-
- /* check if mode is valid */
- if (ELEM(mode, COMMONKEY_MODE_INSERT, COMMONKEY_MODE_DELETE)==0)
- return;
-
- /* delegate to other functions or get keyingsets to use
- * - if the current area doesn't have its own handling, there will be data returned...
- */
- commonkey_context_get(curarea, mode, &dsources, &ksc);
-
- /* check that there is data to operate on */
- if (ELEM(NULL, dsources.first, ksc)) {
- BLI_freelistN(&dsources);
- return;
- }
-
- /* get menu and process it */
- if (mode == COMMONKEY_MODE_DELETE)
- menustr= build_keyingsets_menu(ksc, "Delete");
- else
- menustr= build_keyingsets_menu(ksc, "Insert");
- menu_nr= pupmenu(menustr);
- if (menustr) MEM_freeN(menustr);
-
- /* no item selected or shapekey entry? */
- if (menu_nr < 1) {
- /* free temp sources */
- BLI_freelistN(&dsources);
-
- /* check if insert new shapekey */
- if ((menu_nr == 0) && (mode == COMMONKEY_MODE_INSERT))
- insert_shapekey(OBACT);
- else
- ksc->lastused= NULL;
-
- return;
- }
- else {
- /* try to get keyingset */
- ks= get_keyingset_fromcontext(ksc, menu_nr);
-
- if (ks == NULL) {
- BLI_freelistN(&dsources);
- return;
- }
- }
-
- /* loop over each destination, applying the keying set */
- for (cks= dsources.first; cks; cks= cks->next) {
- short success= 0;
-
- /* special hacks for 'available' option */
- if (ks->flag == -2) {
- IpoCurve *icu= NULL, *icn= NULL;
-
- /* get first IPO-curve */
- if (cks->act && cks->actname) {
- bActionChannel *achan= get_action_channel(cks->act, cks->actname);
-
- // FIXME: what about constraint channels?
- if (achan && achan->ipo)
- icu= achan->ipo->curve.first;
- }
- else if(cks->ipo)
- icu= cks->ipo->curve.first;
-
- /* we get adrcodes directly from IPO curves (see method below...) */
- for (; icu; icu= icn) {
- short flag;
-
- /* get next ipo-curve in case current is deleted */
- icn= icu->next;
-
- /* insert mode or delete mode */
- if (mode == COMMONKEY_MODE_DELETE) {
- /* local flags only add on to global flags */
- flag = 0;
-
- /* delete keyframe */
- success += deletekey(cks->id, ks->blocktype, cks->actname, cks->constname, icu->adrcode, flag);
- }
- else {
- /* local flags only add on to global flags */
- flag = ks->flag;
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
- // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE;
-
- /* insert keyframe */
- success += insertkey(cks->id, ks->blocktype, cks->actname, cks->constname, icu->adrcode, flag);
- }
- }
- }
- else {
- int i;
-
- /* loop over channels available in keyingset */
- for (i=0; i < ks->chan_num; i++) {
- short flag, adrcode;
-
- /* get adrcode
- * - certain adrcodes (for MTEX channels need special offsets) // BAD CRUFT!!!
- */
- adrcode= ks->adrcodes[i];
- if (ELEM3(ks->blocktype, ID_MA, ID_LA, ID_WO) && (ks->flag & COMMONKEY_ADDMAP)) {
- switch (adrcode) {
- case MAP_OFS_X: case MAP_OFS_Y: case MAP_OFS_Z:
- case MAP_SIZE_X: case MAP_SIZE_Y: case MAP_SIZE_Z:
- case MAP_R: case MAP_G: case MAP_B: case MAP_DVAR:
- case MAP_COLF: case MAP_NORF: case MAP_VARF: case MAP_DISP:
- adrcode += cks->map;
- break;
- }
- }
-
- /* insert mode or delete mode */
- if (mode == COMMONKEY_MODE_DELETE) {
- /* local flags only add on to global flags */
- flag = 0;
- //flag &= ~COMMONKEY_ADDMAP;
-
- /* delete keyframe */
- success += deletekey(cks->id, ks->blocktype, cks->actname, cks->constname, adrcode, flag);
- }
- else {
- /* local flags only add on to global flags */
- flag = ks->flag;
- if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
- if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
- // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE;
- flag &= ~COMMONKEY_ADDMAP;
-
- /* insert keyframe */
- success += insertkey(cks->id, ks->blocktype, cks->actname, cks->constname, adrcode, flag);
- }
- }
- }
-
- /* special handling for some key-sources */
- if (success) {
- /* set pose recalc-paths flag */
- if (cks->pchan) {
- Object *ob= (Object *)cks->id;
- bPoseChannel *pchan= cks->pchan;
-
- /* set flag to trigger path recalc */
- if (pchan->path)
- ob->pose->flag |= POSE_RECALCPATHS;
-
- /* clear unkeyed flag (it doesn't matter if it's set or not) */
- if (pchan->bone)
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
- }
- }
-
- /* apply post-keying flushes for this data sources */
- commonkey_context_finish(&dsources);
- ksc->lastused= ks;
-
- /* free temp data */
- BLI_freelistN(&dsources);
-
- /* undo pushes */
- if (mode == COMMONKEY_MODE_DELETE)
- BLI_snprintf(buf, 64, "Delete %s Key", ks->name);
- else
- BLI_snprintf(buf, 64, "Insert %s Key", ks->name);
- BIF_undo_push(buf);
-
- /* queue updates for contexts */
- commonkey_context_refresh();
-}
-
-/* ---- */
-
-/* used to insert keyframes from any view */
-void common_insertkey (void)
-{
- common_modifykey(COMMONKEY_MODE_INSERT);
-}
-
-/* used to insert keyframes from any view */
-void common_deletekey (void)
-{
- common_modifykey(COMMONKEY_MODE_DELETE);
-}
-
-/* ************************************************** */
-/* KEYFRAME DETECTION */
-
-/* --------------- API/Per-Datablock Handling ------------------- */
-
-/* Checks whether an IPO-block has a keyframe for a given frame
- * Since we're only concerned whether a keyframe exists, we can simply loop until a match is found...
- */
-short ipo_frame_has_keyframe (Ipo *ipo, float frame, short filter)
-{
- IpoCurve *icu;
-
- /* can only find if there is data */
- if (ipo == NULL)
- return 0;
-
- /* if only check non-muted, check if muted */
- if ((filter & ANIMFILTER_MUTED) || (ipo->muteipo))
- return 0;
-
- /* loop over IPO-curves, using binary-search to try to find matches
- * - this assumes that keyframes are only beztriples
- */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- /* only check if there are keyframes (currently only of type BezTriple) */
- if (icu->bezt) {
- /* we either include all regardless of muting, or only non-muted */
- if ((filter & ANIMFILTER_MUTED) || (icu->flag & IPO_MUTE)==0) {
- short replace = -1;
- int i = binarysearch_bezt_index(icu->bezt, frame, icu->totvert, &replace);
-
- /* binarysearch_bezt_index will set replace to be 0 or 1
- * - obviously, 1 represents a match
- */
- if (replace) {
- /* sanity check: 'i' may in rare cases exceed arraylen */
- if ((i >= 0) && (i < icu->totvert))
- return 1;
- }
- }
- }
- }
-
- /* nothing found */
- return 0;
-}
-
-/* Checks whether an action-block has a keyframe for a given frame
- * Since we're only concerned whether a keyframe exists, we can simply loop until a match is found...
- */
-short action_frame_has_keyframe (bAction *act, float frame, short filter)
-{
- bActionChannel *achan;
-
- /* error checking */
- if (act == NULL)
- return 0;
-
- /* check thorugh action-channels for match */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- /* we either include all regardless of muting, or only non-muted
- * - here we include 'hidden' channels in the muted definition
- */
- if ((filter & ANIMFILTER_MUTED) || (achan->flag & ACHAN_HIDDEN)==0) {
- if (ipo_frame_has_keyframe(achan->ipo, frame, filter))
- return 1;
- }
- }
-
- /* nothing found */
- return 0;
-}
-
-/* Checks whether an Object has a keyframe for a given frame */
-short object_frame_has_keyframe (Object *ob, float frame, short filter)
-{
- /* error checking */
- if (ob == NULL)
- return 0;
-
- /* check for an action - actions take priority over normal IPO's */
- if (ob->action) {
- float aframe;
-
- /* apply nla-action scaling if needed */
- if ((ob->nlaflag & OB_NLA_OVERRIDE) && (ob->nlastrips.first))
- aframe= get_action_frame(ob, frame);
- else
- aframe= frame;
-
- /* priority check here goes to pose-channel checks (for armatures) */
- if ((ob->pose) && (ob->flag & OB_POSEMODE)) {
- /* only relevant check here is to only show active... */
- if (filter & ANIMFILTER_ACTIVE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
- bActionChannel *achan= (pchan) ? get_action_channel(ob->action, pchan->name) : NULL;
-
- /* since we're only interested in whether the selected one has any keyframes... */
- return (achan && ipo_frame_has_keyframe(achan->ipo, aframe, filter));
- }
- }
-
- /* for everything else, just use the standard test (only return if success) */
- if (action_frame_has_keyframe(ob->action, aframe, filter))
- return 1;
- }
- else if (ob->ipo) {
- /* only return if success */
- if (ipo_frame_has_keyframe(ob->ipo, frame, filter))
- return 1;
- }
-
- /* try shapekey keyframes (if available, and allowed by filter) */
- if ( !(filter & ANIMFILTER_LOCAL) && !(filter & ANIMFILTER_NOSKEY) ) {
- Key *key= ob_get_key(ob);
-
- /* shapekeys can have keyframes ('Relative Shape Keys')
- * or depend on time (old 'Absolute Shape Keys')
- */
-
- /* 1. test for relative (with keyframes) */
- if (id_frame_has_keyframe((ID *)key, frame, filter))
- return 1;
-
- /* 2. test for time */
- // TODO... yet to be implemented (this feature may evolve before then anyway)
- }
-
- /* try materials */
- if ( !(filter & ANIMFILTER_LOCAL) && !(filter & ANIMFILTER_NOMAT) ) {
- /* if only active, then we can skip a lot of looping */
- if (filter & ANIMFILTER_ACTIVE) {
- Material *ma= give_current_material(ob, (ob->actcol + 1));
-
- /* we only retrieve the active material... */
- if (id_frame_has_keyframe((ID *)ma, frame, filter))
- return 1;
- }
- else {
- int a;
-
- /* loop over materials */
- for (a=0; a<ob->totcol; a++) {
- Material *ma= give_current_material(ob, a+1);
-
- if (id_frame_has_keyframe((ID *)ma, frame, filter))
- return 1;
- }
- }
- }
-
- /* nothing found */
- return 0;
-}
-
-/* --------------- API ------------------- */
-
-/* Checks whether a keyframe exists for the given ID-block one the given frame */
-short id_frame_has_keyframe (ID *id, float frame, short filter)
-{
- /* error checking */
- if (id == NULL)
- return 0;
-
- /* check for a valid id-type */
- switch (GS(id->name)) {
- /* animation data-types */
- case ID_IP: /* ipo */
- return ipo_frame_has_keyframe((Ipo *)id, frame, filter);
- case ID_AC: /* action */
- return action_frame_has_keyframe((bAction *)id, frame, filter);
-
- case ID_OB: /* object */
- return object_frame_has_keyframe((Object *)id, frame, filter);
-
- case ID_MA: /* material */
- {
- Material *ma= (Material *)id;
-
- /* currently, material's only have an ipo-block */
- return ipo_frame_has_keyframe(ma->ipo, frame, filter);
- }
- break;
-
- case ID_KE: /* shapekey */
- {
- Key *key= (Key *)id;
-
- /* currently, shapekey's only have an ipo-block */
- return ipo_frame_has_keyframe(key->ipo, frame, filter);
- }
- break;
- }
-
- /* no keyframe found */
- return 0;
-}
-
-/* ************************************************** */
diff --git a/source/blender/src/keyval.c b/source/blender/src/keyval.c
deleted file mode 100644
index 5a2ba531821..00000000000
--- a/source/blender/src/keyval.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "stdio.h"
-#include "ctype.h"
-#include "string.h"
-
-#include "BKE_global.h"
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BIF_keyval.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-char *key_event_to_string(unsigned short event)
-{
-
- switch(event) {
- case AKEY:
- return "A";
- break;
- case BKEY:
- return "B";
- break;
- case CKEY:
- return "C";
- break;
- case DKEY:
- return "D";
- break;
- case EKEY:
- return "E";
- break;
- case FKEY:
- return "F";
- break;
- case GKEY:
- return "G";
- break;
- case HKEY:
- return "H";
- break;
- case IKEY:
- return "I";
- break;
- case JKEY:
- return "J";
- break;
- case KKEY:
- return "K";
- break;
- case LKEY:
- return "L";
- break;
- case MKEY:
- return "M";
- break;
- case NKEY:
- return "N";
- break;
- case OKEY:
- return "O";
- break;
- case PKEY:
- return "P";
- break;
- case QKEY:
- return "Q";
- break;
- case RKEY:
- return "R";
- break;
- case SKEY:
- return "S";
- break;
- case TKEY:
- return "T";
- break;
- case UKEY:
- return "U";
- break;
- case VKEY:
- return "V";
- break;
- case WKEY:
- return "W";
- break;
- case XKEY:
- return "X";
- break;
- case YKEY:
- return "Y";
- break;
- case ZKEY:
- return "Z";
- break;
-
- case ZEROKEY:
- return "Zero";
- break;
- case ONEKEY:
- return "One";
- break;
- case TWOKEY:
- return "Two";
- break;
- case THREEKEY:
- return "Three";
- break;
- case FOURKEY:
- return "Four";
- break;
- case FIVEKEY:
- return "Five";
- break;
- case SIXKEY:
- return "Six";
- break;
- case SEVENKEY:
- return "Seven";
- break;
- case EIGHTKEY:
- return "Eight";
- break;
- case NINEKEY:
- return "Nine";
- break;
-
- case LEFTCTRLKEY:
- return "Leftctrl";
- break;
- case LEFTALTKEY:
- return "Leftalt";
- break;
- case RIGHTALTKEY:
- return "Rightalt";
- break;
- case RIGHTCTRLKEY:
- return "Rightctrl";
- break;
- case RIGHTSHIFTKEY:
- return "Rightshift";
- break;
- case LEFTSHIFTKEY:
- return "Leftshift";
- break;
-
- case ESCKEY:
- return "Esc";
- break;
- case TABKEY:
- return "Tab";
- break;
- case RETKEY:
- return "Ret";
- break;
- case SPACEKEY:
- return "Space";
- break;
- case LINEFEEDKEY:
- return "Linefeed";
- break;
- case BACKSPACEKEY:
- return "Backspace";
- break;
- case DELKEY:
- return "Del";
- break;
- case SEMICOLONKEY:
- return "Semicolon";
- break;
- case PERIODKEY:
- return "Period";
- break;
- case COMMAKEY:
- return "Comma";
- break;
- case QUOTEKEY:
- return "Quote";
- break;
- case ACCENTGRAVEKEY:
- return "Accentgrave";
- break;
- case MINUSKEY:
- return "Minus";
- break;
- case SLASHKEY:
- return "Slash";
- break;
- case BACKSLASHKEY:
- return "Backslash";
- break;
- case EQUALKEY:
- return "Equal";
- break;
- case LEFTBRACKETKEY:
- return "Leftbracket";
- break;
- case RIGHTBRACKETKEY:
- return "Rightbracket";
- break;
-
- case LEFTARROWKEY:
- return "Leftarrow";
- break;
- case DOWNARROWKEY:
- return "Downarrow";
- break;
- case RIGHTARROWKEY:
- return "Rightarrow";
- break;
- case UPARROWKEY:
- return "Uparrow";
- break;
-
- case PAD2:
- return "Pad2";
- break;
- case PAD4:
- return "Pad4";
- break;
- case PAD6:
- return "Pad6";
- break;
- case PAD8:
- return "Pad8";
- break;
- case PAD1:
- return "Pad1";
- break;
- case PAD3:
- return "Pad3";
- break;
- case PAD5:
- return "Pad5";
- break;
- case PAD7:
- return "Pad7";
- break;
- case PAD9:
- return "Pad9";
- break;
-
- case PADPERIOD:
- return "Padperiod";
- break;
- case PADSLASHKEY:
- return "Padslash";
- break;
- case PADASTERKEY:
- return "Padaster";
- break;
-
- case PAD0:
- return "Pad0";
- break;
- case PADMINUS:
- return "Padminus";
- break;
- case PADENTER:
- return "Padenter";
- break;
- case PADPLUSKEY:
- return "Padplus";
- break;
-
- case F1KEY:
- return "F1";
- break;
- case F2KEY:
- return "F2";
- break;
- case F3KEY:
- return "F3";
- break;
- case F4KEY:
- return "F4";
- break;
- case F5KEY:
- return "F5";
- break;
- case F6KEY:
- return "F6";
- break;
- case F7KEY:
- return "F7";
- break;
- case F8KEY:
- return "F8";
- break;
- case F9KEY:
- return "F9";
- break;
- case F10KEY:
- return "F10";
- break;
- case F11KEY:
- return "F11";
- break;
- case F12KEY:
- return "F12";
- break;
-
- case PAUSEKEY:
- return "Pause";
- break;
- case INSERTKEY:
- return "Insert";
- break;
- case HOMEKEY:
- return "Home";
- break;
- case PAGEUPKEY:
- return "Pageup";
- break;
- case PAGEDOWNKEY:
- return "Pagedown";
- break;
- case ENDKEY:
- return "End";
- break;
- }
-
- return "";
-}
-
-/*
- * Decodes key combination strings [qual1+[qual2+[...]]]keyname
- * The '+'s may be replaced by '-' or ' ' characters to support different
- * formats. No additional whitespace is allowed. The keyname may be an internal
- * name, like "RETKEY", or a more common name, like "Return". Decoding is case-
- * insensitive.
- *
- * Example strings: "Ctrl+L", "ALT-ESC", "Shift A"
- *
- * Returns 1 if successful.
- */
-int decode_key_string(char *str, unsigned short *key, unsigned short *qual)
-{
- int i, prev, len, invalid=0;
-
- len= strlen(str);
- *key= *qual= 0;
-
- /* Convert to upper case */
- for (i=0; i<len; i++) {
- str[i]= toupper(str[i]);
- }
-
- /* Handle modifiers */
- for (prev=i=0; i<len; i++) {
- if (str[i]==' ' || str[i]=='+' || str[i]=='-') {
- if (!strncmp(str+prev, "CTRL", i-prev)) *qual |= LR_CTRLKEY;
- else if (!strncmp(str+prev, "ALT", i-prev)) *qual |= LR_ALTKEY;
- else if (!strncmp(str+prev, "SHIFT", i-prev)) *qual |= LR_SHIFTKEY;
- else if (!strncmp(str+prev, "COMMAND", i-prev)) *qual |= LR_COMMANDKEY;
- prev=i+1;
- }
- }
-
- /* Compare last part against key names */
- if ((len-prev==1) || ((len-prev==4) && !strncmp(str+prev, "KEY", 3))) {
-
- if (str[prev]>='A' && str[prev]<='Z') {
- *key= str[prev]-'A'+AKEY;
- } else if (str[prev]>='0' && str[prev]<='9') {
- *key= str[prev]-'0'+ZEROKEY;
- } else {
- invalid= 1;
- }
-
- } else if (!strncmp(str+prev, "ZEROKEY", len-prev) || !strncmp(str+prev, "ZERO", len-prev)) {
- *key= ZEROKEY;
- } else if (!strncmp(str+prev, "ONEKEY", len-prev) || !strncmp(str+prev, "ONE", len-prev)) {
- *key= ONEKEY;
- } else if (!strncmp(str+prev, "TWOKEY", len-prev) || !strncmp(str+prev, "TWO", len-prev)) {
- *key= TWOKEY;
- } else if (!strncmp(str+prev, "THREEKEY", len-prev) || !strncmp(str+prev, "THREE", len-prev)) {
- *key= THREEKEY;
- } else if (!strncmp(str+prev, "FOURKEY", len-prev) || !strncmp(str+prev, "FOUR", len-prev)) {
- *key= FOURKEY;
- } else if (!strncmp(str+prev, "FIVEKEY", len-prev) || !strncmp(str+prev, "FIVE", len-prev)) {
- *key= FIVEKEY;
- } else if (!strncmp(str+prev, "SIZEKEY", len-prev) || !strncmp(str+prev, "SIX", len-prev)) {
- *key= SIXKEY;
- } else if (!strncmp(str+prev, "SEVENKEY", len-prev) || !strncmp(str+prev, "SEVEN", len-prev)) {
- *key= SEVENKEY;
- } else if (!strncmp(str+prev, "EIGHTKEY", len-prev) || !strncmp(str+prev, "EIGHT", len-prev)) {
- *key= EIGHTKEY;
- } else if (!strncmp(str+prev, "NINEKEY", len-prev) || !strncmp(str+prev, "NINE", len-prev)) {
- *key= NINEKEY;
-
- } else if (!strncmp(str+prev, "ESCKEY", len-prev) || !strncmp(str+prev, "ESC", len-prev)) {
- *key= ESCKEY;
- } else if (!strncmp(str+prev, "TABKEY", len-prev) || !strncmp(str+prev, "TAB", len-prev)) {
- *key= TABKEY;
- } else if (!strncmp(str+prev, "RETKEY", len-prev) || !strncmp(str+prev, "RETURN", len-prev) || !strncmp(str+prev, "ENTER", len-prev)) {
- *key= RETKEY;
- } else if (!strncmp(str+prev, "SPACEKEY", len-prev) || !strncmp(str+prev, "SPACE", len-prev)) {
- *key= SPACEKEY;
- } else if (!strncmp(str+prev, "LINEFEEDKEY", len-prev) || !strncmp(str+prev, "LINEFEED", len-prev)) {
- *key= LINEFEEDKEY;
- } else if (!strncmp(str+prev, "BACKSPACEKEY", len-prev) || !strncmp(str+prev, "BACKSPACE", len-prev)) {
- *key= BACKSPACEKEY;
- } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) {
- *key= DELKEY;
-
- } else if (!strncmp(str+prev, "SEMICOLONKEY", len-prev) || !strncmp(str+prev, "SEMICOLON", len-prev)) {
- *key= SEMICOLONKEY;
- } else if (!strncmp(str+prev, "PERIODKEY", len-prev) || !strncmp(str+prev, "PERIOD", len-prev)) {
- *key= PERIODKEY;
- } else if (!strncmp(str+prev, "COMMAKEY", len-prev) || !strncmp(str+prev, "COMMA", len-prev)) {
- *key= COMMAKEY;
- } else if (!strncmp(str+prev, "QUOTEKEY", len-prev) || !strncmp(str+prev, "QUOTE", len-prev)) {
- *key= QUOTEKEY;
- } else if (!strncmp(str+prev, "ACCENTGRAVEKEY", len-prev) || !strncmp(str+prev, "ACCENTGRAVE", len-prev)) {
- *key= ACCENTGRAVEKEY;
- } else if (!strncmp(str+prev, "MINUSKEY", len-prev) || !strncmp(str+prev, "MINUS", len-prev)) {
- *key= MINUSKEY;
- } else if (!strncmp(str+prev, "SLASHKEY", len-prev) || !strncmp(str+prev, "SLASH", len-prev)) {
- *key= SLASHKEY;
- } else if (!strncmp(str+prev, "BACKSLASHKEY", len-prev) || !strncmp(str+prev, "BACKSLASH", len-prev)) {
- *key= BACKSLASHKEY;
- } else if (!strncmp(str+prev, "EQUALKEY", len-prev) || !strncmp(str+prev, "EQUAL", len-prev)) {
- *key= EQUALKEY;
- } else if (!strncmp(str+prev, "LEFTBRACKETKEY", len-prev) || !strncmp(str+prev, "LEFTBRACKET", len-prev)) {
- *key= LEFTBRACKETKEY;
- } else if (!strncmp(str+prev, "RIGHTBRACKETKEY", len-prev) || !strncmp(str+prev, "RIGHTBRACKET", len-prev)) {
- *key= RIGHTBRACKETKEY;
- } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) {
- *key= DELKEY;
-
- } else if (!strncmp(str+prev, "LEFTARROWKEY", len-prev) || !strncmp(str+prev, "LEFTARROW", len-prev)) {
- *key= LEFTARROWKEY;
- } else if (!strncmp(str+prev, "DOWNARROWKEY", len-prev) || !strncmp(str+prev, "DOWNARROW", len-prev)) {
- *key= DOWNARROWKEY;
- } else if (!strncmp(str+prev, "RIGHTARROWKEY", len-prev) || !strncmp(str+prev, "RIGHTARROW", len-prev)) {
- *key= RIGHTARROWKEY;
- } else if (!strncmp(str+prev, "UPARROWKEY", len-prev) || !strncmp(str+prev, "UPARROW", len-prev)) {
- *key= UPARROWKEY;
-
- } else if (!strncmp(str+prev, "PAD", 3)) {
-
- if (len-prev<=4) {
-
- if (str[prev]>='0' && str[prev]<='9') {
- *key= str[prev]-'0'+ZEROKEY;
- } else {
- invalid= 1;
- }
-
- } else if (!strncmp(str+prev+3, "PERIODKEY", len-prev-3) || !strncmp(str+prev+3, "PERIOD", len-prev-3)) {
- *key= PADPERIOD;
- } else if (!strncmp(str+prev+3, "SLASHKEY", len-prev-3) || !strncmp(str+prev+3, "SLASH", len-prev-3)) {
- *key= PADSLASHKEY;
- } else if (!strncmp(str+prev+3, "ASTERKEY", len-prev-3) || !strncmp(str+prev+3, "ASTERISK", len-prev-3)) {
- *key= PADASTERKEY;
- } else if (!strncmp(str+prev+3, "MINUSKEY", len-prev-3) || !strncmp(str+prev+3, "MINUS", len-prev-3)) {
- *key= PADMINUS;
- } else if (!strncmp(str+prev+3, "ENTERKEY", len-prev-3) || !strncmp(str+prev+3, "ENTER", len-prev-3)) {
- *key= PADENTER;
- } else if (!strncmp(str+prev+3, "PLUSKEY", len-prev-3) || !strncmp(str+prev+3, "PLUS", len-prev-3)) {
- *key= PADPLUSKEY;
- } else {
- invalid= 1;
- }
-
- } else if (!strncmp(str+prev, "F1KEY", len-prev) || !strncmp(str+prev, "F1", len-prev)) {
- *key= F1KEY;
- } else if (!strncmp(str+prev, "F2KEY", len-prev) || !strncmp(str+prev, "F2", len-prev)) {
- *key= F2KEY;
- } else if (!strncmp(str+prev, "F3KEY", len-prev) || !strncmp(str+prev, "F3", len-prev)) {
- *key= F3KEY;
- } else if (!strncmp(str+prev, "F4KEY", len-prev) || !strncmp(str+prev, "F4", len-prev)) {
- *key= F4KEY;
- } else if (!strncmp(str+prev, "F5KEY", len-prev) || !strncmp(str+prev, "F5", len-prev)) {
- *key= F5KEY;
- } else if (!strncmp(str+prev, "F6KEY", len-prev) || !strncmp(str+prev, "F6", len-prev)) {
- *key= F6KEY;
- } else if (!strncmp(str+prev, "F7KEY", len-prev) || !strncmp(str+prev, "F7", len-prev)) {
- *key= F7KEY;
- } else if (!strncmp(str+prev, "F8KEY", len-prev) || !strncmp(str+prev, "F8", len-prev)) {
- *key= F8KEY;
- } else if (!strncmp(str+prev, "F9KEY", len-prev) || !strncmp(str+prev, "F9", len-prev)) {
- *key= F9KEY;
- } else if (!strncmp(str+prev, "F10KEY", len-prev) || !strncmp(str+prev, "F10", len-prev)) {
- *key= F10KEY;
- } else if (!strncmp(str+prev, "F11KEY", len-prev) || !strncmp(str+prev, "F11", len-prev)) {
- *key= F11KEY;
- } else if (!strncmp(str+prev, "F12KEY", len-prev) || !strncmp(str+prev, "F12", len-prev)) {
- *key= F12KEY;
-
- } else if (!strncmp(str+prev, "PAUSEKEY", len-prev) || !strncmp(str+prev, "PAUSE", len-prev)) {
- *key= PAUSEKEY;
- } else if (!strncmp(str+prev, "INSERTKEY", len-prev) || !strncmp(str+prev, "INSERT", len-prev)) {
- *key= INSERTKEY;
- } else if (!strncmp(str+prev, "HOMEKEY", len-prev) || !strncmp(str+prev, "HOME", len-prev)) {
- *key= HOMEKEY;
- } else if (!strncmp(str+prev, "PAGEUPKEY", len-prev) || !strncmp(str+prev, "PAGEUP", len-prev)) {
- *key= PAGEUPKEY;
- } else if (!strncmp(str+prev, "PAGEDOWNKEY", len-prev) || !strncmp(str+prev, "PAGEDOWN", len-prev)) {
- *key= PAGEDOWNKEY;
- } else if (!strncmp(str+prev, "ENDKEY", len-prev) || !strncmp(str+prev, "END", len-prev)) {
- *key= ENDKEY;
-
- } else {
- invalid= 1;
- }
-
- if (!invalid && *key) {
- return 1;
- }
-
- return 0;
-}
diff --git a/source/blender/src/lorem.c b/source/blender/src/lorem.c
deleted file mode 100644
index 68637f7f9ef..00000000000
--- a/source/blender/src/lorem.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "BIF_editfont.h"
-
-char *BIF_lorem =
-"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
-"Aliquam tristique interdum sem. "
-"Nullam pretium, tortor non euismod varius, nulla odio sodales nulla, at bibendum lorem metus sed nulla. "
-"Vestibulum in lectus at pede blandit viverra. "
-"Fusce scelerisque ipsum nec enim. "
-"Fusce euismod nunc id enim. "
-"In venenatis cursus arcu. "
-"Aenean quis dui. "
-"Maecenas laoreet. "
-"Nulla tempor, arcu pulvinar pretium suscipit, tortor wisi dapibus libero, id ornare felis ipsum suscipit purus. "
-"Maecenas ipsum. "
-"Morbi cursus. "
-"Vestibulum diam purus, commodo et, convallis eu, posuere at, ligula. "
-"Nulla aliquam aliquet lorem. "
-"Nunc et mauris hendrerit est bibendum suscipit. "
-"Donec pellentesque libero eu nisl. "
-"Pellentesque eget libero. "
-"Donec tempus ipsum sed quam. "
-"Sed blandit nunc quis enim. "
-"Quisque lectus diam, adipiscing hendrerit, placerat non, pulvinar id, felis. "
-"In congue magna sit amet urna. "
-"Nunc non augue sed nisl dictum laoreet. "
-"Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. "
-"In venenatis dapibus massa. "
-"Nulla hendrerit sapien et quam. "
-"Nunc ac magna lobortis tellus tincidunt posuere. "
-"Cras augue mauris, mattis lobortis, fermentum at, semper ac, tellus. "
-"Cras vitae ligula sit amet sem posuere iaculis. "
-"Aliquam condimentum eleifend felis. "
-"Ut sit amet sapien. "
-"Suspendisse potenti. "
-"Mauris urna. "
-"Ut eu enim eu ante porta vestibulum. "
-"Aenean scelerisque est ac felis. "
-"Suspendisse auctor. "
-"Nunc pellentesque. "
-"Morbi laoreet ante et nibh. "
-"Donec feugiat arcu eget enim. "
-"Morbi vehicula tortor ac ipsum. "
-"Quisque lacus arcu, elementum ac, faucibus vel, posuere id, est. "
-"Proin commodo gravida sem. "
-"Vivamus tincidunt vehicula libero. "
-"Phasellus wisi. "
-"Maecenas pretium tellus eu sapien. "
-"Nunc sit amet nunc. "
-"In hac habitasse platea dictumst. "
-"Aenean dictum neque sed tortor. "
-"Donec et erat. "
-"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed justo turpis, scelerisque ut, mattis sit amet, ornare rutrum, massa. "
-"Vestibulum bibendum enim sit amet velit. "
-"Vivamus tellus ipsum, luctus ut, consectetuer vitae, dignissim non, ligula. "
-"Phasellus lacinia wisi at est. "
-"Donec elit wisi, commodo non, placerat in, convallis id, elit. "
-"Nunc dolor dolor, vestibulum id, bibendum vitae, lacinia id, erat. "
-"Cras sit amet eros. "
-"Suspendisse suscipit lobortis lectus. "
-"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. "
-"Cras orci. "
-"Praesent massa urna, lobortis semper, auctor a, pretium vitae, tellus. "
-"Curabitur at purus. "
-"Morbi tortor quam, imperdiet venenatis, egestas a, cursus eu, est. "
-"Nunc interdum lectus sit amet libero. "
-"Quisque dignissim placerat ligula. "
-"Nunc porttitor posuere arcu. "
-"Mauris faucibus quam at massa. "
-"Vivamus sodales aliquet mauris. "
-"In id ante. "
-"Pellentesque varius ipsum in arcu. "
-"Fusce mauris lacus, tristique ac, lobortis quis, lobortis luctus, pede. "
-"Sed wisi. "
-"Vestibulum mattis. "
-"Maecenas hendrerit sem nec purus. "
-"Proin id quam. "
-"Cras nec mauris. "
-"Integer orci. "
-"Nullam dui sem, molestie sed, egestas quis, cursus in, magna. "
-"Mauris neque lacus, consectetuer nec, sagittis eu, porttitor eget, dui. "
-"Fusce consectetuer. "
-"Donec nec tellus quis leo lobortis ullamcorper. "
-"Etiam metus urna, aliquet pretium, ultrices eu, cursus ut, turpis. "
-"Morbi bibendum vehicula lectus. "
-"Sed non ante vitae arcu pellentesque tempor. "
-"Fusce sed ligula in sem tempor imperdiet. "
-"Aliquam vel est. "
-"Phasellus sollicitudin sollicitudin nibh. "
-"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. "
-"Sed vel leo nec eros blandit imperdiet. "
-"Nulla facilisi. "
-"Suspendisse lobortis, dui ut fringilla hendrerit, justo purus ullamcorper ligula, ultricies ultrices dolor enim in libero. "
-"Sed elementum, pede eget porta convallis, dui nulla dignissim pede, eget vehicula odio ante at sem. "
-"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
-"Sed ullamcorper tincidunt ipsum. "
-"Fusce risus nibh, accumsan sit amet, tempus eget, tristique ac, neque. "
-"Sed quis lorem ut tortor facilisis fermentum. "
-"Fusce pulvinar quam sit amet ipsum. "
-"Morbi ac elit quis tellus malesuada blandit. "
-"Maecenas suscipit sollicitudin sem. "
-"Nam sed eros vel lacus lobortis congue. "
-"Proin interdum nunc lobortis orci. "
-"Donec egestas enim eu odio. "
-"Vestibulum id metus. "
-"Pellentesque auctor, sem varius luctus tempus, libero magna cursus neque, et porttitor diam diam quis purus. "
-"Vestibulum sit amet dolor. "
-"Nulla in magna. "
-"Cras id diam at lectus faucibus placerat. "
-"Nunc porta posuere sapien. "
-"Etiam scelerisque. "
-"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. "
-"Aliquam pellentesque mi sed tortor. "
-"Maecenas eleifend diam non urna. "
-"Donec luctus pharetra tellus. "
-"Proin ac ipsum eget libero bibendum volutpat. "
-"Cras id tellus. "
-"Nulla non risus. "
-"In dolor. "
-"Fusce scelerisque quam in massa ultrices porta. "
-"Morbi ut dolor eu massa egestas condimentum. "
-"Mauris vulputate. "
-"In hac habitasse platea dictumst. "
-"Suspendisse potenti. "
-"Mauris vehicula leo in tortor. "
-"Mauris vel erat a urna laoreet semper. "
-"Pellentesque ut metus ac tellus commodo eleifend. "
-"Suspendisse quis urna. "
-"Curabitur lacinia dignissim dui. "
-"Nam nec ante. "
-"In id enim. "
-"Aenean mattis enim. "
-"In ut neque porttitor risus hendrerit tincidunt. "
-"Suspendisse potenti. "
-"Ut vestibulum lectus vitae tortor. "
-"Duis velit. "
-"Nulla facilisi. "
-"Integer sit amet urna. "
-"Cras varius tortor in pede. "
-"Sed facilisis. "
-"Praesent lacinia libero nec nibh. "
-"Donec aliquam risus non nisl. "
-"Nam a nunc et felis tempor feugiat. "
-"Nunc metus. "
-"Vestibulum euismod, metus in semper laoreet, urna ipsum pharetra lorem, sed ultricies magna lorem sit amet wisi. "
-"Sed wisi. "
-"Nullam facilisis elit sed nisl. "
-"Phasellus mattis leo nec massa. "
-"Aenean malesuada. "
-"Cras wisi erat, lobortis nec, cursus eget, lobortis at, libero. "
-"In massa nisl, rutrum non, cursus nec, faucibus sed, lacus. "
-"Pellentesque malesuada. "
-"Cras euismod, neque ac suscipit tempus, velit lorem luctus elit, dapibus rhoncus wisi est ut sem. "
-"Proin vulputate enim in eros elementum accumsan. "
-"Ut lorem nisl, hendrerit et, interdum nec, lacinia in, dolor. "
-"Duis nec quam. "
-"Praesent velit felis, posuere id, luctus quis, laoreet ut, ipsum. "
-"Praesent eget arcu. "
-"Mauris massa felis, ornare non, ultrices id, tristique in, elit. "
-"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
-"Phasellus vulputate, mi ac bibendum facilisis, libero enim suscipit leo, non nonummy pede diam eget nibh. "
-"Sed tempus. "
-"Aenean interdum suscipit dui. "
-"Aliquam erat volutpat. "
-"Ut malesuada. "
-"Nam commodo, nulla ut fringilla rutrum, orci elit viverra diam, vitae mollis odio odio et purus. "
-"Aliquam erat volutpat. "
-"Sed aliquet lobortis ipsum. "
-"In ut est. "
-"Etiam condimentum. "
-"Vestibulum pellentesque tortor pulvinar lacus. "
-"Aenean orci. "
-"Suspendisse lacus nulla, nonummy a, dictum vitae, egestas quis, eros. "
-"Donec auctor gravida nisl. "
-"Cras ac est rutrum augue pulvinar ornare. "
-"Phasellus mauris nibh, vulputate in, rhoncus imperdiet, dapibus eget, lacus. "
-"Nam nunc mauris, suscipit at, ultricies a, facilisis at, tellus. "
-"Nam accumsan mollis libero. "
-"Vivamus condimentum mattis est. "
-"Donec lacus. "
-"Nullam ac sapien id massa lobortis molestie. "
-"Pellentesque elementum. "
-"Proin ut purus. "
-"Integer et sapien quis turpis commodo mollis. "
-"Nulla consequat. "
-"Proin a wisi ut tellus blandit elementum. "
-"Aliquam nulla lorem, bibendum ac, malesuada vel, elementum et, metus. "
-"Phasellus egestas nibh et ligula. "
-"Vivamus diam odio, lacinia quis, malesuada quis, sollicitudin ut, eros. "
-"Phasellus aliquet lorem ac ipsum. "
-"Sed cursus tellus ac orci. "
-"Phasellus at nulla. "
-"Donec porta sodales ante. "
-"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
-"Sed id lectus at massa ullamcorper tristique. "
-"Suspendisse porttitor lacus. "
-"In hac habitasse platea dictumst. "
-"Nunc non turpis. "
-"Sed sagittis. "
-"Morbi laoreet scelerisque dui. "
-"Nam arcu tellus, tempor vitae, vestibulum et, imperdiet ut, velit. "
-"In sit amet augue a arcu volutpat suscipit. "
-"Donec dictum ultrices lectus. "
-"Phasellus a purus et orci dictum lacinia. "
-"Ut leo. "
-"Cras semper, lorem sit amet tincidunt congue, justo eros varius pede, in bibendum turpis lectus non eros. "
-"Phasellus quam. "
-"Suspendisse mattis sollicitudin magna. "
-"Aenean facilisis diam vel nisl nonummy condimentum. "
-"Suspendisse vel dolor. "
-"Vestibulum nonummy. "
-"Mauris imperdiet semper ante. "
-"Maecenas vulputate eros. "
-"Vestibulum ac dolor. "
-"Fusce risus metus, aliquet eget, facilisis et, feugiat vel, orci. "
-"Ut at nunc id ante sodales vulputate. "
-"Duis tristique mattis ante. "
-"Vestibulum neque mauris, laoreet id, congue interdum, aliquet ut, diam. "
-"Nulla volutpat blandit magna. "
-"Donec accumsan congue diam. "
-"Etiam vel dui eget nisl tempor varius. "
-"Cras dictum massa sed enim. "
-"Cras urna tortor, fringilla ac, ullamcorper in, euismod vel, arcu. "
-"Morbi posuere luctus augue. "
-"Aliquam dui dui, adipiscing in, lobortis eu, luctus eu, nulla. "
-"Cras velit pede, ullamcorper sit amet, feugiat in, auctor vitae, ante. "
-"Suspendisse dictum fringilla mauris. "
-"In a nibh. "
-"Donec ac ligula. "
-"In quam. "
-"Praesent vitae urna ultricies sem aliquam placerat. "
-"Aliquam erat volutpat. "
-"Nam est. "
-"Donec faucibus sodales metus. "
-"Ut congue. "
-"Donec arcu tellus, pharetra ac, vulputate ac, mollis sed, lectus. "
-"Nulla facilisi. "
-"Nullam volutpat nunc et felis. "
-"Sed pede odio, tincidunt in, volutpat malesuada, feugiat gravida, nulla. "
-"Nulla aliquam pede vitae arcu. "
-"Proin velit elit, nonummy sit amet, elementum vitae, varius vitae, dolor. "
-"Donec rutrum ipsum eu mi. "
-"Aliquam et sem. "
-"In adipiscing rhoncus velit. "
-"Nam viverra scelerisque arcu. "
-"Aliquam sem. "
-"Sed tincidunt nulla quis massa. "
-"Mauris faucibus tempus nunc. "
-"Phasellus condimentum. "
-"Curabitur aliquet iaculis sapien. "
-"Nunc rhoncus, odio vitae bibendum dignissim, tellus libero commodo ipsum, ut sollicitudin nisl nisl vel justo. "
-"Nulla facilisi. "
-"Praesent blandit enim ut justo. "
-"Proin elementum, elit eget accumsan pulvinar, orci quam auctor neque, sed convallis diam purus vel felis. "
-"Sed orci leo, eleifend vel, blandit non, semper eu, purus. "
-"Proin bibendum, libero ac consectetuer commodo, eros sapien blandit nisl, eu eleifend nibh nibh vel lectus. "
-"Vivamus placerat. "
-"Integer odio dolor, pharetra non, sodales id, viverra eget, diam. "
-"Nunc mauris magna, egestas quis, feugiat id, fermentum viverra, mi. "
-"Aenean suscipit nisl non nunc. "
-"Proin quis lectus ac tellus nonummy commodo. "
-"Nunc eget diam ac elit vestibulum auctor. "
-"Etiam vulputate, odio sed lacinia consequat, justo mi vulputate purus, sit amet euismod libero metus sed tortor. "
-"Maecenas ac elit sed lorem vulputate gravida. "
-"Proin lectus eros, ullamcorper id, volutpat quis, condimentum tincidunt, sapien. "
-"Sed et massa eget lorem aliquet tempus. "
-"Duis porttitor nisl non risus. "
-"Nam id quam. "
-"Nullam est. "
-"Proin orci diam, posuere et, pharetra commodo, dictum vel, enim. "
-"Proin eget erat. "
-"Donec nisl. "
-"Maecenas auctor velit ut pede. "
-"Nunc vitae lectus nec libero tincidunt hendrerit. "
-"Quisque varius, erat ultrices ultrices euismod, purus lacus dictum eros, at condimentum enim dui nec magna. "
-"Morbi diam. "
-"Phasellus sed est. "
-"Phasellus nec libero in arcu fringilla sollicitudin. "
-"In rutrum nisl at arcu. "
-"Nulla facilisi. "
-"Mauris dignissim. "
-"Etiam est mauris, pharetra sed, viverra et, tincidunt sed, neque. "
-"Ut at lectus id nibh luctus ornare. "
-"Mauris varius porttitor risus. "
-"Ut vulputate aliquet risus. "
-"Vestibulum luctus neque sit amet nunc. "
-"Duis fermentum nibh. "
-"Pellentesque dapibus. "
-"Proin eros libero, aliquam non, condimentum a, sodales ut, turpis. "
-"Integer accumsan mi sed lorem. "
-"Vestibulum pellentesque sodales nisl. "
-"Nulla eu justo quis dui pretium rhoncus. "
-"Praesent viverra commodo mi. "
-"Maecenas dolor libero, viverra a, elementum vitae, aliquet vitae, dui. "
-"Mauris convallis lectus et mi. "
-"Mauris sagittis. "
-"Sed arcu. "
-"Pellentesque auctor. "
-"Donec pellentesque purus non tellus. "
-"Ut leo wisi, ultrices sit amet, ultrices eu, gravida ac, libero. "
-"Mauris fermentum dapibus diam. "
-"Integer quis lacus dapibus odio pellentesque varius. "
-"Fusce pede quam, vehicula ut, pulvinar et, tincidunt sed, felis. "
-"Curabitur eros enim, vulputate sed, aliquam ac, euismod ac, erat. "
-"Ut dignissim, lacus a interdum iaculis, enim orci posuere nunc, nec ultricies lectus risus in odio. "
-"Etiam et massa id dui commodo vehicula. "
-"Nunc blandit tortor quis dui. "
-"Quisque nisl. "
-"Sed venenatis blandit ligula. "
-"Fusce viverra imperdiet magna. "
-"Donec eget nunc quis est pharetra lobortis. "
-"Vestibulum quis lectus. "
-"Mauris vel orci lobortis nunc fermentum bibendum. "
-"Pellentesque eget leo. "
-"Morbi vel urna sit amet erat fermentum facilisis. "
-"Sed vulputate, libero et sollicitudin congue, wisi lectus sodales dolor, eget molestie magna orci vel tellus. "
-"Sed tempor ante et enim. "
-"Mauris elit. "
-"Curabitur ullamcorper vehicula massa. "
-"Sed viverra. "
-"Duis nulla. "
-"Nam bibendum. "
-"Nam tortor lorem, ullamcorper vitae, dictum sed, posuere eu, justo. "
-"Aliquam adipiscing arcu vitae turpis. "
-"Donec malesuada posuere libero. "
-"Ut sed tellus. "
-"Fusce sed nunc eget nisl dapibus malesuada. "
-"Suspendisse potenti. "
-"Integer tristique libero et metus. "
-"Vivamus posuere. "
-"Maecenas non sem non quam fermentum blandit. "
-"Duis risus tellus, rutrum vitae, imperdiet nec, malesuada nec, ipsum. "
-"Nunc quam dolor, luctus eget, placerat non, rhoncus at, tellus. "
-"Duis pede lectus, mattis adipiscing, tempor ut, porta at, mi. "
-"Pellentesque risus nulla, sodales sed, interdum id, nonummy vitae, ligula. "
-"Morbi pulvinar pede ut massa. "
-"Nunc risus mauris, tincidunt et, faucibus eu, suscipit vel, orci. "
-"In faucibus felis in arcu. "
-"Nulla sit amet elit. "
-"Nulla erat sapien, sagittis eget, dignissim eget, viverra eu, felis. "
-"Nam ac ipsum. "
-"Suspendisse vulputate turpis vel sem lacinia ullamcorper. "
-"Mauris ornare ipsum sed ligula. "
-"Duis facilisis neque quis orci. "
-"Nullam et erat et orci lacinia pellentesque. "
-"Donec ac ipsum. "
-"Duis molestie ipsum ac arcu. "
-"Aenean congue accumsan ante. "
-"Integer bibendum, leo ut ornare aliquam, nunc erat condimentum arcu, ut pulvinar mi augue et nulla. "
-"Quisque lacinia aliquet wisi. "
-"Vivamus nec dui. "
-"Etiam wisi leo, euismod vitae, vulputate a, dictum vitae, quam. "
-"Quisque quis tortor. "
-"Etiam interdum. "
-"In massa erat, porttitor sed, tincidunt vel, vehicula fringilla, augue. "
-"Nulla vel urna. "
-"In libero mi, pretium sed, mattis tempus, sagittis sed, massa. "
-"Suspendisse quam wisi, fermentum quis, sagittis at, consequat eget, odio. "
-"Nullam imperdiet, purus quis aliquam cursus, turpis odio egestas justo, placerat gravida turpis wisi vel tortor. "
-"Nunc ultricies porta purus. "
-"Proin elementum erat ac orci. "
-"Ut vel magna nec mi feugiat tincidunt. "
-"Ut ligula. "
-"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec et magna in diam porta nonummy. "
-"Maecenas ut sem in turpis fermentum viverra. "
-"Suspendisse at orci. "
-"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
-"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque rutrum eleifend justo. "
-"Nullam vitae pede. "
-"Donec condimentum nibh et odio. "
-"Sed et metus. "
-"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. "
-"Nam tempus. "
-"Sed ac wisi. "
-"In hac habitasse platea dictumst. "
-"Sed sed wisi. "
-"Ut facilisis tellus non ligula. "
-"Integer metus. "
-"In lacinia dui. "
-"Curabitur ornare. "
-"Mauris vel urna. "
-"Nam consectetuer dignissim urna. "
-"Nunc elementum porttitor erat. "
-"Sed blandit, risus non commodo nonummy, ligula erat fermentum nibh, eu facilisis ante neque sed sem. "
-"Etiam scelerisque justo eget wisi. "
-"Nunc dignissim. "
-"Proin pulvinar quam non lectus. "
-"Proin ut turpis quis augue pellentesque dictum. "
-"Fusce et lorem. "
-"Aliquam urna lacus, blandit sed, vestibulum sit amet, placerat et, dolor. "
-"Curabitur auctor erat nec lorem. "
-"Phasellus urna wisi, lacinia ut, molestie tincidunt, condimentum id, odio. "
-"Curabitur convallis ullamcorper justo. "
-"Donec vestibulum est ac quam. "
-"Nullam vitae elit eu massa varius vulputate. "
-"Nulla facilisi. "
-"Suspendisse potenti. "
-"Praesent non libero. "
-"Nullam tristique massa id magna viverra commodo. "
-"Vestibulum libero tortor, luctus ac, viverra congue, consectetuer vel, libero. "
-"Aenean arcu augue, luctus id, laoreet pulvinar, dictum sed, lectus. "
-"Donec vestibulum volutpat dolor. "
-"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
-"Pellentesque augue turpis, laoreet nec, malesuada at, nonummy vitae, nibh. "
-"Etiam orci sapien, congue in, porttitor sit amet, rutrum vel, nibh. "
-"Integer eu lorem. "
-"Mauris pretium leo et elit. "
-"In nonummy ultricies sapien. "
-"Mauris varius. "
-"Mauris sed libero. "
-"Curabitur ullamcorper elit eu purus. "
-"Vestibulum velit pede, semper sit amet, lobortis vitae, tincidunt vel, dui. "
-"Nulla neque ante, sagittis eu, vestibulum et, lacinia a, libero. "
-"Morbi sit amet wisi. "
-"Pellentesque non felis quis arcu bibendum ornare. "
-"Aenean enim metus, commodo eu, hendrerit nonummy, euismod ut, quam. "
-"Nulla eleifend nisl quis dolor. "
-"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. "
-"Maecenas pellentesque massa in erat molestie molestie. "
-"Mauris dignissim dapibus libero. "
-"Sed sed risus id neque dictum ornare. "
-"Sed eu ligula at felis sodales accumsan. "
-"Sed interdum, urna non pharetra hendrerit, quam mi ornare libero, id fringilla tortor orci non velit. "
-"Aliquam nec risus. "
-"Donec at nunc vitae tellus molestie vestibulum. "
-"Pellentesque vel justo. "
-"Duis ligula libero, vulputate quis, adipiscing bibendum, feugiat vitae, velit. "
-"Vivamus et arcu. "
-"Fusce eget quam. "
-"Ut ante. "
-"Suspendisse feugiat metus non ipsum. "
-"Nulla tempus leo ut mi. "
-"Curabitur vitae nisl. "
-"Vivamus elementum. "
-"Etiam a orci. "
-"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus urna quam, tincidunt at, ultrices vel, feugiat eget, nulla. "
-"Maecenas lacus magna, nonummy eu, iaculis sed, consectetuer quis, enim. "
-"Praesent a eros. "
-"Aliquam nonummy dignissim neque. "
-"Nulla enim. "
-"Praesent molestie, orci quis tristique volutpat, lacus metus luctus sapien, et facilisis eros neque id sapien. "
-"Nunc condimentum dolor vel orci. "
-"Integer wisi diam, porttitor sit amet, feugiat in, dapibus in, lectus. "
-"Aliquam erat volutpat. "
-"Quisque mollis turpis vitae tortor. "
-"Mauris turpis mi, pretium ut, ultrices sed, porta in, justo. "
-"Suspendisse posuere. "
-"Quisque ultricies lacus vitae enim. "
-"Donec lacus. "
-"Suspendisse potenti. "
-"Donec molestie, magna sed euismod dictum, magna magna interdum diam, vitae sagittis leo lorem ac neque. "
-"Cras metus. "
-"Quisque nunc. "
-"Duis consectetuer. "
-"Vestibulum gravida sollicitudin urna. "
-"Integer volutpat, massa quis ultrices pulvinar, eros purus dignissim nunc, eget rhoncus enim lectus quis tortor. "
-"Integer lacinia quam quis erat convallis mattis. "
-"Suspendisse iaculis posuere velit. "
-"Etiam tellus enim, aliquet nec, laoreet a, molestie non, velit. "
-"Quisque lacus velit, eleifend imperdiet, fringilla id, dapibus scelerisque, lectus. "
-"Nulla quis lorem. "
-"Nulla malesuada neque et dui. "
-"Phasellus malesuada ultricies odio. "
-"Phasellus vitae ligula. "
-"Pellentesque feugiat arcu at erat. "
-"Vivamus ut eros ut lorem pulvinar iaculis. "
-"Proin lobortis ipsum id nunc. "
-"Curabitur vel massa. "
-"Suspendisse nulla ipsum, malesuada vel, posuere eget, mollis at, risus. "
-"Vestibulum sed diam id est dapibus ultrices. "
-"Proin tempus, eros a scelerisque vestibulum, ipsum arcu aliquam mi, ut feugiat libero odio in nisl. "
-"Quisque et massa a mauris luctus congue. "
-"Ut id eros. "
-"Fusce ante eros, pharetra non, molestie tristique, bibendum sit amet, wisi. "
-"Phasellus rutrum, dolor et semper elementum, eros ante malesuada massa, sed sollicitudin lectus velit et massa. "
-"In auctor. "
-"Aliquam erat volutpat. "
-"Etiam risus leo, vulputate suscipit, sollicitudin et, sodales eget, nisl. "
-"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur lobortis, libero ac laoreet mollis, ligula leo porta wisi, ut euismod felis ligula id elit. "
-"Vivamus malesuada nulla eu enim. "
-"Donec accumsan faucibus orci. "
-"Nulla lacinia ante. "
-"Praesent at nibh. "
-"Mauris porta dignissim wisi. "
-"Ut lacinia tortor nec nunc. "
-"Phasellus et augue. "
-"Integer rhoncus, libero a pellentesque rhoncus, tortor sapien lobortis pede, eget condimentum sapien risus vitae elit. "
-"Suspendisse sed turpis ut dolor placerat dignissim. "
-"Quisque quis leo. "
-"Cras ultrices. "
-"Maecenas hendrerit auctor tortor. "
-"Etiam sit amet arcu. ";
diff --git a/source/blender/src/mainqueue.c b/source/blender/src/mainqueue.c
deleted file mode 100644
index 9e26ebb3a10..00000000000
--- a/source/blender/src/mainqueue.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Just the functions to maintain a central event
- * queue.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "BIF_mainqueue.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-typedef struct {
- unsigned short event;
- short val;
- char ascii;
-} QEvent;
-
-static QEvent mainqueue[MAXQUEUE];
-static unsigned int nevents= 0;
-
-unsigned short mainqread(short *val, char *ascii)
-{
- if (nevents) {
- nevents--;
-
- *val= mainqueue[nevents].val;
- *ascii= mainqueue[nevents].ascii;
- if((*ascii<32)||(*ascii==127)) *ascii=0;
- return mainqueue[nevents].event;
- } else
- return 0;
-}
-
-void mainqenter(unsigned short event, short val)
-{
- mainqenter_ext(event, val, 0);
-}
-
-void mainqenter_ext(unsigned short event, short val, char ascii)
-{
- if (!event)
- return;
-
- if (nevents<MAXQUEUE) {
- memmove(mainqueue+1, mainqueue, sizeof(*mainqueue)*nevents);
- mainqueue[0].event= event;
- mainqueue[0].val= val;
- mainqueue[0].ascii= ascii;
-
- nevents++;
- }
-}
-
-void mainqpushback(unsigned short event, short val, char ascii)
-{
- if (nevents<MAXQUEUE) {
- mainqueue[nevents].event= event;
- mainqueue[nevents].val= val;
- mainqueue[nevents].ascii= ascii;
- nevents++;
- }
-}
-
-unsigned short mainqtest()
-{
- if (nevents)
- return mainqueue[nevents-1].event;
- else
- return 0;
-}
diff --git a/source/blender/src/meshlaplacian.c b/source/blender/src/meshlaplacian.c
deleted file mode 100644
index 96349e8fb98..00000000000
--- a/source/blender/src/meshlaplacian.c
+++ /dev/null
@@ -1,1912 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * meshlaplacian.c: Algorithms using the mesh laplacian.
- */
-
-#include <math.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-
-#include "BLI_arithb.h"
-#include "BLI_edgehash.h"
-#include "BLI_memarena.h"
-
-#include "BKE_DerivedMesh.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editdeform.h"
-#include "BIF_meshlaplacian.h"
-#include "BIF_meshtools.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_headerbuttons.h"
-
-#ifdef RIGID_DEFORM
-#include "BLI_editVert.h"
-#include "BLI_polardecomp.h"
-#endif
-
-#include "RE_raytrace.h"
-
-#include "ONL_opennl.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/************************** Laplacian System *****************************/
-
-struct LaplacianSystem {
- NLContext context; /* opennl context */
-
- int totvert, totface;
-
- float **verts; /* vertex coordinates */
- float *varea; /* vertex weights for laplacian computation */
- char *vpinned; /* vertex pinning */
- int (*faces)[3]; /* face vertex indices */
- float (*fweights)[3]; /* cotangent weights per face */
-
- int areaweights; /* use area in cotangent weights? */
- int storeweights; /* store cotangent weights in fweights */
- int nlbegun; /* nlBegin(NL_SYSTEM/NL_MATRIX) done */
-
- EdgeHash *edgehash; /* edge hash for construction */
-
- struct HeatWeighting {
- Mesh *mesh;
- float (*verts)[3]; /* vertex coordinates */
- float (*vnors)[3]; /* vertex normals */
-
- float (*root)[3]; /* bone root */
- float (*tip)[3]; /* bone tip */
- int numbones;
-
- float *H; /* diagonal H matrix */
- float *p; /* values from all p vectors */
- float *mindist; /* minimum distance to a bone for all vertices */
-
- RayTree *raytree; /* ray tracing acceleration structure */
- MFace **vface; /* a face that the vertex belongs to */
- } heat;
-
-#ifdef RIGID_DEFORM
- struct RigidDeformation {
- EditMesh *mesh;
-
- float (*R)[3][3];
- float (*rhs)[3];
- float (*origco)[3];
- int thrownerror;
- } rigid;
-#endif
-};
-
-/* Laplacian matrix construction */
-
-/* Computation of these weights for the laplacian is based on:
- "Discrete Differential-Geometry Operators for Triangulated 2-Manifolds",
- Meyer et al, 2002. Section 3.5, formula (8).
-
- We do it a bit different by going over faces instead of going over each
- vertex and adjacent faces, since we don't store this adjacency. Also, the
- formulas are tweaked a bit to work for non-manifold meshes. */
-
-static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2)
-{
- void **p = BLI_edgehash_lookup_p(edgehash, v1, v2);
-
- if(p)
- *p = (void*)((intptr_t)*p + (intptr_t)1);
- else
- BLI_edgehash_insert(edgehash, v1, v2, (void*)(intptr_t)1);
-}
-
-static int laplacian_edge_count(EdgeHash *edgehash, int v1, int v2)
-{
- return (int)(intptr_t)BLI_edgehash_lookup(edgehash, v1, v2);
-}
-
-static float cotan_weight(float *v1, float *v2, float *v3)
-{
- float a[3], b[3], c[3], clen;
-
- VecSubf(a, v2, v1);
- VecSubf(b, v3, v1);
- Crossf(c, a, b);
-
- clen = VecLength(c);
-
- if (clen == 0.0f)
- return 0.0f;
-
- return Inpf(a, b)/clen;
-}
-
-static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3)
-{
- float t1, t2, t3, len1, len2, len3, area;
- float *varea= sys->varea, *v1, *v2, *v3;
- int obtuse = 0;
-
- v1= sys->verts[i1];
- v2= sys->verts[i2];
- v3= sys->verts[i3];
-
- t1= cotan_weight(v1, v2, v3);
- t2= cotan_weight(v2, v3, v1);
- t3= cotan_weight(v3, v1, v2);
-
- if(VecAngle3(v2, v1, v3) > 90) obtuse= 1;
- else if(VecAngle3(v1, v2, v3) > 90) obtuse= 2;
- else if(VecAngle3(v1, v3, v2) > 90) obtuse= 3;
-
- if (obtuse > 0) {
- area= AreaT3Dfl(v1, v2, v3);
-
- varea[i1] += (obtuse == 1)? area: area*0.5;
- varea[i2] += (obtuse == 2)? area: area*0.5;
- varea[i3] += (obtuse == 3)? area: area*0.5;
- }
- else {
- len1= VecLenf(v2, v3);
- len2= VecLenf(v1, v3);
- len3= VecLenf(v1, v2);
-
- t1 *= len1*len1;
- t2 *= len2*len2;
- t3 *= len3*len3;
-
- varea[i1] += (t2 + t3)*0.25f;
- varea[i2] += (t1 + t3)*0.25f;
- varea[i3] += (t1 + t2)*0.25f;
- }
-}
-
-static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int i2, int i3)
-{
- float t1, t2, t3;
- float *varea= sys->varea, *v1, *v2, *v3;
-
- v1= sys->verts[i1];
- v2= sys->verts[i2];
- v3= sys->verts[i3];
-
- /* instead of *0.5 we divided by the number of faces of the edge, it still
- needs to be verified that this is indeed the correct thing to do! */
- t1= cotan_weight(v1, v2, v3)/laplacian_edge_count(sys->edgehash, i2, i3);
- t2= cotan_weight(v2, v3, v1)/laplacian_edge_count(sys->edgehash, i3, i1);
- t3= cotan_weight(v3, v1, v2)/laplacian_edge_count(sys->edgehash, i1, i2);
-
- nlMatrixAdd(i1, i1, (t2+t3)*varea[i1]);
- nlMatrixAdd(i2, i2, (t1+t3)*varea[i2]);
- nlMatrixAdd(i3, i3, (t1+t2)*varea[i3]);
-
- nlMatrixAdd(i1, i2, -t3*varea[i1]);
- nlMatrixAdd(i2, i1, -t3*varea[i2]);
-
- nlMatrixAdd(i2, i3, -t1*varea[i2]);
- nlMatrixAdd(i3, i2, -t1*varea[i3]);
-
- nlMatrixAdd(i3, i1, -t2*varea[i3]);
- nlMatrixAdd(i1, i3, -t2*varea[i1]);
-
- if(sys->storeweights) {
- sys->fweights[f][0]= t1*varea[i1];
- sys->fweights[f][1]= t2*varea[i2];
- sys->fweights[f][2]= t3*varea[i3];
- }
-}
-
-LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface, int lsq)
-{
- LaplacianSystem *sys;
-
- sys= MEM_callocN(sizeof(LaplacianSystem), "LaplacianSystem");
-
- sys->verts= MEM_callocN(sizeof(float*)*totvert, "LaplacianSystemVerts");
- sys->vpinned= MEM_callocN(sizeof(char)*totvert, "LaplacianSystemVpinned");
- sys->faces= MEM_callocN(sizeof(int)*3*totface, "LaplacianSystemFaces");
-
- sys->totvert= 0;
- sys->totface= 0;
-
- sys->areaweights= 1;
- sys->storeweights= 0;
-
- /* create opennl context */
- nlNewContext();
- nlSolverParameteri(NL_NB_VARIABLES, totvert);
- if(lsq)
- nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
-
- sys->context= nlGetCurrent();
-
- return sys;
-}
-
-void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned)
-{
- sys->verts[sys->totvert]= co;
- sys->vpinned[sys->totvert]= pinned;
- sys->totvert++;
-}
-
-void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3)
-{
- sys->faces[sys->totface][0]= v1;
- sys->faces[sys->totface][1]= v2;
- sys->faces[sys->totface][2]= v3;
- sys->totface++;
-}
-
-void laplacian_system_construct_end(LaplacianSystem *sys)
-{
- int (*face)[3];
- int a, totvert=sys->totvert, totface=sys->totface;
-
- laplacian_begin_solve(sys, 0);
-
- sys->varea= MEM_callocN(sizeof(float)*totvert, "LaplacianSystemVarea");
-
- sys->edgehash= BLI_edgehash_new();
- for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
- laplacian_increase_edge_count(sys->edgehash, (*face)[0], (*face)[1]);
- laplacian_increase_edge_count(sys->edgehash, (*face)[1], (*face)[2]);
- laplacian_increase_edge_count(sys->edgehash, (*face)[2], (*face)[0]);
- }
-
- if(sys->areaweights)
- for(a=0, face=sys->faces; a<sys->totface; a++, face++)
- laplacian_triangle_area(sys, (*face)[0], (*face)[1], (*face)[2]);
-
- for(a=0; a<totvert; a++) {
- if(sys->areaweights) {
- if(sys->varea[a] != 0.0f)
- sys->varea[a]= 0.5f/sys->varea[a];
- }
- else
- sys->varea[a]= 1.0f;
-
- /* for heat weighting */
- if(sys->heat.H)
- nlMatrixAdd(a, a, sys->heat.H[a]);
- }
-
- if(sys->storeweights)
- sys->fweights= MEM_callocN(sizeof(float)*3*totface, "LaplacianFWeight");
-
- for(a=0, face=sys->faces; a<totface; a++, face++)
- laplacian_triangle_weights(sys, a, (*face)[0], (*face)[1], (*face)[2]);
-
- MEM_freeN(sys->faces);
- sys->faces= NULL;
-
- if(sys->varea) {
- MEM_freeN(sys->varea);
- sys->varea= NULL;
- }
-
- BLI_edgehash_free(sys->edgehash, NULL);
- sys->edgehash= NULL;
-}
-
-void laplacian_system_delete(LaplacianSystem *sys)
-{
- if(sys->verts) MEM_freeN(sys->verts);
- if(sys->varea) MEM_freeN(sys->varea);
- if(sys->vpinned) MEM_freeN(sys->vpinned);
- if(sys->faces) MEM_freeN(sys->faces);
- if(sys->fweights) MEM_freeN(sys->fweights);
-
- nlDeleteContext(sys->context);
- MEM_freeN(sys);
-}
-
-void laplacian_begin_solve(LaplacianSystem *sys, int index)
-{
- int a;
-
- if (!sys->nlbegun) {
- nlBegin(NL_SYSTEM);
-
- if(index >= 0) {
- for(a=0; a<sys->totvert; a++) {
- if(sys->vpinned[a]) {
- nlSetVariable(0, a, sys->verts[a][index]);
- nlLockVariable(a);
- }
- }
- }
-
- nlBegin(NL_MATRIX);
- sys->nlbegun = 1;
- }
-}
-
-void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value)
-{
- nlRightHandSideAdd(0, v, value);
-}
-
-int laplacian_system_solve(LaplacianSystem *sys)
-{
- nlEnd(NL_MATRIX);
- nlEnd(NL_SYSTEM);
- sys->nlbegun = 0;
-
- //nlPrintMatrix();
-
- return nlSolveAdvanced(NULL, NL_TRUE);
-}
-
-float laplacian_system_get_solution(int v)
-{
- return nlGetVariable(0, v);
-}
-
-/************************* Heat Bone Weighting ******************************/
-/* From "Automatic Rigging and Animation of 3D Characters"
- Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */
-
-#define C_WEIGHT 1.0f
-#define WEIGHT_LIMIT_START 0.05f
-#define WEIGHT_LIMIT_END 0.025f
-#define DISTANCE_EPSILON 1e-4f
-
-/* Raytracing for vertex to bone visibility */
-
-static LaplacianSystem *HeatSys = NULL;
-
-static void heat_ray_coords_func(RayFace *face, float **v1, float **v2, float **v3, float **v4)
-{
- MFace *mface= (MFace*)face;
- float (*verts)[3]= HeatSys->heat.verts;
-
- *v1= verts[mface->v1];
- *v2= verts[mface->v2];
- *v3= verts[mface->v3];
- *v4= (mface->v4)? verts[mface->v4]: NULL;
-}
-
-static int heat_ray_check_func(Isect *is, int ob, RayFace *face)
-{
- float *v1, *v2, *v3, *v4, nor[3];
-
- /* don't intersect if the ray faces along the face normal */
- heat_ray_coords_func(face, &v1, &v2, &v3, &v4);
-
- if(v4) CalcNormFloat4(v1, v2, v3, v4, nor);
- else CalcNormFloat(v1, v2, v3, nor);
-
- return (INPR(nor, is->vec) < 0);
-}
-
-static void heat_ray_tree_create(LaplacianSystem *sys)
-{
- Mesh *me = sys->heat.mesh;
- RayTree *tree;
- MFace *mface;
- float min[3], max[3];
- int a;
-
- /* create a raytrace tree from the mesh */
- INIT_MINMAX(min, max);
-
- for(a=0; a<me->totvert; a++)
- DO_MINMAX(sys->heat.verts[a], min, max);
-
- tree= RE_ray_tree_create(64, me->totface, min, max,
- heat_ray_coords_func, heat_ray_check_func, NULL, NULL);
-
- sys->heat.vface= MEM_callocN(sizeof(MFace*)*me->totvert, "HeatVFaces");
-
- HeatSys= sys;
-
- for(a=0, mface=me->mface; a<me->totface; a++, mface++) {
- RE_ray_tree_add_face(tree, 0, mface);
-
- sys->heat.vface[mface->v1]= mface;
- sys->heat.vface[mface->v2]= mface;
- sys->heat.vface[mface->v3]= mface;
- if(mface->v4) sys->heat.vface[mface->v4]= mface;
- }
-
- HeatSys= NULL;
-
- RE_ray_tree_done(tree);
-
- sys->heat.raytree= tree;
-}
-
-static int heat_ray_bone_visible(LaplacianSystem *sys, int vertex, int bone)
-{
- Isect isec;
- MFace *mface;
- float dir[3];
- int visible;
-
- mface= sys->heat.vface[vertex];
- if(!mface)
- return 1;
-
- /* setup isec */
- memset(&isec, 0, sizeof(isec));
- isec.mode= RE_RAY_SHADOW;
- isec.lay= -1;
- isec.face_last= NULL;
- isec.faceorig= mface;
-
- VECCOPY(isec.start, sys->heat.verts[vertex]);
- PclosestVL3Dfl(isec.end, isec.start,
- sys->heat.root[bone], sys->heat.tip[bone]);
-
- /* add an extra offset to the start position to avoid self intersection */
- VECSUB(dir, isec.end, isec.start);
- Normalize(dir);
- VecMulf(dir, 1e-5);
- VecAddf(isec.start, isec.start, dir);
-
- HeatSys= sys;
- visible= !RE_ray_tree_intersect(sys->heat.raytree, &isec);
- HeatSys= NULL;
-
- return visible;
-}
-
-static float heat_bone_distance(LaplacianSystem *sys, int vertex, int bone)
-{
- float closest[3], d[3], dist, cosine;
-
- /* compute euclidian distance */
- PclosestVL3Dfl(closest, sys->heat.verts[vertex],
- sys->heat.root[bone], sys->heat.tip[bone]);
-
- VecSubf(d, sys->heat.verts[vertex], closest);
- dist= Normalize(d);
-
- /* if the vertex normal does not point along the bone, increase distance */
- cosine= INPR(d, sys->heat.vnors[vertex]);
-
- return dist/(0.5f*(cosine + 1.001f));
-}
-
-static int heat_bone_closest(LaplacianSystem *sys, int vertex, int bone)
-{
- float dist;
-
- dist= heat_bone_distance(sys, vertex, bone);
-
- if(dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON))
- if(heat_ray_bone_visible(sys, vertex, bone))
- return 1;
-
- return 0;
-}
-
-static void heat_set_H(LaplacianSystem *sys, int vertex)
-{
- float dist, mindist, h;
- int j, numclosest = 0;
-
- mindist= 1e10;
-
- /* compute minimum distance */
- for(j=0; j<sys->heat.numbones; j++) {
- dist= heat_bone_distance(sys, vertex, j);
-
- if(dist < mindist)
- mindist= dist;
- }
-
- sys->heat.mindist[vertex]= mindist;
-
- /* count number of bones with approximately this minimum distance */
- for(j=0; j<sys->heat.numbones; j++)
- if(heat_bone_closest(sys, vertex, j))
- numclosest++;
-
- sys->heat.p[vertex]= (numclosest > 0)? 1.0f/numclosest: 0.0f;
-
- /* compute H entry */
- if(numclosest > 0) {
- if(mindist > 1e-5)
- h= numclosest*C_WEIGHT/(mindist*mindist);
- else
- h= 1e10f;
- }
- else
- h= 0.0f;
-
- sys->heat.H[vertex]= h;
-}
-
-void heat_calc_vnormals(LaplacianSystem *sys)
-{
- float fnor[3];
- int a, v1, v2, v3, (*face)[3];
-
- sys->heat.vnors= MEM_callocN(sizeof(float)*3*sys->totvert, "HeatVNors");
-
- for(a=0, face=sys->faces; a<sys->totface; a++, face++) {
- v1= (*face)[0];
- v2= (*face)[1];
- v3= (*face)[2];
-
- CalcNormFloat(sys->verts[v1], sys->verts[v2], sys->verts[v3], fnor);
-
- VecAddf(sys->heat.vnors[v1], sys->heat.vnors[v1], fnor);
- VecAddf(sys->heat.vnors[v2], sys->heat.vnors[v2], fnor);
- VecAddf(sys->heat.vnors[v3], sys->heat.vnors[v3], fnor);
- }
-
- for(a=0; a<sys->totvert; a++)
- Normalize(sys->heat.vnors[a]);
-}
-
-static void heat_laplacian_create(LaplacianSystem *sys)
-{
- Mesh *me = sys->heat.mesh;
- MFace *mface;
- int a;
-
- /* heat specific definitions */
- sys->heat.mindist= MEM_callocN(sizeof(float)*me->totvert, "HeatMinDist");
- sys->heat.H= MEM_callocN(sizeof(float)*me->totvert, "HeatH");
- sys->heat.p= MEM_callocN(sizeof(float)*me->totvert, "HeatP");
-
- /* add verts and faces to laplacian */
- for(a=0; a<me->totvert; a++)
- laplacian_add_vertex(sys, sys->heat.verts[a], 0);
-
- for(a=0, mface=me->mface; a<me->totface; a++, mface++) {
- laplacian_add_triangle(sys, mface->v1, mface->v2, mface->v3);
- if(mface->v4)
- laplacian_add_triangle(sys, mface->v1, mface->v3, mface->v4);
- }
-
- /* for distance computation in set_H */
- heat_calc_vnormals(sys);
-
- for(a=0; a<me->totvert; a++)
- heat_set_H(sys, a);
-}
-
-static float heat_limit_weight(float weight)
-{
- float t;
-
- if(weight < WEIGHT_LIMIT_END) {
- return 0.0f;
- }
- else if(weight < WEIGHT_LIMIT_START) {
- t= (weight - WEIGHT_LIMIT_END)/(WEIGHT_LIMIT_START - WEIGHT_LIMIT_END);
- return t*WEIGHT_LIMIT_START;
- }
- else
- return weight;
-}
-
-void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected)
-{
- LaplacianSystem *sys;
- MFace *mface;
- float solution, weight;
- int *vertsflipped = NULL;
- int a, totface, j, bbone, firstsegment, lastsegment, thrownerror = 0;
-
- /* count triangles */
- for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) {
- totface++;
- if(mface->v4) totface++;
- }
-
- /* create laplacian */
- sys = laplacian_system_construct_begin(me->totvert, totface, 1);
-
- sys->heat.mesh= me;
- sys->heat.verts= verts;
- sys->heat.root= root;
- sys->heat.tip= tip;
- sys->heat.numbones= numbones;
-
- heat_ray_tree_create(sys);
- heat_laplacian_create(sys);
-
- laplacian_system_construct_end(sys);
-
- if(dgroupflip) {
- vertsflipped = MEM_callocN(sizeof(int)*me->totvert, "vertsflipped");
- for(a=0; a<me->totvert; a++)
- vertsflipped[a] = mesh_get_x_mirror_vert(ob, a);
- }
-
- /* compute weights per bone */
- for(j=0; j<numbones; j++) {
- if(!selected[j])
- continue;
-
- firstsegment= (j == 0 || dgrouplist[j-1] != dgrouplist[j]);
- lastsegment= (j == numbones-1 || dgrouplist[j] != dgrouplist[j+1]);
- bbone= !(firstsegment && lastsegment);
-
- /* clear weights */
- if(bbone && firstsegment) {
- for(a=0; a<me->totvert; a++) {
- remove_vert_defgroup(ob, dgrouplist[j], a);
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0)
- remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
- }
- }
-
- /* fill right hand side */
- laplacian_begin_solve(sys, -1);
-
- for(a=0; a<me->totvert; a++)
- if(heat_bone_closest(sys, a, j))
- laplacian_add_right_hand_side(sys, a,
- sys->heat.H[a]*sys->heat.p[a]);
-
- /* solve */
- if(laplacian_system_solve(sys)) {
- /* load solution into vertex groups */
- for(a=0; a<me->totvert; a++) {
- solution= laplacian_system_get_solution(a);
-
- if(bbone) {
- if(solution > 0.0f)
- add_vert_to_defgroup(ob, dgrouplist[j], a, solution,
- WEIGHT_ADD);
- }
- else {
- weight= heat_limit_weight(solution);
- if(weight > 0.0f)
- add_vert_to_defgroup(ob, dgrouplist[j], a, weight,
- WEIGHT_REPLACE);
- else
- remove_vert_defgroup(ob, dgrouplist[j], a);
- }
-
- /* do same for mirror */
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
- if(bbone) {
- if(solution > 0.0f)
- add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a],
- solution, WEIGHT_ADD);
- }
- else {
- weight= heat_limit_weight(solution);
- if(weight > 0.0f)
- add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a],
- weight, WEIGHT_REPLACE);
- else
- remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
- }
- }
- }
- }
- else if(!thrownerror) {
- error("Bone Heat Weighting:"
- " failed to find solution for one or more bones");
- thrownerror= 1;
- break;
- }
-
- /* remove too small vertex weights */
- if(bbone && lastsegment) {
- for(a=0; a<me->totvert; a++) {
- weight= get_vert_defgroup(ob, dgrouplist[j], a);
- weight= heat_limit_weight(weight);
- if(weight <= 0.0f)
- remove_vert_defgroup(ob, dgrouplist[j], a);
-
- if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) {
- weight= get_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
- weight= heat_limit_weight(weight);
- if(weight <= 0.0f)
- remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]);
- }
- }
- }
- }
-
- /* free */
- if(vertsflipped) MEM_freeN(vertsflipped);
-
- RE_ray_tree_free(sys->heat.raytree);
- MEM_freeN(sys->heat.vface);
-
- MEM_freeN(sys->heat.mindist);
- MEM_freeN(sys->heat.H);
- MEM_freeN(sys->heat.p);
- MEM_freeN(sys->heat.vnors);
-
- laplacian_system_delete(sys);
-}
-
-#ifdef RIGID_DEFORM
-/********************** As-Rigid-As-Possible Deformation ******************/
-/* From "As-Rigid-As-Possible Surface Modeling",
- Olga Sorkine and Marc Alexa, ESGP 2007. */
-
-/* investigate:
- - transpose R in orthogonal
- - flipped normals and per face adding
- - move cancelling to transform, make origco pointer
-*/
-
-static LaplacianSystem *RigidDeformSystem = NULL;
-
-static void rigid_add_half_edge_to_R(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w)
-{
- float e[3], e_[3];
- int i;
-
- VecSubf(e, sys->rigid.origco[v1->tmp.l], sys->rigid.origco[v2->tmp.l]);
- VecSubf(e_, v1->co, v2->co);
-
- /* formula (5) */
- for (i=0; i<3; i++) {
- sys->rigid.R[v1->tmp.l][i][0] += w*e[0]*e_[i];
- sys->rigid.R[v1->tmp.l][i][1] += w*e[1]*e_[i];
- sys->rigid.R[v1->tmp.l][i][2] += w*e[2]*e_[i];
- }
-}
-
-static void rigid_add_edge_to_R(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w)
-{
- rigid_add_half_edge_to_R(sys, v1, v2, w);
- rigid_add_half_edge_to_R(sys, v2, v1, w);
-}
-
-static void rigid_orthogonalize_R(float R[][3])
-{
- HMatrix M, Q, S;
-
- Mat4CpyMat3(M, R);
- polar_decomp(M, Q, S);
- Mat3CpyMat4(R, Q);
-}
-
-static void rigid_add_half_edge_to_rhs(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w)
-{
- /* formula (8) */
- float Rsum[3][3], rhs[3];
-
- if (sys->vpinned[v1->tmp.l])
- return;
-
- Mat3AddMat3(Rsum, sys->rigid.R[v1->tmp.l], sys->rigid.R[v2->tmp.l]);
- Mat3Transp(Rsum);
-
- VecSubf(rhs, sys->rigid.origco[v1->tmp.l], sys->rigid.origco[v2->tmp.l]);
- Mat3MulVecfl(Rsum, rhs);
- VecMulf(rhs, 0.5f);
- VecMulf(rhs, w);
-
- VecAddf(sys->rigid.rhs[v1->tmp.l], sys->rigid.rhs[v1->tmp.l], rhs);
-}
-
-static void rigid_add_edge_to_rhs(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w)
-{
- rigid_add_half_edge_to_rhs(sys, v1, v2, w);
- rigid_add_half_edge_to_rhs(sys, v2, v1, w);
-}
-
-void rigid_deform_iteration()
-{
- LaplacianSystem *sys= RigidDeformSystem;
- EditMesh *em;
- EditVert *eve;
- EditFace *efa;
- int a, i;
-
- if(!sys)
- return;
-
- nlMakeCurrent(sys->context);
- em= sys->rigid.mesh;
-
- /* compute R */
- memset(sys->rigid.R, 0, sizeof(float)*3*3*sys->totvert);
- memset(sys->rigid.rhs, 0, sizeof(float)*3*sys->totvert);
-
- for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
- rigid_add_edge_to_R(sys, efa->v1, efa->v2, sys->fweights[a][2]);
- rigid_add_edge_to_R(sys, efa->v2, efa->v3, sys->fweights[a][0]);
- rigid_add_edge_to_R(sys, efa->v3, efa->v1, sys->fweights[a][1]);
-
- if(efa->v4) {
- a++;
- rigid_add_edge_to_R(sys, efa->v1, efa->v3, sys->fweights[a][2]);
- rigid_add_edge_to_R(sys, efa->v3, efa->v4, sys->fweights[a][0]);
- rigid_add_edge_to_R(sys, efa->v4, efa->v1, sys->fweights[a][1]);
- }
- }
-
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
- rigid_orthogonalize_R(sys->rigid.R[a]);
- eve->tmp.l= a;
- }
-
- /* compute right hand sides for solving */
- for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) {
- rigid_add_edge_to_rhs(sys, efa->v1, efa->v2, sys->fweights[a][2]);
- rigid_add_edge_to_rhs(sys, efa->v2, efa->v3, sys->fweights[a][0]);
- rigid_add_edge_to_rhs(sys, efa->v3, efa->v1, sys->fweights[a][1]);
-
- if(efa->v4) {
- a++;
- rigid_add_edge_to_rhs(sys, efa->v1, efa->v3, sys->fweights[a][2]);
- rigid_add_edge_to_rhs(sys, efa->v3, efa->v4, sys->fweights[a][0]);
- rigid_add_edge_to_rhs(sys, efa->v4, efa->v1, sys->fweights[a][1]);
- }
- }
-
- /* solve for positions, for X,Y and Z separately */
- for(i=0; i<3; i++) {
- laplacian_begin_solve(sys, i);
-
- for(a=0; a<sys->totvert; a++)
- if(!sys->vpinned[a])
- laplacian_add_right_hand_side(sys, a, sys->rigid.rhs[a][i]);
-
- if(laplacian_system_solve(sys)) {
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
- eve->co[i]= laplacian_system_get_solution(a);
- }
- else {
- if(!sys->rigid.thrownerror) {
- error("RigidDeform: failed to find solution.");
- sys->rigid.thrownerror= 1;
- }
- break;
- }
- }
-}
-
-static void rigid_laplacian_create(LaplacianSystem *sys)
-{
- EditMesh *em = sys->rigid.mesh;
- EditVert *eve;
- EditFace *efa;
- int a;
-
- /* add verts and faces to laplacian */
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
- laplacian_add_vertex(sys, eve->co, eve->pinned);
- eve->tmp.l= a;
- }
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- laplacian_add_triangle(sys,
- efa->v1->tmp.l, efa->v2->tmp.l, efa->v3->tmp.l);
- if(efa->v4)
- laplacian_add_triangle(sys,
- efa->v1->tmp.l, efa->v3->tmp.l, efa->v4->tmp.l);
- }
-}
-
-void rigid_deform_begin(EditMesh *em)
-{
- LaplacianSystem *sys;
- EditVert *eve;
- EditFace *efa;
- int a, totvert, totface;
-
- /* count vertices, triangles */
- for(totvert=0, eve=em->verts.first; eve; eve=eve->next)
- totvert++;
-
- for(totface=0, efa=em->faces.first; efa; efa=efa->next) {
- totface++;
- if(efa->v4) totface++;
- }
-
- /* create laplacian */
- sys = laplacian_system_construct_begin(totvert, totface, 0);
-
- sys->rigid.mesh= em;
- sys->rigid.R = MEM_callocN(sizeof(float)*3*3*totvert, "RigidDeformR");
- sys->rigid.rhs = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformRHS");
- sys->rigid.origco = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformCo");
-
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
- VecCopyf(sys->rigid.origco[a], eve->co);
-
- sys->areaweights= 0;
- sys->storeweights= 1;
-
- rigid_laplacian_create(sys);
-
- laplacian_system_construct_end(sys);
-
- RigidDeformSystem = sys;
-}
-
-void rigid_deform_end(int cancel)
-{
- LaplacianSystem *sys = RigidDeformSystem;
-
- if(sys) {
- EditMesh *em = sys->rigid.mesh;
- EditVert *eve;
- int a;
-
- if(cancel)
- for(a=0, eve=em->verts.first; eve; eve=eve->next, a++)
- if(!eve->pinned)
- VecCopyf(eve->co, sys->rigid.origco[a]);
-
- if(sys->rigid.R) MEM_freeN(sys->rigid.R);
- if(sys->rigid.rhs) MEM_freeN(sys->rigid.rhs);
- if(sys->rigid.origco) MEM_freeN(sys->rigid.origco);
-
- /* free */
- laplacian_system_delete(sys);
- }
-
- RigidDeformSystem = NULL;
-}
-#endif
-
-/************************** Harmonic Coordinates ****************************/
-/* From "Harmonic Coordinates for Character Articulation",
- Pushkar Joshi, Mark Meyer, Tony DeRose, Brian Green and Tom Sanocki,
- SIGGRAPH 2007. */
-
-#define EPSILON 0.0001f
-
-#define MESHDEFORM_TAG_UNTYPED 0
-#define MESHDEFORM_TAG_BOUNDARY 1
-#define MESHDEFORM_TAG_INTERIOR 2
-#define MESHDEFORM_TAG_EXTERIOR 3
-
-#define MESHDEFORM_LEN_THRESHOLD 1e-6
-
-#define MESHDEFORM_MIN_INFLUENCE 0.0005
-
-static int MESHDEFORM_OFFSET[7][3] =
- {{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}};
-
-typedef struct MDefBoundIsect {
- float co[3], uvw[4];
- int nvert, v[4], facing;
- float len;
-} MDefBoundIsect;
-
-typedef struct MDefBindInfluence {
- struct MDefBindInfluence *next;
- float weight;
- int vertex;
-} MDefBindInfluence;
-
-typedef struct MeshDeformBind {
- /* grid dimensions */
- float min[3], max[3];
- float width[3], halfwidth[3];
- int size, size3;
-
- /* meshes */
- DerivedMesh *cagedm;
- float (*cagecos)[3];
- float (*vertexcos)[3];
- int totvert, totcagevert;
-
- /* grids */
- MemArena *memarena;
- MDefBoundIsect *(*boundisect)[6];
- int *semibound;
- int *tag;
- float *phi, *totalphi;
-
- /* mesh stuff */
- int *inside;
- float *weights;
- MDefBindInfluence **dyngrid;
- float cagemat[4][4];
-
- /* direct solver */
- int *varidx;
-
- /* raytrace */
- RayTree *raytree;
-} MeshDeformBind;
-
-/* ray intersection */
-
-/* our own triangle intersection, so we can fully control the epsilons and
- * prevent corner case from going wrong*/
-static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
- float vert1[3], float vert2[3], float *isectco, float *uvw)
-{
- float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3];
- float det,inv_det, u, v, dir[3], isectdir[3];
-
- VECSUB(dir, end, orig);
-
- /* find vectors for two edges sharing vert0 */
- VECSUB(edge1, vert1, vert0);
- VECSUB(edge2, vert2, vert0);
-
- /* begin calculating determinant - also used to calculate U parameter */
- Crossf(pvec, dir, edge2);
-
- /* if determinant is near zero, ray lies in plane of triangle */
- det = INPR(edge1, pvec);
-
- if (det == 0.0f)
- return 0;
- inv_det = 1.0f / det;
-
- /* calculate distance from vert0 to ray origin */
- VECSUB(tvec, orig, vert0);
-
- /* calculate U parameter and test bounds */
- u = INPR(tvec, pvec) * inv_det;
- if (u < -EPSILON || u > 1.0f+EPSILON)
- return 0;
-
- /* prepare to test V parameter */
- Crossf(qvec, tvec, edge1);
-
- /* calculate V parameter and test bounds */
- v = INPR(dir, qvec) * inv_det;
- if (v < -EPSILON || u + v > 1.0f+EPSILON)
- return 0;
-
- isectco[0]= (1.0f - u - v)*vert0[0] + u*vert1[0] + v*vert2[0];
- isectco[1]= (1.0f - u - v)*vert0[1] + u*vert1[1] + v*vert2[1];
- isectco[2]= (1.0f - u - v)*vert0[2] + u*vert1[2] + v*vert2[2];
-
- uvw[0]= 1.0 - u - v;
- uvw[1]= u;
- uvw[2]= v;
-
- /* check if it is within the length of the line segment */
- VECSUB(isectdir, isectco, orig);
-
- if(INPR(dir, isectdir) < -EPSILON)
- return 0;
-
- if(INPR(dir, dir) + EPSILON < INPR(isectdir, isectdir))
- return 0;
-
- return 1;
-}
-
-/* blender's raytracer is not use now, even though it is much faster. it can
- * give problems with rays falling through, so we use our own intersection
- * function above with tweaked epsilons */
-
-#if 0
-static MeshDeformBind *MESHDEFORM_BIND = NULL;
-
-static void meshdeform_ray_coords_func(RayFace *face, float **v1, float **v2, float **v3, float **v4)
-{
- MFace *mface= (MFace*)face;
- float (*cagecos)[3]= MESHDEFORM_BIND->cagecos;
-
- *v1= cagecos[mface->v1];
- *v2= cagecos[mface->v2];
- *v3= cagecos[mface->v3];
- *v4= (mface->v4)? cagecos[mface->v4]: NULL;
-}
-
-static int meshdeform_ray_check_func(Isect *is, RayFace *face)
-{
- return 1;
-}
-
-static void meshdeform_ray_tree_create(MeshDeformBind *mdb)
-{
- MFace *mface;
- float min[3], max[3];
- int a, totface;
-
- /* create a raytrace tree from the mesh */
- INIT_MINMAX(min, max);
-
- for(a=0; a<mdb->totcagevert; a++)
- DO_MINMAX(mdb->cagecos[a], min, max)
-
- MESHDEFORM_BIND= mdb;
-
- mface= mdb->cagedm->getFaceArray(mdb->cagedm);
- totface= mdb->cagedm->getNumFaces(mdb->cagedm);
-
- mdb->raytree= RE_ray_tree_create(64, totface, min, max,
- meshdeform_ray_coords_func, meshdeform_ray_check_func);
-
- for(a=0; a<totface; a++, mface++)
- RE_ray_tree_add_face(mdb->raytree, mface);
-
- RE_ray_tree_done(mdb->raytree);
-}
-
-static void meshdeform_ray_tree_free(MeshDeformBind *mdb)
-{
- MESHDEFORM_BIND= NULL;
- RE_ray_tree_free(mdb->raytree);
-}
-#endif
-
-static int meshdeform_intersect(MeshDeformBind *mdb, Isect *isec)
-{
- MFace *mface;
- float face[4][3], co[3], uvw[3], len, nor[3];
- int f, hit, is= 0, totface;
-
- isec->labda= 1e10;
-
- mface= mdb->cagedm->getFaceArray(mdb->cagedm);
- totface= mdb->cagedm->getNumFaces(mdb->cagedm);
-
- for(f=0; f<totface; f++, mface++) {
- VECCOPY(face[0], mdb->cagecos[mface->v1]);
- VECCOPY(face[1], mdb->cagecos[mface->v2]);
- VECCOPY(face[2], mdb->cagecos[mface->v3]);
-
- if(mface->v4) {
- VECCOPY(face[3], mdb->cagecos[mface->v4]);
- hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[1], face[2], co, uvw);
-
- if(hit) {
- CalcNormFloat(face[0], face[1], face[2], nor);
- }
- else {
- hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[2], face[3], co, uvw);
- CalcNormFloat(face[0], face[2], face[3], nor);
- }
- }
- else {
- hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[1], face[2], co, uvw);
- CalcNormFloat(face[0], face[1], face[2], nor);
- }
-
- if(hit) {
- len= VecLenf(isec->start, co)/VecLenf(isec->start, isec->end);
- if(len < isec->labda) {
- isec->labda= len;
- isec->face= mface;
- isec->isect= (INPR(isec->vec, nor) <= 0.0f);
- is= 1;
- }
- }
- }
-
- return is;
-}
-
-static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float *co1, float *co2)
-{
- MDefBoundIsect *isect;
- Isect isec;
- float (*cagecos)[3];
- MFace *mface;
- float vert[4][3], len;
- static float epsilon[3]= {0, 0, 0}; //1e-4, 1e-4, 1e-4};
-
- /* setup isec */
- memset(&isec, 0, sizeof(isec));
- isec.mode= RE_RAY_MIRROR; /* we want the closest intersection */
- isec.lay= -1;
- isec.face_last= NULL;
- isec.faceorig= NULL;
- isec.labda= 1e10f;
-
- VECADD(isec.start, co1, epsilon);
- VECADD(isec.end, co2, epsilon);
- VECSUB(isec.vec, isec.end, isec.start);
-
-#if 0
- /*if(RE_ray_tree_intersect(mdb->raytree, &isec)) {*/
-#endif
-
- if(meshdeform_intersect(mdb, &isec)) {
- len= isec.labda;
- mface= isec.face;
-
- /* create MDefBoundIsect */
- isect= BLI_memarena_alloc(mdb->memarena, sizeof(*isect));
-
- /* compute intersection coordinate */
- isect->co[0]= co1[0] + isec.vec[0]*len;
- isect->co[1]= co1[1] + isec.vec[1]*len;
- isect->co[2]= co1[2] + isec.vec[2]*len;
-
- isect->len= VecLenf(co1, isect->co);
- if(isect->len < MESHDEFORM_LEN_THRESHOLD)
- isect->len= MESHDEFORM_LEN_THRESHOLD;
-
- isect->v[0]= mface->v1;
- isect->v[1]= mface->v2;
- isect->v[2]= mface->v3;
- isect->v[3]= mface->v4;
- isect->nvert= (mface->v4)? 4: 3;
-
- isect->facing= isec.isect;
-
- /* compute mean value coordinates for interpolation */
- cagecos= mdb->cagecos;
- VECCOPY(vert[0], cagecos[mface->v1]);
- VECCOPY(vert[1], cagecos[mface->v2]);
- VECCOPY(vert[2], cagecos[mface->v3]);
- if(mface->v4) VECCOPY(vert[3], cagecos[mface->v4]);
- MeanValueWeights(vert, isect->nvert, isect->co, isect->uvw);
-
- return isect;
- }
-
- return NULL;
-}
-
-static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co)
-{
- MDefBoundIsect *isect;
- float outside[3], start[3], dir[3];
- int i, counter;
-
- for(i=1; i<=6; i++) {
- counter = 0;
-
- outside[0] = co[0] + (mdb->max[0] - mdb->min[0] + 1.0f)*MESHDEFORM_OFFSET[i][0];
- outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1];
- outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2];
-
- VECCOPY(start, co);
- VECSUB(dir, outside, start);
- Normalize(dir);
-
- isect = meshdeform_ray_tree_intersect(mdb, start, outside);
- if(isect && !isect->facing)
- return 1;
- }
-
- return 0;
-}
-
-/* solving */
-
-static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n)
-{
- int size= mdb->size;
-
- x += MESHDEFORM_OFFSET[n][0];
- y += MESHDEFORM_OFFSET[n][1];
- z += MESHDEFORM_OFFSET[n][2];
-
- if(x < 0 || x >= mdb->size)
- return -1;
- if(y < 0 || y >= mdb->size)
- return -1;
- if(z < 0 || z >= mdb->size)
- return -1;
-
- return x + y*size + z*size*size;
-}
-
-static void meshdeform_cell_center(MeshDeformBind *mdb, int x, int y, int z, int n, float *center)
-{
- x += MESHDEFORM_OFFSET[n][0];
- y += MESHDEFORM_OFFSET[n][1];
- z += MESHDEFORM_OFFSET[n][2];
-
- center[0]= mdb->min[0] + x*mdb->width[0] + mdb->halfwidth[0];
- center[1]= mdb->min[1] + y*mdb->width[1] + mdb->halfwidth[1];
- center[2]= mdb->min[2] + z*mdb->width[2] + mdb->halfwidth[2];
-}
-
-static void meshdeform_add_intersections(MeshDeformBind *mdb, int x, int y, int z)
-{
- MDefBoundIsect *isect;
- float center[3], ncenter[3];
- int i, a;
-
- a= meshdeform_index(mdb, x, y, z, 0);
- meshdeform_cell_center(mdb, x, y, z, 0, center);
-
- /* check each outgoing edge for intersection */
- for(i=1; i<=6; i++) {
- if(meshdeform_index(mdb, x, y, z, i) == -1)
- continue;
-
- meshdeform_cell_center(mdb, x, y, z, i, ncenter);
-
- isect= meshdeform_ray_tree_intersect(mdb, center, ncenter);
- if(isect) {
- mdb->boundisect[a][i-1]= isect;
- mdb->tag[a]= MESHDEFORM_TAG_BOUNDARY;
- }
- }
-}
-
-static void meshdeform_bind_floodfill(MeshDeformBind *mdb)
-{
- int *stack, *tag= mdb->tag;
- int a, b, i, xyz[3], stacksize, size= mdb->size;
-
- stack= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformBindStack");
-
- /* we know lower left corner is EXTERIOR because of padding */
- tag[0]= MESHDEFORM_TAG_EXTERIOR;
- stack[0]= 0;
- stacksize= 1;
-
- /* floodfill exterior tag */
- while(stacksize > 0) {
- a= stack[--stacksize];
-
- xyz[2]= a/(size*size);
- xyz[1]= (a - xyz[2]*size*size)/size;
- xyz[0]= a - xyz[1]*size - xyz[2]*size*size;
-
- for(i=1; i<=6; i++) {
- b= meshdeform_index(mdb, xyz[0], xyz[1], xyz[2], i);
-
- if(b != -1) {
- if(tag[b] == MESHDEFORM_TAG_UNTYPED ||
- (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i-1])) {
- tag[b]= MESHDEFORM_TAG_EXTERIOR;
- stack[stacksize++]= b;
- }
- }
- }
- }
-
- /* other cells are interior */
- for(a=0; a<size*size*size; a++)
- if(tag[a]==MESHDEFORM_TAG_UNTYPED)
- tag[a]= MESHDEFORM_TAG_INTERIOR;
-
-#if 0
- {
- int tb, ti, te, ts;
- tb= ti= te= ts= 0;
- for(a=0; a<size*size*size; a++)
- if(tag[a]==MESHDEFORM_TAG_BOUNDARY)
- tb++;
- else if(tag[a]==MESHDEFORM_TAG_INTERIOR)
- ti++;
- else if(tag[a]==MESHDEFORM_TAG_EXTERIOR) {
- te++;
-
- if(mdb->semibound[a])
- ts++;
- }
-
- printf("interior %d exterior %d boundary %d semi-boundary %d\n", ti, te, tb, ts);
- }
-#endif
-
- MEM_freeN(stack);
-}
-
-static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, int cagevert)
-{
- int a;
-
- for(a=0; a<isect->nvert; a++)
- if(isect->v[a] == cagevert)
- return isect->uvw[a];
-
- return 0.0f;
-}
-
-static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *vec, int cagevert)
-{
- float dvec[3], ivec[3], wx, wy, wz, result=0.0f;
- float weight, totweight= 0.0f;
- int i, a, x, y, z;
-
- for(i=0; i<3; i++) {
- ivec[i]= (int)gridvec[i];
- dvec[i]= gridvec[i] - ivec[i];
- }
-
- for(i=0; i<8; i++) {
- if(i & 1) { x= ivec[0]+1; wx= dvec[0]; }
- else { x= ivec[0]; wx= 1.0f-dvec[0]; }
-
- if(i & 2) { y= ivec[1]+1; wy= dvec[1]; }
- else { y= ivec[1]; wy= 1.0f-dvec[1]; }
-
- if(i & 4) { z= ivec[2]+1; wz= dvec[2]; }
- else { z= ivec[2]; wz= 1.0f-dvec[2]; }
-
- CLAMP(x, 0, mdb->size-1);
- CLAMP(y, 0, mdb->size-1);
- CLAMP(z, 0, mdb->size-1);
-
- a= meshdeform_index(mdb, x, y, z, 0);
- weight= wx*wy*wz;
- result += weight*mdb->phi[a];
- totweight += weight;
- }
-
- if(totweight > 0.0f)
- result /= totweight;
-
- return result;
-}
-
-static void meshdeform_check_semibound(MeshDeformBind *mdb, int x, int y, int z)
-{
- int i, a;
-
- a= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR)
- return;
-
- for(i=1; i<=6; i++)
- if(mdb->boundisect[a][i-1])
- mdb->semibound[a]= 1;
-}
-
-static float meshdeform_boundary_total_weight(MeshDeformBind *mdb, int x, int y, int z)
-{
- float weight, totweight= 0.0f;
- int i, a;
-
- a= meshdeform_index(mdb, x, y, z, 0);
-
- /* count weight for neighbour cells */
- for(i=1; i<=6; i++) {
- if(meshdeform_index(mdb, x, y, z, i) == -1)
- continue;
-
- if(mdb->boundisect[a][i-1])
- weight= 1.0f/mdb->boundisect[a][i-1]->len;
- else if(!mdb->semibound[a])
- weight= 1.0f/mdb->width[0];
- else
- weight= 0.0f;
-
- totweight += weight;
- }
-
- return totweight;
-}
-
-static void meshdeform_matrix_add_cell(MeshDeformBind *mdb, int x, int y, int z)
-{
- MDefBoundIsect *isect;
- float weight, totweight;
- int i, a, acenter;
-
- acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
- return;
-
- nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[acenter], 1.0f);
-
- totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
- a= meshdeform_index(mdb, x, y, z, i);
- if(a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)
- continue;
-
- isect= mdb->boundisect[acenter][i-1];
- if (!isect) {
- weight= (1.0f/mdb->width[0])/totweight;
- nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[a], -weight);
- }
- }
-}
-
-static void meshdeform_matrix_add_rhs(MeshDeformBind *mdb, int x, int y, int z, int cagevert)
-{
- MDefBoundIsect *isect;
- float rhs, weight, totweight;
- int i, a, acenter;
-
- acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR)
- return;
-
- totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
- a= meshdeform_index(mdb, x, y, z, i);
- if(a == -1)
- continue;
-
- isect= mdb->boundisect[acenter][i-1];
-
- if (isect) {
- weight= (1.0f/isect->len)/totweight;
- rhs= weight*meshdeform_boundary_phi(mdb, isect, cagevert);
- nlRightHandSideAdd(0, mdb->varidx[acenter], rhs);
- }
- }
-}
-
-static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert)
-{
- MDefBoundIsect *isect;
- float rhs, weight, totweight;
- int i, a;
-
- a= meshdeform_index(mdb, x, y, z, 0);
- if(!mdb->semibound[a])
- return;
-
- mdb->phi[a]= 0.0f;
-
- totweight= meshdeform_boundary_total_weight(mdb, x, y, z);
- for(i=1; i<=6; i++) {
- isect= mdb->boundisect[a][i-1];
-
- if (isect) {
- weight= (1.0f/isect->len)/totweight;
- rhs= weight*meshdeform_boundary_phi(mdb, isect, cagevert);
- mdb->phi[a] += rhs;
- }
- }
-}
-
-static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert)
-{
- float phi, totweight;
- int i, a, acenter;
-
- acenter= meshdeform_index(mdb, x, y, z, 0);
- if(mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter])
- return;
-
- phi= 0.0f;
- totweight= 0.0f;
- for(i=1; i<=6; i++) {
- a= meshdeform_index(mdb, x, y, z, i);
-
- if(a != -1 && mdb->semibound[a]) {
- phi += mdb->phi[a];
- totweight += 1.0f;
- }
- }
-
- if(totweight != 0.0f)
- mdb->phi[acenter]= phi/totweight;
-}
-
-static void meshdeform_matrix_solve(MeshDeformBind *mdb)
-{
- NLContext *context;
- float vec[3], gridvec[3];
- int a, b, x, y, z, totvar;
- char message[1024];
-
- /* setup variable indices */
- mdb->varidx= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformDSvaridx");
- for(a=0, totvar=0; a<mdb->size3; a++)
- mdb->varidx[a]= (mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)? -1: totvar++;
-
- if(totvar == 0) {
- MEM_freeN(mdb->varidx);
- return;
- }
-
- progress_bar(0, "Starting mesh deform solve");
-
- /* setup opennl solver */
- nlNewContext();
- context= nlGetCurrent();
-
- nlSolverParameteri(NL_NB_VARIABLES, totvar);
- nlSolverParameteri(NL_NB_ROWS, totvar);
- nlSolverParameteri(NL_NB_RIGHT_HAND_SIDES, 1);
-
- nlBegin(NL_SYSTEM);
- nlBegin(NL_MATRIX);
-
- /* build matrix */
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
- meshdeform_matrix_add_cell(mdb, x, y, z);
-
- /* solve for each cage vert */
- for(a=0; a<mdb->totcagevert; a++) {
- if(a != 0) {
- nlBegin(NL_SYSTEM);
- nlBegin(NL_MATRIX);
- }
-
- /* fill in right hand side and solve */
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
- meshdeform_matrix_add_rhs(mdb, x, y, z, a);
-
- nlEnd(NL_MATRIX);
- nlEnd(NL_SYSTEM);
-
-#if 0
- nlPrintMatrix();
-#endif
-
- if(nlSolveAdvanced(NULL, NL_TRUE)) {
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
- meshdeform_matrix_add_semibound_phi(mdb, x, y, z, a);
-
- for(z=0; z<mdb->size; z++)
- for(y=0; y<mdb->size; y++)
- for(x=0; x<mdb->size; x++)
- meshdeform_matrix_add_exterior_phi(mdb, x, y, z, a);
-
- for(b=0; b<mdb->size3; b++) {
- if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
- mdb->phi[b]= nlGetVariable(0, mdb->varidx[b]);
- mdb->totalphi[b] += mdb->phi[b];
- }
-
- if(mdb->weights) {
- /* static bind : compute weights for each vertex */
- for(b=0; b<mdb->totvert; b++) {
- if(mdb->inside[b]) {
- VECCOPY(vec, mdb->vertexcos[b]);
- Mat4MulVecfl(mdb->cagemat, vec);
- gridvec[0]= (vec[0] - mdb->min[0] - mdb->halfwidth[0])/mdb->width[0];
- gridvec[1]= (vec[1] - mdb->min[1] - mdb->halfwidth[1])/mdb->width[1];
- gridvec[2]= (vec[2] - mdb->min[2] - mdb->halfwidth[2])/mdb->width[2];
-
- mdb->weights[b*mdb->totcagevert + a]= meshdeform_interp_w(mdb, gridvec, vec, a);
- }
- }
- }
- else {
- MDefBindInfluence *inf;
-
- /* dynamic bind */
- for(b=0; b<mdb->size3; b++) {
- if(mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) {
- inf= BLI_memarena_alloc(mdb->memarena, sizeof(*inf));
- inf->vertex= a;
- inf->weight= mdb->phi[b];
- inf->next= mdb->dyngrid[b];
- mdb->dyngrid[b]= inf;
- }
- }
- }
- }
- else {
- error("Mesh Deform: failed to find solution.");
- break;
- }
-
- sprintf(message, "Mesh deform solve %d / %d |||", a+1, mdb->totcagevert);
- progress_bar((float)(a+1)/(float)(mdb->totcagevert), message);
- }
-
-#if 0
- /* sanity check */
- for(b=0; b<mdb->size3; b++)
- if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR)
- if(fabs(mdb->totalphi[b] - 1.0f) > 1e-4)
- printf("totalphi deficiency [%s|%d] %d: %.10f\n",
- (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR)? "interior": "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]);
-#endif
-
- /* free */
- MEM_freeN(mdb->varidx);
-
- nlDeleteContext(context);
-}
-
-void harmonic_coordinates_bind(MeshDeformModifierData *mmd, float (*vertexcos)[3], int totvert, float cagemat[][4])
-{
- MeshDeformBind mdb;
- MDefBindInfluence *inf;
- MDefInfluence *mdinf;
- MDefCell *cell;
- MVert *mvert;
- float center[3], vec[3], maxwidth, totweight;
- int a, b, x, y, z, totinside, offset;
-
- waitcursor(1);
- start_progress_bar();
-
- memset(&mdb, 0, sizeof(MeshDeformBind));
-
- /* get mesh and cage mesh */
- mdb.vertexcos= vertexcos;
- mdb.totvert= totvert;
-
- mdb.cagedm= mesh_create_derived_no_deform(mmd->object, NULL, CD_MASK_BAREMESH);
- mdb.totcagevert= mdb.cagedm->getNumVerts(mdb.cagedm);
- mdb.cagecos= MEM_callocN(sizeof(*mdb.cagecos)*mdb.totcagevert, "MeshDeformBindCos");
- Mat4CpyMat4(mdb.cagemat, cagemat);
-
- mvert= mdb.cagedm->getVertArray(mdb.cagedm);
- for(a=0; a<mdb.totcagevert; a++)
- VECCOPY(mdb.cagecos[a], mvert[a].co)
-
- /* compute bounding box of the cage mesh */
- INIT_MINMAX(mdb.min, mdb.max);
-
- for(a=0; a<mdb.totcagevert; a++)
- DO_MINMAX(mdb.cagecos[a], mdb.min, mdb.max);
-
- /* allocate memory */
- mdb.size= (2<<(mmd->gridsize-1)) + 2;
- mdb.size3= mdb.size*mdb.size*mdb.size;
- mdb.tag= MEM_callocN(sizeof(int)*mdb.size3, "MeshDeformBindTag");
- mdb.phi= MEM_callocN(sizeof(float)*mdb.size3, "MeshDeformBindPhi");
- mdb.totalphi= MEM_callocN(sizeof(float)*mdb.size3, "MeshDeformBindTotalPhi");
- mdb.boundisect= MEM_callocN(sizeof(*mdb.boundisect)*mdb.size3, "MDefBoundIsect");
- mdb.semibound= MEM_callocN(sizeof(int)*mdb.size3, "MDefSemiBound");
-
- mdb.inside= MEM_callocN(sizeof(int)*mdb.totvert, "MDefInside");
-
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND)
- mdb.dyngrid= MEM_callocN(sizeof(MDefBindInfluence*)*mdb.size3, "MDefDynGrid");
- else
- mdb.weights= MEM_callocN(sizeof(float)*mdb.totvert*mdb.totcagevert, "MDefWeights");
-
- mdb.memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
- BLI_memarena_use_calloc(mdb.memarena);
-
- /* make bounding box equal size in all directions, add padding, and compute
- * width of the cells */
- maxwidth = -1.0f;
- for(a=0; a<3; a++)
- if(mdb.max[a]-mdb.min[a] > maxwidth)
- maxwidth= mdb.max[a]-mdb.min[a];
-
- for(a=0; a<3; a++) {
- center[a]= (mdb.min[a]+mdb.max[a])*0.5f;
- mdb.min[a]= center[a] - maxwidth*0.5f;
- mdb.max[a]= center[a] + maxwidth*0.5f;
-
- mdb.width[a]= (mdb.max[a]-mdb.min[a])/(mdb.size-4);
- mdb.min[a] -= 2.1f*mdb.width[a];
- mdb.max[a] += 2.1f*mdb.width[a];
-
- mdb.width[a]= (mdb.max[a]-mdb.min[a])/mdb.size;
- mdb.halfwidth[a]= mdb.width[a]*0.5f;
- }
-
- progress_bar(0, "Setting up mesh deform system");
-
-#if 0
- /* create ray tree */
- meshdeform_ray_tree_create(&mdb);
-#endif
-
- totinside= 0;
- for(a=0; a<mdb.totvert; a++) {
- VECCOPY(vec, mdb.vertexcos[a]);
- Mat4MulVecfl(mdb.cagemat, vec);
- mdb.inside[a]= meshdeform_inside_cage(&mdb, vec);
- if(mdb.inside[a])
- totinside++;
- }
-
- /* free temporary MDefBoundIsects */
- BLI_memarena_free(mdb.memarena);
- mdb.memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
-
- /* start with all cells untyped */
- for(a=0; a<mdb.size3; a++)
- mdb.tag[a]= MESHDEFORM_TAG_UNTYPED;
-
- /* detect intersections and tag boundary cells */
- for(z=0; z<mdb.size; z++)
- for(y=0; y<mdb.size; y++)
- for(x=0; x<mdb.size; x++)
- meshdeform_add_intersections(&mdb, x, y, z);
-
-#if 0
- /* free ray tree */
- meshdeform_ray_tree_free(&mdb);
-#endif
-
- /* compute exterior and interior tags */
- meshdeform_bind_floodfill(&mdb);
-
- for(z=0; z<mdb.size; z++)
- for(y=0; y<mdb.size; y++)
- for(x=0; x<mdb.size; x++)
- meshdeform_check_semibound(&mdb, x, y, z);
-
- /* solve */
- meshdeform_matrix_solve(&mdb);
-
- /* assign results */
- mmd->bindcos= (float*)mdb.cagecos;
- mmd->totvert= mdb.totvert;
- mmd->totcagevert= mdb.totcagevert;
- Mat4CpyMat4(mmd->bindmat, mmd->object->obmat);
-
- if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
- mmd->totinfluence= 0;
- for(a=0; a<mdb.size3; a++)
- for(inf=mdb.dyngrid[a]; inf; inf=inf->next)
- mmd->totinfluence++;
-
- /* convert MDefBindInfluences to smaller MDefInfluences */
- mmd->dyngrid= MEM_callocN(sizeof(MDefCell)*mdb.size3, "MDefDynGrid");
- mmd->dyninfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefInfluence");
- offset= 0;
- for(a=0; a<mdb.size3; a++) {
- cell= &mmd->dyngrid[a];
- cell->offset= offset;
-
- totweight= 0.0f;
- mdinf= mmd->dyninfluences + cell->offset;
- for(inf=mdb.dyngrid[a]; inf; inf=inf->next, mdinf++) {
- mdinf->weight= inf->weight;
- mdinf->vertex= inf->vertex;
- totweight += mdinf->weight;
- cell->totinfluence++;
- }
-
- if(totweight > 0.0f) {
- mdinf= mmd->dyninfluences + cell->offset;
- for(b=0; b<cell->totinfluence; b++, mdinf++)
- mdinf->weight /= totweight;
- }
-
- offset += cell->totinfluence;
- }
-
- mmd->dynverts= mdb.inside;
- mmd->dyngridsize= mdb.size;
- VECCOPY(mmd->dyncellmin, mdb.min);
- mmd->dyncellwidth= mdb.width[0];
- MEM_freeN(mdb.dyngrid);
- }
- else {
- mmd->bindweights= mdb.weights;
- MEM_freeN(mdb.inside);
- }
-
- /* transform bindcos to world space */
- for(a=0; a<mdb.totcagevert; a++)
- Mat4MulVecfl(mmd->object->obmat, mmd->bindcos+a*3);
-
- /* free */
- mdb.cagedm->release(mdb.cagedm);
- MEM_freeN(mdb.tag);
- MEM_freeN(mdb.phi);
- MEM_freeN(mdb.totalphi);
- MEM_freeN(mdb.boundisect);
- MEM_freeN(mdb.semibound);
- BLI_memarena_free(mdb.memarena);
-
- end_progress_bar();
- waitcursor(0);
-}
-
diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c
deleted file mode 100644
index 66a484eb903..00000000000
--- a/source/blender/src/meshtools.c
+++ /dev/null
@@ -1,1174 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/*
-
-meshtools.c: no editmode, tools operating on meshes
-
-int join_mesh(void);
-
-void fasterdraw(void);
-void slowerdraw(void);
-
-void sort_faces(void);
-
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_image_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_material_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_customdata.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_material.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_editconstraint.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-#include "BDR_sculptmode.h"
-
-#include "BLI_editVert.h"
-#include "BLI_ghash.h"
-#include "BLI_threads.h"
-#include "BLI_rand.h" /* for randome face sorting */
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "BIF_meshtools.h" /* include ourself for prototypes */
-
-#include "RE_pipeline.h"
-#include "RE_shader_ext.h"
-
-#include "PIL_time.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "GPU_draw.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* from rendercode.c */
-#define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f
-
-/* * ********************** no editmode!!! *********** */
-
-/* join selected meshes into the active mesh, context sensitive
-return 0 if no join is made (error) and 1 of the join is done */
-int join_mesh(void)
-{
- Base *base, *nextb;
- Object *ob;
- Material **matar, *ma;
- Mesh *me;
- MVert *mvert, *mvertmain;
- MEdge *medge = NULL, *medgemain;
- MFace *mface = NULL, *mfacemain;
- float imat[4][4], cmat[4][4];
- int a, b, totcol, totedge=0, totvert=0, totface=0, ok=0, vertofs, map[MAXMAT];
- int i, j, index, haskey=0, hasmulti=0, edgeofs, faceofs;
- bDeformGroup *dg, *odg;
- MDeformVert *dvert;
- CustomData vdata, edata, fdata;
-
- if(G.obedit) return 0;
-
- ob= OBACT;
- if(!ob || ob->type!=OB_MESH) return 0;
-
- if (object_data_is_libdata(ob)) {
- error_libdata();
- return 0;
- }
-
-#ifdef WITH_VERSE
- /* it isn't allowed to join shared object at verse server
- * this function will be implemented as soon as possible */
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB(base) {
- if(base->object->type==OB_MESH) {
- if(base->object->vnode) {
- haskey= 1;
- break;
- }
- }
- }
- base= base->next;
- }
- if(haskey) {
- error("Can't join meshes shared at verse server");
- return 0;
- }
-#endif
-
- /* count & check */
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB_BGMODE(base) { /* BGMODE since python can access */
- if(base->object->type==OB_MESH) {
- me= base->object->data;
- totvert+= me->totvert;
- totface+= me->totface;
-
- if(base->object == ob) ok= 1;
-
- if(me->key) {
- haskey= 1;
- break;
- }
- if(me->mr) {
- hasmulti= 1;
- break;
- }
- }
- }
- base= base->next;
- }
-
- if(haskey) {
- error("Can't join meshes with vertex keys");
- return 0;
- }
- if(hasmulti) {
- error("Can't join meshes with Multires");
- return 0;
- }
- /* that way the active object is always selected */
- if(ok==0) return 0;
-
- if(totvert==0 || totvert>MESH_MAX_VERTS) return 0;
-
- /* if needed add edges to other meshes */
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASELIB_BGMODE(base) {
- if(base->object->type==OB_MESH) {
- me= base->object->data;
- totedge += me->totedge;
- }
- }
- }
-
- /* new material indices and material array */
- matar= MEM_callocN(sizeof(void *)*MAXMAT, "join_mesh");
- totcol= ob->totcol;
-
- /* obact materials in new main array, is nicer start! */
- for(a=1; a<=ob->totcol; a++) {
- matar[a-1]= give_current_material(ob, a);
- id_us_plus((ID *)matar[a-1]);
- /* increase id->us : will be lowered later */
- }
-
- base= FIRSTBASE;
- while(base) {
- if TESTBASELIB_BGMODE(base) {
- if(ob!=base->object && base->object->type==OB_MESH) {
- me= base->object->data;
-
- // Join this object's vertex groups to the base one's
- for (dg=base->object->defbase.first; dg; dg=dg->next){
- /* See if this group exists in the object */
- for (odg=ob->defbase.first; odg; odg=odg->next){
- if (!strcmp(odg->name, dg->name)){
- break;
- }
- }
- if (!odg){
- odg = MEM_callocN (sizeof(bDeformGroup), "join deformGroup");
- memcpy (odg, dg, sizeof(bDeformGroup));
- BLI_addtail(&ob->defbase, odg);
- }
-
- }
- if (ob->defbase.first && ob->actdef==0)
- ob->actdef=1;
-
- if(me->totvert) {
- for(a=1; a<=base->object->totcol; a++) {
- ma= give_current_material(base->object, a);
- if(ma) {
- for(b=0; b<totcol; b++) {
- if(ma == matar[b]) break;
- }
- if(b==totcol) {
- matar[b]= ma;
- ma->id.us++;
- totcol++;
- }
- if(totcol>=MAXMAT-1) break;
- }
- }
- }
- }
- if(totcol>=MAXMAT-1) break;
- }
- base= base->next;
- }
-
- me= ob->data;
-
- memset(&vdata, 0, sizeof(vdata));
- memset(&edata, 0, sizeof(edata));
- memset(&fdata, 0, sizeof(fdata));
-
- mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
- medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
- mface= CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface);
-
- mvertmain= mvert;
- medgemain= medge;
- mfacemain= mface;
-
- /* inverse transorm all selected meshes in this object */
- Mat4Invert(imat, ob->obmat);
-
- vertofs= 0;
- edgeofs= 0;
- faceofs= 0;
- base= FIRSTBASE;
- while(base) {
- nextb= base->next;
- if TESTBASELIB_BGMODE(base) {
- if(base->object->type==OB_MESH) {
-
- me= base->object->data;
-
- if(me->totvert) {
- CustomData_merge(&me->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert);
- CustomData_copy_data(&me->vdata, &vdata, 0, vertofs, me->totvert);
-
- dvert= CustomData_get(&vdata, vertofs, CD_MDEFORMVERT);
-
- /* NEW VERSION */
- if (dvert){
- for (i=0; i<me->totvert; i++){
- for (j=0; j<dvert[i].totweight; j++){
- // Find the old vertex group
- odg = BLI_findlink (&base->object->defbase, dvert[i].dw[j].def_nr);
- if(odg) {
- // Search for a match in the new object
- for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){
- if (!strcmp(dg->name, odg->name)){
- dvert[i].dw[j].def_nr = index;
- break;
- }
- }
- }
- }
- }
- }
-
- if(base->object != ob) {
- /* watch this: switch matmul order really goes wrong */
- Mat4MulMat4(cmat, base->object->obmat, imat);
-
- a= me->totvert;
- while(a--) {
- Mat4MulVecfl(cmat, mvert->co);
- mvert++;
- }
- }
- else mvert+= me->totvert;
- }
- if(me->totface) {
-
- /* make mapping for materials */
- memset(map, 0, 4*MAXMAT);
- for(a=1; a<=base->object->totcol; a++) {
- ma= give_current_material(base->object, a);
- if(ma) {
- for(b=0; b<totcol; b++) {
- if(ma == matar[b]) {
- map[a-1]= b;
- break;
- }
- }
- }
- }
-
- CustomData_merge(&me->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface);
- CustomData_copy_data(&me->fdata, &fdata, 0, faceofs, me->totface);
-
- for(a=0; a<me->totface; a++, mface++) {
- mface->v1+= vertofs;
- mface->v2+= vertofs;
- mface->v3+= vertofs;
- if(mface->v4) mface->v4+= vertofs;
-
- mface->mat_nr= map[(int)mface->mat_nr];
- }
-
- faceofs += me->totface;
- }
-
- if(me->totedge) {
- CustomData_merge(&me->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge);
- CustomData_copy_data(&me->edata, &edata, 0, edgeofs, me->totedge);
-
- for(a=0; a<me->totedge; a++, medge++) {
- medge->v1+= vertofs;
- medge->v2+= vertofs;
- }
-
- edgeofs += me->totedge;
- }
-
- vertofs += me->totvert;
-
- if(base->object!=ob)
- free_and_unlink_base(base);
- }
- }
- base= nextb;
- }
-
- me= ob->data;
-
- CustomData_free(&me->vdata, me->totvert);
- CustomData_free(&me->edata, me->totedge);
- CustomData_free(&me->fdata, me->totface);
-
- me->totvert= totvert;
- me->totedge= totedge;
- me->totface= totface;
-
- me->vdata= vdata;
- me->edata= edata;
- me->fdata= fdata;
-
- mesh_update_customdata_pointers(me);
-
- /* old material array */
- for(a=1; a<=ob->totcol; a++) {
- ma= ob->mat[a-1];
- if(ma) ma->id.us--;
- }
- for(a=1; a<=me->totcol; a++) {
- ma= me->mat[a-1];
- if(ma) ma->id.us--;
- }
- if(ob->mat) MEM_freeN(ob->mat);
- if(me->mat) MEM_freeN(me->mat);
- ob->mat= me->mat= 0;
-
- if(totcol) {
- me->mat= matar;
- ob->mat= MEM_callocN(sizeof(void *)*totcol, "join obmatar");
- }
- else MEM_freeN(matar);
-
- ob->totcol= me->totcol= totcol;
- ob->colbits= 0;
-
- /* other mesh users */
- test_object_materials((ID *)me);
-
- DAG_scene_sort(G.scene); // removed objects, need to rebuild dag before editmode call
-
- enter_editmode(EM_WAITCURSOR);
- exit_editmode(EM_FREEDATA|EM_WAITCURSOR); // freedata, but no undo
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSSHADING, 0);
-
- BIF_undo_push("Join Mesh");
- return 1;
-}
-
-
-/* ********************** SORT FACES ******************* */
-
-static void permutate(void *list, int num, int size, int *index)
-{
- void *buf;
- int len;
- int i;
-
- len = num * size;
-
- buf = MEM_mallocN(len, "permutate");
- memcpy(buf, list, len);
-
- for (i = 0; i < num; i++) {
- memcpy((char *)list + (i * size), (char *)buf + (index[i] * size), size);
- }
- MEM_freeN(buf);
-}
-
-/* sort faces on view axis */
-static float *face_sort_floats;
-static int float_sort(const void *v1, const void *v2)
-{
- float x1, x2;
-
- x1 = face_sort_floats[((int *) v1)[0]];
- x2 = face_sort_floats[((int *) v2)[0]];
-
- if( x1 > x2 ) return 1;
- else if( x1 < x2 ) return -1;
- return 0;
-}
-
-
-void sort_faces(void)
-{
- Object *ob= OBACT;
- Mesh *me;
- CustomDataLayer *layer;
- int i, *index;
- short event;
- float reverse = 1;
-
- if(!ob) return;
- if(G.obedit) return;
- if(ob->type!=OB_MESH) return;
- if (!G.vd) return;
-
- me= ob->data;
- if(me->totface==0) return;
-
- event = pupmenu(
- "Sort Faces (Ctrl to reverse)%t|"
- "View Axis%x1|"
- "Cursor Distance%x2|"
- "Material%x3|"
- "Selection%x4|"
- "Randomize%x5");
-
- if (event==-1) return;
-
- if(G.qual & LR_CTRLKEY)
- reverse = -1;
-
-/* create index list */
- index = (int *) MEM_mallocN(sizeof(int) * me->totface, "sort faces");
- for (i = 0; i < me->totface; i++) {
- index[i] = i;
- }
-
- face_sort_floats = (float *) MEM_mallocN(sizeof(float) * me->totface, "sort faces float");
-
-/* sort index list instead of faces itself
- and apply this permutation to all face layers */
-
- if (event == 5) {
- /* Random */
- for(i=0; i<me->totface; i++) {
- face_sort_floats[i] = BLI_frand();
- }
- qsort(index, me->totface, sizeof(int), float_sort);
- } else {
- MFace *mf;
- float vec[3];
- float mat[4][4];
- float cur[3];
-
- if (event == 1)
- Mat4MulMat4(mat, OBACT->obmat, G.vd->viewmat); /* apply the view matrix to the object matrix */
- else if (event == 2) { /* sort from cursor */
- if( G.vd && G.vd->localview ) {
- VECCOPY(cur, G.vd->cursor);
- } else {
- VECCOPY(cur, G.scene->cursor);
- }
- Mat4Invert(mat, OBACT->obmat);
- Mat4MulVecfl(mat, cur);
- }
-
- mf= me->mface;
- for(i=0; i<me->totface; i++, mf++) {
-
- if (event==3) {
- face_sort_floats[i] = ((float)mf->mat_nr)*reverse;
- } else if (event==4) {
- /*selected first*/
- if (mf->flag & ME_FACE_SEL) face_sort_floats[i] = 0.0;
- else face_sort_floats[i] = reverse;
- } else {
- /* find the faces center */
- VECADD(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co);
- if (mf->v4) {
- VECADD(vec, vec, (me->mvert+mf->v3)->co);
- VECADD(vec, vec, (me->mvert+mf->v4)->co);
- VECMUL(vec, 0.25f);
- } else {
- VECADD(vec, vec, (me->mvert+mf->v3)->co);
- VECMUL(vec, 1.0f/3.0f);
- } /* done */
-
- if (event == 1) { /* sort on view axis */
- Mat4MulVecfl(mat, vec);
- face_sort_floats[i] = vec[2] * reverse;
- } else { /* distance from cursor*/
- face_sort_floats[i] = VecLenf(cur, vec) * reverse; /* back to front */
- }
- }
- }
- qsort(index, me->totface, sizeof(int), float_sort);
- }
-
- MEM_freeN(face_sort_floats);
-
- for(i = 0; i < me->fdata.totlayer; i++) {
- layer = &me->fdata.layers[i];
- permutate(layer->data, me->totface, CustomData_sizeof(layer->type), index);
- }
-
- MEM_freeN(index);
-
- allqueue(REDRAWVIEW3D, 0);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-}
-
-
-
-/* ********************* MESH VERTEX OCTREE LOOKUP ************* */
-
-/* important note; this is unfinished, needs better API for editmode, and custom threshold */
-
-#define MOC_RES 8
-#define MOC_NODE_RES 8
-#define MOC_THRESH 0.0002f
-
-typedef struct MocNode {
- struct MocNode *next;
- intptr_t index[MOC_NODE_RES];
-} MocNode;
-
-static int mesh_octree_get_base_offs(float *co, float *offs, float *div)
-{
- int vx, vy, vz;
-
- vx= floor( (co[0]-offs[0])/div[0] );
- vy= floor( (co[1]-offs[1])/div[1] );
- vz= floor( (co[2]-offs[2])/div[2] );
-
- CLAMP(vx, 0, MOC_RES-1);
- CLAMP(vy, 0, MOC_RES-1);
- CLAMP(vz, 0, MOC_RES-1);
-
- return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz;
-}
-
-static void mesh_octree_add_node(MocNode **bt, intptr_t index)
-{
- if(*bt==NULL) {
- *bt= MEM_callocN(sizeof(MocNode), "MocNode");
- (*bt)->index[0]= index;
- }
- else {
- int a;
- for(a=0; a<MOC_NODE_RES; a++) {
- if((*bt)->index[a]==index)
- return;
- else if((*bt)->index[a]==0) {
- (*bt)->index[a]= index;
- return;
- }
- }
- mesh_octree_add_node(&(*bt)->next, index);
- }
-}
-
-static void mesh_octree_free_node(MocNode **bt)
-{
- if( (*bt)->next ) {
- mesh_octree_free_node(&(*bt)->next);
- }
- MEM_freeN(*bt);
-}
-
-
-/* temporal define, just to make nicer code below */
-#define MOC_ADDNODE(vx, vy, vz) mesh_octree_add_node(basetable + ((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz), index)
-
-static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, intptr_t index)
-{
- float fx, fy, fz;
- int vx, vy, vz;
-
- if (isnan(co[0]) || !finite(co[0]) ||
- isnan(co[1]) || !finite(co[1]) ||
- isnan(co[2]) || !finite(co[2])
- ) {
- return;
- }
-
- fx= (co[0]-offs[0])/div[0];
- fy= (co[1]-offs[1])/div[1];
- fz= (co[2]-offs[2])/div[2];
- CLAMP(fx, 0.0f, MOC_RES-MOC_THRESH);
- CLAMP(fy, 0.0f, MOC_RES-MOC_THRESH);
- CLAMP(fz, 0.0f, MOC_RES-MOC_THRESH);
-
- vx= floor(fx);
- vy= floor(fy);
- vz= floor(fz);
-
- MOC_ADDNODE(vx, vy, vz);
-
- if( vx>0 )
- if( fx-((float)vx)-MOC_THRESH < 0.0f)
- MOC_ADDNODE(vx-1, vy, vz);
- if( vx<MOC_RES-2 )
- if( fx-((float)vx)+MOC_THRESH > 1.0f)
- MOC_ADDNODE(vx+1, vy, vz);
-
- if( vy>0 )
- if( fy-((float)vy)-MOC_THRESH < 0.0f)
- MOC_ADDNODE(vx, vy-1, vz);
- if( vy<MOC_RES-2 )
- if( fy-((float)vy)+MOC_THRESH > 1.0f)
- MOC_ADDNODE(vx, vy+1, vz);
-
- if( vz>0 )
- if( fz-((float)vz)-MOC_THRESH < 0.0f)
- MOC_ADDNODE(vx, vy, vz-1);
- if( vz<MOC_RES-2 )
- if( fz-((float)vz)+MOC_THRESH > 1.0f)
- MOC_ADDNODE(vx, vy, vz+1);
-
-}
-
-static intptr_t mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co)
-{
- float *vec;
- int a;
-
- if(*bt==NULL)
- return -1;
-
- for(a=0; a<MOC_NODE_RES; a++) {
- if((*bt)->index[a]) {
- /* does mesh verts and editmode, code looks potential dangerous, octree should really be filled OK! */
- if(orco) {
- vec= orco[(*bt)->index[a]-1];
- if(FloatCompare(vec, co, MOC_THRESH))
- return (*bt)->index[a]-1;
- }
- else if(mvert) {
- vec= (mvert+(*bt)->index[a]-1)->co;
- if(FloatCompare(vec, co, MOC_THRESH))
- return (*bt)->index[a]-1;
- }
- else {
- EditVert *eve= (EditVert *)((*bt)->index[a]);
- if(FloatCompare(eve->co, co, MOC_THRESH))
- return (*bt)->index[a];
- }
- }
- else return -1;
- }
- if( (*bt)->next)
- return mesh_octree_find_index(&(*bt)->next, orco, mvert, co);
-
- return -1;
-}
-
-static struct {
- MocNode **table;
- float offs[3], div[3];
- float (*orco)[3];
- float orcoloc[3];
-} MeshOctree = {NULL, {0, 0, 0}, {0, 0, 0}, NULL};
-
-/* mode is 's' start, or 'e' end, or 'u' use */
-/* if end, ob can be NULL */
-intptr_t mesh_octree_table(Object *ob, float *co, char mode)
-{
- MocNode **bt;
-
- if(mode=='u') { /* use table */
- if(MeshOctree.table==NULL)
- mesh_octree_table(ob, NULL, 's');
-
- if(MeshOctree.table) {
- Mesh *me= ob->data;
- bt= MeshOctree.table + mesh_octree_get_base_offs(co, MeshOctree.offs, MeshOctree.div);
- if(ob==G.obedit)
- return mesh_octree_find_index(bt, NULL, NULL, co);
- else
- return mesh_octree_find_index(bt, MeshOctree.orco, me->mvert, co);
- }
- return -1;
- }
- else if(mode=='s') { /* start table */
- Mesh *me= ob->data;
- float min[3], max[3];
-
- /* we compute own bounding box and don't reuse ob->bb because
- * we are using the undeformed coordinates*/
- INIT_MINMAX(min, max);
-
- if(ob==G.obedit) {
- EditVert *eve;
-
- for(eve= G.editMesh->verts.first; eve; eve= eve->next)
- DO_MINMAX(eve->co, min, max)
- }
- else {
- MVert *mvert;
- float *vco;
- int a, totvert;
-
- MeshOctree.orco= mesh_getRefKeyCos(me, &totvert);
- mesh_get_texspace(me, MeshOctree.orcoloc, NULL, NULL);
-
- for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++) {
- vco= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
- DO_MINMAX(vco, min, max);
- }
- }
-
- /* for quick unit coordinate calculus */
- VECCOPY(MeshOctree.offs, min);
- MeshOctree.offs[0]-= MOC_THRESH; /* we offset it 1 threshold unit extra */
- MeshOctree.offs[1]-= MOC_THRESH;
- MeshOctree.offs[2]-= MOC_THRESH;
-
- VecSubf(MeshOctree.div, max, min);
- MeshOctree.div[0]+= 2*MOC_THRESH; /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */
- MeshOctree.div[1]+= 2*MOC_THRESH;
- MeshOctree.div[2]+= 2*MOC_THRESH;
-
- VecMulf(MeshOctree.div, 1.0f/MOC_RES);
- if(MeshOctree.div[0]==0.0f) MeshOctree.div[0]= 1.0f;
- if(MeshOctree.div[1]==0.0f) MeshOctree.div[1]= 1.0f;
- if(MeshOctree.div[2]==0.0f) MeshOctree.div[2]= 1.0f;
-
- if(MeshOctree.table) /* happens when entering this call without ending it */
- mesh_octree_table(ob, co, 'e');
-
- MeshOctree.table= MEM_callocN(MOC_RES*MOC_RES*MOC_RES*sizeof(void *), "sym table");
-
- if(ob==G.obedit) {
- EditVert *eve;
-
- for(eve= G.editMesh->verts.first; eve; eve= eve->next) {
- mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (intptr_t)(eve));
- }
- }
- else {
- MVert *mvert;
- float *vco;
- int a;
-
- for(a=0, mvert= me->mvert; a<me->totvert; a++, mvert++) {
- vco= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co;
- mesh_octree_add_nodes(MeshOctree.table, vco, MeshOctree.offs, MeshOctree.div, a+1);
- }
- }
- }
- else if(mode=='e') { /* end table */
- if(MeshOctree.table) {
- int a;
-
- for(a=0, bt=MeshOctree.table; a<MOC_RES*MOC_RES*MOC_RES; a++, bt++) {
- if(*bt) mesh_octree_free_node(bt);
- }
- MEM_freeN(MeshOctree.table);
- MeshOctree.table= NULL;
- }
- if(MeshOctree.orco) {
- MEM_freeN(MeshOctree.orco);
- MeshOctree.orco= NULL;
- }
- }
- return 0;
-}
-
-int mesh_get_x_mirror_vert(Object *ob, int index)
-{
- Mesh *me= ob->data;
- MVert *mvert;
- float vec[3];
-
- if(MeshOctree.orco) {
- float *loc= MeshOctree.orcoloc;
-
- vec[0]= -(MeshOctree.orco[index][0] + loc[0]) - loc[0];
- vec[1]= MeshOctree.orco[index][1];
- vec[2]= MeshOctree.orco[index][2];
- }
- else {
- mvert= me->mvert+index;
- vec[0]= -mvert->co[0];
- vec[1]= mvert->co[1];
- vec[2]= mvert->co[2];
- }
-
- return mesh_octree_table(ob, vec, 'u');
-}
-
-EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co)
-{
- float vec[3];
- intptr_t poinval;
-
- /* ignore nan verts */
- if (isnan(co[0]) || !finite(co[0]) ||
- isnan(co[1]) || !finite(co[1]) ||
- isnan(co[2]) || !finite(co[2])
- )
- return NULL;
-
- vec[0]= -co[0];
- vec[1]= co[1];
- vec[2]= co[2];
-
- poinval= mesh_octree_table(ob, vec, 'u');
- if(poinval != -1)
- return (EditVert *)(poinval);
- return NULL;
-}
-
-static unsigned int mirror_facehash(void *ptr)
-{
- MFace *mf= ptr;
- int v0, v1;
-
- if(mf->v4) {
- v0= MIN4(mf->v1, mf->v2, mf->v3, mf->v4);
- v1= MAX4(mf->v1, mf->v2, mf->v3, mf->v4);
- }
- else {
- v0= MIN3(mf->v1, mf->v2, mf->v3);
- v1= MAX3(mf->v1, mf->v2, mf->v3);
- }
-
- return ((v0*39)^(v1*31));
-}
-
-static int mirror_facerotation(MFace *a, MFace *b)
-{
- if(b->v4) {
- if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3 && a->v4==b->v4)
- return 0;
- else if(a->v4==b->v1 && a->v1==b->v2 && a->v2==b->v3 && a->v3==b->v4)
- return 1;
- else if(a->v3==b->v1 && a->v4==b->v2 && a->v1==b->v3 && a->v2==b->v4)
- return 2;
- else if(a->v2==b->v1 && a->v3==b->v2 && a->v4==b->v3 && a->v1==b->v4)
- return 3;
- }
- else {
- if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3)
- return 0;
- else if(a->v3==b->v1 && a->v1==b->v2 && a->v2==b->v3)
- return 1;
- else if(a->v2==b->v1 && a->v3==b->v2 && a->v1==b->v3)
- return 2;
- }
-
- return -1;
-}
-
-static int mirror_facecmp(void *a, void *b)
-{
- return (mirror_facerotation((MFace*)a, (MFace*)b) == -1);
-}
-
-int *mesh_get_x_mirror_faces(Object *ob)
-{
- Mesh *me= ob->data;
- MVert *mv, *mvert= me->mvert;
- MFace mirrormf, *mf, *hashmf, *mface= me->mface;
- GHash *fhash;
- int *mirrorverts, *mirrorfaces;
- int a;
-
- mirrorverts= MEM_callocN(sizeof(int)*me->totvert, "MirrorVerts");
- mirrorfaces= MEM_callocN(sizeof(int)*2*me->totface, "MirrorFaces");
-
- mesh_octree_table(ob, NULL, 's');
-
- for(a=0, mv=mvert; a<me->totvert; a++, mv++)
- mirrorverts[a]= mesh_get_x_mirror_vert(ob, a);
-
- mesh_octree_table(ob, NULL, 'e');
-
- fhash= BLI_ghash_new(mirror_facehash, mirror_facecmp);
- for(a=0, mf=mface; a<me->totface; a++, mf++)
- BLI_ghash_insert(fhash, mf, mf);
-
- for(a=0, mf=mface; a<me->totface; a++, mf++) {
- mirrormf.v1= mirrorverts[mf->v3];
- mirrormf.v2= mirrorverts[mf->v2];
- mirrormf.v3= mirrorverts[mf->v1];
- mirrormf.v4= (mf->v4)? mirrorverts[mf->v4]: 0;
-
- /* make sure v4 is not 0 if a quad */
- if(mf->v4 && mirrormf.v4==0) {
- SWAP(int, mirrormf.v1, mirrormf.v3);
- SWAP(int, mirrormf.v2, mirrormf.v4);
- }
-
- hashmf= BLI_ghash_lookup(fhash, &mirrormf);
- if(hashmf) {
- mirrorfaces[a*2]= hashmf - mface;
- mirrorfaces[a*2+1]= mirror_facerotation(&mirrormf, hashmf);
- }
- else
- mirrorfaces[a*2]= -1;
- }
-
- BLI_ghash_free(fhash, NULL, NULL);
- MEM_freeN(mirrorverts);
-
- return mirrorfaces;
-}
-
-/* ****************** render BAKING ********************** */
-
-/* threaded break test */
-static volatile int g_break= 0;
-static int thread_break(void)
-{
- return g_break;
-}
-
-static ScrArea *biggest_image_area(void)
-{
- ScrArea *sa, *big= NULL;
- int size, maxsize= 0;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_IMAGE) {
- size= sa->winx*sa->winy;
- if(sa->winx > 10 && sa->winy > 10 && size > maxsize) {
- maxsize= size;
- big= sa;
- }
- }
- }
- return big;
-}
-
-
-typedef struct BakeRender {
- Render *re;
- struct Object *actob;
- int event, tot, ready;
-} BakeRender;
-
-static void *do_bake_render(void *bake_v)
-{
- BakeRender *bkr= bake_v;
-
- bkr->tot= RE_bake_shade_all_selected(bkr->re, bkr->event, bkr->actob);
- bkr->ready= 1;
-
- return NULL;
-}
-
-
-void objects_bake_render_menu(void)
-{
- short event;
-
- event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4|Displacement %x5|Shadow %x6");
- if (event < 1) return;
- objects_bake_render_ui(event);
-}
-
-void objects_bake_render(short event, char **error_msg)
-{
- Object *actob= OBACT;
- int active= G.scene->r.bake_flag & R_BAKE_TO_ACTIVE;
- short prev_r_raytrace= 0, prev_wo_amb_occ= 0;
-
- if(event==0) event= G.scene->r.bake_mode;
-
- if(G.scene->r.renderer!=R_INTERN) {
- *error_msg = "Bake only supported for Internal Renderer";
- return;
- }
-
- if(active && !actob) {
- *error_msg = "No active object";
- return;
- }
-
- if(event>0) {
- Render *re= RE_NewRender("_Bake View_");
- ScrArea *area= biggest_image_area();
- ListBase threads;
- BakeRender bkr;
- int timer=0, tot, sculptmode= G.f & G_SCULPTMODE;
-
- if(sculptmode) set_sculptmode();
-
- if(event==1) event= RE_BAKE_ALL;
- else if(event==2) event= RE_BAKE_AO;
- else if(event==3) event= RE_BAKE_NORMALS;
- else if(event==4) event= RE_BAKE_TEXTURE;
- else if(event==5) event= RE_BAKE_DISPLACEMENT;
- else event= RE_BAKE_SHADOW;
-
- if(event==RE_BAKE_AO) {
- if(G.scene->world==NULL) {
- *error_msg = "No world set up";
- return;
- }
-
- /* If raytracing or AO is disabled, switch it on temporarily for baking. */
- prev_wo_amb_occ = (G.scene->world->mode & WO_AMB_OCC) != 0;
- G.scene->world->mode |= WO_AMB_OCC;
- }
- if(event==RE_BAKE_AO || active) {
- prev_r_raytrace = (G.scene->r.mode & R_RAYTRACE) != 0;
- G.scene->r.mode |= R_RAYTRACE;
- }
-
- waitcursor(1);
- RE_test_break_cb(re, thread_break);
- g_break= 0;
- G.afbreek= 0; /* blender_test_break uses this global */
-
- RE_Database_Baking(re, G.scene, event, (active)? actob: NULL);
-
- /* baking itself is threaded, cannot use test_break in threads. we also update optional imagewindow */
-
- BLI_init_threads(&threads, do_bake_render, 1);
- bkr.re= re;
- bkr.event= event;
- bkr.ready= 0;
- bkr.actob= (active)? actob: NULL;
- BLI_insert_thread(&threads, &bkr);
-
- while(bkr.ready==0) {
- PIL_sleep_ms(50);
- if(bkr.ready)
- break;
-
- if (!G.background) {
- g_break= blender_test_break();
-
- timer++;
- if(area && timer==20) {
- Image *ima= RE_bake_shade_get_image();
- if(ima) ((SpaceImage *)area->spacedata.first)->image= ima;
- scrarea_do_windraw(area);
- myswapbuffers();
- timer= 0;
- }
- }
- }
- BLI_end_threads(&threads);
- tot= bkr.tot;
-
- RE_Database_Free(re);
- waitcursor(0);
-
- if(tot==0) *error_msg = "No Images found to bake to";
- else {
- Image *ima;
- /* force OpenGL reload and mipmap recalc */
- for(ima= G.main->image.first; ima; ima= ima->id.next) {
- if(ima->ok==IMA_OK_LOADED) {
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- GPU_free_image(ima);
- imb_freemipmapImBuf(ibuf);
- }
- }
- }
- }
-
- /* restore raytrace and AO */
- if(event==RE_BAKE_AO)
- if(prev_wo_amb_occ == 0)
- G.scene->world->mode &= ~WO_AMB_OCC;
-
- if(event==RE_BAKE_AO || active)
- if(prev_r_raytrace == 0)
- G.scene->r.mode &= ~R_RAYTRACE;
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-
- if(sculptmode) set_sculptmode();
-
- }
-}
-
-/* all selected meshes with UV maps are rendered for current scene visibility */
-void objects_bake_render_ui(short event)
-{
- char *error_msg = NULL;
- int is_editmode = (G.obedit!=NULL);
-
- /* Deal with editmode, this is a bit clunky but since UV's are in editmode, users are likely to bake from their */
- if (is_editmode) exit_editmode(0);
-
- objects_bake_render(event, &error_msg);
-
- if (is_editmode) enter_editmode(0);
-
- if (error_msg)
- error(error_msg);
-}
-
diff --git a/source/blender/src/multires.c b/source/blender/src/multires.c
deleted file mode 100644
index 64edfb5f6cc..00000000000
--- a/source/blender/src/multires.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Implements the multiresolution modeling tools.
- *
- * multires.h
- *
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_vec_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_key.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_multires.h"
-#include "BKE_object.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_editobject.h"
-#include "BDR_sculptmode.h"
-
-#include "BLI_editVert.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "blendef.h"
-#include "editmesh.h"
-#include "multires.h"
-#include "mydevice.h"
-#include "parametrizer.h"
-
-#include <math.h>
-
-void multires_calc_temp_data(struct MultiresLevel *lvl);
-
-int multires_test()
-{
- Mesh *me= get_mesh(OBACT);
- if(me && me->mr) {
- error("Unable to complete action with multires enabled.");
- return 1;
- }
- return 0;
-}
-int multires_level1_test()
-{
- Mesh *me= get_mesh(OBACT);
- if(me && me->mr && me->mr->current != 1) {
- error("Operation only available for multires level 1.");
- return 1;
- }
- return 0;
-}
-
-/* Sculptmode */
-
-void multires_check_state()
-{
- if(G.f & G_SCULPTMODE && !G.obedit)
- sculptmode_correct_state();
-}
-
-static void medge_flag_to_eed(const short flag, const char crease, EditEdge *eed)
-{
- if(!eed) return;
-
- if(flag & ME_SEAM) eed->seam= 1;
- if(flag & ME_SHARP) eed->sharp = 1;
- if(flag & SELECT) eed->f |= SELECT;
- if(flag & ME_FGON) eed->h= EM_FGON;
- if(flag & ME_HIDE) eed->h |= 1;
-
- eed->crease= ((float)crease)/255.0;
-}
-
-void multires_level_to_editmesh(Object *ob, Mesh *me, const int render)
-{
- MultiresLevel *lvl= BLI_findlink(&me->mr->levels,me->mr->current-1);
- int i;
- EditMesh *em= (!render && G.obedit) ? G.editMesh : NULL;
- EditVert **eves= NULL;
- EditEdge *eed= NULL;
-
- if(em) {
- /* Remove editmesh elements */
- free_editMesh(em);
-
- eves= MEM_callocN(sizeof(EditVert*)*lvl->totvert, "editvert pointers");
-
- /* Vertices/Edges/Faces */
- for(i=0; i<lvl->totvert; ++i) {
- eves[i]= addvertlist(me->mr->verts[i].co, NULL);
- if(me->mr->verts[i].flag & 1) eves[i]->f |= SELECT;
- if(me->mr->verts[i].flag & ME_HIDE) eves[i]->h= 1;
- eves[i]->data= NULL;
- }
- for(i=0; i<lvl->totedge; ++i) {
- addedgelist(eves[lvl->edges[i].v[0]], eves[lvl->edges[i].v[1]], NULL);
- }
- for(i=0; i<lvl->totface; ++i) {
- EditVert *eve4= lvl->faces[i].v[3] ? eves[lvl->faces[i].v[3]] : NULL;
- EditFace *efa= addfacelist(eves[lvl->faces[i].v[0]], eves[lvl->faces[i].v[1]],
- eves[lvl->faces[i].v[2]], eve4, NULL, NULL);
- efa->flag= lvl->faces[i].flag & ~ME_HIDE;
- efa->mat_nr= lvl->faces[i].mat_nr;
- if(lvl->faces[i].flag & ME_FACE_SEL)
- efa->f |= SELECT;
- if(lvl->faces[i].flag & ME_HIDE) efa->h= 1;
- efa->data= NULL;
- }
-
- /* Edge flags */
- eed= em->edges.first;
- if(lvl==me->mr->levels.first) {
- for(i=0; i<lvl->totedge; ++i) {
- medge_flag_to_eed(me->mr->edge_flags[i], me->mr->edge_creases[i], eed);
- eed= eed->next;
- }
- } else {
- MultiresLevel *lvl1= me->mr->levels.first;
- const int last= lvl1->totedge * pow(2, me->mr->current-1);
- for(i=0; i<last; ++i) {
- const int ndx= i / pow(2, me->mr->current-1);
-
- medge_flag_to_eed(me->mr->edge_flags[ndx], me->mr->edge_creases[ndx], eed);
- eed= eed->next;
- }
- }
-
- eed= em->edges.first;
- for(i=0, eed= em->edges.first; i<lvl->totedge; ++i, eed= eed->next) {
- eed->h= me->mr->verts[lvl->edges[i].v[0]].flag & ME_HIDE ||
- me->mr->verts[lvl->edges[i].v[1]].flag & ME_HIDE;
- }
-
- EM_select_flush();
-
- multires_customdata_to_mesh(me, em, lvl, &me->mr->vdata, em ? &em->vdata : &me->vdata, CD_MDEFORMVERT);
- multires_customdata_to_mesh(me, em, lvl, &me->mr->fdata, em ? &em->fdata : &me->fdata, CD_MTFACE);
-
- /* Colors */
- if(me->mr->use_col) {
- MCol c[4];
- EditFace *efa= NULL;
- CustomData *src= &em->fdata;
-
- if(me->mr->use_col) EM_add_data_layer(src, CD_MCOL);
- efa= em->faces.first;
-
- for(i=0; i<lvl->totface; ++i) {
- if(me->mr->use_col) {
- multires_to_mcol(&lvl->colfaces[i], c);
- CustomData_em_set(src, efa->data, CD_MCOL, c);
- }
- efa= efa->next;
- }
-
- }
-
- mesh_update_customdata_pointers(me);
-
- MEM_freeN(eves);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- recalc_editnormals();
- }
-}
-
-void multires_make(void *ob, void *me_v)
-{
- Mesh *me= me_v;
- Key *key;
-
- /* Check for shape keys */
- key= me->key;
- if(key) {
- int ret= okee("Adding multires will delete all shape keys, proceed?");
- if(ret) {
- free_key(key);
- me->key= NULL;
- } else
- return;
- }
-
- waitcursor(1);
-
- multires_check_state();
-
- multires_create(ob, me);
-
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Make multires");
- waitcursor(0);
-}
-
-void multires_delete(void *ob, void *me_v)
-{
- Mesh *me= me_v;
- multires_free(me->mr);
- me->mr= NULL;
-
- multires_check_state();
-
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Apply multires");
-}
-
-/* Make sure that all level indices are clipped to [1, mr->level_count] */
-void multires_clip_levels(Multires *mr)
-{
- if(mr) {
- const int cnt = mr->level_count;
-
- if(mr->current < 1) mr->current = 1;
- if(mr->edgelvl < 1) mr->edgelvl = 1;
- if(mr->pinlvl < 1) mr->pinlvl = 1;
- if(mr->renderlvl < 1) mr->renderlvl = 1;
-
- if(mr->current > cnt) mr->current = cnt;
- if(mr->edgelvl > cnt) mr->edgelvl = cnt;
- if(mr->pinlvl > cnt) mr->pinlvl = cnt;
- if(mr->renderlvl > cnt) mr->renderlvl = cnt;
- }
-}
-
-/* Delete all multires levels beneath current level. Subdivide special
- first-level data up to the new lowest level. */
-void multires_del_lower(void *ob, void *me)
-{
- Multires *mr= ((Mesh*)me)->mr;
- MultiresLevel *lvl1= mr->levels.first, *cr_lvl= current_level(mr);
- MultiresLevel *lvl= NULL, *lvlprev= NULL;
- short *edgeflags= NULL;
- char *edgecreases= NULL;
- int i, last;
-
- if(cr_lvl == lvl1) return;
-
- multires_check_state();
-
- /* Subdivide the edge flags to the current level */
- edgeflags= MEM_callocN(sizeof(short)*current_level(mr)->totedge, "Multires Edge Flags");
- edgecreases= MEM_callocN(sizeof(char)*current_level(mr)->totedge, "Multires Edge Creases");
- last= lvl1->totedge * pow(2, mr->current-1);
- for(i=0; i<last; ++i) {
- edgeflags[i] = mr->edge_flags[(int)(i / pow(2, mr->current-1))];
- edgecreases[i] = mr->edge_creases[(int)(i / pow(2, mr->current-1))];
- }
- MEM_freeN(mr->edge_flags);
- MEM_freeN(mr->edge_creases);
- mr->edge_flags= edgeflags;
- mr->edge_creases= edgecreases;
-
- multires_del_lower_customdata(mr, cr_lvl);
-
- lvl= cr_lvl->prev;
- while(lvl) {
- lvlprev= lvl->prev;
-
- multires_free_level(lvl);
- BLI_freelinkN(&mr->levels, lvl);
-
- mr->current-= 1;
- mr->level_count-= 1;
-
- lvl= lvlprev;
- }
- mr->newlvl= mr->current;
-
- multires_clip_levels(mr);
-
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Multires delete lower");
-}
-
-void multires_del_higher(void *ob, void *me)
-{
- Multires *mr= ((Mesh*)me)->mr;
- MultiresLevel *lvl= BLI_findlink(&mr->levels,mr->current-1);
- MultiresLevel *lvlnext;
-
- multires_check_state();
-
- lvl= lvl->next;
- while(lvl) {
- lvlnext= lvl->next;
-
- multires_free_level(lvl);
- BLI_freelinkN(&mr->levels,lvl);
-
- mr->level_count-= 1;
-
- lvl= lvlnext;
- }
-
- multires_clip_levels(mr);
-
- allqueue(REDRAWBUTSEDIT, 0);
-
- BIF_undo_push("Multires delete higher");
-}
-
-void multires_finish_mesh_update(Object *ob)
-{
- /* friendly check for background render */
- if(G.background==0) {
- object_handle_update(ob);
- countall();
-
- if(G.vd && G.vd->depths) G.vd->depths->damaged= 1;
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- }
-}
-
-void multires_subdivide(void *ob_v, void *me_v)
-{
- Mesh *me = me_v;
-
- multires_check_state();
-
- if(CustomData_number_of_layers(G.obedit ? &G.editMesh->fdata : &me->fdata, CD_MCOL) > 1) {
- int ret= okee("Adding a level will delete all but the active vertex color layer, proceed?");
- if(!ret)
- return;
- }
-
- waitcursor(1);
- multires_add_level(ob_v, me, G.scene->toolsettings->multires_subdiv_type);
- multires_level_to_editmesh(ob_v, me, 0);
- multires_finish_mesh_update(ob_v);
-
- allqueue(REDRAWBUTSEDIT, 0);
- BIF_undo_push("Add multires level");
- waitcursor(0);
-}
-
-void multires_set_level_cb(void *ob, void *me)
-{
- waitcursor(1);
-
- multires_check_state();
-
- multires_set_level(ob, me, 0);
- multires_level_to_editmesh(ob, me, 0);
- multires_finish_mesh_update(ob);
-
- if(G.obedit || G.f & G_SCULPTMODE)
- BIF_undo_push("Multires set level");
-
- allqueue(REDRAWBUTSEDIT, 0);
-
- waitcursor(0);
-}
-
-void multires_edge_level_update_cb(void *ob_v, void *me_v)
-{
- multires_edge_level_update(ob_v, me_v);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-int multires_modifier_warning()
-{
- ModifierData *md;
-
- for(md= modifiers_getVirtualModifierList(OBACT); md; md= md->next) {
- if(md->mode & eModifierMode_Render) {
- switch(md->type) {
- case eModifierType_Subsurf:
- case eModifierType_Build:
- case eModifierType_Mirror:
- case eModifierType_Decimate:
- case eModifierType_Boolean:
- case eModifierType_Array:
- case eModifierType_EdgeSplit:
- return 1;
- }
- }
- }
-
- return 0;
-}
diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c
deleted file mode 100644
index 6166ab18766..00000000000
--- a/source/blender/src/mywindow.c
+++ /dev/null
@@ -1,729 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- *
- * for compatibility with old iris code, replacement of swinopen, winset, etc
- * btw: subwindows in X are way too slow, tried it, and choose for my own system... (ton)
- *
- */
-
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_gsqueue.h"
-
-#include "DNA_screen_types.h"
-
-#include "BKE_global.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "winlay.h"
-
-typedef struct {
- struct bWindow *next, *prev;
- int id, pad;
-
- int xmin, xmax, ymin, ymax;
- float viewmat[4][4], winmat[4][4];
-
- GSQueue *qevents;
-} bWindow;
-
-/* globals */
-static Window *winlay_mainwindow;
-static int curswin=0;
-static bWindow *swinarray[MAXWIN]= {NULL};
-static bWindow mainwindow, renderwindow;
-static int mainwin_color_depth;
-
-/* prototypes --------------- */
-void mywindow_init_mainwin(Window *, int , int , int , int );
-void mywindow_build_and_set_renderwin( int , int , int , int);
-
-void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey)
-{
- GLint r, g, b;
-
- winlay_mainwindow= win;
-
- swinarray[1]= &mainwindow;
- curswin= 1;
-
- mainwindow.xmin= orx;
- mainwindow.ymin= ory;
- mainwindow.xmax= orx+sizex-1;
- mainwindow.ymax= ory+sizey-1;
- mainwindow.qevents= NULL;
-
- myortho2(-0.375, (float)sizex-0.375, -0.375, (float)sizey-0.375);
- glLoadIdentity();
-
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)mainwindow.winmat);
- glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mainwindow.viewmat);
-
- glGetIntegerv(GL_RED_BITS, &r);
- glGetIntegerv(GL_GREEN_BITS, &g);
- glGetIntegerv(GL_BLUE_BITS, &b);
-
- mainwin_color_depth= r + g + b;
- if(G.f & G_DEBUG) {
- printf("Color depth r %d g %d b %d\n", (int)r, (int)g, (int)b);
- glGetIntegerv(GL_AUX_BUFFERS, &r);
- printf("Aux buffers: %d\n", (int)r);
- }
-}
-
-/* XXXXXXXXXXXXXXXX very hacky, because of blenderwindows vs ghostwindows vs renderwindow
- this routine sets up a blenderwin (a mywin)
- */
-void mywindow_build_and_set_renderwin( int orx, int ory, int sizex, int sizey)
-{
-
- swinarray[2]= &renderwindow;
- curswin= 2; /* myortho2 needs this to be set */
-
- renderwindow.xmin= orx;
- renderwindow.ymin= ory;
- renderwindow.xmax= orx+sizex-1;
- renderwindow.ymax= ory+sizey-1;
- renderwindow.qevents= NULL;
-
- myortho2(-0.375, (float)sizex-0.375, -0.375, (float)sizey-0.375);
- glLoadIdentity();
-
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)renderwindow.winmat);
- glGetFloatv(GL_MODELVIEW_MATRIX, (float *)renderwindow.viewmat);
- mywinset(2);
-
-}
-
-/* ------------------------------------------------------------------------- */
-
- /* XXXXX, remove later */
-static bWindow *bwin_from_winid(int winid)
-{
- bWindow *bwin= swinarray[winid];
- if (!bwin) {
- printf("bwin_from_winid: Internal error, bad winid: %d\n", winid);
- }
- return bwin;
-}
-
-int bwin_qtest(int winid)
-{
- return !BLI_gsqueue_is_empty(bwin_from_winid(winid)->qevents);
-}
-int bwin_qread(int winid, BWinEvent *evt_r)
-{
- if (bwin_qtest(winid)) {
- BLI_gsqueue_pop(bwin_from_winid(winid)->qevents, evt_r);
- return 1;
- } else {
- return 0;
- }
-}
-void bwin_qadd(int winid, BWinEvent *evt)
-{
- BLI_gsqueue_push(bwin_from_winid(winid)->qevents, evt);
-}
-
-/* ------------------------------------------------------------------------- */
-
-void bwin_get_rect(int winid, rcti *rect_r)
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
- rect_r->xmin= win->xmin;
- rect_r->ymin= win->ymin;
- rect_r->xmax= win->xmax;
- rect_r->ymax= win->ymax;
- }
-}
-
-void bwin_getsize(int win, int *x, int *y)
-{
- if(win<4) {
- if (win==1) {
- window_get_size(winlay_mainwindow, x, y);
- } else {
- printf("bwin_getsize: Internal error, bad winid: %d\n", win);
- *x= *y= 0;
- }
- } else {
- bWindow *bwin= swinarray[win];
- if (bwin) {
- *x= bwin->xmax-bwin->xmin+1;
- *y= bwin->ymax-bwin->ymin+1;
- }
- }
-}
-
-void bwin_getsuborigin(int win, int *x, int *y)
-{
- if(win<4) {
- *x= *y= 0;
- } else {
- bWindow *bwin= swinarray[win];
- if (bwin) {
- *x= bwin->xmin;
- *y= bwin->ymin;
- }
- }
-}
-
-void bwin_getsinglematrix(int winid, float mat[][4])
-{
- bWindow *win;
- float matview[4][4], matproj[4][4];
-
- win= swinarray[winid];
- if(win==NULL) {
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)matproj);
- glGetFloatv(GL_MODELVIEW_MATRIX, (float *)matview);
- Mat4MulMat4(mat, matview, matproj);
- }
- else {
- Mat4MulMat4(mat, win->viewmat, win->winmat);
- }
-}
-
-/* ------------------------------------------------------------------------- */
-
-void bwin_load_viewmatrix(int winid, float mat[][4])
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
- glLoadMatrixf(mat);
- Mat4CpyMat4(win->viewmat, mat);
- }
-}
-void bwin_load_winmatrix(int winid, float mat[][4])
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
- glLoadMatrixf(mat);
- Mat4CpyMat4(win->winmat, mat);
- }
-}
-
-void bwin_get_viewmatrix(int winid, float mat[][4])
-{
- bWindow *win= bwin_from_winid(winid);
- if(win)
- Mat4CpyMat4(mat, win->viewmat);
-}
-void bwin_get_winmatrix(int winid, float mat[][4])
-{
- bWindow *win= bwin_from_winid(winid);
- if(win)
- Mat4CpyMat4(mat, win->winmat);
-}
-
-void bwin_multmatrix(int winid, float mat[][4])
-{
- bWindow *win= bwin_from_winid(winid);
-
- if(win) {
- glMultMatrixf((float*) mat);
- glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->viewmat);
- }
-}
-
-void bwin_scalematrix(int winid, float x, float y, float z)
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
- glScalef(x, y, z);
- glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->viewmat);
- }
-}
-
-void bwin_clear_viewmat(int swin)
-{
- bWindow *win;
-
- win= swinarray[swin];
- if(win==NULL) return;
-
- memset(win->viewmat, 0, sizeof(win->viewmat));
- win->viewmat[0][0]= 1.0;
- win->viewmat[1][1]= 1.0;
- win->viewmat[2][2]= 1.0;
- win->viewmat[3][3]= 1.0;
-}
-
-
-void myloadmatrix(float mat[][4])
-{
- if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) {
- bwin_load_viewmatrix(curswin, mat);
- } else {
- bwin_load_winmatrix(curswin, mat);
- }
-}
-
-void mygetmatrix(float mat[][4])
-{
- if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) {
- bwin_get_viewmatrix(curswin, mat);
- } else {
- bwin_get_winmatrix(curswin, mat);
- }
-}
-
-void mymultmatrix(float mat[][4])
-{
- bwin_multmatrix(curswin, mat);
-}
-
-void mygetsingmatrix(float mat[][4])
-{
- bwin_getsinglematrix(curswin, mat);
-}
-
-int mywinget(void)
-{
- return curswin;
-}
-
-void mywinset(int wid)
-{
- bWindow *win;
-
- win= swinarray[wid];
- if(win==NULL) {
- printf("mywinset %d: doesn't exist\n", wid);
- return;
- }
- if (wid == 1 || wid == 2) { /* main window or renderwindow*/
- glViewport(0, 0, ( win->xmax-win->xmin)+1, ( win->ymax-win->ymin)+1);
- glScissor(0, 0, ( win->xmax-win->xmin)+1, ( win->ymax-win->ymin)+1);
- }
- else {
- int width= (win->xmax - win->xmin)+1;
- int height= (win->ymax - win->ymin)+1;
-
- /* CRITICAL, this clamping ensures that
- * the viewport never goes outside the screen
- * edges (assuming the x, y coords aren't
- * outside). This causes a hardware lock
- * on Matrox cards if it happens.
- *
- * Really Blender should never _ever_ try
- * to do such a thing, but just to be safe
- * clamp it anyway (or fix the bScreen
- * scaling routine, and be damn sure you
- * fixed it). - zr
- */
- if (win->xmin + width>G.curscreen->sizex)
- width= G.curscreen->sizex - win->xmin;
- if (win->ymin + height>G.curscreen->sizey)
- height= G.curscreen->sizey - win->ymin;
-
- glViewport(win->xmin, win->ymin, width, height);
- glScissor(win->xmin, win->ymin, width, height);
- }
-
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(&win->winmat[0][0]);
- glMatrixMode(GL_MODELVIEW);
- glLoadMatrixf(&win->viewmat[0][0]);
-
- glFlush();
-
- curswin= wid;
-}
-
-int myswinopen(int parentid, int xmin, int xmax, int ymin, int ymax)
-{
- bWindow *win= NULL;
- int freewinid;
-
- for (freewinid= 4; freewinid<MAXWIN; freewinid++)
- if (!swinarray[freewinid])
- break;
-
- /* this case is not handled in Blender, so will crash. use myswinopen_allowed() first to check */
- if (freewinid==MAXWIN) {
- printf("too many windows\n");
-
- return 0;
- }
- else {
- win= MEM_callocN(sizeof(*win), "winopen");
-
- win->id= freewinid;
- swinarray[win->id]= win;
-
- win->xmin= xmin;
- win->ymin= ymin;
- win->xmax= xmax;
- win->ymax= ymax;
-
- win->qevents= BLI_gsqueue_new(sizeof(BWinEvent));
-
- Mat4One(win->viewmat);
- Mat4One(win->winmat);
-
- mywinset(win->id);
-
- return win->id;
- }
-}
-
-int myswinopen_allowed(void)
-{
- int totfree=0;
- int freewinid;
-
- for (freewinid= 4; freewinid<MAXWIN; freewinid++)
- if (swinarray[freewinid]==NULL)
- totfree++;
- if(totfree<2)
- return 0;
- return 1;
-}
-
-void mywinclose(int winid)
-{
- if (winid<4) {
- if (winid==1) {
- window_destroy(winlay_mainwindow);
- winlay_mainwindow= NULL;
- } else {
- printf("mwinclose: Internal error, bad winid: %d\n", winid);
- }
- } else {
- bWindow *win= swinarray[winid];
-
- if (win) {
- BLI_gsqueue_free(win->qevents);
- MEM_freeN(win);
- } else {
- printf("mwinclose: Internal error, bad winid: %d\n", winid);
- }
- }
-
- swinarray[winid]= NULL;
- if (curswin==winid) curswin= 0;
-}
-
-void mywinposition(int winid, int xmin, int xmax, int ymin, int ymax) /* watch: syntax differs from iris */
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
- win->xmin= xmin;
- win->ymin= ymin;
- win->xmax= xmax;
- win->ymax= ymax;
- }
-}
-
-
-void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f)
-{
- bWindow *bwin= bwin_from_winid(winid);
- if(bwin) {
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-
- glOrtho(x1, x2, y1, y2, n, f);
-
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)bwin->winmat);
- glMatrixMode(GL_MODELVIEW);
- }
-}
-
-void bwin_ortho2(int win, float x1, float x2, float y1, float y2)
-{
- bwin_ortho(win, x1, x2, y1, y2, -1, 1);
-}
-
-void bwin_frustum(int winid, float x1, float x2, float y1, float y2, float n, float f)
-{
- bWindow *win= bwin_from_winid(winid);
- if(win) {
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(x1, x2, y1, y2, n, f);
-
- glGetFloatv(GL_PROJECTION_MATRIX, (float *)win->winmat);
- glMatrixMode(GL_MODELVIEW);
- }
-}
-
-void myortho(float x1, float x2, float y1, float y2, float n, float f)
-{
- bwin_ortho(curswin, x1, x2, y1, y2, n, f);
-}
-
-void myortho2(float x1, float x2, float y1, float y2)
-{
- /* prevent opengl from generating errors */
- if(x1==x2) x2+=1.0;
- if(y1==y2) y2+=1.0;
- bwin_ortho(curswin, x1, x2, y1, y2, -100, 100);
-}
-
-void mywindow(float x1, float x2, float y1, float y2, float n, float f)
-{
- bwin_frustum(curswin, x1, x2, y1, y2, n, f);
-}
-
-#ifdef __APPLE__
-
-/* apple seems to round colors to below and up on some configs */
-
-static unsigned int index_to_framebuffer(int index)
-{
- unsigned int i= index;
-
- switch(mainwin_color_depth) {
- case 12:
- i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
- /* sometimes dithering subtracts! */
- i |= 0x070707;
- break;
- case 15:
- case 16:
- i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
- i |= 0x030303;
- break;
- case 24:
- break;
- default: // 18 bits...
- i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
- i |= 0x010101;
- break;
- }
-
- return i;
-}
-
-#else
-
-/* this is the old method as being in use for ages.... seems to work? colors are rounded to lower values */
-
-static unsigned int index_to_framebuffer(int index)
-{
- unsigned int i= index;
-
- switch(mainwin_color_depth) {
- case 8:
- i= ((i & 48)<<18) + ((i & 12)<<12) + ((i & 3)<<6);
- i |= 0x3F3F3F;
- break;
- case 12:
- i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
- /* sometimes dithering subtracts! */
- i |= 0x0F0F0F;
- break;
- case 15:
- case 16:
- i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
- i |= 0x070707;
- break;
- case 24:
- break;
- default: // 18 bits...
- i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
- i |= 0x030303;
- break;
- }
-
- return i;
-}
-
-#endif
-
-void set_framebuffer_index_color(int index)
-{
- cpack(index_to_framebuffer(index));
-}
-
-int framebuffer_to_index(unsigned int col)
-{
- if (col==0) return 0;
-
- switch(mainwin_color_depth) {
- case 8:
- return ((col & 0xC00000)>>18) + ((col & 0xC000)>>12) + ((col & 0xC0)>>6);
- case 12:
- return ((col & 0xF00000)>>12) + ((col & 0xF000)>>8) + ((col & 0xF0)>>4);
- case 15:
- case 16:
- return ((col & 0xF80000)>>9) + ((col & 0xF800)>>6) + ((col & 0xF8)>>3);
- case 24:
- return col & 0xFFFFFF;
- default: // 18 bits...
- return ((col & 0xFC0000)>>6) + ((col & 0xFC00)>>4) + ((col & 0xFC)>>2);
- }
-}
-
-
-/* ********** END MY WINDOW ************** */
-
-void myswapbuffers(void)
-{
- ScrArea *sa;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->win_swap==WIN_BACK_OK) sa->win_swap= WIN_FRONT_OK;
- if(sa->head_swap==WIN_BACK_OK) sa->head_swap= WIN_FRONT_OK;
-
- sa= sa->next;
- }
-
- /* HACK, some windows drivers feel they should honor the scissor
- * test when swapping buffers, disable the test while swapping
- * on WIN32. (namely Matrox and NVidia's new drivers around Oct 1 2001)
- * - zr
- */
-
-#ifdef WIN32
- /* HACK, in some NVidia driver release some kind of
- * fancy optimiziation (I presume) was put in which for
- * some reason causes parts of the buffer not to be
- * swapped. One way to defeat it is the following wierd
- * code (which we only do for nvidia cards). This should
- * be removed if NVidia fixes their drivers. - zr
- */
- if (is_a_really_crappy_nvidia_card()) {
- glDrawBuffer(GL_FRONT);
-
- glBegin(GL_LINES);
- glEnd();
-
- glDrawBuffer(GL_BACK);
- }
-
- glDisable(GL_SCISSOR_TEST);
- window_swap_buffers(winlay_mainwindow);
- glEnable(GL_SCISSOR_TEST);
-#else
- window_swap_buffers(winlay_mainwindow);
-#endif
-}
-
-
-/* *********************** PATTERNS ETC ***************** */
-
-void setlinestyle(int nr)
-{
- if(nr==0) {
- glDisable(GL_LINE_STIPPLE);
- }
- else {
-
- glEnable(GL_LINE_STIPPLE);
- glLineStipple(nr, 0xAAAA);
- }
-}
-
-/*******************/
-/*******************/
-/* Menu utilities */
-
-static int *frontbuffer_save= NULL;
-static int ov_x, ov_y, ov_sx, ov_sy;
-
-/*
-#if defined(__sgi) || defined(__sun) || defined(__sun__) || defined (__sparc) || defined (__sparc__)
-*/
-/* this is a dirty patch: gets sometimes the backbuffer */
-/* my_get_frontbuffer_image(0, 0, 1, 1);
-my_put_frontbuffer_image();
-#endif
-*/
-
-void my_put_frontbuffer_image(void)
-{
- if (frontbuffer_save) {
- glRasterPos2f( (float)ov_x -0.5, (float)ov_y - 0.5 );
- glDrawPixels(ov_sx, ov_sy, GL_RGBA, GL_UNSIGNED_BYTE, frontbuffer_save);
- MEM_freeN(frontbuffer_save);
- frontbuffer_save= NULL;
- }
-}
-
-void my_get_frontbuffer_image(int x, int y, int sx, int sy)
-{
- if(frontbuffer_save) return;
-
- ov_x= x;
- ov_y= y;
- ov_sx= sx;
- ov_sy= sy;
-
- if(sx>1 && sy>1) {
- frontbuffer_save= MEM_mallocN(sx*sy*4, "temp_frontbuffer_image");
- glReadPixels(x, y, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, frontbuffer_save);
- }
-
- #ifdef WIN32
- /* different coord system! */
- y= (G.curscreen->sizey-y);
-
- if(curswin>3) {
- y -= curarea->winrct.ymin;
- }
- #endif
-}
-
-int mywin_inmenu(void) {
- return frontbuffer_save?1:0;
-}
-
-void mywin_getmenu_rect(int *x, int *y, int *sx, int *sy) {
- *x= ov_x;
- *sx= ov_sx;
- *sy= ov_sy;
-
-#if defined(WIN32) || defined (__BeOS)
- *y= ov_y;
-#else
- *y= (G.curscreen->sizey - ov_y) - ov_sy;
-#endif
-}
diff --git a/source/blender/src/oops.c b/source/blender/src/oops.c
deleted file mode 100644
index 51d83eff3e6..00000000000
--- a/source/blender/src/oops.c
+++ /dev/null
@@ -1,1178 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_key_types.h"
-#include "DNA_group_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_armature_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_oops.h"
-#include "BIF_drawoops.h"
-#include "BIF_outliner.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-static int correct_oops_y(Oops *oops);
-
-
-Oops *add_oops(void *id)
-{
- Oops *oops;
-
- if(G.soops==0) return NULL;
- oops= MEM_callocN(sizeof(Oops), "oops");
-
- BLI_addtail(&G.soops->oops, oops);
-
- oops->id= id;
- oops->type= GS(oops->id->name);
-
- return oops;
-}
-
-
-Oops *find_oops(ID *id)
-{
- Oops *oops;
-
- /* searching for an oops with this ID */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->id == id) {
- /* this error once happened. securing it doesnt harm */
- if(oops->type != GS(id->name)) oops->id= 0;
- else break;
- }
- oops= oops->next;
- }
- return oops;
-}
-
-/* never even called! (ton) */
-int test_oops(Oops *oops)
-{
- /* test if own ID block still exists */
- ListBase *lb;
- ID *id;
-
- if(G.soops==0) return 0;
-
- lb= wich_libbase(G.main, oops->type);
- id= lb->first;
- while(id) {
- if(id==oops->id) break;
- id= id->next;
- }
-
- if(id==0) return 0;
-
-
- return 1;
-}
-
-void test_oopslinko(OopsLink *ol)
-{
- /* test if links exist */
- Oops *oops;
- ListBase *lb;
- ID *id, *from;
-
- if(G.soops==0) return;
-
- ol->to= 0;
- from= *ol->idfrom;
-
- if(from==0) return;
-
- lb= wich_libbase(G.main, ol->type);
- id= lb->first;
- while(id) {
- if(id==from) break;
- id= id->next;
- }
-
- if(id==0) {
- /* ID does not exist anymore */
- *ol->idfrom= 0;
- }
- else {
- /* search for oops with this ID */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->id == id) break;
- oops= oops->next;
- }
-
- ol->to= oops;
- }
-}
-
-void test_oopslink(OopsLink *ol)
-{
- /* test if links exist */
- Oops *oops;
- ID *from;
-
- if(G.soops==0) return;
-
- ol->to= 0;
- from= *ol->idfrom;
-
- if(from==0) return;
-
- /* search for oops with this ID */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->id == from) break;
- oops= oops->next;
- }
-
- ol->to= oops;
- if(oops) oops->flag |= OOPS_REFER;
-}
-
-
-OopsLink *add_oopslink(char *name, Oops *oops, short type, void *from, float xof, float yof)
-{
- OopsLink *ol;
-
- if(G.soops==0) return NULL;
-
- /* testing if it exsists: */
- /* ol= oops->link.first; */
- /* while(ol) { */
- /* if(ol->idfrom == from) { */
- /* strncpy(ol->name, name, 11); */
- /* ol->type= type; */
- /* ol->xof= xof; */
- /* ol->yof= yof; */
- /* return ol; */
- /* } */
- /* ol= ol->next; */
- /* } */
-
- if(* ((int *)from) == 0) return NULL;
-
- /* make new */
- ol= MEM_callocN(sizeof(OopsLink), "oopslink");
-
- BLI_addtail(&oops->link, ol);
-
- ol->type= type;
- ol->idfrom= from;
- ol->xof= xof;
- ol->yof= yof;
- BLI_strncpy(ol->name, name, sizeof(ol->name));
-
- return ol;
-}
-
-int oops_test_overlap(Oops *test)
-{
- Oops *oops;
- rctf rt, ro;
-
- rt.xmin= test->x;
- rt.xmax= (float)(test->x+OOPSX);
- rt.ymin= test->y;
- rt.ymax= (float)(test->y+OOPSY);
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops!=test) { /* do net test for hide: is only a temporal flag */
-
- ro.xmin= oops->x;
- ro.xmax= (float)(oops->x+OOPSX);
- ro.ymin= oops->y;
- ro.ymax= (float)(oops->y+OOPSY);
-
- if( BLI_isect_rctf(&rt, &ro, 0) ) return 1;
-
- }
- oops= oops->next;
- }
-
- return 0;
-}
-
-int oops_test_overlaphide(Oops *test)
-{
- Oops *oops;
- rctf rt, ro;
-
- rt.xmin= (float)(test->x);
- rt.xmax= (float)(test->x+OOPSX);
- rt.ymin= (float)(test->y);
- rt.ymax= (float)(test->y+OOPSY);
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0 && oops!=test) { /* do test for hide, but not use it during build_oops */
-
- ro.xmin= oops->x;
- ro.xmax= (float)(oops->x+OOPSX);
- ro.ymin= oops->y;
- ro.ymax= (float)(oops->y+OOPSY);
-
- if( BLI_isect_rctf(&rt, &ro, 0) ) return 1;
-
- }
- oops= oops->next;
- }
-
- return 0;
-}
-
-float oopslink_totlen(Oops *oops)
-{
- OopsLink *ol;
- float vec[4], dx, dy, len= 0.0;
-
-
- ol= oops->link.first;
- while(ol) {
- if(ol->to) {
- give_oopslink_line(oops, ol, vec, vec+2);
-
- dx= vec[0]-vec[2];
- dy= vec[1]-vec[3];
-
- len+= (float)sqrt( dx*dx + dy*dy );
- }
- ol= ol->next;
- }
- return len;
-}
-
-
-void add_from_link(Oops *from, Oops *oops)
-{
- OopsLink *ol;
-
- ol= MEM_callocN(sizeof(OopsLink), "oopslinktemp");
- BLI_addtail(&oops->link, ol);
- ol->from= from;
-
-}
-
-void shuffle_oops()
-{
- Oops *o2, *oops;
- OopsLink *ol, *oln;
- float olen, len1, f1, f2;
- int go= 1, tot=0, dir=1, type1, type2;
-
-
- /* we take two oopses, calc the 'beauty' and the exchanged beauty */
-
- if(G.soops==0) return;
-
- waitcursor(1);
-
- /* to make it 100% OK and fast: temporal insert
- * to the ooplinklist - per oops - the 'from' links.
- * Don't forget to free!
- */
-
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- ol= oops->link.first;
- while(ol) {
- if(ol->to && ol->to->hide==0) {
- if(ol->to->flag & SELECT) {
- add_from_link(oops, ol->to);
- }
- }
- ol= ol->next;
- }
- }
- oops= oops->next;
- }
-
- while(go) {
-
- go= 0;
- dir= 1-dir;
- tot++;
-
- if(dir) oops= G.soops->oops.last;
- else oops= G.soops->oops.first;
- while(oops) {
-
- if(oops->link.first && oops->hide==0 && (oops->flag & SELECT)) {
- /* find a good exchangable pair */
- olen= oopslink_totlen(oops);
-
- if(dir) o2= oops->prev;
- else o2= oops->next;
-
- if ELEM3(oops->type, ID_OB, ID_LI, ID_SCE) type1= 1; else type1= 0;
-
-
- while(o2) {
- if(o2->hide==0 && (o2->flag & SELECT)) {
-
- if ELEM3(o2->type, ID_OB, ID_LI, ID_SCE) type2= 1; else type2= 0;
-
- if(type1==type2) {
-
- len1= oopslink_totlen(o2);
-
- SWAP(float, oops->x, o2->x);
- SWAP(float, oops->y, o2->y);
-
- f1= oopslink_totlen(oops);
- f2= oopslink_totlen(o2);
-
- if( f1<=olen && f2<len1) { /* 1 x <= !!! */
- olen= oopslink_totlen(oops);
- go= 1;
- }
- else {
- SWAP(float, oops->x, o2->x);
- SWAP(float, oops->y, o2->y);
- }
- }
- }
- if(dir) o2= o2->prev;
- else o2= o2->next;
- }
- }
- if(dir) oops= oops->prev;
- else oops= oops->next;
-
-
- }
- if(tot>5) break;
- }
- waitcursor(0);
-
- /* free the from links */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- ol= oops->link.first;
- while(ol) {
- oln= ol->next;
- if(ol->from) {
- BLI_remlink(&oops->link, ol);
- MEM_freeN(ol);
- }
- ol= oln;
- }
- }
- oops= oops->next;
- }
-
- allqueue(REDRAWOOPS, 1);
-}
-
-void shrink_oops()
-{
- Oops *oops;
- OopsLink *ol;
- float vec[4];
- int /* go= 1, */tot=4;
-
-
- if(G.soops==0) return;
-
- if(okee("Shrink oops")==0) return;
-
- waitcursor(1);
-
- /* clear */
- oops= G.soops->oops.first;
- while(oops) {
- oops->dx= oops->dy= 0.0;
- oops= oops->next;
- }
-
- while(tot) {
- tot--;
-
- /* shrink */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->link.first && oops->hide==0 && (oops->flag & SELECT)) {
-
- ol= oops->link.first;
- while(ol) {
- if(ol->to && ol->to->hide==0) {
-
- give_oopslink_line(oops, ol, vec, vec+2);
-
- oops->dx= (float)(.8*oops->dx + .2*( vec[2]-vec[0]));
- oops->dy= (float)(.8*oops->dy + .2*( vec[3]-vec[1]));
-
- if(ol->to->flag & SELECT) {
- ol->to->dx= (float)(.8*ol->to->dx + .2*( vec[0]-vec[2]));
- ol->to->dy= (float)(.8*ol->to->dy + .2*( vec[1]-vec[3]));
- }
- }
-
- ol= ol->next;
- }
- }
- oops= oops->next;
- }
-
- /* apply */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0 && (oops->flag & SELECT)) {
-
- /* shrink */
- oops->x+= oops->dx;
- oops->y+= oops->dy;
-
- if(oops_test_overlaphide(oops)) {
- oops->x-= oops->dx;
- oops->y-= oops->dy;
- }
-
- oops->dx= oops->dy= 0.0;
- }
- oops= oops->next;
- }
- }
- waitcursor(0);
-
- allqueue(REDRAWOOPS, 1);
-}
-
-#define LIMSCE -20.0
-#define LIMOB 14.0
-#define LIMDATA 24.0
-
-static int correct_oops_y(Oops *oops)
-{
- float y;
-
- y= oops->y;
-
- switch(oops->type) {
- case ID_SCE:
- case ID_LI:
- if(oops->y > LIMSCE-OOPSY) oops->y= (float)(LIMSCE-OOPSY);
- break;
- case ID_OB:
- CLAMP(oops->y, LIMSCE, LIMOB);
- break;
- case ID_IP:
- case ID_MA:
- case ID_TE:
- if(oops->y < LIMDATA+OOPSY) oops->y= (float)(LIMDATA+OOPSY);
- break;
- default:
- CLAMP(oops->y, (float)(LIMOB+OOPSY), LIMDATA);
- break;
- }
-
- if(y==oops->y) return 0;
- else return 1;
-}
-
-float oopslastx=0.0, oopslasty= 0.0;
-
-void new_oops_location(Oops *new)
-{
- float dirvec[4][2];
- static int cnt=0;
- int a, b, rc= 1, tel=1, ok=0;
-
- if(G.soops==0) return;
-
- if(G.soops->oops.first==G.soops->oops.last) {
- oopslastx= oopslasty= 0.0;
- }
-
- cnt++;
-
- new->x= oopslastx;
- new->y= oopslasty;
-
- correct_oops_y(new);
-
- /* find from center free location */
- dirvec[cnt & 3][0]= 1.2*OOPSX;
- dirvec[cnt & 3][1]= 0;
- cnt++;
- dirvec[cnt & 3][0]= 0;
- dirvec[cnt & 3][1]= (float)(-1.2*OOPSY);
- cnt++;
- dirvec[cnt & 3][0]= -1.2*OOPSX;
- dirvec[cnt & 3][1]= 0;
- cnt++;
- dirvec[cnt & 3][0]= 0;
- dirvec[cnt & 3][1]= (float)(1.2*OOPSY);
- cnt++;
-
-
- new->x+= dirvec[ (rc-2) & 3][0];
- new->y+= dirvec[ (rc-2) & 3][1];
- rc+= correct_oops_y(new);
-
- if( oops_test_overlap(new)==0 ) {
- ok= 1;
- }
-
- rc++;
-
- if(ok==0) {
- new->x+= dirvec[ (rc-1) & 3][0];
- new->y+= dirvec[ (rc-1) & 3][1];
- rc+= correct_oops_y(new);
-
- if(oops_test_overlap(new)==0 ) {
- ok= 1;
- }
- rc++;
- }
-
-
- while(ok==0) {
-
- for(a=0;a<2;a++) {
- for(b=0;b<tel;b++) {
-
- if( oops_test_overlap(new)==0 ) {
- ok= 1;
- break;
- }
-
- rc &= 3;
- new->x += dirvec[rc][0];
- new->y += dirvec[rc][1];
- rc+= correct_oops_y(new);
- }
- rc++;
-
-
-
- if(ok) break;
- }
- if(ok || tel>100) break;
- tel++;
- }
- oopslastx= new->x;
- oopslasty= new->y;
-
-}
-
-
-void free_oops(Oops *oops) /* also oops itself */
-{
- BLI_freelistN(&oops->link);
- MEM_freeN(oops);
-}
-
-void free_oopspace(SpaceOops *so)
-{
- Oops *oops;
-
- while( (oops= so->oops.first) ) {
- BLI_remlink(&so->oops, oops);
- free_oops(oops);
- }
-
- outliner_free_tree(&so->tree);
- if(so->treestore) {
- if(so->treestore->data) MEM_freeN(so->treestore->data);
- MEM_freeN(so->treestore);
- }
-}
-
-void add_material_oopslinks(Material *ma, Oops *oops, short flag)
-{
- int a;
-
- if(flag & OOPS_TE) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) add_oopslink("tex", oops, ID_TE, &(ma->mtex[a]->tex), (float)(0.5*OOPSX), (float)OOPSY);
- }
- }
- if(flag & OOPS_OB) {
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) add_oopslink("ob", oops, ID_OB, &(ma->mtex[a]->object), 0.0, (float)(0.2*OOPSY));
- }
- }
- if(flag & OOPS_IP)
- if(ma->ipo) add_oopslink("ipo", oops, ID_IP, &(ma->ipo), OOPSX, (float)(0.5*OOPSY));
-
- if (ma->group)
- add_oopslink("group", oops, ID_GR, &(ma->group), OOPSX, (float)(0.5*OOPSY));
-}
-
-void add_group_oopslinks(Group *gp, Oops *oops, short flag)
-{
- GroupObject *gob;
- if(flag & OOPS_GR) {
- for(gob=gp->gobject.first; gob; gob= gob->next) {
- add_oopslink("group", oops, ID_GR, &(gob->ob), (float)(0.5*OOPSX), (float)OOPSY);
- }
- }
-}
-
-void add_object_oopslinks(Object *ob, Oops *oops, short flag)
-{
- ID *id;
-
- if(ob->parent) add_oopslink("parent", oops, ID_OB, &ob->parent, (float)(.6*OOPSX), (float)OOPSY);
- if(ob->track) add_oopslink("parent", oops, ID_OB, &ob->track, (float)(.4*OOPSX), (float)OOPSY);
-
- id= ob->data;
- if(id) {
- switch( GS(id->name) ) {
- case ID_ME:
- if(flag & OOPS_ME) add_oopslink("data", oops, ID_ME, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_CU:
- if(flag & OOPS_CU) add_oopslink("data", oops, ID_CU, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_MB:
- if(flag & OOPS_MB) add_oopslink("data", oops, ID_MB, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_LT:
- if(flag & OOPS_LT) add_oopslink("data", oops, ID_LT, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_LA:
- if(flag & OOPS_LA) add_oopslink("data", oops, ID_LA, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_CA:
- if(flag & OOPS_CA) add_oopslink("data", oops, ID_CA, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_AR:
- if(flag & OOPS_AR) add_oopslink("data", oops, ID_AR, &ob->data, (float)(.5*OOPSX), (float)OOPSY);
- break;
- }
- }
-
- if(flag & OOPS_MA) {
- short a;
-
- for(a=0; a<ob->totcol; a++) {
- if(ob->mat[a]) {
- add_oopslink("mat", oops, ID_MA, ob->mat+a, 0, (float)(0.5*OOPSY));
- }
- }
- }
-
- if(flag & OOPS_IP) add_oopslink("ipo", oops, ID_IP, &ob->ipo, OOPSX, (float)(0.5*OOPSY));
-
- if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
- add_oopslink("group", oops, ID_GR, &ob->dup_group, OOPSX, (float)(0.5*OOPSY));
-}
-
-void add_mesh_oopslinks(Mesh *me, Oops *oops, short flag)
-{
- int a;
-
- if(flag & OOPS_MA) {
- for(a=0; a<me->totcol; a++) {
- if(me->mat[a]) {
- add_oopslink("ma", oops, ID_MA, me->mat+a, 0.0, (float)(0.5*OOPSY));
- }
- }
- }
- if(flag & OOPS_IP) {
- if(me->key) add_oopslink("ipo", oops, ID_IP, &me->key->ipo, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-void add_curve_oopslinks(Curve *cu, Oops *oops, short flag)
-{
- int a;
-
- if(flag & OOPS_MA) {
- for(a=0; a<cu->totcol; a++) {
- if(cu->mat[a]) {
- add_oopslink("ma", oops, ID_MA, cu->mat+a, 0.0, (float)(0.5*OOPSY));
- }
- }
- }
- if(flag & OOPS_IP) {
- add_oopslink("speed", oops, ID_IP, &cu->ipo, OOPSX, (float)(0.5*OOPSY));
- if(cu->key) add_oopslink("ipo", oops, ID_IP, &cu->key->ipo, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-void add_mball_oopslinks(MetaBall *mb, Oops *oops, short flag)
-{
- int a;
-
- if(flag & OOPS_MA) {
- for(a=0; a<mb->totcol; a++) {
- if(mb->mat[a]) {
- add_oopslink("ma", oops, ID_MA, mb->mat+a, 0.0, (float)(0.5*OOPSY));
- }
- }
- }
-}
-
-void add_lamp_oopslinks(Lamp *la, Oops *oops, short flag)
-{
- int a;
-
- if(flag & OOPS_TE) {
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) {
- add_oopslink("tex", oops, ID_TE, &(la->mtex[a]->tex), 0.0, (float)(0.5*OOPSY));
- }
- }
- }
- if(flag & OOPS_IP) {
- add_oopslink("ipo", oops, ID_IP, &la->ipo, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-void add_camera_oopslinks(Camera *ca, Oops *oops, short flag)
-{
- if(flag & OOPS_IP) {
- add_oopslink("ipo", oops, ID_IP, &ca->ipo, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-void add_texture_oopslinks(Tex *tex, Oops *oops, short flag)
-{
- if(flag & OOPS_IM) {
- add_oopslink("image", oops, ID_IM, &tex->ima, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-void add_lattice_oopslinks(Lattice *lt, Oops *oops, short flag)
-{
- if(flag & OOPS_IP) {
- if(lt->key) add_oopslink("ipo", oops, ID_IP, &lt->key->ipo, OOPSX, (float)(0.5*OOPSY));
- }
-}
-
-Oops *add_test_oops(void *id) /* incl links */
-{
- Oops *oops;
- Object *ob;
-
- if(id==0) return NULL;
-
- /* test if it exists */
- oops= find_oops(id);
-
- if(oops) {
- oops->hide= 0;
- }
- else {
- oops= add_oops(id);
- new_oops_location(oops);
- if(G.soops->flag & SO_NEWSELECTED) {
- oops->flag |= SELECT;
- }
- }
-
- switch( GS( ((ID *)id)->name)) {
- case ID_SCE:
- add_oopslink("set", oops, ID_SCE, &((Scene *)id)->set, (float)(.5*OOPSX), (float)OOPSY);
- break;
- case ID_OB:
- ob= (Object *)id;
- if(ob->flag & SELECT) oops->flag |= SELECT;
- else oops->flag &= ~SELECT;
- add_object_oopslinks(ob, oops, G.soops->visiflag);
- break;
- case ID_ME:
- add_mesh_oopslinks((Mesh *)id, oops, G.soops->visiflag);
- break;
- case ID_CU:
- add_curve_oopslinks((Curve *)id, oops, G.soops->visiflag);
- break;
- case ID_MB:
- add_mball_oopslinks((MetaBall *)id, oops, G.soops->visiflag);
- break;
- case ID_LA:
- add_lamp_oopslinks((Lamp *)id, oops, G.soops->visiflag);
- break;
- case ID_CA:
- add_camera_oopslinks((Camera *)id, oops, G.soops->visiflag);
- break;
- case ID_IP:
-
- break;
- case ID_MA:
- add_material_oopslinks((Material *)id, oops, G.soops->visiflag);
- break;
- case ID_GR:
- add_group_oopslinks((Group *)id, oops, G.soops->visiflag);
- break;
- case ID_TE:
- add_texture_oopslinks((Tex *)id, oops, G.soops->visiflag);
- break;
- case ID_LT:
- add_lattice_oopslinks((Lattice *)id, oops, G.soops->visiflag);
- break;
- case ID_AR:
-
- break;
- }
-
- return oops;
-}
-
-void add_texture_oops(Material *ma)
-{
- int a;
-
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) {
- add_test_oops(ma->mtex[a]->tex);
- if(ma->mtex[a]->tex) if(G.soops->visiflag & OOPS_IM) add_test_oops(ma->mtex[a]->tex->ima);
- }
- }
-}
-
-void build_oops()
-{
- Oops *oops;
- OopsLink *ol;
- ID *id;
- Base *base;
- Object *ob;
- short a, type;
-
- /* always build it all! */
-
- if(G.soops==0) return;
-
- /* set hide flags */
- oops= G.soops->oops.first;
- while(oops) {
- oops->hide= 1;
- oops->flag &= ~OOPS_REFER;
-
- BLI_freelistN(&oops->link); /* much safer */
-
- oops= oops->next;
- }
-
- /* make oops, includes testing for existance */
-
- /* always */
- if(G.soops->visiflag & OOPS_LI) {
- Library *li= G.main->library.first;
- while(li) {
- oops= add_test_oops(li);
- li= li->id.next;
- }
- }
-
- /* the rest in 2 ways: or everything (OOPS_SCE) or only the ones in this scene */
-
- if(G.soops->visiflag & OOPS_SCE) {
- Scene *sce= G.main->scene.first;
-
- while(sce) {
-
- oops= add_test_oops(sce);
-
- if(G.soops->visiflag & OOPS_OB) {
- base= sce->base.first;
- while(base) {
-
- add_oopslink("object", oops, ID_OB, &base->object, (float)(.5*OOPSX), (float)OOPSY);
- base= base->next;
- }
- }
-
- sce= sce->id.next;
- }
-
- if(G.soops->visiflag & OOPS_OB) {
- Object *ob= G.main->object.first;
-
- while(ob) {
- oops= add_test_oops(ob);
- ob= ob->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_ME) {
- Mesh *me= G.main->mesh.first;
- while(me) {
- oops= add_test_oops(me);
- me= me->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_CU) {
- Curve *cu= G.main->curve.first;
- while(cu) {
- oops= add_test_oops(cu);
- cu= cu->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_MB) {
- MetaBall *mb= G.main->mball.first;
- while(mb) {
- oops= add_test_oops(mb);
- mb= mb->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_LA) {
- Lamp *la= G.main->lamp.first;
- while(la) {
- oops= add_test_oops(la);
- la= la->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_CA) {
- Camera *ca= G.main->camera.first;
- while(ca) {
- oops= add_test_oops(ca);
- ca= ca->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_IP) {
- Ipo *ipo= G.main->ipo.first;
- while(ipo) {
- oops= add_test_oops(ipo);
- ipo= ipo->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_MA) {
- Material *ma= G.main->mat.first;
- while(ma) {
- oops= add_test_oops(ma);
- ma= ma->id.next;
- }
- }
- if(G.soops->visiflag & OOPS_TE) {
- Tex *tex= G.main->tex.first;
- while(tex) {
- oops= add_test_oops(tex);
- tex= tex->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_IM) {
- Image *ima= G.main->image.first;
- while(ima) {
- oops= add_test_oops(ima);
- ima= ima->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_GR) {
- Group *gp= G.main->group.first;
- while(gp) {
- oops= add_test_oops(gp);
- gp= gp->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_LT) {
- Lattice *lt= G.main->latt.first;
- while(lt) {
- oops= add_test_oops(lt);
- lt= lt->id.next;
- }
- }
-
- if(G.soops->visiflag & OOPS_AR) {
- bArmature *ar= G.main->armature.first;
- while(ar) {
- oops= add_test_oops(ar);
- ar= ar->id.next;
- }
- }
-
- }
- else {
-
- /* only blocks from this scene */
-
- base= FIRSTBASE;
- while(base) {
-
- /* layer? */
- if( (G.soops->visiflag & OOPS_LAY)==0 || (base->lay & G.scene->lay)) {
- ob= base->object;
-
- if(G.soops->visiflag & OOPS_OB) {
- oops= add_test_oops(ob);
- }
- if(G.soops->visiflag & OOPS_MA) {
- for(a=0; a<ob->totcol; a++) {
- if(ob->mat[a]) {
- oops= add_test_oops(ob->mat[a]);
- if(G.soops->visiflag & OOPS_TE) add_texture_oops(ob->mat[a]);
- if(G.soops->visiflag & OOPS_IP) add_test_oops(ob->mat[a]->ipo);
- }
- }
- }
- if(G.soops->visiflag & OOPS_IP) oops= add_test_oops(ob->ipo);
-
- id= ob->data;
- if(id) {
- type= GS(id->name);
-
- if(type==ID_ME && G.soops->visiflag & OOPS_ME) {
- Mesh *me= ob->data;
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_MA) {
- for(a=0; a<me->totcol; a++) {
- if(me->mat[a]) {
- oops= add_test_oops(me->mat[a]);
- if(G.soops->visiflag & OOPS_TE) add_texture_oops(me->mat[a]);
- if(G.soops->visiflag & OOPS_IP) add_test_oops(me->mat[a]->ipo);
- }
- }
- }
- if(G.soops->visiflag & OOPS_IP) {
- if(me->key) oops= add_test_oops(me->key->ipo);
- }
- }
- else if(type==ID_CU && G.soops->visiflag & OOPS_CU) {
- Curve *cu= ob->data;
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_MA) {
- for(a=0; a<cu->totcol; a++) {
- if(cu->mat[a]) {
- oops= add_test_oops(cu->mat[a]);
- if(G.soops->visiflag & OOPS_TE) add_texture_oops(cu->mat[a]);
- if(G.soops->visiflag & OOPS_IP) add_test_oops(cu->mat[a]->ipo);
- }
- }
- }
- if(G.soops->visiflag & OOPS_IP) {
- if(cu->ipo) oops= add_test_oops(cu->ipo);
- if(cu->key) oops= add_test_oops(cu->key->ipo);
- }
- }
- else if(type==ID_MB && G.soops->visiflag & OOPS_MB) {
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_MA) {
- MetaBall *mb= ob->data;
- for(a=0; a<mb->totcol; a++) {
- if(mb->mat[a]) {
- oops= add_test_oops(mb->mat[a]);
- if(G.soops->visiflag & OOPS_TE) add_texture_oops(mb->mat[a]);
- if(G.soops->visiflag & OOPS_IP) add_test_oops(mb->mat[a]->ipo);
- }
- }
- }
- }
- else if(type==ID_LA && G.soops->visiflag & OOPS_LA) {
- Lamp *la= ob->data;
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_IP) add_test_oops(la->ipo);
- if(G.soops->visiflag & OOPS_TE) {
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) add_test_oops(la->mtex[a]->tex);
- }
- }
- }
- else if(type==ID_CA && G.soops->visiflag & OOPS_CA) {
- Camera *ca= ob->data;
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_IP) add_test_oops(ca->ipo);
- }
- else if(type==ID_LT && G.soops->visiflag & OOPS_LT) {
- Lattice *lt= ob->data;
- oops= add_test_oops(ob->data);
-
- if(G.soops->visiflag & OOPS_IP) {
- if(lt->key) oops= add_test_oops(lt->key->ipo);
- }
- }
- else if(type==ID_AR && G.soops->visiflag & OOPS_AR) {
- oops= add_test_oops(ob->data);
- }
- }
- }
- base= base->next;
- }
- }
-
- /* test links */
- oops= G.soops->oops.first;
- while(oops) {
- if(oops->hide==0) {
- ol= oops->link.first;
- while(ol) {
- test_oopslink(ol);
- ol= ol->next;
- }
- }
- oops= oops->next;
- }
-
- G.soops->flag &= ~SO_NEWSELECTED;
-}
diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c
deleted file mode 100644
index 8e3e44c06de..00000000000
--- a/source/blender/src/outliner.c
+++ /dev/null
@@ -1,4121 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2004 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stdlib.h>
-#include <stddef.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_group_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_oops_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_text_types.h"
-#include "DNA_world_types.h"
-#include "DNA_sequence_types.h"
-
-#include "BLI_blenlib.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "BKE_constraint.h"
-#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_screen.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BIF_butspace.h"
-#include "BIF_drawscene.h"
-#include "BIF_drawtext.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editdeform.h"
-#include "BIF_editnla.h"
-#include "BIF_editview.h"
-#include "BIF_editconstraint.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_mywindow.h"
-#include "BIF_outliner.h"
-#include "BIF_language.h"
-#include "BIF_mainqueue.h"
-#include "BIF_poseobject.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_editseq.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif
-
-#include "BDR_editobject.h"
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "PIL_time.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#define OL_H 19
-#define OL_X 18
-
-#define OL_TOG_RESTRICT_VIEWX 54
-#define OL_TOG_RESTRICT_SELECTX 36
-#define OL_TOG_RESTRICT_RENDERX 18
-
-#define OL_TOGW OL_TOG_RESTRICT_VIEWX
-
-#define TS_CHUNK 128
-
-#define TREESTORE(a) ((a)?soops->treestore->data+(a)->store_index:NULL)
-
-#ifdef WITH_VERSE
-extern ListBase session_list;
-extern ListBase server_list;
-#endif
-
-
-/* ******************** PROTOTYPES ***************** */
-static void outliner_draw_tree_element(SpaceOops *soops, TreeElement *te, int startx, int *starty);
-static void outliner_do_object_operation(SpaceOops *soops, ListBase *lb,
- void (*operation_cb)(TreeElement *, TreeStoreElem *, TreeStoreElem *));
-
-
-/* ******************** PERSISTANT DATA ***************** */
-
-static void outliner_storage_cleanup(SpaceOops *soops)
-{
- TreeStore *ts= soops->treestore;
-
- if(ts) {
- TreeStoreElem *tselem;
- int a, unused= 0;
-
- /* each element used once, for ID blocks with more users to have each a treestore */
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) tselem->used= 0;
-
- /* cleanup only after reading file or undo step */
- if(soops->storeflag & SO_TREESTORE_CLEANUP) {
-
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
- if(tselem->id==NULL) unused++;
- }
-
- if(unused) {
- if(ts->usedelem == unused) {
- MEM_freeN(ts->data);
- ts->data= NULL;
- ts->usedelem= ts->totelem= 0;
- }
- else {
- TreeStoreElem *tsnewar, *tsnew;
-
- tsnew=tsnewar= MEM_mallocN((ts->usedelem-unused)*sizeof(TreeStoreElem), "new tselem");
- for(a=0, tselem= ts->data; a<ts->usedelem; a++, tselem++) {
- if(tselem->id) {
- *tsnew= *tselem;
- tsnew++;
- }
- }
- MEM_freeN(ts->data);
- ts->data= tsnewar;
- ts->usedelem-= unused;
- ts->totelem= ts->usedelem;
- }
- }
- }
- }
-}
-
-static void check_persistant(SpaceOops *soops, TreeElement *te, ID *id, short type, short nr)
-{
- TreeStore *ts;
- TreeStoreElem *tselem;
- int a;
-
- /* case 1; no TreeStore */
- if(soops->treestore==NULL) {
- ts= soops->treestore= MEM_callocN(sizeof(TreeStore), "treestore");
- }
- ts= soops->treestore;
-
- /* check if 'te' is in treestore */
- tselem= ts->data;
- for(a=0; a<ts->usedelem; a++, tselem++) {
- if(tselem->id==id && tselem->used==0) {
- if((type==0 && tselem->type==0) ||(tselem->type==type && tselem->nr==nr)) {
- te->store_index= a;
- tselem->used= 1;
- return;
- }
- }
- }
-
- /* add 1 element to treestore */
- if(ts->usedelem==ts->totelem) {
- TreeStoreElem *tsnew;
-
- tsnew= MEM_mallocN((ts->totelem+TS_CHUNK)*sizeof(TreeStoreElem), "treestore data");
- if(ts->data) {
- memcpy(tsnew, ts->data, ts->totelem*sizeof(TreeStoreElem));
- MEM_freeN(ts->data);
- }
- ts->data= tsnew;
- ts->totelem+= TS_CHUNK;
- }
-
- tselem= ts->data+ts->usedelem;
-
- tselem->type= type;
- if(type) tselem->nr= nr; // we're picky! :)
- else tselem->nr= 0;
- tselem->id= id;
- tselem->used = 0;
- tselem->flag= TSE_CLOSED;
- te->store_index= ts->usedelem;
-
- ts->usedelem++;
-}
-
-/* ******************** TREE MANAGEMENT ****************** */
-
-void outliner_free_tree(ListBase *lb)
-{
-
- while(lb->first) {
- TreeElement *te= lb->first;
-
- outliner_free_tree(&te->subtree);
- BLI_remlink(lb, te);
- MEM_freeN(te);
- }
-}
-
-static void outliner_height(SpaceOops *soops, ListBase *lb, int *h)
-{
- TreeElement *te= lb->first;
- while(te) {
- TreeStoreElem *tselem= TREESTORE(te);
- if((tselem->flag & TSE_CLOSED)==0)
- outliner_height(soops, &te->subtree, h);
- (*h)++;
- te= te->next;
- }
-}
-
-static void outliner_width(SpaceOops *soops, ListBase *lb, int *w)
-{
- TreeElement *te= lb->first;
- while(te) {
- TreeStoreElem *tselem= TREESTORE(te);
- if(tselem->flag & TSE_CLOSED) {
- if (te->xend > *w)
- *w = te->xend;
- }
- outliner_width(soops, &te->subtree, w);
- te= te->next;
- }
-}
-
-static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index)
-{
- TreeElement *te= lb->first, *tes;
- while(te) {
- if(te->store_index==store_index) return te;
- tes= outliner_find_tree_element(&te->subtree, store_index);
- if(tes) return tes;
- te= te->next;
- }
- return NULL;
-}
-
-
-
-static ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode)
-{
- TreeStoreElem *tselem;
- te= te->parent;
-
- while(te) {
- tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==idcode) return tselem->id;
- te= te->parent;
- }
- return NULL;
-}
-
-struct treesort {
- TreeElement *te;
- ID *id;
- char *name;
- short idcode;
-};
-
-static int treesort_alpha(const void *v1, const void *v2)
-{
- const struct treesort *x1= v1, *x2= v2;
- int comp;
-
- /* first put objects last (hierarchy) */
- comp= (x1->idcode==ID_OB);
- if(x2->idcode==ID_OB) comp+=2;
-
- if(comp==1) return 1;
- else if(comp==2) return -1;
- else if(comp==3) {
- int comp= strcmp(x1->name, x2->name);
-
- if( comp>0 ) return 1;
- else if( comp<0) return -1;
- return 0;
- }
- return 0;
-}
-
-/* this is nice option for later? doesnt look too useful... */
-#if 0
-static int treesort_obtype_alpha(const void *v1, const void *v2)
-{
- const struct treesort *x1= v1, *x2= v2;
-
- /* first put objects last (hierarchy) */
- if(x1->idcode==ID_OB && x2->idcode!=ID_OB) return 1;
- else if(x2->idcode==ID_OB && x1->idcode!=ID_OB) return -1;
- else {
- /* 2nd we check ob type */
- if(x1->idcode==ID_OB && x2->idcode==ID_OB) {
- if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1;
- else if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1;
- else return 0;
- }
- else {
- int comp= strcmp(x1->name, x2->name);
-
- if( comp>0 ) return 1;
- else if( comp<0) return -1;
- return 0;
- }
- }
-}
-#endif
-
-/* sort happens on each subtree individual */
-static void outliner_sort(SpaceOops *soops, ListBase *lb)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
- int totelem=0;
-
- te= lb->last;
- if(te==NULL) return;
- tselem= TREESTORE(te);
-
- /* sorting rules; only object lists or deformgroups */
- if( (tselem->type==TSE_DEFGROUP) || (tselem->type==0 && te->idcode==ID_OB)) {
-
- /* count first */
- for(te= lb->first; te; te= te->next) totelem++;
-
- if(totelem>1) {
- struct treesort *tear= MEM_mallocN(totelem*sizeof(struct treesort), "tree sort array");
- struct treesort *tp=tear;
- int skip= 0;
-
- for(te= lb->first; te; te= te->next, tp++) {
- tselem= TREESTORE(te);
- tp->te= te;
- tp->name= te->name;
- tp->idcode= te->idcode;
- if(tselem->type && tselem->type!=TSE_DEFGROUP) tp->idcode= 0; // dont sort this
- tp->id= tselem->id;
- }
- /* keep beginning of list */
- for(tp= tear, skip=0; skip<totelem; skip++, tp++)
- if(tp->idcode) break;
-
- if(skip<totelem)
- qsort(tear+skip, totelem-skip, sizeof(struct treesort), treesort_alpha);
-
- lb->first=lb->last= NULL;
- tp= tear;
- while(totelem--) {
- BLI_addtail(lb, tp->te);
- tp++;
- }
- MEM_freeN(tear);
- }
- }
-
- for(te= lb->first; te; te= te->next) {
- outliner_sort(soops, &te->subtree);
- }
-}
-
-/* Prototype, see functions below */
-static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv,
- TreeElement *parent, short type, short index);
-
-
-static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl)
-{
- TreeStoreElem *tselem= TREESTORE(tenla);
- TreeElement *te;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_COMBINED);
- te->name= "Combined";
- te->directdata= &srl->passflag;
-
- /* save cpu cycles, but we add the first to invoke an open/close triangle */
- if(tselem->flag & TSE_CLOSED)
- return;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_Z);
- te->name= "Z";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_VECTOR);
- te->name= "Vector";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_NORMAL);
- te->name= "Normal";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_UV);
- te->name= "UV";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_MIST);
- te->name= "Mist";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_INDEXOB);
- te->name= "Index Object";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RGBA);
- te->name= "Color";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_DIFFUSE);
- te->name= "Diffuse";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_SPEC);
- te->name= "Specular";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_SHADOW);
- te->name= "Shadow";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_AO);
- te->name= "AO";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_REFLECT);
- te->name= "Reflection";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_REFRACT);
- te->name= "Refraction";
- te->directdata= &srl->passflag;
-
- te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RADIO);
- te->name= "Radiosity";
- te->directdata= &srl->passflag;
-
-}
-
-
-/* special handling of hierarchical non-lib data */
-static void outliner_add_bone(SpaceOops *soops, ListBase *lb, ID *id, Bone *curBone,
- TreeElement *parent, int *a)
-{
- TreeElement *te= outliner_add_element(soops, lb, id, parent, TSE_BONE, *a);
-
- (*a)++;
- te->name= curBone->name;
- te->directdata= curBone;
-
- for(curBone= curBone->childbase.first; curBone; curBone=curBone->next) {
- outliner_add_bone(soops, &te->subtree, id, curBone, te, a);
- }
-}
-
-static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
-{
- SceneRenderLayer *srl;
- TreeElement *tenla= outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0);
- int a;
-
- tenla->name= "RenderLayers";
- for(a=0, srl= sce->r.layers.first; srl; srl= srl->next, a++) {
- TreeElement *tenlay= outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a);
- tenlay->name= srl->name;
- tenlay->directdata= &srl->passflag;
-
- if(srl->light_override)
- outliner_add_element(soops, &tenlay->subtree, srl->light_override, tenlay, TSE_LINKED_LAMP, 0);
- if(srl->mat_override)
- outliner_add_element(soops, &tenlay->subtree, srl->mat_override, tenlay, TSE_LINKED_MAT, 0);
-
- outliner_add_passes(soops, tenlay, &sce->id, srl);
- }
-
- outliner_add_element(soops, lb, sce->world, te, 0, 0);
-
- if(sce->scriptlink.scripts) {
- int a= 0;
- tenla= outliner_add_element(soops, lb, sce, te, TSE_SCRIPT_BASE, 0);
- tenla->name= "Scripts";
- for (a=0; a<sce->scriptlink.totscript; a++) {
- outliner_add_element(soops, &tenla->subtree, sce->scriptlink.scripts[a], tenla, 0, 0);
- }
- }
-
-}
-
-static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv,
- TreeElement *parent, short type, short index)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
- ID *id= idv;
- int a;
-
- if(id==NULL) return NULL;
-
- te= MEM_callocN(sizeof(TreeElement), "tree elem");
- /* add to the visual tree */
- BLI_addtail(lb, te);
- /* add to the storage */
- check_persistant(soops, te, id, type, index);
- tselem= TREESTORE(te);
-
- te->parent= parent;
- te->index= index; // for data arays
- if((type!=TSE_SEQUENCE) && (type != TSE_SEQ_STRIP) && (type != TSE_SEQUENCE_DUP)) {
- te->name= id->name+2; // default, can be overridden by Library or non-ID data
- te->idcode= GS(id->name);
- }
-
- if(type==0) {
-
- /* tuck pointer back in object, to construct hierarchy */
- if(GS(id->name)==ID_OB) id->newid= (ID *)te;
-
- /* expand specific data always */
- switch(GS(id->name)) {
- case ID_LI:
- te->name= ((Library *)id)->name;
- break;
- case ID_SCE:
- outliner_add_scene_contents(soops, &te->subtree, (Scene *)id, te);
- break;
- case ID_OB:
- {
- Object *ob= (Object *)id;
-
- if(ob->proxy && ob->id.lib==NULL)
- outliner_add_element(soops, &te->subtree, ob->proxy, te, TSE_PROXY, 0);
-
- outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0);
-
- if(ob->pose) {
- bPoseChannel *pchan;
- TreeElement *ten;
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_POSE_BASE, 0);
-
- tenla->name= "Pose";
-
- if(ob!=G.obedit && (ob->flag & OB_POSEMODE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself
- int a= 0, const_index= 1000; /* ensure unique id for bone constraints */
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) {
- ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_POSE_CHANNEL, a);
- ten->name= pchan->name;
- ten->directdata= pchan;
- pchan->prev= (bPoseChannel *)ten;
-
- if(pchan->constraints.first) {
- //Object *target;
- bConstraint *con;
- TreeElement *ten1;
- TreeElement *tenla1= outliner_add_element(soops, &ten->subtree, ob, ten, TSE_CONSTRAINT_BASE, 0);
- //char *str;
-
- tenla1->name= "Constraints";
- for(con= pchan->constraints.first; con; con= con->next, const_index++) {
- ten1= outliner_add_element(soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index);
-#if 0 /* disabled as it needs to be reworked for recoded constraints system */
- target= get_constraint_target(con, &str);
- if(str && str[0]) ten1->name= str;
- else if(target) ten1->name= target->id.name+2;
- else ten1->name= con->name;
-#endif
- ten1->name= con->name;
- ten1->directdata= con;
- /* possible add all other types links? */
- }
- }
- }
- /* make hierarchy */
- ten= tenla->subtree.first;
- while(ten) {
- TreeElement *nten= ten->next, *par;
- tselem= TREESTORE(ten);
- if(tselem->type==TSE_POSE_CHANNEL) {
- pchan= (bPoseChannel *)ten->directdata;
- if(pchan->parent) {
- BLI_remlink(&tenla->subtree, ten);
- par= (TreeElement *)pchan->parent->prev;
- BLI_addtail(&par->subtree, ten);
- ten->parent= par;
- }
- }
- ten= nten;
- }
- /* restore prev pointers */
- pchan= ob->pose->chanbase.first;
- if(pchan) pchan->prev= NULL;
- for(; pchan; pchan= pchan->next) {
- if(pchan->next) pchan->next->prev= pchan;
- }
- }
-
- /* Pose Groups */
- if(ob->pose->agroups.first) {
- bActionGroup *agrp;
- TreeElement *ten;
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_POSEGRP_BASE, 0);
- int a= 0;
-
- tenla->name= "Bone Groups";
- for (agrp=ob->pose->agroups.first; agrp; agrp=agrp->next, a++) {
- ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_POSEGRP, a);
- ten->name= agrp->name;
- ten->directdata= agrp;
- }
- }
- }
-
- outliner_add_element(soops, &te->subtree, ob->ipo, te, 0, 0);
- outliner_add_element(soops, &te->subtree, ob->action, te, 0, 0);
-
- for(a=0; a<ob->totcol; a++)
- outliner_add_element(soops, &te->subtree, ob->mat[a], te, 0, a);
-
- if(ob->constraints.first) {
- //Object *target;
- bConstraint *con;
- TreeElement *ten;
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_CONSTRAINT_BASE, 0);
- int a= 0;
- //char *str;
-
- tenla->name= "Constraints";
- for(con= ob->constraints.first; con; con= con->next, a++) {
- ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a);
-#if 0 /* disabled due to constraints system targets recode... code here needs review */
- target= get_constraint_target(con, &str);
- if(str && str[0]) ten->name= str;
- else if(target) ten->name= target->id.name+2;
- else ten->name= con->name;
-#endif
- ten->name= con->name;
- ten->directdata= con;
- /* possible add all other types links? */
- }
- }
-
- if(ob->modifiers.first) {
- ModifierData *md;
- TreeElement *temod = outliner_add_element(soops, &te->subtree, ob, te, TSE_MODIFIER_BASE, 0);
- int index;
-
- temod->name = "Modifiers";
- for (index=0,md=ob->modifiers.first; md; index++,md=md->next) {
- TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index);
- te->name= md->name;
- te->directdata = md;
-
- if (md->type==eModifierType_Lattice) {
- outliner_add_element(soops, &te->subtree, ((LatticeModifierData*) md)->object, te, TSE_LINKED_OB, 0);
- } else if (md->type==eModifierType_Curve) {
- outliner_add_element(soops, &te->subtree, ((CurveModifierData*) md)->object, te, TSE_LINKED_OB, 0);
- } else if (md->type==eModifierType_Armature) {
- outliner_add_element(soops, &te->subtree, ((ArmatureModifierData*) md)->object, te, TSE_LINKED_OB, 0);
- } else if (md->type==eModifierType_Hook) {
- outliner_add_element(soops, &te->subtree, ((HookModifierData*) md)->object, te, TSE_LINKED_OB, 0);
- }
- }
- }
- if(ob->defbase.first) {
- bDeformGroup *defgroup;
- TreeElement *ten;
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_DEFGROUP_BASE, 0);
- int a= 0;
-
- tenla->name= "Vertex Groups";
- for (defgroup=ob->defbase.first; defgroup; defgroup=defgroup->next, a++) {
- ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_DEFGROUP, a);
- ten->name= defgroup->name;
- ten->directdata= defgroup;
- }
- }
- if(ob->scriptlink.scripts) {
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_SCRIPT_BASE, 0);
- int a= 0;
-
- tenla->name= "Scripts";
- for (a=0; a<ob->scriptlink.totscript; a++) { /* ** */
- outliner_add_element(soops, &tenla->subtree, ob->scriptlink.scripts[a], te, 0, 0);
- }
- }
-
- if(ob->dup_group)
- outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0);
-
- if(ob->nlastrips.first) {
- bActionStrip *strip;
- TreeElement *ten;
- TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_NLA, 0);
- int a= 0;
-
- tenla->name= "NLA strips";
- for (strip=ob->nlastrips.first; strip; strip=strip->next, a++) {
- ten= outliner_add_element(soops, &tenla->subtree, strip->act, tenla, TSE_NLA_ACTION, a);
- if(ten) ten->directdata= strip;
- }
- }
-
- }
- break;
- case ID_ME:
- {
- Mesh *me= (Mesh *)id;
- outliner_add_element(soops, &te->subtree, me->ipo, te, 0, 0);
- outliner_add_element(soops, &te->subtree, me->key, te, 0, 0);
- for(a=0; a<me->totcol; a++)
- outliner_add_element(soops, &te->subtree, me->mat[a], te, 0, a);
- /* could do tfaces with image links, but the images are not grouped nicely.
- would require going over all tfaces, sort images in use. etc... */
- }
- break;
- case ID_CU:
- {
- Curve *cu= (Curve *)id;
- for(a=0; a<cu->totcol; a++)
- outliner_add_element(soops, &te->subtree, cu->mat[a], te, 0, a);
- }
- break;
- case ID_MB:
- {
- MetaBall *mb= (MetaBall *)id;
- for(a=0; a<mb->totcol; a++)
- outliner_add_element(soops, &te->subtree, mb->mat[a], te, 0, a);
- }
- break;
- case ID_MA:
- {
- Material *ma= (Material *)id;
-
- outliner_add_element(soops, &te->subtree, ma->ipo, te, 0, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(ma->mtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a);
- }
- }
- break;
- case ID_TE:
- {
- Tex *tex= (Tex *)id;
-
- outliner_add_element(soops, &te->subtree, tex->ipo, te, 0, 0);
- outliner_add_element(soops, &te->subtree, tex->ima, te, 0, 0);
- }
- break;
- case ID_CA:
- {
- Camera *ca= (Camera *)id;
- outliner_add_element(soops, &te->subtree, ca->ipo, te, 0, 0);
- }
- break;
- case ID_LA:
- {
- Lamp *la= (Lamp *)id;
- outliner_add_element(soops, &te->subtree, la->ipo, te, 0, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(la->mtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a);
- }
- }
- break;
- case ID_WO:
- {
- World *wrld= (World *)id;
- outliner_add_element(soops, &te->subtree, wrld->ipo, te, 0, 0);
- for(a=0; a<MAX_MTEX; a++) {
- if(wrld->mtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a);
- }
- }
- break;
- case ID_KE:
- {
- Key *key= (Key *)id;
- outliner_add_element(soops, &te->subtree, key->ipo, te, 0, 0);
- }
- break;
- case ID_IP:
- {
- Ipo *ipo= (Ipo *)id;
- IpoCurve *icu;
- Object *lastadded= NULL;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- if (icu->driver && icu->driver->ob) {
- if (lastadded != icu->driver->ob) {
- outliner_add_element(soops, &te->subtree, icu->driver->ob, te, TSE_LINKED_OB, 0);
- lastadded= icu->driver->ob;
- }
- }
- }
- }
- break;
- case ID_AC:
- {
- bAction *act= (bAction *)id;
- bActionChannel *chan;
- int a= 0;
-
- tselem= TREESTORE(parent);
- for (chan=act->chanbase.first; chan; chan=chan->next, a++) {
- outliner_add_element(soops, &te->subtree, chan->ipo, te, 0, a);
- }
- }
- break;
- case ID_AR:
- {
- bArmature *arm= (bArmature *)id;
- int a= 0;
-
- if(G.obedit && G.obedit->data==arm) {
- EditBone *ebone;
- TreeElement *ten;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next, a++) {
- ten= outliner_add_element(soops, &te->subtree, id, te, TSE_EBONE, a);
- ten->directdata= ebone;
- ten->name= ebone->name;
- ebone->temp= ten;
- }
- /* make hierarchy */
- ten= te->subtree.first;
- while(ten) {
- TreeElement *nten= ten->next, *par;
- ebone= (EditBone *)ten->directdata;
- if(ebone->parent) {
- BLI_remlink(&te->subtree, ten);
- par= ebone->parent->temp;
- BLI_addtail(&par->subtree, ten);
- ten->parent= par;
- }
- ten= nten;
- }
- }
- else {
- /* do not extend Armature when we have posemode */
- tselem= TREESTORE(te->parent);
- if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->flag & OB_POSEMODE);
- else {
- Bone *curBone;
- for (curBone=arm->bonebase.first; curBone; curBone=curBone->next){
- outliner_add_bone(soops, &te->subtree, id, curBone, te, &a);
- }
- }
- }
- }
- break;
- }
- }
- else if(type==TSE_SEQUENCE) {
- Sequence *seq= (Sequence*) idv;
- Sequence *p;
-
- /*
- * The idcode is a little hack, but the outliner
- * only check te->idcode if te->type is equal to zero,
- * so this is "safe".
- */
- te->idcode= seq->type;
- te->directdata= seq;
-
- if(seq->type<7) {
- /*
- * This work like the sequence.
- * If the sequence have a name (not default name)
- * show it, in other case put the filename.
- */
- if(strcmp(seq->name, "SQ"))
- te->name= seq->name;
- else {
- if((seq->strip) && (seq->strip->stripdata))
- te->name= seq->strip->stripdata->name;
- else if((seq->strip) && (seq->strip->tstripdata) && (seq->strip->tstripdata->ibuf))
- te->name= seq->strip->tstripdata->ibuf->name;
- else
- te->name= "SQ None";
- }
-
- if(seq->type==SEQ_META) {
- te->name= "Meta Strip";
- p= seq->seqbase.first;
- while(p) {
- outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
- p= p->next;
- }
- }
- else
- outliner_add_element(soops, &te->subtree, (void*)seq->strip, te, TSE_SEQ_STRIP, index);
- }
- else
- te->name= "Effect";
- }
- else if(type==TSE_SEQ_STRIP) {
- Strip *strip= (Strip *)idv;
-
- if(strip->dir)
- te->name= strip->dir;
- else
- te->name= "Strip None";
- te->directdata= strip;
- }
- else if(type==TSE_SEQUENCE_DUP) {
- Sequence *seq= (Sequence*)idv;
-
- te->idcode= seq->type;
- te->directdata= seq;
- te->name= seq->strip->stripdata->name;
- }
-#ifdef WITH_VERSE
- else if(type==ID_VS) {
- struct VerseSession *session = (VerseSession*)idv;
- te->name = session->address;
- te->directdata = (void*)session;
- te->idcode = ID_VS;
- }
- else if(type==ID_MS) {
- te->name = "Available Verse Servers";
- te->idcode = ID_MS;
- }
- else if(type==ID_SS) {
- struct VerseServer *server = (VerseServer *)idv;
- te->name = server->name;
- te->directdata = (void *)server;
- te->idcode = ID_SS;
- }
- else if(type==ID_VN) {
- struct VNode *vnode = (VNode*)idv;
- te->name = vnode->name;
- te->idcode = ID_VN;
- if(vnode->type==V_NT_OBJECT) {
- struct TreeElement *ten;
- struct VNode *child_node;
- struct VLink *vlink;
-
- vlink = ((VObjectData*)vnode->data)->links.lb.first;
- while(vlink) {
- child_node = vlink->target;
- if(child_node && child_node->type==V_NT_GEOMETRY) {
- ten = outliner_add_element(soops, &te->subtree, child_node, te, ID_VN, 0);
- ten->directdata = child_node;
- }
- vlink = vlink->next;
- }
- }
- }
-#endif
- return te;
-}
-
-static void outliner_make_hierarchy(SpaceOops *soops, ListBase *lb)
-{
- TreeElement *te, *ten, *tep;
- TreeStoreElem *tselem;
-
- /* build hierarchy */
- te= lb->first;
- while(te) {
- ten= te->next;
- tselem= TREESTORE(te);
-
- if(tselem->type==0 && te->idcode==ID_OB) {
- Object *ob= (Object *)tselem->id;
- if(ob->parent && ob->parent->id.newid) {
- BLI_remlink(lb, te);
- tep= (TreeElement *)ob->parent->id.newid;
- BLI_addtail(&tep->subtree, te);
- // set correct parent pointers
- for(te=tep->subtree.first; te; te= te->next) te->parent= tep;
- }
- }
- te= ten;
- }
-}
-
-/* Helped function to put duplicate sequence in the same tree. */
-int need_add_seq_dup(Sequence *seq)
-{
- Sequence *p;
-
- if((!seq->strip) || (!seq->strip->stripdata) || (!seq->strip->stripdata->name))
- return(1);
-
- /*
- * First check backward, if we found a duplicate
- * sequence before this, don't need it, just return.
- */
- p= seq->prev;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
- p= p->prev;
- continue;
- }
-
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
- return(2);
- p= p->prev;
- }
-
- p= seq->next;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
- p= p->next;
- continue;
- }
-
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
- return(0);
- p= p->next;
- }
- return(1);
-}
-
-void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index)
-{
- TreeElement *ch;
- Sequence *p;
-
- p= seq;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
- p= p->next;
- continue;
- }
-
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
- ch= outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
- p= p->next;
- }
-}
-
-static void outliner_build_tree(SpaceOops *soops)
-{
- Base *base;
- Object *ob;
- TreeElement *te, *ten;
- TreeStoreElem *tselem;
- int show_opened= soops->treestore==NULL; /* on first view, we open scenes */
-#ifdef WITH_VERSE
- struct VerseSession *session;
-#endif
-
- if(soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW))
- return;
-
- outliner_free_tree(&soops->tree);
- outliner_storage_cleanup(soops);
-
- /* clear ob id.new flags */
- for(ob= G.main->object.first; ob; ob= ob->id.next) ob->id.newid= NULL;
-
- /* options */
- if(soops->outlinevis == SO_LIBRARIES) {
- Library *lib;
-
- for(lib= G.main->library.first; lib; lib= lib->id.next) {
- ten= outliner_add_element(soops, &soops->tree, lib, NULL, 0, 0);
- lib->id.newid= (ID *)ten;
- }
- /* make hierarchy */
- ten= soops->tree.first;
- while(ten) {
- TreeElement *nten= ten->next, *par;
- tselem= TREESTORE(ten);
- lib= (Library *)tselem->id;
- if(lib->parent) {
- BLI_remlink(&soops->tree, ten);
- par= (TreeElement *)lib->parent->id.newid;
- BLI_addtail(&par->subtree, ten);
- ten->parent= par;
- }
- ten= nten;
- }
- /* restore newid pointers */
- for(lib= G.main->library.first; lib; lib= lib->id.next)
- lib->id.newid= NULL;
-
- }
- else if(soops->outlinevis == SO_ALL_SCENES) {
- Scene *sce;
- for(sce= G.main->scene.first; sce; sce= sce->id.next) {
- te= outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0);
- tselem= TREESTORE(te);
- if(sce==G.scene && show_opened)
- tselem->flag &= ~TSE_CLOSED;
-
- for(base= sce->base.first; base; base= base->next) {
- ten= outliner_add_element(soops, &te->subtree, base->object, te, 0, 0);
- ten->directdata= base;
- }
- outliner_make_hierarchy(soops, &te->subtree);
- /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */
- for(base= sce->base.first; base; base= base->next) base->object->id.newid= NULL;
- }
- }
- else if(soops->outlinevis == SO_CUR_SCENE) {
-
- outliner_add_scene_contents(soops, &soops->tree, G.scene, NULL);
-
- for(base= G.scene->base.first; base; base= base->next) {
- ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
- ten->directdata= base;
- }
- outliner_make_hierarchy(soops, &soops->tree);
- }
- else if(soops->outlinevis == SO_VISIBLE) {
- for(base= G.scene->base.first; base; base= base->next) {
- if(base->lay & G.scene->lay)
- outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
- }
- outliner_make_hierarchy(soops, &soops->tree);
- }
- else if(soops->outlinevis == SO_GROUPS) {
- Group *group;
- GroupObject *go;
-
- for(group= G.main->group.first; group; group= group->id.next) {
- if(group->id.us) {
- te= outliner_add_element(soops, &soops->tree, group, NULL, 0, 0);
- tselem= TREESTORE(te);
-
- for(go= group->gobject.first; go; go= go->next) {
- ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0);
- ten->directdata= NULL; /* eh, why? */
- }
- outliner_make_hierarchy(soops, &te->subtree);
- /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */
- for(go= group->gobject.first; go; go= go->next) go->ob->id.newid= NULL;
- }
- }
- }
- else if(soops->outlinevis == SO_SAME_TYPE) {
- Object *ob= OBACT;
- if(ob) {
- for(base= G.scene->base.first; base; base= base->next) {
- if(base->object->type==ob->type) {
- ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
- ten->directdata= base;
- }
- }
- outliner_make_hierarchy(soops, &soops->tree);
- }
- }
- else if(soops->outlinevis == SO_SELECTED) {
- for(base= G.scene->base.first; base; base= base->next) {
- if(base->lay & G.scene->lay) {
- if(base==BASACT || (base->flag & SELECT)) {
- ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0);
- ten->directdata= base;
- }
- }
- }
- outliner_make_hierarchy(soops, &soops->tree);
- }
-#ifdef WITH_VERSE
- else if(soops->outlinevis == SO_VERSE_SESSION) {
- /* add all session to the "root" of hierarchy */
- for(session=session_list.first; session; session = session->next) {
- struct VNode *vnode;
- if(session->flag & VERSE_CONNECTED) {
- te= outliner_add_element(soops, &soops->tree, session, NULL, ID_VS, 0);
- /* add all object nodes as childreen of session */
- for(vnode=session->nodes.lb.first; vnode; vnode=vnode->next) {
- if(vnode->type==V_NT_OBJECT) {
- ten= outliner_add_element(soops, &te->subtree, vnode, te, ID_VN, 0);
- ten->directdata= vnode;
- }
- else if(vnode->type==V_NT_BITMAP) {
- ten= outliner_add_element(soops, &te->subtree, vnode, te, ID_VN, 0);
- ten->directdata= vnode;
- }
- }
- }
- }
- }
- else if(soops->outlinevis == SO_VERSE_MS) {
- te= outliner_add_element(soops, &soops->tree, "MS", NULL, ID_MS, 0);
- if(server_list.first!=NULL) {
- struct VerseServer *server;
- /* add one main entry to root of hierarchy */
- for(server=server_list.first; server; server=server->next) {
- ten= outliner_add_element(soops, &te->subtree, server, te, ID_SS, 0);
- ten->directdata= server;
- }
- }
- }
-#endif
- else if(soops->outlinevis==SO_SEQUENCE) {
- Sequence *seq;
- Editing *ed;
- int op;
-
- ed= G.scene->ed;
- if(!ed)
- return;
-
- seq= ed->seqbasep->first;
- if(!seq)
- return;
-
- while(seq) {
- op= need_add_seq_dup(seq);
- if(op==1)
- ten= outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE, 0);
- else if(op==0) {
- ten= outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE_DUP, 0);
- add_seq_dup(soops, seq, ten, 0);
- }
- seq= seq->next;
- }
- }
- else {
- ten= outliner_add_element(soops, &soops->tree, OBACT, NULL, 0, 0);
- if(ten) ten->directdata= BASACT;
- }
-
-
- outliner_sort(soops, &soops->tree);
-}
-
-/* **************** INTERACTIVE ************* */
-
-static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
-{
- TreeElement *te;
- int level=curlevel, lev;
-
- for(te= lb->first; te; te= te->next) {
-
- lev= outliner_count_levels(soops, &te->subtree, curlevel+1);
- if(lev>level) level= lev;
- }
- return level;
-}
-
-static int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, short curlevel)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
- int level;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->flag & flag) return curlevel;
-
- level= outliner_has_one_flag(soops, &te->subtree, flag, curlevel+1);
- if(level) return level;
- }
- return 0;
-}
-
-static void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short set)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(set==0) tselem->flag &= ~flag;
- else tselem->flag |= flag;
- outliner_set_flag(soops, &te->subtree, flag, set);
- }
-}
-
-void object_toggle_visibility_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base) {
- base->object->restrictflag^=OB_RESTRICT_VIEW;
- }
-}
-
-void outliner_toggle_visibility(struct ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
-
- outliner_do_object_operation(soops, &soops->tree, object_toggle_visibility_cb);
-
- BIF_undo_push("Outliner toggle selectability");
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 1);
-}
-
-static void object_toggle_selectability_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base) {
- base->object->restrictflag^=OB_RESTRICT_SELECT;
- }
-}
-
-void outliner_toggle_selectability(struct ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
-
- outliner_do_object_operation(soops, &soops->tree, object_toggle_selectability_cb);
-
- BIF_undo_push("Outliner toggle selectability");
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 1);
-}
-
-void object_toggle_renderability_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base) {
- base->object->restrictflag^=OB_RESTRICT_RENDER;
- }
-}
-
-void outliner_toggle_renderability(struct ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
-
- outliner_do_object_operation(soops, &soops->tree, object_toggle_renderability_cb);
-
- BIF_undo_push("Outliner toggle renderability");
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 1);
-}
-
-void outliner_toggle_visible(struct ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
-
- if( outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1))
- outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 0);
- else
- outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 1);
-
- BIF_undo_push("Outliner toggle visible");
- scrarea_queue_redraw(sa);
-}
-
-void outliner_toggle_selected(struct ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
-
- if( outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1))
- outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
- else
- outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 1);
-
- BIF_undo_push("Outliner toggle selected");
- soops->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_queue_redraw(sa);
-}
-
-
-static void outliner_openclose_level(SpaceOops *soops, ListBase *lb, int curlevel, int level, int open)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
-
- if(open) {
- if(curlevel<=level) tselem->flag &= ~TSE_CLOSED;
- }
- else {
- if(curlevel>=level) tselem->flag |= TSE_CLOSED;
- }
-
- outliner_openclose_level(soops, &te->subtree, curlevel+1, level, open);
- }
-}
-
-/* return 1 when levels were opened */
-static int outliner_open_back(SpaceOops *soops, TreeElement *te)
-{
- TreeStoreElem *tselem;
- int retval= 0;
-
- for (te= te->parent; te; te= te->parent) {
- tselem= TREESTORE(te);
- if (tselem->flag & TSE_CLOSED) {
- tselem->flag &= ~TSE_CLOSED;
- retval= 1;
- }
- }
- return retval;
-}
-
-/* This is not used anywhere at the moment */
-#if 0
-static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for (te= lb->first; te; te= te->next) {
- /* check if this tree-element was the one we're seeking */
- if (te == teFind) {
- *found= 1;
- return;
- }
-
- /* try to see if sub-tree contains it then */
- outliner_open_reveal(soops, &te->subtree, teFind, found);
- if (*found) {
- tselem= TREESTORE(te);
- if (tselem->flag & TSE_CLOSED)
- tselem->flag &= ~TSE_CLOSED;
- return;
- }
- }
-}
-#endif
-
-void outliner_one_level(struct ScrArea *sa, int add)
-{
- SpaceOops *soops= sa->spacedata.first;
- int level;
-
- level= outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1);
- if(add==1) {
- if(level) outliner_openclose_level(soops, &soops->tree, 1, level, 1);
- }
- else {
- if(level==0) level= outliner_count_levels(soops, &soops->tree, 0);
- if(level) outliner_openclose_level(soops, &soops->tree, 1, level-1, 0);
- }
-
- BIF_undo_push("Outliner show/hide one level");
- scrarea_queue_redraw(sa);
-}
-
-void outliner_page_up_down(ScrArea *sa, int up)
-{
- SpaceOops *soops= sa->spacedata.first;
- int dy= soops->v2d.mask.ymax-soops->v2d.mask.ymin;
-
- if(up == -1) dy= -dy;
- soops->v2d.cur.ymin+= dy;
- soops->v2d.cur.ymax+= dy;
-
- soops->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_queue_redraw(sa);
-}
-
-/* **** do clicks on items ******* */
-
-static int tree_element_active_renderlayer(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Scene *sce;
-
- /* paranoia check */
- if(te->idcode!=ID_SCE)
- return 0;
- sce= (Scene *)tselem->id;
-
- if(set) {
- sce->r.actlay= tselem->nr;
- allqueue(REDRAWBUTSSCENE, 0);
- }
- else {
- return sce->r.actlay==tselem->nr;
- }
- return 0;
-}
-
-static void tree_element_active_object(SpaceOops *soops, TreeElement *te)
-{
- TreeStoreElem *tselem= TREESTORE(te);
- Scene *sce;
- Base *base;
- Object *ob= NULL;
-
- /* if id is not object, we search back */
- if(te->idcode==ID_OB) ob= (Object *)tselem->id;
- else {
- ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==OBACT) return;
- }
- if(ob==NULL) return;
-
- sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
- if(sce && G.scene != sce) {
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- set_scene(sce);
- }
-
- /* find associated base in current scene */
- for(base= FIRSTBASE; base; base= base->next)
- if(base->object==ob) break;
- if(base) {
- if(G.qual & LR_SHIFTKEY) {
- /* swap select */
- if(base->flag & SELECT) base->flag &= ~SELECT;
- else if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) base->flag |= SELECT;
- base->object->flag= base->flag;
- }
- else {
- Base *b;
- /* deleselect all */
- for(b= FIRSTBASE; b; b= b->next) {
- b->flag &= ~SELECT;
- b->object->flag= b->flag;
- }
- if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- }
- }
- set_active_base(base); /* editview.c */
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWINFO, 1);
- }
-
- if(ob!=G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- else countall(); /* exit_editmode calls countall() */
-}
-
-static int tree_element_active_material(SpaceOops *soops, TreeElement *te, int set)
-{
- TreeElement *tes;
- Object *ob;
-
- /* we search for the object parent */
- ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==NULL || ob!=OBACT) return 0; // just paranoia
-
- /* searching in ob mat array? */
- tes= te->parent;
- if(tes->idcode==ID_OB) {
- if(set) {
- ob->actcol= te->index+1;
- ob->colbits |= (1<<te->index); // make ob material active too
- }
- else {
- if(ob->actcol == te->index+1)
- if(ob->colbits & (1<<te->index)) return 1;
- }
- }
- /* or we search for obdata material */
- else {
- if(set) {
- ob->actcol= te->index+1;
- ob->colbits &= ~(1<<te->index); // make obdata material active too
- }
- else {
- if(ob->actcol == te->index+1)
- if( (ob->colbits & (1<<te->index))==0 ) return 1;
- }
- }
- if(set) {
- extern_set_butspace(F5KEY, 0); // force shading buttons
- BIF_preview_changed(ID_MA);
- allqueue(REDRAWBUTSSHADING, 1);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWIPO, 0);
- }
- return 0;
-}
-
-static int tree_element_active_texture(SpaceOops *soops, TreeElement *te, int set)
-{
- TreeElement *tep;
- TreeStoreElem *tselem, *tselemp;
- Object *ob=OBACT;
- ScrArea *sa;
- SpaceButs *sbuts=NULL;
-
- if(ob==NULL) return 0; // no active object
-
- tselem= TREESTORE(te);
-
- /* find buttons area (note, this is undefined really still, needs recode in blender) */
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_BUTS) break;
- sa= sa->next;
- }
- if(sa) sbuts= sa->spacedata.first;
-
- /* where is texture linked to? */
- tep= te->parent;
- tselemp= TREESTORE(tep);
-
- if(tep->idcode==ID_WO) {
- World *wrld= (World *)tselemp->id;
-
- if(set) {
- if(sbuts) {
- sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
- sbuts->texfrom= 1;
- }
- extern_set_butspace(F6KEY, 0); // force shading buttons texture
- wrld->texact= te->index;
- }
- else if(tselemp->id == (ID *)(G.scene->world)) {
- if(wrld->texact==te->index) return 1;
- }
- }
- else if(tep->idcode==ID_LA) {
- Lamp *la= (Lamp *)tselemp->id;
- if(set) {
- if(sbuts) {
- sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
- sbuts->texfrom= 2;
- }
- extern_set_butspace(F6KEY, 0); // force shading buttons texture
- la->texact= te->index;
- }
- else {
- if(tselemp->id == ob->data) {
- if(la->texact==te->index) return 1;
- }
- }
- }
- else if(tep->idcode==ID_MA) {
- Material *ma= (Material *)tselemp->id;
- if(set) {
- if(sbuts) {
- //sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c
- sbuts->texfrom= 0;
- }
- extern_set_butspace(F6KEY, 0); // force shading buttons texture
- ma->texact= (char)te->index;
-
- /* also set active material */
- ob->actcol= tep->index+1;
- }
- else if(tep->flag & TE_ACTIVE) { // this is active material
- if(ma->texact==te->index) return 1;
- }
- }
-
- return 0;
-}
-
-
-static int tree_element_active_lamp(SpaceOops *soops, TreeElement *te, int set)
-{
- Object *ob;
-
- /* we search for the object parent */
- ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==NULL || ob!=OBACT) return 0; // just paranoia
-
- if(set) {
- extern_set_butspace(F5KEY, 0);
- BIF_preview_changed(ID_LA);
- allqueue(REDRAWBUTSSHADING, 1);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWIPO, 0);
- }
- else return 1;
-
- return 0;
-}
-
-static int tree_element_active_world(SpaceOops *soops, TreeElement *te, int set)
-{
- TreeElement *tep;
- TreeStoreElem *tselem=NULL;
- Scene *sce=NULL;
-
- tep= te->parent;
- if(tep) {
- tselem= TREESTORE(tep);
- sce= (Scene *)tselem->id;
- }
-
- if(set) { // make new scene active
- if(sce && G.scene != sce) {
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- set_scene(sce);
- countall();
- }
- }
-
- if(tep==NULL || tselem->id == (ID *)G.scene) {
- if(set) {
- extern_set_butspace(F8KEY, 0);
- }
- else {
- return 1;
- }
- }
- return 0;
-}
-
-static int tree_element_active_ipo(SpaceOops *soops, TreeElement *te, int set)
-{
- TreeElement *tes;
- TreeStoreElem *tselems=NULL;
- Object *ob;
-
- /* we search for the object parent */
- ob= (Object *)outliner_search_back(soops, te, ID_OB);
- if(ob==NULL || ob!=OBACT) return 0; // just paranoia
-
- /* the parent of ipo */
- tes= te->parent;
- tselems= TREESTORE(tes);
-
- if(set) {
- if(tes->idcode==ID_AC) {
- if(ob->ipoflag & OB_ACTION_OB)
- ob->ipowin= ID_OB;
- else if(ob->ipoflag & OB_ACTION_KEY)
- ob->ipowin= ID_KE;
- else
- ob->ipowin= ID_PO;
- }
- else ob->ipowin= tes->idcode;
-
- if(ob->ipowin==ID_MA) tree_element_active_material(soops, tes, 1);
- else if(ob->ipowin==ID_AC) {
- bActionChannel *chan;
- short a=0;
- for(chan=ob->action->chanbase.first; chan; chan= chan->next) {
- if(a==te->index) break;
- if(chan->ipo) a++;
- }
- deselect_actionchannels(ob->action, 0);
- if (chan)
- select_channel(ob->action, chan, SELECT_ADD);
- allqueue(REDRAWACTION, ob->ipowin);
- allqueue(REDRAWVIEW3D, ob->ipowin);
- }
-
- allqueue(REDRAWIPO, ob->ipowin);
- }
- else {
- if(tes->idcode==ID_AC) {
- if(ob->ipoflag & OB_ACTION_OB)
- return ob->ipowin==ID_OB;
- else if(ob->ipoflag & OB_ACTION_KEY)
- return ob->ipowin==ID_KE;
- else if(ob->ipowin==ID_AC) {
- bActionChannel *chan;
- short a=0;
- for(chan=ob->action->chanbase.first; chan; chan= chan->next) {
- if(a==te->index) break;
- if(chan->ipo) a++;
- }
- if(chan==get_hilighted_action_channel(ob->action)) return 1;
- }
- }
- else if(ob->ipowin==tes->idcode) {
- if(ob->ipowin==ID_MA) {
- Material *ma= give_current_material(ob, ob->actcol);
- if(ma==(Material *)tselems->id) return 1;
- }
- else return 1;
- }
- }
- return 0;
-}
-
-static int tree_element_active_defgroup(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Object *ob;
-
- /* id in tselem is object */
- ob= (Object *)tselem->id;
- if(set) {
- ob->actdef= te->index+1;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, ob->ipowin);
- }
- else {
- if(ob==OBACT)
- if(ob->actdef== te->index+1) return 1;
- }
- return 0;
-}
-
-static int tree_element_active_nla_action(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- if(set) {
- bActionStrip *strip= te->directdata;
- if(strip) {
- deselect_nlachannel_keys(0);
- strip->flag |= ACTSTRIP_SELECT;
- allqueue(REDRAWNLA, 0);
- }
- }
- else {
- /* id in tselem is action */
- bActionStrip *strip= te->directdata;
- if(strip) {
- if(strip->flag & ACTSTRIP_SELECT) return 1;
- }
- }
- return 0;
-}
-
-static int tree_element_active_posegroup(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Object *ob= (Object *)tselem->id;
-
- if(set) {
- if (ob->pose) {
- ob->pose->active_group= te->index+1;
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- else {
- if(ob==OBACT && ob->pose) {
- if (ob->pose->active_group== te->index+1) return 1;
- }
- }
- return 0;
-}
-
-static int tree_element_active_posechannel(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Object *ob= (Object *)tselem->id;
- bPoseChannel *pchan= te->directdata;
-
- if(set) {
- if(!(pchan->bone->flag & BONE_HIDDEN_P)) {
-
- if(G.qual & LR_SHIFTKEY) deselectall_posearmature(ob, 2, 0); // 2 = clear active tag
- else deselectall_posearmature(ob, 0, 0); // 0 = deselect
- pchan->bone->flag |= BONE_SELECTED|BONE_ACTIVE;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWACTION, 0);
- }
- }
- else {
- if(ob==OBACT && ob->pose) {
- if (pchan->bone->flag & BONE_SELECTED) return 1;
- }
- }
- return 0;
-}
-
-static int tree_element_active_bone(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- bArmature *arm= (bArmature *)tselem->id;
- Bone *bone= te->directdata;
-
- if(set) {
- if(!(bone->flag & BONE_HIDDEN_P)) {
- if(G.qual & LR_SHIFTKEY) deselectall_posearmature(OBACT, 2, 0); // 2 is clear active tag
- else deselectall_posearmature(OBACT, 0, 0);
- bone->flag |= BONE_SELECTED|BONE_ACTIVE;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWACTION, 0);
- }
- }
- else {
- Object *ob= OBACT;
-
- if(ob && ob->data==arm) {
- if (bone->flag & BONE_SELECTED) return 1;
- }
- }
- return 0;
-}
-
-
-/* ebones only draw in editmode armature */
-static int tree_element_active_ebone(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- EditBone *ebone= te->directdata;
-
- if(set) {
- if(!(ebone->flag & BONE_HIDDEN_A)) {
-
- if(G.qual & LR_SHIFTKEY) deselectall_armature(2, 0); // only clear active tag
- else deselectall_armature(0, 0); // deselect
-
- ebone->flag |= BONE_SELECTED|BONE_ROOTSEL|BONE_TIPSEL|BONE_ACTIVE;
- // flush to parent?
- if(ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag |= BONE_TIPSEL;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWACTION, 0);
- }
- }
- else {
- if (ebone->flag & BONE_SELECTED) return 1;
- }
- return 0;
-}
-
-static int tree_element_active_modifier(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- if(set) {
- extern_set_butspace(F9KEY, 0);
- }
-
- return 0;
-}
-
-static int tree_element_active_constraint(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- if(set) {
- extern_set_butspace(F7KEY, 0);
- }
-
- return 0;
-}
-
-static int tree_element_active_text(SpaceOops *soops, TreeElement *te, int set)
-{
- ScrArea *sa=NULL;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_TEXT) break;
- }
- if(sa) {
- SpaceText *st= sa->spacedata.first;
- TreeStoreElem *tselem= TREESTORE(te);
-
- if(set) {
- st->text= (Text *)tselem->id;
- st->top= 0;
- scrarea_queue_redraw(sa);
- }
- else if(st->text==(Text *)tselem->id) return 1;
- }
- return 0;
-}
-
-/* generic call for ID data check or make/check active in UI */
-static int tree_element_active(SpaceOops *soops, TreeElement *te, int set)
-{
-
- switch(te->idcode) {
- case ID_MA:
- return tree_element_active_material(soops, te, set);
- case ID_WO:
- return tree_element_active_world(soops, te, set);
- case ID_LA:
- return tree_element_active_lamp(soops, te, set);
- case ID_IP:
- return tree_element_active_ipo(soops, te, set);
- case ID_TE:
- return tree_element_active_texture(soops, te, set);
- case ID_TXT:
- return tree_element_active_text(soops, te, set);
- }
- return 0;
-}
-
-static int tree_element_active_pose(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Object *ob= (Object *)tselem->id;
-
- if(set) {
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- if(ob->flag & OB_POSEMODE) exit_posemode();
- else enter_posemode();
- }
- else {
- if(ob->flag & OB_POSEMODE) return 1;
- }
- return 0;
-}
-
-static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Sequence *seq= (Sequence*) te->directdata;
-
- if(set) {
- select_single_seq(seq, 1);
- allqueue(REDRAWSEQ, 0);
- }
- else {
- if(seq->flag & SELECT)
- return(1);
- }
- return(0);
-}
-
-static int tree_element_active_sequence_dup(TreeElement *te, TreeStoreElem *tselem, int set)
-{
- Sequence *seq, *p;
- Editing *ed;
-
- seq= (Sequence*)te->directdata;
- if(set==0) {
- if(seq->flag & SELECT)
- return(1);
- return(0);
- }
-
- select_single_seq(seq, 1);
- ed= G.scene->ed;
- p= ed->seqbasep->first;
- while(p) {
- if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
- p= p->next;
- continue;
- }
-
- if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
- select_single_seq(p, 0);
- p= p->next;
- }
- allqueue(REDRAWSEQ, 0);
- return(0);
-}
-
-/* generic call for non-id data to make/check active in UI */
-static int tree_element_type_active(SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set)
-{
-
- switch(tselem->type) {
- case TSE_NLA_ACTION:
- return tree_element_active_nla_action(te, tselem, set);
- case TSE_DEFGROUP:
- return tree_element_active_defgroup(te, tselem, set);
- case TSE_BONE:
- return tree_element_active_bone(te, tselem, set);
- case TSE_EBONE:
- return tree_element_active_ebone(te, tselem, set);
- case TSE_MODIFIER:
- return tree_element_active_modifier(te, tselem, set);
- case TSE_LINKED_OB:
- if(set) tree_element_active_object(soops, te);
- else if(tselem->id==(ID *)OBACT) return 1;
- break;
- case TSE_POSE_BASE:
- return tree_element_active_pose(te, tselem, set);
- break;
- case TSE_POSE_CHANNEL:
- return tree_element_active_posechannel(te, tselem, set);
- case TSE_CONSTRAINT:
- return tree_element_active_constraint(te, tselem, set);
- case TSE_R_LAYER:
- return tree_element_active_renderlayer(te, tselem, set);
- case TSE_POSEGRP:
- return tree_element_active_posegroup(te, tselem, set);
- case TSE_SEQUENCE:
- return tree_element_active_sequence(te, tselem, set);
- break;
- case TSE_SEQUENCE_DUP:
- return tree_element_active_sequence_dup(te, tselem, set);
- break;
- }
- return 0;
-}
-
-#ifdef WITH_VERSE
-static void verse_operation_menu(TreeElement *te)
-{
- short event=0;
- if(te->idcode==ID_VS) {
- struct VerseSession *session = (VerseSession*)te->directdata;
- struct VNode *vnode;
- if(!(session->flag & VERSE_AUTOSUBSCRIBE)) {
- event = pupmenu("VerseSession %t| End Session %x1| Subscribe to All Nodes %x2| Start Autosubscribe %x3");
- }
- else {
- event = pupmenu("VerseSession %t| End Session %x1| Subscribe to All Nodes %x2| Stop Autosubscribe %x4");
- }
- switch(event) {
- case 1:
- end_verse_session(session);
- break;
- case 2:
- vnode = session->nodes.lb.first;
- while(vnode) {
- b_verse_pop_node(vnode);
- vnode = vnode->next;
- }
- break;
- case 3:
- vnode = session->nodes.lb.first;
- while(vnode) {
- b_verse_pop_node(vnode);
- vnode = vnode->next;
- }
- session->flag |= VERSE_AUTOSUBSCRIBE;
- break;
- case 4:
- session->flag &= ~VERSE_AUTOSUBSCRIBE;
- break;
- }
- }
- else if(te->idcode==ID_VN) {
- struct VNode *vnode = (VNode*)te->directdata;
- event = pupmenu("VerseNode %t| Subscribe %x1| Unsubscribe %x2");
- switch(event) {
- case 1:
- b_verse_pop_node(vnode);
- break;
- case 2:
- /* Global */
- b_verse_unsubscribe(vnode);
- break;
- }
- }
- else if(te->idcode==ID_MS) {
- event = pupmenu("Verse Master Server %t| Refresh %x1");
- b_verse_ms_get();
- }
- else if(te->idcode==ID_SS) {
- struct VerseServer *vserver = (VerseServer*)te->directdata;
-
- if(!(vserver->flag & VERSE_CONNECTING) && !(vserver->flag & VERSE_CONNECTED)) {
- event = pupmenu("VerseServer %t| Connect %x1");
- } else if((vserver->flag & VERSE_CONNECTING) && !(vserver->flag & VERSE_CONNECTED)) {
- event = pupmenu("VerseServer %t| Connecting %x2");
- } else if(!(vserver->flag & VERSE_CONNECTING) && (vserver->flag & VERSE_CONNECTED)) {
- event = pupmenu("VerseServer %t| Disconnect %x3");
- }
- switch(event) {
- case 1:
- b_verse_connect(vserver->ip);
- vserver->flag |= VERSE_CONNECTING;
- break;
- case 2:
- break;
- case 3:
- end_verse_session(vserver->session);
- break;
- }
- }
-}
-#endif
-
-
-static int do_outliner_mouse_event(SpaceOops *soops, TreeElement *te, short event, float *mval)
-{
-
- if(mval[1]>te->ys && mval[1]<te->ys+OL_H) {
- TreeStoreElem *tselem= TREESTORE(te);
- int openclose= 0;
-
- /* open close icon, three things to check */
- if(event==RETKEY || event==PADENTER) openclose= 1; // enter opens/closes always
- else if((te->flag & TE_ICONROW)==0) { // hidden icon, no open/close
- if( mval[0]>te->xs && mval[0]<te->xs+OL_X) openclose= 1;
- }
-
- if(openclose) {
-
- /* all below close/open? */
- if( (G.qual & LR_SHIFTKEY) ) {
- tselem->flag &= ~TSE_CLOSED;
- outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1));
- }
- else {
- if(tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
- else tselem->flag |= TSE_CLOSED;
-
- }
-
- return 1;
- }
- /* name and first icon */
- else if(mval[0]>te->xs && mval[0]<te->xend) {
-
- /* activate a name button? */
- if(event==LEFTMOUSE) {
-
- if (G.qual == LR_CTRLKEY) {
- if(ELEM9(tselem->type, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_POSEGRP_BASE, TSE_R_LAYER_BASE, TSE_R_PASS))
- error("Cannot edit builtin name");
- else if(ELEM3(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP))
- error("Cannot edit sequence name");
- else if(tselem->id->lib) {
- error_libdata();
- } else if(te->idcode == ID_LI && te->parent) {
- error("Cannot edit the path of an indirectly linked library");
- } else {
- tselem->flag |= TSE_TEXTBUT;
- }
- } else {
- /* always makes active object */
- if(tselem->type!=TSE_SEQUENCE && tselem->type!=TSE_SEQ_STRIP && tselem->type!=TSE_SEQUENCE_DUP)
- tree_element_active_object(soops, te);
-
- if(tselem->type==0) { // the lib blocks
- /* editmode? */
- if(te->idcode==ID_SCE) {
- if(G.scene!=(Scene *)tselem->id) {
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- set_scene((Scene *)tselem->id);
- countall();
- }
- }
- else if(ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) {
- if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
- else {
- enter_editmode(EM_WAITCURSOR);
- extern_set_butspace(F9KEY, 0);
- }
- } else { // rest of types
- tree_element_active(soops, te, 1);
- }
-
- }
- else tree_element_type_active(soops, te, tselem, 1);
- }
- }
- else if(event==RIGHTMOUSE) {
-#ifdef WITH_VERSE
- if((tselem->type!=TSE_SEQUENCE && tselem->type!=TSE_SEQ_STRIP && tselem->type!=TSE_SEQUENCE_DUP) && ELEM4(te->idcode, ID_VS, ID_VN, ID_MS, ID_SS))
- verse_operation_menu(te);
- else
-#endif
- /* select object that's clicked on and popup context menu */
- if (!(tselem->flag & TSE_SELECTED)) {
-
- if ( outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1) )
- outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
-
- tselem->flag |= TSE_SELECTED;
- /* redraw, same as outliner_select function */
- soops->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_do_windraw(soops->area);
- screen_swapbuffers();
- }
-
- outliner_operation_menu(soops->area);
- }
- return 1;
- }
- }
-
- for(te= te->subtree.first; te; te= te->next) {
- if(do_outliner_mouse_event(soops, te, event, mval)) return 1;
- }
- return 0;
-}
-
-/* event can enterkey, then it opens/closes */
-void outliner_mouse_event(ScrArea *sa, short event)
-{
- SpaceOops *soops= sa->spacedata.first;
- TreeElement *te;
- float fmval[2];
- short mval[2];
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(&soops->v2d, mval, fmval, fmval+1);
-
- for(te= soops->tree.first; te; te= te->next) {
- if(do_outliner_mouse_event(soops, te, event, fmval)) break;
- }
-
- if(te) {
- BIF_undo_push("Outliner click event");
- allqueue(REDRAWOOPS, 0);
- }
- else
- outliner_select(sa);
-
-}
-/* recursive helper for function below */
-static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty)
-{
- TreeStoreElem *tselem= TREESTORE(te);
-
- /* store coord and continue, we need coordinates for elements outside view too */
- te->xs= (float)startx;
- te->ys= (float)(*starty);
- *starty-= OL_H;
-
- if((tselem->flag & TSE_CLOSED)==0) {
- TreeElement *ten;
- for(ten= te->subtree.first; ten; ten= ten->next) {
- outliner_set_coordinates_element(soops, ten, startx+OL_X, starty);
- }
- }
-
-}
-
-/* to retrieve coordinates with redrawing the entire tree */
-static void outliner_set_coordinates(SpaceOops *soops)
-{
- TreeElement *te;
- int starty= (int)(soops->v2d.tot.ymax)-OL_H;
- int startx= 0;
-
- for(te= soops->tree.first; te; te= te->next) {
- outliner_set_coordinates_element(soops, te, startx, &starty);
- }
-}
-
-static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id)
-{
- TreeElement *te, *tes;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->type==0) {
- if(tselem->id==id) return te;
- /* only deeper on scene or object */
- if( te->idcode==ID_OB || te->idcode==ID_SCE) {
- tes= outliner_find_id(soops, &te->subtree, id);
- if(tes) return tes;
- }
- }
- }
- return NULL;
-}
-
-void outliner_show_active(struct ScrArea *sa)
-{
- SpaceOops *so= sa->spacedata.first;
- TreeElement *te;
- int xdelta, ytop;
-
- if(OBACT == NULL) return;
-
- te= outliner_find_id(so, &so->tree, (ID *)OBACT);
- if(te) {
- /* make te->ys center of view */
- ytop= (int)(te->ys + (so->v2d.mask.ymax-so->v2d.mask.ymin)/2);
- if(ytop>0) ytop= 0;
- so->v2d.cur.ymax= (float)ytop;
- so->v2d.cur.ymin= (float)(ytop-(so->v2d.mask.ymax-so->v2d.mask.ymin));
-
- /* make te->xs ==> te->xend center of view */
- xdelta = (int)(te->xs - so->v2d.cur.xmin);
- so->v2d.cur.xmin += xdelta;
- so->v2d.cur.xmax += xdelta;
-
- so->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_queue_redraw(sa);
- }
-}
-
-void outliner_show_selected(struct ScrArea *sa)
-{
- SpaceOops *so= sa->spacedata.first;
- TreeElement *te;
- int xdelta, ytop;
-
- te= outliner_find_id(so, &so->tree, (ID *)OBACT);
- if(te) {
- /* make te->ys center of view */
- ytop= (int)(te->ys + (so->v2d.mask.ymax-so->v2d.mask.ymin)/2);
- if(ytop>0) ytop= 0;
- so->v2d.cur.ymax= (float)ytop;
- so->v2d.cur.ymin= (float)(ytop-(so->v2d.mask.ymax-so->v2d.mask.ymin));
-
- /* make te->xs ==> te->xend center of view */
- xdelta = (int)(te->xs - so->v2d.cur.xmin);
- so->v2d.cur.xmin += xdelta;
- so->v2d.cur.xmax += xdelta;
-
- so->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_queue_redraw(sa);
- }
-}
-
-
-/* find next element that has this name */
-static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
-{
- TreeElement *te, *tes;
-
- for (te= lb->first; te; te= te->next) {
- int found;
-
- /* determine if match */
- if(flags==OL_FIND)
- found= BLI_strcasestr(te->name, name)!=NULL;
- else if(flags==OL_FIND_CASE)
- found= strstr(te->name, name)!=NULL;
- else if(flags==OL_FIND_COMPLETE)
- found= BLI_strcasecmp(te->name, name)==0;
- else
- found= strcmp(te->name, name)==0;
-
- if(found) {
- /* name is right, but is element the previous one? */
- if (prev) {
- if ((te != prev) && (*prevFound))
- return te;
- if (te == prev) {
- *prevFound = 1;
- }
- }
- else
- return te;
- }
-
- tes= outliner_find_named(soops, &te->subtree, name, flags, prev, prevFound);
- if(tes) return tes;
- }
-
- /* nothing valid found */
- return NULL;
-}
-
-/* tse is not in the treestore, we use its contents to find a match */
-static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse)
-{
- TreeStore *ts= soops->treestore;
- TreeStoreElem *tselem;
- int a;
-
- if(tse->id==NULL) return NULL;
-
- /* check if 'tse' is in treestore */
- tselem= ts->data;
- for(a=0; a<ts->usedelem; a++, tselem++) {
- if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) {
- if(tselem->id==tse->id) {
- break;
- }
- }
- }
- if(tselem)
- return outliner_find_tree_element(&soops->tree, a);
-
- return NULL;
-}
-
-
-/* Called to find an item based on name.
- */
-void outliner_find_panel(struct ScrArea *sa, int again, int flags)
-{
- SpaceOops *soops= sa->spacedata.first;
- TreeElement *te= NULL;
- TreeElement *last_find;
- TreeStoreElem *tselem;
- int ytop, xdelta, prevFound=0;
- char name[33];
-
- /* get last found tree-element based on stored search_tse */
- last_find= outliner_find_tse(soops, &soops->search_tse);
-
- /* determine which type of search to do */
- if (again && last_find) {
- /* no popup panel - previous + user wanted to search for next after previous */
- BLI_strncpy(name, soops->search_string, 33);
- flags= soops->search_flags;
-
- /* try to find matching element */
- te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
- if (te==NULL) {
- /* no more matches after previous, start from beginning again */
- prevFound= 1;
- te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
- }
- }
- else {
- /* pop up panel - no previous, or user didn't want search after previous */
- strcpy(name, "");
- if (sbutton(name, 0, sizeof(name)-1, "Find: ") && name[0]) {
- te= outliner_find_named(soops, &soops->tree, name, flags, NULL, &prevFound);
- }
- else return; /* XXX RETURN! XXX */
- }
-
- /* do selection and reveil */
- if (te) {
- tselem= TREESTORE(te);
- if (tselem) {
- /* expand branches so that it will be visible, we need to get correct coordinates */
- if( outliner_open_back(soops, te))
- outliner_set_coordinates(soops);
-
- /* deselect all visible, and select found element */
- outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
- tselem->flag |= TSE_SELECTED;
-
- /* make te->ys center of view */
- ytop= (int)(te->ys + (soops->v2d.mask.ymax-soops->v2d.mask.ymin)/2);
- if(ytop>0) ytop= 0;
- soops->v2d.cur.ymax= (float)ytop;
- soops->v2d.cur.ymin= (float)(ytop-(soops->v2d.mask.ymax-soops->v2d.mask.ymin));
-
- /* make te->xs ==> te->xend center of view */
- xdelta = (int)(te->xs - soops->v2d.cur.xmin);
- soops->v2d.cur.xmin += xdelta;
- soops->v2d.cur.xmax += xdelta;
-
- /* store selection */
- soops->search_tse= *tselem;
-
- BLI_strncpy(soops->search_string, name, 33);
- soops->search_flags= flags;
-
- /* redraw */
- soops->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_queue_redraw(sa);
- }
- }
- else {
- /* no tree-element found */
- error("Not found: %s", name);
- }
-}
-
-static int subtree_has_objects(SpaceOops *soops, ListBase *lb)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->type==0 && te->idcode==ID_OB) return 1;
- if( subtree_has_objects(soops, &te->subtree)) return 1;
- }
- return 0;
-}
-
-static void tree_element_show_hierarchy(SpaceOops *soops, ListBase *lb)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- /* open all object elems, close others */
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
-
- if(tselem->type==0) {
- if(te->idcode==ID_SCE) {
- if(tselem->id!=(ID *)G.scene) tselem->flag |= TSE_CLOSED;
- else tselem->flag &= ~TSE_CLOSED;
- }
- else if(te->idcode==ID_OB) {
- if(subtree_has_objects(soops, &te->subtree)) tselem->flag &= ~TSE_CLOSED;
- else tselem->flag |= TSE_CLOSED;
- }
- }
- else tselem->flag |= TSE_CLOSED;
-
- if(tselem->flag & TSE_CLOSED); else tree_element_show_hierarchy(soops, &te->subtree);
- }
-
-}
-
-/* show entire object level hierarchy */
-void outliner_show_hierarchy(struct ScrArea *sa)
-{
- SpaceOops *so= sa->spacedata.first;
-
- tree_element_show_hierarchy(so, &so->tree);
- scrarea_queue_redraw(sa);
-
- BIF_undo_push("Outliner show hierarchy");
-}
-
-static void do_outliner_select(SpaceOops *soops, ListBase *lb, float y1, float y2, short *selecting)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- if(y1>y2) SWAP(float, y1, y2);
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
-
- if(te->ys + OL_H < y1) return;
- if(te->ys < y2) {
- if((te->flag & TE_ICONROW)==0) {
- if(*selecting == -1) {
- if( tselem->flag & TSE_SELECTED) *selecting= 0;
- else *selecting= 1;
- }
- if(*selecting) tselem->flag |= TSE_SELECTED;
- else tselem->flag &= ~TSE_SELECTED;
- }
- }
- if((tselem->flag & TSE_CLOSED)==0) do_outliner_select(soops, &te->subtree, y1, y2, selecting);
- }
-}
-
-/* its own redraw loop... urm */
-void outliner_select(struct ScrArea *sa )
-{
- SpaceOops *so= sa->spacedata.first;
- float fmval[2], y1, y2;
- short mval[2], yo=-1, selecting= -1;
-
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(&so->v2d, mval, fmval, fmval+1);
- y1= fmval[1];
-
- while (get_mbut() & (L_MOUSE|R_MOUSE)) {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(&so->v2d, mval, fmval, fmval+1);
- y2= fmval[1];
-
- if(yo!=mval[1]) {
- /* select the 'ouliner row' */
- do_outliner_select(so, &so->tree, y1, y2, &selecting);
- yo= mval[1];
-
- so->storeflag |= SO_TREESTORE_REDRAW;
- scrarea_do_windraw(sa);
- screen_swapbuffers();
-
- y1= y2;
- }
- else PIL_sleep_ms(30);
- }
-
- BIF_undo_push("Outliner selection");
-
-}
-
-/* ************ SELECTION OPERATIONS ********* */
-
-static void set_operation_types(SpaceOops *soops, ListBase *lb,
- int *scenelevel,
- int *objectlevel,
- int *idlevel,
- int *datalevel)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type) {
- if(tselem->type==TSE_SEQUENCE)
- *datalevel= TSE_SEQUENCE;
- else if(tselem->type==TSE_SEQ_STRIP)
- *datalevel= TSE_SEQ_STRIP;
- else if(tselem->type==TSE_SEQUENCE_DUP)
- *datalevel= TSE_SEQUENCE_DUP;
-#ifdef WITH_VERSE
- else if(te->idcode==ID_VS) *datalevel= TSE_VERSE_SESSION;
- else if(te->idcode==ID_VN) *datalevel= TSE_VERSE_OBJ_NODE;
- else if(*datalevel==0) *datalevel= tselem->type;
-#else
- else if(*datalevel==0) *datalevel= tselem->type;
-#endif
- else if(*datalevel!=tselem->type) *datalevel= -1;
- }
- else {
- int idcode= GS(tselem->id->name);
- switch(idcode) {
- case ID_SCE:
- *scenelevel= 1;
- break;
- case ID_OB:
- *objectlevel= 1;
- break;
-
- case ID_ME: case ID_CU: case ID_MB: case ID_LT:
- case ID_LA: case ID_AR: case ID_CA:
- case ID_MA: case ID_TE: case ID_IP: case ID_IM:
- case ID_SO: case ID_KE: case ID_WO: case ID_AC:
- case ID_NLA: case ID_TXT: case ID_GR:
- if(*idlevel==0) *idlevel= idcode;
- else if(*idlevel!=idcode) *idlevel= -1;
- break;
- }
- }
- }
- if((tselem->flag & TSE_CLOSED)==0) {
- set_operation_types(soops, &te->subtree,
- scenelevel, objectlevel, idlevel, datalevel);
- }
- }
-}
-
-static void unlink_material_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Material **matar=NULL;
- int a, totcol=0;
-
- if( GS(tsep->id->name)==ID_OB) {
- Object *ob= (Object *)tsep->id;
- totcol= ob->totcol;
- matar= ob->mat;
- }
- else if( GS(tsep->id->name)==ID_ME) {
- Mesh *me= (Mesh *)tsep->id;
- totcol= me->totcol;
- matar= me->mat;
- }
- else if( GS(tsep->id->name)==ID_CU) {
- Curve *cu= (Curve *)tsep->id;
- totcol= cu->totcol;
- matar= cu->mat;
- }
- else if( GS(tsep->id->name)==ID_MB) {
- MetaBall *mb= (MetaBall *)tsep->id;
- totcol= mb->totcol;
- matar= mb->mat;
- }
-
- for(a=0; a<totcol; a++) {
- if(a==te->index && matar[a]) {
- matar[a]->id.us--;
- matar[a]= NULL;
- }
- }
-}
-
-static void unlink_texture_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- MTex **mtex= NULL;
- int a;
-
- if( GS(tsep->id->name)==ID_MA) {
- Material *ma= (Material *)tsep->id;
- mtex= ma->mtex;
- }
- else if( GS(tsep->id->name)==ID_LA) {
- Lamp *la= (Lamp *)tsep->id;
- mtex= la->mtex;
- }
- else if( GS(tsep->id->name)==ID_WO) {
- World *wrld= (World *)tsep->id;
- mtex= wrld->mtex;
- }
- else return;
-
- for(a=0; a<MAX_MTEX; a++) {
- if(a==te->index && mtex[a]) {
- if(mtex[a]->tex) {
- mtex[a]->tex->id.us--;
- mtex[a]->tex= NULL;
- }
- }
- }
-}
-
-static void unlink_group_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Group *group= (Group *)tselem->id;
-
- if(tsep) {
- if( GS(tsep->id->name)==ID_OB) {
- Object *ob= (Object *)tsep->id;
- ob->dup_group= NULL;
- group->id.us--;
- }
- }
- else {
- unlink_group(group);
- }
-}
-
-static void outliner_do_libdata_operation(SpaceOops *soops, ListBase *lb,
- void (*operation_cb)(TreeElement *, TreeStoreElem *, TreeStoreElem *))
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te=lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==0) {
- TreeStoreElem *tsep= TREESTORE(te->parent);
- operation_cb(te, tsep, tselem);
- }
- }
- if((tselem->flag & TSE_CLOSED)==0) {
- outliner_do_libdata_operation(soops, &te->subtree, operation_cb);
- }
- }
-}
-
-/* */
-
-static void object_select_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base && ((base->object->restrictflag & OB_RESTRICT_VIEW)==0)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- }
-}
-
-static void object_deselect_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base) {
- base->flag &= ~SELECT;
- base->object->flag &= ~SELECT;
- }
-}
-
-static void object_delete_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Base *base= (Base *)te->directdata;
-
- if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene);
- if(base) {
- // check also library later
- if(G.obedit==base->object) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
-
- if(base==BASACT) {
- G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE);
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
- }
-
- free_and_unlink_base(base);
- te->directdata= NULL;
- tselem->id= NULL;
- }
-}
-
-static void id_local_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) {
- tselem->id->lib= NULL;
- tselem->id->flag= LIB_LOCAL;
- new_id(0, tselem->id, 0);
- }
-}
-
-static void group_linkobs2scene_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
-{
- Group *group= (Group *)tselem->id;
- GroupObject *gob;
- Base *base;
-
- for(gob=group->gobject.first; gob; gob=gob->next) {
- base= object_in_scene(gob->ob, G.scene);
- if (base) {
- base->object->flag |= SELECT;
- base->flag |= SELECT;
- } else {
- /* link to scene */
- base= MEM_callocN( sizeof(Base), "add_base");
- BLI_addhead(&G.scene->base, base);
- base->lay= (1<<20)-1; /*G.vd->lay;*/ /* would be nice to use the 3d layer but the include's not here */
- gob->ob->flag |= SELECT;
- base->flag = gob->ob->flag;
- base->object= gob->ob;
- id_lib_extern((ID *)gob->ob); /* incase these are from a linked group */
- }
- }
-}
-
-static void outliner_do_object_operation(SpaceOops *soops, ListBase *lb,
- void (*operation_cb)(TreeElement *, TreeStoreElem *, TreeStoreElem *))
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te=lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==0 && te->idcode==ID_OB) {
- // when objects selected in other scenes... dunno if that should be allowed
- Scene *sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
- if(sce && G.scene != sce) {
- set_scene(sce);
- countall();
- }
-
- operation_cb(te, NULL, tselem);
- }
- }
- if((tselem->flag & TSE_CLOSED)==0) {
- outliner_do_object_operation(soops, &te->subtree, operation_cb);
- }
- }
-}
-
-static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem)
-{
- bPoseChannel *pchan= (bPoseChannel *)te->directdata;
-
- if(event==1)
- pchan->bone->flag |= BONE_SELECTED;
- else if(event==2)
- pchan->bone->flag &= ~BONE_SELECTED;
- else if(event==3) {
- pchan->bone->flag |= BONE_HIDDEN_P;
- pchan->bone->flag &= ~BONE_SELECTED;
- }
- else if(event==4)
- pchan->bone->flag &= ~BONE_HIDDEN_P;
-}
-
-static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem)
-{
- Bone *bone= (Bone *)te->directdata;
-
- if(event==1)
- bone->flag |= BONE_SELECTED;
- else if(event==2)
- bone->flag &= ~BONE_SELECTED;
- else if(event==3) {
- bone->flag |= BONE_HIDDEN_P;
- bone->flag &= ~BONE_SELECTED;
- }
- else if(event==4)
- bone->flag &= ~BONE_HIDDEN_P;
-}
-
-static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem)
-{
- EditBone *ebone= (EditBone *)te->directdata;
-
- if(event==1)
- ebone->flag |= BONE_SELECTED;
- else if(event==2)
- ebone->flag &= ~BONE_SELECTED;
- else if(event==3) {
- ebone->flag |= BONE_HIDDEN_A;
- ebone->flag &= ~BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- }
- else if(event==4)
- ebone->flag &= ~BONE_HIDDEN_A;
-}
-
-#ifdef WITH_VERSE
-static void vsession_cb(int event, TreeElement *te, TreeStoreElem *tselem)
-{
-/* struct VerseSession *vsession =(VerseSession*)te->directdata;*/
-
- if(event==1) {
- printf("\tending verse session\n");
- }
-}
-#endif
-
-static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem)
-{
- Sequence *seq= (Sequence*) te->directdata;
- if(event==1) {
- select_single_seq(seq, 1);
- allqueue(REDRAWSEQ, 0);
- }
-}
-
-static void outliner_do_data_operation(SpaceOops *soops, int type, int event, ListBase *lb,
- void (*operation_cb)(int, TreeElement *, TreeStoreElem *))
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te=lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(tselem->flag & TSE_SELECTED) {
- if(tselem->type==type) {
- operation_cb(event, te, tselem);
- }
- }
- if((tselem->flag & TSE_CLOSED)==0) {
- outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb);
- }
- }
-}
-
-void outliner_del(ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
- if(soops->outlinevis==SO_SEQUENCE)
- del_seq();
- else {
- outliner_do_object_operation(soops, &soops->tree, object_delete_cb);
- DAG_scene_sort(G.scene);
- countall();
- BIF_undo_push("Delete Objects");
- }
- allqueue(REDRAWALL, 0);
-}
-
-
-void outliner_operation_menu(ScrArea *sa)
-{
- SpaceOops *soops= sa->spacedata.first;
- int scenelevel=0, objectlevel=0, idlevel=0, datalevel=0;
-
- set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel);
-
- if(scenelevel) {
- if(objectlevel || datalevel || idlevel) error("Mixed selection");
- //else pupmenu("Scene Operations%t|Delete");
- }
- else if(objectlevel) {
- short event= pupmenu("Select%x1|Deselect%x2|Delete%x4|Toggle Visible%x6|Toggle Selectable%x7|Toggle Renderable%x8"); /* make local: does not work... it doesn't set lib_extern flags... so data gets lost */
- if(event>0) {
- char *str="";
-
- if(event==1) {
- Scene *sce= G.scene; // to be able to delete, scenes are set...
- outliner_do_object_operation(soops, &soops->tree, object_select_cb);
- if(G.scene != sce) {
- set_scene(sce);
- countall();
- }
-
- str= "Select Objects";
- }
- else if(event==2) {
- outliner_do_object_operation(soops, &soops->tree, object_deselect_cb);
- str= "Deselect Objects";
- }
- else if(event==4) {
- outliner_do_object_operation(soops, &soops->tree, object_delete_cb);
- DAG_scene_sort(G.scene);
- str= "Delete Objects";
- }
- else if(event==5) { /* disabled, see above (ton) */
- outliner_do_object_operation(soops, &soops->tree, id_local_cb);
- str= "Localized Objects";
- }
- else if(event==6) {
- outliner_do_object_operation(soops, &soops->tree, object_toggle_visibility_cb);
- str= "Toggle Visibility";
- }
- else if(event==7) {
- outliner_do_object_operation(soops, &soops->tree, object_toggle_selectability_cb);
- str= "Toggle Selectability";
- }
- else if(event==8) {
- outliner_do_object_operation(soops, &soops->tree, object_toggle_renderability_cb);
- str= "Toggle Renderability";
- }
- countall();
-
- BIF_undo_push(str);
- allqueue(REDRAWALL, 0);
- }
- }
- else if(idlevel) {
- if(idlevel==-1 || datalevel) error("Mixed selection");
- else {
- short event;
- if (idlevel==ID_GR)
- event = pupmenu("Unlink %x1|Make Local %x2|Link Group Objects to Scene%x3");
- else
- event = pupmenu("Unlink %x1|Make Local %x2");
-
-
- if(event==1) {
- switch(idlevel) {
- case ID_MA:
- outliner_do_libdata_operation(soops, &soops->tree, unlink_material_cb);
- BIF_undo_push("Unlink material");
- allqueue(REDRAWBUTSSHADING, 1);
- break;
- case ID_TE:
- outliner_do_libdata_operation(soops, &soops->tree, unlink_texture_cb);
- allqueue(REDRAWBUTSSHADING, 1);
- BIF_undo_push("Unlink texture");
- break;
- case ID_GR:
- outliner_do_libdata_operation(soops, &soops->tree, unlink_group_cb);
- BIF_undo_push("Unlink group");
- break;
- default:
- error("Not yet...");
- }
- allqueue(REDRAWALL, 0);
- }
- else if(event==2) {
- outliner_do_libdata_operation(soops, &soops->tree, id_local_cb);
- BIF_undo_push("Localized Data");
- allqueue(REDRAWALL, 0);
- }
- else if(event==3 && idlevel==ID_GR) {
- outliner_do_libdata_operation(soops, &soops->tree, group_linkobs2scene_cb);
- BIF_undo_push("Link Group Objects to Scene");
- }
- }
- }
- else if(datalevel) {
- if(datalevel==-1) error("Mixed selection");
- else {
- if(datalevel==TSE_POSE_CHANNEL) {
- short event= pupmenu("PoseChannel Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4");
- if(event>0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb);
- BIF_undo_push("PoseChannel operation");
- }
- }
- else if(datalevel==TSE_BONE) {
- short event= pupmenu("Bone Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4");
- if(event>0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb);
- BIF_undo_push("Bone operation");
- }
- }
- else if(datalevel==TSE_EBONE) {
- short event= pupmenu("EditBone Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4");
- if(event>0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb);
- BIF_undo_push("EditBone operation");
- }
- }
-#ifdef WITH_VERSE
- else if(datalevel==TSE_VERSE_SESSION) {
- short event= pupmenu("VerseSession %t| End %x1");
- if(event>0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, vsession_cb);
- }
- }
-#endif
- else if(datalevel==TSE_SEQUENCE) {
- short event= pupmenu("Sequence Operations %t|Select %x1");
- if(event>0) {
- outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb);
- }
- }
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-}
-
-
-/* ***************** DRAW *************** */
-
-static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElement *te)
-{
- if(tselem->type) {
- switch( tselem->type) {
- case TSE_NLA:
- BIF_icon_draw(x, y, ICON_NLA); break;
- case TSE_NLA_ACTION:
- BIF_icon_draw(x, y, ICON_ACTION); break;
- case TSE_DEFGROUP_BASE:
- BIF_icon_draw(x, y, ICON_VERTEXSEL); break;
- case TSE_BONE:
- case TSE_EBONE:
- BIF_icon_draw(x, y, ICON_WPAINT_DEHLT); break;
- case TSE_CONSTRAINT_BASE:
- BIF_icon_draw(x, y, ICON_CONSTRAINT); break;
- case TSE_MODIFIER_BASE:
- BIF_icon_draw(x, y, ICON_MODIFIER); break;
- case TSE_LINKED_OB:
- BIF_icon_draw(x, y, ICON_OBJECT); break;
- case TSE_MODIFIER:
- {
- Object *ob= (Object *)tselem->id;
- ModifierData *md= BLI_findlink(&ob->modifiers, tselem->nr);
- switch(md->type) {
- case eModifierType_Subsurf:
- BIF_icon_draw(x, y, ICON_MOD_SUBSURF); break;
- case eModifierType_Armature:
- BIF_icon_draw(x, y, ICON_ARMATURE); break;
- case eModifierType_Lattice:
- BIF_icon_draw(x, y, ICON_LATTICE); break;
- case eModifierType_Curve:
- BIF_icon_draw(x, y, ICON_CURVE); break;
- case eModifierType_Build:
- BIF_icon_draw(x, y, ICON_MOD_BUILD); break;
- case eModifierType_Mirror:
- BIF_icon_draw(x, y, ICON_MOD_MIRROR); break;
- case eModifierType_Decimate:
- BIF_icon_draw(x, y, ICON_MOD_DECIM); break;
- case eModifierType_Wave:
- BIF_icon_draw(x, y, ICON_MOD_WAVE); break;
- case eModifierType_Hook:
- BIF_icon_draw(x, y, ICON_HOOK); break;
- case eModifierType_Softbody:
- BIF_icon_draw(x, y, ICON_MOD_SOFT); break;
- case eModifierType_Boolean:
- BIF_icon_draw(x, y, ICON_MOD_BOOLEAN); break;
- default:
- BIF_icon_draw(x, y, ICON_DOT); break;
- }
- break;
- }
- case TSE_SCRIPT_BASE:
- BIF_icon_draw(x, y, ICON_TEXT); break;
- case TSE_POSE_BASE:
- BIF_icon_draw(x, y, ICON_ARMATURE_DEHLT); break;
- case TSE_POSE_CHANNEL:
- BIF_icon_draw(x, y, ICON_WPAINT_DEHLT); break;
- case TSE_PROXY:
- BIF_icon_draw(x, y, ICON_GHOST); break;
- case TSE_R_LAYER_BASE:
- BIF_icon_draw(x, y, ICON_RESTRICT_RENDER_OFF); break;
- case TSE_R_LAYER:
- BIF_icon_draw(x, y, ICON_IMAGE_DEHLT); break;
- case TSE_LINKED_LAMP:
- BIF_icon_draw(x, y, ICON_LAMP_DEHLT); break;
- case TSE_LINKED_MAT:
- BIF_icon_draw(x, y, ICON_MATERIAL_DEHLT); break;
- case TSE_POSEGRP_BASE:
- BIF_icon_draw(x, y, ICON_VERTEXSEL); break;
- case TSE_SEQUENCE:
- if((te->idcode==SEQ_MOVIE) || (te->idcode==SEQ_MOVIE_AND_HD_SOUND))
- BIF_icon_draw(x, y, ICON_SEQUENCE);
- else if(te->idcode==SEQ_META)
- BIF_icon_draw(x, y, ICON_DOT);
- else if(te->idcode==SEQ_SCENE)
- BIF_icon_draw(x, y, ICON_SCENE);
- else if((te->idcode==SEQ_RAM_SOUND) || (te->idcode==SEQ_HD_SOUND))
- BIF_icon_draw(x, y, ICON_SOUND);
- else if(te->idcode==SEQ_IMAGE)
- BIF_icon_draw(x, y, ICON_IMAGE_COL);
- else
- BIF_icon_draw(x, y, ICON_PARTICLES);
- break;
- case TSE_SEQ_STRIP:
- BIF_icon_draw(x, y, ICON_LIBRARY_DEHLT);
- break;
- case TSE_SEQUENCE_DUP:
- BIF_icon_draw(x, y, ICON_OBJECT);
- break;
-#ifdef WITH_VERSE
- case ID_VS:
- case ID_MS:
- case ID_SS:
- BIF_icon_draw(x, y, ICON_VERSE); break;
- case ID_VN:
- BIF_icon_draw(x, y, ICON_VERSE); break;
-#endif
- default:
- BIF_icon_draw(x, y, ICON_DOT); break;
- }
- }
- else {
- switch( GS(tselem->id->name)) {
- case ID_SCE:
- BIF_icon_draw(x, y, ICON_SCENE_DEHLT); break;
- case ID_OB:
- BIF_icon_draw(x, y, ICON_OBJECT); break;
- case ID_ME:
- BIF_icon_draw(x, y, ICON_MESH); break;
- case ID_CU:
- BIF_icon_draw(x, y, ICON_CURVE); break;
- case ID_MB:
- BIF_icon_draw(x, y, ICON_MBALL); break;
- case ID_LT:
- BIF_icon_draw(x, y, ICON_LATTICE); break;
- case ID_LA:
- BIF_icon_draw(x, y, ICON_LAMP_DEHLT); break;
- case ID_MA:
- BIF_icon_draw(x, y, ICON_MATERIAL_DEHLT); break;
- case ID_TE:
- BIF_icon_draw(x, y, ICON_TEXTURE_DEHLT); break;
- case ID_IP:
- BIF_icon_draw(x, y, ICON_IPO_DEHLT); break;
- case ID_IM:
- BIF_icon_draw(x, y, ICON_IMAGE_DEHLT); break;
- case ID_SO:
- BIF_icon_draw(x, y, ICON_SPEAKER); break;
- case ID_AR:
- BIF_icon_draw(x, y, ICON_ARMATURE); break;
- case ID_CA:
- BIF_icon_draw(x, y, ICON_CAMERA_DEHLT); break;
- case ID_KE:
- BIF_icon_draw(x, y, ICON_EDIT_DEHLT); break;
- case ID_WO:
- BIF_icon_draw(x, y, ICON_WORLD_DEHLT); break;
- case ID_AC:
- BIF_icon_draw(x, y, ICON_ACTION); break;
- case ID_NLA:
- BIF_icon_draw(x, y, ICON_NLA); break;
- case ID_TXT:
- BIF_icon_draw(x, y, ICON_SCRIPT); break;
- case ID_GR:
- BIF_icon_draw(x, y, ICON_CIRCLE_DEHLT); break;
- case ID_LI:
- BIF_icon_draw(x, y, ICON_LIBRARY_DEHLT); break;
- }
- }
-}
-
-static void outliner_draw_iconrow(SpaceOops *soops, ListBase *lb, int level, int *offsx, int ys)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
- int active;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
-
- /* object hierarchy always, further constrained on level */
- if(level<1 || (tselem->type==0 && te->idcode==ID_OB)) {
-
- /* active blocks get white circle */
- active= 0;
- if(tselem->type==0) {
- if(te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id);
- else if(G.obedit && G.obedit->data==tselem->id) active= 1;
- else active= tree_element_active(soops, te, 0);
- }
- else active= tree_element_type_active(soops, te, tselem, 0);
-
- if(active) {
- uiSetRoundBox(15);
- glColor4ub(255, 255, 255, 100);
- uiRoundBox( (float)*offsx-0.5f, (float)ys-1.0f, (float)*offsx+OL_H-3.0f, (float)ys+OL_H-3.0f, OL_H/2.0f-2.0f);
- glEnable(GL_BLEND);
- }
-
- tselem_draw_icon((float)*offsx, (float)ys, tselem, te);
- te->xs= (float)*offsx;
- te->ys= (float)ys;
- te->xend= (short)*offsx+OL_X;
- te->flag |= TE_ICONROW; // for click
-
- (*offsx) += OL_X;
- }
-
- /* this tree element always has same amount of branches, so dont draw */
- if(tselem->type!=TSE_R_LAYER)
- outliner_draw_iconrow(soops, &te->subtree, level+1, offsx, ys);
- }
-
-}
-
-static void outliner_draw_tree_element(SpaceOops *soops, TreeElement *te, int startx, int *starty)
-{
- TreeElement *ten;
- TreeStoreElem *tselem;
- int offsx= 0, active=0; // active=1 active obj, else active data
-
- tselem= TREESTORE(te);
-
- if(*starty >= soops->v2d.cur.ymin && *starty<= soops->v2d.cur.ymax) {
-
- glEnable(GL_BLEND);
-
- /* colors for active/selected data */
- if(tselem->type==0) {
- if(te->idcode==ID_SCE) {
- if(tselem->id == (ID *)G.scene) {
- glColor4ub(255, 255, 255, 100);
- active= 2;
- }
- }
- else if(te->idcode==ID_OB) {
- Object *ob= (Object *)tselem->id;
-
- if(ob==OBACT || (ob->flag & SELECT)) {
- char col[4];
-
- active= 2;
- if(ob==OBACT) {
- BIF_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col);
- /* so black text is drawn when active and not selected */
- if (ob->flag & SELECT) active= 1;
- }
- else BIF_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col);
- col[3]= 100;
- glColor4ubv((GLubyte *)col);
- }
-
-#ifdef WITH_VERSE
- if(ob->vnode) {
- if (active==0) active=2;
- if (ob==OBACT)
- glColor4ub(0,255,0,100);
- else
- glColor4ub(0,128,0,100);
- }
-#endif
- }
- else if(G.obedit && G.obedit->data==tselem->id) {
- glColor4ub(255, 255, 255, 100);
- active= 2;
- }
- else {
- if(tree_element_active(soops, te, 0)) {
- glColor4ub(220, 220, 255, 100);
- active= 2;
- }
- }
- } else if (tselem->type==ID_SS) {
-#ifdef WITH_VERSE
- /* draw colored circle behind verse server icon */
- struct VerseServer *server = (VerseServer *)te->directdata;
- if(server->flag & VERSE_CONNECTING) {
- glColor4ub(255,128,64,100);
- active = 2;
- } else if(server->flag & VERSE_CONNECTED) {
- glColor4ub(0,128,0,100);
- active = 2;
- }
-#endif
- }
- else if (tselem->type==ID_VN) {
-#ifdef WITH_VERSE
- struct VNode *vnode = (VNode *)te->directdata;
- if(vnode->type==V_NT_OBJECT) {
- if(((VObjectData*)vnode->data)->object) {
- glColor4ub(0,128,0,100);
- active = 2;
- }
- }
- else if(vnode->type==V_NT_GEOMETRY) {
- if(((VGeomData*)vnode->data)->mesh || ((VGeomData*)vnode->data)->editmesh) {
- glColor4ub(0,128,0,100);
- active = 2;
- }
- }
- if(vnode->type==V_NT_BITMAP) {
- if(((VBitmapData*)vnode->data)->image) {
- glColor4ub(0,128,0,100);
- active = 2;
- }
- }
-#endif
- }
- else {
- if( tree_element_type_active(soops, te, tselem, 0) ) active= 2;
- glColor4ub(220, 220, 255, 100);
- }
-
- /* active circle */
- if(active) {
- uiSetRoundBox(15);
- uiRoundBox( (float)startx+OL_H-1.5f, (float)*starty+2.0f, (float)startx+2.0f*OL_H-4.0f, (float)*starty+OL_H-1.0f, OL_H/2.0f-2.0f);
- glEnable(GL_BLEND); /* roundbox disables it */
-
- te->flag |= TE_ACTIVE; // for lookup in display hierarchies
- }
-
- /* open/close icon, only when sublevels, except for scene */
- if(te->subtree.first || (tselem->type==0 && te->idcode==ID_SCE)) {
- int icon_x;
- if((tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE)) || ELEM4(te->idcode,ID_VN,ID_VS, ID_MS, ID_SS))
- icon_x = startx;
- else
- icon_x = startx+5;
-
- // icons a bit higher
- if(tselem->flag & TSE_CLOSED)
- BIF_icon_draw((float)icon_x, (float)*starty+2, ICON_TRIA_RIGHT);
- else
- BIF_icon_draw((float)icon_x, (float)*starty+2, ICON_TRIA_DOWN);
- }
- offsx+= OL_X;
-
- /* datatype icon */
-
- // icons a bit higher
- tselem_draw_icon((float)startx+offsx, (float)*starty+2, tselem, te);
- offsx+= OL_X;
-
- if(tselem->type==0 && tselem->id->lib) {
- glPixelTransferf(GL_ALPHA_SCALE, 0.5f);
- if(tselem->id->flag & LIB_INDIRECT)
- BIF_icon_draw((float)startx+offsx, (float)*starty+2, ICON_DATALIB);
- else
- BIF_icon_draw((float)startx+offsx, (float)*starty+2, ICON_PARLIB);
- glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
- offsx+= OL_X;
- }
- glDisable(GL_BLEND);
-
- /* name */
- if(active==1) BIF_ThemeColor(TH_TEXT_HI);
- else BIF_ThemeColor(TH_TEXT);
- glRasterPos2i(startx+offsx, *starty+5);
- BIF_RasterPos((float)startx+offsx, (float)*starty+5);
-#ifdef WITH_VERSE
- if(te->name) {
-#endif
- BIF_DrawString(G.font, te->name, 0);
- offsx+= (int)(OL_X + BIF_GetStringWidth(G.font, te->name, 0));
-#ifdef WITH_VERSE
- }
-#endif
-
- /* closed item, we draw the icons, not when it's a scene, or master-server list though */
- if(tselem->flag & TSE_CLOSED) {
- if(te->subtree.first) {
- if(tselem->type==0 && te->idcode==ID_SCE);
-#ifdef WITH_VERSE
- else if(tselem->type==ID_MS) {
- char server_buf[50];
- int nr_servers = 0;
- struct VerseServer *server = server_list.first;
- while (server) {
- nr_servers++;
- server = server->next;
- }
- sprintf(server_buf, "(%d server%s", nr_servers, nr_servers==1?")":"s)");
- glRasterPos2i(startx+offsx-10, *starty+5);
- BIF_RasterPos(startx+offsx-10, *starty+5);
- BIF_DrawString(G.font, server_buf, 0);
- offsx+= OL_X + BIF_GetStringWidth(G.font, server_buf, 0);
- }
-#endif
- else if(tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so dont draw */
- int tempx= startx+offsx;
- // divider
- BIF_ThemeColorShade(TH_BACK, -40);
- glRecti(tempx -10, *starty+4, tempx -8, *starty+OL_H-4);
-
- glEnable(GL_BLEND);
- glPixelTransferf(GL_ALPHA_SCALE, 0.5);
-
- outliner_draw_iconrow(soops, &te->subtree, 0, &tempx, *starty+2);
-
- glPixelTransferf(GL_ALPHA_SCALE, 1.0);
- glDisable(GL_BLEND);
- }
- }
- }
- }
- /* store coord and continue, we need coordinates for elements outside view too */
- te->xs= (float)startx;
- te->ys= (float)*starty;
- te->xend= startx+offsx;
-
- *starty-= OL_H;
-
- if((tselem->flag & TSE_CLOSED)==0) {
- for(ten= te->subtree.first; ten; ten= ten->next) {
- outliner_draw_tree_element(soops, ten, startx+OL_X, starty);
- }
- }
-}
-
-static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx, int *starty)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
- int y1, y2;
-
- if(lb->first==NULL) return;
-
- y1=y2= *starty; /* for vertical lines between objects */
- for(te=lb->first; te; te= te->next) {
- y2= *starty;
- tselem= TREESTORE(te);
-
- /* horizontal line? */
- if((tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE)) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS))
- glRecti(startx, *starty, startx+OL_X, *starty-1);
-
- *starty-= OL_H;
-
- if((tselem->flag & TSE_CLOSED)==0)
- outliner_draw_hierarchy(soops, &te->subtree, startx+OL_X, starty);
- }
-
- /* vertical line */
- te= lb->last;
- if(te->parent || lb->first!=lb->last) {
- tselem= TREESTORE(te);
- if((tselem->type==0 && te->idcode==ID_OB) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS)) {
-
- glRecti(startx, y1+OL_H, startx+1, y2);
- }
- }
-}
-
-static void outliner_draw_selection(SpaceOops *soops, ListBase *lb, int *starty)
-{
- TreeElement *te;
- TreeStoreElem *tselem;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
-
- /* selection status */
- if(tselem->flag & TSE_SELECTED) {
- glRecti(0, *starty+1, (int)soops->v2d.cur.xmax, *starty+OL_H-1);
- }
- *starty-= OL_H;
- if((tselem->flag & TSE_CLOSED)==0) outliner_draw_selection(soops, &te->subtree, starty);
- }
-}
-
-
-static void outliner_draw_tree(SpaceOops *soops)
-{
- TreeElement *te;
- int starty, startx;
- float col[4];
-
-#ifdef INTERNATIONAL
- FTF_SetFontSize('l');
- BIF_SetScale(1.0);
-#endif
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // only once
-
- // selection first
- BIF_GetThemeColor3fv(TH_BACK, col);
- glColor3f(col[0]+0.06f, col[1]+0.08f, col[2]+0.10f);
- starty= (int)soops->v2d.tot.ymax-OL_H;
- outliner_draw_selection(soops, &soops->tree, &starty);
-
- // grey hierarchy lines
- BIF_ThemeColorBlend(TH_BACK, TH_TEXT, 0.2f);
- starty= (int)soops->v2d.tot.ymax-OL_H/2;
- startx= 6;
- outliner_draw_hierarchy(soops, &soops->tree, startx, &starty);
-
- // items themselves
- starty= (int)soops->v2d.tot.ymax-OL_H;
- startx= 0;
- for(te= soops->tree.first; te; te= te->next) {
- outliner_draw_tree_element(soops, te, startx, &starty);
- }
-}
-
-
-static void outliner_back(SpaceOops *soops)
-{
- int ystart;
-
- BIF_ThemeColorShade(TH_BACK, 6);
- ystart= (int)soops->v2d.tot.ymax;
- ystart= OL_H*(ystart/(OL_H));
-
- while(ystart > soops->v2d.cur.ymin) {
- glRecti(0, ystart, (int)soops->v2d.cur.xmax, ystart+OL_H);
- ystart-= 2*OL_H;
- }
-}
-
-static void outliner_draw_restrictcols(SpaceOops *soops)
-{
- int ystart;
-
- /* background underneath */
- BIF_ThemeColor(TH_BACK);
- glRecti((int)soops->v2d.cur.xmax-OL_TOGW, (int)soops->v2d.cur.ymin, (int)soops->v2d.cur.xmax, (int)soops->v2d.cur.ymax);
-
- BIF_ThemeColorShade(TH_BACK, 6);
- ystart= (int)soops->v2d.tot.ymax;
- ystart= OL_H*(ystart/(OL_H));
-
- while(ystart > soops->v2d.cur.ymin) {
- glRecti((int)soops->v2d.cur.xmax-OL_TOGW, ystart, (int)soops->v2d.cur.xmax, ystart+OL_H);
- ystart-= 2*OL_H;
- }
-
- BIF_ThemeColorShadeAlpha(TH_BACK, -15, -200);
-
- /* view */
- fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX,
- soops->v2d.cur.ymax,
- soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX,
- soops->v2d.cur.ymin);
-
- /* render */
- fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX,
- soops->v2d.cur.ymax,
- soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX,
- soops->v2d.cur.ymin);
-
- /* render */
- fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX,
- soops->v2d.cur.ymax,
- soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX,
- soops->v2d.cur.ymin);
-}
-
-static void restrictbutton_view_cb(void *poin, void *poin2)
-{
- Base *base;
- Object *ob = (Object *)poin;
-
- /* deselect objects that are invisible */
- if (ob->restrictflag & OB_RESTRICT_VIEW) {
-
- /* Ouch! There is no backwards pointer from Object to Base,
- * so have to do loop to find it. */
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->object==ob) {
- base->flag &= ~SELECT;
- base->object->flag= base->flag;
- }
- }
- }
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void restrictbutton_sel_cb(void *poin, void *poin2)
-{
- Base *base;
- Object *ob = (Object *)poin;
-
- /* if select restriction has just been turned on */
- if (ob->restrictflag & OB_RESTRICT_SELECT) {
-
- /* Ouch! There is no backwards pointer from Object to Base,
- * so have to do loop to find it. */
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->object==ob) {
- base->flag &= ~SELECT;
- base->object->flag= base->flag;
- }
- }
- }
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void restrictbutton_rend_cb(void *poin, void *poin2)
-{
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void restrictbutton_r_lay_cb(void *poin, void *poin2)
-{
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSCENE, 0);
-}
-
-static void restrictbutton_modifier_cb(void *poin, void *poin2)
-{
- Object *ob = (Object *)poin;
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- object_handle_update(ob);
- countall();
-
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
-}
-
-static void restrictbutton_bone_cb(void *poin, void *poin2)
-{
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-static void namebutton_cb(void *tep, void *oldnamep)
-{
- SpaceOops *soops= curarea->spacedata.first;
- TreeStore *ts= soops->treestore;
- TreeElement *te= tep;
-
- if(ts && te) {
- TreeStoreElem *tselem= TREESTORE(te);
-
- if(tselem->type==0) {
- test_idbutton(tselem->id->name+2); // library.c, unique name and alpha sort
-
- /* Check the library target exists */
- if (te->idcode == ID_LI) {
- char expanded[FILE_MAXDIR + FILE_MAXFILE];
- BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE);
- BLI_convertstringcode(expanded, G.sce);
- if (!BLI_exists(expanded)) {
- error("This path does not exist, correct this before saving");
- }
- }
- }
- else {
- switch(tselem->type) {
- case TSE_DEFGROUP:
- unique_vertexgroup_name(te->directdata, (Object *)tselem->id); // id = object
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case TSE_NLA_ACTION:
- test_idbutton(tselem->id->name+2);
- break;
- case TSE_EBONE:
- if(G.obedit && G.obedit->data==(ID *)tselem->id) {
- EditBone *ebone= te->directdata;
- char newname[32];
-
- /* restore bone name */
- BLI_strncpy(newname, ebone->name, 32);
- BLI_strncpy(ebone->name, oldnamep, 32);
- armature_bone_rename(G.obedit->data, oldnamep, newname);
- }
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
-
- case TSE_BONE:
- {
- Bone *bone= te->directdata;
- Object *ob;
- char newname[32];
-
- // always make current object active
- tree_element_active_object(soops, te);
- ob= OBACT;
-
- /* restore bone name */
- BLI_strncpy(newname, bone->name, 32);
- BLI_strncpy(bone->name, oldnamep, 32);
- armature_bone_rename(ob->data, oldnamep, newname);
- }
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case TSE_POSE_CHANNEL:
- {
- bPoseChannel *pchan= te->directdata;
- Object *ob;
- char newname[32];
-
- // always make current object active
- tree_element_active_object(soops, te);
- ob= OBACT;
-
- /* restore bone name */
- BLI_strncpy(newname, pchan->name, 32);
- BLI_strncpy(pchan->name, oldnamep, 32);
- armature_bone_rename(ob->data, oldnamep, newname);
- }
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case TSE_POSEGRP:
- {
- Object *ob= (Object *)tselem->id; // id = object
- bActionGroup *grp= te->directdata;
-
- BLI_uniquename(&ob->pose->agroups, grp, "Group", offsetof(bActionGroup, name), 32);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- break;
- case TSE_R_LAYER:
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSSCENE, 0);
- break;
- }
- }
- }
- scrarea_queue_redraw(curarea);
-}
-
-static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBase *lb)
-{
- uiBut *bt;
- TreeElement *te;
- TreeStoreElem *tselem;
- Object *ob = NULL;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(te->ys >= soops->v2d.cur.ymin && te->ys <= soops->v2d.cur.ymax) {
- /* objects have toggle-able restriction flags */
- if(tselem->type==0 && te->idcode==ID_OB) {
- ob = (Object *)tselem->id;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
- uiButSetFunc(bt, restrictbutton_view_cb, ob, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
-
- bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_SELECT, REDRAWALL, ICON_RESTRICT_SELECT_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (short)te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
- uiButSetFunc(bt, restrictbutton_sel_cb, ob, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
-
- bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_RENDER, REDRAWALL, ICON_RESTRICT_RENDER_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (short)te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow renderability");
- uiButSetFunc(bt, restrictbutton_rend_cb, NULL, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- /* scene render layers and passes have toggle-able flags too! */
- else if(tselem->type==TSE_R_LAYER) {
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- bt= uiDefIconButBitI(block, ICONTOGN, SCE_LAY_DISABLE, REDRAWBUTSSCENE, ICON_CHECKBOX_HLT-1,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, te->directdata, 0, 0, 0, 0, "Render this RenderLayer");
- uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- else if(tselem->type==TSE_R_PASS) {
- int *layflag= te->directdata;
- uiBlockSetEmboss(block, UI_EMBOSSN);
-
- /* NOTE: tselem->nr is short! */
- bt= uiDefIconButBitI(block, ICONTOG, tselem->nr, REDRAWBUTSSCENE, ICON_CHECKBOX_HLT-1,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Render this Pass");
- uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL);
-
- layflag++; /* is lay_xor */
- if(ELEM6(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RADIO))
- bt= uiDefIconButBitI(block, TOG, tselem->nr, REDRAWBUTSSCENE, (*layflag & tselem->nr)?ICON_DOT:ICON_BLANK1,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (short)te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Exclude this Pass from Combined");
- uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL);
-
- uiBlockSetEmboss(block, UI_EMBOSS);
- }
- else if(tselem->type==TSE_MODIFIER) {
- ModifierData *md= (ModifierData *)te->directdata;
- ob = (Object *)tselem->id;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Realtime, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
- uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
-
- bt= uiDefIconButBitI(block, ICONTOGN, eModifierMode_Render, REDRAWALL, ICON_RESTRICT_RENDER_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (short)te->ys, 17, OL_H-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability");
- uiButSetFunc(bt, restrictbutton_modifier_cb, ob, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
- }
- else if(tselem->type==TSE_POSE_CHANNEL) {
- bPoseChannel *pchan= (bPoseChannel *)te->directdata;
- Bone *bone = pchan->bone;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_P, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
- uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
- }
- else if(tselem->type==TSE_EBONE) {
- EditBone *ebone= (EditBone *)te->directdata;
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_A, REDRAWALL, ICON_RESTRICT_VIEW_OFF,
- (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (short)te->ys, 17, OL_H-1, &(ebone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
- uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
- uiButSetFlag(bt, UI_NO_HILITE);
- }
- }
-
- if((tselem->flag & TSE_CLOSED)==0) outliner_draw_restrictbuts(block, soops, &te->subtree);
- }
-}
-
-static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb)
-{
- uiBut *bt;
- TreeElement *te;
- TreeStoreElem *tselem;
- int dx, len;
-
- for(te= lb->first; te; te= te->next) {
- tselem= TREESTORE(te);
- if(te->ys >= soops->v2d.cur.ymin && te->ys <= soops->v2d.cur.ymax) {
-
- if(tselem->flag & TSE_TEXTBUT) {
- /* If we add support to rename Sequence.
- * need change this.
- */
- if(tselem->type == TSE_POSE_BASE) continue; // prevent crash when trying to rename 'pose' entry of armature
-
- if(tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name);
- else if (tselem->type==TSE_MODIFIER) len = sizeof(((ModifierData*) 0)->name);
- else if(tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name);
- else len= sizeof(((ID*) 0)->name)-2;
-
- dx= (int)BIF_GetStringWidth(G.font, te->name, 0);
- if(dx<50) dx= 50;
-
- bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "", (short)te->xs+2*OL_X-4, (short)te->ys, dx+10, OL_H-1, te->name, 1.0, (float)len-1, 0, 0, "");
- uiButSetFunc(bt, namebutton_cb, te, NULL);
-
- // signal for button to open
- addqueue(curarea->win, BUT_ACTIVATE, OL_NAMEBUTTON);
-
- /* otherwise keeps open on ESC */
- tselem->flag &= ~TSE_TEXTBUT;
- }
- }
-
- if((tselem->flag & TSE_CLOSED)==0) outliner_buttons(block, soops, &te->subtree);
- }
-}
-
-void draw_outliner(ScrArea *sa, SpaceOops *soops)
-{
- uiBlock *block;
- int sizey, sizex;
- short ofsx, ofsy;
-
- /* version patch for old outliners here - do_versions patch doesn't work */
- if (G.v2d->scroll != L_SCROLL+B_SCROLLO) {
- init_v2d_oops(curarea, soops);
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy);
- }
- else
- calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy);
-
- if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
- if(G.v2d->scroll) {
- ofsx= sa->winrct.xmin; /* because mywin */
- ofsy= sa->winrct.ymin;
- glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
- }
- }
-
- outliner_build_tree(soops); // always
- sizey = sizex = 0;
- outliner_height(soops, &soops->tree, &sizey);
- outliner_width(soops, &soops->tree, &sizex);
-
- /* we init all tot rect vars, only really needed on window size change though */
- G.v2d->tot.xmin= 0.0f;
- G.v2d->tot.xmax= (float)(G.v2d->mask.xmax-G.v2d->mask.xmin);
- if(soops->flag & SO_HIDE_RESTRICTCOLS) {
- if(G.v2d->tot.xmax <= sizex)
- G.v2d->tot.xmax= (float)2*sizex;
- }
- else {
- if(G.v2d->tot.xmax-OL_TOGW <= sizex)
- G.v2d->tot.xmax= (float)2*sizex;
- }
- G.v2d->tot.ymax= 0.0f;
- G.v2d->tot.ymin= (float)-sizey*OL_H;
- test_view2d(G.v2d, sa->winx, sa->winy);
-
- // align on top window if cur bigger than tot
- if(G.v2d->cur.ymax-G.v2d->cur.ymin > sizey*OL_H) {
- G.v2d->cur.ymax= 0.0f;
- G.v2d->cur.ymin= (float)-(G.v2d->mask.ymax-G.v2d->mask.ymin);
- }
-
- myortho2(G.v2d->cur.xmin-0.375f, G.v2d->cur.xmax-0.375f, G.v2d->cur.ymin-0.375f, G.v2d->cur.ymax-0.375f);
-
- /* draw outliner stuff (background and hierachy lines) */
- outliner_back(soops);
- outliner_draw_tree(soops);
-
- /* restore viewport */
- mywinset(sa->win);
-
- /* ortho corrected - 'pixel space' */
- myortho2(G.v2d->cur.xmin-SCROLLB-0.375f, G.v2d->cur.xmax-0.375f, G.v2d->cur.ymin-SCROLLH-0.375f, G.v2d->cur.ymax-0.375f);
-
- /* draw icons and names */
- block= uiNewBlock(&sa->uiblocks, "outliner buttons", UI_EMBOSS, UI_HELV, sa->win);
- outliner_buttons(block, soops, &soops->tree);
-
- /* draw restriction columns */
- if (!(soops->flag & SO_HIDE_RESTRICTCOLS)) {
- outliner_draw_restrictcols(soops);
- outliner_draw_restrictbuts(block, soops, &soops->tree);
- }
-
- uiDrawBlock(block);
-
- /* clear flag that allows quick redraws */
- soops->storeflag &= ~SO_TREESTORE_REDRAW;
-
- /* drawoopsspace handles sliders */
-}
diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c
deleted file mode 100644
index 1cf796d86bc..00000000000
--- a/source/blender/src/parametrizer.c
+++ /dev/null
@@ -1,4295 +0,0 @@
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_memarena.h"
-#include "BLI_arithb.h"
-#include "BLI_rand.h"
-#include "BLI_heap.h"
-#include "BLI_boxpack2d.h"
-
-#include "BKE_utildefines.h"
-
-#include "BIF_editsima.h"
-#include "BIF_toolbox.h"
-
-#include "ONL_opennl.h"
-
-#include "parametrizer.h"
-#include "parametrizer_intern.h"
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-#if defined(_WIN32)
-#define M_PI 3.14159265358979323846
-#endif
-
-/* PHash
- - special purpose hash that keeps all its elements in a single linked list.
- - after construction, this hash is thrown away, and the list remains.
- - removing elements is not possible efficiently.
-*/
-
-static int PHashSizes[] = {
- 1, 3, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209,
- 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169,
- 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459
-};
-
-#define PHASH_hash(ph, item) (((uintptr_t) (item))%((unsigned int) (ph)->cursize))
-#define PHASH_edge(v1, v2) ((v1)^(v2))
-
-static PHash *phash_new(PHashLink **list, int sizehint)
-{
- PHash *ph = (PHash*)MEM_callocN(sizeof(PHash), "PHash");
- ph->size = 0;
- ph->cursize_id = 0;
- ph->list = list;
-
- while (PHashSizes[ph->cursize_id] < sizehint)
- ph->cursize_id++;
-
- ph->cursize = PHashSizes[ph->cursize_id];
- ph->buckets = (PHashLink**)MEM_callocN(ph->cursize*sizeof(*ph->buckets), "PHashBuckets");
-
- return ph;
-}
-
-static void phash_delete(PHash *ph)
-{
- MEM_freeN(ph->buckets);
- MEM_freeN(ph);
-}
-
-static int phash_size(PHash *ph)
-{
- return ph->size;
-}
-
-static void phash_insert(PHash *ph, PHashLink *link)
-{
- int size = ph->cursize;
- int hash = PHASH_hash(ph, link->key);
- PHashLink *lookup = ph->buckets[hash];
-
- if (lookup == NULL) {
- /* insert in front of the list */
- ph->buckets[hash] = link;
- link->next = *(ph->list);
- *(ph->list) = link;
- }
- else {
- /* insert after existing element */
- link->next = lookup->next;
- lookup->next = link;
- }
-
- ph->size++;
-
- if (ph->size > (size*3)) {
- PHashLink *next = NULL, *first = *(ph->list);
-
- ph->cursize = PHashSizes[++ph->cursize_id];
- MEM_freeN(ph->buckets);
- ph->buckets = (PHashLink**)MEM_callocN(ph->cursize*sizeof(*ph->buckets), "PHashBuckets");
- ph->size = 0;
- *(ph->list) = NULL;
-
- for (link = first; link; link = next) {
- next = link->next;
- phash_insert(ph, link);
- }
- }
-}
-
-static PHashLink *phash_lookup(PHash *ph, PHashKey key)
-{
- PHashLink *link;
- int hash = PHASH_hash(ph, key);
-
- for (link = ph->buckets[hash]; link; link = link->next)
- if (link->key == key)
- return link;
- else if (PHASH_hash(ph, link->key) != hash)
- return NULL;
-
- return link;
-}
-
-static PHashLink *phash_next(PHash *ph, PHashKey key, PHashLink *link)
-{
- int hash = PHASH_hash(ph, key);
-
- for (link = link->next; link; link = link->next)
- if (link->key == key)
- return link;
- else if (PHASH_hash(ph, link->key) != hash)
- return NULL;
-
- return link;
-}
-
-/* Geometry */
-
-static float p_vec_angle_cos(float *v1, float *v2, float *v3)
-{
- float d1[3], d2[3];
-
- d1[0] = v1[0] - v2[0];
- d1[1] = v1[1] - v2[1];
- d1[2] = v1[2] - v2[2];
-
- d2[0] = v3[0] - v2[0];
- d2[1] = v3[1] - v2[1];
- d2[2] = v3[2] - v2[2];
-
- Normalize(d1);
- Normalize(d2);
-
- return d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2];
-}
-
-static float p_vec_angle(float *v1, float *v2, float *v3)
-{
- float dot = p_vec_angle_cos(v1, v2, v3);
-
- if (dot <= -1.0f)
- return (float)M_PI;
- else if (dot >= 1.0f)
- return 0.0f;
- else
- return (float)acos(dot);
-}
-
-static float p_vec2_angle(float *v1, float *v2, float *v3)
-{
- float u1[3], u2[3], u3[3];
-
- u1[0] = v1[0]; u1[1] = v1[1]; u1[2] = 0.0f;
- u2[0] = v2[0]; u2[1] = v2[1]; u2[2] = 0.0f;
- u3[0] = v3[0]; u3[1] = v3[1]; u3[2] = 0.0f;
-
- return p_vec_angle(u1, u2, u3);
-}
-
-static void p_triangle_angles(float *v1, float *v2, float *v3, float *a1, float *a2, float *a3)
-{
- *a1 = p_vec_angle(v3, v1, v2);
- *a2 = p_vec_angle(v1, v2, v3);
- *a3 = M_PI - *a2 - *a1;
-}
-
-static void p_face_angles(PFace *f, float *a1, float *a2, float *a3)
-{
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- p_triangle_angles(v1->co, v2->co, v3->co, a1, a2, a3);
-}
-
-static float p_face_area(PFace *f)
-{
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- return AreaT3Dfl(v1->co, v2->co, v3->co);
-}
-
-static float p_area_signed(float *v1, float *v2, float *v3)
-{
- return 0.5f*(((v2[0] - v1[0])*(v3[1] - v1[1])) -
- ((v3[0] - v1[0])*(v2[1] - v1[1])));
-}
-
-static float p_face_uv_area_signed(PFace *f)
-{
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- return 0.5f*(((v2->uv[0] - v1->uv[0])*(v3->uv[1] - v1->uv[1])) -
- ((v3->uv[0] - v1->uv[0])*(v2->uv[1] - v1->uv[1])));
-}
-
-static float p_edge_length(PEdge *e)
-{
- PVert *v1 = e->vert, *v2 = e->next->vert;
- float d[3];
-
- d[0] = v2->co[0] - v1->co[0];
- d[1] = v2->co[1] - v1->co[1];
- d[2] = v2->co[2] - v1->co[2];
-
- return sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]);
-}
-
-static float p_edge_uv_length(PEdge *e)
-{
- PVert *v1 = e->vert, *v2 = e->next->vert;
- float d[3];
-
- d[0] = v2->uv[0] - v1->uv[0];
- d[1] = v2->uv[1] - v1->uv[1];
-
- return sqrt(d[0]*d[0] + d[1]*d[1]);
-}
-
-static void p_chart_uv_bbox(PChart *chart, float *minv, float *maxv)
-{
- PVert *v;
-
- INIT_MINMAX2(minv, maxv);
-
- for (v=chart->verts; v; v=v->nextlink) {
- DO_MINMAX2(v->uv, minv, maxv);
- }
-}
-
-static void p_chart_uv_scale(PChart *chart, float scale)
-{
- PVert *v;
-
- for (v=chart->verts; v; v=v->nextlink) {
- v->uv[0] *= scale;
- v->uv[1] *= scale;
- }
-}
-
-static void p_chart_uv_scale_xy(PChart *chart, float x, float y)
-{
- PVert *v;
-
- for (v=chart->verts; v; v=v->nextlink) {
- v->uv[0] *= x;
- v->uv[1] *= y;
- }
-}
-
-static void p_chart_uv_translate(PChart *chart, float trans[2])
-{
- PVert *v;
-
- for (v=chart->verts; v; v=v->nextlink) {
- v->uv[0] += trans[0];
- v->uv[1] += trans[1];
- }
-}
-
-static PBool p_intersect_line_2d_dir(float *v1, float *dir1, float *v2, float *dir2, float *isect)
-{
- float lmbda, div;
-
- div= dir2[0]*dir1[1] - dir2[1]*dir1[0];
-
- if (div == 0.0f)
- return P_FALSE;
-
- lmbda= ((v1[1]-v2[1])*dir1[0]-(v1[0]-v2[0])*dir1[1])/div;
- isect[0] = v1[0] + lmbda*dir2[0];
- isect[1] = v1[1] + lmbda*dir2[1];
-
- return P_TRUE;
-}
-
-#if 0
-static PBool p_intersect_line_2d(float *v1, float *v2, float *v3, float *v4, float *isect)
-{
- float dir1[2], dir2[2];
-
- dir1[0] = v4[0] - v3[0];
- dir1[1] = v4[1] - v3[1];
-
- dir2[0] = v2[0] - v1[0];
- dir2[1] = v2[1] - v1[1];
-
- if (!p_intersect_line_2d_dir(v1, dir1, v2, dir2, isect)) {
- /* parallel - should never happen in theory for polygon kernel, but
- let's give a point nearby in case things go wrong */
- isect[0] = (v1[0] + v2[0])*0.5f;
- isect[1] = (v1[1] + v2[1])*0.5f;
- return P_FALSE;
- }
-
- return P_TRUE;
-}
-#endif
-
-/* Topological Utilities */
-
-static PEdge *p_wheel_edge_next(PEdge *e)
-{
- return e->next->next->pair;
-}
-
-static PEdge *p_wheel_edge_prev(PEdge *e)
-{
- return (e->pair)? e->pair->next: NULL;
-}
-
-static PEdge *p_boundary_edge_next(PEdge *e)
-{
- return e->next->vert->edge;
-}
-
-static PEdge *p_boundary_edge_prev(PEdge *e)
-{
- PEdge *we = e, *last;
-
- do {
- last = we;
- we = p_wheel_edge_next(we);
- } while (we && (we != e));
-
- return last->next->next;
-}
-
-static PBool p_vert_interior(PVert *v)
-{
- return (v->edge->pair != NULL);
-}
-
-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;
-
- e1->vert = v2;
- e1->next = e3;
- e1->flag = (f1 & ~PEDGE_VERTEX_FLAGS) | (f2 & PEDGE_VERTEX_FLAGS);
-
- e2->vert = v3;
- e2->next = e1;
- e2->flag = (f2 & ~PEDGE_VERTEX_FLAGS) | (f3 & PEDGE_VERTEX_FLAGS);
-
- e3->vert = v1;
- e3->next = e2;
- e3->flag = (f3 & ~PEDGE_VERTEX_FLAGS) | (f1 & PEDGE_VERTEX_FLAGS);
-}
-
-#if 0
-static void p_chart_topological_sanity_check(PChart *chart)
-{
- PVert *v;
- PEdge *e;
-
- for (v=chart->verts; v; v=v->nextlink)
- param_test_equals_ptr("v->edge->vert", v, v->edge->vert);
-
- for (e=chart->edges; e; e=e->nextlink) {
- if (e->pair) {
- param_test_equals_ptr("e->pair->pair", e, e->pair->pair);
- param_test_equals_ptr("pair->vert", e->vert, e->pair->next->vert);
- param_test_equals_ptr("pair->next->vert", e->next->vert, e->pair->vert);
- }
- }
-}
-#endif
-
-/* Loading / Flushing */
-
-static void p_vert_load_pin_select_uvs(PHandle *handle, PVert *v)
-{
- PEdge *e;
- int nedges = 0, npins = 0;
- float pinuv[2];
-
- v->uv[0] = v->uv[1] = 0.0f;
- pinuv[0] = pinuv[1] = 0.0f;
- e = v->edge;
- do {
- if (e->orig_uv) {
- if (e->flag & PEDGE_SELECT)
- v->flag |= PVERT_SELECT;
-
- if (e->flag & PEDGE_PIN) {
- pinuv[0] += e->orig_uv[0]*handle->aspx;
- pinuv[1] += e->orig_uv[1]*handle->aspy;
- npins++;
- }
- else {
- v->uv[0] += e->orig_uv[0]*handle->aspx;
- v->uv[1] += e->orig_uv[1]*handle->aspy;
- }
-
- nedges++;
- }
-
- e = p_wheel_edge_next(e);
- } while (e && e != (v->edge));
-
- if (npins > 0) {
- v->uv[0] = pinuv[0]/npins;
- v->uv[1] = pinuv[1]/npins;
- v->flag |= PVERT_PIN;
- }
- else if (nedges > 0) {
- v->uv[0] /= nedges;
- v->uv[1] /= nedges;
- }
-}
-
-static void p_flush_uvs(PHandle *handle, PChart *chart)
-{
- PEdge *e;
-
- for (e=chart->edges; e; e=e->nextlink) {
- if (e->orig_uv) {
- e->orig_uv[0] = e->vert->uv[0]/handle->aspx;
- e->orig_uv[1] = e->vert->uv[1]/handle->aspy;
- }
- }
-}
-
-static void p_flush_uvs_blend(PHandle *handle, PChart *chart, float blend)
-{
- PEdge *e;
- float invblend = 1.0f - blend;
-
- for (e=chart->edges; e; e=e->nextlink) {
- if (e->orig_uv) {
- e->orig_uv[0] = blend*e->old_uv[0] + invblend*e->vert->uv[0]/handle->aspx;
- e->orig_uv[1] = blend*e->old_uv[1] + invblend*e->vert->uv[1]/handle->aspy;
- }
- }
-}
-
-static void p_face_backup_uvs(PFace *f)
-{
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
-
- if (e1->orig_uv && e2->orig_uv && e3->orig_uv) {
- e1->old_uv[0] = e1->orig_uv[0];
- e1->old_uv[1] = e1->orig_uv[1];
- e2->old_uv[0] = e2->orig_uv[0];
- e2->old_uv[1] = e2->orig_uv[1];
- e3->old_uv[0] = e3->orig_uv[0];
- e3->old_uv[1] = e3->orig_uv[1];
- }
-}
-
-static void p_face_restore_uvs(PFace *f)
-{
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
-
- if (e1->orig_uv && e2->orig_uv && e3->orig_uv) {
- e1->orig_uv[0] = e1->old_uv[0];
- e1->orig_uv[1] = e1->old_uv[1];
- e2->orig_uv[0] = e2->old_uv[0];
- e2->orig_uv[1] = e2->old_uv[1];
- e3->orig_uv[0] = e3->old_uv[0];
- e3->orig_uv[1] = e3->old_uv[1];
- }
-}
-
-/* Construction (use only during construction, relies on u.key being set */
-
-static PVert *p_vert_add(PHandle *handle, PHashKey key, float *co, PEdge *e)
-{
- PVert *v = (PVert*)BLI_memarena_alloc(handle->arena, sizeof *v);
- v->co = co;
- v->u.key = key;
- v->edge = e;
- v->flag = 0;
-
- phash_insert(handle->hash_verts, (PHashLink*)v);
-
- return v;
-}
-
-static PVert *p_vert_lookup(PHandle *handle, PHashKey key, float *co, PEdge *e)
-{
- PVert *v = (PVert*)phash_lookup(handle->hash_verts, key);
-
- if (v)
- return v;
- else
- return p_vert_add(handle, key, co, e);
-}
-
-static PVert *p_vert_copy(PChart *chart, PVert *v)
-{
- PVert *nv = (PVert*)BLI_memarena_alloc(chart->handle->arena, sizeof *nv);
-
- nv->co = v->co;
- nv->uv[0] = v->uv[0];
- nv->uv[1] = v->uv[1];
- nv->u.key = v->u.key;
- nv->edge = v->edge;
- nv->flag = v->flag;
-
- return nv;
-}
-
-static PEdge *p_edge_lookup(PHandle *handle, PHashKey *vkeys)
-{
- PHashKey key = PHASH_edge(vkeys[0], vkeys[1]);
- PEdge *e = (PEdge*)phash_lookup(handle->hash_edges, key);
-
- while (e) {
- if ((e->vert->u.key == vkeys[0]) && (e->next->vert->u.key == vkeys[1]))
- return e;
- else if ((e->vert->u.key == vkeys[1]) && (e->next->vert->u.key == vkeys[0]))
- return e;
-
- e = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)e);
- }
-
- return NULL;
-}
-
-static PBool p_face_exists(PHandle *handle, PHashKey *vkeys, int i1, int i2, int i3)
-{
- PHashKey key = PHASH_edge(vkeys[i1], vkeys[i2]);
- PEdge *e = (PEdge*)phash_lookup(handle->hash_edges, key);
-
- while (e) {
- if ((e->vert->u.key == vkeys[i1]) && (e->next->vert->u.key == vkeys[i2])) {
- if (e->next->next->vert->u.key == vkeys[i3])
- return P_TRUE;
- }
- else if ((e->vert->u.key == vkeys[i2]) && (e->next->vert->u.key == vkeys[i1])) {
- if (e->next->next->vert->u.key == vkeys[i3])
- return P_TRUE;
- }
-
- e = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)e);
- }
-
- return P_FALSE;
-}
-
-static PChart *p_chart_new(PHandle *handle)
-{
- PChart *chart = (PChart*)MEM_callocN(sizeof*chart, "PChart");
- chart->handle = handle;
-
- return chart;
-}
-
-static void p_chart_delete(PChart *chart)
-{
- /* the actual links are free by memarena */
- MEM_freeN(chart);
-}
-
-static PBool p_edge_implicit_seam(PEdge *e, PEdge *ep)
-{
- float *uv1, *uv2, *uvp1, *uvp2;
- float limit[2];
-
- limit[0] = 0.00001;
- limit[1] = 0.00001;
-
- uv1 = e->orig_uv;
- uv2 = e->next->orig_uv;
-
- if (e->vert->u.key == ep->vert->u.key) {
- uvp1 = ep->orig_uv;
- uvp2 = ep->next->orig_uv;
- }
- else {
- uvp1 = ep->next->orig_uv;
- uvp2 = ep->orig_uv;
- }
-
- if((fabs(uv1[0]-uvp1[0]) > limit[0]) || (fabs(uv1[1]-uvp1[1]) > limit[1])) {
- e->flag |= PEDGE_SEAM;
- ep->flag |= PEDGE_SEAM;
- return P_TRUE;
- }
- if((fabs(uv2[0]-uvp2[0]) > limit[0]) || (fabs(uv2[1]-uvp2[1]) > limit[1])) {
- e->flag |= PEDGE_SEAM;
- ep->flag |= PEDGE_SEAM;
- return P_TRUE;
- }
-
- return P_FALSE;
-}
-
-static PBool p_edge_has_pair(PHandle *handle, PEdge *e, PEdge **pair, PBool impl)
-{
- PHashKey key;
- PEdge *pe;
- PVert *v1, *v2;
- PHashKey key1 = e->vert->u.key;
- PHashKey key2 = e->next->vert->u.key;
-
- if (e->flag & PEDGE_SEAM)
- return P_FALSE;
-
- key = PHASH_edge(key1, key2);
- pe = (PEdge*)phash_lookup(handle->hash_edges, key);
- *pair = NULL;
-
- while (pe) {
- if (pe != e) {
- v1 = pe->vert;
- v2 = pe->next->vert;
-
- if (((v1->u.key == key1) && (v2->u.key == key2)) ||
- ((v1->u.key == key2) && (v2->u.key == key1))) {
-
- /* don't connect seams and t-junctions */
- if ((pe->flag & PEDGE_SEAM) || *pair ||
- (impl && p_edge_implicit_seam(e, pe))) {
- *pair = NULL;
- return P_FALSE;
- }
-
- *pair = pe;
- }
- }
-
- pe = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)pe);
- }
-
- if (*pair && (e->vert == (*pair)->vert)) {
- if ((*pair)->next->pair || (*pair)->next->next->pair) {
- /* non unfoldable, maybe mobius ring or klein bottle */
- *pair = NULL;
- return P_FALSE;
- }
- }
-
- return (*pair != NULL);
-}
-
-static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PEdge ***stack, PBool impl)
-{
- PEdge *pair = NULL;
-
- if(!e->pair && p_edge_has_pair(handle, e, &pair, impl)) {
- if (e->vert == pair->vert)
- p_face_flip(pair->face);
-
- e->pair = pair;
- pair->pair = e;
-
- if (!(pair->face->flag & PFACE_CONNECTED)) {
- **stack = pair;
- (*stack)++;
- }
- }
-
- return (e->pair != NULL);
-}
-
-static int p_connect_pairs(PHandle *handle, PBool impl)
-{
- PEdge **stackbase = MEM_mallocN(sizeof*stackbase*phash_size(handle->hash_faces), "Pstackbase");
- PEdge **stack = stackbase;
- PFace *f, *first;
- PEdge *e, *e1, *e2;
- PChart *chart = handle->construction_chart;
- int ncharts = 0;
-
- /* connect pairs, count edges, set vertex-edge pointer to a pairless edge */
- for (first=chart->faces; first; first=first->nextlink) {
- if (first->flag & PFACE_CONNECTED)
- continue;
-
- *stack = first->edge;
- stack++;
-
- while (stack != stackbase) {
- stack--;
- e = *stack;
- e1 = e->next;
- e2 = e1->next;
-
- f = e->face;
- f->flag |= PFACE_CONNECTED;
-
- /* assign verts to charts so we can sort them later */
- f->u.chart = ncharts;
-
- if (!p_edge_connect_pair(handle, e, &stack, impl))
- e->vert->edge = e;
- if (!p_edge_connect_pair(handle, e1, &stack, impl))
- e1->vert->edge = e1;
- if (!p_edge_connect_pair(handle, e2, &stack, impl))
- e2->vert->edge = e2;
- }
-
- ncharts++;
- }
-
- MEM_freeN(stackbase);
-
- return ncharts;
-}
-
-static void p_split_vert(PChart *chart, PEdge *e)
-{
- PEdge *we, *lastwe = NULL;
- PVert *v = e->vert;
- PBool copy = P_TRUE;
-
- if (e->flag & PEDGE_VERTEX_SPLIT)
- return;
-
- /* rewind to start */
- lastwe = e;
- for (we = p_wheel_edge_prev(e); we && (we != e); we = p_wheel_edge_prev(we))
- lastwe = we;
-
- /* go over all edges in wheel */
- for (we = lastwe; we; we = p_wheel_edge_next(we)) {
- if (we->flag & PEDGE_VERTEX_SPLIT)
- break;
-
- we->flag |= PEDGE_VERTEX_SPLIT;
-
- if (we == v->edge) {
- /* found it, no need to copy */
- copy = P_FALSE;
- v->nextlink = chart->verts;
- chart->verts = v;
- chart->nverts++;
- }
- }
-
- if (copy) {
- /* not found, copying */
- v->flag |= PVERT_SPLIT;
- v = p_vert_copy(chart, v);
- v->flag |= PVERT_SPLIT;
-
- v->nextlink = chart->verts;
- chart->verts = v;
- chart->nverts++;
-
- v->edge = lastwe;
-
- we = lastwe;
- do {
- we->vert = v;
- we = p_wheel_edge_next(we);
- } while (we && (we != lastwe));
- }
-}
-
-static PChart **p_split_charts(PHandle *handle, PChart *chart, int ncharts)
-{
- PChart **charts = MEM_mallocN(sizeof*charts * ncharts, "PCharts"), *nchart;
- PFace *f, *nextf;
- int i;
-
- for (i = 0; i < ncharts; i++)
- charts[i] = p_chart_new(handle);
-
- f = chart->faces;
- while (f) {
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- nextf = f->nextlink;
-
- nchart = charts[f->u.chart];
-
- f->nextlink = nchart->faces;
- nchart->faces = f;
- e1->nextlink = nchart->edges;
- nchart->edges = e1;
- e2->nextlink = nchart->edges;
- nchart->edges = e2;
- e3->nextlink = nchart->edges;
- nchart->edges = e3;
-
- nchart->nfaces++;
- nchart->nedges += 3;
-
- p_split_vert(nchart, e1);
- p_split_vert(nchart, e2);
- p_split_vert(nchart, e3);
-
- f = nextf;
- }
-
- return charts;
-}
-
-static PFace *p_face_add(PHandle *handle)
-{
- PFace *f;
- PEdge *e1, *e2, *e3;
-
- /* allocate */
- f = (PFace*)BLI_memarena_alloc(handle->arena, sizeof *f);
- f->flag=0; // init !
-
- e1 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e1);
- e2 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e2);
- e3 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e3);
-
- /* set up edges */
- f->edge = e1;
- e1->face = e2->face = e3->face = f;
-
- e1->next = e2;
- e2->next = e3;
- e3->next = e1;
-
- e1->pair = NULL;
- e2->pair = NULL;
- e3->pair = NULL;
-
- e1->flag =0;
- e2->flag =0;
- e3->flag =0;
-
- return f;
-}
-
-static PFace *p_face_add_construct(PHandle *handle, ParamKey key, ParamKey *vkeys,
- float *co[3], float *uv[3], int i1, int i2, int i3,
- ParamBool *pin, ParamBool *select)
-{
- PFace *f = p_face_add(handle);
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
-
- e1->vert = p_vert_lookup(handle, vkeys[i1], co[i1], e1);
- e2->vert = p_vert_lookup(handle, vkeys[i2], co[i2], e2);
- e3->vert = p_vert_lookup(handle, vkeys[i3], co[i3], e3);
-
- e1->orig_uv = uv[i1];
- e2->orig_uv = uv[i2];
- e3->orig_uv = uv[i3];
-
- if (pin) {
- if (pin[i1]) e1->flag |= PEDGE_PIN;
- if (pin[i2]) e2->flag |= PEDGE_PIN;
- if (pin[i3]) e3->flag |= PEDGE_PIN;
- }
-
- if (select) {
- if (select[i1]) e1->flag |= PEDGE_SELECT;
- if (select[i2]) e2->flag |= PEDGE_SELECT;
- if (select[i3]) e3->flag |= PEDGE_SELECT;
- }
-
- /* insert into hash */
- f->u.key = key;
- phash_insert(handle->hash_faces, (PHashLink*)f);
-
- e1->u.key = PHASH_edge(vkeys[i1], vkeys[i2]);
- e2->u.key = PHASH_edge(vkeys[i2], vkeys[i3]);
- e3->u.key = PHASH_edge(vkeys[i3], vkeys[i1]);
-
- phash_insert(handle->hash_edges, (PHashLink*)e1);
- phash_insert(handle->hash_edges, (PHashLink*)e2);
- phash_insert(handle->hash_edges, (PHashLink*)e3);
-
- return f;
-}
-
-static PFace *p_face_add_fill(PChart *chart, PVert *v1, PVert *v2, PVert *v3)
-{
- PFace *f = p_face_add(chart->handle);
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
-
- e1->vert = v1;
- e2->vert = v2;
- e3->vert = v3;
-
- e1->orig_uv = e2->orig_uv = e3->orig_uv = NULL;
-
- f->nextlink = chart->faces;
- chart->faces = f;
- e1->nextlink = chart->edges;
- chart->edges = e1;
- e2->nextlink = chart->edges;
- chart->edges = e2;
- e3->nextlink = chart->edges;
- chart->edges = e3;
-
- chart->nfaces++;
- chart->nedges += 3;
-
- return f;
-}
-
-static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys)
-{
- float fac= VecLenf(co[0], co[2]) - VecLenf(co[1], co[3]);
- PBool dir = (fac <= 0.0f);
-
- /* the face exists check is there because of a special case: when
- two quads share three vertices, they can each be split into two
- triangles, resulting in two identical triangles. for example in
- suzanne's nose. */
- if (dir) {
- if (p_face_exists(handle,vkeys,0,1,2) || p_face_exists(handle,vkeys,0,2,3))
- return !dir;
- }
- else {
- if (p_face_exists(handle,vkeys,0,1,3) || p_face_exists(handle,vkeys,1,2,3))
- return !dir;
- }
-
- return dir;
-}
-
-/* Construction: boundary filling */
-
-static void p_chart_boundaries(PChart *chart, int *nboundaries, PEdge **outer)
-{
- PEdge *e, *be;
- float len, maxlen = -1.0;
-
- if (nboundaries)
- *nboundaries = 0;
- if (outer)
- *outer = NULL;
-
- for (e=chart->edges; e; e=e->nextlink) {
- if (e->pair || (e->flag & PEDGE_DONE))
- continue;
-
- if (nboundaries)
- (*nboundaries)++;
-
- len = 0.0f;
-
- be = e;
- do {
- be->flag |= PEDGE_DONE;
- len += p_edge_length(be);
- be = be->next->vert->edge;
- } while(be != e);
-
- if (outer && (len > maxlen)) {
- *outer = e;
- maxlen = len;
- }
- }
-
- for (e=chart->edges; e; e=e->nextlink)
- e->flag &= ~PEDGE_DONE;
-}
-
-static float p_edge_boundary_angle(PEdge *e)
-{
- PEdge *we;
- PVert *v, *v1, *v2;
- float angle;
- int n = 0;
-
- v = e->vert;
-
- /* concave angle check -- could be better */
- angle = M_PI;
-
- we = v->edge;
- do {
- v1 = we->next->vert;
- v2 = we->next->next->vert;
- angle -= p_vec_angle(v1->co, v->co, v2->co);
-
- we = we->next->next->pair;
- n++;
- } while (we && (we != v->edge));
-
- return angle;
-}
-
-static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges)
-{
- PEdge *e, *e1, *e2;
-
- PFace *f;
- struct Heap *heap = BLI_heap_new();
- float angle;
-
- e = be;
- do {
- angle = p_edge_boundary_angle(e);
- e->u.heaplink = BLI_heap_insert(heap, angle, e);
-
- e = p_boundary_edge_next(e);
- } while(e != be);
-
- if (nedges == 2) {
- /* no real boundary, but an isolated seam */
- e = be->next->vert->edge;
- e->pair = be;
- be->pair = e;
-
- BLI_heap_remove(heap, e->u.heaplink);
- BLI_heap_remove(heap, be->u.heaplink);
- }
- else {
- while (nedges > 2) {
- PEdge *ne, *ne1, *ne2;
-
- e = (PEdge*)BLI_heap_popmin(heap);
-
- e1 = p_boundary_edge_prev(e);
- e2 = p_boundary_edge_next(e);
-
- BLI_heap_remove(heap, e1->u.heaplink);
- BLI_heap_remove(heap, e2->u.heaplink);
- e->u.heaplink = e1->u.heaplink = e2->u.heaplink = NULL;
-
- e->flag |= PEDGE_FILLED;
- e1->flag |= PEDGE_FILLED;
-
-
-
-
-
- f = p_face_add_fill(chart, e->vert, e1->vert, e2->vert);
- f->flag |= PFACE_FILLED;
-
- ne = f->edge->next->next;
- ne1 = f->edge;
- ne2 = f->edge->next;
-
- ne->flag = ne1->flag = ne2->flag = PEDGE_FILLED;
-
- e->pair = ne;
- ne->pair = e;
- e1->pair = ne1;
- ne1->pair = e1;
-
- ne->vert = e2->vert;
- ne1->vert = e->vert;
- ne2->vert = e1->vert;
-
- if (nedges == 3) {
- e2->pair = ne2;
- ne2->pair = e2;
- }
- else {
- ne2->vert->edge = ne2;
-
- ne2->u.heaplink = BLI_heap_insert(heap, p_edge_boundary_angle(ne2), ne2);
- e2->u.heaplink = BLI_heap_insert(heap, p_edge_boundary_angle(e2), e2);
- }
-
- nedges--;
- }
- }
-
- BLI_heap_free(heap, NULL);
-}
-
-static void p_chart_fill_boundaries(PChart *chart, PEdge *outer)
-{
- PEdge *e, *be; /* *enext - as yet unused */
- int nedges;
-
- for (e=chart->edges; e; e=e->nextlink) {
- /* enext = e->nextlink; - as yet unused */
-
- if (e->pair || (e->flag & PEDGE_FILLED))
- continue;
-
- nedges = 0;
- be = e;
- do {
- be->flag |= PEDGE_FILLED;
- be = be->next->vert->edge;
- nedges++;
- } while(be != e);
-
- if (e != outer)
- p_chart_fill_boundary(chart, e, nedges);
- }
-}
-
-#if 0
-/* Polygon kernel for inserting uv's non overlapping */
-
-static int p_polygon_point_in(float *cp1, float *cp2, float *p)
-{
- if ((cp1[0] == p[0]) && (cp1[1] == p[1]))
- return 2;
- else if ((cp2[0] == p[0]) && (cp2[1] == p[1]))
- return 3;
- else
- return (p_area_signed(cp1, cp2, p) >= 0.0f);
-}
-
-static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float (*newpoints)[2], int *nnewpoints, float *cp1, float *cp2)
-{
- float *p2, *p1, isect[2];
- int i, p2in, p1in;
-
- p1 = oldpoints[noldpoints-1];
- p1in = p_polygon_point_in(cp1, cp2, p1);
- *nnewpoints = 0;
-
- for (i = 0; i < noldpoints; i++) {
- p2 = oldpoints[i];
- p2in = p_polygon_point_in(cp1, cp2, p2);
-
- if ((p2in >= 2) || (p1in && p2in)) {
- newpoints[*nnewpoints][0] = p2[0];
- newpoints[*nnewpoints][1] = p2[1];
- (*nnewpoints)++;
- }
- else if (p1in && !p2in) {
- if (p1in != 3) {
- p_intersect_line_2d(p1, p2, cp1, cp2, isect);
- newpoints[*nnewpoints][0] = isect[0];
- newpoints[*nnewpoints][1] = isect[1];
- (*nnewpoints)++;
- }
- }
- else if (!p1in && p2in) {
- p_intersect_line_2d(p1, p2, cp1, cp2, isect);
- newpoints[*nnewpoints][0] = isect[0];
- newpoints[*nnewpoints][1] = isect[1];
- (*nnewpoints)++;
-
- newpoints[*nnewpoints][0] = p2[0];
- newpoints[*nnewpoints][1] = p2[1];
- (*nnewpoints)++;
- }
-
- p1in = p2in;
- p1 = p2;
- }
-}
-
-static void p_polygon_kernel_center(float (*points)[2], int npoints, float *center)
-{
- int i, size, nnewpoints = npoints;
- float (*oldpoints)[2], (*newpoints)[2], *p1, *p2;
-
- size = npoints*3;
- oldpoints = MEM_mallocN(sizeof(float)*2*size, "PPolygonOldPoints");
- newpoints = MEM_mallocN(sizeof(float)*2*size, "PPolygonNewPoints");
-
- memcpy(oldpoints, points, sizeof(float)*2*npoints);
-
- for (i = 0; i < npoints; i++) {
- p1 = points[i];
- p2 = points[(i+1)%npoints];
- p_polygon_kernel_clip(oldpoints, nnewpoints, newpoints, &nnewpoints, p1, p2);
-
- if (nnewpoints == 0) {
- /* degenerate case, use center of original polygon */
- memcpy(oldpoints, points, sizeof(float)*2*npoints);
- nnewpoints = npoints;
- break;
- }
- else if (nnewpoints == 1) {
- /* degenerate case, use remaining point */
- center[0] = newpoints[0][0];
- center[1] = newpoints[0][1];
-
- MEM_freeN(oldpoints);
- MEM_freeN(newpoints);
-
- return;
- }
-
- if (nnewpoints*2 > size) {
- size *= 2;
- free(oldpoints);
- oldpoints = malloc(sizeof(float)*2*size);
- memcpy(oldpoints, newpoints, sizeof(float)*2*nnewpoints);
- free(newpoints);
- newpoints = malloc(sizeof(float)*2*size);
- }
- else {
- float (*sw_points)[2] = oldpoints;
- oldpoints = newpoints;
- newpoints = sw_points;
- }
- }
-
- center[0] = center[1] = 0.0f;
-
- for (i = 0; i < nnewpoints; i++) {
- center[0] += oldpoints[i][0];
- center[1] += oldpoints[i][1];
- }
-
- center[0] /= nnewpoints;
- center[1] /= nnewpoints;
-
- MEM_freeN(oldpoints);
- MEM_freeN(newpoints);
-}
-#endif
-
-#if 0
-/* Edge Collapser */
-
-int NCOLLAPSE = 1;
-int NCOLLAPSEX = 0;
-
-static float p_vert_cotan(float *v1, float *v2, float *v3)
-{
- float a[3], b[3], c[3], clen;
-
- VecSubf(a, v2, v1);
- VecSubf(b, v3, v1);
- Crossf(c, a, b);
-
- clen = VecLength(c);
-
- if (clen == 0.0f)
- return 0.0f;
-
- return Inpf(a, b)/clen;
-}
-
-static PBool p_vert_flipped_wheel_triangle(PVert *v)
-{
- PEdge *e = v->edge;
-
- do {
- if (p_face_uv_area_signed(e->face) < 0.0f)
- return P_TRUE;
-
- e = p_wheel_edge_next(e);
- } while (e && (e != v->edge));
-
- return P_FALSE;
-}
-
-static PBool p_vert_map_harmonic_weights(PVert *v)
-{
- float weightsum, positionsum[2], olduv[2];
-
- weightsum = 0.0f;
- positionsum[0] = positionsum[1] = 0.0f;
-
- if (p_vert_interior(v)) {
- PEdge *e = v->edge;
-
- do {
- float t1, t2, weight;
- PVert *v1, *v2;
-
- v1 = e->next->vert;
- v2 = e->next->next->vert;
- t1 = p_vert_cotan(v2->co, e->vert->co, v1->co);
-
- v1 = e->pair->next->vert;
- v2 = e->pair->next->next->vert;
- t2 = p_vert_cotan(v2->co, e->pair->vert->co, v1->co);
-
- weight = 0.5f*(t1 + t2);
- weightsum += weight;
- positionsum[0] += weight*e->pair->vert->uv[0];
- positionsum[1] += weight*e->pair->vert->uv[1];
-
- e = p_wheel_edge_next(e);
- } while (e && (e != v->edge));
- }
- else {
- PEdge *e = v->edge;
-
- do {
- float t1, t2;
- PVert *v1, *v2;
-
- v2 = e->next->vert;
- v1 = e->next->next->vert;
-
- t1 = p_vert_cotan(v1->co, v->co, v2->co);
- t2 = p_vert_cotan(v2->co, v->co, v1->co);
-
- weightsum += t1 + t2;
- positionsum[0] += (v2->uv[1] - v1->uv[1]) + (t1*v2->uv[0] + t2*v1->uv[0]);
- positionsum[1] += (v1->uv[0] - v2->uv[0]) + (t1*v2->uv[1] + t2*v1->uv[1]);
-
- e = p_wheel_edge_next(e);
- } while (e && (e != v->edge));
- }
-
- if (weightsum != 0.0f) {
- weightsum = 1.0f/weightsum;
- positionsum[0] *= weightsum;
- positionsum[1] *= weightsum;
- }
-
- olduv[0] = v->uv[0];
- olduv[1] = v->uv[1];
- v->uv[0] = positionsum[0];
- v->uv[1] = positionsum[1];
-
- if (p_vert_flipped_wheel_triangle(v)) {
- v->uv[0] = olduv[0];
- v->uv[1] = olduv[1];
-
- return P_FALSE;
- }
-
- return P_TRUE;
-}
-
-static void p_vert_harmonic_insert(PVert *v)
-{
- PEdge *e;
-
- if (!p_vert_map_harmonic_weights(v)) {
- /* do polygon kernel center insertion: this is quite slow, but should
- only be needed for 0.01 % of verts or so, when insert with harmonic
- weights fails */
-
- int npoints = 0, i;
- float (*points)[2];
-
- e = v->edge;
- do {
- npoints++;
- e = p_wheel_edge_next(e);
- } while (e && (e != v->edge));
-
- if (e == NULL)
- npoints++;
-
- points = MEM_mallocN(sizeof(float)*2*npoints, "PHarmonicPoints");
-
- e = v->edge;
- i = 0;
- do {
- PEdge *nexte = p_wheel_edge_next(e);
-
- points[i][0] = e->next->vert->uv[0];
- points[i][1] = e->next->vert->uv[1];
-
- if (nexte == NULL) {
- i++;
- points[i][0] = e->next->next->vert->uv[0];
- points[i][1] = e->next->next->vert->uv[1];
- break;
- }
-
- e = nexte;
- i++;
- } while (e != v->edge);
-
- p_polygon_kernel_center(points, npoints, v->uv);
-
- MEM_freeN(points);
- }
-
- e = v->edge;
- do {
- if (!(e->next->vert->flag & PVERT_PIN))
- p_vert_map_harmonic_weights(e->next->vert);
- e = p_wheel_edge_next(e);
- } while (e && (e != v->edge));
-
- p_vert_map_harmonic_weights(v);
-}
-
-static void p_vert_fix_edge_pointer(PVert *v)
-{
- PEdge *start = v->edge;
-
- /* set v->edge pointer to the edge with no pair, if there is one */
- while (v->edge->pair) {
- v->edge = p_wheel_edge_prev(v->edge);
-
- if (v->edge == start)
- break;
- }
-}
-
-static void p_collapsing_verts(PEdge *edge, PEdge *pair, PVert **newv, PVert **keepv)
-{
- /* the two vertices that are involved in the collapse */
- if (edge) {
- *newv = edge->vert;
- *keepv = edge->next->vert;
- }
- else {
- *newv = pair->next->vert;
- *keepv = pair->vert;
- }
-}
-
-static void p_collapse_edge(PEdge *edge, PEdge *pair)
-{
- PVert *oldv, *keepv;
- PEdge *e;
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
-
- /* change e->vert pointers from old vertex to the target vertex */
- e = oldv->edge;
- do {
- if ((e != edge) && !(pair && pair->next == e))
- e->vert = keepv;
-
- e = p_wheel_edge_next(e);
- } while (e && (e != oldv->edge));
-
- /* set keepv->edge pointer */
- if ((edge && (keepv->edge == edge->next)) || (keepv->edge == pair)) {
- if (edge && edge->next->pair)
- keepv->edge = edge->next->pair->next;
- else if (pair && pair->next->next->pair)
- keepv->edge = pair->next->next->pair;
- else if (edge && edge->next->next->pair)
- keepv->edge = edge->next->next->pair;
- else
- keepv->edge = pair->next->pair->next;
- }
-
- /* update pairs and v->edge pointers */
- if (edge) {
- PEdge *e1 = edge->next, *e2 = e1->next;
-
- if (e1->pair)
- e1->pair->pair = e2->pair;
-
- if (e2->pair) {
- e2->pair->pair = e1->pair;
- e2->vert->edge = p_wheel_edge_prev(e2);
- }
- else
- e2->vert->edge = p_wheel_edge_next(e2);
-
- p_vert_fix_edge_pointer(e2->vert);
- }
-
- if (pair) {
- PEdge *e1 = pair->next, *e2 = e1->next;
-
- if (e1->pair)
- e1->pair->pair = e2->pair;
-
- if (e2->pair) {
- e2->pair->pair = e1->pair;
- e2->vert->edge = p_wheel_edge_prev(e2);
- }
- else
- e2->vert->edge = p_wheel_edge_next(e2);
-
- p_vert_fix_edge_pointer(e2->vert);
- }
-
- p_vert_fix_edge_pointer(keepv);
-
- /* mark for move to collapsed list later */
- oldv->flag |= PVERT_COLLAPSE;
-
- if (edge) {
- PFace *f = edge->face;
- PEdge *e1 = edge->next, *e2 = e1->next;
-
- f->flag |= PFACE_COLLAPSE;
- edge->flag |= PEDGE_COLLAPSE;
- e1->flag |= PEDGE_COLLAPSE;
- e2->flag |= PEDGE_COLLAPSE;
- }
-
- if (pair) {
- PFace *f = pair->face;
- PEdge *e1 = pair->next, *e2 = e1->next;
-
- f->flag |= PFACE_COLLAPSE;
- pair->flag |= PEDGE_COLLAPSE;
- e1->flag |= PEDGE_COLLAPSE;
- e2->flag |= PEDGE_COLLAPSE;
- }
-}
-
-static void p_split_vertex(PEdge *edge, PEdge *pair)
-{
- PVert *newv, *keepv;
- PEdge *e;
-
- p_collapsing_verts(edge, pair, &newv, &keepv);
-
- /* update edge pairs */
- if (edge) {
- PEdge *e1 = edge->next, *e2 = e1->next;
-
- if (e1->pair)
- e1->pair->pair = e1;
- if (e2->pair)
- e2->pair->pair = e2;
-
- e2->vert->edge = e2;
- p_vert_fix_edge_pointer(e2->vert);
- keepv->edge = e1;
- }
-
- if (pair) {
- PEdge *e1 = pair->next, *e2 = e1->next;
-
- if (e1->pair)
- e1->pair->pair = e1;
- if (e2->pair)
- e2->pair->pair = e2;
-
- e2->vert->edge = e2;
- p_vert_fix_edge_pointer(e2->vert);
- keepv->edge = pair;
- }
-
- p_vert_fix_edge_pointer(keepv);
-
- /* set e->vert pointers to restored vertex */
- e = newv->edge;
- do {
- e->vert = newv;
- e = p_wheel_edge_next(e);
- } while (e && (e != newv->edge));
-}
-
-static PBool p_collapse_allowed_topologic(PEdge *edge, PEdge *pair)
-{
- PVert *oldv, *keepv;
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
-
- /* boundary edges */
- if (!edge || !pair) {
- /* avoid collapsing chart into an edge */
- if (edge && !edge->next->pair && !edge->next->next->pair)
- return P_FALSE;
- else if (pair && !pair->next->pair && !pair->next->next->pair)
- return P_FALSE;
- }
- /* avoid merging two boundaries (oldv and keepv are on the 'other side' of
- the chart) */
- else if (!p_vert_interior(oldv) && !p_vert_interior(keepv))
- return P_FALSE;
-
- return P_TRUE;
-}
-
-static PBool p_collapse_normal_flipped(float *v1, float *v2, float *vold, float *vnew)
-{
- float nold[3], nnew[3], sub1[3], sub2[3];
-
- VecSubf(sub1, vold, v1);
- VecSubf(sub2, vold, v2);
- Crossf(nold, sub1, sub2);
-
- VecSubf(sub1, vnew, v1);
- VecSubf(sub2, vnew, v2);
- Crossf(nnew, sub1, sub2);
-
- return (Inpf(nold, nnew) <= 0.0f);
-}
-
-static PBool p_collapse_allowed_geometric(PEdge *edge, PEdge *pair)
-{
- PVert *oldv, *keepv;
- PEdge *e;
- float angulardefect, angle;
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
-
- angulardefect = 2*M_PI;
-
- e = oldv->edge;
- do {
- float a[3], b[3], minangle, maxangle;
- PEdge *e1 = e->next, *e2 = e1->next;
- PVert *v1 = e1->vert, *v2 = e2->vert;
- int i;
-
- angle = p_vec_angle(v1->co, oldv->co, v2->co);
- angulardefect -= angle;
-
- /* skip collapsing faces */
- if (v1 == keepv || v2 == keepv) {
- e = p_wheel_edge_next(e);
- continue;
- }
-
- if (p_collapse_normal_flipped(v1->co, v2->co, oldv->co, keepv->co))
- return P_FALSE;
-
- a[0] = angle;
- a[1] = p_vec_angle(v2->co, v1->co, oldv->co);
- a[2] = M_PI - a[0] - a[1];
-
- b[0] = p_vec_angle(v1->co, keepv->co, v2->co);
- b[1] = p_vec_angle(v2->co, v1->co, keepv->co);
- b[2] = M_PI - b[0] - b[1];
-
- /* abf criterion 1: avoid sharp and obtuse angles */
- minangle = 15.0f*M_PI/180.0f;
- maxangle = M_PI - minangle;
-
- for (i = 0; i < 3; i++) {
- if ((b[i] < a[i]) && (b[i] < minangle))
- return P_FALSE;
- else if ((b[i] > a[i]) && (b[i] > maxangle))
- return P_FALSE;
- }
-
- e = p_wheel_edge_next(e);
- } while (e && (e != oldv->edge));
-
- if (p_vert_interior(oldv)) {
- /* hlscm criterion: angular defect smaller than threshold */
- if (fabs(angulardefect) > (M_PI*30.0/180.0))
- return P_FALSE;
- }
- else {
- PVert *v1 = p_boundary_edge_next(oldv->edge)->vert;
- PVert *v2 = p_boundary_edge_prev(oldv->edge)->vert;
-
- /* abf++ criterion 2: avoid collapsing verts inwards */
- if (p_vert_interior(keepv))
- return P_FALSE;
-
- /* don't collapse significant boundary changes */
- angle = p_vec_angle(v1->co, oldv->co, v2->co);
- if (angle < (M_PI*160.0/180.0))
- return P_FALSE;
- }
-
- return P_TRUE;
-}
-
-static PBool p_collapse_allowed(PEdge *edge, PEdge *pair)
-{
- PVert *oldv, *keepv;
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
-
- if (oldv->flag & PVERT_PIN)
- return P_FALSE;
-
- return (p_collapse_allowed_topologic(edge, pair) &&
- p_collapse_allowed_geometric(edge, pair));
-}
-
-static float p_collapse_cost(PEdge *edge, PEdge *pair)
-{
- /* based on volume and boundary optimization from:
- "Fast and Memory Efficient Polygonal Simplification" P. Lindstrom, G. Turk */
-
- PVert *oldv, *keepv;
- PEdge *e;
- PFace *oldf1, *oldf2;
- float volumecost = 0.0f, areacost = 0.0f, edgevec[3], cost, weight, elen;
- float shapecost = 0.0f;
- float shapeold = 0.0f, shapenew = 0.0f;
- int nshapeold = 0, nshapenew = 0;
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
- oldf1 = (edge)? edge->face: NULL;
- oldf2 = (pair)? pair->face: NULL;
-
- VecSubf(edgevec, keepv->co, oldv->co);
-
- e = oldv->edge;
- do {
- float a1, a2, a3;
- float *co1 = e->next->vert->co;
- float *co2 = e->next->next->vert->co;
-
- if ((e->face != oldf1) && (e->face != oldf2)) {
- float tetrav2[3], tetrav3[3], c[3];
-
- /* tetrahedron volume = (1/3!)*|a.(b x c)| */
- VecSubf(tetrav2, co1, oldv->co);
- VecSubf(tetrav3, co2, oldv->co);
- Crossf(c, tetrav2, tetrav3);
-
- volumecost += fabs(Inpf(edgevec, c)/6.0f);
-#if 0
- shapecost += Inpf(co1, keepv->co);
-
- if (p_wheel_edge_next(e) == NULL)
- shapecost += Inpf(co2, keepv->co);
-#endif
-
- p_triangle_angles(oldv->co, co1, co2, &a1, &a2, &a3);
- a1 = a1 - M_PI/3.0;
- a2 = a2 - M_PI/3.0;
- a3 = a3 - M_PI/3.0;
- shapeold = (a1*a1 + a2*a2 + a3*a3)/((M_PI/2)*(M_PI/2));
-
- nshapeold++;
- }
- else {
- p_triangle_angles(keepv->co, co1, co2, &a1, &a2, &a3);
- a1 = a1 - M_PI/3.0;
- a2 = a2 - M_PI/3.0;
- a3 = a3 - M_PI/3.0;
- shapenew = (a1*a1 + a2*a2 + a3*a3)/((M_PI/2)*(M_PI/2));
-
- nshapenew++;
- }
-
- e = p_wheel_edge_next(e);
- } while (e && (e != oldv->edge));
-
- if (!p_vert_interior(oldv)) {
- PVert *v1 = p_boundary_edge_prev(oldv->edge)->vert;
- PVert *v2 = p_boundary_edge_next(oldv->edge)->vert;
-
- areacost = AreaT3Dfl(oldv->co, v1->co, v2->co);
- }
-
- elen = VecLength(edgevec);
- weight = 1.0f; /* 0.2f */
- cost = weight*volumecost*volumecost + elen*elen*areacost*areacost;
-#if 0
- cost += shapecost;
-#else
- shapeold /= nshapeold;
- shapenew /= nshapenew;
- shapecost = (shapeold + 0.00001)/(shapenew + 0.00001);
-
- cost *= shapecost;
-#endif
-
- return cost;
-}
-
-static void p_collapse_cost_vertex(PVert *vert, float *mincost, PEdge **mine)
-{
- PEdge *e, *enext, *pair;
-
- *mine = NULL;
- *mincost = 0.0f;
- e = vert->edge;
- do {
- if (p_collapse_allowed(e, e->pair)) {
- float cost = p_collapse_cost(e, e->pair);
-
- if ((*mine == NULL) || (cost < *mincost)) {
- *mincost = cost;
- *mine = e;
- }
- }
-
- enext = p_wheel_edge_next(e);
-
- if (enext == NULL) {
- /* the other boundary edge, where we only have the pair halfedge */
- pair = e->next->next;
-
- if (p_collapse_allowed(NULL, pair)) {
- float cost = p_collapse_cost(NULL, pair);
-
- if ((*mine == NULL) || (cost < *mincost)) {
- *mincost = cost;
- *mine = pair;
- }
- }
-
- break;
- }
-
- e = enext;
- } while (e != vert->edge);
-}
-
-static void p_chart_post_collapse_flush(PChart *chart, PEdge *collapsed)
-{
- /* move to collapsed_ */
-
- PVert *v, *nextv = NULL, *verts = chart->verts;
- PEdge *e, *nexte = NULL, *edges = chart->edges, *laste = NULL;
- PFace *f, *nextf = NULL, *faces = chart->faces;
-
- chart->verts = chart->collapsed_verts = NULL;
- chart->edges = chart->collapsed_edges = NULL;
- chart->faces = chart->collapsed_faces = NULL;
-
- chart->nverts = chart->nedges = chart->nfaces = 0;
-
- for (v=verts; v; v=nextv) {
- nextv = v->nextlink;
-
- if (v->flag & PVERT_COLLAPSE) {
- v->nextlink = chart->collapsed_verts;
- chart->collapsed_verts = v;
- }
- else {
- v->nextlink = chart->verts;
- chart->verts = v;
- chart->nverts++;
- }
- }
-
- for (e=edges; e; e=nexte) {
- nexte = e->nextlink;
-
- if (!collapsed || !(e->flag & PEDGE_COLLAPSE_EDGE)) {
- if (e->flag & PEDGE_COLLAPSE) {
- e->nextlink = chart->collapsed_edges;
- chart->collapsed_edges = e;
- }
- else {
- e->nextlink = chart->edges;
- chart->edges = e;
- chart->nedges++;
- }
- }
- }
-
- /* these are added last so they can be popped of in the right order
- for splitting */
- for (e=collapsed; e; e=e->nextlink) {
- e->nextlink = e->u.nextcollapse;
- laste = e;
- }
- if (laste) {
- laste->nextlink = chart->collapsed_edges;
- chart->collapsed_edges = collapsed;
- }
-
- for (f=faces; f; f=nextf) {
- nextf = f->nextlink;
-
- if (f->flag & PFACE_COLLAPSE) {
- f->nextlink = chart->collapsed_faces;
- chart->collapsed_faces = f;
- }
- else {
- f->nextlink = chart->faces;
- chart->faces = f;
- chart->nfaces++;
- }
- }
-}
-
-static void p_chart_post_split_flush(PChart *chart)
-{
- /* move from collapsed_ */
-
- PVert *v, *nextv = NULL;
- PEdge *e, *nexte = NULL;
- PFace *f, *nextf = NULL;
-
- for (v=chart->collapsed_verts; v; v=nextv) {
- nextv = v->nextlink;
- v->nextlink = chart->verts;
- chart->verts = v;
- chart->nverts++;
- }
-
- for (e=chart->collapsed_edges; e; e=nexte) {
- nexte = e->nextlink;
- e->nextlink = chart->edges;
- chart->edges = e;
- chart->nedges++;
- }
-
- for (f=chart->collapsed_faces; f; f=nextf) {
- nextf = f->nextlink;
- f->nextlink = chart->faces;
- chart->faces = f;
- chart->nfaces++;
- }
-
- chart->collapsed_verts = NULL;
- chart->collapsed_edges = NULL;
- chart->collapsed_faces = NULL;
-}
-
-static void p_chart_simplify_compute(PChart *chart)
-{
- /* Computes a list of edge collapses / vertex splits. The collapsed
- simplices go in the chart->collapsed_* lists, The original and
- collapsed may then be view as stacks, where the next collapse/split
- is at the top of the respective lists. */
-
- Heap *heap = BLI_heap_new();
- PVert *v, **wheelverts;
- PEdge *collapsededges = NULL, *e;
- int nwheelverts, i, ncollapsed = 0;
-
- wheelverts = MEM_mallocN(sizeof(PVert*)*chart->nverts, "PChartWheelVerts");
-
- /* insert all potential collapses into heap */
- for (v=chart->verts; v; v=v->nextlink) {
- float cost;
- PEdge *e = NULL;
-
- p_collapse_cost_vertex(v, &cost, &e);
-
- if (e)
- v->u.heaplink = BLI_heap_insert(heap, cost, e);
- else
- v->u.heaplink = NULL;
- }
-
- for (e=chart->edges; e; e=e->nextlink)
- e->u.nextcollapse = NULL;
-
- /* pop edge collapse out of heap one by one */
- while (!BLI_heap_empty(heap)) {
- if (ncollapsed == NCOLLAPSE)
- break;
-
- HeapNode *link = BLI_heap_top(heap);
- PEdge *edge = (PEdge*)BLI_heap_popmin(heap), *pair = edge->pair;
- PVert *oldv, *keepv;
- PEdge *wheele, *nexte;
-
- /* remember the edges we collapsed */
- edge->u.nextcollapse = collapsededges;
- collapsededges = edge;
-
- if (edge->vert->u.heaplink != link) {
- edge->flag |= (PEDGE_COLLAPSE_EDGE|PEDGE_COLLAPSE_PAIR);
- edge->next->vert->u.heaplink = NULL;
- SWAP(PEdge*, edge, pair);
- }
- else {
- edge->flag |= PEDGE_COLLAPSE_EDGE;
- edge->vert->u.heaplink = NULL;
- }
-
- p_collapsing_verts(edge, pair, &oldv, &keepv);
-
- /* gather all wheel verts and remember them before collapse */
- nwheelverts = 0;
- wheele = oldv->edge;
-
- do {
- wheelverts[nwheelverts++] = wheele->next->vert;
- nexte = p_wheel_edge_next(wheele);
-
- if (nexte == NULL)
- wheelverts[nwheelverts++] = wheele->next->next->vert;
-
- wheele = nexte;
- } while (wheele && (wheele != oldv->edge));
-
- /* collapse */
- p_collapse_edge(edge, pair);
-
- for (i = 0; i < nwheelverts; i++) {
- float cost;
- PEdge *collapse = NULL;
-
- v = wheelverts[i];
-
- if (v->u.heaplink) {
- BLI_heap_remove(heap, v->u.heaplink);
- v->u.heaplink = NULL;
- }
-
- p_collapse_cost_vertex(v, &cost, &collapse);
-
- if (collapse)
- v->u.heaplink = BLI_heap_insert(heap, cost, collapse);
- }
-
- ncollapsed++;
- }
-
- MEM_freeN(wheelverts);
- BLI_heap_free(heap, NULL);
-
- p_chart_post_collapse_flush(chart, collapsededges);
-}
-
-static void p_chart_complexify(PChart *chart)
-{
- PEdge *e, *pair, *edge;
- PVert *newv, *keepv;
- int x = 0;
-
- for (e=chart->collapsed_edges; e; e=e->nextlink) {
- if (!(e->flag & PEDGE_COLLAPSE_EDGE))
- break;
-
- edge = e;
- pair = e->pair;
-
- if (edge->flag & PEDGE_COLLAPSE_PAIR) {
- SWAP(PEdge*, edge, pair);
- }
-
- p_split_vertex(edge, pair);
- p_collapsing_verts(edge, pair, &newv, &keepv);
-
- if (x >= NCOLLAPSEX) {
- newv->uv[0] = keepv->uv[0];
- newv->uv[1] = keepv->uv[1];
- }
- else {
- p_vert_harmonic_insert(newv);
- x++;
- }
- }
-
- p_chart_post_split_flush(chart);
-}
-
-#if 0
-static void p_chart_simplify(PChart *chart)
-{
- /* Not implemented, needs proper reordering in split_flush. */
-}
-#endif
-#endif
-
-/* ABF */
-
-#define ABF_MAX_ITER 20
-
-typedef struct PAbfSystem {
- int ninterior, nfaces, nangles;
- float *alpha, *beta, *sine, *cosine, *weight;
- float *bAlpha, *bTriangle, *bInterior;
- float *lambdaTriangle, *lambdaPlanar, *lambdaLength;
- float (*J2dt)[3], *bstar, *dstar;
- float minangle, maxangle;
-} PAbfSystem;
-
-static void p_abf_setup_system(PAbfSystem *sys)
-{
- int i;
-
- sys->alpha = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFalpha");
- sys->beta = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFbeta");
- sys->sine = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFsine");
- sys->cosine = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFcosine");
- sys->weight = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFweight");
-
- sys->bAlpha = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFbalpha");
- sys->bTriangle = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFbtriangle");
- sys->bInterior = (float*)MEM_mallocN(sizeof(float)*2*sys->ninterior, "ABFbinterior");
-
- sys->lambdaTriangle = (float*)MEM_callocN(sizeof(float)*sys->nfaces, "ABFlambdatri");
- sys->lambdaPlanar = (float*)MEM_callocN(sizeof(float)*sys->ninterior, "ABFlamdaplane");
- sys->lambdaLength = (float*)MEM_mallocN(sizeof(float)*sys->ninterior, "ABFlambdalen");
-
- sys->J2dt = MEM_mallocN(sizeof(float)*sys->nangles*3, "ABFj2dt");
- sys->bstar = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFbstar");
- sys->dstar = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFdstar");
-
- for (i = 0; i < sys->ninterior; i++)
- sys->lambdaLength[i] = 1.0;
-
- sys->minangle = 7.5f*M_PI/180.0f;
- sys->maxangle = M_PI - sys->minangle;
-}
-
-static void p_abf_free_system(PAbfSystem *sys)
-{
- MEM_freeN(sys->alpha);
- MEM_freeN(sys->beta);
- MEM_freeN(sys->sine);
- MEM_freeN(sys->cosine);
- MEM_freeN(sys->weight);
- MEM_freeN(sys->bAlpha);
- MEM_freeN(sys->bTriangle);
- MEM_freeN(sys->bInterior);
- MEM_freeN(sys->lambdaTriangle);
- MEM_freeN(sys->lambdaPlanar);
- MEM_freeN(sys->lambdaLength);
- MEM_freeN(sys->J2dt);
- MEM_freeN(sys->bstar);
- MEM_freeN(sys->dstar);
-}
-
-static void p_abf_compute_sines(PAbfSystem *sys)
-{
- int i;
- float *sine = sys->sine, *cosine = sys->cosine, *alpha = sys->alpha;
-
- for (i = 0; i < sys->nangles; i++, sine++, cosine++, alpha++) {
- *sine = sin(*alpha);
- *cosine = cos(*alpha);
- }
-}
-
-static float p_abf_compute_sin_product(PAbfSystem *sys, PVert *v, int aid)
-{
- PEdge *e, *e1, *e2;
- float sin1, sin2;
-
- sin1 = sin2 = 1.0;
-
- e = v->edge;
- do {
- e1 = e->next;
- e2 = e->next->next;
-
- if (aid == e1->u.id) {
- /* we are computing a derivative for this angle,
- so we use cos and drop the other part */
- sin1 *= sys->cosine[e1->u.id];
- sin2 = 0.0;
- }
- else
- sin1 *= sys->sine[e1->u.id];
-
- if (aid == e2->u.id) {
- /* see above */
- sin1 = 0.0;
- sin2 *= sys->cosine[e2->u.id];
- }
- else
- sin2 *= sys->sine[e2->u.id];
-
- e = e->next->next->pair;
- } while (e && (e != v->edge));
-
- return (sin1 - sin2);
-}
-
-static float p_abf_compute_grad_alpha(PAbfSystem *sys, PFace *f, PEdge *e)
-{
- PVert *v = e->vert, *v1 = e->next->vert, *v2 = e->next->next->vert;
- float deriv;
-
- deriv = (sys->alpha[e->u.id] - sys->beta[e->u.id])*sys->weight[e->u.id];
- deriv += sys->lambdaTriangle[f->u.id];
-
- if (v->flag & PVERT_INTERIOR) {
- deriv += sys->lambdaPlanar[v->u.id];
- }
-
- if (v1->flag & PVERT_INTERIOR) {
- float product = p_abf_compute_sin_product(sys, v1, e->u.id);
- deriv += sys->lambdaLength[v1->u.id]*product;
- }
-
- if (v2->flag & PVERT_INTERIOR) {
- float product = p_abf_compute_sin_product(sys, v2, e->u.id);
- deriv += sys->lambdaLength[v2->u.id]*product;
- }
-
- return deriv;
-}
-
-static float p_abf_compute_gradient(PAbfSystem *sys, PChart *chart)
-{
- PFace *f;
- PEdge *e;
- PVert *v;
- float norm = 0.0;
-
- for (f=chart->faces; f; f=f->nextlink) {
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- float gtriangle, galpha1, galpha2, galpha3;
-
- galpha1 = p_abf_compute_grad_alpha(sys, f, e1);
- galpha2 = p_abf_compute_grad_alpha(sys, f, e2);
- galpha3 = p_abf_compute_grad_alpha(sys, f, e3);
-
- sys->bAlpha[e1->u.id] = -galpha1;
- sys->bAlpha[e2->u.id] = -galpha2;
- sys->bAlpha[e3->u.id] = -galpha3;
-
- norm += galpha1*galpha1 + galpha2*galpha2 + galpha3*galpha3;
-
- gtriangle = sys->alpha[e1->u.id] + sys->alpha[e2->u.id] + sys->alpha[e3->u.id] - M_PI;
- sys->bTriangle[f->u.id] = -gtriangle;
- norm += gtriangle*gtriangle;
- }
-
- for (v=chart->verts; v; v=v->nextlink) {
- if (v->flag & PVERT_INTERIOR) {
- float gplanar = -2*M_PI, glength;
-
- e = v->edge;
- do {
- gplanar += sys->alpha[e->u.id];
- e = e->next->next->pair;
- } while (e && (e != v->edge));
-
- sys->bInterior[v->u.id] = -gplanar;
- norm += gplanar*gplanar;
-
- glength = p_abf_compute_sin_product(sys, v, -1);
- sys->bInterior[sys->ninterior + v->u.id] = -glength;
- norm += glength*glength;
- }
- }
-
- return norm;
-}
-
-static PBool p_abf_matrix_invert(PAbfSystem *sys, PChart *chart)
-{
- PFace *f;
- PEdge *e;
- int i, j, ninterior = sys->ninterior, nvar = 2*sys->ninterior;
- PBool success;
-
- nlNewContext();
- nlSolverParameteri(NL_NB_VARIABLES, nvar);
-
- nlBegin(NL_SYSTEM);
-
- nlBegin(NL_MATRIX);
-
- for (i = 0; i < nvar; i++)
- nlRightHandSideAdd(0, i, sys->bInterior[i]);
-
- for (f=chart->faces; f; f=f->nextlink) {
- float wi1, wi2, wi3, b, si, beta[3], j2[3][3], W[3][3];
- float row1[6], row2[6], row3[6];
- int vid[6];
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- wi1 = 1.0/sys->weight[e1->u.id];
- wi2 = 1.0/sys->weight[e2->u.id];
- wi3 = 1.0/sys->weight[e3->u.id];
-
- /* bstar1 = (J1*dInv*bAlpha - bTriangle) */
- b = sys->bAlpha[e1->u.id]*wi1;
- b += sys->bAlpha[e2->u.id]*wi2;
- b += sys->bAlpha[e3->u.id]*wi3;
- b -= sys->bTriangle[f->u.id];
-
- /* si = J1*d*J1t */
- si = 1.0/(wi1 + wi2 + wi3);
-
- /* J1t*si*bstar1 - bAlpha */
- beta[0] = b*si - sys->bAlpha[e1->u.id];
- beta[1] = b*si - sys->bAlpha[e2->u.id];
- beta[2] = b*si - sys->bAlpha[e3->u.id];
-
- /* use this later for computing other lambda's */
- sys->bstar[f->u.id] = b;
- sys->dstar[f->u.id] = si;
-
- /* set matrix */
- W[0][0] = si - sys->weight[e1->u.id]; W[0][1] = si; W[0][2] = si;
- W[1][0] = si; W[1][1] = si - sys->weight[e2->u.id]; W[1][2] = si;
- W[2][0] = si; W[2][1] = si; W[2][2] = si - sys->weight[e3->u.id];
-
- vid[0] = vid[1] = vid[2] = vid[3] = vid[4] = vid[5] = -1;
-
- if (v1->flag & PVERT_INTERIOR) {
- vid[0] = v1->u.id;
- vid[3] = ninterior + v1->u.id;
-
- sys->J2dt[e1->u.id][0] = j2[0][0] = 1.0*wi1;
- sys->J2dt[e2->u.id][0] = j2[1][0] = p_abf_compute_sin_product(sys, v1, e2->u.id)*wi2;
- sys->J2dt[e3->u.id][0] = j2[2][0] = p_abf_compute_sin_product(sys, v1, e3->u.id)*wi3;
-
- nlRightHandSideAdd(0, v1->u.id, j2[0][0]*beta[0]);
- nlRightHandSideAdd(0, ninterior + v1->u.id, j2[1][0]*beta[1] + j2[2][0]*beta[2]);
-
- row1[0] = j2[0][0]*W[0][0];
- row2[0] = j2[0][0]*W[1][0];
- row3[0] = j2[0][0]*W[2][0];
-
- row1[3] = j2[1][0]*W[0][1] + j2[2][0]*W[0][2];
- row2[3] = j2[1][0]*W[1][1] + j2[2][0]*W[1][2];
- row3[3] = j2[1][0]*W[2][1] + j2[2][0]*W[2][2];
- }
-
- if (v2->flag & PVERT_INTERIOR) {
- vid[1] = v2->u.id;
- vid[4] = ninterior + v2->u.id;
-
- sys->J2dt[e1->u.id][1] = j2[0][1] = p_abf_compute_sin_product(sys, v2, e1->u.id)*wi1;
- sys->J2dt[e2->u.id][1] = j2[1][1] = 1.0*wi2;
- sys->J2dt[e3->u.id][1] = j2[2][1] = p_abf_compute_sin_product(sys, v2, e3->u.id)*wi3;
-
- nlRightHandSideAdd(0, v2->u.id, j2[1][1]*beta[1]);
- nlRightHandSideAdd(0, ninterior + v2->u.id, j2[0][1]*beta[0] + j2[2][1]*beta[2]);
-
- row1[1] = j2[1][1]*W[0][1];
- row2[1] = j2[1][1]*W[1][1];
- row3[1] = j2[1][1]*W[2][1];
-
- row1[4] = j2[0][1]*W[0][0] + j2[2][1]*W[0][2];
- row2[4] = j2[0][1]*W[1][0] + j2[2][1]*W[1][2];
- row3[4] = j2[0][1]*W[2][0] + j2[2][1]*W[2][2];
- }
-
- if (v3->flag & PVERT_INTERIOR) {
- vid[2] = v3->u.id;
- vid[5] = ninterior + v3->u.id;
-
- sys->J2dt[e1->u.id][2] = j2[0][2] = p_abf_compute_sin_product(sys, v3, e1->u.id)*wi1;
- sys->J2dt[e2->u.id][2] = j2[1][2] = p_abf_compute_sin_product(sys, v3, e2->u.id)*wi2;
- sys->J2dt[e3->u.id][2] = j2[2][2] = 1.0*wi3;
-
- nlRightHandSideAdd(0, v3->u.id, j2[2][2]*beta[2]);
- nlRightHandSideAdd(0, ninterior + v3->u.id, j2[0][2]*beta[0] + j2[1][2]*beta[1]);
-
- row1[2] = j2[2][2]*W[0][2];
- row2[2] = j2[2][2]*W[1][2];
- row3[2] = j2[2][2]*W[2][2];
-
- row1[5] = j2[0][2]*W[0][0] + j2[1][2]*W[0][1];
- row2[5] = j2[0][2]*W[1][0] + j2[1][2]*W[1][1];
- row3[5] = j2[0][2]*W[2][0] + j2[1][2]*W[2][1];
- }
-
- for (i = 0; i < 3; i++) {
- int r = vid[i];
-
- if (r == -1)
- continue;
-
- for (j = 0; j < 6; j++) {
- int c = vid[j];
-
- if (c == -1)
- continue;
-
- if (i == 0)
- nlMatrixAdd(r, c, j2[0][i]*row1[j]);
- else
- nlMatrixAdd(r + ninterior, c, j2[0][i]*row1[j]);
-
- if (i == 1)
- nlMatrixAdd(r, c, j2[1][i]*row2[j]);
- else
- nlMatrixAdd(r + ninterior, c, j2[1][i]*row2[j]);
-
-
- if (i == 2)
- nlMatrixAdd(r, c, j2[2][i]*row3[j]);
- else
- nlMatrixAdd(r + ninterior, c, j2[2][i]*row3[j]);
- }
- }
- }
-
- nlEnd(NL_MATRIX);
-
- nlEnd(NL_SYSTEM);
-
- success = nlSolve();
-
- if (success) {
- for (f=chart->faces; f; f=f->nextlink) {
- float dlambda1, pre[3], dalpha;
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- pre[0] = pre[1] = pre[2] = 0.0;
-
- if (v1->flag & PVERT_INTERIOR) {
- float x = nlGetVariable(0, v1->u.id);
- float x2 = nlGetVariable(0, ninterior + v1->u.id);
- pre[0] += sys->J2dt[e1->u.id][0]*x;
- pre[1] += sys->J2dt[e2->u.id][0]*x2;
- pre[2] += sys->J2dt[e3->u.id][0]*x2;
- }
-
- if (v2->flag & PVERT_INTERIOR) {
- float x = nlGetVariable(0, v2->u.id);
- float x2 = nlGetVariable(0, ninterior + v2->u.id);
- pre[0] += sys->J2dt[e1->u.id][1]*x2;
- pre[1] += sys->J2dt[e2->u.id][1]*x;
- pre[2] += sys->J2dt[e3->u.id][1]*x2;
- }
-
- if (v3->flag & PVERT_INTERIOR) {
- float x = nlGetVariable(0, v3->u.id);
- float x2 = nlGetVariable(0, ninterior + v3->u.id);
- pre[0] += sys->J2dt[e1->u.id][2]*x2;
- pre[1] += sys->J2dt[e2->u.id][2]*x2;
- pre[2] += sys->J2dt[e3->u.id][2]*x;
- }
-
- dlambda1 = pre[0] + pre[1] + pre[2];
- dlambda1 = sys->dstar[f->u.id]*(sys->bstar[f->u.id] - dlambda1);
-
- sys->lambdaTriangle[f->u.id] += dlambda1;
-
- dalpha = (sys->bAlpha[e1->u.id] - dlambda1);
- sys->alpha[e1->u.id] += dalpha/sys->weight[e1->u.id] - pre[0];
-
- dalpha = (sys->bAlpha[e2->u.id] - dlambda1);
- sys->alpha[e2->u.id] += dalpha/sys->weight[e2->u.id] - pre[1];
-
- dalpha = (sys->bAlpha[e3->u.id] - dlambda1);
- sys->alpha[e3->u.id] += dalpha/sys->weight[e3->u.id] - pre[2];
-
- /* clamp */
- e = f->edge;
- do {
- if (sys->alpha[e->u.id] > M_PI)
- sys->alpha[e->u.id] = M_PI;
- else if (sys->alpha[e->u.id] < 0.0f)
- sys->alpha[e->u.id] = 0.0f;
- } while (e != f->edge);
- }
-
- for (i = 0; i < ninterior; i++) {
- sys->lambdaPlanar[i] += nlGetVariable(0, i);
- sys->lambdaLength[i] += nlGetVariable(0, ninterior + i);
- }
- }
-
- nlDeleteContext(nlGetCurrent());
-
- return success;
-}
-
-static PBool p_chart_abf_solve(PChart *chart)
-{
- PVert *v;
- PFace *f;
- PEdge *e, *e1, *e2, *e3;
- PAbfSystem sys;
- int i;
- float lastnorm, limit = (chart->nfaces > 100)? 1.0f: 0.001f;
-
- /* setup id's */
- sys.ninterior = sys.nfaces = sys.nangles = 0;
-
- for (v=chart->verts; v; v=v->nextlink) {
- if (p_vert_interior(v)) {
- v->flag |= PVERT_INTERIOR;
- v->u.id = sys.ninterior++;
- }
- else
- v->flag &= ~PVERT_INTERIOR;
- }
-
- for (f=chart->faces; f; f=f->nextlink) {
- e1 = f->edge; e2 = e1->next; e3 = e2->next;
- f->u.id = sys.nfaces++;
-
- /* angle id's are conveniently stored in half edges */
- e1->u.id = sys.nangles++;
- e2->u.id = sys.nangles++;
- e3->u.id = sys.nangles++;
- }
-
- p_abf_setup_system(&sys);
-
- /* compute initial angles */
- for (f=chart->faces; f; f=f->nextlink) {
- float a1, a2, a3;
-
- e1 = f->edge; e2 = e1->next; e3 = e2->next;
- p_face_angles(f, &a1, &a2, &a3);
-
- if (a1 < sys.minangle)
- a1 = sys.minangle;
- else if (a1 > sys.maxangle)
- a1 = sys.maxangle;
- if (a2 < sys.minangle)
- a2 = sys.minangle;
- else if (a2 > sys.maxangle)
- a2 = sys.maxangle;
- if (a3 < sys.minangle)
- a3 = sys.minangle;
- else if (a3 > sys.maxangle)
- a3 = sys.maxangle;
-
- sys.alpha[e1->u.id] = sys.beta[e1->u.id] = a1;
- sys.alpha[e2->u.id] = sys.beta[e2->u.id] = a2;
- sys.alpha[e3->u.id] = sys.beta[e3->u.id] = a3;
-
- sys.weight[e1->u.id] = 2.0/(a1*a1);
- sys.weight[e2->u.id] = 2.0/(a2*a2);
- sys.weight[e3->u.id] = 2.0/(a3*a3);
- }
-
- for (v=chart->verts; v; v=v->nextlink) {
- if (v->flag & PVERT_INTERIOR) {
- float anglesum = 0.0, scale;
-
- e = v->edge;
- do {
- anglesum += sys.beta[e->u.id];
- e = e->next->next->pair;
- } while (e && (e != v->edge));
-
- scale = (anglesum == 0.0f)? 0.0f: 2*M_PI/anglesum;
-
- e = v->edge;
- do {
- sys.beta[e->u.id] = sys.alpha[e->u.id] = sys.beta[e->u.id]*scale;
- e = e->next->next->pair;
- } while (e && (e != v->edge));
- }
- }
-
- if (sys.ninterior > 0) {
- p_abf_compute_sines(&sys);
-
- /* iteration */
- lastnorm = 1e10;
-
- for (i = 0; i < ABF_MAX_ITER; i++) {
- float norm = p_abf_compute_gradient(&sys, chart);
-
- lastnorm = norm;
-
- if (norm < limit)
- break;
-
- if (!p_abf_matrix_invert(&sys, chart)) {
- param_warning("ABF failed to invert matrix.");
- p_abf_free_system(&sys);
- return P_FALSE;
- }
-
- p_abf_compute_sines(&sys);
- }
-
- if (i == ABF_MAX_ITER) {
- param_warning("ABF maximum iterations reached.");
- p_abf_free_system(&sys);
- return P_FALSE;
- }
- }
-
- chart->u.lscm.abf_alpha = MEM_dupallocN(sys.alpha);
- p_abf_free_system(&sys);
-
- return P_TRUE;
-}
-
-/* Least Squares Conformal Maps */
-
-static void p_chart_pin_positions(PChart *chart, PVert **pin1, PVert **pin2)
-{
- if (pin1 == pin2) {
- /* degenerate case */
- PFace *f = chart->faces;
- *pin1 = f->edge->vert;
- *pin2 = f->edge->next->vert;
-
- (*pin1)->uv[0] = 0.0f;
- (*pin1)->uv[1] = 0.5f;
- (*pin2)->uv[0] = 1.0f;
- (*pin2)->uv[1] = 0.5f;
- }
- else {
- int diru, dirv, dirx, diry;
- float sub[3];
-
- VecSubf(sub, (*pin1)->co, (*pin2)->co);
- sub[0] = fabs(sub[0]);
- sub[1] = fabs(sub[1]);
- sub[2] = fabs(sub[2]);
-
- if ((sub[0] > sub[1]) && (sub[0] > sub[2])) {
- dirx = 0;
- diry = (sub[1] > sub[2])? 1: 2;
- }
- else if ((sub[1] > sub[0]) && (sub[1] > sub[2])) {
- dirx = 1;
- diry = (sub[0] > sub[2])? 0: 2;
- }
- else {
- dirx = 2;
- diry = (sub[0] > sub[1])? 0: 1;
- }
-
- if (dirx == 2) {
- diru = 1;
- dirv = 0;
- }
- else {
- diru = 0;
- dirv = 1;
- }
-
- (*pin1)->uv[diru] = (*pin1)->co[dirx];
- (*pin1)->uv[dirv] = (*pin1)->co[diry];
- (*pin2)->uv[diru] = (*pin2)->co[dirx];
- (*pin2)->uv[dirv] = (*pin2)->co[diry];
- }
-}
-
-static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PVert **pin2)
-{
- PEdge *be, *lastbe = NULL, *maxe1 = NULL, *maxe2 = NULL, *be1, *be2;
- PEdge *cure = NULL, *firste1 = NULL, *firste2 = NULL, *nextbe;
- float maxlen = 0.0f, curlen = 0.0f, totlen = 0.0f, firstlen = 0.0f;
- float len1, len2;
-
- /* find longest series of verts split in the chart itself, these are
- marked during construction */
- be = outer;
- lastbe = p_boundary_edge_prev(be);
- do {
- float len = p_edge_length(be);
- totlen += len;
-
- nextbe = p_boundary_edge_next(be);
-
- if ((be->vert->flag & PVERT_SPLIT) ||
- (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) {
- if (!cure) {
- if (be == outer)
- firste1 = be;
- cure = be;
- }
- else
- curlen += p_edge_length(lastbe);
- }
- else if (cure) {
- if (curlen > maxlen) {
- maxlen = curlen;
- maxe1 = cure;
- maxe2 = lastbe;
- }
-
- if (firste1 == cure) {
- firstlen = curlen;
- firste2 = lastbe;
- }
-
- curlen = 0.0f;
- cure = NULL;
- }
-
- lastbe = be;
- be = nextbe;
- } while(be != outer);
-
- /* make sure we also count a series of splits over the starting point */
- if (cure && (cure != outer)) {
- firstlen += curlen + p_edge_length(be);
-
- if (firstlen > maxlen) {
- maxlen = firstlen;
- maxe1 = cure;
- maxe2 = firste2;
- }
- }
-
- if (!maxe1 || !maxe2 || (maxlen < 0.5f*totlen))
- return P_FALSE;
-
- /* find pin1 in the split vertices */
- be1 = maxe1;
- be2 = maxe2;
- len1 = 0.0f;
- len2 = 0.0f;
-
- do {
- if (len1 < len2) {
- len1 += p_edge_length(be1);
- be1 = p_boundary_edge_next(be1);
- }
- else {
- be2 = p_boundary_edge_prev(be2);
- len2 += p_edge_length(be2);
- }
- } while (be1 != be2);
-
- *pin1 = be1->vert;
-
- /* find pin2 outside the split vertices */
- be1 = maxe1;
- be2 = maxe2;
- len1 = 0.0f;
- len2 = 0.0f;
-
- do {
- if (len1 < len2) {
- be1 = p_boundary_edge_prev(be1);
- len1 += p_edge_length(be1);
- }
- else {
- len2 += p_edge_length(be2);
- be2 = p_boundary_edge_next(be2);
- }
- } while (be1 != be2);
-
- *pin2 = be1->vert;
-
- p_chart_pin_positions(chart, pin1, pin2);
-
- return P_TRUE;
-}
-
-static void p_chart_extrema_verts(PChart *chart, PVert **pin1, PVert **pin2)
-{
- float minv[3], maxv[3], dirlen;
- PVert *v, *minvert[3], *maxvert[3];
- int i, dir;
-
- /* find minimum and maximum verts over x/y/z axes */
- minv[0] = minv[1] = minv[2] = 1e20;
- maxv[0] = maxv[1] = maxv[2] = -1e20;
-
- minvert[0] = minvert[1] = minvert[2] = NULL;
- maxvert[0] = maxvert[1] = maxvert[2] = NULL;
-
- for (v = chart->verts; v; v=v->nextlink) {
- for (i = 0; i < 3; i++) {
- if (v->co[i] < minv[i]) {
- minv[i] = v->co[i];
- minvert[i] = v;
- }
- if (v->co[i] > maxv[i]) {
- maxv[i] = v->co[i];
- maxvert[i] = v;
- }
- }
- }
-
- /* find axes with longest distance */
- dir = 0;
- dirlen = -1.0;
-
- for (i = 0; i < 3; i++) {
- if (maxv[i] - minv[i] > dirlen) {
- dir = i;
- dirlen = maxv[i] - minv[i];
- }
- }
-
- *pin1 = minvert[dir];
- *pin2 = maxvert[dir];
-
- p_chart_pin_positions(chart, pin1, pin2);
-}
-
-static void p_chart_lscm_load_solution(PChart *chart)
-{
- PVert *v;
-
- for (v=chart->verts; v; v=v->nextlink) {
- v->uv[0] = nlGetVariable(0, 2*v->u.id);
- v->uv[1] = nlGetVariable(0, 2*v->u.id + 1);
- }
-}
-
-static void p_chart_lscm_begin(PChart *chart, PBool live, PBool abf)
-{
- PVert *v, *pin1, *pin2;
- PBool select = P_FALSE, deselect = P_FALSE;
- int npins = 0, id = 0;
-
- /* give vertices matrix indices and count pins */
- for (v=chart->verts; v; v=v->nextlink) {
- if (v->flag & PVERT_PIN) {
- npins++;
- if (v->flag & PVERT_SELECT)
- select = P_TRUE;
- }
-
- if (!(v->flag & PVERT_SELECT))
- deselect = P_TRUE;
- }
-
- if ((live && (!select || !deselect)) || (npins == 1)) {
- chart->u.lscm.context = NULL;
- }
- else {
-#if 0
- p_chart_simplify_compute(chart);
- p_chart_topological_sanity_check(chart);
-#endif
-
- if (abf) {
- if (!p_chart_abf_solve(chart))
- param_warning("ABF solving failed: falling back to LSCM.\n");
- }
-
- if (npins <= 1) {
- /* not enough pins, lets find some ourself */
- PEdge *outer;
-
- p_chart_boundaries(chart, NULL, &outer);
-
- if (!p_chart_symmetry_pins(chart, outer, &pin1, &pin2))
- p_chart_extrema_verts(chart, &pin1, &pin2);
-
- chart->u.lscm.pin1 = pin1;
- chart->u.lscm.pin2 = pin2;
- }
- else {
- chart->flag |= PCHART_NOPACK;
- }
-
- for (v=chart->verts; v; v=v->nextlink)
- v->u.id = id++;
-
- nlNewContext();
- nlSolverParameteri(NL_NB_VARIABLES, 2*chart->nverts);
- nlSolverParameteri(NL_NB_ROWS, 2*chart->nfaces);
- nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
-
- chart->u.lscm.context = nlGetCurrent();
- }
-}
-
-static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart)
-{
- PVert *v, *pin1 = chart->u.lscm.pin1, *pin2 = chart->u.lscm.pin2;
- PFace *f;
- float *alpha = chart->u.lscm.abf_alpha;
- int row;
-
- nlMakeCurrent(chart->u.lscm.context);
-
- nlBegin(NL_SYSTEM);
-
-#if 0
- /* TODO: make loading pins work for simplify/complexify. */
-#endif
-
- for (v=chart->verts; v; v=v->nextlink)
- if (v->flag & PVERT_PIN)
- p_vert_load_pin_select_uvs(handle, v); /* reload for live */
-
- if (chart->u.lscm.pin1) {
- nlLockVariable(2*pin1->u.id);
- nlLockVariable(2*pin1->u.id + 1);
- nlLockVariable(2*pin2->u.id);
- nlLockVariable(2*pin2->u.id + 1);
-
- nlSetVariable(0, 2*pin1->u.id, pin1->uv[0]);
- nlSetVariable(0, 2*pin1->u.id + 1, pin1->uv[1]);
- nlSetVariable(0, 2*pin2->u.id, pin2->uv[0]);
- nlSetVariable(0, 2*pin2->u.id + 1, pin2->uv[1]);
- }
- else {
- /* set and lock the pins */
- for (v=chart->verts; v; v=v->nextlink) {
- if (v->flag & PVERT_PIN) {
- nlLockVariable(2*v->u.id);
- nlLockVariable(2*v->u.id + 1);
-
- nlSetVariable(0, 2*v->u.id, v->uv[0]);
- nlSetVariable(0, 2*v->u.id + 1, v->uv[1]);
- }
- }
- }
-
- /* construct matrix */
-
- nlBegin(NL_MATRIX);
-
- row = 0;
- for (f=chart->faces; f; f=f->nextlink) {
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
- float a1, a2, a3, ratio, cosine, sine;
- float sina1, sina2, sina3, sinmax;
-
- if (alpha) {
- /* use abf angles if passed on */
- a1 = *(alpha++);
- a2 = *(alpha++);
- a3 = *(alpha++);
- }
- else
- p_face_angles(f, &a1, &a2, &a3);
-
- sina1 = sin(a1);
- sina2 = sin(a2);
- sina3 = sin(a3);
-
- sinmax = MAX3(sina1, sina2, sina3);
-
- /* shift vertices to find most stable order */
- if (sina3 != sinmax) {
- SHIFT3(PVert*, v1, v2, v3);
- SHIFT3(float, a1, a2, a3);
- SHIFT3(float, sina1, sina2, sina3);
-
- if (sina2 == sinmax) {
- SHIFT3(PVert*, v1, v2, v3);
- SHIFT3(float, a1, a2, a3);
- SHIFT3(float, sina1, sina2, sina3);
- }
- }
-
- /* angle based lscm formulation */
- ratio = (sina3 == 0.0f)? 1.0f: sina2/sina3;
- cosine = cos(a1)*ratio;
- sine = sina1*ratio;
-
-#if 0
- nlBegin(NL_ROW);
- nlCoefficient(2*v1->u.id, cosine - 1.0);
- nlCoefficient(2*v1->u.id+1, -sine);
- nlCoefficient(2*v2->u.id, -cosine);
- nlCoefficient(2*v2->u.id+1, sine);
- nlCoefficient(2*v3->u.id, 1.0);
- nlEnd(NL_ROW);
-
- nlBegin(NL_ROW);
- nlCoefficient(2*v1->u.id, sine);
- nlCoefficient(2*v1->u.id+1, cosine - 1.0);
- nlCoefficient(2*v2->u.id, -sine);
- nlCoefficient(2*v2->u.id+1, -cosine);
- nlCoefficient(2*v3->u.id+1, 1.0);
- nlEnd(NL_ROW);
-#else
- nlMatrixAdd(row, 2*v1->u.id, cosine - 1.0);
- nlMatrixAdd(row, 2*v1->u.id+1, -sine);
- nlMatrixAdd(row, 2*v2->u.id, -cosine);
- nlMatrixAdd(row, 2*v2->u.id+1, sine);
- nlMatrixAdd(row, 2*v3->u.id, 1.0);
- row++;
-
- nlMatrixAdd(row, 2*v1->u.id, sine);
- nlMatrixAdd(row, 2*v1->u.id+1, cosine - 1.0);
- nlMatrixAdd(row, 2*v2->u.id, -sine);
- nlMatrixAdd(row, 2*v2->u.id+1, -cosine);
- nlMatrixAdd(row, 2*v3->u.id+1, 1.0);
- row++;
-#endif
- }
-
- nlEnd(NL_MATRIX);
-
- nlEnd(NL_SYSTEM);
-
- if (nlSolveAdvanced(NULL, NL_TRUE)) {
- p_chart_lscm_load_solution(chart);
- return P_TRUE;
- }
- else {
- for (v=chart->verts; v; v=v->nextlink) {
- v->uv[0] = 0.0f;
- v->uv[1] = 0.0f;
- }
- }
-
- return P_FALSE;
-}
-
-static void p_chart_lscm_end(PChart *chart)
-{
- if (chart->u.lscm.context)
- nlDeleteContext(chart->u.lscm.context);
-
- if (chart->u.lscm.abf_alpha) {
- MEM_freeN(chart->u.lscm.abf_alpha);
- chart->u.lscm.abf_alpha = NULL;
- }
-
- chart->u.lscm.context = NULL;
- chart->u.lscm.pin1 = NULL;
- chart->u.lscm.pin2 = NULL;
-}
-
-/* Stretch */
-
-#define P_STRETCH_ITER 20
-
-static void p_stretch_pin_boundary(PChart *chart)
-{
- PVert *v;
-
- for(v=chart->verts; v; v=v->nextlink)
- if (v->edge->pair == NULL)
- v->flag |= PVERT_PIN;
- else
- v->flag &= ~PVERT_PIN;
-}
-
-static float p_face_stretch(PFace *f)
-{
- float T, w, tmp[3];
- float Ps[3], Pt[3];
- float a, c, area;
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert;
-
- area = p_face_uv_area_signed(f);
-
- if (area <= 0.0f) /* flipped face -> infinite stretch */
- return 1e10f;
-
- w= 1.0f/(2.0f*area);
-
- /* compute derivatives */
- VecCopyf(Ps, v1->co);
- VecMulf(Ps, (v2->uv[1] - v3->uv[1]));
-
- VecCopyf(tmp, v2->co);
- VecMulf(tmp, (v3->uv[1] - v1->uv[1]));
- VecAddf(Ps, Ps, tmp);
-
- VecCopyf(tmp, v3->co);
- VecMulf(tmp, (v1->uv[1] - v2->uv[1]));
- VecAddf(Ps, Ps, tmp);
-
- VecMulf(Ps, w);
-
- VecCopyf(Pt, v1->co);
- VecMulf(Pt, (v3->uv[0] - v2->uv[0]));
-
- VecCopyf(tmp, v2->co);
- VecMulf(tmp, (v1->uv[0] - v3->uv[0]));
- VecAddf(Pt, Pt, tmp);
-
- VecCopyf(tmp, v3->co);
- VecMulf(tmp, (v2->uv[0] - v1->uv[0]));
- VecAddf(Pt, Pt, tmp);
-
- VecMulf(Pt, w);
-
- /* Sander Tensor */
- a= Inpf(Ps, Ps);
- c= Inpf(Pt, Pt);
-
- T = sqrt(0.5f*(a + c));
- if (f->flag & PFACE_FILLED)
- T *= 0.2;
-
- return T;
-}
-
-static float p_stretch_compute_vertex(PVert *v)
-{
- PEdge *e = v->edge;
- float sum = 0.0f;
-
- do {
- sum += p_face_stretch(e->face);
- e = p_wheel_edge_next(e);
- } while (e && e != (v->edge));
-
- return sum;
-}
-
-static void p_chart_stretch_minimize(PChart *chart, RNG *rng)
-{
- PVert *v;
- PEdge *e;
- int j, nedges;
- float orig_stretch, low, stretch_low, high, stretch_high, mid, stretch;
- float orig_uv[2], dir[2], random_angle, trusted_radius;
-
- for(v=chart->verts; v; v=v->nextlink) {
- if((v->flag & PVERT_PIN) || !(v->flag & PVERT_SELECT))
- continue;
-
- orig_stretch = p_stretch_compute_vertex(v);
- orig_uv[0] = v->uv[0];
- orig_uv[1] = v->uv[1];
-
- /* move vertex in a random direction */
- trusted_radius = 0.0f;
- nedges = 0;
- e = v->edge;
-
- do {
- trusted_radius += p_edge_uv_length(e);
- nedges++;
-
- e = p_wheel_edge_next(e);
- } while (e && e != (v->edge));
-
- trusted_radius /= 2 * nedges;
-
- random_angle = rng_getFloat(rng) * 2.0 * M_PI;
- dir[0] = trusted_radius * cos(random_angle);
- dir[1] = trusted_radius * sin(random_angle);
-
- /* calculate old and new stretch */
- low = 0;
- stretch_low = orig_stretch;
-
- Vec2Addf(v->uv, orig_uv, dir);
- high = 1;
- stretch = stretch_high = p_stretch_compute_vertex(v);
-
- /* binary search for lowest stretch position */
- for (j = 0; j < P_STRETCH_ITER; j++) {
- mid = 0.5 * (low + high);
- v->uv[0]= orig_uv[0] + mid*dir[0];
- v->uv[1]= orig_uv[1] + mid*dir[1];
- stretch = p_stretch_compute_vertex(v);
-
- if (stretch_low < stretch_high) {
- high = mid;
- stretch_high = stretch;
- }
- else {
- low = mid;
- stretch_low = stretch;
- }
- }
-
- /* no luck, stretch has increased, reset to old values */
- if(stretch >= orig_stretch)
- Vec2Copyf(v->uv, orig_uv);
- }
-}
-
-/* Minimum area enclosing rectangle for packing */
-
-static int p_compare_geometric_uv(const void *a, const void *b)
-{
- PVert *v1 = *(PVert**)a;
- PVert *v2 = *(PVert**)b;
-
- if (v1->uv[0] < v2->uv[0])
- return -1;
- else if (v1->uv[0] == v2->uv[0]) {
- if (v1->uv[1] < v2->uv[1])
- return -1;
- else if (v1->uv[1] == v2->uv[1])
- return 0;
- else
- return 1;
- }
- else
- return 1;
-}
-
-static PBool p_chart_convex_hull(PChart *chart, PVert ***verts, int *nverts, int *right)
-{
- /* Graham algorithm, taken from:
- * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117225 */
-
- PEdge *be, *e;
- int npoints = 0, i, ulen, llen;
- PVert **U, **L, **points, **p;
-
- p_chart_boundaries(chart, NULL, &be);
-
- if (!be)
- return P_FALSE;
-
- e = be;
- do {
- npoints++;
- e = p_boundary_edge_next(e);
- } while(e != be);
-
- p = points = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints*2, "PCHullpoints");
- U = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints, "PCHullU");
- L = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints, "PCHullL");
-
- e = be;
- do {
- *p = e->vert;
- p++;
- e = p_boundary_edge_next(e);
- } while(e != be);
-
- qsort(points, npoints, sizeof(PVert*), p_compare_geometric_uv);
-
- ulen = llen = 0;
- for (p=points, i = 0; i < npoints; i++, p++) {
- while ((ulen > 1) && (p_area_signed(U[ulen-2]->uv, (*p)->uv, U[ulen-1]->uv) <= 0))
- ulen--;
- while ((llen > 1) && (p_area_signed(L[llen-2]->uv, (*p)->uv, L[llen-1]->uv) >= 0))
- llen--;
-
- U[ulen] = *p;
- ulen++;
- L[llen] = *p;
- llen++;
- }
-
- npoints = 0;
- for (p=points, i = 0; i < ulen; i++, p++, npoints++)
- *p = U[i];
-
- /* the first and last point in L are left out, since they are also in U */
- for (i = llen-2; i > 0; i--, p++, npoints++)
- *p = L[i];
-
- *verts = points;
- *nverts = npoints;
- *right = ulen - 1;
-
- MEM_freeN(U);
- MEM_freeN(L);
-
- return P_TRUE;
-}
-
-static float p_rectangle_area(float *p1, float *dir, float *p2, float *p3, float *p4)
-{
- /* given 4 points on the rectangle edges and the direction of on edge,
- compute the area of the rectangle */
-
- float orthodir[2], corner1[2], corner2[2], corner3[2];
-
- orthodir[0] = dir[1];
- orthodir[1] = -dir[0];
-
- if (!p_intersect_line_2d_dir(p1, dir, p2, orthodir, corner1))
- return 1e10;
-
- if (!p_intersect_line_2d_dir(p1, dir, p4, orthodir, corner2))
- return 1e10;
-
- if (!p_intersect_line_2d_dir(p3, dir, p4, orthodir, corner3))
- return 1e10;
-
- return Vec2Lenf(corner1, corner2)*Vec2Lenf(corner2, corner3);
-}
-
-static float p_chart_minimum_area_angle(PChart *chart)
-{
- /* minimum area enclosing rectangle with rotating calipers, info:
- * http://cgm.cs.mcgill.ca/~orm/maer.html */
-
- float rotated, minarea, minangle, area, len;
- float *angles, miny, maxy, v[2], a[4], mina;
- int npoints, right, mini, maxi, i, idx[4], nextidx;
- PVert **points, *p1, *p2, *p3, *p4, *p1n;
-
- /* compute convex hull */
- if (!p_chart_convex_hull(chart, &points, &npoints, &right))
- return 0.0;
-
- /* find left/top/right/bottom points, and compute angle for each point */
- angles = MEM_mallocN(sizeof(float)*npoints, "PMinAreaAngles");
-
- mini = maxi = 0;
- miny = 1e10;
- maxy = -1e10;
-
- for (i = 0; i < npoints; i++) {
- p1 = (i == 0)? points[npoints-1]: points[i-1];
- p2 = points[i];
- p3 = (i == npoints-1)? points[0]: points[i+1];
-
- angles[i] = M_PI - p_vec2_angle(p1->uv, p2->uv, p3->uv);
-
- if (points[i]->uv[1] < miny) {
- miny = points[i]->uv[1];
- mini = i;
- }
- if (points[i]->uv[1] > maxy) {
- maxy = points[i]->uv[1];
- maxi = i;
- }
- }
-
- /* left, top, right, bottom */
- idx[0] = 0;
- idx[1] = maxi;
- idx[2] = right;
- idx[3] = mini;
-
- v[0] = points[idx[0]]->uv[0];
- v[1] = points[idx[0]]->uv[1] + 1.0f;
- a[0] = p_vec2_angle(points[(idx[0]+1)%npoints]->uv, points[idx[0]]->uv, v);
-
- v[0] = points[idx[1]]->uv[0] + 1.0f;
- v[1] = points[idx[1]]->uv[1];
- a[1] = p_vec2_angle(points[(idx[1]+1)%npoints]->uv, points[idx[1]]->uv, v);
-
- v[0] = points[idx[2]]->uv[0];
- v[1] = points[idx[2]]->uv[1] - 1.0f;
- a[2] = p_vec2_angle(points[(idx[2]+1)%npoints]->uv, points[idx[2]]->uv, v);
-
- v[0] = points[idx[3]]->uv[0] - 1.0f;
- v[1] = points[idx[3]]->uv[1];
- a[3] = p_vec2_angle(points[(idx[3]+1)%npoints]->uv, points[idx[3]]->uv, v);
-
- /* 4 rotating calipers */
-
- rotated = 0.0;
- minarea = 1e10;
- minangle = 0.0;
-
- while (rotated <= M_PI/2) { /* INVESTIGATE: how far to rotate? */
- /* rotate with the smallest angle */
- mini = 0;
- mina = 1e10;
-
- for (i = 0; i < 4; i++)
- if (a[i] < mina) {
- mina = a[i];
- mini = i;
- }
-
- rotated += mina;
- nextidx = (idx[mini]+1)%npoints;
-
- a[mini] = angles[nextidx];
- a[(mini+1)%4] = a[(mini+1)%4] - mina;
- a[(mini+2)%4] = a[(mini+2)%4] - mina;
- a[(mini+3)%4] = a[(mini+3)%4] - mina;
-
- /* compute area */
- p1 = points[idx[mini]];
- p1n = points[nextidx];
- p2 = points[idx[(mini+1)%4]];
- p3 = points[idx[(mini+2)%4]];
- p4 = points[idx[(mini+3)%4]];
-
- len = Vec2Lenf(p1->uv, p1n->uv);
-
- if (len > 0.0f) {
- len = 1.0/len;
- v[0] = (p1n->uv[0] - p1->uv[0])*len;
- v[1] = (p1n->uv[1] - p1->uv[1])*len;
-
- area = p_rectangle_area(p1->uv, v, p2->uv, p3->uv, p4->uv);
-
- /* remember smallest area */
- if (area < minarea) {
- minarea = area;
- minangle = rotated;
- }
- }
-
- idx[mini] = nextidx;
- }
-
- /* try keeping rotation as small as possible */
- if (minangle > M_PI/4)
- minangle -= M_PI/2;
-
- MEM_freeN(angles);
- MEM_freeN(points);
-
- return minangle;
-}
-
-static void p_chart_rotate_minimum_area(PChart *chart)
-{
- float angle = p_chart_minimum_area_angle(chart);
- float sine = sin(angle);
- float cosine = cos(angle);
- PVert *v;
-
- for (v = chart->verts; v; v=v->nextlink) {
- float oldu = v->uv[0], oldv = v->uv[1];
- v->uv[0] = cosine*oldu - sine*oldv;
- v->uv[1] = sine*oldu + cosine*oldv;
- }
-}
-
-/* Area Smoothing */
-
-/* 2d bsp tree for inverse mapping - that's a bit silly */
-
-typedef struct SmoothTriangle {
- float co1[2], co2[2], co3[2];
- float oco1[2], oco2[2], oco3[2];
-} SmoothTriangle;
-
-typedef struct SmoothNode {
- struct SmoothNode *c1, *c2;
- SmoothTriangle **tri;
- float split;
- int axis, ntri;
-} SmoothNode;
-
-static void p_barycentric_2d(float *v1, float *v2, float *v3, float *p, float *b)
-{
- float a[2], c[2], h[2], div;
-
- a[0] = v2[0] - v1[0];
- a[1] = v2[1] - v1[1];
- c[0] = v3[0] - v1[0];
- c[1] = v3[1] - v1[1];
-
- div = a[0]*c[1] - a[1]*c[0];
-
- if (div == 0.0f) {
- b[0] = 1.0f/3.0f;
- b[1] = 1.0f/3.0f;
- b[2] = 1.0f/3.0f;
- }
- else {
- h[0] = p[0] - v1[0];
- h[1] = p[1] - v1[1];
-
- div = 1.0f/div;
-
- b[1] = (h[0]*c[1] - h[1]*c[0])*div;
- b[2] = (a[0]*h[1] - a[1]*h[0])*div;
- b[0] = 1.0 - b[1] - b[2];
- }
-}
-
-static PBool p_triangle_inside(SmoothTriangle *t, float *co)
-{
- float b[3];
-
- p_barycentric_2d(t->co1, t->co2, t->co3, co, b);
-
- if ((b[0] >= 0.0) && (b[1] >= 0.0) && (b[2] >= 0.0f)) {
- co[0] = t->oco1[0]*b[0] + t->oco2[0]*b[1] + t->oco3[0]*b[2];
- co[1] = t->oco1[1]*b[0] + t->oco2[1]*b[1] + t->oco3[1]*b[2];
- return P_TRUE;
- }
-
- return P_FALSE;
-}
-
-static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, float *bmin, float *bmax, int depth)
-{
- SmoothNode *node = BLI_memarena_alloc(arena, sizeof *node);
- int axis, i, t1size = 0, t2size = 0;
- float split, mi, mx;
- SmoothTriangle **t1, **t2, *t;
-
- node->tri = tri;
- node->ntri = ntri;
-
- if (ntri <= 10 || depth >= 15)
- return node;
-
- t1 = MEM_mallocN(sizeof(SmoothTriangle)*ntri, "PNodeTri1");
- t2 = MEM_mallocN(sizeof(SmoothTriangle)*ntri, "PNodeTri1");
-
- axis = (bmax[0] - bmin[0] > bmax[1] - bmin[1])? 0: 1;
- split = 0.5f*(bmin[axis] + bmax[axis]);
-
- for (i = 0; i < ntri; i++) {
- t = tri[i];
-
- if ((t->co1[axis] <= split) || (t->co2[axis] <= split) || (t->co3[axis] <= split)) {
- t1[t1size] = t;
- t1size++;
- }
- if ((t->co1[axis] >= split) || (t->co2[axis] >= split) || (t->co3[axis] >= split)) {
- t2[t2size] = t;
- t2size++;
- }
- }
-
- if ((t1size == t2size) && (t1size == ntri)) {
- MEM_freeN(t1);
- MEM_freeN(t2);
- return node;
- }
-
- node->tri = NULL;
- node->ntri = 0;
- MEM_freeN(tri);
-
- node->axis = axis;
- node->split = split;
-
- mi = bmin[axis];
- mx = bmax[axis];
- bmax[axis] = split;
- node->c1 = p_node_new(arena, t1, t1size, bmin, bmax, depth+1);
-
- bmin[axis] = bmax[axis];
- bmax[axis] = mx;
- node->c2 = p_node_new(arena, t2, t2size, bmin, bmax, depth+1);
-
- return node;
-}
-
-static void p_node_delete(SmoothNode *node)
-{
- if (node->c1)
- p_node_delete(node->c1);
- if (node->c2)
- p_node_delete(node->c2);
- if (node->tri)
- MEM_freeN(node->tri);
-}
-
-static PBool p_node_intersect(SmoothNode *node, float *co)
-{
- int i;
-
- if (node->tri) {
- for (i = 0; i < node->ntri; i++)
- if (p_triangle_inside(node->tri[i], co))
- return P_TRUE;
-
- return P_FALSE;
- }
- else {
- if (co[node->axis] < node->split)
- return p_node_intersect(node->c1, co);
- else
- return p_node_intersect(node->c2, co);
- }
-
-}
-
-/* smooothing */
-
-static int p_compare_float(const void *a, const void *b)
-{
- if (*((float*)a) < *((float*)b))
- return -1;
- else if (*((float*)a) == *((float*)b))
- return 0;
- else
- return 1;
-}
-
-static float p_smooth_median_edge_length(PChart *chart)
-{
- PEdge *e;
- float *lengths = MEM_mallocN(sizeof(chart->edges)*chart->nedges, "PMedianLength");
- float median;
- int i;
-
- /* ok, so i'm lazy */
- for (i=0, e=chart->edges; e; e=e->nextlink, i++)
- lengths[i] = p_edge_length(e);
-
- qsort(lengths, i, sizeof(float), p_compare_float);
-
- median = lengths[i/2];
- MEM_freeN(lengths);
-
- return median;
-}
-
-static float p_smooth_distortion(PEdge *e, float avg2d, float avg3d)
-{
- float len2d = p_edge_uv_length(e)*avg3d;
- float len3d = p_edge_length(e)*avg2d;
-
- return (len3d == 0.0f)? 0.0f: len2d/len3d;
-}
-
-static void p_smooth(PChart *chart)
-{
- PEdge *e;
- PVert *v;
- PFace *f;
- int j, it2, maxiter2, it;
- int nedges = chart->nedges, nwheel, gridx, gridy;
- int edgesx, edgesy, nsize, esize, i, x, y, maxiter, totiter;
- float minv[2], maxv[2], median, invmedian, distortion, avglen2d, avglen3d;
- float center[2], dx, dy, *nodes, dlimit, d, *oldnodesx, *oldnodesy;
- float *nodesx, *nodesy, *hedges, *vedges, climit, moved, padding;
- SmoothTriangle *triangles, *t, *t2, **tri, **trip;
- SmoothNode *root;
- MemArena *arena;
-
- if (nedges == 0)
- return;
-
- p_chart_uv_bbox(chart, minv, maxv);
- median = p_smooth_median_edge_length(chart)*0.10f;
-
- if (median == 0.0)
- return;
-
- invmedian = 1.0/median;
-
- /* compute edge distortion */
- distortion = 0.0;
- avglen2d = avglen3d = 0.0;
-
- for (e=chart->edges; e; e=e->nextlink) {
- avglen2d += p_edge_uv_length(e);
- avglen3d += p_edge_length(e);
- }
-
- avglen2d /= nedges;
- avglen3d /= nedges;
-
- for (v=chart->verts; v; v=v->nextlink) {
- v->u.distortion = 0.0;
- nwheel = 0;
-
- e = v->edge;
- do {
- v->u.distortion += p_smooth_distortion(e, avglen2d, avglen3d);
- nwheel++;
-
- e = e->next->next->pair;
- } while(e && (e != v->edge));
-
- v->u.distortion /= nwheel;
- }
-
- /* need to do excessive grid size checking still */
- center[0] = 0.5f*(minv[0] + maxv[0]);
- center[1] = 0.5f*(minv[1] + maxv[1]);
-
- dx = 0.5f*(maxv[0] - minv[0]);
- dy = 0.5f*(maxv[1] - minv[1]);
-
- padding = 0.15f;
- dx += padding*dx + 2.0f*median;
- dy += padding*dy + 2.0f*median;
-
- gridx = (int)(dx*invmedian);
- gridy = (int)(dy*invmedian);
-
- minv[0] = center[0] - median*gridx;
- minv[1] = center[1] - median*gridy;
- maxv[0] = center[0] + median*gridx;
- maxv[1] = center[1] + median*gridy;
-
- /* create grid */
- gridx = gridx*2 + 1;
- gridy = gridy*2 + 1;
-
- if ((gridx <= 2) || (gridy <= 2))
- return;
-
- edgesx = gridx-1;
- edgesy = gridy-1;
- nsize = gridx*gridy;
- esize = edgesx*edgesy;
-
- nodes = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodes");
- nodesx = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodesX");
- nodesy = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodesY");
- oldnodesx = MEM_mallocN(sizeof(float)*nsize, "PSmoothOldNodesX");
- oldnodesy = MEM_mallocN(sizeof(float)*nsize, "PSmoothOldNodesY");
- hedges = MEM_mallocN(sizeof(float)*esize, "PSmoothHEdges");
- vedges = MEM_mallocN(sizeof(float)*esize, "PSmoothVEdges");
-
- if (!nodes || !nodesx || !nodesy || !oldnodesx || !oldnodesy || !hedges || !vedges) {
- if (nodes) MEM_freeN(nodes);
- if (nodesx) MEM_freeN(nodesx);
- if (nodesy) MEM_freeN(nodesy);
- if (oldnodesx) MEM_freeN(oldnodesx);
- if (oldnodesy) MEM_freeN(oldnodesy);
- if (hedges) MEM_freeN(hedges);
- if (vedges) MEM_freeN(vedges);
-
- error("Not enough memory for area smoothing grid.");
- return;
- }
-
- for (x = 0; x < gridx; x++) {
- for (y = 0; y < gridy; y++) {
- i = x + y*gridx;
-
- nodesx[i] = minv[0] + median*x;
- nodesy[i] = minv[1] + median*y;
-
- nodes[i] = 1.0f;
- }
- }
-
- /* embed in grid */
- for (f=chart->faces; f; f=f->nextlink) {
- PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;
- float fmin[2], fmax[2];
- int bx1, by1, bx2, by2;
-
- INIT_MINMAX2(fmin, fmax);
-
- DO_MINMAX2(e1->vert->uv, fmin, fmax);
- DO_MINMAX2(e2->vert->uv, fmin, fmax);
- DO_MINMAX2(e3->vert->uv, fmin, fmax);
-
- bx1 = (int)((fmin[0] - minv[0])*invmedian);
- by1 = (int)((fmin[1] - minv[1])*invmedian);
- bx2 = (int)((fmax[0] - minv[0])*invmedian + 2);
- by2 = (int)((fmax[1] - minv[1])*invmedian + 2);
-
- for (x = bx1; x < bx2; x++) {
- for (y = by1; y < by2; y++) {
- float p[2], b[3];
-
- i = x + y*gridx;
-
- p[0] = nodesx[i];
- p[1] = nodesy[i];
-
- p_barycentric_2d(e1->vert->uv, e2->vert->uv, e3->vert->uv, p, b);
-
- if ((b[0] > 0.0) && (b[1] > 0.0) && (b[2] > 0.0)) {
- nodes[i] = e1->vert->u.distortion*b[0];
- nodes[i] += e2->vert->u.distortion*b[1];
- nodes[i] += e3->vert->u.distortion*b[2];
- }
- }
- }
- }
-
- /* smooth the grid */
- maxiter = 10;
- totiter = 0;
- climit = 0.00001f*nsize;
-
- for (it = 0; it < maxiter; it++) {
- moved = 0.0f;
-
- for (x = 0; x < edgesx; x++) {
- for (y = 0; y < edgesy; y++) {
- i = x + y*gridx;
- j = x + y*edgesx;
-
- hedges[j] = (nodes[i] + nodes[i+1])*0.5f;
- vedges[j] = (nodes[i] + nodes[i+gridx])*0.5f;
-
- /* we do *inverse* mapping */
- hedges[j] = 1.0f/hedges[j];
- vedges[j] = 1.0f/vedges[j];
- }
- }
-
- maxiter2 = 50;
- dlimit = 0.0001f;
-
- for (it2 = 0; it2 < maxiter2; it2++) {
- d = 0.0f;
- totiter += 1;
-
- memcpy(oldnodesx, nodesx, sizeof(float)*nsize);
- memcpy(oldnodesy, nodesy, sizeof(float)*nsize);
-
- for (x=1; x < gridx-1; x++) {
- for (y=1; y < gridy-1; y++) {
- float p[2], oldp[2], sum1, sum2, diff[2], length;
-
- i = x + gridx*y;
- j = x + edgesx*y;
-
- oldp[0] = oldnodesx[i];
- oldp[1] = oldnodesy[i];
-
- sum1 = hedges[j-1]*oldnodesx[i-1];
- sum1 += hedges[j]*oldnodesx[i+1];
- sum1 += vedges[j-edgesx]*oldnodesx[i-gridx];
- sum1 += vedges[j]*oldnodesx[i+gridx];
-
- sum2 = hedges[j-1];
- sum2 += hedges[j];
- sum2 += vedges[j-edgesx];
- sum2 += vedges[j];
-
- nodesx[i] = sum1/sum2;
-
- sum1 = hedges[j-1]*oldnodesy[i-1];
- sum1 += hedges[j]*oldnodesy[i+1];
- sum1 += vedges[j-edgesx]*oldnodesy[i-gridx];
- sum1 += vedges[j]*oldnodesy[i+gridx];
-
- nodesy[i] = sum1/sum2;
-
- p[0] = nodesx[i];
- p[1] = nodesy[i];
-
- diff[0] = p[0] - oldp[0];
- diff[1] = p[1] - oldp[1];
-
- length = sqrt(diff[0]*diff[0] + diff[1]*diff[1]);
- d = MAX2(d, length);
- moved += length;
- }
- }
-
- if (d < dlimit)
- break;
- }
-
- if (moved < climit)
- break;
- }
-
- MEM_freeN(oldnodesx);
- MEM_freeN(oldnodesy);
- MEM_freeN(hedges);
- MEM_freeN(vedges);
-
- /* create bsp */
- t = triangles = MEM_mallocN(sizeof(SmoothTriangle)*esize*2, "PSmoothTris");
- trip = tri = MEM_mallocN(sizeof(SmoothTriangle*)*esize*2, "PSmoothTriP");
-
- if (!triangles || !tri) {
- MEM_freeN(nodes);
- MEM_freeN(nodesx);
- MEM_freeN(nodesy);
-
- if (triangles) MEM_freeN(triangles);
- if (tri) MEM_freeN(tri);
-
- error("Not enough memory for area smoothing grid.");
- return;
- }
-
- for (x = 0; x < edgesx; x++) {
- for (y = 0; y < edgesy; y++) {
- i = x + y*gridx;
-
- t->co1[0] = nodesx[i];
- t->co1[1] = nodesy[i];
-
- t->co2[0] = nodesx[i+1];
- t->co2[1] = nodesy[i+1];
-
- t->co3[0] = nodesx[i+gridx];
- t->co3[1] = nodesy[i+gridx];
-
- t->oco1[0] = minv[0] + x*median;
- t->oco1[1] = minv[1] + y*median;
-
- t->oco2[0] = minv[0] + (x+1)*median;
- t->oco2[1] = minv[1] + y*median;
-
- t->oco3[0] = minv[0] + x*median;
- t->oco3[1] = minv[1] + (y+1)*median;
-
- t2 = t+1;
-
- t2->co1[0] = nodesx[i+gridx+1];
- t2->co1[1] = nodesy[i+gridx+1];
-
- t2->oco1[0] = minv[0] + (x+1)*median;
- t2->oco1[1] = minv[1] + (y+1)*median;
-
- t2->co2[0] = t->co2[0]; t2->co2[1] = t->co2[1];
- t2->oco2[0] = t->oco2[0]; t2->oco2[1] = t->oco2[1];
-
- t2->co3[0] = t->co3[0]; t2->co3[1] = t->co3[1];
- t2->oco3[0] = t->oco3[0]; t2->oco3[1] = t->oco3[1];
-
- *trip = t; trip++; t++;
- *trip = t; trip++; t++;
- }
- }
-
- MEM_freeN(nodes);
- MEM_freeN(nodesx);
- MEM_freeN(nodesy);
-
- arena = BLI_memarena_new(1<<16);
- root = p_node_new(arena, tri, esize*2, minv, maxv, 0);
-
- for (v=chart->verts; v; v=v->nextlink)
- if (!p_node_intersect(root, v->uv))
- param_warning("area smoothing error: couldn't find mapping triangle\n");
-
- p_node_delete(root);
- BLI_memarena_free(arena);
-
- MEM_freeN(triangles);
-}
-
-/* Exported */
-
-ParamHandle *param_construct_begin()
-{
- PHandle *handle = MEM_callocN(sizeof*handle, "PHandle");
- handle->construction_chart = p_chart_new(handle);
- handle->state = PHANDLE_STATE_ALLOCATED;
- handle->arena = BLI_memarena_new((1<<16));
- handle->aspx = 1.0f;
- handle->aspy = 1.0f;
-
- handle->hash_verts = phash_new((PHashLink**)&handle->construction_chart->verts, 1);
- handle->hash_edges = phash_new((PHashLink**)&handle->construction_chart->edges, 1);
- handle->hash_faces = phash_new((PHashLink**)&handle->construction_chart->faces, 1);
-
- return (ParamHandle*)handle;
-}
-
-void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy)
-{
- PHandle *phandle = (PHandle*)handle;
-
- phandle->aspx = aspx;
- phandle->aspy = aspy;
-}
-
-void param_delete(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- int i;
-
- param_assert((phandle->state == PHANDLE_STATE_ALLOCATED) ||
- (phandle->state == PHANDLE_STATE_CONSTRUCTED));
-
- for (i = 0; i < phandle->ncharts; i++)
- p_chart_delete(phandle->charts[i]);
-
- if (phandle->charts)
- MEM_freeN(phandle->charts);
-
- if (phandle->construction_chart) {
- p_chart_delete(phandle->construction_chart);
-
- phash_delete(phandle->hash_verts);
- phash_delete(phandle->hash_edges);
- phash_delete(phandle->hash_faces);
- }
-
- BLI_memarena_free(phandle->arena);
- MEM_freeN(phandle);
-}
-
-void param_face_add(ParamHandle *handle, ParamKey key, int nverts,
- ParamKey *vkeys, float **co, float **uv,
- ParamBool *pin, ParamBool *select)
-{
- PHandle *phandle = (PHandle*)handle;
-
- param_assert(phash_lookup(phandle->hash_faces, key) == NULL);
- param_assert(phandle->state == PHANDLE_STATE_ALLOCATED);
- param_assert((nverts == 3) || (nverts == 4));
-
- if (nverts == 4) {
- if (p_quad_split_direction(phandle, co, vkeys)) {
- p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 2, pin, select);
- p_face_add_construct(phandle, key, vkeys, co, uv, 0, 2, 3, pin, select);
- }
- else {
- p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 3, pin, select);
- p_face_add_construct(phandle, key, vkeys, co, uv, 1, 2, 3, pin, select);
- }
- }
- else
- p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 2, pin, select);
-}
-
-void param_edge_set_seam(ParamHandle *handle, ParamKey *vkeys)
-{
- PHandle *phandle = (PHandle*)handle;
- PEdge *e;
-
- param_assert(phandle->state == PHANDLE_STATE_ALLOCATED);
-
- e = p_edge_lookup(phandle, vkeys);
- if (e)
- e->flag |= PEDGE_SEAM;
-}
-
-void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart = phandle->construction_chart;
- int i, j, nboundaries = 0;
- PEdge *outer;
-
- param_assert(phandle->state == PHANDLE_STATE_ALLOCATED);
-
- phandle->ncharts = p_connect_pairs(phandle, impl);
- phandle->charts = p_split_charts(phandle, chart, phandle->ncharts);
-
- p_chart_delete(phandle->construction_chart);
- phandle->construction_chart = NULL;
-
- phash_delete(phandle->hash_verts);
- phash_delete(phandle->hash_edges);
- phash_delete(phandle->hash_faces);
- phandle->hash_verts = phandle->hash_edges = phandle->hash_faces = NULL;
-
- for (i = j = 0; i < phandle->ncharts; i++) {
- PVert *v;
- chart = phandle->charts[i];
-
- p_chart_boundaries(chart, &nboundaries, &outer);
-
- if (!impl && nboundaries == 0) {
- p_chart_delete(chart);
- continue;
- }
-
- phandle->charts[j] = chart;
- j++;
-
- if (fill && (nboundaries > 1))
- p_chart_fill_boundaries(chart, outer);
-
- for (v=chart->verts; v; v=v->nextlink)
- p_vert_load_pin_select_uvs(handle, v);
- }
-
- phandle->ncharts = j;
-
- phandle->state = PHANDLE_STATE_CONSTRUCTED;
-}
-
-void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf)
-{
- PHandle *phandle = (PHandle*)handle;
- PFace *f;
- int i;
-
- param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED);
- phandle->state = PHANDLE_STATE_LSCM;
-
- for (i = 0; i < phandle->ncharts; i++) {
- for (f=phandle->charts[i]->faces; f; f=f->nextlink)
- p_face_backup_uvs(f);
- p_chart_lscm_begin(phandle->charts[i], live, abf);
- }
-}
-
-void param_lscm_solve(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- int i;
- PBool result;
-
- param_assert(phandle->state == PHANDLE_STATE_LSCM);
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
-
- if (chart->u.lscm.context) {
- result = p_chart_lscm_solve(phandle, chart);
-
- if (result && !(chart->flag & PCHART_NOPACK))
- p_chart_rotate_minimum_area(chart);
-
- if (!result || (chart->u.lscm.pin1))
- p_chart_lscm_end(chart);
- }
- }
-}
-
-void param_lscm_end(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- int i;
-
- param_assert(phandle->state == PHANDLE_STATE_LSCM);
-
- for (i = 0; i < phandle->ncharts; i++) {
- p_chart_lscm_end(phandle->charts[i]);
-#if 0
- p_chart_complexify(phandle->charts[i]);
-#endif
- }
-
- phandle->state = PHANDLE_STATE_CONSTRUCTED;
-}
-
-void param_stretch_begin(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- PVert *v;
- PFace *f;
- int i;
-
- param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED);
- phandle->state = PHANDLE_STATE_STRETCH;
-
- phandle->rng = rng_new(31415926);
- phandle->blend = 0.0f;
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
-
- for (v=chart->verts; v; v=v->nextlink)
- v->flag &= ~PVERT_PIN; /* don't use user-defined pins */
-
- p_stretch_pin_boundary(chart);
-
- for (f=chart->faces; f; f=f->nextlink) {
- p_face_backup_uvs(f);
- f->u.area3d = p_face_area(f);
- }
- }
-}
-
-void param_stretch_blend(ParamHandle *handle, float blend)
-{
- PHandle *phandle = (PHandle*)handle;
-
- param_assert(phandle->state == PHANDLE_STATE_STRETCH);
- phandle->blend = blend;
-}
-
-void param_stretch_iter(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- int i;
-
- param_assert(phandle->state == PHANDLE_STATE_STRETCH);
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
- p_chart_stretch_minimize(chart, phandle->rng);
- }
-}
-
-void param_stretch_end(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
-
- param_assert(phandle->state == PHANDLE_STATE_STRETCH);
- phandle->state = PHANDLE_STATE_CONSTRUCTED;
-
- rng_free(phandle->rng);
- phandle->rng = NULL;
-}
-
-void param_smooth_area(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- int i;
-
- param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED);
-
- for (i = 0; i < phandle->ncharts; i++) {
- PChart *chart = phandle->charts[i];
- PVert *v;
-
- for (v=chart->verts; v; v=v->nextlink)
- v->flag &= ~PVERT_PIN;
-
- p_smooth(chart);
- }
-}
-
-void param_pack(ParamHandle *handle)
-{
- /* box packing variables */
- boxPack *boxarray, *box;
- float tot_width, tot_height, scale;
-
- PChart *chart;
- int i, unpacked=0;
- float trans[2];
-
- PHandle *phandle = (PHandle*)handle;
-
- if (phandle->ncharts == 0)
- return;
-
- if(phandle->aspx != phandle->aspy)
- param_scale(handle, 1.0f/phandle->aspx, 1.0f/phandle->aspy);
-
- /* we may not use all these boxes */
- boxarray = MEM_mallocN( phandle->ncharts*sizeof(boxPack), "boxPack box");
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
-
- if (chart->flag & PCHART_NOPACK) {
- unpacked++;
- continue;
- }
-
- box = boxarray+(i-unpacked);
-
- p_chart_uv_bbox(chart, trans, chart->u.pack.size);
-
- trans[0] = -trans[0];
- trans[1] = -trans[1];
-
- p_chart_uv_translate(chart, trans);
-
- box->w = chart->u.pack.size[0] + trans[0];
- box->h = chart->u.pack.size[1] + trans[1];
- box->index = i; /* warning this index skips PCHART_NOPACK boxes */
- }
-
- boxPack2D(boxarray, phandle->ncharts-unpacked, &tot_width, &tot_height);
-
- if (tot_height>tot_width)
- scale = 1.0/tot_height;
- else
- scale = 1.0/tot_width;
-
- for (i = 0; i < phandle->ncharts-unpacked; i++) {
- box = boxarray+i;
- trans[0] = box->x;
- trans[1] = box->y;
-
- chart = phandle->charts[box->index];
- p_chart_uv_translate(chart, trans);
- p_chart_uv_scale(chart, scale);
- }
- MEM_freeN(boxarray);
-
- if(phandle->aspx != phandle->aspy)
- param_scale(handle, phandle->aspx, phandle->aspy);
-}
-
-void param_average(ParamHandle *handle)
-{
- PChart *chart;
- int i;
- float tot_uvarea = 0.0f, tot_facearea = 0.0f;
- float tot_fac, fac;
- float minv[2], maxv[2], trans[2];
- PHandle *phandle = (PHandle*)handle;
-
- if (phandle->ncharts == 0)
- return;
-
- for (i = 0; i < phandle->ncharts; i++) {
- PFace *f;
- chart = phandle->charts[i];
-
- chart->u.pack.area = 0.0f; /* 3d area */
- chart->u.pack.rescale = 0.0f; /* UV area, abusing rescale for tmp storage, oh well :/ */
-
- for (f=chart->faces; f; f=f->nextlink) {
- chart->u.pack.area += p_face_area(f);
- chart->u.pack.rescale += fabs(p_face_uv_area_signed(f));
- }
-
- tot_facearea += chart->u.pack.area;
- tot_uvarea += chart->u.pack.rescale;
- }
-
- if (tot_facearea == tot_uvarea || tot_facearea==0.0f || tot_uvarea==0.0f) {
- /* nothing to do */
- return;
- }
-
- tot_fac = tot_facearea/tot_uvarea;
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
- if (chart->u.pack.area != 0.0f && chart->u.pack.rescale != 0.0f) {
- fac = chart->u.pack.area / chart->u.pack.rescale;
-
- /* Get the island center */
- p_chart_uv_bbox(chart, minv, maxv);
- trans[0] = (minv[0] + maxv[0]) /-2.0f;
- trans[1] = (minv[1] + maxv[1]) /-2.0f;
-
- /* Move center to 0,0 */
- p_chart_uv_translate(chart, trans);
- p_chart_uv_scale(chart, sqrt(fac / tot_fac));
-
- /* Move to original center */
- trans[0] = -trans[0];
- trans[1] = -trans[1];
- p_chart_uv_translate(chart, trans);
- }
- }
-}
-
-void param_scale(ParamHandle *handle, float x, float y)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- int i;
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
- p_chart_uv_scale_xy(chart, x, y);
- }
-}
-
-void param_flush(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- int i;
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
-
- if ((phandle->state == PHANDLE_STATE_LSCM) && !chart->u.lscm.context)
- continue;
-
- if (phandle->blend == 0.0f)
- p_flush_uvs(phandle, chart);
- else
- p_flush_uvs_blend(phandle, chart, phandle->blend);
- }
-}
-
-void param_flush_restore(ParamHandle *handle)
-{
- PHandle *phandle = (PHandle*)handle;
- PChart *chart;
- PFace *f;
- int i;
-
- for (i = 0; i < phandle->ncharts; i++) {
- chart = phandle->charts[i];
-
- for (f=chart->faces; f; f=f->nextlink)
- p_face_restore_uvs(f);
- }
-}
-
diff --git a/source/blender/src/parametrizer.h b/source/blender/src/parametrizer.h
deleted file mode 100644
index c468b8d62c5..00000000000
--- a/source/blender/src/parametrizer.h
+++ /dev/null
@@ -1,97 +0,0 @@
-
-#ifndef __PARAMETRIZER_H__
-#define __PARAMETRIZER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-typedef void ParamHandle; /* handle to a set of charts */
-typedef intptr_t ParamKey; /* (hash) key for identifying verts and faces */
-typedef enum ParamBool {
- PARAM_TRUE = 1,
- PARAM_FALSE = 0
-} ParamBool;
-
-/* Chart construction:
- -------------------
- - faces and seams may only be added between construct_{begin|end}
- - the pointers to co and uv are stored, rather than being copied
- - vertices are implicitly created
- - in construct_end the mesh will be split up according to the seams
- - the resulting charts must be:
- - manifold, connected, open (at least one boundary loop)
- - output will be written to the uv pointers
-*/
-
-ParamHandle *param_construct_begin();
-
-void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy);
-
-void param_face_add(ParamHandle *handle,
- ParamKey key,
- int nverts,
- ParamKey *vkeys,
- float **co,
- float **uv,
- ParamBool *pin,
- ParamBool *select);
-
-void param_edge_set_seam(ParamHandle *handle,
- ParamKey *vkeys);
-
-void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl);
-void param_delete(ParamHandle *chart);
-
-/* Least Squares Conformal Maps:
- -----------------------------
- - charts with less than two pinned vertices are assigned 2 pins
- - lscm is divided in three steps:
- - begin: compute matrix and it's factorization (expensive)
- - solve using pinned coordinates (cheap)
- - end: clean up
- - uv coordinates are allowed to change within begin/end, for
- quick re-solving
-*/
-
-void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf);
-void param_lscm_solve(ParamHandle *handle);
-void param_lscm_end(ParamHandle *handle);
-
-/* Stretch */
-
-void param_stretch_begin(ParamHandle *handle);
-void param_stretch_blend(ParamHandle *handle, float blend);
-void param_stretch_iter(ParamHandle *handle);
-void param_stretch_end(ParamHandle *handle);
-
-/* Area Smooth */
-
-void param_smooth_area(ParamHandle *handle);
-
-/* Packing */
-
-void param_pack(ParamHandle *handle);
-
-/* Average area for all charts */
-
-void param_average(ParamHandle *handle);
-
-/* Simple x,y scale */
-
-void param_scale(ParamHandle *handle, float x, float y);
-
-/* Flushing */
-
-void param_flush(ParamHandle *handle);
-void param_flush_restore(ParamHandle *handle);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*__PARAMETRIZER_H__*/
-
diff --git a/source/blender/src/parametrizer_intern.h b/source/blender/src/parametrizer_intern.h
deleted file mode 100644
index bc38cb4bc0f..00000000000
--- a/source/blender/src/parametrizer_intern.h
+++ /dev/null
@@ -1,194 +0,0 @@
-
-#ifndef __PARAMETRIZER_INTERN_H__
-#define __PARAMETRIZER_INTERN_H__
-
-/* Utils */
-
-#if 0
- #define param_assert(condition);
- #define param_warning(message);
- #define param_test_equals_ptr(condition);
- #define param_test_equals_int(condition);
-#else
- #define param_assert(condition) \
- if (!(condition)) \
- { /*printf("Assertion %s:%d\n", __FILE__, __LINE__); abort();*/ }
- #define param_warning(message) \
- { /*printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message);*/ }
- #define param_test_equals_ptr(str, a, b) \
- if (a != b) \
- { /*printf("Equals %s => %p != %p\n", str, a, b);*/ };
- #define param_test_equals_int(str, a, b) \
- if (a != b) \
- { /*printf("Equals %s => %d != %d\n", str, a, b);*/ };
-#endif
-
-typedef enum PBool {
- P_TRUE = 1,
- P_FALSE = 0
-} PBool;
-
-/* Special Purpose Hash */
-
-typedef intptr_t PHashKey;
-
-typedef struct PHashLink {
- struct PHashLink *next;
- PHashKey key;
-} PHashLink;
-
-typedef struct PHash {
- PHashLink **list;
- PHashLink **buckets;
- int size, cursize, cursize_id;
-} PHash;
-
-
-
-struct PVert;
-struct PEdge;
-struct PFace;
-struct PChart;
-struct PHandle;
-
-/* Simplices */
-
-typedef struct PVert {
- struct PVert *nextlink;
-
- union PVertUnion {
- PHashKey key; /* construct */
- int id; /* abf/lscm matrix index */
- float distortion; /* area smoothing */
- HeapNode *heaplink; /* edge collapsing */
- } u;
-
- struct PEdge *edge;
- float *co;
- float uv[2];
- unsigned char flag;
-
-} PVert;
-
-typedef struct PEdge {
- struct PEdge *nextlink;
-
- union PEdgeUnion {
- PHashKey key; /* construct */
- int id; /* abf matrix index */
- HeapNode *heaplink; /* fill holes */
- struct PEdge *nextcollapse; /* simplification */
- } u;
-
- struct PVert *vert;
- struct PEdge *pair;
- struct PEdge *next;
- struct PFace *face;
- float *orig_uv, old_uv[2];
- unsigned short flag;
-
-} PEdge;
-
-typedef struct PFace {
- struct PFace *nextlink;
-
- union PFaceUnion {
- PHashKey key; /* construct */
- int chart; /* construct splitting*/
- float area3d; /* stretch */
- int id; /* abf matrix index */
- } u;
-
- struct PEdge *edge;
- unsigned char flag;
-
-} PFace;
-
-enum PVertFlag {
- PVERT_PIN = 1,
- PVERT_SELECT = 2,
- PVERT_INTERIOR = 4,
- PVERT_COLLAPSE = 8,
- PVERT_SPLIT = 16
-};
-
-enum PEdgeFlag {
- PEDGE_SEAM = 1,
- PEDGE_VERTEX_SPLIT = 2,
- PEDGE_PIN = 4,
- PEDGE_SELECT = 8,
- PEDGE_DONE = 16,
- PEDGE_FILLED = 32,
- PEDGE_COLLAPSE = 64,
- PEDGE_COLLAPSE_EDGE = 128,
- PEDGE_COLLAPSE_PAIR = 256
-};
-
-/* for flipping faces */
-#define PEDGE_VERTEX_FLAGS (PEDGE_PIN)
-
-enum PFaceFlag {
- PFACE_CONNECTED = 1,
- PFACE_FILLED = 2,
- PFACE_COLLAPSE = 4
-};
-
-/* Chart */
-
-typedef struct PChart {
- PVert *verts;
- PEdge *edges;
- PFace *faces;
- int nverts, nedges, nfaces;
-
- PVert *collapsed_verts;
- PEdge *collapsed_edges;
- PFace *collapsed_faces;
-
- union PChartUnion {
- struct PChartLscm {
- NLContext context;
- float *abf_alpha;
- PVert *pin1, *pin2;
- } lscm;
- struct PChartPack {
- float rescale, area;
- float size[2], trans[2];
- } pack;
- } u;
-
- unsigned char flag;
- struct PHandle *handle;
-} PChart;
-
-enum PChartFlag {
- PCHART_NOPACK = 1
-};
-
-enum PHandleState {
- PHANDLE_STATE_ALLOCATED,
- PHANDLE_STATE_CONSTRUCTED,
- PHANDLE_STATE_LSCM,
- PHANDLE_STATE_STRETCH
-};
-
-typedef struct PHandle {
- enum PHandleState state;
- MemArena *arena;
-
- PChart *construction_chart;
- PHash *hash_verts;
- PHash *hash_edges;
- PHash *hash_faces;
-
- PChart **charts;
- int ncharts;
-
- float aspx, aspy;
-
- RNG *rng;
- float blend;
-} PHandle;
-
-#endif /*__PARAMETRIZER_INTERN_H__*/
-
diff --git a/source/blender/src/playanim.c b/source/blender/src/playanim.c
deleted file mode 100644
index 8880380700d..00000000000
--- a/source/blender/src/playanim.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#include <sys/times.h>
-#include <sys/wait.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include <math.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "BDR_editcurve.h"
-
-#include "BKE_blender.h"
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_screen.h"
-#include "BIF_mywindow.h"
-
-#include "BMF_Api.h"
-
-#ifdef WITH_QUICKTIME
-#ifdef _WIN32
-#include <QTML.h>
-#include <Movies.h>
-#elif defined(__APPLE__)
-#include <QuickTime/Movies.h>
-#endif /* __APPLE__ */
-#endif /* WITH_QUICKTIME */
-
-#include "playanim_ext.h"
-#include "mydevice.h"
-#include "blendef.h"
-#include "winlay.h"
-
-/* ***************** gl_util.c ****************** */
-
-static Window *g_window = NULL;
-static int qualN = 0;
-
-#define LSHIFT (1<<0)
-#define RSHIFT (1<<1)
-#define SHIFT (LSHIFT | RSHIFT)
-#define LALT (1<<2)
-#define RALT (1<<3)
-#define ALT (LALT | RALT)
-#define LCTRL (1<<4)
-#define RCTRL (1<<5)
-#define LMOUSE (1<<16)
-#define MMOUSE (1<<17)
-#define RMOUSE (1<<18)
-#define MOUSE (LMOUSE | MMOUSE | RMOUSE)
-
-unsigned short screen_qread(short *val, char *ascii);
-
-/* implementation */
-static int qreadN(short *val)
-{
- char ascii;
- int event = screen_qread(val, &ascii);
-
- switch(event){
- case LEFTMOUSE:
- if (*val) qualN |= LMOUSE;
- else qualN &= ~LMOUSE;
- break;
- case MIDDLEMOUSE:
- if (*val) qualN |= MMOUSE;
- else qualN &= ~MMOUSE;
- break;
- case RIGHTMOUSE:
- if (*val) qualN |= RMOUSE;
- else qualN &= ~RMOUSE;
- break;
- case LEFTSHIFTKEY:
- if (*val) qualN |= LSHIFT;
- else qualN &= ~LSHIFT;
- break;
- case RIGHTSHIFTKEY:
- if (*val) qualN |= RSHIFT;
- else qualN &= ~RSHIFT;
- break;
- case LEFTCTRLKEY:
- if (*val) qualN |= LCTRL;
- else qualN &= ~LCTRL;
- break;
- case RIGHTCTRLKEY:
- if (*val) qualN |= RCTRL;
- else qualN &= ~RCTRL;
- break;
- case LEFTALTKEY:
- if (*val) qualN |= LALT;
- else qualN &= ~LALT;
- break;
- case RIGHTALTKEY:
- if (*val) qualN |= RALT;
- else qualN &= ~RALT;
- break;
- }
-
- return(event);
-}
-
-/* ***************** gl_util.c ****************** */
-
-
-
-
-typedef struct pict{
- struct pict *next, *prev;
- char *mem;
- int size;
- char *name;
- struct ImBuf *ibuf;
- struct anim *anim;
- int frame;
- int IB_flags;
-}Pict;
-
-static struct ListBase _picsbase = {0,0};
-static struct ListBase *picsbase = &_picsbase;
-static int fromdisk = FALSE;
-static float zoomx = 1.0 , zoomy = 1.0;
-static double ptottime = 0.0, swaptime = 0.04;
-
-static int pupdate_time(void)
-{
- static double ltime;
- double time;
-
- time = PIL_check_seconds_timer();
-
- ptottime += (time - ltime);
- ltime = time;
- return (ptottime < 0);
-}
-
-static void toscreen(Pict *picture, struct ImBuf *ibuf)
-{
-
- if (ibuf == 0){
- printf("no ibuf !\n");
- return;
- }
- if (ibuf->rect==NULL && ibuf->rect_float) {
- IMB_rect_from_float(ibuf);
- imb_freerectfloatImBuf(ibuf);
- }
- if (ibuf->rect==NULL)
- return;
-
- glRasterPos2f(0.0f, 0.0f);
-
- glDrawPixels(ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
-
- pupdate_time();
-
- if(picture && (qualN & (SHIFT|LMOUSE))) {
- char str[512];
- cpack(-1);
- glRasterPos2f(0.02f, 0.03f);
- sprintf(str, "%s | %.2f frames/s\n", picture->name, 1.0 / swaptime);
- BMF_DrawString(G.fonts, str);
- }
-
- window_swap_buffers(g_window);
-}
-
-static void build_pict_list(char * first, int totframes)
-{
- int size,pic,file;
- char *mem, name[512];
- short val;
- struct pict * picture = 0;
- struct ImBuf *ibuf = 0;
- int count = 0;
- char str[512];
- struct anim * anim;
-
- if (IMB_isanim(first)) {
- anim = IMB_open_anim(first, IB_rect);
- if (anim) {
- ibuf = IMB_anim_absolute(anim, 0);
- if (ibuf) {
- toscreen(NULL, ibuf);
- IMB_freeImBuf(ibuf);
- }
-
- for (pic = 0; pic < IMB_anim_get_duration(anim); pic ++) {
- picture = (Pict*)MEM_callocN(sizeof(Pict),"Pict");
- picture->anim = anim;
- picture->frame = pic;
- picture->IB_flags = IB_rect;
- sprintf(str, "%s : %d", first, pic + 1);
- picture->name = strdup(str);
- BLI_addtail(picsbase, picture);
- }
- }
- else printf("couldn't open anim %s\n", first);
- }
- else {
-
- strcpy(name,first);
-
- pupdate_time();
- ptottime = 1.0;
-
-/*
- O_DIRECT
- If set, all reads and writes on the resulting file descriptor will
- be performed directly to or from the user program buffer, provided
- appropriate size and alignment restrictions are met. Refer to the
- F_SETFL and F_DIOINFO commands in the fcntl(2) manual entry for
- information about how to determine the alignment constraints.
- O_DIRECT is a Silicon Graphics extension and is only supported on
- local EFS and XFS file systems.
-*/
-
- while(IMB_ispic(name) && totframes){
- file = open(name, O_BINARY|O_RDONLY, 0);
- if (file < 0) return;
- picture = (struct pict*)MEM_callocN(sizeof(struct pict), "picture");
- if (picture == 0){
- printf("Not enough memory for pict struct \n");
- close(file);
- return;
- }
- size = BLI_filesize(file);
-
- if (size < 1) {
- close(file);
- MEM_freeN(picture);
- return;
- }
-
- picture->size = size;
- picture->IB_flags = IB_rect;
-
- if (fromdisk == FALSE) {
- mem=(char *)MEM_mallocN(size, "build pic list");
- if (mem==0){
- printf("Couldn't get memory\n");
- close(file);
- MEM_freeN(picture);
- return;
- }
-
- if (read(file,mem,size) != size){
- printf("Error while reading %s\n",name);
- close(file);
- MEM_freeN(picture);
- MEM_freeN(mem);
- return;
- }
- } else mem = 0;
-
- picture->mem = mem;
- picture->name = strdup(name);
- close(file);
- BLI_addtail(picsbase,picture);
- count++;
-
- pupdate_time();
-
- if (ptottime > 1.0) {
- if (picture->mem) ibuf = IMB_ibImageFromMemory((int *) picture->mem, picture->size, picture->IB_flags);
- else ibuf = IMB_loadiffname(picture->name, picture->IB_flags);
- if (ibuf) {
- toscreen(picture, ibuf);
- IMB_freeImBuf(ibuf);
- }
- pupdate_time();
- ptottime = 0.0;
- }
-
- BLI_newname(name, +1);
-
- while(qtest()){
- switch(qreadN(&val)){
- case ESCKEY:
- if (val) return;
- break;
- }
- }
- totframes--;
- }
- }
- return;
-}
-
-void playanim(int argc, char **argv)
-{
- struct ImBuf *ibuf = 0;
- struct pict *picture = 0;
- char name[512];
- short val = 0, go = TRUE, ibufx = 0, ibufy = 0;
- int event, stopped = FALSE, maxwinx, maxwiny;
- short /* c233 = FALSE, */ /* yuvx = FALSE, */ once = FALSE, sstep = FALSE, wait2 = FALSE, /* resetmap = FALSE, */ pause = 0;
- short pingpong = FALSE, direction = 1, next = 1, turbo = FALSE, /* doubleb = TRUE, */ noskip = FALSE;
- int sizex, sizey, ofsx, ofsy, i;
- /* This was done to disambiguate the name for use under c++. */
- struct anim * anim = 0;
- int start_x= 0, start_y= 0;
- int sfra= -1;
- int efra= -1;
- int totblock;
-
- while (argc > 1) {
- if (argv[1][0] == '-'){
- switch(argv[1][1]) {
- case 'm':
- fromdisk = TRUE;
- break;
- case 'p':
- if (argc>3) {
- start_x= atoi(argv[2]);
- start_y= atoi(argv[3]);
- argc-= 2;
- argv+= 2;
- } else {
- printf("too few arguments for -p (need 2): skipping\n");
- }
- break;
- case 'f':
- if (argc>3) {
- double fps = atof(argv[2]);
- double fps_base= atof(argv[3]);
- if (fps == 0) {
- fps = 1;
- printf("invalid fps,"
- "forcing 1\n");
- }
- swaptime = fps_base / fps;
- argc-= 2;
- argv+= 2;
- } else {
- printf("too few arguments for -f (need 2): skipping\n");
- }
- break;
- case 's':
- sfra= MIN2(MAXFRAME, MAX2(1, atoi(argv[2]) ));
- argc--;
- argv++;
- break;
- case 'e':
- efra= MIN2(MAXFRAME, MAX2(1, atoi(argv[2]) ));
- argc--;
- argv++;
- break;
- default:
- printf("unknown option '%c': skipping\n", argv[1][1]);
- break;
- }
- argc--;
- argv++;
- } else break;
- }
-
-#ifdef WITH_QUICKTIME
-#if defined (_WIN32) || defined (__APPLE__)
- /* Initialize QuickTime */
-#ifndef noErr
-#define noErr 0
-#endif
-
-#ifdef _WIN32
- if (InitializeQTML(0) != noErr)
- G.have_quicktime = FALSE;
- else
- G.have_quicktime = TRUE;
-#endif /* _WIN32 */
- if (EnterMovies() != noErr)
- G.have_quicktime = FALSE;
- else
-#endif /* _WIN32 || __APPLE__ */
- G.have_quicktime = TRUE;
-#endif /* WITH_QUICKTIME */
-
- if (argc > 1) strcpy(name,argv[1]);
- else {
- BLI_getwdN(name);
- if (name[strlen(name)-1] != '/') strcat(name,"/");
- }
-
- if (IMB_isanim(name)) {
- anim = IMB_open_anim(name, IB_rect);
- if (anim) {
- ibuf = IMB_anim_absolute(anim, 0);
- IMB_close_anim(anim);
- anim = NULL;
- }
- } else if (!IMB_ispic(name)) {
- exit(1);
- }
-
- if (ibuf == 0) ibuf = IMB_loadiffname(name, IB_rect);
- if (ibuf == 0){
- printf("couldn't open %s\n",name);
- exit(1);
- }
-
- #if !defined(WIN32) && !defined(__APPLE__)
- if (fork()) exit(0);
- #endif
-
- winlay_get_screensize(&maxwinx, &maxwiny);
-
- /* XXX, fixme zr */
- {
- extern void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii);
-
- g_window = window_open("Blender:Anim", start_x, start_y, ibuf->x, ibuf->y, 0);
- window_set_handler(g_window, add_to_mainqueue, NULL);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f);
- glMatrixMode(GL_MODELVIEW);
- }
-
- G.fonts= BMF_GetFont(BMF_kHelvetica10);
-
- ibufx = ibuf->x;
- ibufy = ibuf->y;
-
- if (maxwinx % ibuf->x) maxwinx = ibuf->x * (1 + (maxwinx / ibuf->x));
- if (maxwiny % ibuf->y) maxwiny = ibuf->y * (1 + (maxwiny / ibuf->y));
-
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- window_swap_buffers(g_window);
-
- if (sfra == -1 || efra == -1) {
- /* one of the frames was invalid, just use all images */
- sfra = 1;
- efra = MAXFRAME;
- }
-
- build_pict_list(name, (efra - sfra) + 1);
-
- for (i = 2; i < argc; i++){
- strcpy(name, argv[i]);
- build_pict_list(name, (efra - sfra) + 1);
- }
-
- IMB_freeImBuf(ibuf);
- ibuf = 0;
-
- pupdate_time();
- ptottime = 0;
-
- while (go){
- if (pingpong) direction = -direction;
-
- if (direction == 1) picture = picsbase->first;
- else picture = picsbase->last;
-
- if (picture == 0){
- printf("couldn't find pictures\n");
- go = FALSE;
- }
- if (pingpong){
- if (direction == 1) picture = picture->next;
- else picture = picture->prev;
- }
- if (ptottime > 0.0) ptottime = 0.0;
-
- while (picture){
- if (ibuf != 0 && ibuf->type == 0) IMB_freeImBuf(ibuf);
-
- if (picture->ibuf) ibuf = picture->ibuf;
- else if (picture->anim) ibuf = IMB_anim_absolute(picture->anim, picture->frame);
- else if (picture->mem) ibuf = IMB_ibImageFromMemory((int *) picture->mem, picture->size, picture->IB_flags);
- else ibuf = IMB_loadiffname(picture->name, picture->IB_flags);
-
- if (ibuf){
- strcpy(ibuf->name, picture->name);
-
-#ifdef _WIN32
- window_set_title(g_window, picture->name);
-#endif
-
- while (pupdate_time()) PIL_sleep_ms(1);
- ptottime -= swaptime;
- toscreen(picture, ibuf);
- } /* else deleten */
- else {
- printf("error: can't play this image type\n");
- exit(0);
- }
-
- if (once){
- if (picture->next == 0) wait2 = TRUE;
- else if (picture->prev == 0) wait2 = TRUE;
- }
-
- next = direction;
-
- while ((qtest() != 0 ) || ( wait2 != 0)){
- if (wait2 && stopped) {
- stopped = FALSE;
- }
-
- event = qreadN(&val);
- /* printf("%d %d\n", event, val); */
-
- if (wait2){
- pupdate_time();
- ptottime = 0;
- }
- switch (event){
- case AKEY:
- if (val)
- noskip = !noskip;
- break;
- case PKEY:
- if (val)
- pingpong = !pingpong;
- break;
- case SLASHKEY:
- if (val) {
- if (qualN & SHIFT) {
- if (ibuf)
- printf(" Name: %s | Speed: %.2f frames/s\n", ibuf->name, 1.0 / swaptime);
- } else {
- swaptime = 1.0 / 5.0;
- }
- }
- break;
- case LEFTARROWKEY:
- if (val){
- sstep = TRUE;
- wait2 = FALSE;
- if (qualN & SHIFT) {
- picture = picsbase->first;
- next = 0;
- } else {
- next = -1;
- }
- }
- break;
- case DOWNARROWKEY:
- if (val){
- wait2 = FALSE;
- if (qualN & SHIFT) {
- next = direction = -1;
- } else {
- next = -10;
- sstep = TRUE;
- }
- }
- break;
- case RIGHTARROWKEY:
- if (val){
- sstep = TRUE;
- wait2 = FALSE;
- if (qualN & SHIFT) {
- picture = picsbase->last;
- next = 0;
- } else {
- next = 1;
- }
- }
- break;
- case UPARROWKEY:
- if (val){
- wait2 = FALSE;
- if (qualN & SHIFT) {
- next = direction = 1;
- } else {
- next = 10;
- sstep = TRUE;
- }
- }
- break;
- case LEFTMOUSE:
- case MOUSEX:
- if (qualN & LMOUSE) {
- window_get_size(g_window,&sizex,&sizey);
- picture = picsbase->first;
- i = 0;
- while (picture){
- i ++;
- picture = picture->next;
- }
- i = (i * val) / sizex;
- picture = picsbase->first;
- for (; i > 0; i--){
- if (picture->next == 0) break;
- picture = picture->next;
- }
- sstep = TRUE;
- wait2 = FALSE;
- next = 0;
- }
- break;
- go= FALSE;
- break;
- case EQUALKEY:
- if (val) {
- if (qualN & SHIFT) {
- pause ++;
- printf("pause:%d\n", pause);
- } else swaptime /= 1.1;
- }
- break;
- case MINUSKEY:
- if (val) {
- if (qualN & SHIFT) {
- pause --;
- printf("pause:%d\n", pause);
- } else swaptime *= 1.1;
- }
- break;
- case PAD0:
- if (val){
- if (once) once = wait2 = FALSE;
- else {
- picture = 0;
- once = TRUE;
- wait2 = FALSE;
- }
- }
- break;
- case RETKEY:
- case PADENTER:
- if (val){
- wait2 = sstep = FALSE;
- }
- break;
- case PADPERIOD:
- if (val){
- if (sstep) wait2 = FALSE;
- else {
- sstep = TRUE;
- wait2 = !wait2;
- }
- }
- break;
- case PAD1:
- swaptime = 1.0 / 60.0;
- break;
- case PAD2:
- swaptime = 1.0 / 50.0;
- break;
- case PAD3:
- swaptime = 1.0 / 30.0;
- break;
- case PAD4:
- if (qualN & SHIFT)
- swaptime = 1.0 / 24.0;
- else
- swaptime = 1.0 / 25.0;
- break;
- case PAD5:
- swaptime = 1.0 / 20.0;
- break;
- case PAD6:
- swaptime = 1.0 / 15.0;
- break;
- case PAD7:
- swaptime = 1.0 / 12.0;
- break;
- case PAD8:
- swaptime = 1.0 / 10.0;
- break;
- case PAD9:
- swaptime = 1.0 / 6.0;
- break;
- case PADPLUSKEY:
- if (val == 0) break;
- zoomx += 2.0;
- zoomy += 2.0;
- case PADMINUS:
- if (val == 0) break;
- if (zoomx > 1.0) zoomx -= 1.0;
- if (zoomy > 1.0) zoomy -= 1.0;
- window_get_position(g_window,&ofsx,&ofsy);
- window_get_size(g_window,&sizex,&sizey);
- ofsx += sizex/2;
- ofsy += sizey/2;
- sizex = zoomx * ibufx;
- sizey = zoomy * ibufy;
- ofsx -= sizex/2;
- ofsy -= sizey/2;
-/* window_set_position(g_window,sizex,sizey); */
- window_set_size(g_window,sizex,sizey);
- break;
- case RESHAPE:
- case REDRAW:
- window_get_size(g_window,&sizex,&sizey);
- window_make_active(g_window);
-
- glViewport(0, 0, sizex, sizey);
- glScissor(0, 0, sizex, sizey);
-
- zoomx = (float) sizex / ibufx;
- zoomy = (float) sizey / ibufy;
- zoomx = floor(zoomx + 0.5);
- zoomy = floor(zoomy + 0.5);
- if (zoomx < 1.0) zoomx = 1.0;
- if (zoomy < 1.0) zoomy = 1.0;
-
- sizex = zoomx * ibufx;
- sizey = zoomy * ibufy;
-
- glPixelZoom(zoomx, zoomy);
- glEnable(GL_DITHER);
- ptottime = 0.0;
- toscreen(picture, ibuf);
- while (qtest()) qreadN(&val);
-
- break;
- case ESCKEY:
- case WINCLOSE:
- case WINQUIT:
- go = FALSE;
- break;
- }
- if (go == FALSE) break;
- }
-
- wait2 = sstep;
-
- if (wait2 == 0 && stopped == 0) {
- stopped = TRUE;
- }
-
- pupdate_time();
-
- if (picture && next) {
- /* always at least set one step */
- while (picture){
- if (next < 0) picture = picture->prev;
- else picture = picture->next;
-
- if (once && picture != 0){
- if (picture->next == 0) wait2 = TRUE;
- else if (picture->prev == 0) wait2 = TRUE;
- }
-
- if (wait2 || ptottime < swaptime || turbo || noskip) break;
- ptottime -= swaptime;
- }
- if (picture == 0 && sstep) {
- if (next < 0) picture = picsbase->last;
- else if (next > 0) picture = picsbase->first;
- }
- }
- if (go == FALSE) break;
- }
- }
- picture = picsbase->first;
- anim = NULL;
- while (picture) {
- if (picture && picture->anim && (anim != picture->anim)) {
- // to prevent divx crashes
- anim = picture->anim;
- IMB_close_anim(anim);
- }
- if(picture->ibuf) IMB_freeImBuf(picture->ibuf);
- if(picture->mem) MEM_freeN(picture->mem);
-
- picture = picture->next;
- }
-#ifdef WITH_QUICKTIME
-#if defined (_WIN32) || defined (__APPLE__)
- if(G.have_quicktime) {
- ExitMovies();
-#ifdef _WIN32
- TerminateQTML();
-#endif /* _WIN32 */
- }
-#endif /* _WIN32 || __APPLE__ */
-#endif /* WITH_QUICKTIME */
-
- /* cleanup */
- if(ibuf) IMB_freeImBuf(ibuf);
- BLI_freelistN(picsbase);
- free_blender();
- window_destroy(g_window);
-
- totblock= MEM_get_memory_blocks_in_use();
- if(totblock!=0) {
- printf("Error Totblock: %d\n",totblock);
- MEM_printmemlist();
- }
-}
diff --git a/source/blender/src/poselib.c b/source/blender/src/poselib.c
deleted file mode 100644
index 13520c94b87..00000000000
--- a/source/blender/src/poselib.c
+++ /dev/null
@@ -1,1329 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007, Blender Foundation
- * This is a new part of Blender
- *
- * Contributor(s): Joshua Leung
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "DNA_listBase.h"
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_depsgraph.h"
-#include "BKE_ipo.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_keyframing.h"
-#include "BSE_editipo.h"
-
-#include "BDR_drawaction.h"
-#include "BSE_time.h"
-
-#include "BIF_poselib.h"
-#include "BIF_interface.h"
-#include "BIF_editaction.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-
-
-#include "blendef.h"
-
-#include "PIL_time.h" /* sleep */
-#include "mydevice.h"
-
-/* ************************************************************* */
-/* == POSE-LIBRARY TOOL FOR BLENDER ==
- *
- * Overview:
- * This tool allows animators to store a set of frequently used poses to dump into
- * the active action to help in "budget" productions to quickly block out new actions.
- * It acts as a kind of "glorified clipboard for poses", allowing for naming of poses.
- *
- * Features:
- * - PoseLibs are simply normal Actions
- * - Each "pose" is simply a set of keyframes that occur on a particular frame
- * -> a set of TimeMarkers that belong to each Action, help 'label' where a 'pose' can be
- * found in the Action
- * - The Scrollwheel or PageUp/Down buttons when used in a special mode or after pressing/holding
- * [a modifier] key, cycles through the poses available for the active pose's poselib, allowing the
- * animator to preview what action best suits that pose
- */
-/* ************************************************************* */
-
-/* gets list of poses in poselib as a string usable for pupmenu() */
-char *poselib_build_poses_menu (bAction *act, char title[])
-{
- DynStr *pupds= BLI_dynstr_new();
- TimeMarker *marker;
- char *str;
- char buf[64];
- int i;
-
- /* add title first */
- sprintf(buf, "%s%%t|", title);
- BLI_dynstr_append(pupds, buf);
-
- /* loop through markers, adding them */
- for (marker=act->markers.first, i=1; marker; marker=marker->next, i++) {
- BLI_dynstr_append(pupds, marker->name);
-
- sprintf(buf, "%%x%d", i);
- BLI_dynstr_append(pupds, buf);
-
- if (marker->next)
- BLI_dynstr_append(pupds, "|");
- }
-
- /* convert to normal MEM_malloc'd string */
- str= BLI_dynstr_get_cstring(pupds);
- BLI_dynstr_free(pupds);
-
- return str;
-}
-
-/* gets the first available frame in poselib to store a pose on
- * - frames start from 1, and a pose should occur on every frame... 0 is error!
- */
-int poselib_get_free_index (bAction *act)
-{
- TimeMarker *marker;
- int low=0, high=0;
-
- /* sanity checks */
- if (ELEM(NULL, act, act->markers.first)) return 1;
-
- /* loop over poses finding various values (poses are not stored in chronological order) */
- for (marker= act->markers.first; marker; marker= marker->next) {
- /* only increase low if value is 1 greater than low, to find "gaps" where
- * poses were removed from the poselib
- */
- if (marker->frame == (low + 1))
- low++;
-
- /* value replaces high if it is the highest value encountered yet */
- if (marker->frame > high)
- high= marker->frame;
- }
-
- /* - if low is not equal to high, then low+1 is a gap
- * - if low is equal to high, then high+1 is the next index (add at end)
- */
- if (low < high)
- return (low + 1);
- else
- return (high + 1);
-}
-
-/* returns the active pose for a poselib */
-TimeMarker *poselib_get_active_pose (bAction *act)
-{
- if ((act) && (act->active_marker))
- return BLI_findlink(&act->markers, act->active_marker-1);
- else
- return NULL;
-}
-
-/* ************************************************************* */
-
-/* Initialise a new poselib (whether it is needed or not) */
-bAction *poselib_init_new (Object *ob)
-{
- /* sanity checks - only for armatures */
- if (ELEM(NULL, ob, ob->pose))
- return NULL;
-
- /* init object's poselib action (unlink old one if there) */
- if (ob->poselib)
- ob->poselib->id.us--;
- ob->poselib= add_empty_action("PoseLib");
-
- return ob->poselib;
-}
-
-/* Initialise a new poselib (checks if that needs to happen) */
-bAction *poselib_validate (Object *ob)
-{
- if (ELEM(NULL, ob, ob->pose))
- return NULL;
- else if (ob->poselib == NULL)
- return poselib_init_new(ob);
- else
- return ob->poselib;
-}
-
-
-/* This tool automagically generates/validates poselib data so that it corresponds to the data
- * in the action. This is for use in making existing actions usable as poselibs.
- */
-void poselib_validate_act (bAction *act)
-{
- ListBase keys = {NULL, NULL};
- ActKeyColumn *ak;
- TimeMarker *marker, *markern;
-
- /* validate action and poselib */
- if (act == NULL) {
- error("No Action to validate");
- return;
- }
-
- /* determine which frames have keys */
- action_to_keylist(act, &keys, NULL, NULL);
-
- /* for each key, make sure there is a correspnding pose */
- for (ak= keys.first; ak; ak= ak->next) {
- /* check if any pose matches this */
- for (marker= act->markers.first; marker; marker= marker->next) {
- if (IS_EQ(marker->frame, ak->cfra)) {
- marker->flag = -1;
- break;
- }
- }
-
- /* add new if none found */
- if (marker == NULL) {
- char name[64];
-
- /* add pose to poselib */
- marker= MEM_callocN(sizeof(TimeMarker), "ActionMarker");
-
- strcpy(name, "Pose");
- BLI_strncpy(marker->name, name, sizeof(marker->name));
-
- marker->frame= (int)ak->cfra;
- marker->flag= -1;
-
- BLI_addtail(&act->markers, marker);
- }
- }
-
- /* remove all untagged poses (unused), and remove all tags */
- for (marker= act->markers.first; marker; marker= markern) {
- markern= marker->next;
-
- if (marker->flag != -1)
- BLI_freelinkN(&act->markers, marker);
- else
- marker->flag = 0;
- }
-
- /* free temp memory */
- BLI_freelistN(&keys);
-
- BIF_undo_push("PoseLib Validate Action");
-}
-
-/* ************************************************************* */
-
-/* This function adds an ipo-curve of the right type where it's needed */
-static IpoCurve *poselib_verify_icu (Ipo *ipo, int adrcode)
-{
- IpoCurve *icu;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- if (icu->adrcode==adrcode) break;
- }
- if (icu==NULL) {
- icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
-
- icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
- if (ipo->curve.first==NULL) icu->flag |= IPO_ACTIVE; /* first one added active */
-
- icu->blocktype= ID_PO;
- icu->adrcode= adrcode;
-
- set_icu_vars(icu);
-
- BLI_addtail(&ipo->curve, icu);
- }
-
- return icu;
-}
-
-/* This tool adds the current pose to the poselib
- * Note: Standard insertkey cannot be used for this due to its limitations
- */
-void poselib_add_current_pose (Object *ob, int val)
-{
- bArmature *arm= (ob) ? ob->data : NULL;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan;
- TimeMarker *marker;
- bAction *act;
- bActionChannel *achan;
- IpoCurve *icu;
- int frame;
- char name[64];
-
- /* sanity check */
- if (ELEM3(NULL, ob, arm, pose))
- return;
-
- /* mode - add new or replace existing */
- if (val == 0) {
- if ((ob->poselib) && (ob->poselib->markers.first)) {
- val= pupmenu("PoseLib Add Current Pose%t|Add New%x1|Add New (Current Frame)%x3|Replace Existing%x2");
- if (val <= 0) return;
- }
- else
- val= 1;
- }
-
- if ((ob->poselib) && (val == 2)) {
- char *menustr;
-
- /* get poselib */
- act= ob->poselib;
-
- /* get the pose to replace */
- menustr= poselib_build_poses_menu(act, "Replace PoseLib Pose");
- val= pupmenu_col(menustr, 20);
- if (menustr) MEM_freeN(menustr);
-
- if (val <= 0) return;
- marker= BLI_findlink(&act->markers, val-1);
- if (marker == NULL) return;
-
- /* get the frame from the poselib */
- frame= marker->frame;
- }
- else {
- /* get name of pose */
- sprintf(name, "Pose");
- if (sbutton(name, 0, sizeof(name)-1, "Name: ") == 0)
- return;
-
- /* get/initialise poselib */
- act= poselib_validate(ob);
-
- /* get frame */
- if (val == 3)
- frame= CFRA;
- else /* if (val == 1) */
- frame= poselib_get_free_index(act);
-
- /* add pose to poselib - replaces any existing pose there */
- for (marker= act->markers.first; marker; marker= marker->next) {
- if (marker->frame == frame) {
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- break;
- }
- }
- if (marker == NULL) {
- marker= MEM_callocN(sizeof(TimeMarker), "ActionMarker");
-
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- marker->frame= frame;
-
- BLI_addtail(&act->markers, marker);
- }
-
- /* validate name */
- BLI_uniquename(&act->markers, marker, "Pose", offsetof(TimeMarker, name), 64);
- }
-
- /* loop through selected posechannels, keying their pose to the action */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- /* check if available */
- if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
- if (pchan->bone->flag & (BONE_SELECTED|BONE_ACTIVE)) {
- /* make action-channel if needed (action groups are also created) */
- achan= verify_action_channel(act, pchan->name);
- verify_pchan2achan_grouping(act, pose, pchan->name);
-
- /* make ipo if needed... */
- if (achan->ipo == NULL)
- achan->ipo= add_ipo(achan->name, ID_PO);
-
- /* add missing ipo-curves and insert keys */
- #define INSERT_KEY_ICU(adrcode, data) {\
- icu= poselib_verify_icu(achan->ipo, adrcode); \
- insert_vert_icu(icu, (float)frame, data, 1); \
- }
-
- INSERT_KEY_ICU(AC_LOC_X, pchan->loc[0])
- INSERT_KEY_ICU(AC_LOC_Y, pchan->loc[1])
- INSERT_KEY_ICU(AC_LOC_Z, pchan->loc[2])
- INSERT_KEY_ICU(AC_SIZE_X, pchan->size[0])
- INSERT_KEY_ICU(AC_SIZE_Y, pchan->size[1])
- INSERT_KEY_ICU(AC_SIZE_Z, pchan->size[2])
- INSERT_KEY_ICU(AC_QUAT_W, pchan->quat[0])
- INSERT_KEY_ICU(AC_QUAT_X, pchan->quat[1])
- INSERT_KEY_ICU(AC_QUAT_Y, pchan->quat[2])
- INSERT_KEY_ICU(AC_QUAT_Z, pchan->quat[3])
- }
- }
- }
-
- /* store new 'active' pose number */
- act->active_marker= BLI_countlist(&act->markers);
-
- BIF_undo_push("PoseLib Add Pose");
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-
-/* This tool removes the pose that the user selected from the poselib (or the provided pose) */
-void poselib_remove_pose (Object *ob, TimeMarker *marker)
-{
- bPose *pose= (ob) ? ob->pose : NULL;
- bAction *act= (ob) ? ob->poselib : NULL;
- bActionChannel *achan;
- char *menustr;
- int val;
-
- /* check if valid poselib */
- if (ELEM(NULL, ob, pose)) {
- error("PoseLib is only for Armatures in PoseMode");
- return;
- }
- if (act == NULL) {
- error("Object doesn't have PoseLib data");
- return;
- }
-
- /* get index (and pointer) of pose to remove */
- if (marker == NULL) {
- menustr= poselib_build_poses_menu(act, "Remove PoseLib Pose");
- val= pupmenu_col(menustr, 20);
- if (menustr) MEM_freeN(menustr);
-
- if (val <= 0) return;
- marker= BLI_findlink(&act->markers, val-1);
- if (marker == NULL) return;
- }
- else {
- /* only continue if pose belongs to poselib */
- if (BLI_findindex(&act->markers, marker) == -1)
- return;
- }
-
- /* remove relevant keyframes */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- Ipo *ipo= achan->ipo;
- IpoCurve *icu;
- BezTriple *bezt;
- int i;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- /* check if remove... */
- if (IS_EQ(bezt->vec[1][0], marker->frame)) {
- delete_icu_key(icu, i, 1);
- break;
- }
- }
- }
- }
-
- /* remove poselib from list */
- BLI_freelinkN(&act->markers, marker);
-
- /* fix active pose number */
- act->active_marker= 0;
-
- /* undo + redraw */
- BIF_undo_push("PoseLib Remove Pose");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
-}
-
-
-/* This tool renames the pose that the user selected from the poselib */
-void poselib_rename_pose (Object *ob)
-{
- bPose *pose= (ob) ? ob->pose : NULL;
- bAction *act= (ob) ? ob->poselib : NULL;
- TimeMarker *marker;
- char *menustr, name[64];
- int val;
-
- /* check if valid poselib */
- if (ELEM(NULL, ob, pose)) {
- error("PoseLib is only for Armatures in PoseMode");
- return;
- }
- if (act == NULL) {
- error("Object doesn't have a valid PoseLib");
- return;
- }
-
- /* get index of pose to remove */
- menustr= poselib_build_poses_menu(act, "Rename PoseLib Pose");
- val= pupmenu_col(menustr, 20);
- if (menustr) MEM_freeN(menustr);
-
- if (val <= 0) return;
- marker= BLI_findlink(&act->markers, val-1);
- if (marker == NULL) return;
-
- /* get name of pose */
- strncpy(name, marker->name, sizeof(name));
- if (sbutton(name, 0, sizeof(name)-1, "Name: ") == 0)
- return;
-
- /* copy name and validate it */
- BLI_strncpy(marker->name, name, sizeof(marker->name));
- BLI_uniquename(&act->markers, marker, "Pose", offsetof(TimeMarker, name), 64);
-
- /* undo and update */
- BIF_undo_push("PoseLib Rename Pose");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
-}
-
-
-/* ************************************************************* */
-
-/* Simple struct for storing settings/data for use during PoseLib preview */
-typedef struct tPoseLib_PreviewData {
- ListBase backups; /* tPoseLib_Backup structs for restoring poses */
- ListBase searchp; /* LinkData structs storing list of poses which match the current search-string */
-
- Object *ob; /* object to work on */
- bArmature *arm; /* object's armature data */
- bPose *pose; /* object's pose */
- bAction *act; /* poselib to use */
- TimeMarker *marker; /* 'active' pose */
-
- short state; /* state of main loop */
- short redraw; /* redraw/update settings during main loop */
- short flag; /* flags for various settings */
-
- int selcount; /* number of selected elements to work on */
- int totcount; /* total number of elements to work on */
-
- char headerstr[200]; /* Info-text to print in header */
-
- char searchstr[64]; /* (Part of) Name to search for to filter poses that get shown */
- char searchold[64]; /* Previously set searchstr (from last loop run), so that we can detected when to rebuild searchp */
- short search_cursor; /* position of cursor in searchstr (cursor occurs before the item at the nominated index) */
-} tPoseLib_PreviewData;
-
-/* defines for tPoseLib_PreviewData->state values */
-enum {
- PL_PREVIEW_ERROR = -1,
- PL_PREVIEW_RUNNING,
- PL_PREVIEW_CONFIRM,
- PL_PREVIEW_CANCEL,
- PL_PREVIEW_RUNONCE
-};
-
-/* defines for tPoseLib_PreviewData->redraw values */
-enum {
- PL_PREVIEW_NOREDRAW = 0,
- PL_PREVIEW_REDRAWALL,
- PL_PREVIEW_REDRAWHEADER,
-};
-
-/* defines for tPoseLib_PreviewData->flag values */
-enum {
- PL_PREVIEW_FIRSTTIME = (1<<0),
- PL_PREVIEW_SHOWORIGINAL = (1<<1)
-};
-
-/* ---------------------------- */
-
-/* simple struct for storing backup info */
-typedef struct tPoseLib_Backup {
- struct tPoseLib_Backup *next, *prev;
-
- bPoseChannel *pchan;
- bPoseChannel olddata;
-} tPoseLib_Backup;
-
-/* Makes a copy of the current pose for restoration purposes - doesn't do constraints currently */
-static void poselib_backup_posecopy (tPoseLib_PreviewData *pld)
-{
- bActionChannel *achan;
- bPoseChannel *pchan;
-
- /* for each posechannel that has an actionchannel in */
- for (achan= pld->act->chanbase.first; achan; achan= achan->next) {
- /* try to find posechannel */
- pchan= get_pose_channel(pld->pose, achan->name);
-
- /* backup data if available */
- if (pchan) {
- tPoseLib_Backup *plb;
-
- /* store backup */
- plb= MEM_callocN(sizeof(tPoseLib_Backup), "tPoseLib_Backup");
-
- plb->pchan= pchan;
- memcpy(&plb->olddata, plb->pchan, sizeof(bPoseChannel));
-
- BLI_addtail(&pld->backups, plb);
-
- /* mark as being affected */
- if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED))
- pld->selcount++;
- pld->totcount++;
- }
- }
-}
-
-/* Restores original pose - doesn't do constraints currently */
-static void poselib_backup_restore (tPoseLib_PreviewData *pld)
-{
- tPoseLib_Backup *plb;
-
- for (plb= pld->backups.first; plb; plb= plb->next) {
- memcpy(plb->pchan, &plb->olddata, sizeof(bPoseChannel));
- }
-}
-
-/* ---------------------------- */
-
-/* Applies the appropriate stored pose from the pose-library to the current pose
- * - assumes that a valid object, with a poselib has been supplied
- * - gets the string to print in the header
- * - this code is based on the code for extract_pose_from_action in blenkernel/action.c
- */
-static void poselib_apply_pose (tPoseLib_PreviewData *pld)
-{
- bPose *pose= pld->pose;
- bPoseChannel *pchan;
- bAction *act= pld->act;
- bActionChannel *achan;
- IpoCurve *icu;
- int frame;
-
- if (pld->marker)
- frame= pld->marker->frame;
- else
- return;
-
- /* start applying - only those channels which have a key at this point in time! */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- short found= 0;
-
- /* apply this achan? */
- if (achan->ipo) {
- /* find a keyframe at this frame - users may not have defined the pose on every channel, so this is necessary */
- // TODO: this may be bad for user-defined poses...
- for (icu= achan->ipo->curve.first; icu; icu= icu->next) {
- BezTriple *bezt;
- int i;
-
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- if (IN_RANGE(bezt->vec[1][0], (frame-0.5f), (frame+0.5f))) {
- found= 1;
- break;
- }
- }
-
- if (found) break;
- }
-
- /* apply pose - only if posechannel selected? */
- if (found) {
- pchan= get_pose_channel(pose, achan->name);
-
- if (pchan) {
- short ok= 0;
-
- if (pchan->bone) {
- if ( (pchan->bone->flag & (BONE_SELECTED|BONE_ACTIVE)) &&
- (pchan->bone->flag & BONE_HIDDEN_P)==0 )
- ok = 1;
- else if (pld->selcount == 0)
- ok= 1;
- }
- else if (pld->selcount == 0)
- ok= 1;
-
- if (ok) {
- /* Evaluates and sets the internal ipo values */
- calc_ipo(achan->ipo, (float)frame);
- /* This call also sets the pchan flags */
- execute_action_ipo(achan, pchan);
- }
- }
- }
- }
-
- /* tag achan as having been used or not... */
- if (found)
- achan->flag |= ACHAN_SELECTED;
- else
- achan->flag &= ~ACHAN_SELECTED;
- }
-}
-
-/* Auto-keys/tags bones affected by the pose used from the poselib */
-static void poselib_keytag_pose (tPoseLib_PreviewData *pld)
-{
- bPose *pose= pld->pose;
- bPoseChannel *pchan;
- bAction *act= pld->act;
- bActionChannel *achan;
-
- /* start tagging/keying */
- for (achan= act->chanbase.first; achan; achan= achan->next) {
- /* only for selected action channels */
- if (achan->flag & ACHAN_SELECTED) {
- pchan= get_pose_channel(pose, achan->name);
-
- if (pchan) {
- // TODO: use a standard autokeying function in future (to allow autokeying-editkeys to work)
- if (IS_AUTOKEY_MODE(NORMAL)) {
- ID *id= &pld->ob->id;
-
- /* Set keys on pose */
- if (pchan->flag & POSE_ROT) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0);
- }
- if (pchan->flag & POSE_SIZE) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0);
- }
- if (pchan->flag & POSE_LOC) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0);
- }
-
- /* clear any unkeyed tags */
- if (pchan->bone)
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
- else {
- /* add unkeyed tags */
- if (pchan->bone)
- pchan->bone->flag |= BONE_UNKEYED;
- }
- }
- }
- }
-}
-
-/* ---------------------------- */
-
-/* This helper function is called during poselib_preview_poses to find the
- * pose to preview next (after a change event)
- */
-static void poselib_preview_get_next (tPoseLib_PreviewData *pld, int step)
-{
- /* check if we no longer have search-string, but don't have any marker */
- if (pld->marker == NULL) {
- if ((step) && (pld->searchstr[0] == 0))
- pld->marker= pld->act->markers.first;
- }
-
- /* the following operations assume that there is a starting point and direction */
- if ((pld->marker) && (step)) {
- /* search-string dictates a special approach */
- if (pld->searchstr[0]) {
- TimeMarker *marker;
- LinkData *ld, *ldn, *ldc;
-
- /* free and rebuild if needed (i.e. if search-str changed) */
- if (strcmp(pld->searchstr, pld->searchold)) {
- /* free list of temporary search matches */
- BLI_freelistN(&pld->searchp);
-
- /* generate a new list of search matches */
- for (marker= pld->act->markers.first; marker; marker= marker->next) {
- /* does the name partially match?
- * - don't worry about case, to make it easier for users to quickly input a name (or
- * part of one), which is the whole point of this feature
- */
- if (BLI_strcasestr(marker->name, pld->searchstr)) {
- /* make link-data to store reference to it */
- ld= MEM_callocN(sizeof(LinkData), "PoseMatch");
- ld->data= marker;
- BLI_addtail(&pld->searchp, ld);
- }
- }
-
- /* set current marker to NULL (so that we start from first) */
- pld->marker= NULL;
- }
-
- /* check if any matches */
- if (pld->searchp.first == NULL) {
- pld->marker= NULL;
- return;
- }
-
- /* find first match */
- for (ldc= pld->searchp.first; ldc; ldc= ldc->next) {
- if (ldc->data == pld->marker)
- break;
- }
- if (ldc == NULL)
- ldc= pld->searchp.first;
-
- /* Loop through the matches in a cyclic fashion, incrementing/decrementing step as appropriate
- * until step == 0. At this point, marker should be the correct marker.
- */
- if (step > 0) {
- for (ld=ldc; ld && step; ld=ldn, step--)
- ldn= (ld->next) ? ld->next : pld->searchp.first;
- }
- else {
- for (ld=ldc; ld && step; ld=ldn, step++)
- ldn= (ld->prev) ? ld->prev : pld->searchp.last;
- }
-
- /* set marker */
- if (ld)
- pld->marker= ld->data;
- }
- else {
- TimeMarker *marker, *next;
-
- /* Loop through the markers in a cyclic fashion, incrementing/decrementing step as appropriate
- * until step == 0. At this point, marker should be the correct marker.
- */
- if (step > 0) {
- for (marker=pld->marker; marker && step; marker=next, step--)
- next= (marker->next) ? marker->next : pld->act->markers.first;
- }
- else {
- for (marker=pld->marker; marker && step; marker=next, step++)
- next= (marker->prev) ? marker->prev : pld->act->markers.last;
- }
-
- /* it should be fairly impossible for marker to be NULL */
- if (marker)
- pld->marker= marker;
- }
- }
-}
-
-/* specially handle events for searching */
-static void poselib_preview_handle_search (tPoseLib_PreviewData *pld, unsigned short event, char ascii)
-{
- if (ascii) {
- /* character to add to the string */
- short index= pld->search_cursor;
- short len= (pld->searchstr[0]) ? strlen(pld->searchstr) : 0;
- short i;
-
- if (len) {
- for (i = len; i > index; i--)
- pld->searchstr[i]= pld->searchstr[i-1];
- }
- else
- pld->searchstr[1]= 0;
-
- pld->searchstr[index]= ascii;
- pld->search_cursor++;
-
- poselib_preview_get_next(pld, 1);
- pld->redraw = PL_PREVIEW_REDRAWALL;
- }
- else {
- /* some form of string manipulation */
- switch (event) {
- case BACKSPACEKEY:
- if (pld->searchstr[0] && pld->search_cursor) {
- short len= strlen(pld->searchstr);
- short index= pld->search_cursor;
- short i;
-
- for (i = index; i <= len; i++)
- pld->searchstr[i-1] = pld->searchstr[i];
-
- pld->search_cursor--;
-
- poselib_preview_get_next(pld, 1);
- pld->redraw = PL_PREVIEW_REDRAWALL;
- }
- break;
-
- case DELKEY:
- if (pld->searchstr[0] && pld->searchstr[1]) {
- short len= strlen(pld->searchstr);
- short index= pld->search_cursor;
- int i;
-
- if (index < len) {
- for (i = index; i < len; i++)
- pld->searchstr[i] = pld->searchstr[i+1];
-
- poselib_preview_get_next(pld, 1);
- pld->redraw = PL_PREVIEW_REDRAWALL;
- }
- }
- break;
- }
- }
-}
-
-/* handle events for poselib_preview_poses */
-static void poselib_preview_handle_event (tPoseLib_PreviewData *pld, unsigned short event, char ascii)
-{
- /* backup stuff that needs to occur before every operation
- * - make a copy of searchstr, so that we know if cache needs to be rebuilt
- */
- strcpy(pld->searchold, pld->searchstr);
-
- /* if we're currently showing the original pose, only certain events are handled */
- if (pld->flag & PL_PREVIEW_SHOWORIGINAL) {
- switch (event) {
- /* exit - cancel */
- case ESCKEY:
- case RIGHTMOUSE:
- pld->state= PL_PREVIEW_CANCEL;
- break;
-
- /* exit - confirm */
- case LEFTMOUSE:
- case RETKEY:
- case PADENTER:
- case SPACEKEY:
- pld->state= PL_PREVIEW_CONFIRM;
- break;
-
- /* view manipulation */
- case MIDDLEMOUSE:
- // there's a little bug here that causes the normal header to get drawn while view is manipulated
- handle_view_middlemouse();
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- break;
-
- /* view manipulation, or searching */
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADPLUSKEY: case PADMINUS:
- persptoetsen(event);
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- break;
-
- case TABKEY:
- pld->flag &= ~PL_PREVIEW_SHOWORIGINAL;
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
- }
-
- /* EXITS HERE... */
- return;
- }
-
- /* NORMAL EVENT HANDLING... */
- /* searching takes priority over normal activity */
- switch (event) {
- /* exit - cancel */
- case ESCKEY:
- case RIGHTMOUSE:
- pld->state= PL_PREVIEW_CANCEL;
- break;
-
- /* exit - confirm */
- case LEFTMOUSE:
- case RETKEY:
- case PADENTER:
- case SPACEKEY:
- pld->state= PL_PREVIEW_CONFIRM;
- break;
-
- /* toggle between original pose and poselib pose*/
- case TABKEY:
- pld->flag |= PL_PREVIEW_SHOWORIGINAL;
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
-
- /* change to previous pose (cyclic) */
- case PAGEUPKEY:
- case WHEELUPMOUSE:
- poselib_preview_get_next(pld, -1);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
-
- /* change to next pose (cyclic) */
- case PAGEDOWNKEY:
- case WHEELDOWNMOUSE:
- poselib_preview_get_next(pld, 1);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
-
- /* jump 5 poses (cyclic, back) */
- case DOWNARROWKEY:
- poselib_preview_get_next(pld, -5);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
-
- /* jump 5 poses (cyclic, forward) */
- case UPARROWKEY:
- poselib_preview_get_next(pld, 5);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- break;
-
- /* change to next pose or searching cursor control */
- case RIGHTARROWKEY:
- if (pld->searchstr[0]) {
- /* move text-cursor to the right */
- if (pld->search_cursor < strlen(pld->searchstr))
- pld->search_cursor++;
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- }
- else {
- /* change to next pose (cyclic) */
- poselib_preview_get_next(pld, 1);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- }
- break;
-
- /* change to next pose or searching cursor control */
- case LEFTARROWKEY:
- if (pld->searchstr[0]) {
- /* move text-cursor to the left */
- if (pld->search_cursor)
- pld->search_cursor--;
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- }
- else {
- /* change to previous pose (cyclic) */
- poselib_preview_get_next(pld, -1);
- pld->redraw= PL_PREVIEW_REDRAWALL;
- }
- break;
-
- /* change to first pose or start of searching string */
- case HOMEKEY:
- if (pld->searchstr[0]) {
- pld->search_cursor= 0;
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- }
- else {
- /* change to first pose */
- pld->marker= pld->act->markers.first;
- pld->act->active_marker= 1;
-
- pld->redraw= PL_PREVIEW_REDRAWALL;
- }
- break;
-
- /* change to last pose or start of searching string */
- case ENDKEY:
- if (pld->searchstr[0]) {
- pld->search_cursor= strlen(pld->searchstr);
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- }
- else {
- /* change to last pose */
- pld->marker= pld->act->markers.last;
- pld->act->active_marker= BLI_countlist(&pld->act->markers);
-
- pld->redraw= PL_PREVIEW_REDRAWALL;
- }
- break;
-
- /* view manipulation */
- case MIDDLEMOUSE:
- // there's a little bug here that causes the normal header to get drawn while view is manipulated
- handle_view_middlemouse();
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- break;
-
- /* view manipulation, or searching */
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADPLUSKEY: case PADMINUS:
- if (pld->searchstr[0]) {
- poselib_preview_handle_search(pld, event, ascii);
- }
- else {
- persptoetsen(event);
- pld->redraw= PL_PREVIEW_REDRAWHEADER;
- }
- break;
-
- /* otherwise, assume that searching might be able to handle it */
- default:
- poselib_preview_handle_search(pld, event, ascii);
- break;
- }
-}
-
-/* ---------------------------- */
-
-/* Init PoseLib Previewing data */
-static void poselib_preview_init_data (tPoseLib_PreviewData *pld, Object *ob, short apply_active)
-{
- /* clear pld first as it resides on the stack */
- memset(pld, 0, sizeof(tPoseLib_PreviewData));
-
- /* get basic data */
- pld->ob= ob;
- pld->arm= (ob) ? (ob->data) : NULL;
- pld->pose= (ob) ? (ob->pose) : NULL;
- pld->act= (ob) ? (ob->poselib) : NULL;
- pld->marker= poselib_get_active_pose(pld->act);
-
- /* check if valid poselib */
- if (ELEM3(NULL, pld->ob, pld->pose, pld->arm)) {
- error("PoseLib is only for Armatures in PoseMode");
- pld->state= PL_PREVIEW_ERROR;
- return;
- }
- if (pld->act == NULL) {
- error("Object doesn't have a valid PoseLib");
- pld->state= PL_PREVIEW_ERROR;
- return;
- }
- if (pld->marker == NULL) {
- if ((apply_active==0) && (pld->act->markers.first)) {
- /* just use first one then... */
- pld->marker= pld->act->markers.first;
- printf("PoseLib had no active pose\n");
- }
- else {
- error("PoseLib has no poses to preview/apply");
- pld->state= PL_PREVIEW_ERROR;
- return;
- }
- }
-
- /* make backups for restoring pose */
- poselib_backup_posecopy(pld);
-
- /* set flags for running */
- pld->state= (apply_active) ? PL_PREVIEW_RUNONCE : PL_PREVIEW_RUNNING;
- pld->redraw= PL_PREVIEW_REDRAWALL;
- pld->flag= PL_PREVIEW_FIRSTTIME;
-
- /* set depsgraph flags */
- /* make sure the lock is set OK, unlock can be accidentally saved? */
- pld->pose->flag |= POSE_LOCKED;
- pld->pose->flag &= ~POSE_DO_UNLOCK;
-
- /* clear strings + search */
- strcpy(pld->headerstr, "");
- strcpy(pld->searchstr, "");
- strcpy(pld->searchold, "");
- pld->search_cursor= 0;
-}
-
-/* After previewing poses */
-static void poselib_preview_cleanup (tPoseLib_PreviewData *pld)
-{
- Object *ob= pld->ob;
- bPose *pose= pld->pose;
- bArmature *arm= pld->arm;
- bAction *act= pld->act;
- TimeMarker *marker= pld->marker;
-
- /* this signal does one recalc on pose, then unlocks, so ESC or edit will work */
- pose->flag |= POSE_DO_UNLOCK;
-
- /* clear pose if cancelled */
- if (pld->state == PL_PREVIEW_CANCEL) {
- poselib_backup_restore(pld);
-
- /* old optimize trick... this enforces to bypass the depgraph
- * - note: code copied from transform_generics.c -> recalcData()
- */
- if ((arm->flag & ARM_DELAYDEFORM)==0)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); /* sets recalc flags */
- else
- where_is_pose(ob);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- else if (pld->state == PL_PREVIEW_CONFIRM) {
- /* tag poses as appropriate */
- poselib_keytag_pose(pld);
-
- /* change active pose setting */
- act->active_marker= BLI_findindex(&act->markers, marker) + 1;
- action_set_activemarker(act, marker, 0);
-
- /* Update event for pose and deformation children */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- /* updates */
- if (IS_AUTOKEY_MODE(NORMAL)) {
- remake_action_ipos(ob->action);
-
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
- else {
- /* need to trick depgraph, action is not allowed to execute on pose */
- where_is_pose(ob);
- ob->recalc= 0;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
-
- /* free memory used for backups */
- BLI_freelistN(&pld->backups);
- BLI_freelistN(&pld->searchp);
-}
-
-
-
-/* This tool allows users to preview the pose from the pose-lib using the mouse-scrollwheel/pageupdown
- * It is also used to apply the active poselib pose only
- */
-void poselib_preview_poses (Object *ob, short apply_active)
-{
- tPoseLib_PreviewData pld;
-
- unsigned short event;
- short val=0;
- char ascii;
-
- /* check if valid poselib */
- poselib_preview_init_data(&pld, ob, apply_active);
- if (pld.state == PL_PREVIEW_ERROR)
- return;
-
- /* start preview loop */
- while (ELEM(pld.state, PL_PREVIEW_RUNNING, PL_PREVIEW_RUNONCE)) {
- /* preview a pose */
- if (pld.redraw) {
- /* only recalc pose (and its dependencies) if pose has changed */
- if (pld.redraw == PL_PREVIEW_REDRAWALL) {
- /* don't clear pose if firsttime */
- if ((pld.flag & PL_PREVIEW_FIRSTTIME)==0)
- poselib_backup_restore(&pld);
- else
- pld.flag &= ~PL_PREVIEW_FIRSTTIME;
-
- /* pose should be the right one to draw (unless we're temporarily not showing it) */
- if ((pld.flag & PL_PREVIEW_SHOWORIGINAL)==0)
- poselib_apply_pose(&pld);
-
- /* old optimize trick... this enforces to bypass the depgraph
- * - note: code copied from transform_generics.c -> recalcData()
- */
- if ((pld.arm->flag & ARM_DELAYDEFORM)==0)
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); /* sets recalc flags */
- else
- where_is_pose(ob);
- }
-
- /* do header print - if interactively previewing */
- if (pld.state == PL_PREVIEW_RUNNING) {
- if (pld.flag & PL_PREVIEW_SHOWORIGINAL) {
- sprintf(pld.headerstr, "PoseLib Previewing Pose: [Showing Original Pose] | Use Tab to start previewing poses again");
- headerprint(pld.headerstr);
- }
- else if (pld.searchstr[0]) {
- char tempstr[65];
- char markern[64];
- short index;
-
- /* get search-string */
- index= pld.search_cursor;
-
- if (IN_RANGE(index, 0, 64)) {
- memcpy(&tempstr[0], &pld.searchstr[0], index);
- tempstr[index]= '|';
- memcpy(&tempstr[index+1], &pld.searchstr[index], 64-index);
- }
- else {
- strncpy(tempstr, pld.searchstr, 64);
- }
-
- /* get marker name */
- if (pld.marker)
- strcpy(markern, pld.marker->name);
- else
- strcpy(markern, "No Matches");
-
- sprintf(pld.headerstr, "PoseLib Previewing Pose: Filter - [%s] | Current Pose - \"%s\" | Use ScrollWheel or PageUp/Down to change", tempstr, markern);
- headerprint(pld.headerstr);
- }
- else {
- sprintf(pld.headerstr, "PoseLib Previewing Pose: \"%s\" | Use ScrollWheel or PageUp/Down to change", pld.marker->name);
- headerprint(pld.headerstr);
- }
- }
-
- /* force drawing of view + clear redraw flag */
- force_draw(0);
- pld.redraw= PL_PREVIEW_NOREDRAW;
- }
-
- /* stop now if only running once */
- if (pld.state == PL_PREVIEW_RUNONCE) {
- pld.state = PL_PREVIEW_CONFIRM;
- break;
- }
-
- /* essential for idling subloop */
- if (qtest() == 0)
- PIL_sleep_ms(2);
-
- /* emptying queue and reading events */
- while ( qtest() ) {
- event= extern_qread_ext(&val, &ascii);
-
- /* event processing */
- if (val) {
- poselib_preview_handle_event(&pld, event, ascii);
- }
- }
- }
-
- /* finish up */
- poselib_preview_cleanup(&pld);
-
- BIF_undo_push("PoseLib Apply Pose");
-}
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c
deleted file mode 100644
index c2a2be80e89..00000000000
--- a/source/blender/src/poseobject.c
+++ /dev/null
@@ -1,1743 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Ton Roosendaal, Blender Foundation '05, full recode.
- *
- * ***** END GPL LICENSE BLOCK *****
- * support for animation modes - Reevan McKay
- */
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_blender.h"
-#include "BKE_constraint.h"
-#include "BKE_deform.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-#include "BKE_ipo.h"
-
-#include "BIF_editarmature.h"
-#include "BIF_editaction.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_poseobject.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_screen.h"
-
-#include "BDR_editobject.h"
-
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_trans_types.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "transform.h"
-
-#include "BIF_transform.h" /* for autokey TFM_TRANSLATION, etc */
-
-void enter_posemode(void)
-{
- Base *base;
- Object *ob;
- bArmature *arm;
-
- if(G.scene->id.lib) return;
- base= BASACT;
- if(base==NULL) return;
-
- ob= base->object;
-
- if (ob->id.lib){
- error ("Can't pose libdata");
- return;
- }
-
- switch (ob->type){
- case OB_ARMATURE:
- arm= get_armature(ob);
- if( arm==NULL ) return;
-
- ob->flag |= OB_POSEMODE;
- base->flag= ob->flag;
-
- allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWVIEW3D, 0);
- break;
- default:
- return;
- }
-
- if (G.obedit) exit_editmode(EM_FREEDATA|EM_WAITCURSOR);
- G.f &= ~(G_VERTEXPAINT | G_TEXTUREPAINT | G_WEIGHTPAINT | G_SCULPTMODE);
-}
-
-void set_pose_keys (Object *ob)
-{
- bArmature *arm= ob->data;
- bPoseChannel *chan;
-
- if (ob->pose){
- for (chan=ob->pose->chanbase.first; chan; chan=chan->next){
- Bone *bone= chan->bone;
- if(bone && (bone->flag & BONE_SELECTED) && (arm->layer & bone->layer)) {
- chan->flag |= POSE_KEY;
- }
- else {
- chan->flag &= ~POSE_KEY;
- }
- }
- }
-}
-
-
-void exit_posemode(void)
-{
- Object *ob= OBACT;
- Base *base= BASACT;
-
- if(ob==NULL) return;
-
- ob->flag &= ~OB_POSEMODE;
- base->flag= ob->flag;
-
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWHEADERS, 0);
- allqueue(REDRAWBUTSALL, 0);
-
- scrarea_queue_headredraw(curarea);
-}
-
-/* called by buttons to find a bone to display/edit values for */
-bPoseChannel *get_active_posechannel (Object *ob)
-{
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
-
- if ELEM(NULL, ob, ob->pose)
- return NULL;
-
- /* find active */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone && (pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer))
- return pchan;
- }
-
- return NULL;
-}
-
-/* if a selected or active bone is protected, throw error (oonly if warn==1) and return 1 */
-/* only_selected==1 : the active bone is allowed to be protected */
-static short pose_has_protected_selected(Object *ob, short only_selected, short warn)
-{
- /* check protection */
- if (ob->proxy) {
- bPoseChannel *pchan;
- bArmature *arm= ob->data;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone && (pchan->bone->layer & arm->layer)) {
- if (pchan->bone->layer & arm->layer_protected) {
- if (only_selected && (pchan->bone->flag & BONE_ACTIVE));
- else if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED))
- break;
- }
- }
- }
- if (pchan) {
- if (warn) error("Cannot change Proxy protected bones");
- return 1;
- }
- }
- return 0;
-}
-
-/* only for real IK, not for auto-IK */
-int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
-{
- bConstraint *con;
- Bone *bone;
-
- /* No need to check if constraint is active (has influence),
- * since all constraints with CONSTRAINT_IK_AUTO are active */
- for(con= pchan->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
- bKinematicConstraint *data= con->data;
- if((data->flag & CONSTRAINT_IK_AUTO)==0)
- return 1;
- }
- }
- for(bone= pchan->bone->childbase.first; bone; bone= bone->next) {
- pchan= get_pose_channel(ob->pose, bone->name);
- if(pchan && pose_channel_in_IK_chain(ob, pchan))
- return 1;
- }
- return 0;
-}
-
-/* ********************************************** */
-
-/* For the object with pose/action: create path curves for selected bones
- * This recalculates the WHOLE path within the pchan->pathsf and pchan->pathef range
- */
-void pose_calculate_path(Object *ob)
-{
- bArmature *arm;
- bPoseChannel *pchan;
- Base *base;
- float *fp;
- int cfra;
- int sfra, efra;
-
- if (ob==NULL || ob->pose==NULL)
- return;
- arm= ob->data;
-
- /* version patch for older files here (do_versions patch too complicated) */
- if ((arm->pathsf == 0) || (arm->pathef == 0)) {
- arm->pathsf = SFRA;
- arm->pathef = EFRA;
- }
- if (arm->pathsize == 0) {
- arm->pathsize = 1;
- }
-
- /* set frame values */
- cfra= CFRA;
- sfra = arm->pathsf;
- efra = arm->pathef;
- if (efra <= sfra) {
- error("Can't calculate paths when pathlen <= 0");
- return;
- }
-
- waitcursor(1);
-
- /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */
- if ((ob->recalc & OB_RECALC)==0) {
- ob->recalc |= OB_RECALC;
- DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
- }
- else
- DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
-
-
- /* malloc the path blocks */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) {
- if (arm->layer & pchan->bone->layer) {
- pchan->pathlen= efra-sfra+1;
- pchan->pathsf= sfra;
- pchan->pathef= efra+1;
- if (pchan->path)
- MEM_freeN(pchan->path);
- pchan->path= MEM_callocN(3*pchan->pathlen*sizeof(float), "pchan path");
- }
- }
- }
-
- for (CFRA=sfra; CFRA<=efra; CFRA++) {
- /* do all updates */
- for (base= FIRSTBASE; base; base= base->next) {
- if (base->object->recalc) {
- int temp= base->object->recalc;
- object_handle_update(base->object);
- base->object->recalc= temp;
- }
- }
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->path) {
- fp= pchan->path+3*(CFRA-sfra);
-
- if (arm->pathflag & ARM_PATH_HEADS) {
- VECCOPY(fp, pchan->pose_head);
- }
- else {
- VECCOPY(fp, pchan->pose_tail);
- }
-
- Mat4MulVecfl(ob->obmat, fp);
- }
- }
- }
- }
- }
-
- waitcursor(0);
-
- CFRA= cfra;
- allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-/* For the object with pose/action: update paths for those that have got them
- * This should selectively update paths that exist...
- */
-void pose_recalculate_paths(Object *ob)
-{
- bArmature *arm;
- bPoseChannel *pchan;
- Base *base;
- float *fp;
- int cfra;
- int sfra, efra;
-
- if (ob==NULL || ob->pose==NULL)
- return;
- arm= ob->data;
-
- /* set frame values */
- cfra = CFRA;
- sfra = efra = cfra;
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
- if (pchan->path) {
- /* if the pathsf and pathef aren't initialised, abort! */
- if (ELEM(0, pchan->pathsf, pchan->pathef))
- return;
-
- /* try to increase area to do (only as much as needed) */
- sfra= MIN2(sfra, pchan->pathsf);
- efra= MAX2(efra, pchan->pathef);
- }
- }
- }
- if (efra <= sfra) return;
-
- waitcursor(1);
-
- /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */
- if ((ob->recalc & OB_RECALC)==0) {
- ob->recalc |= OB_RECALC;
- DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
- }
- else
- DAG_object_update_flags(G.scene, ob, screen_view3d_layers());
-
- for (CFRA=sfra; CFRA<=efra; CFRA++) {
- /* do all updates */
- for (base= FIRSTBASE; base; base= base->next) {
- if (base->object->recalc) {
- int temp= base->object->recalc;
- object_handle_update(base->object);
- base->object->recalc= temp;
- }
- }
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (arm->layer & pchan->bone->layer)) {
- if (pchan->path) {
- /* only update if:
- * - in range of this pchan's existing path
- * - ... insert evil filtering/optimising conditions here...
- */
- if (IN_RANGE(CFRA, pchan->pathsf, pchan->pathef)) {
- fp= pchan->path+3*(CFRA-sfra);
-
- if (arm->pathflag & ARM_PATH_HEADS) {
- VECCOPY(fp, pchan->pose_head);
- }
- else {
- VECCOPY(fp, pchan->pose_tail);
- }
-
- Mat4MulVecfl(ob->obmat, fp);
- }
- }
- }
- }
- }
-
- waitcursor(0);
-
- CFRA= cfra;
- ob->pose->flag &= ~POSE_RECALCPATHS;
- allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-/* for the object with pose/action: clear path curves for selected bones only */
-void pose_clear_paths(Object *ob)
-{
- bPoseChannel *pchan;
-
- if (ob==NULL || ob->pose==NULL)
- return;
-
- /* free the path blocks */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) {
- if (pchan->path) {
- MEM_freeN(pchan->path);
- pchan->path= NULL;
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-
-void pose_select_constraint_target(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- bConstraint *con;
-
- /* paranoia checks */
- if (!ob && !ob->pose) return;
- if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
- for (con= pchan->constraints.first; con; con= con->next) {
- bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
- ListBase targets = {NULL, NULL};
- bConstraintTarget *ct;
-
- if (cti && cti->get_constraint_targets) {
- cti->get_constraint_targets(con, &targets);
-
- for (ct= targets.first; ct; ct= ct->next) {
- if ((ct->tar == ob) && (ct->subtarget[0])) {
- bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget);
- if(pchanc)
- pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
- }
- }
-
- if (cti->flush_constraint_targets)
- cti->flush_constraint_targets(con, &targets, 1);
- }
- }
- }
- }
- }
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- BIF_undo_push("Select constraint target");
-
-}
-
-void pose_select_hierarchy(short direction, short add_to_sel)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- Bone *curbone, *pabone, *chbone;
-
- /* paranoia checks */
- if (!ob && !ob->pose) return;
- if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- curbone= pchan->bone;
-
- if (arm->layer & curbone->layer) {
- if (curbone->flag & (BONE_ACTIVE)) {
- if (direction == BONE_SELECT_PARENT) {
-
- if (pchan->parent == NULL) continue;
- else pabone= pchan->parent->bone;
-
- if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_P)) {
-
- if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
- curbone->flag &= ~BONE_ACTIVE;
- pabone->flag |= (BONE_ACTIVE|BONE_SELECTED);
-
- select_actionchannel_by_name (ob->action, pchan->name, 0);
- select_actionchannel_by_name (ob->action, pchan->parent->name, 1);
- break;
- }
- } else { // BONE_SELECT_CHILD
-
- if (pchan->child == NULL) continue;
- else chbone = pchan->child->bone;
-
- if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_P)) {
-
- if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
- curbone->flag &= ~BONE_ACTIVE;
- chbone->flag |= (BONE_ACTIVE|BONE_SELECTED);
-
- select_actionchannel_by_name (ob->action, pchan->name, 0);
- select_actionchannel_by_name (ob->action, pchan->child->name, 1);
- break;
- }
- }
- }
- }
- }
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- if (direction==BONE_SELECT_PARENT)
- BIF_undo_push("Select pose bone parent");
- if (direction==BONE_SELECT_CHILD)
- BIF_undo_push("Select pose bone child");
-}
-
-/* context: active channel */
-void pose_special_editmenu(void)
-{
- Object *ob= OBACT;
- short nr;
-
- /* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- nr= pupmenu("Specials%t|Select Constraint Target%x1|Flip Left-Right Names%x2|Calculate Paths%x3|Clear Paths%x4|Clear User Transform %x5|Relax Pose %x6|%l|AutoName Left-Right%x7|AutoName Front-Back%x8|AutoName Top-Bottom%x9");
- if(nr==1) {
- pose_select_constraint_target();
- }
- else if(nr==2) {
- pose_flip_names();
- }
- else if(nr==3) {
- pose_calculate_path(ob);
- }
- else if(nr==4) {
- pose_clear_paths(ob);
- }
- else if(nr==5) {
- rest_pose(ob->pose);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Clear User Transform Pose");
- }
- else if(nr==6) {
- pose_relax();
- }
- else if(ELEM3(nr, 7, 8, 9)) {
- pose_autoside_names(nr-7);
- }
-}
-
-void pose_add_IK(void)
-{
- Object *ob= OBACT;
-
- /* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- add_constraint(1); /* 1 means only IK */
-}
-
-/* context: all selected channels */
-void pose_clear_IK(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- bConstraint *con;
- bConstraint *next;
-
- /* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- if(pose_has_protected_selected(ob, 0, 1))
- return;
-
- if(okee("Remove IK constraint(s)")==0) return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
-
- for(con= pchan->constraints.first; con; con= next) {
- next= con->next;
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
- BLI_remlink(&pchan->constraints, con);
- free_constraint_data(con);
- MEM_freeN(con);
- }
- }
- pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET);
- }
- }
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- BIF_undo_push("Remove IK constraint(s)");
-}
-
-void pose_clear_constraints(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
-
- /* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- if(pose_has_protected_selected(ob, 0, 1))
- return;
-
- if(okee("Remove Constraints")==0) return;
-
- /* find active */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
- free_constraints(&pchan->constraints);
- pchan->constflag= 0;
- }
- }
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- BIF_undo_push("Remove Constraint(s)");
-
-}
-
-
-void pose_copy_menu(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan, *pchanact;
- short nr=0;
- int i=0;
-
- /* paranoia checks */
- if (ELEM(NULL, ob, ob->pose)) return;
- if ((ob==G.obedit) || (ob->flag & OB_POSEMODE)==0) return;
-
- /* find active */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone->flag & BONE_ACTIVE)
- break;
- }
-
- if (pchan==NULL) return;
- pchanact= pchan;
-
- /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable,
- * but for constraints (just add local constraints)
- */
- if (pose_has_protected_selected(ob, 1, 0)) {
- i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
- if (i < 25)
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5");
- else
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4");
- }
- else {
- i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
- if (i < 25)
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
- else
- nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8");
- }
-
- if (nr <= 0)
- return;
-
- if (nr != 5) {
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ( (arm->layer & pchan->bone->layer) &&
- (pchan->bone->flag & BONE_SELECTED) &&
- (pchan != pchanact) )
- {
- switch (nr) {
- case 1: /* Local Location */
- VECCOPY(pchan->loc, pchanact->loc);
- break;
- case 2: /* Local Rotation */
- QUATCOPY(pchan->quat, pchanact->quat);
- break;
- case 3: /* Local Size */
- VECCOPY(pchan->size, pchanact->size);
- break;
- case 4: /* All Constraints */
- {
- ListBase tmp_constraints = {NULL, NULL};
-
- /* copy constraints to tmpbase and apply 'local' tags before
- * appending to list of constraints for this channel
- */
- copy_constraints(&tmp_constraints, &pchanact->constraints);
- if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) {
- bConstraint *con;
-
- /* add proxy-local tags */
- for (con= tmp_constraints.first; con; con= con->next)
- con->flag |= CONSTRAINT_PROXY_LOCAL;
- }
- addlisttolist(&pchan->constraints, &tmp_constraints);
-
- /* update flags (need to add here, not just copy) */
- pchan->constflag |= pchanact->constflag;
-
- if (ob->pose)
- ob->pose->flag |= POSE_RECALC;
- }
- break;
- case 6: /* Transform Locks */
- pchan->protectflag = pchanact->protectflag;
- break;
- case 7: /* IK (DOF) settings */
- {
- pchan->ikflag = pchanact->ikflag;
- VECCOPY(pchan->limitmin, pchanact->limitmin);
- VECCOPY(pchan->limitmax, pchanact->limitmax);
- VECCOPY(pchan->stiffness, pchanact->stiffness);
- pchan->ikstretch= pchanact->ikstretch;
- }
- break;
- case 8: /* Custom Bone Shape */
- pchan->custom = pchanact->custom;
- break;
- case 9: /* Visual Location */
- armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);
- break;
- case 10: /* Visual Rotation */
- {
- float delta_mat[4][4], quat[4];
-
- armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
- Mat4ToQuat(delta_mat, quat);
- QUATCOPY(pchan->quat, quat);
- }
- break;
- case 11: /* Visual Size */
- {
- float delta_mat[4][4], size[4];
-
- armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
- Mat4ToSize(delta_mat, size);
- VECCOPY(pchan->size, size);
- }
- }
- }
- }
- }
- else { /* constraints, optional (note: max we can have is 24 constraints) */
- bConstraint *con, *con_back;
- int const_toggle[24];
- ListBase const_copy = {NULL, NULL};
-
- duplicatelist(&const_copy, &(pchanact->constraints));
-
- /* build the puplist of constraints */
- for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){
- const_toggle[i]= 1;
- add_numbut(i, TOG|INT, con->name, 0, 0, &(const_toggle[i]), "");
- }
-
- if (!do_clever_numbuts("Select Constraints", i, REDRAW)) {
- BLI_freelistN(&const_copy);
- return;
- }
-
- /* now build a new listbase from the options selected */
- for (i=0, con=const_copy.first; con; i++) {
- /* if not selected, free/remove it from the list */
- if (!const_toggle[i]) {
- con_back= con->next;
- BLI_freelinkN(&const_copy, con);
- con= con_back;
- }
- else
- con= con->next;
- }
-
- /* Copy the temo listbase to the selected posebones */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if ( (arm->layer & pchan->bone->layer) &&
- (pchan->bone->flag & BONE_SELECTED) &&
- (pchan!=pchanact) )
- {
- ListBase tmp_constraints = {NULL, NULL};
-
- /* copy constraints to tmpbase and apply 'local' tags before
- * appending to list of constraints for this channel
- */
- copy_constraints(&tmp_constraints, &const_copy);
- if ((ob->proxy) && (pchan->bone->layer & arm->layer_protected)) {
- bConstraint *con;
-
- /* add proxy-local tags */
- for (con= tmp_constraints.first; con; con= con->next)
- con->flag |= CONSTRAINT_PROXY_LOCAL;
- }
- addlisttolist(&pchan->constraints, &tmp_constraints);
-
- /* update flags (need to add here, not just copy) */
- pchan->constflag |= pchanact->constflag;
- }
- }
- BLI_freelistN(&const_copy);
- update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
-
- if (ob->pose)
- ob->pose->flag |= POSE_RECALC;
- }
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations
-
- allqueue (REDRAWVIEW3D, 0);
- allqueue (REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWOOPS, 0);
-
- BIF_undo_push("Copy Pose Attributes");
-
-}
-
-/* ******************** copy/paste pose ********************** */
-
-static bPose *g_posebuf=NULL;
-
-void free_posebuf(void)
-{
- if (g_posebuf) {
- // was copied without constraints
- BLI_freelistN (&g_posebuf->chanbase);
- MEM_freeN (g_posebuf);
- }
- g_posebuf=NULL;
-}
-
-void copy_posebuf (void)
-{
- Object *ob= OBACT;
-
- if (!ob || !ob->pose){
- error ("No Pose");
- return;
- }
-
- free_posebuf();
-
- set_pose_keys(ob); // sets chan->flag to POSE_KEY if bone selected
- copy_pose(&g_posebuf, ob->pose, 0);
-
-}
-
-void paste_posebuf (int flip)
-{
- Object *ob= OBACT;
- bPoseChannel *chan, *pchan;
- float eul[4];
- char name[32];
-
- if (!ob || !ob->pose)
- return;
-
- if (!g_posebuf){
- error ("Copy buffer is empty");
- return;
- }
-
- /*
- // disabled until protected bones in proxies follow the rules everywhere else!
- if(pose_has_protected_selected(ob, 1, 1))
- return;
- */
-
- /* Safely merge all of the channels in this pose into
- any existing pose */
- for (chan=g_posebuf->chanbase.first; chan; chan=chan->next) {
- if (chan->flag & POSE_KEY) {
- BLI_strncpy(name, chan->name, sizeof(name));
- if (flip)
- bone_flip_name (name, 0); // 0 = don't strip off number extensions
-
- /* only copy when channel exists, poses are not meant to add random channels to anymore */
- pchan= get_pose_channel(ob->pose, name);
-
- if (pchan) {
- /* only loc rot size */
- /* only copies transform info for the pose */
- VECCOPY(pchan->loc, chan->loc);
- VECCOPY(pchan->size, chan->size);
- QUATCOPY(pchan->quat, chan->quat);
- pchan->flag= chan->flag;
-
- if (flip) {
- pchan->loc[0]*= -1;
-
- QuatToEul(pchan->quat, eul);
- eul[1]*= -1;
- eul[2]*= -1;
- EulToQuat(eul, pchan->quat);
- }
-
- if (autokeyframe_cfra_can_key(ob)) {
- ID *id= &ob->id;
-
- /* Set keys on pose */
- if (chan->flag & POSE_ROT) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0);
- }
- if (chan->flag & POSE_SIZE) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0);
- }
- if (chan->flag & POSE_LOC) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0);
- }
-
- /* clear any unkeyed tags */
- if (chan->bone)
- chan->bone->flag &= ~BONE_UNKEYED;
- }
- else {
- /* add unkeyed tags */
- if (chan->bone)
- chan->bone->flag |= BONE_UNKEYED;
- }
- }
- }
- }
-
- /* Update event for pose and deformation children */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if (IS_AUTOKEY_ON) {
- remake_action_ipos(ob->action);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- }
- else {
- /* need to trick depgraph, action is not allowed to execute on pose */
- where_is_pose(ob);
- ob->recalc= 0;
- }
-
- BIF_undo_push("Paste Action Pose");
-}
-
-/* ********************************************** */
-
-/* context weightpaint and deformer in posemode */
-void pose_adds_vgroups(Object *meshobj, int heatweights)
-{
- extern VPaint Gwp; /* from vpaint */
- Object *poseobj= modifiers_isDeformedByArmature(meshobj);
-
- if(poseobj==NULL || (poseobj->flag & OB_POSEMODE)==0) {
- error("The active object must have a deforming armature in pose mode");
- return;
- }
-
- add_verts_to_dgroups(meshobj, poseobj, heatweights, (Gwp.flag & VP_MIRROR_X));
-
- if(heatweights)
- BIF_undo_push("Apply Bone Heat Weights to Vertex Groups");
- else
- BIF_undo_push("Apply Bone Envelopes to Vertex Groups");
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
-
- // and all its relations
- DAG_object_flush_update(G.scene, meshobj, OB_RECALC_DATA);
-}
-
-/* ********************************************** */
-
-/* adds a new pose-group */
-void pose_add_posegroup ()
-{
- Object *ob= OBACT;
- bPose *pose= (ob) ? ob->pose : NULL;
- bActionGroup *grp;
-
- if (ELEM(NULL, ob, ob->pose))
- return;
-
- grp= MEM_callocN(sizeof(bActionGroup), "PoseGroup");
- strcpy(grp->name, "Group");
- BLI_addtail(&pose->agroups, grp);
- BLI_uniquename(&pose->agroups, grp, "Group", offsetof(bActionGroup, name), 32);
-
- pose->active_group= BLI_countlist(&pose->agroups);
-
- BIF_undo_push("Add Bone Group");
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* Remove the active bone-group */
-void pose_remove_posegroup ()
-{
- Object *ob= OBACT;
- bPose *pose= (ob) ? ob->pose : NULL;
- bActionGroup *grp = NULL;
- bPoseChannel *pchan;
-
- /* sanity checks */
- if (ELEM(NULL, ob, pose))
- return;
- if (pose->active_group <= 0)
- return;
-
- /* get group to remove */
- grp= BLI_findlink(&pose->agroups, pose->active_group-1);
- if (grp) {
- /* adjust group references (the trouble of using indices!):
- * - firstly, make sure nothing references it
- * - also, make sure that those after this item get corrected
- */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->agrp_index == pose->active_group)
- pchan->agrp_index= 0;
- else if (pchan->agrp_index > pose->active_group)
- pchan->agrp_index--;
- }
-
- /* now, remove it from the pose */
- BLI_freelinkN(&pose->agroups, grp);
- pose->active_group= 0;
-
- BIF_undo_push("Remove Bone Group");
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-char *build_posegroups_menustr (bPose *pose, short for_pupmenu)
-{
- DynStr *pupds= BLI_dynstr_new();
- bActionGroup *grp;
- char *str;
- char buf[16];
- int i;
-
- /* add title first (and the "none" entry) */
- BLI_dynstr_append(pupds, "Bone Group%t|");
- if (for_pupmenu)
- BLI_dynstr_append(pupds, "Add New%x0|");
- else
- BLI_dynstr_append(pupds, "BG: [None]%x0|");
-
- /* loop through groups, adding them */
- for (grp= pose->agroups.first, i=1; grp; grp=grp->next, i++) {
- if (for_pupmenu == 0)
- BLI_dynstr_append(pupds, "BG: ");
- BLI_dynstr_append(pupds, grp->name);
-
- sprintf(buf, "%%x%d", i);
- BLI_dynstr_append(pupds, buf);
-
- if (grp->next)
- BLI_dynstr_append(pupds, "|");
- }
-
- /* convert to normal MEM_malloc'd string */
- str= BLI_dynstr_get_cstring(pupds);
- BLI_dynstr_free(pupds);
-
- return str;
-}
-
-/* Assign selected pchans to the bone group that the user selects */
-void pose_assign_to_posegroup (short active)
-{
- Object *ob= OBACT;
- bArmature *arm= (ob) ? ob->data : NULL;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan;
- char *menustr;
- int nr;
- short done= 0;
-
- /* sanity checks */
- if (ELEM3(NULL, ob, pose, arm))
- return;
-
- /* get group to affect */
- if ((active==0) || (pose->active_group <= 0)) {
- menustr= build_posegroups_menustr(pose, 1);
- nr= pupmenu_col(menustr, 20);
- MEM_freeN(menustr);
-
- if (nr < 0)
- return;
- else if (nr == 0) {
- /* add new - note: this does an undo push and sets active group */
- pose_add_posegroup();
- }
- else
- pose->active_group= nr;
- }
-
- /* add selected bones to group then */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) {
- pchan->agrp_index= pose->active_group;
- done= 1;
- }
- }
-
- if (done)
- BIF_undo_push("Add Bones To Group");
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* Remove selected pchans from their bone groups */
-void pose_remove_from_posegroups ()
-{
- Object *ob= OBACT;
- bArmature *arm= (ob) ? ob->data : NULL;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan;
- short done= 0;
-
- /* sanity checks */
- if (ELEM3(NULL, ob, pose, arm))
- return;
-
- /* remove selected bones from their groups */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) {
- if (pchan->agrp_index) {
- pchan->agrp_index= 0;
- done= 1;
- }
- }
- }
-
- if (done)
- BIF_undo_push("Remove Bones From Groups");
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* Ctrl-G in 3D-View while in PoseMode */
-void pgroup_operation_with_menu (void)
-{
- Object *ob= OBACT;
- bArmature *arm= (ob) ? ob->data : NULL;
- bPose *pose= (ob) ? ob->pose : NULL;
- bPoseChannel *pchan= NULL;
- int mode;
-
- /* sanity checks */
- if (ELEM3(NULL, ob, pose, arm))
- return;
-
- /* check that something is selected */
- for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
- if ((pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer))
- break;
- }
- if (pchan == NULL)
- return;
-
- /* get mode of action */
- if (pchan)
- mode= pupmenu("Bone Groups%t|Add Selected to Active Group%x1|Add Selected to Group%x2|%|Remove Selected From Groups%x3|Remove Active Group%x4");
- else
- mode= pupmenu("Bone Groups%t|Add New Group%x5|Remove Active Group%x4");
-
- /* handle mode */
- switch (mode) {
- case 1:
- pose_assign_to_posegroup(1);
- break;
- case 2:
- pose_assign_to_posegroup(0);
- break;
- case 5:
- pose_add_posegroup();
- break;
- case 3:
- pose_remove_from_posegroups();
- break;
- case 4:
- pose_remove_posegroup();
- break;
- }
-}
-
-/* ********************************************** */
-
-static short pose_select_same_group (Object *ob)
-{
- bPose *pose= (ob)? ob->pose : NULL;
- bArmature *arm= (ob)? ob->data : NULL;
- bPoseChannel *pchan, *chan;
- short changed= 0;
-
- if (ELEM3(NULL, ob, pose, arm))
- return 0;
-
- /* loop in loop... bad and slow! */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
-
- /* only if group matches (and is not selected or current bone) */
- for (chan= ob->pose->chanbase.first; chan; chan= chan->next) {
- if (arm->layer & chan->bone->layer) {
- if (pchan->agrp_index == chan->agrp_index) {
- chan->bone->flag |= BONE_SELECTED;
- changed= 1;
- }
- }
- }
-
- }
- }
- }
-
- return changed;
-}
-
-static short pose_select_same_layer (Object *ob)
-{
- bPose *pose= (ob)? ob->pose : NULL;
- bArmature *arm= (ob)? ob->data : NULL;
- bPoseChannel *pchan;
- short layers= 0, changed= 0;
-
- if (ELEM3(NULL, ob, pose, arm))
- return 0;
-
- /* figure out what bones are selected */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
- layers |= pchan->bone->layer;
- }
- }
- }
- if (layers == 0)
- return 0;
-
- /* select bones that are on same layers as layers flag */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (layers & pchan->bone->layer) {
- pchan->bone->flag |= BONE_SELECTED;
- changed= 1;
- }
- }
- }
-
- return changed;
-}
-
-
-void pose_select_grouped (short nr)
-{
- short changed = 0;
-
- if (nr == 1) changed= pose_select_same_group(OBACT);
- else if (nr == 2) changed= pose_select_same_layer(OBACT);
-
- if (changed) {
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWACTION, 0);
- BIF_undo_push("Select Grouped");
- }
-}
-
-/* Shift-G in 3D-View while in PoseMode */
-void pose_select_grouped_menu (void)
-{
- short nr;
-
- /* here we go */
- nr= pupmenu("Select Grouped%t|In Same Group%x1|In Same Layer%x2");
- pose_select_grouped(nr);
-}
-
-/* ********************************************** */
-
-/* context active object */
-void pose_flip_names(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- char newname[32];
-
- /* paranoia checks */
- if(!ob && !ob->pose) return;
- if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- if(pose_has_protected_selected(ob, 0, 1))
- return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
- BLI_strncpy(newname, pchan->name, sizeof(newname));
- bone_flip_name(newname, 1); // 1 = do strip off number extensions
- armature_bone_rename(ob->data, pchan->name, newname);
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Flip names");
-}
-
-/* context active object */
-void pose_autoside_names(short axis)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- char newname[32];
-
- /* paranoia checks */
- if (ELEM(NULL, ob, ob->pose)) return;
- if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
-
- if (pose_has_protected_selected(ob, 0, 1))
- return;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
- BLI_strncpy(newname, pchan->name, sizeof(newname));
- bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]);
- armature_bone_rename(ob->data, pchan->name, newname);
- }
- }
- }
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWOOPS, 0);
- BIF_undo_push("Flip names");
-}
-
-/* context active object, or weightpainted object with armature in posemode */
-void pose_activate_flipped_bone(void)
-{
- Object *ob= OBACT;
- bArmature *arm= ob->data;
-
- if(ob==NULL) return;
-
- if(G.f & G_WEIGHTPAINT) {
- ob= modifiers_isDeformedByArmature(ob);
- }
- if(ob && (ob->flag & OB_POSEMODE)) {
- bPoseChannel *pchan, *pchanf;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(arm->layer & pchan->bone->layer) {
- if(pchan->bone->flag & BONE_ACTIVE)
- break;
- }
- }
- if(pchan) {
- char name[32];
-
- BLI_strncpy(name, pchan->name, 32);
- bone_flip_name(name, 1); // 0 = do not strip off number extensions
-
- pchanf= get_pose_channel(ob->pose, name);
- if(pchanf && pchanf!=pchan) {
- pchan->bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE);
- pchanf->bone->flag |= (BONE_SELECTED|BONE_ACTIVE);
-
- /* in weightpaint we select the associated vertex group too */
- if(G.f & G_WEIGHTPAINT) {
- vertexgroup_select_by_name(OBACT, name);
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- }
-
- select_actionchannel_by_name(ob->action, name, 1);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0); /* To force action/constraint ipo update */
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWOOPS, 0);
- }
- }
- }
-}
-
-/* This function pops up the move-to-layer popup widgets when the user
- * presses either SHIFT-MKEY or MKEY in PoseMode OR EditMode (for Armatures)
- */
-void pose_movetolayer(void)
-{
- Object *ob= OBACT;
- bArmature *arm;
- short lay= 0;
-
- if (ob==NULL) return;
- arm= ob->data;
-
- if (G.qual & LR_SHIFTKEY) {
- /* armature layers */
- lay= arm->layer;
- if ( movetolayer_short_buts(&lay, "Armature Layers")==0 ) return;
- if (lay==0) return;
- arm->layer= lay;
- if(ob->pose)
- ob->pose->proxy_layer= lay;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- else if (G.obedit) {
- /* the check for editbone layer moving needs to occur before posemode one to work */
- EditBone *ebo;
- EditBone *flipBone;
-
- for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if (arm->layer & ebo->layer) {
- if (ebo->flag & BONE_SELECTED)
- lay |= ebo->layer;
- }
- }
- if (lay==0) return;
-
- if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return;
- if (lay==0) return;
-
- for (ebo= G.edbo.first; ebo; ebo= ebo->next) {
- if (arm->layer & ebo->layer) {
- if (ebo->flag & BONE_SELECTED) {
- ebo->layer= lay;
- if (arm->flag & ARM_MIRROR_EDIT) {
- flipBone = armature_bone_get_mirrored(ebo);
- if (flipBone)
- flipBone->layer = lay;
- }
- }
- }
- }
-
- BIF_undo_push("Move Bone Layer");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- else if (ob->flag & OB_POSEMODE) {
- /* pose-channel layers */
- bPoseChannel *pchan;
-
- if (pose_has_protected_selected(ob, 0, 1))
- return;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->bone->flag & BONE_SELECTED)
- lay |= pchan->bone->layer;
- }
- }
- if (lay==0) return;
-
- if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return;
- if (lay==0) return;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (arm->layer & pchan->bone->layer) {
- if (pchan->bone->flag & BONE_SELECTED)
- pchan->bone->layer= lay;
- }
- }
-
- BIF_undo_push("Move Bone Layer");
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-}
-
-
-/* for use with pose_relax only */
-static int pose_relax_icu(struct IpoCurve *icu, float framef, float *val, float *frame_prev, float *frame_next)
-{
- if (!icu) {
- return 0;
- }
- else {
- BezTriple *bezt = icu->bezt;
-
- BezTriple *bezt_prev=NULL, *bezt_next=NULL;
- float w1, w2, wtot;
- int i;
-
- for (i=0; i < icu->totvert; i++, bezt++) {
- if (bezt->vec[1][0] < framef - 0.5) {
- bezt_prev = bezt;
- } else {
- break;
- }
- }
-
- if (bezt_prev==NULL) return 0;
-
- /* advance to the next, dont need to advance i */
- bezt = bezt_prev+1;
-
- for (; i < icu->totvert; i++, bezt++) {
- if (bezt->vec[1][0] > framef + 0.5) {
- bezt_next = bezt;
- break;
- }
- }
-
- if (bezt_next==NULL) return 0;
-
- if (val) {
- w1 = framef - bezt_prev->vec[1][0];
- w2 = bezt_next->vec[1][0] - framef;
- wtot = w1 + w2;
- w1=w1/wtot;
- w2=w2/wtot;
-#if 0
- val = (bezt_prev->vec[1][1] * w2) + (bezt_next->vec[1][1] * w1);
-#else
- /* apply the value with a hard coded 6th */
- *val = (((bezt_prev->vec[1][1] * w2) + (bezt_next->vec[1][1] * w1)) + (*val * 5.0f)) / 6.0f;
-#endif
- }
-
- if (frame_prev) *frame_prev = bezt_prev->vec[1][0];
- if (frame_next) *frame_next = bezt_next->vec[1][0];
-
- return 1;
- }
-}
-
-void pose_relax()
-{
- Object *ob = OBACT;
- bPose *pose;
- bAction *act;
- bArmature *arm;
-
- IpoCurve *icu_w, *icu_x, *icu_y, *icu_z;
-
- bPoseChannel *pchan;
- bActionChannel *achan;
- float framef = F_CFRA;
- float frame_prev, frame_next;
- float quat_prev[4], quat_next[4], quat_interp[4], quat_orig[4];
-
- int do_scale = 0;
- int do_loc = 0;
- int do_quat = 0;
- int flag = 0;
- int do_x, do_y, do_z;
-
- if (!ob) return;
-
- pose = ob->pose;
- act = ob->action;
- arm = (bArmature *)ob->data;
-
- if (!pose || !act || !arm) return;
-
- for (pchan=pose->chanbase.first; pchan; pchan= pchan->next) {
-
- pchan->bone->flag &= ~BONE_TRANSFORM;
-
- if (pchan->bone->layer & arm->layer) {
- if (pchan->bone->flag & BONE_SELECTED) {
- /* do we have an ipo curve? */
- achan= get_action_channel(act, pchan->name);
-
- if (achan && achan->ipo) {
- /*calc_ipo(achan->ipo, ctime);*/
-
- do_x = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_X), framef, &pchan->loc[0], NULL, NULL);
- do_y = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_Y), framef, &pchan->loc[1], NULL, NULL);
- do_z = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_Z), framef, &pchan->loc[2], NULL, NULL);
- do_loc += do_x + do_y + do_z;
-
- do_x = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_X), framef, &pchan->size[0], NULL, NULL);
- do_y = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_Y), framef, &pchan->size[1], NULL, NULL);
- do_z = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_Z), framef, &pchan->size[2], NULL, NULL);
- do_scale += do_x + do_y + do_z;
-
- if( ((icu_w = find_ipocurve(achan->ipo, AC_QUAT_W))) &&
- ((icu_x = find_ipocurve(achan->ipo, AC_QUAT_X))) &&
- ((icu_y = find_ipocurve(achan->ipo, AC_QUAT_Y))) &&
- ((icu_z = find_ipocurve(achan->ipo, AC_QUAT_Z))) )
- {
- /* use the quatw keyframe as a basis for others */
- if (pose_relax_icu(icu_w, framef, NULL, &frame_prev, &frame_next)) {
- /* get 2 quats */
- quat_prev[0] = eval_icu(icu_w, frame_prev);
- quat_prev[1] = eval_icu(icu_x, frame_prev);
- quat_prev[2] = eval_icu(icu_y, frame_prev);
- quat_prev[3] = eval_icu(icu_z, frame_prev);
-
- quat_next[0] = eval_icu(icu_w, frame_next);
- quat_next[1] = eval_icu(icu_x, frame_next);
- quat_next[2] = eval_icu(icu_y, frame_next);
- quat_next[3] = eval_icu(icu_z, frame_next);
-
-#if 0
- /* apply the setting, completely smooth */
- QuatInterpol(pchan->quat, quat_prev, quat_next, (framef-frame_prev) / (frame_next-frame_prev) );
-#else
- /* tricky interpolation */
- QuatInterpol(quat_interp, quat_prev, quat_next, (framef-frame_prev) / (frame_next-frame_prev) );
- QUATCOPY(quat_orig, pchan->quat);
- QuatInterpol(pchan->quat, quat_orig, quat_interp, 1.0f/6.0f);
- /* done */
-#endif
- do_quat++;
- }
- }
-
- /* apply BONE_TRANSFORM tag so that autokeying will pick it up */
- pchan->bone->flag |= BONE_TRANSFORM;
- }
- }
- }
- }
-
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
-
- /* do auto-keying */
- if (do_loc) flag |= TFM_TRANSLATION;
- if (do_scale) flag |= TFM_RESIZE;
- if (do_quat) flag |= TFM_ROTATION;
- autokeyframe_pose_cb_func(ob, flag, 0);
-
- /* clear BONE_TRANSFORM flags */
- for (pchan=pose->chanbase.first; pchan; pchan= pchan->next)
- pchan->bone->flag &= ~ BONE_TRANSFORM;
-
- /* do depsgraph flush */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Relax Pose");
-}
-
-/* for use in insertkey, ensure rotation goes other way around */
-void pose_flipquats(void)
-{
- Object *ob = OBACT;
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
-
- if(ob->pose==NULL)
- return;
-
- /* find sel bones */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) {
- /* quaternions have 720 degree range */
- pchan->quat[0]= -pchan->quat[0];
- pchan->quat[1]= -pchan->quat[1];
- pchan->quat[2]= -pchan->quat[2];
- pchan->quat[3]= -pchan->quat[3];
- }
- }
-
- /* do autokey */
- autokeyframe_pose_cb_func(ob, TFM_ROTATION, 0);
-}
-
-
diff --git a/source/blender/src/preview.blend.c b/source/blender/src/preview.blend.c
deleted file mode 100644
index 63731e97342..00000000000
--- a/source/blender/src/preview.blend.c
+++ /dev/null
@@ -1,13952 +0,0 @@
-/* DataToC output of file <preview_blend> */
-
-int datatoc_preview_blend_size= 446288;
-char datatoc_preview_blend[]= {
- 66, 76, 69, 78, 68, 69, 82, 95, 86, 50, 52, 55, 82, 69, 78, 68,
- 0, 0, 0, 32,191,255,241,160, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 20,112,114,101,118,105,101,119, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66, 0, 0, 0, 32,191,255,241,144, 0, 0, 0,165,
- 0, 0, 0, 1, 32, 32, 32, 53, 0, 5, 0, 0, 0,245, 0, 15, 0, 1, 1, 0, 7, 31,229,144, 7,159,144, 32, 0, 0, 0, 0,
- 0, 0, 0, 64, 0, 0, 83, 82, 0, 0, 0,120, 7, 31,229,144, 0, 0, 0,160, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 83, 82,115, 99,114,101,101,110, 0, 45, 83, 99,114,105,112,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 29,221,112, 7, 31,232, 48, 7, 31,232,112, 7, 31,235,176, 7, 31,235,240,
- 13, 64,121,112, 7,159,144, 32, 0, 0, 3,231, 1,143, 4,174, 3,232, 3, 32, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 10,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 7, 29,221,112, 0, 0, 0,161,
- 0, 0, 0, 1, 7, 31,230, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20,
- 7, 31,230, 48, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,230,112, 7, 29,221,112, 0, 0, 0, 0, 0, 0, 3, 32, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,230,112, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,230,176, 7, 31,230, 48, 0, 0, 0, 0,
- 3,232, 3, 32, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,230,176, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,230,240,
- 7, 31,230,112, 0, 0, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,230,240, 0, 0, 0,161,
- 0, 0, 0, 1, 7, 31,231, 48, 7, 31,230,176, 0, 0, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20,
- 7, 31,231, 48, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,231,112, 7, 31,230,240, 0, 0, 0, 0, 3,232, 3, 6, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,231,112, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,231,176, 7, 31,231, 48, 0, 0, 0, 0,
- 3, 32, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,231,176, 0, 0, 0,161, 0, 0, 0, 1, 7, 31,231,240,
- 7, 31,231,112, 0, 0, 0, 0, 3, 32, 3, 6, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 7, 31,231,240, 0, 0, 0,161,
- 0, 0, 0, 1, 7, 31,232, 48, 7, 31,231,176, 0, 0, 0, 0, 1,236, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20,
- 7, 31,232, 48, 0, 0, 0,161, 0, 0, 0, 1, 0, 0, 0, 0, 7, 31,231,240, 0, 0, 0, 0, 1,236, 3, 6, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,232,112, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,232,176, 0, 0, 0, 0, 7, 31,230, 48,
- 7, 31,230,112, 0, 1, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,232,176, 0, 0, 0,162, 0, 0, 0, 1,
- 7, 31,232,240, 7, 31,232,112, 7, 31,230, 48, 7, 31,230,240, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 7, 31,232,240, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,233, 48, 7, 31,232,176, 7, 31,230,112, 7, 31,231, 48, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,233, 48, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,233,112, 7, 31,232,240,
- 7, 31,230,240, 7, 31,231, 48, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,233,112, 0, 0, 0,162,
- 0, 0, 0, 1, 7, 31,233,176, 7, 31,233, 48, 7, 31,230,176, 7, 31,231,112, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 24, 7, 31,233,176, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,233,240, 7, 31,233,112, 7, 31,231, 48, 7, 31,231,176,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,233,240, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,234, 48,
- 7, 31,233,176, 7, 31,231,112, 7, 31,231,176, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,234, 48,
- 0, 0, 0,162, 0, 0, 0, 1, 7, 31,234,112, 7, 31,233,240, 7, 31,230,176, 7, 31,231, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,234,112, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,234,176, 7, 31,234, 48, 7, 29,221,112,
- 7, 31,230,240, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,234,176, 0, 0, 0,162, 0, 0, 0, 1,
- 7, 31,234,240, 7, 31,234,112, 7, 29,221,112, 7, 31,231,240, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 7, 31,234,240, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,235, 48, 7, 31,234,176, 7, 31,231,112, 7, 31,231,240, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,235, 48, 0, 0, 0,162, 0, 0, 0, 1, 7, 31,235,112, 7, 31,234,240,
- 7, 31,230,240, 7, 31,232, 48, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 7, 31,235,112, 0, 0, 0,162,
- 0, 0, 0, 1, 7, 31,235,176, 7, 31,235, 48, 7, 31,231,176, 7, 31,232, 48, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 24, 7, 31,235,176, 0, 0, 0,162, 0, 0, 0, 1, 0, 0, 0, 0, 7, 31,235,112, 7, 31,231,240, 7, 31,232, 48,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,204, 7, 31,235,240, 0, 0, 0,164, 0, 0, 0, 1, 13, 64, 24,144,
- 0, 0, 0, 0, 7, 31,230,240, 7, 31,230, 48, 7, 31,230,112, 7, 31,231, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,232,
- 0, 0, 3, 7, 0, 0, 3, 32, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 3, 7, 0, 0, 3, 33, 0, 0, 0, 0, 0, 0, 3,232,
- 0, 0, 3, 32, 0, 0, 3, 32, 0, 5, 0, 4, 0, 1, 7, 7, 3,233, 0, 1, 1, 0, 1, 0, 2,189, 0, 0, 0, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 22,196, 96, 7, 22,196, 96,
- 7, 31,236,240, 13, 64, 23,128, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,236,240, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,238, 0,
- 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 7, 31,238, 0, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,239, 16, 7, 31,236,240, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 7, 31,239, 16, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,240, 32, 7, 31,238, 0, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,240, 32, 0, 0, 0,163,
- 0, 0, 0, 1, 7, 31,241, 48, 7, 31,239, 16, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,241, 48, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,242, 64,
- 7, 31,240, 32, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 7, 31,242, 64, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,243, 80, 7, 31,241, 48, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 7, 31,243, 80, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,244, 96, 7, 31,242, 64, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,
-112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,244, 96, 0, 0, 0,163,
- 0, 0, 0, 1, 7, 31,245,112, 7, 31,243, 80, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,245,112, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,246,128,
- 7, 31,244, 96, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,244, 96,
- 68, 65, 84, 65, 0, 0, 0,228, 7, 31,246,128, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,247,144, 7, 31,245,112, 80,114,101,118,
-105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
-114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 7, 31,247,144, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,248,160, 7, 31,246,128, 76,105,110,107,115, 32, 97,110,100, 32, 80,105,
-112,101,108,105,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,248,160, 0, 0, 0,163,
- 0, 0, 0, 1, 7, 31,249,176, 7, 31,247,144, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,249,176, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,250,192,
- 7, 31,248,160, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,248,160,
- 68, 65, 84, 65, 0, 0, 0,228, 7, 31,250,192, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,251,208, 7, 31,249,176, 83,104, 97,100,
-101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
-114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,251,208, 68, 65, 84, 65, 0, 0, 0,228,
- 7, 31,251,208, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,252,224, 7, 31,250,192, 77,105,114,114,111,114, 32, 84,114, 97,110,115,
-112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,252,224, 0, 0, 0,163,
- 0, 0, 0, 1, 7, 31,253,240, 7, 31,251,208, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 7, 31,253,240, 0, 0, 0,163, 0, 0, 0, 1, 7, 31,255, 0,
- 7, 31,252,224, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,252,224,
- 68, 65, 84, 65, 0, 0, 0,228, 7, 31,255, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 0, 32, 7, 31,253,240, 77, 97,112, 32,
- 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
-114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,252,224, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 0, 32, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 1, 48, 7, 31,255, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,
-101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 1, 48, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 2, 64, 13, 64, 0, 32, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 2, 64, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 3, 80,
- 13, 64, 1, 48, 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 3, 80, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 4, 96, 13, 64, 2, 64, 83,104, 97,112,
-101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
-105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 2, 64, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 4, 96, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 5,112, 13, 64, 3, 80, 77,101,115,104, 32, 84,111,111,108,115, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 5,112, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 6,128, 13, 64, 4, 96, 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 24, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 6,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 7,144,
- 13, 64, 5,112, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 7,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 8,160, 13, 64, 6,128, 87,111,114,108,
-100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,
-100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 8,160, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 9,176, 13, 64, 7,144, 77,105,115,116, 32, 47, 32, 83,116, 97,114,115,
- 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 9,176, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 10,192, 13, 64, 8,160, 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64, 8,160, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 10,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 11,208,
- 13, 64, 9,176, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 11,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 12,224, 13, 64, 10,192, 77, 97,112, 32,
- 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,
-100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 10,192, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 12,224, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 13,240, 13, 64, 11,208, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 13,240, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 15, 0, 13, 64, 12,224, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 15, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 16, 16,
- 13, 64, 13,240, 67,111,108,111,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 13,240,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 16, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 17, 32, 13, 64, 15, 0, 79, 98,106,101,
- 99,116, 32, 97,110,100, 32, 76,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
- 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 17, 32, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 18, 48, 13, 64, 16, 16, 65,110,105,109, 32,115,101,116,116,105,110,103,
-115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 18, 48, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 19, 64, 13, 64, 17, 32, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 19, 64, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 20, 80,
- 13, 64, 18, 48, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3,210, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 20, 80, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 21, 96, 13, 64, 19, 64, 67,108,111,117,
-100,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,
-117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 21, 96, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 22,112, 13, 64, 20, 80, 83,116,117, 99, 99,105, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 22,112, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 23,128, 13, 64, 21, 96, 87,111,111,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,140, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 23,128, 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0, 0,
- 13, 64, 22,112, 82,101,110,100,101,114, 32, 76, 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 31,236,240,
- 68, 65, 84, 65, 0, 0, 0,204, 13, 64, 24,144, 0, 0, 0,164, 0, 0, 0, 1, 13, 64, 96, 96, 7, 31,235,240, 7, 31,231,112,
- 7, 31,231,176, 7, 31,231, 48, 7, 31,230,176, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 65, 45, 68,171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0,
-128, 0, 0, 0,128, 0, 0, 0,188,163,215,226,128, 0, 0, 0, 0, 0, 3, 33, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 3, 5,
- 0, 0, 3, 33, 0, 0, 3,232, 0, 0, 2,235, 0, 0, 3, 5, 0, 0, 3, 33, 0, 0, 3,232, 0, 0, 0, 0, 0, 0, 2,234,
- 0, 7, 0, 6, 0, 2, 4, 4, 0,200, 2,235, 1, 0, 1, 0, 1, 76, 0, 4, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 86, 32, 13, 64, 94,112, 7, 27,181,240, 7, 27,222,144, 13, 64, 25,144, 13, 64, 85, 16,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 25,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 26,160, 0, 0, 0, 0, 84,114, 97,110,
-115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167,
- 1, 62, 0,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 26,160, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 27,176, 13, 64, 25,144, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 59,144, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 27,176, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 28,192, 13, 64, 26,160, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 28,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 29,208,
- 13, 64, 27,176, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 29,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 30,224, 13, 64, 28,192, 70,111,114,109,
- 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 30,224, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 31,240, 13, 64, 29,208, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,
-101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 1,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 31,240, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 33, 0, 13, 64, 30,224, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 4, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 33, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 34, 16,
- 13, 64, 31,240, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 34, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 35, 32, 13, 64, 33, 0, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 35, 32, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 36, 48, 13, 64, 34, 16, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,
-112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 28, 1, 62, 0,224, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 85, 16, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 36, 48, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 37, 64, 13, 64, 35, 32, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 37, 64, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 38, 80,
- 13, 64, 36, 48, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 36, 48,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 38, 80, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 39, 96, 13, 64, 37, 64, 77,101,115,104,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
-105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 39, 96, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 40,112, 13, 64, 38, 80, 77,111,100,105,102,105,101,114,115, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 40,112, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 41,128, 13, 64, 39, 96, 83,104, 97,112,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64, 39, 96, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 41,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 42,144,
- 13, 64, 40,112, 77,101,115,104, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 42,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 43,160, 13, 64, 41,128, 77,101,115,104,
- 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
-105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 96,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 43,160, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 44,176, 13, 64, 42,144, 84,101,120,116,117,114,101, 32,102, 97, 99,101,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 44,176, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 44,176, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 45,192, 13, 64, 43,160, 85, 86, 32, 67, 97,108, 99,117,108, 97,116,105,111,110, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 45,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 46,208,
- 13, 64, 44,176, 80, 97,105,110,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 46,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 47,224, 13, 64, 45,192, 67,117,114,118,
-101, 32, 97,110,100, 32, 83,117,114,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
-105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 47,224, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 48,240, 13, 64, 46,208, 67,117,114,118,101, 32, 84,111,111,108,115, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 48,240, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 50, 0, 13, 64, 47,224, 67,117,114,118,101, 32, 84,111,111,108,115, 49, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 50, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 51, 16,
- 13, 64, 48,240, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 51, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 52, 32, 13, 64, 50, 0, 76,105,110,107,
-115, 32, 97,110,100, 32, 80,105,112,101,108,105,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
-114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 52, 32, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 53, 48, 13, 64, 51, 16, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 53, 48, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 54, 64, 13, 64, 52, 32, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64, 52, 32, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 54, 64, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 55, 80,
- 13, 64, 53, 48, 83,104, 97,100,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,253, 52, 1, 62, 0,224, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 55, 80,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 55, 80, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 56, 96, 13, 64, 54, 64, 77,105,114,114,
-111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,
-114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252,248,
- 1, 62, 1, 28, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 56, 96, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 57,112, 13, 64, 55, 80, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 16, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 57,112, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 57,112, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 58,128, 13, 64, 56, 96, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252, 16, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 58,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 59,144,
- 13, 64, 57,112, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,252, 16, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 57,112,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 59,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 60,160, 13, 64, 58,128, 82,101,110,100,
-101,114, 32, 76, 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 60,160, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 61,176, 13, 64, 59,144, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 61,176, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 62,192, 13, 64, 60,160, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 62,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 63,208,
- 13, 64, 61,176, 77,105,115,116, 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 63,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 64,224, 13, 64, 62,192, 65,109, 98, 32,
- 79, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,
-100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 62,192, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 64,224, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 65,240, 13, 64, 63,208, 84,101,120,116,117,114,101, 32, 97,110,100, 32,
- 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 65,240, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 67, 0, 13, 64, 64,224, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64, 64,224, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 67, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 68, 16,
- 13, 64, 65,240, 77,117,108,116,105,114,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 68, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 69, 32, 13, 64, 67, 0, 79, 98,106,101,
- 99,116, 32, 97,110,100, 32, 76,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101,
- 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 69, 32, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 70, 48, 13, 64, 68, 16, 65,110,105,109, 32,115,101,116,116,105,110,103,
-115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 70, 48, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 71, 64, 13, 64, 69, 32, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 71, 64, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 72, 80,
- 13, 64, 70, 48, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 72, 80, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 73, 96, 13, 64, 71, 64, 66, 97,107,101,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 28,192, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 73, 96, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 74,112, 13, 64, 72, 80, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 29,208, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 74,112, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 75,128, 13, 64, 73, 96, 80, 97,114,116,105, 99,108,101, 32, 83,121,115,116,101,109, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 75,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 76,144,
- 13, 64, 74,112, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 76,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 77,160, 13, 64, 75,128, 86,105,115,117,
- 97,108,105,122, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,
-105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 77,160, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 78,176, 13, 64, 76,144, 69,120,116,114, 97,115, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 78,176, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 79,192, 13, 64, 77,160, 67,104,105,108,100,114,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64, 77,160, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 79,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 80,208,
- 13, 64, 78,176, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 80,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 81,224, 13, 64, 79,192, 84,101,120,116,
-117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,
-117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64, 81,224, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 82,240, 13, 64, 80,208, 67,111,108,111,114,115, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 80,208, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 82,240, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64, 84, 0, 13, 64, 81,224, 87,111,111,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 84, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 85, 16,
- 13, 64, 82,240, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64, 55, 80,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 85, 16, 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64, 84, 0, 83,107,121, 47,
- 65,116,109,111,115,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,220,
- 13, 64, 86, 32, 0, 0, 0,142, 0, 0, 0, 1, 7,159,132, 32, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 13, 64, 24,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,193, 0, 0, 0,
- 67,163, 0, 0,196, 48, 0, 0, 67,104, 0, 0,193, 0, 0, 0, 67,163, 0, 0,196,125,223, 92, 67,104, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 66, 40, 0, 0, 69, 0, 0, 0, 67,225, 0, 0, 63, 0, 0, 0,
- 63,154,225, 72, 0, 0, 0, 1, 0, 1, 0, 1, 0,200, 2,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 13, 64,160, 96,255,255, 0, 0, 0, 0, 0, 0, 1,150, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 0, 3, 0, 0, 0, 68, 65, 84, 65, 0, 0, 3, 4, 7,159,132, 32, 0, 0, 0,137, 0, 0, 0, 1, 13, 64, 87, 48,
- 13, 64, 86, 32, 0, 0, 0, 1, 63, 51, 51, 51, 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,127,198, 52,188,166, 29,146, 61, 22,153, 97, 0, 0, 0, 0, 61, 43,252, 13, 62,247, 11, 89,191, 95,248, 90, 0, 0, 0, 0,
- 52, 67,176,196, 63, 96, 42,246, 62,247, 67, 44, 0, 0, 0, 0, 64, 78, 45, 74, 62,172, 87,201,194, 41,171, 79, 63,128, 0, 0,
- 63,127,198, 53, 61, 43,251,248, 52, 80, 0, 0, 0, 0, 0, 0,188,166, 29,186, 62,247, 11,119, 63, 96, 43, 16, 0, 0, 0, 0,
- 61, 22,153, 99,191, 95,248,117, 62,247, 67, 75, 0, 0, 0, 0,191,211,125,192,194, 21,161,185, 65,161,133, 59, 63,128, 0, 0,
- 63,139,224,100,190, 96,221, 21,189, 22,154,236,189, 22,153, 97, 61, 60, 27,174, 64,167, 52,239, 63, 95,250,166, 63, 95,248, 90,
- 52, 86, 9, 86, 65, 23,185, 41,190,247, 69,181,190,247, 67, 44, 64, 97,129,137, 64,105, 75, 27, 66, 41,152,145, 66, 41,171, 79,
- 63,105,225, 95, 61, 39,247, 84,186,185, 46,176,184,146,196,144,186,245,126,178, 61, 54,117, 48, 61,165,157, 23, 52,153,160, 0,
- 66,165, 56,225, 68,233,202,192,196,124, 94, 18,194, 71,254, 87,194,165, 77,102,196,233,177, 39, 68,124, 65,193, 66, 72, 0,101,
- 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 45, 68,171, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0,128, 0, 0, 0,128, 0, 0, 0,188,163,215,226,128, 0, 0, 0,
- 63,127,198, 52,188,166, 29,146, 61, 22,153, 97, 0, 0, 0, 0, 61, 43,252, 13, 62,247, 11, 89,191, 95,248, 90, 0, 0, 0, 0,
- 52, 67,176,196, 63, 96, 42,246, 62,247, 67, 44, 0, 0, 0, 0, 64, 78, 45, 74, 62,172, 87,201,194, 41,171, 79, 63,128, 0, 0,
- 63, 92, 99,141,191, 2, 35, 43,188, 46,238,188,188,148, 32, 94, 66, 25,240, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 7,159,156, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0,255,226, 0, 0, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,124, 56, 68,
- 60, 35,215, 10, 67,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 68, 77,201, 64,111, 66,228,191,205, 97,230, 60,149,191,128,
-191, 77,109,116, 63,230,165,248, 0, 20, 0, 0, 0, 7, 0, 99, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,255,255, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 1, 88, 13, 64, 87, 48, 0, 0, 0,141, 0, 0, 0, 1, 13, 64, 88,176, 7,159,132, 32, 0, 0, 0, 2,
- 63, 51, 51, 51, 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, 63,128, 0, 0, 67,122, 0, 0,192,160, 0, 0, 64,160, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 2,235, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 0, 0, 0, 0, 16,
- 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 16, 0, 0, 2,235, 60, 35,215, 10, 60, 35,215, 10, 70,106, 96, 0, 68,122, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,159,184, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 67,122, 0, 0,189,204,204,205, 63,140,204,205, 68, 65, 84, 65, 0, 0, 0,128, 13, 64, 88,176, 0, 0, 0,148, 0, 0, 0, 1,
- 13, 64, 89, 96, 13, 64, 87, 48, 0, 0, 0, 9, 63, 51, 51, 51, 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,194,224, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 5, 0, 0, 0, 17,
- 0, 0, 2,225, 0, 0, 2,227, 0, 0, 0, 5, 0, 0, 0, 17, 0, 0, 2,207, 0, 0, 2,227, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 1, 8, 13, 64, 89, 96, 0, 0, 0,146, 0, 0, 0, 1, 13, 64, 90,144, 13, 64, 88,176, 0, 0, 0, 6,
- 63, 51, 51, 51, 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0,
- 0, 0, 0, 0, 67,128, 0, 0,190,120, 0, 0, 63,159, 0, 0,190,242, 0, 0, 63,188,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124,
- 0, 0, 0, 0, 0, 0, 1,242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 8, 13, 64, 90,144, 0, 0, 0,145, 0, 0, 0, 1, 13, 64, 91,192, 13, 64, 89, 96, 0, 0, 0, 3, 63, 51, 51, 51,
- 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,209, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,190, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0,
- 0, 0, 1,124,195,190, 0, 0,195,190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1,
- 0, 1, 0, 1, 1,108, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3,142, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,176,
- 13, 64, 91,192, 0, 0, 0,230, 0, 0, 0, 1, 13, 64, 92,160, 13, 64, 90,144, 0, 0, 0, 11, 63, 51, 51, 51, 13, 64, 24,144,
-192,128, 0, 0, 67,122, 0, 0,192,128, 0, 0, 67,127, 0, 0,192,128, 0, 0, 66, 72, 0, 0,192,128, 0, 0, 67,127, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 16, 0, 0, 1,124, 63,128, 0, 0, 67,129,128, 0, 70,250, 0, 0, 67,129,128, 0,
- 61,204,204,205, 65, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,180, 13, 64, 92,160, 0, 0, 0,147, 0, 0, 0, 1, 13, 64, 93,128, 13, 64, 91,192, 0, 0, 0, 13, 63, 51, 51, 51,
- 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 68,122, 0, 0, 0, 0, 0, 0, 68,122, 0, 0,192,160, 0, 0, 66,130, 0, 0, 0, 0, 0, 0, 67,182, 0, 0, 0, 0, 1,108,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0,196, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196,
- 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 68,122, 0, 0, 68,122, 0, 0, 61,204,204,205,
- 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,192, 13, 64, 93,128, 0, 0, 0,240, 0, 0, 0, 1, 13, 64, 94,112, 13, 64, 92,160,
- 0, 0, 0, 12, 63, 51, 51, 51, 13, 64, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0,
- 66, 2, 0, 0,196,122, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 66, 2, 0, 0,194,150, 0, 0, 64,160, 0, 0, 0, 0, 1,108,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0,128, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128,
- 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 2, 14, 0, 0, 0, 0, 0, 0, 0, 0, 70,250, 0, 0, 68,122, 0, 0, 60, 35,215, 10,
- 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,200,
- 13, 64, 94,112, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64, 93,128, 0, 0, 0, 5, 63, 51, 51, 51, 13, 64, 24,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 83, 97,118,101, 32, 70,105,108,
-101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,
-111,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,114,101,118,105,101,119, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 82, 0, 0, 0, 0, 1, 76, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,204, 13, 64, 96, 96,
- 0, 0, 0,164, 0, 0, 0, 1, 13, 64,121,112, 13, 64, 24,144, 7, 31,231,240, 7, 31,232, 48, 7, 31,231,176, 7, 31,231,112,
- 0, 0, 0, 0, 63,238, 38, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188,163,215,225,
- 0, 0, 0, 0, 0, 0, 1,237, 0, 0, 3, 31, 0, 0, 0, 0, 0, 0, 3, 5, 0, 0, 1,237, 0, 0, 3, 31, 0, 0, 0, 0,
- 0, 0, 0, 26, 0, 0, 1,237, 0, 0, 3, 31, 0, 0, 0, 27, 0, 0, 3, 5, 0, 9, 0, 8, 0, 1, 6, 6, 1, 51, 2,235,
- 1, 0, 1, 0, 0,220, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,111, 48,
- 13, 64,119,128, 7, 23, 59,224, 7, 23, 59,224, 13, 64, 97, 96, 13, 64,110, 32, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 97, 96,
- 0, 0, 0,163, 0, 0, 0, 1, 13, 64, 98,112, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,
-116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 1, 62, 0,204, 0, 0, 0, 0, 0,162, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 98,112, 0, 0, 0,163, 0, 0, 0, 1,
- 13, 64, 99,128, 13, 64, 97, 96, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64, 99,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,100,144, 13, 64, 98,112,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 64, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,228, 13, 64,100,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,101,160, 13, 64, 99,128, 65,110,105,109, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 1, 62, 0,204,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,101,160,
- 0, 0, 0,163, 0, 0, 0, 1, 13, 64,102,176, 13, 64,100,144, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,192, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,102,176, 0, 0, 0,163, 0, 0, 0, 1,
- 13, 64,103,192, 13, 64,101,160, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,103,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,104,208, 13, 64,102,176,
- 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 64, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,228, 13, 64,104,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,105,224, 13, 64,103,192, 80,114,101,118,105,101,119, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,105,224,
- 0, 0, 0,163, 0, 0, 0, 1, 13, 64,106,240, 13, 64,104,208, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,106,240, 0, 0, 0,163, 0, 0, 0, 1,
- 13, 64,108, 0, 13, 64,105,224, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,108, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,109, 16, 13, 64,106,240,
- 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,228, 13, 64,109, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,110, 32, 13, 64,108, 0, 77, 97,112, 32, 84,111, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,108, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,110, 32,
- 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64,109, 16, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,
-116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228, 1, 62, 0,204, 0, 0, 0, 0, 0,162, 0, 8,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,111, 48, 0, 0, 0,146, 0, 0, 0, 1,
- 7,159,136, 32, 0, 0, 0, 0, 0, 0, 0, 6, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 0, 0, 0, 0, 67,128, 0, 0,189,204, 0, 0, 63,140,192, 0,191,117,128, 0,
- 63,250,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 51, 0, 0, 0, 0, 0, 0, 2,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 3, 4, 7,159,136, 32, 0, 0, 0,137, 0, 0, 0, 1, 13, 64,112, 96,
- 13, 64,111, 48, 0, 0, 0, 1, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 64, 75, 54, 62,191,102,119,191, 11, 73, 11, 0, 0, 0, 0,191, 40,254,108, 62,217,202, 94,191, 30,124,246, 0, 0, 0, 0,
-180,186, 33,218, 63, 82,254,184, 63, 16,248,193, 0, 0, 0, 0, 62, 8,228, 73,192, 33,158, 72,193,210,148,125, 63,128, 0, 0,
- 63, 64, 75, 68,191, 40,254,161, 54, 58,221,101, 0, 0, 0, 0, 62,191,103, 10, 62,217,202,178, 63, 82,255, 4, 0, 0, 0, 0,
-191, 11, 73, 20,191, 30,125, 78, 63, 16,248,219, 0, 0, 0, 0,193, 87,166, 3,193,114, 36, 19, 65,135,230,213, 63,128, 0, 0,
- 63,178,226,132, 62,209, 88, 18, 63, 11, 74,121, 63, 11, 73, 11,191,157, 53,169, 62,238, 53, 87, 63, 30,126,150, 63, 30,124,246,
-181, 45, 39, 38, 63,102,198,153,191, 16,250, 62,191, 16,248,193, 62,126,177, 46,192, 48,197, 31, 65,210,109,176, 65,210,148,125,
- 62,206,202,119,190,181,145,194,185, 84, 1, 62,183, 73, 79,188, 62,174,236, 32, 62,199, 10,100, 63, 64,245, 33, 55, 52,160, 0,
- 68, 40, 79, 84, 68, 60,252,158,196, 84, 35, 68,194, 71,205,165,196, 40, 46, 68,196, 60,214,248, 68, 84, 1, 62, 66, 71,207,188,
- 63,238, 38, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188,163,215,225, 0, 0, 0, 0,
- 63, 64, 75, 54, 62,191,102,119,191, 11, 73, 11, 0, 0, 0, 0,191, 40,254,108, 62,217,202, 94,191, 30,124,246, 0, 0, 0, 0,
-180,186, 33,218, 63, 82,254,184, 63, 16,248,193, 0, 0, 0, 0, 62, 8,228, 73,192, 33,158, 72,193,210,148,125, 63,128, 0, 0,
- 63, 83,252, 84,190,223, 25,104, 62, 40, 52,115, 62,159,211,119, 65,198,183, 96, 65,198,183, 96, 0, 0, 0, 0, 0, 1, 0, 0,
- 7,159,156, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0,255,251, 0, 0, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,213,207,174,
- 60, 35,215, 10, 67,250, 0, 0,188,218, 18,228,188, 23,180, 37,189, 22,146,163,190,122, 51,174,192, 58,244, 29, 54,224, 0, 0,
- 63, 88,146, 56, 64, 71, 37,198, 0, 20, 0, 0, 0, 7, 0,115, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,255,255, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,220, 13, 64,112, 96, 0, 0, 0,142, 0, 0, 0, 1, 13, 64,113,112, 7,159,136, 32, 0, 0, 0, 4,
- 0, 0, 0, 0, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 0, 4, 0, 0, 0, 0, 68,160, 0, 0,196, 46, 0, 0, 67,100, 0, 0, 55,136,197,197, 68, 78,209,118,195,231,222, 40,
- 67, 25,158,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0, 66, 40, 0, 0, 69, 0, 0, 0,
- 67,225, 0, 0, 63, 0, 0, 0, 63,154,225, 72, 0, 0, 0, 1, 0, 1, 0, 1, 3,233, 2,235, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0,
- 1,150, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 88, 13, 64,113,112, 0, 0, 0,141,
- 0, 0, 0, 1, 13, 64,114,240, 13, 64,112, 96, 0, 0, 0, 2, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205,
- 63,128, 0, 0, 67,122, 0, 0,192,160, 0, 0, 64,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 2,235,
- 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 16, 0, 0, 2,235,
- 60, 35,215, 10, 60, 35,215, 10, 70,106, 96, 0, 68,122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7,159,184, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, 68, 65, 84, 65,
- 0, 0, 0,128, 13, 64,114,240, 0, 0, 0,148, 0, 0, 0, 1, 13, 64,115,160, 13, 64,113,112, 0, 0, 0, 9, 63, 51, 51, 51,
- 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,194,224, 0, 0, 0, 0, 0, 0, 0, 62,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 5, 0, 0, 0, 17, 0, 0, 2,225, 0, 0, 2,227, 0, 0, 0, 5, 0, 0, 0, 17,
- 0, 0, 2,207, 0, 0, 2,227, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,115,160, 0, 0, 0,145,
- 0, 0, 0, 1, 13, 64,116,208, 13, 64,114,240, 0, 0, 0, 3, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,
-195,190, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,124,195,190, 0, 0,195,190, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1,108, 1,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,142, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,176, 13, 64,116,208, 0, 0, 0,230, 0, 0, 0, 1,
- 13, 64,117,176, 13, 64,115,160, 0, 0, 0, 11, 63, 51, 51, 51, 13, 64, 96, 96,192,128, 0, 0, 67,122, 0, 0,192,128, 0, 0,
- 67,127, 0, 0,192,128, 0, 0, 66, 72, 0, 0,192,128, 0, 0, 67,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 16,
- 0, 0, 1,124, 63,128, 0, 0, 67,129,128, 0, 70,250, 0, 0, 67,129,128, 0, 61,204,204,205, 65, 32, 0, 0, 0, 8, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,180, 13, 64,117,176, 0, 0, 0,147,
- 0, 0, 0, 1, 13, 64,118,144, 13, 64,116,208, 0, 0, 0, 13, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 68,122, 0, 0, 0, 0, 0, 0, 68,122, 0, 0,
-192,160, 0, 0, 66,130, 0, 0, 0, 0, 0, 0, 67,182, 0, 0, 0, 0, 1,108, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,124,
- 0, 0, 0,196, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 1,124,
- 0, 0, 0, 0, 0, 0, 0, 0, 68,122, 0, 0, 68,122, 0, 0, 61,204,204,205, 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,192,
- 13, 64,118,144, 0, 0, 0,240, 0, 0, 0, 1, 13, 64,119,128, 13, 64,117,176, 0, 0, 0, 12, 63, 51, 51, 51, 13, 64, 96, 96,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 66, 2, 0, 0,196,122, 0, 0, 0, 0, 0, 0,
-191, 0, 0, 0, 66, 2, 0, 0,194,150, 0, 0, 64,160, 0, 0, 0, 0, 1,108, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 2, 14,
- 0, 0, 0,128, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 2, 14,
- 0, 0, 0, 0, 0, 0, 0, 0, 70,250, 0, 0, 68,122, 0, 0, 60, 35,215, 10, 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,200, 13, 64,119,128, 0, 0, 0,144, 0, 0, 0, 1,
- 0, 0, 0, 0, 13, 64,118,144, 0, 0, 0, 5, 63, 51, 51, 51, 13, 64, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 83, 97,118,101, 32, 70,105,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,114, 47,114,101,108,101, 97,115,
-101, 47,100, 97,116, 97,102,105,108,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,114,101,118,105,101,119, 46, 98,108,101,110,
-100, 0, 0, 0, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 8, 0, 46, 0, 0, 0, 0, 1, 85, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,204, 13, 64,121,112, 0, 0, 0,164, 0, 0, 0, 1, 0, 0, 0, 0,
- 13, 64, 96, 96, 7, 29,221,112, 7, 31,230,240, 7, 31,232, 48, 7, 31,231,240, 0, 0, 0, 0, 63,157, 86,198, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 79, 65,252, 0, 0, 0, 0, 0, 0, 0, 0,189, 60, 82,166,188,131, 1,237,
-191,153,213,185,191,128, 0, 0,128, 0, 0, 0,128, 0, 0, 0,193, 65,194,239,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,235,
- 0, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 0, 0, 1,235, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 1,235,
- 0, 0, 0, 27, 0, 0, 3, 5, 0, 11, 0, 10, 0, 1, 1, 1, 1,236, 2,235, 1, 0, 1, 0, 2, 86, 0, 0, 0, 7, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,159,140, 32, 13, 64,145,160, 7, 27,196,112, 7, 27,196,112,
- 13, 64,122,112, 13, 64,136, 64, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,122,112, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,123,128,
- 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 33, 0,167, 1, 62, 0,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64,123,128, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,124,144, 13, 64,122,112, 79,117,116,112,
-117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,
-101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64,124,144, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,125,160, 13, 64,123,128, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,125,160, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64,126,176, 13, 64,124,144, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,126,176, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,127,192,
- 13, 64,125,160, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3,192, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64,127,192, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,128,208, 13, 64,126,176, 76,105,110,107,
- 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,
-105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64,128,208, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,129,224, 13, 64,127,192, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,129,224, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64,130,240, 13, 64,128,208, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,130,240, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,132, 0,
- 13, 64,129,224, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,255, 24, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64,132, 0, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,133, 16, 13, 64,130,240, 83,104, 97,100,
-111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 48,
- 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228,
- 13, 64,133, 16, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,134, 32, 13, 64,132, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32,
- 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,134, 32, 0, 0, 0,163,
- 0, 0, 0, 1, 13, 64,135, 48, 13, 64,133, 16, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 72, 1, 62, 0,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,133, 16, 68, 65, 84, 65, 0, 0, 0,228, 13, 64,135, 48, 0, 0, 0,163, 0, 0, 0, 1, 13, 64,136, 64,
- 13, 64,134, 32, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,228, 1, 62, 0,204, 0, 0, 0, 0, 0, 34, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,228, 13, 64,136, 64, 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64,135, 48, 80,114,101,118,
-105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119,
- 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 1,116,
- 1,152, 1, 76, 0, 4, 0, 0, 2, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 3, 4,
- 7,159,140, 32, 0, 0, 0,137, 0, 0, 0, 1, 13, 64,137, 80, 0, 0, 0, 0, 0, 0, 0, 1, 63, 51, 51, 51, 13, 64,121,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51,160, 0, 0,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 51,162, 33,104, 0, 0, 0, 0,
- 60, 41,199, 78,191,230,129,210,193, 30,230,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 0, 1, 51,160, 0, 0, 0, 0, 0, 0,
-188, 41,199, 79,193, 30,230,226, 63,230,129,216, 63,128, 0, 0, 63,157, 86,198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 61, 60, 82,166, 60,131, 2, 13, 63,153,213,185, 63,128, 0, 0,177,110,137,192, 63, 79, 65,252,179,194,218,164,179,162, 33,104,
- 62,240, 79, 64,191,166, 74, 13,190, 50,105, 0, 65, 30,230,225, 63, 80, 67,132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51,208, 0, 0, 63,158, 26, 71,179,128, 0, 0, 58, 96, 80, 64, 63, 81,241,110,190, 24, 70, 67,189,169, 29,122,
-189, 29,107, 44, 60,107,183,198, 62, 34,200, 16, 61,203, 63,156, 63,157, 86,198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 79, 65,252, 0, 0, 0, 0, 0, 0, 0, 0,189, 60, 82,166,188,131, 1,237,191,153,213,185,191,128, 0, 0,
-128, 0, 0, 0,128, 0, 0, 0,193, 65,194,239,128, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 51,160, 0, 0,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 51,162, 33,104, 0, 0, 0, 0,
- 60, 41,199, 78,191,230,129,210,193, 30,230,225, 63,128, 0, 0, 63, 53, 4,244,191, 53, 4,243, 0, 0, 0, 0, 0, 0, 0, 0,
- 65, 21,104,229, 63,128, 0, 0, 0, 0, 13,255, 0, 2, 0, 0, 7,159,156, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0,255,251, 0, 0,
- 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 59, 88,186,208, 60, 35,215, 10, 67,250, 0, 0,188,218, 18,228,188, 23,180, 37,
-189, 22,146,163, 64,198, 40, 85,192,173,239,178, 54,224, 0, 0, 63, 88,146, 56, 64, 71, 37,198, 0, 20, 0, 0, 0, 7, 0,207,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,255,255, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 8,
- 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,220, 13, 64,137, 80, 0, 0, 0,142,
- 0, 0, 0, 1, 13, 64,138, 96, 7,159,140, 32, 0, 0, 0, 4, 0, 0, 0, 0, 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 68,160, 0, 0,196, 46, 0, 0,
- 67,100, 0, 0, 55,136,197,197, 68, 78,209,118,195,231,222, 40, 67, 25,158,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67,128, 0, 0, 66, 40, 0, 0, 69, 0, 0, 0, 67,225, 0, 0, 63, 0, 0, 0, 63,154,225, 72, 0, 0, 0, 1,
- 0, 1, 0, 1, 3,233, 2,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2,
- 0, 0, 0, 3, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 1,150, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 1, 88, 13, 64,138, 96, 0, 0, 0,141, 0, 0, 0, 1, 13, 64,139,224, 13, 64,137, 80, 0, 0, 0, 2,
- 63, 51, 51, 51, 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67,122, 0, 0,189,204,204,205, 63,140,204,205, 63,128, 0, 0, 67,122, 0, 0,192,160, 0, 0, 64,160, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 2,235, 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 0, 0, 0, 0, 16,
- 0, 0, 0, 16, 0, 0, 3,168, 0, 0, 0, 16, 0, 0, 2,235, 60, 35,215, 10, 60, 35,215, 10, 70,106, 96, 0, 68,122, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,159,184, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 67,122, 0, 0,189,204,204,205, 63,140,204,205, 68, 65, 84, 65, 0, 0, 0,128, 13, 64,139,224, 0, 0, 0,148, 0, 0, 0, 1,
- 13, 64,140,144, 13, 64,138, 96, 0, 0, 0, 9, 63, 51, 51, 51, 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,194,224, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,204,204,205, 0, 0, 0, 5, 0, 0, 0, 17,
- 0, 0, 2,225, 0, 0, 2,227, 0, 0, 0, 5, 0, 0, 0, 17, 0, 0, 2,207, 0, 0, 2,227, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,140,144, 0, 0, 0,146, 0, 0, 0, 1, 13, 64,141,192, 13, 64,139,224, 0, 0, 0, 6,
- 63, 51, 51, 51, 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,128, 0, 0,
- 0, 0, 0, 0, 67,128, 0, 0,190,120, 0, 0, 63,159, 0, 0,190,242, 0, 0, 63,188,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124,
- 0, 0, 0, 0, 0, 0, 1,242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 8, 13, 64,141,192, 0, 0, 0,145, 0, 0, 0, 1, 13, 64,142,240, 13, 64,140,144, 0, 0, 0, 3, 63, 51, 51, 51,
- 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,209, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67,182, 0, 0,195,190, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0,
- 0, 0, 1,124,195,190, 0, 0,195,190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1,
- 0, 1, 0, 1, 1,108, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 3,142, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,176,
- 13, 64,142,240, 0, 0, 0,230, 0, 0, 0, 1, 13, 64,143,208, 13, 64,141,192, 0, 0, 0, 11, 63, 51, 51, 51, 13, 64,121,112,
-192,128, 0, 0, 67,122, 0, 0,192,128, 0, 0, 67,127, 0, 0,192,128, 0, 0, 66, 72, 0, 0,192,128, 0, 0, 67,127, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 16,
- 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0, 16, 0, 0, 1,124, 63,128, 0, 0, 67,129,128, 0, 70,250, 0, 0, 67,129,128, 0,
- 61,204,204,205, 65, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,180, 13, 64,143,208, 0, 0, 0,147, 0, 0, 0, 1, 13, 64,144,176, 13, 64,142,240, 0, 0, 0, 13, 63, 51, 51, 51,
- 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 68,122, 0, 0, 0, 0, 0, 0, 68,122, 0, 0,192,160, 0, 0, 66,130, 0, 0, 0, 0, 0, 0, 67,182, 0, 0, 0, 0, 1,108,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 0,196, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196,
- 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 0, 68,122, 0, 0, 68,122, 0, 0, 61,204,204,205,
- 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,192, 13, 64,144,176, 0, 0, 0,240, 0, 0, 0, 1, 13, 64,145,160, 13, 64,143,208,
- 0, 0, 0, 12, 63, 51, 51, 51, 13, 64,121,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0,
- 66, 2, 0, 0,196,122, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 66, 2, 0, 0,194,150, 0, 0, 64,160, 0, 0, 0, 0, 1,108,
- 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0,128, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128,
- 0, 0, 1,108, 0, 0, 0, 16, 0, 0, 2, 14, 0, 0, 0, 0, 0, 0, 0, 0, 70,250, 0, 0, 68,122, 0, 0, 60, 35,215, 10,
- 66, 72, 0, 0, 0, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,200,
- 13, 64,145,160, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64,144,176, 0, 0, 0, 5, 63, 51, 51, 51, 13, 64,121,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 83, 97,118,101, 32, 70,105,108,
-101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,
-111,112, 47, 0,114, 47,114,101,108,101, 97,115,101, 47,100, 97,116, 97,102,105,108,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-112,114,101,118,105,101,119, 46, 98,108,101,110,100, 0, 0, 0, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 46, 0, 0, 0, 0, 1, 85, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0, 5, 96, 7,159,144, 32,
- 0, 0, 0,135, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67,112,114,101,118,105,101,
-119, 0, 0, 99,101,110,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,159,156, 32,
- 13, 64,193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,147,144, 13, 64,155, 16, 13, 64,147,144, 62, 18, 2, 17, 62,117,122,104,
-191,188,208, 62,188,211,197,192, 65, 59,229, 76, 64,184,106,208,188,211,197,192, 65, 59,229, 76, 64,184,106,208,188,211,197,192,
- 65, 59,229, 76, 64,184,106,208, 0, 0, 0, 2, 62,214,245, 65, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,155, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,155,176,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0, 1, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, 1,224, 0, 60, 0, 32, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 25, 0,141, 2, 88, 2, 88, 0, 2, 0, 2, 0, 0, 0, 24, 0, 4, 0, 0, 0, 0,
- 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 32, 0, 0, 0, 0, 0, 64, 0, 0, 0, 5, 0, 25, 0, 10, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,158, 64, 13, 64,158, 64, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2,
- 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 98, 97, 99,107, 98,117,102, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76,204,205,
- 63, 76,204,205, 63, 76,204,205, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 0, 0, 0, 6,
- 0, 0, 0, 16, 63,128, 0, 0, 63,128, 0, 0, 2,173, 0, 95, 63,217,153,154, 0, 0,172, 68, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 7, 26, 32,144, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,156,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,147,144, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,147,224,
- 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 96, 0,227, 7,159,156, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,147,224, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,148, 48, 13, 64,147,144, 0, 0, 8, 0, 0, 0, 0, 2, 0, 0, 0, 0,
- 46,224, 1,169, 7,159,248, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,148, 48, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,148,128,
- 13, 64,147,224, 0, 0, 0, 33, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1,122, 7,159,172, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,148,128, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,148,208, 13, 64,148, 48, 0, 0, 4, 14, 0, 0, 0, 1, 0, 0, 0, 0,
- 1, 2, 1,220, 7,159,168, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,148,208, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,149, 32,
- 13, 64,148,128, 0, 0, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 48, 1, 67, 7,159,244, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,149, 32, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,149,112, 13, 64,148,208, 0, 0, 0, 32, 0, 0, 0, 4, 0, 0, 16, 0,
- 46,224, 1, 49, 7,159,208, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,149,112, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,149,192,
- 13, 64,149, 32, 0, 0, 0, 33, 0, 0, 0, 2, 0, 0, 0, 0, 1, 1, 1,122, 7,159,212, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,149,192, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,150, 16, 13, 64,149,112, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 20, 0,
- 46,224, 0, 52, 7,159,204, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,150, 16, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,150, 96,
- 13, 64,149,192, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 20, 0, 46,224, 0, 47, 7,159,200, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,150, 96, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,150,176, 13, 64,150, 16, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 20, 0,
- 46,224, 1, 85, 7,159,196, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,150,176, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,151, 0,
- 13, 64,150, 96, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 20, 0, 46,224, 0, 10, 7,159,192, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,151, 0, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,151, 80, 13, 64,150,176, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 20, 0,
- 46,224, 1,113, 7,159,188, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,151, 80, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,151,160,
- 13, 64,151, 0, 0, 0, 0, 4, 0, 0, 0, 11, 0, 0, 0, 0, 1, 1, 1,147, 7,159,240, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,151,160, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,151,240, 13, 64,151, 80, 0, 0, 4, 14, 0, 0, 0, 3, 0, 0, 0, 0,
- 1, 2, 1,220, 7,159,164, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,151,240, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,152, 64,
- 13, 64,151,160, 0, 0, 0, 64, 0, 0, 0, 1, 0, 0, 16, 0, 0,255, 2, 91, 7,159,232, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,152, 64, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,152,144, 13, 64,151,240, 0, 0, 0, 64, 0, 0, 0, 2, 0, 0, 0, 0,
- 0,253, 1,180, 7,159,236, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,152,144, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,152,224,
- 13, 64,152, 64, 0, 0, 0, 32, 0, 0, 0, 15, 0, 0, 0, 0, 1, 0, 1,122, 7,159,252, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,152,224, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,153, 48, 13, 64,152,144, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 1,123, 7,159,228, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,153, 48, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,153,128,
- 13, 64,152,224, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 1, 0, 1,123, 7,159,216, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,153,128, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,153,208, 13, 64,153, 48, 0, 0, 4, 28, 0, 0, 0, 4, 0, 0, 20, 0,
- 46,224, 1,204, 7,159,176, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,153,208, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,154, 32,
- 13, 64,153,128, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 1, 1, 1,122, 7,159,224, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,154, 32, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,154,112, 13, 64,153,208, 0, 0, 4, 28, 0, 0, 0, 5, 0, 0, 20, 0,
- 46,224, 2,229, 7,159,184, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,154,112, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,154,192,
- 13, 64,154, 32, 0, 0, 0, 8, 0, 0, 0, 21, 0, 0, 0, 0, 0,204, 1,147, 7,159,220, 32, 68, 65, 84, 65, 0, 0, 0, 28,
- 13, 64,154,192, 0, 0, 0,118, 0, 0, 0, 1, 13, 64,155, 16, 13, 64,154,112, 0, 0, 4, 28, 0, 0, 0, 6, 0, 0, 20, 0,
- 46,224, 1, 9, 7,159,180, 32, 68, 65, 84, 65, 0, 0, 0, 28, 13, 64,155, 16, 0, 0, 0,118, 0, 0, 0, 1, 0, 0, 0, 0,
- 13, 64,154,192, 0, 0, 13,223, 0, 0, 0, 3, 0, 0, 4, 0, 46,224, 0,227, 7,159,160, 32, 68, 65, 84, 65, 0, 0, 0, 40,
- 13, 64,155, 96, 0, 0, 0,117, 0, 0, 0, 1, 1, 44, 0, 0, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 1,244, 0,200,
- 0,100, 0, 20, 0, 0, 39, 16, 61,204,204,205, 65,240, 0, 0, 64, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,188, 13, 64,155,176,
- 0, 0, 0,132, 0, 0, 0, 1, 0, 1, 0, 1, 63, 76,204,205, 66,180, 0, 0, 0, 9, 0, 1, 63,128, 0, 0, 58,131, 18,111,
- 0, 32, 0, 32, 0, 32, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 7, 0, 5, 0, 5,255,255, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0,100, 0, 10, 0, 0, 0, 50, 0, 50,
- 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50,
- 0, 10, 0, 0, 62,128, 0, 0, 0, 0, 0, 0, 56,209,183, 23, 61,204,204,205, 0, 0, 0, 0, 0, 0, 0, 50, 60, 35,215, 10,
- 60, 35,215, 10, 63,166,102,102, 63,192, 0, 0, 66, 52, 0, 0, 63,122,225, 72, 61,204,204,205, 0, 3, 0, 1, 2, 0, 1, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,156,160, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 6, 0, 0, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191,127, 10, 78, 61,177, 44, 36,191,127, 10, 78, 61,177, 43,213,
- 13, 64,157,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 72, 13, 64,157,208, 0, 0, 1, 30, 0, 0, 0, 6, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 61,204,204,205, 63,121,188, 86, 0, 0, 0, 0, 62,153,153,154, 63, 75, 60, 96, 0, 0, 0, 0, 63, 51, 51, 51, 62, 83, 14,128,
- 0, 0, 0, 0, 63,102,102,102, 60,200,117, 79, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 72, 13, 64,158, 64, 0, 0, 0,123, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 49, 32, 82,101,110,100,101,114,
- 76, 97,121,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,195,240,
- 0, 15,255,255, 0, 0, 0, 0, 0, 0,127,255, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 73, 77, 0, 0, 1,128,
- 13, 64,158,176, 0, 0, 0, 32, 0, 0, 0, 1, 7, 30,176,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 73,109,
- 97,103,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 53, 0, 0, 0, 0,
- 85,110,116,105,116,108,101,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,134,110,108, 0, 0, 1, 0, 1, 0, 0, 1,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 0, 0, 1,128, 7, 30,176,144, 0, 0, 0, 32, 0, 0, 0, 1,
- 0, 0, 0, 0, 13, 64,158,176, 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 82,101,110,100,101,114, 32, 82,101,115,117,108,116, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 67, 65, 0, 0, 0,132, 13, 64,160, 96, 0, 0, 0, 30, 0, 0, 0, 1, 13, 64,161, 16, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 62, 76,204,205, 66, 96,148,117, 64,176, 0, 0, 66,112, 0, 0, 65,240, 0, 0,
- 64,192, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 0, 0, 0,132,
- 13, 64,161, 16, 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 13, 64,160, 96, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 67, 97,
-109,101,114, 97, 65,116,109,111, 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 12, 62, 76,204,205, 66, 68,137,145, 64,176, 39, 76, 66,112, 69,210, 66, 12, 0, 0, 64,234, 14,161, 63, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,161,192, 0, 0, 0, 40,
- 0, 0, 0, 1, 13, 64,165, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 76, 97,109,112, 46, 48, 48, 49, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 65,160, 0, 0, 66, 52, 0, 0, 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 13, 64,163, 96, 0, 1, 0, 0, 63, 0, 0, 0, 66, 32, 0, 0, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 2, 0, 0, 3,
- 0, 1, 0, 0, 0, 2, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 65, 32, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,164,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 8, 13, 64,163, 96, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,164,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 13, 64,164,144, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 32, 13, 64,164,208, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120,
- 13, 64,165, 32, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,168,128, 13, 64,161,192, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 76, 97,
-109,112, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 65,160, 0, 0, 66,143,152,182, 62, 25,153,154, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 13, 64,166,192, 0, 1, 0, 0, 63, 0, 0, 0, 66, 32, 0, 0, 66, 52, 0, 0, 63,128, 0, 0,
- 64, 64, 0, 0, 2, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,168, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,166,192, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243,
- 13, 64,167,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,167,240, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 32, 13, 64,168, 48, 0, 0, 0, 19, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 76, 65, 0, 0, 1,120, 13, 64,168,128, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,171,144, 13, 64,165, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 12,204,205, 65,239,255,247, 66,150, 0, 0,
- 62, 25,153,154, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 13, 64,170, 32, 0, 4, 0, 0, 63,128, 26, 46, 65,240, 4, 25,
- 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,170, 32, 0, 0, 1, 32, 0, 0, 0, 1,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,
-191, 53, 4,242, 63, 53, 4,243, 13, 64,171, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,171, 80, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,171,144,
- 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,174,160, 13, 64,168,128, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48,
- 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,102,102,102, 65,239,255,247, 66,150, 0, 0, 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 13, 64,173, 48, 0, 1, 0, 0, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0,
- 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,173, 48, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1,
- 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,174, 96,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 24, 13, 64,174, 96, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,174,160, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,177,176,
- 13, 64,171,144, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 65,239,255,247, 66,150, 0, 0, 62, 25,153,154, 63,128, 0, 0, 63, 27,182,200, 63,128, 0, 0, 13, 64,176, 64, 0, 1, 0, 0,
- 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1,
- 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,176, 64,
- 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
-191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,177,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,177,112, 0, 0, 1, 30,
- 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65,
- 0, 0, 1,120, 13, 64,177,176, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,180,192, 13, 64,174,160, 0, 0, 0, 0, 0, 0, 0, 0,
- 76, 65, 83,112,111,116, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,204,204,205, 65,239,255,247, 66,150, 0, 0, 62, 25,153,154,
- 63,128, 0, 0, 63, 27,182,200, 63,128, 0, 0, 13, 64,179, 80, 0, 1, 0, 0, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0,
- 63,128, 0, 0, 64, 64, 0, 0, 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,179, 80, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242,
- 63, 53, 4,243, 13, 64,180,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,180,128, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,180,192, 0, 0, 0, 40,
- 0, 0, 0, 1, 13, 64,183,208, 13, 64,177,176, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 53, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 8,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 83, 78, 80, 65,239,255,247, 66,150, 0, 0, 62, 25,153,154, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 13, 64,182, 96, 0, 4, 0, 0, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 11, 64, 0, 3,
- 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 8, 13, 64,182, 96, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,183,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 13, 64,183,144, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,183,208, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,186,224, 13, 64,180,192,
- 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,179, 51, 51, 65,239,255,247,
- 66, 72, 0, 0, 63, 8,156,171, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 13, 64,185,112, 0, 4, 0, 0, 65, 68,207, 78,
- 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 2, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,185,112, 0, 0, 1, 32,
- 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243,
- 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,186,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,186,160, 0, 0, 1, 30, 0, 0, 0, 2,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120,
- 13, 64,186,224, 0, 0, 0, 40, 0, 0, 0, 1, 13, 64,189,240, 13, 64,183,208, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,
-111,116, 46, 48, 48, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 65,239,255,247, 66,150, 0, 0, 62, 25,153,154, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 13, 64,188,128, 0, 1, 0, 0, 63,128, 26, 46, 65,240, 4, 25, 66, 52, 0, 0, 63,128, 0, 0,
- 64, 64, 0, 0, 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 13, 64,188,128, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243,
- 13, 64,189,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,189,176, 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, 1,120, 13, 64,189,240, 0, 0, 0, 40, 0, 0, 0, 1,
- 0, 0, 0, 0, 13, 64,186,224, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,192, 0, 0, 65,160, 0, 0, 66, 52, 0, 0, 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 13, 64,191,144,
- 0, 1, 0, 0, 63, 0, 0, 0, 66, 32, 0, 0, 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 2, 0, 0, 3, 0, 1, 0, 0,
- 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8,
- 13, 64,191,144, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0,191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 13, 64,192,192, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,192,192,
- 0, 0, 1, 30, 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 87, 79, 0, 0, 1,100, 13, 64,193, 0, 0, 0, 0,116, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 79, 47,141, 62,209, 19, 64, 63, 14, 23, 73, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 28,204,205, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 65,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 65, 32, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61, 76,204,205, 0, 0, 0, 5, 0, 0, 0, 0, 59,163,215, 10, 0, 0, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,194,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 32,
- 13, 64,194,144, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0, 0,120, 13, 64,194,224, 0, 0, 0, 28, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1,
- 13, 64,195,128, 13, 64,195,128, 13, 64,195,128, 13, 64,195,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7,159,150, 32,255,255,255,255, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 13, 64,195,128, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,195,192, 0, 0, 0, 0, 0, 0, 0, 0,
- 70, 82, 69, 69, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,195,192, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 71, 82,
- 0, 0, 0, 76, 13, 64,195,240, 0, 0, 0,232, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 71, 82, 79,118,101,114,114,105,100,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,196,112, 13, 64,198,176, 0, 15,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 24, 13, 64,196,112, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,196,176, 0, 0, 0, 0, 7,159,208, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,196,176, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,196,240,
- 13, 64,196,112, 7,159,204, 32, 7,162,150, 32, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,196,240,
- 0, 0, 0,231, 0, 0, 0, 1, 13, 64,197, 48, 13, 64,196,176, 7,159,200, 32, 7,157,170, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,197, 48, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,197,112, 13, 64,196,240, 7,159,196, 32,
- 7,157,174, 32, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,197,112, 0, 0, 0,231, 0, 0, 0, 1,
- 13, 64,197,176, 13, 64,197, 48, 7,159,192, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24,
- 13, 64,197,176, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,197,240, 13, 64,197,112, 7,159,188, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,197,240, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,198, 48, 13, 64,197,176,
- 7,159,232, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,198, 48, 0, 0, 0,231,
- 0, 0, 0, 1, 13, 64,198,112, 13, 64,197,240, 7,159,176, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 24, 13, 64,198,112, 0, 0, 0,231, 0, 0, 0, 1, 13, 64,198,176, 13, 64,198, 48, 7,159,184, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 13, 64,198,176, 0, 0, 0,231, 0, 0, 0, 1, 0, 0, 0, 0,
- 13, 64,198,112, 7,159,180, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,156, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,160, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,160, 96, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,188, 41,199, 78,193, 30,230,225, 63,230,129,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,201, 15,218,128, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,162, 33,105, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191,128, 0, 0, 51,162, 33,105, 0, 0, 0, 0,188, 41,199, 78,193, 30,230,225, 63,230,129,216, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 48,136, 90, 64, 0, 0, 0, 0, 0, 0, 0, 0,
-168, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-176,136, 90, 64, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 8, 0,
- 0, 1, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,160, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,164, 32, 7,159,156, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, 65,116,109,111, 0, 97,109,101,
-114, 97, 46, 48, 48, 49, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,161, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-188, 41,199, 78,193, 30,230,225, 63,230,129,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,244, 47,173,
- 37,113,155,162, 37,170, 80, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 37,170, 80, 40,165,113,155,162,
- 0, 0, 0, 0, 37,170, 80, 39,190,169, 64,157, 63,113,155,163, 0, 0, 0, 0, 37,113,155,165,191,113,155,163,190,169, 64,157,
- 0, 0, 0, 0,188, 41,199, 78,193, 30,230,225, 63,230,129,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,154, 0, 0, 1, 25,127,255,254,
- 0, 0, 0, 0, 37,171, 80, 41, 63,128, 0, 1, 51,128, 0, 1, 0, 0, 0, 0, 45,255,255,135,136,127,255,137, 63,128, 0, 0,
- 0, 0, 0, 0, 48,128, 0, 0, 53,128, 0, 1, 52,128, 0, 2, 63,128, 0, 0, 63,128, 0, 0, 37,170, 80, 39, 37,113,155,166,
- 0, 0, 0, 0,165,113,155,162, 63,113,155,164,190,169, 64,158, 0, 0, 0, 0,165,170, 80, 40, 62,169, 64,159, 63,113,155,162,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 13,223, 4, 0, 0, 0, 0, 0, 0, 0,
- 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 63,100, 41, 6, 63,128, 0, 0, 62,204,204,205, 63,100, 41, 6, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,164, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,168, 32, 7,159,160, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 46, 48, 48, 49, 0, 46, 48, 48, 49, 0, 0, 0, 0, 0,
- 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 23, 97,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,115, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,198,240, 55,142, 84, 52,192,188, 12,194,
- 64, 71, 38, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,190, 36, 69,
- 64,190, 36, 69, 64,190, 36, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 63, 73, 15,218,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,134,115, 83, 64,134,115, 82, 0, 0, 0, 0, 0, 0, 0, 0,192,134,115, 82,
- 64,134,115, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,190, 36, 68, 0, 0, 0, 0, 55,142, 84, 52,
-192,188, 12,194, 64, 71, 38, 28, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 52, 85,230, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,243,183,207,189,243,183,205, 37,162, 83,160, 0, 0, 0, 0, 50, 26, 90, 29,
- 50, 26, 90, 31, 62, 44, 85,173, 0, 0, 0, 0,189,243,183,205,189,243,183,207, 50, 87,107, 24, 0, 0, 0, 0,190,247,176,158,
-190,246,108,212,190, 97,232, 64, 63,128, 0, 0, 0, 0, 4, 14, 4, 0, 0, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0,
- 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56,
- 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0,
- 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 29,237,208, 7, 29,244,128,
- 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 4, 13, 64,198,240, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 4, 32, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,168, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,172, 32, 7,159,164, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,
-114,115, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 22,250,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,109,208, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,199, 32, 55,142, 84, 52,192,188, 12,194, 64, 71, 38, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,190, 36, 69, 64,190, 36, 69, 64,190, 36, 68, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 63, 73, 15,218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,134,115, 83,
- 64,134,115, 82, 0, 0, 0, 0, 0, 0, 0, 0,192,134,115, 82, 64,134,115, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64,190, 36, 68, 0, 0, 0, 0, 55,142, 84, 52,192,188, 12,194, 64, 71, 38, 28, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 52, 85,230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,243,183,207,
-189,243,183,205, 37,162, 83,160, 0, 0, 0, 0, 50, 26, 90, 29, 50, 26, 90, 31, 62, 44, 85,173, 0, 0, 0, 0,189,243,183,205,
-189,243,183,207, 50, 87,107, 24, 0, 0, 0, 0,190,247,176,158,190,246,108,212,190, 97,232, 64, 63,128, 0, 0, 0, 0, 4, 14,
- 4, 0, 0, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 23, 89,240, 7, 22,192,224, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,199, 32, 0, 0, 0, 0, 0, 0, 0, 1,
- 7,160, 0, 32, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,172, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,176, 32, 7,159,168, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 28,254,192, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,120,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,199, 80, 60,102,131, 0, 64,164,112, 14,
- 63,229,211, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 34,159,178,
- 65, 34,159,178, 65, 34,159,177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,178, 89,250,166,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 34,159,178,180, 10,120,151, 0, 0, 0, 0, 0, 0, 0, 0, 52, 10,120,151,
- 65, 34,159,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 34,159,177, 0, 0, 0, 0, 60,102,131, 0,
- 64,164,112, 14, 63,229,211, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 53, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,201,126,231, 48,171,145,219, 30,247,120,240, 0, 0, 0, 0,164,217,209, 65,
- 49,255, 57, 51, 61,201,126,232, 0, 0, 0, 0, 48,172, 66,235,189,201,126,231, 49,251,201, 70, 0, 0, 0, 0,187, 29,136, 18,
-191,189,200,203, 58, 9,139,180, 63,128, 0, 0, 0, 0, 0, 33, 0, 0, 0, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0,
- 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56,
- 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0,
- 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 27,180,176, 7, 22, 19,240,
- 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 4, 13, 64,199, 80, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 4, 32, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,176, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,180, 32, 7,159,172, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,168,128, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 65,110, 57, 42, 64, 11,114,237, 64,121, 99,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,103, 90, 85,190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,255,247,136,
- 63, 74, 39, 37, 62,182, 26,138, 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, 0, 0, 0, 0, 63, 11,203,251,
-191, 27, 45,217, 63, 20, 7, 47, 0, 0, 0, 0, 65,110, 57, 42, 64, 11,114,237, 64,121, 99,120, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
-179, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 51,128, 0, 0, 63,128, 0, 0,178,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 41, 64, 0, 0, 53, 64, 0, 0,181, 64, 0, 0, 63,128, 0, 0, 62,255,247,138,
-191, 44, 21,164, 63, 11,203,251, 0, 0, 0, 0, 62,182, 26,141, 63, 59,248,176, 63, 20, 7, 45, 0, 0, 0, 0,191, 74, 39, 37,
-189,194, 67, 9, 63, 27, 45,217, 0, 0, 0, 0,193,142, 14,147, 64,234,125, 35,192, 0,119, 85, 63,128, 0, 0, 0, 0, 4, 28,
- 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,180, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,184, 32, 7,159,176, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,171,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191,210, 76, 84,193, 71,162,178, 64,178,186,210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85,
-190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138,
- 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47,
- 0, 0, 0, 0,191,210, 76, 84,193, 71,162,178, 64,178,186,210, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 52,191,255,250,179,191,255,250,
- 0, 0, 0, 0,178,255,255,248, 63,127,255,248, 51,255,255,248, 0, 0, 0, 0, 38,255,255,248,179,127,255,248, 63,128, 0, 0,
- 0, 0, 0, 0,180,255,255,250,182,191,255,250, 53,127,255,244, 63,128, 0, 0, 62,255,247,136,191, 44, 21,164, 63, 11,203,251,
- 0, 0, 0, 0, 62,182, 26,139, 63, 59,248,173, 63, 20, 7, 44, 0, 0, 0, 0,191, 74, 39, 36,189,194, 67, 17, 63, 27, 45,217,
- 0, 0, 0, 0, 63,189,129,191,192,104,159,176,192, 53,194,132, 63,128, 0, 0, 0, 0, 4, 28, 16, 0, 0, 0, 0, 0, 0, 68,
- 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,184, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,188, 32, 7,159,180, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,183,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 16,188,238,193, 57,119,229,
- 65,141,218, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 15, 79,202,191, 12,100,179, 63,234, 92,112,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 96,197,171, 63, 83, 27,149, 63, 5,118, 10, 0, 0, 0, 0,191, 99,218,142,
- 61, 75, 4,109,190,232, 3,179, 0, 0, 0, 0,190,204,142,233,191, 16, 64,104, 63, 57, 28,174, 0, 0, 0, 0,193, 16,188,238,
-193, 57,119,229, 65,141,218, 17, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,127,255,254,178,127,255,254, 52, 32, 0, 0, 0, 0, 0, 0,178,128, 0, 0,
- 63,128, 0, 0, 51,192, 0, 2, 0, 0, 0, 0,179, 0, 0, 0, 38, 0, 0, 0, 63,128, 0, 1, 0, 0, 0, 0,181,127,255,255,
-182, 0, 0, 0, 54, 0, 0, 0, 63,128, 0, 0,190, 96,197,175,191, 99,218,143,190,204,142,235, 0, 0, 0, 0, 63, 5,118, 11,
-190,232, 3,179, 63, 57, 28,172, 0, 0, 0, 0,191, 83, 27,150,189, 75, 4,119, 63, 16, 64,105, 0, 0, 0, 0,193, 14,181,128,
-191, 61,177,214,193,128,133, 29, 63,128, 0, 0, 0, 0, 4, 28, 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0,
- 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56,
- 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0,
- 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,
- 0, 0, 3, 68, 7,159,188, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,192, 32, 7,159,184, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 66, 76, 97,109,112, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 64,174,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,104,147,176,193, 23, 84, 42, 64,171, 77,116, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85,190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138, 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176,
- 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47, 0, 0, 0, 0, 64,104,147,176,193, 23, 84, 42, 64,171, 77,116,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0,180, 31,255,255,167,159,255,254, 0, 0, 0, 0, 50,255,255,254, 63,127,255,254, 50,255,255,252,
- 0, 0, 0, 0,178,255,255,254, 39,159,255,254, 63,127,255,254, 0, 0, 0, 0, 52,127,255,253,181,127,255,254, 52,255,255,253,
- 63,128, 0, 0, 62,255,247,137,191, 44, 21,165, 63, 11,203,251, 0, 0, 0, 0, 62,182, 26,141, 63, 59,248,176, 63, 20, 7, 46,
- 0, 0, 0, 0,191, 74, 39, 37,189,194, 67, 20, 63, 27, 45,217, 0, 0, 0, 0,192, 93, 99, 91,190, 80, 98,136,192,112,119,223,
- 63,128, 0, 0, 0, 0, 0, 1, 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10,
- 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,192, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,196, 32, 7,159,188, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48,
- 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,177,176, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,192,251,147,249,193, 24, 0,206,192,104,131, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,103, 90, 85,190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,255,247,136,
- 63, 74, 39, 37, 62,182, 26,138, 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, 0, 0, 0, 0, 63, 11,203,251,
-191, 27, 45,217, 63, 20, 7, 47, 0, 0, 0, 0,192,251,147,249,193, 24, 0,206,192,104,131, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,127,255,254,
- 50,255,255,254,166,127,255,254, 0, 0, 0, 0, 38,127,255,254, 63,128, 0, 0,179, 0, 0, 0, 0, 0, 0, 0,178,255,255,254,
- 51, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,181,127,255,254,181,128, 0, 0, 41, 0, 0, 0, 63,128, 0, 0, 62,255,247,137,
-191, 44, 21,165, 63, 11,203,251, 0, 0, 0, 0, 62,182, 26,139, 63, 59,248,176, 63, 20, 7, 45, 0, 0, 0, 0,191, 74, 39, 36,
-189,194, 67, 19, 63, 27, 45,217, 0, 0, 0, 0, 64,176,142,147,191,170, 22, 97, 64,246, 28, 27, 63,128, 0, 0, 0, 0, 0, 1,
- 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,196, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,200, 32, 7,159,192, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 53, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,180,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 65, 54, 41,142,191,115,124, 24,192, 58,215,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85,
-190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138,
- 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176, 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47,
- 0, 0, 0, 0, 65, 54, 41,142,191,115,124, 24,192, 58,215,162, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0,
- 0, 0, 0, 0, 51,128, 0, 0, 63,128, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 53,128, 0, 0, 0, 0, 0, 0,181, 64, 0, 0, 63,128, 0, 0, 62,255,247,136,191, 44, 21,164, 63, 11,203,251,
- 0, 0, 0, 0, 62,182, 26,139, 63, 59,248,175, 63, 20, 7, 46, 0, 0, 0, 0,191, 74, 39, 36,189,194, 67, 25, 63, 27, 45,217,
- 0, 0, 0, 0,193, 49,192,139, 65, 36, 99, 40, 63,249,156, 89, 63,128, 0, 0, 0, 0, 0, 2, 20, 0, 0, 0, 0, 0, 0, 68,
- 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,200, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,204, 32, 7,159,196, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,183,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 19,239,220,193, 54,239,215,
- 65, 60, 9, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,103,251, 67,191, 24, 27,164, 64, 3,136, 37,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,197,143, 31, 63, 59,184,209, 63, 15, 80,138, 0, 0, 0, 0,191, 64, 66, 57,
- 61,210,119,132,191, 38,249,118, 0, 0, 0, 0,191, 9, 43, 37,191, 44, 15, 35, 63, 2,212,114, 0, 0, 0, 0,193, 19,239,220,
-193, 54,239,215, 65, 60, 9, 42, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,180, 0, 0, 1, 52, 32, 0, 1, 0, 0, 0, 0, 38,128, 0, 1,
- 63,128, 0, 0,179, 0, 0, 1, 0, 0, 0, 0,179, 0, 0, 1,179,128, 0, 0, 63,128, 0, 1, 0, 0, 0, 0, 53,128, 0, 0,
-170, 0, 0, 1, 42, 32, 0, 1, 63,128, 0, 0,190,197,143, 31,191, 64, 66, 56,191, 9, 43, 35, 0, 0, 0, 0, 63, 15, 80,139,
-191, 38,249,117, 63, 2,212,112, 0, 0, 0, 0,191, 59,184,208,189,210,119,142, 63, 44, 15, 35, 0, 0, 0, 0,193, 0,135,195,
-190,148,252,127,193, 48,180, 8, 63,128, 0, 0, 0, 0, 0, 2, 20, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0,
- 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56,
- 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0,
- 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,
- 0, 0, 3, 68, 7,159,204, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,208, 32, 7,159,200, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 66, 76, 97,109,112, 46, 48, 48, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 64,186,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,164, 99,104,193, 51,244,239, 64, 19,110,188, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,103, 90, 85,190,186, 45,254, 63,128,209,115, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,255,247,136, 63, 74, 39, 37, 62,182, 26,138, 0, 0, 0, 0,191, 44, 21,164, 61,194, 67, 28, 63, 59,248,176,
- 0, 0, 0, 0, 63, 11,203,251,191, 27, 45,217, 63, 20, 7, 47, 0, 0, 0, 0,192,164, 99,104,193, 51,244,239, 64, 19,110,188,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0,178,255,255,254, 51,128, 0, 1, 0, 0, 0, 0,167, 64, 0, 2, 63,128, 0, 0, 51, 0, 0, 1,
- 0, 0, 0, 0,179,192, 0, 2, 51,128, 0, 1, 63,128, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,255,247,137,191, 44, 21,165, 63, 11,203,251, 0, 0, 0, 0, 62,182, 26,139, 63, 59,248,178, 63, 20, 7, 45,
- 0, 0, 0, 0,191, 74, 39, 36,189,194, 67, 18, 63, 27, 45,217, 0, 0, 0, 0, 64, 91, 24, 96,192,108, 50,226, 63,219, 9,101,
- 63,128, 0, 0, 0, 0, 0, 2, 20, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10,
- 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,208, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,212, 32, 7,159,204, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48,
- 48, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,189,240, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,188, 75,145,193,107,197, 44, 64, 81,147, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,201, 15,218, 37,128, 0, 0, 37,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 37,127,255,255,165,128, 0, 0, 0, 0, 0, 0, 37,127,255,255, 51,162, 33,105, 63,128, 0, 0, 0, 0, 0, 0, 37,128, 0, 0,
-191,128, 0, 0, 51,162, 33,105, 0, 0, 0, 0, 63,188, 75,145,193,107,197, 44, 64, 81,147, 5, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,127,255,254,
- 53,107,197, 44,180, 81,147, 4, 0, 0, 0, 0, 37,127,255,253, 63,128, 0, 0, 48,136, 90, 64, 0, 0, 0, 0,165,127,255,254,
-155,107,197, 44, 63,128, 0, 0, 0, 0, 0, 0, 51,255,255,254,181,255,255,255, 52,127,255,254, 63,128, 0, 0, 63,128, 0, 0,
-178, 23, 25, 45,179, 75,199,107, 0, 0, 0, 0,165,128, 0, 1, 63,128, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,177,108,127, 0,
- 50, 29, 9,206, 63,128, 0, 0, 0, 0, 0, 0,191,189,159, 32,191,188,164, 47,192,153,188,150, 63,128, 0, 0, 0, 0, 0, 32,
- 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,212, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,216, 32, 7,159,208, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 0, 0,108, 97,110,101,
- 46, 48, 48, 51, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 28,231, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,131, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,199,128,
- 60,102,131, 0, 64,164,112, 14, 63,229,211, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 65, 34,159,178, 65, 34,159,178, 65, 34,159,177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-128, 0, 0, 0,178, 89,250,166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 34,159,178,180, 10,120,151, 0, 0, 0, 0,
- 0, 0, 0, 0, 52, 10,120,151, 65, 34,159,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 34,159,177,
- 0, 0, 0, 0, 60,102,131, 0, 64,164,112, 14, 63,229,211, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,201,126,231, 48,171,145,219, 30,247,120,240,
- 0, 0, 0, 0,164,217,209, 65, 49,255, 57, 51, 61,201,126,232, 0, 0, 0, 0, 48,172, 66,235,189,201,126,231, 49,251,201, 70,
- 0, 0, 0, 0,187, 29,136, 18,191,189,200,203, 58, 9,139,180, 63,128, 0, 0, 0, 0, 0, 33, 0, 0, 0, 1, 0, 0, 0, 68,
- 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 26, 8, 80, 7, 26, 13,176, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,199,128, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 0, 32, 0, 0, 79, 66,
- 0, 0, 3, 68, 7,159,216, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,220, 32, 7,159,212, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 66,112,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 26, 31,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,199,176,189, 7, 82,100,191,103,204, 21, 63,230,165,241, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,155, 39,153, 64,155, 39,153, 64,155, 39,153,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,201, 15,218, 37,192, 0, 0, 36,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64,155, 39,153, 38, 27, 39,152,166,232,187,102, 0, 0, 0, 0, 38,232,187,102, 52,196,134,157, 64,155, 39,153,
- 0, 0, 0, 0, 38, 27, 39,154,192,155, 39,153, 52,196,134,157, 0, 0, 0, 0,189, 7, 82,100,191,103,204, 21, 63,230,165,241,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,153, 34, 33,106, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,153, 34, 33,106, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,179,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62, 83, 50, 25, 36,158,101,147, 35,211, 50, 27, 0, 0, 0, 0,164,158,101,147, 62, 83, 50, 25, 38,174, 59,158,
- 0, 0, 0, 0,173,204, 94, 0,175, 96, 79,158, 62, 83, 50, 25, 0, 0, 0, 0, 59,153, 62,135,185,110, 94,217, 63,238, 71,118,
- 63,128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10,
- 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 26, 19,192, 7, 26, 25,160, 0, 0, 0, 25, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,199,176,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,220, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,224, 32, 7,159,216, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, 50, 0, 46, 48,
- 48, 49, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,104, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,200, 16, 13, 64,200, 16, 13, 64,199,224,
-191,213,187,242, 63,134,145,194, 64, 35,100,254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 65, 28, 0,243, 65, 28, 0,246, 65, 28, 0,243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,135,110, 48,
- 62, 59,169,180,191, 1,115,138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 6, 49,198,192,148,154,115,191,227,113, 3,
- 0, 0, 0, 0, 64,106,250,159, 64, 91,207,189, 65, 5,170, 80, 0, 0, 0, 0,192, 86,151, 46,192,251, 94,125, 64,150,127,188,
- 0, 0, 0, 0,191,213,187,242, 63,134,145,194, 64, 35,100,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 1,167, 0, 0, 1,179,128, 0, 1,
- 0, 0, 0, 0,179, 0, 0, 1, 63,128, 0, 0, 51, 0, 0, 1, 0, 0, 0, 0,166,128, 0, 1, 51, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,180,174,143, 61, 30, 48,160,189, 16,118,223,
- 0, 0, 0, 0,188,153, 29,162, 61,179,248, 38, 61, 74,162,115, 0, 0, 0, 0, 61, 72, 21, 15,189, 19,250,160, 61,169, 57, 88,
- 0, 0, 0, 0, 63, 50,107, 4,190,204, 46, 88, 63, 79,206,177, 63,128, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 68,
- 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,199,224, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 68, 13, 64,200, 16, 0, 0, 0, 78, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 31,
- 83,117, 98,115,117,114,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,224, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,228, 32, 7,159,220, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,
-119, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 22,191, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,148,176, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,200,128,187,203,194, 16, 63, 45, 89,155, 63,230,153,244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 72,135, 56, 63, 72,135, 56, 63, 72,135, 56, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 72,135, 56,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 72,135, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 72,135, 56, 0, 0, 0, 0,187,203,194, 16, 63, 45, 89,155, 63,230,153,244, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,200,135, 57,
-178,200,135, 57, 63,128, 0, 1, 0, 0, 0, 0,176,192, 0, 0, 51,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,163,104,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 52, 33, 50, 51,206,250,252, 63,163,104,144, 0, 0, 0, 0,173,202,240, 60,
-191,163,104,144, 51,204, 63,183, 0, 0, 0, 0,187,173, 93,105,193, 88,176,172,186,118, 52, 95, 63,128, 0, 0, 0, 0, 0, 2,
- 4, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 32, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7, 29,251, 48, 7, 30, 0,144, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,200,128, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,228, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,232, 32, 7,159,224, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,148,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,200,176, 58, 10, 31, 0, 63,236, 94, 59,
- 63,231, 84,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,110,188, 91,
- 63,110,188, 91, 63,110,188, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,201, 15,218,128, 0, 0, 0,128, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,110,188, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 51,151, 50, 90, 63,110,188, 91, 0, 0, 0, 0, 0, 0, 0, 0,191,110,188, 91, 51,151, 50, 90, 0, 0, 0, 0, 58, 10, 31, 0,
- 63,236, 94, 59, 63,231, 84,236, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,127,255,254,179, 25, 53,226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 1, 0, 0, 0, 0,174,128, 0, 1,
-179,255,255,254, 39,153, 53,226, 63,128, 0, 0, 63,137, 65,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22,123, 29,164,
- 63,137, 65,160, 40, 19, 46,157, 0, 0, 0, 0, 45, 14,127,248,176,150,195,159, 63,137, 65,161, 0, 0, 0, 0,188, 63, 80, 29,
-187,226, 95, 62, 65, 74, 19, 87, 63,128, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0,
- 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56,
- 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0,
- 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 1, 64, 0, 0, 0, 0, 0, 0, 32, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 4, 13, 64,200,176, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,232, 32,
- 0, 0, 0,109, 0, 0, 0, 1, 7,159,236, 32, 7,159,228, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,
-119, 46, 48, 48, 53, 0, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,165, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,189,195,155,128, 64,188,145, 20, 65, 88,220, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,134,180,221, 37,141,190, 48, 35, 57, 55,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 35, 57, 55,253,165,141,190, 48, 0, 0, 0, 0, 37,112,128,219, 62,253,177, 52, 63, 94, 93, 94, 0, 0, 0, 0, 37, 22,133, 52,
-191, 94, 93, 94, 62,253,177, 52, 0, 0, 0, 0,189,195,155,128, 64,188,145, 20, 65, 88,220, 94, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 25,127,255,255,153,128, 0, 1, 0, 0, 0, 0,176, 0, 0, 0, 63,128, 0, 0, 10, 0, 0, 1, 0, 0, 0, 0,176, 0, 0, 5,
- 51, 0, 0, 1, 63,128, 0, 1, 0, 0, 0, 0, 50, 0, 0, 0, 12, 0, 0, 0,140, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0,
- 37,112,128,219, 37, 22,133, 53, 0, 0, 0, 0,174,231, 90, 80, 63, 94, 93, 94, 62,253,177, 52, 0, 0, 0, 0,172,239, 68, 0,
-190,253,177, 50, 63, 94, 93, 95, 0, 0, 0, 0, 61,174, 98,150,193,144,101, 85, 64,253,124,196, 63,128, 0, 0, 0, 0, 0, 64,
- 16, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205,
- 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,236, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,240, 32, 7,159,232, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, 54, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,169, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,200,224,
-190,252, 52, 94, 65,228,101,174, 65, 17,116,141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66, 30,239,235, 66, 30,239,236, 66, 30,239,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 95,174,138,
- 37,123,132, 98,165, 87, 56, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 30,239,235,168, 5,158,105,168, 28, 39,108,
- 0, 0, 0, 0, 40, 77,129,212, 65,204, 15, 66, 65,243,186,158, 0, 0, 0, 0,165, 13, 89, 55,193,243,186,156, 65,204, 15, 65,
- 0, 0, 0, 0,190,252, 52, 94, 65,228,101,174, 65, 17,116,141, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 25, 80, 0, 0, 25,120, 0, 2,
- 0, 0, 0, 0, 24,216, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153, 12, 0, 1,179, 0, 0, 1, 63,128, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60,206, 43,101, 35, 5, 74, 25,159,183, 90,141,
- 0, 0, 0, 0,162,202,143, 41, 60,158, 20,101, 60,132, 89,193, 0, 0, 0, 0, 34,173, 83,188,188,132, 89,192, 60,158, 20,103,
- 0, 0, 0, 0, 60, 70,215, 11,191, 67, 43, 61, 63, 31,241,185, 63,128, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 68,
- 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,200,224, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66,
- 0, 0, 3, 68, 7,159,240, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,244, 32, 7,159,236, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 79, 66,112,114,101,118,105,101,119, 99,117, 98,101, 0,117, 98,101, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,176,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,201, 16, 59, 88,253,128, 63,160,118,220, 64, 37, 15, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 68, 88, 84, 64, 68, 88, 84, 64, 68, 88, 83,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,237,190, 1,190,217,230,108, 63, 52,151, 20, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64, 8, 38, 67, 63,231,228,191, 63,162, 31,186, 0, 0, 0, 0,192, 13,118, 35, 63,220, 61, 2, 63,160, 44, 31,
- 0, 0, 0, 0, 60,234, 52,166,191,227,223,102, 64, 31,229, 55, 0, 0, 0, 0, 59, 88,253,128, 63,160,118,220, 64, 37, 15, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0,178,155,255,255, 49, 64, 0, 2, 0, 0, 0, 0,178,211,255,254, 63,127,255,254,164,159, 0, 0,
- 0, 0, 0, 0, 51, 2, 0, 1, 50,255,255,255, 63,128, 0, 1, 0, 0, 0, 0, 51,234, 0, 0,179,255,255,254, 37,175,128, 1,
- 63,128, 0, 0, 62,103,115, 10,190,112,122,201, 59, 71, 17,255, 0, 0, 0, 0, 62, 9,205,116, 62, 8, 36,205, 62,135,232,136,
- 0, 0, 0, 0,190, 69, 27, 1,190, 59, 50,224, 62, 65,176, 25, 0, 0, 0, 0,192, 16,176,110,192, 9, 71,158, 63,244, 90,115,
- 63,128, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10,
- 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,201, 16,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68, 7,159,244, 32, 0, 0, 0,109, 0, 0, 0, 1,
- 7,159,248, 32, 7,159,240, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119,104, 97,105,114, 0,108, 97,
-110,101, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,141,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65, 97,208, 13, 65, 97,208, 13, 64,201, 64,
- 63,200, 92, 86, 63,227,205, 7,189, 9,199,149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 64, 47,126,234, 64, 47,126,234, 64, 47,126,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 2, 80,225,
-191, 15,211, 5, 62, 18,219, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 18,254,224, 62,169,209, 23, 63,186,251, 27,
- 0, 0, 0, 0,191,133,254, 71, 64, 17, 40,207, 63,144,194,229, 0, 0, 0, 0,191,137, 38, 78,191,192,162, 48, 64, 1,176,125,
- 0, 0, 0, 0, 63,200, 92, 86, 63,227,205, 7,189, 9,199,149, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 1,179, 0, 0, 1,179,128, 0, 1,
- 0, 0, 0, 0, 50,128, 0, 0, 63,128, 0, 1, 51,128, 0, 1, 0, 0, 0, 0,179,128, 0, 1,179, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 40, 12, 0, 2,180, 0, 0, 1,180, 44, 0, 1, 63,128, 0, 0, 62,156,100,244,190, 14,143,135,190, 17,235, 52,
- 0, 0, 0, 0, 62, 70,239,175, 62, 26, 4,102, 62,137,251, 72, 0, 0, 0, 0,189, 52,172,174,190,154,112,211, 62, 76,243, 67,
- 0, 0, 0, 0,191, 36, 56,149,192, 66, 98,139, 64, 68, 5,168, 63,128, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 68,
- 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100,
- 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0,
- 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,202, 32, 13, 64,202, 32,
- 13, 64,201,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 64,201, 64, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,128, 13, 64,201,112, 0, 0, 0,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,204,204,205, 62, 76,204,205, 60,163,215, 10, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 64, 13, 64,202, 32, 0, 0, 1, 42,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 74, 32, 12,117, 80, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,156,100,244,190, 14,143,134,190, 17,235, 52,
- 0, 0, 0, 0, 61, 52,172,172, 62,154,112,211,190, 76,243, 69, 0, 0, 0, 0, 62, 70,239,176, 62, 26, 4,102, 62,137,251, 73,
- 0, 0, 0, 0,191, 12,211,188,190,160,176,198, 63, 22,156, 56, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17,
- 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65, 97,144, 68, 65, 84, 65, 0, 0,114,216, 12,117, 80, 32, 0, 0, 1, 40, 0, 0, 0,150, 0, 0, 0, 0,192, 17,135, 20,
-192, 97,121, 36, 63,141, 32,112,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,203,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 32, 96, 77, 62,160,201,185, 63, 6, 3,160,190,248, 34, 11, 60,185, 53,206,
- 61,178,197,192, 63, 53,184,174,190,162,172,223, 62,224,136,109,191, 61,173,142, 60, 10, 96,180, 61,163,196,200, 63, 99,182, 78,
- 60,180,242,165, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,150,112,248,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 7, 46,111,192, 60, 26,143, 63,207,147, 28,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,204,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,229,121, 6,191, 41, 50,108,191, 7,152,136,190,146,100,156,
-191, 25,141,146, 62,142, 92, 39, 63, 18,104,212,190,105,105,227, 62, 96,156,113,191, 69,226,137, 61, 17,247,147, 62, 44,172, 51,
- 63, 54,125, 17, 61,169,195, 69, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,245, 63,144, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,189,174,103,224,192, 17, 88, 60, 64, 76, 35,230,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,205,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,155,160,101, 62,152, 87, 59,191, 84,199,118,
- 62,183, 89, 86, 62,231,103,118,189,177, 47,110,191, 4, 8,155, 62,199, 60,100,189,177, 40,197, 62, 46, 14, 2, 62, 39, 96,102,
- 61,242,119,101, 62,146,168,189, 62,221, 9, 55, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 61, 87, 36,135, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,192,131,102, 75, 63, 26,241,196, 64, 76,198,140,191, 55, 81,190,191, 71,243,107, 63, 42,237, 98,
- 62,214,163,235,190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,206,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 39, 80, 49,190,218, 26,171,
- 63, 16,118, 89,190,138, 72,130,190,122,255,169,191, 14,111,185, 63, 38,207, 21, 61,211,252, 73,191, 80,177,198,189,203,154, 43,
- 61, 53,146,227, 63,115,180, 63, 59, 42,113,216, 58,144, 63,125, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,142, 95,175, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,189,226, 43, 64,191,220, 85,253, 64,101,104,225,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,207,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 45, 97,119,
-190,205, 47,119, 63, 19,117, 35, 62, 98,125,166, 62, 73,195,242, 62,243,228,124, 63, 11, 86,119, 62, 89,156, 70, 63, 88,232,230,
-190,204, 53,130, 62,128,120,250, 62, 20,194, 19, 62, 90, 15, 61, 62,200, 30, 92, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,253,129, 53, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,129,159,108, 63, 6,210, 8, 64,152,221, 35,191, 55, 81,190,
-191, 71,243,107, 63, 42,237,102, 62,214,163,235,190,183,206,200,190, 61,137,205,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,208,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-190,210,167, 41, 62,139,172,194, 63, 35,220,250,191, 22,182, 30, 61,136, 3,122,190,176,164,109,190,147,153, 30,188, 10,248,255,
-190,160, 90,234,190,205,241, 89, 63, 25,235,148, 62,146,172,206, 61, 52,195,137, 61,139,142, 99, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 77,227, 37, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,189,167,114,192,104, 59,217, 63,184,179,184,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,209,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,121, 45, 57, 63, 98,126,120,189,135,171, 60,190,200,174,139, 63, 21,142,220,191, 40, 70, 77, 62,150, 70,118,
- 61, 92,245, 4,190,174,118,159, 63, 49,217,176, 60,104,167,120, 60,235,104,166, 63, 73,251,218, 62, 44, 25, 13, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,247, 2,217, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 30,112, 86,192, 82, 69,111,
- 64, 51,191, 59,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,210,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,190,137,227, 49,191, 71,195,206,190, 96, 31, 70, 63, 5, 46,127,189,214, 51, 99,191, 67, 61,228,
- 62, 2, 90,134,190,146,214,120, 62, 33,111, 34,190,187,229,136, 60,241,112, 27, 60,177,187, 0, 62,171,134, 4, 63, 29, 35,164,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 56,192,130, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,176,148,118,
- 63, 1,200, 88, 64,146, 48, 89,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,211,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 82,169, 42, 63, 57,214,102,191, 36,112, 55, 62, 9,205, 59, 63, 5,139,184,
-190, 43, 32,105,191, 37, 62,120, 63, 15,215,220, 63, 8, 2,180, 62,163,170,198, 63, 8,178,160, 62,184,164,185, 61, 63, 72, 68,
- 61,112,104, 16, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,192,249, 97,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191,168, 80,200,191,165,154, 8, 64, 80,248,229,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,212,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 5,145, 56, 62,126, 77, 83,191, 63,133, 14, 62,167, 5,190,
-190, 96,212,123, 62,176,136,233,189, 80,193, 25, 62, 18, 49,147, 62, 25, 40,222,191, 10,204, 59, 62,104, 46,177, 62,150,106, 36,
- 62,138, 61, 2, 62, 86,131, 4, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 19, 27, 39, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,189,246,190, 0,192, 90,129,233, 64, 20,155,224,191, 55, 81,190,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,
-190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,213,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 14, 77, 30, 62,154, 81,231,191, 22,220, 41,
-191, 0,189,104,190,160,167,214,190, 22, 60,140, 63, 74, 85, 37,191, 8,253, 32, 61, 23,146, 96,190,177, 30,196, 60,187, 25, 79,
- 60,194,244,207, 62,253,234, 53, 62,234, 52,233, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 79, 21,218, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,190, 67,231,176,189, 11,105,144, 64,153,111,210,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,214,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,205,110, 74,191, 27,226,146,
- 61,219, 95, 73, 63, 45, 3, 75,190,147,109,222, 63, 40,196,152,190,116,136, 36,190,190, 21,181,190,213, 38,211, 62,183,230,114,
- 63, 24,217,206, 62, 25,222, 59, 61,134, 50, 0, 62, 63,161,139, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,127, 67,180, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,158,217, 58,192, 17,225,122, 64,120,158,213,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,215,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 22, 95,176,
-190,210, 95,172,191, 46, 70,114, 62, 26, 71, 67, 61,234,164,188,191, 78,120,121,188,108,229,186,190, 72,225,144,190, 42,218,197,
-191,114,104, 83, 62, 73,213, 34, 61, 49,230,217, 61,187,117,217, 63, 42,253,143, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 95,144,226, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,127,205, 29,191,142,116,231, 64,100, 64,116,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,216,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-189,132, 25,196,191, 41,167, 67,190,174,145,249, 63, 41,227,171, 62, 94,208, 84, 63, 50, 21, 98,191, 46,162,138,191, 56, 53,136,
- 62,160, 44, 9,190,188, 42, 15, 62,145,124,109, 62,135, 84, 47, 62, 95, 56, 95, 62,111, 38,104, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 87,116,183, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 67,106,143, 62,236, 1,239, 64,105,139,230,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,217,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 72, 62, 61, 62,176,226,147,191, 48,185, 67,191, 26,215,255,187,254,158,242,190,201,238, 89, 63, 39,166, 99,
-191, 3,238,102, 62, 10,229,206, 62,230, 53,165, 62,100,227, 37, 63, 54, 38,230, 61, 43, 4, 87, 60,190, 1,166, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,126, 26,213, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 58, 63,114,191,102, 44,242,
- 64,119,155,239,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,218,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 61,131,238,198,191, 58, 99, 49, 63, 26,180, 63,190,162, 92,201, 62,209,254,113, 63, 12, 67,151,
- 62,197,138, 80,191, 72,116,197,190,182,129,117, 62, 76,137,180, 62,178,134,232, 62,113,134, 23, 62, 46,242,235, 62,122,121, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,169, 12,248, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62,175,173,244,
- 61,141,194,136, 64,164,239, 0,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,219,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 28, 38,213, 60,166,248, 66,191, 67,199,227,190, 83,123,127,190,224,119,122,
- 62,149, 46, 73, 62, 62, 43,135, 62,199,175, 30, 63, 2,224, 97, 62,250,198,180, 63, 48, 97,211, 61,130,134, 38, 61, 8, 53,167,
- 62, 91, 40, 56, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,157,115, 93,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 36,188,127,192, 42,192, 83, 63,202, 24, 20,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,220,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 82,121, 10,190,216,142,233,191, 83,156, 94, 62,158, 73,222,
- 63, 3,207,170,191, 39, 41, 63, 62,147,164, 2,191, 38,187, 36, 62,218, 1, 0,191, 32,119,145, 60,154,242,191, 62,130,165, 14,
- 63, 49,236,127, 60,253, 44,163, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,130,194, 13, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 51,117,191,192, 44,247, 40, 64, 82, 59, 84,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,221,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 71,176, 89,191, 18, 55,214,190,223, 82, 67,
- 63, 50, 2,142, 61,202, 17,235, 62,199,118, 51, 63, 72,125,129,191, 36,250, 86, 61, 90, 99, 70, 63, 25, 38,125, 61,227, 50,218,
- 61,110,152, 48, 62,104, 58,166, 63, 26,161,121, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62, 35, 69, 21, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 44,218, 23,190,159,112,131, 64, 80,196, 68,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,222,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 39, 65, 62,190,203,203,175,
-191, 8, 58, 24,190,185,178,132, 63, 27,133, 48, 63, 35,150,166,189,174,164,195,189,209, 20,146,191, 3, 43,124, 63, 54,188,219,
- 62, 53,126, 23, 63, 22,113, 93, 62, 42,104, 29, 61,140,168,166, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,222,122, 90, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 61,253,222,190, 43,216,212, 64,140,239,219,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,223,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,251, 62, 59,
- 62,132,207,154,191, 19,198,191,191, 25, 82,122,190,169,114,179,191, 46, 80,242,189,100, 92,161, 62,188,103,125,191, 23,234, 0,
- 63, 22,140, 12, 62,252, 36, 24, 62,121,130,191, 61,198,245, 96, 62, 42,186, 98, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 89,205, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,212,168,192,192, 30,175, 47, 64, 12,228, 94,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,224,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 62, 6,136,242,191, 58,135,240, 61,233,198, 89, 63, 41,148, 57,190,189,188,151,190,189, 72,156, 63, 86, 14,184,190,165, 54,185,
- 62, 49,220,131,189,189, 87, 60, 61,167,198,118, 62, 80,200, 92, 63, 10,210,157, 62, 48, 9,240, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,181,132,186, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190,238,184,114,191,230,206,237, 64, 85,122,208,
-191, 55, 81,190,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,225,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 30,165,128,190,249, 50,161,189, 86,213,180,191, 29, 10,178,191, 49,247,227,189, 7,139,215,189,154,249,222,
-191, 23, 77,153, 63, 14, 58,160, 61, 15, 47, 72, 62, 94,132,138, 62, 48,190,167, 62,136, 41,203, 62,176, 52,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,233,177, 38, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,104, 19, 67,191,254,122,179,
- 64,123, 37,115,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,226,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,181,231, 69, 63, 51, 19, 36,191, 6, 5,126,190,170, 27,231,189, 35,253,128,189,151, 11,182,
- 62,178,171, 74, 63, 49,231,127, 62,128,146,204, 62, 17,100, 88, 62,124,245,197, 61,130,108, 30, 61,229,152,201, 63, 19,193,242,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 79,156, 56, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,191,106,172,
-192, 42,225,110, 64,110,170, 2,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,201,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,227,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 27,227, 49, 63, 26, 83, 17,191, 2,229, 27, 61,135, 48, 83, 62,134,244,199,
-190,151, 37, 55,189,237,195,210, 63, 17, 39,249, 61, 76, 1,154,191, 79,194, 75, 61,249, 99,240, 60,249, 88,190, 61,183, 20,174,
- 63, 66, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,178, 40,150,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 12, 3,121,190,252, 11, 63, 64, 89,136,146,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,228,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 20, 59,104, 63, 17, 36, 30,190,252, 57,112, 62,162,101, 32,
- 62,160, 6,139, 61, 80,160, 57, 61,245,243,109,190,224, 18, 41,188,227,154,182,190,139,196,238, 62,108, 28,173, 62,246,152,191,
- 62, 61, 50,199, 61,210,254, 31, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 56,166, 20, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191,187,104,250,189,139, 86, 56, 64,131, 23,145,191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,
-190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,229,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 19, 80,228,191, 16,138,118,191, 6,210,122,
- 62,138, 14,139, 62,189, 65, 73,189,244, 89, 19, 62, 83, 5,205,190,107,159, 94, 62,255,199, 19,190, 48,124, 14, 62,208, 67, 15,
- 62,190, 57,184, 61,219,154,119, 61,234,114,111, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,223, 51,203, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,161, 56, 52,191,207,221,255, 64,120,110,202,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,230,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 47,124,138, 63, 0,193, 12,
- 62,176, 39,124,190,204, 3, 68, 61, 43,180,132,189,104,184, 66,191, 54,173, 69,189,116,239, 24,190, 53,183,191,190,198, 91,120,
- 62,150, 33,123, 61,226, 30, 68, 62, 27,121,224, 62,227,154, 4, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 35, 22,117, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 41, 89, 63,192, 25,107,117, 63,222,245,174,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,231,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,207,202, 66,
- 63, 47, 32,211,191, 0,219,139,190,172,212,197, 63, 65, 68,195,190,217,152,105,190,214,218,159,190, 84,113, 85,190,158,108,194,
- 61,235,217,229, 60,202,179, 82, 62,157,106,197, 63, 33,197,211, 61, 18,243, 9, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,102,162, 1, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,220,238, 94,191,150, 70, 91, 64, 72,192,203,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,232,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 22, 95,176,190,210, 95,172,191, 46, 70,114, 62, 26, 71, 67, 61,234,164,188,191, 78,120,121,188,108,229,186,190, 72,225,144,
-190, 42,218,197,191,114,104, 83, 62, 77,183, 13, 62,182,153,158, 62,143, 59, 65, 62, 38,159, 52, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 95,144,226, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192,116,234, 61,188,238,101,224, 64, 56, 20,165,
-191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,233,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 6,136,242,191, 58,135,240, 61,233,198, 89, 63, 41,148, 57,190,189,188,151,190,189, 72,156, 63, 86, 14,184,
-190,165, 54,185, 62, 49,220,131,189,189, 87, 60, 60,242,255, 31, 63, 83,194,231, 62, 5, 56,189, 60, 85,188, 68, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,181,132,186, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,189,240,209,128, 63, 95,183,178,
- 64,176, 67, 5,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,234,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 86,114,107,191, 2,141,137, 61,105,140,227,190, 63,121, 70, 62,218,242,130,190,132,163,237,
- 60, 16,235,219, 62,248,203, 85,191, 80,244, 79, 62,148, 0,103, 63, 85,189,153, 61,200,104,151, 60,142, 55,246, 61, 76, 57, 74,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 33,252, 31, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 25, 54,206,
- 62,162,197,171, 64,121, 16, 6,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,201,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,235,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,244,100,219,191, 91, 69,182,189,144,137, 60, 62, 59,126,161,190,200,228, 28,
- 62,170, 49, 60,189,250,139,225, 62,111,143,244,191,100,103,252, 62, 79, 32,148, 62,163,246,104, 63, 16,201, 91, 61,136,104, 24,
- 61, 66,230,227, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 41, 88,182,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 61, 57, 29,191, 39, 53,236, 64, 55,221,173,191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,
-190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,236,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 35, 43,167, 61,225,210,242, 63, 30, 58,197, 63, 67, 8,229,
- 61,222,176,215, 63, 12, 15, 70, 62,165,195, 80, 61,227, 72,218,191, 87, 66,188, 62,195,213,145, 61,212,218, 39, 63, 25, 20,242,
- 62,118, 70,122, 61,107,226,159, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 64, 74,173, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191, 40, 62,249, 63, 26,113, 16, 64,160,179, 50,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,237,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,224, 29,190, 63, 4, 44,239, 63, 49,217,125,
-190,121, 25,107, 62,217,172,117,190,116, 98,242, 63, 42,162,148,190,199,178,142,191, 13,105, 54,190,163,107, 83, 63, 45,186, 64,
- 62, 91,122,109, 61, 21,134, 32, 61,144,118, 21, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 73,107,113, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,191,138, 51, 90,192,110, 14,199, 63,203, 66, 18,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,238,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 39, 78, 36,190,251, 50,128,
-190,189,185,139, 62,226, 4,175,190,153, 23,118,190,120,228, 67,191, 42,226, 50,191, 86,243,239,190,189, 42, 37,190,190, 1, 66,
- 59,153,223,235, 59,243,174, 21, 63, 60,160,231, 62,128,135,251, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,105,245,167, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,186, 75, 44,191,204,205,170, 64, 61,169,132,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,239,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,155,223,118,
-191, 3,196,249,190,163, 12,115,191, 60, 73,212, 62, 85,208, 59, 62,155, 11, 65,189,173, 17, 28,190,254, 16, 20, 63, 32,229,213,
-189, 28,221,216, 62, 52, 19, 79, 62,146, 52,229, 62,171,228,191, 62, 79,185,106, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 37,184, 45, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,219,119, 4,192, 28, 73,231, 64,128,117, 83,191, 55, 81,188,
-191, 71,243,109, 63, 42,237,100, 62,214,163,233,190,183,206,202,190, 61,137,201,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,240,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 62,254,109,168, 63, 4,146,210, 63, 23,131,232, 62,187,212, 66,190,158,109, 9, 62,216, 12, 71, 59,153, 20, 64, 62, 7, 2, 11,
- 62, 91,134, 92,191, 33,128, 43, 62, 51, 75,186, 60,144,251,206, 61, 19, 49,198, 63, 69,114, 22, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,115,100,221, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,194, 59,172,192, 13, 29, 35, 64, 30,208, 13,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,241,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,155,223,118,191, 3,196,249,190,163, 12,115,191, 60, 73,212, 62, 85,208, 59, 62,155, 11, 65,189,173, 17, 28,
-190,254, 16, 20, 63, 32,229,213,189, 28,221,216, 61,227, 31, 97, 62,104,207,168, 62,237, 89, 38, 62, 74,238, 93, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 37,184, 45, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 82,190,197, 62,174,148,251,
- 64, 91,189, 29,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,242,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 10,132,170, 62,237, 61, 82,190,223,191,127, 63, 12,148, 11, 62, 92,142,236, 63, 32,199, 17,
-189,242,206,157, 63, 15,114,199,191, 33, 82, 91,190,167,247, 3, 62, 37, 10,210, 63, 65,152,124, 61,106,110, 28, 60,207,189,179,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,140, 23, 40, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190,163,157,120,
- 63, 33,219, 44, 64,167, 25,250,191, 55, 81,190,191, 71,243,107, 63, 42,237,102, 62,214,163,237,190,183,206,199,190, 61,137,206,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,243,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 4,175,102,190, 50,200,160, 63, 77,214,248,190,110,194,226, 61,198, 10,138,
- 62, 62,213,210, 61,253,163,141, 61,160,130,106,191,101,229,201, 62, 50,145,103, 63, 61,192, 52, 62, 23, 50, 16, 61, 1, 56, 40,
- 61,162,254, 43, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60,220, 81, 89,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 79, 63,131,191,203,225, 22, 64,133, 83,183,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,244,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,194,155, 70,191, 3, 93, 82,191, 19,133, 23,191, 2,146,179,
- 62,104,198,131, 63, 93,189, 15,190,209,226, 77,191, 21,122,159,190,234,192,169, 63, 35,128, 16, 62,167,188, 9, 61,138,167,141,
- 61,185,163,186, 63, 3,152,147, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 59,236,249, 25, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 62, 89,218, 20,192, 81, 21,169, 64, 38,226, 50,191, 55, 81,190,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,
-190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,245,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 52,169,139, 62,156,163, 97,190,184,132, 26,
- 63, 7, 25, 82, 62,151,117,127, 62,247,206,254, 63, 76,144, 27, 62,204, 57,150,188,246,181,184, 63, 19,222,196, 61, 18,237,175,
- 61, 0, 0, 50, 62,208, 45,180, 63, 6,186, 72, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,186,195, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,190,166, 91,192, 62,151,138,203, 64,159, 4,232,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98,
- 62,214,163,236,190,183,206,197,190, 61,137,201,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,246,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 7,240,212,191, 18, 2,213,
-191, 5, 90,228, 62,178, 92,221, 63, 16,236, 8, 62,151,216, 90, 62,128,193,155,188,245, 60, 56,190,160,129,118,191,113,157, 47,
- 63, 40,117,114, 62, 37, 92,164, 61, 78,198, 72, 62, 5, 28, 6, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,226, 96,137, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,191,137,104,190,208,156,143, 64,116,245,234,191, 55, 81,190,191, 71,243,109,
- 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,247,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 49,218,173,
-191, 23,109,113, 62, 55, 16, 32,190,188,117, 54, 62,208, 20, 25,191, 46,245,118,186,236,158, 72,191, 97, 10, 55, 62,183,128,140,
-190,146,230,177, 62,174,217,121, 62,188, 55, 45, 62, 25, 76, 41, 62, 16,146,138, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 48, 85, 96, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 78, 6,218,191, 2,247,240, 64,131,181, 2,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 64,248,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-189,236, 25,179, 63, 27,158,127, 62,239,235,123, 63, 33,108, 59,190,103,198,244, 62,187,192,251,190,101, 39,179, 62,138,210,110,
-191, 54,168,145,190, 63, 20,208, 62,211,209,237, 62,129,168, 1, 62, 7,237,108, 62, 77, 30,188, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,109,210, 2, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,251,181,100, 63, 79, 67,160, 64,143,115, 83,
-191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,201,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,249,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 61,237,243,122,190,169,234, 11,191, 55,226,211,191, 25,175,184, 63, 39,201, 24,190, 71, 23,204, 62,218, 61, 87,
- 63, 39,211, 31,190,215,101,108,189,244,125, 35, 62,250, 56, 31, 62,248,208,174, 60, 79, 43, 50, 60, 79,186,252, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,186,130, 83, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 16,143,166,192, 31, 40,219,
- 63,240,165,188,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,250,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 15,157,192,190,205, 51, 47,190,136, 40,152, 63, 44,122,128, 63, 92,144,194,190, 99, 36,235,
-190,206, 22,244, 62,220, 32,143, 63, 19,244,169,189,238,205,160, 61, 69,255, 93, 62,129,237,131, 63, 29,113,199, 61,169,188, 16,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,151,139,249, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 46, 16, 47,
- 62, 17,135,234, 64,101,174,196,191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,251,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,162,110,186,190,105,104,145, 62,239,168,247, 63, 74,235, 3,190,178, 77,140,
- 63, 72, 49, 80, 62,112, 45,164, 63, 44,101, 43, 62,173,162, 95,190,104,215,180, 62,112,185,132, 63, 31,198, 76, 61,186,148, 82,
- 61, 75,140,149, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,120,174,161,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 34, 76,221,191,220, 63,195, 64, 19, 92,101,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,252,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 32, 89,101, 63, 82, 91,234, 60, 86, 78,243, 63, 12, 61, 22,
-190,178,120,249,191, 37, 19,203, 63, 24, 65,128, 63, 52,226,196,191, 0,214,219,190,210,228,203, 61,144, 5,191, 62,203,251, 27,
- 62,232,217, 8, 61,156,169,185, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,113,165, 7, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191,208,209, 0,192, 57, 98,175, 63,244, 39,214,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 64,253,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 6,136,242,191, 58,135,240, 61,233,198, 89,
- 63, 41,148, 57,190,189,188,151,190,189, 72,156, 63, 86, 14,184,190,165, 54,185, 62, 49,220,131,189,189, 87, 60, 61,100,142, 40,
- 62, 18, 81,206, 63, 34,238, 52, 62, 40,209,214, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 61,181,132,186, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 19,146,156, 63, 38,169,132, 64,133,240,119,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 64,254,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,104,191,123,190,172, 12, 91,
- 62,112, 97,100, 61,150, 67,240, 61,241,234,237,190, 65, 15,121, 62, 61, 2,224,190,233, 38,159,187,191, 62,118, 63, 29,119,107,
- 62,202, 98,177, 63, 14,134,157, 60,213,140,246, 60,179,116, 97, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 69,173,159, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,211,209,100,192, 64, 57, 80, 64,100, 52,239,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 64,255,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,157, 46,129,
-191, 47,142,239, 60,219,129, 7, 63, 40,203,124,189,122,175, 5, 62,139, 33,180, 61, 63, 8,162,191, 26,191, 75, 61,189,191, 52,
-190,100,188,125, 61,112,222,131, 60,161,149,150, 61,202,188,127, 63, 82,141,219, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 58, 78, 34, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62,195, 40,204,192, 22, 66,169, 64, 88, 69, 56,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 0,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 25, 69,168, 62,124,123, 76,191, 32,238,100, 62,220,140,234, 61,120,159, 84, 61,244,254,187, 63, 59,215,103,190, 71,235,244,
-191, 73,172, 9,190,165,228, 94, 62, 39,198,237, 61,180,166,232, 62,106, 45, 33, 63, 4,238, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,104,255,128, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,124, 41,179,192, 92, 52,215, 64, 56,194, 1,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 1,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,175,191,249, 63, 67,210, 72,190,255, 44, 91, 62, 97,232, 36,191, 70, 89,183,190,246, 37, 58, 61,211,174,112,
-189,119,174,231,191,119, 2,237, 62, 35,205,180, 59,158,119,225, 59, 89,185, 62, 62,150, 41, 58, 63, 50,212,186, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 32,102, 78, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 66,215, 78,189, 17,102, 16,
- 64, 82, 64,251,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 2,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,190,158, 15, 40,191, 27, 48, 97,191, 41,181, 48,190,160, 19, 31,189,153, 23, 91,190,110,243,100,
-190,164,169,182,191,120,129, 97, 60, 90,101,145, 61,186, 53,193, 62, 31, 65, 94, 63, 45, 57,152, 61,248,240,117, 61, 61,128, 59,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,137, 79,196, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,243,234,243,
-192, 50,199, 12, 64,118,173,246,191, 55, 81,192,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,197,190, 61,137,205,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 3,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,136,137,130,191,106, 7,101,190,155,249,249, 60,155,218,146,188,184,212,179,
-189,201,215, 68,191, 61,244, 40, 61, 70,234,114,191, 1,226,154, 63, 91,139,119, 61,207, 64,202, 60, 89,106, 46, 61, 13, 53, 30,
- 63, 89,222,236, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 87, 40, 6,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 54,176,174,191,187,173, 99, 64, 93, 31,209,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 4,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 71,176, 89,191, 18, 55,214,190,223, 82, 67, 63, 50, 2,142,
- 61,202, 17,235, 62,199,118, 51, 63, 72,125,129,191, 36,250, 86, 61, 90, 99, 70, 63, 25, 38,125, 62,129,144,101, 62, 91, 1,185,
- 62,121, 67, 60, 62,148, 77, 32, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62, 35, 69, 21, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,192,100,131,238,191, 81,185,222, 64, 27, 50, 40,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 5,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 35, 43,167, 61,225,210,242, 63, 30, 58,197,
- 63, 67, 8,229, 61,222,176,215, 63, 12, 15, 70, 62,165,195, 80, 61,227, 72,218,191, 87, 66,188, 62,195,213,145, 60, 70,146,197,
- 63, 44,125, 83, 62,156,124, 64, 60, 10,144,125, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 64, 74,173, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,190,248, 77,226,190,103,109, 12, 64,143,231,230,191, 55, 81,190,191, 71,243,107, 63, 42,237,100,
- 62,214,163,235,190,183,206,199,190, 61,137,204,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 6,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,251, 62, 59, 62,132,207,154,
-191, 19,198,191,191, 25, 82,122,190,169,114,179,191, 46, 80,242,189,100, 92,161, 62,188,103,125,191, 23,234, 0, 63, 22,140, 12,
- 63, 3,173, 53, 62, 78,233,187, 61,187,225, 77, 62, 68,112,203, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62, 89,205, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 64, 10, 80,129,192, 74,130,253, 64,109,179,124,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 7,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 71,176, 89,
-191, 18, 55,214,190,223, 82, 67, 63, 50, 2,142, 61,202, 17,235, 62,199,118, 51, 63, 72,125,129,191, 36,250, 86, 61, 90, 99, 70,
- 63, 25, 38,125, 60,202, 2,215, 59,181,116, 38, 60,204,167,240, 63,113,223,193, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 35, 69, 21, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 55, 37, 73,191,210, 44, 92, 64, 12, 20,134,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 8,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 15, 7, 34,190, 46,194,135, 62,148, 82, 36,191, 66, 22,185, 63, 53,135,211,190,172, 29,111, 62,229, 68,200, 62,140,167,253,
-190, 99,223,181,190,176,226, 35, 61, 50,158,144, 62,230,247, 53, 62,236, 25,253, 61, 52,215,226, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,214,199,202, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,152,163, 4,192, 16,189,233, 64, 39, 29,148,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 9,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,189,236, 25,179, 63, 27,158,127, 62,239,235,123, 63, 33,108, 59,190,103,198,244, 62,187,192,251,190,101, 39,179,
- 62,138,210,110,191, 54,168,145,190, 63, 20,208, 61,250,136,113, 62, 71, 45,109, 62,222,240,248, 62,125,172,108, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,109,210, 2, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,213,219, 83,192, 77,221,119,
- 64, 90,157, 98,191, 55, 81,192,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,197,190, 61,137,205,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 10,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 4,225, 56, 63, 35,172,239,191, 4, 44, 92,190,112,166, 88,190,176,149,229, 63, 6,184,233,
-191, 44,120, 91, 63, 20, 36,208, 63, 79, 84,165, 61, 89,145,190, 60,192,154,154, 60, 43,233,206, 62, 0, 13, 68, 63, 87, 72, 51,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 32,131, 34, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,106, 39,118,
- 63,114, 29,130, 64,164,123,156,191, 55, 81,190,191, 71,243,107, 63, 42,237,102, 62,214,163,235,190,183,206,200,190, 61,137,205,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 11,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 45, 97,119,190,205, 47,119, 63, 19,117, 35, 62, 98,125,166, 62, 73,195,242,
- 62,243,228,124, 63, 11, 86,119, 62, 89,156, 70, 63, 88,232,230,190,204, 53,130, 63, 54, 27,149, 62,133, 38,243, 60, 53, 55,232,
- 60,143,130, 91, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,253,129, 53,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192,102, 71, 4,190,194,109,241, 64, 47, 39,108,191, 55, 81,192,191, 71,243,107, 63, 42,237,100, 62,214,163,233,190,183,206,198,
-190, 61,137,204,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 12,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188,105,157,127, 62,184, 8,148,191, 7,109,181,191, 68,194,177,
-190,220, 77,163, 63,101,120, 58, 61, 25,105,241, 62, 86,197, 69,190,236, 78,214, 63, 46,136,126, 61, 22,203,152, 63, 61,161,132,
- 62, 79,196, 67, 60,160, 22, 79, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 93,148,112, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,214,224, 12,192, 5,182,225, 64,136, 59,246,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 13,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 24, 46,192,191, 43, 20, 41, 62,183,184,186,
- 62,136,173, 42, 63, 50, 75, 75, 62,126, 83, 40, 63, 8,195,188, 62,238,211,234, 61,152, 36, 69, 62,145,106,235, 62,131, 28,211,
- 60, 46,255, 24, 60,139,165, 11, 63, 55, 88,113, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 57,122, 93, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 92,158, 95,192, 67,243,117, 64, 70,154, 16,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 14,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 4,175,102,190, 50,200,160,
- 63, 77,214,248,190,110,194,226, 61,198, 10,138, 62, 62,213,210, 61,253,163,141, 61,160,130,106,191,101,229,201, 62, 50,145,103,
- 61,104, 55,112, 61, 9, 23, 14, 62,129, 82,208, 63, 40, 65,176, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 60,220, 81, 89, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 31,234, 87,192, 65,234,204, 63,172,200,110,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 15,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 99,180,162,
- 62,145,169,127, 62,174, 95,114,189,223,121,169, 63, 73,190,173,190, 51, 72,118,190,162, 48,116,189,139, 98, 59, 62,191,245, 77,
- 61,253,124, 75, 60, 48,252,197, 62, 62,176,163, 63, 72, 93,216, 60,166, 65, 94, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 12, 69, 81, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,189,122, 76,191,102,243,238, 64, 93,253,158,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 16,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-189,218,139, 33,190,222, 81,160,190,151, 71, 75,191, 88, 33, 47,190,128,174,152,190,107,218, 43,190, 66, 96, 40,190,113, 29,219,
-190,184,240, 89, 62,204, 92,153, 62,135,159,101, 62,174,216,253, 62, 96, 99,217, 62, 50,171,104, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,207, 27, 5, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 67, 75,227, 61, 78,124, 48, 64,171,150,200,
-191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 17,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,190,190, 19, 92, 62,147,203,188, 62, 2,242, 19, 63, 95,138,223, 60, 24, 50,144, 63, 64,174,148,191, 11,158,196,
- 63, 64, 22,220,190, 19, 35, 98, 62, 44, 93,217, 63, 58,115,191, 60, 2,198,121, 59,167,102,254, 62,132,100,178, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 27,176,189, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62,139, 37, 24, 63, 62,231, 4,
- 64,179,205,174,191, 55, 81,188,191, 71,243,107, 63, 42,237,102, 62,214,163,235,190,183,206,200,190, 61,137,206,191, 80, 38,156,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 18,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 60,239,220, 87,191, 46,204,168, 61, 84, 95, 78,191, 58,105, 8, 63, 43,245,231, 62,151,254, 91,
- 61,206,143, 77, 63, 42,139,177,190,196,107, 26,190,139,211,150, 63, 92, 23, 50, 61, 15, 27,169, 60, 83, 43, 8, 61,189, 83, 59,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 49,221,121, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,225,247, 32,
-192, 81,175, 37, 63,198,254,248,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 19,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,130,132, 59,190,120,166,131,191,109,191, 15, 61,238,164,170,190, 78, 93, 20,
-189,231,164,245, 62, 16,254,254,190,234,189, 61,189,116,167,116, 63, 16,175, 67, 61, 2,132, 66, 61,189, 37,191, 63, 64, 5,173,
- 62, 0,181, 91, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 2, 93,129,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 61,165,110,200, 62,239, 43,183, 64,169,243,129,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 20,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 49,218,173,191, 23,109,113, 62, 55, 16, 32,190,188,117, 54,
- 62,208, 20, 25,191, 46,245,118,186,236,158, 72,191, 97, 10, 55, 62,183,128,140,190,146,230,177, 63, 66,109, 62, 61,170,159,244,
- 60,243,150, 79, 62, 2,136, 69, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 48, 85, 96, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191,243,158, 12,192,104,237,244, 63,155, 34,138,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 21,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 49, 22,155, 62,165,232,223,191, 6,208,133,
-190,190,253, 93,190,194,234,190,191, 29, 89,239,191, 23,110,134,191, 30,217, 8,190,205,159,107,190,185, 94, 18, 60, 92,106,228,
- 61, 35, 25, 23, 63, 93,111,136, 61,167,105,211, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,132,153,252, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 8, 74,118,192, 1,240, 0, 64,108,123, 28,191, 55, 81,190,191, 71,243,107, 63, 42,237,102,
- 62,214,163,235,190,183,206,200,190, 61,137,205,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 22,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,104,155,217,190, 29,164,215,
-190,179, 60,175, 62, 43,201,201, 61, 67, 60,100,189, 90, 42,171,191, 4, 85, 68, 62,130,249, 67,190,133,199,230, 63,107, 14,149,
- 62,101,242,233, 61,181,120,181, 62, 43,136,231, 63, 4,241,245, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,108,179,252, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,231, 24, 26,191, 21,105, 44, 64, 98, 32,186,191, 55, 81,190,191, 71,243,107,
- 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 23,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 49, 52,126,
- 63, 43, 9,201,190, 96,234,166,190, 37,210,182, 61, 54, 58,206, 63, 63, 1,231,191, 34,173,133,190,170,154, 5, 63, 51,112, 93,
-191, 23, 61, 18, 62,138,189, 66, 62,210,103,114, 62, 62,128,117, 62, 7, 54, 35, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,126,132, 33, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 5, 52,141,192, 49,103, 10, 64, 37,154,230,191, 55, 81,190,
-191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 24,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 32, 96, 77, 62,160,201,185, 63, 6, 3,160,190,248, 34, 11, 60,185, 53,206, 61,178,197,192, 63, 53,184,174,190,162,172,223,
- 62,224,136,109,191, 61,173,142, 61,184, 47,132, 61,207,157,244, 62,225, 0,168, 62,189, 11,249, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,150,112,248, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,177, 45,136, 63, 99,253, 22, 64,155, 58, 8,
-191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 25,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 55,202, 47,190, 89,235,249,190, 92, 18,127,191, 32,129,146,190, 8,212, 7,190,171, 50,167, 62,123,120, 97,
-189,249,152,232, 62,149, 18,140, 61, 13,111, 37, 63, 28,253,147, 62,184,184,231, 60, 58, 48, 48, 60,111, 78, 59, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 18, 61,115, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 57,255, 42,192, 65, 4,235,
- 64, 19, 7, 77,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 26,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,189,133,218,208,189,176, 10,116, 63, 10,237,186, 63, 85, 61, 14,190, 38,219,182, 62,206,175,174,
- 63, 10,240, 47,190,114,232, 31,190,207,162, 91,190,193, 85,173, 61,128,255,228, 61,172, 32, 76, 63, 5,152,147, 62,169,134,205,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60,212, 38, 62, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,137, 68,184,
- 61,226,177,204, 64,141,247,196,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 27,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,146,138,133,187, 8, 75,133, 62, 68,235, 28, 63,122,141,122, 63, 92,117,116,
-190,125,147, 7,190,147, 49, 87, 63, 41, 88, 9, 63, 2,255, 63, 61,126, 44, 71, 63, 0,166,107, 62,154, 29, 23, 61,165,214, 34,
- 61,236,130, 42, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,103,170,241,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 82,103, 22,191,201, 75, 73, 64, 0,247, 1,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 28,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,168,120,231,191, 7,154,179, 63, 48,180, 41,190,187,232,239,
-191,104, 35, 9, 62,114, 8,222,190,177,143, 76,191, 28, 29,107, 62,234,112,210,190, 92,249, 9, 59,118,109, 73, 63, 4,155,168,
- 62,243, 2, 73, 59,108,198,186, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,184, 4, 74, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191,246,241,194, 62,236,130, 87, 64,135,209, 50,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 29,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,223,197,124,190,189,243, 32,190,140,213,199,
-191, 69,149, 13,190,199,235,221, 62,240, 79,159,190, 14,202,113,190, 60,168,186,190,220,145, 5, 62,148, 8, 42, 62,219, 99, 49,
- 62,242, 73, 85, 61, 79, 14,127, 61, 67,141, 68, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,192,236,157, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,189,149,228,224,190,221, 13,233, 64,145,251,210,191, 55, 81,190,191, 71,243,107, 63, 42,237,100,
- 62,214,163,235,190,183,206,199,190, 61,137,204,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 30,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,190, 19, 92, 62,147,203,188,
- 62, 2,242, 19, 63, 95,138,223, 60, 24, 50,144, 63, 64,174,148,191, 11,158,196, 63, 64, 22,220,190, 19, 35, 98, 62, 44, 93,217,
- 63, 4,141,198, 62, 19, 71, 3, 61,174,186, 60, 62,129,146, 99, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62, 27,176,189, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 89,120, 0,190,120,169,164, 64,155, 78, 26,191, 55, 81,192,191, 71,243,109,
- 63, 42,237, 98, 62,214,163,234,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 31,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 94,201,118,
- 62,213,189,192, 62, 67, 27,142,190, 55, 93,214,190,131,154, 6,190,178, 48,133,190,192, 11,139,189,147,123, 39,191, 57,130, 29,
-190, 33,253, 46, 63, 24, 89,224, 61,198,174,189, 61,101,152, 2, 62,128,237,143, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,117,122, 59, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 26, 80, 92,189,239, 3,232, 64, 99,210,182,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 32,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-190,153, 16,148,191, 33, 1,224, 62,168,253, 43, 63, 35, 36,254,191, 19,255,124,190,138, 97, 70, 62, 6,109,188,190,223, 58, 64,
-189,189,121,154, 62,170,126, 9, 62,126,248,115, 63, 12, 41, 84, 62, 4, 55,153, 61,152, 85, 62, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,106,244, 74, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190, 70,245, 80,192, 37,148,136, 64, 57,107, 41,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 33,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,249,246, 44, 62,140,102,200, 63, 10,199,154, 63, 32,102, 40,191, 19, 10, 78,190,250,238,224,190,111, 13, 0,
- 61,187,232,243, 62, 99, 10,106, 62,221, 96,163, 61,239,237,208, 61,210, 34, 10, 62,181,101, 62, 62,218, 22,205, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 25,143, 35, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 25,172,253,191,249,234, 68,
- 64, 73,217, 59,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 34,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,230,109,205,190,189, 47, 67,189,155,119,205,191, 79, 53,238,191, 88,144,223, 62,146,163, 88,
-190,208, 99, 63, 62,130,235,236,190, 17, 10, 72, 63, 15,223,124, 62, 64,172, 12, 62, 51, 24,160, 62,156, 49,145, 62,169,236, 26,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 72,237,254, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 60, 63, 77,
-191,245, 70,192, 63,248,177,246,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 35,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 16,162, 50,190,219,180, 33,190,177,166, 24,191, 29, 8,234,190, 48, 26, 24,
-190,115, 70,240, 63, 54,197, 0, 62, 75,201, 69,189, 10,174, 28, 63, 78,128, 81, 60,175,109,172, 62,214,135, 7, 63, 9, 12, 59,
- 60,198,154,150, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,138, 50, 34,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,162,125, 6,192, 64,233, 63, 64, 86,167,147,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 36,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 11,120,234,190,253, 35,200,190,233,152, 2,191, 0, 38, 0,
-191, 36, 3,214,190, 45,239, 3,191, 9,175,135,190, 42,130, 18, 63, 38,197,156,190,238, 37,181, 61,119, 49, 4, 60,224,251,119,
- 62, 47, 5, 94, 63, 61,195,188, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,191,162, 89, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,192, 27, 96,184,191,179, 23,251, 64, 38, 77,193,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 37,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 32,231,177, 62,239, 89,150,190,188,156,128,
-191, 0, 45,225, 62,210,133,247, 63, 40,169, 51, 63, 26,184,146,190,223, 39,209,191, 15,238,182,190,146, 63, 75, 61,213,161,166,
- 62,218,242,217, 62,191, 18, 39, 61,194, 74, 89, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 61,129,236, 81, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 21, 0,185,192, 14,241,137, 64, 61, 27,206,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 38,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,213, 79,214, 63, 10, 19, 95,
-191, 56, 25, 60, 62, 10,193,193,190, 10,232,127,190, 93,126,162, 63, 7,169, 25,190,221,209, 38, 62,186,214, 52,191, 41, 63, 21,
- 62, 27, 36, 58, 62, 28,151,245, 62,179, 23, 82, 62,177, 10,148, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 41,241, 98, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,189, 57, 80, 64,191,166, 80,193, 64,123,172,242,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 39,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,232,174,160,
- 61,164, 99, 64, 63, 12,108, 41,191, 50,126,106, 62,124,117, 66, 63, 82, 54,134, 62,191, 55, 38,190,197,232,121,189, 70,203,188,
-191, 51, 88, 26, 62,170,225,199, 62, 23, 67,114, 62, 33, 56,202, 62,184,224, 26, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,138,213,216, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190,219,106,202, 63,127,216, 17, 64,173,251,140,191, 55, 81,190,
-191, 71,243,110, 63, 42,237, 98, 62,214,163,235,190,183,206,198,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 40,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-190,213, 79,214, 63, 10, 19, 95,191, 56, 25, 60, 62, 10,193,193,190, 10,232,127,190, 93,126,162, 63, 7,169, 25,190,221,209, 38,
- 62,186,214, 52,191, 41, 63, 21, 63, 79,203, 10, 62, 32, 14,104, 60, 44,238,252, 60,175,180, 55, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 41,241, 98, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 91, 39,111,191,150, 81, 64, 64, 15, 68, 89,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 41,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,191, 0,212,130,191, 38,161, 15,190,123,203,131,191, 3, 48,207, 63, 64, 6,112,190, 34, 53,137,191, 6,202,175,
- 62, 19,241, 66,190, 85,105,119, 61,146,246,149, 60, 25, 88, 25, 63, 25, 74, 85, 62,196,185,199, 59,249,179,210, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 90,223,198, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 40, 17,231,190,153, 44,141,
- 64,161,123, 68,191, 55, 81,190,191, 71,243,107, 63, 42,237,102, 62,214,163,235,190,183,206,200,190, 61,137,205,191, 80, 38,157,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 42,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 68,219, 69, 62, 74, 75,190, 62,229,129,250,190,210, 78,198,188, 59, 63, 65, 62,214,173,173,
- 62, 85,159, 18,189,185,160, 25,191, 46,193,169,190, 77, 21,177, 63, 32,133,202, 61, 36,163, 25, 60,225,136, 45, 62,156, 71,133,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61,141,208, 22, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 95, 50,
-191,249,101, 34, 64,132, 96,176,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 43,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,189,236, 25,179, 63, 27,158,127, 62,239,235,123, 63, 33,108, 59,190,103,198,244,
- 62,187,192,251,190,101, 39,179, 62,138,210,110,191, 54,168,145,190, 63, 20,208, 62,138, 45, 62, 61, 30,142, 35, 61,128, 78,173,
- 63, 32,246,170, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,109,210, 2,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 6,133,111,191,225,152,167, 64, 32, 16, 84,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 44,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,241, 57,184, 62,173,244,209, 61,188,195,202, 63, 79, 10,229,
-191, 34,223, 15,190, 40, 65,171, 61, 38,228,158, 63, 12,225,187,189, 13,196,198,191, 14,253,185, 61,217,107,245, 62,174,147,253,
- 62,218,232,227, 62, 0, 80, 70, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62,183,168, 8, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,190,228, 99, 80,191, 51, 59, 44, 64,133, 75,221,191, 55, 81,192,191, 71,243,109, 63, 42,237, 98, 62,214,163,234,
-190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 45,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 23,191, 52, 62, 82,209,247, 62,204, 21, 34,
- 63, 43, 58, 21, 61,139, 3, 1, 61,135,159, 52,189, 36,117, 30, 62,244,123,230, 62,185,104, 79, 63, 33, 73, 17, 62,213,208,117,
- 62, 76,118,118, 62, 5,254, 32, 62,128,245, 65, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 4,246,179, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 74,101, 85,191,105,185,166, 64, 36,141, 18,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 46,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 3,157,221, 62,215, 81, 67,
- 63, 5, 46,135,191, 9,108,121,190, 16, 83, 37,190,130,244, 37, 62,216, 18,191, 63, 53, 44,221,189,162,136,153,190,252,138, 80,
- 61,102,214,221, 63, 25, 22, 50, 62,157, 42,139, 61, 30,113,164, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 26,208,145, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,218,234,122,191,232,177, 50, 64, 42,174,108,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 47,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 59, 41, 98,
- 61,252, 70,236,191, 25, 96, 77,190,154,195, 33,190,242,119, 31,190,204, 79,125,190, 18, 53, 23,190,214, 31,102,190,199,174,165,
-188,169,105, 48, 62, 8, 50,229, 62,148,251,227, 62,206, 65,133, 62, 49, 82, 75, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 5,230, 44, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,206,106,254, 62,150, 36,205, 64,137, 42, 96,191, 55, 81,190,
-191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 48,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 23,191, 52, 62, 82,209,247, 62,204, 21, 34, 63, 43, 58, 21, 61,139, 3, 1, 61,135,159, 52,189, 36,117, 30, 62,244,123,230,
- 62,185,104, 79, 63, 33, 73, 17, 62,231, 15, 87, 62,207,237, 49, 61,141, 43,254, 61,150,225,226, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 4,246,179, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,167, 61,200,191,171, 5,119, 64,147,214, 86,
-191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,201,191, 80, 38,157, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 49,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 70, 39,111,188,218,103, 91, 63, 30, 24, 44, 62, 12, 81, 28, 63, 16,129, 26, 61,162,153,215,191, 31,203, 11,
- 63, 2,132,222,190,154, 4, 26, 62,100,112,202, 62,214, 36,216, 60,122, 85,172, 60,142,247, 44, 63, 12,140,132, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,115, 61, 48, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,251, 14,194,190,105,213, 44,
- 64,109,188,165,191, 55, 81,190,191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 50,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,191, 3, 49,173, 63, 9,133,178, 63, 16, 18,104, 62,186, 16,159, 62,245,147,183, 62,111, 88,220,
- 63, 2, 25,220,191, 77, 44, 80, 62,152,136, 76, 61,176,242,126, 62,155, 13,239, 62,234, 17, 40, 62, 13,128, 92, 61,208,130,226,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,208,147, 65, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 46, 47,102,
- 63, 45,212, 64, 64,127, 35, 61,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 51,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 48,164, 8,191, 38,100, 32,190,157,157,163, 61,167, 78, 10, 59, 54, 8, 4,
-190,147,155,139, 63, 50, 41, 11, 62,140,101, 27, 63,110,237,241, 59,179,188, 18, 62,165, 31, 74, 63, 37,208,207, 60,141,227, 74,
- 60, 76, 28, 8, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 80, 24,129,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 83,203, 10,192, 29, 15,133, 64, 42, 82,237,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 52,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,232,194, 41, 63, 35,110,156,190, 75,200,233,191, 22,158,170,
-189,193,122, 83,189,149, 58,217,191, 18, 15, 80,189,145, 37, 66,189,219,184, 98,191, 86,185, 70, 61,239,150, 21, 62, 24,193,130,
- 62,217, 71, 46, 62,158,114,141, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 75,231,122, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,102, 71, 47,191, 44, 13, 16, 64,156,187, 24,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,
-190,183,206,197,190, 61,137,201,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 53,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 61, 40,120,191, 15,196,150,191, 54,219,159,
- 62,191,195,234,190,122, 96,104,191, 74, 71,193,190, 56,230, 15, 61,203,156, 61, 61,177, 39,227,190,193,222, 25, 63, 13,206,178,
- 60,237,101,144, 60,198,227, 16, 62,201, 30, 16, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 61,189,137, 74, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,252,210,140,191, 44, 58,216, 64,149,217, 98,191, 55, 81,192,191, 71,243,109, 63, 42,237, 98,
- 62,214,163,234,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 54,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 38,152, 86,191, 17,225,169,
-189,140,217, 57,190,254,124, 67, 62, 17, 65, 13, 63, 15,204,229, 62,241,148,180,191, 73,210,175, 63, 21,161,182,188,169,222,186,
- 63, 4,174,235, 61,156,216,125, 61,115,228,114, 62,176,239,124, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 61,165,104, 86, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 46,210,181,191,135, 4, 59, 64, 44, 99,164,191, 55, 81,190,191, 71,243,109,
- 63, 42,237, 98, 62,214,163,236,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 55,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 45, 97,119,
-190,205, 47,119, 63, 19,117, 35, 62, 98,125,166, 62, 73,195,242, 62,243,228,124, 63, 11, 86,119, 62, 89,156, 70, 63, 88,232,230,
-190,204, 53,130, 61,201, 69,154, 63, 3,143, 74, 62,162, 10,155, 61,146, 21,186, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,253,129, 53, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 60, 64,235, 64, 63,147,210,203, 64,185, 32,205,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 56,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 62,136,137,130,191,106, 7,101,190,155,249,249, 60,155,218,146,188,184,212,179,189,201,215, 68,191, 61,244, 40, 61, 70,234,114,
-191, 1,226,154, 63, 91,139,119, 63,109,168,135, 61,112, 44, 87, 59,115, 72,106, 60, 24, 90,214, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 87, 40, 6, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 0,185,160,192, 38,235,197, 63,245,221,182,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 57,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,241, 54,241,190, 60, 75, 25,190,166, 31,137, 63, 76,162, 26, 62,180, 23,214,191, 22, 28,134, 62,184,125,189,
- 63, 49,143,170, 62,208,100, 42, 63, 12,182,201, 61,103,123, 85, 62, 90, 65,230, 63, 29,215, 33, 61,233, 5,124, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 78, 6,233, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,247,118,132,192, 8, 66, 87,
- 64, 20, 88, 93,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 58,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,157,149,183, 62,150,241,169, 63, 5, 72,210,191, 61, 98,196,191,103, 43, 94, 62, 13,249,141,
-190, 28, 40,108,189, 89,143,180, 62,180,169,159, 63,102,210, 50, 61,186,245, 15, 62,140,211,252, 62,252,184,237, 62, 15,107,164,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,126, 53,234, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190, 2,252, 96,
-192, 63, 32,189, 64, 40,176,249,191, 55, 81,190,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,198,190, 61,137,206,
-191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 59,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,185,185,227,190,133, 55, 69, 62,246,101, 76,191, 65, 32,146,190, 47,142, 11,
-191, 16,240,207, 60,250, 47,178, 62,135, 12,147,190,192,130,250, 63, 63,224,182, 61,141,251,109, 61,135, 15,209, 62,212,122,152,
- 62,230, 66,150, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,201, 22,194,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192, 60, 37,186,192, 19, 36,209, 63,212,102,200,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 60,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,253,116,133, 63, 23,178,160,191, 32, 78,114, 61,221, 97, 57,
-189,236,244,191, 62,214, 56,206,191, 40,142, 77, 61,161, 48, 31, 63, 7, 95, 82,190, 62, 70,244, 59,141,146,144, 62,182,189, 24,
- 63, 34, 24, 12, 59,183, 33,242, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 90, 4, 51, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,155,165, 62,191,200,188, 35, 64,140,201,156,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 61,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,205,198, 68, 63, 99, 21, 50,190, 86,246, 18,
-189,178, 24,237, 62, 74,177,229,190,174, 94,233,189, 17,113, 14, 62,211,148,144,190, 80,182,157,191, 66,214, 18, 62,182,112, 54,
- 61, 2,202,156, 61, 40,146, 65, 63, 18, 18, 24, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,124, 84,229, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 1, 48,150, 62,211, 14,133, 64,175,209,120,191, 55, 81,190,191, 71,243,107, 63, 42,237,102,
- 62,214,163,235,190,183,206,200,190, 61,137,205,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 62,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60,181, 0, 30, 63, 39, 21,183,
-191, 42, 28,174, 62,185,254,206, 61,180,101, 60, 62,162,164,224,191, 78, 22,169,190,146,164, 15, 62,188, 47, 66,191, 63,255,233,
- 63, 76, 61, 26, 60,171,234,214, 60, 47,187,230, 62, 46,146,126, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 41,195,113, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 98,144,196,191,112,190, 62, 64,138,224,153,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 63,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,148, 80,255,
- 63, 5,138, 17, 62, 38, 16,171,191, 73, 50,107, 63, 32,126,214, 62,148, 14,143,191, 4, 31,183, 62,145,152, 70,189, 89, 32, 21,
- 62,100,239, 63, 62,220,212, 51, 61,238, 96, 49, 61,205,246, 1, 62,180, 22, 64, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 76, 33,247, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 2,243, 80,191, 91, 84, 18, 64, 77, 0,110,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 64,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 69,146, 49,190, 69,123,236,191, 26,188,179,189, 47,182,207,191,105, 14, 96,190, 31,120, 55, 62, 18, 41,138,189,183, 73,210,
-189, 57, 99,105,190,137,155, 32, 62, 79,143,112, 62,220, 36, 13, 62,119,171,207, 62, 0,124,168, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,199,151,184, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 34, 81,228,192, 39, 55,178, 64, 68, 36, 87,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 65,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 3,148,230, 62,239, 68,224, 62,241, 64, 72,191, 11, 35, 71,191, 31,202,248, 62,182, 98, 68,191, 48,127, 18,
-189, 26,108,158,190,173, 93,145,191, 16,155,161, 61,244, 72,144, 61,173, 98,152, 62,154,243, 16, 62,252,162, 38, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,245,111, 69, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,132,206,226,191,254,157,153,
- 64, 57, 78, 61,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 66,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,217, 64, 45,190,213, 24,151, 61,187,174, 94, 63, 76,136,102, 63, 32, 1, 27,189,162, 95,236,
-191, 29, 18,124,190,155, 78, 75,191, 43,134,124,190,184,202,174, 62, 35,138, 49, 62, 85,209,237, 62,186, 75,126, 62,137, 6,113,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61, 76,100,111, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62,237,163,228,
-192, 58, 20, 55, 64, 64,122, 9,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 67,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,189, 55, 95, 82,190,181, 21, 43,191,101, 3,230, 62,137,248, 87, 62, 75,208, 4,
- 59,115,115, 0,190, 95,196,100, 62, 83, 15,191,191, 81,222, 84, 62,169, 58, 36, 61,163,215,187, 61, 92,207, 90, 62,152,248,188,
- 63, 17, 59,182, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,112,119,230,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191,148, 59,202,191, 56,242,188, 64,113,111,189,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 68,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,192, 21,202, 63, 8, 22,216, 63, 66, 84,188, 62,186, 70,158,
- 62, 98,211,240, 62,155, 7,124, 62,246,134, 10,190, 79, 16,110,189,252,197,248, 63, 39,188, 81, 62,169,204, 42, 62,154,195,204,
- 62, 51,225,146, 62, 66,254,125, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 81, 26,123, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,191,252,179, 34,191,184,102, 86, 64, 51,174,169,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 69,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,144, 50,232,191, 50, 31,207,191, 40,203,179,
-189, 45, 99,214,190, 34,153,109,191, 10, 94,239,190,212,186,115,190, 19,234, 42,191, 97, 26, 72, 61, 99,105,122, 62, 21,210, 46,
- 62,186, 32,250, 62,178,126,195, 62, 16,238, 85, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 60,124,240,131, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,192, 77,244, 1,190,163, 52, 51, 64, 62,234, 30,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98,
- 62,214,163,236,190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 70,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,112, 41,126, 61,164,166, 56,
- 61,240, 4, 91, 62,161,172, 15,190,191,126,106, 63, 64, 33,117, 62,184,227,130,190,244, 20, 92,189,180,168,210,191, 43, 25, 60,
- 61,198,246, 89, 63, 46,130, 30, 62, 54,241,223, 61, 46, 41,221, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,107,196,190, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,122, 27,255,191,133,229,179, 64,149, 39, 66,191, 55, 81,190,191, 71,243,107,
- 63, 42,237,102, 62,214,163,235,190,183,206,200,190, 61,137,205,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 71,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 24, 46,192,
-191, 43, 20, 41, 62,183,184,186, 62,136,173, 42, 63, 50, 75, 75, 62,126, 83, 40, 63, 8,195,188, 62,238,211,234, 61,152, 36, 69,
- 62,145,106,235, 62,239, 4,216, 61, 21,100,235, 61, 20, 73,174, 62,235,197, 83, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 57,122, 93, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,151, 66, 20,192, 62,139,208, 64, 5,118, 98,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 72,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-190, 32,160,159,191, 52, 39,190,191, 9,138,142, 62,224, 13,138, 62,242,218,166, 63, 26, 71, 93, 62, 52, 22, 36, 62,124, 52,231,
-190,192, 91,165,191, 86,111,148, 61,120,101,212, 61,221, 26, 72, 63, 22, 82,158, 62,122, 14,241, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 22, 96,195, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190, 46, 63,224,191,107,105,222, 64,132,191,198,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,201,190, 61,137,200,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 73,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 55,202, 47,190, 89,235,249,190, 92, 18,127,191, 32,129,146,190, 8,212, 7,190,171, 50,167, 62,123,120, 97,
-189,249,152,232, 62,149, 18,140, 61, 13,111, 37, 62,204,238, 89, 62, 39, 90, 10, 62, 6,156,123, 62,156, 22, 98, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 18, 61,115, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190,234,148,250,192, 97,179, 11,
- 64, 3,215, 16,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 74,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,190,248,227,177,190,192,134,160, 62,184,159,155, 63, 51,157,105, 63, 54, 56, 2, 62,182,126, 88,
-187, 4,207,108, 62,198,216, 38,191, 73, 66,140, 61,248,126,139, 60,119, 26,251, 60,150,207, 34, 63, 20,176,170, 62,197,120,225,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,216,234,208, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,135,177,202,
-192, 86,220,150, 63,239, 9,144,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 75,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 18,122,201,190,163, 68,155,191, 39, 36,236,190,194,182,221,190, 98, 47,217,
-190,230, 46, 97, 62,134,236,197, 60,187, 40,216,189,179, 92,111, 63, 54, 17, 71, 61, 5,169, 87, 61, 92,116,120, 63, 38,253,179,
- 62,133,192,225, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60,154, 58,100,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-192,108,105,213, 62,223,145,125, 64, 82,182,192,191, 55, 81,190,191, 71,243,107, 63, 42,237, 98, 62,214,163,235,190,183,206,198,
-190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 76,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 32,244,195,190,218,189,174, 62, 55, 11,163,191, 95, 75,157,
-190,243,155, 33,191, 90, 86,180, 62, 86,237, 57,190,126,198,226, 61,101, 34, 30,190,180,239, 93, 61,204, 82,206, 63, 89,113, 44,
- 61, 23, 63, 63, 60,100, 33,220, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63, 50, 63, 6, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,243, 23, 76,191,166,133, 46, 64,134,153, 78,191, 55, 81,192,191, 71,243,109, 63, 42,237, 98, 62,214,163,234,
-190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 77,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 49,218,173,191, 23,109,113, 62, 55, 16, 32,
-190,188,117, 54, 62,208, 20, 25,191, 46,245,118,186,236,158, 72,191, 97, 10, 55, 62,183,128,140,190,146,230,177, 62,190, 2,159,
- 61,193,141, 29, 61,214, 93,214, 62,220, 2,164, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 48, 85, 96, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,190,214,192,130,192, 73, 57,182, 64, 23, 83,175,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 78,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 34,172,206, 62,187, 79, 64,
- 62, 11,197,140, 63, 42,135,199, 61,148, 91,100, 60, 25, 75,123,189,232,126, 54,189,220,190,210, 62,186,158, 9,190,225, 62,182,
- 61, 84,103,211, 61,115,194, 92, 62,253,216,148, 62,201, 34, 41, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,162,103, 38, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192,133, 4,122, 62,128,136,109, 64, 58, 58,136,191, 55, 81,190,191, 71,243,107,
- 63, 42,237, 98, 62,214,163,235,190,183,206,198,190, 61,137,206,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 79,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,137,206,147,
- 63, 11,207,234, 62,225,144,195, 63, 40,225,162,190,148, 69, 24, 61,190,238, 50,191, 86, 31, 13, 63, 71,106,217, 62, 1, 60,247,
- 62,136,250,162, 58,156, 80, 70, 63,108,100,142, 61,153, 72, 15, 58, 17, 35,116, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60, 41,199,174, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 12, 40,132,192, 1, 32,102, 64, 95,178,222,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 80,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 95, 57,157, 62,214,148,238, 62,109,249, 87,189,204,220,227,189,221,118,238,191, 19,162,121,191, 48, 50,203,190, 80,232, 58,
-191, 8,100,141, 63, 19,142,229, 62, 88,196,223, 61,237, 94,134, 62, 97, 5,141, 62,231,195, 43, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 15, 11, 75, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 80,109,211,192, 20,210, 96, 64,103,253,246,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 81,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,133, 32, 88,190,189,201, 13, 63, 66, 43, 55, 62,239,254, 76, 62,179,163,254,188,171,181, 15, 60,196, 8,130,
-191, 14, 27,214,190,128, 32, 86,190,208, 27,190, 62, 53,196, 69, 61,135,184,136, 62, 35,250,240, 63, 24,153, 34, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,234, 93,224, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,147,142,240,190,166, 7, 43,
- 64,130, 69, 61,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 82,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,249,246, 44, 62,140,102,200, 63, 10,199,154, 63, 32,102, 40,191, 19, 10, 78,190,250,238,224,
-190,111, 13, 0, 61,187,232,243, 62, 99, 10,106, 62,221, 96,163, 62,206,243, 56, 62,159,170,109, 62, 2,145,224, 62, 32, 50,211,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 25,143, 35, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 89,254, 2,
-192, 85,197,195, 63,254,197,176,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 83,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,204,125,122, 63, 46, 10, 37,190, 26, 71, 69, 63, 24,168,130,190, 36,105,117,
- 63, 32,220,144, 62,231,167, 11, 62,179,145,151,190, 36, 72, 33,191, 50, 67, 42, 61, 11, 3,111, 61, 76, 2,241, 63, 28,181,231,
- 62,155,179,103, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,188,186,244,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191,253, 46, 24, 61,214,126,200, 64,125, 1,248,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,190,183,206,197,
-190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 84,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,181,218,171, 63, 80,100,162,190,175, 18, 86,190,157, 51,142,
-191, 4, 35, 18, 62,210,113,207, 63, 11,170, 0,190,165,126,134, 62, 59, 47,141,191, 62,163,104, 62,181,251, 18, 62,242,163,225,
- 61,191, 98, 90, 61,158, 33,220, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,104, 76, 83, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,192, 94, 18,115, 61, 49, 61,112, 64, 71,153, 90,191, 55, 81,190,191, 71,243,109, 63, 42,237, 98, 62,214,163,236,
-190,183,206,197,190, 61,137,202,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 85,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,112, 41,126, 61,164,166, 56, 61,240, 4, 91,
- 62,161,172, 15,190,191,126,106, 63, 64, 33,117, 62,184,227,130,190,244, 20, 92,189,180,168,210,191, 43, 25, 60, 61,190,188,141,
- 63, 68,157,118, 61,224,119,105, 60,239,129,112, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 62,107,196,190, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0,191,141, 34, 38,192, 39,140,222, 64, 25, 55,182,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 86,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 85, 40,193,190,146, 79,120,
-190,203,249, 68, 62,131,217,207, 63, 22, 65,229, 63, 63,104,120,189,124,135,173,190,190,179,131, 62,171, 81,208, 63, 69,132,211,
- 61,189, 6,122, 62, 23,195, 58, 62,254,114, 6, 62,134,106,189, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63, 20,102,179, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 63, 14,149,191,165,204, 64, 64, 24, 96, 12,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 87,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 30, 81, 54,
- 62,223, 39,157, 63, 11, 30,214, 62,186, 51, 76, 62, 83,228,206, 61, 0,146,209, 63,121,106, 22,187, 6,124, 44,187, 71,233,128,
- 62,173,190,218, 61, 83, 67, 14, 63, 4,186,192, 62,197,206, 39, 61, 50,159,178, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 60, 52, 19,208, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 22,180,183,192, 4,173,126, 64, 8,189,240,191, 55, 81,190,
-191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 88,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-191, 20, 59,104, 63, 17, 36, 30,190,252, 57,112, 62,162,101, 32, 62,160, 6,139, 61, 80,160, 57, 61,245,243,109,190,224, 18, 41,
-188,227,154,182,190,139,196,238, 61,131, 49,133, 62,167, 33,130, 63, 5,225,160, 61,177, 59,124, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 56,166, 20, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 97,160, 35,191,163,220,129, 64,141,248,194,
-191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 89,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 62,157,149,183, 62,150,241,169, 63, 5, 72,210,191, 61, 98,196,191,103, 43, 94, 62, 13,249,141,190, 28, 40,108,
-189, 89,143,180, 62,180,169,159, 63,102,210, 50, 62,206,174, 78, 61, 93,159, 68, 61,118, 84,160, 62,246,211, 54, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,126, 53,234, 0, 0, 0, 0,255,255,255,255,
- 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,192, 18,223, 4,191,140,169,155,
- 64, 57, 18,151,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 90,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 44, 63,186, 62,136,104,134, 63, 32,117, 44,190,147,227,178, 63, 90, 77,254,190,175,117, 0,
- 62,167, 69,119, 61,138, 73,238, 62,189,211, 58,191, 37, 28,210, 62, 21, 96,245, 62,227,104, 35, 62,154, 62, 83, 61,222,164, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,151, 27,130, 0, 0, 0, 0,
-255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191,179,193,100,
-192, 78,111,251, 63,228, 64,166,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,
-191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 91,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 4,101,129, 63, 0, 90,237,190,239,125,104, 63, 3, 31,131,190,212,160,200,
- 63, 27,217,115,190, 6,189, 55,190, 22,223,131,190,223,241, 4,190, 0, 70, 4, 61, 35,242, 37, 61,171,214,204, 63, 46, 25,175,
- 62, 72,177, 82, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62,202,249,184,
- 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-191,124, 90, 93,191,212, 48,113, 64, 74,208, 56,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,190,183,206,200,
-190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 92,144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,189,236, 25,179, 63, 27,158,127, 62,239,235,123, 63, 33,108, 59,
-190,103,198,244, 62,187,192,251,190,101, 39,179, 62,138,210,110,191, 54,168,145,190, 63, 20,208, 62, 81,178,187, 62,108, 57,176,
- 62,153,177, 93, 62,135, 88,108, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,109,210, 2, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0,192, 33,231,251,191, 59, 2,132, 64, 66,162, 78,191, 55, 81,190,191, 71,243,109, 63, 42,237,100, 62,214,163,234,
-190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 93,144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 24, 46,192,191, 43, 20, 41, 62,183,184,186,
- 62,136,173, 42, 63, 50, 75, 75, 62,126, 83, 40, 63, 8,195,188, 62,238,211,234, 61,152, 36, 69, 62,145,106,235, 62, 30, 15,217,
- 63, 4,209,227, 62,117,148,178, 61,178, 39,218, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63, 57,122, 93, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,138,185, 2,192, 41,128,191, 64, 97,193,139,191, 55, 81,190,191, 71,243,109, 63, 42,237,100,
- 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 13, 65, 94,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,168,120,231,191, 7,154,179,
- 63, 48,180, 41,190,187,232,239,191,104, 35, 9, 62,114, 8,222,190,177,143, 76,191, 28, 29,107, 62,234,112,210,190, 92,249, 9,
- 61,250,196, 0, 61, 62,120, 79, 62, 31, 12,195, 63, 44,252,202, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 62,184, 4, 74, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,190,243, 63,242,191,159,176, 86, 64,111,150,245,191, 55, 81,190,191, 71,243,109,
- 63, 42,237,100, 62,214,163,234,190,183,206,200,190, 61,137,199,191, 80, 38,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 13, 65, 95,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 58, 26,166,
- 62,159, 70, 1, 63, 2,111,113,190,173,187,235, 62,237, 51,116, 62,247, 53,130,190, 26,199,243,189,172, 88,235, 62,244,115,118,
-191, 5,147, 34, 62,158, 77,217, 62, 72,131, 43, 62, 68,208,119, 62,155, 8, 86, 0, 0, 0, 0, 0, 0, 0, 0, 66,200, 0, 0,
- 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,110,152,253, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,191, 48,178,198, 62, 52, 39,138, 64,149,252, 39,191, 55, 81,190,
-191, 71,243,107, 63, 42,237,100, 62,214,163,235,190,183,206,198,190, 61,137,203,191, 80, 38,157, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 66,200, 0, 0, 13, 65, 96,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-190,210,167, 41, 62,139,172,194, 63, 35,220,250,191, 22,182, 30, 61,136, 3,122,190,176,164,109,190,147,153, 30,188, 10,248,255,
-190,160, 90,234,190,205,241, 89, 63, 19, 71, 62, 62,107,215,111, 61,138, 71, 63, 62, 1,231,243, 0, 0, 0, 0, 0, 0, 0, 0,
- 66,200, 0, 0, 66,200, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 77,227, 37, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,203,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7,
- 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 15, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 84,231, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203,
- 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,151, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 31, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,204,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,255,
- 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,152, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,205,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223, 63, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23,
- 61,124,223,251, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 3, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,142, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23,
- 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,206,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 82, 7, 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,255,
- 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 8, 61, 14, 61,255, 63, 65,123,218, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,224, 15, 63,127,101,123, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,171, 61,197,143, 15, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,136, 62, 14, 62, 15,
- 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,151, 63,216,177,182, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 31, 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,207,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168,
- 61, 14, 61,243, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 15, 61,124,223,251, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 5, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,180, 62, 14, 62, 8, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59,
- 62, 65,155,142, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 11, 62,124,224, 23, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,208,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 82, 7, 59,124,223,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,126,200, 61, 14, 61,247, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,135, 61,124,224, 7, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,107, 61,197,143, 11,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,104, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,137,251, 62, 65,155,145, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 84,231, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,209,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,255, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184,
- 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,147, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,210,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,136, 61, 14, 61,247, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,223,251,
- 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 5, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 8, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,142, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 23,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,211,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 15, 63, 2, 71,188,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 23, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43,
- 61,197,143, 18, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 15, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,152, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 34, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,212,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,223, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,132, 61, 14, 62, 3,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,252, 61,124,224, 19, 63,127,101,127, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,207, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,169, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 50, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 7, 62,124,224, 31, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,213,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,143, 62,131,146, 56,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,250, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7,
- 61,124,224, 4, 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 11, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 11, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,146, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255,
- 62,124,224, 26, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,214,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 87, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,199, 60,124,223,255,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 21, 11, 61,197,143, 11, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,192, 62, 14, 62, 11,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,145, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 25, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,215,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200,
- 61, 14, 61,239, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,223,239, 63,127,101,127,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 3, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75,
- 62, 65,155,135, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 17, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,216,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 71, 59,124,223,239,
- 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,120, 61, 14, 62, 2, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,247, 61,124,224, 17, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 15,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,165, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 48, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 7, 62,124,224, 28, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,217,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135,
- 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,221,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 21, 43, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200,
- 62, 14, 62, 7, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,143, 63,216,177,186,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 23, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,218,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231, 60,124,223,255, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,136, 61, 14, 62, 3, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 17,
- 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,211, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 53, 62, 65,155,148, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 10, 62,124,224, 29,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,219,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 71, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43,
- 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 7, 63,187,172,164,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 83, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 27, 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,220,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 15,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 23, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,168, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19, 62,124,224, 27, 63,245, 17,143, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,221,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,127, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7,
- 61,124,223,247, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,142,255, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 5, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,138, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15,
- 62,124,224, 19, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,222,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86, 7, 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255,
- 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 21, 11, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 11,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 83, 62, 65,155,143, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 27, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,223,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 71, 60,124,223,223, 63, 2, 71,189, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200,
- 61, 14, 61,247, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 7, 63,127,101,127,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 11, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59,
- 62, 65,155,145, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 27, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,224,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,127,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,247, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 7, 61,124,224, 7, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 11,
- 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13, 63,187,172,165, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,145, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 11, 62,124,224, 25, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,225,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 84,135, 59,124,224, 63, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231,
- 60,124,224, 55, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 62, 17, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 30, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,203, 61,197,143, 24, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,164,
- 62, 14, 62, 18, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 55, 62, 65,155,155, 63,216,177,183,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 9, 62,124,224, 36, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,226,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,168, 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,223,255,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 67, 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 19,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,227,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,186,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,255, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 15, 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11,
- 61,197,143, 15, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 15, 63,187,172,163,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,151, 63,216,177,182, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 31, 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,228,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 71, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 7,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 23, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 19, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,176, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,229,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,191, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,247, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127, 72, 61, 14, 62, 0, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231,
- 61,124,224, 14, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,171, 61,197,143, 13, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 27, 62, 65,155,147, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,251,
- 62,124,224, 27, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,230,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 85, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 39, 60,124,223,223,
- 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,184, 61, 14, 61,247, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 31, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,243, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,188, 62, 14, 62, 7,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,141, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 17, 62,124,224, 22, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,231,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168,
- 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67,
- 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 27, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,232,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 71, 59,124,223,255,
- 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,255, 61,124,224, 23, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,211, 61,197,143, 19,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,170, 62, 14, 62, 15, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 56, 62, 65,155,147, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 13, 62,124,224, 25, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,233,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7,
- 60,124,224, 63, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 72, 61, 14, 62, 15, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,224, 15, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,171, 61,197,143, 7, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152,
- 62, 14, 62, 11, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 27, 62, 65,155,147, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 19, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,234,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,128, 8, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85,103, 61,124,223,255,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 75, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,216, 62, 14, 62, 7, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 91, 62, 65,155,143, 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 23,
- 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,235,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 31, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 23, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43,
- 61,197,143, 27, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 19, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,155, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 35, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,236,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,135, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,104, 61, 14, 61,255,
- 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,187, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,152, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 35, 62, 65,155,143,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,237,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 59,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,255, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71,
- 61,124,224, 15, 63,127,101,128, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 13, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23,
- 62,124,224, 29, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,238,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 31,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 7, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 23, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,203, 61,197,143, 19, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,149, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 33, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,239,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,215, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,144,
- 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,251, 61,124,224, 15, 63,127,101,127,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,207, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,166, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 45,
- 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 8, 62,124,224, 27, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,240,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,222,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 39, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,142,255,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,139, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 31, 62,124,224, 15, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,241,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 7, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176,
- 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,145, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 29, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,242,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 61,255, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 15,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 23,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,243,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 82, 7,
- 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 83,135, 60,124,223,191, 63, 2, 71,188,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,126,200, 61, 14, 61,239, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 84,135, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20, 75,
- 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127, 88, 62, 14, 61,255, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,137,219, 62, 65,155,135, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 84,223, 62,124,224, 15, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,244,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,239,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,184, 62, 14, 62, 3, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,137,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 11, 62,124,224, 15, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,245,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,127, 62,131,146, 56,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,251, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7,
- 61,124,224, 3, 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 8, 63,158, 2, 80,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 10, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 27, 62, 65,155,143, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,247,
- 62,124,224, 24, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,246,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86, 7, 59,124,224,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 63,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 15, 63, 65,123,221, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 31, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 21, 11, 61,197,143, 27, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,216, 62, 14, 62, 23,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,157, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 37, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,247,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 87, 7, 59,124,224, 15, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85,135, 60,124,224, 19, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,232,
- 61, 14, 62, 12, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 28, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 25, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 19, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91,
- 62, 65,155,155, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 35, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,248,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,224, 63,
- 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 3, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 7, 61,124,224, 19, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,148, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 11, 62,124,224, 29, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 64,249,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,224, 33, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135,
- 60,124,224, 29, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 11, 63, 65,123,221,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 24, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 21, 43, 61,197,143, 24, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200,
- 62, 14, 62, 18, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,157, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 37, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,250,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 71, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 15,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 27, 62,124,224, 23,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,251,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 82, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 8, 61, 14, 62, 7, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 84,167, 61,124,224, 15, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,139,
- 61,197,143, 15, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,136, 62, 14, 62, 11, 63,187,172,163,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 11, 62, 65,155,143, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 84,247, 62,124,224, 23, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 64,252,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,215, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 61,255,
- 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,223, 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,174, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 57, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 12, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,253,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7,
- 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,147, 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23,
- 62,124,224, 31, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 64,254,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86, 7, 59,124,223,191, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 15,
- 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 23, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 21, 11, 61,197,143, 17, 63,158, 2, 83, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 14,
- 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,146, 63,216,177,186, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 26, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 64,255,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200,
- 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,223,255, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75,
- 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 19, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 0,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,127,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 71, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 23, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,251, 61,197,143, 3,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,192, 62, 14, 62, 6, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,140, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 19, 62,124,224, 21, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 1,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 84, 7, 59,124,223,127, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,247, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,235, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184,
- 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,141, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 2,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 15,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,143, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 23,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 3,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7,
- 59,124,224,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,224, 63, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 72, 61, 14, 62, 47, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 84,231, 61,124,224, 63, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203,
- 61,197,143, 47, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 27, 63,187,172,163,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,167, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 84,255, 62,124,224, 51, 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 4,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,224, 31, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,199, 60,124,224, 31, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 62, 16,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,215, 61,197,143, 22, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,172, 62, 14, 62, 17, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 53, 62, 65,155,151,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 9, 62,124,224, 32, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 5,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,247,
- 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15,
- 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 6,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,191,
- 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,104, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,223,247, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,171, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 7,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 35, 62, 65,155,145, 63,216,177,183, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 26, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 7,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200,
- 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75,
- 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 23, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 8,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,191, 59,124,222,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,229, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,154, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 7, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,232, 61,197,143, 7,
- 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,182, 62, 14, 62, 7, 63,187,172,165, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 65, 62, 65,155,139, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 16, 62,124,224, 19, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 9,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199,
- 60,124,224, 31, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 7, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,247, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168,
- 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,147, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 7, 62,124,224, 31, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 10,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,224,255, 62,131,146, 58, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,224, 63, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127, 72, 61, 14, 62, 47, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 47,
- 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,171, 61,197,143, 47, 63,158, 2, 80, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 27, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 27, 62, 65,155,167, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,247, 62,124,224, 49,
- 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 11,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7,
- 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,191, 63, 2, 71,186,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 8, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 84,167, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,107,
- 61,197,143, 11, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,104, 62, 14, 62, 9, 63,187,172,163,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,137,251, 62, 65,155,143, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 84,239, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 12,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,135, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 72, 61, 14, 62, 15,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,171, 61,197,143, 31, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,152, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 11, 62, 65,155,159,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,247, 62,124,224, 39, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 13,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39,
- 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 7, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,192, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19,
- 62,124,224, 19, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 14,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,223,247, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,235, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 5,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,138, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 19, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 15,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,135, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136,
- 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59,
- 62, 65,155,147, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 27, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 16,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231, 60,124,224, 15, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,247, 61,124,224, 19, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 17,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,164, 62, 14, 62, 14, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,148, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 7, 62,124,224, 30, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 17,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 83, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 71,
- 60,124,223,191, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 40, 61, 14, 61,223, 63, 65,123,218,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,223,239, 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,155, 61,197,142,255, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,128,
- 62, 14, 61,255, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 11, 62, 65,155,131, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,243, 62,124,224, 15, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 18,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,191, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127, 72, 61, 14, 61,239, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,223,255,
- 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,139, 61,197,142,247, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,120, 62, 14, 61,255, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,137,251, 62, 65,155,131, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,239, 62,124,224, 11,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 19,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11,
- 61,197,143, 23, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 15, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 39, 62,124,224, 27, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 20,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,222,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85,135, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,239,
- 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85,103, 61,124,223,255, 63,127,101,127, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43, 61,197,142,255, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,200, 62, 14, 62, 3, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,135,
- 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 19, 63,245, 17,143, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 21,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 59,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39,
- 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,151, 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31,
- 62,124,224, 27, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 22,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 85, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,191,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,231, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,215, 61,124,223,231, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,171, 61,197,142,247, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 1,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 27, 62, 65,155,135, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,251, 62,124,224, 15, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 23,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 83, 7, 59,124,223,191, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,135, 60,124,223,239, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,104,
- 61, 14, 62, 3, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,187, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 35,
- 62, 65,155,145, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 25, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 24,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,224, 63,
- 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 47, 63, 2, 71,186, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 15, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 7, 61,124,224, 29, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 24,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 17, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,155, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 7, 62,124,224, 35, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 25,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135,
- 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 23, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 21, 43, 61,197,143, 23, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,216,
- 62, 14, 62, 15, 63,187,172,166, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,150, 63,216,177,186,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 30, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 26,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 15, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 62, 11, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 23,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 19, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 17, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,151, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 33,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 27,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,191, 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 15, 63, 2, 71,188,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 19, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235,
- 61,197,143, 17, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 14, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,151, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 34, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 28,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,103, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,191, 60,124,224, 63, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,144, 61, 14, 62, 15,
- 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 3, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,223, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,174, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 63, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 29,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,191, 62,131,146, 59,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 3, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 4, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71,
- 61,124,224, 18, 63,127,101,128, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 14, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,149, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23,
- 62,124,224, 26, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 30,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,191,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,247, 61,124,223,247, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,203, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,160, 62, 14, 62, 7,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,145, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 7, 62,124,224, 25, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 31,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 87, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85,199, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 40,
- 61, 14, 62, 15, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 31, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 27, 61,197,143, 31, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,208, 62, 14, 62, 27, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91,
- 62, 65,155,163, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 27, 62,124,224, 43, 63,245, 17,140,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 32,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255,
- 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 39, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 19,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 23, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 33,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135,
- 60,124,223,207, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,244, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,223,254, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 5, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184,
- 62, 14, 62, 9, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,143, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 25, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 34,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,241, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,168, 61, 14, 61,253, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 11,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 13, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 12, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 59, 62, 65,155,146, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 11, 62,124,224, 27,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 35,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,199,
- 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,247, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,160, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 11, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,231,
- 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,178, 62, 14, 62, 7, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 61, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 14, 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 36,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,239,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,223,239, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,184, 62, 14, 62, 3, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,137,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 17, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 37,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,215, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,140, 61, 14, 62, 15, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,251,
- 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,178, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 61, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15,
- 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 38,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 85, 7, 59,124,224, 13, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 31,
- 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 9, 63, 65,123,220, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 22, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,235, 61,197,143, 16, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 14,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,148, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 30, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 39,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,199, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,231, 60,124,223,159, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,144,
- 61, 14, 61,231, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,223,239, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,217, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,175, 62, 14, 62, 5, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 56,
- 62, 65,155,140, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 11, 62,124,224, 21, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 40,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,224,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 63, 63, 2, 71,188, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 72, 61, 14, 62, 31, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85,103, 61,124,224, 47, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 75, 61,197,143, 39,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,248, 62, 14, 62, 27, 63,187,172,163, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138,139, 62, 65,155,163, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 55, 62,124,224, 43, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 41,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199,
- 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 61,239, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,219, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176,
- 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,139, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 19, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 42,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 71, 60,124,223,191, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127, 72, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,223,255,
- 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,187, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 3, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 35, 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 19,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 43,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 71, 60,124,223,255, 63, 2, 71,186,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 23, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,251,
- 61,197,143, 7, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 19, 62,124,224, 19, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 44,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,199, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,231, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 62, 15,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 3, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,180, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 63, 62, 65,155,147,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 27, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 45,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 58,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 39, 60,124,224, 31, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255,
- 61,124,224, 39, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,227, 61,197,143, 33, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 24, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,162, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 17,
- 62,124,224, 45, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 46,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 85, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,255,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,219, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 11,
- 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 19, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 47,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,231, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152,
- 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 15, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51,
- 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 9, 62,124,224, 27, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 48,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 82, 7, 59,124,223,223,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,235, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,126,200, 61, 14, 61,251, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,167, 61,124,224, 9, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,107, 61,197,143, 11,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,120, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,137,251, 62, 65,155,145, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 84,239, 62,124,224, 28, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 49,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 39,
- 60,124,223,191, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,239, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 21, 3, 61,197,143, 7, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,196,
- 62, 14, 62, 7, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 87, 62, 65,155,143, 63,216,177,183,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 29, 62,124,224, 23, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 50,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,191, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84, 7, 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127, 72, 61, 14, 61,251, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,224, 11,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,155, 61,197,143, 13, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,136, 62, 14, 62, 12, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 19, 62, 65,155,144, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,247, 62,124,224, 24,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 51,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,224, 31, 63, 2, 71,188,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 7, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11,
- 61,197,143, 11, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 11, 63,187,172,164,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 52,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,239, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 3,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 17, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,168, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,149,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 29, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 53,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86,135, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,103, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,248, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 55,
- 61,124,224, 15, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 35, 61,197,143, 15, 63,158, 2, 80,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,220, 62, 14, 62, 15, 63,187,172,162, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138,107, 62, 65,155,151, 63,216,177,182, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 37,
- 62,124,224, 31, 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 54,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86,135, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,103, 60,124,223,255,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,184, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,235, 61,197,143, 31, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,180, 62, 14, 62, 23,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 71, 62, 65,155,159, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 18, 62,124,224, 43, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 55,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 39, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168,
- 61, 14, 62, 15, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 15, 61,124,224, 15, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,243, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 83,
- 62, 65,155,151, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 25, 62,124,224, 27, 63,245, 17,140,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 56,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,222,255,
- 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,239, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 71, 61,124,223,255, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 75, 61,197,143, 7,
- 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,216, 62, 14, 62, 7, 63,187,172,165, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138,107, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 31, 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 57,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,224, 63, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 15, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,219, 61,197,143, 23, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176,
- 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,151, 63,216,177,185,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19, 62,124,224, 31, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 58,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 71, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 15,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 59, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19, 62,124,224, 31,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 59,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,143, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,186,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,251, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 2, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235,
- 61,197,143, 11, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 11, 63,187,172,163,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,145, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 7, 62,124,224, 27, 63,245, 17,139, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 60,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 7, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 15,
- 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,176, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,147,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 61,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,152, 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 15,
- 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,142,255, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,143, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19,
- 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 62,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,191,
- 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 8, 61, 14, 61,239, 63, 65,123,218, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,199, 61,124,223,239, 63,127,101,124, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,139, 61,197,142,247, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,120, 62, 14, 61,251,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 11, 62, 65,155,131, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,239, 62,124,224, 11, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 63,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 85, 39, 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,176,
- 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 19, 61,124,223,239, 63,127,101,125,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,231, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,179, 62, 14, 62, 5, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 65,
- 62, 65,155,139, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 16, 62,124,224, 21, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 64,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,199, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,104, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,239, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 11,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,164, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,145, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 11, 62,124,224, 25, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 65,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,223,207, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,243, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,223,251, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,235, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184,
- 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,141, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 66,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,168, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 51, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 11, 62,124,224, 27,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 67,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7,
- 59,124,223,127, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,247, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 7, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235,
- 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 6, 63,187,172,164,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,141, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 22, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 68,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85, 71, 60,124,224, 13, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 5,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 19, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,227, 61,197,143, 17, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,176, 62, 14, 62, 14, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,149,
- 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 13, 62,124,224, 31, 63,245, 17,142, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 69,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,151, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,219, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,140, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,249,
- 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,205, 61,197,143, 15, 63,158, 2, 82,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 10,
- 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 70,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71, 61,124,224, 15, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 21, 11, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,200, 62, 14, 62, 7,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,143, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 27, 62,124,224, 23, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 71,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,175, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,224, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,142,
- 61, 14, 61,239, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 1, 61,124,223,239, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,207, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,164, 62, 14, 62, 3, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 42,
- 62, 65,155,135, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 4, 62,124,224, 15, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 72,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 31, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 39, 61,124,224, 23, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 19,
- 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,147, 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 23, 62,124,224, 31, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 73,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,223,127, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 39,
- 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,176, 61, 14, 61,239, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 19, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,231, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,178,
- 62, 14, 62, 9, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 63, 62, 65,155,143, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 24, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 74,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 31, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,136, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 19, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 75, 62, 65,155,151, 63,216,177,186, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 31,
- 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 75,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 7, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203,
- 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 15, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,151, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 31, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 76,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,135, 60,124,223,255, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 72, 61, 14, 61,255,
- 63, 65,123,217, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,123, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 15, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,168, 62, 14, 62, 11, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,147,
- 63,216,177,182, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 7, 62,124,224, 27, 63,245, 17,139, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 77,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 71, 59,124,223,255, 62,131,146, 56,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 39, 60,124,223,255, 63, 2, 71,186, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,144, 61, 14, 62, 15, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255,
- 61,124,224, 31, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,223, 61,197,143, 31, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 23, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 63, 62, 65,155,161, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 14,
- 62,124,224, 43, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 78,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,224, 15,
- 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,203, 61,197,143, 17, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,150, 63,216,177,185, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 30, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 79,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84, 7, 59,124,223,255, 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,135, 60,124,223,255, 63, 2, 71,185, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 72,
- 61, 14, 61,255, 63, 65,123,217, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,231, 61,124,223,255, 63,127,101,123,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203, 61,197,143, 15, 63,158, 2, 80, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,152, 62, 14, 62, 7, 63,187,172,163, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43,
- 62, 65,155,143, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 84,255, 62,124,224, 23, 63,245, 17,141,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 80,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,127,
- 62,131,146, 56, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,247, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 23, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 3,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,141, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 15, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 81,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7,
- 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 61,239, 63, 65,123,220,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,223,255, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,235, 61,197,143, 3, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184,
- 62, 14, 62, 5, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,139, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 21, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 82,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 59, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85,135, 60,124,223,255, 63, 2, 71,189, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,200, 61, 14, 62, 1, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23, 61,124,224, 16,
- 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235, 61,197,143, 15, 63,158, 2, 82, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 13, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 67, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 30,
- 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 83,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,223, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,255, 63, 65,123,219, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 7, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,203,
- 61,197,143, 11, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 11, 63,187,172,165,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,145, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 29, 63,245, 17,143, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 84,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,191, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 85,135, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,128, 8, 61, 14, 62, 11,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 39, 61,124,224, 19, 63,127,101,127, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 11, 61,197,143, 21, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,200, 62, 14, 62, 17, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 91, 62, 65,155,153,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 31, 62,124,224, 33, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 85,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7, 59,124,223,255, 62,131,146, 57,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 86, 7, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,128, 8, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 71,
- 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 21, 43, 61,197,143, 15, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,216, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138,107, 62, 65,155,147, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 39,
- 62,124,224, 27, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 86,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 86, 7, 59,124,223,255, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,255,
- 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 7, 63, 65,123,220, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 15, 63,127,101,127, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,203, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 13,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 43, 62, 65,155,147, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 15, 62,124,224, 31, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 87,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,199, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136,
- 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 15, 63,127,101,126,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,215, 61,197,143, 7, 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,174, 62, 14, 62, 11, 63,187,172,165, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 57,
- 62, 65,155,143, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 13, 62,124,224, 23, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 88,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231, 60,124,223,255, 63, 2, 71,187, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,168, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 85, 15, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,211, 61,197,143, 23,
- 63,158, 2, 82, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,165, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 85, 11, 62,124,224, 27, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216,
- 13, 65, 89,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,247,
- 60,124,223,191, 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 61,239, 63, 65,123,219,
- 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 11, 61,124,223,255, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0,188,227, 20,227, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,180,
- 62, 14, 62, 7, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 73, 62, 65,155,143, 63,216,177,184,
- 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 20, 62,124,224, 23, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 90,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0,
- 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,231, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,
-188, 35,127,136, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,255, 61,124,224, 15,
- 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,211, 61,197,143, 15, 63,158, 2, 81, 66,122, 0, 0,
- 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 15, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,
-189, 94,138, 55, 62, 65,155,147, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 12, 62,124,224, 27,
- 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 91,144, 0, 0, 1, 37,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 86, 7,
- 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,224, 63, 63, 2, 71,187,
- 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,200, 61, 14, 62, 15, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0,
- 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 31, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,235,
- 61,197,143, 23, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,184, 62, 14, 62, 15, 63,187,172,164,
- 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 75, 62, 65,155,151, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0,
- 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 35, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,216, 13, 65, 92,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,135, 59,124,224, 15, 62,131,146, 58, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,
-187,145, 84,199, 60,124,223,251, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,152, 61, 14, 62, 8,
- 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,224, 22, 63,127,101,126, 66, 72, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 17, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,
-189, 35,127,172, 62, 14, 62, 15, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 51, 62, 65,155,148,
- 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 9, 62,124,224, 30, 63,245, 17,141, 66,200, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 93,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 85, 7, 59,124,223,255, 62,131,146, 58,
- 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0,
- 0, 0, 0, 0,188, 35,127,168, 61, 14, 61,255, 63, 65,123,220, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 23,
- 61,124,224, 15, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,219, 61,197,143, 15, 63,158, 2, 81,
- 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,176, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0,
- 0, 0, 0, 0,189, 94,138, 67, 62, 65,155,147, 63,216,177,184, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 19,
- 62,124,224, 27, 63,245, 17,141, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 94,144,
- 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
-186,145, 84, 7, 59,124,222,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 85, 7, 60,124,223,191,
- 63, 2, 71,187, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,136, 61, 14, 61,239, 63, 65,123,219, 66, 22, 0, 0,
- 63, 32, 0, 0, 0, 0, 0, 0,188,145, 85, 7, 61,124,223,239, 63,127,101,126, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
-188,227, 20,203, 61,197,142,255, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,168, 62, 14, 62, 3,
- 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 59, 62, 65,155,137, 63,216,177,184, 66,175, 0, 0,
- 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 23, 62,124,224, 17, 63,245, 17,142, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 95,144, 0, 0, 1, 37, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 84,111, 59,124,223,255, 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0,
- 0, 0, 0, 0,187,145, 84,173, 60,124,223,255, 63, 2, 71,188, 65,200, 0, 0, 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127,116,
- 61, 14, 61,255, 63, 65,123,221, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,188,145, 84,245, 61,124,224, 15, 63,127,101,127,
- 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,199, 61,197,143, 13, 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0,
- 0, 0, 0, 0,189, 35,127,163, 62, 14, 62, 13, 63,187,172,164, 66,150, 0, 0, 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 47,
- 62, 65,155,147, 63,216,177,185, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,189,145, 85, 6, 62,124,224, 28, 63,245, 17,142,
- 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,216, 13, 65, 96,144, 0, 0, 1, 37, 0, 0, 0, 9,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,186,145, 82, 7, 59,124,223,127,
- 62,131,146, 57, 65, 72, 0, 0, 63, 96, 0, 0, 0, 0, 0, 0,187,145, 84,135, 60,124,223,223, 63, 2, 71,186, 65,200, 0, 0,
- 63, 64, 0, 0, 0, 0, 0, 0,188, 35,127, 8, 61, 14, 61,247, 63, 65,123,218, 66, 22, 0, 0, 63, 32, 0, 0, 0, 0, 0, 0,
-188,145, 84,199, 61,124,224, 7, 63,127,101,125, 66, 72, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,188,227, 20,139, 61,197,143, 7,
- 63,158, 2, 81, 66,122, 0, 0, 62,192, 0, 0, 0, 0, 0, 0,189, 35,127,136, 62, 14, 62, 11, 63,187,172,164, 66,150, 0, 0,
- 62,128, 0, 0, 0, 0, 0, 0,189, 94,138, 27, 62, 65,155,147, 63,216,177,183, 66,175, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0,
-189,145, 84,247, 62,124,224, 28, 63,245, 17,140, 66,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20,
- 13, 65, 97,144, 0, 0, 0,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 76, 13, 65, 97,208, 0, 0, 0,102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
- 0, 0, 0, 23, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 64,202, 32, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 2, 0, 0,
- 0, 0, 79, 66, 0, 0, 3, 68, 7,159,248, 32, 0, 0, 0,109, 0, 0, 0, 1, 7,159,252, 32, 7,159,244, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119,108, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 97,109,112, 0, 1, 4, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 64,161,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188,211,197,192, 65, 59,229, 76, 64,184,106,208,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 98,215,247, 63, 72, 11, 71, 63, 6,248,230, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 29, 14,212, 62,182,225,149,191, 52, 76, 84, 0, 0, 0, 0,191, 74, 40, 22, 62,139, 74,201,
-191, 12,198,228, 0, 0, 0, 0,187,157,213, 84, 63,100,190,151, 62,229,223,145, 0, 0, 0, 0,188,211,197,192, 65, 59,229, 76,
- 64,184,106,208, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 51, 46, 0, 0,179, 63, 0, 0, 0, 0, 0, 0, 51, 2, 0, 0, 63,128, 0, 0,
-179, 0, 0, 0, 0, 0, 0, 0,179, 85, 0, 0,179, 0, 0, 1, 63,128, 0, 0, 0, 0, 0, 0,177,255,255,203, 40,122,144, 2,
-181, 0, 0, 0, 63,128, 0, 0, 63, 29, 14,213,191, 74, 40, 23,187,157,211,254, 0, 0, 0, 0,191, 52, 76, 83,191, 12,198,227,
- 62,229,223,148, 0, 0, 0, 0,190,182,225,149,190,139, 74,202,191,100,190,152, 0, 0, 0, 0,192,158, 36,208,192,110,186,100,
-193,169, 43, 99, 63,128, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0,
- 61, 35,215, 10, 63,128, 0, 0, 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 64, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 68,
- 7,159,252, 32, 0, 0, 0,109, 0, 0, 0, 1, 0, 0, 0, 0, 7,159,248, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,116,101,
-120,116,117,114,101, 0,114,101,118,105,101,119, 46, 48, 48, 53, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,161,176,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65, 98, 80,188,183, 16, 61,191,103,204, 21, 63,228,234, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,155, 39,153, 64,155, 39,153, 64,155, 39,153, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,201, 15,218, 37,192, 0, 0, 36,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64,155, 39,153, 38, 27, 39,152,166,232,187,102, 0, 0, 0, 0, 38,232,187,102, 52,196,134,157, 64,155, 39,153, 0, 0, 0, 0,
- 38, 27, 39,154,192,155, 39,153, 52,196,134,157, 0, 0, 0, 0,188,183, 16, 61,191,103,204, 21, 63,228,234, 48, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0,153, 34, 33,106, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-153, 34, 33,106, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,179,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 62, 83, 50, 25, 36,158,101,147, 35,211, 50, 27, 0, 0, 0, 0,164,158,101,147, 62, 83, 50, 25, 38,174, 59,158, 0, 0, 0, 0,
-173, 44, 24, 0,175, 94,165,224, 62, 83, 50, 25, 0, 0, 0, 0, 59, 33,251,236, 59, 40, 37,135, 63,238, 71,118, 63,128, 0, 0,
- 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 61, 35,215, 10, 63,128, 0, 0,
- 62,204,204,205, 61,204,204,205, 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65, 98, 80, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 2,108, 7,160, 0, 32, 0, 0, 0, 42, 0, 0, 0, 1, 7,160, 4, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 99,104,101, 99,107,101,114,100, 97,114,107, 0, 0, 0, 97,116,101,114,
-105, 97, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 61,221, 1,116, 61,220,251,200, 61,220,251,200,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 63, 89,153,154, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 76,204,205,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 63,160, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 2, 0, 1, 0, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 18, 0, 18,
- 59,163,215, 10, 59,163,215, 10, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 3, 1, 64, 0, 3, 0, 1, 0, 4,
- 0, 12, 0, 4, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205, 63, 0, 0, 0,
- 61,204,204,205, 61,204,204,205, 63,128, 0, 0, 8, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 13, 65, 98,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, 63,166,102,102, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,136, 13, 65, 98,128, 0, 0, 0, 33, 0, 0, 0, 1, 0, 16, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,103, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,192, 0, 1,
- 63,192, 0, 1, 63,192, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,209,183, 23, 56,209,177,184,
- 56,209,177,184, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 62, 76,204,205,
- 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 2,108, 7,160, 4, 32, 0, 0, 0, 42, 0, 0, 0, 1, 7,160, 8, 32, 7,160, 0, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 99,104,101, 99,107,101,114,108,105,103,104,116, 0, 0, 0, 97,116,101,114,105, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 62,157, 65,188, 62,157, 61,178, 62,157, 61,178, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 89,153,154, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 76,204,205, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 61,204,204,205, 0, 2, 0, 2, 0, 1, 0, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 18, 0, 18, 59,163,215, 10,
- 59,163,215, 10, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 3, 1, 64, 0, 3, 0, 1, 0, 4, 0, 12, 0, 4,
- 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205, 63, 0, 0, 0, 61,204,204,205,
- 61,204,204,205, 63,128, 0, 0, 8, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 13, 65, 99, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, 63,166,102,102, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,136, 13, 65, 99, 48, 0, 0, 0, 33, 0, 0, 0, 1, 0, 16, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,103, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,209,183, 23, 56,209,177,184, 56,209,177,184,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 62, 76,204,205, 0, 0, 0, 0,
- 0, 0, 77, 65, 0, 0, 2,108, 7,160, 8, 32, 0, 0, 0, 42, 0, 0, 0, 1, 7,160, 16, 32, 7,160, 4, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 65,112,114,101,118,105,101,119, 0, 0, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, 63, 54,232, 61, 63, 23,161,184, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 62, 68,248,188, 63,128, 0, 0, 63, 76,204,205, 63, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,130,121,198, 63,160, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 61,204,204,205, 0, 2, 0, 2, 0, 50, 0, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 18, 0, 18, 59,163,215, 10, 59,163,215, 10,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 17, 0, 3, 3, 17, 0, 3, 0, 1, 0, 4, 0, 12, 0, 4, 63, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 2,
- 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205, 63, 0, 0, 0, 61,204,204,205, 61,204,204,205,
- 63,128, 0, 0, 8, 16, 0, 1, 7,160, 12, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 13, 65, 99,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,100,144, 63, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63, 76,204,205,
- 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, 63,166,102,102, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,136, 13, 65, 99,224, 0, 0, 0, 33, 0, 0, 0, 1, 0, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,101,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 62, 76,204,205, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 3, 8, 7,160, 12, 32, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,220, 40,245, 0, 0, 0, 0, 63,125,112,164, 63,128, 0, 0, 63, 24,214,106, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 1, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 32,
- 13, 65,100,144, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 2,108, 7,160, 16, 32, 0, 0, 0, 42, 0, 0, 0, 1,
- 7,160, 24, 32, 7,160, 8, 32, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,116,101,120,116,117,114,101, 0,114,101,118,105,101,119,
- 46, 48, 48, 49, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 76,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0,
- 63,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61,204,204,205, 0, 2, 0, 2, 0, 50, 0, 6, 63,128, 0, 0, 63,128, 0, 0,
- 0, 18, 0, 18, 59,163,215, 10, 59,163,215, 10, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 71, 3, 1, 0, 67,
- 0, 1, 0, 4, 0, 12, 0, 4, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205,
- 63, 0, 0, 0, 61,204,204,205, 61,204,204,205, 63,128, 0, 0, 8, 1, 0,129, 7,160, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 13, 65,100,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, 63,166,102,102,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,136, 13, 65,100,224, 0, 0, 0, 33, 0, 0, 0, 1,
- 0, 1, 0,129, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,101,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 62, 76,204,205, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 3, 8, 7,160, 20, 32, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, 2,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,220, 40,245, 0, 0, 0, 0, 63,125,112,164,
- 63,128, 0, 0, 63, 24,214,106, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 1, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 2,108, 7,160, 24, 32, 0, 0, 0, 42, 0, 0, 0, 1, 0, 0, 0, 0, 7,160, 16, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,116,101,120,116,117,114,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 76,204,205, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 2, 0, 50, 0, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 18, 0, 18, 59,163,215, 10,
- 59,163,215, 10, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 3, 3, 1, 0, 3, 0, 1, 0, 4, 0, 12, 0, 4,
- 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 3,
- 0, 0, 0, 2, 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, 61,204,204,205, 63, 0, 0, 0, 61,204,204,205,
- 61,204,204,205, 63,128, 0, 0, 0, 0, 0, 0, 7,160, 28, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, 63,166,102,102, 63,128, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 3, 8, 7,160, 28, 32, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,220, 40,245, 0, 0, 0, 0, 63,125,112,164, 63,128, 0, 0,
- 63, 24,214,106, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 1, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 84, 69, 0, 0, 1, 4, 13, 65,101,144, 0, 0, 0, 38, 0, 0, 0, 1, 13, 65,103, 16, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 84, 69,112,114,101,118,105,101,119, 0,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 64,160, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 32, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 5, 0, 8, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1,
- 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 60,204,204,205, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,102,192, 68, 65, 84, 65, 0, 0, 0, 32,
- 13, 65,102,192, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0, 1, 4, 13, 65,103, 16, 0, 0, 0, 38, 0, 0, 0, 1,
- 0, 0, 0, 0, 13, 65,101,144, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69,102, 97,107,101,115,104, 97,100,111,119, 0, 0, 76,101,
-110,100, 0,101,120, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 64,160, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 32, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 40, 0, 5, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 60,204,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,104, 64, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,109,208, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,105,128, 7,160,128, 32, 12,117,208, 32, 0, 0, 0, 0, 7,160, 32, 32, 7,160, 80, 32, 0, 0, 0, 0, 7,160,168, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,105,176, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,107, 16, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,108,112,
- 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,249, 0, 0, 3,237, 0, 0, 1,244,
- 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 61, 88,133,192,189, 85, 45,184,190, 24,181,196, 63, 35, 71,185, 62,235, 31,153,
- 62,203,102,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,105,128, 0, 0, 0, 0,
- 0, 0, 0, 1, 7,160, 8, 32, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,105,176, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,160, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 47, 88, 7,160, 32, 32, 0, 0, 0, 58, 0, 0, 1,249, 62,131,144,140,
- 60,200,163,119, 62, 85, 9,156, 92,125,170, 70, 21,228, 0,255, 0, 0, 0, 0,190, 26,222, 50, 60,200,163,119, 62, 85, 9,156,
-163,131,170, 70, 21,228, 0,255, 0, 0, 0, 0, 62,146,126, 61,188, 8, 37,223, 62, 47,183, 99, 76,247,194,191, 81,228, 2,255,
- 0, 0, 0, 0,190, 56,185,147,188, 8, 37,223, 62, 47,183, 99,179, 9,194,191, 81,228, 2,255, 0, 0, 0, 0, 62,157,176,129,
-188,217, 91,211, 61,246,238,244, 84, 31,181,226, 61,191, 2,255, 0, 0, 0, 0,190, 79, 30, 28,188,217, 91,211, 61,246,238,244,
-171,225,181,226, 61,191, 2,255, 0, 0, 0, 0, 62, 94, 19,115,189,128,251,103, 62, 14, 32,150, 9,241,144,155, 62, 64, 2,255,
- 0, 0, 0, 0,189,227,161, 26,189,128,251,103, 62, 14, 32,150,246, 15,144,155, 62, 64, 2,255, 0, 0, 0, 0, 62, 94, 19,115,
-189, 25,118,251, 62, 62,165, 20, 14,184,163,144, 87, 76, 2,255, 0, 0, 0, 0,189,227,161, 26,189, 25,118,251, 62, 62,165, 20,
-241, 72,163,144, 87, 76, 2,255, 0, 0, 0, 0, 62, 94, 19,115, 60, 34,107,232, 62, 92,128,116, 3, 3,131,121, 29,110, 0,255,
- 0, 0, 0, 0,189,227,161, 26, 60, 34,107,232, 62, 92,128,116,252,253,131,121, 29,110, 0,255, 0, 0, 0, 0, 62, 56,193, 58,
- 60,200,163,119, 62, 99,247, 77,171, 56,167,117, 36,206, 0,255, 0, 0, 0, 0,189,152,252,168, 60,200,163,119, 62, 99,247, 77,
- 84,200,167,117, 36,206, 0,255, 0, 0, 0, 0, 62, 23, 42,109,188, 8, 37,223, 62, 73,215, 88,217,152,203,122,110, 56, 0,255,
- 0, 0, 0, 0, 62, 0,197,229,188,217, 91,211, 62, 29, 14, 71,184,179,175, 93, 69, 66, 2,255, 0, 0, 0, 0,188,164, 23,249,
-188,217, 91,211, 62, 29, 14, 71, 71, 77,175, 93, 69, 66, 2,255, 0, 0, 0, 0, 61,182,231, 88, 61,121,154,159, 62, 32,201,179,
-151,181,255,104, 74, 51, 2,255, 0, 0, 0, 0, 60,134,121,207, 61,121,154,159, 62, 32,201,179,104, 75,255,104, 74, 51, 2,255,
- 0, 0, 0, 0, 61,242,158, 25, 61,121,154,159, 62, 73,215, 88,171, 78,255,150, 95,246, 2,255, 0, 0, 0, 0,188, 80,194,110,
- 61,121,154,159, 62, 73,215, 88, 84,178,255,150, 95,246, 2,255, 0, 0, 0, 0, 62, 41,211,138, 61,121,154,159, 62, 99,247, 77,
-133,152,254,153, 37, 98, 0,255, 0, 0, 0, 0,189,118, 66,143, 61,121,154,159, 62, 99,247, 77,122,104,254,153, 37, 98, 0,255,
- 0, 0, 0, 0, 62, 56,193, 58, 61,206,232,154, 62, 99,247, 77,170, 24, 88, 13, 35, 89, 0,255, 0, 0, 0, 0,189,152,252,168,
- 61,206,232,154, 62, 99,247, 77, 85,232, 88, 13, 35, 89, 0,255, 0, 0, 0, 0, 62, 23, 42,109, 62, 5, 79,173, 62, 73,215, 88,
-200,249, 65,221, 94,244, 2,255, 0, 0, 0, 0,189, 43,158, 31, 62, 5, 79,173, 62, 73,215, 88, 55, 7, 65,221, 94,244, 2,255,
- 0, 0, 0, 0, 62, 0,197,229, 62, 27,180, 54, 62, 29, 14, 71,186, 51, 78, 86, 73, 78, 2,255, 0, 0, 0, 0,188,164, 23,249,
- 62, 27,180, 54, 62, 29, 14, 71, 69,205, 78, 86, 73, 78, 2,255, 0, 0, 0, 0, 62, 94, 19,115, 62, 65, 6,111, 62, 14, 32,150,
- 11, 2,107,152, 68,114, 2,255, 0, 0, 0, 0,189,227,161, 26, 62, 65, 6,111, 62, 14, 32,150,244,254,107,152, 68,114, 2,255,
- 0, 0, 0, 0, 62, 94, 19,115, 62, 35, 43, 14, 62, 62,165, 20, 14,201, 91,180, 88, 14, 2,255, 0, 0, 0, 0,189,227,161, 26,
- 62, 35, 43, 14, 62, 62,165, 20,241, 55, 91,180, 88, 14, 2,255, 0, 0, 0, 0, 62, 94, 19,115, 61,236,195,250, 62, 92,128,116,
- 2,134,125, 29, 26,228, 0,255, 0, 0, 0, 0,189,227,161, 26, 61,236,195,250, 62, 92,128,116,253,122,125, 29, 26,228, 0,255,
- 0, 0, 0, 0, 62,131,144,140, 61,206,232,154, 62, 85, 9,156, 93, 54, 85, 67, 20,154, 0,255, 0, 0, 0, 0,190, 26,222, 50,
- 61,206,232,154, 62, 85, 9,156,162,202, 85, 67, 20,154, 0,255, 0, 0, 0, 0, 62,146,126, 61, 62, 5, 79,173, 62, 47,183, 99,
- 76,241, 60,161, 82, 97, 2,255, 0, 0, 0, 0,190, 56,185,147, 62, 5, 79,173, 62, 47,183, 99,179, 15, 60,161, 82, 97, 2,255,
- 0, 0, 0, 0, 62,157,176,129, 62, 27,180, 54, 61,246,238,244, 83,179, 71,157, 65, 45, 2,255, 0, 0, 0, 0,190, 79, 30, 28,
- 62, 27,180, 54, 61,246,238,244,172, 77, 71,157, 65, 45, 2,255, 0, 0, 0, 0, 62,176, 89,157, 61,121,154,159, 61,232, 1, 67,
-111, 40,255,113, 63,117, 2,255, 0, 0, 0, 0,190,116,112, 84, 61,121,154,159, 61,232, 1, 67,144,216,255,113, 63,117, 2,255,
- 0, 0, 0, 0, 62,161,107,237, 61,121,154,159, 62, 40, 64,139,100, 48,255,154, 79,167, 2,255, 0, 0, 0, 0,190, 86,148,244,
- 61,121,154,159, 62, 40, 64,139,155,208,255,154, 79,167, 2,255, 0, 0, 0, 0, 62,139, 7,100, 61,121,154,159, 62, 81, 78, 48,
-126,117,254,181, 19,185, 0,255, 0, 0, 0, 0,190, 41,203,227, 61,121,154,159, 62, 81, 78, 48,129,139,254,181, 19,185, 0,255,
- 0, 0, 0, 0, 62,140,229, 26, 61,121,154,159, 62, 88,197, 8,120,160,254,106, 42,198, 2,255, 0, 0, 0, 0,190, 45,135, 79,
- 61,121,154,159, 62, 88,197, 8,135, 96,254,106, 42,198, 2,255, 0, 0, 0, 0, 62,133,110, 66, 61,214, 95,114, 62, 92,128,116,
- 93,173, 74,126, 45, 93, 2,255, 0, 0, 0, 0,190, 30,153,158, 61,214, 95,114, 62, 92,128,116,162, 83, 74,126, 45, 93, 2,255,
- 0, 0, 0, 0, 62, 94, 19,115, 61,251,177,170, 62,103,178,185, 11, 9,115, 31, 54,216, 2,255, 0, 0, 0, 0,189,227,161, 26,
- 61,251,177,170, 62,103,178,185,244,247,115, 31, 54,216, 2,255, 0, 0, 0, 0, 62, 53, 5,206, 61,214, 95,114, 62,111, 41,145,
-181, 9, 80,184, 65, 43, 2,255, 0, 0, 0, 0,189,145,133,208, 61,214, 95,114, 62,111, 41,145, 74,247, 80,184, 65, 43, 2,255,
- 0, 0, 0, 0, 62, 34, 92,178, 61,121,154,159, 62,111, 41,145,146,116,254, 57, 66, 43, 2,255, 0, 0, 0, 0,189, 88,103, 48,
- 61,121,154,159, 62,111, 41,145,109,140,254, 57, 66, 43, 2,255, 0, 0, 0, 0, 62, 53, 5,206, 60,170,200, 22, 62,111, 41,145,
-182, 34,173,181, 64,115, 2,255, 0, 0, 0, 0,189,145,133,208, 60,170,200, 22, 62,111, 41,145, 73,222,173,181, 64,115, 2,255,
- 0, 0, 0, 0, 62, 94, 19,115, 61,121,154,159, 62,114,228,253, 24, 74,255,139,125,171, 2,255, 0, 0, 0, 0,189,227,161, 26,
- 61,121,154,159, 62,114,228,253,231,182,255,139,125,171, 2,255, 0, 0, 0, 0, 62, 94, 19,115, 59, 43,249,149, 62,103,178,185,
- 10,218,140,140, 54, 45, 2,255, 0, 0, 0, 0,189,227,161, 26, 59, 43,249,149, 62,103,178,185,245, 38,140,140, 54, 45, 2,255,
- 0, 0, 0, 0, 62,133,110, 66, 60,170,200, 22, 62, 92,128,116, 92,141,179,203, 44,210, 2,255, 0, 0, 0, 0,190, 30,153,158,
- 60,170,200, 22, 62, 92,128,116,163,115,179,203, 44,210, 2,255, 0, 0, 0, 0, 61, 88,133,203, 62, 23,248,202, 62, 73,215, 88,
- 0, 0,124, 43, 31, 17, 0,255, 0, 0, 0, 0, 61, 88,133,203, 61,229, 77, 34, 62,111, 41,145, 0, 0,249, 63,127,209, 0,255,
- 0, 0, 0, 0, 61, 88,133,203,190,188,254,150, 62, 70, 27,236, 0, 0,251,204,127,237, 0,255, 0, 0, 0, 0, 61, 88,133,203,
-190, 78, 79,191, 62, 92,128,116, 0, 0,150, 33, 71,238, 2,255, 0, 0, 0, 0, 61, 88,133,203,190, 14,221,146, 62, 99,247, 77,
- 0, 0,100, 28, 79,192, 0,255, 0, 0, 0, 0, 61, 88,133,203,190,211, 99, 30, 62, 62,165, 20, 0, 0,142,184, 59,147, 2,255,
- 0, 0, 0, 0, 61, 88,133,203, 62, 12,198,133, 62, 6,169,190, 0, 0,103,143, 75, 57, 0,255, 0, 0, 0, 0, 61, 88,133,203,
- 62, 91, 38, 99, 61,239,120, 28, 0, 0, 78,115,101, 34, 0,255, 0, 0, 0, 0, 61, 88,133,203, 62,187,243, 16,190,206,250,170,
- 0, 0,110,190,191,212, 2,255, 0, 0, 0, 0, 61, 88,133,203, 62, 87,106,247,191, 11,224,178, 0, 0, 35,144,133, 12, 3,255,
- 0, 0, 0, 0, 61, 88,133,203,188,157,165, 18,191, 9, 20, 33, 0, 0,214,194,134,213, 2,255, 0, 0, 0, 0, 61, 88,133,203,
-190,108, 43, 32,190,160, 83,227, 0, 0,134,154,215,113, 2,255, 0, 0, 0, 0, 62, 23, 42,109,190, 14,221,146, 61,232, 1, 67,
-113,144,198,122, 13, 79, 0,255, 0, 0, 0, 0,189, 43,158, 31,190, 14,221,146, 61,232, 1, 67,142,112,198,122, 13, 79, 0,255,
- 0, 0, 0, 0, 62, 75,106, 87,190,131, 37,138, 61,239,120, 28,122,196, 31, 19, 18,152, 2,255, 0, 0, 0, 0,189,190, 78,225,
-190,131, 37,138, 61,239,120, 28,133, 60, 31, 19, 18,152, 2,255, 0, 0, 0, 0, 62, 94, 19,115,190,192,186, 2, 61,239,120, 28,
-125,167, 12,146, 20,226, 0,255, 0, 0, 0, 0,189,227,161, 26,190,192,186, 2, 61,239,120, 28,130, 89, 12,146, 20,226, 0,255,
- 0, 0, 0, 0, 62,101,138, 75,190,239, 96,200, 61,202, 37,227,124,113,242,142, 26,196, 2,255, 0, 0, 0, 0,189,242,142,203,
-190,239, 96,200, 61,202, 37,227,131,143,242,142, 26,196, 2,255, 0, 0, 0, 0, 62, 82,225, 47,190,252,112,195, 61,194,175, 10,
- 79,159,159, 44, 25,210, 2,255, 0, 0, 0, 0,189,205, 60,146,190,252,112,195, 61,194,175, 10,176, 97,159, 44, 25,210, 2,255,
- 0, 0, 0, 0, 62, 11,248, 41,191, 1, 4,242, 61,224,138,107, 19,143,131, 13, 19,178, 2,255, 0, 0, 0, 0,188,253,170, 27,
-191, 1, 4,242, 61,224,138,107,236,113,131, 13, 19,178, 2,255, 0, 0, 0, 0, 61, 88,133,203,191, 2,226,168, 61,246,238,244,
- 0, 0,130, 75, 24, 21, 2,255, 0, 0, 0, 0, 62,131,144,140,189,240,242, 18, 61,202, 37,227, 47,114,137,117, 8,232, 2,255,
- 0, 0, 0, 0,190, 26,222, 50,189,240,242, 18, 61,202, 37,227,208,142,137,117, 8,232, 2,255, 0, 0, 0, 0, 62,178, 55, 83,
-189,143,233, 23, 61,209,156,187, 77, 25,154,198, 13,214, 2,255, 0, 0, 0, 0,190,120, 43,193,189,143,233, 23, 61,209,156,187,
-178,231,154,198, 13,214, 2,255, 0, 0, 0, 0, 62,224,222, 26, 60,140,236,182, 61,112, 21, 49,113,216,198,247, 12,255, 2,255,
- 0, 0, 0, 0,190,170,188,167, 60,140,236,182, 61,112, 21, 49,142, 40,198,247, 12,255, 2,255, 0, 0, 0, 0, 62,232, 84,243,
- 62, 23,248,202, 62, 2,238, 82,113,104, 51, 31, 30, 32, 2,255, 0, 0, 0, 0,190,178, 51,128, 62, 23,248,202, 62, 2,238, 82,
-142,152, 51, 31, 30, 32, 2,255, 0, 0, 0, 0, 62,196,224,112, 62, 50, 24,190, 62, 17,220, 2, 64,216,106,225, 27,121, 0,255,
- 0, 0, 0, 0,190,142,190,253, 62, 50, 24,190, 62, 17,220, 2,191, 40,106,225, 27,121, 0,255, 0, 0, 0, 0, 62,144,160,134,
- 62,106, 20, 20, 62, 47,183, 99, 75,137,101, 82, 20, 70, 0,255, 0, 0, 0, 0,190, 52,254, 39, 62,106, 20, 20, 62, 47,183, 99,
-180,119,101, 82, 20, 70, 0,255, 0, 0, 0, 0, 62, 79, 37,195, 62,154, 92, 67, 62, 70, 27,236, 38,241,119, 19, 26, 54, 2,255,
- 0, 0, 0, 0,189,197,197,186, 62,154, 92, 67, 62, 70, 27,236,217, 15,119, 19, 26, 54, 2,255, 0, 0, 0, 0, 62, 0,197,229,
- 62,145, 7,181, 62, 81, 78, 48,175, 21, 96, 54, 24, 12, 2,255, 0, 0, 0, 0,188,164, 23,249, 62,145, 7,181, 62, 81, 78, 48,
- 80,235, 96, 54, 24, 12, 2,255, 0, 0, 0, 0, 61,167,249,168, 62, 53,212, 42, 62, 77,146,196,155,174, 76,128, 21,151, 0,255,
- 0, 0, 0, 0, 60,194, 48,144, 62, 53,212, 42, 62, 77,146,196,100, 82, 76,128, 21,151, 0,255, 0, 0, 0, 0, 62, 4,129, 81,
- 62, 16,129,241, 62, 88,197, 8, 25, 0,237, 4,124, 22, 0,255, 0, 0, 0, 0,188,193,243, 89, 62, 16,129,241, 62, 88,197, 8,
-231, 0,237, 4,124, 22, 0,255, 0, 0, 0, 0, 61,227,176,105, 61,184,132, 17, 62, 85, 9,156,255,160,232,126,125,209, 0,255,
- 0, 0, 0, 0,187,178,169,214, 61,184,132, 17, 62, 85, 9,156, 0, 96,232,126,125,209, 0,255, 0, 0, 0, 0,189, 43,158, 31,
-188, 8, 37,223, 62, 73,215, 88, 38,104,203,122,110, 56, 0,255, 0, 0, 0, 0, 62,105, 69,184,189, 55, 82, 92, 62, 55, 46, 59,
- 34,106,200,119,110, 16, 0,255, 0, 0, 0, 0,189,250, 5,163,189, 55, 82, 92, 62, 55, 46, 59,221,150,200,119,110, 16, 0,255,
- 0, 0, 0, 0, 62,144,160,134,188,187,128,115, 62, 40, 64,139, 55,161,207, 60,104,115, 0,255, 0, 0, 0, 0,190, 52,254, 39,
-188,187,128,115, 62, 40, 64,139,200, 95,207, 60,104,115, 0,255, 0, 0, 0, 0, 62,176, 89,157, 61, 17, 26,205, 62, 29, 14, 71,
- 58,181,226,123,109,214, 0,255, 0, 0, 0, 0,190,116,112, 84, 61, 17, 26,205, 62, 29, 14, 71,197, 75,226,123,109,214, 0,255,
- 0, 0, 0, 0, 62,180, 21, 9, 61,177, 13, 57, 62, 29, 14, 71, 49,157,230, 61,115, 36, 0,255, 0, 0, 0, 0,190,123,231, 45,
- 61,177, 13, 57, 62, 29, 14, 71,206, 99,230, 61,115, 36, 0,255, 0, 0, 0, 0, 62,170,192,123, 61,251,177,170, 62, 36,133, 31,
- 39,206,234,175,119,196, 0,255, 0, 0, 0, 0,190,105, 62, 16, 61,251,177,170, 62, 36,133, 31,216, 50,234,175,119,196, 0,255,
- 0, 0, 0, 0, 62,129,178,214, 62, 27,180, 54, 62, 62,165, 20, 24, 62,255, 85,125,173, 0,255, 0, 0, 0, 0,190, 23, 34,198,
- 62, 27,180, 54, 62, 62,165, 20,231,194,255, 85,125,173, 0,255, 0, 0, 0, 0, 62, 45,142,246, 62, 42,161,230, 62, 81, 78, 48,
- 31,251,247, 40,123,158, 0,255, 0, 0, 0, 0,189,130,152, 32, 62, 42,161,230, 62, 81, 78, 48,224, 5,247, 40,123,158, 0,255,
- 0, 0, 0, 0, 61, 88,133,203,190,209,133,104, 62, 70, 27,236, 0, 0,210,148,119,170, 0,255, 0, 0, 0, 0, 61,212,194,185,
-190,198, 83, 36, 62, 70, 27,236, 19, 39,222, 65,121,248, 0,255, 0, 0, 0, 0, 58,240,196,191,190,198, 83, 36, 62, 70, 27,236,
-236,217,222, 65,121,248, 0,255, 0, 0, 0, 0, 61,220, 57,145,190,226, 80,207, 62, 58,233,167, 2,134,217,132,122, 12, 0,255,
- 0, 0, 0, 0,186,236,241, 77,190,226, 80,207, 62, 58,233,167,253,122,217,132,122, 12, 0,255, 0, 0, 0, 0, 61,167,249,168,
-190,237,131, 19, 62, 51,114,207,252, 13,214,169,121, 18, 0,255, 0, 0, 0, 0, 60,194, 48,144,190,237,131, 19, 62, 51,114,207,
- 3,243,214,169,121, 18, 0,255, 0, 0, 0, 0, 61, 88,133,203,190,239, 96,200, 62, 47,183, 99, 0, 0,219,150,122,180, 0,255,
- 0, 0, 0, 0, 61, 88,133,203,190, 18,152,254, 62, 77,146,196, 0, 0, 97, 46, 83, 76, 0,255, 0, 0, 0, 0, 61, 88,133,203,
-189,240,242, 18, 62, 73,215, 88, 0, 0,104,197, 73,134, 0,255, 0, 0, 0, 0, 61,205, 75,225,189,248,104,235, 62, 73,215, 88,
- 36, 52, 53, 2,110,187, 0,255, 0, 0, 0, 0, 59,179,158,179,189,248,104,235, 62, 73,215, 88,219,204, 53, 2,110,187, 0,255,
- 0, 0, 0, 0, 61,227,176,105,190, 33,134,174, 62, 77,146,196, 95,187,212, 14, 72,182, 0,255, 0, 0, 0, 0,187,178,169,214,
-190, 33,134,174, 62, 77,146,196,160, 69,212, 14, 72,182, 0,255, 0, 0, 0, 0, 61,190, 94, 48,190, 63, 98, 15, 62, 73,215, 88,
- 64,117,207,117, 99, 90, 0,255, 0, 0, 0, 0, 60, 81, 60,220,190, 63, 98, 15, 62, 73,215, 88,191,139,207,117, 99, 90, 0,255,
- 0, 0, 0, 0, 62,116,119,252,189,151, 95,239, 62, 40, 64,139, 49,103,196,157,102, 13, 0,255, 0, 0, 0, 0,190, 8, 53, 22,
-189,151, 95,239, 62, 40, 64,139,206,153,196,157,102, 13, 0,255, 0, 0, 0, 0, 62,174,123,231,188,217, 91,211, 62, 17,220, 2,
- 59,142,204,107,100,223, 2,255, 0, 0, 0, 0,190,112,180,232,188,217, 91,211, 62, 17,220, 2,196,114,204,107,100,223, 2,255,
- 0, 0, 0, 0, 62,200,155,220, 61, 46,246, 45, 62, 6,169,190, 66,102,217, 11,102, 65, 0,255, 0, 0, 0, 0,190,146,122,105,
- 61, 46,246, 45, 62, 6,169,190,189,154,217, 11,102, 65, 0,255, 0, 0, 0, 0, 62,204, 87, 72, 61,251,177,170, 62, 32,201,179,
- 54, 87,228,142,112,151, 0,255, 0, 0, 0, 0,190,150, 53,213, 61,251,177,170, 62, 32,201,179,201,169,228,142,112,151, 0,255,
- 0, 0, 0, 0, 62,191, 71, 78, 62, 16,129,241, 62, 66, 96,128, 42, 82,247, 97,120,125, 2,255, 0, 0, 0, 0,190,137, 37,219,
- 62, 16,129,241, 62, 66, 96,128,213,174,247, 97,120,125, 2,255, 0, 0, 0, 0, 62,131,144,140, 62, 79,244, 31, 62, 99,247, 77,
- 41,192,254,216,120,253, 0,255, 0, 0, 0, 0,190, 26,222, 50, 62, 79,244, 31, 62, 99,247, 77,214, 64,254,216,120,253, 0,255,
- 0, 0, 0, 0, 62, 75,106, 87, 62,124,189, 48, 62,118,160,105, 28,217, 7, 53,124,126, 0,255, 0, 0, 0, 0,189,190, 78,225,
- 62,124,189, 48, 62,118,160,105,227, 39, 7, 53,124,126, 0,255, 0, 0, 0, 0, 62, 23, 42,109, 62,113,138,236, 62,126, 23, 65,
-255,125, 5, 44,127,227, 0,255, 0, 0, 0, 0,189, 43,158, 31, 62,113,138,236, 62,126, 23, 65, 0,131, 5, 44,127,227, 0,255,
- 0, 0, 0, 0, 61,205, 75,225, 62, 23,248,202, 62,122, 91,213,238,130, 2, 89,126,197, 0,255, 0, 0, 0, 0, 59,179,158,179,
- 62, 23,248,202, 62,122, 91,213, 17,126, 2, 89,126,197, 0,255, 0, 0, 0, 0, 61,227,176,105,189,203,159,217, 62,107,110, 37,
- 23,115,230, 27,123, 34, 0,255, 0, 0, 0, 0,187,178,169,214,189,203,159,217, 62,107,110, 37,232,141,230, 27,123, 34, 0,255,
- 0, 0, 0, 0, 62, 26,229,218,190,133, 3, 64, 62, 58,233,167, 74,212, 14, 28,102,225, 2,255, 0, 0, 0, 0,189, 58,139,207,
-190,133, 3, 64, 62, 58,233,167,181, 44, 14, 28,102,225, 2,255, 0, 0, 0, 0, 62, 45,142,246,190,194,151,184, 62, 47,183, 99,
- 72,235,252, 17,105, 31, 2,255, 0, 0, 0, 0,189,130,152, 32,190,194,151,184, 62, 47,183, 99,183, 21,252, 17,105, 31, 2,255,
- 0, 0, 0, 0, 62, 53, 5,206,190,222,149, 99, 62, 36,133, 31, 66,179,225,197,104,249, 2,255, 0, 0, 0, 0,189,145,133,208,
-190,222,149, 99, 62, 36,133, 31,189, 77,225,197,104,249, 2,255, 0, 0, 0, 0, 62, 38, 24, 30,190,244,249,234, 62, 21,151,111,
- 44, 62,183, 4, 95, 98, 2,255, 0, 0, 0, 0,189,103, 84,224,190,244,249,234, 62, 21,151,111,211,194,183, 4, 95, 98, 2,255,
- 0, 0, 0, 0, 62, 4,129, 81,190,248,181, 86, 62, 21,151,111, 19,155,158, 52, 80, 54, 2,255, 0, 0, 0, 0,188,193,243, 89,
-190,248,181, 86, 62, 21,151,111,236,101,158, 52, 80, 54, 2,255, 0, 0, 0, 0, 61, 88,133,203,190,252,112,195, 62, 25, 82,219,
- 0, 0,154,201, 78, 88, 2,255, 0, 0, 0, 0, 61, 88,133,203,188,247, 55, 52, 62, 66, 96,128, 0, 0,252, 2,127,239, 0,255,
- 0, 0, 0, 0, 61, 88,133,203, 61, 61,227,222, 62, 85, 9,156, 0, 0,227,112,124,196, 0,255, 0, 0, 0, 0, 62, 82,225, 47,
- 62, 46, 93, 82, 62, 73,215, 88, 21, 58,254,234,126, 56, 0,255, 0, 0, 0, 0,189,205, 60,146, 62, 46, 93, 82, 62, 73,215, 88,
-234,198,254,234,126, 56, 0,255, 0, 0, 0, 0, 62, 4,129, 81, 60, 94, 34,170, 62, 77,146,196,214, 37,232,110,118,163, 0,255,
- 0, 0, 0, 0,188,193,243, 89, 60, 94, 34,170, 62, 77,146,196, 41,219,232,110,118,163, 0,255, 0, 0, 0, 0, 61,235, 39, 65,
- 61, 61,227,222, 62, 81, 78, 48,232,150,230,127,123, 57, 0,255, 0, 0, 0, 0,188, 21, 11,173, 61, 61,227,222, 62, 81, 78, 48,
- 23,106,230,127,123, 57, 0,255, 0, 0, 0, 0, 61,220, 57,145,190,190,220, 76, 62, 70, 27,236, 20,117,248,197,126, 36, 0,255,
- 0, 0, 0, 0,186,236,241, 77,190,190,220, 76, 62, 70, 27,236,235,139,248,197,126, 36, 0,255, 0, 0, 0, 0, 61,182,231, 88,
-190,133, 3, 64, 62, 77,146,196, 19, 43, 0,128,126,141, 2,255, 0, 0, 0, 0, 60,134,121,207,190,133, 3, 64, 62, 77,146,196,
-236,213, 0,128,126,141, 2,255, 0, 0, 0, 0, 61, 88,133,203,190,133, 3, 64, 62, 77,146,196, 0, 0,255,122,127,254, 0,255,
- 0, 0, 0, 0, 61, 88,133,203,190, 82, 11, 43, 62, 73,215, 88, 0, 0,184,121,106, 36, 0,255, 0, 0, 0, 0, 61,197,213, 8,
-190, 55,235, 55, 62, 92,128,116, 66,167,160,139, 53, 45, 2,255, 0, 0, 0, 0, 60, 21,134, 27,190, 55,235, 55, 62, 92,128,116,
-189, 89,160,139, 53, 45, 2,255, 0, 0, 0, 0, 61,235, 39, 65,190, 33,134,174, 62, 99,247, 77,118,133,224,215, 36,239, 2,255,
- 0, 0, 0, 0,188, 21, 11,173,190, 33,134,174, 62, 99,247, 77,137,123,224,215, 36,239, 2,255, 0, 0, 0, 0, 61,212,194,185,
-189,233,123, 57, 62, 92,128,116, 81,167, 95,141, 24, 49, 2,255, 0, 0, 0, 0, 58,240,196,191,189,233,123, 57, 62, 92,128,116,
-174, 89, 95,141, 24, 49, 2,255, 0, 0, 0, 0, 61,145,149, 31,189,226, 4, 97, 62, 92,128,116,200,189,108,160, 39, 26, 2,255,
- 0, 0, 0, 0, 61, 13,225, 89,189,226, 4, 97, 62, 92,128,116, 55, 67,108,160, 39, 26, 2,255, 0, 0, 0, 0, 61, 88,133,203,
-190, 22, 84,106, 62,114,228,253, 0, 0, 23, 42,125,225, 0,255, 0, 0, 0, 0, 61,153, 11,247,189,248,104,235, 62,107,110, 37,
-231,186, 78, 89, 98, 66, 2,255, 0, 0, 0, 0, 60,253,231, 82,189,248,104,235, 62,107,110, 37, 24, 70, 78, 89, 98, 66, 2,255,
- 0, 0, 0, 0, 61,197,213, 8,189,255,223,195, 62,107,110, 37, 43, 88, 62,134,102,237, 2,255, 0, 0, 0, 0, 60, 21,134, 27,
-189,255,223,195, 62,107,110, 37,212,168, 62,134,102,237, 2,255, 0, 0, 0, 0, 61,212,194,185,190, 33,134,174, 62,114,228,253,
- 46,247,233, 89,116,228, 2,255, 0, 0, 0, 0, 58,240,196,191,190, 33,134,174, 62,114,228,253,209, 9,233, 89,116,228, 2,255,
- 0, 0, 0, 0, 61,182,231, 88,190, 44,184,243, 62,103,178,185, 31, 46,181,198, 99,128, 2,255, 0, 0, 0, 0, 60,134,121,207,
-190, 44,184,243, 62,103,178,185,224,210,181,198, 99,128, 2,255, 0, 0, 0, 0, 61, 88,133,203,190, 63, 98, 15, 62,103,178,185,
- 0, 0,191,185,110,175, 2,255, 0, 0, 0, 0, 62, 49, 74, 98,190, 74,148, 83, 61,224,138,107,120, 23, 41, 34, 16, 99, 0,255,
- 0, 0, 0, 0,189,138, 14,248,190, 74,148, 83, 61,224,138,107,135,233, 41, 34, 16, 99, 0,255, 0, 0, 0, 0, 62, 4,129, 81,
-190, 40,253,134, 62, 58,233,167, 80,251,250, 26, 98,241, 0,255, 0, 0, 0, 0,188,193,243, 89,190, 40,253,134, 62, 58,233,167,
-175, 5,250, 26, 98,241, 0,255, 0, 0, 0, 0, 62, 11,248, 41,190, 74,148, 83, 62, 58,233,167, 83,215, 16,153, 95, 71, 0,255,
- 0, 0, 0, 0,188,253,170, 27,190, 74,148, 83, 62, 58,233,167,172, 41, 16,153, 95, 71, 0,255, 0, 0, 0, 0, 62, 38, 24, 30,
-190, 44,184,243, 61,224,138,107,122, 24, 35, 67, 15, 64, 0,255, 0, 0, 0, 0,189,103, 84,224,190, 44,184,243, 61,224,138,107,
-133,232, 35, 67, 15, 64, 0,255, 0, 0, 0, 0, 61, 88,133,203,190,235,165, 93, 62, 47,183, 99, 0, 0, 86,139, 94, 77, 0,255,
- 0, 0, 0, 0, 61,153, 11,247,190,233,199,167, 62, 47,183, 99,206,144, 70,200, 94,125, 0,255, 0, 0, 0, 0, 60,253,231, 82,
-190,233,199,167, 62, 47,183, 99, 49,112, 70,200, 94,125, 0,255, 0, 0, 0, 0, 61,197,213, 8,190,222,149, 99, 62, 58,233,167,
-164,253, 17,109, 88, 75, 0,255, 0, 0, 0, 0, 60, 21,134, 27,190,222,149, 99, 62, 58,233,167, 91, 3, 17,109, 88, 75, 0,255,
- 0, 0, 0, 0, 61,197,213, 8,190,203,236, 70, 62, 66, 96,128,225,141,168, 87, 88, 39, 0,255, 0, 0, 0, 0, 60, 21,134, 27,
-190,203,236, 70, 62, 66, 96,128, 30,115,168, 87, 88, 39, 0,255, 0, 0, 0, 0, 61, 88,133,203,190,213, 64,212, 62, 32,201,179,
- 0, 0,159, 20, 83,153, 0,255, 0, 0, 0, 0, 61,197,213, 8,190,205,201,252, 62, 36,133, 31,230, 5,177,250, 98, 20, 0,255,
- 0, 0, 0, 0, 60, 21,134, 27,190,205,201,252, 62, 36,133, 31, 25,251,177,250, 98, 20, 0,255, 0, 0, 0, 0, 61,197,213, 8,
-190,220,183,173, 62, 25, 82,219,152, 18, 24, 8, 70,188, 0,255, 0, 0, 0, 0, 60, 21,134, 27,190,220,183,173, 62, 25, 82,219,
-103,238, 24, 8, 70,188, 0,255, 0, 0, 0, 0, 61,153, 11,247,190,230, 12, 59, 62, 21,151,111,222, 26, 49,242,112,221, 0,255,
- 0, 0, 0, 0, 60,253,231, 82,190,230, 12, 59, 62, 21,151,111, 33,230, 49,242,112,221, 0,255, 0, 0, 0, 0, 61, 88,133,203,
-190,231,233,241, 62, 21,151,111, 0, 0, 60, 18,113, 5, 0,255, 0, 0, 0, 0, 62, 8, 60,189, 61, 76,209,142, 62, 92,128,116,
- 30, 4,244, 93,123,225, 0,255, 0, 0, 0, 0,188,223,206,186, 61, 76,209,142, 62, 92,128,116,225,252,244, 93,123,225, 0,255,
- 0, 0, 0, 0, 62, 15,179,149, 60,170,200, 22, 62, 88,197, 8, 9, 71,251, 34,127,144, 0,255, 0, 0, 0, 0,189, 13,194,190,
- 60,170,200, 22, 62, 88,197, 8,246,185,251, 34,127,144, 0,255, 0, 0, 0, 0, 62, 86,156,155, 62, 23,248,202, 62, 81, 78, 48,
- 17, 81, 2, 74,126,204, 0,255, 0, 0, 0, 0,189,212,179,106, 62, 23,248,202, 62, 81, 78, 48,238,175, 2, 74,126,204, 0,255,
- 0, 0, 0, 0, 62, 56,193, 58, 62, 20, 61, 94, 62, 88,197, 8, 25,218,253,177,125, 86, 2,255, 0, 0, 0, 0,189,152,252,168,
- 62, 20, 61, 94, 62, 88,197, 8,230, 38,253,177,125, 86, 2,255, 0, 0, 0, 0, 62,127,170, 64, 62, 9, 11, 25, 62, 88,197, 8,
- 21,182,240,210,125, 57, 2,255, 0, 0, 0, 0,190, 19,103, 90, 62, 9, 11, 25, 62, 88,197, 8,234, 74,240,210,125, 57, 2,255,
- 0, 0, 0, 0, 62,161,107,237, 61,229, 77, 34, 62, 51,114,207, 28,143,237,249,123,117, 0,255, 0, 0, 0, 0,190, 86,148,244,
- 61,229, 77, 34, 62, 51,114,207,227,113,237,249,123,117, 0,255, 0, 0, 0, 0, 62,167, 5, 15, 61,169,150, 97, 62, 47,183, 99,
- 15,209,246,217,126,175, 0,255, 0, 0, 0, 0,190, 97,199, 56, 61,169,150, 97, 62, 47,183, 99,240, 47,246,217,126,175, 0,255,
- 0, 0, 0, 0, 62,165, 39, 89, 61, 32, 8,125, 62, 43,251,247, 24,177,253,190,125,146, 0,255, 0, 0, 0, 0,190, 94, 11,204,
- 61, 32, 8,125, 62, 43,251,247,231, 79,253,190,125,146, 0,255, 0, 0, 0, 0, 62,140,229, 26,187,152,222, 60, 62, 62,165, 20,
- 33, 20, 2, 75,123,160, 0,255, 0, 0, 0, 0,190, 45,135, 79,187,152,222, 60, 62, 62,165, 20,222,236, 2, 75,123,160, 0,255,
- 0, 0, 0, 0, 62,105, 69,184,188,187,128,115, 62, 73,215, 88, 26, 85,248,238,125, 14, 0,255, 0, 0, 0, 0,189,250, 5,163,
-188,187,128,115, 62, 73,215, 88,229,171,248,238,125, 14, 0,255, 0, 0, 0, 0, 62, 34, 92,178,186,133,194,226, 62, 92,128,116,
- 7, 8,250,142,127,175, 0,255, 0, 0, 0, 0,189, 88,103, 48,186,133,194,226, 62, 92,128,116,248,248,250,142,127,175, 0,255,
- 0, 0, 0, 0, 62, 11,248, 41, 61,177, 13, 57, 62, 92,128,116, 34,169,240, 2,122, 43, 0,255, 0, 0, 0, 0,188,253,170, 27,
- 61,177, 13, 57, 62, 92,128,116,221, 87,240, 2,122, 43, 0,255, 0, 0, 0, 0, 62, 26,229,218, 61,251,177,170, 62, 92,128,116,
- 27,126,239,108,123,231, 0,255, 0, 0, 0, 0,189, 58,139,207, 61,251,177,170, 62, 92,128,116,228,130,239,108,123,231, 0,255,
- 0, 0, 0, 0, 62, 38, 24, 30, 61,236,195,250, 62, 81, 78, 48, 64,226,207, 13, 98,224, 0,255, 0, 0, 0, 0,189,103, 84,224,
- 61,236,195,250, 62, 81, 78, 48,191, 30,207, 13, 98,224, 0,255, 0, 0, 0, 0, 62, 19,111, 1, 61,177, 13, 57, 62, 81, 78, 48,
- 96, 29,229,169, 80, 81, 0,255, 0, 0, 0, 0,189, 28,176,110, 61,177, 13, 57, 62, 81, 78, 48,159,227,229,169, 80, 81, 0,255,
- 0, 0, 0, 0, 62, 41,211,138, 59,205,106, 77, 62, 81, 78, 48, 55, 36, 71,122, 90,188, 0,255, 0, 0, 0, 0,189,118, 66,143,
- 59,205,106, 77, 62, 81, 78, 48,200,220, 71,122, 90,188, 0,255, 0, 0, 0, 0, 62,105, 69,184,188, 67,220,161, 62, 66, 96,128,
- 21, 76, 78, 90, 98,241, 0,255, 0, 0, 0, 0,189,250, 5,163,188, 67,220,161, 62, 66, 96,128,234,180, 78, 90, 98,241, 0,255,
- 0, 0, 0, 0, 62,137, 41,174, 59, 43,249,149, 62, 55, 46, 59,245, 85, 69, 69,107, 25, 0,255, 0, 0, 0, 0,190, 38, 16,118,
- 59, 43,249,149, 62, 55, 46, 59, 10,171, 69, 69,107, 25, 0,255, 0, 0, 0, 0, 62,157,176,129, 61, 61,227,222, 62, 40, 64,139,
-223,232, 29,211,120, 67, 0,255, 0, 0, 0, 0,190, 79, 30, 28, 61, 61,227,222, 62, 40, 64,139, 32, 24, 29,211,120, 67, 0,255,
- 0, 0, 0, 0, 62,159,142, 55, 61,162, 31,137, 62, 40, 64,139,210,148,238,123,118, 95, 0,255, 0, 0, 0, 0,190, 82,217,136,
- 61,162, 31,137, 62, 40, 64,139, 45,108,238,123,118, 95, 0,255, 0, 0, 0, 0, 62,153,245, 21, 61,214, 95,114, 62, 43,251,247,
-229,216,179,108, 99, 43, 0,255, 0, 0, 0, 0,190, 71,167, 67, 61,214, 95,114, 62, 43,251,247, 26, 40,179,108, 99, 43, 0,255,
- 0, 0, 0, 0, 62,123,238,212, 62, 5, 79,173, 62, 77,146,196,237,202,158,179, 81, 35, 2,255, 0, 0, 0, 0,190, 15,171,238,
- 62, 5, 79,173, 62, 77,146,196, 18, 54,158,179, 81, 35, 2,255, 0, 0, 0, 0, 62, 60,124,166, 62, 9, 11, 25, 62, 85, 9,156,
- 39, 24,212,118,113,214, 2,255, 0, 0, 0, 0,189,160,115,129, 62, 9, 11, 25, 62, 85, 9,156,216,232,212,118,113,214, 2,255,
- 0, 0, 0, 0, 62, 86,156,155, 62, 12,198,133, 62, 77,146,196, 1,213,193,189,111,208, 0,255, 0, 0, 0, 0,189,212,179,106,
- 62, 12,198,133, 62, 77,146,196,254, 43,193,189,111,208, 0,255, 0, 0, 0, 0, 62, 23, 42,109, 60,230,126,216, 62, 77,146,196,
- 84,226, 42,192, 85,187, 0,255, 0, 0, 0, 0,189, 43,158, 31, 60,230,126,216, 62, 77,146,196,171, 30, 42,192, 85,187, 0,255,
- 0, 0, 0, 0, 62, 19,111, 1, 61, 91,191, 63, 62, 77,146,196,102,235, 2,196, 76, 11, 0,255, 0, 0, 0, 0,189, 28,176,110,
- 61, 91,191, 63, 62, 77,146,196,153, 21, 2,196, 76, 11, 0,255, 0, 0, 0, 0, 61,212,194,185, 62, 38,230,122, 62, 10,101, 42,
-182,183,104,118,246, 5, 0,255, 0, 0, 0, 0, 58,240,196,191, 62, 38,230,122, 62, 10,101, 42, 73, 73,104,118,246, 5, 0,255,
- 0, 0, 0, 0, 62, 19,111, 1, 62,131,247,186, 62, 14, 32,150,192,208, 66,221,167, 3, 2,255, 0, 0, 0, 0,189, 28,176,110,
- 62,131,247,186, 62, 14, 32,150, 63, 48, 66,221,167, 3, 2,255, 0, 0, 0, 0, 62, 86,156,155, 62,137,144,220, 62, 2,238, 82,
- 9, 59, 90, 89,165,208, 2,255, 0, 0, 0, 0,189,212,179,106, 62,137,144,220, 62, 2,238, 82,246,197, 90, 89,165,208, 2,255,
- 0, 0, 0, 0, 62,142,194,208, 62, 83,175,139, 61,224,138,107, 37,165,114,104,212,176, 0,255, 0, 0, 0, 0,190, 49, 66,187,
- 62, 83,175,139, 61,224,138,107,218, 91,114,104,212,176, 0,255, 0, 0, 0, 0, 62,189,105,152, 62, 35, 43, 14, 61,164,211,170,
- 45, 67,116, 40,227, 1, 0,255, 0, 0, 0, 0,190,135, 72, 37, 62, 35, 43, 14, 61,164,211,170,210,189,116, 40,227, 1, 0,255,
- 0, 0, 0, 0, 62,217,103, 66, 62, 12,198,133, 61,134,248, 73, 94,100, 79,237,223, 18, 0,255, 0, 0, 0, 0,190,163, 69,207,
- 62, 12,198,133, 61,134,248, 73,161,156, 79,237,223, 18, 0,255, 0, 0, 0, 0, 62,211,206, 32, 60,200,163,119, 60,211,115,252,
-120,247,221,255,231,165, 0,255, 0, 0, 0, 0,190,157,172,173, 60,200,163,119, 60,211,115,252,135, 9,221,255,231,165, 0,255,
- 0, 0, 0, 0, 62,170,192,123,189, 85, 45,188, 61, 52, 94,112, 76,155,154,106,242, 19, 0,255, 0, 0, 0, 0,190,105, 62, 16,
-189, 85, 45,188, 61, 52, 94,112,179,101,154,106,242, 19, 0,255, 0, 0, 0, 0, 62,131,144,140,189,196, 41, 0, 61,142,111, 33,
- 56,204,142, 26, 13,138, 0,255, 0, 0, 0, 0,190, 26,222, 50,189,196, 41, 0, 61,142,111, 33,199, 52,142, 26, 13,138, 0,255,
- 0, 0, 0, 0, 61, 88,133,203, 62,187,243, 16,188,105,242, 89, 0, 0,106,155, 70,214, 2,255, 0, 0, 0, 0, 61, 88,133,203,
- 62,208,121,226,190, 62, 7,254, 0, 0,127,243, 3, 82, 2,255, 0, 0, 0, 0, 61, 88,133,203,190, 18,152,254,190,236,214, 11,
- 0, 0,164, 54,166,204, 3,255, 0, 0, 0, 0, 61, 88,133,203,190,136,190,173,189,124,142,139, 0, 0,129,179,235, 65, 0,255,
- 0, 0, 0, 0, 61, 88,133,203,191, 1,243,205, 61,134,248, 73, 0, 0,151,182,181,204, 2,255, 0, 0, 0, 0, 61, 88,133,203,
-190,218,217,247, 60, 56, 12,241, 0, 0,221,231,132,162, 2,255, 0, 0, 0, 0, 61, 88,133,203,190,162,222,161, 57,157, 21,147,
- 0, 0,212, 16,135,201, 0,255, 0, 0, 0, 0, 61, 88,133,203,190,142, 87,207,188,146,212,141, 0, 0,147,245,187, 97, 0,255,
- 0, 0, 0, 0, 62,230,119, 61, 61,106,172,239,189,253, 43,161,125,164,235,181, 13,156, 0,255, 0, 0, 0, 0,190,176, 85,202,
- 61,106,172,239,189,253, 43,161,130, 92,235,181, 13,156, 0,255, 0, 0, 0, 0, 62,232, 84,243, 61,199,113,194,190, 47, 26, 78,
-126,174,238, 23,252, 66, 0,255, 0, 0, 0, 0,190,178, 51,128, 61,199,113,194,190, 47, 26, 78,129, 82,238, 23,252, 66, 0,255,
- 0, 0, 0, 0, 62,211,206, 32, 61,147, 49,216,190,180,218,181, 81, 70, 13,148,158, 15, 1,255, 0, 0, 0, 0,190,157,172,173,
- 61,147, 49,216,190,180,218,181,174,186, 13,148,158, 15, 1,255, 0, 0, 0, 0, 62,137, 41,174, 62, 27,180, 54,190,244, 76,226,
- 58,123, 21,228,144, 70, 3,255, 0, 0, 0, 0,190, 38, 16,118, 62, 27,180, 54,190,244, 76,226,197,133, 21,228,144, 70, 3,255,
- 0, 0, 0, 0, 62,202,121,146,189,151, 95,239,189,238, 61,240, 89, 76,164,139, 6,161, 2,255, 0, 0, 0, 0,190,148, 88, 31,
-189,151, 95,239,189,238, 61,240,166,180,164,139, 6,161, 2,255, 0, 0, 0, 0, 62,168,226,197,189,226, 4, 97,190,103, 21,163,
- 38, 93,134, 34, 7,182, 0,255, 0, 0, 0, 0,190,101,130,164,189,226, 4, 97,190,103, 21,163,217,163,134, 34, 7,182, 0,255,
- 0, 0, 0, 0, 62,180, 21, 9,189,100, 27,109,190,178,252,255, 43,106,170,219,170,222, 1,255, 0, 0, 0, 0,190,123,231, 45,
-189,100, 27,109,190,178,252,255,212,150,170,219,170,222, 1,255, 0, 0, 0, 0, 62, 86,156,155,188,217, 91,211,190,234,248, 85,
- 55,168,213,109,148,229, 2,255, 0, 0, 0, 0,189,212,179,106,188,217, 91,211,190,234,248, 85,200, 88,213,109,148,229, 2,255,
- 0, 0, 0, 0, 62, 38, 24, 30,190, 93, 61,112, 61, 37,112,191,120,197,255, 36,213,158, 0,255, 0, 0, 0, 0,189,103, 84,224,
-190, 93, 61,112, 61, 37,112,191,135, 59,255, 36,213,158, 0,255, 0, 0, 0, 0, 62, 11,248, 41,190,123, 24,209,188,236,102,176,
- 84,188,181, 20,196, 24, 0,255, 0, 0, 0, 0,188,253,170, 27,190,123, 24,209,188,236,102,176,171, 68,181, 20,196, 24, 0,255,
- 0, 0, 0, 0, 62, 64, 56, 19,190,196,117,110, 60,241, 79, 92, 79,131,254, 86,155,183, 2,255, 0, 0, 0, 0,189,167,234, 89,
-190,196,117,110, 60,241, 79, 92,176,125,254, 86,155,183, 2,255, 0, 0, 0, 0, 62, 45,142,246,190,146, 19, 59, 61, 7,149, 95,
- 99, 5, 1, 8,174,231, 0,255, 0, 0, 0, 0,189,130,152, 32,190,146, 19, 59, 61, 7,149, 95,156,251, 1, 8,174,231, 0,255,
- 0, 0, 0, 0, 62, 82,225, 47,190,244,249,234, 61, 22,131, 15, 62, 65,185,227,168,224, 2,255, 0, 0, 0, 0,189,205, 60,146,
-190,244,249,234, 61, 22,131, 15,193,191,185,227,168,224, 2,255, 0, 0, 0, 0, 61,242,158, 25,190,207,167,178, 60,181,152,155,
- 16,133,232,208,131, 55, 0,255, 0, 0, 0, 0,188, 80,194,110,190,207,167,178, 60,181,152,155,239,123,232,208,131, 55, 0,255,
- 0, 0, 0, 0, 61,227,176,105,190,155,103,201, 60,151,189, 58, 48, 7,224,163,141,149, 0,255, 0, 0, 0, 0,187,178,169,214,
-190,155,103,201, 60,151,189, 58,207,249,224,163,141,149, 0,255, 0, 0, 0, 0, 62, 4,129, 81,190,252,112,195, 61, 97, 39,129,
- 12, 68,158,218,173,147, 0,255, 0, 0, 0, 0,188,193,243, 89,190,252,112,195, 61, 97, 39,129,243,188,158,218,173,147, 0,255,
- 0, 0, 0, 0, 62, 30,161, 70,190, 59,166,163, 61, 82, 57,208,124,195,227,106,255,203, 0,255, 0, 0, 0, 0,189, 73,121,127,
-190, 59,166,163, 61, 82, 57,208,131, 61,227,106,255,203, 0,255, 0, 0, 0, 0, 62, 26,229,218,190, 33,134,174, 61,142,111, 33,
-120, 29,231,105, 36,193, 0,255, 0, 0, 0, 0,189, 58,139,207,190, 33,134,174, 61,142,111, 33,135,227,231,105, 36,193, 0,255,
- 0, 0, 0, 0, 62, 23, 42,109,190, 7,102,186, 61,172, 74,130,101,160,182,164, 25,240, 0,255, 0, 0, 0, 0,189, 43,158, 31,
-190, 7,102,186, 61,172, 74,130,154, 96,182,164, 25,240, 0,255, 0, 0, 0, 0, 62, 26,229,218,190,111,230,140,189,148,171,206,
- 84,120,159,221,253,198, 0,255, 0, 0, 0, 0,189, 58,139,207,190,111,230,140,189,148,171,206,171,136,159,221,253,198, 0,255,
- 0, 0, 0, 0, 62, 67,243,127,190, 74,148, 83,190,139,205, 16, 67,255,151, 42,228, 73, 2,255, 0, 0, 0, 0,189,175, 97, 49,
-190, 74,148, 83,190,139,205, 16,188, 1,151, 42,228, 73, 2,255, 0, 0, 0, 0, 62, 90, 88, 7,189,248,104,235,190,205, 28,244,
- 63,201,176, 25,179, 0, 3,255, 0, 0, 0, 0,189,220, 42, 66,189,248,104,235,190,205, 28,244,192, 55,176, 25,179, 0, 3,255,
- 0, 0, 0, 0, 62,135, 75,248, 62,180,124, 55,190,167,202,187, 56, 34, 95,160,192, 17, 2,255, 0, 0, 0, 0,190, 34, 85, 10,
- 62,180,124, 55,190,167,202,187,199,222, 95,160,192, 17, 2,255, 0, 0, 0, 0, 62,135, 75,248, 62,195,105,232,190, 58, 76,146,
- 55, 54,115,120, 0,239, 2,255, 0, 0, 0, 0,190, 34, 85, 10, 62,195,105,232,190, 58, 76,146,200,202,115,120, 0,239, 2,255,
- 0, 0, 0, 0, 62,135, 75,248, 62,176,192,203,189, 34,252,105, 63,239, 92,164, 60,238, 2,255, 0, 0, 0, 0,190, 34, 85, 10,
- 62,176,192,203,189, 34,252,105,192, 17, 92,164, 60,238, 2,255, 0, 0, 0, 0, 62,137, 41,174, 62, 68,193,219, 61, 82, 57,208,
- 49,123,102,255, 57,170, 0,255, 0, 0, 0, 0,190, 38, 16,118, 62, 68,193,219, 61, 82, 57,208,206,133,102,255, 57,170, 0,255,
- 0, 0, 0, 0, 62,200,155,220, 62, 12,198,133, 59,248,172, 95, 98,142, 73,198, 35, 6, 0,255, 0, 0, 0, 0,190,146,122,105,
- 62, 12,198,133, 59,248,172, 95,157,114, 73,198, 35, 6, 0,255, 0, 0, 0, 0, 62,178, 55, 83, 62, 35, 43, 14,188,146,212,141,
- 61,129,106,254, 33,241, 0,255, 0, 0, 0, 0,190,120, 43,193, 62, 35, 43, 14,188,146,212,141,194,127,106,254, 33,241, 0,255,
- 0, 0, 0, 0, 62,180, 21, 9, 62,141, 76, 72,189,253, 43,161, 76,234, 87,151, 52,221, 0,255, 0, 0, 0, 0,190,123,231, 45,
- 62,141, 76, 72,189,253, 43,161,179, 22, 87,151, 52,221, 0,255, 0, 0, 0, 0, 62,217,103, 66, 62, 87,106,247,189,185,254, 7,
-101,187, 66, 28, 40,199, 2,255, 0, 0, 0, 0,190,163, 69,207, 62, 87,106,247,189,185,254, 7,154, 69, 66, 28, 40,199, 2,255,
- 0, 0, 0, 0, 62,217,103, 66, 62,113,138,236,190, 80,177, 26,113,183, 58, 68,248,119, 2,255, 0, 0, 0, 0,190,163, 69,207,
- 62,113,138,236,190, 80,177, 26,142, 73, 58, 68,248,119, 2,255, 0, 0, 0, 0, 62,180, 21, 9, 62,152,126,141,190,118, 3, 83,
- 86,235, 93,238,253,205, 0,255, 0, 0, 0, 0,190,123,231, 45, 62,152,126,141,190,118, 3, 83,169, 21, 93,238,253,205, 0,255,
- 0, 0, 0, 0, 62,180, 21, 9, 62,135,179, 38,190,182,184,107, 85,232, 70,154,192,157, 2,255, 0, 0, 0, 0,190,123,231, 45,
- 62,135,179, 38,190,182,184,107,170, 24, 70,154,192,157, 2,255, 0, 0, 0, 0, 62,217,103, 66, 62, 76, 56,179,190,162, 49,153,
-110,166, 42,177,207,222, 2,255, 0, 0, 0, 0,190,163, 69,207, 62, 76, 56,179,190,162, 49,153,145, 90, 42,177,207,222, 2,255,
- 0, 0, 0, 0, 62,174,123,231, 61,206,232,154,190,216, 79, 56, 75, 58, 1, 57,152,116, 3,255, 0, 0, 0, 0,190,112,180,232,
- 61,206,232,154,190,216, 79, 56,180,198, 1, 57,152,116, 3,255, 0, 0, 0, 0, 62,142,194,208,189, 40,100,171,190,206,250,170,
- 70, 73,187,147,173,200, 1,255, 0, 0, 0, 0,190, 49, 66,187,189, 40,100,171,190,206,250,170,185,183,187,147,173,200, 0,255,
- 0, 0, 0, 0, 62,223, 0,100, 61,206,232,154,190,121,190,191,114,194, 41, 80, 38,207, 0,255, 0, 0, 0, 0,190,168,222,241,
- 61,206,232,154,190,121,190,191,141, 62, 41, 80, 38,207, 0,255, 0, 0, 0, 0, 62,120, 51,104,190, 7,102,186,189,163,153,127,
- 74,232,154,153, 22, 28, 0,255, 0, 0, 0, 0,190, 11,240,130,190, 7,102,186,189,163,153,127,181, 24,154,153, 22, 28, 0,255,
- 0, 0, 0, 0, 62,129,178,214,190, 18,152,254,190,125,122, 44, 71, 89,151,115,237, 1, 0,255, 0, 0, 0, 0,190, 23, 34,198,
-190, 18,152,254,190,125,122, 44,184,167,151,115,237, 1, 0,255, 0, 0, 0, 0, 62,239,203,202, 62, 12,198,133,190,132, 86, 56,
-220, 72, 93,207, 79,106, 2,255, 0, 0, 0, 0,190,185,170, 88, 62, 12,198,133,190,132, 86, 56, 35,184, 93,207, 79,106, 2,255,
- 0, 0, 0, 0, 62,211,206, 32,189,240,242, 18,190, 84,108,135, 15, 30,150, 34, 70, 84, 2,255, 0, 0, 0, 0,190,157,172,173,
-189,240,242, 18,190, 84,108,135,240,226,150, 34, 70, 84, 2,255, 0, 0, 0, 0, 63, 9,160, 38,189,203,159,217,190,154,186,192,
- 67,164,166,138, 61,172, 0,255, 0, 0, 0, 0,190,221, 30,219,189,203,159,217,190,154,186,192,188, 92,166,138, 61,172, 0,255,
- 0, 0, 0, 0, 63, 38,140,172,188,217, 91,211,190,178,252,255, 83,179,206,223, 83,114, 0,255, 0, 0, 0, 0,191, 11,123,244,
-188,217, 91,211,190,178,252,255,172, 77,206,223, 83,114, 0,255, 0, 0, 0, 0, 63, 46,242, 95, 61,199,113,194,190,177, 31, 73,
- 92, 54, 12,232, 87,210, 2,255, 0, 0, 0, 0,191, 19,225,167, 61,199,113,194,190,177, 31, 73,163,202, 12,232, 87,210, 2,255,
- 0, 0, 0, 0, 63, 32,243,138, 62, 61, 75, 3,190,177, 31, 73, 62,247, 83,221, 73, 97, 0,255, 0, 0, 0, 0,191, 5,226,209,
- 62, 61, 75, 3,190,177, 31, 73,193, 9, 83,221, 73, 97, 0,255, 0, 0, 0, 0, 63, 7,194,112, 62, 46, 93, 82,190,150,255, 84,
- 5,181,111, 80, 62,236, 0,255, 0, 0, 0, 0,190,217, 99,111, 62, 46, 93, 82,190,150,255, 84,250, 75,111, 80, 62,236, 0,255,
- 0, 0, 0, 0, 63, 6,211,149, 62, 16,129,241,190,145,102, 50, 69,236,239,117,105,236, 0,255, 0, 0, 0, 0,190,215,133,185,
- 62, 16,129,241,190,145,102, 50,186, 20,239,117,105,236, 0,255, 0, 0, 0, 0, 63, 27, 90,104, 62, 27,180, 54,190,169,168,113,
- 24, 34,231,205,123, 89, 0,255, 0, 0, 0, 0,191, 0, 73,175, 62, 27,180, 54,190,169,168,113,231,222,231,205,123, 89, 0,255,
- 0, 0, 0, 0, 63, 36,174,246, 61,169,150, 97,190,173, 99,221,223, 69,252, 16,123,173, 0,255, 0, 0, 0, 0,191, 9,158, 62,
- 61,169,150, 97,190,173, 99,221, 32,187,252, 16,123,173, 0,255, 0, 0, 0, 0, 63, 30, 38,249,188,127,147, 98,190,173, 99,221,
-239,171, 39, 0,120,207, 0,255, 0, 0, 0, 0,191, 3, 22, 64,188,127,147, 98,190,173, 99,221, 16, 85, 39, 0,120,207, 0,255,
- 0, 0, 0, 0, 63, 8,177, 75,189,143,233, 23,190,149, 33,158, 51, 9, 45, 56,108, 82, 0,255, 0, 0, 0, 0,190,219, 65, 37,
-189,143,233, 23,190,149, 33,158,204,247, 45, 56,108, 82, 0,255, 0, 0, 0, 0, 62,224,222, 26,189,173,196,120,190, 88, 39,243,
- 38,147, 62,224,104,153, 2,255, 0, 0, 0, 0,190,170,188,167,189,173,196,120,190, 88, 39,243,217,109, 62,224,104,153, 2,255,
- 0, 0, 0, 0, 62,247, 66,162, 61,236,195,250,190,128,154,204, 62,218,243,152,110,206, 2,255, 0, 0, 0, 0,190,193, 33, 48,
- 61,236,195,250,190,128,154,204,193, 38,243,152,110,206, 2,255, 0, 0, 0, 0, 62,252,219,196, 61,184,132, 17,190,145,102, 50,
- 87, 10,182, 73, 58, 19, 0,255, 0, 0, 0, 0,190,198,186, 82, 61,184,132, 17,190,145,102, 50,168,246,182, 73, 58, 19, 0,255,
- 0, 0, 0, 0, 62,237,238, 21,189,128,251,103,190,125,122, 44, 15,232,121,106, 37, 64, 0,255, 0, 0, 0, 0,190,183,204,162,
-189,128,251,103,190,125,122, 44,240, 24,121,106, 37, 64, 0,255, 0, 0, 0, 0, 63, 9,160, 38,189, 85, 45,188,190,164, 15, 79,
-239,157,122, 89, 33,212, 0,255, 0, 0, 0, 0,190,221, 30,219,189, 85, 45,188,190,164, 15, 79, 16, 99,122, 89, 33,212, 0,255,
- 0, 0, 0, 0, 63, 27, 90,104,188, 8, 37,223,190,182,184,107,158, 8, 81,202, 9,185, 0,255, 0, 0, 0, 0,191, 0, 73,175,
-188, 8, 37,223,190,182,184,107, 97,248, 81,202, 9,185, 0,255, 0, 0, 0, 0, 63, 32,243,138, 61,132, 68, 40,190,182,184,107,
-131, 60,239,145, 23, 95, 0,255, 0, 0, 0, 0,191, 5,226,209, 61,132, 68, 40,190,182,184,107,124,196,239,145, 23, 95, 0,255,
- 0, 0, 0, 0, 63, 25,124,178, 61,236,195,250,190,180,218,181,228, 27,153, 22, 70,206, 0,255, 0, 0, 0, 0,190,252,215,242,
- 61,236,195,250,190,180,218,181, 27,229,153, 22, 70,206, 0,255, 0, 0, 0, 0, 63, 7,194,112, 61,221,214, 74,190,162, 49,153,
- 68, 65,168,253, 64,113, 0,255, 0, 0, 0, 0,190,217, 99,111, 61,221,214, 74,190,162, 49,153,187,191,168,253, 64,113, 0,255,
- 0, 0, 0, 0, 62,228,153,135, 61,169,150, 97,190,125,122, 44, 86,113,222,190, 88, 87, 0,255, 0, 0, 0, 0,190,174,120, 20,
- 61,169,150, 97,190,125,122, 44,169,143,222,190, 88, 87, 0,255, 0, 0, 0, 0, 62,226,187,209, 60,230,126,216,190,141,170,198,
- 95,196,182,107, 42,100, 0,255, 0, 0, 0, 0,190,172,154, 93, 60,230,126,216,190,141,170,198,160, 60,182,107, 42,100, 0,255,
- 0, 0, 0, 0, 62,208, 18,180,188, 8, 37,223,190,141,170,198,111, 42, 14, 21, 61,220, 0,255, 0, 0, 0, 0,190,153,241, 65,
-188, 8, 37,223,190,141,170,198,144,214, 14, 21, 61,220, 0,255, 0, 0, 0, 0, 62,223, 0,100,188, 67,220,161,190,141,170,198,
- 79, 3, 91, 4, 43, 19, 2,255, 0, 0, 0, 0,190,168,222,241,188, 67,220,161,190,141,170,198,176,253, 91, 4, 43, 19, 2,255,
- 0, 0, 0, 0, 62,228,153,135,189, 55, 82, 92,190,141,170,198,107,207,254,198, 68,250, 2,255, 0, 0, 0, 0,190,174,120, 20,
-189, 55, 82, 92,190,141,170,198,148, 49,254,198, 68,250, 2,255, 0, 0, 0, 0, 62,221, 34,174,189,115, 9, 29,190,141,170,198,
- 82, 7, 64,225, 73,200, 0,255, 0, 0, 0, 0,190,167, 1, 59,189,115, 9, 29,190,141,170,198,173,249, 64,225, 73,200, 0,255,
- 0, 0, 0, 0, 62,200,155,220,189, 85, 45,188,190, 58, 76,146,117, 38,207, 66,239, 47, 0,255, 0, 0, 0, 0,190,146,122,105,
-189, 85, 45,188,190, 58, 76,146,138,218,207, 66,239, 47, 0,255, 0, 0, 0, 0, 62,198,190, 38,189,128,251,103,190,106,209, 15,
- 97,150, 18,139, 80,184, 0,255, 0, 0, 0, 0,190,144,156,179,189,128,251,103,190,106,209, 15,158,106, 18,139, 80,184, 0,255,
- 0, 0, 0, 0, 62,198,190, 38,189, 10,137, 74,190,114, 71,231,116, 17,240, 66, 51,154, 0,255, 0, 0, 0, 0,190,144,156,179,
-189, 10,137, 74,190,114, 71,231,139,239,240, 66, 51,154, 0,255, 0, 0, 0, 0, 62,217,103, 66, 61, 46,246, 45,190,125,122, 44,
-113,112,204,245, 30, 39, 0,255, 0, 0, 0, 0,190,163, 69,207, 61, 46,246, 45,190,125,122, 44,142,144,204,245, 30, 39, 0,255,
- 0, 0, 0, 0, 62,239,203,202, 61,121,154,159,190,139,205, 16, 90,105,185, 61, 56,146, 0,255, 0, 0, 0, 0,190,185,170, 88,
- 61,121,154,159,190,139,205, 16,165,151,185, 61, 56,146, 0,255, 0, 0, 0, 0, 62,239,203,202, 61,106,172,239,190,152,221, 10,
- 82,191,204,102, 82,230, 0,255, 0, 0, 0, 0,190,185,170, 88, 61,106,172,239,190,152,221, 10,173, 65,204,102, 82,230, 0,255,
- 0, 0, 0, 0, 62,221, 34,174,189,115, 9, 29,190,152,221, 10, 29,246, 98, 64, 76, 94, 0,255, 0, 0, 0, 0,190,167, 1, 59,
-189,115, 9, 29,190,152,221, 10,226, 10, 98, 64, 76, 94, 0,255, 0, 0, 0, 0, 62,230,119, 61,189, 55, 82, 92,190,152,221, 10,
- 77,150, 17,111,100, 75, 0,255, 0, 0, 0, 0,190,176, 85,202,189, 55, 82, 92,190,152,221, 10,178,106, 17,111,100, 75, 0,255,
- 0, 0, 0, 0, 62,224,222, 26,188,127,147, 98,190,152,221, 10, 60,239, 60,190, 94,195, 0,255, 0, 0, 0, 0,190,170,188,167,
-188,127,147, 98,190,152,221, 10,195, 17, 60,190, 94,195, 0,255, 0, 0, 0, 0, 62,209,240,106,188, 8, 37,223,190,152,221, 10,
- 83,199, 23,178, 93,209, 0,255, 0, 0, 0, 0,190,155,206,247,188, 8, 37,223,190,152,221, 10,172, 57, 23,178, 93,209, 0,255,
- 0, 0, 0, 0, 62,228,153,135, 60,230,126,216,190,152,221, 10, 73, 98,200, 1, 88,170, 0,255, 0, 0, 0, 0,190,174,120, 20,
- 60,230,126,216,190,152,221, 10,182,158,200, 1, 88,170, 0,255, 0, 0, 0, 0, 63, 9,160, 38, 61,206,232,154,190,175, 65,147,
- 68, 23,223,166,103,112, 0,255, 0, 0, 0, 0,190,221, 30,219, 61,206,232,154,190,175, 65,147,187,233,223,166,103,112, 0,255,
- 0, 0, 0, 0, 63, 27, 90,104, 61,221,214, 74,190,192, 12,249, 18,165,216,156,120, 89, 0,255, 0, 0, 0, 0,191, 0, 73,175,
- 61,221,214, 74,190,192, 12,249,237, 91,216,156,120, 89, 0,255, 0, 0, 0, 0, 63, 35,192, 27, 61,121,154,159,190,193,234,175,
-185, 25,231, 29,103,157, 0,255, 0, 0, 0, 0,191, 8,175, 98, 61,121,154,159,190,193,234,175, 70,231,231, 29,103,157, 0,255,
- 0, 0, 0, 0, 63, 30, 38,249,188, 67,220,161,190,192, 12,249,209, 43, 64, 0,100,119, 0,255, 0, 0, 0, 0,191, 3, 22, 64,
-188, 67,220,161,190,192, 12,249, 46,213, 64, 0,100,119, 0,255, 0, 0, 0, 0, 63, 10,143, 1,189, 85, 45,188,190,177, 31, 73,
- 26, 52, 92,240, 84, 3, 0,255, 0, 0, 0, 0,190,222,252,145,189, 85, 45,188,190,177, 31, 73,229,204, 92,240, 84, 3, 0,255,
- 0, 0, 0, 0, 62,237,238, 21,189,115, 9, 29,190,139,205, 16, 8, 58,111,116, 62,101, 0,255, 0, 0, 0, 0,190,183,204,162,
-189,115, 9, 29,190,139,205, 16,247,198,111,116, 62,101, 0,255, 0, 0, 0, 0, 62,254,185,122, 61,169,150, 97,190,158,118, 45,
- 80,198,213,102, 89,175, 0,255, 0, 0, 0, 0,190,200,152, 8, 61,169,150, 97,190,158,118, 45,175, 58,213,102, 89,175, 0,255,
- 0, 0, 0, 0, 62,239,203,202,186,133,194,226,190,154,186,192, 25,136, 0,130,125,108, 0,255, 0, 0, 0, 0,190,185,170, 88,
-186,133,194,226,190,154,186,192,230,120, 0,130,125,108, 0,255, 0, 0, 0, 0, 62,250,254, 14,188,187,128,115,190,156,152,119,
- 27, 2, 30, 58,121,104, 0,255, 0, 0, 0, 0,190,196,220,156,188,187,128,115,190,156,152,119,228,254, 30, 58,121,104, 0,255,
- 0, 0, 0, 0, 63, 4,245,223, 59,205,106, 77,190,164, 15, 79, 55,218,253,126,115, 35, 0,255, 0, 0, 0, 0,190,211,202, 76,
- 59,205,106, 77,190,164, 15, 79,200, 38,253,126,115, 35, 0,255, 0, 0, 0, 0, 63, 0, 75,152, 60,230,126,216,190,160, 83,227,
- 41,164,255,199,121, 8, 0,255, 0, 0, 0, 0,190,202,117,190, 60,230,126,216,190,160, 83,227,214, 92,255,199,121, 8, 0,255,
- 0, 0, 0, 0, 63, 6,211,149, 61,106,172,239,190,165,237, 5, 39,237, 9,191,121, 55, 0,255, 0, 0, 0, 0,190,215,133,185,
- 61,106,172,239,190,165,237, 5,216, 19, 9,191,121, 55, 0,255, 0, 0, 0, 0, 63, 11,125,220, 61, 17, 26,205,190,167,202,187,
- 46,208,244, 41,118,137, 0,255, 0, 0, 0, 0,190,224,218, 71, 61, 17, 26,205,190,167,202,187,209, 48,244, 41,118,137, 0,255,
- 0, 0, 0, 0, 63, 18, 5,218, 61, 61,227,222,190,169,168,113, 53, 70, 3, 84,116, 85, 2,255, 0, 0, 0, 0,190,237,234, 65,
- 61, 61,227,222,190,169,168,113,202,186, 3, 84,116, 85, 2,255, 0, 0, 0, 0, 63, 15, 57, 73, 61,154,168,176,190,169,168,113,
- 44, 99, 38, 36,113,212, 2,255, 0, 0, 0, 0,190,232, 81, 31, 61,154,168,176,190,169,168,113,211,157, 38, 36,113,212, 2,255,
- 0, 0, 0, 0, 63, 7,194,112, 62, 27,180, 54,190,192, 12,249,198,249, 72, 3,166,222, 3,255, 0, 0, 0, 0,190,217, 99,111,
- 62, 27,180, 54,190,192, 12,249, 57, 7, 72, 3,166,222, 3,255, 0, 0, 0, 0, 63, 34,209, 64, 62, 42,161,230,190,206,250,170,
- 37,198, 68,123,154,174, 3,255, 0, 0, 0, 0,191, 7,192,135, 62, 42,161,230,190,206,250,170,218, 58, 68,123,154,174, 3,255,
- 0, 0, 0, 0, 63, 48,208, 21, 61,177, 13, 57,190,195,200,102,121, 3, 17,201,218, 73, 3,255, 0, 0, 0, 0,191, 21,191, 93,
- 61,177, 13, 57,190,195,200,102,134,253, 17,201,218, 73, 3,255, 0, 0, 0, 0, 63, 42, 72, 24,188,217, 91,211,190,203, 63, 62,
- 82, 59,200, 75,175, 70, 3,255, 0, 0, 0, 0,191, 15, 55, 96,188,217, 91,211,190,203, 63, 62,173,197,200, 75,175, 70, 3,255,
- 0, 0, 0, 0, 63, 9,160, 38,189,188,178, 40,190,193,234,175,249,134,165,184,165,129, 3,255, 0, 0, 0, 0,190,221, 30,219,
-189,188,178, 40,190,193,234,175, 6,122,165,184,165,129, 3,255, 0, 0, 0, 0, 62,215,137,140,189,226, 4, 97,190,154,186,192,
-249,126,163,122,167,205, 1,255, 0, 0, 0, 0,190,161,104, 25,189,226, 4, 97,190,154,186,192, 6,130,163,122,167,205, 1,255,
- 0, 0, 0, 0, 62,232, 84,243, 62, 1,148, 65,190,167,202,187,193, 93, 65,224,165,229, 1,255, 0, 0, 0, 0,190,178, 51,128,
- 62, 1,148, 65,190,167,202,187, 62,163, 65,224,165,229, 1,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,107, 16,
- 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7,160, 80, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 47, 28, 7,160, 80, 32,
- 0, 0, 0, 55, 0, 0, 3,237, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34,
- 0, 0, 0, 2, 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 43, 0, 0, 0, 45, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 3,
- 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 46, 0, 0, 0, 34, 0, 0, 0, 44, 0, 0, 0, 46, 0, 0, 0, 34, 0, 0, 0, 3,
- 0, 0, 0, 44, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 41, 0, 0, 0, 34,
- 0, 0, 0, 41, 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 44,
- 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 42, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 6,
- 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 6, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 34,
- 0, 0, 0, 3, 0, 0, 0, 9, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 0, 34, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 1,
- 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 10, 0, 0, 0, 12, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 14, 0, 0, 0, 34,
- 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 13, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 15,
- 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 14,
- 0, 0, 0, 19, 0, 0, 0, 34, 0, 0, 0, 17, 0, 0, 0, 19, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 17, 0, 0, 0, 34,
- 0, 0, 0, 18, 0, 0, 0, 20, 0, 0, 0, 34, 0, 0, 0, 16, 0, 0, 0, 18, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 21,
- 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 21, 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0, 22, 0, 0, 0, 34, 0, 0, 0, 13,
- 0, 0, 0, 22, 0, 0, 0, 34, 0, 0, 0, 21, 0, 0, 0, 23, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 25, 0, 0, 0, 34,
- 0, 0, 0, 19, 0, 0, 0, 25, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 26, 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 24,
- 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0, 26, 0, 0, 0, 34, 0, 0, 0, 25, 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 17,
- 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 26, 0, 0, 0, 28, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 28, 0, 0, 0, 34,
- 0, 0, 0, 25, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 27, 0, 0, 0, 29,
- 0, 0, 0, 34, 0, 0, 0, 30, 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 26, 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 28,
- 0, 0, 0, 30, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 31, 0, 0, 0, 33, 0, 0, 0, 34,
- 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 33, 0, 0, 0, 35,
- 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 0, 34, 0, 0, 0, 31, 0, 0, 0, 37, 0, 0, 0, 34, 0, 0, 0, 36,
- 0, 0, 0, 38, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 38, 0, 0, 0, 34,
- 0, 0, 0, 37, 0, 0, 0, 39, 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 39, 0, 0, 0, 34, 0, 0, 0, 38, 0, 0, 0, 40,
- 0, 0, 0, 34, 0, 0, 0, 30, 0, 0, 0, 40, 0, 0, 0, 34, 0, 0, 0, 37, 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 39,
- 0, 0, 0, 41, 0, 0, 0, 34, 0, 0, 0, 38, 0, 0, 0, 44, 0, 0, 0, 34, 0, 0, 0, 40, 0, 0, 0, 42, 0, 0, 0, 34,
- 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 46, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 49,
- 0, 0, 0, 34, 0, 0, 0, 47, 0, 0, 0, 49, 0, 0, 0, 34, 0, 0, 0, 45, 0, 0, 0, 47, 0, 0, 0, 34, 0, 0, 0, 36,
- 0, 0, 0, 50, 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 34, 0, 0, 0, 48, 0, 0, 0, 50, 0, 0, 0, 34,
- 0, 0, 0, 33, 0, 0, 0, 51, 0, 0, 0, 34, 0, 0, 0, 49, 0, 0, 0, 51, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 52,
- 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0, 52, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 51,
- 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 54, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 54, 0, 0, 0, 34,
- 0, 0, 0, 21, 0, 0, 0, 55, 0, 0, 0, 34, 0, 0, 0, 53, 0, 0, 0, 55, 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 56,
- 0, 0, 0, 34, 0, 0, 0, 54, 0, 0, 0, 56, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 57, 0, 0, 0, 34, 0, 0, 0, 55,
- 0, 0, 0, 57, 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0, 58, 0, 0, 0, 34, 0, 0, 0, 56, 0, 0, 0, 58, 0, 0, 0, 34,
- 0, 0, 0, 10, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 62,
- 0, 0, 0, 34, 0, 0, 0, 58, 0, 0, 0, 62, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 61,
- 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 62, 0, 0, 0, 64, 0, 0, 0, 34,
- 0, 0, 0, 47, 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 59, 0, 0, 0, 63,
- 0, 0, 0, 34, 0, 0, 0, 47, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 48,
- 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 59, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 62, 0, 0, 0, 34,
- 0, 0, 0, 57, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 58, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 55, 0, 0, 0, 59,
- 0, 0, 0, 34, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 53, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 54,
- 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 51, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 60, 0, 0, 0, 34,
- 0, 0, 0, 49, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 87, 0, 0, 0,171,
- 0, 0, 0, 34, 0, 0, 0,171, 0, 0, 0,173, 0, 0, 0, 34, 0, 0, 0, 89, 0, 0, 0,173, 0, 0, 0, 34, 0, 0, 0, 87,
- 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0,172, 0, 0, 0,173, 0, 0, 0, 34, 0, 0, 0, 88, 0, 0, 0,172, 0, 0, 0, 34,
- 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0, 85, 0, 0, 0,169, 0, 0, 0, 34, 0, 0, 0,169, 0, 0, 0,171,
- 0, 0, 0, 34, 0, 0, 0, 85, 0, 0, 0, 87, 0, 0, 0, 34, 0, 0, 0,170, 0, 0, 0,172, 0, 0, 0, 34, 0, 0, 0, 86,
- 0, 0, 0,170, 0, 0, 0, 34, 0, 0, 0, 86, 0, 0, 0, 88, 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 0,167, 0, 0, 0, 34,
- 0, 0, 0,167, 0, 0, 0,169, 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 0, 85, 0, 0, 0, 34, 0, 0, 0,168, 0, 0, 0,170,
- 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0,168, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0, 86, 0, 0, 0, 34, 0, 0, 0, 81,
- 0, 0, 0,165, 0, 0, 0, 34, 0, 0, 0,165, 0, 0, 0,167, 0, 0, 0, 34, 0, 0, 0, 81, 0, 0, 0, 83, 0, 0, 0, 34,
- 0, 0, 0,166, 0, 0, 0,168, 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 0,166, 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 0, 84,
- 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0,163, 0, 0, 0, 34, 0, 0, 0,163, 0, 0, 0,165, 0, 0, 0, 34, 0, 0, 0, 79,
- 0, 0, 0, 81, 0, 0, 0, 34, 0, 0, 0,164, 0, 0, 0,166, 0, 0, 0, 34, 0, 0, 0, 80, 0, 0, 0,164, 0, 0, 0, 34,
- 0, 0, 0, 80, 0, 0, 0, 82, 0, 0, 0, 34, 0, 0, 0, 77, 0, 0, 0, 90, 0, 0, 0, 34, 0, 0, 0, 90, 0, 0, 0,143,
- 0, 0, 0, 34, 0, 0, 0,143, 0, 0, 0,161, 0, 0, 0, 34, 0, 0, 0, 77, 0, 0, 0,161, 0, 0, 0, 34, 0, 0, 0, 91,
- 0, 0, 0,144, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 0, 91, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 0,162, 0, 0, 0, 34,
- 0, 0, 0,144, 0, 0, 0,162, 0, 0, 0, 34, 0, 0, 0, 90, 0, 0, 0, 92, 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0,145,
- 0, 0, 0, 34, 0, 0, 0,143, 0, 0, 0,145, 0, 0, 0, 34, 0, 0, 0, 93, 0, 0, 0,146, 0, 0, 0, 34, 0, 0, 0, 91,
- 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0,144, 0, 0, 0,146, 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0, 94, 0, 0, 0, 34,
- 0, 0, 0, 94, 0, 0, 0,147, 0, 0, 0, 34, 0, 0, 0,145, 0, 0, 0,147, 0, 0, 0, 34, 0, 0, 0, 95, 0, 0, 0,148,
- 0, 0, 0, 34, 0, 0, 0, 93, 0, 0, 0, 95, 0, 0, 0, 34, 0, 0, 0,146, 0, 0, 0,148, 0, 0, 0, 34, 0, 0, 0, 94,
- 0, 0, 0, 96, 0, 0, 0, 34, 0, 0, 0, 96, 0, 0, 0,149, 0, 0, 0, 34, 0, 0, 0,147, 0, 0, 0,149, 0, 0, 0, 34,
- 0, 0, 0, 97, 0, 0, 0,150, 0, 0, 0, 34, 0, 0, 0, 95, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0,148, 0, 0, 0,150,
- 0, 0, 0, 34, 0, 0, 0, 96, 0, 0, 0, 98, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0,151, 0, 0, 0, 34, 0, 0, 0,149,
- 0, 0, 0,151, 0, 0, 0, 34, 0, 0, 0, 99, 0, 0, 0,152, 0, 0, 0, 34, 0, 0, 0, 97, 0, 0, 0, 99, 0, 0, 0, 34,
- 0, 0, 0,150, 0, 0, 0,152, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0,100, 0, 0, 0, 34, 0, 0, 0,100, 0, 0, 0,153,
- 0, 0, 0, 34, 0, 0, 0,151, 0, 0, 0,153, 0, 0, 0, 34, 0, 0, 0,101, 0, 0, 0,154, 0, 0, 0, 34, 0, 0, 0, 99,
- 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0,152, 0, 0, 0,154, 0, 0, 0, 34, 0, 0, 0,100, 0, 0, 0,102, 0, 0, 0, 34,
- 0, 0, 0,102, 0, 0, 0,155, 0, 0, 0, 34, 0, 0, 0,153, 0, 0, 0,155, 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 0,156,
- 0, 0, 0, 34, 0, 0, 0,101, 0, 0, 0,103, 0, 0, 0, 34, 0, 0, 0,154, 0, 0, 0,156, 0, 0, 0, 34, 0, 0, 0,102,
- 0, 0, 0,104, 0, 0, 0, 34, 0, 0, 0,104, 0, 0, 0,157, 0, 0, 0, 34, 0, 0, 0,155, 0, 0, 0,157, 0, 0, 0, 34,
- 0, 0, 0,105, 0, 0, 0,158, 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 0,105, 0, 0, 0, 34, 0, 0, 0,156, 0, 0, 0,158,
- 0, 0, 0, 34, 0, 0, 0,104, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0,106, 0, 0, 0,159, 0, 0, 0, 34, 0, 0, 0,157,
- 0, 0, 0,159, 0, 0, 0, 34, 0, 0, 0,107, 0, 0, 0,160, 0, 0, 0, 34, 0, 0, 0,105, 0, 0, 0,107, 0, 0, 0, 34,
- 0, 0, 0,158, 0, 0, 0,160, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0, 66,
- 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0,159, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0,107, 0, 0, 0, 34, 0, 0, 0, 66,
- 0, 0, 0,160, 0, 0, 0, 34, 0, 0, 0,108, 0, 0, 0,125, 0, 0, 0, 34, 0, 0, 0,125, 0, 0, 0,157, 0, 0, 0, 34,
- 0, 0, 0,108, 0, 0, 0,159, 0, 0, 0, 34, 0, 0, 0,126, 0, 0, 0,158, 0, 0, 0, 34, 0, 0, 0,109, 0, 0, 0,126,
- 0, 0, 0, 34, 0, 0, 0,109, 0, 0, 0,160, 0, 0, 0, 34, 0, 0, 0,125, 0, 0, 0,176, 0, 0, 0, 34, 0, 0, 0,155,
- 0, 0, 0,176, 0, 0, 0, 34, 0, 0, 0,156, 0, 0, 0,177, 0, 0, 0, 34, 0, 0, 0,126, 0, 0, 0,177, 0, 0, 0, 34,
- 0, 0, 0,123, 0, 0, 0,153, 0, 0, 0, 34, 0, 0, 0,123, 0, 0, 0,176, 0, 0, 0, 34, 0, 0, 0,124, 0, 0, 0,154,
- 0, 0, 0, 34, 0, 0, 0,124, 0, 0, 0,177, 0, 0, 0, 34, 0, 0, 0,121, 0, 0, 0,151, 0, 0, 0, 34, 0, 0, 0,121,
- 0, 0, 0,123, 0, 0, 0, 34, 0, 0, 0,122, 0, 0, 0,152, 0, 0, 0, 34, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, 34,
- 0, 0, 0,119, 0, 0, 0,149, 0, 0, 0, 34, 0, 0, 0,119, 0, 0, 0,121, 0, 0, 0, 34, 0, 0, 0,120, 0, 0, 0,150,
- 0, 0, 0, 34, 0, 0, 0,120, 0, 0, 0,122, 0, 0, 0, 34, 0, 0, 0,117, 0, 0, 0,147, 0, 0, 0, 34, 0, 0, 0,117,
- 0, 0, 0,119, 0, 0, 0, 34, 0, 0, 0,118, 0, 0, 0,148, 0, 0, 0, 34, 0, 0, 0,118, 0, 0, 0,120, 0, 0, 0, 34,
- 0, 0, 0,115, 0, 0, 0,145, 0, 0, 0, 34, 0, 0, 0,115, 0, 0, 0,117, 0, 0, 0, 34, 0, 0, 0,116, 0, 0, 0,146,
- 0, 0, 0, 34, 0, 0, 0,116, 0, 0, 0,118, 0, 0, 0, 34, 0, 0, 0,113, 0, 0, 0,143, 0, 0, 0, 34, 0, 0, 0,113,
- 0, 0, 0,115, 0, 0, 0, 34, 0, 0, 0,114, 0, 0, 0,144, 0, 0, 0, 34, 0, 0, 0,114, 0, 0, 0,116, 0, 0, 0, 34,
- 0, 0, 0,112, 0, 0, 0,162, 0, 0, 0, 34, 0, 0, 0,112, 0, 0, 0,114, 0, 0, 0, 34, 0, 0, 0,174, 0, 0, 0,178,
- 0, 0, 0, 34, 0, 0, 0,161, 0, 0, 0,174, 0, 0, 0, 34, 0, 0, 0,174, 0, 0, 0,179, 0, 0, 0, 34, 0, 0, 0,112,
- 0, 0, 0,179, 0, 0, 0, 34, 0, 0, 0,162, 0, 0, 0,174, 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0,110, 0, 0, 0, 34,
- 0, 0, 0,108, 0, 0, 0,110, 0, 0, 0, 34, 0, 0, 0,109, 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0,111,
- 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0,175, 0, 0, 0, 34, 0, 0, 0,175, 0, 0, 0,180, 0, 0, 0, 34, 0, 0, 0,110,
- 0, 0, 0,180, 0, 0, 0, 34, 0, 0, 0,111, 0, 0, 0,181, 0, 0, 0, 34, 0, 0, 0,175, 0, 0, 0,181, 0, 0, 0, 34,
- 0, 0, 0,178, 0, 0, 0,180, 0, 0, 0, 34, 0, 0, 0,174, 0, 0, 0,175, 0, 0, 0, 32, 0, 0, 0,179, 0, 0, 0,181,
- 0, 0, 0, 34, 0, 0, 0,132, 0, 0, 0,134, 0, 0, 0, 34, 0, 0, 0,134, 0, 0, 0,173, 0, 0, 0, 34, 0, 0, 0,132,
- 0, 0, 0,171, 0, 0, 0, 34, 0, 0, 0,133, 0, 0, 0,134, 0, 0, 0, 34, 0, 0, 0,133, 0, 0, 0,172, 0, 0, 0, 34,
- 0, 0, 0,130, 0, 0, 0,132, 0, 0, 0, 34, 0, 0, 0,130, 0, 0, 0,169, 0, 0, 0, 34, 0, 0, 0,131, 0, 0, 0,133,
- 0, 0, 0, 34, 0, 0, 0,131, 0, 0, 0,170, 0, 0, 0, 34, 0, 0, 0,128, 0, 0, 0,130, 0, 0, 0, 34, 0, 0, 0,128,
- 0, 0, 0,167, 0, 0, 0, 34, 0, 0, 0,129, 0, 0, 0,131, 0, 0, 0, 34, 0, 0, 0,129, 0, 0, 0,168, 0, 0, 0, 34,
- 0, 0, 0,163, 0, 0, 0,184, 0, 0, 0, 34, 0, 0, 0,182, 0, 0, 0,184, 0, 0, 0, 34, 0, 0, 0,165, 0, 0, 0,182,
- 0, 0, 0, 34, 0, 0, 0,183, 0, 0, 0,185, 0, 0, 0, 34, 0, 0, 0,164, 0, 0, 0,185, 0, 0, 0, 34, 0, 0, 0,166,
- 0, 0, 0,183, 0, 0, 0, 34, 0, 0, 0,128, 0, 0, 0,182, 0, 0, 0, 34, 0, 0, 0,129, 0, 0, 0,183, 0, 0, 0, 34,
- 0, 0, 0,141, 0, 0, 0,187, 0, 0, 0, 34, 0, 0, 0,186, 0, 0, 0,187, 0, 0, 0, 32, 0, 0, 0,184, 0, 0, 0,186,
- 0, 0, 0, 34, 0, 0, 0,141, 0, 0, 0,184, 0, 0, 0, 34, 0, 0, 0,142, 0, 0, 0,187, 0, 0, 0, 34, 0, 0, 0,142,
- 0, 0, 0,185, 0, 0, 0, 34, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0,186, 0, 0, 0, 32,
- 0, 0, 0, 67, 0, 0, 0,182, 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0,183, 0, 0, 0, 34, 0, 0, 0,127, 0, 0, 0,128,
- 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0,127, 0, 0, 0, 32, 0, 0, 0,127, 0, 0, 0,129, 0, 0, 0, 34, 0, 0, 0,139,
- 0, 0, 0,190, 0, 0, 0, 34, 0, 0, 0,188, 0, 0, 0,190, 0, 0, 0, 34, 0, 0, 0,141, 0, 0, 0,188, 0, 0, 0, 34,
- 0, 0, 0,139, 0, 0, 0,141, 0, 0, 0, 34, 0, 0, 0,189, 0, 0, 0,191, 0, 0, 0, 34, 0, 0, 0,140, 0, 0, 0,191,
- 0, 0, 0, 34, 0, 0, 0,140, 0, 0, 0,142, 0, 0, 0, 34, 0, 0, 0,142, 0, 0, 0,189, 0, 0, 0, 34, 0, 0, 0,137,
- 0, 0, 0,192, 0, 0, 0, 34, 0, 0, 0,190, 0, 0, 0,192, 0, 0, 0, 34, 0, 0, 0,137, 0, 0, 0,139, 0, 0, 0, 34,
- 0, 0, 0,191, 0, 0, 0,193, 0, 0, 0, 34, 0, 0, 0,138, 0, 0, 0,193, 0, 0, 0, 34, 0, 0, 0,138, 0, 0, 0,140,
- 0, 0, 0, 34, 0, 0, 0,136, 0, 0, 0,194, 0, 0, 0, 34, 0, 0, 0,192, 0, 0, 0,194, 0, 0, 0, 34, 0, 0, 0,136,
- 0, 0, 0,137, 0, 0, 0, 34, 0, 0, 0,193, 0, 0, 0,195, 0, 0, 0, 34, 0, 0, 0,136, 0, 0, 0,195, 0, 0, 0, 34,
- 0, 0, 0,136, 0, 0, 0,138, 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0,135, 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0,194,
- 0, 0, 0, 34, 0, 0, 0,135, 0, 0, 0,136, 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0,195, 0, 0, 0, 34, 0, 0, 0, 68,
- 0, 0, 0,188, 0, 0, 0, 34, 0, 0, 0, 68, 0, 0, 0,187, 0, 0, 0, 34, 0, 0, 0, 68, 0, 0, 0,189, 0, 0, 0, 34,
- 0, 0, 0,188, 0, 0, 0,203, 0, 0, 0, 34, 0, 0, 0,203, 0, 0, 0,205, 0, 0, 0, 34, 0, 0, 0, 68, 0, 0, 0,205,
- 0, 0, 0, 34, 0, 0, 0,189, 0, 0, 0,204, 0, 0, 0, 34, 0, 0, 0,204, 0, 0, 0,205, 0, 0, 0, 34, 0, 0, 0, 69,
- 0, 0, 0,196, 0, 0, 0, 34, 0, 0, 0,196, 0, 0, 0,197, 0, 0, 0, 34, 0, 0, 0,194, 0, 0, 0,197, 0, 0, 0, 34,
- 0, 0, 0,196, 0, 0, 0,198, 0, 0, 0, 34, 0, 0, 0,195, 0, 0, 0,198, 0, 0, 0, 34, 0, 0, 0,197, 0, 0, 0,199,
- 0, 0, 0, 34, 0, 0, 0,192, 0, 0, 0,199, 0, 0, 0, 34, 0, 0, 0,198, 0, 0, 0,200, 0, 0, 0, 34, 0, 0, 0,193,
- 0, 0, 0,200, 0, 0, 0, 34, 0, 0, 0,199, 0, 0, 0,201, 0, 0, 0, 34, 0, 0, 0,190, 0, 0, 0,201, 0, 0, 0, 34,
- 0, 0, 0,200, 0, 0, 0,202, 0, 0, 0, 34, 0, 0, 0,191, 0, 0, 0,202, 0, 0, 0, 34, 0, 0, 0,201, 0, 0, 0,203,
- 0, 0, 0, 34, 0, 0, 0,202, 0, 0, 0,204, 0, 0, 0, 34, 0, 0, 0,196, 0, 0, 0,201, 0, 0, 0, 34, 0, 0, 0,196,
- 0, 0, 0,202, 0, 0, 0, 34, 0, 0, 0,196, 0, 0, 0,205, 0, 0, 0, 34, 0, 0, 0,137, 0, 0, 0,161, 0, 0, 0, 34,
- 0, 0, 0,136, 0, 0, 0,174, 0, 0, 0, 34, 0, 0, 0,138, 0, 0, 0,162, 0, 0, 0, 34, 0, 0, 0,139, 0, 0, 0,208,
- 0, 0, 0, 34, 0, 0, 0,161, 0, 0, 0,208, 0, 0, 0, 34, 0, 0, 0,140, 0, 0, 0,209, 0, 0, 0, 34, 0, 0, 0,162,
- 0, 0, 0,209, 0, 0, 0, 34, 0, 0, 0,141, 0, 0, 0,210, 0, 0, 0, 34, 0, 0, 0,208, 0, 0, 0,210, 0, 0, 0, 34,
- 0, 0, 0,142, 0, 0, 0,211, 0, 0, 0, 34, 0, 0, 0,209, 0, 0, 0,211, 0, 0, 0, 34, 0, 0, 0,163, 0, 0, 0,210,
- 0, 0, 0, 34, 0, 0, 0,164, 0, 0, 0,211, 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0,206, 0, 0, 0, 34, 0, 0, 0,206,
- 0, 0, 0,210, 0, 0, 0, 34, 0, 0, 0,207, 0, 0, 0,211, 0, 0, 0, 34, 0, 0, 0, 80, 0, 0, 0,207, 0, 0, 0, 34,
- 0, 0, 0,206, 0, 0, 0,212, 0, 0, 0, 34, 0, 0, 0,208, 0, 0, 0,212, 0, 0, 0, 34, 0, 0, 0,209, 0, 0, 0,213,
- 0, 0, 0, 34, 0, 0, 0,207, 0, 0, 0,213, 0, 0, 0, 34, 0, 0, 0, 77, 0, 0, 0,212, 0, 0, 0, 34, 0, 0, 0, 78,
- 0, 0, 0,213, 0, 0, 0, 34, 0, 0, 0, 70, 0, 0, 0,127, 0, 0, 0, 34, 0, 0, 0, 70, 0, 0, 0,219, 0, 0, 0, 34,
- 0, 0, 0,128, 0, 0, 0,219, 0, 0, 0, 34, 0, 0, 0,129, 0, 0, 0,220, 0, 0, 0, 34, 0, 0, 0, 70, 0, 0, 0,220,
- 0, 0, 0, 34, 0, 0, 0,217, 0, 0, 0,219, 0, 0, 0, 34, 0, 0, 0,130, 0, 0, 0,217, 0, 0, 0, 34, 0, 0, 0,131,
- 0, 0, 0,218, 0, 0, 0, 34, 0, 0, 0,218, 0, 0, 0,220, 0, 0, 0, 34, 0, 0, 0,215, 0, 0, 0,217, 0, 0, 0, 34,
- 0, 0, 0,132, 0, 0, 0,215, 0, 0, 0, 34, 0, 0, 0,133, 0, 0, 0,216, 0, 0, 0, 34, 0, 0, 0,216, 0, 0, 0,218,
- 0, 0, 0, 34, 0, 0, 0,214, 0, 0, 0,215, 0, 0, 0, 34, 0, 0, 0,134, 0, 0, 0,214, 0, 0, 0, 34, 0, 0, 0,214,
- 0, 0, 0,216, 0, 0, 0, 34, 0, 0, 0,215, 0, 0, 0,226, 0, 0, 0, 34, 0, 0, 0,226, 0, 0, 0,228, 0, 0, 0, 34,
- 0, 0, 0,214, 0, 0, 0,228, 0, 0, 0, 34, 0, 0, 0,216, 0, 0, 0,227, 0, 0, 0, 34, 0, 0, 0,227, 0, 0, 0,228,
- 0, 0, 0, 34, 0, 0, 0,217, 0, 0, 0,224, 0, 0, 0, 34, 0, 0, 0,224, 0, 0, 0,226, 0, 0, 0, 34, 0, 0, 0,218,
- 0, 0, 0,225, 0, 0, 0, 34, 0, 0, 0,225, 0, 0, 0,227, 0, 0, 0, 34, 0, 0, 0,219, 0, 0, 0,222, 0, 0, 0, 34,
- 0, 0, 0,222, 0, 0, 0,224, 0, 0, 0, 34, 0, 0, 0,220, 0, 0, 0,223, 0, 0, 0, 34, 0, 0, 0,223, 0, 0, 0,225,
- 0, 0, 0, 34, 0, 0, 0, 70, 0, 0, 0,221, 0, 0, 0, 34, 0, 0, 0,221, 0, 0, 0,222, 0, 0, 0, 34, 0, 0, 0,221,
- 0, 0, 0,223, 0, 0, 0, 34, 0, 0, 0,221, 0, 0, 0,228, 0, 0, 0, 34, 0, 0, 0,222, 0, 0, 0,226, 0, 0, 0, 34,
- 0, 0, 0,223, 0, 0, 0,227, 0, 0, 0, 34, 0, 0, 0,178, 0, 0, 0,231, 0, 0, 0, 34, 0, 0, 0,229, 0, 0, 0,231,
- 0, 0, 0, 34, 0, 0, 0,180, 0, 0, 0,229, 0, 0, 0, 34, 0, 0, 0,179, 0, 0, 0,232, 0, 0, 0, 34, 0, 0, 0,181,
- 0, 0, 0,230, 0, 0, 0, 34, 0, 0, 0,230, 0, 0, 0,232, 0, 0, 0, 34, 0, 0, 0,229, 0, 0, 0,251, 0, 0, 0, 34,
- 0, 0, 0,110, 0, 0, 0,251, 0, 0, 0, 34, 0, 0, 0,111, 0, 0, 0,252, 0, 0, 0, 34, 0, 0, 0,230, 0, 0, 0,252,
- 0, 0, 0, 34, 0, 0, 0,251, 0, 0, 0,253, 0, 0, 0, 34, 0, 0, 0,108, 0, 0, 0,253, 0, 0, 0, 34, 0, 0, 0,109,
- 0, 0, 0,254, 0, 0, 0, 34, 0, 0, 0,252, 0, 0, 0,254, 0, 0, 0, 34, 0, 0, 0,231, 0, 0, 0,249, 0, 0, 0, 34,
- 0, 0, 0,112, 0, 0, 0,250, 0, 0, 0, 34, 0, 0, 0,232, 0, 0, 0,250, 0, 0, 0, 34, 0, 0, 0,113, 0, 0, 0,247,
- 0, 0, 0, 34, 0, 0, 0,247, 0, 0, 0,249, 0, 0, 0, 34, 0, 0, 0,114, 0, 0, 0,248, 0, 0, 0, 34, 0, 0, 0,248,
- 0, 0, 0,250, 0, 0, 0, 34, 0, 0, 0,115, 0, 0, 0,245, 0, 0, 0, 34, 0, 0, 0,245, 0, 0, 0,247, 0, 0, 0, 34,
- 0, 0, 0,116, 0, 0, 0,246, 0, 0, 0, 34, 0, 0, 0,246, 0, 0, 0,248, 0, 0, 0, 34, 0, 0, 0,117, 0, 0, 0,243,
- 0, 0, 0, 34, 0, 0, 0,243, 0, 0, 0,245, 0, 0, 0, 34, 0, 0, 0,118, 0, 0, 0,244, 0, 0, 0, 34, 0, 0, 0,244,
- 0, 0, 0,246, 0, 0, 0, 34, 0, 0, 0,119, 0, 0, 0,241, 0, 0, 0, 34, 0, 0, 0,241, 0, 0, 0,243, 0, 0, 0, 34,
- 0, 0, 0,120, 0, 0, 0,242, 0, 0, 0, 34, 0, 0, 0,242, 0, 0, 0,244, 0, 0, 0, 34, 0, 0, 0,121, 0, 0, 0,239,
- 0, 0, 0, 34, 0, 0, 0,239, 0, 0, 0,241, 0, 0, 0, 34, 0, 0, 0,122, 0, 0, 0,240, 0, 0, 0, 34, 0, 0, 0,240,
- 0, 0, 0,242, 0, 0, 0, 34, 0, 0, 0,123, 0, 0, 0,237, 0, 0, 0, 34, 0, 0, 0,237, 0, 0, 0,239, 0, 0, 0, 34,
- 0, 0, 0,124, 0, 0, 0,238, 0, 0, 0, 34, 0, 0, 0,238, 0, 0, 0,240, 0, 0, 0, 34, 0, 0, 0,176, 0, 0, 0,233,
- 0, 0, 0, 34, 0, 0, 0,233, 0, 0, 0,237, 0, 0, 0, 34, 0, 0, 0,177, 0, 0, 0,234, 0, 0, 0, 34, 0, 0, 0,234,
- 0, 0, 0,238, 0, 0, 0, 34, 0, 0, 0,125, 0, 0, 0,235, 0, 0, 0, 34, 0, 0, 0,233, 0, 0, 0,235, 0, 0, 0, 34,
- 0, 0, 0,126, 0, 0, 0,236, 0, 0, 0, 34, 0, 0, 0,234, 0, 0, 0,236, 0, 0, 0, 34, 0, 0, 0,235, 0, 0, 0,253,
- 0, 0, 0, 34, 0, 0, 0,236, 0, 0, 0,254, 0, 0, 0, 34, 0, 0, 0,253, 0, 0, 0,255, 0, 0, 0, 34, 0, 0, 0,255,
- 0, 0, 1, 17, 0, 0, 0, 34, 0, 0, 0,235, 0, 0, 1, 17, 0, 0, 0, 34, 0, 0, 0,254, 0, 0, 1, 0, 0, 0, 0, 34,
- 0, 0, 0,236, 0, 0, 1, 18, 0, 0, 0, 34, 0, 0, 1, 0, 0, 0, 1, 18, 0, 0, 0, 34, 0, 0, 1, 17, 0, 0, 1, 19,
- 0, 0, 0, 34, 0, 0, 0,233, 0, 0, 1, 19, 0, 0, 0, 34, 0, 0, 0,234, 0, 0, 1, 20, 0, 0, 0, 34, 0, 0, 1, 18,
- 0, 0, 1, 20, 0, 0, 0, 34, 0, 0, 1, 15, 0, 0, 1, 19, 0, 0, 0, 34, 0, 0, 0,237, 0, 0, 1, 15, 0, 0, 0, 34,
- 0, 0, 0,238, 0, 0, 1, 16, 0, 0, 0, 34, 0, 0, 1, 16, 0, 0, 1, 20, 0, 0, 0, 34, 0, 0, 1, 13, 0, 0, 1, 15,
- 0, 0, 0, 34, 0, 0, 0,239, 0, 0, 1, 13, 0, 0, 0, 34, 0, 0, 0,240, 0, 0, 1, 14, 0, 0, 0, 34, 0, 0, 1, 14,
- 0, 0, 1, 16, 0, 0, 0, 34, 0, 0, 1, 11, 0, 0, 1, 13, 0, 0, 0, 34, 0, 0, 0,241, 0, 0, 1, 11, 0, 0, 0, 34,
- 0, 0, 0,242, 0, 0, 1, 12, 0, 0, 0, 34, 0, 0, 1, 12, 0, 0, 1, 14, 0, 0, 0, 34, 0, 0, 1, 9, 0, 0, 1, 11,
- 0, 0, 0, 34, 0, 0, 0,243, 0, 0, 1, 9, 0, 0, 0, 34, 0, 0, 0,244, 0, 0, 1, 10, 0, 0, 0, 34, 0, 0, 1, 10,
- 0, 0, 1, 12, 0, 0, 0, 34, 0, 0, 1, 7, 0, 0, 1, 9, 0, 0, 0, 34, 0, 0, 0,245, 0, 0, 1, 7, 0, 0, 0, 34,
- 0, 0, 0,246, 0, 0, 1, 8, 0, 0, 0, 34, 0, 0, 1, 8, 0, 0, 1, 10, 0, 0, 0, 34, 0, 0, 1, 5, 0, 0, 1, 7,
- 0, 0, 0, 34, 0, 0, 0,247, 0, 0, 1, 5, 0, 0, 0, 34, 0, 0, 0,248, 0, 0, 1, 6, 0, 0, 0, 34, 0, 0, 1, 6,
- 0, 0, 1, 8, 0, 0, 0, 34, 0, 0, 1, 3, 0, 0, 1, 5, 0, 0, 0, 34, 0, 0, 0,249, 0, 0, 1, 3, 0, 0, 0, 34,
- 0, 0, 0,250, 0, 0, 1, 4, 0, 0, 0, 34, 0, 0, 1, 4, 0, 0, 1, 6, 0, 0, 0, 34, 0, 0, 1, 3, 0, 0, 1, 21,
- 0, 0, 0, 34, 0, 0, 0,231, 0, 0, 1, 21, 0, 0, 0, 34, 0, 0, 0,232, 0, 0, 1, 22, 0, 0, 0, 34, 0, 0, 1, 4,
- 0, 0, 1, 22, 0, 0, 0, 34, 0, 0, 0,251, 0, 0, 1, 1, 0, 0, 0, 34, 0, 0, 0,255, 0, 0, 1, 1, 0, 0, 0, 34,
- 0, 0, 0,252, 0, 0, 1, 2, 0, 0, 0, 34, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 0, 34, 0, 0, 0,229, 0, 0, 1, 23,
- 0, 0, 0, 34, 0, 0, 1, 1, 0, 0, 1, 23, 0, 0, 0, 34, 0, 0, 0,230, 0, 0, 1, 24, 0, 0, 0, 34, 0, 0, 1, 2,
- 0, 0, 1, 24, 0, 0, 0, 34, 0, 0, 1, 21, 0, 0, 1, 23, 0, 0, 0, 34, 0, 0, 1, 22, 0, 0, 1, 24, 0, 0, 0, 34,
- 0, 0, 0,106, 0, 0, 1, 25, 0, 0, 0, 34, 0, 0, 0, 71, 0, 0, 1, 25, 0, 0, 0, 38, 0, 0, 0, 65, 0, 0, 0, 71,
- 0, 0, 0, 34, 0, 0, 0,107, 0, 0, 1, 26, 0, 0, 0, 34, 0, 0, 0, 71, 0, 0, 1, 26, 0, 0, 0, 38, 0, 0, 0,104,
- 0, 0, 1, 27, 0, 0, 0, 34, 0, 0, 1, 25, 0, 0, 1, 27, 0, 0, 0, 34, 0, 0, 0,105, 0, 0, 1, 28, 0, 0, 0, 34,
- 0, 0, 1, 26, 0, 0, 1, 28, 0, 0, 0, 34, 0, 0, 0,102, 0, 0, 1, 29, 0, 0, 0, 34, 0, 0, 1, 27, 0, 0, 1, 29,
- 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 1, 30, 0, 0, 0, 34, 0, 0, 1, 28, 0, 0, 1, 30, 0, 0, 0, 34, 0, 0, 0,100,
- 0, 0, 1, 31, 0, 0, 0, 34, 0, 0, 1, 29, 0, 0, 1, 31, 0, 0, 0, 34, 0, 0, 0,101, 0, 0, 1, 32, 0, 0, 0, 34,
- 0, 0, 1, 30, 0, 0, 1, 32, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 1, 33, 0, 0, 0, 34, 0, 0, 1, 31, 0, 0, 1, 33,
- 0, 0, 0, 38, 0, 0, 0, 99, 0, 0, 1, 34, 0, 0, 0, 34, 0, 0, 1, 32, 0, 0, 1, 34, 0, 0, 0, 38, 0, 0, 0, 96,
- 0, 0, 1, 35, 0, 0, 0, 34, 0, 0, 1, 33, 0, 0, 1, 35, 0, 0, 0, 34, 0, 0, 0, 97, 0, 0, 1, 36, 0, 0, 0, 34,
- 0, 0, 1, 34, 0, 0, 1, 36, 0, 0, 0, 34, 0, 0, 0, 94, 0, 0, 1, 37, 0, 0, 0, 34, 0, 0, 1, 35, 0, 0, 1, 37,
- 0, 0, 0, 34, 0, 0, 0, 95, 0, 0, 1, 38, 0, 0, 0, 34, 0, 0, 1, 36, 0, 0, 1, 38, 0, 0, 0, 34, 0, 0, 0, 92,
- 0, 0, 1, 39, 0, 0, 0, 34, 0, 0, 1, 37, 0, 0, 1, 39, 0, 0, 0, 34, 0, 0, 0, 93, 0, 0, 1, 40, 0, 0, 0, 34,
- 0, 0, 1, 38, 0, 0, 1, 40, 0, 0, 0, 34, 0, 0, 0, 90, 0, 0, 1, 41, 0, 0, 0, 34, 0, 0, 1, 39, 0, 0, 1, 41,
- 0, 0, 0, 34, 0, 0, 0, 91, 0, 0, 1, 42, 0, 0, 0, 34, 0, 0, 1, 40, 0, 0, 1, 42, 0, 0, 0, 34, 0, 0, 1, 49,
- 0, 0, 1, 50, 0, 0, 0, 38, 0, 0, 1, 50, 0, 0, 1, 69, 0, 0, 0, 34, 0, 0, 1, 69, 0, 0, 1, 79, 0, 0, 0, 34,
- 0, 0, 1, 49, 0, 0, 1, 79, 0, 0, 0, 34, 0, 0, 1, 50, 0, 0, 1, 70, 0, 0, 0, 34, 0, 0, 1, 49, 0, 0, 1, 80,
- 0, 0, 0, 34, 0, 0, 1, 70, 0, 0, 1, 80, 0, 0, 0, 34, 0, 0, 1, 48, 0, 0, 1, 49, 0, 0, 0, 38, 0, 0, 1, 77,
- 0, 0, 1, 79, 0, 0, 0, 34, 0, 0, 1, 48, 0, 0, 1, 77, 0, 0, 0, 34, 0, 0, 1, 48, 0, 0, 1, 78, 0, 0, 0, 34,
- 0, 0, 1, 78, 0, 0, 1, 80, 0, 0, 0, 34, 0, 0, 1, 47, 0, 0, 1, 48, 0, 0, 0, 38, 0, 0, 1, 77, 0, 0, 1, 81,
- 0, 0, 0, 34, 0, 0, 1, 47, 0, 0, 1, 81, 0, 0, 0, 34, 0, 0, 1, 47, 0, 0, 1, 82, 0, 0, 0, 34, 0, 0, 1, 78,
- 0, 0, 1, 82, 0, 0, 0, 34, 0, 0, 0, 89, 0, 0, 1, 47, 0, 0, 0, 38, 0, 0, 0, 87, 0, 0, 1, 81, 0, 0, 0, 34,
- 0, 0, 0, 88, 0, 0, 1, 82, 0, 0, 0, 34, 0, 0, 1, 75, 0, 0, 1, 81, 0, 0, 0, 34, 0, 0, 0, 85, 0, 0, 1, 75,
- 0, 0, 0, 34, 0, 0, 0, 86, 0, 0, 1, 76, 0, 0, 0, 34, 0, 0, 1, 76, 0, 0, 1, 82, 0, 0, 0, 34, 0, 0, 1, 71,
- 0, 0, 1, 75, 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 1, 71, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 1, 72, 0, 0, 0, 34,
- 0, 0, 1, 72, 0, 0, 1, 76, 0, 0, 0, 34, 0, 0, 1, 71, 0, 0, 1, 73, 0, 0, 0, 34, 0, 0, 0, 81, 0, 0, 1, 73,
- 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 1, 74, 0, 0, 0, 34, 0, 0, 1, 72, 0, 0, 1, 74, 0, 0, 0, 34, 0, 0, 1, 71,
- 0, 0, 1, 77, 0, 0, 0, 34, 0, 0, 1, 73, 0, 0, 1, 79, 0, 0, 0, 34, 0, 0, 1, 72, 0, 0, 1, 78, 0, 0, 0, 34,
- 0, 0, 1, 74, 0, 0, 1, 80, 0, 0, 0, 34, 0, 0, 1, 67, 0, 0, 1, 73, 0, 0, 0, 34, 0, 0, 1, 67, 0, 0, 1, 69,
- 0, 0, 0, 34, 0, 0, 1, 68, 0, 0, 1, 74, 0, 0, 0, 34, 0, 0, 1, 68, 0, 0, 1, 70, 0, 0, 0, 34, 0, 0, 0, 79,
- 0, 0, 1, 67, 0, 0, 0, 34, 0, 0, 0, 80, 0, 0, 1, 68, 0, 0, 0, 34, 0, 0, 0,206, 0, 0, 1, 83, 0, 0, 0, 34,
- 0, 0, 1, 83, 0, 0, 1, 85, 0, 0, 0, 34, 0, 0, 0,212, 0, 0, 1, 85, 0, 0, 0, 34, 0, 0, 1, 84, 0, 0, 1, 86,
- 0, 0, 0, 34, 0, 0, 0,207, 0, 0, 1, 84, 0, 0, 0, 34, 0, 0, 0,213, 0, 0, 1, 86, 0, 0, 0, 34, 0, 0, 1, 67,
- 0, 0, 1, 83, 0, 0, 0, 34, 0, 0, 1, 68, 0, 0, 1, 84, 0, 0, 0, 34, 0, 0, 1, 85, 0, 0, 1, 87, 0, 0, 0, 34,
- 0, 0, 0, 77, 0, 0, 1, 87, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 1, 88, 0, 0, 0, 34, 0, 0, 1, 86, 0, 0, 1, 88,
- 0, 0, 0, 34, 0, 0, 1, 41, 0, 0, 1, 87, 0, 0, 0, 34, 0, 0, 1, 42, 0, 0, 1, 88, 0, 0, 0, 34, 0, 0, 0, 75,
- 0, 0, 1, 65, 0, 0, 0, 34, 0, 0, 1, 65, 0, 0, 1, 93, 0, 0, 0, 34, 0, 0, 1, 45, 0, 0, 1, 93, 0, 0, 0, 39,
- 0, 0, 0, 75, 0, 0, 1, 45, 0, 0, 0, 38, 0, 0, 1, 66, 0, 0, 1, 94, 0, 0, 0, 34, 0, 0, 0, 75, 0, 0, 1, 66,
- 0, 0, 0, 34, 0, 0, 1, 45, 0, 0, 1, 94, 0, 0, 0, 39, 0, 0, 1, 91, 0, 0, 1, 93, 0, 0, 0, 34, 0, 0, 0, 76,
- 0, 0, 1, 91, 0, 0, 0, 34, 0, 0, 0, 76, 0, 0, 1, 45, 0, 0, 0, 38, 0, 0, 1, 92, 0, 0, 1, 94, 0, 0, 0, 34,
- 0, 0, 0, 76, 0, 0, 1, 92, 0, 0, 0, 34, 0, 0, 1, 89, 0, 0, 1, 91, 0, 0, 0, 34, 0, 0, 1, 46, 0, 0, 1, 89,
- 0, 0, 0, 34, 0, 0, 0, 76, 0, 0, 1, 46, 0, 0, 0, 38, 0, 0, 1, 90, 0, 0, 1, 92, 0, 0, 0, 34, 0, 0, 1, 46,
- 0, 0, 1, 90, 0, 0, 0, 34, 0, 0, 1, 69, 0, 0, 1, 89, 0, 0, 0, 34, 0, 0, 1, 46, 0, 0, 1, 50, 0, 0, 0, 38,
- 0, 0, 1, 70, 0, 0, 1, 90, 0, 0, 0, 34, 0, 0, 1, 83, 0, 0, 1, 89, 0, 0, 0, 34, 0, 0, 1, 84, 0, 0, 1, 90,
- 0, 0, 0, 34, 0, 0, 1, 39, 0, 0, 1, 59, 0, 0, 0, 34, 0, 0, 1, 51, 0, 0, 1, 59, 0, 0, 0, 34, 0, 0, 1, 37,
- 0, 0, 1, 51, 0, 0, 0, 34, 0, 0, 1, 40, 0, 0, 1, 60, 0, 0, 0, 34, 0, 0, 1, 38, 0, 0, 1, 52, 0, 0, 0, 34,
- 0, 0, 1, 52, 0, 0, 1, 60, 0, 0, 0, 34, 0, 0, 0, 74, 0, 0, 1, 57, 0, 0, 0, 39, 0, 0, 1, 57, 0, 0, 1, 65,
- 0, 0, 0, 34, 0, 0, 0, 74, 0, 0, 0, 75, 0, 0, 0, 38, 0, 0, 1, 58, 0, 0, 1, 66, 0, 0, 0, 34, 0, 0, 0, 74,
- 0, 0, 1, 58, 0, 0, 0, 39, 0, 0, 1, 43, 0, 0, 1, 99, 0, 0, 0, 34, 0, 0, 1, 97, 0, 0, 1, 99, 0, 0, 0, 34,
- 0, 0, 1, 44, 0, 0, 1, 97, 0, 0, 0, 34, 0, 0, 1, 43, 0, 0, 1, 44, 0, 0, 0, 38, 0, 0, 1, 98, 0, 0, 1,100,
- 0, 0, 0, 34, 0, 0, 1, 43, 0, 0, 1,100, 0, 0, 0, 34, 0, 0, 1, 44, 0, 0, 1, 98, 0, 0, 0, 34, 0, 0, 1, 95,
- 0, 0, 1, 97, 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 1, 95, 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 1, 44, 0, 0, 0, 38,
- 0, 0, 1, 96, 0, 0, 1, 98, 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 1, 96, 0, 0, 0, 34, 0, 0, 1, 57, 0, 0, 1, 95,
- 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 0, 74, 0, 0, 0, 38, 0, 0, 1, 58, 0, 0, 1, 96, 0, 0, 0, 34, 0, 0, 1, 35,
- 0, 0, 1,103, 0, 0, 0, 34, 0, 0, 1,103, 0, 0, 1,105, 0, 0, 0, 34, 0, 0, 1, 33, 0, 0, 1,105, 0, 0, 0, 34,
- 0, 0, 1, 36, 0, 0, 1,104, 0, 0, 0, 34, 0, 0, 1, 34, 0, 0, 1,106, 0, 0, 0, 34, 0, 0, 1,104, 0, 0, 1,106,
- 0, 0, 0, 34, 0, 0, 1,103, 0, 0, 1,109, 0, 0, 0, 34, 0, 0, 1,107, 0, 0, 1,109, 0, 0, 0, 34, 0, 0, 1,105,
- 0, 0, 1,107, 0, 0, 0, 34, 0, 0, 1,104, 0, 0, 1,110, 0, 0, 0, 34, 0, 0, 1,106, 0, 0, 1,108, 0, 0, 0, 34,
- 0, 0, 1,108, 0, 0, 1,110, 0, 0, 0, 34, 0, 0, 1,109, 0, 0, 1,111, 0, 0, 0, 34, 0, 0, 1,111, 0, 0, 1,113,
- 0, 0, 0, 34, 0, 0, 1,107, 0, 0, 1,113, 0, 0, 0, 34, 0, 0, 1,110, 0, 0, 1,112, 0, 0, 0, 34, 0, 0, 1,108,
- 0, 0, 1,114, 0, 0, 0, 34, 0, 0, 1,112, 0, 0, 1,114, 0, 0, 0, 34, 0, 0, 1,111, 0, 0, 1,117, 0, 0, 0, 34,
- 0, 0, 1,115, 0, 0, 1,117, 0, 0, 0, 34, 0, 0, 1,113, 0, 0, 1,115, 0, 0, 0, 34, 0, 0, 1,112, 0, 0, 1,118,
- 0, 0, 0, 34, 0, 0, 1,114, 0, 0, 1,116, 0, 0, 0, 34, 0, 0, 1,116, 0, 0, 1,118, 0, 0, 0, 34, 0, 0, 1, 55,
- 0, 0, 1,119, 0, 0, 0, 39, 0, 0, 1,115, 0, 0, 1,119, 0, 0, 0, 34, 0, 0, 1, 55, 0, 0, 1,117, 0, 0, 0, 34,
- 0, 0, 1,116, 0, 0, 1,120, 0, 0, 0, 34, 0, 0, 1, 56, 0, 0, 1,120, 0, 0, 0, 39, 0, 0, 1, 56, 0, 0, 1,118,
- 0, 0, 0, 34, 0, 0, 1, 95, 0, 0, 1,115, 0, 0, 0, 34, 0, 0, 1, 57, 0, 0, 1,119, 0, 0, 0, 39, 0, 0, 1, 96,
- 0, 0, 1,116, 0, 0, 0, 34, 0, 0, 1, 58, 0, 0, 1,120, 0, 0, 0, 39, 0, 0, 1, 97, 0, 0, 1,113, 0, 0, 0, 34,
- 0, 0, 1, 98, 0, 0, 1,114, 0, 0, 0, 34, 0, 0, 1, 99, 0, 0, 1,107, 0, 0, 0, 34, 0, 0, 1,100, 0, 0, 1,108,
- 0, 0, 0, 34, 0, 0, 1, 99, 0, 0, 1,101, 0, 0, 0, 34, 0, 0, 1,101, 0, 0, 1,105, 0, 0, 0, 34, 0, 0, 1,102,
- 0, 0, 1,106, 0, 0, 0, 34, 0, 0, 1,100, 0, 0, 1,102, 0, 0, 0, 34, 0, 0, 1, 31, 0, 0, 1,101, 0, 0, 0, 34,
- 0, 0, 1, 32, 0, 0, 1,102, 0, 0, 0, 34, 0, 0, 0, 72, 0, 0, 1,101, 0, 0, 0, 34, 0, 0, 0, 72, 0, 0, 1, 43,
- 0, 0, 0, 38, 0, 0, 0, 72, 0, 0, 1,102, 0, 0, 0, 34, 0, 0, 1, 25, 0, 0, 1, 31, 0, 0, 0, 38, 0, 0, 1, 26,
- 0, 0, 1, 32, 0, 0, 0, 38, 0, 0, 0, 72, 0, 0, 1, 25, 0, 0, 0, 34, 0, 0, 0, 72, 0, 0, 1, 26, 0, 0, 0, 34,
- 0, 0, 0, 71, 0, 0, 0, 72, 0, 0, 0, 38, 0, 0, 1, 51, 0, 0, 1,103, 0, 0, 0, 34, 0, 0, 1, 52, 0, 0, 1,104,
- 0, 0, 0, 34, 0, 0, 1, 51, 0, 0, 1, 53, 0, 0, 0, 34, 0, 0, 1, 53, 0, 0, 1,109, 0, 0, 0, 34, 0, 0, 1, 54,
- 0, 0, 1,110, 0, 0, 0, 34, 0, 0, 1, 52, 0, 0, 1, 54, 0, 0, 0, 34, 0, 0, 1, 53, 0, 0, 1,123, 0, 0, 0, 34,
- 0, 0, 1,111, 0, 0, 1,123, 0, 0, 0, 34, 0, 0, 1,112, 0, 0, 1,124, 0, 0, 0, 34, 0, 0, 1, 54, 0, 0, 1,124,
- 0, 0, 0, 34, 0, 0, 1, 55, 0, 0, 1,123, 0, 0, 0, 34, 0, 0, 1, 56, 0, 0, 1,124, 0, 0, 0, 34, 0, 0, 1, 91,
- 0, 0, 1,127, 0, 0, 0, 34, 0, 0, 1,125, 0, 0, 1,127, 0, 0, 0, 34, 0, 0, 1, 89, 0, 0, 1,125, 0, 0, 0, 34,
- 0, 0, 1, 92, 0, 0, 1,128, 0, 0, 0, 34, 0, 0, 1, 90, 0, 0, 1,126, 0, 0, 0, 34, 0, 0, 1,126, 0, 0, 1,128,
- 0, 0, 0, 34, 0, 0, 1, 59, 0, 0, 1,125, 0, 0, 0, 34, 0, 0, 1, 61, 0, 0, 1,127, 0, 0, 0, 34, 0, 0, 1, 59,
- 0, 0, 1, 61, 0, 0, 0, 34, 0, 0, 1, 60, 0, 0, 1,126, 0, 0, 0, 34, 0, 0, 1, 60, 0, 0, 1, 62, 0, 0, 0, 34,
- 0, 0, 1, 62, 0, 0, 1,128, 0, 0, 0, 34, 0, 0, 1, 41, 0, 0, 1,125, 0, 0, 0, 34, 0, 0, 1, 42, 0, 0, 1,126,
- 0, 0, 0, 34, 0, 0, 1, 41, 0, 0, 1, 85, 0, 0, 0, 34, 0, 0, 1, 83, 0, 0, 1,125, 0, 0, 0, 34, 0, 0, 1, 42,
- 0, 0, 1, 86, 0, 0, 0, 34, 0, 0, 1, 84, 0, 0, 1,126, 0, 0, 0, 34, 0, 0, 1, 55, 0, 0, 1, 63, 0, 0, 0, 34,
- 0, 0, 1, 63, 0, 0, 1,121, 0, 0, 0, 39, 0, 0, 1,119, 0, 0, 1,121, 0, 0, 0, 34, 0, 0, 1, 64, 0, 0, 1,122,
- 0, 0, 0, 39, 0, 0, 1, 56, 0, 0, 1, 64, 0, 0, 0, 34, 0, 0, 1,120, 0, 0, 1,122, 0, 0, 0, 34, 0, 0, 1, 65,
- 0, 0, 1,121, 0, 0, 0, 34, 0, 0, 1, 66, 0, 0, 1,122, 0, 0, 0, 34, 0, 0, 1,121, 0, 0, 1,127, 0, 0, 0, 34,
- 0, 0, 1, 61, 0, 0, 1, 63, 0, 0, 0, 34, 0, 0, 1,122, 0, 0, 1,128, 0, 0, 0, 34, 0, 0, 1, 62, 0, 0, 1, 64,
- 0, 0, 0, 34, 0, 0, 1, 93, 0, 0, 1,121, 0, 0, 0, 39, 0, 0, 1, 94, 0, 0, 1,122, 0, 0, 0, 39, 0, 0, 1,129,
- 0, 0, 1,141, 0, 0, 0, 34, 0, 0, 1,129, 0, 0, 1,155, 0, 0, 0, 34, 0, 0, 1,143, 0, 0, 1,155, 0, 0, 0, 34,
- 0, 0, 1,141, 0, 0, 1,143, 0, 0, 0, 34, 0, 0, 1,130, 0, 0, 1,156, 0, 0, 0, 34, 0, 0, 1,130, 0, 0, 1,142,
- 0, 0, 0, 34, 0, 0, 1,142, 0, 0, 1,144, 0, 0, 0, 34, 0, 0, 1,144, 0, 0, 1,156, 0, 0, 0, 34, 0, 0, 1,143,
- 0, 0, 1,145, 0, 0, 0, 34, 0, 0, 1,139, 0, 0, 1,145, 0, 0, 0, 34, 0, 0, 1,139, 0, 0, 1,141, 0, 0, 0, 34,
- 0, 0, 1,144, 0, 0, 1,146, 0, 0, 0, 34, 0, 0, 1,140, 0, 0, 1,142, 0, 0, 0, 34, 0, 0, 1,140, 0, 0, 1,146,
- 0, 0, 0, 34, 0, 0, 1,145, 0, 0, 1,147, 0, 0, 0, 34, 0, 0, 1,137, 0, 0, 1,147, 0, 0, 0, 34, 0, 0, 1,137,
- 0, 0, 1,139, 0, 0, 0, 34, 0, 0, 1,146, 0, 0, 1,148, 0, 0, 0, 34, 0, 0, 1,138, 0, 0, 1,140, 0, 0, 0, 34,
- 0, 0, 1,138, 0, 0, 1,148, 0, 0, 0, 34, 0, 0, 1,147, 0, 0, 1,149, 0, 0, 0, 34, 0, 0, 1,135, 0, 0, 1,149,
- 0, 0, 0, 34, 0, 0, 1,135, 0, 0, 1,137, 0, 0, 0, 34, 0, 0, 1,148, 0, 0, 1,150, 0, 0, 0, 34, 0, 0, 1,136,
- 0, 0, 1,138, 0, 0, 0, 34, 0, 0, 1,136, 0, 0, 1,150, 0, 0, 0, 34, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 0, 34,
- 0, 0, 1,133, 0, 0, 1,151, 0, 0, 0, 34, 0, 0, 1,133, 0, 0, 1,135, 0, 0, 0, 34, 0, 0, 1,150, 0, 0, 1,152,
- 0, 0, 0, 34, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 0, 34, 0, 0, 1,134, 0, 0, 1,152, 0, 0, 0, 34, 0, 0, 1,151,
- 0, 0, 1,153, 0, 0, 0, 34, 0, 0, 1,131, 0, 0, 1,153, 0, 0, 0, 34, 0, 0, 1,131, 0, 0, 1,133, 0, 0, 0, 34,
- 0, 0, 1,152, 0, 0, 1,154, 0, 0, 0, 34, 0, 0, 1,132, 0, 0, 1,134, 0, 0, 0, 34, 0, 0, 1,132, 0, 0, 1,154,
- 0, 0, 0, 34, 0, 0, 1,151, 0, 0, 1,161, 0, 0, 0, 34, 0, 0, 1,159, 0, 0, 1,161, 0, 0, 0, 34, 0, 0, 1,153,
- 0, 0, 1,159, 0, 0, 0, 34, 0, 0, 1,160, 0, 0, 1,162, 0, 0, 0, 34, 0, 0, 1,152, 0, 0, 1,162, 0, 0, 0, 34,
- 0, 0, 1,154, 0, 0, 1,160, 0, 0, 0, 34, 0, 0, 1,149, 0, 0, 1,163, 0, 0, 0, 34, 0, 0, 1,161, 0, 0, 1,163,
- 0, 0, 0, 34, 0, 0, 1,162, 0, 0, 1,164, 0, 0, 0, 34, 0, 0, 1,150, 0, 0, 1,164, 0, 0, 0, 34, 0, 0, 1,147,
- 0, 0, 1,165, 0, 0, 0, 34, 0, 0, 1,163, 0, 0, 1,165, 0, 0, 0, 34, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 0, 34,
- 0, 0, 1,148, 0, 0, 1,166, 0, 0, 0, 34, 0, 0, 1,145, 0, 0, 1,167, 0, 0, 0, 34, 0, 0, 1,165, 0, 0, 1,167,
- 0, 0, 0, 34, 0, 0, 1,166, 0, 0, 1,168, 0, 0, 0, 34, 0, 0, 1,146, 0, 0, 1,168, 0, 0, 0, 34, 0, 0, 1,143,
- 0, 0, 1,169, 0, 0, 0, 34, 0, 0, 1,167, 0, 0, 1,169, 0, 0, 0, 34, 0, 0, 1,168, 0, 0, 1,170, 0, 0, 0, 34,
- 0, 0, 1,144, 0, 0, 1,170, 0, 0, 0, 34, 0, 0, 1,155, 0, 0, 1,157, 0, 0, 0, 34, 0, 0, 1,157, 0, 0, 1,169,
- 0, 0, 0, 34, 0, 0, 1,156, 0, 0, 1,158, 0, 0, 0, 34, 0, 0, 1,158, 0, 0, 1,170, 0, 0, 0, 34, 0, 0, 1, 61,
- 0, 0, 1,185, 0, 0, 0, 34, 0, 0, 1,183, 0, 0, 1,185, 0, 0, 0, 34, 0, 0, 1, 59, 0, 0, 1,183, 0, 0, 0, 34,
- 0, 0, 1, 62, 0, 0, 1,186, 0, 0, 0, 34, 0, 0, 1, 60, 0, 0, 1,184, 0, 0, 0, 34, 0, 0, 1,184, 0, 0, 1,186,
- 0, 0, 0, 34, 0, 0, 1, 61, 0, 0, 1,131, 0, 0, 0, 34, 0, 0, 1,153, 0, 0, 1,185, 0, 0, 0, 34, 0, 0, 1, 62,
- 0, 0, 1,132, 0, 0, 0, 34, 0, 0, 1,154, 0, 0, 1,186, 0, 0, 0, 34, 0, 0, 1, 53, 0, 0, 1,183, 0, 0, 0, 34,
- 0, 0, 1, 54, 0, 0, 1,184, 0, 0, 0, 34, 0, 0, 1,123, 0, 0, 1,171, 0, 0, 0, 34, 0, 0, 1,155, 0, 0, 1,171,
- 0, 0, 0, 34, 0, 0, 1,123, 0, 0, 1,129, 0, 0, 0, 34, 0, 0, 1,156, 0, 0, 1,172, 0, 0, 0, 34, 0, 0, 1,124,
- 0, 0, 1,172, 0, 0, 0, 34, 0, 0, 1,124, 0, 0, 1,130, 0, 0, 0, 34, 0, 0, 1,159, 0, 0, 1,181, 0, 0, 0, 34,
- 0, 0, 1,181, 0, 0, 1,185, 0, 0, 0, 34, 0, 0, 1,160, 0, 0, 1,182, 0, 0, 0, 34, 0, 0, 1,182, 0, 0, 1,186,
- 0, 0, 0, 34, 0, 0, 1,179, 0, 0, 1,187, 0, 0, 0, 34, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 0, 34, 0, 0, 1,179,
- 0, 0, 1,181, 0, 0, 0, 34, 0, 0, 1,186, 0, 0, 1,188, 0, 0, 0, 34, 0, 0, 1,180, 0, 0, 1,188, 0, 0, 0, 34,
- 0, 0, 1,180, 0, 0, 1,182, 0, 0, 0, 34, 0, 0, 1,175, 0, 0, 1,187, 0, 0, 0, 34, 0, 0, 1,177, 0, 0, 1,179,
- 0, 0, 0, 34, 0, 0, 1,175, 0, 0, 1,177, 0, 0, 0, 34, 0, 0, 1,176, 0, 0, 1,188, 0, 0, 0, 34, 0, 0, 1,176,
- 0, 0, 1,178, 0, 0, 0, 34, 0, 0, 1,178, 0, 0, 1,180, 0, 0, 0, 34, 0, 0, 1,173, 0, 0, 1,189, 0, 0, 0, 34,
- 0, 0, 1,187, 0, 0, 1,189, 0, 0, 0, 34, 0, 0, 1,173, 0, 0, 1,175, 0, 0, 0, 34, 0, 0, 1,188, 0, 0, 1,190,
- 0, 0, 0, 34, 0, 0, 1,174, 0, 0, 1,190, 0, 0, 0, 34, 0, 0, 1,174, 0, 0, 1,176, 0, 0, 0, 34, 0, 0, 1,171,
- 0, 0, 1,189, 0, 0, 0, 34, 0, 0, 1,173, 0, 0, 1,191, 0, 0, 0, 34, 0, 0, 1,171, 0, 0, 1,191, 0, 0, 0, 32,
- 0, 0, 1,172, 0, 0, 1,190, 0, 0, 0, 34, 0, 0, 1,172, 0, 0, 1,192, 0, 0, 0, 32, 0, 0, 1,174, 0, 0, 1,192,
- 0, 0, 0, 34, 0, 0, 1,157, 0, 0, 1,191, 0, 0, 0, 34, 0, 0, 1,158, 0, 0, 1,192, 0, 0, 0, 34, 0, 0, 1, 53,
- 0, 0, 1,189, 0, 0, 0, 34, 0, 0, 1, 54, 0, 0, 1,190, 0, 0, 0, 34, 0, 0, 1,183, 0, 0, 1,187, 0, 0, 0, 34,
- 0, 0, 1,184, 0, 0, 1,188, 0, 0, 0, 34, 0, 0, 1,191, 0, 0, 1,193, 0, 0, 0, 34, 0, 0, 1,193, 0, 0, 1,217,
- 0, 0, 0, 34, 0, 0, 1,157, 0, 0, 1,217, 0, 0, 0, 34, 0, 0, 1,192, 0, 0, 1,194, 0, 0, 0, 34, 0, 0, 1,158,
- 0, 0, 1,218, 0, 0, 0, 34, 0, 0, 1,194, 0, 0, 1,218, 0, 0, 0, 34, 0, 0, 1,173, 0, 0, 1,203, 0, 0, 0, 34,
- 0, 0, 1,193, 0, 0, 1,203, 0, 0, 0, 34, 0, 0, 1,174, 0, 0, 1,204, 0, 0, 0, 34, 0, 0, 1,194, 0, 0, 1,204,
- 0, 0, 0, 34, 0, 0, 1,175, 0, 0, 1,201, 0, 0, 0, 34, 0, 0, 1,201, 0, 0, 1,203, 0, 0, 0, 34, 0, 0, 1,176,
- 0, 0, 1,202, 0, 0, 0, 34, 0, 0, 1,202, 0, 0, 1,204, 0, 0, 0, 34, 0, 0, 1,177, 0, 0, 1,199, 0, 0, 0, 34,
- 0, 0, 1,199, 0, 0, 1,201, 0, 0, 0, 34, 0, 0, 1,178, 0, 0, 1,200, 0, 0, 0, 34, 0, 0, 1,200, 0, 0, 1,202,
- 0, 0, 0, 34, 0, 0, 1,179, 0, 0, 1,197, 0, 0, 0, 34, 0, 0, 1,197, 0, 0, 1,199, 0, 0, 0, 34, 0, 0, 1,180,
- 0, 0, 1,198, 0, 0, 0, 34, 0, 0, 1,198, 0, 0, 1,200, 0, 0, 0, 34, 0, 0, 1,181, 0, 0, 1,195, 0, 0, 0, 34,
- 0, 0, 1,195, 0, 0, 1,197, 0, 0, 0, 34, 0, 0, 1,182, 0, 0, 1,196, 0, 0, 0, 34, 0, 0, 1,196, 0, 0, 1,198,
- 0, 0, 0, 34, 0, 0, 1,159, 0, 0, 1,215, 0, 0, 0, 34, 0, 0, 1,195, 0, 0, 1,215, 0, 0, 0, 34, 0, 0, 1,160,
- 0, 0, 1,216, 0, 0, 0, 34, 0, 0, 1,196, 0, 0, 1,216, 0, 0, 0, 34, 0, 0, 1,205, 0, 0, 1,217, 0, 0, 0, 34,
- 0, 0, 1,169, 0, 0, 1,205, 0, 0, 0, 34, 0, 0, 1,170, 0, 0, 1,206, 0, 0, 0, 34, 0, 0, 1,206, 0, 0, 1,218,
- 0, 0, 0, 34, 0, 0, 1,205, 0, 0, 1,207, 0, 0, 0, 34, 0, 0, 1,167, 0, 0, 1,207, 0, 0, 0, 34, 0, 0, 1,168,
- 0, 0, 1,208, 0, 0, 0, 34, 0, 0, 1,206, 0, 0, 1,208, 0, 0, 0, 34, 0, 0, 1,207, 0, 0, 1,209, 0, 0, 0, 34,
- 0, 0, 1,165, 0, 0, 1,209, 0, 0, 0, 34, 0, 0, 1,166, 0, 0, 1,210, 0, 0, 0, 34, 0, 0, 1,208, 0, 0, 1,210,
- 0, 0, 0, 34, 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 34, 0, 0, 1,163, 0, 0, 1,211, 0, 0, 0, 34, 0, 0, 1,164,
- 0, 0, 1,212, 0, 0, 0, 34, 0, 0, 1,210, 0, 0, 1,212, 0, 0, 0, 34, 0, 0, 1,211, 0, 0, 1,213, 0, 0, 0, 34,
- 0, 0, 1,161, 0, 0, 1,213, 0, 0, 0, 34, 0, 0, 1,162, 0, 0, 1,214, 0, 0, 0, 34, 0, 0, 1,212, 0, 0, 1,214,
- 0, 0, 0, 34, 0, 0, 1,213, 0, 0, 1,215, 0, 0, 0, 34, 0, 0, 1,214, 0, 0, 1,216, 0, 0, 0, 34, 0, 0, 1,197,
- 0, 0, 1,221, 0, 0, 0, 34, 0, 0, 1,219, 0, 0, 1,221, 0, 0, 0, 34, 0, 0, 1,199, 0, 0, 1,219, 0, 0, 0, 34,
- 0, 0, 1,198, 0, 0, 1,222, 0, 0, 0, 34, 0, 0, 1,200, 0, 0, 1,220, 0, 0, 0, 34, 0, 0, 1,220, 0, 0, 1,222,
- 0, 0, 0, 34, 0, 0, 1,221, 0, 0, 1,223, 0, 0, 0, 34, 0, 0, 1,223, 0, 0, 1,225, 0, 0, 0, 32, 0, 0, 1,219,
- 0, 0, 1,225, 0, 0, 0, 34, 0, 0, 1,222, 0, 0, 1,224, 0, 0, 0, 34, 0, 0, 1,220, 0, 0, 1,226, 0, 0, 0, 34,
- 0, 0, 1,224, 0, 0, 1,226, 0, 0, 0, 32, 0, 0, 1,223, 0, 0, 1,229, 0, 0, 0, 34, 0, 0, 1,227, 0, 0, 1,229,
- 0, 0, 0, 34, 0, 0, 1,225, 0, 0, 1,227, 0, 0, 0, 34, 0, 0, 1,224, 0, 0, 1,230, 0, 0, 0, 34, 0, 0, 1,226,
- 0, 0, 1,228, 0, 0, 0, 34, 0, 0, 1,228, 0, 0, 1,230, 0, 0, 0, 34, 0, 0, 1,229, 0, 0, 1,231, 0, 0, 0, 34,
- 0, 0, 1,231, 0, 0, 1,233, 0, 0, 0, 34, 0, 0, 1,227, 0, 0, 1,233, 0, 0, 0, 34, 0, 0, 1,230, 0, 0, 1,232,
- 0, 0, 0, 34, 0, 0, 1,228, 0, 0, 1,234, 0, 0, 0, 34, 0, 0, 1,232, 0, 0, 1,234, 0, 0, 0, 34, 0, 0, 1,217,
- 0, 0, 1,227, 0, 0, 0, 34, 0, 0, 1,205, 0, 0, 1,233, 0, 0, 0, 34, 0, 0, 1,218, 0, 0, 1,228, 0, 0, 0, 34,
- 0, 0, 1,206, 0, 0, 1,234, 0, 0, 0, 34, 0, 0, 1,193, 0, 0, 1,225, 0, 0, 0, 34, 0, 0, 1,194, 0, 0, 1,226,
- 0, 0, 0, 34, 0, 0, 1,203, 0, 0, 1,219, 0, 0, 0, 34, 0, 0, 1,204, 0, 0, 1,220, 0, 0, 0, 34, 0, 0, 1,215,
- 0, 0, 1,221, 0, 0, 0, 34, 0, 0, 1,216, 0, 0, 1,222, 0, 0, 0, 34, 0, 0, 1,213, 0, 0, 1,223, 0, 0, 0, 34,
- 0, 0, 1,214, 0, 0, 1,224, 0, 0, 0, 34, 0, 0, 1,211, 0, 0, 1,229, 0, 0, 0, 34, 0, 0, 1,212, 0, 0, 1,230,
- 0, 0, 0, 34, 0, 0, 1,209, 0, 0, 1,231, 0, 0, 0, 34, 0, 0, 1,210, 0, 0, 1,232, 0, 0, 0, 34, 0, 0, 1,207,
- 0, 0, 1,233, 0, 0, 0, 34, 0, 0, 1,208, 0, 0, 1,234, 0, 0, 0, 34, 0, 0, 1,131, 0, 0, 1,245, 0, 0, 0, 34,
- 0, 0, 1,243, 0, 0, 1,245, 0, 0, 0, 39, 0, 0, 1,133, 0, 0, 1,243, 0, 0, 0, 34, 0, 0, 1,132, 0, 0, 1,246,
- 0, 0, 0, 34, 0, 0, 1,134, 0, 0, 1,244, 0, 0, 0, 34, 0, 0, 1,244, 0, 0, 1,246, 0, 0, 0, 39, 0, 0, 1,241,
- 0, 0, 1,243, 0, 0, 0, 39, 0, 0, 1,135, 0, 0, 1,241, 0, 0, 0, 34, 0, 0, 1,136, 0, 0, 1,242, 0, 0, 0, 34,
- 0, 0, 1,242, 0, 0, 1,244, 0, 0, 0, 39, 0, 0, 1,239, 0, 0, 1,241, 0, 0, 0, 39, 0, 0, 1,137, 0, 0, 1,239,
- 0, 0, 0, 34, 0, 0, 1,138, 0, 0, 1,240, 0, 0, 0, 34, 0, 0, 1,240, 0, 0, 1,242, 0, 0, 0, 39, 0, 0, 1,237,
- 0, 0, 1,239, 0, 0, 0, 39, 0, 0, 1,139, 0, 0, 1,237, 0, 0, 0, 34, 0, 0, 1,140, 0, 0, 1,238, 0, 0, 0, 34,
- 0, 0, 1,238, 0, 0, 1,240, 0, 0, 0, 39, 0, 0, 1,235, 0, 0, 1,237, 0, 0, 0, 39, 0, 0, 1,141, 0, 0, 1,235,
- 0, 0, 0, 34, 0, 0, 1,142, 0, 0, 1,236, 0, 0, 0, 34, 0, 0, 1,236, 0, 0, 1,238, 0, 0, 0, 39, 0, 0, 1,235,
- 0, 0, 1,247, 0, 0, 0, 39, 0, 0, 1,129, 0, 0, 1,247, 0, 0, 0, 34, 0, 0, 1,130, 0, 0, 1,248, 0, 0, 0, 34,
- 0, 0, 1,236, 0, 0, 1,248, 0, 0, 0, 39, 0, 0, 1,235, 0, 0, 1,243, 0, 0, 0, 34, 0, 0, 1,245, 0, 0, 1,247,
- 0, 0, 0, 34, 0, 0, 1,236, 0, 0, 1,244, 0, 0, 0, 34, 0, 0, 1,246, 0, 0, 1,248, 0, 0, 0, 34, 0, 0, 1,237,
- 0, 0, 1,241, 0, 0, 0, 34, 0, 0, 1,238, 0, 0, 1,242, 0, 0, 0, 34, 0, 0, 1, 55, 0, 0, 1,247, 0, 0, 0, 39,
- 0, 0, 1, 56, 0, 0, 1,248, 0, 0, 0, 39, 0, 0, 1, 63, 0, 0, 1,245, 0, 0, 0, 39, 0, 0, 1, 64, 0, 0, 1,246,
- 0, 0, 0, 39, 0, 0, 0, 14, 0, 0, 0,249, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0,178, 0, 0, 0, 34, 0, 0, 0, 14,
- 0, 0, 0,113, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0,161, 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0,112, 0, 0, 0, 34,
- 0, 0, 0, 16, 0, 0, 0,112, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0,112, 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0,112,
- 0, 0, 0, 34, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,108,112, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,160,128, 32, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,117,208, 32, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7,160,168, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 39, 16, 7,160,128, 32, 0, 0, 0, 54, 0, 0, 1,244, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 2, 0, 0, 0, 43, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 46, 0, 0, 0, 44, 0, 0, 0, 1,
- 0, 0, 0, 43, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 41, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 44,
- 0, 0, 0, 42, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 7,
- 0, 0, 0, 9, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 8, 0, 0, 0, 2,
- 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 12,
- 0, 0, 0, 14, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,112, 0, 0, 0, 13, 0, 0, 0, 11, 0, 0, 0, 9, 0, 0, 0, 1,
- 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0,112, 0, 0, 0, 9,
- 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0, 19, 0, 0, 0, 17, 0, 0, 0, 15, 0, 0, 0, 1, 0, 0, 0, 18,
- 0, 0, 0, 20, 0, 0, 0,112, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 21, 0, 0, 0, 19, 0, 0, 0, 14,
- 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 22, 0, 0, 0, 13, 0, 0, 0,112, 0, 0, 0, 1, 0, 0, 0, 21, 0, 0, 0, 23,
- 0, 0, 0, 25, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 26, 0, 0, 0, 24, 0, 0, 0, 22, 0, 0, 0, 20, 0, 0, 0, 1,
- 0, 0, 0, 19, 0, 0, 0, 25, 0, 0, 0, 27, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 26, 0, 0, 0, 20,
- 0, 0, 0, 18, 0, 0, 0, 1, 0, 0, 0, 25, 0, 0, 0, 31, 0, 0, 0, 29, 0, 0, 0, 27, 0, 0, 0, 1, 0, 0, 0, 30,
- 0, 0, 0, 32, 0, 0, 0, 26, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0, 23, 0, 0, 0, 33, 0, 0, 0, 31, 0, 0, 0, 25,
- 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 33, 0, 0, 0, 35,
- 0, 0, 0, 37, 0, 0, 0, 31, 0, 0, 0, 1, 0, 0, 0, 38, 0, 0, 0, 36, 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 1,
- 0, 0, 0, 31, 0, 0, 0, 37, 0, 0, 0, 39, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 40, 0, 0, 0, 38, 0, 0, 0, 32,
- 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 37, 0, 0, 0, 43, 0, 0, 0, 41, 0, 0, 0, 39, 0, 0, 0, 1, 0, 0, 0, 42,
- 0, 0, 0, 44, 0, 0, 0, 38, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 0, 43, 0, 0, 0, 37,
- 0, 0, 0, 1, 0, 0, 0, 44, 0, 0, 0, 46, 0, 0, 0, 36, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0, 45, 0, 0, 0, 35,
- 0, 0, 0, 49, 0, 0, 0, 47, 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0, 36, 0, 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 1,
- 0, 0, 0, 35, 0, 0, 0, 33, 0, 0, 0, 51, 0, 0, 0, 49, 0, 0, 0, 1, 0, 0, 0, 52, 0, 0, 0, 34, 0, 0, 0, 36,
- 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, 33, 0, 0, 0, 23, 0, 0, 0, 53, 0, 0, 0, 51, 0, 0, 0, 1, 0, 0, 0, 54,
- 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, 23, 0, 0, 0, 21, 0, 0, 0, 55, 0, 0, 0, 53,
- 0, 0, 0, 1, 0, 0, 0, 56, 0, 0, 0, 22, 0, 0, 0, 24, 0, 0, 0, 54, 0, 0, 0, 1, 0, 0, 0, 21, 0, 0, 0, 12,
- 0, 0, 0, 57, 0, 0, 0, 55, 0, 0, 0, 1, 0, 0, 0, 58, 0, 0, 0, 13, 0, 0, 0, 22, 0, 0, 0, 56, 0, 0, 0, 1,
- 0, 0, 0, 12, 0, 0, 0, 10, 0, 0, 0, 61, 0, 0, 0, 57, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 0, 11, 0, 0, 0, 13,
- 0, 0, 0, 58, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 61, 0, 0, 0, 1, 0, 0, 0, 64,
- 0, 0, 0, 1, 0, 0, 0, 11, 0, 0, 0, 62, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 47, 0, 0, 0, 63,
- 0, 0, 0, 1, 0, 0, 0, 48, 0, 0, 0, 46, 0, 0, 0, 1, 0, 0, 0, 64, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 63,
- 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 61, 0, 0, 0, 63, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 60, 0, 0, 0, 64, 0, 0, 0, 62,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62,
- 0, 0, 0, 58, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 55, 0, 0, 0, 57, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 58, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 53,
- 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 56, 0, 0, 0, 54, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 59, 0, 0, 0, 51, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 54, 0, 0, 0, 52, 0, 0, 0, 60,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 49, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 52,
- 0, 0, 0, 50, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 59, 0, 0, 0, 47, 0, 0, 0, 49, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0, 48, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 87, 0, 0, 0,171,
- 0, 0, 0,173, 0, 0, 0, 89, 0, 0, 0, 1, 0, 0, 0,173, 0, 0, 0,172, 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 1,
- 0, 0, 0, 85, 0, 0, 0,169, 0, 0, 0,171, 0, 0, 0, 87, 0, 0, 0, 1, 0, 0, 0,172, 0, 0, 0,170, 0, 0, 0, 86,
- 0, 0, 0, 88, 0, 0, 0, 1, 0, 0, 0, 83, 0, 0, 0,167, 0, 0, 0,169, 0, 0, 0, 85, 0, 0, 0, 1, 0, 0, 0,170,
- 0, 0, 0,168, 0, 0, 0, 84, 0, 0, 0, 86, 0, 0, 0, 1, 0, 0, 0, 81, 0, 0, 0,165, 0, 0, 0,167, 0, 0, 0, 83,
- 0, 0, 0, 1, 0, 0, 0,168, 0, 0, 0,166, 0, 0, 0, 82, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 79, 0, 0, 0,163,
- 0, 0, 0,165, 0, 0, 0, 81, 0, 0, 0, 1, 0, 0, 0,166, 0, 0, 0,164, 0, 0, 0, 80, 0, 0, 0, 82, 0, 0, 0, 1,
- 0, 0, 0, 77, 0, 0, 0, 90, 0, 0, 0,143, 0, 0, 0,161, 0, 0, 0, 1, 0, 0, 0,144, 0, 0, 0, 91, 0, 0, 0, 78,
- 0, 0, 0,162, 0, 0, 0, 1, 0, 0, 0, 90, 0, 0, 0, 92, 0, 0, 0,145, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0,146,
- 0, 0, 0, 93, 0, 0, 0, 91, 0, 0, 0,144, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0, 94, 0, 0, 0,147, 0, 0, 0,145,
- 0, 0, 0, 1, 0, 0, 0,148, 0, 0, 0, 95, 0, 0, 0, 93, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 94, 0, 0, 0, 96,
- 0, 0, 0,149, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0,150, 0, 0, 0, 97, 0, 0, 0, 95, 0, 0, 0,148, 0, 0, 0, 1,
- 0, 0, 0, 96, 0, 0, 0, 98, 0, 0, 0,151, 0, 0, 0,149, 0, 0, 0, 1, 0, 0, 0,152, 0, 0, 0, 99, 0, 0, 0, 97,
- 0, 0, 0,150, 0, 0, 0, 1, 0, 0, 0, 98, 0, 0, 0,100, 0, 0, 0,153, 0, 0, 0,151, 0, 0, 0, 1, 0, 0, 0,154,
- 0, 0, 0,101, 0, 0, 0, 99, 0, 0, 0,152, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0,102, 0, 0, 0,155, 0, 0, 0,153,
- 0, 0, 0, 1, 0, 0, 0,156, 0, 0, 0,103, 0, 0, 0,101, 0, 0, 0,154, 0, 0, 0, 1, 0, 0, 0,102, 0, 0, 0,104,
- 0, 0, 0,157, 0, 0, 0,155, 0, 0, 0, 1, 0, 0, 0,158, 0, 0, 0,105, 0, 0, 0,103, 0, 0, 0,156, 0, 0, 0, 1,
- 0, 0, 0,104, 0, 0, 0,106, 0, 0, 0,159, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,160, 0, 0, 0,107, 0, 0, 0,105,
- 0, 0, 0,158, 0, 0, 0, 1, 0, 0, 0,106, 0, 0, 0, 65, 0, 0, 0, 66, 0, 0, 0,159, 0, 0, 0, 1, 0, 0, 0, 66,
- 0, 0, 0, 65, 0, 0, 0,107, 0, 0, 0,160, 0, 0, 0, 1, 0, 0, 0,108, 0, 0, 0,125, 0, 0, 0,157, 0, 0, 0,159,
- 0, 0, 0, 1, 0, 0, 0,158, 0, 0, 0,126, 0, 0, 0,109, 0, 0, 0,160, 0, 0, 0, 1, 0, 0, 0,125, 0, 0, 0,176,
- 0, 0, 0,155, 0, 0, 0,157, 0, 0, 0, 1, 0, 0, 0,156, 0, 0, 0,177, 0, 0, 0,126, 0, 0, 0,158, 0, 0, 0, 1,
- 0, 0, 0,123, 0, 0, 0,153, 0, 0, 0,155, 0, 0, 0,176, 0, 0, 0, 1, 0, 0, 0,156, 0, 0, 0,154, 0, 0, 0,124,
- 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0,121, 0, 0, 0,151, 0, 0, 0,153, 0, 0, 0,123, 0, 0, 0, 1, 0, 0, 0,154,
- 0, 0, 0,152, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, 1, 0, 0, 0,119, 0, 0, 0,149, 0, 0, 0,151, 0, 0, 0,121,
- 0, 0, 0, 1, 0, 0, 0,152, 0, 0, 0,150, 0, 0, 0,120, 0, 0, 0,122, 0, 0, 0, 1, 0, 0, 0,117, 0, 0, 0,147,
- 0, 0, 0,149, 0, 0, 0,119, 0, 0, 0, 1, 0, 0, 0,150, 0, 0, 0,148, 0, 0, 0,118, 0, 0, 0,120, 0, 0, 0, 1,
- 0, 0, 0,115, 0, 0, 0,145, 0, 0, 0,147, 0, 0, 0,117, 0, 0, 0, 1, 0, 0, 0,148, 0, 0, 0,146, 0, 0, 0,116,
- 0, 0, 0,118, 0, 0, 0, 1, 0, 0, 0,113, 0, 0, 0,143, 0, 0, 0,145, 0, 0, 0,115, 0, 0, 0, 1, 0, 0, 0,146,
- 0, 0, 0,144, 0, 0, 0,114, 0, 0, 0,116, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0,161, 0, 0, 0,143, 0, 0, 0,113,
- 0, 0, 0, 1, 0, 0, 0,144, 0, 0, 0,162, 0, 0, 0,112, 0, 0, 0,114, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0,178,
- 0, 0, 0,174, 0, 0, 0,161, 0, 0, 0, 1, 0, 0, 0,174, 0, 0, 0,179, 0, 0, 0,112, 0, 0, 0,162, 0, 0, 0, 1,
- 0, 0, 0,108, 0, 0, 0,159, 0, 0, 0, 66, 0, 0, 0,110, 0, 0, 0, 1, 0, 0, 0, 66, 0, 0, 0,160, 0, 0, 0,109,
- 0, 0, 0,111, 0, 0, 0, 1, 0, 0, 0,110, 0, 0, 0, 66, 0, 0, 0,175, 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0,175,
- 0, 0, 0, 66, 0, 0, 0,111, 0, 0, 0,181, 0, 0, 0, 1, 0, 0, 0,174, 0, 0, 0,178, 0, 0, 0,180, 0, 0, 0,175,
- 0, 0, 0, 1, 0, 0, 0,181, 0, 0, 0,179, 0, 0, 0,174, 0, 0, 0,175, 0, 0, 0, 1, 0, 0, 0,132, 0, 0, 0,134,
- 0, 0, 0,173, 0, 0, 0,171, 0, 0, 0, 1, 0, 0, 0,173, 0, 0, 0,134, 0, 0, 0,133, 0, 0, 0,172, 0, 0, 0, 1,
- 0, 0, 0,130, 0, 0, 0,132, 0, 0, 0,171, 0, 0, 0,169, 0, 0, 0, 1, 0, 0, 0,172, 0, 0, 0,133, 0, 0, 0,131,
- 0, 0, 0,170, 0, 0, 0, 1, 0, 0, 0,128, 0, 0, 0,130, 0, 0, 0,169, 0, 0, 0,167, 0, 0, 0, 1, 0, 0, 0,170,
- 0, 0, 0,131, 0, 0, 0,129, 0, 0, 0,168, 0, 0, 0, 1, 0, 0, 0,163, 0, 0, 0,184, 0, 0, 0,182, 0, 0, 0,165,
- 0, 0, 0, 1, 0, 0, 0,183, 0, 0, 0,185, 0, 0, 0,164, 0, 0, 0,166, 0, 0, 0, 1, 0, 0, 0,128, 0, 0, 0,167,
- 0, 0, 0,165, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0,166, 0, 0, 0,168, 0, 0, 0,129, 0, 0, 0,183, 0, 0, 0, 1,
- 0, 0, 0,141, 0, 0, 0,187, 0, 0, 0,186, 0, 0, 0,184, 0, 0, 0, 1, 0, 0, 0,186, 0, 0, 0,187, 0, 0, 0,142,
- 0, 0, 0,185, 0, 0, 0, 1, 0, 0, 0,182, 0, 0, 0,184, 0, 0, 0,186, 0, 0, 0, 67, 0, 0, 0, 1, 0, 0, 0,186,
- 0, 0, 0,185, 0, 0, 0,183, 0, 0, 0, 67, 0, 0, 0, 1, 0, 0, 0,127, 0, 0, 0,128, 0, 0, 0,182, 0, 0, 0, 67,
- 0, 0, 0, 1, 0, 0, 0,183, 0, 0, 0,129, 0, 0, 0,127, 0, 0, 0, 67, 0, 0, 0, 1, 0, 0, 0,139, 0, 0, 0,190,
- 0, 0, 0,188, 0, 0, 0,141, 0, 0, 0, 1, 0, 0, 0,189, 0, 0, 0,191, 0, 0, 0,140, 0, 0, 0,142, 0, 0, 0, 1,
- 0, 0, 0,137, 0, 0, 0,192, 0, 0, 0,190, 0, 0, 0,139, 0, 0, 0, 1, 0, 0, 0,191, 0, 0, 0,193, 0, 0, 0,138,
- 0, 0, 0,140, 0, 0, 0, 1, 0, 0, 0,136, 0, 0, 0,194, 0, 0, 0,192, 0, 0, 0,137, 0, 0, 0, 1, 0, 0, 0,193,
- 0, 0, 0,195, 0, 0, 0,136, 0, 0, 0,138, 0, 0, 0, 1, 0, 0, 0,135, 0, 0, 0, 69, 0, 0, 0,194, 0, 0, 0,136,
- 0, 0, 0, 1, 0, 0, 0,195, 0, 0, 0, 69, 0, 0, 0,135, 0, 0, 0,136, 0, 0, 0, 1, 0, 0, 0,187, 0, 0, 0,141,
- 0, 0, 0,188, 0, 0, 0, 68, 0, 0, 0, 1, 0, 0, 0,189, 0, 0, 0,142, 0, 0, 0,187, 0, 0, 0, 68, 0, 0, 0, 1,
- 0, 0, 0, 68, 0, 0, 0,188, 0, 0, 0,203, 0, 0, 0,205, 0, 0, 0, 1, 0, 0, 0,204, 0, 0, 0,189, 0, 0, 0, 68,
- 0, 0, 0,205, 0, 0, 0, 1, 0, 0, 0, 69, 0, 0, 0,196, 0, 0, 0,197, 0, 0, 0,194, 0, 0, 0, 1, 0, 0, 0,198,
- 0, 0, 0,196, 0, 0, 0, 69, 0, 0, 0,195, 0, 0, 0, 1, 0, 0, 0,194, 0, 0, 0,197, 0, 0, 0,199, 0, 0, 0,192,
- 0, 0, 0, 1, 0, 0, 0,200, 0, 0, 0,198, 0, 0, 0,195, 0, 0, 0,193, 0, 0, 0, 1, 0, 0, 0,192, 0, 0, 0,199,
- 0, 0, 0,201, 0, 0, 0,190, 0, 0, 0, 1, 0, 0, 0,202, 0, 0, 0,200, 0, 0, 0,193, 0, 0, 0,191, 0, 0, 0, 1,
- 0, 0, 0,190, 0, 0, 0,201, 0, 0, 0,203, 0, 0, 0,188, 0, 0, 0, 1, 0, 0, 0,204, 0, 0, 0,202, 0, 0, 0,191,
- 0, 0, 0,189, 0, 0, 0, 1, 0, 0, 0,196, 0, 0, 0,201, 0, 0, 0,199, 0, 0, 0,197, 0, 0, 0, 1, 0, 0, 0,200,
- 0, 0, 0,202, 0, 0, 0,196, 0, 0, 0,198, 0, 0, 0, 1, 0, 0, 0,196, 0, 0, 0,205, 0, 0, 0,203, 0, 0, 0,201,
- 0, 0, 0, 1, 0, 0, 0,204, 0, 0, 0,205, 0, 0, 0,196, 0, 0, 0,202, 0, 0, 0, 1, 0, 0, 0,136, 0, 0, 0,137,
- 0, 0, 0,161, 0, 0, 0,174, 0, 0, 0, 1, 0, 0, 0,162, 0, 0, 0,138, 0, 0, 0,136, 0, 0, 0,174, 0, 0, 0, 1,
- 0, 0, 0,137, 0, 0, 0,139, 0, 0, 0,208, 0, 0, 0,161, 0, 0, 0, 1, 0, 0, 0,209, 0, 0, 0,140, 0, 0, 0,138,
- 0, 0, 0,162, 0, 0, 0, 1, 0, 0, 0,139, 0, 0, 0,141, 0, 0, 0,210, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0,211,
- 0, 0, 0,142, 0, 0, 0,140, 0, 0, 0,209, 0, 0, 0, 1, 0, 0, 0,141, 0, 0, 0,184, 0, 0, 0,163, 0, 0, 0,210,
- 0, 0, 0, 1, 0, 0, 0,164, 0, 0, 0,185, 0, 0, 0,142, 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 79, 0, 0, 0,206,
- 0, 0, 0,210, 0, 0, 0,163, 0, 0, 0, 1, 0, 0, 0,211, 0, 0, 0,207, 0, 0, 0, 80, 0, 0, 0,164, 0, 0, 0, 1,
- 0, 0, 0,206, 0, 0, 0,212, 0, 0, 0,208, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0,209, 0, 0, 0,213, 0, 0, 0,207,
- 0, 0, 0,211, 0, 0, 0, 1, 0, 0, 0, 77, 0, 0, 0,161, 0, 0, 0,208, 0, 0, 0,212, 0, 0, 0, 1, 0, 0, 0,209,
- 0, 0, 0,162, 0, 0, 0, 78, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0,128, 0, 0, 0,127, 0, 0, 0, 70, 0, 0, 0,219,
- 0, 0, 0, 1, 0, 0, 0, 70, 0, 0, 0,127, 0, 0, 0,129, 0, 0, 0,220, 0, 0, 0, 1, 0, 0, 0,130, 0, 0, 0,128,
- 0, 0, 0,219, 0, 0, 0,217, 0, 0, 0, 1, 0, 0, 0,220, 0, 0, 0,129, 0, 0, 0,131, 0, 0, 0,218, 0, 0, 0, 1,
- 0, 0, 0,132, 0, 0, 0,130, 0, 0, 0,217, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0,218, 0, 0, 0,131, 0, 0, 0,133,
- 0, 0, 0,216, 0, 0, 0, 1, 0, 0, 0,134, 0, 0, 0,132, 0, 0, 0,215, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,216,
- 0, 0, 0,133, 0, 0, 0,134, 0, 0, 0,214, 0, 0, 0, 1, 0, 0, 0,214, 0, 0, 0,215, 0, 0, 0,226, 0, 0, 0,228,
- 0, 0, 0, 1, 0, 0, 0,227, 0, 0, 0,216, 0, 0, 0,214, 0, 0, 0,228, 0, 0, 0, 1, 0, 0, 0,215, 0, 0, 0,217,
- 0, 0, 0,224, 0, 0, 0,226, 0, 0, 0, 1, 0, 0, 0,225, 0, 0, 0,218, 0, 0, 0,216, 0, 0, 0,227, 0, 0, 0, 1,
- 0, 0, 0,217, 0, 0, 0,219, 0, 0, 0,222, 0, 0, 0,224, 0, 0, 0, 1, 0, 0, 0,223, 0, 0, 0,220, 0, 0, 0,218,
- 0, 0, 0,225, 0, 0, 0, 1, 0, 0, 0,219, 0, 0, 0, 70, 0, 0, 0,221, 0, 0, 0,222, 0, 0, 0, 1, 0, 0, 0,221,
- 0, 0, 0, 70, 0, 0, 0,220, 0, 0, 0,223, 0, 0, 0, 1, 0, 0, 0,221, 0, 0, 0,228, 0, 0, 0,226, 0, 0, 0,222,
- 0, 0, 0, 1, 0, 0, 0,227, 0, 0, 0,228, 0, 0, 0,221, 0, 0, 0,223, 0, 0, 0, 1, 0, 0, 0,222, 0, 0, 0,226,
- 0, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,225, 0, 0, 0,227, 0, 0, 0,223, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0,180, 0, 0, 0,178, 0, 0, 0,231, 0, 0, 0,229, 0, 0, 0, 1, 0, 0, 0,232, 0, 0, 0,179, 0, 0, 0,181,
- 0, 0, 0,230, 0, 0, 0, 1, 0, 0, 0,110, 0, 0, 0,180, 0, 0, 0,229, 0, 0, 0,251, 0, 0, 0, 1, 0, 0, 0,230,
- 0, 0, 0,181, 0, 0, 0,111, 0, 0, 0,252, 0, 0, 0, 1, 0, 0, 0,108, 0, 0, 0,110, 0, 0, 0,251, 0, 0, 0,253,
- 0, 0, 0, 1, 0, 0, 0,252, 0, 0, 0,111, 0, 0, 0,109, 0, 0, 0,254, 0, 0, 0, 1, 0, 0, 0,178, 0, 0, 0, 14,
- 0, 0, 0,249, 0, 0, 0,231, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0,112, 0, 0, 0,179, 0, 0, 0,232, 0, 0, 0, 1,
- 0, 0, 0, 14, 0, 0, 0,113, 0, 0, 0,247, 0, 0, 0,249, 0, 0, 0, 1, 0, 0, 0,248, 0, 0, 0,114, 0, 0, 0,112,
- 0, 0, 0,250, 0, 0, 0, 1, 0, 0, 0,113, 0, 0, 0,115, 0, 0, 0,245, 0, 0, 0,247, 0, 0, 0, 1, 0, 0, 0,246,
- 0, 0, 0,116, 0, 0, 0,114, 0, 0, 0,248, 0, 0, 0, 1, 0, 0, 0,115, 0, 0, 0,117, 0, 0, 0,243, 0, 0, 0,245,
- 0, 0, 0, 1, 0, 0, 0,244, 0, 0, 0,118, 0, 0, 0,116, 0, 0, 0,246, 0, 0, 0, 1, 0, 0, 0,117, 0, 0, 0,119,
- 0, 0, 0,241, 0, 0, 0,243, 0, 0, 0, 1, 0, 0, 0,242, 0, 0, 0,120, 0, 0, 0,118, 0, 0, 0,244, 0, 0, 0, 1,
- 0, 0, 0,119, 0, 0, 0,121, 0, 0, 0,239, 0, 0, 0,241, 0, 0, 0, 1, 0, 0, 0,240, 0, 0, 0,122, 0, 0, 0,120,
- 0, 0, 0,242, 0, 0, 0, 1, 0, 0, 0,121, 0, 0, 0,123, 0, 0, 0,237, 0, 0, 0,239, 0, 0, 0, 1, 0, 0, 0,238,
- 0, 0, 0,124, 0, 0, 0,122, 0, 0, 0,240, 0, 0, 0, 1, 0, 0, 0,123, 0, 0, 0,176, 0, 0, 0,233, 0, 0, 0,237,
- 0, 0, 0, 1, 0, 0, 0,234, 0, 0, 0,177, 0, 0, 0,124, 0, 0, 0,238, 0, 0, 0, 1, 0, 0, 0,176, 0, 0, 0,125,
- 0, 0, 0,235, 0, 0, 0,233, 0, 0, 0, 1, 0, 0, 0,236, 0, 0, 0,126, 0, 0, 0,177, 0, 0, 0,234, 0, 0, 0, 1,
- 0, 0, 0,125, 0, 0, 0,108, 0, 0, 0,253, 0, 0, 0,235, 0, 0, 0, 1, 0, 0, 0,254, 0, 0, 0,109, 0, 0, 0,126,
- 0, 0, 0,236, 0, 0, 0, 1, 0, 0, 0,235, 0, 0, 0,253, 0, 0, 0,255, 0, 0, 1, 17, 0, 0, 0, 1, 0, 0, 1, 0,
- 0, 0, 0,254, 0, 0, 0,236, 0, 0, 1, 18, 0, 0, 0, 1, 0, 0, 0,233, 0, 0, 0,235, 0, 0, 1, 17, 0, 0, 1, 19,
- 0, 0, 0, 1, 0, 0, 1, 18, 0, 0, 0,236, 0, 0, 0,234, 0, 0, 1, 20, 0, 0, 0, 1, 0, 0, 0,237, 0, 0, 0,233,
- 0, 0, 1, 19, 0, 0, 1, 15, 0, 0, 0, 1, 0, 0, 1, 20, 0, 0, 0,234, 0, 0, 0,238, 0, 0, 1, 16, 0, 0, 0, 1,
- 0, 0, 0,239, 0, 0, 0,237, 0, 0, 1, 15, 0, 0, 1, 13, 0, 0, 0, 1, 0, 0, 1, 16, 0, 0, 0,238, 0, 0, 0,240,
- 0, 0, 1, 14, 0, 0, 0, 1, 0, 0, 0,241, 0, 0, 0,239, 0, 0, 1, 13, 0, 0, 1, 11, 0, 0, 0, 1, 0, 0, 1, 14,
- 0, 0, 0,240, 0, 0, 0,242, 0, 0, 1, 12, 0, 0, 0, 1, 0, 0, 0,243, 0, 0, 0,241, 0, 0, 1, 11, 0, 0, 1, 9,
- 0, 0, 0, 1, 0, 0, 1, 12, 0, 0, 0,242, 0, 0, 0,244, 0, 0, 1, 10, 0, 0, 0, 1, 0, 0, 0,245, 0, 0, 0,243,
- 0, 0, 1, 9, 0, 0, 1, 7, 0, 0, 0, 1, 0, 0, 1, 10, 0, 0, 0,244, 0, 0, 0,246, 0, 0, 1, 8, 0, 0, 0, 1,
- 0, 0, 0,247, 0, 0, 0,245, 0, 0, 1, 7, 0, 0, 1, 5, 0, 0, 0, 1, 0, 0, 1, 8, 0, 0, 0,246, 0, 0, 0,248,
- 0, 0, 1, 6, 0, 0, 0, 1, 0, 0, 0,249, 0, 0, 0,247, 0, 0, 1, 5, 0, 0, 1, 3, 0, 0, 0, 1, 0, 0, 1, 6,
- 0, 0, 0,248, 0, 0, 0,250, 0, 0, 1, 4, 0, 0, 0, 1, 0, 0, 0,231, 0, 0, 0,249, 0, 0, 1, 3, 0, 0, 1, 21,
- 0, 0, 0, 1, 0, 0, 1, 4, 0, 0, 0,250, 0, 0, 0,232, 0, 0, 1, 22, 0, 0, 0, 1, 0, 0, 0,253, 0, 0, 0,251,
- 0, 0, 1, 1, 0, 0, 0,255, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0,252, 0, 0, 0,254, 0, 0, 1, 0, 0, 0, 0, 1,
- 0, 0, 0,251, 0, 0, 0,229, 0, 0, 1, 23, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 24, 0, 0, 0,230, 0, 0, 0,252,
- 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0,229, 0, 0, 0,231, 0, 0, 1, 21, 0, 0, 1, 23, 0, 0, 0, 1, 0, 0, 1, 22,
- 0, 0, 0,232, 0, 0, 0,230, 0, 0, 1, 24, 0, 0, 0, 1, 0, 0, 0, 65, 0, 0, 0,106, 0, 0, 1, 25, 0, 0, 0, 71,
- 0, 0, 0, 1, 0, 0, 1, 26, 0, 0, 0,107, 0, 0, 0, 65, 0, 0, 0, 71, 0, 0, 0, 1, 0, 0, 0,106, 0, 0, 0,104,
- 0, 0, 1, 27, 0, 0, 1, 25, 0, 0, 0, 1, 0, 0, 1, 28, 0, 0, 0,105, 0, 0, 0,107, 0, 0, 1, 26, 0, 0, 0, 1,
- 0, 0, 0,104, 0, 0, 0,102, 0, 0, 1, 29, 0, 0, 1, 27, 0, 0, 0, 1, 0, 0, 1, 30, 0, 0, 0,103, 0, 0, 0,105,
- 0, 0, 1, 28, 0, 0, 0, 1, 0, 0, 0,102, 0, 0, 0,100, 0, 0, 1, 31, 0, 0, 1, 29, 0, 0, 0, 1, 0, 0, 1, 32,
- 0, 0, 0,101, 0, 0, 0,103, 0, 0, 1, 30, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 98, 0, 0, 1, 33, 0, 0, 1, 31,
- 0, 0, 0, 1, 0, 0, 1, 34, 0, 0, 0, 99, 0, 0, 0,101, 0, 0, 1, 32, 0, 0, 0, 1, 0, 0, 0, 98, 0, 0, 0, 96,
- 0, 0, 1, 35, 0, 0, 1, 33, 0, 0, 0, 1, 0, 0, 1, 36, 0, 0, 0, 97, 0, 0, 0, 99, 0, 0, 1, 34, 0, 0, 0, 1,
- 0, 0, 0, 96, 0, 0, 0, 94, 0, 0, 1, 37, 0, 0, 1, 35, 0, 0, 0, 1, 0, 0, 1, 38, 0, 0, 0, 95, 0, 0, 0, 97,
- 0, 0, 1, 36, 0, 0, 0, 1, 0, 0, 0, 94, 0, 0, 0, 92, 0, 0, 1, 39, 0, 0, 1, 37, 0, 0, 0, 1, 0, 0, 1, 40,
- 0, 0, 0, 93, 0, 0, 0, 95, 0, 0, 1, 38, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0, 90, 0, 0, 1, 41, 0, 0, 1, 39,
- 0, 0, 0, 1, 0, 0, 1, 42, 0, 0, 0, 91, 0, 0, 0, 93, 0, 0, 1, 40, 0, 0, 0, 1, 0, 0, 1, 49, 0, 0, 1, 50,
- 0, 0, 1, 69, 0, 0, 1, 79, 0, 0, 0, 1, 0, 0, 1, 70, 0, 0, 1, 50, 0, 0, 1, 49, 0, 0, 1, 80, 0, 0, 0, 1,
- 0, 0, 1, 48, 0, 0, 1, 49, 0, 0, 1, 79, 0, 0, 1, 77, 0, 0, 0, 1, 0, 0, 1, 80, 0, 0, 1, 49, 0, 0, 1, 48,
- 0, 0, 1, 78, 0, 0, 0, 1, 0, 0, 1, 47, 0, 0, 1, 48, 0, 0, 1, 77, 0, 0, 1, 81, 0, 0, 0, 1, 0, 0, 1, 78,
- 0, 0, 1, 48, 0, 0, 1, 47, 0, 0, 1, 82, 0, 0, 0, 1, 0, 0, 0, 87, 0, 0, 0, 89, 0, 0, 1, 47, 0, 0, 1, 81,
- 0, 0, 0, 1, 0, 0, 1, 47, 0, 0, 0, 89, 0, 0, 0, 88, 0, 0, 1, 82, 0, 0, 0, 1, 0, 0, 0, 85, 0, 0, 0, 87,
- 0, 0, 1, 81, 0, 0, 1, 75, 0, 0, 0, 1, 0, 0, 1, 82, 0, 0, 0, 88, 0, 0, 0, 86, 0, 0, 1, 76, 0, 0, 0, 1,
- 0, 0, 0, 83, 0, 0, 0, 85, 0, 0, 1, 75, 0, 0, 1, 71, 0, 0, 0, 1, 0, 0, 1, 76, 0, 0, 0, 86, 0, 0, 0, 84,
- 0, 0, 1, 72, 0, 0, 0, 1, 0, 0, 0, 81, 0, 0, 0, 83, 0, 0, 1, 71, 0, 0, 1, 73, 0, 0, 0, 1, 0, 0, 1, 72,
- 0, 0, 0, 84, 0, 0, 0, 82, 0, 0, 1, 74, 0, 0, 0, 1, 0, 0, 1, 71, 0, 0, 1, 77, 0, 0, 1, 79, 0, 0, 1, 73,
- 0, 0, 0, 1, 0, 0, 1, 80, 0, 0, 1, 78, 0, 0, 1, 72, 0, 0, 1, 74, 0, 0, 0, 1, 0, 0, 1, 71, 0, 0, 1, 75,
- 0, 0, 1, 81, 0, 0, 1, 77, 0, 0, 0, 1, 0, 0, 1, 82, 0, 0, 1, 76, 0, 0, 1, 72, 0, 0, 1, 78, 0, 0, 0, 1,
- 0, 0, 1, 67, 0, 0, 1, 73, 0, 0, 1, 79, 0, 0, 1, 69, 0, 0, 0, 1, 0, 0, 1, 80, 0, 0, 1, 74, 0, 0, 1, 68,
- 0, 0, 1, 70, 0, 0, 0, 1, 0, 0, 0, 79, 0, 0, 0, 81, 0, 0, 1, 73, 0, 0, 1, 67, 0, 0, 0, 1, 0, 0, 1, 74,
- 0, 0, 0, 82, 0, 0, 0, 80, 0, 0, 1, 68, 0, 0, 0, 1, 0, 0, 0,206, 0, 0, 1, 83, 0, 0, 1, 85, 0, 0, 0,212,
- 0, 0, 0, 1, 0, 0, 1, 86, 0, 0, 1, 84, 0, 0, 0,207, 0, 0, 0,213, 0, 0, 0, 1, 0, 0, 0, 79, 0, 0, 1, 67,
- 0, 0, 1, 83, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 1, 84, 0, 0, 1, 68, 0, 0, 0, 80, 0, 0, 0,207, 0, 0, 0, 1,
- 0, 0, 0, 77, 0, 0, 0,212, 0, 0, 1, 85, 0, 0, 1, 87, 0, 0, 0, 1, 0, 0, 1, 86, 0, 0, 0,213, 0, 0, 0, 78,
- 0, 0, 1, 88, 0, 0, 0, 1, 0, 0, 0, 77, 0, 0, 1, 87, 0, 0, 1, 41, 0, 0, 0, 90, 0, 0, 0, 1, 0, 0, 1, 42,
- 0, 0, 1, 88, 0, 0, 0, 78, 0, 0, 0, 91, 0, 0, 0, 1, 0, 0, 0, 75, 0, 0, 1, 65, 0, 0, 1, 93, 0, 0, 1, 45,
- 0, 0, 0, 1, 0, 0, 1, 94, 0, 0, 1, 66, 0, 0, 0, 75, 0, 0, 1, 45, 0, 0, 0, 1, 0, 0, 1, 45, 0, 0, 1, 93,
- 0, 0, 1, 91, 0, 0, 0, 76, 0, 0, 0, 1, 0, 0, 1, 92, 0, 0, 1, 94, 0, 0, 1, 45, 0, 0, 0, 76, 0, 0, 0, 1,
- 0, 0, 0, 76, 0, 0, 1, 91, 0, 0, 1, 89, 0, 0, 1, 46, 0, 0, 0, 1, 0, 0, 1, 90, 0, 0, 1, 92, 0, 0, 0, 76,
- 0, 0, 1, 46, 0, 0, 0, 1, 0, 0, 1, 46, 0, 0, 1, 89, 0, 0, 1, 69, 0, 0, 1, 50, 0, 0, 0, 1, 0, 0, 1, 70,
- 0, 0, 1, 90, 0, 0, 1, 46, 0, 0, 1, 50, 0, 0, 0, 1, 0, 0, 1, 67, 0, 0, 1, 69, 0, 0, 1, 89, 0, 0, 1, 83,
- 0, 0, 0, 1, 0, 0, 1, 90, 0, 0, 1, 70, 0, 0, 1, 68, 0, 0, 1, 84, 0, 0, 0, 1, 0, 0, 1, 37, 0, 0, 1, 39,
- 0, 0, 1, 59, 0, 0, 1, 51, 0, 0, 0, 1, 0, 0, 1, 60, 0, 0, 1, 40, 0, 0, 1, 38, 0, 0, 1, 52, 0, 0, 0, 1,
- 0, 0, 0, 74, 0, 0, 1, 57, 0, 0, 1, 65, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 1, 66, 0, 0, 1, 58, 0, 0, 0, 74,
- 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 1, 43, 0, 0, 1, 99, 0, 0, 1, 97, 0, 0, 1, 44, 0, 0, 0, 1, 0, 0, 1, 98,
- 0, 0, 1,100, 0, 0, 1, 43, 0, 0, 1, 44, 0, 0, 0, 1, 0, 0, 1, 44, 0, 0, 1, 97, 0, 0, 1, 95, 0, 0, 0, 73,
- 0, 0, 0, 1, 0, 0, 1, 96, 0, 0, 1, 98, 0, 0, 1, 44, 0, 0, 0, 73, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0, 1, 95,
- 0, 0, 1, 57, 0, 0, 0, 74, 0, 0, 0, 1, 0, 0, 1, 58, 0, 0, 1, 96, 0, 0, 0, 73, 0, 0, 0, 74, 0, 0, 0, 1,
- 0, 0, 1, 33, 0, 0, 1, 35, 0, 0, 1,103, 0, 0, 1,105, 0, 0, 0, 1, 0, 0, 1,104, 0, 0, 1, 36, 0, 0, 1, 34,
- 0, 0, 1,106, 0, 0, 0, 1, 0, 0, 1,105, 0, 0, 1,103, 0, 0, 1,109, 0, 0, 1,107, 0, 0, 0, 1, 0, 0, 1,110,
- 0, 0, 1,104, 0, 0, 1,106, 0, 0, 1,108, 0, 0, 0, 1, 0, 0, 1,107, 0, 0, 1,109, 0, 0, 1,111, 0, 0, 1,113,
- 0, 0, 0, 1, 0, 0, 1,112, 0, 0, 1,110, 0, 0, 1,108, 0, 0, 1,114, 0, 0, 0, 1, 0, 0, 1,113, 0, 0, 1,111,
- 0, 0, 1,117, 0, 0, 1,115, 0, 0, 0, 1, 0, 0, 1,118, 0, 0, 1,112, 0, 0, 1,114, 0, 0, 1,116, 0, 0, 0, 1,
- 0, 0, 1, 55, 0, 0, 1,119, 0, 0, 1,115, 0, 0, 1,117, 0, 0, 0, 1, 0, 0, 1,116, 0, 0, 1,120, 0, 0, 1, 56,
- 0, 0, 1,118, 0, 0, 0, 1, 0, 0, 1, 57, 0, 0, 1, 95, 0, 0, 1,115, 0, 0, 1,119, 0, 0, 0, 1, 0, 0, 1,116,
- 0, 0, 1, 96, 0, 0, 1, 58, 0, 0, 1,120, 0, 0, 0, 1, 0, 0, 1, 95, 0, 0, 1, 97, 0, 0, 1,113, 0, 0, 1,115,
- 0, 0, 0, 1, 0, 0, 1,114, 0, 0, 1, 98, 0, 0, 1, 96, 0, 0, 1,116, 0, 0, 0, 1, 0, 0, 1, 97, 0, 0, 1, 99,
- 0, 0, 1,107, 0, 0, 1,113, 0, 0, 0, 1, 0, 0, 1,108, 0, 0, 1,100, 0, 0, 1, 98, 0, 0, 1,114, 0, 0, 0, 1,
- 0, 0, 1, 99, 0, 0, 1,101, 0, 0, 1,105, 0, 0, 1,107, 0, 0, 0, 1, 0, 0, 1,106, 0, 0, 1,102, 0, 0, 1,100,
- 0, 0, 1,108, 0, 0, 0, 1, 0, 0, 1, 31, 0, 0, 1, 33, 0, 0, 1,105, 0, 0, 1,101, 0, 0, 0, 1, 0, 0, 1,106,
- 0, 0, 1, 34, 0, 0, 1, 32, 0, 0, 1,102, 0, 0, 0, 1, 0, 0, 0, 72, 0, 0, 1,101, 0, 0, 1, 99, 0, 0, 1, 43,
- 0, 0, 0, 1, 0, 0, 1,100, 0, 0, 1,102, 0, 0, 0, 72, 0, 0, 1, 43, 0, 0, 0, 1, 0, 0, 1, 25, 0, 0, 1, 27,
- 0, 0, 1, 29, 0, 0, 1, 31, 0, 0, 0, 1, 0, 0, 1, 30, 0, 0, 1, 28, 0, 0, 1, 26, 0, 0, 1, 32, 0, 0, 0, 1,
- 0, 0, 1, 25, 0, 0, 1, 31, 0, 0, 1,101, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 1,102, 0, 0, 1, 32, 0, 0, 1, 26,
- 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 71, 0, 0, 1, 25, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 72,
- 0, 0, 1, 26, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 35, 0, 0, 1, 37, 0, 0, 1, 51, 0, 0, 1,103,
- 0, 0, 0, 1, 0, 0, 1, 52, 0, 0, 1, 38, 0, 0, 1, 36, 0, 0, 1,104, 0, 0, 0, 1, 0, 0, 1, 51, 0, 0, 1, 53,
- 0, 0, 1,109, 0, 0, 1,103, 0, 0, 0, 1, 0, 0, 1,110, 0, 0, 1, 54, 0, 0, 1, 52, 0, 0, 1,104, 0, 0, 0, 1,
- 0, 0, 1, 53, 0, 0, 1,123, 0, 0, 1,111, 0, 0, 1,109, 0, 0, 0, 1, 0, 0, 1,112, 0, 0, 1,124, 0, 0, 1, 54,
- 0, 0, 1,110, 0, 0, 0, 1, 0, 0, 1, 55, 0, 0, 1,117, 0, 0, 1,111, 0, 0, 1,123, 0, 0, 0, 1, 0, 0, 1,112,
- 0, 0, 1,118, 0, 0, 1, 56, 0, 0, 1,124, 0, 0, 0, 1, 0, 0, 1, 89, 0, 0, 1, 91, 0, 0, 1,127, 0, 0, 1,125,
- 0, 0, 0, 1, 0, 0, 1,128, 0, 0, 1, 92, 0, 0, 1, 90, 0, 0, 1,126, 0, 0, 0, 1, 0, 0, 1, 59, 0, 0, 1,125,
- 0, 0, 1,127, 0, 0, 1, 61, 0, 0, 0, 1, 0, 0, 1,128, 0, 0, 1,126, 0, 0, 1, 60, 0, 0, 1, 62, 0, 0, 0, 1,
- 0, 0, 1, 39, 0, 0, 1, 41, 0, 0, 1,125, 0, 0, 1, 59, 0, 0, 0, 1, 0, 0, 1,126, 0, 0, 1, 42, 0, 0, 1, 40,
- 0, 0, 1, 60, 0, 0, 0, 1, 0, 0, 1, 41, 0, 0, 1, 85, 0, 0, 1, 83, 0, 0, 1,125, 0, 0, 0, 1, 0, 0, 1, 84,
- 0, 0, 1, 86, 0, 0, 1, 42, 0, 0, 1,126, 0, 0, 0, 1, 0, 0, 1, 83, 0, 0, 1, 89, 0, 0, 1,125, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 1,126, 0, 0, 1, 90, 0, 0, 1, 84, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 41, 0, 0, 1, 87,
- 0, 0, 1, 85, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 86, 0, 0, 1, 88, 0, 0, 1, 42, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 1, 55, 0, 0, 1, 63, 0, 0, 1,121, 0, 0, 1,119, 0, 0, 0, 1, 0, 0, 1,122, 0, 0, 1, 64, 0, 0, 1, 56,
- 0, 0, 1,120, 0, 0, 0, 1, 0, 0, 1, 57, 0, 0, 1,119, 0, 0, 1,121, 0, 0, 1, 65, 0, 0, 0, 1, 0, 0, 1,122,
- 0, 0, 1,120, 0, 0, 1, 58, 0, 0, 1, 66, 0, 0, 0, 1, 0, 0, 1, 61, 0, 0, 1,127, 0, 0, 1,121, 0, 0, 1, 63,
- 0, 0, 0, 1, 0, 0, 1,122, 0, 0, 1,128, 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 0, 1, 0, 0, 1, 91, 0, 0, 1, 93,
- 0, 0, 1,121, 0, 0, 1,127, 0, 0, 0, 1, 0, 0, 1,122, 0, 0, 1, 94, 0, 0, 1, 92, 0, 0, 1,128, 0, 0, 0, 1,
- 0, 0, 1, 65, 0, 0, 1,121, 0, 0, 1, 93, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 94, 0, 0, 1,122, 0, 0, 1, 66,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,141, 0, 0, 1,129, 0, 0, 1,155, 0, 0, 1,143, 0, 0, 0, 1, 0, 0, 1,156,
- 0, 0, 1,130, 0, 0, 1,142, 0, 0, 1,144, 0, 0, 0, 1, 0, 0, 1,141, 0, 0, 1,143, 0, 0, 1,145, 0, 0, 1,139,
- 0, 0, 0, 1, 0, 0, 1,146, 0, 0, 1,144, 0, 0, 1,142, 0, 0, 1,140, 0, 0, 0, 1, 0, 0, 1,139, 0, 0, 1,145,
- 0, 0, 1,147, 0, 0, 1,137, 0, 0, 0, 1, 0, 0, 1,148, 0, 0, 1,146, 0, 0, 1,140, 0, 0, 1,138, 0, 0, 0, 1,
- 0, 0, 1,137, 0, 0, 1,147, 0, 0, 1,149, 0, 0, 1,135, 0, 0, 0, 1, 0, 0, 1,150, 0, 0, 1,148, 0, 0, 1,138,
- 0, 0, 1,136, 0, 0, 0, 1, 0, 0, 1,135, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 1,133, 0, 0, 0, 1, 0, 0, 1,152,
- 0, 0, 1,150, 0, 0, 1,136, 0, 0, 1,134, 0, 0, 0, 1, 0, 0, 1,133, 0, 0, 1,151, 0, 0, 1,153, 0, 0, 1,131,
- 0, 0, 0, 1, 0, 0, 1,154, 0, 0, 1,152, 0, 0, 1,134, 0, 0, 1,132, 0, 0, 0, 1, 0, 0, 1,151, 0, 0, 1,161,
- 0, 0, 1,159, 0, 0, 1,153, 0, 0, 0, 1, 0, 0, 1,160, 0, 0, 1,162, 0, 0, 1,152, 0, 0, 1,154, 0, 0, 0, 1,
- 0, 0, 1,149, 0, 0, 1,163, 0, 0, 1,161, 0, 0, 1,151, 0, 0, 0, 1, 0, 0, 1,162, 0, 0, 1,164, 0, 0, 1,150,
- 0, 0, 1,152, 0, 0, 0, 1, 0, 0, 1,147, 0, 0, 1,165, 0, 0, 1,163, 0, 0, 1,149, 0, 0, 0, 1, 0, 0, 1,164,
- 0, 0, 1,166, 0, 0, 1,148, 0, 0, 1,150, 0, 0, 0, 1, 0, 0, 1,145, 0, 0, 1,167, 0, 0, 1,165, 0, 0, 1,147,
- 0, 0, 0, 1, 0, 0, 1,166, 0, 0, 1,168, 0, 0, 1,146, 0, 0, 1,148, 0, 0, 0, 1, 0, 0, 1,143, 0, 0, 1,169,
- 0, 0, 1,167, 0, 0, 1,145, 0, 0, 0, 1, 0, 0, 1,168, 0, 0, 1,170, 0, 0, 1,144, 0, 0, 1,146, 0, 0, 0, 1,
- 0, 0, 1,143, 0, 0, 1,155, 0, 0, 1,157, 0, 0, 1,169, 0, 0, 0, 1, 0, 0, 1,158, 0, 0, 1,156, 0, 0, 1,144,
- 0, 0, 1,170, 0, 0, 0, 1, 0, 0, 1, 59, 0, 0, 1, 61, 0, 0, 1,185, 0, 0, 1,183, 0, 0, 0, 1, 0, 0, 1,186,
- 0, 0, 1, 62, 0, 0, 1, 60, 0, 0, 1,184, 0, 0, 0, 1, 0, 0, 1, 61, 0, 0, 1,131, 0, 0, 1,153, 0, 0, 1,185,
- 0, 0, 0, 1, 0, 0, 1,154, 0, 0, 1,132, 0, 0, 1, 62, 0, 0, 1,186, 0, 0, 0, 1, 0, 0, 1, 51, 0, 0, 1, 59,
- 0, 0, 1,183, 0, 0, 1, 53, 0, 0, 0, 1, 0, 0, 1,184, 0, 0, 1, 60, 0, 0, 1, 52, 0, 0, 1, 54, 0, 0, 0, 1,
- 0, 0, 1,123, 0, 0, 1,171, 0, 0, 1,155, 0, 0, 1,129, 0, 0, 0, 1, 0, 0, 1,156, 0, 0, 1,172, 0, 0, 1,124,
- 0, 0, 1,130, 0, 0, 0, 1, 0, 0, 1,153, 0, 0, 1,159, 0, 0, 1,181, 0, 0, 1,185, 0, 0, 0, 1, 0, 0, 1,182,
- 0, 0, 1,160, 0, 0, 1,154, 0, 0, 1,186, 0, 0, 0, 1, 0, 0, 1,179, 0, 0, 1,187, 0, 0, 1,185, 0, 0, 1,181,
- 0, 0, 0, 1, 0, 0, 1,186, 0, 0, 1,188, 0, 0, 1,180, 0, 0, 1,182, 0, 0, 0, 1, 0, 0, 1,175, 0, 0, 1,187,
- 0, 0, 1,179, 0, 0, 1,177, 0, 0, 0, 1, 0, 0, 1,180, 0, 0, 1,188, 0, 0, 1,176, 0, 0, 1,178, 0, 0, 0, 1,
- 0, 0, 1,173, 0, 0, 1,189, 0, 0, 1,187, 0, 0, 1,175, 0, 0, 0, 1, 0, 0, 1,188, 0, 0, 1,190, 0, 0, 1,174,
- 0, 0, 1,176, 0, 0, 0, 1, 0, 0, 1,171, 0, 0, 1,189, 0, 0, 1,173, 0, 0, 1,191, 0, 0, 0, 1, 0, 0, 1,174,
- 0, 0, 1,190, 0, 0, 1,172, 0, 0, 1,192, 0, 0, 0, 1, 0, 0, 1,155, 0, 0, 1,171, 0, 0, 1,191, 0, 0, 1,157,
- 0, 0, 0, 1, 0, 0, 1,192, 0, 0, 1,172, 0, 0, 1,156, 0, 0, 1,158, 0, 0, 0, 1, 0, 0, 1, 53, 0, 0, 1,189,
- 0, 0, 1,171, 0, 0, 1,123, 0, 0, 0, 1, 0, 0, 1,172, 0, 0, 1,190, 0, 0, 1, 54, 0, 0, 1,124, 0, 0, 0, 1,
- 0, 0, 1, 53, 0, 0, 1,183, 0, 0, 1,187, 0, 0, 1,189, 0, 0, 0, 1, 0, 0, 1,188, 0, 0, 1,184, 0, 0, 1, 54,
- 0, 0, 1,190, 0, 0, 0, 1, 0, 0, 1,183, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,188,
- 0, 0, 1,186, 0, 0, 1,184, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,157, 0, 0, 1,191, 0, 0, 1,193, 0, 0, 1,217,
- 0, 0, 0, 1, 0, 0, 1,194, 0, 0, 1,192, 0, 0, 1,158, 0, 0, 1,218, 0, 0, 0, 1, 0, 0, 1,191, 0, 0, 1,173,
- 0, 0, 1,203, 0, 0, 1,193, 0, 0, 0, 1, 0, 0, 1,204, 0, 0, 1,174, 0, 0, 1,192, 0, 0, 1,194, 0, 0, 0, 1,
- 0, 0, 1,173, 0, 0, 1,175, 0, 0, 1,201, 0, 0, 1,203, 0, 0, 0, 1, 0, 0, 1,202, 0, 0, 1,176, 0, 0, 1,174,
- 0, 0, 1,204, 0, 0, 0, 1, 0, 0, 1,175, 0, 0, 1,177, 0, 0, 1,199, 0, 0, 1,201, 0, 0, 0, 1, 0, 0, 1,200,
- 0, 0, 1,178, 0, 0, 1,176, 0, 0, 1,202, 0, 0, 0, 1, 0, 0, 1,177, 0, 0, 1,179, 0, 0, 1,197, 0, 0, 1,199,
- 0, 0, 0, 1, 0, 0, 1,198, 0, 0, 1,180, 0, 0, 1,178, 0, 0, 1,200, 0, 0, 0, 1, 0, 0, 1,179, 0, 0, 1,181,
- 0, 0, 1,195, 0, 0, 1,197, 0, 0, 0, 1, 0, 0, 1,196, 0, 0, 1,182, 0, 0, 1,180, 0, 0, 1,198, 0, 0, 0, 1,
- 0, 0, 1,181, 0, 0, 1,159, 0, 0, 1,215, 0, 0, 1,195, 0, 0, 0, 1, 0, 0, 1,216, 0, 0, 1,160, 0, 0, 1,182,
- 0, 0, 1,196, 0, 0, 0, 1, 0, 0, 1,169, 0, 0, 1,157, 0, 0, 1,217, 0, 0, 1,205, 0, 0, 0, 1, 0, 0, 1,218,
- 0, 0, 1,158, 0, 0, 1,170, 0, 0, 1,206, 0, 0, 0, 1, 0, 0, 1,167, 0, 0, 1,169, 0, 0, 1,205, 0, 0, 1,207,
- 0, 0, 0, 1, 0, 0, 1,206, 0, 0, 1,170, 0, 0, 1,168, 0, 0, 1,208, 0, 0, 0, 1, 0, 0, 1,165, 0, 0, 1,167,
- 0, 0, 1,207, 0, 0, 1,209, 0, 0, 0, 1, 0, 0, 1,208, 0, 0, 1,168, 0, 0, 1,166, 0, 0, 1,210, 0, 0, 0, 1,
- 0, 0, 1,163, 0, 0, 1,165, 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 1, 0, 0, 1,210, 0, 0, 1,166, 0, 0, 1,164,
- 0, 0, 1,212, 0, 0, 0, 1, 0, 0, 1,161, 0, 0, 1,163, 0, 0, 1,211, 0, 0, 1,213, 0, 0, 0, 1, 0, 0, 1,212,
- 0, 0, 1,164, 0, 0, 1,162, 0, 0, 1,214, 0, 0, 0, 1, 0, 0, 1,159, 0, 0, 1,161, 0, 0, 1,213, 0, 0, 1,215,
- 0, 0, 0, 1, 0, 0, 1,214, 0, 0, 1,162, 0, 0, 1,160, 0, 0, 1,216, 0, 0, 0, 1, 0, 0, 1,199, 0, 0, 1,197,
- 0, 0, 1,221, 0, 0, 1,219, 0, 0, 0, 1, 0, 0, 1,222, 0, 0, 1,198, 0, 0, 1,200, 0, 0, 1,220, 0, 0, 0, 1,
- 0, 0, 1,219, 0, 0, 1,221, 0, 0, 1,223, 0, 0, 1,225, 0, 0, 0, 1, 0, 0, 1,224, 0, 0, 1,222, 0, 0, 1,220,
- 0, 0, 1,226, 0, 0, 0, 1, 0, 0, 1,225, 0, 0, 1,223, 0, 0, 1,229, 0, 0, 1,227, 0, 0, 0, 1, 0, 0, 1,230,
- 0, 0, 1,224, 0, 0, 1,226, 0, 0, 1,228, 0, 0, 0, 1, 0, 0, 1,227, 0, 0, 1,229, 0, 0, 1,231, 0, 0, 1,233,
- 0, 0, 0, 1, 0, 0, 1,232, 0, 0, 1,230, 0, 0, 1,228, 0, 0, 1,234, 0, 0, 0, 1, 0, 0, 1,205, 0, 0, 1,217,
- 0, 0, 1,227, 0, 0, 1,233, 0, 0, 0, 1, 0, 0, 1,228, 0, 0, 1,218, 0, 0, 1,206, 0, 0, 1,234, 0, 0, 0, 1,
- 0, 0, 1,193, 0, 0, 1,225, 0, 0, 1,227, 0, 0, 1,217, 0, 0, 0, 1, 0, 0, 1,228, 0, 0, 1,226, 0, 0, 1,194,
- 0, 0, 1,218, 0, 0, 0, 1, 0, 0, 1,193, 0, 0, 1,203, 0, 0, 1,219, 0, 0, 1,225, 0, 0, 0, 1, 0, 0, 1,220,
- 0, 0, 1,204, 0, 0, 1,194, 0, 0, 1,226, 0, 0, 0, 1, 0, 0, 1,199, 0, 0, 1,219, 0, 0, 1,203, 0, 0, 1,201,
- 0, 0, 0, 1, 0, 0, 1,204, 0, 0, 1,220, 0, 0, 1,200, 0, 0, 1,202, 0, 0, 0, 1, 0, 0, 1,195, 0, 0, 1,215,
- 0, 0, 1,221, 0, 0, 1,197, 0, 0, 0, 1, 0, 0, 1,222, 0, 0, 1,216, 0, 0, 1,196, 0, 0, 1,198, 0, 0, 0, 1,
- 0, 0, 1,213, 0, 0, 1,223, 0, 0, 1,221, 0, 0, 1,215, 0, 0, 0, 1, 0, 0, 1,222, 0, 0, 1,224, 0, 0, 1,214,
- 0, 0, 1,216, 0, 0, 0, 1, 0, 0, 1,211, 0, 0, 1,229, 0, 0, 1,223, 0, 0, 1,213, 0, 0, 0, 1, 0, 0, 1,224,
- 0, 0, 1,230, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 1, 0, 0, 1,209, 0, 0, 1,231, 0, 0, 1,229, 0, 0, 1,211,
- 0, 0, 0, 1, 0, 0, 1,230, 0, 0, 1,232, 0, 0, 1,210, 0, 0, 1,212, 0, 0, 0, 1, 0, 0, 1,207, 0, 0, 1,233,
- 0, 0, 1,231, 0, 0, 1,209, 0, 0, 0, 1, 0, 0, 1,232, 0, 0, 1,234, 0, 0, 1,208, 0, 0, 1,210, 0, 0, 0, 1,
- 0, 0, 1,205, 0, 0, 1,233, 0, 0, 1,207, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,208, 0, 0, 1,234, 0, 0, 1,206,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,133, 0, 0, 1,131, 0, 0, 1,245, 0, 0, 1,243, 0, 0, 0, 1, 0, 0, 1,246,
- 0, 0, 1,132, 0, 0, 1,134, 0, 0, 1,244, 0, 0, 0, 1, 0, 0, 1,135, 0, 0, 1,133, 0, 0, 1,243, 0, 0, 1,241,
- 0, 0, 0, 1, 0, 0, 1,244, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 1,242, 0, 0, 0, 1, 0, 0, 1,137, 0, 0, 1,135,
- 0, 0, 1,241, 0, 0, 1,239, 0, 0, 0, 1, 0, 0, 1,242, 0, 0, 1,136, 0, 0, 1,138, 0, 0, 1,240, 0, 0, 0, 1,
- 0, 0, 1,139, 0, 0, 1,137, 0, 0, 1,239, 0, 0, 1,237, 0, 0, 0, 1, 0, 0, 1,240, 0, 0, 1,138, 0, 0, 1,140,
- 0, 0, 1,238, 0, 0, 0, 1, 0, 0, 1,141, 0, 0, 1,139, 0, 0, 1,237, 0, 0, 1,235, 0, 0, 0, 1, 0, 0, 1,238,
- 0, 0, 1,140, 0, 0, 1,142, 0, 0, 1,236, 0, 0, 0, 1, 0, 0, 1,129, 0, 0, 1,141, 0, 0, 1,235, 0, 0, 1,247,
- 0, 0, 0, 1, 0, 0, 1,236, 0, 0, 1,142, 0, 0, 1,130, 0, 0, 1,248, 0, 0, 0, 1, 0, 0, 1,235, 0, 0, 1,243,
- 0, 0, 1,245, 0, 0, 1,247, 0, 0, 0, 1, 0, 0, 1,246, 0, 0, 1,244, 0, 0, 1,236, 0, 0, 1,248, 0, 0, 0, 1,
- 0, 0, 1,235, 0, 0, 1,237, 0, 0, 1,241, 0, 0, 1,243, 0, 0, 0, 1, 0, 0, 1,242, 0, 0, 1,238, 0, 0, 1,236,
- 0, 0, 1,244, 0, 0, 0, 1, 0, 0, 1,237, 0, 0, 1,239, 0, 0, 1,241, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,242,
- 0, 0, 1,240, 0, 0, 1,238, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 55, 0, 0, 1,123, 0, 0, 1,129, 0, 0, 1,247,
- 0, 0, 0, 1, 0, 0, 1,130, 0, 0, 1,124, 0, 0, 1, 56, 0, 0, 1,248, 0, 0, 0, 1, 0, 0, 1, 55, 0, 0, 1,247,
- 0, 0, 1,245, 0, 0, 1, 63, 0, 0, 0, 1, 0, 0, 1,246, 0, 0, 1,248, 0, 0, 1, 56, 0, 0, 1, 64, 0, 0, 0, 1,
- 0, 0, 1, 61, 0, 0, 1, 63, 0, 0, 1,245, 0, 0, 1,131, 0, 0, 0, 1, 0, 0, 1,246, 0, 0, 1, 64, 0, 0, 1, 62,
- 0, 0, 1,132, 0, 0, 0, 1, 68, 65, 84, 65, 0, 0, 85,240, 12,117,208, 32, 0, 0, 0, 65, 0, 0, 1,244, 63, 28,112, 3,
- 62,236,178,185, 63, 27,124,224, 62,232, 65,235, 63, 30, 63,144, 62,226,195,233, 63, 32,152,118, 62,236,167, 37, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,209,232, 2, 62,226, 21,222, 62,215,109,102, 62,231,147,222, 62,213,135, 28, 62,236, 4,172,
- 62,205, 54, 56, 62,235,249, 22, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 32,152,118, 62,236,167, 37, 63, 30, 63,144,
- 62,226,195,233, 63, 33,235,108, 62,220,235,197, 63, 37,151,209, 62,236,161, 89, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,202,144, 76, 62,220, 61,186, 62,209,232, 2, 62,226, 21,222, 62,205, 54, 56, 62,235,249, 22, 62,195, 55,128, 62,235,243, 70,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 30, 63,144, 62,226,195,233, 63, 25, 55, 20, 62,223, 35, 1, 63, 25,178,200,
- 62,214,233, 77, 63, 33,235,108, 62,220,235,197, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,219, 1,146, 62,214, 59, 66,
- 62,219,248,248, 62,222,116,246, 62,209,232, 2, 62,226, 21,222, 62,202,144, 76, 62,220, 61,186, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 27,124,224, 62,232, 65,235, 63, 24,252, 87, 62,230,111, 93, 63, 25, 55, 20, 62,223, 35, 1, 63, 30, 63,144,
- 62,226,195,233, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,219,248,248, 62,222,116,246, 62,220,110,118, 62,229,193, 78,
- 62,215,109,102, 62,231,147,222, 62,209,232, 2, 62,226, 21,222, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 24,252, 87,
- 62,230,111, 93, 63, 22,195, 22, 62,232, 90,195, 63, 20, 91,191, 62,227, 18,193, 63, 25, 55, 20, 62,223, 35, 1, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,229,175,162, 62,226,100,178, 62,224,224,248, 62,231,172,182, 62,220,110,118, 62,229,193, 78,
- 62,219,248,248, 62,222,116,246, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 25, 55, 20, 62,223, 35, 1, 63, 20, 91,191,
- 62,227, 18,193, 63, 17,165,187, 62,221, 6,225, 63, 25,178,200, 62,214,233, 77, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,235, 27,170, 62,220, 88,214, 62,229,175,162, 62,226,100,178, 62,219,248,248, 62,222,116,246, 62,219, 1,146, 62,214, 59, 66,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 20, 91,191, 62,227, 18,193, 63, 18, 18,164, 62,236,201,173, 63, 13,231,157,
- 62,236,161, 89, 63, 17,165,187, 62,221, 6,225, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,242,151,232, 62,235,243, 70,
- 62,234, 65,216, 62,236, 27,158, 62,229,175,162, 62,226,100,178, 62,235, 27,170, 62,220, 88,214, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 22,195, 22, 62,232, 90,195, 63, 21,202, 11, 62,236,189, 1, 63, 18, 18,164, 62,236,201,173, 63, 20, 91,191,
- 62,227, 18,193, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,234, 65,216, 62,236, 27,158, 62,226,211, 12, 62,236, 14,246,
- 62,224,224,248, 62,231,172,182, 62,229,175,162, 62,226,100,178, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 21,202, 11,
- 62,236,189, 1, 63, 22,202,215, 62,241,124,237, 63, 20,105,125, 62,246, 71, 1, 63, 18, 18,164, 62,236,201,173, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,229,148, 42, 62,245,152,246, 62,224,209,112, 62,240,206,226, 62,226,211, 12, 62,236, 14,246,
- 62,234, 65,216, 62,236, 27,158, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 18, 18,164, 62,236,201,173, 63, 20,105,125,
- 62,246, 71, 1, 63, 17,173, 44, 62,252,149,231, 63, 13,231,157, 62,236,161, 89, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,235, 12,206, 62,251,231,218, 62,229,148, 42, 62,245,152,246, 62,234, 65,216, 62,236, 27,158, 62,242,151,232, 62,235,243, 70,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 20,105,125, 62,246, 71, 1, 63, 25, 59, 37, 62,250, 73, 49, 63, 25,178,108,
- 63, 1,108,218, 63, 17,173, 44, 62,252,149,231, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,219, 2, 76, 63, 1, 21,213,
- 62,219,240,216, 62,249,155, 38, 62,229,148, 42, 62,245,152,246, 62,235, 12,206, 62,251,231,218, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 22,202,215, 62,241,124,237, 63, 25, 1,195, 62,243,102,169, 63, 25, 59, 37, 62,250, 73, 49, 63, 20,105,125,
- 62,246, 71, 1, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,219,240,216, 62,249,155, 38, 62,220, 99,156, 62,242,184,154,
- 62,224,209,112, 62,240,206,226, 62,229,148, 42, 62,245,152,246, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 25, 1,195,
- 62,243,102,169, 63, 27,125,176, 62,241,145,149, 63, 30, 74,167, 62,246,153, 3, 63, 25, 59, 37, 62,250, 73, 49, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,209,209,212, 62,245,234,246, 62,215,107,192, 62,240,227,138, 62,220, 99,156, 62,242,184,154,
- 62,219,240,216, 62,249,155, 38, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 25, 59, 37, 62,250, 73, 49, 63, 30, 74,167,
- 62,246,153, 3, 63, 33,230,204, 62,252,232,107, 63, 25,178,108, 63, 1,108,218, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,202,153,132, 62,252, 58, 94, 62,209,209,212, 62,245,234,246, 62,219,240,216, 62,249,155, 38, 62,219, 2, 76, 63, 1, 21,213,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 30, 74,167, 62,246,153, 3, 63, 32,152,118, 62,236,167, 37, 63, 37,151,209,
- 62,236,161, 89, 63, 33,230,204, 62,252,232,107, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,195, 55,128, 62,235,243, 70,
- 62,205, 54, 56, 62,235,249, 22, 62,209,209,212, 62,245,234,246, 62,202,153,132, 62,252, 58, 94, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 27,125,176, 62,241,145,149, 63, 28,112, 3, 62,236,178,185, 63, 32,152,118, 62,236,167, 37, 63, 30, 74,167,
- 62,246,153, 3, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,205, 54, 56, 62,235,249, 22, 62,213,135, 28, 62,236, 4,172,
- 62,215,107,192, 62,240,227,138, 62,209,209,212, 62,245,234,246, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 28,112, 3,
- 62,236,178,185, 63, 27,125,176, 62,241,145,149, 63, 27, 39, 42, 62,241, 1, 57, 63, 27,249,140, 62,236,186,115, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,216, 24,206, 62,240, 83, 46, 62,215,107,192, 62,240,227,138, 62,213,135, 28, 62,236, 4,172,
- 62,214,116, 8, 62,236, 12,102, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 27,125,176, 62,241,145,149, 63, 25, 1,195,
- 62,243,102,169, 63, 24,248, 6, 62,242, 91,185, 63, 27, 39, 42, 62,241, 1, 57, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,220,119, 22, 62,241,173,174, 62,220, 99,156, 62,242,184,154, 62,215,107,192, 62,240,227,138, 62,216, 24,206, 62,240, 83, 46,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 25, 1,195, 62,243,102,169, 63, 22,202,215, 62,241,124,237, 63, 23, 38,157,
- 62,240,173,225, 63, 24,248, 6, 62,242, 91,185, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,224, 25,234, 62,239,255,214,
- 62,224,209,112, 62,240,206,226, 62,220, 99,156, 62,242,184,154, 62,220,119, 22, 62,241,173,174, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 22,202,215, 62,241,124,237, 63, 21,202, 11, 62,236,189, 1, 63, 22, 89, 13, 62,236,196,247, 63, 23, 38,157,
- 62,240,173,225, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,225,181, 8, 62,236, 22,234, 62,226,211, 12, 62,236, 14,246,
- 62,224,209,112, 62,240,206,226, 62,224, 25,234, 62,239,255,214, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 21,202, 11,
- 62,236,189, 1, 63, 22,195, 22, 62,232, 90,195, 63, 23, 33, 88, 62,233, 47, 69, 63, 22, 89, 13, 62,236,196,247, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62,224, 36,112, 62,232,129, 58, 62,224,224,248, 62,231,172,182, 62,226,211, 12, 62,236, 14,246,
- 62,225,181, 8, 62,236, 22,234, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 22,195, 22, 62,232, 90,195, 63, 24,252, 87,
- 62,230,111, 93, 63, 24,243,100, 62,231,123, 5, 63, 23, 33, 88, 62,233, 47, 69, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,220,128, 90, 62,230,204,248, 62,220,110,118, 62,229,193, 78, 62,224,224,248, 62,231,172,182, 62,224, 36,112, 62,232,129, 58,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 24,252, 87, 62,230,111, 93, 63, 27,124,224, 62,232, 65,235, 63, 27, 37,169,
- 62,232,211, 35, 63, 24,243,100, 62,231,123, 5, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,216, 27,206, 62,232, 37, 22,
- 62,215,109,102, 62,231,147,222, 62,220,110,118, 62,229,193, 78, 62,220,128, 90, 62,230,204,248, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,240, 63, 27,124,224, 62,232, 65,235, 63, 28,112, 3, 62,236,178,185, 63, 27,249,140, 62,236,186,115, 63, 27, 37,169,
- 62,232,211, 35, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,214,116, 8, 62,236, 12,102, 62,213,135, 28, 62,236, 4,172,
- 62,215,109,102, 62,231,147,222, 62,216, 27,206, 62,232, 37, 22, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,240, 63, 24,242,138,
- 62,236,194, 21, 63, 27, 37,169, 62,232,211, 35, 63, 27,249,140, 62,236,186,115, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,112, 62,214,116, 8, 62,236, 12,102, 62,216, 27,206, 62,232, 37, 22, 62,220,130, 16, 62,236, 20, 6,
- 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 24,243,100, 62,231,123, 5, 63, 27, 37,169,
- 62,232,211, 35, 63, 24,242,138, 62,236,194, 21, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112,
- 62,220,130, 16, 62,236, 20, 6, 62,216, 27,206, 62,232, 37, 22, 62,220,128, 90, 62,230,204,248, 63,128, 0, 0, 63,128, 0, 0,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 24,242,138, 62,236,194, 21, 63, 23, 33, 88, 62,233, 47, 69, 63, 24,243,100,
- 62,231,123, 5, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 62,220,128, 90, 62,230,204,248,
- 62,224, 36,112, 62,232,129, 58, 62,220,130, 16, 62,236, 20, 6, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,112, 63, 24,242,138, 62,236,194, 21, 63, 22, 89, 13, 62,236,196,247, 63, 23, 33, 88, 62,233, 47, 69, 63,128, 0, 0,
- 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 62,224, 36,112, 62,232,129, 58, 62,225,181, 8, 62,236, 22,234,
- 62,220,130, 16, 62,236, 20, 6, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 24,242,138,
- 62,236,194, 21, 63, 23, 38,157, 62,240,173,225, 63, 22, 89, 13, 62,236,196,247, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,112, 62,225,181, 8, 62,236, 22,234, 62,224, 25,234, 62,239,255,214, 62,220,130, 16, 62,236, 20, 6,
- 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 24,242,138, 62,236,194, 21, 63, 24,248, 6,
- 62,242, 91,185, 63, 23, 38,157, 62,240,173,225, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112,
- 62,224, 25,234, 62,239,255,214, 62,220,119, 22, 62,241,173,174, 62,220,130, 16, 62,236, 20, 6, 63,128, 0, 0, 63,128, 0, 0,
- 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 24,242,138, 62,236,194, 21, 63, 27, 39, 42, 62,241, 1, 57, 63, 24,248, 6,
- 62,242, 91,185, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 62,220,119, 22, 62,241,173,174,
- 62,216, 24,206, 62,240, 83, 46, 62,220,130, 16, 62,236, 20, 6, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5,
- 0, 0, 0,112, 63, 24,242,138, 62,236,194, 21, 63, 27,249,140, 62,236,186,115, 63, 27, 39, 42, 62,241, 1, 57, 63,128, 0, 0,
- 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 62,216, 24,206, 62,240, 83, 46, 62,214,116, 8, 62,236, 12,102,
- 62,220,130, 16, 62,236, 20, 6, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 61, 0, 0, 5, 0, 0, 0,112, 63, 16,254,174,
- 62, 34, 45, 94, 63, 13,190, 79, 62, 46,193,160, 63, 3,199,220, 62, 24,219, 89, 63, 3,199,219, 61,229, 28, 18, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 16, 63, 3,199,220, 62, 24,219, 89, 62,243,150, 14, 62, 47, 79,204, 62,236,248,140, 62, 34,202,182,
- 63, 3,199,219, 61,229, 28, 18, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 21,152,184, 62, 53, 47,182, 63, 16,104,250,
- 62, 55,113, 16, 63, 13,190, 79, 62, 46,193,160, 63, 16,254,174, 62, 34, 45, 94, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128,
- 62,243,150, 14, 62, 47, 79,204, 62,238, 68,200, 62, 56, 62, 76, 62,227,207,183, 62, 54, 75,250, 62,236,248,140, 62, 34,202,182,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 63, 22, 57,137, 62, 61, 93, 81, 63, 16,186,206, 62, 72,129, 85, 63, 16,104,250,
- 62, 55,113, 16, 63, 21,152,184, 62, 53, 47,182, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,238, 68,200, 62, 56, 62, 76,
- 62,237,187,192, 62, 73,118,194, 62,226,152,122, 62, 62,166,190, 62,227,207,183, 62, 54, 75,250, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 22,249,250, 62, 88,251,160, 63, 16, 32,222, 62, 93,106, 34, 63, 16,186,206, 62, 72,129, 85, 63, 22, 57,137,
- 62, 61, 93, 81, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,237,187,192, 62, 73,118,194, 62,239, 19, 21, 62, 94,110,121,
- 62,225, 83, 90, 62, 90,153, 21, 62,226,152,122, 62, 62,166,190, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 25, 81, 20,
- 62,132, 56, 17, 63, 15,243,206, 62,136,207,182, 63, 16, 32,222, 62, 93,106, 34, 63, 22,249,250, 62, 88,251,160, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,239, 19, 21, 62, 94,110,121, 62,239,193, 92, 62,137, 61,113, 62,221, 42, 54, 62,133, 25,209,
- 62,225, 83, 90, 62, 90,153, 21, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,239,111, 62,166, 77,159, 63, 37, 94, 91,
- 62,187,120,107, 63, 30, 21, 66, 62,200,139,178, 63, 12,237,158, 62,187,241, 38, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,211,125,139, 62,200,171,170, 62,197, 28,156, 62,187,130,166, 62,216, 21,115, 62,166,177, 14, 62,245,175, 15, 62,188, 14,188,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 37, 94, 91, 62,187,120,107, 63, 43, 57, 87, 62,206, 58,222, 63, 39,163, 24,
- 62,216, 95,174, 63, 30, 21, 66, 62,200,139,178, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,191,194, 98, 62,216, 94, 42,
- 62,184,207,130, 62,206, 27, 42, 62,197, 28,156, 62,187,130,166, 62,211,125,139, 62,200,171,170, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 43, 57, 87, 62,206, 58,222, 63, 50,229, 38, 62,226, 32,169, 63, 43, 79,177, 62,231,194,202, 63, 39,163, 24,
- 62,216, 95,174, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,183,201, 60, 62,231,218, 82, 62,168, 39,196, 62,226, 11,206,
- 62,184,207,130, 62,206, 27, 42, 62,191,194, 98, 62,216, 94, 42, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 50,229, 38,
- 62,226, 32,169, 63, 48,134, 62, 62,249,107, 37, 63, 43,190,154, 62,249, 0,192, 63, 43, 79,177, 62,231,194,202, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,182,190,138, 62,249, 49, 35, 62,172,229,172, 62,249,127,116, 62,168, 39,196, 62,226, 11,206,
- 62,183,201, 60, 62,231,218, 82, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 48,134, 62, 62,249,107, 37, 63, 46, 88,238,
- 63, 2,223,146, 63, 40,207,123, 62,254,175,218, 63, 43,190,154, 62,249, 0,192, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,188,184, 2, 62,255, 0,140, 62,177, 87,173, 63, 3, 9,102, 62,172,229,172, 62,249,127,116, 62,182,190,138, 62,249, 49, 35,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 46, 88,238, 63, 2,223,146, 63, 34,158,220, 63, 10, 23,175, 63, 30, 77,126,
- 63, 5, 88,156, 63, 40,207,123, 62,254,175,218, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,210, 65, 89, 63, 5,158, 56,
- 62,201,109,124, 63, 10,121, 72, 62,177, 87,173, 63, 3, 9,102, 62,188,184, 2, 62,255, 0,140, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 34,158,220, 63, 10, 23,175, 63, 26,105, 28, 63, 11,194,242, 63, 25,120,244, 63, 7,242, 78, 63, 30, 77,126,
- 63, 5, 88,156, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,220, 39, 0, 63, 8, 58,252, 62,218, 73,220, 63, 12, 31,169,
- 62,201,109,124, 63, 10,121, 72, 62,210, 65, 89, 63, 5,158, 56, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 26,105, 28,
- 63, 11,194,242, 63, 22,244,173, 63, 11,215,236, 63, 22, 47,202, 63, 8, 60,156, 63, 25,120,244, 63, 7,242, 78, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,226,221, 11, 63, 8,125, 90, 62,225, 89,220, 63, 12, 42, 77, 62,218, 73,220, 63, 12, 31,169,
- 62,220, 39, 0, 63, 8, 58,252, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22,244,173, 63, 11,215,236, 63, 11,169, 67,
- 63, 11,197, 18, 63, 12,252,106, 63, 3,173,180, 63, 22, 47,202, 63, 8, 60,156, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,245,114, 35, 63, 3,196,233, 62,248, 72, 55, 63, 11,232, 91, 62,225, 89,220, 63, 12, 42, 77, 62,226,221, 11, 63, 8,125, 90,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 11,169, 67, 63, 11,197, 18, 63, 3,232,148, 63, 11, 17,164, 63, 3,220,162,
- 63, 0, 88, 45, 63, 12,252,106, 63, 3,173,180, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,220,162, 63, 0, 88, 45,
- 63, 3,232,148, 63, 11, 17,164, 62,248, 72, 55, 63, 11,232, 91, 62,245,114, 35, 63, 3,196,233, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 17, 59,103, 62,255,195,120, 63, 22, 81,240, 63, 1, 70,114, 63, 22, 47,202, 63, 8, 60,156, 63, 12,252,106,
- 63, 3,173,180, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,226,221, 11, 63, 8,125, 90, 62,226,128,106, 63, 1,111,198,
- 62,236,213,209, 62,255,250, 4, 62,245,114, 35, 63, 3,196,233, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22, 81,240,
- 63, 1, 70,114, 63, 25,182,151, 63, 1, 9,130, 63, 25,120,244, 63, 7,242, 78, 63, 22, 47,202, 63, 8, 60,156, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,220, 39, 0, 63, 8, 58,252, 62,219,150,213, 63, 1, 55, 50, 62,226,128,106, 63, 1,111,198,
- 62,226,221, 11, 63, 8,125, 90, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 30, 49, 96, 62,254,229,121, 63, 30, 77,126,
- 63, 5, 88,156, 63, 25,120,244, 63, 7,242, 78, 63, 25,182,151, 63, 1, 9,130, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,220, 39, 0, 63, 8, 58,252, 62,210, 65, 89, 63, 5,158, 56, 62,210,116,176, 62,255, 62,227, 62,219,150,213, 63, 1, 55, 50,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 37,113, 25, 62,247,157, 35, 63, 40,207,123, 62,254,175,218, 63, 30, 77,126,
- 63, 5, 88,156, 63, 30, 49, 96, 62,254,229,121, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,210, 65, 89, 63, 5,158, 56,
- 62,188,184, 2, 62,255, 0,140, 62,195,165,189, 62,247,232,139, 62,210,116,176, 62,255, 62,227, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 39, 62, 92, 62,240, 75,121, 63, 43,190,154, 62,249, 0,192, 63, 40,207,123, 62,254,175,218, 63, 37,113, 25,
- 62,247,157, 35, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,188,184, 2, 62,255, 0,140, 62,182,190,138, 62,249, 49, 35,
- 62,192, 10,222, 62,240,128,163, 62,195,165,189, 62,247,232,139, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 38,149,140,
- 62,229, 95, 38, 63, 43, 79,177, 62,231,194,202, 63, 43,190,154, 62,249, 0,192, 63, 39, 62, 92, 62,240, 75,121, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,182,190,138, 62,249, 49, 35, 62,183,201, 60, 62,231,218, 82, 62,193,140,168, 62,229,129, 94,
- 62,192, 10,222, 62,240,128,163, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 33,120, 14, 62,214,238,166, 63, 39,163, 24,
- 62,216, 95,174, 63, 43, 79,177, 62,231,194,202, 63, 38,149,140, 62,229, 95, 38, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,183,201, 60, 62,231,218, 82, 62,191,194, 98, 62,216, 94, 42, 62,204, 75,168, 62,215, 7, 62, 62,193,140,168, 62,229,129, 94,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,178,165, 62,208, 17,128, 63, 30, 21, 66, 62,200,139,178, 63, 39,163, 24,
- 62,216, 95,174, 63, 33,120, 14, 62,214,238,166, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,191,194, 98, 62,216, 94, 42,
- 62,211,125,139, 62,200,171,170, 62,216, 24, 6, 62,208, 57,128, 62,204, 75,168, 62,215, 7, 62, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 17, 97, 15, 62,214, 34,220, 63, 12,237,158, 62,187,241, 38, 63, 30, 21, 66, 62,200,139,178, 63, 27,178,165,
- 62,208, 17,128, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,211,125,139, 62,200,171,170, 62,245,175, 15, 62,188, 14,188,
- 62,236,200,217, 62,214, 49,134, 62,216, 24, 6, 62,208, 57,128, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 17, 97, 15,
- 62,214, 34,220, 63, 14,244,149, 62,221, 42, 4, 63, 3,230,147, 62,208, 47, 78, 63, 12,237,158, 62,187,241, 38, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,230,147, 62,208, 47, 78, 62,241,144,141, 62,221, 52,244, 62,236,200,217, 62,214, 49,134,
- 62,245,175, 15, 62,188, 14,188, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 17, 59,103, 62,255,195,120, 63, 12,252,106,
- 63, 3,173,180, 63, 3,220,162, 63, 0, 88, 45, 63, 13, 25, 71, 62,243,163,116, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 63, 3,220,162, 63, 0, 88, 45, 62,245,114, 35, 63, 3,196,233, 62,236,213,209, 62,255,250, 4, 62,245, 45, 0, 62,243,185,206,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 13, 25, 71, 62,243,163,116, 63, 3,220,162, 63, 0, 88, 45, 63, 3,220,215,
- 62,231,189,148, 63, 13, 2, 64, 62,230,215, 52, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,220,215, 62,231,189,148,
- 63, 3,220,162, 63, 0, 88, 45, 62,245, 45, 0, 62,243,185,206, 62,245,100,219, 62,230,230,184, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,230,147, 62,208, 47, 78, 63, 14,244,149, 62,221, 42, 4, 63, 13, 2, 64, 62,230,215, 52, 63, 3,220,215,
- 62,231,189,148, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,245,100,219, 62,230,230,184, 62,241,144,141, 62,221, 52,244,
- 63, 3,230,147, 62,208, 47, 78, 63, 3,220,215, 62,231,189,148, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 7, 61,250,
- 62, 54, 31,148, 63, 3,202,193, 62, 49,174,214, 63, 3,199,220, 62, 24,219, 89, 63, 13,190, 79, 62, 46,193,160, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,199,220, 62, 24,219, 89, 63, 3,202,193, 62, 49,174,214, 63, 0, 87,175, 62, 54, 90,251,
- 62,243,150, 14, 62, 47, 79,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 9,214, 68, 62, 66,237,246, 63, 7, 61,250,
- 62, 54, 31,148, 63, 13,190, 79, 62, 46,193,160, 63, 16,104,250, 62, 55,113, 16, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,243,150, 14, 62, 47, 79,204, 63, 0, 87,175, 62, 54, 90,251, 62,251,137,104, 62, 67, 92,179, 62,238, 68,200, 62, 56, 62, 76,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 8,221,237, 62, 91, 90,218, 63, 9,214, 68, 62, 66,237,246, 63, 16,104,250,
- 62, 55,113, 16, 63, 16,186,206, 62, 72,129, 85, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,238, 68,200, 62, 56, 62, 76,
- 62,251,137,104, 62, 67, 92,179, 62,253,153, 39, 62, 91,195, 27, 62,237,187,192, 62, 73,118,194, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 15,243,206, 62,136,207,182, 63, 8, 32, 77, 62,139, 39, 10, 63, 9,117, 22, 62, 97,203,146, 63, 16, 32,222,
- 62, 93,106, 34, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,252,110,192, 62, 98, 68, 79, 62,255, 89,219, 62,139, 79,116,
- 62,239,193, 92, 62,137, 61,113, 62,239, 19, 21, 62, 94,110,121, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 8,221,237,
- 62, 91, 90,218, 63, 16,186,206, 62, 72,129, 85, 63, 16, 32,222, 62, 93,106, 34, 63, 9,117, 22, 62, 97,203,146, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,239, 19, 21, 62, 94,110,121, 62,237,187,192, 62, 73,118,194, 62,253,153, 39, 62, 91,195, 27,
- 62,252,110,192, 62, 98, 68, 79, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 9,125,119, 62,158,112, 7, 63, 3,233, 70,
- 62,154, 27, 88, 63, 3,229,235, 62,139,108, 97, 63, 8, 32, 77, 62,139, 39, 10, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 63, 3,229,235, 62,139,108, 97, 63, 3,233, 70, 62,154, 27, 88, 62,252,179,165, 62,158,140,163, 62,255, 89,219, 62,139, 79,116,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 9,117, 22, 62, 97,203,146, 63, 8, 32, 77, 62,139, 39, 10, 63, 3,229,235,
- 62,139,108, 97, 63, 3,215,246, 62,101, 56,143, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,229,235, 62,139,108, 97,
- 62,255, 89,219, 62,139, 79,116, 62,252,110,192, 62, 98, 68, 79, 63, 3,215,246, 62,101, 56,143, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,210,147, 62, 86, 95,221, 63, 8,221,237, 62, 91, 90,218, 63, 9,117, 22, 62, 97,203,146, 63, 3,215,246,
- 62,101, 56,143, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,252,110,192, 62, 98, 68, 79, 62,253,153, 39, 62, 91,195, 27,
- 63, 3,210,147, 62, 86, 95,221, 63, 3,215,246, 62,101, 56,143, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 12, 54, 5,
- 62,167,183,188, 63, 9, 61,250, 62,168,214,252, 63, 8,143,152, 62,163,107, 45, 63, 9,125,119, 62,158,112, 7, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,254,136,100, 62,163,123, 38, 62,253, 39,110, 62,168,224,103, 62,247, 68, 98, 62,167,206,146,
- 62,252,179,165, 62,158,140,163, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 10,196,135, 62,178,208, 52, 63, 8,233, 25,
- 62,175,110,116, 63, 9, 61,250, 62,168,214,252, 63, 12, 54, 5, 62,167,183,188, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,253, 39,110, 62,168,224,103, 62,253,195,102, 62,175,102,184, 62,250, 14, 98, 62,178,202,149, 62,247, 68, 98, 62,167,206,146,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 4, 17, 69, 62,182,176,105, 63, 6,138, 69, 62,177,180, 80, 63, 8,233, 25,
- 62,175,110,116, 63, 10,196,135, 62,178,208, 52, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,253,195,102, 62,175,102,184,
- 63, 1, 49, 14, 62,177,150, 62, 63, 4, 17, 69, 62,182,176,105, 62,250, 14, 98, 62,178,202,149, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,124,209, 62,177, 0, 70, 63, 3,232, 11, 62,174, 4,140, 63, 6,138, 69, 62,177,180, 80, 63, 4, 17, 69,
- 62,182,176,105, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 1, 49, 14, 62,177,150, 62, 63, 3,232, 11, 62,174, 4,140,
- 63, 3,124,209, 62,177, 0, 70, 63, 4, 17, 69, 62,182,176,105, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,233, 70,
- 62,154, 27, 88, 63, 9,125,119, 62,158,112, 7, 63, 8,143,152, 62,163,107, 45, 63, 3,232,212, 62,158,152, 58, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,254,136,100, 62,163,123, 38, 62,252,179,165, 62,158,140,163, 63, 3,233, 70, 62,154, 27, 88,
- 63, 3,232,212, 62,158,152, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,232,212, 62,158,152, 58, 63, 8,143,152,
- 62,163,107, 45, 63, 7, 91,121, 62,166, 51,134, 63, 3,231,205, 62,162,149, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 63, 0,116, 44, 62,166, 56,255, 62,254,136,100, 62,163,123, 38, 63, 3,232,212, 62,158,152, 58, 63, 3,231,205, 62,162,149, 58,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,232, 11, 62,174, 4,140, 63, 3,233,214, 62,170,154,198, 63, 6,110,233,
- 62,174,152, 94, 63, 6,138, 69, 62,177,180, 80, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 1, 82,228, 62,174,140, 95,
- 63, 3,233,214, 62,170,154,198, 63, 3,232, 11, 62,174, 4,140, 63, 1, 49, 14, 62,177,150, 62, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 6,138, 69, 62,177,180, 80, 63, 6,110,233, 62,174,152, 94, 63, 7,236, 59, 62,173,123, 19, 63, 8,233, 25,
- 62,175,110,116, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,255,185,217, 62,173,116, 92, 63, 1, 82,228, 62,174,140, 95,
- 63, 1, 49, 14, 62,177,150, 62, 62,253,195,102, 62,175,102,184, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 8,233, 25,
- 62,175,110,116, 63, 7,236, 59, 62,173,123, 19, 63, 7,249, 85, 62,169, 52, 92, 63, 9, 61,250, 62,168,214,252, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,255,169,160, 62,169, 57, 6, 62,255,185,217, 62,173,116, 92, 62,253,195,102, 62,175,102,184,
- 62,253, 39,110, 62,168,224,103, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 9, 61,250, 62,168,214,252, 63, 7,249, 85,
- 62,169, 52, 92, 63, 7, 91,121, 62,166, 51,134, 63, 8,143,152, 62,163,107, 45, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 63, 0,116, 44, 62,166, 56,255, 62,255,169,160, 62,169, 57, 6, 62,253, 39,110, 62,168,224,103, 62,254,136,100, 62,163,123, 38,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,233,214, 62,170,154,198, 63, 7,249, 85, 62,169, 52, 92, 63, 7,236, 59,
- 62,173,123, 19, 63, 6,110,233, 62,174,152, 94, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,255,185,217, 62,173,116, 92,
- 62,255,169,160, 62,169, 57, 6, 63, 3,233,214, 62,170,154,198, 63, 1, 82,228, 62,174,140, 95, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,233,214, 62,170,154,198, 63, 3,231,205, 62,162,149, 58, 63, 7, 91,121, 62,166, 51,134, 63, 7,249, 85,
- 62,169, 52, 92, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 0,116, 44, 62,166, 56,255, 63, 3,231,205, 62,162,149, 58,
- 63, 3,233,214, 62,170,154,198, 62,255,169,160, 62,169, 57, 6, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 4, 17, 69,
- 62,182,176,105, 63, 10,196,135, 62,178,208, 52, 63, 12,237,158, 62,187,241, 38, 63, 3,230,147, 62,208, 47, 78, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,245,175, 15, 62,188, 14,188, 62,250, 14, 98, 62,178,202,149, 63, 4, 17, 69, 62,182,176,105,
- 63, 3,230,147, 62,208, 47, 78, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 10,196,135, 62,178,208, 52, 63, 12, 54, 5,
- 62,167,183,188, 63, 16, 0,112, 62,164,246,254, 63, 12,237,158, 62,187,241, 38, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,239,187,207, 62,165, 42, 19, 62,247, 68, 98, 62,167,206,146, 62,250, 14, 98, 62,178,202,149, 62,245,175, 15, 62,188, 14,188,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 12, 54, 5, 62,167,183,188, 63, 9,125,119, 62,158,112, 7, 63, 15,250, 44,
- 62,154, 0,109, 63, 16, 0,112, 62,164,246,254, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,239,205, 56, 62,154, 71, 8,
- 62,252,179,165, 62,158,140,163, 62,247, 68, 98, 62,167,206,146, 62,239,187,207, 62,165, 42, 19, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 9,125,119, 62,158,112, 7, 63, 8, 32, 77, 62,139, 39, 10, 63, 15,243,206, 62,136,207,182, 63, 15,250, 44,
- 62,154, 0,109, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,239,193, 92, 62,137, 61,113, 62,255, 89,219, 62,139, 79,116,
- 62,252,179,165, 62,158,140,163, 62,239,205, 56, 62,154, 71, 8, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 25, 81, 20,
- 62,132, 56, 17, 63, 27, 46,208, 62,148, 35,149, 63, 15,250, 44, 62,154, 0,109, 63, 15,243,206, 62,136,207,182, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,239,205, 56, 62,154, 71, 8, 62,217,166,238, 62,148,221,229, 62,221, 42, 54, 62,133, 25,209,
- 62,239,193, 92, 62,137, 61,113, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27, 46,208, 62,148, 35,149, 63, 27,177, 36,
- 62,156,151,158, 63, 16, 0,112, 62,164,246,254, 63, 15,250, 44, 62,154, 0,109, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,239,187,207, 62,165, 42, 19, 62,216,160, 0, 62,157, 44,127, 62,217,166,238, 62,148,221,229, 62,239,205, 56, 62,154, 71, 8,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,239,111, 62,166, 77,159, 63, 12,237,158, 62,187,241, 38, 63, 16, 0,112,
- 62,164,246,254, 63, 27,177, 36, 62,156,151,158, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,239,187,207, 62,165, 42, 19,
- 62,245,175, 15, 62,188, 14,188, 62,216, 21,115, 62,166,177, 14, 62,216,160, 0, 62,157, 44,127, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 8,221,237, 62, 91, 90,218, 63, 3,210,147, 62, 86, 95,221, 63, 3,211,129, 62, 83,168,248, 63, 8, 33,170,
- 62, 86,149,254, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,211,129, 62, 83,168,248, 63, 3,210,147, 62, 86, 95,221,
- 62,253,153, 39, 62, 91,195, 27, 62,255, 14, 8, 62, 86,232, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 9,214, 68,
- 62, 66,237,246, 63, 8,221,237, 62, 91, 90,218, 63, 8, 33,170, 62, 86,149,254, 63, 8,180, 20, 62, 69, 29, 94, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,255, 14, 8, 62, 86,232, 58, 62,253,153, 39, 62, 91,195, 27, 62,251,137,104, 62, 67, 92,179,
- 62,253,210, 19, 62, 69,114, 55, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 7, 61,250, 62, 54, 31,148, 63, 9,214, 68,
- 62, 66,237,246, 63, 8,180, 20, 62, 69, 29, 94, 63, 6, 82,168, 62, 57, 43, 80, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,253,210, 19, 62, 69,114, 55, 62,251,137,104, 62, 67, 92,179, 63, 0, 87,175, 62, 54, 90,251, 63, 1, 68, 48, 62, 57, 84,166,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,202,193, 62, 49,174,214, 63, 7, 61,250, 62, 54, 31,148, 63, 6, 82,168,
- 62, 57, 43, 80, 63, 3,202,205, 62, 54, 22, 8, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 1, 68, 48, 62, 57, 84,166,
- 63, 0, 87,175, 62, 54, 90,251, 63, 3,202,193, 62, 49,174,214, 63, 3,202,205, 62, 54, 22, 8, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,202,205, 62, 54, 22, 8, 63, 6, 82,168, 62, 57, 43, 80, 63, 5, 24,246, 62, 66,150, 26, 63, 3,205,213,
- 62, 64,232,220, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 2,131, 29, 62, 66,172, 22, 63, 1, 68, 48, 62, 57, 84,166,
- 63, 3,202,205, 62, 54, 22, 8, 63, 3,205,213, 62, 64,232,220, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 6, 82,168,
- 62, 57, 43, 80, 63, 8,180, 20, 62, 69, 29, 94, 63, 6, 83, 39, 62, 70,114,191, 63, 5, 24,246, 62, 66,150, 26, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 63, 1, 75,185, 62, 70,160,222, 62,253,210, 19, 62, 69,114, 55, 63, 1, 68, 48, 62, 57, 84,166,
- 63, 2,131, 29, 62, 66,172, 22, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 8,180, 20, 62, 69, 29, 94, 63, 8, 33,170,
- 62, 86,149,254, 63, 6,111, 4, 62, 76,172, 40, 63, 6, 83, 39, 62, 70,114,191, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 63, 1, 51,157, 62, 76,218,158, 62,255, 14, 8, 62, 86,232, 58, 62,253,210, 19, 62, 69,114, 55, 63, 1, 75,185, 62, 70,160,222,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 8, 33,170, 62, 86,149,254, 63, 3,211,129, 62, 83,168,248, 63, 3,208,234,
- 62, 75, 43,146, 63, 6,111, 4, 62, 76,172, 40, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 3,208,234, 62, 75, 43,146,
- 63, 3,211,129, 62, 83,168,248, 62,255, 14, 8, 62, 86,232, 58, 63, 1, 51,157, 62, 76,218,158, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,208,234, 62, 75, 43,146, 63, 3,205,213, 62, 64,232,220, 63, 5, 24,246, 62, 66,150, 26, 63, 6,111, 4,
- 62, 76,172, 40, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 2,131, 29, 62, 66,172, 22, 63, 3,205,213, 62, 64,232,220,
- 63, 3,208,234, 62, 75, 43,146, 63, 1, 51,157, 62, 76,218,158, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 6,111, 4,
- 62, 76,172, 40, 63, 5, 24,246, 62, 66,150, 26, 63, 6, 83, 39, 62, 70,114,191, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 63, 1, 75,185, 62, 70,160,222, 63, 2,131, 29, 62, 66,172, 22, 63, 1, 51,157, 62, 76,218,158,
- 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 13, 2, 64, 62,230,215, 52, 63, 14,244,149,
- 62,221, 42, 4, 63, 16,216, 4, 62,224, 24,160, 63, 15,200,120, 62,231,255, 84, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,237,193,119, 62,224, 38,190, 62,241,144,141, 62,221, 52,244, 62,245,100,219, 62,230,230,184, 62,239,211, 21, 62,232, 18,185,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 13, 25, 71, 62,243,163,116, 63, 13, 2, 64, 62,230,215, 52, 63, 15,200,120,
- 62,231,255, 84, 63, 16,171,184, 62,241,133, 40, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,239,211, 21, 62,232, 18,185,
- 62,245,100,219, 62,230,230,184, 62,245, 45, 0, 62,243,185,206, 62,237,252,218, 62,241,160, 62, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 17, 59,103, 62,255,195,120, 63, 13, 25, 71, 62,243,163,116, 63, 16,171,184, 62,241,133, 40, 63, 19, 44, 55,
- 62,250, 21, 86, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,237,252,218, 62,241,160, 62, 62,245, 45, 0, 62,243,185,206,
- 62,236,213,209, 62,255,250, 4, 62,232,228,153, 62,250, 67,154, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 14,244,149,
- 62,221, 42, 4, 63, 17, 97, 15, 62,214, 34,220, 63, 19, 53,217, 62,218,211, 16, 63, 16,216, 4, 62,224, 24,160, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,233, 14, 8, 62,218,226, 66, 62,236,200,217, 62,214, 49,134, 62,241,144,141, 62,221, 52,244,
- 62,237,193,119, 62,224, 38,190, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 17, 97, 15, 62,214, 34,220, 63, 27,178,165,
- 62,208, 17,128, 63, 26,198,205, 62,214,184,124, 63, 19, 53,217, 62,218,211, 16, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,217,214,216, 62,214,224,218, 62,216, 24, 6, 62,208, 57,128, 62,236,200,217, 62,214, 49,134, 62,233, 14, 8, 62,218,226, 66,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,178,165, 62,208, 17,128, 63, 33,120, 14, 62,214,238,166, 63, 31,136,156,
- 62,219,138,194, 63, 26,198,205, 62,214,184,124, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,208, 30,254, 62,219,177,204,
- 62,204, 75,168, 62,215, 7, 62, 62,216, 24, 6, 62,208, 57,128, 62,217,214,216, 62,214,224,218, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 33,120, 14, 62,214,238,166, 63, 38,149,140, 62,229, 95, 38, 63, 36, 9, 79, 62,229,224, 94, 63, 31,136,156,
- 62,219,138,194, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,198,192,148, 62,230, 11,182, 62,193,140,168, 62,229,129, 94,
- 62,204, 75,168, 62,215, 7, 62, 62,208, 30,254, 62,219,177,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 38,149,140,
- 62,229, 95, 38, 63, 39, 62, 92, 62,240, 75,121, 63, 36, 49, 14, 62,239, 88,253, 63, 36, 9, 79, 62,229,224, 94, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,198, 71, 97, 62,239,149,192, 62,192, 10,222, 62,240,128,163, 62,193,140,168, 62,229,129, 94,
- 62,198,192,148, 62,230, 11,182, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 39, 62, 92, 62,240, 75,121, 63, 37,113, 25,
- 62,247,157, 35, 63, 35, 33,243, 62,245,143, 80, 63, 36, 49, 14, 62,239, 88,253, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,200, 99, 87, 62,245,217,172, 62,195,165,189, 62,247,232,139, 62,192, 10,222, 62,240,128,163, 62,198, 71, 97, 62,239,149,192,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 37,113, 25, 62,247,157, 35, 63, 30, 49, 96, 62,254,229,121, 63, 29, 49,223,
- 62,250,140,199, 63, 35, 33,243, 62,245,143, 80, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,212,124,147, 62,250,215,146,
- 62,210,116,176, 62,255, 62,227, 62,195,165,189, 62,247,232,139, 62,200, 99, 87, 62,245,217,172, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 30, 49, 96, 62,254,229,121, 63, 25,182,151, 63, 1, 9,130, 63, 25,181, 50, 62,253,111,118, 63, 29, 49,223,
- 62,250,140,199, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,219,151, 52, 62,253,186, 68, 62,219,150,213, 63, 1, 55, 50,
- 62,210,116,176, 62,255, 62,227, 62,212,124,147, 62,250,215,146, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 25,182,151,
- 63, 1, 9,130, 63, 22, 81,240, 63, 1, 70,114, 63, 22,188,241, 62,253,149, 28, 63, 25,181, 50, 62,253,111,118, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,225,163,212, 62,253,215, 91, 62,226,128,106, 63, 1,111,198, 62,219,150,213, 63, 1, 55, 50,
- 62,219,151, 52, 62,253,186, 68, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22, 81,240, 63, 1, 70,114, 63, 17, 59,103,
- 62,255,195,120, 63, 19, 44, 55, 62,250, 21, 86, 63, 22,188,241, 62,253,149, 28, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,232,228,153, 62,250, 67,154, 62,236,213,209, 62,255,250, 4, 62,226,128,106, 63, 1,111,198, 62,225,163,212, 62,253,215, 91,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22,188,241, 62,253,149, 28, 63, 19, 44, 55, 62,250, 21, 86, 63, 20,165, 9,
- 62,247, 99,248, 63, 23, 0, 20, 62,251, 57, 6, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,229,232,232, 62,247,142, 74,
- 62,232,228,153, 62,250, 67,154, 62,225,163,212, 62,253,215, 91, 62,225, 26,145, 62,251,116,114, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 25,181, 50, 62,253,111,118, 63, 22,188,241, 62,253,149, 28, 63, 23, 0, 20, 62,251, 57, 6, 63, 25,144,130,
- 62,251, 7,128, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,225, 26,145, 62,251,116,114, 62,225,163,212, 62,253,215, 91,
- 62,219,151, 52, 62,253,186, 68, 62,219,225,177, 62,251, 75, 67, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 29, 49,223,
- 62,250,140,199, 63, 25,181, 50, 62,253,111,118, 63, 25,144,130, 62,251, 7,128, 63, 28,195, 80, 62,248,166, 55, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,219,225,177, 62,251, 75, 67, 62,219,151, 52, 62,253,186, 68, 62,212,124,147, 62,250,215,146,
- 62,213, 95,233, 62,248,237, 20, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 35, 33,243, 62,245,143, 80, 63, 29, 49,223,
- 62,250,140,199, 63, 28,195, 80, 62,248,166, 55, 63, 33,164, 22, 62,243, 75,102, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,213, 95,233, 62,248,237, 20, 62,212,124,147, 62,250,215,146, 62,200, 99, 87, 62,245,217,172, 62,203,114, 65, 62,243,143,159,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 36, 49, 14, 62,239, 88,253, 63, 35, 33,243, 62,245,143, 80, 63, 33,164, 22,
- 62,243, 75,102, 63, 34,160, 30, 62,238, 47,169, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,203,114, 65, 62,243,143,159,
- 62,200, 99, 87, 62,245,217,172, 62,198, 71, 97, 62,239,149,192, 62,201,128,188, 62,238,110,126, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 36, 9, 79, 62,229,224, 94, 63, 36, 49, 14, 62,239, 88,253, 63, 34,160, 30, 62,238, 47,169, 63, 34,144,131,
- 62,231, 87,253, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,201,128,188, 62,238,110,126, 62,198, 71, 97, 62,239,149,192,
- 62,198,192,148, 62,230, 11,182, 62,201,190,141, 62,231,140,124, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 31,136,156,
- 62,219,138,194, 63, 36, 9, 79, 62,229,224, 94, 63, 34,144,131, 62,231, 87,253, 63, 30,208, 21, 62,221,182,174, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,201,190,141, 62,231,140,124, 62,198,192,148, 62,230, 11,182, 62,208, 30,254, 62,219,177,204,
- 62,209,133,168, 62,221,221, 51, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 26,198,205, 62,214,184,124, 63, 31,136,156,
- 62,219,138,194, 63, 30,208, 21, 62,221,182,174, 63, 26,218,128, 62,217,206, 68, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,209,133,168, 62,221,221, 51, 62,208, 30,254, 62,219,177,204, 62,217,214,216, 62,214,224,218, 62,217,157, 11, 62,217,243, 64,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 19, 53,217, 62,218,211, 16, 63, 26,198,205, 62,214,184,124, 63, 26,218,128,
- 62,217,206, 68, 63, 20, 53,103, 62,221, 84,236, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,217,157, 11, 62,217,243, 64,
- 62,217,214,216, 62,214,224,218, 62,233, 14, 8, 62,218,226, 66, 62,231, 5, 68, 62,221,101,234, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 16,216, 4, 62,224, 24,160, 63, 19, 53,217, 62,218,211, 16, 63, 20, 53,103, 62,221, 84,236, 63, 18, 87, 81,
- 62,226,175, 33, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,231, 5, 68, 62,221,101,234, 62,233, 14, 8, 62,218,226, 66,
- 62,237,193,119, 62,224, 38,190, 62,234,187,180, 62,226,190,249, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 19, 44, 55,
- 62,250, 21, 86, 63, 16,171,184, 62,241,133, 40, 63, 18, 68, 98, 62,240,197,150, 63, 20,165, 9, 62,247, 99,248, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,234,197, 35, 62,240,226,215, 62,237,252,218, 62,241,160, 62, 62,232,228,153, 62,250, 67,154,
- 62,229,232,232, 62,247,142, 74, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 16,171,184, 62,241,133, 40, 63, 15,200,120,
- 62,231,255, 84, 63, 18, 4,161, 62,232,184,138, 63, 18, 68, 98, 62,240,197,150, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,235, 85,154, 62,232,206, 92, 62,239,211, 21, 62,232, 18,185, 62,237,252,218, 62,241,160, 62, 62,234,197, 35, 62,240,226,215,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 15,200,120, 62,231,255, 84, 63, 16,216, 4, 62,224, 24,160, 63, 18, 87, 81,
- 62,226,175, 33, 63, 18, 4,161, 62,232,184,138, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,234,187,180, 62,226,190,249,
- 62,237,193,119, 62,224, 38,190, 62,239,211, 21, 62,232, 18,185, 62,235, 85,154, 62,232,206, 92, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 3,232,148, 63, 11, 17,164, 63, 11,169, 67, 63, 11,197, 18, 63, 13,120,216, 63, 23, 81,160, 63, 4, 15,147,
- 63, 23,248,227, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,245, 27, 64, 63, 23,166,100, 62,248, 72, 55, 63, 11,232, 91,
- 63, 3,232,148, 63, 11, 17,164, 63, 4, 15,147, 63, 23,248,227, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 11,169, 67,
- 63, 11,197, 18, 63, 22,244,173, 63, 11,215,236, 63, 23,233, 94, 63, 16, 60,186, 63, 13,120,216, 63, 23, 81,160, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,223,130,109, 63, 16,165,118, 62,225, 89,220, 63, 12, 42, 77, 62,248, 72, 55, 63, 11,232, 91,
- 62,245, 27, 64, 63, 23,166,100, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22,244,173, 63, 11,215,236, 63, 26,105, 28,
- 63, 11,194,242, 63, 28, 56,220, 63, 14,250, 66, 63, 23,233, 94, 63, 16, 60,186, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,214,161,157, 63, 15,110,219, 62,218, 73,220, 63, 12, 31,169, 62,225, 89,220, 63, 12, 42, 77, 62,223,130,109, 63, 16,165,118,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 26,105, 28, 63, 11,194,242, 63, 34,158,220, 63, 10, 23,175, 63, 39, 44,109,
- 63, 19,221,107, 63, 28, 56,220, 63, 14,250, 66, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,192, 26,156, 63, 20,139, 31,
- 62,201,109,124, 63, 10,121, 72, 62,218, 73,220, 63, 12, 31,169, 62,214,161,157, 63, 15,110,219, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 34,158,220, 63, 10, 23,175, 63, 46, 88,238, 63, 2,223,146, 63, 56, 80,242, 63, 6,244, 44, 63, 39, 44,109,
- 63, 19,221,107, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 62,156,208, 61, 63, 7, 16,204, 62,177, 87,173, 63, 3, 9,102,
- 62,201,109,124, 63, 10,121, 72, 62,192, 26,156, 63, 20,139, 31, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 63, 46, 88,238,
- 63, 2,223,146, 63, 48,134, 62, 62,249,107, 37, 63, 54,173,195, 62,252,106,239, 63, 56, 80,242, 63, 6,244, 44, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,128, 62,160, 36,202, 62,252, 51, 94, 62,172,229,172, 62,249,127,116, 62,177, 87,173, 63, 3, 9,102,
- 62,156,208, 61, 63, 7, 16,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 63, 48,134, 62, 62,249,107, 37, 63, 50,229, 38,
- 62,226, 32,169, 63, 53, 88,154, 62,221,146,240, 63, 54,173,195, 62,252,106,239, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64,
- 62,162,172,128, 62,221,169, 17, 62,168, 39,196, 62,226, 11,206, 62,172,229,172, 62,249,127,116, 62,160, 36,202, 62,252, 51, 94,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 63, 50,229, 38, 62,226, 32,169, 63, 43, 57, 87, 62,206, 58,222, 63, 49,117,240,
- 62,198,138,164, 63, 53, 88,154, 62,221,146,240, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 62,172,137,147, 62,198, 19,148,
- 62,184,207,130, 62,206, 27, 42, 62,168, 39,196, 62,226, 11,206, 62,162,172,128, 62,221,169, 17, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0,128, 63, 43, 57, 87, 62,206, 58,222, 63, 37, 94, 91, 62,187,120,107, 63, 41,160,156, 62,182,175, 56, 63, 49,117,240,
- 62,198,138,164, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,188,212,202, 62,182,163,245, 62,197, 28,156, 62,187,130,166,
- 62,184,207,130, 62,206, 27, 42, 62,172,137,147, 62,198, 19,148, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 48,252,165,
- 62, 85, 33,133, 63, 48, 54,112, 62, 96, 19, 20, 63, 46, 36,172, 62,129, 7,208, 63, 42, 17,240, 62, 97, 84,129, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,181, 71, 76, 62,131,200,204, 62,175,121,117, 62,106,185,183, 62,172, 24,217, 62, 92,237, 21,
- 62,187, 81,138, 62,103, 40, 59, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 48, 89,204, 62, 4,194,134, 63, 48,252,165,
- 62, 85, 33,133, 63, 42, 17,240, 62, 97, 84,129, 63, 37,125,160, 62, 46,211, 50, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16,
- 62,187, 81,138, 62,103, 40, 59, 62,172, 24,217, 62, 92,237, 21, 62,172,197, 94, 62, 4,200,109, 62,195,121, 25, 62, 48,253, 46,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 20, 44, 11, 61,163, 26, 20, 63, 48, 89,204, 62, 4,194,134, 63, 37,125,160,
- 62, 46,211, 50, 63, 24, 92, 40, 62, 21,184,214, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 62,195,121, 25, 62, 48,253, 46,
- 62,172,197, 94, 62, 4,200,109, 62,230,122,140, 61,161,248,202, 62,222, 13,216, 62, 22,116,222, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 32, 63, 16,254,174, 62, 34, 45, 94, 63, 3,199,219, 61,229, 28, 18, 63, 20, 44, 11, 61,163, 26, 20, 63, 24, 92, 40,
- 62, 21,184,214, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 62,230,122,140, 61,161,248,202, 63, 3,199,219, 61,229, 28, 18,
- 62,236,248,140, 62, 34,202,182, 62,222, 13,216, 62, 22,116,222, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 21,152,184,
- 62, 53, 47,182, 63, 16,254,174, 62, 34, 45, 94, 63, 24, 92, 40, 62, 21,184,214, 63, 25, 52,209, 62, 51,140, 76, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 32, 62,222, 13,216, 62, 22,116,222, 62,236,248,140, 62, 34,202,182, 62,227,207,183, 62, 54, 75,250,
- 62,220,137,229, 62, 52,228,185, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 63, 22, 57,137, 62, 61, 93, 81, 63, 21,152,184,
- 62, 53, 47,182, 63, 25, 52,209, 62, 51,140, 76, 63, 30,166,193, 62, 73,168,114, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,220,137,229, 62, 52,228,185, 62,227,207,183, 62, 54, 75,250, 62,226,152,122, 62, 62,166,190, 62,209,198, 54, 62, 75,240, 18,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 22,249,250, 62, 88,251,160, 63, 22, 57,137, 62, 61, 93, 81, 63, 30,166,193,
- 62, 73,168,114, 63, 36, 0, 75, 62,116, 47,229, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,209,198, 54, 62, 75,240, 18,
- 62,226,152,122, 62, 62,166,190, 62,225, 83, 90, 62, 90,153, 21, 62,199,231,211, 62,119,237,216, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 30,166,193, 62, 73,168,114, 63, 37,125,160, 62, 46,211, 50, 63, 42, 17,240, 62, 97, 84,129, 63, 36, 0, 75,
- 62,116, 47,229, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,187, 81,138, 62,103, 40, 59, 62,195,121, 25, 62, 48,253, 46,
- 62,209,198, 54, 62, 75,240, 18, 62,199,231,211, 62,119,237,216, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 30,166,193,
- 62, 73,168,114, 63, 25, 52,209, 62, 51,140, 76, 63, 24, 92, 40, 62, 21,184,214, 63, 37,125,160, 62, 46,211, 50, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,222, 13,216, 62, 22,116,222, 62,220,137,229, 62, 52,228,185, 62,209,198, 54, 62, 75,240, 18,
- 62,195,121, 25, 62, 48,253, 46, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 36,163, 37, 62,140,168,191, 63, 36, 0, 75,
- 62,116, 47,229, 63, 42, 17,240, 62, 97, 84,129, 63, 46, 36,172, 62,129, 7,208, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,187, 81,138, 62,103, 40, 59, 62,199,231,211, 62,119,237,216, 62,199, 64, 6, 62,142, 6,105, 62,181, 71, 76, 62,131,200,204,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 25, 81, 20, 62,132, 56, 17, 63, 22,249,250, 62, 88,251,160, 63, 36, 0, 75,
- 62,116, 47,229, 63, 36,163, 37, 62,140,168,191, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,199,231,211, 62,119,237,216,
- 62,225, 83, 90, 62, 90,153, 21, 62,221, 42, 54, 62,133, 25,209, 62,199, 64, 6, 62,142, 6,105, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 27, 46,208, 62,148, 35,149, 63, 36, 60, 91, 62,150,222,221, 63, 33,170,222, 62,158,126, 74, 63, 27,177, 36,
- 62,156,151,158, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,204,234, 72, 62,159, 63, 56, 62,199,245,150, 62,152, 15, 85,
- 62,217,166,238, 62,148,221,229, 62,216,160, 0, 62,157, 44,127, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 25, 81, 20,
- 62,132, 56, 17, 63, 36,163, 37, 62,140,168,191, 63, 36, 60, 91, 62,150,222,221, 63, 27, 46,208, 62,148, 35,149, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,199,245,150, 62,152, 15, 85, 62,199, 64, 6, 62,142, 6,105, 62,221, 42, 54, 62,133, 25,209,
- 62,217,166,238, 62,148,221,229, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,239,111, 62,166, 77,159, 63, 27,177, 36,
- 62,156,151,158, 63, 33,170,222, 62,158,126, 74, 63, 31,212,102, 62,164,192,144, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,204,234, 72, 62,159, 63, 56, 62,216,160, 0, 62,157, 44,127, 62,216, 21,115, 62,166,177, 14, 62,208,119, 17, 62,165, 65,201,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 27,239,111, 62,166, 77,159, 63, 31,212,102, 62,164,192,144, 63, 41,160,156,
- 62,182,175, 56, 63, 37, 94, 91, 62,187,120,107, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,188,212,202, 62,182,163,245,
- 62,208,119, 17, 62,165, 65,201, 62,216, 21,115, 62,166,177, 14, 62,197, 28,156, 62,187,130,166, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 62,194,119,104, 63, 82,189,164, 62,212, 73, 23, 63, 90,239,152, 62,205,192,100, 63, 97,238, 46, 62,185, 56, 38,
- 63, 91,154, 72, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,141, 94,228, 63,100,234, 86, 62,150, 66, 84, 63, 94,154,114,
- 62,173, 86,230, 63, 98, 66, 79, 62,162,143, 20, 63,106,173, 44, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 63, 87,122, 72,
- 62, 62, 8,216, 63, 84,106,202, 62,113,185,137, 63, 72, 77,226, 62,121, 21,204, 63, 71,225,158, 62, 68, 34,113, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 16, 62,137, 32,132, 62,121, 65,181, 62,107,179,168, 62,103,127,139, 62,114,147,210, 62, 61,116,212,
- 62,142,125,248, 62, 80, 4, 30, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 71,225,158, 62, 68, 34,113, 63, 72, 77,226,
- 62,121, 21,204, 63, 51, 7, 8, 62,130,186, 5, 63, 49,166, 3, 62, 96, 57,232, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,172,197, 18, 62,133,112, 41, 62,137, 32,132, 62,121, 65,181, 62,142,125,248, 62, 80, 4, 30, 62,174,228,121, 62,109, 79, 52,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 49,166, 3, 62, 96, 57,232, 63, 51, 7, 8, 62,130,186, 5, 63, 46, 36,172,
- 62,129, 7,208, 63, 48, 54,112, 62, 96, 19, 20, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,181, 71, 76, 62,131,200,204,
- 62,172,197, 18, 62,133,112, 41, 62,174,228,121, 62,109, 79, 52, 62,175,121,117, 62,106,185,183, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 36,163, 37, 62,140,168,191, 63, 46, 36,172, 62,129, 7,208, 63, 51, 7, 8, 62,130,186, 5, 63, 36, 60, 91,
- 62,150,222,221, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,172,197, 18, 62,133,112, 41, 62,181, 71, 76, 62,131,200,204,
- 62,199, 64, 6, 62,142, 6,105, 62,199,245,150, 62,152, 15, 85, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 53, 88,154,
- 62,221,146,240, 63, 49,117,240, 62,198,138,164, 63, 69, 19,224, 62,190, 68, 24, 63, 74, 64, 53, 62,224, 31,171, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 16, 62,134, 78,250, 62,186,213,148, 62,172,137,147, 62,198, 19,148, 62,162,172,128, 62,221,169, 17,
- 62,114,112,184, 62,220,169,248, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 62,214, 74, 54, 63, 70, 55, 20, 62,233,130, 48,
- 63, 83, 69,188, 62,212, 73, 23, 63, 90,239,152, 62,194,119,104, 63, 82,189,164, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,150, 66, 84, 63, 94,154,114, 62,153, 1, 66, 63, 81,149,245, 62,185, 56, 38, 63, 83,110,102, 62,173, 86,230, 63, 98, 66, 79,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 63, 66,242,106, 63, 25, 94,202, 63, 70,100,190, 63, 15,234,222, 63, 77,189, 90,
- 63, 17, 88,233, 63, 74,206, 8, 63, 27,118, 88, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 96, 32, 22, 63, 16, 60, 66,
- 62,125, 87, 86, 63, 15, 5,174, 62,132,187, 78, 63, 24, 44,180, 62,108, 79, 26, 63, 26, 1,124, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 74,206, 8, 63, 27,118, 88, 63, 77,189, 90, 63, 17, 88,233, 63, 85,139, 72, 63, 19, 51,103, 63, 85,119,220,
- 63, 31, 71, 77, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 64,199, 64, 63, 18, 40, 26, 62, 96, 32, 22, 63, 16, 60, 66,
- 62,108, 79, 26, 63, 26, 1,124, 62, 67,191, 44, 63, 30, 89, 90, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 85,119,220,
- 63, 31, 71, 77, 63, 85,139, 72, 63, 19, 51,103, 63,100,213,228, 63, 20,156, 72, 63, 96, 82, 18, 63, 34,133,128, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,128, 62, 1, 50,226, 63, 20, 68,184, 62, 64,199, 64, 63, 18, 40, 26, 62, 67,191, 44, 63, 30, 89, 90,
- 62, 24,204,194, 63, 34,186, 32, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 63, 56, 80,242, 63, 6,244, 44, 63, 54,173,195,
- 62,252,106,239, 63, 60,205,115, 62,253,150,213, 63, 64, 14,166, 63, 4, 80, 81, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16,
- 62,147, 85,190, 62,252,176, 91, 62,160, 36,202, 62,252, 51, 94, 62,156,208, 61, 63, 7, 16,204, 62,140,121,160, 63, 3,197, 74,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 64, 14,166, 63, 4, 80, 81, 63, 60,205,115, 62,253,150,213, 63, 73,103, 68,
- 63, 0,248,233, 63, 75, 12,248, 63, 8,206, 64, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,115, 59,144, 62,255,143,102,
- 62,147, 85,190, 62,252,176, 91, 62,140,121,160, 63, 3,197, 74, 62,107,135, 78, 63, 7,182, 88, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 75, 12,248, 63, 8,206, 64, 63, 73,103, 68, 63, 0,248,233, 63, 82,151,239, 63, 3,223, 86, 63, 82,227,181,
- 63, 11,102,189, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 77, 17, 82, 63, 2, 98,162, 62,115, 59,144, 62,255,143,102,
- 62,107,135, 78, 63, 7,182, 88, 62, 75, 98,202, 63, 10, 43,108, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 82,227,181,
- 63, 11,102,189, 63, 82,151,239, 63, 3,223, 86, 63, 91,224, 92, 63, 5,144,239, 63, 90,148,161, 63, 13, 95,146, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 38, 40,178, 63, 3,230, 14, 62, 77, 17, 82, 63, 2, 98,162, 62, 75, 98,202, 63, 10, 43,108,
- 62, 43,162, 10, 63, 12, 50, 8, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,103, 89,120, 63, 2, 76,105, 63,103,179,170,
- 63, 12,105,142, 63, 90,148,161, 63, 13, 95,146, 63, 91,224, 92, 63, 5,144,239, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 43,162, 10, 63, 12, 50, 8, 61,231, 41,168, 63, 11, 83,158, 61,234,128,116, 63, 0, 39,200, 62, 38, 40,178, 63, 3,230, 14,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,100,213,228, 63, 20,156, 72, 63, 85,139, 72, 63, 19, 51,103, 63, 90,148,161,
- 63, 13, 95,146, 63,103,179,170, 63, 12,105,142, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 43,162, 10, 63, 12, 50, 8,
- 62, 64,199, 64, 63, 18, 40, 26, 62, 1, 50,226, 63, 20, 68,184, 61,231, 41,168, 63, 11, 83,158, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 85,139, 72, 63, 19, 51,103, 63, 77,189, 90, 63, 17, 88,233, 63, 82,227,181, 63, 11,102,189, 63, 90,148,161,
- 63, 13, 95,146, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 75, 98,202, 63, 10, 43,108, 62, 96, 32, 22, 63, 16, 60, 66,
- 62, 64,199, 64, 63, 18, 40, 26, 62, 43,162, 10, 63, 12, 50, 8, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 77,189, 90,
- 63, 17, 88,233, 63, 70,100,190, 63, 15,234,222, 63, 75, 12,248, 63, 8,206, 64, 63, 82,227,181, 63, 11,102,189, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,107,135, 78, 63, 7,182, 88, 62,125, 87, 86, 63, 15, 5,174, 62, 96, 32, 22, 63, 16, 60, 66,
- 62, 75, 98,202, 63, 10, 43,108, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 70,100,190, 63, 15,234,222, 63, 60,235, 82,
- 63, 12, 12, 27, 63, 64, 14,166, 63, 4, 80, 81, 63, 75, 12,248, 63, 8,206, 64, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,140,121,160, 63, 3,197, 74, 62,145,230, 78, 63, 11,225,148, 62,125, 87, 86, 63, 15, 5,174, 62,107,135, 78, 63, 7,182, 88,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 57,118, 31, 63, 12, 79,230, 63, 56, 80,242, 63, 6,244, 44, 63, 64, 14,166,
- 63, 4, 80, 81, 63, 60,235, 82, 63, 12, 12, 27, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 62,140,121,160, 63, 3,197, 74,
- 62,156,208, 61, 63, 7, 16,204, 62,152,199, 0, 63, 12,133, 13, 62,145,230, 78, 63, 11,225,148, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 32, 63, 57,240,195, 63, 23,138, 10, 63, 60,235, 82, 63, 12, 12, 27, 63, 70,100,190, 63, 15,234,222, 63, 66,242,106,
- 63, 25, 94,202, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,125, 87, 86, 63, 15, 5,174, 62,145,230, 78, 63, 11,225,148,
- 62,150, 7,247, 63, 23, 12, 96, 62,132,187, 78, 63, 24, 44,180, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 13,120,216,
- 63, 23, 81,160, 63, 23,233, 94, 63, 16, 60,186, 63, 28, 56,220, 63, 14,250, 66, 63, 39, 44,109, 63, 19,221,107, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,214,161,157, 63, 15,110,219, 62,223,130,109, 63, 16,165,118, 62,245, 27, 64, 63, 23,166,100,
- 62,192, 26,156, 63, 20,139, 31, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 56, 29,176, 63, 20,206, 88, 63, 57,118, 31,
- 63, 12, 79,230, 63, 60,235, 82, 63, 12, 12, 27, 63, 57,240,195, 63, 23,138, 10, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,145,230, 78, 63, 11,225,148, 62,152,199, 0, 63, 12,133, 13, 62,153,211,239, 63, 20,159,220, 62,150, 7,247, 63, 23, 12, 96,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 54,148, 48, 63, 22,206,220, 63, 56, 29,176, 63, 20,206, 88, 63, 57,240,195,
- 63, 23,138, 10, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,150, 7,247, 63, 23, 12, 96,
- 62,153,211,239, 63, 20,159,220, 62,156,106,108, 63, 22,154,146, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 54,173,195, 62,252,106,239, 63, 53, 88,154, 62,221,146,240, 63, 74, 64, 53, 62,224, 31,171, 63, 60,205,115,
- 62,253,150,213, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 62,114,112,184, 62,220,169,248, 62,162,172,128, 62,221,169, 17,
- 62,160, 36,202, 62,252, 51, 94, 62,147, 85,190, 62,252,176, 91, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 63, 74, 64, 53,
- 62,224, 31,171, 63, 81,106,217, 62,232,214, 14, 63, 73,103, 68, 63, 0,248,233, 63, 60,205,115, 62,253,150,213, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,115, 59,144, 62,255,143,102, 62, 84, 93, 88, 62,228,105, 50, 62,114,112,184, 62,220,169,248,
- 62,147, 85,190, 62,252,176, 91, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 81,106,217, 62,232,214, 14, 63, 93,154,106,
- 62,233, 26,226, 63, 82,151,239, 63, 3,223, 86, 63, 73,103, 68, 63, 0,248,233, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 77, 17, 82, 63, 2, 98,162, 62, 33, 1,128, 62,226,210, 70, 62, 84, 93, 88, 62,228,105, 50, 62,115, 59,144, 62,255,143,102,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,103, 89,120, 63, 2, 76,105, 63, 91,224, 92, 63, 5,144,239, 63, 82,151,239,
- 63, 3,223, 86, 63, 93,154,106, 62,233, 26,226, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 77, 17, 82, 63, 2, 98,162,
- 62, 38, 40,178, 63, 3,230, 14, 61,234,128,116, 63, 0, 39,200, 62, 33, 1,128, 62,226,210, 70, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 51, 7, 8, 62,130,186, 5, 63, 72, 77,226, 62,121, 21,204, 63, 73,254,154, 62,140, 82,178, 63, 56,188, 90,
- 62,159,207,103, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,130,249,249, 62,137,175,246, 62,137, 32,132, 62,121, 65,181,
- 62,172,197, 18, 62,133,112, 41, 62,161, 5,192, 62,159, 40,228, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 69, 19,224,
- 62,190, 68, 24, 63, 56,188, 90, 62,159,207,103, 63, 73,254,154, 62,140, 82,178, 63, 77,217,216, 62,157,228, 7, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,128, 62,130,249,249, 62,137,175,246, 62,161, 5,192, 62,159, 40,228, 62,134, 78,250, 62,186,213,148,
- 62,111,118,154, 62,152,108,120, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 63, 49,117,240, 62,198,138,164, 63, 41,160,156,
- 62,182,175, 56, 63, 56,188, 90, 62,159,207,103, 63, 69, 19,224, 62,190, 68, 24, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62,161, 5,192, 62,159, 40,228, 62,188,212,202, 62,182,163,245, 62,172,137,147, 62,198, 19,148, 62,134, 78,250, 62,186,213,148,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 41,160,156, 62,182,175, 56, 63, 33,170,222, 62,158,126, 74, 63, 36, 60, 91,
- 62,150,222,221, 63, 56,188, 90, 62,159,207,103, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,199,245,150, 62,152, 15, 85,
- 62,204,234, 72, 62,159, 63, 56, 62,188,212,202, 62,182,163,245, 62,161, 5,192, 62,159, 40,228, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 36, 60, 91, 62,150,222,221, 63, 51, 7, 8, 62,130,186, 5, 63, 56,188, 90, 62,159,207,103, 63,128, 0, 0,
- 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,161, 5,192, 62,159, 40,228, 62,172,197, 18, 62,133,112, 41,
- 62,199,245,150, 62,152, 15, 85, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 41,160,156,
- 62,182,175, 56, 63, 31,212,102, 62,164,192,144, 63, 33,170,222, 62,158,126, 74, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,204,234, 72, 62,159, 63, 56, 62,208,119, 17, 62,165, 65,201, 62,188,212,202, 62,182,163,245,
- 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,245, 44,226, 63, 96,140,129, 62,227,135, 42,
- 63,101, 2, 58, 62,219,168,136, 63, 95,236, 30, 62,238, 30,135, 63, 90, 41,200, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62,137,240,216, 63, 93,226, 90, 62,122,103,110, 63, 92,255,236, 62,120, 84, 74, 63, 83, 32,104, 62,138,193, 32, 63, 83, 3, 16,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,233,130, 48, 63, 83, 69,188, 62,238, 30,135, 63, 90, 41,200, 62,219,168,136,
- 63, 95,236, 30, 62,212, 73, 23, 63, 90,239,152, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 62,137,240,216, 63, 93,226, 90,
- 62,138,193, 32, 63, 83, 3, 16, 62,153, 1, 66, 63, 81,149,245, 62,150, 66, 84, 63, 94,154,114, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0,240, 63, 77,217,216, 62,157,228, 7, 63, 73,254,154, 62,140, 82,178, 63, 90, 61, 33, 62,124,207,195, 63, 90,225,160,
- 62,137,121,110, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 62, 81,207, 98, 62,110, 1,109, 62,130,249,249, 62,137,175,246,
- 62,111,118,154, 62,152,108,120, 62, 74,125,166, 62,130, 30,252, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 72, 77,226,
- 62,121, 21,204, 63, 84,106,202, 62,113,185,137, 63, 90, 61, 33, 62,124,207,195, 63, 73,254,154, 62,140, 82,178, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 81,207, 98, 62,110, 1,109, 62,107,179,168, 62,103,127,139, 62,137, 32,132, 62,121, 65,181,
- 62,130,249,249, 62,137,175,246, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,212, 73, 23, 63, 90,239,152, 62,219,168,136,
- 63, 95,236, 30, 62,205,192,100, 63, 97,238, 46, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112,
- 62,141, 94,228, 63,100,234, 86, 62,137,240,216, 63, 93,226, 90, 62,150, 66, 84, 63, 94,154,114, 63,128, 0, 0, 63,128, 0, 0,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 63,109,178, 31, 62,228, 68,224, 63,102,178, 46, 62,232,184,100, 63,101,251,100,
- 62,227,198,238, 63,107,173, 94, 62,225,130,168, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,249,209, 68, 62,219,134, 70,
- 61,242,216,120, 62,225, 40,124, 61,177, 27, 28, 62,219,240, 42, 61,196,131, 76, 62,216, 97,196, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,109,178, 31, 62,228, 68,224, 63,107,173, 94, 62,225,130,168, 63,114,102,144, 62,220, 23,198, 63,116, 76, 41,
- 62,222,153,139, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,120,163, 56, 62,208,252, 58, 61,196,131, 76, 62,216, 97,196,
- 61,177, 27, 28, 62,219,240, 42, 61, 73,183,128, 62,213,108, 84, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,116, 76, 41,
- 62,222,153,139, 63,114,102,144, 62,220, 23,198, 63,117, 87, 84, 62,211,255,221, 63,119,115,183, 62,215, 49,140, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 61, 55, 29,144, 62,194,183,207, 61,120,163, 56, 62,208,252, 58, 61, 73,183,128, 62,213,108, 84,
- 60,231,111,224, 62,198,142,100, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,119,115,183, 62,215, 49,140, 63,117, 87, 84,
- 62,211,255,221, 63,118, 20,150, 62,196,110, 60, 63,122, 12, 49, 62,197, 8,246, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,103,197, 96, 62,170,206, 15, 61, 55, 29,144, 62,194,183,207, 60,231,111,224, 62,198,142,100, 61, 16, 54,240, 62,167, 4,120,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,122, 12, 49, 62,197, 8,246, 63,118, 20,150, 62,196,110, 60, 63,108,155, 17,
- 62,178,201,130, 63,110,190, 84, 62,172, 77,223, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,246,252,148, 62,160,116,164,
- 61,103,197, 96, 62,170,206, 15, 61, 16, 54,240, 62,167, 4,120, 61,246, 66, 8, 62,152,161, 28, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,110,190, 84, 62,172, 77,223, 63,108,155, 17, 62,178,201,130, 63, 92,180, 21, 62,173, 95,202, 63, 90, 5,151,
- 62,167, 61,138, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 54,216,144, 62,163, 76, 35, 61,246,252,148, 62,160,116,164,
- 61,246, 66, 8, 62,152,161, 28, 62, 66,251,194, 62,158,102,163, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,108,155, 17,
- 62,178,201,130, 63,109,132,198, 62,186,157,182, 63, 97, 32, 68, 62,178, 12,192, 63, 92,180, 21, 62,173, 95,202, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 36,185, 48, 62,166, 7, 16, 61,221, 91, 40, 62,167,194, 4, 61,246,252,148, 62,160,116,164,
- 62, 54,216,144, 62,163, 76, 35, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,118, 20,150, 62,196,110, 60, 63,115,225, 84,
- 62,198, 85,208, 63,109,132,198, 62,186,157,182, 63,108,155, 17, 62,178,201,130, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,221, 91, 40, 62,167,194, 4, 61,134,221,244, 62,175,164,121, 61,103,197, 96, 62,170,206, 15, 61,246,252,148, 62,160,116,164,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,117, 87, 84, 62,211,255,221, 63,116, 48,222, 62,209, 8,169, 63,115,225, 84,
- 62,198, 85,208, 63,118, 20,150, 62,196,110, 60, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,134,221,244, 62,175,164,121,
- 61, 93,108,160, 62,190,207, 17, 61, 55, 29,144, 62,194,183,207, 61,103,197, 96, 62,170,206, 15, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,114,102,144, 62,220, 23,198, 63,113,151,174, 62,214,229, 26, 63,116, 48,222, 62,209, 8,169, 63,117, 87, 84,
- 62,211,255,221, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61, 93,108,160, 62,190,207, 17, 61,135,155, 12, 62,201, 39,166,
- 61,120,163, 56, 62,208,252, 58, 61, 55, 29,144, 62,194,183,207, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,107,173, 94,
- 62,225,130,168, 63,107,239,228, 62,218, 59, 62, 63,113,151,174, 62,214,229, 26, 63,114,102,144, 62,220, 23,198, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 61,135,155, 12, 62,201, 39,166, 61,195, 47,128, 62,207, 11, 6, 61,196,131, 76, 62,216, 97,196,
- 61,120,163, 56, 62,208,252, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,107,173, 94, 62,225,130,168, 63,101,251,100,
- 62,227,198,238, 63,102,205, 71, 62,219, 94,132, 63,107,239,228, 62,218, 59, 62, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,244,157,192, 62,209,137,157, 61,249,209, 68, 62,219,134, 70, 61,196,131, 76, 62,216, 97,196, 61,195, 47,128, 62,207, 11, 6,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 69, 19,224, 62,190, 68, 24, 63, 77,217,216, 62,157,228, 7, 63, 85, 35,236,
- 62,181,201,164, 63, 78, 92, 56, 62,188,114,177, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 32, 62, 80, 91,122, 62,174, 18, 72,
- 62,111,118,154, 62,152,108,120, 62,134, 78,250, 62,186,213,148, 62,104,163,162, 62,182,180,150, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 32, 63, 77,217,216, 62,157,228, 7, 63, 90, 5,151, 62,167, 61,138, 63, 92,180, 21, 62,173, 95,202, 63, 85, 35,236,
- 62,181,201,164, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 62, 54,216,144, 62,163, 76, 35, 62, 66,251,194, 62,158,102,163,
- 62,111,118,154, 62,152,108,120, 62, 80, 91,122, 62,174, 18, 72, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 63, 74, 64, 53,
- 62,224, 31,171, 63, 69, 19,224, 62,190, 68, 24, 63, 78, 92, 56, 62,188,114,177, 63, 81,106,217, 62,232,214, 14, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62,104,163,162, 62,182,180,150, 62,134, 78,250, 62,186,213,148, 62,114,112,184, 62,220,169,248,
- 62, 84, 93, 88, 62,228,105, 50, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 93,154,106, 62,233, 26,226, 63, 94,229,196,
- 62,224,195,128, 63,101,251,100, 62,227,198,238, 63,102,178, 46, 62,232,184,100, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,249,209, 68, 62,219,134, 70, 62, 28,187,108, 62,217, 86, 48, 62, 33, 1,128, 62,226,210, 70, 61,242,216,120, 62,225, 40,124,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 92,180, 21, 62,173, 95,202, 63, 97, 32, 68, 62,178, 12,192, 63, 94,215, 9,
- 62,186, 54, 4, 63, 85, 35,236, 62,181,201,164, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 41,122, 60, 62,175, 58, 16,
- 62, 36,185, 48, 62,166, 7, 16, 62, 54,216,144, 62,163, 76, 35, 62, 80, 91,122, 62,174, 18, 72, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 95, 78,230, 62,189,233, 4, 63, 86,188, 32, 62,190, 62, 44, 63, 85, 35,236, 62,181,201,164, 63, 94,215, 9,
- 62,186, 54, 4, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 80, 91,122, 62,174, 18, 72, 62, 71,118, 78, 62,182, 49, 27,
- 62, 37,225, 52, 62,179, 12, 40, 62, 41,122, 60, 62,175, 58, 16, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 92,166, 70,
- 62,197,166, 0, 63, 86,188, 32, 62,190, 62, 44, 63, 95, 78,230, 62,189,233, 4, 63, 95, 13,226, 62,194,152, 37, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 37,225, 52, 62,179, 12, 40, 62, 71,118, 78, 62,182, 49, 27, 62, 45,143,142, 62,188, 37,237,
- 62, 36,230,106, 62,184, 27,222, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 95, 90,248, 62,207,122,100, 63, 90,249,108,
- 62,212,199, 58, 63, 86,188, 32, 62,190, 62, 44, 63, 92,166, 70, 62,197,166, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 71,118, 78, 62,182, 49, 27, 62, 48, 56,110, 62,205, 43,230, 62, 30,250,174, 62,198, 12, 26, 62, 45,143,142, 62,188, 37,237,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 94,229,196, 62,224,195,128, 63, 90,249,108, 62,212,199, 58, 63, 95, 90,248,
- 62,207,122,100, 63, 98,104, 92, 62,215,136,197, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 30,250,174, 62,198, 12, 26,
- 62, 48, 56,110, 62,205, 43,230, 62, 28,187,108, 62,217, 86, 48, 62, 15, 59,212, 62,206, 50,224, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,101,251,100, 62,227,198,238, 63, 94,229,196, 62,224,195,128, 63, 98,104, 92, 62,215,136,197, 63,102,205, 71,
- 62,219, 94,132, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 15, 59,212, 62,206, 50,224, 62, 28,187,108, 62,217, 86, 48,
- 61,249,209, 68, 62,219,134, 70, 61,244,157,192, 62,209,137,157, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 81,106,217,
- 62,232,214, 14, 63, 90,249,108, 62,212,199, 58, 63, 94,229,196, 62,224,195,128, 63, 93,154,106, 62,233, 26,226, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 28,187,108, 62,217, 86, 48, 62, 48, 56,110, 62,205, 43,230, 62, 84, 93, 88, 62,228,105, 50,
- 62, 33, 1,128, 62,226,210, 70, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 81,106,217, 62,232,214, 14, 63, 78, 92, 56,
- 62,188,114,177, 63, 86,188, 32, 62,190, 62, 44, 63, 90,249,108, 62,212,199, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 71,118, 78, 62,182, 49, 27, 62,104,163,162, 62,182,180,150, 62, 84, 93, 88, 62,228,105, 50, 62, 48, 56,110, 62,205, 43,230,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 78, 92, 56, 62,188,114,177, 63, 85, 35,236, 62,181,201,164, 63, 86,188, 32,
- 62,190, 62, 44, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 71,118, 78, 62,182, 49, 27,
- 62, 80, 91,122, 62,174, 18, 72, 62,104,163,162, 62,182,180,150, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,102,205, 71, 62,219, 94,132, 63, 98,104, 92, 62,215,136,197, 63,100,109,182, 62,210,255,149, 63,104, 86, 54,
- 62,214,241,209, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 7,107,160, 62,200,103, 34, 62, 15, 59,212, 62,206, 50,224,
- 61,244,157,192, 62,209,137,157, 61,232, 2, 8, 62,203,214, 20, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 98,104, 92,
- 62,215,136,197, 63, 95, 90,248, 62,207,122,100, 63, 97,206,112, 62,204,202, 10, 63,100,109,182, 62,210,255,149, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 21, 68, 64, 62,194, 55,107, 62, 30,250,174, 62,198, 12, 26, 62, 15, 59,212, 62,206, 50,224,
- 62, 7,107,160, 62,200,103, 34, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 95, 90,248, 62,207,122,100, 63, 92,166, 70,
- 62,197,166, 0, 63, 94,241, 82, 62,198,103, 40, 63, 97,206,112, 62,204,202, 10, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 35,225, 20, 62,188, 50, 39, 62, 45,143,142, 62,188, 37,237, 62, 30,250,174, 62,198, 12, 26, 62, 21, 68, 64, 62,194, 55,107,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 92,166, 70, 62,197,166, 0, 63, 95, 13,226, 62,194,152, 37, 63, 97, 1,118,
- 62,195,226, 47, 63, 94,241, 82, 62,198,103, 40, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 28, 43, 12, 62,184,177,186,
- 62, 36,230,106, 62,184, 27,222, 62, 45,143,142, 62,188, 37,237, 62, 35,225, 20, 62,188, 50, 39, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 95, 13,226, 62,194,152, 37, 63, 95, 78,230, 62,189,233, 4, 63, 97,113, 51, 62,189,151, 92, 63, 97, 1,118,
- 62,195,226, 47, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 29, 67,104, 62,177,199, 58, 62, 37,225, 52, 62,179, 12, 40,
- 62, 36,230,106, 62,184, 27,222, 62, 28, 43, 12, 62,184,177,186, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 95, 78,230,
- 62,189,233, 4, 63, 94,215, 9, 62,186, 54, 4, 63, 96, 69, 96, 62,187,133,152, 63, 97,113, 51, 62,189,151, 92, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 35, 14,140, 62,176, 19, 33, 62, 41,122, 60, 62,175, 58, 16, 62, 37,225, 52, 62,179, 12, 40,
- 62, 29, 67,104, 62,177,199, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 94,215, 9, 62,186, 54, 4, 63, 97, 32, 68,
- 62,178, 12,192, 63, 98, 91,112, 62,182,128,149, 63, 96, 69, 96, 62,187,133,152, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 29,107,228, 62,169,230, 95, 62, 36,185, 48, 62,166, 7, 16, 62, 41,122, 60, 62,175, 58, 16, 62, 35, 14,140, 62,176, 19, 33,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,107,239,228, 62,218, 59, 62, 63,102,205, 71, 62,219, 94,132, 63,104, 86, 54,
- 62,214,241,209, 63,109, 27, 34, 62,214,254,155, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,232, 2, 8, 62,203,214, 20,
- 61,244,157,192, 62,209,137,157, 61,195, 47,128, 62,207, 11, 6, 61,184,174, 36, 62,202,130,216, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,113,151,174, 62,214,229, 26, 63,107,239,228, 62,218, 59, 62, 63,109, 27, 34, 62,214,254,155, 63,113,134, 69,
- 62,212, 82,156, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,184,174, 36, 62,202,130,216, 61,195, 47,128, 62,207, 11, 6,
- 61,135,155, 12, 62,201, 39,166, 61,138,114, 60, 62,197, 61, 28, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,116, 48,222,
- 62,209, 8,169, 63,113,151,174, 62,214,229, 26, 63,113,134, 69, 62,212, 82,156, 63,114,143, 42, 62,207,168, 24, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 61,138,114, 60, 62,197, 61, 28, 61,135,155, 12, 62,201, 39,166, 61, 93,108,160, 62,190,207, 17,
- 61,132, 85,184, 62,189,211, 22, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,115,225, 84, 62,198, 85,208, 63,116, 48,222,
- 62,209, 8,169, 63,114,143, 42, 62,207,168, 24, 63,114,125,203, 62,200,114, 96, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,132, 85,184, 62,189,211, 22, 61, 93,108,160, 62,190,207, 17, 61,134,221,244, 62,175,164,121, 61,145,152, 16, 62,179,214, 84,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,109,132,198, 62,186,157,182, 63,115,225, 84, 62,198, 85,208, 63,114,125,203,
- 62,200,114, 96, 63,109,192,177, 62,190,240,152, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,145,152, 16, 62,179,214, 84,
- 61,134,221,244, 62,175,164,121, 61,221, 91, 40, 62,167,194, 4, 61,208,226, 64, 62,172, 58,232, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 97, 32, 68, 62,178, 12,192, 63,109,132,198, 62,186,157,182, 63,109,192,177, 62,190,240,152, 63, 98, 91,112,
- 62,182,128,149, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,208,226, 64, 62,172, 58,232, 61,221, 91, 40, 62,167,194, 4,
- 62, 36,185, 48, 62,166, 7, 16, 62, 29,107,228, 62,169,230, 95, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 97, 1,118,
- 62,195,226, 47, 63, 97,113, 51, 62,189,151, 92, 63,102,139,215, 62,193,109, 15, 63,100, 47, 54, 62,198,115,186, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 5,169, 92, 62,179,115,168, 62, 29, 67,104, 62,177,199, 58, 62, 28, 43, 12, 62,184,177,186,
- 62, 13, 97, 50, 62,186, 42, 50, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,100, 47, 54, 62,198,115,186, 63,102,139,215,
- 62,193,109, 15, 63,105,241,174, 62,200, 8,204, 63,103,233, 71, 62,204, 42,178, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,229,171,228, 62,185, 42, 41, 62, 5,169, 92, 62,179,115,168, 62, 13, 97, 50, 62,186, 42, 50, 61,243,248, 92, 62,191, 22, 96,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,103,233, 71, 62,204, 42,178, 63,105,241,174, 62,200, 8,204, 63,108, 37, 51,
- 62,205, 3,249, 63,106,212, 56, 62,208,238, 96, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,202, 99,120, 62,190, 49,192,
- 61,229,171,228, 62,185, 42, 41, 61,243,248, 92, 62,191, 22, 96, 61,211,209,160, 62,195,159,108, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,106,212, 56, 62,208,238, 96, 63,108, 37, 51, 62,205, 3,249, 63,110, 73, 56, 62,206,119,186, 63,109,191, 46,
- 62,210, 64, 92, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,179,234,244, 62,190,219,240, 61,202, 99,120, 62,190, 49,192,
- 61,211,209,160, 62,195,159,108, 61,181,129,196, 62,196, 14,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,109, 27, 34,
- 62,214,254,155, 63,104, 86, 54, 62,214,241,209, 63,106,212, 56, 62,208,238, 96, 63,109,191, 46, 62,210, 64, 92, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 61,211,209,160, 62,195,159,108, 61,232, 2, 8, 62,203,214, 20, 61,184,174, 36, 62,202,130,216,
- 61,181,129,196, 62,196, 14,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,100,109,182, 62,210,255,149, 63,103,233, 71,
- 62,204, 42,178, 63,106,212, 56, 62,208,238, 96, 63,104, 86, 54, 62,214,241,209, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,211,209,160, 62,195,159,108, 61,243,248, 92, 62,191, 22, 96, 62, 7,107,160, 62,200,103, 34, 61,232, 2, 8, 62,203,214, 20,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,100,109,182, 62,210,255,149, 63, 97,206,112, 62,204,202, 10, 63,100, 47, 54,
- 62,198,115,186, 63,103,233, 71, 62,204, 42,178, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 13, 97, 50, 62,186, 42, 50,
- 62, 21, 68, 64, 62,194, 55,107, 62, 7,107,160, 62,200,103, 34, 61,243,248, 92, 62,191, 22, 96, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63, 97, 1,118, 62,195,226, 47, 63,100, 47, 54, 62,198,115,186, 63, 97,206,112, 62,204,202, 10, 63, 94,241, 82,
- 62,198,103, 40, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62, 21, 68, 64, 62,194, 55,107, 62, 13, 97, 50, 62,186, 42, 50,
- 62, 28, 43, 12, 62,184,177,186, 62, 35,225, 20, 62,188, 50, 39, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63, 96, 69, 96,
- 62,187,133,152, 63, 98, 91,112, 62,182,128,149, 63,102,139,215, 62,193,109, 15, 63, 97,113, 51, 62,189,151, 92, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 62, 5,169, 92, 62,179,115,168, 62, 29,107,228, 62,169,230, 95, 62, 35, 14,140, 62,176, 19, 33,
- 62, 29, 67,104, 62,177,199, 58, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,109,192,177, 62,190,240,152, 63,105,241,174,
- 62,200, 8,204, 63,102,139,215, 62,193,109, 15, 63, 98, 91,112, 62,182,128,149, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 62, 5,169, 92, 62,179,115,168, 61,229,171,228, 62,185, 42, 41, 61,208,226, 64, 62,172, 58,232, 62, 29,107,228, 62,169,230, 95,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,114,125,203, 62,200,114, 96, 63,108, 37, 51, 62,205, 3,249, 63,105,241,174,
- 62,200, 8,204, 63,109,192,177, 62,190,240,152, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,229,171,228, 62,185, 42, 41,
- 61,202, 99,120, 62,190, 49,192, 61,145,152, 16, 62,179,214, 84, 61,208,226, 64, 62,172, 58,232, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,114,143, 42, 62,207,168, 24, 63,110, 73, 56, 62,206,119,186, 63,108, 37, 51, 62,205, 3,249, 63,114,125,203,
- 62,200,114, 96, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,202, 99,120, 62,190, 49,192, 61,179,234,244, 62,190,219,240,
- 61,132, 85,184, 62,189,211, 22, 61,145,152, 16, 62,179,214, 84, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,113,134, 69,
- 62,212, 82,156, 63,109,191, 46, 62,210, 64, 92, 63,110, 73, 56, 62,206,119,186, 63,114,143, 42, 62,207,168, 24, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 61,179,234,244, 62,190,219,240, 61,181,129,196, 62,196, 14,204, 61,138,114, 60, 62,197, 61, 28,
- 61,132, 85,184, 62,189,211, 22, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,109, 27, 34, 62,214,254,155, 63,109,191, 46,
- 62,210, 64, 92, 63,113,134, 69, 62,212, 82,156, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 61,138,114, 60, 62,197, 61, 28, 61,181,129,196, 62,196, 14,204, 61,184,174, 36, 62,202,130,216, 63,128, 0, 0, 63,128, 0, 0,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,110,190, 84, 62,172, 77,223, 63, 90, 5,151, 62,167, 61,138, 63, 96, 25, 22,
- 62,149,248,246, 63,122,176,162, 62,161,215,145, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 62, 54,234, 64, 62,140,219,146,
- 62, 66,251,194, 62,158,102,163, 61,246, 66, 8, 62,152,161, 28, 61,189,241,172, 62,132,107, 13, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0, 0, 63,122, 12, 49, 62,197, 8,246, 63,110,190, 84, 62,172, 77,223, 63,122,176,162, 62,161,215,145, 63,126,255,188,
- 62,198,248,115, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 61,189,241,172, 62,132,107, 13, 61,246, 66, 8, 62,152,161, 28,
- 61, 16, 54,240, 62,167, 4,120, 58,163, 8, 0, 62,162, 69, 39, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 63,119,115,183,
- 62,215, 49,140, 63,122, 12, 49, 62,197, 8,246, 63,126,255,188, 62,198,248,115, 63,122, 6, 47, 62,216,157,248, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0, 0, 58,163, 8, 0, 62,162, 69, 39, 61, 16, 54,240, 62,167, 4,120, 60,231,111,224, 62,198,142,100,
- 60, 14,248,224, 62,198,141, 70, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 63,116, 76, 41, 62,222,153,139, 63,119,115,183,
- 62,215, 49,140, 63,122, 6, 47, 62,216,157,248, 63,119, 98,134, 62,225, 37,204, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0,
- 60, 14,248,224, 62,198,141, 70, 60,231,111,224, 62,198,142,100, 61, 73,183,128, 62,213,108, 84, 60,229,210, 80, 62,218,239, 32,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 63,109,178, 31, 62,228, 68,224, 63,116, 76, 41, 62,222,153,139, 63,119, 98,134,
- 62,225, 37,204, 63,115,185, 46, 62,234,157, 90, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,128, 60,229,210, 80, 62,218,239, 32,
- 61, 73,183,128, 62,213,108, 84, 61,177, 27, 28, 62,219,240, 42, 61,122,103, 56, 62,230, 10, 30, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0,128, 63,102,178, 46, 62,232,184,100, 63,109,178, 31, 62,228, 68,224, 63,115,185, 46, 62,234,157, 90, 63,106,134,244,
- 62,246, 64,234, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 61,122,103, 56, 62,230, 10, 30, 61,177, 27, 28, 62,219,240, 42,
- 61,242,216,120, 62,225, 40,124, 61,209,222,212, 62,240,123,238, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16, 63, 5,188,235,
- 63, 98, 74,252, 62,248,111,200, 63,112,105,197, 62,231, 49, 0, 63,107,190,118, 62,255, 57,150, 63, 96, 14, 53, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62, 95, 99, 80, 63, 94,194,149, 62, 62, 8, 58, 63, 89,154, 10, 62, 92, 24, 40, 63, 74, 82, 14,
- 62,112, 11,112, 63, 78,133,157, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 63, 5,188,235, 63, 98, 74,252, 63, 12,139,136,
- 63,101,233,138, 63, 6, 45,116, 63,113,245,112, 62,248,111,200, 63,112,105,197, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240,
- 62, 36,219, 68, 63, 81,186,249, 62, 65,254, 28, 63, 70, 55, 20, 62, 92, 24, 40, 63, 74, 82, 14, 62, 62, 8, 58, 63, 89,154, 10,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 63, 12,139,136, 63,101,233,138, 63, 12,130, 5, 63,108,216,149, 63, 6, 45,116,
- 63,113,245,112, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,112, 62, 36,219, 68, 63, 81,186,249,
- 62, 42, 1, 76, 63, 73,178, 39, 62, 65,254, 28, 63, 70, 55, 20, 63,128, 0, 0, 63,128, 0, 0, 13, 64,158,176, 1, 0, 0, 5,
- 0, 0, 0,112, 63,103, 89,120, 63, 2, 76,105, 63, 93,154,106, 62,233, 26,226, 63,102,178, 46, 62,232,184,100, 63,106,134,244,
- 62,246, 64,234, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 61,242,216,120, 62,225, 40,124, 62, 33, 1,128, 62,226,210, 70,
- 61,234,128,116, 63, 0, 39,200, 61,209,222,212, 62,240,123,238, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 0, 62,245, 44,226,
- 63, 96,140,129, 62,255, 57,150, 63, 96, 14, 53, 62,231, 49, 0, 63,107,190,118, 62,227,135, 42, 63,101, 2, 58, 13, 64,158,176,
- 1, 0, 0, 5, 0, 0, 0,240, 62, 95, 99, 80, 63, 94,194,149, 62,112, 11,112, 63, 78,133,157, 62,120, 84, 74, 63, 83, 32,104,
- 62,122,103,110, 63, 92,255,236, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0,240, 63, 77,217,216, 62,157,228, 7, 63, 90,225,160,
- 62,137,121,110, 63, 96, 25, 22, 62,149,248,246, 63, 90, 5,151, 62,167, 61,138, 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 16,
- 62, 54,234, 64, 62,140,219,146, 62, 74,125,166, 62,130, 30,252, 62,111,118,154, 62,152,108,120, 62, 66,251,194, 62,158,102,163,
- 13, 64,158,176, 1, 0, 0, 5, 0, 0, 0, 64, 68, 65, 84, 65, 0, 0, 31, 64, 7,160,168, 32, 0, 0, 0, 59, 0, 0, 7,208,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,109,208, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,115, 96, 13, 65,104, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,111, 16,
- 7,160,234, 32, 7,160,242, 32, 0, 0, 0, 0, 7,160,200, 32, 7,160,218, 32, 0, 0, 0, 0, 7,161, 0, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,111, 64, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,112,160, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,114, 0, 0, 0, 0, 3,
- 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,188, 0, 0, 1, 53, 0, 0, 0, 76, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 63, 76,204,213, 63, 76,204,255,182,104, 0, 0, 63,128, 0, 30, 63,128, 0,140, 63,127,255,214,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,111, 16, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,111, 64, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,160,200, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 17,160, 7,160,200, 32, 0, 0, 0, 58, 0, 0, 0,188, 63,230,102,133, 63,179, 51,208,
- 63,127,255,146,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,133, 63, 25,154,206, 63,127,255,146,165,127, 0, 0,
- 90,129, 2,255, 0, 0, 0, 0, 63,179, 51, 81, 63,179, 51,210, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,128, 0, 28, 63,179, 51,212, 63,127,255,152, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,207, 63,179, 51,214,
- 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,179, 51,216, 63,127,255,156, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,128, 0,158, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63,128, 0,160, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204, 63,128, 0,162,
- 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,128, 0,163, 63,127,255,156, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63, 25,154,209, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63, 25,154,213, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204, 63, 25,154,217,
- 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63, 25,154,221, 63,127,255,156, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 62, 76,209,160, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 62, 76,209,176, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204, 62, 76,209,188,
- 63,127,255,152, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 62, 76,209,204, 63,127,255,154, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8, 63,127,255,148, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0,
- 63, 25,153,204, 63,230,103, 10, 63,127,255,146, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,128, 0, 27, 63,230,103, 10,
- 63,127,255,142, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12, 63,127,255,140, 0, 0,165,127,
- 90,129, 0,255, 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12, 63,127,255,140, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0,
-190, 76,205,152, 62, 76,209,160, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 63, 25,154,209,
- 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,128, 0,158, 63,127,255,148, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0,190, 76,205,144, 63,179, 51,210, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,230,103, 7, 63,127,255,148, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,230,102,131, 63,128, 0,160,
- 63,127,255,142,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28, 63,127,255,148,165,127, 0, 0,
- 90,129, 2,255, 0, 0, 0, 0,190, 76,205,146,190, 76,208, 72, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 62, 76,205,150,190, 76,208, 24, 63,127,255,156, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,207,190, 76,208, 40,
- 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 28,190, 76,208, 56, 63,127,255,152, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 81,190, 76,208, 72, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63,230,102,133,190, 76,208, 88, 63,127,255,146, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,230,102,133,190, 76,208, 88,
-191,128, 0, 4, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 81,190, 76,208, 72,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 28,190, 76,208, 56,191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63, 25,153,207,190, 76,208, 40,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,150,190, 76,208, 24,
-191,127,255,254, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,146,190, 76,208, 72,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28,191, 25,153,155,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131,190, 76,201,136,191, 25,153,159,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28,
-190, 76,204,193,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,190, 76,201,136,190, 76,204,209,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28, 62, 76,204,219,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131,190, 76,201,136, 62, 76,204,203,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28,
- 63, 25,153,159,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,190, 76,201,136, 63, 25,153,155,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28,191,128, 0, 3,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,128, 0,160,191,128, 0, 6,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,
-191,128, 0, 3, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207, 63, 25,153,151,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,128, 0,156, 63, 25,153,151,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,179, 51,212, 63, 25,153,155,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,
- 63, 25,153,159,165,127,165,127, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207, 62, 76,204,171,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,128, 0,160, 62, 76,204,187,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,179, 51,212, 62, 76,204,203,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,
- 62, 76,204,219,165,127,165,127, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207,190, 76,204,241,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,128, 0,160,190, 76,204,225,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,179, 51,212,190, 76,204,209,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,
-190, 76,204,193,165,127,165,127, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207,191, 25,153,167,128, 1, 0, 0,
- 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,128, 0,160,191, 25,153,163,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,
- 63,230,102,131, 63,179, 51,212,191, 25,153,159,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,
-191, 25,153,155,165,127,165,127, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,144, 63,179, 51,210,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,128, 0,158,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
-190, 76,205,152, 63, 25,154,209,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 62, 76,209,160,
-191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12,191, 25,153,168, 0, 0,128, 1,
- 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12,190, 76,204,244, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,
-190, 76,205,152, 63,230,103, 12, 62, 76,204,168, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,144, 63,230,103, 12,
- 63, 25,153,150, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12,191,128, 0, 7, 0, 0,165,127,
- 90,129, 0,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,191,128, 0, 7, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63,230,103, 10,191,128, 0, 6, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,
-191,128, 0, 4, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,191,128, 0, 3, 0, 0,165,127,
- 90,129, 0,255, 0, 0, 0, 0, 63,179, 51, 81, 63,230,103, 12, 63, 25,153,150, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,
- 63,128, 0, 28, 63,230,103, 10, 63, 25,153,150, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63, 25,153,207, 63,230,103, 10,
- 63, 25,153,154, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,230,103, 8, 63, 25,153,158, 0, 0,128, 1,
- 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12, 62, 76,204,168, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63,230,103, 10, 62, 76,204,184, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,
- 62, 76,204,200, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8, 62, 76,204,216, 0, 0,128, 1,
- 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,190, 76,204,244, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63,230,103, 10,190, 76,204,228, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,
-190, 76,204,212, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,190, 76,204,196, 0, 0,128, 1,
- 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,191, 25,153,168, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,
- 63,128, 0, 27, 63,230,103, 10,191, 25,153,164, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,
-191, 25,153,160, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,191, 25,153,156, 0, 0,128, 1,
- 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 62, 76,209,204,191,127,255,255, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63, 25,153,204, 62, 76,209,188,191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27, 62, 76,209,176,
-191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 62, 76,209,160,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63, 25,154,221,191,127,255,254, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63, 25,153,204, 63, 25,154,217,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27, 63, 25,154,213,
-191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63, 25,154,209,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,128, 0,163,191,127,255,254, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63, 25,153,204, 63,128, 0,162,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27, 63,128, 0,160,
-191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,128, 0,158,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,179, 51,216,191,127,255,254, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,
- 63, 25,153,207, 63,179, 51,214,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 28, 63,179, 51,212,
-191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 81, 63,179, 51,210,191,128, 0, 3, 0, 0, 0, 0,
-127,255, 2,255, 0, 0, 0, 0, 63,230,102,133, 63, 25,154,206,191,128, 0, 4,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0,
- 63,230,102,133, 63,179, 51,208,191,128, 0, 4,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0,190, 76,205,128, 62, 76,201,116,
-191,128, 0, 5,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,190, 76,205,136, 63,127,255, 48,191,128, 0, 5,127,255, 0, 0,
- 0, 0, 16,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191, 25,153,156,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,
-190, 76,205,112, 62, 76,201, 84,191, 25,153,160,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,120, 63, 25,152,190,
-191, 25,153,164,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 46,191, 25,153,168,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,190, 76,204,195,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,
-190, 76,205,112, 62, 76,201, 84,190, 76,204,211,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,120, 63, 25,152,190,
-190, 76,204,227,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 46,190, 76,204,243,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 62, 76,204,221,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,
-190, 76,205,112, 62, 76,201, 84, 62, 76,204,205,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,120, 63, 25,152,190,
- 62, 76,204,189,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 46, 62, 76,204,173,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 63, 25,153,160,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,
-190, 76,205,112, 62, 76,201, 84, 63, 25,153,156,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,120, 63, 25,152,198,
- 63, 25,153,152,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 46, 63, 25,153,152,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191,128, 0, 4,231, 94,231, 94,132,215, 16,255, 0, 0, 0, 0,
-190, 76,205,120, 63, 25,152,190,191,128, 0, 7,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,190, 76,205, 96, 63,179, 50,251,
-191,128, 0, 4,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,190, 76,205,128, 63,230,102, 48, 63, 25,153,156,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205, 96, 63,179, 50,251, 63, 25,153,160,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,
-190, 76,205,128, 63,230,102, 48, 62, 76,204,205,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205, 96, 63,179, 50,251,
- 62, 76,204,221,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,128, 63,230,102, 48,190, 76,204,211,127,255, 0, 0,
- 0, 0, 18,255, 0, 0, 0, 0,190, 76,205, 96, 63,179, 50,251,190, 76,204,195,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,
-190, 76,205,128, 63,230,102, 48,191, 25,153,160,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205, 96, 63,179, 50,251,
-191, 25,153,156,127,255, 0, 0, 0, 0, 18,255, 0, 0, 0, 0,190, 76,205,144, 63,230,103, 10,191,128, 0, 5,243,161,111, 93,
-194, 34, 16,255, 0, 0, 0, 0,190, 76,205,144, 63,230,103, 10, 63,127,255,148,243,161,111, 93, 61,222, 16,255, 0, 0, 0, 0,
-190, 76,205, 96, 63,179, 50,251, 63,127,255,150,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,190, 76,205,120, 63, 25,152,190,
- 63,127,255,144,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 63,127,255,150,231, 94,231, 94,
-123, 41, 16,255, 0, 0, 0, 0,190, 76,205,136, 63,127,255, 48, 63,127,255,148,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0,
-190, 76,205,128, 62, 76,201,116, 63,127,255,148,127,255, 0, 0, 0, 0, 16,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,
-191, 25,153,157, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80,191, 25,153,161, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,191, 25,153,165, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 62, 76,204, 44,190, 76,208,104,191, 25,153,169, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,
-190, 76,204,198, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80,190, 76,204,214, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,190, 76,204,230, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 62, 76,204, 44,190, 76,208,104,190, 76,204,246, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,
- 62, 76,204,218, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80, 62, 76,204,202, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80, 62, 76,204,186, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 62, 76,204, 44,190, 76,208,104, 62, 76,204,170, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 34,190, 76,208, 56,
- 63, 25,153,159, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,220,190, 76,208, 80, 63, 25,153,155, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,114,190, 76,208, 80, 63, 25,153,151, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 62, 76,204, 36,190, 76,208,104, 63, 25,153,151, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,
-191,128, 0, 4, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80,191,128, 0, 5, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,191,128, 0, 7, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 62, 76,204, 44,190, 76,208,104,191,128, 0, 8, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,136,190, 76,208, 88,
-191,128, 0, 8, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,135,190, 76,208, 88, 63, 25,153,151, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,136,190, 76,208, 88, 62, 76,204,170, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 63,230,102,136,190, 76,208, 88,190, 76,204,246, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,136,190, 76,208, 88,
-191, 25,153,169, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191, 25,153,156, 0, 0,127,255,
- 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,190, 76,204,195, 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0,
-190, 76,205,112,190, 76,208, 64, 62, 76,204,221, 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,
- 63, 25,153,160, 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191,128, 0, 4, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 63,127,255,150, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 63,230,102,136,190, 76,208, 88, 63,127,255,142, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104,
- 63,127,255,142, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80, 63,127,255,144, 0, 0,127,255,
- 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80, 63,127,255,148, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,
- 63,179, 51, 36,190, 76,208, 56, 63,127,255,150, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,112,160, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7,160,218, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 14,124,
- 7,160,218, 32, 0, 0, 0, 55, 0, 0, 1, 53, 0, 0, 0, 21, 0, 0, 0, 82, 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0, 83,
- 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 84, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 85, 0, 0, 0, 34, 0, 0, 0, 22,
- 0, 0, 0, 76, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 28, 0, 0, 0, 54, 0, 0, 0, 34,
- 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 34, 0, 0, 0, 27, 0, 0, 0, 56, 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 48,
- 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 34, 0, 0, 0, 2,
- 0, 0, 0, 3, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, 34,
- 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 8,
- 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 2,
- 0, 0, 0, 6, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 13, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 13, 0, 0, 0, 34,
- 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 11,
- 0, 0, 0, 34, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 10, 0, 0, 0, 34, 0, 0, 0, 1,
- 0, 0, 0, 10, 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0, 17, 0, 0, 0, 34, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0, 34,
- 0, 0, 0, 12, 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 15,
- 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 34, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 34, 0, 0, 0, 19,
- 0, 0, 0, 20, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 21, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 20, 0, 0, 0, 34,
- 0, 0, 0, 4, 0, 0, 0, 19, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 18, 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 26,
- 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 25, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 22, 0, 0, 0, 34, 0, 0, 0, 17,
- 0, 0, 0, 23, 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 25, 0, 0, 0, 34,
- 0, 0, 0, 5, 0, 0, 0, 26, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 28,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 29, 0, 0, 0, 34, 0, 0, 0, 21,
- 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 29, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 28, 0, 0, 0, 34,
- 0, 0, 0, 30, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 33,
- 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 30, 0, 0, 0, 34, 0, 0, 0, 14,
- 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 16, 0, 0, 0, 32, 0, 0, 0, 34,
- 0, 0, 0, 17, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 40, 0, 0, 0, 98, 0, 0, 0, 34, 0, 0, 0, 39, 0, 0, 0, 99,
- 0, 0, 0, 34, 0, 0, 0, 38, 0, 0, 0,100, 0, 0, 0, 34, 0, 0, 0, 37, 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0, 41,
- 0, 0, 0, 72, 0, 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 50, 0, 0, 0, 34, 0, 0, 0, 38, 0, 0, 0, 39, 0, 0, 0, 34,
- 0, 0, 0, 36, 0, 0, 0, 37, 0, 0, 0, 34, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 34, 0, 0, 0, 51, 0, 0, 0,109,
- 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0, 68, 0, 0, 0, 94, 0, 0, 0, 34, 0, 0, 0, 64,
- 0, 0, 0, 90, 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 86, 0, 0, 0, 34, 0, 0, 0, 56, 0, 0, 0, 82, 0, 0, 0, 34,
- 0, 0, 0, 52, 0, 0, 0, 78, 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0,114, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0,114,
- 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0,115, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0,115, 0, 0, 0, 34, 0, 0, 0, 51,
- 0, 0, 0,115, 0, 0, 0, 34, 0, 0, 0, 51, 0, 0, 0,114, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 50, 0, 0, 0, 34,
- 0, 0, 0, 43, 0, 0, 0, 45, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 44,
- 0, 0, 0, 34, 0, 0, 0, 44, 0, 0, 0, 45, 0, 0, 0, 34, 0, 0, 0, 44, 0, 0, 0, 46, 0, 0, 0, 34, 0, 0, 0, 47,
- 0, 0, 0, 49, 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 47, 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 34,
- 0, 0, 0, 48, 0, 0, 0, 49, 0, 0, 0, 34, 0, 0, 0, 55, 0, 0, 0, 56, 0, 0, 0, 34, 0, 0, 0, 54, 0, 0, 0, 55,
- 0, 0, 0, 34, 0, 0, 0, 53, 0, 0, 0, 54, 0, 0, 0, 34, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 59,
- 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 55, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 58, 0, 0, 0, 59, 0, 0, 0, 34,
- 0, 0, 0, 54, 0, 0, 0, 58, 0, 0, 0, 34, 0, 0, 0, 57, 0, 0, 0, 58, 0, 0, 0, 34, 0, 0, 0, 53, 0, 0, 0, 57,
- 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 59,
- 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 62, 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 58, 0, 0, 0, 62, 0, 0, 0, 34,
- 0, 0, 0, 61, 0, 0, 0, 62, 0, 0, 0, 34, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 64, 0, 0, 0, 68,
- 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0, 68, 0, 0, 0, 34, 0, 0, 0, 63, 0, 0, 0, 67, 0, 0, 0, 34, 0, 0, 0, 66,
- 0, 0, 0, 67, 0, 0, 0, 34, 0, 0, 0, 62, 0, 0, 0, 66, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0, 66, 0, 0, 0, 34,
- 0, 0, 0, 61, 0, 0, 0, 65, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 68, 0, 0, 0, 34, 0, 0, 0, 51, 0, 0, 0, 66,
- 0, 0, 0, 34, 0, 0, 0, 48, 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 57, 0, 0, 0, 34, 0, 0, 0, 44,
- 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 65, 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0,110, 0, 0, 0, 34,
- 0, 0, 0, 70, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0, 71, 0, 0, 0,102, 0, 0, 0, 34, 0, 0, 0, 72, 0, 0, 0, 98,
- 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 74, 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0, 75,
- 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0, 76, 0, 0, 0, 85, 0, 0, 0, 34, 0, 0, 0, 77, 0, 0, 0, 81, 0, 0, 0, 34,
- 0, 0, 0, 70, 0, 0, 0, 71, 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 0, 77, 0, 0, 0, 34, 0, 0, 0, 74, 0, 0, 0, 75,
- 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0, 77, 0, 0, 0, 34, 0, 0, 0, 81, 0, 0, 0,110, 0, 0, 0, 34, 0, 0, 0, 80,
- 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0,112, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 0,113, 0, 0, 0, 34,
- 0, 0, 0, 79, 0, 0, 0, 80, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0, 85, 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 0, 84,
- 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 0, 83, 0, 0, 0, 34, 0, 0, 0, 85, 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0, 88,
- 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0, 88, 0, 0, 0, 34, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, 34,
- 0, 0, 0, 83, 0, 0, 0, 87, 0, 0, 0, 34, 0, 0, 0, 86, 0, 0, 0, 87, 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 0, 86,
- 0, 0, 0, 34, 0, 0, 0, 89, 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0, 88,
- 0, 0, 0, 92, 0, 0, 0, 34, 0, 0, 0, 91, 0, 0, 0, 92, 0, 0, 0, 34, 0, 0, 0, 87, 0, 0, 0, 91, 0, 0, 0, 34,
- 0, 0, 0, 90, 0, 0, 0, 91, 0, 0, 0, 34, 0, 0, 0, 86, 0, 0, 0, 90, 0, 0, 0, 34, 0, 0, 0, 93, 0, 0, 0, 97,
- 0, 0, 0, 34, 0, 0, 0, 96, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0, 96, 0, 0, 0, 34, 0, 0, 0, 95,
- 0, 0, 0, 96, 0, 0, 0, 34, 0, 0, 0, 91, 0, 0, 0, 95, 0, 0, 0, 34, 0, 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, 34,
- 0, 0, 0, 90, 0, 0, 0, 94, 0, 0, 0, 34, 0, 0, 0, 81, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 80, 0, 0, 0, 96,
- 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0, 95, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 0, 94, 0, 0, 0, 34, 0, 0, 0,101,
- 0, 0, 0,105, 0, 0, 0, 34, 0, 0, 0,100, 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0,100, 0, 0, 0,104, 0, 0, 0, 34,
- 0, 0, 0, 99, 0, 0, 0,100, 0, 0, 0, 34, 0, 0, 0, 99, 0, 0, 0,103, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0, 99,
- 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0,102, 0, 0, 0, 34, 0, 0, 0,105, 0, 0, 0,114, 0, 0, 0, 34, 0, 0, 0,105,
- 0, 0, 0,109, 0, 0, 0, 34, 0, 0, 0,104, 0, 0, 0,105, 0, 0, 0, 34, 0, 0, 0,104, 0, 0, 0,108, 0, 0, 0, 34,
- 0, 0, 0,103, 0, 0, 0,104, 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 0,107, 0, 0, 0, 34, 0, 0, 0,102, 0, 0, 0,103,
- 0, 0, 0, 34, 0, 0, 0,102, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0,109, 0, 0, 0,113, 0, 0, 0, 34, 0, 0, 0,108,
- 0, 0, 0,109, 0, 0, 0, 34, 0, 0, 0,108, 0, 0, 0,112, 0, 0, 0, 34, 0, 0, 0,107, 0, 0, 0,108, 0, 0, 0, 34,
- 0, 0, 0,107, 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0,106, 0, 0, 0,107, 0, 0, 0, 34, 0, 0, 0,106, 0, 0, 0,110,
- 0, 0, 0, 34, 0, 0, 0,113, 0, 0, 0,115, 0, 0, 0, 34, 0, 0, 0,112, 0, 0, 0,113, 0, 0, 0, 34, 0, 0, 0,111,
- 0, 0, 0,112, 0, 0, 0, 34, 0, 0, 0,110, 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0,121, 0, 0, 0,144, 0, 0, 0, 50,
- 0, 0, 0,125, 0, 0, 0,142, 0, 0, 0, 50, 0, 0, 0,129, 0, 0, 0,140, 0, 0, 0, 50, 0, 0, 0,133, 0, 0, 0,138,
- 0, 0, 0, 50, 0, 0, 0,120, 0, 0, 0,135, 0, 0, 0, 50, 0, 0, 0,118, 0, 0, 0,134, 0, 0, 0,178, 0, 0, 0,121,
- 0, 0, 0,125, 0, 0, 0, 50, 0, 0, 0,120, 0, 0, 0,121, 0, 0, 0, 50, 0, 0, 0,120, 0, 0, 0,124, 0, 0, 0, 50,
- 0, 0, 0,120, 0, 0, 0,119, 0, 0, 0, 50, 0, 0, 0,119, 0, 0, 0,123, 0, 0, 0, 50, 0, 0, 0,118, 0, 0, 0,119,
- 0, 0, 0, 50, 0, 0, 0,118, 0, 0, 0,122, 0, 0, 0, 50, 0, 0, 0,125, 0, 0, 0,129, 0, 0, 0, 50, 0, 0, 0,124,
- 0, 0, 0,125, 0, 0, 0, 50, 0, 0, 0,124, 0, 0, 0,128, 0, 0, 0, 50, 0, 0, 0,123, 0, 0, 0,124, 0, 0, 0, 50,
- 0, 0, 0,123, 0, 0, 0,127, 0, 0, 0, 50, 0, 0, 0,122, 0, 0, 0,123, 0, 0, 0, 50, 0, 0, 0,122, 0, 0, 0,126,
- 0, 0, 0,178, 0, 0, 0,129, 0, 0, 0,133, 0, 0, 0, 50, 0, 0, 0,128, 0, 0, 0,129, 0, 0, 0, 50, 0, 0, 0,128,
- 0, 0, 0,132, 0, 0, 0, 50, 0, 0, 0,127, 0, 0, 0,128, 0, 0, 0, 50, 0, 0, 0,127, 0, 0, 0,131, 0, 0, 0, 50,
- 0, 0, 0,126, 0, 0, 0,127, 0, 0, 0, 50, 0, 0, 0,126, 0, 0, 0,130, 0, 0, 0, 50, 0, 0, 0,132, 0, 0, 0,133,
- 0, 0, 0, 50, 0, 0, 0,131, 0, 0, 0,132, 0, 0, 0, 50, 0, 0, 0,130, 0, 0, 0,131, 0, 0, 0, 50, 0, 0, 0,137,
- 0, 0, 0,138, 0, 0, 0, 50, 0, 0, 0,138, 0, 0, 0,140, 0, 0, 0, 50, 0, 0, 0,139, 0, 0, 0,140, 0, 0, 0, 50,
- 0, 0, 0,137, 0, 0, 0,139, 0, 0, 0, 50, 0, 0, 0,140, 0, 0, 0,142, 0, 0, 0, 50, 0, 0, 0,141, 0, 0, 0,142,
- 0, 0, 0, 50, 0, 0, 0,142, 0, 0, 0,144, 0, 0, 0, 50, 0, 0, 0,143, 0, 0, 0,144, 0, 0, 0, 50, 0, 0, 0,141,
- 0, 0, 0,143, 0, 0, 0, 50, 0, 0, 0,136, 0, 0, 0,144, 0, 0, 0, 50, 0, 0, 0,117, 0, 0, 0,135, 0, 0, 0,178,
- 0, 0, 0,116, 0, 0, 0,135, 0, 0, 0, 50, 0, 0, 0,116, 0, 0, 0,134, 0, 0, 0,178, 0, 0, 0,119, 0, 0, 0,116,
- 0, 0, 0, 50, 0, 0, 0,117, 0, 0, 0,121, 0, 0, 0, 50, 0, 0, 0,117, 0, 0, 0,136, 0, 0, 0, 50, 0, 0, 0,136,
- 0, 0, 0,145, 0, 0, 0,178, 0, 0, 0,146, 0, 0, 0,147, 0, 0, 0,178, 0, 0, 0,147, 0, 0, 0,150, 0, 0, 0, 50,
- 0, 0, 0,149, 0, 0, 0,151, 0, 0, 0,178, 0, 0, 0,148, 0, 0, 0,151, 0, 0, 0, 50, 0, 0, 0,148, 0, 0, 0,150,
- 0, 0, 0,178, 0, 0, 0,138, 0, 0, 0,147, 0, 0, 0, 50, 0, 0, 0,130, 0, 0, 0,149, 0, 0, 0,178, 0, 0, 0,131,
- 0, 0, 0,151, 0, 0, 0, 50, 0, 0, 0,132, 0, 0, 0,148, 0, 0, 0, 50, 0, 0, 0,133, 0, 0, 0,150, 0, 0, 0, 50,
- 0, 0, 0,155, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 0,169,
- 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,168, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 0,154,
- 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 0,154, 0, 0, 0, 35,
- 0, 0, 0,153, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,153, 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,156,
- 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 0,158,
- 0, 0, 0,162, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 0,158, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 0,161, 0, 0, 0, 35,
- 0, 0, 0,156, 0, 0, 0,157, 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 0,160, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0,167,
- 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0,161,
- 0, 0, 0,162, 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 0,165, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 0,161, 0, 0, 0, 35,
- 0, 0, 0,160, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0,166,
- 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,165, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,174,
- 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0, 35,
- 0, 0, 0,164, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 0,175,
- 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,177,
- 0, 0, 0,178, 0, 0, 0,163, 0, 0, 0,178, 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 0,180, 0, 0, 0,163,
- 0, 0, 0,171, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0,179,
- 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 0,177, 0, 0, 0, 35, 0, 0, 0,182,
- 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0, 35,
- 0, 0, 0,180, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,187,
- 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0,167,
- 0, 0, 0,184, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,114, 0, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,160,234, 32, 0, 0, 0, 5, 0, 0, 0, 20,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,160,242, 32, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 5,240, 7,160,234, 32, 0, 0, 0, 54, 0, 0, 0, 76, 0, 0, 0, 18,
- 0, 0, 0, 22, 0, 0, 0, 26, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 19, 0, 0, 0, 4, 0, 0, 0, 3,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 5,
- 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 25, 0, 0, 0, 24, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 12,
- 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 6, 0, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12,
- 0, 0, 0, 13, 0, 0, 0, 17, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 15, 0, 0, 0, 14,
- 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 23, 0, 0, 0, 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16,
- 0, 0, 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 0, 14, 0, 0, 0, 0,
- 0, 0, 0, 42, 0, 0, 0, 65, 0, 0, 0,114, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 44, 0, 0, 0, 42,
- 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 49,
- 0, 0, 0, 48, 0, 0, 0, 46, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 53, 0, 0, 0, 48,
- 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 56,
- 0, 0, 0, 60, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 54, 0, 0, 0, 58, 0, 0, 0, 57, 0, 0, 0, 0,
- 0, 0, 0, 58, 0, 0, 0, 59, 0, 0, 0, 63, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 68,
- 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 62, 0, 0, 0, 66, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0,115,
- 0, 0, 0, 51, 0, 0, 0, 66, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 22, 0, 0, 0, 76, 0, 0, 0, 85,
- 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 19, 0, 0, 0, 84, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 21,
- 0, 0, 0, 82, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 85, 0, 0, 0, 89, 0, 0, 0, 88, 0, 0, 0, 0,
- 0, 0, 0, 82, 0, 0, 0, 83, 0, 0, 0, 87, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 75, 0, 0, 0, 74,
- 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, 92, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 60,
- 0, 0, 0, 86, 0, 0, 0, 90, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0, 97, 0, 0, 0, 96,
- 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 91, 0, 0, 0, 95, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 73,
- 0, 0, 0, 77, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, 80, 0, 0, 0, 79, 0, 0, 0, 0,
- 0, 0, 0, 78, 0, 0, 0, 52, 0, 0, 0, 68, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 36, 0, 0, 0, 50,
- 0, 0, 0,101, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 99, 0, 0, 0, 39, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 98,
- 0, 0, 0, 72, 0, 0, 0, 41, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0,104, 0, 0, 0,100, 0, 0, 0,101,
- 0, 0, 0, 0, 0, 0, 0,103, 0, 0, 0,102, 0, 0, 0, 98, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0,109,
- 0, 0, 0,105, 0, 0, 0,114, 0, 0, 0, 0, 0, 0, 0,108, 0, 0, 0,107, 0, 0, 0,103, 0, 0, 0,104, 0, 0, 0, 0,
- 0, 0, 0,106, 0, 0, 0, 70, 0, 0, 0, 71, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0,113, 0, 0, 0,112, 0, 0, 0,108,
- 0, 0, 0,109, 0, 0, 0, 0, 0, 0, 0,111, 0, 0, 0,110, 0, 0, 0,106, 0, 0, 0,107, 0, 0, 0, 0, 0, 0, 0,113,
- 0, 0, 0,115, 0, 0, 0, 52, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 80, 0, 0, 0,111, 0, 0, 0,112,
- 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 77, 0, 0, 0, 69, 0, 0, 0,110, 0, 0, 0, 0, 0, 0, 0,116, 0, 0, 0,135,
- 0, 0, 0,120, 0, 0, 0,119, 0, 0, 0, 16, 0, 0, 0,125, 0, 0, 0,124, 0, 0, 0,120, 0, 0, 0,121, 0, 0, 0, 16,
- 0, 0, 0,123, 0, 0, 0,122, 0, 0, 0,118, 0, 0, 0,119, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,127, 0, 0, 0,123,
- 0, 0, 0,124, 0, 0, 0, 16, 0, 0, 0,133, 0, 0, 0,132, 0, 0, 0,128, 0, 0, 0,129, 0, 0, 0, 16, 0, 0, 0,131,
- 0, 0, 0,130, 0, 0, 0,126, 0, 0, 0,127, 0, 0, 0, 16, 0, 0, 0,148, 0, 0, 0,151, 0, 0, 0,131, 0, 0, 0,132,
- 0, 0, 0, 16, 0, 0, 0,147, 0, 0, 0,150, 0, 0, 0,133, 0, 0, 0,138, 0, 0, 0, 16, 0, 0, 0,137, 0, 0, 0,138,
- 0, 0, 0,140, 0, 0, 0,139, 0, 0, 0, 16, 0, 0, 0,140, 0, 0, 0,129, 0, 0, 0,125, 0, 0, 0,142, 0, 0, 0, 16,
- 0, 0, 0,141, 0, 0, 0,142, 0, 0, 0,144, 0, 0, 0,143, 0, 0, 0, 16, 0, 0, 0,144, 0, 0, 0,121, 0, 0, 0,117,
- 0, 0, 0,136, 0, 0, 0, 16, 0, 0, 0,171, 0, 0, 0,181, 0, 0, 0,177, 0, 0, 0,155, 0, 0, 0, 2, 0, 0, 0,154,
- 0, 0, 0,153, 0, 0, 0,169, 0, 0, 0,170, 0, 0, 0, 2, 0, 0, 0,152, 0, 0, 0,176, 0, 0, 0,172, 0, 0, 0,168,
- 0, 0, 0, 2, 0, 0, 0,159, 0, 0, 0,158, 0, 0, 0,154, 0, 0, 0,155, 0, 0, 0, 2, 0, 0, 0,157, 0, 0, 0,156,
- 0, 0, 0,152, 0, 0, 0,153, 0, 0, 0, 2, 0, 0, 0,179, 0, 0, 0,163, 0, 0, 0,159, 0, 0, 0,178, 0, 0, 0, 2,
- 0, 0, 0,162, 0, 0, 0,161, 0, 0, 0,157, 0, 0, 0,158, 0, 0, 0, 2, 0, 0, 0,160, 0, 0, 0,174, 0, 0, 0,175,
- 0, 0, 0,156, 0, 0, 0, 2, 0, 0, 0,167, 0, 0, 0,166, 0, 0, 0,162, 0, 0, 0,163, 0, 0, 0, 2, 0, 0, 0,165,
- 0, 0, 0,164, 0, 0, 0,160, 0, 0, 0,161, 0, 0, 0, 2, 0, 0, 0,182, 0, 0, 0,184, 0, 0, 0,167, 0, 0, 0,180,
- 0, 0, 0, 2, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0,165, 0, 0, 0,166, 0, 0, 0, 2, 0, 0, 0,187, 0, 0, 0,183,
- 0, 0, 0,173, 0, 0, 0,164, 0, 0, 0, 2, 68, 65, 84, 65, 0, 0, 13, 16, 7,160,242, 32, 0, 0, 0, 65, 0, 0, 0, 76,
- 63, 27,168,250, 59, 93,211, 96, 62,203,162, 84, 59, 93,211, 96, 62,203,162, 84, 59, 93,211, 96, 63, 27,168,251, 59, 93,211, 96,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,131,172, 21, 59, 93,211, 96, 63, 81,128,146, 59, 93,211, 96, 63, 81,128,149,
- 59, 93,211, 96, 63,131,172, 22, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,158,151,227, 59, 93,211, 96,
- 63,185,131,174, 59, 93,211, 96, 63,185,131,174, 59, 93,211, 96, 63,158,151,225, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1,
- 0, 0, 0, 0, 63, 81,128,149, 59, 93,211, 96, 63, 27,168,251, 59, 93,211, 96, 63, 27,168,246, 59, 93,211, 96, 63, 81,128,142,
- 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,158,151,227, 59, 93,211, 96, 63,131,172, 22, 59, 93,211, 96,
- 63,131,172, 24, 59, 93,211, 96, 63,158,151,226, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 27,168,246,
- 59, 93,211, 96, 62,203,162, 86, 59, 93,211, 96, 62,203,162, 85, 59, 93,211, 96, 63, 27,168,247, 59, 93,211, 96, 0, 0, 0, 0,
- 61, 0, 0, 1, 0, 0, 0, 0, 63,131,172, 24, 59, 93,211, 96, 63, 81,128,142, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96,
- 63,131,172, 21, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,185,131,174, 59, 93,211, 96, 63,158,151,226,
- 59, 93,211, 96, 63,158,151,226, 59, 93,211, 96, 63,185,131,176, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0,
- 63, 81,128,144, 59, 93,211, 96, 63, 27,168,247, 59, 93,211, 96, 63, 27,168,247, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,158,151,226, 59, 93,211, 96, 63,131,172, 21, 59, 93,211, 96, 63,131,172, 22,
- 59, 93,211, 96, 63,158,151,224, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 27,168,247, 59, 93,211, 96,
- 62,203,162, 85, 59, 93,211, 96, 62,203,162, 86, 59, 93,211, 96, 63, 27,168,248, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1,
- 0, 0, 0, 0, 63,131,172, 22, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96, 63,131,172, 22,
- 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,158,151,226, 59, 93,211, 96, 63,185,131,176, 59, 93,211, 96,
- 63,185,131,174, 59, 93,211, 96, 63,158,151,224, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99,
- 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,161, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76,
- 63,159,140,161, 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76, 63,114,244, 44,
- 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63,159,140,161, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,161, 63, 3, 28,210,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 72, 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44,
- 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 63,117, 84,102,
- 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52, 63,141,179,111, 63, 76,225,174, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 38,207, 52, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52,
- 63,141,179,111, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,174, 63,117, 84,102,
- 63, 76,225,172, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,172,
- 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52, 63,141,179,111, 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173,
- 63, 38,207, 52, 63,141,179,111, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172,
- 63,117, 84,102, 63, 76,225,172, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,207, 56, 63,141,179,111, 63, 76,225,172, 63,117, 84,102, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,189,188,105, 96, 63, 41, 47,120,190,118,127, 56, 63, 3, 28,220,190,118,127, 56,
- 63, 3, 28,220,189,188,105, 96, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102,
- 61,104, 84,200, 63, 79, 65,244, 61,104, 84,200, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 0,188,190, 63,160,188,171, 62,181, 84,122, 63,141,179,113, 62,181, 84,122, 63,141,179,113, 63, 0,188,188,
- 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,200, 63, 79, 65,242,189,188,105, 96, 63, 41, 47,120,
-189,188,105,128, 63, 41, 47,120, 61,104, 84,160, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122,
- 63,141,179,113, 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64, 63, 3, 28,216,
-189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160,
- 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113, 62,181, 84,122, 63,141,179,113, 63, 0,188,188, 63,160,188,173,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,189,188,105,128,
- 63, 41, 47,120, 61,104, 84,160, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113,
- 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64, 63, 3, 28,216,189,188,105,128,
- 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160, 63, 79, 65,242,
- 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122,
- 63,141,179,113, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131,180, 62,186, 19,116, 63,159,140,244, 63, 3, 28, 50, 63,140,131, 99, 63, 41, 47, 76,
- 63,114,244, 42, 63, 3, 28,244, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 62,186, 21, 0, 63, 38,207, 51,
- 62, 91,224, 24, 63, 76,226,112, 61,135, 38, 64, 63,114,244,240, 62, 91,221, 4, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 0,188,185, 61,135, 44, 96, 62,181, 84, 61,189,169,104,176, 63, 0,189, 93,190,109, 1, 80, 63, 38,207,248,189,169,109,144,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 63, 41, 47,116, 63, 38,207, 52, 63, 3, 28,248, 63, 76,225,174,
- 62,186, 21, 0, 63,114,244, 42, 63, 3, 28,244, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,185, 62,186, 21, 0,
- 62,181, 84,122, 62, 91,224, 32, 63, 0,188,185, 61,135, 44, 96, 63, 38,207, 51, 62, 91,224, 24, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52, 63, 79, 65,236, 63, 76,225,174, 63, 41, 47,116, 63,114,244, 44,
- 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188, 63, 41, 47,120, 62,181, 84,122, 63, 3, 28,248,
- 63, 0,188,185, 62,186, 21, 0, 63, 38,207, 52, 63, 3, 28,248, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 14,
- 62,186, 21, 0, 61,104, 82,144, 62, 91,223,128, 62, 82, 94,138, 61,135, 43, 48, 62,181, 84,122, 62, 91,224, 32, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,190, 63,117, 84,102, 62,181, 84,127, 63, 79, 65,242, 63, 0,188,188, 63, 41, 47,120,
- 63, 38,207, 52, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63, 41, 47,120, 61,104, 84,160,
- 63, 3, 29, 0, 62, 82, 95, 14, 62,186, 21, 0, 62,181, 84,122, 63, 3, 28,248, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 0,188,190, 63,117, 84,102, 63, 38,207, 56, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26,
- 63, 41, 47,120, 62,181, 84,127, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,
-190,118,127, 64, 63, 3, 28,216,189,188,106,128, 62,186, 20,176, 61,104, 84,160, 63, 3, 29, 0, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 38,207, 56, 63,141,179,111, 63, 76,225,172, 63,117, 84,102, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52,
- 63,141,179,111, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102,
- 63, 76,225,172, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52,
- 63,141,179,111, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52, 63,141,179,111,
- 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,174,
- 63,117, 84,102, 63, 76,225,172, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,207, 52, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52,
- 63,141,179,111, 63, 76,225,174, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 72,
- 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63,159,140,161, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,161,
- 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236,
- 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,161,
- 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,161, 63, 3, 28,210, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236,
- 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113, 63, 0,188,188,
- 63,160,188,173, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160, 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64,
- 63, 3, 28,216,189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113,
- 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,189,188,105,128, 63, 41, 47,120, 61,104, 84,160,
- 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113,
- 62,181, 84,122, 63,141,179,113, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26,
- 63,117, 84,102, 61,104, 84,160, 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64, 63, 3, 28,216,
-189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113, 62, 82, 95, 26,
- 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 61,104, 84,200, 63, 79, 65,242,189,188,105, 96, 63, 41, 47,120,189,188,105,128, 63, 41, 47,120, 61,104, 84,160, 63, 79, 65,242,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,190, 63,160,188,171, 62,181, 84,122, 63,141,179,113, 62,181, 84,122,
- 63,141,179,113, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102,
- 61,104, 84,200, 63, 79, 65,244, 61,104, 84,200, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0,189,188,105, 96, 63, 41, 47,120,190,118,127, 56, 63, 3, 28,220,190,118,127, 56, 63, 3, 28,220,189,188,105, 96,
- 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 4,192, 7,161, 0, 32, 0, 0, 0, 59,
- 0, 0, 1, 48,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,115, 96, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,120,240, 13, 65,109,208,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,116,160, 7,161, 40, 32, 7,161, 46, 32, 0, 0, 0, 0, 7,161, 6, 32, 7,161, 24, 32, 0, 0, 0, 0, 7,161, 60, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,116,208, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,118, 48, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,119,144,
- 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 0, 0, 1, 45, 0, 0, 0, 74,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63, 76,204,213, 63, 76,204,255,182,104, 0, 0, 63,128, 0, 30, 63,128, 0,140,
- 63,127,255,214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,116,160, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,116,208, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 6, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 17, 16, 7,161, 6, 32, 0, 0, 0, 58, 0, 0, 0,182, 63,230,102,133,
- 63,179, 51,208,191,128, 0, 4,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,133, 63, 25,154,206,191,128, 0, 4,
-165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,179, 51, 81, 63,179, 51,210,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 28, 63,179, 51,212,191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,207,
- 63,179, 51,214,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,179, 51,216,191,127,255,254,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,128, 0,158,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 27, 63,128, 0,160,191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204,
- 63,128, 0,162,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,128, 0,163,191,127,255,254,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63, 25,154,209,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 27, 63, 25,154,213,191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204,
- 63, 25,154,217,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63, 25,154,221,191,127,255,254,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 62, 76,209,160,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 27, 62, 76,209,176,191,128, 0, 2, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,204,
- 62, 76,209,188,191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 62, 76,209,204,191,127,255,255,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,191, 25,153,156, 0, 0,128, 1, 0, 0, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,191, 25,153,160, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63,230,103, 10,191, 25,153,164, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,191, 25,153,168,
- 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,190, 76,204,196, 0, 0,128, 1, 0, 0, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,190, 76,204,212, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63,230,103, 10,190, 76,204,228, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,190, 76,204,244,
- 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8, 62, 76,204,216, 0, 0,128, 1, 0, 0, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10, 62, 76,204,200, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63,230,103, 10, 62, 76,204,184, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12, 62, 76,204,168,
- 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,230,103, 8, 63, 25,153,158, 0, 0,128, 1, 0, 0, 2,255,
- 0, 0, 0, 0, 63, 25,153,207, 63,230,103, 10, 63, 25,153,154, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,128, 0, 28,
- 63,230,103, 10, 63, 25,153,150, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 63,179, 51, 81, 63,230,103, 12, 63, 25,153,150,
- 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8,191,128, 0, 3, 0, 0,165,127, 90,129, 0,255,
- 0, 0, 0, 0, 63, 25,153,204, 63,230,103, 10,191,128, 0, 4, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63,230,103, 10,191,128, 0, 6, 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12,191,128, 0, 7,
- 0, 0,165,127, 90,129, 0,255, 0, 0, 0, 0,190, 76,205,144, 63,230,103, 12, 63, 25,153,150, 0, 0,128, 1, 0, 0, 2,255,
- 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12, 62, 76,204,168, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,152,
- 63,230,103, 12,190, 76,204,244, 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,152, 63,230,103, 12,191, 25,153,168,
- 0, 0,128, 1, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,152, 62, 76,209,160,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0,190, 76,205,152, 63, 25,154,209,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152,
- 63,128, 0,158,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,144, 63,179, 51,210,191,128, 0, 3,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,191, 25,153,155,165,127,165,127, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131, 63,179, 51,212,191, 25,153,159,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,
- 63,128, 0,160,191, 25,153,163,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207,191, 25,153,167,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,190, 76,204,193,165,127,165,127, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131, 63,179, 51,212,190, 76,204,209,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,
- 63,128, 0,160,190, 76,204,225,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207,190, 76,204,241,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7, 62, 76,204,219,165,127,165,127, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131, 63,179, 51,212, 62, 76,204,203,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,
- 63,128, 0,160, 62, 76,204,187,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207, 62, 76,204,171,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7, 63, 25,153,159,165,127,165,127, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131, 63,179, 51,212, 63, 25,153,155,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,
- 63,128, 0,156, 63, 25,153,151,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,135, 63, 25,154,207, 63, 25,153,151,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7,191,128, 0, 3,128, 1, 0, 0, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131, 63,128, 0,160,191,128, 0, 6,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,127,
- 62, 76,208, 28,191,128, 0, 3,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,131,190, 76,201,136, 63, 25,153,155,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28, 63, 25,153,159,128, 1, 0, 0, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131,190, 76,201,136, 62, 76,204,203,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127,
- 62, 76,208, 28, 62, 76,204,219,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,131,190, 76,201,136,190, 76,204,209,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28,190, 76,204,193,128, 1, 0, 0, 0, 0, 2,255,
- 0, 0, 0, 0, 63,230,102,131,190, 76,201,136,191, 25,153,159,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,127,
- 62, 76,208, 28,191, 25,153,155,128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 62, 76,205,150,190, 76,208, 24,191,127,255,254,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,207,190, 76,208, 40,191,128, 0, 0, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 28,190, 76,208, 56,191,128, 0, 1, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 81,
-190, 76,208, 72,191,128, 0, 3, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,230,102,133,190, 76,208, 88,191,128, 0, 4,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0, 63,230,102,133,190, 76,208, 88, 63,127,255,146,128, 1, 0, 0, 0, 0, 2,255,
- 0, 0, 0, 0, 63,179, 51, 81,190, 76,208, 72, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 28,
-190, 76,208, 56, 63,127,255,152, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63, 25,153,207,190, 76,208, 40, 63,127,255,154,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,150,190, 76,208, 24, 63,127,255,156, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,230,102,127, 62, 76,208, 28, 63,127,255,148,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,131,
- 63,128, 0,160, 63,127,255,142,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0, 63,230,102,131, 63,230,103, 7, 63,127,255,148,
-128, 1, 0, 0, 0, 0, 2,255, 0, 0, 0, 0,190, 76,205,144, 63,179, 51,210, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0,190, 76,205,152, 63,128, 0,158, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152,
- 63, 25,154,209, 63,127,255,148, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,190, 76,205,152, 62, 76,209,160, 63,127,255,148,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,230,103, 12, 63,127,255,140, 0, 0,165,127, 90,129, 2,255,
- 0, 0, 0, 0, 63,128, 0, 27, 63,230,103, 10, 63,127,255,142, 0, 0,165,127, 90,129, 2,255, 0, 0, 0, 0, 63, 25,153,204,
- 63,230,103, 10, 63,127,255,146, 0, 0,165,127, 90,129, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,230,103, 8, 63,127,255,148,
- 0, 0,165,127, 90,129, 2,255, 0, 0, 0, 0, 62, 76,205,140, 62, 76,209,204, 63,127,255,154, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 62, 76,209,188, 63,127,255,152, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 62, 76,209,176, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 62, 76,209,160, 63,127,255,148,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63, 25,154,221, 63,127,255,156, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 63, 25,154,217, 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63, 25,154,213, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63, 25,154,209, 63,127,255,148,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,140, 63,128, 0,163, 63,127,255,156, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63, 25,153,204, 63,128, 0,162, 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 27,
- 63,128, 0,160, 63,127,255,150, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 80, 63,128, 0,158, 63,127,255,148,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 62, 76,205,152, 63,179, 51,216, 63,127,255,156, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63, 25,153,207, 63,179, 51,214, 63,127,255,154, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,128, 0, 28,
- 63,179, 51,212, 63,127,255,152, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,179, 51, 81, 63,179, 51,210, 63,127,255,148,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 63,230,102,133, 63, 25,154,206, 63,127,255,146,165,127, 0, 0, 90,129, 2,255,
- 0, 0, 0, 0, 63,230,102,133, 63,179, 51,208, 63,127,255,146,165,127, 0, 0, 90,129, 2,255, 0, 0, 0, 0,190, 76,205,144,
- 62, 76,201,140, 63,127,255,148,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,136, 63,127,255, 52, 63,127,255,148,
-127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48, 63,127,255,150,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205,120, 63, 25,152,194, 63,127,255,144,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205, 80,
- 63,179, 50,254, 63,127,255,150,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,128, 63,230,103, 12, 63,127,255,148,
-127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128, 63,230,103, 12,191,128, 0, 5,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205, 80, 63,179, 50,254,191, 25,153,156,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112,
- 63,230,102, 50,191, 25,153,160,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205, 80, 63,179, 50,254,190, 76,204,195,
-127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112, 63,230,102, 50,190, 76,204,211,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205, 80, 63,179, 50,254, 62, 76,204,221,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112,
- 63,230,102, 50, 62, 76,204,205,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205, 80, 63,179, 50,254, 63, 25,153,160,
-127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112, 63,230,102, 50, 63, 25,153,156,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205, 80, 63,179, 50,254,191,128, 0, 4,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,120,
- 63, 25,152,194,191,128, 0, 7,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48,191,128, 0, 4,
-127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 52, 63, 25,153,152,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205,120, 63, 25,152,202, 63, 25,153,152,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,
- 62, 76,201,108, 63, 25,153,156,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48, 63, 25,153,160,
-127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 52, 62, 76,204,173,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205,120, 63, 25,152,194, 62, 76,204,189,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,
- 62, 76,201,108, 62, 76,204,205,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48, 62, 76,204,221,
-127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 52,190, 76,204,243,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205,120, 63, 25,152,194,190, 76,204,227,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,
- 62, 76,201,108,190, 76,204,211,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48,190, 76,204,195,
-127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,152, 63,127,255, 52,191, 25,153,168,127,255, 0, 0, 0, 0, 3,255,
- 0, 0, 0, 0,190, 76,205,120, 63, 25,152,194,191, 25,153,164,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,
- 62, 76,201,108,191, 25,153,160,127,255, 0, 0, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,128,190, 76,208, 48,191, 25,153,156,
-127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,136, 63,127,255, 52,191,128, 0, 5,127,255, 0, 0, 0, 0, 1,255,
- 0, 0, 0, 0,190, 76,205,144, 62, 76,201,140,191,128, 0, 5,127,255, 0, 0, 0, 0, 1,255, 0, 0, 0, 0, 63,179, 51, 36,
-190, 76,208, 56, 63,127,255,150, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,190, 76,208, 80, 63,127,255,148,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80, 63,127,255,144, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104, 63,127,255,142, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0,190, 76,205,112,
-190, 76,208, 64, 63,127,255,150,231, 94,231, 94,123, 41, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191,128, 0, 4,
-231, 94,231, 94,132,215, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 63, 25,153,160, 0, 0,127,255, 0, 0, 1,255,
- 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64, 62, 76,204,221, 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,112,
-190, 76,208, 64,190, 76,204,195, 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0,190, 76,205,112,190, 76,208, 64,191, 25,153,156,
- 0, 0,127,255, 0, 0, 1,255, 0, 0, 0, 0, 63,230,102,136,190, 76,208, 88,191, 25,153,169, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63,230,102,136,190, 76,208, 88,190, 76,204,246, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,136,
-190, 76,208, 88, 62, 76,204,170, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,230,102,135,190, 76,208, 88, 63, 25,153,151,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104,191,128, 0, 8, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,191,128, 0, 7, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,
-190, 76,208, 80,191,128, 0, 5, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,191,128, 0, 4,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 36,190, 76,208,104, 63, 25,153,151, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63, 25,153,114,190, 76,208, 80, 63, 25,153,151, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,220,
-190, 76,208, 80, 63, 25,153,155, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 34,190, 76,208, 56, 63, 25,153,159,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104, 62, 76,204,170, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80, 62, 76,204,186, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,
-190, 76,208, 80, 62, 76,204,202, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56, 62, 76,204,218,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104,190, 76,204,246, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,190, 76,204,230, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,
-190, 76,208, 80,190, 76,204,214, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,190, 76,204,198,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 62, 76,204, 44,190, 76,208,104,191, 25,153,169, 0, 0,127,255, 0, 0, 3,255,
- 0, 0, 0, 0, 63, 25,153,116,190, 76,208, 80,191, 25,153,165, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,127,255,222,
-190, 76,208, 80,191, 25,153,161, 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 63,179, 51, 36,190, 76,208, 56,191, 25,153,157,
- 0, 0,127,255, 0, 0, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,118, 48, 0, 0, 1, 35, 0, 0, 0, 5,
- 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 24, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 14, 28, 7,161, 24, 32, 0, 0, 0, 55, 0, 0, 1, 45,
- 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 3,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, 34, 0, 0, 0, 8,
- 0, 0, 0, 9, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 34,
- 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 6,
- 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 13, 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 13, 0, 0, 0, 34, 0, 0, 0, 8,
- 0, 0, 0, 12, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 34,
- 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 10, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 10,
- 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0, 17, 0, 0, 0, 34, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0, 34, 0, 0, 0, 12,
- 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 11, 0, 0, 0, 15, 0, 0, 0, 34,
- 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 34, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 34, 0, 0, 0, 21, 0, 0, 0, 37,
- 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0, 36, 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 18,
- 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 21, 0, 0, 0, 25, 0, 0, 0, 34, 0, 0, 0, 20, 0, 0, 0, 21, 0, 0, 0, 34,
- 0, 0, 0, 20, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 23,
- 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 19, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 22, 0, 0, 0, 34, 0, 0, 0, 25,
- 0, 0, 0, 29, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 25, 0, 0, 0, 34, 0, 0, 0, 24, 0, 0, 0, 28, 0, 0, 0, 34,
- 0, 0, 0, 23, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 23, 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 23,
- 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 26, 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 28,
- 0, 0, 0, 29, 0, 0, 0, 34, 0, 0, 0, 28, 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 34,
- 0, 0, 0, 27, 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 26, 0, 0, 0, 27, 0, 0, 0, 34, 0, 0, 0, 26, 0, 0, 0, 30,
- 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 31, 0, 0, 0, 32, 0, 0, 0, 34, 0, 0, 0, 30,
- 0, 0, 0, 31, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 37, 0, 0, 0, 34,
- 0, 0, 0, 2, 0, 0, 0, 37, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 36, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 35,
- 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 34, 0, 0, 0, 38, 0, 0, 0, 39, 0, 0, 0, 34, 0, 0, 0, 40,
- 0, 0, 0, 41, 0, 0, 0, 34, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 44, 0, 0, 0, 45, 0, 0, 0, 34,
- 0, 0, 0, 30, 0, 0, 0, 38, 0, 0, 0, 34, 0, 0, 0, 26, 0, 0, 0, 39, 0, 0, 0, 34, 0, 0, 0, 22, 0, 0, 0, 40,
- 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 41, 0, 0, 0, 34, 0, 0, 0, 17, 0, 0, 0, 42, 0, 0, 0, 34, 0, 0, 0, 13,
- 0, 0, 0, 43, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 44, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 45, 0, 0, 0, 34,
- 0, 0, 0, 49, 0, 0, 0, 72, 0, 0, 0, 34, 0, 0, 0, 53, 0, 0, 0, 70, 0, 0, 0, 34, 0, 0, 0, 57, 0, 0, 0, 68,
- 0, 0, 0, 34, 0, 0, 0, 61, 0, 0, 0, 66, 0, 0, 0, 34, 0, 0, 0, 48, 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 46,
- 0, 0, 0, 62, 0, 0, 0, 34, 0, 0, 0, 49, 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 48, 0, 0, 0, 49, 0, 0, 0, 34,
- 0, 0, 0, 48, 0, 0, 0, 52, 0, 0, 0, 34, 0, 0, 0, 47, 0, 0, 0, 48, 0, 0, 0, 34, 0, 0, 0, 47, 0, 0, 0, 51,
- 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 47, 0, 0, 0, 34, 0, 0, 0, 46, 0, 0, 0, 50, 0, 0, 0, 34, 0, 0, 0, 53,
- 0, 0, 0, 57, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 53, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, 56, 0, 0, 0, 34,
- 0, 0, 0, 51, 0, 0, 0, 52, 0, 0, 0, 34, 0, 0, 0, 51, 0, 0, 0, 55, 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0, 51,
- 0, 0, 0, 34, 0, 0, 0, 50, 0, 0, 0, 54, 0, 0, 0, 34, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 56,
- 0, 0, 0, 57, 0, 0, 0, 34, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 55, 0, 0, 0, 56, 0, 0, 0, 34,
- 0, 0, 0, 55, 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 54, 0, 0, 0, 55, 0, 0, 0, 34, 0, 0, 0, 54, 0, 0, 0, 58,
- 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, 34, 0, 0, 0, 59, 0, 0, 0, 60, 0, 0, 0, 34, 0, 0, 0, 58,
- 0, 0, 0, 59, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0, 66, 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0, 68, 0, 0, 0, 34,
- 0, 0, 0, 67, 0, 0, 0, 68, 0, 0, 0, 34, 0, 0, 0, 68, 0, 0, 0, 70, 0, 0, 0, 34, 0, 0, 0, 69, 0, 0, 0, 70,
- 0, 0, 0, 34, 0, 0, 0, 67, 0, 0, 0, 69, 0, 0, 0, 34, 0, 0, 0, 70, 0, 0, 0, 72, 0, 0, 0, 34, 0, 0, 0, 71,
- 0, 0, 0, 72, 0, 0, 0, 34, 0, 0, 0, 64, 0, 0, 0, 72, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 63, 0, 0, 0, 34,
- 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 47,
- 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 49, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 33,
- 0, 0, 0, 58, 0, 0, 0, 34, 0, 0, 0, 29, 0, 0, 0, 54, 0, 0, 0, 34, 0, 0, 0, 25, 0, 0, 0, 50, 0, 0, 0, 34,
- 0, 0, 0, 21, 0, 0, 0, 46, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 64, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 63,
- 0, 0, 0, 34, 0, 0, 0, 75, 0, 0, 0, 76, 0, 0, 0, 34, 0, 0, 0, 73, 0, 0, 0, 74, 0, 0, 0, 34, 0, 0, 0, 71,
- 0, 0, 0, 77, 0, 0, 0, 34, 0, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 76, 0, 0, 0, 34,
- 0, 0, 0, 15, 0, 0, 0, 75, 0, 0, 0, 34, 0, 0, 0, 16, 0, 0, 0, 74, 0, 0, 0, 34, 0, 0, 0, 17, 0, 0, 0, 73,
- 0, 0, 0, 34, 0, 0, 0, 82, 0, 0, 0, 94, 0, 0, 0, 34, 0, 0, 0, 81, 0, 0, 0, 95, 0, 0, 0, 34, 0, 0, 0, 80,
- 0, 0, 0, 96, 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 78, 0, 0, 0, 83, 0, 0, 0, 34,
- 0, 0, 0, 81, 0, 0, 0, 82, 0, 0, 0, 34, 0, 0, 0, 79, 0, 0, 0, 80, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0,105,
- 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 83, 0, 0, 0,110, 0, 0, 0, 34, 0, 0, 0, 85,
- 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0, 84, 0, 0, 0,110, 0, 0, 0, 34,
- 0, 0, 0, 86, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0, 87, 0, 0, 0,102, 0, 0, 0, 34, 0, 0, 0, 88, 0, 0, 0, 98,
- 0, 0, 0, 34, 0, 0, 0, 89, 0, 0, 0, 94, 0, 0, 0, 34, 0, 0, 0, 86, 0, 0, 0, 87, 0, 0, 0, 34, 0, 0, 0, 88,
- 0, 0, 0, 89, 0, 0, 0, 34, 0, 0, 0, 93, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0,107, 0, 0, 0, 34,
- 0, 0, 0, 91, 0, 0, 0,108, 0, 0, 0, 34, 0, 0, 0, 90, 0, 0, 0,109, 0, 0, 0, 34, 0, 0, 0, 90, 0, 0, 0, 91,
- 0, 0, 0, 34, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0, 97, 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0, 96,
- 0, 0, 0, 97, 0, 0, 0, 34, 0, 0, 0, 96, 0, 0, 0,100, 0, 0, 0, 34, 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, 34,
- 0, 0, 0, 95, 0, 0, 0, 99, 0, 0, 0, 34, 0, 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, 34, 0, 0, 0, 94, 0, 0, 0, 98,
- 0, 0, 0, 34, 0, 0, 0,101, 0, 0, 0,110, 0, 0, 0, 34, 0, 0, 0,101, 0, 0, 0,105, 0, 0, 0, 34, 0, 0, 0,100,
- 0, 0, 0,101, 0, 0, 0, 34, 0, 0, 0,100, 0, 0, 0,104, 0, 0, 0, 34, 0, 0, 0, 99, 0, 0, 0,100, 0, 0, 0, 34,
- 0, 0, 0, 99, 0, 0, 0,103, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0, 99, 0, 0, 0, 34, 0, 0, 0, 98, 0, 0, 0,102,
- 0, 0, 0, 34, 0, 0, 0,105, 0, 0, 0,109, 0, 0, 0, 34, 0, 0, 0,104, 0, 0, 0,105, 0, 0, 0, 34, 0, 0, 0,104,
- 0, 0, 0,108, 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 0,104, 0, 0, 0, 34, 0, 0, 0,103, 0, 0, 0,107, 0, 0, 0, 34,
- 0, 0, 0,102, 0, 0, 0,103, 0, 0, 0, 34, 0, 0, 0,102, 0, 0, 0,106, 0, 0, 0, 34, 0, 0, 0,109, 0, 0, 0,111,
- 0, 0, 0, 34, 0, 0, 0,108, 0, 0, 0,109, 0, 0, 0, 34, 0, 0, 0,107, 0, 0, 0,108, 0, 0, 0, 34, 0, 0, 0,106,
- 0, 0, 0,107, 0, 0, 0, 34, 0, 0, 0, 65, 0, 0, 0, 78, 0, 0, 0, 34, 0, 0, 0, 66, 0, 0, 0, 83, 0, 0, 0, 34,
- 0, 0, 0, 58, 0, 0, 0, 85, 0, 0, 0, 34, 0, 0, 0, 59, 0, 0, 0,111, 0, 0, 0, 34, 0, 0, 0, 60, 0, 0, 0, 84,
- 0, 0, 0, 34, 0, 0, 0, 61, 0, 0, 0,110, 0, 0, 0, 34, 0, 0, 0, 30, 0, 0, 0, 93, 0, 0, 0, 34, 0, 0, 0, 31,
- 0, 0, 0, 92, 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 91, 0, 0, 0, 34, 0, 0, 0, 33, 0, 0, 0, 90, 0, 0, 0, 34,
- 0, 0, 0,113, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 0,132,
- 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 0,125, 0, 0, 0, 35, 0, 0, 0,117,
- 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 0,115, 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 0,115, 0, 0, 0,163,
- 0, 0, 0,112, 0, 0, 0,114, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 0,116, 0, 0, 0,163, 0, 0, 0,116, 0, 0, 0,117,
- 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 0,120, 0, 0, 0, 35, 0, 0, 0,127,
- 0, 0, 0,146, 0, 0, 0,163, 0, 0, 0,142, 0, 0, 0,146, 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 0,147, 0, 0, 0, 35,
- 0, 0, 0,129, 0, 0, 0,147, 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 0,147, 0, 0, 0,163, 0, 0, 0,128, 0, 0, 0,146,
- 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 0,127, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 0,120, 0, 0, 0, 35, 0, 0, 0,119,
- 0, 0, 0,121, 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 0,122, 0, 0, 0, 35,
- 0, 0, 0,121, 0, 0, 0,123, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 0,124, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 0,125,
- 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 0,126, 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 0,133, 0, 0, 0, 35, 0, 0, 0,131,
- 0, 0, 0,132, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 0,131, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 0,137, 0, 0, 0,163,
- 0, 0, 0,136, 0, 0, 0,137, 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 0,136, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 0,136,
- 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 0,135, 0, 0, 0, 35, 0, 0, 0,130,
- 0, 0, 0,134, 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 0,141, 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 0,141, 0, 0, 0, 35,
- 0, 0, 0,136, 0, 0, 0,140, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 0,140, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 0,139,
- 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,139, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 0,138, 0, 0, 0, 35, 0, 0, 0,141,
- 0, 0, 0,145, 0, 0, 0,163, 0, 0, 0,144, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 0,144, 0, 0, 0, 35,
- 0, 0, 0,143, 0, 0, 0,144, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 0,143,
- 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 0,145, 0, 0, 0, 35, 0, 0, 0,128,
- 0, 0, 0,143, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 0,130, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 0,134, 0, 0, 0, 35,
- 0, 0, 0,121, 0, 0, 0,138, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 0,142, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 0,166,
- 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 0,168, 0, 0, 0, 35, 0, 0, 0,148,
- 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 0,154, 0, 0, 0,163, 0, 0, 0,148, 0, 0, 0,149, 0, 0, 0, 35,
- 0, 0, 0,150, 0, 0, 0,151, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 0,174,
- 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0,154,
- 0, 0, 0,155, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 0,156, 0, 0, 0,163, 0, 0, 0,156, 0, 0, 0,157, 0, 0, 0, 35,
- 0, 0, 0,153, 0, 0, 0,157, 0, 0, 0,163, 0, 0, 0,158, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 0,177,
- 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0,158,
- 0, 0, 0,159, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 0,161, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,163, 0, 0, 0, 35,
- 0, 0, 0,164, 0, 0, 0,165, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 0,168,
- 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,172,
- 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 0,172, 0, 0, 0, 35,
- 0, 0, 0,167, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,170,
- 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 0,177, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,177, 0, 0, 0, 35, 0, 0, 0,172,
- 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 0,175, 0, 0, 0, 35,
- 0, 0, 0,174, 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 0,181,
- 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,179,
- 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 0,179, 0, 0, 0, 35,
- 0, 0, 0,174, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,180,
- 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,178, 0, 0, 0, 35, 68, 65, 84, 65,
- 0, 0, 1, 44, 13, 65,119,144, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 40, 32, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7,161, 46, 32, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 7,161, 60, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 5,200, 7,161, 40, 32, 0, 0, 0, 54, 0, 0, 0, 74, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 36, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 45,
- 0, 0, 0, 44, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 13,
- 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 13,
- 0, 0, 0, 43, 0, 0, 0, 42, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 16, 0, 0, 0, 15,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17,
- 0, 0, 0, 73, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 76, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0,
- 0, 0, 0, 21, 0, 0, 0, 20, 0, 0, 0, 36, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 18, 0, 0, 0, 34,
- 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 25, 0, 0, 0, 21, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 24,
- 0, 0, 0, 23, 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 18,
- 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 28, 0, 0, 0, 24, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 26,
- 0, 0, 0, 22, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 33, 0, 0, 0, 29, 0, 0, 0, 54, 0, 0, 0, 0,
- 0, 0, 0, 32, 0, 0, 0, 31, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 38, 0, 0, 0, 39,
- 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 91, 0, 0, 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 92,
- 0, 0, 0, 93, 0, 0, 0, 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 48, 0, 0, 0, 63, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 51,
- 0, 0, 0, 47, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 56, 0, 0, 0, 52, 0, 0, 0, 53, 0, 0, 0, 0,
- 0, 0, 0, 55, 0, 0, 0, 54, 0, 0, 0, 50, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 59, 0, 0, 0, 55,
- 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0,110, 0, 0, 0, 84, 0, 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0,111,
- 0, 0, 0, 85, 0, 0, 0, 58, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 83, 0, 0, 0, 66, 0, 0, 0, 65,
- 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 61, 0, 0, 0, 57, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 68,
- 0, 0, 0, 70, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 53, 0, 0, 0, 49, 0, 0, 0, 72, 0, 0, 0, 0,
- 0, 0, 0, 71, 0, 0, 0, 72, 0, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 79, 0, 0, 0, 97,
- 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 94, 0, 0, 0, 82, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0,110,
- 0, 0, 0,101, 0, 0, 0, 97, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 99, 0, 0, 0, 95, 0, 0, 0, 96,
- 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0,104,
- 0, 0, 0,100, 0, 0, 0,101, 0, 0, 0, 0, 0, 0, 0,103, 0, 0, 0,102, 0, 0, 0, 98, 0, 0, 0, 99, 0, 0, 0, 0,
- 0, 0, 0,111, 0, 0, 0,109, 0, 0, 0,105, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,108, 0, 0, 0,107, 0, 0, 0,103,
- 0, 0, 0,104, 0, 0, 0, 0, 0, 0, 0,106, 0, 0, 0, 86, 0, 0, 0, 87, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 90,
- 0, 0, 0, 91, 0, 0, 0,108, 0, 0, 0,109, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0,106, 0, 0, 0,107,
- 0, 0, 0, 0, 0, 0, 0,120, 0, 0, 0,119, 0, 0, 0,127, 0, 0, 0,118, 0, 0, 0, 2, 0, 0, 0,121, 0, 0, 0,138,
- 0, 0, 0,142, 0, 0, 0,119, 0, 0, 0, 2, 0, 0, 0,124, 0, 0, 0,123, 0, 0, 0,121, 0, 0, 0,122, 0, 0, 0, 2,
- 0, 0, 0,125, 0, 0, 0,130, 0, 0, 0,134, 0, 0, 0,123, 0, 0, 0, 2, 0, 0, 0,117, 0, 0, 0,116, 0, 0, 0,125,
- 0, 0, 0,126, 0, 0, 0, 2, 0, 0, 0,112, 0, 0, 0,114, 0, 0, 0,133, 0, 0, 0,132, 0, 0, 0, 2, 0, 0, 0,113,
- 0, 0, 0,115, 0, 0, 0,131, 0, 0, 0,130, 0, 0, 0, 2, 0, 0, 0,131, 0, 0, 0,132, 0, 0, 0,136, 0, 0, 0,135,
- 0, 0, 0, 2, 0, 0, 0,136, 0, 0, 0,137, 0, 0, 0,141, 0, 0, 0,140, 0, 0, 0, 2, 0, 0, 0,134, 0, 0, 0,135,
- 0, 0, 0,139, 0, 0, 0,138, 0, 0, 0, 2, 0, 0, 0,139, 0, 0, 0,140, 0, 0, 0,144, 0, 0, 0,143, 0, 0, 0, 2,
- 0, 0, 0,129, 0, 0, 0,147, 0, 0, 0,144, 0, 0, 0,145, 0, 0, 0, 2, 0, 0, 0,142, 0, 0, 0,143, 0, 0, 0,128,
- 0, 0, 0,146, 0, 0, 0, 2, 0, 0, 0,149, 0, 0, 0,148, 0, 0, 0,169, 0, 0, 0,168, 0, 0, 0, 2, 0, 0, 0,151,
- 0, 0, 0,150, 0, 0, 0,167, 0, 0, 0,166, 0, 0, 0, 2, 0, 0, 0,169, 0, 0, 0,161, 0, 0, 0,160, 0, 0, 0,173,
- 0, 0, 0, 2, 0, 0, 0,167, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0,171, 0, 0, 0, 2, 0, 0, 0,154, 0, 0, 0,166,
- 0, 0, 0,170, 0, 0, 0,155, 0, 0, 0, 2, 0, 0, 0,172, 0, 0, 0,173, 0, 0, 0,177, 0, 0, 0,176, 0, 0, 0, 2,
- 0, 0, 0,170, 0, 0, 0,171, 0, 0, 0,175, 0, 0, 0,174, 0, 0, 0, 2, 0, 0, 0,177, 0, 0, 0,159, 0, 0, 0,158,
- 0, 0, 0,181, 0, 0, 0, 2, 0, 0, 0,175, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0,179, 0, 0, 0, 2, 0, 0, 0,156,
- 0, 0, 0,174, 0, 0, 0,178, 0, 0, 0,157, 0, 0, 0, 2, 0, 0, 0,180, 0, 0, 0,181, 0, 0, 0,165, 0, 0, 0,164,
- 0, 0, 0, 2, 0, 0, 0,178, 0, 0, 0,179, 0, 0, 0,163, 0, 0, 0,162, 0, 0, 0, 2, 68, 65, 84, 65, 0, 0, 12,184,
- 7,161, 46, 32, 0, 0, 0, 65, 0, 0, 0, 74, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120, 61,104, 84,160,
- 63, 3, 29, 0, 62, 82, 95, 26, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113,
- 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,127, 63, 79, 65,242, 63, 0,188,190, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 61,104, 84,160, 63, 3, 29, 0,189,188,106,128, 62,186, 20,176, 61,104, 82,144, 62, 91,223,128, 62, 82, 95, 14,
- 62,186, 21, 0, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,127, 63, 79, 65,242, 62, 82, 95, 26, 63, 41, 47,120,
- 62,181, 84,122, 63, 3, 28,248, 63, 0,188,188, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 56,
- 63,141,179,111, 63, 0,188,190, 63,117, 84,102, 63, 38,207, 52, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63, 3, 28,248, 62, 82, 95, 14, 62,186, 21, 0, 62,181, 84,122, 62, 91,224, 32,
- 63, 0,188,185, 62,186, 21, 0, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52, 63, 79, 65,236, 63, 0,188,188,
- 63, 41, 47,120, 63, 38,207, 52, 63, 3, 28,248, 63, 76,225,174, 63, 41, 47,116, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 62,181, 84,122, 62, 91,224, 32, 62, 82, 94,138, 61,135, 43, 48, 62,181, 84, 61,189,169,104,176, 63, 0,188,185, 61,135, 44, 96,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52, 63, 3, 28,248, 63, 0,188,185, 62,186, 21, 0, 63, 38,207, 51,
- 62, 91,224, 24, 63, 76,225,174, 62,186, 21, 0, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236,
- 63, 76,225,174, 63, 41, 47,116, 63,114,244, 42, 63, 3, 28,244, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 38,207, 51, 62, 91,224, 24, 63, 0,188,185, 61,135, 44, 96, 63, 38,207,248,189,169,109,144, 63, 76,226,112,
- 61,135, 38, 64, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244,240, 62, 91,221, 4, 63,140,131,180, 62,186, 19,116,
- 63,114,244, 42, 63, 3, 28,244, 63, 76,225,174, 62,186, 21, 0, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122,
- 63,141,179,113, 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,189,188,105,128, 63, 41, 47,120,
- 61,104, 84,160, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188, 63,160,188,173, 62,181, 84,122,
- 63,141,179,113, 62,181, 84,122, 63,141,179,113, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160, 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64,
- 63, 3, 28,216,189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113,
- 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,189,188,105,128, 63, 41, 47,120, 61,104, 84,160,
- 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113,
- 62,181, 84,122, 63,141,179,113, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26,
- 63,117, 84,102, 61,104, 84,200, 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0,189,188,105, 96, 63, 41, 47,120,190,118,127, 56, 63, 3, 28,220,190,118,127, 64, 63, 3, 28,216,
-189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113, 62, 82, 95, 26,
- 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 61,104, 84,200, 63, 79, 65,244,189,188,105, 96, 63, 41, 47,120,189,188,105, 96, 63, 41, 47,120, 61,104, 84,200, 63, 79, 65,242,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102, 63, 76,225,172,
- 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188, 63,160,188,173,
- 63, 38,207, 56, 63,141,179,111, 63, 38,207, 52, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52, 63,141,179,111, 63, 76,225,172,
- 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102,
- 63, 76,225,172, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52,
- 63,141,179,111, 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52, 63,141,179,111,
- 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,174,
- 63,117, 84,102, 63, 76,225,174, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,207, 52, 63,141,179,111, 63, 0,188,190, 63,160,188,171, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,162, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 72, 63,140,131, 99,
- 63, 41, 47, 76, 63,159,140,161, 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76,
- 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63,159,140,161, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,161,
- 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236,
- 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,161,
- 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,244, 63, 3, 28, 50, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,131,172, 22, 59, 93,211, 96, 63,158,151,226, 59, 93,211, 96, 63,158,151,224, 59, 93,211, 96,
- 63,131,172, 22, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 81,128,144, 59, 93,211, 96, 63, 27,168,247,
- 59, 93,211, 96, 63, 27,168,248, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0,
- 63,185,131,176, 59, 93,211, 96, 63,158,151,226, 59, 93,211, 96, 63,158,151,224, 59, 93,211, 96, 63,185,131,174, 59, 93,211, 96,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,131,172, 21, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96, 63, 81,128,144,
- 59, 93,211, 96, 63,131,172, 22, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 27,168,247, 59, 93,211, 96,
- 62,203,162, 85, 59, 93,211, 96, 62,203,162, 85, 59, 93,211, 96, 63, 27,168,247, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1,
- 0, 0, 0, 0, 63,158,151,226, 59, 93,211, 96, 63,131,172, 24, 59, 93,211, 96, 63,131,172, 21, 59, 93,211, 96, 63,158,151,226,
- 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 81,128,142, 59, 93,211, 96, 63, 27,168,246, 59, 93,211, 96,
- 63, 27,168,247, 59, 93,211, 96, 63, 81,128,144, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,185,131,174,
- 59, 93,211, 96, 63,158,151,227, 59, 93,211, 96, 63,158,151,226, 59, 93,211, 96, 63,185,131,174, 59, 93,211, 96, 0, 0, 0, 0,
- 61, 0, 0, 1, 0, 0, 0, 0, 63,131,172, 22, 59, 93,211, 96, 63, 81,128,149, 59, 93,211, 96, 63, 81,128,142, 59, 93,211, 96,
- 63,131,172, 24, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 27,168,251, 59, 93,211, 96, 62,203,162, 84,
- 59, 93,211, 96, 62,203,162, 86, 59, 93,211, 96, 63, 27,168,246, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0,
- 63,158,151,225, 59, 93,211, 96, 63,131,172, 21, 59, 93,211, 96, 63,131,172, 22, 59, 93,211, 96, 63,158,151,227, 59, 93,211, 96,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 81,128,146, 59, 93,211, 96, 63, 27,168,250, 59, 93,211, 96, 63, 27,168,251,
- 59, 93,211, 96, 63, 81,128,149, 59, 93,211, 96, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63,159,140,161, 63, 3, 28,210,
- 63,140,131, 99, 63, 41, 47, 76, 63,140,131, 99, 63, 41, 47, 76, 63,159,140,244, 63, 3, 28, 50, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63,140,131, 99, 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99,
- 63, 41, 47, 76, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,161, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 76,
- 63,140,131, 99, 63, 41, 47, 76, 63,159,140,161, 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63,140,131, 99,
- 63, 41, 47, 76, 63,114,244, 44, 63, 79, 65,236, 63,114,244, 44, 63, 79, 65,236, 63,140,131, 99, 63, 41, 47, 76, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,159,140,162, 63, 3, 28,210, 63,140,131, 99, 63, 41, 47, 72, 63,140,131, 99, 63, 41, 47, 76,
- 63,159,140,161, 63, 3, 28,210, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52, 63,141,179,111, 63, 0,188,190,
- 63,160,188,171, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63,114,244, 44, 63, 79, 65,236, 63, 76,225,174, 63,117, 84,102, 63, 76,225,174, 63,117, 84,102, 63,114,244, 44, 63, 79, 65,236,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,174, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111, 63, 38,207, 52,
- 63,141,179,111, 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 38,207, 52, 63,141,179,111,
- 63, 0,188,188, 63,160,188,173, 63, 0,188,188, 63,160,188,173, 63, 38,207, 52, 63,141,179,111, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102, 63, 76,225,172, 63,117, 84,102, 63,114,244, 44,
- 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 76,225,172, 63,117, 84,102, 63, 38,207, 52, 63,141,179,111,
- 63, 38,207, 52, 63,141,179,111, 63, 76,225,172, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 63, 0,188,188,
- 63,160,188,173, 63, 38,207, 56, 63,141,179,111, 63, 38,207, 52, 63,141,179,111, 63, 0,188,188, 63,160,188,173, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0, 63,114,244, 44, 63, 79, 65,236, 63, 76,225,172, 63,117, 84,102, 63, 76,225,172, 63,117, 84,102,
- 63,114,244, 44, 63, 79, 65,236, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,200, 63, 79, 65,244,189,188,105, 96,
- 63, 41, 47,120,189,188,105, 96, 63, 41, 47,120, 61,104, 84,200, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 62,181, 84,122, 63,141,179,113, 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,189,188,105, 96, 63, 41, 47,120,190,118,127, 56, 63, 3, 28,220,190,118,127, 64,
- 63, 3, 28,216,189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102,
- 61,104, 84,200, 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113, 62,181, 84,122, 63,141,179,113, 63, 0,188,188,
- 63,160,188,173, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,
-189,188,105,128, 63, 41, 47,120, 61,104, 84,160, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122,
- 63,141,179,113, 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0,
- 60, 0, 0, 1, 0, 0, 0, 0,189,188,105,128, 63, 41, 47,120,190,118,127, 64, 63, 3, 28,216,190,118,127, 64, 63, 3, 28,216,
-189,188,105,128, 63, 41, 47,120, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62, 82, 95, 26, 63,117, 84,102, 61,104, 84,160,
- 63, 79, 65,242, 61,104, 84,160, 63, 79, 65,242, 62, 82, 95, 26, 63,117, 84,102, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0,
- 63, 0,188,188, 63,160,188,173, 62,181, 84,122, 63,141,179,113, 62,181, 84,122, 63,141,179,113, 63, 0,188,188, 63,160,188,173,
- 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 61,104, 84,160, 63, 79, 65,242,189,188,105,128, 63, 41, 47,120,189,188,105,128,
- 63, 41, 47,120, 61,104, 84,160, 63, 79, 65,242, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 62,181, 84,122, 63,141,179,113,
- 62, 82, 95, 26, 63,117, 84,102, 62, 82, 95, 26, 63,117, 84,102, 62,181, 84,122, 63,141,179,113, 0, 0, 0, 0, 60, 0, 0, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 4,160, 7,161, 60, 32, 0, 0, 0, 59, 0, 0, 1, 40,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24,
- 13, 65,120,240, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,131, 64, 13, 65,115, 96, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108,
- 97,110,101, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,122, 48, 13, 65,128, 48, 13, 65,129, 0,
- 0, 0, 0, 0, 7,161, 66, 32, 13, 65,125, 32, 0, 0, 0, 0, 13, 65,130,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,122, 96, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,123,192, 0, 0, 0, 1,
- 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,126,208, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76,205, 4, 55, 39,197,172, 63, 76,204,214, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,122, 48, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 44, 13, 65,122, 96, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 66, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 2, 40, 7,161, 66, 32, 0, 0, 0, 58, 0, 0, 0, 23,191, 76,205, 4, 0, 0, 0, 0,190,204,204,208, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,190,204,204,216, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
-182, 70, 0, 0, 52,128, 0, 0,190,204,204,224, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,191, 76,205, 4, 0, 0, 0, 0,
- 52, 96, 0, 0, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,179, 0, 0, 0, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0,180,144, 0, 0, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
-191, 76,205, 4, 0, 0, 0, 0, 62,204,204,213, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,
- 62,204,204,205, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0, 62,204,204,197, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0,190,204,205, 47, 0, 0, 0, 0, 63, 76,204,206, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
-182, 62, 0, 0, 52,128, 0, 0, 63, 76,204,206, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,191, 76,205, 4, 0, 0, 0, 0,
-191, 76,204,208, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,191, 76,204,212, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0,191, 76,204,214, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
- 62,204,205, 47,180,128, 0, 0,191, 76,204,206, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0, 63, 76,205, 4, 0, 0, 0, 0,
- 63, 76,204,210, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0, 62,204,205, 53,180,128, 0, 0, 63, 76,204,214, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0, 62,204,204,213, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
- 62,204,205, 47,180,128, 0, 0, 62,204,204,221, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0,
- 52, 96, 0, 0, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0, 62,204,205, 47,180,128, 0, 0, 52,240, 0, 0, 0, 0,128, 1,
- 0, 0, 3, 1, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0,190,204,204,208, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0,
- 62,204,205, 47,180,128, 0, 0,190,204,204,200, 0, 0,128, 1, 0, 0, 3, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,123,192, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,125, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,128,
- 13, 65,125, 32, 0, 0, 0, 55, 0, 0, 0, 32, 0, 0, 0, 2, 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 20,
- 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 0, 2,
- 0, 0, 0, 13, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 35,
- 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 1,
- 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 35, 0, 0, 0, 5,
- 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 35,
- 0, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0, 7,
- 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 9,
- 0, 0, 0, 10, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 35,
- 0, 0, 0, 16, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 0, 17,
- 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 0, 20, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 35, 0, 0, 0, 20,
- 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 0, 22, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 0, 21, 0, 0, 0, 35,
- 0, 0, 0, 14, 0, 0, 0, 22, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,126,208, 0, 0, 1, 35, 0, 0, 0, 5,
- 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,128, 48, 0, 0, 0, 5,
- 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,129, 0, 0, 0, 0, 6, 0, 0, 0, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,130,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,160, 13, 65,128, 48, 0, 0, 0, 54, 0, 0, 0, 8,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 1,
- 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 10,
- 0, 0, 0, 9, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 18, 0, 0, 0, 17,
- 0, 0, 0, 2, 0, 0, 0, 18, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 2, 0, 0, 0, 22, 0, 0, 0, 21,
- 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 2, 0, 0, 0, 22, 0, 0, 0, 2, 0, 0, 0, 13, 0, 0, 0, 14, 0, 0, 0, 2,
- 68, 65, 84, 65, 0, 0, 1, 96, 13, 65,129, 0, 0, 0, 0, 65, 0, 0, 0, 8, 62,137,192, 12, 63,125,226,162, 61,246,108,144,
- 63,125,226,162, 61,246,108,144, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0,
- 62,213,228,252, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,213,228,252, 63,125,226,162,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,137,192, 12, 63,125,226,162, 61,246,108,144, 63,125,226,162, 61,246,108,144,
- 63,125,226,162, 62,137,192, 12, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,213,229, 0, 63,125,226,162,
- 62,137,192, 18, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,213,228,252, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1,
- 0, 0, 0, 0, 63, 55, 23,154, 63,125,226,162, 63, 17, 5, 34, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 63, 55, 23,152,
- 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 17, 5, 30, 63,125,226,162, 62,213,228,252, 63,125,226,162,
- 62,213,228,252, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 17, 5, 30,
- 63,125,226,162, 63, 55, 23,152, 63,125,226,162, 63, 55, 23,152, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 0, 0, 0, 0,
- 61, 0, 0, 1, 0, 0, 0, 0, 63, 17, 5, 30, 63,125,226,162, 62,213,228,252, 63,125,226,162, 62,213,228,252, 63,125,226,162,
- 63, 17, 5, 30, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,128, 13, 65,130,144,
- 0, 0, 0, 59, 0, 0, 0, 32,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,131, 64, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,141,144,
- 13, 65,120,240,192,139, 5, 8, 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,132,128, 13, 65,138,128, 13, 65,139, 80, 0, 0, 0, 0, 7,161, 70, 32, 13, 65,135,112, 0, 0, 0, 0,
- 13, 65,140,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,132,176, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,134, 16, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,137, 32, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 32,
- 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76,205, 2,
- 55, 39,197,172, 63, 76,204,214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 5,
- 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,132,128,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,132,176, 0, 0, 1, 35, 0, 0, 0, 5,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,161, 70, 32, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 2, 40, 7,161, 70, 32, 0, 0, 0, 58, 0, 0, 0, 23,
- 62,204,205, 47,180,128, 0, 0,190,204,204,200, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0,
-190,204,204,208, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0, 62,204,205, 47,180,128, 0, 0, 52,240, 0, 0, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0, 52, 96, 0, 0, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,
- 62,204,205, 47,180,128, 0, 0, 62,204,204,221, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0, 63, 76,205, 0, 0, 0, 0, 0,
- 62,204,204,213, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0, 62,204,205, 53,180,128, 0, 0, 63, 76,204,214, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0, 62,204,205, 47,180,128, 0, 0,191, 76,204,206, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,
- 63, 76,205, 0, 0, 0, 0, 0,191, 76,204,208, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0,
-191, 76,204,214, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,191, 76,204,212, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0,182, 62, 0, 0, 52,128, 0, 0, 63, 76,204,206, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,
-190,204,205, 47, 0, 0, 0, 0, 63, 76,204,206, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,191, 76,205, 4, 0, 0, 0, 0,
- 63, 76,204,210, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0, 62,204,204,197, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0, 62,204,204,205, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,
-191, 76,205, 4, 0, 0, 0, 0, 62,204,204,213, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,182, 70, 0, 0, 52,128, 0, 0,
-180,144, 0, 0, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,179, 0, 0, 0, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0,191, 76,205, 4, 0, 0, 0, 0, 52, 96, 0, 0, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,
-182, 70, 0, 0, 52,128, 0, 0,190,204,204,224, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,190,204,205, 55, 0, 0, 0, 0,
-190,204,204,216, 0, 0,128, 1, 0, 0, 2, 0, 0, 0, 0, 0,191, 76,205, 4, 0, 0, 0, 0,190,204,204,208, 0, 0,128, 1,
- 0, 0, 2, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,134, 16, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,135,112, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1,128, 13, 65,135,112, 0, 0, 0, 55, 0, 0, 0, 32, 0, 0, 0, 1,
- 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 34,
- 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 34, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 3,
- 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 34, 0, 0, 0, 4,
- 0, 0, 0, 6, 0, 0, 0, 34, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 9, 0, 0, 0, 10, 0, 0, 0, 34,
- 0, 0, 0, 12, 0, 0, 0, 13, 0, 0, 0, 34, 0, 0, 0, 13, 0, 0, 0, 16, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 16,
- 0, 0, 0, 34, 0, 0, 0, 12, 0, 0, 0, 15, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 34, 0, 0, 0, 11,
- 0, 0, 0, 14, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 19, 0, 0, 0, 34, 0, 0, 0, 15, 0, 0, 0, 18, 0, 0, 0, 34,
- 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 34, 0, 0, 0, 14, 0, 0, 0, 17, 0, 0, 0, 34, 0, 0, 0, 19, 0, 0, 0, 22,
- 0, 0, 0, 34, 0, 0, 0, 21, 0, 0, 0, 22, 0, 0, 0, 34, 0, 0, 0, 18, 0, 0, 0, 21, 0, 0, 0, 34, 0, 0, 0, 20,
- 0, 0, 0, 21, 0, 0, 0, 34, 0, 0, 0, 17, 0, 0, 0, 20, 0, 0, 0, 34, 0, 0, 0, 10, 0, 0, 0, 21, 0, 0, 0, 34,
- 0, 0, 0, 9, 0, 0, 0, 20, 0, 0, 0, 34, 0, 0, 0, 6, 0, 0, 0, 11, 0, 0, 0, 34, 0, 0, 0, 4, 0, 0, 0, 14,
- 0, 0, 0, 34, 0, 0, 0, 2, 0, 0, 0, 17, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 34, 68, 65, 84, 65,
- 0, 0, 1, 44, 13, 65,137, 32, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,138,128, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,139, 80, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,140,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,160, 13, 65,138,128, 0, 0, 0, 54, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8,
- 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4,
- 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 11, 0, 0, 0, 14, 0, 0, 0, 4, 0, 0, 0, 0,
- 0, 0, 0, 12, 0, 0, 0, 13, 0, 0, 0, 16, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 18,
- 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 19, 0, 0, 0, 22, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 20,
- 0, 0, 0, 21, 0, 0, 0, 10, 0, 0, 0, 9, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 96, 13, 65,139, 80, 0, 0, 0, 65,
- 0, 0, 0, 8, 63, 55, 23,152, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 63, 55, 23,152,
- 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,213,228,252, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162,
- 63, 17, 5, 30, 63,125,226,162, 62,213,228,252, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 63, 55, 23,152,
- 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 63, 17, 5, 30, 63,125,226,162, 63, 55, 23,152, 63,125,226,162, 0, 0, 0, 0,
- 61, 0, 0, 1, 0, 0, 0, 0, 63, 17, 5, 34, 63,125,226,162, 62,213,229, 0, 63,125,226,162, 62,213,228,252, 63,125,226,162,
- 63, 17, 5, 30, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,137,192, 18, 63,125,226,162, 61,246,108,144,
- 63,125,226,162, 61,246,108,144, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0,
- 62,213,228,252, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,213,228,252, 63,125,226,162,
- 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,137,192, 12, 63,125,226,162, 61,246,108,144, 63,125,226,162, 61,246,108,144,
- 63,125,226,162, 62,137,192, 12, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1, 0, 0, 0, 0, 62,213,228,252, 63,125,226,162,
- 62,137,192, 12, 63,125,226,162, 62,137,192, 12, 63,125,226,162, 62,213,228,252, 63,125,226,162, 0, 0, 0, 0, 61, 0, 0, 1,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,128, 13, 65,140,224, 0, 0, 0, 59, 0, 0, 0, 32,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24,
- 13, 65,141,144, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,148,176, 13, 65,131, 64, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108,
- 97,110,101, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,142,208, 13, 65,148, 16, 13, 65,148, 80,
- 0, 0, 0, 0, 13, 65,144, 96, 13, 65,146, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,143, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,144,240, 0, 0, 0, 1,
- 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,146,176, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 64,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
-179,128, 0, 0, 52, 64, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 2, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,142,208, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 8, 32, 68, 65, 84, 65,
- 0, 0, 1, 44, 13, 65,143, 0, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,144, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0, 96, 13, 65,144, 96, 0, 0, 0, 58, 0, 0, 0, 4, 63,128, 0, 0, 63,127,255,255, 0, 0, 0, 0, 0, 0, 0, 0,
-127,255, 3,255, 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0,
-191,128, 0, 1,191,127,255,253, 0, 0, 0, 0, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0,191,127,255,250, 63,128, 0, 3,
- 0, 0, 0, 0, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,144,240, 0, 0, 1, 35,
- 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,146, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 48, 13, 65,146, 80, 0, 0, 0, 55,
- 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,146,176,
- 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,148, 16, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,
-120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,148, 80,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 13, 65,148, 16,
- 0, 0, 0, 54, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 68, 65, 84, 65,
- 0, 0, 0, 44, 13, 65,148, 80, 0, 0, 0, 65, 0, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 60, 0, 0, 1, 0, 0, 0, 0, 0, 0, 77, 69,
- 0, 0, 1, 24, 13, 65,148,176, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,154, 64, 13, 65,141,144, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 69,112,114,101,118,105,101,119, 0, 0, 0, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,149,240, 12,118,208, 32,
- 12,119, 64, 32, 0, 0, 0, 0, 12,118, 48, 32, 12,118,112, 32, 0, 0, 0, 0, 12,120, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,150, 32, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,151,128,
- 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,152,224, 0, 0, 0, 3, 0, 0, 0, 5,
- 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,130, 0, 0, 7,128, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,186,224,117, 64,187, 13, 91, 64,186,240,160, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,149,240, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 8, 32,
- 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,150, 32, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,118, 48, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 60, 48, 12,118, 48, 32, 0, 0, 0, 58, 0, 0, 2,130,191,141,136, 28, 62,244,243, 12,192,183, 86,198,
-231,212, 10,117,130,191, 3,255, 0, 0, 0, 0,192,131,102,240, 64,119,183, 30,191,199,169,109,166, 58, 84,158,221,230, 3,255,
- 0, 0, 0, 0, 63,239,108,119, 64,156, 85,213,192, 40, 58,188, 40,228,106,207,198,137, 3,255, 0, 0, 0, 0, 64,146,135, 95,
-191, 14, 54, 63,192,102,194,241,100, 27,243,219,177, 45, 3,255, 0, 0, 0, 0, 62,141, 84,239,192,157,220, 16,192, 73, 2, 14,
- 6, 8,148, 39,187, 86, 3,255, 0, 0, 0, 0,192,162,239,132,192, 12,165,206,191,240, 45,150,144,175,207,245,214,251, 3,255,
- 0, 0, 0, 0,190,141, 84,239, 64,157,220, 16, 64, 73, 2, 14,249,248,107,217, 68,170, 3,255, 0, 0, 0, 0, 64,162,239,132,
- 64, 12,165,206, 63,240, 45,150,111, 81, 48, 11, 41, 5, 3,255, 0, 0, 0, 0, 64,131,102,240,192,119,183, 30, 63,199,169,109,
- 89,198,171, 98, 34, 26, 3,255, 0, 0, 0, 0,191,239,108,119,192,156, 85,213, 64, 40, 58,188,215, 28,149, 49, 57,119, 3,255,
- 0, 0, 0, 0,192,146,135, 95, 63, 14, 54, 63, 64,102,194,241,155,229, 12, 37, 78,211, 3,255, 0, 0, 0, 0, 63,141,136, 28,
-190,244,243, 12, 64,183, 86,198, 24, 44,245,139,125, 65, 3,255, 0, 0, 0, 0,192, 68, 17,114, 64, 35,153,226,192,137, 26,154,
-189, 6, 55,226,162, 85, 3,255, 0, 0, 0, 0, 62,230, 40,155, 64, 73,199,239,192,157, 52,176, 9,211, 68,237,148,153, 3,255,
- 0, 0, 0, 0,191,168, 55,124, 64,164,177,224,192, 29,144, 58,227, 69,112,132,202, 46, 3,255, 0, 0, 0, 0,192,105, 35, 94,
-191,129, 88,230,192,143, 14,195,176, 93,233,233,158, 68, 3,255, 0, 0, 0, 0,192,173, 2, 37, 63,123,187,137,192, 1, 68, 56,
-137,206, 21,127,211,216, 3,255, 0, 0, 0, 0, 64, 2,168,234,189, 57,158,231,192,175,149, 65, 44,162,255, 3,136, 11, 3,255,
- 0, 0, 0, 0, 64,114,159, 19, 64, 34,226,254,192,106,133,196, 82,225, 55,164,175,228, 3,255, 0, 0, 0, 0,190,249,176,105,
-192, 39,148, 21,192,166,214,217,245, 87,198,194,142, 5, 3,255, 0, 0, 0, 0, 64, 54,163,227,192, 78,121, 86,192,125,202, 22,
- 62, 99,185,120,169, 79, 3,255, 0, 0, 0, 0,192, 53, 40,241,192,134, 31,200,192, 60,188,229,194, 30,164, 94,191,136, 3,255,
- 0, 0, 0, 0,192,181,230, 96,191,119, 24, 33, 63,130, 26,174,131,186,234,231, 22, 56, 3,255, 0, 0, 0, 0,192,163, 93,103,
- 64, 38,128,136, 63,153,235, 83,144,100, 56,224, 26, 74, 3,255, 0, 0, 0, 0,192, 36,219,238, 64,165,151,132, 63,109,226,165,
-199,176,113, 33, 20, 80, 3,255, 0, 0, 0, 0, 63,111,237, 24, 64,184,174,118, 62,154, 34,212, 20,125,126, 44, 6,148, 3,255,
- 0, 0, 0, 0, 64,130,244,163, 64,133, 58,157,190,226, 95,125, 89,119, 91, 5,246, 86, 3,255, 0, 0, 0, 0, 64,181,230, 96,
- 63,119, 24, 33,191,130, 26,174,124, 70, 21, 25,233,200, 3,255, 0, 0, 0, 0, 64,163, 93,103,192, 38,128,136,191,153,235, 83,
-111,156,199, 32,229,182, 3,255, 0, 0, 0, 0, 64, 36,219,238,192,165,151,132,191,109,226,165, 56, 80,142,223,235,176, 3,255,
- 0, 0, 0, 0,191,111,237, 24,192,184,174,118,190,154, 34,212,235,131,129,212,249,108, 3,255, 0, 0, 0, 0,192,130,244,163,
-192,133, 58,157, 62,226, 95,125,166,137,164,251, 9,170, 3,255, 0, 0, 0, 0,192, 54,163,227, 64, 78,121, 86, 64,125,202, 22,
-193,157, 70,136, 86,177, 3,255, 0, 0, 0, 0, 64, 53, 40,241, 64,134, 31,200, 64, 60,188,229, 61,226, 91,162, 64,120, 3,255,
- 0, 0, 0, 0, 64,173, 2, 37,191,123,187,137, 64, 1, 68, 56,118, 50,234,129, 44, 40, 3,255, 0, 0, 0, 0, 63,168, 55,124,
-192,164,177,224, 64, 29,144, 58, 28,187,143,124, 53,210, 3,255, 0, 0, 0, 0,192,114,159, 19,192, 34,226,254, 64,106,133,196,
-173, 31,200, 92, 80, 28, 3,255, 0, 0, 0, 0,192, 2,168,234, 61, 57,158,231, 64,175,149, 65,211, 94, 0,253,119,245, 3,255,
- 0, 0, 0, 0, 62,249,176,105, 64, 39,148, 21, 64,166,214,217, 10,169, 57, 62,113,251, 3,255, 0, 0, 0, 0, 64,105, 35, 94,
- 63,129, 88,230, 64,143, 14,195, 79,163, 22, 23, 97,188, 3,255, 0, 0, 0, 0, 64, 68, 17,114,192, 35,153,226, 64,137, 26,154,
- 66,250,200, 30, 93,171, 3,255, 0, 0, 0, 0,190,230, 40,155,192, 73,199,239, 64,157, 52,176,246, 45,187, 19,107,103, 3,255,
- 0, 0, 0, 0,192, 10,178, 37, 63,201,231,138,192,166,143,149,209,129, 33,140,141,145, 3,255, 0, 0, 0, 0,192,110,132, 3,
- 64, 85,203,243,192, 66,107,151,174, 16, 73,158,190,209, 3,255, 0, 0, 0, 0,190,174,161,116, 63,241,152, 81,192,177, 2,110,
-247,217, 40, 15,134,182, 3,255, 0, 0, 0, 0, 63,154, 91,138, 64,133,179,218,192,122,222,209, 27, 0, 92, 30,171, 86, 3,255,
- 0, 0, 0, 0,192, 52, 82, 7, 64,149,252, 82,192, 5,202, 64,193, 39,101,227,210,181, 3,255, 0, 0, 0, 0, 62,148, 12,179,
- 64,166,221,251,192, 41, 87,188, 7,192,113,224,198, 21, 3,255, 0, 0, 0, 0,192, 29,246,216,190,141,156, 17,192,169,167,209,
-203, 47,250,160,139,137, 3,255, 0, 0, 0, 0,192,145, 72, 99,191,213,114, 79,192, 83, 35,183,156, 26,219, 3,185, 12, 3,255,
- 0, 0, 0, 0,192,158, 58,115, 64, 33,120,129,191,238, 41,198,148,126, 56,116,215,137, 3,255, 0, 0, 0, 0,192,174,158,118,
-191, 33,148,103,192, 1,156,140,136,218,240,198,211,203, 3,255, 0, 0, 0, 0, 62,249, 14, 55, 62,102,133, 95,192,186,143,210,
- 9, 56, 5, 40,128,113, 3,255, 0, 0, 0, 0, 64, 92, 61,220,190,159,230, 56,192,151, 61, 6, 76, 94,248,242,153,135, 3,255,
- 0, 0, 0, 0, 64, 60, 86, 7, 64,119, 48, 60,192, 81, 88, 93, 63,119, 85,124,184,246, 3,255, 0, 0, 0, 0, 64,139, 55,252,
- 63,132, 95, 62,192,113,216,225, 95,118, 21, 54,173,107, 3,255, 0, 0, 0, 0,191, 84, 6, 18,191,142, 96,251,192,182, 4, 76,
-237,158,233, 20,131,109, 3,255, 0, 0, 0, 0,189,225, 74,109,192,123, 54, 51,192,138,246, 34,253,241,169, 39,162, 1, 3,255,
- 0, 0, 0, 0, 64,119, 66,153,191,251,154,127,192,123,220,161, 85, 59,214, 59,170, 34, 3,255, 0, 0, 0, 0, 63,208, 59,201,
-192,135,182,241,192,108,101,212, 34,103,162,133,175,160, 3,255, 0, 0, 0, 0,191,169,246,161,192,151,196,235,192, 74,149,170,
-228, 95,151,253,186,184, 3,255, 0, 0, 0, 0,192,131,198, 33,192, 84,137,218,192, 32,134, 37,164,247,184, 77,201,167, 3,255,
- 0, 0, 0, 0,192,179, 61,176,191,210,110,138,190,228,220, 24,133,210,219,130,244,238, 3,255, 0, 0, 0, 0,192,170,182, 73,
-190, 90, 16,136, 64, 25,194, 90,139,224,252, 8, 53,174, 3,255, 0, 0, 0, 0,192,153, 55, 75, 64, 87, 78, 4,190, 62, 54, 12,
-151,200, 74, 29,250,179, 3,255, 0, 0, 0, 0,192,161, 19,235, 63,210, 12,207, 64, 31,242,210,146, 50, 34,244, 55,182, 3,255,
- 0, 0, 0, 0,192, 94, 75, 60, 64,150,115,189,190,167,211,186,179, 98,102, 49,247,183, 3,255, 0, 0, 0, 0,191,189,191,186,
- 64,168, 32, 63, 64, 7,100,213,224,161,114,191, 47, 61, 3,255, 0, 0, 0, 0, 63,186,205,242, 64,177, 65,141,191,154,219,127,
- 32, 82,120,177,228, 61, 3,255, 0, 0, 0, 0, 62,175,245, 99, 64,178, 12, 97, 63,228,253,255, 6,247,121, 65, 40, 98, 3,255,
- 0, 0, 0, 0, 64, 70, 92,226, 64,150,131, 8,191,204, 77,182, 66,193,103, 37,220, 32, 3,255, 0, 0, 0, 0, 64,152,194,200,
- 64, 83,155,180, 63, 62,217,154,104,207, 71,101, 17, 87, 3,255, 0, 0, 0, 0, 64,170,182, 73, 62, 90, 16,136,192, 25,194, 90,
-116, 32, 3,248,202, 82, 3,255, 0, 0, 0, 0, 64,179, 61,176, 63,210,110,138, 62,228,220, 24,122, 46, 36,126, 11, 18, 3,255,
- 0, 0, 0, 0, 64,161, 19,235,191,210, 12,207,192, 31,242,210,109,206,221, 12,200, 74, 3,255, 0, 0, 0, 0, 64,153, 55, 75,
-192, 87, 78, 4, 62, 62, 54, 12,104, 56,181,227, 5, 77, 3,255, 0, 0, 0, 0, 63,189,191,186,192,168, 32, 63,192, 7,100,213,
- 31, 95,141, 65,208,195, 3,255, 0, 0, 0, 0, 64, 94, 75, 60,192,150,115,189, 62,167,211,186, 76,158,153,207, 8, 73, 3,255,
- 0, 0, 0, 0,190,175,245, 99,192,178, 12, 97,191,228,253,255,249, 9,134,191,215,158, 3,255, 0, 0, 0, 0,191,186,205,242,
-192,177, 65,141, 63,154,219,127,223,174,135, 79, 27,195, 3,255, 0, 0, 0, 0,192,152,194,200,192, 83,155,180,191, 62,217,154,
-151, 49,184,155,238,169, 3,255, 0, 0, 0, 0,192, 70, 92,226,192,150,131, 8, 63,204, 77,182,189, 63,152,219, 35,224, 3,255,
- 0, 0, 0, 0,191,208, 59,201, 64,135,182,241, 64,108,101,212,221,153, 93,123, 80, 96, 3,255, 0, 0, 0, 0,192,119, 66,153,
- 63,251,154,127, 64,123,220,161,170,197, 41,197, 85,222, 3,255, 0, 0, 0, 0, 63,169,246,161, 64,151,196,235, 64, 74,149,170,
- 27,161,104, 3, 69, 72, 3,255, 0, 0, 0, 0, 64,131,198, 33, 64, 84,137,218, 64, 32,134, 37, 91, 9, 71,179, 54, 89, 3,255,
- 0, 0, 0, 0, 64,174,158,118, 63, 33,148,103, 64, 1,156,140,119, 38, 15, 58, 44, 53, 3,255, 0, 0, 0, 0, 64,158, 58,115,
-192, 33,120,129, 63,238, 41,198,107,130,199,140, 40,119, 3,255, 0, 0, 0, 0, 64, 52, 82, 7,192,149,252, 82, 64, 5,202, 64,
- 62,217,154, 29, 45, 75, 3,255, 0, 0, 0, 0,190,148, 12,179,192,166,221,251, 64, 41, 87,188,248, 64,142, 32, 57,235, 3,255,
- 0, 0, 0, 0,192, 60, 86, 7,192,119, 48, 60, 64, 81, 88, 93,192,137,170,132, 71, 10, 3,255, 0, 0, 0, 0,192,139, 55,252,
-191,132, 95, 62, 64,113,216,225,160,138,234,202, 82,149, 3,255, 0, 0, 0, 0,192, 92, 61,220, 62,159,230, 56, 64,151, 61, 6,
-179,162, 7, 14,102,121, 3,255, 0, 0, 0, 0,190,249, 14, 55,190,102,133, 95, 64,186,143,210,246,200,250,216,127,143, 3,255,
- 0, 0, 0, 0, 61,225, 74,109, 64,123, 54, 51, 64,138,246, 34, 2, 15, 86,217, 93,255, 3,255, 0, 0, 0, 0, 63, 84, 6, 18,
- 63,142, 96,251, 64,182, 4, 76, 18, 98, 22,236,124,147, 3,255, 0, 0, 0, 0, 64,145, 72, 99, 63,213,114, 79, 64, 83, 35,183,
- 99,230, 36,253, 70,244, 3,255, 0, 0, 0, 0, 64, 29,246,216, 62,141,156, 17, 64,169,167,209, 52,209, 5, 96,116,119, 3,255,
- 0, 0, 0, 0, 64,110,132, 3,192, 85,203,243, 64, 66,107,151, 81,240,182, 98, 65, 47, 3,255, 0, 0, 0, 0, 64, 10,178, 37,
-191,201,231,138, 64,166,143,149, 46,127,222,116,114,111, 3,255, 0, 0, 0, 0,191,154, 91,138,192,133,179,218, 64,122,222,209,
-229, 0,163,226, 84,170, 3,255, 0, 0, 0, 0, 62,174,161,116,191,241,152, 81, 64,177, 2,110, 8, 39,215,241,121, 74, 3,255,
- 0, 0, 0, 0,192, 19, 76, 36, 64,129,151, 25,192, 98,254,212,206,231, 88, 97,177,131, 3,255, 0, 0, 0, 0,191,175,232, 93,
- 64, 64, 23,177,192,154,186, 69,225,227, 66,235,151, 34, 3,255, 0, 0, 0, 0,190,232,190,208, 64,139,160, 93,192,120, 33,191,
-244,183, 94,205,170,192, 3,255, 0, 0, 0, 0,192,142,126,210, 63,238, 49, 43,192, 84, 30,112,158,187, 39, 95,182,183, 3,255,
- 0, 0, 0, 0,192, 97,165,138, 63, 80, 9, 92,192,147, 74, 20,177,183, 17,233,156, 86, 3,255, 0, 0, 0, 0,192,152, 61, 98,
-188,106, 63, 87,192, 90, 97, 6,152,127, 0,251,180,183, 3,255, 0, 0, 0, 0, 64, 14,173,200, 64, 63,183,155,192,144, 75,192,
- 48,206, 64, 45,156,152, 3,255, 0, 0, 0, 0, 63,167,162, 95, 63,209, 29,144,192,174,245, 25, 29,250, 36, 75,136,250, 3,255,
- 0, 0, 0, 0, 64, 68, 62,211, 63,168, 56, 51,192,153,245, 13, 65,241, 29,192,150,106, 3,255, 0, 0, 0, 0, 64, 36,182, 33,
-191,220, 38, 34,192,159, 5,150, 54,233,217,211,146,223, 3,255, 0, 0, 0, 0, 63, 81, 34, 16,191,179, 64,129,192,180, 5,162,
- 18,242,224, 93,133,111, 3,255, 0, 0, 0, 0, 63,159, 56,212,192, 68,166,172,192,154,108,212, 27,176,190, 32,149,208, 3,255,
- 0, 0, 0, 0,191,223, 76,204,192,101, 32,170,192,137, 83, 65,216,199,178,195,161,198, 3,255, 0, 0, 0, 0,192, 10,249,249,
-191,244, 52, 62,192,162,236, 25,208, 9,213, 0,145,102, 3,255, 0, 0, 0, 0,192, 89,207, 42,192, 47, 6,251,192,121,165, 27,
-182,209,196, 18,169,198, 3,255, 0, 0, 0, 0,192,176,215,137, 63,241, 62, 25,190,219,254,179,134,179, 39,232,247, 78, 3,255,
- 0, 0, 0, 0,192,186,150, 28, 60, 28, 16,150,191, 7, 9,191,128,118, 1,131,245, 77, 3,255, 0, 0, 0, 0,192,181,132, 34,
- 63, 92, 60, 99, 63,149, 81,217,131,181, 18,238, 23,252, 3,255, 0, 0, 0, 0,190, 74,242,175, 64,183,173,164,191,145,105,227,
-250,117,125,160,232, 31, 3,255, 0, 0, 0, 0,192, 2,227,219, 64,173,164, 96,191, 78, 71,200,212,164,119, 52,238,226, 3,255,
- 0, 0, 0, 0,191, 92,140,181, 64,184, 38, 75, 63, 37,148,176,236,224,125,237, 12,159, 3,255, 0, 0, 0, 0, 64,159,104, 75,
- 63,236, 56,212,192, 29,126,240,108,211, 41,166,203, 9, 3,255, 0, 0, 0, 0, 64,132,159,215, 64, 97,184, 84,192, 10, 44, 30,
- 91,176, 76, 19,209, 56, 3,255, 0, 0, 0, 0, 64,164,122, 95, 64, 44,143,199,191, 68, 78, 53,112, 17, 59, 17,237,185, 3,255,
- 0, 0, 0, 0, 64, 54,176,255,192,141, 84,243,192, 36,176,237, 63,192,160, 9,200, 63, 3,255, 0, 0, 0, 0, 64,133,229, 93,
-192, 68, 21,217,192, 45,226,157, 90,249,187,187,197, 78, 3,255, 0, 0, 0, 0, 64,129, 56,203,192,130,211, 21,191,143,115,187,
- 87,252,166,194,229,252, 3,255, 0, 0, 0, 0,192,104,239,189,192,140,142, 82,191,168,178,178,177,134,158,245,227,155, 3,255,
- 0, 0, 0, 0,191,253,141, 50,192,167,155, 52,191,218,181,170,211,125,141,166,219,155, 3,255, 0, 0, 0, 0,192, 41, 58,164,
-192,167, 34,172, 61,151,232,206,197,232,141,243, 0, 26, 3,255, 0, 0, 0, 0,192,133,229, 93, 64, 68, 21,217, 64, 45,226,157,
-165, 7, 68, 69, 58,178, 3,255, 0, 0, 0, 0,192,129, 56,203, 64,130,211, 21, 63,143,115,187,168, 4, 89, 62, 26, 4, 3,255,
- 0, 0, 0, 0,192, 54,176,255, 64,141, 84,243, 64, 36,176,237,192, 64, 95,247, 55,193, 3,255, 0, 0, 0, 0, 63,253,141, 50,
- 64,167,155, 52, 63,218,181,170, 44,131,114, 90, 36,101, 3,255, 0, 0, 0, 0, 64, 41, 58,164, 64,167, 34,172,189,151,232,206,
- 58, 24,114, 13,255,230, 3,255, 0, 0, 0, 0, 64,104,239,189, 64,140,142, 82, 63,168,178,178, 78,122, 97, 11, 28,101, 3,255,
- 0, 0, 0, 0, 64,186,150, 28,188, 28, 16,150, 63, 7, 9,191,127,138,254,125, 10,179, 3,255, 0, 0, 0, 0, 64,181,132, 34,
-191, 92, 60, 99,191,149, 81,217,124, 75,237, 18,232, 4, 3,255, 0, 0, 0, 0, 64,176,215,137,191,241, 62, 25, 62,219,254,179,
-121, 77,216, 24, 8,178, 3,255, 0, 0, 0, 0, 64, 2,227,219,192,173,164, 96, 63, 78, 71,200, 43, 92,136,204, 17, 30, 3,255,
- 0, 0, 0, 0, 63, 92,140,181,192,184, 38, 75,191, 37,148,176, 19, 32,130, 19,243, 97, 3,255, 0, 0, 0, 0, 62, 74,242,175,
-192,183,173,164, 63,145,105,227, 5,139,130, 96, 23,225, 3,255, 0, 0, 0, 0,192,132,159,215,192, 97,184, 84, 64, 10, 44, 30,
-164, 80,179,237, 46,200, 3,255, 0, 0, 0, 0,192,164,122, 95,192, 44,143,199, 63, 68, 78, 53,143,239,196,239, 18, 71, 3,255,
- 0, 0, 0, 0,192,159,104, 75,191,236, 56,212, 64, 29,126,240,147, 45,214, 90, 52,247, 3,255, 0, 0, 0, 0,191,159, 56,212,
- 64, 68,166,172, 64,154,108,212,228, 80, 65,224,106, 48, 3,255, 0, 0, 0, 0,192, 36,182, 33, 63,220, 38, 34, 64,159, 5,150,
-201, 23, 38, 45,109, 33, 3,255, 0, 0, 0, 0,191, 81, 34, 16, 63,179, 64,129, 64,180, 5,162,237, 14, 31,163,122,145, 3,255,
- 0, 0, 0, 0, 64, 89,207, 42, 64, 47, 6,251, 64,121,165, 27, 73, 47, 59,238, 86, 58, 3,255, 0, 0, 0, 0, 63,223, 76,208,
- 64,101, 32,170, 64,137, 83, 65, 39, 57, 77, 61, 94, 58, 3,255, 0, 0, 0, 0, 64, 10,249,249, 63,244, 52, 62, 64,162,236, 25,
- 47,247, 43, 0,110,154, 3,255, 0, 0, 0, 0, 64,142,126,210,191,238, 49, 43, 64, 84, 30,112, 97, 69,216,161, 73, 73, 3,255,
- 0, 0, 0, 0, 64,152, 61, 98, 60,106, 63, 87, 64, 90, 97, 6,103,129,255, 5, 75, 73, 3,255, 0, 0, 0, 0, 64, 97,165,138,
-191, 80, 9, 92, 64,147, 74, 20, 78, 73,238, 23, 99,170, 3,255, 0, 0, 0, 0, 62,232,190,208,192,139,160, 93, 64,120, 33,191,
- 11, 73,161, 51, 85, 64, 3,255, 0, 0, 0, 0, 64, 19, 76, 36,192,129,151, 25, 64, 98,254,212, 49, 25,167,159, 78,125, 3,255,
- 0, 0, 0, 0, 63,175,232, 93,192, 64, 23,177, 64,154,186, 69, 30, 29,189, 21,104,222, 3,255, 0, 0, 0, 0,192, 68, 62,211,
-191,168, 56, 51, 64,153,245, 13,190, 15,226, 64,105,150, 3,255, 0, 0, 0, 0,192, 14,173,200,192, 63,183,155, 64,144, 75,192,
-207, 50,191,211, 99,104, 3,255, 0, 0, 0, 0,191,167,162, 95,191,209, 29,144, 64,174,245, 25,226, 6,219,181,119, 6, 3,255,
- 0, 0, 0, 0,191,211,156,158, 63,132,228,185,192,176,207,190,220,164, 21,231,134,244, 3,255, 0, 0, 0, 0,192, 41, 76, 0,
- 64, 5,199,190,192,153,157, 83,198,146, 45, 75,150,246, 3,255, 0, 0, 0, 0,192,125, 83,204, 64,105, 55,169,192, 20,162,244,
-169, 72, 79,246,206, 82, 3,255, 0, 0, 0, 0,192, 91,215,178, 64, 62,235,222,192,108,254,190,180,215, 65, 87,175,155, 3,255,
- 0, 0, 0, 0,191, 59, 63,242, 63,152,237,210,192,182, 21,251,239,125, 25, 26,131,149, 3,255, 0, 0, 0, 0, 61, 94,230, 86,
- 64, 35, 30,198,192,169, 15,233, 0,238, 55, 52,140,135, 3,255, 0, 0, 0, 0, 63,199, 4,220, 64,146,145, 7,192, 83,186,104,
- 34,109,100,137,184,168, 3,255, 0, 0, 0, 0, 63, 86,120, 9, 64,109, 91,149,192,142,242, 79, 18,133, 81, 64,158,218, 3,255,
- 0, 0, 0, 0,192, 95,243,103, 64,138, 91,221,191,236, 15,186,178,170, 93,219,216, 25, 3,255, 0, 0, 0, 0,192, 5,206, 46,
- 64,159, 41,121,192, 19, 91,154,209,230,108, 96,205,226, 3,255, 0, 0, 0, 0, 63,139,200,169, 64,163, 78,198,192, 42,146,201,
- 24,247,111, 59,197,206, 3,255, 0, 0, 0, 0,191, 4,128,187, 64,167,181,206,192, 37, 92, 74,245, 57,114, 96,199,145, 3,255,
- 0, 0, 0, 0,191,231, 16,151, 61,209,166,160,192,178, 95,167,217,136, 2,196,133,245, 3,255, 0, 0, 0, 0,192, 69,200,163,
-191, 38,143,178,192,158, 48,148,188,243,242, 11,147,223, 3,255, 0, 0, 0, 0,192,155,192, 43,191,250, 6,151,192, 39, 82,170,
-149, 79,212,247,199,231, 3,255, 0, 0, 0, 0,192,132,118,233,191,173,111,217,192,123,122, 67,165,100,226, 58,170,165, 3,255,
- 0, 0, 0, 0,192,146, 85,238, 64, 78,205,178,191,221, 54, 70,156,183, 71,134,218,120, 3,255, 0, 0, 0, 0,192,167,137, 76,
- 63,227, 31,111,191,251, 57,158,141,234, 39, 54,213, 59, 3,255, 0, 0, 0, 0,192,170,143, 39,191,183, 15,167,191,252, 85,251,
-139,217,223,169,213, 13, 3,255, 0, 0, 0, 0,192,175,214, 8, 62, 53,124,177,192, 2,241,206,136, 23, 3, 89,211, 92, 3,255,
- 0, 0, 0, 0,190,160,160, 77, 62,182, 20, 9,192,186,232,108,248, 8, 7,241,128,128, 3,255, 0, 0, 0, 0, 63,163,144, 33,
- 61,186,144,151,192,183, 47, 50, 27, 97, 2, 19,130,252, 3,255, 0, 0, 0, 0, 64,129,179,222,190,224,147,234,192,134,180, 38,
- 89, 83,246, 64,164,218, 3,255, 0, 0, 0, 0, 64, 49,138,114,190, 57, 97,246,192,165, 76, 57, 60,250,251,247,143,138, 3,255,
- 0, 0, 0, 0, 64, 27,158,249, 64,141,118,197,192, 62,196, 58, 52, 90, 97, 70,191, 90, 3,255, 0, 0, 0, 0, 64, 89,244, 98,
- 64, 79,120, 8,192, 96,128, 65, 74, 8, 71, 39,179,151, 3,255, 0, 0, 0, 0, 64,144,100, 13, 62,118,214,200,192,110,205, 64,
- 98,182, 4, 37,174,161, 3,255, 0, 0, 0, 0, 64,131,202, 42, 63,231,161, 60,192,112,245,142, 90, 10, 38,255,173,209, 3,255,
- 0, 0, 0, 0,191,122, 51,149,190,163,151, 52,192,184,157, 15,234,118,250, 36,129,248, 3,255, 0, 0, 0, 0,191, 42,113, 5,
-191,241,112, 31,192,176,119, 15,241, 93,215, 84,135,135, 3,255, 0, 0, 0, 0, 61,172, 55, 60,192,143, 64, 22,192,113,246,164,
- 2, 27,157,132,174, 71, 3,255, 0, 0, 0, 0,190,154,173,167,192, 83,224,111,192,154,169,198,249,136,183, 89,150,211, 3,255,
- 0, 0, 0, 0, 64,136,133,151,191,162,249, 9,192,115,219,106, 93,175,229, 47,173, 3, 3,255, 0, 0, 0, 0, 64, 89,124,110,
-192, 40, 6,135,192,127,195,223, 74,120,199, 31,168,208, 3,255, 0, 0, 0, 0, 63,117,248,244,192,148, 90,109,192, 93, 0,123,
- 20, 8,154, 66,180,249, 3,255, 0, 0, 0, 0, 64, 17, 0,162,192,113,196, 63,192,119,239, 52, 49, 10,173, 64,171,144, 3,255,
- 0, 0, 0, 0,191, 7,217,162,192,156,117, 21,192, 75,238,222,245,139,149, 20,186,108, 3,255, 0, 0, 0, 0,192, 6,144,171,
-192,144,158,112,192, 69,241,198,210,156,157, 55,188,115, 3,255, 0, 0, 0, 0,192,148,238,110,192, 50,109,115,192, 13,197,187,
-153,170,195,231,208, 17, 3,255, 0, 0, 0, 0,192, 96,252, 79,192,115, 40,140,192, 48,165,116,178,226,173, 98,195,236, 3,255,
- 0, 0, 0, 0,192,172,228,100,191,248,128,217,191,150, 93, 8,138, 91,213, 53,229, 86, 3,255, 0, 0, 0, 0,192,182,171, 82,
-191,168,250,216, 62,147, 15, 15,131,122,226,250, 5,203, 3,255, 0, 0, 0, 0,192,160, 73,215, 62, 49,165,124, 64, 66, 85,232,
-147, 33, 4, 84, 67, 42, 3,255, 0, 0, 0, 0,192,178, 89,171,191, 24,115,192, 63,221,116, 78,134,129,243, 64, 38, 50, 3,255,
- 0, 0, 0, 0,192,143,206, 51, 64,105,250,133,191, 97,251,119,158, 85, 80, 53,235,193, 3,255, 0, 0, 0, 0,192,160, 32, 62,
- 64, 65, 38,163, 63, 3,117,164,146,236, 66, 24, 10,193, 3,255, 0, 0, 0, 0,192,155,108,216, 63,141,255, 59, 64, 69,117,189,
-150, 61, 23,119, 68, 42, 3,255, 0, 0, 0, 0,192,164, 27, 85, 64, 9, 78,244, 63,239,193, 87,144, 33, 46,128, 41, 73, 3,255,
- 0, 0, 0, 0,192,117, 35,134, 64,138,152, 39,191,116, 86, 73,171,230, 94, 2,234, 73, 3,255, 0, 0, 0, 0,192, 67,220, 35,
- 64,159,218, 6, 62,155,103,242,188,240,108,215, 6, 55, 3,255, 0, 0, 0, 0,191, 99, 79,130, 64,164,182,215, 64, 42, 4, 10,
-237,118,112, 50, 58,190, 3,255, 0, 0, 0, 0,192, 3, 86,161, 64,168,205, 14, 63,197, 55, 60,211,148,115, 31, 33,255, 3,255,
- 0, 0, 0, 0, 63,215,101,229, 64,168,141, 84,191,248, 90, 16, 37, 11,114,148,212,159, 3,255, 0, 0, 0, 0, 63,155, 52, 99,
- 64,183, 17,198,190,235,199,232, 26,159,124,192,245,120, 3,255, 0, 0, 0, 0, 61, 10,179,105, 64,169,185, 25, 64, 31,119,120,
- 0, 77,115,101, 55, 96, 3,255, 0, 0, 0, 0, 63, 37,198,143, 64,183,120,123, 63,135,108,160, 13,240,125, 8, 23,144, 3,255,
- 0, 0, 0, 0, 64, 32,174,180, 64,155, 13, 65,192, 8,167,238, 53,247,105,245,208,163, 3,255, 0, 0, 0, 0, 64,104,199, 69,
- 64,143,135,177,191,132, 12, 41, 79, 10, 98, 10,233, 31, 3,255, 0, 0, 0, 0, 64,159,134,121, 64, 49,245, 49, 63,169,166,210,
-109, 27, 59,242, 29,190, 3,255, 0, 0, 0, 0, 64,143,133, 52, 64,113,200,119, 62, 29,206,186, 98, 20, 82, 39, 3,190, 3,255,
- 0, 0, 0, 0, 64,160, 73,215,190, 49,165,124,192, 66, 85,232,108,223,251,172,188,214, 3,255, 0, 0, 0, 0, 64,178, 89,171,
- 63, 24,115,192,191,221,116, 78,121,127, 12,192,217,206, 3,255, 0, 0, 0, 0, 64,172,228,100, 63,248,128,217, 63,150, 93, 8,
-117,165, 42,203, 26,170, 3,255, 0, 0, 0, 0, 64,182,171, 82, 63,168,250,216,190,147, 15, 15,124,134, 29, 6,250, 53, 3,255,
- 0, 0, 0, 0, 64,155,108,216,191,141,255, 59,192, 69,117,189,105,195,232,137,187,214, 3,255, 0, 0, 0, 0, 64,164, 27, 85,
-192, 9, 78,244,191,239,193, 87,111,223,209,128,214,183, 3,255, 0, 0, 0, 0, 64,143,206, 51,192,105,250,133, 63, 97,251,119,
- 97,171,175,203, 20, 63, 3,255, 0, 0, 0, 0, 64,160, 32, 62,192, 65, 38,163,191, 3,117,164,109, 20,189,232,245, 63, 3,255,
- 0, 0, 0, 0, 63, 99, 79,130,192,164,182,215,192, 42, 4, 10, 18,138,143,206,197, 66, 3,255, 0, 0, 0, 0, 64, 3, 86,161,
-192,168,205, 14,191,197, 55, 60, 44,108,140,225,222, 1, 3,255, 0, 0, 0, 0, 64,117, 35,134,192,138,152, 39, 63,116, 86, 73,
- 84, 26,161,254, 21,183, 3,255, 0, 0, 0, 0, 64, 67,220, 35,192,159,218, 6,190,155,103,242, 67, 16,147, 41,249,201, 3,255,
- 0, 0, 0, 0,189, 10,179,105,192,169,185, 25,192, 31,119,120,255,179,140,155,200,160, 3,255, 0, 0, 0, 0,191, 37,198,143,
-192,183,120,123,191,135,108,160,242, 16,130,248,232,112, 3,255, 0, 0, 0, 0,191,215,101,229,192,168,141, 84, 63,248, 90, 16,
-218,245,141,108, 43, 97, 3,255, 0, 0, 0, 0,191,155, 52, 99,192,183, 17,198, 62,235,199,232,229, 97,131, 64, 10,136, 3,255,
- 0, 0, 0, 0,192,159,134,121,192, 49,245, 49,191,169,166,210,146,229,196, 14,226, 66, 3,255, 0, 0, 0, 0,192,143,133, 52,
-192,113,200,119,190, 29,206,186,157,236,173,217,252, 66, 3,255, 0, 0, 0, 0,192, 32,174,180,192,155, 13, 65, 64, 8,167,238,
-202, 9,150, 11, 47, 93, 3,255, 0, 0, 0, 0,192,104,199, 69,192,143,135,177, 63,132, 12, 41,176,246,157,246, 22,225, 3,255,
- 0, 0, 0, 0,191,117,248,244, 64,148, 90,109, 64, 93, 0,123,235,248,101,190, 75, 7, 3,255, 0, 0, 0, 0,192, 17, 0,162,
- 64,113,196, 63, 64,119,239, 52,206,246, 82,192, 84,112, 3,255, 0, 0, 0, 0,192,136,133,151, 63,162,249, 9, 64,115,219,106,
-162, 81, 26,209, 82,253, 3,255, 0, 0, 0, 0,192, 89,124,110, 64, 40, 6,135, 64,127,195,223,181,136, 56,225, 87, 48, 3,255,
- 0, 0, 0, 0, 63, 7,217,162, 64,156,117, 21, 64, 75,238,222, 10,117,106,236, 69,148, 3,255, 0, 0, 0, 0, 64, 6,144,171,
- 64,144,158,112, 64, 69,241,198, 45,100, 98,201, 67,141, 3,255, 0, 0, 0, 0, 64,148,238,110, 64, 50,109,115, 64, 13,197,187,
-102, 86, 60, 25, 47,239, 3,255, 0, 0, 0, 0, 64, 96,252, 79, 64,115, 40,140, 64, 48,165,116, 77, 30, 82,158, 60, 20, 3,255,
- 0, 0, 0, 0, 64,170,143, 39, 63,183, 15,167, 63,252, 85,251,116, 39, 32, 87, 42,243, 3,255, 0, 0, 0, 0, 64,175,214, 8,
-190, 53,124,177, 64, 2,241,206,119,233,252,167, 44,164, 3,255, 0, 0, 0, 0, 64,146, 85,238,192, 78,205,178, 63,221, 54, 70,
- 99, 73,184,122, 37,136, 3,255, 0, 0, 0, 0, 64,167,137, 76,191,227, 31,111, 63,251, 57,158,114, 22,216,202, 42,197, 3,255,
- 0, 0, 0, 0, 64, 95,243,103,192,138, 91,221, 63,236, 15,186, 77, 86,162, 37, 39,231, 3,255, 0, 0, 0, 0, 64, 5,206, 46,
-192,159, 41,121, 64, 19, 91,154, 46, 26,147,160, 50, 30, 3,255, 0, 0, 0, 0,191,139,200,169,192,163, 78,198, 64, 42,146,201,
-231, 9,144,197, 58, 50, 3,255, 0, 0, 0, 0, 63, 4,128,187,192,167,181,206, 64, 37, 92, 74, 10,199,141,160, 56,111, 3,255,
- 0, 0, 0, 0,192, 27,158,249,192,141,118,197, 64, 62,196, 58,203,166,158,186, 64,166, 3,255, 0, 0, 0, 0,192, 89,244, 98,
-192, 79,120, 8, 64, 96,128, 65,181,248,184,217, 76,105, 3,255, 0, 0, 0, 0,192,144,100, 13,190,118,214,200, 64,110,205, 64,
-157, 74,251,219, 81, 95, 3,255, 0, 0, 0, 0,192,131,202, 42,191,231,161, 60, 64,112,245,142,165,246,217, 1, 82, 47, 3,255,
- 0, 0, 0, 0,192,129,179,222, 62,224,147,234, 64,134,180, 38,166,173, 9,192, 91, 38, 3,255, 0, 0, 0, 0,192, 49,138,114,
- 62, 57, 97,246, 64,165, 76, 57,195, 6, 4, 9,112,118, 3,255, 0, 0, 0, 0, 62,160,160, 77,190,182, 20, 9, 64,186,232,108,
- 7,248,248, 15,127,128, 3,255, 0, 0, 0, 0,191,163,144, 33,189,186,144,151, 64,183, 47, 50,228,159,253,237,125, 4, 3,255,
- 0, 0, 0, 0,189,172, 55, 60, 64,143, 64, 22, 64,113,246,164,253,229, 98,124, 81,185, 3,255, 0, 0, 0, 0, 62,154,173,167,
- 64, 83,224,111, 64,154,169,198, 6,120, 72,167,105, 45, 3,255, 0, 0, 0, 0, 63,122, 51,149, 62,163,151, 52, 64,184,157, 15,
- 21,138, 5,220,126, 8, 3,255, 0, 0, 0, 0, 63, 42,113, 5, 63,241,112, 31, 64,176,119, 15, 14,163, 40,172,120,121, 3,255,
- 0, 0, 0, 0, 64,155,192, 43, 63,250, 6,151, 64, 39, 82,170,106,177, 43, 9, 56, 25, 3,255, 0, 0, 0, 0, 64,132,118,233,
- 63,173,111,217, 64,123,122, 67, 90,156, 29,198, 85, 91, 3,255, 0, 0, 0, 0, 63,231, 16,151,189,209,166,160, 64,178, 95,167,
- 38,120,253, 60,122, 11, 3,255, 0, 0, 0, 0, 64, 69,200,163, 63, 38,143,178, 64,158, 48,148, 67, 13, 13,245,108, 33, 3,255,
- 0, 0, 0, 0, 64,125, 83,204,192,105, 55,169, 64, 20,162,244, 86,184,176, 10, 49,174, 3,255, 0, 0, 0, 0, 64, 91,215,178,
-192, 62,235,222, 64,108,254,190, 75, 41,190,169, 80,101, 3,255, 0, 0, 0, 0, 63,211,156,158,191,132,228,185, 64,176,207,190,
- 35, 92,234, 25,121, 12, 3,255, 0, 0, 0, 0, 64, 41, 76, 0,192, 5,199,190, 64,153,157, 83, 57,110,210,181,105, 10, 3,255,
- 0, 0, 0, 0,191,199, 4,220,192,146,145, 7, 64, 83,186,104,221,147,155,119, 71, 88, 3,255, 0, 0, 0, 0,191, 86,120, 9,
-192,109, 91,149, 64,142,242, 79,237,123,174,192, 97, 38, 3,255, 0, 0, 0, 0, 63, 59, 63,242,191,152,237,210, 64,182, 21,251,
- 16,131,230,230,124,107, 3,255, 0, 0, 0, 0,189, 94,230, 86,192, 35, 30,198, 64,169, 15,233,255, 18,200,204,115,121, 3,255,
- 0, 0, 0, 0,192, 46, 27,208, 64, 86,104,124,192,126, 52, 85,197,137, 72,226,168,134, 3,255, 0, 0, 0, 0,191,234,168, 82,
- 64,149, 62, 87,192, 67, 12,118,217, 5,101,188,188,210, 3,255, 0, 0, 0, 0,192, 16, 10,186, 64, 52,106,249,192,147,253,210,
-206,182, 62,131,155,198, 3,255, 0, 0, 0, 0,190,240, 33, 93, 64, 71,199,191,192,158, 47,142,245,214, 69, 40,148,199, 3,255,
- 0, 0, 0, 0,187, 71, 46, 19, 64,115,240,194,192,142,166,175,254,240, 82,161,158, 66, 3,255, 0, 0, 0, 0,191,101,194,188,
- 64,154, 84, 17,192, 77,193,240,235, 76,104,214,185,142, 3,255, 0, 0, 0, 0,192,115,246,246, 64, 15, 86,183,192,118,168, 51,
-172,249, 47,229,171, 45, 3,255, 0, 0, 0, 0,192,160, 1,101, 63,184,146, 47,192, 45, 38,153,146,225, 30, 96,196,102, 3,255,
- 0, 0, 0, 0,192, 85,229,215, 63,218,178,166,192,144, 55,183,182, 38, 37,133,158,110, 3,255, 0, 0, 0, 0,192,104,178,151,
-189,205,107,245,192,147, 60,175,175,178,253,205,156, 91, 3,255, 0, 0, 0, 0,192,136, 81,192,191, 4,239, 55,192,127,222, 24,
-163,130,245,158,168, 35, 3,255, 0, 0, 0, 0,192,164,241, 70, 62,251,218,102,192, 48, 82,143,143,222, 11,210,195,110, 3,255,
- 0, 0, 0, 0, 63,173,230,209, 64, 71,135,231,192,152,234, 27, 29,148, 67, 4,151, 11, 3,255, 0, 0, 0, 0, 64, 67,103,158,
- 64, 51,206, 82,192,132,168, 39, 66,203, 60, 63,164,242, 3,255, 0, 0, 0, 0, 63,100,131,136, 64, 27, 95, 16,192,168,115, 4,
- 20,122, 53,138,141,143, 3,255, 0, 0, 0, 0, 63,217,154, 77, 63, 78, 69,185,192,177,196,221, 38, 53, 17,236,135, 42, 3,255,
- 0, 0, 0, 0, 64, 37,195,107, 63, 36,213, 4,192,167, 33, 20, 55,151, 14,194,141,168, 3,255, 0, 0, 0, 0, 64, 94,139,103,
- 63,250,146,153,192,137,141, 72, 75, 19, 43,156,161,245, 3,255, 0, 0, 0, 0, 64, 21,195,231,191,101, 58,236,192,169,178,218,
- 49,247,236, 31,139,218, 3,255, 0, 0, 0, 0, 64, 48, 32,142,192, 32,140,155,192,145, 1,195, 59, 3,200,178,156,204, 3,255,
- 0, 0, 0, 0, 63,185,155, 70,191, 59,202, 12,192,180, 86,163, 32,149,239, 73,133, 91, 3,255, 0, 0, 0, 0, 62, 43, 97, 29,
-192, 2,118,144,192,175,231,125, 4,106,210,160,136,103, 3,255, 0, 0, 0, 0, 62,196,116, 97,192, 56,176, 10,192,162,239,120,
- 8,164,194, 20,144, 81, 3,255, 0, 0, 0, 0, 64, 5, 2,185,192, 76,105,217,192,142,173,135, 45,218,187, 79,158, 56, 3,255,
- 0, 0, 0, 0,191,144,243,163,192, 73, 41,252,192,154, 66,148,230,134,188, 73,150,107, 3,255, 0, 0, 0, 0,192, 20,133,147,
-192,124, 55,234,192,107, 3,176,204,110,170,196,175,164, 3,255, 0, 0, 0, 0,192, 60,186, 42,191,189,128,219,192,155, 43, 23,
-191, 41,222,189,150,199, 3,255, 0, 0, 0, 0,191,172,164, 52,192, 18,240,106,192,167, 58,141,226, 76,204,213,142,128, 3,255,
- 0, 0, 0, 0,192,100,171, 12,191,243, 33,249,192,135,221,106,178,248,214,143,162,143, 3,255, 0, 0, 0, 0,192, 74, 78,195,
-192, 96,206,241,192, 94, 88, 98,188, 4,179, 34,179,129, 3,255, 0, 0, 0, 0,192,177,110, 41, 63,186, 30, 81,191,158,249,105,
-134,160, 30,165,229, 86, 3,255, 0, 0, 0, 0,192,172,138, 45, 64, 17,149,114, 62,200,203,127,137,251, 48,171, 9, 56, 3,255,
- 0, 0, 0, 0,192,182, 94, 10, 63, 1, 5, 48,191,165, 81, 86,131,156, 12, 24,228, 94, 3,255, 0, 0, 0, 0,192,186,224,117,
-190,247,234, 37, 62,126, 56,147,128,132,246,101, 6, 46, 3,255, 0, 0, 0, 0,192,184, 78,204,189, 89,193, 19, 63,141,163,187,
-130, 22,254,208, 22,241, 3,255, 0, 0, 0, 0,192,174,232,105, 63,224,187,151, 63,153,183,156,136,137, 38,137, 25, 3, 3,255,
- 0, 0, 0, 0,191, 68,118, 42, 64,176,173,101,191,233,132,114,238, 57,120,142,216,217, 3,255, 0, 0, 0, 0, 62,191,172, 81,
- 64,186,208, 67,190,216,163,195, 7, 75,127,131,247,159, 3,255, 0, 0, 0, 0,191,218, 2,113, 64,171,151,172,191,212, 25,114,
-219,243,117,116,220, 30, 3,255, 0, 0, 0, 0,192, 21,244,251, 64,172, 12, 28, 61,128,151, 13,205,229,117,196, 1,226, 3,255,
- 0, 0, 0, 0,191,223, 39, 51, 64,177, 94,248, 63, 76,122,104,217,155,121, 3, 16, 65, 3,255, 0, 0, 0, 0, 61, 28,208, 72,
- 64,187, 13, 91, 62,245,215, 64, 0,187,127,168, 9, 66, 3,255, 0, 0, 0, 0, 64,142, 93, 45, 64, 14,137, 70,192, 70,202,147,
- 96,241, 49,173,188,202, 3,255, 0, 0, 0, 0, 64,173, 23,106, 63,182,131,157,191,225,176,175,118, 7, 32, 20,218, 72, 3,255,
- 0, 0, 0, 0, 64,128,203, 78, 64, 69, 14,124,192, 61, 0, 55, 88,168, 66, 80,191,199, 3,255, 0, 0, 0, 0, 64,133,175,133,
- 64,121,149, 28,191,168,212, 51, 92, 4, 84, 86,227,170, 3,255, 0, 0, 0, 0, 64,149,211, 8, 64, 94,166, 84,191, 29, 24, 68,
-101,221, 76, 30,241,113, 3,255, 0, 0, 0, 0, 64,175,169, 31, 63,237,176,138,191,103,168, 15,119,152, 40,128,235, 11, 3,255,
- 0, 0, 0, 0, 64, 57, 78,122,192,120, 12,224,192, 84, 56, 7, 64, 62,171,247,183,239, 3,255, 0, 0, 0, 0, 64, 48, 74, 0,
-192,155,165,245,191,227, 87,208, 61, 38,150, 68,217,192, 3,255, 0, 0, 0, 0, 64,100,108, 85,192, 76, 47,115,192, 88,224,149,
- 77,102,185, 90,182,131, 3,255, 0, 0, 0, 0, 64,150,191,173,192, 55,233,227,191,254,101,198,102,121,192, 79,213, 73, 3,255,
- 0, 0, 0, 0, 64,148, 97,119,192, 89, 33,200,191,150,225, 24,101, 7,182, 44,229, 20, 3,255, 0, 0, 0, 0, 64, 86,171, 75,
-192,150, 83, 36,191,133, 36, 22, 72,220,153,131,232, 32, 3,255, 0, 0, 0, 0,192, 81,251,116,192,139, 80,115,192, 10,124, 57,
-185, 81,160, 53,208,254, 3,255, 0, 0, 0, 0,192,122,239, 70,192,138,220, 53,190,227, 86,113,171, 68,160,132,246,195, 3,255,
- 0, 0, 0, 0,192, 28, 50, 14,192,153, 4,245,192, 23, 39,141,201,187,151,215,205, 33, 3,255, 0, 0, 0, 0,191,189,123, 34,
-192,178,168,203,191,130,106,149,222,209,134, 63,234,158, 3,255, 0, 0, 0, 0,191,232,127,176,192,178,107,177,189,236,189, 47,
-216, 65,134,100,252, 66, 3,255, 0, 0, 0, 0,192, 90,168, 53,192,152, 83,169, 62,133,201,227,181, 29,152, 77, 4,136, 3,255,
- 0, 0, 0, 0,192,150,191,173, 64, 55,233,227, 63,254,101,198,153,135, 63,177, 42,183, 3,255, 0, 0, 0, 0,192,100,108, 85,
- 64, 76, 47,115, 64, 88,224,149,178,154, 70,166, 73,125, 3,255, 0, 0, 0, 0,192,148, 97,119, 64, 89, 33,200, 63,150,225, 24,
-154,249, 73,212, 26,236, 3,255, 0, 0, 0, 0,192, 86,171, 75, 64,150, 83, 36, 63,133, 36, 22,183, 36,102,125, 23,224, 3,255,
- 0, 0, 0, 0,192, 48, 74, 0, 64,155,165,245, 63,227, 87,208,194,218,105,188, 38, 64, 3,255, 0, 0, 0, 0,192, 57, 78,122,
- 64,120, 12,224, 64, 84, 56, 7,191,194, 84, 9, 72, 17, 3,255, 0, 0, 0, 0, 63,189,123, 34, 64,178,168,203, 63,130,106,149,
- 33, 47,121,193, 21, 98, 3,255, 0, 0, 0, 0, 64, 28, 50, 14, 64,153, 4,245, 64, 23, 39,141, 54, 69,104, 41, 50,223, 3,255,
- 0, 0, 0, 0, 63,232,127,176, 64,178,107,177, 61,236,189, 47, 39,191,121,156, 3,190, 3,255, 0, 0, 0, 0, 64, 90,168, 53,
- 64,152, 83,169,190,133,201,227, 74,227,103,179,251,120, 3,255, 0, 0, 0, 0, 64,122,239, 70, 64,138,220, 53, 62,227, 86,113,
- 84,188, 95,124, 9, 61, 3,255, 0, 0, 0, 0, 64, 81,251,116, 64,139, 80,115, 64, 10,124, 57, 70,175, 95,203, 47, 2, 3,255,
- 0, 0, 0, 0, 64,186,224,117, 62,247,234, 37,190,126, 56,147,127,124, 9,155,249,210, 3,255, 0, 0, 0, 0, 64,182, 94, 10,
-191, 1, 5, 48, 63,165, 81, 86,124,100,243,232, 27,162, 3,255, 0, 0, 0, 0, 64,184, 78,204, 61, 89,193, 19,191,141,163,187,
-125,234, 1, 48,233, 15, 3,255, 0, 0, 0, 0, 64,174,232,105,191,224,187,151,191,153,183,156,119,119,217,119,230,253, 3,255,
- 0, 0, 0, 0, 64,172,138, 45,192, 17,149,114,190,200,203,127,118, 5,207, 85,246,200, 3,255, 0, 0, 0, 0, 64,177,110, 41,
-191,186, 30, 81, 63,158,249,105,121, 96,225, 91, 26,170, 3,255, 0, 0, 0, 0, 64, 21,244,251,192,172, 12, 28,189,128,151, 13,
- 50, 27,138, 60,254, 30, 3,255, 0, 0, 0, 0, 63,218, 2,113,192,171,151,172, 63,212, 25,114, 36, 13,138,140, 35,226, 3,255,
- 0, 0, 0, 0, 63,223, 39, 51,192,177, 94,248,191, 76,122,104, 38,101,134,253,239,191, 3,255, 0, 0, 0, 0,189, 28,208, 72,
-192,187, 13, 91,190,245,215, 64,255, 69,128, 88,246,190, 3,255, 0, 0, 0, 0,190,191,172, 81,192,186,208, 67, 62,216,163,195,
-248,181,128,125, 8, 97, 3,255, 0, 0, 0, 0, 63, 68,118, 42,192,176,173,101, 63,233,132,114, 17,199,135,114, 39, 39, 3,255,
- 0, 0, 0, 0,192,133,175,133,192,121,149, 28, 63,168,212, 51,163,252,171,170, 28, 86, 3,255, 0, 0, 0, 0,192,128,203, 78,
-192, 69, 14,124, 64, 61, 0, 55,167, 88,189,176, 64, 57, 3,255, 0, 0, 0, 0,192,175,169, 31,191,237,176,138, 63,103,168, 15,
-136,104,215,128, 20,245, 3,255, 0, 0, 0, 0,192,149,211, 8,192, 94,166, 84, 63, 29, 24, 68,154, 35,179,226, 14,143, 3,255,
- 0, 0, 0, 0,192,173, 23,106,191,182,131,157, 63,225,176,175,137,249,223,236, 37,184, 3,255, 0, 0, 0, 0,192,142, 93, 45,
-192, 14,137, 70, 64, 70,202,147,159, 15,206, 83, 67, 54, 3,255, 0, 0, 0, 0,192, 5, 2,185, 64, 76,105,217, 64,142,173,135,
-210, 38, 68,177, 97,200, 3,255, 0, 0, 0, 0,190,196,116, 97, 64, 56,176, 10, 64,162,239,120,247, 92, 61,236,111,175, 3,255,
- 0, 0, 0, 0,192, 48, 32,142, 64, 32,140,155, 64,145, 1,195,196,253, 55, 78, 99, 52, 3,255, 0, 0, 0, 0,192, 21,195,231,
- 63,101, 58,236, 64,169,178,218,206, 9, 19,225,116, 38, 3,255, 0, 0, 0, 0,191,185,155, 70, 63, 59,202, 12, 64,180, 86,163,
-223,107, 16,183,122,165, 3,255, 0, 0, 0, 0,190, 43, 97, 29, 64, 2,118,144, 64,175,231,125,251,150, 45, 96,119,153, 3,255,
- 0, 0, 0, 0, 64, 74, 78,195, 64, 96,206,241, 64, 94, 88, 98, 67,252, 76,222, 76,127, 3,255, 0, 0, 0, 0, 64,100,171, 12,
- 63,243, 33,249, 64,135,221,106, 77, 8, 41,113, 93,113, 3,255, 0, 0, 0, 0, 64, 20,133,147, 64,124, 55,234, 64,107, 3,176,
- 51,146, 85, 60, 80, 92, 3,255, 0, 0, 0, 0, 63,144,243,164, 64, 73, 41,252, 64,154, 66,148, 25,122, 67,183,105,149, 3,255,
- 0, 0, 0, 0, 63,172,164, 52, 64, 18,240,106, 64,167, 58,141, 29,180, 51, 43,113,128, 3,255, 0, 0, 0, 0, 64, 60,186, 42,
- 63,189,128,219, 64,155, 43, 23, 64,215, 33, 67,105, 57, 3,255, 0, 0, 0, 0, 64,160, 1,101,191,184,146, 47, 64, 45, 38,153,
-109, 31,225,160, 59,154, 3,255, 0, 0, 0, 0, 64,115,246,246,192, 15, 86,183, 64,118,168, 51, 83, 7,208, 27, 84,211, 3,255,
- 0, 0, 0, 0, 64,164,241, 70,190,251,218,102, 64, 48, 82,143,112, 34,244, 46, 60,146, 3,255, 0, 0, 0, 0, 64,136, 81,192,
- 63, 4,239, 55, 64,127,222, 24, 92,126, 10, 98, 87,221, 3,255, 0, 0, 0, 0, 64,104,178,151, 61,205,107,245, 64,147, 60,175,
- 80, 78, 2, 51, 99,165, 3,255, 0, 0, 0, 0, 64, 85,229,215,191,218,178,166, 64,144, 55,183, 73,218,218,123, 97,146, 3,255,
- 0, 0, 0, 0, 63,101,194,188,192,154, 84, 17, 64, 77,193,240, 20,180,151, 42, 70,114, 3,255, 0, 0, 0, 0, 59, 71, 46, 19,
-192,115,240,194, 64,142,166,175, 1, 16,173, 95, 97,190, 3,255, 0, 0, 0, 0, 63,234,168, 82,192,149, 62, 87, 64, 67, 12,118,
- 38,251,154, 68, 67, 46, 3,255, 0, 0, 0, 0, 64, 46, 27,208,192, 86,104,124, 64,126, 52, 85, 58,119,183, 30, 87,122, 3,255,
- 0, 0, 0, 0, 64, 16, 10,186,192, 52,106,249, 64,147,253,210, 49, 74,193,125,100, 58, 3,255, 0, 0, 0, 0, 62,240, 33, 93,
-192, 71,199,191, 64,158, 47,142, 10, 42,186,216,107, 57, 3,255, 0, 0, 0, 0,192, 94,139,103,191,250,146,153, 64,137,141, 72,
-180,237,212,100, 94, 11, 3,255, 0, 0, 0, 0,192, 37,195,107,191, 36,213, 4, 64,167, 33, 20,200,105,241, 62,114, 88, 3,255,
- 0, 0, 0, 0,192, 67,103,158,192, 51,206, 82, 64,132,168, 39,189, 53,195,193, 91, 14, 3,255, 0, 0, 0, 0,191,173,230,209,
-192, 71,135,231, 64,152,234, 27,226,108,188,252,104,245, 3,255, 0, 0, 0, 0,191,217,154, 77,191, 78, 69,185, 64,177,196,221,
-217,203,238, 20,120,214, 3,255, 0, 0, 0, 0,191,100,131,136,192, 27, 95, 16, 64,168,115, 4,235,134,202,118,114,113, 3,255,
- 0, 0, 0, 0,192, 37,220,139, 64,141,135,245,192, 54,173,114,199, 45, 96, 95,193,211, 3,255, 0, 0, 0, 0,192, 84,119,204,
- 64,130, 73, 93,192, 38,107,212,183, 58, 88,223,199,137, 3,255, 0, 0, 0, 0,192, 67, 76,208, 64,111,120, 62,192, 85, 89, 14,
-189, 80, 81,196,183,140, 3,255, 0, 0, 0, 0,191,238,147, 68, 64,100,230,166,192,136, 9,234,215,216, 78,130,163, 59, 3,255,
- 0, 0, 0, 0,191,109,149, 30, 64,111, 18, 40,192,141,100,171,235, 37, 81,201,159,199, 3,255, 0, 0, 0, 0,191,178,237,144,
- 64,136,136, 25,192,113, 1,121,225,117, 92,189,173, 62, 3,255, 0, 0, 0, 0, 63, 66, 82,214, 64,152,115,128,192, 85, 25,164,
- 16,241,104, 27,183,126, 3,255, 0, 0, 0, 0,189,171,155,119, 64,155, 40,138,192, 83, 96,113,254,128,105,196,183,238, 3,255,
- 0, 0, 0, 0, 62,194,138, 67, 64,138, 97,177,192,124,158, 75, 8,112, 94,134,170, 29, 3,255, 0, 0, 0, 0,191, 94,106,158,
- 64, 30,106,167,192,167,240,254,236,229, 53,187,141,105, 3,255, 0, 0, 0, 0,191,229,114, 22, 64, 20, 96,193,192,162,167,253,
-217, 22, 50, 93,144,244, 3,255, 0, 0, 0, 0,191,162,210, 45, 63,224,211,233,192,174, 67,184,228, 69, 37,245,136,244, 3,255,
- 0, 0, 0, 0,192,152, 61, 37, 64, 14, 9,230,192, 39,179,137,152, 85, 48,183,198,226, 3,255, 0, 0, 0, 0,192,140,187,232,
- 64, 62, 96, 6,192, 30,247,107,160, 7, 65, 68,202, 11, 3,255, 0, 0, 0, 0,192,132,134,116, 64, 40,130, 40,192, 77,207,237,
-165,139, 57,149,186, 30, 3,255, 0, 0, 0, 0,192,129,129, 12, 63,173,129,231,192,128,125,159,167, 62, 29, 15,168,123, 3,255,
- 0, 0, 0, 0,192,134,112,254, 62,207,146,126,192,130, 19,159,164, 15, 9,119,167,117, 3,255, 0, 0, 0, 0,192,149,121,189,
- 63,111,192,142,192, 90, 95, 76,154, 95, 20,107,180,236, 3,255, 0, 0, 0, 0,192,162, 65, 12,191,149, 84, 11,192, 44,202,172,
-145, 60,230, 47,197, 75, 3,255, 0, 0, 0, 0,192,165,120, 74,190,167, 78, 95,192, 48, 51,139,143, 54,248,140,195,244, 3,255,
- 0, 0, 0, 0,192,150,161, 61,191, 89,221,107,192, 89,113,118,153, 40,237, 79,182, 35, 3,255, 0, 0, 0, 0,192, 66, 56, 52,
- 62,139, 40,206,192,160,116, 21,190, 13, 6, 19,146,121, 3,255, 0, 0, 0, 0,192, 56,120,245, 63,154,213,118,192,158,227, 81,
-193, 81, 26, 47,147,133, 3,255, 0, 0, 0, 0,192, 22,104,220, 63, 40,221,204,192,170,137,115,205, 16, 14, 89,139,117, 3,255,
- 0, 0, 0, 0, 64, 39,143,145, 64, 94, 49,190,192,124, 27,165, 56,238, 75,252,170, 43, 3,255, 0, 0, 0, 0, 64, 6,168,130,
- 64,130,132,190,192,105, 96, 12, 45,226, 89, 91,176,173, 3,255, 0, 0, 0, 0, 63,222,169, 76, 64,104,107,205,192,136,142,150,
- 38, 23, 79,105,163, 33, 3,255, 0, 0, 0, 0, 63,229,207,137, 64, 22, 63, 30,192,161,235,207, 39,198, 50,227,145,127, 3,255,
- 0, 0, 0, 0, 64, 14, 11,239, 63,191,114,175,192,166,208,254, 48,133, 33, 81,142, 87, 3,255, 0, 0, 0, 0, 64, 43,222,239,
- 64, 11,226,212,192,151, 71,227, 58, 33, 47,140,152, 91, 3,255, 0, 0, 0, 0, 64,124,245, 0, 62,187, 32, 27,192,138, 6, 57,
- 86,138, 7,176,162, 2, 3,255, 0, 0, 0, 0, 64,112, 75, 42, 63,152, 42,228,192,139, 44, 25, 82, 0, 25,159,161, 31, 3,255,
- 0, 0, 0, 0, 64, 82,218,178, 63, 1,247,178,192,154,129,211, 72, 35, 11, 4,150,217, 3,255, 0, 0, 0, 0, 63,104,203,208,
- 63,113, 6,146,192,183, 5,108, 19,132, 20,150,131, 49, 3,255, 0, 0, 0, 0, 62,251, 68, 26, 63,228, 38,111,192,178, 48,114,
- 10,139, 38,158,134,109, 3,255, 0, 0, 0, 0, 61,149, 78,163, 63,137, 25, 65,192,184,102,234, 1, 54, 23, 52,130, 34, 3,255,
- 0, 0, 0, 0, 64, 80,140, 98,191,238,205,169,192,144, 69, 83, 71, 70,215,145,157,173, 3,255, 0, 0, 0, 0, 64,109, 39,177,
-191,147,213,155,192,140,143,238, 81, 57,230,247,160, 77, 3,255, 0, 0, 0, 0, 64, 66,225,100,191,131,191,146,192,157, 18,152,
- 66,178,233,128,149, 25, 3,255, 0, 0, 0, 0, 63,220, 24,190,191,202,163,163,192,171,244,160, 37, 99,220,199,138,196, 3,255,
- 0, 0, 0, 0, 63,133,219,227,192, 17, 47,172,192,169,160, 93, 23,126,206,164,140, 68, 3,255, 0, 0, 0, 0, 63,247,202, 46,
-192, 27,140, 23,192,158,252,116, 41,217,203, 77,147, 32, 3,255, 0, 0, 0, 0, 63, 68,220, 36,192,132,143, 24,192,130,105, 20,
- 16,163,165, 66,167, 72, 3,255, 0, 0, 0, 0, 63,185,255, 60,192,108,244,215,192,138, 7,129, 31,113,175, 11,161,251, 3,255,
- 0, 0, 0, 0, 63, 19, 18,220,192, 98,186,168,192,148,136, 66, 12,155,178,121,154,241, 3,255, 0, 0, 0, 0,187,172,119,131,
-191,162,209,182,192,183, 73,170,255,209,228,144,130,251, 3,255, 0, 0, 0, 0, 63, 40,230,165,191, 24,111,246,192,185,150, 50,
- 14, 19,243, 18,129,113, 3,255, 0, 0, 0, 0,190, 50, 45,123,190,230, 16,213,192,186,240,160,251,231,246,124,128,109, 3,255,
- 0, 0, 0, 0,191,199, 22,221,192,134,211, 71,192,113,161, 37,222, 98,163,255,173,157, 3,255, 0, 0, 0, 0,191, 58,131,171,
-192,140,178, 57,192,115,174,214,240,105,159,201,173, 11, 3,255, 0, 0, 0, 0,191,112,119,228,192,115, 46, 49,192,139,222,186,
-235,152,172,221,160,217, 3,255, 0, 0, 0, 0,191,254, 75,122,192, 50, 36, 18,192,152, 70, 84,211,253,195, 46,152, 87, 3,255,
- 0, 0, 0, 0,192, 52,239,190,192, 22,186,193,192,145,240,166,194,167,204, 3,156,108, 3,255, 0, 0, 0, 0,192, 39, 23, 51,
-192, 76,245, 14,192,132,248,105,199, 29,186,137,164,200, 3,255, 0, 0, 0, 0,192,140,137,202,192, 33,234, 4,192, 60,117,152,
-159,215,200,216,192, 6, 3,255, 0, 0, 0, 0,192,115,176, 68,192, 68, 49, 85,192, 79,173, 65,172,178,189, 81,185, 81, 3,255,
- 0, 0, 0, 0,192,128,173,131,192, 14,170, 50,192,105, 71,247,168, 30,207, 64,176,189, 3,255, 0, 0, 0, 0,192, 22, 80,230,
-191,141,155, 50,192,168, 95,108,205, 3,232, 6,141, 19, 3,255, 0, 0, 0, 0,191,194,113, 96,191,195,184,166,192,174,160, 31,
-222,205,222,245,136,227, 3,255, 0, 0, 0, 0,191,213,244,249,191, 52, 33, 10,192,178, 94,248,219,172,241, 3,134, 48, 3,255,
- 0, 0, 0, 0,192,167, 26, 30, 64, 42, 11, 62,190,159,163,199,142, 45, 58, 26,248,236, 3,255, 0, 0, 0, 0,192,157,242, 15,
- 64, 63, 35,177,191,132,230,242,148,115, 65,134,233, 39, 3,255, 0, 0, 0, 0,192,169,163, 58, 64, 14,207,184,191,148, 92, 43,
-140,122, 48,250,230,193, 3,255, 0, 0, 0, 0,192,184, 83,241, 63,117,241, 33,190,248, 69,204,130, 32, 20,245,246, 22, 3,255,
- 0, 0, 0, 0,192,186,178, 88, 62,226, 33,180, 62,165,211, 69,128,153, 10, 65, 6,196, 3,255, 0, 0, 0, 0,192,181,194,100,
- 63,178, 37,227, 62,191, 51, 65,131,199, 29,217, 7,201, 3,255, 0, 0, 0, 0,192,168, 68,140, 63, 57,100,162, 64, 31, 41, 90,
-141, 91, 15,195, 54,175, 3,255, 0, 0, 0, 0,192,173,114,185, 63,162, 11,147, 63,237,131,136,137,204, 27,106, 40,187, 3,255,
- 0, 0, 0, 0,192,178, 82, 90, 62,168, 0,181, 63,231, 64,125,134,136, 7, 78, 39,175, 3,255, 0, 0, 0, 0,192,185, 52,235,
-191, 83,185,191,190,252,176, 39,129,201,237,211,244,241, 3,255, 0, 0, 0, 0,192,182,222, 95,190,161, 32,178,191,165, 92, 48,
-131, 90,248,208,227,211, 3,255, 0, 0, 0, 0,192,179,119, 52,191,147,204,223,191,160,141,116,133,169,230,113,228,103, 3,255,
- 0, 0, 0, 0, 63, 35, 88,109, 64,182,186,129,191,152, 8,207, 14, 5,124,127,229,202, 3,255, 0, 0, 0, 0, 63, 99, 54,226,
- 64,174,134,172,191,250, 98, 96, 19,180,118,244,213, 14, 3,255, 0, 0, 0, 0, 61, 60,195,150, 64,177,121, 46,191,245, 6,174,
- 1, 84,120,249,214, 55, 3,255, 0, 0, 0, 0,191,145,160,228, 64,181, 59,121,191,123,252,246,231, 63,123,214,235, 42, 3,255,
- 0, 0, 0, 0,191,188,166, 29, 64,181,120,167,189,165,224, 4,224, 81,123,253,253,203, 3,255, 0, 0, 0, 0,191, 9,186, 26,
- 64,186,142,104,190,126, 74,128,243,158,127, 69,250, 88, 3,255, 0, 0, 0, 0,191, 19,205,179, 64,175,145, 33, 63,253,151,102,
-243,125,119,171, 43,167, 3,255, 0, 0, 0, 0,190,134,114,163, 64,183, 94, 81, 63,157,210, 73,250, 40,124,240, 27, 49, 3,255,
- 0, 0, 0, 0,191,151,217,253, 64,178, 89, 90, 63,178,246,210,230, 89,121,146, 30,187, 3,255, 0, 0, 0, 0,192, 50,200,107,
- 64,164, 21, 4,191, 18,252,143,194,229,111,189,243, 58, 3,255, 0, 0, 0, 0,192, 29,140,219, 64,163,216,164,191,187,160,163,
-202, 2,111,148,224, 27, 3,255, 0, 0, 0, 0,192, 76, 63, 8, 64,152, 92,149,191,157, 6,201,185,254,103,184,229, 25, 3,255,
- 0, 0, 0, 0, 64,167, 31,102, 63,133,113, 18,192, 29,150,122,113,214, 22,149,202, 5, 3,255, 0, 0, 0, 0, 64,157, 48,115,
- 63, 33,183, 74,192, 72,172, 21,107, 50, 13,106,187, 91, 3,255, 0, 0, 0, 0, 64,151, 48,250, 63,186,157,117,192, 74, 37,236,
-103, 41, 31,126,187, 23, 3,255, 0, 0, 0, 0, 64,148, 31,118, 64, 46, 99,144,192, 21,237, 95,101,101, 59,141,205,115, 3,255,
- 0, 0, 0, 0, 64,150,177, 40, 64, 73,250,101,191,189,252,104,103, 13, 68,113,223, 39, 3,255, 0, 0, 0, 0, 64,164, 67, 59,
- 64, 19,116,106,191,209,145, 96,111,204, 50,223,219,255, 3,255, 0, 0, 0, 0, 64,168, 99, 9, 64, 32,173,184, 63, 27, 16,129,
-114,228, 54,189, 13,164, 3,255, 0, 0, 0, 0, 64,174, 1,225, 64, 12,167, 65,190, 38, 1,199,118,149, 48, 17,252,195, 3,255,
- 0, 0, 0, 0, 64,160,156,172, 64, 66,121, 23,188, 53,253,220,109,155, 66, 25, 0, 0, 3,255, 0, 0, 0, 0, 64,106,184,230,
- 64,133, 83,117,191,243, 95, 76, 79,202, 90,251,214, 77, 3,255, 0, 0, 0, 0, 64,101,166,116, 64,111,107, 67,192, 47,233, 69,
- 78, 23, 81,219,196, 34, 3,255, 0, 0, 0, 0, 64, 68, 20,109, 64,139, 9,202,192, 29,255,124, 66,138, 95, 22,202, 6, 3,255,
- 0, 0, 0, 0, 64, 12,138, 46,192,156,168,195,192, 23,240, 99, 47,172,149, 54,203,252, 3,255, 0, 0, 0, 0, 63,201,189,110,
-192,154, 28, 48,192, 60,148,180, 34, 2,150,195,191,147, 3,255, 0, 0, 0, 0, 64, 17, 55, 21,192,140, 67,125,192, 75, 8,118,
- 49, 61,160, 50,186,221, 3,255, 0, 0, 0, 0, 64,100,126, 85,192,114,211,103,192, 43,176,187, 78, 60,172,241,198, 2, 3,255,
- 0, 0, 0, 0, 64,133,112, 29,192,104, 45,168,191,249, 44, 95, 90,154,176, 96,213, 48, 3,255, 0, 0, 0, 0, 64, 95,193,192,
-192,138, 5,221,191,239,219, 42, 76,181,162, 61,214,177, 3,255, 0, 0, 0, 0, 64,134, 21, 28,192,130,231,185, 62,133,210,175,
- 91,128,166,182, 6, 33, 3,255, 0, 0, 0, 0, 64,115,101,128,192,142,100,106,190,205,174,214, 83, 32,159, 12,247,127, 3,255,
- 0, 0, 0, 0, 64,142,250,187,192,113,123,178,190,242,120, 90, 97, 99,173,142,245,244, 3,255, 0, 0, 0, 0, 64,149, 83,115,
-192, 24,118, 25,192, 41, 5, 96,101,195,204, 61,198, 36, 3,255, 0, 0, 0, 0, 64,130, 97,236,192, 34,248,181,192, 87,132, 49,
- 89, 17,200,184,182,144, 3,255, 0, 0, 0, 0, 64,144,103,186,191,234, 9, 91,192, 80,226,150, 98,152,216,121,184,152, 3,255,
- 0, 0, 0, 0,192,136, 74,208,192,121,117,231,191,133,193, 32,162,248,171, 42,232,249, 3,255, 0, 0, 0, 0,192,144, 84, 31,
-192, 87, 19, 24,191,211, 65, 53,157, 74,182,248,219,224, 3,255, 0, 0, 0, 0,192,123, 90, 7,192,121,238,107,191,247,227,115,
-170, 22,171, 1,213,218, 3,255, 0, 0, 0, 0,192, 54,112,161,192,156, 77, 94,191,196,107,207,193,198,149, 23,223, 32, 3,255,
- 0, 0, 0, 0,192, 22, 41, 24,192,169,197, 1,191, 84, 68,191,204, 45,140,105,237,172, 3,255, 0, 0, 0, 0,192, 75,243, 73,
-192,156, 16, 86,191, 33,150,180,186,216,149, 63,241,194, 3,255, 0, 0, 0, 0,192, 19,246,140,192,166, 60,148, 63,182, 70, 11,
-205,164,142,159, 31,127, 3,255, 0, 0, 0, 0,192, 58, 21, 17,192,160,209,224, 63, 88,100,103,192,202,146, 72, 18,171, 3,255,
- 0, 0, 0, 0,192, 4,252,151,192,174, 89, 71, 63, 38, 93,215,210,148,137, 55, 14,122, 3,255, 0, 0, 0, 0,191,150,176, 53,
-192,174,252,238,191,226,172, 37,230,114,136,199,217, 20, 3,255, 0, 0, 0, 0,191,214,105,225,192,161,177,211,192, 29,229,160,
-219,197,145,175,202, 38, 3,255, 0, 0, 0, 0,191, 88,213, 62,192,167, 70,193,192, 32,217,212,237,221,141,232,200,230, 3,255,
- 0, 0, 0, 0,192,130, 97,236, 64, 34,248,181, 64, 87,132, 49,166,239, 55, 72, 73,112, 3,255, 0, 0, 0, 0,192,144,103,186,
- 63,234, 9, 91, 64, 80,226,150,157,104, 39,135, 71,104, 3,255, 0, 0, 0, 0,192,149, 83,115, 64, 24,118, 25, 64, 41, 5, 96,
-154, 61, 51,195, 57,220, 3,255, 0, 0, 0, 0,192,133,112, 29, 64,104, 45,168, 63,249, 44, 95,165,102, 79,160, 42,208, 3,255,
- 0, 0, 0, 0,192, 95,193,192, 64,138, 5,221, 63,239,219, 42,179, 75, 93,195, 41, 79, 3,255, 0, 0, 0, 0,192,100,126, 85,
- 64,114,211,103, 64, 43,176,187,177,196, 83, 15, 57,254, 3,255, 0, 0, 0, 0,191,201,189,110, 64,154, 28, 48, 64, 60,148,180,
-221,254,105, 61, 64,109, 3,255, 0, 0, 0, 0,192, 17, 55, 21, 64,140, 67,125, 64, 75, 8,118,206,195, 95,206, 69, 35, 3,255,
- 0, 0, 0, 0,192, 12,138, 46, 64,156,168,195, 64, 23,240, 99,208, 84,106,202, 52, 4, 3,255, 0, 0, 0, 0,192,115,101,128,
- 64,142,100,106, 62,205,174,214,172,224, 96,244, 8,129, 3,255, 0, 0, 0, 0,192,142,250,187, 64,113,123,178, 62,242,120, 90,
-158,157, 82,114, 10, 12, 3,255, 0, 0, 0, 0,192,134, 21, 28, 64,130,231,185,190,133,210,175,164,128, 89, 74,249,223, 3,255,
- 0, 0, 0, 0, 63,214,105,225, 64,161,177,211, 64, 29,229,160, 36, 59,110, 81, 53,218, 3,255, 0, 0, 0, 0, 63, 88,213, 62,
- 64,167, 70,193, 64, 32,217,212, 18, 35,114, 24, 55, 26, 3,255, 0, 0, 0, 0, 63,150,176, 53, 64,174,252,238, 63,226,172, 37,
- 25,142,119, 57, 38,236, 3,255, 0, 0, 0, 0, 64, 22, 41, 24, 64,169,197, 1, 63, 84, 68,191, 51,211,115,151, 18, 84, 3,255,
- 0, 0, 0, 0, 64, 75,243, 73, 64,156, 16, 86, 63, 33,150,180, 69, 40,106,193, 14, 62, 3,255, 0, 0, 0, 0, 64, 54,112,161,
- 64,156, 77, 94, 63,196,107,208, 62, 58,106,233, 32,224, 3,255, 0, 0, 0, 0, 64,144, 84, 31, 64, 87, 19, 24, 63,211, 65, 53,
- 98,182, 73, 8, 36, 32, 3,255, 0, 0, 0, 0, 64,123, 90, 7, 64,121,238,107, 63,247,227,115, 85,234, 84,255, 42, 38, 3,255,
- 0, 0, 0, 0, 64,136, 74,208, 64,121,117,231, 63,133,193, 32, 93, 8, 84,214, 23, 7, 3,255, 0, 0, 0, 0, 64, 58, 21, 17,
- 64,160,209,224,191, 88,100,103, 63, 54,109,184,237, 85, 3,255, 0, 0, 0, 0, 64, 4,252,151, 64,174, 89, 71,191, 38, 93,215,
- 45,108,118,201,241,134, 3,255, 0, 0, 0, 0, 64, 19,246,140, 64,166, 60,148,191,182, 70, 11, 50, 92,113, 97,224,129, 3,255,
- 0, 0, 0, 0, 64,182,222, 95, 62,161, 32,178, 63,165, 92, 48,124,166, 7, 48, 28, 45, 3,255, 0, 0, 0, 0, 64,179,119, 52,
- 63,147,204,223, 63,160,141,116,122, 87, 25,143, 27,153, 3,255, 0, 0, 0, 0, 64,185, 52,235, 63, 83,185,191, 62,252,176, 39,
-126, 55, 18, 45, 11, 15, 3,255, 0, 0, 0, 0, 64,186,178, 88,190,226, 33,180,190,165,211, 69,127,103,245,191,249, 60, 3,255,
- 0, 0, 0, 0, 64,181,194,100,191,178, 37,227,190,191, 51, 65,124, 57,226, 39,248, 55, 3,255, 0, 0, 0, 0, 64,184, 83,241,
-191,117,241, 33, 62,248, 69,204,125,224,235, 11, 9,234, 3,255, 0, 0, 0, 0, 64,157,242, 15,192, 63, 35,177, 63,132,230,242,
-107,141,190,122, 22,217, 3,255, 0, 0, 0, 0, 64,169,163, 58,192, 14,207,184, 63,148, 92, 43,115,134,207, 6, 25, 63, 3,255,
- 0, 0, 0, 0, 64,167, 26, 30,192, 42, 11, 62, 62,159,163,199,113,211,197,230, 7, 20, 3,255, 0, 0, 0, 0, 64,173,114,185,
-191,162, 11,147,191,237,131,136,118, 52,228,150,215, 69, 3,255, 0, 0, 0, 0, 64,178, 82, 90,190,168, 0,181,191,231, 64,125,
-121,120,248,178,216, 81, 3,255, 0, 0, 0, 0, 64,168, 68,140,191, 57,100,162,192, 31, 41, 90,114,165,240, 61,201, 81, 3,255,
- 0, 0, 0, 0, 64, 29,140,219,192,163,216,164, 63,187,160,163, 53,254,144,108, 31,229, 3,255, 0, 0, 0, 0, 64, 76, 63, 8,
-192,152, 92,149, 63,157, 6,201, 70, 2,152, 72, 26,231, 3,255, 0, 0, 0, 0, 64, 50,200,107,192,164, 21, 4, 63, 18,252,143,
- 61, 27,144, 67, 12,198, 3,255, 0, 0, 0, 0, 63,188,166, 29,192,181,120,167, 61,165,224, 4, 31,175,132, 3, 2, 53, 3,255,
- 0, 0, 0, 0, 63, 9,186, 26,192,186,142,104, 62,126, 74,128, 12, 98,128,187, 5,168, 3,255, 0, 0, 0, 0, 63,145,160,228,
-192,181, 59,121, 63,123,252,246, 24,193,132, 42, 20,214, 3,255, 0, 0, 0, 0,191, 99, 54,226,192,174,134,172, 63,250, 98, 96,
-236, 76,137, 12, 42,242, 3,255, 0, 0, 0, 0,189, 60,195,150,192,177,121, 46, 63,245, 6,174,254,172,135, 7, 41,201, 3,255,
- 0, 0, 0, 0,191, 35, 88,109,192,182,186,129, 63,152, 8,207,241,251,131,129, 26, 54, 3,255, 0, 0, 0, 0, 62,134,114,163,
-192,183, 94, 81,191,157,210, 73, 5,216,131, 16,228,207, 3,255, 0, 0, 0, 0, 63,151,217,253,192,178, 89, 90,191,178,246,210,
- 25,167,134,110,225, 69, 3,255, 0, 0, 0, 0, 63, 19,205,179,192,175,145, 33,191,253,151,102, 12,131,136, 85,212, 89, 3,255,
- 0, 0, 0, 0,192,101,166,116,192,111,107, 67, 64, 47,233, 69,177,233,174, 37, 59,222, 3,255, 0, 0, 0, 0,192, 68, 20,109,
-192,139, 9,202, 64, 29,255,124,189,118,160,234, 53,250, 3,255, 0, 0, 0, 0,192,106,184,230,192,133, 83,117, 63,243, 95, 76,
-176, 54,165, 5, 41,179, 3,255, 0, 0, 0, 0,192,150,177, 40,192, 73,250,101, 63,189,252,104,152,243,187,143, 32,217, 3,255,
- 0, 0, 0, 0,192,164, 67, 59,192, 19,116,106, 63,209,145, 96,144, 52,205, 33, 36, 1, 3,255, 0, 0, 0, 0,192,148, 31,118,
-192, 46, 99,144, 64, 21,237, 95,154,155,196,115, 50,141, 3,255, 0, 0, 0, 0,192,157, 48,115,191, 33,183, 74, 64, 72,172, 21,
-148,206,242,150, 68,165, 3,255, 0, 0, 0, 0,192,151, 48,250,191,186,157,117, 64, 74, 37,236,152,215,224,130, 68,233, 3,255,
- 0, 0, 0, 0,192,167, 31,102,191,133,113, 18, 64, 29,150,122,142, 42,233,107, 53,251, 3,255, 0, 0, 0, 0,192,174, 1,225,
-192, 12,167, 65, 62, 38, 1,199,137,107,207,239, 3, 61, 3,255, 0, 0, 0, 0,192,160,156,172,192, 66,121, 23, 60, 53,253,220,
-146,101,189,231, 0, 0, 3,255, 0, 0, 0, 0,192,168, 99, 9,192, 32,173,184,191, 27, 16,129,141, 28,201, 67,242, 92, 3,255,
- 0, 0, 0, 0,191, 19, 18,220, 64, 98,186,168, 64,148,136, 66,243,101, 77,135,101, 15, 3,255, 0, 0, 0, 0,191, 68,220, 36,
- 64,132,143, 24, 64,130,105, 20,239, 93, 90,190, 88,184, 3,255, 0, 0, 0, 0,191,185,255, 60, 64,108,244,215, 64,138, 7,129,
-224,143, 80,245, 94, 5, 3,255, 0, 0, 0, 0,191,247,202, 46, 64, 27,140, 23, 64,158,252,116,214, 39, 52,179,108,224, 3,255,
- 0, 0, 0, 0,191,220, 24,190, 63,202,163,163, 64,171,244,160,218,157, 35, 57,117, 60, 3,255, 0, 0, 0, 0,191,133,219,227,
- 64, 17, 47,172, 64,169,160, 93,232,130, 49, 92,115,188, 3,255, 0, 0, 0, 0, 62, 50, 45,123, 62,230, 16,213, 64,186,240,160,
- 4, 25, 9,132,127,147, 3,255, 0, 0, 0, 0, 59,172,119,131, 63,162,209,182, 64,183, 73,170, 0, 47, 27,112,125, 5, 3,255,
- 0, 0, 0, 0,191, 40,230,165, 63, 24,111,246, 64,185,150, 50,241,237, 12,238,126,143, 3,255, 0, 0, 0, 0,192, 66,225,100,
- 63,131,191,146, 64,157, 18,152,189, 78, 22,128,106,231, 3,255, 0, 0, 0, 0,192, 80,140, 98, 63,238,205,169, 64,144, 69, 83,
-184,186, 40,111, 98, 83, 3,255, 0, 0, 0, 0,192,109, 39,177, 63,147,213,154, 64,140,143,239,174,199, 25, 9, 95,179, 3,255,
- 0, 0, 0, 0, 64,128,173,131, 64, 14,170, 50, 64,105, 71,247, 87,226, 48,192, 79, 67, 3,255, 0, 0, 0, 0, 64,140,137,202,
- 64, 33,234, 4, 64, 60,117,152, 96, 41, 55, 40, 63,250, 3,255, 0, 0, 0, 0, 64,115,176, 68, 64, 68, 49, 85, 64, 79,173, 65,
- 83, 78, 66,175, 70,175, 3,255, 0, 0, 0, 0, 64, 39, 23, 51, 64, 76,245, 14, 64,132,248,105, 56,227, 69,119, 91, 56, 3,255,
- 0, 0, 0, 0, 63,254, 75,122, 64, 50, 36, 17, 64,152, 70, 83, 44, 3, 60,210,103,169, 3,255, 0, 0, 0, 0, 64, 52,239,190,
- 64, 22,186,193, 64,145,240,166, 61, 89, 51,253, 99,148, 3,255, 0, 0, 0, 0, 63,213,244,249, 63, 52, 33, 10, 64,178, 94,248,
- 36, 84, 14,253,121,208, 3,255, 0, 0, 0, 0, 64, 22, 80,230, 63,141,155, 50, 64,168, 95,108, 50,253, 23,250,114,237, 3,255,
- 0, 0, 0, 0, 63,194,113, 96, 63,195,184,166, 64,174,160, 31, 33, 51, 33, 11,119, 29, 3,255, 0, 0, 0, 0, 63,112,119,228,
- 64,115, 46, 49, 64,139,222,186, 20,104, 83, 35, 95, 40, 3,255, 0, 0, 0, 0, 63,199, 22,221, 64,134,211, 71, 64,113,161, 37,
- 33,158, 92, 1, 82, 99, 3,255, 0, 0, 0, 0, 63, 58,131,170, 64,140,178, 58, 64,115,174,213, 15,151, 96, 55, 82,245, 3,255,
- 0, 0, 0, 0, 64,132,134,116,192, 40,130, 40, 64, 77,207,237, 90,117,198,107, 69,226, 3,255, 0, 0, 0, 0, 64,140,187,232,
-192, 62, 96, 6, 64, 30,247,107, 95,249,190,188, 53,245, 3,255, 0, 0, 0, 0, 64,152, 61, 37,192, 14, 9,230, 64, 39,179,137,
-103,171,207, 73, 57, 30, 3,255, 0, 0, 0, 0, 64,149,121,189,191,111,192,142, 64, 90, 95, 76,101,161,235,149, 75, 20, 3,255,
- 0, 0, 0, 0, 64,134,112,254,190,207,146,126, 64,130, 19,159, 91,241,246,137, 88,139, 3,255, 0, 0, 0, 0, 64,129,129, 12,
-191,173,129,231, 64,128,125,159, 88,194,226,241, 87,133, 3,255, 0, 0, 0, 0, 64, 22,104,220,191, 40,221,204, 64,170,137,115,
- 50,240,241,167,116,139, 3,255, 0, 0, 0, 0, 64, 56,120,245,191,154,213,118, 64,158,227, 81, 62,175,229,209,108,123, 3,255,
- 0, 0, 0, 0, 64, 66, 56, 52,190,139, 40,206, 64,160,116, 21, 65,243,249,237,109,135, 3,255, 0, 0, 0, 0, 64,150,161, 61,
- 63, 89,221,107, 64, 89,113,118,102,216, 18,177, 73,221, 3,255, 0, 0, 0, 0, 64,165,120, 74, 62,167, 78, 95, 64, 48, 51,139,
-112,202, 7,116, 60, 12, 3,255, 0, 0, 0, 0, 64,162, 65, 12, 63,149, 84, 11, 64, 44,202,172,110,196, 25,209, 58,181, 3,255,
- 0, 0, 0, 0,190,194,138, 67,192,138, 97,177, 64,124,158, 75,247,144,161,122, 85,227, 3,255, 0, 0, 0, 0,191, 66, 82,214,
-192,152,115,128, 64, 85, 25,164,239, 15,151,229, 72,130, 3,255, 0, 0, 0, 0, 61,171,155,119,192,155, 40,138, 64, 83, 96,113,
- 1,128,150, 60, 72, 18, 3,255, 0, 0, 0, 0, 63,178,237,144,192,136,136, 25, 64,113, 1,121, 30,139,163, 67, 82,194, 3,255,
- 0, 0, 0, 0, 63,238,147, 68,192,100,230,166, 64,136, 9,234, 40, 40,177,126, 92,197, 3,255, 0, 0, 0, 0, 63,109,149, 30,
-192,111, 18, 40, 64,141,100,171, 20,219,174, 55, 96, 57, 3,255, 0, 0, 0, 0, 63,162,210, 45,191,224,211,233, 64,174, 67,184,
- 27,187,218, 11,119, 12, 3,255, 0, 0, 0, 0, 63, 94,106,158,192, 30,106,167, 64,167,240,254, 19, 27,202, 69,114,151, 3,255,
- 0, 0, 0, 0, 63,229,114, 22,192, 20, 96,193, 64,162,167,253, 38,234,205,163,111, 12, 3,255, 0, 0, 0, 0, 64, 67, 76,208,
-192,111,120, 62, 64, 85, 89, 14, 66,176,174, 60, 72,116, 3,255, 0, 0, 0, 0, 64, 37,220,139,192,141,135,245, 64, 54,173,114,
- 56,211,159,161, 62, 45, 3,255, 0, 0, 0, 0, 64, 84,119,204,192,130, 73, 93, 64, 38,107,212, 72,198,167, 33, 56,119, 3,255,
- 0, 0, 0, 0,192, 82,218,178,191, 1,247,178, 64,154,129,211,183,221,244,252,105, 39, 3,255, 0, 0, 0, 0,192,124,245, 0,
-190,187, 32, 27, 64,138, 6, 57,169,118,248, 80, 93,254, 3,255, 0, 0, 0, 0,192,112, 75, 42,191,152, 42,228, 64,139, 44, 25,
-174, 0,230, 97, 94,225, 3,255, 0, 0, 0, 0,192, 43,222,239,192, 11,226,212, 64,151, 71,227,197,223,208,116,103,165, 3,255,
- 0, 0, 0, 0,191,229,207,137,192, 22, 63, 30, 64,161,235,207,216, 58,205, 29,110,129, 3,255, 0, 0, 0, 0,192, 14, 11,239,
-191,191,114,175, 64,166,208,254,207,123,222,175,113,169, 3,255, 0, 0, 0, 0,189,149, 78,163,191,137, 25, 65, 64,184,102,234,
-254,202,232,204,125,222, 3,255, 0, 0, 0, 0,191,104,203,208,191,113, 6,146, 64,183, 5,108,236,124,235,106,124,207, 3,255,
- 0, 0, 0, 0,190,251, 68, 26,191,228, 38,111, 64,178, 48,114,245,117,217, 98,121,147, 3,255, 0, 0, 0, 0,191,222,169, 76,
-192,104,107,205, 64,136,142,150,217,233,176,151, 92,223, 3,255, 0, 0, 0, 0,192, 39,143,145,192, 94, 49,190, 64,124, 27,165,
-199, 18,180, 4, 85,213, 3,255, 0, 0, 0, 0,192, 6,168,130,192,130,132,190, 64,105, 96, 12,210, 30,166,165, 79, 83, 3,255,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,151,128, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,118,112, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 90, 0, 12,118,112, 32, 0, 0, 0, 55, 0, 0, 7,128, 0, 0, 0, 0, 0, 0, 0,162,
- 0, 0, 0, 35, 0, 0, 0, 42, 0, 0, 0,162, 0, 0, 0, 35, 0, 0, 0, 12, 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0, 42,
- 0, 0, 0,163, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0,164, 0, 0, 0, 35, 0, 0, 0, 43, 0, 0, 0,164, 0, 0, 0, 35,
- 0, 0, 0, 12, 0, 0, 0,165, 0, 0, 0, 35, 0, 0, 0, 43, 0, 0, 0,165, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,166,
- 0, 0, 0, 35, 0, 0, 0, 44, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0, 13, 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0, 44,
- 0, 0, 0,167, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0,168, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 0,168, 0, 0, 0, 35,
- 0, 0, 0, 13, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 0,169, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0,170,
- 0, 0, 0, 35, 0, 0, 0, 46, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0, 46,
- 0, 0, 0,171, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 0, 47, 0, 0, 0,172, 0, 0, 0, 35,
- 0, 0, 0, 14, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0, 47, 0, 0, 0,173, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,174,
- 0, 0, 0, 35, 0, 0, 0, 48, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0, 48,
- 0, 0, 0,175, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0,176, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 0,176, 0, 0, 0, 35,
- 0, 0, 0, 15, 0, 0, 0,177, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 0,177, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0,178,
- 0, 0, 0, 35, 0, 0, 0, 50, 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 0, 16, 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0, 50,
- 0, 0, 0,179, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0, 51, 0, 0, 0,180, 0, 0, 0, 35,
- 0, 0, 0, 16, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0, 51, 0, 0, 0,181, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,182,
- 0, 0, 0, 35, 0, 0, 0, 52, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0, 17, 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0, 52,
- 0, 0, 0,183, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0,184, 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 0,184, 0, 0, 0, 35,
- 0, 0, 0, 17, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 0,185, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0,186,
- 0, 0, 0, 35, 0, 0, 0, 54, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 0, 54,
- 0, 0, 0,187, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0,188, 0, 0, 0, 35, 0, 0, 0, 55, 0, 0, 0,188, 0, 0, 0, 35,
- 0, 0, 0, 18, 0, 0, 0,189, 0, 0, 0, 35, 0, 0, 0, 55, 0, 0, 0,189, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,190,
- 0, 0, 0, 35, 0, 0, 0, 56, 0, 0, 0,190, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 0,191, 0, 0, 0, 35, 0, 0, 0, 56,
- 0, 0, 0,191, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0,192, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 0,192, 0, 0, 0, 35,
- 0, 0, 0, 19, 0, 0, 0,193, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 0,193, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0,194,
- 0, 0, 0, 35, 0, 0, 0, 58, 0, 0, 0,194, 0, 0, 0, 35, 0, 0, 0, 20, 0, 0, 0,195, 0, 0, 0, 35, 0, 0, 0, 58,
- 0, 0, 0,195, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0,196, 0, 0, 0, 35, 0, 0, 0, 59, 0, 0, 0,196, 0, 0, 0, 35,
- 0, 0, 0, 20, 0, 0, 0,197, 0, 0, 0, 35, 0, 0, 0, 59, 0, 0, 0,197, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0,198,
- 0, 0, 0, 35, 0, 0, 0, 60, 0, 0, 0,198, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 0,199, 0, 0, 0, 35, 0, 0, 0, 60,
- 0, 0, 0,199, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0,200, 0, 0, 0, 35, 0, 0, 0, 61, 0, 0, 0,200, 0, 0, 0, 35,
- 0, 0, 0, 21, 0, 0, 0,201, 0, 0, 0, 35, 0, 0, 0, 61, 0, 0, 0,201, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0,202,
- 0, 0, 0, 35, 0, 0, 0, 62, 0, 0, 0,202, 0, 0, 0, 35, 0, 0, 0, 22, 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 0, 62,
- 0, 0, 0,203, 0, 0, 0, 35, 0, 0, 0, 10, 0, 0, 0,204, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 0,204, 0, 0, 0, 35,
- 0, 0, 0, 22, 0, 0, 0,205, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 0,205, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0,206,
- 0, 0, 0, 35, 0, 0, 0, 64, 0, 0, 0,206, 0, 0, 0, 35, 0, 0, 0, 23, 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0, 64,
- 0, 0, 0,207, 0, 0, 0, 35, 0, 0, 0, 10, 0, 0, 0,208, 0, 0, 0, 35, 0, 0, 0, 65, 0, 0, 0,208, 0, 0, 0, 35,
- 0, 0, 0, 23, 0, 0, 0,209, 0, 0, 0, 35, 0, 0, 0, 65, 0, 0, 0,209, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0,210,
- 0, 0, 0, 35, 0, 0, 0, 66, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0, 24, 0, 0, 0,211, 0, 0, 0, 35, 0, 0, 0, 66,
- 0, 0, 0,211, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0,212, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,212, 0, 0, 0, 35,
- 0, 0, 0, 24, 0, 0, 0,213, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 0,213, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0,214,
- 0, 0, 0, 35, 0, 0, 0, 68, 0, 0, 0,214, 0, 0, 0, 35, 0, 0, 0, 25, 0, 0, 0,215, 0, 0, 0, 35, 0, 0, 0, 68,
- 0, 0, 0,215, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0,216, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 0,216, 0, 0, 0, 35,
- 0, 0, 0, 25, 0, 0, 0,217, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 0,217, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0,218,
- 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0, 26, 0, 0, 0,219, 0, 0, 0, 35, 0, 0, 0, 70,
- 0, 0, 0,219, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0,220, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 0,220, 0, 0, 0, 35,
- 0, 0, 0, 26, 0, 0, 0,221, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 0,221, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0,222,
- 0, 0, 0, 35, 0, 0, 0, 72, 0, 0, 0,222, 0, 0, 0, 35, 0, 0, 0, 27, 0, 0, 0,223, 0, 0, 0, 35, 0, 0, 0, 72,
- 0, 0, 0,223, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0,224, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 0,224, 0, 0, 0, 35,
- 0, 0, 0, 27, 0, 0, 0,225, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 0,225, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0,226,
- 0, 0, 0, 35, 0, 0, 0, 74, 0, 0, 0,226, 0, 0, 0, 35, 0, 0, 0, 28, 0, 0, 0,227, 0, 0, 0, 35, 0, 0, 0, 74,
- 0, 0, 0,227, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0,228, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 0,228, 0, 0, 0, 35,
- 0, 0, 0, 28, 0, 0, 0,229, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 0,229, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0,230,
- 0, 0, 0, 35, 0, 0, 0, 76, 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 0,231, 0, 0, 0, 35, 0, 0, 0, 76,
- 0, 0, 0,231, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0,232, 0, 0, 0, 35, 0, 0, 0, 77, 0, 0, 0,232, 0, 0, 0, 35,
- 0, 0, 0, 29, 0, 0, 0,233, 0, 0, 0, 35, 0, 0, 0, 77, 0, 0, 0,233, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0,234,
- 0, 0, 0, 35, 0, 0, 0, 78, 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0, 30, 0, 0, 0,235, 0, 0, 0, 35, 0, 0, 0, 78,
- 0, 0, 0,235, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 0,236, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 0,236, 0, 0, 0, 35,
- 0, 0, 0, 30, 0, 0, 0,237, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 0,237, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0,238,
- 0, 0, 0, 35, 0, 0, 0, 80, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 0, 31, 0, 0, 0,239, 0, 0, 0, 35, 0, 0, 0, 80,
- 0, 0, 0,239, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 0,240, 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 0,240, 0, 0, 0, 35,
- 0, 0, 0, 31, 0, 0, 0,241, 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 0,241, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0,242,
- 0, 0, 0, 35, 0, 0, 0, 82, 0, 0, 0,242, 0, 0, 0, 35, 0, 0, 0, 32, 0, 0, 0,243, 0, 0, 0, 35, 0, 0, 0, 82,
- 0, 0, 0,243, 0, 0, 0, 35, 0, 0, 0, 10, 0, 0, 0,244, 0, 0, 0, 35, 0, 0, 0, 83, 0, 0, 0,244, 0, 0, 0, 35,
- 0, 0, 0, 32, 0, 0, 0,245, 0, 0, 0, 35, 0, 0, 0, 83, 0, 0, 0,245, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0,246,
- 0, 0, 0, 35, 0, 0, 0, 84, 0, 0, 0,246, 0, 0, 0, 35, 0, 0, 0, 33, 0, 0, 0,247, 0, 0, 0, 35, 0, 0, 0, 84,
- 0, 0, 0,247, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0,248, 0, 0, 0, 35, 0, 0, 0, 85, 0, 0, 0,248, 0, 0, 0, 35,
- 0, 0, 0, 33, 0, 0, 0,249, 0, 0, 0, 35, 0, 0, 0, 85, 0, 0, 0,249, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 0,250,
- 0, 0, 0, 35, 0, 0, 0, 86, 0, 0, 0,250, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0,251, 0, 0, 0, 35, 0, 0, 0, 86,
- 0, 0, 0,251, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 0, 87, 0, 0, 0,252, 0, 0, 0, 35,
- 0, 0, 0, 34, 0, 0, 0,253, 0, 0, 0, 35, 0, 0, 0, 87, 0, 0, 0,253, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 0,254,
- 0, 0, 0, 35, 0, 0, 0, 88, 0, 0, 0,254, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 0, 35, 0, 0, 0, 88,
- 0, 0, 0,255, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 0, 89, 0, 0, 1, 0, 0, 0, 0, 35,
- 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 0, 35, 0, 0, 0, 89, 0, 0, 1, 1, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 1, 2,
- 0, 0, 0, 35, 0, 0, 0, 90, 0, 0, 1, 2, 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, 1, 3, 0, 0, 0, 35, 0, 0, 0, 90,
- 0, 0, 1, 3, 0, 0, 0, 35, 0, 0, 0, 10, 0, 0, 1, 4, 0, 0, 0, 35, 0, 0, 0, 91, 0, 0, 1, 4, 0, 0, 0, 35,
- 0, 0, 0, 36, 0, 0, 1, 5, 0, 0, 0, 35, 0, 0, 0, 91, 0, 0, 1, 5, 0, 0, 0, 35, 0, 0, 0, 10, 0, 0, 1, 6,
- 0, 0, 0, 35, 0, 0, 0, 92, 0, 0, 1, 6, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 1, 7, 0, 0, 0, 35, 0, 0, 0, 92,
- 0, 0, 1, 7, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 1, 8, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 1, 8, 0, 0, 0, 35,
- 0, 0, 0, 37, 0, 0, 1, 9, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 1, 9, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 1, 10,
- 0, 0, 0, 35, 0, 0, 0, 94, 0, 0, 1, 10, 0, 0, 0, 35, 0, 0, 0, 38, 0, 0, 1, 11, 0, 0, 0, 35, 0, 0, 0, 94,
- 0, 0, 1, 11, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 1, 12, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 1, 12, 0, 0, 0, 35,
- 0, 0, 0, 38, 0, 0, 1, 13, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 1, 13, 0, 0, 0, 35, 0, 0, 0, 7, 0, 0, 1, 14,
- 0, 0, 0, 35, 0, 0, 0, 96, 0, 0, 1, 14, 0, 0, 0, 35, 0, 0, 0, 39, 0, 0, 1, 15, 0, 0, 0, 35, 0, 0, 0, 96,
- 0, 0, 1, 15, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 1, 16, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 1, 16, 0, 0, 0, 35,
- 0, 0, 0, 39, 0, 0, 1, 17, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 1, 17, 0, 0, 0, 35, 0, 0, 0, 8, 0, 0, 1, 18,
- 0, 0, 0, 35, 0, 0, 0, 98, 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 0, 40, 0, 0, 1, 19, 0, 0, 0, 35, 0, 0, 0, 98,
- 0, 0, 1, 19, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 1, 20, 0, 0, 0, 35, 0, 0, 0, 99, 0, 0, 1, 20, 0, 0, 0, 35,
- 0, 0, 0, 40, 0, 0, 1, 21, 0, 0, 0, 35, 0, 0, 0, 99, 0, 0, 1, 21, 0, 0, 0, 35, 0, 0, 0, 9, 0, 0, 1, 22,
- 0, 0, 0, 35, 0, 0, 0,100, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 0, 41, 0, 0, 1, 23, 0, 0, 0, 35, 0, 0, 0,100,
- 0, 0, 1, 23, 0, 0, 0, 35, 0, 0, 0, 11, 0, 0, 1, 24, 0, 0, 0, 35, 0, 0, 0,101, 0, 0, 1, 24, 0, 0, 0, 35,
- 0, 0, 0, 41, 0, 0, 1, 25, 0, 0, 0, 35, 0, 0, 0,101, 0, 0, 1, 25, 0, 0, 0, 35, 0, 0, 0, 12, 0, 0, 1, 26,
- 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 1, 26, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 0,102,
- 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 0, 12, 0, 0, 1, 28, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1, 28, 0, 0, 0, 35,
- 0, 0, 0, 13, 0, 0, 1, 29, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1, 29, 0, 0, 0, 35, 0, 0, 0, 13, 0, 0, 1, 30,
- 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 1, 30, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 0,104,
- 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 0, 12, 0, 0, 1, 32, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 1, 32, 0, 0, 0, 35,
- 0, 0, 0, 16, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 0, 12, 0, 0, 1, 34,
- 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 1, 35, 0, 0, 0, 35, 0, 0, 0,106,
- 0, 0, 1, 35, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 0,107, 0, 0, 1, 36, 0, 0, 0, 35,
- 0, 0, 0, 16, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 0,107, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 0, 13, 0, 0, 1, 38,
- 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 1, 38, 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 1, 39, 0, 0, 0, 35, 0, 0, 0,108,
- 0, 0, 1, 39, 0, 0, 0, 35, 0, 0, 0, 13, 0, 0, 1, 40, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 1, 40, 0, 0, 0, 35,
- 0, 0, 0, 17, 0, 0, 1, 41, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 1, 41, 0, 0, 0, 35, 0, 0, 0, 17, 0, 0, 1, 42,
- 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 1, 42, 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 0,110,
- 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 0, 17, 0, 0, 1, 44, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 1, 44, 0, 0, 0, 35,
- 0, 0, 0, 20, 0, 0, 1, 45, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 1, 45, 0, 0, 0, 35, 0, 0, 0, 17, 0, 0, 1, 46,
- 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 1, 46, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 1, 47, 0, 0, 0, 35, 0, 0, 0,112,
- 0, 0, 1, 47, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 1, 48, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 1, 48, 0, 0, 0, 35,
- 0, 0, 0, 20, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 0, 19, 0, 0, 1, 50,
- 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 1, 50, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 1, 51, 0, 0, 0, 35, 0, 0, 0,114,
- 0, 0, 1, 51, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 1, 52, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 1, 52, 0, 0, 0, 35,
- 0, 0, 0, 19, 0, 0, 1, 53, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 1, 53, 0, 0, 0, 35, 0, 0, 0, 15, 0, 0, 1, 54,
- 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 1, 54, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 0,116,
- 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 0, 16, 0, 0, 1, 56, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 1, 56, 0, 0, 0, 35,
- 0, 0, 0, 23, 0, 0, 1, 57, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 1, 57, 0, 0, 0, 35, 0, 0, 0, 16, 0, 0, 1, 58,
- 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 1, 58, 0, 0, 0, 35, 0, 0, 0, 22, 0, 0, 1, 59, 0, 0, 0, 35, 0, 0, 0,118,
- 0, 0, 1, 59, 0, 0, 0, 35, 0, 0, 0, 22, 0, 0, 1, 60, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 1, 60, 0, 0, 0, 35,
- 0, 0, 0, 23, 0, 0, 1, 61, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 1, 61, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 1, 62,
- 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 1, 62, 0, 0, 0, 35, 0, 0, 0, 25, 0, 0, 1, 63, 0, 0, 0, 35, 0, 0, 0,120,
- 0, 0, 1, 63, 0, 0, 0, 35, 0, 0, 0, 14, 0, 0, 1, 64, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 1, 64, 0, 0, 0, 35,
- 0, 0, 0, 24, 0, 0, 1, 65, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 1, 65, 0, 0, 0, 35, 0, 0, 0, 24, 0, 0, 1, 66,
- 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 1, 66, 0, 0, 0, 35, 0, 0, 0, 25, 0, 0, 1, 67, 0, 0, 0, 35, 0, 0, 0,122,
- 0, 0, 1, 67, 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 1, 68, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 1, 68, 0, 0, 0, 35,
- 0, 0, 0, 27, 0, 0, 1, 69, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 1, 69, 0, 0, 0, 35, 0, 0, 0, 18, 0, 0, 1, 70,
- 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 1, 70, 0, 0, 0, 35, 0, 0, 0, 26, 0, 0, 1, 71, 0, 0, 0, 35, 0, 0, 0,124,
- 0, 0, 1, 71, 0, 0, 0, 35, 0, 0, 0, 26, 0, 0, 1, 72, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 1, 72, 0, 0, 0, 35,
- 0, 0, 0, 27, 0, 0, 1, 73, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 1, 73, 0, 0, 0, 35, 0, 0, 0, 20, 0, 0, 1, 74,
- 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 1, 74, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 1, 75, 0, 0, 0, 35, 0, 0, 0,126,
- 0, 0, 1, 75, 0, 0, 0, 35, 0, 0, 0, 20, 0, 0, 1, 76, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 1, 76, 0, 0, 0, 35,
- 0, 0, 0, 28, 0, 0, 1, 77, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 1, 77, 0, 0, 0, 35, 0, 0, 0, 28, 0, 0, 1, 78,
- 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 1, 78, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 1, 79, 0, 0, 0, 35, 0, 0, 0,128,
- 0, 0, 1, 79, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 1, 80, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 1, 80, 0, 0, 0, 35,
- 0, 0, 0, 31, 0, 0, 1, 81, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 1, 81, 0, 0, 0, 35, 0, 0, 0, 21, 0, 0, 1, 82,
- 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 1, 82, 0, 0, 0, 35, 0, 0, 0, 30, 0, 0, 1, 83, 0, 0, 0, 35, 0, 0, 0,130,
- 0, 0, 1, 83, 0, 0, 0, 35, 0, 0, 0, 30, 0, 0, 1, 84, 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 1, 84, 0, 0, 0, 35,
- 0, 0, 0, 31, 0, 0, 1, 85, 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 1, 85, 0, 0, 0, 35, 0, 0, 0, 23, 0, 0, 1, 86,
- 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 1, 86, 0, 0, 0, 35, 0, 0, 0, 32, 0, 0, 1, 87, 0, 0, 0, 35, 0, 0, 0,132,
- 0, 0, 1, 87, 0, 0, 0, 35, 0, 0, 0, 23, 0, 0, 1, 88, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 1, 88, 0, 0, 0, 35,
- 0, 0, 0, 24, 0, 0, 1, 89, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 1, 89, 0, 0, 0, 35, 0, 0, 0, 24, 0, 0, 1, 90,
- 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 1, 90, 0, 0, 0, 35, 0, 0, 0, 32, 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 0,134,
- 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 0, 25, 0, 0, 1, 92, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 1, 92, 0, 0, 0, 35,
- 0, 0, 0, 33, 0, 0, 1, 93, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 1, 93, 0, 0, 0, 35, 0, 0, 0, 25, 0, 0, 1, 94,
- 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 1, 94, 0, 0, 0, 35, 0, 0, 0, 26, 0, 0, 1, 95, 0, 0, 0, 35, 0, 0, 0,136,
- 0, 0, 1, 95, 0, 0, 0, 35, 0, 0, 0, 26, 0, 0, 1, 96, 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 1, 96, 0, 0, 0, 35,
- 0, 0, 0, 33, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 0, 27, 0, 0, 1, 98,
- 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 1, 98, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 1, 99, 0, 0, 0, 35, 0, 0, 0,138,
- 0, 0, 1, 99, 0, 0, 0, 35, 0, 0, 0, 27, 0, 0, 1,100, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 1,100, 0, 0, 0, 35,
- 0, 0, 0, 28, 0, 0, 1,101, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 1,101, 0, 0, 0, 35, 0, 0, 0, 28, 0, 0, 1,102,
- 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 1,102, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 0,140,
- 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 1,104, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 1,104, 0, 0, 0, 35,
- 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 1,106,
- 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 1,106, 0, 0, 0, 35, 0, 0, 0, 30, 0, 0, 1,107, 0, 0, 0, 35, 0, 0, 0,142,
- 0, 0, 1,107, 0, 0, 0, 35, 0, 0, 0, 30, 0, 0, 1,108, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 1,108, 0, 0, 0, 35,
- 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 0, 31, 0, 0, 1,110,
- 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 1,110, 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 0,144,
- 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 0, 22, 0, 0, 1,112, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 1,112, 0, 0, 0, 35,
- 0, 0, 0, 31, 0, 0, 1,113, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 1,113, 0, 0, 0, 35, 0, 0, 0, 22, 0, 0, 1,114,
- 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 1,114, 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 0,146,
- 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 0, 32, 0, 0, 1,116, 0, 0, 0, 35, 0, 0, 0,147, 0, 0, 1,116, 0, 0, 0, 35,
- 0, 0, 0, 38, 0, 0, 1,117, 0, 0, 0, 35, 0, 0, 0,147, 0, 0, 1,117, 0, 0, 0, 35, 0, 0, 0, 32, 0, 0, 1,118,
- 0, 0, 0, 35, 0, 0, 0,148, 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 1,119, 0, 0, 0, 35, 0, 0, 0,148,
- 0, 0, 1,119, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 1,120, 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 1,120, 0, 0, 0, 35,
- 0, 0, 0, 38, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 0, 33, 0, 0, 1,122,
- 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 1,122, 0, 0, 0, 35, 0, 0, 0, 39, 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 0,150,
- 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 0, 33, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 1,124, 0, 0, 0, 35,
- 0, 0, 0, 38, 0, 0, 1,125, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 1,125, 0, 0, 0, 35, 0, 0, 0, 38, 0, 0, 1,126,
- 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 0, 39, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 0,152,
- 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 1,128, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 1,128, 0, 0, 0, 35,
- 0, 0, 0, 40, 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 1,130,
- 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 0, 39, 0, 0, 1,131, 0, 0, 0, 35, 0, 0, 0,154,
- 0, 0, 1,131, 0, 0, 0, 35, 0, 0, 0, 39, 0, 0, 1,132, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 1,132, 0, 0, 0, 35,
- 0, 0, 0, 40, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 1,134,
- 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 0, 41, 0, 0, 1,135, 0, 0, 0, 35, 0, 0, 0,156,
- 0, 0, 1,135, 0, 0, 0, 35, 0, 0, 0, 35, 0, 0, 1,136, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 1,136, 0, 0, 0, 35,
- 0, 0, 0, 40, 0, 0, 1,137, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 1,137, 0, 0, 0, 35, 0, 0, 0, 40, 0, 0, 1,138,
- 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 1,138, 0, 0, 0, 35, 0, 0, 0, 41, 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 0,158,
- 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, 1,140, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 1,140, 0, 0, 0, 35,
- 0, 0, 0, 37, 0, 0, 1,141, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 1,141, 0, 0, 0, 35, 0, 0, 0, 36, 0, 0, 1,142,
- 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 1,142, 0, 0, 0, 35, 0, 0, 0, 41, 0, 0, 1,143, 0, 0, 0, 35, 0, 0, 0,160,
- 0, 0, 1,143, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 1,144, 0, 0, 0, 35,
- 0, 0, 0, 41, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 0, 46, 0, 0, 1,146,
- 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 1,146, 0, 0, 0, 35, 0, 0, 0, 43, 0, 0, 1,147, 0, 0, 0, 33, 0, 0, 0, 46,
- 0, 0, 1,147, 0, 0, 0, 33, 0, 0, 0, 43, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 1,148, 0, 0, 0, 35,
- 0, 0, 0,102, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1,150,
- 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 0,102, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 0,104,
- 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 1,152, 0, 0, 0, 33, 0, 0, 0, 47, 0, 0, 1,152, 0, 0, 0, 33,
- 0, 0, 0, 47, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 1,154,
- 0, 0, 0, 35, 0, 0, 0,104, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 0, 44, 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 0,103,
- 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 0, 42, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 0,103, 0, 0, 1,156, 0, 0, 0, 35,
- 0, 0, 0, 42, 0, 0, 1,157, 0, 0, 0, 33, 0, 0, 0, 44, 0, 0, 1,157, 0, 0, 0, 33, 0, 0, 0, 50, 0, 0, 1,158,
- 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 0, 43, 0, 0, 1,159, 0, 0, 0, 33, 0, 0, 0, 50,
- 0, 0, 1,159, 0, 0, 0, 33, 0, 0, 0, 43, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 1,160, 0, 0, 0, 35,
- 0, 0, 0,105, 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 1,162,
- 0, 0, 0, 35, 0, 0, 0,107, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 0,105, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 0,107,
- 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 1,164, 0, 0, 0, 33, 0, 0, 0, 51, 0, 0, 1,164, 0, 0, 0, 33,
- 0, 0, 0, 51, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 0,107, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 1,166,
- 0, 0, 0, 35, 0, 0, 0,107, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 0, 48, 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 0,106,
- 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 0, 42, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 0,106, 0, 0, 1,168, 0, 0, 0, 35,
- 0, 0, 0, 42, 0, 0, 1,169, 0, 0, 0, 33, 0, 0, 0, 48, 0, 0, 1,169, 0, 0, 0, 33, 0, 0, 0, 54, 0, 0, 1,170,
- 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 1,170, 0, 0, 0, 35, 0, 0, 0, 45, 0, 0, 1,171, 0, 0, 0, 33, 0, 0, 0, 54,
- 0, 0, 1,171, 0, 0, 0, 33, 0, 0, 0, 45, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 1,172, 0, 0, 0, 35,
- 0, 0, 0,108, 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 1,174,
- 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 0,108, 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 0,110,
- 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 1,176, 0, 0, 0, 33, 0, 0, 0, 55, 0, 0, 1,176, 0, 0, 0, 33,
- 0, 0, 0, 55, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 1,178,
- 0, 0, 0, 35, 0, 0, 0,110, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 0, 52, 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 0,109,
- 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 0, 44, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 0,109, 0, 0, 1,180, 0, 0, 0, 35,
- 0, 0, 0, 44, 0, 0, 1,181, 0, 0, 0, 33, 0, 0, 0, 52, 0, 0, 1,181, 0, 0, 0, 33, 0, 0, 0, 58, 0, 0, 1,182,
- 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 1,182, 0, 0, 0, 35, 0, 0, 0, 53, 0, 0, 1,183, 0, 0, 0, 33, 0, 0, 0, 58,
- 0, 0, 1,183, 0, 0, 0, 33, 0, 0, 0, 53, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 1,184, 0, 0, 0, 35,
- 0, 0, 0,111, 0, 0, 1,185, 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 1,185, 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 1,186,
- 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 0,111, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 0,113,
- 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 1,188, 0, 0, 0, 33, 0, 0, 0, 59, 0, 0, 1,188, 0, 0, 0, 33,
- 0, 0, 0, 59, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 1,190,
- 0, 0, 0, 35, 0, 0, 0,113, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 0, 56, 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 0,112,
- 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 0, 52, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 0,112, 0, 0, 1,192, 0, 0, 0, 35,
- 0, 0, 0, 52, 0, 0, 1,193, 0, 0, 0, 33, 0, 0, 0, 56, 0, 0, 1,193, 0, 0, 0, 33, 0, 0, 0, 60, 0, 0, 1,194,
- 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 1,194, 0, 0, 0, 35, 0, 0, 0, 57, 0, 0, 1,195, 0, 0, 0, 33, 0, 0, 0, 60,
- 0, 0, 1,195, 0, 0, 0, 33, 0, 0, 0, 57, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 1,196, 0, 0, 0, 35,
- 0, 0, 0,114, 0, 0, 1,197, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 1,197, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 1,198,
- 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 0,114, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 0,116,
- 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 1,200, 0, 0, 0, 33, 0, 0, 0, 61, 0, 0, 1,200, 0, 0, 0, 33,
- 0, 0, 0, 61, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 1,202,
- 0, 0, 0, 35, 0, 0, 0,116, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 0, 48, 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 0,115,
- 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 0, 56, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 0,115, 0, 0, 1,204, 0, 0, 0, 35,
- 0, 0, 0, 48, 0, 0, 1,205, 0, 0, 0, 33, 0, 0, 0, 56, 0, 0, 1,205, 0, 0, 0, 33, 0, 0, 0, 64, 0, 0, 1,206,
- 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 0, 50, 0, 0, 1,207, 0, 0, 0, 33, 0, 0, 0, 64,
- 0, 0, 1,207, 0, 0, 0, 33, 0, 0, 0, 50, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 1,208, 0, 0, 0, 35,
- 0, 0, 0,117, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 1,210,
- 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 0,117, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 0,119,
- 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 1,212, 0, 0, 0, 33, 0, 0, 0, 65, 0, 0, 1,212, 0, 0, 0, 33,
- 0, 0, 0, 65, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 1,214,
- 0, 0, 0, 35, 0, 0, 0,119, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 0, 62, 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 0,118,
- 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 0, 51, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 0,118, 0, 0, 1,216, 0, 0, 0, 35,
- 0, 0, 0, 51, 0, 0, 1,217, 0, 0, 0, 33, 0, 0, 0, 62, 0, 0, 1,217, 0, 0, 0, 33, 0, 0, 0, 68, 0, 0, 1,218,
- 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 0, 47, 0, 0, 1,219, 0, 0, 0, 33, 0, 0, 0, 68,
- 0, 0, 1,219, 0, 0, 0, 33, 0, 0, 0, 47, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 1,220, 0, 0, 0, 35,
- 0, 0, 0,120, 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 1,222,
- 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 0,120, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 0,122,
- 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 1,224, 0, 0, 0, 33, 0, 0, 0, 69, 0, 0, 1,224, 0, 0, 0, 33,
- 0, 0, 0, 69, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 1,226,
- 0, 0, 0, 35, 0, 0, 0,122, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 0, 66, 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 0,121,
- 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 0, 46, 0, 0, 1,228, 0, 0, 0, 35, 0, 0, 0,121, 0, 0, 1,228, 0, 0, 0, 35,
- 0, 0, 0, 46, 0, 0, 1,229, 0, 0, 0, 33, 0, 0, 0, 66, 0, 0, 1,229, 0, 0, 0, 33, 0, 0, 0, 72, 0, 0, 1,230,
- 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 1,230, 0, 0, 0, 35, 0, 0, 0, 55, 0, 0, 1,231, 0, 0, 0, 33, 0, 0, 0, 72,
- 0, 0, 1,231, 0, 0, 0, 33, 0, 0, 0, 55, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 1,232, 0, 0, 0, 35,
- 0, 0, 0,123, 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 1,234,
- 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 0,123, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 0,125,
- 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 1,236, 0, 0, 0, 33, 0, 0, 0, 73, 0, 0, 1,236, 0, 0, 0, 33,
- 0, 0, 0, 73, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 1,238,
- 0, 0, 0, 35, 0, 0, 0,125, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 0,124,
- 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 0, 54, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 0,124, 0, 0, 1,240, 0, 0, 0, 35,
- 0, 0, 0, 54, 0, 0, 1,241, 0, 0, 0, 33, 0, 0, 0, 70, 0, 0, 1,241, 0, 0, 0, 33, 0, 0, 0, 76, 0, 0, 1,242,
- 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 0, 59, 0, 0, 1,243, 0, 0, 0, 33, 0, 0, 0, 76,
- 0, 0, 1,243, 0, 0, 0, 33, 0, 0, 0, 59, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 1,244, 0, 0, 0, 35,
- 0, 0, 0,126, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 1,246,
- 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 0,126, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 0,128,
- 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 1,248, 0, 0, 0, 33, 0, 0, 0, 77, 0, 0, 1,248, 0, 0, 0, 33,
- 0, 0, 0, 77, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 1,250,
- 0, 0, 0, 35, 0, 0, 0,128, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 0, 74, 0, 0, 1,251, 0, 0, 0, 35, 0, 0, 0,127,
- 0, 0, 1,251, 0, 0, 0, 35, 0, 0, 0, 58, 0, 0, 1,252, 0, 0, 0, 35, 0, 0, 0,127, 0, 0, 1,252, 0, 0, 0, 35,
- 0, 0, 0, 58, 0, 0, 1,253, 0, 0, 0, 33, 0, 0, 0, 74, 0, 0, 1,253, 0, 0, 0, 33, 0, 0, 0, 80, 0, 0, 1,254,
- 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 1,254, 0, 0, 0, 35, 0, 0, 0, 61, 0, 0, 1,255, 0, 0, 0, 33, 0, 0, 0, 80,
- 0, 0, 1,255, 0, 0, 0, 33, 0, 0, 0, 61, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 2, 0, 0, 0, 0, 35,
- 0, 0, 0,129, 0, 0, 2, 1, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 2, 1, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 2, 2,
- 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 2, 2, 0, 0, 0, 35, 0, 0, 0,129, 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 0,131,
- 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 2, 4, 0, 0, 0, 33, 0, 0, 0, 81, 0, 0, 2, 4, 0, 0, 0, 33,
- 0, 0, 0, 81, 0, 0, 2, 5, 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 2, 5, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 2, 6,
- 0, 0, 0, 35, 0, 0, 0,131, 0, 0, 2, 6, 0, 0, 0, 35, 0, 0, 0, 78, 0, 0, 2, 7, 0, 0, 0, 35, 0, 0, 0,130,
- 0, 0, 2, 7, 0, 0, 0, 35, 0, 0, 0, 60, 0, 0, 2, 8, 0, 0, 0, 35, 0, 0, 0,130, 0, 0, 2, 8, 0, 0, 0, 35,
- 0, 0, 0, 60, 0, 0, 2, 9, 0, 0, 0, 33, 0, 0, 0, 78, 0, 0, 2, 9, 0, 0, 0, 33, 0, 0, 0, 83, 0, 0, 2, 10,
- 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 2, 10, 0, 0, 0, 35, 0, 0, 0, 65, 0, 0, 2, 11, 0, 0, 0, 33, 0, 0, 0, 83,
- 0, 0, 2, 11, 0, 0, 0, 33, 0, 0, 0, 65, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 2, 12, 0, 0, 0, 35,
- 0, 0, 0,132, 0, 0, 2, 13, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 2, 13, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 2, 14,
- 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 0,132, 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 0,134,
- 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 2, 16, 0, 0, 0, 33, 0, 0, 0, 82, 0, 0, 2, 16, 0, 0, 0, 33,
- 0, 0, 0, 82, 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 0, 67, 0, 0, 2, 18,
- 0, 0, 0, 35, 0, 0, 0,134, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 0, 66, 0, 0, 2, 19, 0, 0, 0, 35, 0, 0, 0,133,
- 0, 0, 2, 19, 0, 0, 0, 35, 0, 0, 0, 64, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 0,133, 0, 0, 2, 20, 0, 0, 0, 35,
- 0, 0, 0, 64, 0, 0, 2, 21, 0, 0, 0, 33, 0, 0, 0, 66, 0, 0, 2, 21, 0, 0, 0, 33, 0, 0, 0, 84, 0, 0, 2, 22,
- 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 2, 22, 0, 0, 0, 35, 0, 0, 0, 69, 0, 0, 2, 23, 0, 0, 0, 33, 0, 0, 0, 84,
- 0, 0, 2, 23, 0, 0, 0, 33, 0, 0, 0, 69, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 2, 24, 0, 0, 0, 35,
- 0, 0, 0,135, 0, 0, 2, 25, 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 2, 25, 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 2, 26,
- 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 0,135, 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 0,137,
- 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 2, 28, 0, 0, 0, 33, 0, 0, 0, 85, 0, 0, 2, 28, 0, 0, 0, 33,
- 0, 0, 0, 85, 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 0, 71, 0, 0, 2, 30,
- 0, 0, 0, 35, 0, 0, 0,137, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 0, 70, 0, 0, 2, 31, 0, 0, 0, 35, 0, 0, 0,136,
- 0, 0, 2, 31, 0, 0, 0, 35, 0, 0, 0, 68, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 0,136, 0, 0, 2, 32, 0, 0, 0, 35,
- 0, 0, 0, 68, 0, 0, 2, 33, 0, 0, 0, 33, 0, 0, 0, 70, 0, 0, 2, 33, 0, 0, 0, 33, 0, 0, 0, 86, 0, 0, 2, 34,
- 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 2, 34, 0, 0, 0, 35, 0, 0, 0, 73, 0, 0, 2, 35, 0, 0, 0, 33, 0, 0, 0, 86,
- 0, 0, 2, 35, 0, 0, 0, 33, 0, 0, 0, 73, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 2, 36, 0, 0, 0, 35,
- 0, 0, 0,138, 0, 0, 2, 37, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 2, 37, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 2, 38,
- 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 0,138, 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 0,140,
- 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 2, 40, 0, 0, 0, 33, 0, 0, 0, 87, 0, 0, 2, 40, 0, 0, 0, 33,
- 0, 0, 0, 87, 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 0, 75, 0, 0, 2, 42,
- 0, 0, 0, 35, 0, 0, 0,140, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 0, 74, 0, 0, 2, 43, 0, 0, 0, 35, 0, 0, 0,139,
- 0, 0, 2, 43, 0, 0, 0, 35, 0, 0, 0, 72, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 0,139, 0, 0, 2, 44, 0, 0, 0, 35,
- 0, 0, 0, 72, 0, 0, 2, 45, 0, 0, 0, 33, 0, 0, 0, 74, 0, 0, 2, 45, 0, 0, 0, 33, 0, 0, 0, 88, 0, 0, 2, 46,
- 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 2, 46, 0, 0, 0, 35, 0, 0, 0, 77, 0, 0, 2, 47, 0, 0, 0, 33, 0, 0, 0, 88,
- 0, 0, 2, 47, 0, 0, 0, 33, 0, 0, 0, 77, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 2, 48, 0, 0, 0, 35,
- 0, 0, 0,141, 0, 0, 2, 49, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 2, 49, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 2, 50,
- 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 0,141, 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 0,143,
- 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 2, 52, 0, 0, 0, 33, 0, 0, 0, 89, 0, 0, 2, 52, 0, 0, 0, 33,
- 0, 0, 0, 89, 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 0, 79, 0, 0, 2, 54,
- 0, 0, 0, 35, 0, 0, 0,143, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 0, 78, 0, 0, 2, 55, 0, 0, 0, 35, 0, 0, 0,142,
- 0, 0, 2, 55, 0, 0, 0, 35, 0, 0, 0, 76, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 0,142, 0, 0, 2, 56, 0, 0, 0, 35,
- 0, 0, 0, 76, 0, 0, 2, 57, 0, 0, 0, 33, 0, 0, 0, 78, 0, 0, 2, 57, 0, 0, 0, 33, 0, 0, 0, 90, 0, 0, 2, 58,
- 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 2, 58, 0, 0, 0, 35, 0, 0, 0, 81, 0, 0, 2, 59, 0, 0, 0, 33, 0, 0, 0, 90,
- 0, 0, 2, 59, 0, 0, 0, 33, 0, 0, 0, 81, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 2, 60, 0, 0, 0, 35,
- 0, 0, 0,144, 0, 0, 2, 61, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 2, 61, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 2, 62,
- 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 0,144, 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 0,146,
- 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 2, 64, 0, 0, 0, 33, 0, 0, 0, 91, 0, 0, 2, 64, 0, 0, 0, 33,
- 0, 0, 0, 91, 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 0, 63, 0, 0, 2, 66,
- 0, 0, 0, 35, 0, 0, 0,146, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 0, 62, 0, 0, 2, 67, 0, 0, 0, 35, 0, 0, 0,145,
- 0, 0, 2, 67, 0, 0, 0, 35, 0, 0, 0, 80, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 0,145, 0, 0, 2, 68, 0, 0, 0, 35,
- 0, 0, 0, 62, 0, 0, 2, 69, 0, 0, 0, 33, 0, 0, 0, 80, 0, 0, 2, 69, 0, 0, 0, 33, 0, 0, 0, 94, 0, 0, 2, 70,
- 0, 0, 0, 35, 0, 0, 0,147, 0, 0, 2, 70, 0, 0, 0, 35, 0, 0, 0, 82, 0, 0, 2, 71, 0, 0, 0, 33, 0, 0, 0, 94,
- 0, 0, 2, 71, 0, 0, 0, 33, 0, 0, 0, 82, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 0,147, 0, 0, 2, 72, 0, 0, 0, 35,
- 0, 0, 0,147, 0, 0, 2, 73, 0, 0, 0, 35, 0, 0, 0,148, 0, 0, 2, 73, 0, 0, 0, 35, 0, 0, 0,148, 0, 0, 2, 74,
- 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 2, 74, 0, 0, 0, 35, 0, 0, 0,147, 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 0,149,
- 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 2, 76, 0, 0, 0, 33, 0, 0, 0, 95, 0, 0, 2, 76, 0, 0, 0, 33,
- 0, 0, 0, 95, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 2, 78,
- 0, 0, 0, 35, 0, 0, 0,149, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 0, 92, 0, 0, 2, 79, 0, 0, 0, 35, 0, 0, 0,148,
- 0, 0, 2, 79, 0, 0, 0, 35, 0, 0, 0, 83, 0, 0, 2, 80, 0, 0, 0, 35, 0, 0, 0,148, 0, 0, 2, 80, 0, 0, 0, 35,
- 0, 0, 0, 83, 0, 0, 2, 81, 0, 0, 0, 33, 0, 0, 0, 92, 0, 0, 2, 81, 0, 0, 0, 33, 0, 0, 0, 96, 0, 0, 2, 82,
- 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 2, 82, 0, 0, 0, 35, 0, 0, 0, 85, 0, 0, 2, 83, 0, 0, 0, 33, 0, 0, 0, 96,
- 0, 0, 2, 83, 0, 0, 0, 33, 0, 0, 0, 85, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 2, 84, 0, 0, 0, 35,
- 0, 0, 0,150, 0, 0, 2, 85, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 2, 85, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 2, 86,
- 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 2, 86, 0, 0, 0, 35, 0, 0, 0,150, 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 0,152,
- 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 2, 88, 0, 0, 0, 33, 0, 0, 0, 97, 0, 0, 2, 88, 0, 0, 0, 33,
- 0, 0, 0, 97, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 0, 95, 0, 0, 2, 90,
- 0, 0, 0, 35, 0, 0, 0,152, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 0, 94, 0, 0, 2, 91, 0, 0, 0, 35, 0, 0, 0,151,
- 0, 0, 2, 91, 0, 0, 0, 35, 0, 0, 0, 84, 0, 0, 2, 92, 0, 0, 0, 35, 0, 0, 0,151, 0, 0, 2, 92, 0, 0, 0, 35,
- 0, 0, 0, 84, 0, 0, 2, 93, 0, 0, 0, 33, 0, 0, 0, 94, 0, 0, 2, 93, 0, 0, 0, 33, 0, 0, 0, 98, 0, 0, 2, 94,
- 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 2, 94, 0, 0, 0, 35, 0, 0, 0, 87, 0, 0, 2, 95, 0, 0, 0, 33, 0, 0, 0, 98,
- 0, 0, 2, 95, 0, 0, 0, 33, 0, 0, 0, 87, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 2, 96, 0, 0, 0, 35,
- 0, 0, 0,153, 0, 0, 2, 97, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 2, 97, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 2, 98,
- 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 2, 98, 0, 0, 0, 35, 0, 0, 0,153, 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 0,155,
- 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 2,100, 0, 0, 0, 33, 0, 0, 0, 99, 0, 0, 2,100, 0, 0, 0, 33,
- 0, 0, 0, 99, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 0, 97, 0, 0, 2,102,
- 0, 0, 0, 35, 0, 0, 0,155, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 0, 96, 0, 0, 2,103, 0, 0, 0, 35, 0, 0, 0,154,
- 0, 0, 2,103, 0, 0, 0, 35, 0, 0, 0, 86, 0, 0, 2,104, 0, 0, 0, 35, 0, 0, 0,154, 0, 0, 2,104, 0, 0, 0, 35,
- 0, 0, 0, 86, 0, 0, 2,105, 0, 0, 0, 33, 0, 0, 0, 96, 0, 0, 2,105, 0, 0, 0, 33, 0, 0, 0,100, 0, 0, 2,106,
- 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 2,106, 0, 0, 0, 35, 0, 0, 0, 89, 0, 0, 2,107, 0, 0, 0, 33, 0, 0, 0,100,
- 0, 0, 2,107, 0, 0, 0, 33, 0, 0, 0, 89, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 2,108, 0, 0, 0, 35,
- 0, 0, 0,156, 0, 0, 2,109, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 2,109, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 2,110,
- 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 2,110, 0, 0, 0, 35, 0, 0, 0,156, 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 0,158,
- 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 0, 99, 0, 0, 2,112, 0, 0, 0, 33, 0, 0, 0,101, 0, 0, 2,112, 0, 0, 0, 33,
- 0, 0, 0,101, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 0, 99, 0, 0, 2,114,
- 0, 0, 0, 35, 0, 0, 0,158, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 0, 98, 0, 0, 2,115, 0, 0, 0, 35, 0, 0, 0,157,
- 0, 0, 2,115, 0, 0, 0, 35, 0, 0, 0, 88, 0, 0, 2,116, 0, 0, 0, 35, 0, 0, 0,157, 0, 0, 2,116, 0, 0, 0, 35,
- 0, 0, 0, 88, 0, 0, 2,117, 0, 0, 0, 33, 0, 0, 0, 98, 0, 0, 2,117, 0, 0, 0, 33, 0, 0, 0, 92, 0, 0, 2,118,
- 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 2,118, 0, 0, 0, 35, 0, 0, 0, 91, 0, 0, 2,119, 0, 0, 0, 33, 0, 0, 0, 92,
- 0, 0, 2,119, 0, 0, 0, 33, 0, 0, 0, 91, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 2,120, 0, 0, 0, 35,
- 0, 0, 0,159, 0, 0, 2,121, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 2,121, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 2,122,
- 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 2,122, 0, 0, 0, 35, 0, 0, 0,159, 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 0,161,
- 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 0, 93, 0, 0, 2,124, 0, 0, 0, 33, 0, 0, 0,101, 0, 0, 2,124, 0, 0, 0, 33,
- 0, 0, 0, 93, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 0,101, 0, 0, 2,126,
- 0, 0, 0, 35, 0, 0, 0,161, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 0,100, 0, 0, 2,127, 0, 0, 0, 35, 0, 0, 0,160,
- 0, 0, 2,127, 0, 0, 0, 35, 0, 0, 0, 90, 0, 0, 2,128, 0, 0, 0, 35, 0, 0, 0,160, 0, 0, 2,128, 0, 0, 0, 35,
- 0, 0, 0, 90, 0, 0, 2,129, 0, 0, 0, 33, 0, 0, 0,100, 0, 0, 2,129, 0, 0, 0, 33, 0, 0, 1, 27, 0, 0, 1,146,
- 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1,146, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1, 27, 0, 0, 0, 35, 0, 0, 1,146,
- 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1,146, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 1,147, 0, 0, 1,148, 0, 0, 0, 35,
- 0, 0, 0,165, 0, 0, 1, 26, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 1,148, 0, 0, 0, 35, 0, 0, 1, 26, 0, 0, 1,148,
- 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 0,170, 0, 0, 0, 35, 0, 0, 0,170,
- 0, 0, 1,147, 0, 0, 0, 35, 0, 0, 1, 26, 0, 0, 1,149, 0, 0, 0, 35, 0, 0, 1, 28, 0, 0, 1,149, 0, 0, 0, 35,
- 0, 0, 1, 26, 0, 0, 1, 28, 0, 0, 0, 35, 0, 0, 1,149, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 1,149, 0, 0, 1,151,
- 0, 0, 0, 35, 0, 0, 1,150, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1, 27, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 1, 31,
- 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1, 27, 0, 0, 1,151, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 1,150, 0, 0, 0, 35,
- 0, 0, 1, 29, 0, 0, 1, 30, 0, 0, 0, 35, 0, 0, 1, 29, 0, 0, 1,150, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 1,152,
- 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 1,152, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0, 35, 0, 0, 1,152,
- 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 1,152, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 1,153, 0, 0, 1,154, 0, 0, 0, 35,
- 0, 0, 0,169, 0, 0, 1, 30, 0, 0, 0, 35, 0, 0, 1, 30, 0, 0, 1,154, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 1,154,
- 0, 0, 0, 35, 0, 0, 1, 31, 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 1, 31, 0, 0, 0, 35, 0, 0, 0,173,
- 0, 0, 1,153, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 1,155, 0, 0, 0, 35, 0, 0, 1, 29, 0, 0, 1,155, 0, 0, 0, 35,
- 0, 0, 0,167, 0, 0, 1, 29, 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 1,155, 0, 0, 1,157,
- 0, 0, 0, 35, 0, 0, 1,156, 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,166, 0, 0, 0, 35, 0, 0, 0,162,
- 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 1,157, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1,156, 0, 0, 0, 35,
- 0, 0, 0,163, 0, 0, 1, 28, 0, 0, 0, 35, 0, 0, 1, 28, 0, 0, 1,156, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1,158,
- 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1,158, 0, 0, 0, 35, 0, 0, 1,158,
- 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 1,159, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 1,158, 0, 0, 1,160, 0, 0, 0, 35,
- 0, 0, 0,165, 0, 0, 1, 32, 0, 0, 0, 35, 0, 0, 1, 32, 0, 0, 1,160, 0, 0, 0, 35, 0, 0, 0,165, 0, 0, 1,160,
- 0, 0, 0, 35, 0, 0, 0,164, 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 1,159, 0, 0, 0, 35, 0, 0, 0,164,
- 0, 0, 0,178, 0, 0, 0, 35, 0, 0, 1, 32, 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 1, 32, 0, 0, 1, 34, 0, 0, 0, 35,
- 0, 0, 1, 34, 0, 0, 1,161, 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 1,162, 0, 0, 1,163,
- 0, 0, 0, 35, 0, 0, 1,161, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1, 33, 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 1, 33,
- 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1, 37, 0, 0, 1,163, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 1,162, 0, 0, 0, 35,
- 0, 0, 1, 35, 0, 0, 1,162, 0, 0, 0, 35, 0, 0, 1, 35, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 1,164,
- 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 1,164, 0, 0, 0, 35, 0, 0, 1,164,
- 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 1,165, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 0, 35,
- 0, 0, 0,177, 0, 0, 1, 36, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 1,166, 0, 0, 0, 35, 0, 0, 1, 36, 0, 0, 1,166,
- 0, 0, 0, 35, 0, 0, 1, 37, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1,165, 0, 0, 0, 35, 0, 0, 0,181,
- 0, 0, 1, 37, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 1, 35, 0, 0, 0, 35,
- 0, 0, 1, 35, 0, 0, 1,167, 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 1,168, 0, 0, 1,169,
- 0, 0, 0, 35, 0, 0, 1,167, 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 0,174, 0, 0, 0, 35, 0, 0, 0,174,
- 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 0,162, 0, 0, 1,169, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1,168, 0, 0, 0, 35,
- 0, 0, 1, 34, 0, 0, 1,168, 0, 0, 0, 35, 0, 0, 0,163, 0, 0, 1, 34, 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 1,170,
- 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1,170, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1, 39, 0, 0, 0, 35, 0, 0, 1,170,
- 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1,170, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1,171, 0, 0, 1,172, 0, 0, 0, 35,
- 0, 0, 0,169, 0, 0, 1, 38, 0, 0, 0, 35, 0, 0, 0,169, 0, 0, 1,172, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 1,172,
- 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 0,168, 0, 0, 0,186, 0, 0, 0, 35, 0, 0, 0,186,
- 0, 0, 1,171, 0, 0, 0, 35, 0, 0, 1, 38, 0, 0, 1,173, 0, 0, 0, 35, 0, 0, 1, 40, 0, 0, 1,173, 0, 0, 0, 35,
- 0, 0, 1, 38, 0, 0, 1, 40, 0, 0, 0, 35, 0, 0, 1,173, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 1,173, 0, 0, 1,175,
- 0, 0, 0, 35, 0, 0, 1,174, 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 1, 43,
- 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1, 39, 0, 0, 1,175, 0, 0, 0, 35, 0, 0, 1, 42, 0, 0, 1,174, 0, 0, 0, 35,
- 0, 0, 1, 41, 0, 0, 1, 42, 0, 0, 0, 35, 0, 0, 1, 41, 0, 0, 1,174, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 1,176,
- 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 1,176, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 0,188, 0, 0, 0, 35, 0, 0, 1,176,
- 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 1,176, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 1,177, 0, 0, 1,178, 0, 0, 0, 35,
- 0, 0, 0,185, 0, 0, 1, 42, 0, 0, 0, 35, 0, 0, 1, 42, 0, 0, 1,178, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 1,178,
- 0, 0, 0, 35, 0, 0, 1, 43, 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 1, 43, 0, 0, 0, 35, 0, 0, 0,189,
- 0, 0, 1,177, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 1,179, 0, 0, 0, 35, 0, 0, 1, 41, 0, 0, 1,179, 0, 0, 0, 35,
- 0, 0, 0,183, 0, 0, 1, 41, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 1,179, 0, 0, 1,181,
- 0, 0, 0, 35, 0, 0, 1,180, 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 0,166, 0, 0, 0,182, 0, 0, 0, 35, 0, 0, 0,166,
- 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 1,181, 0, 0, 0, 35, 0, 0, 0,167, 0, 0, 1,180, 0, 0, 0, 35,
- 0, 0, 0,167, 0, 0, 1, 40, 0, 0, 0, 35, 0, 0, 1, 40, 0, 0, 1,180, 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 1,182,
- 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1,182, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1, 45, 0, 0, 0, 35, 0, 0, 1,182,
- 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 1,182, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1,183, 0, 0, 1,184, 0, 0, 0, 35,
- 0, 0, 0,185, 0, 0, 1, 44, 0, 0, 0, 35, 0, 0, 0,185, 0, 0, 1,184, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 1,184,
- 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 0,184, 0, 0, 0,194, 0, 0, 0, 35, 0, 0, 0,194,
- 0, 0, 1,183, 0, 0, 0, 35, 0, 0, 1, 44, 0, 0, 1,185, 0, 0, 0, 35, 0, 0, 1, 46, 0, 0, 1,185, 0, 0, 0, 35,
- 0, 0, 1, 44, 0, 0, 1, 46, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 1,185, 0, 0, 1,187,
- 0, 0, 0, 35, 0, 0, 1,186, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 1, 49,
- 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 45, 0, 0, 1,187, 0, 0, 0, 35, 0, 0, 1, 48, 0, 0, 1,186, 0, 0, 0, 35,
- 0, 0, 1, 47, 0, 0, 1, 48, 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 1,186, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 1,188,
- 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 1,188, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 0,196, 0, 0, 0, 35, 0, 0, 1,188,
- 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 1,188, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 1,189, 0, 0, 1,190, 0, 0, 0, 35,
- 0, 0, 0,193, 0, 0, 1, 48, 0, 0, 0, 35, 0, 0, 1, 48, 0, 0, 1,190, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 1,190,
- 0, 0, 0, 35, 0, 0, 1, 49, 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 1, 49, 0, 0, 0, 35, 0, 0, 0,197,
- 0, 0, 1,189, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 1,191, 0, 0, 0, 35, 0, 0, 1, 47, 0, 0, 1,191, 0, 0, 0, 35,
- 0, 0, 0,191, 0, 0, 1, 47, 0, 0, 0, 35, 0, 0, 1,191, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1,191, 0, 0, 1,193,
- 0, 0, 0, 35, 0, 0, 1,192, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 0,182, 0, 0, 0,190, 0, 0, 0, 35, 0, 0, 0,182,
- 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 0,190, 0, 0, 1,193, 0, 0, 0, 35, 0, 0, 0,183, 0, 0, 1,192, 0, 0, 0, 35,
- 0, 0, 0,183, 0, 0, 1, 46, 0, 0, 0, 35, 0, 0, 1, 46, 0, 0, 1,192, 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 1,194,
- 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 1,194, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 1, 51, 0, 0, 0, 35, 0, 0, 1,194,
- 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 1,194, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 1,195, 0, 0, 1,196, 0, 0, 0, 35,
- 0, 0, 0,193, 0, 0, 1, 50, 0, 0, 0, 35, 0, 0, 0,193, 0, 0, 1,196, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 1,196,
- 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 0,192, 0, 0, 0,198, 0, 0, 0, 35, 0, 0, 0,198,
- 0, 0, 1,195, 0, 0, 0, 35, 0, 0, 1, 50, 0, 0, 1,197, 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 1,197, 0, 0, 0, 35,
- 0, 0, 1, 50, 0, 0, 1, 53, 0, 0, 0, 35, 0, 0, 1,197, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 1,197, 0, 0, 1,199,
- 0, 0, 0, 35, 0, 0, 1,198, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 1, 55,
- 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1, 51, 0, 0, 1,199, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 1,198, 0, 0, 0, 35,
- 0, 0, 1, 52, 0, 0, 1, 54, 0, 0, 0, 35, 0, 0, 1, 52, 0, 0, 1,198, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 1,200,
- 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 1,200, 0, 0, 0, 35, 0, 0, 0,176, 0, 0, 0,200, 0, 0, 0, 35, 0, 0, 1,200,
- 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 1,200, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 1,201, 0, 0, 1,202, 0, 0, 0, 35,
- 0, 0, 0,177, 0, 0, 1, 54, 0, 0, 0, 35, 0, 0, 1, 54, 0, 0, 1,202, 0, 0, 0, 35, 0, 0, 0,177, 0, 0, 1,202,
- 0, 0, 0, 35, 0, 0, 1, 55, 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 1, 55, 0, 0, 0, 35, 0, 0, 0,201,
- 0, 0, 1,201, 0, 0, 0, 35, 0, 0, 0,175, 0, 0, 1,203, 0, 0, 0, 35, 0, 0, 1, 52, 0, 0, 1,203, 0, 0, 0, 35,
- 0, 0, 0,175, 0, 0, 1, 52, 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 1,203, 0, 0, 1,205,
- 0, 0, 0, 35, 0, 0, 1,204, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 0,190, 0, 0, 0, 35, 0, 0, 0,190,
- 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 0,174, 0, 0, 1,205, 0, 0, 0, 35, 0, 0, 0,191, 0, 0, 1,204, 0, 0, 0, 35,
- 0, 0, 0,191, 0, 0, 1, 53, 0, 0, 0, 35, 0, 0, 1, 53, 0, 0, 1,204, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1,206,
- 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 1, 57, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 1,206, 0, 0, 0, 35, 0, 0, 1,206,
- 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 1,207, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 1,206, 0, 0, 1,208, 0, 0, 0, 35,
- 0, 0, 0,179, 0, 0, 1, 56, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 1,208, 0, 0, 0, 35, 0, 0, 0,179, 0, 0, 1,208,
- 0, 0, 0, 35, 0, 0, 0,178, 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 1,207, 0, 0, 0, 35, 0, 0, 0,178,
- 0, 0, 0,206, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 1, 56, 0, 0, 1, 58, 0, 0, 0, 35,
- 0, 0, 1, 58, 0, 0, 1,209, 0, 0, 0, 35, 0, 0, 1,209, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1,210, 0, 0, 1,211,
- 0, 0, 0, 35, 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1, 57, 0, 0, 1, 61, 0, 0, 0, 35, 0, 0, 1, 57,
- 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1,211, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1,210, 0, 0, 0, 35,
- 0, 0, 1, 59, 0, 0, 1,210, 0, 0, 0, 35, 0, 0, 1, 59, 0, 0, 1, 60, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 1,212,
- 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 0,208, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 1,212, 0, 0, 0, 35, 0, 0, 1,212,
- 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 1,213, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 35,
- 0, 0, 0,205, 0, 0, 1, 60, 0, 0, 0, 35, 0, 0, 0,205, 0, 0, 1,214, 0, 0, 0, 35, 0, 0, 1, 60, 0, 0, 1,214,
- 0, 0, 0, 35, 0, 0, 1, 61, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 1,213, 0, 0, 0, 35, 0, 0, 0,209,
- 0, 0, 1, 61, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 1, 59, 0, 0, 0, 35,
- 0, 0, 1, 59, 0, 0, 1,215, 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 1,216, 0, 0, 1,217,
- 0, 0, 0, 35, 0, 0, 1,215, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 0,202, 0, 0, 0, 35, 0, 0, 0,202,
- 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 0,180, 0, 0, 1,217, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1,216, 0, 0, 0, 35,
- 0, 0, 1, 58, 0, 0, 1,216, 0, 0, 0, 35, 0, 0, 0,181, 0, 0, 1, 58, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1,218,
- 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 1, 63, 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 1,218, 0, 0, 0, 35, 0, 0, 1,218,
- 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 1,219, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 1,218, 0, 0, 1,220, 0, 0, 0, 35,
- 0, 0, 0,173, 0, 0, 1, 62, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1,220, 0, 0, 0, 35, 0, 0, 0,173, 0, 0, 1,220,
- 0, 0, 0, 35, 0, 0, 0,172, 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 1,219, 0, 0, 0, 35, 0, 0, 0,172,
- 0, 0, 0,214, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 0, 35,
- 0, 0, 1, 64, 0, 0, 1,221, 0, 0, 0, 35, 0, 0, 1,221, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1,222, 0, 0, 1,223,
- 0, 0, 0, 35, 0, 0, 1,221, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1, 63, 0, 0, 1, 67, 0, 0, 0, 35, 0, 0, 1, 63,
- 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 1,223, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,222, 0, 0, 0, 35,
- 0, 0, 1, 65, 0, 0, 1,222, 0, 0, 0, 35, 0, 0, 1, 65, 0, 0, 1, 66, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 1,224,
- 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 0,216, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 1,224, 0, 0, 0, 35, 0, 0, 1,224,
- 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 1,225, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1,224, 0, 0, 1,226, 0, 0, 0, 35,
- 0, 0, 0,213, 0, 0, 1, 66, 0, 0, 0, 35, 0, 0, 0,213, 0, 0, 1,226, 0, 0, 0, 35, 0, 0, 1, 66, 0, 0, 1,226,
- 0, 0, 0, 35, 0, 0, 1, 67, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 1,225, 0, 0, 0, 35, 0, 0, 0,217,
- 0, 0, 1, 67, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 1, 65, 0, 0, 0, 35,
- 0, 0, 1, 65, 0, 0, 1,227, 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 1,228, 0, 0, 0, 35, 0, 0, 1,228, 0, 0, 1,229,
- 0, 0, 0, 35, 0, 0, 1,227, 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0,210,
- 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 0,170, 0, 0, 1,229, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1,228, 0, 0, 0, 35,
- 0, 0, 1, 64, 0, 0, 1,228, 0, 0, 0, 35, 0, 0, 0,171, 0, 0, 1, 64, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 1,230,
- 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 1, 69, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 1,230, 0, 0, 0, 35, 0, 0, 1,230,
- 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 1,231, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 1,230, 0, 0, 1,232, 0, 0, 0, 35,
- 0, 0, 0,189, 0, 0, 1, 68, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 1,232, 0, 0, 0, 35, 0, 0, 0,189, 0, 0, 1,232,
- 0, 0, 0, 35, 0, 0, 0,188, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 1,231, 0, 0, 0, 35, 0, 0, 0,188,
- 0, 0, 0,222, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 1, 68, 0, 0, 1, 70, 0, 0, 0, 35,
- 0, 0, 1, 70, 0, 0, 1,233, 0, 0, 0, 35, 0, 0, 1,233, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 1,234, 0, 0, 1,235,
- 0, 0, 0, 35, 0, 0, 1,233, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1, 69, 0, 0, 1, 73, 0, 0, 0, 35, 0, 0, 1, 69,
- 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1, 73, 0, 0, 1,235, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 1,234, 0, 0, 0, 35,
- 0, 0, 1, 71, 0, 0, 1,234, 0, 0, 0, 35, 0, 0, 1, 71, 0, 0, 1, 72, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 1,236,
- 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 0,224, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 1,236, 0, 0, 0, 35, 0, 0, 1,236,
- 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 1,237, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1,236, 0, 0, 1,238, 0, 0, 0, 35,
- 0, 0, 0,221, 0, 0, 1, 72, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 1,238, 0, 0, 0, 35, 0, 0, 1, 72, 0, 0, 1,238,
- 0, 0, 0, 35, 0, 0, 1, 73, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 1,237, 0, 0, 0, 35, 0, 0, 0,225,
- 0, 0, 1, 73, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 1, 71, 0, 0, 0, 35,
- 0, 0, 1, 71, 0, 0, 1,239, 0, 0, 0, 35, 0, 0, 1,239, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 1,240, 0, 0, 1,241,
- 0, 0, 0, 35, 0, 0, 1,239, 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 0,186, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0,218,
- 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 0,186, 0, 0, 1,241, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1,240, 0, 0, 0, 35,
- 0, 0, 1, 70, 0, 0, 1,240, 0, 0, 0, 35, 0, 0, 0,187, 0, 0, 1, 70, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 1,242,
- 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 1, 75, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 1,242, 0, 0, 0, 35, 0, 0, 1,242,
- 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 1,243, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 1,242, 0, 0, 1,244, 0, 0, 0, 35,
- 0, 0, 0,197, 0, 0, 1, 74, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 1,244, 0, 0, 0, 35, 0, 0, 0,197, 0, 0, 1,244,
- 0, 0, 0, 35, 0, 0, 0,196, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 1,243, 0, 0, 0, 35, 0, 0, 0,196,
- 0, 0, 0,230, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1, 74, 0, 0, 1, 76, 0, 0, 0, 35,
- 0, 0, 1, 76, 0, 0, 1,245, 0, 0, 0, 35, 0, 0, 1,245, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1,246, 0, 0, 1,247,
- 0, 0, 0, 35, 0, 0, 1,245, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 75, 0, 0, 1, 79, 0, 0, 0, 35, 0, 0, 1, 75,
- 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 1,247, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 1,246, 0, 0, 0, 35,
- 0, 0, 1, 77, 0, 0, 1,246, 0, 0, 0, 35, 0, 0, 1, 77, 0, 0, 1, 78, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 1,248,
- 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0,232, 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 1,248, 0, 0, 0, 35, 0, 0, 1,248,
- 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 1,249, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1,248, 0, 0, 1,250, 0, 0, 0, 35,
- 0, 0, 0,229, 0, 0, 1, 78, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 1,250, 0, 0, 0, 35, 0, 0, 1, 78, 0, 0, 1,250,
- 0, 0, 0, 35, 0, 0, 1, 79, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 1,249, 0, 0, 0, 35, 0, 0, 0,233,
- 0, 0, 1, 79, 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 1,251, 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 1, 77, 0, 0, 0, 35,
- 0, 0, 1, 77, 0, 0, 1,251, 0, 0, 0, 35, 0, 0, 1,251, 0, 0, 1,252, 0, 0, 0, 35, 0, 0, 1,252, 0, 0, 1,253,
- 0, 0, 0, 35, 0, 0, 1,251, 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 0,226, 0, 0, 0, 35, 0, 0, 0,226,
- 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 0,194, 0, 0, 1,253, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1,252, 0, 0, 0, 35,
- 0, 0, 1, 76, 0, 0, 1,252, 0, 0, 0, 35, 0, 0, 0,195, 0, 0, 1, 76, 0, 0, 0, 35, 0, 0, 1, 81, 0, 0, 1,254,
- 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1, 81, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 1,254, 0, 0, 0, 35, 0, 0, 1,254,
- 0, 0, 1,255, 0, 0, 0, 35, 0, 0, 1,255, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 1,254, 0, 0, 2, 0, 0, 0, 0, 35,
- 0, 0, 0,201, 0, 0, 1, 80, 0, 0, 0, 35, 0, 0, 1, 80, 0, 0, 2, 0, 0, 0, 0, 35, 0, 0, 0,201, 0, 0, 2, 0,
- 0, 0, 0, 35, 0, 0, 0,200, 0, 0, 1,255, 0, 0, 0, 35, 0, 0, 0,238, 0, 0, 1,255, 0, 0, 0, 35, 0, 0, 0,200,
- 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 1, 80, 0, 0, 2, 1, 0, 0, 0, 35, 0, 0, 1, 80, 0, 0, 1, 82, 0, 0, 0, 35,
- 0, 0, 1, 82, 0, 0, 2, 1, 0, 0, 0, 35, 0, 0, 2, 1, 0, 0, 2, 2, 0, 0, 0, 35, 0, 0, 2, 2, 0, 0, 2, 3,
- 0, 0, 0, 35, 0, 0, 2, 1, 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 1, 81, 0, 0, 1, 85, 0, 0, 0, 35, 0, 0, 1, 81,
- 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 1, 85, 0, 0, 2, 3, 0, 0, 0, 35, 0, 0, 1, 84, 0, 0, 2, 2, 0, 0, 0, 35,
- 0, 0, 1, 83, 0, 0, 2, 2, 0, 0, 0, 35, 0, 0, 1, 83, 0, 0, 1, 84, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 2, 4,
- 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 0,240, 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 2, 4, 0, 0, 0, 35, 0, 0, 2, 4,
- 0, 0, 2, 5, 0, 0, 0, 35, 0, 0, 2, 5, 0, 0, 2, 6, 0, 0, 0, 35, 0, 0, 2, 4, 0, 0, 2, 6, 0, 0, 0, 35,
- 0, 0, 0,237, 0, 0, 1, 84, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 2, 6, 0, 0, 0, 35, 0, 0, 1, 84, 0, 0, 2, 6,
- 0, 0, 0, 35, 0, 0, 1, 85, 0, 0, 2, 5, 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 2, 5, 0, 0, 0, 35, 0, 0, 0,241,
- 0, 0, 1, 85, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 2, 7, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 1, 83, 0, 0, 0, 35,
- 0, 0, 1, 83, 0, 0, 2, 7, 0, 0, 0, 35, 0, 0, 2, 7, 0, 0, 2, 8, 0, 0, 0, 35, 0, 0, 2, 8, 0, 0, 2, 9,
- 0, 0, 0, 35, 0, 0, 2, 7, 0, 0, 2, 9, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0,234,
- 0, 0, 2, 9, 0, 0, 0, 35, 0, 0, 0,198, 0, 0, 2, 9, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 2, 8, 0, 0, 0, 35,
- 0, 0, 1, 82, 0, 0, 2, 8, 0, 0, 0, 35, 0, 0, 0,199, 0, 0, 1, 82, 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 2, 10,
- 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 2, 10, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 1, 87, 0, 0, 0, 35, 0, 0, 2, 10,
- 0, 0, 2, 11, 0, 0, 0, 35, 0, 0, 2, 10, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 2, 11, 0, 0, 2, 12, 0, 0, 0, 35,
- 0, 0, 0,209, 0, 0, 1, 86, 0, 0, 0, 35, 0, 0, 0,209, 0, 0, 2, 12, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 2, 12,
- 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 2, 11, 0, 0, 0, 35, 0, 0, 0,208, 0, 0, 0,244, 0, 0, 0, 35, 0, 0, 0,244,
- 0, 0, 2, 11, 0, 0, 0, 35, 0, 0, 1, 86, 0, 0, 2, 13, 0, 0, 0, 35, 0, 0, 1, 88, 0, 0, 2, 13, 0, 0, 0, 35,
- 0, 0, 1, 86, 0, 0, 1, 88, 0, 0, 0, 35, 0, 0, 2, 13, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 2, 13, 0, 0, 2, 15,
- 0, 0, 0, 35, 0, 0, 2, 14, 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 1, 91,
- 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 1, 87, 0, 0, 2, 15, 0, 0, 0, 35, 0, 0, 1, 90, 0, 0, 2, 14, 0, 0, 0, 35,
- 0, 0, 1, 89, 0, 0, 1, 90, 0, 0, 0, 35, 0, 0, 1, 89, 0, 0, 2, 14, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 2, 16,
- 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 2, 16, 0, 0, 0, 35, 0, 0, 0,212, 0, 0, 0,242, 0, 0, 0, 35, 0, 0, 2, 16,
- 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 2, 16, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 2, 17, 0, 0, 2, 18, 0, 0, 0, 35,
- 0, 0, 0,213, 0, 0, 1, 90, 0, 0, 0, 35, 0, 0, 1, 90, 0, 0, 2, 18, 0, 0, 0, 35, 0, 0, 0,213, 0, 0, 2, 18,
- 0, 0, 0, 35, 0, 0, 1, 91, 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 1, 91, 0, 0, 0, 35, 0, 0, 0,243,
- 0, 0, 2, 17, 0, 0, 0, 35, 0, 0, 0,211, 0, 0, 2, 19, 0, 0, 0, 35, 0, 0, 1, 89, 0, 0, 2, 19, 0, 0, 0, 35,
- 0, 0, 0,211, 0, 0, 1, 89, 0, 0, 0, 35, 0, 0, 2, 19, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 2, 19, 0, 0, 2, 21,
- 0, 0, 0, 35, 0, 0, 2, 20, 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 0,206, 0, 0, 0,210, 0, 0, 0, 35, 0, 0, 0,206,
- 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 0,210, 0, 0, 2, 21, 0, 0, 0, 35, 0, 0, 0,207, 0, 0, 2, 20, 0, 0, 0, 35,
- 0, 0, 0,207, 0, 0, 1, 88, 0, 0, 0, 35, 0, 0, 1, 88, 0, 0, 2, 20, 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 2, 22,
- 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 2, 22, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 1, 93, 0, 0, 0, 35, 0, 0, 2, 22,
- 0, 0, 2, 23, 0, 0, 0, 35, 0, 0, 2, 22, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 2, 23, 0, 0, 2, 24, 0, 0, 0, 35,
- 0, 0, 0,217, 0, 0, 1, 92, 0, 0, 0, 35, 0, 0, 0,217, 0, 0, 2, 24, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 2, 24,
- 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 2, 23, 0, 0, 0, 35, 0, 0, 0,216, 0, 0, 0,246, 0, 0, 0, 35, 0, 0, 0,246,
- 0, 0, 2, 23, 0, 0, 0, 35, 0, 0, 1, 92, 0, 0, 2, 25, 0, 0, 0, 35, 0, 0, 1, 94, 0, 0, 2, 25, 0, 0, 0, 35,
- 0, 0, 1, 92, 0, 0, 1, 94, 0, 0, 0, 35, 0, 0, 2, 25, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 2, 25, 0, 0, 2, 27,
- 0, 0, 0, 35, 0, 0, 2, 26, 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 1, 97,
- 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 1, 93, 0, 0, 2, 27, 0, 0, 0, 35, 0, 0, 1, 96, 0, 0, 2, 26, 0, 0, 0, 35,
- 0, 0, 1, 95, 0, 0, 1, 96, 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 2, 26, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 2, 28,
- 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 2, 28, 0, 0, 0, 35, 0, 0, 0,220, 0, 0, 0,248, 0, 0, 0, 35, 0, 0, 2, 28,
- 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 2, 28, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 2, 29, 0, 0, 2, 30, 0, 0, 0, 35,
- 0, 0, 0,221, 0, 0, 1, 96, 0, 0, 0, 35, 0, 0, 1, 96, 0, 0, 2, 30, 0, 0, 0, 35, 0, 0, 0,221, 0, 0, 2, 30,
- 0, 0, 0, 35, 0, 0, 1, 97, 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 1, 97, 0, 0, 0, 35, 0, 0, 0,249,
- 0, 0, 2, 29, 0, 0, 0, 35, 0, 0, 0,219, 0, 0, 2, 31, 0, 0, 0, 35, 0, 0, 1, 95, 0, 0, 2, 31, 0, 0, 0, 35,
- 0, 0, 0,219, 0, 0, 1, 95, 0, 0, 0, 35, 0, 0, 2, 31, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 2, 31, 0, 0, 2, 33,
- 0, 0, 0, 35, 0, 0, 2, 32, 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 0,214, 0, 0, 0,218, 0, 0, 0, 35, 0, 0, 0,214,
- 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 0,218, 0, 0, 2, 33, 0, 0, 0, 35, 0, 0, 0,215, 0, 0, 2, 32, 0, 0, 0, 35,
- 0, 0, 0,215, 0, 0, 1, 94, 0, 0, 0, 35, 0, 0, 1, 94, 0, 0, 2, 32, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 2, 34,
- 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 2, 34, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 1, 99, 0, 0, 0, 35, 0, 0, 2, 34,
- 0, 0, 2, 35, 0, 0, 0, 35, 0, 0, 2, 34, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 2, 35, 0, 0, 2, 36, 0, 0, 0, 35,
- 0, 0, 0,225, 0, 0, 1, 98, 0, 0, 0, 35, 0, 0, 0,225, 0, 0, 2, 36, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 2, 36,
- 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 2, 35, 0, 0, 0, 35, 0, 0, 0,224, 0, 0, 0,250, 0, 0, 0, 35, 0, 0, 0,250,
- 0, 0, 2, 35, 0, 0, 0, 35, 0, 0, 1, 98, 0, 0, 2, 37, 0, 0, 0, 35, 0, 0, 1,100, 0, 0, 2, 37, 0, 0, 0, 35,
- 0, 0, 1, 98, 0, 0, 1,100, 0, 0, 0, 35, 0, 0, 2, 37, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 2, 37, 0, 0, 2, 39,
- 0, 0, 0, 35, 0, 0, 2, 38, 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 1,103,
- 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 1, 99, 0, 0, 2, 39, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 2, 38, 0, 0, 0, 35,
- 0, 0, 1,101, 0, 0, 1,102, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 2, 38, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 2, 40,
- 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 2, 40, 0, 0, 0, 35, 0, 0, 0,228, 0, 0, 0,252, 0, 0, 0, 35, 0, 0, 2, 40,
- 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 2, 40, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 2, 41, 0, 0, 2, 42, 0, 0, 0, 35,
- 0, 0, 0,229, 0, 0, 1,102, 0, 0, 0, 35, 0, 0, 1,102, 0, 0, 2, 42, 0, 0, 0, 35, 0, 0, 0,229, 0, 0, 2, 42,
- 0, 0, 0, 35, 0, 0, 1,103, 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 1,103, 0, 0, 0, 35, 0, 0, 0,253,
- 0, 0, 2, 41, 0, 0, 0, 35, 0, 0, 0,227, 0, 0, 2, 43, 0, 0, 0, 35, 0, 0, 1,101, 0, 0, 2, 43, 0, 0, 0, 35,
- 0, 0, 0,227, 0, 0, 1,101, 0, 0, 0, 35, 0, 0, 2, 43, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 2, 43, 0, 0, 2, 45,
- 0, 0, 0, 35, 0, 0, 2, 44, 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 0,222, 0, 0, 0,226, 0, 0, 0, 35, 0, 0, 0,222,
- 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 0,226, 0, 0, 2, 45, 0, 0, 0, 35, 0, 0, 0,223, 0, 0, 2, 44, 0, 0, 0, 35,
- 0, 0, 0,223, 0, 0, 1,100, 0, 0, 0, 35, 0, 0, 1,100, 0, 0, 2, 44, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 2, 46,
- 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 2, 46, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 2, 46,
- 0, 0, 2, 47, 0, 0, 0, 35, 0, 0, 2, 46, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 2, 47, 0, 0, 2, 48, 0, 0, 0, 35,
- 0, 0, 0,233, 0, 0, 1,104, 0, 0, 0, 35, 0, 0, 0,233, 0, 0, 2, 48, 0, 0, 0, 35, 0, 0, 1,104, 0, 0, 2, 48,
- 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 2, 47, 0, 0, 0, 35, 0, 0, 0,232, 0, 0, 0,254, 0, 0, 0, 35, 0, 0, 0,254,
- 0, 0, 2, 47, 0, 0, 0, 35, 0, 0, 1,104, 0, 0, 2, 49, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 2, 49, 0, 0, 0, 35,
- 0, 0, 1,104, 0, 0, 1,106, 0, 0, 0, 35, 0, 0, 2, 49, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 2, 49, 0, 0, 2, 51,
- 0, 0, 0, 35, 0, 0, 2, 50, 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1,109,
- 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 2, 51, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 2, 50, 0, 0, 0, 35,
- 0, 0, 1,107, 0, 0, 1,108, 0, 0, 0, 35, 0, 0, 1,107, 0, 0, 2, 50, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 2, 52,
- 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 2, 52, 0, 0, 0, 35, 0, 0, 0,236, 0, 0, 1, 0, 0, 0, 0, 35, 0, 0, 2, 52,
- 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 2, 52, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 2, 53, 0, 0, 2, 54, 0, 0, 0, 35,
- 0, 0, 0,237, 0, 0, 1,108, 0, 0, 0, 35, 0, 0, 1,108, 0, 0, 2, 54, 0, 0, 0, 35, 0, 0, 0,237, 0, 0, 2, 54,
- 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 1,109, 0, 0, 0, 35, 0, 0, 1, 1,
- 0, 0, 2, 53, 0, 0, 0, 35, 0, 0, 0,235, 0, 0, 2, 55, 0, 0, 0, 35, 0, 0, 1,107, 0, 0, 2, 55, 0, 0, 0, 35,
- 0, 0, 0,235, 0, 0, 1,107, 0, 0, 0, 35, 0, 0, 2, 55, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 2, 55, 0, 0, 2, 57,
- 0, 0, 0, 35, 0, 0, 2, 56, 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 0,230, 0, 0, 0,234, 0, 0, 0, 35, 0, 0, 0,230,
- 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 0,234, 0, 0, 2, 57, 0, 0, 0, 35, 0, 0, 0,231, 0, 0, 2, 56, 0, 0, 0, 35,
- 0, 0, 0,231, 0, 0, 1,106, 0, 0, 0, 35, 0, 0, 1,106, 0, 0, 2, 56, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 2, 58,
- 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 2, 58, 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 1,111, 0, 0, 0, 35, 0, 0, 2, 58,
- 0, 0, 2, 59, 0, 0, 0, 35, 0, 0, 2, 58, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 2, 59, 0, 0, 2, 60, 0, 0, 0, 35,
- 0, 0, 0,241, 0, 0, 1,110, 0, 0, 0, 35, 0, 0, 0,241, 0, 0, 2, 60, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 2, 60,
- 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 2, 59, 0, 0, 0, 35, 0, 0, 0,240, 0, 0, 1, 2, 0, 0, 0, 35, 0, 0, 1, 2,
- 0, 0, 2, 59, 0, 0, 0, 35, 0, 0, 1,110, 0, 0, 2, 61, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 2, 61, 0, 0, 0, 35,
- 0, 0, 1,110, 0, 0, 1,113, 0, 0, 0, 35, 0, 0, 2, 61, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 2, 61, 0, 0, 2, 63,
- 0, 0, 0, 35, 0, 0, 2, 62, 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 1,115,
- 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 1,111, 0, 0, 2, 63, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 2, 62, 0, 0, 0, 35,
- 0, 0, 1,112, 0, 0, 1,114, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 2, 62, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 2, 64,
- 0, 0, 0, 35, 0, 0, 1, 4, 0, 0, 2, 64, 0, 0, 0, 35, 0, 0, 0,204, 0, 0, 1, 4, 0, 0, 0, 35, 0, 0, 2, 64,
- 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 2, 64, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 2, 65, 0, 0, 2, 66, 0, 0, 0, 35,
- 0, 0, 0,205, 0, 0, 1,114, 0, 0, 0, 35, 0, 0, 1,114, 0, 0, 2, 66, 0, 0, 0, 35, 0, 0, 0,205, 0, 0, 2, 66,
- 0, 0, 0, 35, 0, 0, 1,115, 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 1,115, 0, 0, 0, 35, 0, 0, 1, 5,
- 0, 0, 2, 65, 0, 0, 0, 35, 0, 0, 0,203, 0, 0, 2, 67, 0, 0, 0, 35, 0, 0, 1,112, 0, 0, 2, 67, 0, 0, 0, 35,
- 0, 0, 0,203, 0, 0, 1,112, 0, 0, 0, 35, 0, 0, 2, 67, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 2, 67, 0, 0, 2, 69,
- 0, 0, 0, 35, 0, 0, 2, 68, 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 0,238, 0, 0, 0, 35, 0, 0, 0,238,
- 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 0,202, 0, 0, 2, 69, 0, 0, 0, 35, 0, 0, 0,239, 0, 0, 2, 68, 0, 0, 0, 35,
- 0, 0, 0,239, 0, 0, 1,113, 0, 0, 0, 35, 0, 0, 1,113, 0, 0, 2, 68, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 2, 70,
- 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 1,117, 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 2, 70, 0, 0, 0, 35, 0, 0, 2, 70,
- 0, 0, 2, 71, 0, 0, 0, 35, 0, 0, 2, 71, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 2, 70, 0, 0, 2, 72, 0, 0, 0, 35,
- 0, 0, 0,243, 0, 0, 1,116, 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 2, 72, 0, 0, 0, 35, 0, 0, 0,243, 0, 0, 2, 72,
- 0, 0, 0, 35, 0, 0, 0,242, 0, 0, 2, 71, 0, 0, 0, 35, 0, 0, 1, 10, 0, 0, 2, 71, 0, 0, 0, 35, 0, 0, 0,242,
- 0, 0, 1, 10, 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 2, 73, 0, 0, 0, 35, 0, 0, 1,116, 0, 0, 1,118, 0, 0, 0, 35,
- 0, 0, 1,118, 0, 0, 2, 73, 0, 0, 0, 35, 0, 0, 2, 73, 0, 0, 2, 74, 0, 0, 0, 35, 0, 0, 2, 74, 0, 0, 2, 75,
- 0, 0, 0, 35, 0, 0, 2, 73, 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 1,117, 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1,117,
- 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 1,121, 0, 0, 2, 75, 0, 0, 0, 35, 0, 0, 1,120, 0, 0, 2, 74, 0, 0, 0, 35,
- 0, 0, 1,119, 0, 0, 2, 74, 0, 0, 0, 35, 0, 0, 1,119, 0, 0, 1,120, 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 2, 76,
- 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 1, 12, 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 2, 76, 0, 0, 0, 35, 0, 0, 2, 76,
- 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 2, 77, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 2, 76, 0, 0, 2, 78, 0, 0, 0, 35,
- 0, 0, 1, 9, 0, 0, 1,120, 0, 0, 0, 35, 0, 0, 1, 9, 0, 0, 2, 78, 0, 0, 0, 35, 0, 0, 1,120, 0, 0, 2, 78,
- 0, 0, 0, 35, 0, 0, 1,121, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 2, 77, 0, 0, 0, 35, 0, 0, 1, 13,
- 0, 0, 1,121, 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 2, 79, 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 1,119, 0, 0, 0, 35,
- 0, 0, 1,119, 0, 0, 2, 79, 0, 0, 0, 35, 0, 0, 2, 79, 0, 0, 2, 80, 0, 0, 0, 35, 0, 0, 2, 80, 0, 0, 2, 81,
- 0, 0, 0, 35, 0, 0, 2, 79, 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 1, 6, 0, 0, 0, 35, 0, 0, 1, 6,
- 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 0,244, 0, 0, 2, 81, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 2, 80, 0, 0, 0, 35,
- 0, 0, 1,118, 0, 0, 2, 80, 0, 0, 0, 35, 0, 0, 0,245, 0, 0, 1,118, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 2, 82,
- 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 1,123, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 2, 82, 0, 0, 0, 35, 0, 0, 2, 82,
- 0, 0, 2, 83, 0, 0, 0, 35, 0, 0, 2, 83, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 2, 82, 0, 0, 2, 84, 0, 0, 0, 35,
- 0, 0, 0,249, 0, 0, 1,122, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 2, 84, 0, 0, 0, 35, 0, 0, 0,249, 0, 0, 2, 84,
- 0, 0, 0, 35, 0, 0, 0,248, 0, 0, 2, 83, 0, 0, 0, 35, 0, 0, 1, 14, 0, 0, 2, 83, 0, 0, 0, 35, 0, 0, 0,248,
- 0, 0, 1, 14, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 2, 85, 0, 0, 0, 35, 0, 0, 1,122, 0, 0, 1,124, 0, 0, 0, 35,
- 0, 0, 1,124, 0, 0, 2, 85, 0, 0, 0, 35, 0, 0, 2, 85, 0, 0, 2, 86, 0, 0, 0, 35, 0, 0, 2, 86, 0, 0, 2, 87,
- 0, 0, 0, 35, 0, 0, 2, 85, 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 1,123, 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1,123,
- 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 2, 87, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 2, 86, 0, 0, 0, 35,
- 0, 0, 1,125, 0, 0, 2, 86, 0, 0, 0, 35, 0, 0, 1,125, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 2, 88,
- 0, 0, 0, 35, 0, 0, 1, 12, 0, 0, 1, 16, 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 2, 88, 0, 0, 0, 35, 0, 0, 2, 88,
- 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 2, 89, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 2, 88, 0, 0, 2, 90, 0, 0, 0, 35,
- 0, 0, 1, 13, 0, 0, 1,126, 0, 0, 0, 35, 0, 0, 1, 13, 0, 0, 2, 90, 0, 0, 0, 35, 0, 0, 1,126, 0, 0, 2, 90,
- 0, 0, 0, 35, 0, 0, 1,127, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 2, 89, 0, 0, 0, 35, 0, 0, 1, 17,
- 0, 0, 1,127, 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 2, 91, 0, 0, 0, 35, 0, 0, 1, 11, 0, 0, 1,125, 0, 0, 0, 35,
- 0, 0, 1,125, 0, 0, 2, 91, 0, 0, 0, 35, 0, 0, 2, 91, 0, 0, 2, 92, 0, 0, 0, 35, 0, 0, 2, 92, 0, 0, 2, 93,
- 0, 0, 0, 35, 0, 0, 2, 91, 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 1, 10, 0, 0, 0, 35, 0, 0, 1, 10,
- 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 0,246, 0, 0, 2, 93, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 2, 92, 0, 0, 0, 35,
- 0, 0, 1,124, 0, 0, 2, 92, 0, 0, 0, 35, 0, 0, 0,247, 0, 0, 1,124, 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 2, 94,
- 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 1,129, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 2, 94, 0, 0, 0, 35, 0, 0, 2, 94,
- 0, 0, 2, 95, 0, 0, 0, 35, 0, 0, 2, 95, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 2, 94, 0, 0, 2, 96, 0, 0, 0, 35,
- 0, 0, 0,253, 0, 0, 1,128, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 2, 96, 0, 0, 0, 35, 0, 0, 0,253, 0, 0, 2, 96,
- 0, 0, 0, 35, 0, 0, 0,252, 0, 0, 2, 95, 0, 0, 0, 35, 0, 0, 1, 18, 0, 0, 2, 95, 0, 0, 0, 35, 0, 0, 0,252,
- 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 2, 97, 0, 0, 0, 35, 0, 0, 1,128, 0, 0, 1,130, 0, 0, 0, 35,
- 0, 0, 1,130, 0, 0, 2, 97, 0, 0, 0, 35, 0, 0, 2, 97, 0, 0, 2, 98, 0, 0, 0, 35, 0, 0, 2, 98, 0, 0, 2, 99,
- 0, 0, 0, 35, 0, 0, 2, 97, 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 1,129, 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 1,129,
- 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 2, 99, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 2, 98, 0, 0, 0, 35,
- 0, 0, 1,131, 0, 0, 2, 98, 0, 0, 0, 35, 0, 0, 1,131, 0, 0, 1,132, 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 2,100,
- 0, 0, 0, 35, 0, 0, 1, 16, 0, 0, 1, 20, 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 2,100, 0, 0, 0, 35, 0, 0, 2,100,
- 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 2,101, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 2,100, 0, 0, 2,102, 0, 0, 0, 35,
- 0, 0, 1, 17, 0, 0, 1,132, 0, 0, 0, 35, 0, 0, 1, 17, 0, 0, 2,102, 0, 0, 0, 35, 0, 0, 1,132, 0, 0, 2,102,
- 0, 0, 0, 35, 0, 0, 1,133, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 1, 21, 0, 0, 2,101, 0, 0, 0, 35, 0, 0, 1, 21,
- 0, 0, 1,133, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 2,103, 0, 0, 0, 35, 0, 0, 1, 15, 0, 0, 1,131, 0, 0, 0, 35,
- 0, 0, 1,131, 0, 0, 2,103, 0, 0, 0, 35, 0, 0, 2,103, 0, 0, 2,104, 0, 0, 0, 35, 0, 0, 2,104, 0, 0, 2,105,
- 0, 0, 0, 35, 0, 0, 2,103, 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 1, 14, 0, 0, 0, 35, 0, 0, 1, 14,
- 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 0,250, 0, 0, 2,105, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 2,104, 0, 0, 0, 35,
- 0, 0, 1,130, 0, 0, 2,104, 0, 0, 0, 35, 0, 0, 0,251, 0, 0, 1,130, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 2,106,
- 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 1,135, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 2,106, 0, 0, 0, 35, 0, 0, 2,106,
- 0, 0, 2,107, 0, 0, 0, 35, 0, 0, 2,107, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 2,106, 0, 0, 2,108, 0, 0, 0, 35,
- 0, 0, 1, 1, 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 2,108, 0, 0, 0, 35, 0, 0, 1, 1, 0, 0, 2,108,
- 0, 0, 0, 35, 0, 0, 1, 0, 0, 0, 2,107, 0, 0, 0, 35, 0, 0, 1, 22, 0, 0, 2,107, 0, 0, 0, 35, 0, 0, 1, 0,
- 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 2,109, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 1,136, 0, 0, 0, 35,
- 0, 0, 1,136, 0, 0, 2,109, 0, 0, 0, 35, 0, 0, 2,109, 0, 0, 2,110, 0, 0, 0, 35, 0, 0, 2,110, 0, 0, 2,111,
- 0, 0, 0, 35, 0, 0, 2,109, 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 1,135, 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 1,135,
- 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 2,111, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 2,110, 0, 0, 0, 35,
- 0, 0, 1,137, 0, 0, 2,110, 0, 0, 0, 35, 0, 0, 1,137, 0, 0, 1,138, 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 2,112,
- 0, 0, 0, 35, 0, 0, 1, 20, 0, 0, 1, 24, 0, 0, 0, 35, 0, 0, 1, 24, 0, 0, 2,112, 0, 0, 0, 35, 0, 0, 2,112,
- 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 2,113, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 2,112, 0, 0, 2,114, 0, 0, 0, 35,
- 0, 0, 1, 21, 0, 0, 1,138, 0, 0, 0, 35, 0, 0, 1, 21, 0, 0, 2,114, 0, 0, 0, 35, 0, 0, 1,138, 0, 0, 2,114,
- 0, 0, 0, 35, 0, 0, 1,139, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 1, 25, 0, 0, 2,113, 0, 0, 0, 35, 0, 0, 1, 25,
- 0, 0, 1,139, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 2,115, 0, 0, 0, 35, 0, 0, 1, 19, 0, 0, 1,137, 0, 0, 0, 35,
- 0, 0, 1,137, 0, 0, 2,115, 0, 0, 0, 35, 0, 0, 2,115, 0, 0, 2,116, 0, 0, 0, 35, 0, 0, 2,116, 0, 0, 2,117,
- 0, 0, 0, 35, 0, 0, 2,115, 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 1, 18, 0, 0, 0, 35, 0, 0, 1, 18,
- 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 0,254, 0, 0, 2,117, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 2,116, 0, 0, 0, 35,
- 0, 0, 1,136, 0, 0, 2,116, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 1,136, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 2,118,
- 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 1,141, 0, 0, 0, 35, 0, 0, 1, 7, 0, 0, 2,118, 0, 0, 0, 35, 0, 0, 2,118,
- 0, 0, 2,119, 0, 0, 0, 35, 0, 0, 2,119, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 2,118, 0, 0, 2,120, 0, 0, 0, 35,
- 0, 0, 1, 5, 0, 0, 1,140, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 2,120, 0, 0, 0, 35, 0, 0, 1, 5, 0, 0, 2,120,
- 0, 0, 0, 35, 0, 0, 1, 4, 0, 0, 2,119, 0, 0, 0, 35, 0, 0, 1, 6, 0, 0, 2,119, 0, 0, 0, 35, 0, 0, 1, 4,
- 0, 0, 1, 6, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 2,121, 0, 0, 0, 35, 0, 0, 1,140, 0, 0, 1,142, 0, 0, 0, 35,
- 0, 0, 1,142, 0, 0, 2,121, 0, 0, 0, 35, 0, 0, 2,121, 0, 0, 2,122, 0, 0, 0, 35, 0, 0, 2,122, 0, 0, 2,123,
- 0, 0, 0, 35, 0, 0, 2,121, 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 1,141, 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 1,141,
- 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 2,123, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 2,122, 0, 0, 0, 35,
- 0, 0, 1,143, 0, 0, 2,122, 0, 0, 0, 35, 0, 0, 1,143, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 1, 24, 0, 0, 2,124,
- 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 1, 24, 0, 0, 0, 35, 0, 0, 1, 8, 0, 0, 2,124, 0, 0, 0, 35, 0, 0, 2,124,
- 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 2,125, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 2,124, 0, 0, 2,126, 0, 0, 0, 35,
- 0, 0, 1, 25, 0, 0, 1,145, 0, 0, 0, 35, 0, 0, 1, 25, 0, 0, 2,126, 0, 0, 0, 35, 0, 0, 1,145, 0, 0, 2,126,
- 0, 0, 0, 35, 0, 0, 1,144, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 1, 9, 0, 0, 2,125, 0, 0, 0, 35, 0, 0, 1, 9,
- 0, 0, 1,144, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 2,127, 0, 0, 0, 35, 0, 0, 1, 23, 0, 0, 1,143, 0, 0, 0, 35,
- 0, 0, 1,143, 0, 0, 2,127, 0, 0, 0, 35, 0, 0, 2,127, 0, 0, 2,128, 0, 0, 0, 35, 0, 0, 2,128, 0, 0, 2,129,
- 0, 0, 0, 35, 0, 0, 2,127, 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 1, 2, 0, 0, 1, 22, 0, 0, 0, 35, 0, 0, 1, 22,
- 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 1, 2, 0, 0, 2,129, 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 2,128, 0, 0, 0, 35,
- 0, 0, 1,142, 0, 0, 2,128, 0, 0, 0, 35, 0, 0, 1, 3, 0, 0, 1,142, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,152,224, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 12,118,208, 32, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 12,119, 64, 32, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,120, 32, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0,100, 0,
- 12,118,208, 32, 0, 0, 0, 54, 0, 0, 5, 0, 0, 0, 1, 27, 0, 0, 0,102, 0, 0, 1,146, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,146, 0, 0, 0,171, 0, 0, 1, 27, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 14, 0, 0, 1, 27, 0, 0, 0,171,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,171, 0, 0, 1,146, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,147,
- 0, 0, 0, 46, 0, 0, 1,146, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,146, 0, 0, 1,148, 0, 0, 1,147, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 43, 0, 0, 1,147, 0, 0, 1,148, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,148, 0, 0, 1,146,
- 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 26, 0, 0, 0, 12, 0, 0, 0,165, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,165, 0, 0, 1,148, 0, 0, 1, 26, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,102, 0, 0, 1, 26, 0, 0, 1,148,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,148, 0, 0, 0,165, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,147,
- 0, 0, 0, 43, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,164, 0, 0, 0,170, 0, 0, 1,147, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 1,147, 0, 0, 0,170, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,170, 0, 0, 0,164,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 26, 0, 0, 0,102, 0, 0, 1,149, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,149, 0, 0, 1, 28, 0, 0, 1, 26, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 12, 0, 0, 1, 26, 0, 0, 1, 28,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 28, 0, 0, 1,149, 0, 0, 0,103, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,150,
- 0, 0, 0,103, 0, 0, 1,149, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,149, 0, 0, 1,151, 0, 0, 1,150, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,104, 0, 0, 1,150, 0, 0, 1,151, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,151, 0, 0, 1,149,
- 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 27, 0, 0, 0, 14, 0, 0, 1, 31, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 31, 0, 0, 1,151, 0, 0, 1, 27, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,102, 0, 0, 1, 27, 0, 0, 1,151,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,151, 0, 0, 1, 31, 0, 0, 0,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,150,
- 0, 0, 0,104, 0, 0, 1, 30, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 30, 0, 0, 1, 29, 0, 0, 1,150, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,103, 0, 0, 1,150, 0, 0, 1, 29, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 29, 0, 0, 1, 30,
- 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,168, 0, 0, 0, 45, 0, 0, 1,152, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,152, 0, 0, 0,172, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0,168, 0, 0, 0,172,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,172, 0, 0, 1,152, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,153,
- 0, 0, 0, 47, 0, 0, 1,152, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,152, 0, 0, 1,154, 0, 0, 1,153, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,104, 0, 0, 1,153, 0, 0, 1,154, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,154, 0, 0, 1,152,
- 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,169, 0, 0, 0, 13, 0, 0, 1, 30, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 30, 0, 0, 1,154, 0, 0, 0,169, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 45, 0, 0, 0,169, 0, 0, 1,154,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,154, 0, 0, 1, 30, 0, 0, 0,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,153,
- 0, 0, 0,104, 0, 0, 1, 31, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 31, 0, 0, 0,173, 0, 0, 1,153, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 47, 0, 0, 1,153, 0, 0, 0,173, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,173, 0, 0, 1, 31,
- 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,167, 0, 0, 0, 44, 0, 0, 1,155, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,155, 0, 0, 1, 29, 0, 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 13, 0, 0, 0,167, 0, 0, 1, 29,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 29, 0, 0, 1,155, 0, 0, 0,103, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,156,
- 0, 0, 0,103, 0, 0, 1,155, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,155, 0, 0, 1,157, 0, 0, 1,156, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 42, 0, 0, 1,156, 0, 0, 1,157, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,157, 0, 0, 1,155,
- 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,162, 0, 0, 1,157, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 44, 0, 0, 0,166, 0, 0, 1,157,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,157, 0, 0, 0,162, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,156,
- 0, 0, 0, 42, 0, 0, 0,163, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,163, 0, 0, 1, 28, 0, 0, 1,156, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,103, 0, 0, 1,156, 0, 0, 1, 28, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 28, 0, 0, 0,163,
- 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,158, 0, 0, 0,105, 0, 0, 1, 33, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 33, 0, 0, 0,179, 0, 0, 1,158, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 50, 0, 0, 1,158, 0, 0, 0,179,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,179, 0, 0, 1, 33, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,158,
- 0, 0, 0, 50, 0, 0, 1,159, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,159, 0, 0, 1,160, 0, 0, 1,158, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,105, 0, 0, 1,158, 0, 0, 1,160, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,160, 0, 0, 1,159,
- 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,165, 0, 0, 0, 12, 0, 0, 1, 32, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 32, 0, 0, 1,160, 0, 0, 0,165, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 43, 0, 0, 0,165, 0, 0, 1,160,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,160, 0, 0, 1, 32, 0, 0, 0,105, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,164,
- 0, 0, 0, 43, 0, 0, 1,159, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,159, 0, 0, 0,178, 0, 0, 0,164, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0,164, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,178, 0, 0, 1,159,
- 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,161, 0, 0, 0,105, 0, 0, 1, 32, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 32, 0, 0, 1, 34, 0, 0, 1,161, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,106, 0, 0, 1,161, 0, 0, 1, 34,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 34, 0, 0, 1, 32, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,161,
- 0, 0, 0,106, 0, 0, 1,162, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,162, 0, 0, 1,163, 0, 0, 1,161, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,105, 0, 0, 1,161, 0, 0, 1,163, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,163, 0, 0, 1,162,
- 0, 0, 0,107, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 37, 0, 0, 0, 16, 0, 0, 1, 33, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 33, 0, 0, 1,163, 0, 0, 1, 37, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,107, 0, 0, 1, 37, 0, 0, 1,163,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,163, 0, 0, 1, 33, 0, 0, 0,105, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 36,
- 0, 0, 0,107, 0, 0, 1,162, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,162, 0, 0, 1, 35, 0, 0, 1, 36, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 1, 36, 0, 0, 1, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 35, 0, 0, 1,162,
- 0, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,164, 0, 0, 0, 49, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,176, 0, 0, 0,180, 0, 0, 1,164, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 51, 0, 0, 1,164, 0, 0, 0,180,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,180, 0, 0, 0,176, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,164,
- 0, 0, 0, 51, 0, 0, 1,165, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,165, 0, 0, 1,166, 0, 0, 1,164, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 49, 0, 0, 1,164, 0, 0, 1,166, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,166, 0, 0, 1,165,
- 0, 0, 0,107, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 36, 0, 0, 0, 15, 0, 0, 0,177, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,177, 0, 0, 1,166, 0, 0, 1, 36, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,107, 0, 0, 1, 36, 0, 0, 1,166,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,166, 0, 0, 0,177, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 37,
- 0, 0, 0,107, 0, 0, 1,165, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,165, 0, 0, 0,181, 0, 0, 1, 37, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 16, 0, 0, 1, 37, 0, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,181, 0, 0, 1,165,
- 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,167, 0, 0, 0, 48, 0, 0, 0,175, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,175, 0, 0, 1, 35, 0, 0, 1,167, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,106, 0, 0, 1,167, 0, 0, 1, 35,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 35, 0, 0, 0,175, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,167,
- 0, 0, 0,106, 0, 0, 1,168, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,168, 0, 0, 1,169, 0, 0, 1,167, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 48, 0, 0, 1,167, 0, 0, 1,169, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,169, 0, 0, 1,168,
- 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,174, 0, 0, 1,169, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 42, 0, 0, 0,162, 0, 0, 1,169,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,169, 0, 0, 0,174, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,163,
- 0, 0, 0, 42, 0, 0, 1,168, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,168, 0, 0, 1, 34, 0, 0, 0,163, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 12, 0, 0, 0,163, 0, 0, 1, 34, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 34, 0, 0, 1,168,
- 0, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 39, 0, 0, 0,108, 0, 0, 1,170, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,170, 0, 0, 0,187, 0, 0, 1, 39, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 18, 0, 0, 1, 39, 0, 0, 0,187,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,187, 0, 0, 1,170, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,171,
- 0, 0, 0, 54, 0, 0, 1,170, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,170, 0, 0, 1,172, 0, 0, 1,171, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 45, 0, 0, 1,171, 0, 0, 1,172, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,172, 0, 0, 1,170,
- 0, 0, 0,108, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 38, 0, 0, 0, 13, 0, 0, 0,169, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,169, 0, 0, 1,172, 0, 0, 1, 38, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,108, 0, 0, 1, 38, 0, 0, 1,172,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,172, 0, 0, 0,169, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,171,
- 0, 0, 0, 45, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,168, 0, 0, 0,186, 0, 0, 1,171, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 54, 0, 0, 1,171, 0, 0, 0,186, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,186, 0, 0, 0,168,
- 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 38, 0, 0, 0,108, 0, 0, 1,173, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,173, 0, 0, 1, 40, 0, 0, 1, 38, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 13, 0, 0, 1, 38, 0, 0, 1, 40,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 40, 0, 0, 1,173, 0, 0, 0,109, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,174,
- 0, 0, 0,109, 0, 0, 1,173, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,173, 0, 0, 1,175, 0, 0, 1,174, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,110, 0, 0, 1,174, 0, 0, 1,175, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,175, 0, 0, 1,173,
- 0, 0, 0,108, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 39, 0, 0, 0, 18, 0, 0, 1, 43, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 43, 0, 0, 1,175, 0, 0, 1, 39, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,108, 0, 0, 1, 39, 0, 0, 1,175,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,175, 0, 0, 1, 43, 0, 0, 0,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,174,
- 0, 0, 0,110, 0, 0, 1, 42, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 42, 0, 0, 1, 41, 0, 0, 1,174, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,109, 0, 0, 1,174, 0, 0, 1, 41, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 41, 0, 0, 1, 42,
- 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,184, 0, 0, 0, 53, 0, 0, 1,176, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,176, 0, 0, 0,188, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0,184, 0, 0, 0,188,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,188, 0, 0, 1,176, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,177,
- 0, 0, 0, 55, 0, 0, 1,176, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,176, 0, 0, 1,178, 0, 0, 1,177, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,110, 0, 0, 1,177, 0, 0, 1,178, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,178, 0, 0, 1,176,
- 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,185, 0, 0, 0, 17, 0, 0, 1, 42, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 42, 0, 0, 1,178, 0, 0, 0,185, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 53, 0, 0, 0,185, 0, 0, 1,178,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,178, 0, 0, 1, 42, 0, 0, 0,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,177,
- 0, 0, 0,110, 0, 0, 1, 43, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 43, 0, 0, 0,189, 0, 0, 1,177, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 55, 0, 0, 1,177, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,189, 0, 0, 1, 43,
- 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,183, 0, 0, 0, 52, 0, 0, 1,179, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,179, 0, 0, 1, 41, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 17, 0, 0, 0,183, 0, 0, 1, 41,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 41, 0, 0, 1,179, 0, 0, 0,109, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,180,
- 0, 0, 0,109, 0, 0, 1,179, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,179, 0, 0, 1,181, 0, 0, 1,180, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 44, 0, 0, 1,180, 0, 0, 1,181, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,181, 0, 0, 1,179,
- 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,166, 0, 0, 1,181, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 52, 0, 0, 0,182, 0, 0, 1,181,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,181, 0, 0, 0,166, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,180,
- 0, 0, 0, 44, 0, 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,167, 0, 0, 1, 40, 0, 0, 1,180, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,109, 0, 0, 1,180, 0, 0, 1, 40, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 40, 0, 0, 0,167,
- 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 45, 0, 0, 0,111, 0, 0, 1,182, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,182, 0, 0, 0,195, 0, 0, 1, 45, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 20, 0, 0, 1, 45, 0, 0, 0,195,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,195, 0, 0, 1,182, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,183,
- 0, 0, 0, 58, 0, 0, 1,182, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,182, 0, 0, 1,184, 0, 0, 1,183, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 53, 0, 0, 1,183, 0, 0, 1,184, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,184, 0, 0, 1,182,
- 0, 0, 0,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 44, 0, 0, 0, 17, 0, 0, 0,185, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,185, 0, 0, 1,184, 0, 0, 1, 44, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,111, 0, 0, 1, 44, 0, 0, 1,184,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,184, 0, 0, 0,185, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,183,
- 0, 0, 0, 53, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,184, 0, 0, 0,194, 0, 0, 1,183, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 58, 0, 0, 1,183, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,194, 0, 0, 0,184,
- 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 44, 0, 0, 0,111, 0, 0, 1,185, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,185, 0, 0, 1, 46, 0, 0, 1, 44, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 17, 0, 0, 1, 44, 0, 0, 1, 46,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 46, 0, 0, 1,185, 0, 0, 0,112, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,186,
- 0, 0, 0,112, 0, 0, 1,185, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,185, 0, 0, 1,187, 0, 0, 1,186, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,113, 0, 0, 1,186, 0, 0, 1,187, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,187, 0, 0, 1,185,
- 0, 0, 0,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 45, 0, 0, 0, 20, 0, 0, 1, 49, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 49, 0, 0, 1,187, 0, 0, 1, 45, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,111, 0, 0, 1, 45, 0, 0, 1,187,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,187, 0, 0, 1, 49, 0, 0, 0,113, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,186,
- 0, 0, 0,113, 0, 0, 1, 48, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 48, 0, 0, 1, 47, 0, 0, 1,186, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,112, 0, 0, 1,186, 0, 0, 1, 47, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 47, 0, 0, 1, 48,
- 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,192, 0, 0, 0, 57, 0, 0, 1,188, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,188, 0, 0, 0,196, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0,192, 0, 0, 0,196,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,196, 0, 0, 1,188, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,189,
- 0, 0, 0, 59, 0, 0, 1,188, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,188, 0, 0, 1,190, 0, 0, 1,189, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,113, 0, 0, 1,189, 0, 0, 1,190, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,190, 0, 0, 1,188,
- 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,193, 0, 0, 0, 19, 0, 0, 1, 48, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 48, 0, 0, 1,190, 0, 0, 0,193, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 57, 0, 0, 0,193, 0, 0, 1,190,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,190, 0, 0, 1, 48, 0, 0, 0,113, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,189,
- 0, 0, 0,113, 0, 0, 1, 49, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 49, 0, 0, 0,197, 0, 0, 1,189, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 59, 0, 0, 1,189, 0, 0, 0,197, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,197, 0, 0, 1, 49,
- 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,191, 0, 0, 0, 56, 0, 0, 1,191, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,191, 0, 0, 1, 47, 0, 0, 0,191, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 19, 0, 0, 0,191, 0, 0, 1, 47,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 47, 0, 0, 1,191, 0, 0, 0,112, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,192,
- 0, 0, 0,112, 0, 0, 1,191, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,191, 0, 0, 1,193, 0, 0, 1,192, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 52, 0, 0, 1,192, 0, 0, 1,193, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,193, 0, 0, 1,191,
- 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,190, 0, 0, 0, 0, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,182, 0, 0, 1,193, 0, 0, 0,190, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 56, 0, 0, 0,190, 0, 0, 1,193,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,193, 0, 0, 0,182, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,192,
- 0, 0, 0, 52, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,183, 0, 0, 1, 46, 0, 0, 1,192, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,112, 0, 0, 1,192, 0, 0, 1, 46, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 46, 0, 0, 0,183,
- 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 51, 0, 0, 0,114, 0, 0, 1,194, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,194, 0, 0, 0,199, 0, 0, 1, 51, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 21, 0, 0, 1, 51, 0, 0, 0,199,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,199, 0, 0, 1,194, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,195,
- 0, 0, 0, 60, 0, 0, 1,194, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,194, 0, 0, 1,196, 0, 0, 1,195, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 57, 0, 0, 1,195, 0, 0, 1,196, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,196, 0, 0, 1,194,
- 0, 0, 0,114, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 50, 0, 0, 0, 19, 0, 0, 0,193, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,193, 0, 0, 1,196, 0, 0, 1, 50, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,114, 0, 0, 1, 50, 0, 0, 1,196,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,196, 0, 0, 0,193, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,195,
- 0, 0, 0, 57, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,192, 0, 0, 0,198, 0, 0, 1,195, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 60, 0, 0, 1,195, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,198, 0, 0, 0,192,
- 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 50, 0, 0, 0,114, 0, 0, 1,197, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,197, 0, 0, 1, 53, 0, 0, 1, 50, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 19, 0, 0, 1, 50, 0, 0, 1, 53,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 53, 0, 0, 1,197, 0, 0, 0,115, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,198,
- 0, 0, 0,115, 0, 0, 1,197, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,197, 0, 0, 1,199, 0, 0, 1,198, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,116, 0, 0, 1,198, 0, 0, 1,199, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,199, 0, 0, 1,197,
- 0, 0, 0,114, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 51, 0, 0, 0, 21, 0, 0, 1, 55, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 55, 0, 0, 1,199, 0, 0, 1, 51, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,114, 0, 0, 1, 51, 0, 0, 1,199,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,199, 0, 0, 1, 55, 0, 0, 0,116, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,198,
- 0, 0, 0,116, 0, 0, 1, 54, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 54, 0, 0, 1, 52, 0, 0, 1,198, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,115, 0, 0, 1,198, 0, 0, 1, 52, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 52, 0, 0, 1, 54,
- 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,176, 0, 0, 0, 49, 0, 0, 1,200, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,200, 0, 0, 0,200, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0,176, 0, 0, 0,200,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,200, 0, 0, 1,200, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,201,
- 0, 0, 0, 61, 0, 0, 1,200, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,200, 0, 0, 1,202, 0, 0, 1,201, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,116, 0, 0, 1,201, 0, 0, 1,202, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,202, 0, 0, 1,200,
- 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,177, 0, 0, 0, 15, 0, 0, 1, 54, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 54, 0, 0, 1,202, 0, 0, 0,177, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 49, 0, 0, 0,177, 0, 0, 1,202,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,202, 0, 0, 1, 54, 0, 0, 0,116, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,201,
- 0, 0, 0,116, 0, 0, 1, 55, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 55, 0, 0, 0,201, 0, 0, 1,201, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 61, 0, 0, 1,201, 0, 0, 0,201, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,201, 0, 0, 1, 55,
- 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,175, 0, 0, 0, 48, 0, 0, 1,203, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,203, 0, 0, 1, 52, 0, 0, 0,175, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0,175, 0, 0, 1, 52,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 52, 0, 0, 1,203, 0, 0, 0,115, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,204,
- 0, 0, 0,115, 0, 0, 1,203, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,203, 0, 0, 1,205, 0, 0, 1,204, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 56, 0, 0, 1,204, 0, 0, 1,205, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,205, 0, 0, 1,203,
- 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 0,190, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,190, 0, 0, 1,205, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 48, 0, 0, 0,174, 0, 0, 1,205,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,205, 0, 0, 0,190, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,204,
- 0, 0, 0, 56, 0, 0, 0,191, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,191, 0, 0, 1, 53, 0, 0, 1,204, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,115, 0, 0, 1,204, 0, 0, 1, 53, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 53, 0, 0, 0,191,
- 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,206, 0, 0, 0,117, 0, 0, 1, 57, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 57, 0, 0, 0,207, 0, 0, 1,206, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 64, 0, 0, 1,206, 0, 0, 0,207,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,207, 0, 0, 1, 57, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,206,
- 0, 0, 0, 64, 0, 0, 1,207, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,207, 0, 0, 1,208, 0, 0, 1,206, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,117, 0, 0, 1,206, 0, 0, 1,208, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,208, 0, 0, 1,207,
- 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,179, 0, 0, 0, 16, 0, 0, 1, 56, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 56, 0, 0, 1,208, 0, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 50, 0, 0, 0,179, 0, 0, 1,208,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,208, 0, 0, 1, 56, 0, 0, 0,117, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,178,
- 0, 0, 0, 50, 0, 0, 1,207, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,207, 0, 0, 0,206, 0, 0, 0,178, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0,178, 0, 0, 0,206, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,206, 0, 0, 1,207,
- 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,209, 0, 0, 0,117, 0, 0, 1, 56, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 56, 0, 0, 1, 58, 0, 0, 1,209, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,118, 0, 0, 1,209, 0, 0, 1, 58,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 58, 0, 0, 1, 56, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,209,
- 0, 0, 0,118, 0, 0, 1,210, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,210, 0, 0, 1,211, 0, 0, 1,209, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,117, 0, 0, 1,209, 0, 0, 1,211, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,211, 0, 0, 1,210,
- 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 61, 0, 0, 0, 23, 0, 0, 1, 57, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 57, 0, 0, 1,211, 0, 0, 1, 61, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,119, 0, 0, 1, 61, 0, 0, 1,211,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,211, 0, 0, 1, 57, 0, 0, 0,117, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 60,
- 0, 0, 0,119, 0, 0, 1,210, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,210, 0, 0, 1, 59, 0, 0, 1, 60, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 22, 0, 0, 1, 60, 0, 0, 1, 59, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 59, 0, 0, 1,210,
- 0, 0, 0,118, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,212, 0, 0, 0, 63, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,204, 0, 0, 0,208, 0, 0, 1,212, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 65, 0, 0, 1,212, 0, 0, 0,208,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,208, 0, 0, 0,204, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,212,
- 0, 0, 0, 65, 0, 0, 1,213, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,213, 0, 0, 1,214, 0, 0, 1,212, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 63, 0, 0, 1,212, 0, 0, 1,214, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,214, 0, 0, 1,213,
- 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 60, 0, 0, 0, 22, 0, 0, 0,205, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,205, 0, 0, 1,214, 0, 0, 1, 60, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,119, 0, 0, 1, 60, 0, 0, 1,214,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,214, 0, 0, 0,205, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 61,
- 0, 0, 0,119, 0, 0, 1,213, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,213, 0, 0, 0,209, 0, 0, 1, 61, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 23, 0, 0, 1, 61, 0, 0, 0,209, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,209, 0, 0, 1,213,
- 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,215, 0, 0, 0, 62, 0, 0, 0,203, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,203, 0, 0, 1, 59, 0, 0, 1,215, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,118, 0, 0, 1,215, 0, 0, 1, 59,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 59, 0, 0, 0,203, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,215,
- 0, 0, 0,118, 0, 0, 1,216, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,216, 0, 0, 1,217, 0, 0, 1,215, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 62, 0, 0, 1,215, 0, 0, 1,217, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,217, 0, 0, 1,216,
- 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,180, 0, 0, 0, 5, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,202, 0, 0, 1,217, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 51, 0, 0, 0,180, 0, 0, 1,217,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,217, 0, 0, 0,202, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,181,
- 0, 0, 0, 51, 0, 0, 1,216, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,216, 0, 0, 1, 58, 0, 0, 0,181, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 16, 0, 0, 0,181, 0, 0, 1, 58, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 58, 0, 0, 1,216,
- 0, 0, 0,118, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,218, 0, 0, 0,120, 0, 0, 1, 63, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 63, 0, 0, 0,215, 0, 0, 1,218, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 68, 0, 0, 1,218, 0, 0, 0,215,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,215, 0, 0, 1, 63, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,218,
- 0, 0, 0, 68, 0, 0, 1,219, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,219, 0, 0, 1,220, 0, 0, 1,218, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,120, 0, 0, 1,218, 0, 0, 1,220, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,220, 0, 0, 1,219,
- 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,173, 0, 0, 0, 14, 0, 0, 1, 62, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 62, 0, 0, 1,220, 0, 0, 0,173, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 47, 0, 0, 0,173, 0, 0, 1,220,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,220, 0, 0, 1, 62, 0, 0, 0,120, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,172,
- 0, 0, 0, 47, 0, 0, 1,219, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,219, 0, 0, 0,214, 0, 0, 0,172, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0,172, 0, 0, 0,214, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,214, 0, 0, 1,219,
- 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,221, 0, 0, 0,120, 0, 0, 1, 62, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 62, 0, 0, 1, 64, 0, 0, 1,221, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,121, 0, 0, 1,221, 0, 0, 1, 64,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 64, 0, 0, 1, 62, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,221,
- 0, 0, 0,121, 0, 0, 1,222, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,222, 0, 0, 1,223, 0, 0, 1,221, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,120, 0, 0, 1,221, 0, 0, 1,223, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,223, 0, 0, 1,222,
- 0, 0, 0,122, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 67, 0, 0, 0, 25, 0, 0, 1, 63, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 63, 0, 0, 1,223, 0, 0, 1, 67, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,122, 0, 0, 1, 67, 0, 0, 1,223,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,223, 0, 0, 1, 63, 0, 0, 0,120, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 66,
- 0, 0, 0,122, 0, 0, 1,222, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,222, 0, 0, 1, 65, 0, 0, 1, 66, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 24, 0, 0, 1, 66, 0, 0, 1, 65, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 65, 0, 0, 1,222,
- 0, 0, 0,121, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,224, 0, 0, 0, 67, 0, 0, 0,212, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,212, 0, 0, 0,216, 0, 0, 1,224, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 69, 0, 0, 1,224, 0, 0, 0,216,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,216, 0, 0, 0,212, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,224,
- 0, 0, 0, 69, 0, 0, 1,225, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,225, 0, 0, 1,226, 0, 0, 1,224, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 67, 0, 0, 1,224, 0, 0, 1,226, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,226, 0, 0, 1,225,
- 0, 0, 0,122, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 66, 0, 0, 0, 24, 0, 0, 0,213, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,213, 0, 0, 1,226, 0, 0, 1, 66, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,122, 0, 0, 1, 66, 0, 0, 1,226,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,226, 0, 0, 0,213, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 67,
- 0, 0, 0,122, 0, 0, 1,225, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,225, 0, 0, 0,217, 0, 0, 1, 67, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 25, 0, 0, 1, 67, 0, 0, 0,217, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,217, 0, 0, 1,225,
- 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,227, 0, 0, 0, 66, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,211, 0, 0, 1, 65, 0, 0, 1,227, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,121, 0, 0, 1,227, 0, 0, 1, 65,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 65, 0, 0, 0,211, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,227,
- 0, 0, 0,121, 0, 0, 1,228, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,228, 0, 0, 1,229, 0, 0, 1,227, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 66, 0, 0, 1,227, 0, 0, 1,229, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,229, 0, 0, 1,228,
- 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,170, 0, 0, 0, 1, 0, 0, 0,210, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,210, 0, 0, 1,229, 0, 0, 0,170, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 46, 0, 0, 0,170, 0, 0, 1,229,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,229, 0, 0, 0,210, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,171,
- 0, 0, 0, 46, 0, 0, 1,228, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,228, 0, 0, 1, 64, 0, 0, 0,171, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 14, 0, 0, 0,171, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 64, 0, 0, 1,228,
- 0, 0, 0,121, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,230, 0, 0, 0,123, 0, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 69, 0, 0, 0,223, 0, 0, 1,230, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 72, 0, 0, 1,230, 0, 0, 0,223,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,223, 0, 0, 1, 69, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,230,
- 0, 0, 0, 72, 0, 0, 1,231, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,231, 0, 0, 1,232, 0, 0, 1,230, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,123, 0, 0, 1,230, 0, 0, 1,232, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,232, 0, 0, 1,231,
- 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,189, 0, 0, 0, 18, 0, 0, 1, 68, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 68, 0, 0, 1,232, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 55, 0, 0, 0,189, 0, 0, 1,232,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,232, 0, 0, 1, 68, 0, 0, 0,123, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,188,
- 0, 0, 0, 55, 0, 0, 1,231, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,231, 0, 0, 0,222, 0, 0, 0,188, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0,188, 0, 0, 0,222, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,222, 0, 0, 1,231,
- 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,233, 0, 0, 0,123, 0, 0, 1, 68, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 68, 0, 0, 1, 70, 0, 0, 1,233, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,124, 0, 0, 1,233, 0, 0, 1, 70,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 70, 0, 0, 1, 68, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,233,
- 0, 0, 0,124, 0, 0, 1,234, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,234, 0, 0, 1,235, 0, 0, 1,233, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,123, 0, 0, 1,233, 0, 0, 1,235, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,235, 0, 0, 1,234,
- 0, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 73, 0, 0, 0, 27, 0, 0, 1, 69, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 69, 0, 0, 1,235, 0, 0, 1, 73, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,125, 0, 0, 1, 73, 0, 0, 1,235,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,235, 0, 0, 1, 69, 0, 0, 0,123, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 72,
- 0, 0, 0,125, 0, 0, 1,234, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,234, 0, 0, 1, 71, 0, 0, 1, 72, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 26, 0, 0, 1, 72, 0, 0, 1, 71, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 71, 0, 0, 1,234,
- 0, 0, 0,124, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,236, 0, 0, 0, 71, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,220, 0, 0, 0,224, 0, 0, 1,236, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 73, 0, 0, 1,236, 0, 0, 0,224,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,224, 0, 0, 0,220, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,236,
- 0, 0, 0, 73, 0, 0, 1,237, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,237, 0, 0, 1,238, 0, 0, 1,236, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 71, 0, 0, 1,236, 0, 0, 1,238, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,238, 0, 0, 1,237,
- 0, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 72, 0, 0, 0, 26, 0, 0, 0,221, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,221, 0, 0, 1,238, 0, 0, 1, 72, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,125, 0, 0, 1, 72, 0, 0, 1,238,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,238, 0, 0, 0,221, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 73,
- 0, 0, 0,125, 0, 0, 1,237, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,237, 0, 0, 0,225, 0, 0, 1, 73, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 27, 0, 0, 1, 73, 0, 0, 0,225, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,225, 0, 0, 1,237,
- 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,239, 0, 0, 0, 70, 0, 0, 0,219, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,219, 0, 0, 1, 71, 0, 0, 1,239, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,124, 0, 0, 1,239, 0, 0, 1, 71,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 71, 0, 0, 0,219, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,239,
- 0, 0, 0,124, 0, 0, 1,240, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,240, 0, 0, 1,241, 0, 0, 1,239, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 70, 0, 0, 1,239, 0, 0, 1,241, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,241, 0, 0, 1,240,
- 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,186, 0, 0, 0, 2, 0, 0, 0,218, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,218, 0, 0, 1,241, 0, 0, 0,186, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 54, 0, 0, 0,186, 0, 0, 1,241,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,241, 0, 0, 0,218, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,187,
- 0, 0, 0, 54, 0, 0, 1,240, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,240, 0, 0, 1, 70, 0, 0, 0,187, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 18, 0, 0, 0,187, 0, 0, 1, 70, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 70, 0, 0, 1,240,
- 0, 0, 0,124, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,242, 0, 0, 0,126, 0, 0, 1, 75, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 75, 0, 0, 0,231, 0, 0, 1,242, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 76, 0, 0, 1,242, 0, 0, 0,231,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,231, 0, 0, 1, 75, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,242,
- 0, 0, 0, 76, 0, 0, 1,243, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,243, 0, 0, 1,244, 0, 0, 1,242, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,126, 0, 0, 1,242, 0, 0, 1,244, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,244, 0, 0, 1,243,
- 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,197, 0, 0, 0, 20, 0, 0, 1, 74, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 74, 0, 0, 1,244, 0, 0, 0,197, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 59, 0, 0, 0,197, 0, 0, 1,244,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,244, 0, 0, 1, 74, 0, 0, 0,126, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,196,
- 0, 0, 0, 59, 0, 0, 1,243, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,243, 0, 0, 0,230, 0, 0, 0,196, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0,196, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,230, 0, 0, 1,243,
- 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,245, 0, 0, 0,126, 0, 0, 1, 74, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 74, 0, 0, 1, 76, 0, 0, 1,245, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,127, 0, 0, 1,245, 0, 0, 1, 76,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 76, 0, 0, 1, 74, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,245,
- 0, 0, 0,127, 0, 0, 1,246, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,246, 0, 0, 1,247, 0, 0, 1,245, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,126, 0, 0, 1,245, 0, 0, 1,247, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,247, 0, 0, 1,246,
- 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 79, 0, 0, 0, 29, 0, 0, 1, 75, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 75, 0, 0, 1,247, 0, 0, 1, 79, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,128, 0, 0, 1, 79, 0, 0, 1,247,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,247, 0, 0, 1, 75, 0, 0, 0,126, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 78,
- 0, 0, 0,128, 0, 0, 1,246, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,246, 0, 0, 1, 77, 0, 0, 1, 78, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 1, 78, 0, 0, 1, 77, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 77, 0, 0, 1,246,
- 0, 0, 0,127, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,248, 0, 0, 0, 75, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,228, 0, 0, 0,232, 0, 0, 1,248, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 77, 0, 0, 1,248, 0, 0, 0,232,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,232, 0, 0, 0,228, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,248,
- 0, 0, 0, 77, 0, 0, 1,249, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,249, 0, 0, 1,250, 0, 0, 1,248, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 75, 0, 0, 1,248, 0, 0, 1,250, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,250, 0, 0, 1,249,
- 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 78, 0, 0, 0, 28, 0, 0, 0,229, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,229, 0, 0, 1,250, 0, 0, 1, 78, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,128, 0, 0, 1, 78, 0, 0, 1,250,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,250, 0, 0, 0,229, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 79,
- 0, 0, 0,128, 0, 0, 1,249, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,249, 0, 0, 0,233, 0, 0, 1, 79, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 29, 0, 0, 1, 79, 0, 0, 0,233, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,233, 0, 0, 1,249,
- 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,251, 0, 0, 0, 74, 0, 0, 0,227, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,227, 0, 0, 1, 77, 0, 0, 1,251, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,127, 0, 0, 1,251, 0, 0, 1, 77,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 77, 0, 0, 0,227, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,251,
- 0, 0, 0,127, 0, 0, 1,252, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,252, 0, 0, 1,253, 0, 0, 1,251, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 74, 0, 0, 1,251, 0, 0, 1,253, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,253, 0, 0, 1,252,
- 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,194, 0, 0, 0, 3, 0, 0, 0,226, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,226, 0, 0, 1,253, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 58, 0, 0, 0,194, 0, 0, 1,253,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,253, 0, 0, 0,226, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,195,
- 0, 0, 0, 58, 0, 0, 1,252, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,252, 0, 0, 1, 76, 0, 0, 0,195, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 20, 0, 0, 0,195, 0, 0, 1, 76, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 76, 0, 0, 1,252,
- 0, 0, 0,127, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,254, 0, 0, 0,129, 0, 0, 1, 81, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 81, 0, 0, 0,239, 0, 0, 1,254, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 80, 0, 0, 1,254, 0, 0, 0,239,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,239, 0, 0, 1, 81, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,254,
- 0, 0, 0, 80, 0, 0, 1,255, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,255, 0, 0, 2, 0, 0, 0, 1,254, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,129, 0, 0, 1,254, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0, 1,255,
- 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,201, 0, 0, 0, 21, 0, 0, 1, 80, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 80, 0, 0, 2, 0, 0, 0, 0,201, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 61, 0, 0, 0,201, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0, 1, 80, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,200,
- 0, 0, 0, 61, 0, 0, 1,255, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,255, 0, 0, 0,238, 0, 0, 0,200, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0,200, 0, 0, 0,238, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,238, 0, 0, 1,255,
- 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 1, 0, 0, 0,129, 0, 0, 1, 80, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 80, 0, 0, 1, 82, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,130, 0, 0, 2, 1, 0, 0, 1, 82,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 82, 0, 0, 1, 80, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 1,
- 0, 0, 0,130, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 2, 0, 0, 2, 3, 0, 0, 2, 1, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,129, 0, 0, 2, 1, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 3, 0, 0, 2, 2,
- 0, 0, 0,131, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 85, 0, 0, 0, 31, 0, 0, 1, 81, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 81, 0, 0, 2, 3, 0, 0, 1, 85, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,131, 0, 0, 1, 85, 0, 0, 2, 3,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 3, 0, 0, 1, 81, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 84,
- 0, 0, 0,131, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 2, 0, 0, 1, 83, 0, 0, 1, 84, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 1, 84, 0, 0, 1, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 83, 0, 0, 2, 2,
- 0, 0, 0,130, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 4, 0, 0, 0, 79, 0, 0, 0,236, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,236, 0, 0, 0,240, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 81, 0, 0, 2, 4, 0, 0, 0,240,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,240, 0, 0, 0,236, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 4,
- 0, 0, 0, 81, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 5, 0, 0, 2, 6, 0, 0, 2, 4, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 79, 0, 0, 2, 4, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 6, 0, 0, 2, 5,
- 0, 0, 0,131, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 84, 0, 0, 0, 30, 0, 0, 0,237, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,237, 0, 0, 2, 6, 0, 0, 1, 84, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,131, 0, 0, 1, 84, 0, 0, 2, 6,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 6, 0, 0, 0,237, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 85,
- 0, 0, 0,131, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 5, 0, 0, 0,241, 0, 0, 1, 85, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 31, 0, 0, 1, 85, 0, 0, 0,241, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,241, 0, 0, 2, 5,
- 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 7, 0, 0, 0, 78, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,235, 0, 0, 1, 83, 0, 0, 2, 7, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,130, 0, 0, 2, 7, 0, 0, 1, 83,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 83, 0, 0, 0,235, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 7,
- 0, 0, 0,130, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 8, 0, 0, 2, 9, 0, 0, 2, 7, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 78, 0, 0, 2, 7, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 9, 0, 0, 2, 8,
- 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,198, 0, 0, 0, 4, 0, 0, 0,234, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,234, 0, 0, 2, 9, 0, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 60, 0, 0, 0,198, 0, 0, 2, 9,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 9, 0, 0, 0,234, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,199,
- 0, 0, 0, 60, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 8, 0, 0, 1, 82, 0, 0, 0,199, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 21, 0, 0, 0,199, 0, 0, 1, 82, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 82, 0, 0, 2, 8,
- 0, 0, 0,130, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 87, 0, 0, 0,132, 0, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 10, 0, 0, 0,245, 0, 0, 1, 87, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 32, 0, 0, 1, 87, 0, 0, 0,245,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,245, 0, 0, 2, 10, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 11,
- 0, 0, 0, 83, 0, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 10, 0, 0, 2, 12, 0, 0, 2, 11, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 65, 0, 0, 2, 11, 0, 0, 2, 12, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 12, 0, 0, 2, 10,
- 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 86, 0, 0, 0, 23, 0, 0, 0,209, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,209, 0, 0, 2, 12, 0, 0, 1, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,132, 0, 0, 1, 86, 0, 0, 2, 12,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 12, 0, 0, 0,209, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 11,
- 0, 0, 0, 65, 0, 0, 0,208, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,208, 0, 0, 0,244, 0, 0, 2, 11, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 83, 0, 0, 2, 11, 0, 0, 0,244, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,244, 0, 0, 0,208,
- 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 86, 0, 0, 0,132, 0, 0, 2, 13, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 13, 0, 0, 1, 88, 0, 0, 1, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 23, 0, 0, 1, 86, 0, 0, 1, 88,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 88, 0, 0, 2, 13, 0, 0, 0,133, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 14,
- 0, 0, 0,133, 0, 0, 2, 13, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 13, 0, 0, 2, 15, 0, 0, 2, 14, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,134, 0, 0, 2, 14, 0, 0, 2, 15, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 15, 0, 0, 2, 13,
- 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 87, 0, 0, 0, 32, 0, 0, 1, 91, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 91, 0, 0, 2, 15, 0, 0, 1, 87, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,132, 0, 0, 1, 87, 0, 0, 2, 15,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 15, 0, 0, 1, 91, 0, 0, 0,134, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 14,
- 0, 0, 0,134, 0, 0, 1, 90, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 90, 0, 0, 1, 89, 0, 0, 2, 14, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,133, 0, 0, 2, 14, 0, 0, 1, 89, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 89, 0, 0, 1, 90,
- 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,212, 0, 0, 0, 67, 0, 0, 2, 16, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 16, 0, 0, 0,242, 0, 0, 0,212, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0,212, 0, 0, 0,242,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,242, 0, 0, 2, 16, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 17,
- 0, 0, 0, 82, 0, 0, 2, 16, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 16, 0, 0, 2, 18, 0, 0, 2, 17, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,134, 0, 0, 2, 17, 0, 0, 2, 18, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 18, 0, 0, 2, 16,
- 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,213, 0, 0, 0, 24, 0, 0, 1, 90, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 90, 0, 0, 2, 18, 0, 0, 0,213, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 67, 0, 0, 0,213, 0, 0, 2, 18,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 18, 0, 0, 1, 90, 0, 0, 0,134, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 17,
- 0, 0, 0,134, 0, 0, 1, 91, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 91, 0, 0, 0,243, 0, 0, 2, 17, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 82, 0, 0, 2, 17, 0, 0, 0,243, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,243, 0, 0, 1, 91,
- 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,211, 0, 0, 0, 66, 0, 0, 2, 19, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 19, 0, 0, 1, 89, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 24, 0, 0, 0,211, 0, 0, 1, 89,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 89, 0, 0, 2, 19, 0, 0, 0,133, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 20,
- 0, 0, 0,133, 0, 0, 2, 19, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 19, 0, 0, 2, 21, 0, 0, 2, 20, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 64, 0, 0, 2, 20, 0, 0, 2, 21, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 21, 0, 0, 2, 19,
- 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,210, 0, 0, 0, 1, 0, 0, 0,206, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,206, 0, 0, 2, 21, 0, 0, 0,210, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 66, 0, 0, 0,210, 0, 0, 2, 21,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 21, 0, 0, 0,206, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 20,
- 0, 0, 0, 64, 0, 0, 0,207, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,207, 0, 0, 1, 88, 0, 0, 2, 20, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,133, 0, 0, 2, 20, 0, 0, 1, 88, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 88, 0, 0, 0,207,
- 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 93, 0, 0, 0,135, 0, 0, 2, 22, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 22, 0, 0, 0,247, 0, 0, 1, 93, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 33, 0, 0, 1, 93, 0, 0, 0,247,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,247, 0, 0, 2, 22, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 23,
- 0, 0, 0, 84, 0, 0, 2, 22, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 22, 0, 0, 2, 24, 0, 0, 2, 23, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 69, 0, 0, 2, 23, 0, 0, 2, 24, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 24, 0, 0, 2, 22,
- 0, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 92, 0, 0, 0, 25, 0, 0, 0,217, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,217, 0, 0, 2, 24, 0, 0, 1, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,135, 0, 0, 1, 92, 0, 0, 2, 24,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 24, 0, 0, 0,217, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 23,
- 0, 0, 0, 69, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,216, 0, 0, 0,246, 0, 0, 2, 23, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 84, 0, 0, 2, 23, 0, 0, 0,246, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,246, 0, 0, 0,216,
- 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 92, 0, 0, 0,135, 0, 0, 2, 25, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 25, 0, 0, 1, 94, 0, 0, 1, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 25, 0, 0, 1, 92, 0, 0, 1, 94,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 94, 0, 0, 2, 25, 0, 0, 0,136, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 26,
- 0, 0, 0,136, 0, 0, 2, 25, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 25, 0, 0, 2, 27, 0, 0, 2, 26, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,137, 0, 0, 2, 26, 0, 0, 2, 27, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 27, 0, 0, 2, 25,
- 0, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 93, 0, 0, 0, 33, 0, 0, 1, 97, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 97, 0, 0, 2, 27, 0, 0, 1, 93, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,135, 0, 0, 1, 93, 0, 0, 2, 27,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 27, 0, 0, 1, 97, 0, 0, 0,137, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 26,
- 0, 0, 0,137, 0, 0, 1, 96, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 96, 0, 0, 1, 95, 0, 0, 2, 26, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,136, 0, 0, 2, 26, 0, 0, 1, 95, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 95, 0, 0, 1, 96,
- 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,220, 0, 0, 0, 71, 0, 0, 2, 28, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 28, 0, 0, 0,248, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0,220, 0, 0, 0,248,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,248, 0, 0, 2, 28, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 29,
- 0, 0, 0, 85, 0, 0, 2, 28, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 28, 0, 0, 2, 30, 0, 0, 2, 29, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,137, 0, 0, 2, 29, 0, 0, 2, 30, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 30, 0, 0, 2, 28,
- 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,221, 0, 0, 0, 26, 0, 0, 1, 96, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 96, 0, 0, 2, 30, 0, 0, 0,221, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 71, 0, 0, 0,221, 0, 0, 2, 30,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 30, 0, 0, 1, 96, 0, 0, 0,137, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 29,
- 0, 0, 0,137, 0, 0, 1, 97, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 97, 0, 0, 0,249, 0, 0, 2, 29, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 85, 0, 0, 2, 29, 0, 0, 0,249, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,249, 0, 0, 1, 97,
- 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,219, 0, 0, 0, 70, 0, 0, 2, 31, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 31, 0, 0, 1, 95, 0, 0, 0,219, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 26, 0, 0, 0,219, 0, 0, 1, 95,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 95, 0, 0, 2, 31, 0, 0, 0,136, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 32,
- 0, 0, 0,136, 0, 0, 2, 31, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 31, 0, 0, 2, 33, 0, 0, 2, 32, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 68, 0, 0, 2, 32, 0, 0, 2, 33, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 33, 0, 0, 2, 31,
- 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,218, 0, 0, 0, 2, 0, 0, 0,214, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,214, 0, 0, 2, 33, 0, 0, 0,218, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 70, 0, 0, 0,218, 0, 0, 2, 33,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 33, 0, 0, 0,214, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 32,
- 0, 0, 0, 68, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,215, 0, 0, 1, 94, 0, 0, 2, 32, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,136, 0, 0, 2, 32, 0, 0, 1, 94, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 94, 0, 0, 0,215,
- 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 99, 0, 0, 0,138, 0, 0, 2, 34, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 34, 0, 0, 0,251, 0, 0, 1, 99, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 34, 0, 0, 1, 99, 0, 0, 0,251,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,251, 0, 0, 2, 34, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 35,
- 0, 0, 0, 86, 0, 0, 2, 34, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 34, 0, 0, 2, 36, 0, 0, 2, 35, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 73, 0, 0, 2, 35, 0, 0, 2, 36, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 36, 0, 0, 2, 34,
- 0, 0, 0,138, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 98, 0, 0, 0, 27, 0, 0, 0,225, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,225, 0, 0, 2, 36, 0, 0, 1, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,138, 0, 0, 1, 98, 0, 0, 2, 36,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 36, 0, 0, 0,225, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 35,
- 0, 0, 0, 73, 0, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,224, 0, 0, 0,250, 0, 0, 2, 35, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 86, 0, 0, 2, 35, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,250, 0, 0, 0,224,
- 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 98, 0, 0, 0,138, 0, 0, 2, 37, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 37, 0, 0, 1,100, 0, 0, 1, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 27, 0, 0, 1, 98, 0, 0, 1,100,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,100, 0, 0, 2, 37, 0, 0, 0,139, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 38,
- 0, 0, 0,139, 0, 0, 2, 37, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 37, 0, 0, 2, 39, 0, 0, 2, 38, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,140, 0, 0, 2, 38, 0, 0, 2, 39, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 39, 0, 0, 2, 37,
- 0, 0, 0,138, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 99, 0, 0, 0, 34, 0, 0, 1,103, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,103, 0, 0, 2, 39, 0, 0, 1, 99, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,138, 0, 0, 1, 99, 0, 0, 2, 39,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 39, 0, 0, 1,103, 0, 0, 0,140, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 38,
- 0, 0, 0,140, 0, 0, 1,102, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,102, 0, 0, 1,101, 0, 0, 2, 38, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,139, 0, 0, 2, 38, 0, 0, 1,101, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,101, 0, 0, 1,102,
- 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,228, 0, 0, 0, 75, 0, 0, 2, 40, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 40, 0, 0, 0,252, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0,228, 0, 0, 0,252,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,252, 0, 0, 2, 40, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 41,
- 0, 0, 0, 87, 0, 0, 2, 40, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 40, 0, 0, 2, 42, 0, 0, 2, 41, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,140, 0, 0, 2, 41, 0, 0, 2, 42, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 42, 0, 0, 2, 40,
- 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,229, 0, 0, 0, 28, 0, 0, 1,102, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,102, 0, 0, 2, 42, 0, 0, 0,229, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 75, 0, 0, 0,229, 0, 0, 2, 42,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 42, 0, 0, 1,102, 0, 0, 0,140, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 41,
- 0, 0, 0,140, 0, 0, 1,103, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,103, 0, 0, 0,253, 0, 0, 2, 41, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 87, 0, 0, 2, 41, 0, 0, 0,253, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,253, 0, 0, 1,103,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,227, 0, 0, 0, 74, 0, 0, 2, 43, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 43, 0, 0, 1,101, 0, 0, 0,227, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 0,227, 0, 0, 1,101,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,101, 0, 0, 2, 43, 0, 0, 0,139, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 44,
- 0, 0, 0,139, 0, 0, 2, 43, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 43, 0, 0, 2, 45, 0, 0, 2, 44, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 72, 0, 0, 2, 44, 0, 0, 2, 45, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 45, 0, 0, 2, 43,
- 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,226, 0, 0, 0, 3, 0, 0, 0,222, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,222, 0, 0, 2, 45, 0, 0, 0,226, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 74, 0, 0, 0,226, 0, 0, 2, 45,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 45, 0, 0, 0,222, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 44,
- 0, 0, 0, 72, 0, 0, 0,223, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,223, 0, 0, 1,100, 0, 0, 2, 44, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,139, 0, 0, 2, 44, 0, 0, 1,100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,100, 0, 0, 0,223,
- 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,105, 0, 0, 0,141, 0, 0, 2, 46, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 46, 0, 0, 0,255, 0, 0, 1,105, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 1,105, 0, 0, 0,255,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,255, 0, 0, 2, 46, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 47,
- 0, 0, 0, 88, 0, 0, 2, 46, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 46, 0, 0, 2, 48, 0, 0, 2, 47, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 77, 0, 0, 2, 47, 0, 0, 2, 48, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 48, 0, 0, 2, 46,
- 0, 0, 0,141, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,104, 0, 0, 0, 29, 0, 0, 0,233, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,233, 0, 0, 2, 48, 0, 0, 1,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,141, 0, 0, 1,104, 0, 0, 2, 48,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 48, 0, 0, 0,233, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 47,
- 0, 0, 0, 77, 0, 0, 0,232, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,232, 0, 0, 0,254, 0, 0, 2, 47, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 88, 0, 0, 2, 47, 0, 0, 0,254, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,254, 0, 0, 0,232,
- 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,104, 0, 0, 0,141, 0, 0, 2, 49, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 49, 0, 0, 1,106, 0, 0, 1,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 29, 0, 0, 1,104, 0, 0, 1,106,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,106, 0, 0, 2, 49, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 50,
- 0, 0, 0,142, 0, 0, 2, 49, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 49, 0, 0, 2, 51, 0, 0, 2, 50, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,143, 0, 0, 2, 50, 0, 0, 2, 51, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 51, 0, 0, 2, 49,
- 0, 0, 0,141, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,105, 0, 0, 0, 35, 0, 0, 1,109, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,109, 0, 0, 2, 51, 0, 0, 1,105, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,141, 0, 0, 1,105, 0, 0, 2, 51,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 51, 0, 0, 1,109, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 50,
- 0, 0, 0,143, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,108, 0, 0, 1,107, 0, 0, 2, 50, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,142, 0, 0, 2, 50, 0, 0, 1,107, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,107, 0, 0, 1,108,
- 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,236, 0, 0, 0, 79, 0, 0, 2, 52, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 52, 0, 0, 1, 0, 0, 0, 0,236, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 9, 0, 0, 0,236, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 2, 52, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 53,
- 0, 0, 0, 89, 0, 0, 2, 52, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 52, 0, 0, 2, 54, 0, 0, 2, 53, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,143, 0, 0, 2, 53, 0, 0, 2, 54, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 54, 0, 0, 2, 52,
- 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,237, 0, 0, 0, 30, 0, 0, 1,108, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,108, 0, 0, 2, 54, 0, 0, 0,237, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 79, 0, 0, 0,237, 0, 0, 2, 54,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 54, 0, 0, 1,108, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 53,
- 0, 0, 0,143, 0, 0, 1,109, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,109, 0, 0, 1, 1, 0, 0, 2, 53, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 89, 0, 0, 2, 53, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 1, 0, 0, 1,109,
- 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,235, 0, 0, 0, 78, 0, 0, 2, 55, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 55, 0, 0, 1,107, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0,235, 0, 0, 1,107,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,107, 0, 0, 2, 55, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 56,
- 0, 0, 0,142, 0, 0, 2, 55, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 55, 0, 0, 2, 57, 0, 0, 2, 56, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 76, 0, 0, 2, 56, 0, 0, 2, 57, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 57, 0, 0, 2, 55,
- 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,234, 0, 0, 0, 4, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,230, 0, 0, 2, 57, 0, 0, 0,234, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 78, 0, 0, 0,234, 0, 0, 2, 57,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 57, 0, 0, 0,230, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 56,
- 0, 0, 0, 76, 0, 0, 0,231, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,231, 0, 0, 1,106, 0, 0, 2, 56, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,142, 0, 0, 2, 56, 0, 0, 1,106, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,106, 0, 0, 0,231,
- 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,111, 0, 0, 0,144, 0, 0, 2, 58, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 58, 0, 0, 1, 3, 0, 0, 1,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 36, 0, 0, 1,111, 0, 0, 1, 3,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3, 0, 0, 2, 58, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 59,
- 0, 0, 0, 90, 0, 0, 2, 58, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 58, 0, 0, 2, 60, 0, 0, 2, 59, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 81, 0, 0, 2, 59, 0, 0, 2, 60, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 60, 0, 0, 2, 58,
- 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,110, 0, 0, 0, 31, 0, 0, 0,241, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,241, 0, 0, 2, 60, 0, 0, 1,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,144, 0, 0, 1,110, 0, 0, 2, 60,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 60, 0, 0, 0,241, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 59,
- 0, 0, 0, 81, 0, 0, 0,240, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,240, 0, 0, 1, 2, 0, 0, 2, 59, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 90, 0, 0, 2, 59, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 0,240,
- 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,110, 0, 0, 0,144, 0, 0, 2, 61, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 61, 0, 0, 1,113, 0, 0, 1,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 31, 0, 0, 1,110, 0, 0, 1,113,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,113, 0, 0, 2, 61, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 62,
- 0, 0, 0,145, 0, 0, 2, 61, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 61, 0, 0, 2, 63, 0, 0, 2, 62, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,146, 0, 0, 2, 62, 0, 0, 2, 63, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 63, 0, 0, 2, 61,
- 0, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,111, 0, 0, 0, 36, 0, 0, 1,115, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,115, 0, 0, 2, 63, 0, 0, 1,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,144, 0, 0, 1,111, 0, 0, 2, 63,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 63, 0, 0, 1,115, 0, 0, 0,146, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 62,
- 0, 0, 0,146, 0, 0, 1,114, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,114, 0, 0, 1,112, 0, 0, 2, 62, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,145, 0, 0, 2, 62, 0, 0, 1,112, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,112, 0, 0, 1,114,
- 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,204, 0, 0, 0, 63, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 64, 0, 0, 1, 4, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0,204, 0, 0, 1, 4,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 4, 0, 0, 2, 64, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 65,
- 0, 0, 0, 91, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 64, 0, 0, 2, 66, 0, 0, 2, 65, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,146, 0, 0, 2, 65, 0, 0, 2, 66, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 66, 0, 0, 2, 64,
- 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,205, 0, 0, 0, 22, 0, 0, 1,114, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,114, 0, 0, 2, 66, 0, 0, 0,205, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 63, 0, 0, 0,205, 0, 0, 2, 66,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 66, 0, 0, 1,114, 0, 0, 0,146, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 65,
- 0, 0, 0,146, 0, 0, 1,115, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,115, 0, 0, 1, 5, 0, 0, 2, 65, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 91, 0, 0, 2, 65, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 5, 0, 0, 1,115,
- 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,203, 0, 0, 0, 62, 0, 0, 2, 67, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 2, 67, 0, 0, 1,112, 0, 0, 0,203, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 22, 0, 0, 0,203, 0, 0, 1,112,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,112, 0, 0, 2, 67, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 68,
- 0, 0, 0,145, 0, 0, 2, 67, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 67, 0, 0, 2, 69, 0, 0, 2, 68, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 80, 0, 0, 2, 68, 0, 0, 2, 69, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 69, 0, 0, 2, 67,
- 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,202, 0, 0, 0, 5, 0, 0, 0,238, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0,238, 0, 0, 2, 69, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 62, 0, 0, 0,202, 0, 0, 2, 69,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 69, 0, 0, 0,238, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 68,
- 0, 0, 0, 80, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,239, 0, 0, 1,113, 0, 0, 2, 68, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,145, 0, 0, 2, 68, 0, 0, 1,113, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,113, 0, 0, 0,239,
- 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 70, 0, 0, 0,147, 0, 0, 1,117, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,117, 0, 0, 1, 11, 0, 0, 2, 70, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 94, 0, 0, 2, 70, 0, 0, 1, 11,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 11, 0, 0, 1,117, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 70,
- 0, 0, 0, 94, 0, 0, 2, 71, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 71, 0, 0, 2, 72, 0, 0, 2, 70, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,147, 0, 0, 2, 70, 0, 0, 2, 72, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 72, 0, 0, 2, 71,
- 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,243, 0, 0, 0, 32, 0, 0, 1,116, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,116, 0, 0, 2, 72, 0, 0, 0,243, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 82, 0, 0, 0,243, 0, 0, 2, 72,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 72, 0, 0, 1,116, 0, 0, 0,147, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,242,
- 0, 0, 0, 82, 0, 0, 2, 71, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 71, 0, 0, 1, 10, 0, 0, 0,242, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0,242, 0, 0, 1, 10, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 10, 0, 0, 2, 71,
- 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 73, 0, 0, 0,147, 0, 0, 1,116, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,116, 0, 0, 1,118, 0, 0, 2, 73, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,148, 0, 0, 2, 73, 0, 0, 1,118,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,118, 0, 0, 1,116, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 73,
- 0, 0, 0,148, 0, 0, 2, 74, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 74, 0, 0, 2, 75, 0, 0, 2, 73, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,147, 0, 0, 2, 73, 0, 0, 2, 75, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 75, 0, 0, 2, 74,
- 0, 0, 0,149, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,121, 0, 0, 0, 38, 0, 0, 1,117, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,117, 0, 0, 2, 75, 0, 0, 1,121, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,149, 0, 0, 1,121, 0, 0, 2, 75,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 75, 0, 0, 1,117, 0, 0, 0,147, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,120,
- 0, 0, 0,149, 0, 0, 2, 74, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 74, 0, 0, 1,119, 0, 0, 1,120, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 37, 0, 0, 1,120, 0, 0, 1,119, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,119, 0, 0, 2, 74,
- 0, 0, 0,148, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 76, 0, 0, 0, 93, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 8, 0, 0, 1, 12, 0, 0, 2, 76, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 95, 0, 0, 2, 76, 0, 0, 1, 12,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 12, 0, 0, 1, 8, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 76,
- 0, 0, 0, 95, 0, 0, 2, 77, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 77, 0, 0, 2, 78, 0, 0, 2, 76, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 93, 0, 0, 2, 76, 0, 0, 2, 78, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 78, 0, 0, 2, 77,
- 0, 0, 0,149, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,120, 0, 0, 0, 37, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 9, 0, 0, 2, 78, 0, 0, 1,120, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,149, 0, 0, 1,120, 0, 0, 2, 78,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 78, 0, 0, 1, 9, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,121,
- 0, 0, 0,149, 0, 0, 2, 77, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 77, 0, 0, 1, 13, 0, 0, 1,121, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 38, 0, 0, 1,121, 0, 0, 1, 13, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 13, 0, 0, 2, 77,
- 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 79, 0, 0, 0, 92, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 7, 0, 0, 1,119, 0, 0, 2, 79, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,148, 0, 0, 2, 79, 0, 0, 1,119,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,119, 0, 0, 1, 7, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 79,
- 0, 0, 0,148, 0, 0, 2, 80, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 80, 0, 0, 2, 81, 0, 0, 2, 79, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 92, 0, 0, 2, 79, 0, 0, 2, 81, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 81, 0, 0, 2, 80,
- 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,244, 0, 0, 0, 10, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 6, 0, 0, 2, 81, 0, 0, 0,244, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 83, 0, 0, 0,244, 0, 0, 2, 81,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 81, 0, 0, 1, 6, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,245,
- 0, 0, 0, 83, 0, 0, 2, 80, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 80, 0, 0, 1,118, 0, 0, 0,245, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 32, 0, 0, 0,245, 0, 0, 1,118, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,118, 0, 0, 2, 80,
- 0, 0, 0,148, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 82, 0, 0, 0,150, 0, 0, 1,123, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,123, 0, 0, 1, 15, 0, 0, 2, 82, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 96, 0, 0, 2, 82, 0, 0, 1, 15,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 15, 0, 0, 1,123, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 82,
- 0, 0, 0, 96, 0, 0, 2, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 83, 0, 0, 2, 84, 0, 0, 2, 82, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,150, 0, 0, 2, 82, 0, 0, 2, 84, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 84, 0, 0, 2, 83,
- 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,249, 0, 0, 0, 33, 0, 0, 1,122, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,122, 0, 0, 2, 84, 0, 0, 0,249, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 85, 0, 0, 0,249, 0, 0, 2, 84,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 84, 0, 0, 1,122, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,248,
- 0, 0, 0, 85, 0, 0, 2, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 83, 0, 0, 1, 14, 0, 0, 0,248, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0,248, 0, 0, 1, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 14, 0, 0, 2, 83,
- 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 85, 0, 0, 0,150, 0, 0, 1,122, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,122, 0, 0, 1,124, 0, 0, 2, 85, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,151, 0, 0, 2, 85, 0, 0, 1,124,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,124, 0, 0, 1,122, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 85,
- 0, 0, 0,151, 0, 0, 2, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 86, 0, 0, 2, 87, 0, 0, 2, 85, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,150, 0, 0, 2, 85, 0, 0, 2, 87, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 87, 0, 0, 2, 86,
- 0, 0, 0,152, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,127, 0, 0, 0, 39, 0, 0, 1,123, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,123, 0, 0, 2, 87, 0, 0, 1,127, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,152, 0, 0, 1,127, 0, 0, 2, 87,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 87, 0, 0, 1,123, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,126,
- 0, 0, 0,152, 0, 0, 2, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 86, 0, 0, 1,125, 0, 0, 1,126, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 38, 0, 0, 1,126, 0, 0, 1,125, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,125, 0, 0, 2, 86,
- 0, 0, 0,151, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 88, 0, 0, 0, 95, 0, 0, 1, 12, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 12, 0, 0, 1, 16, 0, 0, 2, 88, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 97, 0, 0, 2, 88, 0, 0, 1, 16,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 16, 0, 0, 1, 12, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 88,
- 0, 0, 0, 97, 0, 0, 2, 89, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 89, 0, 0, 2, 90, 0, 0, 2, 88, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 95, 0, 0, 2, 88, 0, 0, 2, 90, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 90, 0, 0, 2, 89,
- 0, 0, 0,152, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,126, 0, 0, 0, 38, 0, 0, 1, 13, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 13, 0, 0, 2, 90, 0, 0, 1,126, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,152, 0, 0, 1,126, 0, 0, 2, 90,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 90, 0, 0, 1, 13, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,127,
- 0, 0, 0,152, 0, 0, 2, 89, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 89, 0, 0, 1, 17, 0, 0, 1,127, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 39, 0, 0, 1,127, 0, 0, 1, 17, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 17, 0, 0, 2, 89,
- 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 91, 0, 0, 0, 94, 0, 0, 1, 11, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 11, 0, 0, 1,125, 0, 0, 2, 91, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,151, 0, 0, 2, 91, 0, 0, 1,125,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,125, 0, 0, 1, 11, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 91,
- 0, 0, 0,151, 0, 0, 2, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 92, 0, 0, 2, 93, 0, 0, 2, 91, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 94, 0, 0, 2, 91, 0, 0, 2, 93, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 93, 0, 0, 2, 92,
- 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,246, 0, 0, 0, 6, 0, 0, 1, 10, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 10, 0, 0, 2, 93, 0, 0, 0,246, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 84, 0, 0, 0,246, 0, 0, 2, 93,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 93, 0, 0, 1, 10, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,247,
- 0, 0, 0, 84, 0, 0, 2, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 92, 0, 0, 1,124, 0, 0, 0,247, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 33, 0, 0, 0,247, 0, 0, 1,124, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,124, 0, 0, 2, 92,
- 0, 0, 0,151, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 94, 0, 0, 0,153, 0, 0, 1,129, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,129, 0, 0, 1, 19, 0, 0, 2, 94, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 98, 0, 0, 2, 94, 0, 0, 1, 19,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 19, 0, 0, 1,129, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 94,
- 0, 0, 0, 98, 0, 0, 2, 95, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 95, 0, 0, 2, 96, 0, 0, 2, 94, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,153, 0, 0, 2, 94, 0, 0, 2, 96, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 96, 0, 0, 2, 95,
- 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,253, 0, 0, 0, 34, 0, 0, 1,128, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,128, 0, 0, 2, 96, 0, 0, 0,253, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 87, 0, 0, 0,253, 0, 0, 2, 96,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 96, 0, 0, 1,128, 0, 0, 0,153, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,252,
- 0, 0, 0, 87, 0, 0, 2, 95, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 95, 0, 0, 1, 18, 0, 0, 0,252, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0,252, 0, 0, 1, 18, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 18, 0, 0, 2, 95,
- 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 97, 0, 0, 0,153, 0, 0, 1,128, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,128, 0, 0, 1,130, 0, 0, 2, 97, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,154, 0, 0, 2, 97, 0, 0, 1,130,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,130, 0, 0, 1,128, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 97,
- 0, 0, 0,154, 0, 0, 2, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 98, 0, 0, 2, 99, 0, 0, 2, 97, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,153, 0, 0, 2, 97, 0, 0, 2, 99, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 99, 0, 0, 2, 98,
- 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,133, 0, 0, 0, 40, 0, 0, 1,129, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,129, 0, 0, 2, 99, 0, 0, 1,133, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,155, 0, 0, 1,133, 0, 0, 2, 99,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 99, 0, 0, 1,129, 0, 0, 0,153, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,132,
- 0, 0, 0,155, 0, 0, 2, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 98, 0, 0, 1,131, 0, 0, 1,132, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 39, 0, 0, 1,132, 0, 0, 1,131, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,131, 0, 0, 2, 98,
- 0, 0, 0,154, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,100, 0, 0, 0, 97, 0, 0, 1, 16, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 16, 0, 0, 1, 20, 0, 0, 2,100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 99, 0, 0, 2,100, 0, 0, 1, 20,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 20, 0, 0, 1, 16, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,100,
- 0, 0, 0, 99, 0, 0, 2,101, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,101, 0, 0, 2,102, 0, 0, 2,100, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 97, 0, 0, 2,100, 0, 0, 2,102, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,102, 0, 0, 2,101,
- 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,132, 0, 0, 0, 39, 0, 0, 1, 17, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 17, 0, 0, 2,102, 0, 0, 1,132, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,155, 0, 0, 1,132, 0, 0, 2,102,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,102, 0, 0, 1, 17, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,133,
- 0, 0, 0,155, 0, 0, 2,101, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,101, 0, 0, 1, 21, 0, 0, 1,133, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 40, 0, 0, 1,133, 0, 0, 1, 21, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 21, 0, 0, 2,101,
- 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,103, 0, 0, 0, 96, 0, 0, 1, 15, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 15, 0, 0, 1,131, 0, 0, 2,103, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,154, 0, 0, 2,103, 0, 0, 1,131,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,131, 0, 0, 1, 15, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,103,
- 0, 0, 0,154, 0, 0, 2,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,104, 0, 0, 2,105, 0, 0, 2,103, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 96, 0, 0, 2,103, 0, 0, 2,105, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,105, 0, 0, 2,104,
- 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,250, 0, 0, 0, 7, 0, 0, 1, 14, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 14, 0, 0, 2,105, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 86, 0, 0, 0,250, 0, 0, 2,105,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,105, 0, 0, 1, 14, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,251,
- 0, 0, 0, 86, 0, 0, 2,104, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,104, 0, 0, 1,130, 0, 0, 0,251, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 34, 0, 0, 0,251, 0, 0, 1,130, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,130, 0, 0, 2,104,
- 0, 0, 0,154, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,106, 0, 0, 0,156, 0, 0, 1,135, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,135, 0, 0, 1, 23, 0, 0, 2,106, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,100, 0, 0, 2,106, 0, 0, 1, 23,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 23, 0, 0, 1,135, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,106,
- 0, 0, 0,100, 0, 0, 2,107, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,107, 0, 0, 2,108, 0, 0, 2,106, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,156, 0, 0, 2,106, 0, 0, 2,108, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,108, 0, 0, 2,107,
- 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 35, 0, 0, 1,134, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,134, 0, 0, 2,108, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 89, 0, 0, 1, 1, 0, 0, 2,108,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,108, 0, 0, 1,134, 0, 0, 0,156, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0,
- 0, 0, 0, 89, 0, 0, 2,107, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,107, 0, 0, 1, 22, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 9, 0, 0, 1, 0, 0, 0, 1, 22, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 22, 0, 0, 2,107,
- 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,109, 0, 0, 0,156, 0, 0, 1,134, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,134, 0, 0, 1,136, 0, 0, 2,109, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,157, 0, 0, 2,109, 0, 0, 1,136,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,136, 0, 0, 1,134, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,109,
- 0, 0, 0,157, 0, 0, 2,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,110, 0, 0, 2,111, 0, 0, 2,109, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,156, 0, 0, 2,109, 0, 0, 2,111, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,111, 0, 0, 2,110,
- 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,139, 0, 0, 0, 41, 0, 0, 1,135, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,135, 0, 0, 2,111, 0, 0, 1,139, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 1,139, 0, 0, 2,111,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,111, 0, 0, 1,135, 0, 0, 0,156, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,138,
- 0, 0, 0,158, 0, 0, 2,110, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,110, 0, 0, 1,137, 0, 0, 1,138, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 40, 0, 0, 1,138, 0, 0, 1,137, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,137, 0, 0, 2,110,
- 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,112, 0, 0, 0, 99, 0, 0, 1, 20, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 20, 0, 0, 1, 24, 0, 0, 2,112, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,101, 0, 0, 2,112, 0, 0, 1, 24,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 24, 0, 0, 1, 20, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,112,
- 0, 0, 0,101, 0, 0, 2,113, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,113, 0, 0, 2,114, 0, 0, 2,112, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 99, 0, 0, 2,112, 0, 0, 2,114, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,114, 0, 0, 2,113,
- 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,138, 0, 0, 0, 40, 0, 0, 1, 21, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 21, 0, 0, 2,114, 0, 0, 1,138, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,158, 0, 0, 1,138, 0, 0, 2,114,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,114, 0, 0, 1, 21, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,139,
- 0, 0, 0,158, 0, 0, 2,113, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,113, 0, 0, 1, 25, 0, 0, 1,139, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 41, 0, 0, 1,139, 0, 0, 1, 25, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 25, 0, 0, 2,113,
- 0, 0, 0,101, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,115, 0, 0, 0, 98, 0, 0, 1, 19, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 19, 0, 0, 1,137, 0, 0, 2,115, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,157, 0, 0, 2,115, 0, 0, 1,137,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,137, 0, 0, 1, 19, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,115,
- 0, 0, 0,157, 0, 0, 2,116, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,116, 0, 0, 2,117, 0, 0, 2,115, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 98, 0, 0, 2,115, 0, 0, 2,117, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,117, 0, 0, 2,116,
- 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,254, 0, 0, 0, 8, 0, 0, 1, 18, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 18, 0, 0, 2,117, 0, 0, 0,254, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 88, 0, 0, 0,254, 0, 0, 2,117,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,117, 0, 0, 1, 18, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,255,
- 0, 0, 0, 88, 0, 0, 2,116, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,116, 0, 0, 1,136, 0, 0, 0,255, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0,255, 0, 0, 1,136, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,136, 0, 0, 2,116,
- 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,118, 0, 0, 0,159, 0, 0, 1,141, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,141, 0, 0, 1, 7, 0, 0, 2,118, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 92, 0, 0, 2,118, 0, 0, 1, 7,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 7, 0, 0, 1,141, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,118,
- 0, 0, 0, 92, 0, 0, 2,119, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,119, 0, 0, 2,120, 0, 0, 2,118, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,159, 0, 0, 2,118, 0, 0, 2,120, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,120, 0, 0, 2,119,
- 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 5, 0, 0, 0, 36, 0, 0, 1,140, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,140, 0, 0, 2,120, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 91, 0, 0, 1, 5, 0, 0, 2,120,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,120, 0, 0, 1,140, 0, 0, 0,159, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 4,
- 0, 0, 0, 91, 0, 0, 2,119, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,119, 0, 0, 1, 6, 0, 0, 1, 4, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 1, 4, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 6, 0, 0, 2,119,
- 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,121, 0, 0, 0,159, 0, 0, 1,140, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,140, 0, 0, 1,142, 0, 0, 2,121, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,160, 0, 0, 2,121, 0, 0, 1,142,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,142, 0, 0, 1,140, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,121,
- 0, 0, 0,160, 0, 0, 2,122, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,122, 0, 0, 2,123, 0, 0, 2,121, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,159, 0, 0, 2,121, 0, 0, 2,123, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,123, 0, 0, 2,122,
- 0, 0, 0,161, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,144, 0, 0, 0, 37, 0, 0, 1,141, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1,141, 0, 0, 2,123, 0, 0, 1,144, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,161, 0, 0, 1,144, 0, 0, 2,123,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,123, 0, 0, 1,141, 0, 0, 0,159, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,145,
- 0, 0, 0,161, 0, 0, 2,122, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,122, 0, 0, 1,143, 0, 0, 1,145, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 41, 0, 0, 1,145, 0, 0, 1,143, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 2,122,
- 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,124, 0, 0, 0,101, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 24, 0, 0, 1, 8, 0, 0, 2,124, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 93, 0, 0, 2,124, 0, 0, 1, 8,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 8, 0, 0, 1, 24, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,124,
- 0, 0, 0, 93, 0, 0, 2,125, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,125, 0, 0, 2,126, 0, 0, 2,124, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,101, 0, 0, 2,124, 0, 0, 2,126, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,126, 0, 0, 2,125,
- 0, 0, 0,161, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,145, 0, 0, 0, 41, 0, 0, 1, 25, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 25, 0, 0, 2,126, 0, 0, 1,145, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,161, 0, 0, 1,145, 0, 0, 2,126,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,126, 0, 0, 1, 25, 0, 0, 0,101, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,144,
- 0, 0, 0,161, 0, 0, 2,125, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,125, 0, 0, 1, 9, 0, 0, 1,144, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 37, 0, 0, 1,144, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 9, 0, 0, 2,125,
- 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,127, 0, 0, 0,100, 0, 0, 1, 23, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 23, 0, 0, 1,143, 0, 0, 2,127, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,160, 0, 0, 2,127, 0, 0, 1,143,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,143, 0, 0, 1, 23, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,127,
- 0, 0, 0,160, 0, 0, 2,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,128, 0, 0, 2,129, 0, 0, 2,127, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0,100, 0, 0, 2,127, 0, 0, 2,129, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,129, 0, 0, 2,128,
- 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 0, 9, 0, 0, 1, 22, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 1, 22, 0, 0, 2,129, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 90, 0, 0, 1, 2, 0, 0, 2,129,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,129, 0, 0, 1, 22, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 3,
- 0, 0, 0, 90, 0, 0, 2,128, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2,128, 0, 0, 1,142, 0, 0, 1, 3, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 36, 0, 0, 1, 3, 0, 0, 1,142, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1,142, 0, 0, 2,128,
- 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 3, 68, 65, 84, 65, 0, 0,220, 0, 12,119, 64, 32, 0, 0, 0, 65, 0, 0, 5, 0,
- 63,110,222,166, 63, 55,205, 9, 63,105,132,212, 63, 65,236,201, 63,103,153,218, 63, 54,155,119, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,103,153,218, 63, 54,155,119, 63,108,148,118, 63, 44,160,211, 63,110,222,166,
- 63, 55,205, 9, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 36, 63, 45, 28, 36,
- 63,110,222,166, 63, 55,205, 9, 63,108,148,118, 63, 44,160,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,108,148,118, 63, 44,160,211, 63,103,153,218, 63, 54,155,119, 63,102, 17, 87, 63, 43, 52,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 96, 81, 56, 63, 52, 55,170, 63,102, 17, 87, 63, 43, 52,229,
- 63,103,153,218, 63, 54,155,119, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,103,153,218,
- 63, 54,155,119, 63, 97, 75, 9, 63, 63,233, 92, 63, 96, 81, 56, 63, 52, 55,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63, 60, 86, 49, 63, 96, 81, 56, 63, 52, 55,170, 63, 97, 75, 9, 63, 63,233, 92,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 97, 75, 9, 63, 63,233, 92, 63,103,153,218,
- 63, 54,155,119, 63,105,132,212, 63, 65,236,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 98,167,103, 63, 75, 39,168, 63, 89,153,138, 63, 82,228, 39, 63, 89,153,139, 63, 71,153,255, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,139, 63, 71,153,255, 63, 97, 75, 9, 63, 63,233, 92, 63, 98,167,103,
- 63, 75, 39,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,132,212, 63, 65,236,201,
- 63, 98,167,103, 63, 75, 39,168, 63, 97, 75, 9, 63, 63,233, 92, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 97, 75, 9, 63, 63,233, 92, 63, 89,153,139, 63, 71,153,255, 63, 89,153,138, 63, 60, 86, 49, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 96, 81, 56, 63, 52, 55,170, 63, 89,153,138, 63, 60, 86, 49,
- 63, 89,153,139, 63, 49, 12, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,139,
- 63, 49, 12, 79, 63, 95,182,205, 63, 40,228,222, 63, 96, 81, 56, 63, 52, 55,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,102, 17, 87, 63, 43, 52,229, 63, 96, 81, 56, 63, 52, 55,170, 63, 95,182,205, 63, 40,228,222,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 95,182,205, 63, 40,228,222, 63, 89,153,139,
- 63, 49, 12, 79, 63, 89,153,139, 63, 37,200, 45, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 98,167,103, 63, 75, 39,168, 63,105,132,212, 63, 65,236,201, 63,109, 83,168, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,109, 83,168, 63, 78, 83,207, 63,101, 85,135, 63, 88, 64,148, 63, 98,167,103,
- 63, 75, 39,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63, 82,228, 39,
- 63, 98,167,103, 63, 75, 39,168, 63,101, 85,135, 63, 88, 64,148, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,101, 85,135, 63, 88, 64,148, 63,109, 83,168, 63, 78, 83,207, 63,115, 51, 36, 63, 90, 56, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121, 18,162, 63, 78, 83,207, 63,115, 51, 36, 63, 90, 56, 22,
- 63,109, 83,168, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,109, 83,168,
- 63, 78, 83,207, 63,115, 51, 36, 63, 67, 23,115, 63,121, 18,162, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,124,225,116, 63, 65,236,202, 63,121, 18,162, 63, 78, 83,207, 63,115, 51, 36, 63, 67, 23,115,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 36, 63, 67, 23,115, 63,109, 83,168,
- 63, 78, 83,207, 63,105,132,212, 63, 65,236,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,110,222,166, 63, 55,205, 9, 63,115, 51, 36, 63, 45, 28, 36, 63,119,135,163, 63, 55,205, 11, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,119,135,163, 63, 55,205, 11, 63,115, 51, 36, 63, 67, 23,115, 63,110,222,166,
- 63, 55,205, 9, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,132,212, 63, 65,236,201,
- 63,110,222,166, 63, 55,205, 9, 63,115, 51, 36, 63, 67, 23,115, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,115, 51, 36, 63, 67, 23,115, 63,119,135,163, 63, 55,205, 11, 63,124,225,116, 63, 65,236,202, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121, 18,162, 63, 78, 83,207, 63,124,225,116, 63, 65,236,202,
- 63,129,223,113, 63, 75, 39,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,129,223,113,
- 63, 75, 39,170, 63,128,136, 98, 63, 88, 64,148, 63,121, 18,162, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 36, 63, 90, 56, 22, 63,121, 18,162, 63, 78, 83,207, 63,128,136, 98, 63, 88, 64,148,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 59,136, 98, 95, 63, 88, 64,148, 60,111,184,160,
- 63, 75, 39,170, 61, 76,203,243, 63, 82,228, 41, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61, 76,203,243, 63, 49, 12, 82, 61, 76,203,246, 63, 60, 86, 53, 60,194,162, 31, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,194,162, 31, 63, 52, 55,172, 60,213,239,111, 63, 40,228,223, 61, 76,203,243,
- 63, 49, 12, 82, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,246, 63, 37,200, 48,
- 61, 76,203,243, 63, 49, 12, 82, 60,213,239,111, 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 60,213,239,111, 63, 40,228,223, 60,194,162, 31, 63, 52, 55,172, 58,169,226,120, 63, 43, 52,230, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,126,204,111, 63, 54,155,121, 63,128, 42,121, 63, 43, 52,230,
- 63,131, 10,136, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,131, 10,136,
- 63, 52, 55,172, 63,130,141,160, 63, 63,233, 95, 63,126,204,111, 63, 54,155,121, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,124,225,116, 63, 65,236,202, 63,126,204,111, 63, 54,155,121, 63,130,141,160, 63, 63,233, 95,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,163,104, 11, 63, 63,233, 95, 60,194,162, 31,
- 63, 52, 55,172, 61, 76,203,246, 63, 60, 86, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61, 76,203,244, 63, 71,154, 2, 61, 76,203,243, 63, 82,228, 41, 60,111,184,160, 63, 75, 39,170, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,111,184,160, 63, 75, 39,170, 60,163,104, 11, 63, 63,233, 95, 61, 76,203,244,
- 63, 71,154, 2, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,246, 63, 60, 86, 53,
- 61, 76,203,244, 63, 71,154, 2, 60,163,104, 11, 63, 63,233, 95, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,130,141,160, 63, 63,233, 95, 63,129,223,113, 63, 75, 39,170, 63,124,225,116, 63, 65,236,202, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,126,204,111, 63, 54,155,121, 63,124,225,116, 63, 65,236,202,
- 63,119,135,163, 63, 55,205, 11, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,119,135,163,
- 63, 55,205, 11, 63,121,209,210, 63, 44,160,212, 63,126,204,111, 63, 54,155,121, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,128, 42,121, 63, 43, 52,230, 63,126,204,111, 63, 54,155,121, 63,121,209,210, 63, 44,160,212,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121,209,210, 63, 44,160,212, 63,119,135,163,
- 63, 55,205, 11, 63,115, 51, 36, 63, 45, 28, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,134,102, 95, 63, 94, 46, 79, 63,134,102, 95, 63,105,114, 22, 63,124,205, 52, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,124,205, 52, 63, 99, 26, 58, 63,128,136, 98, 63, 88, 64,148, 63,134,102, 95,
- 63, 94, 46, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,243, 63, 82,228, 41,
- 61, 76,203,234, 63, 94, 46, 79, 59,136, 98, 95, 63, 88, 64,148, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,128,136, 98, 63, 88, 64,148, 63,124,205, 52, 63, 99, 26, 58, 63,115, 51, 36, 63, 90, 56, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,153, 21, 63, 99, 26, 58, 63,115, 51, 36, 63, 90, 56, 22,
- 63,124,205, 52, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,124,205, 52,
- 63, 99, 26, 58, 63,115, 51, 32, 63,109,154,212, 63,105,153, 21, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63,105,114, 19, 63,105,153, 21, 63, 99, 26, 58, 63,115, 51, 32, 63,109,154,212,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 32, 63,109,154,212, 63,124,205, 52,
- 63, 99, 26, 58, 63,134,102, 95, 63,105,114, 22, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,134,102, 95, 63,116,187,242, 63, 59,153, 3, 63,128, 0, 0, 63, 89,153,136, 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,136, 63,116,187,242, 63,115, 51, 32, 63,109,154,212, 63,134,102, 95,
- 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,134,102, 95, 63,105,114, 22,
- 63,134,102, 95, 63,116,187,242, 63,115, 51, 32, 63,109,154,212, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,115, 51, 32, 63,109,154,212, 63, 89,153,136, 63,116,187,242, 63, 89,153,138, 63,105,114, 19, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,153, 21, 63, 99, 26, 58, 63, 89,153,138, 63,105,114, 19,
- 63, 89,153,138, 63, 94, 46, 77, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138,
- 63, 94, 46, 77, 63,101, 85,135, 63, 88, 64,148, 63,105,153, 21, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 36, 63, 90, 56, 22, 63,105,153, 21, 63, 99, 26, 58, 63,101, 85,135, 63, 88, 64,148,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,101, 85,135, 63, 88, 64,148, 63, 89,153,138,
- 63, 94, 46, 77, 63, 89,153,138, 63, 82,228, 39, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 75,153, 67, 63, 54,155,113, 63, 73,174, 74, 63, 65,236,193, 63, 68, 84,124, 63, 55,204,255, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 68, 84,124, 63, 55,204,255, 63, 70,158,169, 63, 44,160,200, 63, 75,153, 67,
- 63, 54,155,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 77, 33,196, 63, 43, 52,221,
- 63, 75,153, 67, 63, 54,155,113, 63, 70,158,169, 63, 44,160,200, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 70,158,169, 63, 44,160,200, 63, 68, 84,124, 63, 55,204,255, 63, 64, 0, 0, 63, 45, 28, 24, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 75,153, 67, 63, 54,155,113, 63, 77, 33,196, 63, 43, 52,221,
- 63, 82,225,225, 63, 52, 55,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,225,225,
- 63, 52, 55,165, 63, 81,232, 16, 63, 63,233, 89, 63, 75,153, 67, 63, 54,155,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,174, 74, 63, 65,236,193, 63, 75,153, 67, 63, 54,155,113, 63, 81,232, 16, 63, 63,233, 89,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 81,232, 16, 63, 63,233, 89, 63, 82,225,225,
- 63, 52, 55,165, 63, 89,153,138, 63, 60, 86, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 89,153,139, 63, 71,153,255, 63, 89,153,138, 63, 82,228, 39, 63, 80,139,179, 63, 75, 39,164, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 80,139,179, 63, 75, 39,164, 63, 81,232, 16, 63, 63,233, 89, 63, 89,153,139,
- 63, 71,153,255, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63, 60, 86, 49,
- 63, 89,153,139, 63, 71,153,255, 63, 81,232, 16, 63, 63,233, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 81,232, 16, 63, 63,233, 89, 63, 80,139,179, 63, 75, 39,164, 63, 73,174, 74, 63, 65,236,193, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,139, 63, 49, 12, 79, 63, 89,153,138, 63, 60, 86, 49,
- 63, 82,225,225, 63, 52, 55,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,225,225,
- 63, 52, 55,165, 63, 83,124, 75, 63, 40,228,217, 63, 89,153,139, 63, 49, 12, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,139, 63, 37,200, 45, 63, 89,153,139, 63, 49, 12, 79, 63, 83,124, 75, 63, 40,228,217,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 83,124, 75, 63, 40,228,217, 63, 82,225,225,
- 63, 52, 55,165, 63, 77, 33,196, 63, 43, 52,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 69,223,120, 63, 78, 83,198, 63, 73,174, 74, 63, 65,236,193, 63, 80,139,179, 63, 75, 39,164, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 80,139,179, 63, 75, 39,164, 63, 77,221,148, 63, 88, 64,140, 63, 69,223,120,
- 63, 78, 83,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 90, 56, 12,
- 63, 69,223,120, 63, 78, 83,198, 63, 77,221,148, 63, 88, 64,140, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 77,221,148, 63, 88, 64,140, 63, 80,139,179, 63, 75, 39,164, 63, 89,153,138, 63, 82,228, 39, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 69,223,120, 63, 78, 83,198, 63, 64, 0, 0, 63, 90, 56, 12,
- 63, 58, 32,136, 63, 78, 83,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 58, 32,136,
- 63, 78, 83,198, 63, 64, 0, 0, 63, 67, 23,106, 63, 69,223,120, 63, 78, 83,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,174, 74, 63, 65,236,193, 63, 69,223,120, 63, 78, 83,198, 63, 64, 0, 0, 63, 67, 23,106,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 67, 23,106, 63, 58, 32,136,
- 63, 78, 83,198, 63, 54, 81,182, 63, 65,236,193, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 59,171,132, 63, 55,204,255, 63, 64, 0, 0, 63, 45, 28, 24, 63, 68, 84,124, 63, 55,204,255, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 68, 84,124, 63, 55,204,255, 63, 64, 0, 0, 63, 67, 23,106, 63, 59,171,132,
- 63, 55,204,255, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 81,182, 63, 65,236,193,
- 63, 59,171,132, 63, 55,204,255, 63, 64, 0, 0, 63, 67, 23,106, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 64, 0, 0, 63, 67, 23,106, 63, 68, 84,124, 63, 55,204,255, 63, 73,174, 74, 63, 65,236,193, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 47,116, 77, 63, 75, 39,164, 63, 54, 81,182, 63, 65,236,193,
- 63, 58, 32,136, 63, 78, 83,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 58, 32,136,
- 63, 78, 83,198, 63, 50, 34,108, 63, 88, 64,140, 63, 47,116, 77, 63, 75, 39,164, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,118, 63, 82,228, 38, 63, 47,116, 77, 63, 75, 39,164, 63, 50, 34,108, 63, 88, 64,140,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 50, 34,108, 63, 88, 64,140, 63, 58, 32,136,
- 63, 78, 83,198, 63, 64, 0, 0, 63, 90, 56, 12, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 45, 30, 31, 63, 52, 55,165, 63, 38,102,117, 63, 60, 86, 50, 63, 38,102,117, 63, 49, 12, 78, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 49, 12, 78, 63, 44,131,181, 63, 40,228,216, 63, 45, 30, 31,
- 63, 52, 55,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 50,222, 60, 63, 43, 52,221,
- 63, 45, 30, 31, 63, 52, 55,165, 63, 44,131,181, 63, 40,228,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 44,131,181, 63, 40,228,216, 63, 38,102,117, 63, 49, 12, 78, 63, 38,102,117, 63, 37,200, 45, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 30, 31, 63, 52, 55,165, 63, 50,222, 60, 63, 43, 52,221,
- 63, 52,102,189, 63, 54,155,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 52,102,189,
- 63, 54,155,113, 63, 46, 23,240, 63, 63,233, 89, 63, 45, 30, 31, 63, 52, 55,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 60, 86, 50, 63, 45, 30, 31, 63, 52, 55,165, 63, 46, 23,240, 63, 63,233, 89,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 46, 23,240, 63, 63,233, 89, 63, 52,102,189,
- 63, 54,155,113, 63, 54, 81,182, 63, 65,236,193, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 47,116, 77, 63, 75, 39,164, 63, 38,102,118, 63, 82,228, 38, 63, 38,102,117, 63, 71,153,255, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 71,153,255, 63, 46, 23,240, 63, 63,233, 89, 63, 47,116, 77,
- 63, 75, 39,164, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 81,182, 63, 65,236,193,
- 63, 47,116, 77, 63, 75, 39,164, 63, 46, 23,240, 63, 63,233, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 46, 23,240, 63, 63,233, 89, 63, 38,102,117, 63, 71,153,255, 63, 38,102,117, 63, 60, 86, 50, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 59,171,132, 63, 55,204,255, 63, 54, 81,182, 63, 65,236,193,
- 63, 52,102,189, 63, 54,155,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 52,102,189,
- 63, 54,155,113, 63, 57, 97, 87, 63, 44,160,200, 63, 59,171,132, 63, 55,204,255, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 45, 28, 24, 63, 59,171,132, 63, 55,204,255, 63, 57, 97, 87, 63, 44,160,200,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 97, 87, 63, 44,160,200, 63, 52,102,189,
- 63, 54,155,113, 63, 50,222, 60, 63, 43, 52,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 54,101,250, 63, 99, 26, 51, 63, 38,102,118, 63,105,114, 19, 63, 38,102,118, 63, 94, 46, 77, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,118, 63, 94, 46, 77, 63, 50, 34,108, 63, 88, 64,140, 63, 54,101,250,
- 63, 99, 26, 51, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 90, 56, 12,
- 63, 54,101,250, 63, 99, 26, 51, 63, 50, 34,108, 63, 88, 64,140, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 50, 34,108, 63, 88, 64,140, 63, 38,102,118, 63, 94, 46, 77, 63, 38,102,118, 63, 82,228, 38, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54,101,250, 63, 99, 26, 51, 63, 64, 0, 0, 63, 90, 56, 12,
- 63, 73,154, 6, 63, 99, 26, 51, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,154, 6,
- 63, 99, 26, 51, 63, 64, 0, 0, 63,109,154,206, 63, 54,101,250, 63, 99, 26, 51, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,118, 63,105,114, 19, 63, 54,101,250, 63, 99, 26, 51, 63, 64, 0, 0, 63,109,154,206,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63,109,154,206, 63, 73,154, 6,
- 63, 99, 26, 51, 63, 89,153,138, 63,105,114, 19, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 89,153,136, 63,116,187,242, 63, 59,153, 3, 63,128, 0, 0, 63, 38,102,120, 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,120, 63,116,187,242, 63, 64, 0, 0, 63,109,154,206, 63, 89,153,136,
- 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63,105,114, 19,
- 63, 89,153,136, 63,116,187,242, 63, 64, 0, 0, 63,109,154,206, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 64, 0, 0, 63,109,154,206, 63, 38,102,120, 63,116,187,242, 63, 38,102,118, 63,105,114, 19, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63, 94, 46, 77, 63, 89,153,138, 63,105,114, 19,
- 63, 73,154, 6, 63, 99, 26, 51, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,154, 6,
- 63, 99, 26, 51, 63, 77,221,148, 63, 88, 64,140, 63, 89,153,138, 63, 94, 46, 77, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,138, 63, 82,228, 39, 63, 89,153,138, 63, 94, 46, 77, 63, 77,221,148, 63, 88, 64,140,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 77,221,148, 63, 88, 64,140, 63, 73,154, 6,
- 63, 99, 26, 51, 63, 64, 0, 0, 63, 90, 56, 12, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 8, 71,167, 63, 55,205, 7, 61,229,192,170, 63, 65,236,200, 61,214,104,203, 63, 54,155,120, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,214,104,203, 63, 54,155,120, 61,254, 61,201, 63, 44,160,207, 62, 8, 71,167,
- 63, 55,205, 7, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,173, 63, 45, 28, 27,
- 62, 8, 71,167, 63, 55,205, 7, 61,254, 61,201, 63, 44,160,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,254, 61,201, 63, 44,160,207, 61,214,104,203, 63, 54,155,120, 61,202, 36,175, 63, 43, 52,228, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,156, 35,145, 63, 52, 55,172, 61,202, 36,175, 63, 43, 52,228,
- 61,214,104,203, 63, 54,155,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,214,104,203,
- 63, 54,155,120, 61,163,242, 32, 63, 63,233, 96, 61,156, 35,145, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,246, 63, 60, 86, 53, 61,156, 35,145, 63, 52, 55,172, 61,163,242, 32, 63, 63,233, 96,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,163,242, 32, 63, 63,233, 96, 61,214,104,203,
- 63, 54,155,120, 61,229,192,170, 63, 65,236,200, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,174,213, 17, 63, 75, 39,171, 61, 76,203,243, 63, 82,228, 41, 61, 76,203,244, 63, 71,154, 2, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,244, 63, 71,154, 2, 61,163,242, 32, 63, 63,233, 96, 61,174,213, 17,
- 63, 75, 39,171, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,229,192,170, 63, 65,236,200,
- 61,174,213, 17, 63, 75, 39,171, 61,163,242, 32, 63, 63,233, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,163,242, 32, 63, 63,233, 96, 61, 76,203,244, 63, 71,154, 2, 61, 76,203,246, 63, 60, 86, 53, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,156, 35,145, 63, 52, 55,172, 61, 76,203,246, 63, 60, 86, 53,
- 61, 76,203,243, 63, 49, 12, 82, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,243,
- 63, 49, 12, 82, 61,151, 80, 53, 63, 40,228,223, 61,156, 35,145, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,202, 36,175, 63, 43, 52,228, 61,156, 35,145, 63, 52, 55,172, 61,151, 80, 53, 63, 40,228,223,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,151, 80, 53, 63, 40,228,223, 61, 76,203,243,
- 63, 49, 12, 82, 61, 76,203,246, 63, 37,200, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,174,213, 17, 63, 75, 39,171, 61,229,192,170, 63, 65,236,200, 62, 2, 27,169, 63, 78, 83,204, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 2, 27,169, 63, 78, 83,204, 61,196, 70, 23, 63, 88, 64,147, 61,174,213, 17,
- 63, 75, 39,171, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,243, 63, 82,228, 41,
- 61,174,213, 17, 63, 75, 39,171, 61,196, 70, 23, 63, 88, 64,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,196, 70, 23, 63, 88, 64,147, 62, 2, 27,169, 63, 78, 83,204, 62, 25,153,160, 63, 90, 56, 14, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 49, 23,162, 63, 78, 83,195, 62, 25,153,160, 63, 90, 56, 14,
- 62, 2, 27,169, 63, 78, 83,204, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 2, 27,169,
- 63, 78, 83,204, 62, 25,153,172, 63, 67, 23,108, 62, 49, 23,162, 63, 78, 83,195, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 64, 82,240, 63, 65,236,183, 62, 49, 23,162, 63, 78, 83,195, 62, 25,153,172, 63, 67, 23,108,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,172, 63, 67, 23,108, 62, 2, 27,169,
- 63, 78, 83,204, 61,229,192,170, 63, 65,236,200, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 8, 71,167, 63, 55,205, 7, 62, 25,153,173, 63, 45, 28, 27, 62, 42,235,173, 63, 55,204,254, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 42,235,173, 63, 55,204,254, 62, 25,153,172, 63, 67, 23,108, 62, 8, 71,167,
- 63, 55,205, 7, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,229,192,170, 63, 65,236,200,
- 62, 8, 71,167, 63, 55,205, 7, 62, 25,153,172, 63, 67, 23,108, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 25,153,172, 63, 67, 23,108, 62, 42,235,173, 63, 55,204,254, 62, 64, 82,240, 63, 65,236,183, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 49, 23,162, 63, 78, 83,195, 62, 64, 82,240, 63, 65,236,183,
- 62, 91,200,166, 63, 75, 39,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 91,200,166,
- 63, 75, 39,147, 62, 81, 16, 34, 63, 88, 64,131, 62, 49, 23,162, 63, 78, 83,195, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,160, 63, 90, 56, 14, 62, 49, 23,162, 63, 78, 83,195, 62, 81, 16, 34, 63, 88, 64,131,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 81, 16, 34, 63, 88, 64,131, 62, 91,200,166,
- 63, 75, 39,147, 62,128, 0, 0, 63, 82,228, 13, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,128, 0, 0, 63, 49, 12, 47, 62,128, 0, 0, 63, 60, 86, 19, 62,101, 33, 92, 63, 52, 55,146, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,101, 33, 92, 63, 52, 55,146, 62,103,139, 14, 63, 40,228,199, 62,128, 0, 0,
- 63, 49, 12, 47, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 37,200, 23,
- 62,128, 0, 0, 63, 49, 12, 47, 62,103,139, 14, 63, 40,228,199, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,103,139, 14, 63, 40,228,199, 62,101, 33, 92, 63, 52, 55,146, 62, 78, 32,230, 63, 43, 52,211, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 71,254,223, 63, 54,155,102, 62, 78, 32,230, 63, 43, 52,211,
- 62,101, 33, 92, 63, 52, 55,146, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,101, 33, 92,
- 63, 52, 55,146, 62, 97, 58, 23, 63, 63,233, 69, 62, 71,254,223, 63, 54,155,102, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 64, 82,240, 63, 65,236,183, 62, 71,254,223, 63, 54,155,102, 62, 97, 58, 23, 63, 63,233, 69,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 97, 58, 23, 63, 63,233, 69, 62,101, 33, 92,
- 63, 52, 55,146, 62,128, 0, 0, 63, 60, 86, 19, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,128, 0, 0, 63, 71,153,228, 62,128, 0, 0, 63, 82,228, 13, 62, 91,200,166, 63, 75, 39,147, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 91,200,166, 63, 75, 39,147, 62, 97, 58, 23, 63, 63,233, 69, 62,128, 0, 0,
- 63, 71,153,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 60, 86, 19,
- 62,128, 0, 0, 63, 71,153,228, 62, 97, 58, 23, 63, 63,233, 69, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 97, 58, 23, 63, 63,233, 69, 62, 91,200,166, 63, 75, 39,147, 62, 64, 82,240, 63, 65,236,183, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 71,254,223, 63, 54,155,102, 62, 64, 82,240, 63, 65,236,183,
- 62, 42,235,173, 63, 55,204,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 42,235,173,
- 63, 55,204,254, 62, 52, 20,105, 63, 44,160,198, 62, 71,254,223, 63, 54,155,102, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 78, 32,230, 63, 43, 52,211, 62, 71,254,223, 63, 54,155,102, 62, 52, 20,105, 63, 44,160,198,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 52, 20,105, 63, 44,160,198, 62, 42,235,173,
- 63, 55,204,254, 62, 25,153,173, 63, 45, 28, 27, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,128, 0, 0, 63, 94, 46, 58, 62,128, 0, 0, 63,105,114, 8, 62, 64, 1,230, 63, 99, 26, 49, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 64, 1,230, 63, 99, 26, 49, 62, 81, 16, 34, 63, 88, 64,131, 62,128, 0, 0,
- 63, 94, 46, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 82,228, 13,
- 62,128, 0, 0, 63, 94, 46, 58, 62, 81, 16, 34, 63, 88, 64,131, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 81, 16, 34, 63, 88, 64,131, 62, 64, 1,230, 63, 99, 26, 49, 62, 25,153,160, 63, 90, 56, 14, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,230, 98,164, 63, 99, 26, 58, 62, 25,153,160, 63, 90, 56, 14,
- 62, 64, 1,230, 63, 99, 26, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 64, 1,230,
- 63, 99, 26, 49, 62, 25,153,159, 63,109,154,210, 61,230, 98,164, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,237, 63,105,114, 22, 61,230, 98,164, 63, 99, 26, 58, 62, 25,153,159, 63,109,154,210,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,159, 63,109,154,210, 62, 64, 1,230,
- 63, 99, 26, 49, 62,128, 0, 0, 63,105,114, 8, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,128, 0, 0, 63,116,187,232, 63, 59,153, 3, 63,128, 0, 0, 63,134,102, 95, 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,210, 63,116,187,242, 62, 25,153,159, 63,109,154,210, 62,128, 0, 0,
- 63,116,187,232, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63,105,114, 8,
- 62,128, 0, 0, 63,116,187,232, 62, 25,153,159, 63,109,154,210, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 25,153,159, 63,109,154,210, 61, 76,203,210, 63,116,187,242, 61, 76,203,237, 63,105,114, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,230, 98,164, 63, 99, 26, 58, 61, 76,203,237, 63,105,114, 22,
- 61, 76,203,234, 63, 94, 46, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,234,
- 63, 94, 46, 79, 61,196, 70, 23, 63, 88, 64,147, 61,230, 98,164, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,160, 63, 90, 56, 14, 61,230, 98,164, 63, 99, 26, 58, 61,196, 70, 23, 63, 88, 64,147,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,196, 70, 23, 63, 88, 64,147, 61, 76,203,234,
- 63, 94, 46, 79, 61, 76,203,243, 63, 82,228, 41, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,170,138, 42, 63, 55,204,254, 62,159,214,136, 63, 65,236,183, 62,156, 0,145, 63, 54,155,102, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,156, 0,145, 63, 54,155,102, 62,165,245,204, 63, 44,160,198, 62,170,138, 42,
- 63, 55,204,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 42, 63, 45, 28, 28,
- 62,170,138, 42, 63, 55,204,254, 62,165,245,204, 63, 44,160,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,165,245,204, 63, 44,160,198, 62,156, 0,145, 63, 54,155,102, 62,152,239,141, 63, 43, 52,211, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,141,111, 82, 63, 52, 55,146, 62,152,239,141, 63, 43, 52,211,
- 62,156, 0,145, 63, 54,155,102, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,156, 0,145,
- 63, 54,155,102, 62,143, 98,245, 63, 63,233, 68, 62,141,111, 82, 63, 52, 55,146, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 60, 86, 19, 62,141,111, 82, 63, 52, 55,146, 62,143, 98,245, 63, 63,233, 68,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,143, 98,245, 63, 63,233, 68, 62,156, 0,145,
- 63, 54,155,102, 62,159,214,136, 63, 65,236,183, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,146, 27,173, 63, 75, 39,147, 62,128, 0, 0, 63, 82,228, 13, 62,128, 0, 0, 63, 71,153,228, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 71,153,228, 62,143, 98,245, 63, 63,233, 68, 62,146, 27,173,
- 63, 75, 39,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,214,136, 63, 65,236,183,
- 62,146, 27,173, 63, 75, 39,147, 62,143, 98,245, 63, 63,233, 68, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,143, 98,245, 63, 63,233, 68, 62,128, 0, 0, 63, 71,153,228, 62,128, 0, 0, 63, 60, 86, 19, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,141,111, 82, 63, 52, 55,146, 62,128, 0, 0, 63, 60, 86, 19,
- 62,128, 0, 0, 63, 49, 12, 47, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0,
- 63, 49, 12, 47, 62,140, 58,121, 63, 40,228,199, 62,141,111, 82, 63, 52, 55,146, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,152,239,141, 63, 43, 52,211, 62,141,111, 82, 63, 52, 55,146, 62,140, 58,121, 63, 40,228,199,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,140, 58,121, 63, 40,228,199, 62,128, 0, 0,
- 63, 49, 12, 47, 62,128, 0, 0, 63, 37,200, 23, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,146, 27,173, 63, 75, 39,147, 62,159,214,136, 63, 65,236,183, 62,167,116, 47, 63, 78, 83,195, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,167,116, 47, 63, 78, 83,195, 62,151,119,239, 63, 88, 64,131, 62,146, 27,173,
- 63, 75, 39,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 82,228, 13,
- 62,146, 27,173, 63, 75, 39,147, 62,151,119,239, 63, 88, 64,131, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,151,119,239, 63, 88, 64,131, 62,167,116, 47, 63, 78, 83,195, 62,179, 51, 49, 63, 90, 56, 14, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,190,242, 44, 63, 78, 83,205, 62,179, 51, 49, 63, 90, 56, 14,
- 62,167,116, 47, 63, 78, 83,195, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,167,116, 47,
- 63, 78, 83,195, 62,179, 51, 42, 63, 67, 23,108, 62,190,242, 44, 63, 78, 83,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,198,143,214, 63, 65,236,200, 62,190,242, 44, 63, 78, 83,205, 62,179, 51, 42, 63, 67, 23,108,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 42, 63, 67, 23,108, 62,167,116, 47,
- 63, 78, 83,195, 62,159,214,136, 63, 65,236,183, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,170,138, 42, 63, 55,204,254, 62,179, 51, 42, 63, 45, 28, 28, 62,187,220, 45, 63, 55,205, 7, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,187,220, 45, 63, 55,205, 7, 62,179, 51, 42, 63, 67, 23,108, 62,170,138, 42,
- 63, 55,204,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,214,136, 63, 65,236,183,
- 62,170,138, 42, 63, 55,204,254, 62,179, 51, 42, 63, 67, 23,108, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,179, 51, 42, 63, 67, 23,108, 62,187,220, 45, 63, 55,205, 7, 62,198,143,214, 63, 65,236,200, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,190,242, 44, 63, 78, 83,205, 62,198,143,214, 63, 65,236,200,
- 62,212, 74,188, 63, 75, 39,171, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,212, 74,188,
- 63, 75, 39,171, 62,206,238,122, 63, 88, 64,147, 62,190,242, 44, 63, 78, 83,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 49, 63, 90, 56, 14, 62,190,242, 44, 63, 78, 83,205, 62,206,238,122, 63, 88, 64,147,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,206,238,122, 63, 88, 64,147, 62,212, 74,188,
- 63, 75, 39,171, 62,230,102,130, 63, 82,228, 41, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102,130, 63, 49, 12, 82, 62,230,102,129, 63, 60, 86, 53, 62,216,247, 28, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,216,247, 28, 63, 52, 55,172, 62,218, 43,243, 63, 40,228,223, 62,230,102,130,
- 63, 49, 12, 82, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,129, 63, 37,200, 48,
- 62,230,102,130, 63, 49, 12, 82, 62,218, 43,243, 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,218, 43,243, 63, 40,228,223, 62,216,247, 28, 63, 52, 55,172, 62,205,118,212, 63, 43, 52,228, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,202,101,206, 63, 54,155,120, 62,205,118,212, 63, 43, 52,228,
- 62,216,247, 28, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,216,247, 28,
- 63, 52, 55,172, 62,215, 3,120, 63, 63,233, 95, 62,202,101,206, 63, 54,155,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,198,143,214, 63, 65,236,200, 62,202,101,206, 63, 54,155,120, 62,215, 3,120, 63, 63,233, 95,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,215, 3,120, 63, 63,233, 95, 62,216,247, 28,
- 63, 52, 55,172, 62,230,102,129, 63, 60, 86, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102,130, 63, 71,154, 1, 62,230,102,130, 63, 82,228, 41, 62,212, 74,188, 63, 75, 39,171, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,212, 74,188, 63, 75, 39,171, 62,215, 3,120, 63, 63,233, 95, 62,230,102,130,
- 63, 71,154, 1, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,129, 63, 60, 86, 53,
- 62,230,102,130, 63, 71,154, 1, 62,215, 3,120, 63, 63,233, 95, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,215, 3,120, 63, 63,233, 95, 62,212, 74,188, 63, 75, 39,171, 62,198,143,214, 63, 65,236,200, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,202,101,206, 63, 54,155,120, 62,198,143,214, 63, 65,236,200,
- 62,187,220, 45, 63, 55,205, 7, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,187,220, 45,
- 63, 55,205, 7, 62,192,112,142, 63, 44,160,207, 62,202,101,206, 63, 54,155,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,205,118,212, 63, 43, 52,228, 62,202,101,206, 63, 54,155,120, 62,192,112,142, 63, 44,160,207,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,192,112,142, 63, 44,160,207, 62,187,220, 45,
- 63, 55,205, 7, 62,179, 51, 42, 63, 45, 28, 28, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102,131, 63, 94, 46, 79, 62,230,102,131, 63,105,114, 22, 62,198,103, 87, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198,103, 87, 63, 99, 26, 58, 62,206,238,122, 63, 88, 64,147, 62,230,102,131,
- 63, 94, 46, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,130, 63, 82,228, 41,
- 62,230,102,131, 63, 94, 46, 79, 62,206,238,122, 63, 88, 64,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,206,238,122, 63, 88, 64,147, 62,198,103, 87, 63, 99, 26, 58, 62,179, 51, 49, 63, 90, 56, 14, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,255, 14, 63, 99, 26, 49, 62,179, 51, 49, 63, 90, 56, 14,
- 62,198,103, 87, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198,103, 87,
- 63, 99, 26, 58, 62,179, 51, 49, 63,109,154,210, 62,159,255, 14, 63, 99, 26, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63,105,114, 8, 62,159,255, 14, 63, 99, 26, 49, 62,179, 51, 49, 63,109,154,210,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 49, 63,109,154,210, 62,198,103, 87,
- 63, 99, 26, 58, 62,230,102,131, 63,105,114, 22, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102,134, 63,116,187,242, 63, 59,153, 3, 63,128, 0, 0, 62,128, 0, 0, 63,116,187,232, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63,116,187,232, 62,179, 51, 49, 63,109,154,210, 62,230,102,134,
- 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,131, 63,105,114, 22,
- 62,230,102,134, 63,116,187,242, 62,179, 51, 49, 63,109,154,210, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,179, 51, 49, 63,109,154,210, 62,128, 0, 0, 63,116,187,232, 62,128, 0, 0, 63,105,114, 8, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,255, 14, 63, 99, 26, 49, 62,128, 0, 0, 63,105,114, 8,
- 62,128, 0, 0, 63, 94, 46, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0,
- 63, 94, 46, 58, 62,151,119,239, 63, 88, 64,131, 62,159,255, 14, 63, 99, 26, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 49, 63, 90, 56, 14, 62,159,255, 14, 63, 99, 26, 49, 62,151,119,239, 63, 88, 64,131,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,151,119,239, 63, 88, 64,131, 62,128, 0, 0,
- 63, 94, 46, 58, 62,128, 0, 0, 63, 82,228, 13, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 8,120, 93, 63, 55,205, 11, 63, 3, 30,140, 63, 65,236,201, 63, 1, 51,145, 63, 54,155,121, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 1, 51,145, 63, 54,155,121, 63, 6, 46, 46, 63, 44,160,211, 63, 8,120, 93,
- 63, 55,205, 11, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,220, 63, 45, 28, 35,
- 63, 8,120, 93, 63, 55,205, 11, 63, 6, 46, 46, 63, 44,160,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 6, 46, 46, 63, 44,160,211, 63, 1, 51,145, 63, 54,155,121, 62,255, 86, 30, 63, 43, 52,230, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,243,213,222, 63, 52, 55,172, 62,255, 86, 30, 63, 43, 52,230,
- 63, 1, 51,145, 63, 54,155,121, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 1, 51,145,
- 63, 54,155,121, 62,245,201,128, 63, 63,233, 94, 62,243,213,222, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,129, 63, 60, 86, 53, 62,243,213,222, 63, 52, 55,172, 62,245,201,128, 63, 63,233, 94,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,245,201,128, 63, 63,233, 94, 63, 1, 51,145,
- 63, 54,155,121, 63, 3, 30,140, 63, 65,236,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,248,130, 59, 63, 75, 39,169, 62,230,102,130, 63, 82,228, 41, 62,230,102,130, 63, 71,154, 1, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,130, 63, 71,154, 1, 62,245,201,128, 63, 63,233, 94, 62,248,130, 59,
- 63, 75, 39,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 30,140, 63, 65,236,201,
- 62,248,130, 59, 63, 75, 39,169, 62,245,201,128, 63, 63,233, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,245,201,128, 63, 63,233, 94, 62,230,102,130, 63, 71,154, 1, 62,230,102,129, 63, 60, 86, 53, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,243,213,222, 63, 52, 55,172, 62,230,102,129, 63, 60, 86, 53,
- 62,230,102,130, 63, 49, 12, 82, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,130,
- 63, 49, 12, 82, 62,242,161, 9, 63, 40,228,223, 62,243,213,222, 63, 52, 55,172, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,255, 86, 30, 63, 43, 52,230, 62,243,213,222, 63, 52, 55,172, 62,242,161, 9, 63, 40,228,223,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,242,161, 9, 63, 40,228,223, 62,230,102,130,
- 63, 49, 12, 82, 62,230,102,129, 63, 37,200, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,248,130, 59, 63, 75, 39,169, 63, 3, 30,140, 63, 65,236,201, 63, 6,237, 94, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6,237, 94, 63, 78, 83,207, 62,253,222,118, 63, 88, 64,148, 62,248,130, 59,
- 63, 75, 39,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,130, 63, 82,228, 41,
- 62,248,130, 59, 63, 75, 39,169, 62,253,222,118, 63, 88, 64,148, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,253,222,118, 63, 88, 64,148, 63, 6,237, 94, 63, 78, 83,207, 63, 12,204,220, 63, 90, 56, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 18,172, 88, 63, 78, 83,207, 63, 12,204,220, 63, 90, 56, 22,
- 63, 6,237, 94, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6,237, 94,
- 63, 78, 83,207, 63, 12,204,220, 63, 67, 23,115, 63, 18,172, 88, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,123, 44, 63, 65,236,201, 63, 18,172, 88, 63, 78, 83,207, 63, 12,204,220, 63, 67, 23,115,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,220, 63, 67, 23,115, 63, 6,237, 94,
- 63, 78, 83,207, 63, 3, 30,140, 63, 65,236,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 8,120, 93, 63, 55,205, 11, 63, 12,204,220, 63, 45, 28, 35, 63, 17, 33, 91, 63, 55,205, 9, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 17, 33, 91, 63, 55,205, 9, 63, 12,204,220, 63, 67, 23,115, 63, 8,120, 93,
- 63, 55,205, 11, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 30,140, 63, 65,236,201,
- 63, 8,120, 93, 63, 55,205, 11, 63, 12,204,220, 63, 67, 23,115, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 12,204,220, 63, 67, 23,115, 63, 17, 33, 91, 63, 55,205, 9, 63, 22,123, 44, 63, 65,236,201, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 18,172, 88, 63, 78, 83,207, 63, 22,123, 44, 63, 65,236,201,
- 63, 29, 88,153, 63, 75, 39,167, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 29, 88,153,
- 63, 75, 39,167, 63, 26,170,121, 63, 88, 64,147, 63, 18,172, 88, 63, 78, 83,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,220, 63, 90, 56, 22, 63, 18,172, 88, 63, 78, 83,207, 63, 26,170,121, 63, 88, 64,147,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 26,170,121, 63, 88, 64,147, 63, 29, 88,153,
- 63, 75, 39,167, 63, 38,102,118, 63, 82,228, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,117, 63, 49, 12, 78, 63, 38,102,117, 63, 60, 86, 50, 63, 31,174,200, 63, 52, 55,169, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,174,200, 63, 52, 55,169, 63, 32, 73, 51, 63, 40,228,221, 63, 38,102,117,
- 63, 49, 12, 78, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 37,200, 45,
- 63, 38,102,117, 63, 49, 12, 78, 63, 32, 73, 51, 63, 40,228,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 32, 73, 51, 63, 40,228,221, 63, 31,174,200, 63, 52, 55,169, 63, 25,238,169, 63, 43, 52,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 24,102, 39, 63, 54,155,119, 63, 25,238,169, 63, 43, 52,229,
- 63, 31,174,200, 63, 52, 55,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,174,200,
- 63, 52, 55,169, 63, 30,180,246, 63, 63,233, 92, 63, 24,102, 39, 63, 54,155,119, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,123, 44, 63, 65,236,201, 63, 24,102, 39, 63, 54,155,119, 63, 30,180,246, 63, 63,233, 92,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 30,180,246, 63, 63,233, 92, 63, 31,174,200,
- 63, 52, 55,169, 63, 38,102,117, 63, 60, 86, 50, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,117, 63, 71,153,255, 63, 38,102,118, 63, 82,228, 38, 63, 29, 88,153, 63, 75, 39,167, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 29, 88,153, 63, 75, 39,167, 63, 30,180,246, 63, 63,233, 92, 63, 38,102,117,
- 63, 71,153,255, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 60, 86, 50,
- 63, 38,102,117, 63, 71,153,255, 63, 30,180,246, 63, 63,233, 92, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 30,180,246, 63, 63,233, 92, 63, 29, 88,153, 63, 75, 39,167, 63, 22,123, 44, 63, 65,236,201, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 24,102, 39, 63, 54,155,119, 63, 22,123, 44, 63, 65,236,201,
- 63, 17, 33, 91, 63, 55,205, 9, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 17, 33, 91,
- 63, 55,205, 9, 63, 19,107,138, 63, 44,160,211, 63, 24,102, 39, 63, 54,155,119, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,238,169, 63, 43, 52,229, 63, 24,102, 39, 63, 54,155,119, 63, 19,107,138, 63, 44,160,211,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,107,138, 63, 44,160,211, 63, 17, 33, 91,
- 63, 55,205, 9, 63, 12,204,220, 63, 45, 28, 35, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,118, 63, 94, 46, 77, 63, 38,102,118, 63,105,114, 19, 63, 22,102,235, 63, 99, 26, 59, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,102,235, 63, 99, 26, 59, 63, 26,170,121, 63, 88, 64,147, 63, 38,102,118,
- 63, 94, 46, 77, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,118, 63, 82,228, 38,
- 63, 38,102,118, 63, 94, 46, 77, 63, 26,170,121, 63, 88, 64,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 26,170,121, 63, 88, 64,147, 63, 22,102,235, 63, 99, 26, 59, 63, 12,204,220, 63, 90, 56, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 50,204, 63, 99, 26, 58, 63, 12,204,220, 63, 90, 56, 22,
- 63, 22,102,235, 63, 99, 26, 59, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,102,235,
- 63, 99, 26, 59, 63, 12,204,224, 63,109,154,212, 63, 3, 50,204, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,131, 63,105,114, 22, 63, 3, 50,204, 63, 99, 26, 58, 63, 12,204,224, 63,109,154,212,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,224, 63,109,154,212, 63, 22,102,235,
- 63, 99, 26, 59, 63, 38,102,118, 63,105,114, 19, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,120, 63,116,187,242, 63, 59,153, 3, 63,128, 0, 0, 62,230,102,134, 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,134, 63,116,187,242, 63, 12,204,224, 63,109,154,212, 63, 38,102,120,
- 63,116,187,242, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,118, 63,105,114, 19,
- 63, 38,102,120, 63,116,187,242, 63, 12,204,224, 63,109,154,212, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 12,204,224, 63,109,154,212, 62,230,102,134, 63,116,187,242, 62,230,102,131, 63,105,114, 22, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 50,204, 63, 99, 26, 58, 62,230,102,131, 63,105,114, 22,
- 62,230,102,131, 63, 94, 46, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,131,
- 63, 94, 46, 79, 62,253,222,118, 63, 88, 64,148, 63, 3, 50,204, 63, 99, 26, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,220, 63, 90, 56, 22, 63, 3, 50,204, 63, 99, 26, 58, 62,253,222,118, 63, 88, 64,148,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,253,222,118, 63, 88, 64,148, 62,230,102,131,
- 63, 94, 46, 79, 62,230,102,130, 63, 82,228, 41, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 76,233,213, 63, 21, 48, 35, 63, 70,235,176, 63, 22,209,226, 63, 73,234, 80, 63, 11,111,146, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,234, 80, 63, 11,111,146, 63, 79,200, 1, 63, 9,152, 94, 63, 76,233,213,
- 63, 21, 48, 35, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,215, 19, 63, 19, 29,252,
- 63, 76,233,213, 63, 21, 48, 35, 63, 79,200, 1, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 79,200, 1, 63, 9,152, 94, 63, 73,234, 80, 63, 11,111,146, 63, 76,204,193, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,233,213, 63, 21, 48, 35, 63, 82,215, 19, 63, 19, 29,252,
- 63, 80, 41,220, 63, 31, 60,105, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 80, 41,220,
- 63, 31, 60,105, 63, 73,219,164, 63, 33, 23,173, 63, 76,233,213, 63, 21, 48, 35, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,235,176, 63, 22,209,226, 63, 76,233,213, 63, 21, 48, 35, 63, 73,219,164, 63, 33, 23,173,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,219,164, 63, 33, 23,173, 63, 80, 41,220,
- 63, 31, 60,105, 63, 77, 33,196, 63, 43, 52,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 70,158,169, 63, 44,160,200, 63, 64, 0, 0, 63, 45, 28, 24, 63, 67,171, 5, 63, 34, 17,216, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67,171, 5, 63, 34, 17,216, 63, 73,219,164, 63, 33, 23,173, 63, 70,158,169,
- 63, 44,160,200, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 77, 33,196, 63, 43, 52,221,
- 63, 70,158,169, 63, 44,160,200, 63, 73,219,164, 63, 33, 23,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 73,219,164, 63, 33, 23,173, 63, 67,171, 5, 63, 34, 17,216, 63, 70,235,176, 63, 22,209,226, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 83,124, 75, 63, 40,228,217, 63, 77, 33,196, 63, 43, 52,221,
- 63, 80, 41,220, 63, 31, 60,105, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 80, 41,220,
- 63, 31, 60,105, 63, 86, 20,218, 63, 28,140,143, 63, 83,124, 75, 63, 40,228,217, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,139, 63, 37,200, 45, 63, 83,124, 75, 63, 40,228,217, 63, 86, 20,218, 63, 28,140,143,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 20,218, 63, 28,140,143, 63, 80, 41,220,
- 63, 31, 60,105, 63, 82,215, 19, 63, 19, 29,252, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 64, 0, 0, 63, 23, 32,182, 63, 70,235,176, 63, 22,209,226, 63, 67,171, 5, 63, 34, 17,216, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67,171, 5, 63, 34, 17,216, 63, 60, 84,251, 63, 34, 17,216, 63, 64, 0, 0,
- 63, 23, 32,182, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 20, 80, 63, 22,209,226,
- 63, 64, 0, 0, 63, 23, 32,182, 63, 60, 84,251, 63, 34, 17,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 60, 84,251, 63, 34, 17,216, 63, 67,171, 5, 63, 34, 17,216, 63, 64, 0, 0, 63, 45, 28, 24, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 23, 32,182, 63, 57, 20, 80, 63, 22,209,226,
- 63, 60,156,169, 63, 11,116, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 60,156,169,
- 63, 11,116, 96, 63, 67, 99, 87, 63, 11,116, 96, 63, 64, 0, 0, 63, 23, 32,182, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,235,176, 63, 22,209,226, 63, 64, 0, 0, 63, 23, 32,182, 63, 67, 99, 87, 63, 11,116, 96,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67, 99, 87, 63, 11,116, 96, 63, 60,156,169,
- 63, 11,116, 96, 63, 64, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 70,102, 96, 63, 0, 1,244, 63, 76,204,193, 63, 0, 0, 0, 63, 73,234, 80, 63, 11,111,146, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,234, 80, 63, 11,111,146, 63, 67, 99, 87, 63, 11,116, 96, 63, 70,102, 96,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 0, 0, 0,
- 63, 70,102, 96, 63, 0, 1,244, 63, 67, 99, 87, 63, 11,116, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 67, 99, 87, 63, 11,116, 96, 63, 73,234, 80, 63, 11,111,146, 63, 70,235,176, 63, 22,209,226, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57,153,160, 63, 0, 1,244, 63, 64, 0, 0, 63, 0, 0, 0,
- 63, 60,156,169, 63, 11,116, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 60,156,169,
- 63, 11,116, 96, 63, 54, 21,176, 63, 11,111,146, 63, 57,153,160, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 51, 51, 63, 63, 0, 0, 0, 63, 57,153,160, 63, 0, 1,244, 63, 54, 21,176, 63, 11,111,146,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 21,176, 63, 11,111,146, 63, 60,156,169,
- 63, 11,116, 96, 63, 57, 20, 80, 63, 22,209,226, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 64, 0, 0, 62,217, 58, 93, 63, 57, 61,144, 62,217,196, 19, 63, 60,123, 85, 62,198,230,253, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 60,123, 85, 62,198,230,253, 63, 67,132,171, 62,198,230,253, 63, 64, 0, 0,
- 62,217, 58, 93, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,194,112, 62,217,196, 19,
- 63, 64, 0, 0, 62,217, 58, 93, 63, 67,132,171, 62,198,230,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 67,132,171, 62,198,230,253, 63, 60,123, 85, 62,198,230,253, 63, 64, 0, 0, 62,180,111,211, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,217, 58, 93, 63, 70,194,112, 62,217,196, 19,
- 63, 67, 84,125, 62,236,211, 42, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67, 84,125,
- 62,236,211, 42, 63, 60,171,131, 62,236,211, 42, 63, 64, 0, 0, 62,217, 58, 93, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 61,144, 62,217,196, 19, 63, 64, 0, 0, 62,217, 58, 93, 63, 60,171,131, 62,236,211, 42,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 60,171,131, 62,236,211, 42, 63, 67, 84,125,
- 62,236,211, 42, 63, 64, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 57,153,160, 63, 0, 1,244, 63, 51, 51, 63, 63, 0, 0, 0, 63, 54, 46,128, 62,236,207, 75, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 46,128, 62,236,207, 75, 63, 60,171,131, 62,236,211, 42, 63, 57,153,160,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 0, 0, 0,
- 63, 57,153,160, 63, 0, 1,244, 63, 60,171,131, 62,236,211, 42, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 60,171,131, 62,236,211, 42, 63, 54, 46,128, 62,236,207, 75, 63, 57, 61,144, 62,217,196, 19, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,102, 96, 63, 0, 1,244, 63, 64, 0, 0, 63, 0, 0, 0,
- 63, 67, 84,125, 62,236,211, 42, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67, 84,125,
- 62,236,211, 42, 63, 73,209,128, 62,236,207, 75, 63, 70,102, 96, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,204,193, 63, 0, 0, 0, 63, 70,102, 96, 63, 0, 1,244, 63, 73,209,128, 62,236,207, 75,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,209,128, 62,236,207, 75, 63, 67, 84,125,
- 62,236,211, 42, 63, 70,194,112, 62,217,196, 19, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 51, 22, 43, 63, 21, 48, 35, 63, 45, 40,237, 63, 19, 29,252, 63, 48, 55,255, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 55,255, 63, 9,152, 94, 63, 54, 21,176, 63, 11,111,146, 63, 51, 22, 43,
- 63, 21, 48, 35, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 20, 80, 63, 22,209,226,
- 63, 51, 22, 43, 63, 21, 48, 35, 63, 54, 21,176, 63, 11,111,146, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 54, 21,176, 63, 11,111,146, 63, 48, 55,255, 63, 9,152, 94, 63, 51, 51, 63, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 51, 22, 43, 63, 21, 48, 35, 63, 57, 20, 80, 63, 22,209,226,
- 63, 54, 36, 91, 63, 33, 23,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 36, 91,
- 63, 33, 23,173, 63, 47,214, 36, 63, 31, 60,105, 63, 51, 22, 43, 63, 21, 48, 35, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 40,237, 63, 19, 29,252, 63, 51, 22, 43, 63, 21, 48, 35, 63, 47,214, 36, 63, 31, 60,105,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 47,214, 36, 63, 31, 60,105, 63, 54, 36, 91,
- 63, 33, 23,173, 63, 50,222, 60, 63, 43, 52,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 44,131,181, 63, 40,228,216, 63, 38,102,117, 63, 37,200, 45, 63, 41,235, 38, 63, 28,140,141, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 41,235, 38, 63, 28,140,141, 63, 47,214, 36, 63, 31, 60,105, 63, 44,131,181,
- 63, 40,228,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 50,222, 60, 63, 43, 52,221,
- 63, 44,131,181, 63, 40,228,216, 63, 47,214, 36, 63, 31, 60,105, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 47,214, 36, 63, 31, 60,105, 63, 41,235, 38, 63, 28,140,141, 63, 45, 40,237, 63, 19, 29,252, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 97, 87, 63, 44,160,200, 63, 50,222, 60, 63, 43, 52,221,
- 63, 54, 36, 91, 63, 33, 23,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54, 36, 91,
- 63, 33, 23,173, 63, 60, 84,251, 63, 34, 17,216, 63, 57, 97, 87, 63, 44,160,200, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 63, 45, 28, 24, 63, 57, 97, 87, 63, 44,160,200, 63, 60, 84,251, 63, 34, 17,216,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 60, 84,251, 63, 34, 17,216, 63, 54, 36, 91,
- 63, 33, 23,173, 63, 57, 20, 80, 63, 22,209,226, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,128, 14,134, 63, 21, 48, 39, 63,122, 30,227, 63, 22,209,233, 63,125, 29,138, 63, 11,111,150, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,125, 29,138, 63, 11,111,150, 63,129,125,159, 63, 9,152, 94, 63,128, 14,134,
- 63, 21, 48, 39, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,193, 73,174, 63, 19, 29,253,
- 57,232, 92,209, 63, 21, 48, 39, 60, 62,207,114, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,129,125,159, 63, 9,152, 94, 63,125, 29,138, 63, 11,111,150, 63,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 57,232, 92,209, 63, 21, 48, 39, 60,193, 73,174, 63, 19, 29,253,
- 60, 87, 67,214, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,129,174,136,
- 63, 31, 60,110, 63,125, 14,213, 63, 33, 23,180, 63,128, 14,134, 63, 21, 48, 39, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,122, 30,227, 63, 22,209,233, 63,128, 14,134, 63, 21, 48, 39, 63,125, 14,213, 63, 33, 23,180,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,125, 14,213, 63, 33, 23,180, 63,129,174,136,
- 63, 31, 60,110, 63,128, 42,121, 63, 43, 52,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,121,209,210, 63, 44,160,212, 63,115, 51, 36, 63, 45, 28, 36, 63,118,222, 49, 63, 34, 17,226, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,222, 49, 63, 34, 17,226, 63,125, 14,213, 63, 33, 23,180, 63,121,209,210,
- 63, 44,160,212, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,128, 42,121, 63, 43, 52,230,
- 63,121,209,210, 63, 44,160,212, 63,125, 14,213, 63, 33, 23,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,125, 14,213, 63, 33, 23,180, 63,118,222, 49, 63, 34, 17,226, 63,122, 30,227, 63, 22,209,233, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,213,239,111, 63, 40,228,223, 58,169,226,120, 63, 43, 52,230,
- 60, 87, 67,214, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60, 87, 67,214,
- 63, 31, 60,110, 61, 20,129, 13, 63, 28,140,143, 60,213,239,111, 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,203,246, 63, 37,200, 48, 60,213,239,111, 63, 40,228,223, 61, 20,129, 13, 63, 28,140,143,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 20,129, 13, 63, 28,140,143, 60, 87, 67,214,
- 63, 31, 60,110, 60,193, 73,174, 63, 19, 29,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,115, 51, 44, 63, 23, 32,188, 63,122, 30,227, 63, 22,209,233, 63,118,222, 49, 63, 34, 17,226, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,222, 49, 63, 34, 17,226, 63,111,136, 31, 63, 34, 17,225, 63,115, 51, 44,
- 63, 23, 32,188, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108, 71,116, 63, 22,209,232,
- 63,115, 51, 44, 63, 23, 32,188, 63,111,136, 31, 63, 34, 17,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,111,136, 31, 63, 34, 17,225, 63,118,222, 49, 63, 34, 17,226, 63,115, 51, 36, 63, 45, 28, 36, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 44, 63, 23, 32,188, 63,108, 71,116, 63, 22,209,232,
- 63,111,207,213, 63, 11,116,100, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,111,207,213,
- 63, 11,116,100, 63,118,150,138, 63, 11,116,101, 63,115, 51, 44, 63, 23, 32,188, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,122, 30,227, 63, 22,209,233, 63,115, 51, 44, 63, 23, 32,188, 63,118,150,138, 63, 11,116,101,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,150,138, 63, 11,116,101, 63,111,207,213,
- 63, 11,116,100, 63,115, 51, 51, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,121,153,154, 63, 0, 1,244, 63,128, 0, 0, 63, 0, 0, 0, 63,125, 29,138, 63, 11,111,150, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,125, 29,138, 63, 11,111,150, 63,118,150,138, 63, 11,116,101, 63,121,153,154,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 51, 63, 0, 0, 0,
- 63,121,153,154, 63, 0, 1,244, 63,118,150,138, 63, 11,116,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,118,150,138, 63, 11,116,101, 63,125, 29,138, 63, 11,111,150, 63,122, 30,227, 63, 22,209,233, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108,204,205, 63, 0, 1,244, 63,115, 51, 51, 63, 0, 0, 0,
- 63,111,207,213, 63, 11,116,100, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,111,207,213,
- 63, 11,116,100, 63,105, 72,213, 63, 11,111,149, 63,108,204,205, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,102,102,101, 63, 0, 0, 0, 63,108,204,205, 63, 0, 1,244, 63,105, 72,213, 63, 11,111,149,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105, 72,213, 63, 11,111,149, 63,111,207,213,
- 63, 11,116,100, 63,108, 71,116, 63, 22,209,232, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,115, 51, 58, 62,217, 58, 73, 63,108,112,192, 62,217,196, 4, 63,111,174,139, 62,198,230,223, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,111,174,139, 62,198,230,223, 63,118,183,239, 62,198,230,227, 63,115, 51, 58,
- 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121,245,179, 62,217,196, 6,
- 63,115, 51, 58, 62,217, 58, 73, 63,118,183,239, 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,118,183,239, 62,198,230,227, 63,111,174,139, 62,198,230,223, 63,115, 51, 65, 62,180,111,160, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 58, 62,217, 58, 73, 63,121,245,179, 62,217,196, 6,
- 63,118,135,185, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,135,185,
- 62,236,211, 30, 63,111,222,180, 62,236,211, 30, 63,115, 51, 58, 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,108,112,192, 62,217,196, 4, 63,115, 51, 58, 62,217, 58, 73, 63,111,222,180, 62,236,211, 30,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,111,222,180, 62,236,211, 30, 63,118,135,185,
- 62,236,211, 30, 63,115, 51, 51, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,108,204,205, 63, 0, 1,244, 63,102,102,101, 63, 0, 0, 0, 63,105, 97,170, 62,236,207, 65, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105, 97,170, 62,236,207, 65, 63,111,222,180, 62,236,211, 30, 63,108,204,205,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 51, 63, 0, 0, 0,
- 63,108,204,205, 63, 0, 1,244, 63,111,222,180, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,111,222,180, 62,236,211, 30, 63,105, 97,170, 62,236,207, 65, 63,108,112,192, 62,217,196, 4, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121,153,154, 63, 0, 1,244, 63,115, 51, 51, 63, 0, 0, 0,
- 63,118,135,185, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,135,185,
- 62,236,211, 30, 63,125, 4,194, 62,236,207, 67, 63,121,153,154, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 63,121,153,154, 63, 0, 1,244, 63,125, 4,194, 62,236,207, 67,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,125, 4,194, 62,236,207, 67, 63,118,135,185,
- 62,236,211, 30, 63,121,245,179, 62,217,196, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,102, 73, 76, 63, 21, 48, 38, 63, 96, 92, 11, 63, 19, 29,253, 63, 99,107, 33, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99,107, 33, 63, 9,152, 94, 63,105, 72,213, 63, 11,111,149, 63,102, 73, 76,
- 63, 21, 48, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108, 71,116, 63, 22,209,232,
- 63,102, 73, 76, 63, 21, 48, 38, 63,105, 72,213, 63, 11,111,149, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,105, 72,213, 63, 11,111,149, 63, 99,107, 33, 63, 9,152, 94, 63,102,102,101, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,102, 73, 76, 63, 21, 48, 38, 63,108, 71,116, 63, 22,209,232,
- 63,105, 87,124, 63, 33, 23,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105, 87,124,
- 63, 33, 23,180, 63, 99, 9, 65, 63, 31, 60,109, 63,102, 73, 76, 63, 21, 48, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 96, 92, 11, 63, 19, 29,253, 63,102, 73, 76, 63, 21, 48, 38, 63, 99, 9, 65, 63, 31, 60,109,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99, 9, 65, 63, 31, 60,109, 63,105, 87,124,
- 63, 33, 23,180, 63,102, 17, 87, 63, 43, 52,229, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 95,182,205, 63, 40,228,222, 63, 89,153,139, 63, 37,200, 45, 63, 93, 30, 63, 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 93, 30, 63, 63, 28,140,143, 63, 99, 9, 65, 63, 31, 60,109, 63, 95,182,205,
- 63, 40,228,222, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,102, 17, 87, 63, 43, 52,229,
- 63, 95,182,205, 63, 40,228,222, 63, 99, 9, 65, 63, 31, 60,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 99, 9, 65, 63, 31, 60,109, 63, 93, 30, 63, 63, 28,140,143, 63, 96, 92, 11, 63, 19, 29,253, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108,148,118, 63, 44,160,211, 63,102, 17, 87, 63, 43, 52,229,
- 63,105, 87,124, 63, 33, 23,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105, 87,124,
- 63, 33, 23,180, 63,111,136, 31, 63, 34, 17,225, 63,108,148,118, 63, 44,160,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 36, 63, 45, 28, 36, 63,108,148,118, 63, 44,160,211, 63,111,136, 31, 63, 34, 17,225,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,111,136, 31, 63, 34, 17,225, 63,105, 87,124,
- 63, 33, 23,180, 63,108, 71,116, 63, 22,209,232, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 77, 65, 65, 63, 21, 48, 32, 62, 53, 72,152, 63, 22,209,229, 62, 65, 67, 47, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 65, 67, 47, 63, 11,111,147, 62, 88,185,255, 63, 9,152, 90, 62, 77, 65, 65,
- 63, 21, 48, 32, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,100,246, 64, 63, 19, 29,246,
- 62, 77, 65, 65, 63, 21, 48, 32, 62, 88,185,255, 63, 9,152, 90, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 88,185,255, 63, 9,152, 90, 62, 65, 67, 47, 63, 11,111,147, 62, 76,204,254, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 77, 65, 65, 63, 21, 48, 32, 62,100,246, 64, 63, 19, 29,246,
- 62, 90, 65, 89, 63, 31, 60, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 90, 65, 89,
- 63, 31, 60, 94, 62, 65, 8,107, 63, 33, 23,170, 62, 77, 65, 65, 63, 21, 48, 32, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 53, 72,152, 63, 22,209,229, 62, 77, 65, 65, 63, 21, 48, 32, 62, 65, 8,107, 63, 33, 23,170,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 65, 8,107, 63, 33, 23,170, 62, 90, 65, 89,
- 63, 31, 60, 94, 62, 78, 32,230, 63, 43, 52,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 52, 20,105, 63, 44,160,198, 62, 25,153,173, 63, 45, 28, 27, 62, 40, 69,216, 63, 34, 17,220, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 40, 69,216, 63, 34, 17,220, 62, 65, 8,107, 63, 33, 23,170, 62, 52, 20,105,
- 63, 44,160,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 78, 32,230, 63, 43, 52,211,
- 62, 52, 20,105, 63, 44,160,198, 62, 65, 8,107, 63, 33, 23,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 65, 8,107, 63, 33, 23,170, 62, 40, 69,216, 63, 34, 17,220, 62, 53, 72,152, 63, 22,209,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,103,139, 14, 63, 40,228,199, 62, 78, 32,230, 63, 43, 52,211,
- 62, 90, 65, 89, 63, 31, 60, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 90, 65, 89,
- 63, 31, 60, 94, 62,113,237, 83, 63, 28,140,130, 62,103,139, 14, 63, 40,228,199, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 37,200, 23, 62,103,139, 14, 63, 40,228,199, 62,113,237, 83, 63, 28,140,130,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,113,237, 83, 63, 28,140,130, 62, 90, 65, 89,
- 63, 31, 60, 94, 62,100,246, 64, 63, 19, 29,246, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 25,153,180, 63, 23, 32,185, 62, 53, 72,152, 63, 22,209,229, 62, 40, 69,216, 63, 34, 17,220, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 40, 69,216, 63, 34, 17,220, 62, 10,237,133, 63, 34, 17,219, 62, 25,153,180,
- 63, 23, 32,185, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,251,213,147, 63, 22,209,228,
- 62, 25,153,180, 63, 23, 32,185, 62, 10,237,133, 63, 34, 17,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 10,237,133, 63, 34, 17,219, 62, 40, 69,216, 63, 34, 17,220, 62, 25,153,173, 63, 45, 28, 27, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,180, 63, 23, 32,185, 61,251,213,147, 63, 22,209,228,
- 62, 12, 12, 67, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 12, 12, 67,
- 63, 11,116, 98, 62, 39, 39, 34, 63, 11,116, 98, 62, 25,153,180, 63, 23, 32,185, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 53, 72,152, 63, 22,209,229, 62, 25,153,180, 63, 23, 32,185, 62, 39, 39, 34, 63, 11,116, 98,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 39, 39, 34, 63, 11,116, 98, 62, 12, 12, 67,
- 63, 11,116, 98, 62, 25,153,181, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 51, 51, 92, 63, 0, 1,244, 62, 76,204,254, 63, 0, 0, 0, 62, 65, 67, 47, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 65, 67, 47, 63, 11,111,147, 62, 39, 39, 34, 63, 11,116, 98, 62, 51, 51, 92,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,181, 63, 0, 0, 0,
- 62, 51, 51, 92, 63, 0, 1,244, 62, 39, 39, 34, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 39, 39, 34, 63, 11,116, 98, 62, 65, 67, 47, 63, 11,111,147, 62, 53, 72,152, 63, 22,209,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 0, 0, 8, 63, 0, 1,244, 62, 25,153,181, 63, 0, 0, 0,
- 62, 12, 12, 67, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 12, 12, 67,
- 63, 11,116, 98, 61,227,224,109, 63, 11,111,147, 62, 0, 0, 8, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,204,204,215, 63, 0, 0, 0, 62, 0, 0, 8, 63, 0, 1,244, 61,227,224,109, 63, 11,111,147,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,227,224,109, 63, 11,111,147, 62, 12, 12, 67,
- 63, 11,116, 98, 61,251,213,147, 63, 22,209,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 25,153,196, 62,217, 58, 73, 61,253, 31,171, 62,217,196, 6, 62, 11,135, 1, 62,198,230,228, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 11,135, 1, 62,198,230,228, 62, 39,172,153, 62,198,230,230, 62, 25,153,196,
- 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 52,163,179, 62,217,196, 7,
- 62, 25,153,196, 62,217, 58, 73, 62, 39,172,153, 62,198,230,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 39,172,153, 62,198,230,230, 62, 11,135, 1, 62,198,230,228, 62, 25,153,214, 62,180,111,165, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,196, 62,217, 58, 73, 62, 52,163,179, 62,217,196, 7,
- 62, 38,235,202, 62,236,211, 33, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 38,235,202,
- 62,236,211, 33, 62, 12, 71,173, 62,236,211, 31, 62, 25,153,196, 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,253, 31,171, 62,217,196, 6, 62, 25,153,196, 62,217, 58, 73, 62, 12, 71,173, 62,236,211, 31,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 12, 71,173, 62,236,211, 31, 62, 38,235,202,
- 62,236,211, 33, 62, 25,153,181, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 0, 0, 8, 63, 0, 1,244, 61,204,204,215, 63, 0, 0, 0, 61,228,166,251, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,228,166,251, 62,236,207, 67, 62, 12, 71,173, 62,236,211, 31, 62, 0, 0, 8,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,181, 63, 0, 0, 0,
- 62, 0, 0, 8, 63, 0, 1,244, 62, 12, 71,173, 62,236,211, 31, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 12, 71,173, 62,236,211, 31, 61,228,166,251, 62,236,207, 67, 61,253, 31,171, 62,217,196, 6, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 51, 51, 92, 63, 0, 1,244, 62, 25,153,181, 63, 0, 0, 0,
- 62, 38,235,202, 62,236,211, 33, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 38,235,202,
- 62,236,211, 33, 62, 64,223,251, 62,236,207, 67, 62, 51, 51, 92, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 76,204,254, 63, 0, 0, 0, 62, 51, 51, 92, 63, 0, 1,244, 62, 64,223,251, 62,236,207, 67,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 64,223,251, 62,236,207, 67, 62, 38,235,202,
- 62,236,211, 33, 62, 52,163,179, 62,217,196, 7, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,203,228, 42, 63, 21, 48, 37, 61,156,122, 1, 63, 19, 29,254, 61,180,242,172, 63, 9,152, 96, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,180,242,172, 63, 9,152, 96, 61,227,224,109, 63, 11,111,147, 61,203,228, 42,
- 63, 21, 48, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,251,213,147, 63, 22,209,228,
- 61,203,228, 42, 63, 21, 48, 37, 61,227,224,109, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,227,224,109, 63, 11,111,147, 61,180,242,172, 63, 9,152, 96, 61,204,204,215, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,203,228, 42, 63, 21, 48, 37, 61,251,213,147, 63, 22,209,228,
- 61,228, 85,208, 63, 33, 23,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,228, 85,208,
- 63, 33, 23,179, 61,177,227,212, 63, 31, 60,110, 61,203,228, 42, 63, 21, 48, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,156,122, 1, 63, 19, 29,254, 61,203,228, 42, 63, 21, 48, 37, 61,177,227,212, 63, 31, 60,110,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,177,227,212, 63, 31, 60,110, 61,228, 85,208,
- 63, 33, 23,179, 61,202, 36,175, 63, 43, 52,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,151, 80, 53, 63, 40,228,223, 61, 76,203,246, 63, 37,200, 48, 61,130,139,166, 63, 28,140,145, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,130,139,166, 63, 28,140,145, 61,177,227,212, 63, 31, 60,110, 61,151, 80, 53,
- 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,202, 36,175, 63, 43, 52,228,
- 61,151, 80, 53, 63, 40,228,223, 61,177,227,212, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,177,227,212, 63, 31, 60,110, 61,130,139,166, 63, 28,140,145, 61,156,122, 1, 63, 19, 29,254, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,254, 61,201, 63, 44,160,207, 61,202, 36,175, 63, 43, 52,228,
- 61,228, 85,208, 63, 33, 23,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,228, 85,208,
- 63, 33, 23,179, 62, 10,237,133, 63, 34, 17,219, 61,254, 61,201, 63, 44,160,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,173, 63, 45, 28, 27, 61,254, 61,201, 63, 44,160,207, 62, 10,237,133, 63, 34, 17,219,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 10,237,133, 63, 34, 17,219, 61,228, 85,208,
- 63, 33, 23,179, 61,251,213,147, 63, 22,209,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,205, 6,245, 63, 21, 48, 37, 62,193, 10,155, 63, 22,209,229, 62,199, 7,229, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,199, 7,229, 63, 11,111,147, 62,210,195, 85, 63, 9,152, 96, 62,205, 6,245,
- 63, 21, 48, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,216,225,128, 63, 19, 29,254,
- 62,205, 6,245, 63, 21, 48, 37, 62,210,195, 85, 63, 9,152, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,210,195, 85, 63, 9,152, 96, 62,199, 7,229, 63, 11,111,147, 62,204,204,202, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,205, 6,245, 63, 21, 48, 37, 62,216,225,128, 63, 19, 29,254,
- 62,211,135, 11, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,211,135, 11,
- 63, 31, 60,110, 62,198,234,140, 63, 33, 23,179, 62,205, 6,245, 63, 21, 48, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,193, 10,155, 63, 22,209,229, 62,205, 6,245, 63, 21, 48, 37, 62,198,234,140, 63, 33, 23,179,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198,234,140, 63, 33, 23,179, 62,211,135, 11,
- 63, 31, 60,110, 62,205,118,212, 63, 43, 52,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,192,112,142, 63, 44,160,207, 62,179, 51, 42, 63, 45, 28, 28, 62,186,137, 61, 63, 34, 17,219, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,186,137, 61, 63, 34, 17,219, 62,198,234,140, 63, 33, 23,179, 62,192,112,142,
- 63, 44,160,207, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,205,118,212, 63, 43, 52,228,
- 62,192,112,142, 63, 44,160,207, 62,198,234,140, 63, 33, 23,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,198,234,140, 63, 33, 23,179, 62,186,137, 61, 63, 34, 17,219, 62,193, 10,155, 63, 22,209,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,218, 43,243, 63, 40,228,223, 62,205,118,212, 63, 43, 52,228,
- 62,211,135, 11, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,211,135, 11,
- 63, 31, 60,110, 62,223, 93, 22, 63, 28,140,145, 62,218, 43,243, 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,129, 63, 37,200, 48, 62,218, 43,243, 63, 40,228,223, 62,223, 93, 22, 63, 28,140,145,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223, 93, 22, 63, 28,140,145, 62,211,135, 11,
- 63, 31, 60,110, 62,216,225,128, 63, 19, 29,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,179, 51, 38, 63, 23, 32,185, 62,193, 10,155, 63, 22,209,229, 62,186,137, 61, 63, 34, 17,219, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,186,137, 61, 63, 34, 17,219, 62,171,221, 20, 63, 34, 17,219, 62,179, 51, 38,
- 63, 23, 32,185, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165, 91,180, 63, 22,209,229,
- 62,179, 51, 38, 63, 23, 32,185, 62,171,221, 20, 63, 34, 17,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,171,221, 20, 63, 34, 17,219, 62,186,137, 61, 63, 34, 17,219, 62,179, 51, 42, 63, 45, 28, 28, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 38, 63, 23, 32,185, 62,165, 91,180, 63, 22,209,229,
- 62,172,108,111, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,172,108,111,
- 63, 11,116, 98, 62,185,249,222, 63, 11,116, 98, 62,179, 51, 38, 63, 23, 32,185, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,193, 10,155, 63, 22,209,229, 62,179, 51, 38, 63, 23, 32,185, 62,185,249,222, 63, 11,116, 98,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,185,249,222, 63, 11,116, 98, 62,172,108,111,
- 63, 11,116, 98, 62,179, 51, 38, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,191,255,252, 63, 0, 1,244, 62,204,204,202, 63, 0, 0, 0, 62,199, 7,229, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,199, 7,229, 63, 11,111,147, 62,185,249,222, 63, 11,116, 98, 62,191,255,252,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 38, 63, 0, 0, 0,
- 62,191,255,252, 63, 0, 1,244, 62,185,249,222, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,185,249,222, 63, 11,116, 98, 62,199, 7,229, 63, 11,111,147, 62,193, 10,155, 63, 22,209,229, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,166,102, 82, 63, 0, 1,244, 62,179, 51, 38, 63, 0, 0, 0,
- 62,172,108,111, 63, 11,116, 98, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,172,108,111,
- 63, 11,116, 98, 62,159, 94,104, 63, 11,111,147, 62,166,102, 82, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,153,153,129, 63, 0, 0, 0, 62,166,102, 82, 63, 0, 1,244, 62,159, 94,104, 63, 11,111,147,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159, 94,104, 63, 11,111,147, 62,172,108,111,
- 63, 11,116, 98, 62,165, 91,180, 63, 22,209,229, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,179, 51, 30, 62,217, 58, 73, 62,165,174, 39, 62,217,196, 7, 62,172, 41,180, 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,172, 41,180, 62,198,230,227, 62,186, 60,127, 62,198,230,225, 62,179, 51, 30,
- 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,192,184, 21, 62,217,196, 6,
- 62,179, 51, 30, 62,217, 58, 73, 62,186, 60,127, 62,198,230,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,186, 60,127, 62,198,230,225, 62,172, 41,180, 62,198,230,227, 62,179, 51, 21, 62,180,111,165, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 30, 62,217, 58, 73, 62,192,184, 21, 62,217,196, 6,
- 62,185,220, 42, 62,236,211, 31, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,185,220, 42,
- 62,236,211, 31, 62,172,138, 27, 62,236,211, 33, 62,179, 51, 30, 62,217, 58, 73, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,165,174, 39, 62,217,196, 7, 62,179, 51, 30, 62,217, 58, 73, 62,172,138, 27, 62,236,211, 33,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,172,138, 27, 62,236,211, 33, 62,185,220, 42,
- 62,236,211, 31, 62,179, 51, 38, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,166,102, 82, 63, 0, 1,244, 62,153,153,129, 63, 0, 0, 0, 62,159,144, 3, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,144, 3, 62,236,207, 67, 62,172,138, 27, 62,236,211, 33, 62,166,102, 82,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 38, 63, 0, 0, 0,
- 62,166,102, 82, 63, 0, 1,244, 62,172,138, 27, 62,236,211, 33, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,172,138, 27, 62,236,211, 33, 62,159,144, 3, 62,236,207, 67, 62,165,174, 39, 62,217,196, 7, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,191,255,252, 63, 0, 1,244, 62,179, 51, 38, 63, 0, 0, 0,
- 62,185,220, 42, 62,236,211, 31, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,185,220, 42,
- 62,236,211, 31, 62,198,214, 65, 62,236,207, 67, 62,191,255,252, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,204,204,202, 63, 0, 0, 0, 62,191,255,252, 63, 0, 1,244, 62,198,214, 65, 62,236,207, 67,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198,214, 65, 62,236,207, 67, 62,185,220, 42,
- 62,236,211, 31, 62,192,184, 21, 62,217,196, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,153, 95, 95, 63, 21, 48, 32, 62,141,132,224, 63, 19, 29,246, 62,147,163, 1, 63, 9,152, 91, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147,163, 1, 63, 9,152, 91, 62,159, 94,104, 63, 11,111,147, 62,153, 95, 95,
- 63, 21, 48, 32, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165, 91,180, 63, 22,209,229,
- 62,153, 95, 95, 63, 21, 48, 32, 62,159, 94,104, 63, 11,111,147, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,159, 94,104, 63, 11,111,147, 62,147,163, 1, 63, 9,152, 91, 62,153,153,129, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,153, 95, 95, 63, 21, 48, 32, 62,165, 91,180, 63, 22,209,229,
- 62,159,123,203, 63, 33, 23,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,123,203,
- 63, 33, 23,170, 62,146,223, 84, 63, 31, 60, 94, 62,153, 95, 95, 63, 21, 48, 32, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,141,132,224, 63, 19, 29,246, 62,153, 95, 95, 63, 21, 48, 32, 62,146,223, 84, 63, 31, 60, 94,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,146,223, 84, 63, 31, 60, 94, 62,159,123,203,
- 63, 33, 23,170, 62,152,239,141, 63, 43, 52,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,140, 58,121, 63, 40,228,199, 62,128, 0, 0, 63, 37,200, 23, 62,135, 9, 86, 63, 28,140,130, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,135, 9, 86, 63, 28,140,130, 62,146,223, 84, 63, 31, 60, 94, 62,140, 58,121,
- 63, 40,228,199, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,152,239,141, 63, 43, 52,211,
- 62,140, 58,121, 63, 40,228,199, 62,146,223, 84, 63, 31, 60, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,146,223, 84, 63, 31, 60, 94, 62,135, 9, 86, 63, 28,140,130, 62,141,132,224, 63, 19, 29,246, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165,245,204, 63, 44,160,198, 62,152,239,141, 63, 43, 52,211,
- 62,159,123,203, 63, 33, 23,170, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,159,123,203,
- 63, 33, 23,170, 62,171,221, 20, 63, 34, 17,219, 62,165,245,204, 63, 44,160,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 42, 63, 45, 28, 28, 62,165,245,204, 63, 44,160,198, 62,171,221, 20, 63, 34, 17,219,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,171,221, 20, 63, 34, 17,219, 62,159,123,203,
- 63, 33, 23,170, 62,165, 91,180, 63, 22,209,229, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 25,182,180, 63, 21, 48, 38, 63, 19,184,140, 63, 22,209,232, 63, 22,183, 43, 63, 11,111,149, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,183, 43, 63, 11,111,149, 63, 28,148,223, 63, 9,152, 94, 63, 25,182,180,
- 63, 21, 48, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,163,245, 63, 19, 29,253,
- 63, 25,182,180, 63, 21, 48, 38, 63, 28,148,223, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 28,148,223, 63, 9,152, 94, 63, 22,183, 43, 63, 11,111,149, 63, 25,153,155, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,182,180, 63, 21, 48, 38, 63, 31,163,245, 63, 19, 29,253,
- 63, 28,246,191, 63, 31, 60,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,246,191,
- 63, 31, 60,109, 63, 22,168,132, 63, 33, 23,180, 63, 25,182,180, 63, 21, 48, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,184,140, 63, 22,209,232, 63, 25,182,180, 63, 21, 48, 38, 63, 22,168,132, 63, 33, 23,180,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,168,132, 63, 33, 23,180, 63, 28,246,191,
- 63, 31, 60,109, 63, 25,238,169, 63, 43, 52,229, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 19,107,138, 63, 44,160,211, 63, 12,204,220, 63, 45, 28, 35, 63, 16,119,225, 63, 34, 17,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16,119,225, 63, 34, 17,225, 63, 22,168,132, 63, 33, 23,180, 63, 19,107,138,
- 63, 44,160,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,238,169, 63, 43, 52,229,
- 63, 19,107,138, 63, 44,160,211, 63, 22,168,132, 63, 33, 23,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 22,168,132, 63, 33, 23,180, 63, 16,119,225, 63, 34, 17,225, 63, 19,184,140, 63, 22,209,232, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 32, 73, 51, 63, 40,228,221, 63, 25,238,169, 63, 43, 52,229,
- 63, 28,246,191, 63, 31, 60,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,246,191,
- 63, 31, 60,109, 63, 34,225,192, 63, 28,140,142, 63, 32, 73, 51, 63, 40,228,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,117, 63, 37,200, 45, 63, 32, 73, 51, 63, 40,228,221, 63, 34,225,192, 63, 28,140,142,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 34,225,192, 63, 28,140,142, 63, 28,246,191,
- 63, 31, 60,109, 63, 31,163,245, 63, 19, 29,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 12,204,212, 63, 23, 32,188, 63, 19,184,140, 63, 22,209,232, 63, 16,119,225, 63, 34, 17,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16,119,225, 63, 34, 17,225, 63, 9, 33,207, 63, 34, 17,226, 63, 12,204,212,
- 63, 23, 32,188, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 5,225, 29, 63, 22,209,233,
- 63, 12,204,212, 63, 23, 32,188, 63, 9, 33,207, 63, 34, 17,226, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 9, 33,207, 63, 34, 17,226, 63, 16,119,225, 63, 34, 17,225, 63, 12,204,220, 63, 45, 28, 35, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,212, 63, 23, 32,188, 63, 5,225, 29, 63, 22,209,233,
- 63, 9,105,118, 63, 11,116,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 9,105,118,
- 63, 11,116,101, 63, 16, 48, 43, 63, 11,116,100, 63, 12,204,212, 63, 23, 32,188, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,184,140, 63, 22,209,232, 63, 12,204,212, 63, 23, 32,188, 63, 16, 48, 43, 63, 11,116,100,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16, 48, 43, 63, 11,116,100, 63, 9,105,118,
- 63, 11,116,101, 63, 12,204,205, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 19, 51, 51, 63, 0, 1,244, 63, 25,153,155, 63, 0, 0, 0, 63, 22,183, 43, 63, 11,111,149, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,183, 43, 63, 11,111,149, 63, 16, 48, 43, 63, 11,116,100, 63, 19, 51, 51,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,205, 63, 0, 0, 0,
- 63, 19, 51, 51, 63, 0, 1,244, 63, 16, 48, 43, 63, 11,116,100, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 16, 48, 43, 63, 11,116,100, 63, 22,183, 43, 63, 11,111,149, 63, 19,184,140, 63, 22,209,232, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6,102,102, 63, 0, 1,244, 63, 12,204,205, 63, 0, 0, 0,
- 63, 9,105,118, 63, 11,116,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 9,105,118,
- 63, 11,116,101, 63, 2,226,118, 63, 11,111,149, 63, 6,102,102, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 6,102,102, 63, 0, 1,244, 63, 2,226,118, 63, 11,111,149,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 2,226,118, 63, 11,111,149, 63, 9,105,118,
- 63, 11,116,101, 63, 5,225, 29, 63, 22,209,233, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 12,204,198, 62,217, 58, 72, 63, 6, 10, 77, 62,217,196, 6, 63, 9, 72, 17, 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 9, 72, 17, 62,198,230,227, 63, 16, 81,117, 62,198,230,223, 63, 12,204,198,
- 62,217, 58, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,143, 64, 62,217,196, 4,
- 63, 12,204,198, 62,217, 58, 72, 63, 16, 81,117, 62,198,230,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 16, 81,117, 62,198,230,223, 63, 9, 72, 17, 62,198,230,227, 63, 12,204,191, 62,180,111,160, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,198, 62,217, 58, 72, 63, 19,143, 64, 62,217,196, 4,
- 63, 16, 33, 76, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16, 33, 76,
- 62,236,211, 30, 63, 9,120, 71, 62,236,211, 30, 63, 12,204,198, 62,217, 58, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 6, 10, 77, 62,217,196, 6, 63, 12,204,198, 62,217, 58, 72, 63, 9,120, 71, 62,236,211, 30,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 9,120, 71, 62,236,211, 30, 63, 16, 33, 76,
- 62,236,211, 30, 63, 12,204,205, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 6,102,102, 63, 0, 1,244, 63, 0, 0, 0, 63, 0, 0, 0, 63, 2,251, 62, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 2,251, 62, 62,236,207, 67, 63, 9,120, 71, 62,236,211, 30, 63, 6,102,102,
- 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,205, 63, 0, 0, 0,
- 63, 6,102,102, 63, 0, 1,244, 63, 9,120, 71, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 9,120, 71, 62,236,211, 30, 63, 2,251, 62, 62,236,207, 67, 63, 6, 10, 77, 62,217,196, 6, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 19, 51, 51, 63, 0, 1,244, 63, 12,204,205, 63, 0, 0, 0,
- 63, 16, 33, 76, 62,236,211, 30, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16, 33, 76,
- 62,236,211, 30, 63, 22,158, 86, 62,236,207, 65, 63, 19, 51, 51, 63, 0, 1,244, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,153,155, 63, 0, 0, 0, 63, 19, 51, 51, 63, 0, 1,244, 63, 22,158, 86, 62,236,207, 65,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,158, 86, 62,236,207, 65, 63, 16, 33, 76,
- 62,236,211, 30, 63, 19,143, 64, 62,217,196, 4, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,255,197,233, 63, 21, 48, 39, 62,243,235,101, 63, 19, 29,252, 62,250, 9,132, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,250, 9,132, 63, 9,152, 94, 63, 2,226,118, 63, 11,111,149, 62,255,197,233,
- 63, 21, 48, 39, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 5,225, 29, 63, 22,209,233,
- 62,255,197,233, 63, 21, 48, 39, 63, 2,226,118, 63, 11,111,149, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 2,226,118, 63, 11,111,149, 62,250, 9,132, 63, 9,152, 94, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,255,197,233, 63, 21, 48, 39, 63, 5,225, 29, 63, 22,209,233,
- 63, 2,241, 43, 63, 33, 23,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 2,241, 43,
- 63, 33, 23,181, 62,249, 69,225, 63, 31, 60,110, 62,255,197,233, 63, 21, 48, 39, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,243,235,101, 63, 19, 29,252, 62,255,197,233, 63, 21, 48, 39, 62,249, 69,225, 63, 31, 60,110,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,249, 69,225, 63, 31, 60,110, 63, 2,241, 43,
- 63, 33, 23,181, 62,255, 86, 30, 63, 43, 52,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,242,161, 9, 63, 40,228,223, 62,230,102,129, 63, 37,200, 48, 62,237,111,222, 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237,111,222, 63, 28,140,143, 62,249, 69,225, 63, 31, 60,110, 62,242,161, 9,
- 63, 40,228,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,255, 86, 30, 63, 43, 52,230,
- 62,242,161, 9, 63, 40,228,223, 62,249, 69,225, 63, 31, 60,110, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,249, 69,225, 63, 31, 60,110, 62,237,111,222, 63, 28,140,143, 62,243,235,101, 63, 19, 29,252, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6, 46, 46, 63, 44,160,211, 62,255, 86, 30, 63, 43, 52,230,
- 63, 2,241, 43, 63, 33, 23,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 2,241, 43,
- 63, 33, 23,181, 63, 9, 33,207, 63, 34, 17,226, 63, 6, 46, 46, 63, 44,160,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,220, 63, 45, 28, 35, 63, 6, 46, 46, 63, 44,160,211, 63, 9, 33,207, 63, 34, 17,226,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 9, 33,207, 63, 34, 17,226, 63, 2,241, 43,
- 63, 33, 23,181, 63, 5,225, 29, 63, 22,209,233, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 85,238,138, 62,187,220, 72, 63, 82,173,218, 62,210, 92, 55, 63, 79,189,229, 62,189,208,173, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,189,229, 62,189,208,173, 63, 82,250,230, 62,166,190,117, 63, 85,238,138,
- 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,149, 62,165,199,201,
- 63, 85,238,138, 62,187,220, 72, 63, 82,250,230, 62,166,190,117, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 82,250,230, 62,166,190,117, 63, 79,189,229, 62,189,208,173, 63, 76,119,198, 62,169,150, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,111,170, 62,193,135, 68, 63, 76,119,198, 62,169,150, 90,
- 63, 79,189,229, 62,189,208,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,189,229,
- 62,189,208,173, 63, 76,175,176, 62,213,159,192, 63, 73,111,170, 62,193,135, 68, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,194,112, 62,217,196, 19, 63, 73,111,170, 62,193,135, 68, 63, 76,175,176, 62,213,159,192,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,175,176, 62,213,159,192, 63, 79,189,229,
- 62,189,208,173, 63, 82,173,218, 62,210, 92, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 79,175, 52, 62,233, 32,218, 63, 76,204,193, 63, 0, 0, 0, 63, 73,209,128, 62,236,207, 75, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,209,128, 62,236,207, 75, 63, 76,175,176, 62,213,159,192, 63, 79,175, 52,
- 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,173,218, 62,210, 92, 55,
- 63, 79,175, 52, 62,233, 32,218, 63, 76,175,176, 62,213,159,192, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 76,175,176, 62,213,159,192, 63, 73,209,128, 62,236,207, 75, 63, 70,194,112, 62,217,196, 19, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73,111,170, 62,193,135, 68, 63, 70,194,112, 62,217,196, 19,
- 63, 67,132,171, 62,198,230,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 67,132,171,
- 62,198,230,253, 63, 70, 29, 61, 62,174, 54,114, 63, 73,111,170, 62,193,135, 68, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,119,198, 62,169,150, 90, 63, 73,111,170, 62,193,135, 68, 63, 70, 29, 61, 62,174, 54,114,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 70, 29, 61, 62,174, 54,114, 63, 67,132,171,
- 62,198,230,253, 63, 64, 0, 0, 62,180,111,211, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 79,175, 52, 62,233, 32,218, 63, 82,173,218, 62,210, 92, 55, 63, 86, 54, 56, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 54, 56, 62,233, 23, 58, 63, 83, 51, 41, 62,255,252, 24, 63, 79,175, 52,
- 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,204,193, 63, 0, 0, 0,
- 63, 79,175, 52, 62,233, 32,218, 63, 83, 51, 41, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 83, 51, 41, 62,255,252, 24, 63, 86, 54, 56, 62,233, 23, 58, 63, 89,153,147, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 92,252,239, 62,233, 23, 58, 63, 89,153,147, 63, 0, 0, 0,
- 63, 86, 54, 56, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 54, 56,
- 62,233, 23, 58, 63, 89,153,147, 62,209,190,143, 63, 92,252,239, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 96,133, 78, 62,210, 92, 55, 63, 92,252,239, 62,233, 23, 58, 63, 89,153,147, 62,209,190,143,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,147, 62,209,190,143, 63, 86, 54, 56,
- 62,233, 23, 58, 63, 82,173,218, 62,210, 92, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 85,238,138, 62,187,220, 72, 63, 89,153,149, 62,165,199,201, 63, 93, 68,159, 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 93, 68,159, 62,187,220, 72, 63, 89,153,147, 62,209,190,143, 63, 85,238,138,
- 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,173,218, 62,210, 92, 55,
- 63, 85,238,138, 62,187,220, 72, 63, 89,153,147, 62,209,190,143, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 89,153,147, 62,209,190,143, 63, 93, 68,159, 62,187,220, 72, 63, 96,133, 78, 62,210, 92, 55, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 92,252,239, 62,233, 23, 58, 63, 96,133, 78, 62,210, 92, 55,
- 63, 99,131,242, 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99,131,242,
- 62,233, 32,218, 63, 95,255,254, 62,255,252, 24, 63, 92,252,239, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,147, 63, 0, 0, 0, 63, 92,252,239, 62,233, 23, 58, 63, 95,255,254, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 95,255,254, 62,255,252, 24, 63, 99,131,242,
- 62,233, 32,218, 63,102,102,101, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,111,174,139, 62,198,230,223, 63,108,112,192, 62,217,196, 4, 63,105,195,133, 62,193,135, 37, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,195,133, 62,193,135, 37, 63,109, 21,249, 62,174, 54, 65, 63,111,174,139,
- 62,198,230,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,180,111,160,
- 63,111,174,139, 62,198,230,223, 63,109, 21,249, 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,109, 21,249, 62,174, 54, 65, 63,105,195,133, 62,193,135, 37, 63,102,187,106, 62,169,150, 54, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99,117, 70, 62,189,208,155, 63,102,187,106, 62,169,150, 54,
- 63,105,195,133, 62,193,135, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,105,195,133,
- 62,193,135, 37, 63,102,131,123, 62,213,159,181, 63, 99,117, 70, 62,189,208,155, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 96,133, 78, 62,210, 92, 55, 63, 99,117, 70, 62,189,208,155, 63,102,131,123, 62,213,159,181,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,102,131,123, 62,213,159,181, 63,105,195,133,
- 62,193,135, 37, 63,108,112,192, 62,217,196, 4, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,105, 97,170, 62,236,207, 65, 63,102,102,101, 63, 0, 0, 0, 63, 99,131,242, 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99,131,242, 62,233, 32,218, 63,102,131,123, 62,213,159,181, 63,105, 97,170,
- 62,236,207, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108,112,192, 62,217,196, 4,
- 63,105, 97,170, 62,236,207, 65, 63,102,131,123, 62,213,159,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,102,131,123, 62,213,159,181, 63, 99,131,242, 62,233, 32,218, 63, 96,133, 78, 62,210, 92, 55, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99,117, 70, 62,189,208,155, 63, 96,133, 78, 62,210, 92, 55,
- 63, 93, 68,159, 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 93, 68,159,
- 62,187,220, 72, 63, 96, 56, 71, 62,166,190, 99, 63, 99,117, 70, 62,189,208,155, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,102,187,106, 62,169,150, 54, 63, 99,117, 70, 62,189,208,155, 63, 96, 56, 71, 62,166,190, 99,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 96, 56, 71, 62,166,190, 99, 63, 93, 68,159,
- 62,187,220, 72, 63, 89,153,149, 62,165,199,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 99,107, 33, 63, 9,152, 94, 63, 96, 92, 11, 63, 19, 29,253, 63, 92,238, 21, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 92,238, 21, 63, 9,150,112, 63, 95,255,254, 62,255,252, 24, 63, 99,107, 33,
- 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,102,102,101, 63, 0, 0, 0,
- 63, 99,107, 33, 63, 9,152, 94, 63, 95,255,254, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 95,255,254, 62,255,252, 24, 63, 92,238, 21, 63, 9,150,112, 63, 89,153,147, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 69, 14, 63, 9,150,112, 63, 89,153,147, 63, 0, 0, 0,
- 63, 92,238, 21, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 92,238, 21,
- 63, 9,150,112, 63, 89,153,143, 63, 19, 98,219, 63, 86, 69, 14, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,215, 19, 63, 19, 29,252, 63, 86, 69, 14, 63, 9,150,112, 63, 89,153,143, 63, 19, 98,219,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,143, 63, 19, 98,219, 63, 92,238, 21,
- 63, 9,150,112, 63, 96, 92, 11, 63, 19, 29,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 93, 30, 63, 63, 28,140,143, 63, 89,153,139, 63, 37,200, 45, 63, 86, 20,218, 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 20,218, 63, 28,140,143, 63, 89,153,143, 63, 19, 98,219, 63, 93, 30, 63,
- 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 96, 92, 11, 63, 19, 29,253,
- 63, 93, 30, 63, 63, 28,140,143, 63, 89,153,143, 63, 19, 98,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 89,153,143, 63, 19, 98,219, 63, 86, 20,218, 63, 28,140,143, 63, 82,215, 19, 63, 19, 29,252, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 86, 69, 14, 63, 9,150,112, 63, 82,215, 19, 63, 19, 29,252,
- 63, 79,200, 1, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,200, 1,
- 63, 9,152, 94, 63, 83, 51, 41, 62,255,252, 24, 63, 86, 69, 14, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,147, 63, 0, 0, 0, 63, 86, 69, 14, 63, 9,150,112, 63, 83, 51, 41, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 83, 51, 41, 62,255,252, 24, 63, 79,200, 1,
- 63, 9,152, 94, 63, 76,204,193, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61, 18, 28,237, 62,187,220, 60, 60,188, 35,151, 62,210, 92, 46, 60, 60, 74,218, 62,189,208,150, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60, 60, 74,218, 62,189,208,150, 60,197,197,195, 62,166,190, 89, 61, 18, 28,237,
- 62,187,220, 60, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,205,194, 62,165,199,186,
- 61, 18, 28,237, 62,187,220, 60, 60,197,197,195, 62,166,190, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,131, 23, 23, 62,166,190, 89, 63,129,120,150, 62,189,208,150, 63,127,171, 15, 62,169,150, 52, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,124,162,241, 62,193,135, 36, 63,127,171, 15, 62,169,150, 52,
- 63,129,120,150, 62,189,208,150, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,129,120,150,
- 62,189,208,150, 63,127,226,244, 62,213,159,179, 63,124,162,241, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,121,245,179, 62,217,196, 6, 63,124,162,241, 62,193,135, 36, 63,127,226,244, 62,213,159,179,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,127,226,244, 62,213,159,179, 63,129,120,150,
- 62,189,208,150, 63,130,240,142, 62,210, 92, 46, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,129,113, 59, 62,233, 32,214, 63,128, 0, 0, 63, 0, 0, 0, 63,125, 4,194, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,125, 4,194, 62,236,207, 67, 63,127,226,244, 62,213,159,179, 63,129,113, 59,
- 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,130,240,142, 62,210, 92, 46,
- 63,129,113, 59, 62,233, 32,214, 63,127,226,244, 62,213,159,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,127,226,244, 62,213,159,179, 63,125, 4,194, 62,236,207, 67, 63,121,245,179, 62,217,196, 6, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,124,162,241, 62,193,135, 36, 63,121,245,179, 62,217,196, 6,
- 63,118,183,239, 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,118,183,239,
- 62,198,230,227, 63,121, 80,133, 62,174, 54, 65, 63,124,162,241, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,127,171, 15, 62,169,150, 52, 63,124,162,241, 62,193,135, 36, 63,121, 80,133, 62,174, 54, 65,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121, 80,133, 62,174, 54, 65, 63,118,183,239,
- 62,198,230,227, 63,115, 51, 65, 62,180,111,160, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 60, 56,157,110, 62,233, 32,214, 60,188, 35,151, 62,210, 92, 46, 61, 22,151, 95, 62,233, 23, 55, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 22,151, 95, 62,233, 23, 55, 60,204,204,176, 62,255,252, 24, 60, 56,157,110,
- 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 38, 11, 79,167, 63, 0, 0, 0,
- 60, 56,157,110, 62,233, 32,214, 60,204,204,176, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 60,204,204,176, 62,255,252, 24, 61, 22,151, 95, 62,233, 23, 55, 61, 76,204,215, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,129,129, 87, 62,233, 23, 57, 61, 76,204,215, 63, 0, 0, 0,
- 61, 22,151, 95, 62,233, 23, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 22,151, 95,
- 62,233, 23, 55, 61, 76,205, 68, 62,209,190,135, 61,129,129, 87, 62,233, 23, 57, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,157,196, 92, 62,210, 92, 49, 61,129,129, 87, 62,233, 23, 57, 61, 76,205, 68, 62,209,190,135,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,205, 68, 62,209,190,135, 61, 22,151, 95,
- 62,233, 23, 55, 60,188, 35,151, 62,210, 92, 46, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61, 18, 28,237, 62,187,220, 60, 61, 76,205,194, 62,165,199,186, 61,131,191, 7, 62,187,220, 62, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,131,191, 7, 62,187,220, 62, 61, 76,205, 68, 62,209,190,135, 61, 18, 28,237,
- 62,187,220, 60, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,188, 35,151, 62,210, 92, 46,
- 61, 18, 28,237, 62,187,220, 60, 61, 76,205, 68, 62,209,190,135, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61, 76,205, 68, 62,209,190,135, 61,131,191, 7, 62,187,220, 62, 61,157,196, 92, 62,210, 92, 49, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,129,129, 87, 62,233, 23, 57, 61,157,196, 92, 62,210, 92, 49,
- 61,181,185, 89, 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,181,185, 89,
- 62,233, 32,214, 61,153,153,154, 62,255,252, 25, 61,129,129, 87, 62,233, 23, 57, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,204,215, 63, 0, 0, 0, 61,129,129, 87, 62,233, 23, 57, 61,153,153,154, 62,255,252, 25,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,153,153,154, 62,255,252, 25, 61,181,185, 89,
- 62,233, 32,214, 61,204,204,215, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 11,135, 1, 62,198,230,228, 61,253, 31,171, 62,217,196, 6, 61,231,181,251, 62,193,135, 38, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,231,181,251, 62,193,135, 38, 62, 1, 36,204, 62,174, 54, 70, 62, 11,135, 1,
- 62,198,230,228, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62,180,111,165,
- 62, 11,135, 1, 62,198,230,228, 62, 1, 36,204, 62,174, 54, 70, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 1, 36,204, 62,174, 54, 70, 61,231,181,251, 62,193,135, 38, 61,207,117, 70, 62,169,150, 54, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,181, 68, 35, 62,189,208,153, 61,207,117, 70, 62,169,150, 54,
- 61,231,181,251, 62,193,135, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,231,181,251,
- 62,193,135, 38, 61,205,181,164, 62,213,159,180, 61,181, 68, 35, 62,189,208,153, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,157,196, 92, 62,210, 92, 49, 61,181, 68, 35, 62,189,208,153, 61,205,181,164, 62,213,159,180,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,205,181,164, 62,213,159,180, 61,231,181,251,
- 62,193,135, 38, 61,253, 31,171, 62,217,196, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,228,166,251, 62,236,207, 67, 61,204,204,215, 63, 0, 0, 0, 61,181,185, 89, 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,181,185, 89, 62,233, 32,214, 61,205,181,164, 62,213,159,180, 61,228,166,251,
- 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,253, 31,171, 62,217,196, 6,
- 61,228,166,251, 62,236,207, 67, 61,205,181,164, 62,213,159,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,205,181,164, 62,213,159,180, 61,181,185, 89, 62,233, 32,214, 61,157,196, 92, 62,210, 92, 49, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,181, 68, 35, 62,189,208,153, 61,157,196, 92, 62,210, 92, 49,
- 61,131,191, 7, 62,187,220, 62, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,131,191, 7,
- 62,187,220, 62, 61,155, 92, 79, 62,166,190, 91, 61,181, 68, 35, 62,189,208,153, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,207,117, 70, 62,169,150, 54, 61,181, 68, 35, 62,189,208,153, 61,155, 92, 79, 62,166,190, 91,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,155, 92, 79, 62,166,190, 91, 61,131,191, 7,
- 62,187,220, 62, 61, 76,205,194, 62,165,199,186, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,180,242,172, 63, 9,152, 96, 61,156,122, 1, 63, 19, 29,254, 61,129, 10,100, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,129, 10,100, 63, 9,150,113, 61,153,153,154, 62,255,252, 25, 61,180,242,172,
- 63, 9,152, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,204,204,215, 63, 0, 0, 0,
- 61,180,242,172, 63, 9,152, 96, 61,153,153,154, 62,255,252, 25, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,153,153,154, 62,255,252, 25, 61,129, 10,100, 63, 9,150,113, 61, 76,204,215, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 23,132,109, 63, 9,150,113, 61, 76,204,215, 63, 0, 0, 0,
- 61,129, 10,100, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,129, 10,100,
- 63, 9,150,113, 61, 76,204, 91, 63, 19, 98,220, 61, 23,132,109, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 60,193, 73,174, 63, 19, 29,253, 61, 23,132,109, 63, 9,150,113, 61, 76,204, 91, 63, 19, 98,220,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,204, 91, 63, 19, 98,220, 61,129, 10,100,
- 63, 9,150,113, 61,156,122, 1, 63, 19, 29,254, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,130,139,166, 63, 28,140,145, 61, 76,203,246, 63, 37,200, 48, 61, 20,129, 13, 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 20,129, 13, 63, 28,140,143, 61, 76,204, 91, 63, 19, 98,220, 61,130,139,166,
- 63, 28,140,145, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,156,122, 1, 63, 19, 29,254,
- 61,130,139,166, 63, 28,140,145, 61, 76,204, 91, 63, 19, 98,220, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61, 76,204, 91, 63, 19, 98,220, 61, 20,129, 13, 63, 28,140,143, 60,193, 73,174, 63, 19, 29,253, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 23,132,109, 63, 9,150,113, 60,193, 73,174, 63, 19, 29,253,
- 60, 62,207,114, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60, 62,207,114,
- 63, 9,152, 94, 60,204,204,176, 62,255,252, 24, 61, 23,132,109, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,204,215, 63, 0, 0, 0, 61, 23,132,109, 63, 9,150,113, 60,204,204,176, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,204,204,176, 62,255,252, 24, 60, 62,207,114,
- 63, 9,152, 94, 38, 11, 79,167, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,113, 83,237, 62,187,220, 79, 62,100, 81, 63, 62,210, 92, 60, 62, 88,145,110, 62,189,208,167, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 88,145,110, 62,189,208,167, 62,101,133, 91, 62,166,190,112, 62,113, 83,237,
- 62,187,220, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62,165,199,206,
- 62,113, 83,237, 62,187,220, 79, 62,101,133, 91, 62,166,190,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,101,133, 91, 62,166,190,112, 62, 88,145,110, 62,189,208,167, 62, 75,120,239, 62,169,150, 70, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 63, 88,144, 62,193,135, 46, 62, 75,120,239, 62,169,150, 70,
- 62, 88,145,110, 62,189,208,167, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 88,145,110,
- 62,189,208,167, 62, 76, 88,170, 62,213,159,187, 62, 63, 88,144, 62,193,135, 46, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 52,163,179, 62,217,196, 7, 62, 63, 88,144, 62,193,135, 46, 62, 76, 88,170, 62,213,159,187,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 76, 88,170, 62,213,159,187, 62, 88,145,110,
- 62,189,208,167, 62,100, 81, 63, 62,210, 92, 60, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 88, 86,190, 62,233, 32,221, 62, 76,204,254, 63, 0, 0, 0, 62, 64,223,251, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 64,223,251, 62,236,207, 67, 62, 76, 88,170, 62,213,159,187, 62, 88, 86,190,
- 62,233, 32,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,100, 81, 63, 62,210, 92, 60,
- 62, 88, 86,190, 62,233, 32,221, 62, 76, 88,170, 62,213,159,187, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 76, 88,170, 62,213,159,187, 62, 64,223,251, 62,236,207, 67, 62, 52,163,179, 62,217,196, 7, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 63, 88,144, 62,193,135, 46, 62, 52,163,179, 62,217,196, 7,
- 62, 39,172,153, 62,198,230,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 39,172,153,
- 62,198,230,230, 62, 50, 14,213, 62,174, 54, 78, 62, 63, 88,144, 62,193,135, 46, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 75,120,239, 62,169,150, 70, 62, 63, 88,144, 62,193,135, 46, 62, 50, 14,213, 62,174, 54, 78,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 50, 14,213, 62,174, 54, 78, 62, 39,172,153,
- 62,198,230,230, 62, 25,153,214, 62,180,111,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 88, 86,190, 62,233, 32,221, 62,100, 81, 63, 62,210, 92, 60, 62,114,114,166, 62,233, 23, 63, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,114,114,166, 62,233, 23, 63, 62,102,102,126, 62,255,252, 25, 62, 88, 86,190,
- 62,233, 32,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 76,204,254, 63, 0, 0, 0,
- 62, 88, 86,190, 62,233, 32,221, 62,102,102,126, 62,255,252, 25, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,102,102,126, 62,255,252, 25, 62,114,114,166, 62,233, 23, 63, 62,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,134,198,173, 62,233, 23, 63, 62,128, 0, 0, 63, 0, 0, 0,
- 62,114,114,166, 62,233, 23, 63, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,114,114,166,
- 62,233, 23, 63, 62,128, 0, 0, 62,209,190,149, 62,134,198,173, 62,233, 23, 63, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,141,215, 97, 62,210, 92, 60, 62,134,198,173, 62,233, 23, 63, 62,128, 0, 0, 62,209,190,149,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62,209,190,149, 62,114,114,166,
- 62,233, 23, 63, 62,100, 81, 63, 62,210, 92, 60, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,113, 83,237, 62,187,220, 79, 62,128, 0, 0, 62,165,199,206, 62,135, 86, 9, 62,187,220, 79, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,135, 86, 9, 62,187,220, 79, 62,128, 0, 0, 62,209,190,149, 62,113, 83,237,
- 62,187,220, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,100, 81, 63, 62,210, 92, 60,
- 62,113, 83,237, 62,187,220, 79, 62,128, 0, 0, 62,209,190,149, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,128, 0, 0, 62,209,190,149, 62,135, 86, 9, 62,187,220, 79, 62,141,215, 97, 62,210, 92, 60, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,134,198,173, 62,233, 23, 63, 62,141,215, 97, 62,210, 92, 60,
- 62,147,212,161, 62,233, 32,221, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147,212,161,
- 62,233, 32,221, 62,140,204,193, 62,255,252, 25, 62,134,198,173, 62,233, 23, 63, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 0, 0, 0, 62,134,198,173, 62,233, 23, 63, 62,140,204,193, 62,255,252, 25,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,140,204,193, 62,255,252, 25, 62,147,212,161,
- 62,233, 32,221, 62,153,153,129, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,172, 41,180, 62,198,230,227, 62,165,174, 39, 62,217,196, 7, 62,160, 83,184, 62,193,135, 46, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,160, 83,184, 62,193,135, 46, 62,166,248,150, 62,174, 54, 78, 62,172, 41,180,
- 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,180,111,165,
- 62,172, 41,180, 62,198,230,227, 62,166,248,150, 62,174, 54, 78, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,166,248,150, 62,174, 54, 78, 62,160, 83,184, 62,193,135, 46, 62,154, 67,137, 62,169,150, 70, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147,183, 73, 62,189,208,167, 62,154, 67,137, 62,169,150, 70,
- 62,160, 83,184, 62,193,135, 46, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,160, 83,184,
- 62,193,135, 46, 62,153,211,171, 62,213,159,187, 62,147,183, 73, 62,189,208,167, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,141,215, 97, 62,210, 92, 60, 62,147,183, 73, 62,189,208,167, 62,153,211,171, 62,213,159,187,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,153,211,171, 62,213,159,187, 62,160, 83,184,
- 62,193,135, 46, 62,165,174, 39, 62,217,196, 7, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,159,144, 3, 62,236,207, 67, 62,153,153,129, 63, 0, 0, 0, 62,147,212,161, 62,233, 32,221, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147,212,161, 62,233, 32,221, 62,153,211,171, 62,213,159,187, 62,159,144, 3,
- 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165,174, 39, 62,217,196, 7,
- 62,159,144, 3, 62,236,207, 67, 62,153,211,171, 62,213,159,187, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,153,211,171, 62,213,159,187, 62,147,212,161, 62,233, 32,221, 62,141,215, 97, 62,210, 92, 60, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147,183, 73, 62,189,208,167, 62,141,215, 97, 62,210, 92, 60,
- 62,135, 86, 9, 62,187,220, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,135, 86, 9,
- 62,187,220, 79, 62,141, 61, 82, 62,166,190,112, 62,147,183, 73, 62,189,208,167, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,154, 67,137, 62,169,150, 70, 62,147,183, 73, 62,189,208,167, 62,141, 61, 82, 62,166,190,112,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,141, 61, 82, 62,166,190,112, 62,135, 86, 9,
- 62,187,220, 79, 62,128, 0, 0, 62,165,199,206, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,147,163, 1, 63, 9,152, 91, 62,141,132,224, 63, 19, 29,246, 62,134,168,251, 63, 9,150,107, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,134,168,251, 63, 9,150,107, 62,140,204,193, 62,255,252, 25, 62,147,163, 1,
- 63, 9,152, 91, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,153,153,129, 63, 0, 0, 0,
- 62,147,163, 1, 63, 9,152, 91, 62,140,204,193, 62,255,252, 25, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,140,204,193, 62,255,252, 25, 62,134,168,251, 63, 9,150,107, 62,128, 0, 0, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,114,174, 11, 63, 9,150,107, 62,128, 0, 0, 63, 0, 0, 0,
- 62,134,168,251, 63, 9,150,107, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,134,168,251,
- 63, 9,150,107, 62,128, 0, 0, 63, 19, 98,209, 62,114,174, 11, 63, 9,150,107, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,100,246, 64, 63, 19, 29,246, 62,114,174, 11, 63, 9,150,107, 62,128, 0, 0, 63, 19, 98,209,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 19, 98,209, 62,134,168,251,
- 63, 9,150,107, 62,141,132,224, 63, 19, 29,246, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,135, 9, 86, 63, 28,140,130, 62,128, 0, 0, 63, 37,200, 23, 62,113,237, 83, 63, 28,140,130, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,113,237, 83, 63, 28,140,130, 62,128, 0, 0, 63, 19, 98,209, 62,135, 9, 86,
- 63, 28,140,130, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,141,132,224, 63, 19, 29,246,
- 62,135, 9, 86, 63, 28,140,130, 62,128, 0, 0, 63, 19, 98,209, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,128, 0, 0, 63, 19, 98,209, 62,113,237, 83, 63, 28,140,130, 62,100,246, 64, 63, 19, 29,246, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,114,174, 11, 63, 9,150,107, 62,100,246, 64, 63, 19, 29,246,
- 62, 88,185,255, 63, 9,152, 90, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 88,185,255,
- 63, 9,152, 90, 62,102,102,126, 62,255,252, 25, 62,114,174, 11, 63, 9,150,107, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 63, 0, 0, 0, 62,114,174, 11, 63, 9,150,107, 62,102,102,126, 62,255,252, 25,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,102,102,126, 62,255,252, 25, 62, 88,185,255,
- 63, 9,152, 90, 62, 76,204,254, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,223, 16, 63, 62,187,220, 62, 62,216,142,233, 62,210, 92, 49, 62,210,174,248, 62,189,208,153, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,210,174,248, 62,189,208,153, 62,217, 40,237, 62,166,190, 91, 62,223, 16, 63,
- 62,187,220, 62, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 72, 62,165,199,183,
- 62,223, 16, 63, 62,187,220, 62, 62,217, 40,237, 62,166,190, 91, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,217, 40,237, 62,166,190, 91, 62,210,174,248, 62,189,208,153, 62,204, 34,175, 62,169,150, 54, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198, 18,129, 62,193,135, 37, 62,204, 34,175, 62,169,150, 54,
- 62,210,174,248, 62,189,208,153, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,210,174,248,
- 62,189,208,153, 62,204,146,151, 62,213,159,180, 62,198, 18,129, 62,193,135, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,192,184, 21, 62,217,196, 6, 62,198, 18,129, 62,193,135, 37, 62,204,146,151, 62,213,159,180,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,204,146,151, 62,213,159,180, 62,210,174,248,
- 62,189,208,153, 62,216,142,233, 62,210, 92, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,210,145,170, 62,233, 32,214, 62,204,204,202, 63, 0, 0, 0, 62,198,214, 65, 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198,214, 65, 62,236,207, 67, 62,204,146,151, 62,213,159,180, 62,210,145,170,
- 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,216,142,233, 62,210, 92, 49,
- 62,210,145,170, 62,233, 32,214, 62,204,146,151, 62,213,159,180, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,204,146,151, 62,213,159,180, 62,198,214, 65, 62,236,207, 67, 62,192,184, 21, 62,217,196, 6, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,198, 18,129, 62,193,135, 37, 62,192,184, 21, 62,217,196, 6,
- 62,186, 60,127, 62,198,230,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,186, 60,127,
- 62,198,230,225, 62,191,109,154, 62,174, 54, 68, 62,198, 18,129, 62,193,135, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,204, 34,175, 62,169,150, 54, 62,198, 18,129, 62,193,135, 37, 62,191,109,154, 62,174, 54, 68,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,191,109,154, 62,174, 54, 68, 62,186, 60,127,
- 62,198,230,225, 62,179, 51, 21, 62,180,111,165, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,210,145,170, 62,233, 32,214, 62,216,142,233, 62,210, 92, 49, 62,223,159,171, 62,233, 23, 57, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223,159,171, 62,233, 23, 57, 62,217,153,154, 62,255,252, 24, 62,210,145,170,
- 62,233, 32,214, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,204,204,202, 63, 0, 0, 0,
- 62,210,145,170, 62,233, 32,214, 62,217,153,154, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,217,153,154, 62,255,252, 24, 62,223,159,171, 62,233, 23, 57, 62,230,102,101, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237, 45, 20, 62,233, 23, 55, 62,230,102,101, 63, 0, 0, 0,
- 62,223,159,171, 62,233, 23, 57, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223,159,171,
- 62,233, 23, 57, 62,230,102, 88, 62,209,190,135, 62,237, 45, 20, 62,233, 23, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,244, 61,199, 62,210, 92, 46, 62,237, 45, 20, 62,233, 23, 55, 62,230,102, 88, 62,209,190,135,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 88, 62,209,190,135, 62,223,159,171,
- 62,233, 23, 57, 62,216,142,233, 62,210, 92, 49, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,223, 16, 63, 62,187,220, 62, 62,230,102, 72, 62,165,199,183, 62,237,188, 99, 62,187,220, 60, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237,188, 99, 62,187,220, 60, 62,230,102, 88, 62,209,190,135, 62,223, 16, 63,
- 62,187,220, 62, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,216,142,233, 62,210, 92, 49,
- 62,223, 16, 63, 62,187,220, 62, 62,230,102, 88, 62,209,190,135, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,230,102, 88, 62,209,190,135, 62,237,188, 99, 62,187,220, 60, 62,244, 61,199, 62,210, 92, 46, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237, 45, 20, 62,233, 23, 55, 62,244, 61,199, 62,210, 92, 46,
- 62,250, 59, 21, 62,233, 32,213, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,250, 59, 21,
- 62,233, 32,213, 62,243, 51, 53, 62,255,252, 24, 62,237, 45, 20, 62,233, 23, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,101, 63, 0, 0, 0, 62,237, 45, 20, 62,233, 23, 55, 62,243, 51, 53, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,243, 51, 53, 62,255,252, 24, 62,250, 59, 21,
- 62,233, 32,213, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 9, 72, 17, 62,198,230,227, 63, 6, 10, 77, 62,217,196, 6, 63, 3, 93, 15, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 93, 15, 62,193,135, 36, 63, 6,175,123, 62,174, 54, 65, 63, 9, 72, 17,
- 62,198,230,227, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,180,111,160,
- 63, 9, 72, 17, 62,198,230,227, 63, 6,175,123, 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 6,175,123, 62,174, 54, 65, 63, 3, 93, 15, 62,193,135, 36, 63, 0, 84,241, 62,169,150, 52, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,250, 29,169, 62,189,208,150, 63, 0, 84,241, 62,169,150, 52,
- 63, 3, 93, 15, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3, 93, 15,
- 62,193,135, 36, 63, 0, 29, 12, 62,213,159,179, 62,250, 29,169, 62,189,208,150, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,244, 61,199, 62,210, 92, 46, 62,250, 29,169, 62,189,208,150, 63, 0, 29, 12, 62,213,159,179,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 0, 29, 12, 62,213,159,179, 63, 3, 93, 15,
- 62,193,135, 36, 63, 6, 10, 77, 62,217,196, 6, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 2,251, 62, 62,236,207, 67, 63, 0, 0, 0, 63, 0, 0, 0, 62,250, 59, 21, 62,233, 32,213, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,250, 59, 21, 62,233, 32,213, 63, 0, 29, 12, 62,213,159,179, 63, 2,251, 62,
- 62,236,207, 67, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6, 10, 77, 62,217,196, 6,
- 63, 2,251, 62, 62,236,207, 67, 63, 0, 29, 12, 62,213,159,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 0, 29, 12, 62,213,159,179, 62,250, 59, 21, 62,233, 32,213, 62,244, 61,199, 62,210, 92, 46, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,250, 29,169, 62,189,208,150, 62,244, 61,199, 62,210, 92, 46,
- 62,237,188, 99, 62,187,220, 60, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237,188, 99,
- 62,187,220, 60, 62,243,163,164, 62,166,190, 89, 62,250, 29,169, 62,189,208,150, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 0, 84,241, 62,169,150, 52, 62,250, 29,169, 62,189,208,150, 62,243,163,164, 62,166,190, 89,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,243,163,164, 62,166,190, 89, 62,237,188, 99,
- 62,187,220, 60, 62,230,102, 72, 62,165,199,183, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,250, 9,132, 63, 9,152, 94, 62,243,235,101, 63, 19, 29,252, 62,237, 15,114, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237, 15,114, 63, 9,150,113, 62,243, 51, 53, 62,255,252, 24, 62,250, 9,132,
- 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 62,250, 9,132, 63, 9,152, 94, 62,243, 51, 53, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,243, 51, 53, 62,255,252, 24, 62,237, 15,114, 63, 9,150,113, 62,230,102,101, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223,189,103, 63, 9,150,112, 62,230,102,101, 63, 0, 0, 0,
- 62,237, 15,114, 63, 9,150,113, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,237, 15,114,
- 63, 9,150,113, 62,230,102,117, 63, 19, 98,220, 62,223,189,103, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,216,225,128, 63, 19, 29,254, 62,223,189,103, 63, 9,150,112, 62,230,102,117, 63, 19, 98,220,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,117, 63, 19, 98,220, 62,237, 15,114,
- 63, 9,150,113, 62,243,235,101, 63, 19, 29,252, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,237,111,222, 63, 28,140,143, 62,230,102,129, 63, 37,200, 48, 62,223, 93, 22, 63, 28,140,145, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223, 93, 22, 63, 28,140,145, 62,230,102,117, 63, 19, 98,220, 62,237,111,222,
- 63, 28,140,143, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,243,235,101, 63, 19, 29,252,
- 62,237,111,222, 63, 28,140,143, 62,230,102,117, 63, 19, 98,220, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,230,102,117, 63, 19, 98,220, 62,223, 93, 22, 63, 28,140,145, 62,216,225,128, 63, 19, 29,254, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,223,189,103, 63, 9,150,112, 62,216,225,128, 63, 19, 29,254,
- 62,210,195, 85, 63, 9,152, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,210,195, 85,
- 63, 9,152, 96, 62,217,153,154, 62,255,252, 24, 62,223,189,103, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102,101, 63, 0, 0, 0, 62,223,189,103, 63, 9,150,112, 62,217,153,154, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,217,153,154, 62,255,252, 24, 62,210,195, 85,
- 63, 9,152, 96, 62,204,204,202, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 34,187, 97, 62,187,220, 72, 63, 31,122,178, 62,210, 92, 55, 63, 28,138,186, 62,189,208,155, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,138,186, 62,189,208,155, 63, 31,199,185, 62,166,190, 96, 63, 34,187, 97,
- 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,107, 62,165,199,201,
- 63, 34,187, 97, 62,187,220, 72, 63, 31,199,185, 62,166,190, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 31,199,185, 62,166,190, 96, 63, 28,138,186, 62,189,208,155, 63, 25, 68,150, 62,169,150, 54, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22, 60,123, 62,193,135, 36, 63, 25, 68,150, 62,169,150, 54,
- 63, 28,138,186, 62,189,208,155, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,138,186,
- 62,189,208,155, 63, 25,124,133, 62,213,159,181, 63, 22, 60,123, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,143, 64, 62,217,196, 4, 63, 22, 60,123, 62,193,135, 36, 63, 25,124,133, 62,213,159,181,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,124,133, 62,213,159,181, 63, 28,138,186,
- 62,189,208,155, 63, 31,122,178, 62,210, 92, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 28,124, 14, 62,233, 32,218, 63, 25,153,155, 63, 0, 0, 0, 63, 22,158, 86, 62,236,207, 65, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22,158, 86, 62,236,207, 65, 63, 25,124,133, 62,213,159,181, 63, 28,124, 14,
- 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,122,178, 62,210, 92, 55,
- 63, 28,124, 14, 62,233, 32,218, 63, 25,124,133, 62,213,159,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 25,124,133, 62,213,159,181, 63, 22,158, 86, 62,236,207, 65, 63, 19,143, 64, 62,217,196, 4, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 22, 60,123, 62,193,135, 36, 63, 19,143, 64, 62,217,196, 4,
- 63, 16, 81,117, 62,198,230,223, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 16, 81,117,
- 62,198,230,223, 63, 18,234, 7, 62,174, 54, 65, 63, 22, 60,123, 62,193,135, 36, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 25, 68,150, 62,169,150, 54, 63, 22, 60,123, 62,193,135, 36, 63, 18,234, 7, 62,174, 54, 65,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 18,234, 7, 62,174, 54, 65, 63, 16, 81,117,
- 62,198,230,223, 63, 12,204,191, 62,180,111,160, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 28,124, 14, 62,233, 32,218, 63, 31,122,178, 62,210, 92, 55, 63, 35, 3, 17, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 35, 3, 17, 62,233, 23, 58, 63, 32, 0, 2, 62,255,252, 24, 63, 28,124, 14,
- 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 25,153,155, 63, 0, 0, 0,
- 63, 28,124, 14, 62,233, 32,218, 63, 32, 0, 2, 62,255,252, 24, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 32, 0, 2, 62,255,252, 24, 63, 35, 3, 17, 62,233, 23, 58, 63, 38,102,109, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 41,201,200, 62,233, 23, 58, 63, 38,102,109, 63, 0, 0, 0,
- 63, 35, 3, 17, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 35, 3, 17,
- 62,233, 23, 58, 63, 38,102,109, 62,209,190,143, 63, 41,201,200, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 82, 38, 62,210, 92, 55, 63, 41,201,200, 62,233, 23, 58, 63, 38,102,109, 62,209,190,143,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,109, 62,209,190,143, 63, 35, 3, 17,
- 62,233, 23, 58, 63, 31,122,178, 62,210, 92, 55, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 34,187, 97, 62,187,220, 72, 63, 38,102,107, 62,165,199,201, 63, 42, 17,118, 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 42, 17,118, 62,187,220, 72, 63, 38,102,109, 62,209,190,143, 63, 34,187, 97,
- 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,122,178, 62,210, 92, 55,
- 63, 34,187, 97, 62,187,220, 72, 63, 38,102,109, 62,209,190,143, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 38,102,109, 62,209,190,143, 63, 42, 17,118, 62,187,220, 72, 63, 45, 82, 38, 62,210, 92, 55, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 41,201,200, 62,233, 23, 58, 63, 45, 82, 38, 62,210, 92, 55,
- 63, 48, 80,204, 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 80,204,
- 62,233, 32,218, 63, 44,204,215, 62,255,252, 23, 63, 41,201,200, 62,233, 23, 58, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,109, 63, 0, 0, 0, 63, 41,201,200, 62,233, 23, 58, 63, 44,204,215, 62,255,252, 23,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 44,204,215, 62,255,252, 23, 63, 48, 80,204,
- 62,233, 32,218, 63, 51, 51, 63, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 60,123, 85, 62,198,230,253, 63, 57, 61,144, 62,217,196, 19, 63, 54,144, 86, 62,193,135, 68, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54,144, 86, 62,193,135, 68, 63, 57,226,196, 62,174, 54,114, 63, 60,123, 85,
- 62,198,230,253, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,180,111,211,
- 63, 60,123, 85, 62,198,230,253, 63, 57,226,196, 62,174, 54,114, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 57,226,196, 62,174, 54,114, 63, 54,144, 86, 62,193,135, 68, 63, 51,136, 58, 62,169,150, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 66, 27, 62,189,208,173, 63, 51,136, 58, 62,169,150, 90,
- 63, 54,144, 86, 62,193,135, 68, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54,144, 86,
- 62,193,135, 68, 63, 51, 80, 80, 62,213,159,192, 63, 48, 66, 27, 62,189,208,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 82, 38, 62,210, 92, 55, 63, 48, 66, 27, 62,189,208,173, 63, 51, 80, 80, 62,213,159,192,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 51, 80, 80, 62,213,159,192, 63, 54,144, 86,
- 62,193,135, 68, 63, 57, 61,144, 62,217,196, 19, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 54, 46,128, 62,236,207, 75, 63, 51, 51, 63, 63, 0, 0, 0, 63, 48, 80,204, 62,233, 32,218, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 80,204, 62,233, 32,218, 63, 51, 80, 80, 62,213,159,192, 63, 54, 46,128,
- 62,236,207, 75, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 61,144, 62,217,196, 19,
- 63, 54, 46,128, 62,236,207, 75, 63, 51, 80, 80, 62,213,159,192, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 51, 80, 80, 62,213,159,192, 63, 48, 80,204, 62,233, 32,218, 63, 45, 82, 38, 62,210, 92, 55, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 66, 27, 62,189,208,173, 63, 45, 82, 38, 62,210, 92, 55,
- 63, 42, 17,118, 62,187,220, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 42, 17,118,
- 62,187,220, 72, 63, 45, 5, 26, 62,166,190,117, 63, 48, 66, 27, 62,189,208,173, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 51,136, 58, 62,169,150, 90, 63, 48, 66, 27, 62,189,208,173, 63, 45, 5, 26, 62,166,190,117,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 5, 26, 62,166,190,117, 63, 42, 17,118,
- 62,187,220, 72, 63, 38,102,107, 62,165,199,201, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 48, 55,255, 63, 9,152, 94, 63, 45, 40,237, 63, 19, 29,252, 63, 41,186,242, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 41,186,242, 63, 9,150,112, 63, 44,204,215, 62,255,252, 23, 63, 48, 55,255,
- 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 51, 51, 63, 63, 0, 0, 0,
- 63, 48, 55,255, 63, 9,152, 94, 63, 44,204,215, 62,255,252, 23, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 44,204,215, 62,255,252, 23, 63, 41,186,242, 63, 9,150,112, 63, 38,102,109, 63, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 35, 17,235, 63, 9,150,112, 63, 38,102,109, 63, 0, 0, 0,
- 63, 41,186,242, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 41,186,242,
- 63, 9,150,112, 63, 38,102,113, 63, 19, 98,219, 63, 35, 17,235, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,163,245, 63, 19, 29,253, 63, 35, 17,235, 63, 9,150,112, 63, 38,102,113, 63, 19, 98,219,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,113, 63, 19, 98,219, 63, 41,186,242,
- 63, 9,150,112, 63, 45, 40,237, 63, 19, 29,252, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 41,235, 38, 63, 28,140,141, 63, 38,102,117, 63, 37,200, 45, 63, 34,225,192, 63, 28,140,142, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 34,225,192, 63, 28,140,142, 63, 38,102,113, 63, 19, 98,219, 63, 41,235, 38,
- 63, 28,140,141, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 45, 40,237, 63, 19, 29,252,
- 63, 41,235, 38, 63, 28,140,141, 63, 38,102,113, 63, 19, 98,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 38,102,113, 63, 19, 98,219, 63, 34,225,192, 63, 28,140,142, 63, 31,163,245, 63, 19, 29,253, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 35, 17,235, 63, 9,150,112, 63, 31,163,245, 63, 19, 29,253,
- 63, 28,148,223, 63, 9,152, 94, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,148,223,
- 63, 9,152, 94, 63, 32, 0, 2, 62,255,252, 24, 63, 35, 17,235, 63, 9,150,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,109, 63, 0, 0, 0, 63, 35, 17,235, 63, 9,150,112, 63, 32, 0, 2, 62,255,252, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 32, 0, 2, 62,255,252, 24, 63, 28,148,223,
- 63, 9,152, 94, 63, 25,153,155, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,107,129,188, 62,128, 45, 66, 63, 99, 71,235, 62,120, 76,222, 63,106, 37, 94, 62, 83, 97, 84, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,106, 37, 94, 62, 83, 97, 84, 63,115, 51, 65, 62, 97,151,248, 63,107,129,188,
- 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,135, 83,151,
- 63,107,129,188, 62,128, 45, 66, 63,115, 51, 65, 62, 97,151,248, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,115, 51, 65, 62, 97,151,248, 63,106, 37, 94, 62, 83, 97, 84, 63,115, 51, 65, 62, 52,111, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,107,129,188, 62,128, 45, 66, 63,115, 51, 65, 62,135, 83,151,
- 63,108,123,142, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108,123,142,
- 62,151,144,169, 63,101, 50,231, 62,146,201, 17, 63,107,129,188, 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 99, 71,235, 62,120, 76,222, 63,107,129,188, 62,128, 45, 66, 63,101, 50,231, 62,146,201, 17,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,101, 50,231, 62,146,201, 17, 63,108,123,142,
- 62,151,144,169, 63,102,187,106, 62,169,150, 54, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 96, 56, 71, 62,166,190, 99, 63, 89,153,149, 62,165,199,201, 63, 93,238, 22, 62,144,101,243, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 93,238, 22, 62,144,101,243, 63,101, 50,231, 62,146,201, 17, 63, 96, 56, 71,
- 62,166,190, 99, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,102,187,106, 62,169,150, 54,
- 63, 96, 56, 71, 62,166,190, 99, 63,101, 50,231, 62,146,201, 17, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,101, 50,231, 62,146,201, 17, 63, 93,238, 22, 62,144,101,243, 63, 99, 71,235, 62,120, 76,222, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,109, 21,249, 62,174, 54, 65, 63,102,187,106, 62,169,150, 54,
- 63,108,123,142, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,108,123,142,
- 62,151,144,169, 63,115, 51, 65, 62,157,231, 93, 63,109, 21,249, 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,180,111,160, 63,109, 21,249, 62,174, 54, 65, 63,115, 51, 65, 62,157,231, 93,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,157,231, 93, 63,108,123,142,
- 62,151,144,169, 63,115, 51, 65, 62,135, 83,151, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 89,153,149, 62,115,162, 79, 63, 99, 71,235, 62,120, 76,222, 63, 93,238, 22, 62,144,101,243, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 93,238, 22, 62,144,101,243, 63, 85, 69, 21, 62,144,102, 3, 63, 89,153,149,
- 62,115,162, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,235, 68, 62,120, 77, 37,
- 63, 89,153,149, 62,115,162, 79, 63, 85, 69, 21, 62,144,102, 3, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 85, 69, 21, 62,144,102, 3, 63, 93,238, 22, 62,144,101,243, 63, 89,153,149, 62,165,199,201, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,149, 62,115,162, 79, 63, 79,235, 68, 62,120, 77, 37,
- 63, 83,186, 24, 62, 70,176,245, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 83,186, 24,
- 62, 70,176,245, 63, 95,121, 22, 62, 70,176,204, 63, 89,153,149, 62,115,162, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 99, 71,235, 62,120, 76,222, 63, 89,153,149, 62,115,162, 79, 63, 95,121, 22, 62, 70,176,204,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 95,121, 22, 62, 70,176,204, 63, 83,186, 24,
- 62, 70,176,245, 63, 89,153,152, 62, 23, 31,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,103,119, 61, 62, 30,253,179, 63,115, 51, 65, 62, 52,111, 90, 63,106, 37, 94, 62, 83, 97, 84, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,106, 37, 94, 62, 83, 97, 84, 63, 95,121, 22, 62, 70,176,204, 63,103,119, 61,
- 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,152, 62, 23, 31,198,
- 63,103,119, 61, 62, 30,253,179, 63, 95,121, 22, 62, 70,176,204, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 95,121, 22, 62, 70,176,204, 63,106, 37, 94, 62, 83, 97, 84, 63, 99, 71,235, 62,120, 76,222, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 75,187,248, 62, 30,253,241, 63, 89,153,152, 62, 23, 31,198,
- 63, 83,186, 24, 62, 70,176,245, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 83,186, 24,
- 62, 70,176,245, 63, 73, 13,214, 62, 83, 97,181, 63, 75,187,248, 62, 30,253,241, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62, 52,111,202, 63, 75,187,248, 62, 30,253,241, 63, 73, 13,214, 62, 83, 97,181,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 73, 13,214, 62, 83, 97,181, 63, 83,186, 24,
- 62, 70,176,245, 63, 79,235, 68, 62,120, 77, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 89,153,152, 61,147, 41,111, 63, 64, 0, 0, 61,180,111,195, 63, 64, 0, 0, 61, 52, 65,111, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 61, 52, 65,111, 63,117, 49, 38, 61, 52, 64,225, 63, 89,153,152,
- 61,147, 41,111, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 61,180,111, 83,
- 63, 89,153,152, 61,147, 41,111, 63,117, 49, 38, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,117, 49, 38, 61, 52, 64,225, 63, 64, 0, 0, 61, 52, 65,111, 63,121,222,208,178,239, 9,102, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,152, 61,147, 41,111, 63,115, 51, 65, 61,180,111, 83,
- 63, 99, 51,172, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99, 51,172,
- 61,231, 46, 48, 63, 79,255,135, 61,231, 46,120, 63, 89,153,152, 61,147, 41,111, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 61,180,111,195, 63, 89,153,152, 61,147, 41,111, 63, 79,255,135, 61,231, 46,120,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,255,135, 61,231, 46,120, 63, 99, 51,172,
- 61,231, 46, 48, 63, 89,153,152, 62, 23, 31,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 75,187,248, 62, 30,253,241, 63, 64, 0, 0, 62, 52,111,202, 63, 64, 0, 0, 62, 7, 71, 24, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62, 7, 71, 24, 63, 79,255,135, 61,231, 46,120, 63, 75,187,248,
- 62, 30,253,241, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,152, 62, 23, 31,198,
- 63, 75,187,248, 62, 30,253,241, 63, 79,255,135, 61,231, 46,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 79,255,135, 61,231, 46,120, 63, 64, 0, 0, 62, 7, 71, 24, 63, 64, 0, 0, 61,180,111,195, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,103,119, 61, 62, 30,253,179, 63, 89,153,152, 62, 23, 31,198,
- 63, 99, 51,172, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 99, 51,172,
- 61,231, 46, 48, 63,115, 51, 66, 62, 7, 70,199, 63,103,119, 61, 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62, 52,111, 90, 63,103,119, 61, 62, 30,253,179, 63,115, 51, 66, 62, 7, 70,199,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 66, 62, 7, 70,199, 63, 99, 51,172,
- 61,231, 46, 48, 63,115, 51, 65, 61,180,111, 83, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 71,177,122, 62,128, 45,120, 63, 64, 0, 0, 62,135, 83,218, 63, 64, 0, 0, 62, 97,152,115, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62, 97,152,115, 63, 73, 13,214, 62, 83, 97,181, 63, 71,177,122,
- 62,128, 45,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 79,235, 68, 62,120, 77, 37,
- 63, 71,177,122, 62,128, 45,120, 63, 73, 13,214, 62, 83, 97,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 73, 13,214, 62, 83, 97,181, 63, 64, 0, 0, 62, 97,152,115, 63, 64, 0, 0, 62, 52,111,202, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 71,177,122, 62,128, 45,120, 63, 79,235, 68, 62,120, 77, 37,
- 63, 78, 0, 72, 62,146,201, 52, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 78, 0, 72,
- 62,146,201, 52, 63, 70,183,169, 62,151,144,219, 63, 71,177,122, 62,128, 45,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,135, 83,218, 63, 71,177,122, 62,128, 45,120, 63, 70,183,169, 62,151,144,219,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 70,183,169, 62,151,144,219, 63, 78, 0, 72,
- 62,146,201, 52, 63, 76,119,198, 62,169,150, 90, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 70, 29, 61, 62,174, 54,114, 63, 64, 0, 0, 62,180,111,211, 63, 64, 0, 0, 62,157,231,162, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,157,231,162, 63, 70,183,169, 62,151,144,219, 63, 70, 29, 61,
- 62,174, 54,114, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 76,119,198, 62,169,150, 90,
- 63, 70, 29, 61, 62,174, 54,114, 63, 70,183,169, 62,151,144,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 70,183,169, 62,151,144,219, 63, 64, 0, 0, 62,157,231,162, 63, 64, 0, 0, 62,135, 83,218, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 82,250,230, 62,166,190,117, 63, 76,119,198, 62,169,150, 90,
- 63, 78, 0, 72, 62,146,201, 52, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 78, 0, 72,
- 62,146,201, 52, 63, 85, 69, 21, 62,144,102, 3, 63, 82,250,230, 62,166,190,117, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 89,153,149, 62,165,199,201, 63, 82,250,230, 62,166,190,117, 63, 85, 69, 21, 62,144,102, 3,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 85, 69, 21, 62,144,102, 3, 63, 78, 0, 72,
- 62,146,201, 52, 63, 79,235, 68, 62,120, 77, 37, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,245,167,179, 62,128, 45, 72, 61,179,217, 94, 62,120, 76,222, 61,234,196,202, 62, 83, 97,100, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,234,196,202, 62, 83, 97,100, 62, 25,153,212, 62, 97,152, 2, 61,245,167,179,
- 62,128, 45, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62,135, 83,156,
- 61,245,167,179, 62,128, 45, 72, 62, 25,153,212, 62, 97,152, 2, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 25,153,212, 62, 97,152, 2, 61,234,196,202, 62, 83, 97,100, 62, 25,153,214, 62, 52,111,106, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,245,167,179, 62,128, 45, 72, 62, 25,153,214, 62,135, 83,156,
- 61,253,118, 62, 62,151,144,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,253,118, 62,
- 62,151,144,174, 61,195, 49, 53, 62,146,201, 17, 61,245,167,179, 62,128, 45, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,179,217, 94, 62,120, 76,222, 61,245,167,179, 62,128, 45, 72, 61,195, 49, 53, 62,146,201, 17,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,195, 49, 53, 62,146,201, 17, 61,253,118, 62,
- 62,151,144,174, 61,207,117, 70, 62,169,150, 54, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,155, 92, 79, 62,166,190, 91, 61, 76,205,194, 62,165,199,186, 61,137, 10,212, 62,144,101,238, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,137, 10,212, 62,144,101,238, 61,195, 49, 53, 62,146,201, 17, 61,155, 92, 79,
- 62,166,190, 91, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,207,117, 70, 62,169,150, 54,
- 61,155, 92, 79, 62,166,190, 91, 61,195, 49, 53, 62,146,201, 17, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,195, 49, 53, 62,146,201, 17, 61,137, 10,212, 62,144,101,238, 61,179,217, 94, 62,120, 76,222, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 1, 36,204, 62,174, 54, 70, 61,207,117, 70, 62,169,150, 54,
- 61,253,118, 62, 62,151,144,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,253,118, 62,
- 62,151,144,174, 62, 25,153,213, 62,157,231,100, 62, 1, 36,204, 62,174, 54, 70, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62,180,111,165, 62, 1, 36,204, 62,174, 54, 70, 62, 25,153,213, 62,157,231,100,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,213, 62,157,231,100, 61,253,118, 62,
- 62,151,144,174, 62, 25,153,214, 62,135, 83,156, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61, 76,205,188, 62,115,162, 53, 61,179,217, 94, 62,120, 76,222, 61,137, 10,212, 62,144,101,238, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,137, 10,212, 62,144,101,238, 61, 7,133,207, 62,144,101,236, 61, 76,205,188,
- 62,115,162, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60, 71,162,255, 62,120, 76,216,
- 61, 76,205,188, 62,115,162, 53, 61, 7,133,207, 62,144,101,236, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61, 7,133,207, 62,144,101,236, 61,137, 10,212, 62,144,101,238, 61, 76,205,194, 62,165,199,186, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,205,188, 62,115,162, 53, 60, 71,162,255, 62,120, 76,216,
- 60,221,171,190, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,221,171,190,
- 62, 70,176,194, 61,149, 98,194, 62, 70,176,194, 61, 76,205,188, 62,115,162, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61,179,217, 94, 62,120, 76,222, 61, 76,205,188, 62,115,162, 53, 61,149, 98,194, 62, 70,176,194,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,149, 98,194, 62, 70,176,194, 60,221,171,190,
- 62, 70,176,194, 61, 76,205,193, 62, 23, 31,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 61,213, 83,198, 62, 30,253,179, 62, 25,153,214, 62, 52,111,106, 61,234,196,202, 62, 83, 97,100, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,234,196,202, 62, 83, 97,100, 61,149, 98,194, 62, 70,176,194, 61,213, 83,198,
- 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,205,193, 62, 23, 31,168,
- 61,213, 83,198, 62, 30,253,179, 61,149, 98,194, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 61,149, 98,194, 62, 70,176,194, 61,234,196,202, 62, 83, 97,100, 61,179,217, 94, 62,120, 76,222, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,126,239, 59, 62, 30,253,174, 63,131,105,154, 62, 23, 31,168,
- 63,131,118,175, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,131,118,175,
- 62, 70,176,194, 63,124, 65, 30, 62, 83, 97, 90, 63,126,239, 59, 62, 30,253,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62, 52,111, 90, 63,126,239, 59, 62, 30,253,174, 63,124, 65, 30, 62, 83, 97, 90,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,124, 65, 30, 62, 83, 97, 90, 63,131,118,175,
- 62, 70,176,194, 63,129,143, 70, 62,120, 76,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,131,105,156, 61,147, 41,101, 63,115, 51, 65, 61,180,111, 83, 63,117, 49, 38, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,117, 49, 38, 61, 52, 64,225, 63,135,148,232, 60,125,158,144, 63,131,105,156,
- 61,147, 41,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,215, 61,180,111,104,
- 61,128,245,122, 61,147, 41,101, 62, 25,153,224, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,135,148,232, 60,125,158,144, 63,117, 49, 38, 61, 52, 64,225, 63,121,222,208,178,239, 9,102, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,128,245,122, 61,147, 41,101, 62, 25,153,215, 61,180,111,104,
- 61,179, 55, 89, 61,231, 46, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,179, 55, 89,
- 61,231, 46, 38, 60,208,147, 96, 61,231, 46, 48, 61,128,245,122, 61,147, 41,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 61,180,111, 83, 63,131,105,156, 61,147, 41,101, 63,129,153,102, 61,231, 46, 48,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 60,208,147, 96, 61,231, 46, 48, 61,179, 55, 89,
- 61,231, 46, 38, 61, 76,205,193, 62, 23, 31,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,126,239, 59, 62, 30,253,174, 63,115, 51, 65, 62, 52,111, 90, 63,115, 51, 66, 62, 7, 70,199, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 66, 62, 7, 70,199, 63,129,153,102, 61,231, 46, 48, 63,126,239, 59,
- 62, 30,253,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,131,105,154, 62, 23, 31,168,
- 63,126,239, 59, 62, 30,253,174, 63,129,153,102, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,129,153,102, 61,231, 46, 48, 63,115, 51, 66, 62, 7, 70,199, 63,115, 51, 65, 61,180,111, 83, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,213, 83,198, 62, 30,253,179, 61, 76,205,193, 62, 23, 31,168,
- 61,179, 55, 89, 61,231, 46, 38, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61,179, 55, 89,
- 61,231, 46, 38, 62, 25,153,217, 62, 7, 70,204, 61,213, 83,198, 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62, 52,111,106, 61,213, 83,198, 62, 30,253,179, 62, 25,153,217, 62, 7, 70,204,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,217, 62, 7, 70,204, 61,179, 55, 89,
- 61,231, 46, 38, 62, 25,153,215, 61,180,111,104, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,122,228,192, 62,128, 45, 66, 63,115, 51, 65, 62,135, 83,151, 63,115, 51, 65, 62, 97,151,248, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62, 97,151,248, 63,124, 65, 30, 62, 83, 97, 90, 63,122,228,192,
- 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,129,143, 70, 62,120, 76,216,
- 63,122,228,192, 62,128, 45, 66, 63,124, 65, 30, 62, 83, 97, 90, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,124, 65, 30, 62, 83, 97, 90, 63,115, 51, 65, 62, 97,151,248, 63,115, 51, 65, 62, 52,111, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,122,228,192, 62,128, 45, 66, 63,129,143, 70, 62,120, 76,216,
- 63,128,153,201, 62,146,201, 14, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,128,153,201,
- 62,146,201, 14, 63,121,234,239, 62,151,144,169, 63,122,228,192, 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,135, 83,151, 63,122,228,192, 62,128, 45, 66, 63,121,234,239, 62,151,144,169,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,121,234,239, 62,151,144,169, 63,128,153,201,
- 62,146,201, 14, 63,127,171, 15, 62,169,150, 52, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63,121, 80,133, 62,174, 54, 65, 63,115, 51, 65, 62,180,111,160, 63,115, 51, 65, 62,157,231, 93, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,115, 51, 65, 62,157,231, 93, 63,121,234,239, 62,151,144,169, 63,121, 80,133,
- 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,127,171, 15, 62,169,150, 52,
- 63,121, 80,133, 62,174, 54, 65, 63,121,234,239, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63,121,234,239, 62,151,144,169, 63,115, 51, 65, 62,157,231, 93, 63,115, 51, 65, 62,135, 83,151, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63,131, 23, 23, 62,166,190, 89, 63,127,171, 15, 62,169,150, 52,
- 63,128,153,201, 62,146,201, 14, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 59,153,200,136,
- 62,146,201, 14, 61, 7,133,207, 62,144,101,236, 60,197,197,195, 62,166,190, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 61, 76,205,194, 62,165,199,186, 60,197,197,195, 62,166,190, 89, 61, 7,133,207, 62,144,101,236,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 61, 7,133,207, 62,144,101,236, 59,153,200,136,
- 62,146,201, 14, 60, 71,162,255, 62,120, 76,216, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,163,208, 32, 62,128, 45, 79, 62,147, 92,147, 62,120, 76,252, 62,161, 23,102, 62, 83, 97,115, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,161, 23,102, 62, 83, 97,115, 62,179, 51, 22, 62, 97,152, 2, 62,163,208, 32,
- 62,128, 45, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,135, 83,156,
- 62,163,208, 32, 62,128, 45, 79, 62,179, 51, 22, 62, 97,152, 2, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,179, 51, 22, 62, 97,152, 2, 62,161, 23,102, 62, 83, 97,115, 62,179, 51, 21, 62, 52,111,101, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,163,208, 32, 62,128, 45, 79, 62,179, 51, 21, 62,135, 83,156,
- 62,165,195,194, 62,151,144,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165,195,194,
- 62,151,144,181, 62,151, 50,134, 62,146,201, 29, 62,163,208, 32, 62,128, 45, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,147, 92,147, 62,120, 76,252, 62,163,208, 32, 62,128, 45, 79, 62,151, 50,134, 62,146,201, 29,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,151, 50,134, 62,146,201, 29, 62,165,195,194,
- 62,151,144,181, 62,154, 67,137, 62,169,150, 70, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,141, 61, 82, 62,166,190,112, 62,128, 0, 0, 62,165,199,206, 62,136,168,247, 62,144,102, 3, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,136,168,247, 62,144,102, 3, 62,151, 50,134, 62,146,201, 29, 62,141, 61, 82,
- 62,166,190,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,154, 67,137, 62,169,150, 70,
- 62,141, 61, 82, 62,166,190,112, 62,151, 50,134, 62,146,201, 29, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,151, 50,134, 62,146,201, 29, 62,136,168,247, 62,144,102, 3, 62,147, 92,147, 62,120, 76,252, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,166,248,150, 62,174, 54, 78, 62,154, 67,137, 62,169,150, 70,
- 62,165,195,194, 62,151,144,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,165,195,194,
- 62,151,144,181, 62,179, 51, 21, 62,157,231, 98, 62,166,248,150, 62,174, 54, 78, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,180,111,165, 62,166,248,150, 62,174, 54, 78, 62,179, 51, 21, 62,157,231, 98,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,157,231, 98, 62,165,195,194,
- 62,151,144,181, 62,179, 51, 21, 62,135, 83,156, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,128, 0, 0, 62,115,162, 89, 62,147, 92,147, 62,120, 76,252, 62,136,168,247, 62,144,102, 3, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,136,168,247, 62,144,102, 3, 62,110,174, 18, 62,144,102, 3, 62,128, 0, 0,
- 62,115,162, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 89, 70,217, 62,120, 76,252,
- 62,128, 0, 0, 62,115,162, 89, 62,110,174, 18, 62,144,102, 3, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,110,174, 18, 62,144,102, 3, 62,136,168,247, 62,144,102, 3, 62,128, 0, 0, 62,165,199,206, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62,115,162, 89, 62, 89, 70,217, 62,120, 76,252,
- 62,104,130, 30, 62, 70,176,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,104,130, 30,
- 62, 70,176,230, 62,139,190,241, 62, 70,176,230, 62,128, 0, 0, 62,115,162, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,147, 92,147, 62,120, 76,252, 62,128, 0, 0, 62,115,162, 89, 62,139,190,241, 62, 70,176,230,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,139,190,241, 62, 70,176,230, 62,104,130, 30,
- 62, 70,176,230, 62,128, 0, 0, 62, 23, 31,208, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,155,187, 41, 62, 30,253,205, 62,179, 51, 21, 62, 52,111,101, 62,161, 23,102, 62, 83, 97,115, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,161, 23,102, 62, 83, 97,115, 62,139,190,241, 62, 70,176,230, 62,155,187, 41,
- 62, 30,253,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62, 23, 31,208,
- 62,155,187, 41, 62, 30,253,205, 62,139,190,241, 62, 70,176,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,139,190,241, 62, 70,176,230, 62,161, 23,102, 62, 83, 97,115, 62,147, 92,147, 62,120, 76,252, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 72,137,174, 62, 30,253,205, 62,128, 0, 0, 62, 23, 31,208,
- 62,104,130, 30, 62, 70,176,230, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,104,130, 30,
- 62, 70,176,230, 62, 61,209, 51, 62, 83, 97,115, 62, 72,137,174, 62, 30,253,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62, 52,111,106, 62, 72,137,174, 62, 30,253,205, 62, 61,209, 51, 62, 83, 97,115,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 61,209, 51, 62, 83, 97,115, 62,104,130, 30,
- 62, 70,176,230, 62, 89, 70,217, 62,120, 76,252, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,127,255,255, 61,147, 41,141, 62, 25,153,215, 61,180,111,104, 62, 25,153,224, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,224, 61, 52, 64,225, 62,179, 51, 15, 61, 52, 64,225, 62,127,255,255,
- 61,147, 41,141, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 20, 61,180,111,104,
- 62,127,255,255, 61,147, 41,141, 62,179, 51, 15, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,179, 51, 15, 61, 52, 64,225, 62, 25,153,224, 61, 52, 64,225, 62,161,175,144,178,239, 9,102, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,127,255,255, 61,147, 41,141, 62,179, 51, 20, 61,180,111,104,
- 62,147, 52, 12, 61,231, 46,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147, 52, 12,
- 61,231, 46,109, 62, 89,151,231, 61,231, 46,109, 62,127,255,255, 61,147, 41,141, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,215, 61,180,111,104, 62,127,255,255, 61,147, 41,141, 62, 89,151,231, 61,231, 46,109,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 89,151,231, 61,231, 46,109, 62,147, 52, 12,
- 61,231, 46,109, 62,128, 0, 0, 62, 23, 31,208, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 72,137,174, 62, 30,253,205, 62, 25,153,214, 62, 52,111,106, 62, 25,153,217, 62, 7, 70,204, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,217, 62, 7, 70,204, 62, 89,151,231, 61,231, 46,109, 62, 72,137,174,
- 62, 30,253,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62, 23, 31,208,
- 62, 72,137,174, 62, 30,253,205, 62, 89,151,231, 61,231, 46,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 89,151,231, 61,231, 46,109, 62, 25,153,217, 62, 7, 70,204, 62, 25,153,215, 61,180,111,104, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,155,187, 41, 62, 30,253,205, 62,128, 0, 0, 62, 23, 31,208,
- 62,147, 52, 12, 61,231, 46,109, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,147, 52, 12,
- 61,231, 46,109, 62,179, 51, 19, 62, 7, 70,204, 62,155,187, 41, 62, 30,253,205, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62, 52,111,101, 62,155,187, 41, 62, 30,253,205, 62,179, 51, 19, 62, 7, 70,204,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 19, 62, 7, 70,204, 62,147, 52, 12,
- 61,231, 46,109, 62,179, 51, 20, 61,180,111,104, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 56, 95,192, 62,128, 45, 79, 62, 25,153,214, 62,135, 83,156, 62, 25,153,212, 62, 97,152, 2, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,212, 62, 97,152, 2, 62, 61,209, 51, 62, 83, 97,115, 62, 56, 95,192,
- 62,128, 45, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 89, 70,217, 62,120, 76,252,
- 62, 56, 95,192, 62,128, 45, 79, 62, 61,209, 51, 62, 83, 97,115, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 61,209, 51, 62, 83, 97,115, 62, 25,153,212, 62, 97,152, 2, 62, 25,153,214, 62, 52,111,106, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 56, 95,192, 62,128, 45, 79, 62, 89, 70,217, 62,120, 76,252,
- 62, 81,154,245, 62,146,201, 29, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 81,154,245,
- 62,146,201, 29, 62, 52,120,125, 62,151,144,181, 62, 56, 95,192, 62,128, 45, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,214, 62,135, 83,156, 62, 56, 95,192, 62,128, 45, 79, 62, 52,120,125, 62,151,144,181,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 52,120,125, 62,151,144,181, 62, 81,154,245,
- 62,146,201, 29, 62, 75,120,239, 62,169,150, 70, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62, 50, 14,213, 62,174, 54, 78, 62, 25,153,214, 62,180,111,165, 62, 25,153,213, 62,157,231,100, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 25,153,213, 62,157,231,100, 62, 52,120,125, 62,151,144,181, 62, 50, 14,213,
- 62,174, 54, 78, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 75,120,239, 62,169,150, 70,
- 62, 50, 14,213, 62,174, 54, 78, 62, 52,120,125, 62,151,144,181, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62, 52,120,125, 62,151,144,181, 62, 25,153,213, 62,157,231,100, 62, 25,153,214, 62,135, 83,156, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,101,133, 91, 62,166,190,112, 62, 75,120,239, 62,169,150, 70,
- 62, 81,154,245, 62,146,201, 29, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62, 81,154,245,
- 62,146,201, 29, 62,110,174, 18, 62,144,102, 3, 62,101,133, 91, 62,166,190,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,128, 0, 0, 62,165,199,206, 62,101,133, 91, 62,166,190,112, 62,110,174, 18, 62,144,102, 3,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,110,174, 18, 62,144,102, 3, 62, 81,154,245,
- 62,146,201, 29, 62, 89, 70,217, 62,120, 76,252, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 5, 27, 64, 62,128, 45, 66, 62,249,194,232, 62,120, 76,216, 63, 3,190,226, 62, 83, 97, 90, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3,190,226, 62, 83, 97, 90, 63, 12,204,191, 62, 97,151,248, 63, 5, 27, 64,
- 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,135, 83,149,
- 63, 5, 27, 64, 62,128, 45, 66, 63, 12,204,191, 62, 97,151,248, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 12,204,191, 62, 97,151,248, 63, 3,190,226, 62, 83, 97, 90, 63, 12,204,191, 62, 52,111, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 5, 27, 64, 62,128, 45, 66, 63, 12,204,191, 62,135, 83,149,
- 63, 6, 21, 17, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6, 21, 17,
- 62,151,144,169, 62,253,152,222, 62,146,201, 14, 63, 5, 27, 64, 62,128, 45, 66, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,249,194,232, 62,120, 76,216, 63, 5, 27, 64, 62,128, 45, 66, 62,253,152,222, 62,146,201, 14,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,253,152,222, 62,146,201, 14, 63, 6, 21, 17,
- 62,151,144,169, 63, 0, 84,241, 62,169,150, 52, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,243,163,164, 62,166,190, 89, 62,230,102, 72, 62,165,199,183, 62,239, 15, 70, 62,144,101,233, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,239, 15, 70, 62,144,101,233, 62,253,152,222, 62,146,201, 14, 62,243,163,164,
- 62,166,190, 89, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 0, 84,241, 62,169,150, 52,
- 62,243,163,164, 62,166,190, 89, 62,253,152,222, 62,146,201, 14, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,253,152,222, 62,146,201, 14, 62,239, 15, 70, 62,144,101,233, 62,249,194,232, 62,120, 76,216, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6,175,123, 62,174, 54, 65, 63, 0, 84,241, 62,169,150, 52,
- 63, 6, 21, 17, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 6, 21, 17,
- 62,151,144,169, 63, 12,204,191, 62,157,231, 90, 63, 6,175,123, 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,180,111,160, 63, 6,175,123, 62,174, 54, 65, 63, 12,204,191, 62,157,231, 90,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,157,231, 90, 63, 6, 21, 17,
- 62,151,144,169, 63, 12,204,191, 62,135, 83,149, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102, 72, 62,115,162, 53, 62,249,194,232, 62,120, 76,216, 62,239, 15, 70, 62,144,101,233, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,239, 15, 70, 62,144,101,233, 62,221,189, 75, 62,144,101,238, 62,230,102, 72,
- 62,115,162, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,211, 9,168, 62,120, 76,222,
- 62,230,102, 72, 62,115,162, 53, 62,221,189, 75, 62,144,101,238, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,221,189, 75, 62,144,101,238, 62,239, 15, 70, 62,144,101,233, 62,230,102, 72, 62,165,199,183, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 72, 62,115,162, 53, 62,211, 9,168, 62,120, 76,222,
- 62,218,167, 80, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,218,167, 80,
- 62, 70,176,194, 62,242, 37, 68, 62, 70,176,194, 62,230,102, 72, 62,115,162, 53, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,249,194,232, 62,120, 76,216, 62,230,102, 72, 62,115,162, 53, 62,242, 37, 68, 62, 70,176,194,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,242, 37, 68, 62, 70,176,194, 62,218,167, 80,
- 62, 70,176,194, 62,230,102, 72, 62, 23, 31,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 1, 16,197, 62, 30,253,174, 63, 12,204,191, 62, 52,111, 90, 63, 3,190,226, 62, 83, 97, 90, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 3,190,226, 62, 83, 97, 90, 62,242, 37, 68, 62, 70,176,194, 63, 1, 16,197,
- 62, 30,253,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 72, 62, 23, 31,168,
- 63, 1, 16,197, 62, 30,253,174, 62,242, 37, 68, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,242, 37, 68, 62, 70,176,194, 63, 3,190,226, 62, 83, 97, 90, 62,249,194,232, 62,120, 76,216, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,202,171, 14, 62, 30,253,179, 62,230,102, 72, 62, 23, 31,168,
- 62,218,167, 80, 62, 70,176,194, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,218,167, 80,
- 62, 70,176,194, 62,197, 78,205, 62, 83, 97, 95, 62,202,171, 14, 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62, 52,111,101, 62,202,171, 14, 62, 30,253,179, 62,197, 78,205, 62, 83, 97, 95,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,197, 78,205, 62, 83, 97, 95, 62,218,167, 80,
- 62, 70,176,194, 62,211, 9,168, 62,120, 76,222, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,230,102, 63, 61,147, 41,101, 62,179, 51, 20, 61,180,111,104, 62,179, 51, 15, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 15, 61, 52, 64,225, 63, 12,204,189, 61, 52, 64,225, 62,230,102, 63,
- 61,147, 41,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 61,180,111, 83,
- 62,230,102, 63, 61,147, 41,101, 63, 12,204,189, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 12,204,189, 61, 52, 64,225, 62,179, 51, 15, 61, 52, 64,225, 62,161,175,144,178,239, 9,102, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 63, 61,147, 41,101, 63, 12,204,191, 61,180,111, 83,
- 62,249,154,104, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,249,154,104,
- 61,231, 46, 48, 62,211, 50, 42, 61,231, 46, 48, 62,230,102, 63, 61,147, 41,101, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 20, 61,180,111,104, 62,230,102, 63, 61,147, 41,101, 62,211, 50, 42, 61,231, 46, 48,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,211, 50, 42, 61,231, 46, 48, 62,249,154,104,
- 61,231, 46, 48, 62,230,102, 72, 62, 23, 31,168, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,202,171, 14, 62, 30,253,179, 62,179, 51, 21, 62, 52,111,101, 62,179, 51, 19, 62, 7, 70,204, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 19, 62, 7, 70,204, 62,211, 50, 42, 61,231, 46, 48, 62,202,171, 14,
- 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 72, 62, 23, 31,168,
- 62,202,171, 14, 62, 30,253,179, 62,211, 50, 42, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,211, 50, 42, 61,231, 46, 48, 62,179, 51, 19, 62, 7, 70,204, 62,179, 51, 20, 61,180,111,104, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 1, 16,197, 62, 30,253,174, 62,230,102, 72, 62, 23, 31,168,
- 62,249,154,104, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,249,154,104,
- 61,231, 46, 48, 63, 12,204,191, 62, 7, 70,199, 63, 1, 16,197, 62, 30,253,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62, 52,111, 90, 63, 1, 16,197, 62, 30,253,174, 63, 12,204,191, 62, 7, 70,199,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62, 7, 70,199, 62,249,154,104,
- 61,231, 46, 48, 63, 12,204,191, 61,180,111, 83, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,194,150, 19, 62,128, 45, 72, 62,179, 51, 21, 62,135, 83,156, 62,179, 51, 22, 62, 97,152, 2, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 22, 62, 97,152, 2, 62,197, 78,205, 62, 83, 97, 95, 62,194,150, 19,
- 62,128, 45, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,211, 9,168, 62,120, 76,222,
- 62,194,150, 19, 62,128, 45, 72, 62,197, 78,205, 62, 83, 97, 95, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,197, 78,205, 62, 83, 97, 95, 62,179, 51, 22, 62, 97,152, 2, 62,179, 51, 21, 62, 52,111,101, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,194,150, 19, 62,128, 45, 72, 62,211, 9,168, 62,120, 76,222,
- 62,207, 51,179, 62,146,201, 17, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,207, 51,179,
- 62,146,201, 17, 62,192,162,113, 62,151,144,174, 62,194,150, 19, 62,128, 45, 72, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,135, 83,156, 62,194,150, 19, 62,128, 45, 72, 62,192,162,113, 62,151,144,174,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,192,162,113, 62,151,144,174, 62,207, 51,179,
- 62,146,201, 17, 62,204, 34,175, 62,169,150, 54, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 62,191,109,154, 62,174, 54, 68, 62,179, 51, 21, 62,180,111,165, 62,179, 51, 21, 62,157,231, 98, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,179, 51, 21, 62,157,231, 98, 62,192,162,113, 62,151,144,174, 62,191,109,154,
- 62,174, 54, 68, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,204, 34,175, 62,169,150, 54,
- 62,191,109,154, 62,174, 54, 68, 62,192,162,113, 62,151,144,174, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 62,192,162,113, 62,151,144,174, 62,179, 51, 21, 62,157,231, 98, 62,179, 51, 21, 62,135, 83,156, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,217, 40,237, 62,166,190, 91, 62,204, 34,175, 62,169,150, 54,
- 62,207, 51,179, 62,146,201, 17, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,207, 51,179,
- 62,146,201, 17, 62,221,189, 75, 62,144,101,238, 62,217, 40,237, 62,166,190, 91, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 62,230,102, 72, 62,165,199,183, 62,217, 40,237, 62,166,190, 91, 62,221,189, 75, 62,144,101,238,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 62,221,189, 75, 62,144,101,238, 62,207, 51,179,
- 62,146,201, 17, 62,211, 9,168, 62,120, 76,222, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 56, 78,134, 62,128, 45,117, 63, 48, 20,188, 62,120, 77, 37, 63, 54,242, 42, 62, 83, 97,181, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54,242, 42, 62, 83, 97,181, 63, 64, 0, 0, 62, 97,152,115, 63, 56, 78,134,
- 62,128, 45,117, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,135, 83,218,
- 63, 56, 78,134, 62,128, 45,117, 63, 64, 0, 0, 62, 97,152,115, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 64, 0, 0, 62, 97,152,115, 63, 54,242, 42, 62, 83, 97,181, 63, 64, 0, 0, 62, 52,111,202, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 56, 78,134, 62,128, 45,117, 63, 64, 0, 0, 62,135, 83,218,
- 63, 57, 72, 87, 62,151,144,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 72, 87,
- 62,151,144,219, 63, 49,255,184, 62,146,201, 52, 63, 56, 78,134, 62,128, 45,117, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 20,188, 62,120, 77, 37, 63, 56, 78,134, 62,128, 45,117, 63, 49,255,184, 62,146,201, 52,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 49,255,184, 62,146,201, 52, 63, 57, 72, 87,
- 62,151,144,219, 63, 51,136, 58, 62,169,150, 90, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 45, 5, 26, 62,166,190,117, 63, 38,102,107, 62,165,199,201, 63, 42,186,235, 62,144,102, 5, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 42,186,235, 62,144,102, 5, 63, 49,255,184, 62,146,201, 52, 63, 45, 5, 26,
- 62,166,190,117, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 51,136, 58, 62,169,150, 90,
- 63, 45, 5, 26, 62,166,190,117, 63, 49,255,184, 62,146,201, 52, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 49,255,184, 62,146,201, 52, 63, 42,186,235, 62,144,102, 5, 63, 48, 20,188, 62,120, 77, 37, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57,226,196, 62,174, 54,114, 63, 51,136, 58, 62,169,150, 90,
- 63, 57, 72, 87, 62,151,144,219, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 57, 72, 87,
- 62,151,144,219, 63, 64, 0, 0, 62,157,231,162, 63, 57,226,196, 62,174, 54,114, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,180,111,211, 63, 57,226,196, 62,174, 54,114, 63, 64, 0, 0, 62,157,231,162,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62,157,231,162, 63, 57, 72, 87,
- 62,151,144,219, 63, 64, 0, 0, 62,135, 83,218, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,107, 62,115,162, 79, 63, 48, 20,188, 62,120, 77, 37, 63, 42,186,235, 62,144,102, 5, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 42,186,235, 62,144,102, 5, 63, 34, 17,234, 62,144,101,243, 63, 38,102,107,
- 62,115,162, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,184, 21, 62,120, 76,222,
- 63, 38,102,107, 62,115,162, 79, 63, 34, 17,234, 62,144,101,243, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 34, 17,234, 62,144,101,243, 63, 42,186,235, 62,144,102, 5, 63, 38,102,107, 62,165,199,201, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,107, 62,115,162, 79, 63, 28,184, 21, 62,120, 76,222,
- 63, 32,134,234, 62, 70,176,204, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 32,134,234,
- 62, 70,176,204, 63, 44, 69,233, 62, 70,176,245, 63, 38,102,107, 62,115,162, 79, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 20,188, 62,120, 77, 37, 63, 38,102,107, 62,115,162, 79, 63, 44, 69,233, 62, 70,176,245,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 44, 69,233, 62, 70,176,245, 63, 32,134,234,
- 62, 70,176,204, 63, 38,102,104, 62, 23, 31,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 52, 68, 9, 62, 30,253,241, 63, 64, 0, 0, 62, 52,111,202, 63, 54,242, 42, 62, 83, 97,181, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 54,242, 42, 62, 83, 97,181, 63, 44, 69,233, 62, 70,176,245, 63, 52, 68, 9,
- 62, 30,253,241, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,104, 62, 23, 31,198,
- 63, 52, 68, 9, 62, 30,253,241, 63, 44, 69,233, 62, 70,176,245, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 44, 69,233, 62, 70,176,245, 63, 54,242, 42, 62, 83, 97,181, 63, 48, 20,188, 62,120, 77, 37, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 24,136,195, 62, 30,253,179, 63, 38,102,104, 62, 23, 31,198,
- 63, 32,134,234, 62, 70,176,204, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 32,134,234,
- 62, 70,176,204, 63, 21,218,162, 62, 83, 97, 84, 63, 24,136,195, 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62, 52,111, 90, 63, 24,136,195, 62, 30,253,179, 63, 21,218,162, 62, 83, 97, 84,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 21,218,162, 62, 83, 97, 84, 63, 32,134,234,
- 62, 70,176,204, 63, 28,184, 21, 62,120, 76,222, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 38,102,104, 61,147, 41,111, 63, 12,204,191, 61,180,111, 83, 63, 12,204,189, 61, 52, 64,225, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,189, 61, 52, 64,225, 63, 64, 0, 0, 61, 52, 65,111, 63, 38,102,104,
- 61,147, 41,111, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 61,180,111,195,
- 63, 38,102,104, 61,147, 41,111, 63, 64, 0, 0, 61, 52, 65,111, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 64, 0, 0, 61, 52, 65,111, 63, 12,204,189, 61, 52, 64,225, 63,121,222,208,178,239, 9,102, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,104, 61,147, 41,111, 63, 64, 0, 0, 61,180,111,195,
- 63, 48, 0,122, 61,231, 46,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 0,122,
- 61,231, 46,120, 63, 28,204, 85, 61,231, 46, 48, 63, 38,102,104, 61,147, 41,111, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 61,180,111, 83, 63, 38,102,104, 61,147, 41,111, 63, 28,204, 85, 61,231, 46, 48,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,204, 85, 61,231, 46, 48, 63, 48, 0,122,
- 61,231, 46,120, 63, 38,102,104, 62, 23, 31,198, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 24,136,195, 62, 30,253,179, 63, 12,204,191, 62, 52,111, 90, 63, 12,204,191, 62, 7, 70,199, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62, 7, 70,199, 63, 28,204, 85, 61,231, 46, 48, 63, 24,136,195,
- 62, 30,253,179, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,104, 62, 23, 31,198,
- 63, 24,136,195, 62, 30,253,179, 63, 28,204, 85, 61,231, 46, 48, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 28,204, 85, 61,231, 46, 48, 63, 12,204,191, 62, 7, 70,199, 63, 12,204,191, 61,180,111, 83, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 52, 68, 9, 62, 30,253,241, 63, 38,102,104, 62, 23, 31,198,
- 63, 48, 0,122, 61,231, 46,120, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 48, 0,122,
- 61,231, 46,120, 63, 64, 0, 0, 62, 7, 71, 24, 63, 52, 68, 9, 62, 30,253,241, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62, 52,111,202, 63, 52, 68, 9, 62, 30,253,241, 63, 64, 0, 0, 62, 7, 71, 24,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 64, 0, 0, 62, 7, 71, 24, 63, 48, 0,122,
- 61,231, 46,120, 63, 64, 0, 0, 61,180,111,195, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 20,126, 68, 62,128, 45, 64, 63, 12,204,191, 62,135, 83,149, 63, 12,204,191, 62, 97,151,248, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62, 97,151,248, 63, 21,218,162, 62, 83, 97, 84, 63, 20,126, 68,
- 62,128, 45, 64, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 28,184, 21, 62,120, 76,222,
- 63, 20,126, 68, 62,128, 45, 64, 63, 21,218,162, 62, 83, 97, 84, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 21,218,162, 62, 83, 97, 84, 63, 12,204,191, 62, 97,151,248, 63, 12,204,191, 62, 52,111, 90, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 20,126, 68, 62,128, 45, 64, 63, 28,184, 21, 62,120, 76,222,
- 63, 26,205, 25, 62,146,201, 14, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 26,205, 25,
- 62,146,201, 14, 63, 19,132,114, 62,151,144,169, 63, 20,126, 68, 62,128, 45, 64, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,135, 83,149, 63, 20,126, 68, 62,128, 45, 64, 63, 19,132,114, 62,151,144,169,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 19,132,114, 62,151,144,169, 63, 26,205, 25,
- 62,146,201, 14, 63, 25, 68,150, 62,169,150, 54, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 63, 18,234, 7, 62,174, 54, 65, 63, 12,204,191, 62,180,111,160, 63, 12,204,191, 62,157,231, 90, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 12,204,191, 62,157,231, 90, 63, 19,132,114, 62,151,144,169, 63, 18,234, 7,
- 62,174, 54, 65, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 25, 68,150, 62,169,150, 54,
- 63, 18,234, 7, 62,174, 54, 65, 63, 19,132,114, 62,151,144,169, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 63, 19,132,114, 62,151,144,169, 63, 12,204,191, 62,157,231, 90, 63, 12,204,191, 62,135, 83,149, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 31,199,185, 62,166,190, 96, 63, 25, 68,150, 62,169,150, 54,
- 63, 26,205, 25, 62,146,201, 14, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 26,205, 25,
- 62,146,201, 14, 63, 34, 17,234, 62,144,101,243, 63, 31,199,185, 62,166,190, 96, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 63, 38,102,107, 62,165,199,201, 63, 31,199,185, 62,166,190, 96, 63, 34, 17,234, 62,144,101,243,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 63, 34, 17,234, 62,144,101,243, 63, 26,205, 25,
- 62,146,201, 14, 63, 28,184, 21, 62,120, 76,222, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 80, 0, 12,120, 32, 32, 0, 0, 0, 59, 0, 0, 20, 0,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,154, 64,
- 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,161,176, 13, 65,148,176, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101,
-119, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,155,128, 13, 65,160,208, 13, 65,161, 16, 0, 0, 0, 0,
- 13, 65,157, 16, 13, 65,159, 16, 0, 0, 0, 0, 13, 65,161,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,155,176,
- 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,157,176, 0, 0, 0, 1, 0, 0, 0, 5,
- 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,159,112, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,179,128, 0, 0,
- 52, 64, 0, 0,188,142, 92,235, 63,128, 0, 0, 63,128, 0, 2, 60,142, 92,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,155,128, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 8, 32, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,155,176, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,157, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,120,
- 13, 65,157, 16, 0, 0, 0, 58, 0, 0, 0, 5, 63,128, 0, 0, 63,127,255,255, 39,251,255,255, 0, 0, 0, 0,127,255, 2,255,
- 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0,168, 2, 0, 0, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,191,128, 0, 1,
-191,127,255,253,167,251,255,253, 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0,191,127,255,250, 63,128, 0, 3, 40, 2, 0, 3,
- 0, 0, 0, 0,127,255, 2,255, 0, 0, 0, 0, 59,110,239, 0, 60, 26,164,131,189, 14, 92,235, 12,228, 33, 95,133, 28, 3,255,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,157,176, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,159, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 48, 13, 65,159, 16, 0, 0, 0, 55, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 2,
- 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 34, 0, 0, 0, 2,
- 0, 0, 0, 3, 0, 0, 0, 34, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,159,112, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,160,208, 0, 0, 0, 5, 0, 0, 0, 20,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,161, 16, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,161,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 13, 65,160,208, 0, 0, 0, 54, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 44, 13, 65,161, 16, 0, 0, 0, 65,
- 0, 0, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 16, 13, 65,161,112, 0, 0, 0, 59,
- 0, 0, 0, 4,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,161,176,
- 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,169, 16, 13, 65,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101,
-119, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,162,240, 13, 65,168, 48, 13, 65,168,112, 0, 0, 0, 0,
- 13, 65,164,128, 13, 65,166,112, 0, 0, 0, 0, 13, 65,168,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,163, 32,
- 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,165, 16, 0, 0, 0, 1, 0, 0, 0, 5,
- 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,166,208, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,179,128, 0, 0,
- 52, 64, 0, 0, 28,192, 0, 0, 63,128, 0, 0, 63,128, 0, 2, 55, 39,197,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,162,240, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 16, 32, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,163, 32, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,164,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 96,
- 13, 65,164,128, 0, 0, 0, 58, 0, 0, 0, 4, 63,128, 0, 0, 63,127,255,255, 39,251,255,255, 0, 0, 0, 0,127,255, 3,255,
- 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0,168, 2, 0, 0, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0,191,128, 0, 1,
-191,127,255,253,167,251,255,253, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0,191,127,255,250, 63,128, 0, 3, 40, 2, 0, 3,
- 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,165, 16, 0, 0, 1, 35, 0, 0, 0, 5,
- 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,166,112, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 48, 13, 65,166,112, 0, 0, 0, 55, 0, 0, 0, 4,
- 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3,
- 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,166,208, 0, 0, 1, 35,
- 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,168, 48,
- 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,168,112, 0, 0, 0, 6,
- 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,168,208, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 13, 65,168, 48, 0, 0, 0, 54,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 68, 65, 84, 65, 0, 0, 0, 44,
- 13, 65,168,112, 0, 0, 0, 65, 0, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 16,
- 13, 65,168,208, 0, 0, 0, 59, 0, 0, 0, 4,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 77, 69,
- 0, 0, 1, 24, 13, 65,169, 16, 0, 0, 0, 52, 0, 0, 0, 1, 13, 65,176,112, 13, 65,161,176, 0, 0, 0, 0, 0, 0, 0, 0,
- 77, 69,112,114,101,118,105,101,119, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,170, 80, 13, 65,175,144,
- 13, 65,175,208, 0, 0, 0, 0, 13, 65,171,224, 13, 65,173,208, 0, 0, 0, 0, 13, 65,176, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,170,128, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,172,112,
- 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,174, 48, 0, 0, 0, 3, 0, 0, 0, 5,
- 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1,179,128, 0, 0, 52, 64, 0, 0, 28,192, 0, 0, 63,128, 0, 0, 63,128, 0, 2, 55, 39,197,172, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,170, 80, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 24, 32,
- 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,170,128, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,171,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 96, 13, 65,171,224, 0, 0, 0, 58, 0, 0, 0, 4, 63,128, 0, 0, 63,127,255,255, 39,251,255,255,
- 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0,168, 2, 0, 0, 0, 0, 0, 0,127,255, 3,255,
- 0, 0, 0, 0,191,128, 0, 1,191,127,255,253,167,251,255,253, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0,191,127,255,250,
- 63,128, 0, 3, 40, 2, 0, 3, 0, 0, 0, 0,127,255, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,172,112,
- 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,173,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 48, 13, 65,173,208,
- 0, 0, 0, 55, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 35,
- 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 44,
- 13, 65,174, 48, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,175,144, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,175,208, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,176, 48,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20,
- 13, 65,175,144, 0, 0, 0, 54, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2,
- 68, 65, 84, 65, 0, 0, 0, 44, 13, 65,175,208, 0, 0, 0, 65, 0, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0, 16, 13, 65,176, 48, 0, 0, 0, 59, 0, 0, 0, 4,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255, 0, 0, 77, 69, 0, 0, 1, 24, 13, 65,176,112, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, 0, 13, 65,169, 16,
- 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 65,177,176, 13, 65,183,176, 13, 65,184, 80, 0, 0, 0, 0, 13, 65,179, 64, 13, 65,181,144, 0, 0, 0, 0, 13, 65,185,128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,177,224, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,180, 48, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,182, 80,
- 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 51,128, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 4, 63,128, 0, 4,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 13, 65,177,176, 0, 0, 0, 0,
- 0, 0, 0, 1, 7,160, 8, 32, 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,177,224, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,179, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,192, 13, 65,179, 64, 0, 0, 0, 58, 0, 0, 0, 8, 63,128, 0, 0,
- 63,127,255,255,191,128, 0, 0, 73,230, 73,230,182, 26, 3,255, 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0,191,128, 0, 0,
- 73,230,182, 26,182, 26, 3,255, 0, 0, 0, 0,191,128, 0, 1,191,127,255,253,191,128, 0, 0,182, 26,182, 26,182, 26, 3,255,
- 0, 0, 0, 0,191,127,255,250, 63,128, 0, 3,191,128, 0, 0,182, 26, 73,230,182, 26, 3,255, 0, 0, 0, 0, 63,128, 0, 4,
- 63,127,255,247, 63,128, 0, 0, 73,230, 73,230, 73,230, 3,255, 0, 0, 0, 0, 63,127,255,245,191,128, 0, 5, 63,128, 0, 0,
- 73,230,182, 26, 73,230, 3,255, 0, 0, 0, 0,191,128, 0, 3,191,127,255,250, 63,128, 0, 0,182, 26,182, 26, 73,230, 3,255,
- 0, 0, 0, 0,191,127,255,255, 63,128, 0, 0, 63,128, 0, 0,182, 26, 73,230, 73,230, 3,255, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 1, 44, 13, 65,180, 48, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,181,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,
- 0, 0, 0,144, 13, 65,181,144, 0, 0, 0, 55, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35,
- 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0, 7,
- 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 0,
- 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 35,
- 68, 65, 84, 65, 0, 0, 1, 44, 13, 65,182, 80, 0, 0, 1, 35, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,183,176, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 13, 65,184, 80, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 13, 65,185,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 68, 65, 84, 65, 0, 0, 0,120, 13, 65,183,176, 0, 0, 0, 54, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2,
- 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, 0, 0,
- 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 2,
- 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0,
- 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 2, 68, 65, 84, 65, 0, 0, 1, 8, 13, 65,184, 80, 0, 0, 0, 65, 0, 0, 0, 6,
- 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 1, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 96, 13, 65,185,128, 0, 0, 0, 59, 0, 0, 0, 24,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 80, 65,
- 0, 0, 1,224, 7,161, 74, 32, 0, 0, 1, 41, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 65, 80, 83,121,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 18, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 4,
- 0, 6, 0, 8, 0, 5, 0, 5, 0, 3, 0,100, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 4, 0, 5, 0, 3, 0, 1,
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,128, 63,128, 0, 0, 61,204,204,205,
- 63, 76,204,205, 63,128, 0, 0, 66,200, 0, 0, 66, 72, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 10, 63,182, 41,128, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0,189, 35,214,240, 0, 0, 0, 0,189,196,155,184, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 62, 76,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 76,204,205,
- 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 63,128, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 63,128, 0, 0, 62, 76,204,205, 62,153,153,154,
- 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0,
- 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 78, 65, 49, 0, 0,166,136, 12,150,192, 32, 0, 0, 0, 0,
- 0, 0, 0, 1, 83, 68, 78, 65, 78, 65, 77, 69, 0, 0, 9, 22, 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116,
- 97, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, 0,122, 0,119, 0,120,109,105,110, 0,120,109, 97,120,
- 0,121,109,105,110, 0,121,109, 97,120, 0, 42,112,111,105,110,116,101,114, 0,103,114,111,117,112, 0,118, 97,108, 0,118, 97,
-108, 50, 0,110, 97,109,101, 91, 51, 50, 93, 0,116,121,112,101, 0,115,117, 98,116,121,112,101, 0,102,108, 97,103, 0,115, 97,
-118,101,100, 0,100, 97,116, 97, 0,108,101,110, 0,116,111,116, 97,108,108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105,
- 98, 0,110, 97,109,101, 91, 50, 52, 93, 0,117,115, 0,105, 99,111,110, 95,105,100, 0, 42,112,114,111,112,101,114,116,105,101,
-115, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102,105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48,
- 93, 0,102,105,108,101,110, 97,109,101, 91, 50, 52, 48, 93, 0,116,111,116, 0,112, 97,100, 0, 42,112, 97,114,101,110,116, 0,
-119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 91, 50, 93, 0,112, 97,100, 48, 0,112, 97,100, 49, 0, 42,
-114,101, 99,116, 91, 50, 93, 0, 42,111, 98, 0, 98,108,111, 99,107,116,121,112,101, 0, 97,100,114, 99,111,100,101, 0,110, 97,
-109,101, 91, 49, 50, 56, 93, 0, 42, 98,112, 0, 42, 98,101,122,116, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,
-118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120,116,114, 97,112, 0,114,116, 0, 98,105,
-116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0,115,108,105,100,101, 95,109, 97,120, 0, 99,117,114,118, 97,108,
- 0, 42,100,114,105,118,101,114, 0, 99,117,114,118,101, 0, 99,117,114, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,
-112,111, 0,112,111,115, 0,114,101,108, 97,116,105,118,101, 0,116,111,116,101,108,101,109, 0,112, 97,100, 50, 0, 42,119,101,
-105,103,104,116,115, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,108,105,100,101,
-114,109, 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,109,115,105,122,
-101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,114,112,104,
- 0, 42, 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,111,116,115, 99,
-114,105,112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0,108,105,110,101,110,111, 0,115,
-116, 97,114,116, 0,101,110,100, 0,102,108, 97,103,115, 0, 99,111,108,111,114, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0, 42,
-110, 97,109,101, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99,117,
-114, 99, 0,115,101,108, 99, 0,109, 97,114,107,101,114,115, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,
-111,115, 0,117,110,100,111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,109,116,105,109,101, 0,115,105,122,101,
- 0,115,101,101,107, 0,112, 97,115,115,101,112, 97,114,116, 97,108,112,104, 97, 0, 97,110,103,108,101, 0, 99,108,105,112,115,
-116, 97, 0, 99,108,105,112,101,110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,
-115,105,122,101, 0,115,104,105,102,116,120, 0,115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 89, 70,
- 95, 97,112,101,114,116,117,114,101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98,105, 97,115, 0,
- 89, 70, 95, 98,107,104,114,111,116, 0,115, 99,114,105,112,116,108,105,110,107, 0, 42,100,111,102, 95,111, 98, 0,102,114, 97,
-109,101,110,114, 0,102,114, 97,109,101,115, 0,111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0,
- 99,121, 99,108, 0,111,107, 0,109,117,108,116,105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,109,
-101,110,117,110,114, 0,105, 98,117,102,115, 0, 42,103,112,117,116,101,120,116,117,114,101, 0, 42, 97,110,105,109, 0, 42,114,
-114, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116,
- 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,
-111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0, 42,112,114,101,118,105,101,
-119, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101,100, 0, 97,110,105,109,115,112,101,101,100, 0,
-103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112,101, 0, 97,115,112,120, 0, 97,115,112,121, 0, 42,
-118,110,111,100,101, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101,110,100,
-116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,117,118,110, 97,109,101, 91, 51, 50, 93, 0,112,114,111,
-106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,
-122,101, 91, 51, 93, 0,116,101,120,102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,112,109, 97,112,116,111, 0,
-112,109, 97,112,116,111,110,101,103, 0,110,111,114,109, 97,112,115,112, 97, 99,101, 0,112, 97,100, 91, 51, 93, 0,114, 0,103,
- 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114,102, 97,
- 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0, 42,104, 97,110,
-100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114,115, 0,
- 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, 0, 40,
- 42,100,111,105,116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,110,105,116, 41, 40, 41, 0, 40, 42, 99, 97,
-108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0, 42,105,109, 97,
- 0, 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,109, 97,116, 91, 51, 93, 91, 51,
- 93, 0,115,116,121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114,101,115,
- 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110,111,105,115,101,115,105,122,101,
- 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,114,102, 97, 99, 0,103,102, 97,
- 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97,
-114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105,
-110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0,
-118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115,
-116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121,
-112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97,
-103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111,
-112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120,116,101,110,100, 0, 99,104,101,
- 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0, 42,112,108,117,103,105,110, 0, 42, 99,111,
- 98, 97, 0, 42,101,110,118, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,
-109,105,110, 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0,112, 97,100, 51, 0,109,111,100,101, 0,116,111,116,101,120, 0,115,104,
-100,119,114, 0,115,104,100,119,103, 0,115,104,100,119, 98, 0,115,104,100,119,112, 97,100, 0,101,110,101,114,103,121, 0,100,
-105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110,116, 0, 97,116,116,
- 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,102,102, 0,102, 97,108,108,111,102,102, 95,116,121,112,101, 0,
-115,104, 97,100,115,112,111,116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 98,117,102,115,105,122,101, 0,115,
- 97,109,112, 0, 98,117,102,102,101,114,115, 0,102,105,108,116,101,114,116,121,112,101, 0, 98,117,102,102,108, 97,103, 0, 98,
-117,102,116,121,112,101, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109,112,121, 0,114, 97,121, 95,115, 97,
-109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95,115,104, 97,112,101, 0, 97,114,101,
- 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95,115,105,122,101,122, 0, 97,100, 97,
-112,116, 95,116,104,114,101,115,104, 0,114, 97,121, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0,116,101,120, 97, 99,116,
- 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0,115,117,110, 95,101,102,102,101, 99,116, 95,116,121,112,101, 0,115,107,
-121, 98,108,101,110,100,116,121,112,101, 0,104,111,114,105,122,111,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,112,
-114,101, 97,100, 0,115,117,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,117,110, 95,115,105,122,101, 0, 98, 97, 99,
-107,115, 99, 97,116,116,101,114,101,100, 95,108,105,103,104,116, 0,115,117,110, 95,105,110,116,101,110,115,105,116,121, 0, 97,
-116,109, 95,116,117,114, 98,105,100,105,116,121, 0, 97,116,109, 95,105,110,115, 99, 97,116,116,101,114,105,110,103, 95,102, 97,
- 99,116,111,114, 0, 97,116,109, 95,101,120,116,105,110, 99,116,105,111,110, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,100,
-105,115,116, 97,110, 99,101, 95,102, 97, 99,116,111,114, 0,115,107,121, 98,108,101,110,100,102, 97, 99, 0, 89, 70, 95,110,117,
-109,112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116,104,
- 0, 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, 95,
- 99, 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119,105,
-110,116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,103,108,111,119,116,121,112,101, 0, 89, 70, 95,112, 97,100,
- 50, 0, 42,109,116,101,120, 91, 49, 56, 93, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,115,112,101, 99, 98, 0,109,105,
-114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,
-101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,114,111,114, 0, 97,108,112,104,
- 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,110,115,108,117, 99,101,110, 99,
-121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,114, 95,105, 0,102,114,101,115,
-110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,108,116,101,114, 0,116,120, 95,
-108,105,109,105,116, 0,116,120, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,
-101,112,116,104, 95,116,114, 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,103,108,111,115,115, 95,109,
-105,114, 0,103,108,111,115,115, 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,109,105,114, 0,115, 97,109,112,
- 95,103,108,111,115,115, 95,116,114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,109,105,114, 0, 97,100, 97,112,
-116, 95,116,104,114,101,115,104, 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115, 95,109,105,114, 0,100,105,115,
-116, 95,109,105,114, 0,102, 97,100,101,116,111, 95,109,105,114, 0,115,104, 97,100,101, 95,102,108, 97,103, 0,109,111,100,101,
- 95,108, 0,102,108, 97,114,101, 99, 0,115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,
-122,101, 0,102,108, 97,114,101,115,105,122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,
-115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,
-101, 0,115,116,114, 97,110,100, 95,115,117,114,102,110,111,114, 0,115,116,114, 97,110,100, 95,109,105,110, 0,115,116,114, 97,
-110,100, 95,119,105,100,116,104,102, 97,100,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,109,101, 91, 51, 50, 93, 0,115,
- 98,105, 97,115, 0,108, 98,105, 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,115,101,112,116,101,120, 0,114,103, 98,
-115,101,108, 0,112,114, 95,116,121,112,101, 0,117,115,101, 95,110,111,100,101,115, 0,112,114, 95, 98, 97, 99,107, 0,112,114,
- 95,108, 97,109,112, 0,112, 97,100, 52, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,
-112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,
-109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,
-112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,
-109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,
-115,104,111,119, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0, 42,110,
-111,100,101,116,114,101,101, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,102,104, 0,114,101,102,108,101,
- 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101, 0,115,115,115, 95,114,
- 97,100,105,117,115, 91, 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,114,111,114, 0,115,115,
-115, 95,115, 99, 97,108,101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99, 0,115,115,115, 95,116,
-101,120,102, 97, 99, 0,115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,115,115, 95,102,108, 97,
-103, 0,115,115,115, 95,112,114,101,115,101,116, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89,
- 70, 95,100,115, 99, 97,108,101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,
-101,116, 0, 89, 70, 95,100,106,105,116, 0,103,112,117,109, 97,116,101,114,105, 97,108, 0,110, 97,109,101, 91, 50, 53, 54, 93,
- 0,115, 99, 97,108,101, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49, 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108,
- 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,
-120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,
-100,105,115,112, 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,
-114,115,105,122,101, 0,116,104,114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,
-104,116, 0,114, 97,100,105,117,115, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101,
- 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,
-101,115,111,108,118, 0,111,114,100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0,
- 42,107,110,111,116,115,117, 0, 42,107,110,111,116,115,118, 0,116,105,108,116, 95,105,110,116,101,114,112, 0, 99,104, 97,114,
-105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,
-106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, 97,
-116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,114,
-101,115,111,108,117, 95,114,101,110, 0,114,101,115,111,108,118, 95,114,101,110, 0,115,112, 97, 99,101,109,111,100,101, 0,115,
-112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,
-115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,
-101,119,105,100,116,104, 0, 42,115,116,114, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,
-102,111,110,116, 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,
-111,116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100,
- 0, 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0,
- 42,109,116,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,
-101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,109,
-115,101,108,101, 99,116, 0,118,100, 97,116, 97, 0,101,100, 97,116, 97, 0,102,100, 97,116, 97, 0,116,111,116,101,100,103,101,
- 0,116,111,116,102, 97, 99,101, 0,116,111,116,115,101,108,101, 99,116, 0, 97, 99,116, 95,102, 97, 99,101, 0, 99,117, 98,101,
-109, 97,112,115,105,122,101, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,
-114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0, 42,109,114, 0, 42,112,118, 0, 42,116,112, 97,103,101, 0,117,118, 91,
- 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0,
-118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0, 98,119,101,105,103,104,
-116, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91,
- 51, 93, 0,117,118, 91, 50, 93, 0, 99,111, 91, 50, 93, 0,105,110,100,101,120, 0,102, 0,105, 0,115, 91, 50, 53, 54, 93, 0,
-118, 91, 52, 93, 0,109,105,100, 0,112, 97,100, 91, 50, 93, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,
-102, 97, 99,101,115, 0, 42,101,100,103,101,115, 0, 42,101,100,103,101, 95, 98,111,117,110,100, 97,114,121, 95,115,116, 97,116,
-101,115, 0, 42,118,101,114,116, 95,101,100,103,101, 95,109, 97,112, 0, 42,118,101,114,116, 95,102, 97, 99,101, 95,109, 97,112,
- 0, 42,109, 97,112, 95,109,101,109, 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,111,
-117,110,116, 0, 99,117,114,114,101,110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,118,
-108, 0,114,101,110,100,101,114,108,118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115, 0,
- 42,101,100,103,101, 95, 99,114,101, 97,115,101,115, 0, 42,118,101,114,116, 95,109, 97,112, 0, 42,101,100,103,101, 95,109, 97,
-112, 0, 42,111,108,100, 95,102, 97, 99,101,115, 0, 42,111,108,100, 95,101,100,103,101,115, 0, 42,101,114,114,111,114, 0,109,
-111,100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0,
- 42,101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54, 93, 0,
-108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 42,115,116, 97,114,116, 95, 99, 97,112,
- 0, 42,101,110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,102,102,115,101,116, 95,111, 98, 0,111,
-102,102,115,101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,101, 95,100,105,115,116, 0,102,105,116,
- 95,116,121,112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110,116, 0, 97,120,105,115, 0,116,111,108,
-101,114, 97,110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105,116, 95, 97,110,103,108,101, 0,118, 97,
-108,117,101, 0,114,101,115, 0,118, 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,102,108, 97,103,115, 0,101, 95,102,108,
- 97,103,115, 0, 98,101,118,101,108, 95, 97,110,103,108,101, 0,100,101,102,103,114,112, 95,110, 97,109,101, 91, 51, 50, 93, 0,
- 42,116,101,120,116,117,114,101, 0,115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116,105,111,110, 0,109,105,100,108,
-101,118,101,108, 0,116,101,120,109, 97,112,112,105,110,103, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,118,108, 97,
-121,101,114, 95,110, 97,109,101, 91, 51, 50, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0, 42,112,114,111,106,101, 99,
-116,111,114,115, 91, 49, 48, 93, 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,115, 0, 97,
-115,112,101, 99,116,120, 0, 97,115,112,101, 99,116,121, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116,
- 0,102, 97, 99, 0,114,101,112,101, 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,110,116,101,114, 0,115,116, 97,114,116,120,
- 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112,
- 0,102, 97,108,108,111,102,102, 0,116,105,109,101,111,102,102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,
-109,102,108, 97,103, 0,109,117,108,116,105, 0, 42,112,114,101,118, 67,111,115, 0,112, 97,114,101,110,116,105,110,118, 91, 52,
- 93, 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,
-111,114, 99,101, 0, 42, 99,108,111,116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97,114,109,115, 0, 42, 99,111,
-108,108, 95,112, 97,114,109,115, 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0, 42,120, 0, 42,120,110,101,119, 0, 42,
-120,111,108,100, 0, 42, 99,117,114,114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,101,110,116, 95,120, 0, 42, 99,
-117,114,114,101,110,116, 95,118, 0, 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,115, 0,110,117,109,102, 97, 99,
-101,115, 0, 97, 98,115,111,114,112,116,105,111,110, 0,116,105,109,101, 0, 42, 98,118,104,116,114,101,101, 0,111,112,101,114,
- 97,116,105,111,110, 0,118,101,114,116,101,120, 0,116,111,116,105,110,102,108,117,101,110, 99,101, 0,103,114,105,100,115,105,
-122,101, 0,110,101,101,100, 98,105,110,100, 0, 42, 98,105,110,100,119,101,105,103,104,116,115, 0, 42, 98,105,110,100, 99,111,
-115, 0,116,111,116, 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105,100, 0, 42,100,121,110,105,110,102,108,117,
-101,110, 99,101,115, 0, 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, 0,100,121,110,103,114,105,100,115,105,122,
-101, 0,100,121,110, 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101,108,108,119,105,100,116,104, 0, 98,105,110,
-100,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,112,115,121,115, 0, 42,100,109, 0,116,111,116,100,109,118,101,114,116, 0,116,
-111,116,100,109,101,100,103,101, 0,116,111,116,100,109,102, 97, 99,101, 0,112,115,121,115, 0,114,116, 91, 50, 93, 0, 42,102,
- 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101, 99,116, 0, 42,116, 97,114,103,101,116, 0, 42, 97,117,
-120, 84, 97,114,103,101,116, 0,118,103,114,111,117,112, 95,110, 97,109,101, 91, 51, 50, 93, 0,107,101,101,112, 68,105,115,116,
- 0,115,104,114,105,110,107, 84,121,112,101, 0,115,104,114,105,110,107, 79,112,116,115, 0,112,114,111,106, 65,120,105,115, 0,
-115,117, 98,115,117,114,102, 76,101,118,101,108,115, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,
-118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118,
- 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101,102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,112, 97,114,116,
-121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 51, 50, 93,
- 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42,112,114,111,120,121, 95,103,114,111,117,112, 0, 42,112,114,111,
-120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, 42,112,111,115,101,108,105, 98, 0, 42,112,111,115,101, 0, 99,
-111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,
-101,114,115, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,114,111,
-116, 91, 51, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,
-108, 97,121, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,116,114,
- 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108,
- 97,103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0, 98,111,117,
-110,100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,
-100, 0,115,102, 0, 99,116,105,109,101, 0,109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,
-102,111,114,109,102, 97, 99,116,111,114, 0,114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, 0,109, 97,114,103,
-105,110, 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,101,109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,
-112, 97,100, 49, 91, 51, 93, 0,101,109,112,116,121, 95,100,114, 97,119,115,105,122,101, 0,100,117,112,102, 97, 99,101,115, 99,
- 97, 0,112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,
-116,111,114,115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103,
- 97,109,101,102,108, 97,103, 50, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99, 70,114,105,
- 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112,115, 0,104,
-111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,101,109, 0, 42,112,100, 0, 42,115,111,102,116, 0, 42,100,
-117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,114,101,115,116,114,105, 99,116,102,108,
- 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103, 0,114,101, 99, 97,108, 99,111, 0, 98,111,100,
-121, 95,116,121,112,101, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100,101,114,105,118,101,
-100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108, 97,115,116, 68, 97,116, 97, 77, 97,
-115,107, 0,115,116, 97,116,101, 0,105,110,105,116, 95,115,116, 97,116,101, 0,103,112,117,108, 97,109,112, 0, 99,117,114,105,
-110,100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,112,
-100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,112,100,
-101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,114,105, 99,116, 0,102, 95,115,116,114,101,110,103,116,104, 0,
-102, 95,112,111,119,101,114, 0,102, 95,100,105,115,116, 0,102, 95,100, 97,109,112, 0,109, 97,120,100,105,115,116, 0,109,105,
-110,100,105,115,116, 0,109, 97,120,114, 97,100, 0,109,105,110,114, 97,100, 0,102, 95,112,111,119,101,114, 95,114, 0,112,100,
-101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0,
- 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0,107,105,110,107, 95,102,114,101,113, 0,107,105,
-110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114,101,101, 95,101,110,100, 0,116,101,120, 95,110,
- 97, 98,108, 97, 0,116,101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107,105,110,107, 95, 97,120,105,115, 0,114,116, 50,
- 0, 42,114,110,103, 0,102, 95,110,111,105,115,101, 0,115,105,109,102,114, 97,109,101, 0,115,116, 97,114,116,102,114, 97,109,
-101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114, 97,109,101, 0, 42,112, 97,114,116,105, 99,108,101,115, 0,
-116,111,116,112,111,105,110,116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,
-105,110,103, 0,110,111,100,101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,
-105,109,105,116, 0,112,104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111,
- 97,108,102,114,105, 99,116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,
-118,101,114,116,103,114,111,117,112, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103, 0,105,110,102,
-114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,118,101,114,102,
-108, 97,103,115, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,110,100,115,112,
-114,105,110,103, 0, 99,111,108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,105,102,102, 0,
-115, 98, 99, 95,109,111,100,101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, 97,120,108,111,
-111,112,115, 0, 99,104,111,107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0,115,112,114,105,
-110,103,112,114,101,108,111, 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102,102, 0,105,110,
-112,117,115,104, 0, 42,112,111,105,110,116, 99, 97, 99,104,101, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,101,100,111,112,
-116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,101,115,120,121,
-122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,110,100,101,114,
- 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,105,115, 99,111,
-115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,114, 97,118,120,
- 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,100, 0,103,
-115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,121, 0,105,
-110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, 0, 42,109,101,
-115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97,114,116, 91, 51,
- 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, 78,111,118,101,
- 99,103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, 86, 97,108,117,
-101, 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97,114,116,105, 99,
-108,101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, 83,117, 98,100,
-105,118,115, 0,117,110,117,115,101,100, 68, 78, 65, 68,117,109,109,121, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 83,105,
-122,101, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,105,122,101,
- 0, 42,109,101,115,104, 83,117,114,102, 78,111,114,109, 97,108,115, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,
-111,114,103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,
-107, 0, 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,
-101, 0,108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121,
- 66,111,120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,
-109,105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,
-114,114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116,
- 97,114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,
-100,111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,
-115,116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,
-111,100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 97,111, 95, 97,100, 97,112,
-116, 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115,112,101,101,100, 95,102, 97, 99, 0, 97,111, 95, 97,
-112,112,114,111,120, 95,101,114,114,111,114, 0, 97,111, 95, 97,112,112,114,111,120, 95, 99,111,114,114,101, 99,116,105,111,110,
- 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, 97,111, 95,103, 97,116,104,101,114, 95,109,101,116,104,111,100,
- 0, 97,111, 95, 97,112,112,114,111,120, 95,112, 97,115,115,101,115, 0, 42, 97,111,115,112,104,101,114,101, 0, 42, 97,111,116,
- 97, 98,108,101,115, 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116,121,112,101, 0,115,
-117, 98,115,104,111,111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0,109, 97,120,115,117,
- 98,108, 97,109,112, 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, 97,120,110,111,100,
-101, 0, 99,111,110,118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0,115,101,108, 99,111,
-108, 0,115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,
-109, 97,116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,
-119, 75,101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115,
- 80,101,114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,
-101,114,121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,
-112, 97,100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 99,111,100,101,
- 99, 0, 97,117,100,105,111, 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, 0, 97,117,100,105,
-111, 95, 98,105,116,114, 97,116,101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105,110, 95,114, 97,116,101, 0,114,
- 99, 95,109, 97,120, 95,114, 97,116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122,101, 0,109,117,120, 95,112, 97,
- 99,107,101,116, 95,115,105,122,101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97,116,101, 0,109, 97,105,110, 0,
- 42,109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105,100,101, 0,108, 97,
-121, 95,122,109, 97,115,107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97,115,115, 95,120,111,
-114, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, 97, 0,102,102, 99,
-111,100,101, 99,100, 97,116, 97, 0, 99,102,114, 97, 0,112,115,102,114, 97, 0,112,101,102,114, 97, 0,105,109, 97,103,101,115,
- 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,101,110, 0, 98,108,117,114,102,
- 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,108,115, 99,114,101,101,110, 0,
-120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,114,105, 98, 0,114,116, 49, 0,
-115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115,112,114,101,115,101,116, 0,109, 97,120,105,
-109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,115, 0,119,105,
-110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112,101, 0,115,117, 98,105,109,116,121,112,101, 0,113,117, 97,
-108,105,116,121, 0,114,112, 97,100, 0,114,112, 97,100, 49, 0,114,112, 97,100, 50, 0,115, 99,101,109,111,100,101, 0,114,101,
-110,100,101,114,101,114, 0,111, 99,114,101,115, 0, 97,108,112,104, 97,109,111,100,101, 0,111,115, 97, 0,102,114,115, 95,115,
-101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,100,105,115,112,114,101, 99,
-116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,120, 97,115,112, 0,121, 97,115,112, 0,102,114,115, 95,115,101,
- 99, 95, 98, 97,115,101, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0,112,111,115,116,103, 97,109,109, 97, 0,112,
-111,115,116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0,
- 98, 97,107,101, 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, 0, 98, 97,107,101, 95,109,111,100,101, 0, 98,
- 97,107,101, 95,102,108, 97,103, 0, 98, 97,107,101, 95,110,111,114,109, 97,108, 95,115,112, 97, 99,101, 0, 98, 97,107,101, 95,
-113,117, 97,100, 95,115,112,108,105,116, 0, 98, 97,107,101, 95,109, 97,120,100,105,115,116, 0, 98, 97,107,101, 95, 98,105, 97,
-115,100,105,115,116, 0, 98, 97,107,101, 95,112, 97,100, 0, 71, 73,113,117, 97,108,105,116,121, 0, 71, 73, 99, 97, 99,104,101,
- 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110,115, 0, 71, 73,100,105,114,101, 99,116, 0, 89, 70, 95,
- 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95,110,111, 98,117,109,112, 0, 89, 70, 95, 99,108, 97,109,
-112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, 71, 73, 99, 97,117,115,100,101,112,116,104, 0,
- 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, 71, 73,112,104,111,116,111,110, 99,111,117,110,116, 0,
- 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111,116,111,110,114, 97,100,105,117,115, 0, 89, 70, 95,114,
- 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108,101,115,
- 0,121,102,112, 97,100, 50, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108,105,116,121, 0, 71, 73,114,101,102,105,110,101,
-109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114,112,111,119,101,114, 0, 89, 70, 95,103, 97,109,
-109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,
-105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111,108,100, 0, 98, 97, 99,107, 98,117,102, 91,
- 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, 0,115,116, 97,109,112, 0,115,116, 97,109,112, 95,102,111,110,116, 95,105,
-100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 49, 54, 48, 93, 0,102,103, 95,115,116, 97,109,112, 91, 52, 93, 0, 98,
-103, 95,115,116, 97,109,112, 91, 52, 93, 0,115,105,109,112,108,105,102,121, 95,115,117, 98,115,117,114,102, 0,115,105,109,112,
-108,105,102,121, 95,115,104, 97,100,111,119,115, 97,109,112,108,101,115, 0,115,105,109,112,108,105,102,121, 95,112, 97,114,116,
-105, 99,108,101,115, 0,115,105,109,112,108,105,102,121, 95, 97,111,115,115,115, 0, 99,105,110,101,111,110,119,104,105,116,101,
- 0, 99,105,110,101,111,110, 98,108, 97, 99,107, 0, 99,105,110,101,111,110,103, 97,109,109, 97, 0,112, 97,114,116,105, 99,108,
-101, 95,112,101,114, 99, 0,115,117, 98,115,117,114,102, 95,109, 97,120, 0,115,104, 97,100, 98,117,102,115, 97,109,112,108,101,
- 95,109, 97,120, 0, 97,111, 95,101,114,114,111,114, 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97,109,101, 91,
- 54, 52, 93, 0, 42, 98,114,117,115,104, 0,116,111,111,108, 0,115,116,101,112, 0,105,110,118,101,114,116, 0,116,111,116,114,
-101,107,101,121, 0,116,111,116, 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112,101, 0, 98,114,117,115,104, 91, 55,
- 93, 0,101,109,105,116,116,101,114,100,105,115,116, 0,100,114, 97,119, 95,116,105,109,101,100, 0,110, 97,109,101, 91, 51, 54,
- 93, 0,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108,
- 97,103, 0,106,111,105,110,116,114,105,108,105,109,105,116, 0,100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, 95,111,
-102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,
-116,105, 99,101,115, 0,117,110,119,114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118,
- 99, 97,108, 99, 95, 99,117, 98,101,115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,112,100,105,114, 0,117,118, 99, 97,
-108, 99, 95,109, 97,112, 97,108,105,103,110, 0,117,118, 99, 97,108, 99, 95,102,108, 97,103, 0, 97,117,116,111,105,107, 95, 99,
-104, 97,105,110,108,101,110, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,108,101, 0,115,101,108,101, 99,116,
- 95,116,104,114,101,115,104, 0, 99,108,101, 97,110, 95,116,104,114,101,115,104, 0,114,101,116,111,112,111, 95,109,111,100,101,
- 0,114,101,116,111,112,111, 95,112, 97,105,110,116, 95,116,111,111,108, 0,108,105,110,101, 95,100,105,118, 0,101,108,108,105,
-112,115,101, 95,100,105,118, 0,114,101,116,111,112,111, 95,104,111,116,115,112,111,116, 0,109,117,108,116,105,114,101,115, 95,
-115,117, 98,100,105,118, 95,116,121,112,101, 0,115,107,103,101,110, 95,114,101,115,111,108,117,116,105,111,110, 0,115,107,103,
-101,110, 95,116,104,114,101,115,104,111,108,100, 95,105,110,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,116,104,114,101,
-115,104,111,108,100, 95,101,120,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,114, 97,116,105,
-111, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 97,110,103,108,101,
- 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 99,111,114,114,101,108, 97,116,105,111,110, 95,108,105,109,105,116, 0,115,
-107,103,101,110, 95,115,121,109,109,101,116,114,121, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,111,112,116,105,111,110,
-115, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 95,112, 97,
-115,115,101,115, 0,115,107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110,115, 91, 51, 93, 0,101,100,103,101, 95,
-109,111,100,101, 0,112, 97,100, 51, 91, 52, 93, 0,100,105,114, 0,118,105,101,119, 0, 42,115,101,115,115,105,111,110, 0, 42,
- 99,117,109, 97,112, 0,100,114, 97,119, 98,114,117,115,104, 0,115,109,111,111,116,104, 98,114,117,115,104, 0,112,105,110, 99,
-104, 98,114,117,115,104, 0,105,110,102,108, 97,116,101, 98,114,117,115,104, 0,103,114, 97, 98, 98,114,117,115,104, 0,108, 97,
-121,101,114, 98,114,117,115,104, 0,102,108, 97,116,116,101,110, 98,114,117,115,104, 0,112,105,118,111,116, 91, 51, 93, 0, 98,
-114,117,115,104, 95,116,121,112,101, 0,116,101,120,110,114, 0,116,101,120,114,101,112,116, 0,116,101,120,102, 97,100,101, 0,
-116,101,120,115,101,112, 0, 97,118,101,114, 97,103,105,110,103, 0,116, 97, 98,108,101,116, 95,115,105,122,101, 0,116, 97, 98,
-108,101,116, 95,115,116,114,101,110,103,116,104, 0,115,121,109,109, 0,114, 97,107,101, 0, 97,120,105,115,108,111, 99,107, 0,
- 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116,
- 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,
-109, 97,120, 91, 51, 93, 0,101,100,105,116, 98,117,116,115,105,122,101, 0,115,101,108,101, 99,116,109,111,100,101, 0,112,114,
-111,112,111,114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0, 97,117,116,111,109,101,114,103,101, 0,112,
- 97,100, 53, 0,112, 97,100, 54, 0,112, 97,100, 55, 0, 42,101,100, 0, 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103,
- 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 97,117,100,105,111, 0,116,114, 97,110,115,102,111,114,109, 95,115,
-112, 97, 99,101,115, 0,106,117,109,112,102,114, 97,109,101, 0,115,110, 97,112, 95,109,111,100,101, 0,115,110, 97,112, 95,102,
-108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,101,116, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97,108,
-105,100, 0,100, 97,103,102,108, 97,103,115, 0,115, 99,117,108,112,116,100, 97,116, 97, 0,102,114, 97,109,101, 95,115,116,101,
-112, 0,122,111,111,109, 0, 98,108,101,110,100, 0,120,105,109, 0,121,105,109, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,
-108,111, 99,107,115, 99, 97,108,101, 0, 42, 97,114,101, 97, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,
-118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,
-109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49, 91,
- 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93,
- 0,122,102, 97, 99, 0,108, 97,121, 95,117,115,101,100, 0,112,101,114,115,112, 0, 42,111, 98, 95, 99,101,110,116,114,101, 0,
- 42, 98,103,112,105, 99, 0, 42,108,111, 99, 97,108,118,100, 0, 42,114,105, 0, 42,114,101,116,111,112,111, 95,118,105,101,119,
- 95,100, 97,116, 97, 0, 42,100,101,112,116,104,115, 0,111, 98, 95, 99,101,110,116,114,101, 95, 98,111,110,101, 91, 51, 50, 93,
- 0,108,111, 99, 97,108,118,105,101,119, 0,108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,
-110,100, 0, 99, 97,109,122,111,111,109, 0,112,105,118,111,116, 95,108, 97,115,116, 0,103,114,105,100, 0,103,114,105,100,118,
-105,101,119, 0,112,105,120,115,105,122,101, 0,110,101, 97,114, 0,102, 97,114, 0, 99, 97,109,100,120, 0, 99, 97,109,100,121,
- 0,103,114,105,100,108,105,110,101,115, 0,118,105,101,119, 98,117,116, 0,103,114,105,100,102,108, 97,103, 0,109,111,100,101,
-115,101,108,101, 99,116, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97,103, 0,116,119,100,114,
- 97,119,102,108, 97,103, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108,105,112, 91, 52, 93, 91, 52, 93, 0, 42, 99,
-108,105,112, 98, 98, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0,102,108, 97,103, 50, 0,
-103,114,105,100,115,117, 98,100,105,118, 0,110,100,111,102,109,111,100,101, 0,110,100,111,102,102,105,108,116,101,114, 0, 42,
-112,114,111,112,101,114,116,105,101,115, 95,115,116,111,114, 97,103,101, 0, 42,103,112,100, 0,118,101,114,116, 0,104,111,114,
- 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,122,111,111,109, 0,109, 97,120,122,
-111,111,109, 0,115, 99,114,111,108,108, 0,107,101,101,112,116,111,116, 0,107,101,101,112, 97,115,112,101, 99,116, 0,107,101,
-101,112,122,111,111,109, 0,111,108,100,119,105,110,120, 0,111,108,100,119,105,110,121, 0, 99,117,114,115,111,114, 91, 50, 93,
- 0,114,111,119, 98,117,116, 0,118, 50,100, 0, 42,101,100,105,116,105,112,111, 0,105,112,111,107,101,121, 0, 97, 99,116,110,
- 97,109,101, 91, 51, 50, 93, 0, 99,111,110,115,116,110, 97,109,101, 91, 51, 50, 93, 0, 98,111,110,101,110, 97,109,101, 91, 51,
- 50, 93, 0,116,111,116,105,112,111, 0,112,105,110, 0, 98,117,116,111,102,115, 0, 99,104, 97,110,110,101,108, 0,108,111, 99,
-107, 0,109,101,100,105, 97,110, 91, 51, 93, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0, 97,108,105,103,110,
- 0,116, 97, 98,111, 0,109, 97,105,110, 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120,
-102,114,111,109, 0,115,104,111,119,103,114,111,117,112, 0,109,111,100,101,108,116,121,112,101, 0,115, 99,114,105,112,116, 98,
-108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115, 0,116, 97, 98, 91, 55, 93,
- 0, 99,104, 97,110,115,104,111,119,110, 0,122,101, 98,114, 97, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,
-108,101, 0,116,105,116,108,101, 91, 50, 52, 93, 0,100,105,114, 91, 50, 52, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,
-102,115, 0,115,111,114,116, 0,109, 97,120,110, 97,109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0,102, 95,102,112, 0,
-102,112, 95,115,116,114, 91, 56, 93, 0, 42,108,105, 98,102,105,108,101,100, 97,116, 97, 0,114,101,116,118, 97,108, 0,109,101,
-110,117, 0, 97, 99,116, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,
-117,110, 99, 95,101,118,101,110,116, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95, 97,114,103,115, 41, 40,
- 41, 0, 42, 97,114,103, 49, 0, 42, 97,114,103, 50, 0, 42,109,101,110,117,112, 0, 42,112,117,112,109,101,110,117, 0,111,111,
-112,115, 0,118,105,115,105,102,108, 97,103, 0,116,114,101,101, 0, 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97,114,
- 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93, 0,115,101, 97,114, 99,104, 95,116,115,101, 0,115,101, 97,114, 99,104, 95,
-102,108, 97,103,115, 0,100,111, 95, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,
-101,112,115, 95,102,108, 97,103,115, 0,105,109, 97,110,114, 0, 99,117,114,116,105,108,101, 0,105,109,116,121,112,101,110,114,
- 0,100,116, 95,117,118, 0,115,116,105, 99,107,121, 0,100,116, 95,117,118,115,116,114,101,116, 99,104, 0,112, 97,100, 91, 53,
- 93, 0, 99,101,110,116,120, 0, 99,101,110,116,121, 0, 97,117,116,111,115,110, 97,112, 0, 42,116,101,120,116, 0,116,111,112,
- 0,118,105,101,119,108,105,110,101,115, 0,102,111,110,116, 95,105,100, 0,108,104,101,105,103,104,116, 0,108,101,102,116, 0,
-115,104,111,119,108,105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0, 99,117,114,114,116, 97, 98, 95,115,101,
-116, 0,115,104,111,119,115,121,110,116, 97,120, 0,111,118,101,114,119,114,105,116,101, 0,112,105,120, 95,112,101,114, 95,108,
-105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, 97,114, 0,119,111,114,100,119,114, 97,112, 0,100,111,
-112,108,117,103,105,110,115, 0, 42,112,121, 95,100,114, 97,119, 0, 42,112,121, 95,101,118,101,110,116, 0, 42,112,121, 95, 98,
-117,116,116,111,110, 0, 42,112,121, 95, 98,114,111,119,115,101,114, 99, 97,108,108, 98, 97, 99,107, 0, 42,112,121, 95,103,108,
-111, 98, 97,108,100,105, 99,116, 0,108, 97,115,116,115,112, 97, 99,101, 0,115, 99,114,105,112,116,110, 97,109,101, 91, 50, 53,
- 54, 93, 0,115, 99,114,105,112,116, 97,114,103, 91, 50, 53, 54, 93, 0, 42,115, 99,114,105,112,116, 0, 42, 98,117,116, 95,114,
-101,102,115, 0,114,101,100,114, 97,119,115, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0, 42, 99,117,114,102,111,110,116, 0,
- 42,101,100,105,116,116,114,101,101, 0,116,114,101,101,116,121,112,101, 0, 42,102,105,108,101,115, 0, 97, 99,116,105,118,101,
- 95,102,105,108,101, 0,110,117,109,116,105,108,101,115,120, 0,110,117,109,116,105,108,101,115,121, 0,115,101,108,115,116, 97,
-116,101, 0,118,105,101,119,114,101, 99,116, 0, 98,111,111,107,109, 97,114,107,114,101, 99,116, 0,115, 99,114,111,108,108,112,
-111,115, 0,115, 99,114,111,108,108,104,101,105,103,104,116, 0,115, 99,114,111,108,108, 97,114,101, 97, 0, 97, 99,116,105,118,
-101, 95, 98,111,111,107,109, 97,114,107, 0,112,114,118, 95,119, 0,112,114,118, 95,104, 0, 42,105,109,103, 0,111,117,116,108,
-105,110,101, 91, 52, 93, 0,110,101,117,116,114, 97,108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101,116,116,
-105,110,103, 91, 52, 93, 0,115,101,116,116,105,110,103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93, 0,110,
-117,109, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104,105, 91,
- 52, 93, 0,112,111,112,117,112, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93, 0,109,
-101,110,117, 95, 98, 97, 99,107, 91, 52, 93, 0,109,101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95,104,105,
-108,105,116,101, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 95,104,
-105, 91, 52, 93, 0, 98,117,116, 95,100,114, 97,119,116,121,112,101, 0,105, 99,111,110,102,105,108,101, 91, 56, 48, 93, 0, 98,
- 97, 99,107, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,101, 49,
- 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,
-119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101,
- 91, 52, 93, 0,103,114,111,117,112, 91, 52, 93, 0,103,114,111,117,112, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,
-110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,101,108,101, 99,
-116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101,
- 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,115,104, 97,114,112, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,
-115,101,108, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97,
- 99,101, 95,100,111,116, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52,
- 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,
-108,101, 99,116, 91, 52, 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,105,122,101, 0,102, 97,
- 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,
-110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,
-121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, 93, 0,105,109, 97,103,101, 91, 52, 93, 0,115, 99,101,110,
-101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99,116, 91, 52, 93, 0,112,108,117,103,105,110, 91, 52,
- 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, 97, 91, 52, 93, 0,101,100,105,116,109,101,115,104,
- 95, 97, 99,116,105,118,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 91, 52, 93, 0,104, 97,110,100,
-108,101, 95,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,
-120, 95,115,105,122,101, 0,104,112, 97,100, 91, 55, 93, 0,115,111,108,105,100, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,
-115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116,115,110,100, 0,116, 97, 99,
-116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97,115,101,108, 0,116,101,120,116, 0,116,111,
-111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116, 97,114,109, 91, 50, 48, 93, 0, 98,112, 97,100, 91, 52, 93,
- 0, 98,112, 97,100, 49, 91, 52, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,
-109,101, 0,116,101,109,112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,
-100,101,114,100,105,114, 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,
-120,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,
-100,105,114, 91, 49, 54, 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,
-105,114, 91, 49, 54, 48, 93, 0,118,101,114,115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103, 97,109,101,102,108,
- 97,103,115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117,
- 97,103,101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,108,101, 95, 98,117,
-102,102,101,114, 0, 99,111,110,115,111,108,101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101, 0,102,111,110,116,
-115,105,122,101, 0,101,110, 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,
-115,104,111,108,100, 49, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110, 97,109,101, 91, 50,
- 53, 54, 93, 0,116,104,101,109,101,115, 0,117,110,100,111,115,116,101,112,115, 0,117,110,100,111,109,101,109,111,114,121, 0,
-103,112, 95,109, 97,110,104, 97,116,116,101,110,100,105,115,116, 0,103,112, 95,101,117, 99,108,105,100,101, 97,110,100,105,115,
-116, 0, 99,117,114,115,115,105,122,101, 0,116, 98, 95,108,101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,
-109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,
-103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,
-117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,116,101, 0,109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,
-112,114,101,102,101,116, 99,104,102,114, 97,109,101,115, 0,102,114, 97,109,101,115,101,114,118,101,114,112,111,114,116, 0,112,
- 97,100, 95,114,111,116, 95, 97,110,103,108,101, 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,
-101, 0,114,118,105, 98,114,105,103,104,116, 0,114,101, 99,101,110,116, 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,
-118,105,101,119,116,120, 0,103,108,114,101,115,108,105,109,105,116, 0,110,100,111,102, 95,112, 97,110, 0,110,100,111,102, 95,
-114,111,116, 97,116,101, 0,112, 97,100,115, 91, 50, 93, 0,112, 97,100, 91, 56, 93, 0,118,101,114,115,101,109, 97,115,116,101,
-114, 91, 49, 54, 48, 93, 0,118,101,114,115,101,117,115,101,114, 91, 49, 54, 48, 93, 0,103,108, 97,108,112,104, 97, 99,108,105,
-112, 0, 97,117,116,111,107,101,121, 95,109,111,100,101, 0, 97,117,116,111,107,101,121, 95,102,108, 97,103, 0, 99,111, 98, 97,
- 95,119,101,105,103,104,116, 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,
-115,101, 0, 42,115, 99,101,110,101, 0,101,110,100,120, 0,101,110,100,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,
-115, 99,101,110,101,110,114, 0,115, 99,114,101,101,110,110,114, 0,102,117,108,108, 0,109, 97,105,110,119,105,110, 0,119,105,
-110, 97,107,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118,
- 50, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,
-110, 97,109,101, 91, 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,
-111,108,100, 95,111,102,115,120, 0,111,108,100, 95,111,102,115,121, 0,115,111,114,116, 99,111,117,110,116,101,114, 0, 42,112,
- 97,110,101,108,116, 97, 98, 0, 42,118, 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91,
- 52, 93, 0,104,101, 97,100,114, 99,116, 0,119,105,110,114, 99,116, 0,104,101, 97,100,119,105,110, 0,119,105,110, 0,104,101,
- 97,100,101,114,116,121,112,101, 0, 98,117,116,115,112, 97, 99,101,116,121,112,101, 0,119,105,110,120, 0,119,105,110,121, 0,
-104,101, 97,100, 95,115,119, 97,112, 0,104,101, 97,100, 95,101,113,117, 97,108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,
-110, 95,101,113,117, 97,108, 0,104,101, 97,100, 98,117,116,108,101,110, 0,104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,
-114,115,111,114, 0,115,112, 97, 99,101,100, 97,116, 97, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0,115,
-117, 98,118,115,116,114, 91, 52, 93, 0,115,117, 98,118,101,114,115,105,111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,
-115,105,111,110, 0,109,105,110,115,117, 98,118,101,114,115,105,111,110, 0,100,105,115,112,108, 97,121,109,111,100,101, 0, 42,
- 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110,101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,
-111, 98, 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,105, 98,117,102, 0, 42,105, 98,117,102, 95, 99,111,109,112, 0,
- 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,110,114, 0, 98,111,116,116,111,109, 0,114,105,103,104,116, 0,120,
-111,102,115, 0,121,111,102,115, 0,108,105,102,116, 91, 51, 93, 0,103, 97,109,109, 97, 91, 51, 93, 0,103, 97,105,110, 91, 51,
- 93, 0,115, 97,116,117,114, 97,116,105,111,110, 0,100,105,114, 91, 49, 54, 48, 93, 0,100,111,110,101, 0,115,116, 97,114,116,
-115,116,105,108,108, 0,101,110,100,115,116,105,108,108, 0, 42,115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,
-121, 0, 42, 99,114,111,112, 0, 42,116,114, 97,110,115,102,111,114,109, 0, 42, 99,111,108,111,114, 95, 98, 97,108, 97,110, 99,
-101, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,115,116, 97,114,116,115,
-116,105,108,108, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,101,110,100,115,116,105,108,108, 0, 42,105, 98,117,102, 95,
-115,116, 97,114,116,115,116,105,108,108, 0, 42,105, 98,117,102, 95,101,110,100,115,116,105,108,108, 0, 42,105,110,115,116, 97,
-110, 99,101, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,116, 95,112,114,105,118, 97,
-116,101, 95,100, 97,116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,109, 97, 99,
-104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,109,117,108, 0,104, 97,110,100,115,
-105,122,101, 0, 97,110,105,109, 95,112,114,101,115,101,101,107, 0, 42,115,116,114,105,112, 0,102, 97, 99,102, 48, 0,102, 97,
- 99,102, 49, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,
-111,117,110,100, 0, 42,104,100, 97,117,100,105,111, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,
-116,114,111, 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115,116, 97,114,116,111,102,115, 0,
- 97,110,105,109, 95,101,110,100,111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98,108,101,110,100, 95,111,112, 97,
- 99,105,116,121, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115,101,112,
- 0,109,101,116, 97,115,116, 97, 99,107, 0,101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,
-101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,
-100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,
-121, 73,110,105, 0, 83, 99, 97,108,101,120, 70,105,110, 0, 83, 99, 97,108,101,121, 70,105,110, 0,120, 73,110,105, 0,120, 70,
-105,110, 0,121, 73,110,105, 0,121, 70,105,110, 0,114,111,116, 73,110,105, 0,114,111,116, 70,105,110, 0,105,110,116,101,114,
-112,111,108, 97,116,105,111,110, 0, 42,102,114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108,
- 97,115,116, 86, 97,108,105,100, 70,114, 97,109,101, 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116,
- 97, 0,116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,
-116,101,120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,
-101, 0,109, 97,120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91,
- 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,
-116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,
-101,120, 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,
-109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,
-110,102, 97, 99, 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0,100,120, 0,100,121, 0,108,105,110,107, 0,111,116,
-121,112,101, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116,100,105,115,116,
- 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,
-101,116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97,108,117,101, 91,
- 51, 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,100,101,108, 97,121, 0,100,117,114, 97,116,105,111,110, 0,
-109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, 0,100, 97,109,112,116,105,109,101,114, 0,112,114,111,112,110,
- 97,109,101, 91, 51, 50, 93, 0,109, 97,116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, 0, 42,102,114,
-111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, 93, 0,112,117,
-108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,106,111,121,105,110,100,
-101,120, 0, 97,120,105,115,102, 0, 98,117,116,116,111,110, 0, 98,117,116,116,111,110,102, 0,104, 97,116, 0,104, 97,116,102,
- 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,
-115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108,111, 0,115,116, 97,116,101, 95,
-109, 97,115,107, 0, 42, 97, 99,116, 0,102,114, 97,109,101, 80,114,111,112, 91, 51, 50, 93, 0, 98,108,101,110,100,105,110, 0,
-112,114,105,111,114,105,116,121, 0,101,110,100, 95,114,101,115,101,116, 0,115,116,114,105,100,101, 97,120,105,115, 0,115,116,
-114,105,100,101,108,101,110,103,116,104, 0,115,110,100,110,114, 0,112, 97,100, 49, 91, 50, 93, 0,109, 97,107,101, 99,111,112,
-121, 0, 99,111,112,121,109, 97,100,101, 0,112, 97,100, 50, 91, 49, 93, 0,116,114, 97, 99,107, 0,118,111,108,117,109,101, 0,
- 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103, 86,101,108,111, 99,105,116,121, 91, 51,
- 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,100,121,110, 95,111,112,101,114, 97,116,105,111,110, 0,102,111,114, 99,101,108,
-111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121,
- 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 98,117,116,115,116, 97, 0, 98,117,
-116,101,110,100, 0,109,105,110, 0,109, 97,120, 0,118,105,115,105,102, 97, 99, 0,114,111,116,100, 97,109,112, 0,109,105,110,
-108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,
-116, 91, 51, 93, 0,109, 97,116,112,114,111,112, 91, 51, 50, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,
-116, 95, 97,114,103, 95, 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,
-111, 97,116, 95, 97,114,103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,101,
- 99,116, 0, 98,111,100,121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,
-110, 97,109,101, 91, 54, 52, 93, 0,105,110,116, 95, 97,114,103, 0,102,108,111, 97,116, 95, 97,114,103, 0,103,111, 0, 97, 99,
- 99,101,108,108,101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120,114,111,116,115,112,101,101,100,
- 0,109, 97,120,116,105,108,116,115,112,101,101,100, 0,116,105,108,116,100, 97,109,112, 0,115,112,101,101,100,100, 97,109,112,
- 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109, 0, 42,110,101,119,112, 97, 99,107,101,100,102,105,108,101, 0,
- 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105,110,103, 0, 97,116,116,101,110,117, 97,116,105,111,110, 0,112,
-105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,120, 95,103, 97,105,110, 0,100,105,115,116, 97,110, 99,101, 0,
-115,116,114,101, 97,109,108,101,110, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,112,114,105,111, 0,112, 97,100, 91,
- 49, 48, 93, 0,103, 97,105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,100,111,112,112,108,101,114,118,101,
-108,111, 99,105,116,121, 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114, 0,110,117,109,115,111,117,110,100,
-115,103, 97,109,101,101,110,103,105,110,101, 0, 42,108, 97,109,112,114,101,110, 0,103,111, 98,106,101, 99,116, 0,100,117,112,
-108,105, 95,111,102,115, 91, 51, 93, 0, 99,104,105,108,100, 98, 97,115,101, 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93,
- 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100,
- 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,120,119,
-105,100,116,104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100,
- 0,114, 97,100, 95,116, 97,105,108, 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,112, 97,116,
-104,102,108, 97,103, 0,108, 97,121,101,114, 95,112,114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101,112, 0,103,104,
-111,115,116,115,105,122,101, 0,103,104,111,115,116,116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103,104,111,115,116,
-115,102, 0,103,104,111,115,116,101,102, 0,112, 97,116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,
-112, 97,116,104, 97, 99, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0,115,101,108,101, 99,116,102,108,
- 97,103, 0, 97,103,114,112, 95,105,110,100,101,120, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0,105,107,116,114,101,
-101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 42,100,117, 97,108, 95,113,117, 97,116, 0, 42, 98, 95, 98,111,110,
-101, 95,100,117, 97,108, 95,113,117, 97,116,115, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101,
- 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,111,115,101, 95,116, 97,105,
-108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, 91, 51, 93, 0,115,116,105,
-102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 42, 99,117,115,116,111,109, 0, 99,104, 97,110,
- 98, 97,115,101, 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51,
- 93, 0, 99,121, 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,114,111,117,112,115, 0, 97, 99,116,105,118,
-101, 95,103,114,111,117,112, 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 42,103,114,112, 0,114,101,115,101,114,118,
-101,100, 49, 0,103,114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,109, 97,114,107,101,114, 0, 97, 99,116,110,114, 0, 97,
- 99,116,119,105,100,116,104, 0,116,105,109,101,115,108,105,100,101, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112,
- 97, 99,101, 0,116, 97,114,115,112, 97, 99,101, 0,101,110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0, 42,116,
- 97,114, 0,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112,
- 97, 99,101, 0, 42,112,114,111,112, 0,116, 97,114,110,117,109, 0,116, 97,114,103,101,116,115, 0,105,116,101,114, 97,116,105,
-111,110,115, 0,114,111,111,116, 98,111,110,101, 0,109, 97,120, 95,114,111,111,116, 98,111,110,101, 0, 42,112,111,108,101,116,
- 97,114, 0,112,111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,112,111,108,101, 97,110,103,108,101, 0,111,
-114,105,101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,114,101,115,101,114,118,
-101,100, 50, 0,109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111,
- 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,
-111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,112,105,118, 90, 0, 97,
-120, 88, 0, 97,120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120, 76,105,109,105,116, 91,
- 54, 93, 0,101,120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,111,109, 0,116,111, 0,
-109, 97,112, 91, 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,111,109, 95,109, 97,120,
- 91, 51, 93, 0,116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,122,109,105,110, 0,122,109, 97,
-120, 0, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114,105,100,101,
- 95, 97,120,105,115, 0, 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, 97, 99,116,
-111,102,102,115, 0,115,116,114,105,100,101,108,101,110, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104,
- 97,110,110,101,108, 91, 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110,112,117,116,
- 0,104, 97,115,111,117,116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112,101, 0, 42,
-110,101,119, 95,115,111, 99,107, 0,110,115, 0,108,105,109,105,116, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 0,105,110,
-116,101,114,110, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, 0,108,111, 99,120, 0,108,111, 99,121, 0,111,
-119,110, 95,105,110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,116,111,115,111, 99,107, 0, 42,108,105,110,107, 0,
- 42,110,101,119, 95,110,111,100,101, 0,117,115,101,114,110, 97,109,101, 91, 51, 50, 93, 0,108, 97,115,116,121, 0,111,117,116,
-112,117,116,115, 0, 42,115,116,111,114, 97,103,101, 0,109,105,110,105,119,105,100,116,104, 0, 99,117,115,116,111,109, 49, 0,
- 99,117,115,116,111,109, 50, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120,101, 99, 0,116,111,116,114, 0, 98,117,116,114,
- 0,112,114,118,114, 0, 42,116,121,112,101,105,110,102,111, 0, 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,
-101, 0, 42,102,114,111,109,115,111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0, 42,115,116, 97, 99,107, 0, 42,
-116,104,114,101, 97,100,115,116, 97, 99,107, 0,105,110,105,116, 0,115,116, 97, 99,107,115,105,122,101, 0, 99,117,114, 95,105,
-110,100,101,120, 0, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0, 42,115,101,108,105,110, 0, 42,115,
-101,108,111,117,116, 0, 40, 42,116,105,109,101, 99,117,114,115,111,114, 41, 40, 41, 0, 40, 42,115,116, 97,116,115, 95,100,114,
- 97,119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114,101, 97,107, 41, 40, 41, 0, 99,121, 99,108,105, 99, 0,109,111,118,
-105,101, 0,115, 97,109,112,108,101,115, 0,109,105,110,115,112,101,101,100, 0,112,101,114, 99,101,110,116,120, 0,112,101,114,
- 99,101,110,116,121, 0, 98,111,107,101,104, 0, 99,117,114,118,101,100, 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,
-104, 0,105,109, 97,103,101, 95,105,110, 95,104,101,105,103,104,116, 0, 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,
-114, 95,121, 0,115,112,105,110, 0,105,116,101,114, 0,119,114, 97,112, 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,
-105,103,109, 97, 95,115,112, 97, 99,101, 0,104,117,101, 0,115, 97,116, 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,
-101,110,103,116,104, 0,102, 97,108,112,104, 97, 0,107,101,121, 91, 52, 93, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0,
- 99,111,108,110, 97,109,101, 91, 51, 50, 93, 0, 98,107,116,121,112,101, 0,114,111,116, 97,116,105,111,110, 0,112,114,101,118,
-105,101,119, 0,103, 97,109, 99,111, 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0,
- 98,116,104,114,101,115,104, 0, 42,100,105, 99,116, 0, 42,110,111,100,101, 0, 97,110,103,108,101, 95,111,102,115, 0, 99,111,
-108,109,111,100, 0,109,105,120, 0,116,104,114,101,115,104,111,108,100, 0,102, 97,100,101, 0,109, 0, 99, 0,106,105,116, 0,
-112,114,111,106, 0,102,105,116, 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,
-101, 0,101,120,116, 95,105,110, 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101, 0, 42,116,
- 97, 98,108,101, 0, 42,112,114,101,109,117,108,116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91,
- 52, 93, 0, 98,108, 97, 99,107, 91, 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,115, 97,
-109,112,108,101, 91, 51, 93, 0,111,102,102,115,101,116, 91, 50, 93, 0,105,110,110,101,114,114, 97,100,105,117,115, 0,114, 97,
-116,101, 0,114,103, 98, 91, 51, 93, 0, 99,108,111,110,101, 0, 97, 99,116,105,118,101, 95,114,110,100, 0, 42,108, 97,121,101,
-114,115, 0,116,111,116,108, 97,121,101,114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,122,101, 0, 42,112,111,
-111,108, 0,101,100,105,116,102,108, 97,103, 0,118,101,108, 91, 51, 93, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93,
- 0,110,117,109, 0,112, 97,114,101,110,116, 0,112, 97, 91, 52, 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,
-102,102,115,101,116, 0,114, 97,110,100, 91, 51, 93, 0, 42,115,116,105, 99,107, 95,111, 98, 0, 42,104, 97,105,114, 0,105, 95,
-114,111,116, 91, 52, 93, 0,114, 95,114,111,116, 91, 52, 93, 0,114, 95, 97,118,101, 91, 51, 93, 0,114, 95,118,101, 91, 51, 93,
- 0,100,105,101,116,105,109,101, 0, 98, 97,110,107, 0,115,105,122,101,109,117,108, 0,110,117,109, 95,100,109, 99, 97, 99,104,
-101, 0, 98,112,105, 0, 97,108,105,118,101, 0,108,111,111,112, 0,100,105,115,116,114, 0,112,104,121,115,116,121,112,101, 0,
-114,111,116,109,111,100,101, 0, 97,118,101,109,111,100,101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,
-100,114, 97,119, 95, 97,115, 0,100,114, 97,119, 95,115,105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,100,114, 97,119,
- 95,115,116,101,112, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, 95,115,116,
-101,112, 0, 97,100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102,114,111,109,
- 0,105,110,116,101,103,114, 97,116,111,114, 0,110, 98,101,116,119,101,101,110, 0, 98,111,105,100,110,101,105,103,104, 98,111,
-117,114,115, 0, 98, 98, 95, 97,108,105,103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97,110,105,109,
- 0, 98, 98, 95,115,112,108,105,116, 95,111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, 97,110,100,
- 95,116,105,108,116, 0, 98, 98, 95,111,102,102,115,101,116, 91, 50, 93, 0,115,105,109,112,108,105,102,121, 95,102,108, 97,103,
- 0,115,105,109,112,108,105,102,121, 95,114,101,102,115,105,122,101, 0,115,105,109,112,108,105,102,121, 95,114, 97,116,101, 0,
-115,105,109,112,108,105,102,121, 95,116,114, 97,110,115,105,116,105,111,110, 0,115,105,109,112,108,105,102,121, 95,118,105,101,
-119,112,111,114,116, 0,116,105,109,101,116,119,101, 97,107, 0,106,105,116,102, 97, 99, 0,107,101,121,101,100, 95,116,105,109,
-101, 0,101,102,102, 95,104, 97,105,114, 0,103,114,105,100, 95,114,101,115, 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102,
- 97, 99, 0,116, 97,110,112,104, 97,115,101, 0,114,101, 97, 99,116,102, 97, 99, 0, 97,118,101,102, 97, 99, 0,112,104, 97,115,
-101,102, 97, 99, 0,114, 97,110,100,114,111,116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,
-100,115,105,122,101, 0,114,101, 97, 99,116,115,104, 97,112,101, 0, 97, 99, 99, 91, 51, 93, 0,100,114, 97,103,102, 97, 99, 0,
- 98,114,111,119,110,102, 97, 99, 0,100, 97,109,112,102, 97, 99, 0, 97, 98,115,108,101,110,103,116,104, 0,114, 97,110,100,108,
-101,110,103,116,104, 0, 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99,104,105,108,100, 95,110, 98,114, 0,112, 97,
-114,101,110,116,115, 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,122,101, 0, 99,104,
-105,108,100,114, 97,100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,104,105,108,100,115,112,114,101, 97,100, 0, 99,108,117,
-109,112,102, 97, 99, 0, 99,108,117,109,112,112,111,119, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95,115,105,122,
-101, 0,114,111,117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116,104,114,101,
-115, 0,114,111,117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 98,114, 97,110,
- 99,104, 95,116,104,114,101,115, 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,109, 97,120, 95,118,101,108, 0,109, 97,
-120, 95,108, 97,116, 95, 97, 99, 99, 0,109, 97,120, 95,116, 97,110, 95, 97, 99, 99, 0, 97,118,101,114, 97,103,101, 95,118,101,
-108, 0, 98, 97,110,107,105,110,103, 0,109, 97,120, 95, 98, 97,110,107, 0,103,114,111,117,110,100,122, 0, 98,111,105,100,102,
- 97, 99, 91, 56, 93, 0, 98,111,105,100,114,117,108,101, 91, 56, 93, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,
-112, 95,111, 98, 0, 42, 98, 98, 95,111, 98, 0, 42,112,100, 50, 0, 42,112, 97,114,116, 0, 42,101,100,105,116, 0, 42, 42,112,
- 97,116,104, 99, 97, 99,104,101, 0, 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0,112, 97,116,104, 99, 97, 99,104,101, 98,
-117,102,115, 0, 99,104,105,108,100, 99, 97, 99,104,101, 98,117,102,115, 0, 42,116, 97,114,103,101,116, 95,111, 98, 0, 42,107,
-101,121,101,100, 95,111, 98, 0, 42,108, 97,116,116,105, 99,101, 0,101,102,102,101, 99,116,111,114,115, 0,114,101, 97, 99,116,
-101,118,101,110,116,115, 0,116,111,116, 99,104,105,108,100, 0,116,111,116, 99, 97, 99,104,101,100, 0,116,111,116, 99,104,105,
-108,100, 99, 97, 99,104,101, 0,116, 97,114,103,101,116, 95,112,115,121,115, 0,107,101,121,101,100, 95,112,115,121,115, 0,116,
-111,116,107,101,121,101,100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110, 97,109,101, 91, 51, 93, 91, 51,
- 50, 93, 0,118,103,114,111,117,112, 91, 49, 50, 93, 0,118,103, 95,110,101,103, 0,114,116, 51, 0, 42,114,101,110,100,101,114,
-100, 97,116, 97, 0, 42, 99, 97, 99,104,101, 0, 67,100,105,115, 0, 67,118,105, 0, 91, 51, 93, 0,115,116,114,117, 99,116,117,
-114, 97,108, 0, 98,101,110,100,105,110,103, 0,109, 97,120, 95, 98,101,110,100, 0,109, 97,120, 95,115,116,114,117, 99,116, 0,
-109, 97,120, 95,115,104,101, 97,114, 0, 97,118,103, 95,115,112,114,105,110,103, 95,108,101,110, 0,116,105,109,101,115, 99, 97,
-108,101, 0,101,102,102, 95,102,111,114, 99,101, 95,115, 99, 97,108,101, 0,101,102,102, 95,119,105,110,100, 95,115, 99, 97,108,
-101, 0,115,105,109, 95,116,105,109,101, 95,111,108,100, 0,115,116,101,112,115, 80,101,114, 70,114, 97,109,101, 0,112,114,101,
-114,111,108,108, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,115,111,108,118,101,114, 95,116,121,112,101, 0,118,103,
-114,111,117,112, 95, 98,101,110,100, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0,118,103,114,111,117,112, 95,115,116,114,
-117, 99,116, 0,112,114,101,115,101,116,115, 0, 42, 99,111,108,108,105,115,105,111,110, 95,108,105,115,116, 0,101,112,115,105,
-108,111,110, 0,115,101,108,102, 95,102,114,105, 99,116,105,111,110, 0,115,101,108,102,101,112,115,105,108,111,110, 0,115,101,
-108,102, 95,108,111,111,112, 95, 99,111,117,110,116, 0,108,111,111,112, 95, 99,111,117,110,116, 0,112,114,101,115,115,117,114,
-101, 0, 42,112,111,105,110,116,115, 0,116,111,116,112,111,105,110,116,115, 0,116,104,105, 99,107,110,101,115,115, 0,115,116,
-114,111,107,101,115, 0,102,114, 97,109,101,110,117,109, 0, 42, 97, 99,116,102,114, 97,109,101, 0,103,115,116,101,112, 0,105,
-110,102,111, 91, 49, 50, 56, 93, 0,115, 98,117,102,102,101,114, 95,115,105,122,101, 0,115, 98,117,102,102,101,114, 95,115,102,
-108, 97,103, 0, 42,115, 98,117,102,102,101,114, 0, 0, 0, 0, 84, 89, 80, 69, 0, 0, 1, 91, 99,104, 97,114, 0,117, 99,104,
- 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,110,103, 0,102,
-108,111, 97,116, 0,100,111,117, 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97,116, 97, 0, 76,
-105,115,116, 66, 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,
-118,101, 99, 51,105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101,
- 99, 52,100, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,114,116,121, 68, 97,116, 97, 0, 73, 68, 80,
-114,111,112,101,114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 80,114,101,118,
-105,101,119, 73,109, 97,103,101, 0, 73,112,111, 68,114,105,118,101,114, 0, 79, 98,106,101, 99,116, 0, 73,112,111, 67,117,114,
-118,101, 0, 66, 80,111,105,110,116, 0, 66,101,122, 84,114,105,112,108,101, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107,
- 0, 75,101,121, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,116, 76,105,110,101, 0, 84,101,120,116, 77, 97,114,
-107,101,114, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101,
- 85,115,101,114, 0, 73,109, 97,103,101, 0, 71, 80, 85, 84,101,120,116,117,114,101, 0, 97,110,105,109, 0, 82,101,110,100,101,
-114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0, 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116,
- 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 73,109, 66,117,102, 0, 84,101,120, 77, 97,112,112,
-105,110,103, 0, 76, 97,109,112, 0, 67,117,114,118,101, 77, 97,112,112,105,110,103, 0, 87, 97,118,101, 0, 77, 97,116,101,114,
-105, 97,108, 0, 98, 78,111,100,101, 84,114,101,101, 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68,
- 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 78,
-117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116, 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0,
- 77,101,115,104, 0, 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,
-100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 77, 83,101,
-108,101, 99,116, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 0, 80, 97,114,116,105, 97,108,
- 86,105,115,105, 98,105,108,105,116,121, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77, 84,101,120, 80,111,108,
-121, 0, 77, 76,111,111,112, 85, 86, 0, 77, 76,111,111,112, 67,111,108, 0, 77, 70,108,111, 97,116, 80,114,111,112,101,114,116,
-121, 0, 77, 73,110,116, 80,114,111,112,101,114,116,121, 0, 77, 83,116,114,105,110,103, 80,114,111,112,101,114,116,121, 0, 79,
-114,105,103, 83,112, 97, 99,101, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 67,111,108, 0, 77,117,108,116,105,114,101,
-115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 69,100,
-103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, 77,117,108,116,105,114,101,115, 77, 97,112, 78,111,100,101,
- 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116,
- 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,
-105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,114, 97,121, 77,
-111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,
-100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,101,118,101,108, 77,111,100,105,102,105,
-101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,105,115,112,108, 97, 99,
-101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,111,100,105,102,105,101,114, 68,
- 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,111,116,104, 77,
-111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, 97,118,
-101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, 68, 97,
-116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111,100,105,
-102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104,
- 0, 67,108,111,116,104, 83,105,109, 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,111,108,108, 83,101,116,116,105,
-110,103,115, 0, 80,111,105,110,116, 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110, 77,111,100,105,102,105,101,114,
- 68, 97,116, 97, 0, 66, 86, 72, 84,114,101,101, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97,
- 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, 77, 68,101,102, 67,101,108,108, 0, 77,101,115,104, 68,101,102,111,
-114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 77,111,100,
-105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 0, 68,101,114,105,118,101,100,
- 77,101,115,104, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116,
- 97, 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,104,114,105,110,107,119,114, 97,112,
- 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,
-112, 0, 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116,
- 66,111,100,121, 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 79, 98, 72,111,111,107, 0, 82, 78, 71,
- 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105,110,103, 0, 83,
- 66, 83, 99,114, 97,116, 99,104, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,
-101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 70, 70, 77,112,101,103,
- 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 83, 99,101,110,101, 82,101,110,100,101,114, 76,
- 97,121,101,114, 0, 82,101,110,100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,114,111,102,105,108,101, 0, 71, 97,
-109,101, 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 73,109, 97,103,101, 80, 97,105,110,116, 83,
-101,116,116,105,110,103,115, 0, 66,114,117,115,104, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97, 0,
- 80, 97,114,116,105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 84,114, 97,110,115,102,111,114,109, 79,114,
-105,101,110,116, 97,116,105,111,110, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 66,114,117,115,104, 68, 97,116, 97,
- 0, 83, 99,117,108,112,116, 68, 97,116, 97, 0, 83, 99,117,108,112,116, 83,101,115,115,105,111,110, 0, 83, 99,101,110,101, 0,
- 68, 97,103, 70,111,114,101,115,116, 0, 66, 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107,
- 0, 83, 99,114, 65,114,101, 97, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,116,111,112,111, 86,105,101,119, 68, 97,
-116, 97, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 98, 71, 80,100, 97,116, 97, 0, 86,105,101,119, 50, 68, 0, 83,112, 97,
- 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,
-101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0,100,105,114,101,110,116,114,121, 0, 66,108,101,110,100, 72, 97,110,100,108,
-101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,101, 0, 84,114,101,101, 83,116,111,114,101, 69,
-108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,
-116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,
-112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 73,109, 97, 83,101,108, 0, 70,105,108,101, 76,105,115,116, 0, 84,104,
-101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 84,104,101,109,101, 87,105,114,101, 67,111,108,111,114, 0,
- 98, 84,104,101,109,101, 0, 83,111,108,105,100, 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,
-110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111, 98,
- 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 84, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,112, 67,114,111,
-112, 0, 83,116,114,105,112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, 66, 97,108, 97,110,
- 99,101, 0, 83,116,114,105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,
-113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0,104,100, 97,117,100,105,111, 0, 77,101,116, 97, 83,116, 97, 99,107, 0,
- 69,100,105,116,105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,
-111,114,109, 86, 97,114,115, 0, 83,111,108,105,100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,
-114,111,108, 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0,
- 80, 97,114,116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 79,111,112,115, 0, 98, 80,114,111,112,101,114,116,121, 0,
- 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104, 83,
-101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121, 83,
-101,110,115,111,114, 0, 98, 65, 99,116,117, 97,116,111,114, 83,101,110,115,111,114, 0, 98, 68,101,108, 97,121, 83,101,110,115,
-111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114,
- 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,
-103,101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,
-121,115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,
-116,104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,
-117, 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117,
- 97,116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117,
- 97,116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,
-117, 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,
-111,114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,
-116,117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,
-117, 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117,
- 97,116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,111, 68, 70,105,
-108,116,101,114, 65, 99,116,117, 97,116,111,114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116,
- 97,116,101, 65, 99,116,117, 97,116,111,114, 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98,
- 83,111,117,110,100, 76,105,115,116,101,110,101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 79, 98,
-106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109, 97,116,117,114,101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108,
- 0, 98, 65, 99,116,105,111,110, 71,114,111,117,112, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 83,112, 97,
- 99,101, 65, 99,116,105,111,110, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,
-115,116,114, 97,105,110,116, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,
-110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116,
- 0, 98, 84,114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,
-111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0,
- 98, 77,105,110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,
-114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97,
- 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,
-110,116, 0, 98, 83,116,114,101,116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,111,
-100,121, 74,111,105,110,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,114,
- 97,105,110,116, 0, 98, 67,104,105,108,100, 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,111,
-114,109, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116,
- 0, 98, 82,111,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,
-111,110,115,116,114, 97,105,110,116, 0, 98, 68,105,115,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98,
- 65, 99,116,105,111,110, 77,111,100,105,102,105,101,114, 0, 98, 65, 99,116,105,111,110, 83,116,114,105,112, 0, 98, 78,111,100,
-101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 0, 98, 78,111,100,101, 76,105,110,107, 0, 98, 78,111,
-100,101, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78,111,100,101, 84,121,112,101, 0, 78,111,100,101, 73,109,
- 97,103,101, 65,110,105,109, 0, 78,111,100,101, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 68, 66,108,117,114, 68, 97,
-116, 97, 0, 78,111,100,101, 66,105,108, 97,116,101,114, 97,108, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 72,117,101,
- 83, 97,116, 0, 78,111,100,101, 73,109, 97,103,101, 70,105,108,101, 0, 78,111,100,101, 67,104,114,111,109, 97, 0, 78,111,100,
-101, 84,119,111, 88, 89,115, 0, 78,111,100,101, 84,119,111, 70,108,111, 97,116,115, 0, 78,111,100,101, 71,101,111,109,101,116,
-114,121, 0, 78,111,100,101, 86,101,114,116,101,120, 67,111,108, 0, 78,111,100,101, 68,101,102,111, 99,117,115, 0, 78,111,100,
-101, 83, 99,114,105,112,116, 68,105, 99,116, 0, 78,111,100,101, 71,108, 97,114,101, 0, 78,111,100,101, 84,111,110,101,109, 97,
-112, 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,
-118,101, 77, 97,112, 0, 66,114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,114,
- 0, 72, 97,105,114, 75,101,121, 0, 80, 97,114,116,105, 99,108,101, 75,101,121, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,
-108,101, 0, 80, 97,114,116,105, 99,108,101, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,101,116,116,105,110,103,115,
- 0, 80, 97,114,116,105, 99,108,101, 69,100,105,116, 0, 80, 97,114,116,105, 99,108,101, 67, 97, 99,104,101, 75,101,121, 0, 76,
-105,110,107, 78,111,100,101, 0, 98, 71, 80, 68,115,112,111,105,110,116, 0, 98, 71, 80, 68,115,116,114,111,107,101, 0, 98, 71,
- 80, 68,102,114, 97,109,101, 0, 98, 71, 80, 68,108, 97,121,101,114, 0, 0, 0, 84, 76, 69, 78, 0, 1, 0, 1, 0, 2, 0, 2,
- 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 8, 0, 12, 0, 8, 0, 4, 0, 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24,
- 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 20, 0, 76, 0, 52, 2, 40, 0, 0, 0, 32, 0,140, 3, 68, 0, 92, 0, 36, 0, 56,
- 0, 84, 0,112, 0,120, 0, 16, 0, 24, 0, 40, 0,120, 0, 20, 0,132, 0, 32, 1,128, 0, 0, 0, 0, 0, 0, 0,136, 1, 4,
- 1, 84, 0, 24, 3, 8, 0,168, 0, 0, 0,132, 1,120, 1, 8, 0, 56, 2,108, 0,124, 0, 76, 1, 68, 0, 0, 0,108, 0,104,
- 0,136, 0, 56, 0, 8, 0, 16, 1, 56, 0, 0, 1, 24, 0, 20, 0, 44, 0, 60, 0, 24, 0, 12, 0, 12, 0, 4, 0, 8, 0, 8,
- 0, 24, 0, 76, 0, 32, 0, 8, 0, 12, 0, 8, 0, 8, 0, 4, 0, 4, 1, 0, 0, 32, 0, 16, 0, 64, 0, 24, 0, 12, 0, 56,
- 0, 0, 0, 52, 0, 68, 0, 88, 0, 96, 0, 68, 0,116, 0, 64, 0, 60, 0,108, 0, 60, 0,148, 0,152, 0, 60, 0, 92, 0,104,
- 0,184, 0,100, 0,180, 0, 52, 0, 68, 0, 0, 0,132, 0, 28, 0, 20, 0,100, 0, 0, 0, 64, 0, 8, 0, 8, 0,216, 0, 76,
- 1, 64, 0, 0, 0, 64, 0, 64, 0,108, 0,116, 0, 40, 0, 84, 0, 56, 0,128, 0,152, 1,132, 0,208, 0, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, 1,100, 0, 40, 0, 28, 0,176, 0,144, 0, 52, 0, 16, 0, 72, 3,180, 0, 56, 0, 16, 0, 80, 0, 12, 0,184,
- 0, 8, 0, 72, 0, 80, 0,188, 0, 8, 0,168, 0, 0, 5, 96, 0, 0, 0, 60, 3, 4, 0, 36, 0,204, 0, 0, 0, 0, 0, 0,
- 0, 20, 0,136, 0, 36, 1, 88, 0,220, 0,200, 1,200, 0, 0, 0, 0, 1, 8, 0, 12, 0, 12, 1, 8, 0,180, 0,128, 2, 80,
- 0, 36, 0,164, 0,220, 2,132, 0, 0, 0,152, 0,208, 0, 16, 14, 56, 0, 56, 12, 32, 0,120, 0, 20, 0, 24, 0,228, 0, 32,
- 0, 80, 0, 28, 0, 16, 0, 8, 0, 52, 0,160, 0,240, 1,168, 0,204, 1, 28, 0, 0, 0, 16, 0, 28, 0, 12, 0, 24, 0, 48,
- 0, 16, 0, 20, 0, 16, 0, 24, 1, 56, 0, 0, 0, 56, 0, 44, 0, 64, 0, 48, 0, 8, 0, 44, 0, 72, 0,104, 0, 40, 0, 8,
- 0, 72, 0, 44, 0, 40, 0,108, 0, 68, 0, 76, 0, 80, 0, 64, 0,128, 0, 4, 0, 60, 0, 12, 0, 92, 0, 28, 0, 20, 0, 80,
- 0, 16, 0, 76, 0,104, 0, 52, 0, 28, 0, 96, 0, 60, 0, 56, 0,108, 0,140, 0, 4, 0, 20, 0, 12, 0, 8, 0, 40, 0, 0,
- 0, 68, 0,176, 0, 24, 1, 4, 0,116, 1,152, 0, 72, 0, 64, 0,192, 0, 44, 0, 64, 0,116, 0, 60, 0,104, 0, 52, 0, 44,
- 0, 44, 0, 68, 0, 44, 0, 64, 0, 44, 0, 20, 0, 52, 0, 96, 0, 12, 0,108, 0, 92, 0, 28, 0, 28, 0, 28, 0, 52, 0, 60,
- 0,140, 0, 36, 0,120, 0, 24, 0,196, 0, 0, 0, 0, 0, 16, 0, 40, 0, 28, 0, 12, 0, 12, 1, 16, 0, 40, 0, 8, 0, 8,
- 0, 64, 0, 32, 0, 24, 0, 8, 0, 24, 0, 32, 0, 8, 0, 12, 0, 44, 0, 20, 0, 60, 0, 24, 0, 56, 0, 72, 0,196, 1,224,
- 0, 0, 0, 0, 0, 0, 0, 16, 0, 20, 0, 24, 0,172, 0, 0, 83, 84, 82, 67, 0, 0, 1, 50, 0, 10, 0, 2, 0, 10, 0, 0,
- 0, 10, 0, 1, 0, 11, 0, 3, 0, 11, 0, 0, 0, 11, 0, 1, 0, 9, 0, 2, 0, 12, 0, 2, 0, 9, 0, 3, 0, 9, 0, 4,
- 0, 13, 0, 2, 0, 2, 0, 5, 0, 2, 0, 6, 0, 14, 0, 2, 0, 4, 0, 5, 0, 4, 0, 6, 0, 15, 0, 2, 0, 7, 0, 5,
- 0, 7, 0, 6, 0, 16, 0, 2, 0, 8, 0, 5, 0, 8, 0, 6, 0, 17, 0, 3, 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7,
- 0, 18, 0, 3, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 19, 0, 3, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7,
- 0, 20, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 4, 0, 8, 0, 21, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6,
- 0, 7, 0, 7, 0, 7, 0, 8, 0, 22, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 8, 0, 8, 0, 23, 0, 4,
- 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0, 4, 0, 12, 0, 24, 0, 4, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11,
- 0, 7, 0, 12, 0, 25, 0, 4, 0, 9, 0, 13, 0, 12, 0, 14, 0, 4, 0, 15, 0, 4, 0, 16, 0, 26, 0, 10, 0, 26, 0, 0,
- 0, 26, 0, 1, 0, 0, 0, 17, 0, 0, 0, 18, 0, 0, 0, 19, 0, 2, 0, 20, 0, 4, 0, 21, 0, 25, 0, 22, 0, 4, 0, 23,
- 0, 4, 0, 24, 0, 27, 0, 9, 0, 9, 0, 0, 0, 9, 0, 1, 0, 27, 0, 25, 0, 28, 0, 26, 0, 0, 0, 27, 0, 2, 0, 28,
- 0, 2, 0, 20, 0, 4, 0, 29, 0, 26, 0, 30, 0, 28, 0, 8, 0, 27, 0, 31, 0, 27, 0, 32, 0, 29, 0, 33, 0, 0, 0, 34,
- 0, 0, 0, 35, 0, 4, 0, 36, 0, 4, 0, 37, 0, 28, 0, 38, 0, 30, 0, 6, 0, 4, 0, 39, 0, 4, 0, 40, 0, 2, 0, 41,
- 0, 2, 0, 42, 0, 2, 0, 43, 0, 4, 0, 44, 0, 31, 0, 6, 0, 32, 0, 45, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 18,
- 0, 2, 0, 20, 0, 0, 0, 48, 0, 33, 0, 21, 0, 33, 0, 0, 0, 33, 0, 1, 0, 34, 0, 49, 0, 35, 0, 50, 0, 24, 0, 51,
- 0, 24, 0, 52, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 53, 0, 2, 0, 54, 0, 2, 0, 55, 0, 2, 0, 56, 0, 2, 0, 20,
- 0, 2, 0, 57, 0, 7, 0, 11, 0, 7, 0, 12, 0, 4, 0, 58, 0, 7, 0, 59, 0, 7, 0, 60, 0, 7, 0, 61, 0, 31, 0, 62,
- 0, 36, 0, 7, 0, 27, 0, 31, 0, 12, 0, 63, 0, 24, 0, 64, 0, 2, 0, 46, 0, 2, 0, 65, 0, 2, 0, 66, 0, 2, 0, 37,
- 0, 37, 0, 16, 0, 37, 0, 0, 0, 37, 0, 1, 0, 7, 0, 67, 0, 7, 0, 61, 0, 2, 0, 18, 0, 2, 0, 47, 0, 2, 0, 68,
- 0, 2, 0, 20, 0, 4, 0, 69, 0, 4, 0, 70, 0, 9, 0, 2, 0, 7, 0, 71, 0, 0, 0, 17, 0, 0, 0, 72, 0, 7, 0, 73,
- 0, 7, 0, 74, 0, 38, 0, 12, 0, 27, 0, 31, 0, 37, 0, 75, 0, 0, 0, 76, 0, 4, 0, 77, 0, 7, 0, 61, 0, 12, 0, 78,
- 0, 36, 0, 79, 0, 27, 0, 80, 0, 2, 0, 18, 0, 2, 0, 81, 0, 2, 0, 82, 0, 2, 0, 20, 0, 39, 0, 5, 0, 27, 0, 83,
- 0, 2, 0, 84, 0, 2, 0, 85, 0, 2, 0, 86, 0, 4, 0, 37, 0, 40, 0, 6, 0, 40, 0, 0, 0, 40, 0, 1, 0, 0, 0, 87,
- 0, 0, 0, 88, 0, 4, 0, 23, 0, 4, 0, 89, 0, 41, 0, 10, 0, 41, 0, 0, 0, 41, 0, 1, 0, 4, 0, 90, 0, 4, 0, 91,
- 0, 4, 0, 92, 0, 4, 0, 43, 0, 4, 0, 14, 0, 4, 0, 93, 0, 0, 0, 94, 0, 0, 0, 95, 0, 42, 0, 15, 0, 27, 0, 31,
- 0, 0, 0, 96, 0, 4, 0, 93, 0, 4, 0, 97, 0, 12, 0, 98, 0, 40, 0, 99, 0, 40, 0,100, 0, 4, 0,101, 0, 4, 0,102,
- 0, 12, 0,103, 0, 0, 0,104, 0, 4, 0,105, 0, 4, 0,106, 0, 9, 0,107, 0, 8, 0,108, 0, 43, 0, 5, 0, 4, 0,109,
- 0, 4, 0,110, 0, 4, 0, 93, 0, 4, 0, 37, 0, 9, 0, 2, 0, 44, 0, 20, 0, 27, 0, 31, 0, 2, 0, 18, 0, 2, 0, 20,
- 0, 7, 0,111, 0, 7, 0,112, 0, 7, 0,113, 0, 7, 0,114, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,118,
- 0, 7, 0,119, 0, 7, 0,120, 0, 7, 0,121, 0, 2, 0,122, 0, 2, 0,123, 0, 7, 0,124, 0, 36, 0, 79, 0, 39, 0,125,
- 0, 32, 0,126, 0, 45, 0, 12, 0, 4, 0,127, 0, 4, 0,128, 0, 4, 0,129, 0, 4, 0,130, 0, 2, 0,131, 0, 2, 0,132,
- 0, 2, 0, 20, 0, 2, 0,133, 0, 2, 0,134, 0, 2, 0,135, 0, 2, 0,136, 0, 2, 0,137, 0, 46, 0, 32, 0, 27, 0, 31,
- 0, 0, 0, 34, 0, 12, 0,138, 0, 47, 0,139, 0, 48, 0,140, 0, 49, 0,141, 0, 2, 0,133, 0, 2, 0, 20, 0, 2, 0,142,
- 0, 2, 0, 18, 0, 2, 0, 37, 0, 2, 0, 43, 0, 4, 0,143, 0, 2, 0,144, 0, 2, 0,145, 0, 2, 0,146, 0, 2, 0,147,
- 0, 2, 0,148, 0, 2, 0,149, 0, 4, 0,150, 0, 4, 0,151, 0, 43, 0,152, 0, 30, 0,153, 0, 7, 0,154, 0, 4, 0,155,
- 0, 2, 0,156, 0, 2, 0,157, 0, 2, 0,158, 0, 2, 0,159, 0, 7, 0,160, 0, 7, 0,161, 0, 9, 0,162, 0, 50, 0, 30,
- 0, 2, 0,163, 0, 2, 0,164, 0, 2, 0,165, 0, 2, 0,166, 0, 32, 0,167, 0, 51, 0,168, 0, 0, 0,169, 0, 0, 0,170,
- 0, 0, 0,171, 0, 0, 0,172, 0, 0, 0,173, 0, 7, 0,174, 0, 7, 0,175, 0, 2, 0,176, 0, 2, 0,177, 0, 2, 0,178,
- 0, 2, 0,179, 0, 2, 0,180, 0, 2, 0,181, 0, 7, 0,182, 0, 7, 0,183, 0, 7, 0,184, 0, 7, 0,185, 0, 7, 0,186,
- 0, 7, 0, 57, 0, 7, 0,187, 0, 7, 0,188, 0, 7, 0,189, 0, 7, 0,190, 0, 7, 0,191, 0, 52, 0, 15, 0, 0, 0,192,
- 0, 9, 0,193, 0, 0, 0,194, 0, 0, 0,195, 0, 4, 0,196, 0, 4, 0,197, 0, 9, 0,198, 0, 7, 0,199, 0, 7, 0,200,
- 0, 7, 0,201, 0, 4, 0,202, 0, 9, 0,203, 0, 9, 0,204, 0, 4, 0,205, 0, 4, 0, 37, 0, 53, 0, 6, 0, 7, 0,182,
- 0, 7, 0,183, 0, 7, 0,184, 0, 7, 0,206, 0, 7, 0, 67, 0, 4, 0, 64, 0, 54, 0, 5, 0, 2, 0, 20, 0, 2, 0, 36,
- 0, 2, 0, 64, 0, 2, 0,207, 0, 53, 0,201, 0, 55, 0, 17, 0, 32, 0,167, 0, 46, 0,208, 0, 56, 0,209, 0, 7, 0,210,
- 0, 7, 0,211, 0, 2, 0, 18, 0, 2, 0,212, 0, 7, 0,113, 0, 7, 0,114, 0, 7, 0,213, 0, 4, 0,214, 0, 2, 0,215,
- 0, 2, 0,216, 0, 4, 0,133, 0, 4, 0,143, 0, 2, 0,217, 0, 2, 0,218, 0, 51, 0, 53, 0, 27, 0, 31, 0, 7, 0,219,
- 0, 7, 0,220, 0, 7, 0,221, 0, 7, 0,222, 0, 7, 0,223, 0, 7, 0,224, 0, 7, 0,225, 0, 7, 0,226, 0, 7, 0,227,
- 0, 7, 0,228, 0, 7, 0,229, 0, 7, 0,230, 0, 7, 0,231, 0, 7, 0,232, 0, 7, 0,233, 0, 7, 0,234, 0, 7, 0,235,
- 0, 7, 0,236, 0, 7, 0,237, 0, 7, 0,238, 0, 2, 0,239, 0, 2, 0,240, 0, 2, 0,241, 0, 2, 0,242, 0, 2, 0,243,
- 0, 2, 0,244, 0, 2, 0,245, 0, 2, 0, 20, 0, 2, 0, 18, 0, 2, 0,212, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248,
- 0, 7, 0,249, 0, 2, 0,250, 0, 2, 0,251, 0, 2, 0,252, 0, 2, 0,131, 0, 4, 0, 23, 0, 4, 0,128, 0, 4, 0,129,
- 0, 4, 0,130, 0, 7, 0,253, 0, 7, 0,254, 0, 7, 0,188, 0, 45, 0,255, 0, 36, 0, 79, 0, 46, 0,208, 0, 52, 1, 0,
- 0, 54, 1, 1, 0, 55, 1, 2, 0, 30, 0,153, 0, 57, 0, 8, 0, 7, 1, 3, 0, 7, 1, 4, 0, 7, 0,175, 0, 4, 0, 20,
- 0, 7, 1, 5, 0, 7, 1, 6, 0, 7, 1, 7, 0, 32, 0, 45, 0, 58, 0, 77, 0, 27, 0, 31, 0, 2, 0, 18, 0, 2, 1, 8,
- 0, 4, 1, 9, 0, 2, 0,177, 0, 2, 1, 10, 0, 7, 0,182, 0, 7, 0,183, 0, 7, 0,184, 0, 7, 0,185, 0, 7, 1, 11,
- 0, 7, 1, 12, 0, 7, 1, 13, 0, 7, 1, 14, 0, 7, 1, 15, 0, 7, 1, 16, 0, 7, 1, 17, 0, 7, 1, 18, 0, 7, 1, 19,
- 0, 7, 1, 20, 0, 7, 1, 21, 0, 59, 1, 22, 0, 2, 1, 23, 0, 2, 0, 70, 0, 7, 0,113, 0, 7, 0,114, 0, 7, 1, 24,
- 0, 7, 1, 25, 0, 7, 1, 26, 0, 2, 1, 27, 0, 2, 1, 28, 0, 2, 1, 29, 0, 2, 1, 30, 0, 0, 1, 31, 0, 0, 1, 32,
- 0, 2, 1, 33, 0, 2, 1, 34, 0, 2, 1, 35, 0, 2, 1, 36, 0, 2, 1, 37, 0, 7, 1, 38, 0, 7, 1, 39, 0, 7, 1, 40,
- 0, 7, 1, 41, 0, 2, 1, 42, 0, 2, 0, 43, 0, 2, 1, 43, 0, 2, 1, 44, 0, 2, 1, 45, 0, 2, 1, 46, 0, 7, 1, 47,
- 0, 7, 1, 48, 0, 7, 1, 49, 0, 7, 1, 50, 0, 7, 1, 51, 0, 7, 1, 52, 0, 7, 1, 53, 0, 7, 1, 54, 0, 7, 1, 55,
- 0, 7, 1, 56, 0, 7, 1, 57, 0, 4, 1, 58, 0, 4, 1, 59, 0, 2, 1, 60, 0, 2, 1, 61, 0, 2, 1, 62, 0, 2, 1, 63,
- 0, 7, 1, 64, 0, 7, 1, 65, 0, 7, 1, 66, 0, 7, 1, 67, 0, 2, 1, 68, 0, 2, 1, 69, 0, 50, 1, 70, 0, 36, 0, 79,
- 0, 30, 0,153, 0, 39, 0,125, 0, 60, 0, 2, 0, 27, 0, 31, 0, 36, 0, 79, 0, 61, 0,129, 0, 27, 0, 31, 0, 2, 0,177,
- 0, 2, 0, 20, 0, 7, 0,182, 0, 7, 0,183, 0, 7, 0,184, 0, 7, 1, 71, 0, 7, 1, 72, 0, 7, 1, 73, 0, 7, 1, 74,
- 0, 7, 1, 75, 0, 7, 1, 76, 0, 7, 1, 77, 0, 7, 1, 78, 0, 7, 1, 79, 0, 7, 1, 80, 0, 7, 1, 81, 0, 7, 1, 82,
- 0, 7, 1, 83, 0, 7, 1, 84, 0, 7, 1, 85, 0, 7, 1, 86, 0, 7, 1, 87, 0, 7, 1, 88, 0, 7, 1, 89, 0, 7, 1, 90,
- 0, 7, 1, 91, 0, 7, 1, 92, 0, 7, 1, 93, 0, 7, 1, 94, 0, 7, 1, 95, 0, 7, 1, 96, 0, 7, 1, 97, 0, 2, 1, 98,
- 0, 2, 1, 99, 0, 2, 1,100, 0, 0, 1,101, 0, 0, 1,102, 0, 7, 1,103, 0, 7, 1,104, 0, 2, 1,105, 0, 2, 1,106,
- 0, 7, 1,107, 0, 7, 1,108, 0, 7, 1,109, 0, 7, 1,110, 0, 2, 1,111, 0, 2, 1,112, 0, 4, 1, 9, 0, 4, 1,113,
- 0, 2, 1,114, 0, 2, 1,115, 0, 2, 1,116, 0, 2, 1,117, 0, 7, 1,118, 0, 7, 1,119, 0, 7, 1,120, 0, 7, 1,121,
- 0, 7, 1,122, 0, 7, 1,123, 0, 7, 1,124, 0, 7, 1,125, 0, 7, 1,126, 0, 7, 1,127, 0, 0, 1,128, 0, 7, 1,129,
- 0, 7, 1,130, 0, 7, 1,131, 0, 4, 1,132, 0, 0, 1,133, 0, 0, 1, 43, 0, 0, 1,134, 0, 0, 1,135, 0, 2, 1,136,
- 0, 2, 1,137, 0, 2, 1,138, 0, 2, 1,139, 0, 2, 1,140, 0, 2, 1,141, 0, 7, 1,142, 0, 7, 1,143, 0, 7, 1,144,
- 0, 7, 1,145, 0, 7, 1,146, 0, 2, 0,163, 0, 2, 0,164, 0, 54, 1,147, 0, 54, 1,148, 0, 0, 1,149, 0, 0, 1,150,
- 0, 0, 1,151, 0, 0, 1,152, 0, 2, 1,153, 0, 2, 1, 8, 0, 7, 1,154, 0, 7, 1,155, 0, 50, 1, 70, 0, 62, 1,156,
- 0, 36, 0, 79, 0, 63, 1,157, 0, 30, 0,153, 0, 7, 1,158, 0, 7, 1,159, 0, 7, 1,160, 0, 7, 1,161, 0, 7, 1,162,
- 0, 2, 1,163, 0, 2, 0, 70, 0, 7, 1,164, 0, 7, 1,165, 0, 7, 1,166, 0, 7, 1,167, 0, 7, 1,168, 0, 7, 1,169,
- 0, 7, 1,170, 0, 7, 1,171, 0, 7, 1,172, 0, 2, 1,173, 0, 2, 1,174, 0, 7, 1,175, 0, 7, 1,176, 0, 7, 1,177,
- 0, 7, 1,178, 0, 7, 1,179, 0, 4, 1,180, 0, 4, 1,181, 0, 4, 1,182, 0, 39, 0,125, 0, 12, 1,183, 0, 64, 0, 6,
- 0, 27, 0, 31, 0, 0, 1,184, 0, 7, 1,185, 0, 7, 0, 37, 0, 65, 0, 2, 0, 43, 0,152, 0, 66, 0, 26, 0, 66, 0, 0,
- 0, 66, 0, 1, 0, 67, 1,186, 0, 4, 1,187, 0, 4, 1,188, 0, 4, 1,189, 0, 4, 1,190, 0, 4, 1,191, 0, 4, 1,192,
- 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 1,193, 0, 2, 1,194, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 1,195,
- 0, 7, 1,196, 0, 7, 1,197, 0, 7, 1,198, 0, 7, 1,199, 0, 7, 1,200, 0, 7, 1,201, 0, 7, 0, 23, 0, 7, 1,202,
- 0, 7, 1,203, 0, 68, 0, 15, 0, 27, 0, 31, 0, 67, 1,186, 0, 12, 1,204, 0, 12, 1,205, 0, 36, 0, 79, 0, 61, 1,206,
- 0, 2, 0, 20, 0, 2, 1,207, 0, 4, 0,176, 0, 7, 1, 3, 0, 7, 0,175, 0, 7, 1, 4, 0, 7, 1,208, 0, 7, 1,209,
- 0, 7, 1,210, 0, 35, 0, 10, 0, 7, 1,211, 0, 7, 1,212, 0, 7, 1,213, 0, 7, 1,214, 0, 2, 1,215, 0, 2, 1,216,
- 0, 0, 1,217, 0, 0, 1,218, 0, 0, 1,219, 0, 0, 1,220, 0, 34, 0, 7, 0, 7, 1,221, 0, 7, 1,212, 0, 7, 1,213,
- 0, 2, 1,217, 0, 2, 1,220, 0, 7, 1,214, 0, 7, 0, 37, 0, 69, 0, 21, 0, 69, 0, 0, 0, 69, 0, 1, 0, 2, 0, 18,
- 0, 2, 1,222, 0, 2, 1,220, 0, 2, 0, 20, 0, 2, 1,223, 0, 2, 1,224, 0, 2, 1,225, 0, 2, 1,226, 0, 2, 1,227,
- 0, 2, 1,228, 0, 2, 1,229, 0, 2, 1,230, 0, 7, 1,231, 0, 7, 1,232, 0, 34, 0, 49, 0, 35, 0, 50, 0, 2, 1,233,
- 0, 2, 0, 37, 0, 4, 1,234, 0, 70, 0, 5, 0, 2, 1,235, 0, 2, 1,222, 0, 0, 0, 20, 0, 0, 0, 37, 0, 2, 0, 70,
- 0, 71, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 8, 0, 7, 1,236, 0, 72, 0, 57, 0, 27, 0, 31, 0, 67, 1,186,
- 0, 12, 1,237, 0, 12, 1,205, 0, 32, 1,238, 0, 32, 1,239, 0, 32, 1,240, 0, 36, 0, 79, 0, 73, 1,241, 0, 38, 1,242,
- 0, 61, 1,206, 0, 12, 1,243, 0, 7, 1, 3, 0, 7, 0,175, 0, 7, 1, 4, 0, 4, 0,176, 0, 2, 1,244, 0, 2, 1,207,
- 0, 2, 0, 20, 0, 2, 1,245, 0, 7, 1,246, 0, 7, 1,247, 0, 7, 1,248, 0, 2, 1,225, 0, 2, 1,226, 0, 2, 1,249,
- 0, 2, 1,250, 0, 4, 0, 70, 0, 2, 0, 23, 0, 2, 0, 98, 0, 2, 0, 67, 0, 2, 1,251, 0, 7, 1,252, 0, 7, 1,253,
- 0, 7, 1,254, 0, 7, 1,255, 0, 7, 2, 0, 0, 7, 2, 1, 0, 7, 2, 2, 0, 7, 2, 3, 0, 7, 2, 4, 0, 7, 2, 5,
- 0, 0, 2, 6, 0, 0, 2, 7, 0, 64, 2, 8, 0, 64, 2, 9, 0, 64, 2, 10, 0, 64, 2, 11, 0, 4, 2, 12, 0, 4, 2, 13,
- 0, 4, 2, 14, 0, 4, 0, 37, 0, 71, 2, 15, 0, 4, 2, 16, 0, 4, 2, 17, 0, 70, 2, 18, 0, 70, 2, 19, 0, 74, 0, 39,
- 0, 27, 0, 31, 0, 67, 1,186, 0, 12, 2, 20, 0, 36, 0, 79, 0, 38, 1,242, 0, 61, 1,206, 0, 75, 2, 21, 0, 76, 2, 22,
- 0, 77, 2, 23, 0, 78, 2, 24, 0, 79, 2, 25, 0, 80, 2, 26, 0, 81, 2, 27, 0, 82, 2, 28, 0, 74, 2, 29, 0, 83, 2, 30,
- 0, 84, 2, 31, 0, 84, 2, 32, 0, 84, 2, 33, 0, 4, 0, 54, 0, 4, 2, 34, 0, 4, 2, 35, 0, 4, 2, 36, 0, 4, 2, 37,
- 0, 4, 0,176, 0, 7, 1, 3, 0, 7, 0,175, 0, 7, 1, 4, 0, 7, 2, 38, 0, 7, 0, 37, 0, 2, 2, 39, 0, 2, 0, 20,
- 0, 2, 2, 40, 0, 2, 2, 41, 0, 2, 1,207, 0, 2, 2, 42, 0, 85, 2, 43, 0, 86, 2, 44, 0, 9, 0,162, 0, 77, 0, 8,
- 0, 9, 2, 45, 0, 7, 2, 46, 0, 4, 2, 47, 0, 0, 0, 20, 0, 0, 2, 48, 0, 2, 1, 9, 0, 2, 2, 49, 0, 2, 2, 50,
- 0, 75, 0, 8, 0, 4, 2, 51, 0, 4, 2, 52, 0, 4, 2, 53, 0, 4, 2, 54, 0, 0, 0, 37, 0, 0, 1,222, 0, 0, 2, 55,
- 0, 0, 0, 20, 0, 79, 0, 5, 0, 4, 2, 51, 0, 4, 2, 52, 0, 0, 2, 56, 0, 0, 2, 57, 0, 2, 0, 20, 0, 87, 0, 2,
- 0, 4, 2, 58, 0, 7, 1,213, 0, 80, 0, 3, 0, 87, 2, 59, 0, 4, 2, 60, 0, 4, 0, 20, 0, 78, 0, 6, 0, 7, 2, 61,
- 0, 2, 2, 62, 0, 0, 0, 20, 0, 0, 1,222, 0, 0, 2, 57, 0, 0, 0,181, 0, 81, 0, 4, 0, 0, 0,206, 0, 0, 0,182,
- 0, 0, 0,183, 0, 0, 0,184, 0, 88, 0, 6, 0, 46, 2, 45, 0, 0, 0, 20, 0, 0, 2, 48, 0, 2, 1, 9, 0, 2, 2, 49,
- 0, 2, 2, 50, 0, 89, 0, 1, 0, 7, 2, 63, 0, 90, 0, 5, 0, 0, 0,206, 0, 0, 0,182, 0, 0, 0,183, 0, 0, 0,184,
- 0, 4, 0, 37, 0, 82, 0, 1, 0, 7, 2, 64, 0, 83, 0, 2, 0, 4, 2, 65, 0, 4, 0, 18, 0, 76, 0, 7, 0, 7, 2, 46,
- 0, 46, 2, 45, 0, 0, 0, 20, 0, 0, 2, 48, 0, 2, 1, 9, 0, 2, 2, 49, 0, 2, 2, 50, 0, 91, 0, 1, 0, 7, 2, 66,
- 0, 92, 0, 1, 0, 4, 2, 67, 0, 93, 0, 1, 0, 0, 2, 68, 0, 94, 0, 1, 0, 7, 2, 46, 0, 95, 0, 4, 0, 7, 0,206,
- 0, 7, 0,182, 0, 7, 0,183, 0, 7, 0,184, 0, 96, 0, 1, 0, 95, 2, 47, 0, 97, 0, 5, 0, 4, 2, 69, 0, 4, 2, 70,
- 0, 0, 0, 20, 0, 0, 1,222, 0, 0, 2, 71, 0, 98, 0, 2, 0, 4, 2, 72, 0, 4, 2, 70, 0, 99, 0, 14, 0, 99, 0, 0,
- 0, 99, 0, 1, 0, 97, 2, 73, 0, 96, 2, 74, 0, 98, 2, 75, 0, 0, 2, 76, 0, 12, 2, 77, 0, 12, 2, 78, 0,100, 2, 79,
- 0, 4, 0, 54, 0, 4, 2, 35, 0, 4, 2, 34, 0, 4, 0, 37, 0, 78, 2, 80, 0, 85, 0, 14, 0, 12, 2, 81, 0, 78, 2, 80,
- 0, 0, 2, 82, 0, 0, 2, 83, 0, 0, 2, 84, 0, 0, 2, 85, 0, 0, 2, 86, 0, 0, 2, 87, 0, 0, 2, 88, 0, 0, 0, 20,
- 0, 84, 2, 31, 0, 84, 2, 33, 0, 2, 2, 89, 0, 0, 2, 90, 0, 86, 0, 8, 0, 4, 2, 91, 0, 4, 2, 92, 0, 75, 2, 93,
- 0, 79, 2, 94, 0, 4, 2, 35, 0, 4, 2, 34, 0, 4, 0, 54, 0, 4, 0, 37, 0,101, 0, 6, 0,101, 0, 0, 0,101, 0, 1,
- 0, 4, 0, 18, 0, 4, 1, 9, 0, 0, 0, 17, 0, 0, 2, 95, 0,102, 0, 7, 0,101, 2, 96, 0, 2, 2, 97, 0, 2, 2, 81,
- 0, 2, 2, 98, 0, 2, 0, 93, 0, 9, 2, 99, 0, 9, 2,100, 0,103, 0, 3, 0,101, 2, 96, 0, 32, 0,167, 0, 0, 0, 17,
- 0,104, 0, 5, 0,101, 2, 96, 0, 32, 0,167, 0, 0, 0, 17, 0, 2, 2,101, 0, 0, 2,102, 0,105, 0, 5, 0,101, 2, 96,
- 0, 7, 0, 91, 0, 7, 2,103, 0, 4, 2,104, 0, 4, 2,105, 0,106, 0, 13, 0,101, 2, 96, 0, 32, 2,106, 0, 32, 2,107,
- 0, 32, 2,108, 0, 32, 2,109, 0, 7, 2,110, 0, 7, 2,111, 0, 7, 2,103, 0, 7, 2,112, 0, 4, 2,113, 0, 4, 2,114,
- 0, 4, 0, 93, 0, 4, 2,115, 0,107, 0, 5, 0,101, 2, 96, 0, 2, 2,116, 0, 2, 0, 20, 0, 7, 2,117, 0, 32, 2,118,
- 0,108, 0, 3, 0,101, 2, 96, 0, 7, 2,119, 0, 4, 0, 93, 0,109, 0, 10, 0,101, 2, 96, 0, 7, 2,120, 0, 4, 2,121,
- 0, 4, 0, 37, 0, 2, 0, 93, 0, 2, 2,122, 0, 2, 2,123, 0, 2, 2,124, 0, 7, 2,125, 0, 0, 2,126, 0,110, 0, 3,
- 0,101, 2, 96, 0, 7, 0, 37, 0, 4, 0, 18, 0,111, 0, 11, 0,101, 2, 96, 0, 51, 2,127, 0, 7, 2,128, 0, 4, 2,129,
- 0, 0, 2,126, 0, 7, 2,130, 0, 4, 2,131, 0, 32, 2,132, 0, 0, 2,133, 0, 4, 2,134, 0, 4, 0, 37, 0,112, 0, 10,
- 0,101, 2, 96, 0, 32, 2,135, 0, 46, 2,136, 0, 4, 0, 93, 0, 4, 2,137, 0, 7, 2,138, 0, 7, 2,139, 0, 0, 2,133,
- 0, 4, 2,134, 0, 4, 0, 37, 0,113, 0, 3, 0,101, 2, 96, 0, 7, 2,140, 0, 4, 2,141, 0,114, 0, 5, 0,101, 2, 96,
- 0, 7, 2,142, 0, 0, 2,126, 0, 2, 0, 20, 0, 2, 2,143, 0,115, 0, 8, 0,101, 2, 96, 0, 32, 0,167, 0, 7, 2,142,
- 0, 7, 1,214, 0, 7, 0,109, 0, 0, 2,126, 0, 2, 0, 20, 0, 2, 0, 18, 0,116, 0, 21, 0,101, 2, 96, 0, 32, 2,144,
- 0, 0, 2,126, 0, 51, 2,127, 0, 32, 2,132, 0, 2, 0, 20, 0, 2, 0, 37, 0, 7, 2,145, 0, 7, 2,146, 0, 7, 2,147,
- 0, 7, 1,246, 0, 7, 2,148, 0, 7, 2,149, 0, 7, 2,150, 0, 7, 2,151, 0, 4, 2,131, 0, 4, 2,134, 0, 0, 2,133,
- 0, 7, 2,152, 0, 7, 2,153, 0, 7, 0, 43, 0,117, 0, 7, 0,101, 2, 96, 0, 2, 2,154, 0, 2, 2,155, 0, 4, 0, 70,
- 0, 32, 0,167, 0, 7, 2,156, 0, 0, 2,126, 0,118, 0, 9, 0,101, 2, 96, 0, 32, 0,167, 0, 7, 2,157, 0, 7, 2,158,
- 0, 7, 2,151, 0, 4, 2,159, 0, 4, 2,160, 0, 7, 2,161, 0, 0, 0, 17, 0,119, 0, 1, 0,101, 2, 96, 0,120, 0, 5,
- 0,101, 2, 96, 0,121, 2,162, 0,122, 2,163, 0,123, 2,164, 0,124, 2,165, 0,125, 0, 14, 0,101, 2, 96, 0, 78, 2,166,
- 0, 78, 2,167, 0, 78, 2,168, 0, 78, 2,169, 0, 78, 2,170, 0, 78, 2,171, 0, 75, 2,172, 0, 4, 2,173, 0, 4, 2,174,
- 0, 2, 2,175, 0, 2, 0, 37, 0, 7, 2,176, 0,126, 2,177, 0,127, 0, 4, 0,101, 2, 96, 0, 32, 0,167, 0, 4, 2,178,
- 0, 4, 0, 37, 0,128, 0, 2, 0, 4, 2,179, 0, 7, 1,213, 0,129, 0, 2, 0, 4, 0,129, 0, 4, 2,180, 0,130, 0, 20,
- 0,101, 2, 96, 0, 32, 0,167, 0, 0, 2,126, 0, 2, 2,181, 0, 2, 2,182, 0, 2, 0, 20, 0, 2, 0, 37, 0, 7, 2,183,
- 0, 7, 2,184, 0, 4, 0, 54, 0, 4, 2,185, 0,129, 2,186, 0,128, 2,187, 0, 4, 2,188, 0, 4, 2,189, 0, 4, 2,190,
- 0, 4, 2,180, 0, 7, 2,191, 0, 7, 2,192, 0, 7, 2,193, 0,131, 0, 8, 0,101, 2, 96, 0,132, 2,194, 0,133, 2,195,
- 0, 4, 2,196, 0, 4, 2,197, 0, 4, 2,198, 0, 2, 0, 20, 0, 2, 0, 57, 0,134, 0, 5, 0,101, 2, 96, 0, 32, 0, 45,
- 0, 2, 2,199, 0, 2, 0, 20, 0, 2, 2,200, 0,135, 0, 5, 0,101, 2, 96, 0, 4, 2,201, 0, 2, 0, 20, 0, 2, 2,202,
- 0, 7, 2,203, 0,136, 0, 10, 0,101, 2, 96, 0, 32, 2,204, 0, 32, 2,205, 0, 0, 2,206, 0, 7, 2,207, 0, 2, 2,208,
- 0, 2, 2,209, 0, 0, 2,210, 0, 0, 2,211, 0, 0, 2,102, 0,137, 0, 24, 0, 27, 0, 31, 0, 2, 1,223, 0, 2, 1,224,
- 0, 2, 2,212, 0, 2, 0, 20, 0, 2, 2,213, 0, 2, 2,214, 0, 2, 2,215, 0, 2, 0, 70, 0, 0, 2,216, 0, 0, 2,217,
- 0, 0, 2,218, 0, 0, 0, 18, 0, 4, 0, 37, 0, 7, 2,219, 0, 7, 2,220, 0, 7, 2,221, 0, 7, 2,222, 0, 7, 2,223,
- 0, 7, 2,224, 0, 34, 2,225, 0, 36, 0, 79, 0, 38, 1,242, 0, 80, 2, 26, 0,138, 0, 3, 0,138, 0, 0, 0,138, 0, 1,
- 0, 0, 0, 17, 0, 67, 0, 3, 0, 7, 2,226, 0, 4, 0, 20, 0, 4, 0, 37, 0, 32, 0,108, 0, 27, 0, 31, 0, 2, 0, 18,
- 0, 2, 2,227, 0, 4, 2,228, 0, 4, 2,229, 0, 4, 2,230, 0, 0, 2,231, 0, 32, 0, 38, 0, 32, 2,232, 0, 32, 2,233,
- 0, 32, 2,234, 0, 32, 2,235, 0, 36, 0, 79, 0, 73, 1,241, 0, 67, 1,186, 0,139, 2,236, 0,139, 2,237, 0,140, 2,238,
- 0, 9, 0, 2, 0, 12, 2,239, 0, 12, 2, 20, 0, 12, 1,205, 0, 12, 2,240, 0, 12, 2,241, 0, 61, 1,206, 0, 7, 1, 3,
- 0, 7, 2,242, 0, 7, 2,243, 0, 7, 0,175, 0, 7, 2,244, 0, 7, 1, 4, 0, 7, 2,245, 0, 7, 2,246, 0, 7, 2,157,
- 0, 7, 2,247, 0, 7, 0,210, 0, 4, 2,248, 0, 2, 0, 20, 0, 2, 2,249, 0, 2, 2,250, 0, 2, 2,251, 0, 2, 2,252,
- 0, 2, 2,253, 0, 2, 2,254, 0, 2, 2,255, 0, 2, 3, 0, 0, 2, 3, 1, 0, 2, 3, 2, 0, 2, 3, 3, 0, 4, 3, 4,
- 0, 4, 3, 5, 0, 4, 3, 6, 0, 4, 3, 7, 0, 7, 3, 8, 0, 7, 3, 9, 0, 7, 3, 10, 0, 7, 3, 11, 0, 7, 3, 12,
- 0, 7, 3, 13, 0, 7, 3, 14, 0, 7, 3, 15, 0, 7, 3, 16, 0, 7, 1, 8, 0, 0, 3, 17, 0, 0, 3, 18, 0, 0, 1,207,
- 0, 0, 3, 19, 0, 0, 3, 20, 0, 0, 3, 21, 0, 7, 3, 22, 0, 7, 3, 23, 0, 39, 0,125, 0, 12, 3, 24, 0, 12, 3, 25,
- 0, 12, 3, 26, 0, 12, 3, 27, 0, 7, 3, 28, 0, 2, 2, 65, 0, 2, 3, 29, 0, 7, 2, 47, 0, 4, 3, 30, 0, 4, 3, 31,
- 0, 2, 3, 32, 0, 2, 0,217, 0, 7, 3, 33, 0, 12, 3, 34, 0, 12, 3, 35, 0, 12, 3, 36, 0, 12, 3, 37, 0,141, 3, 38,
- 0,142, 3, 39, 0, 63, 3, 40, 0, 2, 3, 41, 0, 2, 3, 42, 0, 2, 3, 43, 0, 2, 3, 44, 0, 7, 2, 39, 0, 2, 3, 45,
- 0, 2, 3, 46, 0,143, 3, 47, 0,133, 3, 48, 0,133, 3, 49, 0, 4, 3, 50, 0, 4, 3, 51, 0, 4, 3, 52, 0, 4, 0, 70,
- 0, 9, 0,162, 0, 12, 3, 53, 0,144, 0, 14, 0,144, 0, 0, 0,144, 0, 1, 0, 32, 0, 38, 0, 7, 2,157, 0, 7, 1, 5,
- 0, 7, 2,158, 0, 7, 2,151, 0, 0, 0, 17, 0, 4, 2,159, 0, 4, 2,160, 0, 4, 3, 54, 0, 2, 0, 18, 0, 2, 3, 55,
- 0, 7, 2,161, 0,141, 0, 36, 0, 2, 3, 56, 0, 2, 3, 57, 0, 2, 0, 20, 0, 2, 2,151, 0, 7, 3, 58, 0, 7, 3, 59,
- 0, 7, 3, 60, 0, 7, 3, 61, 0, 7, 3, 62, 0, 7, 3, 63, 0, 7, 3, 64, 0, 7, 3, 65, 0, 7, 3, 66, 0, 7, 3, 67,
- 0, 7, 3, 68, 0, 7, 3, 69, 0, 7, 3, 70, 0, 7, 3, 71, 0, 7, 3, 72, 0, 7, 3, 73, 0, 7, 3, 74, 0, 7, 3, 75,
- 0, 7, 3, 76, 0, 7, 3, 77, 0, 7, 3, 78, 0, 7, 3, 79, 0, 7, 3, 80, 0, 7, 3, 81, 0, 2, 3, 82, 0, 2, 3, 83,
- 0, 2, 3, 84, 0, 2, 3, 85, 0, 51, 0,168, 0,145, 3, 86, 0, 7, 3, 87, 0, 4, 0, 37, 0,124, 0, 5, 0, 4, 0, 20,
- 0, 4, 3, 88, 0, 4, 3, 89, 0, 4, 3, 90, 0, 4, 3, 91, 0,146, 0, 1, 0, 7, 1,221, 0,142, 0, 44, 0,132, 3, 92,
- 0, 4, 3, 93, 0, 4, 3, 94, 0,147, 3, 95, 0,148, 3, 96, 0, 7, 0, 37, 0, 7, 3, 97, 0, 7, 3, 98, 0, 7, 3, 99,
- 0, 7, 3,100, 0, 7, 3,101, 0, 7, 3,102, 0, 7, 3,103, 0, 7, 3,104, 0, 7, 3,105, 0, 7, 3,106, 0, 2, 3,107,
- 0, 2, 3,108, 0, 7, 3,109, 0, 7, 3,110, 0, 4, 0,130, 0, 4, 3,111, 0, 4, 3,112, 0, 2, 3,113, 0, 2, 3,114,
- 0,146, 3,115, 0, 4, 3,116, 0, 4, 0, 81, 0, 7, 3,117, 0, 7, 3,118, 0, 7, 3,119, 0, 7, 3,120, 0, 2, 3,121,
- 0, 2, 3,122, 0, 2, 3,123, 0, 2, 3,124, 0, 2, 3,125, 0, 2, 3,126, 0, 2, 3,127, 0, 2, 3,128, 0,149, 3,129,
- 0, 7, 3,130, 0, 7, 3,131, 0,124, 3,132, 0,143, 0, 40, 0, 2, 0, 18, 0, 2, 3,133, 0, 2, 3,134, 0, 2, 3,135,
- 0, 7, 3,136, 0, 2, 3,137, 0, 2, 3,138, 0, 7, 3,139, 0, 2, 3,140, 0, 2, 3,141, 0, 7, 3,142, 0, 7, 3,143,
- 0, 7, 3,144, 0, 7, 3,145, 0, 7, 3,146, 0, 7, 3,147, 0, 4, 3,148, 0, 7, 3,149, 0, 7, 3,150, 0, 7, 3,151,
- 0, 74, 3,152, 0, 74, 3,153, 0, 74, 3,154, 0, 0, 3,155, 0, 7, 3,156, 0, 7, 3,157, 0, 36, 0, 79, 0, 2, 3,158,
- 0, 0, 3,159, 0, 0, 3,160, 0, 7, 3,161, 0, 4, 3,162, 0, 7, 3,163, 0, 7, 3,164, 0, 4, 3,165, 0, 4, 3,166,
- 0, 7, 3,167, 0, 7, 3,168, 0, 7, 3,169, 0, 78, 3,170, 0,150, 0, 66, 0, 27, 0, 31, 0, 2, 0,177, 0, 2, 1, 10,
- 0, 2, 1, 43, 0, 2, 3,171, 0, 7, 3,172, 0, 7, 3,173, 0, 7, 3,174, 0, 7, 3,175, 0, 7, 3,176, 0, 7, 3,177,
- 0, 7, 3,178, 0, 7, 3,179, 0, 7, 1, 77, 0, 7, 1, 79, 0, 7, 1, 78, 0, 7, 3,180, 0, 4, 3,181, 0, 7, 3,182,
- 0, 7, 3,183, 0, 7, 3,184, 0, 7, 3,185, 0, 7, 3,186, 0, 7, 3,187, 0, 7, 3,188, 0, 2, 3,189, 0, 2, 1, 9,
- 0, 4, 3,190, 0, 7, 3,191, 0, 7, 3,192, 0, 7, 3,193, 0, 7, 3,194, 0, 7, 3,195, 0, 7, 3,196, 0, 7, 3,197,
- 0, 7, 3,198, 0, 7, 3,199, 0, 7, 3,200, 0, 7, 3,201, 0, 7, 3,202, 0, 2, 3,203, 0, 2, 3,204, 0, 2, 3,205,
- 0, 2, 3,206, 0, 7, 3,207, 0, 7, 3,208, 0, 7, 3,209, 0, 7, 3,210, 0, 2, 3,211, 0, 2, 3,212, 0, 2, 3,213,
- 0, 2, 3,214, 0, 7, 3,215, 0, 7, 3,216, 0, 7, 3,217, 0, 7, 3,218, 0, 2, 3,219, 0, 2, 3,220, 0, 2, 3,221,
- 0, 2, 0, 43, 0, 7, 3,222, 0, 7, 3,223, 0, 36, 0, 79, 0, 50, 1, 70, 0, 30, 0,153, 0, 39, 0,125, 0,151, 0, 16,
- 0, 2, 3,224, 0, 2, 3,225, 0, 2, 3,226, 0, 2, 0, 20, 0, 2, 3,227, 0, 2, 3,228, 0, 2, 3,229, 0, 2, 3,230,
- 0, 2, 3,231, 0, 2, 3,232, 0, 2, 3,233, 0, 2, 3,234, 0, 4, 3,235, 0, 7, 3,236, 0, 7, 3,237, 0, 7, 3,238,
- 0,152, 0, 8, 0,152, 0, 0, 0,152, 0, 1, 0, 4, 2,248, 0, 4, 3,239, 0, 4, 0, 20, 0, 2, 3,240, 0, 2, 3,241,
- 0, 32, 0,167, 0,153, 0, 13, 0, 9, 3,242, 0, 9, 3,243, 0, 4, 3,244, 0, 4, 3,245, 0, 4, 3,246, 0, 4, 3,247,
- 0, 4, 3,248, 0, 4, 3,249, 0, 4, 3,250, 0, 4, 3,251, 0, 4, 3,252, 0, 4, 0, 37, 0, 0, 3,253, 0,154, 0, 5,
- 0, 9, 3,254, 0, 9, 3,255, 0, 4, 4, 0, 0, 4, 0, 70, 0, 0, 4, 1, 0,155, 0, 13, 0, 4, 0, 18, 0, 4, 4, 2,
- 0, 4, 4, 3, 0, 4, 4, 4, 0, 4, 4, 5, 0, 4, 4, 6, 0, 4, 0, 93, 0, 4, 4, 7, 0, 4, 4, 8, 0, 4, 4, 9,
- 0, 4, 4, 10, 0, 4, 4, 11, 0, 26, 0, 30, 0,156, 0, 4, 0, 4, 4, 12, 0, 7, 4, 13, 0, 2, 0, 20, 0, 2, 0,181,
- 0,157, 0, 11, 0,157, 0, 0, 0,157, 0, 1, 0, 0, 0, 17, 0, 61, 4, 14, 0, 63, 4, 15, 0, 4, 2,248, 0, 4, 4, 16,
- 0, 4, 4, 17, 0, 4, 0, 37, 0, 4, 4, 18, 0, 4, 4, 19, 0,158, 0,120, 0,153, 4, 20, 0,154, 4, 21, 0,155, 4, 22,
- 0, 4, 4, 23, 0, 4, 0,130, 0, 4, 3,111, 0, 4, 4, 24, 0, 4, 4, 25, 0, 4, 4, 26, 0, 4, 4, 27, 0, 2, 0, 20,
- 0, 2, 4, 28, 0, 7, 3, 9, 0, 7, 4, 29, 0, 7, 4, 30, 0, 7, 4, 31, 0, 7, 4, 32, 0, 7, 4, 33, 0, 2, 4, 34,
- 0, 2, 4, 35, 0, 2, 4, 36, 0, 2, 4, 37, 0, 2, 0,216, 0, 2, 4, 38, 0, 2, 4, 39, 0, 2, 3, 85, 0, 2, 4, 40,
- 0, 2, 4, 41, 0, 2, 1, 30, 0, 2, 0,109, 0, 2, 4, 42, 0, 2, 4, 43, 0, 2, 4, 44, 0, 2, 4, 45, 0, 2, 4, 46,
- 0, 2, 4, 47, 0, 2, 4, 48, 0, 2, 4, 49, 0, 2, 4, 50, 0, 2, 1, 31, 0, 2, 4, 51, 0, 2, 4, 52, 0, 2, 4, 53,
- 0, 2, 4, 54, 0, 4, 4, 55, 0, 4, 1, 9, 0, 2, 4, 56, 0, 2, 4, 57, 0, 2, 4, 58, 0, 2, 4, 59, 0, 2, 4, 60,
- 0, 2, 4, 61, 0, 24, 4, 62, 0, 24, 4, 63, 0, 23, 4, 64, 0, 12, 4, 65, 0, 2, 4, 66, 0, 2, 0, 37, 0, 7, 4, 67,
- 0, 7, 4, 68, 0, 7, 4, 69, 0, 7, 4, 70, 0, 7, 4, 71, 0, 7, 4, 72, 0, 7, 4, 73, 0, 7, 4, 74, 0, 7, 4, 75,
- 0, 2, 4, 76, 0, 2, 4, 77, 0, 2, 4, 78, 0, 2, 4, 79, 0, 2, 4, 80, 0, 2, 4, 81, 0, 7, 4, 82, 0, 7, 4, 83,
- 0, 7, 4, 84, 0, 2, 4, 85, 0, 2, 4, 86, 0, 2, 4, 87, 0, 2, 4, 88, 0, 2, 4, 89, 0, 2, 4, 90, 0, 2, 4, 91,
- 0, 2, 4, 92, 0, 2, 4, 93, 0, 2, 4, 94, 0, 4, 4, 95, 0, 4, 4, 96, 0, 4, 4, 97, 0, 4, 4, 98, 0, 4, 4, 99,
- 0, 7, 4,100, 0, 4, 4,101, 0, 4, 4,102, 0, 4, 4,103, 0, 4, 4,104, 0, 7, 4,105, 0, 7, 4,106, 0, 7, 4,107,
- 0, 7, 4,108, 0, 7, 4,109, 0, 7, 4,110, 0, 7, 4,111, 0, 7, 4,112, 0, 7, 4,113, 0, 0, 4,114, 0, 0, 4,115,
- 0, 4, 4,116, 0, 2, 4,117, 0, 2, 1, 8, 0, 0, 4,118, 0, 7, 4,119, 0, 7, 4,120, 0, 4, 4,121, 0, 4, 4,122,
- 0, 7, 4,123, 0, 7, 4,124, 0, 2, 4,125, 0, 2, 4,126, 0, 7, 4,127, 0,159, 0, 9, 0,159, 0, 0, 0,159, 0, 1,
- 0, 0, 0, 17, 0, 2, 4,128, 0, 2, 4,129, 0, 2, 4,130, 0, 2, 0, 43, 0, 7, 4,131, 0, 7, 0, 70, 0,160, 0, 5,
- 0, 7, 4,132, 0, 0, 0, 18, 0, 0, 0, 43, 0, 0, 0, 70, 0, 0, 1, 8, 0,161, 0, 5, 0,161, 0, 0, 0,161, 0, 1,
- 0, 4, 4,133, 0, 0, 4,134, 0, 4, 0, 20, 0,162, 0, 4, 0,163, 4,135, 0, 2, 0, 20, 0, 2, 4,136, 0, 4, 1, 8,
- 0,164, 0, 4, 0, 2, 0,109, 0, 2, 2,128, 0, 2, 4,137, 0, 2, 4,138, 0,165, 0, 7, 0, 2, 0, 20, 0, 2, 4,139,
- 0, 2, 4,140, 0, 2, 4,141, 0,164, 4,142, 0, 7, 4,143, 0, 4, 4,144, 0,166, 0, 4, 0,166, 0, 0, 0,166, 0, 1,
- 0, 0, 4,145, 0, 7, 4,146, 0,167, 0, 42, 0, 2, 4,147, 0, 2, 4,148, 0, 7, 4,149, 0, 7, 4,150, 0, 2, 4,137,
- 0, 2, 4,151, 0, 7, 4,152, 0, 7, 4,153, 0, 2, 4,154, 0, 2, 4,155, 0, 2, 4,156, 0, 2, 4,157, 0, 7, 4,158,
- 0, 7, 4,159, 0, 2, 4,160, 0, 2, 4,161, 0, 2, 4,162, 0, 2, 4,163, 0,162, 4,164, 0,165, 4,165, 0, 7, 4,166,
- 0, 7, 4,167, 0, 0, 4,168, 0, 0, 4,169, 0, 0, 4,170, 0, 0, 4,171, 0, 0, 4,172, 0, 0, 4,173, 0, 2, 4,174,
- 0, 7, 4,175, 0, 7, 4,176, 0, 7, 4,177, 0, 7, 4,178, 0, 7, 4,179, 0, 7, 4,180, 0, 7, 4,181, 0, 2, 4,182,
- 0, 0, 4,183, 0, 0, 4,184, 0, 0, 4,185, 0, 0, 4,186, 0, 0, 4,187, 0,168, 0, 6, 0, 2, 0,109, 0, 0, 2,128,
- 0, 0, 4,188, 0, 0, 4,189, 0, 0, 0, 20, 0, 0, 2, 71, 0,169, 0, 26, 0,170, 4,190, 0, 50, 1, 70, 0, 59, 4,191,
- 0,168, 4,192, 0,168, 4,193, 0,168, 4,194, 0,168, 4,195, 0,168, 4,196, 0,168, 4,197, 0,168, 4,198, 0, 7, 4,199,
- 0, 2, 4,200, 0, 2, 1, 43, 0, 2, 4,201, 0, 2, 1,252, 0, 0, 4,202, 0, 0, 4,203, 0, 0, 4,204, 0, 0, 4,205,
- 0, 0, 0, 93, 0, 0, 4,206, 0, 0, 4,207, 0, 0, 4,208, 0, 0, 4,209, 0, 0, 4,210, 0, 0, 2, 71, 0,171, 0, 43,
- 0, 27, 0, 31, 0, 32, 4,211, 0,150, 4,212, 0,171, 4,213, 0, 46, 0,208, 0, 12, 4,214, 0,152, 4,215, 0, 7, 4,216,
- 0, 7, 4,217, 0, 7, 4,218, 0, 7, 4,219, 0, 4, 2,248, 0, 7, 4,220, 0, 2, 4,221, 0, 2, 4,222, 0, 2, 4,223,
- 0, 2, 4,224, 0, 2, 4,225, 0, 2, 4,226, 0, 2, 4,227, 0, 2, 1,135, 0, 62, 1,156, 0, 9, 4,228, 0,151, 4,229,
- 0,160, 4,230, 0,167, 4,231, 0,158, 0,182, 0,156, 4,232, 0, 39, 0,125, 0, 12, 0,103, 0, 12, 4,233, 0, 2, 4,234,
- 0, 2, 4,235, 0, 2, 4,236, 0, 2, 4,237, 0,172, 4,238, 0, 2, 4,239, 0, 2, 4,240, 0, 2, 1,138, 0, 2, 0,217,
- 0,169, 4,241, 0, 4, 4,242, 0, 4, 0, 37, 0,173, 0, 9, 0, 46, 0,208, 0, 45, 0,255, 0, 7, 2, 3, 0, 7, 2, 4,
- 0, 7, 0,109, 0, 7, 4,243, 0, 7, 4,244, 0, 2, 4,245, 0, 2, 4,246, 0,174, 0, 70, 0,175, 0, 0, 0,175, 0, 1,
- 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0, 7, 4,251, 0, 7, 4,252, 0, 7, 4,253, 0, 7, 4,254,
- 0, 7, 4,255, 0, 7, 5, 0, 0, 7, 5, 1, 0, 7, 1, 16, 0, 7, 5, 2, 0, 4, 5, 3, 0, 2, 5, 4, 0, 2, 4,189,
- 0, 32, 4,211, 0, 32, 5, 5, 0,173, 5, 6, 0,174, 5, 7, 0,177, 5, 8, 0,178, 5, 9, 0,179, 5, 10, 0, 0, 5, 11,
- 0, 2, 3,226, 0, 2, 5, 12, 0, 4, 2,248, 0, 4, 5, 13, 0, 2, 5, 14, 0, 2, 5, 15, 0, 2, 5, 16, 0, 0, 5, 17,
- 0, 0, 0, 43, 0, 7, 0,115, 0, 7, 5, 18, 0, 7, 5, 19, 0, 7, 5, 20, 0, 7, 5, 21, 0, 7, 5, 22, 0, 7, 5, 23,
- 0, 7, 5, 24, 0, 7, 0,174, 0, 7, 4,216, 0, 2, 5, 25, 0, 2, 5, 26, 0, 2, 5, 27, 0, 2, 5, 28, 0, 2, 0,137,
- 0, 2, 4,201, 0, 2, 5, 29, 0, 2, 5, 30, 0, 2, 5, 31, 0, 2, 5, 32, 0, 7, 5, 33, 0, 7, 5, 34, 0, 67, 5, 35,
- 0, 12, 5, 36, 0, 2, 5, 37, 0, 2, 2, 48, 0, 2, 5, 38, 0, 2, 0, 20, 0, 2, 5, 39, 0, 2, 5, 40, 0, 2, 1, 8,
- 0, 0, 5, 41, 0, 0, 5, 42, 0, 9, 5, 43, 0,180, 5, 44, 0,181, 0, 19, 0, 24, 0, 36, 0, 24, 0, 64, 0, 23, 5, 45,
- 0, 23, 5, 46, 0, 23, 5, 47, 0, 7, 5, 48, 0, 7, 5, 49, 0, 7, 5, 50, 0, 7, 5, 51, 0, 2, 5, 52, 0, 2, 5, 53,
- 0, 2, 5, 54, 0, 2, 5, 55, 0, 2, 5, 56, 0, 2, 5, 57, 0, 4, 0, 20, 0, 7, 5, 58, 0, 2, 5, 15, 0, 0, 2,102,
- 0,175, 0, 6, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0,182, 0, 6,
- 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0,183, 0, 27, 0,175, 0, 0,
- 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0, 4, 5, 59, 0, 4, 0, 70, 0,181, 5, 60,
- 0, 9, 5, 61, 0, 12, 5, 62, 0, 36, 0, 79, 0, 27, 0, 80, 0, 0, 5, 63, 0, 0, 5, 64, 0, 0, 5, 65, 0, 2, 5, 66,
- 0, 2, 5, 67, 0, 2, 5, 68, 0, 2, 5, 69, 0, 2, 0, 65, 0, 2, 0, 46, 0, 2, 0,137, 0, 2, 5, 70, 0, 4, 0, 20,
- 0, 7, 5, 71, 0, 24, 0, 36, 0,184, 0, 29, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249,
- 0,177, 5, 8, 0, 2, 4,250, 0, 2, 5, 72, 0, 2, 5, 73, 0, 2, 5, 74, 0, 2, 5, 75, 0,181, 5, 60, 0, 2, 5, 76,
- 0, 2, 0,137, 0, 2, 5, 67, 0, 2, 5, 77, 0, 9, 5, 78, 0, 2, 4,201, 0, 0, 5, 79, 0, 0, 5, 80, 0, 2, 5, 81,
- 0, 2, 5, 82, 0, 2, 3, 1, 0, 2, 5, 83, 0, 2, 5, 84, 0, 0, 0, 37, 0, 0, 0, 20, 0, 0, 1, 43, 0, 0, 5, 85,
- 0,185, 0, 16, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0,181, 5, 60,
- 0, 7, 2, 3, 0, 7, 2, 4, 0, 2, 5, 76, 0, 2, 0, 37, 0, 2, 5, 86, 0, 2, 5, 87, 0, 4, 0, 20, 0, 7, 4,243,
- 0,180, 5, 44, 0,186, 0, 33, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250,
- 0,187, 5, 88, 0, 4, 5, 89, 0, 0, 5, 90, 0, 0, 5, 91, 0, 0, 5, 92, 0, 2, 0, 18, 0, 2, 5, 93, 0, 2, 0, 20,
- 0, 2, 5, 94, 0, 2, 5, 95, 0, 2, 5, 96, 0, 2, 5, 97, 0, 2, 0, 43, 0, 4, 0, 70, 0, 0, 5, 98, 0,188, 5, 99,
- 0, 2, 5,100, 0, 2, 5,101, 0, 2, 5,102, 0, 2, 0,207, 0, 9, 5,103, 0, 9, 5,104, 0, 9, 5,105, 0, 9, 5,106,
- 0, 9, 5,107, 0, 2, 5,108, 0, 0, 5,109, 0,189, 0, 23, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248,
- 0,176, 4,249, 0, 2, 4,250, 0,181, 5, 60, 0, 12, 5,110, 0, 2, 5, 67, 0, 2, 5,111, 0, 2, 0, 20, 0, 2, 0, 57,
- 0, 9, 5, 78, 0, 12, 5,112, 0,190, 5,113, 0, 0, 5,114, 0,191, 5,115, 0, 4, 5,116, 0, 4, 5,117, 0, 2, 0, 18,
- 0, 2, 5,118, 0, 2, 5,119, 0, 2, 5,120, 0,192, 0, 29, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248,
- 0,176, 4,249, 0, 2, 4,250, 0,181, 5, 60, 0, 46, 2,136, 0, 45, 0,255, 0, 59, 4,191, 0, 2, 1, 9, 0, 2, 0,137,
- 0, 2, 5,121, 0, 2, 5,122, 0, 4, 0, 20, 0, 2, 4,221, 0, 2, 5,123, 0, 2, 5, 70, 0, 2, 5, 67, 0, 7, 4,243,
- 0, 0, 5,124, 0, 0, 5,125, 0, 0, 5,126, 0, 0, 5,127, 0, 7, 2, 3, 0, 7, 2, 4, 0, 7, 5,128, 0, 7, 5,129,
- 0,180, 5, 44, 0,193, 0, 11, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250,
- 0, 2, 0,137, 0, 2, 5, 70, 0, 2, 5,130, 0, 2, 0, 20, 0,181, 5, 60, 0,194, 0, 24, 0,175, 0, 0, 0,175, 0, 1,
- 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0, 42, 5,131, 0, 4, 5,132, 0, 4, 5,133, 0, 2, 0, 93,
- 0, 2, 0,137, 0, 4, 5,134, 0, 4, 5,135, 0, 4, 5,136, 0, 4, 5,137, 0, 4, 5,138, 0, 4, 5,139, 0, 4, 5,140,
- 0, 4, 5,141, 0, 7, 5,142, 0, 23, 5,143, 0, 23, 5,144, 0, 4, 5,145, 0, 4, 5,146, 0,195, 0, 10, 0, 27, 0, 31,
- 0, 9, 5,147, 0, 9, 5,148, 0, 9, 5,149, 0, 9, 5,150, 0, 9, 5,151, 0, 4, 0, 93, 0, 4, 5,152, 0, 0, 5,153,
- 0, 0, 5,154, 0,196, 0, 10, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0,195, 5,155,
- 0, 2, 0, 93, 0, 2, 0,137, 0, 4, 0, 43, 0, 9, 5,156, 0,197, 0, 8, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247,
- 0, 7, 4,248, 0,176, 4,249, 0,181, 5, 60, 0, 4, 0, 20, 0, 4, 5,157, 0,198, 0, 20, 0,175, 0, 0, 0,175, 0, 1,
- 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0,181, 5, 60, 0, 27, 5,158, 0, 27, 0, 80, 0, 2, 0, 20,
- 0, 2, 0,137, 0, 7, 5,159, 0, 9, 5,160, 0, 7, 2, 3, 0, 7, 2, 4, 0, 62, 1,156, 0, 62, 5,161, 0, 4, 5,162,
- 0, 4, 0, 37, 0,180, 5, 44, 0,199, 0, 42, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249,
- 0, 2, 4,250, 0,181, 5, 60, 0,200, 5,163, 0, 0, 5, 90, 0, 0, 5, 91, 0, 0, 5, 92, 0, 2, 0, 18, 0, 2, 5,101,
- 0, 2, 0, 20, 0, 2, 5, 94, 0, 9, 5,160, 0, 4, 5,164, 0, 4, 5,165, 0, 4, 5,166, 0, 4, 5,167, 0, 23, 5,168,
- 0, 23, 5,169, 0, 7, 5,170, 0, 7, 5,171, 0, 7, 5,172, 0, 7, 5,159, 0, 2, 5,100, 0, 2, 0,207, 0, 2, 1, 95,
- 0, 2, 5,173, 0, 2, 0, 37, 0, 2, 0, 43, 0, 2, 5,174, 0, 2, 5,175, 0, 9, 5,103, 0, 9, 5,104, 0, 9, 5,105,
- 0, 9, 5,106, 0, 9, 5,107, 0, 2, 5,108, 0, 0, 5,109, 0, 56, 5,176, 0,201, 0, 20, 0, 0, 5,177, 0, 0, 5,178,
- 0, 0, 5,179, 0, 0, 5,180, 0, 0, 5,181, 0, 0, 5,182, 0, 0, 5,183, 0, 0, 5,184, 0, 0, 5,185, 0, 0, 5,186,
- 0, 0, 5,187, 0, 0, 5,188, 0, 0, 5,189, 0, 0, 5,190, 0, 0, 5,191, 0, 0, 5,192, 0, 0, 5,193, 0, 0, 5,194,
- 0, 0, 0,181, 0, 0, 5,195, 0,202, 0, 54, 0, 0, 5,196, 0, 0, 5,187, 0, 0, 5,188, 0, 0, 5,197, 0, 0, 5,198,
- 0, 0, 5,199, 0, 0, 5,200, 0, 0, 5,201, 0, 0, 5,202, 0, 0, 5,203, 0, 0, 5,204, 0, 0, 5,205, 0, 0, 5,206,
- 0, 0, 5,207, 0, 0, 5,208, 0, 0, 5,209, 0, 0, 5,210, 0, 0, 5,211, 0, 0, 5,212, 0, 0, 5,213, 0, 0, 5,214,
- 0, 0, 5,215, 0, 0, 5,216, 0, 0, 5,217, 0, 0, 5,218, 0, 0, 5,219, 0, 0, 5,220, 0, 0, 5,221, 0, 0, 5,222,
- 0, 0, 5,223, 0, 0, 5,224, 0, 0, 5,225, 0, 0, 0, 95, 0, 0, 5,226, 0, 0, 5,227, 0, 0, 5,228, 0, 0, 5,229,
- 0, 0, 5,230, 0, 0, 5,231, 0, 0, 5,232, 0, 0, 5,233, 0, 0, 5,234, 0, 0, 5,235, 0, 0, 5,236, 0, 0, 5,237,
- 0, 0, 5,238, 0, 0, 5,239, 0, 0, 5,240, 0, 0, 5,241, 0, 0, 5,242, 0, 0, 5,243, 0, 0, 5,244, 0, 0, 5,245,
- 0, 0, 5,246, 0,203, 0, 5, 0, 0, 5,247, 0, 0, 5,204, 0, 0, 5,206, 0, 2, 0, 20, 0, 2, 0, 37, 0,204, 0, 22,
- 0,204, 0, 0, 0,204, 0, 1, 0, 0, 0, 17, 0,201, 5,248, 0,202, 5,249, 0,202, 5,250, 0,202, 5,251, 0,202, 5,252,
- 0,202, 5,253, 0,202, 5,254, 0,202, 5,255, 0,202, 6, 0, 0,202, 6, 1, 0,202, 6, 2, 0,202, 6, 3, 0,202, 6, 4,
- 0,202, 6, 5, 0,202, 6, 6, 0,202, 6, 7, 0,203, 6, 8, 0, 0, 6, 9, 0, 0, 6, 10, 0,205, 0, 5, 0, 4, 0, 20,
- 0, 4, 0, 37, 0, 7, 2, 47, 0, 7, 6, 11, 0, 7, 1,221, 0,206, 0, 65, 0, 4, 0, 20, 0, 4, 6, 12, 0, 4, 6, 13,
- 0, 0, 6, 14, 0, 0, 6, 15, 0, 0, 6, 16, 0, 0, 6, 17, 0, 0, 6, 18, 0, 0, 6, 19, 0, 0, 6, 20, 0, 0, 6, 21,
- 0, 0, 6, 22, 0, 2, 6, 23, 0, 2, 6, 24, 0, 4, 6, 25, 0, 4, 6, 26, 0, 4, 6, 27, 0, 4, 6, 28, 0, 2, 6, 29,
- 0, 2, 6, 30, 0, 2, 6, 31, 0, 2, 6, 32, 0, 4, 6, 33, 0, 4, 6, 34, 0, 2, 6, 35, 0, 2, 6, 36, 0, 2, 6, 37,
- 0, 2, 6, 38, 0, 0, 6, 39, 0, 12, 6, 40, 0, 2, 6, 41, 0, 2, 6, 42, 0, 2, 6, 43, 0, 2, 6, 44, 0, 2, 0, 37,
- 0, 2, 6, 45, 0, 2, 6, 46, 0, 2, 6, 47, 0,205, 6, 48, 0, 2, 6, 49, 0, 2, 6, 50, 0, 2, 6, 51, 0, 2, 6, 52,
- 0, 4, 6, 53, 0, 4, 6, 54, 0, 4, 6, 55, 0, 4, 6, 56, 0, 2, 6, 57, 0, 2, 6, 58, 0, 2, 6, 59, 0, 2, 6, 60,
- 0, 2, 6, 61, 0, 2, 6, 62, 0, 2, 6, 63, 0, 2, 6, 64, 0, 2, 6, 65, 0, 2, 6, 66, 0, 2, 6, 67, 0, 0, 6, 68,
- 0, 0, 6, 69, 0, 0, 6, 70, 0, 7, 6, 71, 0, 2, 6, 72, 0, 2, 6, 73, 0, 54, 6, 74, 0,207, 0, 18, 0, 27, 0, 31,
- 0, 12, 6, 75, 0, 12, 6, 76, 0, 12, 6, 77, 0,171, 6, 78, 0, 2, 2,145, 0, 2, 6, 79, 0, 2, 2,146, 0, 2, 6, 80,
- 0, 2, 6, 81, 0, 2, 6, 82, 0, 2, 6, 83, 0, 2, 6, 84, 0, 2, 6, 85, 0, 2, 0, 37, 0, 2, 6, 86, 0, 2, 6, 87,
- 0, 2, 6, 88, 0,208, 0, 5, 0,208, 0, 0, 0,208, 0, 1, 0,208, 6, 89, 0, 13, 6, 90, 0, 4, 0, 20, 0,209, 0, 7,
- 0,209, 0, 0, 0,209, 0, 1, 0,208, 6, 91, 0,208, 6, 92, 0, 2, 4, 63, 0, 2, 0, 20, 0, 4, 0, 37, 0,210, 0, 17,
- 0,210, 0, 0, 0,210, 0, 1, 0, 0, 6, 93, 0, 0, 6, 94, 0, 0, 6, 95, 0, 2, 6, 96, 0, 2, 6, 97, 0, 2, 6, 81,
- 0, 2, 6, 82, 0, 2, 0, 20, 0, 2, 3, 55, 0, 2, 6, 98, 0, 2, 6, 99, 0, 2, 6,100, 0, 2, 6,101, 0, 4, 6,102,
- 0,210, 6,103, 0,176, 0, 30, 0,176, 0, 0, 0,176, 0, 1, 0,208, 6, 91, 0,208, 6, 92, 0,208, 6,104, 0,208, 6,105,
- 0,207, 6,106, 0, 7, 6,107, 0, 23, 0, 52, 0, 23, 6,108, 0, 23, 6,109, 0, 2, 6,110, 0, 2, 6,111, 0, 2, 6,112,
- 0, 0, 4,247, 0, 0, 6,113, 0, 2, 6,114, 0, 2, 6,115, 0, 0, 6,116, 0, 0, 6,117, 0, 0, 6,118, 0, 0, 6,119,
- 0, 2, 6,120, 0, 2, 6,121, 0, 2, 6,122, 0, 2, 0, 20, 0, 39, 0,125, 0, 12, 6,123, 0, 12, 6,124, 0, 12, 6,125,
- 0,211, 0, 11, 0, 0, 6,126, 0, 2, 6,127, 0, 2, 6,128, 0, 2, 6,129, 0, 2, 6,130, 0, 2, 6,131, 0, 2, 4, 47,
- 0, 9, 6,132, 0, 9, 6,133, 0, 4, 6,134, 0, 4, 6,135, 0,212, 0, 1, 0, 0, 6,136, 0,213, 0, 8, 0, 56, 6,137,
- 0, 56, 6,138, 0,213, 6,139, 0,213, 6,140, 0,213, 6,141, 0, 2, 0,133, 0, 2, 0, 20, 0, 4, 6,142, 0,214, 0, 4,
- 0, 4, 5,132, 0, 4, 6,143, 0, 4, 5,136, 0, 4, 6,144, 0,215, 0, 2, 0, 4, 6,145, 0, 4, 6,146, 0,216, 0, 7,
- 0, 7, 6,147, 0, 7, 6,148, 0, 7, 6,149, 0, 4, 0, 20, 0, 4, 0, 37, 0, 7, 3,182, 0, 7, 6,150, 0,217, 0, 1,
- 0, 0, 6,151, 0,218, 0, 21, 0,218, 0, 0, 0,218, 0, 1, 0, 4, 0, 57, 0, 4, 0, 23, 0, 4, 0, 28, 0, 4, 6,152,
- 0, 4, 6,153, 0, 4, 6,154, 0,212, 6,155, 0, 0, 6,151, 0, 4, 6,156, 0, 4, 6,157, 0,217, 2,233, 0,214, 6,158,
- 0,215, 6,159, 0,216, 6,160, 0,213, 6,161, 0,213, 6,162, 0,213, 6,163, 0, 56, 6,164, 0, 56, 6,165, 0,219, 0, 12,
- 0, 0, 1,184, 0, 9, 0,193, 0, 0, 0,194, 0, 4, 0,197, 0, 4, 0,205, 0, 9, 0,198, 0, 7, 0,200, 0, 7, 0,201,
- 0, 9, 6,166, 0, 9, 6,167, 0, 9, 0,202, 0, 9, 0,204, 0,220, 0, 45, 0,220, 0, 0, 0,220, 0, 1, 0, 9, 6,168,
- 0, 9, 0, 26, 0, 0, 0, 27, 0, 4, 0, 20, 0, 4, 0, 18, 0, 4, 0, 23, 0, 4, 0, 91, 0, 4, 6,169, 0, 4, 6,170,
- 0, 4, 6,153, 0, 4, 6,154, 0, 4, 6,171, 0, 4, 0,216, 0, 4, 6,172, 0, 4, 6,173, 0, 7, 6,174, 0, 7, 6,175,
- 0, 4, 0,130, 0, 4, 6,176, 0,218, 6,177, 0, 36, 0, 79, 0,171, 6, 78, 0, 48, 0,140, 0, 7, 6,178, 0, 7, 6,179,
- 0,219, 1, 0, 0,220, 6,180, 0,220, 6,181, 0,220, 6,182, 0, 12, 6,183, 0,221, 6,184, 0,222, 6,185, 0, 7, 6,186,
- 0, 7, 6,187, 0, 4, 6,188, 0, 7, 6,189, 0, 9, 6,190, 0, 4, 6,191, 0, 4, 6,192, 0, 4, 6,193, 0, 7, 6,194,
- 0, 4, 6, 83, 0, 4, 0, 37, 0,223, 0, 4, 0,223, 0, 0, 0,223, 0, 1, 0, 12, 6,195, 0,220, 6,196, 0,224, 0, 6,
- 0, 12, 6,197, 0, 12, 6,183, 0, 12, 6,198, 0, 2, 0, 20, 0, 2, 0, 37, 0, 4, 0, 57, 0,225, 0, 4, 0, 7, 6,199,
- 0, 7, 0,112, 0, 2, 6,200, 0, 2, 6,201, 0,226, 0, 6, 0, 7, 6,202, 0, 7, 6,203, 0, 7, 6,204, 0, 7, 6,205,
- 0, 4, 6,206, 0, 4, 6,207, 0,227, 0, 12, 0, 7, 6,208, 0, 7, 6,209, 0, 7, 6,210, 0, 7, 6,211, 0, 7, 6,212,
- 0, 7, 6,213, 0, 7, 6,214, 0, 7, 6,215, 0, 7, 6,216, 0, 7, 6,217, 0, 4, 2,140, 0, 4, 6,218, 0,228, 0, 2,
- 0, 7, 4,132, 0, 7, 0, 37, 0,229, 0, 5, 0, 7, 6,219, 0, 7, 6,220, 0, 4, 0, 93, 0, 4, 2,103, 0, 4, 6,221,
- 0,230, 0, 6, 0,230, 0, 0, 0,230, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 6,222, 0, 2, 0, 57, 0,231, 0, 8,
- 0,231, 0, 0, 0,231, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 6,222, 0, 2, 0, 57, 0, 7, 0, 23, 0, 7, 0,130,
- 0,232, 0, 45, 0,232, 0, 0, 0,232, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 6,222, 0, 2, 0,212, 0, 2, 3,107,
- 0, 2, 6,223, 0, 7, 6,224, 0, 7, 0, 92, 0, 7, 2,153, 0, 4, 6,225, 0, 4, 0, 81, 0, 4, 2,105, 0, 7, 6,226,
- 0, 7, 6,227, 0, 7, 6,228, 0, 7, 6,229, 0, 7, 6,230, 0, 7, 6,231, 0, 7, 2,150, 0, 7, 0,254, 0, 7, 6,232,
- 0, 7, 6,233, 0, 7, 0, 37, 0, 7, 6,234, 0, 7, 6,235, 0, 7, 6,236, 0, 2, 6,237, 0, 2, 6,238, 0, 2, 6,239,
- 0, 2, 6,240, 0, 2, 6,241, 0, 2, 6,242, 0, 2, 6,243, 0, 2, 6,244, 0, 2, 5, 39, 0, 2, 6,245, 0, 2, 1,205,
- 0, 2, 6,246, 0, 0, 6,247, 0, 0, 6,248, 0, 7, 0,210, 0,233, 6,249, 0, 63, 1,157, 0,234, 0, 16, 0,234, 0, 0,
- 0,234, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 6,222, 0, 2, 0,212, 0, 7, 2,145, 0, 7, 2,146, 0, 7, 2,147,
- 0, 7, 1,246, 0, 7, 2,148, 0, 7, 2,149, 0, 7, 6,250, 0, 7, 2,150, 0, 7, 2,152, 0, 7, 2,153, 0,191, 0, 5,
- 0, 2, 0, 18, 0, 2, 6,142, 0, 2, 0, 20, 0, 2, 6,251, 0, 27, 5,158, 0,190, 0, 3, 0, 4, 0, 69, 0, 4, 6,252,
- 0,191, 0, 2, 0,235, 0, 12, 0,235, 0, 0, 0,235, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 3, 17, 0, 2, 1,220,
- 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 6,253, 0, 7, 6,254, 0, 27, 5,158, 0, 12, 6,255, 0,236, 0, 11, 0,236, 0, 0,
- 0,236, 0, 1, 0, 0, 0, 17, 0, 2, 0, 18, 0, 2, 7, 0, 0, 4, 0, 22, 0, 4, 7, 1, 0, 2, 0, 20, 0, 2, 0, 37,
- 0, 9, 7, 2, 0, 9, 7, 3, 0,237, 0, 5, 0, 0, 0, 17, 0, 7, 1, 16, 0, 7, 7, 4, 0, 4, 7, 5, 0, 4, 0, 37,
- 0,238, 0, 4, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 0, 43, 0, 2, 0, 70, 0,239, 0, 4, 0, 0, 0, 17, 0, 61, 7, 6,
- 0, 7, 1, 16, 0, 7, 0, 37, 0,240, 0, 6, 0, 2, 7, 7, 0, 2, 7, 8, 0, 2, 0, 18, 0, 2, 7, 9, 0, 0, 7, 10,
- 0, 0, 7, 11, 0,241, 0, 5, 0, 4, 0, 18, 0, 4, 0, 37, 0, 0, 0, 17, 0, 0, 7, 12, 0, 0, 7, 13, 0,242, 0, 3,
- 0, 4, 0, 18, 0, 4, 0, 37, 0, 0, 0, 17, 0,243, 0, 4, 0, 2, 7, 14, 0, 2, 7, 15, 0, 2, 0, 20, 0, 2, 0, 37,
- 0,244, 0, 6, 0, 0, 0, 17, 0, 0, 7, 16, 0, 2, 7, 17, 0, 2, 2,150, 0, 2, 1, 9, 0, 2, 0, 70, 0,245, 0, 5,
- 0, 0, 0, 17, 0, 7, 0,112, 0, 7, 3,184, 0, 2, 0, 20, 0, 2, 2,116, 0,246, 0, 3, 0, 0, 0, 17, 0, 4, 2,105,
- 0, 4, 7, 14, 0,247, 0, 7, 0, 0, 0, 17, 0, 7, 3,184, 0, 0, 7, 18, 0, 0, 7, 19, 0, 2, 1, 9, 0, 2, 0, 43,
- 0, 4, 7, 20, 0,248, 0, 3, 0, 32, 7, 21, 0, 0, 7, 22, 0, 0, 7, 23, 0,249, 0, 17, 0,249, 0, 0, 0,249, 0, 1,
- 0, 2, 0, 18, 0, 2, 7, 0, 0, 2, 0, 20, 0, 2, 7, 24, 0, 2, 7, 25, 0, 2, 7, 26, 0, 2, 0, 43, 0, 2, 0, 70,
- 0, 0, 0, 17, 0, 9, 0, 2, 0,250, 7, 27, 0, 32, 0, 45, 0, 2, 4,138, 0, 2, 6,186, 0, 4, 0, 37, 0,251, 0, 10,
- 0, 0, 0, 17, 0, 2, 0, 18, 0, 2, 7, 28, 0, 4, 2,116, 0, 4, 7, 29, 0, 4, 7, 30, 0, 4, 7, 31, 0, 4, 7, 32,
- 0, 4, 7, 33, 0, 4, 7, 34, 0,252, 0, 1, 0, 0, 7, 35, 0,253, 0, 1, 0, 42, 5,131, 0,250, 0, 18, 0,250, 0, 0,
- 0,250, 0, 1, 0,250, 7, 36, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 7, 37, 0, 2, 7, 26, 0, 2, 7, 0, 0, 2, 7, 38,
- 0, 2, 0, 70, 0, 2, 1, 8, 0, 0, 0, 17, 0, 9, 0, 2, 0,254, 7, 27, 0,249, 7, 39, 0, 2, 0, 15, 0, 2, 7, 40,
- 0, 4, 7, 41, 0,255, 0, 3, 0, 4, 2,176, 0, 4, 0, 37, 0, 32, 0, 45, 1, 0, 0, 12, 0,139, 7, 42, 0, 2, 0, 18,
- 0, 2, 0, 20, 0, 4, 6,224, 0, 4, 0, 92, 0, 0, 0, 17, 0, 0, 7, 43, 0, 2, 7, 44, 0, 2, 7, 45, 0, 2, 7, 46,
- 0, 2, 7, 47, 0, 7, 7, 48, 1, 1, 0, 10, 0, 2, 0, 20, 0, 2, 7, 49, 0, 4, 6,224, 0, 4, 0, 92, 0, 2, 7, 50,
- 0,221, 6,184, 0, 2, 0, 18, 0, 2, 7, 51, 0, 2, 7, 52, 0, 2, 7, 53, 1, 2, 0, 7, 0, 2, 0, 20, 0, 2, 7, 49,
- 0, 4, 6,224, 0, 4, 0, 92, 0, 2, 0, 18, 0, 2, 7, 54, 0, 7, 7, 55, 1, 3, 0, 11, 0, 4, 2,176, 0, 2, 0, 18,
- 0, 2, 0, 20, 0, 32, 0, 45, 0, 74, 7, 56, 0, 0, 0, 17, 0, 7, 7, 57, 0, 7, 7, 58, 0, 7, 0, 37, 0, 2, 7, 59,
- 0, 2, 7, 60, 1, 4, 0, 5, 0, 2, 0, 18, 0, 2, 0, 20, 0, 4, 0, 37, 0,171, 6, 78, 0, 32, 4,211, 1, 5, 0, 5,
- 0, 4, 0, 20, 0, 4, 0, 18, 0, 0, 0, 17, 0, 0, 7, 12, 0, 32, 0, 45, 1, 6, 0, 12, 0, 2, 0, 20, 0, 2, 0, 18,
- 0, 2, 7, 0, 0, 2, 3, 11, 0, 7, 7, 61, 0, 7, 7, 62, 0, 7, 1, 3, 0, 7, 1, 4, 0, 7, 2,242, 0, 7, 2,245,
- 0, 7, 7, 63, 0, 7, 7, 64, 1, 7, 0, 9, 0, 2, 0, 20, 0, 2, 0, 18, 0, 4, 6,224, 0, 4, 0, 92, 0, 0, 0, 17,
- 0, 2, 0, 43, 0, 2, 0, 64, 0, 2, 7, 65, 0, 2, 7, 66, 1, 8, 0, 8, 0, 32, 0, 45, 0, 7, 2,147, 0, 7, 7, 67,
- 0, 7, 7, 68, 0, 7, 2,142, 0, 2, 0, 20, 0, 2, 2,116, 0, 7, 7, 69, 1, 9, 0, 12, 0, 2, 0, 18, 0, 2, 1, 9,
- 0, 2, 0, 20, 0, 2, 2,150, 0, 2, 2,176, 0, 2, 7, 70, 0, 4, 0, 37, 0, 7, 7, 71, 0, 7, 7, 72, 0, 7, 7, 73,
- 0, 7, 7, 74, 0, 0, 7, 75, 1, 10, 0, 10, 0, 2, 0, 20, 0, 2, 0, 18, 0, 4, 6,224, 0, 4, 0, 92, 0, 0, 0, 17,
- 0, 2, 0,181, 0, 2, 0, 64, 0, 2, 7, 65, 0, 2, 7, 66, 0, 63, 1,157, 1, 11, 0, 7, 0, 4, 2,105, 0, 4, 7, 76,
- 0, 4, 7, 77, 0, 4, 7, 78, 0, 7, 7, 79, 0, 7, 7, 80, 0, 0, 7, 18, 1, 12, 0, 7, 0, 0, 7, 81, 0, 32, 7, 82,
- 0, 0, 7, 22, 0, 2, 7, 83, 0, 2, 0, 43, 0, 4, 0, 70, 0, 0, 7, 23, 1, 13, 0, 6, 0, 2, 0, 20, 0, 2, 0, 18,
- 0, 4, 6,224, 0, 4, 0, 92, 0, 0, 7, 84, 0, 0, 7, 85, 1, 14, 0, 1, 0, 4, 0, 20, 1, 15, 0, 6, 0, 0, 0, 95,
- 0, 2, 0, 18, 0, 2, 0, 20, 0, 4, 7, 86, 0, 7, 7, 87, 0, 42, 5,131, 1, 16, 0, 3, 0, 0, 0, 95, 0, 4, 0, 18,
- 0, 32, 0, 45, 1, 17, 0, 2, 0, 4, 0, 18, 0, 4, 5, 47, 0,254, 0, 10, 0,254, 0, 0, 0,254, 0, 1, 0,254, 7, 36,
- 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 7, 0, 0, 2, 7, 88, 0, 0, 0, 17, 0, 9, 0, 2, 0, 32, 0, 45, 1, 18, 0, 10,
- 0, 7, 3, 10, 0, 7, 7, 89, 0, 7, 7, 90, 0, 7, 7, 91, 0, 7, 7, 92, 0, 4, 0, 20, 0, 7, 7, 70, 0, 7, 7, 93,
- 0, 7, 7, 94, 0, 7, 0, 37, 0,221, 0, 20, 0, 27, 0, 31, 0, 0, 0,192, 1, 19, 7, 95, 0, 9, 7, 96, 0, 43, 0,152,
- 0, 43, 7, 97, 0, 9, 7, 98, 0, 36, 0, 79, 0, 7, 7, 55, 0, 7, 7, 99, 0, 7, 7,100, 0, 7, 7,101, 0, 7, 7,102,
- 0, 7, 7,103, 0, 7, 7,104, 0, 4, 0, 93, 0, 4, 7,105, 0, 0, 7,106, 0, 0, 7,107, 0, 0, 7,108, 1, 20, 0, 6,
- 0, 27, 0, 31, 0, 7, 7,109, 0, 7, 7,110, 0, 7, 7,111, 0, 2, 7,112, 0, 2, 7,113, 1, 21, 0, 14, 0,175, 0, 0,
- 0,175, 0, 1, 0, 4, 4,247, 0, 7, 4,248, 0,176, 4,249, 0,181, 5, 60, 0,221, 6,184, 0, 2, 1, 9, 0, 2, 7, 49,
- 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 0, 20, 0, 2, 5, 70, 0, 4, 0, 70, 1, 22, 0, 6, 1, 22, 0, 0, 1, 22, 0, 1,
- 0, 32, 0, 45, 0, 9, 7,114, 0, 4, 0,217, 0, 4, 0, 37, 0, 63, 0, 4, 0, 27, 0, 31, 0, 12, 7,115, 0, 4, 0,135,
- 0, 7, 7,116, 1, 23, 0, 25, 1, 23, 0, 0, 1, 23, 0, 1, 1, 23, 0, 38, 0, 12, 7,117, 0, 0, 0, 17, 0, 7, 7,118,
- 0, 7, 7,119, 0, 7, 7,120, 0, 7, 7,121, 0, 4, 0, 20, 0, 7, 7,122, 0, 7, 7,123, 0, 7, 7,124, 0, 7, 1, 16,
- 0, 7, 1,213, 0, 7, 7,125, 0, 7, 2,103, 0, 7, 7,126, 0, 7, 7,127, 0, 7, 7,128, 0, 7, 7,129, 0, 7, 7,130,
- 0, 7, 0,175, 0, 2, 0,135, 0, 2, 4,154, 1, 24, 0, 19, 0, 27, 0, 31, 0, 12, 7,131, 0, 12, 7,132, 0, 4, 0, 20,
- 0, 4, 3,226, 0, 2, 2,154, 0, 2, 7,133, 0, 2, 0,135, 0, 2, 7,134, 0, 2, 7,135, 0, 2, 7,136, 0, 2, 7,137,
- 0, 2, 7,138, 0, 4, 7,139, 0, 4, 7,140, 0, 4, 7,141, 0, 4, 7,142, 0, 4, 7,143, 0, 4, 7,144, 1, 25, 0, 34,
- 1, 25, 0, 0, 1, 25, 0, 1, 0, 12, 3, 34, 0, 0, 0, 17, 0, 2, 0, 20, 0, 2, 7,145, 0, 2, 7,146, 0, 2, 7,147,
- 0, 2, 2,255, 0, 2, 7,148, 0, 4, 1,244, 0, 4, 7,141, 0, 4, 7,142, 1, 23, 7,149, 1, 25, 0, 38, 1, 25, 7,150,
- 0, 12, 7,151, 0, 9, 7,152, 0, 9, 7,153, 0, 9, 7,154, 0, 7, 1, 3, 0, 7, 0,175, 0, 7, 1,195, 0, 7, 7,155,
- 0, 7, 7,156, 0, 7, 2,247, 0, 7, 7,157, 0, 7, 7,158, 0, 7, 7,159, 0, 7, 7,160, 0, 7, 7,161, 0, 7, 7,162,
- 0, 7, 1,241, 0, 32, 7,163, 0,140, 0, 9, 0, 12, 7,164, 0, 2, 0, 20, 0, 2, 7,165, 0, 7, 3, 9, 0, 7, 7,166,
- 0, 7, 7,167, 0, 12, 7,168, 0, 4, 7,169, 0, 4, 0, 37, 1, 26, 0, 7, 1, 26, 0, 0, 1, 26, 0, 1, 0, 12, 7,106,
- 0, 4, 0, 20, 0, 4, 7,170, 0, 0, 0, 17, 0,203, 7,171, 1, 27, 0, 8, 1, 27, 0, 0, 1, 27, 0, 1, 1, 26, 7,172,
- 0, 36, 0, 79, 0, 12, 2,239, 0, 4, 0, 20, 0, 0, 0, 17, 0, 4, 7,173, 0,139, 0, 6, 0, 27, 0, 31, 0, 12, 7,164,
- 0, 12, 7,174, 0, 12, 0,103, 0, 4, 7,175, 0, 4, 0, 37, 1, 28, 0, 16, 0,175, 0, 0, 0,175, 0, 1, 0, 4, 4,247,
- 0, 7, 4,248, 0,176, 4,249, 0, 2, 4,250, 0,181, 5, 60, 0,139, 2,236, 0, 0, 1, 9, 0, 0, 5,130, 0, 2, 0, 20,
- 0, 2, 7,176, 0, 2, 5, 67, 0, 2, 5, 70, 0, 2, 7,177, 0, 7, 7,178, 1, 29, 0, 5, 1, 29, 0, 0, 1, 29, 0, 1,
- 0, 36, 0, 79, 0, 2, 0, 20, 0, 0, 7,179, 1, 30, 0, 12, 1, 30, 0, 0, 1, 30, 0, 1, 0, 9, 0, 2, 0, 2, 0, 18,
- 0, 2, 0, 20, 0, 0, 7,180, 0, 0, 7,181, 0, 0, 7,179, 0, 7, 7,182, 0, 7, 7,183, 0, 4, 0, 37, 0, 36, 0, 79,
- 1, 31, 0, 9, 1, 31, 0, 0, 1, 31, 0, 1, 0, 32, 7,184, 0, 0, 7,185, 0, 7, 7,186, 0, 2, 7,187, 0, 2, 0, 20,
- 0, 2, 0, 18, 0, 2, 0, 37, 1, 32, 0, 7, 0, 42, 5,131, 0, 26, 7,188, 0, 4, 0, 20, 0, 4, 7,189, 0, 12, 7,190,
- 0, 32, 7,184, 0, 0, 7,185, 1, 33, 0, 12, 0, 32, 7,184, 0, 2, 7,191, 0, 2, 0, 20, 0, 2, 7,192, 0, 2, 7,193,
- 0, 0, 7,185, 0, 32, 7,194, 0, 0, 7,195, 0, 7, 7,196, 0, 7, 1,213, 0, 7, 7,197, 0, 7, 7,198, 1, 34, 0, 6,
- 0, 32, 7,184, 0, 4, 7,173, 0, 4, 7,199, 0, 4, 0, 93, 0, 4, 0, 37, 0, 0, 7,185, 1, 35, 0, 4, 0, 32, 7,184,
- 0, 4, 0, 20, 0, 4, 7,173, 0, 0, 7,185, 1, 36, 0, 4, 0, 32, 7,184, 0, 4, 0, 20, 0, 4, 7,173, 0, 0, 7,185,
- 1, 37, 0, 10, 0, 32, 7,184, 0, 4, 7,200, 0, 7, 0,129, 0, 4, 0, 20, 0, 2, 5,125, 0, 2, 7,201, 0, 2, 0, 43,
- 0, 2, 0, 70, 0, 7, 7,202, 0, 0, 7,185, 1, 38, 0, 4, 0, 32, 7,184, 0, 4, 0, 20, 0, 4, 7,173, 0, 0, 7,185,
- 1, 39, 0, 10, 0, 32, 7,184, 0, 2, 0, 18, 0, 2, 3,113, 0, 4, 0, 91, 0, 4, 0, 92, 0, 7, 7, 67, 0, 7, 7, 68,
- 0, 4, 0, 37, 0,139, 7, 42, 0, 0, 7,185, 1, 40, 0, 4, 0, 32, 7,184, 0, 4, 2,252, 0, 4, 7,203, 0, 0, 7,185,
- 1, 41, 0, 5, 0, 32, 7,184, 0, 7, 0,129, 0, 4, 7,204, 0, 4, 2,252, 0, 4, 2,253, 1, 42, 0, 6, 0, 32, 7,184,
- 0, 4, 7,205, 0, 4, 7,206, 0, 7, 7,207, 0, 7, 7,208, 0, 0, 7,185, 1, 43, 0, 16, 0, 32, 7,184, 0, 32, 7,150,
- 0, 4, 0, 18, 0, 7, 7,209, 0, 7, 7,210, 0, 7, 7,211, 0, 7, 7,212, 0, 7, 7,213, 0, 7, 7,214, 0, 7, 7,215,
- 0, 7, 7,216, 0, 7, 7,217, 0, 2, 0, 20, 0, 2, 0, 37, 0, 2, 0, 43, 0, 2, 0, 70, 1, 44, 0, 3, 0, 32, 7,184,
- 0, 4, 0, 20, 0, 4, 5, 39, 1, 45, 0, 5, 0, 32, 7,184, 0, 4, 0, 20, 0, 4, 0, 37, 0, 7, 7,218, 0, 0, 7,185,
- 1, 46, 0, 10, 0, 32, 7,184, 0, 0, 7,185, 0, 2, 7,219, 0, 2, 7,220, 0, 0, 7,221, 0, 0, 7,222, 0, 7, 7,223,
- 0, 7, 7,224, 0, 7, 7,225, 0, 7, 7,226, 1, 47, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12,
- 0, 7, 7,227, 0, 7, 7,228, 0, 2, 0, 20, 0, 2, 5, 39, 1, 48, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11,
- 0, 7, 0, 12, 0, 7, 7,227, 0, 7, 7,228, 0, 2, 0, 20, 0, 2, 5, 39, 1, 49, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10,
- 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 7,227, 0, 7, 7,228, 0, 2, 0, 20, 0, 2, 5, 39, 1, 50, 0, 7, 0, 32, 7,184,
- 0, 0, 7,185, 0, 7, 1, 16, 0, 7, 1, 26, 0, 2, 0, 20, 0, 2, 1, 9, 0, 4, 0, 37, 1, 51, 0, 10, 1, 51, 0, 0,
- 1, 51, 0, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 0, 7,229, 0, 7, 0,219, 0, 7, 0,220, 0, 2, 7,106, 0, 2, 7,230,
- 0, 32, 0, 45, 1, 52, 0, 22, 1, 52, 0, 0, 1, 52, 0, 1, 0, 2, 0, 20, 0, 2, 1, 9, 0, 2, 7,231, 0, 2, 7,232,
- 0, 36, 0, 79, 0,139, 7, 42, 0, 32, 0,167, 0, 7, 0, 91, 0, 7, 0, 92, 0, 7, 7,233, 0, 7, 7,234, 0, 7, 7,235,
- 0, 7, 7,236, 0, 7, 2,143, 0, 7, 1,185, 0, 7, 7, 44, 0, 7, 7,237, 0, 0, 7,238, 0, 0, 7,239, 0, 12, 2,241,
- 1, 53, 0, 8, 0, 7, 1,221, 0, 7, 7, 67, 0, 7, 7, 68, 0, 9, 0, 2, 0, 2, 7,240, 0, 2, 7,241, 0, 2, 7,242,
- 0, 2, 7,243, 1, 54, 0, 18, 1, 54, 0, 0, 1, 54, 0, 1, 1, 54, 7,244, 0, 0, 0, 17, 1, 53, 7,245, 0, 2, 0, 18,
- 0, 2, 0, 20, 0, 2, 7,246, 0, 2, 7,247, 0, 2, 7,248, 0, 2, 7,249, 0, 4, 0, 43, 0, 7, 7,250, 0, 7, 7,251,
- 0, 4, 7,252, 0, 4, 7,253, 1, 54, 7,254, 1, 55, 7,255, 1, 56, 0, 30, 1, 56, 0, 0, 1, 56, 0, 1, 1, 56, 8, 0,
- 0, 0, 0, 17, 0, 0, 8, 1, 0, 2, 0, 18, 0, 2, 0, 20, 0, 2, 6,152, 0, 2, 6,186, 0, 2, 8, 2, 0, 2, 0,137,
- 0, 2, 7,247, 0, 2, 6,142, 0, 12, 7, 37, 0, 12, 8, 3, 0, 27, 5,158, 0, 9, 8, 4, 0, 7, 7,250, 0, 7, 7,251,
- 0, 7, 1,246, 0, 7, 8, 5, 0, 2, 8, 6, 0, 2, 8, 7, 0, 2, 8, 8, 0, 2, 8, 9, 0, 24, 8, 10, 0, 24, 8, 11,
- 0, 24, 8, 12, 1, 57, 0,153, 1, 58, 8, 13, 1, 55, 0, 6, 1, 55, 0, 0, 1, 55, 0, 1, 1, 56, 8, 14, 1, 56, 8, 15,
- 1, 54, 8, 16, 1, 54, 7,254, 0, 62, 0, 16, 0, 27, 0, 31, 0, 12, 8, 17, 0, 12, 8, 18, 1, 53, 8, 19, 0, 12, 8, 20,
- 0, 4, 0, 18, 0, 4, 8, 21, 0, 4, 8, 22, 0, 4, 8, 23, 0, 12, 8, 24, 1, 58, 8, 25, 1, 54, 8, 26, 1, 54, 8, 27,
- 0, 9, 8, 28, 0, 9, 8, 29, 0, 4, 8, 30, 1, 59, 0, 6, 0, 4, 0,128, 0, 4, 0,130, 0, 4, 6,142, 0, 0, 8, 31,
- 0, 0, 8, 32, 0, 2, 0, 37, 1, 60, 0, 16, 0, 2, 6, 81, 0, 2, 6, 82, 0, 2, 8, 33, 0, 2, 7, 90, 0, 2, 8, 34,
- 0, 2, 0, 68, 0, 7, 2,142, 0, 7, 8, 35, 0, 7, 8, 36, 0, 2, 1, 30, 0, 0, 8, 37, 0, 0, 3,238, 0, 2, 8, 38,
- 0, 2, 0, 37, 0, 4, 8, 39, 0, 4, 8, 40, 1, 61, 0, 9, 0, 7, 8, 41, 0, 7, 8, 42, 0, 7, 7,104, 0, 7, 0,112,
- 0, 7, 8, 43, 0, 7, 4,243, 0, 2, 8, 44, 0, 0, 8, 45, 0, 0, 0, 37, 1, 62, 0, 4, 0, 7, 8, 46, 0, 7, 8, 47,
- 0, 2, 8, 44, 0, 2, 0, 37, 1, 63, 0, 3, 0, 7, 8, 48, 0, 7, 8, 49, 0, 7, 0, 15, 1, 64, 0, 7, 0, 0, 1,184,
- 0, 2, 4, 49, 0, 2, 4, 50, 0, 2, 4, 51, 0, 2, 4, 2, 0, 4, 0,130, 0, 4, 3,111, 1, 65, 0, 7, 0, 7, 8, 50,
- 0, 7, 8, 51, 0, 7, 8, 52, 0, 7, 1,255, 0, 7, 8, 53, 0, 7, 8, 54, 0, 7, 8, 55, 1, 66, 0, 4, 0, 2, 8, 56,
- 0, 2, 8, 57, 0, 2, 8, 58, 0, 2, 8, 59, 1, 67, 0, 2, 0, 7, 0, 5, 0, 7, 0, 6, 1, 68, 0, 2, 0, 0, 0,169,
- 0, 0, 8, 60, 1, 69, 0, 1, 0, 0, 0, 17, 1, 70, 0, 10, 0, 0, 8, 61, 0, 0, 8, 62, 0, 0, 8, 63, 0, 0, 8, 64,
- 0, 2, 8, 33, 0, 2, 8, 65, 0, 7, 8, 66, 0, 7, 8, 67, 0, 7, 8, 68, 0, 7, 1,185, 1, 71, 0, 2, 0, 9, 8, 69,
- 0, 9, 8, 70, 1, 72, 0, 11, 0, 0, 4, 51, 0, 0, 0, 18, 0, 0, 8, 44, 0, 0, 0,112, 0, 0, 8, 71, 0, 0, 0,109,
- 0, 0, 2, 71, 0, 7, 8, 72, 0, 7, 8, 73, 0, 7, 8, 74, 0, 7, 8, 75, 1, 73, 0, 8, 0, 7, 7, 7, 0, 7, 0,129,
- 0, 7, 3,238, 0, 7, 2, 66, 0, 7, 8, 76, 0, 7, 0,206, 0, 7, 8, 77, 0, 4, 0, 18, 1, 74, 0, 4, 0, 2, 8, 78,
- 0, 2, 8, 79, 0, 2, 8, 80, 0, 2, 0, 37, 1, 75, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 2, 0, 20, 0, 2, 8, 81,
- 1, 76, 0, 10, 0, 2, 3, 93, 0, 2, 0, 20, 0, 7, 3,184, 0, 7, 8, 82, 0, 7, 8, 83, 0, 7, 8, 84, 0, 7, 8, 85,
- 1, 75, 8, 86, 1, 75, 8, 87, 1, 75, 8, 88, 0, 59, 0, 9, 0, 4, 0, 20, 0, 4, 0, 64, 0, 24, 8, 89, 0, 24, 8, 90,
- 1, 76, 8, 91, 0, 7, 8, 92, 0, 7, 8, 93, 0, 7, 8, 94, 0, 7, 8, 95, 1, 77, 0, 4, 0, 46, 2,136, 0, 7, 8, 96,
- 0, 7, 1, 85, 0, 7, 0, 37, 0,163, 0, 13, 0, 27, 0, 31, 0, 2, 0, 20, 0, 2, 4,244, 0, 4, 0,109, 0, 7, 8, 97,
- 0, 7, 1,252, 0, 7, 8, 98, 0, 7, 8, 99, 0, 7, 1, 85, 0, 2, 1, 43, 0, 2, 0, 37, 0, 50, 1, 70, 1, 77, 8,100,
- 1, 78, 0, 8, 0, 4, 0, 18, 0, 4, 0,129, 0, 4, 0, 20, 0, 4, 3, 55, 0, 4, 8,101, 0, 0, 0, 95, 0, 0, 0, 17,
- 0, 9, 0, 2, 0, 84, 0, 6, 1, 78, 8,102, 0, 4, 8,103, 0, 4, 8,104, 0, 4, 8,105, 0, 4, 0, 37, 0, 9, 8,106,
- 1, 79, 0, 5, 0, 7, 2, 61, 0, 7, 2,176, 0, 7, 1,213, 0, 2, 8,107, 0, 2, 0, 37, 1, 80, 0, 5, 0, 7, 2, 61,
- 0, 7, 8,108, 0, 7, 8,109, 0, 7, 8,110, 0, 7, 2,176, 1, 81, 0, 7, 0, 4, 8,111, 0, 4, 8,112, 0, 4, 8,113,
- 0, 7, 8,114, 0, 7, 8,115, 0, 7, 8,116, 0, 7, 8,117, 1, 82, 0, 25, 0, 32, 8,118, 1, 80, 3, 51, 1, 79, 8,119,
- 1, 80, 6,249, 0, 7, 8,120, 0, 7, 8,121, 0, 7, 8,122, 0, 7, 8,123, 0, 7, 8,115, 0, 7, 8,116, 0, 7, 2,176,
- 0, 7, 2,153, 0, 7, 8,124, 0, 7, 8,125, 0, 7, 0,109, 0, 7, 8,126, 0, 4, 8,111, 0, 4, 8,127, 0, 4, 0, 37,
- 0, 4, 0, 81, 0, 4, 8,128, 0, 2, 0, 20, 0, 2, 8,129, 0, 2, 8,130, 0, 2, 3, 85, 1, 83, 0,112, 0, 27, 0, 31,
- 0, 4, 0, 20, 0, 2, 0, 18, 0, 2, 7,219, 0, 2, 8,131, 0, 2, 8,132, 0, 2, 8,133, 0, 2, 8,134, 0, 2, 8,135,
- 0, 2, 8,136, 0, 2, 8,137, 0, 2, 8,138, 0, 2, 8,139, 0, 2, 8,140, 0, 2, 8,141, 0, 2, 8,142, 0, 2, 8,143,
- 0, 2, 8,144, 0, 2, 8,145, 0, 2, 1,205, 0, 2, 6,242, 0, 2, 6,218, 0, 2, 8,146, 0, 2, 8,147, 0, 2, 3, 83,
- 0, 2, 3, 84, 0, 2, 8,148, 0, 2, 8,149, 0, 2, 8,150, 0, 2, 8,151, 0, 2, 8,152, 0, 2, 8,153, 0, 7, 8,154,
- 0, 7, 8,155, 0, 7, 8,156, 0, 2, 8,157, 0, 2, 8,158, 0, 7, 8,159, 0, 7, 8,160, 0, 7, 8,161, 0, 7, 6,224,
- 0, 7, 0, 92, 0, 7, 2,153, 0, 7, 6,230, 0, 7, 8,162, 0, 7, 8,163, 0, 7, 8,164, 0, 7, 8,165, 0, 7, 0, 57,
- 0, 4, 6,225, 0, 4, 6,223, 0, 4, 8,166, 0, 7, 6,226, 0, 7, 6,227, 0, 7, 6,228, 0, 7, 8,167, 0, 7, 8,168,
- 0, 7, 8,169, 0, 7, 8,170, 0, 7, 8,171, 0, 7, 8,172, 0, 7, 8,173, 0, 7, 8,174, 0, 7, 3, 10, 0, 7, 0,109,
- 0, 7, 8,175, 0, 7, 8,176, 0, 7, 8,177, 0, 7, 8,178, 0, 7, 8,179, 0, 7, 8,180, 0, 7, 2,103, 0, 7, 8,181,
- 0, 7, 8,182, 0, 4, 8,183, 0, 4, 8,184, 0, 7, 8,185, 0, 7, 8,186, 0, 7, 8,187, 0, 7, 8,188, 0, 7, 8,189,
- 0, 7, 8,190, 0, 7, 8,191, 0, 7, 8,192, 0, 7, 3, 79, 0, 7, 3, 77, 0, 7, 3, 78, 0, 7, 8,193, 0, 7, 8,194,
- 0, 7, 8,195, 0, 7, 8,196, 0, 7, 8,197, 0, 7, 8,198, 0, 7, 8,199, 0, 7, 8,200, 0, 7, 8,201, 0, 7, 8,202,
- 0, 7, 8,203, 0, 7, 8,204, 0, 7, 8,205, 0, 7, 8,206, 0, 7, 8,207, 0, 7, 8,208, 0, 7, 8,209, 0, 0, 8,210,
- 0, 63, 3, 40, 0, 63, 8,211, 0, 32, 8,212, 0, 32, 8,213, 0, 36, 0, 79, 0,141, 3, 38, 0,141, 8,214, 0,132, 0, 37,
- 0,132, 0, 0, 0,132, 0, 1, 1, 83, 8,215, 1, 82, 3, 92, 1, 81, 7,150, 1, 84, 8,216, 1, 85, 8,217, 1, 85, 8,218,
- 0, 12, 8,219, 0, 12, 8,220, 0,142, 3, 39, 0, 32, 8,221, 0, 32, 8,222, 0, 32, 8,223, 0, 12, 8,224, 0, 12, 8,225,
- 0, 7, 0,210, 0, 7, 4, 23, 0, 4, 2,105, 0, 4, 0, 20, 0, 4, 6,225, 0, 4, 8,226, 0, 4, 8,227, 0, 4, 8,228,
- 0, 4, 0, 57, 0, 2, 0,217, 0, 2, 8,229, 0, 2, 8,230, 0, 2, 8,231, 0, 2, 3, 32, 0, 2, 8,232, 0, 0, 8,233,
- 0, 2, 8,234, 0, 2, 8,235, 0, 2, 8,236, 0, 9, 8,237, 0,124, 3,132, 0,122, 0, 34, 1, 86, 8,238, 0, 7, 3,104,
- 0, 7, 8,239, 0, 7, 8,240, 0, 7, 3,187, 0, 7, 8,241, 0, 7, 3, 17, 0, 7, 3, 10, 0, 7, 8,242, 0, 7, 1,254,
- 0, 7, 8,243, 0, 7, 8,244, 0, 7, 8,245, 0, 7, 8,246, 0, 7, 8,247, 0, 7, 8,248, 0, 7, 3,105, 0, 7, 8,249,
- 0, 7, 8,250, 0, 7, 8,251, 0, 7, 3,106, 0, 7, 3,102, 0, 7, 3,103, 0, 4, 8,252, 0, 4, 0, 93, 0, 4, 8,253,
- 0, 4, 8,254, 0, 2, 8,255, 0, 2, 9, 0, 0, 2, 9, 1, 0, 2, 9, 2, 0, 2, 9, 3, 0, 2, 0, 37, 0, 4, 0, 70,
- 0,123, 0, 8, 1, 86, 9, 4, 0, 7, 9, 5, 0, 7, 9, 6, 0, 7, 1,158, 0, 7, 9, 7, 0, 4, 0, 93, 0, 2, 9, 8,
- 0, 2, 9, 9, 1, 87, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 9, 10, 1, 88, 0, 6, 1, 88, 0, 0,
- 1, 88, 0, 1, 1, 87, 9, 11, 0, 4, 9, 12, 0, 2, 9, 13, 0, 2, 0, 20, 1, 89, 0, 5, 1, 89, 0, 0, 1, 89, 0, 1,
- 0, 12, 9, 14, 0, 4, 9, 15, 0, 4, 0, 20, 1, 90, 0, 9, 1, 90, 0, 0, 1, 90, 0, 1, 0, 12, 0,128, 1, 89, 9, 16,
- 0, 4, 0, 20, 0, 2, 9, 13, 0, 2, 9, 17, 0, 7, 0, 94, 0, 0, 9, 18, 0,180, 0, 5, 0, 12, 4, 65, 0, 4, 0, 20,
- 0, 2, 9, 19, 0, 2, 9, 20, 0, 9, 9, 21, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
deleted file mode 100644
index 8dfa32d48c8..00000000000
--- a/source/blender/src/previewrender.c
+++ /dev/null
@@ -1,962 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* global includes */
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-
-#include "MTC_matrixops.h"
-
-#include "DNA_texture_types.h"
-#include "DNA_world_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_image_types.h"
-#include "DNA_material_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_icons.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_texture.h"
-#include "BKE_material.h"
-#include "BKE_node.h"
-#include "BKE_world.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
-#include "BIF_gl.h"
-#include "BIF_screen.h"
-#include "BIF_space.h" /* allqueue */
-#include "BIF_butspace.h"
-#include "BIF_mywindow.h"
-#include "BIF_interface.h"
-#include "BIF_glutil.h"
-
-#include "BIF_previewrender.h" /* include ourself for prototypes */
-
-#include "PIL_time.h"
-
-#include "RE_pipeline.h"
-#include "BLO_readfile.h"
-
-#include "GPU_material.h"
-
-#include "blendef.h" /* CLAMP */
-#include "interface.h" /* ui_graphics_to_window(), SOLVE! (ton) */
-#include "mydevice.h"
-
-
-#define PR_XMIN 10
-#define PR_YMIN 5
-#define PR_XMAX 200
-#define PR_YMAX 195
-
-
-static void set_previewrect(RenderInfo *ri, int win)
-{
- rctf viewplane;
-
- BLI_init_rctf(&viewplane, PR_XMIN, PR_XMAX, PR_YMIN, PR_YMAX);
-
- ui_graphics_to_window_rct(win, &viewplane, &ri->disprect);
-
- /* correction for gla draw */
- BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
-
- glaDefine2DArea(&curarea->winrct);
-
- ri->pr_rectx= (ri->disprect.xmax-ri->disprect.xmin);
- ri->pr_recty= (ri->disprect.ymax-ri->disprect.ymin);
-}
-
-static void end_previewrect(void)
-{
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- // restore viewport / scissor which was set by glaDefine2DArea
- glViewport(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy);
- glScissor(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy);
-
-}
-
-/* unused now */
-void draw_tex_crop(Tex *tex)
-{
- rcti rct;
- int ret= 0;
-
- if(tex==0) return;
-
- if(tex->type==TEX_IMAGE) {
- if(tex->cropxmin==0.0f) ret++;
- if(tex->cropymin==0.0f) ret++;
- if(tex->cropxmax==1.0f) ret++;
- if(tex->cropymax==1.0f) ret++;
- if(ret==4) return;
-
- rct.xmin= PR_XMIN+2+tex->cropxmin*(PR_XMAX-PR_XMIN-4);
- rct.xmax= PR_XMIN+2+tex->cropxmax*(PR_XMAX-PR_XMIN-4);
- rct.ymin= PR_YMIN+2+tex->cropymin*(PR_YMAX-PR_YMIN-4);
- rct.ymax= PR_YMIN+2+tex->cropymax*(PR_YMAX-PR_YMIN-4);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- glColor3ub(0, 0, 0);
- glRecti(rct.xmin+1, rct.ymin-1, rct.xmax+1, rct.ymax-1);
-
- glColor3ub(255, 255, 255);
- glRecti(rct.xmin, rct.ymin, rct.xmax, rct.ymax);
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
-
-}
-
-/* temporal abuse; if id_code is -1 it only does texture.... solve! */
-void BIF_preview_changed(short id_code)
-{
- ScrArea *sa;
-
- for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->spacetype==SPACE_BUTS) {
- SpaceButs *sbuts= sa->spacedata.first;
- if(sbuts->mainb==CONTEXT_SHADING) {
- int tab= sbuts->tab[CONTEXT_SHADING];
- if(tab==TAB_SHADING_MAT && (id_code==ID_MA || id_code==ID_TE)) {
- if (sbuts->ri) sbuts->ri->curtile= 0;
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
- else if(tab==TAB_SHADING_TEX && (id_code==ID_TE || id_code==-1)) {
- if (sbuts->ri) sbuts->ri->curtile= 0;
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
- else if(tab==TAB_SHADING_LAMP && (id_code==ID_LA || id_code==ID_TE)) {
- if (sbuts->ri) sbuts->ri->curtile= 0;
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
- else if(tab==TAB_SHADING_WORLD && (id_code==ID_WO || id_code==ID_TE)) {
- if (sbuts->ri) sbuts->ri->curtile= 0;
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
- }
- else if (sbuts->ri)
- sbuts->ri->curtile= 0; /* ensure changes always result in re-render when context is restored */
- }
- else if(sa->spacetype==SPACE_NODE) {
- SpaceNode *snode= sa->spacedata.first;
- if(snode->treetype==NTREE_SHADER && (id_code==ID_MA || id_code==ID_TE)) {
- snode_tag_dirty(snode);
- }
- }
- else if(sa->spacetype==SPACE_VIEW3D) {
- View3D *vd= sa->spacedata.first;
- /* if is has a renderinfo, we consider that reason for signalling */
- if (vd->ri) {
- vd->ri->curtile= 0;
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
- }
- }
-
- if(ELEM4(id_code, ID_MA, ID_TE, ID_LA, ID_WO)) {
- Object *ob;
- Material *ma;
-
- if(id_code == ID_WO) {
- for(ma=G.main->mat.first; ma; ma=ma->id.next) {
- if(ma->gpumaterial.first) {
- GPU_material_free(ma);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
- else if(id_code == ID_LA) {
- for(ob=G.main->object.first; ob; ob=ob->id.next) {
- if(ob->gpulamp.first) {
- GPU_lamp_free(ob);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- } else if(OBACT) {
- Object *ob = OBACT;
-
- ma= give_current_material(ob, ob->actcol);
- if(ma && ma->gpumaterial.first) {
- GPU_material_free(ma);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
-}
-
-/* *************************** Preview for buttons *********************** */
-
-static Main *pr_main= NULL;
-
-void BIF_preview_init_dbase(void)
-{
- BlendReadError bre;
- BlendFileData *bfd;
- extern int datatoc_preview_blend_size;
- extern char datatoc_preview_blend[];
-
- G.fileflags |= G_FILE_NO_UI;
- bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, &bre);
- if (bfd) {
- pr_main= bfd->main;
-
- MEM_freeN(bfd);
- }
- G.fileflags &= ~G_FILE_NO_UI;
-}
-
-void BIF_preview_free_dbase(void)
-{
- if(pr_main)
- free_main(pr_main);
-}
-
-static Object *find_object(ListBase *lb, const char *name)
-{
- Object *ob;
- for(ob= lb->first; ob; ob= ob->id.next)
- if(strcmp(ob->id.name+2, name)==0)
- break;
- return ob;
-}
-
-/* call this with an ID pointer to initialize preview scene */
-/* call this with ID NULL to restore assigned ID pointers in preview scene */
-static Scene *preview_prepare_scene(RenderInfo *ri, int id_type, ID *id, int pr_method)
-{
- Scene *sce;
- Base *base;
-
- if(pr_main==NULL) return NULL;
-
- sce= pr_main->scene.first;
- if(sce) {
- /* this flag tells render to not execute depsgraph or ipos etc */
- sce->r.scemode |= R_PREVIEWBUTS;
- /* set world always back, is used now */
- sce->world= pr_main->world.first;
- /* now: exposure copy */
- if(G.scene->world) {
- sce->world->exp= G.scene->world->exp;
- sce->world->range= G.scene->world->range;
- }
-
- sce->r.cfra= G.scene->r.cfra;
-
- if(id_type==ID_MA) {
- Material *mat= (Material *)id;
-
- if(id) {
- init_render_material(mat, 0, NULL); /* call that retrieves mode_l */
- end_render_material(mat);
-
- /* turn on raytracing if needed */
- if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR))
- sce->r.mode |= R_RAYTRACE;
- if(mat->sss_flag & MA_DIFF_SSS)
- sce->r.mode |= R_SSS;
-
- /* turn off fake shadows if needed */
- /* this only works in a specific case where the preview.blend contains
- * an object starting with 'c' which has a material linked to it (not the obdata)
- * and that material has a fake shadow texture in the active texture slot */
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='c') {
- Material *shadmat= give_current_material(base->object, base->object->actcol);
- if(shadmat) {
- if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
- else shadmat->septex |= 1;
- }
- }
- }
-
-
- if(pr_method==PR_ICON_RENDER) {
- if (mat->mode & MA_HALO) {
- sce->lay= 1<<MA_FLAT;
- }
- else {
- sce->lay= 1<<MA_SPHERE_A;
- }
- }
- else {
- sce->lay= 1<<mat->pr_type;
- if(mat->nodetree)
- ntreeInitPreview(mat->nodetree, ri->pr_rectx, ri->pr_recty);
- }
- }
- else {
- sce->r.mode &= ~(R_OSA|R_RAYTRACE|R_SSS);
- }
-
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='p') {
- if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL))
- assign_material(base->object, mat, base->object->actcol);
- }
- }
- }
- else if(id_type==ID_TE) {
- Tex *tex= (Tex *)id;
-
- sce->lay= 1<<MA_TEXTURE;
-
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='t') {
- Material *mat= give_current_material(base->object, base->object->actcol);
- if(mat && mat->mtex[0]) {
- mat->mtex[0]->tex= tex;
- /* show alpha in this case */
- if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) {
- mat->mtex[0]->mapto |= MAP_ALPHA;
- mat->alpha= 0.0f;
- }
- else {
- mat->mtex[0]->mapto &= ~MAP_ALPHA;
- mat->alpha= 1.0f;
- }
- }
- }
- }
- }
- else if(id_type==ID_LA) {
- Lamp *la= (Lamp *)id;
-
- if(la && la->type==LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
- sce->lay= 1<<MA_ATMOS;
- sce->world= G.scene->world;
- sce->camera= (Object *)find_object(&pr_main->object, "CameraAtmo");
- }
- else {
- sce->lay= 1<<MA_LAMP;
- sce->world= NULL;
- sce->camera= (Object *)find_object(&pr_main->object, "Camera");
- }
- sce->r.mode &= ~R_SHADOW;
-
- for(base= sce->base.first; base; base= base->next) {
- if(base->object->id.name[2]=='p') {
- if(base->object->type==OB_LAMP)
- base->object->data= la;
- }
- }
- }
- else if(id_type==ID_WO) {
- sce->lay= 1<<MA_SKY;
- sce->world= (World *)id;
- }
-
- return sce;
- }
-
- return NULL;
-}
-
-static void previewrender_progress(RenderResult *rr, volatile rcti *renrect)
-{
- RenderLayer *rl;
- RenderInfo *ri= G.buts->ri;
- float ofsx, ofsy;
-
- if(renrect) return;
-
- rl= rr->layers.first;
-
- ofsx= ri->disprect.xmin + rr->tilerect.xmin;
- ofsy= ri->disprect.ymin + rr->tilerect.ymin;
-
- glDrawBuffer(GL_FRONT);
- glaDrawPixelsSafe_to32(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, rl->rectf);
- bglFlush();
- glDrawBuffer(GL_BACK);
-}
-
-
-/* called by interface_icons.c, or by BIF_previewrender_buts or by nodes... */
-void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method)
-{
- Render *re;
- RenderStats *rstats;
- Scene *sce;
- SpaceButs *sbuts= NULL;
- int oldx= ri->pr_rectx, oldy= ri->pr_recty;
- char name [32];
-
- if(ri->tottile && ri->curtile>=ri->tottile) return;
-
- /* check for return with a new event */
- if(pr_method!=PR_ICON_RENDER && qtest()) {
- if(area)
- addafterqueue(area->win, RENDERPREVIEW, 1);
- return;
- }
-
- /* get the stuff from the builtin preview dbase */
- sce= preview_prepare_scene(ri, GS(id->name), id, pr_method);
- if(sce==NULL) return;
-
- /* set drawing conditions OK */
- if(area) {
- sbuts= area->spacedata.first; /* needed for flag */
-
- set_previewrect(ri, area->win); // uses UImat
-
- /* because preview render size can differs */
- if(ri->rect && (oldx!=ri->pr_rectx || oldy!=ri->pr_recty)) {
- MEM_freeN(ri->rect);
- ri->rect= NULL;
- ri->curtile= 0;
- }
- }
-
- sprintf(name, "ButsPreview %d", area?area->win:0);
- re= RE_GetRender(name);
-
- /* full refreshed render from first tile */
- if(re==NULL || ri->curtile==0) {
-
- re= RE_NewRender(name);
-
- /* handle cases */
- if(pr_method==PR_DRAW_RENDER) {
- RE_display_draw_cb(re, previewrender_progress);
- RE_test_break_cb(re, qtest);
- sce->r.scemode |= R_NODE_PREVIEW;
- if(sbuts->flag & SB_PRV_OSA)
- sce->r.mode |= R_OSA;
- sce->r.scemode &= ~R_NO_IMAGE_LOAD;
- }
- else if(pr_method==PR_DO_RENDER) {
- RE_test_break_cb(re, qtest);
- sce->r.scemode |= R_NODE_PREVIEW;
- sce->r.scemode &= ~R_NO_IMAGE_LOAD;
- }
- else { /* PR_ICON_RENDER */
- sce->r.scemode &= ~R_NODE_PREVIEW;
- sce->r.scemode |= R_NO_IMAGE_LOAD;
- }
-
- /* allocates render result */
- RE_InitState(re, NULL, &sce->r, ri->pr_rectx, ri->pr_recty, NULL);
-
- /* enforce preview image clear */
- if(GS(id->name)==ID_MA) {
- Material *ma= (Material *)id;
- ntreeClearPreview(ma->nodetree);
- }
- }
- /* entire cycle for render engine */
- RE_SetCamera(re, sce->camera);
- RE_Database_FromScene(re, sce, 1);
- RE_TileProcessor(re, ri->curtile, 0); // actual render engine
- RE_Database_Free(re);
-
- /* handle results */
- if(pr_method==PR_ICON_RENDER) {
- if(ri->rect==NULL)
- ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender");
- RE_ResultGet32(re, ri->rect);
- }
- else {
- rstats= RE_GetStats(re);
-
- if(rstats->partsdone!=ri->curtile) {
- if(ri->rect==NULL)
- ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender");
- RE_ResultGet32(re, ri->rect);
- }
-
- if(rstats->totpart==rstats->partsdone && rstats->partsdone) {
- if(GS(id->name)==ID_MA && ((Material *)id)->use_nodes)
- allqueue(REDRAWNODE, 0);
- allqueue(REDRAWBUTSSHADING, 0);
- }
- else {
- if(pr_method==PR_DRAW_RENDER && qtest())
- addafterqueue(area->win, RENDERPREVIEW, 1);
- }
-
- ri->curtile= rstats->partsdone;
- ri->tottile= rstats->totpart;
- }
-
- /* unassign the pointers, reset vars */
- preview_prepare_scene(ri, GS(id->name), NULL, 0);
-
-}
-
-
-/* afterqueue call */
-void BIF_previewrender_buts(SpaceButs *sbuts)
-{
- uiBlock *block;
- struct ID* id = 0;
- struct ID* idfrom = 0;
- struct ID* idshow = 0;
- Object *ob;
-
- if (!sbuts->ri) return;
-
- /* we safely assume curarea has panel "preview" */
- /* quick hack for now, later on preview should become uiBlock itself */
-
- block= uiFindOpenPanelBlockName(&curarea->uiblocks, "Preview");
- if(block==NULL) return;
-
- ob= ((G.scene->basact)? (G.scene->basact)->object: 0);
-
- /* we cant trust this global lockpoin.. for example with headerless window */
- buttons_active_id(&id, &idfrom);
- G.buts->lockpoin= id;
-
- if(sbuts->mainb==CONTEXT_SHADING) {
- int tab= sbuts->tab[CONTEXT_SHADING];
-
- if(tab==TAB_SHADING_MAT)
- idshow = sbuts->lockpoin;
- else if(tab==TAB_SHADING_TEX)
- idshow = sbuts->lockpoin;
- else if(tab==TAB_SHADING_LAMP) {
- if(ob && ob->type==OB_LAMP) idshow= ob->data;
- }
- else if(tab==TAB_SHADING_WORLD)
- idshow = sbuts->lockpoin;
- }
- else if(sbuts->mainb==CONTEXT_OBJECT) {
- if(ob && ob->type==OB_LAMP) idshow = ob->data;
- }
-
- if (idshow) {
- BKE_icon_changed(BKE_icon_getid(idshow));
- uiPanelPush(block);
- BIF_previewrender(idshow, sbuts->ri, sbuts->area, PR_DRAW_RENDER);
- uiPanelPop(block);
- end_previewrect();
- }
- else {
- /* no active block to draw. But we do draw black if possible */
- if(sbuts->ri->rect) {
- memset(sbuts->ri->rect, 0, sizeof(int)*sbuts->ri->pr_rectx*sbuts->ri->pr_recty);
- sbuts->ri->tottile= 10000;
- addqueue(curarea->win, REDRAW, 1);
- }
- return;
- }
-}
-
-
-/* is panel callback, supposed to be called with correct panel offset matrix */
-void BIF_previewdraw(ScrArea *sa, uiBlock *block)
-{
- SpaceButs *sbuts= sa->spacedata.first;
- short id_code= 0;
-
- if(sbuts->lockpoin) {
- ID *id= sbuts->lockpoin;
- id_code= GS(id->name);
- }
-
- if (!sbuts->ri) {
- sbuts->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo");
- sbuts->ri->tottile = 10000;
- }
-
- if (sbuts->ri->rect==NULL) BIF_preview_changed(id_code);
- else {
- RenderInfo *ri= sbuts->ri;
- int oldx= ri->pr_rectx, oldy= ri->pr_recty;
-
- /* we now do scalable previews! */
- set_previewrect(ri, sa->win);
- if( ABS(oldx-ri->pr_rectx)<2 && ABS(oldy-ri->pr_recty)<2 ) {
- /* restore old values for drawing! */
- ri->pr_rectx= oldx;
- ri->pr_recty= oldy;
- glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect);
- }
- else {
- MEM_freeN(ri->rect);
- ri->rect= NULL;
- sbuts->ri->curtile= 0;
- }
- end_previewrect();
- }
- if(sbuts->ri->curtile==0) BIF_preview_changed(id_code);
-
-}
-
-/* *************************** Preview for 3d window *********************** */
-static void view3d_previewrender_stats(RenderStats *rs)
-{
-// if(rs->convertdone)
-// printf("rendered %d %.3f\n", rs->partsdone, rs->lastframetime);
-}
-
-static void view3d_previewrender_progress(RenderResult *rr, volatile rcti *renrect)
-{
- RenderLayer *rl;
- int ofsx, ofsy;
-
- if(renrect) return;
-
- rl= rr->layers.first;
-
- /* this case is when we render envmaps... */
- if(rr->rectx>G.vd->ri->pr_rectx || rr->recty>G.vd->ri->pr_recty)
- return;
-
- ofsx= G.vd->ri->disprect.xmin + rr->tilerect.xmin;
- ofsy= G.vd->ri->disprect.ymin + rr->tilerect.ymin;
-
- glDrawBuffer(GL_FRONT);
- glaDefine2DArea(&curarea->winrct);
- glaDrawPixelsSafe_to32(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, rl->rectf);
- bglFlush();
- glDrawBuffer(GL_BACK);
-
-}
-
-void BIF_view3d_previewrender_signal(ScrArea *sa, short signal)
-{
- View3D *v3d= sa->spacedata.first;
-
- /* this can be called from other window... solve! */
- if(sa->spacetype!=SPACE_VIEW3D)
- v3d= G.vd;
-
- if(v3d && v3d->ri) {
- RenderInfo *ri= v3d->ri;
- ri->status &= ~signal;
- ri->curtile= 0;
- //printf("preview signal %d\n", signal);
- if(ri->re && (signal & PR_DBASE))
- RE_Database_Free(ri->re);
-
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
-}
-
-void BIF_view3d_previewrender_free(View3D *v3d)
-{
-
- if(v3d->ri) {
- RenderInfo *ri= v3d->ri;
- if(ri->re) {
-// printf("free render\n");
- RE_Database_Free(ri->re);
- RE_FreeRender(ri->re);
- ri->re= NULL;
- }
- if (v3d->ri->rect) MEM_freeN(v3d->ri->rect);
- MEM_freeN(v3d->ri);
- v3d->ri= NULL;
- }
-}
-
-/* returns 1 if OK, do not call while in panel space! */
-static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderInfo *ri, float *clipsta, float *clipend, int *ortho, float *pixsize)
-{
- int rectx, recty;
- uiBlock *block;
-
- block= uiFindOpenPanelBlockName(&curarea->uiblocks, "Preview");
- if(block==NULL) return 0;
-
- /* calculate preview rect size */
- BLI_init_rctf(viewplane, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f);
- uiPanelPush(block);
- ui_graphics_to_window_rct(sa->win, viewplane, &ri->disprect);
- uiPanelPop(block);
-
- /* correction for gla draw */
- BLI_translate_rcti(&ri->disprect, -sa->winrct.xmin, -sa->winrct.ymin);
-
- *ortho= get_view3d_viewplane(sa->winx, sa->winy, viewplane, clipsta, clipend, pixsize);
-
- rectx= ri->disprect.xmax - ri->disprect.xmin;
- recty= ri->disprect.ymax - ri->disprect.ymin;
-
- if(rectx<4 || recty<4) return 0;
-
- if(ri->rect && (rectx!=ri->pr_rectx || recty!=ri->pr_recty)) {
- MEM_freeN(ri->rect);
- ri->rect= NULL;
- ri->curtile= 0;
- printf("changed size\n");
- }
- ri->pr_rectx= rectx;
- ri->pr_recty= recty;
-
- return 1;
-}
-
-/* called before a panel gets moved/scaled, makes sure we can see through */
-void BIF_view3d_previewrender_clear(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
-
- if(v3d->ri) {
- RenderInfo *ri= v3d->ri;
- ri->curtile= 0;
- if(ri->rect)
- MEM_freeN(ri->rect);
- ri->rect= NULL;
- }
-}
-
-/* afterqueue call */
-void BIF_view3d_previewrender(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
- Render *re;
- RenderInfo *ri; /* preview struct! */
- RenderStats *rstats;
- RenderData rdata;
- rctf viewplane;
- float clipsta, clipend, pixsize;
- int orth;
-
- /* first get the render info right */
- if (!v3d->ri) {
- ri= v3d->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo");
- ri->tottile= 10000;
- }
- ri= v3d->ri;
-
- if(0==view3d_previewrender_get_rects(sa, &viewplane, ri, &clipsta, &clipend, &orth, &pixsize))
- return;
-
- /* render is finished, so return */
- if(ri->tottile && ri->curtile>=ri->tottile) return;
-
- /* or return with a new event */
- if(qtest()) {
- addafterqueue(curarea->win, RENDERPREVIEW, 1);
- return;
- }
- //printf("Enter previewrender\n");
- /* ok, are we rendering all over? */
- if(ri->re==NULL) {
- char name[32];
-
- ri->status= 0;
-
- sprintf(name, "View3dPreview %d", sa->win);
- re= ri->re= RE_NewRender(name);
- RE_display_draw_cb(re, view3d_previewrender_progress);
- RE_stats_draw_cb(re, view3d_previewrender_stats);
- RE_test_break_cb(re, qtest);
-
- /* no osa, blur, seq, layers, etc for preview render */
- rdata= G.scene->r;
- rdata.mode &= ~(R_OSA|R_MBLUR);
- rdata.scemode &= ~(R_DOSEQ|R_DOCOMP|R_FREE_IMAGE);
- rdata.layers.first= rdata.layers.last= NULL;
- rdata.renderer= R_INTERN;
-
- RE_InitState(re, NULL, &rdata, sa->winx, sa->winy, &ri->disprect);
-
- if(orth)
- RE_SetOrtho(re, &viewplane, clipsta, clipend);
- else
- RE_SetWindow(re, &viewplane, clipsta, clipend);
- RE_SetPixelSize(re, pixsize);
-
- /* until here are no escapes */
- ri->status |= PR_DISPRECT;
- ri->curtile= 0;
- //printf("new render\n");
- }
-
- re= ri->re;
-
- PIL_sleep_ms(100); /* wait 0.1 second if theres really no event... */
- if(qtest()==0) {
-
- /* check status */
- if((ri->status & PR_DISPRECT)==0) {
- RE_SetDispRect(ri->re, &ri->disprect);
- if(orth)
- RE_SetOrtho(ri->re, &viewplane, clipsta, clipend);
- else
- RE_SetWindow(ri->re, &viewplane, clipsta, clipend);
- RE_SetPixelSize(re, pixsize);
- ri->status |= PR_DISPRECT;
- ri->curtile= 0;
- //printf("disprect update\n");
- }
- if((ri->status & PR_DBASE)==0) {
- unsigned int lay= G.scene->lay;
-
- RE_SetView(re, G.vd->viewmat);
-
- /* allow localview render for objects with lights in normal layers */
- if(v3d->lay & 0xFF000000)
- G.scene->lay |= v3d->lay;
- else G.scene->lay= v3d->lay;
-
- RE_Database_FromScene(re, G.scene, 0); // 0= dont use camera view
- G.scene->lay= lay;
-
- rstats= RE_GetStats(re);
- if(rstats->convertdone)
- ri->status |= PR_DBASE|PR_PROJECTED|PR_ROTATED;
- ri->curtile= 0;
-
- /* database can have created render-resol data... */
- if(rstats->convertdone)
- DAG_scene_update_flags(G.scene, screen_view3d_layers());
-
- //printf("dbase update\n");
- }
- if((ri->status & PR_PROJECTED)==0) {
- if(ri->status & PR_DBASE) {
- if(orth)
- RE_SetOrtho(ri->re, &viewplane, clipsta, clipend);
- else
- RE_SetWindow(ri->re, &viewplane, clipsta, clipend);
- RE_DataBase_ApplyWindow(re);
- ri->status |= PR_PROJECTED;
- }
- ri->curtile= 0;
- //printf("project update\n");
- }
-
- /* OK, can we enter render code? */
- if(ri->status==(PR_DISPRECT|PR_DBASE|PR_PROJECTED|PR_ROTATED)) {
- //printf("curtile %d tottile %d\n", ri->curtile, ri->tottile);
- RE_TileProcessor(ri->re, ri->curtile, 0);
-
- if(ri->rect==NULL)
- ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "preview view3d rect");
-
- RE_ResultGet32(ri->re, ri->rect);
- }
-
- rstats= RE_GetStats(ri->re);
- if(rstats->totpart==rstats->partsdone && rstats->partsdone)
- addqueue(sa->win, REDRAW, 1);
- else
- addafterqueue(curarea->win, RENDERPREVIEW, 1);
-
- ri->curtile= rstats->partsdone;
- ri->tottile= rstats->totpart;
- }
- else {
- addafterqueue(curarea->win, RENDERPREVIEW, 1);
- }
-
- //printf("\n");
-}
-
-/* in panel space! */
-static void view3d_previewdraw_rect(ScrArea *sa, uiBlock *block, RenderInfo *ri)
-{
- rctf dispf;
-
- if(ri->rect==NULL)
- return;
-
- BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f);
- ui_graphics_to_window_rct(sa->win, &dispf, &ri->disprect);
-
- /* correction for gla draw */
- BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin);
-
- /* when panel scale changed, free rect */
- if(ri->disprect.xmax-ri->disprect.xmin != ri->pr_rectx ||
- ri->disprect.ymax-ri->disprect.ymin != ri->pr_recty) {
- MEM_freeN(ri->rect);
- ri->rect= NULL;
- }
- else {
- glaDefine2DArea(&sa->winrct);
- glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect);
- }
-}
-
-/* is panel callback, supposed to be called with correct panel offset matrix */
-void BIF_view3d_previewdraw(struct ScrArea *sa, struct uiBlock *block)
-{
- View3D *v3d= sa->spacedata.first;
-
- if (v3d->ri==NULL || v3d->ri->rect==NULL)
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- else {
- view3d_previewdraw_rect(sa, block, v3d->ri);
- if(v3d->ri->curtile==0)
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- }
-}
-
diff --git a/source/blender/src/prvicons.c b/source/blender/src/prvicons.c
deleted file mode 100644
index 6222090705a..00000000000
--- a/source/blender/src/prvicons.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/* DataToC output of file <prvicons> */
-
-int datatoc_prvicons_size= 13732;
-char datatoc_prvicons[]= {
-137, 80, 78, 71,
- 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0,192, 0, 0, 0,192, 8, 6, 0, 0, 0, 82,220,108, 7, 0, 0, 0,
- 6, 98, 75, 71, 68, 0, 0, 0, 0, 0, 0,249, 67,187,127, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1,
- 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,215, 8, 27, 17, 57, 33, 43,142, 73,203, 0, 0, 0, 29,116, 69, 88,116, 67,
-111,109,109,101,110,116, 0, 67,114,101, 97,116,101,100, 32,119,105,116,104, 32, 84,104,101, 32, 71, 73, 77, 80,239,100, 37,110,
- 0, 0, 32, 0, 73, 68, 65, 84,120,218,237,125,121,124, 84,213,249,254,115,238,189, 51,147,201,158, 12, 73, 72,216, 3,200, 98,
- 88, 69, 66, 38, 65, 16, 20,165, 40,213,162, 32, 45,138,203, 79,176,223, 42,180,110, 72,235,190, 97, 91, 91, 21,181,149,182, 90,
- 20, 42, 10, 66, 80,164, 34, 59,146, 5,194, 30, 18, 8, 75, 2,201,144,144,201, 62, 73,102,189,247,158,243,251, 35,235, 36, 51,
-217,200,100, 38,229, 62,159,207,124,146,123,239,153, 59,207, 61,247,125,207,121,223,247,156,243, 30, 64,129, 2, 5, 10, 20, 40,
- 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2,
- 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,
-160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5,
- 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160,
- 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,208, 18, 36, 41, 41,105,
-180, 32, 8,143, 16, 66, 72,119,223,156, 49, 22, 46,203,242,112,198,216,203, 41, 41, 41,251, 60,241, 0,189,157,191, 2,239, 43,
-192, 61, 49, 49, 49, 27,230,204,153,227,215,157, 55,206,206,206,198,169, 83,167, 16, 25, 25, 9,131,193, 64, 37, 73,154,150,146,
-146,146,226, 1, 5,232,213,252, 21,120, 23, 2, 0, 68, 71, 71,219, 23, 46, 92,216,109, 2,180,105,211, 38, 24, 12, 6, 60,250,
-232,163,224, 56, 14, 7, 15, 30,228, 50, 51, 51, 15, 36, 38, 38, 38,164,166,166,102,116,247, 67,244,118,254, 10,188, 7,174,187,
-111, 40, 73, 18,214,175, 95,143, 5, 11, 22,160,111,223,190,240,247,247, 71, 98, 98, 34,226,226,226, 56,149, 74,149,174,215,235,
- 39,250,114,133,244,118,254, 10,188,172, 0, 6,131, 1,193,193,193,136,136,136,128, 32, 8,208,106,181,208,106,181,208,235,245,
- 24, 57,114, 36,167, 86,171, 51,244,122,125,156,175, 86, 72,111,231,175,192,203, 10, 80, 88, 88, 8,157, 78,215,120,172,209,104,
- 26,133, 40, 49, 49, 17,195,135, 15,231,213,106,245,137,132,132,132, 27,124,177, 66,122, 59,127, 5, 94, 86,128,192,192, 64, 88,
-173, 86,167,115,254,254,254,141,159,164,164, 36,196,198,198, 10,126,126,126, 89,122,189, 62,214,215, 42,164,183,243, 87,224,101,
- 5,208,233,116, 48,153, 76,173,206, 55,180,162, 90,173, 22, 73, 73, 73, 24, 56,112,160, 74,163,209,156,213,235,245, 3,124,169,
- 66,122, 59,127, 5,157,131,208,221, 55,140,138,138, 66, 77, 77, 13,172, 86, 43,180, 90, 45, 0,160,170,170, 10,165,165,165, 40,
- 47, 47, 71,105,105, 41, 44, 22, 11, 6, 15, 30, 12, 81, 20,213, 87,175, 94, 61,175,215,235,135,164,165,165, 21,251, 66,133,244,
-118,254, 10,188,172, 0,106,181, 26,227,199,143, 71, 78, 78, 14,116, 58, 29, 14, 28, 56,128,130,130, 2,196,198,198, 34, 42, 42,
- 10, 67,135, 14, 5,207,243, 72, 77, 77,133,209,104,132, 40,138,126, 26,141, 38, 79,175,215, 15, 74, 75, 75, 43,245,118,133,244,
-118,254, 10,188,172, 0, 0, 48,109,218, 52,124,250,233,167, 16, 69, 17,143, 63,254, 56,102,206,156, 9,181, 90,237, 84,102,209,
-162, 69, 48,153, 76, 88,183,110, 29,182,108,217,162,165,148,190, 9,224, 9, 0,204,219,149,210,219,249, 43,240,162, 15, 0, 0,
- 9, 9, 9, 8, 12, 12,196, 71, 31,125,132,217,179,103,183, 18,158, 6,132,132,132,224,201, 39,159,132, 70,163, 97, 86,171,117,
-108,104,104,104,127, 0,196,219,149,210,219,249, 43,240,178, 2, 4, 5, 5, 97,205,154, 53,136,137,137,233, 80,249, 33, 67,134,
- 72, 86,171,213,204,243,252,253,190, 32, 64,189,157,191, 2, 47, 43, 0, 0, 8, 66,199,173, 43, 63, 63, 63, 70, 41,149, 24, 99,
- 26, 95, 17,160,222,206, 95,129,151, 21,160,139,144,123,121,125,202,138, 72, 41, 10,208, 37, 16, 66,100, 66, 72,175, 21,160,222,
-206,255,122,133,208, 19, 63, 98,178,216,193, 24,131, 74,224, 17,160, 81,185,109, 61, 25, 99, 50,122,111, 20,165,183,243, 87, 20,
-192, 19,200, 45,174,194,152,103, 62, 5, 0, 68,135, 5,226,252,234, 37,224,185,122, 51,153, 81, 56,142,252, 11,183, 71, 92,225,
- 39,223, 22, 56, 50, 88,173,213,234, 99,111,136,134, 64,254, 25,249,155,244,139,158,230,166, 82,185, 85, 70,136,162,216,217, 30,
-128, 2,160,138, 15,160, 40,128, 19, 62, 63,112,186,241,255,171,149,181,248,241,100, 30,126, 54,113, 40, 0,128,154,174,192,126,
-124, 61,146,194,192, 35, 76, 51, 28,192,112, 0,183, 17,137,255,216,155,194,223,145,235, 45,148,132, 1,104, 48,129,148, 30, 64,
-241, 1,234,109, 2,202,240,159,159,178,157,206,125,113, 32,171,241,127, 90,118,190,213,119, 24, 80, 30,190, 60,165,192,155,194,
-223,197,251, 80,197, 9, 86, 20,192, 9, 59, 79, 93,194,213, 42, 51,180,234,166,142,230,135, 19,121, 40,173,182,212, 41, 72,217,
- 5,184,208,128, 19,189,169, 2,155, 41, 1,173,247, 1, 20, 40, 10,224,220,218,191,255,240, 76, 52, 44, 89, 23,101,138, 13, 41,
-103,234, 36,166,212,101, 15,112,220,215, 43, 77, 20, 69,167, 15, 0, 13,165, 20, 0,244, 0,120, 69,172, 20, 5, 64,105,181, 5,
-255, 61,158,139, 65, 17, 33, 88,116, 75, 28,102,196, 13,106,230, 23,100,213,247, 0, 46, 20,128,178,227,189,173, 18, 25, 99, 0,
- 16, 7,160, 76,241, 1, 20, 39, 24, 0,176, 33,229, 12, 68,153,226,161,105, 55,130, 16,224,161,105, 99,176,231,116, 62, 0,224,
-236,149,114,100,100,102, 97,148,189,166,213,247,204,140,157, 0,128,146,143,167, 7,242,212, 54, 7,192, 72, 70,137,131,227,113,
- 90,148,232,145,168,223, 30, 54,250,168, 2,252, 4,160, 90, 17, 41,165, 7,104,108,229, 57, 66,240,224,180,186,229,179,115, 39,
- 13, 67, 88, 64, 83,226,134,181,123, 91,155,250,162,204, 44,187,114,228, 75,229,171,227,159,225,101, 91, 49, 24,190, 2,195,171,
-132,176,183, 25,101,219, 4,142,228, 85,172, 78, 88,234,139, 21,233,112, 56,202, 25, 99,134,122,103, 88,193,245,172, 0, 71,115,
-139,113,246, 74, 57,102,142, 25,132,254,225, 65, 0, 0,141,138,199,130,196, 81,141,101, 54,159, 42,133, 85,118, 54,151,171,172,
-180,224, 23,113,170,117, 0,121, 23, 64,128,139, 91,251, 51,176, 79,202, 62, 72, 88,229,131,117, 25, 98,179,217,250,195,247,166,
-151, 40,232,105, 5, 88,187,191, 46,246,191,120,250, 24,167,243, 15, 79,111, 74,166, 80,227, 96,216, 86,230, 60,219, 82, 23,192,
- 15, 35,192,130,246,238, 79, 8,123,166,236,189, 41,163,188, 85,105, 42,149,170, 85, 40,149, 16, 2, 74,169, 77, 81,128,235, 92,
- 1, 44,118, 17,223,164,159,131, 46, 72,139,187,110, 26,234,116,109,236,160, 72,140, 27, 28,217,228, 39, 24, 7, 57,147, 33, 16,
- 24, 96, 7,240, 79, 2,242, 75, 2,242, 75, 6, 28,112, 37,131,132,195,115,222,170,180,102,209,159, 70,225,231, 56, 14, 42,149,
-234, 40,234,162, 64,202,104,240,245,170, 0, 91,143, 92, 64,181,213,142, 7, 18, 71, 65, 45,180,142, 8, 62,220,172, 87, 72,175,
- 14,199,101, 91,147,165, 67, 41,236,162,204,238,214, 45, 59,180, 36,124, 89,250,134,240,101,233, 27,116, 21,126,183, 1,200,105,
-221, 13,224,198,107, 17, 96, 15, 33,166,222, 7, 96, 0, 84,138,120, 93,135, 10,208, 16,251, 95, 60,205,117,238,168,249,250,145,
-240, 19,184,250,232, 9,193,134,226,129,141,215, 14, 92, 52,255, 43,250,119,135,247, 56,201,249,171,251, 37, 66, 88,178,139,216,
-139, 79,229,229,169,207,205, 43,212,127, 72,125,221,106, 20, 17,187,142, 20,224, 82,137, 9, 7,207, 26, 48, 49, 54, 10,113, 3,
- 35, 92,150, 9, 11,240,195, 93,195,154,150, 24,126,109, 28, 8,153, 17, 88, 37, 88, 95,218,102,220,233, 70,188,170, 92,156,243,
-243,149, 74,164,148,130, 82, 10, 73,146, 56, 0, 13,221,139, 31,234,204, 57, 5, 62,140,110, 29, 7,248,226, 64, 22, 24, 3,146,
- 70, 14, 64,102,126,137,219,114, 19,131, 42,241, 13,234, 82,142, 92,117,248, 97,127,101, 36, 2,107, 11, 47, 24,107, 36,171,171,
-242,140,161,159,139,211, 62,149,129,161,190, 7, 16,209, 52, 16,102, 82,196,235, 58, 82, 0,202, 24,214,255, 84,103,254,172,254,
-239, 81,172,254,239,209, 54, 74,107,157,142, 54, 24, 7,226, 94,114,165,202,221,130, 18, 2, 50,136,181, 30, 96,205,242, 86,165,
- 53, 68,128,154,251, 18,140, 49,112, 28, 39,214,215,169,168,136,214,117,166, 0,187, 78, 93, 70, 97, 69, 45,166,142, 26,128,219,
-199, 14,118, 95, 80,118,192,126,116, 45, 14,155,194,177,187, 50, 10, 0,240, 99,121, 95,220,168,209, 88, 40,165,173,166, 19,151,
-175,142, 15,102, 96,183,182,234, 21, 0,175,231,234, 87,169, 84, 78, 74,192,113,156, 67, 49,123,174, 83, 5,104,112,126, 95,186,
- 79,143,164,145,253,221,150,147,138, 78,192,106, 60,143,139,186, 64,236, 62, 86,167, 0, 14,198,225, 44, 63,108, 24, 33, 57,178,
- 11,211,226, 9,198, 16,220,178,195,225,101,124,233, 11, 21,216,208, 27,168, 84, 42,155, 90,173,110,112,128, 21, 92, 79, 78,112,
-121,141, 21,219,143,231, 98, 72,100, 8, 18, 71,244,111,219, 84,170,159, 1, 58,204,191, 22, 55, 7, 87, 52,158, 63, 45,247, 31,
- 76,235,167, 84, 54,160,236,195,201, 51, 24,195, 75, 46,140,162, 45, 97,191, 59,116,217,135,236,255, 82, 65, 16,120, 40, 19,225,
-174,207, 30,224,171,212,179,112, 72, 50, 22,221,114, 35,218,219,169,171,249, 26,128, 95, 70,229,227, 72,117, 56, 0, 32,207, 22,
- 36,124,241,127,250, 79,110,139,170,120,141,112, 40,231, 25,110,167, 12,207,160,117, 40,209,194,113,228, 89, 95,170, 68,158,231,
- 3,120,158,175, 97,140, 29,135, 50, 23,232,250,235, 1,214,238, 63, 13,142, 16, 44,186,165,253,125, 35,154,175, 2,251,121, 68,
- 33,252, 57,169,241,120,111,109,255, 49, 60,193, 55, 28,195, 62, 6,252,158,180, 22,126, 10, 66, 30, 14,123, 50, 45,223,199,234,
-145, 17, 66,168, 39, 54,234, 83,224,163, 61, 64, 65, 89, 53,118,158,186,132,242, 26, 43,178, 13,101,232, 23, 30,136, 31, 79,230,
- 1, 0,126, 54,113, 40, 98,194, 2, 91, 75,137,100, 3,173, 42, 64,165,164,198,119,165,117,243,128, 6,105, 45, 56,107,174, 51,
-241,183,148,246,199,232,128,186, 25,197,183,134,149, 96,160,159,197,201,125, 32,192,178,240,167,210, 55,249, 82, 5,138,162,216,
- 16, 2,149, 91,154,112, 10,254,135, 21, 32,203, 80,134,101,159,237,110, 60, 46,172,168,109, 60, 30,214, 55,204,165, 2,208,242,
- 92,128, 81, 20,219,253,240,252,197,113,173,174, 87, 75,170,198,243,159,141,202,104,174, 0, 57,132,224,255,133, 63,117, 40,181,
- 59, 5,247, 90,215, 6, 55, 68,128, 24, 99,168,239, 1, 20, 5,184, 94, 20, 32,126, 88, 52,118,252, 97,190,203,107, 99, 7,185,
- 30, 5,230,130,251, 65, 59,247, 3,140,112,200,216, 62,185,166,222,129,228,177,230,235, 31,109,135,207,228,173, 11, 12,208,156,
-126,112, 28, 25, 30,161,178, 15, 25, 27,100,178, 1,200, 97,132,238,235,243, 84,198, 94, 79,181,222,157, 77,141, 34, 73, 82,171,
-180,137,132, 16, 48,198,168, 44,203, 65,138, 72, 93, 39, 10,160, 11,210,226,150,209,157,219, 28,133,104, 67, 33,104, 39, 32, 4,
-192,173,131,155,206,127,191,245, 59, 57,220,116,225, 66,126,102,254,174, 63,236, 48,125,212,147,209,148,206, 78,140,115,151, 51,
- 84,201, 12,119, 29, 59,193,221,132,222, 46, 64,138, 2,244,214, 30,192,100, 50, 9, 25, 25,222,219,255,217,100, 50,241,132, 16,
- 42,203,178,220,197,239,247,106,254, 10,188,171, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99, 76,141,186,176, 30,
-234, 77, 17,214,204, 36, 97,132,144,198,255, 91, 94,115,119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212, 59,145,157, 53,
-127,122, 59,127, 5, 94, 68,243,184, 53,167,211,233,150, 3,232,139,166, 44,103, 50, 99, 76, 34,132,200,140, 49,153, 16, 34, 53,
- 59, 71,155, 93,107, 56, 47, 19, 66,164,250, 4, 81,114,195, 53, 66,136, 76, 41,149, 90, 28,203, 13,118, 51,165, 84,146,101, 89,
- 98,140, 89,204,102,243,149,174,154,115,189,156,191, 2, 47, 43, 0, 9, 12, 12,140,230, 56, 78, 77, 8, 97,245, 19,189, 26, 91,
-185,134, 86,176,249,113,125,232,143, 1,128,195,225,112,106, 65, 9, 33,172,217,167,161, 44, 44, 22,139,211, 61, 56,142, 99,132,
- 16, 86, 89, 89,201,234,133,182,171, 51, 41,123, 59,127, 5, 94, 86, 0, 87,199, 29, 5,243,209,231,233,109,252, 21,244,180,192,
- 36, 37, 37,141, 22, 4,225, 17, 79, 12,227, 51,198,194,101, 89, 30,206, 24,123, 57, 37, 37,101,159, 39, 30, 64,225,175,240,191,
- 86, 5,184, 39, 38, 38,102,195,156, 57,115,186,117,137, 97,118,118, 54, 78,157, 58,133,200,200, 72, 24, 12, 6, 42, 73,210,180,
-148,148,148, 20, 15,188, 0,133,191,194,255,154,162, 64,136,142,142,182, 47, 92,184,176,219, 30, 96,211,166, 77, 48, 24, 12,120,
-244,209, 71,193,113, 28, 14, 30, 60,200,101,102,102, 30, 72, 76, 76, 76, 72, 77, 77,237,246,120,165,194, 95,225,223, 85,116,251,
- 64,152, 36, 73, 88,191,126, 61, 22, 44, 88,128,190,125,251,194,223,223, 31,137,137,137,136,139,139,227, 84, 42, 85,186, 94,175,
-159,232,203, 54,161,194,255,250,226,223,237, 10, 96, 48, 24, 16, 28, 28,140,136,136, 8, 8,130, 0,173, 86, 11,173, 86, 11,189,
- 94,143,145, 35, 71,114,106,181, 58, 67,175,215,199,249,234, 11, 80,248, 95, 95,252,187, 93, 1, 10, 11, 11,161,211,233, 26,143,
- 53, 26, 77,227, 67, 36, 38, 38, 98,248,240,225,188, 90,173, 62,145,144,144,112,131, 47,190, 0,133,255,245,197,191,219, 21, 32,
- 48, 48, 16, 86,171,115,118, 19,127,127,255,198, 79, 82, 82, 18, 98, 99, 99, 5, 63, 63,191, 44,189, 94, 31,235,107, 47, 64,225,
-127,125,241,239,118, 5,208,233,116, 48,153, 90,167,196,105,208, 98,173, 86,139,164,164, 36, 12, 28, 56, 80,165,209,104,206,234,
-245,250, 1,190,244, 2, 20,254,215, 23,255,110,223, 32, 35, 42, 42, 10, 53, 53, 53,176, 90,173,208,106,235,242,255, 84, 85, 85,
-161,180,180, 20,229,229,229, 40, 45, 45,133,197, 98,193,224,193,131, 33,138,162,250,234,213,171,231,245,122,253,144,180,180,180,
- 98, 95,120, 1, 10,255,235,139,127,183, 43,128, 90,173,198,248,241,227,145,147,147, 3,157, 78,135, 3, 7, 14,160,160,160, 0,
-177,177,177,136,138,138,194,208,161, 67,193,243, 60, 82, 83, 83, 97, 52, 26, 33,138,162,159, 70,163,201,211,235,245,131,210,210,
-210,188,158,237, 77,225,127,125,241,247,200, 22, 73,211,166, 77,195,167,159,126, 10, 81, 20,241,248,227,143, 99,230,204,153, 80,
-171,213, 78,101, 22, 45, 90, 4,147,201,132,117,235,214, 97,203,150, 45, 90, 74,233,155, 0,158,128, 15, 76, 75, 80,248, 95, 63,
-252, 61,178, 32, 38, 33, 33, 1,129,129,129,248,232,163,143, 48,123,246,108,183,171,168, 66, 66, 66,240,228,147, 79, 66,163,209,
- 48,171,213, 58, 54, 52, 52,180, 63,124, 32,177, 84, 75,254, 45, 43, 95,225,255,191,195,223, 35, 10, 16, 20, 20,132, 53,107,214,
- 32, 38, 38, 6,207, 62,251, 44,102,204,152, 1,135,195,225,182,252,144, 33, 67, 36,171,213,106,230,121,254,126, 95,120, 1,205,
-249,119, 4,189,141,191,217, 46,225, 82,105, 45,142, 95,174,192,190, 51,197,136,136,155, 70, 73,212, 40,191,136,184,169,207,196,
-175,248, 79,191,235,169,254, 61,182, 75,164, 32, 8,248,252,243,207,177,122,245,106, 0, 64,114,114, 50, 22, 44,112,189,251,145,
-159,159, 31,163,148, 74,140, 49, 13,124, 36,181,160,187, 94,171, 55,243, 63,122,169, 2,155, 50, 12,200, 41, 50,129,202, 82, 99,
- 90,119, 22, 54,158, 15,157, 50,118,124, 8,165,227, 41,149,151, 37,190,240,245, 22,202,196,215,210,255,184,232,244,255,122,253,
- 11,158,124,136, 63,252,225, 15, 0,128,216,216, 88,124,241,197, 23,110, 21,160, 25,122,251,146, 66,159,229,127,185,204,140, 55,
-191,205,134,192, 1, 49, 33, 26, 20,148,137, 96,148,130,177, 86, 31, 2, 70,231,129,146, 95, 76,126,118,253,188,140,119, 23, 37,
-119,250,189,111,248, 9, 89, 5,158,245,167,191,121,246, 94,168,120,238,154,235,223, 99, 10, 80, 84, 84,132,146,146, 18,188,249,
-230,155,120,238,185,231,176,120,241,226, 54,203,247,246,172, 10,190,206,255, 68,126, 37, 24,163,120,235,254, 9, 24, 17, 29,140,
- 63,109, 59,141,189, 89, 69, 96, 13,189, 64,227, 95,214,112, 76, 64,233, 59, 0, 58,173, 0,207,220, 61, 25, 14,201,179, 85,209,
- 82,248,187, 90,255, 30, 83,128,236,236,108, 68, 68, 68,224,217,103,159, 5, 33, 4,185,185,185, 46,115,234, 52,215,222,250,165,
-136,189,117,113,138, 79,243, 63, 83,104, 2,165, 20, 2, 87,103, 33,168, 56, 82,215, 3,180,248,180, 80,130, 27,110, 90,178,198,
-255,216, 63,150, 90, 58,243, 91, 57,133,229, 40,175,181, 94, 51,103,209, 97,119,235, 59,206, 26, 59, 24, 92,253, 18, 4,187,221,
- 14, 89,150, 57, 89,150,213, 0, 66,208,118,126,214,234,230,215, 59,164, 0,159,237,205,196,165,146,206,109,120,146,157,150,138,
-232, 81,147,240,202,198, 84, 72, 14, 59,206,156,191,136, 87,190, 78, 1,199,183,222, 56,239, 80, 77, 8, 95, 54,112,234, 72,235,
- 0,149, 86, 8, 31, 20, 13,144,118,133, 72, 82,227,143,248,114,101,165, 15,245, 0,180,190, 98,125, 50, 63,168, 67,148,193, 40,
-195,138, 47,143,162, 95,152, 22, 57,133,149,117, 2,207, 24, 24,163,160,204,165, 57, 4,217, 95,173, 6,208, 41, 5,200, 51, 86,
- 33,191,172,250,154, 57,239, 92,247, 49,210,183,111,236, 72, 81, 53,128, 59,235, 63,111,183, 83,246, 70, 0,103, 58,165, 0,250,
- 17,253,220,238,249,229, 14, 17, 86, 3,138,250,248,225,238, 73,195,240,233, 71,239, 33,208,223, 31, 63,143, 31,225,186,194, 82,
-183,211, 98, 83,126,161,228, 96,167,164,240,129,223, 18,158,111, 63,197, 96,165,214,210, 93,194, 65,171, 12,224, 66, 59, 54,162,
-110, 50,153, 96,179,217, 16, 21, 21,213,252, 52, 67, 83, 94, 32, 31,237,193,234, 4,221,108,151,113,174,200,214, 36,244,148,130,
- 82,230,214, 20, 2,215,249, 64,225,162, 91,110,236, 22,198,166, 67,201, 72,175,139,242, 32, 34,194,181,252,157, 57,115, 6,181,
-181,181, 13,141, 80, 25, 99, 44,215,205,237, 70, 1,173,246,153,232,152, 2,140,236,167,235,188, 61, 80, 58, 4, 63, 92,202, 65,
-148,202,129, 13,159,125,130, 25, 51,102, 96,242,176,104,151,101,163, 84, 14,234, 95,109, 40,179,150,151, 95,172,201,220,123, 8,
- 61,156, 98,220,113, 98, 61,184,136, 17, 80,199,253,162,221,178, 85, 85, 85,152, 59,119, 46,118,239,222,221,242,165, 80, 95,115,
-130, 25, 99, 16,229, 58,125, 92,126,199, 72,136,242, 8,103,253,100,117,255, 63,248,167,173,204, 14,129,184, 50,133, 0,128, 93,
-125,186, 97,177,139, 68,162,255, 42,181,247,187,203,255,189, 27, 39, 47,151, 92,187,227,158, 86,183, 59, 46, 55,106, 6,248,113,
- 83,157,174,237,122,105, 1,212, 2,143,105,211,166, 33, 61, 61, 29, 0,160,209,104,126,176,217,108, 15,187,145,159, 61, 0,102,
-244,152, 15, 48, 96,192, 0, 28, 59,118, 12,219,183,111,135,205,102,195,252,249,243,219,109,136,235,109,104,175,180,142,246,148,
- 15, 64, 56, 30,170,209, 63,111,183,244,217,179,103,113,199, 29,119, 96,231,206,157,232,211,167,143, 15,240,119,150,233,140,188,
- 10,164,158, 47, 65, 70, 94, 57,204, 86, 7, 40,149, 91,181,240, 78,231,160, 34, 13, 38, 80, 75, 83,232,181,159, 93,137, 4,112,
-174,241, 25,175,254,238, 44,152,188,140,196,172,118,155,175,245,131, 71,110,235,150,103,121,222,122, 18,239,103,236,192,138,123,
-226,241,240,195,191,236,136,194,119,186,225,236,144, 2, 56, 36, 25,148,117,174,103, 55,219,108,216,187,119, 47,100, 89, 70,100,
-100, 36,102,205,254, 25,108,162,228, 38,118, 72, 64,121, 1,208,104, 57,220,189,212, 15,186,232,246, 31,100,237, 43,246,142,248,
- 10,157, 81, 2,219, 79,127, 5, 8, 15,213,168,187,218, 45,157,149,149,133, 59,239,188, 19, 59,119, 54,238,236,234, 19, 81,160,
- 79,246,229,226,199,204,162, 38, 97,111, 33,216, 77, 2,206,156,237,125, 23,166, 80,235, 42,162, 28,152,116, 35,152,252, 29, 51,
- 44, 25, 72, 6,252,163,194, 21,135,175,211,114, 96,232, 6, 31,224,104,110,221,252,182, 31, 79, 94, 66,217,119,206, 43, 33,127,
-119,215,205,224,185, 86,238,150,103, 20,224,181, 77,169,157,138,235, 58,204,213, 72, 91,243, 18, 26, 50, 5, 14,152,181, 24,143,
-253, 99,143,251, 22,181, 50, 92, 85, 26, 59,123,170, 72, 84,163, 4, 77,240, 47, 96,110,223,142,150, 22,190,189, 24, 27, 96,236,
-238,158,192,118,224,207, 0,199, 67, 53, 98,118,187,165, 51, 51, 51, 49,123,246,108, 76,154, 52, 9,245,137,182,188,170, 0, 57,
- 87,107,240,227,233,171,237, 10,182,187,191,172,222,236,113, 45,252, 18,192,228,186, 15,149, 2,192,228,223, 0,120,195,165, 73,
- 27,226,223, 24,161,185, 22,204,152, 53, 27, 67, 6, 13, 68,220,164,201,232, 31, 17,210, 34,232,224,218,138,104,227,118, 31, 3,
-216, 6,160,184,211, 10,240,214,194, 91, 58, 69,124,225,194,133,176, 86,214,217,128, 43, 86,172,192, 27,111,188,209,102,249,167,
-159,126,218,177,235,232,174, 93,165,165,165,187, 42, 42, 42,190,132, 87,183, 25, 98,176,237,255, 35, 8,199, 67, 24, 62,171,221,
-210, 39, 78,156, 64, 97, 97,161, 42, 40, 40,136,247,182, 15,176,247,140,177, 93,193,102, 45,206, 57,149,173,239, 33,154,161,118,
-214,232,138, 64, 48, 9,160,178,179, 18, 48,233,255,220, 41,192,164,161,125, 33,201,215,254, 10,111, 31, 59, 8,192,189, 46,175,
-185, 81,176,182, 26,206, 45, 93,238, 1, 58,131, 77,155, 54, 97,243,230,205, 0,128,233,211,167, 99,220,184,113, 29, 14, 35,250,
-130, 13, 93,223,213,195,186,247,109,104, 9, 15, 97,216,204,118,139,151,148,148,112, 85, 85, 85, 51,181, 90,237, 78,111,210, 46,
- 40, 51,183, 22,108, 39,211,135,181,109, 10, 81,218,232, 24,215,139,211, 14, 63, 34,198,131,214, 11,190,179, 18,244,101,185,247,
- 69, 76, 93, 92,236,210, 98,200,204,247,236, 72,240,182, 23,230, 65, 45,240, 61,227, 3,116, 20, 70,163, 17,203,150, 45, 3, 0,
- 60,245,212, 83, 88,190,124, 57,222,127,255,125,220,119,223,125,237, 9,191,207,216,208, 78, 74,176,231, 13,104, 57, 30, 66,236,
-244,246,205, 62,135, 35, 66,146,164, 21, 0, 54,163,110,176,165,199, 81,108,178,180, 22,236, 86,145,157, 54, 76, 32,103, 63,239,
-220,188,201,149,175,129,138, 59,235, 91,252,230, 38, 80,195,255,195, 93,241,248,243,131,183,122,235,173,121, 70, 1, 58, 58, 16,
-182,229,253,151, 80, 94, 94,142,126,195,227,224, 55,241,110,124,188,247, 44, 54,126,247, 3, 28, 3, 39, 35,172,175,251, 73,134,
-233, 53,193, 66,241,128, 91, 38, 89, 7,106,116, 66,112,244, 77, 62, 51, 16,198, 40,172,187, 95,131,246,118, 30,194,144,169,237,
-215, 62,165, 35,234,237,204,159, 1, 48,247,228,155,183,139, 50,202,170,173,109, 10, 56, 24,197,168,126, 97, 24, 30, 19, 10,127,
- 53, 95,175, 36, 12,187,247,236,145, 10,140,101,217, 18,175,189,164, 14, 31,144, 77,128,172,111,127,115,246,252,128, 80,219, 23,
- 96, 82,180,139,214, 31,245,102,209, 48, 87,202,254,238,119, 25, 56, 95, 84,225,209,231,253,248,241, 89,174,230, 2,121, 70, 1,
-166,223, 56, 16,147,134, 58,218,142,138,156, 58,129, 11,199,211,160,235, 19,129,127,253,123, 45, 34,162,250,226,245,149,207,162,
-164, 32, 23,255,120,254, 33, 68,247,235,143, 71,150, 62,137, 95, 44, 92,212,186,235, 78,219, 78, 75,170, 46, 94,144,236, 72,167,
-129,186,253,224, 85,237, 63,136, 40,246,140,128, 81, 25,214, 93,175, 64,123,199, 27, 16, 6, 37,118,228, 27,183,212, 43,193, 28,
- 0,214,158, 82, 0,158, 35, 0, 99,110,109,252,176, 64, 53,126, 63,111, 18,110, 30, 80, 14, 34, 93, 6, 88,211,134,246, 55,251,
-149, 18,201, 94,174,234, 19, 74,252, 71, 13,171,138, 38,160,119,130, 74,227, 65,101,190,141,214, 31, 96, 82,128, 43, 5, 88,144,
- 56, 10, 86,187,103,115, 4, 11,174, 7,232,152, 71, 20, 32, 54, 42,180,221, 50, 23,143,213,201,227,250,117, 95, 96,230,228,177,
- 88,191,126, 61,190,251,230,171,198,235, 87, 11,175,224,237,151, 95,192,200,193, 49,120,224,129, 7,156,190,219, 71, 37,202, 1,
-181, 87, 75,106,141,198,139,181,153,123, 79,194,215,246,218,165, 18,172, 59, 95,134,118,214,155, 0, 58, 52, 71,253, 86, 0,223,
- 1,184, 27,128,173, 39, 40, 10, 60,135,240, 0, 21, 74, 76, 98, 43, 27,159,128,225,181, 7,166, 96, 92,216, 15,224,106,178, 90,
-125, 87, 63, 30, 60, 88,232,104, 80,121,180,139, 86, 30,173,148,160, 73, 17,114, 80, 55,247,198, 9,102,155, 3,213, 86,199,255,
-142, 9,212, 17,148,151,151, 35, 52, 52, 20, 51,103,214, 57,141,111,189,245, 22,198,141, 27,135,249,243,231, 35, 47, 47, 15, 35,
- 71,142,196, 59,239,188,131, 23, 95,124,177,149, 2, 52,115, 96,124,119, 54,168, 44,194,150,242, 30,144,240,118, 71,191,113, 27,
-128,135, 0,252,163,167, 40,246, 13,209,194, 88, 89,219,202,244,153,114, 67, 20,198, 70, 21,128,171,205,114,209,102,182, 16,112,
- 87,166,142,203,243, 50, 64,165,179, 0,166,180,188,229,206, 83,151,112,161,216,179,214,233,196, 33, 81, 16,122,202, 4,170,181,
- 57,218, 13,107,197, 12, 28,140, 81,163,111, 68,149,217,134,146, 18, 35,114,115,115,241,205,214,239, 16, 63, 37, 1,143, 62,180,
- 8,171,222,125, 15, 34, 5,126,191,226, 57,100,229, 92, 64,255, 1, 77,115,111,236,148, 16, 89,229,175,146, 2,250,248,225,230,
-135, 67,161, 13,110,255, 65,198,163, 26,175,190,218, 99, 61, 5,231,175,131,118,206,187, 40, 55,117,184,151,125,191, 39,133, 31,
- 0,134, 68, 4,226,100, 94, 73,171,112,231,232, 1,225, 32,226,233,214,214, 66, 91,173, 60,117,161, 4,206,231,175,144,184,148,
-226,164,164,164, 86, 60,150,253,108,146,119,226, 22,158,138, 2,253,101,219, 17,100, 27,218, 14,107,201, 14, 59, 78, 95,184,132,
- 37,107,118,128,202, 18,180, 33, 58,124,145, 85,131,245, 57,251,144,117,165, 2, 75,214,236,128,100,139, 0, 39,168,240,252,231,
- 59, 17, 24,209,228, 20,103, 85,135,169,138, 7,207,184,205, 65,212, 99, 4, 77,224, 67, 29,114,130, 79, 9, 75, 0,148,244,152,
-240,207,253, 0, 92,232, 64,192,148,223, 81,225,255, 93, 79, 11,192,188,248,193,248,238, 72, 30,100,217, 57,220, 25,232,167, 2,
-161,181, 78,206,125,199, 90,249,230,202,209,226, 26,240, 23,119, 60,126,253,207,157, 56,158,231,217, 44, 43, 7,223,248, 85,171,
- 48,168,199,122,128, 87,238,239,144,243,135,249,199, 55,227, 47,247,223,132, 1, 3, 6,224, 29,249, 34,180,154, 34, 44, 95,190,
- 28,203,243,247,225,165,135,146,224,231,231,135, 81,127, 95,129,109,111, 62, 1,190,217,180,232,103,158, 57,232,216,115,108, 79,
-178,209,104,252,161,188,188,124,191, 47,249, 0, 78,194,223, 49,124,224, 13,225, 7,128,200, 16, 45,102,143, 31,128,173,135,115,
-157, 28, 96,231, 9,112,157,106,229, 91, 40,135,220,240,106, 74,219,234,221,254,254,248, 44,175,188,171,102,251,187,245,188, 15,
- 0, 0,127,255,251,223,241,252,243,207,227,239,127,255, 59, 94,120,225, 5, 36, 39, 39, 67,146, 36,140, 27, 55, 14,199,143, 31,
- 71,126,126, 62,238,184,227, 14, 39,225,111,230,189,203,148, 82,159,154, 78,220, 89,225,231,121,254, 27, 89,150,127,231, 77,206,
-191,190, 35, 14,126, 42, 14, 7, 78, 27, 80, 92, 89, 11, 6, 82, 63,106, 74, 1, 38,186,108,229,101, 81, 6,152, 36, 19, 34, 83,
- 14, 50,117,171, 4,117, 14,253, 81, 0,207,146,184, 84,183,211,209,119,158,186,132, 18,147,197,163,207,185, 48,105,116,171,185,
- 64,245, 38, 16,243,154, 2,232,116, 58,188,248,226,139, 88,185,114, 37,238,186,235, 46,220,123,111,221, 48,246,152, 49, 99,240,
-250,235,175,227,198, 27,111,196,154, 53,107,220,105, 47,245,165,129,176,206, 10,127, 80, 80,208, 17,149, 74,245, 65, 69, 69,133,
- 87,121,171, 4, 14, 75,102,197, 97,201,172, 22, 9,148, 77,123, 1, 42,186, 52,117,254,181, 45,216,158,113,228,196,231,209, 97,
-214,159, 94,249, 77,255,227, 42,158,177,102,189,193,121, 18,119,176, 83, 61,178, 40, 83,183, 19, 31,123,101, 20,232,147,157, 39,
-144,107,172,234, 56,139,209,183,227,131,173, 7,241,202,223,214,163,232, 66, 54,170,203,141,144, 28,118,140,184,255,183,120,225,
-203,159, 90,219,115,213, 33,234, 43, 3,111,157,105, 25,172, 29, 42,248,135,221,215,145, 69, 85, 18, 52,175, 99,211,211, 21,190,
- 32,252,227,198,141,147, 36, 73,218, 89, 88, 88,232, 91,225,219, 22,161,220,186, 86,189,181,169,179,244,238, 18,205,210,187,162,
-150,128,201, 75, 90,181,254, 96, 97, 0,170, 58,243, 83,115, 38, 14,245,150, 19,236, 25, 19,104,214,184, 33,168,181,117, 50,174,
-123,155,243, 62, 6, 75, 23,221,143,135,166,141,113, 89,180,228,200,143, 82, 85,213,197,147,146,168, 74,113, 12,158,156, 5,194,
-117,224, 65,170,107,125, 65,248,151, 45, 91, 6,198,152, 99,223,190,125, 62,190,168, 95,114,107, 2, 57, 69,129, 84,209,102, 16,
-129,192,122,222,191,203,102, 88, 39,157,224,221, 47, 63,128, 32,173,218,119,123,128,142, 12,132,181,135, 49,163, 70, 96,236,160,
- 72,151,215,250,168, 68, 57,168,182,176,168,186,176,240,172,249,232,182,147,222,242, 3,186, 34,252,239,190,251, 46,158,121,230,
- 25,230,107, 38, 92,235,214,145, 7,105, 48,129,220,216,248,148,105,109, 92,236,218, 0, 16, 14,184,176,160, 22,142, 66,127, 0,
-246, 78,251,130, 94,114,130,225,205,129,176,230, 56,113,226, 4,190,252,242, 75, 76,157, 58, 21,115,231,206, 5, 0, 12, 29, 58,
- 20,178, 44,187,114,128, 27, 39,195,213, 59,193,232, 77,194,239, 43,252,219, 85, 0,213, 96,192,156,222,102,180,135, 48,137,135,
- 92, 13,112, 26, 64,174, 38, 0, 78,146,184, 84,171,175, 61,203,246,237,219, 81, 88, 88, 8, 0, 40, 46,110,234,105, 40,165, 19,
-209,148, 31,116, 63,128,156, 30, 87, 0, 74, 41,230,205,155,135, 43, 87,174,224,227,143, 63,198,241,227,199, 49,114,228, 72,132,
-132,132,192,106,181, 34, 48, 48,208,149,237,230, 85, 39,152,248,247,233,178,240,251, 2,255, 14,189,151,192, 89,224, 44,135, 64,
-172,103, 93,155, 64,160, 32,128, 10,231,127,110, 7, 56, 6, 38,137, 0,150,250,226,179,172, 94,189, 26,251,246,237,115, 37,123,
-115, 80, 55, 7, 11, 0, 30,243,138, 2,212,214,214,226,202,149, 43,141,202,208,208,226, 23, 23, 23, 67, 20, 69,119, 17, 32, 48,
-198,168,220,176,132,172,135,161,185,249, 49,128,227, 59, 84,182, 95,191,126, 78,194,239, 11,252, 59,166,229, 42, 72, 81,175,131,
- 51,167,129,171, 88, 7, 98,191,220,220,209,109,214, 26,201,118, 64,126, 15,192,123, 36, 46,213,228,139,143,242,231, 63,255, 25,
-149,149, 77, 83, 45,254,246,183,191,217, 14, 31, 62,188,174,180,180, 52, 77, 20,197,252,250, 7,202,233,200,189,186, 93, 1,130,
-131,131,113,251,237,183, 35, 59, 59, 27,159,127,254, 57,134, 15, 31,142,140,140, 12, 24,141, 70,132,133,133,185,127, 63,222,204,
-172,214, 65,225, 7,220,231,172,236, 29,153,237, 8,104, 64, 34,104, 64, 34, 32, 87,129, 56, 10, 64, 28, 6,108,217,188,209,158,
-151,119,225,115,115,109,229, 87, 99,134, 9, 63,205,127,250,156, 79, 63,199,216,177, 99,157,142,183,109,219, 38,231,230,230, 94,
- 48,155,205,135, 76, 38,211,185,206,248,144, 30,241, 1, 54,110,220,136,215, 94,123, 13,159,125,246, 25,190,255,254,123,232,116,
- 58,124,240,193, 7,237,125,173, 87,167, 70,236,117,252,249, 80, 48,109, 40,152,118, 44, 82,206,236,147,246,239,207, 62, 87, 80,
- 80,126,165,170,170,138, 94, 79,245, 47, 0,128,201,100, 18, 50, 50,186,119,255,228,150,171,192, 78,158, 60,233,182,172,201,100,
-226, 9, 33, 93, 54, 33, 60,193,191,147,191,175,240,239,165,252, 5, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99,
- 76, 13,128,213, 71, 54, 88,179, 15,234,207, 55,254,223,242,154,187,235, 45,238,213,178, 44,147,101, 89,150, 36,169,164, 62,189,
- 96,103, 67,160, 10,127,133,127,151,249, 55, 31,114,229,116, 58,221,114, 0,125,209,148,229, 76,102,140, 73,132, 16,153, 49, 38,
- 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84,191,184, 93,110,184, 70, 8,145, 41,165, 82,139, 99,185,193,110,166,148,
- 74,178, 44, 75,140, 49,139,217,108,190,210, 85, 75, 94,225,175,240,239, 44,255,230, 10, 64, 2, 3, 3,163, 57,142, 83, 19, 66,
-152, 74,165,130, 40,138,141, 90,214,160,133,205,143,235, 67,127, 12, 0, 28, 14,135,147, 6, 19, 66, 88,179, 79, 67, 89, 88, 44,
- 22,167,123,112, 28,199, 8, 33,172,178,178,146,213, 87, 90, 87,215,210, 41,252, 21,254,157,230, 79,218, 57,238, 40,124,101, 6,
-167,194, 95,225,223, 35,132,187, 5, 73, 73, 73, 2,128,217, 28,199,221,247,211, 79, 63, 45,238,109, 97, 7,133, 63,144,148,148,
- 52, 90, 16,132, 71, 8, 33,221, 46, 75,140,177,112, 89,150,135, 51,198, 94, 78, 73, 73,217,231,137, 58, 16,186,169, 34,251, 1,
- 40, 79, 73, 73,177,117,176,252,120,181, 90,189,132, 49,246, 43,157, 78,199,149,149,149, 9, 0, 22,123, 81, 16, 20,254, 93,231,
-127, 67,100,100,228,147,115,230,204,241,235,206,103,202,206,206,198,169, 83,167, 16, 25, 25, 9,131,193,176, 59, 41, 41,105, 90,
- 74, 74, 74,138,207, 40, 64, 82, 82, 82, 8,128,121, 90,173,246,215, 14,135, 99,188, 32, 8, 59,146,146,146,230,166,164,164, 48,
- 55,229, 35, 57,142,123, 80,173, 86,255,159, 32, 8, 81,241,241,241,154, 73,147, 38, 9, 90,173, 22,111,190,249,166,205, 11, 66,
-163,240,239, 38,254,209,209,209,246,133, 11, 23,118,155, 2,108,218,180, 9, 6,131, 1,143, 62,250, 40, 56,142,195,193,131, 7,
-185,204,204,204, 3,137,137,137, 9,169,169,169, 25, 94, 83,128,164,164, 36, 53,128,217,126,126,126, 75,101, 89,158, 62,108,216,
- 48, 41, 62, 62, 62,104,232,208,161, 88,179,102,205,173, 37, 37, 37,239, 2,120,166, 69,249,185, 90,173,246, 73, 73,146,226,227,
-226,226,104,124,124,188,255,224,193,131, 27, 38,144,193,106,181,246,164,208, 40,252,189,200,191, 35,144, 36, 9,235,215,175,199,
-210,165, 75, 17, 22, 22,134,218,218, 90, 36, 38, 38,130, 82,202,101,101,101,165,235,245,250,155,211,210,210,142,247,152, 2, 36,
- 37, 37, 17, 0, 73, 26,141,230, 49, 74,233,188,190,125,251,202, 83,166, 76, 9,137,139,139,131,159, 95,147,210, 63,246,216, 99,
- 1,239,189,247,222, 19,183,220,114, 75, 14,165,244,148, 70,163, 89, 74, 41,157, 31, 19, 19, 67, 19, 18, 18,130,227,226,226,160,
- 82,169,188, 97, 30, 40,252,189,200,191,179, 48, 24, 12, 8, 14, 14,110,220,124, 68,171,213, 66,150,101,232,245,122, 72,146,196,
-229,228,228,100,232,245,250,241,105,105,105, 89, 30, 85,128,122,231,102, 49,199,113,143, 6, 6, 6,170,227,227,227, 3, 38, 76,
-152,192,135,132,132,184, 44,239,239,239,143, 37, 75,150,248,175, 94,189,250, 35,173, 86,235,152, 50,101,138,118,226,196,137,124,
-104,104,104,183, 85,206,244,233,211,251,216,237,118,154,158,158, 94,209, 1,193, 81,248,123,145,127, 87, 81, 88, 88, 8,157,174,
-105, 71, 34,141, 70, 3, 89,150, 33,203, 50, 18, 19, 19, 33,203, 50,127,225,194,133, 19, 9, 9, 9, 55,166,167,167,159,239, 86,
- 5, 72, 74, 74,138,225, 56,238, 87,106,181,122, 9,199,113, 49,147, 38, 77, 18,110,186,233, 38,117,223,190,125, 59,116,179,136,
-136, 8,172, 92,185, 82,237,239,239,175,238,206, 74, 73, 76, 76, 28, 17, 16, 16,176,210,110,183,223, 86, 93, 93, 29,219,134,208,
- 40,252,189,200,191, 59, 16, 24, 24,216,202, 44,243,247,247,111,220,212, 59, 41, 41, 9,178, 44, 11,151, 46, 93,202,210,235,245,
- 35,211,210,210,242,186, 69, 1,146,146,146, 18, 4, 65,216, 59,102,204, 24,122,243,205, 55,251,199,198,198,162, 43,145, 45,127,
-127,255,110,171,140,169, 83,167, 78, 11, 8, 8,120,153, 82,154, 16, 16, 16,160,150,101,249,163,236,236,108,135, 27,225, 81,248,
-123,145,127,119, 65,167,211,193,100,106, 61, 11,187,193, 20,146,101,185, 65, 9, 84, 5, 5, 5,103,245,122,253,176,180,180, 52,
-195, 53, 43,128,159,159,223,107,208,238,250,153, 0, 0, 20,252, 73, 68, 65, 84,119,222,121,167, 58, 33, 33,129,131, 23, 49,125,
-250,116, 65,150,229,251,252,253,253, 95,241,247,247,239,255,224,131, 15, 6, 76,159, 62,157, 44, 88,176,192,102,177, 88, 62,114,
-247, 61,133,191,119,249,119, 23,162,162,162, 80, 83, 83, 3,171,213, 10,173, 86, 11,160,110, 99,194,210,210, 82,148,151,151,163,
-180,180, 20, 22,139, 5,131, 7, 15,134, 40,138,234,171, 87,175,158,215,235,245, 67,210,210,210,138,187,172, 0, 73, 73, 73, 35,
- 1, 36, 77,154, 52,201,107,149, 31, 31, 31, 31,172,209,104,150, 8,130,176, 98,232,208,161,154,135, 30,122, 40,104,202,148, 41,
- 32,132, 96,247,238,221, 16, 4,225, 84,122,122,250, 69, 55,173,167,194,223,139,252,187, 19,106,181, 26,227,199,143, 71, 78, 78,
- 14,116, 58, 29, 14, 28, 56,128,130,130, 2,196,198,198, 34, 42, 42, 10, 67,135, 14, 5,207,243, 72, 77, 77,133,209,104,132, 40,
-138,126, 26,141, 38, 79,175,215, 15, 74, 75, 75, 43,237,146, 2,104, 52,154,151,166, 78,157,170,242, 70,148,160,186,186, 26, 28,
-199,169, 2, 3, 3,139, 38, 79,158,140, 95,253,234, 87, 1, 55,220,112,131, 83,153,111,190,249,166,166,182,182,246,207,238,238,
-161,240,119,195,205, 38,225,167,139,165, 40,169,113, 64, 45,112, 80,243, 4,106,158,131, 70,224, 48, 97, 64, 40,250, 6,251,117,
- 11,255,238,198,180,105,211,240,233,167,159, 66, 20, 69, 60,254,248,227,152, 57,115, 38,212,106,103,183,102,209,162, 69, 48,153,
- 76, 88,183,110, 29,182,108,217,162,165,148,190,137,166,245,192, 29, 87,128,164,164,164,104, 74,233,189,122,189, 94,232, 73,193,
- 41, 44, 44, 68, 74, 74, 10,206,157, 59,135, 57,115,230,240, 11, 22, 44, 8,136,140,108,157, 53, 34, 63, 63, 31, 5, 5, 5,148,
-231,249,111,221,180,158, 94,231, 63,243,206,159,241,139,127,249,128, 79,240,183, 75, 20,169,121,229,216,157, 83,130,140,252, 74,
-136,110,146, 26, 19, 0, 3, 53,118,220,104,207,198, 67,119, 37,240,183,205,127, 34, 32, 50, 50,170,211,252, 61,129,132,132, 4,
-124,253,245,215,120,227,141, 55, 16, 19,227, 62, 29,125, 72, 72, 8,158,124,242, 73,108,223,190,157,213,212,212,140, 13, 13, 13,
-237, 95, 85, 85,117,165, 51, 74, 32,168,213,234,231,110,186,233, 38,174, 59,157, 39,119, 96,140, 33, 39, 39, 7,169,169,169,168,
-172,172,196,125,247,221,135,215, 95,127,189, 77,199, 45, 57, 57,217,193, 24, 91,179,127,255,126,201, 77,151,233, 85,254,137,243,
- 30,197,211,235,126,194, 61,178, 10,145, 94,228,207, 24,240,245,113, 3,214, 30, 42,128, 85,108,127, 93, 8, 3,144,111,215,224,
-151,131,181,184, 91,216, 3,203,119,199, 96, 31, 57, 3,252,144,169, 16,162,199, 55, 46, 19,109,143,191, 39, 16, 20, 20,132, 53,
-107,214,184, 93,126,218, 18, 67,134, 12,145, 12, 6,131,153,231,249,251, 81,151,152,184,227, 10,192,243,252,207, 39, 77,154,164,
-241,228, 3, 73,146,132, 99,199,142, 33, 45, 45, 13, 1, 1, 1, 88,184,112, 33,166, 77,155,230, 50, 69,138, 83,107,102,183, 99,
-231,206,157,212,106,181,254,205, 93, 25,111,242,207,200, 45,198, 93,171,190,129,213, 33,225,238,119,190,193,190, 87, 23, 34, 58,
- 44,176,199,249,151,155, 29,120,251,199,115, 56, 90,208,249,156,252, 19, 2,235,190,227, 47, 85,193,145,181, 5,200,218, 2,226,
- 23, 12, 97,144, 30,108,128, 30,251,246,180,205,223, 83,232,168,240,215, 7, 16, 24,165, 84, 98,140,105,208,201, 9,158, 2, 0,
-194,113,158,241,189,204,102, 51,210,211,211,113,248,240, 97,140, 26, 53, 10, 43, 86,172,232,240,174,145, 0,176,111,223, 62, 8,
-130,112, 36, 45, 45,173,173,156,228, 94,225,159,109, 40,195,188,119,183,194,234,168,107, 24, 11,202,170,113,239,159,147,177,243,
-165,249, 8,214,106,122,140,191,201, 38,225,183,155, 51, 81, 80,209,249,100,180, 4,192,248,160,214, 89, 15,153,173, 26,226,185,
- 29,192,185, 29,248,247,108,162, 82, 17,246, 23,242,192,148,100,104,196,239,195,151, 30,243,201, 76, 17,245,232,218,154,224,238,
- 70,105,105, 41, 82, 83, 83,145,153,153,137,105,211,166,225,195, 15, 63,196,128,102, 27, 98,116, 20, 61,237,124,117,148,127, 65,
- 89, 53,230,190,243, 13,170,204,206,115,200, 50,243, 75,176,240,253,109, 72,126,238, 94,168, 5,222,227,252,173,162,140,231,147,
- 79,119, 73,248, 1, 32, 86, 91,139, 16,161,237,245, 35, 42,142,241, 0,230, 49, 96, 58,236,170,229,229, 31, 76,249, 74,144,201,
-218,144,167,211,189,155, 5,152, 81,128, 52, 53, 28, 93,205,202,209,173, 10,144,151,151,135,148,148, 20, 20, 22, 22, 98,238,220,
-185,120,238,185,231,208,213,161,248,220,220, 92, 92,189,122, 85,140,142,142,254,111, 79,213,105, 71,248,151,152, 44,152,179,106,
- 19,174, 86,185,222,163,111, 95, 86, 62,150,124,178, 3, 47,222, 57,210,227,252,255,153,122, 25, 57,198,154,182, 91,121, 2,232,
- 71,244, 71, 76, 88, 0,204, 54, 17,149,102, 59, 14, 95, 40, 2,101, 12, 19,130, 42,219,234,151,144,122,133,179,199,199,208, 39,
- 52, 4, 7, 67,151,165,229,250, 66, 19, 79, 45,229,176,253,176, 18,204, 82, 6,245,228, 37, 80,141,184,163,177,245,175, 95, 74,
-217,233,244,232,215,180, 26,135, 82,138,204,204, 76,164,166,166, 66,150,101, 60,240,192, 3,184,253,246,219, 91,133,173, 58,139,
-173, 91,183,218, 41,165, 31,111,218,180,169, 61,173,238, 49,254, 53, 86, 7,238,249,211, 22,228, 22,183,157, 44,121, 99,122, 14,
- 12,185, 57,178,218,131,252, 47,150,214, 34,249, 84,161,219,235,129,126,106,172,184, 39, 30, 11, 18, 71,161,127,120,144,211,181,
-203, 37, 38,124,180,227, 56, 6, 95,106, 61,159,204, 6, 13,252, 96, 7, 24,197,153, 50, 97,227,220, 63,166,172,245, 37, 27,135,
- 85, 23, 65,174,200,173,219,179,109,223,219, 16,179,147, 17,227, 7, 82,191, 32,158,118,197, 7,232, 18, 28, 14, 7, 14, 29, 58,
-132,244,244,116,244,239,223, 31, 79, 60,241, 4,226,227,227,209, 29, 11,131,108, 54, 27,246,236,217,195,108, 54,219, 39,158,170,
-200,206,242,183,139, 50, 22,188,247, 45, 78, 94, 54,118,232,254,233, 37,224, 53, 33,137, 20,216,227, 17,254,255, 72,201, 3,117,
-163, 58,209, 97,129,216,242,236,189, 24, 55,216,117, 50,226,193,145, 33,120,247,161, 91, 81,242,229, 23, 78,155,156,214,112, 65,
- 8,162, 77, 61,202,226, 56,199,224, 23,124,204,200,231,251,142,129,118,214, 27,176,238,124, 9,144, 69,200, 37,103,241,255, 6,
- 16,149,223, 20,255,193,111,109, 39, 93,234, 1,186,132,109,219,182,129, 82,138, 85,171, 86, 97,248,240,225,221,250,144,123,246,
-236,129, 32, 8,169,169,169,169, 69,158,170,200,206,240,167,140,225,145,143,183, 99,127,118, 65,167,126,195,206,107, 95,230,231,
-175, 58, 39,111, 92,185,161, 59,185,151,155, 29,200,200,175,116,217,216, 13,208, 5, 97,247, 43, 11, 49, 64, 23,212,142,187, 40,
- 66,107,174,123, 30, 17, 2,100,162,114, 18,126, 0, 80,243,152, 90,249,158,126,124,216,239,210, 78,250,146, 18, 8,131,244,208,
-206,122, 3,182,157, 47,131,201, 14,240,132, 97,241, 36,191,113, 83, 6, 14,122, 88, 16,134,173,155,252,234,225,234,142,222,139,
- 67, 23,246, 21, 48,155,205,200,204,204,196,202,149, 43,187, 93,248, 27,156, 95,179,217,220, 81,231,209,227,252,151,125,182, 27,
- 91,143, 92,232,202,163, 16,194,176, 86,184,127,213,140,238,228,191, 35,171, 16,204, 77, 79,255,135,121,250,246,133, 31,128, 92,
- 94,103, 70,128, 87, 33, 48,225, 9,248, 49,215, 11, 99, 40, 47,223,235,139,225, 30, 97,144, 30,126,179,255, 8,162,210, 54,158,
- 27, 17,169,158, 52, 52,156, 28, 42,251, 48, 97,164, 71,123,128,163, 71,143, 34, 33, 33,161,205, 92,159, 93,197,185,115,231, 80,
- 82, 82, 98, 59,120,240,224, 78, 79, 85, 94,103,248,191,254, 77, 42, 62,219,155,121, 45, 63,167, 6,144,172, 90,240,206, 45,226,
-215, 47,156,234, 14,254,169,103, 93, 79,126, 28,216, 39, 24, 11,147, 70,119, 44, 94, 88,114, 6, 32, 28,180,183,191, 6, 97,112,
- 18,196,236,100,208,106, 23, 62, 5, 35, 9, 61,102,223,215,150, 64, 42, 60, 6, 72,118, 48, 89, 4,100, 7, 24, 21, 65,168, 4,
-230,176,130, 57,106,193, 28,181,128,104, 1,179,155,235,254,111,189, 51,234, 40,194,216,225,242, 15, 19,230,235,158, 74,255,177,
-219, 21,128, 82,138,140,140, 12,188,252,242,203, 30,169,132,173, 91,183,218, 68, 81,252, 0, 30, 74,149,209, 25,254,127,251,241,
- 56,222, 73, 62,212,120, 28,164, 85, 99, 70,220, 32,216, 68, 9, 63,158,188,228,186, 66, 9, 16,224,168, 56,100, 82,133,107, 0,
- 76,168, 63, 29,204, 40,251,193,239,129, 85,122,219, 87, 43, 47, 95, 43,255,203,149, 86,128,104, 91, 93, 91,116,203,141, 80,241,
- 29, 27, 83,160, 37,103,161,137, 95, 10, 97,112,221, 62,191,170,225, 51, 97, 63,246,133,139, 62, 12, 61,178,233,175,116, 97, 39,
-172,123,223,118, 37,208, 93, 65, 48, 24,219, 94,241, 97,252,178,240,167, 14,255,173, 61, 19,168, 83, 56,127,254, 60,130,130,130,
- 16, 23, 23,215,237,149, 96,177, 88,176,127,255,126, 56, 28,142,127,122,170,162, 59,202,255,235,180, 28, 60,183,110, 31,162,195,
- 2,241,248,109,227,240,237,138,121, 48,124,242,127,216,240,219,185,109,239,129, 69, 37,140, 40, 73,253,185,180,105,229, 68, 9,
-100, 16, 1,158, 2,176, 27, 64,164, 36, 99, 7,238,125, 91,119,173,252, 45,196,245,250,243,168,144,128,142,219,102,234, 0,168,
-199, 63,208, 36, 8, 49, 19,221, 21, 13,233, 9, 5, 16,207,239,236, 46,225,111,244,151, 25, 35, 31,151,127,144,240, 62,123,213,
-189,156, 11,157,221, 91,245,240,225,195,248,197, 47,126,225,145, 74,216,181,107, 23, 83,171,213,123,247,236,217,211,225, 13,176,
- 61,193,127, 87,230,101,252,117, 91, 6,214, 44,189, 19, 11,244,163, 58,220,170, 2, 0, 3,145,210,210,210,234,248,111,122,161,
- 64, 4, 62, 2,240,145,102,193,159,134, 74,178,252,172, 32,112,155,164,251,255, 58, 7,155,158,182,118,149,191,138,143,133, 67,
-110,253,181,176, 64,103,197, 56,124,161, 8,195,163,195, 17,222,226, 60, 24,133,122,226,131,206, 78,180,228, 54, 49, 4,199, 54,
-222,207,147,249,155, 60,154,249,218,111,198,139,144, 75,178, 1,209, 10, 38, 90,193, 28, 22,192, 81, 3,106, 53,129,150,157,131,
- 92,226, 58,221, 63, 31, 58, 16,124,248, 96, 64,208,128, 89, 42, 32, 22,157,172,223,240,163, 65, 64,216,242,242,176, 41, 67, 75,
- 62,246, 91, 24,249,155,253,181, 93, 54,129, 24, 99, 40, 47, 47, 71, 65, 65, 1,110,187,237, 54,143, 84,194,166, 77,155,204,213,
-213,213,239,122,196,190,236, 32,127,179, 93,132,192, 17, 28,122,251, 33,116, 37,162, 75, 9,231,114, 79, 45,251,215,207,231, 2,
-248, 53, 22,190, 21, 37,136,142, 9, 18,144,214, 85,254, 1,125, 71,194, 97,110,253, 51,205,103,126,214,218, 28,120,107, 75, 58,
-190, 91, 49,207, 69,171,193,129,248, 59,119, 68,204,230, 54,112, 34,226,204, 38,143,103,110, 35,218, 80, 8,131, 90,111,200, 46,
- 95,205,132, 53,111,127,171,243,170,126, 19,161,141,127, 28, 66,191,241,173,158,195,126,126, 39, 44, 41,171,235,156,124, 0,132,
-224, 46, 94,182,165,148,175,142,191, 75,183,236,240,149, 78, 41, 0, 99,245, 59,142, 51,134,195,135, 15, 99,214,172, 89,208,104,
-186,127,238,217,153, 51,103, 80, 85, 85, 85,147,154,154,186,175,187, 5,191, 51,252, 3, 52, 42,220, 26, 55,168,235,191, 7,210,
-246,172,201, 13,127, 48, 74,128,241, 90,248, 27, 11,131, 81,105,110,189,246, 99,219,145, 11, 88,152, 56, 10,140, 1,203, 63,219,
-141, 62, 65,218, 14,243, 46,185,120, 28,193,174, 47, 93, 32,175,194, 43,123, 6, 72, 23,247,192,186,239,237, 70, 65,110,236, 45,
-110,122, 8,254, 9, 75, 27,167, 66,156, 59,127, 6,102,179, 25,186,112, 29, 6, 13,138,133,223,216,251, 32, 68,220,128,154,237,
- 43,192,172,141,131,150,227, 0,238, 61, 0,247,119,216, 7,160,148, 54,174,195,180,217,108, 56,126,252, 56,238,185,231, 30,143,
- 60,236,150, 45, 91,172,162, 40,190,215,221, 14,111, 79,241,247,148,195,238,138,255,228,225,209, 46,203,239,204,188, 12,139, 93,
-196,239, 55, 28,192,134,212,179,152, 60, 44,186, 99, 74,230,176, 64,147,191,219, 77, 43, 79,206,244,248,131, 51, 10,251,225, 53,
-176,238,126,189,149,240,171,135,205,128,191,254,215, 0,225,112, 56, 35, 29,241, 79,188,138,184, 23,191, 67,252,170, 61, 24,246,
-220, 70,252,252,153, 55,112,241, 98, 14,132,232,177, 8,185,255, 95, 32,126,205,167,178,176,123,171, 62,156, 60,164,165, 2,180,
-138, 67, 55,175,248,134, 79,102,102, 38,134, 13, 27,134,254,253,251,119,251,243,214,212,212, 32, 53, 53,149,216,108,182, 79,187,
-214,200,123,151,255,181,119, 82,157,227, 63,101,120, 63,215, 65, 4,187,136,121,127,217,138, 15,182, 31, 5, 0, 76, 30, 22,211,
- 33, 2,181,199,191,130,134,147,220, 24,124,108,103,143, 42,189,185, 12,150,109,203,225, 56,241,159,214,129, 64, 65, 3,255,233,
-207, 2, 0,242,242,206,227,231,171,119,227,120,133,179,127,243, 95,131, 10,243,255,244, 21, 36, 81, 4, 23,210, 15,234, 33,122,
- 39,151, 65,166,252,114,183, 61, 0, 99,172,177,194, 37, 73,130, 36, 73,141,199,199,143, 31,199,188,121,243, 60,242,208, 59,119,
-238,132, 90,173,222,113,173,249,102,188,197,191, 59,205,181,142,240,159, 59,105, 24, 66,252, 93,155,113, 7,234, 71,171,181,106,
- 1, 99, 6, 69,180,111,102,228,167, 65, 62,245, 31,119,151,109, 68, 35,110,236, 49,147,231,202, 49, 88,191,121, 12,114,145,235,
-225, 18, 85,244, 88,112,218,186,177,155, 15,191,254, 14,229, 14,215, 75, 72, 79, 87,249,225,207,255,168, 11, 36,170, 6, 76,110,
-209,161,177, 71, 13,127, 77,208, 58, 41, 64,131,157,217,178,213,105,120, 17, 6,131, 1, 22,139, 5, 9, 9,221, 59, 38, 66, 41,
-197,158, 61,123,176,118,237, 90,212,214,214,190,123, 45,130,227, 13,254,221,237,167,116,148,127,144, 86,141, 71,110, 29,219,230,
- 61,199,235, 36,168,218,153, 30,239,200,254, 22,150, 31, 86,130,103,110,167, 68,127,213, 35,243,255, 25,133,253,216, 90, 88,183,
- 63, 3,106,117, 63, 67, 85,136,106, 26,228, 59,125,213,220,230, 45,243, 74,235,156,122, 97,192,205, 45, 47, 5,169,180, 36,168,
-185, 19,204, 26, 42,186,193,217,106, 72, 66,212,240, 57,113,226, 4,238,185,231, 30,116,215,194, 19, 89,150,177,107,215, 46,124,
-246,217,103,176, 88, 44,142,226,226,226, 45, 6,131, 33, 60, 56, 56,248,230,234,234,234, 35,157,173,190,158,230, 79,105,183,250,
-132, 93,226,255,200,140, 49, 88,179,235, 68,227,130,156,150,152,192, 95,132,121,227, 98, 8, 35,102, 67,125,195, 29, 32,129,117,
- 19,227,152,104,133,227,226, 62,148, 30,222,128, 16, 91,126, 91, 83, 39, 77, 50, 47,175,244,184,236,139, 86,216,118,189, 2,169,
-224,144,115, 67,205,171,193,192,156,124, 0, 90,219, 20, 29, 31, 18,174,193,129, 54, 18,161,140,111,152, 8,232, 98,108,193,223,
-108,111, 60, 41, 52,111,125, 26, 42,188,249, 75,176, 88, 44, 56,127,254, 60, 94,121,229,149,107,239,226, 36, 9, 63,252,240, 3,
-214,174, 93, 11,155,205,102,191,122,245,234,214,162,162,162,100, 74,105, 49,207,243, 70, 89,150, 75,174,165,245,236, 41,254,255,
- 90,191, 3, 16, 98,187,189,245,119,197,223, 84,107,198,169,220, 43,184,243, 87, 75,177,249,240,121, 28,207, 43, 70,218,185, 66,
-156,184,100,132, 67,114,223,194,223, 20, 84, 9,106, 42,130, 35,227,159,112,100,252,179, 46, 98, 66, 56, 48, 42,131,128,181, 59,
-186, 69, 8, 94,136,252,205,145, 98,143, 10,191,189, 22,214,255, 62, 7,217,152,237,252,219,193, 49,240,159,245, 38,236, 71,254,
- 5, 41,191, 41, 90, 44,149,158,107,252,255,233, 7,238,194,127, 94,217, 6,145,181, 86,225, 80,149,132,217,183,212,141,112,203,
-165,173,179, 39, 50, 78, 77,157,194,160, 45, 95, 64,243, 23,113,234,212, 41, 36, 36, 36,224, 90,114, 76, 58, 28, 14,124,255,253,
-247, 88,183,110, 29, 28, 14,135,173,168,168, 40,185,168,168,232,123,142,227,140,140, 49,163, 36, 73,198,170,170,170,210,107,105,
-145,123,146,255, 85, 41,226, 52,250,224,230,238,142,246,184,226,159,125,250, 52,134,198, 77,192, 15, 89,133,216,118,244, 34,174,
- 86,214,118,232,158, 55, 5, 87,180, 50, 51,192,104,135, 38,203, 51,134,191,233,150, 29,250,196,147,194, 79,173,149,117, 38, 79,
-153,115,170, 33, 97,144, 30,126, 51, 94, 4,209, 4, 66, 24,156,232,164, 0,114,121, 30,236,103,191,135,102,212, 93, 24, 53, 50,
- 14,219,127, 99,196, 67,255, 76, 69,177,189,105,237,198,208, 0, 59, 62, 91, 58, 3,177,177,117,169, 93,172, 39,190,108,249,211,
-162, 57,192, 97,115, 82,128, 6,123,179,229, 11,144,101, 25, 89, 89, 89,120,253,245,215,187,244,144,118,187, 29,223,126,251, 45,
-214,175, 95, 15, 89,150,109,133,133,133,155,141, 70,227, 14,198,152, 17,128,145,231,121, 99,121,121,185,241, 90, 43,179,167,249,
- 91,198,207,187, 25,232, 62, 5,104,139,127,118,214,105,188,254,250,235, 24, 61,122, 52,254,186,120, 6, 14,157, 47, 66,114,198,
-121,108,205, 56,143,194, 10,215,202, 16,163,177, 34, 90,109,235, 98,143,132, 47,117,149,135,158,242,104,203,111,173,130,245,219,
- 39, 65,171,154, 77,234,227, 4,104,110,126, 12,234, 9,191, 68,195, 8, 53, 63, 48,161,254,255,166,104,144, 53,245, 35,168, 98,
- 38,128, 11,233,135, 91,111,153,137,203,137,211,177,231,192, 30, 20,149,150, 33, 38,162, 15,110,155, 62, 19, 28,199, 3,140,194,
-146,178, 26,210,149, 99, 45,186, 54,124, 25,179,244,152,197,165, 15,208,210,254,204,203,203, 67,104,104, 40, 70,143, 30,221,169,
- 7,180, 88, 44, 72, 78, 78,198,134, 13, 27, 64, 41,181, 22, 20, 20,108, 46, 47, 47,223,205, 24, 51, 82, 74,141,130, 32, 24,203,
-202,202,140,232,194, 34,230,182,108,232,158,226, 79,253,195,251,121,194, 7,104,143, 63, 71, 8,244, 35,250, 65, 63,162, 31,254,
-180,232, 86, 28,201,189,138,228,140,243, 72, 62,124, 30, 5,101,213, 78,230, 79, 23, 32,130,177,223,235,150, 29,254, 11, 33,158,
-221,179, 75, 46, 60,234, 36,252, 92,200, 0,248,221,246, 50,248,136, 17, 78,229,184,128, 62,224,251,222, 8,185, 56,171, 89,207,
- 97,130,233,171,135, 17,112,219, 31,160, 30, 58, 29, 60,207, 99,214,140, 89,173, 76,171,218, 29, 47, 66, 44, 56,220,170,174,193,
-216,159,156,122,156,230,161,183,150, 54,232,153, 51,103, 58, 21, 58,172,173,173,197,230,205,155,177,113,227, 70, 80, 74, 45, 6,
-131,225,155,178,178,178,253,140, 49, 35,207,243, 70,198,152,177,170,170,202,136,174,239, 68,216,102,232,176,167,248,171,180, 33,
-241,221, 37, 34, 93,229, 79, 8, 48,121, 88, 52, 38, 15,139,198,170, 95, 78,195,241, 60, 35, 54,238,203, 64,114,250,105,140, 15,
-236,148, 2, 72,140, 97, 7,227,232,107, 17,203, 50,142, 98,185,231,163, 94,252,160, 68,240,125,199, 64, 46, 57, 11,213,136,217,
-208,232,159,116,154,215,223, 28,154,164,223,194,178,229, 9,128, 54, 57,251,204, 81,139,218,255,174,132,122,232,116, 8, 81,163,
-193,135, 15, 1, 9,208, 65,174,184, 12,185,236, 2, 28,185, 7, 64,171, 91,175,165, 98,192,247,125,150, 29,118, 26,216,115,235,
- 3,152, 76, 38, 20, 23, 23, 99,198,140, 25,237, 62, 80,117,117, 53,190,254,250,107, 36, 39, 39,131, 82,106,190,114,229,202,230,
-178,178,178,131,140, 49, 99,189,157, 95, 28, 26, 26,106,188,120,241,162,221, 35,246,164,194, 31,199,246,124,135,204,228,100, 12,
-161,212,188, 35,219,184,189,223, 56,106,191,101,120,224, 68,157, 63, 63, 26,196,133,233, 79,112,152, 49,178, 94,237,112,124, 21,
-252,236,177,178,158, 12,251, 18,149, 22,254,247,124,220,184, 32,167, 77,101,233,115, 3,212,147, 30,169,115,228, 91,250,102,185,
-251,225,200,221,223,193, 31, 37,121, 2,228, 86,234,237,214, 7,200,206,206,198,157,119,222,217,230,188,153,170,170, 42,124,249,
-229,151, 13,203, 11,107, 13, 6,195,230,170,170,170,180, 6, 27,159, 82,106,212,106,181,198,162,162, 34, 75,101,101,165,199, 42,
- 84,225,223,154,255,243,151,152, 81,150,139,140,235, 31, 25, 64, 18, 6, 5,106,136, 74,230,136,172, 34, 96, 50, 7,162,170, 10,
- 95,150, 82, 0,111,131,239, 88, 46, 84,205,132, 95, 1,142, 90, 56, 78,118,121,101,233, 41,153,147,238,212,185,136,106, 53, 42,
- 64,115, 27, 84, 20, 69,156, 63,127, 30,207, 60,243,140,203,187,149,151,151, 99,253,250,245,216,177, 99, 7,100, 89,174,169,175,
-248,140, 6,161, 81,169, 84,197,140, 49, 99, 69, 69, 69,173,171, 92,239,158, 16, 32,133,191,107,254,119,191,239,203,121,172, 58,
-218,101,112,208, 76,249, 53,248, 62, 55,192,182,255,143, 96, 82,167, 28,252, 20,162, 17,239,138,116, 51,160,215,202, 4, 98,140,
-225,226,197,139, 24, 49, 98, 4,250,245,115,246,245, 74, 74, 74,240,197, 23, 95, 96,247,238,221,144, 36,169,218, 96, 48,108,169,
-174,174, 62,202, 24, 51, 54,216,201, 0,140, 37, 37, 37, 61, 90,235, 10,127,239,242,239, 41, 8,195,102,194,191,223, 68,136,103,
-190,131,120,230, 91, 48,179, 91,203,205, 0, 32,153, 3,217, 18,218,183,127, 74, 91,107, 25, 4,198, 24,107,217, 5, 95,184,112,
- 1, 79, 61,213, 20, 9, 43, 42, 42,194,231,159,127,142, 3, 7, 14, 64,146, 36, 83,126,126,254,150,218,218,218,147, 13, 81, 17,
-158,231,141,146, 36, 25, 43, 43, 43,123, 60, 91,152, 87,248,203,220, 81,240,244, 53,215,132,136,205,231,249,247, 98,112,218, 48,
-104,110, 90, 12,205,132, 69,117,249,129, 28, 22,124,182,230, 67, 27, 45, 57,179,121, 76, 31,122,118,100,140,176,179,239,242, 35,
- 29,158, 77, 32, 16, 66,242,171,171,171, 71,134,133,133,129, 82,138,210,210, 82,136,162,136, 41, 83,166,192, 96, 48,224,223,255,
-254, 55,210,210,210, 32,138, 98,229,229,203,151,183,154,205,230,204, 6,231, 16,128, 81,150,101, 99, 85, 85, 85,153,183, 42,196,
- 27,252,197,205, 43,142, 2, 56,218, 91,249,255,111,104, 2, 15,190, 79,221, 96,215, 57,115,152,188,255,136,120,188,160,160, 96,
- 91, 85, 85, 85,167, 54,241, 16,236,118,123,106, 73, 73,201,204,254,253,251, 11,148, 82, 92,188,120, 17, 19, 38, 76,192,203, 47,
-191,140, 35, 71,142,192,110,183, 87, 24, 12,134,111,107,107,107,179, 8, 33, 37,168, 91,204, 97,228,121,222, 88, 82, 82, 98,244,
-118, 61, 40,252,189, 15,147,201, 36,100,100,100,120,243,247,121, 66, 8,149,101,185,243,185, 65, 25, 99, 25,121,121,121,246, 33,
- 67,134, 8,118,187, 29,121,121,121,200,207,207,135,205,102,107,168,248,179,205, 91,155,102,131, 88,212, 23, 42, 95,225,239,117,
- 24,139,139,139, 79,173, 90,181,138,183,219,237,209,140, 49, 53, 0, 86,159, 97,143, 53,251,160,254, 60,107, 10,203, 59, 95,115,
-119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212,167, 71,236,212, 8, 13, 1,128,105,211,166, 61, 79, 41,125, 11,128,236,
-112, 56,106,138,138,138,182,213,214,214,158,227, 56,174,193,198, 44, 97,140, 21,215, 79, 91,144,224, 99, 80,248,251,134, 81,162,
-211,233,150, 3,232, 91,175,156, 50,234, 18,214, 74,132, 16,153, 49, 38, 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84,
-159,228, 86,110,184, 70, 8,145, 41,165, 82,139, 99,185, 33, 35, 52,165, 84,146,101, 89, 98,140, 89,204,102,243,149, 78, 43, 64,
- 61, 84,225,225,225, 81,140,177, 48,142,227,180, 0,136, 44,203,118,142,227,202,195,195,195, 75, 60, 53, 8,212,141, 80,248,123,
- 57, 88, 25, 24, 24, 24,205,113,156,154, 16,194, 84, 42, 21, 68, 81,108,108,165, 27, 90,241,230,199,132, 16,218,208,226, 59, 28,
- 14,167, 30,128, 16,194,154,125, 26,202,194, 98,177, 56,221,131,227, 56, 70, 8, 97,149,149,149,172, 94,233,196,174, 42,128, 2,
- 5,215,172, 4, 93,181, 4,189, 69,248,255, 3,212, 21,184,121, 66,226, 69,162, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
-};
-
diff --git a/source/blender/src/radialcontrol.c b/source/blender/src/radialcontrol.c
deleted file mode 100644
index 404aac225c6..00000000000
--- a/source/blender/src/radialcontrol.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * $Id: multires.c 13015 2007-12-27 07:27:03Z nicholasbishop $
- *
- * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Implements the multiresolution modeling tools.
- *
- * multires.h
- *
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_radialcontrol.h"
-
-#include "BKE_global.h"
-#include "BLI_arithb.h"
-
-#include "mydevice.h"
-#include "transform.h"
-
-#include "math.h"
-
-/* Prints the value being edited in the view header */
-static void radialcontrol_header(const RadialControl *rc)
-{
- if(rc) {
- char str[512];
- const char *name= "";
-
- if(rc->mode == RADIALCONTROL_SIZE)
- name= "Size";
- else if(rc->mode == RADIALCONTROL_STRENGTH)
- name= "Strength";
- else if(rc->mode == RADIALCONTROL_ROTATION)
- name= "Angle";
-
- sprintf(str, "%s: %d", name, (int)(rc->new_value));
- headerprint(str);
- }
-}
-
-/* Creates, initializes, and returns the control */
-RadialControl *radialcontrol_start(const int mode, RadialControlCallback callback,
- const int original_value, const int max_value,
- const unsigned int tex)
-{
- RadialControl *rc= MEM_callocN(sizeof(RadialControl), "radial control");
- short mouse[2];
-
- getmouseco_areawin(mouse);
- rc->origloc[0]= mouse[0];
- rc->origloc[1]= mouse[1];
-
- if(mode == RADIALCONTROL_SIZE)
- rc->origloc[0]-= original_value;
- else if(mode == RADIALCONTROL_STRENGTH)
- rc->origloc[0]-= 200 - 2*original_value;
- else if(mode == RADIALCONTROL_ROTATION) {
- rc->origloc[0]-= 200 * cos(original_value * M_PI / 180.0);
- rc->origloc[1]-= 200 * sin(original_value * M_PI / 180.0);
- }
-
- rc->callback = callback;
- rc->original_value = original_value;
- rc->max_value = max_value;
-
- rc->tex = tex;
-
- /* NumInput is used for keyboard input */
- rc->num = MEM_callocN(sizeof(NumInput), "radialcontrol numinput");
- rc->num->idx_max= 0;
-
- rc->mode= mode;
- radialcontrol_header(rc);
-
- allqueue(REDRAWVIEW3D, 0);
-
- return rc;
-}
-
-
-static void radialcontrol_end(RadialControl *rc)
-{
- if(rc) {
- rc->callback(rc->mode, rc->new_value);
- BIF_undo_push("Brush property set");
-
- /* Free everything */
- glDeleteTextures(1, (GLuint*)(&rc->tex));
- MEM_freeN(rc->num);
- MEM_freeN(rc);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWHEADERS, 0);
- }
-}
-
-void radialcontrol_do_events(RadialControl *rc, unsigned short event)
-{
- short mouse[2];
- short tmp[2];
- float dist;
- char valset= 0;
-
- if(!rc)
- return;
-
- handleNumInput(rc->num, event);
-
- if(hasNumInput(rc->num)) {
- float val;
- applyNumInput(rc->num, &val);
- rc->new_value = val;
- valset= 1;
- allqueue(REDRAWVIEW3D, 0);
- }
-
- switch(event) {
- case MOUSEX:
- case MOUSEY:
- if(!hasNumInput(rc->num)) {
- char ctrl= G.qual & LR_CTRLKEY;
- getmouseco_areawin(mouse);
- tmp[0]= rc->origloc[0]-mouse[0];
- tmp[1]= rc->origloc[1]-mouse[1];
- dist= sqrt(tmp[0]*tmp[0]+tmp[1]*tmp[1]);
- if(rc->mode == RADIALCONTROL_SIZE)
- rc->new_value = dist;
- else if(rc->mode == RADIALCONTROL_STRENGTH) {
- float fin= (200.0f - dist) * 0.5f;
- rc->new_value= fin>=0 ? fin : 0;
- } else if(rc->mode == RADIALCONTROL_ROTATION)
- rc->new_value= ((int)(atan2(tmp[1], tmp[0]) * (180.0 / M_PI)) + 180);
-
- if(ctrl)
- rc->new_value= (rc->new_value + 5) / 10*10;
-
- valset= 1;
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case ESCKEY:
- case RIGHTMOUSE:
- rc->new_value = rc->original_value;
- case LEFTMOUSE:
- while(get_mbut()==L_MOUSE);
- case RETKEY:
- case PADENTER:
- radialcontrol_end(rc);
- return;
- default:
- break;
- };
-
- if(valset) {
- if(rc->new_value > rc->max_value)
- rc->new_value = rc->max_value;
- }
-
- radialcontrol_header(rc);
-}
-
-static void rot_line(const short o[2], const float ang)
-{
- sdrawXORline(o[0], o[1], o[0] + 200*cos(ang), o[1] + 200*sin(ang));
-}
-
-void radialcontrol_draw(RadialControl *rc)
-{
- short r1=200, r2=200, r3=200;
- float angle = 0;
-
- if(rc && rc->mode) {
- if(rc->mode == RADIALCONTROL_SIZE) {
- r1= rc->new_value;
- r2= rc->original_value;
- r3= r1;
- } else if(rc->mode == RADIALCONTROL_STRENGTH) {
- r1= 200 - rc->new_value * 2;
- r2= 200;
- r3= 200;
- } else if(rc->mode == RADIALCONTROL_ROTATION) {
- r1= r2= 200;
- r3= 200;
- angle = rc->new_value;
- }
-
- /* Draw brush with texture */
- glPushMatrix();
- glTranslatef(rc->origloc[0], rc->origloc[1], 0);
- glRotatef(angle, 0, 0, 1);
-
- if(rc->tex) {
- const float str = rc->mode == RADIALCONTROL_STRENGTH ? (rc->new_value / 200.0 + 0.5) : 1;
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- glBindTexture(GL_TEXTURE_2D, rc->tex);
-
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glEnable(GL_TEXTURE_2D);
- glBegin(GL_QUADS);
- glColor4f(0,0,0, str);
- glTexCoord2f(0,0);
- glVertex2f(-r3, -r3);
- glTexCoord2f(1,0);
- glVertex2f(r3, -r3);
- glTexCoord2f(1,1);
- glVertex2f(r3, r3);
- glTexCoord2f(0,1);
- glVertex2f(-r3, r3);
- glEnd();
- glDisable(GL_TEXTURE_2D);
- }
-
- glPopMatrix();
-
- if(r1 != r2)
- fdrawXORcirc(rc->origloc[0], rc->origloc[1], r1);
- fdrawXORcirc(rc->origloc[0], rc->origloc[1], r2);
-
- if(rc->mode == RADIALCONTROL_ROTATION) {
- float ang1= rc->original_value * (M_PI/180.0f);
- float ang2= rc->new_value * (M_PI/180.0f);
-
- if(rc->new_value > 359)
- ang2 = 0;
-
- rot_line(rc->origloc, ang1);
- if(ang1 != ang2)
- rot_line(rc->origloc, ang2);
- }
- }
-}
diff --git a/source/blender/src/reeb.c b/source/blender/src/reeb.c
deleted file mode 100644
index b37087064cb..00000000000
--- a/source/blender/src/reeb.c
+++ /dev/null
@@ -1,3790 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h> // for memcpy
-#include <stdio.h>
-#include <stdlib.h> // for qsort
-
-#include "PIL_time.h"
-
-#include "DNA_listBase.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_armature_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-#include "BLI_edgehash.h"
-#include "BLI_ghash.h"
-#include "BLI_heap.h"
-
-#include "BDR_editobject.h"
-
-#include "BMF_Api.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_editarmature.h"
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-#include "BIF_graphics.h"
-#include "BIF_gl.h"
-#include "BIF_resources.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_customdata.h"
-
-#include "blendef.h"
-
-#include "ONL_opennl.h"
-
-#include "reeb.h"
-
-
-ReebGraph *GLOBAL_RG = NULL;
-ReebGraph *FILTERED_RG = NULL;
-
-/*
- * Skeleton generation algorithm based on:
- * "Harmonic Skeleton for Realistic Character Animation"
- * Gregoire Aujay, Franck Hetroy, Francis Lazarus and Christine Depraz
- * SIGGRAPH 2007
- *
- * Reeb graph generation algorithm based on:
- * "Robust On-line Computation of Reeb Graphs: Simplicity and Speed"
- * Valerio Pascucci, Giorgio Scorzelli, Peer-Timo Bremer and Ajith Mascarenhas
- * SIGGRAPH 2007
- *
- * */
-
-#define DEBUG_REEB
-#define DEBUG_REEB_NODE
-
-typedef struct VertexData
-{
- float w; /* weight */
- int i; /* index */
- ReebNode *n;
-} VertexData;
-
-typedef struct EdgeIndex
-{
- EditEdge **edges;
- int *offset;
-} EdgeIndex;
-
-typedef enum {
- MERGE_LOWER,
- MERGE_HIGHER,
- MERGE_APPEND
-} MergeDirection;
-
-int mergeArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1);
-void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection direction);
-int mergeConnectedArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1);
-EditEdge * NextEdgeForVert(EdgeIndex *indexed_edges, int index);
-void mergeArcFaces(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc);
-void addFacetoArc(ReebArc *arc, EditFace *efa);
-
-void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count);
-void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BArc* barc1, BArc* barc2);
-
-void flipArcBuckets(ReebArc *arc);
-
-
-/***************************************** UTILS **********************************************/
-
-VertexData *allocVertexData(EditMesh *em)
-{
- VertexData *data;
- EditVert *eve;
- int totvert, index;
-
- totvert = BLI_countlist(&em->verts);
-
- data = MEM_callocN(sizeof(VertexData) * totvert, "VertexData");
-
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
- {
- data[index].i = index;
- data[index].w = 0;
- eve->tmp.p = data + index;
- }
-
- return data;
-}
-
-int indexData(EditVert *eve)
-{
- return ((VertexData*)eve->tmp.p)->i;
-}
-
-float weightData(EditVert *eve)
-{
- return ((VertexData*)eve->tmp.p)->w;
-}
-
-void weightSetData(EditVert *eve, float w)
-{
- ((VertexData*)eve->tmp.p)->w = w;
-}
-
-ReebNode* nodeData(EditVert *eve)
-{
- return ((VertexData*)eve->tmp.p)->n;
-}
-
-void nodeSetData(EditVert *eve, ReebNode *n)
-{
- ((VertexData*)eve->tmp.p)->n = n;
-}
-
-void REEB_freeArc(BArc *barc)
-{
- ReebArc *arc = (ReebArc*)barc;
- BLI_freelistN(&arc->edges);
-
- if (arc->buckets)
- MEM_freeN(arc->buckets);
-
- if (arc->faces)
- BLI_ghash_free(arc->faces, NULL, NULL);
-
- MEM_freeN(arc);
-}
-
-void REEB_freeGraph(ReebGraph *rg)
-{
- ReebArc *arc;
- ReebNode *node;
-
- // free nodes
- for( node = rg->nodes.first; node; node = node->next )
- {
- BLI_freeNode((BGraph*)rg, (BNode*)node);
- }
- BLI_freelistN(&rg->nodes);
-
- // free arcs
- arc = rg->arcs.first;
- while( arc )
- {
- ReebArc *next = arc->next;
- REEB_freeArc((BArc*)arc);
- arc = next;
- }
-
- // free edge map
- BLI_edgehash_free(rg->emap, NULL);
-
- /* free linked graph */
- if (rg->link_up)
- {
- REEB_freeGraph(rg->link_up);
- }
-
- MEM_freeN(rg);
-}
-
-ReebGraph * newReebGraph()
-{
- ReebGraph *rg;
- rg = MEM_callocN(sizeof(ReebGraph), "reeb graph");
-
- rg->totnodes = 0;
- rg->emap = BLI_edgehash_new();
-
-
- rg->free_arc = REEB_freeArc;
- rg->free_node = NULL;
- rg->radial_symmetry = REEB_RadialSymmetry;
- rg->axial_symmetry = REEB_AxialSymmetry;
-
- return rg;
-}
-
-void BIF_flagMultiArcs(ReebGraph *rg, int flag)
-{
- for ( ; rg; rg = rg->link_up)
- {
- BLI_flagArcs((BGraph*)rg, flag);
- }
-}
-
-ReebNode * addNode(ReebGraph *rg, EditVert *eve)
-{
- float weight;
- ReebNode *node = NULL;
-
- weight = weightData(eve);
-
- node = MEM_callocN(sizeof(ReebNode), "reeb node");
-
- node->flag = 0; // clear flag on init
- node->symmetry_level = 0;
- node->arcs = NULL;
- node->degree = 0;
- node->weight = weight;
- node->index = rg->totnodes;
- VECCOPY(node->p, eve->co);
-
- BLI_addtail(&rg->nodes, node);
- rg->totnodes++;
-
- nodeSetData(eve, node);
-
- return node;
-}
-
-ReebNode * copyNode(ReebGraph *rg, ReebNode *node)
-{
- ReebNode *cp_node = NULL;
-
- cp_node = MEM_callocN(sizeof(ReebNode), "reeb node copy");
-
- memcpy(cp_node, node, sizeof(ReebNode));
-
- cp_node->prev = NULL;
- cp_node->next = NULL;
- cp_node->arcs = NULL;
-
- cp_node->link_up = NULL;
- cp_node->link_down = NULL;
-
- BLI_addtail(&rg->nodes, cp_node);
- rg->totnodes++;
-
- return cp_node;
-}
-
-void relinkNodes(ReebGraph *low_rg, ReebGraph *high_rg)
-{
- ReebNode *low_node, *high_node;
-
- if (low_rg == NULL || high_rg == NULL)
- {
- return;
- }
-
- for (low_node = low_rg->nodes.first; low_node; low_node = low_node->next)
- {
- for (high_node = high_rg->nodes.first; high_node; high_node = high_node->next)
- {
- if (low_node->index == high_node->index)
- {
- high_node->link_down = low_node;
- low_node->link_up = high_node;
- break;
- }
- }
- }
-}
-
-ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node)
-{
- return (arc->head->index == node->index) ? arc->tail : arc->head;
-}
-
-ReebNode *BIF_NodeFromIndex(ReebArc *arc, ReebNode *node)
-{
- return (arc->head->index == node->index) ? arc->head : arc->tail;
-}
-
-ReebNode *BIF_lowestLevelNode(ReebNode *node)
-{
- while (node->link_down)
- {
- node = node->link_down;
- }
-
- return node;
-}
-
-ReebArc * copyArc(ReebGraph *rg, ReebArc *arc)
-{
- ReebArc *cp_arc;
- ReebNode *node;
-
- cp_arc = MEM_callocN(sizeof(ReebArc), "reeb arc copy");
-
- memcpy(cp_arc, arc, sizeof(ReebArc));
-
- cp_arc->link_up = arc;
-
- cp_arc->head = NULL;
- cp_arc->tail = NULL;
-
- cp_arc->prev = NULL;
- cp_arc->next = NULL;
-
- cp_arc->edges.first = NULL;
- cp_arc->edges.last = NULL;
-
- /* copy buckets */
- cp_arc->buckets = MEM_callocN(sizeof(EmbedBucket) * cp_arc->bcount, "embed bucket");
- memcpy(cp_arc->buckets, arc->buckets, sizeof(EmbedBucket) * cp_arc->bcount);
-
- /* copy faces map */
- cp_arc->faces = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
- mergeArcFaces(rg, cp_arc, arc);
-
- /* find corresponding head and tail */
- for (node = rg->nodes.first; node && (cp_arc->head == NULL || cp_arc->tail == NULL); node = node->next)
- {
- if (node->index == arc->head->index)
- {
- cp_arc->head = node;
- }
- else if (node->index == arc->tail->index)
- {
- cp_arc->tail = node;
- }
- }
-
- BLI_addtail(&rg->arcs, cp_arc);
-
- return cp_arc;
-}
-
-ReebGraph * copyReebGraph(ReebGraph *rg, int level)
-{
- ReebNode *node;
- ReebArc *arc;
- ReebGraph *cp_rg = newReebGraph();
-
- cp_rg->resolution = rg->resolution;
- cp_rg->length = rg->length;
- cp_rg->link_up = rg;
- cp_rg->multi_level = level;
-
- /* Copy nodes */
- for (node = rg->nodes.first; node; node = node->next)
- {
- ReebNode *cp_node = copyNode(cp_rg, node);
- cp_node->multi_level = level;
- }
-
- /* Copy arcs */
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- copyArc(cp_rg, arc);
- }
-
- BLI_buildAdjacencyList((BGraph*)cp_rg);
-
- return cp_rg;
-}
-
-ReebGraph *BIF_graphForMultiNode(ReebGraph *rg, ReebNode *node)
-{
- ReebGraph *multi_rg = rg;
-
- while(multi_rg && multi_rg->multi_level != node->multi_level)
- {
- multi_rg = multi_rg->link_up;
- }
-
- return multi_rg;
-}
-
-ReebEdge * copyEdge(ReebEdge *edge)
-{
- ReebEdge *newEdge = NULL;
-
- newEdge = MEM_callocN(sizeof(ReebEdge), "reeb edge");
- memcpy(newEdge, edge, sizeof(ReebEdge));
-
- newEdge->next = NULL;
- newEdge->prev = NULL;
-
- return newEdge;
-}
-
-void printArc(ReebArc *arc)
-{
- ReebEdge *edge;
- ReebNode *head = (ReebNode*)arc->head;
- ReebNode *tail = (ReebNode*)arc->tail;
- printf("arc: (%i) %f -> (%i) %f\n", head->index, head->weight, tail->index, tail->weight);
-
- for(edge = arc->edges.first; edge ; edge = edge->next)
- {
- printf("\tedge (%i, %i)\n", edge->v1->index, edge->v2->index);
- }
-}
-
-void flipArc(ReebArc *arc)
-{
- ReebNode *tmp;
- tmp = arc->head;
- arc->head = arc->tail;
- arc->tail = tmp;
-
- flipArcBuckets(arc);
-}
-
-#ifdef DEBUG_REEB_NODE
-void NodeDegreeDecrement(ReebGraph *rg, ReebNode *node)
-{
- node->degree--;
-
-// if (node->degree == 0)
-// {
-// printf("would remove node %i\n", node->index);
-// }
-}
-
-void NodeDegreeIncrement(ReebGraph *rg, ReebNode *node)
-{
-// if (node->degree == 0)
-// {
-// printf("first connect node %i\n", node->index);
-// }
-
- node->degree++;
-}
-
-#else
-#define NodeDegreeDecrement(rg, node) {node->degree--;}
-#define NodeDegreeIncrement(rg, node) {node->degree++;}
-#endif
-
-void repositionNodes(ReebGraph *rg)
-{
- BArc *arc = NULL;
- BNode *node = NULL;
-
- // Reset node positions
- for(node = rg->nodes.first; node; node = node->next)
- {
- node->p[0] = node->p[1] = node->p[2] = 0;
- }
-
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (((ReebArc*)arc)->bcount > 0)
- {
- float p[3];
-
- VECCOPY(p, ((ReebArc*)arc)->buckets[0].p);
- VecMulf(p, 1.0f / arc->head->degree);
- VecAddf(arc->head->p, arc->head->p, p);
-
- VECCOPY(p, ((ReebArc*)arc)->buckets[((ReebArc*)arc)->bcount - 1].p);
- VecMulf(p, 1.0f / arc->tail->degree);
- VecAddf(arc->tail->p, arc->tail->p, p);
- }
- }
-}
-
-void verifyNodeDegree(ReebGraph *rg)
-{
-#ifdef DEBUG_REEB
- ReebNode *node = NULL;
- ReebArc *arc = NULL;
-
- for(node = rg->nodes.first; node; node = node->next)
- {
- int count = 0;
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (arc->head == node || arc->tail == node)
- {
- count++;
- }
- }
- if (count != node->degree)
- {
- printf("degree error in node %i: expected %i got %i\n", node->index, count, node->degree);
- }
- if (node->degree == 0)
- {
- printf("zero degree node %i with weight %f\n", node->index, node->weight);
- }
- }
-#endif
-}
-
-void verifyBucketsArc(ReebGraph *rg, ReebArc *arc)
-{
- ReebNode *head = (ReebNode*)arc->head;
- ReebNode *tail = (ReebNode*)arc->tail;
-
- if (arc->bcount > 0)
- {
- int i;
- for(i = 0; i < arc->bcount; i++)
- {
- if (arc->buckets[i].nv == 0)
- {
- printArc(arc);
- printf("count error in bucket %i/%i\n", i+1, arc->bcount);
- }
- }
-
- if (ceil(head->weight) != arc->buckets[0].val)
- {
- printArc(arc);
- printf("alloc error in first bucket: %f should be %f \n", arc->buckets[0].val, ceil(head->weight));
- }
- if (floor(tail->weight) != arc->buckets[arc->bcount - 1].val)
- {
- printArc(arc);
- printf("alloc error in last bucket: %f should be %f \n", arc->buckets[arc->bcount - 1].val, floor(tail->weight));
- }
- }
-}
-
-void verifyBuckets(ReebGraph *rg)
-{
-#ifdef DEBUG_REEB
- ReebArc *arc = NULL;
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- verifyBucketsArc(rg, arc);
- }
-#endif
-}
-
-void verifyFaces(ReebGraph *rg)
-{
-#ifdef DEBUG_REEB
- int total = 0;
- ReebArc *arc = NULL;
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- total += BLI_ghash_size(arc->faces);
- }
-
-#endif
-}
-
-void verifyArcs(ReebGraph *rg)
-{
- ReebArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (arc->head->weight > arc->tail->weight)
- {
- printf("FLIPPED ARC!\n");
- }
- }
-}
-
-void verifyMultiResolutionLinks(ReebGraph *rg, int level)
-{
-#ifdef DEBUG_REEB
- ReebGraph *lower_rg = rg->link_up;
-
- if (lower_rg)
- {
- ReebArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (BLI_findindex(&lower_rg->arcs, arc->link_up) == -1)
- {
- printf("missing arc %p for level %i\n", arc->link_up, level);
- printf("Source arc was ---\n");
- printArc(arc);
-
- arc->link_up = NULL;
- }
- }
-
-
- verifyMultiResolutionLinks(lower_rg, level + 1);
- }
-#endif
-}
-/***************************************** BUCKET UTILS **********************************************/
-
-void addVertToBucket(EmbedBucket *b, float co[3])
-{
- b->nv++;
- VecLerpf(b->p, b->p, co, 1.0f / b->nv);
-}
-
-void removeVertFromBucket(EmbedBucket *b, float co[3])
-{
- VecMulf(b->p, (float)b->nv);
- VecSubf(b->p, b->p, co);
- b->nv--;
- VecMulf(b->p, 1.0f / (float)b->nv);
-}
-
-void mergeBuckets(EmbedBucket *bDst, EmbedBucket *bSrc)
-{
- if (bDst->nv > 0 && bSrc->nv > 0)
- {
- bDst->nv += bSrc->nv;
- VecLerpf(bDst->p, bDst->p, bSrc->p, (float)bSrc->nv / (float)(bDst->nv));
- }
- else if (bSrc->nv > 0)
- {
- bDst->nv = bSrc->nv;
- VECCOPY(bDst->p, bSrc->p);
- }
-}
-
-void mergeArcBuckets(ReebArc *aDst, ReebArc *aSrc, float start, float end)
-{
- if (aDst->bcount > 0 && aSrc->bcount > 0)
- {
- int indexDst = 0, indexSrc = 0;
-
- start = MAX3(start, aDst->buckets[0].val, aSrc->buckets[0].val);
-
- while(indexDst < aDst->bcount && aDst->buckets[indexDst].val < start)
- {
- indexDst++;
- }
-
- while(indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start)
- {
- indexSrc++;
- }
-
- for( ; indexDst < aDst->bcount &&
- indexSrc < aSrc->bcount &&
- aDst->buckets[indexDst].val <= end &&
- aSrc->buckets[indexSrc].val <= end
-
- ; indexDst++, indexSrc++)
- {
- mergeBuckets(aDst->buckets + indexDst, aSrc->buckets + indexSrc);
- }
- }
-}
-
-void flipArcBuckets(ReebArc *arc)
-{
- int i, j;
-
- for (i = 0, j = arc->bcount - 1; i < j; i++, j--)
- {
- EmbedBucket tmp;
-
- tmp = arc->buckets[i];
- arc->buckets[i] = arc->buckets[j];
- arc->buckets[j] = tmp;
- }
-}
-
-int countArcBuckets(ReebArc *arc)
-{
- return (int)(floor(arc->tail->weight) - ceil(arc->head->weight)) + 1;
-}
-
-void allocArcBuckets(ReebArc *arc)
-{
- int i;
- float start = ceil(arc->head->weight);
- arc->bcount = countArcBuckets(arc);
-
- if (arc->bcount > 0)
- {
- arc->buckets = MEM_callocN(sizeof(EmbedBucket) * arc->bcount, "embed bucket");
-
- for(i = 0; i < arc->bcount; i++)
- {
- arc->buckets[i].val = start + i;
- }
- }
- else
- {
- arc->buckets = NULL;
- }
-
-}
-
-void resizeArcBuckets(ReebArc *arc)
-{
- EmbedBucket *oldBuckets = arc->buckets;
- int oldBCount = arc->bcount;
-
- if (countArcBuckets(arc) == oldBCount)
- {
- return;
- }
-
- allocArcBuckets(arc);
-
- if (oldBCount != 0 && arc->bcount != 0)
- {
- int oldStart = (int)oldBuckets[0].val;
- int oldEnd = (int)oldBuckets[oldBCount - 1].val;
- int newStart = (int)arc->buckets[0].val;
- int newEnd = (int)arc->buckets[arc->bcount - 1].val;
- int oldOffset = 0;
- int newOffset = 0;
- int len;
-
- if (oldStart < newStart)
- {
- oldOffset = newStart - oldStart;
- }
- else
- {
- newOffset = oldStart - newStart;
- }
-
- len = MIN2(oldEnd - (oldStart + oldOffset) + 1, newEnd - (newStart - newOffset) + 1);
-
- memcpy(arc->buckets + newOffset, oldBuckets + oldOffset, len * sizeof(EmbedBucket));
- }
-
- if (oldBuckets != NULL)
- {
- MEM_freeN(oldBuckets);
- }
-}
-
-void reweightBuckets(ReebArc *arc)
-{
- int i;
- float start = ceil((arc->head)->weight);
-
- if (arc->bcount > 0)
- {
- for(i = 0; i < arc->bcount; i++)
- {
- arc->buckets[i].val = start + i;
- }
- }
-}
-
-static void interpolateBuckets(ReebArc *arc, float *start_p, float *end_p, int start_index, int end_index)
-{
- int total;
- int j;
-
- total = end_index - start_index + 2;
-
- for (j = start_index; j <= end_index; j++)
- {
- EmbedBucket *empty = arc->buckets + j;
- empty->nv = 1;
- VecLerpf(empty->p, start_p, end_p, (float)(j - start_index + 1) / total);
- }
-}
-
-void fillArcEmptyBuckets(ReebArc *arc)
-{
- float *start_p, *end_p;
- int start_index = 0, end_index = 0;
- int missing = 0;
- int i;
-
- start_p = arc->head->p;
-
- for(i = 0; i < arc->bcount; i++)
- {
- EmbedBucket *bucket = arc->buckets + i;
-
- if (missing)
- {
- if (bucket->nv > 0)
- {
- missing = 0;
-
- end_p = bucket->p;
- end_index = i - 1;
-
- interpolateBuckets(arc, start_p, end_p, start_index, end_index);
- }
- }
- else
- {
- if (bucket->nv == 0)
- {
- missing = 1;
-
- if (i > 0)
- {
- start_p = arc->buckets[i - 1].p;
- }
- start_index = i;
- }
- }
- }
-
- if (missing)
- {
- end_p = arc->tail->p;
- end_index = arc->bcount - 1;
-
- interpolateBuckets(arc, start_p, end_p, start_index, end_index);
- }
-}
-
-static void ExtendArcBuckets(ReebArc *arc)
-{
- ReebArcIterator iter;
- EmbedBucket *previous, *bucket, *last_bucket, *first_bucket;
- float average_length = 0, length;
- int padding_head = 0, padding_tail = 0;
-
- if (arc->bcount == 0)
- {
- return; /* failsafe, shouldn't happen */
- }
-
- initArcIterator(&iter, arc, arc->head);
-
- for ( previous = nextBucket(&iter), bucket = nextBucket(&iter);
- bucket;
- previous = bucket, bucket = nextBucket(&iter)
- )
- {
- average_length += VecLenf(previous->p, bucket->p);
- }
- average_length /= (arc->bcount - 1);
-
- first_bucket = arc->buckets;
- last_bucket = arc->buckets + (arc->bcount - 1);
-
- length = VecLenf(first_bucket->p, arc->head->p);
- if (length > 2 * average_length)
- {
- padding_head = (int)floor(length / average_length);
- }
-
- length = VecLenf(last_bucket->p, arc->tail->p);
- if (length > 2 * average_length)
- {
- padding_tail = (int)floor(length / average_length);
- }
-
- if (padding_head + padding_tail > 0)
- {
- EmbedBucket *old_buckets = arc->buckets;
-
- arc->buckets = MEM_callocN(sizeof(EmbedBucket) * (padding_head + arc->bcount + padding_tail), "embed bucket");
- memcpy(arc->buckets + padding_head, old_buckets, arc->bcount * sizeof(EmbedBucket));
-
- arc->bcount = padding_head + arc->bcount + padding_tail;
-
- MEM_freeN(old_buckets);
- }
-
- if (padding_head > 0)
- {
- interpolateBuckets(arc, arc->head->p, first_bucket->p, 0, padding_head);
- }
-
- if (padding_tail > 0)
- {
- interpolateBuckets(arc, last_bucket->p, arc->tail->p, arc->bcount - padding_tail, arc->bcount - 1);
- }
-}
-
-/* CALL THIS ONLY AFTER FILTERING, SINCE IT MESSES UP WEIGHT DISTRIBUTION */
-void extendGraphBuckets(ReebGraph *rg)
-{
- ReebArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- ExtendArcBuckets(arc);
- }
-}
-
-/**************************************** LENGTH CALCULATIONS ****************************************/
-
-void calculateArcLength(ReebArc *arc)
-{
- ReebArcIterator iter;
- EmbedBucket *bucket = NULL;
- float *vec0, *vec1;
-
- arc->length = 0;
-
- initArcIterator(&iter, arc, arc->head);
-
- bucket = nextBucket(&iter);
-
- vec0 = arc->head->p;
- vec1 = arc->head->p; /* in case there's no embedding */
-
- while (bucket != NULL)
- {
- vec1 = bucket->p;
-
- arc->length += VecLenf(vec0, vec1);
-
- vec0 = vec1;
- bucket = nextBucket(&iter);
- }
-
- arc->length += VecLenf(arc->tail->p, vec1);
-}
-
-void calculateGraphLength(ReebGraph *rg)
-{
- ReebArc *arc;
-
- for (arc = rg->arcs.first; arc; arc = arc->next)
- {
- calculateArcLength(arc);
- }
-}
-
-/**************************************** SYMMETRY HANDLING ******************************************/
-
-void REEB_RadialSymmetry(BNode* root_node, RadialArc* ring, int count)
-{
- ReebNode *node = (ReebNode*)root_node;
- float axis[3];
- int i;
-
- VECCOPY(axis, root_node->symmetry_axis);
-
- /* first pass, merge incrementally */
- for (i = 0; i < count - 1; i++)
- {
- ReebNode *node1, *node2;
- ReebArc *arc1, *arc2;
- float tangent[3];
- float normal[3];
- int j = i + 1;
-
- VecAddf(tangent, ring[i].n, ring[j].n);
- Crossf(normal, tangent, axis);
-
- node1 = (ReebNode*)BLI_otherNode(ring[i].arc, root_node);
- node2 = (ReebNode*)BLI_otherNode(ring[j].arc, root_node);
-
- arc1 = (ReebArc*)ring[i].arc;
- arc2 = (ReebArc*)ring[j].arc;
-
- /* mirror first node and mix with the second */
- BLI_mirrorAlongAxis(node1->p, root_node->p, normal);
- VecLerpf(node2->p, node2->p, node1->p, 1.0f / (j + 1));
-
- /* Merge buckets
- * there shouldn't be any null arcs here, but just to be safe
- * */
- if (arc1->bcount > 0 && arc2->bcount > 0)
- {
- ReebArcIterator iter1, iter2;
- EmbedBucket *bucket1 = NULL, *bucket2 = NULL;
-
- initArcIterator(&iter1, arc1, (ReebNode*)root_node);
- initArcIterator(&iter2, arc2, (ReebNode*)root_node);
-
- bucket1 = nextBucket(&iter1);
- bucket2 = nextBucket(&iter2);
-
- /* Make sure they both start at the same value */
- while(bucket1 && bucket1->val < bucket2->val)
- {
- bucket1 = nextBucket(&iter1);
- }
-
- while(bucket2 && bucket2->val < bucket1->val)
- {
- bucket2 = nextBucket(&iter2);
- }
-
-
- for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2))
- {
- bucket2->nv += bucket1->nv; /* add counts */
-
- /* mirror on axis */
- BLI_mirrorAlongAxis(bucket1->p, root_node->p, normal);
- /* add bucket2 in bucket1 */
- VecLerpf(bucket2->p, bucket2->p, bucket1->p, (float)bucket1->nv / (float)(bucket2->nv));
- }
- }
- }
-
- /* second pass, mirror back on previous arcs */
- for (i = count - 1; i > 0; i--)
- {
- ReebNode *node1, *node2;
- ReebArc *arc1, *arc2;
- float tangent[3];
- float normal[3];
- int j = i - 1;
-
- VecAddf(tangent, ring[i].n, ring[j].n);
- Crossf(normal, tangent, axis);
-
- node1 = (ReebNode*)BLI_otherNode(ring[i].arc, root_node);
- node2 = (ReebNode*)BLI_otherNode(ring[j].arc, root_node);
-
- arc1 = (ReebArc*)ring[i].arc;
- arc2 = (ReebArc*)ring[j].arc;
-
- /* copy first node than mirror */
- VECCOPY(node2->p, node1->p);
- BLI_mirrorAlongAxis(node2->p, root_node->p, normal);
-
- /* Copy buckets
- * there shouldn't be any null arcs here, but just to be safe
- * */
- if (arc1->bcount > 0 && arc2->bcount > 0)
- {
- ReebArcIterator iter1, iter2;
- EmbedBucket *bucket1 = NULL, *bucket2 = NULL;
-
- initArcIterator(&iter1, arc1, node);
- initArcIterator(&iter2, arc2, node);
-
- bucket1 = nextBucket(&iter1);
- bucket2 = nextBucket(&iter2);
-
- /* Make sure they both start at the same value */
- while(bucket1 && bucket1->val < bucket2->val)
- {
- bucket1 = nextBucket(&iter1);
- }
-
- while(bucket2 && bucket2->val < bucket1->val)
- {
- bucket2 = nextBucket(&iter2);
- }
-
-
- for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2))
- {
- /* copy and mirror back to bucket2 */
- bucket2->nv = bucket1->nv;
- VECCOPY(bucket2->p, bucket1->p);
- BLI_mirrorAlongAxis(bucket2->p, node->p, normal);
- }
- }
- }
-}
-
-void REEB_AxialSymmetry(BNode* root_node, BNode* node1, BNode* node2, struct BArc* barc1, BArc* barc2)
-{
- ReebArc *arc1, *arc2;
- float nor[3], p[3];
-
- arc1 = (ReebArc*)barc1;
- arc2 = (ReebArc*)barc2;
-
- VECCOPY(nor, root_node->symmetry_axis);
-
- /* mirror node2 along axis */
- VECCOPY(p, node2->p);
- BLI_mirrorAlongAxis(p, root_node->p, nor);
-
- /* average with node1 */
- VecAddf(node1->p, node1->p, p);
- VecMulf(node1->p, 0.5f);
-
- /* mirror back on node2 */
- VECCOPY(node2->p, node1->p);
- BLI_mirrorAlongAxis(node2->p, root_node->p, nor);
-
- /* Merge buckets
- * there shouldn't be any null arcs here, but just to be safe
- * */
- if (arc1->bcount > 0 && arc2->bcount > 0)
- {
- ReebArcIterator iter1, iter2;
- EmbedBucket *bucket1 = NULL, *bucket2 = NULL;
-
- initArcIterator(&iter1, arc1, (ReebNode*)root_node);
- initArcIterator(&iter2, arc2, (ReebNode*)root_node);
-
- bucket1 = nextBucket(&iter1);
- bucket2 = nextBucket(&iter2);
-
- /* Make sure they both start at the same value */
- while(bucket1 && bucket1->val < bucket2->val)
- {
- bucket1 = nextBucket(&iter1);
- }
-
- while(bucket2 && bucket2->val < bucket1->val)
- {
- bucket2 = nextBucket(&iter2);
- }
-
-
- for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2))
- {
- bucket1->nv += bucket2->nv; /* add counts */
-
- /* mirror on axis */
- BLI_mirrorAlongAxis(bucket2->p, root_node->p, nor);
- /* add bucket2 in bucket1 */
- VecLerpf(bucket1->p, bucket1->p, bucket2->p, (float)bucket2->nv / (float)(bucket1->nv));
-
- /* copy and mirror back to bucket2 */
- bucket2->nv = bucket1->nv;
- VECCOPY(bucket2->p, bucket1->p);
- BLI_mirrorAlongAxis(bucket2->p, root_node->p, nor);
- }
- }
-}
-
-/************************************** ADJACENCY LIST *************************************************/
-
-
-/****************************************** SMOOTHING **************************************************/
-
-void postprocessGraph(ReebGraph *rg, char mode)
-{
- ReebArc *arc;
- float fac1 = 0, fac2 = 1, fac3 = 0;
-
- switch(mode)
- {
- case SKGEN_AVERAGE:
- fac1 = fac2 = fac3 = 1.0f / 3.0f;
- break;
- case SKGEN_SMOOTH:
- fac1 = fac3 = 0.25f;
- fac2 = 0.5f;
- break;
- case SKGEN_SHARPEN:
- fac1 = fac2 = -0.25f;
- fac2 = 1.5f;
- break;
- default:
- error("Unknown post processing mode");
- return;
- }
-
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- EmbedBucket *buckets = arc->buckets;
- int bcount = arc->bcount;
- int index;
-
- for(index = 1; index < bcount - 1; index++)
- {
- VecLerpf(buckets[index].p, buckets[index].p, buckets[index - 1].p, fac1 / (fac1 + fac2));
- VecLerpf(buckets[index].p, buckets[index].p, buckets[index + 1].p, fac3 / (fac1 + fac2 + fac3));
- }
- }
-}
-
-/********************************************SORTING****************************************************/
-
-int compareNodesWeight(void *vnode1, void *vnode2)
-{
- ReebNode *node1 = (ReebNode*)vnode1;
- ReebNode *node2 = (ReebNode*)vnode2;
-
- if (node1->weight < node2->weight)
- {
- return -1;
- }
- if (node1->weight > node2->weight)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-void sortNodes(ReebGraph *rg)
-{
- BLI_sortlist(&rg->nodes, compareNodesWeight);
-}
-
-int compareArcsWeight(void *varc1, void *varc2)
-{
- ReebArc *arc1 = (ReebArc*)varc1;
- ReebArc *arc2 = (ReebArc*)varc2;
- ReebNode *node1 = (ReebNode*)arc1->head;
- ReebNode *node2 = (ReebNode*)arc2->head;
-
- if (node1->weight < node2->weight)
- {
- return -1;
- }
- if (node1->weight > node2->weight)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-void sortArcs(ReebGraph *rg)
-{
- BLI_sortlist(&rg->arcs, compareArcsWeight);
-}
-/******************************************* JOINING ***************************************************/
-
-void reweightArc(ReebGraph *rg, ReebArc *arc, ReebNode *start_node, float start_weight)
-{
- ReebNode *node;
- float old_weight;
- float end_weight = start_weight + ABS(arc->tail->weight - arc->head->weight);
- int i;
-
- node = (ReebNode*)BLI_otherNode((BArc*)arc, (BNode*)start_node);
-
- /* prevent backtracking */
- if (node->flag == 1)
- {
- return;
- }
-
- if (arc->tail == start_node)
- {
- flipArc(arc);
- }
-
- start_node->flag = 1;
-
- for (i = 0; i < node->degree; i++)
- {
- ReebArc *next_arc = node->arcs[i];
-
- reweightArc(rg, next_arc, node, end_weight);
- }
-
- /* update only if needed */
- if (arc->head->weight != start_weight || arc->tail->weight != end_weight)
- {
- old_weight = arc->head->weight; /* backup head weight, other arcs need it intact, it will be fixed by the source arc */
-
- arc->head->weight = start_weight;
- arc->tail->weight = end_weight;
-
- reweightBuckets(arc);
- resizeArcBuckets(arc);
- fillArcEmptyBuckets(arc);
-
- arc->head->weight = old_weight;
- }
-}
-
-void reweightSubgraph(ReebGraph *rg, ReebNode *start_node, float start_weight)
-{
- int i;
-
- BLI_flagNodes((BGraph*)rg, 0);
-
- for (i = 0; i < start_node->degree; i++)
- {
- ReebArc *next_arc = start_node->arcs[i];
-
- reweightArc(rg, next_arc, start_node, start_weight);
- }
- start_node->weight = start_weight;
-}
-
-int joinSubgraphsEnds(ReebGraph *rg, float threshold, int nb_subgraphs)
-{
- int joined = 0;
- int subgraph;
-
- for (subgraph = 1; subgraph <= nb_subgraphs; subgraph++)
- {
- ReebNode *start_node, *end_node;
- ReebNode *min_node_start = NULL, *min_node_end = NULL;
- float min_distance = FLT_MAX;
-
- for (start_node = rg->nodes.first; start_node; start_node = start_node->next)
- {
- if (start_node->subgraph_index == subgraph && start_node->degree == 1)
- {
-
- for (end_node = rg->nodes.first; end_node; end_node = end_node->next)
- {
- if (end_node->subgraph_index != subgraph)
- {
- float distance = VecLenf(start_node->p, end_node->p);
-
- if (distance < threshold && distance < min_distance)
- {
- min_distance = distance;
- min_node_end = end_node;
- min_node_start = start_node;
- }
- }
- }
- }
- }
-
- end_node = min_node_end;
- start_node = min_node_start;
-
- if (end_node && start_node)
- {
- ReebArc *start_arc, *end_arc;
- int merging = 0;
-
- start_arc = start_node->arcs[0];
- end_arc = end_node->arcs[0];
-
- if (start_arc->tail == start_node)
- {
- reweightSubgraph(rg, end_node, start_node->weight);
-
- start_arc->tail = end_node;
-
- merging = 1;
- }
- else if (start_arc->head == start_node)
- {
- reweightSubgraph(rg, start_node, end_node->weight);
-
- start_arc->head = end_node;
-
- merging = 2;
- }
-
- if (merging)
- {
- BLI_ReflagSubgraph((BGraph*)rg, end_node->flag, subgraph);
-
- resizeArcBuckets(start_arc);
- fillArcEmptyBuckets(start_arc);
-
- NodeDegreeIncrement(rg, end_node);
- BLI_rebuildAdjacencyListForNode((BGraph*)rg, (BNode*)end_node);
-
- BLI_removeNode((BGraph*)rg, (BNode*)start_node);
- }
-
- joined = 1;
- }
- }
-
- return joined;
-}
-
-/* Reweight graph from smallest node, fix fliped arcs */
-void fixSubgraphsOrientation(ReebGraph *rg, int nb_subgraphs)
-{
- int subgraph;
-
- for (subgraph = 1; subgraph <= nb_subgraphs; subgraph++)
- {
- ReebNode *node;
- ReebNode *start_node = NULL;
-
- for (node = rg->nodes.first; node; node = node->next)
- {
- if (node->subgraph_index == subgraph)
- {
- if (start_node == NULL || node->weight < start_node->weight)
- {
- start_node = node;
- }
- }
- }
-
- if (start_node)
- {
- reweightSubgraph(rg, start_node, start_node->weight);
- }
- }
-}
-
-int joinSubgraphs(ReebGraph *rg, float threshold)
-{
- int nb_subgraphs;
- int joined = 0;
-
- BLI_buildAdjacencyList((BGraph*)rg);
-
- if (BLI_isGraphCyclic((BGraph*)rg))
- {
- /* don't deal with cyclic graphs YET */
- return 0;
- }
-
- /* sort nodes before flagging subgraphs to make sure root node is subgraph 0 */
- sortNodes(rg);
-
- nb_subgraphs = BLI_FlagSubgraphs((BGraph*)rg);
-
- /* Harmonic function can create flipped arcs, take the occasion to fix them */
- if (G.scene->toolsettings->skgen_options & SKGEN_HARMONIC)
- {
- fixSubgraphsOrientation(rg, nb_subgraphs);
- }
-
- if (nb_subgraphs > 1)
- {
- joined |= joinSubgraphsEnds(rg, threshold, nb_subgraphs);
-
- if (joined)
- {
- removeNormalNodes(rg);
- BLI_buildAdjacencyList((BGraph*)rg);
- }
- }
-
- return joined;
-}
-
-/****************************************** FILTERING **************************************************/
-
-float lengthArc(ReebArc *arc)
-{
-#if 0
- ReebNode *head = (ReebNode*)arc->head;
- ReebNode *tail = (ReebNode*)arc->tail;
-
- return tail->weight - head->weight;
-#else
- return arc->length;
-#endif
-}
-
-int compareArcs(void *varc1, void *varc2)
-{
- ReebArc *arc1 = (ReebArc*)varc1;
- ReebArc *arc2 = (ReebArc*)varc2;
- float len1 = lengthArc(arc1);
- float len2 = lengthArc(arc2);
-
- if (len1 < len2)
- {
- return -1;
- }
- if (len1 > len2)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, ReebArc * srcArc, int merging)
-{
- ReebArc *arc = NULL, *nextArc = NULL;
-
- if (merging)
- {
- /* first pass, merge buckets for arcs that spawned the two nodes into the source arc*/
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- if (arc->head == srcArc->head && arc->tail == srcArc->tail && arc != srcArc)
- {
- ReebNode *head = srcArc->head;
- ReebNode *tail = srcArc->tail;
- mergeArcBuckets(srcArc, arc, head->weight, tail->weight);
- }
- }
- }
-
- /* second pass, replace removedNode by newNode, remove arcs that are collapsed in a loop */
- arc = rg->arcs.first;
- while(arc)
- {
- nextArc = arc->next;
-
- if (arc->head == removedNode || arc->tail == removedNode)
- {
- if (arc->head == removedNode)
- {
- arc->head = newNode;
- }
- else
- {
- arc->tail = newNode;
- }
-
- // Remove looped arcs
- if (arc->head == arc->tail)
- {
- // v1 or v2 was already newNode, since we're removing an arc, decrement degree
- NodeDegreeDecrement(rg, newNode);
-
- // If it's srcArc, it'll be removed later, so keep it for now
- if (arc != srcArc)
- {
- BLI_remlink(&rg->arcs, arc);
- REEB_freeArc((BArc*)arc);
- }
- }
- else
- {
- /* flip arcs that flipped, can happen on diamond shapes, mostly on null arcs */
- if (arc->head->weight > arc->tail->weight)
- {
- flipArc(arc);
- }
- //newNode->degree++; // incrementing degree since we're adding an arc
- NodeDegreeIncrement(rg, newNode);
- mergeArcFaces(rg, arc, srcArc);
-
- if (merging)
- {
- ReebNode *head = arc->head;
- ReebNode *tail = arc->tail;
-
- // resize bucket list
- resizeArcBuckets(arc);
- mergeArcBuckets(arc, srcArc, head->weight, tail->weight);
-
- /* update length */
- arc->length += srcArc->length;
- }
- }
- }
-
- arc = nextArc;
- }
-}
-
-void filterNullReebGraph(ReebGraph *rg)
-{
- ReebArc *arc = NULL, *nextArc = NULL;
-
- arc = rg->arcs.first;
- while(arc)
- {
- nextArc = arc->next;
- // Only collapse arcs too short to have any embed bucket
- if (arc->bcount == 0)
- {
- ReebNode *newNode = (ReebNode*)arc->head;
- ReebNode *removedNode = (ReebNode*)arc->tail;
- float blend;
-
- blend = (float)newNode->degree / (float)(newNode->degree + removedNode->degree); // blending factors
-
- VecLerpf(newNode->p, removedNode->p, newNode->p, blend);
-
- filterArc(rg, newNode, removedNode, arc, 0);
-
- // Reset nextArc, it might have changed
- nextArc = arc->next;
-
- BLI_remlink(&rg->arcs, arc);
- REEB_freeArc((BArc*)arc);
-
- BLI_removeNode((BGraph*)rg, (BNode*)removedNode);
- }
-
- arc = nextArc;
- }
-}
-
-int filterInternalExternalReebGraph(ReebGraph *rg, float threshold_internal, float threshold_external)
-{
- ReebArc *arc = NULL, *nextArc = NULL;
- int value = 0;
-
- BLI_sortlist(&rg->arcs, compareArcs);
-
- for (arc = rg->arcs.first; arc; arc = nextArc)
- {
- nextArc = arc->next;
-
- // Only collapse non-terminal arcs that are shorter than threshold
- if (threshold_internal > 0 && arc->head->degree > 1 && arc->tail->degree > 1 && (lengthArc(arc) < threshold_internal))
- {
- ReebNode *newNode = NULL;
- ReebNode *removedNode = NULL;
-
- /* Always remove lower node, so arcs don't flip */
- newNode = arc->head;
- removedNode = arc->tail;
-
- filterArc(rg, newNode, removedNode, arc, 1);
-
- // Reset nextArc, it might have changed
- nextArc = arc->next;
-
- BLI_remlink(&rg->arcs, arc);
- REEB_freeArc((BArc*)arc);
-
- BLI_removeNode((BGraph*)rg, (BNode*)removedNode);
- value = 1;
- }
-
- // Only collapse terminal arcs that are shorter than threshold
- else if (threshold_external > 0 && (arc->head->degree == 1 || arc->tail->degree == 1) && (lengthArc(arc) < threshold_external))
- {
- ReebNode *terminalNode = NULL;
- ReebNode *middleNode = NULL;
- ReebNode *removedNode = NULL;
-
- // Assign terminal and middle nodes
- if (arc->head->degree == 1)
- {
- terminalNode = arc->head;
- middleNode = arc->tail;
- }
- else
- {
- terminalNode = arc->tail;
- middleNode = arc->head;
- }
-
- if (middleNode->degree == 2)
- {
-#if 1
- // If middle node is a normal node, it will be removed later
- /* USE THIS IF YOU WANT TO PROLONG ARCS TO THEIR TERMINAL NODES
- * FOR HANDS, THIS IS NOT THE BEST RESULT
- * */
- continue;
-#else
- removedNode = terminalNode;
-
- // removing arc, so we need to decrease the degree of the remaining node
- NodeDegreeDecrement(rg, middleNode);
-#endif
- }
- // Otherwise, just plain remove of the arc
- else
- {
- removedNode = terminalNode;
-
- // removing arc, so we need to decrease the degree of the remaining node
- NodeDegreeDecrement(rg, middleNode);
- }
-
- // Reset nextArc, it might have changed
- nextArc = arc->next;
-
- BLI_remlink(&rg->arcs, arc);
- REEB_freeArc((BArc*)arc);
-
- BLI_removeNode((BGraph*)rg, (BNode*)removedNode);
- value = 1;
- }
- }
-
- return value;
-}
-
-int filterCyclesReebGraph(ReebGraph *rg, float distance_threshold)
-{
- ReebArc *arc1, *arc2;
- ReebArc *next2;
- int filtered = 0;
-
- for (arc1 = rg->arcs.first; arc1; arc1 = arc1->next)
- {
- for (arc2 = arc1->next; arc2; arc2 = next2)
- {
- next2 = arc2->next;
- if (arc1 != arc2 && arc1->head == arc2->head && arc1->tail == arc2->tail)
- {
- mergeArcEdges(rg, arc1, arc2, MERGE_APPEND);
- mergeArcFaces(rg, arc1, arc2);
- mergeArcBuckets(arc1, arc2, arc1->head->weight, arc1->tail->weight);
-
- NodeDegreeDecrement(rg, arc1->head);
- NodeDegreeDecrement(rg, arc1->tail);
-
- BLI_remlink(&rg->arcs, arc2);
- REEB_freeArc((BArc*)arc2);
-
- filtered = 1;
- }
- }
- }
-
- return filtered;
-}
-
-int filterSmartReebGraph(ReebGraph *rg, float threshold)
-{
- ReebArc *arc = NULL, *nextArc = NULL;
- int value = 0;
-
- BLI_sortlist(&rg->arcs, compareArcs);
-
-#ifdef DEBUG_REEB
- {
- EditFace *efa;
- for(efa=G.editMesh->faces.first; efa; efa=efa->next) {
- efa->tmp.fp = -1;
- }
- }
-#endif
-
- arc = rg->arcs.first;
- while(arc)
- {
- nextArc = arc->next;
-
- /* need correct normals and center */
- recalc_editnormals();
-
- // Only test terminal arcs
- if (arc->head->degree == 1 || arc->tail->degree == 1)
- {
- GHashIterator ghi;
- int merging = 0;
- int total = BLI_ghash_size(arc->faces);
- float avg_angle = 0;
- float avg_vec[3] = {0,0,0};
-
- for(BLI_ghashIterator_init(&ghi, arc->faces);
- !BLI_ghashIterator_isDone(&ghi);
- BLI_ghashIterator_step(&ghi))
- {
- EditFace *efa = BLI_ghashIterator_getValue(&ghi);
-
-#if 0
- ReebArcIterator iter;
- EmbedBucket *bucket = NULL;
- EmbedBucket *previous = NULL;
- float min_distance = -1;
- float angle = 0;
-
- initArcIterator(&iter, arc, arc->head);
-
- bucket = nextBucket(&iter);
-
- while (bucket != NULL)
- {
- float *vec0 = NULL;
- float *vec1 = bucket->p;
- float midpoint[3], tangent[3];
- float distance;
-
- /* first bucket. Previous is head */
- if (previous == NULL)
- {
- vec0 = arc->head->p;
- }
- /* Previous is a valid bucket */
- else
- {
- vec0 = previous->p;
- }
-
- VECCOPY(midpoint, vec1);
-
- distance = VecLenf(midpoint, efa->cent);
-
- if (min_distance == -1 || distance < min_distance)
- {
- min_distance = distance;
-
- VecSubf(tangent, vec1, vec0);
- Normalize(tangent);
-
- angle = Inpf(tangent, efa->n);
- }
-
- previous = bucket;
- bucket = nextBucket(&iter);
- }
-
- avg_angle += saacos(fabs(angle));
-#ifdef DEBUG_REEB
- efa->tmp.fp = saacos(fabs(angle));
-#endif
-#else
- VecAddf(avg_vec, avg_vec, efa->n);
-#endif
- }
-
-
-#if 0
- avg_angle /= total;
-#else
- VecMulf(avg_vec, 1.0 / total);
- avg_angle = Inpf(avg_vec, avg_vec);
-#endif
-
- arc->angle = avg_angle;
-
- if (avg_angle > threshold)
- merging = 1;
-
- if (merging)
- {
- ReebNode *terminalNode = NULL;
- ReebNode *middleNode = NULL;
- ReebNode *newNode = NULL;
- ReebNode *removedNode = NULL;
- int merging = 0;
-
- // Assign terminal and middle nodes
- if (arc->head->degree == 1)
- {
- terminalNode = arc->head;
- middleNode = arc->tail;
- }
- else
- {
- terminalNode = arc->tail;
- middleNode = arc->head;
- }
-
- // If middle node is a normal node, merge to terminal node
- if (middleNode->degree == 2)
- {
- merging = 1;
- newNode = terminalNode;
- removedNode = middleNode;
- }
- // Otherwise, just plain remove of the arc
- else
- {
- merging = 0;
- newNode = middleNode;
- removedNode = terminalNode;
- }
-
- // Merging arc
- if (merging)
- {
- filterArc(rg, newNode, removedNode, arc, 1);
- }
- else
- {
- // removing arc, so we need to decrease the degree of the remaining node
- //newNode->degree--;
- NodeDegreeDecrement(rg, newNode);
- }
-
- // Reset nextArc, it might have changed
- nextArc = arc->next;
-
- BLI_remlink(&rg->arcs, arc);
- REEB_freeArc((BArc*)arc);
-
- BLI_freelinkN(&rg->nodes, removedNode);
- value = 1;
- }
- }
-
- arc = nextArc;
- }
-
- return value;
-}
-
-void filterGraph(ReebGraph *rg, short options, float threshold_internal, float threshold_external)
-{
- int done = 1;
-
- calculateGraphLength(rg);
-
- if ((options & SKGEN_FILTER_EXTERNAL) == 0)
- {
- threshold_external = 0;
- }
-
- if ((options & SKGEN_FILTER_INTERNAL) == 0)
- {
- threshold_internal = 0;
- }
-
- if (threshold_internal > 0 || threshold_external > 0)
- {
- /* filter until there's nothing more to do */
- while (done == 1)
- {
- done = 0; /* no work done yet */
-
- done = filterInternalExternalReebGraph(rg, threshold_internal, threshold_external);
- }
- }
-
- if (options & SKGEN_FILTER_SMART)
- {
- filterSmartReebGraph(rg, 0.5);
- filterCyclesReebGraph(rg, 0.5);
- }
-
- repositionNodes(rg);
-
- /* Filtering might have created degree 2 nodes, so remove them */
- removeNormalNodes(rg);
-}
-
-void finalizeGraph(ReebGraph *rg, char passes, char method)
-{
- int i;
-
- BLI_buildAdjacencyList((BGraph*)rg);
-
- sortNodes(rg);
-
- sortArcs(rg);
-
- for(i = 0; i < passes; i++)
- {
- postprocessGraph(rg, method);
- }
-
- extendGraphBuckets(rg);
-}
-
-/************************************** WEIGHT SPREADING ***********************************************/
-
-int compareVerts( const void* a, const void* b )
-{
- EditVert *va = *(EditVert**)a;
- EditVert *vb = *(EditVert**)b;
- int value = 0;
-
- if (weightData(va) < weightData(vb))
- {
- value = -1;
- }
- else if (weightData(va) > weightData(vb))
- {
- value = 1;
- }
-
- return value;
-}
-
-void spreadWeight(EditMesh *em)
-{
- EditVert **verts, *eve;
- float lastWeight = 0.0f;
- int totvert = BLI_countlist(&em->verts);
- int i;
- int work_needed = 1;
-
- verts = MEM_callocN(sizeof(EditVert*) * totvert, "verts array");
-
- for(eve = em->verts.first, i = 0; eve; eve = eve->next, i++)
- {
- verts[i] = eve;
- }
-
- while(work_needed == 1)
- {
- work_needed = 0;
- qsort(verts, totvert, sizeof(EditVert*), compareVerts);
-
- for(i = 0; i < totvert; i++)
- {
- eve = verts[i];
-
- if (i == 0 || (weightData(eve) - lastWeight) > FLT_EPSILON)
- {
- lastWeight = weightData(eve);
- }
- else
- {
- work_needed = 1;
- weightSetData(eve, lastWeight + FLT_EPSILON * 2);
- lastWeight = weightData(eve);
- }
- }
- }
-
- MEM_freeN(verts);
-}
-
-/******************************************** EXPORT ***************************************************/
-
-void exportNode(FILE *f, char *text, ReebNode *node)
-{
- fprintf(f, "%s i:%i w:%f d:%i %f %f %f\n", text, node->index, node->weight, node->degree, node->p[0], node->p[1], node->p[2]);
-}
-
-void REEB_exportGraph(ReebGraph *rg, int count)
-{
- ReebArc *arc;
- char filename[128];
- FILE *f;
-
- if (count == -1)
- {
- sprintf(filename, "test.txt");
- }
- else
- {
- sprintf(filename, "test%05i.txt", count);
- }
- f = fopen(filename, "w");
-
- for(arc = rg->arcs.first; arc; arc = arc->next)
- {
- int i;
- float p[3];
-
- exportNode(f, "v1", arc->head);
-
- for(i = 0; i < arc->bcount; i++)
- {
- fprintf(f, "b nv:%i %f %f %f\n", arc->buckets[i].nv, arc->buckets[i].p[0], arc->buckets[i].p[1], arc->buckets[i].p[2]);
- }
-
- VecAddf(p, arc->tail->p, arc->head->p);
- VecMulf(p, 0.5f);
-
- fprintf(f, "angle %0.3f %0.3f %0.3f %0.3f %i\n", p[0], p[1], p[2], arc->angle, BLI_ghash_size(arc->faces));
- exportNode(f, "v2", arc->tail);
- }
-
- fclose(f);
-}
-
-/***************************************** MAIN ALGORITHM **********************************************/
-
-/* edges alone will create zero degree nodes, use this function to remove them */
-void removeZeroNodes(ReebGraph *rg)
-{
- ReebNode *node, *next_node;
-
- for (node = rg->nodes.first; node; node = next_node)
- {
- next_node = node->next;
-
- if (node->degree == 0)
- {
- BLI_removeNode((BGraph*)rg, (BNode*)node);
- }
- }
-}
-
-void removeNormalNodes(ReebGraph *rg)
-{
- ReebArc *arc, *nextArc;
-
- // Merge degree 2 nodes
- for(arc = rg->arcs.first; arc; arc = nextArc)
- {
- nextArc = arc->next;
-
- while (arc->head->degree == 2 || arc->tail->degree == 2)
- {
- // merge at v1
- if (arc->head->degree == 2)
- {
- ReebArc *connectedArc = (ReebArc*)BLI_findConnectedArc((BGraph*)rg, (BArc*)arc, (BNode*)arc->head);
-
- /* If arcs are one after the other */
- if (arc->head == connectedArc->tail)
- {
- /* remove furthest arc */
- if (arc->tail->weight < connectedArc->head->weight)
- {
- mergeConnectedArcs(rg, arc, connectedArc);
- nextArc = arc->next;
- }
- else
- {
- mergeConnectedArcs(rg, connectedArc, arc);
- break; /* arc was removed, move to next */
- }
- }
- /* Otherwise, arcs are side by side */
- else
- {
- /* Don't do anything, we need to keep the lowest node, even if degree 2 */
- break;
- }
- }
-
- // merge at v2
- if (arc->tail->degree == 2)
- {
- ReebArc *connectedArc = (ReebArc*)BLI_findConnectedArc((BGraph*)rg, (BArc*)arc, (BNode*)arc->tail);
-
- /* If arcs are one after the other */
- if (arc->tail == connectedArc->head)
- {
- /* remove furthest arc */
- if (arc->head->weight < connectedArc->tail->weight)
- {
- mergeConnectedArcs(rg, arc, connectedArc);
- nextArc = arc->next;
- }
- else
- {
- mergeConnectedArcs(rg, connectedArc, arc);
- break; /* arc was removed, move to next */
- }
- }
- /* Otherwise, arcs are side by side */
- else
- {
- /* Don't do anything, we need to keep the lowest node, even if degree 2 */
- break;
- }
- }
- }
- }
-
-}
-
-int edgeEquals(ReebEdge *e1, ReebEdge *e2)
-{
- return (e1->v1 == e2->v1 && e1->v2 == e2->v2);
-}
-
-ReebArc *nextArcMappedToEdge(ReebArc *arc, ReebEdge *e)
-{
- ReebEdge *nextEdge = NULL;
- ReebEdge *edge = NULL;
- ReebArc *result = NULL;
-
- /* Find the ReebEdge in the edge list */
- for(edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next)
- { }
-
- nextEdge = edge->nextEdge;
-
- if (nextEdge != NULL)
- {
- result = nextEdge->arc;
- }
-
- return result;
-}
-
-void addFacetoArc(ReebArc *arc, EditFace *efa)
-{
- BLI_ghash_insert(arc->faces, efa, efa);
-}
-
-void mergeArcFaces(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc)
-{
- GHashIterator ghi;
-
- for(BLI_ghashIterator_init(&ghi, aSrc->faces);
- !BLI_ghashIterator_isDone(&ghi);
- BLI_ghashIterator_step(&ghi))
- {
- EditFace *efa = BLI_ghashIterator_getValue(&ghi);
- BLI_ghash_insert(aDst->faces, efa, efa);
- }
-}
-
-void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection direction)
-{
- ReebEdge *e = NULL;
-
- if (direction == MERGE_APPEND)
- {
- for(e = aSrc->edges.first; e; e = e->next)
- {
- e->arc = aDst; // Edge is stolen by new arc
- }
-
- addlisttolist(&aDst->edges , &aSrc->edges);
- }
- else
- {
- for(e = aSrc->edges.first; e; e = e->next)
- {
- ReebEdge *newEdge = copyEdge(e);
-
- newEdge->arc = aDst;
-
- BLI_addtail(&aDst->edges, newEdge);
-
- if (direction == MERGE_LOWER)
- {
- void **p = BLI_edgehash_lookup_p(rg->emap, e->v1->index, e->v2->index);
-
- newEdge->nextEdge = e;
-
- // if edge was the first in the list, point the edit edge to the new reeb edge instead.
- if (*p == e)
- {
- *p = (void*)newEdge;
- }
- // otherwise, advance in the list until the predecessor is found then insert it there
- else
- {
- ReebEdge *previous = (ReebEdge*)*p;
-
- while(previous->nextEdge != e)
- {
- previous = previous->nextEdge;
- }
-
- previous->nextEdge = newEdge;
- }
- }
- else
- {
- newEdge->nextEdge = e->nextEdge;
- e->nextEdge = newEdge;
- }
- }
- }
-}
-
-// return 1 on full merge
-int mergeConnectedArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1)
-{
- int result = 0;
- ReebNode *removedNode = NULL;
-
- a0->length += a1->length;
-
- mergeArcEdges(rg, a0, a1, MERGE_APPEND);
- mergeArcFaces(rg, a0, a1);
-
- // Bring a0 to the combine length of both arcs
- if (a0->tail == a1->head)
- {
- removedNode = a0->tail;
- a0->tail = a1->tail;
- }
- else if (a0->head == a1->tail)
- {
- removedNode = a0->head;
- a0->head = a1->head;
- }
-
- resizeArcBuckets(a0);
- // Merge a1 in a0
- mergeArcBuckets(a0, a1, a0->head->weight, a0->tail->weight);
-
- // remove a1 from graph
- BLI_remlink(&rg->arcs, a1);
- REEB_freeArc((BArc*)a1);
-
- BLI_removeNode((BGraph*)rg, (BNode*)removedNode);
- result = 1;
-
- return result;
-}
-// return 1 on full merge
-int mergeArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1)
-{
- int result = 0;
- // TRIANGLE POINTS DOWN
- if (a0->head->weight == a1->head->weight) // heads are the same
- {
- if (a0->tail->weight == a1->tail->weight) // tails also the same, arcs can be totally merge together
- {
- mergeArcEdges(rg, a0, a1, MERGE_APPEND);
- mergeArcFaces(rg, a0, a1);
-
- mergeArcBuckets(a0, a1, a0->head->weight, a0->tail->weight);
-
- // Adjust node degree
- //a1->head->degree--;
- NodeDegreeDecrement(rg, a1->head);
- //a1->tail->degree--;
- NodeDegreeDecrement(rg, a1->tail);
-
- // remove a1 from graph
- BLI_remlink(&rg->arcs, a1);
-
- REEB_freeArc((BArc*)a1);
- result = 1;
- }
- else if (a0->tail->weight > a1->tail->weight) // a1->tail->weight is in the middle
- {
- mergeArcEdges(rg, a1, a0, MERGE_LOWER);
- mergeArcFaces(rg, a1, a0);
-
- // Adjust node degree
- //a0->head->degree--;
- NodeDegreeDecrement(rg, a0->head);
- //a1->tail->degree++;
- NodeDegreeIncrement(rg, a1->tail);
-
- mergeArcBuckets(a1, a0, a1->head->weight, a1->tail->weight);
- a0->head = a1->tail;
- resizeArcBuckets(a0);
- }
- else // a0>n2 is in the middle
- {
- mergeArcEdges(rg, a0, a1, MERGE_LOWER);
- mergeArcFaces(rg, a0, a1);
-
- // Adjust node degree
- //a1->head->degree--;
- NodeDegreeDecrement(rg, a1->head);
- //a0->tail->degree++;
- NodeDegreeIncrement(rg, a0->tail);
-
- mergeArcBuckets(a0, a1, a0->head->weight, a0->tail->weight);
- a1->head = a0->tail;
- resizeArcBuckets(a1);
- }
- }
- // TRIANGLE POINTS UP
- else if (a0->tail->weight == a1->tail->weight) // tails are the same
- {
- if (a0->head->weight > a1->head->weight) // a0->head->weight is in the middle
- {
- mergeArcEdges(rg, a0, a1, MERGE_HIGHER);
- mergeArcFaces(rg, a0, a1);
-
- // Adjust node degree
- //a1->tail->degree--;
- NodeDegreeDecrement(rg, a1->tail);
- //a0->head->degree++;
- NodeDegreeIncrement(rg, a0->head);
-
- mergeArcBuckets(a0, a1, a0->head->weight, a0->tail->weight);
- a1->tail = a0->head;
- resizeArcBuckets(a1);
- }
- else // a1->head->weight is in the middle
- {
- mergeArcEdges(rg, a1, a0, MERGE_HIGHER);
- mergeArcFaces(rg, a1, a0);
-
- // Adjust node degree
- //a0->tail->degree--;
- NodeDegreeDecrement(rg, a0->tail);
- //a1->head->degree++;
- NodeDegreeIncrement(rg, a1->head);
-
- mergeArcBuckets(a1, a0, a1->head->weight, a1->tail->weight);
- a0->tail = a1->head;
- resizeArcBuckets(a0);
- }
- }
- else
- {
- // Need something here (OR NOT)
- }
-
- return result;
-}
-
-void glueByMergeSort(ReebGraph *rg, ReebArc *a0, ReebArc *a1, ReebEdge *e0, ReebEdge *e1)
-{
- int total = 0;
- while (total == 0 && a0 != a1 && a0 != NULL && a1 != NULL)
- {
- total = mergeArcs(rg, a0, a1);
-
- if (total == 0) // if it wasn't a total merge, go forward
- {
- if (a0->tail->weight < a1->tail->weight)
- {
- a0 = nextArcMappedToEdge(a0, e0);
- }
- else
- {
- a1 = nextArcMappedToEdge(a1, e1);
- }
- }
- }
-}
-
-void mergePaths(ReebGraph *rg, ReebEdge *e0, ReebEdge *e1, ReebEdge *e2)
-{
- ReebArc *a0, *a1, *a2;
- a0 = e0->arc;
- a1 = e1->arc;
- a2 = e2->arc;
-
- glueByMergeSort(rg, a0, a1, e0, e1);
- glueByMergeSort(rg, a0, a2, e0, e2);
-}
-
-ReebEdge * createArc(ReebGraph *rg, ReebNode *node1, ReebNode *node2)
-{
- ReebEdge *edge;
-
- edge = BLI_edgehash_lookup(rg->emap, node1->index, node2->index);
-
- // Only add existing edges that haven't been added yet
- if (edge == NULL)
- {
- ReebArc *arc;
- ReebNode *v1, *v2;
- float len, offset;
- int i;
-
- arc = MEM_callocN(sizeof(ReebArc), "reeb arc");
- edge = MEM_callocN(sizeof(ReebEdge), "reeb edge");
-
- arc->flag = 0; // clear flag on init
- arc->symmetry_level = 0;
- arc->faces = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
-
- if (node1->weight <= node2->weight)
- {
- v1 = node1;
- v2 = node2;
- }
- else
- {
- v1 = node2;
- v2 = node1;
- }
-
- arc->head = v1;
- arc->tail = v2;
-
- // increase node degree
- //v1->degree++;
- NodeDegreeIncrement(rg, v1);
- //v2->degree++;
- NodeDegreeIncrement(rg, v2);
-
- BLI_edgehash_insert(rg->emap, node1->index, node2->index, edge);
-
- edge->arc = arc;
- edge->nextEdge = NULL;
- edge->v1 = v1;
- edge->v2 = v2;
-
- BLI_addtail(&rg->arcs, arc);
- BLI_addtail(&arc->edges, edge);
-
- /* adding buckets for embedding */
- allocArcBuckets(arc);
-
- offset = arc->head->weight;
- len = arc->tail->weight - arc->head->weight;
-
-#if 0
- /* This is the actual embedding filling described in the paper
- * the problem is that it only works with really dense meshes
- */
- if (arc->bcount > 0)
- {
- addVertToBucket(&(arc->buckets[0]), arc->head->co);
- addVertToBucket(&(arc->buckets[arc->bcount - 1]), arc->tail->co);
- }
-#else
- for(i = 0; i < arc->bcount; i++)
- {
- float co[3];
- float f = (arc->buckets[i].val - offset) / len;
-
- VecLerpf(co, v1->p, v2->p, f);
- addVertToBucket(&(arc->buckets[i]), co);
- }
-#endif
-
- }
-
- return edge;
-}
-
-void addTriangleToGraph(ReebGraph *rg, ReebNode * n1, ReebNode * n2, ReebNode * n3, EditFace *efa)
-{
- ReebEdge *re1, *re2, *re3;
- ReebEdge *e1, *e2, *e3;
- float len1, len2, len3;
-
- re1 = createArc(rg, n1, n2);
- re2 = createArc(rg, n2, n3);
- re3 = createArc(rg, n3, n1);
-
- addFacetoArc(re1->arc, efa);
- addFacetoArc(re2->arc, efa);
- addFacetoArc(re3->arc, efa);
-
- len1 = (float)fabs(n1->weight - n2->weight);
- len2 = (float)fabs(n2->weight - n3->weight);
- len3 = (float)fabs(n3->weight - n1->weight);
-
- /* The rest of the algorithm assumes that e1 is the longest edge */
-
- if (len1 >= len2 && len1 >= len3)
- {
- e1 = re1;
- e2 = re2;
- e3 = re3;
- }
- else if (len2 >= len1 && len2 >= len3)
- {
- e1 = re2;
- e2 = re1;
- e3 = re3;
- }
- else
- {
- e1 = re3;
- e2 = re2;
- e3 = re1;
- }
-
- /* And e2 is the lowest edge
- * If e3 is lower than e2, swap them
- */
- if (e3->v1->weight < e2->v1->weight)
- {
- ReebEdge *etmp = e2;
- e2 = e3;
- e3 = etmp;
- }
-
-
- mergePaths(rg, e1, e2, e3);
-}
-
-ReebGraph * generateReebGraph(EditMesh *em, int subdivisions)
-{
- ReebGraph *rg;
- EditVert *eve;
- EditFace *efa;
- int index;
- int totvert;
- int totfaces;
-
-#ifdef DEBUG_REEB
- int countfaces = 0;
-#endif
-
- rg = newReebGraph();
-
- rg->resolution = subdivisions;
-
- totvert = BLI_countlist(&em->verts);
- totfaces = BLI_countlist(&em->faces);
-
- renormalizeWeight(em, 1.0f);
-
- /* Spread weight to minimize errors */
- spreadWeight(em);
-
- renormalizeWeight(em, (float)rg->resolution);
-
- /* Adding vertice */
- for(index = 0, eve = em->verts.first; eve; eve = eve->next)
- {
- if (eve->h == 0)
- {
- addNode(rg, eve);
- eve->f2 = 0;
- index++;
- }
- }
-
- /* Adding face, edge per edge */
- for(efa = em->faces.first; efa; efa = efa->next)
- {
- if (efa->h == 0)
- {
- ReebNode *n1, *n2, *n3;
-
- n1 = nodeData(efa->v1);
- n2 = nodeData(efa->v2);
- n3 = nodeData(efa->v3);
-
- addTriangleToGraph(rg, n1, n2, n3, efa);
-
- if (efa->v4)
- {
- ReebNode *n4 = nodeData(efa->v4);
- addTriangleToGraph(rg, n1, n3, n4, efa);
- }
-#ifdef DEBUG_REEB
- countfaces++;
- if (countfaces % 100 == 0)
- {
- printf("\rface %i of %i", countfaces, totfaces);
- }
-#endif
- }
- }
-
- printf("\n");
-
- removeZeroNodes(rg);
-
- removeNormalNodes(rg);
-
- return rg;
-}
-
-/***************************************** WEIGHT UTILS **********************************************/
-
-void renormalizeWeight(EditMesh *em, float newmax)
-{
- EditVert *eve;
- float minimum, maximum, range;
-
- if (em == NULL || BLI_countlist(&em->verts) == 0)
- return;
-
- /* First pass, determine maximum and minimum */
- eve = em->verts.first;
- minimum = weightData(eve);
- maximum = minimum;
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- maximum = MAX2(maximum, weightData(eve));
- minimum = MIN2(minimum, weightData(eve));
- }
-
- range = maximum - minimum;
-
- /* Normalize weights */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- float weight = (weightData(eve) - minimum) / range * newmax;
- weightSetData(eve, weight);
- }
-}
-
-
-int weightFromLoc(EditMesh *em, int axis)
-{
- EditVert *eve;
-
- if (em == NULL || BLI_countlist(&em->verts) == 0 || axis < 0 || axis > 2)
- return 0;
-
- /* Copy coordinate in weight */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- weightSetData(eve, eve->co[axis]);
- }
-
- return 1;
-}
-
-static float cotan_weight(float *v1, float *v2, float *v3)
-{
- float a[3], b[3], c[3], clen;
-
- VecSubf(a, v2, v1);
- VecSubf(b, v3, v1);
- Crossf(c, a, b);
-
- clen = VecLength(c);
-
- if (clen == 0.0f)
- return 0.0f;
-
- return Inpf(a, b)/clen;
-}
-
-void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, long e1, long e2, long e3)
-{
- /* Angle opposite e1 */
- float t1= cotan_weight(v1->co, v2->co, v3->co) / e2;
-
- /* Angle opposite e2 */
- float t2 = cotan_weight(v2->co, v3->co, v1->co) / e3;
-
- /* Angle opposite e3 */
- float t3 = cotan_weight(v3->co, v1->co, v2->co) / e1;
-
- int i1 = indexData(v1);
- int i2 = indexData(v2);
- int i3 = indexData(v3);
-
- nlMatrixAdd(i1, i1, t2+t3);
- nlMatrixAdd(i2, i2, t1+t3);
- nlMatrixAdd(i3, i3, t1+t2);
-
- nlMatrixAdd(i1, i2, -t3);
- nlMatrixAdd(i2, i1, -t3);
-
- nlMatrixAdd(i2, i3, -t1);
- nlMatrixAdd(i3, i2, -t1);
-
- nlMatrixAdd(i3, i1, -t2);
- nlMatrixAdd(i1, i3, -t2);
-}
-
-int weightToHarmonic(EditMesh *em, EdgeIndex *indexed_edges)
-{
- NLboolean success;
- EditVert *eve;
- EditEdge *eed;
- EditFace *efa;
- int totvert = 0;
- int index;
- int rval;
-
- /* Find local extrema */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- totvert++;
- }
-
- /* Solve with openNL */
-
- nlNewContext();
-
- nlSolverParameteri(NL_NB_VARIABLES, totvert);
-
- nlBegin(NL_SYSTEM);
-
- /* Find local extrema */
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
- {
- if (eve->h == 0)
- {
- EditEdge *eed;
- int maximum = 1;
- int minimum = 1;
-
- NextEdgeForVert(indexed_edges, -1); /* Reset next edge */
- for(eed = NextEdgeForVert(indexed_edges, index); eed && (maximum || minimum); eed = NextEdgeForVert(indexed_edges, index))
- {
- EditVert *eve2;
-
- if (eed->v1 == eve)
- {
- eve2 = eed->v2;
- }
- else
- {
- eve2 = eed->v1;
- }
-
- if (eve2->h == 0)
- {
- /* Adjacent vertex is bigger, not a local maximum */
- if (weightData(eve2) > weightData(eve))
- {
- maximum = 0;
- }
- /* Adjacent vertex is smaller, not a local minimum */
- else if (weightData(eve2) < weightData(eve))
- {
- minimum = 0;
- }
- }
- }
-
- if (maximum || minimum)
- {
- float w = weightData(eve);
- eve->f1 = 0;
- nlSetVariable(0, index, w);
- nlLockVariable(index);
- }
- else
- {
- eve->f1 = 1;
- }
- }
- }
-
- nlBegin(NL_MATRIX);
-
- /* Zero edge weight */
- for(eed = em->edges.first; eed; eed = eed->next)
- {
- eed->tmp.l = 0;
- }
-
- /* Add faces count to the edge weight */
- for(efa = em->faces.first; efa; efa = efa->next)
- {
- if (efa->h == 0)
- {
- efa->e1->tmp.l++;
- efa->e2->tmp.l++;
- efa->e3->tmp.l++;
-
- if (efa->e4)
- {
- efa->e4->tmp.l++;
- }
- }
- }
-
- /* Add faces angle to the edge weight */
- for(efa = em->faces.first; efa; efa = efa->next)
- {
- if (efa->h == 0)
- {
- if (efa->v4 == NULL)
- {
- addTriangle(efa->v1, efa->v2, efa->v3, efa->e1->tmp.l, efa->e2->tmp.l, efa->e3->tmp.l);
- }
- else
- {
- addTriangle(efa->v1, efa->v2, efa->v3, efa->e1->tmp.l, efa->e2->tmp.l, 2);
- addTriangle(efa->v3, efa->v4, efa->v1, efa->e3->tmp.l, efa->e4->tmp.l, 2);
- }
- }
- }
-
- nlEnd(NL_MATRIX);
-
- nlEnd(NL_SYSTEM);
-
- success = nlSolveAdvanced(NULL, NL_TRUE);
-
- if (success)
- {
- rval = 1;
- for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next)
- {
- weightSetData(eve, nlGetVariable(0, index));
- }
- }
- else
- {
- rval = 0;
- }
-
- nlDeleteContext(nlGetCurrent());
-
- return rval;
-}
-
-
-EditEdge * NextEdgeForVert(EdgeIndex *indexed_edges, int index)
-{
- static int offset = -1;
-
- /* Reset method, call with NULL mesh pointer */
- if (index == -1)
- {
- offset = -1;
- return NULL;
- }
-
- /* first pass, start at the head of the list */
- if (offset == -1)
- {
- offset = indexed_edges->offset[index];
- }
- /* subsequent passes, start on the next edge */
- else
- {
- offset++;
- }
-
- return indexed_edges->edges[offset];
-}
-
-void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeIndex *indexed_edges)
-{
- Heap *edge_heap;
- EditVert *current_eve = NULL;
- EditEdge *eed = NULL;
- EditEdge *select_eed = NULL;
-
- edge_heap = BLI_heap_new();
-
- current_eve = starting_vert;
-
- /* insert guard in heap, when that is returned, no more edges */
- BLI_heap_insert(edge_heap, FLT_MAX, NULL);
-
- /* Initialize edge flag */
- for(eed= em->edges.first; eed; eed= eed->next)
- {
- eed->f1 = 0;
- }
-
- while (BLI_heap_size(edge_heap) > 0)
- {
- float current_weight;
-
- current_eve->f1 = 1; /* mark vertex as selected */
-
- /* Add all new edges connected to current_eve to the list */
- NextEdgeForVert(indexed_edges, -1); // Reset next edge
- for(eed = NextEdgeForVert(indexed_edges, indexData(current_eve)); eed; eed = NextEdgeForVert(indexed_edges, indexData(current_eve)))
- {
- if (eed->f1 == 0)
- {
- BLI_heap_insert(edge_heap, weightData(current_eve) + eed->tmp.fp, eed);
- eed->f1 = 1;
- }
- }
-
- /* Find next shortest edge with unselected verts */
- do
- {
- current_weight = BLI_heap_node_value(BLI_heap_top(edge_heap));
- select_eed = BLI_heap_popmin(edge_heap);
- } while (select_eed != NULL && select_eed->v1->f1 != 0 && select_eed->v2->f1);
-
- if (select_eed != NULL)
- {
- select_eed->f1 = 2;
-
- if (select_eed->v1->f1 == 0) /* v1 is the new vertex */
- {
- current_eve = select_eed->v1;
- }
- else /* otherwise, it's v2 */
- {
- current_eve = select_eed->v2;
- }
-
- weightSetData(current_eve, current_weight);
- }
- }
-
- BLI_heap_free(edge_heap, NULL);
-}
-
-void freeEdgeIndex(EdgeIndex *indexed_edges)
-{
- MEM_freeN(indexed_edges->offset);
- MEM_freeN(indexed_edges->edges);
-}
-
-void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges)
-{
- EditVert *eve;
- EditEdge *eed;
- int totvert = 0;
- int tot_indexed = 0;
- int offset = 0;
-
- totvert = BLI_countlist(&em->verts);
-
- indexed_edges->offset = MEM_callocN(totvert * sizeof(int), "EdgeIndex offset");
-
- for(eed = em->edges.first; eed; eed = eed->next)
- {
- if (eed->v1->h == 0 && eed->v2->h == 0)
- {
- tot_indexed += 2;
- indexed_edges->offset[indexData(eed->v1)]++;
- indexed_edges->offset[indexData(eed->v2)]++;
- }
- }
-
- tot_indexed += totvert;
-
- indexed_edges->edges = MEM_callocN(tot_indexed * sizeof(EditEdge*), "EdgeIndex edges");
-
- /* setting vert offsets */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- if (eve->h == 0)
- {
- int d = indexed_edges->offset[indexData(eve)];
- indexed_edges->offset[indexData(eve)] = offset;
- offset += d + 1;
- }
- }
-
- /* adding edges in array */
- for(eed = em->edges.first; eed; eed= eed->next)
- {
- if (eed->v1->h == 0 && eed->v2->h == 0)
- {
- int i;
- for (i = indexed_edges->offset[indexData(eed->v1)]; i < tot_indexed; i++)
- {
- if (indexed_edges->edges[i] == NULL)
- {
- indexed_edges->edges[i] = eed;
- break;
- }
- }
-
- for (i = indexed_edges->offset[indexData(eed->v2)]; i < tot_indexed; i++)
- {
- if (indexed_edges->edges[i] == NULL)
- {
- indexed_edges->edges[i] = eed;
- break;
- }
- }
- }
- }
-}
-
-int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges)
-{
- EditVert *eve;
- int totedge = 0;
- int totvert = 0;
- int vCount = 0;
-
- totvert = BLI_countlist(&em->verts);
-
- if (em == NULL || totvert == 0)
- {
- return 0;
- }
-
- totedge = BLI_countlist(&em->edges);
-
- if (totedge == 0)
- {
- return 0;
- }
-
- /* Initialize vertice flag and find at least one selected vertex */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- eve->f1 = 0;
- if (eve->f & SELECT)
- {
- vCount = 1;
- }
- }
-
- if (vCount == 0)
- {
- return 0; /* no selected vert, failure */
- }
- else
- {
- EditEdge *eed;
- int allDone = 0;
-
- /* Calculate edge weight */
- for(eed = em->edges.first; eed; eed= eed->next)
- {
- if (eed->v1->h == 0 && eed->v2->h == 0)
- {
- eed->tmp.fp = VecLenf(eed->v1->co, eed->v2->co);
- }
- }
-
- /* Apply dijkstra spf for each selected vert */
- for(eve = em->verts.first; eve; eve = eve->next)
- {
- if (eve->f & SELECT)
- {
- shortestPathsFromVert(em, eve, indexed_edges);
- }
- }
-
- /* connect unselected islands */
- while (allDone == 0)
- {
- EditVert *selected_eve = NULL;
- float selected_weight = 0;
- float min_distance = FLT_MAX;
-
- allDone = 1;
-
- for (eve = em->verts.first; eve; eve = eve->next)
- {
- /* for every vertex visible that hasn't been processed yet */
- if (eve->h == 0 && eve->f1 != 1)
- {
- EditVert *closest_eve;
-
- /* find the closest processed vertex */
- for (closest_eve = em->verts.first; closest_eve; closest_eve = closest_eve->next)
- {
- /* vertex is already processed and distance is smaller than current minimum */
- if (closest_eve->f1 == 1)
- {
- float distance = VecLenf(closest_eve->co, eve->co);
- if (distance < min_distance)
- {
- min_distance = distance;
- selected_eve = eve;
- selected_weight = weightData(closest_eve);
- }
- }
- }
- }
- }
-
- if (selected_eve)
- {
- allDone = 0;
-
- weightSetData(selected_eve, selected_weight + min_distance);
- shortestPathsFromVert(em, selected_eve, indexed_edges);
- }
- }
- }
-
- for(eve = em->verts.first; eve && vCount == 0; eve = eve->next)
- {
- if (eve->f1 == 0)
- {
- printf("vertex not reached\n");
- break;
- }
- }
-
- return 1;
-}
-
-MCol MColFromVal(float val)
-{
- MCol col;
- col.a = 255;
- col.b = (char)(val * 255);
- col.g = 0;
- col.r = (char)((1.0f - val) * 255);
- return col;
-}
-
-void weightToVCol(EditMesh *em, int index)
-{
- EditFace *efa;
- MCol *mcol;
- if (!EM_vertColorCheck()) {
- return;
- }
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- mcol = CustomData_em_get_n(&em->fdata, efa->data, CD_MCOL, index);
-
- if (mcol)
- {
- mcol[0] = MColFromVal(weightData(efa->v1));
- mcol[1] = MColFromVal(weightData(efa->v2));
- mcol[2] = MColFromVal(weightData(efa->v3));
-
- if(efa->v4) {
- mcol[3] = MColFromVal(weightData(efa->v4));
- }
- }
- }
-}
-
-void angleToVCol(EditMesh *em, int index)
-{
- EditFace *efa;
- MCol *mcol;
-
- if (!EM_vertColorCheck()) {
- return;
- }
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- MCol col;
- if (efa->tmp.fp > 0)
- {
- col = MColFromVal(efa->tmp.fp / (M_PI / 2 + 0.1));
- }
- else
- {
- col.a = 255;
- col.r = 0;
- col.g = 255;
- col.b = 0;
- }
-
- mcol = CustomData_em_get_n(&em->fdata, efa->data, CD_MCOL, index);
-
- if (mcol)
- {
- mcol[0] = col;
- mcol[1] = col;
- mcol[2] = col;
-
- if(efa->v4) {
- mcol[3] = col;
- }
- }
- }
-}
-
-void blendColor(MCol *dst, MCol *src)
-{
-#if 1
- float blend_src = (float)src->a / (float)(src->a + dst->a);
- float blend_dst = (float)dst->a / (float)(src->a + dst->a);
- dst->a += src->a;
- dst->r = (char)(dst->r * blend_dst + src->r * blend_src);
- dst->g = (char)(dst->g * blend_dst + src->g * blend_src);
- dst->b = (char)(dst->b * blend_dst + src->b * blend_src);
-#else
- dst->r = src->r;
- dst->g = src->g;
- dst->b = src->b;
-#endif
-}
-
-void arcToVCol(ReebGraph *rg, EditMesh *em, int index)
-{
- GHashIterator ghi;
- EditFace *efa;
- ReebArc *arc;
- MCol *mcol;
- MCol col;
- int total = BLI_countlist(&rg->arcs);
- int i = 0;
-
- if (!EM_vertColorCheck()) {
- return;
- }
-
- col.a = 0;
-
- col.r = 0;
- col.g = 0;
- col.b = 0;
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- mcol = CustomData_em_get_n(&em->fdata, efa->data, CD_MCOL, index);
-
- if (mcol)
- {
- mcol[0] = col;
- mcol[1] = col;
- mcol[2] = col;
-
- if(efa->v4) {
- mcol[3] = col;
- }
- }
- }
-
- for (arc = rg->arcs.first; arc; arc = arc->next, i++)
- {
- float r,g,b;
- col.a = 1;
-
- hsv_to_rgb((float)i / (float)total, 1, 1, &r, &g, &b);
-
- col.r = FTOCHAR(r);
- col.g = FTOCHAR(g);
- col.b = FTOCHAR(b);
-
- for(BLI_ghashIterator_init(&ghi, arc->faces);
- !BLI_ghashIterator_isDone(&ghi);
- BLI_ghashIterator_step(&ghi))
- {
- efa = BLI_ghashIterator_getValue(&ghi);
-
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
-
- blendColor(&mcol[0], &col);
- blendColor(&mcol[1], &col);
- blendColor(&mcol[2], &col);
-
- if(efa->v4) {
- blendColor(&mcol[3], &col);
- }
- }
- }
-
- for(efa=em->faces.first; efa; efa=efa->next) {
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
-
- mcol[0].a = 255;
- mcol[1].a = 255;
- mcol[2].a = 255;
-
- if(efa->v4) {
- mcol[3].a = 255;
- }
- }
-}
-
-/****************************************** BUCKET ITERATOR **************************************************/
-
-void initArcIterator(ReebArcIterator *iter, ReebArc *arc, ReebNode *head)
-{
- iter->arc = arc;
-
- if (head == arc->head)
- {
- iter->start = 0;
- iter->end = arc->bcount - 1;
- iter->stride = 1;
- }
- else
- {
- iter->start = arc->bcount - 1;
- iter->end = 0;
- iter->stride = -1;
- }
-
- iter->length = arc->bcount;
-
- iter->index = iter->start - iter->stride;
-}
-
-void initArcIteratorStart(struct ReebArcIterator *iter, struct ReebArc *arc, struct ReebNode *head, int start)
-{
- iter->arc = arc;
-
- if (head == arc->head)
- {
- iter->start = start;
- iter->end = arc->bcount - 1;
- iter->stride = 1;
- }
- else
- {
- iter->start = arc->bcount - 1 - start;
- iter->end = 0;
- iter->stride = -1;
- }
-
- iter->index = iter->start - iter->stride;
-
- iter->length = arc->bcount - start;
-
- if (start >= arc->bcount)
- {
- iter->start = iter->end; /* stop iterator since it's past its end */
- }
-}
-
-void initArcIterator2(ReebArcIterator *iter, ReebArc *arc, int start, int end)
-{
- iter->arc = arc;
-
- iter->start = start;
- iter->end = end;
-
- if (end > start)
- {
- iter->stride = 1;
- }
- else
- {
- iter->stride = -1;
- }
-
- iter->index = iter->start - iter->stride;
-
- iter->length = abs(iter->end - iter->start) + 1;
-}
-
-EmbedBucket * nextBucket(ReebArcIterator *iter)
-{
- EmbedBucket *result = NULL;
-
- if (iter->index != iter->end)
- {
- iter->index += iter->stride;
- result = &(iter->arc->buckets[iter->index]);
- }
-
- return result;
-}
-
-EmbedBucket * nextNBucket(ReebArcIterator *iter, int n)
-{
- EmbedBucket *result = NULL;
-
- iter->index += n * iter->stride;
-
- /* check if passed end */
- if ((iter->stride == 1 && iter->index <= iter->end) ||
- (iter->stride == -1 && iter->index >= iter->end))
- {
- result = &(iter->arc->buckets[iter->index]);
- }
- else
- {
- /* stop iterator if passed end */
- iter->index = iter->end;
- }
-
- return result;
-}
-
-EmbedBucket * peekBucket(ReebArcIterator *iter, int n)
-{
- EmbedBucket *result = NULL;
- int index = iter->index + n * iter->stride;
-
- /* check if passed end */
- if ((iter->stride == 1 && index <= iter->end && index >= iter->start) ||
- (iter->stride == -1 && index >= iter->end && index <= iter->start))
- {
- result = &(iter->arc->buckets[index]);
- }
-
- return result;
-}
-
-EmbedBucket * previousBucket(struct ReebArcIterator *iter)
-{
- EmbedBucket *result = NULL;
-
- if (iter->index != iter->start)
- {
- iter->index -= iter->stride;
- result = &(iter->arc->buckets[iter->index]);
- }
-
- return result;
-}
-
-int iteratorStopped(struct ReebArcIterator *iter)
-{
- if (iter->index == iter->end)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-struct EmbedBucket * currentBucket(struct ReebArcIterator *iter)
-{
- EmbedBucket *result = NULL;
-
- if (iter->index != iter->end)
- {
- result = &(iter->arc->buckets[iter->index]);
- }
-
- return result;
-}
-
-/************************ PUBLIC FUNCTIONS *********************************************/
-
-ReebGraph *BIF_ReebGraphMultiFromEditMesh(void)
-{
- EditMesh *em = G.editMesh;
- EdgeIndex indexed_edges;
- VertexData *data;
- ReebGraph *rg = NULL;
- ReebGraph *rgi, *previous;
- int i, nb_levels = REEB_MAX_MULTI_LEVEL;
-
- if (em == NULL)
- return NULL;
-
- data = allocVertexData(em);
-
- buildIndexedEdges(em, &indexed_edges);
-
- if (weightFromDistance(em, &indexed_edges) == 0)
- {
- error("No selected vertex\n");
- freeEdgeIndex(&indexed_edges);
- return NULL;
- }
-
- renormalizeWeight(em, 1.0f);
-
- if (G.scene->toolsettings->skgen_options & SKGEN_HARMONIC)
- {
- weightToHarmonic(em, &indexed_edges);
- }
-
- freeEdgeIndex(&indexed_edges);
-
-#ifdef DEBUG_REEB
- weightToVCol(em, 0);
-#endif
-
- rg = generateReebGraph(em, G.scene->toolsettings->skgen_resolution);
-
- /* Remove arcs without embedding */
- filterNullReebGraph(rg);
-
- /* smart filter and loop filter on basic level */
- filterGraph(rg, SKGEN_FILTER_SMART, 0, 0);
-
- repositionNodes(rg);
-
- /* Filtering might have created degree 2 nodes, so remove them */
- removeNormalNodes(rg);
-
- joinSubgraphs(rg, 1.0);
-
- BLI_buildAdjacencyList((BGraph*)rg);
-
- /* calc length before copy, so we have same length on all levels */
- BLI_calcGraphLength((BGraph*)rg);
-
- previous = NULL;
- for (i = 0; i <= nb_levels; i++)
- {
- rgi = rg;
-
- /* don't filter last level */
- if (i > 0)
- {
- float internal_threshold;
- float external_threshold;
-
- /* filter internal progressively in second half only*/
- if (i > nb_levels / 2)
- {
- internal_threshold = rg->length * G.scene->toolsettings->skgen_threshold_internal;
- }
- else
- {
- internal_threshold = rg->length * G.scene->toolsettings->skgen_threshold_internal * (2 * i / (float)nb_levels);
- }
-
- external_threshold = rg->length * G.scene->toolsettings->skgen_threshold_external * (i / (float)nb_levels);
-
- filterGraph(rgi, G.scene->toolsettings->skgen_options, internal_threshold, external_threshold);
- }
-
- if (i < nb_levels)
- {
- rg = copyReebGraph(rgi, i + 1);
- }
-
- finalizeGraph(rgi, G.scene->toolsettings->skgen_postpro_passes, G.scene->toolsettings->skgen_postpro);
-
- BLI_markdownSymmetry((BGraph*)rgi, rgi->nodes.first, G.scene->toolsettings->skgen_symmetry_limit);
-
- if (previous != NULL)
- {
- relinkNodes(rgi, previous);
- }
- previous = rgi;
- }
-
- verifyMultiResolutionLinks(rg, 0);
-
- MEM_freeN(data);
-
- return rg;
-}
-
-ReebGraph *BIF_ReebGraphFromEditMesh(void)
-{
- EditMesh *em = G.editMesh;
- EdgeIndex indexed_edges;
- VertexData *data;
- ReebGraph *rg = NULL;
-
- if (em == NULL)
- return NULL;
-
- data = allocVertexData(em);
-
- buildIndexedEdges(em, &indexed_edges);
-
- if (weightFromDistance(em, &indexed_edges) == 0)
- {
- error("No selected vertex\n");
- freeEdgeIndex(&indexed_edges);
- freeEdgeIndex(&indexed_edges);
- return NULL;
- }
-
- renormalizeWeight(em, 1.0f);
-
- if (G.scene->toolsettings->skgen_options & SKGEN_HARMONIC)
- {
- weightToHarmonic(em, &indexed_edges);
- }
-
- freeEdgeIndex(&indexed_edges);
-
-#ifdef DEBUG_REEB
- weightToVCol(em, 1);
-#endif
-
- rg = generateReebGraph(em, G.scene->toolsettings->skgen_resolution);
-
- REEB_exportGraph(rg, -1);
-
- printf("GENERATED\n");
- printf("%i subgraphs\n", BLI_FlagSubgraphs((BGraph*)rg));
-
- /* Remove arcs without embedding */
- filterNullReebGraph(rg);
-
- BLI_freeAdjacencyList((BGraph*)rg);
-
- printf("NULL FILTERED\n");
- printf("%i subgraphs\n", BLI_FlagSubgraphs((BGraph*)rg));
-
- filterGraph(rg, G.scene->toolsettings->skgen_options, G.scene->toolsettings->skgen_threshold_internal, G.scene->toolsettings->skgen_threshold_external);
-
- finalizeGraph(rg, G.scene->toolsettings->skgen_postpro_passes, G.scene->toolsettings->skgen_postpro);
-
- REEB_exportGraph(rg, -1);
-
-#ifdef DEBUG_REEB
- arcToVCol(rg, em, 0);
- //angleToVCol(em, 1);
-#endif
-
- printf("DONE\n");
- printf("%i subgraphs\n", BLI_FlagSubgraphs((BGraph*)rg));
-
- MEM_freeN(data);
-
- return rg;
-}
-
-void BIF_GlobalReebFree()
-{
- if (GLOBAL_RG != NULL)
- {
- REEB_freeGraph(GLOBAL_RG);
- GLOBAL_RG = NULL;
- }
-}
-
-void BIF_GlobalReebGraphFromEditMesh(void)
-{
- ReebGraph *rg;
-
- BIF_GlobalReebFree();
-
- rg = BIF_ReebGraphMultiFromEditMesh();
-
- GLOBAL_RG = rg;
-}
-
-void REEB_draw()
-{
- ReebGraph *rg;
- ReebArc *arc;
- int i = 0;
-
- if (GLOBAL_RG == NULL)
- {
- return;
- }
-
- if (GLOBAL_RG->link_up && G.scene->toolsettings->skgen_options & SKGEN_DISP_ORIG)
- {
- for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up) ;
- }
- else
- {
- i = G.scene->toolsettings->skgen_multi_level;
-
- for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up) ;
- }
-
- glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- glDisable(GL_DEPTH_TEST);
- for (arc = rg->arcs.first; arc; arc = arc->next, i++)
- {
- ReebArcIterator iter;
- EmbedBucket *bucket;
- float vec[3];
- char text[128];
- char *s = text;
-
- glLineWidth(BIF_GetThemeValuef(TH_VERTEX_SIZE) + 2);
- glColor3f(0, 0, 0);
- glBegin(GL_LINE_STRIP);
- glVertex3fv(arc->head->p);
-
- if (arc->bcount)
- {
- initArcIterator(&iter, arc, arc->head);
- for (bucket = nextBucket(&iter); bucket; bucket = nextBucket(&iter))
- {
- glVertex3fv(bucket->p);
- }
- }
-
- glVertex3fv(arc->tail->p);
- glEnd();
-
- glLineWidth(BIF_GetThemeValuef(TH_VERTEX_SIZE));
-
- if (arc->symmetry_level == 1)
- {
- glColor3f(1, 0, 0);
- }
- else if (arc->symmetry_flag == SYM_SIDE_POSITIVE || arc->symmetry_flag == SYM_SIDE_NEGATIVE)
- {
- glColor3f(1, 0.5f, 0);
- }
- else if (arc->symmetry_flag >= SYM_SIDE_RADIAL)
- {
- glColor3f(0.5f, 1, 0);
- }
- else
- {
- glColor3f(1, 1, 0);
- }
- glBegin(GL_LINE_STRIP);
- glVertex3fv(arc->head->p);
-
- if (arc->bcount)
- {
- initArcIterator(&iter, arc, arc->head);
- for (bucket = nextBucket(&iter); bucket; bucket = nextBucket(&iter))
- {
- glVertex3fv(bucket->p);
- }
- }
-
- glVertex3fv(arc->tail->p);
- glEnd();
-
-
- if (G.scene->toolsettings->skgen_options & SKGEN_DISP_EMBED)
- {
- glColor3f(1, 1, 1);
- glBegin(GL_POINTS);
- glVertex3fv(arc->head->p);
- glVertex3fv(arc->tail->p);
-
- glColor3f(0.5f, 0.5f, 1);
- if (arc->bcount)
- {
- initArcIterator(&iter, arc, arc->head);
- for (bucket = nextBucket(&iter); bucket; bucket = nextBucket(&iter))
- {
- glVertex3fv(bucket->p);
- }
- }
- glEnd();
- }
-
- if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX)
- {
- VecLerpf(vec, arc->head->p, arc->tail->p, 0.5f);
- s += sprintf(s, "%i (%i-%i-%i) ", i, arc->symmetry_level, arc->symmetry_flag, arc->symmetry_group);
-
- if (G.scene->toolsettings->skgen_options & SKGEN_DISP_WEIGHT)
- {
- s += sprintf(s, "w:%0.3f ", arc->tail->weight - arc->head->weight);
- }
-
- if (G.scene->toolsettings->skgen_options & SKGEN_DISP_LENGTH)
- {
- s += sprintf(s, "l:%0.3f", arc->length);
- }
-
- glColor3f(0, 1, 0);
- glRasterPos3fv(vec);
- BMF_DrawString( G.fonts, text);
- }
-
- if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX)
- {
- sprintf(text, " %i", arc->head->index);
- glRasterPos3fv(arc->head->p);
- BMF_DrawString( G.fonts, text);
-
- sprintf(text, " %i", arc->tail->index);
- glRasterPos3fv(arc->tail->p);
- BMF_DrawString( G.fonts, text);
- }
- }
- glEnable(GL_DEPTH_TEST);
-
- glLineWidth(1.0);
- glPointSize(1.0);
-}
diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c
deleted file mode 100644
index bbac70e9e5e..00000000000
--- a/source/blender/src/renderwin.c
+++ /dev/null
@@ -1,1556 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WIN32
-/* for the multimedia timer */
-#include <windows.h>
-#include <mmsystem.h>
-#endif
-
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#else
- /* for signal callback, not (fully) supported at windows */
-#include <sys/time.h>
-#include <signal.h>
-
-#endif
-
-#include <limits.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_threads.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-
-#include "DNA_image_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_vec_types.h"
-
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-#include "BKE_writeavi.h" /* movie handle */
-
-#include "BIF_drawimage.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_graphics.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_mywindow.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_writeimage.h"
-
-#include "BDR_sculptmode.h"
-#include "BDR_editobject.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h" /* for BPY_do_all_scripts */
-#endif
-
-#include "BSE_view.h"
-#include "BSE_drawview.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-
-#include "RE_pipeline.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "GPU_draw.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-#include "winlay.h"
-
-/* ------------ renderwin struct, to prevent too much global vars --------- */
-/* ------------ only used for display in a 2nd window --------- */
-
-
-/* flags escape presses during event handling
-* so we can test for user break later.
-*/
-#define RW_FLAGS_ESCAPE (1<<0)
-/* old zoom style (2x, locked to mouse, exits
-* when mouse leaves window), to be removed
-* at some point.
-*/
-#define RW_FLAGS_OLDZOOM (1<<1)
-/* on when image is being panned with middlemouse
-*/
-#define RW_FLAGS_PANNING (1<<2)
-/* on when the mouse is dragging over the image
-* to examine pixel values.
-*/
-#define RW_FLAGS_PIXEL_EXAMINING (1<<3)
-
-/* forces draw of alpha */
-#define RW_FLAGS_ALPHA (1<<4)
-
-
-typedef struct {
- Window *win;
-
- int rectx, recty; /* size of image */
-
- float zoom, zoomofs[2];
- int active;
-
- int mbut[5];
- int lmouse[2];
-
- unsigned int flags;
-
- float pan_mouse_start[2], pan_ofs_start[2];
-
- char *info_text;
-
-} RenderWin;
-
-typedef struct RenderSpare {
- ImBuf *ibuf;
-
- short storespare, showspare;
- char *render_text_spare;
-} RenderSpare;
-
-static RenderWin *render_win= NULL;
-static RenderSpare *render_spare= NULL;
-static char *render_text= NULL;
-
-/* --------------- help functions for RenderWin struct ---------------------------- */
-
-static RenderSpare *renderspare_alloc()
-{
- RenderSpare *rspare= MEM_callocN(sizeof(*rspare), "RenderSpare");
- rspare->render_text_spare= MEM_callocN(RW_MAXTEXT, "rendertext spare");
-
- return rspare;
-}
-
-/* only called in function open_renderwin */
-static RenderWin *renderwin_alloc(Window *win)
-{
- RenderWin *rw= MEM_callocN(sizeof(*rw), "RenderWin");
- rw->win= win;
- rw->zoom= 1.0;
- rw->active= 0;
- rw->flags= 0;
- rw->zoomofs[0]= rw->zoomofs[1]= 0;
- rw->info_text= NULL;
-
- rw->lmouse[0]= rw->lmouse[1]= 0;
- rw->mbut[0]= rw->mbut[1]= rw->mbut[2]= rw->mbut[3] = rw->mbut[4] = 0;
-
- return rw;
-}
-
-
-static void renderwin_queue_redraw(RenderWin *rw)
-{
- window_queue_redraw(rw->win); // to ghost
-}
-
-static void renderwin_reshape(RenderWin *rw)
-{
- ;
-}
-
-static void renderwin_get_fullrect(RenderWin *rw, float fullrect_r[2][2])
-{
- float display_w, display_h;
- float cent_x, cent_y;
- int w, h;
-
- window_get_size(rw->win, &w, &h);
- h-= RW_HEADERY;
-
- display_w= rw->rectx*rw->zoom;
- display_h= rw->recty*rw->zoom;
- cent_x= (rw->zoomofs[0] + rw->rectx/2)*rw->zoom;
- cent_y= (rw->zoomofs[1] + rw->recty/2)*rw->zoom;
-
- fullrect_r[0][0]= w/2 - cent_x;
- fullrect_r[0][1]= h/2 - cent_y;
- fullrect_r[1][0]= fullrect_r[0][0] + display_w;
- fullrect_r[1][1]= fullrect_r[0][1] + display_h;
-}
-
- /**
- * Project window coordinate to image pixel coordinate.
- * Returns true if resulting coordinate is within image.
- */
-static int renderwin_win_to_image_co(RenderWin *rw, int winco[2], int imgco_r[2])
-{
- float fullrect[2][2];
-
- renderwin_get_fullrect(rw, fullrect);
-
- imgco_r[0]= (int) ((winco[0]-fullrect[0][0])/rw->zoom);
- imgco_r[1]= (int) ((winco[1]-fullrect[0][1])/rw->zoom);
-
- return (imgco_r[0]>=0 && imgco_r[1]>=0 && imgco_r[0]<rw->rectx && imgco_r[1]<rw->recty);
-}
-
- /**
- * Project window coordinates to normalized device coordinates
- * Returns true if resulting coordinate is within window.
- */
-static int renderwin_win_to_ndc(RenderWin *rw, int win_co[2], float ndc_r[2])
-{
- int w, h;
-
- window_get_size(rw->win, &w, &h);
- h-= RW_HEADERY;
-
- ndc_r[0]= ((float)(win_co[0]*2)/(w-1) - 1.0f);
- ndc_r[1]= ((float)(win_co[1]*2)/(h-1) - 1.0f);
-
- return (fabs(ndc_r[0])<=1.0 && fabs(ndc_r[1])<=1.0);
-}
-
-static void renderwin_set_infotext(RenderWin *rw, char *info_text)
-{
- if (rw->info_text) MEM_freeN(rw->info_text);
- rw->info_text= info_text?BLI_strdup(info_text):NULL;
-}
-
-static void renderwin_reset_view(RenderWin *rw)
-{
- int w, h;
-
- if (rw->info_text) renderwin_set_infotext(rw, NULL);
-
- /* now calculate a zoom for when image is larger than window */
- window_get_size(rw->win, &w, &h);
- h-= RW_HEADERY;
-
- if(rw->rectx>w || rw->recty>h) {
- if(rw->rectx-w > rw->recty-h) rw->zoom= ((float)w)/((float)rw->rectx);
- else rw->zoom= ((float)h)/((float)rw->recty);
- }
- else rw->zoom= 1.0;
-
- rw->zoomofs[0]= rw->zoomofs[1]= 0;
- renderwin_queue_redraw(rw);
-}
-
-static void renderwin_draw_render_info(RenderWin *rw)
-{
- /* render text is added to top */
- if(RW_HEADERY) {
- float colf[3];
- rcti rect;
- char *str;
-
- window_get_size(rw->win, &rect.xmax, &rect.ymax);
- rect.xmin= 0;
- rect.ymin= rect.ymax-RW_HEADERY;
- glEnable(GL_SCISSOR_TEST);
- glaDefine2DArea(&rect);
-
- /* clear header rect */
- BIF_SetTheme(NULL); // sets view3d theme by default
- BIF_GetThemeColor3fv(TH_HEADER, colf);
- glClearColor(colf[0], colf[1], colf[2], 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- str= BIF_render_text();
-
- if(str) {
- BIF_ThemeColor(TH_TEXT);
- glRasterPos2i(12, 5);
- BMF_DrawString(G.fonts, str);
- }
-
- BIF_SetTheme(curarea); // restore theme
- }
-
-}
-
-static void renderwin_draw(RenderWin *rw, int just_clear)
-{
- Image *ima;
- ImBuf *ibuf;
- float fullrect[2][2];
- int set_back_mainwindow;
- rcti rect;
-
- /* since renderwin uses callbacks (controlled by ghost) it can
- mess up active window output with redraw events after a render.
- this is patchy, still WIP */
- set_back_mainwindow = (winlay_get_active_window() != rw->win);
- window_make_active(rw->win);
-
- rect.xmin= rect.ymin= 0;
- window_get_size(rw->win, &rect.xmax, &rect.ymax);
- rect.ymax-= RW_HEADERY;
-
- renderwin_get_fullrect(rw, fullrect);
-
- /* do this first, so window ends with correct scissor */
- renderwin_draw_render_info(rw);
-
- glEnable(GL_SCISSOR_TEST);
- glaDefine2DArea(&rect);
-
- glClearColor(.1875, .1875, .1875, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- if (just_clear) {
- glColor3ub(0, 0, 0);
- glRectfv(fullrect[0], fullrect[1]);
- } else {
- RenderSpare *rspare= render_spare;
-
- if(rspare && rspare->showspare) {
- ibuf= rspare->ibuf;
- }
- else {
- ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
- ibuf= BKE_image_get_ibuf(ima, NULL);
- }
-
- if(ibuf) {
- if(!ibuf->rect)
- IMB_rect_from_float(ibuf);
-
- glPixelZoom(rw->zoom, rw->zoom);
- if(rw->flags & RW_FLAGS_ALPHA) {
- if(ibuf->rect) {
- /* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- if(G.order==B_ENDIAN)
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
- glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ibuf->rect);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
- }
- else {
- float *trectf= MEM_mallocN(ibuf->x*ibuf->y*4, "temp");
- int a, b;
-
- for(a= ibuf->x*ibuf->y -1, b= 4*a+3; a>=0; a--, b-=4)
- trectf[a]= ibuf->rect_float[b];
-
- glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_FLOAT, trectf);
- MEM_freeN(trectf);
- }
- }
- else {
- if(ibuf->rect)
- glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- else if(ibuf->rect_float)
- glaDrawPixelsSafe_to32(fullrect[0][0], fullrect[0][1], ibuf->x, ibuf->y, ibuf->x, ibuf->rect_float);
- }
- glPixelZoom(1.0, 1.0);
- }
- }
-
- /* info text is overlayed on bottom */
- if (rw->info_text) {
- float w;
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
- w=186.0*strlen(rw->info_text)/30;
- glColor4f(.5,.5,.5,.25);
- glRectf(0.0,0.0,w,30.0);
- glDisable(GL_BLEND);
- glColor3ub(255, 255, 255);
- glRasterPos2i(10, 10);
- BMF_DrawString(G.font, rw->info_text);
- }
-
- window_swap_buffers(rw->win);
-
- if (set_back_mainwindow) mainwindow_make_active();
-}
-
-
-/* ------ interactivity calls for RenderWin ------------- */
-static void renderwin_zoom(RenderWin *rw, int ZoomIn) {
- if (ZoomIn) {
- if (rw->zoom>0.26) {
- if(rw->zoom>1.0 && rw->zoom<2.0) rw->zoom= 1.0;
- else rw->zoom*= 0.5;
- }
- } else {
- if (rw->zoom<15.9) {
- if(rw->zoom>0.5 && rw->zoom<1.0) rw->zoom= 1.0;
- else rw->zoom*= 2.0;
- }
- }
- if (rw->zoom>1.0) rw->flags |= RW_FLAGS_OLDZOOM;
- if (rw->zoom==1.0) rw->flags &= ~RW_FLAGS_OLDZOOM;
- renderwin_queue_redraw(rw);
-}
-
-
-static void renderwin_mouse_moved(RenderWin *rw)
-{
- Image *ima;
- ImBuf *ibuf;
- RenderSpare *rspare= render_spare;
-
- if(rspare && rspare->showspare) {
- ibuf= rspare->ibuf;
- }
- else {
- ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
- ibuf= BKE_image_get_ibuf(ima, NULL);
- }
-
- if(!ibuf)
- return;
-
- if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) {
- int imgco[2], ofs=0;
- char buf[128];
- char *pxl;
-
- if (renderwin_win_to_image_co(rw, rw->lmouse, imgco)) {
- ofs= sprintf(buf, "X: %d Y: %d ", imgco[0], imgco[1]);
- if (ibuf->rect) {
- pxl= (char*) &ibuf->rect[ibuf->x*imgco[1] + imgco[0]];
- ofs+= sprintf(buf+ofs, " | R: %d G: %d B: %d A: %d", pxl[0], pxl[1], pxl[2], pxl[3]);
- }
- if (ibuf->rect_float) {
- float *pxlf= ibuf->rect_float + 4*(ibuf->x*imgco[1] + imgco[0]);
- if(!ibuf->rect) {
- ofs+= sprintf(buf+ofs, " | R: %d G: %d B: %d A: %d", FTOCHAR(pxlf[0]), FTOCHAR(pxlf[1]), FTOCHAR(pxlf[2]), FTOCHAR(pxlf[3]));
- }
- ofs+= sprintf(buf+ofs, " | R: %.3f G: %.3f B: %.3f A: %.3f ", pxlf[0], pxlf[1], pxlf[2], pxlf[3]);
- }
- if (ibuf->zbuf_float) {
- float *pxlz= &ibuf->zbuf_float[ibuf->x*imgco[1] + imgco[0]];
- sprintf(buf+ofs, "| Z: %.3f", *pxlz );
- }
-
- renderwin_set_infotext(rw, buf);
- renderwin_queue_redraw(rw);
- } else {
- renderwin_set_infotext(rw, NULL);
- renderwin_queue_redraw(rw);
- }
- }
- else if (rw->flags & RW_FLAGS_PANNING) {
- int delta_x= rw->lmouse[0] - rw->pan_mouse_start[0];
- int delta_y= rw->lmouse[1] - rw->pan_mouse_start[1];
-
- rw->zoomofs[0]= rw->pan_ofs_start[0] - delta_x/rw->zoom;
- rw->zoomofs[1]= rw->pan_ofs_start[1] - delta_y/rw->zoom;
- rw->zoomofs[0]= CLAMPIS(rw->zoomofs[0], -ibuf->x/2, ibuf->x/2);
- rw->zoomofs[1]= CLAMPIS(rw->zoomofs[1], -ibuf->y/2, ibuf->y/2);
-
- renderwin_queue_redraw(rw);
- }
- else if (rw->flags & RW_FLAGS_OLDZOOM) {
- float ndc[2];
- int w, h;
-
- window_get_size(rw->win, &w, &h);
- h-= RW_HEADERY;
- renderwin_win_to_ndc(rw, rw->lmouse, ndc);
-
- rw->zoomofs[0]= -0.5*ndc[0]*(w-ibuf->x*rw->zoom)/rw->zoom;
- rw->zoomofs[1]= -0.5*ndc[1]*(h-ibuf->y*rw->zoom)/rw->zoom;
-
- renderwin_queue_redraw(rw);
- }
-}
-
-static void renderwin_mousebut_changed(RenderWin *rw)
-{
- if (rw->mbut[0]) {
- rw->flags|= RW_FLAGS_PIXEL_EXAMINING;
- }
- else if (rw->mbut[1]) {
- rw->flags|= RW_FLAGS_PANNING;
- rw->pan_mouse_start[0]= rw->lmouse[0];
- rw->pan_mouse_start[1]= rw->lmouse[1];
- rw->pan_ofs_start[0]= rw->zoomofs[0];
- rw->pan_ofs_start[1]= rw->zoomofs[1];
- } else if (rw->mbut[3]) {
- renderwin_zoom(rw, 0);
- rw->mbut[3]=0;
- } else if (rw->mbut[4]) {
- renderwin_zoom(rw, 1);
- rw->mbut[4]=0;
- } else {
- if (rw->flags & RW_FLAGS_PANNING) {
- rw->flags &= ~RW_FLAGS_PANNING;
- renderwin_queue_redraw(rw);
- }
- if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) {
- rw->flags&= ~RW_FLAGS_PIXEL_EXAMINING;
- renderwin_set_infotext(rw, NULL);
- renderwin_queue_redraw(rw);
- }
- }
-}
-
-
-/* handler for renderwin, passed on to Ghost */
-static void renderwin_handler(Window *win, void *user_data, short evt, short val, char ascii)
-{
- RenderWin *rw= user_data;
-
- // added this for safety, while render it's just creating bezerk results
- if(G.rendering) {
- if(evt==ESCKEY && val)
- rw->flags|= RW_FLAGS_ESCAPE;
- return;
- }
-
- if (evt==RESHAPE) {
- renderwin_reshape(rw);
- }
- else if (evt==REDRAW) {
- renderwin_draw(rw, 0);
- }
- else if (evt==WINCLOSE) {
- BIF_close_render_display();
- }
- else if (evt==INPUTCHANGE) {
- rw->active= val;
-
- if (!val && (rw->flags&RW_FLAGS_OLDZOOM)) {
- rw->flags&= ~RW_FLAGS_OLDZOOM;
- renderwin_reset_view(rw);
- }
- }
- else if (ELEM(evt, MOUSEX, MOUSEY)) {
- rw->lmouse[evt==MOUSEY]= val;
- renderwin_mouse_moved(rw);
- }
- else if (ELEM(evt, WHEELUPMOUSE, WHEELDOWNMOUSE)) {
- int which=(evt==WHEELUPMOUSE?3:4);
- rw->mbut[which]=val;
- renderwin_mousebut_changed(rw);
- }
- else if (ELEM3(evt, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
- int which= (evt==LEFTMOUSE)?0:(evt==MIDDLEMOUSE)?1:2;
- rw->mbut[which]= val;
- renderwin_mousebut_changed(rw);
- }
- else if (val) {
- if (evt==ESCKEY) {
- if (rw->flags&RW_FLAGS_OLDZOOM) {
- rw->flags&= ~RW_FLAGS_OLDZOOM;
- renderwin_reset_view(rw);
- }
- else {
- rw->flags|= RW_FLAGS_ESCAPE;
- mainwindow_raise();
- mainwindow_make_active();
- rw->active= 0;
- }
- }
- else if( evt==AKEY) {
- rw->flags ^= RW_FLAGS_ALPHA;
- renderwin_queue_redraw(render_win);
- }
- else if (evt==JKEY) {
- if(G.rendering==0) BIF_swap_render_rects();
- }
- else if (evt==ZKEY) {
- if (rw->flags&RW_FLAGS_OLDZOOM) {
- rw->flags&= ~RW_FLAGS_OLDZOOM;
- renderwin_reset_view(rw);
- } else {
- rw->zoom= 2.0;
- rw->flags|= RW_FLAGS_OLDZOOM;
- renderwin_mouse_moved(rw);
- }
- }
- else if (ELEM(evt,PADPLUSKEY,PAGEUPKEY)) {
- renderwin_zoom(rw, 0);
- }
- else if (ELEM(evt,PADMINUS,PAGEDOWNKEY)) {
- renderwin_zoom(rw, 1);
- }
- else if (evt==PADENTER || evt==HOMEKEY) {
- if (rw->flags&RW_FLAGS_OLDZOOM) {
- rw->flags&= ~RW_FLAGS_OLDZOOM;
- }
- renderwin_reset_view(rw);
- }
- else if (evt==F3KEY) {
- if(G.rendering==0) {
- mainwindow_raise();
- mainwindow_make_active();
- rw->active= 0;
- areawinset(find_biggest_area()->win);
- BIF_save_rendered_image_fs();
- }
- }
- else if (evt==F11KEY) {
- BIF_toggle_render_display();
- }
- else if (evt==F12KEY) {
- if(G.rendering==0)
- BIF_do_render(0);
- }
- }
-}
-
-static char *renderwin_get_title()
-{
- char *title="";
-
- if(BIF_show_render_spare()) {
- if (G.scene->r.renderer==R_YAFRAY) title = "YafRay:Render (previous)";
- else title = "Blender:Render (previous)";
- }
- else {
- if (G.scene->r.renderer==R_YAFRAY) title = "YafRay:Render";
- else title = "Blender:Render";
- }
-
- return title;
-}
-
-/* opens window and allocs struct */
-static void open_renderwin(int winpos[2], int winsize[2], int imagesize[2])
-{
- extern void mywindow_build_and_set_renderwin( int orx, int ory, int sizex, int sizey); // mywindow.c
- Window *win;
- char *title;
-
- title= renderwin_get_title();
- win= window_open(title, winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY, 0);
-
- render_win= renderwin_alloc(win);
- render_win->rectx= imagesize[0];
- render_win->recty= imagesize[1];
-
- /* Ghost calls handler */
- window_set_handler(win, renderwin_handler, render_win);
-
- winlay_process_events(0);
- window_make_active(render_win->win);
- winlay_process_events(0);
-
- /* mywindow has to know about it too */
- mywindow_build_and_set_renderwin(winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY);
- /* and we should be able to draw 3d in it */
- GPU_state_init();
-
- renderwin_draw(render_win, 1);
- renderwin_draw(render_win, 1);
-}
-
-/* -------------- callbacks for render loop: Window (RenderWin) ----------------------- */
-
-/* calculations for window size and position */
-void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r[2], int rendersize_r[2])
-{
- int scr_w, scr_h, x, y, div= 0;
- float ndc_x= 0.0, ndc_y= 0.0;
-
- winlay_get_screensize(&scr_w, &scr_h);
-
- rendersize_r[0]= rectx;
- rendersize_r[1]= recty;
-
- rendersize_r[0]= CLAMPIS(rendersize_r[0], 0, scr_w);
- rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-RW_HEADERY);
-
- for (y=-1; y<=1; y++) {
- for (x=-1; x<=1; x++) {
- if (posmask & (1<<((y+1)*3 + (x+1)))) {
- ndc_x+= x;
- ndc_y+= y;
- div++;
- }
- }
- }
-
- if (div) {
- ndc_x/= div;
- ndc_y/= div;
- }
-
- renderpos_r[0]= (scr_w-rendersize_r[0])*(ndc_x*0.5 + 0.5);
-#ifdef __APPLE__
- /* 44 pixels is topbar and window header... awaiting better fixes in ghost :) */
- rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-44-RW_HEADERY);
- renderpos_r[1]= -44-RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);
-#else
- renderpos_r[1]= -RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);
-#endif
-}
-
-/* init renderwin, alloc/open/resize */
-static void renderwin_init_display_cb(RenderResult *rr)
-{
- if (G.afbreek != 1) {
- int rendersize[2], renderpos[2], imagesize[2];
-
- calc_renderwin_rectangle(rr->rectx, rr->recty, G.winpos, renderpos, rendersize);
-
- imagesize[0]= rr->rectx;
- imagesize[1]= rr->recty;
-
- if (!render_win) {
- open_renderwin(renderpos, rendersize, imagesize);
- renderwin_reset_view(render_win); // incl. autozoom for large images
- } else {
- int win_x, win_y;
- int win_w, win_h;
-
- window_get_position(render_win->win, &win_x, &win_y);
- window_get_size(render_win->win, &win_w, &win_h);
- win_h-= RW_HEADERY;
-
- /* XXX, this is nasty and I guess bound to cause problems,
- * but to ensure the window is at the user specified position
- * and size we reopen the window all the time... we need
- * a ghost _set_position to fix this -zr
- */
-
- /* XXX, well... it is nasty yes, and reopens windows each time on
- subsequent renders. Better rule is to make it reopen only only
- size change, and use the preferred position only on open_renderwin
- cases (ton)
- */
- if(rendersize[0]!= win_w || rendersize[1]!= win_h) {
- BIF_close_render_display();
- open_renderwin(renderpos, rendersize, imagesize);
- }
- else {
- window_raise(render_win->win);
- window_make_active(render_win->win);
-
- mywinset(2); // to assign scissor/viewport again in mywindow.c. is hackish yes, but otherwise it draws in header of button for ogl header
- {
- rcti win_rct;
- win_rct.xmin= win_rct.ymin= 0;
- window_get_size(render_win->win, &win_rct.xmax, &win_rct.ymax);
- win_rct.ymax-= RW_HEADERY;
- glaDefine2DArea(&win_rct);
- }
- }
-
- renderwin_reset_view(render_win);
- render_win->active= 1;
- }
- /* make sure we are in normal draw again */
- render_win->flags &= ~RW_FLAGS_ALPHA;
-
- glFinish();
- }
-}
-
-/* callback for redraw render win */
-static void renderwin_clear_display_cb(RenderResult *rr)
-{
- if (render_win) {
- window_make_active(render_win->win);
- renderwin_draw(render_win, 1);
- }
-}
-
-/* XXX, this is not good, we do this without any regard to state
-* ... better is to make this an optimization of a more clear
-* implementation. the bug shows up when you do something like
-* open the window, then draw part of the progress, then get
-* a redraw event. whatever can go wrong will. -zr
-*
-* Note: blocked queue handling while rendering to prevent that (ton)
-*/
-
-/* can get as well the full picture, as the parts while rendering */
-static void renderwin_progress(RenderWin *rw, RenderResult *rr, volatile rcti *renrect)
-{
- rcti win_rct;
- float *rectf= NULL, fullrect[2][2];
- unsigned int *rect32= NULL;
- int ymin, ymax, xmin, xmax;
-
- /* if renrect argument, we only display scanlines */
- if(renrect) {
- /* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */
- if(rr->renlay==NULL || renrect->ymax>=rr->recty)
- return;
-
- /* xmin here is first subrect x coord, xmax defines subrect width */
- xmin = renrect->xmin;
- xmax = renrect->xmax - xmin;
- if (xmax<2) return;
-
- ymin= renrect->ymin;
- ymax= renrect->ymax - ymin;
- if(ymax<2)
- return;
- renrect->ymin= renrect->ymax;
- }
- else {
- xmin = ymin = 0;
- xmax = rr->rectx - 2*rr->crop;
- ymax = rr->recty - 2*rr->crop;
- }
-
- /* renderwindow cruft */
- win_rct.xmin= win_rct.ymin= 0;
- window_get_size(rw->win, &win_rct.xmax, &win_rct.ymax);
- win_rct.ymax-= RW_HEADERY;
- renderwin_get_fullrect(rw, fullrect);
-
- /* find current float rect for display, first case is after composit... still weak */
- if(rr->rectf)
- rectf= rr->rectf;
- else {
- if(rr->rect32)
- rect32= (unsigned int *)rr->rect32;
- else {
- if(rr->renlay==NULL || rr->renlay->rectf==NULL) return;
- rectf= rr->renlay->rectf;
- }
- }
- if(rectf) {
- /* if scanline updates... */
- rectf+= 4*(rr->rectx*ymin + xmin);
-
- /* when rendering more pixels than needed, we crop away cruft */
- if(rr->crop)
- rectf+= 4*(rr->crop*rr->rectx + rr->crop);
- }
-
- /* tilerect defines drawing offset from (0,0) */
- /* however, tilerect (xmin, ymin) is first pixel */
- fullrect[0][0] += (rr->tilerect.xmin + rr->crop + xmin)*rw->zoom;
- fullrect[0][1] += (rr->tilerect.ymin + rr->crop + ymin)*rw->zoom;
-
- glEnable(GL_SCISSOR_TEST);
- glaDefine2DArea(&win_rct);
-
-#ifdef __APPLE__
-#else
- glDrawBuffer(GL_FRONT);
-#endif
- glPixelZoom(rw->zoom, rw->zoom);
-
- if(rect32)
- glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], xmax, ymax, rr->rectx, GL_RGBA, GL_UNSIGNED_BYTE, rect32);
- else
- glaDrawPixelsSafe_to32(fullrect[0][0], fullrect[0][1], xmax, ymax, rr->rectx, rectf);
-
- glPixelZoom(1.0, 1.0);
-
-#ifdef __APPLE__
- window_swap_buffers(render_win->win);
-#else
- glFlush();
- glDrawBuffer(GL_BACK);
-#endif
-}
-
-
-/* in render window; display a couple of scanlines of rendered image */
-static void renderwin_progress_display_cb(RenderResult *rr, volatile rcti *rect)
-{
- if (render_win) {
- renderwin_progress(render_win, rr, rect);
- }
-}
-
-/* -------------- callbacks for render loop: interactivity ----------------------- */
-
-/* string is RW_MAXTEXT chars min */
-void make_renderinfo_string(RenderStats *rs, char *str)
-{
- extern char info_time_str[32]; // header_info.c
- uintptr_t mem_in_use, mmap_in_use;
- float megs_used_memory, mmap_used_memory;
- char *spos= str;
-
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
-
- megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0);
- mmap_used_memory= (mmap_in_use)/(1024.0*1024.0);
-
- if(G.scene->lay & 0xFF000000)
- spos+= sprintf(spos, "Localview | ");
- else if(G.scene->r.scemode & R_SINGLE_LAYER)
- spos+= sprintf(spos, "Single Layer | ");
-
- spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (G.scene->r.cfra), rs->totvert, 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) ", rs->totlamp, megs_used_memory, mmap_used_memory);
-
- if(rs->curfield)
- spos+= sprintf(spos, "Field %d ", rs->curfield);
- if(rs->curblur)
- spos+= sprintf(spos, "Blur %d ", rs->curblur);
-
- BLI_timestr(rs->lastframetime, info_time_str);
- spos+= sprintf(spos, "Time:%s ", info_time_str);
-
- if(rs->infostr)
- spos+= sprintf(spos, "| %s ", rs->infostr);
-
- /* very weak... but 512 characters is quite safe... we cannot malloc during thread render */
- if(spos >= str+RW_MAXTEXT)
- printf("WARNING! renderwin text beyond limit \n");
-
-}
-
-/* callback for print info in top header of renderwin */
-static void renderwin_renderinfo_cb(RenderStats *rs)
-{
-
- if(render_win) {
-
- BIF_make_render_text(rs);
-
-#ifdef __APPLE__
-#else
- glDrawBuffer(GL_FRONT);
-#endif
- renderwin_draw_render_info(render_win);
-
-#ifdef __APPLE__
- window_swap_buffers(render_win->win);
-#else
- glFlush();
- glDrawBuffer(GL_BACK);
-#endif
- }
-
-}
-
-/* -------------- callback system to allow ESC from rendering ----------------------- */
-
-/* POSIX & WIN32: this function is called all the time, and should not use cpu or resources */
-static int test_break(void)
-{
-
- if(G.afbreek==2) { /* code for testing queue */
-
- G.afbreek= 0;
-
- blender_test_break(); /* tests blender interface */
-
- if (G.afbreek==0 && render_win) { /* tests window */
- winlay_process_events(0);
- // render_win can be closed in winlay_process_events()
- if (render_win == 0 || (render_win->flags & RW_FLAGS_ESCAPE)) {
- G.afbreek= 1;
- }
- }
- }
-
- if(G.afbreek==1) return 1;
- else return 0;
-}
-
-
-
-#ifdef _WIN32
-/* we use the multimedia time here */
-static UINT uRenderTimerId;
-
-void CALLBACK interruptESC(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
-{
- if(G.afbreek==0) G.afbreek= 2; /* code for read queue */
-}
-
-/* WIN32: init SetTimer callback */
-static void init_test_break_callback()
-{
- timeBeginPeriod(50);
- uRenderTimerId = timeSetEvent(250, 1, interruptESC, 0, TIME_PERIODIC);
-}
-
-/* WIN32: stop SetTimer callback */
-static void end_test_break_callback()
-{
- timeEndPeriod(50);
- timeKillEvent(uRenderTimerId);
-}
-
-#else
-/* all other OS's support signal(SIGVTALRM/SIGALRM) */
-
-/* XXX The ESC problem: some unix users reported that ESC doesn't cancel
- * renders anymore. Most complaints came from linux, but it's not
- * general, not all linux users have the problem.
- *
- * From tests, the systems that do have it are not signalling SIGVTALRM
- * interrupts (an issue with signals and threads). Using SIGALRM instead
- * fixes the problem, at least while we investigate better.
- *
- * ITIMER_REAL (SIGALRM): timer that counts real system time
- * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process
- *
- * Addendum: now SIGVTALRM is used on Solaris again, because SIGALRM can
- * kill the process there! */
-
-/* POSIX: this function goes in the signal() callback */
-static void interruptESC(int sig)
-{
-
- if(G.afbreek==0) G.afbreek= 2; /* code for read queue */
-
- /* call again, timer was reset */
-#ifdef __sun
- signal(SIGVTALRM, interruptESC);
-#else
- signal(SIGALRM, interruptESC);
-#endif
-}
-
-/* POSIX: initialize timer and signal */
-static void init_test_break_callback()
-{
-
- struct itimerval tmevalue;
-
- tmevalue.it_interval.tv_sec = 0;
- tmevalue.it_interval.tv_usec = 250000;
- /* when the first ? */
- tmevalue.it_value.tv_sec = 0;
- tmevalue.it_value.tv_usec = 10000;
-
-#ifdef __sun
- signal(SIGVTALRM, interruptESC);
- setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
-#else
- signal(SIGALRM, interruptESC);
- setitimer(ITIMER_REAL, &tmevalue, 0);
-#endif
-}
-
-/* POSIX: stop timer and callback */
-static void end_test_break_callback()
-{
- struct itimerval tmevalue;
-
- memset(&tmevalue, 0, sizeof(struct itimerval));
-
-#ifdef __sun
- setitimer(ITIMER_VIRTUAL, &tmevalue, 0);
- signal(SIGVTALRM, SIG_IGN);
-#else
- setitimer(ITIMER_REAL, &tmevalue, 0);
- signal(SIGALRM, SIG_IGN);
-#endif
-}
-
-
-#endif
-
-
-
-/* -------------- callbacks for render loop: init & run! ----------------------- */
-
-
-/* - initialize displays
- - set callbacks
- - cleanup
-*/
-
-static void do_render(int anim)
-{
- Image *ima;
- Render *re= RE_NewRender(G.scene->id.name);
- unsigned int lay= G.scene->lay;
- int scemode= G.scene->r.scemode;
- int sculptmode= G.f & G_SCULPTMODE;
-
- /* UGLY! we set this flag to prevent renderwindow queue to execute another render */
- /* is reset in RE_BlenderFrame */
- G.rendering= 1;
-
- /* set render callbacks, also starts ESC timer */
- BIF_init_render_callbacks(re, 1);
-
- waitcursor(1);
- if(render_win)
- window_set_cursor(render_win->win, CURSOR_WAIT);
-
- if(G.obedit)
- exit_editmode(0); /* 0 = no free data */
-
- if(sculptmode) set_sculptmode();
-
- /* allow localview render for objects with lights in normal layers */
- if(curarea->spacetype==SPACE_VIEW3D) {
- /* if view is defined (might not be if called from script), check and set layers. */
- if(G.vd) {
- if(G.vd->lay & 0xFF000000) {
- G.scene->lay |= G.vd->lay;
- G.scene->r.scemode |= R_SINGLE_LAYER;
- }
- else G.scene->lay= G.vd->lay;
- }
- }
-
- if(anim)
- RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
- else
- RE_BlenderFrame(re, G.scene, G.scene->r.cfra);
-
- /* restore local view exception */
- G.scene->lay= lay;
- G.scene->r.scemode= scemode;
-
- if(render_win) window_set_cursor(render_win->win, CURSOR_STD);
-
- free_filesel_spec(G.scene->r.pic);
-
- G.afbreek= 0;
- BIF_end_render_callbacks();
-
- /* after an envmap creation... */
-// if(R.flag & R_REDRAW_PRV) {
-// BIF_preview_changed(ID_TE);
-// }
-
- scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it
-
- /* get a render result image, and make sure it is clean */
- ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result");
- BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
-
- if(sculptmode) set_sculptmode();
-
- waitcursor(0);
-}
-
-/* called before render, store old render in spare buffer */
-static int render_store_spare(void)
-{
- RenderResult rres;
- RenderSpare *rspare= render_spare;
-
- if(rspare==0 || rspare->storespare==0)
- return 0;
-
- /* only store when it does not show spare */
- if(rspare->showspare==0)
- return 0;
-
- rspare->showspare= 0;
-
- if(rspare->ibuf) {
- IMB_freeImBuf(rspare->ibuf);
- rspare->ibuf= NULL;
- }
-
- RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres);
-
- rspare->ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, 0, 0);
- rspare->ibuf->dither= G.scene->r.dither_intensity;
-
- if(rres.rect32) {
- rspare->ibuf->rect= MEM_dupallocN(rres.rect32);
- rspare->ibuf->flags |= IB_rect;
- rspare->ibuf->mall |= IB_rect;
- }
- if(rres.rectf) {
- rspare->ibuf->rect_float= MEM_dupallocN(rres.rectf);
- rspare->ibuf->flags |= IB_rectfloat;
- rspare->ibuf->mall |= IB_rectfloat;
- }
- if(rres.rectz) {
- rspare->ibuf->zbuf_float= MEM_dupallocN(rres.rectz);
- rspare->ibuf->flags |= IB_zbuffloat;
- rspare->ibuf->mall |= IB_zbuffloat;
- }
-
- return 1;
-}
-
-/* -------------- API: externally called --------------- */
-
-static void error_cb(char *str){error(str);}
-static int esc_timer_set= 0;
-
-/* set callbacks, exported to sequence render too.
- Only call in foreground (UI) renders. */
-
-void BIF_init_render_callbacks(Render *re, int do_display)
-{
- if(do_display) {
- if(G.displaymode!=R_DISPLAYWIN) {
- if(render_win)
- BIF_close_render_display();
- imagewindow_render_callbacks(re);
- }
- else {
- RE_display_init_cb(re, renderwin_init_display_cb);
- RE_display_draw_cb(re, renderwin_progress_display_cb);
- RE_display_clear_cb(re, renderwin_clear_display_cb);
- RE_stats_draw_cb(re, renderwin_renderinfo_cb);
- }
- }
-
- RE_error_cb(re, error_cb);
-
- G.afbreek= 0;
- if(render_win)
- render_win->flags &= ~RW_FLAGS_ESCAPE;
-
- /* start esc timer. ensure it happens once only */
- if(esc_timer_set==0)
- init_test_break_callback();
- esc_timer_set++;
-
- RE_test_break_cb(re, test_break);
- RE_timecursor_cb(re, set_timecursor);
-
-}
-
-/* the init/end callbacks can be called multiple times (sequence render) */
-void BIF_end_render_callbacks(void)
-{
- esc_timer_set--;
- if(esc_timer_set==0) {
- end_test_break_callback();
-
- if(render_win)
- mainwindow_make_active();
- }
-}
-
-void BIF_store_spare(void)
-{
- if(render_store_spare()) {
- if(render_text)
- BLI_strncpy(render_spare->render_text_spare, render_text, RW_MAXTEXT);
-
- if(render_win)
- window_set_title(render_win->win, renderwin_get_title());
- allqueue(REDRAWIMAGE, 0);
- }
-}
-
-/* set up display, render an image or scene */
-void BIF_do_render(int anim)
-{
-#ifndef DISABLE_PYTHON
- if (G.f & G_DOSCRIPTLINKS)
- BPY_do_all_scripts(SCRIPT_RENDER, anim);
-#endif
-
- BIF_store_spare();
-
- do_render(anim);
-
- if(G.scene->use_nodes) {
- allqueue(REDRAWNODE, 1);
- allqueue(REDRAWIMAGE, 1);
- }
- if(G.scene->r.dither_intensity != 0.0f)
- BIF_redraw_render_rect();
-#ifndef DISABLE_PYTHON
- if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_POSTRENDER, anim);
-#endif
-}
-
-void do_ogl_view3d_render(Render *re, View3D *v3d, int winx, int winy)
-{
- float winmat[4][4];
-
- update_for_newframe_muted(); /* here, since camera can be animated */
-
- if(v3d->persp==V3D_CAMOB && v3d->camera) {
- /* in camera view, use actual render winmat */
- RE_GetCameraWindow(re, v3d->camera, CFRA, winmat);
- drawview3d_render(v3d, NULL, winx, winy, winmat, 0);
- }
- else
- drawview3d_render(v3d, NULL, winx, winy, NULL, 0);
-}
-
-/* set up display, render the current area view in an image */
-/* the RE_Render is only used to make sure we got the picture in the result */
-void BIF_do_ogl_render(View3D *v3d, int anim)
-{
- Render *re= RE_NewRender(G.scene->id.name);
- RenderResult *rr;
- int winx, winy;
-
- G.afbreek= 0;
- init_test_break_callback();
-
- winx= (G.scene->r.size*G.scene->r.xsch)/100;
- winy= (G.scene->r.size*G.scene->r.ysch)/100;
-
- RE_InitState(re, NULL, &G.scene->r, winx, winy, NULL);
-
- /* for now, result is defaulting to floats still... */
- rr= RE_GetResult(re);
- if(rr->rect32==NULL)
- rr->rect32= MEM_mallocN(sizeof(int)*winx*winy, "32 bits rects");
-
- /* open window */
- renderwin_init_display_cb(rr);
- if(render_win)
- render_win->flags &= ~RW_FLAGS_ESCAPE;
-
- GPU_state_init();
-
- waitcursor(1);
-
- if(anim) {
- bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype);
- unsigned int lay;
- int cfrao= CFRA;
- int nfra;
-
- if(BKE_imtype_is_movie(G.scene->r.imtype))
- mh->start_movie(&G.scene->r, winx, winy);
-
- for(nfra= SFRA, CFRA= SFRA; CFRA<=EFRA; CFRA++) {
- /* user event can close window */
- if(render_win==NULL)
- break;
-
- if(nfra!=CFRA) {
- if(G.scene->lay & 0xFF000000)
- lay= G.scene->lay & 0xFF000000;
- else
- lay= G.scene->lay;
-
- scene_update_for_newframe(G.scene, lay);
- continue;
- }
-
- do_ogl_view3d_render(re, v3d, winx, winy);
- glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32);
- if((G.scene->r.scemode & R_STAMP_INFO) && (G.scene->r.stamp & R_STAMP_DRAW)) {
- BKE_stamp_buf((unsigned char *)rr->rect32, rr->rectf, rr->rectx, rr->recty, 3);
- }
- window_swap_buffers(render_win->win);
-
- if(BKE_imtype_is_movie(G.scene->r.imtype)) {
- mh->append_movie(CFRA, rr->rect32, winx, winy);
- printf("Append frame %d", G.scene->r.cfra);
- }
- else {
- ImBuf *ibuf= IMB_allocImBuf(winx, winy, G.scene->r.planes, 0, 0);
- char name[FILE_MAXDIR+FILE_MAXFILE];
- int ok;
-
- BKE_makepicstring(name, G.scene->r.pic, G.scene->r.cfra, G.scene->r.imtype);
-
- ibuf->rect= (unsigned int *)rr->rect32;
- ok= BKE_write_ibuf(ibuf, name, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality);
-
- if(ok==0) {
- printf("Write error: cannot save %s\n", name);
- break;
- }
- else printf("Saved: %s", name);
-
- /* imbuf knows which rects are not part of ibuf */
- IMB_freeImBuf(ibuf);
- }
- /* movie stats prints have no line break */
- printf("\n");
-
- if(test_break()) break;
- nfra+= STFRA;
- }
-
- if(BKE_imtype_is_movie(G.scene->r.imtype))
- mh->end_movie();
-
- CFRA= cfrao;
- }
- else {
- do_ogl_view3d_render(re, v3d, winx, winy);
- glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32);
- if((G.scene->r.scemode & R_STAMP_INFO) && (G.scene->r.stamp & R_STAMP_DRAW)) {
- BKE_stamp_buf((unsigned char *)rr->rect32, rr->rectf, rr->rectx, rr->recty, 3);
- }
- window_swap_buffers(render_win->win);
- }
-
- if(render_win)
- renderwin_draw(render_win, 0);
-
- mainwindow_make_active();
-
- if(anim)
- scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it
-
- end_test_break_callback();
- waitcursor(0);
-}
-
-void BIF_redraw_render_rect(void)
-{
- /* redraw */
- if(render_win)
- renderwin_queue_redraw(render_win);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void BIF_swap_render_rects(void)
-{
- RenderResult rres;
- RenderSpare *rspare;
- ImBuf *ibuf;
-
- if(!render_spare)
- render_spare= renderspare_alloc();
-
- rspare= render_spare;
- rspare->storespare= 1;
- rspare->showspare ^= 1;
-
- RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres);
-
- ibuf= rspare->ibuf;
- if(ibuf && (ibuf->x!=rres.rectx || ibuf->y!=rres.recty)) {
- IMB_freeImBuf(ibuf);
- rspare->ibuf= NULL;
- }
-
- if(render_win)
- window_set_title(render_win->win, renderwin_get_title());
-
- /* redraw */
- BIF_redraw_render_rect();
-}
-
-ImBuf *BIF_render_spare_imbuf()
-{
- return (render_spare)? render_spare->ibuf: NULL;
-}
-
-int BIF_show_render_spare()
-{
- return (render_spare && render_spare->showspare);
-}
-
-char *BIF_render_text()
-{
- if(render_spare && render_spare->showspare)
- return render_spare->render_text_spare;
- else
- return render_text;
-}
-
-void BIF_make_render_text(RenderStats *rs)
-{
- if(!render_text)
- render_text= MEM_callocN(RW_MAXTEXT, "rendertext");
- make_renderinfo_string(rs, render_text);
-}
-
-/* called from usiblender.c too, to free and close renderwin */
-
-void BIF_free_render_spare()
-{
- RenderSpare *rspare= render_spare;
-
- if(render_text) {
- MEM_freeN(render_text);
- render_text= NULL;
- }
-
- if(rspare) {
- if (rspare->render_text_spare) MEM_freeN(rspare->render_text_spare);
- if (rspare->ibuf) IMB_freeImBuf(rspare->ibuf);
-
- MEM_freeN(rspare);
- render_spare= NULL;
- }
-}
-
-void BIF_close_render_display(void)
-{
- if (render_win) {
- if (render_win->info_text) MEM_freeN(render_win->info_text);
- window_destroy(render_win->win); /* ghost close window */
- MEM_freeN(render_win);
-
- render_win= NULL;
- }
-}
-
-
-/* typical with F11 key, show image or hide/close */
-void BIF_toggle_render_display(void)
-{
-
- if (G.displaymode!=R_DISPLAYWIN) {
- imagewindow_toggle_render();
- }
- else {
- if (render_win) {
- if(render_win->active) {
- mainwindow_raise();
- mainwindow_make_active();
- render_win->active= 0;
- }
- else {
- window_raise(render_win->win);
- window_make_active(render_win->win);
- render_win->active= 1;
- }
- }
- else {
- RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name));
- if(rr) renderwin_init_display_cb(rr);
- }
- }
-}
-
-void BIF_renderwin_set_custom_cursor(unsigned char mask[16][2], unsigned char bitmap[16][2])
-{
- if (render_win) {
- window_set_custom_cursor(render_win->win, mask, bitmap, 7, 7);
- }
-}
diff --git a/source/blender/src/retopo.c b/source/blender/src/retopo.c
deleted file mode 100644
index b6f14b9bb68..00000000000
--- a/source/blender/src/retopo.c
+++ /dev/null
@@ -1,927 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Implements the Retopo tools
- *
- * BIF_retopo.h
- *
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_curve_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BDR_editobject.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "BSE_drawview.h"
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "editmesh.h"
-#include "mydevice.h"
-
-#ifdef WIN32
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef struct RetopoPaintHit {
- struct RetopoPaintHit *next, *prev;
- RetopoPaintPoint *intersection;
- short index;
- float where;
-} RetopoPaintHit;
-
-static void retopo_do_2d(View3D *v3d, double proj[2], float *v, char adj);
-
-#if 0
-static void retopo_paint_debug_print(RetopoPaintData *rpd)
-{
- RetopoPaintLine *l;
- RetopoPaintPoint *p;
-
- for(l= rpd->lines.first; l; l= l->next) {
- printf("Line:\n");
- for(p= l->points.first; p; p= p->next) {
- printf(" Point(%d: %d,%d)\n",p->index,p->loc.x,p->loc.y);
- }
- }
-
- fflush(stdout);
-}
-#endif
-
-/* Painting */
-RetopoPaintData *get_retopo_paint_data(void)
-{
- if(!retopo_mesh_paint_check()) return NULL;
- if(!G.editMesh) return NULL;
- return G.editMesh->retopo_paint_data;
-}
-
-char retopo_mesh_paint_check(void)
-{
- return retopo_mesh_check() && G.scene->toolsettings->retopo_mode & RETOPO_PAINT;
-}
-
-void retopo_free_paint_data(RetopoPaintData *rpd)
-{
- if(rpd) {
- RetopoPaintLine *l;
- for(l= rpd->lines.first; l; l= l->next) {
- BLI_freelistN(&l->points);
- BLI_freelistN(&l->hitlist);
- }
- BLI_freelistN(&rpd->lines);
-
- BLI_freelistN(&rpd->intersections);
-
- MEM_freeN(rpd);
- }
-}
-
-void retopo_free_paint(void)
-{
- retopo_free_paint_data(G.editMesh->retopo_paint_data);
- G.editMesh->retopo_paint_data= NULL;
-}
-
-char line_intersection_2d(const vec2s *a, const vec2s *b, const vec2s *c, const vec2s *d, vec2s *out,
- float *r, float *s)
-{
- float den;
- *r= (a->y - c->y) * (d->x - c->x) - (a->x - c->x) * (d->y - c->y);
- *s= (a->y - c->y) * (b->x - a->x) - (a->x - c->x) * (b->y - a->y);
- den= (b->x - a->x) * (d->y - c->y) - (b->y - a->y) * (d->x - c->x);
-
- if((a->x==b->x && a->y==b->y) || (c->x==d->x && c->y==d->y)) return 0;
-
- if(!den) return 0;
-
- *r/= den;
- *s/= den;
-
- if(*s<0 || *s>=1 || *r<0 || *r>=1) return 0;
-
- out->x= a->x + *r*(b->x - a->x);
- out->y= a->y + *r*(b->y - a->y);
- return 1;
-}
-
-void retopo_paint_add_line_hit(RetopoPaintLine *l, RetopoPaintPoint *p, RetopoPaintPoint *intersection, float w)
-{
- RetopoPaintHit *prev, *hit= MEM_callocN(sizeof(RetopoPaintHit),"RetopoPaintHit");
-
- hit->intersection= intersection;
- hit->index= p->index;
- hit->where= w;
-
- prev= l->hitlist.first;
- if(!prev) {
- BLI_addtail(&l->hitlist,hit);
- }
- else if(prev->index>hit->index) {
- BLI_addhead(&l->hitlist,hit);
- }
- else {
- /* Move forward until we hit the next highest index */
- while(prev->next) {
- if(prev->next->index > hit->index) break;
- prev= prev->next;
- }
- /* Move backward until we hit the next lowest where */
- while(prev->prev && prev->prev->index==prev->index &&
- prev->where > hit->where)
- prev=prev->prev;
- BLI_insertlink(&l->hitlist,prev,hit);
- }
-
- /* Removed duplicate intersections */
- if(hit->prev && hit->prev->intersection==hit->intersection) {
- BLI_freelinkN(&l->hitlist,hit);
- }
-}
-
-char retopo_paint_add_intersection(RetopoPaintData *rpd, RetopoPaintLine *l1, RetopoPaintPoint *p1,
- RetopoPaintLine *l2, RetopoPaintPoint *p2, vec2s *out, float r, float s)
-{
- RetopoPaintPoint *p, *hit;
- char found= 0;
-
- for(p=rpd->intersections.first; p; p= p->next) {
- if(sqrt(pow(p->loc.x-out->x,2)+pow(p->loc.y-out->y,2))<7) {
- found= 1;
- break;
- }
- }
-
- if(!found) {
- hit= MEM_callocN(sizeof(RetopoPaintPoint),"Retopo paint intersection");
- hit->loc.x= out->x;
- hit->loc.y= out->y;
- BLI_addtail(&rpd->intersections,hit);
- } else {
- hit= p;
- }
-
- retopo_paint_add_line_hit(l1,p1,hit,r);
- retopo_paint_add_line_hit(l2,p2,hit,s);
-
- return !found;
-}
-
-
-/* Returns 1 if a new intersection was added */
-char do_line_intersection(RetopoPaintData *rpd, RetopoPaintLine *l1, RetopoPaintPoint *p1,
- RetopoPaintLine *l2, RetopoPaintPoint *p2)
-{
- vec2s out;
- float r,s;
- if(line_intersection_2d(&p1->loc, &p1->next->loc,
- &p2->loc, &p2->next->loc,
- &out,&r,&s)) {
- if(retopo_paint_add_intersection(rpd,l1,p1,l2,p2,&out,r,s))
- return 1;
- }
- return 0;
-}
-
-typedef struct FaceNode {
- struct FaceNode *next, *prev;
- MFace f;
-} FaceNode;
-
-char faces_equal(EditFace *f1, EditFace *f2)
-{
- return editface_containsVert(f2,f1->v1) &&
- editface_containsVert(f2,f1->v2) &&
- editface_containsVert(f2,f1->v3) &&
- (f1->v4 ? editface_containsVert(f2,f1->v4) : 1);
-}
-
-EditFace *addfaceif(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4)
-{
- EditFace *efa;
-
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(editface_containsVert(efa,v1) &&
- editface_containsVert(efa,v2) &&
- editface_containsVert(efa,v3) &&
- (v4 ? editface_containsVert(efa,v4) : 1))
- return NULL;
- }
-
- return addfacelist(v1,v2,v3,v4,NULL,NULL);
-}
-
-void retopo_paint_apply(void)
-{
- RetopoPaintData *rpd= G.editMesh->retopo_paint_data;
- EditVert *eve;
-
- if(rpd) {
- RetopoPaintLine *l1, *l2;
- RetopoPaintPoint *p1, *p2;
- unsigned hitcount= 0;
- unsigned i;
- RetopoPaintHit *h;
- float hitco[3];
-
- /* Find intersections */
- BLI_freelistN(&rpd->intersections);
- for(l1= rpd->lines.first; l1; l1= l1->next) {
- for(l2= rpd->lines.first; l2; l2= l2->next) {
- if(l1!=l2) {
- for(p1= l1->points.first; p1 && p1!=l1->points.last; p1= p1->next) {
- for(p2= l2->points.first; p2 && p2!=l2->points.last; p2= p2->next) {
- if(p1!=p2) {
- if(do_line_intersection(rpd,l1,p1,l2,p2))
- ++hitcount;
- }
- }
- }
- }
- }
- }
-
- /*topoPaintHit *hit;
- l1= rpd->lines.first;
- for(hit= l1->hitlist.first; hit; hit= hit->next) {
- printf("\nhit(%p,%d) ",hit->intersection,hit->index);
- }
- fflush(stdout);*/
-
- /* Deselect */
- for(eve= G.editMesh->verts.first; eve; eve= eve->next)
- eve->f &= ~SELECT;
- EM_deselect_flush();
-
- for(i=0; i<hitcount; ++i) {
- RetopoPaintPoint *intersection= BLI_findlink(&rpd->intersections,i);
- double proj[2] = {intersection->loc.x, intersection->loc.y};
- retopo_do_2d(rpd->paint_v3d, proj, hitco, 1);
- intersection->eve= addvertlist(hitco, NULL);
- intersection->eve->f= SELECT;
- }
-
- for(l1= rpd->lines.first; l1; l1= l1->next) {
- unsigned etcount= BLI_countlist(&l1->hitlist);
- if(etcount>=2) {
- for(h= l1->hitlist.first; (h && h->next); h= h->next)
- addedgelist(h->intersection->eve,h->next->intersection->eve,NULL);
- if(etcount>=3 && l1->cyclic)
- addedgelist(((RetopoPaintHit*)l1->hitlist.first)->intersection->eve,
- ((RetopoPaintHit*)l1->hitlist.last)->intersection->eve, NULL);
- }
- }
-
- addfaces_from_edgenet();
- }
-
- retopo_free_paint();
-}
-
-void add_rppoint(RetopoPaintLine *l, short x, short y)
-{
- RetopoPaintPoint *p= MEM_callocN(sizeof(RetopoPaintPoint),"RetopoPaintPoint");
- double proj[2];
- p->loc.x= x;
- p->loc.y= y;
- BLI_addtail(&l->points,p);
- p->index= p->prev?p->prev->index+1:0;
-
- proj[0] = p->loc.x;
- proj[1] = p->loc.y;
-
- retopo_do_2d(G.editMesh->retopo_paint_data->paint_v3d, proj, p->co, 1);
-}
-RetopoPaintLine *add_rpline(RetopoPaintData *rpd)
-{
- RetopoPaintLine *l= MEM_callocN(sizeof(RetopoPaintLine),"RetopoPaintLine");
- BLI_addtail(&rpd->lines,l);
- return l;
-}
-
-void retopo_paint_toggle_cyclic(RetopoPaintLine *l)
-{
- if(l==NULL)
- return;
- if(!l->cyclic) {
- RetopoPaintPoint *pf= l->points.first;
-
- if(pf) {
- add_rppoint(l, pf->loc.x, pf->loc.y);
- l->cyclic= l->points.last;
- }
- } else {
- BLI_freelinkN(&l->points,l->cyclic);
- l->cyclic= NULL;
- }
-}
-
-void retopo_paint_add_line(RetopoPaintData *rpd, short mouse[2])
-{
- RetopoPaintLine *l= add_rpline(rpd);
- float range[2]= {mouse[0]-rpd->sloc[0],mouse[1]-rpd->sloc[1]};
- int i;
-
- /* Add initial point */
- add_rppoint(l,rpd->sloc[0],rpd->sloc[1]);
- for(i=0; i<G.scene->toolsettings->line_div; ++i) {
- const float mul= (i+1.0f) / G.scene->toolsettings->line_div;
- add_rppoint(l,rpd->sloc[0] + range[0]*mul,rpd->sloc[1] + range[1]*mul);
- }
-
- allqueue(REDRAWVIEW3D,0);
-}
-
-void retopo_paint_add_ellipse(RetopoPaintData *rpd, short mouse[2])
-{
- int i;
-
- add_rpline(rpd);
- for (i=0; i<G.scene->toolsettings->ellipse_div; i++) {
- float t= (float) i / G.scene->toolsettings->ellipse_div;
- float cur= t*(M_PI*2);
-
- float w= abs(mouse[0]-rpd->sloc[0]);
- float h= abs(mouse[1]-rpd->sloc[1]);
-
- add_rppoint(rpd->lines.last,cos(cur)*w+rpd->sloc[0],sin(cur)*h+rpd->sloc[1]);
- }
-
- retopo_paint_toggle_cyclic(rpd->lines.last);
-
- allqueue(REDRAWVIEW3D,0);
-}
-
-void retopo_end_okee(void)
-{
- if(okee("Apply retopo paint?"))
- retopo_paint_apply();
- else
- retopo_free_paint();
- G.scene->toolsettings->retopo_mode &= ~RETOPO_PAINT;
-}
-
-void retopo_paint_toggle(void *a, void *b)
-{
- /* Note that these operations are reversed because mode bit has already been set! */
- if(retopo_mesh_paint_check()) { /* Activate retopo paint */
- RetopoPaintData *rpd= MEM_callocN(sizeof(RetopoPaintData),"RetopoPaintData");
-
- G.editMesh->retopo_paint_data= rpd;
- G.scene->toolsettings->retopo_paint_tool= RETOPO_PEN;
- rpd->seldist= 15;
- rpd->nearest.line= NULL;
- G.scene->toolsettings->line_div= 25;
- G.scene->toolsettings->ellipse_div= 25;
- G.scene->toolsettings->retopo_hotspot= 1;
- } else retopo_end_okee();
-
- BIF_undo_push("Retopo toggle");
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-void retopo_paint_view_update(struct View3D *v3d)
-{
- RetopoPaintData *rpd= get_retopo_paint_data();
-
- if(rpd && rpd->paint_v3d==v3d) {
- RetopoPaintLine *l;
- RetopoPaintPoint *p;
- double ux, uy, uz;
-
- for(l= rpd->lines.first; l; l= l->next) {
- for(p= l->points.first; p; p= p->next) {
- gluProject(p->co[0],p->co[1],p->co[2], v3d->retopo_view_data->mats.modelview,
- v3d->retopo_view_data->mats.projection,
- (GLint *)v3d->retopo_view_data->mats.viewport, &ux, &uy, &uz);
- p->loc.x= ux;
- p->loc.y= uy;
- }
- }
- }
-}
-
-void retopo_force_update(void)
-{
- RetopoPaintData *rpd= get_retopo_paint_data();
-
- if(rpd) {
- View3D *vd= rpd->paint_v3d;
-
- if(vd) {
- if(vd->depths) vd->depths->damaged= 1;
- retopo_queue_updates(vd);
- if(retopo_mesh_paint_check() && vd->retopo_view_data)
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-}
-
-/* Returns 1 if event should be processed by caller, 0 otherwise */
-char retopo_paint(const unsigned short event)
-{
- RetopoPaintData *rpd= get_retopo_paint_data();
-
- if(!event) return 1;
- if(rpd) {
- RetopoPaintLine *l;
- short mouse[2];
- char lbut= get_mbut() & (U.flag & USER_LMOUSESELECT ? R_MOUSE : L_MOUSE);
-
- if(rpd->paint_v3d && rpd->paint_v3d!=G.vd) return 1;
-
- getmouseco_areawin(mouse);
-
- if(rpd->in_drag && !lbut) { /* End drag */
- rpd->in_drag= 0;
-
- switch(G.scene->toolsettings->retopo_paint_tool) {
- case RETOPO_PEN:
- break;
- case RETOPO_LINE:
- retopo_paint_add_line(rpd, mouse);
- break;
- case RETOPO_ELLIPSE:
- retopo_paint_add_ellipse(rpd, mouse);
- break;
- }
- BIF_undo_push("Retopo paint");
- }
-
- switch(event) {
- case MOUSEX:
- case MOUSEY:
- switch(G.scene->toolsettings->retopo_paint_tool) {
- case RETOPO_PEN:
- if(rpd->in_drag && rpd->lines.last) {
- l= rpd->lines.last;
-
- if(((RetopoPaintPoint*)l->points.last)->loc.x != mouse[0] ||
- ((RetopoPaintPoint*)l->points.last)->loc.y != mouse[1]) {
- add_rppoint(l,mouse[0],mouse[1]);
- }
- rpd->nearest.line= NULL;
-
- break;
- } else if(G.scene->toolsettings->retopo_hotspot) { /* Find nearest endpoint */
- float sdist;
- RetopoPaintLine *l= rpd->lines.first;
- RetopoPaintSel n= {NULL,NULL,l,1};
- sdist= rpd->seldist + 10;
- for(l= rpd->lines.first; l; l= l->next) {
- float tdist;
- RetopoPaintPoint *p1= l->points.first, *p2= l->points.last;
-
- tdist= sqrt(pow(mouse[0] - p1->loc.x,2)+pow(mouse[1] - p1->loc.y,2));
- if(tdist < sdist && tdist < rpd->seldist) {
- sdist= tdist;
- n.line= l;
- n.first= 1;
- } else {
- tdist= sqrt(pow(mouse[0] - p2->loc.x,2)+pow(mouse[1] - p2->loc.y,2));
- if(tdist < sdist && tdist < rpd->seldist) {
- sdist= tdist;
- n.line= l;
- n.first= 0;
- }
- }
- }
-
- if(sdist < rpd->seldist)
- rpd->nearest= n;
- else rpd->nearest.line= NULL;
- }
- break;
- case RETOPO_LINE:
- break;
- case RETOPO_ELLIPSE:
- break;
- }
- allqueue(REDRAWVIEW3D,0);
- break;
- case RETKEY:
- case PADENTER:
- retopo_paint_apply();
- case ESCKEY:
- G.scene->toolsettings->retopo_mode&= ~RETOPO_PAINT;
- retopo_free_paint();
-
- BIF_undo_push("Retopo toggle");
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
- break;
- case CKEY:
- retopo_paint_toggle_cyclic(rpd->lines.last);
- BIF_undo_push("Retopo toggle cyclic");
- allqueue(REDRAWVIEW3D, 0);
- break;
- case EKEY:
- G.scene->toolsettings->retopo_paint_tool= RETOPO_ELLIPSE;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case HKEY:
- G.scene->toolsettings->retopo_hotspot= !G.scene->toolsettings->retopo_hotspot;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case LKEY:
- G.scene->toolsettings->retopo_paint_tool= RETOPO_LINE;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case PKEY:
- G.scene->toolsettings->retopo_paint_tool= RETOPO_PEN;
- allqueue(REDRAWVIEW3D, 1);
- break;
- case XKEY:
- case DELKEY:
- l= rpd->lines.last;
- if(l) {
- BLI_freelistN(&l->points);
- BLI_freelistN(&l->hitlist);
- BLI_freelinkN(&rpd->lines, l);
- if(rpd->nearest.line == l)
- rpd->nearest.line= NULL;
- BIF_undo_push("Erase line");
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case LEFTMOUSE:
- if(!rpd->in_drag) { /* Start new drag */
- rpd->in_drag= 1;
-
- if(!rpd->paint_v3d)
- rpd->paint_v3d= G.vd;
-
- /* Location of mouse down */
- rpd->sloc[0]= mouse[0];
- rpd->sloc[1]= mouse[1];
-
- switch(G.scene->toolsettings->retopo_paint_tool) {
- case RETOPO_PEN:
- if(rpd->nearest.line) {
- RetopoPaintPoint *p, *pt;
- int i;
-
- BLI_remlink(&rpd->lines,rpd->nearest.line);
- BLI_addtail(&rpd->lines,rpd->nearest.line);
-
- /* Check if we need to reverse the line */
- if(rpd->nearest.first) {
- for(p= rpd->nearest.line->points.first; p; p= p->prev) {
- pt= p->prev;
- p->prev= p->next;
- p->next= pt;
- }
- pt= rpd->nearest.line->points.first;
- rpd->nearest.line->points.first= rpd->nearest.line->points.last;
- rpd->nearest.line->points.last= pt;
-
- /* Reverse indices */
- i= 0;
- for(p= rpd->nearest.line->points.first; p; p= p->next)
- p->index= i++;
- }
- } else {
- add_rpline(rpd);
- add_rppoint(rpd->lines.last,mouse[0],mouse[1]);
- }
- break;
- case RETOPO_LINE:
- break;
- case RETOPO_ELLIPSE:
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADMINUS: case PADPLUSKEY:
- return 1;
- }
- return 0;
- } else return 1;
-}
-void retopo_draw_paint_lines()
-{
- RetopoPaintData *rpd= get_retopo_paint_data();
-
- if(rpd && rpd->paint_v3d==G.vd) {
- RetopoPaintLine *l;
- RetopoPaintPoint *p;
-
- glColor3f(0,0,0);
- glLineWidth(2);
-
- /* Draw existing lines */
- for(l= rpd->lines.first; l; l= l->next) {
- if(l==rpd->lines.last)
- glColor3f(0.3,0,0);
- glBegin(l->cyclic?GL_LINE_LOOP:GL_LINE_STRIP);
- for(p= l->points.first; p; p= p->next) {
- glVertex2s(p->loc.x,p->loc.y);
- }
- glEnd();
- }
-
- /* Draw ellipse */
- if(G.scene->toolsettings->retopo_paint_tool==RETOPO_ELLIPSE && rpd->in_drag) {
- short mouse[2];
- getmouseco_areawin(mouse);
-
- setlinestyle(3);
- fdrawXORellipse(rpd->sloc[0],rpd->sloc[1],abs(mouse[0]-rpd->sloc[0]),abs(mouse[1]-rpd->sloc[1]));
- setlinestyle(0);
- }
- else if(G.scene->toolsettings->retopo_paint_tool==RETOPO_LINE && rpd->in_drag) {
- short mouse[2];
- getmouseco_areawin(mouse);
-
- setlinestyle(3);
- sdrawXORline(rpd->sloc[0],rpd->sloc[1],mouse[0],mouse[1]);
- setlinestyle(0);
- }
- else if(rpd->nearest.line) { /* Draw selection */
- RetopoPaintPoint *p= rpd->nearest.first ? rpd->nearest.line->points.first :
- rpd->nearest.line->points.last;
- if(p)
- fdrawXORcirc(p->loc.x, p->loc.y, rpd->seldist);
- }
-
- glLineWidth(1);
- }
-}
-
-RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd)
-{
- RetopoPaintData *copy;
- RetopoPaintLine *l, *lcp;
- RetopoPaintPoint *p, *pcp;
-
- if(!rpd) return NULL;
-
- copy= MEM_mallocN(sizeof(RetopoPaintData),"RetopoPaintDataCopy");
-
- memcpy(copy,rpd,sizeof(RetopoPaintData));
- copy->lines.first= copy->lines.last= NULL;
- copy->nearest.next= copy->nearest.prev= NULL;
- copy->nearest.line= NULL;
- copy->nearest.first= 0;
-
- for(l= rpd->lines.first; l; l= l->next) {
- lcp= MEM_dupallocN(l);
- BLI_addtail(&copy->lines, lcp);
-
- lcp->hitlist.first= lcp->hitlist.last= NULL;
- lcp->points.first= lcp->points.last= NULL;
- lcp->cyclic= NULL;
-
- for(p= l->points.first; p; p= p->next) {
- pcp= MEM_dupallocN(p);
- BLI_addtail(&lcp->points, pcp);
- pcp->eve= NULL;
- }
- }
-
- copy->intersections.first= copy->intersections.last= NULL;
-
- return copy;
-}
-
-char retopo_mesh_check(void)
-{
- return G.obedit && G.obedit->type==OB_MESH && (G.scene->toolsettings->retopo_mode & RETOPO);
-}
-char retopo_curve_check(void)
-{
- return G.obedit && (G.obedit->type==OB_CURVE ||
- G.obedit->type==OB_SURF) && (((Curve*)G.obedit->data)->flag & CU_RETOPO);
-}
-
-void retopo_toggle(void *j1,void *j2)
-{
- if(retopo_mesh_check() || retopo_curve_check()) {
- if(G.vd->depths) G.vd->depths->damaged= 1;
- retopo_queue_updates(G.vd);
- } else {
- if(G.editMesh && G.scene->toolsettings->retopo_mode & RETOPO_PAINT)
- retopo_end_okee();
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void retopo_do_2d(View3D *v3d, double proj[2], float *v, char adj)
-{
- /* Check to make sure vert is visible in window */
- if(proj[0]>0 && proj[1]>0 && proj[0] < v3d->depths->w && proj[1] < v3d->depths->h) {
- float depth= v3d->depths->depths[((int)proj[1])*v3d->depths->w+((int)proj[0])];
- double px, py, pz;
-
- /* Don't modify the point if it'll be mapped to the background */
- if(depth==v3d->depths->depth_range[1]) {
- if(adj) {
- /* Find the depth of (0,0,0); */
- gluProject(0,0,0,v3d->retopo_view_data->mats.modelview,
- v3d->retopo_view_data->mats.projection,
- (GLint *)v3d->retopo_view_data->mats.viewport,&px,&py,&pz);
- depth= pz;
- }
- else return;
- }
-
- /* Find 3D location with new depth (unproject) */
- gluUnProject(proj[0],proj[1],depth,v3d->retopo_view_data->mats.modelview,
- v3d->retopo_view_data->mats.projection,
- (GLint *)v3d->retopo_view_data->mats.viewport,&px,&py,&pz);
-
- v[0]= px;
- v[1]= py;
- v[2]= pz;
- }
-}
-
-void retopo_do_vert(View3D *v3d, float *v)
-{
- double proj[3];
-
- /* Find 2D location (project) */
- gluProject(v[0],v[1],v[2],v3d->retopo_view_data->mats.modelview,v3d->retopo_view_data->mats.projection,
- (GLint *)v3d->retopo_view_data->mats.viewport,&proj[0],&proj[1],&proj[2]);
-
- retopo_do_2d(v3d,proj,v,0);
-}
-
-void retopo_do_all(void)
-{
- RetopoViewData *rvd= G.vd->retopo_view_data;
- if(retopo_mesh_check()) {
- if(rvd) {
- EditMesh *em= G.editMesh;
- EditVert *eve;
-
- /* Apply retopo to all selected vertices */
- eve= em->verts.first;
- while(eve) {
- if(eve->f & SELECT)
- retopo_do_vert(G.vd,eve->co);
- eve= eve->next;
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else if(retopo_curve_check()) {
- if(rvd) {
- extern ListBase editNurb;
- Nurb *nu;
- BPoint *bp;
- int i, j;
-
- for(nu= editNurb.first; nu; nu= nu->next)
- {
- if(nu->type & CU_2D) {
- /* Can't wrap a 2D curve onto a 3D surface */
- }
- else if(nu->type & CU_BEZIER) {
- for(i=0; i<nu->pntsu; ++i) {
- if(nu->bezt[i].f1 & SELECT)
- retopo_do_vert(G.vd, nu->bezt[i].vec[0]);
- if(nu->bezt[i].f2 & SELECT)
- retopo_do_vert(G.vd, nu->bezt[i].vec[1]);
- if(nu->bezt[i].f3 & SELECT)
- retopo_do_vert(G.vd, nu->bezt[i].vec[2]);
- }
- }
- else {
- bp= nu->bp;
- for(i=0; i<nu->pntsv; ++i) {
- for(j=0; j<nu->pntsu; ++j, ++bp) {
- if(bp->f1 & SELECT)
- retopo_do_vert(G.vd,bp->vec);
- }
- }
- }
-
- testhandlesNurb(nu);
- }
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
-}
-
-void retopo_do_all_cb(void *j1, void *j2)
-{
- /* This is called from editbuttons, so user needs to specify view */
- if(!select_area(SPACE_VIEW3D)) return;
-
- if(G.vd->drawtype == OB_WIRE) {
- error("Cannot apply retopo in wireframe mode");
- return;
- }
-
- retopo_do_all();
- BIF_undo_push("Retopo all");
-}
-
-void retopo_queue_updates(View3D *v3d)
-{
- if(retopo_mesh_check() || retopo_curve_check()) {
- if(!v3d->retopo_view_data)
- v3d->retopo_view_data= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData");
-
- v3d->retopo_view_data->queue_matrix_update= 1;
-
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-void retopo_matrix_update(View3D *v3d)
-{
- RetopoPaintData *rpd= get_retopo_paint_data();
- if((retopo_mesh_check() || retopo_curve_check()) && (!rpd || rpd->paint_v3d==v3d)) {
- RetopoViewData *rvd= v3d->retopo_view_data;
- if(!rvd) {
- rvd= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData");
- v3d->retopo_view_data= rvd;
- rvd->queue_matrix_update= 1;
- }
- if(rvd && rvd->queue_matrix_update) {
- bgl_get_mats(&rvd->mats);
-
- rvd->queue_matrix_update= 0;
- }
- }
-}
-
-void retopo_free_view_data(View3D *v3d)
-{
- if(v3d->retopo_view_data) {
- MEM_freeN(v3d->retopo_view_data);
- v3d->retopo_view_data= NULL;
- }
-}
diff --git a/source/blender/src/scrarea.c b/source/blender/src/scrarea.c
deleted file mode 100644
index 6f7da9a7dbf..00000000000
--- a/source/blender/src/scrarea.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "BIF_scrarea.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-void *scrarea_find_space_of_type(ScrArea *sa, int type)
-{
- SpaceLink *sl;
-
- for (sl= sa->spacedata.first; sl; sl= sl->next)
- if (sl->spacetype==type)
- return (void*) sl;
-
- return 0;
-}
-
-int scrarea_get_win_x(ScrArea *sa)
-{
- return sa->winrct.xmin;
-}
-
-int scrarea_get_win_y(ScrArea *sa)
-{
- return sa->winrct.ymin;
-}
-
-int scrarea_get_win_width(ScrArea *sa)
-{
- return sa->winx;
-}
-
-int scrarea_get_win_height(ScrArea *sa)
-{
- return sa->winy;
-}
diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c
deleted file mode 100644
index e793c224fcb..00000000000
--- a/source/blender/src/screendump.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- * Making screendumps.
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_material.h"
-#include "BKE_sca.h"
-
-#include "BIF_gl.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_toets.h"
-#include "BIF_interface.h"
-#include "BIF_writeimage.h"
-
-#include "BSE_filesel.h"
-
-#include "mydevice.h"
-
-static unsigned int *dumprect=0;
-static int dumpsx, dumpsy;
-
-void write_screendump(char *name)
-{
- ImBuf *ibuf;
-
- if(dumprect) {
-
- strcpy(G.ima, name);
- BLI_convertstringcode(name, G.sce);
- BLI_convertstringframe(name, G.scene->r.cfra); /* TODO - is this ever used? */
-
- /* BKE_add_image_extension() checks for if extension was already set */
- if(G.scene->r.scemode & R_EXTENSION)
- if(strlen(name)<FILE_MAXDIR+FILE_MAXFILE-5)
- BKE_add_image_extension(name, G.scene->r.imtype);
-
- if(saveover(name)) {
- waitcursor(1);
-
- ibuf= IMB_allocImBuf(dumpsx, dumpsy, 24, 0, 0);
- ibuf->rect= dumprect;
-
- if(G.scene->r.planes == 8) IMB_cspace(ibuf, rgb_to_bw);
-
- BKE_write_ibuf(ibuf, name, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality);
-
- IMB_freeImBuf(ibuf);
-
- waitcursor(0);
- }
- MEM_freeN(dumprect);
- dumprect= NULL;
- }
-}
-
-/* get dump from frontbuffer */
-void BIF_screendump(int fscreen)
-{
- extern int uiIsMenu(int *x, int *y, int *sizex, int *sizey);
- int ismenu;
- static int wasmenu= 0;
- int x=0, y=0;
- char imstr[64];
-
- /* this sets dumpsx/y to zero if ismenu==0 */
- ismenu= uiIsMenu(&x, &y, &dumpsx, &dumpsy);
-
- if(wasmenu && !ismenu) {
- save_image_filesel_str(imstr);
- strcat(imstr, " (Menu)");
- activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump);
- wasmenu= 0;
- return;
- }
-
- if(dumprect) MEM_freeN(dumprect);
- dumprect= NULL;
-
- if((G.qual & LR_SHIFTKEY) || fscreen) { /* full screen */
- x= 0;
- y= 0;
-
- dumpsx= G.curscreen->sizex;
- dumpsy= G.curscreen->sizey;
-
- }
- else {
- if(ismenu==0) { /* a window */
- //int win= mywinget();
-
- //bwin_getsuborigin(win, &x, &y);
- //bwin_getsize(win, &dumpsx, &dumpsy);
- x= curarea->totrct.xmin;
- y= curarea->totrct.ymin;
- dumpsx= curarea->totrct.xmax-x;
- dumpsy= curarea->totrct.ymax-y;
- }
- }
-
- if (dumpsx && dumpsy) {
-
- dumprect= MEM_mallocN(sizeof(int)*dumpsx*dumpsy, "dumprect");
- glReadBuffer(GL_FRONT);
- glReadPixels(x, y, dumpsx, dumpsy, GL_RGBA, GL_UNSIGNED_BYTE, dumprect);
- glFinish();
- glReadBuffer(GL_BACK);
-
- if(ismenu==0) {
- wasmenu= 0;
- save_image_filesel_str(imstr);
- activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump);
- }
- else wasmenu= 1;
- }
-
-}
diff --git a/source/blender/src/sculptmode-stroke.c b/source/blender/src/sculptmode-stroke.c
deleted file mode 100644
index 455112343e9..00000000000
--- a/source/blender/src/sculptmode-stroke.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Storage and manipulation of sculptmode brush strokes.
- *
- */
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_listBase.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_sculpt.h"
-#include "BLI_blenlib.h"
-#include "BIF_gl.h"
-
-#include "BDR_sculptmode.h"
-
-#include <math.h>
-
-/* Temporary storage of input stroke control points */
-typedef struct StrokePoint {
- struct StrokePoint *next, *prev;
- short x, y;
-} StrokePoint;
-typedef struct SculptStroke {
- short (*loc)[2];
- int max;
- int index;
- float length;
- ListBase final;
- StrokePoint *final_mem;
- float offset;
-} SculptStroke;
-
-void sculpt_stroke_new(const int max)
-{
- SculptSession *ss = sculpt_session();
-
- ss->stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke");
- ss->stroke->loc = MEM_callocN(sizeof(short) * 4 * max, "SculptStroke.loc");
- ss->stroke->max = max;
- ss->stroke->index = -1;
-}
-
-void sculpt_stroke_free()
-{
- SculptSession *ss = sculpt_session();
- if(ss && ss->stroke) {
- if(ss->stroke->loc) MEM_freeN(ss->stroke->loc);
- if(ss->stroke->final_mem) MEM_freeN(ss->stroke->final_mem);
-
- MEM_freeN(ss->stroke);
- ss->stroke = NULL;
- }
-}
-
-void sculpt_stroke_add_point(const short x, const short y)
-{
- SculptStroke *stroke = sculpt_session()->stroke;
- const int next = stroke->index + 1;
-
- if(stroke->index == -1) {
- stroke->loc[0][0] = x;
- stroke->loc[0][1] = y;
- stroke->index = 0;
- }
- else if(next < stroke->max) {
- const int dx = x - stroke->loc[stroke->index][0];
- const int dy = y - stroke->loc[stroke->index][1];
- stroke->loc[next][0] = x;
- stroke->loc[next][1] = y;
- stroke->length += sqrt(dx*dx + dy*dy);
- stroke->index = next;
- }
-}
-
-void sculpt_stroke_smooth(SculptStroke *stroke)
-{
- /* Apply smoothing (exclude the first and last points)*/
- StrokePoint *p = stroke->final.first;
- if(p && p->next && p->next->next) {
- for(p = p->next->next; p && p->next && p->next->next; p = p->next) {
- p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1;
- p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1;
- }
- }
-}
-
-static void sculpt_stroke_create_final()
-{
- SculptStroke *stroke = sculpt_session()->stroke;
-
- if(stroke) {
- StrokePoint *p, *pnext;
- int i;
-
- /* Copy loc into final */
- if(stroke->final_mem)
- MEM_freeN(stroke->final_mem);
- stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final");
- stroke->final.first = stroke->final.last = NULL;
- for(i = 0; i <= stroke->index; ++i) {
- p = &stroke->final_mem[i];
- p->x = stroke->loc[i][0];
- p->y = stroke->loc[i][1];
- BLI_addtail(&stroke->final, p);
- }
-
- /* Remove shortest edges */
- if(stroke->final.first) {
- for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) {
- const int dx = p->x - p->prev->x;
- const int dy = p->y - p->prev->y;
- const float len = sqrt(dx*dx + dy*dy);
- pnext = p->next;
- if(len < 10) {
- BLI_remlink(&stroke->final, p);
- }
- }
- }
-
- sculpt_stroke_smooth(stroke);
-
- /* Subdivide edges */
- for(p = stroke->final.first; p && p->next; p = pnext) {
- StrokePoint *np = &stroke->final_mem[i++];
-
- pnext = p->next;
- np->x = (p->x + p->next->x) / 2;
- np->y = (p->y + p->next->y) / 2;
- BLI_insertlink(&stroke->final, p, np);
- }
-
- sculpt_stroke_smooth(stroke);
- }
-}
-
-float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2)
-{
- int dx = p2->x - p1->x;
- int dy = p2->y - p1->y;
- return sqrt(dx*dx + dy*dy);
-}
-
-float sculpt_stroke_final_length(SculptStroke *stroke)
-{
- StrokePoint *p;
- float len = 0;
- for(p = stroke->final.first; p && p->next; ++p)
- len += sculpt_stroke_seglen(p, p->next);
- return len;
-}
-
-/* If partial is nonzero, cuts off apply after that length has been processed */
-static StrokePoint *sculpt_stroke_apply_generic(SculptStroke *stroke, struct BrushAction *a, const int partial)
-{
- const int sdspace = sculpt_data()->spacing;
- const short spacing = sdspace > 0 ? sdspace : 2;
- const int dots = sculpt_stroke_final_length(stroke) / spacing;
- int i;
- StrokePoint *p = stroke->final.first;
- float startloc = stroke->offset;
-
- for(i = 0; i < dots && p && p->next; ++i) {
- const float dotloc = spacing * i;
- short co[2];
- float len = sculpt_stroke_seglen(p, p->next);
- float u, v;
-
- /* Find edge containing dot */
- while(dotloc > startloc + len && p && p->next && p->next->next) {
- p = p->next;
- startloc += len;
- len = sculpt_stroke_seglen(p, p->next);
- }
-
- if(!p || !p->next || dotloc > startloc + len)
- break;
-
- if(partial && startloc > partial) {
- /* Calculate offset for next stroke segment */
- stroke->offset = startloc + len - dotloc;
- break;
- }
-
- u = (dotloc - startloc) / len;
- v = 1 - u;
-
- co[0] = p->x*v + p->next->x*u;
- co[1] = p->y*v + p->next->y*u;
-
- do_symmetrical_brush_actions(a, co, NULL);
- }
-
- return p ? p->next : NULL;
-}
-
-void sculpt_stroke_apply(struct BrushAction *a)
-{
- SculptStroke *stroke = sculpt_session()->stroke;
- /* TODO: make these values user-modifiable? */
- const int partial_len = 100;
- const int min_len = 200;
-
- if(stroke) {
- sculpt_stroke_create_final();
-
- if(sculpt_stroke_final_length(stroke) > min_len) {
- StrokePoint *p = sculpt_stroke_apply_generic(stroke, a, partial_len);
-
- /* Replace remaining values in stroke->loc with remaining stroke->final values */
- stroke->index = -1;
- stroke->length = 0;
- for(; p; p = p->next) {
- ++stroke->index;
- stroke->loc[stroke->index][0] = p->x;
- stroke->loc[stroke->index][1] = p->y;
- if(p->next) {
- stroke->length += sculpt_stroke_seglen(p, p->next);
- }
- }
- }
- }
-}
-
-void sculpt_stroke_apply_all(struct BrushAction *a)
-{
- SculptStroke *stroke = sculpt_session()->stroke;
-
- sculpt_stroke_create_final();
-
- if(stroke) {
- sculpt_stroke_apply_generic(stroke, a, 0);
- }
-}
-
-void sculpt_stroke_draw()
-{
- SculptStroke *stroke = sculpt_session()->stroke;
-
- if(stroke) {
- StrokePoint *p;
-
- /* Draws the original stroke */
- /*glColor3f(1, 0, 0);
- glBegin(GL_LINE_STRIP);
- for(i = 0; i <= stroke->index; ++i)
- glVertex2s(stroke->loc[i][0], stroke->loc[i][1]);
- glEnd();*/
-
- /* Draws the smoothed stroke */
- glColor3f(0, 1, 0);
- glBegin(GL_LINE_STRIP);
- for(p = stroke->final.first; p; p = p->next)
- glVertex2s(p->x, p->y);
- glEnd();
- }
-}
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
deleted file mode 100644
index c534a8b3cab..00000000000
--- a/source/blender/src/sculptmode.c
+++ /dev/null
@@ -1,2086 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2006 by Nicholas Bishop
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- * Implements the Sculpt Mode tools
- *
- * BDR_sculptmode.h
- *
- */
-
-#include "GHOST_Types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_dynstr.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_image_types.h"
-#include "DNA_key_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_color_types.h"
-
-#include "BKE_customdata.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_key.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_sculpt.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_colortools.h"
-
-#include "BIF_editkey.h"
-#include "BIF_editview.h"
-#include "BIF_glutil.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_radialcontrol.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_sculptmode.h"
-
-#include "BSE_drawview.h"
-#include "BSE_edit.h"
-#include "BSE_view.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "blendef.h"
-#include "multires.h"
-#include "mydevice.h"
-
-#include "RE_render_ext.h"
-#include "RE_shader_ext.h" /*for multitex_ext*/
-
-#include "GPU_draw.h"
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Number of vertices to average in order to determine the flatten distance */
-#define FLATTEN_SAMPLE_SIZE 10
-
-/* Texture cache size */
-#define TC_SIZE 256
-
-/* ===== STRUCTS =====
- *
- */
-
-/* Used by vertex_users to store face indices in a list */
-typedef struct IndexNode {
- struct IndexNode* next,* prev;
- int Index;
-} IndexNode;
-
-
-/* ActiveData stores an Index into the mvert array of Mesh, plus Fade, which
- stores how far the vertex is from the brush center, scaled to the range [0,1]. */
-typedef struct ActiveData {
- struct ActiveData *next, *prev;
- unsigned int Index;
- float Fade;
- float dist;
-} ActiveData;
-
-typedef struct BrushActionSymm {
- float center_3d[3];
- char index;
-
- float up[3], right[3], out[3];
-
- /* Grab brush */
- float grab_delta[3];
-} BrushActionSymm;
-
-typedef struct BrushAction {
- BrushActionSymm symm;
-
- char firsttime;
-
- /* Some brushes need access to original mesh vertices */
- vec3f *mesh_store;
- short (*orig_norms)[3];
-
- short mouse[2];
- float size_3d;
-
- float prev_radius;
- float radius;
-
- float *layer_disps;
- char flip;
-
- char clip[3];
- float cliptol[3];
-
- float anchored_rot;
-
- /* Grab brush */
- ListBase grab_active_verts[8];
- float depth;
-
- /* Adjust brush strength along each axis
- to adjust for object scaling */
- float scale[3];
-} BrushAction;
-
-typedef struct RectNode {
- struct RectNode *next, *prev;
- rcti r;
-} RectNode;
-
-/* Used to store to 2D screen coordinates of each vertex in the mesh. */
-typedef struct ProjVert {
- short co[2];
-
- /* Used to mark whether a vertex is inside a rough bounding box
- containing the brush. */
- char inside;
-} ProjVert;
-
-static Object *active_ob= NULL;
-
-SculptData *sculpt_data(void)
-{
- return &G.scene->sculptdata;
-}
-
-static void sculpt_init_session(void);
-static void init_brushaction(BrushAction *a, short *, short *);
-static void sculpt_undo_push(const short);
-
-SculptSession *sculpt_session(void)
-{
- if(!sculpt_data()->session)
- sculpt_init_session();
- return sculpt_data()->session;
-}
-
-/* ===== MEMORY =====
- *
- * Allocate/initialize/free data
- */
-
-static void sculpt_init_session(void)
-{
- if(sculpt_data()->session)
- sculptsession_free(G.scene);
- sculpt_data()->session= MEM_callocN(sizeof(SculptSession), "SculptSession");
-}
-
-/* vertex_users is an array of Lists that store all the faces that use a
- particular vertex. vertex_users is in the same order as mesh.mvert */
-static void calc_vertex_users()
-{
- SculptSession *ss= sculpt_session();
- int i,j;
- IndexNode *node= NULL;
- Mesh *me= get_mesh(OBACT);
-
- sculpt_vertexusers_free(ss);
-
- /* For efficiency, use vertex_users_mem as a memory pool (may be larger
- than necessary if mesh has triangles, but only one alloc is needed.) */
- ss->vertex_users= MEM_callocN(sizeof(ListBase) * me->totvert, "vertex_users");
- ss->vertex_users_size= me->totvert;
- ss->vertex_users_mem= MEM_callocN(sizeof(IndexNode)*me->totface*4, "vertex_users_mem");
- node= ss->vertex_users_mem;
-
- /* Find the users */
- for(i=0; i<me->totface; ++i){
- for(j=0; j<(me->mface[i].v4?4:3); ++j, ++node) {
- node->Index=i;
- BLI_addtail(&ss->vertex_users[((unsigned int*)(&me->mface[i]))[j]], node);
- }
- }
-}
-
-/* ===== INTERFACE =====
- */
-
-void sculptmode_rem_tex(void *junk0,void *junk1)
-{
- MTex *mtex= G.scene->sculptdata.mtex[G.scene->sculptdata.texact];
- if(mtex) {
- SculptSession *ss= sculpt_session();
- if(mtex->tex) mtex->tex->id.us--;
- MEM_freeN(mtex);
- G.scene->sculptdata.mtex[G.scene->sculptdata.texact]= NULL;
- /* Clear brush preview */
- if(ss->texcache) {
- MEM_freeN(ss->texcache);
- ss->texcache= NULL;
- }
- BIF_undo_push("Unlink brush texture");
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWOOPS, 0);
- }
-}
-
-/* ===== OPENGL =====
- *
- * Simple functions to get data from the GL
- */
-
-/* Store the modelview and projection matrices and viewport. */
-void init_sculptmatrices()
-{
- SculptSession *ss= sculpt_session();
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glMultMatrixf(OBACT->obmat);
-
- if(!ss->mats)
- ss->mats = MEM_callocN(sizeof(bglMats), "sculpt bglmats");
- bgl_get_mats(ss->mats);
-
- glPopMatrix();
-
-}
-
-/* Uses window coordinates (x,y) to find the depth in the GL depth buffer. If
- available, G.vd->depths is used so that the brush doesn't sculpt on top of
- itself (G.vd->depths is only updated at the end of a brush stroke.) */
-float get_depth(short x, short y)
-{
- float depth;
-
- if(x<0 || y<0) return 1;
- if(x>=curarea->winx || y>=curarea->winy) return 1;
-
- if(G.vd->depths && x<G.vd->depths->w && y<G.vd->depths->h)
- return G.vd->depths->depths[y*G.vd->depths->w+x];
-
- x+= curarea->winrct.xmin;
- y+= curarea->winrct.ymin;
-
- glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
-
- return depth;
-}
-
-/* Uses window coordinates (x,y) and depth component z to find a point in
- modelspace */
-void unproject(float out[3], const short x, const short y, const float z)
-{
- SculptSession *ss= sculpt_session();
- double ux, uy, uz;
-
- gluUnProject(x,y,z, ss->mats->modelview, ss->mats->projection,
- (GLint *)ss->mats->viewport, &ux, &uy, &uz );
- out[0] = ux;
- out[1] = uy;
- out[2] = uz;
-}
-
-/* Convert a point in model coordinates to 2D screen coordinates. */
-static void projectf(const float v[3], float p[2])
-{
- SculptSession *ss= sculpt_session();
- double ux, uy, uz;
-
- gluProject(v[0],v[1],v[2], ss->mats->modelview, ss->mats->projection,
- (GLint *)ss->mats->viewport, &ux, &uy, &uz);
- p[0]= ux;
- p[1]= uy;
-}
-
-static void project(const float v[3], short p[2])
-{
- float f[2];
- projectf(v, f);
-
- p[0]= f[0];
- p[1]= f[1];
-}
-
-/* ===== Sculpting =====
- *
- */
-
-/* Return modified brush size. Uses current tablet pressure (if available) to
- shrink the brush. Skipped for grab brush because only the first mouse down
- size is used, which is small if the user has just touched the pen to the
- tablet */
-char brush_size()
-{
- const BrushData *b= sculptmode_brush();
- float size= b->size;
- float pressure= get_pressure();
- short activedevice= get_activedevice();
-
- if(sculpt_data()->brush_type!=GRAB_BRUSH) {
- const float size_factor= G.scene->sculptdata.tablet_size / 10.0f;
- if(ELEM(activedevice, DEV_STYLUS, DEV_ERASER))
- size*= G.scene->sculptdata.tablet_size==0?1:
- (1-size_factor) + pressure*size_factor;
- }
-
- return size;
-}
-
-/* Return modified brush strength. Includes the direction of the brush, positive
- values pull vertices, negative values push. Uses tablet pressure and a
- special multiplier found experimentally to scale the strength factor. */
-float brush_strength(BrushAction *a)
-{
- const BrushData* b= sculptmode_brush();
- float dir= b->dir==1 ? 1 : -1;
- float pressure= 1;
- short activedevice= get_activedevice();
- float flip= a->flip ? -1:1;
- float anchored = b->flag & SCULPT_BRUSH_ANCHORED ? 25 : 1;
-
- const float strength_factor= G.scene->sculptdata.tablet_strength / 10.0f;
- if(ELEM(activedevice, DEV_STYLUS, DEV_ERASER))
- pressure= G.scene->sculptdata.tablet_strength==0?1:
- (1-strength_factor) + get_pressure()*strength_factor;
-
- /* Flip direction for eraser */
- if(activedevice==DEV_ERASER)
- dir= -dir;
-
- switch(G.scene->sculptdata.brush_type){
- case DRAW_BRUSH:
- case LAYER_BRUSH:
- return b->strength / 5000.0f * dir * pressure * flip * anchored * G.vd->grid;
- case SMOOTH_BRUSH:
- return b->strength / 50.0f * pressure * anchored;
- case PINCH_BRUSH:
- return b->strength / 1000.0f * dir * pressure * flip * anchored;
- case GRAB_BRUSH:
- return 1;
- case INFLATE_BRUSH:
- return b->strength / 5000.0f * dir * pressure * flip * anchored;
- case FLATTEN_BRUSH:
- return b->strength / 500.0f * pressure * anchored;
- default:
- return 0;
- }
-}
-
-/* For clipping against a mirror modifier */
-void sculpt_clip(const BrushAction *a, float *co, const float val[3])
-{
- char i;
- for(i=0; i<3; ++i) {
- if(a->clip[i] && (fabs(co[i]) <= a->cliptol[i]))
- co[i]= 0.0f;
- else
- co[i]= val[i];
- }
-}
-
-void sculpt_axislock(float *co)
-{
- SculptData *sd = sculpt_data();
- if (sd->axislock == AXISLOCK_X+AXISLOCK_Y+AXISLOCK_Z) return;
- if (G.vd->twmode == V3D_MANIP_LOCAL) {
- float mat[3][3], imat[3][3];
- Mat3CpyMat4(mat, OBACT->obmat);
- Mat3Inv(imat, mat);
- Mat3MulVecfl(mat, co);
- if (sd->axislock & AXISLOCK_X) co[0] = 0.0;
- if (sd->axislock & AXISLOCK_Y) co[1] = 0.0;
- if (sd->axislock & AXISLOCK_Z) co[2] = 0.0;
- Mat3MulVecfl(imat, co);
- } else {
- if (sd->axislock & AXISLOCK_X) co[0] = 0.0;
- if (sd->axislock & AXISLOCK_Y) co[1] = 0.0;
- if (sd->axislock & AXISLOCK_Z) co[2] = 0.0;
- }
-}
-
-static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], const short no[3])
-{
- float fno[3] = {no[0], no[1], no[2]};
-
- Normalize(fno);
-
- if((Inpf(view_vec, fno)) > 0) {
- VecAddf(out, out, fno);
- } else {
- VecAddf(out_flip, out_flip, fno); /* out_flip is used when out is {0,0,0} */
- }
-}
-
-/* Currently only for the draw brush; finds average normal for all active
- vertices */
-void calc_area_normal(float out[3], const BrushAction *a, const float *outdir, const ListBase* active_verts)
-{
- Mesh *me = get_mesh(OBACT);
- ActiveData *node = active_verts->first;
- SculptData *sd = sculpt_data();
- const int view = sd->brush_type==DRAW_BRUSH ? sculptmode_brush()->view : 0;
- float out_flip[3];
-
- out[0]=out[1]=out[2] = out_flip[0]=out_flip[1]=out_flip[2] = 0;
-
- if(sculptmode_brush()->flag & SCULPT_BRUSH_ANCHORED) {
- for(; node; node = node->next)
- add_norm_if(((BrushAction*)a)->symm.out, out, out_flip, a->orig_norms[node->Index]);
- }
- else {
- for(; node; node = node->next)
- add_norm_if(((BrushAction*)a)->symm.out, out, out_flip, me->mvert[node->Index].no);
- }
-
- if (out[0]==0.0 && out[1]==0.0 && out[2]==0.0) {
- VECCOPY(out, out_flip);
- }
-
- Normalize(out);
-
- if(outdir) {
- out[0] = outdir[0] * view + out[0] * (10-view);
- out[1] = outdir[1] * view + out[1] * (10-view);
- out[2] = outdir[2] * view + out[2] * (10-view);
- }
-
- Normalize(out);
-}
-
-void do_draw_brush(const BrushAction *a, const ListBase* active_verts)
-{
- Mesh *me= get_mesh(OBACT);
- float area_normal[3];
- ActiveData *node= active_verts->first;
-
- calc_area_normal(area_normal, a, a->symm.out, active_verts);
-
- sculpt_axislock(area_normal);
-
- while(node){
- float *co= me->mvert[node->Index].co;
-
- const float val[3]= {co[0]+area_normal[0]*node->Fade*a->scale[0],
- co[1]+area_normal[1]*node->Fade*a->scale[1],
- co[2]+area_normal[2]*node->Fade*a->scale[2]};
-
- sculpt_clip(a, co, val);
-
- node= node->next;
- }
-}
-
-/* For the smooth brush, uses the neighboring vertices around vert to calculate
- a smoothed location for vert. Skips corner vertices (used by only one
- polygon.) */
-vec3f neighbor_average(const int vert)
-{
- SculptSession *ss= sculpt_session();
- Mesh *me= get_mesh(OBACT);
- int i, skip= -1, total=0;
- IndexNode *node= ss->vertex_users[vert].first;
- vec3f avg= {0,0,0};
- char ncount= BLI_countlist(&ss->vertex_users[vert]);
- MFace *f;
-
- /* Don't modify corner vertices */
- if(ncount==1) {
- VecCopyf(&avg.x, me->mvert[vert].co);
- return avg;
- }
-
- while(node){
- f= &me->mface[node->Index];
-
- if(f->v4) {
- skip= (f->v1==vert?2:
- f->v2==vert?3:
- f->v3==vert?0:
- f->v4==vert?1:-1);
- }
-
- for(i=0; i<(f->v4?4:3); ++i) {
- if(i != skip && (ncount!=2 || BLI_countlist(&ss->vertex_users[(&f->v1)[i]]) <= 2)) {
- VecAddf(&avg.x,&avg.x,me->mvert[(&f->v1)[i]].co);
- ++total;
- }
- }
-
- node= node->next;
- }
-
- if(total>0) {
- avg.x/= total;
- avg.y/= total;
- avg.z/= total;
- }
- else
- VecCopyf(&avg.x, me->mvert[vert].co);
-
- return avg;
-}
-
-void do_smooth_brush(const BrushAction *a, const ListBase* active_verts)
-{
- ActiveData *node= active_verts->first;
- Mesh *me= get_mesh(OBACT);
-
- while(node){
- float *co= me->mvert[node->Index].co;
- const vec3f avg= neighbor_average(node->Index);
- const float val[3]= {co[0]+(avg.x-co[0])*node->Fade,
- co[1]+(avg.y-co[1])*node->Fade,
- co[2]+(avg.z-co[2])*node->Fade};
- sculpt_clip(a, co, val);
- node= node->next;
- }
-}
-
-void do_pinch_brush(const BrushAction *a, const ListBase* active_verts)
-{
- Mesh *me= get_mesh(OBACT);
- ActiveData *node= active_verts->first;
-
- while(node) {
- float *co= me->mvert[node->Index].co;
- const float val[3]= {co[0]+(a->symm.center_3d[0]-co[0])*node->Fade,
- co[1]+(a->symm.center_3d[1]-co[1])*node->Fade,
- co[2]+(a->symm.center_3d[2]-co[2])*node->Fade};
- sculpt_clip(a, co, val);
- node= node->next;
- }
-}
-
-void do_grab_brush(BrushAction *a)
-{
- Mesh *me= get_mesh(OBACT);
- ActiveData *node= a->grab_active_verts[a->symm.index].first;
- float add[3];
- float grab_delta[3];
-
- VecCopyf(grab_delta, a->symm.grab_delta);
- sculpt_axislock(grab_delta);
-
- while(node) {
- float *co= me->mvert[node->Index].co;
-
- VecCopyf(add, grab_delta);
- VecMulf(add, node->Fade);
- VecAddf(add, add, co);
- sculpt_clip(a, co, add);
-
- node= node->next;
- }
-
-}
-
-void do_layer_brush(BrushAction *a, const ListBase *active_verts)
-{
- Mesh *me= get_mesh(OBACT);
- float area_normal[3];
- ActiveData *node= active_verts->first;
- const float bstr= brush_strength(a);
-
- calc_area_normal(area_normal, a, NULL, active_verts);
-
- while(node){
- float *disp= &a->layer_disps[node->Index];
-
- if((bstr > 0 && *disp < bstr) ||
- (bstr < 0 && *disp > bstr)) {
- float *co= me->mvert[node->Index].co;
-
- *disp+= node->Fade;
-
- if(bstr < 0) {
- if(*disp < bstr)
- *disp = bstr;
- } else {
- if(*disp > bstr)
- *disp = bstr;
- }
-
- {
- const float val[3]= {a->mesh_store[node->Index].x+area_normal[0] * *disp*a->scale[0],
- a->mesh_store[node->Index].y+area_normal[1] * *disp*a->scale[1],
- a->mesh_store[node->Index].z+area_normal[2] * *disp*a->scale[2]};
- sculpt_clip(a, co, val);
- }
- }
-
- node= node->next;
- }
-}
-
-void do_inflate_brush(const BrushAction *a, const ListBase *active_verts)
-{
- ActiveData *node= active_verts->first;
- float add[3];
- Mesh *me= get_mesh(OBACT);
-
- while(node) {
- float *co= me->mvert[node->Index].co;
- short *no= me->mvert[node->Index].no;
-
- add[0]= no[0]/ 32767.0f;
- add[1]= no[1]/ 32767.0f;
- add[2]= no[2]/ 32767.0f;
- VecMulf(add, node->Fade);
- add[0]*= a->scale[0];
- add[1]*= a->scale[1];
- add[2]*= a->scale[2];
- VecAddf(add, add, co);
-
- sculpt_clip(a, co, add);
-
- node= node->next;
- }
-}
-
-void calc_flatten_center(Mesh *me, ActiveData *node, float co[3])
-{
- ActiveData *outer[FLATTEN_SAMPLE_SIZE];
- int i;
-
- for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i)
- outer[i] = node;
-
- for(; node; node = node->next) {
- for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) {
- if(node->dist > outer[i]->dist) {
- outer[i] = node;
- break;
- }
- }
- }
-
- co[0] = co[1] = co[2] = 0.0f;
- for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i)
- VecAddf(co, co, me->mvert[outer[i]->Index].co);
- VecMulf(co, 1.0f / FLATTEN_SAMPLE_SIZE);
-}
-
-void do_flatten_brush(const BrushAction *a, const ListBase *active_verts)
-{
- Mesh *me= get_mesh(OBACT);
- ActiveData *node= active_verts->first;
- /* area_normal and cntr define the plane towards which vertices are squashed */
- float area_normal[3];
- float cntr[3];
-
- calc_area_normal(area_normal, a, a->symm.out, active_verts);
- calc_flatten_center(me, node, cntr);
-
- while(node){
- float *co= me->mvert[node->Index].co;
- float p1[3], sub1[3], sub2[3], intr[3], val[3];
-
- /* Find the intersection between squash-plane and vertex (along the area normal) */
- VecSubf(p1, co, area_normal);
- VecSubf(sub1, cntr, p1);
- VecSubf(sub2, co, p1);
- VecSubf(intr, co, p1);
- VecMulf(intr, Inpf(area_normal, sub1) / Inpf(area_normal, sub2));
- VecAddf(intr, intr, p1);
-
- VecSubf(val, intr, co);
- VecMulf(val, node->Fade);
- VecAddf(val, val, co);
-
- sculpt_clip(a, co, val);
-
- node= node->next;
- }
-}
-
-/* Uses the brush curve control to find a strength value between 0 and 1 */
-float curve_strength(float p, const float len)
-{
- if(p > len) p= len;
- return curvemapping_evaluateF(G.scene->sculptdata.cumap, 0, p/len);
-}
-
-/* Uses symm to selectively flip any axis of a coordinate. */
-void flip_coord(float co[3], const char symm)
-{
- if(symm & SYMM_X)
- co[0]= -co[0];
- if(symm & SYMM_Y)
- co[1]= -co[1];
- if(symm & SYMM_Z)
- co[2]= -co[2];
-}
-
-/* Use the warpfac field in MTex to store a rotation value for sculpt textures. Value is in degrees */
-float sculpt_tex_angle(void)
-{
- SculptData *sd= sculpt_data();
- if(sd->texact!=-1 && sd->mtex[sd->texact])
- return sd->mtex[sd->texact]->warpfac;
- return 0;
-}
-
-void set_tex_angle(const float f)
-{
- SculptData *sd = sculpt_data();
- if(sd->texact != -1 && sd->mtex[sd->texact])
- sd->mtex[sd->texact]->warpfac = f;
-}
-
-float to_rad(const float deg)
-{
- return deg * (M_PI/180.0f);
-}
-
-float to_deg(const float rad)
-{
- return rad * (180.0f/M_PI);
-}
-
-/* Get a pixel from the texcache at (px, py) */
-static unsigned char get_texcache_pixel(const SculptSession *ss, int px, int py)
-{
- unsigned *p;
- p = ss->texcache + py * ss->texcache_w + px;
- return ((unsigned char*)(p))[0];
-}
-
-static float get_texcache_pixel_bilinear(const SculptSession *ss, float u, float v)
-{
- int x, y, x2, y2;
- const int tc_max = TC_SIZE - 1;
- float urat, vrat, uopp;
-
- if(u < 0) u = 0;
- else if(u >= TC_SIZE) u = tc_max;
- if(v < 0) v = 0;
- else if(v >= TC_SIZE) v = tc_max;
-
- x = floor(u);
- y = floor(v);
- x2 = x + 1;
- y2 = y + 1;
-
- if(x2 > TC_SIZE) x2 = tc_max;
- if(y2 > TC_SIZE) y2 = tc_max;
-
- urat = u - x;
- vrat = v - y;
- uopp = 1 - urat;
-
- return ((get_texcache_pixel(ss, x, y) * uopp +
- get_texcache_pixel(ss, x2, y) * urat) * (1 - vrat) +
- (get_texcache_pixel(ss, x, y2) * uopp +
- get_texcache_pixel(ss, x2, y2) * urat) * vrat) / 255.0;
-}
-
-/* Return a multiplier for brush strength on a particular vertex. */
-float tex_strength(BrushAction *a, float *point, const float len,const unsigned vindex)
-{
- SculptData *sd= sculpt_data();
- SculptSession *ss= sculpt_session();
- float avg= 1;
-
- if(sd->texact==-1 || !sd->mtex[sd->texact])
- avg= 1;
- else if(sd->texrept==SCULPTREPT_3D) {
- /* Get strength by feeding the vertex location directly
- into a texture */
- float jnk;
- const float factor= 0.01;
- MTex mtex;
- memset(&mtex,0,sizeof(MTex));
- mtex.tex= sd->mtex[sd->texact]->tex;
- mtex.projx= 1;
- mtex.projy= 2;
- mtex.projz= 3;
- VecCopyf(mtex.size, sd->mtex[sd->texact]->size);
- VecMulf(mtex.size, factor);
- if(!sd->texsep)
- mtex.size[1]= mtex.size[2]= mtex.size[0];
-
- externtex(&mtex,point,&avg,&jnk,&jnk,&jnk,&jnk);
- }
- else if(ss->texcache) {
- const float bsize= a->radius * 2;
- const float rot= to_rad(sculpt_tex_angle()) + a->anchored_rot;
- int px, py;
- float flip[3], point_2d[2];
-
- /* If the active area is being applied for symmetry, flip it
- across the symmetry axis in order to project it. This insures
- that the brush texture will be oriented correctly. */
- VecCopyf(flip, point);
- flip_coord(flip, a->symm.index);
- projectf(flip, point_2d);
-
- /* For Tile and Drag modes, get the 2D screen coordinates of the
- and scale them up or down to the texture size. */
- if(sd->texrept==SCULPTREPT_TILE) {
- const int sx= (const int)sd->mtex[sd->texact]->size[0];
- const int sy= (const int)sd->texsep ? sd->mtex[sd->texact]->size[1] : sx;
-
- float fx= point_2d[0];
- float fy= point_2d[1];
-
- float angle= atan2(fy, fx) - rot;
- float flen= sqrtf(fx*fx + fy*fy);
-
- if(rot<0.001 && rot>-0.001) {
- px= point_2d[0];
- py= point_2d[1];
- } else {
- px= flen * cos(angle) + 2000;
- py= flen * sin(angle) + 2000;
- }
- if(sx != 1)
- px %= sx-1;
- if(sy != 1)
- py %= sy-1;
- avg= get_texcache_pixel_bilinear(ss, TC_SIZE*px/sx, TC_SIZE*py/sy);
- } else {
- float fx= (point_2d[0] - a->mouse[0]) / bsize;
- float fy= (point_2d[1] - a->mouse[1]) / bsize;
-
- float angle= atan2(fy, fx) - rot;
- float flen= sqrtf(fx*fx + fy*fy);
-
- fx = flen * cos(angle) + 0.5;
- fy = flen * sin(angle) + 0.5;
-
- avg= get_texcache_pixel_bilinear(ss, fx * TC_SIZE, fy * TC_SIZE);
- }
- }
-
- if(sd->texfade)
- avg*= curve_strength(len, a->size_3d); /* Smooth curve */
-
- return avg;
-}
-
-/* Mark area around the brush as damaged. projverts are marked if they are
- inside the area and the damaged rectangle in 2D screen coordinates is
- added to damaged_rects. */
-void sculpt_add_damaged_rect(BrushAction *a)
-{
- short p[2];
- RectNode *rn= MEM_mallocN(sizeof(RectNode),"RectNode");
- Mesh *me= get_mesh(OBACT);
- SculptSession *ss = sculpt_session();
- const float radius = a->radius > a->prev_radius ? a->radius : a->prev_radius;
- unsigned i;
-
- /* Find center */
- project(a->symm.center_3d, p);
- rn->r.xmin= p[0] - radius;
- rn->r.ymin= p[1] - radius;
- rn->r.xmax= p[0] + radius;
- rn->r.ymax= p[1] + radius;
-
- BLI_addtail(&sculpt_session()->damaged_rects, rn);
-
- /* Update insides */
- for(i=0; i<me->totvert; ++i) {
- if(!ss->projverts[i].inside) {
- if(ss->projverts[i].co[0] > rn->r.xmin && ss->projverts[i].co[1] > rn->r.ymin &&
- ss->projverts[i].co[0] < rn->r.xmax && ss->projverts[i].co[1] < rn->r.ymax) {
- ss->projverts[i].inside= 1;
- }
- }
- }
-}
-
-/* Clears the depth buffer in each modified area. */
-void sculpt_clear_damaged_areas(SculptSession *ss)
-{
- RectNode *rn= NULL;
-
- for(rn = ss->damaged_rects.first; rn; rn = rn->next) {
- rcti clp = rn->r;
- rcti *win = &curarea->winrct;
-
- clp.xmin += win->xmin;
- clp.xmax += win->xmin;
- clp.ymin += win->ymin;
- clp.ymax += win->ymin;
-
- if(clp.xmin < win->xmax && clp.xmax > win->xmin &&
- clp.ymin < win->ymax && clp.ymax > win->ymin) {
- if(clp.xmin < win->xmin) clp.xmin = win->xmin;
- if(clp.ymin < win->ymin) clp.ymin = win->ymin;
- if(clp.xmax > win->xmax) clp.xmax = win->xmax;
- if(clp.ymax > win->ymax) clp.ymax = win->ymax;
-
- glScissor(clp.xmin + 1, clp.ymin + 1,
- clp.xmax - clp.xmin - 2,
- clp.ymax - clp.ymin - 2);
- }
-
- glClear(GL_DEPTH_BUFFER_BIT);
- }
-}
-
-void do_brush_action(BrushAction *a)
-{
- int i;
- float av_dist;
- ListBase active_verts={0,0};
- ActiveData *adata= 0;
- float *vert;
- Mesh *me= get_mesh(OBACT);
- const float bstrength= brush_strength(a);
- KeyBlock *keyblock= ob_get_keyblock(OBACT);
- SculptData *sd = sculpt_data();
- SculptSession *ss = sculpt_session();
-
- sculpt_add_damaged_rect(a);
-
- /* Build a list of all vertices that are potentially within the brush's
- area of influence. Only do this once for the grab brush. */
- if((sd->brush_type != GRAB_BRUSH) || a->firsttime) {
- for(i=0; i<me->totvert; ++i) {
- /* Projverts.inside provides a rough bounding box */
- if(ss->projverts[i].inside) {
- vert= ss->vertexcosnos ? &ss->vertexcosnos[i*6] : me->mvert[i].co;
- av_dist= VecLenf(a->symm.center_3d, vert);
- if(av_dist < a->size_3d) {
- adata= (ActiveData*)MEM_mallocN(sizeof(ActiveData), "ActiveData");
-
- adata->Index = i;
- /* Fade is used to store the final strength at which the brush
- should modify a particular vertex. */
- adata->Fade= tex_strength(a, vert, av_dist, i) * bstrength;
- adata->dist = av_dist;
-
- if(sd->brush_type == GRAB_BRUSH && a->firsttime)
- BLI_addtail(&a->grab_active_verts[a->symm.index], adata);
- else
- BLI_addtail(&active_verts, adata);
- }
- }
- }
- }
-
- /* Only act if some verts are inside the brush area */
- if(active_verts.first || (sd->brush_type == GRAB_BRUSH && a->grab_active_verts[a->symm.index].first)) {
- /* Apply one type of brush action */
- switch(G.scene->sculptdata.brush_type){
- case DRAW_BRUSH:
- do_draw_brush(a, &active_verts);
- break;
- case SMOOTH_BRUSH:
- do_smooth_brush(a, &active_verts);
- break;
- case PINCH_BRUSH:
- do_pinch_brush(a, &active_verts);
- break;
- case INFLATE_BRUSH:
- do_inflate_brush(a, &active_verts);
- break;
- case GRAB_BRUSH:
- do_grab_brush(a);
- break;
- case LAYER_BRUSH:
- do_layer_brush(a, &active_verts);
- break;
- case FLATTEN_BRUSH:
- do_flatten_brush(a, &active_verts);
- break;
- }
-
- /* Copy the modified vertices from mesh to the active key */
- if(keyblock) {
- float *co= keyblock->data;
- if(co) {
- if(sd->brush_type == GRAB_BRUSH)
- adata = a->grab_active_verts[a->symm.index].first;
- else
- adata = active_verts.first;
-
- for(; adata; adata= adata->next)
- if(adata->Index < keyblock->totelem)
- VecCopyf(&co[adata->Index*3], me->mvert[adata->Index].co);
- }
- }
-
- if(ss->vertexcosnos)
- BLI_freelistN(&active_verts);
- else {
- if(sd->brush_type != GRAB_BRUSH)
- addlisttolist(&ss->damaged_verts, &active_verts);
- }
- }
-}
-
-/* Flip all the editdata across the axis/axes specified by symm. Used to
- calculate multiple modifications to the mesh when symmetry is enabled. */
-void calc_brushdata_symm(BrushAction *a, const char symm)
-{
- flip_coord(a->symm.center_3d, symm);
- flip_coord(a->symm.up, symm);
- flip_coord(a->symm.right, symm);
- flip_coord(a->symm.out, symm);
-
- a->symm.index= symm;
-
- flip_coord(a->symm.grab_delta, symm);
-}
-
-void do_symmetrical_brush_actions(BrushAction *a, short co[2], short pr_co[2])
-{
- const char symm = sculpt_data()->symm;
- BrushActionSymm orig;
- int i;
-
- init_brushaction(a, co, pr_co);
- orig = a->symm;
- do_brush_action(a);
-
- for(i = 1; i <= symm; ++i) {
- if(symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5))) {
- // Restore the original symmetry data
- a->symm = orig;
-
- calc_brushdata_symm(a, i);
- do_brush_action(a);
- }
- }
-
- a->symm = orig;
-}
-
-void add_face_normal(vec3f *norm, const MFace* face)
-{
- Mesh *me= get_mesh(OBACT);
-
- vec3f c= {me->mvert[face->v1].co[0],me->mvert[face->v1].co[1],me->mvert[face->v1].co[2]};
- vec3f b= {me->mvert[face->v2].co[0],me->mvert[face->v2].co[1],me->mvert[face->v2].co[2]};
- vec3f a= {me->mvert[face->v3].co[0],me->mvert[face->v3].co[1],me->mvert[face->v3].co[2]};
- vec3f s1, s2;
-
- VecSubf(&s1.x,&a.x,&b.x);
- VecSubf(&s2.x,&c.x,&b.x);
-
- norm->x+= s1.y * s2.z - s1.z * s2.y;
- norm->y+= s1.z * s2.x - s1.x * s2.z;
- norm->z+= s1.x * s2.y - s1.y * s2.x;
-}
-
-void update_damaged_vert(Mesh *me, ListBase *lb)
-{
- ActiveData *vert;
-
- for(vert= lb->first; vert; vert= vert->next) {
- vec3f norm= {0,0,0};
- IndexNode *face= sculpt_session()->vertex_users[vert->Index].first;
-
- while(face){
- add_face_normal(&norm,&me->mface[face->Index]);
- face= face->next;
- }
- Normalize(&norm.x);
-
- me->mvert[vert->Index].no[0]=norm.x*32767;
- me->mvert[vert->Index].no[1]=norm.y*32767;
- me->mvert[vert->Index].no[2]=norm.z*32767;
- }
-}
-
-void calc_damaged_verts(ListBase *damaged_verts, BrushAction *a)
-{
- Mesh *me= get_mesh(OBACT);
- int i;
-
- for(i=0; i<8; ++i)
- update_damaged_vert(me, &a->grab_active_verts[i]);
-
- update_damaged_vert(me, damaged_verts);
- BLI_freelistN(damaged_verts);
- damaged_verts->first = damaged_verts->last = NULL;
-}
-
-void projverts_clear_inside(SculptSession *ss)
-{
- Mesh *me = get_mesh(OBACT);
- if(me) {
- int i;
- for(i = 0; i < me->totvert; ++i)
- ss->projverts[i].inside = 0;
- }
-}
-
-BrushData *sculptmode_brush(void)
-{
- SculptData *sd= &G.scene->sculptdata;
-
- BrushData *bd =
- (sd->brush_type==DRAW_BRUSH ? &sd->drawbrush :
- sd->brush_type==SMOOTH_BRUSH ? &sd->smoothbrush :
- sd->brush_type==PINCH_BRUSH ? &sd->pinchbrush :
- sd->brush_type==INFLATE_BRUSH ? &sd->inflatebrush :
- sd->brush_type==GRAB_BRUSH ? &sd->grabbrush :
- sd->brush_type==LAYER_BRUSH ? &sd->layerbrush :
- sd->brush_type==FLATTEN_BRUSH ? &sd->flattenbrush : NULL);
-
- if(!bd) {
- sculptdata_init(G.scene);
- bd = &sd->drawbrush;
- }
-
- return bd;
-}
-
-void sculptmode_update_tex()
-{
- SculptData *sd= sculpt_data();
- SculptSession *ss= sculpt_session();
- MTex *mtex = sd->mtex[sd->texact];
- TexResult texres = {0};
- float x, y, step=2.0/TC_SIZE, co[3];
- int hasrgb, ix, iy;
-
- /* Skip Default brush shape and non-textures */
- if(sd->texact == -1 || !sd->mtex[sd->texact]) return;
-
- if(ss->texcache) {
- MEM_freeN(ss->texcache);
- ss->texcache= NULL;
- }
-
- ss->texcache_w = ss->texcache_h = TC_SIZE;
- ss->texcache = MEM_callocN(sizeof(int) * ss->texcache_w * ss->texcache_h, "Sculpt Texture cache");
-
- if(mtex && mtex->tex) {
- BKE_image_get_ibuf(sd->mtex[sd->texact]->tex->ima, NULL);
-
- /*do normalized cannonical view coords for texture*/
- for (y=-1.0, iy=0; iy<TC_SIZE; iy++, y += step) {
- for (x=-1.0, ix=0; ix<TC_SIZE; ix++, x += step) {
- co[0]= x;
- co[1]= y;
- co[2]= 0.0f;
-
- /* This is copied from displace modifier code */
- hasrgb = multitex_ext(mtex->tex, co, NULL, NULL, 1, &texres);
-
- /* if the texture gave an RGB value, we assume it didn't give a valid
- * intensity, so calculate one (formula from do_material_tex).
- * if the texture didn't give an RGB value, copy the intensity across
- */
- if(hasrgb & TEX_RGB)
- texres.tin = (0.35 * texres.tr + 0.45 *
- texres.tg + 0.2 * texres.tb);
-
- texres.tin = texres.tin * 255.0;
- ((char*)ss->texcache)[(iy*TC_SIZE+ix)*4] = (char)texres.tin;
- ((char*)ss->texcache)[(iy*TC_SIZE+ix)*4+1] = (char)texres.tin;
- ((char*)ss->texcache)[(iy*TC_SIZE+ix)*4+2] = (char)texres.tin;
- ((char*)ss->texcache)[(iy*TC_SIZE+ix)*4+3] = (char)texres.tin;
- }
- }
- }
-}
-
-/* pr_mouse is only used for the grab brush, can be NULL otherwise */
-static void init_brushaction(BrushAction *a, short *mouse, short *pr_mouse)
-{
- SculptData *sd = sculpt_data();
- const float mouse_depth = get_depth(mouse[0], mouse[1]);
- float brush_edge_loc[3], zero_loc[3], oldloc[3];
- ModifierData *md;
- int i;
- const char flip = (get_qual() == LR_SHIFTKEY);
- const char anchored = sculptmode_brush()->flag & SCULPT_BRUSH_ANCHORED;
- short orig_mouse[2], dx=0, dy=0;
-
- a->flip = flip;
- a->symm.index = 0;
-
- if(a->firsttime)
- a->depth = mouse_depth;
-
- /* Convert the location and size of the brush to
- modelspace coords */
- if(a->firsttime || !anchored) {
- unproject(a->symm.center_3d, mouse[0], mouse[1], mouse_depth);
- a->mouse[0] = mouse[0];
- a->mouse[1] = mouse[1];
- }
-
- if(anchored) {
- project(a->symm.center_3d, orig_mouse);
- dx = mouse[0] - orig_mouse[0];
- dy = mouse[1] - orig_mouse[1];
- }
-
- if(anchored) {
- unproject(brush_edge_loc, mouse[0], mouse[1], a->depth);
- a->anchored_rot = atan2(dy, dx);
- }
- else
- unproject(brush_edge_loc, mouse[0] + brush_size(), mouse[1], mouse_depth);
-
- a->size_3d = VecLenf(a->symm.center_3d, brush_edge_loc);
-
- a->prev_radius = a->radius;
-
- if(anchored)
- a->radius = sqrt(dx*dx + dy*dy);
- else
- a->radius = brush_size();
-
- /* Set the pivot to allow the model to rotate around the center of the brush */
- if(get_depth(mouse[0],mouse[1]) < 1.0)
- VecCopyf(sd->pivot, a->symm.center_3d);
-
- /* Now project the Up, Right, and Out normals from view to model coords */
- unproject(zero_loc, 0, 0, 0);
- unproject(a->symm.up, 0, -1, 0);
- unproject(a->symm.right, 1, 0, 0);
- unproject(a->symm.out, 0, 0, -1);
- VecSubf(a->symm.up, a->symm.up, zero_loc);
- VecSubf(a->symm.right, a->symm.right, zero_loc);
- VecSubf(a->symm.out, a->symm.out, zero_loc);
- Normalize(a->symm.up);
- Normalize(a->symm.right);
- Normalize(a->symm.out);
-
- /* Initialize mirror modifier clipping */
- for(i=0; i<3; ++i) {
- a->clip[i]= 0;
- a->cliptol[i]= 0;
- }
- for(md= OBACT->modifiers.first; md; md= md->next) {
- if(md->type==eModifierType_Mirror && (md->mode & eModifierMode_Realtime)) {
- const MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- a->clip[mmd->axis]= 1;
- if(mmd->tolerance > a->cliptol[mmd->axis])
- a->cliptol[mmd->axis] = mmd->tolerance;
- }
- }
- }
-
- if(sd->brush_type == GRAB_BRUSH) {
- float gcenter[3];
-
- /* Find the delta */
- unproject(gcenter, mouse[0], mouse[1], a->depth);
- unproject(oldloc, pr_mouse[0], pr_mouse[1], a->depth);
- VecSubf(a->symm.grab_delta, gcenter, oldloc);
- }
- else if(sd->brush_type == LAYER_BRUSH) {
- Mesh *me= get_mesh(OBACT);
-
- if(!a->layer_disps)
- a->layer_disps= MEM_callocN(sizeof(float)*me->totvert,"Layer disps");
- }
-
- if(sd->brush_type == LAYER_BRUSH || anchored) {
- Mesh *me= get_mesh(OBACT);
- unsigned i;
-
- if(!a->mesh_store) {
- a->mesh_store= MEM_mallocN(sizeof(vec3f) * me->totvert, "Sculpt mesh store");
- for(i = 0; i < me->totvert; ++i)
- VecCopyf(&a->mesh_store[i].x, me->mvert[i].co);
- }
-
- if(anchored && a->layer_disps)
- memset(a->layer_disps, 0, sizeof(float) * me->totvert);
-
- if(anchored && !a->orig_norms) {
- a->orig_norms= MEM_mallocN(sizeof(short) * 3 * me->totvert, "Sculpt orig norm");
- for(i = 0; i < me->totvert; ++i) {
- a->orig_norms[i][0] = me->mvert[i].no[0];
- a->orig_norms[i][1] = me->mvert[i].no[1];
- a->orig_norms[i][2] = me->mvert[i].no[2];
- }
- }
- }
-}
-void sculptmode_set_strength(const int delta)
-{
- int val = sculptmode_brush()->strength + delta;
- if(val < 1) val = 1;
- if(val > 100) val = 100;
- sculptmode_brush()->strength= val;
-}
-
-static void sculpt_radialcontrol_callback(const int mode, const int val)
-{
- SculptSession *ss = sculpt_session();
- BrushData *br = sculptmode_brush();
-
- if(mode == RADIALCONTROL_SIZE)
- br->size = val;
- else if(mode == RADIALCONTROL_STRENGTH)
- br->strength = val;
- else if(mode == RADIALCONTROL_ROTATION)
- set_tex_angle(val);
-
- ss->radialcontrol = NULL;
-}
-
-/* Returns GL handle to brush texture */
-static GLuint sculpt_radialcontrol_calctex()
-{
- SculptData *sd= sculpt_data();
- SculptSession *ss= sculpt_session();
- int i, j;
- const int tsz = TC_SIZE;
- float *texdata= MEM_mallocN(sizeof(float)*tsz*tsz, "Brush preview");
- GLuint tex;
-
- if(sd->texrept!=SCULPTREPT_3D)
- sculptmode_update_tex();
- for(i=0; i<tsz; ++i)
- for(j=0; j<tsz; ++j) {
- float magn= sqrt(pow(i-tsz/2,2)+pow(j-tsz/2,2));
- if(sd->texfade)
- texdata[i*tsz+j]= curve_strength(magn,tsz/2);
- else
- texdata[i*tsz+j]= magn < tsz/2 ? 1 : 0;
- }
- if(sd->texact != -1 && ss->texcache) {
- for(i=0; i<tsz; ++i)
- for(j=0; j<tsz; ++j) {
- const int col= ss->texcache[i*tsz+j];
- texdata[i*tsz+j]*= (((char*)&col)[0]+((char*)&col)[1]+((char*)&col)[2])/3.0f/255.0f;
- }
- }
-
- glGenTextures(1, &tex);
- glBindTexture(GL_TEXTURE_2D, tex);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, tsz, tsz, 0, GL_ALPHA, GL_FLOAT, texdata);
- MEM_freeN(texdata);
-
- return tex;
-}
-
-void sculpt_radialcontrol_start(int mode)
-{
- SculptData *sd = sculpt_data();
- SculptSession *ss = sculpt_session();
- BrushData *br = sculptmode_brush();
- int orig=1, max=100;
-
- if(mode == RADIALCONTROL_SIZE) {
- orig = br->size;
- max = 200;
- }
- else if(mode == RADIALCONTROL_STRENGTH) {
- orig = br->strength;
- max = 100;
- }
- else if(mode == RADIALCONTROL_ROTATION) {
- if(sd->texact!=-1 && sd->mtex[sd->texact]) {
- orig = sculpt_tex_angle();
- max = 360;
- }
- else
- mode = RADIALCONTROL_NONE;
- }
-
- if(mode != RADIALCONTROL_NONE) {
- ss->radialcontrol= radialcontrol_start(mode, sculpt_radialcontrol_callback, orig, max,
- sculpt_radialcontrol_calctex());
- }
-}
-
-void sculpt_paint_brush(char clear)
-{
- if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
- static short mvalo[2];
- short mval[2];
- const short rad= sculptmode_brush()->size;
-
- getmouseco_areawin(mval);
-
- persp(PERSP_WIN);
- if(clear)
- fdrawXORcirc(mval[0], mval[1], rad);
- else
- draw_sel_circle(mval, mvalo, rad, rad, 0);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
-}
-
-void sculptmode_selectbrush_menu(void)
-{
- SculptData *sd= sculpt_data();
- int val;
-
- pupmenu_set_active(sd->brush_type);
-
- val= pupmenu("Select Brush%t|Draw|Smooth|Pinch|Inflate|Grab|Layer|Flatten");
-
- if(val>0) {
- sd->brush_type= val;
-
- BIF_undo_push("Brush type");
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 1);
- }
-}
-
-void sculptmode_update_all_projverts(float *vertcosnos)
-{
- SculptSession *ss = sculpt_session();
- Mesh *me= get_mesh(OBACT);
- unsigned i;
-
- if(!ss->projverts)
- ss->projverts = MEM_mallocN(sizeof(ProjVert)*me->totvert,"ProjVerts");
-
- for(i=0; i<me->totvert; ++i) {
- project(vertcosnos ? &vertcosnos[i * 6] : me->mvert[i].co, ss->projverts[i].co);
- ss->projverts[i].inside= 0;
- }
-}
-
-void sculptmode_draw_wires(SculptSession *ss, int only_damaged, Mesh *me)
-{
- int i;
-
- bglPolygonOffset(1.0);
- glDepthMask(0);
- BIF_ThemeColor((OBACT==OBACT)?TH_ACTIVE:TH_SELECT);
-
- for(i=0; i<me->totedge; i++) {
- MEdge *med= &me->medge[i];
-
- if((!only_damaged || (ss->projverts[med->v1].inside || ss->projverts[med->v2].inside)) &&
- (med->flag & ME_EDGEDRAW)) {
- glDrawElements(GL_LINES, 2, GL_UNSIGNED_INT, &med->v1);
- }
- }
-
- glDepthMask(1);
- bglPolygonOffset(0.0);
-}
-
-void sculptmode_draw_mesh(int only_damaged)
-{
- Mesh *me= get_mesh(OBACT);
- int i, j, dt, drawCurrentMat = 1, matnr= -1;
- SculptSession *ss = sculpt_session();
-
- persp(PERSP_VIEW);
- mymultmatrix(OBACT->obmat);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- GPU_set_object_materials(G.scene, OBACT, 0, NULL);
- glEnable(GL_CULL_FACE);
-
- glShadeModel(GL_SMOOTH);
-
- glVertexPointer(3, GL_FLOAT, sizeof(MVert), &me->mvert[0].co);
- glNormalPointer(GL_SHORT, sizeof(MVert), &me->mvert[0].no);
-
- dt= MIN2(G.vd->drawtype, OBACT->dt);
- if(dt==OB_WIRE)
- glColorMask(0,0,0,0);
-
- for(i=0; i<me->totface; ++i) {
- MFace *f= &me->mface[i];
- char inside= 0;
- int new_matnr= f->mat_nr + 1;
-
- if(new_matnr != matnr)
- drawCurrentMat= GPU_enable_material(matnr = new_matnr, NULL);
-
- /* If only_damaged!=0, only draw faces that are partially
- inside the area(s) modified by the brush */
- if(only_damaged) {
- for(j=0; j<(f->v4?4:3); ++j) {
- if(ss->projverts[*((&f->v1)+j)].inside) {
- inside= 1;
- break;
- }
- }
- }
- else
- inside= 1;
-
- if(inside && drawCurrentMat)
- glDrawElements(f->v4?GL_QUADS:GL_TRIANGLES, f->v4?4:3, GL_UNSIGNED_INT, &f->v1);
- }
-
- glDisable(GL_CULL_FACE);
- glDisable(GL_LIGHTING);
- glColorMask(1,1,1,1);
-
- if(dt==OB_WIRE || (OBACT->dtx & OB_DRAWWIRE))
- sculptmode_draw_wires(ss, only_damaged, me);
-
- glDisable(GL_DEPTH_TEST);
-}
-
-void sculptmode_correct_state(void)
-{
- if(!sculpt_session())
- sculpt_init_session();
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- if(!sculpt_session()->vertex_users) calc_vertex_users();
-}
-
-/* Checks whether full update mode (slower) needs to be used to work with modifiers */
-char sculpt_modifiers_active(Object *ob)
-{
- ModifierData *md;
-
- for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
- if(md->mode & eModifierMode_Realtime)
- return 1;
- }
-
- return 0;
-}
-
-void sculpt(void)
-{
- SculptData *sd= sculpt_data();
- SculptSession *ss= sculpt_session();
- Object *ob= OBACT;
- /* lastSigMouse is for the rake, to store the last place the mouse movement was significant */
- short mouse[2], mvalo[2], lastSigMouse[2],firsttime=1, mousebut;
- short modifier_calculations= 0;
- BrushAction *a = MEM_callocN(sizeof(BrushAction), "brush action");
- short spacing= 32000;
- int scissor_box[4];
- float offsetRot;
- int smooth_stroke = 0, i;
- int anchored;
-
- if(!(G.f & G_SCULPTMODE) || G.obedit || !ob || ob->id.lib || !get_mesh(ob) || (get_mesh(ob)->totface == 0))
- return;
- if(!(ob->lay & G.vd->lay))
- error("Active object is not in this layer");
- if(ob_get_keyblock(ob)) {
- if(!(ob->shapeflag & OB_SHAPE_LOCK)) {
- error("Cannot sculpt on unlocked shape key");
- return;
- }
- }
-
- if(!ss) {
- sculpt_init_session();
- ss= sd->session;
- }
-
- anchored = sculptmode_brush()->flag & SCULPT_BRUSH_ANCHORED;
- smooth_stroke = (sd->flags & SCULPT_INPUT_SMOOTH) && (sd->brush_type != GRAB_BRUSH) && !anchored;
-
- if(smooth_stroke)
- sculpt_stroke_new(256);
-
- ss->damaged_rects.first = ss->damaged_rects.last = NULL;
- ss->damaged_verts.first = ss->damaged_verts.last = NULL;
- ss->vertexcosnos = NULL;
-
- /* Check that vertex users are up-to-date */
- if(ob != active_ob || !ss->vertex_users || ss->vertex_users_size != get_mesh(ob)->totvert) {
- sculpt_vertexusers_free(ss);
- calc_vertex_users();
- if(ss->projverts)
- MEM_freeN(ss->projverts);
- ss->projverts = NULL;
- active_ob= ob;
- }
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- persp(PERSP_VIEW);
-
- getmouseco_areawin(mvalo);
-
- /* Init texture
- FIXME: Shouldn't be doing this every time! */
- if(sd->texrept!=SCULPTREPT_3D)
- sculptmode_update_tex();
-
- getmouseco_areawin(mouse);
- mvalo[0]= mouse[0];
- mvalo[1]= mouse[1];
- lastSigMouse[0]=mouse[0];
- lastSigMouse[1]=mouse[1];
- mousebut = L_MOUSE;
-
- /* If modifier_calculations is true, then extra time must be spent
- updating the mesh. This takes a *lot* longer, so it's worth
- skipping if the modifier stack is empty. */
- modifier_calculations= sculpt_modifiers_active(ob);
-
- init_sculptmatrices();
-
- if(modifier_calculations)
- ss->vertexcosnos= mesh_get_mapped_verts_nors(ob);
- sculptmode_update_all_projverts(ss->vertexcosnos);
-
- /* Set scaling adjustment */
- a->scale[0]= 1.0f / ob->size[0];
- a->scale[1]= 1.0f / ob->size[1];
- a->scale[2]= 1.0f / ob->size[2];
-
- /* Capture original copy */
- if(sd->flags & SCULPT_DRAW_FAST)
- glAccum(GL_LOAD, 1);
-
- /* Get original scissor box */
- glGetIntegerv(GL_SCISSOR_BOX, scissor_box);
-
- /* For raking, get the original angle*/
- offsetRot=sculpt_tex_angle();
-
- while (get_mbut() & mousebut) {
- getmouseco_areawin(mouse);
- /* If rake, and the mouse has moved over 10 pixels (euclidean) (prevents jitter) then get the new angle */
- if (sd->rake && (pow(lastSigMouse[0]-mouse[0],2)+pow(lastSigMouse[1]-mouse[1],2))>100){
- /*Nasty looking, but just orig + new angle really*/
- set_tex_angle(offsetRot+180.+to_deg(atan2((float)(mouse[1]-lastSigMouse[1]),(float)(mouse[0]-lastSigMouse[0]))));
- lastSigMouse[0]=mouse[0];
- lastSigMouse[1]=mouse[1];
- }
-
- if(firsttime || mouse[0]!=mvalo[0] || mouse[1]!=mvalo[1] ||
- sculptmode_brush()->flag & SCULPT_BRUSH_AIRBRUSH) {
- a->firsttime = firsttime;
- firsttime= 0;
-
- if(smooth_stroke)
- sculpt_stroke_add_point(mouse[0], mouse[1]);
-
- spacing+= sqrt(pow(mvalo[0]-mouse[0],2)+pow(mvalo[1]-mouse[1],2));
-
- if(modifier_calculations && !ss->vertexcosnos)
- ss->vertexcosnos= mesh_get_mapped_verts_nors(ob);
-
- if(G.scene->sculptdata.brush_type != GRAB_BRUSH) {
- if(anchored) {
- Mesh *me = get_mesh(ob);
-
- /* Restore the mesh before continuing with anchored stroke */
- if(a->mesh_store) {
- for(i = 0; i < me->totvert; ++i) {
- VecCopyf(me->mvert[i].co, &a->mesh_store[i].x);
- me->mvert[i].no[0] = a->orig_norms[i][0];
- me->mvert[i].no[1] = a->orig_norms[i][1];
- me->mvert[i].no[2] = a->orig_norms[i][2];
- }
- }
-
- do_symmetrical_brush_actions(a, mouse, NULL);
- }
- else {
- if(smooth_stroke) {
- sculpt_stroke_apply(a);
- }
- else if(sd->spacing==0 || spacing>sd->spacing) {
- do_symmetrical_brush_actions(a, mouse, NULL);
- spacing= 0;
- }
- }
- }
- else {
- do_symmetrical_brush_actions(a, mouse, mvalo);
- unproject(sd->pivot, mouse[0], mouse[1], a->depth);
- }
-
- if(modifier_calculations || ob_get_keyblock(ob))
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if(modifier_calculations || sd->brush_type == GRAB_BRUSH || !(sd->flags & SCULPT_DRAW_FAST)) {
- calc_damaged_verts(&ss->damaged_verts, a);
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- } else { /* Optimized drawing */
- calc_damaged_verts(&ss->damaged_verts, a);
-
- /* Draw the stored image to the screen */
- glAccum(GL_RETURN, 1);
-
- sculpt_clear_damaged_areas(ss);
-
- /* Draw all the polygons that are inside the modified area(s) */
- glScissor(scissor_box[0], scissor_box[1], scissor_box[2], scissor_box[3]);
- sculptmode_draw_mesh(1);
- glAccum(GL_LOAD, 1);
-
- projverts_clear_inside(ss);
-
- persp(PERSP_WIN);
- glDisable(GL_DEPTH_TEST);
-
- /* Draw cursor */
- if(sculpt_data()->flags & SCULPT_DRAW_BRUSH)
- fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()->size);
- if(smooth_stroke)
- sculpt_stroke_draw();
-
- myswapbuffers();
- }
-
- BLI_freelistN(&ss->damaged_rects);
- ss->damaged_rects.first = ss->damaged_rects.last = NULL;
-
- mvalo[0]= mouse[0];
- mvalo[1]= mouse[1];
-
- if(ss->vertexcosnos) {
- MEM_freeN(ss->vertexcosnos);
- ss->vertexcosnos= NULL;
- }
-
- }
- else BIF_wait_for_statechange();
- }
-
- /* Set the rotation of the brush back to what it was before any rake */
- set_tex_angle(offsetRot);
-
- if(smooth_stroke) {
- sculpt_stroke_apply_all(a);
- calc_damaged_verts(&ss->damaged_verts, a);
- BLI_freelistN(&ss->damaged_rects);
- }
-
- if(a->layer_disps) MEM_freeN(a->layer_disps);
- if(a->mesh_store) MEM_freeN(a->mesh_store);
- if(a->orig_norms) MEM_freeN(a->orig_norms);
- for(i=0; i<8; ++i)
- BLI_freelistN(&a->grab_active_verts[i]);
- MEM_freeN(a);
- sculpt_stroke_free();
-
- sculpt_undo_push(G.scene->sculptdata.brush_type);
-
- if(G.vd->depths) G.vd->depths->damaged= 1;
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void sculpt_undo_push(const short brush_type)
-{
- switch(brush_type) {
- case DRAW_BRUSH:
- BIF_undo_push("Draw Brush"); break;
- case SMOOTH_BRUSH:
- BIF_undo_push("Smooth Brush"); break;
- case PINCH_BRUSH:
- BIF_undo_push("Pinch Brush"); break;
- case INFLATE_BRUSH:
- BIF_undo_push("Inflate Brush"); break;
- case GRAB_BRUSH:
- BIF_undo_push("Grab Brush"); break;
- case LAYER_BRUSH:
- BIF_undo_push("Layer Brush"); break;
- case FLATTEN_BRUSH:
- BIF_undo_push("Flatten Brush"); break;
- default:
- BIF_undo_push("Sculpting"); break;
- }
-}
-
-void set_sculptmode(void)
-{
- if(G.f & G_SCULPTMODE) {
- Mesh *me= get_mesh(OBACT);
-
- G.f &= ~G_SCULPTMODE;
-
- sculptsession_free(G.scene);
- if(me && me->pv)
- mesh_pmv_off(OBACT, me);
- }
- else {
- G.f |= G_SCULPTMODE;
-
- /* Called here to sanity-check the brush */
- sculptmode_brush();
-
- sculpt_init_session();
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- }
-
- active_ob= NULL;
-
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 0);
-}
-
-/* Partial Mesh Visibility */
-
-/* mode: 0=hide outside selection, 1=hide inside selection */
-static void sculptmode_do_pmv(Object *ob, rcti *hb_2d, int mode)
-{
- Mesh *me= get_mesh(ob);
- float hidebox[6][3];
- vec3f plane_normals[4];
- float plane_ds[4];
- unsigned i, j;
- unsigned ndx_show, ndx_hide;
- MVert *nve;
- unsigned face_cnt_show= 0, face_ndx_show= 0;
- unsigned edge_cnt_show= 0, edge_ndx_show= 0;
- unsigned *old_map= NULL;
- const unsigned SHOW= 0, HIDE=1;
-
- /* Convert hide box from 2D to 3D */
- unproject(hidebox[0], hb_2d->xmin, hb_2d->ymax, 1);
- unproject(hidebox[1], hb_2d->xmax, hb_2d->ymax, 1);
- unproject(hidebox[2], hb_2d->xmax, hb_2d->ymin, 1);
- unproject(hidebox[3], hb_2d->xmin, hb_2d->ymin, 1);
- unproject(hidebox[4], hb_2d->xmin, hb_2d->ymax, 0);
- unproject(hidebox[5], hb_2d->xmax, hb_2d->ymin, 0);
-
- /* Calculate normals for each side of hide box */
- CalcNormFloat(hidebox[0], hidebox[1], hidebox[4], &plane_normals[0].x);
- CalcNormFloat(hidebox[1], hidebox[2], hidebox[5], &plane_normals[1].x);
- CalcNormFloat(hidebox[2], hidebox[3], hidebox[5], &plane_normals[2].x);
- CalcNormFloat(hidebox[3], hidebox[0], hidebox[4], &plane_normals[3].x);
-
- /* Calculate D for each side of hide box */
- for(i= 0; i<4; ++i)
- plane_ds[i]= hidebox[i][0]*plane_normals[i].x + hidebox[i][1]*plane_normals[i].y +
- hidebox[i][2]*plane_normals[i].z;
-
- /* Add partial visibility to mesh */
- if(!me->pv) {
- me->pv= MEM_callocN(sizeof(PartialVisibility),"PartialVisibility");
- } else {
- old_map= MEM_callocN(sizeof(unsigned)*me->pv->totvert,"PMV oldmap");
- for(i=0; i<me->pv->totvert; ++i) {
- old_map[i]= me->pv->vert_map[i]<me->totvert?0:1;
- }
- mesh_pmv_revert(ob, me);
- }
-
- /* Kill sculpt data */
- active_ob= NULL;
-
- /* Initalize map with which verts are to be hidden */
- me->pv->vert_map= MEM_mallocN(sizeof(unsigned)*me->totvert, "PMV vertmap");
- me->pv->totvert= me->totvert;
- me->totvert= 0;
- for(i=0; i<me->pv->totvert; ++i) {
- me->pv->vert_map[i]= mode ? HIDE:SHOW;
- for(j=0; j<4; ++j) {
- if(me->mvert[i].co[0] * plane_normals[j].x +
- me->mvert[i].co[1] * plane_normals[j].y +
- me->mvert[i].co[2] * plane_normals[j].z < plane_ds[j] ) {
- me->pv->vert_map[i]= mode ? SHOW:HIDE; /* Vert is outside the hide box */
- break;
- }
- }
- if(old_map && old_map[i]) me->pv->vert_map[i]= 1;
- if(!me->pv->vert_map[i]) ++me->totvert;
-
- }
- if(old_map) MEM_freeN(old_map);
-
- /* Find out how many faces to show */
- for(i=0; i<me->totface; ++i) {
- if(!me->pv->vert_map[me->mface[i].v1] &&
- !me->pv->vert_map[me->mface[i].v2] &&
- !me->pv->vert_map[me->mface[i].v3]) {
- if(me->mface[i].v4) {
- if(!me->pv->vert_map[me->mface[i].v4])
- ++face_cnt_show;
- }
- else ++face_cnt_show;
- }
- }
- /* Find out how many edges to show */
- for(i=0; i<me->totedge; ++i) {
- if(!me->pv->vert_map[me->medge[i].v1] &&
- !me->pv->vert_map[me->medge[i].v2])
- ++edge_cnt_show;
- }
-
- /* Create new vert array and reset each vert's map with map[old]=new index */
- nve= MEM_mallocN(sizeof(MVert)*me->pv->totvert, "PMV verts");
- ndx_show= 0; ndx_hide= me->totvert;
- for(i=0; i<me->pv->totvert; ++i) {
- if(me->pv->vert_map[i]) {
- me->pv->vert_map[i]= ndx_hide;
- nve[me->pv->vert_map[i]]= me->mvert[i];
- ++ndx_hide;
- } else {
- me->pv->vert_map[i]= ndx_show;
- nve[me->pv->vert_map[i]]= me->mvert[i];
- ++ndx_show;
- }
- }
- CustomData_free_layer_active(&me->vdata, CD_MVERT, me->pv->totvert);
- me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, nve, me->totvert);
-
- /* Create new face array */
- me->pv->old_faces= me->mface;
- me->pv->totface= me->totface;
- me->mface= MEM_mallocN(sizeof(MFace)*face_cnt_show, "PMV faces");
- for(i=0; i<me->totface; ++i) {
- MFace *pr_f= &me->pv->old_faces[i];
- char show= 0;
-
- if(me->pv->vert_map[pr_f->v1] < me->totvert &&
- me->pv->vert_map[pr_f->v2] < me->totvert &&
- me->pv->vert_map[pr_f->v3] < me->totvert) {
- if(pr_f->v4) {
- if(me->pv->vert_map[pr_f->v4] < me->totvert)
- show= 1;
- }
- else show= 1;
- }
-
- if(show) {
- MFace *cr_f= &me->mface[face_ndx_show];
- *cr_f= *pr_f;
- cr_f->v1= me->pv->vert_map[pr_f->v1];
- cr_f->v2= me->pv->vert_map[pr_f->v2];
- cr_f->v3= me->pv->vert_map[pr_f->v3];
- cr_f->v4= pr_f->v4 ? me->pv->vert_map[pr_f->v4] : 0;
- test_index_face(cr_f,NULL,0,pr_f->v4?4:3);
- ++face_ndx_show;
- }
- }
- me->totface= face_cnt_show;
- CustomData_set_layer(&me->fdata, CD_MFACE, me->mface);
-
- /* Create new edge array */
- me->pv->old_edges= me->medge;
- me->pv->totedge= me->totedge;
- me->medge= MEM_mallocN(sizeof(MEdge)*edge_cnt_show, "PMV edges");
- me->pv->edge_map= MEM_mallocN(sizeof(int)*me->pv->totedge,"PMV edgemap");
- for(i=0; i<me->totedge; ++i) {
- if(me->pv->vert_map[me->pv->old_edges[i].v1] < me->totvert &&
- me->pv->vert_map[me->pv->old_edges[i].v2] < me->totvert) {
- MEdge *cr_e= &me->medge[edge_ndx_show];
- me->pv->edge_map[i]= edge_ndx_show;
- *cr_e= me->pv->old_edges[i];
- cr_e->v1= me->pv->vert_map[me->pv->old_edges[i].v1];
- cr_e->v2= me->pv->vert_map[me->pv->old_edges[i].v2];
- ++edge_ndx_show;
- }
- else me->pv->edge_map[i]= -1;
- }
- me->totedge= edge_cnt_show;
- CustomData_set_layer(&me->edata, CD_MEDGE, me->medge);
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
-}
-
-static rcti sculptmode_pmv_box()
-{
- short down[2], mouse[2];
- rcti ret;
-
- getmouseco_areawin(down);
-
- while((get_mbut()&L_MOUSE) || (get_mbut()&R_MOUSE)) {
- getmouseco_areawin(mouse);
-
- scrarea_do_windraw(curarea);
-
- persp(PERSP_WIN);
- glLineWidth(2);
- setlinestyle(2);
- sdrawXORline(down[0],down[1],mouse[0],down[1]);
- sdrawXORline(mouse[0],down[1],mouse[0],mouse[1]);
- sdrawXORline(mouse[0],mouse[1],down[0],mouse[1]);
- sdrawXORline(down[0],mouse[1],down[0],down[1]);
- setlinestyle(0);
- glLineWidth(1);
- persp(PERSP_VIEW);
-
- screen_swapbuffers();
- backdrawview3d(0);
- }
-
- ret.xmin= down[0]<mouse[0]?down[0]:mouse[0];
- ret.ymin= down[1]<mouse[1]?down[1]:mouse[1];
- ret.xmax= down[0]>mouse[0]?down[0]:mouse[0];
- ret.ymax= down[1]>mouse[1]?down[1]:mouse[1];
- return ret;
-}
-
-void sculptmode_pmv(int mode)
-{
- Object *ob= OBACT;
- rcti hb_2d;
-
- if(ob_get_key(ob)) {
- error("Cannot hide mesh with shape keys enabled");
- return;
- }
-
- hb_2d= sculptmode_pmv_box(); /* Get 2D hide box */
-
- sculptmode_correct_state();
-
- waitcursor(1);
-
- if(hb_2d.xmax-hb_2d.xmin > 3 && hb_2d.ymax-hb_2d.ymin > 3) {
- init_sculptmatrices();
-
- sculptmode_do_pmv(ob,&hb_2d,mode);
- }
- else mesh_pmv_off(ob, get_mesh(ob));
-
- scrarea_do_windraw(curarea);
-
- BIF_undo_push("Partial mesh hide");
-
- waitcursor(0);
-}
diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c
deleted file mode 100644
index 0bc40674350..00000000000
--- a/source/blender/src/seqaudio.c
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): intrr, Peter Schlaile
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef WIN32
-#define __USE_XOPEN /* Needed for swab on linux */
-#include <unistd.h>
-#undef __USE_XOPEN
-#else
-#include <io.h>
-#endif
-
-#include <fcntl.h>
-#include <stdio.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "BMF_Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_ipo_types.h"
-
-#include "BKE_utildefines.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_blender.h"
-#include "BKE_main.h"
-#include "BKE_ipo.h"
-
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_keyval.h"
-#include "BIF_mainqueue.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-
-#include "BSE_view.h"
-#include "BSE_seqaudio.h"
-#include "BIF_editsound.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-
-
-static void audio_fill(void *mixdown, uint8_t *sstream, int len);
-/* ************ GLOBALS ************* */
-
-static int audio_pos;
-static int audio_scrub=0;
-static int audio_playing=0;
-static int audio_initialised=0;
-static int audio_startframe=0;
-static double audio_starttime = 0.0;
-/////
-//
-/* local protos ------------------- */
-void audio_mixdown(void);
-
-void makewavstring (char *string)
-{
- char txt[64];
-
- if (string==0) return;
-
- strcpy(string, G.scene->r.pic);
- BLI_convertstringcode(string, G.sce);
-
- BLI_make_existing_file(string);
-
- if (BLI_strcasecmp(string + strlen(string) - 4, ".wav")) {
- sprintf(txt, "%04d_%04d.wav", (G.scene->r.sfra) , (G.scene->r.efra) );
- strcat(string, txt);
- }
-}
-
-void audio_mixdown()
-{
-#ifndef DISABLE_SDL
- int file, c, totlen, totframe, i, oldcfra;
- char *buf;
-
- buf = MEM_mallocN(65536, "audio_mixdown");
- makewavstring(buf);
-
- file = open(buf, O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
-
- if(file == -1)
- {
- error("Can't open output file");
- return;
- }
-
- waitcursor(1);
-
- printf("Saving: %s ", buf);
-
- strcpy(buf, "RIFFlengWAVEfmt fmln01ccRATEbsecBP16dataDLEN");
- totframe = (EFRA - SFRA + 1);
- totlen = (int) ( FRA2TIME(totframe) * (float)G.scene->audio.mixrate * 4.0);
- printf(" totlen %d\n", totlen+36+8);
-
- totlen+= 36; /* len is filesize-8 in WAV spec, total header is 44 bytes */
- memcpy(buf+4, &totlen, 4);
- totlen-= 36;
-
- buf[16] = 0x10; buf[17] = buf[18] = buf[19] = 0; buf[20] = 1; buf[21] = 0;
- buf[22] = 2; buf[23]= 0;
- memcpy(buf+24, &G.scene->audio.mixrate, 4);
- i = G.scene->audio.mixrate * 4;
- memcpy(buf+28, &i, 4);
- buf[32] = 4; buf[33] = 0; buf[34] = 16; buf[35] = 0;
- i = totlen;
- memcpy(buf+40, &i, 4);
-
- if (G.order == B_ENDIAN) {
- /* swap the four ints to little endian */
-
- /* length */
- SWITCH_INT(buf[4]);
-
- /* audio rate */
- SWITCH_INT(buf[24]);
-
- /* audio mixrate * 4 */
- SWITCH_INT(buf[28]);
-
- /* length */
- SWITCH_INT(buf[40]);
- }
-
- c = write(file, buf, 44);
-
- oldcfra = CFRA;
- audiostream_play(SFRA, 0, 1);
-
- i= 0;
- while ( totlen > 0 ) {
- totlen -= 64;
-
- memset(buf+i, 0, 64);
-
- CFRA=(int) ( ((float)(audio_pos-64)/( G.scene->audio.mixrate*4 ))*FPS );
-
- audio_fill(buf+i, NULL, 64);
- if (G.order == B_ENDIAN) {
- char tbuf[64];
- memcpy(tbuf, buf+i, 64);
- swab(tbuf, buf+i, 64);
- }
- if (i == (65536-64)) {
- i=0;
- write(file, buf, 65536);
- }
- else i+=64;
- }
- write(file, buf, i);
-
- waitcursor(0);
- CFRA = oldcfra;
- close(file);
- MEM_freeN(buf);
-
- return;
-#endif
-}
-
-void audiostream_fill(uint8_t *mixdown, int len)
-{
- int oldcfra = CFRA;
- int i;
-
- memset(mixdown, 0, len);
-#ifndef DISABLE_SDL
- for (i = 0; i < len; i += 64) {
- CFRA = (int) ( ((float)(audio_pos-64)
- /( G.scene->audio.mixrate*4 ))
- * FPS );
-
- audio_fill(mixdown + i, NULL,
- (len - i) > 64 ? 64 : (len - i));
- }
-
- CFRA = oldcfra;
-#endif
-}
-
-
-static void audio_levels(uint8_t *buf, int len, float db, float facf, float pan)
-{
- int i;
- float facl, facr, fac;
- signed short *sample;
-
- if (pan>=0) { facr = 1.0; facl = 1.0-pan; }
- else { facr = pan+1.0; facl = 1.0; }
-
- fac = pow(10.0, ((-(db+G.scene->audio.main))/20.0)) / facf;
- facl /= fac;
- facr /= fac;
-
- for (i=0; i<len; i+=4) {
- sample = (signed short*)(buf+i);
- sample[0] = (short) ((float)sample[0] * facl);
- sample[1] = (short) ((float)sample[1] * facr);
- }
-}
-
-/* convert mono/stereo and sampling rate, alloc a buffer for
- * sound->stream to contain the new sample, and set sound->streamlen
- * accordingly.
- */
-void audio_makestream(bSound *sound)
-{
- signed short *source, *dest;
- float ratio;
- int i;
-
- if ( (!sound)||(sound->stream)||(!sound->sample)||(!G.scene) ) {
- return;
- }
- ratio = (float)G.scene->audio.mixrate / (float)sound->sample->rate;
- sound->streamlen = (int) ( (float)sound->sample->len * ratio * 2.0/((float)sound->sample->channels) );
- sound->stream = malloc((int) ((float)sound->streamlen * 1.05));
- if (sound->sample->rate == G.scene->audio.mixrate) {
- if (sound->sample->channels == 2) {
- memcpy(sound->stream, sound->sample->data, sound->streamlen);
- return;
- } else {
- for (source = (signed short*)(sound->sample->data),
- dest = (signed short*)(sound->stream),
- i=0;
- i<sound->streamlen/4;
- dest += 2, source++, i++) dest[0] = dest[1] = source[0];
- return;
- }
- }
- if (sound->sample->channels == 1) {
- for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data);
- i<(sound->streamlen/4); dest+=2, i++)
- dest[0] = dest[1] = source[(int)((float)i/ratio)];
- }
- else if (sound->sample->channels == 2) {
- for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data);
- i<(sound->streamlen/2); dest+=2, i+=2) {
- dest[1] = source[(int)((float)i/ratio)];
- dest[0] = source[(int)((float)i/ratio)+1];
- }
- }
-}
-
-#ifndef DISABLE_SDL
-static void audio_fill_ram_sound(Sequence *seq, void * mixdown,
- uint8_t * sstream, int len)
-{
- uint8_t* cvtbuf;
- bSound* sound;
- float facf;
-
- sound = seq->sound;
- audio_makestream(sound);
- if ((seq->curpos<sound->streamlen -len) && (seq->curpos>=0) &&
- (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA))
- {
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, CFRA);
- facf = seq->facf0;
- } else {
- facf = 1.0;
- }
- cvtbuf = malloc(len);
- memcpy(cvtbuf, ((uint8_t*)sound->stream)+(seq->curpos & (~3)), len);
- audio_levels(cvtbuf, len, seq->level, facf, seq->pan);
- if (!mixdown) {
- SDL_MixAudio(sstream, cvtbuf, len, SDL_MIX_MAXVOLUME);
- } else {
- SDL_MixAudio((uint8_t*)mixdown, cvtbuf, len, SDL_MIX_MAXVOLUME);
- }
- free(cvtbuf);
- }
- seq->curpos += len;
-}
-#endif
-
-#ifndef DISABLE_SDL
-static void audio_fill_hd_sound(Sequence *seq,
- void * mixdown, uint8_t * sstream,
- int len)
-{
- uint8_t* cvtbuf;
- float facf;
-
- if ((seq->curpos >= 0) &&
- (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA))
- {
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, CFRA);
- facf = seq->facf0;
- } else {
- facf = 1.0;
- }
- cvtbuf = malloc(len);
-
- sound_hdaudio_extract(seq->hdaudio, (short*) cvtbuf,
- seq->curpos / 4,
- G.scene->audio.mixrate,
- 2,
- len / 4);
- audio_levels(cvtbuf, len, seq->level, facf, seq->pan);
- if (!mixdown) {
- SDL_MixAudio(sstream,
- cvtbuf, len, SDL_MIX_MAXVOLUME);
- } else {
- SDL_MixAudio((uint8_t*)mixdown,
- cvtbuf, len, SDL_MIX_MAXVOLUME);
- }
- free(cvtbuf);
- }
- seq->curpos += len;
-}
-#endif
-
-#ifndef DISABLE_SDL
-static void audio_fill_seq(Sequence * seq, void * mixdown,
- uint8_t *sstream, int len, int advance_only)
-{
- while(seq) {
- if (seq->type == SEQ_META &&
- (!(seq->flag & SEQ_MUTE))) {
- if (seq->startdisp <= CFRA && seq->enddisp > CFRA) {
- audio_fill_seq(seq->seqbase.first,
- mixdown, sstream, len,
- advance_only);
- } else {
- audio_fill_seq(seq->seqbase.first,
- mixdown, sstream, len,
- 1);
- }
- }
- if ( (seq->type == SEQ_RAM_SOUND) &&
- (seq->sound) &&
- (!(seq->flag & SEQ_MUTE))) {
- if (advance_only) {
- seq->curpos += len;
- } else {
- audio_fill_ram_sound(
- seq, mixdown, sstream, len);
- }
- }
- if ( (seq->type == SEQ_HD_SOUND) &&
- (!(seq->flag & SEQ_MUTE))) {
- if (advance_only) {
- seq->curpos += len;
- } else {
- if (!seq->hdaudio) {
- char name[FILE_MAXDIR+FILE_MAXFILE];
-
- BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name);
- BLI_convertstringcode(name, G.sce);
-
- seq->hdaudio= sound_open_hdaudio(name);
- }
- if (seq->hdaudio) {
- audio_fill_hd_sound(seq, mixdown,
- sstream, len);
- }
- }
- }
- seq = seq->next;
- }
-}
-#endif
-
-#ifndef DISABLE_SDL
-static void audio_fill(void *mixdown, uint8_t *sstream, int len)
-{
- Editing *ed;
- Sequence *seq;
-
- ed = G.scene->ed;
- if((ed) && (!(G.scene->audio.flag & AUDIO_MUTE))) {
- seq = ed->seqbasep->first;
- audio_fill_seq(seq, mixdown, sstream, len, 0);
- }
-
- audio_pos += len;
- if (audio_scrub) {
- audio_scrub--;
- if (!audio_scrub) {
- audiostream_stop();
- }
- }
-}
-#endif
-
-#ifndef DISABLE_SDL
-static int audio_init(SDL_AudioSpec *desired)
-{
- SDL_AudioSpec *obtained, *hardware_spec;
-
- SDL_CloseAudio();
-
- obtained = (SDL_AudioSpec*)MEM_mallocN(sizeof(SDL_AudioSpec),
- "SDL_AudioSpec");
-
- desired->callback=audio_fill;
-
- if ( SDL_OpenAudio(desired, obtained) < 0 ) {
- fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
- if (obtained) MEM_freeN(obtained);
- return 0;
- }
- audio_initialised = 1;
- hardware_spec=obtained;
-
- MEM_freeN(obtained);
-
- SDL_PauseAudio(0);
- return 1;
-}
-#endif
-
-static int audiostream_play_seq(Sequence * seq, uint32_t startframe)
-{
- char name[FILE_MAXDIR+FILE_MAXFILE];
- int have_sound = 0;
-
- while(seq) {
- if (seq->type == SEQ_META) {
- if (audiostream_play_seq(
- seq->seqbase.first, startframe)) {
- have_sound = 1;
- }
- }
- if ((seq->type == SEQ_RAM_SOUND) && (seq->sound)) {
- have_sound = 1;
- seq->curpos = (int)( (FRA2TIME(
- (double) startframe -
- (double) seq->start +
- (double)
- seq->anim_startofs)
- * ((float)G.scene->audio.mixrate)
- * 4 ));
- }
- if ((seq->type == SEQ_HD_SOUND)) {
- have_sound = 1;
- if (!seq->hdaudio) {
- strncpy(name, seq->strip->dir, FILE_MAXDIR-1);
- strncat(name, seq->strip->stripdata->name,
- FILE_MAXFILE-1);
-
- seq->hdaudio = sound_open_hdaudio(name);
- }
- seq->curpos = (int)( (FRA2TIME((double) startframe -
- (double) seq->start +
- (double)
- seq->anim_startofs)
- * ((float)G.scene->audio.mixrate)
- * 4 ));
- }
- seq= seq->next;
- }
- return have_sound;
-}
-
-void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown)
-{
-#ifndef DISABLE_SDL
- static SDL_AudioSpec desired;
- Editing *ed;
- int have_sound = 0;
-
- ed= G.scene->ed;
- if(ed) {
- have_sound =
- audiostream_play_seq(ed->seqbasep->first, startframe);
- }
-
- if(have_sound) {
- /* this call used to be in startup */
- sound_init_audio();
- }
-
- if (U.mixbufsize && !audio_initialised && !mixdown) {
- desired.freq=G.scene->audio.mixrate;
- desired.format=AUDIO_S16SYS;
- desired.channels=2;
- desired.samples=U.mixbufsize;
- desired.userdata=0;
-
- if (audio_init(&desired)==0) {
- U.mixbufsize = 0; /* no audio */
- }
- }
-
- audio_startframe = startframe;
- audio_pos = ( ((int)( FRA2TIME(startframe)
- *(G.scene->audio.mixrate)*4 )) & (~3) );
- audio_starttime = PIL_check_seconds_timer();
-
- /* if audio already is playing, just reseek, otherwise
- remember scrub-duration */
- if (!(audio_playing && !audio_scrub)) {
- audio_scrub = duration;
- }
- if (!mixdown) {
- SDL_PauseAudio(0);
- audio_playing++;
- }
-#endif
-}
-
-void audiostream_start(uint32_t frame)
-{
- audiostream_play(frame, 0, 0);
-}
-
-void audiostream_scrub(uint32_t frame)
-{
- if (U.mixbufsize) audiostream_play(frame, 4096/U.mixbufsize, 0);
-}
-
-void audiostream_stop(void)
-{
-#ifndef DISABLE_SDL
- SDL_PauseAudio(1);
- audio_playing=0;
-#endif
-}
-
-int audiostream_pos(void)
-{
- int pos;
-
- if (U.mixbufsize) {
- pos = (int) (((double)(audio_pos-U.mixbufsize)
- / ( G.scene->audio.mixrate*4 ))
- * FPS );
- } else { /* fallback to seconds_timer when no audio available */
- pos = (int) ((PIL_check_seconds_timer() - audio_starttime)
- * FPS);
- }
-
- if (pos < audio_startframe) pos = audio_startframe;
- return ( pos );
-}
-
diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c
deleted file mode 100644
index 05aff70dedf..00000000000
--- a/source/blender/src/seqeffects.c
+++ /dev/null
@@ -1,3139 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <math.h>
-#include <stdlib.h>
-
-#include "MEM_guardedalloc.h"
-#include "PIL_dynlib.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_sequence_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BIF_interface.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_seqeffects.h"
-#include "BSE_sequence.h"
-
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_plugin_types.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "RE_pipeline.h" // talks to entire render API
-
-#include "blendef.h"
-
-/* Glow effect */
-enum {
- GlowR=0,
- GlowG=1,
- GlowB=2,
- GlowA=3
-};
-
-
-/* **********************************************************************
- PLUGINS
- ********************************************************************** */
-
-static void open_plugin_seq(PluginSeq *pis, const char *seqname)
-{
- int (*version)();
- void* (*alloc_private)();
- char *cp;
-
- /* to be sure: (is tested for) */
- pis->doit= 0;
- pis->pname= 0;
- pis->varstr= 0;
- pis->cfra= 0;
- pis->version= 0;
- pis->instance_private_data = 0;
-
- /* clear the error list */
- PIL_dynlib_get_error_as_string(NULL);
-
- /* if(pis->handle) PIL_dynlib_close(pis->handle); */
- /* pis->handle= 0; */
-
- /* open the needed object */
- pis->handle= PIL_dynlib_open(pis->name);
- if(test_dlerr(pis->name, pis->name)) return;
-
- if (pis->handle != 0) {
- /* find the address of the version function */
- version= (int (*)())PIL_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
- if (test_dlerr(pis->name, "plugin_seq_getversion")) return;
-
- if (version != 0) {
- pis->version= version();
- if (pis->version >= 2 && pis->version <= 6) {
- int (*info_func)(PluginInfo *);
- PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
-
- info_func= (int (*)(PluginInfo *))PIL_dynlib_find_symbol(pis->handle, "plugin_getinfo");
-
- if(info_func == NULL) error("No info func");
- else {
- info_func(info);
-
- pis->pname= info->name;
- pis->vars= info->nvars;
- pis->cfra= info->cfra;
-
- pis->varstr= info->varstr;
-
- pis->doit= (void(*)(void))info->seq_doit;
- if (info->init)
- info->init();
- }
- MEM_freeN(info);
-
- cp= PIL_dynlib_find_symbol(pis->handle, "seqname");
- if(cp) strncpy(cp, seqname, 21);
- } else {
- printf ("Plugin returned unrecognized version number\n");
- return;
- }
- }
- alloc_private = (void* (*)())PIL_dynlib_find_symbol(
- pis->handle, "plugin_seq_alloc_private_data");
- if (alloc_private) {
- pis->instance_private_data = alloc_private();
- }
-
- pis->current_private_data = (void**)
- PIL_dynlib_find_symbol(
- pis->handle, "plugin_private_data");
- }
-}
-
-static PluginSeq *add_plugin_seq(const char *str, const char *seqname)
-{
- PluginSeq *pis;
- VarStruct *varstr;
- int a;
-
- pis= MEM_callocN(sizeof(PluginSeq), "PluginSeq");
-
- strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE);
- open_plugin_seq(pis, seqname);
-
- if(pis->doit==0) {
- if(pis->handle==0) error("no plugin: %s", str);
- else error("in plugin: %s", str);
- MEM_freeN(pis);
- return 0;
- }
-
- /* default values */
- varstr= pis->varstr;
- for(a=0; a<pis->vars; a++, varstr++) {
- if( (varstr->type & FLO)==FLO)
- pis->data[a]= varstr->def;
- else if( (varstr->type & INT)==INT)
- *((int *)(pis->data+a))= (int) varstr->def;
- }
-
- return pis;
-}
-
-static void free_plugin_seq(PluginSeq *pis)
-{
- if(pis==0) return;
-
- /* no PIL_dynlib_close: same plugin can be opened multiple times with 1 handle */
-
- if (pis->instance_private_data) {
- void (*free_private)(void *);
-
- free_private = (void (*)(void *))PIL_dynlib_find_symbol(
- pis->handle, "plugin_seq_free_private_data");
- if (free_private) {
- free_private(pis->instance_private_data);
- }
- }
-
- MEM_freeN(pis);
-}
-
-static void init_plugin(Sequence * seq, const char * fname)
-{
- seq->plugin= (PluginSeq *)add_plugin_seq(fname, seq->name+2);
-}
-
-/*
- * FIXME: should query plugin! Could be generator, that needs zero inputs...
- */
-static int num_inputs_plugin()
-{
- return 1;
-}
-
-static void load_plugin(Sequence * seq)
-{
- if (seq) {
- open_plugin_seq(seq->plugin, seq->name+2);
- }
-}
-
-static void copy_plugin(Sequence * dst, Sequence * src)
-{
- if(src->plugin) {
- dst->plugin= MEM_dupallocN(src->plugin);
- open_plugin_seq(dst->plugin, dst->name+2);
- }
-}
-
-static ImBuf * IMB_cast_away_list(ImBuf * i)
-{
- if (!i) {
- return 0;
- }
- return (ImBuf*) (((void**) i) + 2);
-}
-
-static void do_plugin_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- char *cp;
- int float_rendering;
- int use_temp_bufs = 0; /* Are needed since blur.c (and maybe some other
- old plugins) do very bad stuff
- with imbuf-internals */
-
- if(seq->plugin && seq->plugin->doit) {
- if(seq->plugin->cfra)
- *(seq->plugin->cfra)= frame_to_float(cfra);
-
- cp = PIL_dynlib_find_symbol(
- seq->plugin->handle, "seqname");
-
- if(cp) strncpy(cp, seq->name+2, 22);
-
- if (seq->plugin->current_private_data) {
- *seq->plugin->current_private_data
- = seq->plugin->instance_private_data;
- }
-
- float_rendering = (out->rect_float != NULL);
-
- if (seq->plugin->version<=3 && float_rendering) {
- use_temp_bufs = 1;
-
- if (ibuf1) {
- ibuf1 = IMB_dupImBuf(ibuf1);
- IMB_rect_from_float(ibuf1);
- imb_freerectfloatImBuf(ibuf1);
- ibuf1->flags &= ~IB_rectfloat;
- }
- if (ibuf2) {
- ibuf2 = IMB_dupImBuf(ibuf2);
- IMB_rect_from_float(ibuf2);
- imb_freerectfloatImBuf(ibuf2);
- ibuf2->flags &= ~IB_rectfloat;
- }
- if (ibuf3) {
- ibuf3 = IMB_dupImBuf(ibuf3);
- IMB_rect_from_float(ibuf3);
- imb_freerectfloatImBuf(ibuf3);
- ibuf3->flags &= ~IB_rectfloat;
- }
- if (!out->rect) imb_addrectImBuf(out);
- imb_freerectfloatImBuf(out);
- out->flags &= ~IB_rectfloat;
- }
-
- if (seq->plugin->version<=2) {
- if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
- if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
- if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
- }
-
- if (seq->plugin->version<=4) {
- ((SeqDoit)seq->plugin->doit)(
- seq->plugin->data, facf0, facf1, x, y,
- IMB_cast_away_list(ibuf1),
- IMB_cast_away_list(ibuf2),
- IMB_cast_away_list(out),
- IMB_cast_away_list(ibuf3));
- } else {
- ((SeqDoit)seq->plugin->doit)(
- seq->plugin->data, facf0, facf1, x, y,
- ibuf1, ibuf2, out, ibuf3);
- }
-
- if (seq->plugin->version<=2) {
- if (!use_temp_bufs) {
- if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
- if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
- if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
- }
- IMB_convert_rgba_to_abgr(out);
- }
- if (seq->plugin->version<=3 && float_rendering) {
- IMB_float_from_rect(out);
- }
-
- if (use_temp_bufs) {
- if (ibuf1) IMB_freeImBuf(ibuf1);
- if (ibuf2) IMB_freeImBuf(ibuf2);
- if (ibuf3) IMB_freeImBuf(ibuf3);
- }
- }
-}
-
-static int do_plugin_early_out(struct Sequence *seq,
- float facf0, float facf1)
-{
- return 0;
-}
-
-static void free_plugin(struct Sequence * seq)
-{
- free_plugin_seq(seq->plugin);
- seq->plugin = 0;
-}
-
-/* **********************************************************************
- ALPHA OVER
- ********************************************************************** */
-
-static void init_alpha_over_or_under(Sequence * seq)
-{
- Sequence * seq1 = seq->seq1;
- Sequence * seq2 = seq->seq2;
-
- seq->seq2= seq1;
- seq->seq1= seq2;
-}
-
-static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y,
- char * rect1, char *rect2, char *out)
-{
- int fac2, mfac, fac, fac4;
- int xo, tempc;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= (char *)rect1;
- rt2= (char *)rect2;
- rt= (char *)out;
-
- fac2= (int)(256.0*facf0);
- fac4= (int)(256.0*facf1);
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- /* rt = rt1 over rt2 (alpha from rt1) */
-
- fac= fac2;
- mfac= 256 - ( (fac2*rt1[3])>>8 );
-
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else {
- tempc= ( fac*rt1[0] + mfac*rt2[0])>>8;
- if(tempc>255) rt[0]= 255; else rt[0]= tempc;
- tempc= ( fac*rt1[1] + mfac*rt2[1])>>8;
- if(tempc>255) rt[1]= 255; else rt[1]= tempc;
- tempc= ( fac*rt1[2] + mfac*rt2[2])>>8;
- if(tempc>255) rt[2]= 255; else rt[2]= tempc;
- tempc= ( fac*rt1[3] + mfac*rt2[3])>>8;
- if(tempc>255) rt[3]= 255; else rt[3]= tempc;
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- fac= fac4;
- mfac= 256 - ( (fac4*rt1[3])>>8 );
-
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else {
- tempc= ( fac*rt1[0] + mfac*rt2[0])>>8;
- if(tempc>255) rt[0]= 255; else rt[0]= tempc;
- tempc= ( fac*rt1[1] + mfac*rt2[1])>>8;
- if(tempc>255) rt[1]= 255; else rt[1]= tempc;
- tempc= ( fac*rt1[2] + mfac*rt2[2])>>8;
- if(tempc>255) rt[2]= 255; else rt[2]= tempc;
- tempc= ( fac*rt1[3] + mfac*rt2[3])>>8;
- if(tempc>255) rt[3]= 255; else rt[3]= tempc;
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
- float * rect1, float *rect2, float *out)
-{
- float fac2, mfac, fac, fac4;
- int xo;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= facf0;
- fac4= facf1;
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- /* rt = rt1 over rt2 (alpha from rt1) */
-
- fac= fac2;
- mfac= 1.0 - (fac2*rt1[3]) ;
-
- if(fac <= 0.0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else if(mfac <=0) {
- memcpy(rt, rt1, 4 * sizeof(float));
- } else {
- rt[0] = fac*rt1[0] + mfac*rt2[0];
- rt[1] = fac*rt1[1] + mfac*rt2[1];
- rt[2] = fac*rt1[2] + mfac*rt2[2];
- rt[3] = fac*rt1[3] + mfac*rt2[3];
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- fac= fac4;
- mfac= 1.0 - (fac4*rt1[3]);
-
- if(fac <= 0.0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else if(mfac <= 0.0) {
- memcpy(rt, rt1, 4 * sizeof(float));
- } else {
- rt[0] = fac*rt1[0] + mfac*rt2[0];
- rt[1] = fac*rt1[1] + mfac*rt2[1];
- rt[2] = fac*rt1[2] + mfac*rt2[2];
- rt[3] = fac*rt1[3] + mfac*rt2[3];
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_alphaover_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_alphaover_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_alphaover_effect_byte(
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-
-/* **********************************************************************
- ALPHA UNDER
- ********************************************************************** */
-
-void do_alphaunder_effect_byte(
- float facf0, float facf1, int x, int y, char *rect1,
- char *rect2, char *out)
-{
- int fac2, mfac, fac, fac4;
- int xo;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= (int)(256.0*facf0);
- fac4= (int)(256.0*facf1);
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- /* rt = rt1 under rt2 (alpha from rt2) */
-
- /* this complex optimalisation is because the
- * 'skybuf' can be crossed in
- */
- if(rt2[3]==0 && fac2==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else {
- mfac= rt2[3];
- fac= (fac2*(256-mfac))>>8;
-
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else {
- rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8;
- rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8;
- rt[2]= ( fac*rt1[2] + mfac*rt2[2])>>8;
- rt[3]= ( fac*rt1[3] + mfac*rt2[3])>>8;
- }
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- if(rt2[3]==0 && fac4==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1);
- else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else {
- mfac= rt2[3];
- fac= (fac4*(256-mfac))>>8;
-
- if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2);
- else {
- rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8;
- rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8;
- rt[2]= ( fac*rt1[2] + mfac*rt2[2])>>8;
- rt[3]= ( fac*rt1[3] + mfac*rt2[3])>>8;
- }
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-
-static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
-{
- float fac2, mfac, fac, fac4;
- int xo;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= facf0;
- fac4= facf1;
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- /* rt = rt1 under rt2 (alpha from rt2) */
-
- /* this complex optimalisation is because the
- * 'skybuf' can be crossed in
- */
- if( rt2[3]<=0 && fac2>=1.0) {
- memcpy(rt, rt1, 4 * sizeof(float));
- } else if(rt2[3]>=1.0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else {
- mfac = rt2[3];
- fac = fac2 * (1.0 - mfac);
-
- if(fac == 0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else {
- rt[0]= fac*rt1[0] + mfac*rt2[0];
- rt[1]= fac*rt1[1] + mfac*rt2[1];
- rt[2]= fac*rt1[2] + mfac*rt2[2];
- rt[3]= fac*rt1[3] + mfac*rt2[3];
- }
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- if(rt2[3]<=0 && fac4 >= 1.0) {
- memcpy(rt, rt1, 4 * sizeof(float));
-
- } else if(rt2[3]>=1.0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else {
- mfac= rt2[3];
- fac= fac4*(1.0-mfac);
-
- if(fac == 0) {
- memcpy(rt, rt2, 4 * sizeof(float));
- } else {
- rt[0]= fac * rt1[0] + mfac * rt2[0];
- rt[1]= fac * rt1[1] + mfac * rt2[1];
- rt[2]= fac * rt1[2] + mfac * rt2[2];
- rt[3]= fac * rt1[3] + mfac * rt2[3];
- }
- }
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_alphaunder_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_alphaunder_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_alphaunder_effect_byte(
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-
-/* **********************************************************************
- CROSS
- ********************************************************************** */
-
-void do_cross_effect_byte(float facf0, float facf1, int x, int y,
- char *rect1, char *rect2,
- char *out)
-{
- int fac1, fac2, fac3, fac4;
- int xo;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= (int)(256.0*facf0);
- fac1= 256-fac2;
- fac4= (int)(256.0*facf1);
- fac3= 256-fac4;
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- rt[0]= (fac1*rt1[0] + fac2*rt2[0])>>8;
- rt[1]= (fac1*rt1[1] + fac2*rt2[1])>>8;
- rt[2]= (fac1*rt1[2] + fac2*rt2[2])>>8;
- rt[3]= (fac1*rt1[3] + fac2*rt2[3])>>8;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- rt[0]= (fac3*rt1[0] + fac4*rt2[0])>>8;
- rt[1]= (fac3*rt1[1] + fac4*rt2[1])>>8;
- rt[2]= (fac3*rt1[2] + fac4*rt2[2])>>8;
- rt[3]= (fac3*rt1[3] + fac4*rt2[3])>>8;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- }
-}
-
-void do_cross_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2, float *out)
-{
- float fac1, fac2, fac3, fac4;
- int xo;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= facf0;
- fac1= 1.0 - fac2;
- fac4= facf1;
- fac3= 1.0 - fac4;
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- rt[0]= fac1*rt1[0] + fac2*rt2[0];
- rt[1]= fac1*rt1[1] + fac2*rt2[1];
- rt[2]= fac1*rt1[2] + fac2*rt2[2];
- rt[3]= fac1*rt1[3] + fac2*rt2[3];
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- rt[0]= fac3*rt1[0] + fac4*rt2[0];
- rt[1]= fac3*rt1[1] + fac4*rt2[1];
- rt[2]= fac3*rt1[2] + fac4*rt2[2];
- rt[3]= fac3*rt1[3] + fac4*rt2[3];
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- }
-}
-
-/* carefull: also used by speed effect! */
-
-static void do_cross_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_cross_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_cross_effect_byte(
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-
-/* **********************************************************************
- GAMMA CROSS
- ********************************************************************** */
-
-/* copied code from initrender.c */
-static unsigned short gamtab[65536];
-static unsigned short igamtab1[256];
-static int gamma_tabs_init = FALSE;
-
-#define RE_GAMMA_TABLE_SIZE 400
-
-static float gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
-static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
-static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
-static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
-static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1];
-static float color_step;
-static float inv_color_step;
-static float valid_gamma;
-static float valid_inv_gamma;
-
-static void makeGammaTables(float gamma)
-{
- /* we need two tables: one forward, one backward */
- int i;
-
- valid_gamma = gamma;
- valid_inv_gamma = 1.0 / gamma;
- color_step = 1.0 / RE_GAMMA_TABLE_SIZE;
- inv_color_step = (float) RE_GAMMA_TABLE_SIZE;
-
- /* We could squeeze out the two range tables to gain some memory. */
- for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
- color_domain_table[i] = i * color_step;
- gamma_range_table[i] = pow(color_domain_table[i],
- valid_gamma);
- inv_gamma_range_table[i] = pow(color_domain_table[i],
- valid_inv_gamma);
- }
-
- /* The end of the table should match 1.0 carefully. In order to avoid */
- /* rounding errors, we just set this explicitly. The last segment may */
- /* have a different lenght than the other segments, but our */
- /* interpolation is insensitive to that. */
- color_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
- gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
- inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
-
- /* To speed up calculations, we make these calc factor tables. They are */
- /* multiplication factors used in scaling the interpolation. */
- for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
- gamfactor_table[i] = inv_color_step
- * (gamma_range_table[i + 1] - gamma_range_table[i]) ;
- inv_gamfactor_table[i] = inv_color_step
- * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
- }
-
-} /* end of void makeGammaTables(float gamma) */
-
-
-static float gammaCorrect(float c)
-{
- int i;
- float res = 0.0;
-
- i = floor(c * inv_color_step);
- /* Clip to range [0,1]: outside, just do the complete calculation. */
- /* We may have some performance problems here. Stretching up the LUT */
- /* may help solve that, by exchanging LUT size for the interpolation. */
- /* Negative colors are explicitly handled. */
- if (i < 0) res = -pow(abs(c), valid_gamma);
- else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
- else res = gamma_range_table[i] +
- ( (c - color_domain_table[i]) * gamfactor_table[i]);
-
- return res;
-} /* end of float gammaCorrect(float col) */
-
-/* ------------------------------------------------------------------------- */
-
-static float invGammaCorrect(float col)
-{
- int i;
- float res = 0.0;
-
- i = floor(col*inv_color_step);
- /* Negative colors are explicitly handled. */
- if (i < 0) res = -pow(abs(col), valid_inv_gamma);
- else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
- else res = inv_gamma_range_table[i] +
- ( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
-
- return res;
-} /* end of float invGammaCorrect(float col) */
-
-
-static void gamtabs(float gamma)
-{
- float val, igamma= 1.0f/gamma;
- int a;
-
- /* gamtab: in short, out short */
- for(a=0; a<65536; a++) {
- val= a;
- val/= 65535.0;
-
- if(gamma==2.0) val= sqrt(val);
- else if(gamma!=1.0) val= pow(val, igamma);
-
- gamtab[a]= (65535.99*val);
- }
- /* inverse gamtab1 : in byte, out short */
- for(a=1; a<=256; a++) {
- if(gamma==2.0) igamtab1[a-1]= a*a-1;
- else if(gamma==1.0) igamtab1[a-1]= 256*a-1;
- else {
- val= a/256.0;
- igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ;
- }
- }
-
-}
-
-static void build_gammatabs()
-{
- if (gamma_tabs_init == FALSE) {
- gamtabs(2.0f);
- makeGammaTables(2.0f);
- gamma_tabs_init = TRUE;
- }
-}
-
-static void init_gammacross(Sequence * seq)
-{
-}
-
-static void load_gammacross(Sequence * seq)
-{
-}
-
-static void free_gammacross(Sequence * seq)
-{
-}
-
-static void do_gammacross_effect_byte(float facf0, float facf1,
- int x, int y,
- char *rect1,
- char *rect2,
- char *out)
-{
- int fac1, fac2, col;
- int xo;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= (char *)rect1;
- rt2= (char *)rect2;
- rt= (char *)out;
-
- fac2= (int)(256.0*facf0);
- fac1= 256-fac2;
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8;
- if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col=(fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8;
- if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8;
- if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8;
- if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8;
- if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col= (fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8;
- if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8;
- if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
- col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8;
- if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE];
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-
-}
-
-static void do_gammacross_effect_float(float facf0, float facf1,
- int x, int y,
- float *rect1, float *rect2,
- float *out)
-{
- float fac1, fac2;
- int xo;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac2= facf0;
- fac1= 1.0 - fac2;
-
- while(y--) {
-
- x= xo * 4;
- while(x--) {
-
- *rt= gammaCorrect(
- fac1 * invGammaCorrect(*rt1)
- + fac2 * invGammaCorrect(*rt2));
- rt1++; rt2++; rt++;
- }
-
- if(y==0) break;
- y--;
-
- x= xo * 4;
- while(x--) {
-
- *rt= gammaCorrect(
- fac1*invGammaCorrect(*rt1)
- + fac2*invGammaCorrect(*rt2));
-
- rt1++; rt2++; rt++;
- }
- }
-}
-
-static void do_gammacross_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- build_gammatabs();
-
- if (out->rect_float) {
- do_gammacross_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_gammacross_effect_byte(
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-
-/* **********************************************************************
- ADD
- ********************************************************************** */
-
-static void do_add_effect_byte(float facf0, float facf1, int x, int y,
- unsigned char *rect1, unsigned char *rect2,
- unsigned char *out)
-{
- int col, xo, fac1, fac3;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= (char *)rect1;
- rt2= (char *)rect2;
- rt= (char *)out;
-
- fac1= (int)(256.0*facf0);
- fac3= (int)(256.0*facf1);
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- col= rt1[0]+ ((fac1*rt2[0])>>8);
- if(col>255) rt[0]= 255; else rt[0]= col;
- col= rt1[1]+ ((fac1*rt2[1])>>8);
- if(col>255) rt[1]= 255; else rt[1]= col;
- col= rt1[2]+ ((fac1*rt2[2])>>8);
- if(col>255) rt[2]= 255; else rt[2]= col;
- col= rt1[3]+ ((fac1*rt2[3])>>8);
- if(col>255) rt[3]= 255; else rt[3]= col;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- col= rt1[0]+ ((fac3*rt2[0])>>8);
- if(col>255) rt[0]= 255; else rt[0]= col;
- col= rt1[1]+ ((fac3*rt2[1])>>8);
- if(col>255) rt[1]= 255; else rt[1]= col;
- col= rt1[2]+ ((fac3*rt2[2])>>8);
- if(col>255) rt[2]= 255; else rt[2]= col;
- col= rt1[3]+ ((fac3*rt2[3])>>8);
- if(col>255) rt[3]= 255; else rt[3]= col;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_add_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
-{
- int xo;
- float fac1, fac3;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac1= facf0;
- fac3= facf1;
-
- while(y--) {
-
- x= xo * 4;
- while(x--) {
- *rt = *rt1 + fac1 * (*rt2);
-
- rt1++; rt2++; rt++;
- }
-
- if(y==0) break;
- y--;
-
- x= xo * 4;
- while(x--) {
- *rt = *rt1 + fac3 * (*rt2);
-
- rt1++; rt2++; rt++;
- }
- }
-}
-
-static void do_add_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_add_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_add_effect_byte(
- facf0, facf1, x, y,
- (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
- (unsigned char*) out->rect);
- }
-}
-
-
-/* **********************************************************************
- SUB
- ********************************************************************** */
-
-static void do_sub_effect_byte(float facf0, float facf1,
- int x, int y,
- char *rect1, char *rect2, char *out)
-{
- int col, xo, fac1, fac3;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= (char *)rect1;
- rt2= (char *)rect2;
- rt= (char *)out;
-
- fac1= (int)(256.0*facf0);
- fac3= (int)(256.0*facf1);
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- col= rt1[0]- ((fac1*rt2[0])>>8);
- if(col<0) rt[0]= 0; else rt[0]= col;
- col= rt1[1]- ((fac1*rt2[1])>>8);
- if(col<0) rt[1]= 0; else rt[1]= col;
- col= rt1[2]- ((fac1*rt2[2])>>8);
- if(col<0) rt[2]= 0; else rt[2]= col;
- col= rt1[3]- ((fac1*rt2[3])>>8);
- if(col<0) rt[3]= 0; else rt[3]= col;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- col= rt1[0]- ((fac3*rt2[0])>>8);
- if(col<0) rt[0]= 0; else rt[0]= col;
- col= rt1[1]- ((fac3*rt2[1])>>8);
- if(col<0) rt[1]= 0; else rt[1]= col;
- col= rt1[2]- ((fac3*rt2[2])>>8);
- if(col<0) rt[2]= 0; else rt[2]= col;
- col= rt1[3]- ((fac3*rt2[3])>>8);
- if(col<0) rt[3]= 0; else rt[3]= col;
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_sub_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
-{
- int xo;
- float fac1, fac3;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac1= facf0;
- fac3= facf1;
-
- while(y--) {
-
- x= xo * 4;
- while(x--) {
- *rt = *rt1 - fac1 * (*rt2);
-
- rt1++; rt2++; rt++;
- }
-
- if(y==0) break;
- y--;
-
- x= xo * 4;
- while(x--) {
- *rt = *rt1 - fac3 * (*rt2);
-
- rt1++; rt2++; rt++;
- }
- }
-}
-
-static void do_sub_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_sub_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_sub_effect_byte(
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-/* **********************************************************************
- DROP
- ********************************************************************** */
-
-/* Must be > 0 or add precopy, etc to the function */
-#define XOFF 8
-#define YOFF 8
-
-static void do_drop_effect_byte(float facf0, float facf1, int x, int y,
- unsigned char *rect2i, unsigned char *rect1i,
- unsigned char *outi)
-{
- int height, width, temp, fac, fac1, fac2;
- char *rt1, *rt2, *out;
- int field= 1;
-
- width= x;
- height= y;
-
- fac1= (int)(70.0*facf0);
- fac2= (int)(70.0*facf1);
-
- rt2= (char*) (rect2i + YOFF*width);
- rt1= (char*) rect1i;
- out= (char*) outi;
- for (y=0; y<height-YOFF; y++) {
- if(field) fac= fac1;
- else fac= fac2;
- field= !field;
-
- memcpy(out, rt1, sizeof(int)*XOFF);
- rt1+= XOFF*4;
- out+= XOFF*4;
-
- for (x=XOFF; x<width; x++) {
- temp= ((fac*rt2[3])>>8);
-
- *(out++)= MAX2(0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0, *rt1 - temp); rt1++;
- rt2+=4;
- }
- rt2+=XOFF*4;
- }
- memcpy(out, rt1, sizeof(int)*YOFF*width);
-}
-
-static void do_drop_effect_float(float facf0, float facf1, int x, int y,
- float *rect2i, float *rect1i,
- float *outi)
-{
- int height, width;
- float temp, fac, fac1, fac2;
- float *rt1, *rt2, *out;
- int field= 1;
-
- width= x;
- height= y;
-
- fac1= 70.0*facf0;
- fac2= 70.0*facf1;
-
- rt2= (rect2i + YOFF*width);
- rt1= rect1i;
- out= outi;
- for (y=0; y<height-YOFF; y++) {
- if(field) fac= fac1;
- else fac= fac2;
- field= !field;
-
- memcpy(out, rt1, 4 * sizeof(float)*XOFF);
- rt1+= XOFF*4;
- out+= XOFF*4;
-
- for (x=XOFF; x<width; x++) {
- temp= fac * rt2[3];
-
- *(out++)= MAX2(0.0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0.0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0.0, *rt1 - temp); rt1++;
- *(out++)= MAX2(0.0, *rt1 - temp); rt1++;
- rt2+=4;
- }
- rt2+=XOFF*4;
- }
- memcpy(out, rt1, 4 * sizeof(float)*YOFF*width);
-}
-
-
-static void do_drop_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf * ibuf3,
- struct ImBuf *out)
-{
- if (out->rect_float) {
- do_drop_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_drop_effect_byte(
- facf0, facf1, x, y,
- (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
- (unsigned char*) out->rect);
- }
-}
-
-/* **********************************************************************
- MUL
- ********************************************************************** */
-
-static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
- unsigned char *rect1, unsigned char *rect2,
- unsigned char *out)
-{
- int xo, fac1, fac3;
- char *rt1, *rt2, *rt;
-
- xo= x;
- rt1= (char *)rect1;
- rt2= (char *)rect2;
- rt= (char *)out;
-
- fac1= (int)(256.0*facf0);
- fac3= (int)(256.0*facf1);
-
- /* formula:
- * fac*(a*b) + (1-fac)*a => fac*a*(b-1)+axaux= c*px + py*s ;//+centx
- yaux= -s*px + c*py;//+centy
- */
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- rt[0]= rt1[0] + ((fac1*rt1[0]*(rt2[0]-256))>>16);
- rt[1]= rt1[1] + ((fac1*rt1[1]*(rt2[1]-256))>>16);
- rt[2]= rt1[2] + ((fac1*rt1[2]*(rt2[2]-256))>>16);
- rt[3]= rt1[3] + ((fac1*rt1[3]*(rt2[3]-256))>>16);
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- rt[0]= rt1[0] + ((fac3*rt1[0]*(rt2[0]-256))>>16);
- rt[1]= rt1[1] + ((fac3*rt1[1]*(rt2[1]-256))>>16);
- rt[2]= rt1[2] + ((fac3*rt1[2]*(rt2[2]-256))>>16);
- rt[3]= rt1[3] + ((fac3*rt1[3]*(rt2[3]-256))>>16);
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_mul_effect_float(float facf0, float facf1, int x, int y,
- float *rect1, float *rect2,
- float *out)
-{
- int xo;
- float fac1, fac3;
- float *rt1, *rt2, *rt;
-
- xo= x;
- rt1= rect1;
- rt2= rect2;
- rt= out;
-
- fac1= facf0;
- fac3= facf1;
-
- /* formula:
- * fac*(a*b) + (1-fac)*a => fac*a*(b-1)+a
- */
-
- while(y--) {
-
- x= xo;
- while(x--) {
-
- rt[0]= rt1[0] + fac1*rt1[0]*(rt2[0]-1.0);
- rt[1]= rt1[1] + fac1*rt1[1]*(rt2[1]-1.0);
- rt[2]= rt1[2] + fac1*rt1[2]*(rt2[2]-1.0);
- rt[3]= rt1[3] + fac1*rt1[3]*(rt2[3]-1.0);
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
-
- if(y==0) break;
- y--;
-
- x= xo;
- while(x--) {
-
- rt[0]= rt1[0] + fac3*rt1[0]*(rt2[0]-1.0);
- rt[1]= rt1[1] + fac3*rt1[1]*(rt2[1]-1.0);
- rt[2]= rt1[2] + fac3*rt1[2]*(rt2[2]-1.0);
- rt[3]= rt1[3] + fac3*rt1[3]*(rt2[3]-1.0);
-
- rt1+= 4; rt2+= 4; rt+= 4;
- }
- }
-}
-
-static void do_mul_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_mul_effect_float(
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_mul_effect_byte(
- facf0, facf1, x, y,
- (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
- (unsigned char*) out->rect);
- }
-}
-
-/* **********************************************************************
- WIPE
- ********************************************************************** */
-
-typedef struct WipeZone {
- float angle;
- int flip;
- int xo, yo;
- int width;
- float invwidth;
- float pythangle;
-} WipeZone;
-
-static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo)
-{
- wipezone->flip = (wipe->angle < 0);
- wipezone->angle = pow(fabs(wipe->angle)/45.0f, log(xo)/log(2.0f));
- wipezone->xo = xo;
- wipezone->yo = yo;
- wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f));
- wipezone->pythangle = 1.0f/sqrt(wipe->angle*wipe->angle + 1.0f);
-
- if(wipe->wipetype == DO_SINGLE_WIPE)
- wipezone->invwidth = 1.0f/wipezone->width;
- else
- wipezone->invwidth = 1.0f/(0.5f*wipezone->width);
-}
-
-// This function calculates the blur band for the wipe effects
-static float in_band(WipeZone *wipezone,float width,float dist,float perc,int side,int dir)
-{
- float t1,t2,alpha,percwidth;
-
- if(width == 0)
- return (float)side;
-
- if(side == 1)
- percwidth = width * perc;
- else
- percwidth = width * (1 - perc);
-
- if(width < dist)
- return side;
-
- t1 = dist * wipezone->invwidth; //percentange of width that is
- t2 = wipezone->invwidth; //amount of alpha per % point
-
- if(side == 1)
- alpha = (t1*t2*100) + (1-perc); // add point's alpha contrib to current position in wipe
- else
- alpha = (1-perc) - (t1*t2*100);
-
- if(dir == 0)
- alpha = 1-alpha;
-
- return alpha;
-}
-
-static float check_zone(WipeZone *wipezone, int x, int y,
- Sequence *seq, float facf0)
-{
- float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist;
-/*some future stuff
-float hyp3,hyp4,b4,b5
-*/
- float temp1,temp2,temp3,temp4; //some placeholder variables
- int xo = wipezone->xo;
- int yo = wipezone->yo;
- float halfx = xo*0.5f;
- float halfy = yo*0.5f;
- float widthf,output=0;
- WipeVars *wipe = (WipeVars *)seq->effectdata;
- int width;
-
- if(wipezone->flip) x = xo - x;
- angle = wipezone->angle;
-
- posy = facf0 * yo;
-
- if(wipe->forward){
- posx = facf0 * xo;
- posy = facf0 * yo;
- } else{
- posx = xo - facf0 * xo;
- posy = yo - facf0 * yo;
- }
-
- switch (wipe->wipetype) {
- case DO_SINGLE_WIPE:
- width = wipezone->width;
- hwidth = width*0.5f;
-
- if(angle == 0.0f) {
- b1 = posy;
- b2 = y;
- hyp = fabs(y - posy);
- }
- else {
- b1 = posy - (-angle)*posx;
- b2 = y - (-angle)*x;
- hyp = fabs(angle*x+y+(-posy-angle*posx))*wipezone->pythangle;
- }
-
- if(angle < 0) {
- temp1 = b1;
- b1 = b2;
- b2 = temp1;
- }
-
- if(wipe->forward) {
- if(b1 < b2)
- output = in_band(wipezone,width,hyp,facf0,1,1);
- else
- output = in_band(wipezone,width,hyp,facf0,0,1);
- }
- else {
- if(b1 < b2)
- output = in_band(wipezone,width,hyp,facf0,0,1);
- else
- output = in_band(wipezone,width,hyp,facf0,1,1);
- }
- break;
-
- case DO_DOUBLE_WIPE:
- if(!wipe->forward)
- facf0 = 1.0f-facf0; // Go the other direction
-
- width = wipezone->width; // calculate the blur width
- hwidth = width*0.5f;
- if (angle == 0) {
- b1 = posy*0.5f;
- b3 = yo-posy*0.5f;
- b2 = y;
-
- hyp = abs(y - posy*0.5f);
- hyp2 = abs(y - (yo-posy*0.5f));
- }
- else {
- b1 = posy*0.5f - (-angle)*posx*0.5f;
- b3 = (yo-posy*0.5f) - (-angle)*(xo-posx*0.5f);
- b2 = y - (-angle)*x;
-
- hyp = abs(angle*x+y+(-posy*0.5f-angle*posx*0.5f))*wipezone->pythangle;
- hyp2 = abs(angle*x+y+(-(yo-posy*0.5f)-angle*(xo-posx*0.5f)))*wipezone->pythangle;
- }
-
- temp1 = xo*(1-facf0*0.5f)-xo*facf0*0.5f;
- temp2 = yo*(1-facf0*0.5f)-yo*facf0*0.5f;
- pointdist = sqrt(temp1*temp1 + temp2*temp2);
-
- if(b2 < b1 && b2 < b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp,facf0,0,1);
- } else if(b2 > b1 && b2 > b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
- output = in_band(wipezone,hwidth,hyp,facf0,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1);
- else
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
- }
- if(!wipe->forward)output = 1-output;
- break;
- case DO_CLOCK_WIPE:
- /*
- temp1: angle of effect center in rads
- temp2: angle of line through (halfx,halfy) and (x,y) in rads
- temp3: angle of low side of blur
- temp4: angle of high side of blur
- */
- output = 1.0f - facf0;
- widthf = wipe->edgeWidth*2.0f*(float)M_PI;
- temp1 = 2.0f * (float)M_PI * facf0;
-
- if(wipe->forward){
- temp1 = 2.0f*(float)M_PI - temp1;
- }
-
- x = x - halfx;
- y = y - halfy;
-
- temp2 = asin(abs(y)/sqrt(x*x + y*y));
- if(x <= 0 && y >= 0) temp2 = (float)M_PI - temp2;
- else if(x<=0 && y <= 0) temp2 += (float)M_PI;
- else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
-
- if(wipe->forward){
- temp3 = temp1-(widthf*0.5f)*facf0;
- temp4 = temp1+(widthf*0.5f)*(1-facf0);
- } else{
- temp3 = temp1-(widthf*0.5f)*(1-facf0);
- temp4 = temp1+(widthf*0.5f)*facf0;
- }
- if (temp3 < 0) temp3 = 0;
- if (temp4 > 2.0f*(float)M_PI) temp4 = 2.0f*(float)M_PI;
-
-
- if(temp2 < temp3) output = 0;
- else if (temp2 > temp4) output = 1;
- else output = (temp2-temp3)/(temp4-temp3);
- if(x == 0 && y == 0) output = 1;
- if(output != output) output = 1;
- if(wipe->forward) output = 1 - output;
- break;
- /* BOX WIPE IS NOT WORKING YET */
- /* case DO_CROSS_WIPE: */
- /* BOX WIPE IS NOT WORKING YET */
- /*
- case DO_BOX_WIPE:
- if(invert)facf0 = 1-facf0;
-
- width = (int)(wipe->edgeWidth*((xo+yo)/2.0));
- hwidth = (float)width/2.0;
- if (angle == 0)angle = 0.000001;
- b1 = posy/2 - (-angle)*posx/2;
- b3 = (yo-posy/2) - (-angle)*(xo-posx/2);
- b2 = y - (-angle)*x;
-
- hyp = abs(angle*x+y+(-posy/2-angle*posx/2))*wipezone->pythangle;
- hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))*wipezone->pythangle;
-
- temp1 = xo*(1-facf0/2)-xo*facf0/2;
- temp2 = yo*(1-facf0/2)-yo*facf0/2;
- pointdist = sqrt(temp1*temp1 + temp2*temp2);
-
- if(b2 < b1 && b2 < b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp,facf0,0,1);
- } else if(b2 > b1 && b2 > b3 ){
- if(hwidth < pointdist)
- output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
- output = in_band(wipezone,hwidth,hyp,facf0,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1);
- else
- output = in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
- }
-
- if(invert)facf0 = 1-facf0;
- angle = -1/angle;
- b1 = posy/2 - (-angle)*posx/2;
- b3 = (yo-posy/2) - (-angle)*(xo-posx/2);
- b2 = y - (-angle)*x;
-
- hyp = abs(angle*x+y+(-posy/2-angle*posx/2))*wipezone->pythangle;
- hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))*wipezone->pythangle;
-
- if(b2 < b1 && b2 < b3 ){
- if(hwidth < pointdist)
- output *= in_band(wipezone,hwidth,hyp,facf0,0,1);
- } else if(b2 > b1 && b2 > b3 ){
- if(hwidth < pointdist)
- output *= in_band(wipezone,hwidth,hyp2,facf0,0,1);
- } else {
- if( hyp < hwidth && hyp2 > hwidth )
- output *= in_band(wipezone,hwidth,hyp,facf0,1,1);
- else if( hyp > hwidth && hyp2 < hwidth )
- output *= in_band(wipezone,hwidth,hyp2,facf0,1,1);
- else
- output *= in_band(wipezone,hwidth,hyp2,facf0,1,1) * in_band(wipezone,hwidth,hyp,facf0,1,1);
- }
-
- break;
-*/
- case DO_IRIS_WIPE:
- if(xo > yo) yo = xo;
- else xo = yo;
-
- if(!wipe->forward) facf0 = 1-facf0;
-
- width = wipezone->width;
- hwidth = width*0.5f;
-
- temp1 = (halfx-(halfx)*facf0);
- pointdist = sqrt(temp1*temp1 + temp1*temp1);
-
- temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y));
- if(temp2 > pointdist) output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,0,1);
- else output = in_band(wipezone,hwidth,fabs(temp2-pointdist),facf0,1,1);
-
- if(!wipe->forward) output = 1-output;
-
- break;
- }
- if (output < 0) output = 0;
- else if(output > 1) output = 1;
- return output;
-}
-
-static void init_wipe_effect(Sequence *seq)
-{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = MEM_callocN(sizeof(struct WipeVars), "wipevars");
-}
-
-static int num_inputs_wipe()
-{
- return 1;
-}
-
-static void free_wipe_effect(Sequence *seq)
-{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
-}
-
-static void copy_wipe_effect(Sequence *dst, Sequence *src)
-{
- dst->effectdata = MEM_dupallocN(src->effectdata);
-}
-
-static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1,
- int x, int y,
- unsigned char *rect1,
- unsigned char *rect2, unsigned char *out)
-{
- WipeZone wipezone;
- WipeVars *wipe = (WipeVars *)seq->effectdata;
- int xo, yo;
- char *rt1, *rt2, *rt;
-
- precalc_wipe_zone(&wipezone, wipe, x, y);
-
- rt1 = (char *)rect1;
- rt2 = (char *)rect2;
- rt = (char *)out;
-
- xo = x;
- yo = y;
- for(y=0;y<yo;y++) {
- for(x=0;x<xo;x++) {
- float check = check_zone(&wipezone,x,y,seq,facf0);
- if (check) {
- if (rt1) {
- rt[0] = (int)(rt1[0]*check)+ (int)(rt2[0]*(1-check));
- rt[1] = (int)(rt1[1]*check)+ (int)(rt2[1]*(1-check));
- rt[2] = (int)(rt1[2]*check)+ (int)(rt2[2]*(1-check));
- rt[3] = (int)(rt1[3]*check)+ (int)(rt2[3]*(1-check));
- } else {
- rt[0] = 0;
- rt[1] = 0;
- rt[2] = 0;
- rt[3] = 255;
- }
- } else {
- if (rt2) {
- rt[0] = rt2[0];
- rt[1] = rt2[1];
- rt[2] = rt2[2];
- rt[3] = rt2[3];
- } else {
- rt[0] = 0;
- rt[1] = 0;
- rt[2] = 0;
- rt[3] = 255;
- }
- }
-
- rt+=4;
- if(rt1 !=NULL){
- rt1+=4;
- }
- if(rt2 !=NULL){
- rt2+=4;
- }
- }
- }
-}
-
-static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1,
- int x, int y,
- float *rect1,
- float *rect2, float *out)
-{
- WipeZone wipezone;
- WipeVars *wipe = (WipeVars *)seq->effectdata;
- int xo, yo;
- float *rt1, *rt2, *rt;
-
- precalc_wipe_zone(&wipezone, wipe, x, y);
-
- rt1 = rect1;
- rt2 = rect2;
- rt = out;
-
- xo = x;
- yo = y;
- for(y=0;y<yo;y++) {
- for(x=0;x<xo;x++) {
- float check = check_zone(&wipezone,x,y,seq,facf0);
- if (check) {
- if (rt1) {
- rt[0] = rt1[0]*check+ rt2[0]*(1-check);
- rt[1] = rt1[1]*check+ rt2[1]*(1-check);
- rt[2] = rt1[2]*check+ rt2[2]*(1-check);
- rt[3] = rt1[3]*check+ rt2[3]*(1-check);
- } else {
- rt[0] = 0;
- rt[1] = 0;
- rt[2] = 0;
- rt[3] = 1.0;
- }
- } else {
- if (rt2) {
- rt[0] = rt2[0];
- rt[1] = rt2[1];
- rt[2] = rt2[2];
- rt[3] = rt2[3];
- } else {
- rt[0] = 0;
- rt[1] = 0;
- rt[2] = 0;
- rt[3] = 1.0;
- }
- }
-
- rt+=4;
- if(rt1 !=NULL){
- rt1+=4;
- }
- if(rt2 !=NULL){
- rt2+=4;
- }
- }
- }
-}
-
-static void do_wipe_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_wipe_effect_float(seq,
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_wipe_effect_byte(seq,
- facf0, facf1, x, y,
- (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect,
- (unsigned char*) out->rect);
- }
-}
-/* **********************************************************************
- TRANSFORM
- ********************************************************************** */
-static void init_transform_effect(Sequence *seq)
-{
- TransformVars *scale;
-
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = MEM_callocN(sizeof(struct TransformVars), "transformvars");
-
- scale = (TransformVars *)seq->effectdata;
- scale->ScalexIni = 1;
- scale->ScaleyIni = 1;
- scale->ScalexFin = 1;
- scale->ScaleyFin = 1;
-
- scale->xIni=0;
- scale->xFin=0;
- scale->yIni=0;
- scale->yFin=0;
-
- scale->rotIni=0;
- scale->rotFin=0;
-
- scale->interpolation=1;
- scale->percent=1;
-}
-
-static int num_inputs_transform()
-{
- return 1;
-}
-
-static void free_transform_effect(Sequence *seq)
-{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
-}
-
-static void copy_transform_effect(Sequence *dst, Sequence *src)
-{
- dst->effectdata = MEM_dupallocN(src->effectdata);
-}
-
-static void do_transform(Sequence * seq,float facf0, int x, int y,
- struct ImBuf *ibuf1,struct ImBuf *out)
-{
- int xo, yo, xi, yi;
- float xs,ys,factxScale,factyScale,tx,ty,rad,s,c,xaux,yaux,factRot,px,py;
- TransformVars *scale;
-
- scale = (TransformVars *)seq->effectdata;
- xo = x;
- yo = y;
-
- //factor scale
- factxScale = scale->ScalexIni + (scale->ScalexFin - scale->ScalexIni) * facf0;
- factyScale = scale->ScaleyIni + (scale->ScaleyFin - scale->ScaleyIni) * facf0;
-
- //Factor translate
- if(!scale->percent){
- tx = scale->xIni+(xo / 2.0f) + (scale->xFin-(xo / 2.0f) - scale->xIni+(xo / 2.0f)) * facf0;
- ty = scale->yIni+(yo / 2.0f) + (scale->yFin-(yo / 2.0f) - scale->yIni+(yo / 2.0f)) * facf0;
- }else{
- tx = xo*(scale->xIni/100.0)+(xo / 2.0f) + (xo*(scale->xFin/100.0)-(xo / 2.0f) - xo*(scale->xIni/100.0)+(xo / 2.0f)) * facf0;
- ty = yo*(scale->yIni/100.0)+(yo / 2.0f) + (yo*(scale->yFin/100.0)-(yo / 2.0f) - yo*(scale->yIni/100.0)+(yo / 2.0f)) * facf0;
- }
-
- //factor Rotate
- factRot = scale->rotIni + (scale->rotFin - scale->rotIni) * facf0;
- rad = (M_PI * factRot) / 180.0f;
- s= sin(rad);
- c= cos(rad);
-
- for (yi = 0; yi < yo; yi++) {
- for (xi = 0; xi < xo; xi++) {
- //tranlate point
- px = xi-tx;
- py = yi-ty;
-
- //rotate point with center ref
- xaux = c*px + py*s ;
- yaux = -s*px + c*py;
-
- //scale point with center ref
- xs = xaux / factxScale;
- ys = yaux / factyScale;
-
- //undo reference center point
- xs += (xo / 2.0f);
- ys += (yo / 2.0f);
-
- //interpolate
- if(scale->interpolation==0)
- neareast_interpolation(ibuf1,out, xs,ys,xi,yi);
- if(scale->interpolation==1)
- bilinear_interpolation(ibuf1,out, xs,ys,xi,yi);
- if(scale->interpolation==2)
- bicubic_interpolation(ibuf1,out, xs,ys,xi,yi);
- }
- }
-
-}
-static void do_transform_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- do_transform(seq, facf0, x, y, ibuf1, out);
-}
-
-
-/* **********************************************************************
- GLOW
- ********************************************************************** */
-
-static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
- float blur,
- int quality)
-/* MUUUCCH better than the previous blur. */
-/* We do the blurring in two passes which is a whole lot faster. */
-/* I changed the math arount to implement an actual Gaussian */
-/* distribution. */
-/* */
-/* Watch out though, it tends to misbehaven with large blur values on */
-/* a small bitmap. Avoid avoid avoid. */
-/*=============================== */
-{
- unsigned char* temp=NULL,*swap;
- float *filter=NULL;
- int x,y,i,fx,fy;
- int index, ix, halfWidth;
- float fval, k, curColor[3], curColor2[3], weight=0;
-
- /* If we're not really blurring, bail out */
- if (blur<=0)
- return;
-
- /* Allocate memory for the tempmap and the blur filter matrix */
- temp= MEM_mallocN( (width*height*4), "blurbitmaptemp");
- if (!temp)
- return;
-
- /* Allocate memory for the filter elements */
- halfWidth = ((quality+1)*blur);
- filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter");
- if (!filter){
- MEM_freeN (temp);
- return;
- }
-
- /* Apparently we're calculating a bell curve */
- /* based on the standard deviation (or radius) */
- /* This code is based on an example */
- /* posted to comp.graphics.algorithms by */
- /* Blancmange (bmange@airdmhor.gen.nz) */
-
- k = -1.0/(2.0*3.14159*blur*blur);
- fval=0;
- for (ix = 0;ix< halfWidth;ix++){
- weight = (float)exp(k*(ix*ix));
- filter[halfWidth - ix] = weight;
- filter[halfWidth + ix] = weight;
- }
- filter[0] = weight;
-
- /* Normalize the array */
- fval=0;
- for (ix = 0;ix< halfWidth*2;ix++)
- fval+=filter[ix];
-
- for (ix = 0;ix< halfWidth*2;ix++)
- filter[ix]/=fval;
-
- /* Blur the rows */
- for (y=0;y<height;y++){
- /* Do the left & right strips */
- for (x=0;x<halfWidth;x++){
- index=(x+y*width)*4;
- fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
-
- for (i=x-halfWidth;i<x+halfWidth;i++){
- if ((i>=0)&&(i<width)){
- curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
- curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
- curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
-
- curColor2[0]+=map[(width-1-i+y*width)*4+GlowR] *
- filter[fx];
- curColor2[1]+=map[(width-1-i+y*width)*4+GlowG] *
- filter[fx];
- curColor2[2]+=map[(width-1-i+y*width)*4+GlowB] *
- filter[fx];
- }
- fx++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
-
- temp[((width-1-x+y*width)*4)+GlowR]=curColor2[0];
- temp[((width-1-x+y*width)*4)+GlowG]=curColor2[1];
- temp[((width-1-x+y*width)*4)+GlowB]=curColor2[2];
-
- }
- /* Do the main body */
- for (x=halfWidth;x<width-halfWidth;x++){
- index=(x+y*width)*4;
- fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- for (i=x-halfWidth;i<x+halfWidth;i++){
- curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
- curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
- curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
- fx++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- }
- }
-
- /* Swap buffers */
- swap=temp;temp=map;map=swap;
-
-
- /* Blur the columns */
- for (x=0;x<width;x++){
- /* Do the top & bottom strips */
- for (y=0;y<halfWidth;y++){
- index=(x+y*width)*4;
- fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
- for (i=y-halfWidth;i<y+halfWidth;i++){
- if ((i>=0)&&(i<height)){
- /* Bottom */
- curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
- curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
- curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
-
- /* Top */
- curColor2[0]+=map[(x+(height-1-i)*width) *
- 4+GlowR]*filter[fy];
- curColor2[1]+=map[(x+(height-1-i)*width) *
- 4+GlowG]*filter[fy];
- curColor2[2]+=map[(x+(height-1-i)*width) *
- 4+GlowB]*filter[fy];
- }
- fy++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- temp[((x+(height-1-y)*width)*4)+GlowR]=curColor2[0];
- temp[((x+(height-1-y)*width)*4)+GlowG]=curColor2[1];
- temp[((x+(height-1-y)*width)*4)+GlowB]=curColor2[2];
- }
- /* Do the main body */
- for (y=halfWidth;y<height-halfWidth;y++){
- index=(x+y*width)*4;
- fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- for (i=y-halfWidth;i<y+halfWidth;i++){
- curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
- curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
- curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
- fy++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- }
- }
-
-
- /* Swap buffers */
- swap=temp;temp=map;map=swap;
-
- /* Tidy up */
- MEM_freeN (filter);
- MEM_freeN (temp);
-}
-
-static void RVBlurBitmap2_float ( float* map, int width,int height,
- float blur,
- int quality)
-/* MUUUCCH better than the previous blur. */
-/* We do the blurring in two passes which is a whole lot faster. */
-/* I changed the math arount to implement an actual Gaussian */
-/* distribution. */
-/* */
-/* Watch out though, it tends to misbehaven with large blur values on */
-/* a small bitmap. Avoid avoid avoid. */
-/*=============================== */
-{
- float* temp=NULL,*swap;
- float *filter=NULL;
- int x,y,i,fx,fy;
- int index, ix, halfWidth;
- float fval, k, curColor[3], curColor2[3], weight=0;
-
- /* If we're not really blurring, bail out */
- if (blur<=0)
- return;
-
- /* Allocate memory for the tempmap and the blur filter matrix */
- temp= MEM_mallocN( (width*height*4*sizeof(float)), "blurbitmaptemp");
- if (!temp)
- return;
-
- /* Allocate memory for the filter elements */
- halfWidth = ((quality+1)*blur);
- filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter");
- if (!filter){
- MEM_freeN (temp);
- return;
- }
-
- /* Apparently we're calculating a bell curve */
- /* based on the standard deviation (or radius) */
- /* This code is based on an example */
- /* posted to comp.graphics.algorithms by */
- /* Blancmange (bmange@airdmhor.gen.nz) */
-
- k = -1.0/(2.0*3.14159*blur*blur);
- fval=0;
- for (ix = 0;ix< halfWidth;ix++){
- weight = (float)exp(k*(ix*ix));
- filter[halfWidth - ix] = weight;
- filter[halfWidth + ix] = weight;
- }
- filter[0] = weight;
-
- /* Normalize the array */
- fval=0;
- for (ix = 0;ix< halfWidth*2;ix++)
- fval+=filter[ix];
-
- for (ix = 0;ix< halfWidth*2;ix++)
- filter[ix]/=fval;
-
- /* Blur the rows */
- for (y=0;y<height;y++){
- /* Do the left & right strips */
- for (x=0;x<halfWidth;x++){
- index=(x+y*width)*4;
- fx=0;
- curColor[0]=curColor[1]=curColor[2]=0.0f;
- curColor2[0]=curColor2[1]=curColor2[2]=0.0f;
-
- for (i=x-halfWidth;i<x+halfWidth;i++){
- if ((i>=0)&&(i<width)){
- curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
- curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
- curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
-
- curColor2[0]+=map[(width-1-i+y*width)*4+GlowR] *
- filter[fx];
- curColor2[1]+=map[(width-1-i+y*width)*4+GlowG] *
- filter[fx];
- curColor2[2]+=map[(width-1-i+y*width)*4+GlowB] *
- filter[fx];
- }
- fx++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
-
- temp[((width-1-x+y*width)*4)+GlowR]=curColor2[0];
- temp[((width-1-x+y*width)*4)+GlowG]=curColor2[1];
- temp[((width-1-x+y*width)*4)+GlowB]=curColor2[2];
-
- }
- /* Do the main body */
- for (x=halfWidth;x<width-halfWidth;x++){
- index=(x+y*width)*4;
- fx=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- for (i=x-halfWidth;i<x+halfWidth;i++){
- curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
- curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
- curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
- fx++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- }
- }
-
- /* Swap buffers */
- swap=temp;temp=map;map=swap;
-
-
- /* Blur the columns */
- for (x=0;x<width;x++){
- /* Do the top & bottom strips */
- for (y=0;y<halfWidth;y++){
- index=(x+y*width)*4;
- fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- curColor2[0]=curColor2[1]=curColor2[2]=0;
- for (i=y-halfWidth;i<y+halfWidth;i++){
- if ((i>=0)&&(i<height)){
- /* Bottom */
- curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
- curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
- curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
-
- /* Top */
- curColor2[0]+=map[(x+(height-1-i)*width) *
- 4+GlowR]*filter[fy];
- curColor2[1]+=map[(x+(height-1-i)*width) *
- 4+GlowG]*filter[fy];
- curColor2[2]+=map[(x+(height-1-i)*width) *
- 4+GlowB]*filter[fy];
- }
- fy++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- temp[((x+(height-1-y)*width)*4)+GlowR]=curColor2[0];
- temp[((x+(height-1-y)*width)*4)+GlowG]=curColor2[1];
- temp[((x+(height-1-y)*width)*4)+GlowB]=curColor2[2];
- }
- /* Do the main body */
- for (y=halfWidth;y<height-halfWidth;y++){
- index=(x+y*width)*4;
- fy=0;
- curColor[0]=curColor[1]=curColor[2]=0;
- for (i=y-halfWidth;i<y+halfWidth;i++){
- curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
- curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
- curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
- fy++;
- }
- temp[index+GlowR]=curColor[0];
- temp[index+GlowG]=curColor[1];
- temp[index+GlowB]=curColor[2];
- }
- }
-
-
- /* Swap buffers */
- swap=temp;temp=map;map=swap;
-
- /* Tidy up */
- MEM_freeN (filter);
- MEM_freeN (temp);
-}
-
-
-/* Adds two bitmaps and puts the results into a third map. */
-/* C must have been previously allocated but it may be A or B. */
-/* We clamp values to 255 to prevent weirdness */
-/*=============================== */
-static void RVAddBitmaps_byte (unsigned char* a, unsigned char* b, unsigned char* c, int width, int height)
-{
- int x,y,index;
-
- for (y=0;y<height;y++){
- for (x=0;x<width;x++){
- index=(x+y*width)*4;
- c[index+GlowR]=MIN2(255,a[index+GlowR]+b[index+GlowR]);
- c[index+GlowG]=MIN2(255,a[index+GlowG]+b[index+GlowG]);
- c[index+GlowB]=MIN2(255,a[index+GlowB]+b[index+GlowB]);
- c[index+GlowA]=MIN2(255,a[index+GlowA]+b[index+GlowA]);
- }
- }
-}
-
-static void RVAddBitmaps_float (float* a, float* b, float* c,
- int width, int height)
-{
- int x,y,index;
-
- for (y=0;y<height;y++){
- for (x=0;x<width;x++){
- index=(x+y*width)*4;
- c[index+GlowR]=MIN2(1.0,a[index+GlowR]+b[index+GlowR]);
- c[index+GlowG]=MIN2(1.0,a[index+GlowG]+b[index+GlowG]);
- c[index+GlowB]=MIN2(1.0,a[index+GlowB]+b[index+GlowB]);
- c[index+GlowA]=MIN2(1.0,a[index+GlowA]+b[index+GlowA]);
- }
- }
-}
-
-/* For each pixel whose total luminance exceeds the threshold, */
-/* Multiply it's value by BOOST and add it to the output map */
-static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
- int width, int height, int threshold,
- float boost, float clamp)
-{
- int x,y,index;
- int intensity;
-
-
- for(y=0;y< height;y++) {
- for (x=0;x< width;x++) {
- index= (x+y*width)*4;
-
- /* Isolate the intensity */
- intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
- if (intensity>0){
- out[index+GlowR]=MIN2(255*clamp, (in[index+GlowR]*boost*intensity)/255);
- out[index+GlowG]=MIN2(255*clamp, (in[index+GlowG]*boost*intensity)/255);
- out[index+GlowB]=MIN2(255*clamp, (in[index+GlowB]*boost*intensity)/255);
- out[index+GlowA]=MIN2(255*clamp, (in[index+GlowA]*boost*intensity)/255);
- } else{
- out[index+GlowR]=0;
- out[index+GlowG]=0;
- out[index+GlowB]=0;
- out[index+GlowA]=0;
- }
- }
- }
-}
-
-static void RVIsolateHighlights_float (float* in, float* out,
- int width, int height, float threshold,
- float boost, float clamp)
-{
- int x,y,index;
- float intensity;
-
-
- for(y=0;y< height;y++) {
- for (x=0;x< width;x++) {
- index= (x+y*width)*4;
-
- /* Isolate the intensity */
- intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
- if (intensity>0){
- out[index+GlowR]=MIN2(clamp, (in[index+GlowR]*boost*intensity));
- out[index+GlowG]=MIN2(clamp, (in[index+GlowG]*boost*intensity));
- out[index+GlowB]=MIN2(clamp, (in[index+GlowB]*boost*intensity));
- out[index+GlowA]=MIN2(clamp, (in[index+GlowA]*boost*intensity));
- } else{
- out[index+GlowR]=0;
- out[index+GlowG]=0;
- out[index+GlowB]=0;
- out[index+GlowA]=0;
- }
- }
- }
-}
-
-static void init_glow_effect(Sequence *seq)
-{
- GlowVars *glow;
-
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = MEM_callocN(sizeof(struct GlowVars), "glowvars");
-
- glow = (GlowVars *)seq->effectdata;
- glow->fMini = 0.25;
- glow->fClamp = 1.0;
- glow->fBoost = 0.5;
- glow->dDist = 3.0;
- glow->dQuality = 3;
- glow->bNoComp = 0;
-}
-
-static int num_inputs_glow()
-{
- return 1;
-}
-
-static void free_glow_effect(Sequence *seq)
-{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
-}
-
-static void copy_glow_effect(Sequence *dst, Sequence *src)
-{
- dst->effectdata = MEM_dupallocN(src->effectdata);
-}
-
-//void do_glow_effect(Cast *cast, float facf0, float facf1, int xo, int yo, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *outbuf, ImBuf *use)
-static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1,
- int x, int y, char *rect1,
- char *rect2, char *out)
-{
- unsigned char *outbuf=(unsigned char *)out;
- unsigned char *inbuf=(unsigned char *)rect1;
- GlowVars *glow = (GlowVars *)seq->effectdata;
- struct RenderData *rd = &G.scene->r;
-
- RVIsolateHighlights_byte(inbuf, outbuf , x, y, glow->fMini*765, glow->fBoost * facf0, glow->fClamp);
- RVBlurBitmap2_byte (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality);
- if (!glow->bNoComp)
- RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y);
-}
-
-static void do_glow_effect_float(Sequence *seq, float facf0, float facf1,
- int x, int y,
- float *rect1, float *rect2, float *out)
-{
- float *outbuf = out;
- float *inbuf = rect1;
- GlowVars *glow = (GlowVars *)seq->effectdata;
- struct RenderData *rd = &G.scene->r;
-
- RVIsolateHighlights_float(inbuf, outbuf , x, y, glow->fMini*3.0f, glow->fBoost * facf0, glow->fClamp);
- RVBlurBitmap2_float (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality);
- if (!glow->bNoComp)
- RVAddBitmaps_float (inbuf , outbuf, outbuf, x, y);
-}
-
-static void do_glow_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- if (out->rect_float) {
- do_glow_effect_float(seq,
- facf0, facf1, x, y,
- ibuf1->rect_float, ibuf2->rect_float,
- out->rect_float);
- } else {
- do_glow_effect_byte(seq,
- facf0, facf1, x, y,
- (char*) ibuf1->rect, (char*) ibuf2->rect,
- (char*) out->rect);
- }
-}
-
-/* **********************************************************************
- SOLID COLOR
- ********************************************************************** */
-
-static void init_solid_color(Sequence *seq)
-{
- SolidColorVars *cv;
-
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor");
-
- cv = (SolidColorVars *)seq->effectdata;
- cv->col[0] = cv->col[1] = cv->col[2] = 0.5;
-}
-
-static int num_inputs_color()
-{
- return 0;
-}
-
-static void free_solid_color(Sequence *seq)
-{
- if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
-}
-
-static void copy_solid_color(Sequence *dst, Sequence *src)
-{
- dst->effectdata = MEM_dupallocN(src->effectdata);
-}
-
-static int early_out_color(struct Sequence *seq,
- float facf0, float facf1)
-{
- return -1;
-}
-
-static void do_solid_color(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
- SolidColorVars *cv = (SolidColorVars *)seq->effectdata;
-
- unsigned char *rect;
- float *rect_float;
-
- if (out->rect) {
- unsigned char col0[3];
- unsigned char col1[3];
-
- col0[0] = facf0 * cv->col[0] * 255;
- col0[1] = facf0 * cv->col[1] * 255;
- col0[2] = facf0 * cv->col[2] * 255;
-
- col1[0] = facf1 * cv->col[0] * 255;
- col1[1] = facf1 * cv->col[1] * 255;
- col1[2] = facf1 * cv->col[2] * 255;
-
- rect = (unsigned char *)out->rect;
-
- for(y=0; y<out->y; y++) {
- for(x=0; x<out->x; x++, rect+=4) {
- rect[0]= col0[0];
- rect[1]= col0[1];
- rect[2]= col0[2];
- rect[3]= 255;
- }
- y++;
- if (y<out->y) {
- for(x=0; x<out->x; x++, rect+=4) {
- rect[0]= col1[0];
- rect[1]= col1[1];
- rect[2]= col1[2];
- rect[3]= 255;
- }
- }
- }
-
- } else if (out->rect_float) {
- float col0[3];
- float col1[3];
-
- col0[0] = facf0 * cv->col[0];
- col0[1] = facf0 * cv->col[1];
- col0[2] = facf0 * cv->col[2];
-
- col1[0] = facf1 * cv->col[0];
- col1[1] = facf1 * cv->col[1];
- col1[2] = facf1 * cv->col[2];
-
- rect_float = out->rect_float;
-
- for(y=0; y<out->y; y++) {
- for(x=0; x<out->x; x++, rect_float+=4) {
- rect_float[0]= col0[0];
- rect_float[1]= col0[1];
- rect_float[2]= col0[2];
- rect_float[3]= 1.0;
- }
- y++;
- if (y<out->y) {
- for(x=0; x<out->x; x++, rect_float+=4) {
- rect_float[0]= col1[0];
- rect_float[1]= col1[1];
- rect_float[2]= col1[2];
- rect_float[3]= 1.0;
- }
- }
- }
- }
-}
-
-/* **********************************************************************
- SPEED
- ********************************************************************** */
-static void init_speed_effect(Sequence *seq)
-{
- SpeedControlVars * v;
-
- if(seq->effectdata) MEM_freeN(seq->effectdata);
- seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars),
- "speedcontrolvars");
-
- v = (SpeedControlVars *)seq->effectdata;
- v->globalSpeed = 1.0;
- v->frameMap = 0;
- v->flags = SEQ_SPEED_COMPRESS_IPO_Y;
- v->length = 0;
-}
-
-static void load_speed_effect(Sequence * seq)
-{
- SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
-
- v->frameMap = 0;
- v->length = 0;
-}
-
-static int num_inputs_speed()
-{
- return 1;
-}
-
-static void free_speed_effect(Sequence *seq)
-{
- SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
- if(v->frameMap) MEM_freeN(v->frameMap);
- if(seq->effectdata) MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
-}
-
-static void copy_speed_effect(Sequence *dst, Sequence *src)
-{
- SpeedControlVars * v;
- dst->effectdata = MEM_dupallocN(src->effectdata);
- v = (SpeedControlVars *)dst->effectdata;
- v->frameMap = 0;
- v->length = 0;
-}
-
-static int early_out_speed(struct Sequence *seq,
- float facf0, float facf1)
-{
- return 1;
-}
-
-static void store_icu_yrange_speed(struct Sequence * seq,
- short adrcode, float * ymin, float * ymax)
-{
- SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
-
- /* if not already done, load / initialize data */
- get_sequence_effect(seq);
-
- if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
- *ymin = -100.0;
- *ymax = 100.0;
- } else {
- if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
- *ymin = 0.0;
- *ymax = 1.0;
- } else {
- *ymin = 0.0;
- *ymax = seq->len;
- }
- }
-}
-
-void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force)
-{
- float facf0 = seq->facf0;
- float ctime, div;
- int cfra;
- float fallback_fac;
- SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
-
- /* if not already done, load / initialize data */
- get_sequence_effect(seq);
-
- if (!(force || seq->len != v->length || !v->frameMap)) {
- return;
- }
-
- if (!v->frameMap || v->length != seq->len) {
- if (v->frameMap) MEM_freeN(v->frameMap);
-
- v->length = seq->len;
-
- v->frameMap = MEM_callocN(sizeof(float) * v->length,
- "speedcontrol frameMap");
- }
-
- fallback_fac = 1.0;
-
- /* if there is no IPO, try to make retiming easy by stretching the
- strip */
-
- if (!seq->ipo && seq->seq1 && seq->seq1->enddisp != seq->seq1->start
- && seq->seq1->len != 0) {
- fallback_fac = (float) seq->seq1->len /
- (float) (seq->seq1->enddisp - seq->seq1->start);
- /* FIXME: this strip stretching gets screwed by stripdata
- handling one layer up.
-
- So it currently works by enlarging, never by shrinking!
-
- (IPOs still work, if used correctly)
- */
- if (fallback_fac > 1.0) {
- fallback_fac = 1.0;
- }
- }
-
- if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
- float cursor = 0;
-
- v->frameMap[0] = 0;
- v->lastValidFrame = 0;
-
- for (cfra = 1; cfra < v->length; cfra++) {
- if(seq->ipo) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = frame_to_float(seq->startdisp
- + cfra);
- div = 1.0;
- } else {
- ctime= frame_to_float(cfra);
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
-
- calc_ipo(seq->ipo, ctime/div);
- execute_ipo((ID *)seq, seq->ipo);
- } else {
- seq->facf0 = fallback_fac;
- }
- seq->facf0 *= v->globalSpeed;
-
- cursor += seq->facf0;
-
- if (cursor >= v->length) {
- v->frameMap[cfra] = v->length - 1;
- } else {
- v->frameMap[cfra] = cursor;
- v->lastValidFrame = cfra;
- }
- }
- } else {
- v->lastValidFrame = 0;
- for (cfra = 0; cfra < v->length; cfra++) {
- if(seq->ipo) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = frame_to_float(seq->startdisp
- + cfra);
- div = 1.0;
- } else {
- ctime= frame_to_float(cfra);
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
-
- calc_ipo(seq->ipo, ctime/div);
- execute_ipo((ID *)seq, seq->ipo);
- }
-
- if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
- seq->facf0 *= v->length;
- }
- if (!seq->ipo) {
- seq->facf0 = (float) cfra * fallback_fac;
- }
- seq->facf0 *= v->globalSpeed;
- if (seq->facf0 >= v->length) {
- seq->facf0 = v->length - 1;
- } else {
- v->lastValidFrame = cfra;
- }
- v->frameMap[cfra] = seq->facf0;
- }
- }
- seq->facf0 = facf0;
-}
-
-/*
- simply reuse do_cross_effect for blending...
-
-static void do_speed_effect(Sequence * seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
-{
-
-}
-*/
-
-
-/* **********************************************************************
- sequence effect factory
- ********************************************************************** */
-
-
-static void init_noop(struct Sequence *seq)
-{
-
-}
-
-static void load_noop(struct Sequence *seq)
-{
-
-}
-
-static void init_plugin_noop(struct Sequence *seq, const char * fname)
-{
-
-}
-
-static void free_noop(struct Sequence *seq)
-{
-
-}
-
-static int num_inputs_default()
-{
- return 2;
-}
-
-static int early_out_noop(struct Sequence *seq,
- float facf0, float facf1)
-{
- return 0;
-}
-
-static int early_out_fade(struct Sequence *seq,
- float facf0, float facf1)
-{
- if (facf0 == 0.0 && facf1 == 0.0) {
- return 1;
- } else if (facf0 == 1.0 && facf1 == 1.0) {
- return 2;
- }
- return 0;
-}
-
-static int early_out_mul_input2(struct Sequence *seq,
- float facf0, float facf1)
-{
- if (facf0 == 0.0 && facf1 == 0.0) {
- return 1;
- }
- return 0;
-}
-
-static void store_icu_yrange_noop(struct Sequence * seq,
- short adrcode, float * ymin, float * ymax)
-{
- /* defaults are fine */
-}
-
-static void get_default_fac_noop(struct Sequence *seq, int cfra,
- float * facf0, float * facf1)
-{
- *facf0 = *facf1 = 1.0;
-}
-
-static void get_default_fac_fade(struct Sequence *seq, int cfra,
- float * facf0, float * facf1)
-{
- *facf0 = (float)(cfra - seq->startdisp);
- *facf1 = (float)(*facf0 + 0.5);
- *facf0 /= seq->len;
- *facf1 /= seq->len;
-}
-
-static void do_overdrop_effect(struct Sequence * seq, int cfra,
- float fac, float facf,
- int x, int y, struct ImBuf * ibuf1,
- struct ImBuf * ibuf2,
- struct ImBuf * ibuf3,
- struct ImBuf * out)
-{
- do_drop_effect(seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
- do_alphaover_effect(seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
-}
-
-static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
-{
- struct SeqEffectHandle rval;
- int sequence_type = seq_type;
-
- rval.init = init_noop;
- rval.init_plugin = init_plugin_noop;
- rval.num_inputs = num_inputs_default;
- rval.load = load_noop;
- rval.free = free_noop;
- rval.early_out = early_out_noop;
- rval.get_default_fac = get_default_fac_noop;
- rval.store_icu_yrange = store_icu_yrange_noop;
- rval.execute = NULL;
- rval.copy = NULL;
-
- switch (sequence_type) {
- case SEQ_CROSS:
- rval.execute = do_cross_effect;
- rval.early_out = early_out_fade;
- rval.get_default_fac = get_default_fac_fade;
- break;
- case SEQ_GAMCROSS:
- rval.init = init_gammacross;
- rval.load = load_gammacross;
- rval.free = free_gammacross;
- rval.early_out = early_out_fade;
- rval.get_default_fac = get_default_fac_fade;
- rval.execute = do_gammacross_effect;
- break;
- case SEQ_ADD:
- rval.execute = do_add_effect;
- rval.early_out = early_out_mul_input2;
- break;
- case SEQ_SUB:
- rval.execute = do_sub_effect;
- rval.early_out = early_out_mul_input2;
- break;
- case SEQ_MUL:
- rval.execute = do_mul_effect;
- rval.early_out = early_out_mul_input2;
- break;
- case SEQ_ALPHAOVER:
- rval.init = init_alpha_over_or_under;
- rval.execute = do_alphaover_effect;
- break;
- case SEQ_OVERDROP:
- rval.execute = do_overdrop_effect;
- break;
- case SEQ_ALPHAUNDER:
- rval.init = init_alpha_over_or_under;
- rval.execute = do_alphaunder_effect;
- break;
- case SEQ_WIPE:
- rval.init = init_wipe_effect;
- rval.num_inputs = num_inputs_wipe;
- rval.free = free_wipe_effect;
- rval.copy = copy_wipe_effect;
- rval.early_out = early_out_fade;
- rval.get_default_fac = get_default_fac_fade;
- rval.execute = do_wipe_effect;
- break;
- case SEQ_GLOW:
- rval.init = init_glow_effect;
- rval.num_inputs = num_inputs_glow;
- rval.free = free_glow_effect;
- rval.copy = copy_glow_effect;
- rval.execute = do_glow_effect;
- break;
- case SEQ_TRANSFORM:
- rval.init = init_transform_effect;
- rval.num_inputs = num_inputs_transform;
- rval.free = free_transform_effect;
- rval.copy = copy_transform_effect;
- rval.execute = do_transform_effect;
- break;
- case SEQ_SPEED:
- rval.init = init_speed_effect;
- rval.num_inputs = num_inputs_speed;
- rval.load = load_speed_effect;
- rval.free = free_speed_effect;
- rval.copy = copy_speed_effect;
- rval.execute = do_cross_effect;
- rval.early_out = early_out_speed;
- rval.store_icu_yrange = store_icu_yrange_speed;
- break;
- case SEQ_COLOR:
- rval.init = init_solid_color;
- rval.num_inputs = num_inputs_color;
- rval.early_out = early_out_color;
- rval.free = free_solid_color;
- rval.copy = copy_solid_color;
- rval.execute = do_solid_color;
- break;
- case SEQ_PLUGIN:
- rval.init_plugin = init_plugin;
- rval.num_inputs = num_inputs_plugin;
- rval.load = load_plugin;
- rval.free = free_plugin;
- rval.copy = copy_plugin;
- rval.execute = do_plugin_effect;
- rval.early_out = do_plugin_early_out;
- rval.get_default_fac = get_default_fac_fade;
- break;
- }
-
- return rval;
-}
-
-
-struct SeqEffectHandle get_sequence_effect(Sequence * seq)
-{
- struct SeqEffectHandle rval;
-
- memset(&rval, 0, sizeof(struct SeqEffectHandle));
-
- if (seq->type & SEQ_EFFECT) {
- rval = get_sequence_effect_impl(seq->type);
- if ((seq->flag & SEQ_EFFECT_NOT_LOADED) != 0) {
- rval.load(seq);
- seq->flag &= ~SEQ_EFFECT_NOT_LOADED;
- }
- }
-
- return rval;
-}
-
-struct SeqEffectHandle get_sequence_blend(Sequence * seq)
-{
- struct SeqEffectHandle rval;
-
- memset(&rval, 0, sizeof(struct SeqEffectHandle));
-
- if (seq->blend_mode != 0) {
- rval = get_sequence_effect_impl(seq->blend_mode);
- if ((seq->flag & SEQ_EFFECT_NOT_LOADED) != 0) {
- rval.load(seq);
- seq->flag &= ~SEQ_EFFECT_NOT_LOADED;
- }
- }
-
- return rval;
-}
-
-int get_sequence_effect_num_inputs(int seq_type)
-{
- struct SeqEffectHandle rval = get_sequence_effect_impl(seq_type);
-
- int cnt = rval.num_inputs();
- if (rval.execute) {
- return cnt;
- }
- return 0;
-}
diff --git a/source/blender/src/seqscopes.c b/source/blender/src/seqscopes.c
deleted file mode 100644
index 553752c0676..00000000000
--- a/source/blender/src/seqscopes.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Author: Peter Schlaile < peter [at] schlaile [dot] de >
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#include "BSE_seqscopes.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-#include "BKE_utildefines.h"
-#include <math.h>
-#include <string.h>
-
-static void rgb_to_yuv(float rgb[3], float yuv[3]) {
- yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
- yuv[1]= 0.492*(rgb[2] - yuv[0]);
- yuv[2]= 0.877*(rgb[0] - yuv[0]);
-
- /* Normalize */
- yuv[1]*= 255.0/(122*2.0);
- yuv[1]+= 0.5;
-
- yuv[2]*= 255.0/(157*2.0);
- yuv[2]+= 0.5;
-}
-
-static void scope_put_pixel(unsigned char* table, unsigned char * pos)
-{
- char newval = table[*pos];
- pos[0] = pos[1] = pos[2] = newval;
- pos[3] = 255;
-}
-
-static void scope_put_pixel_single(unsigned char* table, unsigned char * pos,
- int col)
-{
- char newval = table[pos[col]];
- pos[col] = newval;
- pos[3] = 255;
-}
-
-static void wform_put_line(int w,
- unsigned char * last_pos, unsigned char * new_pos)
-{
- if (last_pos > new_pos) {
- unsigned char* temp = new_pos;
- new_pos = last_pos;
- last_pos = temp;
- }
-
- while (last_pos < new_pos) {
- if (last_pos[0] == 0) {
- last_pos[0] = last_pos[1] = last_pos[2] = 32;
- last_pos[3] = 255;
- }
- last_pos += 4*w;
- }
-}
-
-static void wform_put_line_single(
- int w, unsigned char * last_pos, unsigned char * new_pos, int col)
-{
- if (last_pos > new_pos) {
- unsigned char* temp = new_pos;
- new_pos = last_pos;
- last_pos = temp;
- }
-
- while (last_pos < new_pos) {
- if (last_pos[col] == 0) {
- last_pos[col] = 32;
- last_pos[3] = 255;
- }
- last_pos += 4*w;
- }
-}
-
-static void wform_put_border(unsigned char * tgt, int w, int h)
-{
- int x, y;
-
- for (x = 0; x < w; x++) {
- unsigned char * p = tgt + 4 * x;
- p[1] = p[3] = 255.0;
- p[4 * w + 1] = p[4 * w + 3] = 255.0;
- p = tgt + 4 * (w * (h - 1) + x);
- p[1] = p[3] = 255.0;
- p[-4 * w + 1] = p[-4 * w + 3] = 255.0;
- }
-
- for (y = 0; y < h; y++) {
- unsigned char * p = tgt + 4 * w * y;
- p[1] = p[3] = 255.0;
- p[4 + 1] = p[4 + 3] = 255.0;
- p = tgt + 4 * (w * y + w - 1);
- p[1] = p[3] = 255.0;
- p[-4 + 1] = p[-4 + 3] = 255.0;
- }
-}
-
-static void wform_put_gridrow(unsigned char * tgt, float perc, int w, int h)
-{
- int i;
-
- tgt += (int) (perc/100.0 * h) * w * 4;
-
- for (i = 0; i < w*2; i++) {
- tgt[0] = 255;
-
- tgt += 4;
- }
-}
-
-static void wform_put_grid(unsigned char * tgt, int w, int h)
-{
- wform_put_gridrow(tgt, 90.0, w, h);
- wform_put_gridrow(tgt, 70.0, w, h);
- wform_put_gridrow(tgt, 10.0, w, h);
-}
-
-static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0);
- int x,y;
- unsigned char* src = (unsigned char*) ibuf->rect;
- unsigned char* tgt = (unsigned char*) rval->rect;
- int w = ibuf->x + 3;
- int h = 515;
- float waveform_gamma = 0.2;
- unsigned char wtable[256];
-
- wform_put_grid(tgt, w, h);
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p = 0;
-
- for (x = 0; x < ibuf->x; x++) {
- unsigned char * rgb = src + 4 * (ibuf->x * y + x);
- float v = 1.0 *
- ( 0.299*rgb[0]
- + 0.587*rgb[1]
- + 0.114*rgb[2]) / 255.0;
- unsigned char * p = tgt;
- p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1);
-
- scope_put_pixel(wtable, p);
- p += 4 * w;
- scope_put_pixel(wtable, p);
-
- if (last_p != 0) {
- wform_put_line(w, last_p, p);
- }
- last_p = p;
- }
- }
-
- wform_put_border(tgt, w, h);
-
- return rval;
-}
-
-static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0);
- int x,y;
- float* src = ibuf->rect_float;
- unsigned char* tgt = (unsigned char*) rval->rect;
- int w = ibuf->x + 3;
- int h = 515;
- float waveform_gamma = 0.2;
- unsigned char wtable[256];
-
- wform_put_grid(tgt, w, h);
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p = 0;
-
- for (x = 0; x < ibuf->x; x++) {
- float * rgb = src + 4 * (ibuf->x * y + x);
- float v = 1.0 *
- ( 0.299*rgb[0]
- + 0.587*rgb[1]
- + 0.114*rgb[2]);
- unsigned char * p = tgt;
-
- CLAMP(v, 0.0, 1.0);
-
- p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1);
-
- scope_put_pixel(wtable, p);
- p += 4 * w;
- scope_put_pixel(wtable, p);
-
- if (last_p != 0) {
- wform_put_line(w, last_p, p);
- }
- last_p = p;
- }
- }
-
- wform_put_border(tgt, w, h);
-
- return rval;
-}
-
-struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf)
-{
- if (ibuf->rect_float) {
- return make_waveform_view_from_ibuf_float(ibuf);
- } else {
- return make_waveform_view_from_ibuf_byte(ibuf);
- }
-}
-
-
-static struct ImBuf *make_sep_waveform_view_from_ibuf_byte(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(
- ibuf->x + 3, 515, 32, IB_rect, 0);
- int x,y;
- unsigned char* src = (unsigned char*) ibuf->rect;
- unsigned char* tgt = (unsigned char*) rval->rect;
- int w = ibuf->x + 3;
- int sw = ibuf->x/3;
- int h = 515;
- float waveform_gamma = 0.2;
- unsigned char wtable[256];
-
- wform_put_grid(tgt, w, h);
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p[3] = {0,0,0};
-
- for (x = 0; x < ibuf->x; x++) {
- int c;
- unsigned char * rgb = src + 4 * (ibuf->x * y + x);
- for (c = 0; c < 3; c++) {
- unsigned char * p = tgt;
- p += 4 * (w * ((rgb[c] * (h - 3))/255 + 1)
- + c * sw + x/3 + 1);
-
- scope_put_pixel_single(wtable, p, c);
- p += 4 * w;
- scope_put_pixel_single(wtable, p, c);
-
- if (last_p[c] != 0) {
- wform_put_line_single(
- w, last_p[c], p, c);
- }
- last_p[c] = p;
- }
- }
- }
-
- wform_put_border(tgt, w, h);
-
- return rval;
-}
-
-static struct ImBuf *make_sep_waveform_view_from_ibuf_float(
- struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(
- ibuf->x + 3, 515, 32, IB_rect, 0);
- int x,y;
- float* src = ibuf->rect_float;
- unsigned char* tgt = (unsigned char*) rval->rect;
- int w = ibuf->x + 3;
- int sw = ibuf->x/3;
- int h = 515;
- float waveform_gamma = 0.2;
- unsigned char wtable[256];
-
- wform_put_grid(tgt, w, h);
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- waveform_gamma)*255);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- unsigned char * last_p[3] = {0, 0, 0};
-
- for (x = 0; x < ibuf->x; x++) {
- int c;
- float * rgb = src + 4 * (ibuf->x * y + x);
- for (c = 0; c < 3; c++) {
- unsigned char * p = tgt;
- float v = rgb[c];
-
- CLAMP(v, 0.0, 1.0);
-
- p += 4 * (w * ((int) (v * (h - 3)) + 1)
- + c * sw + x/3 + 1);
-
- scope_put_pixel_single(wtable, p, c);
- p += 4 * w;
- scope_put_pixel_single(wtable, p, c);
-
- if (last_p[c] != 0) {
- wform_put_line_single(
- w, last_p[c], p, c);
- }
- last_p[c] = p;
- }
- }
- }
-
- wform_put_border(tgt, w, h);
-
- return rval;
-}
-
-struct ImBuf *make_sep_waveform_view_from_ibuf(struct ImBuf * ibuf)
-{
- if (ibuf->rect_float) {
- return make_sep_waveform_view_from_ibuf_float(ibuf);
- } else {
- return make_sep_waveform_view_from_ibuf_byte(ibuf);
- }
-}
-
-static void draw_zebra_byte(struct ImBuf * src,struct ImBuf * ibuf, float perc)
-{
- unsigned int limit = 255 * perc / 100.0;
- unsigned char * p = (unsigned char*) src->rect;
- unsigned char * o = (unsigned char*) ibuf->rect;
- int x;
- int y;
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- unsigned char r = *p++;
- unsigned char g = *p++;
- unsigned char b = *p++;
- unsigned char a = *p++;
-
- if (r >= limit || g >= limit || b >= limit) {
- if (((x + y) & 0x08) != 0) {
- r = 255 - r;
- g = 255 - g;
- b = 255 - b;
- }
- }
- *o++ = r;
- *o++ = g;
- *o++ = b;
- *o++ = a;
- }
- }
-}
-
-
-static void draw_zebra_float(struct ImBuf * src,struct ImBuf * ibuf,float perc)
-{
- float limit = perc / 100.0;
- float * p = src->rect_float;
- unsigned char * o = (unsigned char*) ibuf->rect;
- int x;
- int y;
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- float r = *p++;
- float g = *p++;
- float b = *p++;
- float a = *p++;
-
- if (r >= limit || g >= limit || b >= limit) {
- if (((x + y) & 0x08) != 0) {
- r = -r;
- g = -g;
- b = -b;
- }
- }
-
- *o++ = FTOCHAR(r);
- *o++ = FTOCHAR(g);
- *o++ = FTOCHAR(b);
- *o++ = FTOCHAR(a);
- }
- }
-}
-
-struct ImBuf * make_zebra_view_from_ibuf(struct ImBuf * src, float perc)
-{
- struct ImBuf * ibuf = IMB_allocImBuf(src->x, src->y, 32, IB_rect, 0);
-
- if (src->rect_float) {
- draw_zebra_float(src, ibuf, perc);
- } else {
- draw_zebra_byte(src, ibuf, perc);
- }
- return ibuf;
-}
-
-static void draw_histogram_marker(struct ImBuf * ibuf, int x)
-{
- unsigned char * p = (unsigned char*) ibuf->rect;
- int barh = ibuf->y * 0.1;
- int i;
-
- p += 4 * (x + ibuf->x * (ibuf->y - barh + 1));
-
- for (i = 0; i < barh-1; i++) {
- p[0] = p[1] = p[2] = 255;
- p += ibuf->x * 4;
- }
-}
-
-static void draw_histogram_bar(struct ImBuf * ibuf, int x,float val, int col)
-{
- unsigned char * p = (unsigned char*) ibuf->rect;
- int barh = ibuf->y * val * 0.9;
- int i;
-
- p += 4 * (x + ibuf->x);
-
- for (i = 0; i < barh; i++) {
- p[col] = 255;
- p += ibuf->x * 4;
- }
-}
-
-static struct ImBuf *make_histogram_view_from_ibuf_byte(
- struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect, 0);
- int n,c,x,y;
- unsigned char* src = (unsigned char*) ibuf->rect;
-
- unsigned int bins[3][256];
-
- memset(bins, 0, 3 * 256* sizeof(unsigned int));
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- bins[0][*src++]++;
- bins[1][*src++]++;
- bins[2][*src++]++;
- src++;
- }
- }
-
- n = 0;
- for (c = 0; c < 3; c++) {
- for (x = 0; x < 256; x++) {
- if (bins[c][x] > n) {
- n = bins[c][x];
- }
- }
- }
-
- for (c = 0; c < 3; c++) {
- for (x = 0; x < 256; x++) {
- draw_histogram_bar(rval, x*2+1,
- ((float) bins[c][x])/n, c);
- draw_histogram_bar(rval, x*2+2,
- ((float) bins[c][x])/n, c);
- }
- }
-
- wform_put_border((unsigned char*) rval->rect, rval->x, rval->y);
-
- return rval;
-}
-
-static int get_bin_float(float f)
-{
- if (f < -0.25) {
- f = -0.25;
- } else if (f > 1.25) {
- f = 1.25;
- }
-
- return (int) (((f + 0.25) / 1.5) * 512);
-}
-
-static struct ImBuf *make_histogram_view_from_ibuf_float(
- struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(515, 128, 32, IB_rect, 0);
- int n,c,x,y;
- float* src = ibuf->rect_float;
-
- unsigned int bins[3][512];
-
- memset(bins, 0, 3 * 256* sizeof(unsigned int));
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- bins[0][get_bin_float(*src++)]++;
- bins[1][get_bin_float(*src++)]++;
- bins[2][get_bin_float(*src++)]++;
- src++;
- }
- }
-
- draw_histogram_marker(rval, get_bin_float(0.0));
- draw_histogram_marker(rval, get_bin_float(1.0));
-
- n = 0;
- for (c = 0; c < 3; c++) {
- for (x = 0; x < 512; x++) {
- if (bins[c][x] > n) {
- n = bins[c][x];
- }
- }
- }
- for (c = 0; c < 3; c++) {
- for (x = 0; x < 512; x++) {
- draw_histogram_bar(rval, x+1, (float) bins[c][x]/n, c);
- }
- }
-
- wform_put_border((unsigned char*) rval->rect, rval->x, rval->y);
-
- return rval;
-}
-
-struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf)
-{
- if (ibuf->rect_float) {
- return make_histogram_view_from_ibuf_float(ibuf);
- } else {
- return make_histogram_view_from_ibuf_byte(ibuf);
- }
-}
-
-static void vectorscope_put_cross(unsigned char r, unsigned char g,
- unsigned char b,
- char * tgt, int w, int h, int size)
-{
- float rgb[3], yuv[3];
- char * p;
- int x = 0;
- int y = 0;
-
- rgb[0]= (float)r/255.0;
- rgb[1]= (float)g/255.0;
- rgb[2]= (float)b/255.0;
- rgb_to_yuv(rgb, yuv);
-
- p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
-
- if (r == 0 && g == 0 && b == 0) {
- r = 255;
- }
-
- for (y = -size; y <= size; y++) {
- for (x = -size; x <= size; x++) {
- char * q = p + 4 * (y * w + x);
- q[0] = r; q[1] = g; q[2] = b; q[3] = 255;
- }
- }
-}
-
-static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0);
- int x,y;
- char* src = (char*) ibuf->rect;
- char* tgt = (char*) rval->rect;
- float rgb[3], yuv[3];
- int w = 515;
- int h = 515;
- float scope_gamma = 0.2;
- unsigned char wtable[256];
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- scope_gamma)*255);
- }
-
- for (x = 0; x <= 255; x++) {
- vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1);
- vectorscope_put_cross(255 , x, 0, tgt, w, h, 1);
- vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1);
- vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
- vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
- vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- char * src1 = src + 4 * (ibuf->x * y + x);
- char * p;
-
- rgb[0]= (float)src1[0]/255.0;
- rgb[1]= (float)src1[1]/255.0;
- rgb[2]= (float)src1[2]/255.0;
- rgb_to_yuv(rgb, yuv);
-
- p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
- scope_put_pixel(wtable, (unsigned char*)p);
- }
- }
-
- vectorscope_put_cross(0, 0, 0, tgt, w, h, 3);
-
- return rval;
-}
-
-static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf)
-{
- struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0);
- int x,y;
- float* src = ibuf->rect_float;
- char* tgt = (char*) rval->rect;
- float rgb[3], yuv[3];
- int w = 515;
- int h = 515;
- float scope_gamma = 0.2;
- unsigned char wtable[256];
-
- for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1)/256,
- scope_gamma)*255);
- }
-
- for (x = 0; x <= 255; x++) {
- vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1);
- vectorscope_put_cross(255 , x, 0, tgt, w, h, 1);
- vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1);
- vectorscope_put_cross(0, 255, x, tgt, w, h, 1);
- vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1);
- vectorscope_put_cross(x, 0, 255, tgt, w, h, 1);
- }
-
- for (y = 0; y < ibuf->y; y++) {
- for (x = 0; x < ibuf->x; x++) {
- float * src1 = src + 4 * (ibuf->x * y + x);
- char * p;
-
- memcpy(rgb, src1, 3 * sizeof(float));
-
- CLAMP(rgb[0], 0.0, 1.0);
- CLAMP(rgb[1], 0.0, 1.0);
- CLAMP(rgb[2], 0.0, 1.0);
-
- rgb_to_yuv(rgb, yuv);
-
- p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1))
- + (int) ((yuv[1] * (w - 3) + 1)));
- scope_put_pixel(wtable, (unsigned char*)p);
- }
- }
-
- vectorscope_put_cross(0, 0, 0, tgt, w, h, 3);
-
- return rval;
-}
-
-struct ImBuf *make_vectorscope_view_from_ibuf(struct ImBuf * ibuf)
-{
- if (ibuf->rect_float) {
- return make_vectorscope_view_from_ibuf_float(ibuf);
- } else {
- return make_vectorscope_view_from_ibuf_byte(ibuf);
- }
-}
diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c
deleted file mode 100644
index 219768b2776..00000000000
--- a/source/blender/src/sequence.c
+++ /dev/null
@@ -1,2990 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Contributor(s): Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <math.h>
-#include <stdlib.h>
-
-#include "MEM_guardedalloc.h"
-#include "MEM_CacheLimiterC-Api.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "DNA_ipo_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editsound.h"
-#include "BIF_editseq.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BIF_interface.h"
-#include "BIF_renderwin.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_sequence.h"
-#include "BSE_seqeffects.h"
-
-#include "RE_pipeline.h" // talks to entire render API
-
-#include "blendef.h"
-
-#include "BLI_threads.h"
-#include <pthread.h>
-
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
-
-int seqrectx, seqrecty;
-
-/* **********************************************************************
- alloc / free functions
- ********************************************************************** */
-
-void free_tstripdata(int len, TStripElem *se)
-{
- TStripElem *seo;
- int a;
-
- seo= se;
- if (!se) {
- return;
- }
-
- for(a=0; a<len; a++, se++) {
- if(se->ibuf) {
- IMB_freeImBuf(se->ibuf);
- se->ibuf = 0;
- }
- if(se->ibuf_comp) {
- IMB_freeImBuf(se->ibuf_comp);
- se->ibuf_comp = 0;
- }
- }
-
- MEM_freeN(seo);
-
-}
-
-void free_strip(Strip *strip)
-{
- strip->us--;
- if(strip->us>0) return;
- if(strip->us<0) {
- printf("error: negative users in strip\n");
- return;
- }
-
- if (strip->stripdata) {
- MEM_freeN(strip->stripdata);
- }
-
- if (strip->proxy) {
- MEM_freeN(strip->proxy);
- }
- if (strip->crop) {
- MEM_freeN(strip->crop);
- }
- if (strip->transform) {
- MEM_freeN(strip->transform);
- }
- if (strip->color_balance) {
- MEM_freeN(strip->color_balance);
- }
-
- free_tstripdata(strip->len, strip->tstripdata);
- free_tstripdata(strip->endstill, strip->tstripdata_endstill);
- free_tstripdata(strip->startstill, strip->tstripdata_startstill);
-
- if(strip->ibuf_startstill) {
- IMB_freeImBuf(strip->ibuf_startstill);
- strip->ibuf_startstill = 0;
- }
-
- if(strip->ibuf_endstill) {
- IMB_freeImBuf(strip->ibuf_endstill);
- strip->ibuf_endstill = 0;
- }
-
- MEM_freeN(strip);
-}
-
-void new_tstripdata(Sequence *seq)
-{
- if(seq->strip) {
- free_tstripdata(seq->strip->len, seq->strip->tstripdata);
- free_tstripdata(seq->strip->endstill,
- seq->strip->tstripdata_endstill);
- free_tstripdata(seq->strip->startstill,
- seq->strip->tstripdata_startstill);
-
- seq->strip->tstripdata= 0;
- seq->strip->tstripdata_endstill= 0;
- seq->strip->tstripdata_startstill= 0;
-
- if(seq->strip->ibuf_startstill) {
- IMB_freeImBuf(seq->strip->ibuf_startstill);
- seq->strip->ibuf_startstill = 0;
- }
-
- if(seq->strip->ibuf_endstill) {
- IMB_freeImBuf(seq->strip->ibuf_endstill);
- seq->strip->ibuf_endstill = 0;
- }
-
- seq->strip->len= seq->len;
- }
-}
-
-void free_sequence(Sequence *seq)
-{
- Sequence *last_seq = get_last_seq();
-
- if(seq->strip) free_strip(seq->strip);
-
- if(seq->anim) IMB_free_anim(seq->anim);
- if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio);
-
- if (seq->type & SEQ_EFFECT) {
- struct SeqEffectHandle sh = get_sequence_effect(seq);
-
- sh.free(seq);
- }
-
- if(seq==last_seq) set_last_seq(NULL);
-
- MEM_freeN(seq);
-}
-
-/*
- **********************************************************************
- * build_seqar
- **********************************************************************
- * Build a complete array of _all_ sequencies (including those
- * in metastrips!)
- **********************************************************************
-*/
-
-static void do_seq_count(ListBase *seqbase, int *totseq)
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- (*totseq)++;
- if(seq->seqbase.first) do_seq_count(&seq->seqbase, totseq);
- seq= seq->next;
- }
-}
-
-static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth)
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- seq->depth= depth;
- if(seq->seqbase.first) do_build_seqar(&seq->seqbase, seqar, depth+1);
- **seqar= seq;
- (*seqar)++;
- seq= seq->next;
- }
-}
-
-void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
-{
- Sequence **tseqar;
-
- *totseq= 0;
- do_seq_count(seqbase, totseq);
-
- if(*totseq==0) {
- *seqar= 0;
- return;
- }
- *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar");
- tseqar= *seqar;
-
- do_build_seqar(seqbase, seqar, 0);
- *seqar= tseqar;
-}
-
-static void do_seq_count_cb(ListBase *seqbase, int *totseq,
- int (*test_func)(Sequence * seq))
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- int test = test_func(seq);
- if (test & BUILD_SEQAR_COUNT_CURRENT) {
- (*totseq)++;
- }
- if(seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
- do_seq_count_cb(&seq->seqbase, totseq, test_func);
- }
- seq= seq->next;
- }
-}
-
-static void do_build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int depth,
- int (*test_func)(Sequence * seq))
-{
- Sequence *seq;
-
- seq= seqbase->first;
- while(seq) {
- int test = test_func(seq);
- seq->depth= depth;
-
- if(seq->seqbase.first && (test & BUILD_SEQAR_COUNT_CHILDREN)) {
- do_build_seqar_cb(&seq->seqbase, seqar, depth+1,
- test_func);
- }
- if (test & BUILD_SEQAR_COUNT_CURRENT) {
- **seqar= seq;
- (*seqar)++;
- }
- seq= seq->next;
- }
-}
-
-void build_seqar_cb(ListBase *seqbase, Sequence ***seqar, int *totseq,
- int (*test_func)(Sequence * seq))
-{
- Sequence **tseqar;
-
- *totseq= 0;
- do_seq_count_cb(seqbase, totseq, test_func);
-
- if(*totseq==0) {
- *seqar= 0;
- return;
- }
- *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar");
- tseqar= *seqar;
-
- do_build_seqar_cb(seqbase, seqar, 0, test_func);
- *seqar= tseqar;
-}
-
-
-void free_editing(Editing *ed)
-{
- MetaStack *ms;
- Sequence *seq;
-
- if(ed==NULL) return;
- set_last_seq(NULL); /* clear_last_seq doesnt work, it screws up free_sequence */
-
- WHILE_SEQ(&ed->seqbase) {
- free_sequence(seq);
- }
- END_SEQ
-
- while( (ms= ed->metastack.first) ) {
- BLI_remlink(&ed->metastack, ms);
- MEM_freeN(ms);
- }
-
- MEM_freeN(ed);
-
-}
-
-void calc_sequence_disp(Sequence *seq)
-{
- if(seq->startofs && seq->startstill) seq->startstill= 0;
- if(seq->endofs && seq->endstill) seq->endstill= 0;
-
- seq->startdisp= seq->start + seq->startofs - seq->startstill;
- seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill;
-
- seq->handsize= 10.0; /* 10 frames */
- if( seq->enddisp-seq->startdisp < 10 ) {
- seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp));
- }
- else if(seq->enddisp-seq->startdisp > 250) {
- seq->handsize= (float)((seq->enddisp-seq->startdisp)/25);
- }
-}
-
-void calc_sequence(Sequence *seq)
-{
- Sequence *seqm;
- int min, max;
-
- /* check all metas recursively */
- seqm= seq->seqbase.first;
- while(seqm) {
- if(seqm->seqbase.first) calc_sequence(seqm);
- seqm= seqm->next;
- }
-
- /* effects and meta: automatic start and end */
-
- if(seq->type & SEQ_EFFECT) {
- /* pointers */
- if(seq->seq2==0) seq->seq2= seq->seq1;
- if(seq->seq3==0) seq->seq3= seq->seq1;
-
- /* effecten go from seq1 -> seq2: test */
-
- /* we take the largest start and smallest end */
-
- // seq->start= seq->startdisp= MAX2(seq->seq1->startdisp, seq->seq2->startdisp);
- // seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
-
- if (seq->seq1) {
- seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
- seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
- seq->len= seq->enddisp - seq->startdisp;
- } else {
- calc_sequence_disp(seq);
- }
-
- if(seq->strip && seq->len!=seq->strip->len) {
- new_tstripdata(seq);
- }
-
- }
- else {
- if(seq->type==SEQ_META) {
- seqm= seq->seqbase.first;
- if(seqm) {
- min= 1000000;
- max= -1000000;
- while(seqm) {
- if(seqm->startdisp < min) min= seqm->startdisp;
- if(seqm->enddisp > max) max= seqm->enddisp;
- seqm= seqm->next;
- }
- seq->start= min + seq->anim_startofs;
- seq->len = max-min;
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
-
- if(seq->strip && seq->len!=seq->strip->len) {
- new_tstripdata(seq);
- }
- }
- }
- calc_sequence_disp(seq);
- }
-}
-
-void reload_sequence_new_file(Sequence * seq)
-{
- char str[FILE_MAXDIR+FILE_MAXFILE];
-
- if (!(seq->type == SEQ_MOVIE || seq->type == SEQ_IMAGE ||
- seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND ||
- seq->type == SEQ_SCENE || seq->type == SEQ_META)) {
- return;
- }
-
- new_tstripdata(seq);
-
- if (seq->type != SEQ_SCENE && seq->type != SEQ_META &&
- seq->type != SEQ_IMAGE) {
- BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name);
- BLI_convertstringcode(str, G.sce);
- BLI_convertstringframe(str, G.scene->r.cfra);
-
- }
-
- if (seq->type == SEQ_IMAGE) {
- /* Hack? */
- int olen = MEM_allocN_len(seq->strip->stripdata)
- / sizeof(struct StripElem);
- seq->len = olen;
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- } else if (seq->type == SEQ_MOVIE) {
- if(seq->anim) IMB_free_anim(seq->anim);
- seq->anim = openanim(
- str, IB_rect |
- ((seq->flag & SEQ_FILTERY)
- ? IB_animdeinterlace : 0));
-
- if (!seq->anim) {
- return;
- }
-
- seq->len = IMB_anim_get_duration(seq->anim);
-
- seq->anim_preseek = IMB_anim_get_preseek(seq->anim);
-
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- } else if (seq->type == SEQ_HD_SOUND) {
- if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio);
- seq->hdaudio = sound_open_hdaudio(str);
-
- if (!seq->hdaudio) {
- return;
- }
-
- seq->len = sound_hdaudio_get_duration(seq->hdaudio, FPS)
- - seq->anim_startofs - seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- } else if (seq->type == SEQ_RAM_SOUND) {
- seq->len = (int) ( ((float)(seq->sound->streamlen-1)/
- ((float)G.scene->audio.mixrate*4.0 ))
- * FPS);
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- } else if (seq->type == SEQ_SCENE) {
- Scene * sce = G.main->scene.first;
- int nr = 1;
- while(sce) {
- if(nr == seq->scenenr) {
- break;
- }
- nr++;
- sce= sce->id.next;
- }
-
- if (sce) {
- seq->scene = sce;
- } else {
- sce = seq->scene;
- }
-
- strncpy(seq->name + 2, sce->id.name + 2,
- sizeof(seq->name) - 2);
-
- seq->len= seq->scene->r.efra - seq->scene->r.sfra + 1;
- seq->len -= seq->anim_startofs;
- seq->len -= seq->anim_endofs;
- if (seq->len < 0) {
- seq->len = 0;
- }
- seq->strip->len = seq->len;
- }
-
- calc_sequence(seq);
-}
-
-void sort_seq()
-{
- /* all strips together per kind, and in order of y location ("machine") */
- ListBase seqbase, effbase;
- Editing *ed;
- Sequence *seq, *seqt;
-
- ed= G.scene->ed;
- if(ed==0) return;
-
- seqbase.first= seqbase.last= 0;
- effbase.first= effbase.last= 0;
-
- while( (seq= ed->seqbasep->first) ) {
- BLI_remlink(ed->seqbasep, seq);
-
- if(seq->type & SEQ_EFFECT) {
- seqt= effbase.first;
- while(seqt) {
- if(seqt->machine>=seq->machine) {
- BLI_insertlinkbefore(&effbase, seqt, seq);
- break;
- }
- seqt= seqt->next;
- }
- if(seqt==0) BLI_addtail(&effbase, seq);
- }
- else {
- seqt= seqbase.first;
- while(seqt) {
- if(seqt->machine>=seq->machine) {
- BLI_insertlinkbefore(&seqbase, seqt, seq);
- break;
- }
- seqt= seqt->next;
- }
- if(seqt==0) BLI_addtail(&seqbase, seq);
- }
- }
-
- addlisttolist(&seqbase, &effbase);
- *(ed->seqbasep)= seqbase;
-}
-
-
-void clear_scene_in_allseqs(Scene *sce)
-{
- Scene *sce1;
- Editing *ed;
- Sequence *seq;
-
- /* when a scene is deleted: test all seqs */
-
- sce1= G.main->scene.first;
- while(sce1) {
- if(sce1!=sce && sce1->ed) {
- ed= sce1->ed;
-
- WHILE_SEQ(&ed->seqbase) {
-
- if(seq->scene==sce) seq->scene= 0;
-
- }
- END_SEQ
- }
-
- sce1= sce1->id.next;
- }
-}
-
-char *give_seqname_by_type(int type)
-{
- switch(type) {
- case SEQ_META: return "Meta";
- case SEQ_IMAGE: return "Image";
- case SEQ_SCENE: return "Scene";
- case SEQ_MOVIE: return "Movie";
- case SEQ_RAM_SOUND: return "Audio (RAM)";
- case SEQ_HD_SOUND: return "Audio (HD)";
- case SEQ_CROSS: return "Cross";
- case SEQ_GAMCROSS: return "Gamma Cross";
- case SEQ_ADD: return "Add";
- case SEQ_SUB: return "Sub";
- case SEQ_MUL: return "Mul";
- case SEQ_ALPHAOVER: return "Alpha Over";
- case SEQ_ALPHAUNDER: return "Alpha Under";
- case SEQ_OVERDROP: return "Over Drop";
- case SEQ_WIPE: return "Wipe";
- case SEQ_GLOW: return "Glow";
- case SEQ_TRANSFORM: return "Transform";
- case SEQ_COLOR: return "Color";
- case SEQ_SPEED: return "Speed";
- default:
- return 0;
- }
-}
-
-char *give_seqname(Sequence *seq)
-{
- char * name = give_seqname_by_type(seq->type);
-
- if (!name) {
- if(seq->type<SEQ_EFFECT) {
- return seq->strip->dir;
- } else if(seq->type==SEQ_PLUGIN) {
- if(!(seq->flag & SEQ_EFFECT_NOT_LOADED) &&
- seq->plugin && seq->plugin->doit) {
- return seq->plugin->pname;
- } else {
- return "Plugin";
- }
- } else {
- return "Effect";
- }
- }
- return name;
-}
-
-/* ***************** DO THE SEQUENCE ***************** */
-
-static void make_black_ibuf(ImBuf *ibuf)
-{
- unsigned int *rect;
- float *rect_float;
- int tot;
-
- if(ibuf==0 || (ibuf->rect==0 && ibuf->rect_float==0)) return;
-
- tot= ibuf->x*ibuf->y;
-
- rect= ibuf->rect;
- rect_float = ibuf->rect_float;
-
- if (rect) {
- memset(rect, 0, tot * sizeof(char) * 4);
- }
-
- if (rect_float) {
- memset(rect_float, 0, tot * sizeof(float) * 4);
- }
-}
-
-static void multibuf(ImBuf *ibuf, float fmul)
-{
- char *rt;
- float *rt_float;
-
- int a, mul, icol;
-
- mul= (int)(256.0*fmul);
- rt= (char *)ibuf->rect;
- rt_float = ibuf->rect_float;
-
- if (rt) {
- a= ibuf->x*ibuf->y;
- while(a--) {
-
- icol= (mul*rt[0])>>8;
- if(icol>254) rt[0]= 255; else rt[0]= icol;
- icol= (mul*rt[1])>>8;
- if(icol>254) rt[1]= 255; else rt[1]= icol;
- icol= (mul*rt[2])>>8;
- if(icol>254) rt[2]= 255; else rt[2]= icol;
- icol= (mul*rt[3])>>8;
- if(icol>254) rt[3]= 255; else rt[3]= icol;
-
- rt+= 4;
- }
- }
- if (rt_float) {
- a= ibuf->x*ibuf->y;
- while(a--) {
- rt_float[0] *= fmul;
- rt_float[1] *= fmul;
- rt_float[2] *= fmul;
- rt_float[3] *= fmul;
-
- rt_float += 4;
- }
- }
-}
-
-static void do_effect(int cfra, Sequence *seq, TStripElem * se)
-{
- TStripElem *se1, *se2, *se3;
- float fac, facf;
- int x, y;
- int early_out;
- struct SeqEffectHandle sh = get_sequence_effect(seq);
-
- if (!sh.execute) { /* effect not supported in this version... */
- make_black_ibuf(se->ibuf);
- return;
- }
-
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, cfra);
- fac= seq->facf0;
- facf= seq->facf1;
- } else {
- sh.get_default_fac(seq, cfra, &fac, &facf);
- }
-
- if( !(G.scene->r.mode & R_FIELDS) ) facf = fac;
-
- early_out = sh.early_out(seq, fac, facf);
-
- if (early_out == -1) { /* no input needed */
- sh.execute(seq, cfra, fac, facf,
- se->ibuf->x, se->ibuf->y,
- 0, 0, 0, se->ibuf);
- return;
- }
-
- switch (early_out) {
- case 0:
- if (se->se1==0 || se->se2==0 || se->se3==0) {
- make_black_ibuf(se->ibuf);
- return;
- }
-
- se1= se->se1;
- se2= se->se2;
- se3= se->se3;
-
- if ( (se1==0 || se2==0 || se3==0)
- || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) {
- make_black_ibuf(se->ibuf);
- return;
- }
-
- break;
- case 1:
- if (se->se1 == 0) {
- make_black_ibuf(se->ibuf);
- return;
- }
-
- se1= se->se1;
-
- if (se1 == 0 || se1->ibuf == 0) {
- make_black_ibuf(se->ibuf);
- return;
- }
-
- if (se->ibuf != se1->ibuf) {
- IMB_freeImBuf(se->ibuf);
- se->ibuf = se1->ibuf;
- IMB_refImBuf(se->ibuf);
- }
- return;
- case 2:
- if (se->se2 == 0) {
- make_black_ibuf(se->ibuf);
- return;
- }
-
- se2= se->se2;
-
- if (se2 == 0 || se2->ibuf == 0) {
- make_black_ibuf(se->ibuf);
- return;
- }
- if (se->ibuf != se2->ibuf) {
- IMB_freeImBuf(se->ibuf);
- se->ibuf = se2->ibuf;
- IMB_refImBuf(se->ibuf);
- }
- return;
- default:
- make_black_ibuf(se->ibuf);
- return;
- }
-
- x= se2->ibuf->x;
- y= se2->ibuf->y;
-
- if (!se1->ibuf->rect_float && se->ibuf->rect_float) {
- IMB_float_from_rect(se1->ibuf);
- }
- if (!se2->ibuf->rect_float && se->ibuf->rect_float) {
- IMB_float_from_rect(se2->ibuf);
- }
- if (!se3->ibuf->rect_float && se->ibuf->rect_float) {
- IMB_float_from_rect(se3->ibuf);
- }
-
- if (!se1->ibuf->rect && !se->ibuf->rect_float) {
- IMB_rect_from_float(se1->ibuf);
- }
- if (!se2->ibuf->rect && !se->ibuf->rect_float) {
- IMB_rect_from_float(se2->ibuf);
- }
- if (!se3->ibuf->rect && !se->ibuf->rect_float) {
- IMB_rect_from_float(se3->ibuf);
- }
-
- sh.execute(seq, cfra, fac, facf, x, y, se1->ibuf, se2->ibuf, se3->ibuf,
- se->ibuf);
-}
-
-static int give_stripelem_index(Sequence *seq, int cfra)
-{
- int nr;
-
- if(seq->startdisp >cfra || seq->enddisp <= cfra) return -1;
- if(seq->len == 0) return -1;
- if(seq->flag&SEQ_REVERSE_FRAMES) {
- /*reverse frame in this sequence */
- if(cfra <= seq->start) nr= seq->len-1;
- else if(cfra >= seq->start+seq->len-1) nr= 0;
- else nr= (seq->start + seq->len) - cfra;
- } else {
- if(cfra <= seq->start) nr= 0;
- else if(cfra >= seq->start+seq->len-1) nr= seq->len-1;
- else nr= cfra-seq->start;
- }
- if (seq->strobe < 1.0) seq->strobe = 1.0;
- if (seq->strobe > 1.0) {
- nr -= (int)fmod((double)nr, (double)seq->strobe);
- }
-
- return nr;
-}
-
-static TStripElem* alloc_tstripdata(int len, const char * name)
-{
- int i;
- TStripElem *se = MEM_callocN(len * sizeof(TStripElem), name);
- for (i = 0; i < len; i++) {
- se[i].ok = STRIPELEM_OK;
- }
- return se;
-}
-
-TStripElem *give_tstripelem(Sequence *seq, int cfra)
-{
- TStripElem *se;
- int nr;
-
- se = seq->strip->tstripdata;
- if (se == 0 && seq->len > 0) {
- se = seq->strip->tstripdata = alloc_tstripdata(seq->len,
- "tstripelems");
- }
- nr = give_stripelem_index(seq, cfra);
-
- if (nr == -1) return 0;
- if (se == 0) return 0;
-
- se += nr;
-
- /* if there are IPOs with blend modes active, one has to watch out
- for startstill + endstill area: we can't use the same tstripelem
- here for all ibufs, since then, blending with IPOs won't work!
-
- Rather common case, if you use a single image and try to fade
- it in and out... or want to use your strip as a watermark in
- alpha over mode...
- */
- if (seq->blend_mode != SEQ_BLEND_REPLACE ||
- (seq->ipo && seq->ipo->curve.first && (
- !(seq->type & SEQ_EFFECT) || !seq->seq1))) {
- Strip * s = seq->strip;
- if (cfra < seq->start) {
- se = s->tstripdata_startstill;
- if (seq->startstill > s->startstill) {
- free_tstripdata(s->startstill,
- s->tstripdata_startstill);
- se = 0;
- }
-
- if (se == 0) {
- s->startstill = seq->startstill;
- se = seq->strip->tstripdata_startstill
- = alloc_tstripdata(
- s->startstill,
- "tstripelems_startstill");
- }
- se += seq->start - cfra - 1;
-
- } else if (cfra > seq->start + seq->len-1) {
- se = s->tstripdata_endstill;
- if (seq->endstill > s->endstill) {
- free_tstripdata(s->endstill,
- s->tstripdata_endstill);
- se = 0;
- }
-
- if (se == 0) {
- s->endstill = seq->endstill;
- se = seq->strip->tstripdata_endstill
- = alloc_tstripdata(
- s->endstill,
- "tstripelems_endstill");
- }
- se += cfra - (seq->start + seq->len-1) - 1;
- }
- }
-
-
- se->nr= nr;
-
- return se;
-}
-
-StripElem *give_stripelem(Sequence *seq, int cfra)
-{
- StripElem *se;
- int nr;
-
- se = seq->strip->stripdata;
- nr = give_stripelem_index(seq, cfra);
-
- if (nr == -1) return 0;
- if (se == 0) return 0;
-
- se += nr + seq->anim_startofs;
-
- return se;
-}
-
-static int evaluate_seq_frame_gen(
- Sequence ** seq_arr, ListBase *seqbase, int cfra)
-{
- Sequence *seq;
- int totseq=0;
-
- memset(seq_arr, 0, sizeof(Sequence*) * (MAXSEQ+1));
-
- seq= seqbase->first;
- while(seq) {
- if(seq->startdisp <=cfra && seq->enddisp > cfra) {
- seq_arr[seq->machine]= seq;
- totseq++;
- }
- seq= seq->next;
- }
-
- return totseq;
-}
-
-int evaluate_seq_frame(int cfra)
-{
- Editing *ed;
- Sequence *seq_arr[MAXSEQ+1];
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- return evaluate_seq_frame_gen(seq_arr, ed->seqbasep, cfra);
-
-}
-
-static int video_seq_is_rendered(Sequence * seq)
-{
- return (seq
- && !(seq->flag & SEQ_MUTE)
- && seq->type != SEQ_RAM_SOUND
- && seq->type != SEQ_HD_SOUND);
-}
-
-static int get_shown_sequences(
- ListBase * seqbasep, int cfra, int chanshown, Sequence ** seq_arr_out)
-{
- Sequence *seq_arr[MAXSEQ+1];
- int b = chanshown;
- int cnt = 0;
-
- if (b > MAXSEQ) {
- return 0;
- }
-
- if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
- if (b > 0) {
- if (seq_arr[b] == 0) {
- return 0;
- }
- } else {
- for (b = MAXSEQ; b > 0; b--) {
- if (video_seq_is_rendered(seq_arr[b])) {
- break;
- }
- }
- }
- }
-
- chanshown = b;
-
- for (;b > 0; b--) {
- if (video_seq_is_rendered(seq_arr[b])) {
- if (seq_arr[b]->blend_mode == SEQ_BLEND_REPLACE) {
- break;
- }
- }
- }
-
- for (;b <= chanshown; b++) {
- if (video_seq_is_rendered(seq_arr[b])) {
- seq_arr_out[cnt++] = seq_arr[b];
- }
- }
-
- return cnt;
-}
-
-
-/* **********************************************************************
- proxy management
- ********************************************************************** */
-
-#define PROXY_MAXFILE (2*FILE_MAXDIR+FILE_MAXFILE)
-
-static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name)
-{
- int frameno;
- char dir[FILE_MAXDIR];
-
- if (!seq->strip->proxy) {
- return FALSE;
- }
-
- if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
- strcpy(dir, seq->strip->proxy->dir);
- } else {
- if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
- snprintf(dir, FILE_MAXDIR, "%s/BL_proxy",
- seq->strip->dir);
- } else {
- return FALSE;
- }
- }
-
- /* generate a seperate proxy directory for each preview size */
-
- if (seq->type == SEQ_IMAGE) {
- StripElem * se = give_stripelem(seq, cfra);
- snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy",
- dir, G.scene->r.size, se->name);
- frameno = 1;
- } else if (seq->type == SEQ_MOVIE) {
- TStripElem * tse = give_tstripelem(seq, cfra);
-
- frameno = tse->nr + seq->anim_startofs;
-
- snprintf(name, PROXY_MAXFILE, "%s/%s/%d/####", dir,
- seq->strip->stripdata->name,
- G.scene->r.size);
- } else {
- TStripElem * tse = give_tstripelem(seq, cfra);
-
- frameno = tse->nr + seq->anim_startofs;
-
- snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
- G.scene->r.size);
- }
-
- BLI_convertstringcode(name, G.sce);
- BLI_convertstringframe(name, frameno);
-
-
- strcat(name, ".jpg");
-
- return TRUE;
-}
-
-static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra)
-{
- char name[PROXY_MAXFILE];
-
- if (!(seq->flag & SEQ_USE_PROXY)) {
- return 0;
- }
-
- /* rendering at 100% ? No real sense in proxy-ing, right? */
- if (G.scene->r.size == 100.0) {
- return 0;
- }
-
- if (!seq_proxy_get_fname(seq, cfra, name)) {
- return 0;
- }
-
- if (BLI_exists(name)) {
- return IMB_loadiffname(name, IB_rect);
- } else {
- return 0;
- }
-}
-
-static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
- int build_proxy_run);
-
-static void seq_proxy_build_frame(Sequence * seq, int cfra)
-{
- char name[PROXY_MAXFILE];
- int quality;
- TStripElem * se;
- int ok;
- int rectx, recty;
- struct ImBuf * ibuf;
-
- if (!(seq->flag & SEQ_USE_PROXY)) {
- return;
- }
-
- /* rendering at 100% ? No real sense in proxy-ing, right? */
- if (G.scene->r.size == 100.0) {
- return;
- }
-
- if (!seq_proxy_get_fname(seq, cfra, name)) {
- return;
- }
-
- se = give_tstripelem(seq, cfra);
- if (!se) {
- return;
- }
-
- if(se->ibuf) {
- IMB_freeImBuf(se->ibuf);
- se->ibuf = 0;
- }
-
- do_build_seq_ibuf(seq, se, cfra, TRUE);
-
- if (!se->ibuf) {
- return;
- }
-
- rectx= (G.scene->r.size*G.scene->r.xsch)/100;
- recty= (G.scene->r.size*G.scene->r.ysch)/100;
-
- ibuf = se->ibuf;
-
- if (ibuf->x != rectx || ibuf->y != recty) {
- IMB_scalefastImBuf(ibuf, (short)rectx, (short)recty);
- }
-
- /* quality is fixed, otherwise one has to generate seperate
- directories for every quality...
-
- depth = 32 is intentionally left in, otherwise ALPHA channels
- won't work... */
- quality = 90;
- ibuf->ftype= JPG | quality;
-
- BLI_make_existing_file(name);
-
- ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat);
- if (ok == 0) {
- perror(name);
- }
-
- IMB_freeImBuf(ibuf);
- se->ibuf = 0;
-}
-
-void seq_proxy_rebuild(Sequence * seq)
-{
- int cfra;
-
- waitcursor(1);
-
- G.afbreek = 0;
-
- /* flag management tries to account for strobe and
- other "non-linearities", that might come in the future...
- better way would be to "touch" the files, so that _really_
- no one is rebuild twice.
- */
-
- for (cfra = seq->startdisp; cfra < seq->enddisp; cfra++) {
- TStripElem * tse = give_tstripelem(seq, cfra);
-
- tse->flag &= ~STRIPELEM_PREVIEW_DONE;
- }
-
- /* a _lot_ faster for movie files, if we read frames in
- sequential order */
- if (seq->flag & SEQ_REVERSE_FRAMES) {
- for (cfra = seq->enddisp-seq->endstill-1;
- cfra >= seq->startdisp + seq->startstill; cfra--) {
- TStripElem * tse = give_tstripelem(seq, cfra);
-
- if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
- seq_proxy_build_frame(seq, cfra);
- tse->flag |= STRIPELEM_PREVIEW_DONE;
- }
- if (blender_test_break()) {
- break;
- }
- }
- } else {
- for (cfra = seq->startdisp + seq->startstill;
- cfra < seq->enddisp - seq->endstill; cfra++) {
- TStripElem * tse = give_tstripelem(seq, cfra);
-
- if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) {
- seq_proxy_build_frame(seq, cfra);
- tse->flag |= STRIPELEM_PREVIEW_DONE;
- }
- if (blender_test_break()) {
- break;
- }
- }
- }
- waitcursor(0);
-}
-
-
-/* **********************************************************************
- color balance
- ********************************************************************** */
-
-static StripColorBalance calc_cb(StripColorBalance * cb_)
-{
- StripColorBalance cb = *cb_;
- int c;
-
- if (cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) {
- for (c = 0; c < 3; c++) {
- cb.lift[c] = 1.0 - cb.lift[c];
- }
- } else {
- for (c = 0; c < 3; c++) {
- cb.lift[c] = -(1.0 - cb.lift[c]);
- }
- }
- if (cb.flag & SEQ_COLOR_BALANCE_INVERSE_GAIN) {
- for (c = 0; c < 3; c++) {
- if (cb.gain[c] != 0.0) {
- cb.gain[c] = 1.0/cb.gain[c];
- } else {
- cb.gain[c] = 1000000; /* should be enough :) */
- }
- }
- }
-
- if (!(cb.flag & SEQ_COLOR_BALANCE_INVERSE_GAMMA)) {
- for (c = 0; c < 3; c++) {
- if (cb.gamma[c] != 0.0) {
- cb.gamma[c] = 1.0/cb.gamma[c];
- } else {
- cb.gamma[c] = 1000000; /* should be enough :) */
- }
- }
- }
-
- return cb;
-}
-
-static void make_cb_table_byte(float lift, float gain, float gamma,
- unsigned char * table, float mul)
-{
- int y;
-
- for (y = 0; y < 256; y++) {
- float v = 1.0 * y / 255;
- v *= gain;
- v += lift;
- v = pow(v, gamma);
- v *= mul;
- if ( v > 1.0) {
- v = 1.0;
- } else if (v < 0.0) {
- v = 0.0;
- }
- table[y] = v * 255;
- }
-
-}
-
-static void make_cb_table_float(float lift, float gain, float gamma,
- float * table, float mul)
-{
- int y;
-
- for (y = 0; y < 256; y++) {
- float v = (float) y * 1.0 / 255.0;
- v *= gain;
- v += lift;
- v = pow(v, gamma);
- v *= mul;
- table[y] = v;
- }
-}
-
-static void color_balance_byte_byte(Sequence * seq, TStripElem* se,
- float mul)
-{
- unsigned char cb_tab[3][256];
- int c;
- unsigned char * p = (unsigned char*) se->ibuf->rect;
- unsigned char * e = p + se->ibuf->x * 4 * se->ibuf->y;
-
- StripColorBalance cb = calc_cb(seq->strip->color_balance);
-
- for (c = 0; c < 3; c++) {
- make_cb_table_byte(cb.lift[c], cb.gain[c], cb.gamma[c],
- cb_tab[c], mul);
- }
-
- while (p < e) {
- p[0] = cb_tab[0][p[0]];
- p[1] = cb_tab[1][p[1]];
- p[2] = cb_tab[2][p[2]];
-
- p += 4;
- }
-}
-
-static void color_balance_byte_float(Sequence * seq, TStripElem* se,
- float mul)
-{
- float cb_tab[4][256];
- int c,i;
- unsigned char * p = (unsigned char*) se->ibuf->rect;
- unsigned char * e = p + se->ibuf->x * 4 * se->ibuf->y;
- float * o;
- StripColorBalance cb;
-
- imb_addrectfloatImBuf(se->ibuf);
-
- o = se->ibuf->rect_float;
-
- cb = calc_cb(seq->strip->color_balance);
-
- for (c = 0; c < 3; c++) {
- make_cb_table_float(cb.lift[c], cb.gain[c], cb.gamma[c],
- cb_tab[c], mul);
- }
-
- for (i = 0; i < 256; i++) {
- cb_tab[3][i] = ((float)i)*(1.0f/255.0f);
- }
-
- while (p < e) {
- o[0] = cb_tab[0][p[0]];
- o[1] = cb_tab[1][p[1]];
- o[2] = cb_tab[2][p[2]];
- o[3] = cb_tab[3][p[3]];
-
- p += 4; o += 4;
- }
-}
-
-static void color_balance_float_float(Sequence * seq, TStripElem* se,
- float mul)
-{
- float * p = se->ibuf->rect_float;
- float * e = se->ibuf->rect_float + se->ibuf->x * 4* se->ibuf->y;
- StripColorBalance cb = calc_cb(seq->strip->color_balance);
-
- while (p < e) {
- int c;
- for (c = 0; c < 3; c++) {
- p[c] = pow(p[c] * cb.gain[c] + cb.lift[c],
- cb.gamma[c]) * mul;
- }
- p += 4;
- }
-}
-
-static void color_balance(Sequence * seq, TStripElem* se, float mul)
-{
- if (se->ibuf->rect_float) {
- color_balance_float_float(seq, se, mul);
- } else if(seq->flag & SEQ_MAKE_FLOAT) {
- color_balance_byte_float(seq, se, mul);
- } else {
- color_balance_byte_byte(seq, se, mul);
- }
-}
-
-/*
- input preprocessing for SEQ_IMAGE, SEQ_MOVIE and SEQ_SCENE
-
- Do all the things you can't really do afterwards using sequence effects
- (read: before rescaling to render resolution has been done)
-
- Order is important!
-
- - Deinterlace
- - Crop and transform in image source coordinate space
- - Flip X + Flip Y (could be done afterwards, backward compatibility)
- - Promote image to float data (affects pipeline operations afterwards)
- - Color balance (is most efficient in the byte -> float
- (future: half -> float should also work fine!)
- case, if done on load, since we can use lookup tables)
- - Premultiply
-
-*/
-
-static int input_have_to_preprocess(Sequence * seq, TStripElem* se, int cfra)
-{
- float mul;
-
- if ((seq->flag & SEQ_FILTERY) ||
- (seq->flag & SEQ_USE_CROP) ||
- (seq->flag & SEQ_USE_TRANSFORM) ||
- (seq->flag & SEQ_FLIPX) ||
- (seq->flag & SEQ_FLIPY) ||
- (seq->flag & SEQ_USE_COLOR_BALANCE) ||
- (seq->flag & SEQ_MAKE_PREMUL) ||
- (se->ibuf->x != seqrectx || se->ibuf->y != seqrecty)) {
- return TRUE;
- }
-
- mul = seq->mul;
-
- if(seq->blend_mode == SEQ_BLEND_REPLACE) {
- if (seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, cfra);
- mul *= seq->facf0;
- }
- mul *= seq->blend_opacity / 100.0;
- }
-
- if (mul != 1.0) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void input_preprocess(Sequence * seq, TStripElem* se, int cfra)
-{
- float mul;
-
- seq->strip->orx= se->ibuf->x;
- seq->strip->ory= se->ibuf->y;
-
- if((seq->flag & SEQ_FILTERY) && seq->type != SEQ_MOVIE) {
- IMB_filtery(se->ibuf);
- }
-
- if(seq->flag & SEQ_USE_CROP || seq->flag & SEQ_USE_TRANSFORM) {
- StripCrop c;
- StripTransform t;
- int sx,sy,dx,dy;
-
- memset(&c, 0, sizeof(StripCrop));
- memset(&t, 0, sizeof(StripTransform));
-
- if(seq->flag & SEQ_USE_CROP && seq->strip->crop) {
- c = *seq->strip->crop;
- }
- if(seq->flag & SEQ_USE_TRANSFORM && seq->strip->transform) {
- t = *seq->strip->transform;
- }
-
- sx = se->ibuf->x - c.left - c.right;
- sy = se->ibuf->y - c.top - c.bottom;
- dx = sx;
- dy = sy;
-
- if (seq->flag & SEQ_USE_TRANSFORM) {
- dx = G.scene->r.xsch;
- dy = G.scene->r.ysch;
- }
-
- if (c.top + c.bottom >= se->ibuf->y ||
- c.left + c.right >= se->ibuf->x ||
- t.xofs >= dx || t.yofs >= dy) {
- make_black_ibuf(se->ibuf);
- } else {
- ImBuf * i;
-
- if (se->ibuf->rect_float) {
- i = IMB_allocImBuf(dx, dy,32, IB_rectfloat, 0);
- } else {
- i = IMB_allocImBuf(dx, dy,32, IB_rect, 0);
- }
-
- IMB_rectcpy(i, se->ibuf,
- t.xofs, t.yofs,
- c.left, c.bottom,
- sx, sy);
-
- IMB_freeImBuf(se->ibuf);
-
- se->ibuf = i;
- }
- }
-
- if(seq->flag & SEQ_FLIPX) {
- IMB_flipx(se->ibuf);
- }
- if(seq->flag & SEQ_FLIPY) {
- IMB_flipy(se->ibuf);
- }
-
- if(seq->mul == 0.0) {
- seq->mul = 1.0;
- }
-
- mul = seq->mul;
-
- if(seq->blend_mode == SEQ_BLEND_REPLACE) {
- if (seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, cfra);
- mul *= seq->facf0;
- }
- mul *= seq->blend_opacity / 100.0;
- }
-
- if(seq->flag & SEQ_USE_COLOR_BALANCE && seq->strip->color_balance) {
- color_balance(seq, se, mul);
- mul = 1.0;
- }
-
- if(seq->flag & SEQ_MAKE_FLOAT) {
- if (!se->ibuf->rect_float) {
- IMB_float_from_rect(se->ibuf);
- }
- if (se->ibuf->rect) {
- imb_freerectImBuf(se->ibuf);
- }
- }
-
- if(mul != 1.0) {
- multibuf(se->ibuf, mul);
- }
-
- if(seq->flag & SEQ_MAKE_PREMUL) {
- if(se->ibuf->depth == 32 && se->ibuf->zbuf == 0) {
- converttopremul(se->ibuf);
- }
- }
-
-
- if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) {
- if(G.scene->r.mode & R_OSA) {
- IMB_scaleImBuf(se->ibuf,
- (short)seqrectx, (short)seqrecty);
- } else {
- IMB_scalefastImBuf(se->ibuf,
- (short)seqrectx, (short)seqrecty);
- }
- }
-}
-
-/* test if image too small or discarded from cache: reload */
-
-static void test_and_auto_discard_ibuf(TStripElem * se)
-{
- if (se->ibuf) {
- if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty
- || !(se->ibuf->rect || se->ibuf->rect_float)) {
- IMB_freeImBuf(se->ibuf);
-
- se->ibuf= 0;
- se->ok= STRIPELEM_OK;
- }
- }
- if (se->ibuf_comp) {
- if(se->ibuf_comp->x != seqrectx || se->ibuf_comp->y != seqrecty
- || !(se->ibuf_comp->rect || se->ibuf_comp->rect_float)) {
- IMB_freeImBuf(se->ibuf_comp);
-
- se->ibuf_comp = 0;
- }
- }
-}
-
-static void test_and_auto_discard_ibuf_stills(Strip * strip)
-{
- if (strip->ibuf_startstill) {
- if (!strip->ibuf_startstill->rect &&
- !strip->ibuf_startstill->rect_float) {
- IMB_freeImBuf(strip->ibuf_startstill);
- strip->ibuf_startstill = 0;
- }
- }
- if (strip->ibuf_endstill) {
- if (!strip->ibuf_endstill->rect &&
- !strip->ibuf_endstill->rect_float) {
- IMB_freeImBuf(strip->ibuf_endstill);
- strip->ibuf_endstill = 0;
- }
- }
-}
-
-static void copy_from_ibuf_still(Sequence * seq, TStripElem * se)
-{
- if (!se->ibuf) {
- if (se->nr == 0 && seq->strip->ibuf_startstill) {
- IMB_cache_limiter_touch(seq->strip->ibuf_startstill);
-
- se->ibuf = IMB_dupImBuf(seq->strip->ibuf_startstill);
- }
- if (se->nr == seq->len - 1
- && (seq->len != 1)
- && seq->strip->ibuf_endstill) {
- IMB_cache_limiter_touch(seq->strip->ibuf_endstill);
-
- se->ibuf = IMB_dupImBuf(seq->strip->ibuf_endstill);
- }
- }
-}
-
-static void copy_to_ibuf_still(Sequence * seq, TStripElem * se)
-{
- if (se->ibuf) {
- if (se->nr == 0) {
- seq->strip->ibuf_startstill = IMB_dupImBuf(se->ibuf);
-
- IMB_cache_limiter_insert(seq->strip->ibuf_startstill);
- IMB_cache_limiter_touch(seq->strip->ibuf_startstill);
- }
- if (se->nr == seq->len - 1 && seq->len != 1) {
- seq->strip->ibuf_endstill = IMB_dupImBuf(se->ibuf);
-
- IMB_cache_limiter_insert(seq->strip->ibuf_endstill);
- IMB_cache_limiter_touch(seq->strip->ibuf_endstill);
- }
- }
-}
-
-static void free_metastrip_imbufs(ListBase *seqbasep, int cfra, int chanshown)
-{
- Sequence* seq_arr[MAXSEQ+1];
- int i;
- TStripElem* se = 0;
-
- evaluate_seq_frame_gen(seq_arr, seqbasep, cfra);
-
- for (i = 0; i < MAXSEQ; i++) {
- if (!video_seq_is_rendered(seq_arr[i])) {
- continue;
- }
- se = give_tstripelem(seq_arr[i], cfra);
- if (se) {
- if (se->ibuf) {
- IMB_freeImBuf(se->ibuf);
-
- se->ibuf= 0;
- se->ok= STRIPELEM_OK;
- }
-
- if (se->ibuf_comp) {
- IMB_freeImBuf(se->ibuf_comp);
-
- se->ibuf_comp = 0;
- }
- }
- }
-
-}
-
-static TStripElem* do_build_seq_array_recursively(
- ListBase *seqbasep, int cfra, int chanshown);
-
-static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
- int build_proxy_run)
-{
- char name[FILE_MAXDIR+FILE_MAXFILE];
- int use_limiter = TRUE;
-
- test_and_auto_discard_ibuf(se);
- test_and_auto_discard_ibuf_stills(seq->strip);
-
- if(seq->type == SEQ_META) {
- TStripElem * meta_se = 0;
- use_limiter = FALSE;
-
- if (!build_proxy_run && se->ibuf == 0) {
- se->ibuf = seq_proxy_fetch(seq, cfra);
- if (se->ibuf) {
- use_limiter = TRUE;
- }
- }
-
- if(!se->ibuf && seq->seqbase.first) {
- meta_se = do_build_seq_array_recursively(
- &seq->seqbase, seq->start + se->nr, 0);
- }
-
- se->ok = STRIPELEM_OK;
-
- if(!se->ibuf && meta_se) {
- se->ibuf = meta_se->ibuf_comp;
- if(se->ibuf &&
- (!input_have_to_preprocess(seq, se, cfra) ||
- build_proxy_run)) {
- IMB_refImBuf(se->ibuf);
- if (build_proxy_run) {
- IMB_cache_limiter_unref(se->ibuf);
- }
- } else if (se->ibuf) {
- struct ImBuf * i = IMB_dupImBuf(se->ibuf);
-
- IMB_cache_limiter_unref(se->ibuf);
-
- se->ibuf = i;
-
- use_limiter = TRUE;
- }
- }
- if (meta_se) {
- free_metastrip_imbufs(
- &seq->seqbase, seq->start + se->nr, 0);
- }
-
- if (use_limiter) {
- input_preprocess(seq, se, cfra);
- }
- } else if(seq->type & SEQ_EFFECT) {
- /* should the effect be recalculated? */
-
- if (!build_proxy_run && se->ibuf == 0) {
- se->ibuf = seq_proxy_fetch(seq, cfra);
- }
-
- if(se->ibuf == 0) {
- /* if any inputs are rectfloat, output is float too */
- if((se->se1 && se->se1->ibuf && se->se1->ibuf->rect_float) ||
- (se->se2 && se->se2->ibuf && se->se2->ibuf->rect_float) ||
- (se->se3 && se->se3->ibuf && se->se3->ibuf->rect_float))
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0);
- else
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0);
-
- do_effect(cfra, seq, se);
- }
- } else if(seq->type == SEQ_IMAGE) {
- if(se->ok == STRIPELEM_OK && se->ibuf == 0) {
- StripElem * s_elem = give_stripelem(seq, cfra);
- BLI_join_dirfile(name, seq->strip->dir, s_elem->name);
- BLI_convertstringcode(name, G.sce);
- BLI_convertstringframe(name, G.scene->r.cfra);
- if (!build_proxy_run) {
- se->ibuf = seq_proxy_fetch(seq, cfra);
- }
- copy_from_ibuf_still(seq, se);
-
- if (!se->ibuf) {
- se->ibuf= IMB_loadiffname(
- name, IB_rect);
- copy_to_ibuf_still(seq, se);
- }
-
- if(se->ibuf == 0) {
- se->ok = STRIPELEM_FAILED;
- } else if (!build_proxy_run) {
- input_preprocess(seq, se, cfra);
- }
- }
- } else if(seq->type == SEQ_MOVIE) {
- if(se->ok == STRIPELEM_OK && se->ibuf==0) {
- if(!build_proxy_run) {
- se->ibuf = seq_proxy_fetch(seq, cfra);
- }
- copy_from_ibuf_still(seq, se);
-
- if (se->ibuf == 0) {
- if(seq->anim==0) {
- BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name);
- BLI_convertstringcode(name, G.sce);
- BLI_convertstringframe(name, G.scene->r.cfra);
-
- seq->anim = openanim(
- name, IB_rect |
- ((seq->flag & SEQ_FILTERY)
- ? IB_animdeinterlace : 0));
- }
- if(seq->anim) {
- IMB_anim_set_preseek(seq->anim, seq->anim_preseek);
- se->ibuf = IMB_anim_absolute(seq->anim, se->nr + seq->anim_startofs);
- }
- copy_to_ibuf_still(seq, se);
- }
-
- if(se->ibuf == 0) {
- se->ok = STRIPELEM_FAILED;
- } else if (!build_proxy_run) {
- input_preprocess(seq, se, cfra);
- }
- }
- } else if(seq->type == SEQ_SCENE) { // scene can be NULL after deletions
- int oldcfra = CFRA;
- Sequence * oldseq = get_last_seq();
- Scene *sce= seq->scene, *oldsce= G.scene;
- Render *re;
- RenderResult rres;
- int doseq, rendering= G.rendering;
- char scenename[64];
- int sce_valid =sce&& (sce->camera || sce->r.scemode & R_DOSEQ);
-
- if (se->ibuf == NULL && sce_valid && !build_proxy_run) {
- se->ibuf = seq_proxy_fetch(seq, cfra);
- if (se->ibuf) {
- input_preprocess(seq, se, cfra);
- }
- }
-
- if (se->ibuf == NULL && sce_valid) {
- copy_from_ibuf_still(seq, se);
- if (se->ibuf) {
- input_preprocess(seq, se, cfra);
- }
- }
-
- if (!sce_valid) {
- se->ok = STRIPELEM_FAILED;
- } else if (se->ibuf==NULL && sce_valid) {
- waitcursor(1);
-
- /* Hack! This function can be called from do_render_seq(), in that case
- the seq->scene can already have a Render initialized with same name,
- so we have to use a default name. (compositor uses G.scene name to
- find render).
- However, when called from within the UI (image preview in sequencer)
- we do want to use scene Render, that way the render result is defined
- for display in render/imagewindow */
- if(rendering) {
- BLI_strncpy(scenename, sce->id.name+2, 64);
- strcpy(sce->id.name+2, " do_build_seq_ibuf");
- }
- re= RE_NewRender(sce->id.name);
-
- /* prevent eternal loop */
- doseq= G.scene->r.scemode & R_DOSEQ;
- G.scene->r.scemode &= ~R_DOSEQ;
-
- BIF_init_render_callbacks(re, 0); /* 0= no display callbacks */
-
- /* hrms, set_scene still needed? work on that... */
- if(sce!=oldsce) set_scene_bg(sce);
- RE_BlenderFrame(re, sce,
- seq->sfra+se->nr+seq->anim_startofs);
- if(sce!=oldsce) set_scene_bg(oldsce);
-
- /* UGLY WARNING, it is set to zero in RE_BlenderFrame */
- G.rendering= rendering;
- if(rendering)
- BLI_strncpy(sce->id.name+2, scenename, 64);
-
- RE_GetResultImage(re, &rres);
-
- if(rres.rectf) {
- se->ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat, 0);
- memcpy(se->ibuf->rect_float, rres.rectf, 4*sizeof(float)*rres.rectx*rres.recty);
- if(rres.rectz) {
- addzbuffloatImBuf(se->ibuf);
- memcpy(se->ibuf->zbuf_float, rres.rectz, sizeof(float)*rres.rectx*rres.recty);
- }
- } else if (rres.rect32) {
- se->ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect, 0);
- memcpy(se->ibuf->rect, rres.rect32, 4*rres.rectx*rres.recty);
- }
-
- BIF_end_render_callbacks();
-
- /* restore */
- G.scene->r.scemode |= doseq;
-
- if((G.f & G_PLAYANIM)==0) /* bad, is set on do_render_seq */
- waitcursor(0);
- CFRA = oldcfra;
- set_last_seq(oldseq);
-
- copy_to_ibuf_still(seq, se);
-
- if (!build_proxy_run) {
- if(se->ibuf == NULL) {
- se->ok = STRIPELEM_FAILED;
- } else {
- input_preprocess(seq, se, cfra);
- }
- }
-
- }
- }
- if (!build_proxy_run) {
- if (se->ibuf && use_limiter) {
- IMB_cache_limiter_insert(se->ibuf);
- IMB_cache_limiter_ref(se->ibuf);
- IMB_cache_limiter_touch(se->ibuf);
- }
- }
-}
-
-static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra);
-
-static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra)
-{
- float fac, facf;
- struct SeqEffectHandle sh = get_sequence_effect(seq);
- int early_out;
-
- se->se1 = 0;
- se->se2 = 0;
- se->se3 = 0;
-
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, cfra);
- fac= seq->facf0;
- facf= seq->facf1;
- } else {
- sh.get_default_fac(seq, cfra, &fac, &facf);
- }
-
- if( G.scene->r.mode & R_FIELDS ); else facf= fac;
-
- early_out = sh.early_out(seq, fac, facf);
- switch (early_out) {
- case -1:
- /* no input needed */
- break;
- case 0:
- se->se1 = do_build_seq_recursively(seq->seq1, cfra);
- se->se2 = do_build_seq_recursively(seq->seq2, cfra);
- if (seq->seq3) {
- se->se3 = do_build_seq_recursively(seq->seq3, cfra);
- }
- break;
- case 1:
- se->se1 = do_build_seq_recursively(seq->seq1, cfra);
- break;
- case 2:
- se->se2 = do_build_seq_recursively(seq->seq2, cfra);
- break;
- }
-
-
- do_build_seq_ibuf(seq, se, cfra, FALSE);
-
- /* children are not needed anymore ... */
-
- if (se->se1 && se->se1->ibuf) {
- IMB_cache_limiter_unref(se->se1->ibuf);
- }
- if (se->se2 && se->se2->ibuf) {
- IMB_cache_limiter_unref(se->se2->ibuf);
- }
- if (se->se3 && se->se3->ibuf) {
- IMB_cache_limiter_unref(se->se3->ibuf);
- }
-}
-
-static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra)
-{
- TStripElem *se;
-
- se = give_tstripelem(seq, cfra);
-
- if(se) {
- if (seq->type & SEQ_EFFECT) {
- do_effect_seq_recursively(seq, se, cfra);
- } else {
- do_build_seq_ibuf(seq, se, cfra, FALSE);
- }
- }
- return se;
-}
-
-/* FIXME:
-
-If cfra was float throughout blender (especially in the render
-pipeline) one could even _render_ with subframe precision
-instead of faking using the blend code below...
-
-*/
-
-static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra)
-{
- SpeedControlVars * s = (SpeedControlVars *)seq->effectdata;
- int nr = cfra - seq->start;
- float f_cfra;
- int cfra_left;
- int cfra_right;
- TStripElem * se = 0;
- TStripElem * se1 = 0;
- TStripElem * se2 = 0;
-
- sequence_effect_speed_rebuild_map(seq, 0);
-
- f_cfra = seq->start + s->frameMap[nr];
-
- cfra_left = (int) floor(f_cfra);
- cfra_right = (int) ceil(f_cfra);
-
- se = give_tstripelem(seq, cfra);
-
- if (!se) {
- return se;
- }
-
- if (cfra_left == cfra_right ||
- (s->flags & SEQ_SPEED_BLEND) == 0) {
- test_and_auto_discard_ibuf(se);
-
- if (se->ibuf == NULL) {
- se1 = do_build_seq_recursively_impl(
- seq->seq1, cfra_left);
-
- if((se1 && se1->ibuf && se1->ibuf->rect_float))
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0);
- else
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0);
-
- if (se1 == 0 || se1->ibuf == 0) {
- make_black_ibuf(se->ibuf);
- } else {
- if (se->ibuf != se1->ibuf) {
- if (se->ibuf) {
- IMB_freeImBuf(se->ibuf);
- }
-
- se->ibuf = se1->ibuf;
- IMB_refImBuf(se->ibuf);
- }
- }
- }
- } else {
- struct SeqEffectHandle sh;
-
- if(se->ibuf) {
- if(se->ibuf->x < seqrectx || se->ibuf->y < seqrecty
- || !(se->ibuf->rect || se->ibuf->rect_float)) {
- IMB_freeImBuf(se->ibuf);
- se->ibuf= 0;
- }
- }
-
- if (se->ibuf == NULL) {
- se1 = do_build_seq_recursively_impl(
- seq->seq1, cfra_left);
- se2 = do_build_seq_recursively_impl(
- seq->seq1, cfra_right);
-
- if((se1 && se1->ibuf && se1->ibuf->rect_float))
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0);
- else
- se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0);
-
- if (!se1 || !se2) {
- make_black_ibuf(se->ibuf);
- } else {
- sh = get_sequence_effect(seq);
-
- sh.execute(seq, cfra,
- f_cfra - (float) cfra_left,
- f_cfra - (float) cfra_left,
- se->ibuf->x, se->ibuf->y,
- se1->ibuf, se2->ibuf, 0, se->ibuf);
- }
- }
-
- }
-
- /* caller expects this to be referenced, so do it! */
- if (se->ibuf) {
- IMB_cache_limiter_insert(se->ibuf);
- IMB_cache_limiter_ref(se->ibuf);
- IMB_cache_limiter_touch(se->ibuf);
- }
-
- /* children are no longer needed */
- if (se1 && se1->ibuf)
- IMB_cache_limiter_unref(se1->ibuf);
- if (se2 && se2->ibuf)
- IMB_cache_limiter_unref(se2->ibuf);
-
- return se;
-}
-
-/*
- * build all ibufs recursively
- *
- * if successfull, the returned TStripElem contains the (referenced!) imbuf
- * that means: you _must_ call
- *
- * IMB_cache_limiter_unref(rval);
- *
- * if rval != 0
- *
- */
-
-static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra)
-{
- if (seq->type == SEQ_SPEED) {
- return do_handle_speed_effect(seq, cfra);
- } else {
- return do_build_seq_recursively_impl(seq, cfra);
- }
-}
-
-static TStripElem* do_build_seq_array_recursively(
- ListBase *seqbasep, int cfra, int chanshown)
-{
- Sequence* seq_arr[MAXSEQ+1];
- int count;
- int i;
- TStripElem* se = 0;
-
- count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr);
-
- if (!count) {
- return 0;
- }
-
- se = give_tstripelem(seq_arr[count - 1], cfra);
-
- if (!se) {
- return 0;
- }
-
- test_and_auto_discard_ibuf(se);
-
- if (se->ibuf_comp != 0) {
- IMB_cache_limiter_insert(se->ibuf_comp);
- IMB_cache_limiter_ref(se->ibuf_comp);
- IMB_cache_limiter_touch(se->ibuf_comp);
- return se;
- }
-
-
- if(count == 1) {
- se = do_build_seq_recursively(seq_arr[0], cfra);
- if (se->ibuf) {
- se->ibuf_comp = se->ibuf;
- IMB_refImBuf(se->ibuf_comp);
- }
- return se;
- }
-
-
- for (i = count - 1; i >= 0; i--) {
- int early_out;
- Sequence * seq = seq_arr[i];
- struct SeqEffectHandle sh;
-
- se = give_tstripelem(seq, cfra);
-
- test_and_auto_discard_ibuf(se);
-
- if (se->ibuf_comp != 0) {
- break;
- }
- if (seq->blend_mode == SEQ_BLEND_REPLACE) {
- do_build_seq_recursively(seq, cfra);
- if (se->ibuf) {
- se->ibuf_comp = se->ibuf;
- IMB_refImBuf(se->ibuf);
- } else {
- se->ibuf_comp = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rect, 0);
- }
- break;
- }
-
- sh = get_sequence_blend(seq);
-
- seq->facf0 = seq->facf1 = 1.0;
-
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(seq, cfra);
- }
-
- if( G.scene->r.mode & R_FIELDS ); else seq->facf0 = seq->facf1;
-
- seq->facf0 *= seq->blend_opacity / 100.0;
- seq->facf1 *= seq->blend_opacity / 100.0;
-
- early_out = sh.early_out(seq, seq->facf0, seq->facf1);
-
- switch (early_out) {
- case -1:
- case 2:
- do_build_seq_recursively(seq, cfra);
- if (se->ibuf) {
- se->ibuf_comp = se->ibuf;
- IMB_refImBuf(se->ibuf_comp);
- } else {
- se->ibuf_comp = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rect, 0);
- }
- break;
- case 1:
- if (i == 0) {
- se->ibuf_comp = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rect, 0);
- IMB_cache_limiter_insert(se->ibuf_comp);
- IMB_cache_limiter_ref(se->ibuf_comp);
- IMB_cache_limiter_touch(se->ibuf_comp);
- }
- break;
- case 0:
- do_build_seq_recursively(seq, cfra);
- if (!se->ibuf) {
- se->ibuf = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rect, 0);
- }
- if (i == 0) {
- se->ibuf_comp = se->ibuf;
- IMB_refImBuf(se->ibuf_comp);
- }
- break;
- }
-
- if (se->ibuf_comp) {
- break;
- }
- }
-
- i++;
-
- for (; i < count; i++) {
- Sequence * seq = seq_arr[i];
- struct SeqEffectHandle sh = get_sequence_blend(seq);
- TStripElem* se1 = give_tstripelem(seq_arr[i-1], cfra);
- TStripElem* se2 = give_tstripelem(seq_arr[i], cfra);
-
- int early_out = sh.early_out(seq, seq->facf0, seq->facf1);
- switch (early_out) {
- case 0: {
- int x= se2->ibuf->x;
- int y= se2->ibuf->y;
- int swap_input = FALSE;
-
- if (se1->ibuf_comp->rect_float ||
- se2->ibuf->rect_float) {
- se2->ibuf_comp = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rectfloat, 0);
- } else {
- se2->ibuf_comp = IMB_allocImBuf(
- (short)seqrectx, (short)seqrecty,
- 32, IB_rect, 0);
- }
-
-
- if (!se1->ibuf_comp->rect_float &&
- se2->ibuf_comp->rect_float) {
- IMB_float_from_rect(se1->ibuf_comp);
- }
- if (!se2->ibuf->rect_float &&
- se2->ibuf_comp->rect_float) {
- IMB_float_from_rect(se2->ibuf);
- }
-
- if (!se1->ibuf_comp->rect &&
- !se2->ibuf_comp->rect_float) {
- IMB_rect_from_float(se1->ibuf_comp);
- }
- if (!se2->ibuf->rect &&
- !se2->ibuf_comp->rect_float) {
- IMB_rect_from_float(se2->ibuf);
- }
-
- /* bad hack, to fix crazy input ordering of
- those two effects */
-
- if (seq->blend_mode == SEQ_ALPHAOVER ||
- seq->blend_mode == SEQ_ALPHAUNDER ||
- seq->blend_mode == SEQ_OVERDROP) {
- swap_input = TRUE;
- }
-
- if (swap_input) {
- sh.execute(seq, cfra,
- seq->facf0, seq->facf1, x, y,
- se2->ibuf, se1->ibuf_comp, 0,
- se2->ibuf_comp);
- } else {
- sh.execute(seq, cfra,
- seq->facf0, seq->facf1, x, y,
- se1->ibuf_comp, se2->ibuf, 0,
- se2->ibuf_comp);
- }
-
- IMB_cache_limiter_insert(se2->ibuf_comp);
- IMB_cache_limiter_ref(se2->ibuf_comp);
- IMB_cache_limiter_touch(se2->ibuf_comp);
-
- IMB_cache_limiter_unref(se1->ibuf_comp);
- IMB_cache_limiter_unref(se2->ibuf);
-
- break;
- }
- case 1: {
- se2->ibuf_comp = se1->ibuf;
- IMB_refImBuf(se2->ibuf_comp);
-
- break;
- }
- }
- se = se2;
- }
-
- return se;
-}
-
-/*
- * returned ImBuf is refed!
- * you have to unref after usage!
- */
-
-static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown)
-{
- Editing *ed;
- int count;
- ListBase *seqbasep;
- TStripElem *se;
-
- ed= G.scene->ed;
- if(ed==0) return 0;
-
- count = BLI_countlist(&ed->metastack);
- if((chanshown < 0) && (count > 0)) {
- count = MAX2(count + chanshown, 0);
- seqbasep= ((MetaStack*)BLI_findlink(&ed->metastack, count))->oldbasep;
- } else {
- seqbasep= ed->seqbasep;
- }
-
- seqrectx= rectx; /* bad bad global! */
- seqrecty= recty;
-
- se = do_build_seq_array_recursively(seqbasep, cfra, chanshown);
-
- if(!se) {
- return 0;
- }
-
- return se->ibuf_comp;
-}
-
-ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra,
- Sequence * seq)
-{
- TStripElem* se;
-
- seqrectx= rectx; /* bad bad global! */
- seqrecty= recty;
-
- se = do_build_seq_recursively(seq, cfra);
-
- if(!se) {
- return 0;
- }
-
- if (se->ibuf) {
- IMB_cache_limiter_unref(se->ibuf);
- }
-
- return se->ibuf;
-}
-
-ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chanshown)
-{
- ImBuf* i = give_ibuf_seq_impl(rectx, recty, cfra, chanshown);
-
- if (i) {
- IMB_cache_limiter_unref(i);
- }
- return i;
-}
-
-/* check used when we need to change seq->blend_mode but not to effect or audio strips */
-int seq_can_blend(Sequence *seq)
-{
- if (ELEM4(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE)) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* threading api */
-
-static ListBase running_threads;
-static ListBase prefetch_wait;
-static ListBase prefetch_done;
-
-static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER;
-
-static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER;
-
-static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER;
-
-static volatile int seq_thread_shutdown = FALSE;
-static volatile int seq_last_given_monoton_cfra = 0;
-static int monoton_cfra = 0;
-
-typedef struct PrefetchThread {
- struct PrefetchThread *next, *prev;
- struct PrefetchQueueElem *current;
- pthread_t pthread;
- int running;
-} PrefetchThread;
-
-typedef struct PrefetchQueueElem {
- struct PrefetchQueueElem *next, *prev;
-
- int rectx;
- int recty;
- int cfra;
- int chanshown;
-
- int monoton_cfra;
-
- struct ImBuf * ibuf;
-} PrefetchQueueElem;
-
-static void * seq_prefetch_thread(void * This_)
-{
- PrefetchThread * This = This_;
-
- while (!seq_thread_shutdown) {
- PrefetchQueueElem * e;
- int s_last;
-
- pthread_mutex_lock(&queue_lock);
- e = prefetch_wait.first;
- if (e) {
- BLI_remlink(&prefetch_wait, e);
- }
- s_last = seq_last_given_monoton_cfra;
-
- This->current = e;
-
- pthread_mutex_unlock(&queue_lock);
-
- if (!e) {
- pthread_mutex_lock(&prefetch_ready_lock);
-
- This->running = FALSE;
-
- pthread_cond_signal(&prefetch_ready_cond);
- pthread_mutex_unlock(&prefetch_ready_lock);
-
- pthread_mutex_lock(&wakeup_lock);
- if (!seq_thread_shutdown) {
- pthread_cond_wait(&wakeup_cond, &wakeup_lock);
- }
- pthread_mutex_unlock(&wakeup_lock);
- continue;
- }
-
- This->running = TRUE;
-
- if (e->cfra >= s_last) {
- e->ibuf = give_ibuf_seq_impl(
- e->rectx, e->recty, e->cfra, e->chanshown);
- }
-
- pthread_mutex_lock(&queue_lock);
-
- BLI_addtail(&prefetch_done, e);
-
- for (e = prefetch_wait.first; e; e = e->next) {
- if (s_last > e->monoton_cfra) {
- BLI_remlink(&prefetch_wait, e);
- MEM_freeN(e);
- }
- }
-
- for (e = prefetch_done.first; e; e = e->next) {
- if (s_last > e->monoton_cfra) {
- if (e->ibuf) {
- IMB_cache_limiter_unref(e->ibuf);
- }
- BLI_remlink(&prefetch_done, e);
- MEM_freeN(e);
- }
- }
-
- pthread_mutex_unlock(&queue_lock);
-
- pthread_mutex_lock(&frame_done_lock);
- pthread_cond_signal(&frame_done_cond);
- pthread_mutex_unlock(&frame_done_lock);
- }
- return 0;
-}
-
-void seq_start_threads()
-{
- int i;
-
- running_threads.first = running_threads.last = NULL;
- prefetch_wait.first = prefetch_wait.last = NULL;
- prefetch_done.first = prefetch_done.last = NULL;
-
- seq_thread_shutdown = FALSE;
- seq_last_given_monoton_cfra = monoton_cfra = 0;
-
- /* since global structures are modified during the processing
- of one frame, only one render thread is currently possible...
-
- (but we code, in the hope, that we can remove this restriction
- soon...)
- */
-
- fprintf(stderr, "SEQ-THREAD: seq_start_threads\n");
-
- for (i = 0; i < 1; i++) {
- PrefetchThread *t = MEM_callocN(sizeof(PrefetchThread),
- "prefetch_thread");
- t->running = TRUE;
- BLI_addtail(&running_threads, t);
-
- pthread_create(&t->pthread, NULL, seq_prefetch_thread, t);
- }
-
- /* init malloc mutex */
- BLI_init_threads(0, 0, 0);
-}
-
-void seq_stop_threads()
-{
- PrefetchThread *tslot;
- PrefetchQueueElem * e;
-
- fprintf(stderr, "SEQ-THREAD: seq_stop_threads()\n");
-
- if (seq_thread_shutdown) {
- fprintf(stderr, "SEQ-THREAD: ... already stopped\n");
- return;
- }
-
- pthread_mutex_lock(&wakeup_lock);
-
- seq_thread_shutdown = TRUE;
-
- pthread_cond_broadcast(&wakeup_cond);
- pthread_mutex_unlock(&wakeup_lock);
-
- for(tslot = running_threads.first; tslot; tslot= tslot->next) {
- pthread_join(tslot->pthread, NULL);
- }
-
-
- for (e = prefetch_wait.first; e; e = e->next) {
- BLI_remlink(&prefetch_wait, e);
- MEM_freeN(e);
- }
-
- for (e = prefetch_done.first; e; e = e->next) {
- if (e->ibuf) {
- IMB_cache_limiter_unref(e->ibuf);
- }
- BLI_remlink(&prefetch_done, e);
- MEM_freeN(e);
- }
-
- BLI_freelistN(&running_threads);
-
- /* deinit malloc mutex */
- BLI_end_threads(0);
-}
-
-void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown)
-{
- PrefetchQueueElem * e;
- if (seq_thread_shutdown) {
- return;
- }
-
- e = MEM_callocN(sizeof(PrefetchQueueElem), "prefetch_queue_elem");
- e->rectx = rectx;
- e->recty = recty;
- e->cfra = cfra;
- e->chanshown = chanshown;
- e->monoton_cfra = monoton_cfra++;
-
- pthread_mutex_lock(&queue_lock);
- BLI_addtail(&prefetch_wait, e);
- pthread_mutex_unlock(&queue_lock);
-
- pthread_mutex_lock(&wakeup_lock);
- pthread_cond_signal(&wakeup_cond);
- pthread_mutex_unlock(&wakeup_lock);
-}
-
-void seq_wait_for_prefetch_ready()
-{
- PrefetchThread *tslot;
-
- if (seq_thread_shutdown) {
- return;
- }
-
- fprintf(stderr, "SEQ-THREAD: rendering prefetch frames...\n");
-
- pthread_mutex_lock(&prefetch_ready_lock);
-
- for(;;) {
- for(tslot = running_threads.first; tslot; tslot= tslot->next) {
- if (tslot->running) {
- break;
- }
- }
- if (!tslot) {
- break;
- }
- pthread_cond_wait(&prefetch_ready_cond, &prefetch_ready_lock);
- }
-
- pthread_mutex_unlock(&prefetch_ready_lock);
-
- fprintf(stderr, "SEQ-THREAD: prefetch done\n");
-}
-
-ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown)
-{
- PrefetchQueueElem * e = 0;
- int found_something = FALSE;
-
- if (seq_thread_shutdown) {
- return give_ibuf_seq(rectx, recty, cfra, chanshown);
- }
-
- while (!e) {
- int success = FALSE;
- pthread_mutex_lock(&queue_lock);
-
- for (e = prefetch_done.first; e; e = e->next) {
- if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- rectx == e->rectx &&
- recty == e->recty) {
- success = TRUE;
- found_something = TRUE;
- break;
- }
- }
-
- if (!e) {
- for (e = prefetch_wait.first; e; e = e->next) {
- if (cfra == e->cfra &&
- chanshown == e->chanshown &&
- rectx == e->rectx &&
- recty == e->recty) {
- found_something = TRUE;
- break;
- }
- }
- }
-
- if (!e) {
- PrefetchThread *tslot;
-
- for(tslot = running_threads.first;
- tslot; tslot= tslot->next) {
- if (tslot->current &&
- cfra == tslot->current->cfra &&
- chanshown == tslot->current->chanshown &&
- rectx == tslot->current->rectx &&
- recty == tslot->current->recty) {
- found_something = TRUE;
- break;
- }
- }
- }
-
- /* e->ibuf is unrefed by render thread on next round. */
-
- if (e) {
- seq_last_given_monoton_cfra = e->monoton_cfra;
- }
-
- pthread_mutex_unlock(&queue_lock);
-
- if (!success) {
- e = NULL;
-
- if (!found_something) {
- fprintf(stderr,
- "SEQ-THREAD: Requested frame "
- "not in queue ???\n");
- break;
- }
- pthread_mutex_lock(&frame_done_lock);
- pthread_cond_wait(&frame_done_cond, &frame_done_lock);
- pthread_mutex_unlock(&frame_done_lock);
- }
- }
-
- return e ? e->ibuf : 0;
-}
-
-/* Functions to free imbuf and anim data on changes */
-
-static void free_imbuf_strip_elem(TStripElem *se)
-{
- if(se->ibuf) {
- IMB_freeImBuf(se->ibuf);
- }
- if(se->ibuf_comp) {
- IMB_freeImBuf(se->ibuf_comp);
- }
- se->ibuf_comp = 0;
- se->ibuf= 0;
- se->ok= STRIPELEM_OK;
- se->se1= se->se2= se->se3= 0;
-}
-
-static void free_anim_seq(Sequence *seq)
-{
- if(seq->anim) {
- IMB_free_anim(seq->anim);
- seq->anim = 0;
- }
-}
-
-void free_imbuf_seq_except(int cfra)
-{
- Editing *ed= G.scene->ed;
- Sequence *seq;
- TStripElem *se;
- int a;
-
- if(ed==0) return;
-
- WHILE_SEQ(&ed->seqbase) {
- if(seq->strip) {
- TStripElem * curelem = give_tstripelem(seq, cfra);
-
- for(a = 0, se = seq->strip->tstripdata;
- a < seq->strip->len && se; a++, se++) {
- if(se != curelem) {
- free_imbuf_strip_elem(se);
- }
- }
- for(a = 0, se = seq->strip->tstripdata_startstill;
- a < seq->strip->startstill && se; a++, se++) {
- if(se != curelem) {
- free_imbuf_strip_elem(se);
- }
- }
- for(a = 0, se = seq->strip->tstripdata_endstill;
- a < seq->strip->endstill && se; a++, se++) {
- if(se != curelem) {
- free_imbuf_strip_elem(se);
- }
- }
- if(seq->strip->ibuf_startstill) {
- IMB_freeImBuf(seq->strip->ibuf_startstill);
- seq->strip->ibuf_startstill = 0;
- }
-
- if(seq->strip->ibuf_endstill) {
- IMB_freeImBuf(seq->strip->ibuf_endstill);
- seq->strip->ibuf_endstill = 0;
- }
-
- if(seq->type==SEQ_MOVIE)
- if(seq->startdisp > cfra || seq->enddisp < cfra)
- free_anim_seq(seq);
- }
- }
- END_SEQ
-}
-
-void free_imbuf_seq()
-{
- Editing *ed= G.scene->ed;
- Sequence *seq;
- TStripElem *se;
- int a;
-
- if(ed==0) return;
-
- WHILE_SEQ(&ed->seqbase) {
- if(seq->strip) {
- for(a = 0, se = seq->strip->tstripdata;
- a < seq->strip->len && se; a++, se++) {
- free_imbuf_strip_elem(se);
- }
- for(a = 0, se = seq->strip->tstripdata_startstill;
- a < seq->strip->startstill && se; a++, se++) {
- free_imbuf_strip_elem(se);
- }
- for(a = 0, se = seq->strip->tstripdata_endstill;
- a < seq->strip->endstill && se; a++, se++) {
- free_imbuf_strip_elem(se);
- }
- if(seq->strip->ibuf_startstill) {
- IMB_freeImBuf(seq->strip->ibuf_startstill);
- seq->strip->ibuf_startstill = 0;
- }
-
- if(seq->strip->ibuf_endstill) {
- IMB_freeImBuf(seq->strip->ibuf_endstill);
- seq->strip->ibuf_endstill = 0;
- }
-
- if(seq->type==SEQ_MOVIE)
- free_anim_seq(seq);
- if(seq->type==SEQ_SPEED) {
- sequence_effect_speed_rebuild_map(seq, 1);
- }
- }
- }
- END_SEQ
-}
-
-void free_imbuf_seq_with_ipo(struct Ipo *ipo)
-{
- /* force update of all sequences with this ipo, on ipo changes */
- Editing *ed= G.scene->ed;
- Sequence *seq;
-
- if(ed==0) return;
-
- WHILE_SEQ(&ed->seqbase) {
- if(seq->ipo == ipo) {
- update_changed_seq_and_deps(seq, 0, 1);
- if(seq->type == SEQ_SPEED) {
- sequence_effect_speed_rebuild_map(seq, 1);
- }
- }
- }
- END_SEQ
-}
-
-static int update_changed_seq_recurs(Sequence *seq, Sequence *changed_seq, int len_change, int ibuf_change)
-{
- Sequence *subseq;
- int a, free_imbuf = 0;
- TStripElem *se;
-
- /* recurs downwards to see if this seq depends on the changed seq */
-
- if(seq == NULL)
- return 0;
-
- if(seq == changed_seq)
- free_imbuf = 1;
-
- for(subseq=seq->seqbase.first; subseq; subseq=subseq->next)
- if(update_changed_seq_recurs(subseq, changed_seq, len_change, ibuf_change))
- free_imbuf = TRUE;
-
- if(seq->seq1)
- if(update_changed_seq_recurs(seq->seq1, changed_seq, len_change, ibuf_change))
- free_imbuf = TRUE;
- if(seq->seq2 && (seq->seq2 != seq->seq1))
- if(update_changed_seq_recurs(seq->seq2, changed_seq, len_change, ibuf_change))
- free_imbuf = TRUE;
- if(seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2))
- if(update_changed_seq_recurs(seq->seq3, changed_seq, len_change, ibuf_change))
- free_imbuf = TRUE;
-
- if(free_imbuf) {
- if(ibuf_change) {
- se= seq->strip->tstripdata;
- if (se) {
- for(a=0; a<seq->len; a++, se++)
- free_imbuf_strip_elem(se);
- }
-
- if(seq->type == SEQ_MOVIE)
- free_anim_seq(seq);
- if(seq->type == SEQ_SPEED) {
- sequence_effect_speed_rebuild_map(seq, 1);
- }
- }
-
- if(len_change)
- calc_sequence(seq);
- }
-
- return free_imbuf;
-}
-
-void update_changed_seq_and_deps(Sequence *changed_seq, int len_change, int ibuf_change)
-{
- Editing *ed= G.scene->ed;
- Sequence *seq;
-
- if (!ed) return;
-
- for (seq=ed->seqbase.first; seq; seq=seq->next)
- update_changed_seq_recurs(seq, changed_seq, len_change, ibuf_change);
-}
-
-/* bad levell call... */
-void do_render_seq(RenderResult *rr, int cfra)
-{
- ImBuf *ibuf;
-
- G.f |= G_PLAYANIM; /* waitcursor patch */
-
- ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0);
-
- if(ibuf) {
- if(ibuf->rect_float) {
- if (!rr->rectf)
- rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
-
- memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
-
- /* TSK! Since sequence render doesn't free the *rr render result, the old rect32
- can hang around when sequence render has rendered a 32 bits one before */
- if(rr->rect32) {
- MEM_freeN(rr->rect32);
- rr->rect32= NULL;
- }
- }
- else if(ibuf->rect) {
- if (!rr->rect32)
- rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
-
- memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty);
-
- /* if (ibuf->zbuf) { */
- /* if (R.rectz) freeN(R.rectz); */
- /* R.rectz = BLI_dupallocN(ibuf->zbuf); */
- /* } */
- }
-
- /* Let the cache limitor take care of this (schlaile) */
- /* While render let's keep all memory available for render
- (ton)
- At least if free memory is tight...
- This can make a big difference in encoding speed
- (it is around 4 times(!) faster, if we do not waste time
- on freeing _all_ buffers every time on long timelines...)
- (schlaile)
- */
- {
- uintptr_t mem_in_use;
- uintptr_t mmap_in_use;
- uintptr_t max;
-
- mem_in_use= MEM_get_memory_in_use();
- mmap_in_use= MEM_get_mapped_memory_in_use();
- max = MEM_CacheLimiter_get_maximum();
-
- if (max != 0 && mem_in_use + mmap_in_use > max) {
- fprintf(stderr, "Memory in use > maximum memory\n");
- fprintf(stderr, "Cleaning up, please wait...\n"
- "If this happens very often,\n"
- "consider "
- "raising the memcache limit in the "
- "user preferences.\n");
- free_imbuf_seq();
- }
- }
- }
- else {
- /* render result is delivered empty in most cases, nevertheless we handle all cases */
- if (rr->rectf)
- memset(rr->rectf, 0, 4*sizeof(float)*rr->rectx*rr->recty);
- else if (rr->rect32)
- memset(rr->rect32, 0, 4*rr->rectx*rr->recty);
- else
- rr->rect32= MEM_callocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect");
- }
-
- G.f &= ~G_PLAYANIM;
-
-}
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
deleted file mode 100644
index b6221c2f84b..00000000000
--- a/source/blender/src/space.c
+++ /dev/null
@@ -1,7150 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- *
- * - here initialize and free and handling SPACE data
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-#include "MEM_CacheLimiterC-Api.h"
-
-#ifdef INTERNATIONAL
-#include "BIF_language.h"
-#endif
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "BLI_gsqueue.h"
-#include "BLI_linklist.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_group_types.h" /* used for select_same_group */
-#include "DNA_gpencil_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h" /* used for select grouped hooks */
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_property_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_sequence_types.h"
-#include "DNA_sound_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view2d_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_blender.h"
-#include "BKE_colortools.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_ipo.h"
-#include "BKE_main.h"
-#include "BKE_mesh.h"
-#include "BKE_multires.h"
-#include "BKE_node.h"
-#include "BKE_pointcache.h"
-#include "BKE_property.h"
-#include "BKE_scene.h"
-#include "BKE_sculpt.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_image.h" /* for IMA_TYPE_COMPOSITE and IMA_TYPE_R_RESULT */
-#include "BKE_particle.h"
-#include "BIF_spacetypes.h" /* first, nasty dependency with typedef */
-
-#include "BIF_butspace.h"
-#include "BIF_drawimage.h"
-#include "BIF_drawseq.h"
-#include "BIF_drawtext.h"
-#include "BIF_drawscript.h"
-#include "BIF_editarmature.h"
-#include "BIF_editparticle.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editdeform.h"
-#include "BIF_editfont.h"
-#include "BIF_editgroup.h"
-#include "BIF_editkey.h"
-#include "BIF_editlattice.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_editnla.h"
-#include "BIF_editoops.h"
-#include "BIF_editseq.h"
-#include "BIF_editsima.h"
-#include "BIF_editsound.h"
-#include "BIF_editview.h"
-#include "BIF_filelist.h"
-#include "BIF_gl.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_keyframing.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_oops.h"
-#include "BIF_poselib.h"
-#include "BIF_poseobject.h"
-#include "BIF_outliner.h"
-#include "BIF_radialcontrol.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-#include "BIF_previewrender.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-#include "BSE_editipo.h"
-#include "BSE_drawipo.h"
-#include "BSE_drawview.h"
-#include "BSE_drawnla.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_editnla_types.h"
-#include "BSE_time.h"
-#include "BSE_trans_types.h"
-
-#include "BDR_vpaint.h"
-#include "BDR_editmball.h"
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_editface.h"
-#include "BDR_drawmesh.h"
-#include "BDR_drawobject.h"
-#include "BDR_imagepaint.h"
-#include "BDR_sculptmode.h"
-#include "BDR_unwrapper.h"
-#include "BDR_gpencil.h"
-
-#include "BLO_readfile.h" /* for BLO_blendhandle_close */
-
-#include "PIL_time.h"
-
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "butspace.h"
-#include "mydevice.h"
-#include "blendef.h"
-#include "datatoc.h"
-#include "multires.h"
-
-#include "BIF_transform.h"
-
-#include "BKE_depsgraph.h"
-
-#include "BSE_trans_types.h"
-
-#include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
-
-#include "GPU_extensions.h"
-#include "GPU_draw.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* maybe we need this defined somewhere else */
-extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);
-extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);/*rcruiz*/
-
-/**
- * When the mipmap setting changes, we want to redraw the view right
- * away to reflect this setting.
- */
-//static void space_mipmap_button_function(int event);
-
-static void free_soundspace(SpaceSound *ssound);
-
-/* *************************************** */
-
-/* don't know yet how the handlers will evolve, for simplicity
- i choose for an array with eventcodes, this saves in a file!
- */
-void add_blockhandler(ScrArea *sa, short eventcode, short val)
-{
- SpaceLink *sl= sa->spacedata.first;
- short a;
-
- /* find empty spot */
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- if( sl->blockhandler[a]==eventcode ) {
- sl->blockhandler[a+1]= val;
- break;
- }
- else if( sl->blockhandler[a]==0) {
- sl->blockhandler[a]= eventcode;
- sl->blockhandler[a+1]= val;
- break;
- }
- }
- if(a==SPACE_MAXHANDLER) {
- error("Only %i floating panels allowed", SPACE_MAXHANDLER/2);
- }
-
-}
-
-void rem_blockhandler(ScrArea *sa, short eventcode)
-{
- SpaceLink *sl= sa->spacedata.first;
- short a;
-
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- if( sl->blockhandler[a]==eventcode) {
- sl->blockhandler[a]= 0;
-
- /* specific free calls */
- if(eventcode==IMAGE_HANDLER_PREVIEW)
- image_preview_event(0);
- break;
- }
- }
-}
-
-void toggle_blockhandler(ScrArea *sa, short eventcode, short val)
-{
- SpaceLink *sl= sa->spacedata.first;
- short a, addnew=1;
-
- /* find if it exists */
- for(a=0; a<SPACE_MAXHANDLER; a+=2) {
- if( sl->blockhandler[a]==eventcode ) {
- sl->blockhandler[a]= 0;
-
- /* specific free calls */
- if(eventcode==VIEW3D_HANDLER_PREVIEW)
- BIF_view3d_previewrender_free(sa->spacedata.first);
- else if(eventcode==IMAGE_HANDLER_PREVIEW)
- image_preview_event(0);
-
- addnew= 0;
- }
- }
- if(addnew) {
- add_blockhandler(sa, eventcode, val);
-
- /* specific add new calls */
- if(eventcode==IMAGE_HANDLER_PREVIEW)
- image_preview_event(1);
- }
-}
-
-
-
-/* ************* SPACE: VIEW3D ************* */
-
-/* extern void drawview3dspace(ScrArea *sa, void *spacedata); BSE_drawview.h */
-
-
-void copy_view3d_lock(short val)
-{
- bScreen *sc;
- int bit;
-
- /* from G.scene copy to the other views */
- sc= G.main->screen.first;
-
- while(sc) {
- if(sc->scene==G.scene) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_OOPS && val==REDRAW) {
- if(sa->win) scrarea_queue_winredraw(sa);
- }
- else if(sl->spacetype==SPACE_VIEW3D) {
- View3D *vd= (View3D*) sl;
- if(vd->scenelock && vd->localview==0) {
- vd->lay= G.scene->lay;
- vd->camera= G.scene->camera;
-
- if(vd->camera==0 && vd->persp==V3D_CAMOB) vd->persp= V3D_PERSP;
-
- if( (vd->lay & vd->layact) == 0) {
- bit= 0;
- while(bit<32) {
- if(vd->lay & (1<<bit)) {
- vd->layact= 1<<bit;
- break;
- }
- bit++;
- }
- }
-
- if(val==REDRAW && vd==sa->spacedata.first) {
- if(sa->win) scrarea_queue_redraw(sa);
- }
- }
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- }
- sc= sc->id.next;
- }
-}
-
-void handle_view3d_around()
-{
- bScreen *sc;
-
- if ((U.uiflag & USER_LOCKAROUND)==0) return;
-
- /* copies from G.vd->around to other view3ds */
-
- sc= G.main->screen.first;
-
- while(sc) {
- if(sc->scene==G.scene) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *vd= (View3D*) sl;
- if (vd != G.vd) {
- vd->around= G.vd->around;
- if (G.vd->flag & V3D_ALIGN)
- vd->flag |= V3D_ALIGN;
- else
- vd->flag &= ~V3D_ALIGN;
- scrarea_queue_headredraw(sa);
- }
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- }
- sc= sc->id.next;
- }
-}
-
-void handle_view3d_lock()
-{
- if (G.vd != NULL && curarea != NULL ) {
- if(G.vd->localview==0 && G.vd->scenelock && curarea->spacetype==SPACE_VIEW3D) {
-
- /* copy to scene */
- G.scene->lay= G.vd->lay;
- G.scene->camera= G.vd->camera;
-
- copy_view3d_lock(REDRAW);
- }
- }
-}
-
-void space_set_commmandline_options(void) {
- SYS_SystemHandle syshandle;
- int a;
-
- if ( (syshandle = SYS_GetSystem()) ) {
- /* User defined settings */
- a= (U.gameflags & USER_DISABLE_SOUND);
- /* if user already disabled audio at the command-line, don't re-enable it */
- if (a)
- {
- SYS_WriteCommandLineInt(syshandle, "noaudio", a);
- }
-
- a= (U.gameflags & USER_DISABLE_MIPMAP);
- GPU_set_mipmap(!a);
- SYS_WriteCommandLineInt(syshandle, "nomipmap", a);
-
- /* File specific settings: */
- /* Only test the first one. These two are switched
- * simultaneously. */
- a= (G.fileflags & G_FILE_SHOW_FRAMERATE);
- SYS_WriteCommandLineInt(syshandle, "show_framerate", a);
- SYS_WriteCommandLineInt(syshandle, "show_profile", a);
-
- /* When in wireframe mode, always draw debug props. */
- if (G.vd) {
- a = ( (G.fileflags & G_FILE_SHOW_DEBUG_PROPS)
- || (G.vd->drawtype == OB_WIRE)
- || (G.vd->drawtype == OB_SOLID) );
- SYS_WriteCommandLineInt(syshandle, "show_properties", a);
- }
-
- a= (G.fileflags & G_FILE_SHOW_PHYSICS);
- SYS_WriteCommandLineInt(syshandle, "show_physics", a);
-
- a= (G.fileflags & G_FILE_ENABLE_ALL_FRAMES);
- SYS_WriteCommandLineInt(syshandle, "fixedtime", a);
-
- a= (G.fileflags & G_FILE_GAME_TO_IPO);
- SYS_WriteCommandLineInt(syshandle, "game2ipo", a);
-
- a=(G.fileflags & G_FILE_GAME_MAT);
- SYS_WriteCommandLineInt(syshandle, "blender_material", a);
- a=(G.fileflags & G_FILE_GAME_MAT_GLSL);
- SYS_WriteCommandLineInt(syshandle, "blender_glsl_material", a);
- a=(G.fileflags & G_FILE_DISPLAY_LISTS);
- SYS_WriteCommandLineInt(syshandle, "displaylists", a);
-
-
- }
-}
-
-#if GAMEBLENDER == 1
- /**
- * These two routines imported from the gameengine,
- * I suspect a lot of the resetting stuff is cruft
- * and can be removed, but it should be checked.
- */
-static void SaveState(void)
-{
- glPushAttrib(GL_ALL_ATTRIB_BITS);
-
- GPU_state_init();
-
- if(G.f & G_TEXTUREPAINT)
- GPU_paint_set_mipmap(1);
-
- waitcursor(1);
-}
-
-static void RestoreState(void)
-{
- if(G.f & G_TEXTUREPAINT)
- GPU_paint_set_mipmap(0);
-
- curarea->win_swap = 0;
- curarea->head_swap=0;
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSALL, 0);
- reset_slowparents();
- waitcursor(0);
- G.qual= 0;
- glPopAttrib();
-}
-
-static LinkNode *save_and_reset_all_scene_cfra(void)
-{
- LinkNode *storelist= NULL;
- Scene *sc;
-
- for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- BLI_linklist_prepend(&storelist, (void*) (intptr_t) sc->r.cfra);
-
- /* why is this reset to 1 ?*/
- /* sc->r.cfra= 1;*/
-
- set_scene_bg(sc);
- }
-
- BLI_linklist_reverse(&storelist);
-
- return storelist;
-}
-
-static void restore_all_scene_cfra(LinkNode *storelist) {
- LinkNode *sc_store= storelist;
- Scene *sc;
-
- for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- int stored_cfra= (intptr_t) sc_store->link;
-
- sc->r.cfra= stored_cfra;
- set_scene_bg(sc);
-
- sc_store= sc_store->next;
- }
-
- BLI_linklist_free(storelist, NULL);
-}
-#endif
-
-void start_game(void)
-{
-#if GAMEBLENDER == 1
-#ifndef NO_KETSJI
- Scene *sc, *startscene = G.scene;
- LinkNode *scene_cfra_store;
-
- /* XXX, silly code - the game engine can
- * access any scene through logic, so we try
- * to make sure each scene has a valid camera,
- * just in case the game engine tries to use it.
- *
- * Better would be to make a better routine
- * in the game engine for finding the camera.
- * - zr
- * Note: yes, this is all very badly hacked! (ton)
- */
- for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- if (!sc->camera) {
- Base *base;
-
- for (base= sc->base.first; base; base= base->next)
- if (base->object->type==OB_CAMERA)
- break;
-
- sc->camera= base?base->object:NULL;
- }
- }
-
- /* these two lines make sure front and backbuffer are equal. for swapbuffers */
- markdirty_all();
- screen_swapbuffers();
-
- /* can start from header */
- mywinset(curarea->win);
-
- scene_cfra_store= save_and_reset_all_scene_cfra();
-
-
- /* game engine will do its own sounds. */
- sound_stop_all_sounds();
- sound_exit_audio();
-
- /* Before jumping into Ketsji, we configure some settings. */
- space_set_commmandline_options();
-
- SaveState();
- StartKetsjiShell(curarea, startscene->id.name+2, G.main,G.sipo, 1);
- RestoreState();
-
- /* Restart BPY - unload the game engine modules. */
-
- /* Commented out: testing before Blender 2.46 if it's ok to keep
- * these modules around, they give access to relevant info for
- * exporters to other engines...
- BPY_end_python();
- BPY_start_python(0, NULL);
- BPY_post_start_python();
- */
-
- restore_all_scene_cfra(scene_cfra_store);
- set_scene_bg(startscene);
- scene_update_for_newframe(G.scene, G.scene->lay);
-
- if (G.flags & G_FILE_AUTOPLAY)
- exit_usiblender();
-
- /* groups could have changed ipo */
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-#endif
-#else
- notice("Game engine is disabled in this release!");
-#endif
-}
-
-void start_RBSimulation(void)
-{
-#if GAMEBLENDER == 1
-#ifndef NO_KETSJI
- Scene *sc, *startscene = G.scene;
- LinkNode *scene_cfra_store;
-
- /* XXX, silly code - the game engine can
- * access any scene through logic, so we try
- * to make sure each scene has a valid camera,
- * just in case the game engine tries to use it.
- *
- * Better would be to make a better routine
- * in the game engine for finding the camera.
- * - zr
- * Note: yes, this is all very badly hacked! (ton)
- */
- for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- if (!sc->camera) {
- Base *base;
-
- for (base= sc->base.first; base; base= base->next)
- if (base->object->type==OB_CAMERA)
- break;
-
- sc->camera= base?base->object:NULL;
- }
- }
-
- /* these two lines make sure front and backbuffer are equal. for swapbuffers */
- markdirty_all();
- screen_swapbuffers();
-
- /* can start from header */
- mywinset(curarea->win);
-
- scene_cfra_store= save_and_reset_all_scene_cfra();
-
-
- /* game engine will do its own sounds. */
- sound_stop_all_sounds();
- sound_exit_audio();
-
- /* Before jumping into Ketsji, we configure some settings. */
- space_set_commmandline_options();
-
- SaveState();
- StartKetsjiShellSimulation(curarea, startscene->id.name+2, G.main,G.sipo, 1);
- RestoreState();
-
- /* Restart BPY - unload the game engine modules. */
-
- /* Commented out: testing before Blender 2.46 if it's ok to keep
- * these modules around, they give access to relevant info for
- * exporters to other engines...
- BPY_end_python();
- BPY_start_python(0, NULL);
- BPY_post_start_python();
- */
-
- restore_all_scene_cfra(scene_cfra_store);
- set_scene_bg(startscene);
- scene_update_for_newframe(G.scene, G.scene->lay);
-
- if (G.flags & G_FILE_AUTOPLAY)
- exit_usiblender();
-
- /* groups could have changed ipo */
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
-#endif
-#else
- notice("YOU NEED GAME ENGIEN TO RUN THE SIMULATION!");
-#endif
-}
-
-static void changeview3dspace(ScrArea *sa, void *spacedata)
-{
- setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
-}
-
- /* Callable from editmode and faceselect mode from the
- * moment, would be nice (and is easy) to generalize
- * to any mode.
- */
-static void align_view_to_selected(View3D *v3d)
-{
- int nr= pupmenu("Align View (Ctrl flips)%t|To Selected (top)%x3|To Selected (front)%x2|To Selected (side)%x1");
- if (nr!=-1) {
- int axis= nr;
-
- /* opposite axis in case ctrl is pressed */
- if(G.qual==LR_CTRLKEY) axis= -axis;
-
- if ((G.obedit) && (G.obedit->type == OB_MESH)) {
- editmesh_align_view_to_selected(v3d, axis);
- addqueue(v3d->area->win, REDRAW, 1);
- } else if (FACESEL_PAINT_TEST) {
- Object *obact= OBACT;
- if (obact && obact->type==OB_MESH) {
- Mesh *me= obact->data;
- faceselect_align_view_to_selected(v3d, me, axis);
- addqueue(v3d->area->win, REDRAW, 1);
- }
- }
- }
-}
-
-
-static short select_children(Object *ob, int recursive)
-{
- short changed = 0;
- Base *base;
-
- for (base= FIRSTBASE; base; base= base->next) {
- if (ob == base->object->parent) {
- if (BASE_SELECTABLE(base) && !(base->flag & SELECT)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
-
- if (recursive)
- changed |= select_children(base->object, 1);
- }
- }
- return changed;
-}
-
-static short select_parent(void) /* Makes parent active and de-selected OBACT */
-{
- short changed = 0;
- Base *base, *startbase, *basact=NULL, *oldbasact;
-
- if (!(OBACT->parent)) return 0; /* we know OBACT is valid */
- BASACT->flag &= (~SELECT);
- BASACT->object->flag &= (~SELECT);
- startbase= FIRSTBASE;
- if(BASACT && BASACT->next) startbase= BASACT->next;
- base = startbase;
- while(base) {
- if(base->object==BASACT->object->parent) { basact=base; break; }
- base=base->next;
- if(base==NULL) base= FIRSTBASE;
- if(base==startbase) break;
- }
- /* can be NULL if parent in other scene */
- if(basact && BASE_SELECTABLE(basact)) {
- oldbasact = BASACT;
- BASACT = basact;
- basact->flag |= SELECT;
-
- basact->object->flag= basact->flag;
-
- set_active_base(basact);
- changed = 1;
- }
- return changed;
-}
-
-
-#define GROUP_MENU_MAX 24
-static short select_same_group(Object *ob) /* Select objects in the same group as the active */
-{
- short changed = 0;
- Base *base;
- Group *group, *ob_groups[GROUP_MENU_MAX];
- char str[10 + (24*GROUP_MENU_MAX)];
- char *p = str;
- int group_count=0, menu, i;
-
- for ( group=G.main->group.first;
- group && group_count < GROUP_MENU_MAX;
- group=group->id.next
- ) {
- if (object_in_group (ob, group)) {
- ob_groups[group_count] = group;
- group_count++;
- }
- }
-
- if (!group_count)
- return 0;
-
- else if (group_count == 1) {
- group = ob_groups[0];
- for (base= FIRSTBASE; base; base= base->next) {
- if (BASE_SELECTABLE(base) && !(base->flag & SELECT) && object_in_group(base->object, group)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- }
- return changed;
- }
-
- /* build the menu. */
- p += sprintf(str, "Groups%%t");
- for (i=0; i<group_count; i++) {
- group = ob_groups[i];
- p += sprintf (p, "|%s%%x%i", group->id.name+2, i);
- }
-
- menu = pupmenu (str);
- if (menu == -1)
- return 0;
-
- group = ob_groups[menu];
- for (base= FIRSTBASE; base; base= base->next) {
- if (!(base->flag & SELECT) && object_in_group(base->object, group)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- }
- return changed;
-}
-
-static short select_object_hooks(Object *ob)
-{
- short changed = 0;
- Base *base;
- ModifierData *md;
- HookModifierData *hmd;
-
- for (md = ob->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- hmd= (HookModifierData*) md;
- if (hmd->object && !(hmd->object->flag & SELECT)) {
- base= object_in_scene(hmd->object, G.scene);
- if (base && BASE_SELECTABLE(base)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- }
- }
- }
- return changed;
-}
-
-/* Select objects woth the same parent as the active (siblings),
- * parent can be NULL also */
-static short select_same_parent(Object *ob)
-{
- short changed = 0;
- Base *base;
-
- for (base= FIRSTBASE; base; base= base->next) {
- if (BASE_SELECTABLE(base) && (base->object->parent==ob->parent) && !(base->flag & SELECT)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- }
- return changed;
-}
-
-static short select_same_type(Object *ob)
-{
- short changed = 0;
- Base *base;
-
- for (base= FIRSTBASE; base; base= base->next) {
- if (BASE_SELECTABLE(base) && (base->object->type == ob->type) && !(base->flag & SELECT)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- }
- return changed;
-}
-
-static short select_same_layer(Object *ob)
-{
- char changed = 0;
- Base *base = FIRSTBASE;
-
- while(base) {
- if (BASE_SELECTABLE(base) && (base->lay & ob->lay) && !(base->flag & SELECT)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- base= base->next;
- }
- return changed;
-}
-
-static short select_same_index_object(Object *ob)
-{
- char changed = 0;
- Base *base = FIRSTBASE;
-
- while(base) {
- if (BASE_SELECTABLE(base) && (base->object->index == ob->index) && !(base->flag & SELECT)) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- base= base->next;
- }
- return changed;
-}
-
-static short select_same_color(Object *ob)
-{
- char changed = 0;
- Base *base = FIRSTBASE;
-
- while(base) {
- if (BASE_SELECTABLE(base) && !(base->flag & SELECT) && (FloatCompare(base->object->col, ob->col, 0.005f))) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- base= base->next;
- }
- return changed;
-}
-
-static short objects_share_gameprop(Object *a, Object *b)
-{
- bProperty *prop;
- /*make a copy of all its properties*/
-
- for( prop= a->prop.first; prop; prop = prop->next ) {
- if ( get_ob_property(b, prop->name) )
- return 1;
- }
- return 0;
-}
-
-static short select_same_gameprops(Object *ob)
-{
- char changed = 0;
- Base *base = FIRSTBASE;
-
- while(base) {
- if (BASE_SELECTABLE(base) && !(base->flag & SELECT) && (objects_share_gameprop(base->object, ob))) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- changed = 1;
- }
- base= base->next;
- }
- return changed;
-}
-
-void select_object_grouped(short nr)
-{
- Object *ob = OBACT;
- short changed = 0;
-
- if (ob==NULL) return;
-
- if(nr==1) changed = select_children(ob, 1);
- else if(nr==2) changed = select_children(ob, 0);
- else if(nr==3) changed = select_parent();
- else if(nr==4) changed = select_same_parent(ob);
- else if(nr==5) changed = select_same_type(ob);
- else if(nr==6) changed = select_same_layer(ob);
- else if(nr==7) changed = select_same_group(ob);
- else if(nr==8) changed = select_object_hooks(ob);
- else if(nr==9) changed = select_same_index_object(ob);
- else if(nr==10) changed = select_same_color(ob);
- else if(nr==11) changed = select_same_gameprops(ob);
-
- if (changed) {
- countall();
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- allspace(REMAKEIPO, 0);
- allqueue(REDRAWIPO, 0);
- BIF_undo_push("Select Grouped");
- }
-}
-
-static void select_object_grouped_menu(void)
-{
- char *str;
- short nr;
-
- /* make menu string */
-
- str= MEM_mallocN(512, "groupmenu");
- strcpy(str, "Select Grouped%t|Children%x1|"
- "Immediate Children%x2|Parent%x3|"
- "Siblings (Shared Parent)%x4|"
- "Objects of Same Type%x5|"
- "Objects on Shared Layers%x6|"
- "Objects in Same Group%x7|"
- "Object Hooks%x8|"
- "Object PassIndex%x9|"
- "Object Color%x10|"
- "Game Properties%x11");
-
- /* here we go */
-
- nr= pupmenu(str);
- MEM_freeN(str);
-
- select_object_grouped(nr);
-}
-
-void join_menu(void)
-{
- Object *ob= OBACT;
- if (G.obedit) {
- error("This data does not support joining in editmode");
- return;
- }
- if (!ob) {
- error("Can't join unless there is an active object");
- return;
- }
-
- if(ob->type == OB_MESH) {
- if(okee("Join selected meshes")==0) return;
- join_mesh();
- } else if(ob->type == OB_CURVE) {
- if(okee("Join selected curves")==0) return;
- join_curve(OB_CURVE);
- } else if(ob->type == OB_SURF) {
- if(okee("Join selected NURBS")==0) return;
- join_curve(OB_SURF);
- } else if(ob->type == OB_ARMATURE) {
- /* Make sure the user wants to continue*/
- if(okee("Join selected armatures")==0) return;
- join_armature ();
- } else {
- error("This object type doesn't support joining");
- }
-}
-
-static unsigned short convert_for_nonumpad(unsigned short event)
-{
- if (event>=ZEROKEY && event<=NINEKEY) {
- return event - ZEROKEY + PAD0;
- } else if (event==MINUSKEY) {
- return PADMINUS;
- } else if (event==EQUALKEY) {
- return PADPLUSKEY;
- } else if (event==BACKSLASHKEY) {
- return PADSLASHKEY;
- } else {
- return event;
- }
-}
-
-/* *************** */
-
-void BIF_undo_push(char *str)
-{
- if(G.obedit) {
- if (U.undosteps == 0) return;
-
- if(G.obedit->type==OB_MESH)
- undo_push_mesh(str);
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
- undo_push_curve(str);
- else if (G.obedit->type==OB_FONT)
- undo_push_font(str);
- else if (G.obedit->type==OB_MBALL)
- undo_push_mball(str);
- else if (G.obedit->type==OB_LATTICE)
- undo_push_lattice(str);
- else if (G.obedit->type==OB_ARMATURE)
- undo_push_armature(str);
- }
- else if(G.f & G_PARTICLEEDIT) {
- if (U.undosteps == 0) return;
-
- PE_undo_push(str);
- }
- else {
- if(U.uiflag & USER_GLOBALUNDO)
- BKE_write_undo(str);
- }
-}
-
-void BIF_undo(void)
-{
- if(G.obedit) {
- if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
- undo_editmode_step(1);
- }
- else {
- if(G.f & G_TEXTUREPAINT)
- undo_imagepaint_step(1);
- else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL))
- undo_imagepaint_step(1);
- else if(G.f & G_PARTICLEEDIT)
- PE_undo();
- else {
- /* now also in faceselect mode */
- if(U.uiflag & USER_GLOBALUNDO) {
-#ifndef DISABLE_PYTHON
- BPY_scripts_clear_pyobjects();
-#endif
- BKE_undo_step(1);
- sound_initialize_sounds();
- }
- }
- }
-}
-
-void BIF_redo(void)
-{
- if(G.obedit) {
- if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
- undo_editmode_step(-1);
- }
- else {
- if(G.f & G_TEXTUREPAINT)
- undo_imagepaint_step(-1);
- else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL))
- undo_imagepaint_step(-1);
- else if(G.f & G_PARTICLEEDIT)
- PE_redo();
- else {
- /* includes faceselect now */
- if(U.uiflag & USER_GLOBALUNDO) {
- BKE_undo_step(-1);
- sound_initialize_sounds();
- }
- }
- }
-}
-
-void BIF_undo_menu(void)
-{
- if(G.obedit) {
- if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
- undo_editmode_menu();
- allqueue(REDRAWALL, 0);
- }
- else {
- if(G.f & G_PARTICLEEDIT)
- PE_undo_menu();
- else if(U.uiflag & USER_GLOBALUNDO) {
- char *menu= BKE_undo_menu_string();
- if(menu) {
- short event= pupmenu_col(menu, 20);
- MEM_freeN(menu);
- if(event>0) {
- BKE_undo_number(event);
- sound_initialize_sounds();
- }
- }
- }
- }
-}
-
-/* *************** */
-
-void handle_view_middlemouse() {
- /* use '&' here, because of alt+leftmouse which emulates middlemouse */
- if(U.flag & USER_VIEWMOVE) {
- if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
- viewmove(0);
- else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
- viewmove(2);
- else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
- viewmove(1);
- }
- else {
- if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
- viewmove(1);
- else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
- viewmove(2);
- else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
- viewmove(0);
- }
-}
-
-void handle_view_wheelup()
-{
- /* Regular: Zoom in */
- /* Shift: Scroll up */
- /* Ctrl: Scroll right */
- /* Alt-Shift: Rotate up */
- /* Alt-Ctrl: Rotate right */
-
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD2);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD2);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD4);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD4);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADMINUS);
- else
- persptoetsen(PADPLUSKEY);
-}
-
-void handle_view_wheeldown()
-{
- /* Regular: Zoom out */
- /* Shift: Scroll down */
- /* Ctrl: Scroll left */
- /* Alt-Shift: Rotate down */
- /* Alt-Ctrl: Rotate left */
-
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD8);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD8);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD6);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD6);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADPLUSKEY);
- else
- persptoetsen(PADMINUS);
-}
-
-int mouse_in_header(ScrArea *sa)
-{
- short mouse[2];
- getmouseco_sc(mouse);
- return mouse[0] >= sa->headrct.xmin &&
- mouse[0] <= sa->headrct.xmax &&
- mouse[1] >= sa->headrct.ymin &&
- mouse[1] <= sa->headrct.ymax;
-}
-
-static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- View3D *v3d= sa->spacedata.first;
- Object *ob= OBACT; /* do not change! */
- float *curs;
- int doredraw= 0, pupval;
- unsigned short event= evt->event;
- short val= evt->val;
- char ascii= evt->ascii;
-
- if(curarea->win==0) return; /* when it comes from sa->headqread() */
-
- if(val) {
-
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- if(event==UI_BUT_EVENT) do_butspace(val); /* temporal, view3d deserves own queue? */
-
- /* - we consider manipulator a button, defaulting to leftmouse
- * - grease-pencil also defaults to leftmouse
- */
- if(event==LEFTMOUSE) {
-#ifndef DISABLE_PYTHON
- /* run any view3d event handler script links */
- if (sa->scriptlink.totscript) {
- if (BPY_do_spacehandlers(sa, event, val, SPACEHANDLER_VIEW3D_EVENT))
- return; /* return if event was processed (swallowed) by handler(s) */
- }
-#endif
- if(gpencil_do_paint(sa, L_MOUSE)) return;
- if(BIF_do_manipulator(sa)) return;
- }
- else if(event==RIGHTMOUSE) {
- if(gpencil_do_paint(sa, R_MOUSE)) return;
- }
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- /* only swap mouse button for selection, in modes where it is relevant.
- * painting/sculpting stays on LEFTMOUSE */
- if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) || (G.f & G_GREASEPENCIL) ||
- (G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_PARTICLEEDIT)) ||
- (G.obedit) )
- {
- if (event==LEFTMOUSE) event = RIGHTMOUSE;
- else if (event==RIGHTMOUSE) event = LEFTMOUSE;
- }
- }
-
- if(!mouse_in_header(sa)) {
- if(!G.obedit && (G.f & G_SCULPTMODE)) {
- SculptSession *ss= sculpt_session();
- if(ss && ss->radialcontrol) {
- radialcontrol_do_events(ss->radialcontrol, event);
- return;
- }
- else if(event!=LEFTMOUSE && event!=MIDDLEMOUSE && (event==MOUSEY || event==MOUSEX)) {
- if(!bwin_qtest(sa->win))
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else if(!G.obedit && OBACT && G.f&G_PARTICLEEDIT){
- ParticleSystem *psys=PE_get_current(OBACT);
- ParticleEditSettings *pset=PE_settings();
- if(*PE_radialcontrol()) {
- radialcontrol_do_events(*PE_radialcontrol(), event);
- return;
- }
- if(psys && psys->edit){
- if(pset->brushtype>=0 &&
- event!=LEFTMOUSE && event!=RIGHTMOUSE && event!=MIDDLEMOUSE &&
- (event==MOUSEY || event==MOUSEX) && bwin_qtest(sa->win)==0) {
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- }
-
- /* Handle retopo painting */
- if(retopo_mesh_paint_check()) {
- if(!retopo_paint(event))
- return;
- }
- }
-
-#ifndef DISABLE_PYTHON
- /* run any view3d event handler script links */
- if (event && sa->scriptlink.totscript)
- if (BPY_do_spacehandlers(sa, event, val, SPACEHANDLER_VIEW3D_EVENT))
- return; /* return if event was processed (swallowed) by handler(s) */
-#endif
-
- /* TEXTEDITING?? */
- if((G.obedit) && G.obedit->type==OB_FONT) {
- switch(event) {
-
- case LEFTMOUSE:
- mouse_cursor();
- break;
- case MIDDLEMOUSE:
- /* use '&' here, because of alt+leftmouse which emulates middlemouse */
- if(U.flag & USER_VIEWMOVE) {
- if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
- viewmove(0);
- else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
- viewmove(2);
- else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
- viewmove(1);
- }
- else {
- if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
- viewmove(1);
- else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
- viewmove(2);
- else
- viewmove(0);
- }
- break;
-
- case WHEELUPMOUSE:
- /* Regular: Zoom in */
- /* Shift: Scroll up */
- /* Ctrl: Scroll right */
- /* Alt-Shift: Rotate up */
- /* Alt-Ctrl: Rotate right */
-
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD2);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD2);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD4);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD4);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADMINUS);
- else
- persptoetsen(PADPLUSKEY);
-
- doredraw= 1;
- break;
-
- case WHEELDOWNMOUSE:
- /* Regular: Zoom out */
- /* Shift: Scroll down */
- /* Ctrl: Scroll left */
- /* Alt-Shift: Rotate down */
- /* Alt-Ctrl: Rotate left */
-
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD8);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD8);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD6);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD6);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADPLUSKEY);
- else
- persptoetsen(PADMINUS);
-
- doredraw= 1;
- break;
-
- case UKEY:
- if(G.qual==LR_ALTKEY) {
- remake_editText();
- doredraw= 1;
- }
- else {
- do_textedit(event, val, ascii);
- }
- break;
- case VKEY:
- if(G.qual==LR_ALTKEY) {
- paste_editText();
- doredraw= 1;
- }
- else {
- do_textedit(event, val, ascii);
- }
- break;
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADENTER:
- persptoetsen(event);
- doredraw= 1;
- break;
-
- default:
- do_textedit(event, val, ascii);
- break;
- }
- }
- else if(!G.obedit && (G.f & G_SCULPTMODE)) {
- SculptData *sd= sculpt_data();
- SculptSession *ss= sculpt_session();
- BrushData *br= sculptmode_brush();
- Mesh *me= get_mesh(OBACT);
- char update_prop= 0;
-
- if(U.flag & USER_NONUMPAD) {
- event= convert_for_nonumpad(event);
- }
-
- switch(event) {
- case LEFTMOUSE:
- if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
- sculptmode_pmv(0);
- else if(!(ss && ss->radialcontrol))
- sculpt();
- break;
- /* View */
- case MIDDLEMOUSE:
- handle_view_middlemouse();
- break;
- case WHEELUPMOUSE:
- handle_view_wheelup();
- doredraw= 1;
- break;
- case WHEELDOWNMOUSE:
- handle_view_wheeldown();
- doredraw= 1;
- break;
- case RIGHTMOUSE:
- if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
- sculptmode_pmv(1);
- break;
- case CKEY:
- if(G.qual==LR_SHIFTKEY) {
- view3d_home(1);
- curs= give_cursor();
- curs[0]=curs[1]=curs[2]= 0.0;
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(G.qual==0) {
- if (G.vd->persp==V3D_CAMOB)
- /* center the camera offset */
- G.vd->camdx= G.vd->camdy= 0.0;
- else {
- /*non camera center*/
- float new_ofs[3];
- curs= give_cursor();
- new_ofs[0]= -curs[0];
- new_ofs[1]= -curs[1];
- new_ofs[2]= -curs[2];
- smooth_view(G.vd, new_ofs, NULL, NULL, NULL);
- }
- }
- doredraw= 1;
- break;
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADPLUSKEY:
- case PADMINUS:
- case PADENTER:
- persptoetsen(event);
- doredraw= 1;
- break;
- case BKEY:
- if(G.qual==LR_ALTKEY)
- view3d_edit_clipping(v3d);
- else if(G.qual==LR_SHIFTKEY) {
- if(G.vd->persp==V3D_CAMOB)
- set_render_border();
- else
- view3d_border_zoom();
- }
- break;
- case PADSLASHKEY:
- if(!G.qual) {
- if(G.vd->localview) {
- G.vd->localview= 0;
- endlocalview(curarea);
- }
- else {
- G.vd->localview= 1;
- initlocalview();
- }
- allqueue(REDRAWVIEW3D, 1);
- }
- break;
- /* Brush properties */
- case AKEY:
- if(G.qual==LR_SHIFTKEY)
- br->flag ^= SCULPT_BRUSH_ANCHORED;
- else
- br->flag ^= SCULPT_BRUSH_AIRBRUSH;
- update_prop= 1; break;
- case FKEY:
- if(ss) {
- sculpt_radialcontrol_start(G.qual == 0 ? RADIALCONTROL_SIZE :
- G.qual == LR_SHIFTKEY ? RADIALCONTROL_STRENGTH :
- G.qual == LR_CTRLKEY ? RADIALCONTROL_ROTATION :
- RADIALCONTROL_NONE);
- }
- break;
- case VKEY:
- br->dir= br->dir==1 ? 2 : 1;
- update_prop= 1; break;
- /* Set brush */
- case DKEY:
- sd->brush_type= DRAW_BRUSH;
- update_prop= 1; break;
- case SKEY:
- if(G.qual==LR_SHIFTKEY)
- sd->flags ^= SCULPT_INPUT_SMOOTH;
- else {
- sd->brush_type= SMOOTH_BRUSH;
- update_prop= 1;
- }
- break;
- case PKEY:
- sd->brush_type= PINCH_BRUSH;
- update_prop= 1; break;
- case IKEY:
- sd->brush_type= INFLATE_BRUSH;
- update_prop= 1; break;
- case GKEY:
- sd->brush_type= GRAB_BRUSH;
- update_prop= 1; break;
- case LKEY:
- sd->brush_type= LAYER_BRUSH;
- update_prop= 1; break;
- case TKEY:
- sd->brush_type= FLATTEN_BRUSH;
- update_prop= 1; break;
- /* Symmetry */
- case XKEY:
- sd->symm^= SYMM_X;
- update_prop= 1; break;
- case YKEY:
- sd->symm^= SYMM_Y;
- update_prop= 1; break;
- case ZKEY:
- sd->symm^= SYMM_Z;
- update_prop= 1; break;
- /* Interface */
- case NKEY:
- if(G.qual==0) {
- toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- /* Multires */
- case PAGEUPKEY:
- if(me && me->mr) {
- me->mr->newlvl= ((Mesh*)ob->data)->mr->current+1;
- multires_set_level_cb(ob, ob->data);
- }
- break;
- case PAGEDOWNKEY:
- if(me && me->mr) {
- me->mr->newlvl= ((Mesh*)ob->data)->mr->current-1;
- multires_set_level_cb(ob, ob->data);
- }
- break;
- /* Partial Visibility */
- case HKEY:
- if(G.qual==LR_ALTKEY) {
- waitcursor(1);
- mesh_pmv_off(ob, get_mesh(ob));
- BIF_undo_push("Partial mesh hide");
- allqueue(REDRAWVIEW3D,0);
- waitcursor(0);
- }
- break;
- /* Layers */
- case ONEKEY:
- do_layer_buttons(0); break;
- case TWOKEY:
- do_layer_buttons(1); break;
- case THREEKEY:
- do_layer_buttons(2); break;
- case FOURKEY:
- do_layer_buttons(3); break;
- case FIVEKEY:
- do_layer_buttons(4); break;
- case SIXKEY:
- do_layer_buttons(5); break;
- case SEVENKEY:
- do_layer_buttons(6); break;
- case EIGHTKEY:
- do_layer_buttons(7); break;
- case NINEKEY:
- do_layer_buttons(8); break;
- case ZEROKEY:
- do_layer_buttons(9); break;
- case MINUSKEY:
- do_layer_buttons(10); break;
- case EQUALKEY:
- do_layer_buttons(11); break;
- case ACCENTGRAVEKEY:
- do_layer_buttons(-1); break;
-
- case NDOFMOTION:
- if (G.vd->ndofmode == 0) {
- viewmoveNDOF(1);
- } else if (G.vd->ndofmode == 1) {
- viewmoveNDOFfly(1);
- } else {
- NDofTransform();
- }
- break;
-
- case NDOFBUTTON:
- if (val == 1) {
- G.vd->ndofmode +=1;
- if (G.vd->ndofmode > 2) /* we have currently 3 modes : 0 original, 1 fly, 2 transform */
- G.vd->ndofmode = 0;
- }
- if (val == 2) {
- G.vd->ndoffilter =(G.vd->ndoffilter == 1 ? 0 : 1);
- }
- allqueue(REDRAWHEADERS, 0);
- break;
-
- }
-
- /* Redraw buttons window as well as view 3d (for floating panel) */
- if(update_prop) {
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- } else {
-
- if (U.flag & USER_NONUMPAD) {
- event= convert_for_nonumpad(event);
- }
-
- switch(event) {
-
- /* Afterqueue events */
- case BACKBUFDRAW:
- backdrawview3d(1);
- break;
- case RENDERPREVIEW:
- BIF_view3d_previewrender(sa);
- break;
-
- case TABKEY:
- /* Shift-Tabe handling (other cases are in toets) */
- if (G.qual == LR_SHIFTKEY)
- {
- /* Snap toggle only when supported */
- if (BIF_snappingSupported())
- {
- G.scene->snap_flag ^= SCE_SNAP;
- allqueue(REDRAWHEADERS, 0);
- }
- }
- break;
-
- /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
- * based on user preference USER_LMOUSESELECT
- */
- case LEFTMOUSE:
- if ((G.obedit) || !(G.f&(G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT|G_PARTICLEEDIT))) {
- mouse_cursor();
- }
- else if (G.f & G_WEIGHTPAINT) {
- weight_paint();
- }
- else if (G.f & G_VERTEXPAINT) {
- vertex_paint();
- }
- else if (G.f & G_TEXTUREPAINT) {
- imagepaint_paint(L_MOUSE, 1);
- }
- else if (G.f & G_PARTICLEEDIT) {
- if(G.qual & LR_CTRLKEY)
- mouse_cursor();
- else if(!PE_brush_particles())
- mouse_cursor();
- }
- break;
- case MIDDLEMOUSE:
- handle_view_middlemouse();
- break;
- case RIGHTMOUSE:
- if((G.obedit) && (G.qual & LR_CTRLKEY)==0) {
- if(G.obedit->type==OB_MESH)
- mouse_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
- mouse_nurb();
- else if(G.obedit->type==OB_MBALL)
- mouse_mball();
- else if(G.obedit->type==OB_LATTICE)
- mouse_lattice();
- else if(G.obedit->type==OB_ARMATURE)
- mouse_armature();
- }
- else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY)))
- mouse_mesh(); /* loop select for 1 mousebutton dudes */
- else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY)))
- mouse_mesh(); /* loop select for 1 mousebutton dudes */
- else if(G.qual==LR_CTRLKEY)
- mouse_select(); /* also allow in editmode, for vertex parenting */
- else if(FACESEL_PAINT_TEST)
- face_select();
- else if( G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))
- sample_vpaint();
- else if( G.f & G_PARTICLEEDIT)
- PE_mouse_particles();
- else
- mouse_select(); /* does poses too */
- break;
- case WHEELUPMOUSE:
- handle_view_wheelup();
- doredraw= 1;
- break;
- case WHEELDOWNMOUSE:
- handle_view_wheeldown();
- doredraw= 1;
- break;
-
- case NDOFMOTION:
- if (G.vd->ndofmode == 0) {
- viewmoveNDOF(1);
- } else if (G.vd->ndofmode == 1) {
- viewmoveNDOFfly(1);
- } else {
- NDofTransform();
- }
- break;
-
- case NDOFBUTTON:
- if (val == 1) {
- G.vd->ndofmode +=1;
- if (G.vd->ndofmode > 2) /* we have currently 3 modes : 0 original, 1 fly, 2 transform */
- G.vd->ndofmode = 0;
- }
- if (val == 2) {
- G.vd->ndoffilter =(G.vd->ndoffilter == 1 ? 0 : 1);
- }
- allqueue(REDRAWHEADERS, 0);
- break;
-
- case ONEKEY:
- if(G.qual==LR_CTRLKEY) {
- flip_subdivison(1);
- }
- else do_layer_buttons(0);
- break;
-
- case TWOKEY:
- if(G.qual==LR_CTRLKEY) {
- flip_subdivison(2);
- }
- else do_layer_buttons(1);
- break;
-
- case THREEKEY:
- if(G.qual==LR_CTRLKEY) {
- flip_subdivison(3);
- }
- else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- if ( (G.obedit) && (G.obedit->type==OB_MESH) )
- select_faces_by_numverts(3);
- }
- else do_layer_buttons(2);
- break;
-
- case FOURKEY:
- if(G.qual==LR_CTRLKEY) {
- flip_subdivison(4);
- }
- else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- if ( (G.obedit) && (G.obedit->type==OB_MESH) )
- select_faces_by_numverts(4);
- }
- else do_layer_buttons(3);
- break;
-
- case FIVEKEY:
- if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- if ( (G.obedit) && (G.obedit->type==OB_MESH) )
- select_faces_by_numverts(5);
- }
-
- else if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(4);
- break;
-
- case SIXKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(5);
- break;
- case SEVENKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(6);
- break;
- case EIGHTKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(7);
- break;
- case NINEKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(8);
- break;
- case ZEROKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(9);
- break;
- case MINUSKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(10);
- break;
- case EQUALKEY:
- if(G.qual==LR_CTRLKEY) {}
- else do_layer_buttons(11);
- break;
- case ACCENTGRAVEKEY:
- do_layer_buttons(-1);
- break;
-
- case SPACEKEY:
- if(G.qual == LR_CTRLKEY) {
- val= pupmenu("Manipulator%t|Enable/Disable|Translate|Rotate|Scale|Combo");
- if(val>0) {
- if(val==1) v3d->twflag ^= V3D_USE_MANIPULATOR;
- else {
- if(val==2) v3d->twtype= V3D_MANIP_TRANSLATE;
- else if(val==3) v3d->twtype= V3D_MANIP_ROTATE;
- else if(val==4) v3d->twtype= V3D_MANIP_SCALE;
- else if(val==5) v3d->twtype= V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE|V3D_MANIP_SCALE;
- v3d->twflag |= V3D_USE_MANIPULATOR;
- }
- doredraw= 1;
- }
- }
- else if(G.qual == LR_ALTKEY) {
- BIF_selectOrientation();
- doredraw= 1;
- }
-
- break;
-
- case AKEY:
- if(G.qual == (LR_CTRLKEY|LR_ALTKEY)) {
- if(G.obedit == 0)
- alignmenu();
- else if(G.obedit->type==OB_ARMATURE)
- align_selected_bones();
- }
- else if(G.qual & LR_CTRLKEY) { /* also with shift! */
- apply_object();
- }
- else if((G.qual==LR_SHIFTKEY)) {
- toolbox_n_add();
- }
- else {
- if(G.obedit) {
- if(G.obedit->type==OB_MESH)
- deselectall_mesh();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
- deselectall_nurb();
- else if(G.obedit->type==OB_MBALL)
- deselectall_mball();
- else if(G.obedit->type==OB_LATTICE)
- deselectall_Latt();
- else if(G.obedit->type==OB_ARMATURE)
- deselectall_armature(1, 1); /* 1 == toggle */
- }
- else if (ob && (ob->flag & OB_POSEMODE)){
- deselectall_posearmature(ob, 1, 1);
- }
- else {
- if(FACESEL_PAINT_TEST) deselectall_tface();
- else if(G.f & G_PARTICLEEDIT) PE_deselectall();
- else {
- /* by design, the center of the active object
- * (which need not necessarily by selected) will
- * still be drawn as if it were selected.
- */
- deselectall();
- }
- }
- }
- break;
- case BKEY:
- if(G.qual==LR_ALTKEY)
- view3d_edit_clipping(v3d);
- else if(G.qual==LR_SHIFTKEY)
- {
- if(G.vd->persp==V3D_CAMOB)
- set_render_border();
- else
- view3d_border_zoom();
- }
- else if(G.qual==LR_CTRLKEY) {
- extern void pointcache_bake(PTCacheID *pid, int startframe);
- extern void pointcache_free(PTCacheID *pid, int cacheonly);
- extern void fluidsimBake(Object *ob);
- extern void fluidsimFreeBake(Object *ob);
- int pupval;
-
- pupval= pupmenu("Physics Baking%t|Bake selected %x1|Free bake selected %x2|Free cache selected %x3");
-
- if(pupval > 0) {
- if(pupval == 1) {
- pointcache_bake(NULL, 0);
- /* also bake first domain of selected objects... */
- fluidsimBake(NULL);
- }
- else if(pupval == 2) {
- pointcache_free(NULL, 0);
- fluidsimFreeBake(NULL);
- }
- else if(pupval == 3)
- pointcache_free(NULL, 1);
- }
- }
- else if(G.qual== (LR_ALTKEY|LR_CTRLKEY))
- objects_bake_render_menu();
- else if(G.qual==0)
- borderselect();
- break;
- case CKEY:
- if(G.qual==LR_CTRLKEY) {
- if(ob && (ob->flag & OB_POSEMODE))
- pose_copy_menu(); /* poseobject.c */
- else
- copy_attr_menu();
- }
- else if(G.qual==(LR_ALTKEY|LR_SHIFTKEY))
- gpencil_convert_menu(); /* gpencil.c */
- else if(G.qual==LR_ALTKEY) {
- if(ob && (ob->flag & OB_POSEMODE))
- pose_clear_constraints(); /* poseobject.c */
- else
- convertmenu(); /* editobject.c */
- }
- else if(G.qual==(LR_ALTKEY|LR_CTRLKEY))
- add_constraint(0); /* editconstraint.c, generic for objects and posemode */
- else if(G.qual==(LR_CTRLKEY|LR_SHIFTKEY)) {
- BIF_manageTransformOrientation(0, 1);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if((G.qual==LR_SHIFTKEY)) {
- view3d_home(1);
- curs= give_cursor();
- curs[0]=curs[1]=curs[2]= 0.0;
- allqueue(REDRAWVIEW3D, 0);
- }
- else if((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF) ) {
- makecyclicNurb();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if((G.qual==0)){
- if (G.vd->persp==V3D_CAMOB)
- /* center the camera offset */
- G.vd->camdx= G.vd->camdy= 0.0;
- else {
- /*non camera center*/
- float new_ofs[3];
- curs= give_cursor();
- new_ofs[0]= -curs[0];
- new_ofs[1]= -curs[1];
- new_ofs[2]= -curs[2];
- smooth_view(G.vd, new_ofs, NULL, NULL, NULL);
- }
- scrarea_queue_winredraw(curarea);
- }
- break;
- case DKEY:
- if((G.qual==LR_SHIFTKEY)) {
- duplicate_context_selected();
- }
- else if(G.qual==LR_ALTKEY) {
- if(ob && (ob->flag & OB_POSEMODE))
- error ("Duplicate not possible in posemode.");
- else if((G.obedit==NULL))
- adduplicate(0, 0);
- }
- else if(G.qual==LR_CTRLKEY) {
- imagestodisplist(); // removed
- }
- else if((G.qual==0)){
- pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4|Textured Solid %x5");
- if(pupval>0) {
- G.vd->drawtype= pupval;
- doredraw= 1;
- }
- }
-
- break;
- case EKEY:
- if (G.qual==0){
- if(G.obedit) {
- if(G.obedit->type==OB_MESH)
- extrude_mesh();
- else if(G.obedit->type==OB_CURVE)
- addvert_Nurb('e');
- else if(G.obedit->type==OB_SURF)
- extrude_nurb();
- else if(G.obedit->type==OB_ARMATURE)
- extrude_armature(0);
- }
- }
- else if (G.qual==LR_CTRLKEY) {
- if(G.obedit && G.obedit->type==OB_MESH)
- Edge_Menu();
- else if (FACESEL_PAINT_TEST)
- seam_mark_clear_tface(0);
- }
- else if (G.qual==LR_SHIFTKEY) {
- if (G.obedit && G.obedit->type==OB_MESH &&
- !multires_level1_test()) {
- initTransform(TFM_CREASE, CTX_EDGE);
- Transform();
- }
- else if (G.obedit && G.obedit->type==OB_ARMATURE) {
- extrude_armature(1);
- }
- }
- else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- if (G.obedit && G.obedit->type==OB_MESH &&
- !multires_level1_test()) {
- if (G.scene->selectmode & SCE_SELECT_VERTEX) {
- initTransform(TFM_BWEIGHT, CTX_NONE);
- }
- else {
- initTransform(TFM_BWEIGHT, CTX_EDGE);
- }
- Transform();
- }
- }
- break;
- case FKEY:
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- if(G.qual == LR_CTRLKEY)
- Face_Menu();
- else if((G.qual==LR_SHIFTKEY))
- fill_mesh();
- else if(G.qual==LR_ALTKEY)
- beauty_fill();
- else if(G.qual==(LR_CTRLKEY|LR_SHIFTKEY))
- edge_flip();
- else if (G.qual==0)
- addedgeface_mesh();
- else if ( G.qual ==
- (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- select_linked_flat_faces();
- }
-
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- addsegment_nurb();
- }
- else if(G.obedit->type == OB_ARMATURE) {
- fill_bones_armature();
- }
- }
- else if(G.qual==LR_CTRLKEY)
- sort_faces();
- else if((G.qual==LR_SHIFTKEY)) {
- if(ob && (ob->flag & OB_POSEMODE))
- pose_activate_flipped_bone();
- else if(G.f & G_WEIGHTPAINT)
- pose_activate_flipped_bone();
- else if(G.f & G_PARTICLEEDIT)
- PE_radialcontrol_start(RADIALCONTROL_STRENGTH);
- else
- fly();
- }
- else if((G.qual==LR_ALTKEY)) {
- if(ob && (ob->flag & OB_POSEMODE))
- if(okee("Flip quaternion rotations"))
- pose_flipquats();
- }
- else {
- if (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)){
- G.f ^= G_FACESELECT;
- allqueue(REDRAWVIEW3D, 1);
- allqueue(REDRAWBUTSEDIT, 1);
- }
- else if(G.f & G_PARTICLEEDIT) {
- PE_radialcontrol_start(RADIALCONTROL_SIZE);
- } else {
- pupmenu("Note%t|UV/Face Select was removed. Editmode now allows UV editing, Add a UV layer or Unwrap (UKey)");
- }
- }
-
- break;
- case GKEY:
- if((G.qual == LR_CTRLKEY)) {
- if(G.obedit) {
- if(ELEM(G.obedit->type, OB_MESH, OB_LATTICE))
- vgroup_assign_with_menu();
- }
- else if(ob && (ob->flag & OB_POSEMODE))
- pgroup_operation_with_menu();
- else
- group_operation_with_menu();
- }
- else if((G.qual == (LR_CTRLKEY|LR_SHIFTKEY))) {
- if(G.obedit) {
- if(ELEM(G.obedit->type, OB_MESH, OB_LATTICE))
- vgroup_operation_with_menu();
- }
- }
- else if((G.qual==LR_SHIFTKEY)) {
- if(G.obedit) {
- if(G.obedit->type==OB_MESH)
- select_mesh_group_menu();
- }
- else if(ob && (ob->flag & OB_POSEMODE))
- pose_select_grouped_menu();
- else if (ob)
- select_object_grouped_menu();
- }
- else if((G.obedit==0) && G.qual==LR_ALTKEY) {
- if(okee("Clear location")) {
- clear_object('g');
- }
- }
- else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
- v3d->twtype= V3D_MANIP_TRANSLATE;
- doredraw= 1;
- }
- else if((G.qual==0)) {
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- }
- break;
- case HKEY:
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- if(G.qual==LR_CTRLKEY)
- add_hook_menu();
- else if(G.qual==LR_ALTKEY)
- reveal_mesh();
- else if((G.qual==LR_SHIFTKEY))
- hide_mesh(1);
- else if((G.qual==0))
- hide_mesh(0);
- }
- else if(G.obedit->type== OB_SURF) {
- if(G.qual==LR_CTRLKEY)
- add_hook_menu();
- else if(G.qual==LR_ALTKEY)
- revealNurb();
- else if((G.qual==LR_SHIFTKEY))
- hideNurb(1);
- else if((G.qual==0))
- hideNurb(0);
- }
- else if(G.obedit->type==OB_CURVE) {
- if(G.qual==LR_CTRLKEY)
- add_hook_menu();
- else if(G.qual==LR_ALTKEY)
- revealNurb();
- /* should be G.qual==LR_SHIFTKEY, but that is taken fro handles already */
- else if((G.qual==(LR_ALTKEY|LR_SHIFTKEY)))
- hideNurb(1);
- /* should be G.qual==0, but that is taken for handles already */
- else if((G.qual==(LR_ALTKEY|LR_CTRLKEY)))
- hideNurb(0);
- else {
- if(G.qual==LR_CTRLKEY) /* conflict */
- autocalchandlesNurb_all(1); /* flag=1, selected */
- else if((G.qual==LR_SHIFTKEY))
- sethandlesNurb(1);
- else if((G.qual==0))
- sethandlesNurb(3);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- BIF_undo_push("Handle change");
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else if(G.obedit->type==OB_LATTICE) {
- if(G.qual==LR_CTRLKEY) add_hook_menu();
- }
- else if(G.obedit->type==OB_MBALL) {
- if(G.qual==LR_ALTKEY)
- reveal_mball();
- else if((G.qual==LR_SHIFTKEY))
- hide_mball(1);
- else if((G.qual==0))
- hide_mball(0);
- }
- else if(G.obedit->type==OB_ARMATURE) {
- if (G.qual==0)
- hide_selected_armature_bones();
- else if (G.qual==LR_SHIFTKEY)
- hide_unselected_armature_bones();
- else if (G.qual==LR_ALTKEY)
- show_all_armature_bones();
- }
- }
- else if(FACESEL_PAINT_TEST)
- hide_tface();
- else if(G.f & G_PARTICLEEDIT) {
- if(G.qual == LR_ALTKEY)
- PE_hide(0);
- else if(G.qual == LR_SHIFTKEY)
- PE_hide(1);
- else if(G.qual == 0)
- PE_hide(2);
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- if (G.qual==0)
- hide_selected_pose_bones();
- else if (G.qual==LR_SHIFTKEY)
- hide_unselected_pose_bones();
- else if (G.qual==LR_ALTKEY)
- show_all_pose_bones();
- }
- /* Object mode only, other modes are accounted for above */
- else if ((G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) {
- if(G.qual==LR_CTRLKEY)hookmenu();
- else if(G.qual==LR_ALTKEY) show_objects();
- else if(G.qual==LR_SHIFTKEY) hide_objects(0);
- else hide_objects(1);
- }
- break;
- case IKEY:
- if(G.qual==LR_CTRLKEY) {
- if((ob) && (ob->flag & OB_POSEMODE) && (ob->type==OB_ARMATURE))
- deselectall_posearmature(ob, 3, 1);
- else if(ob && G.obedit) {
- if(G.obedit->type == OB_ARMATURE)
- deselectall_armature(3, 1);
- else
- selectswap_mesh();
- }
- else
- selectswap();
- }
- else if(G.qual==(LR_CTRLKEY|LR_ALTKEY)) {
- if(ob && (ob->flag & OB_POSEMODE) && ob->type==OB_ARMATURE)
- pose_clear_IK();
- }
- else if(G.qual==LR_SHIFTKEY) {
- if(ob && (ob->flag & OB_POSEMODE) && ob->type==OB_ARMATURE)
- pose_add_IK();
- }
- break;
-
- case JKEY:
- if(G.qual==LR_CTRLKEY) {
- if( ob ) {
- join_menu();
- }
- else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF)) {
- addsegment_nurb();
- } else {
- error("Can't join unless there is an active object");
- }
-
- }
- else if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- join_triangles();
- }
- }
-
- break;
- case KKEY:
- if(G.obedit) {
- if (G.obedit->type==OB_MESH) {
- if (G.qual==LR_SHIFTKEY)
- KnifeSubdivide(KNIFE_PROMPT);
- else if (G.qual==0)
- LoopMenu();
- }
- else if(G.obedit->type==OB_SURF)
- printknots();
- }
- else {
- if((G.qual==LR_SHIFTKEY)) {
- if(FACESEL_PAINT_TEST)
- if (G.f & G_WEIGHTPAINT)
- clear_wpaint_selectedfaces();
- else
- clear_vpaint_selectedfaces();
- else if(G.f & G_VERTEXPAINT)
- clear_vpaint();
- else
- select_select_keys();
- }
- else if (G.qual==0)
- set_ob_ipoflags();
- }
-
- break;
- case LKEY:
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- if (G.qual & LR_CTRLKEY) {
- if ((G.scene->selectmode & SCE_SELECT_FACE) == 0) {
- selectconnected_mesh_all(); /* normal select linked */
- } else {
- selectconnected_delimit_mesh_all(); /* select linked with edge crease delimiting */
- }
- } else {
- if ((G.scene->selectmode & SCE_SELECT_FACE) == 0) {
- selectconnected_mesh();
- } else {
- selectconnected_delimit_mesh();
- }
- }
- }
- if(G.obedit->type==OB_ARMATURE)
- selectconnected_armature();
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
- selectconnected_nurb();
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- if (G.qual == LR_CTRLKEY)
- poselib_preview_poses(ob, 0);
- else if (G.qual == LR_SHIFTKEY)
- poselib_add_current_pose(ob, 0);
- else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- poselib_rename_pose(ob);
- else if (G.qual == LR_ALTKEY)
- poselib_remove_pose(ob, NULL);
- else
- selectconnected_posearmature();
- }
- else {
- if(FACESEL_PAINT_TEST) {
- if((G.qual==0))
- select_linked_tfaces(0);
- else if((G.qual==LR_SHIFTKEY))
- select_linked_tfaces(1);
- else if(G.qual==LR_CTRLKEY)
- select_linked_tfaces(2);
- }
- else if(G.f & G_PARTICLEEDIT) {
- if(G.qual==0)
- PE_select_linked();
- }
- else {
- if((G.qual==0))
- make_local_menu();
- else if((G.qual==LR_SHIFTKEY))
- selectlinks_menu();
- else if(G.qual==LR_CTRLKEY)
- make_links_menu();
- }
- }
- break;
- case MKEY:
- if(G.obedit){
- if (ELEM(G.qual, 0, LR_SHIFTKEY) && (G.obedit->type==OB_ARMATURE)) {
- pose_movetolayer();
- }
- else if (G.qual==LR_ALTKEY) {
- if (G.obedit->type == OB_MESH) {
- mergemenu();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- else if (G.obedit->type == OB_ARMATURE) {
- merge_armature();
- }
- }
- else if ((G.qual==0) || (G.qual==LR_CTRLKEY)) {
- mirrormenu();
- }
- else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- if(G.obedit->type==OB_MESH) select_non_manifold();
- }
- }
- else if(G.qual & LR_CTRLKEY) {
- mirrormenu();
- }
- else if(G.qual==0 || G.qual==LR_SHIFTKEY) {
- if(ob && (ob->flag & OB_POSEMODE))
- pose_movetolayer();
- else
- movetolayer();
- }
- break;
- case NKEY:
- if((G.qual==0)) {
- toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(G.obedit) {
- switch (G.obedit->type){
- case OB_ARMATURE:
- if(G.qual==LR_CTRLKEY) {
- pupval= pupmenu("Recalculate Bone Roll Angles%t|Clear Roll (Z-Axis Up) %x1|Align Z-Axis to 3D-Cursor %x2");
- if (pupval > 0) {
- auto_align_armature(pupval - 1);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- break;
- case OB_MESH:
- if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
- if(okee("Recalculate normals inside")) {
- righthandfaces(2);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Recalculate normals inside");
- }
- }
- else if(G.qual==LR_CTRLKEY){
- if(okee("Recalculate normals outside")) {
- righthandfaces(1);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Recalculate normals outside");
- }
- }
- break;
- }
- }
-
- break;
- case OKEY:
- if (G.obedit || G.f&G_PARTICLEEDIT) {
- if (G.qual==LR_SHIFTKEY) {
- G.scene->prop_mode = (G.scene->prop_mode+1)%7;
- allqueue(REDRAWHEADERS, 0);
- }
- else if((G.qual==LR_ALTKEY)) {
- if(G.scene->proportional==2) G.scene->proportional= 1;
- else G.scene->proportional= 2;
- allqueue(REDRAWHEADERS, 0);
- }
- else if((G.qual==0)) {
- G.scene->proportional= !G.scene->proportional;
- allqueue(REDRAWHEADERS, 0);
- }
- }
- else if((G.qual==LR_SHIFTKEY || G.qual==(LR_ALTKEY|LR_SHIFTKEY))) {
- flip_subdivison(-1);
- }
- else if(G.qual==LR_ALTKEY) {
- if(okee("Clear origin")) {
- clear_object('o');
- }
- }
- break;
-
- case PKEY:
- if(G.obedit) {
- if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
- if(G.obedit->type==OB_ARMATURE)
- make_bone_parent();
- else
- make_parent();
- }
-
- else if(G.qual==LR_ALTKEY && G.obedit->type==OB_ARMATURE)
- clear_bone_parent();
- else if((G.qual==0) && (G.obedit->type==OB_ARMATURE))
- armature_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection
- else if((G.qual==(LR_CTRLKEY|LR_ALTKEY)) && (G.obedit->type==OB_ARMATURE))
- separate_armature();
- else if((G.qual==0) && G.obedit->type==OB_MESH)
- separatemenu();
- else if ((G.qual==0) && ELEM(G.obedit->type, OB_CURVE, OB_SURF))
- separate_nurb();
- else if (G.qual==LR_SHIFTKEY) {
- initTransform(TFM_PUSHPULL, CTX_NONE);
- Transform();
- }
- }
- else if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
- make_parent();
- else if(G.qual==LR_SHIFTKEY) {
- toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
- doredraw= 1;
- }
- else if(G.qual==(LR_ALTKEY|LR_SHIFTKEY)) {
- initTransform(TFM_PUSHPULL, CTX_NONE);
- Transform();
- }
- else if(G.qual==LR_ALTKEY)
- clear_parent();
- else if(G.qual==(LR_ALTKEY|LR_CTRLKEY))
- make_proxy();
- else if(G.qual==(LR_ALTKEY|LR_CTRLKEY|LR_SHIFTKEY)) {
- start_RBSimulation();
- }
- else if((G.qual==0) && (OBACT) && (OBACT->type==OB_ARMATURE) && (OBACT->flag & OB_POSEMODE))
- pose_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection
- else if((G.qual==0)) {
- start_game();
- }
- break;
- case RKEY:
- if((G.obedit==0) && G.qual==LR_ALTKEY) {
- if(okee("Clear rotation")) {
- clear_object('r');
- }
- }
- else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
- v3d->twtype= V3D_MANIP_ROTATE;
- doredraw= 1;
- }
- else if (G.obedit) {
- if((G.qual==LR_SHIFTKEY)) {
- if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
- selectrow_nurb();
- }
- else if(G.qual==LR_CTRLKEY) {
- if (G.obedit->type==OB_MESH) {
- CutEdgeloop(1);
- BIF_undo_push("Cut Edgeloop");
- }
- else if (G.obedit->type==OB_ARMATURE) {
- initTransform(TFM_BONE_ROLL, CTX_NONE);
- Transform();
- }
- }
- else if((G.qual==0)) {
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- }
- }
- else if((G.qual==0)) {
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- }
- break;
- case SKEY:
- if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
- v3d->twtype= V3D_MANIP_SCALE;
- doredraw= 1;
- }
- else if(G.obedit) {
-
- if(G.qual==LR_ALTKEY) {
- if(G.obedit->type==OB_ARMATURE) {
- initTransform(TFM_BONESIZE, CTX_NONE);
- }
- else if (G.obedit->type==OB_CURVE) {
- initTransform(TFM_CURVE_SHRINKFATTEN, CTX_NONE);
- } else {
- initTransform(TFM_SHRINKFATTEN, CTX_NONE);
- }
- Transform();
- }
- else if(G.qual==LR_CTRLKEY) {
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- }
- else if(G.qual==LR_SHIFTKEY)
- snapmenu();
- else if(G.qual==0) {
- if(G.obedit->type==OB_ARMATURE) {
- bArmature *arm= G.obedit->data;
- if(arm->drawtype==ARM_ENVELOPE)
- initTransform(TFM_BONE_ENVELOPE, CTX_NONE);
- else
- initTransform(TFM_RESIZE, CTX_NONE);
- }
- else
- initTransform(TFM_RESIZE, CTX_NONE);
- Transform();
- }
- else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)){
- initTransform(TFM_TOSPHERE, CTX_NONE);
- Transform();
- }
- if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
- if(G.obedit->type==OB_MESH) select_sharp_edges();
- }
- }
- else if(G.qual==LR_ALTKEY) {
- if(G.f & G_WEIGHTPAINT)
- ob= ob->parent;
- if(ob && (ob->flag & OB_POSEMODE)) {
- bArmature *arm= ob->data;
- if( arm->drawtype==ARM_ENVELOPE) {
- initTransform(TFM_BONESIZE, CTX_NONE);
- Transform();
- break;
- }
- }
-
- if(okee("Clear scale")) {
- clear_object('s');
- }
- }
- else if(G.qual==LR_SHIFTKEY) {
- snapmenu();
- }
- else if((G.qual==0)) {
- initTransform(TFM_RESIZE, CTX_NONE);
- Transform();
- }
- else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
- initTransform(TFM_TOSPHERE, CTX_NONE);
- Transform();
- }
- else if(G.qual==(LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY)) {
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- }
- break;
- case TKEY:
- if(G.qual == LR_SHIFTKEY) { /* toggle texture in solid draw mode */
- G.vd->flag2 ^= V3D_SOLID_TEX;
- allqueue(REDRAWVIEW3D, 0);
- } else if(G.obedit){
- if((G.qual & LR_CTRLKEY) && G.obedit->type==OB_MESH) {
- convert_to_triface(G.qual & LR_SHIFTKEY);
- allqueue(REDRAWVIEW3D, 0);
- if (EM_texFaceCheck())
- allqueue(REDRAWIMAGE, 0);
-
- countall();
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- }
- if (G.obedit->type==OB_CURVE) {
- if (G.qual==LR_ALTKEY) {
- clear_tilt();
- }
- else if (G.qual==0) {
- initTransform(TFM_TILT, CTX_NONE);
- Transform();
- }
- }
- }
- else if(G.f & G_PARTICLEEDIT) {
- initTransform(TFM_BAKE_TIME, CTX_NONE);
- Transform();
- }
- else if(G.qual==LR_CTRLKEY) {
- if(ob && (ob->flag & OB_POSEMODE));
- else make_track();
- }
- else if(G.qual==LR_ALTKEY) {
- if(ob && (ob->flag & OB_POSEMODE));
- else clear_track();
- }
- else if((G.qual==0)){
- texspace_edit();
- }
-
- break;
- case UKEY:
- /*// Use Ctrl Z like everybody else
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- if(G.qual==0) BIF_undo(); else BIF_redo();
- }
- else if ELEM5(G.obedit->type, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) {
- if(G.qual==0) BIF_undo(); else BIF_redo();
- }
- }*/
- if(G.obedit) {
- if(G.obedit->type==OB_MESH && G.qual==0) {
- uv_autocalc_tface();
- }
- }
- else if (G.f & G_PARTICLEEDIT){
- if(G.qual==0) BIF_undo(); else BIF_redo();
- }
- else if((G.qual==0)) {
- if(G.f & G_WEIGHTPAINT)
- BIF_undo();
- else if(G.f & G_VERTEXPAINT)
- BIF_undo();
- else if(G.f & G_TEXTUREPAINT)
- undo_imagepaint_step(1);
- else
- single_user();
- }
-
- break;
- case VKEY:
- if ((G.qual==LR_CTRLKEY)) {
- if ((G.obedit) && G.obedit->type==OB_MESH) {
- Vertex_Menu();
- }
- } else if((G.qual==LR_SHIFTKEY)) {
- if ((G.obedit) && G.obedit->type==OB_MESH) {
- align_view_to_selected(v3d);
- }
- else if (FACESEL_PAINT_TEST) {
- align_view_to_selected(v3d);
- }
- }
- else if(G.qual==LR_ALTKEY)
- image_aspect();
- else if (G.qual==0){
- if(G.obedit) {
- if(G.obedit->type==OB_MESH) {
- mesh_rip();
- }
- else if(G.obedit->type==OB_CURVE) {
- sethandlesNurb(2);
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- BIF_undo_push("Handle change");
- }
- }
- else if(ob && ob->type == OB_MESH)
- set_vpaint();
- }
- break;
- case WKEY:
- if ( ((ob) && (ob->flag & OB_POSEMODE)) ||
- ((G.obedit) && (G.obedit->type==OB_ARMATURE)) )
- {
- if (G.qual) {
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
- val= 1;
- else if (G.qual == LR_ALTKEY)
- val= 2;
- else
- val= 0;
-
- setflag_armature(val);
- }
- else if (G.qual == 0)
- special_editmenu();
- }
- else if((G.qual==LR_SHIFTKEY)) {
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- }
- /*else if(G.qual==LR_ALTKEY) {}*/
- else if(G.qual==LR_CTRLKEY) {
- if(G.obedit) {
- if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- switchdirectionNurb2();
- }
- }
- }
- else if((G.qual==0))
- special_editmenu();
-
- break;
- case XKEY:
- case DELKEY:
- if(G.qual==0 || G.qual==LR_SHIFTKEY)
- delete_context_selected();
- if(G.qual==LR_ALTKEY)
- gpencil_delete_menu();
- break;
- case YKEY:
- if((G.qual==0) && (G.obedit)) {
- if(G.obedit->type==OB_MESH) split_mesh();
- }
- break;
- case ZKEY:
- toggle_shading();
-
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
-
- case HOMEKEY:
- if(G.qual==0)
- view3d_home(0);
- break;
- case COMMAKEY:
- if(G.qual==LR_CTRLKEY) {
- G.vd->around= V3D_CENTROID;
- } else if(G.qual==LR_SHIFTKEY) {
- G.vd->around= V3D_CENTROID;
- } else if(G.qual==0) {
- G.vd->around= V3D_CENTER;
- }
- handle_view3d_around();
-
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
-
- case PERIODKEY:
- if(G.qual==LR_CTRLKEY) {
- G.vd->around= V3D_LOCAL;
- } else if(G.qual==LR_ALTKEY) {
- G.vd->around= V3D_ACTIVE;
- } else if(G.qual==0) {
- G.vd->around= V3D_CURSOR;
- }
- handle_view3d_around();
-
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
-
- case LEFTBRACKETKEY:
- if ((G.obedit) && (G.obedit->type == OB_ARMATURE))
- armature_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY));
- else if ((ob) && (ob->flag & OB_POSEMODE))
- pose_select_hierarchy(BONE_SELECT_PARENT, (G.qual == LR_SHIFTKEY));
- break;
- case RIGHTBRACKETKEY:
- if ((G.obedit) && (G.obedit->type == OB_ARMATURE))
- armature_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY));
- if ((ob) && (ob->flag & OB_POSEMODE))
- pose_select_hierarchy(BONE_SELECT_CHILD, (G.qual == LR_SHIFTKEY));
- break;
-
- case PADSLASHKEY:
- if(G.qual==0) {
- if(G.vd->localview) {
- G.vd->localview= 0;
- endlocalview(curarea);
- }
- else {
- G.vd->localview= 1;
- initlocalview();
- }
- scrarea_queue_headredraw(curarea);
- }
- break;
- case PADASTERKEY: /* '*' */
- if(G.qual==0) {
- if(ob) {
- if ((G.obedit) && (G.obedit->type == OB_MESH)) {
- editmesh_align_view_to_selected(G.vd, 3);
- }
- else if (FACESEL_PAINT_TEST) {
- if(ob->type==OB_MESH) {
- Mesh *me= ob->data;
- faceselect_align_view_to_selected(G.vd, me, 3);
- }
- }
- else
- obmat_to_viewmat(ob, 1);
-
- if(G.vd->persp==V3D_CAMOB) G.vd->persp= V3D_PERSP;
- scrarea_queue_winredraw(curarea);
- }
- }
- break;
- case PADPERIOD: /* '.' */
- if(G.qual==0)
- centerview();
- break;
-
- case PAGEUPKEY:
- if (G.qual==LR_CTRLKEY)
- nextprev_timeline_key(1);
- else if (G.qual==LR_SHIFTKEY)
- movekey_obipo(1);
- else if (G.qual==0)
- nextkey_obipo(1); /* in editipo.c */
-
- break;
-
- case PAGEDOWNKEY:
- if (G.qual==LR_CTRLKEY)
- nextprev_timeline_key(-1);
- else if (G.qual==LR_SHIFTKEY)
- movekey_obipo(-1);
- else if (G.qual==0)
- nextkey_obipo(-1);
- break;
-
- case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
- case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
- case PADENTER:
- persptoetsen(event);
- doredraw= 1;
- break;
- case PADMINUS:
- if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_MESH) )
- select_less();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_CURVE) )
- select_less_nurb();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_SURF) )
- select_less_nurb();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.f & G_PARTICLEEDIT) )
- PE_select_less();
- else {
- persptoetsen(event);
- doredraw= 1;
- }
- break;
-
- case PADPLUSKEY:
- if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_MESH) )
- select_more();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_CURVE) )
- select_more_nurb();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.obedit) && (G.obedit->type==OB_SURF) )
- select_more_nurb();
- else if ( (G.qual==LR_CTRLKEY)
- && (G.f & G_PARTICLEEDIT) )
- PE_select_more();
- else {
- persptoetsen(event);
- doredraw= 1;
- }
- break;
-
- case ESCKEY:
- if(G.qual==0) {
- if (G.vd->flag & V3D_DISPIMAGE) {
- G.vd->flag &= ~V3D_DISPIMAGE;
- doredraw= 1;
- }
- }
- break;
- }
- }
- }
-
- if(doredraw) {
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- }
-}
-
-static void initview3d(ScrArea *sa)
-{
- View3D *vd;
-
- vd= MEM_callocN(sizeof(View3D), "initview3d");
- BLI_addhead(&sa->spacedata, vd); /* addhead! not addtail */
-
- vd->spacetype= SPACE_VIEW3D;
- vd->blockscale= 0.7f;
- vd->viewquat[0]= 1.0f;
- vd->viewquat[1]= vd->viewquat[2]= vd->viewquat[3]= 0.0f;
- vd->persp= V3D_PERSP;
- vd->drawtype= OB_WIRE;
- vd->view= 7;
- vd->dist= 10.0;
- vd->lens= 35.0f;
- vd->near= 0.01f;
- vd->far= 500.0f;
- vd->grid= 1.0f;
- vd->gridlines= 16;
- vd->gridsubdiv = 10;
-
- vd->lay= vd->layact= 1;
- if(G.scene) {
- vd->lay= vd->layact= G.scene->lay;
- vd->camera= G.scene->camera;
- }
- vd->scenelock= 1;
- vd->gridflag |= V3D_SHOW_X;
- vd->gridflag |= V3D_SHOW_Y;
- vd->gridflag |= V3D_SHOW_FLOOR;
- vd->gridflag &= ~V3D_SHOW_Z;
-
- vd->depths= NULL;
- vd->ndofmode=0;
-}
-
-
-/* ******************** SPACE: IPO ********************** */
-
-static void changeview2dspace(ScrArea *sa, void *spacedata)
-{
- if(G.v2d==0) return;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-}
-
-static int get_cfra_from_dx(SpaceIpo * sipo, int dx)
-{
- if (sipo->blocktype == ID_SEQ) {
- Sequence * seq = (Sequence*) sipo->from;
- if (!seq) {
- return dx;
- }
- if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- return dx;
- } else {
- float m= (seq->enddisp - seq->startdisp)/100.0f;
- float cfra = dx * m + seq->startdisp;
-
- return (int) cfra;
- }
- } else {
- return dx;
- }
-}
-
-static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- extern void do_ipobuts(unsigned short event); /* drawipo.c */
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceIpo *sipo= curarea->spacedata.first;
- View2D *v2d= &sipo->v2d;
- float dx, dy;
- int cfra, doredraw= 0;
- short mval[2];
- short mousebut = L_MOUSE;
-
- if(sa->win==0) return;
-
- if(val) {
- if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- switch(event) {
- case UI_BUT_EVENT:
- /* note: bad bad code, will be cleaned! is because event queues are all shattered */
- if(val>0 && val < 256) do_ipowin_buts(val-1);
- else do_ipobuts(val);
- break;
-
- case LEFTMOUSE:
- if( in_ipo_buttons() ) {
- do_ipo_selectbuttons();
- doredraw= 1;
- }
- else if(G.qual == LR_CTRLKEY) {
- if (sipo->showkey==0)
- add_vert_ipo();
- }
- else if(view2dmove(LEFTMOUSE)); /* only checks for sliders */
- else {
- do {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(v2d, mval, &dx, &dy);
-
- cfra = get_cfra_from_dx(sipo, (int)(dx+0.5f));
- if(cfra< 1) cfra= 1;
-
- if( cfra!=CFRA ) {
- CFRA= cfra;
- update_for_newframe_nodraw(0); /* 1 = nosound */
- force_draw_all(0); /* To make constraint sliders redraw */
- }
- else PIL_sleep_ms(30);
-
- } while(get_mbut() & mousebut);
- }
- break;
- case RIGHTMOUSE:
- mouse_select_ipo();
- allqueue(REDRAWMARKER, 0);
- break;
- case MIDDLEMOUSE:
- if(in_ipo_buttons()) {
- scroll_ipobuts();
- }
- else view2dmove(event); /* in drawipo.c */
- break;
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- case PADPLUSKEY:
- view2d_zoom(v2d, 0.1154f, sa->winx, sa->winy);
- doredraw= 1;
- break;
- case PADMINUS:
- view2d_zoom(v2d, -0.15f, sa->winx, sa->winy);
- doredraw= 1;
- break;
- case PAGEUPKEY:
- if(G.qual & LR_CTRLKEY)
- movekey_ipo(1);
- else if(G.qual & LR_SHIFTKEY)
- nextkey_ipo(1);
- else
- nextprev_marker(1);
- break;
- case PAGEDOWNKEY:
- if(G.qual & LR_CTRLKEY)
- movekey_ipo(-1);
- else if(G.qual & LR_SHIFTKEY)
- nextkey_ipo(-1);
- else
- nextprev_marker(-1);
- break;
- case HOMEKEY:
- if((G.qual==0))
- do_ipo_buttons(B_IPOHOME);
- break;
- case PADPERIOD:
- if((G.qual==0))
- do_ipo_buttons(B_IPOVIEWCENTER);
- break;
-
- case AKEY:
- if (G.qual & LR_CTRLKEY) {
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- }
- else if (G.qual==0) {
- if(in_ipo_buttons()) {
- swap_visible_editipo();
- }
- else {
- swap_selectall_editipo();
- }
- allspace (REMAKEIPO, 0);
- allqueue (REDRAWNLA, 0);
- allqueue (REDRAWACTION, 0);
- }
-
- break;
- case BKEY:
- if (G.qual==0)
- borderselect_ipo();
- else if (G.qual==LR_CTRLKEY) {
- borderselect_markers();
- }
- else if (G.qual==LR_SHIFTKEY) {
- do_ipo_buttons(B_IPOBORDER);
- }
- break;
- case CKEY:
- if (G.qual == LR_SHIFTKEY)
- center_currframe();
- else
- move_to_frame();
- break;
- case DKEY:
- if (G.qual==LR_SHIFTKEY) {
- add_duplicate_editipo();
- } else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- duplicate_marker();
- allqueue(REDRAWMARKER, 0);
- }
- break;
- case GKEY:
- if (G.qual & LR_CTRLKEY) {
- transform_markers('g', 0);
- allqueue(REDRAWMARKER, 0);
- } else if (G.qual==0)
- transform_ipo('g');
- break;
- case HKEY:
- if (G.qual==LR_ALTKEY)
- sethandles_ipo(HD_AUTO_ANIM);
- if (G.qual==LR_SHIFTKEY)
- sethandles_ipo(HD_AUTO);
- else if (G.qual==0)
- sethandles_ipo(HD_ALIGN);
- break;
- case JKEY:
- if (G.qual==LR_CTRLKEY)
- join_ipo_menu();
- break;
- case KKEY:
- if (G.qual==0) {
- ipo_toggle_showkey();
- scrarea_queue_headredraw(curarea);
- allqueue(REDRAWVIEW3D, 0);
- doredraw= 1;
- }
- break;
- case MKEY:
- if (G.qual==0) {
- add_marker(CFRA);
- } else if (G.qual==LR_SHIFTKEY) {
- ipo_mirror_menu();
- break;
- } else if (G.qual == LR_CTRLKEY) {
- rename_marker();
- } else {
- break;
- }
- allqueue(REDRAWMARKER, 0);
- break;
- case NKEY:
- toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- doredraw= 1;
- break;
- case OKEY:
- if (G.qual==LR_SHIFTKEY)
- smooth_ipo();
- else
- clean_ipo();
- break;
- case PKEY:
- if (G.qual & LR_CTRLKEY) /* set preview range */
- anim_previewrange_set();
- else if (G.qual & LR_ALTKEY) /* clear preview range */
- anim_previewrange_clear();
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWBUTSALL, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- break;
- case RKEY:
- if (G.qual==LR_CTRLKEY)
- ipo_record();
- else
- transform_ipo('r');
- break;
- case SKEY:
- if (G.qual==LR_SHIFTKEY) {
- ipo_snap_menu();
- }
- else if (G.qual==0)
- transform_ipo('s');
- break;
- case TKEY:
- if (G.qual==0)
- set_ipotype();
- break;
- case EKEY:
- if (G.qual==0)
- set_ipoextend();
- break;
- case VKEY:
- if (G.qual==0)
- sethandles_ipo(HD_VECT);
- break;
- case XKEY:
- case DELKEY:
- /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
- if (G.qual == LR_SHIFTKEY) {
- if (okee("Erase selected marker(s)?"))
- remove_marker();
- }
- else {
- if (okee("Erase selected?"))
- del_ipo(0);
- }
-
- /* note: don't update the other spaces (in particular ipo)
- * or else curves disappear.
- */
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWSOUND, 0);
- break;
- case ACCENTGRAVEKEY:
- if((G.qual==0)) {
- do_ipo_buttons(B_IPOVIEWALL);
- allqueue(REDRAWIPO, 0);
- }
- break;
-
- }
- }
-
- if(doredraw) scrarea_queue_winredraw(sa);
-}
-
-void initipo(ScrArea *sa)
-{
- SpaceIpo *sipo;
-
- sipo= MEM_callocN(sizeof(SpaceIpo), "initipo");
- BLI_addhead(&sa->spacedata, sipo);
-
- sipo->spacetype= SPACE_IPO;
- sipo->blockscale= 0.7f;
-
- /* sipo space loopt van (0,-?) tot (??,?) */
- sipo->v2d.tot.xmin= 0.0f;
- sipo->v2d.tot.ymin= -10.0f;
- sipo->v2d.tot.xmax= (float)G.scene->r.efra;
- sipo->v2d.tot.ymax= 10.0f;
-
- sipo->v2d.cur= sipo->v2d.tot;
-
- sipo->v2d.min[0]= 0.01f;
- sipo->v2d.min[1]= 0.01f;
-
- sipo->v2d.max[0]= MAXFRAMEF;
- sipo->v2d.max[1]= 10000.0f;
-
- sipo->v2d.scroll= L_SCROLL+B_SCROLL;
- sipo->v2d.keeptot= 0;
-
- sipo->blocktype= ID_OB;
-}
-
-/* ******************** SPACE: INFO ********************** */
-
-#if 0
-static void space_mipmap_button_function(int event) {
- GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-static void space_sound_button_function(int event)
-{
- int a;
- SYS_SystemHandle syshandle;
-
- if ((syshandle = SYS_GetSystem()))
- {
- a = (U.gameflags & USER_DISABLE_SOUND);
- SYS_WriteCommandLineInt(syshandle, "noaudio", a);
- }
-}
-#endif
-
-static char *iconfile_menu(void)
-{
- static char string[512];
- char *str = string;
- IconFile *ifile;
- ListBase *iconfilelist = BIF_iconfile_list();
-
- str += sprintf(str, "Built-in %%x0|%%l|");
-
- for(ifile=iconfilelist->first; ifile; ifile=ifile->next) {
- str += sprintf(str, "%s %%x%d|", ifile->filename, ifile->index);
- }
-
- return string;
-}
-
-static void set_userdef_iconfile_cb(void *menuindex, void *unused2)
-{
- bTheme *btheme= U.themes.first;
- IconFile *ifile;
- ListBase *iconfilelist = BIF_iconfile_list();
- int index = *((int *)menuindex);
-
- if (index==0) {
- BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile));
- return;
- }
-
- for(ifile=iconfilelist->first; ifile; ifile=ifile->next) {
- if (index == ifile->index) {
- BLI_strncpy(btheme->tui.iconfile, ifile->filename, sizeof(btheme->tui.iconfile));
- }
- }
-}
-
-/* needed for event; choose new 'curmain' resets it... */
-static short th_curcol= TH_BACK;
-static short th_curcolset = 1;
-static char *th_curcol_ptr= NULL;
-static char th_curcol_arr[4]={0, 0, 0, 255};
-
-
-static void info_dump_customcolorset (void *arg1, void *arg2)
-{
- bTheme *btheme= U.themes.first;
- ThemeWireColor *tcs= &btheme->tarm[(th_curcolset - 1)];
-
-
-#if 0 // this version, if we keep the button
- /* print (name, redval, greenval, blueval) */
- printf("Theme '%s': Bone Color Set %d \n", btheme->name, th_curcolset);
- printf("\t'Normal': 0x%02x, 0x%02x, 0x%02x \n", tcs->solid[0], tcs->solid[1], tcs->solid[2]);
- printf("\t'Select': 0x%02x, 0x%02x, 0x%02x \n", tcs->select[0], tcs->select[1], tcs->select[2]);
- printf("\t'Active': 0x%02x, 0x%02x, 0x%02x \n", tcs->active[0], tcs->active[1], tcs->active[2]);
- printf("\n");
-#endif
-
- // this version generates code that can be copy+paste-ed
- printf("Theme '%s': Bone Color Set - Code for Copy+Paste \n", btheme->name);
- printf("\t/* set %d */ \n", th_curcolset);
- printf("\tSETCOL(btheme->tarm[%d].solid, 0x%02x, 0x%02x, 0x%02x, 255); \n", th_curcolset-1, tcs->solid[0], tcs->solid[1], tcs->solid[2]);
- printf("\tSETCOL(btheme->tarm[%d].select, 0x%02x, 0x%02x, 0x%02x, 255); \n", th_curcolset-1, tcs->select[0], tcs->select[1], tcs->select[2]);
- printf("\tSETCOL(btheme->tarm[%d].active, 0x%02x, 0x%02x, 0x%02x, 255); \n", th_curcolset-1, tcs->active[0], tcs->active[1], tcs->active[2]);
-}
-
-static void info_user_theme_colsets_buts(uiBlock *block, short y1, short y2, short y3, short y4)
-{
- bTheme *btheme= U.themes.first;
- ThemeWireColor *col_set= &btheme->tarm[(th_curcolset - 1)];
- uiBut *but;
- short y4label= y4-2; // sync this with info_user_themebuts
-
- /* Selector for set (currently only 20 sets) */
- uiDefButS(block, NUM, B_REDR, "Color Set: ", 255,y1,200,20, &th_curcolset, 1, 20, 0, 0, "Current color set");
-
- /* "Solid" Color (unselected wire-color is derived from this) */
- uiDefBut(block, LABEL,0,"Normal: ", 475,y4label,60,20,0, 0, 0, 0, 0, "");
- uiDefButC(block, COL, B_UPDATE_THEME, "", 475,y1,50,y3-y1+20, col_set->solid, 0, 0, 0, 0, "Color to use for surface of bones");
-
- /* Selected Color */
- uiDefBut(block, LABEL,0,"Selected: ", 575,y4label,60,20,0, 0, 0, 0, 0, "");
- uiDefButC(block, COL, B_UPDATE_THEME, "", 575,y1,50,y3-y1+20, col_set->select, 0, 0, 0, 0, "Color to use for 'selected' bones");
-
- /* Active Color */
- uiDefBut(block, LABEL,0,"Active: ", 675,y4label,60,20,0, 0, 0, 0, 0, "");
- uiDefButC(block, COL, B_UPDATE_THEME, "", 675,y1,50,y3-y1+20, col_set->active, 0, 0, 0, 0, "Color to use for 'active' bones");
-
- /* Extra 'Options' */
- uiDefButBitS(block, TOG, TH_WIRECOLOR_CONSTCOLS, B_UPDATE_THEME, "Use 'Constraint' Colouring", 885,y2,200,20, &col_set->flag, 0, 0, 0, 0, "Allow the use of colors indicating constraints/keyed status");
-
- /* 'Debug' Tools */
- // these should be disabled for release... but are needed for development
- but= uiDefBut(block, BUT, B_UPDATE_THEME, "Dump Colors Codes", 885,y3,200,20, NULL, 0, 0, 0, 0, "Prints this set's colors to the console");
- uiButSetFunc(but, info_dump_customcolorset, NULL, NULL);
-}
-
-static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3, short y4)
-{
- bTheme *btheme, *bt;
- int spacetype= 0;
- static short cur=1, curmain=2;
- short a, tot=0, isbuiltin= 0;
- char string[21*32], *strp, *col;
- /* for choosing an icon image based on index in the cached list */
- static int iconfileindex=0;
-
- y3= y2+23; /* exception! */
-
- /* count total, max 16! */
- for(bt= U.themes.first; bt; bt= bt->next) tot++;
-
- /* if cur not is 1; move that to front of list */
- if(cur!=1) {
- a= 1;
- for(bt= U.themes.first; bt; bt= bt->next, a++) {
- if(a==cur) {
- BLI_remlink(&U.themes, bt);
- BLI_addhead(&U.themes, bt);
- allqueue(REDRAWALL, 0);
- cur= 1;
- break;
- }
- }
- }
-
- /* the current theme */
- btheme= U.themes.first;
- if(strcmp(btheme->name, "Default")==0) isbuiltin= 1;
-
- /* construct popup script */
- string[0]= 0;
- for(bt= U.themes.first; bt; bt= bt->next) {
- strcat(string, bt->name);
- if(btheme->next) strcat(string, " |");
- }
- uiDefButS(block, MENU, B_UPDATE_THEME_ICONS, string, 45,y3,200,20, &cur, 0, 0, 0, 0, "Current theme");
-
-
- /* add / delete / name */
-
- if(tot<16)
- uiDefBut(block, BUT, B_ADD_THEME, "Add", 45,y2,200,20, NULL, 0, 0, 0, 0, "Makes new copy of this theme");
- if(tot>1 && isbuiltin==0)
- uiDefBut(block, BUT, B_DEL_THEME, "Delete", 45,y1,200,20, NULL, 0, 0, 0, 0, "Delete theme");
-
- if(isbuiltin) return;
-
- /* name */
- uiDefBut(block, TEX, B_NAME_THEME, "", 255,y3,200,20, btheme->name, 1.0, 30.0, 0, 0, "Rename theme");
-
- /* main choices pup: note, it uses collums, and the seperators (%l) then have to fill both halves equally for the menu to work */
- uiDefButS(block, MENU, B_CHANGE_THEME, "UI and Buttons %x1|%l|Bone Color Sets %x17|%l|3D View %x2|%l|Ipo Curve Editor %x3|Action Editor %x4|"
- "NLA Editor %x5|%l|UV/Image Editor %x6|Video Sequence Editor %x7|Node Editor %x16|Timeline %x15|%l|Audio Window %x8|Text Editor %x9|%l|User Preferences %x10|"
- "Outliner %x11|Buttons Window %x12|%l|File Browser %x13|Image Browser %x14",
- 255,y2,200,20, &curmain, 0, 0, 0, 0, "Specify theme for...");
- if(curmain==1) spacetype= 0;
- else if(curmain==2) spacetype= SPACE_VIEW3D;
- else if(curmain==3) spacetype= SPACE_IPO;
- else if(curmain==4) spacetype= SPACE_ACTION;
- else if(curmain==5) spacetype= SPACE_NLA;
- else if(curmain==6) spacetype= SPACE_IMAGE;
- else if(curmain==7) spacetype= SPACE_SEQ;
- else if(curmain==8) spacetype= SPACE_SOUND;
- else if(curmain==9) spacetype= SPACE_TEXT;
- else if(curmain==10) spacetype= SPACE_INFO;
- else if(curmain==11) spacetype= SPACE_OOPS;
- else if(curmain==12) spacetype= SPACE_BUTS;
- else if(curmain==13) spacetype= SPACE_FILE;
- else if(curmain==14) spacetype= SPACE_IMASEL;
- else if(curmain==15) spacetype= SPACE_TIME;
- else if(curmain==16) spacetype= SPACE_NODE;
- else if(curmain==17) {
- info_user_theme_colsets_buts(block, y1, y2, y3, y4);
- return;
- }
- else return; /* only needed while coding... when adding themes for more windows */
-
- /* color choices pup */
- if(curmain==1) {
- strp= BIF_ThemeColorsPup(0);
- if(th_curcol==TH_BACK) th_curcol= TH_BUT_OUTLINE; /* switching main choices... */
- }
- else strp= BIF_ThemeColorsPup(spacetype);
-
- uiDefButS(block, MENU, B_REDR, strp, 255,y1,200,20, &th_curcol, 0, 0, 0, 0, "Current color");
- MEM_freeN(strp);
-
- th_curcol_ptr= col= BIF_ThemeGetColorPtr(btheme, spacetype, th_curcol);
- if(col==NULL) return;
-
- /* first handle exceptions, special single values, row selection, etc */
- if(th_curcol==TH_VERTEX_SIZE) {
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
- }
- else if(th_curcol==TH_FACEDOT_SIZE) {
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Face dot size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
- }
- else if(th_curcol==TH_BUT_DRAWTYPE) {
- uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_UPDATE_THEME, "Shaded", 465,y2,80,20, col, 2.0, (float) TH_SHADED, 0, 0, "");
- uiDefButC(block, ROW, B_UPDATE_THEME, "Rounded", 545,y2,80,20, col, 2.0, (float) TH_ROUNDED, 0, 0, "");
- uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 625,y2,80,20, col, 2.0, (float) TH_MINIMAL, 0, 0, "");
- uiDefButC(block, ROW, B_UPDATE_THEME, "OldSkool", 705,y2,80,20, col, 2.0, (float) TH_OLDSKOOL, 0, 0, "");
- uiBlockEndAlign(block);
- }
- else if(th_curcol==TH_ICONFILE) {
- uiBut *but;
-
- /* set the icon file menu to the correct icon file index for what's stored in the theme values */
- iconfileindex= BIF_iconfile_get_index(btheme->tui.iconfile);
-
- but = uiDefButI(block, MENU, B_UPDATE_THEME_ICONS, iconfile_menu(),
- 465,y2,200,20, &iconfileindex, 0, 0, 0, 0, "The icon PNG file to use, searching in .blender/icons");
- uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, NULL);
-
- }
- else if(th_curcol==TH_HANDLE_VERTEX_SIZE) {
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Handle size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
- }
- else {
- uiBlockBeginAlign(block);
- if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) {
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, "");
- }
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"R ", 465,y3,200,20, col, 0.0, 255.0, B_THEMECOL, 0, "");
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"G ", 465,y2,200,20, col+1, 0.0, 255.0, B_THEMECOL, 0, "");
- uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, "");
- uiBlockEndAlign(block);
-
- uiDefButC(block, COL, B_UPDATE_THEME, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, "");
-
- /* copy paste */
- uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_THEME_COPY, "Copy Color", 755,y2,120,20, NULL, 0, 0, 0, 0, "Stores current color in buffer");
- uiDefBut(block, BUT, B_THEME_PASTE, "Paste Color", 755,y1,120,20, NULL, 0, 0, 0, 0, "Pastes buffer color");
- uiBlockEndAlign(block);
-
- uiDefButC(block, COL, 0, "", 885,y1,50,y2-y1+20, th_curcol_arr, 0, 0, 0, 0, "");
-
- }
-}
-
-/* setting the temp dir needs to set */
-void eval_utemp_dir_callback(void *dummy1, void *dummy2)
-{
- if (!BLI_exists(U.tempdir))
- error("temp directory does not exist, assign a valid directory");
- BLI_where_is_temp(btempdir, 1);
-}
-
-void drawinfospace(ScrArea *sa, void *spacedata)
-{
- uiBlock *block;
- uiBut *uibut;
- static short cur_light=0;
- float fac, col[3];
- short xpos, ypos, ypostab, buth, rspace, dx, y1, y2, y3, y4, y5, y6, y7;
- short y2label, y3label, y4label, y5label, y6label, y7label;
- short spref, mpref, lpref, smfileselbut;
- short edgsp, midsp;
- char naam[32];
-
- if(curarea->win==0 || curarea->winy<2) return;
-
- BIF_GetThemeColor3fv(TH_BACK, col);
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- /* smaller buttons make no sense */
- if(curarea->winx<320) return;
-
- if(curarea->winx<=1280.0) {
- fac= ((float)curarea->winx)/1280.0f;
- myortho2(0.375f, 1280.375f, 0.375f, curarea->winy/fac + 0.375f);
- }
- else {
- myortho2(0.375f, (float)curarea->winx + 0.375f, 0.375f, (float)curarea->winy + 0.375f);
- }
-
- sprintf(naam, "infowin %d", curarea->win);
- block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->win);
-
-
- /* Vars for nice grid alignment */
- dx= (1280-90)/7; /* spacing for use in equally dividing 'tab' row */
-
- xpos = 45; /* left padding */
- ypos = 50; /* bottom padding for buttons */
- ypostab = 10; /* bottom padding for 'tab' row */
-
- buth = 20; /* standard button height */
-
- spref = 90; /* standard size for small preferences button */
- mpref = 189; /* standard size for medium preferences button */
- lpref = 288; /* standard size for large preferences button */
- smfileselbut = buth; /* standard size for fileselect button (square) */
-
- edgsp = 3; /* space from edge of end 'tab' to edge of end button */
- midsp = 9; /* horizontal space between buttons */
-
- rspace = 3; /* default space between rows */
-
- y1 = ypos; /* grid alignment for each row of buttons */
- y2 = ypos+buth+rspace;
- y3 = ypos+2*(buth+rspace);
- y4 = ypos+3*(buth+rspace);
- y5 = ypos+4*(buth+rspace);
- y6 = ypos+5*(buth+rspace);
- y7 = ypos+6*(buth+rspace);
-
-
- y2label = y2-2; /* adjustments to offset the labels down to align better */
- y3label = y3-2;
- y4label = y4-2;
- y5label = y5-2;
- y6label = y6-2;
- y7label = y7-2;
-
-
- /* set the color to blue and draw the main 'tab' controls */
-
- uiBlockSetCol(block, TH_BUT_SETTING1);
- uiBlockBeginAlign(block);
-
- uiDefButS(block, ROW,B_USERPREF,"View & Controls",
- xpos,ypostab,(short)dx,buth,
- &U.userpref,1.0,0.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"Edit Methods",
- (short)(xpos+dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,1.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"Language & Font",
- (short)(xpos+2*dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,2.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"Themes",
- (short)(xpos+3*dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,6.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"Auto Save",
- (short)(xpos+4*dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,3.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"System & OpenGL",
- (short)(xpos+5*dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,4.0, 0, 0,"");
-
- uiDefButS(block, ROW,B_USERPREF,"File Paths",
- (short)(xpos+6*dx),ypostab,(short)dx,buth,
- &U.userpref,1.0,5.0, 0, 0,"");
-
- uiBlockSetCol(block, TH_AUTO);
- uiBlockEndAlign(block);
- /* end 'tab' controls */
-
- /* line 2: left x co-ord, top y co-ord, width, height */
-
- if(U.userpref == 6) {
- info_user_themebuts(block, y1, y2, y3, y4);
- }
- else if (U.userpref == 0) { /* view & controls */
-
- uiDefBut(block, LABEL,0,"Display:",
- xpos,y7label,spref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_TOOLTIPS, 0, "Tool Tips",
- (xpos+edgsp),y6,spref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Display tooltips (help tags) over buttons");
- uiDefButBitI(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info",
- (xpos+edgsp),y5,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Display active object name and frame number in the 3D View");
- uiDefButBitI(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene",
- (xpos+edgsp),y4,spref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Forces the current Scene to be displayed in all Screens");
-#ifndef __APPLE__
- uiDefButBitS(block, TOG, 1, 0, "Large Cursors",
- (xpos+edgsp),y3,spref,buth,
- &(U.curssize), 0, 0, 0, 0,
- "Use large mouse cursors when available");
-#else
- U.curssize=0; /*Small Cursor always for OS X for now */
-#endif
- uiDefButBitI(block, TOG, USER_SHOW_VIEWPORTNAME, B_DRAWINFO, "View Name",
- (xpos+edgsp),y2,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Show the name of the view's direction in each 3D View");
- uiDefButBitI(block, TOG, USER_SHOW_FPS, B_DRAWINFO, "Playback FPS",
- (xpos+edgsp),y1,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Show the frames per second screen refresh rate, while animation is played back");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Menus:",
- (xpos+(2*edgsp)+spref),y6label,spref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_MENUOPENAUTO, 0, "Open on Mouse Over",
- (xpos+edgsp+spref+midsp),y5,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Open menu buttons and pulldowns automatically when the mouse is hovering");
- uiDefButS(block, NUM, 0, "Top Level:",
- (xpos+edgsp+spref+midsp),y4,spref+edgsp,buth,
- &(U.menuthreshold1), 1, 40, 0, 0,
- "Time delay in 1/10 seconds before automatically opening top level menus");
- uiDefButS(block, NUM, 0, "Sublevels:",
- (xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y4,spref+edgsp,buth,
- &(U.menuthreshold2), 1, 40, 0, 0,
- "Time delay in 1/10 seconds before automatically opening menu sublevels");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Toolbox click-hold delay:",
- (xpos+(2*edgsp)+spref),y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, 0, "LMB:",
- (xpos+edgsp+spref+midsp),y2,spref+edgsp,buth,
- &(U.tb_leftmouse), 2, 40, 0, 0,
- "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
- uiDefButS(block, NUM, 0, "RMB:",
- (xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y2,spref+edgsp,buth,
- &(U.tb_rightmouse), 2, 40, 0, 0,
- "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, USER_PANELPINNED, 0, "Pin Floating Panels",
- (xpos+edgsp+spref+midsp),y1,(mpref/2),buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Make floating panels invoked by a hotkey (eg. N Key) open at the previous location");
- uiDefButBitI(block, TOG, USER_PLAINMENUS, B_PLAINMENUS, "Plain Menus",
- (xpos+edgsp+(2*spref)+(2*midsp)),y1,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Use a column layout for toolbox and do not flip the contents of any menu");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Snap to grid:",
- (xpos+(2*edgsp)+spref+midsp+mpref),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_AUTOGRABGRID, 0, "Grab/Move",
- (xpos+edgsp+mpref+spref+(2*midsp)),y5,spref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Snap objects and sub-objects to grid units when moving");
- uiDefButBitI(block, TOG, USER_AUTOROTGRID, 0, "Rotate",
- (xpos+edgsp+mpref+spref+(2*midsp)),y4,spref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Snap objects and sub-objects to grid units when rotating");
- uiDefButBitI(block, TOG, USER_AUTOSIZEGRID, 0, "Scale",
- (xpos+edgsp+mpref+spref+(2*midsp)),y3,spref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Snap objects and sub-objects to grid units when scaling");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, USER_ORBIT_ZBUF, B_DRAWINFO, "Auto Depth",
- (xpos+edgsp+mpref+spref+(2*midsp)),y2,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
-
- uiDefButBitI(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
- (xpos+edgsp+mpref+spref+(2*midsp)),y1,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Lock the same rotation/scaling pivot in all 3D Views");
-
- uiDefBut(block, LABEL,0,"View zoom:",
- (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
- uiDefButS(block, ROW, 0, "Continue",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y5,(mpref/3),buth,
- &(U.viewzoom), 40, USER_ZOOM_CONT, 0, 0,
- "Old style zoom, continues while moving mouse up or down");
- uiDefButS(block, ROW, 0, "Dolly",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/3)),y5,(mpref/3),buth,
- &(U.viewzoom), 40, USER_ZOOM_DOLLY, 0, 0,
- "Zooms in and out based on vertical mouse movement.");
- uiDefButS(block, ROW, 0, "Scale",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(2*mpref/3)),y5,(mpref/3),buth,
- &(U.viewzoom), 40, USER_ZOOM_SCALE, 0, 0,
- "Zooms in and out like scaling the view, mouse movements relative to center.");
- uiBlockSetCol(block, TH_AUTO); /* end color */
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, USER_ZOOM_TO_MOUSEPOS, B_DRAWINFO, "Zoom to Mouse Position",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y4,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
-
- uiDefBut(block, LABEL,0,"View rotation:",
- (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
- uiDefButBitI(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y2,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0,
- "Allow the view to tumble freely when orbiting with the Middle Mouse Button");
- uiDefButBitI(block, TOGN, USER_TRACKBALL, B_DRAWINFO, "Turntable",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y2,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0,
- "Use fixed up axis for orbiting with Middle Mouse Button");
- uiBlockSetCol(block, TH_AUTO); /* end color */
- uiDefButBitI(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Perspective",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y1,(mpref/2),buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Automatically switch between orthographic and perspective when changing from top/front/side views");
- uiDefButBitI(block, TOG, USER_ORBIT_SELECTION, B_DRAWINFO, "Around Selection",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y1,(mpref/2),buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Use selection as the orbiting center");
-
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"Select with:",
- (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
- uiDefButBitI(block, TOG, USER_LMOUSESELECT, B_DRAWINFO, "Left Mouse",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y5,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Use the Left Mouse Button for selection");
- uiDefButBitI(block, TOGN, USER_LMOUSESELECT, B_DRAWINFO, "Right Mouse",
- (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/2)),y5,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Use the Right Mouse Button for selection");
- uiBlockSetCol(block, TH_AUTO); /* end color */
- uiBlockEndAlign(block);
-
-
- if(U.flag & USER_LMOUSESELECT) {
- uiDefBut(block, LABEL,0,"Cursor with: Right Mouse",
- (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth,
- 0, 0, 0, 0, 0, "");
- } else {
- uiDefBut(block, LABEL,0,"Cursor with: Left Mouse",
- (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth,
- 0, 0, 0, 0, 0, "");
- }
-
- /* illegal combo... */
- if (U.flag & USER_LMOUSESELECT)
- U.flag &= ~USER_TWOBUTTONMOUSE;
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_TWOBUTTONMOUSE, B_DRAWINFO, "Emulate 3 Button Mouse",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
- uiDefButBitI(block, TOG, USER_MMB_PASTE, B_DRAWINFO, "Paste on MMB",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y2,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "In text window, paste with MMB instead of panning");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref/3),buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Show a small rotating 3D axis in the bottom left corner of the 3D View");
- uiDefButS(block, NUM, B_DRAWINFO, "Size:",
- (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/3)),y1,(mpref/3),buth,
- &U.rvisize, 10, 64, 0, 0,
- "The axis icon's size");
- uiDefButS(block, NUM, B_DRAWINFO, "Bright:",
- (xpos+edgsp+(3*mpref)+(4*midsp)+2*(mpref/3)),y1,(mpref/3),buth,
- &U.rvibright, 0, 10, 0, 0,
- "The brightness of the icon");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Middle Mouse Button:",
- (xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
- uiDefButBitI(block, TOGN, USER_VIEWMOVE, B_DRAWINFO, "Rotate View",
- (xpos+edgsp+(4*mpref)+(5*midsp)),y5,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button");
- uiDefButBitI(block, TOG, USER_VIEWMOVE, B_DRAWINFO, "Pan View",
- (xpos+edgsp+(4*mpref)+(5*midsp)+(mpref/2)),y5,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button");
- uiBlockSetCol(block, TH_AUTO); /* end color */
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"Mouse Wheel:",
- (xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y4label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_WHEELZOOMDIR, 0, "Invert Zoom",
- (xpos+edgsp+(4*mpref)+(5*midsp)),y3,spref,buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Swap the Mouse Wheel zoom direction");
- uiDefButI(block, NUM, 0, "Scroll Lines:",
- (xpos+edgsp+(4*mpref)+(6*midsp)+spref-edgsp),y3,spref+edgsp,buth,
- &U.wheellinescroll, 0.0, 32.0, 0, 0,
- "The number of lines scrolled at a time with the mouse wheel");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_DRAWINFO, "Smooth View:",
- (xpos+edgsp+(4*mpref)+(5*midsp)),y2,(mpref),buth,
- &U.smooth_viewtx, 0, 1000, 0, 0,
- "The time to animate the view in miliseconds, zero to disable");
- uiDefButS(block, NUM, B_DRAWINFO, "Rotation Angle:",
- (xpos+edgsp+(4*mpref)+(5*midsp)),y1,(mpref),buth,
- &U.pad_rot_angle, 0, 90, 0, 0,
- "The rotation step for numerical pad keys (2 4 6 8)");
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"3D Transform Widget:",
- (xpos+(2*edgsp)+(5*mpref)+(5*midsp)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_REDRCURW3D, "Size:",
- (xpos+edgsp+(5*mpref)+(6*midsp)),y5,(mpref/2),buth,
- &(U.tw_size), 2, 40, 0, 0, "Diameter of widget, in 10 pixel units");
- uiDefButS(block, NUM, B_REDRCURW3D, "Handle:",
- (xpos+edgsp+(5*mpref)+(6*midsp)+(mpref/2)),y5,(mpref/2),buth,
- &(U.tw_handlesize), 2, 40, 0, 0, "Size of widget handles as percentage of widget radius");
- uiDefButS(block, NUM, B_REDRCURW3D, "Hotspot:",
- (xpos+edgsp+(5*mpref)+(6*midsp)),y4,(mpref),buth,
- &(U.tw_hotspot), 4, 40, 0, 0, "Hotspot in pixels for clicking widget handles");
- uiBlockEndAlign(block);
-
- uiDefButS(block, NUM, B_REDRCURW3D, "Object Center Size: ",
- (xpos+edgsp+(5*mpref)+(6*midsp)),y3,mpref,buth,
- &(U.obcenter_dia), 4, 10, 0, 0,
- "Diameter in Pixels for Object/Lamp center display");
-
- uiDefBut(block, LABEL,0,"6DOF devices speeds :",
- (xpos+edgsp+(5*mpref)+(6*midsp)),y2label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- //FIXME NDOF BAD ETIQUETTES
- uiDefButS(block, NUM, USER_AUTOPERSP, "ndPan",
- (xpos+edgsp+(5*mpref)+(6*midsp)),y1,(mpref/2),buth,
- &(U.ndof_pan), 0, 200, 0, 0,
- "The overall panning speed of an NDOF device, as percent of standard");
- uiDefButS(block, NUM, USER_ORBIT_SELECTION, "ndRot",
- (xpos+edgsp+(5*mpref)+(6*midsp)+(mpref/2)),y1,(mpref/2),buth,
- &(U.ndof_rotate), 0, 200, 0, 0,
- "The overall rotation speed of an NDOF device, as percent of standard");
-
- } else if (U.userpref == 1) { /* edit methods */
-
-
- uiDefBut(block, LABEL,0,"Material linked to:",
- xpos,y5label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOGN, USER_MAT_ON_OB, B_DRAWINFO, "ObData",
- (xpos+edgsp),y4,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Link new objects' material to the obData block");
- uiDefButBitI(block, TOG, USER_MAT_ON_OB, B_DRAWINFO, "Object",
- (xpos+edgsp+(mpref/2)),y4,(mpref/2),buth,
- &(U.flag), 0, 0, 0, 0, "Link new objects' material to the object block");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Add new objects:",
- xpos,y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_ADD_EDITMODE, B_DRAWINFO, "Switch to Edit Mode",
- (xpos+edgsp),y2,mpref,buth,
- &(U.flag), 0, 0, 0, 0, "Enter Edit Mode automatically after adding a new object");
- uiDefButBitI(block, TOG, USER_ADD_VIEWALIGNED, B_DRAWINFO, "Aligned to View",
- (xpos+edgsp),y1,mpref,buth,
- &(U.flag), 0, 0, 0, 0, "Align newly added objects facing the 3D View direction");
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"Transform:",
- (xpos+(2*edgsp)+mpref),y6label, mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiDefButBitI(block, TOG, USER_DRAGIMMEDIATE, B_DRAWINFO, "Drag Immediately",
- (xpos+edgsp+mpref+midsp),y5,mpref,buth,
- &(U.flag), 0, 0, 0, 0, "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users)");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Undo:",
- (xpos+(2*edgsp)+mpref),y4label, mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButS(block, NUMSLI, B_DRAWINFO, "Steps: ",
- (xpos+edgsp+mpref+midsp),y3,mpref,buth,
- &(U.undosteps), 0, 64, 0, 0, "Number of undo steps available (smaller values conserve memory)");
- uiDefButS(block, NUM, B_DRAWINFO, "Memory Limit: ",
- (xpos+edgsp+mpref+midsp),y2,mpref,buth,
- &(U.undomemory), 0, 32767, -1, 0, "Maximum memory usage in megabytes (0 means unlimited)");
-
- uiDefButBitI(block, TOG, USER_GLOBALUNDO, B_DRAWINFO, "Global Undo",
- (xpos+edgsp+mpref+midsp),y1,mpref,buth,
- &(U.uiflag), 2, 64, 0, 0, "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"Auto Keyframe",
- (xpos+(2*edgsp)+(2*mpref)+midsp),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, AUTOKEY_ON, REDRAWTIME, "Auto-Keying Enabled",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y5,mpref, buth,
- &(U.autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
-
- if (U.autokey_mode & AUTOKEY_ON) {
- uiDefButS(block, MENU, REDRAWTIME,
- "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y4,mpref, buth,
- &(U.autokey_mode), 0, 1, 0, 0,
- "Mode of automatic keyframe insertion for Objects and Bones");
- }
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTAVAIL, REDRAWTIME, "Available",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y3,mpref, buth,
- &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion in available curves");
-
- uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTNEEDED, REDRAWTIME, "Needed",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y2,mpref, buth,
- &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion only when keyframe needed");
-
- uiDefButBitS(block, TOG, AUTOKEY_FLAG_AUTOMATKEY, REDRAWTIME, "Use Visual Keying",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y1,mpref, buth,
- &(U.autokey_flag), 0, 0, 0, 0, "Use Visual keying automatically for constrained objects");
- uiBlockEndAlign(block);
-
-
- uiDefBut(block, LABEL,0,"Duplicate with object:",
- (xpos+(2*edgsp)+(3*midsp)+(3*mpref)+spref),y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_DUP_MESH, 0, "Mesh",
- (xpos+edgsp+(4*midsp)+(3*mpref)+spref),y2,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes mesh data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_SURF, 0, "Surface",
- (xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y2,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes surface data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_CURVE, 0, "Curve",
- (xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y2,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes curve data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_FONT, 0, "Text",
- (xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y2,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes text data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_MBALL, 0, "Metaball",
- (xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y2,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes metaball data to be duplicated with Shift+D");
-
- uiDefButBitI(block, TOG, USER_DUP_ARM, 0, "Armature",
- (xpos+edgsp+(4*midsp)+(3*mpref)+spref),y1,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes armature data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_LAMP, 0, "Lamp",
- (xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y1,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes lamp data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_MAT, 0, "Material",
- (xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y1,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes material data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_TEX, 0, "Texture",
- (xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y1,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes texture data to be duplicated with Shift+D");
- uiDefButBitI(block, TOG, USER_DUP_IPO, 0, "Ipo",
- (xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y1,(spref+edgsp),buth,
- &(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D");
- uiBlockEndAlign(block);
-
- uiDefBut(block, LABEL,0,"Grease Pencil:",
- (xpos+(2*edgsp)+(3*midsp)+(3*mpref)+spref),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, 0, "Manhatten Dist:",
- (xpos+(4*midsp)+(3*mpref)+spref),y5,(spref*1.5),buth,
- &(U.gp_manhattendist), 0, 100, 0, 0, "Pixels moved by mouse per axis when drawing stroke");
- uiDefButS(block, NUM, 0, "Euclidean Dist:",
- (xpos+(5*midsp)+(3*mpref)+(spref*2.5)),y5,(spref*1.5),buth,
- &(U.gp_euclideandist), 0, 100, 0, 0, "Distance moved by mouse when drawing stroke (in pixels) to include");
-
- uiDefButBitS(block, TOG, GP_PAINT_DOSMOOTH, 0,"Smooth Stroke",
- (xpos+(4*midsp)+(3*mpref)+spref),y4,(spref*1.5),buth,
- &(U.gp_settings), 0, 100, 0, 0, "Smooth the final stroke");
-
- // currently hidden behind G.rt, as it is not that useful yet
- if (G.rt) {
- uiDefButBitS(block, TOG, GP_PAINT_DOSIMPLIFY, 0,"Simplify Stroke",
- (xpos+(5*midsp)+(3*mpref)+(spref*2.5)),y4,(spref*1.5),buth,
- &(U.gp_settings), 0, 100, 0, 0, "Simplify the final stroke");
- }
- uiBlockEndAlign(block);
-
- uiDefButS(block, NUM, 0, "Eraser Radius:",
- (xpos+(7*midsp)+(3*mpref)+(4*spref)),y5,mpref,buth,
- &(U.gp_eraser), 0, 100, 0, 0, "Radius of eraser 'brush'");
-
-
- } else if(U.userpref == 2) { /* language & colors */
-
-#ifdef INTERNATIONAL
- uiDefButBitS(block, TOG, USER_DOTRANSLATE, B_DOLANGUIFONT, "International Fonts",
- xpos,y2,mpref,buth,
- &(U.transopts), 0, 0, 0, 0, "Activate international interface");
-
- if(U.transopts & USER_DOTRANSLATE) {
- char curfont[320];
-
- sprintf(curfont, "Interface Font: ");
- if(U.fontname[0]) strcat(curfont, U.fontname);
- else strcat(curfont, "Built-in");
-
- uiDefBut(block, LABEL,0,curfont,
- (xpos),y3,4*mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefBut(block, BUT, B_LOADUIFONT, "Select Font",
- xpos,y1,mpref,buth,
- 0, 0, 0, 0, 0, "Select a new font for the interface");
-
- uiDefButI(block, BUT, B_RESTOREFONT, "Restore to default",
- (xpos+edgsp+mpref+midsp),y2,mpref,buth,
- &U.fontsize, 0, 0, 0, 0, "Restores to using the default included antialised font");
-
- uiDefButI(block, MENU, B_SETFONTSIZE, fontsize_pup(),
- (xpos+edgsp+mpref+midsp),y1,mpref,buth,
- &U.fontsize, 0, 0, 0, 0, "Current interface font size (points)");
-
-/*
- uiDefButS(block, MENU, B_SETENCODING, encoding_pup(),
- (xpos+edgsp+mpref+midsp),y1,mpref,buth,
- &U.encoding, 0, 0, 0, 0, "Current interface font encoding");
-
-
- uiDefBut(block, LABEL,0,"Translate:",
- (xpos+edgsp+(2.1*mpref)+(2*midsp)),y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-*/
-
- uiDefButBitS(block, TOG, USER_TR_TOOLTIPS, B_SETTRANSBUTS, "Tooltips",
- (xpos+edgsp+(2.2*mpref)+(3*midsp)),y1,spref,buth,
- &(U.transopts), 0, 0, 0, 0, "Translate tooltips");
-
- uiDefButBitS(block, TOG, USER_TR_BUTTONS, B_SETTRANSBUTS, "Buttons",
- (xpos+edgsp+(2.2*mpref)+(4*midsp)+spref),y1,spref,buth,
- &(U.transopts), 0, 0, 0, 0, "Translate button labels");
-
- uiDefButBitS(block, TOG, USER_TR_MENUS, B_SETTRANSBUTS, "Toolbox",
- (xpos+edgsp+(2.2*mpref)+(5*midsp)+(2*spref)),y1,spref,buth,
- &(U.transopts), 0, 0, 0, 0, "Translate toolbox menu");
-
- uiDefButI(block, MENU, B_SETLANGUAGE, language_pup(),
- (xpos+edgsp+(2.2*mpref)+(3*midsp)),y2,mpref+(0.5*mpref)+3,buth,
- &U.language, 0, 0, 0, 0, "Select interface language");
-
- uiDefButBitS(block, TOG, USER_USETEXTUREFONT, B_USETEXTUREFONT, "Use Textured Fonts",
- (xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth,
- &(U.transopts), 0, 0, 0, 0,
- "Use Textured Fonts");
- }
-
-/* end of INTERNATIONAL */
-#endif
-
- } else if(U.userpref == 3) { /* auto save */
-
-
- uiDefButS(block, NUM, 0, "Save Versions:",
- (xpos+edgsp),y3,mpref,buth,
- &U.versions, 0.0, 32.0, 0, 0,
- "The number of old versions to maintain in the current directory, when manually saving");
-
- uiDefButBitI(block, TOG, USER_AUTOSAVE, B_RESETAUTOSAVE, "Auto Save Temp Files",
- (xpos+edgsp+mpref+midsp),y3,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Enables automatic saving of temporary files");
-
- if(U.flag & USER_AUTOSAVE) {
-
- uiDefButI(block, NUM, B_RESETAUTOSAVE, "Minutes:",
- (xpos+edgsp+mpref+midsp),y2,mpref,buth,
- &(U.savetime), 1.0, 60.0, 0, 0,
- "The time (in minutes) to wait between automatic temporary saves");
-
- uiDefBut(block, BUT, B_LOADTEMP, "Open Recent",
- (xpos+edgsp+mpref+midsp),y1,mpref,buth,
- 0, 0, 0, 0, 0,"Open the most recently saved temporary file");
- }
-
- uiDefButS(block, NUM, B_DRAWINFO, "Recent Files:",
- (xpos+edgsp+(2*mpref)+(3*midsp)),y3,(mpref),buth,
- &U.recent_files, 0, 30, 0, 0,
- "Maximum number of recently opened files to remember");
-
- uiDefButBitI(block, TOG, USER_SAVE_PREVIEWS, 0, "Save Preview Images",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Enables automatic saving of preview images in the .blend file");
-
- } else if (U.userpref == 4) { /* system & opengl */
- int memcachemax;
- if (sizeof(void *) ==8) memcachemax = 1024*16; /* 64bit system, 16 gig of ram would be nice */
- else memcachemax = 1024; /* 32 bit system, cant address over 2gig anyway */
-
- uiDefBut(block, LABEL,0,"Solid OpenGL lights:",
- xpos+edgsp, y6label, mpref, buth,
- 0, 0, 0, 0, 0, "");
-
- for (cur_light=0; cur_light<3; cur_light++) {
- char lightname[12];
- int lightbutw=buth*2;
- int offs=cur_light*(midsp+lightbutw);
-
- sprintf(lightname, "Light %d", cur_light+1);
-
- uiDefButBitI(block, TOG, 1, B_RECALCLIGHT, lightname,
- xpos+edgsp+offs, y5, lightbutw, buth,
- &U.light[cur_light].flag, 0.0, 0.0, 0, 0, "Enable this OpenGL light in Solid draw mode");
-
- uiDefButF(block, BUT_NORMAL, B_RECALCLIGHT, "",
- xpos+edgsp+offs, y3, lightbutw, buth*2+rspace,
- U.light[cur_light].vec, 0.0f, 1.0f, 0, 0, "The direction that the OpenGL light is shining");
-
- uiDefButF(block, COL, B_RECALCLIGHT, "",
- xpos+edgsp+offs, y2, lightbutw, buth,
- U.light[cur_light].col, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, COL, B_RECALCLIGHT, "",
- xpos+edgsp+offs, y1, lightbutw, buth,
- U.light[cur_light].spec, 0.0, 0.0, 0, 0, "");
- }
-
- uiDefBut(block, LABEL,0,"Color",
- xpos+edgsp+140, y2, mpref/4, buth,
- 0, 0, 0, 0, 0, "");
- uiDefBut(block, LABEL,0,"Spec",
- xpos+edgsp+140, y1, mpref/4, buth,
- 0, 0, 0, 0, 0, "");
-
-
-#ifdef WITH_VERSE
- uiDefBut(block, LABEL,0,"Verse:",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefBut(block, TEX, 0, "Master: ",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y5,mpref,buth,
- U.versemaster, 1.0, 63.0, 0, 0,
- "The Verse Master-server IP");
- uiDefBut(block, TEX, 0, "Username: ",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y4,mpref,buth,
- U.verseuser, 1.0, 63.0, 0, 0,
- "The Verse user name");
-#endif
-
-/*
- uiDefButBitS(block, TOG, USER_EVTTOCONSOLE, 0, "Log Events to Console",
- (xpos+edgsp),y2,lpref,buth,
- &(U.uiflag), 0, 0, 0, 0, "Display a list of input events in the console");
-
- uiDefButS(block, MENU, B_CONSOLEOUT, consolemethod_pup(),
- (xpos+edgsp), y1, lpref,buth,
- &U.console_out, 0, 0, 0, 0, "Select console output method");
-
- uiDefButS(block, NUM, B_CONSOLENUMLINES, "Lines:",
- (xpos+edgsp+lpref+midsp),y1,spref,buth,
- &U.console_buffer, 1.0, 4000.0, 0, 0, "Maximum number of internal console lines");
-*/
-
-#ifdef _WIN32
- uiDefBut(block, LABEL,0,"Win Codecs:",
- (xpos+edgsp+(1*midsp)+(1*mpref)),y3label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefButBitI(block, TOG, USER_ALLWINCODECS, 0, "Enable all codecs",
- (xpos+edgsp+(1*mpref)+(1*midsp)),y2,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0, "Allows all codecs for rendering (not guaranteed)");
-#endif
-
-#ifndef DISABLE_PYTHON
- uiDefBut(block, LABEL,0,"Auto Run Python Scripts",
- (xpos+edgsp+(1*midsp)+(1*mpref)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefButBitI(block, TOGN, USER_DONT_DOSCRIPTLINKS, REDRAWBUTSSCRIPT, "Enabled by Default",
- (xpos+edgsp+(1*mpref)+(1*midsp)),y5,mpref,buth,
- &(U.flag), 0, 0, 0, 0, "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
-#endif
-
- uiDefBut(block, LABEL,0,"Keyboard:",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y2label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- /* Not actually used anywhere! */
- /*
- uiDefButBitI(block, TOG, USER_NO_CAPSLOCK, B_U_CAPSLOCK, "Disable Caps Lock",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y1,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Disables the Caps Lock key when entering text");
- */
- uiDefButBitI(block, TOG, USER_NONUMPAD, 0, "Emulate Numpad",
- (xpos+edgsp+(3*midsp)+(3*mpref)),y1,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
-
-
- uiDefBut(block, LABEL,0,"System:",
- (xpos+edgsp+(4*midsp)+(4*mpref)),y7label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiDefButI(block, NUM, B_REDR, "Prefetch frames ",
- (xpos+edgsp+(4*mpref)+(4*midsp)), y6, mpref, buth,
- &U.prefetchframes, 0.0, 500.0, 20, 2,
- "Number of frames to render ahead during playback.");
-
- uiDefButI(block, NUM, B_MEMCACHELIMIT, "MEM Cache Limit ",
- (xpos+edgsp+(4*mpref)+(4*midsp)), y5, mpref, buth,
- &U.memcachelimit, 0.0, (float)memcachemax, 30, 2,
- "Memory cache limit in sequencer (megabytes)");
-
- uiDefButS(block, NUM, B_REDR, "Frameserver Port ",
- (xpos+edgsp+(4*mpref)+(4*midsp)), y4, mpref, buth,
- &U.frameserverport, 0.0, 32727.0, 30, 2,
- "Frameserver Port for Framserver-Rendering");
-
- uiDefButBitI(block, TOG, USER_DISABLE_SOUND, B_SOUNDTOGGLE, "Disable Game Sound",
- (xpos+edgsp+(4*mpref)+(4*midsp)),y3,mpref,buth,
- &(U.gameflags), 0, 0, 0, 0, "Disables sounds from being played in games");
-
- uiDefButBitI(block, TOG, USER_FILTERFILEEXTS, 0, "Filter File Extensions",
- (xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0, "Display only files with extensions in the image select window");
-
- uiDefButBitI(block, TOG, USER_HIDE_DOT, 0, "Hide dot file/datablock",
- (xpos+edgsp+(4*mpref)+(4*midsp)),y1,mpref,buth,
- &(U.uiflag), 0, 0, 0, 0, "Hide files/datablocks that start with a dot(.*)");
-
- uiDefBut(block, LABEL,0,"OpenGL:",
- (xpos+edgsp+(5*midsp)+(5*mpref)),y7label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefButF(block, NUMSLI, B_DRAWINFO, "Clip Alpha: ",
- (xpos+edgsp+(5*mpref)+(5*midsp)),y6,mpref,buth,
- &(U.glalphaclip), 0.0, 1.0, 0, 0, "Clip alpha below this threshold in the 3d textured view");
-
- uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps",
- (xpos+edgsp+(5*mpref)+(5*midsp)),y5,mpref,buth,
- &(U.gameflags), 0, 0, 0, 0, "Scale textures for the 3d View (Looks nicer but uses more memory and slows image reloading)");
-
- /* main choices pup: note, it uses collums, and the seperators (%l) then have to fill both halves equally for the menu to work */
- uiDefButS(block, MENU, B_GLRESLIMITCHANGED, "GL Texture Clamp Off%x0|%l|GL Texture Clamp 8192%x8192|GL Texture Clamp 4096%x4096|GL Texture Clamp 2048%x2048|GL Texture Clamp 1024%x1024|GL Texture Clamp 512%x512|GL Texture Clamp 256%x256|GL Texture Clamp 128%x128",
- (xpos+edgsp+(5*mpref)+(5*midsp)),y4,mpref,buth, &(U.glreslimit), 0, 0, 0, 0, "Limit the texture size to save graphics memory");
-
- uiDefButI(block, NUM, 0, "Time Out ",
- (xpos+edgsp+(5*mpref)+(5*midsp)), y3, mpref, buth,
- &U.textimeout, 0.0, 3600.0, 30, 2, "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated)");
- uiDefButI(block, NUM, 0, "Collect Rate ",
- (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth,
- &U.texcollectrate, 1.0, 3600.0, 30, 2, "Number of seconds between each run of the GL texture garbage collector.");
- uiBlockEndAlign(block);
-
- /* *** */
- uiDefBut(block, LABEL,0,"Color range for weight paint",
- (xpos+edgsp+(2*midsp)+(2*mpref)),y6label,mpref,buth,
- 0, 0, 0, 0, 0, "");
-
- uiDefButBitI(block, TOG, USER_CUSTOM_RANGE, B_WPAINT_RANGE, "ColorBand",
- (xpos+edgsp+(2*midsp)+(2*mpref)),y5,mpref,buth,
- &(U.flag), 0, 0, 0, 0,
- "");
-
- if((U.flag & USER_CUSTOM_RANGE)==0) {
- vDM_ColorBand_store(NULL);
- }
- else {
- rctf butrect;
-
- vDM_ColorBand_store(&U.coba_weight); /* also signal for derivedmesh to use colorband */
-
- BLI_init_rctf(&butrect, (xpos+edgsp+(2*midsp)+(2*mpref)),
- (xpos+edgsp+(2*midsp)+(2*mpref)) + mpref,
- y3, y3+30);
-
- draw_colorband_buts_small(block, &U.coba_weight, &butrect, B_WPAINT_RANGE);
- }
-
- uiDefBut(block, LABEL,0,"Audio mixing buffer:",
- (xpos+edgsp+(2*midsp)+(2*mpref)),y2label,mpref,buth,
- 0, 0, 0, 0, 0, "");
- uiBlockBeginAlign(block);
- uiDefButI(block, ROW, 0, "256",
- (xpos+edgsp+(2*midsp)+(2*mpref)),y1,(mpref/4),buth,
- &U.mixbufsize, 2.0, 256.0, 0, 0, "Set audio mixing buffer size to 256 samples");
- uiDefButI(block, ROW, 0, "512",
- (xpos+edgsp+(2*midsp)+(2*mpref)+(mpref/4)),y1,(mpref/4),buth,
- &U.mixbufsize, 2.0, 512.0, 0, 0, "Set audio mixing buffer size to 512 samples");
- uiDefButI(block, ROW, 0, "1024",
- (xpos+edgsp+(2*midsp)+(2*mpref)+(2*mpref/4)),y1,(mpref/4),buth,
- &U.mixbufsize, 2.0, 1024.0, 0, 0, "Set audio mixing buffer size to 1024 samples");
- uiDefButI(block, ROW, 0, "2048",
- (xpos+edgsp+(2*midsp)+(2*mpref)+(3*mpref/4)),y1,(mpref/4),buth,
- &U.mixbufsize, 2.0, 2048.0, 0, 0, "Set audio mixing buffer size to 2048 samples");
- uiBlockEndAlign(block);
-
- } else if(U.userpref == 5) { /* file paths */
-
- /* yafray: (temporary) path button for yafray xml export, now with fileselect */
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "YFexport: ",
- (xpos+edgsp), y2+buth+rspace, lpref-smfileselbut, buth,
- U.yfexportdir, 1.0, 63.0, 0, 0,
- "The default directory for yafray xml export (must exist!)");
- uiDefIconBut(block, BUT, B_YAFRAYDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+lpref-smfileselbut), y2+buth+rspace, smfileselbut, buth,
- 0, 0, 0, 0, 0, "Select the default yafray export directory");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Fonts: ",
- (xpos+edgsp),y2,(lpref-smfileselbut),buth,
- U.fontdir, 1.0, 63.0, 0, 0,
- "The default directory to search for loading fonts");
- uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+lpref-smfileselbut),y2,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default font directory");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Textures: ",
- (xpos+edgsp+lpref+midsp),y2,(lpref-smfileselbut),buth,
- U.textudir, 1.0, 63.0, 0, 0, "The default directory to search for textures");
- uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(2*lpref)+midsp-smfileselbut),y2,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default texture location");
- uiBlockEndAlign(block);
-
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Tex Plugins: ",
- (xpos+edgsp+(2*lpref)+(2*midsp)),y2,(lpref-smfileselbut),buth,
- U.plugtexdir, 1.0, 63.0, 0, 0, "The default directory to search for texture plugins");
- uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y2,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default texture plugin location");
- uiBlockEndAlign(block);
-
- uiDefButBitI(block, TOG, USER_RELPATHS, B_DRAWINFO, "Relative Paths Default",
- (xpos+edgsp+(5*mpref)+(5*midsp)),y3,mpref,buth,
- &(U.flag), 0, 0, 0, 0, "Default relative path option for the file selector");
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Seq Plugins: ",
- (xpos+edgsp+(3*lpref)+(3*midsp)),y2,(lpref-smfileselbut),buth,
- U.plugseqdir, 1.0, 63.0, 0, 0, "The default directory to search for sequence plugins");
- uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y2,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default sequence plugin location");
- uiBlockEndAlign(block);
-
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Render: ",
- (xpos+edgsp),y1,(lpref-smfileselbut),buth,
- U.renderdir, 1.0, 63.0, 0, 0, "The default directory for rendering output");
- uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+lpref-smfileselbut),y1,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default render output location");
- uiBlockEndAlign(block);
-
-#ifndef DISABLE_PYTHON
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, B_PYMENUEVAL, "Python Scripts: ",
- (xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth,
- U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts (resets python module search path: sys.path)");
- uiDefIconBut(block, BUT, B_PYMENUEVAL, ICON_SCRIPT,
- (xpos+edgsp+(2*lpref)+midsp-2*smfileselbut),y1,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Re-evaluate scripts registration in menus (resets python module search path: sys.path)");
- uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default Python script location");
- uiBlockEndAlign(block);
-#endif
-
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, 0, "Sounds: ",
- (xpos+edgsp+(2*lpref)+(2*midsp)),y1,(lpref-smfileselbut),buth,
- U.sounddir, 1.0, 63.0, 0, 0, "The default directory to search for sounds");
- uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y1,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Selet the default sound location");
- uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uibut = uiDefBut(block, TEX, 0, "Temp: ",
- (xpos+edgsp+(3*lpref)+(3*midsp)),y1,(lpref-smfileselbut),buth,
- U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files");
-
- /* set the btempdir from U.temp */
- uiButSetFunc(uibut, eval_utemp_dir_callback, NULL, NULL);
-
- uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL,
- (xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y1,smfileselbut,buth,
- 0, 0, 0, 0, 0, "Select the default temporary save file location");
- uiBlockEndAlign(block);
-
- }
-
- uiDrawBlock(block);
-
- myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
- draw_area_emboss(sa);
-
- /* restore buttons transform */
- if(curarea->winx<=1280.0) {
- fac= ((float)curarea->winx)/1280.0f;
- myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
- }
- else {
- myortho2(0.0, (float)curarea->winx, 0.0, (float)curarea->winy);
- }
- sa->win_swap= WIN_BACK_OK;
-
-}
-
-
-static void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
-
- if(val) {
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- switch(event) {
- case UI_BUT_EVENT:
- if(val==REDRAWTIME) {
- allqueue(REDRAWTIME, 0);
- addqueue(sa->win, REDRAW, 1);
- }
- else if(val==B_ADD_THEME) {
- bTheme *btheme, *new;
-
- btheme= U.themes.first;
- new= MEM_callocN(sizeof(bTheme), "theme");
- memcpy(new, btheme, sizeof(bTheme));
- BLI_addhead(&U.themes, new);
- strcpy(new->name, "New User Theme");
- addqueue(sa->win, REDRAW, 1);
- }
- else if(val==B_DEL_THEME) {
- bTheme *btheme= U.themes.first;
- BLI_remlink(&U.themes, btheme);
- MEM_freeN(btheme);
- BIF_SetTheme(sa); /* prevent usage of old theme in calls */
- addqueue(sa->win, REDRAW, 1);
- }
- else if(val==B_NAME_THEME) {
- bTheme *btheme= U.themes.first;
- if(strcmp(btheme->name, "Default")==0) {
- strcpy(btheme->name, "New User Theme");
- addqueue(sa->win, REDRAW, 1);
- }
- }
- else if(val==B_UPDATE_THEME) {
- allqueue(REDRAWALL, 0);
- }
- else if(val==B_UPDATE_THEME_ICONS) {
- BIF_icons_free();
- BIF_icons_init(BIFICONID_LAST+1);
- allqueue(REDRAWALL, 0);
- }
- else if(val==B_CHANGE_THEME) {
- th_curcol= TH_BACK; /* backdrop color is always there... */
- addqueue(sa->win, REDRAW, 1);
- }
- else if(val==B_THEME_COPY) {
- if(th_curcol_ptr) {
- th_curcol_arr[0]= th_curcol_ptr[0];
- th_curcol_arr[1]= th_curcol_ptr[1];
- th_curcol_arr[2]= th_curcol_ptr[2];
- th_curcol_arr[3]= th_curcol_ptr[3];
- addqueue(sa->win, REDRAW, 1);
- }
- }
- else if(val==B_THEME_PASTE) {
- if(th_curcol_ptr) {
- th_curcol_ptr[0]= th_curcol_arr[0];
- th_curcol_ptr[1]= th_curcol_arr[1];
- th_curcol_ptr[2]= th_curcol_arr[2];
- th_curcol_ptr[3]= th_curcol_arr[3];
- allqueue(REDRAWALL, 0);
- }
- }
- else if(val==B_RECALCLIGHT) {
- if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0)
- U.light[0].flag= 1;
-
- GPU_default_lights();
- addqueue(sa->win, REDRAW, 1);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if (val==B_MEMCACHELIMIT) {
- printf("Setting memcache limit to %d\n",
- U.memcachelimit);
- MEM_CacheLimiter_set_maximum(
- U.memcachelimit * 1024 * 1024);
- }
- else if (val==B_WPAINT_RANGE) {
- addqueue(sa->win, REDRAW, 1);
- if(OBACT && (G.f & G_WEIGHTPAINT)) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- }
- }
- else do_global_buttons(val);
-
- break;
- }
- }
-}
-
-static void init_infospace(ScrArea *sa)
-{
- SpaceInfo *sinfo;
-
- sinfo= MEM_callocN(sizeof(SpaceInfo), "initinfo");
- BLI_addhead(&sa->spacedata, sinfo);
-
- sinfo->spacetype=SPACE_INFO;
-}
-
-/* ******************** SPACE: BUTS ********************** */
-
-extern void drawbutspace(ScrArea *sa, void *spacedata); /* buttons.c */
-
-static void changebutspace(ScrArea *sa, void *spacedata)
-{
- if(G.v2d==0) return;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-}
-
-static void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceButs *sbuts= curarea->spacedata.first;
- ScrArea *sa2, *sa3d;
- int nr;
-
- if(val) {
-
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- switch(event) {
- case UI_BUT_EVENT:
- do_butspace(val);
- break;
-
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- case PAGEUPKEY:
- event= WHEELUPMOUSE;
- view2dmove(event); /* in drawipo.c */
- break;
- case PAGEDOWNKEY:
- event= WHEELDOWNMOUSE;
- view2dmove(event); /* in drawipo.c */
- break;
-
- case RIGHTMOUSE:
- nr= pupmenu("Panel Alignment%t|Horizontal%x1|Vertical%x2|Free %x0");
- if (nr>=0) {
- sbuts->align= nr;
- if(nr) {
- uiAlignPanelStep(sa, 1.0);
- do_buts_buttons(B_BUTSHOME);
- }
- }
-
- break;
- case PADPLUSKEY:
- view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- break;
- case PADMINUS:
- view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- break;
- case RENDERPREVIEW:
- BIF_previewrender_buts(sbuts);
- break;
-
- case HOMEKEY:
- do_buts_buttons(B_BUTSHOME);
- break;
-
-
- /* if only 1 view, also de persp, excluding arrowkeys */
- case PAD0: case PAD1: case PAD3:
- case PAD5: case PAD7: case PAD9:
- case PADENTER: case ZKEY: case PKEY:
- sa3d= 0;
- sa2= G.curscreen->areabase.first;
- while(sa2) {
- if(sa2->spacetype==SPACE_VIEW3D) {
- if(sa3d) return;
- sa3d= sa2;
- }
- sa2= sa2->next;
- }
- if(sa3d) {
- sa= curarea;
- areawinset(sa3d->win);
-
- if(event==PKEY && G.qual==0) start_game();
- else if(event==ZKEY) toggle_shading();
- else persptoetsen(event);
-
- scrarea_queue_winredraw(sa3d);
- scrarea_queue_headredraw(sa3d);
- areawinset(sa->win);
- }
- }
- }
-
-}
-
-void set_rects_butspace(SpaceButs *buts)
-{
- /* buts space goes from (0,0) to (1280, 228) */
-
- buts->v2d.tot.xmin= 0.0f;
- buts->v2d.tot.ymin= 0.0f;
- buts->v2d.tot.xmax= 1279.0f;
- buts->v2d.tot.ymax= 228.0f;
-
- buts->v2d.min[0]= 256.0f;
- buts->v2d.min[1]= 42.0f;
-
- buts->v2d.max[0]= 2048.0f;
- buts->v2d.max[1]= 450.0f;
-
- buts->v2d.minzoom= 0.5f;
- buts->v2d.maxzoom= 1.21f;
-
- buts->v2d.scroll= 0;
- buts->v2d.keepaspect= 1;
- buts->v2d.keepzoom= 1;
- buts->v2d.keeptot= 1;
-
-}
-
-void test_butspace(void)
-{
- ScrArea *area= curarea;
- int blocksmin= uiBlocksGetYMin(&area->uiblocks)-10.0f;
-
- G.buts->v2d.tot.ymin= MIN2(0.0f, blocksmin-10.0f);
-}
-
-static void init_butspace(ScrArea *sa)
-{
- SpaceButs *buts;
-
- buts= MEM_callocN(sizeof(SpaceButs), "initbuts");
- BLI_addhead(&sa->spacedata, buts);
-
- buts->spacetype= SPACE_BUTS;
- buts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK;
-
- /* set_rects only does defaults, so after reading a file the cur has not changed */
- set_rects_butspace(buts);
- buts->v2d.cur= buts->v2d.tot;
-
- buts->ri = NULL;
-}
-
-void extern_set_butspace(int fkey, int do_cycle)
-{
- ScrArea *sa;
- SpaceButs *sbuts;
- Object *ob= OBACT;
-
- /* when a f-key pressed: 'closest' button window is initialized */
- if(curarea->spacetype==SPACE_BUTS) sa= curarea;
- else {
- /* find area */
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_BUTS) break;
- sa= sa->next;
- }
- }
-
- if(sa==NULL) return;
-
- if(sa!=curarea) areawinset(sa->win);
-
- sbuts= sa->spacedata.first;
- if(!do_cycle) sbuts->oldkeypress= 0;
-
- if(fkey==F4KEY) {
- sbuts->mainb= CONTEXT_LOGIC;
- }
- else if(fkey==F5KEY) {
- /* if it's already in shading context, cycle between tabs with the same key */
- if (sbuts->oldkeypress == F5KEY) {
-
- if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP)
- sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_MAT;
- else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT)
- sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_TEX;
- else if (sbuts->tab[CONTEXT_SHADING]==1) {
- sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_RAD;
- }
- else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_RAD)
- sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_WORLD;
- else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD)
- sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_LAMP;
- }
- /* if we're coming in from texture buttons,
- or from outside the shading context, just go to the 'default' */
- else if (ob) {
- sbuts->mainb= CONTEXT_SHADING;
-
- if(ob->type==OB_CAMERA)
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD;
- else if(ob->type==OB_LAMP)
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
- else
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
- }
- else {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
- }
- BIF_preview_changed(ID_TE);
- }
- else if(fkey==F6KEY) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX;
- BIF_preview_changed(ID_TE);
- }
- else if(fkey==F7KEY) {
- /* if it's already in object context, cycle between tabs with the same key */
- if (sbuts->oldkeypress == F7KEY) {
-
- if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_OBJECT)
- sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_PHYSICS;
- else if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_PHYSICS)
- sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_PARTICLE;
- else if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_PARTICLE)
- sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_OBJECT;
- }
- else sbuts->mainb= CONTEXT_OBJECT;
-
- }
- else if(fkey==F8KEY) {
- sbuts->mainb= CONTEXT_SHADING;
- sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD;
- BIF_preview_changed(ID_TE);
- }
- else if(fkey==F9KEY) sbuts->mainb= CONTEXT_EDITING;
- else if(fkey==F10KEY) {
- /* if it's already in scene context, cycle between tabs with the same key */
- if (sbuts->oldkeypress == F10KEY) {
- if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_RENDER)
- sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_SEQUENCER;
- else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_SEQUENCER)
- sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_ANIM;
- else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_ANIM)
- sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_SOUND;
- else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND)
- sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_RENDER;
- }
- else sbuts->mainb= CONTEXT_SCENE;
- }
-
- sbuts->oldkeypress = fkey;
-
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
-}
-
-/* ******************** SPACE: SEQUENCE ********************** */
-
-/* extern void drawseqspace(ScrArea *sa, void *spacedata); BIF_drawseq.h */
-
-static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceSeq *sseq= curarea->spacedata.first;
- View2D *v2d= &sseq->v2d;
- Sequence *last_seq = get_last_seq();
- float dx, dy;
- int doredraw= 0, cfra=0, first;
- short mval[2];
- short nr;
- short mousebut = L_MOUSE;
-
- if(curarea->win==0) return;
-
- if(val) {
- if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* grease-pencil defaults to leftmouse */
- if (event == LEFTMOUSE) {
- if(gpencil_do_paint(sa, L_MOUSE)) return;
- }
- else if (event == RIGHTMOUSE) {
- if(gpencil_do_paint(sa, R_MOUSE)) return;
- }
-
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- mousebut = L_MOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- mousebut = R_MOUSE;
- }
- }
-
- switch(event) {
- case LEFTMOUSE:
- if(sseq->mainb==0 && view2dmove(event)==0) {
-
- first= 1;
- set_special_seq_update(1);
-
- do {
- getmouseco_areawin(mval);
- areamouseco_to_ipoco(v2d, mval, &dx, &dy);
-
- cfra= (int)(dx+0.5f);
- if(cfra< 1) cfra= 1;
- /* else if(cfra> EFRA) cfra= EFRA; */
-
- if( cfra!=CFRA || first ) {
- first= 0;
-
- CFRA= cfra;
- force_draw_all(0);
- update_for_newframe(); /* for audio scrubbing */
- }
- else PIL_sleep_ms(30);
-
- } while(get_mbut() & mousebut);
-
- set_special_seq_update(0);
-
- if (cfra == 0)
- update_for_newframe();
- }
- break;
- case MIDDLEMOUSE:
- if(sseq->mainb) seq_viewmove(sseq);
- else view2dmove(event); /* in drawipo.c */
- break;
- case RIGHTMOUSE:
- if(sseq->mainb) break;
- mouse_select_seq();
- break;
- case PADPLUSKEY:
- if (G.qual==LR_CTRLKEY) {
- select_more_seq();
- break;
- }
- /* fall through */
- case WHEELUPMOUSE:
- if(sseq->mainb) {
- if (G.qual == LR_SHIFTKEY) {
- sseq->zoom += 0.10f;
- } else {
- sseq->zoom++;
- }
- if(sseq->zoom >= -1 && sseq->zoom < 1) {
- sseq->zoom += 2.0f;
- }
- if(sseq->zoom>8) sseq->zoom= 8;
- } else {
- if((G.qual==0)) {
- dx= 0.1154f*(v2d->cur.xmax-v2d->cur.xmin);
- v2d->cur.xmin+= dx;
- v2d->cur.xmax-= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(sa, V2D_LOCK_COPY);
- }
- }
- doredraw= 1;
- break;
- case PADMINUS:
- if (G.qual==LR_CTRLKEY) {
- select_less_seq();
- break;
- }
- /* fall through */
- case WHEELDOWNMOUSE:
- if(sseq->mainb) {
- if (G.qual == LR_SHIFTKEY) {
- sseq->zoom -= 0.10f;
- } else {
- sseq->zoom--;
- }
- if(sseq->zoom >= -1 && sseq->zoom < 1) {
- sseq->zoom -= 2.0f;
- }
- if(sseq->zoom<-8) sseq->zoom= -8;
- } else {
- if((G.qual==LR_SHIFTKEY))
- no_gaps();
- else if((G.qual==0)) {
- dx= 0.15f*(v2d->cur.xmax-v2d->cur.xmin);
- v2d->cur.xmin-= dx;
- v2d->cur.xmax+= dx;
- test_view2d(G.v2d, sa->winx, sa->winy);
- view2d_do_locks(sa, V2D_LOCK_COPY);
- }
- }
- doredraw= 1;
- break;
- case HOMEKEY:
- if((G.qual==0))
- seq_home();
- break;
- case PADPERIOD:
- if(last_seq) {
- int len = last_seq->enddisp - last_seq->startdisp;
- v2d->cur.xmin= last_seq->startdisp- (len/20);
- v2d->cur.xmax= last_seq->enddisp+ (len/20);
- update_for_newframe();
- }
- break;
-
- case AKEY:
- if (G.qual == LR_CTRLKEY) {
- deselect_markers(1, 0);
- allqueue(REDRAWMARKER, 0);
- } else {
- if(sseq->mainb) break;
- if((G.qual==LR_SHIFTKEY)) {
- add_sequence(-1);
- } else if((G.qual==0)) {
- swap_select_seq();
- }
- }
- break;
- case SPACEKEY:
- if (G.qual==0) {
- add_sequence(-1);
- }
- break;
- case BKEY:
- if(sseq->mainb) break;
- if((G.qual==0))
- borderselect_seq();
- break;
- case CKEY:
- if((G.qual==0)) {
- if(last_seq && (last_seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))) {
- if(last_seq->flag & SEQ_LEFTSEL) CFRA= last_seq->startdisp;
- else CFRA= last_seq->enddisp-1;
-
- dx= CFRA-(v2d->cur.xmax+v2d->cur.xmin)/2;
- v2d->cur.xmax+= dx;
- v2d->cur.xmin+= dx;
- update_for_newframe();
- }
- else
- change_sequence();
- }
- break;
- case DKEY:
- if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
- duplicate_marker();
- } else if ((G.qual==LR_SHIFTKEY)) {
- if(sseq->mainb) break;
- add_duplicate_seq();
- } else if (G.qual == 0) {
- set_filter_seq();
- }
- break;
- case EKEY:
- if(sseq->mainb) break;
- if((G.qual==0))
- transform_seq('e', 0);
- break;
- case GKEY:
- if (G.qual & LR_CTRLKEY)
- transform_markers('g', 0);
- else if (G.qual==0) {
- if(sseq->mainb) break;
- transform_seq('g', 0);
- }
- break;
- case KKEY: /* Cut at current frame */
- if((G.qual == LR_SHIFTKEY)) {
- seq_cut(CFRA, FALSE); /* soft cut */
- } else if((G.qual==0)) {
- seq_cut(CFRA, TRUE); /* hard cut */
- }
- break;
- case LKEY:
- if((G.qual==0)) {
- select_linked_seq( 0 );
- } else if((G.qual==LR_CTRLKEY)) {
- select_linked_seq( 2 );
- } else if (G.qual==LR_SHIFTKEY) {
- seq_lock_sel(1);
- } else if (G.qual==(LR_SHIFTKEY|LR_ALTKEY)) {
- seq_lock_sel(0);
- }
- break;
- case YKEY:
- if((G.qual==0)) { /* Cut at current frame */
- seq_separate_images();
- }
- break;
- case MKEY:
- if(G.qual==LR_ALTKEY) {
- un_meta();
- break; /*dont redraw timeline etc */
- } else if(G.qual == 0){
- make_meta();
- break; /*dont redraw timeline etc */
- } else if (G.qual == LR_SHIFTKEY) {
- seq_mute_sel(1);
- } else if (G.qual == (LR_SHIFTKEY|LR_ALTKEY)) {
- seq_mute_sel(0);
- } else if (G.qual == (LR_CTRLKEY|LR_ALTKEY)) {
- add_marker(CFRA);
- } else if (G.qual == LR_CTRLKEY) {
- rename_marker();
- } else {
- break; /* do nothing */
- }
- allqueue(REDRAWMARKER, 0);
- break;
- case NKEY:
- if(G.qual==0) {
- toggle_blockhandler(curarea, SEQ_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- scrarea_queue_winredraw(curarea);
- }
- break;
- case RKEY:
- if(G.qual==LR_SHIFTKEY)
- seq_remap_paths();
- if(G.qual==LR_ALTKEY)
- reload_sequence();
- else if (G.qual==0)
- reassign_inputs_seq_effect();
- break;
- case SKEY:
- if((G.qual==LR_SHIFTKEY))
- seq_snap_menu();
- break;
- case PKEY:
- if((G.qual==0))
- touch_seq_files();
- break;
- case TKEY: /* popup menu */
- nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
- if (nr>0) {
- if(nr==1) sseq->flag |= SEQ_DRAWFRAMES;
- else sseq->flag &= ~SEQ_DRAWFRAMES;
- doredraw= 1;
- }
- break;
- case HKEY: /* hide==mute? - not that nice but MKey us used for meta :/ */
- if((G.qual==0)) {
- seq_mute_sel(1);
- } else if(G.qual==LR_ALTKEY) {
- seq_mute_sel(0);
- } else if(G.qual==LR_SHIFTKEY) {
- seq_mute_sel(-1);
- }
- break;
- case XKEY:
- case DELKEY:
- if(G.qual==0) {
- if(sseq->mainb) break;
- if((G.qual==0))
- del_seq();
- }
- else if(G.qual==LR_ALTKEY) {
- if(sseq->mainb)
- gpencil_delete_menu();
- }
- else if(G.qual==LR_SHIFTKEY) {
- /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
- remove_marker();
- }
- break;
- case PAD1: case PAD2: case PAD4: case PAD8:
- seq_viewzoom(event, (G.qual & LR_SHIFTKEY)==0);
- doredraw= 1;
- break;
- }
- }
-
- if(doredraw) {
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea);
- }
-}
-
-
-static void init_seqspace(ScrArea *sa)
-{
- SpaceSeq *sseq;
-
- sseq= MEM_callocN(sizeof(SpaceSeq), "initseqspace");
- BLI_addhead(&sa->spacedata, sseq);
-
- sseq->spacetype= SPACE_SEQ;
- sseq->zoom= 4;
- sseq->blockscale= 0.7f;
- sseq->chanshown = 0;
-
- /* seq space goes from (0,8) to (250, 0) */
-
- sseq->v2d.tot.xmin= 0.0f;
- sseq->v2d.tot.ymin= 0.0f;
- sseq->v2d.tot.xmax= 250.0f;
- sseq->v2d.tot.ymax= 8.0f;
-
- sseq->v2d.cur= sseq->v2d.tot;
-
- sseq->v2d.min[0]= 10.0f;
- sseq->v2d.min[1]= 4.0f;
-
- sseq->v2d.max[0]= MAXFRAMEF;
- sseq->v2d.max[1]= MAXSEQ;
-
- sseq->v2d.minzoom= 0.01f;
- sseq->v2d.maxzoom= 100.0f;
-
- sseq->v2d.scroll= L_SCROLL+B_SCROLL;
- sseq->v2d.keepaspect= 0;
- sseq->v2d.keepzoom= 0;
- sseq->v2d.keeptot= 0;
-}
-
-/* ******************** SPACE: ACTION ********************** */
-extern void drawactionspace(ScrArea *sa, void *spacedata);
-extern void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void changeactionspace(ScrArea *sa, void *spacedata)
-{
- if(G.v2d==0) return;
-
- /* this sets the sub-areas correct, for scrollbars */
- test_view2d(G.v2d, sa->winx, sa->winy);
-
- /* action space uses weird matrices... local calculated in a function */
- /* myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); */
-}
-
-
-static void init_actionspace(ScrArea *sa)
-{
- SpaceAction *saction;
-
- saction= MEM_callocN(sizeof(SpaceAction), "initactionspace");
- BLI_addhead(&sa->spacedata, saction);
-
- saction->spacetype= SPACE_ACTION;
- saction->blockscale= 0.7f;
-
- saction->v2d.tot.xmin= 1.0f;
- saction->v2d.tot.ymin= -1000.0f;
- saction->v2d.tot.xmax= 1000.0f;
- saction->v2d.tot.ymax= 0.0f;
-
- saction->v2d.cur.xmin= -5.0f;
- saction->v2d.cur.ymin= -75.0f;
- saction->v2d.cur.xmax= 65.0f;
- saction->v2d.cur.ymax= 5.0f;
-
- saction->v2d.min[0]= 0.0f;
- saction->v2d.min[1]= 0.0f;
-
- saction->v2d.max[0]= MAXFRAMEF;
- saction->v2d.max[1]= 1000.0f;
-
- saction->v2d.minzoom= 0.01f;
- saction->v2d.maxzoom= 50;
-
- saction->v2d.scroll= R_SCROLL+B_SCROLL;
- saction->v2d.keepaspect= 0;
- saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
- saction->v2d.keeptot= 0;
-
- saction->autosnap = SACTSNAP_FRAME;
-}
-
-static void free_actionspace(SpaceAction *saction)
-{
- /* don't free saction itself */
-
- /* __PINFAKE */
-/* if (saction->flag & SACTION_PIN)
- if (saction->action)
- saction->action->id.us --;
-
-*/ /* end PINFAKE */
-}
-
-
-/* ******************** SPACE: FILE ********************** */
-
-static void init_filespace(ScrArea *sa)
-{
- SpaceFile *sfile;
-
- sfile= MEM_callocN(sizeof(SpaceFile), "initfilespace");
- BLI_addhead(&sa->spacedata, sfile);
-
- sfile->dir[0]= '/';
- sfile->type= FILE_UNIX;
- sfile->blockscale= 0.7f;
- sfile->spacetype= SPACE_FILE;
-}
-
-
-/* ******************** SPACE: SOUND ********************** */
-
-extern void drawsoundspace(ScrArea *sa, void *spacedata);
-extern void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void init_soundspace(ScrArea *sa)
-{
- SpaceSound *ssound;
-
- ssound= MEM_callocN(sizeof(SpaceSound), "initsoundspace");
- BLI_addhead(&sa->spacedata, ssound);
-
- ssound->spacetype= SPACE_SOUND;
- ssound->blockscale= 0.7f;
- /* sound space goes from (0,8) to (250, 0) */
-
- ssound->v2d.tot.xmin= -4.0f;
- ssound->v2d.tot.ymin= -4.0f;
- ssound->v2d.tot.xmax= 250.0f;
- ssound->v2d.tot.ymax= 255.0f;
-
- ssound->v2d.cur.xmin= -4.0f;
- ssound->v2d.cur.ymin= -4.0f;
- ssound->v2d.cur.xmax= 50.0f;
- ssound->v2d.cur.ymax= 255.0f;
-
- ssound->v2d.min[0]= 1.0f;
- ssound->v2d.min[1]= 259.0f;
-
- ssound->v2d.max[0]= MAXFRAMEF;
- ssound->v2d.max[1]= 259.0f;
-
- ssound->v2d.minzoom= 0.1f;
- ssound->v2d.maxzoom= 10.0f;
-
- ssound->v2d.scroll= B_SCROLL;
- ssound->v2d.keepaspect= 0;
- ssound->v2d.keepzoom= 0;
- ssound->v2d.keeptot= 0;
-
-}
-
-static void free_soundspace(SpaceSound *ssound)
-{
- /* don't free ssound itself */
-
-
-}
-
-/* ******************** SPACE: IMAGE ********************** */
-
-static void changeimagepace(ScrArea *sa, void *spacedata)
-{
- image_preview_event(2);
-}
-
-static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- SpaceImage *sima= spacedata;
- unsigned short event= evt->event;
- short val= evt->val;
-
- if(val==0) return;
-
- if(uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- /* grease-pencil drawing before draw-tool */
- if (event == LEFTMOUSE) {
- if (gpencil_do_paint(sa, L_MOUSE)) return;
- }
- else if (event == RIGHTMOUSE) {
- if (gpencil_do_paint(sa, R_MOUSE)) return;
- }
-
- if (sima->image && (sima->flag & SI_DRAWTOOL)) {
- switch(event) {
- case CKEY:
- toggle_blockhandler(sa, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
- scrarea_queue_winredraw(sa);
- break;
- case LEFTMOUSE:
- imagepaint_paint(L_MOUSE, 0);
- break;
- case RIGHTMOUSE:
- imagepaint_pick(R_MOUSE);
- break;
- }
- }
- else if (G.obedit) {
- if (U.flag & USER_LMOUSESELECT) {
- if (event == LEFTMOUSE) {
- event = RIGHTMOUSE;
- } else if (event == RIGHTMOUSE) {
- event = LEFTMOUSE;
- }
- }
-
- /* Draw tool is inactive, editmode is enabled and the image is not a render or composite */
- if (EM_texFaceCheck() && (G.sima->image==0 || (G.sima->image->type != IMA_TYPE_R_RESULT && G.sima->image->type != IMA_TYPE_COMPOSITE))) {
- switch(event) {
- case LEFTMOUSE:
- if(G.qual == LR_SHIFTKEY) {
- if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) {
- mouseco_to_curtile();
- }
- } else if (!gesture()) {
- mouseco_to_cursor_sima();
- }
- break;
- case RIGHTMOUSE:
- mouse_select_sima();
- break;
- case AKEY:
- if(G.qual==0) {
- select_swap_tface_uv();
- } else if(G.qual==LR_CTRLKEY) {
- average_charts_tface_uv();
- }
- break;
- case BKEY:
- if(G.qual==LR_SHIFTKEY)
- borderselect_sima(UV_SELECT_PINNED);
- else if((G.qual==0))
- borderselect_sima(UV_SELECT_ALL);
- break;
- case CKEY:
- if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
- if(G.qual==LR_CTRLKEY) {
- G.sima->sticky = SI_STICKY_VERTEX;
- scrarea_do_headdraw(curarea);
- } else if(G.qual==LR_SHIFTKEY) {
- G.sima->sticky = SI_STICKY_DISABLE;
- scrarea_do_headdraw(curarea);
- } else if(G.qual==LR_ALTKEY) {
- G.sima->sticky = SI_STICKY_LOC;
- scrarea_do_headdraw(curarea);
- } else {
- G.sima->flag ^= SI_SELACTFACE;
- scrarea_queue_winredraw(curarea);
- scrarea_queue_headredraw(curarea); /* for the header face buttons */
- }
- }
- break;
- case EKEY :
- if(okee("Unwrap"))
- unwrap_lscm(0);
- break;
- case HKEY:
- if(G.qual==LR_ALTKEY)
- reveal_tface_uv();
- else if((G.qual==LR_SHIFTKEY))
- hide_tface_uv(1);
- else if((G.qual==0))
- hide_tface_uv(0);
- break;
- case IKEY:
- if(G.qual==LR_CTRLKEY)
- select_invert_tface_uv();
- break;
- case LKEY:
- if(G.qual==0)
- select_linked_tface_uv(0);
- else if(G.qual==LR_SHIFTKEY)
- select_linked_tface_uv(1);
- else if(G.qual==LR_CTRLKEY)
- select_linked_tface_uv(2);
- else if(G.qual==LR_ALTKEY)
- unlink_selection();
- break;
- case PKEY:
- if(G.qual==LR_CTRLKEY)
- pack_charts_tface_uv();
- else if(G.qual==LR_SHIFTKEY)
- select_pinned_tface_uv();
- else if(G.qual==LR_ALTKEY)
- pin_tface_uv(0);
- else
- pin_tface_uv(1);
- break;
- case GKEY:
- if((G.qual==0) && is_uv_tface_editing_allowed()) {
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- }
- break;
- case RKEY:
- if((G.qual==0) && is_uv_tface_editing_allowed()) {
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- }
- break;
- case SKEY:
- if (is_uv_tface_editing_allowed()) {
- if ( G.qual==LR_SHIFTKEY) {
- /* Snap */
- snap_menu_sima();
- } else if (G.qual==0) {
- initTransform(TFM_RESIZE, CTX_NONE);
- Transform();
- }
- }
- break;
- case VKEY:
- if(G.qual == 0)
- stitch_vert_uv_tface();
- else if(G.qual==LR_SHIFTKEY)
- stitch_limit_uv_tface();
- else if(G.qual==LR_CTRLKEY)
- minimize_stretch_tface_uv();
- break;
- case WKEY:
- weld_align_menu_tface_uv();
- break;
- case MKEY:
- if((G.qual==0))
- mirrormenu_tface_uv();
- break;
- case COMMAKEY:
- if(G.qual==LR_SHIFTKEY) {
- G.v2d->around= V3D_CENTROID;
- } else if(G.qual==0) {
- G.v2d->around= V3D_CENTER;
- }
-
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
- case PERIODKEY:
- if(G.qual==LR_CTRLKEY) {
- G.v2d->around= V3D_LOCAL;
- } else if(G.qual==0) {
- G.v2d->around= V3D_CURSOR;
- }
- scrarea_queue_headredraw(curarea);
- scrarea_queue_winredraw(curarea);
- break;
- case PADPERIOD:
- if(G.qual==0)
- image_viewcenter();
- break;
- case OKEY:
- if(G.qual==0) {
- G.scene->proportional= !G.scene->proportional;
- allqueue(REDRAWHEADERS, 0);
- } else if (G.qual==LR_SHIFTKEY) {
- G.scene->prop_mode = (G.scene->prop_mode+1)%7;
- allqueue(REDRAWHEADERS, 0);
- }
- break;
- case PADSLASHKEY:
- if(G.qual==0)
- G.sima->flag ^= SI_LOCAL_UV;
- scrarea_queue_winredraw(curarea);
- break;
- case TABKEY:
- if (G.qual == LR_SHIFTKEY) {
- G.scene->snap_flag ^= SCE_SNAP;
- allqueue(REDRAWHEADERS, 0);
- }
- break;
- }
- }
- } else {
- /* Draw and editmode are inactive */
- switch(event) {
- case LEFTMOUSE:
- sima_sample_color();
- break;
- case RIGHTMOUSE:
- if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))
- sample_vpaint();
- break;
- case NKEY:
- if(G.qual==LR_CTRLKEY)
- replace_names_but();
- break;
- case PKEY:
- if(G.qual==LR_SHIFTKEY) {
- toggle_blockhandler(sa, IMAGE_HANDLER_PREVIEW, 0);
- scrarea_queue_winredraw(sa);
- }
- break;
- }
- }
-
-
- /* least intrusive nonumpad hack, only for plus/minus */
- if (U.flag & USER_NONUMPAD) {
- event= convert_for_nonumpad(event);
- }
-
- /* Events handled always (whether the draw tool is active or not) */
- switch (event) {
- case UI_BUT_EVENT:
- do_image_buttons(val); /* header_image.c */
- break;
- case MIDDLEMOUSE:
- if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
- image_viewmove(1);
- else
- image_viewmove(0);
- break;
- case WHEELUPMOUSE: case WHEELDOWNMOUSE: case PADPLUSKEY: case PADMINUS:
- case PAD1: case PAD2: case PAD4: case PAD8:
- image_viewzoom(event, (G.qual & LR_SHIFTKEY)==0);
- scrarea_queue_winredraw(sa);
- break;
- case HOMEKEY:
- if((G.qual==0))
- image_home();
-
- break;
- case NKEY:
- if(G.qual==LR_ALTKEY) {
- new_image_sima();
- } else if(G.qual==0) {
- /*if (EM_texFaceCheck()) {
- toggle_blockhandler(sa, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_TO_MOUSE);
- } else {
- toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- }*/
- toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
- scrarea_queue_winredraw(sa);
- }
- break;
- case OKEY:
- if (G.qual & LR_ALTKEY)
- open_image_sima(G.qual & LR_CTRLKEY);
- break;
- case RKEY:
- if(G.qual==LR_ALTKEY)
- reload_image_sima();
- break;
- case SKEY:
- if(G.qual & LR_ALTKEY)
- save_image_sima();
- break;
- case ESCKEY:
- if(sima->flag & SI_PREVSPACE) {
- /* only allow ESC once */
- sima->flag &= ~SI_PREVSPACE;
-
- sima= sa->spacedata.first;
- if(sima->next) {
- SpaceLink *sl;
-
- BLI_remlink(&sa->spacedata, sima);
- BLI_addtail(&sa->spacedata, sima);
-
- sl= sa->spacedata.first;
-
- newspace(sa, sl->spacetype);
- }
- }
- if(sima->flag & SI_FULLWINDOW) {
- sima->flag &= ~SI_FULLWINDOW;
- if(sa->full)
- area_fullscreen();
- }
- }
-}
-
-
-static void init_imagespace(ScrArea *sa)
-{
- SpaceImage *sima;
-
- sima= MEM_callocN(sizeof(SpaceImage), "initimaspace");
- BLI_addhead(&sa->spacedata, sima);
-
- sima->spacetype= SPACE_IMAGE;
- sima->zoom= 1;
- sima->blockscale= 0.7f;
-
- sima->iuser.ok= 1;
- sima->iuser.fie_ima= 2;
- sima->iuser.frames= 100;
-}
-
-
-/* ******************** SPACE: IMASEL ********************** */
-
-extern void drawimaselspace(ScrArea *sa, void *spacedata);
-extern void winqreadimaselspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void changeimaselspace(ScrArea *sa, void *spacedata)
-{
- if(G.v2d==0) return;
-
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
-}
-
-static void init_imaselspace(ScrArea *sa)
-{
- SpaceImaSel *simasel;
-
- simasel= MEM_callocN(sizeof(SpaceImaSel), "init imaselspace");
- BLI_addhead(&sa->spacedata, simasel);
-
- simasel->spacetype= SPACE_IMASEL;
- simasel->blockscale= 0.7;
-
- /* view 2D */
- simasel->v2d.tot.xmin= -10.0f;
- simasel->v2d.tot.ymin= -10.0f;
- simasel->v2d.tot.xmax= (float)sa->winx + 10.0f;
- simasel->v2d.tot.ymax= (float)sa->winy + 10.0f;
-
- simasel->v2d.cur.xmin= 0.0f;
- simasel->v2d.cur.ymin= 0.0f;
- simasel->v2d.cur.xmax= (float)sa->winx;
- simasel->v2d.cur.ymax= (float)sa->winy;
-
- simasel->v2d.min[0]= 1.0f;
- simasel->v2d.min[1]= 1.0f;
-
- simasel->v2d.max[0]= 32000.0f;
- simasel->v2d.max[1]= 32000.0f;
-
- simasel->v2d.minzoom= 0.5f;
- simasel->v2d.maxzoom= 1.21f;
-
- simasel->v2d.scroll= 0;
- simasel->v2d.keepaspect= 1;
- simasel->v2d.keepzoom= 1;
- simasel->v2d.keeptot= 0;
-
- simasel->prv_h = 96;
- simasel->prv_w = 96;
-
- simasel->flag = 7; /* ??? elubie */
- strcpy (simasel->dir, U.textudir); /* TON */
- strcpy (simasel->file, "");
-
- simasel->returnfunc = 0;
- simasel->title[0] = 0;
- simasel->type = FILE_UNIX;
- simasel->files = BIF_filelist_new();
-}
-
-
-/* ******************** SPACE: OOPS ********************** */
-
-extern void drawoopsspace(ScrArea *sa, void *spacedata);
-
-static void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
-{
- unsigned short event= evt->event;
- short val= evt->val;
- SpaceOops *soops= curarea->spacedata.first;
- View2D *v2d= &soops->v2d;
- float dx, dy;
-
- if(val==0) return;
-
- if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0;
-
- if (U.flag & USER_NONUMPAD) {
- event= convert_for_nonumpad(event);
- }
-
- /* keep leftmouse select for outliner, regardless of user pref */
- if(soops->type==SO_OUTLINER) {
- switch(event) {
- case LEFTMOUSE:
- case RIGHTMOUSE:
- outliner_mouse_event(sa, event);
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- soops->storeflag |= SO_TREESTORE_REDRAW;
- break;
-
- case AKEY:
- if(G.qual==LR_SHIFTKEY)
- outliner_toggle_selected(sa);
- else
- outliner_toggle_visible(sa);
- break;
- case FKEY:
- {
- /* search */
- int search_flags=0, again=0;
-
- /* CTRL=case sensitive, SHIFT=find again, ALT=complete */
- if (G.qual & LR_CTRLKEY) search_flags |= 1;
- if (G.qual & LR_ALTKEY) search_flags |= 8;
- if (G.qual & LR_SHIFTKEY) again = 1;
-
- outliner_find_panel(sa, again, search_flags);
- }
- break;
- case RKEY:
- outliner_toggle_renderability(sa);
- break;
- case SKEY:
- outliner_toggle_selectability(sa);
- break;
- case VKEY:
- outliner_toggle_visibility(sa);
- break;
- case XKEY:
- case DELKEY:
- outliner_del(sa);
- break;
- case WKEY:
- outliner_operation_menu(sa);
- break;
-
- case HOMEKEY:
- outliner_show_hierarchy(sa);
- break;
- case PAGEUPKEY:
- outliner_page_up_down(sa, 1);
- break;
- case PAGEDOWNKEY:
- outliner_page_up_down(sa, -1);
- break;
-
- case RETKEY:
- case PADENTER:
- outliner_mouse_event(sa, event);
- break;
- case PERIODKEY:
- case PADPERIOD:
- outliner_show_active(sa);
- break;
- case PADPLUSKEY:
- outliner_one_level(sa, 1);
- break;
- case PADMINUS:
- outliner_one_level(sa, -1);
- break;
- }
- }
- else {
- /* swap mouse buttons based on user preference */
- if (U.flag & USER_LMOUSESELECT) {
- if (event==LEFTMOUSE) event = RIGHTMOUSE;
- else if (event==RIGHTMOUSE) event = LEFTMOUSE;
- }
-
- switch(event) {
- case LEFTMOUSE:
- gesture();
- break;
- case MIDDLEMOUSE:
- case WHEELUPMOUSE:
- case WHEELDOWNMOUSE:
- view2dmove(event); /* in drawipo.c */
- break;
- case RIGHTMOUSE:
- mouse_select_oops();
- break;
- case PADPLUSKEY:
-
- dx= 0.1154f*(v2d->cur.xmax-v2d->cur.xmin);
- dy= 0.1154f*(v2d->cur.ymax-v2d->cur.ymin);
- v2d->cur.xmin+= dx;
- v2d->cur.xmax-= dx;
- v2d->cur.ymin+= dy;
- v2d->cur.ymax-= dy;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- break;
-
- case PADMINUS:
-
- dx= 0.15f*(v2d->cur.xmax-v2d->cur.xmin);
- dy= 0.15f*(v2d->cur.ymax-v2d->cur.ymin);
- v2d->cur.xmin-= dx;
- v2d->cur.xmax+= dx;
- v2d->cur.ymin-= dy;
- v2d->cur.ymax+= dy;
- test_view2d(G.v2d, curarea->winx, curarea->winy);
- scrarea_queue_winredraw(curarea);
- break;
-
- case HOMEKEY:
- if((G.qual==0))
- do_oops_buttons(B_OOPSHOME);
- break;
-
- case PADPERIOD:
- if((G.qual==0))
- do_oops_buttons(B_OOPSVIEWSEL);
- break;
-
- case AKEY:
- if((G.qual==0)) {
- swap_select_all_oops();
- scrarea_queue_winredraw(curarea);
- }
- break;
- case BKEY:
- if((G.qual==0))
- borderselect_oops();
- break;
- case GKEY:
- if((G.qual==0))
- transform_oops('g', 0);
- break;
- case LKEY:
- if((G.qual==LR_SHIFTKEY))
- select_backlinked_oops();
- else if((G.qual==0))
- select_linked_oops();
- break;
- case SKEY:
- if((G.qual==LR_ALTKEY)) {
- if (okee("Shrink blocks")) {
- shrink_oops();
- }
- } else if((G.qual==LR_SHIFTKEY)) {
- if (okee("Shuffle blocks")) {
- shuffle_oops();
- }
- } else if((G.qual==0)) {
- transform_oops('s', 0);
- }
- break;
- case PKEY:
- if((G.qual==LR_CTRLKEY)) {
- make_parent();
- } else if((G.qual==LR_ALTKEY)) {
- clear_parent();
- }
- break;
-
-
- case ONEKEY:
- do_layer_buttons(0); break;
- case TWOKEY:
- do_layer_buttons(1); break;
- case THREEKEY:
- do_layer_buttons(2); break;
- case FOURKEY:
- do_layer_buttons(3); break;
- case FIVEKEY:
- do_layer_buttons(4); break;
- case SIXKEY:
- do_layer_buttons(5); break;
- case SEVENKEY:
- do_layer_buttons(6); break;
- case EIGHTKEY:
- do_layer_buttons(7); break;
- case NINEKEY:
- do_layer_buttons(8); break;
- case ZEROKEY:
- do_layer_buttons(9); break;
- case MINUSKEY:
- do_layer_buttons(10); break;
- case EQUALKEY:
- do_layer_buttons(11); break;
- case ACCENTGRAVEKEY:
- do_layer_buttons(-1); break;
-
- }
- }
-}
-
-void init_v2d_oops(ScrArea *sa, SpaceOops *soops)
-{
- View2D *v2d= &soops->v2d;
-
- if(soops->type==SO_OUTLINER) {
- /* outliner space is window size */
- calc_scrollrcts(sa, v2d, sa->winx, sa->winy);
-
- v2d->tot.xmax= (float)(v2d->mask.xmax-v2d->mask.xmin);
- v2d->tot.ymax= (float)(v2d->mask.ymax-v2d->mask.ymin);
- v2d->tot.xmin= 0.0f;
- v2d->tot.ymin= 0.0f;
-
- v2d->cur= v2d->tot;
-
- v2d->min[0]= v2d->tot.xmin;
- v2d->min[1]= v2d->tot.ymin;
-
- v2d->max[0]= v2d->tot.xmax;
- v2d->max[1]= v2d->tot.ymax;
-
- v2d->minzoom= 1.0f;
- v2d->maxzoom= 1.0f;
-
- /* B_SCROLLO used here instead of B_SCROLL, to stop old blender's hanging on
- * loading a file from a version with horizontal scrolling due to an old bug
- */
- v2d->scroll= L_SCROLL+B_SCROLLO;
- v2d->keepaspect= 1;
- v2d->keepzoom= 1;
-
- /* NOTE: keeptot is 2, as keeptot!=0 makes sure it does get
- * too freely scrolled on x-axis, but keeptot=1 will result
- * in a snap-back when clicking on elements
- */
- v2d->keeptot= 2;
- }
- else {
- v2d->tot.xmin= -28.0f;
- v2d->tot.xmax= 28.0f;
- v2d->tot.ymin= -28.0f;
- v2d->tot.ymax= 28.0f;
-
- v2d->cur= v2d->tot;
-
- v2d->min[0]= 10.0f;
- v2d->min[1]= 4.0f;
-
- v2d->max[0]= 320.0f;
- v2d->max[1]= 320.0f;
-
- v2d->minzoom= 0.01f;
- v2d->maxzoom= 2.0f;
-
- /* v2d->scroll= L_SCROLL+B_SCROLL; */
- v2d->scroll= 0;
- v2d->keepaspect= 1;
- v2d->keepzoom= 0;
- v2d->keeptot= 0;
- }
-}
-
-static void init_oopsspace(ScrArea *sa)
-{
- SpaceOops *soops;
-
- soops= MEM_callocN(sizeof(SpaceOops), "initoopsspace");
- BLI_addhead(&sa->spacedata, soops);
-
- soops->visiflag= OOPS_OB|OOPS_MA|OOPS_ME|OOPS_TE|OOPS_CU|OOPS_IP;
- /* new oops is default an outliner */
- soops->type= SO_OUTLINER;
-
- soops->spacetype= SPACE_OOPS;
- soops->blockscale= 0.7f;
- init_v2d_oops(sa, soops);
-}
-
-/* ******************** SPACE: NLA ********************** */
-
-static void init_nlaspace(ScrArea *sa)
-{
- SpaceNla *snla;
-
- snla= MEM_callocN(sizeof(SpaceNla), "initnlaspace");
- BLI_addhead(&sa->spacedata, snla);
-
- snla->spacetype= SPACE_NLA;
- snla->blockscale= 0.7f;
-
- snla->v2d.tot.xmin= 1.0f;
- snla->v2d.tot.ymin= 0.0f;
- snla->v2d.tot.xmax= 1000.0f;
- snla->v2d.tot.ymax= 1000.0f;
-
- snla->v2d.cur.xmin= -5.0f;
- snla->v2d.cur.ymin= 0.0f;
- snla->v2d.cur.xmax= 65.0f;
- snla->v2d.cur.ymax= 1000.0f;
-
- snla->v2d.min[0]= 0.0f;
- snla->v2d.min[1]= 0.0f;
-
- snla->v2d.max[0]= MAXFRAMEF;
- snla->v2d.max[1]= 1000.0f;
-
- snla->v2d.minzoom= 0.1f;
- snla->v2d.maxzoom= 50.0f;
-
- snla->v2d.scroll= R_SCROLL+B_SCROLL;
- snla->v2d.keepaspect= 0;
- snla->v2d.keepzoom= V2D_LOCKZOOM_Y;
- snla->v2d.keeptot= 0;
-
- snla->lock = 0;
-}
-
-
-
-/* ******************** SPACE: Text ********************** */
-
-extern void drawtextspace(ScrArea *sa, void *spacedata);
-extern void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void init_textspace(ScrArea *sa)
-{
- SpaceText *st;
-
- st= MEM_callocN(sizeof(SpaceText), "inittextspace");
- BLI_addhead(&sa->spacedata, st);
-
- st->spacetype= SPACE_TEXT;
- st->blockscale= 0.7f;
- st->text= NULL;
- st->flags= 0;
-
- st->font_id= 5;
- st->lheight= 12;
- st->showlinenrs= 0;
- st->tabnumber = 4;
- st->showsyntax= 0;
- st->doplugins= 0;
- st->overwrite= 0;
- st->wordwrap= 0;
- st->currtab_set = 0;
-
- st->top= 0;
-}
-
-
-/* ******************** SPACE: Script ********************** */
-
-extern void drawscriptspace(ScrArea *sa, void *spacedata);
-extern void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void init_scriptspace(ScrArea *sa)
-{
- SpaceScript *sc;
-
- sc = MEM_callocN(sizeof(SpaceScript), "initscriptspace");
- BLI_addhead(&sa->spacedata, sc);
-
- sc->spacetype = SPACE_SCRIPT;
- sc->blockscale= 0.7f;
- sc->script = NULL;
- sc->flags = 0;
-}
-
-
-/* ******************** SPACE: Time ********************** */
-
-extern void drawtimespace(ScrArea *sa, void *spacedata);
-extern void winqreadtimespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void init_timespace(ScrArea *sa)
-{
- SpaceTime *stime;
-
- stime= MEM_callocN(sizeof(SpaceTime), "init timespace");
- BLI_addhead(&sa->spacedata, stime);
-
- stime->spacetype= SPACE_TIME;
- stime->blockscale= 0.7f;
- stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
-
- stime->v2d.tot.xmin= -4.0f;
- stime->v2d.tot.ymin= 0.0f;
- stime->v2d.tot.xmax= (float)EFRA + 4.0;
- stime->v2d.tot.ymax= (float)sa->winy;
-
- stime->v2d.cur= stime->v2d.tot;
-
- stime->v2d.min[0]= 1.0f;
- stime->v2d.min[1]= (float)sa->winy;
-
- stime->v2d.max[0]= MAXFRAMEF;
- stime->v2d.max[1]= (float)sa->winy;
-
- stime->v2d.minzoom= 0.1f;
- stime->v2d.maxzoom= 10.0f;
-
- stime->v2d.scroll= 0;
- stime->v2d.keepaspect= 0;
- stime->v2d.keepzoom= 0;
- stime->v2d.keeptot= 0;
-
- stime->flag |= TIME_DRAWFRAMES;
-
-}
-
-/* ******************** SPACE: Nodes ********************** */
-
-extern void drawnodespace(ScrArea *sa, void *spacedata);
-extern void winqreadnodespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
-
-static void init_nodespace(ScrArea *sa)
-{
- SpaceNode *snode;
-
- snode= MEM_callocN(sizeof(SpaceNode), "init nodespace");
- BLI_addhead(&sa->spacedata, snode);
-
- snode->spacetype= SPACE_NODE;
- snode->blockscale= 0.7f;
-
- snode->v2d.tot.xmin= -10.0f;
- snode->v2d.tot.ymin= -10.0f;
- snode->v2d.tot.xmax= (float)sa->winx + 10.0f;
- snode->v2d.tot.ymax= (float)sa->winy + 10.0f;
-
- snode->v2d.cur.xmin= 0.0f;
- snode->v2d.cur.ymin= 0.0f;
- snode->v2d.cur.xmax= (float)sa->winx;
- snode->v2d.cur.ymax= (float)sa->winy;
-
- snode->v2d.min[0]= 1.0f;
- snode->v2d.min[1]= 1.0f;
-
- snode->v2d.max[0]= 32000.0f;
- snode->v2d.max[1]= 32000.0f;
-
- snode->v2d.minzoom= 0.5f;
- snode->v2d.maxzoom= 1.21f;
-
- snode->v2d.scroll= 0;
- snode->v2d.keepaspect= 1;
- snode->v2d.keepzoom= 1;
- snode->v2d.keeptot= 0;
-}
-
-
-
-/* ******************** SPACE: GENERAL ********************** */
-
-void newspace(ScrArea *sa, int type)
-{
- int xtra= type & 256; /* hack to enforce outliner with hotkey from toets.c */
-
- type &= ~256;
-
- if(type>=0) {
- if(sa->spacetype != type) {
- SpaceLink *sl;
-
- sa->spacetype= type;
- sa->headbutofs= 0;
-
- uiFreeBlocks(&sa->uiblocks);
- wich_cursor(sa);
-
- if (sa->headwin) addqueue(sa->headwin, CHANGED, 1);
- scrarea_queue_headredraw(sa);
-
- addqueue(sa->win, CHANGED, 1);
- scrarea_queue_winredraw(sa);
-
- for (sl= sa->spacedata.first; sl; sl= sl->next)
- if(sl->spacetype==type)
- break;
-
- if (sl) {
- BLI_remlink(&sa->spacedata, sl);
- BLI_addhead(&sa->spacedata, sl);
- } else {
- if(type==SPACE_VIEW3D)
- initview3d(sa);
- else if(type==SPACE_IPO)
- initipo(sa);
- else if(type==SPACE_INFO)
- init_infospace(sa);
- else if(type==SPACE_BUTS)
- init_butspace(sa);
- else if(type==SPACE_FILE)
- init_filespace(sa);
- else if(type==SPACE_SEQ)
- init_seqspace(sa);
- else if(type==SPACE_IMAGE)
- init_imagespace(sa);
- else if(type==SPACE_IMASEL)
- init_imaselspace(sa);
- else if(type==SPACE_OOPS)
- init_oopsspace(sa);
- else if(type==SPACE_ACTION)
- init_actionspace(sa);
- else if(type==SPACE_TEXT)
- init_textspace(sa);
- else if(type==SPACE_SCRIPT)
- init_scriptspace(sa);
- else if(type==SPACE_SOUND)
- init_soundspace(sa);
- else if(type==SPACE_NLA)
- init_nlaspace(sa);
- else if(type==SPACE_TIME)
- init_timespace(sa);
- else if(type==SPACE_NODE)
- init_nodespace(sa);
-
- sl= sa->spacedata.first;
- sl->area= sa;
- }
-
- areawinset(sa->win);
- bwin_clear_viewmat(sa->win);
- }
- }
-
- if(sa->spacetype==SPACE_OOPS) {
- SpaceOops *so= sa->spacedata.first;
- if(xtra && so->type!=SO_OUTLINER) {
- so->type= SO_OUTLINER;
- init_v2d_oops(sa, so);
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
-}
-
-void freespacelist(ScrArea *sa)
-{
- SpaceLink *sl;
-
- for (sl= sa->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_FILE) {
- SpaceFile *sfile= (SpaceFile*) sl;
- if(sfile->libfiledata)
- BLO_blendhandle_close(sfile->libfiledata);
- if(sfile->filelist)
- freefilelist(sfile);
- if(sfile->pupmenu)
- MEM_freeN(sfile->pupmenu);
- }
- else if(sl->spacetype==SPACE_BUTS) {
- SpaceButs *buts= (SpaceButs*) sl;
- if(buts->ri) {
- if (buts->ri->rect) MEM_freeN(buts->ri->rect);
- MEM_freeN(buts->ri);
- }
- if(G.buts==buts) G.buts= NULL;
- }
- else if(sl->spacetype==SPACE_IPO) {
- SpaceIpo *si= (SpaceIpo*) sl;
- if(si->editipo) MEM_freeN(si->editipo);
- free_ipokey(&si->ipokey);
- if(G.sipo==si) G.sipo= NULL;
- }
- else if(sl->spacetype==SPACE_VIEW3D) {
- View3D *vd= (View3D*) sl;
- if(vd->bgpic) {
- if(vd->bgpic->ima) vd->bgpic->ima->id.us--;
- MEM_freeN(vd->bgpic);
- }
- if(vd->gpd) free_gpencil_data(vd->gpd);
- if(vd->localvd) MEM_freeN(vd->localvd);
- if(vd->clipbb) MEM_freeN(vd->clipbb);
- if(vd->depths) {
- if(vd->depths->depths) MEM_freeN(vd->depths->depths);
- MEM_freeN(vd->depths);
- vd->depths= NULL;
- }
- retopo_free_view_data(vd);
- if(vd->properties_storage) MEM_freeN(vd->properties_storage);
- if(G.vd==vd) G.vd= NULL;
- if(vd->ri) {
- BIF_view3d_previewrender_free(vd);
- }
- }
- else if(sl->spacetype==SPACE_OOPS) {
- SpaceOops *so= (SpaceOops *) sl;
- free_oopspace(so);
- }
- else if(sl->spacetype==SPACE_IMASEL) {
- SpaceImaSel *simasel= (SpaceImaSel*) sl;
- free_imasel(simasel);
- }
- else if(sl->spacetype==SPACE_ACTION) {
- free_actionspace((SpaceAction*)sl);
- }
- else if(sl->spacetype==SPACE_NLA){
-/* free_nlaspace((SpaceNla*)sl); */
- }
- else if(sl->spacetype==SPACE_TEXT) {
- free_textspace((SpaceText *)sl);
- }
- else if(sl->spacetype==SPACE_SCRIPT) {
- free_scriptspace((SpaceScript *)sl);
- }
- else if(sl->spacetype==SPACE_SOUND) {
- free_soundspace((SpaceSound *)sl);
- }
- else if(sl->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage *)sl;
- if(sima->cumap)
- curvemapping_free(sima->cumap);
- if(sima->gpd)
- free_gpencil_data(sima->gpd);
- }
- else if(sl->spacetype==SPACE_NODE) {
- SpaceNode *snode= (SpaceNode *)sl;
- if(snode->gpd) free_gpencil_data(snode->gpd);
- }
- else if(sl->spacetype==SPACE_SEQ) {
- SpaceSeq *sseq= (SpaceSeq *)sl;
- if(sseq->gpd) free_gpencil_data(sseq->gpd);
- }
- }
-
- BLI_freelistN(&sa->spacedata);
-}
-
-/* can be called for area-full, so it should keep interesting stuff */
-void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
-{
- SpaceLink *sl;
-
- duplicatelist(lb1, lb2);
-
- /* lb1 is copy from lb2, from lb2 we free stuff, rely on event system to properly re-alloc */
-
- sl= lb2->first;
- while(sl) {
- if(sl->spacetype==SPACE_FILE) {
- SpaceFile *sfile= (SpaceFile*) sl;
- sfile->libfiledata= NULL;
- sfile->filelist= NULL;
- sfile->pupmenu= NULL;
- sfile->menup= NULL;
- }
- else if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D*)sl;
- BIF_view3d_previewrender_free(v3d);
- v3d->depths= NULL;
- v3d->retopo_view_data= NULL;
- v3d->gpd= gpencil_data_duplicate(v3d->gpd);
- }
- else if(sl->spacetype==SPACE_OOPS) {
- SpaceOops *so= (SpaceOops *)sl;
- so->oops.first= so->oops.last= NULL;
- so->tree.first= so->tree.last= NULL;
- so->treestore= NULL;
- }
- else if(sl->spacetype==SPACE_IMASEL) {
- SpaceImaSel *simasel= (SpaceImaSel*) sl;
- simasel->pupmenu= NULL;
- simasel->menup= NULL;
- simasel->files = BIF_filelist_new();
- BIF_filelist_setdir(simasel->files, simasel->dir);
- BIF_filelist_settype(simasel->files, simasel->type);
- /* see SPACE_FILE - elubie */
- }
- else if(sl->spacetype==SPACE_NODE) {
- SpaceNode *snode= (SpaceNode *)sl;
- snode->nodetree= NULL;
- snode->gpd= gpencil_data_duplicate(snode->gpd);
- }
- else if(sl->spacetype==SPACE_SCRIPT) {
- SpaceScript *sc = ( SpaceScript * ) sl;
- sc->but_refs = NULL;
- }
- else if(sl->spacetype==SPACE_SEQ) {
- SpaceSeq *sseq= (SpaceSeq *)sl;
- sseq->gpd= gpencil_data_duplicate(sseq->gpd);
- }
- else if(sl->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage *)sl;
- sima->gpd= gpencil_data_duplicate(sima->gpd);
- }
- sl= sl->next;
- }
-
- /* but some things we copy */
-
- sl= lb1->first;
- while(sl) {
- sl->area= newarea;
-
- if(sl->spacetype==SPACE_BUTS) {
- SpaceButs *buts= (SpaceButs *)sl;
- buts->ri= NULL;
- }
- else if(sl->spacetype==SPACE_FILE) {
- SpaceFile *sfile= (SpaceFile*) sl;
- sfile->menup= NULL;
- }
- else if(sl->spacetype==SPACE_IPO) {
- SpaceIpo *si= (SpaceIpo *)sl;
- si->editipo= NULL;
- si->ipokey.first= si->ipokey.last= NULL;
- }
- else if(sl->spacetype==SPACE_VIEW3D) {
- View3D *vd= (View3D *)sl;
- if(vd->bgpic) {
- vd->bgpic= MEM_dupallocN(vd->bgpic);
- if(vd->bgpic->ima) vd->bgpic->ima->id.us++;
- }
- vd->clipbb= MEM_dupallocN(vd->clipbb);
- vd->ri= NULL;
- vd->properties_storage= NULL;
- }
- else if(sl->spacetype==SPACE_IMAGE) {
- SpaceImage *sima= (SpaceImage *)sl;
- if(sima->cumap)
- sima->cumap= curvemapping_copy(sima->cumap);
- }
- sl= sl->next;
- }
-
- /* again: from old View3D restore localview (because full) */
- sl= lb2->first;
- while(sl) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D*) sl;
- if(v3d->localvd) {
- restore_localviewdata(v3d);
- v3d->localvd= NULL;
- v3d->properties_storage= NULL;
- v3d->localview= 0;
- v3d->lay &= 0xFFFFFF;
- }
- }
- sl= sl->next;
- }
-}
-
-/* is called everywhere in blender */
-void allqueue(unsigned short event, short val)
-{
- ScrArea *sa;
- View3D *v3d;
- SpaceButs *buts;
- SpaceFile *sfile;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
-
- if(event==REDRAWALL) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- else if(sa->win != val) {
- switch(event) {
-
- case REDRAWHEADERS:
- scrarea_queue_headredraw(sa);
- break;
- case REDRAWVIEW3D:
- if(sa->spacetype==SPACE_VIEW3D) {
- scrarea_queue_winredraw(sa);
- if(val) scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWVIEW3D_Z:
- if(sa->spacetype==SPACE_VIEW3D) {
- v3d= sa->spacedata.first;
- if(v3d->drawtype==OB_SOLID) {
- scrarea_queue_winredraw(sa);
- if(val) scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWVIEW3D_IMAGE:
- if(sa->spacetype==SPACE_VIEW3D || sa->spacetype==SPACE_IMAGE) {
- scrarea_queue_winredraw(sa);
- if(val) scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWVIEWCAM:
- if(sa->spacetype==SPACE_VIEW3D) {
- v3d= sa->spacedata.first;
- if(v3d->persp==V3D_CAMOB) scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWINFO:
- if(sa->spacetype==SPACE_INFO) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWIMAGE:
- if(sa->spacetype==SPACE_IMAGE) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWIPO:
- if(sa->spacetype==SPACE_IPO) {
- SpaceIpo *si;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- if(val) {
- si= sa->spacedata.first;
- if (si->pin==0)
- si->blocktype= val;
- }
- }
- else if(sa->spacetype==SPACE_OOPS) {
- scrarea_queue_winredraw(sa);
- }
-
- break;
-
- case REDRAWBUTSALL:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWBUTSHEAD:
- if(sa->spacetype==SPACE_BUTS) {
- scrarea_queue_headredraw(sa);
- }
- break;
- case REDRAWSEQ:
- if(sa->spacetype==SPACE_SEQ) {
- addqueue(sa->win, CHANGED, 1);
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- /* fall through, since N-keys moved to
- Buttons */
- case REDRAWBUTSSCENE:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_SCENE) {
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSOBJECT:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_OBJECT) {
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSSHADING:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_SHADING) {
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSEDIT:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_EDITING) {
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSSCRIPT:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_SCRIPT) {
- buts->re_align= 1;
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
- case REDRAWBUTSLOGIC:
- if(sa->spacetype==SPACE_BUTS) {
- buts= sa->spacedata.first;
- if(buts->mainb==CONTEXT_LOGIC) {
- scrarea_queue_winredraw(sa);
- scrarea_queue_headredraw(sa);
- }
- }
- break;
-
- case REDRAWDATASELECT:
- if(sa->spacetype==SPACE_FILE) {
- sfile= sa->spacedata.first;
- if(sfile->type==FILE_MAIN) {
- freefilelist(sfile);
- scrarea_queue_winredraw(sa);
- }
- }
- else if(sa->spacetype==SPACE_OOPS) {
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWOOPS:
- if(sa->spacetype==SPACE_OOPS) {
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWNLA:
- if(sa->spacetype==SPACE_NLA) {
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
- case REDRAWACTION:
- if(sa->spacetype==SPACE_ACTION) {
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWTEXT:
- if(sa->spacetype==SPACE_TEXT) {
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWSCRIPT:
- if (sa->spacetype==SPACE_SCRIPT) {
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWSOUND:
- if(sa->spacetype==SPACE_SOUND) {
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWTIME:
- if(sa->spacetype==SPACE_TIME) {
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
- break;
- case REDRAWNODE:
- if(sa->spacetype==SPACE_NODE) {
- scrarea_queue_headredraw(sa);
- scrarea_queue_winredraw(sa);
- }
- break;
- case RECALC_COMPOSITE:
- if(sa->spacetype==SPACE_NODE) {
- addqueue(sa->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
- }
- break;
- case REDRAWANIM:
- if ELEM6(sa->spacetype, SPACE_IPO, SPACE_SOUND, SPACE_TIME, SPACE_NLA, SPACE_ACTION, SPACE_SEQ) {
- scrarea_queue_winredraw(sa);
- if(val) scrarea_queue_headredraw(sa);
- }
- case REDRAWMARKER: /* markers may not always match animation */
- if ELEM6(sa->spacetype, SPACE_TIME, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_SOUND, SPACE_SEQ) {
- scrarea_queue_winredraw(sa);
- if(val) scrarea_queue_headredraw(sa);
- }
- }
- }
- sa= sa->next;
- }
-}
-
-void allspace(unsigned short event, short val)
-{
- bScreen *sc;
-
- sc= G.main->screen.first;
- while(sc) {
- ScrArea *sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- switch(event) {
- case REMAKEIPO:
- if(sl->spacetype==SPACE_IPO) {
- SpaceIpo *si= (SpaceIpo *)sl;
- {
- if(si->editipo) MEM_freeN(si->editipo);
- si->editipo= 0;
- free_ipokey(&si->ipokey);
- }
- }
- break;
-
- case OOPS_TEST:
- if(sl->spacetype==SPACE_OOPS) {
- SpaceOops *so= (SpaceOops *)sl;
- so->flag |= SO_TESTBLOCKS;
- }
- break;
- }
-
- sl= sl->next;
- }
- sa= sa->next;
- }
- sc= sc->id.next;
- }
-}
-
-/* if header==1, then draw header for curarea too. Excepption for headerprint()... */
-void force_draw(int header)
-{
- /* draws all areas that show something identical to curarea */
- extern int afterqtest(short win, unsigned short evt); /*editscreen.c*/
- ScrArea *tempsa, *sa;
-
- scrarea_do_windraw(curarea);
- if(header) scrarea_do_headdraw(curarea);
-
- tempsa= curarea;
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa!=tempsa && sa->spacetype==tempsa->spacetype) {
- areawinset(sa->win);
- scrarea_do_windraw(sa);
- scrarea_do_headdraw(sa);
- }
- sa= sa->next;
- }
-
- screen_swapbuffers();
-
-#ifndef __APPLE__
- if(tempsa->spacetype==SPACE_VIEW3D) {
- /* de the afterqueuetest for backbuf draw */
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==SPACE_VIEW3D) {
- if(afterqtest(sa->win, BACKBUFDRAW)) {
- areawinset(sa->win);
- backdrawview3d(0);
- }
- }
- sa= sa->next;
- }
- }
-#endif
- if(curarea!=tempsa) areawinset(tempsa->win);
-
-}
-
-/* if header==1, then draw header for curarea too. Exception for headerprint()... */
-void force_draw_plus(int type, int header)
-{
- /* draws all areas that show something like curarea AND areas of 'type' */
- ScrArea *tempsa, *sa;
-
- scrarea_do_windraw(curarea);
- if(header) scrarea_do_headdraw(curarea);
-
- tempsa= curarea;
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa!=tempsa && (sa->spacetype==tempsa->spacetype || sa->spacetype==type)) {
- if(ELEM5(sa->spacetype, SPACE_VIEW3D, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION)) {
- areawinset(sa->win);
- scrarea_do_windraw(sa);
- scrarea_do_headdraw(sa);
- }
- }
- sa= sa->next;
- }
- if(curarea!=tempsa) areawinset(tempsa->win);
-
- screen_swapbuffers();
-}
-
-/* if header==1, then draw header for curarea too. Excepption for headerprint()... */
-void force_draw_all(int header)
-{
- /* redraws all */
- ScrArea *tempsa, *sa;
-
- tempsa= curarea;
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->headwin) {
- scrarea_do_headdraw(sa);
- if(sa!=curarea || header) scrarea_do_headchange(sa);
- }
- if(sa->win) {
- scrarea_do_windraw(sa);
- }
- sa= sa->next;
- }
- if(curarea!=tempsa) areawinset(tempsa->win);
-
- screen_swapbuffers();
-}
-
-/***/
-
-SpaceType *spaceaction_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Action");
- spacetype_set_winfuncs(st, NULL, drawactionspace, changeactionspace, winqreadactionspace);
- }
-
- return st;
-}
-SpaceType *spacebuts_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Buts");
- spacetype_set_winfuncs(st, NULL, drawbutspace, changebutspace, winqreadbutspace);
- }
-
- return st;
-}
-SpaceType *spacefile_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("File");
- spacetype_set_winfuncs(st, NULL, drawfilespace, NULL, winqreadfilespace);
- }
-
- return st;
-}
-SpaceType *spaceimage_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Image");
- spacetype_set_winfuncs(st, NULL, drawimagespace, changeimagepace, winqreadimagespace);
- }
-
- return st;
-}
-SpaceType *spaceimasel_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Imasel");
- spacetype_set_winfuncs(st, NULL, drawimaselspace, changeimaselspace, winqreadimaselspace);
- }
-
- return st;
-}
-SpaceType *spaceinfo_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Info");
- spacetype_set_winfuncs(st, NULL, drawinfospace, NULL, winqreadinfospace);
- }
-
- return st;
-}
-SpaceType *spaceipo_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Ipo");
- spacetype_set_winfuncs(st, NULL, drawipospace, changeview2dspace, winqreadipospace);
- }
-
- return st;
-}
-SpaceType *spacenla_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Nla");
- spacetype_set_winfuncs(st, NULL, drawnlaspace, changeview2dspace, winqreadnlaspace);
- }
-
- return st;
-}
-SpaceType *spaceoops_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Oops");
- spacetype_set_winfuncs(st, NULL, drawoopsspace, changeview2dspace, winqreadoopsspace);
- }
-
- return st;
-}
-SpaceType *spaceseq_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Sequence");
- spacetype_set_winfuncs(st, drawprefetchseqspace, drawseqspace, changeview2dspace, winqreadseqspace);
- }
-
- return st;
-}
-SpaceType *spacesound_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Sound");
- spacetype_set_winfuncs(st, NULL, drawsoundspace, changeview2dspace, winqreadsoundspace);
- }
-
- return st;
-}
-SpaceType *spacetext_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Text");
- spacetype_set_winfuncs(st, NULL, drawtextspace, NULL, winqreadtextspace);
- }
-
- return st;
-}
-
-static void spacescript_change(ScrArea *sa, void *spacedata)
-{
-#ifndef DISABLE_PYTHON
- SpaceScript *sc = (SpaceScript*) spacedata;
-
- /*clear all temp button references*/
- if (sc->but_refs) {
- BPy_Set_DrawButtonsList(sc->but_refs);
- BPy_Free_DrawButtonsList();
- sc->but_refs = NULL;
- }
-#endif
-}
-
-SpaceType *spacescript_get_type(void)
-{
- static SpaceType *st = NULL;
-
- if (!st) {
- st = spacetype_new("Script");
- spacetype_set_winfuncs(st, NULL, drawscriptspace, spacescript_change, winqreadscriptspace);
- }
-
- return st;
-}
-SpaceType *spaceview3d_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("View3D");
- spacetype_set_winfuncs(st, NULL, drawview3dspace, changeview3dspace, winqreadview3dspace);
- }
-
- return st;
-}
-SpaceType *spacetime_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Time");
- spacetype_set_winfuncs(st, NULL, drawtimespace, NULL, winqreadtimespace);
- }
-
- return st;
-}
-
-SpaceType *spacenode_get_type(void)
-{
- static SpaceType *st= NULL;
-
- if (!st) {
- st= spacetype_new("Node");
- spacetype_set_winfuncs(st, NULL, drawnodespace, changeview2dspace, winqreadnodespace);
- }
-
- return st;
-}
diff --git a/source/blender/src/spacetypes.c b/source/blender/src/spacetypes.c
deleted file mode 100644
index f15630e37d5..00000000000
--- a/source/blender/src/spacetypes.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "BLI_blenlib.h"
-
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BIF_gl.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_spacetypes.h"
-
-/***/
-
-struct _SpaceType {
- char name[32];
-
- SpacePrefetchDrawFP winprefetchdraw;
- SpaceDrawFP windraw;
- SpaceChangeFP winchange;
- SpaceHandleFP winhandle;
-};
-
-/* local prototypes ----------------------- */
-void scrarea_do_windraw(ScrArea *area);
-void scrarea_do_winchange(ScrArea *area);
-void scrarea_do_winhandle(ScrArea *area, BWinEvent *evt);
-
-SpaceType *spacetype_new(char *name)
-{
- SpaceType *st= calloc(1, sizeof(*st));
- BLI_strncpy(st->name, name, sizeof(st->name));
-
- return st;
-}
-
-void spacetype_set_winfuncs(SpaceType *st, SpacePrefetchDrawFP prefetchdraw, SpaceDrawFP draw, SpaceChangeFP change, SpaceHandleFP handle)
-{
- st->winprefetchdraw = prefetchdraw;
- st->windraw= draw;
- st->winchange= change;
- st->winhandle= handle;
-}
-
- /* gets SpaceType struct, but also has patch to initialize unknown spacetypes */
-
-static SpaceType *spacetype_from_area(ScrArea *area)
-{
- switch (area->spacetype) {
- case SPACE_ACTION: return spaceaction_get_type();
- case SPACE_BUTS: return spacebuts_get_type();
- case SPACE_FILE: return spacefile_get_type();
- case SPACE_IMAGE: return spaceimage_get_type();
- case SPACE_IMASEL: return spaceimasel_get_type();
- case SPACE_INFO: return spaceinfo_get_type();
- case SPACE_IPO: return spaceipo_get_type();
- case SPACE_NLA: return spacenla_get_type();
- case SPACE_OOPS: return spaceoops_get_type();
- case SPACE_SEQ: return spaceseq_get_type();
- case SPACE_SOUND: return spacesound_get_type();
- case SPACE_TEXT: return spacetext_get_type();
- case SPACE_SCRIPT: return spacescript_get_type();
- case SPACE_VIEW3D: return spaceview3d_get_type();
- case SPACE_TIME: return spacetime_get_type();
- case SPACE_NODE: return spacenode_get_type();
- default:
- newspace(area, SPACE_VIEW3D);
- return spaceview3d_get_type();
- return NULL;
- }
-}
-
-void scrarea_do_winprefetchdraw(ScrArea *area)
-{
- SpaceType *st= spacetype_from_area(area);
-
- areawinset(area->win);
-
- if(area->win && st->winprefetchdraw) {
- st->winprefetchdraw(area, area->spacedata.first);
- }
-}
-
-void scrarea_do_windraw(ScrArea *area)
-{
- SpaceType *st= spacetype_from_area(area);
-
- areawinset(area->win);
-
- if(area->win && st->windraw) {
- st->windraw(area, area->spacedata.first);
- }
- else {
- glClearColor(0.4375, 0.4375, 0.4375, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- }
-
- area->win_swap= WIN_BACK_OK;
-}
-void scrarea_do_winchange(ScrArea *area)
-{
- SpaceType *st= spacetype_from_area(area);
-
- areawinset(area->win);
-
- if (st->winchange) {
- st->winchange(area, area->spacedata.first);
- } else {
- if (!BLI_rcti_is_empty(&area->winrct)) {
- bwin_ortho2(area->win, -0.375, area->winrct.xmax-area->winrct.xmin-0.375, -0.375, area->winrct.ymax-area->winrct.ymin-0.375);
- glLoadIdentity();
- }
- }
-}
-void scrarea_do_winhandle(ScrArea *area, BWinEvent *evt)
-{
- SpaceType *st= spacetype_from_area(area);
-
- areawinset(area->win);
-
- if (st->winhandle) {
- st->winhandle(area, area->spacedata.first, evt);
- }
-}
diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c
deleted file mode 100644
index d6999563d8a..00000000000
--- a/source/blender/src/splash.jpg.c
+++ /dev/null
@@ -1,9036 +0,0 @@
-/* DataToC output of file <splash_jpg> */
-
-int datatoc_splash_jpg_size= 288981;
-char datatoc_splash_jpg[]= {
-137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1,245, 0,
- 0, 1, 26, 8, 6, 0, 0, 0, 8, 90,206, 70, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71,
- 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24,
- 0, 0, 0, 7,116, 73, 77, 69, 7,216, 10, 22, 11, 33, 15, 29, 14,195,147, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,189,119,
-152, 93, 71,125,255,255,154,114,206,185,109,171,118,213,165, 85, 47,150,132,229,222,177,177, 29,155, 0, 54,166,183,252, 32,201,
-151, 64, 10,249,133, 18, 72, 32, 33, 33,149,150, 56, 13, 8, 37, 36, 64, 2, 4,211,193,184,130,109,140, 45,217,170, 70, 86,177,
-186,180,146, 86,210,174,118,181,245,222,123,202,204,124,255, 56,231,222,189,187,146,108,131, 77,242,124,147,157,231,177, 87,123,
-239,222,115,102,230,204,157,247,231,253,254,148, 17,206, 57,231, 0, 67,218,180,203,254, 33,192, 1, 2, 11,128, 65, 2,160,178,
-247,157, 0, 11, 72,103,112, 2,192,226, 80, 88, 7, 74, 8,164, 19, 96, 35, 32, 6, 37,129, 0,107, 65,226,192, 57, 80, 18,139,
- 64, 90,129,115, 32,132, 3, 97, 64, 36, 56, 44, 2,133, 67, 2, 10,144,136,172, 91, 56, 11, 2,112, 50,253,137, 77,123,159,118,
- 22,156, 2, 33,113,217, 59, 0, 50,123, 11,199,248,171,245, 11,142,143,173, 62, 62,151, 93, 83, 0,120,217,248,106, 31,179,217,
- 88,107,189,148,217, 29,126,246,214,216,199,218,188,154,108,222, 21,105, 95, 5,224,144,152,236,111,107, 51, 34,236,248,115,106,
- 28,203,207,220,129,250, 85,211,103, 90,159,199,236,254,233,187, 22,225,116,237,165,244,125,153,174,153,218,114, 81, 19,230,120,
-226, 26,178, 13, 47,213,198, 53,225,222,162, 54,159,160,240,198,251, 38, 44, 9,178,222, 67, 1,168,236,121, 59, 84, 58, 63, 46,
- 91,185,206,203,134, 97,179,143,235, 73,143,185,113, 53, 52,188,230,100,195,186,146, 24,145,142, 75, 53,244,215, 53,204,145, 32,
-174,191,227, 26,215,229, 84,155,106,255, 29,205,157,227,245,169,133,249,223, 59,255,103, 60, 15, 59,233, 5, 57,105, 95,226, 44,
-251,211,211,220,167,113,159,158,244,172,245, 25,107, 64,100, 27,157, 3, 33,158,254, 86, 18, 16, 66,224,172, 69, 72,133,193,162,
-133, 70, 0, 54, 14,145, 42, 6, 55, 6, 81, 4, 50,135, 20, 1, 88, 13, 42,221,184,157,115, 32, 5,194,101, 61, 16,233,102,153,
- 2,186,192, 58,139, 20,103, 89,172,245,141,184,214,113, 1, 66,158, 49,192,179, 79,143,156, 0, 26, 96,145,245,255, 79,152,136,
- 51,174, 39, 38,117, 68, 62, 7, 64, 63,215, 99,148, 13,143, 89, 52, 0,123,237,110,226,249,252,210, 54,206,165,120,134,235,214,
-214,133, 56,251,101,196,211, 44, 60,217, 96, 58,184,108, 44,227,128, 62, 62,106,121,150, 47,129,104, 0,116, 57,193,170,200,174,
- 35, 92,106,141, 8, 89,191,159,251,185,102,126,226, 43,178,193,160, 21, 19,134, 38,158,254,203, 55,213,166,218, 84,251,223,211,
- 4, 63,203,134,115,142, 61,200,254,124,247, 61,199,126, 93, 39,230, 41,111,182, 19, 45, 8, 71,157,245, 10,146,172,243,178,142,
-191,147,199, 34, 93,182,147, 91,131, 84, 18,162, 17,202, 91,126, 64,247,158, 45, 20,155, 59,153,119,193, 53, 48,123, 13,232,246,
-148,235, 10,137,181,182,126, 63,151, 49, 32, 33, 4, 2,129, 20,181,225,218,172,127, 13, 32, 90, 99,236,200, 58,211,150,207, 64,
- 94,157,224, 12, 88, 78,121,153, 25,103,171,128, 16,227, 91,187,153,196,164,107,192, 38,178,121,121,174,235, 97, 28, 60,228,132,
-215,200, 20, 1, 92,202,117,149, 72, 25,187,157,188,152,158, 35,184,187, 6, 86, 46, 26, 22,154,155,200,103, 83,134, 44,152, 48,
- 79,227, 12,221,158,115,128, 34,155,175, 51, 32, 80,200, 73,216,127,118,144, 84,147, 13,211,236,198, 66,212,250, 57,217,208,144,
-231, 48,112,179,249,117,231,248, 50,100,170,143,112, 18, 37, 0,151, 52,124, 90,140, 63,111,167, 39, 40, 16,114,138, 20, 77,181,
- 95, 72,179, 83,198,227,255, 43,207, 73, 60,155,231, 36,127,206,247,126,118, 18,167,207, 41, 79,158,193,122, 26, 44,138, 73,140,
-205, 57,131,115, 22, 41, 36,162,246,134, 77,232,125,114, 19, 35, 59,214, 83, 42, 31,135,225, 99,156, 24, 59, 77,251,170, 97,252,
-165,151, 32,131, 38,100, 80,196, 74,137,200,182,238,218,198,110, 51, 50, 38, 38,129, 65,125,139,109,176, 82, 38,131,143, 60, 99,
- 60,207, 60,113, 98,146, 65,144,222, 75, 62,141,253, 36,159, 23, 64,101, 2, 32, 78,156,255, 9,151,118, 46, 27,183, 69, 54,202,
-209,207, 21,208,207,232,135,155,192,130, 93, 3,163,118,103,168, 4,118, 18,160,217, 51, 45,189, 6,137,189,230, 70,120,214,138,
-213, 36,215,128,152, 60, 41,217, 26,180,147,108, 27, 89, 55, 80,228, 51,170,100, 19, 4,162, 9,134, 98,134,254,231, 50, 0, 26,
- 20,136, 41, 64,159,106, 83,237,127,111,115, 63, 59,230,254,156, 6,158, 60, 3,225,206, 9,234,245,205, 83,200,113,176,106, 0,
- 46, 43,106,140, 73,142, 75,156, 13,131, 49,128, 80, 26,233, 98, 28,142, 4,137, 68, 35, 77,149,164, 50,138, 24, 27,162,100,202,
-248,158, 98,232,232,147,244, 14, 13, 48,183, 60, 8, 43, 46,131,246, 46,172,202,147, 0,254,164,109,216, 25,144,154, 6,181, 64,
-214, 89, 59,181,190,100, 67,148,207,202,160,177,103, 97,131,141, 82,238,196,167, 52, 25, 48,157,200, 88, 94, 38, 3,152, 6, 16,
- 17,207,243, 3, 20,103, 99,175,147,140,136,231,131, 37, 78, 52,232,220, 68,192,204,222, 87, 13,138,132,171,205,139,203,140, 0,
-225,210, 24,134, 6,230,237,196,184,219, 96,252,131,182, 65,221,145,103, 55,183,206,248,118,216,167,255,214,100, 6,157,155,116,
- 29, 65,198,176, 93,131,188,239, 36, 66,100,198,137, 56, 27, 23,178,136, 44,134,162,129,155,215, 45,240, 70, 86,158,186, 33,108,
- 93,129,152, 98, 82, 83,237,191,134,177,159,131,156, 8,251,243,179,191,169,246, 60,130,251,211,144,178,231,244,188, 27, 95,179,
-147,200,201,217, 99,122,100,186,249,141,111,228,147, 37,106,217,136,117, 13, 27,172,152, 64,208, 82, 90,109, 19,147, 6,189, 41,
- 64,121,204, 94,121, 62,173,243, 86, 16,234,102,194,106, 76,123, 94, 82, 12, 79,209,189,225, 46,250, 30,254, 54, 28,253, 41, 58,
- 30, 36, 71,136, 36,193,217, 4,231, 28, 82, 76, 80,103, 51, 16, 25, 7,240,201,176, 32, 50, 98, 37,220, 68,134,231,206, 88,220,
-118,210,127,181,247,245, 36,132,168,249,218,237,207, 45,129, 60,251,214,224,211, 22, 19,161,198,213,140,151,218,127, 78,254, 23,
-111, 32,227,115, 63,153,221,166, 70,159,104, 0,182, 26,179, 31,255,153,246,123, 50, 80,219, 9,134,152, 60,139,229,235,206,120,
-184,233,173, 92,227,239, 13, 38,153, 56,155,129, 35,220,184, 97,209,176,241,213,215,202, 25, 6,225, 68,167,141,203,198,145, 26,
- 33,242, 44,179, 99,121,246,178,195, 84,155,106, 83,109,170,253, 12,120,224,228, 89, 80,248,217,237,255,194,217,216, 53, 50, 97,
- 73,131,223,209,217,236, 58,141,140,177, 1, 16,133,196, 25,153,198,189, 43,129, 49, 6,165, 50,230,150, 24, 72, 70, 97,248, 40,
-125,155,239,167,178,231, 97, 74,241, 16, 90, 66,130, 32,212, 69, 42,193, 52, 22, 93,117, 43,204, 94, 14,173,115, 64,230, 83,146,
-133,196, 57,133,148,147, 54,205,140, 37,141,119, 16,192,155, 24,213, 94,103,113,114,130, 88, 33,200, 62, 91, 99,149, 25,211,114,
-141, 24,208, 56, 70,105,234,159,116, 13,219,191,248,133,202, 46,181,200,250, 20, 72, 92, 35, 96, 77,112,135,216,241, 49,141,199,
- 58, 62,199,251,214,226,235, 85, 6,216,114, 28, 16, 51,150,219,152, 37, 48, 57,118, 83, 77, 2, 56, 87,151,198,211, 88,141,113,
-208,157, 56,247, 41,179,166,238,171,174,199, 48,144, 52, 24, 11,141,247, 73, 50,133, 72,215,179, 4,196,148,255,113,170,253,143,
-103,232,207, 17, 36,158,241, 62,242,231,236,223,255,238,239,220,100,155,254,156,241, 69,245,128,100,123,246,103, 83,207,222, 58,
- 23, 82,159,235,126,207, 22,212, 39,116,172,225,225,185,198,205,127,156,161,225, 50,255,163, 20, 96,162,236, 45, 63,253, 91, 27,
-194,208, 17,146,109, 15,208,247,212, 58,188,202, 0,158, 11,177,214,146,120, 37, 6,104,101,254,133, 47, 34,127,222,165,208, 50,
- 19, 84, 9,100, 14,231, 84, 93, 3, 63, 35, 29, 13,155,166,191,213, 65, 93, 78,100,223, 19,228,250,179,140,105, 18,160,115, 6,
-176, 55, 94,191,214, 3,253, 11, 89,212,238,140, 7,100, 51, 16,155,232,199, 86,238, 76,198, 59,225, 25, 60,231,251,199,117, 80,
- 23, 53,229,162, 62, 23,182,206,192,205,164,197, 84,235,214,100, 80, 55, 19,230,215, 54,128,175,156,240, 12,168,167,136,121,147,
-192,219,214, 25,243,184,223,220,214, 95,175,129,186,174,207,133,100, 10,212,167,218, 20,168, 79,129,250,255, 59,160,126,150,249,
-123, 94, 64,221, 69, 46,101,163, 53,208,202,152, 83,246,123, 42,113, 26,164,181, 32, 18,176,149,244, 74, 70,128,148, 25,248, 25,
- 48, 46, 13,127,119, 97,134, 13,165,236,195, 6,194, 81,136, 71,225,240, 14,250, 55,221,133, 24,234, 65,187, 24,103, 5,137,206,
- 51, 38,243,228,103, 46,166,243,242,155, 97,198,121,144,155, 6, 78, 98,133, 78,189,157, 22,124, 49,238,231, 54, 22,148,108,144,
-169, 29, 96, 45, 66,142, 59,196, 29, 50, 75,137,147, 56, 28, 88,135,148, 13,254,225, 44, 93, 30,145,166,205, 57,151,249, 91, 45,
- 56, 12, 90, 78, 18,130,157, 58, 83,177, 16, 13,177, 8,207,211,162, 56,215,247, 71, 72,112,198, 34,164,196,186, 4, 41,107,156,
- 94, 61,231,251, 27,107,144,210, 98,176, 8, 52, 2,133,176,105,192,162,214, 96,140, 65,214,213,118,149,230, 11, 24,139,175, 50,
-159,142,117,105, 95,164,196,102, 25,102,198,102,156, 63,203, 29, 23,103, 91,228,162,102, 36,166,160,110, 38, 27, 9, 13,171,209,
-152, 4, 95,129,200,162, 40,157, 84, 36, 14,180,144, 8, 44,198,184,113,149,104,170, 77,181,255, 65,160,238,156, 67,100,155,159,
-115,162,225,223, 14, 33, 92,154, 26, 12, 19, 94, 7, 89,255,253,105,191,255, 89,157, 7, 33,178, 10, 18,214,166,217, 71, 98,146,
-242,250, 52,160, 94,235, 95,237,239,173,181, 72,249,252,131,189,115,233, 88,165,148, 19,250,121,182,241,215,254,238, 23,254,148,
-108,186,199,213,230,192,217, 36,221,171, 45, 8,217,224, 50, 77,139,177,164, 88, 68, 86,151,165,190,183,141,207,115, 58, 46, 85,
- 31, 75,109, 46,211,159,212, 95,171,141,183,246,220, 38,128,186,117,198, 77,244,153,218, 9,160,110,112,104, 23,130, 41, 67,111,
- 55,163,125,135, 49, 73, 21, 33, 60,148, 82, 56, 83,197,154,152, 32, 8, 48,213, 42, 5,109,137, 19, 75,164,138,104, 47,143,141,
- 42,200, 44, 31, 61, 48, 35,152,238, 45,140, 30,217,141, 78, 66,164, 48, 24, 35,112,126,158, 49, 2,146,214,121,204,189,230, 21,
- 48, 99, 57, 20,218, 65, 21, 72,178,126,168,108, 94,172, 77,165,254, 36,177,120, 90, 78,152,148,218, 4, 84,163, 16,173, 53, 74,
-142, 15, 56, 49, 9, 90,105,194, 48, 38, 8, 60,146,196,162,149, 64,136, 36,203,179, 15, 8,141, 69,169,244,154,113, 28,145,243,
- 68, 67, 0,157, 26,103,151,174,129,193,138,231,206, 16, 93,195,215, 68,158,197,226,115,214,130, 72,199,167,164, 2, 97,169, 70,
- 33,129, 31,156, 51, 21,236,103,109, 49, 9, 34,147,253, 85,102,139, 73, 9,198,186,116, 49,101, 11, 50,142, 12,218,215,117, 85,
-195, 37, 9, 74,167,210,121,210,160, 45,168,108, 33,215,103,112,178,133, 90, 3,245, 44,136,206,101,156,155, 58, 83, 31,159,155,
-200, 88,124, 5,198, 68,232,218,230, 35, 37,233,213, 27, 19,241,166, 98,209,167,218,255, 44, 80,111, 4,244, 26,168,215, 94, 27,
-127,253,108, 6,128, 60,227,179,207, 4,206, 53,160,172, 1,199,211, 27,201,153, 98,102, 82,240,108,188, 79,109, 31,126,118,247,
-127,102, 32, 79,146, 4,207,243, 72,146, 4,173,245,132,113, 54,254,108, 4,246,255,242,167,149,129,110, 18,199,104, 45,211,192,
- 50,151,170,216,198, 56,194, 48,100,100,108,148, 83,167, 78, 17, 70, 17, 90, 9,194, 56,162,185, 84,100, 90,103, 7,131, 3,167,
-241, 2,159, 74, 37,164, 82,169, 96, 13, 36, 73,194,220,185,115,233,152,214,134,231,121,233,245, 77,132, 86, 26, 71,109,111, 61,
- 19,127, 68,226,156, 27,247,163,219, 6, 95,103,205,167,154, 64, 56, 64,178,115, 29, 39,183,255,132,104,176,155,162, 78,192, 42,
-194,114, 5,229,171, 12, 80, 65, 88,135,195,224, 5,121, 70, 42, 33, 82, 41, 52, 2, 41, 37, 73,146,224,139,152,146,142, 17,225,
- 8,210, 90, 76, 18, 33,116,128,177, 18,116,142,170,204, 83,205,181,209,185,250, 74,114,231, 93, 7,237,243, 65,248, 56,151, 78,
- 82,189, 24,141,115,169,133,226,200,194,228, 93,186,216, 27, 82,234, 92,150, 47, 47,132,192, 56, 80, 82,213,140,165,236,243, 25,
- 47,140,203, 89,100,159, 7, 58, 32, 6, 18,155, 22,193, 19,184,113, 81,216,157, 5,188,197,179, 75, 49,248, 89,129, 61, 5,196,
-164,129,197, 10, 16, 62,137, 53,104,169,112,206, 97,196, 56,120,138,231,114,211,196,128,146, 24, 41, 8, 45, 4,153,248, 34, 5,
- 16, 39,160, 37, 40, 89,103,204, 53,235, 84,103,198,141, 20, 16,199, 14,233,139, 44,200,205, 33,176,104, 68,122,109,169,198,131,
-233,196,153,249,230,245,160, 70, 49,169, 2, 96, 67,150,133,115, 22, 92,140, 84, 42, 77,199, 16, 10, 43, 92, 22, 81,224,234, 50,
-253, 20,164, 79,181,255,177, 50,239, 57, 0, 50,142, 99, 60,207,195, 24, 67,146, 36, 4, 65, 80, 39, 58, 66,136,103,193, 86,109,
-166,196,233, 9,215, 79,149, 47,241,172,229,247, 70, 98, 5, 60,175,160,222,120,141, 36, 73, 16, 66,156,113,175, 90, 31,106,255,
-254, 47, 99,234,137, 67,170,137,196,197,217, 4,132,194, 57,193,232,104,153, 35,221,199, 8,130, 28,173,237,109,148, 74, 37,132,
-146,248, 26,134, 70,199,120,228,225,135, 88,188,116, 41,115,103,207, 70,121, 1,198, 56,242,121, 63, 21,195, 13,140,140,142,114,
-178,231, 56, 45, 45, 77,116, 78,159,134,150, 34, 85,164,179,130,111,103, 3,117, 61, 17, 85,228,153,145, 96,198, 66,181, 76,247,
-142, 45,112,242, 32, 37, 49, 64, 46,172,162, 98,104,245, 60,162, 80,164, 8,104,210, 7, 45,165,196,132,131, 20,124,143, 36, 74,
-210,130, 52,214,225,249,138, 40,172, 34,181,196, 24,131, 69, 18,228,155, 49, 46,193, 38, 22, 97, 66,138,206,160,203, 85,250,158,
-120, 16, 53, 60,198,236,203,110,130,210,116, 68,208,132,179, 58,221,184,133,194,216, 20, 76,156, 32,157, 60,192, 56,135,179, 14,
-231, 44, 74,165,252, 85,101, 15, 85,139, 76,214, 72,117, 18,132, 16, 88, 11, 38,137,241,252, 2, 46, 73, 16, 42, 53, 18,132, 5,
- 79,213,188,214, 2, 83,207,162,111, 40,150, 34,158, 79,110,216, 88,181, 76, 54, 34, 89,250,158, 76,125,217, 21, 82,195, 68,100,
- 29, 16, 2,236,115,205,149, 23, 54,117,214,219, 90,254, 96,214, 35, 99,210,133,234,107, 98,151,122,189,135, 12,140,133,112, 96,
-207, 49,164, 2,103, 35,150, 45, 94, 72, 46,128,130,159,206,103, 78,166, 30,121,155,100,154,148, 18,103,248,131,206,236,174, 60,
-227,183,198,160, 69, 33,210,231,164, 61, 15,144, 24, 9,213, 4,148, 22, 89,160,156,192, 26,131, 81,224, 79,237,253, 83,237,127,
- 48,168,215,152,168,115, 46,147,125, 5,158,151, 86,231, 84, 74,213,153,245,179, 7,244,244,186,233,231, 82,249,124,252, 90, 98,
-156, 4, 61, 35, 67,149, 19,250,247,124,178,229,218,181,226, 56, 70, 74,137,214, 26,107,237, 4, 25,190,241,111,255,171,153,186,
- 84,162, 86, 97, 26, 50, 85, 65,123, 30,214, 66,111,239, 41,122,142,157,100,245,154, 53,120, 94, 74, 22,173,133,145,209,152, 67,
-135, 14,112,255,253,247,179,106,245, 74,102,204,236,194,207, 7,132, 85,135, 14, 4,253,167, 99,170,213, 42,113, 28,211, 92, 42,
- 49,123,222, 18,142,247,116,227,121, 99,116,118,182,102,216, 96, 56, 87, 28,145,174,111,162, 89,126,144,155,192, 22, 73, 3,222,
-132,143,149, 62, 66, 23, 64,134, 56,171, 72,140,193, 10, 15,235,251, 84,194, 8,229, 28,121, 95, 34,156,193,218, 56,171, 79,238,
- 8,180, 34, 73,170,200,196,100, 85,217, 52,232, 28,177,145,196, 81, 22, 91, 46, 32,144, 6,108, 66,206, 73,148,179, 84,246, 60,
-194,241,129, 30,102, 93,249, 82,152,181, 28,145,111, 67, 90, 13,120, 72, 5,161,129,200, 64,197,129,231, 65, 32, 83,111,176, 6,
-146, 36, 70,107, 15,107, 45,214,166,146,141, 20,181,200,114, 69,236,192, 73,141,243, 53,101, 7,190,246, 80, 14,132,201,152,112,
- 70, 82,149,102, 34, 11,108,152,159,218,148, 62, 39,166, 60,121, 1, 55, 24, 13, 34, 11,206,139, 17,196,104,198,128,200,129, 87,
-133,214, 92, 42,160, 40,245, 60,220, 91,164, 76,221, 58,139, 47, 37,214, 36,120,126,186, 80, 70, 19,199,152, 22,124,251,225, 61,
-124,253,238,159,176,107, 95, 55, 82,251, 88,107, 49,206, 98,109,153, 5, 51, 74,220,250,162,171,120,205,205,215,211, 17, 64,171,
- 7,158,240, 64, 88,226, 56, 68,251,185, 51, 67,106,106, 81,245, 13,105, 27,194,101, 54,192,164, 8,122,225,200,148, 30,139,209,
-146, 50,176,247,196, 24,159,254,244,167,248,141,183,188,137,139,150,204, 6,169,168,144,130,186,117, 32,137, 8,209, 60,114,112,
-136,239, 61,186,131, 3,135, 15, 19, 37, 49,133,130,207, 53,171,151,113,195, 5,139, 57,127, 86, 27,152, 8, 43,116,125,243, 59,
- 61,208, 71,107,123, 27, 34, 84, 16, 52, 72,158,217,195, 22,130,255,118,153,111,170,253, 47, 19,225, 51, 73,188, 17,160,157, 75,
-119, 7, 33, 32, 49, 14, 41,107,190,228,172, 96,151, 74,141,255,154,191,247,233,175, 15, 74,201, 9,114,123,146,140,251,196,207,
-189,204,107,239,187,186, 33,208,216,223, 70,105,252,185,180,154, 2,224,121,222, 4, 48, 79, 13, 27,123, 78,102,126,182,121,251,
- 69, 52,147, 88,148,206,226,183,164, 64,123, 30,149, 74,133,158,158, 94, 60, 63,207,234, 53,107, 80, 30, 28,239,173,242,212,222,
-125,244, 28, 59,193,161, 67,135, 56,120,248, 0, 77, 77, 77,136,157, 71,104,105, 57, 76, 53,140,233,239, 63,205,240,200, 88, 26,
- 68,158, 36,169, 17,163, 4, 11, 22,204,199,247, 36,115,231,117, 97, 18,208, 74, 96,173, 78,159,205,217,202,118, 91,231,220, 4,
- 80,151,227,155, 44,144,118,214, 85,224,224, 79,233,223,245, 24,163,167, 15,146,195,224, 11, 15,131, 32,113, 14,133,165, 73,198,
-232,112,136,177,254, 30,114,218, 17,217, 84, 18,151,198,225,148,135,145, 1,137, 87, 32,246, 2,240,138,228,242, 45,196,113, 12,
- 46, 36,169, 12, 33,163, 65,124, 27,163, 77,132,151, 5, 90, 85,188, 86, 78, 55,117,177,236,154, 91, 96,209, 11, 64, 53,225, 92,
-158, 72, 72,156,132, 47,126,243, 30,126,176,110, 11,151, 95,113, 5, 87,190, 96, 5, 47, 88, 58,139, 60,160,156,193,147, 10, 99,
- 13, 74,164,134, 3, 56, 76, 20, 35,131, 2, 21,160,231,180, 97, 40, 76,144,218,163,168, 97,110,147,164, 80, 75,116, 23,224,132,
-164,154, 56,124, 45, 38, 69,207,203,122, 97, 89, 82,209,254,249, 97,235, 46, 21,147, 77,173,216, 79, 70,107, 71,128,199,118, 31,
- 97,253,206,195,108,124,108, 35,111,188,233,106,110,187,225, 18, 60, 83,179,200,158,227,125, 77, 4, 74, 17,217,212, 47,230, 9,
-136, 77,130, 83, 62,189, 17,188,237, 79,254,158, 13,123,123,176,126, 27, 82, 5, 36,213, 10, 78, 8,132,167, 64, 36, 8, 98,252,
-120,140, 25, 90,242,143, 31,250, 0,231, 47,108, 33, 15,104, 97,209,186,241, 64, 23,121,102, 5,186, 9,197,142,106, 59, 86,106,
-246,214,229,248, 36, 66,105,141, 65, 50, 6,236, 30,128,223,124,215, 7, 24, 25, 58,205,223,254,249, 7,185,122,217, 44,114, 90,
- 16,106, 40, 38, 33,158, 14,216,214,115,138,247,124,234,187,172,223,211, 75,217,107, 2,237, 35, 92,140, 69,145, 11, 7, 8,108,
-200,109,215, 95,197,223,254,159, 27,152,230, 43, 92, 82, 65,232, 60, 68, 35, 88,191,192, 88, 85,177,105,239, 46,194,106,149,229,
- 43,150,179,176,169,128,139, 70,192,107, 2,220,243,182, 97, 77,181,169,246,179, 51,246,241, 2, 80, 38, 19,216, 92, 67,193,172,
- 90, 0,112,237,204,140,103,179, 68, 39, 6,199,165, 70,130, 16,207, 70,130, 31,255,108,205,216,109, 4,217,231,219,248,173,221,
- 43,142, 99,124,223, 63,171,234, 48,185, 31,191,248, 7, 50,174,122, 70, 81, 68,181, 90,229,248,201, 94, 60, 29, 48,119,126, 23,
- 56,216,180,121, 15,247,253,240, 65,134, 71, 42,140,140,140, 80, 40, 21, 25, 28, 28,100,201,146, 37, 92,116,225, 37, 40,229,177,
-103,207, 94,162,196,226,251, 57, 18,107,144, 66, 99,108, 12,214,144, 15, 52, 39,142, 31,230,198, 27, 95,200,101, 23, 45, 71,101,
-226,120, 74,186,207,236,146,182,100,229, 93,235,111, 38, 52, 86, 28, 73,229,110,133, 90,120, 62,211, 58,230,210, 82, 29,192, 57,
-139, 53, 30,194, 73, 36, 17, 58, 25,132,225, 30,236,238,245,228, 42,253,196,229,129,148, 9, 43,143,170,240, 72,114, 29,132,173,
- 11,201,207, 89, 70,174,125, 38, 34,223, 76,222,207,103, 69, 64, 44,149,211,189, 48,124,156,145, 35, 59,209,195, 61, 84, 70,122,
-105,201,123,168,112,136,150,145, 35, 28,126,232,155,116,197, 9, 44, 90,139, 8, 60,156,244, 83, 73,152, 28,235, 15, 13,179,174,
-251,135,220,121,223, 67,124,228,125,191,205,133,139,103,224, 75,149, 5, 87,213,228,234, 36, 5, 7, 63, 32, 4, 6, 34,184,253,
- 63,190,199,163, 63,221, 69,226, 96,249,188, 14,110,127,207,219,152,215, 36, 80, 73, 37, 43,154,162,201,233,134,224,173,134,148,
- 58, 37,206,122, 4,201,207,189, 38,234, 7,156,136,198,162, 57, 16, 1,135,135, 13,239,251,200, 39, 56, 94,209, 72,107,184,126,
- 56,166,127, 48, 97,110,179,158, 88, 53,237,231, 19,143,112, 42, 71, 28, 27,148,167,192, 89,146, 56, 70,120, 1, 67,192,187,254,
-234,147,108,216,223,135,107,154,137, 41,151,209,201, 48,107,231,118, 80, 42, 4,140, 68, 85,158, 58,114,130, 49, 89,194,229,154,
- 57, 86, 30,224,255,255,240,223,242, 55, 31,120, 39, 23, 44,106,167, 89, 73, 72,210,224, 68, 85,243, 53, 53, 40, 28,245,170,115,
-181,133, 55,161,214,186,197,100,158, 33,173, 53, 97,156,128,231,115,170, 10,127,240,177, 79,112,180, 42, 80,126, 59,167, 67, 65,
-100, 33,135, 35,177, 2, 79, 43, 30,223,123,148,215,124,228, 43, 28, 25, 43,225, 21,166,227, 85,135, 40,248, 80, 84, 17, 67, 21,
- 65, 69, 21, 8,155,230,242,197,135,246,179,239,240,113,238,249,235, 55, 83,170,165, 47,202, 2,255,116,207,102,222,249,153,135,
- 64,232,148,198, 36,247,242,214, 95, 94,203,231,126,231,197,207, 16, 13, 60,213,166,218,207,239,126, 59, 87,108, 78, 99,112, 48,
- 64, 18, 59,180, 78, 65, 55,243, 24,166,241, 76, 98, 28,212, 27,255,253,108,128,178, 6,128, 73,146,160, 84,202, 0,163,208,226,
-251,242, 25, 11,114,140, 51,122, 65, 28,155,134, 8,109,158,209, 32,120,182, 64, 62,249, 62,190,239,215,193,187, 49,104,176,102,
- 92,212,254,182, 22,111,240, 11,109, 2,170,213, 42,163,163,195,244,247,247, 35,181, 98,116,116,148, 66, 73,179,119, 95, 55, 91,
- 54, 63,201,250,199,183,144,203,183,144, 24,193,244, 89,243,137,146,152,249,109,211,105,239,156,137,246,243,236,217,179,135,216,
-129,206,229, 49, 78, 96,156,197,224,144,218, 67, 43, 77, 37,170,160, 60,205,246,157, 79,178,106,229, 34,218,154, 61,158,174,230,
-188,150, 13, 82,231,120, 63, 27, 11,104,130, 21,169,227, 94,182,206,133,164, 61,149, 95, 19, 73, 65, 57,112, 99,216,238, 62,142,
-111,219,132,233, 61, 68, 43, 33,158,242,176,206, 17,203, 28, 97,190,131,166, 69, 23,209,182,232, 50,170,205,115, 24,243,155,209,
- 77,237,132, 78, 16,104,129,139, 33, 63,171, 74, 80,233,165,121,225,106, 78,109,123,144,177,238, 39, 81,229, 62,242, 90,226, 37,
-195,200, 50,244,108,249, 17,179,103,204, 2,191, 9,240, 83,182, 44,115, 84, 68, 9, 39, 53, 35, 73,196,112, 44, 24,142, 65,248,
-128,146,196,169,216,143, 68,227,123, 18,108,202,217,133, 7,189, 35, 9,221,131, 49, 14,104,106, 10, 41, 27, 71, 37,180,148,130,
- 28,214, 90, 98,169,137, 26, 38, 74, 9,137,170, 69,134,103,178,187,202,146,202,220, 89,190,166,166,225, 39,212, 75,186,156, 33,
-217,215,114,176,173, 72, 67,190,146,154,251, 67, 64, 8, 84, 81, 12, 25,197, 96, 44,105,201, 23,168,196, 9, 74, 41, 18, 3, 90,
- 73, 18,145,130,255,217,242, 23, 85,125,252,231,144,142, 72,239,129,167,210,185, 18, 18,223,243,168, 38,142,222,193, 42,219,183,
-239,196,243, 59, 8, 43, 35, 92,184,180,139,119,188,229, 13,116,181, 6, 4, 58,237,103, 95, 4,255,124,199, 15,185,127,221,102,
- 84,190,153, 99, 35,131,124,254, 27,223,225,175,222,253,235,248,198,209,162, 21,227, 85,221, 38, 84, 25, 64, 61,243,119, 5, 3,
-196, 14,240,124,134,129, 63,251,135, 47,178,227,224, 73, 98, 93, 36,137, 35, 98,161,176, 46, 45, 9,235, 11,205, 96,108,121,215,
- 23,215,115,180,156, 71,230,243,204,150, 35,252,198,107,175,226,178,243,151, 80,244, 4,221, 61, 39,248,234, 3, 79,240,253,109,
-199,105,111, 42,241,232,238,211,252,213,215,126,204,135,223,112, 93,102, 69,157,226,130, 5, 93,188,239, 53,215,241,214,107,231,
-209, 25,120,252,209,215, 55,243,169,123,158,224,245,215,172,228,250, 85,243,176, 38,139,171,124,190,138,255, 79,181,169,246,180,
- 96, 47,144, 50,221,183, 70,134, 35,142,246,244, 83,173, 36,120,158,194,216,152, 5, 11,230,211,212, 36,120,224,129, 13,108,220,
-184,145,203,175,184,136,171,175,190, 60,141, 11,106, 96,236,231,252,158,101,105,190,214,146,102,177, 56,248,209,143,214,179, 97,
-195, 6, 46,187,242, 50, 94,116,237,229,147, 24,233,153,215, 72, 44,148,203,134,163, 71,143,146,132, 17, 96,209,158,164,163,163,
-131,233,211,219, 38, 40,191, 78,156,253, 40,133, 70, 55,220, 4,247,155, 76, 83,150,173,131, 67,135,123,248,198, 55,190,193,187,
-223,253,206,172,216, 25,117,223,127, 35, 81,177, 22,134,135,171,244, 28, 63,202,121, 43,151,156,209,125,247, 44,246,158,159,165,
-157, 56,209, 67,165, 82, 97,233,210,165, 56, 1,167, 6,134,217,189,103, 63,119,126,255, 62, 90,218,166, 51, 99,198, 12,252, 32,
- 79, 53,138, 81, 10,166,119,118, 48,109,122, 39,165, 82,137,187,127,240, 61,186, 22, 45, 78, 99,209,108,140, 53,224,231,242, 0,
-148,203,163,140, 69, 85,250,251,122,152, 61,163,149, 25, 51, 58,105,105,246,198,173,189,115,116, 86,227,178,128, 8, 57, 46,183,
- 43, 33,211, 52, 42, 28, 66, 10,180, 16, 8,151,234, 61, 90,120,104, 15, 80, 49, 84,250,113,123, 30,229,248,214, 7,240,134,123,
-104, 22, 21, 92, 20, 19, 10,129,244, 10, 84,117, 43,122,225,101,176,248, 50, 76,251, 18,108,177,147,237,135, 79,242,228,198,159,
-114,240,104, 15, 66, 40,102,183,183,113,225,210, 46,174, 92, 54,159,166, 82, 59, 29,205,109, 36,143,249, 68,123,215,161,163,211,
- 96, 12,121, 29,146,244,239, 39,217,254, 19,244, 69,211,240,154,155,168, 0, 2,157,229,110, 59, 48,150,170, 21,244, 70,176,179,
-167, 74,185, 90, 65, 8, 71,115,177,192,156,246, 28,179, 11,146, 64,130,103, 65, 68, 89,116, 38,154,196, 90, 20, 30,166, 92,197,
-250, 57, 42, 8, 66, 41,217,120,104,144,163,167,134, 56,213, 55,130, 67,163,181,100,230,180,102,150,207,237, 96, 65,135,166, 61,
- 59,224,205, 40, 75, 66, 90, 27,191, 22, 48, 81, 5, 6,170,176,227, 64, 31,199,134,135, 9,130,128,142, 32, 96,249,252, 78,102,
-148, 82,223,175, 76, 18,180,150, 36, 86,146, 72,232, 30,130,222,193, 42,229,200, 80,169,198,180,183,182, 48,125,182,192,104,176,
- 86,163,188, 28, 73,146,224,108,132,117, 9, 86,122, 84, 36,156,172,192,174,163, 67, 28, 57,213,207,192,233, 65,112,154,166,130,
-207,130, 57,157, 44,153,221,206,236,146, 32, 79, 42,213,105,149,254,172,157, 84, 90, 5, 78,150, 97,199,158,227,156, 56,178,159,
-215,222,114, 53, 22,129,167, 5,115,219,242,124,230, 99, 31,228,247,254,236,111, 57,127,237, 5,188,227, 77,175,161, 69, 67, 49,
-112, 8, 19,147, 47,120,116, 36,130, 63,126,235,141,116,239,219,198,222,147,101,130, 92, 43,235, 55, 63,197,169,193,132,142, 54,
- 72, 76, 26,219,128,144,103,230,160,187,113,147,198, 58,129, 20,181, 64,189,184,230, 76, 67, 42, 69, 44,210, 32,193, 15,127,225,
- 62,238,223,180, 15,151,107,198,132, 33,129, 48, 88, 83,193,216, 40,139,165,208, 60,112,120,148,245, 91,159,164,109,206, 28,198,
-250, 79,114,251,251, 95,207, 43, 47, 94, 0,140, 1, 30, 87,204, 95,201,235, 46,239,226, 21, 31,253, 1,223,219,124,144,160,216,
-196, 55,215,239,224,253,111,184,142,102,160,234, 90,121,225, 82,203, 11, 87,188, 0,240, 25,169, 72, 62,242,182,235,248,212, 67,
- 91,120,104,203,110,110,120, 65, 87, 22,140,249,204,155,229, 84,155,106,207, 78,169,155, 84, 43,188, 65,206,205, 80, 23, 99, 64,
- 40,193,190,238, 94, 62,246,225, 47,128,200,129,168, 96, 93, 72,169,152,231, 29,239,120, 7, 35, 99, 69,182, 61,121,140, 85, 47,
-184, 4, 41, 33,140,210, 88, 35,235, 32, 73,210,122, 19,245, 26, 97, 89, 30,181,115,105,114, 74, 20, 57,124, 95,164, 68,196,192,
-208,152,102,251,238, 99, 44, 91,147, 16,101,125,179, 89,141, 39,237,101, 5, 55, 51,249, 55, 78,187,200,158,131,253,124,252,163,
-159,100,237,234,149, 40,233,136,146, 10,151, 93,117, 41, 47,236,188, 4, 45,210,239,188,205,172,121, 9,184, 44,106,220,101, 85,
- 36,107,125,212, 46, 83, 30,212, 56,225, 73, 12,120, 18,198,198, 52,155,183,237,197,200,241, 10,155,141,227,187,243,251,235,216,
-254,212, 30,222,243,158, 95,229,192,161,211,252,221,237,159,224, 75, 95,250,123,172, 29, 63,183, 66,100,231,153, 52,158, 99, 97,
- 77, 58, 6, 41, 83,252,211, 34, 77,229, 77, 3,147, 83, 63,190, 64, 65, 38,239,139, 90,180,125, 98,233,233, 57,138, 53,134,149,
- 43, 87, 98,173,101,104,100,148, 31,252,224,110, 94,242,146,219,184,250,234, 10,187,118,239,167,125,122, 59,109,109, 45,204,155,
- 63,155, 89,211, 59,153, 57,107, 26,194,193,177,158, 62, 78, 30,233,226,200,209, 99,180,180,182, 19, 38,134, 56, 49, 12, 30, 29,
-197, 24, 67,160, 61,170,213, 50, 90, 91, 2, 95,178, 98,249,162,236,156, 12,135, 53,114, 60,234,126, 50,168,167,145,224, 38, 61,
-160, 2, 80,181,205, 85,164,105,100, 34, 11,156, 16, 88,180, 2,146, 16, 92, 12,225, 32, 67,155,238,103,100,247,122,188,225,110,
-138, 46,196, 19, 14,227,107, 34,145,167, 44, 10,228,102,174, 36,183,232, 34,220,140,243,232, 53, 37,190,250,157,135,249,218, 15,
-127,194,201,177,152,170, 19,152,196,162,133,101,118, 41,224,198, 11,207,227, 93,111,121, 5,115,155,186,152,121,233,205,244, 14,
- 30, 39, 60, 86,161, 20, 36,152,112,132,230,124, 66,207, 83, 27,153,191,248, 74,172,215,129,206, 23, 16, 50,139,128,148, 30, 85,
- 45,120,226,192,113, 62,253,213,187,232,235,235, 99,120,176, 31,237, 73,130, 92,129, 5,179,166,243,146, 43, 46,230,182, 27, 46,
-160,205,203, 30,166, 86, 68,214,224, 41,141,113,150,196, 41, 66, 37,232, 30,130,143,124,250, 11,236, 57,118,146,158,190,211,120,
-104,140,113, 41,112, 11,193,156,142,102,110,125,209, 21,188,245,165,215,208,146,151,148, 45,236,220,123,136,200,228,176,206, 99,
-225,226,105,108,222,118,128, 47,127,251,110,158, 58,220, 67, 25, 65,108, 13, 45,158, 79,215,244, 54,222,241, 43,175,225,133, 23,
-204, 33,167, 53, 6,232, 75,224,155,247, 61,198,189,143,110,229,112, 79, 63,213, 40,149,140,148,144, 44, 89,182,148,151,222,242,
- 18,156, 46, 80,173, 36,228, 60, 8,242, 57,170,206, 49,166,224,177, 39, 79,242,201,175,124,155, 3,199,123, 25,139,170, 68, 81,
-130, 39, 61, 60, 37,193, 69, 44,235,154,193,175,191,250, 37,220,112,201, 10, 10, 10, 14,247, 86, 57,112,188, 23,163, 60,132, 16,
-232, 82, 11,159,251,242,119,216,178,117, 43, 50, 26,228,230,155,175, 38,239, 11,132, 75, 40, 40,197,154,121, 29,252,227, 7,223,
- 77,169, 84, 98, 94,179, 36,192, 32, 93, 76,161,232, 19,133,101,180,151, 67,106,201,149,107,150,211, 61,176,131, 74,104,241,208,
- 28,236, 62,198,146,230,217, 72,255,105, 92, 3, 13, 68,183,150,153,144, 36,105,150, 68, 18,135,104,157, 30,244, 83, 5,190,242,
-224, 19,220,113,223,163,132,185, 54,202,213,152,156,159, 67,152, 8,107,199,197,124,237, 18, 30,222,218, 77,161,165,200,200,216,
- 24, 75, 23, 47,224,194,243,230, 66, 50,130,197,199, 74,141, 76, 66,164,159,227,213, 55, 95,201,119,182,245, 97,132,100, 52,146,
-116, 31, 29, 96,245,220,118,202,210,144, 83, 5,254,225,174, 39,249,235,111,172, 99,168,191, 15, 89,204,163,173,100,112, 44,243,
- 17, 58,139,203,210, 10,167, 92,234, 83,237, 23, 13,249, 14,135, 80, 18,227, 72, 21, 74,147, 39, 49, 1,127,244,167,191,207,191,
-125,225,243, 28,239,233,230,240,209, 62, 12,121,144, 69,162, 72, 17, 91,120,236,241, 3,172, 91,183, 14, 33, 28,115,230,204,225,
-150, 91,174,103,227,198,157,140,149,135,112,206,113,248,240, 17,194, 48,228,154,171, 46,229,242,203, 87,176,239,192, 16,119,223,
-125, 31, 67, 67, 33, 99,229, 42,198,230, 16,186, 5,235,224,129, 7,158, 96,195,227,219, 40, 21,138,204,156,217,198,139, 95,124,
- 61, 79, 62,177,131,161,209, 17, 22, 45, 89,204,238, 61, 7, 80,186, 25,207,107,225,247,223,253,107, 72, 5, 54, 43, 86,245,208,
- 67,219,216,188,113, 19, 5, 63,224,134, 27, 94, 68,199,244,105,108,216,248, 40, 47,189,233,122,132,131, 31, 62,184,158,246,206,
-217,204,156, 53,143,205,155, 54,224,170,101,246,236,221, 77,123,231, 76,222,244,230, 87, 48, 54, 10,235,215,111,102,203,134,109,
-105, 45, 20,227,129,128,175,223,241, 32,123,247,238, 69, 74,205, 11,214, 94,200,141, 55,174,101,251,174, 3,156,236, 29,226,174,
-187,183, 83, 42, 22,185,237, 85,191, 66, 98, 97,199,246, 3, 60,244,227,117, 84, 42, 21, 46,188,112, 45,215, 95,127, 9,247, 63,
-248, 4,113, 28,179,111,207, 94,108, 18,115,195, 13,215,178,122,205, 2,148,148, 36, 36,104,169,137,147, 24, 45,211,172, 0, 79,
-167, 21, 78,133,116, 88, 19, 35,133,199,169, 83,167,136,227,152, 69,139,151,146, 36, 17,163,163,163,124,247,187, 63,224,178,203,
- 46,195,247, 60,110,186,233, 58, 86,175, 94, 77, 71,199, 52,180, 22,228, 2,178, 35,180, 13, 88, 71,215,220, 78, 94,246,210, 27,
-248,209,131,143,176,117,235, 14,140, 3, 47,200,211, 92,106,194,211, 62,249,124,158, 92,224, 99,147, 50, 35, 35, 39,153, 57,189,
-131, 40,142,240,148, 68, 42,125, 78,177, 80, 27,151, 32,148, 72, 79,169,170,249, 89,157, 32, 52, 2,169, 82, 70, 34,117, 38, 28,
- 39,229,116,155, 61,185,135,254, 13,247, 49,218,189,147, 32, 26,162,168, 45, 94,226, 48, 54, 38, 22,130,138,167,169, 54,205,101,
-214,146,139,137,155,230, 18,229, 90,184,227,222,205,252,195,215,239,166, 44,155,168, 82,196, 33,145,158,162,234, 98, 14,148, 99,
-190,240,208,102,202, 78,242,103,191,113, 27,179,114, 51,153,126,222,181, 28,237, 31, 32,172,118, 83,240, 45, 81, 56,136,150, 5,
-250,247,111,163,173,121, 14,126,190, 0, 54, 68, 72, 67,197, 9,186,203,240, 79,119,220, 75, 84,141,241,133, 37,112, 1, 54, 52,
-140,134, 17, 7,135,143,177,101,255, 49, 30,219,181,143, 15,252,250, 43,241, 11,138,177, 56, 68,248, 16,155,144,208,198, 68,129,
-207,161, 17,199, 31,222,254, 25,182, 29,236, 33,172, 26,124, 5, 45, 5, 71,190, 73, 99, 8,232, 57, 93,102,231,169, 42,187,255,
-243,126,122,142,247,243,182, 55,223, 70,169, 25,222,253,145,207,112,178,236, 17,139,128,121,243,230,210,119,234, 36, 35,195,101,
- 44,154,216, 89,208,121, 70, 43,112,170,251, 52, 31,253,215,175, 81,124,207,239,176,122, 94,192,104, 2, 31,252,228, 55,185,255,
-241, 39,136,172, 4,167,211, 28,241, 48,194, 57,203,201, 39,182,179,110,199,110, 98, 20, 94,224,131, 8, 25, 11, 35, 42,202,231,
- 75, 15,236,229,246,207,253, 7,195,177, 36,142, 99, 58,138, 57,102,180, 6,248, 82, 48, 92,174,208, 87, 53, 60,118,224, 20,123,
-254,233, 43,188,243,215,222,200,171,174, 94,193,250,237,123,248,227,207,124,141,178, 42,224, 35,209, 90, 49, 52, 58, 74, 94,121,
- 20,133,162, 50, 18, 83,201, 65, 46,159, 22,229,105,213,142,139,186,166, 99,172,195,154, 16, 45, 29, 57, 95, 34,136, 9,124,133,
-148,146, 2,208, 90, 42, 98, 13, 40, 63,192, 79,210, 2, 10,137,149,196,137, 37, 80, 26,215, 16,125, 80, 47,249,154,157, 41,224,
- 12,104,173,136, 99,144,190, 72,125, 73,158, 6, 19, 17, 41,159,173,199,225, 47, 63,253, 29,134,241, 65, 41,140,239, 83, 49, 33,
-158,240,144,210,195,224, 97, 4, 40, 11, 5, 91,161,172, 75,248, 84,105, 82, 21,114, 46, 6,233, 48, 34, 72,162,223, 73, 35, 0,
- 0, 32, 0, 73, 68, 65, 84, 43,210,249, 62, 6, 73,135, 27,166, 67,142, 49, 68, 9,172,135,137,210, 44,252,246,124,192,219, 63,
-119, 47,159,189,123, 27, 31,126,227, 5,188,226,178,215, 17, 59,195,154,119,255, 27,158,159,230,197, 75,233,176,206, 77, 9,239,
- 83,237, 23,236, 83, 31, 23,137,147,172,146,164,231,165, 5,191,164,242,217,179,251, 48, 99, 99, 21,180,239, 49,115,246, 44, 14,
- 31, 58,130,211,128,214,220,241,205,245,252,224,206, 31,210,218,218,142,194,177,115,215, 81, 78,246,134,148,203, 85,246,236,217,
- 3,164,209,213,142,132,109,219,246, 49,103,238,159,243, 55, 31,251, 2,131,195, 35, 44, 91,182,136,114, 53, 33, 54,146,106, 69,
-241,181,175,109,229,158,123,238,161,179,115, 26,189, 39,134,217,180,105, 23,167, 7, 44, 3, 3,253,236,218,181, 3,165, 60,162,
- 56,225,250, 95,186,137,176,154,176,115,103, 25, 72,112,210,209,115,226, 56,223,252,214, 93,188,234,149,175,196, 84, 35, 62,246,
-209,207,240,107,111,253, 53,190,250,213,187,121,217, 75,175,199, 56,216,176,105, 23, 43, 87,230,113,182,149,175,126,229,251,220,
-118,203,181, 92,113,213,213,124,225,223,239, 96,206,252,149, 28,216,127,136,238,238,110,110,123,249,203,217,187,119, 55,222,206,
-237, 36, 6, 6,135,203,220,120,211,173, 88,163,248,220,191,252, 43, 58,223,130, 85, 30,113, 98,177, 22,154,219, 58,249,226,151,
-254,131, 43,174,188,152,143,223,254,105, 94,247,154,219,240,115, 5,238,248,198,119,113,170,141, 77, 27,247,112,226,228, 81,222,
-244,134, 87,178, 99,219, 79,249,242,151,190,206,199, 62,254, 94, 76,156,166,169, 25, 12,158,246,210,115, 43,164,196,154, 84, 65,
-148, 74, 32,149,160, 90, 25, 97,104,184,159,165,203, 86,146, 24, 75,185, 28,113,255,253, 15,178, 98,197, 10,230,205,155,147,166,
- 27,106, 88,208,213, 81,143,115,168, 17,107,147,164,241, 63,198, 89,140, 25, 99,201,162, 57,120,158,199,192,192, 40,126, 46,143,
- 69, 82, 42, 53, 83, 40, 20,104,110, 46,209, 84, 12,104,110,202,177,255,224, 17,214,174, 89,150, 22, 76, 35, 78, 85,117,188, 51,
-214,142,182, 98,188,128, 71, 26, 45, 46, 16, 66,226,213, 34,151,173, 65,145,160,108,152,202,152,123, 55,115,100,203,143, 40, 14,
- 31,163, 88, 57, 73,209,211, 72, 19,167,197, 65,100, 90,118, 48,118,160,219,231, 66,203, 92,130,214, 25,236, 60, 57,198,103,238,
-248, 62,229,220, 52, 70,171,224,148, 95, 47, 72,131, 82, 24,169, 9,165,230,174,199,182,243,178,171, 47,224,197,203, 59,240, 23,
-159,143,183,107, 19,241,145,163, 40, 28,158,176,228,136, 25,233, 59, 70, 91,101, 16,213, 58, 11,107, 83,255,178,139, 19, 76,224,
- 17,153,132,206,230,128,181,203, 23,209, 89,204,115,232,232, 49, 54, 31, 56, 74, 36, 60, 6, 98,195, 93,143, 61,193,244,150, 2,
-111,120,195, 75,193,203,167,149,109,165,196,250, 1, 67, 6, 62,241,207,255,194,214,253, 61,148,173, 71, 62,200,241,242,155,174,
-227,218,139, 23,211,156,247, 24, 46, 59,190,243,163,117,220,179,101, 47,163, 54,228, 27, 15,109,100,214,226,101,252,242, 77,231,
-209, 31, 9, 6, 69,137,200, 41,134, 15, 28,163, 37, 39,184,120,245,114, 22,116,205,103,180, 60,198,186,173,219, 56, 50, 88, 5,
- 47,199,238, 19,253,252,248,137, 93,204,156,190,150,127,252,236, 29,220,253,248, 78,134,140, 79, 73, 75,242, 56, 86,173, 92, 70,
-215,172,153, 12,143, 12,176,125,247, 62,250,198, 12, 33,130,216, 65,130,193, 74,143, 19,195, 9,255,126,231, 3,156, 74, 2,140,
- 14, 40,248,142,215,188,226,151,184,116,205, 10,156,177,244, 14, 13,243,149,187, 31, 96,243,174,221,152, 40,224,243,223,190,159,
- 11,151, 45,162,191,154,208,107, 52, 85, 85,192,119, 6, 85,174,210, 18,104,206, 95, 52,143,217,249,249,120,164, 32, 44,100,234,
-209, 54,113, 68, 65, 6, 24,225, 80,197,194,120,148,128,137, 65,165,113, 13, 9,112,106, 96,144, 56,206, 82,227,146,152,174, 57,
-115, 51,151,142,110,240,101,141,151, 31,182,153,187, 34, 13,246, 72, 15,222,213, 94, 42, 3,106, 15,156,240,168, 40,216,123,202,
-240,246,247,127,156, 49,124,138, 18,102,207,158,206,174,195, 39,209,158,135, 11, 99,156, 73, 83, 54,164, 3, 33, 45,151,204,109,
-134,112, 12,209,220,193,206,131,189, 60,113,240, 20, 47, 94, 61, 15, 25,149, 17,202, 79, 11, 32,105,159,159,118, 15,114, 42,241,
-208,190, 79,179,111,152,223, 57, 29,128,221,125,131,124,246,158,157,124,224,214,139,248,195, 87, 93,207,152,131,162,132,130, 53,
- 84,101, 42,148,142, 57, 77,209, 85, 49, 50,199, 84,200,220, 84,123,126, 0,253,220,158, 93,137, 66,169, 52, 27,200, 36, 9,113,
- 84,197,243, 60,190,247,221,111, 18,219, 10,206,193,177,227,125,105, 16,112, 18,131,244,120,240,161,117, 36, 70,113,213, 85,215,
-131,139,185,243,206, 59,217,184,249,167,172, 89,189,150,106, 40,120,219,219,222,206, 5, 23,182,243, 23,127,249, 57, 78,156, 56,
-193,147, 59,143, 49, 48, 80,229,202,107,174,229,237,191,117, 13,247,222,183,139, 47,127,249,235, 4,126, 19,247,221,251, 19,146,
- 68,115,225, 5,151, 34, 21,220,249,253,251,248,241, 35,155, 56,127,245, 42,164,202,113,219,109,183,176, 98,197, 50,122,251, 6,
-248,241,143, 28,247,221,127, 39,214,198, 68, 38, 45,142,114,221,117,215,113,227, 13,203, 48, 9, 60,190,113, 43,187,247, 30, 5,
-145, 35,138, 83,247, 64, 98, 20, 66,230,113, 46, 0, 20,183,189,226, 38,132,132,135, 31,217,198,232, 72,200,230, 45, 79,242,154,
-215,190,130,213, 47,152,129,159, 83,252,224,158,251, 16, 18, 46,185,244, 42,118,237,120,138,131, 7,142,162,148,102,100,100,132,
- 37,203,150,130, 53,188,236,150,213,108,223, 17, 82, 9, 19,214,173,223,201,156, 57,139,120,241,139,175,196, 10,232, 63, 29,242,
-232,186,205,248,202,227,230, 95,122, 49, 23, 93,180,128, 98,222,231,161, 7,126, 2,164,125,170,135,241, 58,139, 68,100,149, 60,
-189, 44, 13, 55,205,231,217,183,111, 31,115,231,117, 33, 4,132,213,132, 31,222,255, 32, 77,165, 22, 22, 44, 88, 68, 18, 70, 76,
-155, 86, 76, 9,138, 19,105,217,216,204, 77,160, 84,154, 66,232, 28,140, 12, 13, 51, 58, 60,192,138, 21,139, 88,117,222, 26,246,
- 31, 60, 73,169,169,141,106, 24, 82,137, 66,134,134,134, 8,195,144,161,225,211,216,195, 21, 58,166, 53,115,244,216, 9,102,205,
-106, 35, 80,100,199, 73,159, 77,126, 71,165,149,185,107, 14,225,236,204,116, 37, 44,214, 24,180, 82, 16, 87, 33,233,199,110,251,
- 49,199,182, 62, 72, 48,214,139,136,199,104,245, 4,196, 9,214, 25,132,116, 8, 9, 57, 96,204,129,215, 52,141,196, 47, 32, 80,
- 60,182, 97, 3,131,145, 96, 4,192, 87, 96, 19,172, 17,105, 14,123, 28,165,145,140,170, 64,217, 56, 30,216,176,137,203,150,189,
-152, 25,126, 30,127,198, 44,226,147, 5, 76, 52,138,146, 30,213,177, 81,108,229, 52, 34, 26,166, 82,137,208,170, 64, 92,141,201,
-229, 74,168,104,148, 85,243,166,241,190, 95,189,141,165, 51, 91,105,246, 52,137,242,248,238, 35, 91,249,212,127,126,159,227,113,
- 66, 28,228,249,246,143,183,176,230,234,151, 16,225,227,108, 90, 92, 38,198,231,169,227, 99,172,219,182,143, 72, 55,227, 73,197,
-154, 37,139,185,225,234, 43,233, 44, 26, 90,138,138, 89, 10,222, 50,253, 22,214,237,249, 28,161,149,140, 38,240,192,166, 29, 92,
-115,237,121,228,115, 69,170,167, 43, 8,161,152,153, 51,252,206, 27,111,229,133,231, 47,166,181, 24,224,132,199,166,171, 86,243,
-238,127,248,119, 78,140,134,128,226,169,195, 61, 60,121,104, 41,143, 63,185,135,178, 85,228, 60,159, 78, 85,229,119,127,229,213,
- 92,123,241, 42,124, 34, 20,240,212,177, 83,188,255,147, 95,230,240,144, 69, 75, 31, 37, 37, 65,177,157,135, 30,125,156,131, 61,
- 39,137, 69,128,112,134, 75, 47, 57,159, 43, 47, 93, 69,123, 94,211,220, 12,157,213, 60,175,205,189,140, 61,135, 14, 51, 24,194,
-129,147, 67,220,245,200,227,116,118,118,162, 60,137,173, 14, 19,105,195,220, 86,143,119,189,242,102,126,233,162, 85, 20,176, 52,
-123,105,158,126, 98,211, 92, 88, 47, 40,101, 65,249, 38, 61, 61, 79, 72,140,117,160,242,144,105, 59, 9,176,121,251, 83,120,158,
-135,115, 48,123, 90, 11,109,165, 28,158, 20,227,117,165, 39, 49, 15,199,248, 1, 45, 66, 26,112, 85,132,203, 17,232,212,217, 85,
- 5, 14,197,240,174,191,251, 23,122,171, 49,121,165,185,104, 70, 19,239,248,173, 55,240,198, 63,248, 40,177,145,120,210,225, 73,
-131, 71,146, 6, 30, 74,199,165, 23, 47,103,213,220,199,216, 61,168,144,194,227,119, 63,249,125,126,240, 23,111,102, 89, 71,192,
-168, 83,148,146,126, 70,163, 86,190,182,177, 59,149,160, 42,125,188,248,202,229,180, 53,165,253,218,119,180, 23,170,163, 44,158,
-215, 14, 98,152,162,104,102,223,177, 94,202,158, 71, 83,232,192,149,201, 17,164,135,237, 76, 81,245,169,246, 60, 52,113, 46,183,
- 84,118,106,161,179,227,126,112,107, 99,242, 5, 73,165, 58,204,151,255,227,253,252,240,129,195,124,233, 75,223,226,203, 95,248,
- 22,175,126,205, 45,228,189, 34,149, 48, 97,180, 28, 98, 81,236, 63,116, 16,220, 24, 43,215, 44, 70, 73,159, 40, 42, 35,149,163,
-173,189,153,150,102,232,156,222,204,137, 19, 39, 40, 87, 66,164, 39,233, 90, 52, 7, 43, 33,182, 21, 60, 47, 32,142, 19, 70, 70,
- 70, 16,194,113,164,231, 32,137,137, 56,255,194, 21, 36, 49, 36,177,192, 10, 88,186,172,147,165,203, 3,146, 56,143,148, 17,239,
-249,253,215, 18,134,224, 7,240,145,191,249, 60,185, 98,130,203,234,105,228, 75, 62,198, 24,180, 23,160, 60, 8, 19,240, 60, 69,
- 24, 86,240,188,180,246, 9,170, 86,165,210,224,233, 60,163,163,101, 58, 58, 58, 82, 99, 95,134, 88, 52, 27, 55, 12,242, 79,127,
-119, 59,183,189,252,101,220,114,235, 75,184,227,142,255, 68,137, 4,173, 28,206, 84,144, 14,148,115,248,194, 67, 57, 73, 75,177,
-169,158, 2,214, 92, 42,161,132,192,154, 8,103,195,212,165,236,170,120, 74, 32, 44,196,198,225,121,153,158,104, 65,168, 84, 29,
-105,204,221,183, 86, 96,157, 34,159,111,162, 90, 49,108,218,188,149,114,185,202,139, 94,116, 3, 82, 58, 90, 90,139, 41,225,204,
-138,192, 36,177,197,243,130,212, 45,145,197, 35,196,137,201,228,251,144,150,230, 34, 3,167, 44,167, 79,157,102,207,158,180,166,
-134,149, 73,166, 16,200,180,122, 94,104, 80,162, 76, 84,237,166,179, 99, 26, 82, 26, 60, 33,207, 5,234, 2,235, 82,127,177, 32,
-171, 86,100,226, 52,109,203, 69, 16,134, 48,122,156,211,143,223,205,233,125,155,105,141, 7,200,187, 50,218,147,152,196,129, 83,
- 72, 93, 0, 89, 33, 73,170,104,149, 21, 18,241,125,116, 80, 66,248, 1, 3, 67, 67,132,198,165,145, 90,217,168,124,161, 9,171,
- 21,124, 95,101,135,182, 56,194, 40,100,112,112, 16,147,158,180,130, 95,106,166, 42,210,122,228, 54,137,201,249,154,177,177,126,
-194,209, 1, 92,123, 12,164,229, 2,141,141,104,203, 41,110,187,254, 10, 86,205,105,101, 86,222,225,185, 52, 82,228,245, 55, 95,
-192,182, 93,123,248,214,134,157,140, 70, 14, 95,195,147,251, 15,225, 5, 57,180,202,162,167,133, 98,111,247,113, 18, 89, 32,182,
-105, 64,196,177, 99,199,249,228,167, 62, 77,123, 9,226,234, 24,190,159, 99, 40,214, 8, 99,144, 54, 33, 52, 9, 71, 78,158,228,
- 68, 95, 90,121, 78,249, 30,210, 26, 46, 93,181,148, 23,174, 93,198,188,102, 65, 78,134, 72, 95,114,209,242,217, 44,154, 51,139,
-211,251,123,176, 73, 66,136, 98,119,247,113,122,135, 43, 56, 85,194,132,101,110,188,225, 18,174, 89,179,136,233, 58,162,228,129,
-246, 4, 29,211,102,243,214, 55,188,154,191,252,231,175, 96,240, 9,163, 24, 33, 61,158, 58,112,132,208,128, 83, 10,225, 44,123,
-158,122,138,127,252,167,167,104, 10, 4, 81,162,112, 50, 96,212,130,139, 35,148,240,137,147,132,125,135,123, 80,185, 38,156,245,
-240,114, 10,101,203, 92,117,225, 26,174,121,193, 98,166,251, 9, 77,249, 2, 66, 56,180, 39,145, 66,146,184, 52,128, 69, 9,144,
- 94, 90, 6, 56, 13,223,207,170, 86,217,212,111,182,253,152,225,112,239, 32,137,110,161, 32,225,226, 53, 43, 41,105,155, 6, 87,
-158,237, 32,151,115,236,108, 73, 28,163,180, 71,236, 4, 21, 9,127,246,137,239,176,245,192, 9,180,146,180,170,136,223,122,195,
-173, 76,247, 33,175, 29,214, 58,156, 73, 80,214,166,233,114, 2,156, 16,180, 6,154,247,191,250,114,126,245,111,127,136,107,110,
-231,192,233, 65,110,126,255,191,240,135,175,187,142,183,223,184, 22,188, 25,124,240,142,159,178,101,239, 49,114, 77, 57,242,218,
-242,123,175,188, 62, 11,206,243,120,201,218,197,172, 61,111, 49,111,255,226,102,142,246, 85,232,143, 3, 62,123,239,189,180, 5,
-179,248,214,129,227,252,145, 45,224, 39, 9,129, 39, 39,157,154, 55,213,166,218, 47, 0,229,107,178, 45,105, 64,152,112,134,176,
- 58, 66, 33,223,204,142,237,195, 28,237,222, 15, 73, 68,115, 83,137, 66, 62, 32, 10,199, 40,248,154,133, 93,115,217,191,175,155,
-166, 98,192,181, 47,188,142,190, 83,199,217,185,243, 41, 42, 46, 36,240, 28, 90,197,196,177, 70,201, 8, 41, 29, 77,205,121,172,
- 11,121,224, 71,247, 50,191,235,181,236,222,245, 20, 38,137,208, 10, 22, 45,154, 73,119,247, 65, 10,249,128,171,175,190,129,222,
-222, 94,118,238,220,135, 81, 18, 19, 87,113, 84,241, 84, 74, 2,181, 76,203,120,231,114,233,129,203,237,109, 69,246,237,221, 5,
-238,106,170, 85, 56,112, 96, 31,215,188,112, 62,149,234, 8, 99, 99, 41,184,245,247,159,102,229, 74,143, 48, 42, 19, 4,105,104,
-188,115, 41,216, 39, 73,196,204,153,211, 57,120,240, 0,107,214, 92, 72,121,116, 12, 99, 98,250,250, 78,178, 98,197, 10, 94,251,
-218, 75, 25, 29, 5, 33, 19,172,173, 16,120, 62,213,106, 57, 13,183,141,202, 72, 97, 41, 21,242, 28, 62,124,136, 74, 5, 60, 31,
- 54,109, 92,207,188,249,139,233, 59,217, 75, 98,170,105, 86,151, 74, 21,102, 33, 64,214, 79, 6, 21,245,115, 64,210,131,173,210,
- 2, 88, 90, 75,202,229, 42,125,125,253, 28, 60,116, 47,109,109, 29, 28, 63,126,130, 75, 46,185, 4, 99, 12,109,109, 77,169, 1,
-160,108,189,100,121, 90,198,215, 97, 13,120,158, 32,138, 44, 39,123,123,136,227,152, 85,231,157, 79,185,108,216,188,249,167, 12,
- 12, 84, 48, 66, 32,149, 68, 40, 85, 79,207,147, 66,161, 3,143, 56,118,236, 63,112,132,181, 23,172, 34,159,203,147, 16,115,182,
-132,189,212, 91, 46,210, 0, 32,132, 35, 49,105,244, 31, 34,171,139,222,191,135, 19, 15,221, 73,216,187,159, 22, 55,134,231, 98,
-132, 80,148, 13, 8, 29,160,188, 2,213,112, 12, 79,136, 52, 47, 81,164,190,248, 48, 54,228, 69,170, 88,116,182, 79, 67, 38, 89,
-253, 85,153,158,127, 30, 87,171, 20,242,121,202,233, 47, 20, 2, 69, 62,169, 48,163, 24,224,197, 17,184, 8,146, 52, 10,209, 56,
-139,214, 10, 79, 43,180,141, 9,135,250, 9, 60, 69,146,196, 36,194, 97,133, 37,239, 37, 44,237,154, 65, 62,167,201,229, 20,129,
-148, 24, 1, 5, 96,233,162,249,232, 45,123,144, 70, 17,155, 42, 39, 79, 30, 39, 14,171, 96, 18,148,116, 8, 18,202,229, 50,198,
- 41,164,151,195, 90,199,169,145,144,211, 35,195, 56, 51, 66, 78, 75, 92, 28,129,246,235,210,181,175, 12,213,145,126,162, 56,162,
- 92,141, 16, 34, 64,226, 88, 50,127, 14, 77,249, 28,202,135, 32, 40,164, 15, 21,200, 7, 30,202,165,114,177,242, 61, 78,158, 30,
-196, 42, 31,151, 24,218,138, 57, 86, 45,158, 79, 83, 78,210,148,211, 52,229, 36,145,117,120, 2, 94,116,241, 66, 62,161, 98,170,
-113,153,124, 46, 32,113,112,122,112, 4, 99, 37,210,211,184,176,194,192,224, 40,229,161, 16, 27, 85,113, 86, 18, 4,121,198,170,
- 21,148,214, 20, 68,130,150,134, 83,189,167, 88,176,240, 60,226, 80,227, 21,138,120, 81,200,202,185, 11,104, 45,228, 41,229, 32,
-151,243, 51, 54, 94,203,141, 77, 23,187,161,118, 58, 80, 38, 67,101, 7,187,104,161, 24,115,240, 31,223,185,143, 56,215, 76, 78,
-121,184,209, 62,110,185,254, 74, 2, 91,165,232, 21, 82, 75,178, 17,252,156, 64,138,122,157, 35,210,148, 73, 31,129, 64,251,146,
-136,180,216,206, 31,127,226, 78,238, 93,191, 29,167, 61, 74,241,105, 62,242,190,119,178,114,102, 27, 20,129, 36, 66, 74, 31, 63,
-171, 24, 40,132,200,206, 97,151, 40,147,240,166, 43, 86,209,243,250, 83,188,239,107, 63, 69,181,119,112, 98,172,151,119,126,250,
- 30,238,219,180,135, 37,139,230,242,175,223,222, 64, 16, 20,168, 14, 12,241,185,247,190,156,133,157,173,152,120, 20,229,121,152,
-106,149,135, 63,244, 42,222,249,217, 31,240,237, 77, 91,153,217,217,201,198, 63,121, 19, 85, 17,242,155,159,221,192,238, 61,123,
-185,120,197,146, 44, 47,216, 77, 56, 76,102,170, 77,181,231,213,175, 94,171,237,224, 68, 22, 13, 46, 16,194, 81,200,105,162,184,
-194, 71,254,250,195,248,129, 66, 41,203,255,247,166, 87, 51,208,127,138, 64, 27,132, 29,227,215,223,252, 42, 62,251,153,127, 99,
-227,186,135,216,186, 97, 61,113, 28,211,210,210,204,156,185, 51,176,102, 24,103,134,201,251,121, 92, 82,197,217, 81,138, 69,193,
-210, 37,243, 57,116,232, 16, 31,253,171,219,201,231,243,120,194,129, 29,230,215,127,245,229,124,234, 83,159, 98,227, 99,143,179,
-101,195, 86,140, 77, 40,148, 74, 44,152,183, 16, 79, 91,180, 20,105,244, 56, 96,195, 56, 53,254,133, 65, 8,205,171, 95,249, 74,
-254,252, 47, 62,198, 31,188,247, 99,140,142, 84, 89,186,108, 41,183,220,122, 5,143, 60,122, 23,127,254,161,191, 39,142,108, 90,
- 61, 45,174,226,121,134,176, 58,132, 34, 59,240, 83,132, 72, 25,241,203, 55, 95,199, 23,190,244, 69, 14,236,221,195, 83,123,118,
- 17,104,195,154, 85, 11,248,206, 55,255,147, 15,125,232, 95,233,237, 59, 14, 34,194,211, 43,152, 59,103, 6,251,246, 31,230,163,
- 31,251, 50,171,207, 91,141,246, 44,215,189,168,139, 77, 91,230,241,187,191,247, 39,180,181,183, 96, 76,196,255,185,233, 45,124,
-233,223,191, 90, 79,135,211, 66,214, 75,239,214,170,116, 70, 81,130,239,231, 82,182,238,210, 66, 60, 90,167,233,127, 39,122,143,
- 51,115,246, 12,142,247,164,198, 69, 53,138, 56, 61, 52,192,210,229, 11,234, 6, 0, 78, 97, 77,234,114, 20, 66,160,132, 70,121,
- 41, 67, 31, 28,234,199, 57,195,140, 89, 51,177, 8,118,239, 62,204,192,192, 24, 78,248, 4,129, 79, 24, 87,178,131,108,162,250,
- 33,100,158,244,168, 68, 85,202,229,144,227, 61,167,104,111,235,202,234,167,158, 37, 79,189, 86, 58, 87,146, 30,227,167,165, 73,
-153,203, 72, 47,246,224, 54,142,109,184,151, 92,165,143,230,120, 24,233, 18,132,150,140,185, 28, 81,169,149,182,105,179,200, 5,
- 62, 35, 7,118,131, 77,125,234,113, 28,167,150, 79, 84,198, 79,210,156,197,107, 46,191,152, 69,119,175,227,169, 83,163,196, 58,
- 7, 66, 35, 61, 73, 37, 10, 65,105,164,231, 97, 43,167,153, 81,244,184,254,138,139,241,227, 50,232,136,104,224, 4, 90,216, 44,
-157,192, 18,197, 9, 46, 47,209,129, 79, 24, 86, 50,210,104,113,194, 17, 35, 24,173,134, 40,237, 17,217,244, 84,175,154, 23,119,
-180, 26, 18, 27,139,115, 18, 65, 66, 75, 41, 79,239,169,211, 40,178, 35, 90, 19, 67, 83,224,163,133,161,146,132,104, 21,176,120,
- 97, 23,171,151,205, 71,203, 10, 62, 6,149, 88,164,239, 19,233,128, 48,172, 80,148, 6, 95, 88, 74, 90,224, 7, 26, 51,106,240,
-133, 67,216,132,156, 18,120,222,248,121,238,190, 74,243,220,147, 36,193,147,130,106, 37, 34, 63,167,152,254,174,114, 84, 43, 85,
- 78,143,142,224, 23, 2,164,159,246,187, 86,250,113,120, 4, 34,147, 32,132, 79, 20, 69, 56,103,104,111,107, 65,136, 94,146, 36,
-161,152,203,113,209,234,165, 44,232, 40,225,147,160,132, 38,177, 14,229,231, 49, 54, 1, 83, 70,153,152,153,237,237, 24, 79,161,
-165, 34,170,134, 20,148, 34,231,105,124,169,211, 34, 19, 89, 64,142,204,172, 60, 95,137,236, 72,214,148, 50, 24, 39,145, 82,225,
- 92,132, 16, 62, 85, 1, 59,143, 84,185,235, 39, 27, 9,117, 30, 89, 25,226,165, 87,173,101,209,236, 86, 90, 60, 67, 92,173,224,
- 21,243, 13,172, 35,205,163, 19,147,150,161, 64, 17,167,181, 93, 25, 5,190,241,240, 1,238,252,201, 70,180, 46,162,109,153,119,
-188,225, 54, 86,207,105,163,217, 87, 84,178,231, 45,132, 32, 10, 35,124, 63,151, 6, 14, 73,151,158,180, 46, 64,197,101,222,251,
-234,107,153, 55,163,153,223,252,151, 31, 82,206, 79,195,247, 44,223,223,118, 10,251,196, 9,154,253, 2, 29, 69,201, 71,127,251,
-165,188,233,242,149, 36,137, 3,165, 83, 23, 80, 80, 32,239, 28,159,127,215,109,212,170,252,153,244,184, 35, 54,125,124,105, 90,
-235,199, 89,164, 74,171, 37, 78, 81,245,169,246,220, 90, 22, 87,242, 52, 69,172,156,115,104, 37, 49, 22, 22, 46,152,199,187,223,
-253,219, 32, 60,164, 74, 72, 76,200,162,133,115,104, 46, 66, 95,191, 99,233,226,233,204,154,219, 65,123,123,142,143,127,244, 29,
- 28, 62, 52,202,240, 80,132,214, 30,203,151, 55,209,125,100,140,242,216, 13,116, 45,152,129, 0,222,248,186,219,184,245,229, 17,
-243,230,207,228,178,139,223,204,246,237, 39, 9,188, 2,173,173, 77,244,247,158, 98,230,172,118, 58,103, 72, 62,254,209, 63,224,
-232,209,144,193,193, 81,180,150, 44, 95,217,198,145,238,132,145,145, 43, 89,208, 53, 29, 45, 96, 97, 87, 59, 31,248,227,247,164,
-234, 92,150,108,222,218,226,243,247,183,255, 49,219,159, 60, 78,169, 84, 98,206,252, 38,132,130,143,127,236, 47, 56,114,176,151,
-233,157,211, 25, 30, 25,166,181,181,153, 32, 7,127,242,193,247,166, 32, 43,225,213,175,122, 25,165,166,118,166, 77,211, 44, 91,
-242, 65, 78,159, 30,226,237,191,249,122, 14, 28, 60,196,130, 5, 1,183,127,252, 79, 57,118,252, 20,157,211,167, 49, 58,118,154,
-214,230,128,105,211,138,252,195,223,127,156,158,227,167, 88,180,176,147,133, 11, 59, 65,194,239,191,247,205, 28, 62, 82,225,244,
-233,211, 92,176,118, 54,198,192,107, 95,247,114, 10,249, 60, 66,192,252,249,115,121,239,251,222, 89,247, 62,215, 0,221, 24,131,
- 68,165,233,110,164, 37,107,195,204, 93,188,108,233, 10,230, 47, 88, 66, 88,141,152, 59,119, 46,195,131,131, 41,160,171, 90,105,
- 91,129, 84, 41,143,118,134,122, 14,222,232,232, 48,195,195,131,104,173,105,110,106,165,183,127,140, 3,135,142,165,217, 57, 66,
- 83, 13, 67,132, 39, 17,194,166, 69,118,172, 72,139, 13, 57, 65, 79,207, 81,186,186,102,208,219,219,203,234, 85, 93,231, 60,161,
- 83, 91,145, 50,245,196,105, 60, 98,176, 33,132, 39,169,108,248, 22, 67,123, 54, 81,168, 14,146,151, 14,165, 45,149, 56, 97,204,
- 21,168,148,102,224, 47,186,130,220,252,133,216,158,167,136,213, 97, 2, 10,216,172,172, 96, 18, 69,184,129, 30, 84,229, 20,152,
- 14,186, 58,155,249,237,215,191,132,191,250,204, 87, 25,116,142,145, 68, 98, 85,128, 83, 18, 76,140,239, 28, 37, 97,184,254,202,
-139, 88, 50,103, 58, 45,193, 24, 12, 31, 99,248,200, 78, 74,113,136, 20,169, 21,101,117,128,213, 5,100,174, 37, 61, 85,200, 26,
- 60, 1, 85,231,232,173, 38, 60,178, 99, 63,215,156,191, 0,161, 36,161,133, 68,166,204,239,225,173,187,176, 34, 32,144,130, 92,
- 2,115, 59,166,177,111,223, 33,180,144, 84, 93, 90,162,101,193,140,118,252,120,132,160,224, 19, 69,163, 44,234,108,225,205, 55,
- 93, 78,123, 46,100, 90, 73, 19, 86, 29, 85, 52, 91, 14, 30,103,245,121,179, 40,141,166,105, 14,195, 10, 92, 20,162, 84, 33, 53,
-140, 76,132, 38, 65, 59,145,214, 34,183, 18, 95, 42, 92, 98, 80,202,195, 9, 71, 98, 45,179, 59, 90, 41,120,130,209, 48, 65, 4,
- 5, 30,218,180,131, 95,190,225, 42,138,121,234,192, 23, 2,159,255,246,157,140,233, 34, 97,172, 40, 72,131, 22, 9,243,231, 76,
- 71,203,125,196,153,187,100,238,244, 86,222,254,210,171,153,230, 25, 28,146, 16, 65,127,146, 6,102,116,228,161,232, 67, 20, 89,
-238, 90,255, 83,148, 24, 65,233, 28, 97, 82, 65,104,133, 84, 65, 26, 12,169, 64,169,244,148,189,172,178,116, 42,227,100,234, 2,
- 34,181, 82,165,147,196, 2,250,128, 63,253,228, 23,168,200, 28, 24,203,140,162,226,181, 55, 95, 75,158, 16, 79, 64,161, 88,204,
- 78, 84,163,225,200,218,134,163,107,157,203,246,180, 4, 41, 53, 35,192,250,189,131,252,229, 63,127,129,114, 34,104,146, 35,188,
-229,149, 55,114,235,213,107, 41,169, 42, 77,185, 22, 98, 1, 82,106,162,196,210,164,189,241,243,147, 77,106, 97, 27, 87, 5,207,
- 99,221,254, 33, 62,250,189, 61,132, 65, 7,206,140, 16,133, 6,103, 37,186,169,128,169, 86,169, 84,243, 20, 11,157, 56,151,160,
-204, 8,161,200,103, 85, 2, 83, 63,166, 49, 14,135,194, 9,149, 62, 83,192,216, 4, 41, 92,250, 69,178,226, 28, 14,209,169, 54,
-213,126, 30, 96, 63, 35,216,164, 94,175,187, 86,161, 77, 74, 40, 53, 9, 86,191,160,115,194,218, 83, 89,168,202,244, 14,193,244,
-142,185, 89,172,135,197, 34, 89,176,176, 52,193, 79, 63,111,126, 17, 95, 21,211,131,160, 28, 44, 92,216,129, 67,144,216, 20, 72,
-207, 95, 51, 3,157, 93,122,238,140,142,250,119, 53,208,176,168, 43,192,118, 5,245, 74,117, 93,243, 53, 74,205, 68,101,229,106,
- 11, 5, 88,181,106, 54,182,150,217,238, 82, 97,214, 89, 88,189,102,214,132,106,119, 45, 37,104, 62,111, 58, 74, 65,199,244,230,
-116,140, 6, 86,175,156,159, 25, 50,176,112,193,244,250,215,107,126, 87,145,174, 5, 69, 0,206, 95,189, 0, 99, 97, 90, 7,180,
-182,117,224,128,153, 51,218,145,153,202,216,209, 33,232,236,232, 68, 0,171, 86,207,206,206,155, 23,204,239,202, 51,191, 43,159,
-238,173, 2, 22,118,181,212, 79, 66, 43,150, 52,171,215,116,213,207,118,240, 60, 47,221, 83, 82, 93, 30,178,125, 86, 41,197, 96,
-223, 0,109,109,109,233,193,100, 21,203,216, 88,133,177, 74, 21,131,165, 82, 41,211, 84, 42,164, 85, 39, 93,237, 96, 44,133,181,
- 73, 70,208, 6, 25, 28, 26,194, 90,203,252, 5, 11, 25, 30, 9,121,228,177, 13,196,214, 3, 41,136,108,140,210, 2,227, 76, 86,
- 7, 67,226,156, 65, 42,205,208, 64, 63,109,237,205,228,114, 30,203,151, 47,169, 27,124,103,203,171,213,178,118,218, 23, 54,149,
-188,199, 78,112,242,209,239, 98,246, 63, 70, 49,236,195,195, 98, 35, 71,132, 34,201,181, 17, 21,103,209,178,248, 18,212,130, 75,
- 48,197, 34, 74, 25, 42, 79,110, 34,103, 5, 57,169,112,113, 76, 33,128,209,129, 35, 68,221, 59,240,219,103,208, 18, 20,185,229,
-138,149, 36,209, 43,249,247,239,221,207,225,129, 17, 70,179,114,172, 5,207,103, 86,107,145, 27, 46,189,152,215,222,112, 9,109,
- 98, 24,226,211, 36, 59, 30, 37, 31,158, 74,207,114, 7, 16, 30, 86, 7,120,205, 51, 48,186,136,149, 30, 2, 69, 18,197, 80, 40,
-146, 72,197,119,126,244, 40,109,210,113,221,218, 85, 76,107,153, 70,119,223, 32, 95,188,235,126,158,234,238,197, 26,141,118, 17,
-231, 47,155,199,170, 69,115,120,116,195, 22,162,196, 34,253, 0,233, 44,139,103,181,179,118,201,108, 30,217,223, 71, 33, 40,242,
-196, 19, 91,249,241,156, 86,110,184,114, 41,224, 81, 45, 59,190,123,207,143,184,235,209,199,184,108,237, 26,126,245,198, 43, 88,
-185,116, 49, 86, 66,193,207, 97,134, 98, 34,226,250,201, 65, 74,164,233, 16, 90, 42,162, 16,124,175, 86, 40, 7,136, 66, 22,205,
-108, 99,217,156, 14, 70,186, 71, 24, 30, 29, 99,207,145,144,191,254,231, 47,115,235,245,151, 49,111,102, 59, 54,138,121,104,195,
-147,252,104,253, 19, 12, 85,211, 3, 77,243,165,128,234,232, 32, 47,186,226, 98,238,125,120, 43,135,250, 43,132, 85,203,143, 31,
- 94,199,197, 51,255, 47,123,239, 29, 38,201, 85,159,251,127, 78,168,170,142,147,211,134,153,205, 43,105,119,181,171, 44, 20, 73,
- 2, 99, 25, 99,146, 1, 25,219,216, 36,219, 96,204, 5, 95,204,181,125,125,109,192,198,228,100,146, 1, 95, 16,112, 65, 34, 11,
- 36, 64, 8, 16, 8, 33, 1, 22, 32,105,147, 86,155,195,236,238,236,204, 78,236,233, 80, 85,231,156,251,199,169,238,233, 89,173,
- 34,248,254,236,231,167,122,158,121,170,167,167,167,170,171,234,156,243, 77,239,247,125, 75, 92,178,105, 45,185, 92,200,225,147,
- 51,188,255, 83, 95, 98,110,118,150,231, 61,241, 60,158,116,241, 57,172, 89,221, 79,104, 27, 4,210, 81, 79, 83,194,192, 3,217,
- 22,148,238,188,135, 45,156, 88,156, 50,111,169, 6,100,111, 74, 77, 13,248,226,247,118,241,139, 61, 71,145,185, 14,130,180,202,
- 51, 46, 63,143,179,134,123, 40,202,148, 64,123,183, 36, 49,134, 32,200, 48,226,153, 65,111,210, 59,122,249, 62,137,192,203,186,
-222,117, 96,142,191,252,199,119, 83, 73, 4,145,130,171,206, 63,139,107,174,186,132,206,160, 78, 87, 62,196,185, 6,185,176, 64,
- 35,169,147, 43,245, 19,207,206,121,161, 29, 37, 61,255,181, 5,165,114,252,120,215, 81,126,231,205,159, 35,161, 64,221, 9, 86,
-118,215,249,251,151,254, 38,187,246,140,243,209, 91,239, 98,218, 69,104,153,240,156,127,190,150,151, 63,101, 61, 31,121,249,179,
-209,166,154, 93,170, 91,184,228, 83,138,156, 77,173, 62,178,116,255,227,246,252,241,237,215,190,185, 83,246,139, 28, 71,235,213,
- 19, 22, 73, 20,219, 22,176,121,225,227, 94,178,121, 65,105, 65,147,164, 14,165, 29,161,150, 52, 26, 9, 81,228,215, 38,139,193,
- 26, 67,144,209,105, 75, 41, 48,169, 7,233, 53,201,106,172,245,138,141,214, 26,100,134,187, 66,136, 76, 4,198,167,202,149,206,
- 86, 8,231,144, 34,196, 24,207,225,144,117,173,162,240,226, 91, 77,188,149,179, 6,173,156,151,215,146, 26,103,133,167,188,117,
- 96,140, 7,164,121,150,105, 47,198,101, 50,175, 67, 0,206, 38, 40,225,144,104,164,242,217,208, 36,129, 40,200,238,155, 77, 61,
-186, 28,129,196,120,190, 79, 1, 6, 15,228,117,194, 59, 48,169,243,220,186, 65,155,146,100,156,164, 68, 97,118,223,154,220,234,
- 34,171, 33, 59,207,167,113,228,200, 81, 46,188,224, 66, 70,143, 77, 50, 49, 62,141, 19, 32,133,166, 50, 55,207,212,236, 12, 14,
- 15, 54,110, 52, 18, 42,149, 10, 51, 83,211,158, 58,118,118,198,183, 31, 14, 13,209,136, 45,149,185, 58, 59,118,238,161, 86, 79,
- 17,210,119,131, 41, 33, 72, 76, 76,148,243,216,128, 32, 8, 16, 66,130,177,212,170,115, 44, 25,234,163,175,183,196, 64,127, 55,
- 54,171,239,159, 54, 82,199,165,104, 33,193,166, 96,230,169,222,125, 43,141,125, 63, 39,168,205,163,130, 0,105, 83, 82, 45,169,
-171, 18, 73,231, 74,202, 27,159,138,236, 95, 75,208, 49,136,202, 73, 8,150, 33,186,187, 97,226, 36,202,197, 32, 13,194,212,137,
-210, 49, 78,236,248, 49,203,122,122, 17,171, 67,150,132,253,188,248, 73,231,112,217,134,213,236, 58,120,132,189, 71, 71, 73, 19,
-203,138,193, 37,244,119,150, 89,183,118, 57, 93, 98,150, 30, 29,195,222,109, 76,236,188,157, 14, 55, 11, 50,245,131, 7, 65, 35,
- 85,168, 66, 31,170, 52,136, 44,228, 72,172, 35, 44, 20,153,183,142,196, 89,166,141,229,223,110,184,141,175,126,255,151,224, 20,
-243,198, 49,103, 12, 86,228, 8, 69,204,242,142,144,223,187,250, 10,186,131,196, 3, 34, 84,128, 49, 49, 5, 13, 75,242,154, 55,
-190,252, 37, 76,254,203, 39,185,239,232, 36,227, 97,129, 15,223,244, 93,174,191,243,199, 68, 97, 64, 90,135,177,227, 39, 48, 50,
- 96,242, 39, 63,199, 86,199,249,235,215,190, 6, 74,218,115, 38, 11, 69, 46,202, 97,149, 32,182, 54, 99, 49, 18, 45,166,162,164,
- 81, 39, 16,158, 4, 54,231,234,172,234, 10,249,179, 23,252, 54,255,227, 3,215, 19,167, 48,211, 48,252,224,238,221,252,124,215,
- 17,130, 32, 32, 73, 18,230,170, 13, 18, 66,164, 20, 68,133, 60,141,234, 20, 26,199,112, 95,137,231, 63,249,124, 62,126,253, 77,
-204,134,157, 28,171,166,188,237,250,155, 25,248,206, 29, 32, 12, 39,103,103, 57, 58,211,160, 36, 97,230,134,111,210,221,219,197,
-210,225,126, 66, 29, 33,172, 34,148,138,208, 26,164,105,224,164,193, 72, 65,139,229,222, 65,147,212,214,102, 99, 58, 37,197,185,
- 20, 35, 20, 41,146, 3,147,150,127,249,212,245, 16, 21, 8,226, 26,155,135,251,120,201,111, 63,141,176, 62, 79,190,179,136, 86,
- 1,177, 1, 21,168,197,152,119,103, 91, 53, 38,200,168,116, 5, 28,173,193,155, 63,250, 25, 38, 69, 14, 33,171,156,179,110, 5,
-175,255,163,231,211, 97,171, 20,149, 32, 10, 2, 44, 48, 11, 88, 41,136, 77, 74, 49, 95, 32, 78, 29,181, 24, 82,237,125,132,137,
-249, 6,175,252,240,215,153, 21, 61, 88, 53,197,250,222,144,155,255,250,117,172,232,211,112, 41,188,236, 41,231,240,242, 15,223,
-200,109, 7,103,232,140, 10,124,226,198,125,212,147,239,240,233, 63,123,250, 35, 95,119, 31, 87,105,123,124,251, 15, 15,218,205,
- 41,181,118,239, 84,186, 7,196,246,114,193,240,187,133, 37,125, 33,173,175,125, 64, 17,138,150,167, 26,134, 1,105, 86, 71, 6,
-231, 13, 45,144,166, 14, 41, 21, 58, 3,135,185,140, 16, 74, 88,239,144,171, 44, 7,157,166,177,151, 61,118,169,183,125,210,147,
- 94, 59, 12,214,106, 42,115,150, 35, 71,142,176,113,227,136, 7,247, 9, 31, 13,239,185,255, 8, 35, 35,203,201,135, 30, 4,236,
-161,116, 98,177,255, 34,124, 61,218,171,177,137,172,230,109,144, 82,177, 99,251, 17, 86,174, 92, 78, 46,231, 51,136,198,165, 8,
- 17,128, 21, 68,129,167,233,129,196, 27,105, 19,123, 22,186, 48,196,186, 20, 41, 36,210,166, 8,169, 73, 18,131, 21,150, 80,103,
-107,144,213,190,108, 39,124, 59,109,243,158, 55,234, 41, 81, 46,132,172, 11,172,153, 74, 95, 49,178,134,234,188, 97,102,186,138,
- 53, 10,169, 21, 74, 73,194, 48,199,142, 29,247,209,209, 81, 32, 80,138, 98,161, 76,161, 80,162,167,183,159, 40,159, 99,205,154,
- 53, 40,173,185,239,190,251,233, 27, 24,228,235, 55,222, 76,169,220, 69,160, 67,223,174,108, 13,198, 56,194, 48,194, 89,135,150,
- 94, 91, 69, 33,185,127,207, 46, 70,134,151,160, 20,156,117,230, 58, 15, 77,147, 18,151, 93,211, 3,140,186, 16, 25,220,199,247,
- 17,112, 96,231,189,116, 39, 13,242, 90, 96,141,164, 66, 68,146,235,194,245,174,166,103,221, 19,112,131, 27, 81,189,203, 8,100,
-128,151, 10,235, 97,201,186,115,152,153, 60, 68, 18, 59, 52, 18, 27, 55,232,200, 7,196,179,135, 57,252,243,155, 25, 81, 2, 6,
-207,164, 51,234,101,203,210, 34,171, 58,150,146,156, 59,236,131,181, 70,131,142, 32, 64,184,113,100, 58, 3, 7,182,114,228,206,
-111,211,101,231,209, 73, 21, 43, 52,137, 83,168, 92,145,196, 21, 25, 88,178,146, 36, 43, 60, 23,180,163, 24,207, 18, 21,202, 68,
- 81,192,240,210,181, 28,217,119,136, 90,181, 78, 61, 53,136, 32, 36, 18, 16, 73,203,250, 21, 3,188,224, 25,151,114,241, 89, 35,
- 40,173, 40,153,121,122,100, 13,164, 36,170,159,164,232, 42,140,172,236,229,141,175,184,134,143,125,225,235,236, 25, 29,103,170,
-214, 96,236,100, 29,107, 45, 90,132,168, 64,211, 91, 10,185,104,195, 70,254,232, 57, 79,241,244,180, 49,228,109,157,193, 40, 66,
-186, 20,109,235, 20, 11, 17, 54, 73,145,249, 0,147,164,228,148,166, 63,111,233,209, 13,226, 56,166, 59, 72, 97,126,138, 43,207,
- 91,197,223,252,233,239,243,217, 27,111, 97,215,254, 3, 52,172, 99,110,190,142,115, 53,164,132,174, 98,137, 13,235,215,179,115,
-231,118, 42,181, 9,202, 65, 66,135, 54,148, 92,202, 43,158,123, 37,229, 40,228,115,223,253, 9, 71,166,230,169, 86,171,236,173,
- 76,163, 67,129,147,130,238, 82,158,161,206, 2,207,123,194, 21,108,222,112,134, 39,103, 17,150, 46,215,160,150, 54,232,204,167,
- 68,162,129,114,198, 91, 86,233, 1,112,194,137,140, 71, 50, 3,191,100, 50,176, 82,120, 93,247, 41,224, 45, 31,248, 56,115,214,
- 27,254, 14,149,240,138,223,253, 45, 58,180,165,175, 88,244, 34,181, 82,161,164,247,226, 91, 78,175,104,234,198,219,108, 17,240,
- 17,250,156,128,215,255,227,199,217, 53, 58,195,108, 42, 88, 51, 60,194,171, 95,243, 74, 76, 0, 50, 23,146,132, 48,110, 32, 23,
-248,154,187, 12, 11, 24, 11,243,113,234,241, 13, 26,106, 2,242, 18,222,115,221,119,217,113, 34, 69, 7,134,161,156,228,243,175,
-187,134, 21,189,138,122,165, 65, 20, 54, 88,179,188,204,173,111,189,134,107, 62,112, 35,215,255,108,156,124, 23, 92,119,235, 47,
-120,225,185,195,252,214, 69,222,251, 91,114, 0, 0, 32, 0, 73, 68, 65, 84,103, 44, 94, 93, 30, 24,178, 63,192,184, 63,110,216,
- 31,223,126,253,155,225,244,253,235,238,180,188,229,167,111,194, 88, 48,251,237, 98,102,105,150,118,151,178, 37, 77,149, 69,215,
- 18,165,165,143,210,179,233,111,172,244, 37, 41,165, 60, 77,109,243,168, 34,244, 56,166, 76, 8,204,100,103,215, 40,164, 16,236,
- 63,120,140,247,188,251,131,252,239,127,123, 7, 14,208, 89, 38,248,159,254,233,221,188,225, 13,111,224,156,205, 75,113, 86, 98,
-156,244,211, 43,227, 53, 51,105, 86,106, 16,180,176, 55, 14,213,210,172,122,203,155,223,203,255,252,187,191,225,236,141,189, 94,
- 24,170, 13,212,102,129, 52, 21,132, 58, 4,155,128, 12, 9,132,204,250,194, 67,223,169, 99, 51,221,141, 64, 97,109, 83, 38, 54,
-123, 95,251, 53, 78, 8,157,161,224, 5, 81,206,103, 8,164,178, 72,165, 50, 41, 84, 47,211, 60, 57, 51, 77,146,120,192,184,203,
-152, 81,247,238,221,207,178,101,131,156,123,238,133, 94,103,164,237,113,186,140,214, 54, 78, 29, 75,150,141, 48, 53, 53, 67,103,
- 71, 15,251, 15, 31,165,187,119,128, 48, 87, 32,169,123,158,143, 64,105,230,231,231, 17,194, 49, 95,173, 48, 59, 59,203,224, 64,
- 31,165, 98,158, 21,195, 3,244,247,148,252,243, 51, 38,115,168, 78, 19,169, 59, 20,245, 70, 66, 46, 84, 32,115,116, 47, 89, 77,
-188,127,154,200, 84, 65,134, 84,163, 1,212,178,141,148,215, 95,130,233, 25, 33,215, 49,128, 83, 33, 58, 12, 60, 93,172,236,166,
-180,230, 92,234,123,126, 73, 50, 94, 71,216, 4,165, 19,156,105, 80, 86, 49,241,196,118,198,127, 56, 78,215,138, 11, 8,206,184,
- 16,122,150,210, 81,238,241,143, 34,137,161,216,128,120, 14,142,237,165,177,103, 59,211,251,183, 83,106, 76, 34,109,156, 33,176,
- 37, 82, 68,204,212, 28,165,149,203,161,171, 7, 89, 46,162, 37, 60,243,178, 45,172, 95,218, 75, 37, 73, 65, 40,250,250,151, 48,
- 54, 54,193,174,189,251,152,153,155,167, 94,175,211,219,221,201,198,117,107, 24,236,233, 96,197, 80, 55, 93, 57,133, 16,240,151,
- 47,186,138,231, 95,185,153,216, 57, 10,161,160,156,171,146,211,130,167,156,187,140,117, 75,255,128,157,247,239,103,239,161,163,
- 28,157,152,204, 34, 86,193,202,229, 75, 88, 53,212,207,153, 43,150,211, 95, 8, 41,135, 1,132,240,206,191,122, 5, 19,149, 6,
- 38,174,177,118,168,132, 78,103, 9,243, 69,143,174,199,208, 33, 53,127,250,220,167,240,219, 79,186,152, 70,146,210,223, 89,166,
-183, 88, 32,116,240,252,203,151,179,101,228,185,108,223,123,152,237,123, 14, 48, 83, 79, 72,147, 6,253,229, 2,155,206, 88,195,
-170,225,229,140,141,157, 73, 45,110,160, 92,202,234,193, 78, 58,100, 76, 57,212,252,254, 51,158,192, 69,155,215,115,224,232, 9,
-118,239, 63,192,201,217,105, 82,155,208,217, 81,102,120,112,144, 53, 75,251, 57, 99,176,135,238,188,166,224,224,137,103,159,193,
- 7,255,234,229, 84,226, 58, 53, 51,199,218, 85, 67,228,100,138, 70,251, 72,192, 57, 63, 0,197,194,138, 97,147, 4, 29, 4, 24,
-107,136, 37, 92,247,237,123,184,115,215, 40, 85,151, 35,176, 85,158,251, 27, 79,224,252,181, 75, 40,170, 24,137, 32,140,162, 86,
-105,112, 81, 18,219, 45, 32,122,155, 91, 3,248,219, 15,125,147, 59,246,141, 51,111, 3,148, 86, 88,149,231,109, 31,189,158,162,
- 73, 80, 54, 69, 69, 57,143, 76,117, 16,203,136,122,154, 7, 41, 73,195, 60, 31,255,194,151,249,206, 55,225, 37,207,124, 10, 79,
- 58,103, 29, 31,254,238, 61,148,242, 67, 84,106, 39,249,243,103, 95,196,185,203,122,168, 55,234,144, 11, 73, 26, 13, 18, 18,114,
- 90,240,153, 63,255,109,246,191,241,163,220,117, 60,197, 6,101,174,189,109,231, 98,163,222, 44, 17,180,107, 90,158,198,128, 63,
- 30,181, 63,190,253,250, 55,197, 98,185,163,118, 73, 40,211, 38,182, 37, 50,222,248, 76, 80,234, 20,152, 71, 83, 5,209,100,170,
- 46,214,196, 72,149,227,228,201, 58,179,115, 85,134, 71,122,152,152,152, 69, 43, 71,119,119, 39,135, 15, 78, 83, 44,150,153,171,
- 76,177,122,117, 31,147,179, 41,198, 38,244,244,228, 57,122,108, 10,151,228,153,155,155, 99,211,230,126,102, 43,134,147, 39, 79,
- 50, 60, 60,196,201,201,154,255,159,145,165, 72, 9, 58,136,104,196,176,243,190, 41, 14, 29,218, 71,148, 15,185,242,201,103, 35,
-116, 9, 43,188, 67,254,131, 91,119, 80,173,215,232,237,237,230,252,139, 87,179,115,231, 97, 58,242, 93,236,216,126, 31,113,154,
-240,244,223,184,148, 92, 4, 59,118,236,231,240,161,227, 52, 98, 65, 84,232,197,184, 34, 51,115,240,131, 91,239, 64,170,136, 51,
- 55,108, 98,229,170,136,109, 91,143,177,102,205, 18,118,236, 58,204, 96, 79,158, 37, 67,125, 76, 77,195,109, 63,186,155,196,198,
-172, 93,183,146,179, 55, 12,176,117,231, 24, 43, 87, 13,178,111,223, 9, 6,251, 58,153,158, 26,103,223,190,125, 32, 5,195,203,
-150,179,122,245, 42,114,145, 68, 42,235,115,149, 30, 84,132,177,153,134, 5,150, 19, 39,142, 99, 81, 56, 39,125, 38, 91, 42,246,
-238, 61, 64, 16,230, 25, 89,177, 14, 41, 37,149,121,139, 49,134,169,169, 41, 76, 98, 73,140,161, 90,169, 80,173,215, 61,176, 87,
-104,250,250, 7, 57, 54, 62,201,236,236, 44,221, 97, 30, 37, 36,214, 56, 70, 15, 29,166, 90,171, 80, 46,151,232, 40, 23,233, 88,
- 54, 4, 46,161, 84,136, 56,103,203, 58,223,126, 14, 40,241,224,212, 87, 90, 2, 81, 20,120, 87,201, 5, 44,217,114, 37, 7,171,
- 85,230,167,246, 35,164,166,188,230, 60,138, 43,207, 37,238, 94,141, 43,118, 35,180, 34, 12, 20, 38, 73, 81, 90,130,204, 65,199,
-114,250, 54, 92,194,193, 31, 77, 80, 74,167, 40, 75, 71,146,250,134,126, 77,157,180,106,153,216,113, 59,246,208,110, 92,199, 0,
-229,161, 21,232, 98, 25, 29, 72,226,153, 19, 84, 78, 28,164,113,226, 8,185,250, 28,121, 27, 19,186, 6,129, 22,164, 86,147,138,
-144,154,139, 72, 59,151,177,108,227, 37,204, 21,123,200, 21, 75, 24,155, 50,220, 91,102, 73,231, 58,234,245,122,198,200, 31,194,
-112, 55, 87,108, 89,141, 19, 10,155,198,104, 44,210, 89,114,161,166, 24,133, 96,189,130,208,198, 21,125,172, 95,214, 67, 45,142,
- 17, 2, 10,145, 65, 42, 75, 1, 56,107,176,196, 72,233, 76,204,121,155,168, 26,131,193,115,169, 11, 99,232, 10, 3, 92,163, 65,
- 62,146,132,202, 79,185,139, 55,172,194, 24,136,227, 58, 74, 37,228, 2,141, 80, 25,148, 82, 9,108, 90,231,156, 53,203,217,176,
- 74,146, 26, 95,167, 42, 4,142, 98, 0,113, 18,115,230,146, 34,171,135, 54,114,213,197,155,152,174,167,228, 67, 77,144, 54, 80,
-214,215,191,206, 28, 88,129, 68,208,168, 85, 41,228, 3,180, 86, 8,235,232,201, 11,206, 91,217,195,198,165, 93, 36, 23,156,201,
- 92,173, 14, 82,160, 36,104,107, 40, 42, 40, 69, 94,156, 39,138, 96,249, 80,137,161,222, 18,213, 36, 37,150, 9, 82, 9,242, 74,
-162, 90,218,195,222,162,183, 43, 26, 5, 65,144,169,185, 41, 14, 76,194, 7, 63,251, 21,230, 9,201,107,197, 72, 87, 7,191,243,
-164, 39,208, 21, 26,114,205, 99, 52,193, 27,214,139, 48,156,154, 29,108,213,166,157, 39,175,184,229,182, 31, 97, 40,147,115, 14,
-105, 83,142, 31,222,207,152, 53, 72, 43,136,130,136,106,173,225,181,147,165,102,174, 22, 19,150,123,112,214,208, 48,150,125,135,
-143, 49,105,102,184,250,146,243,136, 13,212,194, 62,100, 26,147,203, 5, 92,117,206, 6,176, 16,161,113,105,131,185, 48, 36,103,
- 27,216,121, 73, 80,208,252,229, 51, 46,227,154, 15,221,132, 46,245,113,199,253, 71, 57,189,206, 93,155,145,111,215,180,124, 60,
-106,127,124,251,127,106,228,219, 95,219,214, 88,109,206,171,135,194,207,251,232,215,131,173, 44,112,247, 61,219,248,226, 23,190,
-206, 7, 63,242,102,190,240,197,155,192,166,188,234,207,254,128,183,189,243,131,188,240,133,215,240,133, 47,124,142,247,125,224,
-239,248,228,167,191, 76, 16, 40, 94,245,234,231,243,230,127,122, 23, 47,250,221,151,112,237,181,215,242,166, 55,255, 45,247,222,
-251, 75,110,249,246,119,120,255,251,223,196,255,249,220, 13, 20, 75, 33,171, 95,250, 92, 26, 73,150,244,211, 1, 55,125,243,219,
-140,140, 44,231, 27,215,125, 17, 35, 95, 78,108, 37,137,213,188,237,157, 95,102,110,102,150,179,183,108,230,134,111,124,137, 74,
-227,185,124,242,127,127,140,114,177,196,213, 87, 63,147, 27,191,117, 11, 19, 83, 85, 46, 60,111, 35,239,123,255,135,184,236,138,
- 43,145,178, 72,108, 97,106,182,193,251, 94,251, 94, 46,188,232,124,148,174,243,217,235,222,194,123,223,247,143,188,253, 29,239,
-163, 84, 42,176,114,197, 82,174,188,226,124,250,250,251,120,239,123, 63,137, 37,224,172, 77,107,120,251, 59,223,207,107, 95,243,
- 90,222,241,142,119,210,221,219,205,240,240, 50,214,174, 90,201, 55,111,252, 26, 79,121,234, 19,113,206,241,197,235,110,224, 13,
-111,248,239,108,218, 56,132,117,170,197, 2, 39,132,207, 82, 54,245, 41,102, 42,115,148,138,157,158,143,223, 38,204,207,207, 51,
- 49, 49,193,166, 77,155, 8,131, 60,247,237, 60,204,248,196, 24, 38,117, 56,233,213,106, 44,190, 94, 46,148,194,153,132,114, 87,
-142,124,161,192,200,200, 8, 91,183,237,160, 82,169,130, 9,112, 66, 80, 42, 20, 88,178,100, 5, 82, 90,207, 30,168, 13,197,124,
-158,243,207,219,136, 18, 94,184,198, 90,159, 37,113,182,169, 24,121,106,250, 61, 77, 64, 43,172,144, 72,157,135,145, 77, 12,133,
- 29,164, 83,199,176,214,146,239, 89, 70, 18,148, 9, 75, 93,200, 32,204, 90,222, 44, 4,154,134,133, 80, 42, 68,216, 9,171,158,
- 64,120,228, 56,201,222,219,136,147, 10,132,129,111,205,114, 33,194, 73,116, 58,139,156,107,160,171, 99, 36,199,182,210,208,154,
- 36,109, 16, 98,209, 46, 69, 99, 9,149, 64,217,212,171, 12, 53,234,200, 48, 71, 77, 40,230,130, 14, 58,215, 92, 68, 37,191, 12,
- 93, 26,196,164, 30, 24, 97, 76,130, 12, 3,180, 46, 16, 74,159,136,105, 56, 75, 49,175, 72, 83,135, 82, 33, 73,163, 74, 49,151,
-195,164, 9, 74, 24,148, 86, 30,220,144,213,147,186, 66,223, 75,238, 1,131, 54, 99, 35,130,238, 92, 64, 98, 82,114,121, 77,146,
- 36, 20,195, 28, 46,246,194, 55, 97, 49,204, 2, 89,131, 16, 10,173, 4,129, 53, 20,242, 57, 82,153, 35, 21, 14, 33, 36,169,115,
- 8,147, 18,232,128, 8, 73,232,124,118, 40, 12, 20,198,212, 49,105,157, 48,136,136,109, 74, 73,120, 35, 88,138, 52,214, 66,152,
-211, 8, 39,112, 50, 68, 75,207,109,222, 81,240, 53,158,196,164,144,225, 99, 34,101, 8, 67,135, 22,146, 14, 34,116, 36, 72,140,
-195, 74,145,241, 15,164,168, 0,210, 76, 30, 77, 9,232, 12, 53, 78,104, 82,231, 80,120,109,102,140,201,248,216,155, 70,221,100,
- 96, 54, 47, 65, 91,145,240,119,255,114, 45, 83, 54, 79,106, 12,229,116,134, 87,253,238, 31, 50,220, 29, 17,138,132, 48, 95,242,
-234, 69,194,122,206, 3,235,239, 13, 45, 50,135,133, 90,125,179, 92, 24, 72, 8,171,147,116,229, 28,169, 5,147, 36,148, 35,131,
-177,134, 80, 22,137,107, 53,122,149,196, 38, 53,156,128, 40,151,163, 98,231, 16,104,148,179, 40,231, 40,235, 8,109,125,154, 47,
- 47, 28,177,153,167, 28,194,242,174, 46,112,117, 42, 88,242,198, 59, 80,214, 58,136,242, 56, 83,103,120, 89, 9,235, 28,121, 37,
-152,170, 38,190,134,184,200,104,159, 6,173,212, 52,238, 82, 62,110,216, 31,223,254,131, 82,239, 15,102,208,155,101,246,224,148,
- 44,251, 2,108, 78,192, 3, 36, 82, 69, 22,249,215,227, 6, 58,212,108,220,184,133, 79, 76,127,158,241, 19,176,237,222,125,204,
-215,234, 60,231,121, 80,173,165,172, 90,187,134,169,217, 42, 19, 83,176,107,247,113, 42,243,243, 60,235, 56, 84, 19,201, 25,103,
-175,167,163,187,131,125, 7,142,114,232,208, 73, 38,167, 45, 63,255,229, 20, 99,199,235, 60,237,105, 23,144,113,120, 97,157,195,
- 73,195,107,254,242, 26,180,134,233,106,133, 59,127,122, 23, 78,105,142,140, 29,231,238,123,118,240,202, 87,190,146,254,161, 94,
- 70, 79, 76,112,251, 29, 91, 73,109,129,151,189,242, 37,156,123,238, 10,156,200,113,207,214, 29,220,118,251,221, 60,225,178, 39,
-241,146,151, 62,147,196,193,205,223,187,147,201,169, 89,116, 88,230,146,203,174, 68, 4,150,173,187,238,225, 71, 63,254, 5, 74,
-107, 94,246,210, 63,224,194, 11, 86,147, 26, 56, 54, 54,205,206,251,182,241,254,127,121, 55,189,131, 80,169, 77,240,195,219,127,
- 70,177,216,203, 31,189,228, 26, 46,190,120, 37,239,123,239, 23,185,234,233,207,228, 15, 94,114, 21,194,194, 15,191,255, 83, 76,
-186,192,207,145,182,128,104, 50,171,169,123, 97,175,190,222, 65,238,187,111, 15,133, 98, 7, 93,157, 61,220,183,107, 7,221, 61,
-157,244,246,246, 18, 69, 69, 14, 30, 62, 70,189, 1,185, 92,129, 70, 18, 19, 6, 17, 88, 60, 81, 27, 14, 41, 4, 83,147, 51, 56,
-103, 40, 20,114, 60,249, 73, 87,178,103,239,126,226,154, 5, 41,136, 66,141,181, 13, 58, 59, 11, 12, 13, 12, 49,180,100,128, 82,
- 33, 79,190, 16,100, 57, 25,135, 49,158,132, 76,200, 7, 3,202, 41,225,217,188,130, 8,135, 36, 73, 33, 24, 92,139,234, 28,194,
- 25,223,167,155, 47,118,128, 82, 89,187,132,239, 77, 72, 51, 89,214,196, 58, 66, 25, 64,121, 41, 75,158,248, 44,198, 42,199,152,
- 25,139,201, 41,131, 72,235,104, 11,194, 38,148,116,136, 51,117,100, 82,161, 20, 40,170,149, 42, 93, 81, 4,169,245,242,123, 74,
-144,164, 46, 99, 51, 19,200,168, 76, 5,205,124,208, 73,126,228,108, 10, 43,183, 96, 58,150, 17,149,122, 16, 82, 98, 82, 79,174,
- 34, 1, 43,188,200, 8,120,194, 22,208, 4, 10,140,179,228,114, 33,150,132, 64,123,228,166, 77, 29, 34,123, 45,113, 45, 51, 99,
- 44,104, 41,177,169, 71, 65, 59,225,133, 70,132,116,228,163, 0, 97, 13, 66,129,144, 2,147, 24,100,224, 21,148,156, 19,104, 33,
- 17, 90,225, 82,139,210,178,213, 38, 18, 74,129,208, 81,203,136,105,177,224,108, 43,173,176,153,188,173,202,234, 72, 90, 58, 79,
- 45,168,200,190,153,106,233,171,183,168,210, 17, 72, 21, 82,207,230,111,132, 68, 43, 65, 18, 67, 46,151,225, 35,148, 96,231,129,
- 19, 28, 62,114,144,167, 95,121, 33,102,161,209, 4,229, 32,204,234,221, 66,138, 86, 5, 79, 9,133,108,119,249,133,197,101,231,
-175, 2,159,190,121, 43,119,108,223, 77,172, 58, 41, 6,112,245,133,231,241,196, 77,107, 41, 5, 13,114,161, 70, 8,215,146, 35,
-117,206,249,251,224,188,151,218, 4,145,202,246, 84, 60,160, 12,252,240,134,127,229,100,205,223,255, 36, 1,161,140,215,179, 55,
- 1, 65, 0, 50,109,214,228, 97, 78, 56,158,253,103,111, 6,175,187,198, 27,255,226,213, 60,113,221, 0, 75,138, 16,106,159, 24,
- 49, 78, 97,157,102,102,110,150,129,178, 33,213, 5,112, 1, 36, 22,171, 34, 66, 55, 15, 82,112,178,154,128, 14, 73, 49, 20,114,
- 94, 79,210,181,229, 49,189,131,114,170,129,111,201,202, 61, 32,106,127, 80,185,233,135, 72, 0, 60, 44, 10,250,209,252,207,227,
-219,127,233,205, 57, 3,214,250, 12,223,163,249, 63, 92,171,237,242,116,162, 48,206,128,208, 16,134, 17, 73, 10, 3, 3, 1,203,
-151, 47,231,123,223,253, 17,103,159,189, 5,235, 20,223,252,214, 15,232,236, 44,179,100, 9, 12, 12, 45,231,187,183,252, 59,103,
-110, 56, 3,107,224,150,155,239,164, 92,234, 97, 96, 0,206,185, 96, 51,199,142,158, 96,235,182,251,121,209,139, 94,204,189,247,
-110,229,240,161, 81,206, 88,191,214,183,187,138, 44,138,108,155, 58, 75,151, 46,103,108,124,150, 52, 77, 25, 30, 30, 70,106,205,
- 79,126,114, 7,169,243, 32,175,181,171,207, 96,247,253, 59,136,162,128,212,128,203,186, 98,102,231,170,156,189,114, 93,182, 54,
-129, 84,174, 85,199,190,241,198,111,146, 82, 99,201,146, 37,116,118,118,210,104, 36,228,179,158,115,165, 97, 98,114,138, 48,159,
-163,191,223,175, 27,253,253,131,140,143,143, 82,109,212, 40,149, 10,158,193, 50, 53,116,117,247, 97,155,126,148, 80, 72,169,125,
-125, 63, 35,154,241, 83,221,162, 84,144,245,158, 43,150, 47, 93, 74,154,194,158,221,251, 57,121,242, 36,179,179,179,108,222,188,
-153,174,174, 30,118,237,218, 77, 28, 39, 4, 65,142, 56, 49, 8, 20,113, 98,112, 78, 16,133,121,146,180,129,144, 94, 60,109,116,
-244, 24,165, 82,129,139, 46,216, 0, 54,230,224,129, 81,138,197, 34,131,131,253, 44, 91, 62, 68,103, 71,212,234, 42,176, 38,205,
- 88, 5, 13,169,177, 4, 65, 0, 46,115, 54,180, 58,141, 81, 71,163,131, 5, 4, 93,168, 3,191, 40,231,203,126,241,109,162,235,
-196, 2, 11, 24,194,107,130,183,234,137,105, 10, 58,130,242, 18, 6, 47,125, 54, 71,239,237,102,230,208, 54, 74,114,154,200, 86,
-209, 2,156, 73, 17, 72,172,210, 52,156, 37, 8, 52,214, 38, 56, 33,209, 82,225, 76, 76, 96, 45, 90,133,196, 42, 98, 78, 20,168,
-230,251, 41,172,216, 66, 52,188, 9,215,185, 20, 93,238,193, 74,233, 13,113,214, 67, 40,132,205,210,199,222, 90,170,118, 35,146,
-181, 96,180, 95,182,212,162,173,114, 37, 91,131,207, 75,226, 57,148, 22, 45,199,197, 89,131, 50, 6,147,214,176,105, 29,165, 52,
-168, 18, 82, 10,132,240, 76,104, 45, 10, 18, 1, 34,240,141, 36, 97,219,252,114, 25, 73,120,147,123,184, 53,239, 92,144, 93,131,
-255,158, 13, 4, 78,122,109, 95,153,181, 66, 27, 22,128, 32,243,206,147,216, 68,169,111, 59,137,181,175, 73, 91, 39, 8, 5, 84,
- 67,127,252,162,128,122, 10,247, 31, 57,201,137,177, 57,234, 49,232, 64,146, 10, 79,134, 90, 84,254,255,154,196, 60, 77, 99,159,
-147, 16, 58,188, 97, 23, 22,156,192, 72, 73, 29,216,115,210,240,137,235,111,160, 65, 72,136, 99,176,160,121,217,243,126,139,188,
-169,146, 11,242, 24,151,146,207,174, 5, 39,176, 78, 96, 81,164,194, 31,191, 9,230,177, 9,228,148, 63,151,115,142,156, 18, 56,
-147,101, 93,128, 88,164,132, 42,197, 88, 71,162, 3,159,177, 8, 44,210, 26,148,210, 28,143, 65, 59,139, 69, 16,185,148,156,153,
-163, 67, 20,233, 82, 26,109, 53,196,117, 82, 89, 96,114,102,138,219,239,217,195,186,165,155, 41,204, 85,145,185,144,212, 25,116,
-172,104,212,170,228, 58,186,185,241,135,247,122,145,151,184,206,240,178,238,133,250,121,102, 81,157, 93, 0,205, 45, 68,240,238,
- 65,163,118,155,189,167,132,120,160, 54,118, 59,240,201, 45,200,209,186, 22,112,176,125,192,156,138,126,178,167, 7, 65,181,127,
-149, 71, 97, 4,254, 99,252, 3,251,171,194,189,255,127,108,204,125,134, 71, 8, 69, 98, 82, 2, 21,180,250,155, 31,201, 45, 91,
- 80, 99,151,139, 7,131,243,104,117,161, 61, 33,152,175,255,250, 63,157,181, 97, 13, 55,125,243,171,188,236,101,127,138, 73,225,
-203, 95,253, 18, 23, 93,120, 14,214,192,150, 13,155,185,229, 91,223,226,197,127,240,108,130, 32,226,115,159,253, 26,151, 95,126,
- 25,194,194,170,225,101, 92,251,201, 47,115,197,229, 79,230, 9, 23,159,201,255,252,187, 47,210, 63, 80, 98,112, 8,246, 31,152,
-163, 84, 42,225,140,231,141,208, 2,210, 24,182,221,187,141,161,190,126,118, 58,199,244,216,113, 4, 49, 87,255,230, 85,108,218,
- 92, 6, 11, 63,251,201, 56,218, 53, 72,147,196,211,205, 58,131, 51, 49, 75,150, 13,179,109,219, 14,158,246, 27,155, 73, 13, 8,
-147,210, 85, 14,177,166,193,159,255,249,115,201,229, 33, 78, 96,239,158, 10, 90,251,238,152,195,199,102, 49,198, 48, 48, 56,140,
- 67,177,117, 91,149, 13,155, 10,108,223,182,135,161,161, 65,180,174,121,213, 70, 11,197, 82, 23, 91,183,238,230,153,207, 60,135,
-185, 89,191,222, 90,146,214, 44,105,114,180,203,140,109,206, 19,111,249, 64,111,104,160,135, 72, 43,102, 42,243,116,119,246,144,
-212, 45, 19, 19,147, 36, 73,210, 42,121,212,227, 6, 81,152,207,218,246, 20, 73, 90,203, 2, 26,197,212,201,105,170,213, 42, 61,
-157, 93,236,221,179,159,179,214,143,112,198,218, 97,242,121,207, 3,208,124, 78,205,239,160,148,206,108,148,246,205, 13,217, 35,
- 63,157, 65,207,128,114,100,198,241,148,233, 46, 52, 78, 60,184,102,116, 51,213,211,130,251, 11,188, 57, 27,222,196,210,142,110,
-170,219,251, 57,186,245,199,164,110,154, 40,173,161,201,162, 80, 44,214, 37, 72,235,144, 74, 98,156, 32,182, 62, 77, 79, 16, 81,
- 21, 33, 21, 27, 34,123, 87,210,181,114, 19,225,224,153,232,254, 85,136,142, 62,156, 14,179,126,200,172, 47, 25,151, 93,100,123,
-136, 41,179,133,114, 97,191, 48,252,109,107, 17,106,103,227,241, 93,224, 77, 19,109,152,218,117, 23,201,252, 73,116, 62,207,220,
-216, 36, 99,251,142,144, 36, 49, 97,104, 41,246,244,145,203,231, 41,245, 14,128, 84,148,251,150,144, 24, 8,117,130, 46,150, 72,
-146, 6,129,206, 35, 58,186,145, 50, 68, 16, 32, 50,148,162,203,144,223,173,123,157, 17, 76, 36,113,138, 13, 53,239,249,208, 39,
-216,124,246,217, 92,113,229,197,220,250,163,237,252,252,238, 95,242,186,215,252, 62,223,187,237, 30,110,250,254,143,201,135, 1,
-207,123,250,147, 56,255,252,117,188,230,175,223,195,178,229, 75,153, 63,186,151,151,191,252,149,252,240, 23, 59,249,247,187,126,
-193,250,161, 78, 94,251,218, 63,230,134, 91,110,101,197,138, 21, 36, 1,196, 41, 92,251,229,155,217,122,223,110,250,187,202,188,
-242,101, 47, 33, 95,130,191,253,219,247,208, 55,208,207,212,201, 9, 46,189,232, 66,126,235,105,151,211, 27,250,104, 94, 72, 77,
- 29,152,198,235,203,143,207,167,168,176,136, 52,134, 23,189,240, 69,158, 74,178,144,167, 17, 64,164, 2,106, 52, 65,244,130, 36,
-115,163,106,192, 7,175,253, 22, 95,252,234, 55, 40, 23,202,252,197,159,188,148,223,188,228, 12,116, 0, 90, 9,156,181,228,165,
- 32,240,122, 70, 16, 9,148,243,169,132,154, 48, 32, 20,161,241,206, 87, 26,215,233,205,231,188, 80, 66,160,160,158, 80,144,130,
-178,178,132,196, 8, 52, 27,250, 4, 91,199,231,152, 87,142,119,124,237, 46, 46,189,104, 3,103,116,229,113,113,140, 14, 37,164,
-134,160,220,197, 77,119, 31,227,243,119,238, 36, 23,116, 82,155,159,231,201,103,109,196, 53,163,239,133,105, 77,147, 49,195,225,
- 11,108, 62,221,229, 30,152,146,111,143,216, 31, 48,151,236, 35, 10,198, 31, 89, 84,214,102,148,197,195, 27,111,119,202,254, 63,
-118,107,103, 71,123,164,251,255, 66,198,215, 90,140, 53,109,125,218,191, 30,141, 62, 33, 4, 71,127,114, 19,247,124,231,107,236,
-221,181,143, 3,115,130, 87,190,229,221,172,223,178, 5,147,166, 40,173, 31,195, 65,155, 15,220,208,104,196, 68, 81,216, 66,140,
-107, 13,203,150, 13, 16, 5,112,193,121,235, 9, 67,248,204,181, 99,172, 89, 61, 68,164, 97,233, 96, 23,152, 42,151, 95,186, 25,
- 1,124,246,147, 21, 70,150,245, 35, 12,156,179,233, 44,254,173, 94, 97,243,198,181,244,247,193,210, 37,157,172, 88, 49,140, 20,
-240,133,235, 62,207,166, 77,155, 88, 49,178, 18,225, 26,188,238,181,255, 72, 16,229,153,159,157,231,143,255,232, 26,110,255,209,
-247,233,233,202,243,194,223,125, 38,239,126,247, 91,216,176, 97, 3, 7, 15, 30,228,220,179,207, 33,109,204,146, 15,252,138,156,
- 36,179,228, 66,195, 21, 87, 92,192,187,222,245,125,222,254,207, 31, 98,124,124,156, 80, 27,122,187,115,172, 93,187,148, 55,190,
-225,173, 12,175, 92,194,182,109,219,120,225, 11, 94, 12, 46, 69,200,148,123,238,189,155,109,219,182,241,250,255,246, 42, 46,189,
-236, 66,254,245, 99, 31,162,175,175,143,227,199, 71,185,230,154,103,241,253, 91,191, 70,154, 86,145, 2, 46,189,228, 66, 62,254,
-177, 79,242,166,127,184,150,202,252, 52,214,198,190, 3,192,248,104, 95,102, 81,186,104,245, 17,250,239, 23, 4,130,174,174, 18,
-249,124,142,254, 36,101,112, 32, 97,215,174, 61, 76,207,206,248,250,187,212, 24, 99, 40,228, 75, 24,227,163,116,207, 28,234,199,
-251,244,244, 36,113, 28, 51, 50,178, 28,107, 99,150, 12,246, 83, 44,120, 5,201,166,141,110,174, 33,242, 49, 82, 81, 11,103,172,
-243,145,153,100,209, 30,197,105,223, 95,180, 95, 88,157,172, 3,103, 99,148,114,224, 26, 48,115, 28, 51, 49,202,177,157,191,192,
- 77, 29,193, 77, 31, 39, 76,102,137, 68,130,114, 73, 43, 66, 49, 72, 92, 80,160, 70, 64, 93, 22,144, 93,203,201, 13,174,166, 48,
-180,138,124,239, 8,182,208, 73, 80,236, 70, 4, 57,172, 19, 11,229,204,230,226,233,126, 13,158,178,180, 56,103, 72, 39,118,115,
-224,238,123, 57,188,125,148,195,251,183,115,252,196, 62,226,216, 18, 91,205,196,137, 10, 51,149,163,108, 58,115, 13,133, 40, 79,
-169,152,103,211,121, 23,210,179,100, 41, 97,185, 19, 41, 21,197,101,235, 16,206,128,169,226,226, 4,169, 53, 42, 80,232,176, 68,
- 80,238, 65,151,123, 16,153,132,159,179, 11,198,221,101, 17,237,245, 55,125,143,207,126,253, 59,188,239, 35,111,231, 85,175,122,
- 19,207,121,206,179,233, 27, 26,228, 45,111,125, 43,127,241,234,215, 49, 49, 62,206, 87,191,242, 5,222,255, 47,239,226, 15, 95,
-246, 58,126,243, 41,151,241,130,167, 92,192,124,173,202,107,222,244, 65,254,233,173,111, 35,156, 27,229,188,243,206,226, 61,159,
-186,129, 67, 71, 70,121,207,223,189,138,175,127,245, 38,110,190,229,118, 94,246,170,255,198, 15,238,248, 25,199, 78, 28,227,237,
-111,121, 37,207,188,250,247,120,241,115,158,205,146,165,203,121,207, 71, 62,197, 7,223,251, 14, 46, 95,219,133,136,107, 56, 21,
-210,208,138,143,126,231, 62,222,245,169,235,169, 19, 97, 13,172, 92, 54,196, 43,174,121, 30,133,116,142,142,188,246,134, 55,210,
-184,164, 65, 20,104, 18,227,159,107,119,103, 7,183,222,249, 11,254,245,139,223,162,225, 2,130, 92, 68, 80, 29,231, 95,255,246,
- 21, 92,185,105, 21,161, 77, 61,223, 60, 25,173, 34, 42,107,165,243, 2, 45,169, 51, 40,169,124,135, 74, 38, 5, 59,129, 98,243,
-239,255, 3, 83, 38,162,203, 84,121,235,107, 95,202,211, 54, 13, 49, 16, 89,172, 8,249,183,239,254,146, 55,124,225,167,228, 69,
-131,233, 90,200, 72,215, 73,222,249,188, 45, 92, 52, 48, 76,106, 44,177, 19, 92,127,223,126, 62,120,211, 61,156, 12,123, 40, 40,
-133,170,215,216,250,222, 63, 97,121, 87,174,125,165, 93,192, 2,180, 94,251,253, 66, 29, 75,156,242,121,179, 16, 55,181,208, 43,
- 15,101,208,229,131,219,230, 83,253,134,182,163,201,211, 70,221,246,215, 96,181,228, 35,152,239,167,236,127, 93,219,163, 61,239,
-162,117,234,145,186, 67,143,161,194,157,122, 12, 78,115,107, 84,230, 64, 42,162, 66, 33, 51,244, 46,147, 41,126,184,124,136,227,
-129,144, 81,191,205, 28,216,202,207,191,244,113, 78,142, 79,112,248,240,113,246, 29,154, 96,223,100,133,115, 47,190,146,127,250,
-228,167,192, 42,144,230,193,247,173, 33,160, 30,232,209,101,248, 39,135, 35, 77, 28, 58,240,165,192,217,138,225,208,129, 81,206,
-218, 48,130, 49,176, 99,199,110, 86,175, 89, 73,177, 20, 80,173,192,254,253, 7,216,120,246, 74,156,133,237,219, 14,178, 98,197,
- 10,202,157,254,152, 59,119, 28, 98,213,170, 17,114, 57, 56,112,240, 40,165, 82,129,238,238, 46, 14, 31, 62, 74, 46,151,163,163,
-163,139,189,123,247, 82, 46,117, 82,107,212, 89, 58,180,148,114,167,102,231, 78,127,156, 98, 9, 78,140,205, 51, 53, 53, 69, 62,
-202, 49, 60,220,199,253,247, 31, 98,100,229, 32, 97, 24,114,242,228, 28,105,234, 88,186,180,147,169,169, 6,199,142, 30, 98,205,
-154,117,236,190,255, 0,171, 86,174,164, 84,130,253, 7, 38,168,214, 43, 12, 14, 14,210,223,155,231,158,123,246,114,198,153, 43,
-153,157,155,162, 82,169,178,122,213, 8, 56,216,183,215, 71,196,107,214, 44, 37,202,195,246,237,247,177,126,253,122,162,200,183,
-187, 77, 77,194,225,209, 19,132, 97,200,219,255,249, 77,188,249, 45,127,199,202,149, 61, 30,231,155, 36, 25,113,150,108,249,238,
- 45,199, 90, 44,252,158, 24,152,153,169,242,245,111,220, 68,127,223, 16, 97,174,132, 16,126, 93,180,214,162,117,136, 16,130,185,
-185, 25,106,245, 57, 26,181, 26, 67, 75, 6, 8,164, 96,227,198,117, 12, 13,116, 32,197,226, 96,224, 87,197,231,104, 95, 59,245,
-218,172,167,238, 91, 19,238, 65,247,210, 71,217,178,169, 12,163,179, 5,198, 35,226, 85,113,128,229, 93, 75,176,211,199, 72,198,
-246, 82, 31, 63, 76,125,102,130,184, 58,231,107,186, 89, 67,191, 46,118, 16,116,244,211,221,179,148,176,103, 57,170, 60,132, 45,
-116,226,242, 29,168, 48,135,208, 89,178,223, 37,224, 52, 34, 67,104,187, 95,201,176,103,241,139, 48, 56, 59,199,225,219,191,199,
-214,219,127,198,145,195, 71,136, 41,113,248,224, 81,190,253,179,159,177,188,183,204,108,195, 80,140,138, 28, 57, 57,195,222,137,
- 95,130,128, 40, 84, 12,255,251, 47, 89,214, 61,192,170,145, 1, 46,184,252, 50, 6,109,130,138, 58, 9,202, 37,208, 17,181,153,
- 25,130, 92, 9,228, 12,114,242, 56, 74, 57, 10, 61,195, 4, 93, 3,200, 66, 9,156,194, 88,135,117, 14,161, 36, 87, 95,253, 84,
- 62,112,253,183,184,238,134,159, 50, 57, 53,197, 83,159,178,133,207,223,112, 39, 97,185,135,111,222,242,125, 36,150,233,169, 89,
-246,238, 61, 78,108, 36, 23, 94,124, 25,195,195, 3,132, 57,197,115,159,255, 34,222,241,222,247,115,205,213,151,115,246, 5,103,
-209,209,211,133, 56, 54,138,149,112,207,182,157, 60,233,233,191,201,218, 77,131,156,180, 87,112,195, 63,189,153,217,216,147, 51,
-108,217,180,145,117,103,109,228,109, 31,187,142,227, 51, 85,166,230, 75,244,231,115, 24, 37,216, 61,110,248,216,245, 55, 48,235,
-114,158,135,152,148,163, 99, 39,248,199,119,127, 0,237, 18,164,112, 72,169, 61, 33, 5, 9, 38,110, 16,230, 11, 8,107, 56,107,
-245,106, 68, 80,162,174,202,152,176, 72, 37,105,208, 29, 21,249,249,221,247,112,241,186,165, 68,185, 96,129, 76, 67, 41,140,179,
- 45, 58, 69,207, 51,231, 89,172,132, 18, 24,227,103,149, 9,192,146, 34,101,136,179, 18, 39, 21, 86,248,150, 29,233, 28, 47,127,
-242,102,190,255,139,173,220,188,117,130,245,233, 28,203, 70, 39,248,240,219,238,229, 67,185, 60,182,216,201,177,217,132, 70,234,
- 40,133, 33, 81, 56,207, 9, 19,240,249,255,241, 59, 44, 43, 43, 95, 30,146,237, 41,204,182, 60, 88, 51,205,238,156,247, 57,132,
- 88,168,185,180,162,245, 5, 28,114,115, 92,186,135,136, 70, 31, 50, 86, 61, 77, 90,221,158,178,151, 15, 72,223,255, 26, 12,235,
-163,221,255,186, 13,251, 99,217,255, 7, 24,244,102,253, 84, 58,203,142,239,125,155, 79,188,255,189,220,179,251, 0,179,243,243,
-232, 32,160,167,163,135, 63,121,237,235,121,214, 31,253,225, 67, 24,246,135, 46,122,184,140,126,121,235, 55, 63,205,252,124,149,
-202,204, 44,179, 51, 21,170,105,130, 22,142,155,191,243, 77,110, 91,183,142,239,222,179,131,168, 16, 60,182,104,189,229,152, 72,
-130, 64,146,166, 49, 66,134, 20,114,138, 51, 55,120,114,152, 48,128,205,103,175, 67, 74, 15, 14, 43,151, 36,155, 54,174,244,181,
-120, 96,211,198, 21, 52,147, 18, 73,106, 56, 99,253, 8, 58,107,150, 90,179,106, 41,169, 73, 81, 10, 86,173, 26,242, 28,110,169,
-101,203,230,117, 94,150, 57,177, 4, 89, 11,204,186,181,195, 30,185,157, 66,111, 79,145,222,222, 34, 90,251,114,223,198, 13, 35,
-152, 44, 91, 58, 52,216, 65,106,124,125,190,163, 67,211,219,181, 14, 33, 96,203,217, 43, 91,190,245,218, 53,125,164,105, 79, 70,
- 84, 3, 91, 54,173, 65, 72, 75,190,191,155,222,206, 18, 18, 72, 19, 88,187,166, 11,108, 87,198,250, 6,103,111, 60, 51,171,251,
-195,125,219,119,115,237,103,174,163,175,111, 41,123, 15,236,231,201, 79,185,146,145, 21, 61, 45,246,234, 32, 80,217, 60, 94,240,
-219,155, 21,183,246,228,156,214,208,219, 91,224,137, 87, 94,202, 15,111,187, 3,103, 53, 66,133, 72, 17,226, 50,105,212, 70,163,
-134,181, 41,165, 98,142,225,145, 37, 24, 27,179,118,221, 42,122,123, 59,188, 3, 97,109,139,137, 84,182,129,223, 30,171,113,215,
- 77, 76,188,115, 30, 28,214, 84,234,106,178,253,156, 46,141,215,190,151,138, 86, 74, 92, 88,155,233,118,104,140, 10,145,170,128,
-232, 47, 34, 59, 7,137,250, 86, 16,197,243,116, 26,139,179,146, 70, 42,136, 83, 67, 20,249,116,133, 83,138, 32, 95,130, 32,143,
- 17, 26, 21,134,132,185, 66,118, 97, 89,108, 35,154,175, 29, 2,135,117,226, 33, 47,218,209,222,111, 44, 22, 5, 86,126,221,174,
- 51,246,211,239,112,228,190,237,252,228,142,109,236, 63,112, 24, 25, 20,160, 49,206,214, 67, 7,152, 75, 28, 7,167,230, 9,148,
-102, 98,238, 36,115,113, 66, 53,145, 40, 41,136, 26,142, 74,109,138,237, 7,199,233,188,127, 23, 63,219,190,157,203, 46, 60,135,
-243, 47,127, 26,206,106,250,134,135, 41, 12, 12, 51,127,120, 7,209,208, 90, 26,243, 21,148,210,196, 99,163, 48, 49, 69, 84, 40,
- 80,238,235, 67,119, 14,102, 41,158,132,128,128,231, 62,235,217,124,234, 51,159,227, 79,158,247, 27, 68, 85,232, 43, 6, 20,148,
-226,165, 47,249,125,250,203, 17, 98,230, 57,244, 13,245,145,147, 49, 56, 67, 20,248,104,246, 25, 79,191,146,203,175,186,146,191,
-124,213, 75, 25, 26, 25, 38,194, 17, 37, 49,182, 6,253,189, 3,108,223,187,151,167,234, 43,185,127,223,253, 12, 13,101,188,202,
-169,195,164, 41,249, 76,119, 37,113,224,148,102,222, 56, 18, 5,239,248,208, 39,152,172, 11,172,202,145,164, 6,173, 3,230,235,
- 13,148,138, 80, 58,231,249,208,157, 0,167, 40,228, 59, 80,121,152,174, 86, 81,206, 32,162, 50,229,206, 94,164, 60,206,108,101,
-134, 92, 33,130, 70,131,161,254, 1,164,148,164,109,137, 37,159,210, 84,160, 84,235, 93,145, 21,149, 60,216,206, 97,179, 73,150,
-216, 6, 66,105,172, 51,196,198,144, 98, 73, 92, 66, 65, 57,172,181,124,226,185,103,240,229,198,189,108,191,235, 46,198,167,231,
-153, 20, 69,106, 21,137,155, 56, 68, 63,154, 90, 80,166, 98, 75, 92, 48,216,203,239, 93,117, 30, 23,150, 2, 26,243, 21,194, 92,
-222, 47,100, 50,107, 69, 20, 2, 97, 29, 78, 72,255, 94, 43, 61,239, 22,210,217,226, 20, 11, 44,218,250,134, 31, 38,126,150, 15,
-102,119,218, 14,103, 31,178,250,108, 31,182, 46,253,112,243,247, 87, 55,196,191, 82, 32,220,246, 37,254,115,165,226,149, 18,252,
-228,115, 31,225,255,124,244, 95,217, 61, 54,197, 68,181, 65,221,120,102,177,234,124, 76, 37, 22,124,246, 83,159, 65,135, 37,174,
-254,189,223,125,140,105,119, 69,117,116, 39,149,185, 10, 73,163,206,220,124, 21, 36,204, 84, 27,140, 87,235, 56, 33,152,155,159,
-230,210,179,214,242,181, 91,126,192,240,250,181, 62,123, 42, 89,188,127,152, 91,168,180,162, 17,199,104,173,178,172,131, 39, 45,
-105,164, 9, 74, 42,226, 36,245,130, 49, 70,160,181, 34, 78,234,132, 65,208, 58,182, 37,245, 77,116,169,239,139, 9, 2,133, 49,
- 94,247, 34, 77,211, 12,131,100, 48, 25, 57,139,210,138, 56,110, 16,134, 17, 42, 51,232,141,122,236, 1,203,102, 1,162,101, 76,
- 10, 86, 96,164,194, 89,135,146, 11, 80, 63, 73,138,196,115,206, 91,147, 32,101,208, 26,102, 38,141,209, 90, 18,100, 64, 54, 37,
- 0,109,179,108,177, 33, 12, 61,129, 76, 16, 40,146, 52, 33,208, 1,113,156, 16,133,129, 47,255,102,231,218,178,121, 29, 47,251,
-227,223,195, 56, 77,169,220,201,200,112,151,159,246,206, 35,121,125, 11,155,151,121, 22, 25, 75,142, 79,137,183,219, 22,155, 49,
-239, 5, 12,143, 44,229,210,203, 46,226,216,209, 9,234, 13, 16, 66,123,245, 58, 33,176, 46,165, 80,200,225, 76, 29,129, 97,221,
-250,149, 12, 47, 27,192,186,133, 32,224,161,240, 22,143,218,168,187, 54, 75, 39,192,215,209,219,232,251, 30,110,223, 92,235, 84,
- 22,205,136, 12, 28,230, 50,160, 87,146,106,114, 97, 55, 34, 44,129, 73, 49,137, 33, 69,226,136, 50,104,155, 65, 9,135,115, 14,
- 35, 32, 80,154, 32,171, 35,165,214,120,207,197,217,236,194,229, 66,218, 61,235, 31, 60,157, 35,220, 2,159,100, 75,152,179, 41,
- 66, 5,173,218,185,115, 80, 63,177,139, 31,252,219,251, 65, 68,220,242,189,219,169, 91,159, 46,169,205,204, 50,122, 98,154, 35,
-211,147,204, 37,198, 43,136,137,148,212,224,117,222,141, 1, 37,168,167,150, 0, 47, 38, 83, 53,150,216, 77,113,240,155,183,177,
- 99,235,110, 46, 56,111, 3,235,227,243, 40, 78, 77,208, 61,178,142,100,242, 40,165, 21, 27,153,159, 56, 14,141,121,114,229,152,
- 52,134,233,137, 41, 24,221, 71,231,242,245,232,206, 78, 66,224, 5,207,184,162, 69, 25,242, 0, 0, 32, 0, 73, 68, 65, 84,140,
- 31,124,251, 27, 60,251,105,151, 83, 14, 44,207,191,234, 2,166,143, 29,229, 77,127,249, 26,148,141,121,197, 11,158,201,111, 63,
-235,217,116,136, 26, 37, 81, 37,194, 49, 54, 62,198,255,250,235,127, 96,106,190,193, 69, 91, 54,177,105,237, 42,142,237,222, 69,
-209, 86, 41,105,120,229, 31,191,152,255,249,246,247,241,162,223,121, 57,171, 86,173,226,175, 94,245, 50, 74, 22,194,180, 70, 65,
- 43, 84, 2,170, 62, 75,135, 76, 81,206, 18,132,146,123,183, 31,100,251, 47,127, 65,164,251, 8, 34,131,178, 49, 46, 73, 73,173,
- 33, 12,242,212, 26, 53,242, 90,163,133,246, 84,190,243,179, 8,160,164, 36, 1, 14, 29, 87,120,217, 11,174,225,208,225,125, 28,
- 58, 62,139,116, 53,158,116,225, 70,158,120,241, 5,216, 56,129, 92,174, 77,109,221,225,172,197, 89,147, 77, 28,209,194, 56,184,
-140,163,217, 37, 41, 86, 42,250,117,194,116,125,138, 78, 36, 37, 81, 69, 89, 67, 50, 63,207,220,232, 61, 76,111,187,139,241,251,
-119,176,116,244, 0, 34,172,115,172, 96,152,139,167, 73,165, 66,228, 11,232,158, 14,130, 66,158,129,206, 28,231,108, 26,161,220,
- 25,114,226,248, 81,226,249, 25,250,151,143,144,239,234,197, 89, 3, 82, 33,164,196, 9, 79,243,235,108,102,236, 93,102,106,133,
-122,224,132,115,130,172, 87,178, 53, 6,165, 16, 15,106,122,197, 67, 4,146,238, 65, 28,128, 71, 51,189, 31,233,252,253,181, 26,
-247,255,194,155, 53, 41, 82,105,142,221,251, 99,174,125,211, 27,217,126,112,140, 74,156, 82, 75, 13,213, 52, 37, 16,138,154,117,
- 4,129,102, 62,110, 48, 57, 51,205,157, 63,248, 33, 79,125,238,179,136,114,209, 99, 58,231,253,183,223, 64,210,136, 73,147,148,
- 80,107,142, 79, 87,136, 83,131,113,142,186, 49,164, 14, 26,115, 51, 60,235,170, 39,114,221, 87,111,226,140,243,207,121,120,215,
-238,148, 20,144,179,130, 40,244, 40, 90, 99, 61, 19,156,181, 41,174, 86, 99,207,142,109, 28, 62, 58,202,192,208, 82,182, 92,124,
- 9,198, 38, 94,210,218,166,104,169, 48,158,211,205,175,155, 89,182, 52,142,235, 25,176, 79,120, 94,118,147,144, 90,227, 69, 80,
-124,162,159, 48,212, 88,107, 50, 17, 20, 77,148,145, 63, 5, 81,228,235,230, 38, 37, 80,130,212, 90,164, 85, 56, 41,176,169,245,
-234,158,162, 73, 93,235, 48,214,160, 84, 86,162,203, 96,234, 90, 11,140, 77,189, 64,147,214, 56,103,125,144,102,241, 56, 41, 33,
- 51,235,149, 16, 4, 2,103, 83,162,200,131,120,147, 36,241,116,183, 8,132,131, 13, 27,214,144,216, 54,121,139,204, 49, 80,205,
-121,207, 98, 98,169,102,224,235,178,117,192, 57,239, 32, 88,151, 18,105,205,170, 21, 35,104, 25, 48,122,116,140,184,145,146, 47,
- 21, 16,153,221,178, 54,166,220, 89,100, 96,176,135,165, 75,250, 61, 40, 91,184,140,115,127,113,116,222,142,183,120, 76,211,209,
- 61,152,155,240,136, 23, 15,187,144, 2, 76,155,189, 74, 65, 54, 81, 50, 20,167, 72,253, 93,111,181, 2,169, 22,138,254,129,253,
-193, 11, 78, 65,147,194,176,105,140,253, 77,207,232, 70,155,186, 32,242,244, 6,221,185, 24,236, 52,105,165,206,196,206, 29,148,
-250,122,153, 58, 49, 67, 87, 95,137, 92,127, 47, 95,253,199,247, 50,122,248,110,254,125,207, 49,186,187,151, 49, 57, 57,206,241,
-233, 89,226, 84,112,124,190, 70,146,196,196, 38, 69, 10,129,209,130,185,212,210, 48,134, 46, 4,171, 13,212,181,224,144,117,212,
-180, 68, 57,199, 18,173,232, 8, 21,185, 80,242,228, 77,203,184,236,178, 43,232, 29, 92,141, 80, 17, 29,157, 57, 74,131,203,232,
- 58,243,124,102, 14,238,167, 49, 59, 69,169,183, 27, 21, 4,136, 32,194, 38, 13,194, 92, 25, 93, 42,162,251, 87,146, 90,144,214,
-144, 38, 9,168,188,247,151,141, 23, 86,136, 27, 53,162, 66,158,106, 61, 37, 10,181,239, 17,215, 1,117,163,168,213,125,250, 90,
- 7, 77,239, 47,245,131,206, 58, 80, 57,172,131,122,173, 78, 46, 23, 17, 40,129, 73, 98, 47,176,224,188,198,187,179,150,146, 74,
-177, 38, 65, 68, 69, 42, 41,204, 37, 48,223, 0,215,168, 18, 4, 26, 25,104,170,117, 79, 99, 43, 21,196,141,148, 82,161,136, 73,
- 18, 47,176,227, 44,145, 14,176, 73,140, 14, 35,156,150,220,189,117, 27, 82, 74,206, 61,107, 61, 37, 19,147,211,146,176,148, 35,
-201,198,141, 20, 77,108,143,203, 28, 69,227,129,107,206, 33,172,197,212, 26,132, 66, 48, 89,111, 48,109, 4, 34,140, 8, 82, 67,
- 78, 41,228,137,253,196, 7,183, 51,119,112, 23,199,238,219,193,225,125, 7, 57,118,232, 8,199,143,143, 81, 67,210,221,219,195,
-192,178,165,132,133, 18, 8,232,232,237,163, 60, 52, 76,170, 67,114,165, 34, 61, 75,135, 41,117,117, 51,184,108,132,190,101,203,
-219,106,231,190,198,223,140,220, 69, 83, 21,174, 57, 78,165, 90, 92,111,119,109,181,120,209, 54, 41, 79, 13,139,155,204,122,238,
- 52,166,190,169,161,157, 45,211,139, 58, 12,221,105, 82,213,255, 41,162, 92,251,255,241,249,127,213,235, 55,173, 53,227,251, 31,
-250, 95,252,228,150,239,179,247,248, 52, 99,149, 42,181, 70, 74, 61, 53,212, 18, 67, 61, 49,212,141,241, 45,190,249, 2, 67,221,
-125, 92,118,225,165,188,228, 53,175,102,253,185,155, 30, 37,142,199, 27,168,159,125,226,111, 24, 27, 61, 70,117,190,194,232,161,
- 19,220,189,247, 40,227,149, 58,227,149,152, 70,234, 29,138,212,250,121,145,143,138,124,237,198,155, 79,107,216,125,248,164, 78,
-147,166,241,231,137, 27,117,194,200, 27,221,209,159,221,198, 63,255,237,223,179, 99,255, 33, 78, 84,106, 8,161, 8,163, 60,207,
-120,242,211,121,235, 39, 63,138, 51,214,183,145, 73,209,202, 57, 91, 99,145, 90,249, 84,190,244, 70, 54, 77, 19,207, 42,218,182,
-181, 4, 88, 76,230,156, 75, 47, 55, 13,160,179,118,177, 52,105, 32,149, 66, 74, 65,154, 26,180, 14, 73, 51,177,151,214,113, 76,
- 29,157,245,197, 57,235,127, 60,210,219, 98,210, 56,203, 56,168, 83,108,135, 60,133,225,209, 98,156, 69,101,244,214,214, 56,164,
-242, 86, 36, 35,217, 91, 92,222,178, 32,164,111, 15, 52,214,103, 49,104,203, 29,156,206,238, 53,253,217,212, 26,148,244,130, 49,
-141,134, 33,204,169,172, 92,225,159, 67, 16,156,210, 5,155,117, 24,121, 2, 25,219,114,146,108,246,218,163,237, 31,251,184,214,
-191, 74, 81, 62,107,133,199, 58,183, 0,183,119, 94, 85,166, 89, 43,245, 98,178, 46, 99, 87, 91,168, 81, 58,231, 9,253,197,169,
- 94,138,115, 8,169, 51, 28,122,179, 23,124,225, 59, 42,225,251,159, 61,249,138,163,157, 83,201, 97,188, 68,168, 57, 1,137,161,
-114,116,148,227, 59,247,208,191,122,152,185, 19, 19,216, 56, 70, 21,123,184,243, 51,159,164, 90,171,112,243, 47,142,210,213, 89,
- 98,124, 98,150,123, 15,141, 98,165, 0, 17,144,198, 9, 71, 76, 76,167,133, 1, 41, 57, 39,118,244, 38, 41, 27,115, 17,203,243,
- 17, 93,197, 60,249,188,239, 93,188,119,108,134, 35,206,113, 93,163,193,129, 56,197,132, 10,187,109,148,131, 99,223, 98,245,242,
- 37, 60,225,130,243, 25, 90,125, 25,113, 67,115,244,142, 91,232, 89,119, 54, 46,137,153, 60,184,143, 66, 87, 47, 97,169,140, 48,
-117,140,148,152,217,132,120,246, 30,116,152, 35, 77,235, 4, 65,158,168,171, 15, 17, 22,112,129, 34, 49, 13, 10,229, 34, 73,146,
-208,155,151, 72,105, 51,242,127,139, 50,142, 66,212, 28, 24, 22, 35, 28, 40,137,148,254,199,153, 4,225, 32,137, 32,208, 41, 73,
-146, 16, 70, 33, 14,175, 37, 46,108,138,148, 22,129, 65,230, 35,226, 56,166, 67,106,242,210,226, 66,139, 11,241,200, 81,165,176,
- 37,139,200,178, 40, 46,116, 88, 59,231,219,249,164, 6, 39, 73,109,141,168, 28,145,186, 4, 33, 4, 79, 63,103, 45, 10, 65,220,
-168, 82,202,229,145,129,198,248,218, 79, 91,160,231, 90,160, 93, 45,188,250, 90,243,125,130, 16, 16, 12, 22,243, 12,182,121,179,
-233,212, 24, 83, 51,199,152, 58,122,136, 99, 71, 39, 24,155,174, 51, 54, 93,225,248,124,157, 25,227,249,230,143, 77, 76,144,226,
- 24, 90,225, 53, 3, 38,143,141,147,159,171, 81, 30, 90, 70,206, 58,130,210, 44,197,114, 25,155,212,177,141, 6, 50, 12,179, 18,
- 84,150,126, 7,132, 18,184, 52, 1,165, 23,250,215,155,133,181, 22,211, 28,167, 45,245, 60, 16, 43,101, 31,162,178,190, 72,127,
-171,205,243,126, 48, 96,219,127,154, 56,247,215,128,126,255,127,143,158,247,235,138, 98,126,252, 32, 63,250,240,223,179,107,247,
- 1,166,231,107, 84,234, 13,234,141,148,134,177,204,199, 94,121,209,137,108, 25, 23, 62,170,143, 77,138, 53, 41, 7,119,239,121,
-212, 70, 29,231, 72,230,103,169,213,170,224, 44,105, 35,230,240,248, 52,197, 40, 96,255,100, 5, 99, 45,169,131,122,106,209, 2,
-140,128,233,249, 57,158,245,204,167,113,211,183,190,199,218,115, 54,159, 98,208, 31, 36,123,226, 20,105, 90, 39,140, 66,102,246,
-111,231,218,191,121, 61, 63,220,113,128,189, 19,115, 24,103,136,141, 35, 80, 18,165, 21,247,110,187,135,209, 61,135, 88,186,114,
- 4,165, 20,206, 38, 52,117,190,164, 14, 49, 73, 3, 21,232,214,218,174,181, 23,157,146, 82,182, 12,184,231,221, 0,165, 84,171,
-189, 75,103,249,118, 99, 82, 92,234,208,161,198, 26,143, 39,208, 82, 98,140, 65, 43,207,241,238, 0, 41,189,178,101,115,206, 8,
-217, 86,206,178, 22,165,245,226,150, 63, 33, 50,103, 34,108, 25,116, 95, 22,144,109, 54,202,207,209,230,212,108,170,181, 25,107,
- 90,198,219,217, 20, 37,101, 22,125,171,236, 59, 59,212, 41,188, 1,174,173,245,181,105,136,181, 12,252,181, 75, 65, 46,183,192,
- 43,175,181,119,181,146,140,104,203,101,122, 26, 62,158,149,109,237,140,139, 13,185,115,238, 87, 2,203,233,118, 90,208, 71, 56,
- 30, 23,166,178, 0, 75,208, 18,237,104, 49, 26,181, 3,142,132,106,113,217,185,108, 50,218,182,116,135, 58,101, 32,182, 95,135,
- 18, 89, 49,199,145, 57, 7,190,110, 41,156,108,153, 0,143, 3,104,234,125, 59,132,157,198, 85,235,204,143, 29,165,114,114, 26,
-231, 96,239, 93,247, 16, 72,193,217, 47,120, 46,223,125,247,219, 57,114,248, 24, 95,185,245,199, 12, 14, 12,114,124, 98,146, 61,
-227, 39,188, 76,168, 81, 76, 41,131,142, 19,222,145, 11,120, 98,127, 39,198, 88,238, 60,124,146,243, 71, 6, 80, 57,205,201,185,
- 26,227,141,152,208, 58,162, 80,177, 97,100,128, 13,104,174, 74, 18,210, 52,229,231, 19,211,124,122,124,158, 31, 39,134,241,122,
-157, 37,157,154,176,220,137,169,165,140,108, 60,131,198, 92, 66,109,110,146,174,213, 91,152,222,253,115, 76,117, 22,171,243, 48,
-126,130,206, 85, 27, 9,162,136,160,187,151,201,251,238, 37,236,233,103,122,207, 78,146,233,113, 10,157,157,132, 93, 3,132, 81,
-142,252,224, 50,159, 66, 18, 26,100, 4, 78, 33,148,203,200,101, 84,118, 95,253,189,177,217,163, 8, 50,132,191,140,124,170, 48,
- 23,250,201,104,101,230,113, 26,127, 60, 43, 66, 18, 64,134, 25,179,180,147, 72, 37,113, 50,192,146,195,137,212,183,174, 57,217,
- 18, 63,240, 24, 49,225, 17,236, 72,239,140, 73, 65, 36,179, 76,140,179, 40,227, 25,247, 80,190,127, 86,102, 19,210,207,133,228,
-148,241,213, 54, 64,154, 96, 44,231,201,112, 90,147,202, 89, 38, 15, 31,225,248,209, 49,198,231, 98,142, 79,206,114,116,186,194,
- 84,173,193,108, 61, 97,214,194, 64,127, 15,229, 92,132, 85,154,147,213,132,142,238, 60, 81,169,147,185,106, 29, 55, 55, 75, 84,
- 42, 97,226, 70, 86,103,243,145,128,141,235, 8, 29, 34, 72,113, 82, 45,212,160,149,202,202, 64, 77, 28,199,226,137,231,154,153,
- 6,225, 22, 9,194,120, 39, 75,183,141,107,153,165,238, 44, 66,234,133,116,184,245, 52, 67, 66, 8,140, 77, 72,173,196, 9,137,
- 68, 33, 51,109,234,150, 67,156, 53,167,120,181,173, 95,213,176, 45,224, 76, 30,233,188, 95,252, 89,249,168,246, 11,174,155, 56,
- 77, 6,191,237, 51,174,173, 36,216,158, 9,105,223, 63,130,239,253, 96,215,209,124,118, 19,219,127,196,157,215,125,156, 67, 7,
- 71,153,154,174, 48, 62, 83,165,158, 26,230,211,132, 90,195,248, 58,174,241,207, 84,226,141,140,148,146,114,161, 64,210, 72,232,
- 27, 26,202,164,171, 31,172,118,126,186,228,130,166,178,255, 46,226, 90,221,163,209,103, 42, 20, 2, 69,189,145,146,164, 6, 39,
- 28,181, 56,201,180, 24, 4,198,120,231,114,170, 50,207,243,158,245, 91,252,124,239, 1,100, 54, 32, 4, 15,125,110,165, 3,126,
-248,161,191,231,134, 47,223,192,253,199,103,152,168, 53,176, 88, 20,130, 80,249,206, 18,141, 99,174, 94,229,214,175,220,200,139,
-223,240,231,222, 8, 74,111, 23,100,160, 61,120, 76,103, 37,167,182, 86,190, 32,227, 7,177,153,155,213, 52,230, 50, 80,200, 76,
-161,177, 9,126,181,206,183,231, 57,219, 4,145,250,110,145,102,107,160,143, 98,205, 41, 70, 96,129,158,213,225,141,166,115, 18,
-169,116,107,174,120,162, 43,237,255,158,201,210, 74,157,137, 83, 53,107,225, 77,184, 11,139,179,187, 94, 47, 61, 75,235, 43,111,
-237, 69,179,148, 38,188, 28,108,134,200,166, 73,212, 34, 88,140,156,147, 66,103, 92, 35,114,145, 99, 46, 69, 6,128,206, 72,197,
-112,210, 43,131,182, 57,249,194,137, 22,200, 69,176, 48,166, 91,199,114, 15, 63, 9,221, 41, 31, 18, 66,160,147, 95,161,126,230,
- 19,188, 11,175,101,155,145,182,217,119,180,139, 62, 47, 31, 80,207, 51, 44,238, 32, 95,188, 92, 72,175, 39, 43, 78,249,140,112,
- 45,184,146,197, 27,116, 21,159, 64,146,224, 26, 53,226,217, 89,106, 83,211,204, 29, 31,101,110,102,150,217,227, 39,185,236, 53,
-175,226,167,159,252, 44, 59,126,241, 83,254,125,207, 73,100,208,197,190,209,227, 28,157,157,165, 30, 39,204,104, 69,174, 90,231,
-229, 22, 94, 56,210, 75, 56,216,205,177, 35, 19, 36,206,177,121,245, 0, 59, 39, 43,156, 24, 51, 76,165, 9,145,116, 32, 21,121,
- 4,149,212, 34,156, 99, 73, 62, 79, 42, 44, 70, 74,222, 52, 56,200,241, 74,149, 91,199,170,124,253,151,187,185,164,234,216,180,
-118, 45,163,187, 66,198,142,140,209, 63,188,142,227, 91,127,137,107,156,192,137,165, 20,187,138,136,194, 18,102, 71,143, 80, 92,
- 50,140,153, 56, 73,207, 89,231, 51,189,103, 7, 93,107,215,115,248,230,123,113, 82, 32, 10,157,212,227, 58,211, 71, 15,210,185,
-114, 45,133,222, 65,156,246, 2, 42,173,197,142,197, 64,171,230, 61, 83,104, 16, 58,115,196,188,241, 23,109,218,204, 34, 3,176,
- 52, 25,236, 84, 83,125, 73, 45, 28, 83, 10,129, 21, 1, 26,151,233, 53,235,197,207,109, 1,160,209,122,254, 74, 74,164,149, 77,
- 41, 36,140,108, 91,226, 93, 54, 9,157, 56,165, 1, 91,208,174,231,230, 23,133,133,188, 12,206, 98, 27, 13,166,166,103, 24, 29,
-159,226,196,228, 12, 19,149, 42, 39,171, 13, 78,214, 13,166, 88,166,187,163,140,210, 1,249,222, 62, 58, 7,135,168,202,144,169,
-241, 49,250, 59, 67, 86,173, 91, 65, 71,119, 23,249, 82, 39,131,195,203, 25, 90,189,150,168, 80,160, 22,199, 30,172,103,235, 16,
- 68,254, 91, 56, 95,250,145, 89, 77, 93,120,145,105,191,160, 72, 50,165, 38,219,154,136, 18,185,216,240, 72,221,138,165,154, 32,
-121,175, 23, 45, 23, 77, 41,145,229, 3,109,155,151, 46,149,194,166, 14, 99, 44, 46,181,132, 90,130, 82, 24,227, 85,179, 81,153,
- 18, 30,143,210,168,180,207,193, 71,160, 13,239, 78,153,247, 15,174, 10,246,112, 6, 93,114,170, 43, 47, 30,108,145,105, 7, 33,
-102,191,187,246,247,197, 99, 44,231, 55,219,135,164,224,200, 15,191,200,142, 91,111,228,232,209,163, 28, 28,157,224,248,108,149,
- 56, 53, 36, 54,211, 46, 87, 62,146,141, 19,139, 75, 93, 22,177, 67, 20,104,180,144,132,161,102,233,250,213,158,130,249, 81, 98,
-239, 79, 28,217,237,203, 85, 73, 74, 61, 78,232,239, 42,177,235,232,164,103,163, 52,150,196,250,115, 55, 18,131,193,101, 81,171,
-224,192,137, 99, 60,239, 73, 87,114,253,143,127,148, 25, 44,245,160, 75,244,252,145, 93,124,227,173,255,157,173,247, 31,100,251,
-209, 41,180, 16,164,169, 37,146, 10, 99, 45, 74,121, 37, 54,133, 35,167, 52,163,163,135, 73, 91,134, 75, 47,130,139, 52,127,111,
- 7, 91, 54,159, 99,154, 38, 72, 29,128, 82,212,230,166,185,255,206, 31,115,219,247,110,230,192,190, 3, 32, 21, 91,206, 59,143,
-231,189,226,213,116,244,247, 47,190, 31,109,201, 38, 63, 78,213, 34,231,206,102, 22,120, 17,110,192,101,236,213, 72, 4, 41, 66,
-168, 69, 2,174, 2,215,226,108, 95, 12, 66, 59, 61,137, 83, 51, 85,191,176,136,202, 83,189,191,197, 70, 85,180,138,239,109, 8,
-241,102, 0, 98, 90,246, 73,136, 38,100,214, 34, 90,140,127,109,129, 74,123,143,220,175,224,141,183, 98,218, 44,251,128,117,232,
-198,175,208, 16,210,158,104,108, 38,196,156, 92,184,125, 15,134,224, 21,143,226,156,139,208,186,217, 13, 20,153,186,112, 96,102,
- 48,187,239, 96,251,103, 62,197,166, 87,191, 30, 85,234,163, 49, 62,134, 80, 1, 73,181,194,190, 29,251,153, 61,122,136,181, 79,
-188, 2,109,107, 76,143,141,113, 98,198,114,120, 38, 70, 41,203,108,173,193, 68,189, 65, 49, 73,121,147,113,188,240, 9,235, 17,
-133,136,153,217, 58,197,114,142,189, 56, 62,119,108,154,101,192,110, 7,197, 66,142,176,152,103,223,236, 60, 69,101,168, 38,150,
-126, 96, 28, 40,204, 85,216, 28,104, 58,149,226,115,211, 99, 44, 85,146,171,187,186, 40,205,228,184,245,246,173,236,156,152,224,
-146,165,199, 57,247,146,115,168, 76,141,145,214, 13,129,171, 83,175,156,100,118,236, 56,185,206, 94,130, 82, 9,113,236, 48, 38,
-174,114,226,151, 85,130,158, 65, 26,219,182, 97,115, 93, 36,141,152,169, 61,219, 24, 56,247, 10,102,166,103,177, 58,244,108, 69,
- 46, 33,174,213, 72, 11, 29,139,238,119,251,115, 17,109,206, 85,147, 22, 86,138,197, 9, 76, 3,139,212,213,116,219, 3,144,205,
- 76,115,107,194,103, 90,196,206,115,202,167,109,142,156, 56,221,212,145, 11, 99,193,181, 47,235, 89, 42,172,148,201, 48, 58,215,
-206,228,230,192, 88,223,101,235,108, 86,178,201, 12,187, 53,212, 39,142, 49, 57, 53, 73,181, 50,199,108,101,158,217, 90,157, 21,
-235,215,161,195,128,241, 99,199, 40,151,138, 12, 12, 14, 81,236, 40, 33,145,200, 48, 71,119,103,153,101,203,135, 41,150, 59,233,
- 27, 94, 78,239,202, 53,228,242, 57,140,115,212,146,216, 79,112,171, 17, 74,131,136, 17,132, 30,221,107, 13,210,202, 44, 43, 33,
- 23, 34,200,204,179,183,109,102, 74,156,102, 28,167, 44, 80,221, 34,252,189,109,142,235,176,249,191,206,247,218,136, 12, 25,141,
-147,152,212, 75,225, 6, 74, 97,141,243,156,254,169, 33,149,158,178, 57,109,102,179, 30,197,218,224, 30,197,252, 6, 78, 43,247,
-121,186,107,124,172, 9,131,135, 67,226,139,199,184, 62, 61, 24, 48,191,169, 19,126,240,134, 15,113,248,222,187, 24, 61, 60,202,
-254, 67,227,212,141, 33, 10, 36, 39, 43,117,172,131, 64, 43, 58,149,164,154, 26,202,145,226, 88,156,160,149,196, 57, 63, 14,138,
-249, 60,229, 98,145,176,167,139,198, 41, 4, 68, 11,233,143,102,144, 39,218, 65, 76, 32, 32,153,157, 66, 72, 65,163,222,160, 24,
-133,236, 60,120,156,185,216, 32,156,163,158, 90,148,128,212, 90,111,208, 51,182, 75, 44, 68, 90,115,203, 79,239,228, 47,158,253,
- 2,222,241,181, 47,129,179, 62,240, 57,213,160,239,184,131,239,127,244,109,252,116,235, 94,172,243,180,168, 70, 10, 2, 45,136,
-148, 38, 54,222, 17,109,162, 56, 6,123,122,152,155,155,161,122,218, 60,202,233,193,155,105,154, 34,180,166,114, 98,148,239,124,
-228,189,124,229, 43, 55, 48, 62, 59,207,120,173, 65, 35,177, 52, 50,231,244,166, 31,222,193,215,190,116, 35,239,250,244,103, 25,
-217,116,230,233,154, 61, 22,157, 79, 60,132,253, 80,178,125,190,233,182, 78,210,133, 79,251,168, 87, 46, 68,192, 45, 7,177,221,
- 61,104,163,124, 62,237, 40,122, 32,229,238,194,115,180,109, 15, 55,251,177,110,225, 51, 25,186,182,137,169,105,102,246, 22, 71,
-218, 60,128,184,234, 65,141,247,195,124, 70,100,199,106,126, 74,127,239,159,207,162, 86, 79, 72, 27,134,122,236,211,180, 42,146,
-190,170,231, 22,162, 41,219, 92,112,164, 67, 10, 7, 86, 96,141,223, 7,128, 12, 37, 34,200, 4,186,140,243,117, 72, 99,193, 64,
-146, 58,106, 85, 71,218,180, 40, 70, 32, 13, 4, 54,139,198,243, 22, 23, 64,190, 44,137, 10,158, 67,221,103,241, 29, 78,250, 20,
-134,176, 6, 29,150, 89,186,241,106, 54, 61,253,141,255,151,176,247,142,179,236,186,234, 61,191,123,239, 19,110,168,212,213, 73,
-106,169,149,213,146, 37, 89,150,179,141, 45,108,112,192,198, 96, 12,198, 4, 99,114, 52, 96,242,204,131, 55,192,131, 97,224,241,
- 97,200,240, 48, 25, 51, 24,143,193,198, 96, 27,131, 19,248, 25, 99,108,225,164,172,150,186,213,234, 86,231,234,234,138, 55,156,
-176,247, 94,243,199,218,231, 86, 9,222,231, 51,127,244,167, 90,234,170,123,111,221,123,206, 94,107,253,210, 34,158,254, 44,213,
-133, 11,140,214, 90,142,124,205, 27, 41, 15,221, 76,216, 88, 71, 36, 99,186,186,198,169, 7,143,115,255,103, 62, 71, 35,145, 55,
-124,237, 55,243,196, 63,255, 13, 79,156,186,200,123,191,240, 24,251, 22,151, 56,189,118,153,237,170, 97,185,106,185,247,139,111,
-101,122,112,153,122, 99,139,122, 92,243,240, 67, 79,176,226,225,157, 65,184,253,202,189, 60,122, 97,141,243, 34, 44,182,129,218,
- 89, 34,194,177, 86, 88,180,112, 49, 66,153, 14,216,127,242,158, 43, 67,224,178,133, 11, 81, 56,187,190,198, 80,224, 25,115,139,
-220,245,232, 6,247,212, 39,184,250,166, 67,244,183, 61,198, 26,150,246,238,231,228,189,159,225,217, 47,187,139,237,209,152, 11,
- 71, 31,100,188,185,198,222,195, 55,114,197,237,119, 48, 88,218,207,120,229, 28,139,135,174,135,162, 96,114,233, 60,147,149,243,
-236,191,237, 14,189, 88, 45,248,170, 5, 17,134,120,254,228, 23,110,165,169, 54,104, 91,193,123,161,173,132,232,133,182, 22,188,
-135,166, 17,154,102,199, 22,104, 51,195, 96, 8, 75,139, 80,244, 12,153, 53,184, 12,202, 82, 59,220, 24, 68,125,244, 65,168, 38,
- 66, 85, 9, 62, 8,185,131,178,111, 40,114, 67,150,171,205, 67, 82,118,123,219,234, 5, 31, 69,102,141,175,179, 42,188,201,157,
- 81, 15,170, 75, 40,117, 98,103,250,125,147,172,145,105, 34,193,130, 7, 31,244,226,115, 86, 53, 63,209,128, 45, 12,174,176, 52,
-151, 2,143,158,242,108,143, 34,227,137, 80, 54, 66,216,206,112, 65, 88, 30, 8,147,177,112,225,232, 67,244,156,101, 41, 97,212,
-193,193,218,113, 75,181,199,112,110, 96,200,250,134,114, 78,179,243,163, 24,197,178,131, 16,188,224, 74, 21,215,152, 96,200, 27,
-176, 99,232, 77,161,140,150, 65,190,200,220,242, 45,212,163,179, 76, 70,231,217,116,129, 81, 17,137, 70,200,157, 97, 46, 88, 6,
- 88,140,131,105, 97,136, 3,139,157,115,184,197, 28, 83,170, 45, 71,210,123,226,130, 65,198, 80,136,193,230, 57,253,189,119,178,
-103,255,115,152,222,251, 33,216,184, 72,214, 58,172,100, 56,167,147,110, 4,164, 48,208, 51,180,139,134,182,167,135, 79, 81,131,
-155, 58,108, 48, 16,157,190,191,226,176, 70, 87, 9, 22,203, 55, 96, 92, 15, 63, 58, 15, 97,186,115,248,204,206, 60,229, 28,213,
-115,109, 49,229, 30, 36, 86, 24, 95,237,112,147,169, 32,206,224,107,231,118, 53,218,233, 49, 66, 72, 9,138,122, 6, 32,154, 28,
- 56,131, 85,163,236, 18, 32,106,128,203,127,154,186,173, 77,252, 99, 7,163,166,174,208, 25, 76,190,160, 34,169,118, 59,209, 63,
- 78,191, 90,171,212, 72,183,148, 72, 28,224,119,120,201,238,169,141,112,206,237,227,204,185, 85,206,156, 62,195, 19,167, 87,217,
-152, 54, 92,216,154, 48,110, 2,185, 49,204, 15, 10,100,218, 82, 7,161, 95, 58,181, 73,109,142, 57,191, 49,130,104,200,178, 17,
- 87, 47, 95,137,111,166,132,119,254, 23, 88, 58,128, 29, 46,129,117,200,100, 27,191,117, 25,218, 10,105, 38, 72, 91,167,247,196,
- 34, 65,105, 23, 59, 92, 96,202, 18, 54,179,132, 54, 80, 53,129, 75,219, 53, 18,133,237, 38, 16, 69,155, 89, 47, 50,107,218, 66,
-242, 27,183,162, 91, 53,223,251,177, 15,242,162, 31,255,118,238,190,225, 44,109, 94, 49,206, 38,152,178, 33, 74, 75,217, 95,228,
-193, 79, 28,228, 11, 15, 61, 65, 20,225,244,250,136, 34,119, 84,109, 36, 51,142,126, 47,103, 32,134, 81,237,201,140,161,141,176,
- 61, 29, 51, 55, 24,178,249,209,151, 34,205,152, 64,139,151,144, 86, 95, 91, 98, 47, 16,179,128, 43, 33, 90,165, 6,104, 23,248,
-196,159,205,243,207,159, 61,195,137, 75,155,156, 29, 85, 56, 3, 77,208,143, 43, 75,130, 59,137,129,245,241, 38, 31,121,219,219,
- 41,246,252, 14,181,213,223,175, 73,205,186, 94,114, 70, 81, 49,129, 44,203,112, 24, 92,180,244,157, 99,206,229, 12, 76,129, 51,
-150, 73,221,178,222, 84,108,214, 45,147,160,219, 26,173,129, 72,164,110,161,109, 18,109,104,211,231,157, 66,233,103,170, 43,129,
-126,207, 96, 51, 61, 87, 36, 10, 89,174, 89, 24,193, 67,221,118,187, 43,244,140,202,114, 69,136,186,186, 92,150,202, 8,147,236,
-111,173, 7, 95,107, 82,186, 73,180,162, 85,119, 46,121,169,154,113,155,146,212, 69, 32,180, 66,235,149,246, 40, 51, 40,250,150,
-133,161, 33, 47, 44,121, 6,189, 57, 71,191,231,232,149,234,193, 47, 10,200, 75, 71,153,232, 12, 35,129,141, 77, 79, 53, 9, 68,
- 47, 84, 85, 36, 68,216,218,136, 84,211, 72,227,133,108,189,217,160, 65, 24,213, 42, 75, 43, 50, 67,158, 22,151,248, 8,161, 78,
-107,203, 50,212,118,144, 38, 60,223, 64, 86,148,132, 88,145,139,114,178,101,207, 96, 34,196,100, 81,232, 26,166, 42, 10,117,186,
-255, 9,234, 10,203, 49,228,141,129, 92,151, 14,216, 18,108,207,226, 75,163, 34, 47, 49,184,204, 17, 98,160, 55, 88,230,139,190,
-242,183, 56,116,227, 23, 67,243, 24,225,228,191, 98,122, 7,137,102,155,213, 99,247,112,197,107,190, 10, 66,139,196,192,248,242,
- 26,103, 31,124,136,123, 62,249, 73,126,249,111, 63,202,133,234, 9, 54, 30,254, 20, 15,124,226, 83,188,239, 19, 31,103,121, 97,
-153, 83, 43, 23,152,120,207,202,196,115,246, 69,183,176,210, 4, 56,187, 74,214,115,220,243,216, 10,111,207,134, 44,239,159,231,
-234,181, 13,142, 87, 13,167, 19,105, 54,148,128,153, 6, 46, 69,141, 64,149, 8, 91,104,102,250, 9,224, 90,224,178, 8,171,192,
-161,204,112, 54,194,150, 8,159,218,222,228,121, 83,199, 93,143, 4,206, 14,238, 35, 92,123,144,167,221,124, 29,231, 79, 27, 46,
-173,158,100, 50,185, 1,231, 96,105,239, 60,253, 50, 50, 89,125,130,135, 63,248, 40,131,189, 7,233,239,217,135, 60,246, 48,251,
-175,189,129, 61,215,220, 76, 51,153, 48,186,180, 74,111,239, 50,205,165, 21,222,240,220, 23,241,204, 91,143,240,245,223,241,109,
-124,231,207, 28,229,247,254,251, 13,180,227,117,154, 86, 24,215,224,235, 72,104, 58, 72,207, 80,213,130,151,136,115,234,103, 12,
-193, 98, 91, 40,173, 33,235, 65,191, 52,180, 38,224, 10,131,111,180, 41, 8, 2,190, 20, 38, 94,104, 69,200, 44, 84, 1,138,204,
- 48,200,211,148,157,138,174,110,168,139,122,145, 39,145, 72,102, 53, 94,177,138,144,245, 45,209,107,198,190,177,144,101,194,216,
- 90,138, 92,111, 76, 9, 6, 73,129, 22,173,236, 40,227,109,169,185, 4,189, 62,180,214,210,154,192,212, 70,198, 81,152, 4, 97,
-161,167, 31,132,193,144, 91, 97,169,103, 24, 56,195,162, 24,114,111, 40,140, 97,185,111,145, 2, 70,185, 16, 11,129,129, 16, 74,
- 8,198,226,114, 67, 68, 8, 77,196,228,250,123, 56,103,200, 60,216, 6,178, 40,100, 88,202,148,199, 16,170, 85,218,208, 48, 37,
- 48,118,145, 9,162, 57,205,187,186,119,113, 22,151,131,233,129,153,131,208, 7, 91, 68,218, 86,176, 46,217, 99,188,193, 70,139,
- 4,240,153,103, 58,122, 20,191,126,150,162,222,166,232,132,162, 68, 68,148,211,180,153, 35, 90,136, 86,139,161, 53, 49,125,143,
-219,105,138,130, 36,106, 63, 49,210,206, 18,167,171,152,124,142, 24,234,157, 25, 68,189,122,233,176,144, 89,118,191,158, 86, 27,
- 59,255,158, 40, 7,118,241,169,138,106,248,164, 49,232,160,241,167,230, 70, 72,199,173,117, 54, 34,219,201, 95,172, 22,243,110,
- 8, 73, 13,197,108, 97, 84,148,110,121,195, 12, 25, 53, 9, 90,148,182, 81,199, 77,210,115, 64, 23,223,155, 14,222,142,155, 20,
- 63,107, 28,186,169,202, 2,155,131, 43, 57,245,196, 25,206,159,185,192,227,103, 86,217,158,180, 76, 26,207,160,200, 16,244,204,
-105, 93,142, 72,205,234,229,117, 70, 77,224,192,129,189,188,233, 13, 95,206,235,191,249,155,184,230,200,157,204,205, 47,146,247,
- 10,144,134,118,125, 29,147,101, 42,124,242, 77,154,210,116,139,138, 49,218, 92,249,241, 6,147,207,189,159,246,220, 81, 76, 48,
-216,189, 87, 19, 46,110,232,185,151,193,165,245,109,114,107,216,106,125,242, 72,119, 5,105, 39,100, 11, 68,205, 69,137,223,109,
-218,150,191,248,216,253,124,209, 29,119,226,227,163,216, 76, 19, 91,114,147, 81,173, 9, 31,191,231, 97, 54,155, 70,105, 55,132,
-210,169, 14,233,154,133, 1,235,211, 22, 99,160, 47, 14,103, 51,214, 39, 83, 50,231, 40,203, 18,241, 53, 38, 3, 27,117,171, 36,
-206,129,139, 24,103, 20,193,138, 30, 17,135,149,130,119,252,130,240,222,207,221, 75,139, 97,210,122, 36,170, 6, 32,138,230,136,
-116, 75, 81, 22, 6,125,170,198,211,134, 72,127,184,136, 84,107,196,168, 13,139, 72, 82,218, 59,176, 81,155, 64,211,234,176,208,
-115,142,210,100,244,200,113,100,250,126, 89,155, 18, 38, 53,191,194,166,194, 92, 53,187,250, 70,146,192,207,170,166, 40,207,100,
- 70,113, 73,147,168, 91, 5, 2,245, 53,196, 29,200,104,246,125,179,173,115,169,248,167,203,168,109, 32, 43,210,153,100,180, 52,
-198, 84,232,109, 0, 87, 66,222, 99,230, 14,202,146,174, 54, 81,239, 16,116,137, 86, 89,232,191, 73, 43, 76, 42, 24, 90, 33,179,
-134,210, 25,122,133, 37,179,134, 86, 32,115,150,126,225, 48,153, 22,208, 24,133, 65,223, 81,148, 6, 39, 58, 68,133, 16,152, 27,
-194,120, 27, 70, 85, 36,155,100, 13,193, 7,198, 54, 82, 22, 6, 95, 64,204,180,107,154,182,122,120,196, 86, 29,237,214,166, 67,
-190, 21,174,190,250,102,174, 59,242, 28, 30,190,247, 35,172, 95,190, 76, 22,160,231, 45,214,136, 38,128,165, 55, 56, 68, 93, 32,
- 66,166, 16,111, 72, 40, 73, 12, 6, 49, 6,151, 67,155, 9,189,210, 48,205, 18, 67,148,101, 88,215,226, 6, 87,240,210, 87,253,
- 22,135,111,124, 25, 34, 91, 8,171,152,202,227, 22,246,178,254,240,253, 60,246,137, 79,178,124,235,109,106,251,154,172,115,233,
-177,163,156,184,247, 94, 30,248,183,207,242,143,255,122, 31,127,254,199, 63, 79, 94,206,113,242,190,135,184,231,158,251, 56,191,
- 53,161, 9,134,173,182,101,141,156,127,122,198, 65,154,224,105, 71, 21, 49, 4,222,241,200, 5, 30,190,254, 90,214, 39, 19, 62,
-115,226, 52, 7,128,190,129,101,103,216, 12,194,195, 62,114,251, 85,251,248,233,175,127, 45, 55,221,241,116,150, 15, 30, 98, 97,
- 56, 71,150,151, 52,147, 41,227,201,152,245,245, 85, 62,246,119,239,227,255,249,231, 79,114,110,107, 76, 1, 92,229, 12,247,133,
-192, 19,245, 54,139,255,242, 0,175,186,125,194,158, 47,253, 18, 30,253,240,167, 57,116,232, 0,163,211,151,184,246, 57, 87,225,
-174,185,134,182,105, 25, 95,218, 38,182,171,108, 79, 85, 20,149,247, 74,214, 79, 63, 65, 94,244, 89,190,249, 86, 98,244, 44, 46,
-239,229,240,158,189, 92, 51, 44,152, 76, 43, 78,221,247, 4,217,224, 31,249,254,159, 58,193,175,255,252, 94, 66,222, 96,123, 66,
- 91,107, 97,245,181, 42,175,197, 9,193,171,231,222, 71,176, 65,200, 90,104,141,161,159, 89,178,168, 19,188,247,218, 1, 10,208,
-132,136, 71,136, 78,187,217,128,126,174,193, 11, 25, 58,185,123,152, 21,234, 40,162, 98, 59, 81,132,192,228, 90, 40, 76,145, 66,
- 43, 45,136, 51,184,204, 80,103,208,203, 35, 85, 64,215,229, 2, 94,244,113, 67, 58,216,156, 83,120,203, 57, 67, 5,228,133, 48,
- 65,152,182, 66, 27, 5, 31,133,133, 5, 75, 59, 0, 19,245,240,243, 49, 45,196,113,176,144, 43,154, 98,172,224, 1,143,110,146,
-170,197, 96,140,144,231,162,157,153, 36, 97,161,168,197,198,215, 66,142, 34, 74,185, 64,137,224,162,197, 54, 19,170,245, 51, 84,
-210, 48,113,145,177, 4,154,168,147, 73,204,146,224,198, 9, 18,162,138,113, 44,196,220, 96, 82,227, 97, 51,104,125, 36, 79, 66,
- 70,151, 11, 49,179, 68, 99, 65, 70,196,118,140,195, 17, 77,166,147, 90, 84, 94,221, 56, 75,148,136, 9,201,166,152,144, 4, 35,
- 70,139,156, 86,123,149, 6, 25,187, 83,168,173, 33,212, 35, 76, 51, 86,104,223,217,148,117,175, 78, 21,125,220, 93,108,105,106,
- 98, 5, 93,106,180,195, 35,198,196,247,219,153,162,216,216, 36, 6,116, 58, 26,237,164,220, 37,199, 75, 87,188,157,157,217,122,
-164,227, 89, 76,103, 37,178, 51, 37,250,110,133,206, 83, 38,124,163, 83,187,132,105, 90,252,144,237,130, 38,255,131, 27, 33,165,
- 1,202,174, 93,164,198,128,159,223,207,209,199,207,178,190,178,206,153, 11,107,196, 68,169, 44, 12, 6,108, 53,158,245, 11,231,
-105,218,150,125,123, 23,121,205,235,190,140,111,249,241,159,102,110, 97, 15,121, 57, 76,175,202, 67,172,244,249,155, 41, 18, 61,
-121,175, 79, 12, 30, 95, 87,233, 87,142, 72,132,208,140,137,193, 19, 67,192,152,140,252,217, 95,195,220, 75, 23,168,143,126,146,
- 51, 79, 60, 76, 83, 87,216,220,210, 84,158,237,170,161,137,138,134,138,209,230, 36,179,150, 16,133,208,189, 79,178,195,111,119,
- 84,228,163, 39,143,243, 79,199,191,130, 23, 29,121, 16,103, 12, 98, 4,103, 44, 11,123, 60,197, 53,219,156, 63, 58, 97,105, 33,
-227,235,191,248, 14,206,156,142,172,110,142, 24, 77, 91,230,162, 36,181,122, 61,219,166, 56,169,107,150,151,135,144,251, 29,187,
-165, 19,196, 68,176, 49, 61,182, 94,175,177,181,108,172,181,252,233,191, 29,199, 89, 75,102,244, 30, 52, 6,218,168,197, 9,209,
- 84, 72, 99, 12,173,111, 25,244, 6,108,108,172, 50,127,125, 9, 34,228,121, 58, 67,130, 94,223, 86, 89, 46, 76, 84,228, 47,243,
- 74, 59, 21,214, 81,152,140,194, 57,166,120,154, 54,232,115,101,154,110,222, 33,143, 10,201,119, 72,159, 94, 2, 94, 55,132,211,
-245, 38, 49,189,198,152,134, 75,103, 19,117, 24,180,232, 75, 90,166,213, 93, 90, 88, 67,202,135, 81, 23,170, 40,238,159,162, 51,
-180,185, 16,144,144, 26,122,155, 16,207, 92,109,108, 93, 49,183,105,232,113, 86, 48, 22,250,125,237,155, 99,212,228,187,182, 18,
-188, 19,164,232,132,195, 73, 4,155, 25, 50,231,112, 46,215,137,201,233, 80,157, 13, 19, 76, 32, 66, 16,143,175,161,204, 13,121,
- 33,100, 83, 67,214,208, 18, 77,164,152, 19, 50,103, 48, 14,124, 52, 68, 34,209, 25, 2,122, 90, 69, 49, 52, 29, 55,227, 29, 89,
-209,167, 55,188,130,105, 12,140,166,129,126, 63,249,210,141, 65,210, 94,218,188, 7,117, 4, 91,232,197,232, 34,152,214, 32, 25,
-216, 90, 59, 22, 6, 66, 86, 26,178,121,144,220, 17, 76,100,110,105, 63, 47,125,245, 91,185,242,154, 23,170,102,190,131,254, 87,
-238,163, 61,191,194,229, 7, 30,102,237,252,136, 97, 49,199,205, 95,247, 93,196,205, 21, 66, 61,101,229,216, 9,142,125,250, 83,
-228,146,243,216,218,101,190,242, 59,255, 11,147, 51,247,178,122,234, 44,159, 60,122,130,202,195,202,104, 11,159,101,124, 7,129,
-103, 93,185,196,137, 83,171,172, 93,218,230,183, 87, 71,220, 7,196, 39, 78,113,211,190, 69,110, 52,112, 65,116, 59,218,151,223,
-117, 11, 63,245, 63,126,147, 61,131, 33,217, 96,200,214,229, 75,140,214, 55, 8,173,103,123, 99, 99, 70,146, 88,231, 88, 94,218,
-203,155,126,232, 71,248,182, 31,248, 97,198,219, 91,188,235,175,254,146, 95,252,171,191,231, 48,112, 33, 68, 38,206,242, 39, 15,
- 61,206,133,255,251, 79,120,230,171,190,152,122,178, 70, 49,200,112,197, 60,195,131,135,136,245, 20, 87, 46,176,112,240, 8,117,
- 5,197,222, 27,241,155, 35, 36, 11,108,156,124,156, 98,110,158,141,179,231, 56,246,224,231, 57,179,177, 77,175, 92,228,242,104,
-131, 7, 30,190,135, 79,127,254, 35, 76, 46, 30,227,155,191,239, 19,252,209,111, 60, 23,147, 41,124,237,167,130, 87,201,186,138,
- 27,131, 54, 11, 81,192, 78,146,228, 36, 66, 49,136, 84,173,174,140,141, 94,243,162,131,104,131, 23, 80,145, 91, 52,218, 45, 64,
-145,241,107, 0, 0, 32, 0, 73, 68, 65, 84,118, 43,112,218,118,102, 62, 72,110,198, 36, 84, 73,112,191, 0, 85, 35, 20,214, 82,
- 22,170, 36,142,198, 96,156,222,125,206, 66,211,202, 76,119, 18, 68, 8, 77,178, 15, 53, 96,243,136,175,181, 59,110,163,118,195,
- 54,234, 4, 19, 69,168,131, 80, 24,133,197, 66,166,232,131,180, 26, 98,225, 68,179,153,219,180,140, 65,140, 54, 38,164,215,170,
- 29,100, 36, 24,237,154, 29, 22,147, 25, 66,212, 66, 89, 20,144,167,199,207,141, 37,143,134, 44,113,253, 98, 35, 65, 82, 83,145,
-226, 36,179, 36, 94,176, 78,167, 15,107, 13,226, 74,218,220,208,184,168, 80, 94,209, 61,183,195,182, 49,173,221, 77, 7, 96,166,
-135,154,201,116, 5,101,231, 90, 51, 93,225, 10, 50,171, 91, 54,130, 52, 74, 81, 1,152, 86, 97,118, 43,105, 4, 49, 6,137,162,
-105, 92,166, 75,202, 98,166,218, 39, 65,121, 98, 93, 10,240,208,194, 42, 49,125, 99, 76,113,209,214, 60,133,215,235, 92, 0,200,
- 46, 62, 84,216,121,109, 51, 8,221,165,229,198, 97, 23, 40,160,106,101, 9, 65,127,175, 44,201,139, 37, 5, 69, 69,233,242,165,
- 18, 69,180, 83,176, 99, 8, 24,151, 99,202, 82,121,158,164,118,198,154,157,176,172, 14,162, 79,112,189, 72,196,206, 20,215,150,
- 99,107, 53,151, 47,173,113,242,236, 69,130, 24,246, 46,207, 99,215,183,184,255,248,105,110,187,229, 6,126,234,221,239,224,170,
-155,110, 99,113,223,149,137, 98,168,211,215,118,135, 3,141, 50,243, 38,153,174,209,136, 66, 94,150,196,182, 33,180,158,224,189,
- 54, 36,137, 27,215,133,105, 45,213,198, 10,238,240,157,220,120,219,151,176,120,236,179,124,238,125,111,231,204,153,115, 20, 69,
-201,218,120,147, 38, 66,227, 67,138, 53,213,137,215, 97, 8, 49,221,109, 70,102,130, 46,155,138,229,125, 15, 63,204, 75,238,186,
- 2,169, 47, 32,198,144, 91,139,117,134, 31,122,211,213,216, 8,198, 23,212,219, 55,176,190,122, 22,107, 28,131,178,194,175,141,
- 17, 34, 33, 68, 46,111,110,115,118,115,139,150, 57,124,189,142, 41,123, 72,107, 33,171,241,161, 38, 70,173,126, 46, 6,221, 91,
- 33, 22,235,132, 3, 87, 26,230, 74,199,229, 73,203,176,204,152, 43, 29,155,149, 87,157, 79,231, 74, 74,162,181,214,123, 6,189,
- 30,227,241,152, 94,177, 68, 61, 61, 55, 19, 63,135,116,118,132, 36,208,137,169,192,155,194, 96,177,244, 93,166, 91, 60,137,212,
-190,165,117, 30, 31, 2, 18, 68,239,151, 4,125,219,168,200,151, 75,211,117, 76,240,127, 7,214,216,180,110, 58, 47,244, 90,180,
- 70, 27,138,174, 95,109,252, 14, 37, 30,196,208, 47,211,240,158,237,210, 26, 57,102, 10,251, 78, 24,148,149,224,189, 65,130,204,
-154, 0,137, 10,219, 71,160, 87,104,237,204, 11,109, 90,138, 76,155,129,208, 66, 51, 21,154, 86,105, 38, 31,146, 31, 63,209,253,
- 89, 97,200,196,146, 21,118,182, 72,202, 96,116,159,136, 19,162, 4, 76,114, 4, 5,167,215,100, 95,244, 60,206,140, 17,196, 69,
-242, 76, 39,153, 24, 12,193,234,137,111,178, 78, 85,231, 16, 47,196, 24,104,188, 32,177,229,190, 7,238,231,216,177,199,217,222,
-222, 36,136,238, 19,216, 51, 0, 31, 12,109,173, 28,155,235,165, 22, 57,151, 4, 77, 24,178, 92,232,205, 25,218,145, 32, 83, 33,
- 22,224, 6, 22,227, 2,115, 75,135,121,229,107,223,198,190,131, 55, 34,140,117, 87,176,233, 65,253, 32,241,196,231,105,207,175,
-210,100,123,184,226,235,126,144,225, 35,159,229,226,195, 15,165,211, 66,152,110,141, 88, 57,119, 22,241,142, 63,252,224,199,249,
-127,223,243,135,248,245,199,137, 18,184,120, 97,149, 51,107,219, 8, 22, 31, 35,249,184,225, 87,238,190,149, 11, 23, 55,120,232,
-228, 42,191, 51,109, 57, 15,204, 37, 14,232,242,234, 38, 79, 0,255,227,103,222,204, 87,127,203,183,131, 24, 46,157,125,146,245,
-186, 66, 46, 95,158,165,218,185,178,196,182, 81, 69,102,198,146,149, 61,172, 49, 76,199, 35,182,215,215,168, 71, 35, 94,254, 37,
- 47,227, 53, 47,255,114,126,255, 29,111,231,237, 31,251, 55,214, 67,228,101, 71,174,228,213,223,251,245, 28,127,248, 12,151,206,
- 93,226,218,171,151,192, 9,177,173,200,230,250,184,201,148,172,191,136,247,158,176,189, 70,185,119, 15,229,226, 30, 22,174,214,
-188,230,107,159,121, 23,111,216,191,159,111, 31,246, 88,221,156,240,152, 57,207,231, 46,158,225, 80,209,227,185, 71, 47,240,244,
-215, 94,193,145,219, 94,199,131,159,253, 91, 29, 42,106, 84,100,149,220,133,157,119,192,165,110,177,173,132, 94,207,224, 91, 67,
-175,103,104,235, 72, 20, 69, 92, 66,171, 73,127, 62, 64,104,181,219,141, 73, 89,215, 54,130,239,233, 94,116,241, 80,244, 65, 50,
-213, 84, 4,151,110,144,160,103, 96, 75, 68, 48,148,165,121,138, 90, 53,122,189,238, 36,106, 65, 55,209, 42,199,214,193,115,149,
-222,168,226, 77,167,125,209,127,119,250,216, 86,244,134,182, 61, 67, 86,130,140, 5, 9,122,208, 70, 11,141, 49,108, 69, 97,222,
- 42,197, 16, 17,178, 12, 90,167, 83,253,206, 4, 40,152, 66, 82, 49, 87,189,170, 84,202, 11,155, 76, 40,172,198,135,154,168, 5,
- 71, 2,136,141,248, 4,151,154,216, 57, 62, 20, 97, 48, 8, 89, 94, 80,236, 61, 12, 7,150,216, 54,199,240,166, 1, 99, 40, 10,
- 75,219,128,139, 2,181, 26,145, 93,110,136,118,167,248, 25,103,210,166, 56,157,206,109, 74,158,154,201, 97,130,193,181,224, 45,
- 88, 28, 89, 48,233, 16, 79, 42,243, 16,149, 79, 55,154,130, 40,214, 66, 72,238,210,153,240,118,199,158,179,123, 42,238, 32,113,
-147, 10,214,172,176,207,178, 36,118, 10,244, 78, 53,213, 72, 93,237, 56, 74,160, 77,233,124, 54,217,247,210,207,248,248,148,197,
- 21, 51,213,211,110, 49,153, 73, 81,189,105,242, 82,181,122,142,155, 59,132, 29, 30, 32,142, 47, 16, 38, 43, 79,145,233, 25,211,
-169, 6,147, 21,203,170,245,149, 20,162,210,246, 23,185,116,242, 44,235,155, 35, 92, 94, 48,140, 19, 76,219,112,231,221,119,243,
-139,239,251, 69,141, 9, 38,130,132,212,244, 4, 32, 79,205,131, 48,155, 84,186, 24,225,214,235,210,142,182,214,180, 14,159,174,
-225,168,132,178,205, 50,181, 70, 90,147, 14,251,136,203, 11,229,119,167,171,236,187,238, 86, 94,243,127,188,149,219, 62,251,207,
-252,248,247,254, 32, 15,157, 60,199,118, 16,230,135, 61, 6,189, 94,178,235, 70, 93, 67, 28,162,194,215,117, 96, 84,251,167,136,
-199,142, 29,123,156, 83, 43,119,115,227, 85,141,246, 29,141, 7,105,177, 86,239, 37, 99, 35,167,158,108, 89,219,216, 36, 68,131,
- 88,195,252,194,128, 67, 7, 15,112,123,153,115,228,214, 35, 44, 45,239,229,202, 43, 14,179,231,138,171,136,197, 55,144,247,134,
-100,206, 18,253, 20, 95, 62,192,197,199,127, 89,197,170,109, 80,221, 71,102, 9, 18,248,139,183, 31,230, 27,191,233, 52,149,247,
-236, 91,232,177, 84,102, 60,177, 89,165, 94, 75,135, 28,137, 41, 71, 29, 69,155,138,124, 41, 81, 11, 73, 63,111,205,172,248,199,
-104,158, 34,240,149,174,137,177,145, 90, 60,181,109,169,130,135, 76,212,230, 23,165, 3,130, 8,187, 24,155, 78,175,227,131,210,
-124,214,165, 13,117,233,236, 8,102, 7, 49,246,162,197,182,155,144,109,166,246, 81, 81,131,211,140,117,138, 41, 76,212,228, 9,
-197, 11, 80, 77, 81, 93, 81, 38, 72,169,214, 94,151,165,243, 74,116, 80,200,156, 73,189,166, 97,208, 83, 36,211, 5,195,148,136,
-212,122,153,149,125,232,149,134, 44,179, 12, 6, 57, 46,119, 20,118,135,133,114,174,107,210, 45, 54,179, 72, 12, 51,123,156,111,
-132,152, 6, 9,165,187, 13, 89,136, 65,187, 3, 27,117, 65,124, 84, 78,221,183,137, 19, 51,134,195, 87,221,200,104,107,147,147,
-103,206, 43, 25, 63,133,186,110, 89, 51,235,216,104, 40,251,122,224, 55,173, 33,239, 25,250,165,193, 68, 37, 44,242, 60,137, 31,
- 10,245,253,217,132,201, 15,150, 12,161,111,136, 46,178,239,202,155,120,237, 55,254, 21,195,249, 62,216, 57, 36, 84, 88,119, 21,
-178,254, 41,196,142,224,252, 69,252,198,132,242,101,223,139, 60,248, 65, 62,243,243,111,225,163, 31,250, 60, 63,254,137,127, 69,
- 38,155,136, 88,214, 78, 60,193,197,147,103,248,194,137,147,172, 3, 47,120,229,215,209,172, 60,192,185, 7, 31,226,223, 63,127,
- 31, 77,154, 60,182,179,140, 15,236, 27,176,229, 3,239,125,240, 44,127,158,138,178, 69,121,242, 38, 10, 63,250, 93, 95,195, 79,
-252,242,175,176,118,254, 28,151,207,159,197,101, 25, 89, 81,168, 64,185,141,196,198,211, 54,141, 78, 9, 38,195,250,150,163, 15,
-222,199,233,211,151,120,236,248, 41, 14, 44,239,229, 25,119,221,194,149,251, 15, 49,109,166,156, 61,125,140, 47,123,206,115,216,
- 87, 14,185,170,127,153,103,191,252, 85, 92, 56,191, 70,181,181, 69,152,142, 16,209,221,236,177,109,240,147,192,242, 53,215, 81,
-141,183,137,146, 81, 93,186,128,245, 43,132,173, 57, 76,185, 64, 8, 48,186,188,194,125,107,155,188, 98,121,145, 59, 69,120, 69,
-107, 40,135, 75,252,253,116, 74, 91, 44,240,248, 39,254,141,215,125,253,159,114,239, 61,239,129, 4,249,180, 19, 45,184, 33,253,
-183, 45, 82,193, 13,130,199, 80, 85, 66,127, 62, 13, 65, 86,225,250,105,197, 44,232,199,164,169,119, 58,209,139,214,138, 80,103,
-134,222, 80,200, 58, 33,154,232, 99,135, 6,237, 38, 51,189,142,136, 59, 9,170, 98, 32,223,165,196, 55, 65, 39,234, 40,202,235,
- 58, 23,201, 18, 46,230,130,168, 82, 92, 96,210, 10,193, 26,134,206, 16, 5,109, 12, 91,161,241, 80,213,144,109, 6, 36,207,158,
-146,199,209,138, 22,217,220, 9,141, 3,162, 77,139,135,116,234, 17,103,104,130,208,203,181, 80,155, 68, 61,196,132,209,185, 76,
-167,127,201,148,134,178, 78, 32, 9, 94,186,250,165,225, 63,202, 37,182, 64, 97,119,156, 45, 46, 51, 56,167, 81,150,196, 6,231,
-210,207, 97, 48,185, 37,166, 14,223,137,193,120,161, 91, 73, 63,139,219, 48, 26,130, 99, 19,158, 40, 70, 72,249, 74,250, 58,140,
- 90, 6, 77,155, 44, 95,173,204,224,116, 99,220, 46,191,124,103, 91,116,105,200,220,101,135,233,166, 79, 99,119, 38,249, 78,162,
-214, 97,143,105,225, 80, 55, 53,207,214, 53,119,102,157, 46, 88,202, 71, 76, 57, 79,182,120, 3, 97,122,137, 56,185,160,223,145,
-200, 83,233,138,162,236,240,224,106,179,216,101, 61, 74,217,219,118,183, 96, 46,157,196,166,156, 39,223,123,152,122,251,220, 46,
-235,147, 73, 77,131,155,249,139,109,226, 68,201,244,125,176, 38, 50,170, 27, 54, 54,214, 89, 93, 89,227, 25,207,127, 22,175,251,
-201, 95,163, 24, 44,164,230,194, 35,226,255,131,222,127, 55,230,106,118, 12,206,161,213,155,196,166, 52,176, 76,147, 24,197,215,
-122,120, 23,125,133,182,189,215, 4,179, 44, 71, 82, 34,155, 30,200, 50,139,227, 14,147, 85,174,187,253,153,252,237,253,143,179,
-121,249, 2,107,103, 30,227,207,223,250,135,252,235,231,238,101,117,125,155, 38, 42,199,154, 91,199,129,189, 75,220,122,227, 53,
-124,237,235,191,130,235,142, 28,161, 88,186,146,185,193, 60,189,197, 2,179,177, 78, 61, 26, 19,154, 74,197,190,163, 13,154,237,
- 41, 33,180, 20,131, 30,207,127,221,213,188,236,123,175,192, 58,253,172,234,181, 53,166, 91,219,100,189, 62,213,246,136, 54, 70,
-166,147,150,233,164, 69, 38, 21, 12, 26,236,161,107, 25, 44, 95, 75,187,117, 5, 55,191,240,245,172,157,249, 93,198,231,255, 2,
- 23, 74, 76, 16,172, 53, 44, 45,192, 59,223,126, 13, 63,242,125, 43, 92,179, 56, 96,216,203, 89,153, 92, 96,218,198, 4,193,235,
-122,109,162,164,107, 46,210, 27, 22,184, 13,125,159, 93,146, 91,204,106, 77, 7,121, 27, 33,146,178,215,141,167,138, 66, 37, 45,
- 53, 45,222, 6,234, 86,169,193,232,117,128, 80, 65,175,246,134,117,212,162,108,157, 38,101,198,180,208,142,160,136, 73,221, 48,
-219, 89, 30,146,112,219,238,146,219, 91,209,199,204,157,114,214,153,219,113,160,101, 74,253, 19,125, 87,232,101, 86,120,189,215,
- 65, 47,247, 90,248, 69,160, 40,181,136,231,153,138,132,123,185, 54,159,177, 17,250,206, 80,183,134, 97, 79, 40, 74, 75,191, 52,
-236,219,231, 24, 12,114,138,210, 18, 66,196,137,230,241,207,132,167,185, 37, 6,141, 71, 15, 62,204,146, 87,189,143,120, 47, 52,
-173, 48,173,132,108, 97,113, 15,235,155,107, 73, 93,160,208, 92, 74,232, 36, 36, 56,100, 90,175,211,196, 49, 49, 70,170, 9,212,
- 83,161,169, 83,250, 87, 38,100, 37,184,220, 80,244,161,215,235,222, 80,155,160, 12,205, 31,118, 78, 40, 10,131, 9,162,123,179,
- 35,152, 92,120,245, 87,255, 1,215,220,252,202,116, 19,237,129,205,135, 48,195, 62,114,246, 30,112,145,250,161,251, 40,143,124,
- 17,217, 53, 87,115,254,143,126,140,139,235, 57,147,108, 1,187,124,128,114,120, 24,169, 87,184,252,192,125,156,124,224, 33, 30,
- 61,126,130,127,127,248, 20, 31,254,151,119, 83, 95, 60,202,229, 83,103, 88, 63,119,129, 39, 87, 46, 49,215, 43, 57,189,181,205,
-139,197,242,194,187,174,231,143,255,233, 65,126,171,141,148,169,208,108, 9,124,219,171, 94,192, 47,254,193, 31, 16, 98,195,233,
- 71, 31,194,185,140,188, 44,145, 24,180, 51, 12,129,182,169, 84,213, 79,192, 72,198,116,227, 34,191,251,182,119,243,226, 87,124,
- 57, 63,243,238,247,176,103, 56,207,100,242, 4, 43,127,253, 65, 74, 23,249,218,103, 61,141,175,123,249, 75,120,236,201, 83,172,
-173,156,230,165, 95,245,197,156, 57,126,150, 60,107,217,191,199,177,111,120, 3,147,106, 66,219,212, 12,134, 67,178,114,158,201,
-250, 58, 89,111, 64, 89,182,244,175,191,158, 96, 74,164, 25, 35,211, 77,196, 12,152, 95, 88,224,175,222,245,199,252,248, 27,190,
-139,231, 45,207,113,201, 7,110,205, 45,255,237,138,235,248,248, 31,252, 58,242,149,175,102,223, 51,158,201,243,239,126, 51, 31,
-249,219,223, 83,111,186, 8,161,214,225, 67,178,148, 32, 25, 20, 82, 55, 81, 63,115,223, 64,147, 10,203,120,156,174,129,144, 20,
-160,162,197, 83, 34,140,167,202, 85, 21, 34, 84, 19,163,208,117,170,167,173, 87,197,103, 91, 43,124,216, 54,250, 24,115, 61, 40,
- 10,165, 92,194,236, 6,146, 29, 17,182,239,214,244,104, 18, 92,158, 89,196,105, 17, 11, 41,145,201, 58,133,233, 50, 3,197,188,
-197, 6,131,247, 90,100, 70,235, 2,251, 84, 39, 16,210, 2, 49, 31,132, 44,135,169, 23,114,235,200,156, 22,242,152, 41,250, 96,
- 19,196, 27,208,194, 76,130,239,172, 19,124,147,106, 68,166, 58,147,144,105,179,146, 37, 15,170, 14,181, 66,110, 21, 58,175,144,
- 25,117, 53,171, 55,193, 83,175, 30,199, 7, 7,251, 18,214,232,181,203,207, 10, 51, 11,226,201,141, 34, 4,186, 80, 70,179, 23,
-148,206, 48,255,193,223, 99, 83, 51,145,138,131, 23,104, 4,155,224, 89, 43, 38, 77,228,130, 88, 13,202,177, 34, 42,112,234, 2,
-156,140,106, 89,172,221, 85, 72,163,164, 45, 16,187,178,248, 5,140,117, 72, 76,187,238,125,220,105, 10, 82, 65, 19,217,153,186,
-103,163,142, 49,196,122, 29, 9,245,204,134,104,102, 31,114,178,237,237,122,110, 99, 93,202,248,239,184,240,217, 43,208,112,142,
-244,250, 76,102,241, 27,167,144,201, 42,161,222, 74, 54, 46,153, 69,132,118,250, 56,235, 84, 13,143,117, 58, 64,100,202,179, 84,
-171,107,220,241,210, 87,240, 93,111,253,161, 93,169, 93,241,127,225, 95, 54,187,204, 84,105,236,139,169,234,180, 45,226,125, 18,
- 60, 69,140, 53,132,170,194,100, 57,174,232,233,171,142, 42, 56,118,101,174,141,186,247,184,178, 84,191,181,247,216, 4, 37, 27,
-227,112,253, 66, 21,243, 97,139,133,249,130,133,219,239,226,231,126,255,237,255, 63, 22,190, 9,248, 6, 25,111,129, 84,132,203,
- 99, 98,235,177,121,193,248,242, 6, 98, 51,218, 70, 23,165, 12, 15,237,167,156,159,167, 92, 92,192, 71,207,232,194, 42, 96,168,
- 71, 35,242, 94,143,118, 58,197,139,162,114,153, 19,136, 53,121,175,100,188,185, 73,176,231,136,117,195,210,225,195,180,245,148,
-229, 67,111,102,239,225,239,225,210,189,111,212,248,109,180,216,236, 93, 10,252,225,219, 14,240,201,183, 93,201,116, 82,115,255,
-217,117,206,108,215, 20,206, 81, 7,161,103, 83,225, 9,129, 94,175,199,100,244, 4, 14,163, 62,252,116, 14,205,118, 33, 57, 29,
- 50,186,186,225,241, 76,196,224, 91,143,199, 83, 73,160,145, 72,227, 85,227,211,250, 72, 8, 66,221,166,233,217, 11, 69,174, 14,
- 30,159, 38,108, 73, 8, 99,150, 27,157,220,237,142, 19,205, 38, 26, 78,218, 29,247, 88,240, 9,193,204,244,123, 99,242,233,118,
-180,151,143, 42,114, 11,169, 70,182, 45,180,233, 92,244, 65, 41, 0,155, 94, 3,162, 19,122,102, 13,115,115, 42,126,203, 4,188,
- 19, 70, 83,161, 63, 20,150,250,150,222,208,144, 21,150, 94,223,145, 23,142, 44,183,100,121,218,237,238, 50,140, 53, 56,211, 81,
-161, 26,226,214, 38, 97, 83, 12,234, 72,154,214, 48, 30,193,214,166,144, 69, 81,149,179, 73,111,138,136, 81, 43,130, 49,216, 92,
- 39,169,213,245, 21,170,137,168,114,175, 21,218,182,155,242, 18, 26, 37,106, 17, 48,105, 33, 75,111,152,209,120,149, 35, 26, 47,
- 24,171,211,122, 89,104,254,112,219, 52, 92,127,228,229,188,252, 69,255, 59,244,175, 6,179, 87, 87,160, 62,241, 30,152, 86,152,
-253, 87, 80,159, 58,129,223,188,204,240, 75,191,147,237, 79,254, 53,241, 66,133,121,238,119,179,254,222,191,230,125,127,248, 78,
-126,242, 35,239, 64,154,243,172, 63,241, 24,199,239,185,135,203,231, 79, 49, 87, 88,158, 52,194,117,119,126, 17, 76, 87,121,228,
- 95,254,133,195, 55,222, 68,227, 35,219,211,134,113, 35,252,252,173,251,185,255,193, 39,249,141, 58,204,148,142, 39,163,240,174,
- 95,253, 9, 94,255,221,111,225,204,195,247, 99,179, 28, 87,148, 42,249,105,107,130,215,101, 35, 93,142,177, 6,161, 8, 54,214,
-188,225, 71,126,133,239,249,214,239,226, 61, 31,252, 48, 55, 93,181, 68,148, 1,139,115, 57,203, 11, 11, 56, 50,222,243,224, 9,
- 62,242,240, 35,188,238,206,167,113,203,117,123,153,142, 3,253, 50,208, 95,216, 75, 27,182,216,220, 94, 97,245,232, 57,174,127,
-230,115, 88,240, 45,217,124,142,219,179, 76, 51,222,162, 88,220, 67,181,190, 73,180,125,168,215,201,230, 15,224, 66, 69, 61,218,
-228,230, 23,191,156,191,121,242, 81, 94,114,205, 45,244,128,255,185, 57,230,233,167,206,240,188, 43,175,228,170,207, 61,200,123,
-158,125, 59,223,252,200,189,124, 40, 21,117,155,233,180,222,137,134,130,128, 43,244, 51,148, 92,139,113,219, 66,150, 11,211,198,
-208, 76,186, 65, 72,240,105,204,118, 70,152, 52, 9,149,169,192,206,235, 5, 61, 69, 24,204, 25,170, 74,163, 17, 59,245,174,247,
- 59, 16, 82,219,194,100,162, 34,177,178,103,102,130, 21,151, 58,230, 72,103,111, 50,234,209, 13, 49,249, 67, 82,231, 46,201,139,
- 42, 42, 38,201, 10,109, 38,136,250,179,155, 19, 97,113,230,231, 21,245,214, 39, 2, 44, 90,104, 99, 36, 56,139,203,133,128,138,
-244,130,232, 20,159, 59,187,139,199, 85,117,191, 41, 13,161,209, 70,206, 59,131,207,186,205,212,250, 53, 4, 16, 39, 24,137, 4,
- 23, 53,180, 35,109,148, 83,102,209,166, 53,142,130,177, 1,103,156,114,245,201, 18,216,182,130, 53, 14,201, 34,180, 6,103, 59,
- 41,174,153,153,222, 45, 38,137,221,118, 18,166, 58,222,219, 24, 81,197,173, 81,184,218, 36,222,218,118,153,221, 73, 40,215, 21,
- 96, 99,221, 83, 98,109,165, 91, 39,219,133, 24, 36, 37,150,201,236,108,229,100, 39,166,211,228, 46,237,150,186,226,107,172,234,
- 14,100,214, 52,164, 28,129,122,155, 24, 18,174,152,186, 31,109, 86, 34,146,208, 3,133,244,211,148, 29,211,166,171,174, 43,180,
-118,198,145,235,255,223,121,221,198, 52,196,182,221,161, 3,118,160, 13,141,240,141, 9,255,140, 9,250, 77,104, 66,239,105, 47,
-225,233,207,125,109,250, 61,118,212,251, 34,230, 63,103,239, 75,216, 41,236, 18, 18, 54,171,150, 29, 1, 76,111,128,241, 45, 18,
- 2,226, 3,249,160,175,127, 79, 18, 65,155,229,218, 84,164,166,200,185, 92, 97,253, 16,177,189,222, 78, 42, 89, 39,167,110,106,
- 66,219,204,172,128,161,190, 76,104,181,137,200,251,125,112,249,108,201,150, 30,226, 77,154,113, 35,190,105, 48, 8,205,164,162,
-218,222, 6, 31,112, 69, 70, 49, 55,207,242,193, 27,201,123,229, 12, 11,158,172,174, 17,124,132, 24,152,191,226, 10, 98, 12,180,
-227, 9, 69, 81, 82,111,109,145, 21, 5, 54,119,180,147, 9,153,181,140,206,157,162,222,220,192,229, 37,115, 7,247,211,214, 21,
-142, 30, 87, 60,247,125, 76,206,191,155,209,185,223, 35,196,140, 24,107,178, 44,231,198,155, 15,113,236,177,115,236, 27,246,185,
- 56,105,102,203, 78,156, 85, 1,104,153,229, 44, 46, 44,226,195, 10, 34, 41,210, 58,161,115, 62,125, 30, 70,221,152, 20, 78, 41,
-185, 42, 70,130,169,241, 81,181, 43,209, 70,154, 86,240, 49, 42, 29,152,132,188,154, 27, 47, 20,133,222, 66,105,231,150, 94, 78,
-165,162,207, 62, 33,130, 33, 9,242,250,189,100, 97,171,147, 85, 61,232, 61,109,163,138,221, 76,145,108,106, 46, 53,151,157,148,
-194, 65,211,166,159, 65,233, 73, 17,157,222,155, 70,169,170,106,170, 3, 44, 81,245, 30,253,158,165, 44, 44,101,169,168, 69,222,
-128,153,139, 44, 45,233, 57,147,151,208,212,134,162,116,106,109, 43,108,130,253,133,188,232, 50, 60,180, 33,174, 90, 79, 12, 17,
-239, 61,209, 7, 66,240, 84, 85,164,105, 35,155,219,194,100, 2,217,249,211,235,202,179,185, 20,133, 24, 59,195,190, 22,240, 68,
-107,145, 37, 72, 35,203, 80,185,125,148,153,133, 63,118, 30,121, 50, 14, 94,113, 19,189, 50,231,252,202,163,120, 2,101,161, 31,
-222,252, 96,142,107,111,124, 22,235,171,199,121,214,243,127,143, 43,246, 44, 19, 42,131, 43,247,194,228,126,252, 23, 62,137, 59,
-112, 37, 50,191,196,214, 7,254,130,254, 93,175,164,247,244, 47,231,242, 71,223,199,133,179,176,253,233,223,230,224,211,111,226,
-198,165,156, 23, 60,227, 48, 7,239,188, 11,191, 57,102,253,228, 89,154,209, 6, 11,195, 57, 30,120,114,133,215,191,226,133, 64,
-100,245,196, 41,174,186,241, 58,166,213,132, 65,174,249,103, 87, 57,195, 11,174, 88,228,229, 31, 59,199,145,125,123, 24,251,192,
-209,141, 45,158,252,212,223,177,247,224, 97,206, 30,125, 8,151,229,202, 99,250,134, 24, 34,209,171, 15,188, 43,228,221, 48, 51,
-152, 95,224,187,190,231, 71,145,225, 60,127,255, 63, 63,197,207,253,228, 15,242,151,239,248, 19,122,100,108, 95, 94, 97,109,187,
-226,170, 27,110, 98,208,179,124,230,145,135,217,211, 11,220,121,203,109,212, 4,246, 29,190,149,245,181, 13, 30,123,248, 81,174,
- 58, 48,199,158,229,125, 56, 83, 96,203, 2,223, 52,228,195,140,250, 66,205,224,160,195,149, 37,206, 22,136, 29, 96,164,198, 13,
-230, 9,213,148, 48,217, 34, 47,123, 60, 32, 13, 87, 46,238, 97,126,107,140, 17,225,241,211,103, 24,112,134,219,231,231,248,248,
- 11, 95,193,139,159,113, 35, 31,114,143,239,236,219,241,169,171,141, 59,252,180,201,244, 66,175,107,157,162,155, 58,113, 85,173,
- 22, 63,151,233,141, 50,157,234,141, 16,147,106,117, 60, 86,161, 86,145,153, 78,218,160, 95,157,242,212, 89, 97, 40, 68,109,145,
-210, 26, 26,132,194, 26,154, 86, 39,125,151, 26,128,224,181, 97,192, 26,164,133,214,106, 93,179, 34,184,196,115,251, 86, 93, 24,
- 89, 1,101, 58,246, 15, 31,180,156, 89,139, 24, 35,172,120,184,122, 20, 89,207, 45, 89, 31,100,170, 69,218,166, 3, 35, 0,158,
-142, 35,215, 6, 33, 47,204, 44,169,206, 26,125, 61, 22,213, 13,116,249,203,173, 17, 92, 38,196,220, 16, 50,143,105,244,170,247,
- 70, 69,122, 85, 38, 84,168,128,208, 98, 84,224, 22, 76,242, 98,167,176, 12,103,240, 24,172, 68,104, 2,209, 25,140, 81,206,187,
-117,202,231, 71,117,231,167,253, 3,233,144,235, 4,152,102, 39, 41,139, 46,168, 39,206,186,136,196,111, 88,157,242, 69, 84,108,
- 71,216,149,198,216,113,230, 9,146,238,172, 81,178, 43, 16,195,186,180,132, 46,238,172, 95,206,220, 44, 12,200,116,214,183, 84,
- 96,101,150,138,149,242, 40, 58,136,223, 89, 36, 54,179,162,101, 18,133,208, 37,232,118,211,184, 32,216,108,144,148,236,237,142,
-188, 59, 38, 46,213,116,162,188, 93,141,195, 44,130,208,164, 13,122, 41, 8,168,227,249, 19,253, 98, 51,221, 74,150,237,189,146,
-165, 87,255, 8, 38,207,119,144,128,255,101,208,136, 36,232,202,236,202,183, 84,202, 68,234, 70,159,219, 26,245,196, 55, 21, 38,
-207, 16,175,175, 49, 84, 13,110,216,135,214,167,215,105, 83,174,183,190, 23,116, 49,202, 33, 32, 77,163,191, 98,227,211,211, 4,
-218, 74,171, 74,148,136, 52,109, 58, 75, 35,206, 90,218,105, 5,166, 81, 8, 59, 97,198,161,241, 72,108, 84,159, 16, 2,177, 85,
-126, 57, 43,251,184, 57, 75,150,231,148,215, 47,147,245, 7,248,241, 8,155,229,140, 46, 94,160,169, 91, 6,123,246, 80,204,207,
- 35,161,165,217,158,226,202,130,106,123, 68, 62,232, 19,154, 6, 67,160,191, 48, 71, 53, 30,211, 95,232, 83, 14,123,108, 28,187,
-151,106,243, 26,246,223,114, 43,235,199,142, 82, 44, 46,209,219,247, 90,122, 7, 94,195,229, 7,222, 68,211,172, 80,150, 3,124,
-200,169,166, 13,227,198,147, 91,141,142, 45, 18, 37,151, 57,199,194,220,144,195,215,222, 64,221,110,144, 37,232,154,160, 13,159,
-147, 68,221, 97, 41,156, 90, 91,187,198,167,245, 66, 48,202,199,199,104,152,250, 72,140,208, 84,145,105,165,136, 26, 70, 27,113,
-141,179, 37,233,115,152, 41,218,179, 76, 11,116,232,202, 92,158, 10,118,178,204,182,181,106,100,156,130,107, 52,162, 52, 92, 86,
- 36,126, 61, 42,122, 23,155, 14,158, 87, 68, 46,115,250,247,182,130,232,101,214, 88,251, 6,234, 74,127,118,110, 8,101,105, 40,
-114,167,195,131, 85,103, 72,177,207,205,182,210,181, 45, 20, 61, 75,145,155,153,106, 62,119, 59,104,128,106,142, 4,223,120, 70,
-155,170,225,168,155,128, 15,129,182,137, 76, 39,194,100, 18,217, 28, 69, 46, 95,142,100,211,105,196,100,144,149,122,115,228, 9,
-247, 15,162,240, 72,219, 36, 88, 62,232, 74, 60, 9,201, 3,152, 96, 55,107, 4, 95,235,247,181, 62, 50,218, 92,101,146, 67,221,
-122, 21, 37,228,144, 25, 67,175, 63,228,170, 67,175,228,238, 47,125, 63,194, 89, 70, 31,255, 32,253,235,174, 7,223,135,139, 79,
-194,210, 33,194,218, 89,166,143,222,199,226,183,252, 95, 52, 39,254,157, 75,255,244,143,156,252,232,199,120,193,143,125, 15,151,
- 23, 39,124,250, 47,223,207,135,142, 94,228, 27,127,225,199,129,140,233,234, 10,213,180, 34, 47,122, 60,249,216, 73,222,255,224,
- 73, 78,188,247,207,160,222, 98,114,121,133, 61, 87, 29,228,204,195, 79, 48, 40, 11,206, 24,203,111,247, 29,191,246,249,227, 28,
- 3, 22, 86,215, 57, 1,108, 63,246, 9,170,170,101,107,253,146, 46, 11,104, 91, 66,208, 93,229,130,222, 76, 49, 65,129,182,131,
- 29, 17, 38,107,151,184,247,194,148, 91,110, 60, 76,225, 28, 31,254,192,223, 83,108, 54,252,205,103, 62,206,202,246, 8, 4,110,
- 59,119,158, 3, 87,236,229,251, 94,124, 59, 55,151,142,159,253,173,183,209, 78, 90, 94,253,197,207,230,214,167,223, 64,237, 43,
- 6,229,126,130,159, 66, 61,197, 79, 39,216,126, 73,172, 44,243,135, 14, 80,173,174, 83, 46,238,101, 58, 10,170,211,241, 45,113,
-186, 74, 86,244,176, 18,136, 89,201,198,201,227,156,223, 92,231, 7, 95,243,114,254,230, 31,254,133,131,133, 99, 62, 8, 31, 30,
-143, 57,186, 61,226,182,181, 1,223,112,205, 13,252,217,254,199, 73, 49,204,248, 76, 47,116, 9, 32,233,226,105,131,170,208, 61,
- 80, 77,212, 78, 81,228, 42,254,241, 94, 97,238,182,237,120,172,132, 28, 11, 84, 21, 76, 75,232,207,165,230, 47, 79, 69,211, 24,
- 77, 68,179, 32,165, 81, 56, 91,146,186, 53,128,183,134,208, 64,183,232, 73,140,138, 62,172,213,231,235, 39,154, 32, 72, 82,212,
-103, 10,207, 71,159,184, 48, 47, 92,251,188,130,207, 29,171, 24, 55,134,245, 8,219,103, 34,253, 59, 44,193, 26,165, 21,218,164,
-138,109, 85,117,238,173, 96, 82,147,146, 57, 51, 83,178,250,144,108,124, 65,146, 40, 69,223, 15, 21,238, 65,139,161, 18,117, 96,
- 20, 70, 5,127, 21,145, 41,145,137, 68,234,168, 54,193, 50, 55, 41, 3, 91,249,227, 40, 86,213,252, 33, 98,188,194,252,226, 5,
- 83,234,137, 23,136,184, 34, 65,236, 30, 92,127,158, 80, 7,172, 76,149, 67,150, 78,231, 22,113, 9, 10,235,178,179, 73,211,249,
- 78,238,175, 65,188,186, 87,204,172,222, 42, 94, 40,206, 97, 93, 42,248,187,114,172,159,146, 35,155,184, 94,146,210,182, 19,119,
-105, 83,191,195, 51,203,110,143,187,176,203, 11,206, 14, 2,144, 38,121,161,155,140,227,236, 49, 58, 37,191,117, 5,110,238, 32,
- 38,159,199,111,156, 64,226, 36,109,198, 75, 15, 29,163,234, 65,186, 8,177,110, 41, 71,202, 95, 55,236,108,120, 52, 89,182, 19,
-238,149,233, 61,186,240,165,223, 65,113,205, 29,179,233,188, 83,247,119,121,225,122,165,119, 54,184,176,227, 85, 18,159,160,172,
-134, 48,153,224,122,125,117, 2, 68, 65,188,162, 4, 82, 53, 10,134,148, 37, 12,242,153, 3,192,164,125,221,138, 38, 40,229, 33,
-109,171,239,101,136, 41, 96, 69, 55,142,197, 16,212,157,144,101,170, 59,136,186, 29,205,132, 0, 46,199, 24,139, 43,115, 92, 86,
- 18,234,169,126,222,206,226, 6,253,212,139, 69,252,180,194,149, 96, 51,139, 49, 66,185,103, 47,174,223,131, 44, 35,108,110,169,
-243,100,115,157,232,133,222,242, 2,189,165, 69,178,254, 28,147, 75, 23,212,163, 25, 12,121,145, 19,234, 6, 19, 2, 54, 43, 65,
- 34, 69,175,196,100, 25,205,100,196,100, 99, 13, 31, 44,142,192,242, 45,183, 51,221,216,192,143, 39,152,220,178,255,174,191, 97,
-124,241,221,124,254,109,239,226,210,197, 85, 30, 61,179, 70,192,144,103,142, 54,209, 19, 18,133,185, 94,143,185,193, 28,115,123,
-106,154,218, 43,159,222,245, 79, 33,233, 42,146,214,163, 75,185, 11, 65,136, 46, 16,124, 42,124, 34,180,168,157,218, 71,165,245,
- 98,212, 73,218,153,157, 1, 37,164,224,179,216,104,248,139, 73,104, 64,103,180,192,130,245, 59, 34, 56,164, 75,199,131,105, 3,
- 69,169,195, 79,219,202, 12, 9, 40,138,212, 75, 90,109,144,163,133,118, 42, 73,179, 99, 20, 21,116,170,112,151,132, 32,180,109,
-146,160, 68,221,242,102,157,195, 26,209, 69, 51,185, 54, 9, 34, 58, 64, 97, 5, 35,234,191, 23, 4,103,147,240, 82, 4,107, 21,
- 98, 15,109,100, 90,123,182,214, 61,227,198, 19,188,208,180, 17,103, 97, 52,137, 84, 85,100, 52, 82,248, 63, 11, 41, 12, 70,140,
-190,248,180,164, 74,133, 81,149,116, 34, 79, 18,141,164, 89, 4,201,139, 28, 18,167,144,103, 10,223, 54,211,200,133,213, 75,244,
- 7,122,184,229,185,193,181, 22, 50,225, 37,175,124, 39,251, 15, 60, 11,145,136,156,249, 2,205,198, 54,115,215, 62, 31,121,224,
-253,152, 27,159,198,248, 3,255,200,226,221, 47, 96,254,174, 47,225,252,175,253, 32,199, 62,254, 40,207,120,227, 87,240,130,183,
-124, 7,159,250,137,255,202, 35, 23, 90, 46, 4,225,145,211,107, 60,239, 53,175, 36,108,111,177,114,236, 81,104,167, 24,155,113,
-234,252, 37,138, 97,193,222, 67,215,225,155,138,225,158,101,154,209,101,178,172,207, 32, 47,113,219, 35, 94,121,211, 1,238, 62,
-190,194, 28,176, 10,252,234,119,127, 13,249, 96,158,209,214, 5,130, 68, 66, 83, 37, 75, 79,183,153, 43,204, 20,190,221,228, 38,
-201,235,120,234,248, 9, 76,209,103,190,183,200,245, 87, 31,192,212, 53, 31,248,194,103, 88,217, 26,205,250,255, 39, 46,172,178,
-239,210, 26, 91, 14,126,175,137,204,103,150, 26,184,249,142, 91,120,236,216, 81,174,222,191,128,115, 57,123, 14,236,165, 40,231,
- 40,134,243,244,247, 44, 83,111,111,147,103, 22, 47,142, 80,169,103,195, 20, 37,185, 53,148,123,174,102,227,248, 61,100,131, 5,
- 92, 90, 97,123,233,209,123,249,221, 15,124,148,155,126,248,187,249,227,119,190,143, 51, 43,235,220,208,207, 57, 81,181,124, 97,
- 50,225,210, 99, 39,120,195,202,126,254,250,234,203,140,125, 36, 86, 96,134,201, 11,153, 46,246,182, 78,122,167, 86, 63,103, 27,
- 96,154,146,147,156, 23, 85,190, 39,142, 61,132,157,112,133, 34, 29,194, 49,236,184,125,212, 91,222,229,198,107,182,129, 49, 42,
-136, 9,146,248,113,195,172,211,141, 2,210,168,130, 51, 6,205, 67,144, 20,188, 17,173,217,225,222,188,166, 63, 89,160,200, 21,
-146,190,246,160,227,232,147,158,104, 12,103,199,194,211,114, 67, 99, 19, 92,236,128,244,186,197,106, 94,122,110, 80,193, 80,170,
- 21, 89, 42,130, 38, 68,196, 89,221,168, 20,226,204,242,231, 18,116,239, 50,168, 48, 52,201, 21, 48, 13,194,166, 13,140,129,224,
-146, 66, 60, 53, 7, 74, 63,136, 78,230,193, 64, 43,170,242, 23, 65,252,142,130, 58,100, 65, 55, 67, 89, 33,230,170,114,207,172,
- 83, 7, 64,183, 88, 65, 34, 6,167,112,123, 18, 34,170, 47, 49, 9,226,186,132,182,108,158,108,184,151, 48,185, 4,190,210,169,
- 61,144, 60,254, 42, 5,181,166, 51,134,147, 66, 99, 84, 85,171, 30,242,164,104, 8,250, 94, 25, 31, 21,245,143,162,188,119,231,
-109,199,166,180, 72,153,193,242, 70,146, 96, 46,134,153,160, 78, 11,103,212,205,125,214,238, 20,234, 78,117,153,244, 12,210,214,
- 72,155, 82,235, 66, 80,104, 57,241,238,198,216, 89, 19, 19, 19, 60,221,137, 20, 49, 86, 21,191, 73, 68,100,173, 1,155,131, 43,
- 88,126,227,207,165,253,223,102,150, 3,222,113,248,154,160,224,159,186, 88,222,184, 20, 19,214,133,107,120,226,116,170, 80,186,
-247, 51, 21,190,201, 82,192, 79,209,219, 29,218,175,124,148,181,105, 18, 79,141,134,213,205,126,186,208,200,206,252,255, 49,132,
-116,158, 4, 76,158, 67, 93,105,230, 64, 12, 10,211, 59,135,181, 25, 89, 79, 19, 78,154,201, 22, 89,222,195,230, 57,110, 48, 68,
-218, 22, 49,130,248,128,205, 75,124, 53,193,149, 5,249,220,162,118,234,109,139,223,220,164,173,166,100, 69, 65,104, 35,217,160,
-164,232,247,201,122, 3,218,177,158, 79,177,246, 72, 12,180,117,131,137, 94, 17,166, 40,248,122, 74,211,180, 52,163, 9,193,246,
-201,231, 15, 17,170, 77,157,140,215, 55,200,135,125,154,237, 49,229,112, 64, 51, 30, 49, 56,240,122, 94,248,163, 95,193,187,127,
-238, 45,124,234,129,227,244,246,239,155, 45, 25,113, 9, 73,233,149, 61, 14,238,187,138,229, 67,219,108, 62,105,245,172,109, 83,
- 14, 69,167,159, 48,221, 94, 4, 65, 98,130,230, 61,248, 54, 82, 37, 24, 60, 26,213,204,212,181,204,196,117, 89,102,186, 94, 46,
-105, 52,148,154,202,156, 54,187,157,127, 92,183,185, 41,210, 99,172, 78,210, 38,169,199,155, 78, 16,156, 65,147,118,136,249,105,
- 90, 14,105,181, 37, 45,114, 67, 81, 38, 5,124,208,159,173, 42,125,236,188,132,249, 57,189,214,170, 73,114,144,213,187, 32,121,
-209,166, 46, 26, 13,213, 41,186,160,171, 78, 28,235,245,189, 23,137,196,160,209,192, 38,165,184,182,141, 77, 12, 74, 36, 52,129,
- 54, 4,166, 19,161,105,130, 42,248,173, 90,134,183,183,132,233, 40,173, 76,171,235,157,123, 44,179, 59, 77,124,119,168, 85, 19,
-161,109,244, 80,239,151, 10, 33,100,185,126, 95,145,195,160,151,225, 10,181,250, 52,233,205, 14,181,118, 79,161, 53, 4, 31,249,
-150,239, 62,193,190,253,207, 36,198, 6,204,113,194,230,132, 98,113, 8,231, 62, 73,220,188, 0,151, 30,133, 56,129,173, 75,156,
-123,235, 79, 51, 58,181,194,243,127,224, 13, 44,190,241,167, 57,254,215,127,202,169,245,192,202,185,115, 92, 56,125,134,165,195,
-123,113,115,203, 76, 86,206,209,159,235,177,176,119, 63,155, 43,151,249,236, 19, 43,188,252,217,183,128, 68,170,205, 77,218,118,
-170,211, 11, 19,134,203,115,124,239, 48,231, 93, 23, 54, 82,158,190, 97,255,158, 33, 63,246,235,191,206,165,115,167, 9,193,211,
- 86, 83, 61,216,108,183, 94, 81, 33, 56,233,160,177,168, 65, 18, 49,180,132,186, 33, 26,203,246,230,134, 30,114,227,134,237,245,
- 21,206,174,235,227, 31,113,240,117,153,229,181,206,224, 36,242,233, 38, 50,200, 44, 23,125,228,101,175,124, 33,205,120,147,245,
-141,109,246, 44,205,177,176,127,145,193,220,128,114,121, 30, 99, 60,182, 95, 40, 34,217, 31, 98,138,130,122,243, 50,229,124, 73,
- 49,191, 31, 63, 89, 99,122,241, 17,250,251,175, 35, 31,238, 35,214, 99,242,249, 37, 6,123,174,100,253,212,227,252,192, 47,254,
- 42, 15, 94,188,200,167, 79, 63,202,226, 13, 65, 62,172, 12, 0, 0, 32, 0, 73, 68, 65, 84,215,242,121,129,219, 50,199,253, 34,
-124,116,180,206,183, 93, 58,192, 0,171, 80, 84,151,248, 22,180, 67, 21, 3, 77,163, 23,106,244,224,219, 29,207,112, 93,105, 39,
- 91, 79,187,125,231,162, 16, 84, 18,125,133, 0,117,155,130, 29,124,242,124,219, 29, 68,213,167,107,169,219, 99,108,108, 82,168,
- 38,126, 43, 19, 81,200, 53,161,158,161, 85,125, 7,214,224,172,166, 25, 22, 3, 24, 12,148,243, 74, 66,107, 66,136,220,245,226,
-156,249,158,197, 3,151, 34,216,147,145,254,192, 80, 46, 90, 66,110,177, 61,139, 45, 84,148,233,173, 81,238,219,130, 36,120,220,
- 38,242, 45, 26, 81, 38,220,104,248, 77,140, 66,219, 4, 90, 31,240, 68,106,137,108,167,201,124, 43, 6,214, 8,108,182,162, 69,
- 62, 38,170, 32,169,211, 99,242, 91,135,168,194, 31, 9, 66,108, 2,177, 9,216, 86,104,167,113,182,166, 82,140, 32,185,193,228,
- 16,226, 4,105, 39,152, 40, 73, 25,172, 80, 46,105, 5, 38, 81, 15, 8,131,138,243,180,230,170,160,203,149,243,184,229,171, 83,
- 49,211,201,210,206, 44,103,187, 54,157,205, 50,235,101, 38, 57,158, 65,243,221,198,198,238,243, 16,147,158, 37, 5,163,116,161,
- 52, 33, 50, 51, 70, 38, 94,218,216, 4,151,239,218,214, 96,173, 78,164,177,245, 59, 30,235,110, 87,125,108,241, 27, 39,105, 55,
- 79,164,137,220, 37, 10, 96, 39, 80,102,103, 97,159, 75,121,252, 70, 41, 1,179, 51, 26, 75, 34, 58,197, 56,204,112,145,125,111,
-250,239,152,172,252,207, 91,224,140, 81,232, 38, 76,119, 40,135,212,236,236, 80, 17,138,157, 74, 53,217,181, 87,200, 96,242, 28,
- 83, 20,152,188, 80,213,104,247, 11, 11, 80, 79,192,183, 72,219,236, 74,207, 75, 66, 59,163,209,191,106,153,236, 38,243, 28,155,
- 59, 92,174,118, 55, 87,228,250,167,215,195, 21, 61,178, 34, 35, 27,148, 90,208,167, 19,242,225, 28,249,158, 37,220,194, 18, 56,
-135,160, 73,122, 18, 90, 32,144, 15, 23,200,231,247,232,175, 51, 30,225,199, 99,124, 53,193, 90, 75, 91,215,152, 76,233, 26, 91,
-228, 90, 52,188,167,218,220, 82,126,190,141,186,168,200, 56,117, 9, 20, 25,211,241,132,118, 60, 98, 58,154,210, 54, 21,205,230,
- 10,100, 37,245,246, 22,163,139, 43, 84, 27, 91,184, 94, 70,187, 61, 82, 43, 95,219, 96, 92,206, 55,252,210, 31,241,254,123, 63,
-203,217, 11,171,108, 77,107,122,101, 65,140, 66,175,232,177, 60, 55,207,141, 71,142,112,242,228,111,226,125, 76, 58, 23,161,174,
-132,105,173,133, 90,247, 67,105,100,109,167,161,137,181, 16,188, 66,244,222,107,144, 85, 12, 16,155, 36,164, 11, 66,227,181, 56,
-234,144,169,245, 39,250,164,237, 73,103, 83,136, 9,237,235,166,249,164, 94,199,164, 44,136, 92,185,119,147,205,216, 39, 13,217,
- 74,103, 92, 91,119, 60,250, 14, 18,102, 50, 69, 27,178, 28,134,125, 67,175, 48, 44, 12, 45, 75, 75,134,193, 64,135,194,122,154,
-132,116, 77, 84, 20,210, 40, 12,223, 17,254,209, 11,117, 29, 25,143, 34,211, 58,224,219,180, 54,219,123,170,218,227,219, 72, 12,
-129,182, 81,238, 28, 34, 77,163, 63, 83,183, 48,158, 68, 38,211, 72, 83,193,180,214,166, 7, 59,235,115,119, 18,114,186, 67,215,
-102,202,177,250, 86,161,245,185,133, 33,183, 63,253,185, 28,186,106, 31, 36, 27,219,220,176,199,115,159,119, 7,215, 30, 90, 98,
- 56, 52,228,185, 33,182, 90, 4,166, 99,200, 40,248,254,159, 88,161,236,245, 16,217,192, 52,247, 83,127,242, 31, 57,246,151,111,
-199,111,173, 17,139,121,206,127,248,239,161, 14, 44, 62,235, 38, 78,255,213,187,121,236,157, 31,227,250,239,252, 30,122,175,254,
- 63,217,122,215,127,227,145,127, 59, 65,187,189,205,149,119,221,193, 29,175,122, 21,207,186,235, 6,192,210, 76, 38, 44, 94,117,
- 13,109, 27, 57,250,248,105, 62,125,234, 44,183, 28,222,175, 29, 60, 66,189, 61,102,241,138, 67, 64,159, 24, 45,223,115,203, 1,
-126,117,212,144, 27,184, 24,133,223,249,185, 31,226,226,209, 7,213, 6, 50, 25,165, 0,126, 45,230, 18, 3, 18, 84,136,160,127,
-215, 14, 74,154, 22, 95,215, 52,213,132,151,126,253, 55,113,219, 77,135, 25,109,174,114,126, 90, 81,236,191,146, 55,205, 13,248,
-153,185,130, 27,129,149, 24,217,194,176, 97, 96, 79,102, 56,237, 35,111,252,234,151,240,210,231, 63,147,227, 39, 79,179,127,113,
- 72,108, 3,153, 53,236,189,246, 90, 92, 97,232, 45, 93, 9, 33, 80,206,207, 43,196,101, 12,109,109,241,227, 17,227,149,147,184,
- 98, 14, 59,119, 16, 63, 89,163, 88,152, 99,238,240, 45, 52,155, 23,241,211,117,242, 94,159,102, 58, 97,243,204, 41,230,251, 67,
-222,243,224,195,156,127,244, 11,188,191, 13, 60,111,113,145,127,168, 91,222,122,121,133, 63,186,238, 43, 97, 87,161,118,187,166,
-109,100,103,154,110,130, 22,248,182,214,155,162,169,181,232,182,181, 30,206,214,105, 1, 84, 97, 92, 42,102,201,150,210, 52,146,
- 54,199, 36, 56,189, 86,158,201, 25,181,121, 89,209,102, 64, 15, 91,161,170, 52,157, 78,149,242,250,179, 77,173, 29,115, 8,201,
-239,105, 20,218,239,231,202,139,229,168,111,188,152,131,131, 87, 90,230, 10,104,157,225,145, 11, 65,169,129,158,161, 55, 48,228,
- 3, 48, 67,139,237, 27,108,143, 89,202, 85,183,125, 78, 82,242, 85, 76, 9,121, 49, 17,114, 18, 52, 4,199, 55, 26,194, 83, 25,
- 97, 20, 3, 99, 34, 91, 68, 54,162, 70,195,214,187,182,199,153,168,139,134, 44,157, 78, 44, 65,232, 81,136,109, 36, 84, 59, 7,
- 80, 59,141,132, 38,106,129,148,168,194, 69,163,106,117,135,193,120,189,142, 53,101,171, 43, 74,102,102,137, 50, 41,245,209, 25,
-155,166,248, 26,191,122,156, 48, 78,141,166, 73,220,117,194,165, 59,139,154,236,222, 62,181,123,149,169,145, 93,139, 59, 82, 49,
- 55, 59, 75,104, 76, 74,105,195,176,195,241,238,252,230,187,162,206,192,100,217,172, 40, 26,103,211,218, 78,221,198,161,145,183,
- 9, 93,112, 86,209,130,184,139, 6, 48, 59,107,149, 59, 30,155, 20, 45,219, 33, 28, 70, 80,171, 24, 70, 53, 48,214,144,237, 59,
-204,242,215,254,236,172,152,119,123,170,187, 53,159, 18, 70, 90,208,109,130, 34, 99,212,201,126, 54,165,163, 42,247,224, 19, 47,
-159, 97,172, 42,143,245,100,111,244,102,136,237, 44, 46, 87,154, 90, 95, 83,166, 1, 62,177,109,102, 33, 53,161,170, 8,211,177,
-114,233,193,235,159, 54,133,185,116,209,184, 81, 8,117, 77, 59, 25,235, 32, 50, 25,211, 86, 53,245,104,139,102, 60,194,229, 37,
-214, 88,164,245, 72, 53,198,111,173,107,188,105, 83,205,236,115, 18, 90,218,205,117,218,173,109,218,241,152,208,212, 68,177, 52,
-211,138,208, 4, 92,166, 11,138,178,254, 28,237,104, 76, 61, 30,107, 99,100, 13,190,110,176,198,224,131,199,228, 37,126, 90,107,
-163,230,122,184,225,162, 38, 68, 58, 67, 59,221, 38,250,134,106, 99,141,208,180, 52,227,154, 40,134,208,122,124,163,175,127,178,
-186,194,226,112, 31, 39,182,183,121,221, 87,188,156,199,158, 92, 97,208,235, 51, 63,156,227,250,107,143,112,224,170,147,169,135,
- 76, 13,115,173,121,235,146,226,111,197,128, 79, 75, 81,186,189,227, 33,165,194,145,201,108,235,163, 79,121, 16,190,101,166,211,
-176, 78,245, 48,157,201, 2,204, 14,170,156,156,142,157,162, 34,198,157,239, 13, 33,109,147,116, 26, 62, 19, 83, 98, 92,167, 55,
-106, 91,245,162,183, 77,202,250,104,147,203,196,232,218,218,193,208, 48,236, 65,127, 96,152,155, 55, 44, 44, 25, 22, 22, 45,101,
-207, 48,215,215,188,139, 60, 55,184,220, 98,115, 67, 81,102, 9,241,210, 83,162,242,176,185, 21,168,107, 73,195, 79,160,174, 61,
- 33, 68,218,170,165,170, 91, 66, 8,196,224, 9,109,164,174, 52,106,183,245,145, 73,165, 5,190,154, 10,147,113, 84, 81,111,151,
-143,225, 18, 4,106,173,134,119,152,212, 37, 77,182, 37,169, 86,245, 80,113,244, 24,230, 7,136,213, 49,178, 76,240,173, 97,126,
-104,232,247, 2,229,208, 99,250,157, 15, 93,223,189, 94,182,135,239,255,161,251, 48, 97, 85,111,202,141,251, 89,121,215,123, 25,
-238,159,227,134,151,190,152,242, 37, 95,198, 35,111,249, 94,174,253,170, 87,194,158,131, 60,242,243,255, 27,231,238,189,200,203,
- 62,244, 81,204,210,179,169,238,253, 3,238,253,219,127,229, 69,191,244, 59,252,209,247,255, 0,123,202, 5,254,224, 93, 31,226,
-223,142,126,128,250,252, 25,140,141,108, 94,184,200,147, 71, 31,229, 83, 15, 61,202,168,109,185,243,182, 35,248,233,136,188, 55,
-100,186,185, 77,222,159,195,152,150,103,220,118,132,183,254,246,167, 40, 83,202, 80, 3, 60,231,121,207, 99,245,194,121,242, 44,
-195,229, 69, 58,138, 83,126,177, 64, 76,197, 92, 59,108,237,162,124, 80,217,127,127, 97, 15,219,151,206,115,215,157,183,242,209,
-143,126,146, 35, 79,222, 79,252,216,152,163,192,253,192, 4,184,193, 25, 78,196, 72,175, 95,176,218, 70,190,229, 43, 94,192, 75,
-239,190,155,207,126,226, 19,152,216, 82,184,146,197,165, 69,174,184,241, 8,133, 43, 40,231, 22,177,121,137,201, 28, 33,142, 85,
- 72, 85,228, 20,195,156,106, 20,152,219,219,163, 13, 61, 98,211, 80,109,172, 19,155, 17,249,226, 85,184,193, 18,237,116,132,177,
- 27,184,222,242,108, 63,113,136,158, 43,142,220,206, 7,222,241, 86, 94,243,198, 55,243,179,203,123,248,231,205, 77,190,227,195,
-239,231,247, 95,241,229,188,249,228, 63, 40,229,218,232,133,220,229, 48, 75,218,135,219, 65,200, 29,140, 43,113,182, 72,108,150,
-123,236, 45,212, 83,109,178,219, 54, 9, 72,102, 55,150, 22,164,144, 4, 69,109, 43,184,158,153,165, 61,229, 70,139,120, 7, 99,
- 6, 15,153,211,206,188,179,155,248,169,144, 13,212,153, 97, 51,157, 80,141,232, 13,110,103, 89,204,194,115,190, 36,231,253,111,
-247, 76, 60,172, 8, 76, 30,243,244,239,200,136, 61,136, 77,202, 53,243,170,170,213,237, 67, 6,103,162,110, 79,179, 66,136,102,
- 6,155,103,201,207,218,166,220,123,159, 34, 98,125,171, 30,255, 70,132, 41,170,248,143, 14, 82,234,247, 46, 65, 91,218,136,151,
-226, 35, 5, 21, 17,198, 68,101,248, 20,162,170, 48,153, 65,140,197,244, 83,162, 90, 72,194, 56,175, 80,117,244, 22,187,123,165,
-179, 40,156, 29, 53, 22,112,215, 74, 82, 33,110, 93, 74,161, 39, 73,247,145, 84,241, 97,107,131,119,125,232, 49,190,255, 55,190,
-149,237,227, 99,194,250, 57,157, 80, 76,183,140, 65,215,186,234,155,156, 28, 0,146, 22,242,164,211, 79, 15,139,180, 18, 67, 52,
- 73,207,152,157, 32, 28, 17,193,186,157, 84, 55, 73, 57,209, 42,160,179,179, 56,217,221,203, 90, 98, 12, 56,231, 52,137,171,131,
-241,173, 69,162,217,201,134, 15,201, 56,220,165,127,152, 4,205, 23, 69, 10,233,177,136, 49,100,123,175,101,233, 53, 63,252,148,
- 61,233, 59, 95, 83,119,136,164, 34,222,169,254, 19,170,224, 39, 90,232,103, 11,114, 83, 3,145,151, 80, 87, 79,125, 60,152, 5,
- 60, 72, 85,165,197, 92, 45, 38, 10, 34, 1, 55, 24,208,172,175,171, 63, 59,203, 48,198,210,140, 54,144,144,220, 7,214,225,130,
-167,217,174,136,226,241,117, 75,240, 26, 26, 19,117,156,196,228,142,188,236, 37, 4,102, 10, 49,226,186,230,193,101,196,166,193,
- 55, 53,214, 56,166,211,203, 68, 31,112,121,142,177, 14, 95, 85, 26,186,147, 26, 36,133,109,133,114,126,145,122, 99, 77,209, 33,
-137, 88,151,225,155, 6,231, 12,190,213,165, 56,190,173,241,211,134,122,218, 18, 37,195, 82,225,138, 66,151,118,133, 64,179,189,
- 9, 2,211,205, 13,122,139,243,224,114,213, 14, 56,176,101,137, 17,139,224,185,252,248,227,252,230,219,222,205,235,223,240, 46,
- 94,253,218,111,226,245, 47,123, 9,183,221,126, 4, 99,126,155,194, 42,125, 17, 90,245, 85, 75, 48,120,148,239,110, 66, 18,206,
-122,168,219,136, 9, 66, 48, 6,211, 19, 98, 43,148,165,230, 78,100, 33,125,175,147, 46, 46, 64,151,198,164, 73,222,100,202,139,
- 59, 35, 52,109,242,194,239,218,168,106, 19,141,156, 59,104,140,106,102,186,152,134,206,183, 30,162,210,128,130, 70, 73,199, 8,
- 3, 39,248, 96,176, 94,117,103,136, 33, 26, 85,248,231, 61,221,123,210,235,165,184, 86,107,168, 26,131,117, 90,228,243,220, 80,
-230,118,230,119, 15,162,126,242,173,141, 64, 61, 17, 69, 39, 8, 12,250, 70, 81, 72,107,152, 78,116,175,130,179,205,108,219,219,
-157,207,255, 38,158, 46,142,170,110, 48,214, 81, 79,107,182, 55, 71,124,248,131,255,194,120,180,162,121, 36, 13,216,162, 48,244,
- 74,171,220, 98, 18,192,153,228, 70,177, 14, 74,181, 95,114,121,117,147,207,253,251, 63,115,254,236, 26,133,181,244,122,134, 38,
- 86,156,124,242, 97,196,141, 89, 88, 50,204, 47, 89,134,115,150,235,174,185,147,183,252,215, 99,200,165,207, 17, 46,159,134,199,
-222,203,229,127,252, 0,143,127,250, 56,195,215,124, 7,249,129,101,214,254,244,183,105,234,150, 98,121, 47,143,255,210, 79,113,
-225,115, 39,121,217,199, 62, 13, 75,119,225, 47,254, 13, 91,199,206, 51,124,250, 23,113,255,223,189,135,187,223,252, 3,124,225,
-244, 57, 94,180,228, 40,247, 30,100,251,210,121, 12,134, 51, 71, 31,225,228,241,227,172, 85, 21,181, 15, 92,117,237, 85,196, 54,
-224,219,134,222,160, 96,251,210, 38,203,135,246,114,205,193,189,124, 60, 29,164,222, 26,110, 63,180, 76,172, 42,252,104,155, 32,
- 26,116, 16,131,199, 55, 26,241,232,235, 6, 95,213,248,186,162,169,107,154,186,193,183, 21,109, 85, 83,206,205,243,180, 87,191,
-129,249,225, 18,119,255,251,191,242,173,235,231, 57, 61,157,240,158, 20, 18,210, 0, 79,203, 12,143,164, 60,225,181, 73,195,139,
-111,189,158,175,251,234, 47,227,201, 19,167, 56,117,246, 60,165,115, 92,119,248, 10, 14, 92,123, 3,139, 7,247,177,112,211, 17,
-202,125,251,177,101,142,205, 74, 98, 61,157,165, 81,185, 34,199, 56, 24, 93,218,160,186,124, 17,169, 71, 44,221,252, 28, 92,127,
- 63, 25, 99,242,193, 34, 46, 43,105,182,183, 8,211,117,220,112, 64,181,118,153, 88, 55,255, 31, 89,111, 30,111,249, 85,150,249,
-126,215, 90,191, 97, 15,103,159,177,230, 49,149,169,146, 0, 73,128, 4, 8, 1, 2, 36, 32,162, 68, 16,101,144,182,113,164, 5,
-135,110,212, 30,108,187,111, 59,227,112,181,239,245,210, 40,173, 92, 80, 27, 69,188,128,104,163,128,128, 64, 66, 0,153, 50, 15,
-149,154,135, 83,167,234,204,103, 15,191,105, 13,247,143,119,237,125, 10,229,243,201, 39, 64, 42,167,234,236,179,127,123,173,247,
-121,159,231,251,208, 52, 13,175,126,243,143,114, 96,182,203,199, 54,214,185,228, 61, 51, 38,225,167, 62,253, 73,238,216,127, 43,
-170,150,193, 67, 59,201,106, 78,210, 59, 62,154, 72,148,200, 78,130,129, 85,223, 22, 81,243, 49,242, 48,222,167,215,149, 72,246,
- 33,114,152,235, 10,106, 27, 40, 10,145,201,148,138,185,241,228,138, 30,111,189,157,170, 10, 99,169, 44,126,254,122, 59,174,241,
-213, 34,111, 27,161,174, 37, 29, 29, 85,210, 72,149, 82,242,240, 92,115,196,160, 77, 96, 4, 28, 63, 47, 24, 59,221, 9,146,117,
- 79,164,148,200, 71, 87,245,184, 76, 36,213,106, 98,248, 36,126,184, 88,182,139, 70,188, 21,160,203,176,240,140,106, 79,237, 3,
- 5,129, 50,145,172,169, 27,131, 82,196,211, 69, 74, 60,228,213,248,128,143,133, 36, 99,217, 48, 81,232, 41,141,201,140, 56,211,
-157,252, 90, 21, 20,198,199, 8,140, 23,208, 74,162,141,176, 28,226, 46,118, 59,239,237,227,144, 60,158, 66,153,236,177,181,102,
- 27,171, 21,127,239, 83,167, 47,243,248,200,243,246, 55,190,159,221,247,190,132,160, 35,191, 50,184,168, 58, 71, 99,155, 10,223,
- 86, 75,169,148,150, 29,121,216,182,201,133, 32,151, 5,226,190,124, 60,142,203,197,207,203, 1, 61, 38,194,133,201,237, 46,210,
- 85,199, 14,230, 16, 13,110, 26,111, 61, 42, 25, 79,255,105,140,152, 77,192,218,209,132, 23, 51,242,217, 20,202,100,130,150,213,
-106,178,183, 54,115, 7, 38, 7,186,250, 54, 42,157, 34,132, 50,202, 28, 70,154, 54, 84, 18, 61,217, 89, 84, 23,106, 72, 90,114,
-216,199,198, 48, 97, 3,103,114,139, 51, 10,149,104, 92,221,196,230,145,177,185,168,137,203, 96,217, 99,201, 26,199, 80,175,174,
-224,170, 18, 99,132,250,101,203, 17,174,182, 17, 20, 34,111,170, 98, 99,157,114,176, 69, 51, 28,197, 55, 88,192, 53, 13,245, 96,
- 32, 18,107, 0, 91, 85,216,186, 1,235, 80,193,225,157,195,213, 53,245,230, 6,245,160,143,171,106,234,178,192, 21, 13, 90, 41,
- 92, 93,211,140, 70,184,178, 70,167, 50,158,102, 89, 78,210,238,144,118,218,146,228, 9, 30, 95, 55, 40,101,228, 2,225, 3, 42,
- 75,241, 68, 70, 69,101,177, 62,144,228, 25,154,146, 36,207, 5, 9, 94, 59,108, 85, 83,110,109,208,191,116,129,225,197, 11,244,
- 47, 92,164, 30,141,112,206, 98, 7, 67,170, 75, 43, 52,229,144,224, 3,157,249, 89, 70, 43,151,120,254,139, 95,197,153,243,199,
-201,146, 30,215, 31,253, 52,153, 75, 72, 66, 2,181, 33,212,154, 80,169,184, 2, 84,219, 41, 28, 47,117,179, 62,210, 32,199, 57,
-178, 36,135, 52, 27,171,200, 97,194, 83, 31, 7, 34,172, 19,239, 87, 24, 67, 5, 67,192, 90,181,237, 3, 53,227,211, 92,126,236,
- 70,109, 87, 77,187,237, 71,101, 91, 9,136,180,184,177, 90, 88, 71,181,146,184,161, 25,183,192, 25, 35,251,241,118,166,232,118,
- 52, 83, 29,195, 84,207,208,155,214,204,204,106,118,238,208,180, 91, 9,237,182, 33,205, 19,180, 54, 88,175, 41,202,192,176,111,
- 25, 21,158,254, 48, 80, 87, 94,140,111,214, 81,215,142,173,141,134,245, 53,199, 86,223, 49, 24, 88,234,202, 81,214,150,213,229,
- 51,124,229,254,191,225, 99,127,249, 1,254,254,227, 31,231,236,137, 51,252,227,103,238,227, 37, 47,186, 75,134, 48, 39,166,117,
-221,203, 91, 98,183,215, 50,105, 91, 43,178,132,138, 36, 39, 21, 27,172,154,202,177,181, 54,196, 68,165, 46,213,138, 94, 79,209,
-234,136,101,127,172,142, 93,123,253,119,240,134, 31,121,128,176,241, 77,124,109, 9,205,144,203,255,240,143, 92, 56,222,231,224,
-157,183, 64,251, 8,193,180,120,226,239,190,201,158,155,175,101,227,171,247, 51,213,155,226,101,159,252, 20, 42,221,207,234,187,
-238,226,161,159,255, 63,120,236,179, 15,113,234,145, 83,124,237,115, 95,224, 35, 63,245,211,124,103,167,224,182,107,247, 67,214,
- 97,122,231, 62,234, 66,177,121,121,133, 4, 71, 89,213,120, 96,166, 55,141,141, 89,218,153,131,251,241,174,161,189, 99, 39,102,
-102,150,119,253,187,123,153,159,157, 98,213, 5,238,126,230, 53,156,123,226,113, 41, 76,168, 42,188,141,187,242,186,164, 41, 71,
- 52,213, 72,246, 73,101, 69, 83, 85, 84,131, 33,182,177,228,187,119,147,110,110,242,161, 93, 59,120,217, 13,183,243, 39, 23,150,
-121,159,135,203, 46,208, 37,240,140, 52,193, 0, 39, 60,172, 1, 87, 95,189,159, 15,189,247,183,121,251,191,126, 29, 23,206, 95,
-226,161,111,125,139,217,142,225,198,163,135,184,225,246,219,216,121,237, 53,244,174,190,129, 52,203,193, 53,248,122, 68, 48,134,
-108,170, 75, 83, 84,216,170,166, 42,234, 40,149,228,168, 68, 28,108,163, 75,103,176,141,220,170,155,141, 75,180,119,238,197, 21,
- 53,205,176,194, 36,109, 58,123,246, 80,172, 45,147,166, 41,131,181, 21,190,248,229,207,241,136,135,183,204, 76,243,201,178, 98,
-183,119,188,174,156, 17,137,120,204,214,184, 2,200, 48,169, 11, 6,242,248,121,231,162,106,216,212,146,251,244,110, 59,222,134,
-223,174, 94, 13,113,170,109,138,192,168, 63,193,100, 19,130, 18,143, 69,205, 68,246,110,236,182,236, 53,198, 59, 38,241,115, 60,
-203,174,108, 7, 85,177,202, 80,131, 17,179,201, 88,253, 85,120,124,227,184,241,133, 9,237, 84,225, 2, 92,182, 96,159,178,242,
-181,210, 64,229,197, 17, 91, 79, 92,173,146,115, 85,113,154, 13,102,251,112,146,102,209,200,237,142,107,215,166,146,181, 64,223,
-122, 6, 4, 74, 37, 85,193,186, 21,192,200,107,148,165,178, 34,208,140,235, 23,245,246, 1,172,197,145,151, 76, 25,232,165,132,
-110, 70,218, 78,208, 90, 75,105, 67,228,196,155,216,206,164, 99,173,113, 48, 26, 31, 77,104,218,232,109,172,234, 21, 57,103, 61,
-105,251, 16,166,126,136,239,127, 55,236, 19,178, 17, 71, 95,118, 39,253, 62,140,122,240,219, 47,253, 41,118,189,227,103,197, 35,
- 18,136, 74, 84,204,188,163,233,220,246,114,146,249,253,223,222, 75, 77,216,118,153, 71, 80,140,196,237,116,156,222,153,148,188,
-140, 73,113, 97,252, 67, 87,223,238,142,159, 68,208, 98,108, 84, 41,169,183, 37, 26,225,226, 94, 39,186,228,245,164,221, 13, 19,
- 39,249,177,162,230,229,215,169,206, 12,115,247,190,243,138, 67, 60, 78,213, 52, 4,202, 24, 29,136,157,152, 65, 73,156, 98, 44,
- 69, 5, 7, 42,182,217,251, 74,114, 73, 38, 19, 0,131,143,144, 25,235,176,131,129,172, 9,210, 52, 42, 6, 78,148,136,248, 61,
-106, 99,240,117, 77, 51, 28,224,157, 69, 27, 77, 83,150, 52,195, 1,245, 72, 88,240,222, 74,220,173, 25,141, 36,166,134,172,121,
-170,173, 1,213,214, 0, 91, 84,168, 36,193, 24,131,171, 27, 92, 35,183,107,231, 60,245,168,198, 22, 21,174,174,113, 69,133, 43,
- 43,108, 89, 17,108,131,119,241,159, 85, 21, 38, 49,180,102, 58, 36,173, 22,105, 39, 39,153,234,202,125,168,170,105,202, 66, 86,
-136,222,211, 20, 67,124, 93,161,148,162, 30, 22, 84,197, 8,215, 52,248,198,226,157, 80, 88, 90,221, 46, 77, 81,226, 71, 21,190,
- 28, 68,197, 73, 46, 5,163,149, 85, 58, 59,118, 98,235,134,186, 63, 32, 40, 69,213,223,100,243,196, 9, 70,151, 46, 81, 15, 7,
- 4,101,112,161,161,165,115,254,224,227,127, 66, 86, 46,209, 73,218,194,165,183,160,173, 38, 13,154, 60,209,164, 90,147,199,247,
-127, 29,149,170, 49, 60,198, 33,123,118, 19, 83, 48, 62, 38,175,136,110,117,125, 69,165,249,100,155,228,227,234, 75,122,193, 68,
-249,139,221, 10,121, 91,214,202, 74,111,123,138,198, 59,248, 43,106,208, 39,102,224,224,196,115, 4,130,169, 30,127, 46, 54, 86,
- 24,238,227,135, 93,199, 72,157,214,208,105, 43,186, 93,205,244,180,102,110, 62,101,118,198,208,202, 76,124,102, 20,182,241, 84,
- 35,199,104,232, 25, 14, 5, 28,227,199,151,222,198, 51, 42, 44,253, 45,203,230,150,103, 99,195, 49, 24, 58,170,210, 81, 23,150,
- 86,103,150,197,243, 75,212,101, 96,233,220,101,102,123,243, 44, 94,184, 44,230,186, 70,212,200,224, 3,250,186,235,111,101,207,
-194, 28, 89, 34,150, 24, 29,111, 42, 42,104,116, 16, 20,231,120, 13, 20, 44, 36, 94,209,150, 53,210,228,246, 52,158,124,246,237,
-190,157, 87,222,251, 33,124, 24, 81,159, 59, 71,117,254, 18,201,212, 28, 11,175,252, 94,124,107,154, 36,203, 81,116, 56,251,158,
-223,198,162,152, 58,120,128,133,151,191,134,221,255,238, 87, 80, 51,207,101,235,175,254, 53, 15,127,109, 64,117,240, 14,254,233,
-179,223,224,186, 35,211,252,251, 79,253, 37,191,241,119,239,103,125,179, 98,107,247, 60, 20, 35,234, 98,192,198, 37,145,224,203,
-210,137,169, 11,176, 91,235,184,186,196,214, 13, 73,154, 99, 27, 75,146,230,116,123, 45,174,185,237, 57,188,250,230,163,148,192,
-139,159,125, 3,139,103,207,202, 14,171, 24, 81, 13,134,241, 13, 94, 80, 13, 10,234, 97, 73, 85,148,212,131, 45,108,211,160,102,
-167,177,143, 62,194,215, 95,253, 3,188,247, 95,255, 91,254,124,117,192,205,192,177,218,241, 61,185, 38, 85,112,219, 76,135, 19,
-121,194, 49,160,234,182,248,205,183,126, 15,191,243,203, 63,199,234,233,179, 56, 2,223,250,242, 63, 49,219, 10, 60,231,134,107,
-184,233,121,207,102,223, 77,207, 98,225,198,103,146,228, 45, 76,187,141,202,166, 99, 91, 80, 0, 82, 66,109,169,215,214,104,101,
- 48,179,119, 7, 73,162, 72, 59, 59,168,251, 67,140,118, 36,227, 88,143,130,106,109,137,124,126, 15, 73,111, 14, 91, 12, 32, 40,
-146, 78,143,193,165, 11,116,231,230,184,234,232,173,188,237,123, 95,193,199, 55,182,152,215,176,156,102,188,239,248,147, 28,237,
-237,146, 12,243, 21, 77, 28, 46, 66,104,188, 31, 67,180,162,233, 43, 98, 98,131,151, 93,160,141, 82, 85,170,132,139,174, 67,220,
- 61,149,178,131,110,130,228,187,155, 90,136, 79,206, 69,167,231,184, 47, 36,132,137, 89, 46, 73,193,199,210, 32,111,196,241,222,
- 32, 82,185, 23,144,154,244, 73, 71,247,168,106, 71, 25,223,202,173,126,204,129,126,254, 11, 12,121, 10, 3,224,228,185,200,228,
-143, 77, 74, 46, 62,249, 54,182,211,197, 0,209,164,251, 88,212,239, 48,249,122, 90,199, 80,171,150, 74,146,178, 17,233,188, 64,
-166,117, 43,145,113,178, 68, 9, 53, 10, 69,162, 12, 36,102,187,117,204,164, 96, 4,232,146,118, 53,102, 42, 37,157,221, 73,123,
-118, 39,170,211,198,116,212,246, 58,123,204, 92,159,128, 90,197,145, 62,169,147,116,209, 24,166,148, 76,188,241, 53, 12,113,175,
-168,252,182,185, 53,184,192,223,126,238, 56,111,250,245, 71,120,240,115, 95,231, 53,119, 29, 34,177,240,247,235,176,254,193,255,
-155,108,255,117,242,181,227,164,238, 26, 79,152,210,252,210,207,255, 26,143,159, 57, 78,122,232, 22,217,247, 58,105, 13, 11,147,
- 4,155,152, 9,189,210,248,200,108, 80, 17, 22, 51,158,238,253,184,138, 77, 69, 34,221,248,122,160,181, 92, 10,198,197, 48,106,
-236,130, 87,219,255, 60,198,182,148, 78,100,183,171, 53, 42, 53, 40,157,160,149, 35, 52, 35,113,185, 27,131,202, 90,204,127,255,
- 47,253, 11, 67, 92, 8,245,246,212, 29,148, 76,232, 65, 95, 97,224,115, 87, 40, 18, 86, 14,116, 87, 67,222,149, 14,116, 39,134,
- 64, 87,143,112,101,129,206, 90,232, 86, 46, 64, 25,219,108,147,240,242, 92,166,228,170,192,213, 69, 92,121, 40, 92,213,224,189,
-195, 53, 2,138, 25, 3,197,109,105,105,202, 74, 76,147,214, 77,126,125,210,202, 49,105,130, 73, 83,188,147,169, 88, 25, 69,210,
-238,136, 19, 62, 81, 36,173, 20,188,199,121,139, 78, 19, 73, 31,132,128,201,115,210, 78, 70,123,118,134,180,211, 22,216, 77,196,
- 63, 6, 91, 99,203, 18, 87,202, 45,218, 22, 5,174, 42,113,222,161,116, 66, 57,232, 83, 87, 21,182,146,192,182,192,133, 44, 62,
-194,112,154, 81, 9,174,194,214, 21,182, 24,160,108,131,179,150,225,198, 6,231,238,255, 34,155,167,142, 51,184,112,142,193,197,
- 37,130, 49, 56,235, 25,109,108, 80,174,247,169, 7, 91,248, 70, 28,179,229,102,205,179,223,240,101, 76,147,160,109, 74,104, 52,
- 9,154,169,150, 97, 42,211,100, 74, 86, 80, 38, 34,150,199, 67,130,137,224,171, 36,147,207, 31,235,174,248,203, 10,193, 52, 82,
-111, 73,140, 52,159, 37,169,244, 79, 40, 35,215, 77,231,133,110,153,106,105, 72,243, 94, 97,155,136,138,213,178,122, 28,163,171,
-125, 84, 86,205, 36,129, 35,111,153, 52,189,226,110,105, 34, 42, 86,203, 80,210,205,132,217,174,180,124,142,180, 82,133,209,138,
-169,174, 98,102, 42, 78,232,137,196, 90,173, 13, 20,165,165, 28, 53, 12,135, 13,163,129, 12, 13,201,216, 48,108,161, 63,242, 20,
- 67,207,230,166,103,208,247,140,250,158,205, 53,199,198,134,101,115,211,225,157,166, 59,181,139,178, 12,204,206,238,196, 5, 35,
-170,134,141,119, 84,193,254,147, 24, 37, 21,145, 18,170,215,226, 50,108, 2,237, 86,143,178,168,193,149,212,181, 16,186,188,146,
-253,102, 51, 38,232,148, 65, 96, 32, 93, 67,183,179,147,123,223,252,113, 66,216,192,157,253, 2,131, 71, 30,100,254,229,247, 82,
-157, 63,137,125,226, 43,244, 47,175, 51,191,103,134,234,242, 87, 57,246,192, 5, 76,222, 37,187,229, 14, 66,177,132,154, 63, 74,
-249,197, 95,228,137, 47,109,113,121,195,211,255,232, 39,120,219,175,255, 27,102,239,125, 53, 15,253,200,155,248,223, 15, 45,243,
-177, 51, 27,124,224,231,222, 78,181,190,132,202, 90,244, 47,175,210,212, 14,163, 26,102,166, 91,176, 4,105,154, 82,141, 6,100,
-237, 46,173,222, 52,229,168, 1,163,153,222,177,147, 36,171,249,206,187,110,103,126,118,134,147,199, 79,112,245,161, 3, 12,214,
- 87,105, 59,135,201,107, 48, 34, 75,185,186,142,241,149,132,116,126,142,193,151,190,204,217,119,127,144,227,149,227, 62, 64,237,
-219,133, 94,188,204,237, 63,250, 22,166,223,255, 65, 30,168, 60, 47,186,225, 90, 62,177,120,158,123,158,113, 29,239,250,177, 31,
-164, 77,130,245,125,134,181,167, 51,151,242,228,131,143,160,221,136,219,159,127, 27, 87,223,126, 27,115, 71,174,161,189,176, 19,
-157,183,168, 71, 35,116,154, 96,178, 60,230,130, 29, 73,175,199,240,216,211,236,124,214, 13, 44, 63,117,150, 98,116,150,164, 53,
- 67,179,181, 38, 49,150,106,132,105,207,163,156,197,149, 3,124,210,166,187,243, 0, 77, 57,160, 26,246,201,123,211, 36,121, 27,
-167,193,214, 13,253,197, 11,188,247, 35,159,224,167, 94,251, 42, 62,254,241,207, 49, 21, 2,247, 45, 95,230, 87,239,185,151, 19,
-143,254, 13,185, 6, 23,205, 98, 54,230,194,205,216,213,108, 2, 76, 38,121,249, 96,108,154, 9,125, 19,111, 37,215, 30,116, 32,
-109,171,120,211,149,137,178,142,178,243, 56, 18,105,146,184,186, 29,179,223,163, 35,126,108,160, 11, 58, 78, 92, 62, 54,194,141,
- 33,114,209, 52,101, 98,132,200, 54, 50,161, 87,181, 60,172, 58,149,247,226,142,195,134,214, 55, 45, 85, 21, 56, 81,192, 53,103,
- 29,106,151, 70, 5,201,204,183,186,219,172,115,239,181, 84, 44,186,128,201,229, 66,161, 98,224,216,152,104,206, 49,146,143,183,
- 58, 76,226,118,227, 66, 7, 98,212, 74, 39,154, 12, 79,102, 20,237,222, 60,157,222, 12,211,105,139, 94,167, 7,171,139,120,183,
- 14, 9,178, 54,200, 53,173,206, 28, 33,237,224, 66,137, 15, 77,116,126,199,153,216, 74,102, 87,181, 64,213, 49,121,213, 8, 1,
- 79,155, 49,190, 85, 77,142,125,163,213, 36,138, 22, 38,192, 26,169, 66,125,225,109, 71,120,100,253, 24,239,248,228, 69, 62,252,
-218, 67,124, 50, 79,217,151, 53,188,249,231, 63,195, 63, 60,248,223,185,240,161, 99,114,104, 70,185,242,255,250,253,251,248,219,
-165, 17, 31,248,157, 47,114,250,190,215, 82,159,121, 56, 26,254, 34, 10, 86,171, 24,111, 83, 49,102,167,198,237, 64,242,130, 68,
- 0,141,138,149,169,202, 36,223,102,202, 11, 99, 72, 78,132,234,248, 24,127,147,252, 56,219,108,117, 47,113,175, 16,119, 60, 65,
- 75, 20,207,199, 94,120,185, 1, 6, 22,222,240,223,254,217,238,220, 94,113,180, 95,161,181,134,177,118, 18,182, 43,229,198, 55,
- 33, 65,137, 9, 80,134, 32,221, 11,229, 8,173, 99, 25, 75, 34,151, 10, 95, 85,242,125,155, 68, 98,137, 10, 66, 89,136, 41, 45,
- 54,179,121,231,226, 58,193, 16,170, 74, 34,132,145,251,238,109, 29,219,181,100,247, 11, 90,242,202, 89,134,181, 37,137, 78,100,
-135,110, 20, 89, 39, 39,239,117, 37,123, 95,139,204,239, 98,134, 52,233,116,101,221, 99, 12, 38, 77, 8,206,145,246,102, 32,120,
-252,152, 71,175,228, 82,228,170, 74, 46, 14,206, 98,135,210, 54,231,106,201,163,215,182, 18,101,175,106,100, 13,149,104, 70,133,
- 40, 16,198, 64, 57, 44,192, 59,188,183,184, 98, 72, 93, 88,178,222, 20,222,116, 48,137,166,216,184, 76, 93, 13, 73,179, 46,166,
-181, 73,146, 38,164,237, 54,206, 59,194,250, 58, 93,147, 80, 23,107,100,157,150, 92, 32,250,150,231,255,208,151,248,251,247,220,
-138,115, 10,167, 60, 6, 65, 53,155,120, 65, 17,229, 72,161, 18, 47,211,120,144, 73, 91, 79,252, 36, 66, 37,141,253, 57,209,106,
- 33, 0, 24,163,101,179,146,198,218,111,115, 69, 33,139,148, 10, 6, 76,182,109,228, 13, 49,161, 98, 35,159, 67,112,216, 74,152,
- 43,118,123, 61,168,227, 10,186,149,203,159,133, 88,246,148,181,228,179,168,149, 73,220, 76,123,137,206,134,184, 46, 51, 89, 66,
-150, 27, 25,128, 52,132, 90, 58,207,203, 26,138,194, 81, 22,194,131,111,181, 33, 73, 99, 76, 50,136,241,109, 88,137,171,125, 88,
-200,159,163,170,161,174, 21, 73, 2, 95,250,194,103,184,229, 57, 47,230,142,231,245, 88,190,188,201,231,254,225,179,168,160,248,
-210,253, 95, 2, 15, 85, 19, 15,245,227,199, 30, 36,224,132,100,165, 99,224,222, 43, 6,163,130,225,166,139, 31,208, 1,231, 53,
-174,145, 60,177, 67,202, 45,170, 81,160,213, 54,216,198,243,214, 55,127, 10,138,115, 40, 10,138,175,127,145,133,187,190, 19, 22,
- 14,162,142,125,153, 39, 31, 56, 73,113,169,228,236,234, 69, 14,253,224,143,177,232,115,204,200,145,230, 41, 79,255,254,251, 56,
-242, 99,154, 47,253,222, 39, 88, 58, 63,226,218,217,134,231,253,213,239,176,248,151,127,202,255,248,201,119,177,213,155,227, 84,
- 89,243,244,176,164,117,232, 0,118,216,103, 84,245,177,117,201,204,194, 60, 39,159, 94,228,204,202, 38, 11,237, 4, 92, 73,171,
-211,197, 54, 53,182, 49,152, 76, 83,244, 75,178,169,156, 44,107,177,231,153,215,242,250,235, 15,242,161,191,248, 59, 46,173,173,
-147, 77,245,168,170, 6,109,228, 80,245,182, 65,161, 72, 15,236, 39,251,214, 67,124,241,221,127,206,197,202, 49, 55,157, 49,170,
- 28,255,230,167,126,152, 63,121,247,251,201, 14,237,225,177,175,222,143,189,241, 8,111,190,237, 6,174, 61,116, 45,223,151, 84,
-236,123,206,173, 44,158, 91, 99,117,112,153, 61, 87, 95,195,233,135, 31,102,125,233, 2,161, 90,231,101,175,124, 9, 87,223,113,
- 7,211, 87, 63, 3,101,140,168, 27, 73,134,162,166, 25,246,201,103, 23, 68, 98, 43, 11, 2,138,206,222, 61, 84,155, 91,116,102,
- 59, 84, 91,144,228, 6,103, 83,146, 86, 23, 55,106, 80, 70, 14,183, 68,137,100,220,212, 67, 97, 92,175, 95,166,169, 43,166,119,
-236, 33,233,116,105,250, 91,244,246,237,167,174, 10,222,253,215,159, 68,191,244,133,124,236, 11, 95,231,205,173,140,254,195, 79,
-147,181, 98,237,245, 21,134,172,208,196,143,196,200,100,215,177, 17,205, 36,178,219, 22,185, 42, 76,118, 80, 42,141, 44,139, 56,
-205,103,177, 15,216,123,145,187,196, 77, 44,180, 36,109,226,108,165, 21,169,130,202,199,126,241, 58, 82, 63,199,208, 23,167,176,
- 73,160,147, 70, 74,148, 2,171,130, 84,160,102,224,106,133,175, 98,141,104, 16,249,206,123,207,237, 47, 50,124,230, 83,150, 38,
-192,169, 99,158,253, 59,226, 52,158, 72,221,107,240,210,249,220, 54, 98, 14,181,196, 82, 6,163, 4, 33, 27, 87, 10,214,136, 58,
-235,107, 41,172,105,188,196, 58,107, 39, 68,197, 36, 13,164, 10,118, 29,188,142,151,188,246,231, 57,120,237, 97,212,234, 34,126,
-184, 33,251,238,188,141, 73, 83,108,146,176,181,121,129, 83,223,252, 63,105, 66,160,170, 22,241,141,194, 82,145,182,164,210, 85,
- 41, 69,162,181, 72,203, 25,132, 68,190, 47, 67,116,182, 71, 62,127, 80,146,117, 39,254,221, 71,246,186,224, 92, 77, 36,189,201,
-255,183,115, 71,143,153, 84,243,252,157,158,159,254,187,179,124,224,245,215,241, 19, 31,127,154,222,188,226, 29, 47,122, 39,191,
-251,217,223,102,253,163, 31,151, 60,181,130, 87, 62,119, 15,159,248,196, 73,246,183,224, 79,126,225,183,120,253, 75,159, 33, 19,
-241,216,101, 52,238,171,140,234,193,196, 43, 31,188,192,216, 98, 10, 64, 25,164,215,221,185,109,222,251, 63, 71,171, 79, 40,255,
- 74,190, 7, 32, 4,131,158, 56,227, 19,180, 17,105,222, 68, 71,188,242, 54,114,141, 3,243,223,255, 95, 81,105,190,157, 61, 15,
-225,159, 29,232,209,149, 72,126, 69,231,151,146, 79,222, 73,103,124,132,142, 55,101,124, 0, 28, 85,127,147, 36,154, 62,130,173,
- 81, 89,142,175, 74,185,204,164, 25, 1, 43,198, 89,231, 8,182,150, 29,102, 99,177, 69, 25,179,255, 1,226,231,137,168, 94,141,
- 24,215, 76,140,226, 89, 1, 31, 36, 19,204,109, 32,201,114,146, 52,141, 49,118,143, 78, 83,153, 76,139, 2,147,166, 49,227,239,
- 38,148, 53,239, 28,105,187, 43,151,237, 36, 65, 27,131,173, 44, 58,203, 81,198,224,155, 50,254, 88, 44,174, 22,164,168, 10, 82,
- 95,109,139, 82,192, 89,155, 3, 92, 85, 97,189,103,106,186, 71, 83,138,103, 72, 57, 71, 57,170,164,178, 54,213,184, 26,134, 91,
- 5, 83, 51, 93,182,214,251, 36,173, 64,119, 58, 35,244,102,240,206,179,185,178,140,173, 10,102,174,186,138, 93, 7,175, 99,225,
-234, 35, 52,195, 62,235,231,206,147,117, 90, 36,121, 14,222, 99,171,138,245,179,235,188,234, 29, 15,243,225,247, 28,141, 85,186,
-177, 8, 9, 69, 43,141,249,115,194,132,253, 19, 33,231, 18, 43,139, 70,221,178,140,157, 35, 70,238,118, 58, 17, 70,138,214,219,
-184, 1, 29,182, 27,114,165, 57, 49,140, 59,132, 98, 1,139,184, 65,108, 52,252,198,176,131,207,245,233,210, 0, 0, 32, 0, 73,
- 68, 65, 84,180,225,197,178,166, 60,147,120,111,154, 43,122, 93,104, 79, 41,242, 92,172, 22,206, 10,235, 34,111, 43,166,114, 73,
- 7,248, 70,104,155,218, 5,186, 61, 67,167,107,196,188,151,200,239, 89, 55,129,225,192,209,196,156,124,203, 64,107,218,144,183,
- 21,137,150, 4, 76, 89,203,217,219, 12, 3,131,126,196,215, 6,168, 76,144,234,234, 68,241, 93,175,125, 9, 31,254,243,143, 80,
-141,228,242,210,196,213,195,249,211, 23,169,107,177,136, 4, 2, 73, 89, 69,242, 91, 4,202,160, 69,114, 13,193, 82, 21,226, 70,
-214, 65,246, 9,202,199,210,248, 16,205, 10,137,161, 42, 61, 63,247,142,175, 98, 47,157, 32,185,225, 86, 88,254, 22,189,215,191,
- 19,255,181,143,161,155,139,244,171, 41,206,157,223,160, 92,188,200,212,141,215,114,241, 47,223,199,243, 94,124, 53, 7,110,186,
- 1,242, 14,197,229, 45,158,252,159,239, 99,243,244, 37,246,229,138,219, 63,243, 69, 62,250,140,219,217,117,207,171, 57,107,218,
- 84,195,146,129, 74,201,128,131, 55, 62,151,102,109,145,122,109,141,222,194, 78, 46,158, 56,193,163,199, 79,208,206, 18,218, 77,
- 66,214,234,210,148, 3, 92,200,152,153,221,137,173, 3,199, 31,249, 2, 55,190,236, 59, 41,150, 23,233,206,206,145,183, 90,188,
-241, 13,247,112,234,233, 69, 78,159, 62,195,212, 84,135, 78,187,133, 78, 51,194,204, 52,187, 70, 5, 79,254,248,187, 57, 95, 52,
-220, 50, 55,197,109,135,186,252,167, 83,151,233, 3,159,126,247,251,121,245,139,159,197, 27,223,248, 50,102,247,221,192,176, 40,
-233,111, 12, 41,251,235,204, 28,185,137,147, 15, 29,163,187,208,102,231,193,253, 92, 62,123,158,213,139,103, 88,191,180,196,221,
-175,185,155, 61, 55,220,202,244,213,215,145,244,102,169, 54,214,105,237,216, 73,211, 31, 82,108,110,208,221, 53, 79,221,223, 68,
- 39, 25,245,214, 22, 73, 59, 39,201, 18,134,203, 43,228,211, 29,234,114, 64,210, 78,209,202, 71, 90, 85, 71,104,112,214, 82, 85,
- 5,169, 74,208,153, 37,105,101, 76,239, 62, 64, 83, 85,120, 13,126, 52,194, 22, 5,245, 86,159,217, 35, 87, 83, 23, 67,126,255,
-243, 15,240,192,174, 93,156, 93,217,224,229, 42, 33,205, 69,222,206, 35, 67,195,232,128, 79,162,251,217, 73,211,208,184,136,203,
-143,219,199,226, 33,153,152, 88,109, 24,163,109, 70, 65,187, 45,183,211,204,199, 1, 46, 50,213,179,108, 92,150, 34, 80, 26, 21,
-119, 83,130,130,140, 14,214, 49,180, 34,246,187,171,248,112,142, 15, 90, 31, 39,120,165, 21, 73,166, 80,133,244, 14, 36,241, 82,
-146,169,192,252, 46,205, 76, 27, 86,251,112,161, 10, 92, 95,121,138, 41, 21,121,224,210,188,228, 9, 4, 29, 80,120, 57,132,162,
-196,236,226,225,165, 77,196,222, 70,243,152,143, 49,155, 52,198,200, 82,224,246,151,253, 16,175,252,222, 31, 71, 95,120,152,102,
-115,137,230, 91,103,161,221,149, 3, 43, 56,116, 85, 16, 82, 41,242,152,239,236,102,254,117,127,193,153, 19,159,226,252,201,255,
- 69, 72, 69,190, 11, 62, 16, 50,131, 50,178, 22,208, 38,224, 18,201,213,147, 72,113,131, 28,164,219,165, 97,147,245,176, 15,177,
- 13, 76, 38,183,177, 68, 63,166,173,121,231,249,183,111,188,133,255,252,254,111,209,235,192,239,254,237,211,252,198, 27,111,230,
- 63,253,175,135, 89,202,224, 23, 95,251, 11,252,218, 95,255, 17,235, 31,125, 31,222,121,158,121,221,110,118,182, 78, 50, 8,138,
- 39,206, 91, 84,214,146, 55, 4,227,254, 92, 29, 25,235,102,155, 1,175,174, 44,103,185, 34,114,167,244, 4,250, 2,219,200,220,
-224,213,182,153,109, 12,150, 49,102,187, 98, 53, 18,229, 68, 17, 50,232,116,220,175,173, 64,137,195,123,230,158, 31, 71,119,102,
-255,217, 65, 14, 74,197, 54, 60, 21, 99, 26, 42,222, 16,199, 59, 42,154,237,165,171, 45,227, 13, 82,190,143, 96, 45,205,160,136,
- 30,184, 10,237, 61,250, 10, 58, 30, 10,124, 53,154,212,211,142, 1, 50,214, 54, 52,195,130, 16, 99,121,226, 61, 24, 95, 92,228,
- 66,166,244,248,117,113,104, 99, 72,162, 82, 48, 78,213,108,167, 6,100,100, 12, 77,141,115,141,100,199,199,187,230,162,148,250,
-107,239,208, 90,227,154, 18,229, 83,146,212,196,206,120,189,221, 85, 31, 2,182,174,101,231,110,173, 24, 84,235,154, 96,107,154,
-170,162, 41, 42,234,162, 68,107, 69,214, 50, 52,117, 33, 68, 57,239,177,141,197,123,135,247, 30,157,164, 20,195, 17, 73,158, 49,
- 26, 22, 4, 52,202,246, 49,233, 30, 60,242, 30, 48,237, 12,175, 51,178,108,142, 11,143, 61,204,250,233, 19,132,114, 64,123,207,
- 1,182,150, 46,178,112,228, 26, 76, 43,199, 57,139, 43, 71,172,157,245,188,225, 39,159,228, 79,223,125, 29,105, 38, 48, 24,117,
-197, 78,220, 24,145,178,157,247,162,156,120, 38, 84,194,170,218,110,123, 36,200, 1,172,181,218, 86, 1,199,124,244, 8, 8,204,
- 82,185, 12,140,149, 64,252,246,138,106,156, 65,143,220, 38,156,147, 36,142,142,191,206, 71, 48, 86,158, 67,214, 81,180, 59,138,
-110, 75, 62, 63,116, 8,228,153,162,215,213,194,116, 79, 21,229, 48, 48,218,144,182,203, 52,215,164, 45,185,200,121,239,105, 42,
- 79, 93,138,121, 41,139,221,234, 83, 93, 67,167,165,133, 21, 20,155, 50,141, 23,211,108, 93,201,106,179,140,107,239,224,228, 50,
-161, 85,224,194,217, 21, 90,237, 57, 6, 91,107,226, 9, 10, 2,174,145,202, 93,249, 62, 76, 10, 73, 81, 9,122, 79,167, 50, 49,
- 57, 43, 22,123,226,100,210,148,145,151, 27,155,178, 18, 45,100, 45, 49,201,122,222,241, 31, 63, 79,122,233, 17, 72,247, 17,150,
-142,161,246,220,206,229, 63,250, 73,230,239,121, 51,229,137,251, 56,247,192, 38, 11,185,226,201,194, 65, 51, 32,243, 21, 43,195,
-192,201, 15,127,142, 23,239,152,167,240,154,103, 61,239, 40,199,191,120,138, 67, 47,188,142, 79,188,236, 21,156,168,115,206,127,
-254, 1,246, 78,117,120,170, 17,248,195, 45,151, 54, 81,131,243,148,253, 62,197,214, 22, 91,253, 45,106,231, 73, 84,206,226, 86,
-193,205,251,103,105,202,130,180,213,193,110, 13,113,182, 97,184,126,153,195,207,184,153,188, 59,197, 96,169,161,179,107, 31,245,
-214, 58,249,158,221, 60,239,166, 27,121,230, 90,197,218,137,199, 56,246,244, 25, 46,158, 91,228,192, 31,125,148,143,172, 13,152,
- 55,176, 59, 55,252, 98, 89,179,126,182,226,157,183, 93,195, 61,223,255,106, 14,220,250, 2,150,143, 61,196,220,245,207, 98,115,
-109, 64, 85, 59,202,114,200,204,129,195,172, 46, 46, 98, 90,154,238,244, 14,202, 81,201,242,241,167, 72,155,134,151,190,226,133,
-236,191,229,118,166, 14, 31, 37,153,153,167, 90, 89,166,181,123, 47,213,202, 42,213, 96,200,212,174, 5,202,173, 1,157, 29, 11,
-244, 47, 46,209, 20,125,166, 15,236,143,141, 83,176,118,226, 56, 83,123,246,144,180, 51, 70, 43, 5, 73,171, 34,168, 60, 22, 64,
- 56,210,124, 22,103, 43,130,171,105, 74, 23, 15,224, 64,185,114, 9,211,233,145, 78,117,168,215, 55, 40, 55, 55, 72,123, 61,108,
- 83,241,245,203,151,185,247,192, 62,190,114,225, 20,102,110,140, 98,221, 54,180,201, 52,173, 38,229, 91, 99,138,224,120,127, 69,
-244, 94,140,119,167, 70, 9,152, 33,137, 38,148, 73, 14,212, 8,166, 53, 77, 35, 97, 78,111,155,188, 26, 63,110, 54,146,168,153,
-247,219, 53,134, 42,129,212, 51,233,231,246, 94,162, 30, 10,137,145, 36, 65, 80,176, 58,145,137,199,228,177,226,194,105,130,243,
-220,124,171,225,254, 47, 57, 86, 45,156,125,194,179,243,182, 4,221, 86, 36, 65,154,142,146,200, 19, 31,197, 41, 92,101,177, 88,
-198,130, 73,164, 29, 9, 19, 72, 81, 20,209, 60,235,141, 38,113,142, 59,238,249, 9,238,249,158, 55, 18,150,142,227, 31,255,130,
-124, 16,134,184, 20,171, 7, 34,193, 26, 37, 45,133,237,120,240, 52, 53, 6,205,225,125, 47,225,208, 51,222,202, 55, 62,243, 3,
-148,197, 50, 73, 42,101, 53, 33, 26, 79, 67,252, 80, 11,122,188,175,142,238,124, 37, 23,107,167,182,217,235,168,168,152,196, 49,
- 69,206, 65, 61, 57,116,116,112,124,228,147, 79,176,191,151, 80,244, 45,223,104,224,121,159, 63,198, 61,183, 44,240,247,143,173,
-114,223,186,227, 63,188,246,109,252,234,187,222,194,232,241,227, 56, 20,207,158,111,241,217,149,146,203,193,161,146,156,208, 52,
- 66,114, 51,250, 74,158,138, 76,206, 90, 77,154,217, 38, 25,250,176,205,171,143,187,140, 43, 38,117, 53,105,136, 83, 99,234,107,
- 60,136, 38,229, 46, 17,231,170,146,100, 12,149,141,189,228,134,224, 60,237,231,188,154,116,223,209,127, 65,110, 87,255,172, 98,
-246,219, 90,214,130,142, 19,122,172,238,243, 77, 52,227, 65,112, 66,145,243,214,226,198,220,209,104,134,243, 74,176,157, 62, 68,
-201, 41, 42, 8, 42, 74,232, 62,196,184, 43,110, 18,215, 15, 77, 13, 73,130,117, 78,154,219,140,222, 30, 7,149,198, 43,217,165,
-251, 70,246,238,184, 32, 62, 18, 87, 76,154,238,148, 50, 36,121, 75, 50,253,182,193, 58,185,240,248,166, 34,155,234, 17,172, 24,
-239,210,172, 37, 82,124,154,225,202, 34, 18, 3,165,134, 51, 77,115,138, 81, 33, 81,195, 68,190, 94, 81,213, 40,173,169,155, 70,
- 48,164,222,209,233,204,179,181,188, 66,171,219,161,238,247,197, 48,103, 45, 42, 81, 84,181,228,164,141,115, 4,101,104,154, 17,
-173, 36,101,109,105,149,206,252, 2, 89,119,134,133, 35,207,228,194, 99, 15,114,242,107,247, 97,171, 62,221,233, 89,118,223,120,
- 51,197,250, 58,221, 29,251, 81,105, 70,218,105,211, 50, 9,214, 90, 6,203,107,108, 45,101,252,224, 79, 30,227, 67,127,116, 29,
-218, 10, 45,210, 7, 37, 83,167,151,203,125, 99,161,113,242,126, 72, 76, 60,112,195,152,215, 30, 97, 79, 42, 18,146,163,169, 77,
-238,134,177,191,196,200, 75, 62,238, 42,137, 96,196, 73,116,118, 12,205,170, 43,249, 90,206, 49,137,163,134, 40, 70,101,169, 34,
-203, 36,253,149,183,199, 37, 84, 82,118,214,238,106,166, 58, 26,147, 40,178, 84,250,209,117, 15, 76,166,232,116,117,140,223,130,
- 87, 90,248,252,113,149,105,180,162,219,214,116, 59,137, 56,247,189, 39, 53,154, 38, 56,188,149,194,171,178,146,201,222, 85, 97,
-194,175, 47,134, 66,103,221,183,235, 16,251, 95,125, 13, 69, 37,164, 66, 13,252,233, 7,254, 76,158,203, 16, 34,254, 26,146,225,
-150, 44,241, 91,221, 64,226, 21, 69, 21,198,151, 88,185, 60, 58,121,184, 76,156,210, 74, 23, 72,219,144,182,224, 7,126,244,127,
-176,239,224,126, 54, 62,253, 53,124,181, 66,239,230, 27, 73,221, 38,121,190,139,100,215,126,190,254,203,159,231,234, 91, 14,177,
-120,205, 81, 70,143, 46,242,194,223,252, 37,126,229,214,215,177,235,250, 67, 60,227,232, 85,172, 28,127,154, 60,235,208,186,233,
- 89, 76, 61,103,137, 47,127,233, 81,158,238, 43, 92,221, 48, 55,211,195,245, 50,190,114,108,145,231,236,152,161, 59,157,147,237,
- 56, 64, 58,186,192,202,133,199,164,207,253,242, 34, 89,203, 48,213,202, 56,180, 48, 29,107, 99, 29, 58,213, 40,147, 97,146,148,
-164,213, 34,216,138,188, 55,207,104,125,139,116,170,203,242,241,199,217,255,204, 91,184,124,234,107,220,240,221,175, 97,223,133,
- 75, 84,131,130,206,207,255, 20,207,124,226, 4,201, 76, 78, 50, 61,203,155,106, 75,107, 97,129,193, 96,196,210,177,227,156, 59,
-241, 20,179,123,118,161,242, 28,107, 55, 81, 73, 70,103,122, 39, 43,231,207,146,181, 82,230,246,236,166, 28, 14, 88, 58,113,156,
-133,133, 54,187,111, 61,204,145, 59,239,166,117,240, 40,186,213,194, 14, 70, 56, 91, 99, 71, 91,100,243,243, 84,155,155,162, 33,
-105,216, 90,188, 72, 83,150, 12, 23, 87,233,238,152,197,228, 93,121, 32,122, 59, 40, 55, 54,233, 44,204, 98,178, 22,213, 96,141,
-180, 21, 72, 58,179, 20,163,138, 52, 53,212,253,117, 76,103, 6,109, 45, 38, 49,242, 48,229, 45, 66,204,114, 36, 83, 93,217, 79,
- 90, 71,146,229, 52,117,201, 95,156, 58,201,239, 79,237,156,236,142,148,151,134, 36,231,182,153, 36,232,109,148,107, 98,174, 88,
- 77,134,111,223, 57,137, 92, 25, 98, 64, 59, 86, 14, 26,249,159,217,248, 13, 30,165,180,128, 60, 72, 62,182,168, 69, 42,231,132,
-195, 60,102,152,140, 37,182, 36, 85, 19,160, 4, 42,238,189,188, 48,143, 67,236, 42,110,130,228, 67,147, 76, 81, 13, 3, 59,246,
- 41, 82, 3,149,131,203, 91,176, 43,139,223, 71, 84,156, 18,195,196,164, 34, 7,139,112,253, 85,144,107,125, 80, 1, 85,202, 65,
-222,210, 30,139, 71, 39,109,222,250, 31, 63,206, 44,151,112, 79,252, 19,164, 25,206,122,124, 83,196,201, 69, 30, 22,145,195, 19,
- 92, 51, 64, 85, 67, 89,181,196, 0,174,246, 53,106,180,201,109,119,253, 15, 78, 60,244,126, 86, 46,124, 82,234,196,147,152, 65,
-199,160,146, 22,215,223,249,243,212,126, 68,189,120,138,102,241, 12,195,111,125,115, 34,193,143, 93,215,202,203,109,106,242,218,
- 92,209,129,174, 18, 8, 62,225,193,197,134, 37, 7,123,115, 56,144,194,239, 94, 40,249,247,121,194,238,174,166,223,120,238, 91,
-181,252,222,111,252,127,188,243, 63,191,141,226,241,175,241,195, 47, 62,196,103, 63,124,140,229,149, 13, 76,166,104, 10,143, 78,
-146,137,180,174, 99, 46, 92, 77,250,221,245, 21,241,181, 49,240, 69, 79, 14,106, 53, 30,163, 98,138,102, 27,132,176, 29,187, 83,
- 19,117, 92,161,243, 25, 57,224, 93, 33,184, 85, 98,219,154,115,180,174,189,141,169,155, 95,142,143,113,184,111,143,174,197,184,
- 95, 24, 23,251,142,165,141,184, 91,247,110,187, 70, 85,169,152, 52,105,226,196,220, 96,155, 42,254,121,149,144,215,162, 14,235,
- 3,184,200, 2, 85, 74,163,241,248,218, 99,235,134,166, 28, 97,178,150,236,205,189, 19, 71,121,108,171, 67,107,124, 85, 16,210,
- 20,227, 77,116,250,139,212,236,106, 41,137,177,214, 10, 15, 28, 19,223,247,114, 25, 51,169,198, 86, 37,137,110, 75,171,154, 70,
- 90,219, 8,216,209, 96, 82, 58,163,131, 69,167, 61,225,194,107, 8,190,217,230, 10, 16, 68,146, 55,154,208,136, 26, 81,151,141,
-112, 24,210, 12,215, 4, 18,163, 37,103,221,202,169,171, 90,126, 44, 90,163,242,148, 4,205,104,176, 69,146, 38,226, 51,178, 13,
-105,167,203, 96, 80,162,178,134,144,228, 4,147,176,244,212,195, 4,223,144, 79,119,241, 3,135,205,166,216, 88, 60,143, 27,149,
-156,122,236,113,246, 94,115, 45,123,174, 63,202,212,158, 93, 36,105, 74,103,126, 26,215, 56,154, 17,188,249,109,199,249,224,123,
-174, 35, 4,197,104,232,240, 45, 38,211,185,119, 16, 74,185, 77,215,245,182,154, 71,172, 5,103,172,224, 53, 1, 59,254,172,106,
- 34,130, 32,139,159, 79,201,216, 29,175, 36,170, 23, 87,124,147,172,120,196, 71,123, 55,238, 87,152,244, 29,201, 68, 62, 30,100,
-198,245,169,137,162,221,150,164, 74,158, 41,242,220,144,231,129, 68, 43, 92, 18, 83, 48,109,141, 74,197,167, 98, 98, 19, 38, 90,
-209,238,106,156,149, 76,123,158, 8,114,217, 68,242, 91, 81, 53, 56,171,168,155,192, 96, 8,195, 81,116,228,199, 20,209, 56, 69,
- 89, 55,129,255,249, 63,255, 4,109,100,119,158, 68, 80,149,142, 97,144, 36,141,143,150, 6, 61, 24,200, 77,160, 46, 53,163, 81,
-160, 30, 41,170,161,196,143,196,198, 47,205, 89,120,105, 63,218,185, 71, 72, 67, 47,123,213,143,112,235, 29,111, 34,172, 29,195,
-109,110,113,246, 27, 15, 74,140,103,176,193,204,235,223,192,197,247,252, 28,189,217, 89,170,141, 11,116,253, 58,223,255,179,111,
-229,255,121,197, 15, 51,154,155,227,241,229,130, 37,223,194, 45, 92,205, 85,247,190,146,165, 47,127,131, 39,191,121,146, 77,159,
-178, 82,212,156, 24, 20, 60,188, 82,242,199, 15,157,230,109, 71,119,243,179,183,238,229, 25,251,118,224, 71, 35, 76,222, 65,249,
-148,102,107,133,189, 87, 93, 77, 43,209,204,228, 9, 47,120,198, 33, 6,253, 45, 65, 19,118,167, 8,214,146,117,102, 98,195, 18,
-152,188, 77, 49,232, 99,140,102,255,179,158,207,168, 95, 96,218, 45, 6,235,107, 20,163,146,166,217,128,164,131,106, 43,102,246,
- 31,193,168,156,129,202,185,112,122,145,162,168,112,102,138,222,252, 2,105,119, 71, 44,165,111, 24,108,141, 24,110,174,114,241,
-177, 19, 28,186,238, 0,101,229,185,124,234, 36,135, 15,239,230,250,231,191,136,107, 94,250,157,180,246, 93, 43,123, 50,147,177,
-121,246, 28, 58, 75, 73,102,246,176,246,248, 19,180,119, 46, 80,172,173, 74, 23,179,247, 12, 47,175, 49,189,111,129,203, 79, 29,
-167,220, 92,163,216, 88, 37,237,165, 20,107, 67,236, 96,157,238,142, 30,206,181,113,205,128,128, 33, 56, 69,103,215, 30,218, 11,
- 7,169,215, 46,115,249,169,135, 88, 59,119, 18,149,180,164, 66,179, 41,240,206, 98, 76, 6,105,142, 45,227,237, 93, 39,180, 84,
-202,207, 44,159, 37, 36, 81,222,201,100,101,153,102,226, 32,205,243,237, 28,104,222,138, 12,248,200,108, 55,122,108, 28,145,253,
-123, 24,163, 91,237,118,237,234,184,150,215, 24,137,167, 37,241,220,171, 27,145,156,172,133, 81,225, 9, 74,240,142, 4,113, 86,
- 71,229,149, 86, 14,157,182, 60, 40,237,232,118,199, 68,188,107, 44,140,209, 70, 28,235, 89,166,162, 39, 4, 76,170, 33,211,116,
-219,242, 48,172, 54, 72,100, 38, 17,249, 44, 49, 74,242,223, 78,204,104, 58, 64,158,233,232,118,151, 67, 66, 43, 69,146, 24, 34,
-161,150,155,159,247,131,252,204,175,124,156,153,141,135,176, 75, 23,176,214,209,244, 55,104,250,171,216,162,194, 15,251,132,152,
- 57, 38,120,194,112, 83,178,193,117,137, 27,108,224,134,171,216,205,203, 52, 75,103,113,203,103, 9,139, 79,113,205,209,215,115,
-221,115,127, 11,221,120,180, 5, 26, 5,214,113,205,181,111,199,246,251,164,170,199,212,141,175, 96,199,119,253, 59, 14,252,194,
- 31,162,210,100, 34,229,106, 37, 53,118, 99,159, 90,184,226,147, 78, 46, 41,114,248,254,192, 75,175,162,147,192,226, 8,134,241,
-112,255,227,115, 3,246,105, 67, 10, 44,100,240,231,199,134,124,254, 79, 62,132,233, 76, 51, 53,211, 99,198,192, 82, 31,216,185,
- 35,178,224, 99,188, 45,102,211,199,184, 83, 49,195,233, 8,139,245,219, 45, 50, 99,103, 83, 36,209, 4, 47,178,178, 23,119,163,
- 28,158,113,242,159, 68,220,140,200,149, 58,159,198,116, 22, 80, 38,137, 46,120,153,215,147,157,135,232,189,248, 45,219,209,185,
- 43,136,113,219,179,121, 29, 15,240, 38,122, 0,212, 54,250,117, 92, 53, 23,164, 82,203,149, 37,161, 41,113,182,194,150,101,156,
-184,197,222, 28,156,196,207,130,146,245,150, 78, 82,233, 64,247, 50, 48,160,163,201, 79,169,184, 87, 23,199,184,196, 4, 29, 42,
-145,242, 14,211,106,139, 47, 32, 32, 84,202, 88,190, 29,156, 37, 24, 81, 32, 2, 96,203,146,162, 63,144,174,245,184,138,208, 99,
-198,169,146,229,111,136,113, 63, 41,131, 73,176,229,136,164, 59,141,175, 75,180, 54,130, 14,214,137,112,234,189,167, 25, 13,164,
- 28,196, 57,156,119, 84,197, 8, 91,187, 8,252, 25,167, 12, 50,170,225, 8,111, 61, 78, 69,182,184,243,104, 99, 24, 12, 7,164,
-121,134, 49, 10,147, 27,188,171,241,117,133,233,182, 9, 73,198,197, 39, 30,101,229,244, 49,116,171, 69,107,126,129,249, 67, 87,
-177,112,248, 58,218,221, 30,197,218, 18,143, 62,244, 13, 78, 63,246, 16,107, 23,206,176,113,238, 20, 27,103,207, 64, 8,116,230,
-230,232,237,217, 67,181,181, 73,214,158,229, 95,253,228, 73, 10,159, 80, 27, 65,113, 43,179,141, 44,150, 34,169,109, 84,181,109,
-228, 98, 57,254,220,241,209,172,235, 99, 93,170,115,219,117,168,227,238, 18,233, 37,146,127,175,169, 67,252,107,220,213,190,237,
- 33, 26, 31,162, 19,117, 72,143, 43,141, 5, 36, 99,162, 66,157,154,104,148, 51,144,166, 65, 94,159, 84,250,211,179,142,162,219,
- 19,154,156,214,210,226,230,172,199, 36,134, 78, 59,165,221, 50,100,169, 38,205,140,164, 38,130, 20,160, 5, 23,168, 11,207,214,
- 86,160, 42, 34,228,202,110, 11, 79,227,203,134,183, 80, 70,140,119,154, 68,106,161, 21,212,172, 15, 33, 38, 65, 3, 85, 21,208,
-245, 80,178,124,213, 8,170,129,194,149, 10, 59,146,191,154, 38,106, 28,113, 74,218,189,123, 39,187,118,238, 97,118,110,154,215,
-188,233,183,176,253,199, 8,143,124,150,108,166, 75,119,255, 85, 44,223,255, 5,137,131,176,131,222, 85,251,112,157, 29, 44,149,
-123,185,238,237,111,228,233,207,125,129,229,149, 33,155, 94,179, 84,212, 44, 94, 94,231,232, 59,126,137,211,247,127,131,211,223,
- 60,193,165,149, 13,212,230,144,205,202,115,243,174, 89,102, 58,109,190,242,219,239,224,251,238,190,133, 71, 31, 58,201,140,171,
-112,202, 80,108,174,227, 29,204,239,221,203,226,233,147,220,112,221, 33,246,206,204,113,248,240, 62,218, 51, 61,105,204, 73, 12,
-206, 54, 12,214, 47,137,219, 41, 70,119, 58,211, 11,180,122, 61,234,122,192,218,226, 34,115,251,118,179,181,186, 33,178,249,158,
- 3, 12, 86,214,232,236, 62, 72,227, 36,243, 91,148, 5, 42,203,200,102,230,201,186, 25,214,167,108,174,109, 81, 12,134,232, 52,
- 37, 81,150,186,134,169,217, 22, 13,134,229,167, 30,229,134,231,220,192,129,103,221,204,194,245,215,144,237, 62,132,158,154,130,
- 36,163, 90, 94, 70,249,130,214,222, 35, 12,207, 60, 77,119,247, 60,253,165,139,116, 22,230, 25,174,172, 73,143,120,150,114,249,
-212, 57,252,168,100,245,233,147,108, 46,158,166,169, 70,168,182,162,218,170, 25,109,173,146,166, 26, 91,105,108,177, 76,210, 89,
- 96,253,228, 19,212, 91,203,180,230,230, 56,120,251, 75,233,204,204,179,121,225,164,100, 89,131,162,236,111, 81, 55, 53,190, 46,
- 48,121, 78, 93, 22, 40,109,240,193,209,233,205,242,170,239,253, 25,201,116,198,202, 63,157,196,195, 59,153, 48, 64,136,145,235,
-201,132, 62, 46, 79, 72, 98,125,170, 74, 4,181, 56,110,113, 51,169, 28,144, 89,174, 72,218, 10,157,171,137,103, 74,105, 97,247,
- 57, 27,235, 18, 35,253, 33,104, 53,201,185,155,100, 60,165, 11, 29, 42,207,132,202,228, 35,237,169,172, 61, 77,228,244,143,123,
-217,199,224, 21,157,200, 67,117,228,160, 60,140,125, 15,106, 61,200, 37,199,139,100,109,188,162,109, 12,218, 75,213,176,142, 93,
-238, 74, 73, 9,133, 73, 4,198, 98, 8, 60,227,142,159,230,174,187,191,151,240,212, 87,176,131, 77,108, 57,196,217, 82,192, 34,
- 85, 65,104, 10,233, 5, 40,183, 8,222, 18,219, 81, 9, 85,131, 43,135,212, 91, 43,212,171,107, 84,203,139, 56,223, 80,157, 63,
-134,187,120, 26,127,230, 17,230,167,122, 92,123,199, 31, 96,106,135,169, 29,211,179,183,224, 75, 69,240, 37, 94, 41,170,167, 31,
-160,124,236, 51,152,206, 62, 14,254,230,103,105,221,120,135, 76,227,248, 73,130, 64,212,240,232, 71, 80, 97,242,122, 66,224,232,
-161, 29, 28,157,203,216,244,112,215,188,240,196,119,165,240,224, 80,242,200,179, 26,110,154,133, 95,255,220, 69,118,222,126, 11,
-173, 78,139,110,166, 73,123,138,223,250,149, 15,202, 89, 56,238,103,143,209, 64,117,133,148, 62, 62,200, 39, 53,177, 38,146,224,
-162,236,172, 98,191,184, 50, 18, 75,187,210, 52, 55,169, 37,141, 95, 39,248,128, 43,150,177,195, 37,188,173,163, 97,206,160,210,
- 14,179,223,253,206, 43,170, 83,249, 54,115,156,236,209, 93, 36,252, 68,183,229, 21,147,252,228, 80,151,246, 14, 92,211,224,234,
- 10,103, 27,236,104, 68, 83, 21,226,182,111,106, 49,170,122, 31, 65, 57, 78,128, 45,209,240,102,109,141, 43, 43,201,144, 91,217,
-207,187,186,150, 60, 59, 74,170,112, 3, 17,233, 41, 95, 31, 45, 9, 0,193,154, 54,210,129,237, 60,182,172,112, 78,254,187,143,
- 80, 27,111,173,224, 92, 91, 29,249, 99,155,120,154, 25, 77,210,238,160, 77, 34,127,142,170, 36,157,234,226,155, 82, 26,224,226,
- 26, 65,141, 3,214,193, 99, 7, 5,222, 90,225,245, 55, 13,213,230, 16, 29, 2,202, 5,234,202,146,229, 57, 65, 67, 93, 54,241,
-107, 54,114, 40, 26, 69, 89,148, 88,103, 41,183, 6, 36, 89, 34,253,221, 74,177,177,182, 65,127,125,133,209,250, 26, 23,207,157,
- 33,239, 45, 80,141, 10,138,245, 21,234,209, 0,103, 71,108,156,126,156,181, 11, 23,217,218, 92,167, 53, 53,197,204,158,189,180,
-231,231,153, 61,116, 8,101, 12,182,174,168,182,250,232, 36,161, 30, 85,224, 19,126,226, 63, 92,164,213,157,149, 11, 57,146,166,
- 26,179, 42,136,165, 70, 62, 74,230,206,199,234,239, 56,136,140,255,185,155,168,128, 19,100, 67,140,160,137, 95,193,196, 0, 68,
-237,226,196,191,125,191,155,228,219,253,132, 91, 17, 89, 53, 99, 37, 82, 9, 92,166,213, 18,169,189,219, 17,192,154,209,219,160,
-195, 44, 19,112,149,191, 2,180, 28, 8,104,163,201,115, 67, 18, 63,191,148,150,181,141,179, 30,219,120,234,218, 83, 85,158,245,
- 45, 47, 77,145, 74,190,142,242,219, 7,251,248,153, 75, 51,152,155,155,229,245,223,251, 90,222,248,134, 31,228,222,239,122, 45,
-211,211,179, 2, 7,243,241,210, 50, 6, 39,186, 70, 83, 85,176,185, 5,131, 1, 52,141,162,169, 20,161, 84, 36, 78,145,122, 69,
- 18,196,124,211,223, 88,231,252,169,147,252,204, 47,255, 13,132, 53,154, 79,253,191,232,171,110, 98,243,159, 62, 41, 93,176,209,
-129,105,186,135, 41, 23, 79, 66,154,115,253,205, 7, 89,127,248, 97, 92, 93,243,239,239,251, 34,139, 27, 67,214,234,154,207, 63,
-116, 2,197, 20,166, 41, 57,120,221, 1,172, 54,220,191, 82,242,123,239,124, 37,126,115,147, 59,205, 22,203,159,255, 12,155,231,
-206,113,235,141,251,249,186,215,164,182,194,164, 57, 62,139,153,191, 90, 49, 55,191,139, 29, 51, 93,166,166,218,100, 83,179,148,
-163, 1, 73,146, 98,235,154,249,189, 7,169, 70, 91, 56,103, 73,242, 54,193,104,146, 86, 27,103, 29,157,118, 78,111,223, 65,134,
-203, 43, 76, 45, 28,192, 55,150,114,216,167, 42, 6,216,186,100,184,186, 70,162, 53,115, 7,175, 98,249,244, 57,242,169,105, 26,
- 11,237,110,134,173, 45, 73,106,208,173, 30,235, 23, 46,112,244,249,215,210, 63,127,129, 3, 87,237, 98,215, 53, 55,209,217,181,
-139,214,158,171,208, 89, 11, 84, 66,168,106,134, 75,151,152,127,246, 29, 44,125,249, 75,116,119,238,100,241,177, 39,232,238,156,
-193,121,133, 43, 43, 86, 78,159, 99,216, 95, 39,159,202,241, 90, 97,171,138, 80, 90, 92, 53,130,166,226,220, 19,143,208, 20, 91,
- 4, 45, 31, 76,195,229,203,120,187, 65,107,102, 7,222, 5,182, 46,156, 37,232, 4, 76, 78, 61,216,148, 10,191, 86,139, 44,239,
-162,179, 22, 1, 69, 83,148,228,237,142, 32,129,147, 4,219, 52,188,238,135,126, 89,164,170, 40,181,143, 33, 66, 4,200, 19,201,
-105,130, 76,238,201, 54, 34, 92, 46, 2,145,171,236, 98,127,177, 54,113,194,137, 3,147, 31,231, 77,195,182,201,206, 55,114,235,
-246,241, 97,156,124, 78,251,109, 85, 54, 49, 76, 32, 51,114,187,141,187,123, 45,183, 84,145, 50,253,182,177, 37,246,114,168,232,
- 67,208, 41,236,186, 46,161, 21, 91,151, 86, 47, 5, 92, 51,150, 45,229,198, 77,144,120,166, 74,228, 64,212,136,171,125,130,116,
-209,138,219, 95,246,123, 60,231,217,207,195,159,121,140,166,182, 52,195, 18,183,185,130, 27, 20,184, 66, 84, 16,223, 52,132,186,
-148,104, 84, 83,224,135,107,132,122,128, 31,173,203, 5,160,232, 99,203, 13,170,205, 21,134,143,124,133,226,242, 37,134,103, 30,
-167,185,124, 30,123,230, 81,122,186,230,224,115,127, 15,106,207,174,249,239,198,214, 37, 1,141,219,188, 68,125,236,126,234,167,
-238,163,248,236,239, 16, 46, 63,202,174, 31,249, 47,244,238,121,203,228, 18, 36,147,113, 68,176,106, 45, 50,127,162,162,194,173,
-177, 42,240,182,215, 60,139,131, 93,197, 71, 46, 85,220,212, 78,112, 30, 14,181, 96, 65,195,238, 92,148, 8,151,195,131,239,251,
- 11,118,191,252, 22,234,161, 39,247,129,191, 63, 61,100,107,121, 53,106,148,126, 66,136,155, 20,174,168,113,168, 88,111, 87,162,
-142, 75, 78, 98,102, 61,140, 49,182,225, 10, 74,221,184, 12,197, 95, 81, 52,163, 20, 42,203, 81, 8,218, 80,167, 9, 42,107,163,
- 76,194,220, 27,254,235,191,152,202,183,101,119, 27,221, 79,181,132,142,175, 36,136, 16,119, 74, 46,214, 15, 90,129,180,184, 98,
-132, 45, 70, 52,163, 82,140,103, 72, 27,163,171, 43,188,179,132,186, 17,117, 97, 92,183,218,148,248,218,226,138, 42, 78, 76, 86,
- 86, 72,241,160,111,170, 10, 91,215,232, 84, 99,178,244,138,170, 66,201,236,155, 52,145, 85, 73,144,114,168,224, 3,206, 71,215,
-124, 93,225,227, 78,203,141, 31,130,200,203, 87, 17,176,227,108, 45, 90,113,240,248,224,132,107,145,102,148, 91,253,137, 73, 12,
-109,228, 34, 20,215, 47,182,150,150,174,180,149, 83, 14, 6,212,117, 77, 8, 37,163,193, 72, 10, 67, 92, 77,177, 53,160,169,107,
-202,162,162, 41, 10,154,170,164, 26,108, 82,110, 14,229,107, 56, 79,127, 48,146,131,210,180, 72,167,218,108,172, 15, 56,123,226,
- 24, 54, 24,150,207,157,100,184,186,136, 81, 13,182,222,164,101, 2,169, 47, 24, 85, 21, 83,115,123,217,113,224, 8, 58, 73, 25,
-173,111,176,122,226, 56, 43,199,143,115,233,161,135, 56,249,153,143,177,113,234, 24,174,182,108, 45, 46,178,124,226, 56, 63,250,
-246, 39,185,238,250,123,177, 74, 38,107, 33, 69, 70,143, 23, 34, 55, 55,177,167,188,137,101, 45, 89, 22,239,106,113,125, 23,133,
- 16,154, 42,160,116, 28, 24, 98,235,160,181,210,196,214, 52, 49,240, 80,199,152,155, 17,105,125,156, 65, 87,241,239,214,201, 90,
- 79, 7, 49, 1,231, 45, 77,158,137, 4,159,166, 74,178,231,209,119,166, 9,210,117,129, 64,156,172, 11, 88, 43, 43, 15, 99, 20,
-153,145,175,129,145, 88,237,112,104, 25, 13, 27,138, 65,195,104,228,104,154, 64,183, 5,211, 83,138, 78, 75,186, 45,210, 36, 76,
-252, 43,198, 68, 22,150,133,239,184,231,229,124,245,129, 47,243,231,255,235,207,120,224,129, 7,120,233, 75, 94, 46, 9, 1, 27,
-136,188, 34,130,135, 4,167,112, 94,246, 14, 74, 41,172, 14,100, 70,145,101,122,130,145, 76,140,162,165, 19, 84, 89,115,203, 93,
-175,100,126,247, 53,156,127,247,219,217,113,244,106, 86,255,225, 19,236,124,213,171, 88,121,106,149, 19,159,254, 42, 11,175,253,
- 1,216,122,130, 29,111,252, 25,248,236, 55,249,218, 95,125,145, 67,175,126, 1,173,253,251,120,240,111, 63,134,221,216,162,233,
-118,168, 19, 8,163, 19,236,191,231,110, 62,246, 43,127,200,170,243,188,251, 93,111, 38,153, 81,156,169, 19,158,218, 80,180,251,
-203, 28, 91,222,164,212,134,155,231,102,160, 61,205,112,237, 20,213, 96,157,233,217,221,244, 55, 87,216,181,119, 39,215, 94,181,
- 7,133, 39,203,115,210,212,160,179, 14,205,214, 50,105, 43, 35,109,181, 32, 24,146, 84,147,119,218,168,164, 69,176, 57,189,107,
- 14, 83,172, 13,104, 79,247, 40, 7,235,116, 23,118, 83,142, 2,105, 18,232,206,207, 97,203,128,201, 52,107,139,103,105, 79,119,
- 88,191,124,145, 60, 77,241,180, 25,246,215, 9, 86,209, 20, 67,166,122,134,206,236, 46,102,231, 58,236,124,214, 77,212, 13,100,
-179,179,177,209,169, 69,168, 75,138,213, 21,102,174, 61,204,230,201, 19,204, 93,123,152,213,179,231, 73,117, 67,190,235, 8,231,
-239,255, 34,105,110,176, 85, 77,111, 71, 15,215,120,234,194, 50,220, 28, 82,109,173, 80,187,134,218,167,100, 89,155,102, 88, 82,
-108,109,160, 76,142,171,106, 2,107,244,215,135,164, 89,155,170,172,184,244,200, 87,153,222,123, 21,249,204, 46,202,173, 45,218,
- 89,142, 43,134, 36, 65,170, 91, 77,158, 99,109, 77,127,105, 13,141, 99,106,239, 94,140,201,184,237,206,215,243,149, 47,124, 4,
-199, 21, 25,114, 7, 73, 30, 61, 62,106, 98, 80, 70,197, 72,114, 26,129, 52,227,156, 40, 65,164,245,186, 22, 7,102,150,201,164,
- 60, 62,204, 85,116,176, 54,245,182, 76,159,197,232,138,201,133, 80,167,157,252,230,117, 9,173,116,156, 51,149, 93,121,154, 9,
- 67,193,185, 64,170, 21,141, 11, 84, 54,200,141, 89, 11, 71, 65,155,136,164, 13,129, 44,147,201, 59, 79,225,204,229,192,156, 82,
-152,212,147, 68, 86,179,119,226, 33, 48,169, 84, 61,170, 36,110, 98,227,180,249,220, 23,253, 6, 87,237,217,133, 59,245, 4,110,
- 52,164,174,170,104, 28,107, 8, 20,242, 33,221, 88, 84,171,133, 81, 38,210,214, 32,232, 20,191,177,142,171, 11,188,243, 52,155,
-155,216,193, 8,156,151,194,164, 44,199,110,100,212,155, 27,116,182,214, 81,104,166, 15, 31,197,223,242,159,169, 7,139, 52, 43,
-125,212,220, 60,118,241,105,108, 83,145,237, 62,140,173, 43,138,207,255, 33,249, 13, 47, 98,246,158,215,145,236,188,154,245, 15,
-191,139, 48,222, 73, 71,180,179, 48,221, 5, 51,139, 14, 24,165, 8,214,243,171,111,188,149,255,244,231,223,226,161,129,101, 46,
-129, 22,176,171, 45,171, 9,235, 96,103, 10,239,189,239, 44, 79,125,236, 61,108,182,226,207, 55,131,223,252,155,135,249,245, 31,
-191, 59,102,207, 67, 52,201,153,137,188, 25,198, 6,186, 43,235, 77,199,101, 39,113, 71, 29,198,184,217, 52,145, 41, 94, 93, 81,
-126,237,199,124,249, 56, 81, 71,127, 73,136, 32,238,217,239,254,183,168, 36,219,222,153, 95, 9,153, 25,219,153, 93,132,199, 4,
- 32,237,108, 79,229, 33,196, 58,175,134, 80, 75,145,138,171, 42,154, 98, 64, 61, 28,146,164, 57, 58, 49, 18, 3,171, 27,172,173,
-100, 63, 26,207, 86, 99, 82,108, 85,224,154, 90, 36,238,104,157,182, 85,137,175, 36,238, 22,108,192,186,134, 52,207, 9,181,149,
-172,146, 0, 13,208, 90,201, 69,193,104, 18, 45,187,118, 91, 85,147,239, 69,214, 73,105, 68, 37,199,213, 74,128,224,154, 9, 30,
- 87, 69, 23,125, 8, 65, 80,179,206,209, 84, 37,157, 78, 75,208,181,200,206,223,228, 25,182, 9,232, 44,195,141, 68,145, 75,218,
- 45, 70,235,235, 52,117, 77,119,174,195,230,165,101,108,211,208,106,117, 24,110,245,165, 57,204, 59,188,109,240,182,198,214, 53,
-245, 96,139, 98,171, 79, 85,215, 76,237,152,195, 7,141,117, 22,237,193, 54, 21,167,142, 61,206,198,168, 97,247,238,221, 12, 55,
- 87,152,153,217, 79, 43, 79,153,234,117, 40, 86,215,248,204, 63,126,133,222,238,125,188,252,165,119,112,244,249,207,102,110,239,
- 62,178,249, 57,116,167, 3,209,252, 8,207, 65,121,135, 74,106, 90, 7,247,128, 50,248, 0,247,124,199, 31,145,183,167,121,226,
-209, 63,149, 72,104, 34,206,120,173, 96,232, 3,174,158,244,224, 8,245, 55, 78,180,182, 17,210,175,109,182,135, 15,141,146,131,
- 86, 75, 58,102,188,246, 27, 79,251, 54, 34,168, 37,247, 30, 38,241, 56, 27,219,119,211, 24,141, 75,148,162,147,106,218,137, 38,
- 51,210,196,214,110, 25,146, 84, 38,227, 81, 25,177,216,117, 32,235,104, 18, 39,151, 42,103, 21, 73, 34,211,185,139, 43,172,166,
-244, 84, 46, 80, 14,229, 57, 74, 51, 69,187, 45,229, 68,164, 10, 61,128, 94,207, 75, 17,218, 56,125, 20,205,126, 90,139, 89, 61,
- 73, 20,203, 43,151, 80,192,229, 75,151,112, 22,202, 66,100,120,173,182, 49,182, 73,166, 52,181,147, 26, 75,145, 70,117,172, 30,
-149, 23, 39, 49,154,116, 92, 86,161, 28,111,249,185, 15,177,244,193,183,211, 12, 45,173, 61, 71,176, 35,104, 61,239,167,113,159,
-123, 11,243, 71,246,242,224,219,255, 21, 7,191,239,245, 44,124,199, 15,225, 7, 31, 65, 31,190,158,229,115,125, 54,207,158,225,
-115, 31,189,159,255,246,186,103,114,241,198, 87,242, 35,191,242,123,176,177,194,234,250,136,165,188,203,109, 7, 61, 51, 71, 15,
-240, 7, 63,253,251, 52, 83, 29,254,203,143,221,197, 7,254,224,239,200,186, 45,210, 0,231, 83, 5,137,165,169,161,211,237,210,
- 84,142, 86,150,145,166, 41, 33, 56,218,221,105,178, 86, 11,165, 53,222,214,209, 77,171,232,204,206, 50, 90, 95,101,122,239, 97,
-242, 25, 88,126,250, 73,188,114,184,114,192,214,198, 58,211,123,247,160, 76,155,186, 44,105, 79,207, 96,235,130,186,240,148,197,
-144,110,222,195, 59,168,138,154,166,232,211,238,237,167, 24, 88,138,254, 38,123,175,186,142,165,147, 27,204,204,229,236, 61,122,
- 35, 33,159, 66,117,102,104,169,128,233, 78,131,145, 29, 87,136,230, 43,211,221,193,234, 19, 15,112,245, 43,239,102,233,145, 71,
- 56,252,226,187, 25,156, 62, 77,103,126,142,106, 80,144,229,134,114,107, 36, 18,141,181, 40,223,160, 13, 92,120,242, 52,117, 83,
-177,176,119,158,162, 40,176, 77, 13, 42, 39,184,134,164,149,145, 38, 83,184,224,200, 90,179,244, 87,197, 31,160,149,103,246,224,
-245,216,202,210,212,142,164,151, 81, 14,135,180,117,138, 78,115,122,187, 23,104,134, 67,124, 85, 18,210,148,183,254,204,123,249,
-242,125, 31, 83, 33,186, 12, 0, 0, 32, 0, 73, 68, 65, 84,153,132,213, 67, 52,157,248,152, 77, 79,244,246, 13, 89,199, 29,212,
-132,132, 20, 77, 33,227,174,128,241, 33, 46,239,151,128,183, 42,170,180,106,194,153,118, 99,174,187,147, 55,244, 24, 66, 22,227,
-186, 36,185,236,188, 26, 43,187,167,196, 43,129,211, 68,163,221,152, 59,159,197, 28,185, 55, 17, 67,107,137,188,124, 69,146, 69,
-182,188, 87, 12, 43,145,210,141, 17,224, 3,185, 66,121,143, 70,163,114, 35,135,159,242, 82,234,162, 3,187, 15,188,152,171, 14,
- 92,141, 63,254, 45,108, 57,148,184,147, 29,197,178, 25,135, 15,154, 80, 15, 68,242,180, 21, 46,237,196, 46,235,145, 52, 68, 85,
- 35,108,127, 72, 83, 21, 52,253,130,102,115, 64, 57,170, 49, 54, 96, 90, 41,105, 39, 35,171,166,168,214,214,152,113,142, 78, 8,
-204, 30,185, 17,119,224, 78,182, 30,250, 85, 58,123, 15, 81, 46,157, 36,153,158,159,212,126,251,206, 14,236,234, 25,212,249,175,
- 51,117,219, 11, 25,124,225, 16,205,165,179,178,247,136,211,221,248,192, 80,241,245, 32, 4, 84,106,104, 5,248,137, 23, 31,230,
-189,247,157,225, 92, 9,207,154,146,201,167,142, 63, 43, 11,156, 45, 61,217, 20,100, 86,138,122, 20,240,116, 63,224,154, 33, 73,
-222,139, 95,119,194,126,141,252,150, 49, 41,238, 10, 98,219,196,203, 23,198,140, 95,145,161,221,118,171, 70, 8,210,141, 78, 52,
-150,133, 32, 77,110, 81,195,151,253,235,179, 95, 69,178,227,224,191,144,219,183,255,227,228, 79,222,148, 98,222,203, 58,219,124,
-208,232,120, 15,197, 0,215, 84, 82, 44,227, 44, 85,191,143, 45, 11, 1,189,100,224,154, 26, 95,121,217, 69, 7, 4, 8, 20, 57,
-248, 33,245, 52,163,161,188,151,243, 28, 69,160,169, 74,234,225, 16, 99,210, 88, 88,211,196, 38,189,248,156, 87,226, 15,144,239,
-139,216,168,214,144,180, 51, 92,211,208,212,117,100,174, 39, 49,101,225,241, 54,136,127,195, 24,172,109,100, 39, 15, 88,107,133,
- 26,169,196,128, 42,117,183, 18, 13,116,117, 51,169,135,182,213,128,150,153, 70,103, 25, 58,149, 11,146,206, 83,113,178, 59,143,
-206, 19,124, 8,216, 96,208,121, 70,222,235,177, 57, 40, 8,186,193,151,130,154, 21, 84,172,116, 91,148, 69, 1, 42, 48,216, 88,
-151,182,200,170, 32,203, 59,172, 46, 94,228,212,210, 37,208, 25,123,118,204,176,115,231, 52, 11,123,119,147,230, 57,243,121,202,
-142, 35, 7,184,253,206,119,147,204,206, 69, 71,117, 1,245, 16, 46, 15,161,221,129,246, 84, 92, 6,143, 11, 31, 70, 40,103, 33,
-107,163,243,140,208,154,226,101,175,248,125,246, 29,124, 41,127,253,209, 31, 38, 87, 26,219,120, 6,131,237,149,223, 88, 28, 74,
-140,144, 34,147, 54,152, 60, 76,176,252,227,157,250,216, 69, 47,117,172,219, 62, 30,157,202, 35,154,164,242,121,230, 35,224,102,
- 60,237,107, 45,195, 74,158, 41,178, 68, 98,108,179,115,154,118, 91, 72,149, 19,226,113,108,143, 43, 99, 83,154,247, 48,229, 3,
-117,237,105,183,132,164,216,201,212, 36,106,215,184,152,143,111,196, 36,220,237, 40,186, 29, 35, 43,206, 0,182,114,196,193, 95,
-136,121, 13,147, 38, 75, 31,132,249, 49,246, 36,237,221,179,135,165,165,139, 44, 44,236,137,208,156, 88,143, 93,111, 39, 54,205,
-179, 14,116,126,105,140,116, 50, 42,186,251,140, 38, 83, 6,131, 72,149, 45, 45,175,230, 15,254,226, 7,216,217, 89,229,248, 7,
-254, 26,125,240, 32, 59,158,255,124,178,231,124, 31, 79,255,194,157, 44,159,221,100,253,209, 83, 60,252,228,101,182, 54, 87,184,
-254,222, 55,179,241,240,167,105,210,253,124,228, 47, 63,203,115,239,189,155,187,158,183,151, 11,223, 56,206,169, 66,179,122,254,
- 12,223,125,195, 78,254,234,195,159,225,206,187,158,195,119,191,233, 78,126,253, 39,223,203,115,223,240, 93,172, 93,190,204,165,
-115, 75, 92, 90,216,205,197,229, 13, 70, 70,115,120,231, 44,223,243,246,183,241,244,253, 95, 97,126,239, 46, 22,207, 92,166,216,
- 90, 99,106,122,150,149,229,203,236,156, 51,236, 60,124,132,116,106,150, 36,107, 81, 13,135,228,221, 22,105,123,138,225,234, 6,
- 1,143,201, 12, 89,107,154,106, 88, 49,183,127, 23,253,229, 13,230, 14,236, 97,245,204, 69,108, 83, 17, 84,160, 59, 51,197,230,
-202, 38, 51,187,119, 80,143, 60,101, 57,224,210,233,147, 52,229, 6,123,174, 61, 66,146,103,116,167,122,212,253, 62,189,238, 20,
- 71, 95,248, 92,124, 50, 69,107,118, 7,224, 73,122, 11, 52,235, 43,152,222, 12,120,133, 29,246,105, 45,236, 96,180,116,145,106,
-115, 72, 61, 58,199,174,163,183,162,146,156,245, 83,103,240,174,102,180,185, 14, 42,208,153,157,163, 24,148,140,250,235,232, 52,
-101,125,105,139, 39, 30,123, 24, 99,107, 70,245,144,165,227, 23,113,186,162, 26,246, 9, 62,176,177,178, 76, 89,142, 24,108, 46,
-163, 66,139,225, 96,147,197,147, 15, 11,177, 42,155, 66,235,132,172, 59, 3, 90,211,221,177, 83,228, 79,219, 68, 96,130, 84,188,
- 6, 20, 89,158,115,230,248,131, 92,186,112, 76, 76, 30,209, 77,153,165, 99,162, 91,124,152,198,184, 68, 45, 0,134,241,129,159,
- 42, 72,178,113,108, 68,145,183,162,179, 61,102,202, 61,219,120,216, 16, 43,214, 90,121, 28,204, 34, 77, 77, 93,225,172,111,165,
- 42, 26,244, 68,238,210, 17,204,162,144,189,145,138, 13, 74, 65, 9, 23,186,170, 3, 73,186,221,238, 22,162, 19,230,228,137,192,
-104, 24,240, 5, 92,125,189,161, 51,165,201,123, 74,156,162, 68, 58, 92,158,196,245,131,236,221,243,246, 12,119,189,244, 87, 9,
- 23,142,209,172,175, 75,230,191,216,194,142, 10,130,119,114, 16,120, 71,104, 42,240,134,224,170, 72, 87,211,132,122, 68, 40, 74,
-145,120,203, 17,205,214,136,209,218, 38,229,160,166,236,215, 12,251, 53,222, 4,170,178,145, 2,161,173,130,114,109,149,180,149,
-144,230, 45,204,206, 61, 84,107,155,180,231,103,169,206, 60, 78, 58, 63,143, 78, 51,116,107, 90, 82, 29,157,121, 76,104, 80,121,
-206,212,221,255,134,254,231,254, 76,166,185,216,223,174,148,154, 56,201,213,183,103,188,216,177,208,229,252,210, 6,173,178,225,
- 72, 7,150, 74,168,227, 57, 92,198,237,135,137, 69,104, 54,186,139, 27, 7,111,122,238, 94, 76,222,217,142,174,197,203,131, 30,
-239,205,199,193,236,224,197,233, 31,145,175, 97,210,157, 62,110,146,139,174,117, 45, 61,235,147, 28,187, 22, 99, 89,208, 70,186,
-189,209, 36,179, 59,152,125,249, 91, 39,203, 81,249, 61,220,118,213, 22, 33,118,163,215, 49,235, 30,205, 29, 49,162,134, 14,132,
- 74, 14,112, 91, 22, 40, 5,213,214, 38,182,169,241, 77, 45,160, 22,192,149,163,137, 91,156, 68,203, 65,232, 45, 33,238,189,189,
-107, 98,164, 77,156,235,245,104,136,139,165,222, 98,172, 76,196, 71,225, 99, 57,142,150,182, 58, 91,203,138,108,172, 46,120,107,
- 99,135,142,149,122, 86,231,165, 99, 62, 49,177,255, 90, 97, 76, 58,121, 77,131,147, 18,151,241, 26, 37, 4, 41,156, 26,171, 50,
-206, 73, 15,122,136,106,145, 73, 51, 76,187, 37,124,249, 98,136,111,106,170,162,192, 86, 5, 77,213, 80,141,162, 81,206, 90,112,
- 53, 85, 37, 82, 62, 1,188,247, 98, 98, 12,144,207,204,144,119,218,212, 77,141, 78, 12, 58,214,220,174,173,174,240,191, 63,249,
- 5,250,181,227,166,195,123,121,246,237,183,114,237, 45, 55,115,205,190,221,236,159,235,209,155,157,198,228, 25,122, 12, 86, 79,
- 51, 98, 41,136,144, 92, 66,132, 78, 40,189,253, 35,116, 78, 62, 72, 90, 29, 81, 37,234,146, 80,151,236,216,115, 11,215,222,240,
- 26, 30,126,240,125,216,184, 47,174,170,109,116,181, 54,144,119, 20, 89,220,171,167,153, 20, 61,185, 32, 7,121,146,170,137,177,
-110,156,204,113,126,242, 22,141, 32, 26, 89,183, 5,183,173, 68,134,200,195,200, 82,145,193,123, 61,205,194, 78,205,204,140,161,
-219,137,240,110, 37, 3, 71, 8, 66,176,220,234,123,182, 54, 3,101, 37,151, 4, 23,225, 71,157,150, 70, 25, 35,106,119,116,224,
-215,165,195, 57, 72, 51, 77,167,147,144,165, 58,170, 13,158,218,130,171, 61,235,107,158,205, 13,113,193, 55,205,118,198, 94, 56,
- 26,138,165,165,139,220,241,130, 23,241,130, 23, 60,159,185,249, 93,252,195,167,255,145,254,160,144,215,105, 28,171,180,144,120,
- 47,102, 16, 99,140,192, 67, 82, 69,199,104, 82,163, 72,163,147, 53, 73, 20, 11, 59,246,112,211,157,175, 96,241,191,191,129,206,
-117,207,100,126,119, 15,175, 15,161,235,243, 12,186,207, 99,225,197,211,228, 79,126,153, 81,107,154, 79,125,234, 81,190,139,132,
-221,183,221,205,177, 95,123, 15,215, 61,251, 22, 30,253,230,227,252,216, 7,254,144, 79,127,240, 69, 92,119,231, 97,154,191,117,
-252,250,175,253, 17,199, 6,129,159,253,212,223,240,199,175,124, 21, 87,223,115, 23,223,124,248, 24,183,119, 2,239,250,198, 34,
-116,187,108,109, 21, 52, 1,126,232,229,207,133,160,201,242, 22,163,173, 1,117, 53,160,219,107, 83,214, 53,189,169,156,217,233,
- 25,242, 78, 23,239, 28,217, 84, 15,191,178, 74,112,129,209,198, 58,190, 25,210,153, 57, 72, 93,214, 88, 59, 36,201, 12, 73,187,
- 71,112, 22,147,180,169,135,155,244,186, 11, 76,205,205, 80,142, 60,155,203,171,108, 44, 95, 34, 49,255, 63, 93,239, 29,101,233,
-117,151,233, 62,123,127,233,228, 83,185, 58,231, 86,183,114,176, 36,203,114,144,131, 44, 99, 28,193, 38,216, 88, 6,204,192,128,
- 23, 44,102,102,153,176,128,203, 0,151,112, 49, 3,107, 76,158, 11,115,125, 49,120, 8,182,193,152,224, 36, 39,217,150,101, 89,
- 86,206, 45,181,212,185,114,213,137, 95,218,225,254,177,247,119,170,196,112,123,173, 94,213,221,117,186,234,212, 9,223,254,133,
-247,125, 94,183, 19,170, 69,150, 19,175,120, 53, 81,103,150,135, 63,243, 37, 78,222,122, 13,205, 43,174, 64,231, 57,241,212,172,
- 83,109,106, 77,216,110, 98,181,113, 7, 58, 18,157,246,220,184, 86, 27,242,193,144,160, 86, 35,169,199,132,237, 25,150, 31,121,
-144,114, 60, 32, 72, 66,116,105,216, 56,251, 44,251,174,185,158,241, 96, 68, 62,204, 48, 38,229,241, 71, 79, 19, 48,102,117, 35,
-103,116,113,157,115, 43,171, 28, 93,155, 97,105, 77,113,169,191, 65, 18,213,105,214, 34,246,205,207, 49, 51,247, 2,211,211, 11,
-100,217,136,116,248, 8,173,214, 20,251,175,127, 25,155, 23,207, 96, 6,238, 66,213,154,159, 33,138,155, 8, 44,209, 84,205,119,
-118, 80,150, 37, 63,242,159,254, 7, 15,254,192,222, 73,156, 97,101, 53, 22,161,111,128,194,138, 81,238,247, 80,102,155, 69,130,
-113, 35, 32, 2,183,254, 43, 50,119, 72,218, 76, 16,132,149, 34,219, 29,244, 81,232,198,194, 65,228,149,157, 98, 59, 57, 73, 38,
-174, 58,173, 40,116, 2, 40,149, 37, 12,173, 35,104, 5,146, 0,141, 13, 4,177,103,194, 43,237,175, 27,218, 1,145,240, 58,173,
-210,194,174, 26, 44,251, 93,154, 26,131,157,115, 7,183, 1,108, 36,144, 72, 55, 93, 80,206, 64, 21, 7,112,243,171,126, 25, 46,
- 60, 69,177,178, 74, 57, 30, 96,178, 20, 53,206,220,197,175,200,157,122,217, 0, 38, 71, 16,186, 43, 77,233,252,199, 46,130, 83,
- 97,242, 28,147, 41,138,222,144, 81,191, 36, 27, 21,140,122, 37,218, 56, 76,164, 54,134,233,121, 69, 49, 46,104, 77, 43,120,240,
- 33,100, 92,163,129, 97,238,245,239,164, 56,245,109,146,185, 5, 8, 19,100,210,130, 90,151,144, 24,155,116,177, 73, 27,214,207,
- 33,186,251,152,126,207, 47,179,241, 87,191,230, 14, 7,107,156,197, 44,148, 30,226,179, 99,103, 98,220,104,252, 71,239, 56,201,
-127,255,235, 7,220,218, 55,112,106, 90, 35, 33,214,174, 91, 47,128, 92,121,237,132,132,253, 13,136,218,211,254,112,222,134,196,
-136,202,115,174,156,218,123, 2,160,177,206,246,102,140,113, 97, 80,193, 54, 2,214,101,147,187,132, 61, 43, 93,250,153,155, 5,
- 86,163,120,131, 13, 34,164,132,233,183,255,236,191, 43,138,171,130, 94,172, 85, 19,133,147, 53, 6, 17,239, 24, 17,161,160, 40,
-252,120,218,169,169,243,126,143, 60, 29,185,179,197, 51, 68, 85,158,110, 71,248, 90,139,201, 75,116,158,185,215,134,209, 14, 70,
-165,156, 69, 78,105, 69, 64, 60, 97, 7, 24, 44, 90, 41, 4, 22, 85,184,113,185,115,138,132, 94, 4, 85,184,187, 39, 37, 90,149,
- 46,218,182,250, 9,132, 11,234,149,113,197,193, 55,110,202,164, 75,132, 13, 8, 43,175,147,206, 41,199, 46,114, 53, 12, 36, 97,
- 82,115,130,182,172, 32,108, 72,202,209, 8, 17,133, 36,205,182, 75,102,179, 22, 83,164,174, 88, 41,114, 84,150,250, 93,121, 78,
- 49,204,156,157,206, 24,198,195, 49, 90,185,221,153, 12, 2,226,122,205,123,237, 19,247,117,208,132, 73,136, 49,134,225,104,200,
- 84,167,205,235,110,184,129,119,190,249, 45, 68,166,132, 86, 11, 99, 21,245,233, 41,207,127,246,138,177, 9, 73,197,159,160,113,
-228, 99,106,171,220, 98,207,104, 53, 62,210,176,170,228,139,212,215,110, 62, 50,118,176,206,174,238, 33,126,230,231, 7,124,252,
- 99, 63,204,195,223,254, 24, 82, 64,173, 30, 82, 20,138, 48,114,235,182,192, 99,163,221,119,179,142,117,225,213,238,186, 66, 18,
- 40, 38,233,109,213,171, 73,238,204, 98, 23, 19, 16, 35,198,184, 6,214, 59,251,168,213,161,221,146,196,177,159, 64,102, 22,173,
-133,163,182, 5,110,127,174, 53,164, 62,199, 92,149,142, 74, 87,171, 89, 2,233,192, 50, 86, 88, 66, 4,202, 24,172,149,212, 18,
- 75, 28, 6,212, 26, 1, 82, 88, 74,165, 41,180,196, 42,195, 40,181,164, 35, 71,166, 43, 51,247, 51,168,204,101, 98, 68,145,155,
-122,174,175,110,242,143,159,252, 7,183, 99, 47, 96,156, 90,167,220, 55, 30,190, 67,245, 61, 67,129, 84, 2,109, 45,181, 80,210,
-138, 67,154,194, 61, 96,145, 20,228,170, 68,149,150,247,255,241,221,164, 95,254,111, 52,231,118,147,116, 15, 33, 35, 65, 48,123,
-146,167,126,233,101, 28,251,241,191,229,238,159,123, 23, 87,126,231,109,172,254,203, 71, 28,192,254,254,191, 35,188,241,245,236,
-185,236,175, 56,253,200, 58,255,235,158,135,121,223,102,143,153, 67,251,248,163,223,255,159,140,115,195, 19,189,140, 51,131,156,
-103,255,236,143,153, 61,122,156,207,222,127,138, 63,253,196, 31,242,193, 31,251, 0, 63,248,206,203,185,251,190,199,120, 48,203,
- 88,108, 36,200,110,147,236,194,115, 36,237, 6, 91,107,107, 4, 73, 68,216,232, 98, 41, 49,170, 36,238, 52,145,141, 14, 69,154,
- 33,194, 4,105, 3,130, 64,144,143,198,116,247, 30, 70,171, 18, 33, 29, 84,163, 24, 14,124, 55,155, 16, 53,219, 36, 73,135,206,
-226, 2, 82, 54,233,191,240, 56,163,229, 75,220,240,230, 91,208,166,205,249, 71, 78,211,238, 46, 32,227, 26,155,231, 46,113,237,
-107, 94, 65, 99,126,129, 98, 60, 38,233,204,184,215,116,163,195,232,252, 25,218,115,215, 81,174, 92, 32, 94,216, 11,249, 8,163,
- 10,146,118,155,115,223,186,159,249,163, 11,140, 55, 11,106,221, 5,202,254, 6,166,204, 93,247, 66,192,250,217,179, 28,187,249,
-165,140, 55, 50,132, 77,233,204,205,115,241,153,231,232, 54, 35,166,167,246,209,235, 11,206, 62,243, 52,237,122,196, 70, 47, 71,
- 74,201, 84, 28, 83, 90,193,233,165, 77,190,117,234, 2,253,178, 32, 17, 33, 97, 36, 17, 4,116, 63,249,101,222,244,249,187,248,
-190,159,252, 0,205,122,141,233, 93, 11,136, 80,162, 84,142,213,130, 40,142,118,228, 46, 7,180,187,179,180,186,115,244,183,214,
-220, 53,165, 74,192,196,137, 70, 28,144,197, 79, 83, 61,236, 65, 86,187,213, 42, 56,203, 95,240,210,220, 5, 46, 72,159, 96, 25,
- 38,214, 49,155,165,152,196, 98, 11,223,225, 27, 49,209, 21, 57, 8,132, 15, 14, 18,222,163,154,212, 5, 74, 59, 82, 86, 18,184,
-177, 87, 32,157, 80, 44,144, 16, 8, 67,174,157,181, 3,143,175, 69,187, 10,254,224, 62,201,189,143,105, 86,183, 28,126,164,217,
- 9, 16,129, 65, 89,176,198, 37,190, 25, 4, 81, 3,210,145, 37,136,166,153, 10,219,148, 43,207,162,210, 33,122, 56, 64,103,153,
- 83, 42,151,165, 83,180, 87,104, 86,173, 17,148, 72, 12,218,108,251, 98,172, 86, 24,173, 40,199, 99,242,145, 98,176,146,177,214,
- 47,200, 50,205, 11, 35,133,212,150,151,221,176, 23, 49,219,101,102,183, 96,125,101, 76,250,244, 50, 97,251, 81,100,103,150,198,
-169, 47, 19, 95,241,125,216, 11, 15,161, 11,141,104,204, 34,103, 15, 66,212,112,187,216, 32, 33,104,181,176,107,207,209,188,230,
- 38,210, 43, 94, 70,250,196,125,238,208, 53, 59,184,230,222,250,102,124, 9, 47,131, 0, 35, 4,223,113,162,203,215, 78,247, 80,
-118,155,191, 95,161,210,199, 59,248, 3, 2,248,169, 59,174,216, 6,171, 80,237,197, 61,215,221, 31, 10, 19,235,152,177,219, 7,
-181,168, 50,209,141,247,170,251, 8,218, 29,225, 45,198, 71,150,138, 48,113,207,127, 28,130, 12,169, 95,247, 6, 23, 4,179, 99,
-143,238,184,238,129,239, 88, 42,181,187,131,189,184, 3,222,239,209,141,114,228,180,193, 96, 2,141,209,217,152,180,223,119,207,
-155,181, 72, 27, 33,173, 70, 25,231,131, 23, 17,148, 74, 77, 4,108,214,195, 18,180,111, 13, 93, 64,141, 36, 40, 21, 50, 10, 38,
- 65, 44,194, 26, 31, 88, 99, 9, 66,103,193,211,186, 32,176, 33, 97,152,120,208, 73,137,209,206,206, 87, 9, 9,101,224, 0, 60,
-166, 44, 17,177, 3,223, 24,109, 8,163, 8, 97, 52,121,233,108,106, 86, 88,108,169,145, 81,132, 9, 3,212,120,140, 41, 75,100,
- 24, 56, 61,141, 42,145,214, 64, 91, 32,195, 24,132, 69,101, 25, 69, 58, 70,229, 57, 89,191,231, 2, 98,178,124,194,166,151, 34,
- 96,156, 14, 17,196, 8, 97,145,113, 52, 9,215, 9,194, 0,227, 8,251,140,199, 25,221,118,157,183,220,254, 29, 4,132,164, 43,
- 23, 9,209, 4,181, 16, 89,139,160, 62,237, 42,105, 47,146,156,168,107, 67,207,138,174, 78, 24, 17,186, 60,226, 64,186, 55,179,
-159,212,108,243,129,212, 14, 5, 45,219,224, 11, 93, 98,135, 61,222,249,198,255,198, 91,222,252,251,220,127,255,223,242,153,127,
-254, 53,180,217,152,140,192,181, 79, 44,116,248,106,247,186,180, 62,125, 80,123,241,172,246,126,117, 83,108, 83,142,149,241, 17,
-203,202,227,167, 11,175, 31,154, 52, 25,130, 40, 22,212,234,130,118, 71,208,108,184,100, 73, 93,184,176,167,176, 38,145, 30, 53,
- 91,133, 63,233, 18,108, 4, 53,159,113, 16, 70, 78,155, 35,173, 68,107,103, 69,172,215, 3,247,122, 15,188,200,206,175, 38,181,
- 54,164,169,102,208, 55, 12, 71, 78,116,167,189, 84,164,226,212, 91, 31, 25, 29, 74, 71,153,147,129,155, 52,222,241,250,215,243,
- 79,255,242,249,201,164, 33,144, 14, 28, 23, 74, 44, 34, 20, 68, 72,162, 64, 82, 23,146, 90, 32, 73, 36,132,161,164,208,154,151,
-189,253,135, 72, 90, 37, 23, 31,121,130, 93,111,249,110, 54, 63,253, 89,166,223,255, 65, 46,253,253, 47,208,185,234,141,124,233,
-199,223,193, 87, 30, 63,207, 45, 63,241, 19, 36,139,109, 46,223,123,132,108,239,229,180,250,151,216,115,235, 53,236, 91, 62,199,
-235,110,185,158, 95,125,239, 79,240,253,223,251,122,222,223, 10,185,249, 21, 55,242,200,215, 30,230,195, 95,120,140,183,253,204,
- 31,240,206,151,156,224,225, 11,107, 60,251,205,111,241, 91,159,125, 16,128,227,115, 29,154, 81,192,189,203,125,126,124,113,142,
-124, 48,116,202,205, 81,143,124,184,133, 42, 51,162,164,134,202, 71, 52, 27, 83,110,231, 39, 37,233,230, 58, 81, 35, 70,198, 77,
-162, 36, 69, 21, 5,148,134,250,204, 46,198,235,103,105,206,117, 65,132,180,231, 58,140,183,122,104, 97, 64,198,100,227, 1,221,
-197,125, 52,234,109,146,233, 67, 92,124,252,105,172, 29, 17,119,119, 65, 16, 48,123,104, 63, 65,156, 32,194,132,250,226, 52,217,
-234, 37,194,250, 20, 2, 73,251,200, 21,152, 52, 37,158, 93,196,166, 99,210,173, 77,176, 26, 25,198, 76,239,217,131, 26, 43,106,
-141,132,120,102, 23,203,143, 61, 77,210,106, 32, 73,232,175, 45, 49,189, 56, 79,109,102,150,179,143, 62, 72,189,221,165,191,153,
- 97, 44, 28,191,106, 63,131,141, 1,131,165, 37,114, 47,194, 88,217,220,164,159, 22, 28, 91,232, 32, 13, 52,195,128,250, 84,147,
-180,172, 81,175,197,148, 38,160,208,138, 94, 90,240,199,255,240, 25,254,224,239,254,153, 43,247, 29, 98,207,226, 52,111,122,253,
- 27,185,253,125, 63, 72, 50, 61,133, 16,241, 54, 45,219,229,141, 50,221,157, 33, 29,174, 97,119,128,101, 34, 33, 73, 2, 40,170,
- 78,204,147,145, 18,151, 61,130, 18,150, 2,119,152,171,210,189,209,108, 32, 38,133,185,195, 14,251,160,152,220, 18,249, 93,119,
- 32, 60, 77, 46,113, 59,175, 73,135, 93,184,157, 46, 2, 18, 81, 5,193, 56, 77, 71,105,182,173,107,206, 78,226,166, 0, 81,104,
- 25,165, 78, 44, 23, 37,206,187,174,149,165,185, 40,217,232,107, 74, 11,115,137,227,187,107,229, 41,110,184, 93,101,228,145,173,
-113, 44,185,238,150,159,134,165,179,168,113,138, 30,141, 48, 58, 71,149, 37,182, 84,232,241, 16,157,187, 3,196, 8,141, 29,100,
-132,173, 38, 38,146, 48,220, 68, 37, 49,129,207,135,212, 74,161, 83,197,104, 35,101,163,151,179,180,165, 56, 53, 86,188,123,119,
-147,253, 71,219, 48, 76,177, 79, 13,137,195,148,147,183,158, 36,189,238,118, 78,125,250, 46,130,224,110,194, 91, 95, 75,124,233,
- 27,196,175,252, 49,138, 47,254, 17, 38, 12,177,131, 53,119, 72, 89,231,251,150,187, 47, 35,156, 90,192,246,206, 51,247, 67,191,
-197,185,159,123,237,182,117,192,248, 80, 21,172,143, 85,149,219, 23, 89,224,208, 85,135,249,231,167, 30, 98,108, 32,247,231,127,
- 44,157,143,221, 55, 76, 72,224,103,239, 56,193,137, 99,123,125, 48, 11,147, 46, 91,120,192,201, 36,153,205,167,171, 89, 49, 73,
- 15,152,116,233, 24,177, 99,175, 34, 39, 30,108,227,253,223,248,240, 23, 25, 68, 32, 66,100,152,208,188,250, 53,158, 95, 47,119,
-116,232,198, 97, 96, 43,176,140, 75,255, 64,231, 46, 69,205, 71,200, 97,203,194,165, 46,142,134,238,177,208,198,217,200, 4,104,
-173,188,221, 53,242,214, 50,141,140, 35,103,251,242, 25,230,166,116, 98, 18, 33,165, 91,225, 76,172,113, 26, 35, 2, 68,197, 1,
-192, 89,212,172, 41,182,187,119,107, 40,139, 2, 19, 66, 24,248, 3,210,128, 49,202, 39, 10,150,238,103,182,118, 50,113,208,165,
-235,246, 43,226, 74,149, 76,103,149,246,235,192,128,192, 79,211,172, 86, 46, 89, 79, 65, 62,238, 57,143,134,204,105,239, 90, 68,
- 21, 99, 39,162,203, 82,242,254,192,197, 72, 43,133, 42, 74,175,212,215,110, 39, 31,134,238,121,179,110,245,164,138,194,223,182,
- 4, 18,130, 80,178,177,186,194,213,199, 15,114,229,245,215, 81,174,110,162,202,146,100,102, 22,185, 48,231,188,170, 97, 88,145,
- 95, 92,232, 67, 28, 67,173,182,131, 26,229,159,239, 42,128, 92,250, 57,121, 24,111,211, 84,194,200,253,189,138, 89, 19,114, 91,
-126,238,109,136,194, 91, 17, 19, 83,240,242,151,125, 15, 47,127,217,247, 82,104,131, 54, 5,229,120,147,126, 58, 98,117,245, 73,
-150, 47, 62,202, 83, 79,252, 43,253,173,101,148, 30, 97, 52, 40,237,172,171, 70, 90,132,215, 7,137, 0, 84,238,235, 63, 95,131,
-120,233,149,127,205, 11,130,216,173, 5,107, 9, 52,154,174,248,178,214, 53, 21,101,225, 66,174,172,177, 24,229, 10,192,178,112,
- 44,250, 73,120,140, 79,104, 19, 82,120, 13, 64, 21, 5, 28, 98,132, 75,165,180,184,175,103,180, 35,185,230, 99, 67,175,103,217,
-234, 89,210,177, 37,245,147, 69, 97,157, 96,175,194,230, 86,137,216,210,155, 59,132,129, 47,124,225,243,132, 98,123, 45, 81,150,
-194,133,113,189,244, 88,235, 87,132,117, 10,191,110, 18, 50, 95,175,209,137, 2, 98, 9,153,133, 82, 4,188,255,247,254, 14, 53,
-122,156, 72, 37,200,225, 11,180,222,249, 65, 70,159,251, 93, 46,158,137,184,231,115, 95,227,154,215, 94,199, 21,111,123, 23,127,
-254,179,191,196, 91,255,243,251,248,181, 15,126,148, 59, 63,240, 35,132,231, 31, 70, 30,188,140,167,254,215,199,121,122,105,204,
-129,110,192, 43,223,252,122,230, 14,206,243,225, 63,250, 4,229,174,253, 28, 60,121, 25,135, 22,102, 72,154, 17, 31,185,239, 73,
- 94,119, 98, 15,199,235,146,229, 81, 70,163,213,224,224,158, 57,164,128, 55,189,250, 58,106, 73, 72,173,187,200,218,249, 11,196,
- 73,131,124,220, 71,134,130,108, 52,230,154, 27,175,167,190,251, 48,189, 75,167,105, 76,207, 96, 84, 73, 16,198, 46,173,172,204,
- 9,146, 26,197,176, 79,144,212,208,165,243,160,134, 81,157,149,103,159, 97,254,232, 97, 46, 61,250, 0, 73,171, 69,148,212, 72,
-186, 93,134,107, 91,164, 91,107,204, 30,216, 71,107, 97, 55, 66, 7, 68,173, 6, 97,210, 36, 72, 34, 76, 81, 16,214, 26, 4,141,
-166,123, 17,214,155,216,210,101,179,247, 94,112,135,118,125,102,142,188, 63, 32,237,245,176,166,164,189,107, 1,163, 5,171,207,
-156, 34,136,107, 44,157, 58, 69,210, 74, 16, 2,198, 27, 61,242,209,128, 48, 14, 57,251,212, 41, 58,179, 13, 52, 1,198, 6, 44,
- 93,184, 72, 81, 22, 12, 83,197, 70, 58,102,186,158,240,194,218,128,149,225,152,102, 28,145, 27, 77,102, 97,125,152,210,207, 82,
- 10,165, 89,104, 39, 28,152,237,114,112, 97,154, 48,148, 44,111,109,242,192, 99,143,241,145, 63,251,115,158,251,234,151, 24, 62,
-191,196,204,222,221,180,102,166,253,138, 75,115,232,216,141,124,253,139,255, 47,219, 86, 99, 73,136, 91, 95, 6, 1,132, 72,234,
-194,229,125, 55,165, 32, 48,110,172, 94, 26, 55,206,117,128, 23, 71,129,147,194,113,147,171,144, 22, 33,221, 53, 65, 26,225,216,
-202, 62, 19,125,231,123,185, 34, 58, 25, 33,168, 69,174,219,143, 34, 87,108, 26, 51,153,210, 86, 71,199,100,116, 38,181, 79,134,
-179, 85,183, 46, 64, 9,106, 53,201,167,191,232, 30,155, 43,247, 8,230,143,135, 19, 81,158, 43, 12, 92,245, 16,200,128, 40,110,
-112,205, 21,239,166,120,238,105,138,205, 53,116, 54, 66,101,110, 7,107, 83,231, 43, 46, 55, 7,168,113,134, 30,102, 46,239,220,
-199,116, 26, 3,118,152, 97, 77,137, 29,231,152, 66, 81,228, 5,195,205,130,139, 43, 57,223,220, 44,185,115,119,157,153,169,144,
-213, 39, 55,168, 91, 77,173, 41, 88,209, 33,203,253,156,217,251,190,197,193, 59,110,101,105,121,139,160,236,147,116,103,145, 51,
-187, 16, 83,123,208,231, 31,199,148, 41,100, 61,236,120, 29,179,185, 68,177,124,154,104,122, 17,153, 52, 64, 12, 9, 22,175, 34,
-123,252,171,219, 35,119,233, 14,114,225,105,112, 66, 84, 12, 76, 23,162,116,207,147, 23, 56, 51,130,145,217,126,252,173,132,161,
- 15,227,249,197, 55,158,224,250,203,247,110,239, 97, 42,219,156,183,150, 9,223, 25, 73, 79,233,168,146,222, 28, 39, 32,152, 20,
- 16, 21,197, 77, 72,223,165, 84,128, 26,255,239, 50, 8,182, 65, 52,129, 96,250,237, 31, 32, 72,234,147, 61,250,246, 46,189, 10,
-106,241, 18,103, 91, 98,243, 17, 24, 71,188,179,133,179, 84,232, 60,163, 24,246, 40,179, 12, 83,150,104, 93,250, 3,178,192,250,
- 21, 73,224,169,120,202,104,119,176,170, 2,229,119,202, 8,227,226,124,109, 21, 56, 99,183,189,238,149, 69, 15,235,246,221,202,
-161, 94,133,167,231, 85,185,233,149,144,202, 26,141,206,221,110,189, 2,170, 72,225,194, 89,156,183, 93, 99,173,203, 76, 15,130,
-112,130,204, 53,165,154,196,215, 58,175,185, 70,202,112,130, 80, 54,218,177,217, 3, 9, 81,171, 65,210,110,131,209,148, 89, 78,
- 57, 30,146, 15,135,110,252,158, 23,190, 96, 9, 38, 76, 0,235, 85,252, 65,163,134, 53, 18,171, 21,217,104, 72, 89,228,200, 32,
-160, 63, 74,185,113,111,151,163, 87, 94,142,218, 26,128, 95, 41,202,197,121, 39, 49,143, 99,159,234,228, 53, 12, 97,224,247,114,
-254,160, 14, 42, 19,121,205, 9,227, 26, 13,104,118, 92,172,109,179, 13,173,105,104,116,220, 30, 61,174,185,185,114,245,255, 42,
-139, 13,219,248,233,237,195,222,221,255, 64, 64, 40, 35,106,245, 14,157,246, 44,187, 23, 79,114,236,216,107,184,229,229,255,145,
-219, 94,255,115,220,242,242,159,100,223,161, 87,176,181,190,204,250,250, 11,190,243, 14,209,198, 76, 44,148, 2, 55, 30,172,178,
- 36,170, 61,187, 20, 2, 25, 66,189, 38,104,183, 36,187,118, 7, 52, 27, 78,152, 88,100,142,255, 32,172, 75,242, 21,129,131,188,
-140, 6,134, 44,243, 67,138, 72, 48, 53, 37,105,181, 66,234,141,144, 40,116,111, 42, 33, 3, 39, 62,175,154, 39, 43,176,218,146,
-102,134,209, 80,209,235,107, 86,150, 52,189,158, 97, 60,116,117, 79,153,131, 45,157, 56,216,120,106,156, 8, 28, 10,187,212,142,
- 44,153,151,126,200,161, 39,131, 48, 2,225, 26,164, 48, 10, 36, 81, 0,109, 25, 48,157,212,152,138, 67, 4,150,126,174, 25,150,
- 37, 55,124,199,247,131,216, 34, 28,157,165, 40, 83,104,180,120,252,119,239,100,243,137,167, 17, 71,110,231,238, 7, 78,115,240,
-101,215,114,239,239,253, 54,223, 92, 86,220,153,150,252,242,127,121, 39,119,125,224,231,121,197,251,190,155,244,233, 71, 40,116,
-206,251,127,245, 55,184,229,173,119, 18,196,127, 78, 99,113, 47,221,227, 87,240,200,179,231,185,212, 75,249,167, 71,159,229, 79,
-126,244, 59,185,110,166,201,123,127,253, 35, 28,157,239,144, 90, 56,125,105,141,135, 47,174,210,207, 20, 7,143, 28,192,138,132,
- 90, 45, 64,107,141, 12, 67,226,122,147,241, 96, 11,171,115,106,237, 14,101,218,167, 61,183,135,184,222, 65, 21, 91, 4,113, 76,
-218,223, 98,220,219,162,179,176,155,165,103, 30,231,192,245,183, 50, 92,190, 64,109,106, 6,107,114,166,119, 45, 48, 88,221,100,
-238,224, 81,106, 83, 93,134,235, 27, 52,166, 23, 24,110,172, 51,189,111, 63,181,118,147,184,209,100,180,122,137,206,241,203,201,
- 46, 93, 32,238, 76,161,243,129, 27, 69,201, 16, 17, 55,176,105, 58, 49, 91, 7, 97,157,176,214, 36,239,111,185, 52,187, 81,138,
-206, 55,152,185,236, 50,158,191,251, 27, 68, 53, 65, 49,202,104,180, 91, 12,215,214,136,234, 33,129,174,147,180,106,172, 95,218,
- 96,110, 97,202,167, 60, 41, 8,224,240,241, 19,180, 47, 61, 71,115,121,192, 96, 52, 36, 18,112,108,161, 75,174,224,249,245, 30,
-153, 82,180,106, 53, 26, 73,128,214,174,195, 25,231,138,113,174, 16,129,228,224,252, 2,215,157,184,220,161, 14,107, 53, 54,251,
- 35, 30,120,248,219,108,172, 44,113,229,173, 47,229,232, 77, 47,101,102,255,110,142, 93,254, 82,140,149, 8,223,189,132,129, 27,
-133,199,129,192,148,238,160, 14,128,196, 72,175,110,118,105,106, 97,100, 49,210,239,114,133,192, 6,219, 62,210,192,103, 13, 27,
-237, 32, 28, 88,235,104, 87, 21, 48,198,191, 24,141, 87,167,235,210, 65, 40,176, 78,215, 17, 71, 46,212, 34, 16,214,219,225,172,
-139,106,245, 41,107,198,106,136, 64,102,222, 3,239,213,177, 97, 34, 9,107, 1, 66,228,148, 6, 78,157, 54,156, 52,130,160,244,
-251,127,101, 33, 49,132,177, 67,207,214,154, 45, 24,172,161,211, 33,106,232,178, 3, 76, 81,160,211,148,162, 63,198,140,125,182,
-244,184,244,168, 82, 65, 80,139, 8, 76,140, 40, 45,162,208,132,141, 8, 50,229, 20,183,163,146, 97,191,228,204, 72,241,170, 86,
-200,222,169,128,103,159,216,100,215,222,136,251,210,128,143, 70,123,201, 6, 41,209, 3,171,220,181, 53,224, 95,215,190,200,235,
-222,125, 59,231, 7, 43,212, 87,158,167, 49,179,151, 96,247,149,132,115,167, 41,215, 94,192, 6,145, 27,223, 54, 19,244,112,131,
-241, 99,119,209,188,250,118,132, 93,160,117,253,205,244,254,177,142,205, 51,103,209,242, 49,185,198,216, 23, 17,182, 68, 16, 2,
-130, 31,127,251, 75,248,229,191,249, 54,143, 15,161,111, 97, 70, 66, 97,161, 38,225, 23, 94,127,140,107, 46, 63, 48, 17,196, 57,
-213,123,176, 77,115,147, 46,162, 88, 4, 1,198,163,117, 93,129, 21,249,239, 37, 29,102,183, 2,250,132,161,183,195,137, 29,158,
- 36,144, 81,228, 86, 24, 6,136,106,200,214, 12, 65,107,122, 71, 16, 76,181, 75,215, 59,146,215,220,206,220, 22, 41, 89,127,139,
- 32,138, 29, 31, 61,207, 92, 0,139, 49, 20,131, 1, 86,130,202, 75,127,168,217, 9,152, 7, 99,220,126, 60, 8, 8,164,116, 76,
- 0,227,147,254,124,253,224,216,244,214, 63,134, 62, 98,200, 56, 6,185, 53, 10, 27, 72, 7,141,113,168, 56, 87,114,228,214, 7,
-244,104,172,149,152,194,121,218, 85,225, 80,156, 50,136,156,247, 94, 56,250,153,145,194, 69,163, 74,247,184, 41,149, 19, 68,117,
-239,216,113,128,146,216, 11,223,140,210,110,204, 91,102,174, 8, 49,150, 60, 29, 19, 37, 9,137,192,139,220, 44,229,120,132,201,
- 75,144,130, 50, 47, 48, 24, 23, 21,235, 39,228,177,159,140, 25, 29, 98, 74,103,101,211,214,123,171,179,130, 76, 7,220,120,112,
-158,221,251,230,208, 27,125,176,146,176,211, 66, 76,117,157,108,220, 79, 83,136,130,109,242,148,244,135,120, 92,115, 35,178,138,
- 96,181, 51, 49,111,162,224,242,107,147,234,223,236,206,162,137, 29, 93,254,164,188,247, 12, 2, 60,249,202,227,134,241,194,208,
-201,247,209,147,196,189, 90,173,201, 21, 87,222,206, 21, 87,189, 30,107, 36,247,126,253,111,249,135,143,253, 60,163, 98,153, 48,
-138, 80,185,170,112, 11, 62, 83,193, 9,242,171,167, 63,148,142, 24,215,108,249,107, 93, 32, 8,132, 96,122, 78,144,110,105,167,
- 76,199, 96,180,165, 40,141,243,206,251,140,148,216,143, 21,195, 96, 66,104, 34,140, 4,198, 72, 74, 12, 2,227,139, 8,135,140,
-205,198,154,193,150, 98,125,205,208,219, 50,164, 35, 55,109, 84,213,170, 32,112, 57, 21, 81, 92,193,114, 44, 83,179, 51,220,246,
-202, 87, 17, 6, 17,127,249, 87, 31,227,166, 27,111,226, 27,247,220,231,136,119, 22, 10, 3,113, 8,178, 22, 69,116,235, 77, 58,
-113, 76,183, 22, 18, 73, 39, 60,208,194, 50, 42, 21,175,251,129,247, 50,190,255,159,160,215, 71, 54,219, 20,107, 23,144,151, 46,
- 80, 59,118, 19,250,225,207,112,231, 91,111,227,167,254,235,135,185,253,206,239,226,229,187, 18,222,242, 99, 31,228,227,159,255,
- 54,241,236, 12,247,127,241,219,116, 79,222, 72,163, 51,197, 55, 63,252, 71,124,249, 95, 63,198, 61,207,109, 48,200, 10, 46,108,
-110,241,252, 90,159,123, 95,184,200,161,185, 54,191,241,209, 47,240,127,188,235,181,148,129, 32, 53,174, 26,110, 55, 26,164,133,
- 98,166, 22,211, 93,220, 75, 54, 28, 49, 88, 95,163, 63,216,162,191,113,134,124, 60, 98,216,223,228,200,225,131,164, 89, 70, 32,
- 67,199, 59, 23,110, 79, 28,214, 59,244, 47,157,167, 53,213, 65, 70, 53,154,173, 6, 65, 24,210,152,238, 32,172, 65, 21,138,214,
-194,110,202, 52,167,214,237, 16,213, 91,164,189, 62,131,165, 23,152,221,191,135,233, 67, 71,137,219, 83,156,249,214,253,204, 95,
-117, 3, 38, 27, 17,214,125,238, 57,134,160,222,152,160,127,116,158,186,157, 87, 16,146,141, 50,100, 0,197,176, 32,153, 93,100,
-184,180, 78,107,126, 22,140, 97,188,182, 65,210,108,144, 14, 54, 8, 27, 9, 69, 30, 17, 69, 17, 65, 28,162, 21,140,251,235,136,
-208,179, 3, 10,141,202, 20,185, 30,209,104, 52,152,157, 89,224,234,253,211, 92,190,111, 55,227,172,160,180,154,125,211, 45,246,
- 77,183,105,132, 1,105,169, 25,228, 5, 82, 66,179, 22, 48,211,106,176,216,105,163, 85,206,202,234, 5,206, 92, 56,199,165,165,
-101,162, 72,114,237,137,147, 28,185,226, 4, 75,207, 60,198,218, 83,207,176,126,246, 28,195,245, 77, 94,254,154,247, 98,148, 15,
-239, 17, 14,226, 96,148,247,162, 3,210,186,138,185,180, 48, 86,150,145, 50, 46,222, 80, 88, 63, 14,183,212, 99, 63, 50,151,194,
-237,175,125,119,102, 13,224, 89,240, 46,177, 77, 76, 38,195, 70, 11,103,229,240, 29,127, 84,115, 20,167, 32,148,132, 65, 0, 70,
- 78,198,159, 65,228, 46, 8, 90, 57,143,185, 46, 42,107,138, 64, 24,233, 67, 90,220,213,172,221,132,129,134, 51, 75,134,209, 39,
-198,220,247,235, 35, 62,255, 27, 99, 62,253, 91, 41,255,250,107, 99,254,225, 23, 7,124,228, 71,183,216, 23,190, 13, 59, 26,160,
- 70, 35,116,158,162,139, 12, 53, 26, 81,108,245, 81,131, 49,121,111,200,120, 35, 99,184,145,211, 95, 29, 83, 2,227,141,148,241,
-218,136, 98,144,161,138,130,188, 55, 70,143,114,116,145,131, 18,104, 3, 23, 83,195,145, 86, 64,111,117,140,110,199,156, 29,196,
-188,252, 47, 63,203, 95,126,232, 67,252,221, 95,124,152,191,127,226, 97,150, 78,221,207, 29,247,109,242,153, 63,252, 4,139, 55,
-190,137,222, 67,223,162,236,173, 99,207, 61, 64,244,146,183,184, 39,192,231,141,139, 90, 13,209,154,114,187,207,199,190, 8,131,
-101,236,120,153,249,247,253,222,100, 52, 92,161, 90, 43, 22,114, 83,250,135, 0, 0, 32, 0, 73, 68, 65, 84,139,240,123, 92,183,
- 44,183, 52, 27, 49,191,251,190, 91,249,241,107,230,120,233, 66,131,154,132, 17,240,230,227, 51, 92,119,229, 1, 55,186, 55,248,
-221, 46, 88,109,144, 97,128,149, 94,152, 86,169,218,149,222, 22,209, 9,235,243,187,205, 68, 16,230,208,132,174,219, 50, 30,251,
-110,101,224, 70,250,198, 96, 69, 56,161,107,116, 94,125,231,164, 59,223, 30,187,151, 59,200, 68,213, 71,151, 17,110,242, 28, 83,
-102, 20, 89,138, 74, 29, 48,165, 72,199, 40, 85, 82,164, 57, 74, 41,180,247,179, 91, 31,218, 98,171,157,249,142, 68, 57, 7,132,
- 49,232, 66,161,173,174,160,183,126, 63,235,151,182,104,175, 72, 87,152,162,192, 26, 55, 54,119, 7,170,246,227,107, 87,232,168,
-178,160,204, 51,202,162,112, 20, 58,165, 93,166,121,150, 83,102, 57, 34,156, 92,241, 61,140, 71, 16,132, 17,218, 23, 5,198,223,
- 63,173,220,154, 65,198,177,243,146, 91,103, 59,182,198, 16,134,193,164,168,118, 93,121,138, 42,114,178,204,233,120, 8, 66, 4,
-225,196,125, 34,172, 65,249,172, 81,107, 45,166,122,125,231, 99, 84, 97,200,211,140,249, 70,141,221,123,218,148,155, 91, 78,221,
-223,136, 17,205,150,107, 77,227, 58,212,235, 80, 79, 92, 18,225,212, 44, 76, 47,194,220,110,152, 90,132, 70,219,141,216, 43, 60,
-176,221,118, 68,108, 63,119,147,120,193,109, 76, 90, 85,232, 73, 47, 14,220,249,251, 69,207,249,206,143,213,237,119,236,242,253,
-200, 95, 84,129,233, 30, 78,116,235, 43,191,159,223,249,253, 23,248,192, 47,220,141,181, 53,180,177, 24,237, 32, 48,210, 55, 30,
- 21,120,166, 10,156, 10,188, 67,199,104, 73, 24, 75,234,173,136, 56, 14,104,118, 2, 58, 51,174, 37, 86,165,211, 13,229,185,107,
- 52,170, 17,190,179,245, 90,194,192,167,245,121,193, 80,229,214, 84,202, 80,228, 37,233,168,100,220,215,108,108, 24,250, 91,134,
- 52,133, 34,151, 20,153, 32,203, 5,218, 10, 87,194, 74,183,206,244, 8, 3, 94,125,219,107,184,235,243, 95, 32, 31, 43,172,178,
-236,221,181,119, 18,101,237,182, 69, 62,163,161,219,158,165, 85,107, 64, 0,129,176,136, 64,146,233,146,177,177, 4,141, 54,173,
-181, 71,144,181, 14,170, 54, 69,104, 46, 66, 33, 97,102,145,123,190,248, 8, 87,191,247, 93,220,243,192,227,188,253,196, 30,222,
-255,139,127,194,190,203, 14,146, 4,130,175, 60,115,142, 63,253,212, 55,184,235,147, 95,162,125,240, 8,175,250,201,239, 39,153,
-110,242,201,223,249, 85,214,115,205,111,254,237, 23,249,245,127,250, 58,239,126,195,141,156,221, 26,146,142, 75,102,219,117,254,
-228,179,223,230,199,110,189,138, 75,253, 17, 7,186, 13,230, 26, 53,110, 62,114,144,119,220,242, 18,186,179,187, 16, 82,178,181,
-182,198,220,194, 65,202, 77, 65, 99,106, 26,107, 2,146,122, 64, 92, 75, 16, 65, 72, 84,111, 32,164, 35,202, 33,161,214,158, 34,
-233,238, 34, 8, 2, 90,243,251, 49,101, 74,189, 51,235,200, 66,227, 33, 86, 4, 96, 11,154, 11,123,209,133,162,236,103,236,189,
-246, 6,186,135,142, 82, 12,182,216, 60,115,134, 35,183,222,138, 74, 83,116, 58, 70,151, 41, 32,136,154, 13,108,225, 32, 20,202,
-239,240,210,205,117,159,152, 84, 34,162, 6,186, 24,210, 59,123, 30,173,123,204, 92,118, 29,203,143,159, 34,168,135, 12, 86,215,
-221,142,196,104,242,209, 38,113,171,134, 20, 33,207, 63,113,138,246,116,147, 98, 92,112,241,217, 39, 9,107,134,116,148,163, 70,
- 67,194, 70,157, 84, 89,246,238,153,227,208,225,131,156,220,189,151,221,173, 58,135,230,231,105,197, 9,141, 40,228,232,124,151,
- 19, 11, 51,212,162,152, 82,187,139,122, 45,138,216, 55, 55,195,108,103,138, 99,135,143,210,157,105,211,170,213, 89,223, 90,166,
- 72,135, 28, 58,121, 21,237, 93,115,232,209,144,209,218, 18,239,188,243, 87,221,138,204,184, 68,162, 88, 66, 61,116,118, 39,173,
- 44,121,105, 40,148,166, 44, 13,169,182,228,214,146,123, 49, 71, 82,131,169, 41,151,106, 36, 35,127,232,250, 14, 93, 87,193, 93,
-218,141,147,208,118, 50,186,174, 48,136, 65,236,170,219, 40,118,187,238, 36,145,196,158,144, 22, 4,206,110, 25, 73,235,210,217,
-132,139, 42,117, 60,104,225, 46, 24,210, 34, 98, 8, 99,167,200, 22, 6, 46,155,130, 15,238,131,107, 11,248,216, 61,154, 83, 25,
-172,148,176, 97, 96, 93,195,134,133,179, 5,204, 92,125, 2,181,186,234,246,162,186, 68, 13,135,232,193,136,114, 51, 37,235,143,
- 25,174,103,244, 86,199,244, 55, 50,250,131,130,245,243, 3, 54, 55, 82,198,253,156,254,218,152, 97, 47, 39, 31,149, 12,251, 57,
-249, 70,142, 86,154, 40, 22, 36,210,249,137,219,215, 95,203,250, 74,206,241, 15,253, 33,229,165,167,217,236,109,176,190,124,158,
-229,211, 79,161, 85,128,181, 57, 63,179,217,160,255,177, 79,161,195,144,252,133, 71, 49,197, 24, 46,220, 71,237,229, 63,128, 77,
- 71, 16,184,240, 16, 17, 70,136, 90, 27, 19,214,200,206, 60, 6,131,117,226, 3,251,144,141,174,211, 38, 88, 23,166,226,246,167,
-194, 55, 58,254, 34,232,189,229, 86, 91,222,254,154,147,188,108,223, 52,203, 10,110,158, 18,252,224, 91,174,247, 66,198,192, 77,
- 83,220,166,209, 23,100,142, 97, 33,170,121,189, 1, 25,199, 30, 76, 99,156,144,205,143,145, 61, 32,221, 55, 99,118, 59,112, 70,
-134,147,166,205,218,234, 96,138,145, 73,139,120,118,175, 87,202, 91,175, 8, 87, 47,198, 13,138, 42,105,205,161, 88, 13, 46,232,
- 68,231,169, 43, 88,132,160,204, 51,215, 57,121,234,155, 53,218,255,172,158, 91, 17, 5,152, 82, 81,230,142, 38,135, 23,222,105,
- 63,230,118,135,188,246,159,115,192, 29,229,113,174,214,163, 99,181,135,113, 27,255,209, 90,129, 21,110,122,104,180,115,153,216,
- 64,186, 34,194, 23,252,166, 44, 28, 95,222,234, 29,207,139,239,164, 67, 57,129,206,148, 74,163, 75,229,247,225,133,155,128,120,
- 33, 90,149, 69,163, 74,103,227, 11,147, 4,100, 64, 89, 22,168,220, 97,105,173, 21,136, 48, 70,132,129, 59, 2, 45,152,162,240,
-116, 60,151, 87, 97,138, 18,165, 21,101, 89,146, 15,134,152, 60,101,109, 88,114,203,201, 5,202, 94,134, 16, 17,162,221, 65,182,
-187, 80,111, 67,187, 11,173, 22,116,186,238, 32,159, 94,128,198,148, 27,177, 91,175,106,173, 14,235, 10, 41, 92, 61,201, 62, 72,
-121,251, 57,180, 59, 70,235, 98, 91,126, 94, 41,189, 38, 29, 60,219,106, 90, 25,110,155,195, 39,183,209,219, 33, 19,102,135,211,
-163,130,107, 88,243,162,129,193,145,163, 55,241,161, 63, 93,230,251,127,224, 67,232,204, 16, 6, 14,124, 84,229, 11, 73,191, 97,
- 9, 35,103,161,141, 35, 65,189, 33,105,182, 66,106, 53, 73, 82, 23, 36, 45,137,140, 37, 50, 18,100, 5,228,169, 37, 77,221,218,
- 79,122,141, 95,224, 15, 88, 83, 90,111, 2, 16,219,241,205, 86, 84,148, 6,167,154,207, 45,101,234,198,236, 54, 21,148,169,197,
- 22, 16, 90,139, 48,158, 17, 35, 93,131, 99,133,131,217,200, 64,144, 13, 70,216, 82, 16, 26, 73, 64,128,212,222,173,226,250, 37,
-226, 0,100,175,220, 98,107,180,129, 65, 83,150,154, 92, 43,134, 90,147,150, 57,215,222,246,157,148,151,150, 89,126,240, 62,204,
- 56,225,220, 93,255, 72, 84,183, 52,246, 95,207,242,185, 37,254,233, 47, 63,195,204,104,133, 47, 61,118,154,160,222,224, 43, 15,
-156, 66, 38, 17,135,187, 53,238, 59,183,198,215, 46,110,114,233,155,223,228,155, 95,122,156,135,158,190,196, 37, 29, 49,213,169,
-243, 23, 63,251,125, 92, 62,213,224,190,111, 61,193,117,115, 45, 10,107,185,108,113,134, 47, 61,123,145,165,141, 30,227,210,240,
-213,115,107,244,250,125, 78, 95, 90,230,207,190,252, 13,138,108, 68, 89,106,134,253, 33,129, 44, 9,187, 53,172,209, 4, 73,196,
-226,226, 2,241,212,188,143,132,148, 88, 93, 18, 55, 59, 88, 93, 16, 36, 13, 70, 27,151, 40,198,125,194,122, 29, 17, 38,244, 87,
-151,233, 93, 60, 75,107,118, 22,173, 74, 90,211, 83,147, 61,223,252,101, 39, 33,168, 99, 74,141,202, 75,186,251,247,162, 74,231,
- 75, 45,198, 41, 97,123, 10,163,220,142, 77,151, 5, 4, 49,229,104,192, 96,121, 9, 33, 74,178,193,128,250,116,139,241,250, 10,
-173,133, 25, 78,127,237, 91, 28,188,233,106,202, 65,223, 83, 61, 3,122,171, 43,196,205,144,180, 55,166, 51, 93,167, 53,189,200,
-197, 83,171,132,122, 64,123,110, 22, 17,116,176,229,136,246,116, 7, 17,198, 12,179,146, 44, 75, 81,121, 73,156, 72,180,212,236,
-222,115,152,118, 43, 70, 88,195,254,153, 25,218,141,132, 78, 82,167,149, 68, 92,190,103,145, 67,115,211,204,212, 19,138,162,224,
-244,165, 21,158, 95, 94,102, 60, 26,208,106,212, 24,231, 99,180,209, 24,171,200,179,148,165,103,158, 64,149,138, 40,105,209,157,
- 89, 36,170,205, 96, 52,148,133, 11,243, 41,149, 19,118, 88,227,198,180,153,133,220,192, 88,185,191,203,200,153,156,107, 53,151,
-202, 38,195, 10,245,106,125,119,180,221, 57, 26,225, 42,229,220,211,157, 76,197, 40, 9,182,185,206,181,154,160, 61, 21, 16,199,
- 2, 25, 72, 87, 61, 11, 55, 5, 16, 59, 24,228,218,227, 25,109, 53,210, 23, 18, 34,127, 45,176, 22,253,100,201, 75,114,120,186,
-128,115,133, 19,246,141, 53,100,198, 77, 26,172, 15,150,155,158, 73,152,154, 75, 40, 7,125, 23,206, 81, 58, 68,111, 49,202, 41,
-138,146,108, 84, 50, 28,150, 12, 71, 37, 91,131,130,205,158, 98,101, 37, 99,121, 37,103,249,226,136,141, 94,193, 86, 63,103,125,
-101,196,120, 88,146,141, 75, 84, 90,146,102,134,169, 80,208, 27,228, 12,108,200,133, 49,204, 28, 60,198,160,183,193,211, 15,124,
-141, 32,170,129,129,180,215, 99,233,209, 7,120,248,244, 99, 76,189,230, 50,172,109, 81,172, 47,163,214,150, 48,131, 30, 50, 10,
-137, 15, 94,239, 29, 19,174, 51, 22, 65,132, 8, 99,215,121,172,158,193, 14,206, 50,247,227,191,191,157,255,110, 28, 66, 85,248,
-176, 14, 55,166,244,227,120, 5, 34, 10, 57,253,244, 57,254,244,193, 11, 28,110,194, 7,222,249, 82, 7,237, 8,165,219, 97,248,
-174,222, 17, 57,252, 14,117,135,114, 89, 72,167, 4,223,238,212,229,118,180,159,117,202, 36,233, 21,240,214, 88,132, 12,221,251,
-198,250, 29,123, 20,185,145,189,213, 36,135,175,223, 97, 95,171,186, 45, 31,159, 85, 29, 6,214,184, 59,174, 50, 87,140,171, 18,
- 93,184,189, 49, 22,242,241,144,178, 44,156,210,188,202, 73,199,249,176,173, 50,158,131,174,124, 33,105, 38, 9,109,186, 40,182,
- 57,242, 90,185,255,175,141,199,174,110, 11, 12,181,246, 99, 94,163,125,118,186,118,234,116,233, 59,108, 85,122, 5,182,197, 86,
-123,113,237,172,174,198,123,213,177, 46,175,221,104,227,155, 75,175,208,247, 10,112,107,220,254, 95,107,141, 86,238, 99,153,167,
- 62,190,211, 9,222,140,113, 59,124, 25,133, 68, 73, 29,137, 64, 41,237,224, 73, 82,184,194,162, 84,238, 85, 96,220,251, 79, 41,
- 15,190,209, 26,165, 10,242, 81, 74, 57, 30, 3,112,105,179,199,187,110,187, 18, 85, 90, 68,173, 14, 83, 29,100,189, 1,157,105,
-152,157,133,233, 25,152, 89,132,230,140, 39,246,137,237,231, 98,162,117,240, 66, 72, 27, 84,129,231,147, 52,185,237,219,248, 14,
-222,226,111, 87,133, 36,136,237,120,177, 42, 83, 96,167, 7,205, 86, 33,234, 85,109,224,179, 86,181,242,241,142,213,115,226, 47,
- 38,238,201,193,162, 38,245,129,245,232,226,215,190,225, 71,249,147,191, 92,167,209,156,115,215, 17,237,149,240,214, 91,235,107,
- 14, 60,211,104, 73, 90, 45, 89, 5, 9, 34, 3, 55,229, 10, 67,231,137,207,115,203, 48,181,228,165,247,168,151,147,183,150,211,
- 23,225,198,251, 66, 86,171, 70, 23, 36, 37, 3,137, 20,146, 48, 22,212, 99,111,161,211,174,108,150,149,102,136, 10,185,236,155,
- 31,227, 72,155, 90,129, 40, 53,115,211,115, 72, 4,115,211, 51, 8,173, 8,132,152, 88,218, 42,222,147, 28,103, 35, 12,138,220,
-104, 70, 86, 51, 82, 5,125, 85, 50, 84, 37,111,253,161,255, 76, 20,149, 60,252,169,175,177,118,246, 60,243,223,249, 99,228,203,
-207, 98,206, 61,197, 59,190,247, 59,248,253, 79,222,207, 45,119,190,157,107, 15,204, 65, 58,230,225,245, 49,223,117,116,145, 91,
-246,207,241, 93,251,103,120,211,155,223,202,239,127,232, 35, 92,216, 82, 92,243,138,107,177, 8, 78, 47,109,176,188,214,167, 27,
-199,252,205,125, 79,211,173,215,152,111,214, 57,191, 57,224, 88,183,201, 86, 86,114,197,124,135, 43,103,218,172, 12, 82,186,245,
-152, 46, 48,222, 88,159,100, 56,219, 64, 16, 69, 53, 54,150,206,177,177,114,145,214,236,110,242, 44,155, 92, 40,194, 86,135,193,
-218,138,123,115,234,146,184,214, 32,136, 19,100, 88,199,154, 18,149,141,153, 61,112,136,218,244, 28,121,127, 72, 99,110,129,116,
-107,139,184, 51, 69, 57, 94,135,184,142, 26, 15,137,234, 13,226,230, 20,101,158, 35, 66,167, 14, 13,106, 45,172, 46,208, 74, 17,
- 68,206, 7,177,113,230, 89,226, 36,162,117,224, 4,229,120, 68,115, 97, 55, 27, 47,156, 67,214, 58,108,156,123,142,184,153, 48,
- 88, 93,114,150,186,168,129, 41, 44,189,181, 62,232, 17,139,199,143,114,233,249,101,214, 46,156,101,239,137, 67,168, 66, 48,189,
-119,158,153,189,151, 99, 3,195,194,129,235,161,236, 51, 59, 63, 75, 82,111, 19, 38, 53,180, 42,153,153,157,166, 21, 74,174,186,
-226, 8, 87, 95,115, 53, 47, 57,121, 57,194, 10, 6,105,129, 64, 48,221,106,113,248,192, 46,254,195,123,126,148, 59,223,254, 61,
- 92,125,104, 55,253,173,117,214,150, 86,104,213,107,204,205, 77, 83,230, 25, 65,173,142, 16, 6, 41, 35, 90,115,179, 0,220,252,
-138,119, 16,132, 16, 7,110, 55, 90, 0,169,215,154, 40, 11,153,118,163,119, 35,183,249,204, 66,122, 34, 92,224,118,222,218, 79,
- 78,101, 84,189, 63, 45,202, 88, 39, 68, 50,174,126, 15,132,215,201,196,126,127, 21, 58, 36,108,229, 13,149,145,123,165,106,107,
- 17,218,237, 47, 69, 53, 30,243, 66, 57, 97, 65, 11,247,181,101, 0, 73, 32, 8,194,128,232, 51, 25, 79,254,125, 78,207, 58,239,
-117, 97,182,201, 76, 77, 79,179,219,200,161, 52,130,184, 91,131,173, 45,138,225, 22, 38, 47,177,133, 27,173,234, 82, 81,140, 74,
- 70,155, 57,253, 97,201,198, 86,201,218, 72,115, 97,168, 56, 51,208,156,235,151, 60,181, 82,112,126, 45,227,210,122,193,217,181,
-130,173, 97,201,120,172,208,185, 34, 80,150,213, 18,134, 86,114,233,185, 51,196,187,103,248,236, 95,253, 54,191,244, 11,255,133,
-191,249,187, 63,228,135,127,248, 29,156,127,242, 62,178,113,198,197,243, 91, 44,191,231, 6,212, 74, 31,177,120,148,244,210, 5,
-138,213,115,232,241, 0,115,233, 9,226,107,223,136,168,207, 19, 76,237, 67,212,166, 92,216, 73,144,160, 85, 73,217,223,130,222,
- 10,241,124,215,251,176,171,184,211, 96, 2,165,153,136,212,164, 68, 68,130,180, 63,224,119,239, 62,195,238, 6,252,212,237,151,
- 81,239, 54,189, 24, 46,112, 98,183,138,233,110,181, 83,130, 87, 7,120,213, 49, 97, 39,130, 67, 17, 8, 55,146,246, 64,148,109,
- 83,176,167,205, 9,235, 10,140, 64,120, 62,185,246, 23, 94,119, 64, 53,175,189,221, 95,120,203,201,136,221, 29,228,218,103, 2,
-123, 22,187, 42, 80,121,134,206, 29,167, 93,107,151, 96, 81, 22, 25,217,120,236, 88,234, 86,251,241,185,195,109,105,163, 49,147,
- 75,165,197, 88, 71, 81,211, 69,129,241,148, 54,140,193,250, 23,172, 16,129,191,127,206,118, 86,117,238,214, 26, 63, 17, 8,208,
-166, 68, 43,141,136, 2,100,176,237,211,183,218, 17,237,140,113,240, 24, 35,172,243,190,107, 63, 86,247, 17,180, 70,104,255,216,
- 8, 7,150,177,222, 49, 81,186,251, 84,173, 10,116,145,161,243,194, 1,113,172, 70,107, 55,238,183, 24,202,116,236,198,242, 62,
-158, 76, 43,131,214, 26,235,149,248,214, 24,103,123, 11,164,183, 59, 42,138,116,140, 46, 10, 4, 26,147,101,108,245, 7,188,230,
-138,131, 52,218,109,231,159, 79, 18, 68,210,132, 61, 7, 96,113,183,239,202,167, 29, 64,162, 10,117,216,185, 47,255, 55,128, 35,
-119, 37,208, 59,254, 77,191,120,252,238,222,245,254,243,193, 54,164,162,226, 72,111,159,228, 59,114,191,183, 15,234, 73,234,158,
-246,216,181,234,183, 86,219,183,175, 14,124,227, 37,226,136, 29, 93,187, 32,169, 53,248,189, 63, 62,203, 43, 95,245, 67, 4,161,
-179,109,135,194, 53, 18,129, 15,161,106,181,221,250,208,189,132,141,159, 82,185, 98, 48, 8, 44, 74, 65, 58,134,108,236, 85,239,
- 94,220,111,164,192,148,174,192, 49,147, 44, 33, 65,224,223, 7, 50,144, 68, 81, 64, 20, 74,146,154,195,200,134,225,182, 97,192,
- 26,183,242,148,222,230,239,235, 66, 4, 16, 91,248,252,231,190,196,203, 94,118, 43, 83,237, 46,183,191,250, 85,124,253,203, 95,
-246,156, 5,231, 4,154,168,240, 95,114, 89,237, 87, 64,160,133, 70,134,150, 76, 43, 70,214, 96,163, 6,111,254,190,239,161,127,
-239,167,208,131, 26,247,127,225,110, 58,243,139,212, 15, 95,206,220,190, 33, 73, 52,195,117, 7,142,240,254, 95,253, 51,174,217,
- 59,195, 64, 89, 86,135, 41, 11,211, 45,222,247,238,215,114,174,111,104, 55, 52,159,127,232, 5, 14,236,154,198,102, 25,255,231,
- 39,239,102, 61, 87, 92,183,111,150,171,102, 27,140,117,200,129,153, 22,159, 57,117,129, 80, 72,222,112,213, 65,190,126,102,149,
-203,247,206, 48, 74, 75,142, 52, 18,214,141,101, 74, 88,254,227, 79,188,151,149, 75, 75, 88, 99,201, 70, 35,130,208,178,181,220,
-167, 28,109,114,197,181, 87, 18,181, 58,190, 99, 8, 72,234, 45, 70, 27,107, 52,231, 22,200, 7, 3,234, 83,179,200, 32, 96,180,
-181, 78, 20, 71,168, 76, 17, 53, 26, 4,113, 76, 62,216,162,179,103, 63,195,213, 37,116,150,210, 89, 92, 68, 36, 53, 2, 41, 41,
-211,177, 59, 68,179, 33, 97,173, 78,216,108, 81,110,109,145,247,215,168,205, 46,130, 85,140,214, 86,105,116, 59, 68,141, 46,227,
-165, 51,100,195, 30, 73,171, 75, 16, 64, 54, 76,217, 58,115,134,122, 39, 97,180,177, 78,148,212, 25,110,244, 24,111,108,177,112,
-116,154,233,197,131, 12, 54,251,172,157,237,209,153, 42,209,186,198,168,183,132, 54,146,213,231,215,104,181, 53,181,238, 17,244,
-224, 57, 74,186, 36,186, 73,166, 46,145,180,118,145,171, 49,139,139, 71,217,236, 95, 98,102,254, 8,141,122, 3, 83,244,185,249,
-218,151, 50, 28,110,162,140,166, 22,180,201,139,148,194, 20,116,102,231,120,249,107,222,196,190, 3,123,216,123,228, 36,141, 90,
-131,153,197,189, 52,219, 13,116,105,153,218,187,143,246,238, 5, 84,169,216,127,248,106,190,244, 47,127, 0,198,145,154,180,113,
- 96, 5,131, 69,249, 63, 23,108,103,115, 36,137, 83,141, 86, 48, 41, 85,229, 99,187, 19,215, 89,123, 60,177,201,137,179,173,231,
-107, 11,159, 16,231,148,165, 81, 44, 28, 69, 46, 22, 52,234,210,165, 44, 9, 39,156, 27,167,118,242, 10,151,129,152, 36,171, 25,
- 99,145,213,181, 95, 89,106,117,201,240,175, 51, 30,120,208, 48,180,142,156, 54, 48,219,197,191,211, 10,184,223,120,120,205,109,
- 47,221,207,173,175, 56,193,248,236, 69,138, 97,223,141,118, 71, 41,253,149, 49,233, 32,103,208, 47, 25,142, 53,107,153, 98, 57,
- 55,188,144, 26, 30, 30,104, 86, 70,154,168, 21,115,255,166,230,124, 95,177,186,158,209,138,164, 11,131, 48,110, 45,112,110,168,
-104, 27,184,120,177,199,238,171, 15,241,183,143,220,203, 83,151, 44, 3,181,159, 93,157,148, 79,220,123, 15,223,187,103,138,225,
-207,255, 20, 89,163, 78,231,242,125,132, 55,191,157,213, 79,125,148,250,238, 57,130,198, 12, 65,123, 26, 25, 24, 68,107, 47,197,
-217,111,123,111,206,246,216,209,150, 5, 65,189,142,236,204, 49,184,247,179,216,178,244,129, 42,248, 56, 86, 79,107,171, 96, 45,
- 82,242,219, 31,189,143,101, 13,239,188,188,195,141,215,157,112, 99,200, 32,156, 60,169, 21,254,213,197,160,110, 7,170, 72, 31,
-219,231,246,193, 21,223,125,251,243, 21, 50, 86,200,192, 91,234,196,132,101, 94,125, 94, 4,145,183,207, 5,200,184, 78,243,250,
- 59, 42,212,208,142,195,194,108,195, 74,208, 96,114, 76,158,163,211,145, 35,191,149,238,176,211,218,160,202,220,139,222,152,216,
-254,140,111,211, 68, 53, 41,160,250,156, 99,204, 27,163,221,232, 92,149,110,239,110,236, 68,245,110,169,118,237,218,123,203,131,
-237,160,152,106, 88, 81, 42,164,103, 61,104,173, 16, 30, 7,237,178,207, 37, 70,105, 23, 63,156, 56, 27, 91, 16,248, 17,122, 21,
- 41, 43, 92,224,140, 85,190, 96,193, 56, 81, 92, 89,122,187, 85,129, 46,245,132,137,224,164, 66,210,197,191, 90,139, 8, 3, 84,
- 58,246,141,142,117, 29,190,114,197, 68,153,103,147,233,152, 49,214, 77, 6,112, 88, 92,165, 44,229,120,200,104, 48,228,196,222,
-121, 78, 28, 63, 72,169, 53, 54,174, 17,205,237, 66,238, 63, 12, 83,211, 78,189, 94, 29,230, 59, 15,223,137,181, 97, 7, 26,152,
- 29,110,135, 23, 29,214,114,199,159, 5,255,251, 47,187, 99, 52,239, 5,113,213,193, 61, 97, 86,235,237,164,189,234,144,175,164,
-235, 90,111,223, 14,177, 61, 37,168,220, 24, 94,184, 43, 38,201, 55,219, 48,163,107, 95,242,102,118,237,185,156,135,239,251,123,
-194, 0,162, 68, 80,175, 9,230,230, 37,211,211, 33,205,182, 59,228,139,204,160, 75,151, 41,161,177, 20,169,101,148, 58, 27,154,
- 82, 21,222, 90,208,110,185,177,125,163, 17, 18,215, 36, 81, 40,157,211,162, 74,240,243,247,171,210,253,169,210, 50,236,187,157,
-250,112,100,200,203,202,130,234, 10,156, 40,220, 94, 94, 72,239, 48, 42,198, 5, 79, 60,250, 52,143, 63,248, 16,207, 61,253, 52,
-195, 44, 71, 8, 65,233, 27, 26,132,247,223,231,202,144, 81,146, 91, 69, 63,203,217, 40,114, 6, 42,229,186,219,222, 76,239,139,
- 31,229,107,159,248, 38, 7,110, 62,206,147,143,174,242,241, 63,255, 36,233,150, 37, 56,249, 54,202,205,175,210,109,228,252,230,
-247,191,150,127,124,232, 12, 69,191,207,254,118,131, 39,122, 5,151,202, 58,151,134, 41,191,243,137,187, 57,179,190,193,255,245,
-183,159,227,240,209,253,220,245, 11,223,203, 66, 28,243,119,247, 62,201,245, 55, 92,193,231, 78,157,229,101, 55, 28,227,182,131,
- 11,132, 1,252,227, 67,167,153,105, 36,148,163,156, 72, 64,207, 26,116,169,216,219,172,177,114,254, 28, 83,115,243, 40,235,118,
- 83,121,218, 99,247,209,195, 76,205,204, 18,134, 9, 65, 20, 81,235, 76, 19, 68, 9,218,104,218,243, 11, 96, 12,233,160, 71,153,
-143,220,197, 12,137, 12, 19,226,102,141,108, 99, 19, 91,150, 14, 6,129,160, 49,213, 37,172, 55, 8, 59,211, 96, 37, 42, 79,253,
-139, 75, 83,159,223,199,120,117,109, 98,127,168,117,103, 80,227,145,195, 73, 14, 71,212,231, 22, 56,251,173,251, 41,243,140,169,
-189,251, 81,121, 65,212,172,179,250,236, 11, 44,158, 56,204,120,181,207,226,241, 35, 12,215,214,208,101, 70,109,170, 77,173,189,
-135, 65, 63, 99,253,194,144,188,191, 68,103,118,218, 51,178, 53, 97, 18,211,153, 77,168,181,219,200, 32, 99,102,223, 73,154,237,
-105,166,103, 27, 46, 25, 72,128, 52, 33,163,180, 79,171, 51,195,212,226, 94,122, 27,231,185,250,134, 91,201, 84, 74,158,143, 89,
- 92,220,205,137, 19, 87, 49,191,184, 15,155, 21,244,215, 87,120,252,193,111,112,234,137, 71,209, 69, 65,173,211,101,118,255, 30,
-146,198, 20,179, 7, 14,208,217,179,219,103, 9, 75,102, 23,246, 19, 69, 1,214, 3, 97,178,210,146, 21,144, 42, 24,151,214, 89,
- 29, 61,181,201,217,108,156,231, 82,250,102, 75, 88, 55, 26,207, 51, 55,186,159,228, 35, 23,144,101, 22,171, 32,203, 45,121,110,
- 80, 10,138,220,215,243,210,129,110,162, 72, 76,160, 52,129,181,168,220, 32,180,161, 44, 12,101,105,209,133,139, 46,180, 5, 4,
-218, 98,149, 69, 88,227, 24,245,255, 92,240,236, 41,195,186,129, 94,225, 2, 93, 74,175,223, 73,173, 91, 23,172, 21,176,169,220,
-200,107,156,193, 45,175,188, 2,250, 61,116,153, 59,224,200,214,128,114,152, 83,140, 10,250, 91, 5,131, 84, 51, 40, 13, 27,133,
-229,254,158,230,149,173,152, 15, 94, 61,205,255,120,237, 34, 63, 53, 27,240,179, 93,248,149,155,246,240,131, 63,252, 29,124,105,
- 67,243,248,165,148,193, 88, 17,134,208, 18,130,199,134,154,212,194,102,170, 41,149,228,240,209, 69, 14,236,154, 97,247,122,193,
-135,209,220,245, 11,255,157, 23,226, 24, 41, 37,167, 62,122, 23,157, 3, 87,177,113,113, 11, 53, 24,145, 95, 58,141, 94, 95,194,
-244, 86,137,246, 29,195,246,135,152,116,132, 30,244,209,163,190,203,127,175,119,209,233, 24,178, 33, 97,119,207,118,255, 52, 49,
-182, 58,225,169,211, 51, 4, 60,120,207, 19,124,107, 8, 87,207, 8,238,120,245,141,110,164,239,163, 67, 69,224, 58, 10, 91, 45,
- 28,125,241,100,253,238,210, 10,233, 61,234, 85, 39,239,186,119, 33, 92, 97,134, 12, 16,200, 73, 49, 49,217,171, 87, 93, 49, 18,
-171,148, 63,252, 13,178, 61,187,227,114, 91,249, 13,245,228, 32,175, 98,248,116,230,194, 88,116, 89, 78, 14, 87,129,197,148,142,
-188,102,114,135,222, 53, 74, 99,148, 59, 44,173,210, 19,245,187,245, 1,219, 50, 12,157, 98,223,143,205, 43,134,186, 53,238,208,
-176,198,125, 13, 93, 20, 62,253,206,139, 15,171, 46,213, 35, 79,101,228, 52, 1,214,218,237,236,115, 32,136, 66, 39,154, 11, 61,
- 38,217, 90,130, 56, 66,134,161, 99,179, 91, 8,163,196,129,132,148,241, 57,236,214, 91,240,180,167,147,233, 29, 59,123, 77,158,
- 23, 46, 61, 78,104, 2,191,184,181,101, 65,153, 23, 20,163, 17,101,233, 52, 28, 54,176,216, 42,217,196, 56,225,158, 46,180,187,
-198, 89, 8,194, 8, 91, 20,196,181, 58, 11,157, 54, 87, 31,222, 67,150, 43,172,140, 73, 14, 28, 65, 28, 60, 12,221, 41,136,167,
- 17,180, 28, 81,133,232,223, 28,196,226, 69,162,197,255,253,151,249, 55,183,253,255, 57,204, 69, 53,145,217, 49,149, 49,126,172,
-111,118,172, 58, 38, 29,123, 85,153,123,193, 39, 62, 68, 66,121,202,140,217,121,215,140, 27, 21,250,255,111,209, 47, 74,250,171,
- 62,222,124,203, 59,184,245,182,247, 16,197, 78, 52, 23,198,174, 41, 17,194, 89, 99,203,194, 82,102,134,108,236,138, 9,235,179,
-203,181,246, 54,182,216,137,254,163, 90, 85, 11, 91, 2, 79,155,195, 59, 40,172,144,206,217, 35, 33,196, 53, 58, 66, 8, 2,105,
- 29, 39, 62,118,105,145, 85, 60,172,242, 68, 71,180,139,136, 54,165,224,246,215,220, 1, 37,124,223,247,190,135,119,189,235, 61,
-220,121,231,157,252,192,187,239,228,189, 63,112, 39, 74,111,235, 16,180,118, 15, 71,112,195,201,248, 87,148,177,110,167, 46, 12,
-169,214, 20, 70,243,129,223,252, 56,203,159,254, 75, 46, 46,143, 89, 58,125, 1, 35, 12,167, 95,216, 32, 93, 91, 98,255,238, 69,
-212,236, 49,198, 15,125,158,217,189, 7,121,249,145,221, 76,231, 57,193,174, 5, 26, 73,204, 47,253,213,103,184,230,200, 46,142,
-205,119,249,198,179, 23, 25, 40,195,112,179,207,119,191,229,118, 62,241, 47, 95,230,252, 32,227, 93,111,127, 29, 15,125,235, 81,
- 62,249,224,179,188,243,150,171, 56,117, 97,157,133, 78,157,165, 65,202,173,199,246,112,122,109,139, 68, 72, 54,210,156,149, 97,
-198,247,188,241, 86,166, 22,119,179,118, 97,133,178,204, 48,101,128,149, 25,217,176,207,101, 87, 93, 77, 99,215, 62, 8, 92,119,
-144,116,166, 41, 6, 3,162,118,151,205, 51,231,168,183, 35,100,220,246, 30, 90, 67,210,108, 17,212, 18,226,233, 5,108, 54, 66,
-132, 49, 42,203,136, 26, 45,100, 24,144,109,172, 32, 68,128, 20,154,176, 59,207,224,220,243,180,118,239,162,232,245, 8,106, 13,
-194,102,155,222,217,231, 73, 90,117,242,193, 24, 53, 26, 49,218, 88,102,239, 75,110, 38,239,109,249,176, 7,203, 51,247,126,147,
-195, 55, 92, 65,153, 9,172, 78,233,175,167,196,137,101,115,105, 29,107, 54, 8,226, 38,131,181, 13, 58,211, 1,245,169, 57,122,
- 91, 2, 97, 54,168,119,102, 41, 75, 9,118,236, 10,142,233, 61,206,202,213,108,178,118,254, 41,100,216, 32,105,181,156,166, 32,
-146, 68, 73, 23, 25,105,142, 92,253, 90, 30,249,250, 63,179,111,247, 33,102, 23,230, 73, 26, 9, 38, 43,105,204, 76, 81,228, 67,
- 14, 28,187,156,189,251,143,208, 93,220, 75,210,108,208,232,182,152, 57,113, 5,145,144, 52, 23,102,177, 86, 56, 22,187, 16, 60,
-252,237,207,210, 91,187,128, 49, 78,197,157, 27,207, 18, 17,219,103,133,177, 96,132, 37,240, 49,172, 80,129, 26, 4,133,218, 86,
-149, 10,239,101,246,113,207,206,115,233, 15,109, 85, 90, 84,233,172, 35, 81,236, 88,238, 73, 82,221, 15,208, 74, 80,228, 6,155,
- 91,207,174,152,176, 33,221,255,205, 28, 49,202,104, 72,238,183, 60,250,117,205,165,212, 29,228,198, 79,126, 59,161,131,171,212,
- 66, 24, 41,152,142,221,225, 30, 4,174, 8,121,215,143,220, 70,211,148,164, 27,155,168,205, 45, 76, 94, 48, 88, 79, 25,109,164,
-172,247, 75,214, 70,138,181, 84,243,229,213,146, 15,191,118,145,235,143, 5,180, 15,159,224,225,167,123,220,253,244, 58,207,245,
- 53,143,158,238, 81, 62,254, 44,111, 57,220,226,172, 77,120,108,109,204,174, 88,114,104, 42,226, 43,203, 5,161,177, 92,234,182,
-184, 42,148,252,167,164,224,221,175,186,154, 93,211,243,252,233, 87, 95, 96,113, 38, 96,163, 52, 92, 90, 47,144, 65,192,177,151,
-159,224,185,175,220, 71,123, 33, 70, 90, 71,112, 11, 91, 29,100, 82, 35, 62,112, 21,201,194, 97,146,107,110, 35, 8, 20,118, 60,
- 70,198, 17, 65,123,150,160,222, 34, 95, 93, 71, 93,124,222, 89,119,124,199, 82, 73,116,180,177, 72, 93,242,193,207, 62, 75,183,
- 6, 63,125,199,229,212, 91,173,237, 64,150,192,121,106,173, 31, 19, 59, 17,151,152, 36,208,137, 48,242, 34, 36,137,181,218,117,
-246, 21,124,198,122, 8, 75,169, 17,145, 11, 60, 17, 85,200,180, 16, 78, 44,225,211, 94, 68, 28,249,108,128,128,218,209,151, 16,
-239, 57,238,151, 60,118,219,190,102, 12, 86, 23, 8,235, 14,110,157,141, 40,199,174, 75,183,214, 96, 61,118,182, 24, 14,156, 72,
-204,175, 5, 92,202,169,242,208, 29,124, 49, 2,129, 12, 93,174,187,144,104, 79, 31,195, 88,215,249, 34, 95, 52,162, 21, 30,160,
- 32,195,192,217,238, 42,106,154,181, 19, 21,183, 12,228,196,234, 55, 41,120,140,179,160, 89,227,173, 87,210,145,197,170,216, 89,
-225,253,254, 66,138,237,226,196, 90, 63,174, 55, 88,229,138, 4,177,163,251,157,156, 99, 81,101, 35,117,201,123, 50,112,201,128,
-129, 20,222,215,110,209,218,169,248,221,234,217,108, 7,214, 25, 60,132, 70,161, 74, 69, 45,146,220,116,104,142,220, 4,132, 83,
- 51,196, 87, 92, 5, 11,123,160,209, 65,200,182, 19, 63,238, 64,243,190,184,232,218, 17,187, 88,253,126,209, 33,254,239,141,229,
-255,189,238,124, 7,172,188,234,196, 39, 42,202,127,211,145, 79,254,236, 11,168,210, 11,114, 38,227,121,187, 77,182,155, 60, 96,
-225, 14, 86,130,240,107,149, 23,167,253, 25,163,185,238,198,183,242,133,207,126,144, 48,180, 52,107,146,110, 71,208,234, 6,149,
-163,221, 77,251, 51,215,101,151,202,137,127,135, 67, 75, 58, 50,120,105, 21, 97, 40,168, 37,208,108, 74, 26, 77, 65, 32, 5,194,
- 74,194, 80, 78, 44,187,122, 71,168,139,181,134, 82, 89,178,145,166,223, 55,100,169, 33, 75,183,119,255,129,112, 9,113,210, 75,
- 75, 78, 61,243, 28,214,194, 67,143, 60,201, 3,247, 63,200, 67, 15, 62,204,183, 31,124,152,167, 79,159,102,156, 22, 8,105, 41,
-212,118,202, 92,112,195,201,228, 87, 20, 6,133,255,166, 82, 82,107, 77,241,246,183,189,133,193, 87,238,226,250,119,189,139,175,
-127,238, 81, 46, 12,250,236,219, 61,205, 47,127,250, 33,222,125,251,141, 44, 63,250, 56,135,238,248, 14,206,124,245,110, 6, 79,
- 62,194,212, 85,215,211,147,117,182,242, 49, 87,239,158,227,127,222,243, 56,131, 81,202,127,125,227, 75,120,244,244, 37, 30, 59,
-191,198,241,153, 58, 11,161,101, 53,213, 60,254,196,115,252,196,219, 94,201,151,191,253, 12,247, 60,127,129,249, 86,131, 70, 28,
- 49, 80, 78, 65, 26,135, 33, 55, 30, 90,192,140, 82, 86, 10,205,187,223,112, 3,105, 33,177,104,242,116,140, 21, 5,131,245, 30,
-197, 40,229,208,241, 3,132,237, 41,234,173, 46, 50,105,160,149,101,253,236,105, 26,221,105,202, 97,143,246,254,227,232,124, 68,
-214, 31,160,138,140, 48,169, 81,230, 99,116,158, 19,214,155,200, 40,166,216,220, 32,153,158, 65,103, 57,113,179, 69, 57,206, 40,
-198,155, 36,157, 41,132,113, 45,122, 85,205,235, 34, 99,180,180, 68,123,255, 62,116,238,222, 40, 97, 0,245,233, 57,134,171, 27,
- 4, 81,200,198,185,101,226, 80, 50,119,244, 56,151,158,122,218, 5,100,140, 7, 4, 81,157,241,242, 22,135,111,186, 30,149, 89,
- 86,159,125,129, 67,215, 95,197,249,103,206,179,117,225, 28,221,185, 58,130, 6, 90,101,206,183, 45, 36, 83,251,175, 68,101,125,
- 54,206, 60,207,160,127,145,118,103, 23,195,205, 85,106,173, 58,173,246,110, 6, 91, 43,236, 57,126, 45,217,198, 18, 74,148,204,
-236, 61,196,212,194,126, 22,143, 94, 78,103, 97,158, 50, 31, 18, 98,104, 78,117,153,222,187,151, 93,151,157,164,189,127, 23,182,
-180, 36,221, 58, 82, 5, 68,157,182,127,241,111,239,204, 30,188,247,159, 92, 24,134,113,105, 71, 74,187,131,178,114, 15, 87,233,
- 73, 81,228,128, 8,198, 56,209,136, 86,206,239, 43,253,206, 60, 12, 69, 21,200,229,119,178, 16, 75,151, 87, 44,132,160,212, 56,
- 69,170,117,157,122, 28,187, 96, 5,109,192,150, 6,157, 85,222,242,237,208,152, 80,128,205, 93,236,161,202, 32,236, 91, 86, 62,
-173, 56,147,185, 55,218,150,130,102,224,128, 42, 67,227, 84,161, 74, 67, 39,134, 65,233,238,127, 43,132,225, 8,126,228,231,223,
- 10, 43,203,228,155, 61,116,127,132,210,154,209,218,152,222, 86,206,198, 72,145, 42,203,131, 27,138,127,248,192,117, 52, 59, 17,
-163,155,223,199,167, 62,250, 57, 6,171,107, 28,121,211, 27,217,247,186,215, 50,115,236, 0, 47,188,112,145, 39,159,237,115, 44,
- 42,232, 16,176,146,212,216, 21, 41, 74, 33, 89, 26, 42, 94, 57,234,113,234,204,152,123,198, 49, 31,191,235, 49, 30,123,242, 28,
-113, 83,112, 38, 55,100, 90, 16, 9,104,212,106, 76,207,181, 57,245,212,121,226,205, 77,108,153, 57,166,125,173, 78, 92,159,193,
-108,173, 17,236, 58,142,136, 27, 4,179, 71,137,247, 28, 66,118,247,194,112, 9,139, 32, 63,117, 47,197,250,170,247, 60, 79,194,
-199,189,177, 75,240, 23, 31,191,143,199, 82,203,141,243, 9,175,124,233,229, 62,180,185,178,158, 85, 33, 45, 46,239,209,218,170,
-219, 54,147, 93,253,196,179, 46,133,255,138,219, 80, 26, 59, 25,191, 51, 25,253, 79,226,251,188, 42, 90,134,161,239,122,221,237,
- 90,215,191,158,176, 51,231, 71, 60,162,146, 15,123,170,152, 87,186,151, 5,101, 81, 56, 5,119, 89, 32,133,116,239,195,178,164,
- 44, 92, 26, 25,214,135,170,104,229, 64, 51, 82, 76, 64, 51, 24, 8,107,177,155,160, 43, 61,177,177, 85,234,120,172, 19,210, 73,
- 41,221, 97, 17,120,101,190,181, 46,158,181,138,137,245, 98, 54,225, 15,106,163,118,164,129, 84,145,197,165,246, 84, 61,207,181,
-183, 14, 99, 90, 21, 88,210, 7,200, 24, 23, 41,232,190,183, 54,254,188,114,187,127,167,144, 55,254,251,224, 44,108,126, 42, 50,
- 41, 50,172,251, 25,221,125, 50,254,103,223,158, 38, 88,235, 4, 48, 86, 56,177,160, 48, 22, 83, 22,100,185,230,230,110,128,110,
-116,169, 29, 57, 74,120,242, 42,152,154,131,168, 14,182, 62,177, 20,110, 31,126,190, 43,174,166, 39,149,120,209, 7,194, 76, 14,
-212, 73, 87,110,255,157, 3,253,223,142,233, 43,239,185,218, 22,191,189,104,204,206,139, 15,247, 42,138,204,236,216,155, 27,189,
-173,126,175, 48,113,136,109, 1, 29, 59, 95,119, 30,130,244,111,198,240,149,165,176,209,152,229,212,211,159, 35,169, 9,194,216,
- 9,217,146, 72,210,108, 70, 78, 27,228, 87,143,214, 64,161, 12, 69,106,201, 82, 71,111,147,184, 49,125, 84, 19, 46,115, 61,112,
- 26,147, 40,144,126,229,226, 0, 50,149,208, 24, 99, 49,165,113,162,244,212,208,219,212,164, 67, 40, 75, 75, 86, 56,199,145, 16,
-130,208, 8,172,242,218, 36,225,174,171,175,125,205, 27,121,230,153,231,208, 24,146,122,147,215,221,241, 6, 30,127,252,113,167,
-117,242, 67,174, 50,119, 38, 32, 71,230,146, 22, 29, 26,180,208,204, 47, 46,178,245,153,191,128, 56,161,117,104, 15,135,103, 98,
-174,152,159,231,211,207, 45,243,202,189, 83, 92,118,237, 53, 92,255,234, 91,120,250,163,127,205,254, 55,188,107,107,151,232, 0,
- 0, 32, 0, 73, 68, 65, 84,133,107, 63,240,211,108, 12, 71,124,250,190,199,248,139,111, 60,201,190,233, 26, 11, 81,136, 38,160,
- 39, 66,126,238, 29, 47,231,192, 84,139,191,249,242,195,220,120,211,213,164,163,140, 7,206, 46,179,180, 53,100,247, 92,135,147,
-179, 93, 78,175,110, 49,204, 10,108, 89,114,105,115, 64,145,229,204, 41,205, 74, 94, 50, 91,143,105,116, 23, 24,111, 93, 64, 74,
- 67,156, 52,193, 74,218, 51, 51,200, 80, 18,215,234, 68, 81,140,136,234, 96,225,133,111,125,149,164, 22, 98,138, 49,141,217,121,
-140,202, 80, 89, 74, 82,171,209,152,154,162,204, 51,106,237, 14,227,245,101,194, 70, 29,140,165, 54, 61, 75,186,185, 78, 24,199,
-136,168,198,104, 99,157,198,204,156, 27,253,105,133, 78,115,172, 41, 72, 55,151, 65, 59, 88, 68,177,185,138, 16,154,149, 83,207,
- 48, 92, 57, 69,186,185, 76,153, 13, 81, 69,206,202,115,103,216,117,217, 33,206, 63,250, 8,187, 78, 28, 39,235, 59,170,220,210,
-153,231,232,236,107, 83,100, 57,131,181, 53,102, 14,236, 98,227,194, 57,130, 90,147, 70,219, 32,137, 49,102, 72,210,156, 33,205,
- 10,202,113, 78,148,212,233,173,156,167, 61,123,128,122, 61, 65, 54, 26,180,166,103,208, 26,182, 54, 78, 83,111, 69, 52,218, 51,
- 68,211, 51,204,204,239, 70,155,156,230,204, 20,157, 61,123,168,207,206, 50,179,255, 40,135,110,124, 37,157,185, 61, 68,205, 25,
-108,156, 16, 4, 1,157, 67,199, 49, 74, 19,182,219,152, 34,197,106,231,135, 85, 69,193,117, 55,189,217, 97,152,133,131,115, 90,
-207,105,175,180,201, 21,251, 93,226,226,172,149,134,180,112,137, 74,133,114, 99,199,234,154, 30, 8,167, 42,109,182, 4,113,130,
-183,243,185, 47, 20,121, 43, 70,153,187, 74, 83,249, 40,195, 66,121,128,138,127,223,106, 13, 70, 25,164,133,192, 87,207,186, 16,
-152,212, 82,140, 44,229, 63, 40,206,103,238,126,142, 20, 44, 36,176,233, 23,255,177,191,246,200,192,253, 91,102,220,247,204, 13,
- 12,129,176,149, 96, 50, 47,156, 74, 66,140,214, 12, 54, 51,122, 67,197,214, 72,113,113, 88,240,170, 27,247,145, 52, 2,254,229,
- 83, 75,252,223, 63,242, 43, 92,247, 61,111,228, 53, 31,249, 40, 39,223,253, 30, 14,191,234, 21, 28,127,243,219,184,227, 15,254,
-128, 87,252,230, 47,115,239, 48,100,121, 88,176,124,105,196,115, 27,138, 91, 22, 98,214, 35,201,111,245,224,108, 2,101, 54,160,
-214,130, 52,129,213,210, 50,178,176, 97, 12,103, 21,140,145,140, 71, 57,195, 66,178,150, 89,210, 48, 33,218,123,146,238,137,155,
-160, 24, 96,211, 1,143,255, 63, 31,228,233,255,240, 10, 55,251, 19, 16,212,107, 4, 39,223,142,200,135,164,207,158,218,142, 60,
-173,124,201, 90, 33,133,228,235, 95,121,148,127, 92, 51, 28,172,195,143,190,229, 58, 63,237,246,234,117, 15,246,216,217, 39, 86,
-254,115, 25, 4, 19, 82,144,173, 68,120, 59, 83,119, 42, 72, 75,245, 77,119,248,205,237, 68,193,236,198,249,214, 88,231, 79,199,
-199,228,118, 23, 60, 28,166, 82, 67,107,199,254, 54,218,101, 5,148, 94,225,142,197,250,139,180, 83,147,151, 20,105,138, 49,202,
-113,180, 13,200, 80,122,158,123, 48,241,246, 58, 82,169,231,209, 91,215, 45, 27,173,188, 82, 88, 78,172, 87, 19, 56, 78, 24,110,
-107,181, 38, 34,174,202, 15,237,221, 23,149, 23, 31, 59, 17,216, 77,132,114, 94, 7,224, 84,252, 98,242,248,107,165, 38, 95, 10,
-175,196,119, 73,108,190,187,173, 86, 31, 81,228,178,196,165,179,190,133,158, 15,128,135, 7, 9, 31,158,226,138, 21, 95, 12, 84,
- 42,127, 15,210, 81,202, 56,113, 99, 37,192,210,250,255, 35,236,205,163,109, 77,235,250,206,207,243,188,195,126,247,116,230,225,
-158, 59, 15, 85, 69,205,163, 69, 1, 37,197, 12, 34,216,198, 9, 67, 18,210,145,132, 21,117,117, 47,237, 94,203,213, 49,246,178,
- 77,186, 77,162, 73,107, 86, 52,157,164, 87,130,137, 24, 65,204,138, 70, 81, 64, 81,153, 4, 10, 40, 10,168, 42,168,233,214,157,
-239, 61,247,204,251,236,225,157,158,161,255,248, 61,239, 62,167, 64,210,139,117,185,247, 86,221,161,206, 57,123,191,191,233,251,
-253,124,209,218, 81,121,248,238,227, 61,244,137,211,116,238,187, 31,125,235, 29, 48, 59, 43, 74, 47,159,189,140, 17,112, 80,216,
-237, 33,241,226,161, 21,249,244,238,173,254,127, 86,240,127,197,180,223, 60, 69,124, 16,211,249,102,213,222, 76,228,230, 96, 74,
-175, 43,166,121,205, 58, 88,220,154,216,200,166,128, 55, 55,188,186, 98,154,112, 50,253,115,236,116,181,239,125,253,109,255,165,
-214, 26, 30,125,253,251, 2, 47, 67, 73,160,148, 87,100,157, 88,106, 75, 91, 17,181,229, 73, 87, 85,158,114, 2, 54, 87,212,165,
- 68, 15,235,176,173,136,188,167,152,120,242,220, 83, 77,124,152,234, 29,198, 91, 76,105,169, 3,101,178,174,106, 76,104, 72,108,
- 56,223, 88, 47, 91,200, 68,100, 22, 68, 38, 4,199, 56, 61,237,121,156,247, 60,241,196,147,188,249,173,111, 38,106,117,121,221,
-155,223,202, 39,254,226,207,176, 42, 92, 31,108, 24,168, 28,232, 86, 26, 30,208,177,199,107,143, 87,142,187,238,127, 21,118, 52,
- 98,246,212, 49, 62,241,191,254, 44,127,254,149,151,184, 50,216,103,117,245, 8,175,188,101, 13, 91,143,248,215,239,251, 57,206,
-239, 68, 92,250,230,101, 62,243,233,103, 73,142, 30,229,214,149, 30,111,120,197, 89,126,239,235,151,249,224, 47,188,151,163,253,
-140, 79, 63,123,133,185, 35, 43, 60,112,106,145,207,157,191,206,191,250,189,207,240,119, 95,119, 39,215,135, 57,255,246, 15, 63,
-203,255,248,170, 87,240,194,250, 14, 15, 30, 95,228,210,222,144,187,151,230, 40,173,231,145,181, 37,230, 23,122,220,118,124, 25,
-167,224,241, 63,251, 20, 71, 95,113, 15, 85, 62, 65,121, 43,204,226, 50, 39, 47, 10,180,210, 84, 69, 49,189,181,157,184,231,126,
- 58,139, 71,105,205, 44, 98, 77,133,142, 83,178,153, 89, 72, 19,156,243,180, 58, 29,188,215,244, 22,151, 80, 73, 27,111,107, 84,
- 18,147,164, 89, 32, 67,201, 29, 47,158, 61, 74, 61, 30, 19,105,240,174, 98,188,181, 67,127,245, 56, 58, 78,168,171, 2,239, 61,
- 81,210, 34,235,246, 89,185,229, 1,180,142,200,102, 59, 92,121,250,121,250, 43,109,177,163,237,142,152, 12, 70, 84,149,167, 59,
-127,140,196,183, 88, 57,115,148,124,152,227,156,195,152, 17, 78,205,146,239,238,179,116,242, 52,101,105, 72,219, 61,172, 85,184,
-218, 16,165,194,200,118,182,164, 24,110,176,122,226, 21,248, 73, 73,167,159,114,255,235,255, 58,174,154,144,245,150, 25, 13,110,
-114,252,158,135,217,186,113,145, 94,127,153,213,115,119,176,112,226, 36, 88, 71, 57,222, 35,237,100, 68,177,102,225,236, 25,218,
- 51,179,224, 99,116, 20, 81,237,238,163,179,152,114, 82, 99,204, 68,148,158, 58,162,215,159, 39,205,102, 41,236, 33, 62,114, 18,
- 64, 8,225, 69,100, 67, 58,155, 9, 27,177, 50, 63,224,174, 91,215, 96,186, 15, 38,186, 56, 86,116,250, 18,127,154,245, 53,105,
- 38, 34,146, 86, 44,111, 14, 13,168,144,155, 78, 45, 2,187, 52,172,132, 19,175,208, 86,163,141, 48,228,155,160, 3,107, 20,157,
-167, 44,151, 39,114, 43,175, 28,204,198,176, 89, 66, 91,195,208,192, 92, 44, 47,252,202,192, 98, 10, 71, 90, 48,151, 64, 47,208,
-154,178, 36,198,199, 82, 80,156,117,184,210, 81,148,146,143, 92, 90,120,113,199,241, 99, 63,253, 70,126,247, 23,191,204,139, 27,
-187,188,120,251, 26,119,191,247, 39, 73, 82, 81,232,235, 88,209,238,116,136, 76, 78, 43,139,121,213,143,191,143, 47, 31, 57,197,
-185,196,241,228,192,161, 21,188,247, 92,151, 94, 12, 87,107,184,102,100,147, 80,132,216,211,161,131,125,171,216,247,112,115, 84,
- 98,116,202,206,230, 21,230, 86,103, 56,246,200, 99, 44,191,242, 53, 48,222,160,186,254, 18, 73, 84,241,125, 63,245, 27,108,173,
-143,177, 79,126, 8,218,115,144,239,130,217, 65,157,122, 39,222, 74,112, 73,163, 55, 82,104,240,154,107, 95,127,129,247, 63, 55,
-100,185, 5,239,188,123, 85, 38,179, 40, 80, 0,189, 11, 19,119, 16,178,133,102, 0,231,130,181, 56, 20,203, 80,216,155,184,213,
- 38,114,118,186,178,158,114,230,221, 84, 12,166,149, 58,152,166, 26,218,150,115, 33,238, 52, 14,108,121,115,240,128,119, 33,254,
-212, 7,106, 91,240,197,123,107,241,166, 2,107,112,166,196,216, 16,182,226,154,108, 77,135, 53,246,224,166,170, 52, 81, 72,150,
-147,245,184,232, 10,234, 58,140, 62, 46,192,100,130, 13,173, 41,128,234,176, 32, 78,224,237,242,251,173,220,232, 27,196,156,111,
-110,182, 32, 73,140, 38,220,244,157, 23,188,107, 81,139,197,206,185, 32, 52,148, 70,196, 20,225,254, 29,166,109,103, 2,243, 29,
- 97,132,120,156,228,212, 39, 17, 58,213, 16,203,215,195, 6, 11,158,136, 29,237, 1,182, 54, 52, 37, 62,184,130,154,143,181,209,
- 10, 88, 83,163, 21, 76, 42,203, 67, 75, 29,226, 51,183,146,222,113, 55, 44, 31, 17,144, 12,201,183, 21,244,230,107, 44,172,128,
-102, 66,111, 86,228,230,192,135, 58,181,179,125,167,226,237,254,138,159,251,208, 28,216, 67,119,244,176,246,115, 70,190, 25, 43,
- 2, 28,107, 2,181, 37,168,220,203, 92, 10,183, 58, 44,150,115, 82,212,203, 74, 10,187, 9, 69,222,148,193, 51,235, 14,130,214,
-253,193,199,214,108, 34,226, 88,196,142,119,223,247, 63,200,243,169, 29,145,117, 98,178,150, 14,144, 44, 77,218,210,232, 84,145,
- 79, 60,195, 93,152, 12, 33, 81, 50, 73,215,185,104, 73,170,250,224, 25, 99,166, 22,122,143,173, 29,101,109, 25,236, 85, 12,135,
- 53, 69,105,168,106, 75, 93, 89,137,195,245, 30, 99, 60, 74, 55, 11, 9, 37,247,124,171,228, 25, 20,150, 14,206,195,229,107, 87,
-121,254,252,121,126,240,135,126,144, 79,252,249, 39,185,185,177, 67,101,228,239,244, 62, 0,149, 37, 28, 73, 79,173,129,193,209,
-194, 61, 15, 61,192,232,234, 53,102,206,221,194, 3,223,251, 24,239,254, 71, 63,207,229, 43,215,120,230,197, 75, 36,113,196,198,
-139,207,241,217,245,130,229,123, 31,226, 31,253,167,143,242,127,126,224,163,124,229,241,175,242,187, 95,191,200,147, 47,190, 68,
- 85, 27,222,244,115,255, 47, 15,223,178,198, 39,190,113,137,127,252,159,255,148,163,115, 61, 58,145,226,133,107,219, 44, 44, 45,
-242,214,227,243, 92,217, 29, 19,197, 9, 71,187, 45, 42,107,233, 42,197,196, 88, 78,245,219,124,121,125,155, 43,195,130,225,238,
-144, 94, 20,243,103, 79, 60, 79,177,179, 78, 89, 26,140, 41, 68,204,102,133,233, 76, 64,104,154,170,160, 24,238, 17, 37, 29,242,
-221, 77,246,174, 93, 98,176,126, 89,110, 85,206, 16,233, 8, 13,196,237, 46,202, 91,162, 78, 15, 95, 87,210,253, 89, 79,220,105,
-227,234, 66, 84,240, 71,143,227,139, 49,155,207,189, 64,212,237, 17, 37, 41, 89,127,134,114, 56, 20,166,179,145, 53,220,104,119,
-143, 40,129,108, 97,149,221,203, 87, 41,199, 53,147,237, 77,214,110, 57,205,197,175, 62, 67, 57,218,225,218, 11, 95,193, 81, 49,
- 30,110,211,157,239,224, 76,155,122, 82,144, 15,247, 73, 59,125,118,183,111,146,102,226,135,150,247,100,140,181, 5,237,222, 12,
- 73,214, 99,255,198, 37,122,115, 43,164,221, 14, 42,234, 97,117, 65,220,234, 50, 25,109,210,159, 63, 70,127,105,133,185,165,163,
-108, 62,255, 28, 73, 43,161,191, 48, 67,156,164,216,188,100,102,229, 24,206, 87,180, 59,179,116, 86,142,179,127,253, 6, 90,235,
-112, 47,172,137,162,136,186,178, 18,217, 23,117,166, 57,220,222,195,242,218,157, 18,144, 96, 14,132,172, 77, 30,131,157, 58, 85,
- 60,181, 5, 99, 4, 15,107, 2,106,179, 44, 61, 85, 45, 41, 70,113, 72, 97,140, 91, 34,130,107,183, 52,173, 76,216,238, 42, 81,
- 68, 40, 90, 33, 27,162,157, 41,210, 84,178,136,211, 52,194,107, 77,214,210,164,177,166, 21, 41,116, 13, 73,228,165,216,148, 30,
- 55,241,236,189,224,233,103, 33,231,221, 11, 65,174, 27,139, 13,175,165,225,114, 17,222,223,192,184,134,157, 90, 26,128,194,192,
-137, 76,226, 26,189, 85,248, 96, 94,247,133, 65, 41, 17, 8,214,193, 18,167, 82,207,149, 17, 60,183, 7,255,234, 51, 31, 99,231,
-234, 5,116, 20,145,245,231,185,244,252,147,124,248, 3,255,140,107, 23,191,201,194,202, 42,187,181,230,103,251,123,216,180, 69,
-221,239,243,205,155, 57, 71, 86, 82,254,214,177, 54,251, 78,152,235, 35, 96,228,229,199,185,135,125, 5,198, 41,150,143, 44,240,
- 7,239,255,109,222,248,198,219,184,253,251,190,143,197, 7, 30,130,189, 43,184,241, 62,245,104,159,129,173,176, 64,103,166, 77,
-113,245, 69, 40,247,161,213, 71,153, 18,149,236,178,252,247,127,125,154, 1,222, 88, 9, 7,215, 55,248,165, 47,108,224, 99,120,
-245,145,140, 71, 30,188,109, 90, 8,154, 41,177, 33,129, 53, 64,160,198, 87,172, 84, 3,151, 81,211,130,217,144,216,228, 14,227,
- 56,112,185,201, 52,220,252,131,105,161, 80,210,188,121, 43,197,116,122,134, 49,246, 16,160, 38,152,114, 93, 19,211, 41, 35,138,
-242,158,122, 50,164,174,202, 32, 58,107, 97,141,197, 22,146,124,225,157, 17, 98, 92, 19, 32, 18, 30,100,205,116, 46, 76, 18,143,
- 55, 14,175,253,212,190, 54, 93, 87, 7, 45, 0,232,144, 83, 82, 29, 82,234, 75, 67, 74,104, 50,228,125,225, 14, 9, 7, 15, 32,
- 52,206, 57, 9,252, 49, 70,154, 93, 27,126, 30,128, 52, 77,113,247,138,176, 41,240, 97,186, 62,160,160,201, 58, 74, 86,189, 4,
- 56,142,156,169, 85,200, 90, 87,211, 27,126,147, 30,103,173,108, 2, 60,128, 49,225, 38, 31, 44,118,225,155,113,158,219, 50, 75,
-118,230, 44,209,209,227, 48,211,131, 78, 87,176,175, 62,249, 14, 5,189, 57,178,153,151,217, 10, 15,204,223,223, 73, 40,231,255,
-138,169,253, 32,236, 71, 68,113,135, 0, 53, 13,135,215,218,131,130,236, 12,211,123, 95, 25, 38,240,218,200,247, 69, 57,165,120,
- 6,150,182,124,220,101,142, 31,141, 26,171, 78,152, 50, 10,166, 55,193,170,154,166, 13,126,171, 18,222, 89,195, 91,223,249,127,
- 17, 71, 18,200,210,235, 69, 68,137,150,231, 86,124,176,128,202, 43, 24,142,133,177,225,173,162, 46,196,178,214, 92, 7,116,128,
- 17,213, 65,255,103, 45,212,149, 99,176,103,216, 88,175,217,221, 51,140,246, 45,249,200, 80, 20,134,162,116,148, 97, 51,105,140,
-111,184, 57,242,231, 25,168,173,167, 54,240,174,119,255, 45,126,244,111,190,135,247,188,247, 61, 60,242,154, 71,208,177,226, 29,
-239,252, 94,254,230,223,126, 15,170,209, 54,133,141, 39, 10,226, 72,201, 65,223, 91, 71,109, 21,177,246,156, 57,182, 68,244,216,
-155,217,250,250,227,124,249, 99, 95,167,158,187, 78,235,214,187, 57,126,233, 37,190,247,135,223,200,199, 62,240, 71,188,226,236,
- 26,191,252,219, 31,227,201, 27, 91,220,190, 60,199,149, 97,193,127,120,207,235,248,212, 51, 87,249,216,115, 87, 57,183,208,227,
-119,190,244, 60,191,252,131,223,205, 47,252,215,207,242,153, 56,226,103,223,124, 63, 31,124,252, 89,126,229,247, 63,203, 47,254,
-216, 91, 73,127,247,147,252,206,227,207,242,158,239, 58,203,175,125,254,121,222,120,118,141, 63,121,113,157,119,220,115,154,203,
-123, 35,134,133,225,141,183, 30,227,179, 47, 94,231,210,229,117,102,151,214,184,126,225, 58,155,219, 91,116,122, 51, 84,251,134,
-124, 50, 17,193, 76, 49,161,237, 60,189,165, 35,140,110,174,179,116,238, 14,198, 59, 59, 44,159, 56,134, 45,115,226, 44,147,104,
-186,124,130, 87, 17,206,121,210,118, 15, 51,217,199, 84,181,184, 40,211, 4, 21,162, 13,147,217, 69,234,193, 54,237,185, 30,182,
-168,208, 73,130, 41,199, 68,190, 21, 54, 80,134,209,198, 38,155, 23, 46,115,242,222,123,184,252,181,175,211,155,155, 97,239,202,
- 13, 98, 85, 19,165, 29,188, 87,244,230, 23,153,236,110,210,238,118, 25,237, 12, 89, 58,186,194,112, 48, 34,207, 75,156,141, 37,
- 97,169,244,116, 22, 59,236,173, 15,233, 47,119, 40,203, 26, 48, 98, 51, 52,150,108,118,158,237,171, 79,210, 95, 58,137,138, 20,
-227,193,117, 90,237, 57, 70, 59, 27,204,173,157, 97,126,249, 4,206, 25,116, 75,147,181,123, 88,239,152, 12,246,169,139,130,253,
-173,171,204, 31, 59, 78,218,155,165,191,182,202,240,230, 58, 81,106,169, 75,133, 55, 37,217,194, 18, 94,131, 78, 82,234,170, 38,
-109, 69, 56, 11,113,226,121,237,155,255, 6,207,126,227,243, 76,137,159,225,253,226, 67, 16, 8, 86, 88,237,205,117, 76, 59, 80,
- 78,201,166, 54,146,247, 96, 89, 74,156, 96,214,209,248, 72,147,198,160, 50,168,115,143,110,123,234,218, 17, 39, 98, 71, 73,194,
-116,151,180, 52, 81, 18, 84,214,177,166, 82, 34,128,138, 99, 5,149,199, 86, 13, 28, 77,177,244, 13,195, 87,114, 41,210,165,149,
-111, 90,203,154,189,165,101, 90,111, 74, 82, 55,112, 85,102, 98,177,182, 21, 78, 38,250,124, 52,146,253,127,228,160,170, 81,153,
-216,184,162, 72, 48,183, 19, 7,131,170, 67, 10, 60,117,122,153,185, 52, 35,207, 50,162,168,195, 7,126,237, 31,242,133, 47,127,
- 9,235,225,227,159,250, 10,183,124,215,107,248,153,245,231,248,200,139, 3,198,115, 61,108,105,249,210,216,114,110,175,230,209,
-187,102, 73, 20,252,235, 75, 57, 29,160,163,229,243,166, 16,191,252,108, 10,147,209, 22,239,120,199,157, 28,125,228,181,180,143,
-172, 17,233, 10,175, 35, 76, 49, 65, 37, 17, 73,171,205,171,129,149, 51,243, 50,233, 76,118,195,243,114,140,143, 83, 90,167, 78,
- 16,205,174,226,247, 55,169,106, 75,226, 45,191,242,137,151,216, 86,112,123, 27,254,206, 59, 31,146,134,174, 41,234, 65,145,221,
- 76,119, 58,100,160, 79,173,104,145, 62,120,152, 43,125, 40, 35, 93,152,239,186, 17,139,121,139, 10,140,127,165,227, 48, 64,134,
- 98,173, 27, 27,114,132,115,149,196,112,171,230,230,111, 67, 13,141,192, 22,162, 94,183, 86,114,217,131, 63,217, 24,137, 84,117,
- 90,240,178,174, 42,131, 61, 75,138,173,210,209, 84,144, 54, 21,199, 25,135,234,164, 68, 13,213,205, 26,185,167,219, 6, 12, 35,
- 19,186,138, 29,182,116,168,112, 59,215, 73,160,246,225,113, 85, 80, 77, 39,137,164,134, 5,144,143,111,210,218,124,131,198,245,
-161, 57,113, 88, 39,217,232, 56,135, 78,210,233, 58, 63, 10,242,230,230,212,224,157, 17,154, 37, 97, 59,100,108, 16,148,202,122,
-223,167,145, 52, 12, 62, 58,164,186, 15,125,143,115, 34, 36,181, 34,186,243, 78,238,242, 77,196,158, 19,223,105,184, 38,196,232,
-170, 96,241,212, 25, 88, 92,130,118, 10,105,231, 0,242, 18,136,111, 47, 95,189, 31,190,161, 55, 98,180,195, 43,115, 23,178,212,
-195,118,198,127, 39, 81,220,183, 20,249, 70,229,238, 15,221,193,155, 45,141, 53,161,169, 9,147,181, 57,244,115, 31,226, 91, 61,
-146, 73,234,226,131, 7,145, 51, 80, 11,198,215, 7, 65,162,206,186, 33,171,189,148, 19, 21, 72,145,143, 99, 80, 9,158, 26,165,
- 15,154, 25,165, 53, 11, 75,103,105,183, 99, 58,189,136, 86,170, 2, 22, 91,190,183,178,240, 33,109, 9,216,105, 92,120,170, 2,
- 12,158, 44,134, 52, 21,198,134, 69, 6,142, 68, 11,210,119, 50,246,212,214,177,187,107, 24,140, 28, 12, 60,157,174,162,151,202,
-122,190,200,101, 35, 40,197, 91,133,169, 93,145,133, 5,140,117,130,192,127,255,251, 63, 48, 93,213, 79,161,123,234,224, 37, 17,
-150, 99, 33,150, 26,116, 26, 69,196, 74, 19,121, 69,172, 52,206, 66,123,238, 94,218,173, 54, 31,251, 79,127, 65,103,110,142, 15,
-255,193,159,210, 27,141, 57,183,188,194,199,127,239, 83,228,147,146,135,239,191,133,170,170,232, 37,154,167, 54,118,121,242,202,
- 54,127,113,126,147, 59,110, 63,195,114, 39,225,202,206,136,126,164,248,229,143, 61,206,191,122,247,163, 92, 88,223,225,227,207,
- 92,226,181,167,150, 72,241,252,199, 63,250, 34, 63,240,216,221,140,119, 6,140,218, 93, 94,125,124,137, 78, 55,227,142, 35,115,
-124,245,234, 22,221, 36,101,127, 82,210,153,233,115,231, 98,135,122, 92,114,237,194,115,100,115,139,204,204, 31,165, 44, 42,234,
- 90,222,252, 62,146, 46,176, 26, 15, 25,174, 95,165,189,176,194,246,197,243, 84,227, 33,233,220, 17,226, 52, 69, 71, 17,163,173,
- 13,188, 43,177,165,248,251,108,152,210,147, 86, 27,208,140,119,182, 4, 40,163, 53,213,206, 77,246, 46, 95,101,246,204, 57,168,
- 11,198, 91,155,164,221, 62,222, 89,242,189, 93,108, 93,160, 35,205,201,187,239,100,120,115,151, 88, 27, 76,229, 32,178, 44,157,
-190,149,193,205, 13,162,212,115,227,133, 75,248,196, 48,222, 47, 81, 84,212, 14,246,215,111, 82,215, 67,172, 29,208,202,186, 36,
- 45, 67, 93,165,232,164, 34, 82,109,138,114, 72,148,206, 2,145,172,175,235,146,172,187, 34,171,113, 21,209,154, 89,228,212, 61,
-223, 77,148,212, 20,227, 1,229,120,159,164, 55,139,169, 75, 90,157, 57, 48,142,217,181, 85, 84, 26,227,108,142, 43,157, 76, 58,
- 74,194, 54,214,159,187, 76, 49,222,167, 46, 36,170, 48,109,183, 81, 90,124,225,242, 62,117,212, 85,205,109,119, 62, 42,153,229,
- 33,109,209, 29,228, 42,136, 50, 51, 52,221,205,251,205,132, 27,106, 89,129,169, 69,232,134, 13,197,189,144,199,135, 15,249,158,
-226, 73,215, 36,169,228, 11, 39,169,208,154,226,200, 7,180,179,208,158, 60, 78,172,110, 77,214,171, 86, 68, 78,110,239,186,112,
-236, 93,242,108, 23,176, 91,138, 77,205, 0,173, 72, 20,238,203,153, 8,249,250, 49,100, 33,209,205, 42,121,241, 87, 86,132,116,
-206,135,155,123, 28, 80,116,173, 20,213,138,137, 35, 69, 18,107,102,219, 26, 29,193,133, 63,126,154,139, 14, 30,121,229, 93,148,
-163, 1,117,145, 83,141,246,249,232, 39,191,196,218,202,157,124,238,230,105, 80,154,159,123,225,113, 62,244,213,109, 54,146,136,
-207,108, 78, 80,198,178,239,224,165,157, 10,149,192,171,239, 91,228,127,191,115,134, 19, 45,205,134,129, 93, 7, 67, 15,111, 90,
-136,249,177,187,230,120,211, 59, 30, 96,245,161, 87,209, 59,119,142,246,114, 15,148,193, 22, 57,222, 86,196,173, 54, 89,148,240,
- 47,254,233, 91,232,220,118, 26,157,205,201, 46,176, 28,131,169, 81,213, 8, 95,109,177,244, 55,254, 15, 65,137,122,199,207,255,
-246,147, 92,168,224, 88, 2, 63,245, 78, 1, 64, 53,247, 87, 81,179,135, 67,111,220,172,185,165, 16, 79, 87,235,214, 78,149,195,
- 83,174,118, 28,208,165,145, 20,148,233,221,188, 41, 14, 86,124,141, 30, 65, 93,249, 16,177, 39,194,180,120, 58,181,121,107,240,
- 69, 62, 85,197,131,147,156,245, 72,135,194, 44, 15,245,120,138,151,181, 56, 83, 73,254,121, 19,212,130,158,222,200, 69,224, 33,
-250,129,230, 69,169,211, 84, 10,165,115,184, 0,200,137,116,132, 78, 68,208, 4, 26,173,117, 16,168, 73,138,154,156,197, 67,222,
-186, 86,216,128, 90, 61, 36,166, 6,219, 8,235, 36, 71, 94,208,181, 58,220,255,197,139,175,211, 24, 21,136,138,214,123, 73,141,
-115, 70,144,178, 97,155,225, 3,109, 94, 69, 26,103, 28,166, 62, 8, 90,240,222,227,141,232,121,228, 44, 36,236,121,140,132,138,
- 88,107, 37,218,213, 57,129,206, 56, 41,228,206,186,224, 96, 80, 24, 21,113,118,190, 3,253,190,252,185,105,235, 16,127,221, 3,
- 21,222,151,225,222, 92,133,111,223,178,114,247,223,186, 86,215,255,125,129,251,183, 21,244,239, 96,109,107, 80,178,211,137,253,
-144,146, 61, 82, 7, 34, 78, 1,167, 31, 20,120, 99,164, 25,176, 14, 95,213, 2, 9, 50, 6, 87,228,216,253,125,204,112,128,175,
-106,108, 94,134, 91,123,216,122,140, 71, 7,127,214,183, 9,230, 60,183,221,249, 14,218,237,136, 36, 9, 5, 61, 86,211,224, 24,
-135, 19,175,122, 8,113,201,173,163, 48, 30,175,157, 76,214, 65,124,111,131,205,183,178,142,178,114,236,237, 90, 54, 55, 45, 91,
- 91,150,141, 45,203,214,166,229,250,186,101,107,203, 49, 26,138,189,215, 84,210,238, 89, 3,117, 41, 77, 67, 97,164,129,170, 11,
- 97,131,136,190, 72,148,241, 13, 30, 63, 77, 15,233, 91,213,193,243, 53,110, 71,154, 81, 41,112, 8,173, 97,113,110,129, 56, 89,
-167,246,150, 55,254,208, 15,242,233,143,124,130,239,123,221, 93,108,230, 53,159,255,242,121,126,226, 87,126,138, 79,254,155, 15,
-242, 23,207,221,228, 53,103,151,185,246,228, 62, 71,218, 17,221, 94,155, 63,127,230, 18,191,249,185,111,240,163,247,156,226,157,
-119,156,224, 87, 63,253, 77, 22,250,109,190,120,101,135,127,254,174, 87,243,235,159,120,154,213,149,121, 30,213,138,199, 47,239,
-240,196,249,155,188,235,209, 59,248,195, 47, 62,199,143, 60,118, 23,191,250,145,199,121,236,174, 51, 92,222, 30,134,164, 36,207,
- 98, 47,225,146,142, 89, 93,238,211,137,219,236,108, 94, 67,199,154,118,187,197,104, 8,137,242,212,147,154, 36, 49, 36, 89,135,
- 36,107, 81,142,118, 73,187,125,162, 56, 34, 74, 91,228,123, 3, 58,237, 21,188,181,116,214, 94, 65,181,189,137, 78,192,149, 69,
-240,144,182,185,246,228, 23, 56,249,170, 71,169,134, 19,226, 94, 31, 95, 37, 56, 91,161, 85, 76,212,235, 99,182,119,200,122,125,
- 76, 53, 98,188,125,131,164, 53, 79,148,182,240, 46,102,247,250, 58,107,119,156,226,218,211, 23,201,250,154,218, 20, 76,214, 39,
-232, 72,209,233, 45, 65,189, 69,183,155,160,146,121,118,174, 93,195, 26,143, 27, 79, 88, 88, 89,166,200, 75,218,115,139,220,120,
-238, 37,150,143,119, 41, 93, 77,210, 89,160, 30, 12, 48,213, 38,174,101,217,187,121, 25,180,199, 84, 5,237,217, 89, 34, 29,177,
-191,125,157,180,189, 72,146,143,233,173, 30,193, 26, 67,149,239,177,116,244, 52,237,185, 89,138,193, 30, 90,139, 8, 42,237,204,
-162,146,136,209,214, 22,147,205, 13, 86,110,187, 27,231, 42,242,193,132,228,200,172,116,251,214, 18,197, 41,120, 43, 14,129, 56,
- 33,214,138, 31,125,235,219,121,254,202,243,124,241,233,243,211,109, 91,124,232,197,171, 36, 80,141, 72,123,156, 11,201, 96, 90,
-133,219,162,162, 54, 80,228,144,181,193, 20, 30,157,138, 71, 83,200, 87,144,117, 84,152,124, 32,107, 43,210, 76,160, 41, 90, 67,
-229, 28, 70, 43,185, 21,162, 80,169, 40,230,125, 14, 45,231,136, 47,123,158, 43,229,191,197, 43,232, 42,216,179,144,134, 97,192,
- 88,249,185, 53,208,138, 3, 35, 57, 88,243,186, 17, 12, 3, 58, 54, 42, 45,168, 56,224, 87, 99,162,128,121,138, 19,133, 25, 58,
- 86,186,138,207,127,230,235, 12,128, 59,111, 63, 73,177, 47,241,158,152,156, 61, 11,127,248,213,111,240,203, 43, 17, 63,240,170,
- 87,242, 47, 62,127,137,167,252, 13,226,194, 50,246,138,182,130,235,132,105,127,232, 56,115,207, 12, 15,174,205,179,118,124,155,
-237,237,156, 52, 82,204,246, 90,204, 28,153, 97,238,150, 83,204,221,118, 7,237, 99, 39,200,150,103, 33,213,184,237, 77,124, 89,
-226,124,141,142, 82,204,120,200,241, 31,254,219,140, 95,248, 10, 81,175,143, 47,135,226,139, 78,218, 33, 65,171, 67,235,248, 93,
-124,248, 47,174,240,145, 23,175, 19, 71,112, 91, 15,126,242,123,238, 97,102,166, 47,170,118, 4,168, 34, 91, 80,133, 15,156,124,
- 20, 7, 5, 53, 22, 15,162,196,117,170, 3,198,182, 23,144,191, 15,185,233,132,175,157, 68,241, 29, 82,206,155, 32, 20,115,117,
-112,142, 88,228,208, 34,222,107,239,100, 61,110,118,215, 73, 22,142,224, 85, 5,196,242,235,146, 36,112,203,139,144, 57,110,195,
-148, 43,163,136,248,204,229, 99, 16,107, 24, 18,100, 98, 85, 0,232,132,164, 53,107,136,226, 20, 31, 5, 76,108, 99, 59, 11,118,
- 60,101, 68,140,215, 52, 52, 74,201,180, 52, 21,194,105,143,175, 61, 74, 9,177, 45, 78, 82,168,101,107,164,130, 37,138, 52,150,
-116, 52, 26,129,188,159,110, 15,148,245,144, 52,154, 18, 63, 37,210,249, 58,136,235,106,137, 20,244,181,136,192,188, 22,100, 40,
-206, 9,242, 88, 49, 21,191, 41, 35,106,121,231,101,184,142,104,154,160,144, 86,232,152, 38, 59,250, 16,172,162,163,136,204, 26,
- 90,179,115,242,166,141, 35,185, 77,171,228,192,129,160, 14,243,249, 15, 21,108, 26,205,128,123,121, 1,126, 89,172, 26,223,193,
-195,126,248,215,248, 67,152,216,230,255,204,203,127,153,179, 47, 87,189, 55, 58, 9,117,232, 80,124,160, 24, 59,216, 24, 4, 65,
-143, 55,181,232, 24, 42,131,179, 5,170,182, 40, 21, 67,156, 96, 71, 35,162,222,140,112,141,226,112, 31,140, 98,177, 75, 70,233,
-203,236,109, 15,191,230,231,121,242,241,143, 3,154,184, 89, 6, 52,205,149,151,103,156,113,142,210,136,200, 77, 71, 65, 70, 24,
- 88, 29,104,133,173, 61,149,177, 2, 47, 43, 96,127,207,178, 55,176,228,185,199,148, 80,228,142,105, 86, 75,165,200,199,225,124,
- 25,190, 53, 0, 25, 23,222, 87,214,203, 6, 52,214,112,223,189,247,242,224,125,119, 31,144,117,129, 15,254,214,127,166,110, 44,
-190, 7, 9,149, 41, 45, 85, 81, 7, 69,225,194,194, 18,155,255,237,131, 44,220,114,146,211, 63,248, 70,230,239,185,135, 63,254,
-192, 31,240,153,175,126,149,145,138, 56,255,181,175,241,224,247,191,129,232,249,155,188,239, 55, 63,202, 98, 22, 51, 42, 12, 30,
- 77,165, 21,119, 47,207,240,204,141, 93,156,142,248,181,247,188,158,255,242,103, 95,229,223,127,246,155, 60,177,218,231,123, 31,
- 60,195,135,191,240, 44,167,143, 44,112,247,234, 12, 95,185,116,147,249,185,179,188,246,129, 51,124,237,234, 54, 63,254,182,135,
-248,203,167, 46,177, 55, 24, 49, 40, 74,238, 94,157,103,125, 84,176, 21,197,164, 74,113,254,133, 23,152, 91, 61,198,112,176, 67,
-153, 23, 68,174,162,246, 50, 25,216,114, 36,113,144,104,146, 86,139, 40,201,168,203, 18,147, 15,177, 85,129,247,142,238,226, 50,
-118,188, 31,162, 31, 59,232,180,205,254,165,231,233,174,157, 96,238,232, 81, 72,250,224,135,232, 40,102,184,125,141,229,219,110,
-101,124,243, 58, 42,214, 36, 89,202,230,133, 11,180,123, 29,146, 44, 35, 74, 18,226, 36,227,250,243, 23,209,170,194, 90, 77,153,
-231,244,230,231, 25,141,247,177,101,194,112,112,137,217,181, 91,209,164,168,164,195,214,181, 75,236, 94,218, 96,238,204, 12, 43,
-167,110,163,156,140,169,138, 9,197,112,151,254, 92, 74,111,249, 40,155,151, 55,200,102, 58,224, 43, 58,115,199,133, 70,228, 28,
-206,213, 36,157, 89,140,171, 73,186, 61,218,115, 75,180,186, 5,221,185, 37,174, 63,251, 36,139,199,110, 69,199,109,202,201, 22,
-203,179,119,160, 72, 40,134,155,100,189, 57,186, 75, 75,244,151,142,224,156, 33, 61,119, 43,237,185, 62,163,237, 45, 58,243,243,
- 2,188, 48, 86, 30, 88, 65, 84, 20,199, 49, 90,195,220,204, 60, 15, 47, 29,227, 77,119, 63,196,179, 23,126,149,193,222, 24,244,
-193,251,173,209, 18, 17,208,173, 81, 36, 47,240,198,229,169,163, 64, 56, 50,114, 91,143, 90, 26, 91, 43, 8,120,196, 40,130,220,
- 41,201,118,198,139,117, 43,112,190,173,149,238,222, 7,114,140,211,160,236, 33,125,118,237,121,241, 9,203,118,121, 40,181,209,
- 67, 59,146, 27,117,132, 20,109,239,165,160,119,244, 84, 63, 53,197,221,102, 26,142,165, 80, 94,187,137, 74, 84, 88, 47, 39, 56,
- 59,162,221,137,137,149, 34,139, 52,243,153, 38, 29,229, 28,157,209,124,254,207, 62,207,223,122,199, 15,179,113,115,140,141, 60,
-191,243,163,119,113,174,117,138,199,213, 9,126,226, 23,255, 29, 51, 9, 24, 37, 19,120, 91, 43, 46, 79, 74, 22, 58, 45,198,133,
-129,200, 83, 86,158,217, 83,203,180,151,230, 56,237, 28,222, 69,164,189, 30,237,133, 21,210,163,199,104,173, 28, 37, 93, 93,130,
- 86, 11, 63,218,198,185, 28, 87, 21, 33, 22,212,160,108, 37, 78,142,213,115,224, 12,110,180, 7,105, 42,146,135, 60, 66,233, 20,
- 98,197,211, 62,165, 5,156,238,192, 79,188,253, 94,102,103,251, 1, 14,166,167,225, 36, 42, 0,100, 36, 62, 85,135,226, 43,235,
- 72, 23, 48,175, 81,152,114, 85,227,211,214, 97, 61,219,212,248,131,205,189, 8,200,180, 14, 2, 73, 2,137, 77,225,172, 21, 43,
- 28, 14,156, 20,103, 29,126, 94,109, 92,164,125,238,254,105,172,170,169, 75, 18,239,208,173, 12, 21,197,184, 60, 15, 43,247, 92,
-242,225,117, 68,156,166,228,195,145, 76,184, 1,101, 59, 21,240,185, 90,190,134,198, 17,121, 37,192,150, 88, 86,217, 62, 8,234,
-180,142,167,112, 22,240,248, 40, 14,174,228,176,150,215, 42, 20, 26, 29, 68,127,160,147, 88, 86,220, 77, 24, 72,176,147, 73,230,
-185, 15,162,209,122,202,195, 23, 78,128,154, 90, 61,124, 16, 32,218,170, 10,201, 44, 34, 22,244,166,134, 72, 99,170, 90,222, 83,
-173, 86, 80,213, 7,156,178,150,105,181,185,191, 11,178, 20,156,138,208,205,103,221, 29, 8,228, 26,167, 0, 74, 97,117,196, 82,
-190,143,141, 23,136,188, 19,161, 89,154, 74, 81, 53,145,200,173,189, 2,101,190, 37, 46,213, 77, 69,139,130, 42,251,239,212,241,
-111,155,204,213,183, 76,244,135,115,210,221,161,109,124, 88,253,153, 74,110,222,198, 4,249,182,159, 10, 16, 15,120,238, 94,198,
- 81,107,166,103,147,198,159,238, 66, 68,114,227, 38,176,181,216,247,116, 43, 35,153,111, 99,198, 57, 42, 46,208,173, 12, 63, 42,
- 80, 89, 39,220, 14,191,221,118,215,235,159, 70, 5,184,133, 53, 54, 52,129,242,186,177, 86, 84,234,182,161,187, 21,146,119, 51,
-181,198, 39, 42,184,239,100,226, 30, 27,203,112,224,216,222,118, 76, 10, 79,153, 75, 6, 59, 70,238,231, 10, 37,122,165, 58,104,
- 3,235,112,206, 52, 18,179,106, 67,248, 85,208, 83, 98, 61,220,123,231, 93,124,232, 67,191,131,113, 22, 21,123, 34,127,144,165,
-174, 17,180,172,114, 16,189,225,238,254, 47, 12,139,154,202, 89,140,119,188,254,173,239,166,119,241, 37,246,138,121,242,103,254,
-136,254,137,121,110,123,224,117,252,208, 15,189,157,211, 89,202,169,147,171,252,211,255,240, 39,156, 95,191,193,171, 79, 44,113,
-101,119,204,106, 43,162,221,235,242,240,173,183,240,165, 11,151,169,173,227,252,230, 30,159,126,238, 58,127,253,209,219,121,244,
-228, 2, 55,183, 6,124,228, 27,215,248,145, 87,222, 74, 43,210,108,143, 75,238, 60, 50,207, 71,191,126,129, 88,107, 92, 89, 51,
-172, 29,189, 68,115,255,173,107, 88,227,105,165, 41,155,251, 19, 34, 5,115, 89, 66, 84, 22,220,250,192,131,108,111,222, 68,199,
- 49, 69, 97,184,118,241, 10,143, 60,246, 40,217,252, 18,214,137,162, 43,157,157,197, 59,133,142, 99,146,206, 60,202, 25,162,172,
- 29,194, 58, 10,162, 36, 65, 39,169, 88, 61,226,136,209,205, 29,102, 79,158, 96,255,202,121,218,243, 75,216,178, 98,188,113,157,
-206,242,154, 68, 20,230, 57,213,164,162, 28,237, 97, 43,195,120,103,147,133,147,107,120, 82,242,221, 93, 22,207,158, 97,231,226,
- 37,188,181, 36,169,166, 46, 13,163,193, 54,237,110, 6,222, 96, 77, 68, 81, 84,212,227, 29,226,246, 42,118,114, 21,218, 29,234,
-137,195,185, 10,103, 99, 58,179, 41,206,181,201,247,115, 76,109,105,117,193, 89, 77, 20,183,104,247,231,196, 18, 99, 61, 89,119,
-158,186, 30,179,116,244, 22,198, 59,235, 20,249,144,165, 83,119,144,205,206,113,245,155,143,147,181,103, 88, 58,123, 43,189,149,
- 37,246, 55,111,210,158,153, 71, 41,205,220,177, 53,170,124,140,171, 43,112, 80, 14, 71,120,107,105,117,187, 68,137, 76, 72, 30,
- 35, 15,122,173, 36,192,162, 24, 51,124,226, 35, 84,186,197,219, 78, 45,240, 71, 79, 63, 55, 21,158, 38,161, 75,213, 10,142, 46,
-175,242,166,215,188,134, 43, 55,111, 82,215, 85,112, 83,136,104,196, 5,239,185, 87,146,186, 38,140,101, 81,194,107, 45, 94,118,
-103, 37, 75, 61, 78, 20,105,248,247, 34,174, 10,226,165,138,105,172, 99,100, 65,229,158,100,232,169,158,179, 60, 51, 16,193, 89,
- 29,114, 31, 38,225, 13,144,132,116,198, 88, 75,241,206,253,129,160,100,223, 4,251, 72, 4, 75, 9, 60,120,174, 79,231,216,178,
-228,166,187, 26, 95,212,228,163,138,106,191,164, 54, 30,109, 61, 55,107,120,118,219,242,202,239,185,157,183,221, 86,178,248,197,
-223,160,253,129,223,230,191,253,241, 38, 31,254,220, 11,124,245,207,159,160,223,215,172, 59,207, 40,132,222, 68, 74,177,231, 20,
- 75,237,152, 19, 29,197,169,147,179,244,102, 5, 55,220, 89, 90,162,213,155,163,189,178, 74,231,228, 25, 58,103,206,145, 29, 63,
- 69,188, 48, 11,157, 20,202, 17,126, 50,192, 85,114,111, 37,146, 93,155, 86, 74,172, 93, 73, 18,138,146,158,122,152,181, 22,101,
-143, 79,225,228,194, 42,187, 95,248, 28, 63,253,174,251,105,181,146, 41, 36,102,106,229, 10, 60,120,149, 70,135, 82,174,154,127,
- 39,223,235, 0,153, 17,165,245,129, 23,219, 7, 76,105, 51,173,123,231, 15, 18,184, 8, 94,234, 72, 75, 52,105, 3, 76,105,104,
-115, 74,133,182, 76,152,242,188,108,237,124, 0, 0, 32, 0, 73, 68, 65, 84, 42,105,209,185,237,225, 16,111, 90, 72,134,189, 49,
- 68,105, 26, 66, 87, 36,100,197,154, 74, 86,247, 74, 68,113,166, 42,195, 3, 47,164,170, 1,105,214, 10, 76,122,225,159, 71, 90,
- 5, 53,127, 52,213, 0,248,233, 64, 25, 50,224, 21,211,236,119,172, 11,126,100, 23,108,210, 82, 32,117, 67, 90,242, 34,238, 83,
-177, 96,119, 93,136,108, 37,248,231,157,245,178,161, 80,138, 36,138,209, 58, 88,211, 84, 32,199, 5, 97,158,175,202,112, 6,177,
- 7, 49,175, 86, 88,242,141,184,209, 53, 66, 71, 77, 40, 0, 70,254, 59, 66, 60,172,142,162, 67,214, 59, 63,253,188,248,233,157,
- 76,136,118, 11,245,144,164,215, 7,239,132,104, 23,199, 83,123,162,220,170,125, 24, 13,237, 1,150, 85, 55,158,112,243, 29, 6,
-241, 67, 19,120,211, 77,163,190,229, 23, 29,198,202,234,160,120,175, 15, 56,238,166, 22, 19,118, 85,203,125,174, 42,229,199,101,
- 41,150,198, 34,135,186, 14,100,196, 3, 0,141,183, 54, 20,118,135, 55, 6, 95,215,120,107,166,130, 65,241,131,203,231, 57,106,
-117, 4, 97,236, 29, 58,107, 99,243, 9,202, 90, 84,175, 31, 94, 39,209,203, 62,184, 40,210, 92,191,252, 95,168,171, 29,156, 19,
-143,191,169, 28,181,113,228, 19,199,112,228,217,219, 11,138,116,201, 44, 34,235, 74, 49,141, 82,104, 37,106,250, 90, 26,143, 37,
- 39,125,123,203, 51,158, 32,118,184, 66,200,156, 85,117, 32,232,199, 40,124,165, 72,188, 70, 91, 69,236,229,189,226, 14,148,124,
- 98,227,213,176, 48,191,200,246,214, 38,214,148,196,250,192, 1,104, 2,250,190, 73,162,141, 94,117, 87,231, 23, 70,149,193,160,
-169,106,207,163,223,253, 6,110,237,246,249,226, 7,126,159,217,187, 30,197,238, 95,101,239, 51, 31,100,251,179,127,130,169, 21,
- 39,142,180,249,234, 51,235,112,203, 29,252,193,231,158,224,204,226, 2,175, 62,189,204,133,107, 55, 57,127,109,157,168,213, 98,
- 82, 86, 44,247, 50,242,202,240,252,198,128,212, 43,190,235,212, 50, 11,221,140,143, 61,117,153, 27,195,130, 71,206, 29,225,169,
- 75,155,220,181, 50,195,141,221, 17,243,189,140,157,193,152,187,207, 28,229,147, 95, 61, 79,167,157,178, 61, 41,153, 73, 19,246,
-243,154,251,142, 47,113,254,165,235,156,186,235, 4,113,156, 97,140,220,237,246,110,110,112,236,216, 60,199,238,123, 13,227,205,
-107,204, 28, 59,139,138, 51, 76, 62, 18,129, 87,218,150,160,135,170, 38, 74, 83,116,214, 70,121,141, 51, 18,150,144,116, 50,108,
-149,163, 85, 68,156,181, 80, 90,179,123,229, 18, 51,171, 71,216, 58,255, 34,202, 67,214,239,113,254,243,159,103,241,244, 26,144,
-162,124, 77,107,118,137,205, 11, 23, 81,113,204,112,107, 27,107, 5,138, 81, 85,134,170,170,137,116,202,252,234, 42,187, 55,118,
-201,243,117,210, 86,135, 86, 39, 67, 69, 25,198, 84,116,103, 22,153,236,111,208,153, 93,102,127, 99, 11,175, 12,222, 24,146,110,
- 15,111,170,176,174,139,232,206, 47,160,116, 74,123,102,150,253,157,235,104, 29,209,106,119,105,247,231,169,170, 28,147, 23, 28,
-187,231,126,138,253, 93, 54, 46,126,147,197,163,167, 88,189,227, 94,210, 44,163,204,135, 88, 91,179,118,199, 61, 12,214,175,211,
-234,245, 25,109,239,145,116, 50, 90,157, 14, 81,214,193, 57, 67,146, 68,196,113, 34,197, 3, 33, 34,121,231,169, 6,215, 25, 62,
-251, 37,146, 44,198,213,142,209,205, 75, 92, 43, 42, 9,239, 10,111,219,251,206,222,202, 79,190,237,135, 57,154, 36,188,241,212,
- 41,254,228,133,111, 76,239,236, 26, 37,164, 57, 47, 63,110,167,144,182,228,213,152,182,244, 52,157,173,129, 68,197,137, 34, 75,
-181, 32,103, 35, 77,164,161,158,120,121, 30, 4, 17,174,114,224, 74, 71,188,231,249,250,215, 28, 27, 53, 83,122,218, 56,172,175,
- 82, 45,161, 51, 82, 88, 97, 96, 68, 28,151, 70,242,107,230, 91, 7, 48,172, 91, 59,176,178,214, 99,237,222,179, 76, 54,119,161,
-168,240, 85,133, 29,149,216,194, 76, 7,133, 23, 10,199,157,137,226,221, 75, 3, 62,252, 75,159,226,211, 95,220,227, 11,123,154,
- 42, 82,184, 8, 70, 49,108, 27, 97,226,239,251,192,155,215,138, 36,142, 88,142, 45,119, 46,181, 56,178, 54, 75,255,232, 42,237,
-197, 37,162,246, 44,237,149, 35,180, 79,221, 74,118,236, 20,241,242, 42,106,166, 47,221, 72, 89,224,139,137,172, 19,243, 34,160,
- 88,195,202, 88, 71, 65,101,238,167, 48, 24,149,102,168, 72, 60,235, 42,105,131,182, 44, 31,187,139, 87,236,124,102,234,181,110,
- 64, 27, 13, 67,124, 26,182,226, 57, 88,195, 42,166,241,170,226, 39, 63,224,102,235, 40,136, 18,194,125, 91,135,248,214,198,222,
-164,195,244,115,240,247, 53,240,143, 38,209,173, 17, 99,185,240, 49, 4, 91,148,175,233,221,251,198, 48, 61, 74,206,183, 10,103,
-163,102, 59,208,100,152, 91, 83,163,163, 24,103, 13,245, 36, 15,196, 58, 1,201,104,173,137,146, 88, 50,199,195, 58, 57,138, 98,
-116, 28, 17,105, 45,161, 42, 54,248,171,155,167, 31, 7,130, 63, 97,213,135,213,245, 33,244,102, 20,178,187,149, 86,146, 20, 24,
- 69, 83,127,191, 53, 70,148,248, 38,196,183, 86, 34,118,139, 18, 1,221,168, 36, 10, 91,227,208, 16,132,226,228,144,134,193, 59,
-137,114,117, 83,198,187,155,126, 14,197,154, 30, 78, 28, 8,169, 78, 55,160,155,208, 12, 43,229,131, 86, 1,177,249, 58, 66, 8,
- 77, 88,191,199, 17,157,209,206,212, 46,166,194,231,131, 64, 2,124, 25,208,165,185,157, 59,127, 32,100,115,246, 91, 10,250, 33,
- 26,156, 58,184, 55, 79,163, 84,191,109,253,238, 15,221,211,141,116,231, 62, 40,220,155, 66, 94,150, 7, 1, 45, 13,101,175,129,
-229,148, 5, 62, 12, 51, 1,137, 40,155, 36,165, 14, 53, 47, 72, 97,119,114, 98,113, 38, 88,238,194,153, 41,202,218,232,180, 37,
- 13,113,218,194, 78,198,232,158,164, 95, 54,194, 64, 21,160, 91,162,132, 79,185,122,249,163,161,129,130,201,200, 49, 30, 58,242,
-202, 49,216,151, 59,120, 89,202,157, 59,138, 37,217, 45, 73, 21,113, 16,213, 17, 94, 62,251, 3,199,230,134, 39,159,248,208,171,
-120,202,176,148,144,105, 94, 4,167,218, 42, 18, 52, 29, 52, 29, 21,209, 66, 97, 14,105, 24,180,130, 8,129,109,189,246,177,215,
-242,192,125,247,114,207, 61,119,115,247, 61,247,113,239, 61,247,241,196, 19, 95,159, 10,230, 84,208, 19,198,165,177, 88,175, 56,
-121,242, 86,138,124,135,108,116,153,151,190,248, 18,179,186,199,159,252,218,127,230,117,127,247,175,177,246,246,247, 18,149, 3,
-174,254,199,255,194,199,126,227,203,220,179,112,146,223,248,203,199, 33,138,169,117,196, 7,158,188,192, 15,220,182,198,137,153,
- 22,159, 95, 31,241,244,122,205,137,197, 57, 30,108, 69,252,233,249,117,158, 84, 3, 74,165,232,225,121,245,217, 35,248,218,240,
-155,127,249, 77, 30,123,197, 49,250, 89,202,169,190,101, 60, 41,184,101,101,134,103, 47,174,243,214,251,207,241,151,223,188, 76,
-156,182,168,172,167,155,106, 94,218, 24,208,110,167,236,111,108, 19,103, 25,160,152,140, 38,228,149, 33, 65, 97,202, 9, 73,214,
-145,233, 91, 41,161, 49, 57,133,169,114,162, 36,166, 28,237,147,246, 79, 96,234,240, 48,168,192,150, 5,113,183, 77,218,202,100,
-237,220,233,227,202,130,221, 11, 23,200,122, 45,178,110, 70,171,223,102,231,234, 58,115, 71,142,178,115,249, 34, 43,183,221,199,
-222,181,139, 68, 55,174,179,117,229, 60,253,133, 37,188,133,164,213,162,178, 21,219, 87,110, 48,115,100,142,172,223, 99,227,202,
- 21,122,243,115,108, 94,186, 73,178, 20, 99, 74,139,181, 57,249,126, 65,210,217,166, 59,187, 68, 62,222, 39, 73, 34,122,157, 25,
- 74,165,168,135, 19,234,122, 64,146, 46, 81, 84, 99,242,253, 13,122,243,231,136,146,152, 56,105, 73,234,147,110, 99,234,154,229,
-147,183,113,243,252, 83,212, 69,193,100,119,155, 72, 41,226,172, 79,177, 55, 4,111, 41,246,118, 81, 58,166, 46, 74,170,193,136,
-206,220, 60, 43,231,206,177,123,237, 50,179,107,107, 50,201, 68,169, 52, 36,113,138,181,150, 52, 77,228, 70, 27, 41, 38, 55,206,
- 51, 28, 12,233, 44,175, 80,232, 49,111,234,204,241,165,237, 33, 62,128,103,140,243,188,251,225, 55,176,125,227,138,216, 93,119,
- 54,136,155,116,196,192, 66, 54,129, 44,167,156,128, 25, 90, 29, 39, 23, 54,109,233,247, 35, 92,192,201,166, 94,238,130,101,225,
-165,227, 13,214, 14,237, 21,190,114,104,231,101, 37, 31,238,189,234,138,101,163,130,110, 34,171,244, 81, 24, 42,218,145,120,211,
-173, 15, 43,119, 15,203, 45, 41,230,214, 65, 79,195,184,146,194,110, 60,244,187,154,199, 63,121,129, 87,190,239,251,136, 34,141,
-109, 73,225, 76,103, 82,226,157,136,158,177, 12,246,225,150,182,226, 27,185,231,167, 63, 58,224, 61,119,118,216,223, 40,136, 75,
- 24, 57,207,142,241, 76, 60,140, 61, 76, 66, 44,137,241, 48,118,158, 62,112, 91, 47,226,232,114,135,222,210, 12, 89,127,129,108,
-102,145,236,248,105,146,165, 21,244,236, 34,244, 58,178,238,172, 10,168,114,252,100,132,173,114, 92,153,139, 79,121,106, 47,107,
-188,224,200, 58, 55, 10,115,157,169, 65, 59,116, 58, 47,239,236,214, 28, 94, 45, 72,242, 86,160,152, 57,235,209,113,184, 81,198,
- 7,182, 69, 29, 86,197,226, 4, 11, 92,241, 38, 26,202,137, 40,174, 41, 56, 82,236,157, 40,228,157, 23,143,185, 53,232,144, 31,
- 46, 5,223,162,226, 88, 78, 29, 28,162,176,133, 66,238,188, 67, 43, 11, 42, 66, 97,177,147,125,156, 49,168, 88, 54, 9,182,174,
-209, 73, 58, 45,158, 58, 73, 73, 59, 29,172,173,240,101,129, 69, 60,227, 77, 98,163,214, 26,175, 35,226, 36,150,166, 71,213,225,
-254,169,112,182, 34,206, 18, 89,165, 6, 97,155,173,205,180,135,113, 58,232,194,144, 73,186,121,192,187,160,124, 86, 78,164,197,
-206,134, 25, 63,172,222, 81, 30, 99, 44,174, 18, 69,189, 41, 75,140,147,201, 17,149, 16,225, 66,118,188, 59, 64,198,123, 11, 58,
-104, 0, 28, 88, 91, 19,197, 73,176,248,217, 41,236, 71,225,167,195,175,115,193,239,223, 8, 16,195,154, 63,138,195,230,196, 49,
- 21, 24,250, 96, 47,180,182, 34,210,201,180, 72,215,227, 33,186,215, 11,193, 53,242,251,146, 40,158,230,185,139, 34, 60,188,161,
- 85,124,192,127,110, 38,106,107, 27,214,243, 1,181, 77,249,111,185,177,235, 32,172, 83, 7, 29,118,147,174,214,172,221,157,196,
-193, 82,215,210,193,231,121,176,172, 21,184, 60, 71,181, 18, 48, 6, 87, 84,168, 52, 70,107,209,102,184,170, 66,167,226,170,105,
-154, 21, 9, 20, 34,144,249,106,108,195, 65, 8,241,206,222,129,171,106,220,100,136,139, 37,230, 87, 39, 9, 36, 41,218, 89,252,
- 96, 23,181,116,228,144,234, 95,130,123,156, 53,204, 47, 63, 70, 62,246,164,137,216, 18,247, 7,150,189, 61,139,177,142,124, 44,
-231,179,218, 31, 90,108, 52, 58,194,248, 0,211, 90, 15, 29,131, 93, 79,145,135, 41,189,150,181,125,179,154,111, 2,228, 60,138,
- 86,164,192,200,247,189, 68, 99,106, 79,229, 60,198, 90,148, 22,187, 91, 28,174, 56, 31,252,173, 15,160, 34,153,168, 28, 80,212,
-211,240,196,105,255,100, 29,232,202, 27,140,179,228,227, 29,138,114,196,140, 77,120,238,194, 22, 79,220, 92,231,137, 27, 99,254,
-248, 3, 31,231,194, 31,126,146,171, 79, 95,227,196, 99,111,228,187,126,228,157, 60,248,174, 31,224, 39,223,114, 23,223,123, 98,
-158,119,156, 93,224,150,163, 75,108,150, 53,255,254,137,139, 44,116, 82,222,124,118, 25,106,199, 11,219, 35,222,114,106,153,133,
- 86,194,151, 46,111,241,212,198, 30, 30,168,149,231,199, 95,127, 23, 69, 81,242,169, 75, 91,228,237, 54,115,115, 61,158,219,158,
-160,210,136, 43,219, 35,238, 63,115,132,213, 94,202, 94, 93, 17,197, 9, 46,139,185,144, 91,158,248,220, 87,209,145,163, 24,239,
- 17,197, 30,167, 52,149,169,112,222, 18,183,103,209, 89, 23,103, 42,177,185,196,145,100, 8,231, 19, 58,139,171,120, 60, 81,148,
-128,245, 68,237, 30, 73,183,135,138,219, 20,195, 33, 73,167,199,120,253, 10,166,202,153, 89, 93,166,213,155,161,202, 39,164,221,
- 30,163,205, 45,242,241, 46,115, 71,142, 49, 25,108,211,155,159, 67,165,179,204,205,205,177,116,226, 36,163,193, 46,222, 59,116,
-148, 50,186,185,193,218,153, 51,140, 6,187, 88, 91,147,244, 58,168, 36, 35, 78, 91,212, 6,210,172,143, 78,103,240,213,182,196,
-142, 70, 25, 73, 47, 65,183,122,184, 81,137, 87,178, 18,236,204,205, 16,235, 25,234,114,159,241,254, 6,173,206, 12,117, 93,226,
- 48,180, 91,109,242,253, 77,218, 11, 11, 84,229,152, 52,237, 48,220,184, 70, 54, 51,195,236,210, 9, 70, 27, 55,240, 56,138,253,
- 93,230,214, 78, 72,248, 68,162,169, 70, 35,136, 60,173,110, 15,188, 36, 15, 69, 90,139, 48,172,121,129, 55,221,184,135,226,234,
-243, 92,123,252,203, 88,175, 72,226, 12,250,243,180, 7,226, 17,143,128,133, 78,135,201,104,130,170, 39,120,111,217, 92,223, 66,
-133,120,211, 88, 73,193,208, 22,108, 1,213, 4,138,137,103, 52,176,228,133,195, 76, 60,147,137, 5,237,228,243, 16, 43,218,109,
-153,160, 76,160, 35, 53, 89, 15,218,202,218, 29, 11,149,245, 84, 10, 54,118,101,205,253, 82, 14, 87, 10, 89,187,143, 29,236, 84,
-144, 91,249,111, 24, 59, 41,230,185,147, 58,214,137,165,216, 30,235,200,243,121,100, 96, 96, 60, 23,215, 43,201, 81, 12,159, 3,
-157,197,196,105, 76,167,155,208, 75, 99, 86,231, 18, 78,117, 99,214,186, 17,221, 4, 94,204, 61,157, 44,102,162, 97,228, 21, 70,
- 41, 10, 20, 37, 98,147,243, 10,170, 84, 51,113,240,214,142,225,161, 51,125, 78,223,119,134, 99, 15,127, 23,139,175,126, 45,179,
-223,253, 54, 90,175,184, 29,189, 56, 3, 20,176,119, 13,182,175,225,246,110, 96, 7, 59,216,124,140,203, 71,248,224,103, 22,222,
-186,168, 95,189, 62, 80,138,123,219,124,181,226,144, 42, 33, 77, 84,161, 87,248,201,185,101,178,219, 31, 58, 16,184,133,198, 64,
- 10,189, 66,163, 2,110, 85, 26, 46,225, 76,203,109, 93,169, 38,221, 77,138,185, 40,226,133,235, 78,152, 50, 9, 83,161, 82,209,
-212,210,229,141,153,230,170,171,102,138,114, 1, 20, 20,192, 48,202,135, 31,187, 90,234, 66, 93, 99,139, 97, 72, 67,137, 2,254,
-181, 10, 19,171, 76,198,186,213, 22, 21,123,156,136, 47, 56, 8,171,148, 82,104, 29,211,157,157, 37,233,117, 15, 68,101, 74,161,
-163,132,164,213, 22, 49, 90, 36,249,241, 83,210, 94, 8,219, 16,182,166,155,194,113,252, 97,230,186, 11,197, 67,107,162, 56,146,
- 70,202, 56,208, 2, 20,177, 86,238,215,117,145, 79, 9,119,246,240, 45,218, 57, 92,101,194, 61, 60,216,145,234, 58,132,192, 4,
-212, 43, 97,171, 96,195,246, 66, 41,137,239,156, 78,243, 1,221, 29, 52, 16,206,155, 3, 43, 93,243,191, 0, 76,170,107, 59, 93,
-241, 59, 37,226, 57,111, 45,118, 82, 96,138, 9, 85, 62,193,212, 5,245, 96,135,106,103, 11, 70, 3,152,140, 68, 17, 94, 79,130,
-133,172, 10,208,151,234, 80, 94,121, 37,107,114, 27,252,227,254,144, 95,221,219,151, 39,169, 53, 43,123, 87, 7,171,218, 33, 90,
-156,179, 7,160,152, 60,135,201, 16, 63, 26,224,203, 2,133,195, 12,246, 48,227,137, 88, 24,247,247, 48,147, 49, 84, 53,190,174,
-177,121, 33, 27, 8, 43,141,131,107,196,128,193,254,167, 2,204, 72,249, 70, 34,233, 3,216,199, 96,138, 2, 55, 30, 75, 3, 17,
- 39,232,197,229,151, 5,187,248,201, 8,182,183,167,228,192,118,123, 9,235, 60,101,110,201, 39,142,209,190, 99,119,199,113,227,
-154, 99,107, 3,198,195,240, 41, 10,182,250,170,106, 78,136, 80, 86,142,114,226,200, 11,207, 36,135,253,161,151, 0, 42, 43, 44,
- 28, 83, 11,177, 14,171, 80, 33, 51, 67, 43,232,164,138,110, 28,209,141, 53,153, 86,116, 18, 69,150,200,217,178,209, 49, 58,235,
- 41,107, 57, 51, 26, 39,223, 55,226,204, 41, 50, 34,108, 42, 99,235, 61, 73,234,216,218, 93, 71,227,233,222,246, 16,175,248, 46,
-197,187,126,229,251,249,189,159,248, 89,254,237,151, 94,228,183,158,253, 36,111, 56, 62,203, 71,158,187,201, 63,248,161,215,242,
-204,141,167, 57,125,114,133,135, 31,125,128,231, 94,186,202, 27,206,174,240,141, 27, 91,252,216, 99,119, 51,174, 29, 79, 95,217,
- 96, 38, 82, 44,205,164,124,242,218, 54,195,188,100,190,221,102,125, 92,178, 89,108, 49,223,110,241,149, 27, 47,113,100,190,199,
-253,167,150,121,230,242, 22,235,147,138, 59,150,103, 24, 43,207,182,205,217, 28, 71,172,206,116,184,179,219,226,234, 94,193, 78,
- 81,176, 58,211,230,249,235, 59,188, 90,165,120,213,194, 89,137, 41,180,149, 40, 53,189,149, 67,133,111,248,192,113,130,210,137,
- 60,168, 90,125,204,254, 54, 58, 77,209,145,162,216,217,162,206,115, 58, 26,226, 78,155,106, 60, 32,155,153, 99,243,226,121,150,
-207,156,229,133,207,126,154, 91, 31,125,140,107, 79, 61,141,110,105,138,193,152,180,221,101,255,242, 58,253,213,121,182,175, 94,
-103,110,101,141,107,223,188, 76,167,147,209, 93, 90,224,202, 83, 23, 57,251,224,221, 92,123,225, 34, 85, 49,162,149,181,217,223,
- 94, 39,202,192,121, 67, 49,153,128,218, 35, 77, 61,179,171,167,168,203,148,114,176, 77,127,101,142,225,214, 30, 73,150, 82,238,
-239, 16,181,219,100,189,101,174, 63,255, 28,243,199,150,136,116,194,104,103,157,181,179, 15,179,123,243, 89,116,156,128, 82, 12,
- 55,214,177,117,205,104,111, 3,175, 45,221,217, 53,210,153, 30, 42,213,148,227, 49, 62,240,180,139,189, 1, 11,167, 78, 51,188,
-113,147,201,246, 46,113,146,200,138,211, 67, 49, 25, 81, 23, 19,230,150, 87, 14,108, 75, 97,189, 30,107,153,230,242,205, 77,178,
-118,196,220,109,103,240,191,255, 53,212,172, 60,187,142,247,231, 41, 39, 99, 34, 44, 9,138,141,241,136, 52,168,218,227, 96,123,
-115, 78,216,240, 88, 79, 61,129,220,123,108, 71,203,196,150, 40, 20,154, 56,213,164, 25,100,237,132, 36, 6, 83, 59, 90,145,194,
-185,136, 36, 18, 18,153,115,158,202, 59,233,253, 29,220, 68,214,236, 39, 58,176, 87,201,155, 35, 15,176,176,149, 4, 38, 30,250,
- 41, 88,167,216, 46, 60,186,134,249, 12,226, 22, 92,201,161, 23, 54,192,223,220,243,180,198,134,193,214, 46, 81,146, 80, 15, 71,
-168, 52, 35,233, 84,244,142,244,130,133, 11, 90, 89,196, 67,145,108,199, 63,117, 33,231,157,183,119,200,199, 14, 27, 59, 38,181,
-164,202,149,120,118,209,108, 20,142,119,173,182,248, 59,223,127, 59,167, 95,247, 32, 11,119, 63, 72, 52, 51, 47,221, 73, 89,227,
- 7,151,241,102, 50,181, 22,121,149,224,181, 64,135,132,146, 22,204,255,222,225, 76, 40, 56, 74,139,144,208, 40,188,146, 98,170,
-130,210, 91,244,110, 17,180,102,136,151, 31,224,127,249,158, 55,241,113,167,248,233, 23, 47,209, 5,161,150, 77, 89,238,178,118,
-245,138, 67,109,126,216, 2, 52,188,109,149, 4,191,183,132,183,200, 10, 93, 77,197,201,205,134, 64,148,230,225, 22,175,226,198,
- 68, 29, 20,230, 77,253,116,193,250,168, 15, 30,190, 1,210, 65, 32, 57,150, 87,158, 39,190,227,149,224, 3,146,184,174,240,214,
- 76, 55, 1,104, 77,164, 91, 1, 50, 83, 79,167, 94, 21,124,243,196, 17, 90,123, 92,160,103,201,160, 24,116, 8, 72, 3,162,117,
-132, 11,129,193, 74, 71,225,174, 29, 10,245, 20, 83, 43,183,120,165, 84,184,207, 26, 72, 35,153,170,148,216,154,168, 17,226,157,
- 1, 83, 87,210,136, 52, 22, 41,239,195,246, 43, 10,108,115,113,216, 4, 9, 97, 16,161, 73,128,139, 68,214,134,207,183, 14,244,
- 54, 29,133,207,249, 1,129, 85,104,179, 33,211,157,176, 95,117, 90, 16,162,234,224, 12,162,148,220,232,181,142,193, 90, 92,172,
- 5, 97, 26, 43,236,104, 2,253,126,208,167, 84, 48,218,147, 30,170,149,202,118,195,246,160,229,100,106,143,226,131,169,124,234,
- 4, 8,104,216, 40, 9,103, 11, 29, 62,190,224, 51,159,158, 50, 14,111,232, 27, 95,125,168,126, 58, 58, 80,133, 21, 99,236,254,
- 8, 91,149, 97,250, 14,201,122,117,133,106,165, 96, 42, 76, 94,160,226,132, 72, 75, 19, 23,153, 8, 84,140, 15, 52, 58, 63,205,
- 86,247, 47,211, 22,136, 82, 93,194,113,240, 21, 42,169,228,246,158,231,168,254, 76, 0, 86,244,240,206,192,112, 8,219, 91,112,
-233, 42,254,238, 59, 81,139, 75, 36,105,151,186,138,113,153,195, 20,142,193,190,103, 52,134, 97, 14,229, 68,174, 6,161,180, 76,
- 11,174,181, 1,132, 5, 24, 45,233,148,249,196, 81,215,161,167, 14,162,125,121,121,202, 38, 35,110,150, 27,141, 20, 62,108,203,
-146, 72,113, 16, 39,115, 32, 72,205,235, 32,135, 64, 28,122,141, 22,209,187, 41, 10, 98,218, 92,196, 94, 43,137,123,211,160,156,
-166,211,155,199,181, 75,134, 23,159,225,149, 63,252, 58,146, 94,159,127,252,137,175,241, 19,255,243,223,228, 47,255,193,175,147,
-160,184,180, 55,226,215, 63,247,204,244,235,216,209,144,197, 9, 95,190,188,205,184,182,244, 98,205,177, 94,202,137,133, 25,254,
-218,237, 39,232, 70,240,153, 23,111,176, 89, 58,246,198, 5,214, 24,110, 89,154, 97,115,103,200,239, 93,217,228,236,242, 28,111,
-189,101,149,175,221, 28,130, 82,108, 77, 42, 78,207,205,179, 50,119,147,205,170,102,101,105,158,157, 97,202,238,164, 98,223, 58,
-158,121,234, 89,206,158, 61, 65,173, 68,185,170,147, 22,174,174,104,205,174, 30,172, 15,241, 68,105, 70, 61, 28,136,133,170, 46,
-240,120, 76, 57, 1,171,104,205,204, 50,220,218,161, 61, 95,147,102, 25,187,235,235,116,102,250,120, 3,227,221, 29, 90, 89,139,
-201,254,144,124, 52, 32, 77,186,180, 98,197,104,119,192,104,176, 67, 54,219,165, 24,237,179,175, 29,198, 79,152, 91, 92,102,111,
-125,135,164,229, 41,234,154, 56, 74,217,185,114,157,213,179, 43,196,173, 53,146,120, 76, 28,119,240, 46, 33,223,189,193,145, 51,
-183,224,125, 74,158, 15,101,109,170, 82, 84, 58, 64, 69,125,170,226, 26,189, 46, 56,163,104,117, 34,176, 41,113, 71,138,250,169,
- 7,239,226,242, 51,127, 78,127,229, 20,229,222, 6,113,156,176,176,118,134,124,119, 11, 87, 91,230, 78, 29, 37,237,116, 80, 90,
- 9,222, 54, 73,193, 41,121, 8, 89, 71, 54,211, 15,180,173, 68,132, 62,129,134,149,100, 93, 17,217,120,137,117,117,117,152, 72,
- 38,251, 44,158, 60,198,112,123, 64,178, 58,135, 51,142,181, 36,226,186,117, 36, 10,206,204, 45,224, 76, 65,172, 45,182, 44, 24,
-216,130,182, 82,152,224,205,117, 86,238, 65,222,122,116, 44,183,162,220,133,113, 77, 67,145, 40,210,150, 34, 73, 53,113, 34, 55,
-118, 29, 43,178, 56, 2,167,197,143, 94, 6,203,142,145,217, 77, 43,133,137, 61,203, 71, 20,209, 11,158, 43,185, 24,100, 26,161,
-108, 28,193,182,133,173,137,252,253,247,173,181,121,253,253,139,252,200, 15, 63,194,147, 95,122,158, 95,254,205,175,115,108, 22,
-250, 73, 88,209, 71, 48,208,240,226,227,231,185,245,254,179,212,197, 4,103,106,162, 94,151, 22, 30, 95,148,196,169, 34,205, 13,
-105,166,105,197,154, 91,231, 99,190,112,173,164,211,143,217, 24,122,198,214, 49,114,138,101, 15,127,239,225,101,126,244,191,254,
- 49,201, 98, 13, 87, 47,224,214, 47, 99, 7,187,248,225, 64, 44, 80,182, 20,159,183,146,181,180, 87, 26,180, 9, 55,104,145,175,
-202,228,235,197, 14,134, 15, 28,239, 8, 76,130,143,133, 24,166,106,131,143, 82,148, 78,209,221,101,116,103, 14,235, 45, 23, 30,
-255, 40,255,250,227, 79,112, 28,120,246,233,175,241,170,183,188, 5,115,241,233,169,182,201, 91, 27,238,199,118,154, 28,230, 27,
- 43, 67,152,178,189, 49, 16,133,123,122, 19, 8, 18, 80,158,222, 25,233,114,100,239, 47, 73,110,141,221, 72, 53,150, 46, 41,162,
- 62,216, 35, 60, 90, 50, 20,132,237,139,142, 99,156, 49,232, 56,198, 91, 79,241,252, 23,233,222,241, 32,168,136, 72,199, 84,174,
-198,155, 74,232,113,206, 4,209, 83,130,210, 81, 72, 97,147, 38, 70, 28, 98, 65,148,161, 98, 81,199,251, 92, 68,126, 81, 44,247,
-251,192,102,240,166,154, 50,195,157, 59,216, 56,120, 99,241,145,150, 48,149, 0,118,113, 97,203,228, 76,133, 47, 37,100,133, 36,
-149,169, 49,172,197, 61, 14,231,165,184, 88, 35,194,142,131,220,121, 31, 8,119, 33,165, 77,107,148,181,146,225, 30,232,115,178,
-149, 86,211,201,210,163,160, 62, 8,150,105,104,112,205, 68,175,144,102,217,151,181, 52,228, 73, 60,253,103, 40,127,128,178,245,
-146, 23,175, 52, 24,107,195,246, 66,220, 11,186, 81,194, 56,133,247, 21,182,180, 56, 29,163,109, 77,100,186, 2,165, 73, 93, 48,
- 66,171, 3,194,137, 59, 20,188, 18, 16,181, 52,167,160,195, 74,119,117,200,162,214,192,247, 27, 95,152, 11,147,127, 93,225,135,
- 67,170,193, 46,166, 10, 44,246,128,243,197,131,170,170,131,188,122, 43, 80,160, 40, 73,165, 40, 54,218, 64,235, 69,131, 84, 75,
- 70, 64, 19,127, 43,104, 97, 43, 74,248,160, 77, 80, 86, 50,234, 85,154,200,250, 47, 77,153,222, 8, 77, 77,253,197, 47, 18,245,
-123,178,181, 10,205,109, 20, 39,114,210,156,200, 10,125, 50, 22, 59,154, 9, 65, 85, 10,217, 44,106,237,167, 30,113,135, 20,115,
-173, 69, 20,103, 92,248,186,134, 15, 95,251,166,176,171,112, 94, 9,171,119, 39, 89, 6, 85,228,136, 93, 32,212, 77,157, 12, 18,
-196, 84, 91,143,241,112,203,185,179,188,246,181,175, 36,205, 50,172, 87,228, 69,197,127,252,205,223, 66, 7, 70, 81,195,123,138,
- 21,146, 40,163,195,223, 26,247, 50, 94,252,226, 19, 60,255,251,159,226,150, 89,184,113,179,166, 44,114,218, 45,197, 32,202,120,
-255,151,159,231, 27, 59,251, 66, 43, 10, 39,166, 78,150,177,152, 40, 30, 60,121,132, 79,189,120,141,185, 52, 98,175,118, 92,185,
-186,197,248,165,155,172,246, 51, 30, 88,158,227,193,153, 54,145,130,167, 55, 71,108, 12,199,220, 50,223,229,109,183,173,240,249,
-235, 67,126,239, 27,215, 89,238,164,236, 21,134,149, 44,225,123,238, 61,197,205,209, 38,145, 83, 12,205, 14, 38,118,232, 56,226,
- 68, 39,230,197, 75, 79,178,186, 60, 27,214,180,134,178,168,192, 20,210,181,235, 8, 48,168, 36,149,104,194,172, 67,212,238, 80,
-238,108, 17,247,103,193, 90,242,225, 54,233,236, 34, 73,164,240,214, 16,101, 61,182,207,191,132, 59,177,130,138, 60,123, 87,174,
-115,252,190,251,184,248,149,167,232, 47,206,176,191, 57,100,118,237, 8,155, 87, 55,233,205,182,176,214,146,101, 25, 30, 77,130,
-162,174, 61,219,151,110, 64,188, 67,127,246, 36,181, 27,208, 95, 60,137,194,145,239,238, 17,117, 28,197,100, 68,150, 69,180,142,
-156, 68, 69,154,178,168,193, 64,154, 41, 38,163,125,210, 36,163,172,198,212,166, 38,235, 47,178,179,126, 9,167, 82, 76, 61,196,
-251, 57, 34,157,224,234,146,118,127,150,200, 69,196,237, 30,149,169,137, 90,109, 6, 55, 46,144,182,187,244,215,142,163,188,165,
-213,235,225, 76, 65,150,205,210, 89,153,103,120,253, 6,221,249, 69,218,115, 51, 76,246, 6,242, 32, 86,130,158,140,146,132,186,
- 44, 14,238,162,190,133, 11, 28,246,114,176, 75,123,113,158,253,237, 77, 22,150,103,153,140, 74, 30, 56, 62,203, 53,187, 75, 26,
-105,142,247,231,160, 42,240, 89,130, 31, 15,185,126,125,155,172,163,169,189,248, 56, 29, 94, 32, 50, 74,161,157,172,144,156, 85,
- 20,149, 71, 37, 80, 20,142, 86,169,104,117,132,159, 30, 39, 17,113, 28, 76,107, 70, 77,211, 88, 76, 41, 27,102,109,229, 88,237,
- 12, 84,177,162, 8,154,152,110, 12, 57,178,118, 79,128,141, 49,252,234,251, 30,230,213,175,185,157, 52,203,200,139,146,225,222,
-128, 87, 62,116,142, 15,221,113,148,127,254,239, 62,205, 83, 87, 39, 44,245, 96,179,130, 94, 15, 62,242,167,223,224, 31, 62,118,
- 7,227,253, 25,212,100, 52,189, 47,183, 42,139,142, 75,146,196,208,238, 38,244,231, 91, 44, 15, 42,206, 29,201,216,221,173, 97,
- 53, 35,237,104, 78,158,156,227,142,159,251, 37,146,219,222, 66,245,229,223, 98,242,169,111,162,235, 33,166,242,148, 58, 34,238,
-247,137,211,150,124,238,243, 28,159,102,104,231, 32,109,201,165, 83, 69, 83,192,138,194,203,180,110,188, 76,180,141, 3, 40, 40,
-110,209,145,132,242,116,230, 80,157, 69,116,103, 14, 63,217,198,235,121,142,221,253,118,250,192,145,118,204, 63,251,203, 13,222,
-127,250, 89,122,169, 70,187,112,219, 12, 54,174,102, 5,233,172,147, 98,232, 36,227,218, 71, 81,160,202, 57,129, 58, 73,133, 22,
-241, 82,227, 67,244, 77,146, 89,184, 55, 59,185,187,170, 38,151,119,122,234, 53, 77,130, 73,104, 36, 2,132, 38, 4, 82, 55,141,
- 69,113,237, 5,240, 50, 33,122,107,131, 77,204, 6, 14,130,199, 86, 5,206,121,226, 36, 22, 52,103,243,128, 87, 58,188,134, 83,
-217,106, 40,136,166,113,168, 86, 44,144, 49,193,231, 47, 55,111,157,196,216,170,154, 82,220,124, 16, 87, 73, 16, 99,160,216, 89,
- 47, 25,220,210,209,200, 68,223,136,177,234, 90,138,120, 67,136,115, 34,234,116,161, 17,147,251,130,199,225, 66,227, 28,132, 95,
- 40,188, 82,210, 68, 52, 73,106,110,154,156, 19,126,111, 72,153,139, 91,146,181,110,106,116,154, 4,146, 99,133,178, 26,111,106,
-209, 4, 25, 67,148,181,130,112,172, 41,116,130,106,214,234,224,254, 92, 79, 10,116,127,134,168,149,128,171,209,173,118,152,208,
-147, 80,252,197, 97,226,202, 9, 9, 14,232,136, 54, 34,110,238,231, 28,162, 78,185, 67,183,245, 38,232, 38,140,173, 58, 4,242,
-124,155,203,205, 30, 96,127,241,208,237,161,244,134, 20,216,178, 10,155,145,112,242, 9, 77,158,172,250,165,192,249, 78, 38, 52,
-169, 38, 46,215,134, 39,139,113,248, 42,128,119,108,141,173,173,252, 56, 8, 23,133,169, 20, 20,242, 42,156, 62,154, 79,120, 20,
- 76,232,237, 14,254,200,170, 32,115,103,103,167,135,105, 83,213,232, 68, 36, 46,229, 4,124, 13,206, 6, 65,162,133,118, 42,212,
-204, 56,134, 86, 11,201, 89,215, 18, 5,109, 45,216, 90, 78, 78,170,209, 70,218, 80,204, 27,137, 66,152,172,149,149, 51,166,115,
- 48, 14, 34, 64, 83,195,164,118, 82,164,131,182,197, 43,143,143,224,161, 71, 30,225, 67, 31,254,175,124,239, 59,223,206, 31,127,
-244,163, 60,242,202, 87,161,131, 48, 79, 5, 56,164, 3,116, 75, 71, 68, 74, 19, 57, 33, 45,169,108,158,241, 48,231,251,223,245,
- 22, 58,183, 61,192,205, 90,179,180, 60,203, 31,126,224, 15,248,123, 15,158,193, 58,197, 7,255,229, 63,199, 3,255,228,239,191,
-151, 44, 77, 88,237,180, 89,159,148,252,238, 83, 23, 68,173,167, 20,166, 54,244,163,152,227,237, 20,172,227,241,107, 91,252,201,
- 75, 55,249,220,181, 93,172, 49,204,198,154,235,227,138, 79, 95,219,231, 88,183,197,155, 79, 47, 48,223,201, 88,238,164, 28,233,
-244, 88, 59, 25,145,249, 8,172, 10,177,114,138,118,236,104,199, 21, 93, 93, 96,203,130,186, 50,232, 36,101,243,230, 14, 81, 28,
-139,237,203, 91, 92, 85,132,219,149,248, 12,109, 49, 65, 37, 9,147,245, 75,232,172, 29,146,149, 44,105,191, 47,170,216,186,102,
-126,237, 8,221,249, 53, 58,115, 51, 20,249,132, 50,175,168,242,138, 40,120, 72,243,113, 78,149,239, 19,183, 50,108,109,177,206,
- 49, 25,238,210, 91,156,103,119, 99,147,153,181, 5,242,145,167, 48,155, 56,111, 73, 90, 9,186,213, 33,207, 7,204, 45, 29,163,
-154, 24,140,201, 81,169,162,174, 93,232,224, 61,113,167, 43,147,180,146,117,120,111,126, 1,155, 39, 76,246,111,176,180,118, 11,
- 42, 78, 41,134, 35,116, 42, 22,166,172,191, 72, 54,211, 71,121,199,112,253, 10, 51, 43,107,108, 92,124, 6,235, 42, 58,243, 43,
- 24,103, 80, 17, 20,163, 17,237,197,101,204,100,194,236,209, 19, 12, 55,215,241, 22, 76, 57,193,228,101,120,193, 57,129,204,196,
-145,144,213,218,109,121,208,215, 53,120,207,222,238, 58,173, 94,143,186,168, 40, 38,251,104, 20, 11, 71, 87,200, 74,104, 59, 77,
-154,246,136,179,182,228, 3,143, 38,104, 7, 93, 47,241,129,190, 14,129, 31,141, 96, 42,208, 31, 35,192, 26,233,106,139, 60,224,
-158,173,220,186, 27,197,113,172, 21, 81, 75, 30,140,214,129, 75,128, 68,161,188, 34, 9,208,142,170,171,232,167,242,236, 25, 91,
- 73, 92,139,181,252, 57,183,175,182,121,219, 95,123, 61,227, 81,201, 96, 48,160, 44, 10, 34, 15,206, 23,216, 8,254,222,219,239,
-228,103,222,126, 11, 51, 10, 94,209,147,223,247,133,231,134, 36,113,141,142, 52, 58,237, 16,165, 45,226, 94,135,120,190, 71,186,
-212, 35, 91,108,211, 89,233, 49,127,164,207,201, 87,204,178,118,124,150, 59,239, 95,224,193,183,222,193,235,255,201,255,198,189,
-255,233,207, 72,102,250,108,252, 63, 63,193,215,254,229,255,205,207,252, 79,255,134,215,188,247,183,120,223,207,125,136,141, 39,
-190, 66,185,113,141,106,127, 11, 59,222, 23, 64, 79, 93,137, 8,206,203,195, 72, 68, 85,213,129, 34,218,131,199,224,234, 66, 94,
-163,129,153,142,206, 80,233, 60,186,183,130,238, 46, 19,197, 45,204,250,139,212,209, 10,241,145,135,232,116, 59,252,216, 59, 31,
- 99,175, 48, 92,217, 41,216,217,217,160,247,186,119,227,194,233, 66, 4,206, 74, 30,124,193,223,229,140, 13,119,220,134,211, 30,
-130,120,236, 1, 22, 85,110,153, 33,182,212,251, 0,250,144,201,223, 53,196,171,218, 30,220,130,235, 16,110,226,100,211, 96,195,
-189,221,155, 48, 89,213,149,248,189,235, 10,234, 10, 87, 78,240,196,225,227,116, 83, 17, 82,148,180,228,190,239,131,207, 60, 20,
-152, 70,136,167,163,136, 56, 77, 14,110,253, 48,205, 92,215, 81, 36,122,129,180, 37, 5,217, 7, 95,121, 29, 88,238, 62, 76,200,
-113, 44, 31,147,151, 61,169,119, 22,235,228,118, 93,151,165, 76,228, 78,244, 13, 62,210,232, 56, 22,144,142, 82,248, 88, 77,129,
- 47, 90, 19, 66, 99, 74,172,169,197,230,230,229,107, 87,215,149,164, 61,218,208, 68,132,175,169, 11,138, 43, 23,254,135, 86,152,
-178,144, 51,131, 21,239,147,243, 6, 91,214,216,170,192, 58,115, 40,240,198, 5, 85,127,211,160,136, 66, 84, 26,163, 10, 21, 39,
- 20,163,241,180, 1,243,206, 73,210, 91, 28,129, 78,136,211, 76,162,167,149,130,218, 98,170,160, 45,113,149, 84,180,166, 32, 55,
-223, 92, 35,158, 11,183,247, 58,248,179,170, 82,138,180,171, 2,182,181, 58, 20,172, 67,168,142,114,134,160,170, 96,105,137,246,
- 76, 87,108, 89,121,142,207, 71,184,241, 24,183, 55,192, 15,247,113,131, 33,126, 52, 66,249, 26,229, 76, 56, 71,200,223,239,172,
- 76,226,120,135, 67, 62, 78,107, 15, 53,103,214, 6,184,145,147,247,145, 13, 77,218, 33, 37,191, 82,177, 52, 95,105, 74,122,242,
- 52,250,200, 17, 84,146,224,189,167, 44, 70, 20,227,130, 58,119, 12,255, 63,178,222, 52,220,178,172, 46,243,252,173, 97,239,125,
-134,123,206, 29, 34,226, 70, 68,102, 70, 78, 36,100, 36,144,100, 2,138, 32,147, 34,106, 41,216,165, 45,106,149,104, 85,151, 72,
- 57,181, 67, 89,104, 89,213,143,150, 90, 5,109, 59,149,138,218,150, 15, 34,206,221, 45, 98,129, 72, 41,130,136,128,128, 80,200,
-144, 9, 57,147, 25,145, 49,223,233,220, 51,236, 97, 77,253,225,191,206,185,129,245,129,135,124,200, 36,242,220,125,207, 94,235,
- 63,188,239,239,157, 36, 98,254, 81,147,131,202, 40, 6, 61, 77, 63,231, 80, 20, 86,144, 72,130, 71, 72, 43,185,192,108,150, 31,
- 89,119,228,248, 91,154,231, 10, 35,197,138, 78, 95,104,217,239,218,196, 65, 19,216,171, 3, 93, 76,168, 36, 26,129,152,235,100,
- 31, 19,243,249,130,182,149, 0,179,232, 3,167, 78,110, 11,133,120, 25, 37,159, 57, 74,218, 90,193,196, 22,136, 79, 46,185,192,
-177, 83,219, 92,250,212, 63,176,215,246,121,215, 35, 87,121,213,151, 63, 15,213, 95, 99,199,148,124,244,252, 37,254,253, 79,255,
- 12, 0, 63,254, 27,111,230, 88,175,160, 9,158,185,139,252,214,191,251, 65, 38, 77, 71,139,230, 41,235, 67, 42,149,168, 19,108,
- 84, 37, 27,189,146, 69,231, 56,119, 48,227,177,131, 57,199,183,214,121,202,169, 77,198,192,133,131, 25, 15,237,183, 52,206,115,
- 98, 88, 81,151, 5,123, 15,223, 79,231, 20, 46, 15,159, 18,138,210,106, 6, 24, 78,216,130,249,227,255, 3, 69,228,248,198,128,
-217,116, 42, 95, 82,155,213,146, 90,163,139, 18, 95,207,197, 83, 90,244,209, 74,209, 63,118, 35,161, 89, 80,142,198, 76,175, 92,
-164,157, 77,241, 77, 71,187,168, 89,204,230, 76, 46, 61,193, 98,127, 66,244,115, 92, 93, 83,246,123,180, 77, 75,202, 21,104,215,
-122,188,139,184,214,225, 67,160,212,138, 54, 56,246,159,220,193, 47,174,209,239,143, 40,236,128,118, 86, 83,246,228, 96,211, 8,
- 6, 53,120,159,199, 62,134,217,222,101,180,113,152, 84, 64,208, 68, 95, 3,100,116,132,220, 0, 0, 32, 0, 73, 68, 65, 84,134,
-118,190, 79,213, 47,241,221,140,225,104,141,122, 90, 19,124, 67,217,175, 88, 28,236, 81,141,199,236, 95,122,130, 27,158,245, 28,
- 46, 61,246, 0, 87, 30,251, 12, 33,120,186,214,113,236,198, 59,105,155, 41,147,203, 23,177,182,162, 26,244,169,214, 6,148,195,
- 49,186, 52, 20,189, 30,139,201, 62,202,150,244,199, 35,124, 23,153, 93,187, 44, 62, 92, 99,113,109,141, 49,134, 72,196,228,228,
-162,221,135,207, 99,251, 67,198, 91, 35,186,197, 33,138,142,245, 91,182,121,218, 98,192, 90, 84, 12,135,107, 40, 21, 72,198,176,
-127,105,151,202, 24,134,104, 74, 52,165,201,248,194, 36,163,115,225,183, 43, 90, 47,214,142, 16, 35,222, 39, 66,138, 24, 43,222,
-116,163, 19,133, 81, 40,157, 50, 26, 58,229, 29,148,236,162,172, 86,226,229,244,194, 9,154,118,114,153,103, 29, 23,133,129,115,
- 51,120,219,175,191,150,107,147, 22,187,117,156, 84, 86,146,142,229, 58,156, 15, 20, 69,226,196, 93, 39,121,202,115, 78,242, 61,
-255,236,121,124,246, 64,196,109,143, 28, 6, 38,211, 22,149, 34, 74, 42, 17, 84, 81, 98,198,107,216,254,144,226,248,136,225,169,
-117, 54,110, 57,206,232,150,211,108, 61,243, 54,110,123,237,247,112,235,127,252,121,214,158,242, 84,210,167,255, 59, 87,254,244,
- 77,124,254, 61,239,227,151,254,224,113,254,102, 39,177, 23, 19, 31,184,236,121,199,155, 62, 67,243,228, 99,248,131, 93,162,111,
-133,126,182,228,108, 43,115, 20, 83, 26,243,193, 28, 3,169,149,132,175,100, 45, 73,151, 36,211, 71,245, 54, 81,253, 99,152,241,
- 49,204, 96,131,212, 44,104, 47, 62, 70,216,126, 17,122,243, 78, 66,215,224,186,150,255,244,230,223,229, 98,130, 83,165,230,141,
- 31,217,101,241,209,119,161,202,225,234,194,138, 62, 44, 87,200,226, 87, 95, 42,172, 17,132, 85,202,123,229,180, 26,157,166, 85,
-215, 38,226,188,124,138, 44,177,177, 57,206, 52, 45, 71,218,164,163, 56,191,180,244, 76,235, 44,252,139,196, 36, 49,170, 41,166,
-188,247, 86,248,131,107, 40, 37, 9,129,228, 92,246,213, 96,250,186,231,115, 36, 57,142,171,188,119,109,139,163,145,113, 18, 28,
-108, 12, 17,141, 48,209, 83,215,202,164, 35, 8,251, 61,248,124, 9,102,116,173, 20, 40, 33, 15, 25, 98,214, 50, 52,153,123,145,
-240,109, 71,202,133, 79,202,255, 92,178,178,127, 79, 93,155,215, 40,249,207,244,185,155,244, 94,138, 37,239, 69,216, 21,147,216,
- 19,131,187, 46,207, 61,235, 15, 98,166,161,117, 25, 33,219, 57,185,184,148,228, 80,248,186, 93, 21,123, 74,105, 17, 44, 42, 37,
-221,124,138, 34, 28, 84, 41,103,197,135, 28,245, 42,133,148, 83, 66,225, 11,157,203,130,189,235,241,168,128, 23, 33,178,238, 9,
- 78, 55,164, 28,119,234,115, 32,202,210, 6,152,215, 32, 43, 85,214, 82, 32, 23,157, 92,218, 62, 95,236, 33,239,205,235,249,209,
-101,222,181, 48, 57,128, 69, 45,127, 86,175, 15, 27,155,244, 7, 3, 6,253, 10, 91,183,152,182,198,204,166,232,201, 20,189,187,
-131,154,207, 81, 62,160,109,145,181, 35,136, 67,161,115,194,208,136, 34,184,140, 81, 58,246,144,194, 17,103, 32,175, 46,150,224,
- 32,212,117,107,128,149, 96,191,148,118,249,198, 27,225,216,137, 21,243,222,185, 5,222, 37, 90, 23,233,186,200, 98,145,240, 78,
-161,162, 32, 90, 43, 35,123,111,197,145,157,223, 59,133,247, 90, 54, 12, 46,209,182,114,185, 39, 45,117,142, 90, 74, 19,148,236,
-202,151, 54,223, 37, 24,175,243, 34,168,235,188,136, 34,151, 82, 6, 89, 3,197, 28,210, 2,143,126,254, 33, 76,101,184,255,179,
-159,225, 91,191,245,159,113,238,220,147,130,249, 54, 34,252, 93,126, 30,107,115,152,124,138, 73,156, 11, 56,238,255,228,227,248,
-113,143,181,238,239,136, 58,242, 7,239,254, 16, 79,169, 20,238,244, 45,220,188, 57, 38,170,200,187,223,242, 38,254,233,191,254,
-110,250, 42,113,188, 80,220,253,220,187,177,253,146, 24, 97,218,180, 28, 54,137,187,214,215,168, 99,224,252,188,203,100,174,130,
- 19,131, 62,243, 16,249,196,133, 29, 66,132,123, 78,140,232,138,130, 91,250,154,253,198,243,192,197, 3,254,207,127,245,229, 28,
- 60,254,215,132,164,136, 81,198, 22, 86, 43,170,168,217, 42, 44, 91,214, 80, 68, 79, 59,185, 68, 81,141,153,215, 53,218,150,104,
-219, 35,165,128,233,245, 73, 40, 92, 61,161, 87,108,229, 84,166,136,111, 22, 36,215,209,223,218,228,218, 99,143, 99, 13,108,220,
-114, 51, 23, 63,115, 63, 49,118,140,142,159,225,220,103, 30,228,204, 51,207,114,245,241,203, 76,246,174, 98,251,199,113,126, 70,
- 17, 54,177,202,211, 46, 90,154,102,194,250,214, 41,218,249,132,216,122,110,190,251, 44,135, 87, 47, 98,123, 5,139,131,171, 88,
-187, 73, 83, 79, 24,108,110, 51,216,220,160, 62,156,146,116, 71, 55,169, 81,195,150,114, 48, 34,122,141,238, 59,209, 51, 20, 61,
-217,101,199, 6, 99, 78,114,225,177,251,184,237,158,103,179,216,111, 73,177, 37, 37, 69,179, 56,192,205, 22,212,135, 59,204,247,
-246, 40, 74, 75,185,118,156,122,247,128, 98,109,200,230,205,183,103, 85,113,230, 72, 39,240,243,134,209,182,193, 22,134,106, 48,
- 34,225,241,141,167,158,207,176,121,212, 21,130,135, 0,193, 7, 76,145,171, 72,228, 89, 29, 94, 57,160, 11,142,222,168,162,155,
-238,163,138, 68, 81,173,241,252, 23, 63,157,199, 30, 57, 71,104,102, 16, 26,146, 81, 92,120,226,128,173,129,102, 70,162,210,138,
- 16, 85,182,229, 36,220,242,157,242, 71,165,169,107, 21,131, 65,214, 49,101,120,178,226, 58,230,117, 86, 95,163,147,132,197,104,
- 57,133,140, 75, 84, 94,209,120,197, 51,110, 87,156,127, 48,173,152,199,151, 14,225,221, 63,245, 85, 76, 99, 73,168, 15,104, 30,
-249, 20,221,229, 29,186, 69, 39,123,170, 78, 48,181,213,201, 77,250,103, 78,210, 31, 22,188,225,123,239,229,255,120,227, 39, 89,
- 31,192,235,223,240,151,188,225,245,223,196,206,249,107,104,101, 81, 85,133,238, 10,162,181, 24,163,233,143,135,152,193, 0,165,
- 10,122,207,121, 57,122, 84,192, 35,159, 36, 54, 45,126, 50,161, 26, 24,110,123,225, 93,252,220,109, 27, 92,248,220, 21,246,175,
-213,220,112,178,226,230,151,222,138, 62,125, 59,109, 35, 10, 97,165, 75, 84, 33, 99, 76,149, 2, 41, 26, 72, 78, 70,237,209, 11,
-116, 39,211,230,232,173,163,138, 1,216, 1,170,215,199, 14, 71, 40, 93, 16,174,158,199,233, 53,212,237,223,128, 10, 53,209, 45,
-208, 86, 83,148,235, 20, 39,110,224,238,155, 78,208, 92,219,229,195,143,238, 49,187,122,137, 51,223,242, 90,118,223,249,251,153,
-105, 45, 35,241,228,151, 81,183, 17,101, 69,123,161,148,116,162,164,152, 5,113, 98, 97, 74,193,231,236,111, 17, 61, 98,116,238,
-232, 83,182, 18,201,216, 91,101, 81,159,204, 31, 89, 89,218,146, 79,171,220,118,188,135,194, 74, 71,229, 4, 84,115,240,129,183,
-177,253,170,239, 62, 18,178, 69, 73, 95, 36, 72,199,153,186,150, 16,142, 46, 72,181, 74,112, 23, 5,188,213,154,128,128,102,146,
- 11,168, 74,138,178,216,205, 69,240,150,129, 59,137,163,216,205,152,213,124, 33,248,172, 37,145,203, 89, 72,117,130,182,141, 41,
-171,252,139, 76,165,139, 81,138,161,182,203, 96, 27, 77, 82,138,208,116, 89,146, 16,100,213,177, 76,113, 51, 70,180, 3, 75, 86,
-125, 18, 1, 98,136,203,207,159,208,201, 98,173,206, 17,155, 74, 16,202, 62,228,238, 58,161, 11, 69, 12, 10,141,124, 6,101,133,
-110,167,146, 67, 45, 51,234,139, 50,199,184,202,216, 25,101,161,107,233,186,128,239, 60,218, 77, 81,101, 41,163,107,215, 9,138,
- 55,230, 44,101,165, 86,174, 32, 49, 90,199, 35, 90,172,190, 14, 17,155,215, 44, 43,172,236, 10,239,154,189,129,182, 16,159,160,
-239,160,117, 71, 88, 86,215, 17,234, 57,170,109,208,253, 65,190,229, 2,156, 58, 65,169, 18,122,177, 32, 46, 22,164,186, 38,228,
- 16, 22,213,239, 99, 6,107,232, 94, 95,138, 81, 0, 31, 36,130,214,123,188, 77, 89,163, 18,196,130,232, 5,223,251, 5,193,113,
- 74,180, 28, 43,112,146, 53, 95,152, 68, 71,129,170, 74, 82,225,178,249,194,242,224,125,239,101,177, 72, 28, 78, 35,147,125,185,
-176, 85, 94,129,169, 32, 86,210,136,116,233,206, 75,110, 68, 8,146,165,238, 59, 37, 3,142, 78, 86,132, 75,198,142, 50,226, 51,
- 95, 2,129, 76, 82,121,181, 36, 29,187, 54, 10,111,178, 64, 89, 11,127, 32, 70, 17,229,250,236,228, 65,193,179,239,190,139,199,
- 30,253, 44, 15, 61,252, 16, 15, 62,244,144,108, 53, 76,174, 67,175, 99, 0,217,202, 26,172,146, 20,161,206,123, 92, 59,227,197,
- 47,249, 18, 94,255,214,247,113,174,113,148,253,138,107,179, 5,213, 28,182,143, 59,126,232,219,190,145,135, 30,122,156,251, 62,
-241,247,252,233,175,252, 18,191,250,166, 55,113,223, 99,143,241,216,125, 15,240,200, 3, 15,112,251,198,144,131,174, 35, 69,197,
-253,147, 25,165, 49,140, 74, 1,102,204,186,200,110, 59, 99,173, 44, 24, 90, 75,169,225,252,172, 35,106,205,165, 69, 98,221, 42,
-206,108,142,184,233,184,230,240, 81,131, 79, 98,187,209, 57,164,163,208,154,129, 54,140,108, 65,169, 20,113,114, 30, 61, 60, 65,
-220,186, 73, 32, 28, 89, 17,155, 98,194, 20,122, 37, 10,114,245, 28,136,248,122, 70, 87,215,148,195, 33, 59,143, 63,202, 29,207,
-127, 1,205,100,194,226,112,202,250,246, 49,166,123, 19, 81, 89,215, 13,245,116, 10,193, 97,108, 69,232,162,116, 32,185,163,177,
-166,164,105, 14,233, 50,243, 57,164, 9,193, 37,208,158,168, 60, 90, 7,208, 22,183,168,179,109,165,162, 57,152, 50,222, 62,193,
-254,165,115,244,199, 5,211,157, 75, 12,143,111, 17,154,128,173, 44,135, 59,187,244,215,199,248,208,177,121, 82, 60,198,100, 16,
-200,112,235, 52, 87,207,221,199,228,202, 69,140,177,236,156,123,128,254,104,155,254,218,136, 75,143,125,154,170, 26, 83,142,135,
-184,121,195,112,235, 4,101,191, 66,151, 5,107,227,117, 14,175, 94,226,196,109,183,226,141,167,157, 46,164,235,172, 74,146,247,
- 12, 54, 55,105,103, 11,214, 54,198,196, 38,224,219, 26, 91,148, 50,134, 13, 13,251, 87,119, 81, 81,225,219,150,148, 2,126,222,
- 96,123,138,225,230,136,167,127,241, 51, 9,126, 33,200,202,206,243, 15, 23,103, 60,251, 41, 5, 77, 12,216,164, 88, 90,162, 67,
- 94,181,249,108,157,138, 94,222,105, 95,136,127,179,174, 19,245, 44, 49, 24, 44,163, 45,229, 96, 42, 10, 77,155,167,120, 70, 93,
-247,142,122,208,181,162,106, 34, 91,103, 11,110,127,162,227,225, 90,206,154,167,159,234,243,204, 23,127, 49,123,243,130,246,177,
- 15,210, 60,246, 36,244, 43,116, 81, 80,148,106,165,232,141,251, 51,234,217,156,234,142, 91, 40,202,130, 55,190,238, 94, 94,254,
-115,159,228, 23, 63,118,192, 79,183, 11,121,225,181,100,125,235,129,193,134,138,254,120, 64,177,185, 73,185,117, 10,182,239,128,
-246, 50, 92,201,235,158,102, 65,240,142,242,196, 54,232,136, 25,141,184,235,121,207,146,100, 46,101,240, 78,196, 98,118, 67, 44,
- 82, 90, 27,180, 42, 86,192,139, 20, 90,217,159,107, 72, 46, 8,137, 79,151, 36,221, 67, 39, 75, 82, 61,172, 53, 24, 29,137,211,
-125,226,236, 16,119,226,121,216, 19,119,146,218,125,146, 82,104,221,199,244,202, 85,199,241,159,223,240,227,188,250, 95,252, 0,
- 99, 5,127,244,217,125,126,224,239,223,131, 42,171,149,152, 74, 97,114,108, 99, 60,234,142,115,251,150,194,210,147, 45,123,120,
- 81,188,103,206,110,182, 94,165,156, 47,169,172, 21, 22,188,202, 33, 45, 43, 74,232, 18,164, 34, 29,167, 90, 90,144,242,200, 91,
-103,242,156, 92, 66, 21,110,247, 60, 40,131, 45, 45,190, 19,173, 75, 86,194,201,200, 88, 41,146,119,248, 28,198,100,138, 66,252,
-237,185,229,137,203,236, 75,173, 40,135, 3, 17,155,121,143,239, 58, 18,146,240,103,139,146,174,157, 11,233, 46, 83,242, 66, 43,
-157,106,112, 45,160,178,152,143,213,133,142,151, 11, 61,100,190,248,138,182,178, 36,154, 37, 36, 65, 46,255,189,168,100,221,160,
-140,112,232,245, 50, 45, 61,169, 76, 96,245,248, 54,119,150,202, 80, 20, 50, 21, 11,241,136,222, 22,189,132,169,196, 78, 68,105,
-177, 21,144, 77,210, 10,173, 44, 9, 25,249, 43,173, 4,146, 2, 66,203, 76,160,136,116,115,135,173, 74, 76, 81,226, 6, 35,186,
-195, 67,232,149,232,182, 33, 52,141, 64,184,188, 39, 25, 47,191, 63,155,247,228,230,186,244,180,229,232, 60,250, 35,118,123, 92,
-134,205, 92,143,126,205,255,108,204, 24,215, 37,233,206,183,194, 75,246, 30, 22, 11, 82,211,224, 58, 71,218,219,165,220,216,144,
-181, 74,240,176,190,137,141,137,176,191, 79,208, 22, 19,199,164, 65, 31,181,185,129, 30, 14,242, 26,200,147,148,232, 29,150,177,
-179,218,115, 93,188,108,214, 45,164,165, 19, 99, 41, 46, 92,178, 7,174,251,172, 95, 16,228,178, 60, 88, 4, 90,100,140,230,143,
-223,242,131,172,141, 18,237, 2, 90,119,221, 20, 43, 66,200,129, 42,209, 72,224,138,178,160, 27, 48, 54,225, 26, 88,212, 9,215,
- 66,219, 40, 90,119,221, 88, 32, 55, 40,154, 35,231, 72, 17, 21,149,210,232, 32,105,111,201,228,198, 39,175,113, 74, 45, 86,220,
-194,200, 99, 44, 43,197,254,254, 14,155, 27,199,216,217,219, 21,199, 96, 54,175,196, 28, 81, 15, 75, 57, 68, 52,148, 70,227, 99,
-148,189, 38, 37,167,159,123,150,111, 95,192,238,100,143,127,255,142,191,227,145,183,255, 23,222,240,179,191,199,159, 60,240, 56,
-237, 7, 63,198,199, 31,122,148,173,251, 63,199, 35,191,250, 38,142,141, 6, 92,154,204,248,225,255,245,149,252,246, 59,222,197,
-118, 1,235,101, 73,136, 9,171,161,245,129, 89, 23, 8, 9, 74,163, 80, 49,114,176,104, 40,141,102,173,148,125,110,207, 40,206,
-110, 22,204, 27,207,115,159,251,108,246,239,251, 24, 74, 67,161, 12, 67,155, 8,120, 42,147, 24,107,195,168,180, 84, 74, 98, 58,
- 59,109, 96,126,153, 58, 53,242, 29, 52, 86, 68, 44,209,163,109, 9, 9,218,233, 62,209,121,202,181, 33, 16, 40,202, 10,146, 98,
-188,117,140,181,147, 55,114,233, 51,255, 64, 12,129, 75,143, 61, 68, 81,142,241, 93,205, 98, 90, 83,207, 14,136, 81,210,139,108,
- 81, 81, 55, 51, 82,242, 68, 5,221, 98,129,170, 3,137,146,182,222, 99,109,235, 24, 41, 42, 22,135,231, 24,157, 56,142,171, 27,
-250,235, 27,204,246,247, 24,142,215,177,166, 0, 93,224, 92, 77, 10,154,114,173, 15,177,132,208,163,157, 95,193,246,199,146,177,
- 16, 3,174,233,168,170, 10, 55,155, 98,251, 35, 38,215, 22,204,246, 46,131, 74,180,179, 9,182, 55, 68, 37, 75,215, 76, 73, 70,
- 81,104,152, 53, 13, 23, 62,249, 73,220,188, 97,227,228, 41,194,109,103, 24,159, 56, 73,217,175, 56,188, 22,185,246,216, 57,182,
-110,190,145,241,240, 6,186,182, 89, 69, 77, 21,189, 33,245,116, 15, 24,175,252,196,166,167, 9, 62,224,187,154,245,205, 30,174,
-157, 19,242,174,210, 43, 13,170,135,214,150,212,213,146,150, 25, 35,113, 50,229,193, 73,199,115, 99, 65,105, 52,101,136,204,209,
-132, 24, 8, 6,186,152,147, 53,163,164,164,153,108,203,136, 17, 92,151, 68, 16,146,147,172, 18,137,152, 43,216,148, 68,109, 26,
-140,236,167,172, 86, 18, 19,171, 20, 58, 25,170,144,120,222,151,150,204, 62,208,113, 45,192,241,245, 74,196,120,186, 32, 92,219,
-193,174,245,137,189, 18,237,142, 50,160,147, 5, 51,168, 72, 33,224,174,236, 80,157,218,102,182,179,195, 7,127,228, 94, 94,251,
-230,251,249, 47,255,245, 3,252,208,107, 94,196,244,176, 21,117,183,169,176,163, 1,118,115,147,242,244, 25,216,124, 10,184,171,
- 80, 47,136,179, 41, 49,149, 68,215,144,124, 35, 29,207,250, 22,106,208,224, 67,160,107, 35, 26,193,127,162, 51,221,204, 74,119,
-128, 86, 71, 60,111,151, 57,211, 62,146,148, 37,154, 10,204,128,164, 75,208, 6,173, 28,116, 17,127,176,131,179,155,196, 51,175,
- 68,219,132, 91, 92, 69, 25, 77,185,182, 38, 7,181,234,227,189,195, 90,203, 15,127,247,235, 56, 85,105, 10,165,248,163,143,156,
-231, 95,221,187,205,246,215,127, 51, 59,239,250,111, 71,179,215, 37, 8, 95,229, 40,205,148, 91,157, 37, 92,134, 28,183,154, 15,
-166,180, 82,193,103, 11,157,202,202,156,224,115, 68,232,117, 62,111,150, 99,119, 81,161, 39,144,177,110,238,244, 66, 43,184, 85,
-133, 34,249,134, 56,117, 82,224, 14,214, 73, 7,251, 43,227,173,210,150,232,154, 85,102,249, 18,194,162, 84, 22,200, 45,135,230,
-222,101,135,158,168,151,201, 2, 48, 91, 20,116, 93, 71,215, 52,217, 11,126,189,160, 77,166, 9, 62, 7,199,104, 43,162, 39,153,
- 72,228, 53,133,145, 66, 68, 60,249,215,229,195, 47,199,189,217,143, 30,186, 70,166, 11, 17,130, 74, 88, 99, 49,214, 19,163,193,
-216, 60,165, 8,224,157,151,145,121,219,161,181, 37,196,128,166,144,119, 42, 23, 11,218,106,218,133,207,201,113, 82,172,216, 40,
- 59,113,159, 18,102, 57, 85, 73,146, 83,255, 5,211,141,144, 8,190,149, 73, 75, 4,125,250, 38,234, 43,159,199, 20,199, 73, 49,
-224,235, 6, 91, 85,164,162, 32,216, 78, 58, 72, 99,164,242,206,220,254, 21,107,125,101,216,207, 23, 55, 81,114, 72,149,254,199,
-254,181,235,214, 34, 42,231,157, 39,104, 90, 82,118, 50,164,224, 73,222, 17, 90, 79,237,246, 40, 74,147,169,142, 74, 52, 15,155,
-199, 81,131,145,172,131,172, 89,145,247, 72, 66,117,140, 42,255,251, 37, 88,143, 16,175,203,104,191,238,175, 37,174, 61, 19,252,
-174, 3,220, 37,165,190, 32,135, 61,165, 47,204,125,215, 90,243,215,239,124, 51,147,201, 12,231, 20,157,151, 36, 72, 19,151, 97,
- 50,154,164, 16,145,175,138,120,149,208, 49, 65,153, 72, 45,212, 13,204,231, 18, 90, 21, 82,150, 24, 44, 31, 93,167,208, 3,113,
- 2,169,168, 40,141,166,175,160,175, 52,198, 66,235, 34,139,124,177, 47,195,233, 98, 74, 84, 54, 7,201,100,101,251, 45,183,222,
-202, 29, 79,189,131,249,194, 9,208, 38,192,239,255,222,239,225,227, 10,244, 40,147,223, 42, 83,162, 92,230,112,206,167, 19,110,
- 62,123, 3, 47, 24,157,224,193, 79, 61,204,119,156,219,225,119,222,242,255,113,178,222, 97,205,183, 60,114,238, 9,250,189,138,
-255,252,195,255,134, 63,121,215, 59,121,248,220, 5,214,250, 61,222,250, 87,239,229,216,198,152,218, 7, 44, 48,233, 26, 78,143,
-250,148, 72,164,107,235, 61,195,210, 50, 44, 44,209, 7,118, 93, 32, 42,205,180,115,236,183,145,121,235,112,157,231,103,158,255,
- 12, 14, 62,246, 4,125, 93,112,188, 76, 40, 7, 65, 43, 42,149,216, 48,150,161,150, 75, 61,146,104, 67,100,230,193, 25,131, 41,
-251, 68,215, 18,189,199, 20, 21,221,236, 64,124,144,116,196, 88,160,154, 58,143,244, 74, 38,151, 46,161, 10,197,181,135, 31, 96,
-126, 56,197,205,106,226,226, 2,246,134, 49, 11, 63, 39,250, 68, 81, 85, 34,116,200,149,121, 97, 43,234, 60, 57,112,174,165, 24,
- 88,140, 82,196, 73, 36,248, 5,197, 96, 64,209,245, 73, 62, 81,216, 30,205,236,128,126,111,147,102,190, 7, 3,241, 91,117,237,
- 4,116,193, 98,239, 42,189,225, 24,215, 88,186,174,197, 28,214,104,213, 82, 84,199,233, 22,251,148, 91, 55, 48,221,157,208, 45,
-206,211,223, 28, 51,219, 59, 32, 68,203,225,206, 5,250,195, 99,152,168,248,208,219,254,144,219,159,251, 28,206, 62,251,171, 57,
-247,224, 95, 16, 93,199,243, 95,253,189,232,194, 50,191,186, 71, 49,236,227,154,142,162,234, 51, 92, 63, 70,125,120,192,232,216,
- 73, 52, 48,189,118,133,141, 83,167,101,234, 80, 13,240, 33, 96,139, 2,175, 34,222, 37, 76, 97,153, 93,120,152,155,158,126, 43,
-190,153,160,226, 66,118,155, 69,159, 96, 74, 18,134, 20, 21,214, 38,124,242, 52, 7,115,174,229,103,165, 51, 48, 38,198, 68,176,
- 66, 95,114, 42,175,218, 50,161,210, 26,176, 58,209, 58, 69,229,229, 80, 8, 46,146,186,132, 75, 74,162, 94, 99,196, 42, 25, 69,
- 38, 13,177, 80,180,141, 28,194,117, 94,173, 18, 20,107, 70,241,138,231,245,248,111, 31,107,112, 49,192,218, 22, 92,219,147,112,
- 13,219,147, 42, 94,105,116, 33,167,129, 10,121,112,155, 81,153,201, 20, 20,227, 17,151,247, 14,120,243,119,156,101,251,245,159,
-225,251, 94, 61, 39, 37,147,133, 68, 5,197,104, 68,117,226, 6, 24,157, 1, 93, 47,151,209, 40, 83, 16, 46, 95,164,107, 27,244,
- 96,132, 42,123, 36,215,202,184,188,244, 24,235, 51, 37, 44, 11,133,181, 70, 85, 85,246,132,123, 57,232,156,140,171, 99, 74,226,
-195,181, 35,185,208,149, 66,227, 80,201,147,166, 53,222,121,218,147, 47,132,209, 77,232,112, 32,113,181,253, 1,213,218, 16,211,
-235,145,114, 40,199,249,251, 63,206,243,239,125, 41, 91, 64, 89,106,186, 40, 49,157,159,216,109,121,233,103, 62, 33,130, 32,239,
- 50,145, 44,161,205,242, 18,203, 35,231, 36,137, 61, 74, 41, 34, 26,165,151, 7,100, 58,194,202,106,155,213,213,113,213, 1, 41,
-142,208,170, 43,174,187, 86, 71,164,182,148,211,223, 8, 71, 97, 48, 65,101,210,168,168,196,253,254, 85,202,237,141,236,183, 54,
-196,228,209, 74, 62,111, 12, 62,251,226,179,103, 62,120,138,178, 20, 5,190,119,242,217, 98,123,164,200, 86, 57,177, 76, 73,218,
-156,119, 78, 38, 29, 41,137,108, 57,134,213, 78, 58,230, 32,150,232, 85, 30, 79,135, 76,208, 83,196, 46, 23, 57, 33, 17,147, 91,
- 37,160,165,236, 55,143,222, 19,156,147,200,212, 37,114, 20, 67, 8, 73,216,239, 62, 18,112,160,156, 76,109,130,196,167,198,144,
- 81, 97, 62, 97, 10,179, 10, 59,137, 64,234, 4, 19, 29,242, 68,193, 22, 34, 2, 54, 86,211,181, 14,235, 51,119, 62, 4,202,194,
-202,115, 86, 34, 4, 84,222,147, 58,135,183, 89, 98,160, 13, 93,227,114,244,107, 90, 9,235,146,115, 36,107,136,214,160,151,221,
- 57, 25,118,180,188,208, 77,145,173, 6,133, 60,219, 24,101, 63,110,138,236,151,191,126, 52, 31,143,144,176, 89,165, 30, 22, 51,
- 9,184,137, 75, 78,187,120,198, 33,224, 66,118, 22,248, 32,209,207, 36,130,149, 12, 3, 99,141, 76,115, 66, 32, 32, 83,160,116,
-221, 78, 60,173, 98,112,213, 23, 66,237,114,145,160,254, 81,156,171,216,200,244,117, 20,188, 47,188,208,131,247,212,139, 41,191,
-245,139,255, 59, 69, 63, 55, 26, 57,125, 77,231, 66, 33, 70, 17,150, 22, 54,225,146,184,131, 82, 18,110,129,107,210, 74,240,219,
- 1,174,201,185, 52, 94,172,111, 6, 8,157,198, 20,138, 66, 41, 97,163, 40, 77,233,197,198,187,240,137,224, 69, 77,151, 77, 48,
-216, 36, 29,186, 82,240,212,179,119,242,200, 35, 15,240, 23,127,249,223,185,116,229,154,104,145, 50, 11,168,238,178, 11, 77, 29,
-185, 8, 53, 81,225, 98,164, 77, 34, 50,232, 46,127,154,251,126,247, 77,168,233, 35,108,109, 84,188,246,117,255,154, 87,124,203,
- 55,241,251,159, 56,199,253,251,115, 14,162, 98,238, 61,223,245, 31,127,138,183,191,247, 3,164, 24,120,229, 75, 94,196,221,103,
-159,198,108, 94, 51,212, 80, 32,163,144, 39, 14, 22, 92,107, 58,106, 39, 47,164, 54,150, 39,103, 53,155,163, 1,199, 6, 61, 54,
- 74,193, 34,222, 60,176,156, 94, 27,114,227,250, 26,189,131,115, 24, 85, 48, 40,123,140,202, 34,143,234, 53, 27,214, 50,178, 22,
-171,100, 71, 21,151,169,191, 6,102,205, 2, 91,245,228,144, 78, 9,116,174,198,115, 80,140,181, 34, 46,177,101,159,107,143, 61,
-130,247, 11,118,207, 61, 74,115,184, 79, 74,158, 84, 4, 54,110,184, 91, 48,148,206, 51,219,223,229,202, 35, 15,227,218, 9,222,
- 69,186,110, 38,254, 90, 99,233, 22, 45, 49,192,238, 19,151,104,235,171, 12,143,157,192,181,226, 7, 13,222, 97,236, 26, 77,179,
- 79, 81,245,240, 62,224, 22,135,232, 98,128,247, 29,193, 37,170,181, 33,218,244, 56,184,188,131, 82, 53,166,200,185,207,214,210,
- 45, 26,148,174,113,237, 28,219,243,152,202,178,152,204,209, 54,208, 76, 46, 51,223,191,194,197, 71, 62, 11, 90,179,219,193,253,
-159,190,159,143,253,213, 95,241,233, 7,206,241,169, 79,124,138, 7,254,242,175, 80,109,131, 53, 45, 69,242,152,194, 50, 24,143,
- 81, 86, 20,159,222,119,216,178,202,202, 88, 41,237,170,193, 80, 48,154, 25,149,136,149, 29,225, 71,223,249,155,140, 78,157,201,
-239, 75, 68, 43, 39,106, 98,211, 35, 42,133, 42, 4, 32,131,210,120,231,104,178, 26,217, 69,241,141, 7, 36,248,160,203,194,143,
- 46, 74, 84,225,202,246,154,213,238,190, 77, 52,179,196,124, 17,153,215, 9,231, 5, 22, 18, 50, 10, 58, 68,169, 72,157,151,100,
- 44, 95,130,171, 20, 93,246,209, 86, 81,113, 76,105,190,247,139,134,124,215,115, 55,152, 79,107,226,193,133,172, 76,145, 84, 36,
- 93, 89, 84, 89, 96, 55,215, 41,207,108, 11,250,219,104, 25,141,106, 75, 49, 28,211,239,247,216,141,150,183,254,211, 83, 28,255,
-231,111,231,196,241, 10,221,171, 40,214, 70,152,225, 24,214,214, 97, 56,130,102, 6,109, 71, 74,133,164,213,141,199,148,163, 17,
-106,113, 64,216,187, 8,245, 28,229, 23,152,148, 48, 70, 99,141,198,246,250,152,126, 31,211,171, 50, 46, 53, 18,219,142,216,186,
-204, 15,143, 36, 44,193,110, 18,181,184, 51, 84, 59, 35, 45, 22,184,107,215,152,181, 99, 38,199, 95, 78,180,125, 98,115,141, 24,
- 28,182, 87, 81,141, 6,232, 66, 97,203, 33,190,142,188,234,233, 79,227, 89,247,190,148, 91,250,134, 65,169, 87, 16,161, 83, 61,
-205, 27,222,241, 57,220,133,243, 28,255,250,255, 45,115,215, 83,206, 60,207, 99,243, 44,220, 90,142, 45,197, 35, 29, 51, 15, 61,
-136, 13, 45,102,111,118,240,146, 79,176,130,139,116, 89, 5, 31,115,152, 70, 90,133,173,144, 25,231, 41,211,197,162,115, 25,182,
- 34,144,153,163,157,125,100,250,177, 63, 71,233, 98, 21, 1,172,150,177,122,121,239,189,132,196, 44, 47, 52, 85,150, 89,217,190,
-220,215,179,194,167, 46, 69, 99, 33,143,248, 37,128, 69,138, 13,188,144,202, 82,254,185,209, 25,143,170,142, 70,249, 49,118, 34,
-186,210, 10,215, 52,120,223, 74,151, 29, 34,193,119, 34,188, 92,212,184, 78,152,244, 62, 4,156,115,180, 77,135,247,157,172,171,
-124,135,243, 14,215, 9,155, 35,116, 45,177,109, 9, 94, 10, 10,223, 53, 57, 97,178, 35,120,151, 71,252, 45,193,121, 98,134,172,
-196, 32, 43, 7,223,118, 52,243,154, 20, 60,174,109, 8,205,130,208, 44,112,109, 35,207,195,117,196,174,197,117, 78,138,141,174,
-147,213,184,209, 56,231,178,234,190,149,103,208,118,194, 64, 8,162, 38, 23, 85,150, 23, 91, 97,200,207,195, 24, 40, 74,185,192,
- 11,147,101,213, 57,162, 49,100,213,123,138, 71, 93,114,200,220,246, 28,196, 66,219, 16,219,134,176, 88, 72,224, 77,219, 18, 91,
- 81,199,167,182, 35, 54, 93, 22, 3, 42,186, 69, 67,219,200,243, 13, 49,208,117, 14,239, 28, 46, 63,147, 20,151,244,196,116,132,
-138, 93,238,254,149,150,105, 79,186, 46,220,102,217,153,231,184, 91,181,196, 14, 7,255, 63,133,179,197, 24, 49,214,240, 93,175,
- 56, 75,219, 40, 22, 53,204,106,152,215,146, 47,211,116, 34,232,245,153,238,215, 56, 57,227,234, 46,230,238, 60, 81,183, 48,157,
-103, 38,252, 18,221,154,129,122,202, 41,116,210,152,160,136,157, 98,144, 52,253, 88, 80,122,145,171,187, 54,209,185,136, 3,154,
-152, 8, 38,127,255,140,252, 58,208,240,172,187,159,137, 66,241,226, 23,190, 72,202,166, 60,156,104,253, 81,237,210, 69,145, 49,
- 56, 15,230, 37,119,175,255,100,136, 17, 23, 69,221,121,118,188,206,165,199,247, 25,247, 29, 79,252,245,223,114,108,187,226,215,
-126,228, 23,185,231,217, 79,103,182,104, 57, 85, 90,116, 12,172,245,250,164,232,169,130,231,237, 31,251, 20,149, 74, 28,204,107,
- 14, 58,199, 51,111, 61,195,238,193, 33,167,215,250, 12,140, 34, 42, 77, 85, 24,118,234,142, 74, 41, 46,205, 59, 22, 94,248,205,
- 79,219, 28,112,176,232,232, 98,226, 59,190,250,133,108, 29, 60,158, 93, 43, 82,121,250, 36,145,119, 3,109,216,176,134,129,182,
-226,161,142,158,253,224,217,139,158, 98,125,139, 23,126,205,183,160, 76,129, 91, 76,209, 90,246,109,221,108,130, 46, 44, 73,137,
- 80,197,213, 51,180, 49, 12,214,199,196, 38, 82, 14, 53,243,195, 78, 42,103,101, 72,174, 65,151,235, 12,214, 74,162, 75, 40,171,
-177,182,207,124,127,143,132, 99,182,243, 36,253,241,166, 8, 95, 98,192, 90, 67,183,208, 52,211,115, 84,163,173,204,174,238,208,
- 85,129, 86,150,249,254, 30,229,208,128, 31,178,179,243,121, 70,155,235,168,168,209, 21,132,185,166,191,185,198,222,185, 61, 90,
-127,141,209,214, 9,230, 59, 7,216,194,112,184,183, 71, 53, 50,216, 98, 3, 55,159, 81,141,143,241,228,131,247, 81,174, 25,166,
-251, 19, 38, 87, 46,112,234,216, 41,206,156,172,216,220,220,226,236,109,183, 48,180,142,197,254, 21, 62,255,177,143,177,152, 52,
-248,105,195,230,173, 39, 8, 59, 51,202,141,117,180, 53, 4,215, 17, 92,195, 96,188,197,225,229, 11,148,189, 30,166, 40, 51,148,
- 66,112,152,221, 98, 78, 89, 20,252,194,207,191,150,103,223,126, 43, 90,151,210,212, 42, 81,100,232,178,135, 45, 42, 82,116,178,
- 55, 84,208, 92,153,240,231, 15, 79,120,193,205, 5, 7, 42, 49, 79,145, 41,145, 6,104,151,121, 33, 86, 70,240,214, 66, 89,229,
-134,192, 42,202, 82, 34, 8,173, 86, 88,171, 41, 75, 77,116,162,126, 14, 81,130, 75,162, 79,196, 54, 23, 7,141,140,184,146, 83,
-152, 0,253, 78,211,247,138, 94, 48,156,184,227, 22,122, 55,220, 72,216,191, 72,119,245, 26,244,123, 96, 13,166,234, 81,156,188,
-137,242,212, 41,220,181, 43, 82,245, 91, 5, 69,129, 46, 7,232,254, 16,188,167,219,219,231, 25,119,158,224,205, 31,184,200, 77,
-182,229,222,231,220, 73, 23,193, 14, 70,216,205, 83,224, 69,205, 27,187, 5,177,145, 67, 43,117, 78, 58,218,178,135, 29,140,208,
-131, 33,166, 63, 68, 21,149, 64, 66,114,140,173,140,187,237,138, 84,182,242, 72,167, 18,170, 33,201,140,242,136,122, 65,170,231,
-164,230,144,174, 46,153,108,189,128, 56,220, 70, 49, 39,210, 81, 12, 43,202,209,152, 98, 56, 64, 27, 69, 53,188,129,183,191,241,
- 13, 60,255, 37, 95, 71,218, 63,224,116,169,151,113,224, 34,254,202, 97, 16,135, 93,228,155,159,181,205,214,139, 95,192,236,211,
-255, 35,239,148, 85,206,230,200, 30, 92,179, 84,226,235, 60,225,144, 86, 65, 93,151, 24,165,242,206, 93, 45, 17,150, 62,174,180,
- 1,218,154,149, 64,108, 25,225,154,212, 50, 77, 60,171,235, 51,160, 70,160, 49,113,149, 19,162,180, 34,206, 14, 24, 63,255,149,
-132,197, 30,166,215,199,150, 61,217, 41,251,142,110,118, 72,104,107,130, 11,171,236, 16,171,151, 33, 76,118,197,108,195,251,149,
-117, 47,248, 72,116,173,216,191,150,160,153,140,105,139, 73, 29, 69,107,166, 72, 76, 2,104, 74, 41, 9,221, 12, 1,237, 72,244,
-102,200,104, 82,228, 29, 90, 66, 94, 84,194,119,142,206, 57, 66,144,139,179,115, 78,184, 45, 49, 91, 21,151, 57,238,185, 32,136,
- 89,109,143,145, 84, 49,177,211,101, 79, 62, 50,177,113,173, 32, 81,131,143, 25, 32, 19,178, 72, 48,160, 82, 20,107, 92,126,238,
- 33,137, 79, 94,161, 8, 62,160, 98, 32,116,142,164, 12,182, 87, 74, 26,229,165, 75,244,198,107,178,103,215, 22,219,175,208, 85,
- 79,246,241, 90,184, 4,203,213, 4, 74,229,139,188, 18,227,115,182, 11, 18,243,116,235,186,137, 12,174, 61,234,126,243,109,150,
-234, 5, 42, 68,252,225, 4, 92,135,171, 23,184, 70,222, 19, 82, 32,248,112,132,156,205, 33,224,106,121, 35,243,143,226,215,181,
- 94,193,124,150,197,167,220,104, 41,187, 52,146,144,248,150, 41,128,249,194,143,136, 96, 19, 99,177,101,129,237,245, 81,131, 33,
-186,215,203, 88, 54,123, 29,167, 33, 48, 59,216,227,173,191,249,115,162,135,208, 57,183, 66,229, 31, 41, 41, 98,210,171,188,139,
-152,217, 14,162, 19,146,207, 52,155,231,212,181, 28,118,167,181,112, 54, 44, 90, 2,193,180,128,180, 42,163,233, 41, 67, 79,105,
-138,252,227,204,218,192, 34, 68,130,150,117, 87,204,255,238,100,100, 50,160, 20, 12, 71, 99, 94,246,210, 47,103, 99,115,139,167,
-222,113,150,167,222,121, 15,103,207,222,195, 51,158,121, 15,159,254,212,167,143,134, 35,153,222,107, 93,146,164,161,194,200,152,
- 98,209,182, 84,235, 91,124,228, 67,143,179, 56,119, 64,120,207,251, 81, 3,195,188,105,153,207, 23,116, 42,114,211,198,136,247,
- 62,177,195, 86,169, 57,123,108, 72, 82,137,211,163, 62,105, 58,165,208,224,154, 6,131, 98,183,233,100,220,133,226,210,188,225,
- 91,190,232,110, 62,252,185, 7,177,202,224, 98, 98,175,150,106,109,179, 87,225,149,229,120,119, 21,101, 12,198, 68,108,180, 84,
- 38,209,115,158,190, 41, 24,105,168,172,197, 68, 25,123, 52, 49, 49,143,129,218,123,238,121,250,189, 40, 99,240,237,130,178,191,
- 70, 74, 50, 78,182,189,138,122, 58,165, 28, 38,186,206,163, 73,204,118,247, 81, 58,210,122, 71,115,105, 70,215,117,160, 42, 98,
-187, 71,215, 25, 66, 56,196,218, 10, 59,218,164,153, 94,194, 7,104,166, 7,244,199,183, 80, 13, 78, 50,185,246, 56,235, 39,110,
- 39,118, 17,179, 81,176,152, 46,240, 49, 16,124,135,107, 59,218,110,202,112,180,142, 39, 80, 88,137,174, 52, 69,162,153, 56,194,
-241, 26,165, 11, 74, 93,114,112,248, 36,235, 55, 31,163, 24, 86, 12, 55, 70, 36,103, 24, 30,219, 34,161,232,171, 26, 75,133,143,
-141,124,147, 26, 88, 44,246, 40,202, 27,217, 56,113,146,110, 49, 97,127,103,202, 45,103,215, 40,170, 30,166, 88,103,189, 72,140,
-142,111,178,113,203,151,112,203,243, 95,192,238, 67,159,229,252,199, 63,206,248,216,109,108,108,111,161,181,198,246,215,184,250,
-232,195,156,184,237, 14, 6,199,142, 17, 67,164, 93,204,169,250, 3, 20,138,182,158,161,139,146,166,158,145, 10,248,245,247,254,
- 5, 63,250,202, 87,160,155, 30,237, 96,131, 50,200, 97, 99,250, 21, 69, 5,116, 53, 77, 29, 48,165,162, 80,240,241, 39,106, 78,
-220, 92,209, 36,249,146, 6, 18, 81,165, 85,130, 80, 92, 6, 63,229,213,150,201, 76, 99, 5,212,117,162,172, 18,195,158, 6, 11,
- 97, 17, 41, 10, 45, 83,201, 76, 77,245, 46,187, 83,130,168,224,241,138, 34,194, 32,104,246,246, 59, 30,255,228,147,124,235, 43,
- 74, 38,151, 21,102,208, 39, 86, 21, 84, 37,229,137,155, 49,227,117,220,133, 71, 73,157,151,184, 81, 31,243, 43, 20,165,219, 27,
- 15, 49, 23, 3, 79, 94,152,240,193,239,191,139, 59,127,241,115,156,220, 90,227,197, 95,247,114,185, 29,157, 3, 21,136,237,156,
-176, 88, 16, 93,155,115,178,243, 1,163,149,132,117,144, 8, 49,174,196,195, 41,137,158, 4, 93,228, 67, 68,172, 75, 41, 65, 50,
- 61,146, 29,130, 42, 73,237,148,208, 46, 72, 77,135, 15, 37,211,241,115,136,131, 33,101,154,147,156,228, 64,247,198, 99,202,181,
- 53,208,129,193,230, 13, 92,252,220, 39,248,170,123,159,198,126, 23,184,167,103,112, 49, 31,242, 25,206, 82, 26,139, 91,238,125,
- 83,194,161,233,158, 60,135,234,175, 19,231,147, 85,144, 71,200,130,210, 24,162,196,145,202, 13,191, 82,183, 11, 82, 56,173,210,
-207,148,214,196, 37, 94,117, 57,251,212,162,197, 16, 23, 67,238,252,211, 81,113,158,114,210, 91,204, 9,104, 42, 8, 67, 51,146,
-187, 45, 93,226,103, 7,178,142, 48, 90,158,175,217,146,142, 93,137,192, 48, 69, 69, 8, 66,223, 51,218, 16, 82, 86,235, 27,133,
-210,165,136,168,108,135,175,157,184,175,156,147,207,148,225, 38, 81,235,163,209,109,182,197,173,216,154, 64,200,118,191,164,174,
-243,195, 7, 71, 8,203,216,207,110, 57,215, 88, 93,236,193, 7,220,162,198, 39,136,206,163,172,193,117,200,119, 44,136,141, 19,
- 47,177,169,178,118, 1, 31, 60, 58, 74,232, 84,236, 58,108, 89,138,245,205,100,155,150,147,194, 47, 37,217,157, 7,101,133,152,
- 57,172,232, 92,182,115,197, 32, 46,133, 32, 93,158,192,163,178,165,141, 68,153, 23,177, 73, 41,201,126, 80, 71,224,156, 24,132,
-198, 70, 97,101,236, 29,162,100,252,100,251,161,228,119,106,185,196,151,193, 47, 8,167,127,197, 71,237,132,151, 26, 98, 71,108,
- 26, 89,109,233,204,250,175,107,252,124, 46, 46,151,186,206,223, 18, 45, 84,191, 37,227, 52, 38, 20, 45,170, 44, 68,159, 17,128,
-104, 69,144, 25,132, 49,162,162,151, 93,191,213,215,197,246,202,248, 41,105, 89, 93, 44, 99,117,117,206,156, 71,231, 34, 50,105,
-140, 17, 81,106,140, 33,219, 26,175, 75,118, 75, 71, 0,166,217,199, 63, 46, 14,155, 32,156,254,216,202,123,164, 76, 94, 39,170,
-132,242, 74, 70,234, 42,163,140,115, 1,178,104,164,163, 79, 89, 21,188,148,165, 84,133, 32,157, 85, 82,148, 58, 83,252,156,241,
-190,203,176, 0, 0, 32, 0, 73, 68, 65, 84,194, 43,104, 82,196, 38,112, 33, 50,243,145, 46,239, 44,179,150, 18, 99, 98,126,150,
- 98, 18,248,232, 71, 62,202,135, 63,242, 17,190,232,185, 47,224,111, 63,240, 97,252,117, 24,253,112, 93,184,222,146,168,105,190,
-244, 25,195,159, 84, 38, 98,148,166, 52,154, 83, 55,222,204,163, 31,124,140,227, 39,183,104, 85,143,247,126,250, 18,111, 61, 55,
-231,165, 55,173,241, 85,223,254, 26, 62,250,200,195,148, 27, 39,248,137, 31,251,183,124,205, 87,188,140,123, 94,240, 66, 78,140,
-215,249,228, 3,143,114,243, 77,167,153, 28, 30,242,138,103,222,202,109,125,205,164,110,241, 33, 49, 42, 20,227,170,226,177,171,
- 59, 52, 57,170,209,104,197, 23,111,175,177, 85, 26,146, 41, 57, 61,172,120,229,211,182, 51,100, 34,255,226,150, 24,196,148, 88,
-215,134,126, 81,160,181,140, 96, 28,145, 58,120, 22, 42,241, 69, 47,255,122, 78,156, 60, 67, 12, 30, 83,245,104,243, 23, 42,120,
- 65, 42,246, 71, 27, 76, 46, 94, 70, 27,131,115, 18, 86,208,214, 75, 74, 85,143,114, 96, 57,184,188,143, 46, 2, 68,131, 86,208,
- 53, 45,133, 53,153, 90, 37, 66, 9, 93, 24,209, 90, 40, 39, 57,202,133, 70, 57, 69,240,142,162,234,179,119,245, 2,227, 99,219,
-116,139, 89,102, 96,123, 98,236, 40,170, 30,169,179,152, 94, 34,118, 13,168,138, 20, 26,148, 50,204,247,246, 81,101, 75, 89, 14,
- 73,201,113,176,115,128,214, 19,250,107, 39,112,237, 2,173, 52,205,162, 99,122,240, 56,253, 65, 65, 85,142, 73, 42, 98,204,128,
-170,239,232, 15, 78, 51, 61,120,146,205, 27,238, 96, 49,109,241,177,165, 26,109,112,227,179,159,203,240,216, 9,202,209, 16,165,
- 11, 98,244,128, 97,176,181,193,254,197,243, 20,213,128,114, 48, 0, 68, 33, 92,244, 42, 20,210, 73, 78, 15,175,242,158,119,252,
- 6, 74,193,135, 62,247, 48,201,246,185,251,233,119, 17,236, 38, 73,139, 0, 72, 43,177,206,185,230,144, 39, 62,117,129,191,184,
-212, 48,233,224,105,183, 88,102, 49,209,229,247,116,185,251,210,121,130, 87,100, 87, 83, 81, 72, 2,155,181,146,168, 37,231,136,
-162, 42,116, 22, 6,201,151,212,116, 9,213, 66,108, 19,190, 78,248, 69,130, 69, 66,117,208,219,131,143,127,174,227, 93,143, 53,
-252,191, 23, 60,229,230,136, 87,126,245,115,233,218, 22, 55,217, 69,247,122, 20, 39,111,198,172, 31, 35, 28,238,224,118, 46,161,
-172,149, 78, 79,139,184,200, 12,214,209,131, 17,248, 57, 97,239, 16,155, 18,131,241, 26,204, 23,124,223,219, 30,231, 5,199, 27,
-206,190,228,197, 68,211, 35,206,247, 8,211, 67, 73,127,114, 29,201,101,102,117, 78, 74, 91,102, 60,163,244, 10, 69, 74,202, 16,
- 36, 85,200,129, 90,183,164,168, 73,197,128, 84,140, 32,116,146, 84, 54,217,165,155, 5, 38,189,103, 50,173,158,130,173, 16,150,
- 65, 37, 99,246,114,109,140,173, 74,122,227, 49,213, 96,155,239,255,170,151,241, 61, 63,250, 51,156, 41, 52,107,153,183,191, 12,
-199,170, 10,205,229, 58, 48,220, 88,227,218, 97,205,168,208, 52, 62,241, 13,247,156,164,127,106, 76,239,204,115,104,158,120, 96,
-213,165,163, 37, 11, 96,133,192, 90,165,108,229,174,154,235,236, 7,153,178,166,178,224, 45, 59,218,164, 51, 90,230,212,174,168,
-114,113,245,255, 85, 41,253,163, 93,168,202,251,231, 44,212,138, 29,218, 90, 6,103,159,135,238, 91, 98,219, 81, 12, 70,171, 29,
-170,107,230,184,102, 46,222,239,232,177,166, 16,220,177,213, 50, 57,202,148,186,224, 59,124,211,137,166, 35,248,236,237,150,159,
- 33,116, 50, 34, 86,214,224,154,154,148,121,233, 49,196,156,201, 29, 4, 64,147,243,186,189,247,196,214,225,187, 46, 7,171,200,
- 42,193,181, 45, 33,143,136,125,231,233,188,163, 93, 52, 52,141,140,221,149, 17, 59,220,146, 60, 18,149, 4,220,172,146, 77, 67,
-204,103, 19, 43,200,130,136,172,101, 28,238,186, 14,223,121,233,206,151,145,177,217,190,151, 98,194,117,157,196, 35,167,152,159,
-113, 22,172,134,101, 78,121, 68, 87, 54,163,114, 21,236, 92,161,223,239,161,141,197, 20, 6, 91, 86, 20,101, 41,235,180,194, 74,
- 97, 84,100,175,191, 81, 80,246,100,244,190,140,103, 85, 72,231,158,124,206, 2,181,121,167, 46,157, 57,206,225,235, 57,110, 62,
-197,237, 79,104,231,115, 66, 39,207, 40,180, 45,161, 94,208,205,231,132,224, 87,251,113,149,161, 60,194,102,136,171,236,250,101,
-240,139, 74,226,249, 95, 5,215,132,220, 6, 47,163, 97,151,209,100,234,136,226,183, 76, 17,206, 58, 96,116, 81, 72,209, 80, 88,
-138,181, 17,202, 20,168, 94, 63,211, 17, 11,252,222, 46, 74, 41,186,239,252, 17, 62,220, 63,192,235,150,232, 21, 97,105, 63, 67,
-216, 24, 74,201,180,203,102, 4,246, 18, 73,237,162,184,247,124, 39,235, 65, 41, 54, 69, 16, 39,191, 31,149,167, 59,153,235,174,
- 20, 49,202, 8, 95,165,196, 34, 70,225, 8,216, 92,211, 40,209, 97, 44,245, 1,203, 1,134,207,100,185, 39,207, 63,137,213, 71,
-143,128, 36,225, 46,225,122,104,223, 50,132, 49,165, 12,152, 39,178,223,181,108,140,198,252,218,187, 31,228,106,244,220,185, 49,
-230,228, 96,206, 3, 97,192,191,253,201,255,139, 87,221,113,154,233,206, 21,126,246, 39,127,154,241,160,207, 62, 48,176,150,157,
-201, 33, 23,247,247,185,125,251, 56, 63,247,190,127,160, 95, 20,108,247, 11,142, 15, 43,214,171,130, 51, 27,125,254,246,243, 59,
-171,148, 33, 31, 2, 15,238,206,184, 99,107, 64,232, 58,214, 7, 61, 82,215,162,178,186, 51, 37, 75, 21, 35, 67, 99,233,105, 69,
-105, 68, 60,160,148, 37, 21, 9,147, 20,198, 42,130,131,227,167,111,198,183, 53,189,241, 49, 66,211, 16,157,167,115,141,132,185,
-132,192,193,229, 39,105,155, 57,237, 98, 66,217, 31,210, 54,158,162,170, 56,220,219,165,168, 6, 76, 47, 93,166,191,118,140,217,
-222,195,244, 54,207, 80, 47, 22,148,189,117,177,162, 77, 59,102,147,171,108,108,223,134,155, 75, 26,217,222,197, 3,250, 3,133,
- 74,199,153,205,119,233, 13, 12, 93,187, 96, 56, 94,163,171, 91, 20, 5,157,239,208, 41,162,117, 65,215, 54,204, 14,119,100,247,
-106, 43,124, 23,169, 6, 61,202,106, 72, 50, 61, 22, 7, 87,209,202,210, 31, 30,163,215,239, 99, 10,139,119, 30, 31, 58, 76, 89,
- 48,185,112, 69, 82,219,204,128, 24, 53,166,128,114, 45,161,108, 15,221,211, 52,243,146, 43, 23, 63,206,230,201,167, 17, 66,192,
- 47, 90,140, 6, 95, 88,202,162,207,225,181, 75,140, 78,156,166,158, 30, 98,203,138,170,191,198, 98,239, 42,229, 77,183,210,206,
- 91, 6,235,107, 66,191,138,158,178,223,231,145,143,126, 4,107,143,192, 80,127,243,153,251,249,224,167,238,231,127,249,178, 47,
-227,249,207,124, 6,221,252, 0,231, 12,113,177,160,187,188,207, 31, 60,112,128,210,112,185,133,223,251,112, 3,121,186,157, 45,
-148, 20,121, 93,217,183, 2,139, 89, 98,165, 43, 43, 30,244, 99,107,137,106, 0,253,245,200,211,238, 76,108,223, 86, 48,232, 67,
-175, 50, 20, 5, 88,151,112, 83,136,179, 68, 61,129,243,127,223,241,247, 79, 68, 22, 30,174,101,151, 77,105,225,175, 31,222,161,
-212, 17,108, 69,177,190, 78, 72, 80,172,159,192,215, 83,194,206, 69,136, 74,198,198, 70,132, 94,145,132, 42,181, 4,139,248,128,
-202, 93,245,212, 7,126,236,149,183,115,113,242, 0,175,248,133, 79,240,186, 79,190,129,159,125,219, 27,233,246,206, 19, 38,251,
- 82, 21,135,110,213,225,165, 40,111, 87,202,187,100,146,147, 64,148,176,132,161, 68,208,217, 47,171, 75,146, 46,228,165, 93, 76,
-112,251,215,232,230,145,217,214,115,232,250, 39,168,170, 72,207, 6, 76,207, 98,122, 21,197,176, 71,209, 95, 67,105,195,214, 45,
-119,242,167,191,244,179,124,231,235,126,158, 27, 20, 60, 61,119,231, 75,182,180,213,154,153,243, 96, 13,127,246,214, 95,225,174,
-175,252, 6,230,243,134,219,111,120, 42,119, 12, 45,163,141, 53, 6,167,206, 80,221,251, 42, 14, 62,248,167,178,119, 76, 9,240,
-226,137, 95, 74,219, 67,144, 75, 59, 11,160,150, 30,109,117, 29, 31, 62,118,110,165,204, 17, 6,121, 92,137,167,142, 6,246,114,
-241,172,118, 1, 25,154,178, 12,149, 17, 4,150,149,174, 61, 7,202, 28,252,237, 31,115,236,107, 95, 77,219, 77,100,197, 99,123,
-114, 80, 21,213, 81,142,246,210, 40,166, 88,121,179,117, 81,146, 92,139, 86, 22,159,139,249,235,139,170,172,199,147,189,127,235,
- 80,218, 16,150,151, 74,240,171,164, 53,239,226, 42,117,204,183,173,168,172,151, 57,232, 25, 22, 19,124,148,137, 75, 4,159,109,
-115,174,115,116,203,169, 72,136,244,135, 61,193,148,146, 80, 73,225,210,209, 92, 89,101,165,184,107, 58,180, 45, 72,218,137,184,
- 16,157, 51,189, 5,133, 26,131, 76, 4,180,206, 78, 5, 39, 40, 46,231,164, 80,201,209,234, 2,112,210, 26,223,133,124,231,138,
-248,217,119, 29,198, 24,137,130,141,200,222,190,147,201,108, 92,238,194,163, 4, 38,129,202,180,168,252, 31, 93,200, 5,191,140,
- 36, 43,147,116,233,174,203, 42,120,225,146,154,194, 18, 0,211, 54,164,206,211,214,139, 76, 15,204, 47,185,235,136,243,185,232,
- 67, 26, 71, 84, 26,213,151,209,191, 41, 45, 38, 67,134,150, 16, 33, 41,186,141, 56, 35,140, 69,100,232, 58,139, 90,245,106, 6,
- 46,107, 34,105,109, 5,197,155,137,136, 41, 55,130, 90,166, 25,248,128,118, 14, 63, 95, 80, 84, 3,152, 78, 81,235,199, 72, 46,
- 48,189,114,137, 63,254,162,151,240,141, 47,122, 57, 47,122,201,171,120,231, 59,222,140, 50, 73,198,231, 49,235, 3,151,231,149,
- 6, 79, 92, 45, 2, 72, 9,215,201, 14, 59,184, 92,112,101, 11,191, 79,162, 94, 79, 62, 72, 83,230, 19, 70, 65, 71, 18, 34,102,
-130,218, 10, 92,139, 66, 46,114,169, 83,146,200, 25,114,186,173, 86,208, 6,217,128,196, 8,195, 99, 27,188,232, 69, 95, 70,175,
- 55, 98,127,111,202,123,222,251,126,174,238,236,211,249, 37, 95, 39, 81, 88,176,201, 68,116,138, 68,165,240, 33, 50,153, 29,240,
- 21, 47,255, 50, 94,246, 93,223,197,199, 62,240, 97,222,252,182,191,224,159,127,213, 23,243,254, 7,175,241,148, 81, 69, 10,142,
-201,228,144,187,182, 55,232,247,122,204,139, 1,183,109,173,241,193,251, 31,225,177,157, 57, 87,175,237, 50, 64, 51, 44, 45,187,
- 77, 71,101, 44,231,167, 13,107,253, 1, 90,193,237,163, 62, 13,137, 46, 42,214, 43,203,133, 69, 32,162,184,231,212, 56,251, 12,
-101, 76,165, 59, 79,161, 10,214, 74, 37,135, 35, 98,210,143,161,203,122, 22,137,145, 52, 10,214, 70, 27,153,165,236,196,119,107,
- 37,176,194, 53,115,138,106, 64,115,120, 64, 97, 53,182, 88,195,165,200,228,218, 46,131,181, 10,173, 43,218,217, 33,190,107, 40,
-122, 11,122, 27, 55, 66,236,216, 61,255, 4, 39,110, 57,131,107, 21,182, 63,160,185,224,136,199, 61, 41, 53, 4,215, 49, 28,143,
- 88,204,118, 40, 71, 96, 88,142,167, 42, 18,158,182, 62,100,109,125, 27, 55, 23,133,114,136,157,164,196, 21, 21,190,107,233, 13,
-123, 76, 39,251,180,179,203, 4,223,209,236,206, 48,131, 25, 93,221, 39,118, 9, 51, 40,232,143,142, 83, 31, 54,244,251,155,130,
-153, 61,181, 65,125, 8,235,219, 91,212, 51,133,119,115, 10, 61,198, 84, 2, 85, 89, 59, 81, 65,186,139, 20, 44,135,251,143,177,
-127,249, 56, 55,204,159,129,210,154,201,229, 11, 12, 55, 55,136,193,179,251,249, 71, 25,159,216,198,148, 37,213,112,157,216,212,
- 25,167,217,195, 53,135, 25,166,161,120,231,239,255,199,108, 99,146,247,219, 42,233,162,223,254,190,191,225, 79,254,234,111,120,
-222,217,219,121,233, 51,111,199,246, 6,212, 68,238,159,194,241,129,216,213,186, 92,193, 58, 17,134,174,226, 1,181,150,247,115,
-217,204,121,192, 56,249,179,167, 53,116, 1, 10,147,248,244,125,142, 50, 57,150, 92, 5,179,196, 44,102,219,244,161,135,118,149,
- 34, 39,126, 78,159, 96,221,192,197, 3,199,222,147,231,137,186, 79,113,242, 6,226,238, 46,170, 40, 73, 59,123,248,195, 41,102,
-109,176,186,172,196,150,155,208, 70, 68, 89, 97, 49,149,201,203,180, 67,147,184, 54,233,248,213,111,127, 58,225,119, 63,203,207,
-191,247, 60,175,124,203,239,241,194, 23, 61,155,182,203, 28,241, 37,105,203,103,140,106, 12, 43, 75,210, 23,192, 47, 84, 30,249,
-106, 39,187, 74, 23, 72,218,225,166, 51, 38, 15, 61, 65,119,211, 75,224,212, 29, 20, 69, 98, 80, 68, 76,105,209,101,137,233,247,
- 40,122, 21, 49, 70,198,219,167,217, 61,119,142,179,189, 83,204,125,228,108,207,224, 67,202, 23,122,202, 81,216,134,115,181,227,
-167,191,239,155,248,134, 31,252,126,162,170,152,238,239,163, 85,193,253,143, 63,200,135,191,227,203, 41,110, 56,197,240,230, 59,
- 8, 69,155,249,239, 57,184, 36, 42,146,142,162, 28, 86,228, 68, 55,241,178, 11, 54, 54,174, 70,199,132,144,243,215, 83,254,251,
- 75, 82, 86, 14, 33,201, 49,172,202,232,163, 61, 55, 2, 7, 81,198,172, 60,197,171,221,105,148, 85,132,178,226,152,168, 31,189,
- 15,211,235, 19,163, 35, 58, 81,124, 75,176,141,116,244, 41,127,142, 16, 3,189,178, 66, 27, 67,138,126, 5,191,137,161,147,137,
-157,174,100,207,163, 88, 37,175, 97, 12,100,132,108, 74, 33,187, 0, 34,193,137,184,204,119, 14,231, 28, 42, 36, 65,179,250,144,
- 83,225,178,166, 24,129,232,196,184,188,188, 29,193,121,218,214, 81,183,173,212, 71, 70, 81, 20, 21,174,109,196, 49,160, 20, 42,
- 28,217,241,162, 15, 43,111,121, 74,178,223, 47, 85, 73,138,162,248, 38, 38, 66,134,172, 68, 31, 49,133,145,157,238, 42,156, 37,
- 16, 67,162, 91, 68,180, 21,143,179,242, 6,111, 20, 42, 72,254,186,139, 17, 91,150,132,228,192,151, 24,165, 81, 4,146,235, 8,
-109, 67,232,186, 12,170,202, 98,179,234,127, 82,143,229,248,213, 60, 69,233,156, 8,224,180,206,203, 99, 25,115,211, 54,164,197,
- 2, 83, 86, 96, 10, 82, 76,216,144, 48, 74, 2,123, 34,129,160, 13,244,251, 40,239,177, 77, 77,152, 76, 9, 87, 61, 29,138, 88,
- 22,164,178,196,150, 21,182, 95, 97,123, 37,198, 90, 84,217,195, 68, 35,110, 7, 83,162,146, 71,121, 45,110,137,148, 25,247, 25,
-250, 67, 92,226,143,211,106, 93, 36, 29,114, 66,235,128,194,146,122, 67,252,162,166,218, 30,128, 46,121,232,103,127,138,183,254,
-250,155,184,122,113,151,111,184,249, 86, 70,223,245,109,124,221, 11,238,229,221,127,254,219, 36,163,104, 73, 36,189,156, 80,201,
-247,217, 57,209,118,173, 88, 4,203,181, 96, 56, 2,214,233, 32,118,253,180, 28, 86,229, 70, 57, 88, 37,143, 45, 69, 92, 86,152,
-248, 0, 61, 3, 86,201, 95,107, 19, 69,139,152,207, 57, 67,134,219, 24, 8,121,210,249,178,151,189,140,247,191,255, 67, 60,254,
-196, 21,182,143,159,228,203,190,252,101,252,254, 31,254, 73,174, 57,197,223,238, 28,216, 36, 95, 85, 20,158,104,225,224,224, 50,
-167,191,246, 89,216, 59,239,229,159,124,201,151,114,230,150, 51,196,249, 21, 62,250, 15,127, 66,213, 27,242,119,251, 29,255,242,
-107,254, 9, 55,156,190,129, 63,251,179, 63,227,217,219, 3,174, 78,230,212, 74,243,190, 55,190,150,250,218, 46,151, 47,239,241,
-246,191,251, 60,159,185,176,195,194, 59,122,166,224,179,151,174, 97,148,226,161, 73, 45, 7,170, 46, 56,232, 34,195, 66, 99,147,
-226,169, 39, 55, 37, 97, 41,163, 42,181, 49,104,149, 80,169, 16, 63,102, 10,171, 17,148, 85, 70, 94,246, 38,210, 55, 6,213,213,
-168,245, 99,162,196,238, 90,140,173,114,130,146, 34,116, 13, 40, 75,209,215,180,179,134,197,162,145, 3,217, 84, 20, 85, 73, 59,
- 59,160, 90, 59, 65, 61,189,132,102,132,174, 20,163, 19,103, 56,220,185, 70,181,118, 12,215,204, 24,172,143,233, 22, 83, 22,211,
- 67,170,193, 6,221, 98, 66, 89, 13, 80, 33,161,171, 42,115,160, 61, 93,221,178,216, 63, 96,122,237, 60, 91, 55, 62,133,182,174,
-133, 20, 85, 40,138, 94, 65,219, 30, 82, 13,183,105,102,123,160, 10,124,104, 41,215,199,212,139, 43,244, 21,180,173, 33,249,125,
-240, 70,176,173,229,154,252,178,140,165,232,105,130,131,195,189, 75, 12,215,101, 23,218, 53, 10, 83,204,233,154, 14,165, 46,210,
-227, 12,183, 60,243, 43,184,241,158,231, 48,185,114,137,241,182, 80,239, 54,111, 60,195,149, 71, 31, 97,227,198, 51,116,243,154,
-201,229, 39,216,190,243, 25, 52,211, 67,122,235,235, 56, 87, 75,199,101, 75,234,249,132,233,206,149,163, 61,104, 92, 2,164,196,
-158,166,108,226, 83,143,124,158, 7, 31,126,156,161, 86,156, 80,134, 31,122, 97,143,104, 20,141, 78,236,167, 72, 71,100, 22, 3,
-139, 32,158,221,140,218,167,237,178,235, 40,192,225, 34,143,174,144,151, 97,238,229,127, 15, 73, 46,237, 37,148, 43,223,151, 84,
- 89,168,162,145, 51,104, 92,193, 86,161,120,229, 77,125,238, 94, 47,248,131, 7, 38, 52, 30,126,227,119, 63,200,191,249,225,111,
-100,182, 31, 49,253, 57, 74, 73,152,177,202,241,161,171, 3, 53, 95,184,170, 40, 73,205, 76,186,183,126, 73, 58,104, 72,117,141,
- 93, 27,114,101,222,241,203,223,122,150,111,190,239, 26, 63,254,107,239,227,253, 95,249, 60,194,242,128,117,121,156,188, 28, 11,
-166, 40, 29, 97,182, 10,165,156, 58,162,146, 65,245, 42,180, 54,184,174,101,241,196,121, 14, 30,190, 76,216,190,151,242,185,175,
-161,234,201,238, 80, 85, 22, 91,150,216,170,192, 84, 21,201,104, 76,191,199,241, 27,110,229, 71, 94,245,106,222,242,151, 31,227,
-169,149,102,164, 53, 77, 76,121, 92,155, 24, 88,195,197,133,227,236,233,117,254,159,119,254, 10,131,237, 27,104,234, 64, 57,176,
-184,121, 75, 61,155,243,185,159,251, 65,238,252,146,187,216,124,198,179, 96,124, 12, 93,174, 73,199,156, 34,113,233,231, 77,234,
-200,135,189,180,163, 5,143, 41,138, 47, 28,155, 39,241,160, 47, 3, 90, 84, 86, 26,171, 44,214, 90, 66,173, 69, 5, 31, 80,166,
- 88,121,130, 99,184,142, 50,151,228,187, 21, 99, 64, 23,178,191, 47, 54,143,115,227,247,254, 50,232, 5,101, 81, 10,251, 60,249,
-213, 76, 53, 52,221,170,104,146, 67, 76,203, 20, 99, 25, 27, 27,211,170,107, 75,153, 21,158, 50, 1, 47,154, 4,222,203, 74,108,
-117, 65,166,140, 79, 13,116,117,141,111, 61,222, 7,105, 28,242,222, 60, 44, 3, 88,178, 16, 68, 58,244,220,169,119,145,206,121,
-234,133, 88, 14,101, 71,107,133,206,168,197,235,174,180,132,229, 68,231,240, 33, 98,141,166,109, 90,116, 97, 81, 49, 95, 80,249,
- 29, 95, 18,197, 36, 34, 85,138,137,164, 10, 33, 98,102,214,168, 50,134, 24, 60, 46, 70,138, 21, 78, 76,173,214, 34,166,144,177,
-187,107, 26,138,170, 71, 55,159,162, 80, 24,163, 9, 41,137,146,190,169, 69, 85,190, 76,130,139,233,186,125,186, 17, 53,234,178,
- 28,211, 26,218, 57, 76,229,204, 18, 75,138,207,106,215, 72,152, 79,161,109,193,181,164,166, 65,181, 29,152, 66,242, 68,208,216,
-232, 72,166,192,143, 70,196,162,148, 64,153,224, 73,179,133, 64,155, 22, 29,126,127, 66,173,243, 37, 61, 24,208,219, 28, 83,172,
- 13,209, 69,129, 49, 45,202, 24,180, 41,208, 70,173,138,196,184,154, 55,155, 92,164, 41, 17, 34,166,152,233,196,145,160, 44, 41,
-104,134,235,219,232, 96,248,157,111,253, 38, 62,252,222,191, 99, 13,248,138,187,206,114, 60,174,241, 69,111,253, 35,210,179,239,
- 97,216,214, 98, 25,204,209,183, 90,169,108, 75,204, 25,232,185,120,142, 57,183, 92, 37,145, 21, 56,249,113,133,250, 22, 33,120,
-133, 45,142, 26, 34, 49,131,136,119, 61,230, 21,129,206,246, 51,140, 88,179, 75, 43, 96, 27, 33,199,165,163,102, 70, 29, 5,222,
-185, 32,127,246,197, 75, 87, 72, 17,158,188,112,133,103,229, 33, 74, 74, 73,164, 10,121,227, 99,147,142,132, 20,137, 42, 72, 58,
- 19, 29,189,211,219,116,215, 30,228,221, 63,240, 99,252,252,135, 46,112,239,153, 17,159,217,217,231,238,219,206, 16,234,154,183,
-254,249,187,121,124,214,240,162, 91, 78,241,161,139,123,188,228,158, 91,249,251,191,125, 35,204, 12,255,225,229,223,201,133,197,
-130, 59, 54, 45,111,120,243,191,227, 53, 63,252,171, 60,112,121, 23,109, 20,133,181,172, 15, 44, 79, 89,239,241,228, 76, 8, 72,
- 73,105,110, 88,235,113,156, 5,198, 90,146, 15,185, 58,149,151,202, 42, 45, 72, 73,159,178, 93, 86,163,162,198, 36, 24,235,130,
- 16, 3,139,195,150,225,150, 35,184, 22,223, 74,249,228, 59,135,177,138,102, 94,227,125, 64,227,104,155,134,230,112, 23,101,123,
-236, 92, 60,199,104,243,180,136, 93,154, 22, 87, 55,172,159,188,137,217,222,101,170,209, 58,138, 77, 57, 39,186, 6,223, 52,152,
-162,164,155, 7,186,250, 73,122,107,219, 44,230, 59,162,206, 77,138,122, 58,165, 26,110,176,152, 28, 50, 58,121,140,217,222,144,
-118, 49,165,107, 29, 73,245,240,147, 93, 52, 21, 36, 77,215,206,115,212,165, 37, 56,135, 46, 75, 74,182,232,247,251,236,236,205,
-232,173, 53,116, 11, 7,122,129,155,174, 49,157, 94,101, 48, 26,176, 12,192,114, 78,209,214,115, 48, 21, 85, 15,246,175,236, 80,
- 13, 43,122,189,147,140,142,157,194, 86, 5, 87, 30,252, 12, 39,239,184,139,201,165,243,108,220,120, 59,211,189, 61,241,245, 86,
-125,174, 62,242, 16, 55,222,117, 55,237, 98, 38,251, 70, 52,174,107, 40,171, 18, 21, 11, 30,252,200,187, 48, 73, 98, 33, 67, 16,
- 81, 72, 81, 66,211, 66, 53, 40,242, 78,207, 75, 42, 80, 82,116, 86,236, 23, 78,139,206, 33, 22,203, 98, 64, 99,109,148,253,210,
- 64, 58,177,141,101,194,167,130, 27,147,188, 12,202,202, 11, 84, 26,197,230, 64, 51,180,208,175, 44, 93,128,221, 93,216,191, 22,
- 49, 13,168, 38, 49, 46, 52,183, 12, 13,199,140, 97,168, 13,184,132,137,154,217,172,225,161, 26,134, 61,248,253,247,125,158, 31,
-125,157, 96, 56,237,218, 8,124, 45,213,191,206,151,142,213,168,100, 64, 39,204,218, 6, 74, 57,226,116, 15, 93,245,100,100,187,
- 21, 8,243,134,164, 91,236,176,207,238,180,229,238, 59,182,248,191, 79, 15,105,166, 11, 33,143, 45, 41, 15, 41, 43,155,147, 36,
- 52, 97, 75,138,181, 30, 54, 57,156,247, 68, 52,126, 86,179,120,244, 28,147, 7,158,100,113,165, 99,252, 53,223, 72,245,202, 87,
- 99,122, 5,170,153, 67, 81, 97,109, 15, 59,232,163, 11,141,178, 37, 49, 58, 78,221,254, 52,222,245, 91,191,205,107,126,248, 23,
-216, 2,158, 86, 25, 17,193, 93, 7,203,232, 92,224, 92,231,248,173, 95,124, 29,247,126,229, 87, 51,157, 76,241,109,196,148, 61,
-230,151,174,225, 98,197,231,127,230,187, 57,245,212, 77,142,221,253,116,198,103,239,149,168,226,202,162,139,190,216,210, 98,166,
-192,173,132,112,153, 34, 23, 36, 47, 93,112,164, 2,244, 80,198,172,172, 69,203,165, 94, 34,137,102,195, 7, 86,224, 46,147, 35,
- 92,149,149,130, 96, 5,244, 90,242,224,229,119, 78,206,119, 79, 49, 81,108,157,226,204, 15,252, 90, 86, 51,107, 76, 89,226,155,
- 6, 59, 20,168,148,171,231,194, 44, 88,170,160,179, 96,207,150,229, 81,135,238,221,106,164,156,150, 45, 84, 74, 25, 20,179, 12,
- 13, 11,226, 88,200,121,241,193,119, 66,157, 11, 65,108,107,221, 50, 16, 4, 82,116,130,115, 77,113,101,149,138, 49, 18,157,199,
-123, 79,231, 3,157,243,180,117,135,143, 17,163, 21, 49, 37,140, 18,107,146,111,192, 90, 47,170, 4, 45, 68,204,174,113,226,234,
- 89, 52, 34,158, 51,134, 24,193,150, 89,117,191,244,250, 7,233, 12, 77,144,201, 64,200, 2, 97, 99,132,147,230, 91,135,107,161,
-176, 90,212,218, 57, 98, 85,119,134, 94,191,135, 55, 6, 82, 67,212, 26,187,244,207, 71, 97,215,119,139, 5,201,187, 37,239, 49,
- 63, 78,125,116,137,131, 48,219,149,146, 11,126,178, 79,247,248, 57,166,151,206, 83, 55, 45,214,121,236,104, 3,115,234, 4,101,
-191,135, 73, 90, 68,162, 57, 89,110,153,236,167, 18,232,164, 73,190,197,186, 78, 98, 70,109, 73,212,150,116,172, 34,166, 45,146,
- 18,173, 66,108, 29,113, 94,211,237,238, 50,123,242, 34,206, 90,138,181, 49,229,177,177,252,247,160, 39, 73,115, 89, 7,162,146,
-146,174,216,213, 25,150,164, 86,142,131,232, 35,110,209, 48, 88, 63,206,252,202, 5,222,251,203,191,193,223,124,228, 83,244,123,
- 21,235, 91, 99,158, 59,222,100,115, 50,231,139,239,251, 8,234,216, 9, 73,221, 28,172, 97,171, 33, 93, 59,147,120,243,188, 29,
-146,239,106,202,180,193, 28, 10,148, 95,127,114,232,161,134, 21, 74, 86,235,165, 2, 94, 6, 30,254,186,108, 10,157,192, 37,176,
- 36,140,149,144,150, 66, 73,161, 98,205, 17,201, 54,100, 64, 95,206, 28, 90, 58, 45, 9, 17,182, 54, 79,241,248,227,151,217, 58,
-113,138,214, 41, 58,119, 20,115,189, 12,213,179, 62, 70,146,246, 96, 19, 85, 63, 81, 86, 17,223,238,241, 59,223,244, 61,188,255,
-252,156, 31,255, 15,175,193, 63,246, 48,111,254,220,123, 72,159,127, 18, 83, 22,124,237,179,239,228,171,191,237, 95,242,187,191,
-246, 95, 57,115,106,196,235,255,224,167,104,222,246, 39,244,158,250, 84,110,191, 97,204,167, 31,238,232, 79, 34,255,226,219,126,
-130, 63,124,203, 79,240,211,175,127, 11,151,103, 53, 23,230,158,133,247,124,114,183,225,120,223, 48, 50,129,203, 77,228,204,200,
- 18,201, 47,158, 18,178, 89, 82, 96,242, 24, 48, 38,181,138,106, 68, 75,103,223,211,134, 53,173,105, 85,129,217,216, 34,117, 13,
-244, 6, 88,171,105,235, 5,190,105, 40, 7,107,212,251,251, 12,198, 35, 22, 51, 71, 53,232,211, 45, 10, 66,138,180,211,142,237,
- 27, 75,234,137, 33, 41, 1, 51, 40, 18,139,201, 30,229,112, 76, 8,130,186,117, 93,141,247, 30,181, 56,164, 28, 85, 68, 87, 49,
-157,237, 81, 31, 28, 80, 86, 3,186, 46, 80,148,134,197,100, 31, 76,160, 62, 92,208, 46, 38, 24, 51,144,139, 37, 41,130, 11,148,
-131,200,147, 15, 92,101,243,244, 62,221,162,199,249,207,221,207,217, 47,125, 58,245,161, 66,235, 5,109,125,156,182,222, 99,235,
-228, 41,186, 54, 81,216, 17,135,135,251,244,134,107, 76,247, 15, 24,172,175, 51,221,219,197,104,159,227,137, 59,166, 87, 14,233,
-141, 71,162,214, 44, 26,124, 91,211,214, 51,138,162,135,169, 74,138, 97, 31,239, 28,135, 23, 47,209, 95, 31,115,225,254, 79,115,
-211, 51,158,197,124,111,159, 16, 29,163,227,167,240, 93, 45, 47, 68, 2, 85, 68,222,251,155, 63,190, 74, 88, 36,219, 82, 9,160,
- 10,205,250,120,141,255,159,172, 55, 15,151,244, 44,235,252, 63,207,242, 46,181,156,125,233,211, 75,122,205, 74, 2, 89, 32, 11,
- 19, 89, 4, 2,200, 14, 6, 84, 24, 64, 68, 81,208,203,153,193,223,184, 33, 63,103,126, 14,200,140, 58, 8, 81,217,100, 80, 81,
- 35, 75, 36, 64, 68, 4, 5, 66, 8, 97,201,190,118,200,210,123,247, 57,125,182,170, 58, 85,245,110,207, 50,127, 60,111,213, 9,
-254,114, 93,157, 43, 87,119,231,116,159,170,183,158,251,185,239,251,251,253,124,165,140, 89, 62,181, 18,148,154,202,147,201,144,
- 9,110,113, 56, 37, 40,156,195,214,191, 22,177, 45,234,168,181, 80, 40, 81,127, 88,100,120,224,149, 9,187, 37, 45, 37, 54, 3,
-213,144, 52, 83,193,220,130,102,247,146, 32,201, 5,233, 38,200,174, 68,230, 14, 10,129, 47,125,192, 34,250, 48,213,185,119, 37,
- 99,163, 78,195,236, 20,158,211, 71, 79,133,148,188, 56,136,123,100,154, 34, 34,129,168,131, 63,132, 10,140,112, 41, 4, 85,103,
- 29,226, 56,196, 85, 70, 42,216, 80, 26,113, 24,121,214, 33,206,195, 97, 73,185, 58,160,115, 98, 5, 85, 11,225,108,105,160,178,
-184, 42, 99,106,162,201, 48, 47, 88, 91, 91,230,240,145, 77, 30,127,108,141,231, 94,124, 14,246,196, 89, 84,220, 68,159,115,144,
-214,107,174,103,114,118, 1, 95, 12, 16,174, 10, 84,188,201, 38, 58,137,145,113,176,221, 89, 83, 50,189,184,192,218,137,227, 92,
-189,247, 42, 78,117,135, 28, 72, 67, 49,183,126,164,213,135, 88, 73,150, 51,195,235,159,127, 25,191,253,193,255, 65,158,103,116,
- 55,214,209,209, 4,118,152,145,117, 12,118,237, 4, 39, 63,254,223, 88,188,244, 92, 22, 47,191,136,169,139,175,132,214, 84, 29,
- 19,101, 17, 73, 3,151, 13, 65,171, 49, 40,198,139, 81,118,123,120,131, 36,174,238,216,235,168, 85,191,141,220, 28,199,125, 2,
- 66,132,130, 62, 82,188,203, 58, 3, 94, 72, 25, 28, 6,245, 74,205,213, 82,221, 16, 28, 82, 67, 87,240, 8,161,217,243,174, 15,
-214, 5, 45, 3, 36,209,196, 28,101,119, 13, 95,133,144,234,192,235, 49, 99,123, 85, 32,189, 17, 8,125, 74, 80,244,138,186,179,
-241,200, 36,170, 71,231,182,158, 50,200, 26,158, 19,196,157, 40,112,121,129, 19,190,238,238, 60,101, 81, 98, 42, 75, 81, 4,231,
-142,113,102, 76,219, 51, 85, 21,158, 89, 19,128, 52,101, 21, 70,243,101, 89,146, 15,203, 96, 7,118,225, 34,228,188,163,212,160,
-173,166,114, 5,206, 70, 53,222, 84,224,235, 86,170,170, 42,132, 11, 29,178,146, 9, 85,150, 35, 76, 84, 31,240, 2, 99,220, 24,
- 0,100,172, 12, 64, 22, 25, 32, 59, 69, 30, 46, 25, 35, 1,160,209,245,254,121,164,222, 18, 6,169, 68,189,246, 9, 69, 95, 37,
- 1,161,173,176, 88,235, 41,250,125, 76, 89,133,247,218,243, 20,209,153,216, 22,188,200, 8,134, 67,232,172, 51,188,255, 65, 86,
- 79,157,193, 61,121,138,185,211, 43, 40, 1,214, 58, 76,102,232,165,154, 98,207, 14,212, 69,135,136,102, 38, 81, 58, 13,140,119,
- 31,154,177,112, 7,115,248, 42, 68,170,142,232,148,194,107,164, 16, 40,165,176,194,227,227, 20,215,106, 18,205,205,144, 14,135,
-216,193, 22,102,189,139, 57,186, 73,134,100,144, 36,200, 86, 3,217,108, 35, 35,137, 18,186, 22,208,185,122,226, 98,113,149,165,
-202,250,180,167, 23,168, 10,199,223,190,231,131,108,148,150,168,221, 96,106,102, 18, 45, 4,251,178,130,243,175,216,199,229, 95,
-255,215, 31, 35,203, 5,244,112,140,207,125, 88, 23,214, 91,213,194,109,127, 6,172, 15,170,248, 17, 60, 73, 70, 96, 75,129, 80,
-225, 91, 21, 62,116,211, 74,249,113,241, 31,193,249, 70, 49,194,210,213, 72,132,154,140, 89,179,145,208,163,140,164,167,196,210,
-139, 64,153,174, 47,150,240,205,111,124,147,171,174,126, 30,215, 92, 59,193,202,234, 22, 95,253,151,127,163, 54, 67,132,188, 1,
- 73,157,147, 34, 9,132, 28, 25, 20, 1,165,235, 35, 15, 92,197, 47,221,113, 43,191,212,156,133,193, 38,203,159,254, 24, 55,182,
-103,184,251,193, 39, 40, 17, 60,176,178,193,167, 62,244, 33,190,246,240, 49, 58, 63,248, 33,229,189,247,242,127,222,250, 97,222,
-245,195, 63,195,148, 37,151, 46, 77,242,130,171,207,103,198, 87,236,127,237,123,121,227,185, 75, 28, 27,150, 44, 15, 13,150, 64,
-208, 42,135, 33,177,248, 96,203,115,193,124, 28, 44, 4,210,133,221,220, 72, 13, 90,119,118,193, 18, 18,198, 23, 35, 33,142,170,
-133, 65, 73,229, 73, 35,143, 74, 91,193, 75, 74, 16, 37,108,156, 93,101,254,156, 24, 21,199,168, 36,166, 92, 41,208, 73,201,160,
-159, 33,133,169,125,157, 37, 85,222, 71,197, 41, 81, 58, 69,145, 15, 49,182,196,150,134,170,200, 16, 50,193, 20, 97, 37, 80, 22,
- 25, 74,165,193,206,146, 91,108,229,217, 56,251, 56, 58,158,199,155, 38,131,172,143,116,142,210,228, 33,199,184, 40, 25,244,115,
-162, 72, 6,136,194, 80,176,116,238,110, 78, 63,121,140,197, 61, 19, 68,147,243, 20,195, 2,103, 42, 84, 67,209, 57,187, 74,119,
-107,133, 5,183,155,205,149, 83,204,238,156, 99,171,179,137,181,146, 40,106,210, 89, 89, 33,106, 53,217,216, 56,205,252,210, 34,
-174, 28, 34, 27, 45, 42,171,241,110,200,116,123, 31,113, 99, 18, 91, 22, 28,186,230, 57, 12, 55, 58,180,231, 23,176, 69,142, 78,
- 19, 78,222,127, 23,207,120,249,171, 57,122,247, 93,180,102, 23,104, 78,205,145,247,123, 68, 73, 74,210,108, 81,149, 67, 86,238,
-191,141, 97,119, 53,216, 71,159,178, 23, 50, 2, 76,225,232,103, 37,121,209, 15, 5,189,222,107, 27, 5,165, 11, 1, 16, 78,134,
-253,150,169, 25,224, 94,212,174,169, 90,248, 49,202, 83,240,245,120,105, 44,172, 37, 8,172, 34, 5,202, 10,180, 3,170,160,226,
- 20, 69, 48,187,139,202, 67, 37, 67,168,130, 23,193, 62, 98, 61,145, 22, 60, 81, 4, 36,177, 7, 14, 76,194, 39, 62,242, 53,126,
-243,189,215,147, 13, 11,164, 20,136,246, 4, 58, 78,145,177, 10,157,170, 10, 69,198, 87, 67, 84, 20,141,255, 82, 94,133,206, 82,
-170, 8,175, 4,102, 80,160, 82, 73,154, 38,188,255,107,199,153,122,228, 70, 62,240, 39,111,101,227,196, 25,204, 48, 99,216, 27,
-146, 31, 95,231,170,191,121,128,173,194, 97,129, 6,208, 16,240,254,111,159,230,142, 47,254, 37, 34,109,133, 61, 67, 57,132,162,
- 31, 24,238,113, 19, 17,107,116, 18,132, 65, 72,129, 78, 99, 38, 91,179,252,214,127,124, 39,127,251,205,251, 56,144, 72,118,199,
-146,202,109,119,231,137, 86,172, 14, 43, 14, 44, 78,240, 55,159,253, 0,243, 7, 14,210, 61,187,130,119, 18, 73, 68,222,219,160,
-176, 9,254, 7,159, 99,227,123,255,198,222,231, 94,202,228,185,251,153,186,248, 42,226,165,131, 97,132,172, 19, 16, 26, 61, 53,
-139,235,173, 5,126,122, 18,215, 32, 16, 89, 11, 89,195,251, 22, 52,113, 46,140, 61,125,200,176, 30, 3,158,172, 29,103,128, 59,
-231,145, 66,134,203,210,152,199, 29, 18,231,194, 30,221,214, 2,183,250,107, 58, 17,196, 95, 56,132,208,232,169, 57,100,156,224,
-124, 86, 79,231,131,205, 48,154,156, 9,248, 87, 99,198,106,100,129,168,195, 0, 66, 1, 10,214,174, 36,168,204,139, 2,103,171,
-177,242,222,215, 5, 37,164,166,249,177,186, 90, 18,194,176,205,112, 48,158,212, 89,239,169, 76,133,171, 92,216,231, 11, 63, 78,
- 37,179,198,140, 17,198,210, 4, 2, 89,101, 45, 85,229,200,141,197, 24,131,183, 97, 87,158,120, 48,133,165,148, 5, 90,171,218,
-130, 23,236, 86, 78,202, 64,175, 27,137,168,180,164, 26, 14,131,104,111,152, 99,149, 66, 72, 73, 85, 22, 8, 20, 74,171, 90, 8,
- 88, 39,231,213,175, 97,150,149,196,177,198,214, 40, 94, 87,154, 58,230,222,162, 84, 68,145, 21, 97, 43,235, 29,210,106, 84,172,
-235,244, 65,133,208,150, 34, 11,224, 28,111, 70,176, 32,247,227,196,215,209,127, 8,139, 61,115,150,254,177, 83,200,147,107,204,
- 31, 63,133,137, 99,156,210,200, 72,224,253,144,238,242, 6,233,242, 58,199,190,120, 59,170,149,144,156,179,200,196,213, 79, 39,
-221,191, 7, 45, 53,178,149,128,147,168, 56,208, 84,162, 58, 69, 77,200,209,123,169, 81,222, 97,172,195,101, 67,188, 83,200,137,
- 73,104, 54,145, 83,179,196,166, 66, 84, 5, 62,203,177,121,133,233,108,226,133,164, 82, 1, 42, 35,149, 70,214,173,106, 36, 52,
-135, 94,248, 90,238,248,171,191,225,139, 55,255, 51,211,115, 83,161,118, 32,152, 72, 52, 7, 87,183,120,254, 95,223,192,206, 55,
-253, 2,166, 24,160,147,214,118,184, 75,157,248, 87,217, 90,109, 62,178,231,121, 80,113,184, 80,151,101, 24,163,123, 81,175,142,
- 70,238, 63, 31,246,235, 82, 5, 55,143,123,138,103,156,209, 61,201,135, 72,242,168, 30,175,187,250,210, 32,106,181,122, 28, 5,
-202,166, 29, 9,243, 2, 48, 51,100,226,136, 48, 41,125,233, 79, 94,199,189,247, 61,198, 93,247, 63, 66,183,155, 81, 84,126,220,
- 52,249,122, 50,160,195, 48,114,244, 97, 11,190, 60, 39, 45, 85, 17,225, 87,110,231,230,235,223,205,233, 77, 71,191, 91,240,160,
-143,184,242,242,115, 57,118,116,149,153, 86,202, 75, 47, 63,151, 63,248,237,183, 35,146,103, 16, 79,157,230,170, 95,189, 30, 35,
-230,185,232,130, 57, 86,238,239,240, 11, 55,124,153, 43,118,205,240,156,189, 51,244,171,138,103,238,221,197,151, 30, 57,198,158,
-137, 6, 8,199,122, 22, 70,164,147,113,196,190, 25,129, 19, 1, 27, 43,189, 15,209,155, 85, 61,230, 27,169,101, 17, 4, 40, 80,
- 1,117, 30,173,112, 2,227,193, 12,135,248,214, 84, 96,112, 59,135,138, 27,236,186,224, 2, 60, 6,123,118,149, 98,160,177,222,
- 82,244, 11,116,172, 41,122, 3,138, 34, 11,240,152, 50,167, 17, 55, 48,213,144,200, 37,244, 59, 61, 38, 23, 11,170,178, 36,157,
-104, 0, 2,157,104,140, 13,170,213, 50, 43,104,180, 35,112, 83,160,166,177, 85,143,220,135, 55,182,200, 60,198,244,208,113, 3,
-235, 37,141,118,194,230,250, 58,173,201, 54, 38,119,152,108,131,169,169, 25,178,173, 45,166,231, 38, 49, 53,196, 64, 71, 19,120,
-239,104,166, 83, 84, 89,142,138, 91, 60,116,251, 93,236,187,228, 0,166, 42,112, 46,194, 11,141,201, 50,180, 74,233,111,230, 12,
-183, 42,162,102,198,212,236, 78, 76, 81,208, 61,123, 18, 33, 37,187,206,127, 6,131,181, 14,233,100,139,225,198, 26,121,150,147,
-117,206,178,255, 89, 87,115,226,222, 7,104,159, 45, 33, 43, 0, 0, 32, 0, 73, 68, 65, 84, 78,207,225,173, 37,235,174, 17, 55,
- 2,109,110,216,221,164, 61, 63,199, 23,127,251,122,172, 16, 40, 29, 14, 47,231,192,202,109,164,115,111, 56,192, 26, 72, 61, 68,
-178,206, 54,175, 31, 36,175,130,194,215, 56, 31,162,139, 24, 79, 63,235, 91,234,182,162,115,228,154, 10,241,133,161, 80,107, 33,
-144,149, 36,146,161,200, 75, 47,240,185, 64, 20, 2, 42, 16, 86,160,108,173,174,118,117, 68, 33,146, 97,110, 56, 89, 4, 65,201,
-176,130, 70, 4, 87, 75,131,205,107, 10,154,110, 32,132, 35,217,185,132,217,234,134,238, 93,212, 73, 93,222, 35,157, 27,147,170,
-198,123,240,102,132,207,115,162,201, 41,178, 78,151, 7,143,116,185,245,201, 1, 59, 5, 88, 31, 34, 59,135, 27, 61,242, 35,235,
- 76,202, 24,239,225,156, 72,214,235,164,112,225,153,143, 4,215,188,250, 23,185,243,230, 63,199, 39, 41, 34, 13, 22, 34,153, 70,
- 40,173,144,113, 18,220, 27,120, 22,246,236,230,139, 31,249, 56,239,124,239, 39,152,251,119,163,118, 87,239,224,140,245,172,231,
-134, 63,122,239,219,121,241, 91,222,196,218,153,101,122, 43,103,177,101,176, 73,154, 34,172,137,138, 47,252, 57, 54,242, 28,124,
-229,115, 72, 22,231,153,184,232, 10,226,133, 61,224, 6, 16,165, 8,149,140,119,212, 30,129, 80, 97,146, 36, 70,113,169,163,116,
- 49,227,240,114, 59, 54,117, 36,201, 19,181, 28,120, 4,116, 17, 90,133, 93,117, 18,215,212, 57, 81,119,253, 34, 20, 51,251,227,
- 22,164,192, 42,175,163,117, 1,169, 29,122,110, 39,225,138, 95, 23,147,202,141, 61, 58,178, 38, 32,142,232,107,222, 86, 97,138,
- 32, 25, 39,155, 33, 37, 82,199, 33,244,196,213, 2, 56, 27,212,227,225, 22, 17, 58,109, 81,139,213,140,171,168,178, 33,206,187,
-144,151, 46, 36,182,202,234,241,183,161, 40, 3, 72, 37,136,244, 61,198,133, 93,173,112,225,191, 77, 93,200,171,210, 4,210, 91,
- 81, 5, 27,102,164,137,156,192, 82, 81, 25,144, 90,132,226, 45,101, 64,180,214,144, 30, 83,133,145,186, 40,131, 69,196,251,208,
-233,171,186,168,187, 26, 56, 35, 77, 88, 61,152,202,225,109, 69, 89, 21,200,210,144,180,154,108, 13, 43, 26,205,136,170,170,106,
-158,125,184,246, 24, 27, 92, 9,162,204,177, 62,162, 93,230,200, 29, 83, 53,174,216,225, 9,106,248,188,215, 27, 39,236, 61,133,
-191, 90,219, 26, 69,168, 50, 3,143, 25, 12, 41,163,132,137, 39,158,160,108,164, 8, 99, 64,170, 64,212,203, 10,166,103,218, 68,
- 73,194,142,115,118,163,141,199,157, 58,139,185,249, 86, 78,246,243,208, 20, 36, 17, 19,105,204,153,162,196,123,207,201, 65,201,
-102, 86,144,180, 27,244,107, 0,217,228,204, 4, 59,118,206,114,241,179, 47,163, 61, 53, 73, 50,217,100,176,217, 37,154,104,225,
-210, 4,145,198,136, 70, 11,105, 13,145,171,159, 45, 93,107, 61,172,199,148, 37,141,169, 69,150,158,253, 18,254,233, 55,255, 51,
-199, 31, 61, 66,115,102,146,245,210, 50, 23, 41, 46,136, 27,204,167, 9, 87, 29,191, 3, 61, 61, 71,213, 91, 39,105,182,255,127,
-225, 46,185,247,148,198,109,107, 5,235, 2,107, 75, 63,214, 24, 89, 87, 11,217, 70,176,195, 81,236,179, 14,143,108,157,141, 20,
-146, 35,235,206,217,121, 31,196,198,245,161,167,117,189,127,175,127,159,212, 53, 30, 86, 9, 18,229, 49,110,188,165,194,141,180,
- 72, 30,110,250,252, 77,236,217,119, 30, 47,125,233, 75,233,244, 10,238,186,231, 65,142, 31, 59, 94, 71, 2,215,187,122, 9, 58,
- 85,226, 41,126, 98, 16,145,167,236,220,206,109,191,254, 30,118, 93,112,128,217,164,133, 50,142,143,254,253, 93,220,246,131, 39,
-105, 54, 18,174,145,154,207,127,251, 65, 62,242,123,191,134,239,253,128,219,223,241, 70,214, 23, 46, 99,223, 55,254,149,171, 94,
-253, 82,254,230,159,111, 96,231,204, 4, 46,109,178,187,153,208,235,111,113,108,101,141, 11, 38, 27,116,189, 8, 81,128, 90,209,
-246,158,118, 20, 97, 35, 79, 89,239,175, 34,165, 81, 54,236,165,168, 71,129,158,240, 74,134,108,229,192,120, 54, 56,140,183,228,
-120,242,110,151,230,228, 84, 32, 42, 9, 79,177, 57,164, 61,183,192,198,201, 99, 68,105, 19, 83,230, 40,149,112,230,232,163, 76,
-207,239, 66,234, 6,237,169,148,238,250, 6, 69, 86, 18, 55, 51,138,225, 22, 73,107, 10,225, 21,121,191, 3,162,193,176,115,150,
- 70,123, 17,107, 10,164, 19,108,109,174,210,154,158,101,107, 99, 3, 33, 4,189,213,101, 34,157, 32, 34, 75, 20,105,172, 16,244,
-123, 67, 22,118,183, 66, 74,161,142, 80, 34,197,228, 21, 90, 89, 76, 5,241,132,198, 84, 45,100, 62, 0, 4,121,230,233,247,142,
- 49, 53, 51, 79,101, 52,167,143, 61,204,228,212, 30,136,160, 40, 74,176, 49, 69,177,130, 80, 13,108,213, 71,233, 38,195,225,128,
-214, 76,147, 34,107,208,223,234,113,206,193, 43, 88,220,115, 46,233, 84,155,198,212, 44,195,126,135,214,194, 2, 27,199,143,209,
-158,155,167,177,255, 60, 78, 29,126,148,221, 79,187,132,206,201, 83, 52,102,102, 80, 81, 3, 99, 45,162, 16, 36,205, 6,223,253,
-243,223, 66,138,186, 59, 54,163,155, 43, 99, 79,102, 88, 35, 7, 43, 97,164,160, 33, 61,137, 24,221,182, 97, 88,163, 92,188, 18,
- 88,227, 17, 81,189,103,114,225, 48,147,245, 72,203,215,153,196,193,206, 28,168,112, 42, 22,196, 66, 16, 35,136,157, 64,150,160,
-242,144, 30, 38, 11, 31, 14, 63, 35,106,192,195,200,162, 20,188,237,199, 54,135,156, 41,183,131, 16,230, 53,236,152, 77,120,236,
-147, 95,226,252, 95,122, 5,185, 3,157, 38, 68,179, 59,194, 39, 73, 55,198,185,220,194,215, 50,253,122,180, 45,164, 67,136, 8,
- 95, 25,116,156, 98, 81,180, 91, 45,126,255, 51, 63, 96,113, 2,250, 37,220,252,233, 91,121,205,219,174, 35,239,231, 52,167,154,
-108, 61,112,138, 75, 38, 52,143,119, 74,148, 24,237, 47, 67, 2,221,161, 84,241,172,215,252, 42,119,221,242, 17,244,196, 4, 66,
-203, 80,216,147, 24,107, 42,166,230,119,113,228,158, 59,121,241,213,175,103,179, 48, 28, 76, 85,184, 24,249,109,105, 86, 26,105,
- 78, 14, 74, 94,113,245, 69,188,239, 35, 31, 32, 55, 21,107,167, 78, 99,139, 16,163,107,243,156,138, 6, 60,248, 29,186,223,253,
- 23,102,159,113,136,185,243,247, 18,207,237,160,125,193,165,232,233,133,176, 63, 81, 65,201,227, 69, 18,116, 20,171, 39, 67, 26,
-152, 84, 53, 66,187,142, 96, 69,213,170,237,250,134, 50,126, 14, 66, 42, 85, 0,159,212,157,150,144,245,103, 84,226, 75, 91,179,
-222,109, 13,173,222,142,130, 28,217,186, 66,219, 83,107,138,189, 3, 23,196,118,122,114,110,172, 84,199, 58,168,134,148,221, 77,
-156,169, 72,151,246, 4,181,118,237,217, 14, 25,218,150,198, 84,187, 22,161, 57,204,112, 11, 41, 37, 82,234, 0,209, 49, 99, 67,
- 56,190,166,176,133,192,177, 80,132,109, 89, 91,246, 76, 96,243,251,170,196, 25,139, 45, 11,138, 60,216,211, 16, 1, 44,163, 99,
-133,181, 46,196, 97, 90, 31, 10,186,179, 24,107,168,188,165,116, 22,227, 92,232,220, 48, 88,225, 81, 73, 20,198,250,182,246,166,
-187,144,121,110, 77,184, 20,216,154,109,128, 7,170, 32, 58,180,120,124, 85,143,206,173,175, 53, 7, 18,105, 3, 58,217, 24,195,
-160, 55,164,191,209,165, 69, 69,107,239, 94,250, 67, 19, 70,184,248, 96, 93,171, 9,128, 46,219,126,190,109, 55,131,165,169,241,
- 1, 47,165, 36,142, 19,242,254, 22,182,170,208,222,143,147,238, 24, 79, 54,202, 48,170,171, 42,138,188, 64,173,174, 7, 97,154,
-177,184,202,129, 15,216, 90, 91,120,242,162, 79, 28,151,184,225, 42, 86,192,106, 81,177,101, 29,103, 26, 9,198, 67, 49, 28, 34,
-178, 28,165, 53, 81, 26,209, 90,156, 33,198,177,182,182,197,206, 52, 66, 56, 65,214, 25,240,248,114,135,239,125,239, 17, 42, 36,
-251,118, 76,243,154,159,125, 33,214, 25, 68,179,129,111,181, 80, 19, 9,210, 59, 68, 21, 44,136, 33, 66,192, 81,229, 57,205,137,
-121,118, 60,255,167,120,248,159,190, 12, 58,230,120,127, 72, 9,236,108,198, 44,110,102, 92,244,182,151,179,247,131,127,130, 93,
- 94, 67,103, 67,116,171,189,173, 29, 96, 27,201,208,235,244, 41, 76, 88, 49,121, 41,144,210,143,133,139, 35,254,148, 15,157, 48,
-198,131, 54,181, 78,196, 4, 55,151,146, 2, 87,131,168, 70, 83,229,224,210,169,159,249,218, 38, 39, 71,225, 86,120, 10,235,145,
- 90, 80,121, 72,194,227, 48,190, 95, 69, 42,156, 1,145,132, 74,130,243,134,195,143, 62,194,163,143, 31,227,226, 75,175,225,133,
- 47,124, 33,189,173, 62,247,223,127, 63,135, 15, 31, 30,221,111,209,145, 82, 68, 24,168,125,115, 94,192,145,175,127,138,133,133,
- 93,252,207,207, 63,138, 94,152,229,104,167,207,109, 95,250, 51,222,245, 95, 62,128,214,224,163,136,199,143, 46,147,157, 62, 70,
-188,117,150,125,207, 62,200,190,230, 44,221, 97, 65,123,115,157, 67, 59,167, 73,251, 57,155,131,140, 71,150,123, 76,181, 82, 10,
-107,217, 55,147,208, 93, 29, 50, 29, 9, 86, 7, 37,115,177, 98, 50,133,161,205, 41, 81, 68, 46, 98,162,142,168,123,138,102,103,
-252,194,139, 17,112, 65, 41,132,213, 88, 87, 50, 44, 29,199, 31,189,135,153, 93,187,145,222,160,226, 22,241,142, 9,214,143,159,
- 96,102,105, 23,235,167,206, 80, 20, 57,131,173, 62,105,220, 68, 42,144,137,199, 21,150,108,171,194,187,138,124,107, 19, 25, 53,
- 40,250,155,164,147,115,116,151, 79, 51,179,235, 0,203, 39, 54,136, 14,164,224, 84, 16,128,200,136,206,242, 25, 84, 28,177,185,
-118, 22, 37,125,240,101, 17, 4, 28, 85, 94,209,235,117,217,177,103,145,162,172,144,194, 99,170, 10,231, 4,189,124,147,233,217,
- 57,122,107, 91, 72, 28, 69, 57, 68, 69, 45,146, 84,177,190,226,104, 52,115,148,146, 56,215,160, 50, 57, 81,163,205, 86,119, 35,
-236, 73,109,133, 47, 37,150,138,134,246, 36, 81,147,181,141,101, 90,173, 54, 73, 60,131, 82,146,205,181, 99, 44, 52, 46,160,119,
-118,153, 40,105,176,121,236, 24, 69,153,163,250,125,178,147,199, 57,231,138,171, 56,121,223,157,204, 31, 56,111,236, 83,141,146,
- 36,172, 9,206, 30,225,129,127,252, 56,194, 11,180,240, 20,206,147,123, 79, 37,160, 26,171,159,194,191,198,225, 77, 66,144, 72,
- 73, 74,240,158, 23,194,163, 74, 17,124,151, 58,156,245, 35, 23,148, 24,141,242,107,218,146, 29,249,134,149, 8,123, 53, 91, 51,
- 47, 44,164, 74,160, 43, 16,165, 64, 88,143, 42, 36,210,168,122,135, 62,114, 64,203,177, 16,234,158, 78, 69,233, 32,173,161, 87,
- 87, 77, 70, 65,168,162, 4,143,125,226, 22,206,125,199,235, 48, 86,224, 68,132,158, 89,194, 14, 7,117, 55, 18, 60,211, 78, 10,
-192, 32,163, 24, 39, 35,132,205,234, 40, 74,197,226, 76,202,179,222,114, 35,237,102,240,139,122, 5, 31,253,251, 7,121,222,243,
- 47,100,106,105,150,245,149, 62,115,151,239,229,242,123,215,184,117,253, 12, 7,163,167, 0, 32, 4, 84,206,115, 40, 81, 60,243,
- 21,239,228,129, 91,255, 6,149,166,148,121, 70, 43,105,145,164, 17,191,242,138,183,112,203,189, 79,114, 40, 85, 44, 37, 50,240,
-241,235,215, 44, 86,146,141,204,144, 36,130, 91,110,252, 35,246, 95,113, 25,157,213, 85, 92, 97, 49,121,129, 29,230, 24,213,196,
- 13,114,202, 47,253, 25, 78,122, 14,190,226, 90,226,217, 41,212,244, 60,141,115,206, 67, 36,237,176,239, 86, 2, 92, 5,186, 13,
- 8, 76,191,194, 14,186, 72,169, 3,209,205,213, 72,206, 58,251,124,164, 80,151,245, 28,207,153,170, 22,201,185, 32, 56,244,129,
-197, 61,158, 45,142,246,166,118,148, 83,109, 17, 94,213,100, 54, 95,219,206, 70,222,159, 80, 80,133, 14,196,181,113,119,238, 69,
-176, 63, 84, 38, 64, 93,172, 33, 63,123,154, 97,119,157,201,253,231,193,198, 90,152,176,168,144,213, 30,197, 73,248, 26,128, 41,
- 50,164,212, 72, 29,161,164,170, 59,156, 58,190,212, 86, 65,144, 70, 80,160, 91, 28, 85, 21, 68,117,190, 78,104, 51,101,137,177,
- 65,201,110,173,197,216, 58,112, 5,143, 29, 86, 40,173,176,245, 24,222,121, 95,255,222,138,188,176,129, 39,225, 28,194, 57,164,
-208,184,122,212,110, 17,148,117,178,155,179, 22, 99,131,216,205, 26, 59,222, 43,135,180,185, 16,187, 42,148,168, 59,189,112, 33,
-138, 84,184, 92,142,246,178,130, 16, 55,187,210, 27, 48,167, 5,241,233, 51,100, 19,211,232, 56,236,165,181, 50,232,122,246,171,
-116,224, 48,200, 56, 70, 15, 11,220,176,192, 54, 83,226, 58, 92, 40,138, 20, 91,189,173,122, 98, 82,227,201,252, 83,124,235,214,
-133, 86,180,223,167, 18, 10,238,188,143, 92, 72,232, 15, 81, 94,241,192,153, 85, 78, 14,114,172, 84,148, 82,114,182,159, 49, 28,
- 20,136,122, 85,100,159, 18,206,218, 72, 52, 81,164, 72,202, 64, 72, 89,237,103,224, 60,137,146,244, 77,157,186, 39, 97, 50,141,
-104, 55, 98,132,144, 12,135, 37, 31,253,208, 63,242,211,175,188,146,189,151, 28, 10,187,226, 56, 66, 54, 26,200,134, 12,182,208,
-162,196,185, 24,165,155, 44, 60,247,167, 88, 89, 61, 77,235,194,243,248,210,239,188,143,115,230,218,204,122, 73, 99,189,207, 79,
-125,237,239,105, 94,122, 57,213,145, 99,196,147, 83, 40, 61,138,232, 86, 63,150,216,230,189,167,180, 6,139, 71, 73,106,200, 89,
-237,182, 82,132,169,234,168, 91, 55,161, 73, 81, 58,188, 76,120,129,173,195,137, 70, 49,168, 74,201,176, 22,144, 16,215,116, 77,
-148, 39,141,195,209, 19,169,218, 72, 48, 66, 30,235, 32, 28, 30,189, 21, 66,143,181,184,232, 72, 16, 89,207,174, 3, 7, 57,112,
-232, 34,178, 92,241,195,123, 30,226,171, 95,253, 6,214, 11, 94,245,234, 87,115,248,145,195, 97, 85,234,235, 78,221, 56,137, 33,
-124, 88,139, 18,214,166,167,120,206, 47,191,144, 95, 47, 62,199,247,159,236,114,227, 45,127,197, 86,123,142, 55, 94,114,128, 91,
- 30, 61,202,225,147,103,185,224,208, 94, 68,103,131,244,218, 55,144,124,235,239,136,174,120, 25, 31,126,249, 59,249, 95,247,124,
-156,210,127,133,118,154,226,243,156,211, 50,140, 72,103, 82,205,230,192,224,164, 36,141, 4,173, 8,180,176, 60,239, 57, 23,114,
-254, 75, 94,134,207, 50,146, 10,154,141, 41,116,148, 82,174,173, 98, 58,235,216,173, 46,101,103,157,188,211, 65, 84, 37, 54, 74,
-144,213, 16, 83,101, 24,103,169,240,124,251,107, 55,243,140,231,188,148,120, 98,138,124,171,139,200,130,120,173,172, 2, 51, 57,
- 73, 19,178,238, 38,179,187,247,210, 91, 95,197,148, 21, 58,105, 82,230, 25, 81,210, 64, 72,131, 43,160,183,213, 35,105, 42,108,
-213, 34,207,215, 89,220,119,136, 97,111,131,164,217,194,123, 71,214,235,227, 40, 41, 7, 61,240, 38, 20,222, 78,135, 52,149, 68,
- 19, 41, 42,134,249,165, 37, 28,138,170,168,208, 81, 69, 97, 74, 26, 58,102,107,163,199,228,244, 4, 82, 8,162, 52,161, 63,232,
-131, 16,108,172,175, 50, 49,221,224,216,147,199,153,223,177,128,148,142, 97, 30, 60,241,101,158,208,219, 88, 38, 73, 21,158, 18,
-165, 21, 91,101,143, 88, 71, 40, 27,161, 92,139,164, 49,207,147,143,254,128, 11, 47,125, 1, 85, 94,176,126,230, 8,231, 93,249,
-147,108,158, 60, 70,220,106,114,246,209,251,217,119,197,181,156,125,252,113,218,115, 59,200, 54, 59,120, 41, 73,219, 19,100, 91,
- 61,166,151, 22,184,241,205, 47, 0, 47, 48,120,134, 6,250, 46,164, 13,149,120,172, 12,234,119,107, 71, 42,208, 58, 87,216, 65,
- 4,164, 58,240,189, 99, 36, 77, 21,124,152,214,133,100, 54, 33, 61,165, 21,193,158, 93,250, 49,135, 60,140,227, 5,170,206,213,
- 86, 94,160, 13,164, 66,162,173, 66,149, 97,209, 20, 85, 2,149,213,105, 5, 70, 34,234,112, 23, 33,130, 21, 72, 57,195,137,188,
-254,128, 88,152,143,224, 39,246,214, 20, 50, 27,196, 84,143,127,242,102, 14,253,244, 11,240,139, 51,216, 2,100,163,137, 47,182,
-112,149, 8, 38,149, 72,131,106, 33,156, 69, 84, 37, 94, 7,149,252,142, 93, 11,252,252,175,127, 26, 81,103, 92,140, 78,169,169,
- 57,248,181, 95,255, 60,159,190,233, 93,180,251, 25,149,111,243,187,239,188,150, 29,159,188,131,247,124,255, 20, 7, 35, 57, 62,
-212, 36, 80, 90,207,193, 68,113,217,243,222,194,231, 63,246, 30, 46,184,252,105,124,241,163,159,226,221, 31,190,137, 61, 2, 14,
- 38, 18,251,148,189,185, 70, 80,122,199,233,204,240, 71,191,253,102, 94,245,142,183,179,113,118,153,206,242, 10, 38, 43,177, 89,
-137,181, 96, 84,139,252,171, 55, 98,142, 61,194,204,101,231, 49,115,254, 30, 84,187,141,156, 90, 34,158, 93, 68,197, 41, 74,219,
- 96,233,171, 10,104,205,130,110,129, 76, 49,107,167,194, 46,182,190,216,132, 49,197,200, 95, 94,231,169, 11, 17,246,208,117, 20,
-166,171, 28, 50, 82,181,117,175, 30,185, 72,182, 61,231,227,184, 86, 66,218, 27,193,247,238,107,197,249,200,203, 35,116,109, 9,
-244, 46,216, 11, 61,152,238,122,237,103, 12,133,223,149, 69,176,165,233, 8, 51,204,232,157,120, 18,161, 85,184,132, 14,131, 75,
- 70,213,251, 84,239, 29, 58, 74,169,202,124,140,177,213, 90, 96,109,157, 54,231, 61, 38,203, 72, 90, 77, 68, 20,225,234, 72,211,
- 32,174, 10,226,184,170, 52,193, 57, 83, 25,170,170,192,228,101,216,169,214, 92,117, 91, 83,236,108, 61,126,175, 10, 67,229,130,
- 80,174,178, 62, 40,255,133,192, 11,135, 41, 76, 77,220,139,193,135, 2,145, 87, 65,145,109,109,216,130, 87,198,162,130,115, 60,
-164,115,141,215, 19,224,141, 32,210,114, 60, 17,241, 50,208, 55, 93, 13, 1,210,141, 20,155, 15,201,135, 57,157,254, 6, 81,236,
-104,236, 92, 64, 87, 30, 37, 13, 90, 43,162, 81,208,142,117,196,182,198,194, 22, 21, 36, 97, 94, 28,233,132, 52,218,162, 26,228,
- 68, 19,205,122,170,225,182,125,164,181,246,192, 12, 6, 56,231,169,214,123,172,123,193,201,238,144, 51, 69, 73, 30,107,202,202,
-146,247,251,232,118,139,103,191,234,249,156,247,250, 87, 48,125,233,179,144, 50,240,213, 85,212,196, 12,187, 88, 23, 49, 60,246,
- 16, 55,188,251,189,148,199, 86,152,197,160,109,137,112,154,190,146, 56,169, 40,140,161, 33, 5,222, 73, 26,210,211, 80,154, 11,
- 23,167,249,250, 45,119,243,246,171,159, 14, 58, 70,232, 40,156, 22, 58,130,164,129,104, 58, 68, 89,162,100, 11,117,249, 85,252,
-105,148,210, 53,158, 11,119, 76, 51, 45, 96,165,128,159,223, 56,193,224,236, 9,170,179,171,193,234,167,131,221, 79, 74, 21, 26,
-131,177,142,192,209,235,118,201,109, 22, 40,166, 46,104,186,180,216,182,155,133,172,128, 64,147, 19,110,123,175, 30,136,139,212,
-232,214, 80,216, 35, 25,206,180, 70, 4,145, 10,255,159, 80, 53, 67,192, 67, 36,221,216,223,174, 35,208,113, 56, 48,242, 98,123,
-226, 56,114,127, 26, 91,191,149, 6,118, 45, 45,241,173,111,126,135, 83,103,187,100,133,199,186,240, 92,220,254,157,219, 2,178,
-191,190,140,107,173, 36,177,151, 88, 95,139,211, 28, 44,175, 30,231,201, 7, 54, 57,123,226, 12,239,248,200, 13, 60,118,203,231,
-208,170,100, 71,211,241, 51,207,187,130,219,190,123, 23, 15, 45,159, 37,190,242, 5, 48,220, 96,250, 89,207,224,137, 91, 62,202,
-115, 47,156,102,237,214, 91,121,227,203,159,198,111,124,244, 54,158, 62,215,196, 13, 13, 11,141,152,205,202,176,163, 25, 49,232,
- 21,172, 34, 25, 86,142, 75, 38, 12,123, 46,122, 46,235, 15,159, 65, 74, 73,167,211,195, 84, 71,144, 66, 33,227,144,181, 92,150,
- 18,167,231,240,243,139,117, 83, 16, 68, 54, 18,201, 4,158,139,237,128,199,143,221, 79,190,181, 73,212,108, 99,202, 62,205,169,
- 5, 84,210,196, 20, 37, 19,179,115, 20,217,128,214,212, 44,195,225, 32, 96, 1,243,156, 56,210,117,182,120,133, 23, 26,100, 73,
-179, 61,201,160,215, 37,105, 79, 97,205, 16, 31, 57,146,246, 36,101, 62, 64, 74,205,196,204, 36,249,112, 64, 26,167, 20, 69, 65,
- 26, 39, 68, 11,237,154,167, 12, 54,207,177, 6,182, 54,215, 65, 54,113, 6, 36, 2,137, 34,110, 78,146,103, 21,222,105,124,217,
- 71,136, 8, 83, 25,164,138,201,178, 33,179, 11,243,108,172,109, 48, 61,221,160,215,205,137,210, 10, 95, 9,250,189,138,170,176,
- 88, 57,164,217,108, 34, 69,204,176, 42, 17, 42,166,215, 95,195,186,138,246,196, 36,155,171, 39,201, 6, 29, 22,247,156,199,217,
- 39, 31,161, 44,134,100, 3,197,194,254,167, 81, 22, 57, 46,207,200,138,156,180,221,162, 61, 61, 71,111,125,133,153, 93,123,185,
-225,103, 47,160,225,130,101,169,178,158,190,245,228,214, 83,138, 64,123,139,106,178, 92,164,131,192,201,123, 81, 71, 98, 11,180,
-146,164, 50,208,171,172,243,104, 32,243, 62,192, 97, 68, 24,209,134, 38,209,227, 92,157,225,174, 5,190, 10,133, 56,242, 2,233,
- 5,145,135, 68, 75, 34, 43, 72,100, 40,230,110, 40, 80,165, 64,148, 33, 46, 21, 83,175, 89, 71, 43, 64, 47,120,120,121,192,114,
- 5,145, 15, 43,192,197, 52,240,197,125, 13, 42,242,222,163,164,224,200, 23,190,201,190,151, 61,135,104,247, 2, 86, 64, 85,166,
-232, 20,156, 13,123, 1, 95, 5,107,154,136, 27,136,178,100,215,129,253,188,255,125, 55,242,221,227, 67, 22, 27,144,104,232, 85,
- 97, 26, 96, 44, 44,204,193,219,223,252, 9, 62,251,229,255,135, 19,135,143,178, 21,195, 91,222,126, 21,115,238,123,252,218, 15,
-207,132,253, 58,219, 14,161,202,122,246, 38,146, 55,254,242,251,112, 64, 90,239,205,171,122,101, 65, 29,243, 24, 75,193,153,204,
-242,234,103, 95,196, 31,124,226,143,168,172,101,245,196,201,128, 12, 45, 42, 92,110, 67,244,237, 99, 63,160,251,111, 95,162,189,
-127, 7,231,188,238, 90, 84,163,137,108,183, 17,233, 28,186,213, 66, 10,139,212, 22,100,132, 31,118, 16,173,105,188,110,131,106,
- 32,244, 28,167,111,248,217,241,238, 54,200, 86,228, 24, 32,237,107,184,199, 56,132, 69, 4, 27,148,212, 50,136,234,148, 10,162,
-183,177,221, 71,142, 59,251,145, 78, 2, 33, 2, 27, 94,248,237,156,239,218, 47, 62, 10, 13, 9,241,169, 22,145, 68,148,103,143,
-134, 91,152, 28,227,194,112, 56,100,210,192,103, 57,189,211,167,137,218, 45,210,137, 22, 89,119,139, 56,141, 81, 73,130, 20, 97,
-130,166,180,194, 20, 5,101,158,133, 67, 54,138, 17,101, 80,191, 59, 2,188,195, 57, 95,167,194,217,113,252,104, 85, 57, 60, 22,
-107,130, 69, 45,192,100, 42,172,183,136, 74, 96,188, 9, 16,148, 58,232,195, 88, 75, 85, 84, 20,165,165, 48,150,178,242, 24,239,
- 2,235, 95, 73,170,202,162,211, 80, 44,156,177, 84, 88,156,146,120,235, 66, 3, 98, 66,199, 46,132,160,172, 3, 73, 70, 30,251,
-162,176, 36,105, 18,180, 0,222, 17, 41, 31,130,130,156,161,244, 1, 3,155,101, 37,173, 86,147, 65,111,139,125, 51, 77,202, 66,
-144,245, 75,242,173, 1,105,146, 80, 33, 80,198, 34,136, 49,206, 17,137,138, 88, 69,200, 90,200,231,117, 24, 17, 11, 33, 72, 91,
- 45,178,238, 38,173,197,153, 26,162,100, 33,170,199, 81,222, 65,101, 49,253, 28,133,228,142,110,206,177,188, 12, 84, 52,227,200,
-187,125,158,243, 51,207,227,249, 31,255, 24,186,213, 2, 98,108,182,133, 43,134, 99,148,174, 53,107,164, 75,231,112,244,223,190,
-204, 85, 63,251, 59, 44,237,217,197,244,197,255,129,139,207,191,144, 99,199, 78,208, 95, 62,204,197,203, 39,185, 4,139,205, 74,
-196,116,139,126, 97,240,214,211,140, 60,189,202, 50, 59,217,224,200, 55,238,230,252,159,123, 57, 62,138,144,113, 4, 42, 25, 51,
-219,141,245,204, 93,126, 37, 15,127,230, 83,108, 25,207,249,139, 83,200,193,128,199, 15, 94,194,119,207,187,152,127,124,250,179,
-248,193,209,199, 89,123,242,112, 16, 95, 74, 21, 86, 54,226,169, 36,228,240,181, 54, 86,207,140, 37, 5,163,143,131,146,146, 72,
- 8, 76, 45, 72, 68,132, 24,214,250,216, 8,157,244, 72,115,228, 60,206,212,236,117, 21,130,170, 90, 82, 50, 17, 73,144,142, 33,
-161,251,142, 42,135,243, 97, 42,167,164, 39, 86, 34,172,186,106, 45, 19, 46, 48,230, 71, 5,157, 16, 58,138, 51,130,219,191,125,
- 7,235,125,106, 58,224, 40,133, 14,206,174,174,133,115,214, 7,134,135, 78,133,194,196, 50, 8, 59,156, 68, 70,158,179, 79, 62,
- 76, 47,187,128,235,191,254, 53, 40, 51,190,250,255,221,201, 31,222,242, 0, 23,237,153,162, 97, 42,158,136,166, 88, 60,184,147,
-199, 30, 58,203,149, 47,189,134,104,233,233, 44,158,247, 8,135, 94,247, 22,212,161, 75, 89,251,224,159,112,222,108,147,153,137,
-148,189,165, 99, 79, 43,101,178, 40,185,103,163,207,116, 67,211,207, 13, 66, 64,187,149,114,250,248, 49, 54,215, 58, 28, 63,181,
- 66, 51,209,180, 91, 45,156, 80,172,108,108,177,214,233, 50, 63,217,100,162,221,166, 44, 77,253, 98,133, 17, 91, 20,215,227, 64,
- 37, 73,212, 57,100,253,140,217,125, 9,141,246, 60,182,202, 17, 50, 38,110,164,244,179, 77,148, 82, 68,105,194,112,229, 44,141,
-137, 38,249,233, 1,115, 75,243,208,235,209,104,207,208,239,108,177,113,234, 56, 51,231,236,162, 49,145, 98,170,130,188, 7, 71,
-238,253, 87,246, 63,253, 82,170, 82, 32, 35,203,214,102, 31, 99,251, 32, 44, 85,230, 64, 26, 26,173, 73,112,146, 60, 51, 97, 71,
- 28, 9,188,136,217, 92, 93,103,102,190,137,179,154,202, 22, 8, 29,200, 65, 85,153, 33,170, 10,165, 82,202, 60,199, 58,135, 80,
-208,221,236,145,245, 51,166,166,155, 52, 39, 26,148,213, 16, 27, 68,222, 24, 91, 18, 71, 49,152,138,138,146, 94,111, 64,150,195,
-210,252, 34, 62,181,164,141, 9,116,212, 36, 31,150,156, 61,254, 36,173,153, 57,218,211, 51, 52,166,102,201,186,235,244,214, 10,
-226,180,197,196,220, 34, 81,218,100,237,196,113,102,119,237,230,230, 63,125, 39,229, 96, 64, 44, 3,209,173,235, 60, 67, 60,185,
- 11,233,106, 78, 62,101,213, 89, 65, 42,195,222, 71, 85,146, 72, 43, 34, 33,137, 28,196, 82,210, 20,130,161,115,116,132, 37, 22,
- 4,166,113, 72,225,164,244, 4,100, 46, 18, 85, 6,229,123, 3,129,116,129,135,220, 20, 33,105,173, 33, 36,202,200,240, 28, 90,
-129, 44, 61,210,132, 23, 65,212, 6,247,169,253,115,172,116,183,248,198,247, 78,241,240, 0,214,109,173,203,115,112, 81, 67,143,
-169,104,163,207,225, 8,193,125,236,159,110, 35,153,110,208, 59,103, 7,151, 93,247, 19,224, 12,221,181,205,176,131,149, 30,239,
- 36,182, 44,104, 54, 82, 94,115,253,255,230,190, 45,195,158,118,128,226,196,163,122,228, 2, 24, 71, 1, 86, 84,188,233,250, 63,
-229,255,124,250, 93,172, 60,113,140, 50,137,121,233,207, 95,205, 95,171, 31,240, 75,223, 59,205, 66, 29,169, 59,246,174, 58, 88,
-140,229, 88, 9,187,157,201, 28, 46, 52,171,153,225,192,226, 20,255,112,243, 7,152, 63,116, 62, 27,167,207,224, 75,131, 41, 42,
- 92,110, 48,186,129, 63,250, 32, 27,183,220, 68,107,105,130,189, 47,121, 38,205,197, 25, 72, 18, 72,167,112, 58, 69,107,135,180,
- 57, 74,198, 8,155,225,187,155,200,233, 93,208,218,137, 72,102, 64,165,244, 31,248, 30,174,170,130,131, 96, 4,140,175, 15,147,
-113,152, 71, 77, 12, 19,163,147,162,166,197,141,196,133,130,186,155, 87,117,254,184,219,254, 62, 71, 22, 33,165,234,149,149,144,
-219,151,134,250, 0, 20,117,176,134,212, 18, 95, 57, 92,145, 17, 94,229, 98, 28, 67, 28,186,169, 90,219,225, 28, 43,135, 15,179,
-231,210, 75,137, 90, 77,210,118, 43, 8,101, 85, 16,117,153, 42, 64,105,108,145, 99,173, 33,138, 34,140,202, 40, 43, 19,130, 63,
-128, 34,207,198,241,219,214,134, 8, 88, 87, 21,152,194,142, 67,118,170, 42, 16, 41,173, 13,179, 22,161, 21,194,123, 34,111, 40,
- 74,135,169, 66,231, 95, 85, 21,149, 9, 33, 81,227,192, 50,107,208,169,162, 50, 97, 10, 33,234, 92,114,237, 3,190,212, 84, 22,
-235, 29, 85,173,194, 31,141,124, 61,193, 38, 53, 51, 49,193,106,167,135, 3,154,141, 24,231,204,216,105, 86,122, 40, 75, 67, 85,
- 57,140,119, 56, 29,236,111, 11,137,224,225,174, 36,218,216,162,152,242,196, 90,145, 68,154,254,176, 64,105,201,188,144,104,101,
-200, 79, 46, 19, 77,182,107,225,162, 67, 11, 71,172, 99,242,206, 26,222, 31,172, 89, 2,110, 59, 74,213,134,214,176, 28,244,113,
-101, 73,122,222,185,196,247,220, 79, 6, 60,227, 39,159,201, 11, 63,244, 63, 16,105, 74,126,230, 56, 81,179, 21, 28, 30,163,203,
-157, 80,120,111, 72,167,118,242,228,183,191,202,107,222,249, 62,174,189,234, 90,246,238,158, 35, 31, 12,120,211,243,247,242,173,
-251,135,124,255,135, 75,220, 59,181,151,239,118,142,241,250,255, 48,195,220, 35, 71, 57,251,216, 73,228,252, 36,162,114, 76, 68,
- 96,163,136,251,239,124,156,139,127,185, 25,124,225, 42, 10, 30,117, 45,240, 78, 32,116, 74,116,209, 51,185,233, 39, 95,198, 69,
- 75,211, 36,214,114,230,167, 95,197,196,185, 23,114,201,147,103,248,156,157,224,182, 79,255, 53,215,188,254,167,233,173,156, 9,
-238, 12, 89, 91,114,198,180, 56,143,210,154,251,238,185,157,184, 6,205,104,198, 86,251, 80,203,141, 64,200,218,166, 86, 91,210,
-188,171,129, 50, 54, 88,218, 70, 84, 55,141, 68,123,208, 94, 50,161, 52,109, 69,224,119, 16,192, 54, 90, 5,194,160,138,182, 17,
-176, 81, 13,175, 49,118,155,236, 39,124, 16, 7, 75, 31, 52, 74,105,141,129, 85,206,147,213,128,197,235,174,187,142,175,253,203,
-215,131, 69,238, 41,148, 95,245,242,171, 91,255,205,169,240,192, 41, 21, 98,227,172,183,188,252, 23,255,152,120,215,229, 28,249,
-239,111,229,107, 95,188,139, 63,250,175,175,229,212,195, 39,249,149, 63,252, 29,162,229, 83, 28, 76,224,196, 67, 15,114,205,235,
-223, 5,102,141,170,179, 69,243,188,105, 88,125, 18,223,222,199,195, 63,120, 8,132,228, 71,171, 29,146, 68,177,163, 21,115,207,
-234,128,185, 52,102,232, 28, 10,207,190,169, 22,157,110,198,218,198, 38,214, 11, 54,134, 5, 79,156,222,224,241, 51,171, 12,134,
- 3,180,146,156,221,202, 57,190,182,193,233,141, 45, 86,123,125, 78,111, 14, 56,178,178,198,163,167,206,114,124,173,203,201,149,
- 14,135,143, 47,115,197,229, 23,112,206,211, 46,166,123,242, 40, 83, 59,247, 81,100, 3, 6, 27,235, 12,122,125,226, 56, 38,207,
- 10, 6,195, 1,147,147, 83, 40,169,104, 78, 76, 83,100, 21,195, 65,159,222,218,105,230,246, 44, 81, 14, 43,132,104, 49,236,173,
-210,156,110,161,226, 41,132,176,216, 74, 98, 77,216,123, 97, 44,147, 51,243,248, 74, 17,199, 18,107,160, 44, 11,146, 36,166,223,
-239, 16,197, 49,145,142,113,214, 49, 53, 51, 71, 20, 69,148,133,161,204, 75,156,179, 84,182,194,228,134,193, 32,199,122, 67,191,
-179,133,179,134, 78,175, 32,142, 53,157,205, 1,222, 25,138,162,160,170, 12,206, 9, 42, 27,118,173,195,204, 49, 49,181,200, 68,
- 99,146,115,118,159,139,140, 60,113,212,164,219, 91, 71, 75,193,194,206, 3,196, 73, 66,107,102,134,193,230, 6,101, 54, 64, 8,
-135, 78, 82, 90, 51, 59,112, 64,247,236,105,166, 22,119,242,240,247,191,192,247,191,240,177, 90, 49, 11,185,247,116,235, 31,185,
-247,148,158, 58, 30, 50, 32, 10, 83, 5, 10, 73,106, 5,169, 16, 76,106,201,172,148, 76, 40, 69, 44, 20, 81, 29,179, 89, 57,208,
-245,238, 91, 56, 17,108, 28, 72, 90, 74,145,120, 65,138,160, 45, 5, 13, 47, 73,189, 8, 63,143,164,233, 20,109, 33,137,209, 8,
- 27,168,170,210,201, 26,214, 22, 84,211,101,162,121,207,205, 71,249,250,143,182,216,240,208,241,161,232, 86, 14, 38, 35,168,156,
- 99,103, 83, 49,213,208, 99, 13, 70,240,222, 6, 81, 77,227,220, 67,252,218,135,110,231, 63,253,213,119,121,228,174, 71,249,169,
-107, 14,129,181, 52,218,109,100,222,167,101, 28,131,141, 13,222,242,250,203,184,227,235, 15,115,188,158, 40, 84, 35, 59, 94, 72,
-138,164, 89,127,136, 50, 99,184,243, 43,119,241,186,119,188,132,238, 74, 7,209, 74,216,251,140,157,188,121,103,131, 47,220,125,
-134, 45,239, 73,159, 18,182, 50,182,104,242, 84, 29,153,103,173,112,124,240,255,125, 27,191,255, 23, 31, 32, 43, 75,134,235,155,
-152,172,196, 12,134, 24, 26,152,179,167, 25,254,195,159, 49, 56,250, 8,123, 95,114, 57,243,151,236, 37,158,158,128,214, 36, 62,
-153, 8,110, 16, 10,148,116, 68,173, 38,194, 6,194,151,154,217,133,156,216,141,143,167,195, 68,138, 69,142,191,255,141, 99, 80,
-197,216, 59, 51, 26,187,143, 5,112,163,250, 62,242, 37,110,143,135,199, 45,142,120,138,243,105,244,255, 56, 55,254,229, 16, 77,
- 58, 98,188,251,113,196,106,192,207,214,236,246,209,151,181,134,246, 21,207, 71, 53,154, 1,217, 91,133,124,113, 83,150,216,170,
-160, 44, 10,178, 94,143, 39,238,190,135,131, 87, 92,142,136,146,224,239,151, 18,165, 35,170,108,128, 45,194,110,188,202,139,218,
-205, 96,235,192,149,224,136, 9, 4, 95,135,175, 12,101, 89, 6, 59,107, 89, 5,248, 76, 81, 82,228, 57,166, 42, 40,134, 5,101,
-101,199,169,114,179,110,136,233,117,233,148, 46,168,190,109,232,236,135,153, 9,142, 15,107,195,190, 93, 8,154,192, 30, 95, 50,
-111, 42,166,171, 2,223,233, 83,102, 37,157,229, 13,182, 54,250,156, 62,221, 9,127, 78, 94,134, 32, 21,130, 50,122,247,142, 5,
-142,158, 89, 14, 84, 52, 31,156, 29, 82, 5,254,120, 81, 57, 42, 99, 41, 43, 75,105,130, 48, 78, 27,195, 82, 83, 82,148,134,163,
- 61,199,161,182, 38,235, 15,113,205, 36,104, 24,132, 32, 51,134,103,165, 9, 13, 28,190,151, 83,157, 58,141,237,110,161,167, 39,
-145, 73, 10,214,224,140,163,189,107, 9, 17,169,144, 97,175,158,194,123,207, 50,178,147, 43,228,221, 30,213,218,128,153,213,211,
- 20, 78,241,130, 27,126, 7,155, 13,177, 69,137, 78, 26,168, 40,169,229,219, 98,236,170,112,214, 80,244,135, 60,250,157, 59,185,
-249,174, 7,248,169, 23, 93,203,222,102,132, 22,103,121,236,240,143,104,165, 5, 23, 93,124, 30, 59, 91, 13, 30,249,209,227, 12,
- 58, 25,127,124,248,123,236,216, 59,199,173,255,240, 21,210,102, 76,130,167,161,160, 95, 84, 92,254,178,231,226,132, 64,214,185,
-247,163,252,116, 41, 99,212,206,189,124,255,189,239, 35, 79, 83,222,221, 27,240,205,187, 31,226,224,204, 4,215,253,204,155, 56,
-245,196, 41,238,185,243, 46,222,248, 75,111,167,232,119, 80, 73,138, 78, 82,148,142,183,131,134,234,231,250,195,239,255, 79,172,
-109,172,212,156,253, 32,220, 77,180, 68,233,176, 30,171, 76, 29, 94, 36,130, 80, 23, 2, 60, 70,178,109,214,112, 38,232,193, 90,
- 90,208, 84,138, 9, 45,104, 39, 97,114, 83, 67,164,209, 18, 18, 37, 80, 64, 26,135,204, 11,173,196, 56, 59, 39,252, 8,150,109,
-172, 64, 59,129, 54,130,216, 8, 94,251,234,159, 97, 98,122, 1,132,102,144,101, 60,114,248, 71, 65, 35,161,106,143,122, 45,116,
-214,101,108, 48,206,146,196, 97,172,173,133,195, 8,137,219,121, 25,247,252,198,139, 56,243,196, 10,175,185,238, 34, 78, 62,246,
- 36,221,178,228,167,127,238,183,248,244, 63,254, 29,207,191,254, 77,188,237,218,103,132,111, 46, 59,134,109, 45,177,242,119, 55,
-176,227, 13,191,200,137,219,111, 98,110,113,142,187,159, 56,195,179,118,207,225,164,226, 88,119,200, 84,172,208, 4,232,194,148,
-134,210, 75,238, 58,190, 50, 22, 21, 73, 4, 70, 8,132,135, 44,210,144, 89,140, 51, 52,227, 4, 47, 4,153,177, 8,130, 90,185,
-178,142,202,134,108, 99,107, 13, 71,143,159,230,234, 40,166, 57, 55,143, 49, 5, 42, 74, 73, 26, 41,222, 91,154,179,211,193, 34,
-180, 12,121, 94,161,211, 38,107,203,235,100,189, 13,102,166, 39,145,102,103,136,230, 83, 26,239,115,162,116,130, 34, 47,176, 69,
-129,104, 53,209,245,254,197, 27,135,208, 2,235, 10,166, 22,230,233,173,175,146,229, 25, 81, 28,208,144,147,147,139, 68, 73, 0,
- 51,120, 25,209,237,173, 81,149, 10,124, 69, 86,100, 72, 19, 81,102,125,116,148,176,185,185,197,212, 84,131, 65, 94,146,146,146,
-196,146,126, 81,161,188,162, 55,204, 73,162, 56, 48,140,177,120,165,136,244, 36,147,147, 17,101, 86,145,180,155,156, 90,126,140,
- 61,187,246, 49,191,251, 92,146, 36, 13,251, 78,192,186,130,147,143,222,199,190,139,158,137,212, 49,157,213, 83, 44,205, 46,145,
-117,215, 17, 90, 51,185,176,147,147, 71,239,230,150,143,254, 30, 66, 10,202, 90,197,102,132,167,231, 60,165, 11, 20,185, 49,162,
- 80, 6,229,178,179, 65, 68, 23, 35,152,209,130, 89,169,104,138,144, 15, 44,165,192, 10, 79,229, 37,109, 25,246,233,206,215, 15,
-155,135,180, 22,195,201, 90, 69, 26,185,240, 30,107, 33, 72, 76,216,173, 55,133, 32, 54,146,246, 57,251,152,187,244, 42,150,255,
-233,243, 97, 34,235, 67,182,250,163, 91, 25, 31,186,179, 79,210, 8, 53,166,170, 87,237,186,152, 39, 13,255, 0, 0, 32, 0, 73,
- 68, 65, 84, 46, 64, 41,208,179,240,185, 99, 61,222,164, 21, 75,173,104,108,137,164, 46, 48,253,199,143,240,213,191,127, 59, 79,
-222,251, 40,205, 68,226,187,125,178,227,171,156,126,236,104,237,175, 14,230,211,101,231,248,212,159,191,129, 55,255,250,103, 57,
- 81,133, 63,167,165, 97,232,194,222,126,163,130,182, 14, 54,186,141,188,228,177,191,248, 12,231,190,253,181, 44, 31, 63, 77,148,
-166,180,174, 62,159,175,239,157,231, 15, 62,114, 7,159, 62,181,197,129, 68,109,139,224,252,118, 45,141,149,100,232, 37,247,125,
-255, 51,244,139,156,147, 63,122, 2,111, 2,209,206, 37,147,216,245, 46,217, 87,254, 2,107, 50, 22,174, 58,159,169,115, 22,195,
- 78, 58,110,224,117, 18,186,196,178,143,112, 6, 41, 99,164,146,152,245, 19,168,169,121,226, 93, 23, 64,123, 15, 94, 36, 1,191,
-220, 60,143, 35,191,247, 6, 16, 42,236,217,145, 53, 25,180,238, 88,234,136, 82, 95,123,150, 69, 61,178, 14,202,119, 59, 42,195,
-224, 3,203, 94,198,186, 46,210,245, 97,103,106, 65, 94,189, 31,118,198, 33,234,221, 48, 35,252,236, 72, 57, 25,141,188,122,126,
-236,123,223,252,250,141, 44,190,225, 87, 97,123,113, 49,182, 90,153, 50, 8,152, 38,230,102,184,255,107,255,194,149,215,255,108,
-216,137, 87, 85,173,196,206, 41,243,140,114,152, 5, 58, 89, 94, 82,149, 65,212, 22, 34,101, 3,199,220, 25, 67, 81,228,129, 30,
- 87,134,120, 83,147,231,148,101,137,113,150,188,168, 48,245,247,156, 85,134,103,205, 73,170,147,235, 60,126,214,144, 77,107, 90,
-174,196, 88, 75, 67,105, 86,125,142,203,195,124, 97, 82,194,211, 68,198,130, 52,148,195,138,181,129,161, 95,193,176,178, 40, 32,
- 49, 33,116,100, 30, 65,177,145, 99, 61,156, 57,185, 65,225, 28, 75,251,118,112,247,169,135,144, 73, 74,210, 0, 21,171, 32,180,
-171,121, 12,149,181, 65,253,110,195, 62, 63, 31,165,132, 25,195,108, 43,102,169, 5,135,215, 12,151,204, 70,172,244, 7,108,169,
-152,169,118, 3, 83, 89,230,180,196, 84, 54, 8,181,188,160, 92,239, 80,126,239, 94, 92, 28,211,190,248, 16, 82, 43,108,105, 16,
-177,197, 85, 37, 50,142, 65, 36, 53, 10, 45, 4, 22,249,202, 98,132, 68, 25,216, 20,158, 63,121,206, 47,242,182, 63,249, 53,118,
-191,228, 37, 33,225,206,123,164,175,159,167, 26, 53, 43,116,130, 93, 91,225,245,239,185,129,183,189,249, 87, 56,120,254, 12,159,
-254,200, 71,248,137, 93,187,248,201,231, 94,203, 11,126,227,125,252,207,223,123, 59, 79,123,250, 46,238,189,127,158,123,143,108,
-240,181, 15,127,144,171, 94,253, 58, 62,112,234, 1,110,120,218,213,168, 72, 82,120,104,181,162, 16,163, 92,214, 78,141, 26,150,
-227,157,161,181,255,105, 84,171,167,185, 13,248,231,181,206,120, 90,244,233, 47,254, 51,215, 60,239, 74, 46, 59,180,159, 91,191,
-251,157,237,164, 72,169,235, 21,145, 24, 79,148,172,181, 40, 37, 57,115,226, 48, 90,134, 96,179, 17,175, 95, 73,137,178,130, 88,
-133,102,165, 52,182, 46,232, 30, 99, 71,187,244,240,218,186, 26, 32,227, 44, 20, 21,248, 36, 4,147, 9, 17,154,157,209,115, 29,
- 17, 26, 36, 98,168,180,196, 43, 71, 85,143,253, 81, 96,140, 32,174,215, 90, 74,128, 52,193, 17,132, 23,124,229,179, 55,193,244,
- 28, 51,115,187,120,213,203, 47, 71, 40,205,223,254,253,141, 88, 31, 60,238, 35, 75,155,180,202, 34, 35, 16,113, 56,176, 99,163,
-208, 86,112,226,177, 47,211,125,224, 71,180,159,251, 42,174,248,157,255,204, 93,183, 29,230,238,229, 30,175,188,112,129, 19, 55,
-125,140,203,119,206,241,161,219,238,103,253,190,191,198, 14, 11,116, 75,227, 47,126, 3,174,183,202,161,107,246,161, 60,204, 52,
- 99, 38,167,166, 56,221,205,216, 51,219,164, 17,199,244,202, 96, 1,105, 41, 56,220,205,233, 13,115, 54,242,146,204, 58,250,101,
-184,141, 26,239,201,138, 10,235, 42, 26, 58, 14, 34, 17,239, 80, 94, 48,145, 42,210, 56,162, 29,167, 52,226,136, 94,127,200,149,
-151,156,203,207,189,251,221,148, 89, 78,212,104, 33,117, 68, 49,236,210, 90,220,131,183, 6,161, 34,138,173, 1,105,179, 5,206,
- 96,108,133,160,160, 61, 51, 15,113,130,136, 21, 34,110,132,112,134, 50, 39, 74, 83,162, 56, 66, 74,201,176,191,133,208, 33, 30,
- 54, 78, 27, 68,122,146,126, 55, 35,105,107,144, 17,147,179, 83,164,205,132,214,228, 52,101,153, 83, 86,158, 94,167,143,142, 68,
- 16,141,120,139,177,193, 51, 61, 24, 12,192,195,153,229, 77, 10, 91,209, 31,228,120, 36,155,189, 33,131,172, 34, 73, 83,166,103,
-166, 41, 76,196,122,127,128, 19,158, 40,137, 72,149, 68, 74, 67,164, 98, 38, 26, 49,179,173, 54, 87, 93,117, 29, 7, 46,126, 54,
-173,118, 11, 33, 29, 18,193,230,250, 9,148, 74, 56,247,178,107,169,202,156,229, 99, 15,178,227,224, 69,100,189, 14,173,217,121,
-162, 70,155,108,176,202, 39, 63,240, 54,114, 31,148,237,165,244,100,202, 51,116,158,130,208,149,142,226,110,149,222, 22, 55,135,
- 99, 54, 80,252,230,148,100, 90, 9,218, 74, 18, 75, 73, 34, 4,145,133, 4,205, 36, 17, 77, 36,169,208, 52,149, 98,202, 43,102,
- 81, 44, 10,205, 2,138, 5, 52,243, 40,118,168,136, 57,175,152, 66, 51,233, 21,169, 83,156,115,221, 27,185,242,134, 15,177,255,
-181,207,225, 89,127,249,119,236,122,229,203,216,249,138, 87,115,164,211,227,253,119,246,137,210, 80, 72, 19, 5,155, 6,250,118,
-187,145, 28,184,160,252, 28, 90,184,241,190, 77,246,253,194,107,183,185,137, 53,209,140,162,226,240,167,254, 9,121,170, 67,239,
-238,227,156,249,250,247,233, 62,118,164,246, 96,215,170,122, 64, 68,138, 39,110,188,149,143,189,227, 50, 58, 67,104, 72,200,235,
- 49,191,100, 59, 69, 73,213,183,244,162, 95,241,163, 79,126,137,165, 3,251,168,178, 12, 25, 73,170, 93,179,252,254,123,175,227,
- 75,175,184,128, 83, 69, 72, 56, 75,235, 8, 71, 87,199, 56,158,206, 12, 55,127,230,143, 57,115,236, 4, 91,167,151,201,215,214,
- 49,133, 36, 95,239,210,249,171, 63,166,248,218,167,216,113,205, 1, 14,189,246,217,204, 28, 92,130, 56,198, 37, 19,160, 35,188,
- 41,240, 85, 15,170, 45,164, 48,184,225, 58,213,234, 25,228,196, 60,122,225, 92, 72,118,212, 62,228, 28, 49,177,155,229,191,254,
- 67,204,198, 25,156,173,130,237,166,134, 5,248,145, 97,188, 62,232,188,117, 79,105,193,125, 29,230, 82,207, 33, 17, 99,134,190,
-175, 2, 92,102,100,121, 11,116,184, 17, 16, 38,216,116,168,147,192,130,211, 74, 32,132, 27, 99, 97,195, 5, 32, 88,197,132, 16,
- 12, 30,252, 54,208, 8,157,188, 36,120,170, 93,133, 49, 21, 69, 54, 8,207,100, 77,235,184,243,139,159,163, 53, 51,135,138,147,
-208,213, 23, 5, 69,191, 31,186,116, 99,194,247,231, 3,178,212,217, 16, 58,109,171, 18,140,193, 57, 83,255,188,197,150, 21, 85,
- 97, 66,140,106, 89,142, 30, 21,132, 16,204,182, 52,115, 69,143,219, 14,119,120,104, 96,152,104, 70, 65,249,238, 96,163,159,113,
-158,246, 60,173, 28,242,226,104,192,117,141, 33,123,218,142,194,122,250, 78, 80, 33,209,145,100,113, 34,101,126, 34,101,223,108,
-202,174,169,152,189, 19, 49,187, 90, 49,251, 38, 19, 14, 76, 38, 92, 58,223, 98,162,211,101,169,112,248,213, 46,230,244, 58,221,
-227,107, 12, 55,183, 40,242,176, 10, 48, 38,232, 85,156, 11,176, 31,137,103,203, 75,250, 70, 50, 59,157,112,104, 38,193, 9,207,
-227,155,142,253, 30,162, 65, 70, 54,200,217,161,117, 96,126, 24, 31, 66,104, 74, 71, 85, 88,114,227, 24,102, 57,103, 30, 56,204,
-198,234, 58,222, 90,172, 9,107, 11,138,178,142,110, 13,246, 62,231, 65, 36, 9, 88,136, 69, 88, 19,236,153,159,226,216,191,220,
-142,108, 38, 53,142,215,109,231,148,215, 23, 99,107, 74, 14,223,123, 23,115,139, 75,232,184, 96, 70, 27,238,184,251, 9,126,255,
-139,223,226, 5,191,241, 62,148,132,223,122,223,167,152, 88,218,203,174, 11,175, 32,137, 4,247,220,255, 40,177, 86,244,142, 31,
-225, 93,135,239,161, 2, 78,173,116,120,205,239,254, 60,249, 86,191,206,106, 16, 99, 5,170,119,144,236,222,207, 58, 37,255,220,
- 78,126,204,115,190,119,215, 78,148,140,120, 98,179,195,206,185, 26, 48, 35, 85,157,220, 39,217, 30, 51, 5,145,220,233,147, 71,
-176,182, 34,213, 2, 93, 11, 19,163, 40, 56, 38,210, 72, 18, 9,133,150,130, 36, 10, 29,182,173, 47,170,149,169,133,108, 46,156,
- 31,101,157,111,110,106,164,171,212,130,138,224, 6,146,117, 90,237, 40,202, 85, 68, 32, 99, 16, 81, 16, 18,187, 17,144,166,118,
-137, 90, 27, 58,117, 97, 4,177, 21, 36, 78,112,104,255, 94, 14,237, 63,143,221,187,247,208,239,117,185,239,190,251, 66,212,171,
-170, 63,147, 8, 44, 2, 93, 26,135,142,194,158, 44,138,130, 88, 73, 3, 63,250,238,103, 56,117,218,242,171,255,241, 23,120,242,
-150,143,209, 55,130,165, 29,115,196,133,103,179,191,201,175, 94,119, 13,127,241,242, 23,209,123,240, 9,242,134,102,231,179,247,
-176,246,200, 3,152,217, 73,166, 95,244, 38,102, 62,243,223,153, 76, 20,143,156, 88,163, 91, 89,158,209, 78,177,110,147,245,210,
-132,238, 77,122,142,231,134,102,172,105, 9, 73, 83,107, 68, 4,145, 84, 68, 74,147,198,146,162, 10, 0, 8, 45, 71,168,204,240,
- 66, 78, 79, 52,168,140,231,177,227,203,220,240,191,126,147, 43,126,230, 77, 20,155,107,232, 36, 70, 39, 13,178,173, 14,210, 75,
- 54,142, 62,130,138, 19,210,102,131,214,236,116,200, 61,238,247, 17,214,176,255,162, 11,120,242,161, 39,152,152,110, 49,236, 14,
-176,206,208, 72, 99,148,138, 41,141, 37, 31,100, 76, 47,237, 96,216,219,194, 25, 77, 57, 60,203,212,194, 18, 82, 69, 84,213,128,
-178,232,208,154,106,209,237,156, 33,146, 77, 58,249, 26, 85,213, 39,203, 54,145, 40,250,155, 25, 81,170, 48, 70,210,237,108,210,
-158,156,100, 56,200, 80, 72, 78,174,245,152,158, 72,168,140, 35, 82, 49,248, 96, 11, 27,246, 6,148,149,225,210,243, 46,227,254,
- 71,238,161, 42, 60,139,115,123, 56,247,252,167,147, 54, 96,117,249, 56,237,169, 89, 34, 37, 49,101, 78,234, 65,234, 20, 17,197,
-152, 50, 99,215,190, 11, 64, 73, 54,151,143,147,180, 90,204,239, 60,200,112,227, 12,211, 59, 15, 81,102, 3,154, 83,147,252,238,
-175, 60, 7, 41, 60,214, 75,140,243, 88, 27, 70,126,149, 15,153, 90,255,126,202,106, 76,120,232,194,152,213,161,188,162, 33, 20,
- 13, 20,137, 80, 40, 23,108,110, 94, 72, 26,120, 34, 41,112, 14, 38,241, 68, 85, 16,110,164, 46,220, 58,181, 20,200,154,208, 34,
-234,248, 68, 89,139, 76,148, 80, 52,150, 63,199,202, 7,191,197,220,197, 23,145, 29, 57, 65,241,248, 26,223,252,234, 17,254,242,
-184, 99,186, 9,185, 9, 54,144,118,180,173,244,108, 72,200, 70, 1, 48, 53,209, 45, 23, 80,220,123,123,237,141,222,150,162,123,
- 27,186,191,226,236,198, 24,247, 52, 98,111,136,154,193, 28,148, 48,225,107,119, 78,102, 92, 48, 5,107, 38, 28,106,137, 12, 69,
- 60,119,176,167, 5,119,118,224, 29, 23,199, 72, 37,176, 89,206, 99,159,252, 2, 7,222,242, 90, 54,151, 79,160,180,162,240,138,
- 67,175,124, 6,119, 95,178,147,183,221,112, 59, 63,202,131,160,210, 17,210,229, 94,124,249,161, 96,161, 60,121,134,254,242, 26,
- 50,223, 68, 61,250, 15,204,205,193,226, 11,206, 71,183,154,160, 21, 34,141,113, 66, 5, 13,153, 45,240, 85, 81,147,192, 12,190,
- 40, 48, 38, 67, 79, 47, 18, 45, 29, 68, 78,157, 3, 50,197,231, 27,200,198, 4, 98,230, 34,214,191,122, 19,189, 59,110, 9, 3,
- 64, 25,108, 97,206,186, 96,201, 20, 98,236, 63, 20,255, 46,172,107,219, 76, 29,162, 85, 69,125, 73,242, 53,179, 61,132,185,140,
- 38, 28,129, 13,143,243,227,225,136,148,146,209,120,194,213, 42,121, 33, 71,112,143,218,187,107,131,156,216,123,193,202, 63,126,
-136, 29,175,124, 43,248, 12, 91,149, 72, 29,118,203,198,133, 41,128, 20, 10, 17,197, 12, 59, 29,126,120,211,223,114,229,235,223,
-138, 41, 50,156,173, 48,101, 21,166,120, 66,133, 72, 75,111,234,168,214, 17, 7, 62,236,244,157, 9, 29,250,200,179,142,183, 56,
- 31,136,117, 78,120,180,116,108,246, 75, 94,122,225, 60, 63,252,246, 81, 14, 15, 42,118, 44,204, 18,121, 79, 36, 29,179, 91, 93,
-246, 41, 19,130,205,154,142,137,249, 6, 73, 51, 38,207, 44, 26, 67, 85,228, 76,181, 34, 38, 38, 82,100, 35, 70, 8, 65,220, 74,
- 41, 51, 67,175, 55,192, 35,208, 90, 97, 60, 76,204,182,112, 6,138, 60,167,242,130,114,104,112, 74, 48,204, 42,150,123, 3,214,
-149, 38, 78, 34,172,175, 45, 85, 4,161, 90, 28, 41, 58,121, 65,145, 27, 46, 57,119,134, 7, 86,114,156,133,147, 91,138,153,212,
-240, 80,103,192, 11,231, 38,176, 33, 77, 36,116,149,165, 9,178, 9, 32,154,104, 50, 63, 63, 71, 58,191,147,188,183, 73, 51, 89,
-164,202,135, 68,113, 82,103,137, 26,220, 32, 7, 83,225,134, 5, 40,136, 19,197,188, 17,108, 85,134,162,159,227,170, 10, 44,200,
- 58,106, 86, 8,139,247,181,162,220,123,182,182,182,216,185,184,196, 48,239,114,231, 29,143,210,127, 74,224,119, 64,128,123, 92,
-177, 69,231,212, 41,202,170, 98,239,174, 25,140, 49,232, 70, 74,255,241, 71,120,253, 55,190, 74,241,201,255,141,140,226, 80,134,
- 71,139,227, 17, 99,213, 89,212,142,221,220,247,229,207,242,170,103, 61,157, 47,125,235,206, 49, 52,230,205,175,120, 46, 39,123,
-107,108,116, 87,249, 47,215,191, 10,239,202, 64,145,148,122, 60,110, 31,253,163,180,230,209, 7,190, 79, 18,213,128, 37, 31, 0,
-104, 82, 9, 34, 33,136,164,128, 72, 80, 88, 73,110, 92,157,172,247, 84,155,239,104,244, 94,127, 79, 53,228, 93,136, 48,158, 87,
-202, 81,137, 32,162,171, 45,237, 88,231,208,162, 22,201,250, 64,145,115, 2,156, 23,219, 81,175, 54,224, 2, 68, 9,174, 6, 2,
-189,232, 5, 47,230,174, 35,167,248,246, 61,247,241,196,137,147,148,214, 32,253,136,251, 16, 60,245, 74,130,174,188, 71,121,143,
-214,170,246, 15, 42,164, 87,108, 30,126,152,119,124,253, 75,244,127,248,101, 62,252,187,159, 34,154,108,115,253,158,105,110,121,
-224, 4,229, 99, 9,239,254,208, 47,242,111,159,248, 12,131,116,150, 23,189,242, 50, 78,124,231, 4,123, 95,246, 58,142,223,116,
- 35, 7,246,247,185,230,133,151,113,242,179,247,113,118,152,241,234,103, 95,194,185, 7,247,176,214, 43,249,252,163,167,168,156,
-199, 56,193, 76,171,201,116,156, 80,185,112,200, 69, 90,209,136,131, 39, 52,214,138,217, 86,155, 94,150,225,113,104, 39, 66,230,
-174, 18,129, 1, 93, 90,190,242,173, 27,105,236,216,141, 27,108,161,146, 20, 33, 4,213,214, 6,113,163, 69,180,103, 31, 58,190,
-144,213,199, 30,160, 24,244, 65,104,226, 56,194,198, 17,113,115,146,214,204, 2, 66, 28,161, 28, 12,105, 47, 44, 48,216, 92,163,
- 44, 75, 92,153,131,138,145, 10,170,114,192,244,194, 12,221,245, 62, 84,130, 97,175, 79,156, 52, 40, 7, 21, 29,183, 73, 62,236,
-209,152,156, 98,184, 53,100,208,219, 34,203,135, 20, 69,193, 70, 63, 99,162,221, 32,177, 9,121, 86,162,163,136, 65, 63, 40,115,
-143,173,118,208,145,196, 88,143,146,154,173, 44,167,157,166, 52, 98, 77, 97, 4,194, 9,246,156,123,128,243,159,118, 13,165,233,
-176,181,181, 76,175,119, 2,107,103, 88,220,117, 0, 37, 37,206,148, 76,239,220,205, 32,223,162, 49, 53, 77,220,156,160,216,234,
-178,190,124,140,249,221,231,178,184,255, 60,250, 27,107,120, 83, 49,181,231, 32,142,138,185,165,221,252,215,159,191,104,124,160,
-226, 61,218,134,157, 94, 8,248,169, 15,189,145,208,211,109,139, 69,172,169,111,154, 54,228,150,199, 34,120, 47, 35, 25, 30,252,
-209, 40, 89,218, 48, 30,108, 33,105,215,169, 70,202, 65, 44, 66, 0,143,240,160,188,216,206,241, 30, 41,175, 69, 24, 15,124,248,
- 31, 54,184,245,196, 89,102,121,136, 45,160, 47, 64,181,198,137,165,196, 34,140,244,135, 38,116,228,169,222,246,196,182, 85,248,
-187,102, 22, 94,116, 32, 98,229,158,213,113,176,136,168,211,157, 70, 25, 79, 35,188,233,104,145, 37, 68,157,173, 78, 45,125, 21,
-142,120,105, 63,151,188,251,197,244,110,252, 3,244, 68, 16, 43,185,186,222, 47,198,112,166, 8,237,194,243,246,205,143,201,101,
- 46,207,121,226,227, 55,178,247,173,175, 97,176,185,134,140, 36, 78, 57,184, 96,137,207,125,232,181,152,173,156,108,125,139,211,
-255,151,172,247, 14,183,236, 58,235,251, 63,107,173,221, 78,189,253, 78,185,211, 37,205,140,172, 81,239,150, 92,130,141,108,112,
- 9, 53,224,184, 1,191, 96, 48, 24, 98,155, 80,108, 76,208, 15, 28, 48,196, 63, 74, 48,198,166, 5, 23,146, 95,176,193,198, 20,
-199, 13, 99,185,224, 34,201,150,213,187,102, 52,154, 59,115,235,169,251,236,182,214,202, 31,107,237,115,175,200,163, 71,207,140,
- 30,221, 57,115,206, 62,123,175,247,125,191,239,183,156,221,230,225, 39, 55, 56,254,226, 23,240,232,135,223, 75,135, 9,251, 22,
- 66,154,115, 29,226,127,115, 2,173, 4, 66,133,136, 36,154, 78,208,232,220,105,205,141,243,186, 54,147,177,179, 10,142,154, 68,
- 11, 43,132, 51,251,145,201, 50,214, 20,216,124, 11,217,222,131,156, 59,200,230,103,255,158,205,191,123,159,175,207, 78,190, 86,
- 23,104, 99,236, 20,206, 20, 94,174, 35, 3,159, 89,238,247, 4,194,115, 18,132,112,228, 56, 39, 66,116,132, 42, 43, 37,178,118,
- 64,243,198, 49,194, 95,111, 97,188, 75,159,177,211,235, 46, 96, 26,175,108,189, 27,157,197, 32,133,194, 98, 25,223,245, 41,170,
-219, 94,141,181, 26,213, 72,168,170, 18, 83, 58,235, 83, 21, 37,144, 79, 16, 82,209,232,180,121,250,193, 71, 57,248,224,221, 44,
- 28, 58,134, 12, 3, 71,122, 43, 43, 66, 18,183,202,215, 22, 25, 6, 80,228,126,106, 55, 8, 83,250,240,151,210, 33, 16,202, 5,
-173, 68,113, 76,165, 53,166,128,216, 90, 94,113,229, 34, 49, 99,238, 59,159, 51,152,104,222,120,168,193,114,219, 96,199, 5,165,
-181, 68, 11,115,100,169,139,200,154, 93,110, 99, 44,140, 77, 73,186,157,179,119,223, 12,139, 7,231,221, 80,217,233, 50,217,238,
- 19,207, 45, 81, 78, 82,130,141, 45,154, 11,243, 88, 93, 34, 27,109, 26,179, 93,170,201,152,188, 63,162,152,140, 9,195,136,206,
-254,253,136,168,193,112,117,141,103, 30, 95,101,109,123,204,150,129,243, 74,178, 53, 41, 72, 2,225, 76,137, 10,139, 18, 78, 67,
- 61, 31,195,147, 35,232, 34,160,138,152,211, 35,102, 2, 73, 94,104, 68,238, 60, 41, 2, 32,150,206,160, 38, 12, 20, 82,192,184,
-204, 16,107,155, 36,179,179,142, 47,146,103, 4,113, 12,233, 24, 59, 28, 65, 89,185,179,214, 72, 98, 21,112, 34,209,108, 93,117,
- 41,131, 39,158,112, 33, 57,149,241,209,185, 1,214, 72,144,214,163, 11,154,206,124,135, 11,219,235,232,234, 8, 23, 95,126, 41,
- 65,244,119, 46,239,221,111, 85, 86,246,238,165, 85,132,168, 64,179, 61,236,113,217,141, 55, 82, 20,133,219, 39, 71,145,139,169,
-158,237, 98,172, 64,201,208,167, 10, 50,109, 62,101,203, 57,194,189,231,175, 62,203, 31,188,251,157, 92,253,161,191,100,107,173,
-207,137,195, 7,144,157, 3,156, 91, 19,172, 62,242, 41, 94,250,186,247, 49,220, 58,239,160,123,233,121, 54,187,244,233, 82, 10,
-222,251, 91, 63,141, 52,142,128, 23, 10,233,207, 3,199, 13, 74, 2, 9,185, 64, 89, 77,160, 36,161, 53, 62, 70,213, 27, 49,121,
-116, 71, 42, 47,163,173,197, 32,214, 17,228,148, 84, 4,161, 0, 91, 58,162,180, 54,200,132,169, 52, 23,175, 12,173, 35,170,235,
-108,131,188,116,188,162,208, 58,169,156,209,240,222,247,255, 9,186, 61,199,252,254, 3, 92,126,245,181, 84,198,242, 55, 31,251,
-216,148,145,111,189,221, 67, 96, 43, 73,134,123,200, 43,105, 41,173, 37, 40,192, 40,133,169, 6,188,243,117,191,202, 75, 94,254,
- 60,110,254,158,151,176,246,197,207,113,237,107,190, 23,145,110, 51,122,244, 30, 78, 46, 4,252,252, 95,127,137,239,122,249, 73,
-170,170,226,153,187, 30,100,255, 53,167, 88,253,240,111, 82, 69,251,232,175, 93,224,200, 92,151, 59,238,124, 0, 49,217,228,218,
-131,179,124,252,145,115, 24, 9,165,112,129, 17,113, 4,199,230,218, 24,235,157,155,140, 35,134, 24, 99,177,166,100,190, 29, 51,
-211,154,165, 63,153,144,166, 35,138,178,224,242, 83,167,120,227,239,253, 22, 85,225, 4,131, 86, 58,167, 46, 51, 25, 19,182,102,
-157, 65,141,174, 40,210, 49, 69,150,209,232,182,137, 91, 45,176, 21,205,206, 12,219,107,155,164,195, 49, 51,139,243, 20,195, 62,
- 84,153,211,245,202,156,214,220, 12,163,222,136, 78,123,129,126,111,155, 94,185,129, 41,115,154, 75,179, 88, 3,227,254, 22, 73,
- 91,177,122,102, 27, 99,122,200,160,201,160, 55,230,220,133, 45,138,178, 96,152, 85, 68, 17, 4,185,166, 44,114,202,170, 34,208,
-130, 74,107, 38,185,101,115,148, 50,223,142,105,198, 13,214,122, 67, 2, 21, 96,204,132, 80,133,100, 70, 51,183,220, 34, 8, 19,
-206,158,255, 38, 86, 27, 22,151, 15,209,233, 46,209,234,204,145,166,155,232, 34,227,192,241, 43, 41,242, 1,179,179, 7, 64, 40,
-178,113,159,184,217,102,255, 69,151, 49,187,239, 16,227,254, 38,217, 36,229,200,229,215, 82,228, 41,237,206, 60,255,233,245,151,
- 78,141,124, 80,142,205, 94,177, 19, 52, 0, 59,217,192, 74, 91,140,116,146, 13, 25,236,196,158, 10, 11,137, 15,212, 9,144,126,
- 58, 99, 58,113, 41, 4, 77, 41,137,118, 73,117,164,111, 16,148, 16, 83,120,115,135, 96, 37,167,198, 66, 86,192,247,157,156,231,
-205,255,245, 21, 60,250,217, 59,184,247,204, 4,162,132,123, 78,111,242,141,199,123, 40,207,208,215,218, 21,216, 72,193,164,114,
-239,173, 33,221, 20, 61,209,112,249,156,226,214,189,115, 14, 27,247,211, 25,117, 50,178,244, 93, 52, 62,192,198,251,123, 91, 43,
-166, 6, 83, 22,216,243,202,215,114,224, 71, 95,202,237, 7, 95, 68,222,129,141, 17,252,216, 69, 49,127,123,206, 65,146, 43,157,
-144, 59,206,149,124,224,223,159,164,234, 13,188,172,203,255, 93, 86,240,244, 7, 63,206,193, 87,189,140,209,120,132, 82,110, 90,
- 28, 11,133,157,107,195, 76,131,131,135, 23, 57,124,243, 49, 76,185, 70,112,240,160, 75, 33, 52,238, 52, 48, 83,115, 12,233, 14,
- 76, 93,185,137,220, 90,103,147, 90,149, 46,106, 56, 72, 8,103, 23,145,113, 11,217, 94,194, 70,109,108,217, 67,169, 38, 34, 88,
- 34, 88, 58,204,249,255,245, 65,250,126, 66, 87, 82, 98,164,157, 50,107,173,176, 83,178,208, 78,230,184,242,112,186,240, 12,110,
-191,142,168,167, 49,233,124,220, 69,253, 34,248, 44,121,124, 92,107, 32, 17, 70, 56, 79,113, 97,189,233,139,215,176, 23,218, 53,
- 89,222,175,221, 33,159, 21, 66, 74,180,214,110, 58, 9, 66,206,188,235, 71, 57,250,107,127, 77,185,241, 40, 65, 24, 17,180,154,
-200,113, 74, 96, 52, 86,135, 72, 99,209,121, 70,119, 97,158,207,254,233,127,231,149,111,126, 11, 82, 69, 4,205, 22,229, 96, 72,
- 89, 20, 68,141, 24,148,116, 83,166,111, 74,116,225, 60,206,221, 51,160,128,220, 17,237,162, 4, 93, 76,156,249,139,177,156,216,
-151,112,232,232, 18, 79,222,181,206, 75,175,221,199, 27,143, 46,178,124,234, 24, 36, 9,229, 96,200,214,163, 79,144,143, 53,147,
-241, 26,237,153,132,112,182, 69,255,194,136,116, 80,112,240,212, 49,230,246,205, 18,181, 91,152,176, 65,145, 22, 84,149, 70, 37,
- 17,166,200,104, 47, 45, 18,207,205, 98,170,146, 32,105, 32,195, 24,155, 79,136,103, 58, 88, 61,161,181,188, 64,208,108,160,146,
- 6,173, 61, 11, 92,188,184,200,202,104,196,100,179,207,183, 31, 57,199,184,217,102,144, 85,156, 30,101,196,113, 64, 32, 5, 54,
-208, 92,178,183,205,183, 31,238, 49,182, 33, 77,163,144, 26, 6,227,148,142,145, 40, 35,144,198,157,239, 82, 8, 2, 33, 8,141,
-219, 23,207, 70, 49, 89, 9,166, 40,176,121, 65, 17,134, 4,205,142,115,216,211, 26, 43,124, 84,177,178,148, 85,197,226, 76,155,
-175,223,117, 31,179,221, 38,182,200, 48, 37,168,178,112, 74, 5, 43, 65, 57, 37,132,169, 42,142, 95,117, 53,137,252,159, 72, 85,
-146,218,130,119,190,225, 53,252,210,123, 62,128, 49,176,103,113,145,223,121,231, 27,249,232,231,190,194,230, 48,101,111,187,193,
-115,110,184,153,141,181,117,135,242, 4, 46,106, 85,180,155,211,120,179,250,172,168, 37,248,170,221,102, 52, 26,240,229, 59, 31,
-226,203,255,112, 55, 66, 47,115,241,241, 43,201,180,224,233, 39, 87,249,196,231,191,200,167, 63,252,110,138, 34,163,154,164, 68,
-173, 25,148,216, 49,157,113,205, 93,197,234,217, 51, 96, 52, 66, 74,231,181, 17,128,182,138,210, 39,168, 5, 74,209,138, 13, 19,
- 35, 25, 87,142,235, 32,113, 50, 52,107,167, 73,192,222,159,193, 53,137, 8,136, 34,208,194,184,192, 36, 64,250, 33,198, 10,231,
-176,169,212,142,139,159,149,222, 7, 4, 55,236, 26, 11,105, 1, 38,179,228, 26, 26, 86, 35,180,100,229,216, 69, 52, 22,247, 49,
-187,103, 15, 91,163,148,211,103,207,186,115,217, 75,189, 17,174,177, 8, 98, 37,168,188, 6,175,208,130,208,184,135,185,178,112,
-230,254,175,146,107,201,139,223,245,155,132,247,127,149, 95,249,147,207,243,203, 31,123, 25,119,127,252, 9, 62,252, 55,159,225,
-178,189,243,188,242,170,139, 24,158,189, 64,167,157, 50,124,252, 1,178, 27,175, 37,156,219, 71,220,153,229,186, 27,143,243,181,
-175, 63,198,147,153, 38, 21, 93, 46,172,111,113,113, 43,224,161, 81, 73, 97, 5,179,113, 3,161, 97,146, 22,204,182, 91,196,205,
-136, 86,179, 67, 85, 89,186,221,134,243, 67, 14, 66,182,123, 61,154,177, 68,218,132, 23,253,192,109,220,246,150, 95,196,228, 57,
- 42, 40, 48, 66,161, 84, 76,149,143,145, 97, 19,173, 51,138,225,128,184,221,161, 50,134,197, 67,199, 41,139, 49, 97, 12,189,213,
- 49,179,123,150,232,148,134,168,221,102,110,105,137,167,183,251, 72,109,232,118,218,116,218,139,100,217,144, 36,209,100,249,132,
- 56,110,177,185,250, 52,115, 11, 49,229,176,135, 8, 90,216,124, 66,191, 63, 97,115,115,131,195, 43,115,108,156,223,102, 56,170,
-216, 26,164, 78,106,231,245, 75,214,192,214,120, 76, 35,142,216, 30,166, 52,226,152, 39,206,111, 50,211,138,136,195,144, 39, 47,
-108, 19, 71,130,134, 80,168, 64,176,157,231,204, 52, 20, 39,142, 95,193,147,143,223, 75, 24, 40, 14, 28,190, 12,157,167,132, 81,
-130,165, 32,237,109,113,197,243, 95,193,100,210, 39, 9,230, 73, 22,150,200,210, 17,243,251, 15, 48,234,109, 17, 69, 9,217,160,
- 71,149, 78, 56,112,226, 10,250,107,231,137, 26, 49, 63,255,227, 87,161,118,181,130, 86, 11,148, 39,192, 41,111,103,136,151, 68,
-160, 65, 70, 46,210,207,159,193,211,208, 0, 41, 37, 10,199,206, 5,151, 50,100,141,211,130, 27,169,156, 50,202, 57,132,251, 4,
- 40,129, 84,238, 95,140, 69,212, 44,232, 58,207,220,155, 56,184,157,173,147,151,124,249,157,127,201,151, 47,228, 60,255, 80,204,
-210, 66,131,155,143,132,236, 31, 72,254,126,195, 16,120,233,136,244, 33, 8, 19,239,220,134,117, 59,239, 43,230, 66, 94,117,201,
- 60,181, 9,187,245, 19,169, 13,234,112,118,166, 15,150,144,194,235, 82,133, 15, 46,113, 69, 94, 0,123,126,240,185,124,235, 77,
- 63,198, 71,206, 67,167, 35,249,167,159, 60,198,207,255,207,199,176, 22, 94,113,164,205,108, 0,207,223,223, 34,238, 13,221,231,
-145, 59,113, 35, 72,183,191,123,230,163,159,226,226,159,248, 97,214,207,156, 65,121,253,181, 48, 10,194, 16, 17, 75,207,174,174,
- 35, 19, 5, 54,112,210, 24,180,241, 49,154,222,230,212,104,172, 39, 45, 97, 53, 34, 72,156,158, 30, 16,113, 7,145,204,123,221,
- 96, 15, 58, 11,200,230, 44,193,193,147, 60,241,107,111,165,220, 58,239, 57,183,198, 91,207, 58,180,171, 54,204,144,214,186,223,
- 89,235, 39,108,124,186,151,115,125,179, 53,217, 77,186, 98, 45,172,159,188,167,242, 37, 15,197,123, 16, 0,109,167, 9,124,117,
- 76, 41,222,223,191,214,212,226,189,181, 69,160,124, 72, 9,211, 8, 87, 42, 39,227, 58,253, 27,175,229,208,219,254,148,254, 83,
-247,187, 76, 0, 89, 59,214, 90,103, 85, 42, 93,227,179,188,178,194, 63,188,247,143,248,222,183,190,153,193,198, 26, 42, 12,168,
-202,130,162, 40, 9,148,162,240,161, 51,218, 47, 59,171,202,249,164,155, 74,251,156,120,139, 21, 6, 81, 40,146, 36, 98,159,181,
- 92,122,114,129,100,207, 62, 46,249,206, 69,186, 23, 29,119, 44,250,241, 8,213,234, 18, 14, 6,228,163,148,242,244, 51,116,150,
- 58,116, 23, 58,200, 86, 11,181,149,179,116,116, 47, 43,207,187, 5, 81, 78,168, 38, 3,140, 8,168,250, 35,130, 48, 68, 72,137,
-234,206,184,156,236,164, 69, 20,199,160, 43,242,254, 6, 81,119,150,192, 26,130, 70,236, 53,246,190, 25, 86, 1, 54, 16, 52,104,
-211,218,179,194,117,157, 22,214,104, 86,159, 89, 39, 57, 93,210,201,241,204,123,215,156,141, 10, 77,217,180,152, 64,160,138,136,
-213,113, 78, 16,198,180,124,138,142,136,220,234, 37, 84, 18, 21, 74,148,118, 4,200,208, 66,214,219, 38,140, 99,196, 40,132,110,
-142, 53, 62, 66, 21,215,148,219, 32, 32, 47, 45, 69, 89, 50,211,136, 56, 55,158, 80,165, 99, 23, 31, 93,149,136, 32, 2, 81, 98,
- 9,156, 15,145,181, 68,179,243,236, 9,250, 12,122, 19,116,127, 31,123, 14,205,241,193,223,122, 27, 58,140, 41,242,140,239,123,
-253, 47,242, 71, 31,254,119,124,238,142, 47,243,137,223,127, 51, 89, 89,250,231, 71, 32,140,244,196, 49,229,149, 21,202, 15, 1,
-202, 19,120, 13,237,131, 71, 81,141,152,215, 94,183,135,159,249,189,247, 51, 63, 59, 71,183, 53,139,180, 16, 87,235,252,237,239,
-191,149,189,199, 47, 98,212, 91, 39,106,116, 60,226,164,166,152,185,148, 2, 33, 66, 62,240,190, 95,117, 94,238,214,155,101, 25,
-119,198, 5, 62, 42, 55, 22, 2, 17, 74,194, 92, 58, 27, 94,164, 35, 99,214,216, 95, 45,241,196, 21,106,233,215,120, 90, 26,114,
- 3,102, 82,208, 8, 4, 13,225,194,175,164,240, 70, 66,222,184, 47,140,220,112, 85, 63, 79,120,125,122, 89, 89, 50, 45,200, 11,
-203,196, 64,128,230,112,119,142, 7, 31,125,148,167,238,184,131,210,152, 90,109,186,163,171,175, 83,225,190,235,150,214,237,198,
- 26,111,143,231,116,113,129,117,251,128,113, 62,230,198,185,125, 28,125,221, 59,248,165,171,158,207,211, 90,176, 39, 42, 56, 54,
- 60,195, 99, 91,150, 55,255,151,159,102,237, 11,255,204,133,237, 9, 55,254,151,247, 99,198, 21, 15,253,241, 31,179,247,186,107,
-153,123,222,139, 8,179, 33,107, 27, 5,131,237, 17,107,219, 61, 46,127,206, 73,132,169, 88,157, 84, 28,223, 59,207,193,133, 54,
- 43, 75,179,196, 65, 76, 20, 74, 86,150,151, 40,202,138,197,249, 6, 65,152,176,185,182,206,242,114, 27,171, 21,198, 84, 28, 90,
- 89,228, 7,127,243, 15, 96, 50, 6, 93, 32, 84,128, 46, 83,175,233,116, 19,145,201, 82,146,197,189,232,172,112, 14,104,129, 68,
-133, 13,202,116, 12,166,162,217,157,243, 63, 11, 58, 55, 72,160, 61,211,162, 49, 51,199,176,183, 73, 24,196,108,111,109,209,233,
-118,217, 62,183,198,241,203,142, 48, 30,104,230, 23,231, 24,174,110,145, 52, 91, 60,244,192, 25,174,187,226, 8,253,126,201,120,
- 82, 48,202, 11,202,170, 66, 27, 71, 68,233, 38, 33,131,180, 64,107,195,184,116,222,211,231,251, 41, 82, 24, 26,113,194, 90,191,
-160,180, 21, 74, 73, 90,113,196,218,160, 32,138, 44,215, 93,122, 25,141, 86,147,113, 58,228, 57,151, 61,143,241,112, 29, 83,102,
-236, 59,114, 9, 79, 61,124, 55,167,110,254, 46,100,226,166,184,214,252, 2, 2, 65,107, 97, 17,163, 43,132, 54, 52,102, 59,152,
-210,210,104, 53,233,159, 59,139,108, 54,249,173, 95,122, 57,214,119,127,117, 34,144,246,187, 39,233,155,197, 66, 56,198,122,237,
-214,233, 80, 90,225, 85, 79,194,219,158, 58, 98, 92, 55, 20,116,131,128, 4, 65,136,147,172, 97,119, 10,163,244, 14,101, 46,172,
-195, 23,115,156,105,141, 35,102,225, 25,207, 59, 43,219, 41, 56,107, 53,157, 78, 66, 38,224, 19,207,100,252,221,147, 25, 31,123,
- 34,229,222,177, 95, 17, 24,199,122,111,121,216, 61,116,182,243, 44,197,240,198,147, 93,158,187,183,227, 33, 53,233,139,181,123,
- 8, 93,126,189,244,166, 19, 98, 42, 29, 17,211,234,179,107,217,135, 32,191,247, 11,188,228, 61, 79,112,104, 6, 62,244,250, 83,
-188,227, 35,143,240, 72,102, 57, 53, 27,242,255,156,154,231,216,108,204,222, 78,228, 58,228,250,239, 18,210, 29, 20,245,252,107,
-161,255,208,227,204, 95,123, 37,197,104,228, 6, 91,101,157,181,169, 21, 16,184, 85,139,131, 50,188,180,198,175, 33, 48, 26,131,
- 43, 68, 22, 23, 94, 33,195, 4, 17, 53, 29, 44, 15,144,204, 34,195, 24, 33, 75,148,178,136,184, 67,178,176,159,124,125,139,211,
-239,122, 59, 58, 29, 78,249, 4,194, 74,207,254,221, 57,132,106, 62, 65,189, 39,159, 22,234, 58,191,217, 7, 41,137,105,248, 13,
-211,233,123,247,114, 84,120,187,211, 29,121,144,123, 14,165,144, 72, 85,175, 55,158, 45,127,179,149,246,168,205,142,233, 13,182,
- 38,225, 73,108,150, 50,248,234,167, 88,190,237,135, 72, 55,207, 83, 22, 5, 0,197,196, 49,215,133, 39,240, 25,173, 9,195,144,
-167,190,117, 55,199,111,184,137, 81,175,143, 41, 43,116,233, 16, 14,167, 69, 47, 93,214,186, 17, 88, 93,248, 59,205, 49,231,173,
-146, 40, 37, 88,232, 52, 56,184, 52,199,141,183, 94,193,236,161, 3,132,115,203, 68,179, 51, 4, 11, 7, 60,147, 63, 67, 70, 77,
- 44,142,203,130,214,180, 22,154,132,137, 34,221, 30,145,142, 10,226,249, 57,230, 47,121, 14, 86, 79, 40,242, 28, 25,181,209,101,
- 73,153, 77,136, 23,151,137, 59,115, 78,199,220, 8, 93,211,143,147,215, 69,179, 11, 72,165, 16, 88,162, 86, 27,173, 13,197, 36,
- 69,181,187, 68, 73, 11,213,153,131, 42,167,181, 56,131, 82,146, 70,171, 65, 87,103, 4,210, 93, 80, 19, 72, 46,108,229, 60,210,
- 43,105, 6, 1,157,208,113,162, 54,171,156,253, 65,128,180,130, 72,130,148, 1,129,132, 64, 72,148,148,200, 56, 36,104,181, 9,
-219, 77, 38,101,238,125, 3, 2,146,164,233,136,132,163,148, 50, 43,168, 38,154,254,118,138, 61,243, 4, 66, 56, 31,228,199,250,
- 35,110,248,129,239,192, 22,154, 32, 73, 28,129,113,122,101,221, 63,249,164,228,101, 47,190,129,223,123,239, 95, 99,146, 54,221,
-153,101,150,246, 30, 99,125,173,224,225,199,214,120,250,238,111,240,223, 62,242,183,252,252, 43,175,230, 39,110,255,117, 6, 27,
-235, 59,217, 50, 22,144, 33,234,220, 83,200, 32, 64,181,218,200, 32,244,212,110,129,214,150,246,197,151, 67,210,228,182, 87,190,
-128,255,248,154,151,112,219,149, 7,120,225,149,123,248,169, 31,121, 9, 63,251,214, 55,144, 44, 46, 49, 25, 14, 9,130, 16, 21,
-198, 68, 73,130,138, 98,132,116,207,109, 85, 85,100,147, 17,191,251,235, 63,225,184, 55, 66, 80,149,110,191, 45,164, 67,182,218,
-202,113,189,164, 16,100, 90, 51, 46, 52,149,112, 28,133,170,180, 94, 38, 41,166, 8,167, 64,144,132,130, 40, 16, 52, 26,150, 32,
-112, 13,105, 0, 4,129,112, 28, 38, 97,157, 85,121,224,215, 8, 82,120,233,176,207,217, 48,194, 21,244, 76, 80,100,144,149,130,
- 66, 59, 46,207, 13,183,220, 66,212,104,128, 82, 76,202, 9,101, 85, 57,122,129, 71, 75, 29, 17, 15,212, 43,111,110,223,110, 48,
-110,151,170, 5,162,242, 29,177,133,225, 96,141,171,142,220,192, 51,247,124,154,163,139, 33, 43,227, 9, 47,250,229, 95,224,255,
-127,255, 95,243,147,111,251, 49,190,245,201,207,241,149, 71,206,241,169, 59, 30,231,135,126,241,199, 72,191,241, 1,242,228, 4,
- 11,179, 57,241,177, 83,164,171,247,243,212, 3, 67,134,105,198,153,141, 1, 55, 95,117,130,108,146,115,241,225, 99,156, 93, 61,
-239, 29,215, 42,150,230, 59, 72, 25, 50, 28,245,137,195,144,193,112,200,210, 98, 3,140, 98,212, 31, 50, 51,147, 16, 43,197, 27,
-254,226, 67, 48,238, 99,109,134, 8, 91, 84,217,216, 31, 10, 26, 25,197,148,195, 1,241,204, 28,186,200, 41, 39, 41, 85,149, 19,
-198, 9,166, 52,232,188,160, 57,187, 64,153,167,148,185,102, 50,114,187,247, 56,142,136,154,109,134, 27, 23, 88,185,244, 82,158,
-184,251,126,158,115,227, 41,202,204,178,184, 60, 67,145, 85,116,103,219,100, 99, 77,220, 76,184,112,110,147, 35,203,109,242,202,
- 57,169,173,111, 15, 64, 88, 98, 41, 40,140,179, 6, 28,149,206,152,162,170,156,164,165,168, 44,163, 60,167,219,104,144,151,150,
-141,241,152, 32, 52, 48, 80, 0, 0, 32, 0, 73, 68, 65, 84,102, 28, 16, 5, 1, 69,161, 48,162,224,200,210, 2,251,150,246,177,
-182,189,198,137,139,159,139, 10, 53,253,173, 85,142, 92,124, 13, 79,159,190,135, 35, 39,174,161,187,188,136, 64,146,180,187,140,
-182,214,105,206,205, 18,119, 92,194, 91,220,110, 49, 94, 95,199, 26, 67, 62, 73, 89, 56,120,144,245,143,255, 55,110,186,254, 69,
- 60,185,181, 74, 62,233, 79,211,207,204,206,122,213,217,193, 90, 55, 64,217,192,117,141, 82, 56,194,135, 12,156, 33,130,244, 36,
-183, 40, 16,196, 8, 58, 66, 49,215,157, 39,148, 1,210, 86, 83, 56, 27, 33, 93, 78,120,157, 21,108,221, 6,182,238, 36,167,100,
-244,250,128,247,204,103,124, 74, 90,189, 83,218,223,138,121,238,222, 38, 47,216,219, 64,148, 37, 51,129,224,251, 14, 52, 57,210,
- 16,140,115,205,176,182,169, 22, 78, 98,246, 11,167,230,152,107,196, 88, 41,166,218,244, 58,252,199, 76,255, 14,143, 44,120,235,
-207,154, 12, 88,239,232,118,254,156, 32,219, 46,184,124, 94,241,154,231, 44,144,246, 38, 28,159,143,248,142,253, 77, 94,114,108,
-198,125, 38,159,229, 61, 13, 74,150, 98,170, 19,181,187, 25,186,165,134,170,162,121,244, 48,186,202, 60,100,231, 35,134,119,233,
-122,157,115, 4,211,194, 70, 32, 16, 54,112, 5, 92, 5,142, 21, 40, 5,216,202, 25,201,134, 13,132,117,217,226, 42,108, 18,206,
-238, 33,144, 9,103,254,236,253,244,239,252, 23, 55,109, 83,107,204,253,247,189, 75, 33,239, 98,226,133, 39,206,213, 42, 52,103,
-155, 43,148,112,105,103, 90, 35, 3, 53,157,198,169,195,123,106, 59, 83,185,163, 80,243,216,227,142,159,185,127,109,199,130,151,
-110,170,241, 54,177,214, 90,132,242,217,144,218, 21,146,157,130,224, 61,228, 17,232, 34,103,240,197, 79,208,185,250, 86, 68,163,
- 73, 62,232,131,174, 8, 91,109,138, 73,134,209, 21,129,103,195,235,178,162, 72, 71,116, 23, 22,200,125,248, 75, 62, 73,137,146,
-136,108, 48,112, 5,220, 24,207,204,118,161, 41,142, 97, 92,113,120,223, 2,151,221,116, 13, 43,207,185,152,246,225,195,136,214,
- 12, 34,112,211,161, 8, 99,100,220, 68,200, 16,157, 13, 17, 65, 19, 84, 3, 73, 73,228, 92, 96,153,228,176,121,182, 79,115,177,
-205,220, 37, 39,209,249,132, 60, 29, 1,146,201,198, 5, 68, 24, 19,207, 45,128, 82,168, 40, 65,132,161,227, 38, 78, 70, 4,157,
-166, 35,156, 89,141, 12, 66,180,174, 45,107, 13, 70, 8, 23,143,106, 42,116, 54,113,190,245,185,139, 18,110, 46,204,211,104, 69,
- 84,165,115,162,123,116, 61,103,125, 82,209,136, 20,115, 97, 72, 34, 20,231, 38, 99,150,226,192,165,131,121,103, 0, 41, 37,202,
- 72,130, 40, 64, 53, 26,168,102, 76, 16,183, 73, 77,234, 73,171, 6,153, 52,144,214, 80,109,246,168, 82,151,172, 54,234,101,244,
- 31,121,144, 66, 72, 18,107, 57,211, 75, 57,245,221, 55, 32,100, 64, 16, 69,200, 64, 97, 85,136,173,109, 15,180,163,173, 70,221,
- 57,126,248,229, 55,241,255,253,246,239,242,197,251,159,162, 27, 53,185,246,208, 60,127,250,119,159,228, 51, 95,253, 26, 31,254,
-207,255,158,159,248,245,119,178,181,250,204,212,160,168,150, 84, 90,169, 80,103, 31, 71, 5, 33,178,229,195,123,164,131,183,172,
- 21,180, 46,189,134, 98,178,205,104,227, 60, 54, 74, 88, 60,116,152, 3, 39, 78, 18,182,186, 20,185, 91, 31, 8, 41,145, 42, 68,
-133, 17, 97,228,214, 29,210, 55, 32,198, 24,214, 31,127,140, 79,254,253, 95, 76,227, 83,149,116, 30,238, 8, 8,141,164, 25, 6,
-132, 82, 82, 26,152,148,174,168,103,149, 37, 47, 93, 97, 22, 8,146, 40, 66, 87,134, 64, 56, 57,156,146,130, 40,128, 56, 22, 59,
-210,125, 63, 68, 9,101, 16, 46,249, 24,229,109, 99, 69,192,212,132,200, 84,238,188, 45,115, 24,167,144,149,160,181,131,228,173,
-129,135, 31,124,128, 97, 58, 97,126,113,145,155,159,123, 19, 87, 92,126, 37,247, 62,112, 47,198,251,104, 72, 1,177, 16,168, 87,
-220,212,185, 29,225, 33, 83,235, 13,234, 49,104,109,185,254,165,111,226,216,169,171,249,171,255,252,251,188,240,215,110,167, 85,
-156,163,183,122, 1,221,235,113,195,187,255, 43, 79,253,249,159,240,161,199,198,188,234, 5,199, 81,231, 31,231,200,109, 63,200,
-211, 95,249, 39,154, 75,123, 41, 39,134,229,151,126, 15, 79,255,203,191, 48,236,103,228,133,230,222, 39,207,114,213,137,139,121,
-236,244, 25,246,238, 89, 36,207, 82,102,219, 13,154,141, 6,101, 89,177,216,237, 18,199, 17, 73,156,160,164, 98,110,113, 22,107,
- 4,231,159, 62,203, 79,254,225,187, 9,227, 14,186, 24, 35,195,192,105,184,189,148, 66,132,177, 59,132,226, 24, 93, 86,148,233,
-152,168,211, 65,185,147, 18,139,165, 42,114,170, 73,138,140, 98,167,185, 45, 44,189,181,103,104,206,207, 50,220,220,102,229,228,
-165,156,249,214,253,216,124,200,145,171,174, 98,243,244, 51,196,141, 38,186, 40, 64,134,232, 74,179,189,222,163,149,104,154,115,
-139,228,105,202,102, 63, 35, 14, 74,207,214, 10, 49,166, 4, 25, 48,206,220,228, 30, 72,129, 18, 33, 27,131, 49, 75, 51, 29,198,
- 69,197,168, 40,104,132, 18, 33, 20, 73, 24, 19,169,128,102,162, 88,236,116, 9, 19,197,201, 35, 55, 48,179,167,195,185,167, 30,
- 96,113,254, 40, 85,144, 17, 7, 13,246, 30, 59, 78, 16,132, 72,169, 24,109,175,147,180,219,180,231, 22, 48,214, 80, 76,198,152,
-162, 36, 27,143,193, 26, 22,143, 94,196,219,111,185,129,199, 79,175,113,205, 37,123,185,246,138, 91, 57,117,221,243,249,230,157,
- 95, 36, 82,146, 10,183, 51, 47,189,132,173, 46,240,214,203, 86,168,137, 31,254, 41, 13, 36, 72, 35,136,165,160,169, 36, 51, 65,
-196,158, 61,151,160,108,137, 40, 50, 23,226, 41,148,223,173,219, 29, 50, 74, 13,209,214, 58, 76,243,236,228,174,105,226,163,119,
- 50, 19,194,195,110,222,244, 36, 80,146, 75,102, 98,226, 64,242,233, 11, 25,247, 14, 42, 44,208, 82,208,142, 4,215, 47,196,252,
-204,115,230, 9, 2, 71,180, 82,222, 56, 89, 8, 59,157, 2, 69, 13,141,251,105, 84,214,113,190,176, 19,193, 42,133,151,110,213,
-204, 85,193,114, 43,112,159,195, 90,218, 81, 64, 59, 9, 92,202,149,112,254,229, 83,100, 66, 10,143,102, 56, 2, 96,109,101, 44,
-132, 43,144,229,198, 22, 10, 65,114,240,128, 39,168,249, 11, 80, 84, 96, 42, 68,224,155,128,202, 78, 47,152, 83,153,233, 58,197,
-104, 7, 62,193, 5,118,216, 34, 67, 37, 9,201,220, 30, 2, 25,177,254,217,207,178,249,185,207,184,253, 59, 96,234,239, 64,236,
- 56,188, 77, 39,235, 90,146,102,157,157, 37,214, 67,145, 82, 76,141,182,132,181,211, 12,240,186, 33,178,186,242,135,182,221,197,
-139,176,187, 58, 52, 92,179, 36,236,212,104, 71,170, 29, 8,126, 26, 18,227,225, 0,231,149,238,146,196,108,157, 7, 80, 95,157,
- 64, 78, 85,234,147,251,254, 5,206, 62, 74,243,196,213,152, 48,162,154,164, 84, 89,238, 81, 17,144, 97, 64,220, 76,216, 90, 61,
-207,194,202,126,138,225, 8,109, 74,143, 22,120,233,157,117,205,133, 83,115,104, 26,141, 6,233,120, 68, 59, 10, 57,121,213,113,
-102,142, 30,113,168,146,115,223,194,154, 18, 17,197,200, 32, 1, 21, 34,163, 8, 51,238, 97,100,140,213,160,204,152,112,102, 22,
-173, 53,147,137, 97,107,109,192,161,155,174, 35,234,180, 64,134, 84,227, 30,218,104,140, 8, 49,229, 4,213,104,146, 44,238, 71,
-133, 13,178,193, 22, 65, 35, 38, 8, 66,170,178, 64,231,133,107, 98, 42, 77, 89, 20,148,165, 91,137,228,163, 1, 65,232,214,138,
- 66, 69, 24, 83, 82,142,115,100, 28, 99, 10,141, 8, 2,162, 56, 33,140, 35,170,209, 4, 81, 84, 8, 41,104,202,136, 56,144,140,
-139,156, 40, 18,116,140, 32,148,202, 5, 39, 73, 73,168,132, 59,151,146,136,160,153, 32, 27, 49,121,169,209, 38, 71, 72,129, 12,
- 36, 74, 5,216,116,228,204,184, 84, 64,158, 87, 12,158, 56, 77, 98, 13,218,194,153,113,198,202,101, 43,180,151, 23,144,161,247,
-101, 87,106, 7,185,177,245,206, 90,163, 26, 45,222,248,147,175,229,182, 43,247, 34, 70,167,121,252,233, 71,248, 15,175,122, 49,
-239,124,231, 91, 56,114,245, 53, 12,182, 54, 80, 82, 96,181,240, 43, 24,183,171, 70,133,200,179,143, 33, 35,133, 76,154,206,221,
-111,202,126, 15,105, 94,122, 45,233,246,211,206,139, 64,212, 81,192,218, 19,234,106, 79, 4,129, 80, 1, 97, 24, 17,196, 9, 50,
-136, 92,136,145,113,169,118, 95,255,237,223,224, 27,103,191,233,206, 26, 43,188, 9,140, 68, 89,119, 46, 4,129,139,248, 30,231,
- 21,131, 66, 51, 46, 12,165,182,228,133,155,232, 23, 23,230,152,155,153,101, 50, 74, 17, 88, 66, 37,136, 66,103, 17, 43,149,117,
-134, 85,214, 5,245,152,192, 34, 34,151, 94,105,132,147,124, 10,143,151, 91, 47,129,171, 85,133,121, 6,105,102, 41, 10,175, 62,
- 66, 16, 9, 56,126,244, 16,135, 15, 31, 97,121,207, 30, 70,233,136, 71, 30,123,132,245,245,117,183, 38,245, 76,145, 88, 9,212,
- 43,158,219,190, 61,168, 15, 66,109,156,232, 94,192,145,203, 94,204,119,188,246, 93, 20,217,136, 91, 94,126, 37,250,220, 5,246,
-188,250,231,120,248, 55,223,206,119,254,197, 7,201,123, 19,162,187,239, 96,105,121, 31,159,186,231, 73,126,230,163,255, 72,254,
-208, 29,100,131, 77, 78,127,251, 25, 22,246,205, 19, 69,150,152,156,135,191,245, 52, 27,195,140, 94,154,243,163,175,123, 57,255,
-248,133,187,156,211,218,100,194, 76,179, 65, 51,105,160, 2, 69, 89,148,180, 26, 49,139, 75, 75, 88,109,232,111,109, 17, 39,138,
- 23,126,255, 43, 88,185,233, 5,216, 60,245,138, 98,137, 41, 29,209, 69, 70, 77,116,145, 81, 14,251,168,184, 65,149,101, 4,129,
- 79,241,242,169, 68,147,222, 6,205,185, 57,132, 74,144, 74, 48, 25, 12,105,118,103,136,162,144,184,221, 36, 78, 98,130,164,193,
-250,147,103, 89, 57,121,132,124, 92, 34, 3, 73,145,102,132,141, 38, 82, 41, 38,233, 4, 65,198,252,222, 67,244, 54, 7,148,121,
-198,246,246, 54,115,221, 14, 69,110,152, 84, 57,203,179, 93,182, 71, 5, 89,145,211, 12,221,195,212,207, 75,150,187, 9,227,194,
- 50, 42, 11,154, 65, 64, 24, 4, 84, 70,208, 14, 99,180,173,232,196, 49,243,179, 29, 46, 59,118, 19,179,251,102, 89, 61,253, 32,
- 81, 56,203,210,145,131,244,206,159,229,232,229,215, 78,117,197, 85,145,146,246,134,204, 44,239, 33,153,159,161, 72, 83,226,164,
- 73, 85,230, 8,109, 88, 60,124,140, 15,188,233,213,132, 42,228,196,108,194, 95,125,246,110, 46, 94,108,210, 49, 5, 55, 95,123,
- 61,119,222,255,109,140,183, 56,212, 98,167,150, 8,229, 32,110, 41, 28,154,166,237,142,196, 73, 10, 8,149,164, 33, 4, 77, 41,
-152, 15, 35,218, 81,128,200, 82, 2, 91, 77, 73,111,214, 75,226,100,189, 47,223,149, 68,101,237,110,149,148,157,190,176,240,147,
-114,189,219,221,209,212,237, 76,144,123,154, 1, 55, 45, 53,248,206,149, 38,223,177,183,201, 11,246, 54,249, 55,251, 91, 92, 62,
-159, 96,172, 47, 72,187,222,172, 20,181,173,233, 14,219,213,238,138, 23,222, 97,231,213,164, 48, 59, 77,252,218, 49,166,112,175,
- 41,165,244,124, 3, 53,125, 21,235, 11,144,172,181,175,162,158, 96, 93,193,151,190,153, 17,222, 13,162,220,216,160,123,233,165,
-136, 40,242,117,208,173,133, 68, 16,122,148,162,242,138, 3,207,188, 9,164, 55,252,241, 58, 96, 99, 48,101,137,148, 2,213,108,
-210,152, 93,192,110,142,216,248,212,103,232,221,121, 23,101,175,231,139,164, 95, 49,248,172,116, 16, 59, 19, 57,174,224, 78, 27,
-142,169,132,191,150,242,249,221,250,238,107, 23,120,215, 45, 85,147,247, 92,225,118,129, 94,117,140,170,255, 25, 41,119,252,180,
-107,152, 93,187, 56,214,218,165, 11,127, 15,139,218, 43,119,122,197,235,239,206,250,117, 77,205,113,112,255, 79,103, 35,244, 35,
-119,147, 12, 46,208, 88,218,143,154,153, 67,151, 21, 65,183, 67,160, 66,132, 18, 36,157, 54,233,120, 76,103,118,158,241,214, 54,
- 50, 8,168,180,147,196, 18, 40,202,178,112,188, 6,107,157,149,172,148, 92,119,235, 85,204, 30, 63, 6,102,130,144,129, 75,149,
-211,165,227, 48,200, 0,209,104,185,235,161,115,108,218,167,178, 33, 84,154,176, 21,163, 58, 51, 84, 52,216,190,208, 39,156, 91,
- 96,233,216, 65,176, 21, 85, 49, 65,143, 55, 49, 38, 68, 4, 1, 86,103,174, 9,146, 18, 61,218,198, 84,153,219,231, 75, 87,184,
-141,129,201, 48,165, 44, 74,170,202,146,143, 71,148,217,132, 42,205, 72, 55, 54,220,127,143,251, 14,113,168, 10,100,148,184,204,
- 8,143,166,196,205,132,125, 43,139, 28,234,134,148,195, 18,237, 9,136,149,174,216, 46, 53,135,226,208,123,124, 88, 23, 13,108,
- 32,138, 2, 84, 20,163,154, 17,178,217, 34,153, 89, 98,187,119,222,125,135,218, 16,196, 17,166, 63,164,200, 74, 4, 1,197, 56,
-163, 55, 76,105,247, 55,105,198, 49, 74, 41,182, 78,159, 99,229,197,215, 59, 55,195, 40,152,174,183,236, 14, 4,230,125, 14, 44,
-101,165,153,217,187,159,203,110,186,137,235, 94,240, 60,150,143, 28,161,168,140,147, 33,138,192, 31, 7, 78,156,109,234,197,159,
- 10, 17,143,221,135,138, 18,135,150,120,211, 12, 33, 20, 50,105,145, 28, 57, 73,186,113,122, 42,173,116,247,140,156,122, 41, 88,
- 15,137, 75, 21, 16, 70, 77,231, 38, 23,132, 83, 89, 91,245,169,207,242,129,127,248, 19,158, 73,157,155,169, 84,158,204,107,220,
-180, 29, 7, 46,183, 34, 43, 13, 91,105,197,184, 48, 84,198, 48, 41, 44, 69,229,206,207, 80, 40, 38,147, 9,121, 94, 18,133, 18,
- 97,161, 17, 58,137,175, 8,133,147, 14, 27, 55, 84,170,216, 34,195,218,112,201,165,178, 9,223, 1, 89, 13, 69,233,119,233, 5,
-228, 57,164, 41, 20,133,107,130, 3,227, 50, 49, 94,255,195,255, 14,101, 12,223,190,247, 30,238,190,231, 94, 46,172,175, 59,166,
-190,159,143, 2, 1,177,146,168,151,221,210,186, 61,178,138, 0,103, 77,103, 44,204,239, 63,201,247,191,229,111,176,147, 45,226,
-217,125,136,249,121,194, 68,115,238, 11,159,166,125,233,101, 44, 63,239, 86,190,252,170, 87,242,119, 15, 12,120,252,158, 71,248,
-141,255,241,123,252,217,155,222,194,115,174,233,178,239,166,235,185,239,147, 95, 71,156,121,140,246,161,131,236,189,234, 50,238,
-254,196,151,233,149, 26, 43, 3,158,184,247,126, 78, 28, 62, 4, 85, 74,210,104,162,148, 34, 9, 3,132,177,236, 93,217,135, 8,
- 36, 85,153, 57, 91, 85, 93,113,252,178,227, 92,255,227,111,194,166, 35,103,144,128, 65, 37, 29,143,246,134, 20,131, 30,194,135,
- 63,148,163,129,219, 79,169, 96,234,101, 92,101, 5,201,204, 60, 58,207,177, 85,142,138, 26,160, 75,130, 36, 38,159,164,116,150,
-246, 59,136, 39,108, 48,217,218, 98,225,240, 97,178,241,136,114,146,211, 93, 88, 98, 50, 30,121,247,170,148,217,197, 61,140,182,
- 71, 20,197,132, 65, 47,101,105, 62,194,170, 54,189, 94,159,149,125, 51, 12, 83, 75, 86, 24,132,201,105, 39, 9,163, 82, 48,223,
- 84, 20, 70, 49, 46,114,218, 81, 72, 20, 68, 68, 65, 76,158, 87, 68,161, 68,163,233,196, 49, 87, 93,114, 37,221,165,101,242,162,
-207,100,156,114,242,218,231,113,250,145,187, 56,118,234, 6,138,241, 16, 21,132, 8, 5,131,181, 13, 58,243,203,204, 28, 88, 33,
-189,176, 74, 60, 51, 75, 89, 20, 84, 89,198,252,129,253,252,218, 79,190,136,199,214,159,228,231,126,229, 61,156,125,248, 94,190,
-251,182,239,224,191,127,228,147,220,250,226,151,178,231,242,171,184,249,248, 65,238,184,243,107, 88,229, 53,147,158,220,102,167,
-218, 98, 65,229,167, 56, 33,107,231, 47,215,201, 54,172,100, 78, 72,102,165, 32,206, 70, 68, 85,133,139,214, 17, 83, 9, 28,194,
- 57,239,249,147,222,237,215, 37,222,147, 93, 76, 89,162,211, 26,235,249, 13, 98,183,227,152, 47,190,211,237,237,244, 53,220,172,
-231,224,239, 29, 54,189,144, 59,178, 43,118, 21,171,122,100, 20, 72,191, 14,216,217,163,215, 5, 67,248,149,129, 48,255,186,204,
-136,105, 51,226, 10, 38,207,218, 49, 11, 33,188,116,139,233, 7, 23,114,167,137, 97,103,128,197, 90,193,248,193,135,233, 92,250,
- 28,108,171,133, 53,181,254,196,233,170,119, 55, 50,198,136, 41,132,111,173, 32, 8, 67, 84, 51,161,209,108, 99,183, 83,122,119,
-124,157,193,221,223,102,244,196,105, 76, 94,236,192,248,158,209,104,167,214,172, 59,252, 1,215,180,137,233,148,172, 2, 63,249,
- 75, 57,109,136,166, 5,190, 54,134,113,111, 6, 17,184,152, 58, 99,245,180,112, 27,171,221,245,241, 59, 78,177,123, 95,110,236,
-174,164, 94,127, 15,217, 29, 95, 92,233,179,166,107,184, 85, 32,118, 60,185,189, 94, 87, 40,151,200,231,174,167,153,218,201,154,
-241, 8,125,230, 33,212,233,251,104,245, 87, 73,182,158,166, 57,188, 64,179,119,129,230,246, 25, 90, 27, 79, 49,187, 56, 79, 26,
-182, 49, 69,233,101,115, 46,250,211, 26, 31, 23,235, 45,131,247,236, 93,226,192,229,151, 32, 66,137,136, 91,211, 6, 11, 79,160,
-148,141, 6,194, 58,193,164, 41,114,202,225, 22,229,164, 36, 8, 3,130,174, 51, 0, 42,211,140,167,239,185,143,249,195,251,232,
-204,207, 96,202, 49,198,184, 0,155,108,216,119, 33, 42,217,144,114, 82, 32, 48,100,253, 13,168, 12, 85, 49, 33, 27,143, 41,134,
- 19,210,113, 74,127, 99,155, 50,207, 25,110,110,145, 13, 6,100,163,148, 42,207,157,190, 95, 8,210,254,152, 48,136, 41,243, 28,
- 43, 32, 31, 12,200, 6, 35,103,121, 59, 30, 67,101, 72,230,231, 9, 76,142, 20,130, 86,148, 48,204, 50, 54,139,156,163,205, 6,
-129,117,242,183, 72, 10, 2, 33, 9, 3, 73,216,140, 9,146, 38,170,213, 36,156, 93,100,245,236, 83, 68,177,147,142, 69,113,130,
-204, 11,170,188,116, 40, 69, 94,145,229, 48,121,228, 81,150,102,218,156, 43, 11,236,160,100,241,133,167, 80, 6,100,160,144, 65,
- 56,101,168,215,197,221,178, 11,129, 17,194, 69,215, 86,149,215,181,239,172,108, 4,214,135, 11,213, 77,172,117,201,108, 79,222,
-143, 74,154,168,102, 11,171,164,143,105,149,200,230, 12,201,193,139, 24,111,157,113,176, 60,187,154,106,239,153, 80,223, 99, 74,
- 69,200, 40, 33,140, 18,100, 24, 67,101, 40, 77,133,185,253,119,248,131,213, 47,161, 75,135, 70,137,218,250,213, 63,206, 70,184,
-103, 73, 36,109, 70, 69, 69, 90, 84, 76, 10,231,236, 87, 84,142, 88, 90, 20, 37,101, 81, 17, 7,138,216,203,102,149,132, 32,176,
-222,225, 77, 56,228, 83, 9,100, 4, 65,232,152,239,177, 55,162, 65, 58,175,248, 70,210,112, 49,191,133, 37, 43, 92, 65,119, 52,
- 7,225, 16, 82,229, 28, 55, 31,186,231,155, 12,122, 91,204,237, 89,230,250,155,111,230,248,137, 19,220,119,255,131,211,126, 57,
- 80, 78,149, 36,181, 5, 17, 88, 34, 33, 72,148, 34,110,182,120,213,219,254, 25, 61,122, 6,107, 53,249,246,121, 68,235, 48, 98,
-227,107,252,227, 47,191,135,163,175,251, 85,178,123, 62,197,124,171,228,120, 51, 36, 93, 88, 96,207, 11, 94,200, 86,127,204,252,
- 21, 63, 8,139, 7,185,232,210, 54,119,126,227, 12,102,227, 41,250,103, 46,208,233,198, 52,132, 96, 61,117, 94,206, 13, 81, 18,
- 34,137,226,136, 86,179, 65,216,104, 18, 53, 19,198,233,152, 42,175,136, 26, 49, 97, 51,166, 55, 24,113,235, 27,223,132, 30,143,
- 48,198, 56, 27,219,164,141, 46, 11,132, 80, 84,233, 8,163,115,103, 80, 49,153, 16,196,177,151, 87,184, 91,165,156, 84, 68,173,
- 6, 86,107,210,237,109,170, 50,199,228, 99,194, 48, 32,110,118, 88, 60,116, 17, 85, 89, 98,133, 98,188,177,198,254,203, 78,178,
-125,230, 25,218,115,115, 44, 29, 57, 74,111,125,205,201, 96,168, 88,218,127,144, 81,111,224, 96, 28, 21, 51, 59,211,100,126,229,
- 40,166,146,172,236,159, 71,151,150,118,210,160, 27,133, 44,118, 26,204,180,230,104, 5, 22, 33, 67,146, 40,102,161,157,208, 77,
- 18,246, 47, 44,129, 81,164,186, 96, 92,100, 36, 65,192,129,165,101, 58,157,121,132,132,116,216,103, 97,121,133, 97,239, 2,243,
- 11,135, 40, 38, 3, 31,112,165, 25,109,109,147,180, 59,204,236, 91,100,178,185, 70, 99,105,145,170,170,136, 27,146,249,125,203,
-252,225, 79,125, 23,195,222, 6,132,130, 95,122,215,235, 57,112,229, 41, 70, 42,225,103,126,234, 71,248,223, 31,254, 75,154, 71,
- 79, 97,198, 41,175,253,217, 95,199, 71, 93,251, 48, 2, 71,246, 80,190,144, 6,245, 1,235, 13, 19, 2,220,141, 21, 41,136,173,
- 99,132, 6,214,151,115, 63,117, 91,233,101,223,218,238,120, 51,120, 35, 18,140,120, 54, 12, 92,167,121, 25,166,185,213,211,233,
-217, 23,231,154, 69, 42,216,241, 40,183, 53,129,149, 93,198, 80, 62,198, 85,238, 58, 73,220, 36,233, 52,211, 83, 43,211,218, 53,
- 78,236, 16,186,234,215,180,117,232,251,174,148, 49,166, 19,248, 78,153,183,254,240,112,147,151, 39,220, 73, 87,236,165,159, 72,
-157,201,133,220, 41,140,190, 1,176, 18,206,127,244,227,140,190,240, 21,146, 32, 38,153, 93,164,177,247, 0,241,236, 2, 97,163,
-131, 8, 99, 84, 20,211,104,197, 52,163, 16, 81, 65, 92,105,138, 7,158,160,247, 15, 95,224,220, 71,254,158,245,127,254, 50,197,
-120,132,174,229, 8, 72,183,134,242,230, 2,182, 94,144,123,244,162,214,227, 11,235, 99, 84,237,179,137,140,181, 26, 97,234,248,
- 86,163, 30,254,122,200, 64,121, 65,173, 83, 74, 96,156,227,156,156, 46, 77,132,207, 81,247,247, 64,229,167, 44,255, 58,211, 88,
-214,154,124,199, 14, 91, 30, 99, 92,115,230, 27, 33,103, 66,227,223,159,118,136,130,209, 53,115,179, 38, 36,121,237,187, 5, 51,
- 25, 35,210, 33,182,183,137, 24,111, 35,179, 20, 81, 86,140,238,252, 60,123,142, 29, 67,132, 33,152,146, 42,203,208,121,233, 38,
-244, 34,159,250,191,239, 63,178, 7, 17,198, 16, 38, 16, 52, 61, 9, 2,100,152, 32, 67,185,147, 47,142, 6, 83, 32, 27,109,178,
-222,134, 67, 98, 66,133, 41, 11,202,254, 6,149,214,116,230,102, 49,101, 78, 57, 25, 81,165, 27,110, 85, 97,115,172, 46, 65, 5,
- 4,145,162, 28,245, 17, 65, 72, 81,102, 20,147,140,124, 48,100,212, 31,208,223, 26, 80,228, 21,233, 56, 37,155,100, 12,135, 25,
-163,254,152,173,245, 62,195,113,198,133,115, 91, 20,149, 97, 56, 28, 50,236, 13, 25,109,110,144, 79, 38,164,163, 33,195,254,128,
-241, 36, 39,203, 50,180, 41,153, 95,154,231,224,225, 5,150,246,183,105,197, 17, 74, 6,104,191, 38, 50,194, 41,154,172, 48,158,
-139, 89,185,142,184, 2,107, 43,130,112,134,116, 48, 96,178,213,103,188,213, 71, 7, 18,202, 2, 83, 20, 52,218, 77,218,203, 75,
-108, 84,154,204, 90,148,182, 84,163, 49, 91, 79, 60, 77, 54, 26, 80,166, 41,186, 72, 49, 69,134,169, 10,199, 19,168,252,250,200,
- 48,157,218,153, 54,199,245,253,227, 31, 86, 15,239,216, 90,181,130,191,103,139,220,237,254,240, 5, 93, 56, 57,100, 50,179, 48,
-117,131,179, 86,187,103,219,122,225,120, 93,208,125,113, 7,135,182, 9,165,220, 97, 23, 40,182,127,246,231, 56,183,127,150,188,
- 50, 88,229, 28,225,140,117, 62, 13,149,177,100,165, 97,148, 27,210, 82,161,154, 29, 10, 33, 73, 11, 77, 86, 26,202, 90, 65,100,
-221,123, 12, 37,206,105, 46,112,111,181,242,183,188, 68, 58, 72, 93,187, 84,203, 48,112,207, 95, 24,185,157,186,244, 77,123, 28,
-133,116,219,109,172, 81,206,208,175,128,170,180, 84,149,123, 14,149,176, 4,214, 53,100, 39, 47,190,136,147,151, 94,198, 37,151,
-156,160, 42, 74,158,124,234,180, 51, 36,210,126,213,229,165,166,129, 17, 22, 93, 66, 32, 20, 21, 5,255,225, 55, 79, 99, 71,167,
- 81,170,225, 72, 37, 97, 68,181,189,197,249, 51, 99,126,234,211,127,128,213, 79, 35,155, 51, 60,244,208,136,243,195, 30,239,187,
-255, 81, 62,249,234, 87,243,179,111,255, 17,254,252,251, 95,205, 15,252,214, 91,216,251,188, 23,115,236,241, 85,190,244, 39,255,
-192,141, 63,189,200,203, 94,125, 27,189,223,253, 8,103,183, 13,179,157, 14,127,251,181,251,248,237,255,248, 26, 62,249,181,111,
- 82, 86, 21,189,237,109,230,186, 77,202,137,101,189,159,114, 52,154,193, 20, 49,111,120,231, 47, 83, 25, 67, 16, 52, 48, 38,199,
-138,157, 12,104,171, 75,208, 21, 66, 4,232, 34, 67, 72, 23,101,170,194, 0,157, 87, 46,130,211, 20, 24,155,160,203, 28,155,231,
-116, 14, 30,167,154,140,221, 97,129, 64, 68, 77,236, 48,101,184,182,202,190, 43,175,102,227,225, 71, 64, 42, 26,243,139,172,222,
-247, 16, 18, 73, 49,153,176,231,162,163,172, 63,179,206,194,254,125, 12, 54,122,116,103, 23,168, 90, 13, 38,227,140,118, 91, 49,
- 25, 43, 22, 23, 23,216,234,107, 90,121,159, 72, 45,177,209, 31,178, 56,211,196,152,144, 48, 78,232,141, 32,140, 91, 28, 63,114,
- 25,143,159,255,103,164,112,134, 63,141, 36, 98, 60, 54, 16, 54,200,243, 1, 70, 27,230,150, 87, 72,135, 27,116,103,150, 48,166,
-196, 68, 1,101, 89, 16, 37,109, 58,123, 22, 16, 42,112, 4,234, 36, 6, 51, 33, 74, 58,252,229,219, 95,195,198,249,115, 46, 17,
- 74,187,233,251,189,159,254, 32,111,126,197, 27, 88,186,252, 58,206,191,239, 67,152, 34, 99, 99,125,204,169,203, 15, 80, 25, 23,
- 9, 88,231,110,200, 26,169,113,196,108, 52, 14,142, 50,214, 71,155,122, 15,247,142,130,216, 56, 11, 89, 91,251, 26, 90,247,251,
- 58,216,195,238, 2, 87,157,108,203,122, 77,248, 78,100,103, 61,130,215,224,235, 78, 10, 24,254, 65,221,193,202,119,179,167,173,
-135,204,217, 69,188,219,237, 2, 49,109, 44,180,192,122,103, 39, 60,113,111,186, 19,174, 27, 6, 95,248,108,205,250,158, 18, 91,
-236,174,230,163,102,246,219,233, 52,234,199,213,233,158,182,126,239,102, 10,244, 59, 72, 77, 5,206, 18, 21,229,119,201,194, 50,
-121,250, 28,171,207,124,220, 31,112,138,160, 21,123,105,159, 64,104,131,173, 74,116, 94,120,248,218, 31, 32,120, 7, 55, 81,175,
- 50,132, 7, 65,236,212, 92,199,133,169, 40, 95,235, 93,232,196, 20, 0, 8,188,153, 16,142,149, 62, 45,174, 82,248,108,241, 41,
-241,223,193,129, 8,159,133,110,166, 13,178,240, 50, 64,163,119,125,135,194, 31,204,210, 69,141,202,192, 53, 52, 83, 54,187, 20,
-211, 98, 45,188,169,135,216,181,125,169,155,139,186,176, 79, 29, 56,118, 33, 57, 94, 13,231, 14,233,157,155,192, 93,229, 74,239,
- 32, 5,224,253, 41, 44,193, 99,223, 36,238,236,165, 20,150,114, 52, 68,107,111,150, 99, 53,101, 86,177,111,207, 12,243, 39, 47,
-193, 20, 5, 76,250,136,184,242,136,137,132,168,233, 38,116,173,177, 85,142,176, 6, 83,102,152,178,194, 58, 11, 53,103,242, 80,
-142,208, 85, 69,107,182, 3, 85,202,100,107,136, 48, 14,141,172,170, 2,101, 52,149, 73,177,194,241, 96, 76, 54,114, 81,154, 66,
- 81,166, 25,195,222,144,237,245, 33,253, 97, 78,156, 4,104, 3, 10,203, 96, 48, 33,155,228, 72, 96,116,110,196,210, 98,131, 42,
- 47,166,169,110,162, 55,162,211,113,103, 51, 34, 68, 6,129, 35,153,142,198,142, 63, 80, 89, 26,221, 22, 43,251,231,201, 86, 13,
-147,202, 16, 84,134, 72, 8,140,128,170, 82,236, 2,192, 28,105, 47,205, 80, 71, 46, 35,253,214,167, 16,203, 49,162,183, 69,216,
-237, 80,233,138, 80, 24, 84, 43,100,118,255, 2,102,118,150,115,253,161,203,172,239, 52, 56,253,161,207, 49,251, 43,175,163, 72,
- 71,136, 48, 34,244, 49,211,110, 98,246, 92,120, 21,184,103,223, 91,165, 9, 79,220,152,174,121,208,110,154,181,181, 50,163,142,
- 0,214, 14, 65,171, 57, 29,190,233,180, 90, 35, 91, 45,236,104,136, 54,154,192, 59, 18,214,247,164, 53,210,157, 31,218,122,174,
-136, 99,251, 11, 31, 4,211,191,251,171,112,239, 19,124,240,176, 83, 71,153, 18,239, 64, 40,208, 62,147,188, 20,160, 75, 67, 86,
- 77,232,157,126,134,113, 86,144,230,198,121,167,216,169,235,197, 84,184,145, 21,213, 52,168,165,134, 23,181,118, 23, 56,142,160,
- 17,187, 92,117, 25,184,124,118,231,108,227,204,188,242,162,162,215,219,102,156, 26, 76,102, 49,133, 69, 26,167, 96, 64, 8, 66,
-227, 24,245, 45, 41,216,179,184,196, 99,143, 63,198, 35,119,220,193,184, 50,228,254,156, 82,210,157,213,210, 63, 76,234,182, 27,
- 26,183,135, 82, 33,172,230,135,254,223,111, 17,137, 12, 33, 2,103,214,159,143, 16, 74, 81,244,214, 89, 56,126,130,251,255,236,
-247,233,200, 13,190,254,123,127,196,245, 47, 62,193,167,191, 50,224,133, 63,254, 90, 58,219, 15, 18,180, 34,110,121,247, 95,240,
-169, 31,254, 30,102, 14,236, 99,255,169,203,176,197,152,115,247, 62,140,221, 56,195,185, 39,214,120, 36,131,211,253,140,131, 51,
- 9,159,191,243, 33,110, 57,117,156,205, 81, 74, 51,138, 89, 88, 90, 34, 43, 12,157,134,224,200,165,167,104,116,219,156,120,225,
-243, 29,137,160, 24,131, 12, 80,210,105, 91,109, 85, 97,242, 9,214, 90,202, 73,138,138, 99,148,140,177, 86,184,189, 83,224,110,
-164, 32,110,160,226, 6,227,181,243, 44, 28, 63, 73,186,190,238, 37, 65, 22, 21, 37,156,127,224, 62, 26,115, 29,102, 14, 28,166,
-119,230, 9,242,126,159, 61,207, 57,201,246,153,179, 4, 73,204,112,109,147, 99,215, 95,205,234,163,103,232,206,118,201,198, 25,
-141,110, 7, 83, 26, 71,162, 51,150,102,187, 67,163, 25, 80,104, 75, 51, 50,204,118, 22,233,206, 47,177,119,105,158, 70,212,101,
- 97, 97,145,202, 86, 8,173,217,191,255, 8, 75,123, 86,184,247,209,111,250,169,212,210,109,118,185,238,242, 27, 9, 27, 32,164,
- 38, 76,186,204, 46,204, 98,181,128,200, 25,110,116, 22, 23, 8, 84, 76, 16, 75, 90,115, 75, 24, 12,157,165, 57,132, 13, 9, 26,
-109,254,247,251,222,193, 93, 95,252, 12, 69, 77, 74, 83, 14,182, 51,128,138,218, 92,119,233, 73, 26,213,128,229, 19,151,243,228,
-167,255,134,197, 99, 23,113,102, 48,228,153, 11,103,119,100,104,190, 0,123, 98,120, 13, 82, 19, 89, 39, 93,107, 88,193,130, 84,
- 44, 40, 69, 91, 5, 36, 72,130,169,188, 73,120, 98, 85,125, 80, 72, 31, 4,226,160,204,186,200,107,111, 71, 90, 79,192, 53, 57,
-207,213,166, 29,194,218, 46, 79, 20, 31, 50,194,179,166,252,218,163,172,222, 7,215,133,214,201,171,124,106,152,172, 77,227,124,
-135, 47,120,150,209,205, 20,250, 83, 59,159,193,237,136,119,246,225,198,248,120,209, 93, 70, 57,212, 69,107, 58,201,123,231, 53,
-185, 3,221,163,228,180,129,169, 89,248,120, 27,200,122,239,111,141, 99,127,187,123,185,192, 22, 5,186, 40,208,229,191,202, 44,
-223,253,231,252,231,182, 98,151, 71,155,113,223,245,148,145, 46,197,179,152,238,136, 93, 59,115, 47, 37, 68,136, 41, 3, 93,212,
-112,183,221, 97,168, 83,155,198,120,178, 31,181, 81,141, 39, 14, 78,247,234,117,203, 81, 91,254, 42,249,236, 21, 74, 77,198,171,
-181,240, 74, 60, 91,254, 86,127,223,102, 23,217,193,218,103,185,126,213, 95,190,173, 25,151,236,164,200,185,230,206, 76, 63,175,
-245, 13, 65,126,254, 41,186, 87, 60,151,209, 96,224, 78,105,173,153, 76, 82,242,209,136,108, 50,230,226,139, 86,232,238, 95,198,
-244,207, 59,254, 66,205,191,145,210,217,204,234, 12,170, 12,116,134,169, 52,182,210,216, 60,101,184,186, 74,107,105, 17, 97, 10,
-202,209,128,178,180,100,227, 33,161,205,176, 58,163, 42, 43,108,153,163,179, 2, 99, 5, 85, 81, 34,195, 16, 43, 4,249,112, 68,
- 54, 74,209, 6, 70,189, 17,107,231,182, 57,243,204,128, 65, 89,209,235, 21, 60,120,174,207,211,235, 67, 30, 89, 27,113,102, 84,
-241,205, 11, 35,198,165,102,117,123, 66,145,151,156, 89, 31,179, 61, 44, 24, 79, 74,214, 55,199,108,246, 38, 84, 69, 65,145,151,
-200, 64, 81, 20, 37, 32,169,180, 96,156,166,206, 57, 10, 16,121, 70,104,156,221,105, 44, 29, 25, 44, 8, 3, 26,157, 22, 65,171,
- 67, 48,211,198, 38, 93,198, 97,192, 96, 48, 64,102, 35,180, 10,136,162, 8,225, 61, 75,130,184,225,144,149,110,151, 39,239,252,
- 54, 51,141, 6, 97, 40,232,175, 14,152,185,234, 40, 66, 73, 84, 16, 57,102,185,220,145, 71,214, 4,216, 29,206,197,180,133,223,
-185,159,141,247, 30,112,113,140,174,129,211,238,153, 82, 79, 62,136,106,205, 32,226,216,239,212,193, 84,134,230,145, 75,177,121,
- 78,154,110, 56,254, 76,125,239, 24,235,164,130,149,198, 26,131, 82, 49, 97,220, 32,108,117, 93, 20,112,105,185,235,138, 91, 56,
-249,186,215,241, 59, 95,251, 75, 39, 97,171,117,230, 53, 26,101, 65, 91,215,112, 84,218,144,229, 21,147, 66,163,117, 61,201, 51,
-101,172, 72, 95, 72, 3, 1, 97, 80, 35,117, 76, 11,127,162, 4,173,166,164,213,132, 40,118,177,220, 88, 8,189,191,187,173, 32,
-203, 44,233,200,144,142, 12,194, 8,178,137,128, 74,130, 17, 40,227,178, 34,186, 74,210, 10, 36,183,222,122, 43, 50,137, 81, 65,
-192, 40, 77, 41,170,202,103,187,187,243, 52, 16,238,188, 86, 47,189,185,125,187, 48,134, 87,190,229, 31,153,157, 95,112, 29, 62,
-194,101,146, 11,133, 41, 38, 4,141, 38,195, 45,195,242,201, 69, 76, 60,203,224,203, 95, 36,220,187,192,139,126,252,245, 60,246,
-199,239, 36, 90, 57, 64,107,101,133, 71,222,246,195,156,248,233,183,178,250, 87,239,103,245,155,247,178,117,118,155,243,207,140,
- 57,122, 52,102,107, 96,120,106, 44, 56,151,150,204,198, 1, 15,246, 83,204,214, 58, 7,143,173,160,117,136, 38, 67, 9,193,202,
-209,253,220,125,231, 3,188,226, 13,175, 66, 53,218,128, 33,236, 44, 32, 84, 72, 53,234,123, 88,207, 82,229, 25,101, 62, 65, 42,
-137,214, 21, 50, 74,176,218, 96,242,146,176, 25, 33,163, 6,217,246, 38,213,120, 76, 50,219, 70, 70, 45,119, 72, 91, 77, 62,232,
- 81,230, 19, 22, 14, 29, 36,234,204,177,245,212,147, 72,165,232,236,217,131,206, 50,138,180, 96,120, 97,157,165,131,123,153, 12,
- 71, 84,121, 78, 99,166, 67,220,108, 48,220,234, 51,179,103,150, 34,203,105,119, 58, 68,141, 14, 81,123,158,222,153,117,154, 93,
- 75,119, 97,145,238,220, 60,243,199, 46, 71,143, 54, 88, 58,116, 20, 81,142, 89, 90, 92,224,212, 53,207,227,238,175,125,145,178,
- 28, 16, 5,146, 32,136,184,233,170, 91,105, 36,146,206, 92,135, 81,175,207,193, 75,142,163,141, 37, 8, 21,147,254,132,125,151,
-156,192,218,130, 32,112, 33, 51,205,197, 69, 16,150, 70,107, 30, 66,203,104,123,149,255,245,174,255,196,216,251,112, 27, 47, 79,
-203,188,169,201,225,195,199,232,246, 6,252,225,123, 63,198,203, 94,245, 61, 52,230, 98,146, 80,178, 77,204,131, 15,220,141, 10,
-220,158,173,174, 89,202,223,164, 74, 72, 66, 36, 77, 33,105, 9,193,172,144,236, 13, 2,230,164,139, 74, 13,165, 68, 90,185,211,
- 77, 91,235,119,197, 94, 63, 91,241,172,189,217, 20,250,181, 30,110,157, 14,196, 98,202,145,178,187,217,116,117,113, 48,187, 10,
- 10,255, 87,110,169,159,186,107,104,221, 21,170,233,110,127,202, 36, 23,211,181,219,180, 65,176, 59,123, 92, 91,239,200,167,198,
- 42,181,190,218,117,250, 18,225,167,225,122,111, 47,166, 36, 63,233, 11, 86, 93, 56,167,100,239,233,126,223,187,215,213,204,224,
-154, 24,168,205,142, 78,155, 29,216, 81, 74,137,214,214, 79,212,118,250, 89,166,129, 43,211, 24,211, 93,187,233,186,113,120, 22,
-111, 65,185, 98,172,148,231, 45,212,250,125,118,116,233, 59,238, 63,254,146,200, 93, 60, 0,187,219, 42,203, 39,222,213, 64,196,
- 14,131, 93,248,148,181,233,190, 93,219,157,240, 0,177,235,215, 90, 25,225, 67,159,237,174, 34,204,116,159,111, 92, 67, 35,118,
-125,137,117, 99, 50, 37, 47,214,231,247, 78, 8, 79,109, 52, 48,181,255, 69, 82, 62,246, 77,194,227,215, 50,220,220, 36,105, 54,
- 25,110,110, 80,228, 57, 75, 51,109, 46,123,201,139,168,122,171,211,176, 25,215, 1, 6,136,168,133, 45, 70, 80,229,216,106,226,
- 97,228, 10, 83,229,232,116,200,250,227,143,178,112,228, 8, 54, 79,201, 54,215,169,202,140,205,167,215, 8, 85,133, 82, 56,244,
- 16,156,132, 22,227, 52,243, 85, 69,158,142, 41,243,146, 65,111,194, 36,205, 89, 95,237,113,110, 51,229,220, 32,231,194, 48,231,
-174,115, 67, 54,210,146,213, 73,197,189,253,130,103, 38, 37,131, 18,182, 74,195,106,102,120,178, 95,176,154, 86, 12, 11,205, 83,
-195,130, 97,238,146,189, 54, 70, 37,141, 64, 50,153, 20, 36,145,194, 10,201,184, 63, 2, 93,145,230, 37,219,163, 28, 91,104, 34,
- 99,221, 62, 93, 41, 34, 43, 73,162,144,168,221, 34,108, 52,144,205, 54,133, 74,216,170, 10,218, 71, 79,177,246,237,127, 33, 74,
-154,232, 74,211,153,105, 58,167, 64,165, 80, 42,164,189,184,151,187,255,233, 75,236,157,109,210,203, 74, 68,168, 48,167, 7, 52,
-174, 63,234, 84, 83, 42,152, 62, 31, 86,136,233,176,224, 8,154,169,132, 28, 0, 0, 32, 0, 73, 68, 65, 84,203,114,103,149, 38,
-118,206, 9,180,147, 26,218,186,168, 27,143, 16,101, 25,242,244, 35,168,206,140, 83, 55, 9,225, 92, 67,141,160,117,244, 82,244,
-104, 72, 90,246,145, 74,237,202,113, 48,110, 24,173, 42,103,172, 21,183,136, 90, 45,130, 56, 66, 69, 93,190,114,197,181,236, 59,
-122,144,211, 75, 9,159,121,228, 46,114,237, 13,177,148, 11,114,113,230,131, 98,154, 74,236,238, 81, 73, 24, 70,100, 89,181, 43,
-105, 80, 76,213, 23,113, 20,208,233, 38,142,119,130, 69, 41,247,208,132, 18, 58,137,100,177,163,104,249,130, 30, 4,214, 33,102,
- 62,243,162,172, 28,161,111, 60,180, 20,153,132, 66,184, 12,117,237, 24,239,210, 10, 66, 41,233, 68, 17,157, 70,204,125,247,223,
-199,104,156,178,188,180,200,181, 55,222,196, 21, 87, 95,193,125,247,221,139, 12,156, 22, 94, 10, 73,172, 4, 50, 48,240,162,215,
-253, 17,203,251,143, 97,138, 49, 53,136, 40, 60,129, 71,168, 24, 93,106,226, 86,196,214, 5, 69,243,154,155,185,248,123,175,231,
-220,183, 31, 35,185,245,117,180,226,130,206, 53, 55,210,125,254, 15,209, 73, 42,246,188,240,229,220,240,231,159, 96,223,201, 46,
-151,254,219, 23,243,188,231,207,112,224,187,111, 98,238,208, 60,139, 73,192,188, 48, 76,252,129,113,102,123,140,209,134, 81,182,
-141, 52,146, 60, 79,217, 92,239,115,252,248, 1,146,238, 28, 66, 69, 8, 25,160,171, 2,132,165,202, 75,116, 58, 64, 23,169,107,
- 62, 12,148,227,161,131,200,170, 28, 99, 53, 50,114,135,226,224,233, 51,180,150, 87,136,103,186,132, 51,203,140,206,157, 69, 79,
-134, 20,233,144,238,129,195,116,246, 30, 68,107,201,240,194, 5, 58, 75,203,140,183, 6, 32, 20,218,184,116,158,165, 35,135,144,
- 81,194,176, 55,102,118,239, 30,154,115,243,164,195,138,206,236, 44,197, 80, 51,187, 52,135, 8, 21,107,231,207,144,141, 55, 56,
-120,242, 4,113,208, 64,197, 22,173, 20,197,214, 42,179,251,247,179,176,114, 49, 38, 31, 18, 5,154,193,198, 83,156, 56,190,194,
-165, 7, 14,115,253,241, 75, 56,181,255, 0,251, 22, 22,105,116, 2,132, 85,172, 28,186,152,116,216,167, 51,191, 68,158, 78, 88,
- 60,112,144,246,210, 28,166, 84, 68,173,136,112,102, 30, 25, 42, 58, 11,203, 88,233, 18,131,200,115, 7, 23, 97,153,120,211,160,
-220, 39,129, 69, 81,192, 45,167,174,165, 26,110,240, 11,191,241,118,130,185, 46,171,159,255, 52, 34, 73, 88, 91,127, 6, 17, 56,
-163,178,192, 79,232,177,179,111, 38,176,146, 72, 72,186, 74, 48, 39, 4,139, 74,178, 23,201,156, 80, 36, 82,144, 72,137,170, 33,
- 89, 95, 56,167,149,153, 93,147,216, 84,241,100,255,111, 6,250,174,179,223, 65,129,150,103, 69, 45,152, 29,178,215, 20,179,221,
- 93, 28,234, 61,251,174, 49,190,118,144,219,165,178,218, 41, 98,245, 20, 88,239,244,252,110,177, 78,121,171, 33, 62,247,179,214,
-179,249,107, 56,218,127, 38,229, 57,182, 74,236, 10,129, 17,117, 76,146,219,164, 5, 62, 17,206, 10,223, 32,236,104,197,181,103,
-220, 27,237, 72, 56,214, 79,215, 22,175,229, 22,194,169, 35, 37, 24,140, 79, 27,243,134,243, 53,140,237,119,164,181,139,157,245,
-221,141, 84, 62, 44,165,206, 50,159,202, 15,236,174,204,115,235,141, 91,172,223,147,179,195, 68,183,222,205,110, 10,129,251,207,
-110,156,209,139,172, 27, 16,111,222, 93, 75,230,116,169,119,190, 67,191, 83, 23, 22, 31, 53,229,161,242,210,165,216,200,192, 47,
-254,234,247, 84,195,180, 66, 98, 43,127,205,181,222,213,149,153, 29,145,175,223,203,187,247,227,154, 36,180,223,197, 91,231, 37,
-111,189,219,152,245, 73, 99,234,243,255,131,229,197, 5,170,178, 68, 10,193,133,181, 77, 14, 93,180,226, 77,126, 42,170,237, 53,
-202,254, 26,229,230, 42,214, 84,216, 50,197,150,153,147,127, 88,192,148,232, 34, 69,103, 61,198,171, 79, 49, 94, 91, 71,216,138,
- 50, 29, 81,101,125,198, 27, 91,244, 55,122,152,170,112,172,121,173,169,138, 18,141, 70,231, 21, 84, 57,249, 36,163,204, 42,178,
-202,146,142, 11, 46,172,246, 56,187,145,178,214,207,176,194,242,149,243, 35,206, 23,154, 71,211,138,243,185,101, 37,137,249,174,
-189,123, 57, 53,211,225,134,197, 5,174,152,155, 97,100,224, 92,105,184, 63,173, 56,155, 91,190, 53, 40,249,226, 90,206, 83,227,
-138, 47, 61, 61,164, 63,202, 25, 14, 82,138,116, 68,179,233,140,186, 2, 36,137,132, 65,101,200,180,161, 48,150,172,172, 92, 1,
-173, 85, 28, 82, 34, 21,100,227,140, 82, 24,148, 45,177,203, 39,153, 12,183, 24,143,134,244,251, 67,116,230,108, 86, 69, 96,136,
- 67, 56,126,203,181,172,110,246, 17, 8,148,146, 60,243,196,147,152,123,207,145,230, 99,138,241,136, 98, 50,161,202, 38,152,162,
- 64,151,165, 91, 91, 84, 37,214, 84, 24,227,166,104,170,202,125,183, 85,181,179,118,161,118,124, 52,160, 66,236, 51, 79,184, 70,
- 75, 56, 25,103,253,221,139, 48,116, 35,174, 53,238, 59,211,213,212, 22,220, 84, 21,182, 40,166,247,132, 10, 3, 84, 16, 18, 36,
-115,156,127,211,155,217,234,111,209,110,207,241,158, 59, 63,138,149,126,133, 35, 93, 1, 13,172, 59,215, 90,145, 66, 41,233,181,
-225,130,133,133, 37,246,238, 89, 33, 14, 67,103,168,132,112, 83,185,245, 86,187,157, 22,237,168, 69, 86, 57, 98,167,182, 2, 97,
- 37,205, 56,164, 21, 73, 26,129, 32, 82, 78, 30,167,252,128, 64, 33,176,149,196, 26,193,112, 32,152,100,130,178,112, 43,187,192,
- 72, 90, 10, 98, 4, 1, 46, 91,163,219, 76,136,162,152,229,253, 7, 56,122,209, 49,150,247,238,103,107,179,199, 61,223,188, 7,
-101, 5,232,218, 4,204, 98,133, 32,248,183,111,252, 11, 14, 92,116,163,227, 8, 71, 93,215, 58,120,137, 77,141, 97,170, 40,225,
-252,227,143, 34,163, 14, 95,249,229,119,112,195,109, 71, 72, 90, 25, 73,178,198, 63,253,253,131,252,232,237, 87,179,241,209,183,
-147, 92,123, 35, 52,247,112,215,111,191,141, 19,175,126, 7,233,249, 71, 9,247,104,170,198,113, 50, 30,100, 38,236, 33,165,228,
-225,173,148,163,173,136,254,112,196,250,154, 51,111, 57,123,126,149, 35, 7,247,242,213, 59,239,227, 63,191,251, 29, 24, 25, 33,
-116,133, 10,155, 84,222, 29, 43, 72, 26, 20,195, 62, 50, 40,145, 81, 19, 19, 40,162, 96,150,170,114,240,182,201,221, 94,175, 74,
-199,204, 30, 57, 76,145, 14, 17, 82, 81,172,175, 34,164, 98,178,189,201,242, 21, 87, 50, 58,127, 30, 21, 72,178,193,144,184,213,
-102,227,177, 39,233, 44,206,162,243,140, 32, 78, 16,113,196,246,249, 53,198,189, 13,142, 94,119, 45,235,143, 63,193,120, 48, 32,
-110, 5, 84,185,197, 72,227,180,247,195,156, 75,175,190,140, 50, 55,228,153,165,181,184, 72,190,118, 63,182, 41, 33,154,167,204,
- 50,198,155, 79,112,228,212, 53,228, 89, 73,210,158,103, 50,234,177,176,180, 68,179, 59,199,201,197, 61,232,170, 96,239,209,171,
- 25,108, 12,152, 89, 92,228,233, 39, 31,193, 84,112,240,178, 43,104,204,118, 80, 42, 98,238,240, 10,217,120,194,204,226, 60, 97,
-224,204, 65,164,117,246,106,186,116,251,182,202, 63, 19,133, 47,232, 26, 69, 20,183,184,232,232, 33,190,244,197,175,112,245, 13,
-115,100, 15,125,131,203,223,250,219,160, 20,131,173,191,114,204, 85,107,161,112,222,219, 66, 10, 66, 43,104, 37, 1, 11,243,243,
-136,209,136, 86, 86, 50, 35, 4,221, 72,209, 14, 4,137,144, 46,227,156,218, 93,204, 78,235, 71, 61,113,213, 93,248,179,228,107,
-245,115,107,205,206,207,212,123,219,186,120,138, 29, 45, 91,189, 41,181,214, 78, 37, 98, 53,116, 44,107,239, 90,249,236,132,181,
-169,183,188,223,231,154, 26,206,171, 11,243, 20,145, 16,211, 2,137, 39, 11, 90,179, 19,249, 34,165,147,147,201, 93, 82,185,250,
-173, 73, 47,221,115, 69,174,142, 37,101, 26, 24, 83, 19,234,172,216, 21,100, 82,239,171, 13,126, 31,110,167, 5, 83,248, 15, 38,
-119, 89,174,154,250,215, 93,205, 76,173,183,159,174, 39, 60,147,220,122, 19, 31, 93, 89,103, 71, 43,189, 44,173,254, 46, 48,211,
-235, 99,173,143, 61,149,174,113, 53, 83, 68,221, 71,172, 42, 57,221, 47,214, 25, 1, 72, 7,239,153, 74, 79, 53,234,118,218, 52,
- 89, 15, 55, 90,207, 20,175, 3,180,204,191,106,198,172,247,146,247,112,185,117,210, 56,231, 39, 47,156, 94,223, 95, 79,247,193,
-141, 87, 17,236,110, 48,216,249,194,216,209,247,214, 77,137,177,181,215,134,207,104,215,110,223,206, 87, 63,198,226,209,203,104,
- 92,124,156, 35,203, 77, 86, 78, 94,204,248,161,111, 80, 13, 86, 49, 18,200, 50,144,154, 36,155, 16, 31, 60, 49, 85, 43,160, 34,
- 96,130, 41, 82,244, 56, 35, 29,244,153, 12, 39,152,116,132, 46, 38, 20, 85,200,104,235, 60,162, 50,228,233,152,102,123, 6, 99,
- 4, 69,161, 29, 12, 95,148, 76,134, 19, 44,146, 73, 1, 89,110, 25,140, 51, 10, 3,227, 76,179, 85, 26, 62,242,120,143,110,224,
- 2,143,154, 50, 32, 84,130, 84, 74,238,232,245,168,202,138,197, 73,198,177, 56,225,165,139, 11,168, 32, 96,179,204,120,172,159,
-114, 94,231, 68, 74,176,150, 27, 2, 9,247,108, 78,184, 82, 73, 90,147,146, 78,199,208, 76, 98, 42, 11, 81, 28, 16,181, 18,242,
- 52, 39, 43, 13,137,247, 34,177,194, 17, 39,141,245,105,141, 24,204,255, 33,235,205,163, 45,189,234, 58,239,207,222,207,120,230,
-225,206,247, 86,221, 91, 73, 77,169,164, 82,153, 99, 2, 9, 36,160,128, 50,168, 56,161, 66,139,104,183,118, 59,188, 78,221,175,
-195,171,104,175,229,194, 94, 54, 78,171,181,105,193,110, 20,151, 12, 34, 40, 74, 16,136, 96, 32,129,204, 33,115,170, 42, 53, 87,
-221,249,222,115,207,248,204,123,191,127,236,231, 12,101,255, 81,171, 32, 44,110,238, 61,231,220,103,239,223,247,247,253,126,190,
- 74,145, 38, 33,151, 58, 9,242,210, 6,135, 14,185,236,236, 73,156, 74, 9, 18, 11, 25,249, 72, 75,113,251, 91,223,204, 31,127,
-245, 49,110, 45,149,232, 42, 69,193,115, 56,253,137, 7, 57,114,237,187,136,104,231,239, 99,254,123,155, 35, 99,135, 23,101,172,
- 28, 94, 32,243,232,205,200,236,166, 71,127,107,173,208,182, 11,167, 94,134,122,221,196,151,173, 73,178,161, 52, 69, 51, 42, 29,
- 93, 56, 65,153, 21, 85,154, 25,102, 61, 2,203,117,144, 72,220,250, 28, 91,127,249, 17, 30,252,200,255,225,218, 99, 71, 88,155,
- 47,211,123, 53, 26, 61, 62,124, 75,224,216,146,138,107, 96, 51,122, 88,120,164, 53,177, 16, 70,245,232,236, 98, 97, 0, 51,227,
-150, 66,243,253,196, 73, 74, 28,133,198,189,158,171,147,101,223,197,119, 4, 5, 55, 53,101, 46, 22,216, 66,147,196, 32, 51,129,
- 74, 33,214,138, 48,132, 56,209,132,145, 1,191,233, 84, 80, 4, 44,164,145,232,209, 72, 45, 8,227,148,126, 24,241, 67,223,243,
-189,172,173,175,243,216, 51,207,178,186,182, 74,148,166, 88,249,179, 76,229,175,115,170, 21,246,190,195,119, 27,214,115, 94, 49,
- 99,170, 10, 83, 44,219, 39, 25,180,145,133, 18,253, 43, 87, 40,150, 43,232, 36, 98,254,230, 55,240,204,195, 95,167,178,176, 4,
-178, 75, 81,131,163,187,156,251,210, 99,220,241,193, 63, 4,107, 0,131, 29, 68,103,157,221, 83,151, 56,127,174, 75,249,249, 7,
- 57,114,243, 53, 92, 63, 27,112,233,147, 61, 58,169,133,239, 75,138,184,148,125, 88,107, 39, 44,213,235,108,109,247,248,246, 55,
-220,141, 44, 21,232,183,214, 41, 79, 47, 17,108, 92, 64, 43,141, 91, 46,229, 89, 63,207,200,124,105, 10, 74,144,166, 61, 44,183,
-132,214, 22,144, 96,251, 69,208,144, 6, 1,105, 48,128, 76, 97, 21, 76, 51, 91,101,126,158,141, 23, 94,193,182, 20,133,169, 41,
-138,141,105,122,155,155,148,155, 53,220,114, 21,165, 52, 73,208, 35, 25, 4,128, 96,106,126,129,221, 11,231,137,163,152, 65,107,
-135,233,229, 5,250,173, 54,126,177, 68, 18, 11,132,206,144, 5,159,160,211,165,187,183,135,214, 1, 75,199,110,161,219, 82,116,
-119,206,163,173, 26, 59, 59, 91,212,231, 86, 40, 87, 75, 8, 75, 50,127,253, 45,204,107, 73,123,115,147, 82,173, 65,191,183,199,
-250,217, 87, 57,250,218, 55,209,217, 94,229,174,239,127, 23,142,111,147,236,117,232,246, 6, 12,118,183,152, 94, 89,166, 88,113,
- 40, 20, 61, 84,166, 13,124,194, 53, 31, 98, 33, 76, 46,114,184,239, 9, 50, 51, 81, 42,157,241,223,255,235,135,120,225, 67,191,
-207,218,171, 87,184,241,194,243,212,190,235, 71,200,226, 30,150,244, 57,245,226,211,163,200,152, 51,236, 18,215,218, 52,176,105,
- 65,210, 25, 80, 10, 18,234,150,160, 42, 44, 74,194, 72,119,182, 16, 6, 39, 60,169,144, 14, 87,169,234,234,230, 78, 49, 58, 25,
- 76, 4,106, 24,133, 26, 26,139,133,209,162,198, 36,182,171,236,241,227,137, 95,231,187,222, 9,191,220, 88,214, 30,197,176,184,
-234, 50, 97,228,230, 92,154, 31, 30,190,218, 56, 93,135,206,122,115,192,229,213,163,114, 88, 80,147,155,193, 36, 99, 16, 78,166,
- 71,195,172, 26,181,151,233,209,107, 54,148,182, 13,151,122,210,192, 55,121,167, 25,201, 5,249,160, 58, 84, 27,204,197, 70, 98,
-228,244, 97, 59,218, 48,158, 51,148,232,117,126, 1, 26,202,247,227,135, 75, 94, 99, 58,228,211,232,225,247, 54,129,126, 69,140,
-100, 70,114, 52,165, 74,149,145, 51,135,253,233, 50,143, 19, 40,243,150, 73,203, 71, 91, 22,164,161,185, 28,137, 92,189,203,149,
-138,209,123, 40, 13,104, 67,101,198,241, 59,202,242,231,147,245, 36, 4, 71,165,217, 40, 42, 56,169,230, 76,220, 82, 70,142,233,
- 73, 51, 36,121, 23,187, 49, 99,142,211, 10,163,157,186,158, 80, 27, 68,174,216, 76,188, 1,233,153,231,241, 94,125,129, 3,239,
-124, 23, 74, 70, 68,187,219,172, 63,246,117,138, 75, 11,148, 26, 62,131,237, 54, 73, 16,226, 76, 45, 34, 11,197,220, 12,224,161,
- 11, 51,100,187,187, 36,131, 46, 73,183,203,244,210, 2,105, 28, 16,245, 35,122,123, 93,130,126,196,102, 43,162, 94,151,244,219,
- 3,210, 84, 16,199, 41, 66, 42,194, 78, 76,123,187, 79, 34, 37, 65, 0,171,155, 61, 94,184,210,229,114,144,242,173,221,144,189,
- 20,246, 87,125, 22, 27,117,234, 37,143,106,169, 64,193,181,113, 93,155,162,239,160, 51, 77,156,165,236,244, 67, 46,182,123, 68,
- 91, 93, 86,108,155,239, 90, 88,100, 59,137,120,104, 99, 3,157,147, 44, 3, 5, 27,221,148,185,178,131,234, 71, 20, 10, 14,142,
- 20,216,104,202, 69,159,237, 94, 64, 69, 75,148,210, 68,217,176, 44, 75,163,165,133,176,109,186,187, 61,116,165,142,176,125,102,
-166,170,124,226,193, 53,166, 27, 53, 10,117, 69, 81, 72,170,137, 66, 74, 23,183, 92,199, 22, 9,223,254,125,111,226, 27,127,255,
- 32, 11,213, 2,139,215, 44,115,230,149, 51,244, 62,254, 24,233,191,187, 27,217,235,153,115, 68, 74,236,171,122,203, 65,122, 2,
-249,111,219,125,115,147,173,206, 87,163, 58, 77, 65,132,232,126, 23, 81,111, 26,245, 47,206,192, 49,132, 70,187,214, 64,245,187,
-224, 58,208, 78, 76,213, 41,114,132, 13, 86,153,198,182, 61,132,130,226,242, 50, 23, 63,248, 1,190,249, 27,127, 72, 54, 85,230,
-214, 91,238,226, 61, 39, 63, 78, 39, 76,200, 50,141, 99,131,101, 73,106,158, 69,201,178,113,165, 32, 22,166,169,207,182, 28,220,
- 68,163,226, 62, 83,149, 6, 54,154,118,183, 71,146,105, 98,165, 81,169,185,136,244,250,129,113,168,231, 34,148, 84,154, 88, 37,
-166, 12, 75,152,202,112, 41,161, 82,172,210,235,133,249, 74, 38, 35, 77, 37, 97,148,209,235, 67,156, 8,102,202,101,226, 65, 66,
- 18, 37,160, 53,177, 18,230,210,137,166, 27,135,164, 74,241, 63, 63,250, 23, 52,234, 83,236,223,183,196, 93,119,222, 78,140,230,
- 19,159,253,140,105,216,204,221,244,104,114,147, 93,150,128, 93, 32,237,108, 98, 21, 74, 72,203, 37, 13, 3,236,114,141,164,211,
-161,187,125,133,198,210, 2,189, 43, 29,166,175, 63,129, 95,242,233,188,248, 25,104,239, 80,105, 8, 90, 79, 61,197,244,190, 38,
- 76, 29,131, 23,254,142,153, 91,111,226,153,143,254, 5,213,197, 3,156,168,183,120,238,233, 43, 20,122,139, 52, 78,220,137,165,
- 46, 16,105,141,210,146,141, 48, 99,163,157, 50,211,240,233,165, 41,150,208,156,120,237,173,244, 90, 45,202, 83, 51, 36,131,129,
-201,234, 23, 74, 72,233, 19,110,175, 81,152,219,143,138, 18, 52, 22,105,216,198,173,214, 81,169, 66,165, 49, 78,209, 80,131,210,
- 48,196,178,109,116,166, 41, 52,166,209,105,132,219,152,102,245,201,167,176, 93, 69,161, 49,139,101, 91,100,113, 72,150, 68,120,
-149, 34,253,214, 30,105,212,167,177,188, 66,210, 11,137,195, 0, 28,155, 66,177,132, 16, 1,115, 43, 43, 92,122,229, 12, 65,175,
- 79,146, 68,180,183, 2, 28,171, 79,127,111, 11,215, 45, 48, 59, 63, 67,154, 54,233,236,172, 51, 24, 64,117,110,133,242,212, 2,
-133, 66,137,213,211, 79, 81,154, 94,164, 88,157,167, 49,187,132, 87,111,112,236,219,191,139, 52,142,200,162,132, 65,123,151,222,
-246, 14,181,153, 5,202, 83,101,250,107,155,172,157,190,200,220,177,107,168,212,235,148,166,106, 8,157,145,102, 10,219,118,137,
- 6, 29, 74,110,133, 88, 64,183,189, 67,146, 83,223,162, 12, 44,199, 34,201, 50,126,239,125,255,153,167,255,219,251, 81, 94,133,
- 21,209,103,234,246, 59, 16,210,198, 82,235, 60,241,216, 21,132,101,110,210, 89,106, 36, 40, 91,152,105,209,206,192,138, 51, 68,
- 18, 80, 22,146,146,101,254,248,128,173, 13, 89, 78,163, 13, 61, 65,169, 49, 65, 74, 77, 28,100, 67,136, 60, 54, 94,125, 25, 84,
- 70,188,119, 33, 63,216,245,104,199,107, 36,228,124, 23,127, 21, 63,118,130, 67, 51, 68,148, 42, 51,211,203,145, 25, 45,159,124,
-149, 30, 41,181,195, 97,143,137,189, 43,121, 17,141,214,102,223,165,244,196,238,117,130,128, 37,135, 46,238, 76,231,197,110, 35,
-151,218,196,154,127,130,152, 38,198, 18,188,200,229,248,161, 44,174,153,104, 64,155,160,174,105, 61,194,219, 24, 51,225, 68, 52,
- 76, 79,168, 28,122, 66,113, 24,250, 11, 70,164,186, 28, 50, 55, 84, 71,134, 7,250,200,213, 46, 38,238, 5, 19, 85,179, 82, 72,
-195, 15,200,115,226,210,146, 19, 77,109,122, 28,213, 67,129,146,104,219,206, 47, 12,217,196, 46, 91,143, 92,249,194, 50,211,222,
- 72, 14,159, 48,189,201,252, 53,209,122,226,226,164, 39, 46, 93, 90, 33,176, 70,200, 88,178, 92, 41, 24,195, 11, 70,153,241,145,
- 36, 59, 68, 18,234,241,223, 82, 76, 92,178,212, 4,169,110,130,132, 39,164,141,206, 50, 22,223,251, 35,236, 62,250, 44,141,202,
- 9, 54, 95,120,134, 83,207,236,113,230, 75, 87,216,104, 39,188,243,254,121,230,111,180,144,207,126,141,202,161,155,145,149, 42,
- 90,122,166, 8,198,109,208,239, 94, 36, 76, 37,211,251,230, 72,194,140, 32, 52, 19,238,160, 51,160,181,219,229,197, 65,159,219,
-239, 90, 32,234, 71, 36, 10,226, 32, 37, 73, 21,137,109,211,221,139,232,116, 19, 94,221,234,115,166, 27,115,166, 27, 83,240, 92,
-238, 60, 50,207, 76,173, 74,173,232,211,172,215, 40,149, 74,212, 42,198,183, 99, 57,198, 7, 17, 70, 33,105, 26,209,235,247,216,
-109,237,113,105,109,151,167, 46,108,176,140,228, 7, 14, 92,203,195,107, 87, 8, 8,105, 69, 25,115,197,140,118, 98,211,143, 67,
-210, 52, 99,170, 94, 50,114,175,214, 68, 66, 18, 42, 77, 24,103, 72,223,193, 74,205,155, 33,180, 70,184, 30, 23,174,188,202,204,
- 98, 3,219,115,217,217,220,224,231,127,233,167,249,243, 63,250, 16, 63,120,223, 77,172,118, 58,248,243, 83,216, 89,132,140, 3,
-180,157,241,109,111,253,118, 62,245, 15,255,194, 84, 28,179,120,226, 58,206, 94, 94,227,229, 83, 47,114,207,131,179,116,223,114,
-132,218, 32, 15, 98, 11, 57,118,222,230,192, 35,109,139, 28,192,146,127, 94,149, 50,239,191, 54, 7,187,182,108, 56,119, 18, 44,
-219,124,222, 51,141,178,243,221,123,166,241, 74, 85,178,221, 29,212,252, 12,233,160,143, 93,208,104,140, 1, 84,197, 25, 58, 78,
- 96,186, 70,113,121,153,111,189,249,123,216,248,214,203, 76, 93, 51,207, 77,135,143,243,103,189,231, 9,147,212,244,203,231,251,
-115, 35,115, 27,108,178, 37, 36,174, 48,175,151,133,160, 90,144, 20, 60,159,106,109,150,181,244, 18,133,204,165, 21,165,244,226,
-140,212,102,244,123,225, 72,115,225,206,253,150,164,153, 34, 82,130, 72,155,233,190,234,248, 20,203, 77,130,222, 38,105,144, 17,
- 7,130, 32, 81, 12, 66, 65,191,175,241,109,155,130, 91,160,223,137, 73, 50, 77,162,243, 97, 68, 24,159, 84,152, 25,130,221,181,
-215, 92,203,254,125,251, 88,152,155, 37,137, 66,206, 94,190,156,175,156,134,170,158,185,144, 27, 75,161,229,160,194, 54,118,117,
-218,212,238,165, 9,168,140,116, 16,144,134, 61, 26,139,166,226,211, 42,248, 72,167, 64,187,171, 72,171, 55,179,243,240, 23,240,
-143, 46,243,202,223,126,154,198,161, 69,226,147, 95, 71,150, 23,232,156,251, 23,142,188,237, 77, 60,250, 23,159, 98,249, 61,247,
-113,227,254,253,124,237,179, 39,233,159,127,140, 98,185,192,238,222, 14,221,205,148, 56, 85,188,161, 82,162,213, 14, 72,116,200,
- 29,183, 28, 67,105, 40,148,107,164, 73, 4,253, 30, 78,209, 80,226, 84,166,176, 11, 21,146,126, 31,203,245, 73, 7, 1, 94,173,
-153,203,130, 10,219,247,205,154, 38, 10,112,252, 18,189,173,117,138, 83, 85, 52, 25,178, 82,165,119,229, 50,182, 99,211, 92,217,
- 79,208,105,227, 58, 30,231, 31,127,156,198, 82, 3,116, 9, 21,103, 88,150,197,206,165,243,236,156, 89, 99,238,224, 18,245,133,
-253,172,158, 58,137,214,154, 43,167,206, 35, 85,196,204,252, 62,162, 32, 32, 41, 41, 26, 51, 51, 44,223,113, 43,187, 23,119,184,
-124,230, 44, 58,203,176,236, 2,197,114, 17,157,180,232,237, 72,108, 15, 14,222,118, 31, 89, 78,198,218, 58,127,146,238,250, 69,
-252,230, 28, 74, 89, 84,230,167, 89, 62,113, 39,165, 74,149, 36,142, 56,245,240,147, 92,120,254, 57, 86,110, 56, 65, 18,165, 76,
- 47, 78,209,222,222, 5,160, 58,211, 64,105,141, 99,151,205,112,105, 73, 26,243, 43,230, 63,231,168, 68, 75, 72,254,228,247, 62,
- 68,114,230, 91,236,217, 14, 79, 61,242, 60,191,245,241, 63, 65,207, 47,147,156,254,103,220,195,111,230,211, 31,255, 13,148, 54,
-152, 88, 68,222, 18,164, 5,142, 6, 79,152, 28,122, 73, 11,106,182,196, 71,226,102,198,100, 35,243,135,164,237,150, 72,163,158,
-153,203,242, 73, 89, 90, 2,149,234, 17,108, 2,161, 17,110, 21,167, 58, 79,214,221, 25,159,111,195,195, 80,142, 11,100,134,146,
-248,228,126, 92,140, 26,144, 24,237,114,133, 30,138,245, 10,153,229,166,175, 97, 20, 70,138,145, 36, 60,202,186, 14,243,215,249,
- 87,204,178,177,140, 62, 2,202, 24,125,121,228,224, 30,221, 71, 84, 46,197,231, 49, 21,161,135, 82,182,188,218,193, 45, 52, 58,
-205, 15,201, 97,123,221,200,141, 61, 54,248, 9,173,134,202,114, 46,241,235,113,129,133, 96, 44, 55,139,113, 27,218,240,159,105,
-196,196, 20,170,209,105,190,130, 24,114,180, 70, 69, 45, 50,143, 15,229,146, 92,146,215,157,142, 88,248, 98,228, 43, 27, 54,213,
- 13, 39,122, 35, 59, 26, 21, 3, 1, 58,234,161, 99, 53,234,202,213,249,164,111,126,223,134, 6,181,177, 84, 63, 60,188,181, 34,
- 39,179,141, 95, 39, 61,241,158,140, 82,105,217,152, 85,128, 52,123, 72, 3,154, 25, 67,124, 70, 7,251,196, 14,126,210,168,167,
-134, 55,191,225, 6,103,152,163,183,229, 68,140, 82, 49,247,131, 63, 67,177,228, 83,252,225,187,233, 60,252, 49,178,126,135,157,
-118,194,233, 78,198, 55, 90, 25,207,127,238, 50, 63,250,106,151,187,223,161, 16,197, 50,238,212, 62,180,116, 72, 6, 3,176, 75,
-164, 74,144, 96, 19,247, 6,216,165, 50, 73,148, 18,132, 10,219,119,217,237,197, 52,171, 37, 6,221,144, 65,144,152,135,121, 40,
-216,222, 28,208,238,197, 60,115,177,207,229, 32,226,100, 39,101, 43,202,184,117,121,134, 27,246,205, 50,219,168,177, 48, 51,203,
-220,210, 34,141,169, 89, 10, 85,115,160, 59,174, 71,154,166, 36, 73, 66,220, 31, 16, 70,125, 6,253, 30, 51, 51,109,154,141, 45,
- 54,167, 27, 92, 90,221, 97,243,226, 6,247,206, 47,242,200,214, 26, 21, 55, 35, 73, 97,179, 23, 50,229, 25,179, 90,166, 52,174,
- 99,145,101, 18,105, 11,186, 89, 74, 21,153, 19,206, 64, 91, 18,105,217, 72,203,103, 47,106, 51, 43, 4,210,118,233, 7, 61, 54,
- 47, 92,224,221, 63,253, 62,254,254, 35,127,197,253,119, 30,101,187,221,103, 81,218, 72, 97, 35,138,130,222,214, 26,191,249, 59,
-191,192,207,252,218, 7,233,126,234,243, 84,139, 5,240, 11,124,225,171, 95,227,157,149, 42,187,247,217, 84, 6,166, 17,112, 24,
- 37, 27,117, 44, 8,129, 22, 78, 46,196,229,151,123,149,229,229, 69, 26,188, 50,250,217,199, 16,229,138, 41, 54, 26,245, 54, 64,
-166,205, 80, 19,111, 94, 38,142,250,168, 44,193,169, 79,163,211,148, 44, 85, 72, 39,195,153,173,179,251,247,159,227,153, 15,124,
-152, 66,179,206,192,119,184,126,118,129,203,215, 78,243,216,227, 95, 50,145, 71, 33, 70,166, 94,157,235,136,105,170, 40,250, 18,
- 71, 88,164,194, 72,228, 37,199,166,106,107,156,104,139, 41, 95,227,227, 16, 43, 77,156, 14,239,235, 25,142, 52, 83,186,200,164,
- 49, 75, 10, 53, 68, 30, 16, 41,141, 11,244,163,136,240,242, 6, 73, 63, 67,133, 6, 46,211,141, 4,189,208, 12, 16, 65,148,112,
-105,107, 23, 21,155,108,125, 38,140,202,130,206,167,245,252, 25,121,229,220, 57,214,207,159, 51,141,139, 82,211,205, 52, 73, 78,
- 5, 29, 54, 87,106,192,214,241,128,108,176,135, 93, 44,161,146, 1, 42,236, 35,221, 34, 72, 72, 7, 61,210, 48,194,118,205,101,
-185, 52,179, 72,235,210, 57, 44, 15,202,135, 78,208,218, 93,229,190,159,253, 97, 62,254,107, 31,227, 77,247,220,138, 78, 19,236,
-163,247, 83,219,247,207, 60,255,229,167,184,229,125,239,195, 46,245,176,117,200,103,158,111,113,251,225, 38,211,186,195,180,101,
-110, 20,243,243, 13,164,157,210, 10, 67,250,253, 30,119,222,127, 15,221,110, 23, 95,153, 78,111,183, 81, 34, 9, 7,184,165, 10,
- 58, 73,176,202,101, 6,123,171, 8, 89,198, 45,186, 99,215,114,238,186, 20, 82, 97,151, 43,168, 36, 67,135, 41, 94,173,201,230,
-139, 47, 83,168, 27,134,115,121,126,150,221,243, 23, 41, 47, 52, 9,251, 3, 74,245, 42,110,161, 70, 58, 24,224,150, 37, 97, 27,
-138,165, 34,254,177, 35, 84, 23,103,120,245,241,103,233,111,174,113,240,174,155,232,109,183, 73,147,152,181,111,125,139,149,227,
-135,105,206, 79,211,217,221,225,217,175, 60,200,171, 79,175,226,198, 91, 28,127,235,107,200,130, 34,131,110, 8, 66,224,121, 18,
-183, 60,139, 82, 41,131,141, 43, 68, 73,128,237,250, 44,158,184,139, 56,138, 89,184,238, 6, 44,203,226,226,183,158,198,241, 75,
- 28,186,235, 14,166, 14, 44,113,236,254,123,144,104,250,237, 14,157,221, 22,245,185, 38, 89,150, 97,123, 30,225,222,158, 1, 96,
-168, 10,153,180,169, 52,167, 41,148,171,164,237, 54,223,254,218,251,120,207, 79,254, 34, 47,125,228,247, 16,126, 13, 90, 17,239,
-255,252,167, 9, 55,159, 71,189,120, 10,237, 20,248,234, 63,125,156,110,175, 67,150, 51,122, 70,174,238, 12, 92, 75, 80, 6,202,
- 8, 42, 66, 80,194, 28,234,150,144,166,170, 85, 9,252,230, 10,182, 95, 34,220, 57, 79, 22,116, 71,210,244,176,206, 80,107,198,
- 57,226,168, 69,180,125,154, 44,236,230,230,173, 9,186, 24,227,138,182, 76,233,124,167,207,168, 95,152, 97,165,171, 30,146,153,
-212,232,128, 54,207,117,149,223,208,213,132, 73,100,120, 72,112, 85,179, 24,121,173,162, 16, 18, 50, 70,140,115,173, 53, 89,110,
- 2,203,134, 66, 94,222, 2,101,217,140, 27,201,180,201,120,139, 92,110,159, 88, 42,143, 91,231,134, 19,177,252, 55, 2, 99,254,
-218,100, 10, 44,103,194,131, 48,148,207,197, 24,137, 58, 50,167,137, 49,144,111,168, 98, 12,249, 56,195,152,152,210,250,106, 94,
-250,208, 40,168,229,168,211, 89,140,202,106,134,101,104, 26,169, 76,188, 72, 41, 51, 45,139,209,190, 58,207,176,231,239,157, 16,
- 58,135,253, 8, 84,156, 50,146, 57,254,173,108, 62,220,153,142,250,107,245, 40, 13, 49,146,206, 71,123,246,252,224,158,168,218,
- 53,167,187,152, 32, 0, 50,118,218, 15,123,191,198, 18, 77,190,226,209, 87,193, 11,196,176, 68, 36, 39,220,233, 9,117,196,157,
-191,150,202, 93,175,135, 44, 35, 91,125,133,157,103,158,229,241,135, 55,248,244,133, 14,155,177,102, 79,105, 46, 13,224,177, 71,
-118,249, 47,235, 79,241,195, 63, 91,197,233,244,137,250,109,236,218, 2,221,205,117, 50,219, 99,111,171, 69,213,243,136, 90, 45,
- 90, 23,175, 16,201, 34, 81, 47, 32, 65, 18,105,193,238,192, 98,119,179, 79,150, 9,206,172,118, 73,210,148,135, 46,118,120,165,
-155,208,116, 28,246,226,140,123,175,157,227,230, 35,251, 88,154,155,103,105,113,153,133,229,125,148, 26, 13,188,106, 21,207, 51,
- 40, 83,105,217,104,161, 73, 6, 33, 89, 28, 17, 12,122,244,219,109,122,237, 10,182, 95,192,247,125,138,174,195, 86,173,204, 75,
- 39, 87,185,167, 57,207,191,238, 94, 97,198,183,105, 7, 9,221, 56,165, 28, 90,248,126, 66,165,228, 96,101, 26,207,150,116,251,
-154,204,210, 6,180, 50,230, 53,147,101,154,173,176,199,145, 84,161,165,164,213,237, 81,235, 23,168,164, 9, 63,250,255,252, 60,
- 31,253,131, 15,242,198,219,175,167, 32, 36, 83,117, 27, 41, 37,118, 65, 82,168, 20,249,197, 31,122, 51,127,244,201, 47,242,122,
-191, 64,140,162,234, 56, 60,240,192, 3,188, 85,190,149,157,215,239,167, 26, 58,230, 96,183,204, 1,175,100,222, 22,168, 53,200,
-156,147,154, 95,230, 76, 84, 57, 67,183, 46, 65,187, 11,197, 10,194,245, 70, 62, 27,149,195,105,132,235, 17,109,111, 34,202,154,
-191,122,219,251, 40,215, 74, 56,229, 34, 5,219,161, 27, 39,244, 90, 29, 60,149,112,221,242, 10,210,245, 56,222,104, 82,184,233,
-122,254,224,185, 79, 97, 33,176,108,105, 46, 16, 82,160, 50, 65,166, 76,225,150,231, 74,108,105, 83,244,108,100,146, 17, 89, 80,
-116, 44,170,158, 71,217, 43, 82, 84,138, 29, 45,105,245, 83, 66, 11, 28, 27,226, 68, 97, 75,129, 47, 53,210,134, 32,213, 57,223,
- 3, 50,105,120,239, 90, 65, 26, 43,210, 48, 34, 11, 5,189,129,162, 31, 64,144, 64, 26,155, 65,195, 64,106, 82, 92, 41, 13,203,
- 64,154,222, 2, 71, 26, 21, 32,199, 74,225,153, 64, 11, 97,254, 71, 43,131,250, 54, 9, 90,195,146,183, 16, 88,191,253, 59,191,
-246,219,194,114,140, 99, 52,127,218,233,200, 20,132,216,158,131,237, 58, 72,171,128,229,186,132,187,121,179, 89,169,140,237, 56,
-116,182,186,180,119, 99,238,123,239,189,212,222,252, 43, 4, 15,127, 8,239,200, 27,232,190,252, 16,225,246, 54, 91, 15,126, 5,
- 93,154, 37, 9, 35,118,207,174,114,101,125,143,247,252,192,173,124,249,185, 45,110,157, 46, 97, 85,170,236,180,251,196,177,226,
-250, 67, 75,172, 28, 92,193, 45, 86, 40, 79, 79,147,244, 91, 56,165, 26,150,229, 96, 21, 10, 56,165, 26, 89, 16,225,150,202, 72,
-203,194, 43, 85, 16,150, 67,150, 4, 8, 36,118,193,199, 46, 84, 9,118,119,240,106, 37, 44,175, 76,220,238, 98, 73,137,202, 50,
-252,106,141, 52, 78,112,203, 30, 2,151,206,234, 42,221,237, 85,202,179, 13,194, 94,136, 78, 51,202,179, 83,232,252,161,184,187,
-182, 70,119,125,135,230,190, 89, 90, 87,182,105,173,175, 82, 46,149,185,253,123,223,134,237, 87,121,229,209,231, 89, 57,182, 2,
-177,195,226,202, 12,197,233,107,185,248,252, 51, 88,133, 2,171,175, 94,164, 49, 87, 37,232, 37,168, 44, 66, 10, 69,177, 57,139,
-235, 85,168, 46, 45, 83,158, 91,100,230,218, 67,132,221, 46, 90,105, 22,174, 63, 70,109,110,150,104, 16,128, 22,236, 92,184,194,
-233, 71, 31, 99,249,248,113,106, 51, 77,180,178,145,182,139,227, 90,120,133, 2,174, 95, 48,102,142,216, 92,207, 14, 31,187,153,
-215, 31, 58,194, 93,111,255, 97, 30,249,245,159, 37,138, 50,250,238, 62,190,227,183,126, 21,101, 39,120,251,111,193,154,154,166,
-181,113,133, 63,251,240,159, 16, 27,144, 20, 89, 30,181,178,181,160, 96, 9,166,132, 96, 74, 74, 42, 88,121, 54,210,198, 21, 50,
- 47, 9,147,185, 1, 41, 54,249,206,168, 99,118, 96,121,206, 89,101,195, 98,152,241, 67, 67,163,200,162, 62, 74,167,185, 52, 45,
- 70,251,100, 61,177,111, 21, 98,156, 95,159, 76,181,141, 6, 49,205,213,217,229, 17,244, 77, 92,213, 20, 38, 70, 18,242,120, 42,
- 24, 70,211,134,110,243,161,155, 78, 11, 61,226,213, 15, 39, 1, 41,100,222, 96, 38, 71,138,239, 85, 44,107, 57,177, 54,144,114,
- 36,253, 15,139, 95,134, 59,242,209,225, 55,113,190, 15,115,239,195,159,121,116, 74,235,113,204,108, 36, 85,171,137,184,159, 24,
- 99, 55,135, 40, 90, 70,188,118, 57, 62,192,196,184,198,117,248,255,211, 66,143, 86, 3,106,212,147, 35, 17,210,194, 46, 86, 81,
- 73, 56,118,210,231,223,159, 30, 81, 97,204,109, 64, 13,247,250, 8,180,206,198,239,153, 20,100, 57, 8, 10, 97,176,154, 99,249,
-155,209,251,141, 54,208, 14,105, 89, 35,167,254, 85,105,134, 73,131,220,200,136,164,242,248, 97,110,122, 27,197,238,245,168,227,
-102, 88,222, 49,132,219,140, 98,111,163,136,160,249,227, 52,103,169,223,114, 7,225,133,151,145, 8,190,250,167,127,205,103, 94,
-110,113, 57,214,108, 37, 38,115,177, 29, 42,222,118,253, 60, 55,190,254, 54,254,246,211, 79,240,191,255,250, 49,102, 85,159,172,
-183,195,250,234, 46,131,141, 77,194, 94, 72, 18,199, 88, 58, 99,175, 27,208,221,222,101,103,163, 71, 63, 81, 12,194,148, 94,183,
-199,149,141,128,179, 91,125,158, 89,235,240,212,122,192,185, 64,209,180, 45, 6,169,192,118, 37,223,115,247,245,172,236,219,199,
- 53,135, 14,179,124,248, 16,213,153, 57,202, 83,211,184,133, 42,205,185, 25,102,151,103,169, 54, 74, 72,219, 67, 99,225, 20, 10,
-216,158,131,101, 25,168,144, 37,165, 49, 51,162,208,105,140, 93, 45,177,182,213,225,136, 95,226, 82,216,195,181, 37,105,126, 25,
-174,184, 14, 66,153, 67,167, 27,105, 6, 81,194,156, 16,148, 29,155,122,209,199, 47, 23,177,107, 85,148, 87,229,155, 39,159,231,
-134, 91,239, 4,101,115,230,236, 43, 36, 81,159,162,239,227, 21, 60, 94,247,221,223,203, 23, 62,247, 0,213,178, 67,213,113,177,
-135,108,245, 56,225,218, 19,199,104,157,187,192, 11,235, 59,204,187,150,137,195, 74,201,171,167, 78,113, 34,173,211, 95, 40, 34,
- 10,158,145,251, 39, 46,187, 66,143,213, 23,200,119,252,105,130, 46,213, 80,127,243,127,144,141, 6,194,245,176,139,101,148,237,
- 34, 29, 7, 97, 91, 40, 45, 40, 46,174,208, 59,253, 10,238,194, 62,174,252,205,103,137, 43, 69,162, 52,163,110, 89, 68,105, 70,
-169,104, 83, 42, 22,232,100,138, 69, 97,227, 31,157,227,211,123, 15,211,139, 82,131,126,213, 57, 61, 78,107,146,252, 51,104, 33,
-169,149,125,106,158, 75,197,181, 71,213,205,190, 45,153, 46, 55,153,153, 93,130, 44, 99, 48, 8,217,139, 19,130,212, 68,231, 68,
-238, 24, 42,122, 46, 40, 69,154,131,155, 44, 71, 96, 91,138, 74,217, 56,235,117, 44, 72, 34, 65, 47,144,180, 3, 77, 16,107,130,
-216,168,118,230, 64, 7,199,113, 40,122, 46, 89,102,204,143,158, 20,248,210, 60,151,133, 4,199,177,177, 48,190,169, 12, 72,101,
-142,160, 21,134, 90, 39, 1, 71, 8, 92, 41,177,222,255, 27,191,248,219, 66, 90,134,174,164,149,137, 16,216,142,217,175,150,154,
-121, 76,199, 66, 88,146,160,211, 38,238,237, 33, 93,143,181,211,175, 50,125, 96,129,126, 63,229,220,183,214,241,218,207,114,242,
-193, 47, 18, 93,126,217, 84, 37,118, 59,220,242,190,247, 98,245, 46,224,215, 10,156,126,113,149,207,158, 15,241,251, 1, 42, 81,
-196,245,230,232,119, 59,140, 34,126,244, 71,223,129, 87,110,224,248, 22, 94,181, 9, 73, 64,101,126, 5,165, 83, 44,199,193, 46,
- 86, 8,219,187,120,149, 50, 78,161, 48,186,237, 59,126, 1,165, 18,195,124, 23,166, 97,200,169, 77, 19,119, 91,164, 42, 38,108,
- 13, 40,214,171,248,211,139,156,251,250,195, 52, 87,230,233,237,236,208,223,218,197, 18, 26,183, 88, 68,136,132, 52, 73,168,204,
-206,209,186,180, 74,208,238, 17,118,219, 84,107,117,132, 82,180,214, 54, 57,120,203,245,236,191,237,102,206, 61,243, 18,171,175,
-156,230,248,235,239, 32, 28, 36, 12,250,138, 44,234, 81, 46, 23,184,230,198, 19, 20, 43, 85,102, 22, 86, 72,130, 14, 94,209,194,
-182, 93,252, 82, 19,167, 88,199,118, 37, 65,123,143,120,123,141, 36, 52,173, 72,142,239, 35, 29,139, 98,173,167,112, 97, 8, 0,
- 0, 32, 0, 73, 68, 65, 84, 65,161, 94, 33,142, 34,150,142, 28, 98,233,134, 99,172,157, 62,141,214, 22,210,146,216,190,100,227,
-236,101, 16,208,111,181,241,202, 37,132,101,118,145,205,133,101, 30,251,192,175, 18,124,243, 1,206, 94,220,227,208,253,239,224,
-216,237, 11,216, 43,199,177,202,243, 36,171,223,196,146, 14,191,254,171,191, 64, 42,242, 67,201, 50,135,158,173, 48, 96, 25, 91,
- 50,141,164,110, 91, 84,133,160,108,217,184, 58,111,116, 18,134,197, 45,133, 48, 17,146,184, 99, 30,240,154, 17,176, 1,157,147,
-227,198, 96,178,177,139, 93, 79, 78,173,122,116,238, 12,255,202,148,185,221,170,220,220, 38,198, 9,101,115,112,143, 40,174, 98,
-244,176,151, 19, 92,119,131,105, 29,243,229, 39,129, 52,227, 28,253,208, 60, 37, 38,128,113,227,157,245, 48, 95, 43,135,211,229,
- 4,192, 37, 23,226,141, 75, 61,151, 20,196, 48,119, 63, 52,236,253, 91,231,126,238, 48,214,185,107,125,136,239, 50,107,107, 49,
-193,159, 31,127, 79,195,181,197,196, 45,101,204,144, 23,147,223,141,202, 31,244,250,170, 76,249,176,137,110, 24,249, 27, 87,220,
-230,165, 23,150,121, 29,220,153,163, 88,149, 37,116,184,103,222,207,225,235, 60,188, 36,169, 49,147,123,248,122,146,141,205,134,
-195,206,116,203,146,227, 4,129,190, 58,195,110, 78,222, 28, 34, 50,148, 14,244,152, 40, 55,250,186, 19, 73,135,225,101, 70,228,
-178,236, 24,176,163, 38,112,189, 19, 62, 74, 49,217, 35, 48, 94, 5,136,145, 59, 89, 18,239,109,225, 87,109,118,207,156,167,126,
-195,173,244,158,125,136, 51, 23,219,156, 26, 36,196, 26, 86, 7,138,223,125,215, 61,252,220, 47,254, 4,181,233,121,110,190,251,
- 53,188,230,190,187,121,228,233,115,124,229,225, 83, 68,237,144,118, 59,164,191, 23,176,111,169,102,202, 88,178,140,238,238,128,
-193,222, 0, 59,131,146,128, 44,206,144, 90,178,177, 51,192, 65,208,142, 51,227,113,145,176, 23,165,188,237,142,107, 56,122,237,
- 10,251, 87,174,101,113,229, 26,106,179,243, 20,155, 77,188, 74,157,185,253,211,124,238,243,103,248,143,191,247, 34,207,159, 47,
- 34, 6,125,238,126,221, 10,189, 94,130,109,155, 67, 70, 10,200,210,108, 20,221,203,146,132,120, 16,144, 22,124,218,107,123, 32,
- 5, 59, 81,200,116,209, 37, 78, 83,202,182, 77, 16,165,163,207, 83, 18, 39,148, 21,212, 29,155,122,177, 64,161, 81, 69,150,203,
-196,118,129, 39,206,191,194,177, 99, 55, 98,251, 37, 94,126,254, 5, 6,131, 14,181, 74, 25,223, 47,160, 84,202,107,223,250,118,
-158,126,252, 41,210,193, 30,115,205, 6, 90,155,202,220,176,219,229,245,111,127, 11,159,254,199,127, 49,180, 73, 91, 82, 16,146,
- 29,165,121,225,149, 87,184, 46,112,240, 60,143,120,190,136, 37,205, 37, 99, 24,137, 28, 70, 80, 81,166, 22, 91, 23, 74,232, 7,
- 63,143,104,237,129,239, 99,121, 5,172, 82,133, 76, 72, 44,219, 54,205,156, 8,252,198, 60,189,243,167,112, 15, 30,229,235,127,
-250,231, 20,202, 46,190,208, 12,178, 20,169, 96,177, 92,193,206, 52, 43,169,228,142, 15,255, 15, 62,243,212, 95,146,196,218, 76,
-206,185,123, 51, 82,138, 68,235,145,105,214,177, 36, 85,215,102,218,119,168, 22,124,124,203, 2,101, 98,189,245, 98, 1, 59,139,
-233, 15,250,116,194,132,189, 48, 37,206,212, 8, 82,227, 57, 54,174,237, 16, 70, 9, 41, 26,219, 54,171, 53,199, 23, 20,220, 60,
-138, 20,155, 42,213,118, 79, 27,198, 64,170, 71, 10, 84,152,239, 64,155,229, 18, 69,215, 35, 8, 34, 44,204, 97,238,143, 34,180,
- 54,182,235,208,207,155, 18,135, 9,153,100, 72,225,205,237, 11, 14, 2, 87, 88, 88,239,255,205, 95,250,237, 44, 26, 96, 21, 74,
-102, 39,150, 4, 6,173, 87,240,137, 59,123,100, 73, 64,212,109, 19,180,118,113, 92,135, 66, 99,154,213,231,190,197,190, 99, 71,
- 80, 74, 96,219, 80,155,219,207,246, 70,204, 64, 84,177,183, 95,228,236,115,231,232, 81,166, 32, 52, 86,121,138,176, 53,224,145,
- 39, 46,115,172,104,241,244,118,132, 55, 61,205, 94,167, 71,173,232, 18,102,154,155,143,236,227,198, 59,111,163, 80, 41, 81,158,
- 89, 64,232,140,202,226, 62,178, 52, 69, 8,133, 83, 40, 99, 57, 30, 58,202,112,170,101,242,132,246,104, 18, 83,113,136,223,156,
- 53,149,133,221, 61, 86,159,125, 18, 21,133, 88, 50, 99,234,198,155, 81, 97,200,149,103, 95,160, 62,215, 36,232, 4,144, 12,168,
- 46,204,225, 22,171,212,246,237, 39, 9,193,150, 54, 27,167, 95,102,250,208, 33,118, 46,110,224,184,130, 65,208, 65,219, 54,142,
-237, 50,117,205, 1, 54, 78,158,195,182, 5,243, 7, 15,243,202, 55, 31,199,241,108,108, 87, 83,155,159,193,169,212,233,236, 5,
-132,131, 62, 41, 80,170,206, 16,116, 59,164, 97, 23,171, 80,102,250,218,131,244,215,215,192,177,240,106,211,184,165, 2,213,233,
- 69,146, 56, 36,234, 7, 88,158, 67,101,106,138,114,189, 74,208,235,112,241, 27,207,113,224,206, 91,104,111,110,225, 20,125,250,
- 59,187, 84,154, 83,168, 44,163,220,108,144, 69, 9,142,107,161,180,133,101,105,162,141, 11,124,226, 51,223,224,190,183,191,133,
-197,107,160,242,198,159, 64,122, 21,146,206, 11, 88, 86,133, 63,255,227,247,179,186,189, 67, 42, 76,237,170,204,165, 93, 71, 8,
-106, 82, 50, 37, 5, 77,219,166, 44, 5, 37,203,194,149,134, 66,101,137, 97,235,152, 28, 73,236,140, 8,116,114, 60,145, 78, 72,
-234, 67, 23,230,164, 11,126, 2, 36, 55,246,142,141,176,173, 19, 69,103,140,255,203,232,128,158, 96,181,203,225,196,110, 89, 57,
-207, 89,140,158, 19,163,129, 58,159,162,173,188,187,154, 28, 42, 99,184,230, 98,244,192, 31, 30, 46,150, 61, 38,161,141, 90,219,
- 70,113,182,201,137,126, 2, 40, 35,204,207, 41,175,162,159,137,171,212,129,209, 58, 98, 52, 60,231,187,123,235,106,150,174, 30,
- 65,235, 39,242,251,114,108,180,211,136, 17,179,131,188, 88,102, 4,120,203, 21,134,177,124, 63,254,250, 66,202,171, 74,102,204,
-206, 29,132, 93,130,164,135, 10,118,199,253,242, 35,236,171, 24, 25,226,132, 37, 71,230, 62,105,203, 9,182,192,132,218,144,199,
- 5, 5, 99, 0,205, 88,185,144,232, 44,127,120,139, 49, 60,102,136, 3, 21, 67,138,215,100,155,223, 36,142, 23,113,149,201,106,
-120, 97, 48, 49,124, 61,193,146, 23, 87,173,117,134,255,254,225, 71,172,127,242, 21,138, 69, 23, 89,107,208,152, 74,185,240,248,
- 73,158,107, 69,236, 4, 25,191,244,131,247,242,203,191,251,235, 68,177,198, 47,213,241, 43,117,108,183,200,107,223,120, 47, 55,
- 28,191,150,226,229,151,184,249,216, 12,199,239, 60,202,129,227,203,148,188,148,154, 29, 83, 47, 73,230,106, 22,149,220, 61,189,
-111,190,194, 92,205,165, 34, 4, 85,105, 26, 13,215,195,148, 48, 51, 27,134,239,188,247, 56,251,151,246, 51,181,176, 64,115,105,
- 31,165,122, 19,219, 47,177,239,224, 18,223,249, 19, 15,177,112,203,221,252,192,119,220,200,187,126,232, 24,127,241,245, 46,255,
-240,169, 23,120,247,143, 92,207,160, 23,154,181,143,210,100,105, 76,154, 42,146, 56, 34, 73, 82,146, 36, 38, 9, 66,172, 90,157,
-210,110,143,245, 44, 4,165,153,175,120, 20,124, 7, 33, 52,165,130, 79,119, 16,162, 99,133,175,160,233, 88,148, 92, 7,191, 84,
-192, 42, 86,112,106, 13, 30,122,249, 5, 14,236, 95,166,210,156, 97,245,210, 37, 86, 55, 46, 83,112, 44,138,190, 71,161, 84, 34,
-142, 34, 78,220,123, 31,187,177,226,220,179, 79,177,111,118,198,172,129, 92,135,176,211,225,221,239,253, 33, 62,250,153, 47, 81,
- 68,225, 89,146, 4, 8,133,195, 75,231,206,210, 62,121,145, 67,161,143, 93, 43,145,212,139, 40,161, 16, 89, 78,233,203, 20,110,
-181,142, 44,248,196, 95,251, 26,242,217,231, 16,165, 26, 20, 60,236, 98,209, 0,195, 44,137,116,236, 17, 17,209,241, 75,244, 46,
-156,193,159, 95,225, 11, 31,254, 75, 18, 32,214, 25,237, 32,166, 31, 71, 68,113,194,205, 55,221,200,107, 62,250, 97, 78, 5, 87,
-120,230,209, 47, 19,101, 70, 61,180, 44, 73,148,154, 10,213, 40,205, 35, 99, 66, 82,242, 44,166,138, 30, 11, 37,159,170,227, 80,
-118, 92,124,203,198,150,146,146,109, 33,226,132, 56, 78,217, 14, 98,118,131,136, 40, 85, 72,219, 39,206,160, 31,198, 4,113, 66,
-152, 41,178, 33,250, 90, 8, 28,199, 12, 42, 58,129,116, 32,105, 15, 20,189, 88, 19,132, 57, 31, 35,197,124, 15, 57, 49,210, 76,
-244, 9, 74,101, 70,210, 23, 96, 73, 77,164, 5,177, 82, 36, 42, 35,201, 49,181, 82,152,202,236, 88,129,146, 99, 78,133, 35, 36,
-101,199,194,214, 42,195,242, 43,100, 65, 7,233,186, 88,126,201, 76, 25,202, 76, 36,221,181, 43,148, 26, 83, 88, 69, 15, 97, 57,
-196,253, 30,251,111,189,157,112,111,151,213,211,103, 57,116,247,173,244,183,123,132,231, 47,210,143,225,228,165, 57,110, 62,177,
-204, 35, 15,124,129, 96,163,197,197,213, 14,219, 3,193,169,150,102,126,102,138,165,154,164,219,143,152,170,248,248,174, 77,205,
-119,184,227,238,219,113,107, 21, 10,229, 58,126,125, 10,199,177, 77,245, 30, 25,150,231, 33,165, 75, 18, 15,240,103,102,140, 76,
- 72,140,229, 21,201,194, 30,110,165,137,229, 87, 8,247,118, 81,153, 98,176,181,205,202,205,183, 27,252,159, 87,226,252, 87,190,
-204,226,137,155,208, 73, 31,167, 84,167, 82,109, 32,132,131,214,154,126,186,203,246,217,115, 8, 33, 89,125,249, 12, 71,239,187,
-157,221, 75,155,172,157,185,192,212,156, 13,194, 37,234,238, 49,184,178,201,161,123,111,161,208,168,162,132, 77,103,175,205,161,
- 59,238,164,181,182,129, 86, 1,189,110,159,160,183, 75, 99,102,154, 44,117, 80,105, 66, 24,246, 40, 53,151,144,150, 77, 26,245,
-217, 57,245, 18,197, 70,141,222,214, 58,193,206, 6, 73,177, 65,210,218,163,121,195,113, 28,191, 0, 90,241,248, 39,255,142, 82,
- 99,138, 82,189,202,242,107,110,227,149,175, 61,204,129, 91,111,229,242, 75, 47,115,240,246,155, 9, 58, 3, 42, 83, 77,218, 91,
- 91, 84,155, 13,227,232,182, 83,116,166, 57,248,227,255, 47,203,127,248, 97,102, 22, 37,205,119,254,127,232, 96,139,157, 71,254,
- 28,213, 78,248,179, 79,125,142,173,214, 54, 73,238,240,214,218,212,121, 75,192,145,134,114,100, 99, 50,234,174, 16,216,194, 48,
-156,229,100, 85,169, 52, 15,224, 97,236, 74, 78, 72,159,198,245,153,203,203, 19,112,239, 49, 80,110, 28,115,146,195,226, 20, 61,
-161,163,107, 38,204,115,249,180, 47,115,185, 86,101,227,105,108,130,209,110, 21,124,172, 98, 13,111,122,142,242,177,219,177,171,
- 13,188,185,125, 72,199, 99,112,233, 52,253,147,207, 16,173, 95, 34,219,221, 32, 13,251, 99,142,187, 99, 27,134,183, 26,246,170,
-155,134, 40, 33,228, 85,212, 58,149,154, 73,116,184, 50, 96, 66, 49, 24, 85,132, 90,121, 22,126, 88,249, 34, 38, 32, 53,249,164,
- 41,135,166,175,161,100,142,206, 39,233, 9,127, 65,254,191,139,188,142,110,216, 76, 54,220,219,139, 9,179,217,144,109,143, 53,
-142,112, 11,105, 12,139,195,237,250, 8,194, 35, 84,190,107, 27, 82,239, 50, 4,146,116,239,188,233,132,215, 99, 87, 59,202,236,
- 25,181, 54,230,186,225,207, 32,212,144, 13,111,141,100,121,133, 54,134,201,202, 28, 42,238,160,226,192,212,172,146,229, 20, 63,
-157,151,248,100, 38,254,150,141,107,218, 38,248, 53,249,171,161,198,171,152,188,132,103, 8,145, 25, 94, 94, 64,143,118,242, 67,
-137, 95, 77, 24, 33,135, 81,128,177,106, 33,198, 18,188, 48, 92,250, 96,125,141,185,155,222, 64,124,246,171, 8,105, 26,231,246,
- 77, 85,248,221,191,254, 8, 27, 39, 79, 81,108,204,162,148,196, 70,226,186,187,252,218, 31, 63,141, 85, 63,206, 47, 28, 94,225,
-134,183,221,138, 40,151, 8, 46,156, 66,167,109,186,219, 45,194,126,198,234,165, 62, 8, 73,146,251, 28,164,237,178,116, 77, 19,
-107,173, 7,190, 71,217,247,248,234,122,155, 78, 6,113,172,168,206, 77, 83,153,155,199,111, 52,112,170, 53,188,122,131, 87, 78,
-247,137,166, 14,146,158,127,128,183,189,231, 23,168, 87,102,120,250,212, 75,252,230, 7,215,121,240,211,143,113,231, 27,111,160,
-175, 53,110, 92,196, 45,148,113,156, 62,174,237, 98,219, 22,182,235,226,251, 46, 90,165,180, 44,135,253,110,153, 64, 12, 40, 90,
- 30,113,152,129,212,116, 6,177,185, 88,164, 25, 33,146,190,210,196,121, 91, 26,105,138, 4,162, 48, 34, 78, 2,148,202, 88,152,
- 94,226,201,231,158,160,221, 27,208,233,180,113,253, 2,181, 89,151,254,222, 54,135, 78,220, 76,239,208, 17, 86, 31,253, 34, 11,
-115,139,200, 36, 4,199,103,243,220,171,124,244, 35, 31,224,143, 62,240, 63,120,249,212, 69,102,171, 37, 44,173, 73, 28,159,245,
-189, 54,127,246,137, 79,115,205, 23, 27,220,116,253, 81, 22,239, 60,142, 62,186,140,108,214,136,211,136,175,255,215, 63,224,235,
- 15, 62,195,111,254,248, 91,200, 42, 53,132, 43,145, 74, 32, 44,199, 88,216,180,147,127,222,141,199, 35,222,221, 70, 58, 54,165,
- 70,131,223,250,252,223,115,230, 99,127,197,110,171, 69,169, 82,102,106,121, 63,229,230, 52,229,125, 11,176,127,153,191,251,157,
- 31,164, 27,165, 88,210,194,150, 38,110,150, 14,125, 54,249,239,172,196, 16, 53,125, 75, 26, 34,155,109, 83,116, 29, 74,150, 38,
-201, 50, 60,199, 70, 73, 69, 63, 54,159,169, 76, 11, 82,173, 9,163,144, 94,152,152, 4, 74,106,250,209, 73, 20, 41,224, 88, 26,
- 39,134, 1, 18, 39, 3, 18, 8, 83, 65,185, 88, 37,205, 2,194, 48, 52,149,224, 35,150,188, 34,142, 35,108, 9,110,222,141, 30,
-229,151,249, 36, 47,185, 74,148,194,205, 73,117, 38,154,104, 68,128, 97,216, 71,106, 3,185,241,132,192, 22,110, 25,157,132, 88,
-213,105,116,154, 17,119,182,201,210,216,236,108, 28,143,198,242, 65, 44,199,163,115,249, 60,138,144, 98,189,206,246,171,103, 76,
-219, 80,255, 10,110,241,141,188,240,252,195, 36,131, 14,199,110,187,141, 27,239,184,157, 23,159,124,158,180,121,144, 45,183, 64,
-227, 90, 69,213,114, 40,174,111,177,214,234, 34,201,184,118,186,130,237,120, 20, 10, 14,126,193,227,200,237,183, 35, 61,135, 66,
- 99, 6,149, 13,160,208,196,171,214,209,137, 2, 71,160,194, 24,215, 47, 24, 44, 97,148,228, 15,175, 20,183, 62, 75, 58,232,162,
-146, 20, 41, 5,131,237, 61,234,251,151, 16,149, 26,131,115, 23, 73,122, 23, 57,240,186,251, 57,245,207, 95,100,255,109,199,113,
-138, 21, 58, 87,214,232,236,110, 82,105,206,146,244, 3, 44,219,198,107, 52,105,206,245, 64, 11, 54,207,175, 51,183, 52,197,226,
-177,131,188,252,208,147,172,220,184,159,198,189,247,146, 12,224,149, 71,159, 65,235, 14,142,231,209,217, 9,232,237, 92, 97,223,
-161,131,212,166,102,169,148, 61,164,128, 80,151,120,233, 95,254,137, 82, 83, 35,132,135,112, 28,108,223,165, 58,181,136,112, 11,
- 76,223,112, 27,126,189, 78,119,117, 21,167, 88,129, 36,161,187,189, 71,156,198, 92,119,255,253, 20,234, 85, 30,255,212, 39, 88,
- 59,247, 42,199,223,240, 29, 92,124,241, 69,246,221,112,140, 51, 79, 62,195,193, 59,110,165,223,233, 82,108, 54, 25,116,187,248,
-149, 50,150,101,163,165,192,183,109,190,251,119,127,153,194,177, 59,105, 63,253,113, 8, 35,178,160,202,255,252,228,255,166,219,
-217, 38, 27,230,174,179,220,219, 38,133,201, 86,106,193, 68, 61, 54,182, 48, 76,119,169, 20, 82,218, 19,135,179,190,202,189, 62,
- 54,114,141,161, 95,150, 87, 66,197,253, 9, 74,249,216,185,109, 74, 99,198,173, 97, 66,140,161, 34,210, 54,117,149,195, 9, 81,
- 90, 22,118,125, 6,171, 84,196,155,221,143, 59,181,128, 55, 53,139, 59,183, 76,233,186, 19,248,243,203,216,229,170,249, 97, 76,
-213,219, 48,223, 6, 2,166,120, 67,190,176, 50, 25,147, 36,136,136, 86, 47,177,251,208,231,216,125,248,243,164,237,173,145,201,
- 18, 38, 46, 24,122, 88, 65,171,243, 82, 6, 61, 74,228,128,200,205,101,185, 98,192, 24,228, 98, 14,157,252, 23,123, 66, 98, 54,
- 80,150,137,104,158,154,184,233,104,125, 85, 41,141,152,236, 52,151, 19,109,102,195,111,112,178,210, 85, 12, 75,114,196,200,105,
- 43, 25,187,203,199, 57,118, 49, 81, 80, 51, 94, 19, 24, 63,192,132,169, 77,233, 9,222, 59,163, 55,116, 88, 28, 99,184,254, 19,
- 76,118, 13,194, 41, 99, 87, 23,136,119, 99, 80,131,156, 29, 63,198,184,106,161, 12, 11, 60,159,224,149,210,227, 11,136,154,200,
-208,231, 74,129, 82,106,244,207,196, 8,187,155,211,239,242,150,174,255,139, 29, 63,250, 62,175,222,217,142,243,133, 67,206,189,
-133, 59, 87, 39,217,184, 72, 32,230,216,215, 44, 50, 27,236,241, 15, 47,126,145,238,230, 38,126,185,142, 86,198, 57,122,246,197,
-243,188,255, 51,125,222,126,255, 61,216, 69,201,210,160,130, 53,127, 24,221, 95,163,119,241, 50, 73, 63,162,183,218,103,115, 45,
- 32, 72, 53,169,176,217,222,139,113, 54, 67, 22, 14, 52,112, 60,143,185,165, 41,170,245,140,242,118,151,138,103,241,196, 70,143,
-175,126,254, 81,138, 39,183, 88, 40,121,200, 12, 92,199,197,241, 11, 36,190,207,125,131, 2,143,127,249, 52, 63,118,231,113, 62,
-253,248, 11,124,229,203, 95,227,248,173,119,176,214,122, 24,175,218, 32,232, 5,200,156, 47,110, 73,129,176, 13,193, 80, 72,137,
-229, 88,164,105,159,226,190,105,156,243,171,180, 52,108, 12, 34, 74,182,249, 29, 12,226,140, 72,231,201, 17, 9,177, 82, 38,214,
- 21,133, 16,135,184,105,194,177,107,174, 97,245,210, 69,174,127,205, 27,153, 89, 88, 32, 19, 16,164, 9,123,221, 14,213,106,153,
-160,221, 50,107, 49, 75, 82,244, 60,156,239,254, 49,182,191,240, 9,166, 27, 83, 56,169,194,118, 28,214, 79,189,196,127,250,143,
-239,230,139,159,251, 50,127,245,165,199, 56,210, 40, 83, 20,208, 78, 5,243,149, 34,253, 56,224,129, 71,159,160,241,232, 19,164,
- 65, 76, 31,232, 0, 33,240,147,223,117, 55,118,115, 26,157, 68,134, 33,239,251, 72,219, 38, 75, 53,218,181,242,196, 71,138,237,
-149, 72,130, 14,210,117,232,189,252, 28,181,215,189,141, 67,175,158,100,237,197,151, 17,174,109, 94, 23,203,194,159, 95, 96,163,
-179, 65,107, 16, 96,185, 21, 42,181, 25,162,222, 38,105,210, 39,201, 76,125,170, 49,108,154, 9,215,206,125, 34,113,222,118,232,
- 9, 11,219,151, 57, 59, 2, 34, 29,227, 90,150,201,254, 11,179, 46, 12,162,212, 60,125,180,194,119, 11, 52,170, 21,182,246,118,
- 9,147, 4,165,192,181, 36,105,100,224, 54, 82,131, 37, 92, 74,126,133,221,189, 1,105,206, 20, 25,154, 87,173, 33, 48, 82,152,
- 46,119, 5, 68, 10,243,125, 10,176, 20,184,150,105,189, 36, 71,195,107,105, 8,149, 50, 87,236, 44, 76,114,201,149,121, 25, 12,
-210, 34,235,238, 16,118,246, 40,206, 44,146,109, 95,161,184,120, 16, 29,244, 9, 90,155, 12, 86, 47,209,220,127, 13, 42,142,136,
- 6,125,108,199, 38,106, 13,184,243,221, 63,199,233,175,126,137,195, 55,157,160, 60,187,192, 75, 95,123, 4,207,179, 57,127,230,
- 28,175,127,253,237, 60,246,205, 39, 89, 56,188,159,147, 47, 95, 34,138, 19, 28,173,120,211, 61,183,113,126,117, 11,219,177,200,
-178,152,163, 55, 30,197,171,148,241,234, 83,168, 48,160,216,156,193,114,124,210,104,128,215, 88, 32,238,108,226, 84,234, 70,214,
-176,108,164,239, 16,182,182,240,171, 83, 6, 5,232, 21, 32,235,163,177,241,138, 69,220,153,101,210,246, 14,197,169, 6,122,170,
-193,185,135, 30, 98,233,198, 99, 88,210,225,212, 87, 31,194, 41,216,204, 93,187, 15, 45, 28, 46,189,248, 44,251,174,191,142,184,
-215,197,171,149,105,173,111,225,217, 22,139, 71,143,242,236, 87,190,193,183,125,223, 91,232,172,181, 89,127,229, 85, 18, 37, 89,
- 90, 90,196, 41, 45, 51,232,182,144, 42,101,121,101,129,185,163, 7, 57,247,252, 75, 44,221,120, 19,173,181,109,202, 21,135, 55,
-252,135,159, 97,247,213,231,136,130, 61, 44,207,197,178,109,226, 20,236, 82, 17, 97,219,196,221, 62, 89,150,210, 58,247, 10,243,
- 71,142,179,114,199,225,252, 16,201,216,189,116,133,123,222,251,227, 68,131, 1, 89, 24,113,228,238,111,163,179,179,199,210, 13,
- 71,233,181,218, 20,170, 53, 44,169,209,126,193, 20,216,104, 65, 26,132,120, 37,159,226,205,119, 18,159,250, 6,193,238, 26,181,
-187,127,144, 15,254,254,143, 33,195,128, 76, 10,132,101,136, 71, 89, 62,113, 26,239, 83,142, 72,196, 72,237,182, 28, 17,154, 71,
-156,112, 67, 80,203,109,150, 67, 51, 23, 99, 63,210,240, 28, 40, 44, 28,167,114,236, 38, 90,207,127,133,120,253,202, 24, 17, 59,
-220,140,170,241, 67, 89,144, 31,228,105,134, 64, 99, 23, 74, 76,189,241,157, 76,221,251, 86, 74, 71,175,199, 46, 54, 16, 34, 5,
- 29, 95,181,139, 55,185,171, 20, 21, 13, 80,123,189,252,240, 48, 11, 37,145, 35,219,180, 54,225,123,157,154,130,148,168, 59, 32,
-137, 83, 44,191, 72,243, 45, 63,194,220, 59,222,135, 44,148,217,248,236,255, 98,253,179,127, 62,150,247,135, 23,148, 33,139, 37,
-151,158,135, 45,118, 6,124,146, 31,228,154,188, 1, 78,142, 50,209,114,248,179, 9, 3,118, 17, 35,211,215,248, 92,214,232, 81,
- 52, 14,105, 25, 71,253, 40,122,173,199,134,238,188,126, 84, 58,121,169,204,112,228, 31,154,202,165,145,220,135,204,245, 17, 19,
- 94, 48,230,167, 51,110, 61, 19, 82,130, 53, 62,228, 71, 63,203,232,114, 54,169, 93, 15,213,139, 33,230, 90,142, 46, 26,228,180,
- 53, 33, 64, 37, 3,162,141,211,160, 34, 99,152, 28,102,221,135,147, 75, 94, 18,163,242, 94,116, 41,134, 19,127, 94, 30,147, 95,
- 84,192,152,222,132, 37, 39,204, 83, 19,126, 3, 49,222,209,143,217,219,121,181,174,148,230,114, 38,255, 77, 53, 32, 19,166,140,
- 97,107, 93, 40, 80,131, 54, 89, 97,134,163, 55, 76,243,158,218, 60,165,197, 35, 12,182,174, 32,181, 32,205,160, 54,211,224,109,
-255,238, 9,126,249, 7,106,252,236,111,255, 20, 63, 80,105,243,190,143,253, 39, 82,233,210,122,233,121,130,173, 14,209, 78,140,
- 95,240,176, 85,128,159,192,197,221, 62, 47,183, 98,106, 69,135,230,194, 2,210, 17,108, 95,218,102, 99,183, 79,165,224,113, 96,
-166,196,226, 84,145,245, 86,159, 43,221,117,206,119, 44,250, 9,220,208,172,113,235,220, 33,230,103,102,185, 17, 65,225,214,251,
-208, 74,240,254, 59, 94,199,218, 71,255,132,195, 90, 33, 45,151,127,125,224,175,169,222,125, 11,206,177,107, 80,158, 71,226,228,
-141,123,113,146,215, 28,107, 28,203, 6, 7, 92,203,161, 42,108, 28,161, 89,235,197,148, 93, 7, 87, 66,106, 65, 81, 72, 82,173,
- 73,149,166,159,101, 12,186, 17,165, 48, 36,236,237,114,255,241, 59,248,212, 55,191,140, 37, 5,245,153, 38, 39,142, 29,227,202,
-197,243,148,125,151,237,214, 14,142, 95,192,143,139,168, 82, 1,165, 51,210,126,155,210,119,190,139,221, 7, 62, 78,179, 92, 67,
-164, 14,150,231,177,187,126,153,251,222,116, 55,119,223,115, 27,191,243,193,143,114,170, 61,224,230,169, 10, 61, 45,137, 51, 69,
-106, 59, 8,169,185,235,219,110,228,139, 15, 63,205,116,169,200,247,188,237, 62, 22, 87,150, 72,162, 0,167, 90, 6,215, 50, 0,
- 32,219, 1,225,230,207,125, 43,255,168, 72,210, 65,128,148,146,184,211,129, 74, 25,103,118, 26,231, 66, 9, 81,240,113, 42,101,
- 42,203,251,176,111,186,137, 15,253,252,155, 9, 83, 77,181,232,129, 80, 36, 73, 68,152,170,209,129,106,196, 46,243,252,179,164,
- 32,136, 50, 2,215, 68,202,164, 4,207,118,176,133, 67,150,197, 40, 97, 14,244,162,237,224, 88,210,192,183,108,129,157,106, 18,
- 5, 37,207, 65, 43, 77,146,100,230,235, 74, 65, 22,155,242, 28, 43, 53,112,156, 36,138, 89,223,218, 32,136, 98,226,156,175,161,
- 39, 38,109,165,135, 81, 54,147, 6,210,194, 32,191,237,137,178,168, 52,111,207, 12, 51, 67,142,211, 35,211,161,153,210,101,126,
-176,219, 89, 48, 64,186, 14, 96, 81,154,154,165,183,122,158,210,210,126,218, 23,206,208,190,244, 42,139,215,159, 64, 54,155,108,
-159,127,149,168,189, 67,109,113, 63,169,210, 20,166,170,116, 55,214, 89,188,254,102,122, 59,219,156,125,230, 89, 26,115,117,206,
- 61,119,146, 91,238,190,133,213,139,107, 28,188,118, 31,245,217, 37, 42,231,247, 32,147,220,116,253, 1,206,110,172,177,111,126,
-154,205,237, 62, 85,207,231,166,239,120, 19, 86,161,140, 91,170, 98, 53,103, 80, 74, 99,249, 5, 44, 52, 73,167,133,180,108,178,
-168,143, 93,110,130, 74, 8,219,219, 56,149, 10, 72,155,214,169,231,168,237, 91,161,183,187,134,101,121, 84,150, 87, 72,218,219,
-156,127,242, 81, 42,205, 41,122, 91, 91,236,191,249, 56, 94,101,138, 51,143, 60, 70,125,170,201,204,117,215,128, 93,226,137, 79,
-126,142,235,238, 57, 70, 18, 68,196,225, 46,210,171,144, 69, 49,149,133, 6, 59,107,187, 28,186,229, 24,216, 54, 81, 52,160,185,
-255, 16,113, 18,144, 70, 49,253,118, 66,175,181,137,180, 99,234,251, 87,120,242,159, 31,166, 49,227,242,244, 23,254, 9,187,228,
- 35, 16, 52,231,150, 40, 54,150,169, 52,150,185,248,210,163, 56, 5,135, 66,165,129,235, 85,136, 58, 29,220, 82,137,169, 67, 71,
- 40,207,207,115,242,171, 95,102,251,236,181,212,151,247,161,194,152,250,202, 62,178, 52,163, 80, 42,146,120, 30, 47,125,245,235,
- 76,173,172, 48,208, 25, 94,177,200,238,229, 43,212,230,102,145, 5,223, 76,215, 42,197,171,148,208, 89, 74,229,232,189,156,126,
-236, 95,169,220,255,179,252,202,143,223, 71,217, 30,230,172,117,190,127, 49,123, 28, 75,230,196,198,212, 48,131, 11, 57,254,213,
-202,121,206,214,196,196,165,134,128,153,201, 93,171, 26,231,150,205, 65,230, 96, 23,235, 56,245,121,132,182,242,157,114,190, 11,
-150,218,100,144,243, 3,102,216,209,109, 21,202, 76,191,225,123, 89,126,239,127,198,169, 55, 65,245, 77,145,134, 86,136,116, 55,
- 47, 78,183, 25, 85,175,169, 20,146,132, 44,138, 80, 73, 66, 50, 8,200,146, 20,157,101,249,164,102, 33,164,129,217, 27,254,116,
-136,202,210, 60, 43,110, 99,107,135,104,144,128,236,161,213, 54, 83,239,248, 15,204,127,223, 79,241,236,187,239,200,167,243, 9,
-163,219,208,121, 61,140,197,101,122,180,167, 23,185,188,109, 24,171, 58,175, 40,205,247,186, 74,140, 90,170,212, 68,198,126, 20,
- 33, 19, 98, 20, 83,211,169,154,112,115,231,191,184, 74, 95, 21, 75, 83,153,249, 62,172, 97, 76,107,184,143,103, 12,221, 49,189,
-228,150,137, 5,145, 23,172, 40, 19,191, 19,142,217,231, 26,151,184,206, 73,140,122, 36,199, 15,191,158,161,203,137, 81,197,170,
- 30, 26, 14,149, 50,149,167,195,226, 22,244,136,224, 38,116,140,206, 18, 19,152,201, 17,187, 6,131,171, 70,149,174,134, 86, 39,
-242,140,186, 24,209,255,180,206,167,142,201, 13, 76,166,175, 54, 4,202, 9,190,126,166, 48, 27, 80, 61,230,233, 15, 99,108,250,
- 42,204,224, 24,212, 59, 44,177, 65, 35, 11, 21,154,223,243,211,200, 82,137, 76, 59, 92,190,210,227,135,254,248,163,132,123,107,
-196, 58, 37,222,235,163,131,152,189,127,248, 60,159,186,225, 10,197, 39,182,120,224,206,253,124,219, 15,191,150,116,250, 48,173,
-199,255,133,237,231,206,176,115,170, 77,173,225,210,109,117,233,117, 98, 46,238, 37,124,107, 59,164, 86,242, 56, 48, 87, 97,230,
-218, 37,194,214, 14,155, 91,125,206,182, 6, 12,146, 62, 71,166,139, 52,202, 30,199,246, 55,185,209,181, 73,146,140, 51, 87, 90,
-144,181,249,199,167,190,201, 32,214, 28,157,174, 33,180,195,173, 71, 15,226,123, 69,202, 71, 14,144,102, 26,169, 52, 78, 63, 96,
-239,203,143,208,251,196, 63,163,164,166, 95,116,105, 45,212,232,215,125,118,163, 62, 36,230,243,223, 15, 35, 44,207,102,133, 50,
- 47, 7, 45,124, 33, 17,150, 77, 39, 78, 64,105, 74,185, 32, 19, 8, 77,172, 20,253, 56,161,210,110, 83, 40,149, 56,184,255, 8,
- 49,130,168,215,193, 45, 10,110, 58,126, 23, 47,191,242, 18,181,160, 68, 16,198,116,247, 90, 20,138, 62,126, 92, 36,179,108,211,
-106,215,235, 80,248,206,119,209,250,210, 39,153,118,235,232, 52,195,114, 37,253,110, 23,203,178,249,131, 15,252, 10,171,103, 47,
-242,167, 31,251, 7,182,183,219,212,242,251,242,134,148, 60,249,236, 73,126,234,231,222, 75,117,118,150,176,189, 71, 36, 4,110,
-185,132,112, 29,243,112,178, 29,147,116, 44, 56,166,197, 80,106,195,131, 79, 35, 84,100, 84,161,164,187, 3, 59, 27,216, 11, 75,
- 56,165,151, 16,197, 50, 94,181,129,187,176, 72, 80, 44,176,185,181,141, 18,154,118,183, 69, 26,236, 97, 9, 99,142, 75,242,223,
-107,203, 54,209, 58, 91, 8, 35,201, 59, 30, 89,170, 70, 23,111, 71,216, 8,105,126, 86, 71, 74,124, 97, 81,114,108, 42,142,197,
-174,144,216, 90,140, 46,148,189,126,159, 84,245,208, 90, 99, 11,137,163,193,209,130,178,180, 40, 74,129,163, 37,142, 11,123, 97,
- 58,242,129,196,106, 2, 1,109,153,153,201, 32, 32, 12,190, 89,105,176,109, 49, 4, 60, 18,100,195,120,174, 38, 19,210,176, 69,
-242,223, 21,215, 38, 55, 24, 11,124, 91, 96,171,184,135,116,234, 72,207, 39,139, 6,120,181, 41,200, 20,142,101,177,120,227,109,
-196,189, 61,138,139,135, 9,182,118, 41, 45, 31, 36, 9,251, 20, 74, 21,130,189,132, 44, 25,176,183,211, 39,106,109, 50,232,172,
-163,212, 20,123,219, 87,168, 79, 31,197,241, 93,102, 23,230, 25,116, 82, 42,205, 26, 51, 11, 85,188, 66,149, 90, 99,134, 84, 43,
-150, 92,159,133,107, 86,240,107, 83,184,149, 6,105, 20, 34,165,133,180, 52,194,175, 17,111, 95,196,109, 46,229, 57, 86, 7, 21,
-247,145,182,141, 87,109, 34,252, 18, 89,111,143,250,129, 67,108,190,244, 34, 83, 7, 86,232,172,158, 5,181,159, 75,143, 63,206,
-129, 91, 78, 16,135, 1,179,135,142, 16,246,218, 92,124,234, 9, 28, 55,197,169, 54,136,162, 4,221,223, 99,233,208, 97,226,126,
- 68, 18, 68, 36, 42, 65,102,130,176, 51,192, 45, 25,146,150, 87,159,229,242,211, 47,176,215,106,241,220,215, 31,224,134,187,238,
- 97,237,244, 38,157,206, 42,213,114,141,253, 71, 14,243,228, 23, 31,101,122,214, 71,227,112,224,186,107,113, 75, 53,206,189,120,
-150,147,143, 61,204,129, 91,111, 96,122,225, 6,174, 57,126, 39,189,237, 85,122,253, 93,122,187, 23, 40,213,230, 24, 4, 3, 58,
- 27,107,184,149, 50, 39,222,254,253,196,131, 62,151,158,120, 2,219,245,169,237, 95, 98,231,194, 57,144, 54, 11, 7,175,225,134,
- 55,190,222, 76,241,185, 4,101,229, 19, 77, 18,101, 56,174, 36, 85, 70, 46,215, 8, 99,152,187,238, 53,252,247,159,188,207,236,
-197,213,248, 33,173,148,145,223, 44, 97, 10, 92,108, 45,240,129,130, 45, 40, 8,129, 39,229,168, 85, 73, 49,222, 33, 15, 31,216,
- 66, 14, 39,193, 28,154, 34,141, 60, 45, 37,100, 42,161,123,246, 49,130,181, 51, 36,189,213,220,240,164, 70,117,165, 90, 41,164,
-107,163,211,148,226,242, 81, 14,252,244,111,210,184,243,245,102, 18,207, 2,116,180, 99,196, 99,219, 67,216,230,130, 57, 26, 35,
- 85, 98, 92, 37,105, 74, 22,132,132,221, 14,105, 16, 16,247,243, 67, 93,107,146, 40, 54, 10,178,235,225, 88, 78, 94,147,104,154,
-226,178, 52, 70, 91, 26, 71, 15, 76, 12,202,114,112, 42, 21,146, 40,163, 56, 53,203,209,255,246,183,188,244, 95,222,153, 79,183,
-106, 92,224, 61,196,191,218,198,148,153, 42, 53, 50, 6,106, 53,198,146, 42,198,197, 36,195, 83, 41,203,193, 41, 67, 36,106,150,
-169,177,180,207,213, 60,247, 28,113,135, 86,227, 62,100, 24, 79,184,228,101, 61, 98, 20, 9,188,186,232, 70, 43,140,171, 56,255,
-247,169, 92, 66, 17,150, 89, 9, 24,227,159, 26, 93,170,204,222,124,236, 34, 39, 79, 67,104, 97, 46, 2, 74,231,187,148,225,215,
-207, 1, 59, 74,229,197, 45,106, 72, 4, 51, 95, 79, 13, 47, 13, 19,116,188,145,217,223, 45, 33,156, 34, 42,234,152,247,113,164,
-255,235,171,144,238,227,197,224, 88,148, 25,245,170,103, 67, 27,161, 30, 27,243,180, 2,219, 50,148, 65,165,242, 90, 87, 43, 55,
-209,169, 17, 89, 15,165, 81,150,241, 22, 56, 86, 66,251,210,121,236,114,145,226,194, 18, 89,201, 33,125,254, 28,197, 75,109,252,
-176,111, 58, 37,194,152,197,170, 67,151, 1,119,253,200, 29,100, 86,157,172,179, 75,166, 92, 58, 27, 1,237,118, 66, 22,107, 54,
-119, 66,122,169,166, 29,164,220,121,160,193,226,193,121, 14,220,123, 15,171,143,126,147,199,159, 56, 75, 63,131, 78,170, 9, 82,
-197,233,157, 62, 83,221,144,112, 16,177, 48,223,192,111, 20,185,229,248,126,210, 36,225,104, 48,160,189,221, 35, 82, 25,253, 36,
-229, 11,223,122,130,189, 56,195, 67, 51, 85, 40, 49, 83,174,176, 80,157,166,233, 87,104,204,215,233,197, 17, 89, 16,210, 60,121,
-153,166, 18,148, 4,188, 72,200,158, 39,233, 71, 9,158,107,177,144,249,164, 25, 20, 11, 6, 81,106, 91,146,118,148,208,180,114,
- 41, 89,105, 34,173, 73,200,136,227,152, 66, 20,145,181,214,241,181,160,215,235, 32,133, 3, 57, 41, 16,169, 25,244, 7,244, 92,
- 15,191,181,135,180, 61,138, 8,164,229, 32,109, 80,189, 14,254, 27,191,159,157,231, 30,161, 17,133, 38,115,158,223,177,246,118,
- 54,169, 78,149,249,221,247,255, 28,113,152,208,221,110,145,165, 9,197,106, 13,183, 94,165,179,177, 69,191,219, 69,250, 30,210,
- 2, 37, 4,194,115,144,174,141,180, 29, 82, 13,150,227,147,197, 3,200, 64, 75,101,138,101,148,137, 20, 8,199,162,255,244, 55,
- 40, 52, 23,176,167,155,168, 84, 83, 88,156,199, 57,124,152,191,254,253, 95, 34,203, 89,236,190,149,129,150, 36, 74,145,164,106,
-180, 6, 26,126, 22,147, 76, 33, 44,159, 74,109, 1, 63,235, 34,148,145,195,133,206,176,148, 70,145,230,196, 57, 11, 79, 66,193,
- 54,248, 91, 45, 52,105,190, 94,211, 40,108,242,201,218,177,145, 2,202,150,100,214,181, 41, 72, 11, 91, 10,156, 72, 16,196, 96,
- 9, 53,138,254, 78,170, 91,153, 82,164,142,157,195,179,200,159,171,230,179,175,164,113,186, 15,239,207, 74,155,221,189,145,222,
- 13,129,206,206, 76,119,123,217, 18,216,118,161, 76,218,221,197, 46,213,200,130, 62, 78,181, 74, 22,133, 8,203,124,241,226,210,
- 33, 58,231,207, 48,104,111,163, 69,140, 74, 67,234,251,143, 32, 44, 73,105,106,145, 87,191,254, 41, 14,222,121, 23,205,125,251,
-121,252,179,127,207,107,223,250, 54,158,127,228,113, 10,190,199,225,187,239,229,155,255,248,101,138,149, 10,205,153, 26, 74,165,
- 68, 65, 68,173, 81, 38, 25, 4, 28,190,255,141,216,190,103,202,224,171, 21,210, 94, 15,175, 57, 75,188,183,142, 83,107,146,133,
- 93,164, 99,163, 6,187,200, 82,141,184,189,141, 59,189, 72,214,221,165,191,187,141,235,187,204, 30, 60, 74,208,110,209, 60,124,
-130,104,119,139,165, 19,199,137,131,128, 44,138, 8,217, 34,234, 71,168, 36,164, 80, 41,211,219,222, 38, 28,108, 80,168, 31, 32,
- 37, 66,119, 83,226,168,143,237,122,132,131, 46,182,107, 83,172, 52,136,250, 1, 59, 87,214,233,239,238,162,195,152,239,248,241,
-159,100,231,210, 58, 91,235,231, 41,184, 9,215,220,116,136, 87,159, 59,203,226,242, 44, 43,199,143,224,120, 37, 90,187,219,156,
-126,225, 50,113,247, 18,135,111,184,141,222,218,121, 86,219, 59,184,181, 5, 26, 51,215, 50,213,156,165, 56, 51, 15,182,139, 91,
- 40, 18,236,237,208,186,112,153, 96,253, 49,220,114,133, 27,191,251, 29, 35, 46,114,169, 94, 37, 14, 19, 46, 60,247, 10,211, 7,
-246,225,149,203,216,150,100,253,194, 37,166, 87, 14, 16,246,218, 56,110, 17, 33, 4,105, 20,210,110,117,152, 90,154, 39,203, 82,
- 35,101, 23,138,184, 90, 35,226,152, 52, 71, 23, 74,161, 17,169,217,205,216, 8, 74, 66, 24, 12, 44,130,138,176,240, 1,207,202,
-163, 79, 98, 88, 67,104,242,220, 74,168,225,233, 50,118,186, 79,164, 83,164, 4,149, 69,164,253, 43,230, 67, 41, 4,146,220,109,
- 46, 37,144, 81, 58,116,156, 27,126,239,111,112,106, 77, 16, 49, 90, 13, 16, 58, 5, 44,132,107,131,244, 70, 83,157,121,240,135,
-166,205, 41,137,200, 6, 3,130,214, 30, 81,191, 67, 50, 24, 48,216,235, 18,135, 17, 89,146, 97,185, 30,210,241,205, 1,155, 23,
-104,184,165, 10,210,114,205, 21, 88,130,148, 46,105,148, 16, 71, 17,118, 65,226,230,113, 48,173, 20,229,235,110,193,169,214, 73,
-186,221, 60,167,174,199, 50,121, 94,145, 58, 97,245, 27,215,133, 78, 72,225,195, 95,236, 49,115, 69, 95, 69, 61,147, 66, 76,144,
-209,204, 65,175, 50,179,159, 87, 74,231, 44,133, 97, 47,123,142,195,157,204,160, 51,238,110, 31, 50,237, 71,190, 5, 57,118,228,
-143,200,122,195,204,118,158, 38, 94,148,182, 0, 0, 32, 0, 73, 68, 65, 84,251, 31, 70, 0,133, 45,242,238,232, 9,170,156,158,
-196,251, 90,198, 68, 42,195,252, 50, 48, 70,180, 10, 41,141,199,197, 26,198,215, 38,156,234, 19,169, 6,195, 30, 6, 97, 91,216,
-229, 25,132,244,136,163,214,168, 79,110,212,164, 49,145,130,208, 66,152,254,137, 92,209,144,185,173, 95,107, 53,194,200, 94,149,
-150, 0, 84,146,230,251,242, 92,103,207, 84,206,131,103,196,205, 39, 87, 12, 74,203, 7,200,220, 10,193,238, 73, 94,252,218,191,
- 18, 70, 5, 74,223,236,192,110,192,160,219, 33, 88,223, 36,237,247,217,217, 60,135,187,208,229,134,127,255, 58,100,253, 58,186,
-143,127,158,213,135, 78, 50,243,134,183,114,252,189, 77,158,253,131,143, 49,232, 68, 28, 58, 84, 99,167,163, 57, 58, 87,167,180,
-188,128,223,156,162,115,246,121,158,121,236, 52,157, 68,179, 25,102, 68,128, 43, 5,145,134, 86,170, 73,219, 17,171,157, 45, 22,
- 42, 22, 11,139, 53, 26,115, 85,170,251,102,152, 93, 89, 4, 20,105,183,207,237, 82,112,241,244, 26,189, 40,101,189, 29,177, 30,
-236,114,106,119,131,110,168,216,215,172,114,164,218, 64,196, 62,194,178,232,235, 4, 29, 37, 28,201, 44,156, 64,114, 37, 9, 57,
-163, 98,254,127,174,222, 52, 88,210,243, 60,207,187,222,229, 91,123, 63,251, 58, 11,102, 0,204, 96, 39,192, 5, 20, 69, 10, 36,
- 37, 89,178,181,132, 74,201,137,229,216,177, 85,113, 82, 86, 41, 37,197, 81, 92,145,108,171,168, 42, 39,182, 99, 87, 28,197,150,
-146,170, 84, 24, 45,137,164,148, 98, 75,138, 40,201,218, 40, 71, 92, 32, 18, 32, 8,112, 6,192, 96,128,217,231,236, 75,247,233,
-245, 91,223, 55, 63,222,175,251, 28,240, 7, 10, 63,230,116,159,211,221, 95,127,207,251, 60,207,125, 95,247,112, 50,102, 49,246,
- 25, 23,134, 36, 79, 65, 86,177,156, 56, 96,201,176, 48, 28,231, 5, 65,146, 17, 78, 82,194,241,136,188,204,241,148, 34, 75, 38,
-168, 0,252, 90,131,245,197, 14,147,180, 32, 12, 44,195,209,144, 48, 12, 8,106, 53, 60,207,195,247,131, 74,152,169,177,163, 17,
-241, 83, 31,163,247,222,107,180,122, 71,120, 97,195,105, 89,180,132, 82,208,239,118,221,180, 41,244, 80, 86,147,149, 25,121,255,
- 4, 85,139, 16,165,165, 44, 75,215,141, 70, 1,194,211,200,192,195, 42,141,177,106, 70,172, 68,148, 88, 35, 40,139,212, 5,196,
-228, 37, 82, 8,186,119,110,144,117, 79,220,232, 93,122,120,139, 11,164,205, 54,175,252,249, 31, 32, 5,248,158, 27,103,167, 69,
-193,168, 52,213,206,220,206, 26,134,180,176,160, 12, 73,158,211,235,238,211,140, 64,132,117, 55, 97,212, 62,210,175, 83,142,187,
- 32,138,217, 97, 49, 47, 45, 70,216,153,199,220, 86,235, 49, 91,117,238,198, 24,151,200, 38, 4, 53, 79,209,212, 10,140, 96, 50,
-155, 52, 85,247, 78, 97, 65, 41,103, 85, 44, 93,211, 19, 4, 62, 38,207, 48,198,162,113,104, 88,161, 44, 69, 53, 24, 44, 43,236,
-114, 57, 43,238,110, 45,167,112,122,139, 80, 56, 75,161,250,217,159,254,137,207,234,198,156,139,210, 11, 99, 16,110,228,161,188,
-208,141,189,131,136,163,247,222,166,185,188,140, 31, 71,180, 46, 63,199,195,175,191,140,176, 9,147,193, 24, 83, 22,164,201,128,
-147,253, 99, 46, 62,247, 12,119,175,223,100,126,109,145,205, 43,151,184,246,242, 43,180,230,154,204,175,172,226, 5, 62, 42,140,
-104, 52, 27,212,219, 45,218, 43,171,204, 93,122, 2, 21,213, 49, 38, 71,232, 0, 29,198,206,115,172, 60,132, 95,119,192,147,178,
- 64,214,231, 17, 22, 84,220, 38, 57,218, 5,155,163,164, 36, 92,222,196, 26,139,142, 35, 76, 94,144,143, 39,152, 34,163,182,126,
- 1,155,150,236,223,122,143,189,247,110,176,114,233, 34,214,122,140,246,247,217,120,250, 89,110,189,252, 21,180, 42,152, 12, 6,
-248, 97, 72, 58,204, 16,162, 96, 60,236, 49,232,117, 17, 66,226,121, 33, 18,193,226,197, 53,142,182, 14,184,245,250, 77, 86,215,
- 58,156,123,252, 18,147,193, 24, 85,230, 92,121,233, 19,100,133,229,104,247, 0,147, 65,103,174, 77,173,174, 88,188,124,145,205,
-231,190,157,246,194, 5, 36,138, 60, 77, 40,139, 28, 73, 53,238, 25,244, 17, 90, 19, 47,204,211,190,112,158,213, 39,174,184, 11,
- 38,153,176,115,243, 54,126,232,225,199,117,242,108, 66, 16,199,188,251,197,175,112,252, 96,155, 11, 47, 60,203, 55,255,221, 31,
-179,120,249, 17,210, 52,193, 10,240,195, 24, 63,138, 40,210, 12,233,249, 44,111, 60,194,171,191,250, 63,210, 16, 18,109, 28,139,
-115,108, 33, 85,150,162,218,109,215,164,160,109, 37, 75, 90, 80, 19,210,165,176,121,158, 75,139,138,231, 9,218, 43, 80,100, 88,
- 91, 84,187, 90,183,107, 63, 43,146,179,211,172,115,121,134, 53,110, 5,168,138, 79, 94,117, 82,193,242, 38, 47,252,210,151,216,
-248,171,255, 5, 50,136,176,228,136,170, 0, 34,170,113,155,240,192,122,213,137,161,132,236,132,178,223, 39, 63, 62,100,180,189,
- 69,111,103,139,238,206, 22,131,253, 67,250, 7,199,156, 28, 31,145, 12,135,244,187, 93,198,195, 1, 69, 81, 80, 22, 22, 35,148,
-219, 65, 11, 5, 90, 83,228, 5, 69, 97, 16, 94, 64, 89, 22,228, 89, 74,212,153, 35,170,213,241,155, 53,130, 90, 92,237,211, 21,
-131,111,126,217,129, 86,180,156, 37,167,217, 51, 42,252,105, 1,158, 46,107,103, 74,107,123,170,184,158, 38,189,113, 22,172, 83,
-217,200,190, 53,233,102,150,206, 86, 77, 94,164,112, 74,122, 41,229,108, 52, 61,195,220,138,211,238, 98,170,115,152, 86,185, 89,
-176,206, 20,184, 35,171,169,193, 44,203,186,226,198,155,211, 2,239, 52,133, 6, 85,141,212, 69,117, 82, 83,186,229,118,253,101,
-250,254, 76,244,170, 88, 75,229,222, 27,161,164,187, 17,201, 51, 2,182, 74, 0, 57,101,210, 11,161, 1,141, 77, 78,176,249,164,
- 98,243, 87,113,180,149, 13, 77, 40, 57, 59, 44, 57,224, 79,117, 0,210,114,118,221,205, 66,130,102, 4, 62,113,202, 24,224, 12,
-169, 72,158,217,215,203, 42,192,166,154, 68,204,127,234, 51,228,227, 17,131,131, 35,146,131, 99,190,251,135,127,142,114,114,143,
- 98,114, 66, 81,166, 28, 93,251, 38,135,199, 47,163,194, 45,174,252,216,143, 98, 11,159,236,214,203,236,125,241,235,100, 39, 99,
-130, 90, 78,124,249, 57, 22, 30, 95,163,115,105,153,104,169, 78,251,252, 10,181,243, 27, 40,237,147,116,187,220,191,181,207, 48,
-117, 19,165,162,116,234,229,145,177,164, 70,146, 20,134, 80, 8,188, 64,146,230,134, 52,205,201,250, 35,119, 96, 77, 7, 46, 29,
-178, 30,162, 60, 31, 95,150,212, 2, 65, 67, 9, 86,231, 99,214, 58,117, 66, 41,216, 31,166,188,113,124, 68,183,232, 51,204, 50,
- 36, 18,137, 34,142, 60,114,105,241,101,192,146,181,172,214,154,104,207, 82,144, 19,249,154,195, 73, 78,102, 45,243, 90,161,164,
-219, 31, 99, 33, 23,130,204,237,209,168, 55, 34,250, 6,106, 43, 75,120,129, 71,150, 20,212, 25, 80,211,130,222, 40,197,247, 53,
-158,114, 66,194, 32, 12, 80, 74,163,124,207, 29, 80,181, 70, 2,254,234,121, 82,169,177,123,119,208, 81, 92, 45,173,197,140,143,
-160,148,114,247, 4, 79, 35,148,231,238, 41,158, 70,120, 10,161, 61,164,246, 80,158, 70,104,237, 30, 90,111, 99,172,160,200,199,
-152,100,130,205, 18,202,116,132,244,125,151,200, 89, 93, 11,201,176,135, 49, 80, 91, 89,197,187,120,137,163,116,200, 87, 62,255,
-127, 16, 42, 73,224, 73,198,185,101, 84,148,140,115, 67, 82, 77,240, 50,131, 67,173, 78,187, 93, 99,241,108,201,114, 45, 96, 46,
-244,137, 61,143, 90,123, 29, 21, 45, 82, 78, 78, 40,138,140, 36,207, 57,201, 50,246,199, 41,221,164, 32, 47, 75, 50, 99, 40, 13,
-206,106,118, 38,201, 49, 80,146,134,167, 88, 12, 61,154,202,113,252, 71,153,225, 36, 55, 36,198, 86,143,113,233,112, 66, 57,167,
-141, 11,110, 54,120,210,226, 41, 80,194,237,201,207, 38,224,216,106,167, 62,213,139, 40, 41,208, 72, 98, 37,104, 42,201,188,239,
-177,236,123,104, 25,213,177,165,101,124,176,141, 16, 37,218,175,225,215,155,149, 13,200,146, 13,123, 80,102, 68,157, 14,186,189,
-204,201,123,111,211, 90, 94,165,185,113,158,238,157,123,120, 8,214,174, 60,197,219, 95,248, 99,236, 82,135,141, 39, 30, 39, 25,
- 12, 56,218, 61,100,113,113,129,250,226, 50,195,147, 1,221,157,125,214, 47, 95, 32, 27,141,105, 44, 47,210,121,228,113,172,201,
-177,194, 67,199, 77, 39,132,201, 51,247,117, 13, 27,228,131, 67,116,216, 68,132,173,234, 38, 35,201,142, 30, 96,179, 20,127,229,
- 60,121,239,208, 37, 48, 77, 70, 72, 13,119, 95,254, 50,243, 23,207,131, 73, 57,122,117,155,163,155,183, 89,121,100,149, 39, 62,
-245, 41,142,239,111,179,117,253,117, 46,126,248, 35,220,121,229, 53, 54,159,184,138, 10,155,220,253,250, 53,118,239,188,201,210,
-250,227,236, 62,220,194,215,146,165,139,143,224,215,235,156,236,247,145, 10,238,189,117,155,124,220,229,242,179, 79, 83,155, 95,
- 99,210,237,227,251,117,154,107, 23,216,187,247,128,225,241, 17, 74, 7, 28,238, 30,144, 79, 44,147,222, 77,194, 78,135,247,174,
-221,198, 11, 98,188, 40,162, 72, 83,194, 70,135, 64,199,248,243, 75,168, 32, 32, 57,233, 67, 89,112,124,239, 30,175,253,250, 47,
-163,194,136, 39,190,251,135,216,120,234, 42,215,255,228, 11,172, 94,126,156,230,194, 34, 69,154,242,212,119,125,146,116,156,112,
-243, 43,175,176,249,252, 51,148, 89,202,112,175,203,226,133, 77, 74, 83,186,105,135,246, 42,207,178,229,153,143,126, 55, 91, 95,
-250, 61,172,146,238,116,106, 44,148,206,111,238, 41,119,243,109,104, 65, 67,104, 98, 41,136,173,196, 71,160,173, 70,215, 26,196,
- 43, 23, 25, 38,125, 76, 62,174,106,131,156,237,127,207,218,202,222,223, 72, 86,133,176, 74, 41, 83,192,227,255,248,151,152,255,
-216, 95,170,244, 90, 6, 65,138,176, 57,179, 52, 22, 33,193,106, 87,200,205, 8,202,148,108,127,159,254,254, 46,201, 96,200,240,
-164,199,168,219, 37, 73,146,106,164, 13,121,146, 82,100,133,139, 70,204,156,157, 47, 73, 83,124,191, 65,216,236, 16,197, 49,121,
-158,147,231, 41, 20, 96, 68,233,224, 54, 90, 34,149, 36,172,215,177, 24,106,237, 86, 53,221,207,153,255,228,103,184,255,185,127,
-226, 94, 67,201,204,147, 46,236,169, 74,118, 26,128,129, 21,213,244, 66,204,210,222,166,244,178,233, 78, 89,202, 41,250,210,141,
-126, 69,149,176,118, 90,134, 78,189,236, 83,120,155,235,147, 43,124,234,172,243, 20, 51, 60,234,217,136, 89,123, 54,145,236,172,
-184, 14,183,173,154,118,224,167, 54, 50,135,144,116,135, 20, 57, 59,132,157,242,218, 93,247, 92,100,125, 39, 76,154,198,175, 86,
- 46, 9,183,255,113, 40, 89, 33,220,254, 94, 10,135,217,244, 91,231, 40,179, 1, 34,233,206,110, 64, 14,219,154, 97,211,163, 25,
- 43, 94, 78, 17,190, 51, 2,158, 99,230, 79, 83,248,166,169,111, 83, 19,238, 12, 53, 59,227,254,115,154, 34,119, 86,228, 94, 69,
-198,114,118,170, 96,170,160,122,156,245, 81,135, 62,101,173,195,222,221, 63,226, 35, 47,252, 48, 54,185,139,148,146,189,123,215,
-233, 63,124,157,224,188,225,201, 79,126, 15,178,181, 14, 40,198,175,255, 33, 39,119,183,144,145, 38,140, 3, 14, 94,123,139,250,
-179,159, 32,122,228, 42,241,227,207,147,110,221, 97,176,119,200,248,248,132,236,164, 79, 16, 47, 81, 15, 7,104,113, 68,203,151,
-180,227,128,187,189, 9,135,169,165, 95,173,171, 10, 5,157, 90,192,113,127,140,231, 7,200, 40,100,175, 59, 97, 53,158, 99, 50,
- 24,131, 53, 52,150,219,120,161, 69,107,143,218,124,157,180, 55,161,204, 74,106,235, 13, 86,218, 25,253, 81,200,113, 82,242,214,
-225, 9,115,126, 31,141, 71,195, 52,240, 77, 64, 61,212, 20, 72,250,105, 78, 18, 24,140,112,132, 49, 9,100,165, 37,179,134, 88,
-104,252,202,207,172, 42,208,210,168,204,217,126,112,143, 15,175, 95,224,149,173,187, 60, 90,187, 74,115,169,193,157,111,148,180,
- 26, 53,162,208,103,111, 48,198, 24, 67,150,103, 76,198, 67, 71, 25, 21, 18, 29,213,240, 61, 13,194, 77,212,188,149,243, 36,141,
- 37,204,141, 47, 83,143,106,148, 56, 55,138, 27,158,148,110, 71,173,165,187,134,166,200,216,106,180,237, 52, 52, 78,196, 70, 16,
- 35,130,192, 57,155,138,156,201,220, 10,163, 68,178,126,245, 73,196,141, 63, 39,235,117, 17,181, 26,210, 56, 40,154, 49, 37, 50,
-240,208, 43,171,220,251,210,239, 83, 26,208,190,165, 40, 97, 82,150,244,179,146,194, 88,242, 42, 15,192, 84,190,117,107,166,131,
- 65,199,111,207,138,146,188, 40, 41, 75, 75, 54,238,161,199, 35, 76, 49,193, 88,247, 92,101,169, 40,166,194, 79, 37,240, 50,137,
- 17, 46,121,176,180,167,238, 32, 91, 97,175,157, 5, 85,186,144, 44, 89,169,224,173, 75,197,244, 4,100,249,153,239, 70, 21,136,
- 16, 74,133,172,194,167, 60, 33,201,173, 33, 85,130, 36, 55, 20,103,181, 34,210,209, 90, 84, 21,213, 26, 42, 69,203, 19, 68, 82,
-162,126,234,239,254,245,207,102,195, 46,245,249, 21,188,206, 18,101,150,114,255,245,151,161, 40,137, 58, 11,140, 15,247,152,187,
-248, 24,202, 15,200, 71, 67, 70,135, 7,156,236, 61, 32,108,182,232,239,239,210,217, 56, 71,127,127,151,243, 31,248, 48,163,238,
-128,254,209, 30,202, 15, 9,162, 58,210,247, 73, 39, 35,194, 56,162,209,104,209, 90, 89,164,190,188,134, 84,154,104, 97,197,217,
-151,116,128,212, 1, 66, 71, 8,114,132, 14,201,199,125,146,253, 59, 4, 11,143, 96,178, 30, 82, 8,138,201, 0,207,171,225,205,
- 47,210,123,239, 6, 65,179,142,181, 37,163,227, 67, 14,110,220,228,220, 7, 63, 72,214,235,211,219,217, 35, 8,224,252, 7,158,
-199,143, 91, 36,131, 1,163,131, 35, 54,159,126,186, 2, 3, 40,210,241,144,162, 40,184,246,197,107, 60,246,236, 26,209,252,121,
- 30,126,243, 22,207,125,207, 39, 40, 82, 75,145, 25,144, 5,111,191,250, 14,129, 26,209, 94, 90,166,187,191,205,164, 63,230,224,
-254, 61,178,116, 72,255,168,203,222,237,247,168, 55,107,188,253,202, 53,218,173, 38,158,158,176,178,186, 65,153,103, 80, 72,146,
-241, 24,145,236,209, 94, 90,192,147, 49,199, 15,222,102,116,176,199,241,189,119,105,173, 94,192,175,215, 88,125,236, 81, 46,190,
-248, 49,100, 16,225, 71,154,221, 27,239, 49,127,225, 2,111,254,225,231, 89,127,226,105,172, 2, 63, 12, 65,120, 44, 94,216, 32,
-108, 52, 56,184,187,205,226,197, 13,132,167, 9, 60,207,141, 86,171,142,172, 52, 37,171, 87,159,231,206,239,124,206,133, 10, 88,
- 75, 42,220,255,141, 0, 45, 4, 53, 37,233, 72, 69, 83, 74, 26, 82, 17, 75,133,150,210,105, 84,130,128, 98,124, 66,222, 63, 60,
-221, 45,219,211,253,238,217, 6, 73,169, 83, 18,218,180, 51, 18,194,210,122,242, 67,124,232, 55, 94, 37, 62,119,185, 26, 3,231,
-136, 98,186, 87, 21,103,186, 64, 9,101, 74,217, 63, 36,217,223,102,235, 27,175,114,247,218, 53,246,238,223,227,112,103,135,254,
- 73,143, 36, 25, 83, 20, 57,166, 40, 40,203,156, 50,203, 41,173, 65, 10, 75,146,100, 40, 63,164, 44,115, 71,166, 50,133,131, 98,
-120,202,197,211,122, 18, 47,168,163,124,141,146,130,176,217,193, 15, 3,252,118,135, 40,212, 8,237, 97, 45,232,184,206,206,111,
-254,194,108, 44,103,167,101,253,125,158,123, 7,191,152,122,233,173, 53,103, 58,246,111,129,235, 76,165,227, 46, 20,242,116,220,
- 93,165,165,205,108,111,213,238,221, 78, 73,104,138, 89, 62,186, 16, 2, 43, 79,129, 45, 82, 77,179,194,207,196, 87,138,179,130,
-178, 83,175,255,116, 5, 34,206,226,104,207,240, 2,164, 60, 19,105, 58,245,135, 83,249,228,121, 63,187, 93, 76, 5,127,211, 53,
-195,244,103, 37, 8,175,137,215,218,192, 76,142, 48,101,114, 58,189,168, 16,188, 24, 51, 27, 57, 74, 33, 42,206,254,140, 11, 55,
- 59, 16, 58,177,229,116,236, 62, 29,118,152, 51,180,184, 25,228, 0, 59, 61, 53,158,233,218,167,186, 4,170,164,193,105, 68,171,
- 16,150,112, 99,157,246,115, 31, 39, 75, 51,142,110,190,197,202,198, 83,136,180,207,123,127,242, 91, 12,186,175,176,241,209,101,
- 86,190,231,251, 80,139,151,176, 71,239, 48,126,247, 13,134,119,239,114,248, 78,151,198,249, 14,197, 56,103,238,137, 11, 4,237,
- 21,100,220,194, 78, 18,138,110,159,124, 84,146, 77, 36,195,221,156, 47,253,246,203, 60,126,126,158, 34, 29, 50, 26,101, 36,133,
- 65,121, 30, 74,128, 39, 44, 65,224,161,148,102, 56, 76,136,180,100,121, 62,166, 63, 46,104,180, 98,198,227,148,192, 55, 4,161,
- 66,218,156,120,177, 93,101,129, 23,212, 23, 27,132,157, 22, 65,172, 9,180,162, 28,165,132, 18,174, 46,183,200,114,203, 82, 67,
-129, 54, 28,164, 9,131,204, 81,213,186, 54, 99,161, 1, 77,237, 70,193,161,167, 25, 23, 5,117,165,232,248, 26, 95, 56,251,107,
-224, 73,180,146,248,210, 21,198, 16,195,237,193,136,185,165,121,130, 56,230,238,245,215,241, 61,133,239,105, 90,161,207, 40, 45,
-240, 3,133, 86,218,113, 12, 4,248,129, 95,225,128,181,227,135,148, 37,218,147,168, 71,174, 50,216,219, 38,200,199,136, 32, 56,
-189,166,165, 64, 8,215,173, 75,173,176, 72,183,234,243,181,251,198,121,218, 77,128,234, 45,132, 21,228,113,200,176,179,136,149,
-138,180,223, 39,104,175,208,252,232,247,225, 47, 46, 99,183,223,115,209,218, 90,129,146,212, 87, 47,226, 63,122,149,207,255,202,
-191, 96,251,238, 77,180,148,140, 51,195, 40, 47,153, 20,182, 2,208,184,245, 85,110, 64, 73,229,152, 10, 37,196,158, 36, 86,146,
- 80, 75, 58,190,166, 30,250,104, 91, 98,243, 20,112, 63,159,203,136, 50, 94, 96,191,223,103,144,164, 46,155, 66,224,248,241,211,
-240, 21,156,226, 61, 86,130,118,224,177, 90,139,168, 43, 15,139,229, 36, 41,220,225,194, 90,114, 99,201,172, 19,198, 9,225,158,
-167,230, 41, 98,165,137,148,197,147,130,154,148,196,213, 89, 53,183,150,242,204,100, 14, 33, 48, 2,148,117,174,165, 72, 10, 22,
- 3,197,178,231,209,212, 26,245, 51, 63,249,119, 62,219,216,120,134,253,183, 95, 65,218,156,209,222, 46, 11,155,231,136, 23,151,
-208, 65,136, 53, 6, 29,197,152,210,210,189,123,143,209,209, 33, 43,143, 95,198,175,181,241,107, 13,186,247,238,208, 92,223, 96,
-120,124, 76,127,239, 0,207,211, 68,205, 8,161,125, 38,195, 33,113,171, 73,125,161,205,240,168, 71,125,101,137,108, 52,164,189,
-121,209,125,209,131, 90, 37,248, 49,148,195, 19,100, 24,131, 80,216,113,159,104,101,141,236,248, 16, 97,114, 6,219,119, 8,154,
- 77,250,219,119, 8,231, 86, 33,205,208,157, 5, 6,119,111, 18,119,154, 12,119,142,153,187,250, 4,249,201, 9,113,163, 65,231,
-194, 35, 8,169,145,126,200,241,253, 7, 72, 79,115,112,119,139,195,251,119,232,237, 30,186,125,173, 84,136, 20,154, 75, 49,195,
-147,130,116,116,130, 48, 5,147,108,136,231, 69,108,189,187, 71, 35,130, 39, 62,249, 18,255,238,151, 62,207, 51, 31,187,128, 31,
-205,177,188,185,134, 36, 96,255,206, 45,206, 93,189,192,238,182,101,243,156, 98, 50,177, 14, 55,184,186, 64,158, 73,202,178,164,
-221, 9,169, 45,204,147,229, 30,245,205,199,169, 47,172, 35,188,128,197,139, 87, 72,122,199,244,182,238,211,221,221,165,181,186,
- 73,103,101, 25, 21,248,180,215, 54,144,158,100,126,243, 34, 15,223,250, 38,115,235,231, 72,135, 19, 12, 41,199,247, 30,210,152,
-159, 67, 5,158,227,239, 43, 53,179,250,228, 89, 89,249,189, 45, 65,163,195,173, 95,251,151, 88, 3,185,132,212,194,184, 18, 48,
- 73, 4, 53, 37,104, 90, 73, 75, 40, 34, 4, 30,138,176, 54,135, 40, 11, 68, 54,118, 90,134,105,172,165, 16, 72,169,102,241,154,
- 51, 69,183,168, 20,205, 51,175,177,187, 33,159,251, 91, 63,197,227, 63,243,175, 79, 71,165,229, 0,178,209, 25,236,105,101, 99,
- 26, 15,201,123,123,108,191,254, 26,183, 94,123,149,251,111,189,201,241,193, 1,233,120, 76,154,101,110, 85, 92,173, 15, 76,149,
-122,160,181, 66, 88,139, 18, 2, 37,221,151,217,148, 6,173, 53,198, 22, 20, 89,138,177,101,133,254,117,163, 97, 37, 36, 58,240,
- 81, 65, 72, 88,171, 97,181,166,227, 91,202,183,175,161,214, 54,144, 90, 99,173,229,228,181, 47,146, 29,110, 79,229,109,174,187,
-158, 6,180,216,211, 92,117, 91, 85, 78,113,182,168,114,246,165, 85,143,153, 69,142,158, 90,179,196, 25, 13,130,157,122,196,171,
- 93,249,251,246,241,226,108, 39, 95,165,176,153, 51, 25, 38, 83,204,140,176, 51,235,215, 20, 22,115, 26,228,114,186, 87,159, 37,
-197, 33, 16, 94,224, 34,115,229, 41,142,117,250, 58,102,190,123,113,198, 73, 40, 78, 19,182,102, 51,192,170, 91, 16, 38,165,152,
-116,177,197,176,186,169,155,234,181,159,241,192, 35, 78,163,118,207, 38,181,157,129, 9,113,150,127, 48,133, 25,205,108,106,118,
-182,134, 48,165, 57,197, 6,203,111, 57, 97, 86,215,182, 21,118,182, 32, 17,128,142, 2, 26, 31,248, 56, 50,108, 80,230, 67, 22,
- 23,150,216,254,210,175,162,162,123,172,127,228,131, 52, 94,248, 56,102,210, 71, 80, 80, 28, 29, 50,217,223,119,113,173, 69, 6,
-147,140,193,195, 62, 81,251, 89, 38,247,187, 52, 31,121, 12,123, 82, 98,242, 22,121,226,243,205,255,247,139,188,241,229,183,248,
-228, 75, 87, 56,238,238,113,243,222, 17, 71, 73, 73, 90, 77, 31, 66, 79,184,204,140,188,192,179, 37,101, 97,152,111,187,107, 51,
-110, 5, 20, 69, 78,103,121, 17, 83,102,204,173,181, 41,210,140,230,249, 11, 88,105, 9,219, 13, 68,105,208, 81, 72,109,101, 13,
- 89,142,208, 90, 18,215, 2,138,194, 82,100, 5,213,154,151, 88, 27,106,177, 69,123, 14,204, 21, 87,186,135,208, 83,164,101,137,
-174, 14, 86,115,113, 64, 40, 37, 94, 85,204,125, 95, 19,123,154, 88, 43, 94,239, 77,152,251,192, 21, 22, 22,231,216,187,119,143,
-189,219,183,104,212, 99, 60, 79,161,165,163,203, 25, 36, 82,187,236, 0, 91, 58,225,168,246,131,138, 98,168,170,245, 12,216, 52,
-135,185,101,210,246, 42,102,247, 14,158, 22,224, 5, 14, 53, 44, 65,248,142,229, 46,164, 67,144,219,202,179,149,151, 37,214,143,
-136,154,115,100,245,136,174, 41,209,198,197,106,155,162, 36, 79, 82,234,173, 22,165, 12,105,126,251,247, 19, 54, 66,134,247,111,
- 49,216, 59,102,227, 63,253, 49, 0,254,232, 55,126,145,222,225, 14,194,194,164, 40, 25,100,134,172,180,192,233,168, 28, 41, 9,
-252,144, 52, 75,241,181, 99,188,251,190, 36,214, 30,115,113, 64,221,243, 8,148, 66,226, 4,162,105,150,147,251, 77,250, 89,193,
-238,241, 46,198, 24,124,229, 81, 15,124,202,162,112,158,243,234,240,174,133,160, 30, 72,230,194,128,245,102, 11,191,204,176,165,
- 97, 84, 88,210,210,184,172, 0, 99, 49, 86,184, 73,134, 83, 21,209,110,214, 88,109,206, 35,242, 33, 30,142,251, 46,133,194,106,
-205,184, 52, 51,206,188,154, 81, 51,221,222, 94, 33,168, 43,201,162,214,204,123,138,134,167, 81,159,253,217,159,250,108,145,116,
-177,101, 65,125, 97,137, 50, 77, 65, 88,130,133, 11,236, 95,127,133,198,234, 58, 71, 55,111, 80,150, 9,131,157, 29, 22,206, 47,
- 83, 63,247, 52,111,253,222,111,179,125,227,117,148,231, 97,198, 3, 22, 31,127,146,241,241, 9,173,149, 21,172,129,157,119,223,
-101,245,242, 5,198, 39,125,252, 56,102,225,194, 69,132, 16, 68,115,139,232,184, 6, 74,161,162, 38,229,168,143, 12,155,238, 6,
-229, 69,148,201, 8, 29,215,193, 42, 84, 24, 97,139,156,104, 97,141,180, 63, 32,106, 55,145, 94,132,110,181,217,127,237,235,196,
-243,115,110, 47, 83, 26,162,229, 85,202, 36, 99,235,250,117,218,155,107, 36,131, 49,239,124,233, 47,200,250, 71,132,245,144,241,
- 96, 76, 28, 6, 12,142,143,104,180, 27, 68,173, 58,249, 4,194, 72, 49, 56, 58,161,181,208, 32, 77, 75, 58,139, 13,130,230, 28,
- 90, 40, 54,159,126,156,111,252,209,171,188,240,177, 39, 89,127,246,195, 20, 89,201,238,189, 29,238,221,188, 75,179, 41,104,204,
-157,163,187,181, 69,107,190,197,160,123,136,149, 22, 73, 73,239,240,128,214,114, 11,191, 94, 35,207, 36, 81,115, 5,101, 11,182,
-175,125,141,254,222, 13, 6, 7,199, 60,242,209, 79,209,222,220,100,235,218, 43, 4,181, 22,249, 36, 97,251,173,119,104,174, 44,
- 16, 55, 26,196,173, 38,163,238, 9,221,123, 15,121,235, 11, 95,224,241,111,255, 24,227,193, 0, 63,170,161,195,128, 34, 51,232,
-106,247, 56,153, 56, 60,100,158, 21,168, 40, 64, 43,201,209,181,175, 50,218,189, 71,102, 44, 35,229,138,187, 5,180,128, 16, 73,
- 75, 72, 26, 66, 17, 11, 69,224,215, 8,162, 14,214, 76,170,252,108, 59,131,151,156,197,165, 79, 39,177,114,118,219,172,110,184,
-202,229, 54, 63,250, 15,126,129,245, 31,250,209, 74,189, 60,192, 78, 14,177,121, 62,235, 6,177,134,114, 60, 98,178,191, 77,247,
-238,109,182,111,222,100,247,193,125, 38,227,145,219, 69,102, 25,101,158, 33,172,179, 34,153,178,196,243, 20,121, 81,128, 45, 41,
-138,156,210,148,212,163,128,164, 44, 41, 77,201,168,215, 69,135,117,130, 40,162,168, 40, 89,158, 31,225,249, 30,194,243,209, 81,
- 4, 64, 16,213, 16, 65, 72,156,244,225,230, 55,241,151,214,144,139, 75,179,132,191, 50,207,233,191,242,103, 78, 41, 62,197,189,
- 86,122,129,233, 72,119,134, 36,149,156,137, 60, 61, 83,236,166, 34,174,106,173,207, 20,178, 51, 27,191,159, 13,115, 57,203, 87,
- 63,131,215,157,238,166,167, 59,242,105,188,170, 18,239, 3,203, 76,177,183,150,138,238,103,207, 28, 50, 92, 42, 13, 50,104, 84,
- 94,255,170,183,151,142,206,104, 77,126, 42,218, 57,243, 1,139, 51,175, 71, 40, 89,101,183, 11, 48,242, 52, 22,246,253,211,126,
-231, 76, 96,106,189, 63, 45,224, 83, 40,207,244, 26,154, 22,225,217,241, 66,201, 83,133,251, 20,192, 83,169,251,165, 58, 19,254,
-161,228,153, 20, 64,197, 41, 58,206,173,116,102,172,248,138,150,232, 62, 31,229,222, 87,229,209,254,142, 31,161,246,220, 75,152,
-116, 68,122,124,128,121,243, 75,216,248,136,246,229, 75,132,235,231,156, 48,137,128,124,251, 14,233,254, 3,108, 50, 97,114,208,
- 71, 71,138,178, 40,104,159, 95,160,126,126,137,225,253,140, 27,191,254, 5, 66, 95,177,123,231, 33,127,252, 11,191,201,242,188,
- 96,113,197,242,213,111,190,203, 56, 73, 25, 76, 74,226,154, 71, 97,220, 65, 58,181, 2, 91,150,196,194, 18, 41, 65,187, 25,177,
-220, 9,136,162, 0,169, 4,121,110, 24,246, 83, 55,113, 42, 38, 8,105, 73, 71, 3,226, 86, 19,237,215,177,210,160,252, 16, 91,
-166, 88, 83, 82, 38, 41, 58, 12,153, 12, 19,234, 53,207, 29,218,243,146,126, 82,226, 11,156, 6,166, 44, 81, 74,146,100,153, 11,
-247, 16, 48, 31,249,244,210,130, 21,207,195, 87,174, 96,212,124, 69,224,121, 60,148,146,219, 43, 29,158,248,244,139,212,195,144,
-127,243, 27,191,131, 60, 57,100,126,177, 77, 45, 14,136,234, 13,116, 37,246, 10,226, 54,121,153,187,216, 96, 33, 81,190,154,165,
-227, 10, 81,117,236,211,233, 78,197, 17, 40, 22,207,147, 10, 5,189, 61,180, 0, 17, 71,160, 93,103, 47,167,102, 15, 37, 72,138,
- 2,171, 3, 26,107, 23, 25,248,138,126, 62,113, 17,169, 2,138, 60,199,162,171, 41,145, 70,123, 30, 73,247,152,249,103, 62, 72,
-231, 67, 47,177,252,210,247,204,172, 98,119,111,188,206,189,119,174, 33,112, 57,228, 89,225,242,205,157, 63,221, 98,133, 98,105,
-105,133, 86,187,197,104, 60, 64, 25, 23, 87,237, 41, 73,203,211, 44,134, 1,205, 32,196,151,202,161, 91,171, 85,219,120, 56, 96,
-239,248,144,180, 40,240,149,164,221,108, 83, 15, 2, 38,201,132,194,184,231, 23,184, 66,219, 9,124,174,158,187,204,230,226, 26,
- 50, 29,129, 49,140,139,130,110, 90,208,203, 74, 70,165,197, 15,154,188,176,241, 2, 63,244,237,127,141,255,228,211,159,225,197,
-181,143,178, 17, 63,193, 83,143,126, 39,123,135, 55,144,197,136, 90,163, 69,161, 4,105,146, 97,113,205,140, 16, 2,173,221,247,
- 85, 33,240, 17,204,121,138,165,192,163,237,105,106, 90,185,216, 86,165, 36, 81,107,158, 34, 75,193, 26,162,185, 21,210,195,109,
-226,249, 69, 78,118, 14,128,146,246,185,203,120, 94,141,160,217,226,240,237,215,241,131,152,149, 71, 54,241,162, 58, 94,173,198,
- 55,127,255,247,217,124,234, 81,182,223,125,151,168, 22,178,249,228, 85,210, 52, 39, 8,125,230, 47, 93, 37,237,247, 41,210, 4,
- 79,187,177,167,210, 62, 38,155,160,235,109, 76, 50, 68,214,218, 80,184, 96, 22,119,101, 4, 20,131,125,167,202, 47,114,124, 95,
-161,226,121, 76, 54, 33, 57, 62, 98,241,202, 21,118,223,248, 6,107, 47,126, 27,181,204,114,120,237, 85, 14, 31,108,177,184,185,
-198,164,215,229,250, 31,253, 49,235, 87,174, 16, 4, 43,188,241,133, 47,209, 88,210,216,246, 42,243,235,235,236,223,191,195,130,
-202,232,108,174,147, 28, 13, 17,162, 4, 60,154,243,117,154,171,143,208,219,222, 39, 47, 18, 14, 31,236,241,216, 11,143,211, 90,
- 95,228,238,235,239,112,239,230,219,100, 19, 73, 58,220,229, 3,159,248,110,182,222,217, 37,170, 67,191, 63, 32,140, 98,198,253,
- 30,225,230, 42, 94,212,164, 62,215,153,249,145,203,172,143, 53, 33, 79,126,223, 15, 35,131, 26,197,184,207,221, 47,254, 17,173,
- 11,143,178,120,254,113,134,199,199,172, 63,121,133,214,104,137,225, 65, 15,177,164,176,101,206,197,231, 63, 0,192,230,115, 79,
-147, 37, 57,139,231, 55, 57,217, 59,164, 62,191, 64, 16, 85, 59,168,204, 34,173, 65,133, 17,161, 86, 46, 21,171, 44,121,226,111,
-255, 52,219,111,124,177, 58, 11, 22,104,227,138,185,181, 22,173,221,126,199, 17,208, 4,148, 99,210,193, 54,210, 22,136,105, 82,
- 31,118, 22,220, 80,230,133, 99,133, 76,215,150, 85,199,110,167, 5,198, 88,174,252,179, 95,103,225,195, 47, 97,108,129,152,236,
-185,226,160,156, 69, 5, 33,161, 72, 33, 47,200, 70, 3, 70,135,135, 28,110,239,208, 59,216,167, 44, 10,108,158, 83, 20, 57,121,
- 81, 58, 79,184,112,214,178, 73,146,162,211,148,143,125,248,131, 52, 58,115,200,241, 8,211,159, 56,213,123,123, 14,121,233, 42,
-121,123,158,131, 91,111,243,181,223,252, 55,248,181,208,217, 61,242, 9,134, 26,100, 41, 70, 73,132,246,241,155, 77,130,209, 49,
-234,238, 13,104,118, 80, 65, 12,121,138,245,124,108, 94, 48,255,109,223,195,189, 95,248,135,216,202,143,110,166, 81,115,114, 42,
-246, 23,167, 5,187,218,119,155,217,254,253,244,192, 99,103,190,107, 78,227, 69,229,116, 74,124, 6,226, 82,217, 13,169,252,232,
- 74,156, 73,133, 59, 99,216,158,118,243,166,180, 51,193,158, 59, 48,152, 74, 33,238, 64, 56,214, 0, 74,206,246,228, 42,158,195,
-107,159, 39, 63,186,131, 73,186, 85,231,158, 82,154,108,246,188,198, 58,134,128,153,230,196,207, 94,139, 58,205, 66, 47, 45, 66,
-249, 24,147, 51, 37,229,184, 75,164, 74, 99,155, 41,238, 45,198, 8, 78,227,237,220,223, 42, 85,224,132,176,213,126,213,177,239,
- 29,104,105,170, 81, 64,186,247,114, 10,193,177,198,204,208,186,148,103,243,122,237, 76,160, 57,243,222, 79, 83,220,166, 7, 49,
- 83,233, 55,164, 32, 94,217, 36,126,250, 99, 48, 62, 36, 79, 70,232,228, 16, 61,215, 37, 90,186, 68, 49, 73, 40,114,141, 85,117,
- 14,255,252,183,104,172, 95, 64, 6, 13,132, 13,240,130, 35,132, 23,160,124, 65, 54, 25, 51,120,112, 29,191, 85,242,216,127,252,
- 12,247,255,244,109,182,223,237,243, 93,127,243, 50, 95,253,211,111,176,211,205, 41, 61,197, 73, 90, 80, 6,154,222, 40,119,176,
- 18, 91, 82,243, 20,120, 2,133, 98, 96, 21, 53, 9, 73, 90, 66,154, 48,206, 74,254,228,225, 24, 48, 92,238, 4, 60, 60, 86,124,
-224,114,147,213,185,144,225,225, 17,126,109,136,144, 10, 47,148, 4,205, 57,138,100, 66, 99,173, 73, 89, 40,250,199, 71,100, 35,
- 67,187,237,209, 29,166, 88, 5, 99,107,209, 82,162,181,160, 63, 73, 17, 8,146,162,164, 89, 11, 72,139,130, 70,228,243,236,147,
- 11,172,198,138,219, 38,162, 27, 53, 72,227,136,197, 40,164, 53, 72,248,220,255,244,203,220, 62, 74,248,204,167,159,166,217,174,
-227, 73,137,231,251, 40,169,144, 97,132, 23, 73, 50, 27,146,110,237, 35,215,234, 40,223, 35, 29,141,220,244,170,116,105,141,178,
- 44, 81,158,135,180,194, 77,192,140, 0,147, 99, 90,115, 76, 22, 86, 92,156,237,254, 3,130,100,140, 23, 70,206, 46,106, 53,227,
-195, 62,162,179,132,141, 58, 28,235,130,178,204,156,120,190,116,150, 69, 59, 77, 63,195, 50,233, 62,116,135,191,194, 50, 58, 58,
-166, 54, 63, 71, 81,148,238,224, 1,116,218,115, 4,202,185, 46,181,144,248,194, 98,148,164,200, 12, 82,192,252,210, 34,115,173,
- 57,182,118,239,145,231,238,179,210, 21,159,223,171,214, 81,194,150, 88,171, 48,198, 77, 35,203,188, 64, 80, 34, 37,172, 47,156,
- 35, 41, 50, 14,142,247,201,147, 9,145,150,179, 48, 36,137, 37,212,138, 11,171,231, 88, 90, 88,165, 24,239,163, 61,141, 10,214,
-216,104, 47,242,216,194,179, 60,114,233, 81,100,161, 56,218, 57, 96, 56, 72, 57,218,219,231, 88,245,137,163, 6,163,254, 14, 39,
- 59,199,252,165, 79,253, 87,204,207, 55,248,191,127,231, 31,209,239, 15,170,104,233,234,171, 80,233,102,164, 4,105,160,230,185,
- 78,189,174,192, 87,202,117,243,255,240,167,254,238,103,165,246, 73, 78,122, 40, 79,161,149, 66, 55, 58, 12,119,183,104,158,191,
-204,225,245,111,176,246,226, 75, 20,253, 1,147,126,143, 98,124,194,238,205,183,217,124,246,105,218,231, 31,197,148,160,195,136,
-185,213, 85,188,160,134, 48, 5,101,150, 35, 61,133, 23,196,172, 60,253, 44,199, 91,187,236, 92,127,157,206,234, 10,209,252,178,
-219, 13,248, 49, 38, 75,156,232, 32,172, 65, 89,184, 19,182,210,160, 98,204,164,143,106,204, 83, 12,187,238, 48,215,156, 35, 59,
-222, 67,215,155, 88, 11,253,237,251, 52, 86, 86,209, 97, 72,210, 31, 80, 76, 50,206,125,228, 69,118,111,188, 77,127,119,151,203,
- 47,126, 27, 24,195,209,214, 46,100, 22,115,248,144,230,198, 2,147, 81, 74,232, 69,120, 90, 99,200, 73, 38, 5,163,227, 99,148,
-103,177,182,100,112,120,204,253,183,110,177,176,220,166,181,190, 76,154,101,116,183,247,216,190, 59, 64, 23, 71, 40, 17,176,190,
- 25,209, 90, 59,207,253,155, 15, 81,118,136,181, 62, 90, 59,193, 78,216,168, 83, 38,134,100, 50,100,112, 50,196, 24,131,145, 62,
-181,185, 85,138, 36,225,248,221,183,208, 81, 76,231,145,199, 24,119,187, 88,161, 72, 71, 93,252, 90, 11, 47,240,241,227,136,193,
-225, 33, 74, 41,164,138, 56,217,223,165,185,184, 80,217,152,132, 11, 41,177,178,138, 18,117,194, 15, 63, 10,157,127,125, 90, 0,
-172, 37,152, 91,228,198,255,249, 47, 73,149, 32,197,160,172, 64,149,206, 42, 21, 35,104,162,168,161,136, 42,216,140, 82,226, 52,
-143, 76, 56,139,213,148,239, 46, 4,239, 71,132, 86,193, 42, 83,165,245, 51,191,248,121,230,158,251, 40,198, 38,136,180, 11,126,
- 13, 17,212, 29, 12,166,200, 65, 64,126,210, 37, 79, 38,140,246,247, 56,126,184,195,184,223, 39, 75,179, 74,161, 94, 84, 32, 25,
- 11,148, 76,134, 14, 48,241, 93,159,249,126,174, 62,255, 44, 97,105, 40,143,186,228,147,132, 34,201, 72,135,137, 27, 5, 74,167,
-240,111, 92,190,202,213,239,254,203, 76,142,119,216,186,113,147,184,217,114,187,191,169, 2,127,110,145,150, 73,177,111,189,134,
-141,106,196, 75,171,200,213, 53,103,236,196, 34,189, 0, 25, 68,152, 44,161,127,237,213, 89,199,104,207,128, 88,202,242,212, 83,
-250,173,209,240, 83,255, 62,226,253, 81,171,211,241,183,152,213,186, 51,221,182,169, 34,103,205,153,214,183, 18,184,185,115,128,
- 56,165,196,205,118,229,167,145,180,239,139,151,253,150,137,246,148, 18,105,243, 17,101,210, 59, 5,248,188,143, 26,247,126,235,
-219, 44, 60,103,250, 59,170,110,123,134, 2,150,166, 66,222, 78,163, 85,191,101,175,125,198, 25,225, 84,241, 18,161, 93, 40,135,
-205,211,211,189,247,244,119,152,179,161, 57,204,184,249,238,117,201,247, 61,159,144,170, 58,196,216, 51, 58,129, 10,242, 83,141,
- 38,103,147,129,138,204, 39,172, 32,184,240, 36,205,231, 63,137, 48, 99,138, 73,138,188,246,235,168,102, 3, 83,230, 20,131, 62,
-123, 91, 61,186,119,110, 51, 28,166,244,222,121,143,206,165,117,252,133,117,228,229, 79,161,149, 65,170, 9,163, 7,135,148,153,
- 96,248,240,132,175,253,193,235,156,136,140, 15,126,236,121,190,246,229, 47,113,255,168, 96,144,150,228, 5, 12, 51, 80, 88, 6,
- 73, 65,164,221, 8, 54,210,146, 64, 73, 78,140,170, 14,109,130,122, 77,115,104, 32,199, 23, 0, 0, 32, 0, 73, 68, 65, 84, 60,
- 44,248,221,251, 3,234,158,228, 19, 27, 49,207, 95,104,179,218, 82, 8,207,226,135, 62,218,151,152, 36,113, 43, 0, 33,208,161,
- 79, 52,191,130,240, 60,198, 7,123,180, 86,151, 42, 7,137,160,213,169, 65, 90,224,107,133,242, 53, 7,195,132,113, 94,178,212,
-174, 17,249, 18,223, 19,152,188,164, 95, 88,158, 88,171,179,208,138, 89,244, 13, 23,188,130,243,102,204, 47,125,254, 21,254,232,
- 43,111, 18, 7, 18,223, 87, 92, 90,234,208,170,135, 21,194,187,134, 31, 69,132,245,182,139,220,142,234,228,233,136,165,222, 14,
-157,249, 6, 38,172, 57, 11, 98,133, 71, 46,138,220, 29,110,181,118,247,189,162,192, 72,167, 49,177, 88, 74,161, 40, 23,214, 72,
- 91,203, 76,226, 22, 99, 47, 34,245, 66,204,202, 6,114,101, 21, 81,243, 29,141,173, 44, 93,206,120,145, 99, 74,131,201, 12, 74,
-187, 67,112, 89, 22, 96,170,247,197,143,241, 27,117, 60,223,101,121, 80,228,220,248,234,159,178,127,235,117,154,190,118, 28,244,
- 42,162, 52, 53,110, 12, 95,148, 37,135,199, 71, 28,245, 71, 8, 43,136,125, 15,129,165, 17, 72, 22, 34,159,133,192,167,174, 53,
-129,214, 40, 85,209, 26,133,164, 40, 75,210,172, 32,208,210,137,200,203,148, 70,123,142,110,146,209, 79, 75,178,194, 29, 36, 67,
- 33,249,207,127,226,167,249,190,191,242,227, 92,124,246,123,169,197, 47, 18, 54,175,114,238,209, 15,243,200, 83,143, 48,233,229,
-228,137, 96,119,235,152,238,241, 17,145,223, 33,235, 91,182,222,221,166, 63,114,150,241,253, 59, 7,236,239, 30,242,228,227,223,
-201,230,242, 21, 30,244,110, 48, 46,114, 23,237, 90,245, 97,190,112,187,244, 57, 79,179,236,123,204,123,154,166,246,240,164, 69,
- 75, 79,161,226, 6,229,222, 67,252,214, 38,200,144, 98,212,199,175,185, 78,102,243,197,143, 67,105, 41,243, 49,229, 36,161,182,
-186,204,194,218, 5,164, 23,208, 63, 60, 96,255,157, 27,228, 73, 2, 24,180,167,137, 91, 29,218,171,235,120,177, 59,137,149,165,
- 33, 57,222, 99,243,233,171, 68,139,171, 8,237,185,147, 80,158, 32,131,176,234,127, 20,144, 99,139, 2,225,197, 96, 50,100,220,
-198,166, 67,135,129, 21,146,108,255, 1, 94,107,145,180, 55,100,176,115, 7, 51, 30, 17, 61,250, 56,197,104,130, 31, 69, 72, 45,
-121,248,213,175, 50,218,222,230,210,167, 63,206,193, 59,119, 41,210,148,160, 22,176,118,229, 60,194, 94,196,228, 9,254,124, 78,
- 54,129, 81,255, 24, 63, 47, 17, 6, 22,214,150, 93, 16,189, 47,233,119, 7, 60,246,161,199,241,235,203,236,189,251, 46,245,185,
- 58,195,147, 49,118,210,167,190,216, 68, 17,176,118,229, 2,183,190,126,147,108,208,197,171, 27, 4, 33,141, 86,131,122, 39, 34,
- 29, 38,120, 81, 72,153,105,210, 65,159,163,209, 45, 26,115,171,212,151, 47,176,254,244, 83, 40,241, 52,101, 81,114,120,239, 62,
-173,141, 13,130, 90, 76, 50, 88,100,176,127, 64,212,168,163,116,128, 45, 74, 60, 63,158,141, 54, 15,239,111,209, 94,154, 99,231,
-221, 59,172, 63,249, 4,147,193, 9,121, 63, 33,174,207,225,215, 60,246,239, 60,100,233,226, 6,195,163, 94,117, 56,208, 88,165,
- 88,184,250, 65,142,223,122,133, 80, 40, 66, 97, 40,181, 32, 1, 2, 43,221,110,109, 86, 49, 78,239,148,114,154,103,173, 92,199,
- 52, 29,105, 26, 99, 92,225,159,218, 84,170, 74,117,229, 31,253,175,180,175, 62,143,201, 7, 8,155, 64,216,170,212,210, 25,102,
- 60, 0, 41, 41,251, 3,134,199, 71,152, 52,225,224,254, 67,250,199,199,140,135,125,138, 18,138,116,130, 45, 45, 69,150,160,148,
-226,164, 59,224, 67, 47,189,200,163, 31,255, 54,184,123, 23,115,251,144, 50,113, 99,249, 50,205, 73, 71, 35,242,172,196, 71,225,
-117, 18,132, 30, 32,187, 71,216,122,131,103,126,240,175,241,216, 39,255, 50, 95,252,220,255,194,176,127, 66, 51,136,201,133,100,
- 49, 16,120, 59,119, 73,194,186,139,145,213, 62, 52, 26,174,186, 20, 5,214,142,177, 42,224,220,223,254,111,217,255,147,255,135,
-188,119, 52,195, 69, 90, 91,113,221,171, 34,235,196,216, 83,123,155,173,188,250,167,162,180,153,242,124,218,176,150,165, 83,252,
-170, 10,194, 51,165,186,205,242,219,205, 25,129,221,105,140,226,105, 10,171,251, 61,166, 0,229,201, 25,102,247,116,133,111,103,
-135, 46, 91, 26,108,181,215, 52,147, 1, 38, 25,184,241,245, 25,143,183, 19,235,169,170, 3,183,223,226,181, 59,189, 22,166, 68,
- 57,103, 15,203,103, 99, 25,107,156,237,207, 22,230, 52,164,198,158,218,237, 78, 45,126,110,231,110,146, 12,200,171,157,187, 61,
-179, 62, 56,203,181, 63, 21, 12, 88,170, 48, 23,113,122,112,177,101,121, 6,144,127, 54,231,190, 34,225,201,234,239,154,101, 7,
- 72, 84,115,142,250, 99, 47,224, 53,125,242, 99,200,222,250, 19,188, 0,242,188,192,164,130,227,126,136,231, 11,110,191,249, 14,
- 91,183, 14,248,195, 55,186,252,252,149, 13, 66, 83,146,223,252, 11,100,216,164, 40, 67,196,220, 18,227,157, 67,240, 21,163, 97,
-193,181,131, 29,158, 92,223,161, 20,150,126, 82, 98, 44,140,178,146,113,105, 89, 16,146, 64, 11,226,192, 89,254,188, 80, 82, 34,
-240,139,130, 56, 10,200,242,130,193,216,240,103, 91, 3, 30,105, 5,204,105,193, 70,199,195, 11, 44,173, 86,232, 86, 72,121, 78,
-153, 27,252,192, 7, 83, 56, 65,232, 73, 15,161, 53,198, 58,219,153, 64,145, 13, 70, 24, 33, 17, 5,212, 27, 30, 40,141, 82, 62,
-187,189, 20, 45, 36,105,101,100, 54,182, 36, 14, 60,242,209,152,163, 73,193, 5,225, 8,116,198,228, 8, 3, 63,240,244, 50,159,
- 27, 37,164,133, 64,107, 15, 95, 75, 26,205, 22,126,228,227,199,117,119, 95,148,150,218,242, 6,253,222, 8,132,207, 32,135,205,
-193, 1,243,131, 3, 70,243,155,140,189,134, 91,133, 72, 67,153, 87,238, 10,173, 29,251, 95, 56, 48,144, 82,194, 1,102, 76,225,
-198,245,158, 70, 6, 53,164,210,120,161,143, 45,115,164,242, 40, 75, 67, 89,150, 20, 89, 89,133, 31,149, 85, 84,180,116,239,135,
- 20,100,201, 0, 93, 20, 12, 15,183,208,113, 72,103,115,195,137,222,246,182, 24,237,220,102, 49,114,185,239, 77, 93,226, 75,152,
- 20,166,186,252, 5,163, 81, 66, 90, 58,144, 82, 28,213,152,111,183, 25, 84,141,163, 22, 98,102,183, 21,213, 36, 76, 9, 80, 24,
- 66, 37,153, 11,125,114,147, 82,146, 33,226, 6,182,185,132,232, 13, 41,203, 33,182, 2,120,157, 63,119,129,103, 54, 94,226,104,
-111,159,147,123, 39,236,239,110, 97,169,193, 80,209,125,227,132,116, 56,226,221, 55,238,177,120,174,193,194,194, 10, 15,223, 59,
-228,246,193, 3,164,167,144, 24, 26,145, 79,232,121,196, 65,147,238,222,128,250,194, 42,127,227,123,127,158,255,253,247,254, 30,
-253, 97, 23, 20,232,106,133, 82, 71,177,160, 21, 45, 1, 17, 2,101, 12,210, 74,212,207,253,220,207,124,118,240,240, 46,141,213,
- 85,242, 65, 15, 85,107,146, 28,238, 17,117,230, 40,178,140,221,183,175,115,239,155, 95,199, 26, 67,109,110,158,228,228, 24, 99,
- 75,154,107, 27, 28,188,253, 22,139,143, 92, 34,110,213,169, 53, 91,120, 97,200,168,123,132,246, 4,241,226, 18, 97,107,129,193,
-206, 14,243,151, 30, 3,161, 80,126,128,144,202,141,243,138, 28,169, 29,120,198,205, 31, 53,152,188, 42,234, 37,229,100,128, 45,
- 82,172,201, 73,123, 93,194,249, 5, 80, 13,122,183,175,211,222, 56, 71,109,121, 13,225, 5, 12,247,246,185,245,149, 47,178,124,
-229, 81,210,126,202,155, 95,124,153,181,203,203, 24, 35,185,119,237, 29,172, 77, 56, 57, 60, 96, 60,238, 97,132,198,100, 2,108,
- 65,103,117,149,213, 43, 87,137, 91, 11,140, 6, 19,116,168, 9,234,243, 92,127,249, 85, 26,157,144,254,193, 17, 81,173,201,209,
-126,143,251,215,111,176,180, 22,178,124,126,147,184, 51, 79,150, 20,148,121,128,192,178,254,216, 26,158, 8, 80,113, 68, 54,154,
-208, 94,233, 32,253, 22,153,173,145,140, 38,120,162, 68, 43,205, 99, 47,253, 32,227,163, 3,190,250,185,159,231,220,135,190, 3,
-161, 37, 39,219, 15,240,227, 6, 32,209,190,239, 10,155,246, 93, 65,181, 37,121,154,209, 89, 89, 38, 25, 78,248,242,175,253, 50,
- 27, 79, 61,203,238, 59, 55,153, 63,183, 73,216,104,114,244, 96, 11, 29,170, 74, 21,108,136,106, 53, 55, 26, 5,140,144, 68,237,
- 5,238,254,217,111,161, 45, 68, 72, 2,225,178,215,106, 8,154, 72, 98, 79,163,109,149,151,110, 79,187, 62, 99, 79, 45, 81,211,
-105,170,115,160,156,102,157, 75, 41,120,236,167,255, 21,203,159,254, 15, 48,217,145, 11, 83,208, 53,119, 91, 46, 50,202,113, 31,
-147,141, 41,198, 99, 70, 7,251,116, 31,110,209,219,217,229,164,219,101, 50, 28,144,167, 46,102, 16,235, 40, 14, 38,207,233, 29,
- 28,243, 87,255,155, 31,103,105,121, 1,123,247, 46,101,175, 79, 49, 78, 40,211, 9,197,120, 76,210,239,147,244, 71,206,243,175,
- 20, 18,225,252,173, 82,129,167, 65,107,180, 20, 92,250,216,167,216,220, 88,101, 41,142,216, 60,191, 65, 20,250,160,124,172, 41,
-241,107,117,252,249, 5, 88, 94,134, 60,131, 52,135,178, 68,148, 5, 86,106, 86,127,240, 71,217,250,191,254,231,106,226, 97,206,
-236,177,229,183, 36,167,217, 89, 33,158,254,147,197,204,114,190,237, 20,114, 49,131,184,216, 25,180,103, 42, 98,179, 51, 14,191,
-156,137,228,206, 90,204,166,145,177, 0, 74,139, 89, 7, 47,196, 41,209,206, 89,212, 42,152,141, 18,239, 43,134, 83,247,194, 44,
-191,173,234,208,103,235, 1,233,246,236,214,184, 27,231,116,156,125,154,167,251,173,227,136, 83,240,208, 44,222,117,170,160, 63,
- 67,147,155, 21,118, 99,177,166,152,117,247,179,100,186, 51, 42,247, 41,184, 99, 86,236,207, 68,239,218, 51, 89,235,103, 61,234,
-239,143,186, 61, 37, 29,206,108,127, 66, 16,110, 92,166,253,237,255, 33, 58,176,228,199,135,248,251,127,128,209, 62,101, 2,147,
- 44,224,104,239,152,253, 59,119,185,125,125,151,126, 46,216, 78, 12,143,119, 2, 86,175,172,144, 15,114,172,176,148,101, 70,113,
-212,101, 50,204, 25, 30,229,244,146,146, 91,253,146,149, 50,100, 72,202, 32,117,215, 71, 93, 43,140,181,120,190, 98,119,236, 10,
-188,212,138, 48,210, 20, 66, 16, 6, 26,173, 20,195,204,240,141,189, 17,155,173,128, 64,192,188, 47, 88,105,251, 52, 90, 53,218,
-235, 43,104, 95, 98,179, 20,173, 5,126,232, 52, 69,121, 50,118,152, 96,156, 72, 80,135, 49, 38, 47,208,113,132,146,146,193,113,
-223,129,101, 82,203,131,221, 30,135,227, 20, 93,217,157, 22,219, 1,218, 66,127,152,208,207, 13,151, 22,107, 44,215, 43, 30, 68,
- 37,176,253,139,251, 61,222, 60, 28, 83,243,125, 86, 59, 53, 94,120,246, 81, 60,207,167,222,158,115, 34, 54,107,112,188,202,146,
- 32,106, 98,172, 97,110,116,136,231,149,206,159, 62,233, 83, 63,222,166,174, 64,205,173, 80,106, 69,153, 23, 20, 89,142,168,214,
-119, 82, 41,132,144,213,244,209,119,223, 93, 37,240,124,207, 77, 32,165,116, 60, 7,137,211,205,148,134,162, 40, 93, 93,208,218,
-233, 97,108,225,166,186,158,118,143, 49, 57, 89, 54,193,243, 34, 26, 43,171,236,253,254,175, 16,174,156,227,107,191,245,139,212,
- 76, 70,211, 87, 40, 33, 72, 75,195,241,184, 32, 49,206,218, 87,154, 18, 91, 13,130,148,150,164, 69, 6, 38,163,230, 41,230, 3,
-205, 66, 61,164,238,105,103,251,147, 46,199,141,210, 93,203,158,168, 48,201, 24, 38, 89,201,118,183,199,110,127,200, 48,117,174,
- 30, 37,225, 95,252,196,111, 50, 26,116, 25,110, 39,164,233,132,230, 66,135,251,215,238,161,180,162,123,216, 39, 25, 37,100,233,
-132, 48,142,104,207,197, 52, 91, 33,251,123,123,116,179,251,172, 52,226,202,209,100,217,222,217,194,179,154, 60, 43,233,141,123,
-124,226,153,255,136,215,222,253, 93,148,118, 8,218, 88, 73,230,148,100,197, 83,116, 2, 77, 67, 73, 60, 33, 29, 50,118,118, 26,
-151, 26,175,181, 68, 49, 56, 65,120, 30, 22, 69,153, 78, 72,142, 15,169,139,132,181,199, 46, 83, 91, 88,160, 54,183, 68,123,237,
- 28,119,191,250, 23, 44, 92,190,204,184,119,204, 96,247,128,160,217,100,184,119,192,220,198, 57, 26, 43, 27, 72,237,147,244,143,
- 49,249,132,164,119,136,244, 3, 84, 16, 84, 95, 80,131,210, 10,107, 10,215, 1,232,200,221, 88,131, 6, 54, 79, 49,217, 0, 21,
-197, 14,130, 19, 55,137, 58, 75,216,210,208,125,251, 21, 22,158,120, 6, 83,228,116,239,190, 75,247,230,235, 8, 81,114,249,163,
- 31,103,116,120,196,123,175,190,193, 11,159,254, 48,173,245, 43,220,122,229, 13,154,205, 26,243,171,203,140,246, 79, 72,118,182,
-208, 50, 97,225,226, 34, 27, 31,120,158,198,202, 26,251,247,182,217,121,247, 22,113,163, 70,109,113,149, 91,111, 63,164,233, 71,
- 68, 81,131,249,181, 22,199,187, 99, 70,135, 7, 60,243,226,211, 44,157,223, 36,153, 88,118,110,223,161,119,212, 69,202,140,245,
-203,171,100,185, 79,175,223,163,183,187,205,198,179, 79,128,110,227, 47, 62, 78,122,124, 64, 35, 28,208, 94,232,176,254,204,167,
-185,249,167,127,200,171,191,242,207, 89,126,226,105,254,240,159,253,125,234,237, 54, 91,215, 94,195,143,106, 40, 45,200, 39, 99,
-146,225,132, 60, 75,209,158, 79,212,104, 51,216,223, 35, 25,141,153, 91, 95,166,181,180,132, 45, 44,233,120,226, 10,254,104, 80,
- 9, 82, 44, 73,119, 72, 84,171,147,167, 5,189,157,125,138, 44, 71,150, 5, 75, 31,124,137,166, 23, 48, 39, 60,218,202,167,141,
- 98,222, 42,234, 82, 19, 42,133, 42, 29,228, 64, 84,102,137,153,239,220,156,142,126,165,100, 54, 38,157, 58,163,148,148,108,254,
-205,191,199,242,119,254, 16,166,232, 34,188, 58,136,154, 43, 92,249, 24, 51, 25, 80,142,135, 36,253, 33,163,131,125,142,238,223,
-163,183, 87, 21,244,209,128, 60,207, 92, 80, 66, 89,146, 37,185,179, 34, 41,143,191,241,207,255,123,252,193, 9,230,238, 3,202,
-222,128,114, 48,161, 28, 13,201,122, 39, 36,199, 93, 38, 39, 61, 76,145,186,155,133,181, 20,227, 33,233,238, 14,249,206, 67,216,
-221,133,145,139,194, 36,155,224, 9, 73,208,104, 32,194, 24, 58,115,168, 40, 34,136,107,232, 90, 13, 86,150, 92, 81, 56,238,186,
-199,140,135,208,237, 34, 6, 39, 72,223,231,145,159,252, 31,192, 26,164,117, 68, 57,107,157, 2,223, 20,229, 44, 12,110, 26,254,
- 34,236, 41,222, 73, 76, 49,166,102,250, 30, 58,203,204, 52,168,196,150,149,163, 96, 90, 96,167, 49,234,165,157,237,139,167,161,
- 48,179, 84,182,234, 96, 49,253, 55,107,237,108,223,109,166,191,219,158,218,193,172,117,147, 0,236,140,247, 59,243,123,219,106,
- 47,111,170, 85,129,244, 22, 8,230,175,160,195, 22, 84, 33, 44,152,234,231,102,221,205,105, 24,222,236,191,234,176, 55,195,182,
- 22,230, 52,233,206, 48, 59, 72,204, 20,240,150,247,173, 45, 40,221,107,112,175,123, 10,197, 19, 51,205,221, 12,151, 53, 77,186,
- 19,103,108,107,179,247,204, 84,253,192,212,239, 62,189,118, 29, 94, 52,220,184,130,191,186,234,118,145, 91,175, 98,181,162, 40,
- 27,140,109,196,193,206, 33,201,201,128,254,225, 8,221,108,224,251,138,143,174,197,200, 34,227,198,239,126, 13, 99, 18,138, 44,
- 67, 9,203,240, 40, 33,203,224,176,155,112, 52, 54, 24, 43, 56,232,141,169,231,117,246,135, 9, 90,107,110,157,164,172,182,125,
-118, 78, 50, 46, 46, 4, 14,161,108, 45,251,189,132, 44, 43,120,120, 56,225, 75,183,123,220, 57,201, 88,108, 4,228,133, 33, 43,
- 12,151,151, 99, 58, 11, 13, 60, 95, 32, 60, 5,126, 68,216,233, 32,181,118,169,128,217, 4,178,130, 98, 56, 66, 9, 15, 63,110,
-224, 69, 49,126,179,129,174,133,179,192, 35, 99, 4,129,182,212,125, 65, 39, 84,164,133,161, 59,201, 25, 39, 37,190, 47,241,124,
- 73, 45,244,153,175,233, 10, 77,102, 40,242, 2,107, 5,191,125,227,136,197, 32, 96, 99,161,197,243, 79,158, 39,110, 54,136,234,
-209,108, 2,228,249, 62, 58, 8,145, 74,163,149,225,193,245,111, 18,215, 34, 76,225,174,179,105,210,152, 61,216, 34,124,253,255,
- 99,238,157,175,179,232, 91, 58, 75,115,120,145, 79,153,103, 36,163, 1, 69,158, 97, 41,157,152, 15, 55,237, 49,184,157,185, 41,
- 75,138, 34, 37,155, 36, 20, 69,225,174, 79, 83,160,125,143, 70,123,209,161, 87,125,237, 86,180,214, 56,232, 74, 28, 18,132, 2,
- 47,242,120,240,202,203,116,191,244, 5,228,252, 42, 38, 29, 16, 43, 69, 40, 20,129,148, 8,227, 14,130, 74, 88,116, 5,108,169,
-152, 59,164,105, 74,146,140,157,234,168, 48,228,165, 33,207, 10,138,124, 22,161,230, 38,208,210,249,202,125, 37,171,104,106,133,
-176, 5,201,120, 4,198,141,240, 3,101,249,175,255,206, 63,161, 40, 74,138,220, 98,201, 57,217, 75, 8, 26, 13, 86, 30,217, 68,
-123, 62, 71, 15, 15,201,179,140,122,179, 65,187, 21,145, 76,142,120,237, 27,111,210, 75, 13,176,194,131,129, 96,187,215,163, 59,
-206, 57,127,245, 28,194,247, 25, 39, 35,212,164,100,103,255, 30,223,255,226,223, 39,176,174, 75,143,133, 96, 94,107, 26, 74, 17,
- 9,137,135,112,161, 73, 70,160,126,230,167,126,236,179, 94,224,163, 26,171, 60,252,242,159,208,185,124,213, 65, 55,202, 2,161,
- 52, 65, 20,179,244,196,115,136,176,206,248,240,144,225,209, 30,201,112, 76,222,239,209, 63,216,161,223, 61,113, 70,249, 48,196,
- 98,136,230, 90,248, 81,141,254,238, 54,218,247, 81,218,195,150, 57, 97,103,201, 41,117, 85, 8, 69,130, 8,106, 80,100, 8, 47,
-194,230, 35,178,222, 30,202,143,201,123,123,168, 90, 11, 12,148,201, 8,148,100,184,119, 23,105, 75, 26, 23, 63,200, 96,235,182,
-251, 96,181, 79,235,209,103,233,221,187,199,171,191,243,111, 89,190,180,129,200, 82, 54, 63,242, 34,183, 95,126,133, 90,189,198,
-226,197,115,236,223,123,128,239, 7,120, 97,140, 14, 74,154,107,231,120,248,206, 77,142,183,119, 81,218, 77, 15,122,189, 99,238,
- 94,191,195,193,187,223,224,219,127,228,251,153,244, 83,252,120,142,187,215,222,100,105, 99,142,160, 22,177,115,103,151,210,100,
-140,142, 6, 52, 23,157, 34,116,119,235,136,163, 7,119, 88,185,176, 78, 50, 73, 49, 54,101,212,155,160,205,152,214, 82,131,168,
-181, 66,251,210, 71, 72,135, 19,134,219,175, 49,255,216, 11, 92,250,196, 15,112,112,251, 58, 81,125, 25,169, 53,111,252,193,191,
-229,234,119,124,154,173,235,215, 9,234, 77, 38,131, 1, 97,189,134, 23,132, 28,220,121, 23,173, 67,164, 80, 44, 63,246, 56,251,
-247,238,114,245, 19,223,198,201,254, 62, 71, 15,247,144,158,156, 49,193,157, 98, 86, 99,203,140,162, 44,240,131, 24,237,107,118,
-255,240, 55, 81,227, 17,190, 16, 46,152, 64, 57, 64,129,143, 66, 9, 39,242,144,246,253,106,238,169,231,125,150,206,101, 69,117,
-210,118, 5, 98,225,147, 63,192,229,255,242, 31, 99,242, 99,132,174, 33, 68, 0, 34,133,164, 75, 49, 28,144, 14, 78,232,239,237,
-210,219,218,162,183,189,203,104, 52,100, 60, 26, 51, 25, 12, 41,171, 34,121,202,246, 46,200,135, 41, 63,248,223,253, 44,188,125,
- 13,115,216,163, 24, 14, 41, 39, 19,242,225,128,180,223,103,210, 27,146,167, 19,119, 77, 10,129, 20, 18, 79,107,108,150,145, 15,
-251,244,183,238, 98, 7, 99,194,197, 5, 8,131, 74,152,151,159,250,199,106,117,228,120,130, 73,134,168,160,134,188,112, 17,178,
- 28,187,179, 77,121,124,136,244, 35, 24, 15,177,189, 46, 54, 12,104, 60,245, 33,246,254,224,215, 41,198,195, 42,159,220,206,130,
- 77,167,156,102,113,166,141,181,239, 27, 39,115, 38,200,229,253, 49,160, 2, 49,227,235,219, 51,140,231, 41, 29,235,253,196,180,
- 51,227,233,106, 8, 63, 67,211,136,211,224, 25, 41,167, 67, 0,241,190,128, 20,135, 96,172,194, 93,228, 25, 82,144, 61, 5, 5,
-233,134, 83,255, 23,163,221,169,145,254,125,203,121, 59, 93,199,156,161,217,185, 83, 94, 37, 0, 52,230, 76,103, 95, 37,212,153,
-211,132, 58,196, 89,235,218,169, 72,144,106,210, 35,181,152,237,214,167,135,253,233,123, 45, 43, 47,180,168, 80,187,167, 10,121,
-102,180,191,217,182, 64,156,177, 12, 10,139,191,176, 74,235, 67,223, 75,184,190, 70,222,235, 82, 92,251, 85,100,220, 32,235, 15,
-217,127,112, 64, 58,201,233,238, 30, 50,238, 77, 80,166, 96,117, 41, 98,161, 41,104,118, 60,130,133, 38,195,189, 49, 38, 53,244,
-183, 78,232,110, 15,200, 75, 56,233,166,188,186, 59,230,197, 15, 60,198,185,143, 61,141,127,229, 18, 58, 31,243,230,219, 15,153,
-111, 5,236, 14, 11,186,105, 73,164, 64,107, 69, 89, 88,134, 89,137, 18,130,135,227,146,229, 78,140, 39, 93,100,167,167, 37,155,
- 45,159,139,155,117,226,249, 54, 74, 25,194, 86, 27, 63,170, 99, 61, 69,216,106, 98,134, 3,188,168,133,212, 6,225,105,116, 16,
- 83,102, 9, 69, 50, 38,157,140,145,218,167, 72, 83, 76,146, 83, 20, 25,227, 65,142,181,134, 97,238, 70,239, 75,117,159, 86,205,
-169,209,251,227, 12, 63,246,121,126,185,142,174, 62,131, 81,110,249,249,175,110, 97,138, 18,169, 36, 31,126,234, 18,235,231,214,
-137, 26, 45,234,157, 14,158,214,232,192,195,243, 67,194,206, 60,113,103, 1,191,222, 70, 39, 93,214,203, 30,153,177, 85, 17, 49,
-167,224, 41,107,177, 89,138,216,191,135,188,247, 14,209,240,128,120,105, 25,175,214, 64,248,158,235,224, 75,231, 96, 41,242, 18,
- 91,228, 24,225, 86, 89,133, 41, 41, 10,215, 69,219, 34,199,139,107, 68,237, 5,178,241, 9,166,152, 32,164,193, 11, 3,215, 12,
- 74,152,244, 79, 56,220,122,200,193,237,155, 68,181, 38,106,251, 30,222, 83, 47,240,205,223,249,223,104,104, 85,177,216,161,155,
-228,244, 51,195, 56, 47, 41,171, 3,173,113, 8, 5, 23,136,165, 4, 30,146,186,175,152,211,154,197, 40,160,166,149, 83,191,139,
- 51,185, 14, 74,161,116, 72,150, 77, 40,172,211, 78, 28, 21, 32,116, 76,154,140,241,148,228, 71,190,243, 39, 73,242,132, 34, 21,
-100,227, 33,155,207,174,178,253,102, 31, 41, 36, 7, 7, 7, 44,172, 52, 73, 79, 82,246,118, 14,208,254,132,183,175, 31,113,109,
-247,144, 79,127,104,135, 70,123,192,176,216, 97,175, 91, 48, 24, 75,190,114,227, 27,220,207, 95,227,217,213,143,178,191,183, 71,
-189,214,164,214, 92, 70,137, 46,197, 96,135,182, 84, 44,123,146, 78, 88,163, 89,111, 33, 43,235,162,210, 2,245,211, 63,249,163,
-159, 13,154,115,236, 92,123,133,149,103,159,103,124,180,143,246,124,178,113,159,100, 48,196, 74,129,210, 62,199,119,110,226,213,
-106, 72,229, 1,150,122,103,158,230,194, 2, 11, 27, 27,196,173, 22,233, 56,113,251, 18, 37,241,235, 29,154,235,231, 56,124,247,
- 29, 22, 30,125, 2, 29, 53, 42,240,139,196,154, 2,233,249,167, 40, 77,169, 41, 78, 14,240,219,115,152, 44, 67,135, 77, 76,158,
- 56, 47,100, 62, 66,121, 17, 65,163,131,244, 20, 7,239,188, 65,173,213,196,111, 52,177, 6,246,174,191,202,245,207,255, 25, 31,
-255, 91, 63,132, 80,154, 90,187,195,173,191,248,170, 75, 84,203, 18, 78, 14,247, 8,107, 77,252, 90,157, 90,187, 73, 92,107, 51,
- 30, 28, 51, 60,232,115,114,124,192,100, 52,226,250,203,175, 82,164, 93,222,249,250,117,190,243,135, 94,228,104, 39,165,179,214,
-225,193,219,123,116, 58, 17, 11,155,235,220,190,177,195,225,253, 55, 56,127,229, 50,101, 2,205,229, 14,219,119,118,105,196, 30,
-151, 95,120,150,131,135,125,154,205,136,218,194, 18,217, 36,101,112,210, 39, 55, 49,195,147, 9,135,183, 94, 35,235,109, 19, 47,
- 94,228,202,119,253, 0,152,146,133, 75, 79,240,141,223,250, 21, 62,248,195,127,157,238,221, 59,188,251,239,191,200,179,159,249,
- 12, 15,222,120,149,249,245,243,220,125,253, 27,132, 81,157, 60,207, 43,171,142,196, 15, 66,230,206,109,114,124,255, 33, 11,231,
- 54,220,205, 43, 8,232,237,236, 51,191,185,234, 4,103, 89, 73, 84,143,193,106,146, 65, 31,161, 61,194, 48,166,255,218,159, 33,
- 10,131, 39, 37, 26,137,178, 10, 37,156,175,222,225, 65,245, 41,235, 76,128, 49, 37, 90,169,106,183, 36,145, 82,224, 55,214, 16,
-218,195,171, 71, 60,247,175, 63,239, 10,186,215, 64, 8, 31,203, 24,210, 1,217,241, 49,147,238, 17, 39, 59, 59,140,142, 14,233,
- 29, 30, 49, 25, 15,201,210, 9,101,150, 83,148, 37,101, 89, 98,203, 2, 42, 66, 85, 45, 8,248, 43, 63,247, 15,224,141, 87,177,
-189, 97, 85,208,199,228,253, 33,105,175, 71,218, 63,193, 20, 5, 20,185, 43, 92,133,193,230, 19, 55, 53, 48,134,116,216, 35, 79,
- 71, 36,163, 30, 50, 43, 9, 86, 54, 32,208,144,164,144,101, 14, 67, 27,134,160, 61,202,131,125,116, 24, 32,215,207,195,225, 33,
-101,247,136,116,235, 33, 55,254,233, 63, 97,252,202,171, 4,245, 24,127, 97, 30,163, 20,171,159,249,207,120,248,107,255,234, 76,
- 90, 29,179,244, 54, 23, 71, 91, 21,146,233, 78,187,114, 12, 8, 59,197,180, 86,163,111,121,182,216, 58,182,187, 43, 92,178, 82,
-123,159,197,193,158,254,236, 84,120, 55, 85,214, 78,193, 46,103, 93,104,162, 82,141, 79, 11,182, 61,205, 45, 61, 21,186,137, 51,
-145,169,149,128,175,138,119,161, 76, 70,148,227, 67,132, 41, 78,189,239,179, 83,201,116,164,125,122,224,152, 6,175, 8,115,170,
-202,183,156, 25,171, 59, 39,221, 76, 36, 56, 93, 29, 76,255, 96,123,230,125,152, 30, 68,100,229,111,159, 30,104, 68,149, 54,101,
- 75, 51,123, 13, 51,191,253, 25, 12,239, 76, 10, 50,221,119,136,233, 33, 71,160, 26,115,180, 94,252, 62,188,154, 79,126,114, 72,
-254,246,239, 67, 28,113,244,112,151, 65,119, 68,154,102, 12, 15, 78, 40,203,146,149,115,243, 68,117, 77,115, 46,162, 53, 23, 35,
-132,102,247,221, 99, 70, 71,125, 90,155, 77,172, 45, 24, 14, 75,114, 32,247, 91,124,255,207,252, 56,209,230, 26,178, 94, 99,253,
-185,231,184,242,161,171,244, 15, 15, 25, 15,199,212,180,224,126, 63,231,222, 48,163,192, 34, 61, 15, 35,160, 21,249,156, 36, 41,
-131,180,164, 17, 40, 86,155, 1,143, 44,215,240,125,141,212, 78,215, 17, 47, 47,163,180, 71, 62, 30, 81,228, 41, 94, 92,171,240,
-187, 2, 91, 22,104, 63, 36, 27,118,145,158,143, 80,154, 52, 43, 0, 73, 50, 28,211, 63, 30, 3,150,113,102,104,250,146,166,175,
- 8, 35,143,249, 88,147,102, 37,239, 28, 39, 60,182,212,224, 92,211, 67, 43,201,155, 7, 41,159,253,247,119,153, 36, 5,245, 32,
-224, 7, 95,250, 48, 75, 27, 27,120,194, 18,215, 98,130, 90,157,168, 53, 7, 66, 98,202, 2, 29,132,132,141, 57,188,168,206,228,
-164,207, 98,189, 32, 27, 12,206,196,253,150,213,122, 71, 85,215,170, 99, 68,152, 36,197,108,223,230,255, 39,235,205,191, 36, 75,
-239,242,206,207,123,247,123, 99,143,220,215,170,202, 90,187, 90, 85,213,251,162,214,214,218, 90,107,131, 64,131, 25,195,193, 24,
-105,102,108, 60, 22,155, 48,231,128,193, 26,251,224, 25, 97,207, 97,236,115,134, 49, 96,192,204,193, 99, 4, 70, 8,109, 52,146,
- 90, 75, 75,234,150,122, 95,106, 95,178, 42,247, 53, 50,246,136,187,190,239,252,112,111, 68,100,219,127, 64,102,101, 86,222,184,
-239,251,125,190,207,243,124,244,205,235,152, 27,203, 56,189,125,138,229, 50, 70, 46,143, 93, 44,166,255, 63, 73,146,249, 32,116,
- 12, 75,199,241, 92, 92, 55, 71, 24,245,120,253,185, 47,112,251,149,111,227, 20,198,169,109,110, 81,223,217, 98,235,246, 50,123,
-183,111, 17,244,251,184,133, 18,110,121,156,138,151, 71,107,214,185, 19,117, 88,127,225,105,138, 86,106,248,142,165,228,160, 31,
-211,149, 58,113, 34, 73,148, 36,136, 21,177, 74, 5, 11, 33, 82,165,210,182, 52,114,134, 70,201,177,152,112, 61,114,134,129,173,
-155,232,218,232,146,109,186,147, 96,228, 8,252, 22,113,146,208,141, 5, 78,245, 40,249,226, 4, 23,142, 63,198,147, 15,255, 50,
- 55,175,172,208, 63,104,224, 22,139, 24,186, 65, 80, 87,228,202, 54,219,171, 7,105,203,101, 47,102,237,246, 22,243, 75,147,236,
-110,183,184,124,103,151,223,251,219,143,113,230,177, 71,185,239,189,239,224, 29, 79, 60,194,227,239, 58,194,125,247,187, 36,189,
- 58,127,248,252,101, 26,157, 91, 76, 89,199, 88,223, 94,133,216,224,241,247,124,130, 59, 23,255, 11,227,166,206,152,105, 82,173,
- 78,227,218, 69,132,223, 28,174, 4,245,223,250,245, 79,125,102,247,198, 69,186,187, 53,198, 78,158,164,185,124, 13, 97, 89,120,
-149, 9,246,175, 95,198, 43,231,216,120,237, 21,170, 11,179,108, 92,186,200,237,215, 95, 70, 83, 33,110,121,156,214,206, 38,221,
-131, 90,154,161,211,109,204,188, 75,229,244,189, 4,141,125,162,126,159,242,226, 9,174,127,251,105, 38, 78,156, 68,169, 36,125,
-225, 9,145,186, 89,179,134,174, 36,232,164, 5, 6,154,137,102,229, 16,186,133, 72, 66,100, 18,165, 89, 89,187,204,193,181, 87,
-177, 61,143,252,204, 28,134, 87,198,111, 28,176,123,245, 50,243,247,220,143,165, 41,202, 71, 23, 8, 58, 33,183, 95,124,145,198,
-250, 26,186,104,145, 43, 78,211,173,173, 81, 91,190,195,216, 98,145,194,212, 28,237,122,139,126, 43,228,230,149, 91,236, 44, 95,
-102,102, 97,142,205, 91, 53,146,246, 26, 15,188,253, 2,222,228, 41, 26, 91,171,140, 47, 29,103,127,117,157,241,185, 9,174,188,
-124,139,176,182, 73,101, 12, 42,115, 11,216,185, 50, 55,223,184, 78,210,111, 48,115,234, 8,181,173, 3, 38, 22,102,176,189, 34,
-245,189, 26,221,102, 31,191,219, 39,108,238,144,244,219,180, 26, 77,172, 98,145,211,239,251,113,116, 77,176,119,123,141,177,197,
- 25,194,190,100,235,202, 21,238,253,209, 31,195, 27,155, 33,137, 66,138,147, 83,200, 56,166, 52, 57,193,246,181, 27,204,223,115,
-158,230,230, 38,253,102,147,201,227, 71,105,109,111,146,190,127, 19, 52, 77, 67,211, 12, 44,199,193, 27,171,208,218,218,198,176,
- 45, 12,215, 33, 14,186,216,165, 18,221,189, 61, 74,199, 78,178,246,151,127,136,150,229,177,211, 22,247, 36, 59, 68,180,116, 31,
-173,101,135,133,166,167,134, 56, 67, 31, 94, 38, 6, 47,120, 73,130, 12,187, 60,252, 23, 47, 35,244, 62,194,240, 16, 88, 40, 2,
-146,198, 14,157,141, 85,122,141, 26,141,221,125,154,187,251,116, 90, 45, 2, 63, 72,225, 58,137, 76, 95,220, 50, 73,169, 90,137,
-164,215,237,115,108,118,158,199,126,233,151,225,181, 31,162,106, 13,162, 78,135,164,215, 33,104,182,240, 15, 26, 68,221, 54,178,
- 31, 34,131,104,196,103,151, 17,132, 9, 68, 33, 97,175, 71,228,119,209, 45, 29,195,180,240, 59, 13, 28, 51,143, 49, 49, 5, 82,
- 34, 59,157, 84,198, 46, 87,210,195,164,151, 66, 98,180,185, 5, 26,127,242,199,124,239,231, 63,205, 43,159,251, 2,173,131, 6,
-235,203,183,217,252,202,183,176,191,253,109, 10,247,188, 5, 99,233, 36,113,179, 65,235,242, 43,135,135,205, 76,113, 86, 12, 2,
-102,106,144, 77, 23, 35,128,202,168, 94, 78,140, 0, 48,140,106, 94, 7, 99,167, 28, 24,235, 6, 52, 52,149,161,152, 6,133, 44,
- 89,167, 58, 98,176,239, 62, 68, 68, 19,135,138, 99,134,135,166, 24,242,208, 15,145,236,179,131, 87, 28,114,206, 51,228,207, 15,
-254, 89, 41, 71, 40,221,129, 1,110, 0, 71, 81, 74, 12,191,126,196,176,207,158,143,195,178,122,170,197,141,126, 62,245,230, 22,
-194, 33,122,245,240,207, 51,136,174, 9, 45,253, 25, 6, 74,198, 0,154,195,168,122,115,196, 73, 31,229,255, 68,118,163, 16,140,
-190,135, 61,181, 64,233,161, 15,163, 27, 33, 50, 12,233,191,242,119, 96, 41,246,239,212, 8, 98, 65,216,245, 81, 10, 76, 13,188,
-162,129,174,235,232, 42,192, 0,188,177, 28,126,163,199,254,158, 79,107,183,203,234, 74,159, 40, 78,216,235, 73, 78,222,127,146,
-249,199,222, 69,212,237,141, 76,131,186,193,137,119, 62,206,198,203,175, 48,230,194,137,233, 60,167,166,242,204, 85,139,140,121,
- 90, 90,144, 36, 83, 26,162, 46, 52, 22,171, 57,138,142,134,231,166, 89, 70,203,214,241,138, 30, 7,119, 86, 17, 90,156,238,159,
-181,148,244,167, 9, 32, 17,132,157,110, 42, 93, 11, 29,195,205,147, 72, 69,212,233,209,111,180,232, 55,122,132,126, 52,236,214,
- 47,228, 77, 12, 67, 67, 87,138, 56, 81,116,253,132,213,110,194,163,139, 69,166, 43, 14,127,240,210, 14,223, 89,235, 82,180,109,
- 44, 29,206, 47,205,145,119, 13, 92,219,160, 52, 62,134,101,154,233, 69, 52, 9,144,113,152, 81,211, 44,204, 66,137, 94,109, 31,
-199,210,177,140,144,222,214,206,240,178,155, 38,113,178,238, 0, 41, 65, 31, 1,139,132, 38, 72,226, 4,165, 18,146, 94,135,112,
-253, 22,114,249, 34,234,198,235,104,235, 87,209, 54,174, 98,236,173,145,108, 94,161,121,249, 57, 86, 95,122,154, 23,190,251, 69,
- 94,120,225,235,236,108,222,198,213, 96,108,238, 46,162, 56,198,208, 83,165, 75,211, 52,220, 98, 9,195,205, 81,154, 63, 69,240,
-204,151,201, 29,189,139,207,253,231,207,226,169,136,188, 97, 96,106,130, 32, 86,212,125, 73, 63, 81,132,113, 72, 55, 82,132, 50,
- 99, 96,100,162,147,134,192, 18, 26, 5, 75, 99, 58, 95, 98,204,245,168, 84,166,113,115,101, 84,208, 29, 90, 73,164, 18,132,189,
- 70,234,241, 74, 4,230,216, 81,204,252, 52,170,215,101,105,230, 35,188,246,194, 27, 20, 10, 37,208, 97,243,234, 38,165,241, 50,
-166,229,208,239, 69,180, 27, 61,226,110,196,246,157, 61,252,176,143,102,134,188,118,121,147,223,252,211,247, 83,154, 59,146,158,
-131, 73, 76,216,237,226,135, 49,113, 16,115,223,163, 15,240,196,133, 37,126,231,139,223,225,109,115,119,147,179, 43, 36,232,244,
-187, 77, 78,189,229, 73,226,245,167, 41,154, 6,182,110,129,223, 65,197,254,112,211,166,255,234,207,255,204,103,170,199,207, 50,
-118,252, 36,237,245, 53,138, 11,139,172,191,244, 3, 18, 5, 83, 39,206, 18,135, 1,149,217, 57,116,203, 67,200,132, 19, 15, 62,
- 66,229,200, 18,219,151,222, 64,119, 60,114,227, 19,233, 75,186,177,207,212,133, 7,184,250,165,191, 97,242,204,105,146, 48,162,
-189,181,202,204, 91,222,146, 86,188, 22,198,144, 65, 15,205,118,135, 70,156,164,215, 64,152, 14,194,180,144, 9,244,118,110, 99,
-122, 57,100, 20,160,123, 69, 52,187, 74,119, 99,153,210,252, 44,122, 97,156,164,211,225,218,183,190,193,214,245,215, 56,241,240,
-163, 68, 65,148, 70,171, 12,135,171, 79,127,139,233,227,199, 48,117,131, 99, 15,191,141,253,219,171,156,121,252, 29,204,221,245,
- 0,227, 39,238,166,190,177, 67, 20,198, 52,182,235,176,219,225,196,169, 41,188,201, 9,130,221, 46, 51,139, 21,142, 60,120, 31,
- 65, 71, 49,123,234, 20,123,107,219, 40, 41, 89,189,181,134,163,133,228, 74, 30, 71,206,223, 75,123,191,203,250,237, 85,108, 25,
- 99,121, 58, 81,208,103,127,103, 5, 43,231,177,179,177,207,206,218, 6,145,191,207,236,145,105, 44,183,192,228,217,199,152, 92,
-186, 64,109,117,149, 36, 8, 57, 88,221,166, 83,223, 99,108,225, 24,249,169,113, 76,199,163,182,178,193,220,217,147, 68, 97,196,
-254,234, 29, 52,221,196,116, 29,114, 99, 85, 76,199,196, 43, 87,104,239,239, 19,247, 35,202, 71, 23,113, 11,121, 52, 76,182,174,
-223, 96,251,234, 13,166, 79, 46, 17,246,251,180,246, 14,168,204,206,209,219,220, 66, 25, 6,142,231, 96,123, 30,154,237,177,254,
-231,255,119, 42,149,102,221,217,186,174,167,205, 95, 25, 82, 85, 37,153,225, 42, 78,208, 13, 99,100,154,139, 85, 58,121, 1, 66,
-197,156,252,149,127, 75,241,244,105, 16, 58, 66, 56, 40, 18,146,230, 38,141,149,101,234,107, 27,212,247,246,210,189,121,175, 67,
- 24, 4,196,161,159,101,144,229,208,236,164,107,130, 86,167,195,163, 15,220,195,233,159,249, 36, 92,250, 1,106,239,128,168,217,
- 33,233,116,240,235,117,124, 63, 76,119,112, 81,140,150,196, 68,221, 46,186,105,164,238,239, 48, 36,234,244, 82,158,122,191,151,
-174, 80, 12, 11,205, 49,176, 60, 23,191,221, 36, 63,189, 0,158,131,106,119, 82,199,121,185, 12,182,141,136,211, 58,217,110,125,
-159,111,126,228,239, 81,171,120, 84,114, 57,238, 95, 58, 67, 59,232,176, 34,251,212,187,125,106,255,233, 47, 24, 51, 19,166,127,
-241, 55, 89,251,211,255, 43,221, 51,139, 17,184,101, 24, 9, 59, 60, 40,102,210,250,176, 42,117, 56,160, 14,118,202, 42,155,222,
-197,208,212,165, 29,154, 92,165, 84,188,169,158, 69,140,128, 49,131, 23,144, 58,100,178, 19,135, 48,174,169,177,114, 48,176,106,
- 8, 61,159,237, 91, 51,198,251, 97, 89, 61,131,174, 28, 46,192,145,114, 16, 95, 60, 92,189, 58,248, 58, 49,146,211, 7,215, 1,
-205, 70,232, 78, 74, 86,203, 80,173,163,134, 55,134,207,153, 56,124,241, 24,200,238, 67, 68,219, 40,171, 55,194,201, 50, 58, 44,
-130,139,136, 0, 0, 32, 0, 73, 68, 65, 84,168,179, 62,248, 65,249,206, 32,113, 49,116,208, 15, 11, 1,228,208, 19, 2,233,100,
-111, 86,166, 41,220,247, 78,116, 67,161, 91, 14,254,230, 50,253,230, 6,126, 87,209,237,135, 4,109, 63,237,217, 46, 57,136, 68,
-165,135,151, 70,106,220, 82, 9,150, 99,224, 86, 43, 88, 57, 11,221, 54, 48,138, 30, 86, 62, 71,115,127, 31, 67,139, 41, 46, 30,
- 71,166,187, 8,250,245, 58, 23, 63,247,103,140, 79,186, 76, 46,205, 83,156, 24, 99,230,244,113,102,239, 62, 78,117,172, 72,193,
- 54,176,117,157,188,109, 80,114, 76, 60, 71,167, 90,117,201,149,115, 68,126,128, 83,204, 17,246,250,152,174, 77,208, 9,240, 59,
-109, 12, 59, 45,150, 73,194, 84, 82,151, 73, 72, 18,197, 24,142,135,210, 12,146, 80, 34,209,209,221, 28,253, 70,139, 36, 78,208,
-205, 84, 89,179, 61, 11,164,194, 72, 9,170,236,116, 34,148,105, 99, 42,193,255,254,252, 54,187,173, 16, 67, 40,234, 61,159,163,
-211, 19,204, 85, 11,204,204, 77, 83, 40, 22,112, 60, 15,183, 84,193,178,109,164, 82,232,186,158,149, 93,229,176, 28,151,160,219,
- 99,188,168, 19, 55,182,137,235, 7, 35, 15,142,202, 90,100,212,200,152, 57,120,134,147, 88,142, 60, 17, 3, 14, 69,150,120,144,
- 65,128, 10,122,196,157, 38, 65,187, 65,232,247,104,245,125,218, 42,166, 27,198,104, 89,179,218,236,201, 71, 8,250,221,116,101,
-163,137, 84, 49,116, 61, 44,211,164,114,244, 44,221,167,191,200,226,199,254, 1, 79,253,245, 31, 48,102, 89, 20,244, 20, 59, 29,
- 39,138, 94, 24,211, 11, 34, 90,145,164,151, 12,160, 46, 35,115,171,161,137, 20,192, 98,104, 76, 57, 6, 37, 77,226,234, 58,102,
-226, 35,146, 48,101, 41,160, 82,150,123, 18,129,210,211,250,237, 56,198,111,238,178,178, 49,198, 43,175, 94,225,174, 15,174,241,
-248,199,223,206,149,167,246, 9,101,143,201,217,113,208, 4,221,122, 72,183,221,102,111,101,155, 90,167,129,109,232, 52,155, 1,
-103,223, 99,243,214,143, 63,153, 94, 94,227,144, 36, 14,144, 74,162,226,152, 4, 69, 24,132,140, 77, 77,241,225,243, 39,248,163,
- 47,124,151,211,147,199,232,251, 1,248,130,233,227, 11, 56, 42,193,104,223,198, 72, 34, 68,226,103, 43,211,244,111, 96, 56,165,
- 50,194,202, 17, 55,246,112,242, 46,253, 90,157,169, 83,119,177,123,253, 13,220,156, 75,237,214, 77, 22, 30,124,132,205,215, 94,
- 99,242,196, 81,122,205, 38,189,253, 61,138, 19,227, 20,103,230, 56, 88, 93, 37,234,245,152,187,247, 1,154,183,151, 57,246,232,
-195, 4,141, 58,118,121, 28,183, 84,161,223,170,227,150,203,196,221, 54,186,109,167,110, 88, 51, 71,210,111,142, 98, 67, 88, 36,
-157, 13,114,147,115, 4,205, 3,172, 82, 25, 52, 11,229, 55, 82, 7,164,233, 16,181, 90,220,126,238, 89, 38,230,102,169, 44,222,
-143, 94,157,225,230,215,190, 70,105,122,130,231,255,242,175,120,203,187, 31,101,251,242, 13,102,207,156,100,245,149, 75, 76,157,
- 62,138, 89, 24, 99,229,165,203,172,126,245, 34,174,103, 83,223,222, 5, 91, 82, 58, 51, 78, 32, 33,175, 27, 28,125,240, 60, 73,
-208,166,189,219,194,200,151,217,184,185, 74,183,213,164, 89,235,160,197, 61,156,138,205,248,226, 34, 91, 43,219, 92,124,238, 69,
- 30,249,224,195,196, 93, 23,219,149,212,107, 17, 11, 75, 5, 20, 6,177, 47,113, 36,156,126,244, 2,205,253, 16, 97, 79, 32,123,
-109,132,105, 80,153, 90, 96,237,181,151,137,227,136, 56,236,163,155, 30,149,249, 89,202,147, 99,152,182,205,218,197, 43,204,156,
- 56, 65, 18, 70,180, 54,182,104, 30,108,115,254, 3, 31, 98,127,101,141,210,212, 4,147, 75, 75,212, 55,182, 72, 46, 94,199, 42,
- 58, 40,191, 75, 28,166,101, 52,175, 61,245,117, 22, 46,156,195,246, 60,110,191,248, 60,205,205, 26,119, 61,254,104, 26,111,115,
- 93,132, 46, 40,222,117, 47,237, 43, 47, 35, 85, 74, 68, 84, 34, 53, 55,141,202, 64, 52, 52, 5, 50,155,188, 68, 38,229, 10, 51,
-173,136, 69,128, 85,169, 50,253,196,143,163,100, 27, 77, 43,161, 84,159, 96,127,133,221,203,151,233, 53,154,244, 58,109,250, 81,
-132, 74, 36, 73, 28,167,196, 49,203, 64,134,169,185,101, 32,175,182,155, 45, 62,250,193,247,227, 62,246, 94,184,249, 34,236, 30,
- 16, 55, 59,196,237, 22,129, 76, 8,247,246, 17,175, 94,198, 88,222,100,125,175,193,213,126,128,117,100,150, 40,150,196,181, 38,
- 75,199,166,153, 58,179,128,233, 24,217,207, 45,211,246,170, 36,141,192, 72,191, 75,239,250,117,188,123, 46,164, 83, 82,183,141,
- 30, 70, 96,187,224,229, 16, 81, 68,239,198, 85, 90, 69, 15,219, 48, 24,119, 61, 10,213, 41,142,180,155,236, 70, 1,243,165,113,
-174,170, 45, 42,255,241,207,153,219,171,113,238,119,255,130,215, 63,245, 99,164,229,203,153,204, 61,112,133,101, 19,102,106,216,
-146,195, 70, 56, 45, 59,113,213,155, 86, 26,153, 52, 63,112, 27, 14,138,223,196,168,169, 78,161,134, 85,175,135,209,110,137, 28,
- 29,106,195,154,216,129, 15, 66,100,102,188,108,106,178,138,147,232,206, 20, 81,235, 6, 50,236,101, 81, 58,134,198, 59, 53,168,
- 0, 83,135, 47, 36,163,230, 60,153,229,231,211,226,161,140,237,158, 72, 72,196, 48,202,103,152, 70,250, 77,165, 28, 85,201, 30,
-166,213, 13,255,141,180, 9, 79, 73,144, 42,201, 46, 7, 35,167,127,122, 39, 73,208, 50,133, 72,100, 13, 98,131,110,252,209,110,
- 62,203,198, 75, 9,186, 62,220,173,203, 68, 13,235,113,213,176,247, 61,129,230, 58,154,229,131,150, 67,245,235, 56,167,238,165,
-245,229,103, 16, 86, 9,132, 70,126,162, 76,208,241,137,163,152,176,211, 69, 55, 0,105, 98,154, 17,253, 86, 31,211,214,209,133,
-201,244,131, 15, 49,107, 87,232,212, 27, 72,203,193,239,251,180, 55, 55, 89,126,234,175,209,221, 66,150,197, 55, 56,253,182, 71,
- 9, 58,109,132, 80,196,113,136, 87,172, 16, 52, 26,228,242, 57, 90,236,224,104,138, 78, 44,209,101,146, 78,186,166, 65,216,233,
- 99,154, 38,221,122, 27,149,196,148,167,198,176, 11, 58, 81, 47,224, 96,117, 23,219,243,176,139, 54,166,174,163, 59, 69,132,140,
- 80, 82, 96,122, 69,116, 23,194,122,139,218,202, 38, 65, 18, 35,116, 65, 20,164, 49,173,126, 55, 4,161, 17, 69,138,141, 90,159,
-134,150,163,157, 36,252,187,215,183,152,176, 12,198,115, 46,154,109,241,224,220, 12,243, 83,101, 22,102,199,176, 77, 19,195, 48,
-176,189, 28,118,161,152,118, 94,244, 90,232, 78,234,176, 55,242, 37,208, 76,208, 76,156,178,141,127, 77,162,226, 4,161,235,233,
-223, 64,211, 51,246,130,202,158,145,244,221, 18,199, 25,211, 94,101,172, 0, 93, 79, 13,209,114, 20,123, 28,122, 64, 18, 69, 24,
-167,123,239, 48,202,192, 60, 9, 72,191,143,145, 52,211,181,145, 76, 99,211,134, 97,227,150,202,233,179,216,216, 65, 34,216, 55,
- 5,229,252, 24,166, 30,163, 9,137, 46, 4,102, 22, 51,211, 52, 72, 80,196, 3,243, 37,105,177,141, 97,100, 26, 79,102,238,140,
-101,132,134,133, 12,123, 72,149,174, 18, 52,109, 80, 58,165, 48, 13, 7,211,174,146,180, 15,112,251, 61,156,156,195,255,244,226,
-151,168,111,220,198, 45,151, 80,178,193,221, 31,221,225,198, 51, 26,221,102, 23,199,134, 40, 80,105,177,146, 16, 52,131, 26,152,
- 69,198,143, 86,249,201,127,122,142,111, 92,120,136, 99,191,250,115, 28,251,251,159, 68, 4,221, 84, 69, 53,140,212,135,166, 98,
-162, 56,225,220,219, 30,197,182,191,204,106,103,131,179,211,231,105, 52,247,216,221,107, 48,125,230,227,176,243, 44,154, 10, 51,
-209, 76,165,103, 37, 2,253, 95,254,171,223,248, 76,216,105,162,100,130,233,149,208, 77,131,168,219,102,230,252,253,108, 93,124,
-149,185,243,247,176,250,202, 75, 28,121,240, 17,182,111, 92, 71,201,136,177, 99, 39,208, 29,151,246,246, 46,110,169, 68,117,113,
-145,110,109, 31,205, 48, 83, 87,170,110,208,221, 89,199, 44, 86, 82,105, 43, 87, 34,233, 53,209,109, 23, 25, 6, 8,211, 38,110,
-237, 99,150,171, 96,148,144,189, 3,140, 92, 33, 53, 66, 17,163,121,229, 52,231, 44, 65,168, 0,163, 80,101,237, 7,223,101,242,
-216, 2,149,211,231,192,180,217,191,244, 58, 55,159,251, 1,157,230, 46, 39,238, 59, 75,208,245,153, 61,123, 23,245,237,125,146,
- 56,192,205, 23,185,246,236,247,232,214, 91,228, 44,157,124,185, 72,228,199,116, 54,151,113,221,144,177,153,227, 68,177, 79,236,
- 39,228, 43, 5, 4, 26,171, 55,110,226,119, 59,248,221, 30,150,161,152, 57, 58, 67,161, 58, 78,109, 99, 31,191,151, 80,118,250,
- 28,185,255, 62,148,114,104, 55, 3,226,160, 67,113, 98,154,181,171,183, 40,143,229,153, 63,117,140,110, 59, 96,125,101,135, 78,
-125,139,168,239,163, 91, 14, 97,107, 27, 79,235,225, 57, 17,174, 17,210,220,222,193,118,203, 4,237, 14, 94,181, 76, 99,125, 3,
-171,144,103,234,216,113, 90,245, 26,211, 39, 79, 33,163, 16,191,221, 35, 9, 35, 10,213, 34,205,237, 93, 38,142, 31,101,127,101,
-149,245,107,183, 56,251,248,187,184,253,226, 11, 44, 61,240, 16,203, 47,190,128,227,229, 49, 92,135,210,204, 52,182,103,147, 68,
- 65, 86,249,234,226,142,143, 81,251,238,151, 17, 3, 89, 76,141,250,188, 53, 61,165,136,104, 12,202, 64,178,252,181, 32,195,224,
-106, 8,153,112,230, 95,252, 17,206,204, 24, 2, 15,232, 19,215,183,232,239,237,209,222,221,165,213,168,227,199, 50,251, 96,203,
-116,186, 8, 99,146, 40, 26, 26,104, 64, 35, 10,250, 60,249, 83,127, 31,243,194, 91, 97,229, 53,216,216, 34,106, 52,137,162,144,
- 96,255, 0,249, 23, 95,196,185,181,138,234,244,184,217,234,113, 45, 10, 73, 12,147,104,175,137,236,180, 73,116,141,221,122,143,
- 59, 87, 55, 89,126,245, 54, 99,147, 30,229,249, 41,164, 6,154, 99,160, 25, 54,186,109, 17,244,125,114, 83, 25,167,186,219,197,
- 40,148, 32,151, 26, 51,241, 3, 26,175,189,196,141,191,121,138,234,241, 5, 22,159,120,156,194, 71, 63,128,102, 8,186,215,110,
-177,126,103,133,133,201, 25,110,180,118,168,172,237, 49,177,184,196,254,222, 13,194,102, 99,100,214,226,112, 55, 58, 25,220,229,
-112,133,238,161, 3,157, 81,212, 10,161,208, 7,253,239,255, 93,231,251,168,180,134, 55,247,216, 28, 42,102, 25, 57,231,135, 65,
-248, 97, 58, 44,251,225, 52, 19,149,116,145, 65, 35,147,245, 15,187,247,134, 11,246, 33, 26, 54,245, 8, 28,186, 36,104,226,112,
-172,157, 81,183,204,232,194, 34,147, 24,149, 68, 67,243,220, 48,206, 55,216,109, 31,202,217,143,242,252,218,161, 60,251,232, 98,
- 35,134,185,248, 55,121,234, 70,168, 85,109, 4,190, 17,186,137,183,248, 32,154, 83, 37,238,236, 28, 90, 51,140,190, 94,106,130,
-130,102, 83,124,248,221, 96, 59,136,184,139, 86,154,229,224,217, 47,128,230, 17,107,130, 40, 76,144, 97, 64,236, 71,105, 46, 60,
- 78, 21,131,118, 39, 98,127,187, 79,208, 11,233,238,117, 48,117,133,158,183,211,100, 80,177,138,166, 36,197,249,227, 20,103, 22,
- 40, 76, 47,224, 78, 76,144, 31,155,194,111,236, 98,154, 58, 65,183, 69,127,107,143,206,238, 6,171,151,239,224, 55,234,220,188,
-186, 73, 16, 68, 84,199, 60, 44, 75,224, 90, 2, 37, 36, 73, 16,160,105,130, 56, 74,200,143, 21, 49, 45,155, 94,167, 71,175,222,
- 70, 51, 13,176, 45,164,210,136,253, 24,175, 90, 37, 17, 6, 8,145,121,103, 98,194, 86,135,126,187, 67,167,222, 39, 8,211, 92,
-119,156, 72,100,172,232,250, 49,107,141,136, 85, 63, 61, 36,110,212, 26,228,116, 29,221, 52,177,109,155, 35, 99,101,166, 10, 14,
-211,149, 18, 94, 33, 79,113,108,140,226,196, 20,186,101, 18,118,154,200,216,199,176,109,116,195,196, 46,141, 99,230, 11, 68,189,
- 30, 65,171,129,109, 72, 52, 97, 17,108,175,164,135,247,144, 81, 46,135, 38,206,244,243, 46,135,207,153,200,226,146, 74, 42, 72,
- 36, 74,207, 98, 10, 89, 91, 92, 34, 37,145, 74,232,199,146,118, 18,211, 8, 99, 18,169,200, 25,130,130, 97, 82,191,125,133,163,
- 15,189,155,253,189, 61, 44,215,195, 45,149,176,220, 60,222,196, 44,230,234, 45,198, 22, 22,249,253,255,247,119,161,181,207,152,
- 46,241, 52, 29, 93, 66, 40,161, 17,197,236,246, 34, 14,252,152,126,146, 22,201, 40,169,134,157, 79,186, 72, 33, 44, 21,199,102,
-204,113,169,218, 6,121, 35, 35,220,105, 3,180,241, 0,125, 28,167, 67, 80,210,197,208, 36, 73,228,243,209, 79,125,130,243,143,
-188, 31, 37,187, 8,173,192,212,201, 18,107, 47,220,198,113,115,128, 65, 16, 41,252, 32,102,127,239, 0, 63,150,148,244, 42,199,
-198, 95, 98,251, 87,127,155,251, 30, 45,240,229, 63,252, 14,213,251,150, 40, 46, 46, 16, 6,221, 52,167,175, 84,134, 97, 54,240,
-253,136, 7,239, 91,226, 43, 95,185,194,233,233, 57,132, 81,192,175,213, 16,142,205,244,241, 7,137,215,158,201,230, 11, 49,252,
-108, 25,181,155,151, 49,189, 34,157,189,109,220,177, 73,108, 47,135, 83,153,228,242, 83, 95,226,232, 67,247,177,117,233, 18,199,
- 30,125, 27,203,223,251, 46,147, 75,199,208,109,135,205, 75,151,210,138,188, 66,158,252,228, 36,119, 94,124,142, 19,239,127,146,
-254,246, 54,110,117,140,176,211,166,114,236, 20, 73, 18,161, 59, 78, 42,167,187,121,146,160,143, 94,168,226,239,108,224, 76, 76,
- 1, 22,168, 36,205,171,235, 58, 36, 17,122,105,142,168,185,141, 48, 44, 14,150,175, 51,121,230, 60,219, 47,125,151,197, 7, 31,
- 68,179, 61,214, 94,122,150,184,219, 70,232, 54, 83, 71,142,146,171,122, 84, 22,151, 8,122, 1, 55,127,248, 50,249, 74,158, 92,
-165,202,234,197,107,148,199, 39,104, 54, 91,168, 72,103,229,230, 77,246,214,235, 88,166, 32, 55,121,140, 78,187,205,236,201, 19,
- 52,118, 26,180, 27, 93, 14,182,106, 88,150, 34,137, 34,242,174, 70,101,118, 6,116,131, 78,187, 79, 4, 40,233,115,226,209,183,
-209,220, 62, 32,146, 54,157,102,139,241,233, 10,175, 60,243, 60, 83,243, 5, 44, 71,167, 94,111,177,177,188,131,169,251, 8, 36,
- 73,239,128, 27,207,188,202,196,226, 12, 70,126, 18,167,112, 20, 75,104, 52, 47, 61, 75,125,251, 14, 39,223,250, 30, 58, 7,117,
- 38, 79,157,230,213,175,126,129, 7,159,252, 73, 10,213, 18,142,231, 80,219,216,102,108,118,134,157,229, 91,248,205, 26,147,199,
-142,243,234,151,159,226,200,125,247, 50,121,244, 40,245,213, 21,206,190,255, 67,236, 45, 95,227,216,125,247,177,119,103,141, 19,
- 15, 93,200, 58,203, 61, 0,122,141, 30,185,178,160,120,247, 67, 67,201, 85,104,218,144,221, 77,118,131, 70, 42,132,153, 54, 43,
- 33,147, 52,114,168,167,190, 7,123, 98,138,242,125,111,165,124,239, 91, 81,170,135, 32,128,160,139, 76, 98,226,192, 79, 95,138,
- 41,183, 19,169, 18, 84,146, 32,227, 8, 41,227,108,194,147,196, 36, 20, 76,135,247,254,244, 79,195,194,113,168,223,130,237, 93,
-226, 70,139, 4, 65,248,253, 31, 98,189,244, 58, 98,122,130,168,222,226,249,155, 91,236, 36, 33,158, 97, 51,147, 47, 98, 78, 58,
-220,220,221,102,171, 86, 39, 78, 18, 22, 78, 30, 99,254,222, 51,220,238,244, 41,117,218,216,133, 82, 90, 57, 42, 99, 52, 32, 9,
-218,132,219,219,152,149, 50, 50,240, 81,173, 38, 98, 98, 18,242, 69,216,217,165,252, 35, 63,193,143,124,224, 71, 40, 78,207, 97,
-152, 38, 26, 80,120,242, 71,153,249,157,223, 33,172,237,242,195,191,247, 19,140,109,215,184,104,237, 49,247,119,223,229,194,207,
-127,150, 31,254,214, 79, 14, 73,160,104, 3, 65, 88,141, 78,160,172,125, 79, 14, 36,194,172,225, 44,237,125, 31, 72,142,138, 68,
-105, 41,254, 81, 30,222, 55,171, 55,153,211,222,156,199, 30,185,231, 15,231,207, 7,198,183, 97,145, 93,102,234,145,253,122,182,
-135,207,246,219,242,144, 69,237,240,164, 63, 4,206, 64, 18,143,186,229,101, 34,209, 76, 15, 52,137, 10,195, 97,148, 14,237,208,
-215, 25,114,132, 50,207,234,116,133,161, 15,227,108, 42,115,183, 15, 12,110,169,111,240, 77, 55,151, 67, 61,249,114,120, 59, 26,
- 24, 2, 71, 90,253,200, 85,173,233,105, 90, 90,137,180,195, 97,232,104, 80,135,194,244, 34,109,117, 11,252, 0,101, 89,105,231,
-133,222, 70,151,138,137,247,124,130,155,127,245,123,136,194, 56, 42,140, 81,104, 88,158,147, 78,235,253,136, 94, 61, 76, 35, 88,
- 8, 26,205, 4,207,134, 91,175,222, 97,166,221, 71, 24,130, 48, 78,200,205, 47,210, 15,214,169, 28, 59,131,225,120,136, 88,161,
-100,130,110, 26, 52,110, 94,163,223,108,113,176,215, 99,245, 78, 13,165, 67,161,101, 83,169,184, 68, 97, 72, 28,248,184,142, 69,
- 97,204,163,211,234,225, 84, 43, 8,221,196,182, 29,140,106, 21,133, 98,236,196, 20, 36, 49,221,237, 59, 8,153,224,148, 39, 56,
-184,115,139,131,237, 61, 44, 77, 79, 85, 77,173,135,223,236,226,119,124,250, 97,140, 64, 16,199,138, 36,150, 68, 49,180, 3,201,
- 78, 23, 86, 98,157,253, 94,196,238,254, 30, 5,199,161,154,115, 88, 44,231,169,120, 14, 11, 83,101, 74,197, 60, 57,215,165, 56,
- 54,150,173,250, 44,132, 76, 11, 96, 84,166,170,152,249, 74, 10,112, 49,108,162, 32, 78,243,244,147, 30,245,253, 21,100, 20,167,
-127,219, 65, 66, 97, 16, 69,204,128, 58, 42, 73,147, 17, 74,142,168,126,168, 44,201, 16,142,250, 27,148,148,200, 12,135,154, 5,
- 46, 81, 89,212, 22, 5,186, 82,136, 36, 98,253,226,247, 56,241,224,123, 9, 99, 73, 55, 12,184,254,210,247,136, 54,183,184,186,
-179,193,205,205, 85, 38, 60,157, 99, 57, 7,195,116,208, 85,202, 9, 16,154, 65, 18,245, 9,135,109,196,105,123,102,160,146, 33,
-231, 72,144, 30,224,182,235,224, 21, 74,200,184, 59,170,109, 84,105,203,168,146, 58,194, 72,123, 2,146,168,141, 46,192, 49, 12,
-188,169, 57,222,251,179,191,129, 34,129,216,228, 95, 47,204,243,173, 86,151, 71,239,125, 27,239,124,252,231,112, 93, 19, 41, 67,
-226,160,139, 55,229, 83,197,164, 99, 56,120, 79,125,149, 47, 45, 88,252,155,103, 27,124,106,204,160,126,176,199,156, 38, 82,152,
-153, 0,221, 74, 65, 49,138,180,217,243,196,253,119, 99,235,223,160, 17, 65,222,233,161, 57, 41, 12,231, 64,159, 96,233,209, 15,
-112,240,194,215, 82, 15,107, 6,150, 49,220, 82,133,176,215,161, 48, 49, 67,107,103,157,158, 46,232, 55,155, 76,159, 92,194,244,
-198,152, 58,237,177,119,237, 42,229,233, 73, 26,219,155,184, 94, 30,195, 16,216,213, 50,213,165,187, 88,123,254, 89,142,222,255,
- 16, 59,175,191,204,250,229,215,152, 60,122, 20, 33, 96,242,196,221,232,142, 11, 2,194,118, 3,187, 50,153,202,122,177,194, 46,
-151, 51,110,117,144,238, 86, 98,159,164,211,198, 26, 95, 36,172,109, 18, 52,183,176,139,227, 76,156, 62,141,127,176,203,216,209,
-227,200, 36,225,245,191,254, 43,250, 7,187,204,157, 61, 65,191,213,162, 56, 85,101,226,196,113,154, 59,251,236,222,188,205,248,
-194, 12,232, 58,245,213, 45,132,101,240,204, 87,190,197,252,130,134,229, 46,208, 57, 56,128, 56,100,233,244,113, 44,153, 96,150,
-199,121,227,249, 23, 73,194,144,234,228,100, 54,149, 87,240, 59,125,186,205, 54,190, 31,209,239, 54,105,180, 34,186,187,107,156,
- 56,183, 68,179,209,196, 48,109,250,173, 62,197,130, 77, 47,180,177,157, 10,165,170,134, 97, 58, 52, 15, 20,115,115, 46, 66, 47,
-209,106,119,113, 39,143,114,238,158,247,176,118,229, 69, 54,175,191, 65,113,108, 28,183, 56,197,185,143,253, 35, 46,127,235, 11,
-188,254,181,167, 56,254,240,195, 56,185, 60,253,250, 1, 43,175,190,134,233,234,236,223, 90,163,182,185, 66,216, 62,141, 91,204,
-241,198,183,158,230,130, 93, 98,236,200, 34, 50, 12, 48, 45,151,149,231,191,207, 61,243, 71, 24,159, 61,142,148, 29,220, 98,142,
-214,222, 1,245,213, 93,198,143,205,162, 89, 38, 42, 10, 48,242, 51,232,134,192, 42,143, 17,182,234, 56,197, 69,208, 53,162,250,
- 90,202, 56,214,245, 76, 54, 86, 24,133, 34,229,115, 15, 50,254,246, 15,144, 95, 60,137, 53, 62,133,140,125, 48,243, 40, 25, 32,
-146, 0,132, 1,186,129, 64, 16,118,187,105,113,142,174, 19, 51, 32, 71, 73,164,130, 56, 74, 15,216, 94, 20,112,124,106,138,115,
- 63,242,163, 48, 54, 13,126, 3, 54,183,145,141, 38,210, 50,241,127,255, 79,112,226, 24,230,167,241, 27, 13, 94,184,178, 74,207,
-177, 80,173,144,192, 17, 92,186,190,204,226,217,227,204,190,253, 1,238,255,240, 7, 88,124,255, 71, 49, 11, 21,180, 76,101,144,
-150,195,222,255,246,243,105, 65,132, 74, 64,197,104,166, 67,111,103,157, 98,169,132,140, 2,162,131, 61,172,165, 19, 8,195, 70,
-121, 46,118, 33, 79, 99,245, 22, 34,142,200, 85,199, 49, 28, 7, 35,243,122,152,213, 9,222,254,141,111,179,247,181, 47,115,249,
-227,255, 51,205,160,205,228,151,190,131, 83,158,166,127,176,157,190,180,146,180,255, 92, 74, 53, 50,158,137, 17,229, 20,117,248,
-180, 85,135,118,197, 98,120, 16,101,131,122, 86,232,124,216, 80,167, 14, 69,180, 50, 70,123,246, 82, 28, 77, 24,217,222, 82, 31,
- 53,217,201,172,152, 95, 12, 77, 75, 35, 93, 93,101, 7,164,200,170, 98, 7,165, 55, 50, 86,195, 3, 49, 53,202,165, 47,112,205,
- 42,145,244,246,210,159, 83,170,225,126,127, 40, 24, 36, 98, 88, 66,131,150,150,232, 16,201, 65,230, 14,221,114, 82,185, 86,118,
- 16,137, 68,105, 3,162,223, 64, 41,146, 35,102,125,246,179, 13,248,243,106, 72,117,147,135, 10,104, 64, 70, 9, 66, 83,248,171,
- 47,164, 50,163, 76,227, 73, 3, 8,141,166,143,214, 19, 9, 33,228,167,210, 70, 70,153, 66,103, 74, 15,124,148,252, 15,190, 76,
- 55,144,152,194, 68, 15,211,158, 4,163, 23, 18, 4,208,172,247,176,149, 6,161,194, 18, 2,221,214, 41, 20,114,172, 93,217,166,
- 48,150,167,217,106,163,173, 54,152,190,123,137,168, 83, 71, 24, 22, 81, 20,145,244,186,216,249, 42, 70,190,140, 30, 73,220,138,
-206,249,233, 50, 81, 63,164,215,234, 97,186, 22, 38, 80,153,157, 68,115, 11,180,118,119, 41,204, 79, 19,197, 49,238,196, 20,134,
-227, 98,231, 10,152,150,139,110,234,132,173, 3,242, 39, 30,162, 91, 91, 39, 22, 6,238,220, 9,130,102,131,214, 65,157,126,187,
-141,101, 66,212,143,210,142,135,104,208, 87, 32,233, 7,146, 68,193,118,104,178, 44, 13,252, 36, 98,162,148,231,212, 84, 21, 75,
- 55,176, 76, 13, 83, 41,202,158, 65,177,144,163, 88, 46, 99, 26, 34, 77, 28,153, 38, 78,169, 76,212,109,163,180, 16,195, 45,129,
- 46, 80, 73,132, 85,152, 34,236,245, 48,115, 57,170,229, 18,230,108, 14,255,107,119, 16,104,200, 36, 73,159, 17, 61,205,144, 11,
- 93, 31,169, 49,195, 34,133,193,229, 82,189,217,240,152,173,102,146,204, 4, 42,101, 58,201,203, 56, 91, 17, 42,129, 35, 5,150,
-145, 62, 3,183, 95,122,142,111,124,251, 59,108,246, 99, 90,113,202, 71, 87,164,117,169, 69, 91,199, 82, 2, 83,165, 59,114, 93,
- 8, 52, 43, 79,161, 48,137,222, 14, 81,173,126, 42,108, 33,233,135,217, 36,156, 93, 11,141,172, 90, 56,104,183,233,170, 24,189,
-232, 66, 2,137,144,104, 50, 53, 15, 11,211, 68,201,136, 20,175,160,178,181,143,198,217,223,252, 19,164, 76, 16,154,198,191, 40,
-205,241,179,247, 24, 76,237, 91, 20, 91, 87, 17, 94,137,208,247, 49, 29, 19,229,107, 28,236,245, 25, 47,107, 28,220,218,226,238,
-121,193, 71,175,134,124,238,161, 60, 79,189,208,225,215,238,191,143,216,247, 73, 6, 13, 77, 34,206, 8,148,169,153,166, 83,111,
-243,240,219,103,217,191,209, 70, 68, 6,186,159, 80,157,240,217,221,232,113,230, 71,127, 25,227,202, 75,196,157, 90,182,190, 3,
-163,119,176,141, 34,193,202,151,144, 97,200,244,185,123, 72,252, 0, 33, 18,100, 28, 19,245, 2,250,141, 6, 73,212,102,238, 45,
- 15, 82, 95, 91,165,182,182,193,233,119, 62,198, 75,159,255,255,120,228,103,255, 23,118, 94,125, 17,175, 92,230,220, 59,223,133,
- 48,109,204,177, 89,130,253,109,146,200, 71, 88, 30,134,153, 78,225, 8, 19, 65,130, 18, 2, 25,251,168, 56, 38, 14,250,105,158,
-221,205, 17,119,218, 8, 13, 10, 75,231,136,155,181,204, 40, 18, 83, 91, 93,227,250,115, 47, 48, 54,237, 49,118,250, 40,150, 11,
-249,241,121, 52,225,176,121,245, 58,237,253, 58, 94,193,197, 41, 21,217,190,181,198,157,235,183,217,186,179,204, 93,199,171,156,
-121,223, 19,188,248,149,103, 56, 50, 63,193,196,241, 83, 52,155, 29, 94,123,237, 10,187,119,190,205,244, 92,158, 35,119,157,195,
-205,121, 40,211,224,242, 43, 23,145, 81,135,137,217, 89,122,245,132,229,107, 55,153, 42,107,220,243,142, 71,104, 55,218,196, 81,
-182, 79,141, 67,252, 68,163,177, 85, 99,122, 82, 49,117,236, 2,175,125,239, 18,133, 2,180,250,130,176, 31, 81, 61,114,154,214,
-206, 30,187, 23,255, 12, 69,159,114, 57, 71, 18,117,217, 91,123,131,215,158,249, 34, 31,251,167,255, 26,103,124,138, 31,252,249,
- 31,115,242,225,199,185,247,195, 31,231,250,179,223,229,216,133,251,169,173,110, 32,208,217, 91,187,197,221,239,120, 31,110, 33,
-199,254,198, 58, 83, 75, 71,232, 54, 58,108, 92,191, 72, 28,197,108,191,241, 18, 74, 56,148,143, 76,227,183,186,116,246,182,232,
-182,218,200,219, 49, 42, 17, 32, 66,138,243, 51,104,152,228,207, 61, 72,251,229, 87, 40, 44, 61, 76,220,171,145,116,118, 80,177,
-143,233, 21,168, 60,244,118,142,254,236, 47, 35,195, 48,189,153,155, 22, 74,165, 21,174, 2,133, 89,174,160,226,198, 0,162, 14,
-129, 79,220,239, 17, 54, 91,144, 36,217, 7, 38,165,113, 75, 37, 73,178, 73,168,213,233,114,238,212,113, 78,127,228, 35,144,175,
-164,148,133,205, 21,212,238, 62,137, 97,210,255, 63,255, 61, 94,177,136, 40,231,145, 93,159,151,175,172,210, 16, 26, 42,231,113,
-123,121,147, 39,254,199,143,114,230,147,159,196, 91, 56, 74,210,235,145,244,251,132,245,125,146, 94, 23,195,113,211,120,143,144,
- 76,127,230,255, 97,231, 55,126, 14,189, 80, 0, 20,166,109, 16,182,235, 72,223, 71, 24, 14,113,191,135,213,105, 65,105, 12,149,
-243,134, 13,107, 42, 78,136,195, 16,195,177,178,233, 68, 31, 26,250, 38,222,255, 17, 30,122,234,115,172,253,195, 95,165,157, 47,
-114,225,236,199,120,246,123,191,151, 85,168,103,116,133,108,215,139, 54,138,165, 41,169,210, 56, 19,135, 90,210, 6, 49,173,204,
- 25, 44,178,136,217, 64, 60,214,244, 97,226,125, 48,220,167, 59,237, 1,181,141, 55, 31, 96, 3,231,120, 90,167,122,104, 15,173,
-105,233, 33,171,178, 93,251,208,178,159,154,186,164,212,208,180, 84,137, 81,135,164,248, 84,182, 23,160,153,216, 19,103,209,237,
- 28,253,205, 22, 42,238, 49, 80, 82,133,174,161, 68,202,160, 38, 67,226,106, 98, 84, 4,131,174,129,202, 36,203,252, 36, 40, 73,
-212,236,140, 34, 3,100,232,186,204,175, 33,213, 96,197, 35, 70, 57,124,141, 12,224,145,153,247,244, 65,156, 45,243, 32, 72,137,
-166,194,244,128,208, 51, 71,126, 42, 69,164,128, 24,153, 86,196,106, 99, 99, 32,204, 44,171,111,164,129,229,164,207,226,199,126,
-133, 55,254,253, 47, 34, 75, 83, 40, 37, 73, 98, 69, 24, 74,186,189,136, 72,104,248,237,148,124,168,123, 58, 84, 42, 88, 37,143,
- 9, 91,167,189,219,167,180, 56, 71,109,167,193,218,149, 53,142, 22, 39,104,238,214,208,188, 98,122, 25,209,192,174,204,160,156,
- 42,218, 88, 23,250,109, 10,139, 37,170,154,137,146,138, 68,234, 68, 73,140,142, 64, 86, 12, 52,215,193,144,138,110,167, 79,201,
- 43, 17, 71, 18,153,244, 73, 58, 17, 73, 24, 35,194, 6,154, 59, 78, 20,133,224, 90,168,196,196,118,170,180, 86,111,211,108,164,
-145,207, 36,142,211,169, 51,129,126,164,216,232,166,135,153,143,194, 18, 9, 5,207, 74,127,125,161, 81,201, 89, 56,186,206,252,
-252, 52,158,231,144,132, 1,142,231, 80,168, 20,177, 92, 27, 33, 4, 97,191,141,102, 8,116, 59,135, 97,187,104,166,141,176,108,
-100, 28, 16, 7, 1,154, 97, 35, 12,157,254,126,135,176,213, 4, 45,243, 90, 32,136, 51, 67,153,166,228,161, 90, 98, 45,189, 96,
- 11, 61,125,238, 7, 20, 66, 70,135,190,202,194,226,105,107, 93, 58,105,106, 8, 44, 77,160, 39, 10, 93, 79,205, 95,177, 2, 41,
- 35, 18,153, 62, 35,102,134,148,208, 18,129,101, 11, 28, 4, 57, 67,199,214,116,172,236, 50, 33,136,233, 30,108, 17, 5,157,180,
-249, 78,131,110,148, 41, 70,135, 10, 34, 7, 45,141, 58, 2, 91, 31, 60,167, 50, 53,138,154,138, 68, 37,136, 56, 64,104, 18, 97,
-230, 73,226, 48, 83,184, 18,116,215, 69, 33, 57,184,254, 2, 83, 68,252,215, 61,197,175,111, 36,228,180, 3,190,212, 9, 80,102,
-140,138,116, 86, 87, 54,184,211,221,102, 99, 31, 74,249, 51,188,186,162,168,127,250, 12,191,255, 31,174,114,215,135, 31, 97,226,
-244,121, 26,107,215,211, 24,167, 16, 72,165, 33,101, 66, 18,167,202,106,191,235, 51,119,108,140,155,175,246, 41,229,102, 16,178,
-207,205, 55, 94,231,216,185, 7, 88,190,180,193, 35,191,245,103,188,254,207, 62, 52, 20,183,244,223,252,245, 95,252, 12,113,130,
- 55, 57, 3,177,143, 55,123, 55, 7,215,223, 32, 63,179,200,234, 43, 47,209,218, 89,103,252,232, 34, 99,139,167,104,111,175, 99,
-216, 38,149,185, 41,132,225, 48,123,234, 12,151,190,254,119,228,138, 22,229,249, 19,180,246,182,112,203, 19, 36,126,151,160,211,
-192, 29,155, 32,108,212,176, 10, 85, 64, 67,169, 40,189,145, 5, 29,244,252, 68, 42,249, 69,126,154, 23, 44, 84, 73, 58, 45,208,
- 98,132,102,112,237,107,127,131,166,195,197,111, 62,141,101,105, 76,204,205,112,226,173,239,194,116, 11,244,235,109, 58,141, 61,
-100, 44,233, 53, 59,120, 37,143,177,133, 69, 90,251, 7, 92,250,246,243,232,116, 88, 60, 90,230,174,247, 62,193,242,203, 87,152,
- 60, 58,135,145, 31,231,245, 23, 46,242,205,191,251, 14, 57,217,231,252,249, 37,166,143, 30, 35,137, 4,141,221,117,246,182,118,
- 41, 23, 61, 74, 99,101,130,126,196,198,237, 45,206,158, 61,194,244,201, 19,188,254,253, 23,232,244,246,179, 78,147,152,126, 63,
-162,117,208,195,214,118, 57,114,239, 61, 92,127,249, 26, 66,196,180,106, 53,188,162,135, 87, 61, 70,237,246, 27, 40,127,131, 32,
- 9,208, 77, 19,221, 46,160,219, 85, 12,195,195, 52, 52, 94,251,214,223, 50,187,116, 31, 75, 15, 62,194,197,111,127,141, 82,117,
-146,118, 99,151,137,133, 99,212, 54,214, 40,142,205,208,109,109,177,246,250, 37, 38,143,157,102,243,230, 21,170, 83, 41,255,123,
-127,117, 21,221, 50,185,243,234, 15,232, 52, 34,138, 5,155, 36,214,120,227,153,239,161,128,234,244, 4,166,235, 96,218, 54, 94,
-121,156,208,111, 83, 60,114,130,189,111,252, 87,226,222, 1,225,193, 29,236,106,149,179,191,254,187,204,255,248, 63,164,116,254,
- 97,148,166,208, 61, 15,161,155,105, 95,185,105, 98,184, 30,154,233,130, 33, 33,232,129, 93,130,160, 69,220,105, 81,191,115,155,
-230,126,141,110,167,131, 31,250, 4,126, 64, 18, 37,233,190, 85, 38,116,186,125, 30,189,247, 12, 75, 31,122, 18,188, 66,218, 26,
-184,117, 13,117,107,133, 88,105,244,254,195, 31,225,149, 61, 52,215, 65,118, 3,174, 95,186,205,102, 39,164, 99,233,212, 54,118,
-248,165,245,139,204,191,239, 9,226, 94,143,164,211, 70, 70, 81,106, 92, 49,237,244, 48, 55, 82, 2,156,208, 77,136,122,120, 15,
- 63, 78,247, 27, 95, 68,203,121,104,166,133, 76, 20,134, 91, 68, 51,116,226, 56,194,202,229, 17,165,234,112, 42,236,236,111, 99,
-216, 46,134,101, 99, 88, 54, 66, 51,135, 69, 42, 3,247,186,185,120, 4,231,158, 83,244, 62,255,119, 4,221, 22,133,179, 23,168,
-111, 92,229, 77,245, 48, 3, 96,203,224,224,210,196,155,202, 87,134, 9, 44,109,244, 53,135, 25, 40,111, 42,172, 25, 58,205,213,
-112,194, 30,192, 91,180,161,187,124, 32, 81,171,161, 47,252,240, 20,164,105, 34,243, 76, 28, 82, 14,132,134, 89, 94,194,112,139,
- 36,126,253, 77,104,221,129,139, 92, 8, 3,103,234, 46,204,226, 28,193,222, 45,226,238,110,214, 82, 55, 50,189, 41,161,165,117,
-157,111, 94,248,103,174, 53, 53,148,239, 85, 18,147,244,106,217,238, 92,164,159,115,165,165, 17,186,172,214, 86, 28,186, 83, 12,
- 23, 13,135, 98,111, 35, 78,252,168,150,120, 96, 90, 26, 24,253,100,118, 9,210,117,145,101,242, 5, 82,104, 24, 81, 72,245, 67,
- 63,149,254,110, 81,144, 42, 56,137,196, 44,140, 33,194,128,229,231,159, 37,138, 53,250, 45,159,218,110, 7, 63,129,110,164,129,
-101, 98,219, 22, 94, 57,143, 55, 49,142, 81,158,193,154, 57,134, 87, 41, 98,229, 10, 76,156, 58, 67,110, 97, 9, 41,108,122, 93,
-159,110,171, 15,186, 67,125,191, 65,167,211, 67,105, 22,186, 83, 6,221, 68,233, 14,126,164, 82, 22,183, 31, 33, 52,131, 88,232,
-196, 81,136, 83, 40,165,127, 43,195, 36,242,125,116,161,240, 10, 21, 66, 63,192, 15, 98,122,245, 58, 43, 55,215, 56, 56,104,162,
- 37,146,107, 55,214,104,180,125,158,189,180,197,114, 61,228,210, 65, 76,221, 23,108,118, 36,187,161, 96, 59,208,233, 9,131, 62,
- 38,166,105,224, 90, 6, 5,219,102,190, 90,160, 90,112,152, 26,171, 48, 62, 94, 37, 95,112,169, 78, 78, 80,157,157,194,205,121,
- 56,249, 60,185, 74, 5,195, 50, 17, 50,101,157,203, 48,133,165,232,186,131, 83,153, 72, 47,241, 82,146, 43, 21, 49, 84, 31, 33,
- 34,218,175,189, 74,212,235, 29,154,186, 15,251, 35, 6,237,127, 73,214, 64,152, 12, 27, 12,149,208,210,203,115,198, 84, 80,153,
- 28, 47, 73, 47,194,137, 84,116,101, 12,138,180,242, 84, 3, 79,164, 61,250,253, 68,210,136, 99,250, 82, 17,196,233,179, 98,153,
- 96, 11,141,138,169, 51,227, 90, 76, 88, 6,121,211,192, 53, 52, 18, 63, 36,136,122,180,195,132,126,156, 16, 36,138,110, 44, 9,
-149, 34, 81,163,202,107, 67, 23,120,186,160,106, 27, 76,185, 38, 37,203,192,213,116, 12, 93, 75,219, 54,181,140, 94, 40, 5,154,
-102, 64, 28, 32,116, 29,103,234, 8, 19,239,253,137, 52,106,232,119,249,227,127,247, 31,249,236,175, 61,204,221,119,246,249, 71,
- 99,138,218,145, 15,224,234, 26,141,122,151,102,237,128, 86,175,141,103,120, 36, 73,194,196,194, 1,191,240,185,235,124,252,215,
-254, 87, 62,246,217,223,166,183,187, 74, 18,135, 68, 65, 68, 18, 71, 64, 66,228,135, 41,240, 74, 66, 20,129, 72, 34,110,189,220,
-165,152,203,113,208,110, 83,116,171, 68,161, 32, 10,250,148, 38, 79, 48,123,223, 60, 7, 63,252, 38, 66,215, 49, 84,216,165, 56,
-179,128,110,151, 40, 45,156,166, 95, 91, 67,119,108,234,235,183, 89, 60,119,129,131,219,215, 40, 30, 61, 71,103,237, 38,160, 97,
-121, 30, 65,183, 79,243,230,117,226,192,231,248,249,243,228,151,206,112,243,233,191,229,232, 61,231, 8,251, 93,146, 40,196, 45,
-148,169,223,188, 76,117,233,174,244,182,231,251, 88,133, 18, 42,232,163,231,170, 16, 7,217,164, 20,224, 76,157, 32,110,238,160,
-100,136, 85, 61,198,238,203,223,231,236, 7,158,100,229,135,223,231,193, 39, 63,196,171, 95,253, 54, 71,206,123, 52,118,119, 88,
-125,233, 21, 12,221,164,223, 92, 35,191,112,130, 94,175, 67, 20, 88, 52,106,151, 48, 12,131,249, 19, 39,233, 30, 44, 51,115,242,
- 52,183, 95, 75, 97, 51,237,102,139,229,139,119,232, 52, 14,248,209, 39,223,134,155, 47,163, 57, 22,134,237,209,174,183,113,242,
- 37,194,126, 31,221, 50,136, 67,197,254,214, 62,167,239,154,162, 50,183,192,235,207, 93, 66, 71,103,126,118,150,110,183,207,214,
-214, 50,182, 81,194, 54,116,202, 51,227,172, 95, 91,166,215,233,210,239, 52,153,156, 41,144, 72,141,230,173, 87,169, 76, 85,105,
-213, 65,225, 99,229, 92,122,126,132, 69,156,146,165,128,137,165,187,120,238,243,127,196,253, 79,252, 15, 44,222,117, 47,107, 87,
- 95, 71,215, 5,175,127,231,107,140, 79, 29,197,239,182, 16,216,212,247,239,224,150,198, 65, 41, 94,127,230, 59,156,127,219,219,
- 89,186,112, 31, 43, 87, 94,229,206,218, 62,227, 93,131, 91,175,125,159,249,165, 11,140, 45,206, 97,217, 6,149,106,149,158,159,
-130,110,130,214, 46, 50,129,226,252,113,164, 12,153,255,192, 71, 40, 61,240, 46,140,188,139, 48, 12,148, 16,232,174,155, 82,189,
-178,162, 9,188,252,136,241,103,228,161,187, 5,118, 30,136,137, 59, 45,218, 59,155,180,247,246,211, 14,119,165,136,130,136, 56,
- 78, 15,116,153, 36,244,250,125,222,254,200, 5,166,223,249,190,212,117,174,123,224,239,195,157,117,226, 40,161,255,215, 95,192,
- 69, 34, 28, 23,217, 9,184,125,249, 14,161, 40,208, 10, 15, 48,198,114,252,194,237, 54,173,149,215,160,219, 69,183,173,116,178,
- 20,122, 38, 57,235, 41,125, 77, 79, 51,247,172,230, 80,152, 0, 0, 32, 0, 73, 68, 65, 84,154,161, 35, 52, 29,173, 48,142,115,
-254, 62,226,173, 53,100, 20,162, 99,224,239,108,225,205,204,164, 44,129,102, 10,109,192,176,209, 84, 48,220,235, 42,153,100,197,
- 42,113,250,189,133, 64,249,109,132, 91, 4, 32,247,246,119,176, 63,255,251,184,125,193,252,220, 61,220,122,225,175,145, 50,149,
-198,135, 56,214, 33,155,252,240, 36, 34, 14,237, 18, 25,230,136,213,160, 70, 54,155,168,117, 93,203,224, 42, 34,107,106, 27,165,
-200, 7,231, 41, 42,221,193,167, 94,179,108,159,174,254,155,166,183,236,224,147,177, 76, 39, 92, 57,180,144,165, 28,251,126, 13,
-165,226,204,173,156,213,208, 26,163, 26, 91, 21,199,132,205,109,162,230, 22, 73,175,150,113,172,147, 81,157,109, 42,184,102, 78,
-252,244,135, 17, 70, 22, 61, 83,114, 88, 70, 35, 4,168,200,199, 26, 91, 32,246,155,168,208, 79,187,250,197, 64,133,144, 89,132,
- 45, 61,164,213,127,123,176, 15, 14,244, 67,221,239,114,176, 87,215, 70, 94, 16, 50,114,157, 18,234, 16,237, 53, 85, 61,244,249,
- 5,192, 66,169,110, 74, 10, 28, 16,220,194,144,234,189,239,165,244,252,119,217,221,217,195,111,133,180,252,132, 86, 47,164,214,
- 3, 76,157,106,209,102,226,228, 17,244,124, 21,105,121,196, 65,140, 81, 57, 66,208,106, 18,246, 99,122,221, 38,186,233, 18,163,
-163,116,141, 48, 8,211, 88,165, 72, 35,174,189,198, 1,213,201,113,116,219, 78, 65, 32,165, 73,250,237, 38,189,126,144,130, 56,
-188, 28, 66, 73,122,173, 14,126, 16, 98, 89, 6,223,127,238, 34,126, 4, 55,214,247,232, 39, 9,145, 74, 13,101,251,189,136,188,
-109, 96, 8,145,162, 72,133,192, 64,195, 49, 4, 13,116, 76,221,164,160,107, 40, 36,227,249, 28,113, 28,147,115, 44,114,182,137,
-169,107,228, 60,151, 66,222,163, 90, 44, 80,154,153,198, 45,228, 65, 74,108,199,194, 45,229,177, 44, 11,205,180, 49,108, 11, 25,
-249, 72, 33,208,140, 8,221,114,176,171,227,152,110, 14,132,134, 95,175,163,229, 99,114,227, 21, 58,155, 27,196,190, 63, 52,135,
-166,207, 91,250, 89, 28,182, 23,102, 8,220,193, 69, 86, 12,203,148,146,145, 77, 68,201,108,167,157,209,255,148,194, 52, 12,236,
- 72,195,212, 33, 38,229,156, 91,217,141, 87,136,148,128,102, 32,177,132, 64,211,193, 54,210,140,121,209,214, 41, 26,105, 43,156,
- 45,180, 33,135, 93, 83, 2, 71, 8,114,198,224, 3, 50,242,169, 72,149,118,181, 91, 66,203,238,163,153,172,158,128,148, 6,104,
- 86, 42,173, 75, 57,186,128, 70,221,244,226,153, 68, 76,255,216, 63,206,146, 27, 80, 88,120, 11,255,228,119, 62,205,187,255,217,
-191,229, 46, 3,190, 19,195,167,207,174,114,234,253,111,165,182,125,135,114,174,194,108,212, 39,142, 19,106,157,144, 83,191,245,
- 9,190,254,213, 31, 39,108,214,104,111,222, 66, 38, 41,231, 35,138,251, 72, 9,177, 31, 16,249, 62, 65,144,178, 79, 18,108, 58,
-141, 38,186,230,160, 44,147,241, 66, 30,175, 92, 38,110, 6, 4,185, 60,237, 70,159,252,209,247, 99,143,253, 1,113,115, 23,163,
-219,232,162,153,251,208, 11, 9, 58, 7, 52,182,247, 17,244,200,149, 39,105,109,239, 96, 88, 14,171,207, 62, 69,109,109,135, 35,
- 23, 78, 97,184, 37,154,155,251, 88,174,199,220,249, 7, 73,146,132,253,203,175,178,120,254, 30,154,187, 59,184,133, 60,150,227,
-224, 55,107, 84,151,238, 66, 41, 13, 21,251,232,166,145, 46,190, 52, 45, 53, 4,196, 61,100, 20,225, 76,157,162,113,227, 69,108,
- 47,135, 59,115, 12,127,247, 54,197,185, 73,234, 43, 43,204,190,229, 2, 43, 47,189, 76,197, 49,112,244, 22,205,173, 29,102, 78,
- 29,101,231,230, 42, 78,113,138,203,223,252, 27, 30,253,248, 79,179,246,198, 77, 52, 29,122, 82,209,172,245,176, 53,141,253,237,
-253,108,247, 97,178,183,182, 69,169,234,113,225,161,211, 88,133, 50,126,207, 7,169,216, 89,223,165,215,106,145, 47, 56, 20,198,
-198,145,194,224,206,181,155,204, 31,153,166,178,176,200,229,151,111, 96,153, 33,199, 47,156, 99,127,175,195,173,171, 43,156, 58,
- 61,201, 65,179, 15,154, 34, 10, 20, 59, 91,187,168, 68,113,228,196, 34,181,237, 3, 66,185, 75,161,156,163,219, 11, 64, 68, 76,
-206,206,211,106,133,104,102, 30,165,192,112,114,216, 78,145,221,181, 59, 44,158,126,132,215,159,249, 38, 71,206,158, 67,211, 45,
-188, 92,153,239,127,245, 15,249,200, 63,248, 52, 7, 43,215, 9,163, 22,134,101,145, 47, 22,105,237,239,210,106,236,178,113,237,
- 42,249, 74,133,110,189,133, 0,114,197, 60,211, 75, 15,161, 11,147, 92,161,192,230,173, 91,252,151,223,251, 93, 62,254,137, 95,
-160, 50,158,195,171, 76,113,176,181,143,101,107,156,253,151,127,128,158, 43, 98,122, 94, 26, 3, 51, 12, 52,219, 29, 18,190,140,
- 92, 41,213,182, 80,169,100,153,106,212,233, 75,219,176, 32,242,105,111,109,208,171,215,210, 28,186,148, 68, 81,156, 18,212,162,
- 36, 61,208,123, 62, 23,206,157, 96,250,241, 39,192,176, 65,119,211,197,241,234, 50,178,213, 38, 90, 93,199,184,177,130,113,250,
- 8,221,181, 77,154,187, 77, 26,137, 69, 83,118, 57,254,158,135,121,199,231,190, 66,251,206,235,104,186,129,212, 70,125,243,106,
-224, 45,215, 70, 68, 57, 49,176,119, 43,144,157, 6,197, 31,249, 57,246,126,251, 83,104,150,131,238, 88, 68, 65,139,216, 47,129,
- 82, 36,221, 46, 70, 28, 33, 12, 51, 45,253,112,210, 15,109,218,233, 46,145, 38, 4,187,155,252, 31,159,254, 55,108,134, 19, 24,
-202,231, 87, 62,245,126, 78, 60,246, 54, 22,254,243,159,210,124,242, 19,116,151,151, 57,246,246,159,100,249,187,127,142, 76, 4,
- 66,207,246,204,131,222,245,193,139, 67, 2,250,200, 85, 39, 68,182, 47, 84, 35, 3,157,200, 38,229, 1, 42, 52,165,175,137, 44,
-170, 37,135, 19,188, 20, 98, 72,130,147, 89,163,218, 64, 94, 31,148,214, 12,246,244, 50,251, 94,114, 96, 82, 82, 67,180, 57, 73,
-191, 5,196,163,124, 56, 3,230,187, 24,186,203,147, 94, 3,149,132,153,131, 93, 27, 88,231,135,253,222,130,236,247,205, 84, 1,
-149,225, 38,211,223,119,132, 98,213,157, 18, 70,126, 38,189,204,247, 58, 35,191,193, 97, 70,124, 70,188, 27, 85,195, 29, 70,207,
- 13,186,169, 14,101,246,147,129, 77, 64,140, 82, 7, 50,147,239,135, 24, 98, 45,155,234,117, 32, 91,167,104, 90, 58,109, 10,133,
-144, 18,169,153,156,124,223, 79,112,240,185, 63, 32, 33, 34, 76, 36,189, 48,161,229,199, 76,184, 69, 22,142,206, 33,240,168,239,
-246,169, 55,118,105,119,122, 92,120,240, 45,204, 28, 63, 65,109,115,149,146,151,103,127,107,135,126,171,201, 55,127,120, 13,199,
- 50,121,241,214, 14,237, 32, 38,103,233,108,181, 2, 10,158,149,150,136, 72,197,241,201, 18, 66, 9, 30, 58, 62, 67, 20,165,127,
- 87,191, 31,209, 10, 35, 58,189,128,118, 16, 18,100,238,239, 36, 99, 9,152,134,192, 48, 77,102,139,233, 69, 86, 67, 97,234, 58,
-142,161,163,235, 58,101,207,165,215,239,163,235, 26,158,101, 50,110,154,140, 87,138, 88,134,142,155,169, 13,149,241, 42,186, 16,
-228, 74,249,180,172,165,144, 67,202, 8,167, 88,192, 52,245, 97, 28, 81,215,181, 52,105,164,178,149,145,151, 67, 8, 3,221,182,
- 83,213, 78, 37,216,158,135,151, 55, 16,142, 75,251,218, 10, 73,167,151,254,223, 27,163, 72,166,146, 41,127, 64,101, 49,229,244,
- 25,214, 56, 76,238, 25, 40, 49, 41,198, 56, 77, 42, 12, 46,116,166, 18, 36, 73, 76, 65,211, 81,104,105,252, 76,168,116,101,161,
- 43, 28, 36,142,174,147,179, 36,177, 84,233,222, 92,165,145, 53, 75,128,171,235,216, 42, 61,228, 69,146, 62,142,186, 18,152,153,
-100,149,168, 84, 9,136, 37, 67, 95, 74,222,245,152, 29, 27, 39,236,214,137,101,156,246,196,107, 38,110,113, 18,225,183, 17, 42,
-204,178,223,135,153,196,217,103,213, 48,179,207,184, 64,197, 13,238,255,165, 95,225,107, 63,243, 73, 86, 95,250, 91,222,255,249,
- 23, 88,188,251, 2,141,237, 14,149, 35, 99, 52, 27, 45, 42, 90, 9, 25, 24, 84,171, 61,190,251,251, 29,106, 87,126,143,179,239,
- 61,133, 68, 67, 42, 69,208,143,233,181,122, 72, 32, 14, 66,186,157, 54,237, 70,151, 40,182, 81, 74, 35,214, 99, 98, 76,252, 94,
- 64, 37,159, 32,163, 58, 19, 75,169,210,188,119,103, 13,161, 29, 99,233,151, 63,207,181,127,254, 24,134, 91,200,145,155, 63, 67,
-227,246, 13, 10, 19, 51,236, 47,223,161, 50, 61,137,229, 89,172, 94,188,204,145, 11,247, 51, 86, 44, 49,121,236, 56,206,228, 34,
-151,191,242, 55, 88,182,206,244, 93,119,209,109,214, 56, 88,185, 67,101,110,150,218,202, 50, 99,139, 71,216,187,115,147,137,227,
- 39,176, 11, 5, 48, 28,164,223,131, 68,161,123,185,180, 76,196, 42, 16,182,235, 88,197, 49,116, 91,176,119,233,135,140,159, 56,
- 65,127,103, 3,146,152,253,229,155, 20,198,198, 40, 45, 30, 99,247,218, 37,170,243,179, 20, 31,184,159,176,219,101,172, 20,177,
-125,235, 54, 74,104,108,221,184,201, 19,159,252, 57,186, 93, 7, 55,151, 39, 78, 20,205,221,109, 98, 25,145, 68, 62,158, 76, 49,
-127,123,155,219,148,202,121,230, 79, 29, 39, 78, 52, 26,181, 22,126,183, 77, 20,197, 4,221, 62,227,243,179,196,113,204,141,107,
- 55, 81, 97,192,220,252, 4,149,133, 57,126,248,245,151, 49,180, 38,103,238, 63,199,234,202, 62,175, 60,251, 34,239,126,226, 97,
-238,220,222,135,168,206,196,201,147,220,188,180, 73, 16,111,114,236,248, 49, 14,106,109, 14,246,235, 20, 42, 58, 97,162,227,119,
- 58,228, 10, 46,251, 59,125,172,194, 52,126,163, 69,109,235, 13,102,142, 61, 64,113,226, 56,157,102,157,110,179, 5, 90, 66,125,
-111,151,184,223, 68,159,115,176,243, 54,181,205, 53,252, 94, 23,153, 36,248,189, 46, 63,248,198, 87,120,248, 61, 31,166, 89,223,
-231,251, 95,255, 10,154,237,113,246,236, 61,152,150, 73,191,223,162,118,113,157,243, 23,142,209,218,214, 56,121,239,189, 8, 1,
- 59, 43, 55,216, 94, 53, 57,247,104,129,169,241, 24,213,220,196,174,142,167,209, 34, 1,194,178,209,109, 39,117, 19,203, 4,189,
- 88, 97, 8,207, 30, 4,168, 49, 33,106, 34,204, 28, 32, 9, 15,210,151,153,223,234, 18,248, 62, 50,145,196,129, 79,146, 12,242,
-212,146,217,241, 50, 39,159,252, 56,152, 38,104, 54, 2, 23,213,184,130,218,220, 33,146,144,252,229,231,113, 79, 30, 65,250, 62,
-215,223,184,195,118, 0,228, 29,124, 19, 62,240,185,175,208,219,184,132,102,165, 5, 26,233, 78,245, 80,149, 27, 90, 38,179,234,
-195, 61,172,208, 4,194,208, 81,210, 0,211,194, 57,127, 47,201,214, 58,154,230,161, 37, 9, 73,191,151, 50, 44,122, 93,232,182,
-161, 84, 77, 95,242,186,142,140,211, 11,137, 76, 34, 12,179,196, 39,127,230,159, 99, 29,121,148,159,250,169, 39, 89, 88,154,224,
-149,231, 95,231,160,246,183, 60,244,228, 7, 49,127,236,113,196, 11,111, 48, 55,123,158,101,245,231,169,137, 77, 13,220,110,135,
- 38,205, 36,203,102, 43,145, 21,196, 41,148, 54, 34,171, 13, 95,126,234, 48, 90, 85, 12,177,173, 90,214,222, 54,136,147, 13,121,
-230, 66,141,250,230, 85,230, 70, 23, 98,120, 97, 56,108,198, 31,100,122, 53,109,212,210,166,146, 40, 91, 13,100,121,250,225,169,
- 56, 90, 11,168, 36, 96,144,131, 27, 68,144,148, 38,134, 43,132,100,128, 68,205,166,247, 52,170, 62, 56,216,229, 48, 7,159,248,
- 29,250, 91, 55, 80,113, 55,141, 58,101,117,175, 82,100, 83,153,174,141, 76,112,195,156,126,122, 40,171, 67,148,183, 33,183,126,
-160,100, 12,208,183,186, 24,225,107, 17, 67,165, 64,161,136,147,212,205, 76,212, 67, 25,102, 58, 39,170,236, 96,143, 37, 26, 33,
-185,153, 35,188,229, 61, 63,206,237,151,158, 67,119,118, 41,244, 98,238, 46, 86,209,132, 96,188, 92,162,185,215,100,125,115,143,
-253,182,207, 78,187,199,211,207, 93,101,166,154,195,146,224, 39, 49, 81, 44, 65, 51, 88,237, 4, 4,137,196, 52, 52,102, 11, 14,
- 57, 67,231, 72,222,195, 48, 13,116,180, 84, 53,208, 77,138,174,139,136, 20,158,145,114,191,157,156, 78, 41,231, 18,151, 19, 90,
- 45,159,131,110,151,118,146, 50,185, 53,160, 96,167,211,163,165,219,196, 73,186,231, 55, 53,157,130,107, 81,114, 29,250, 81,194,
- 76,201,163, 31, 68,184,150,201,248, 88,133,124,161,128, 33, 37,229,169, 49, 44,199, 65, 70, 49,229,201,137,116,165,150, 17,206,
- 76,203,204,228,241, 24, 72,136,251,109,146,160,135,153, 43,160, 91, 22, 8, 13,221, 76,189, 42,186,227,161, 84, 66,123,107, 3,
- 79, 11,112,139, 83,244,250,109, 58, 87, 95, 76,149, 51, 77,101,208,162, 67,151,188,236, 82, 53,128, 22,169, 44,226, 33,196, 40,
-105, 65,114,232,226, 54,168, 6, 86, 18, 37,193, 80, 2, 79, 75, 63,227, 81, 28, 15, 99,161, 73, 34,112,117, 69, 94, 19,180, 16,
- 96,164,189,236,150,158,186,228, 83,150,133,196,208, 4,154,144,195,139,144, 20, 18,137,164, 31, 43,130,129,169, 53,187, 76,107,
- 40, 92,215, 38, 33, 38, 14, 66, 52, 87, 67, 34,137, 67,159,208,111, 97, 4,221,148,117,161,143,146, 39, 42, 78, 50,213, 64,207,
- 10,146, 4, 16, 33,147,128,160,118, 64,103,239, 6,223,249,163,171,216,253,199, 56,245,143, 79,242,131,255,116,149,220,148, 71,
-113, 54, 36, 94, 55,184,190,125,135,199, 30,123, 11,245,131, 58,203,207, 79,241,236, 95,174,227, 21, 35,112,125, 98,115, 23,221,
- 12,232,199, 17, 81,146,208,110,152,216,133, 62,179, 83,112,208,242,112,250,103, 57, 53,239, 81,239, 7,236,117, 12,142, 29, 29,
-163,211,185, 73,113,252, 94, 52,161,209,222,111,179,229, 25,156,250,213,207,162,255,171,223,254,205,207,200, 56, 98,229,229, 31,
- 96,231,115, 88,182,131, 91,173,226, 22, 42, 40,191,135, 91, 78,141, 19, 66, 55,185,254,173,111,210,105,213, 40, 77, 78,224, 20,
- 75,244, 14, 14,200,143, 79,176,242,234, 43,204,156, 57, 69,115,115,131,242,236, 12, 50, 8,113, 38,103, 81,113, 72,216,239, 96,
-229,138, 4,157, 58,134,155, 75,247, 53,150, 3, 73, 72,212,110, 96,234,169,123,210,158, 60,198,181,167,191,204,226,189,247, 32,
- 12,139,245, 23,158,197, 41,120, 84,142,156, 96,235,141,215, 80, 73,196,234, 27, 87, 9, 90,251,244, 26, 93,238,126,252, 62,148,
- 49,198,193,202, 26,181,237, 93,214,151, 87, 88,189,122,133,137,156,228,254, 15,126,144,246, 65,135,213,171,203, 20,171,130,227,
-231, 30,160,223,243,105, 55, 90,116,219, 29,118, 54,119,137,194, 54,221,102, 29, 41, 67,106,219, 93, 10, 78,194,189,239,126, 39,
-177,178,248,193,211,207, 83, 45, 88,156,126,224, 44,173,253, 54,107,119,154, 92, 56,183,192,242,237, 45,106, 91,155, 44,221,189,
-192,237,235, 91,180,235,219, 44, 45, 77,147,160,179,186,188,141,107, 43,226, 40,194,239,116, 9,162, 62, 97, 40,137,149,160,125,
-208,162,219,220, 69,211, 29,252, 86, 11,195, 40,160, 52, 65,179,182,131,229,184,196,126,143,205,245, 13, 12,195,192, 48, 13,110,
- 95,191,202,252,145,227,244,123, 45,116, 12,182,247, 55,217,186,157,130,105,166,102,231, 9,251, 29,238,172, 44,179,116,226, 12,
-141,218, 46,154,238,178,189,189, 67, 99,191,206,214,237,155,156,125,228,173,172,222,184,197,217,179,243, 76, 47,150,177, 11, 85,
-204, 66, 33,157,240, 12, 3,205,113,208,172,148,152, 39,116, 13, 61, 95, 30,141,116, 34, 27, 23, 18,153, 78,218, 81, 15, 12, 7,
-213,107,210,222, 90,167,185,185, 69,189,182, 79,175,219, 35, 12,125,162, 1,189, 76, 41,108, 1,239,252, 39, 63,159, 74,238,154,
- 1, 42, 7,180,225,202,235,196,205, 46,193, 51,223,193,234,116,209,139, 46,173,149, 77,110, 6,138,104,172,196,238,250, 54, 63,
-189,186, 78,127,231, 26, 66, 51, 80, 66,207,164,112, 61, 59,115,180,116, 66, 19,105,219, 88,122,176, 15,112,141,122,186, 95,243,
-242, 8,161,112,238,186,159,214, 83,159,231,255, 39,235, 61,131, 37,205,238,243,190,223, 9,111,232,183,211,237,155,230,134,201,
- 51, 59,187, 0, 22, 11,236, 46,136, 68, 1, 32, 64, 2,140, 32, 9,138, 42, 6,155,146, 37,154,148, 69, 37, 75,162, 44,127,177,
- 68,149,100,203,102,149, 75,150,168, 18, 85,182, 40,209, 2, 45, 75, 44,217,148, 64, 73, 96, 0, 19,210, 2,139,197, 98,243,238,
-236,196, 59,115,115,232,219,249,205,231,248,195,121,187,251, 14,141,170, 45,236,236,204,237,219,115,187,251,156,127,120,158,223,
-163, 91, 11,168,192,167,204,113, 34, 46, 45,240,155, 11,136,246,162, 91,129, 20, 41,217,164,143,144, 26,191,217,230, 91,191,241,
-239,248,213, 63,218,226, 47,255,217,159,100,115,221, 80,247, 51,222,251,129,235,124,237,165,251, 92,187,176, 72,237,195, 31, 34,
-253, 87,191,129, 94,104,208,141, 15,201, 6,199, 51,155,215, 76,121,115,102, 87, 46,206,120, 71,167, 98,183,105, 84,168,197, 62,
- 18, 70, 50,139, 75,149, 60,178,163,180,149, 50,247,236,159,155,118,167,226, 76, 87, 59, 83,224,203, 41,209,198,177,229,177,246,
- 81,101, 62,103,172, 98,103,147, 91,166, 88,214,105,202,197, 20, 14,115,182,184, 56, 99,208,151,179, 85,195,116,186, 32,207,240,
- 8, 42,207,114,145, 32, 40,206,160, 93,237,188,126,152, 21, 33,213,252, 69,137, 51,124,249, 71, 9,116,238,247, 31, 65,200,207,
- 39, 13, 83,255,112,181,111,119,211, 16, 75,235,218, 53,234,207,124,175, 59,120,243,164,138,110,243, 33,143,177, 42,192,166, 57,
-182, 40,208,170, 73,212, 92, 68, 9,197,202,242, 34,239,250,224, 51, 68,117, 31,109, 45,245,208, 39,242, 20,139,205,128, 31,250,
-200,147, 92, 88,105,241,216,197, 69, 86, 27, 53,214, 87, 58, 52, 61,201,123,206,119,216,108, 6,108, 54, 2,214,162,144,165, 70,
-141,205, 78,131,205, 78,131, 86, 20, 80,247, 3, 86, 58, 13, 90,181,136,165, 78,139,122,224,225,107,141, 53,165, 67,210,250,154,
-186, 47, 73,139,130,181,118,157, 80, 73, 22, 66,143,102,232,211, 14,124, 34,223,167, 17,120, 44,215, 35, 30,191,112,142, 70, 84,
- 99,169,221, 98,109,185, 67,179, 94,103,161, 17,113,225,252, 58,126, 16,176,180,186, 68,179,211, 36,234,116,104,180,219,212, 59,
- 11, 14,247, 92,102, 40,111, 10, 68, 42, 17,149,237, 84,106,133,246,125,116, 24, 34,148,135,148, 10, 29,212,240, 90, 29,130,122,
-199, 5, 37,109, 63,164,222,233,208,106, 9, 84, 51,164,251,149,151, 24,189,254, 85,108, 94,206, 2,153,108,117, 92, 8, 33,102,
- 60, 5, 23,128,226,156, 14, 51, 6,194, 60,214,207,125, 84,206,190, 39,171,162, 85, 75,137, 18,211, 92,115,139,146, 10, 97,220,
- 10,168, 4, 98, 99, 72, 75, 75, 77, 73, 58,129, 19,198,105, 33,104,106, 77, 39,208,212,149, 64, 27, 23,153,154, 23,150,164, 40,
- 57,141, 11, 14,179,130,126,110, 24,229,150,114, 26, 60, 3,148,121, 78,154, 76, 8,165,165,169, 21, 43,129,162,233, 41,106, 38,
-199,211,174, 40,195, 74,164,223,192, 22, 41,194, 90, 39, 36, 22, 30, 11, 31,254, 94,130,115, 29, 76, 50,161,204, 14,216,250,242,
-203,124,249,151,238, 48,220, 91,229, 29,127,162,205,209,237,152,254,201, 33,135,119,142, 57, 62,200,168,249,112,255,232,128,225,
-142,129, 60,192,212, 6, 28,246, 78,233,103, 9,253, 1,220,218,143,233, 29, 53,121,115,119, 72,220,111,115, 26,167, 20,227, 22,
-223,124,107, 66, 49, 58,199,149, 27,151,168, 47, 42, 30,220,223, 33, 43, 11,242, 33, 12,187, 57, 23, 31,191, 76,173, 81,103, 52,
- 26, 96, 75,201,234,187,159, 65,253,197,159,248,254, 95,144, 66, 83, 76,134,232, 80, 51, 25, 12, 93,176,213,242, 38,182,200,105,
- 92,122,156,157,151, 94, 98,210, 61, 33, 29,140,184,250,204,123,200,226, 17,217, 36,197,154,130,248,244,148, 11, 79, 62, 9, 66,
- 50, 62, 57,166,113,110,141,176,115,142,209,254, 67,252,230, 18,118,220, 67,212,218,136,108,132,240, 27,152,204,141,110,164, 86,
- 8, 99,241, 91, 11, 72, 63,164, 72, 39,172, 92,187,142,201, 74, 94,254,205,223,224,234, 7,222, 71, 58,236,209,223,221,163,177,
-188,140,240, 66, 76,146, 80, 20,146,248,112,135,171, 31,253, 8,233, 40,225,104,107,143,124, 28,179,114,110,137,167, 63,242, 97,
- 46,126,240,227,220,121,241,117,162, 86,196,198,229,199, 88, 92, 90,197,104, 77, 81, 26,210,113,194,225,206, 1,109,223, 39,242,
- 60,162,134, 70, 6, 33,218,131,139, 79, 60,206,246,214, 46, 59,119,183, 81, 69,204,165,119, 93,165,123,112,202,238,246, 62,161,
- 7,189,193, 9,233, 32,229,210,213,101,122, 39,167,132,158,226,169,111,123, 22,107, 61,110,190,177,139, 20, 3,150,150,218,180,
- 23, 86,217,222, 58, 37, 25, 14, 25,199, 19,226,225,128, 34, 27,146,230, 5, 66, 90,148, 23,144,229, 3,242, 60, 69, 8, 75, 26,
-143,233, 15,199,180, 90, 75,156, 28,238, 17,250,117,142, 14,143, 40,227, 9, 39, 71,135,188,241,230,107,180,219,231,184,125,231,
- 37,150, 23,214,185,121,251, 13,174, 93,123, 7,121,150,114,120,184,207,147,239,125,150, 23, 94,124, 14,145, 21, 44, 44,157,163,
- 22,213,216,186,117,135,143,125,242, 25,214,174, 93, 70, 4,181, 74,221,109,144, 58, 64,250,161,179, 46, 89,231,135, 20,181,214,
-153, 91,193, 58,107,152,148,149,154,185,172,102,180,134,228,248,128,209,254, 62, 39, 59, 59, 76, 70, 19,138,220, 85,148, 38, 47,
- 16, 72,134,195, 49,159,254, 75, 63, 3,209,130, 59, 64,173, 70, 8, 15,122,183, 41,111,221, 39, 75, 19,204,191,249,247, 4, 23,
-215, 41, 6, 67, 94,127,249, 62, 59,131, 33,111,189,253,128,255,102,235, 69,108, 62, 60,163, 26,179,238, 66,151, 46, 39, 64, 84,
- 1, 42, 98, 30, 65,230, 40, 86, 66,128, 41, 16,131, 46,191,240,211,255, 45,127,247, 31,124,150,209,131,251,124,251, 99, 11, 20,
-194,160, 61,159, 34,201, 17,158,143, 16, 18,237, 7,168,181,243,110, 13,226, 7,140, 14,183, 17,202,163,179,121,153, 31,251,177,
- 63,199,147,207,124,128, 31,251,153,239,229, 95,255,147, 95,230, 7,254,139, 31,161, 57, 56,225,251,126,230,207,241,251,159,251,
- 26, 79,190,247, 26,147,131,135,232,251,251,132, 87,174,115,124,251, 27, 85,119, 45,230,177,167,213,197,236,238, 59, 87,229,255,
-255, 82,196,206, 52, 42,178,202,254,118, 93,171,249, 99, 0, 26, 59,219, 81,207,137,109,211,223,171,212,235, 21, 18,110,230,109,
- 63,131,172,181,143, 36,182,157,177, 18, 85, 8, 87, 42, 44,108,165, 90,154,251,208, 43, 21,242,236,192,174,246,219,198,216, 25,
- 2,214,206,160, 50,211,219, 94, 59,111,123, 53,198, 21, 66, 84,164,183, 63, 6,198,153, 38, 94, 73,129, 8, 34,188,198, 34,228,
-153,219, 93, 50,231,221, 51, 77,162, 19,243, 90,115,110,249, 19,103, 92,127,103,146,237,170,167,163,181, 36,188,241, 1, 26, 79,
-126,104,150, 2,232,212,118, 18,164, 66,218,156, 60,158,144,199,110, 66, 83, 76, 6,180, 22,106,172, 94, 88,195,150, 37,202, 15,
-176,101, 73, 88,243,168,215, 35, 46, 95, 89,101, 97, 99,157,197,213, 69,116, 16,112,254,202, 38,171,203,109, 86,151, 91, 44, 54,
- 3, 22, 26, 53,150, 91, 17, 23, 46, 45,179,210,172,209,168,105,234, 81, 72,189, 22,112,110,177, 69,189, 22,208,136, 28,244,197,
-215, 30, 69,150,224, 41,137,167, 37, 89,146, 16,133, 62,157, 86,192,242, 66,139, 72, 10,218,245,128,186,239,187, 14,188, 29,177,
-177,178,200,242, 98,147,213,181,117, 22,151,151,169,213,106, 52,154,117, 2, 79,179,188,177,202,194,234, 18,245,102, 19,237,121,
- 52, 23,151,241, 61, 7,153,209,190,118,232, 80, 79, 35, 17, 46, 64, 5,129, 41, 10,130, 86, 19,229, 59,184,140,210, 1, 58,170,
- 35,181,135, 14,107,248,173, 37,188,122,147,163, 87, 94,192,196, 99, 58,155,155, 68, 13, 40,242, 33,135,191,245,235,228,167,125,
-231,132, 48,115,130,226,108, 10, 85,218,185,206,227,145,178,140, 57, 6,121, 54, 36, 50,206, 53,129, 91, 47, 9,241,104,146,160,
-170,114,204,133, 20,213, 69, 12, 73,233, 86, 6, 13, 37,232, 4,154, 80,184,241,122, 67, 43, 22, 3,143, 80,106,116, 53, 89,202,
-141,227,188,247,139,130,163,196, 48, 46, 93, 65, 96,177, 21,226, 87,160,112,141, 72, 36, 37, 11, 90,177,228, 41, 58,202, 35, 84,
- 46,229,205,150,224,213,151,169,173, 94,197,100, 9, 38,139, 17,198, 2, 5,157,143,252, 32,193, 90,141,120,119,135,255,240,243,
- 95,229, 11,255,234, 24,169, 36,141,134, 96,117, 77, 17,179, 72,214, 63,118,159,181, 50,195, 76, 20, 39,113,215,217, 37,165,226,
-244,164,160, 30,182, 17, 72, 50, 51,161, 29, 44,128,134,205,232, 28, 37, 9,163,114, 68, 47,237, 81,144, 80,211,109,108,156,113,
-251,246, 14,232, 26, 45,189, 72,171, 86,163, 22, 45,115,237,233, 13,234,203,117,202, 73,201, 96, 56, 32,233,129, 94,188,112,145,
-201, 96, 72,123,253, 2, 97,187,205,253, 23, 62,199,230,103,126,156,187, 47, 60,199,226,250, 58, 15,190,254,101,122,135,123,180,
-151,155, 44, 93,185, 68,111,119,159,214,114,135,104,245, 28, 20,110, 15,178,127,235, 13,206, 63,245, 1,214,223,253, 94,138, 52,
- 99,116,176,141, 95, 11, 41,227,145,203, 69, 79, 99,132,242, 16, 18,210,211, 19,106,171,107,238, 98,247, 3,240, 66,226,195,251,
-120, 81,155,222,246, 93, 14,239,222,227,169,239,254, 4,111,253,209,115, 60,249,221,159, 32,233, 13, 56,221, 59, 98,251,230, 91,
-132, 53,197,210,210, 26,239,252,115,127, 22,252,136,131,219,175, 49,238,245, 56,255,248,101,148, 31,112,122,220,229,246,235,191,
- 67, 84,143,240,234, 75, 46, 57, 14,201,112,175, 75,150,197,216,220,178,113,249, 2,194,211,152, 92,112,180,117,139,206,178,194,
- 15, 60, 94,125,254,155,140, 79, 71, 52,154,138,206, 98,135, 60, 25, 19,143, 39, 68, 53,159,120, 52, 98,253,194, 58,229,186,192,
-164, 5,173, 78, 13, 99, 37,119, 31, 60, 96,208, 29,209, 63, 61,230,189,223,118, 9,165,155,228,153, 96,125, 99,157,195,195, 46,
- 39,167, 39,148,229,136, 56,147, 28,159,244,136,116, 70,107,233, 42,136, 4,165, 61, 70,195, 33, 65, 24,185,149, 95,225, 49, 24,
-109, 83,150,146,188,136,185,191,179,141,148, 1,146,152,237,189, 93, 58,157, 54,175,222,124, 25,165, 20,127,240, 71,191,205,234,
-218, 6,199,221, 46,195,223,249, 77, 30,187,244, 14,254,159,223,250,119,188, 55,181, 92,187,116,129, 31,254,169,239, 69,132, 53,
-240, 3,180,167, 49, 69,137,174,133, 8,165, 92,220,229,116, 90, 18,134,243, 52, 14, 97,157, 61, 77, 77, 59, 60, 5, 36, 32, 61,
-204,228, 20,140,101,120,116,204,168,215,195,106,207,121, 42,129,194, 88, 10, 83,240,157,223,243, 81,104,175,128,246,171,177,148,
-198,210,135,237, 93,231, 91,255,221,223, 35, 56,191,140,205, 11, 6,187,199, 60,156,100, 12,211,130,239,249,155,127,154,112,245,
- 50,121,119,123, 14, 87,153, 18,239,164,194, 8,235,134, 7,210,161, 70,231,163, 59, 7,169,240,149,229,187,190,251,103,249, 19,
- 63,252, 87,248,212,227,134,175,188,125,135,201,173,151,249,235, 63,244,110,242,194, 9, 19,109,158, 99, 3,143,244,228, 24,109,
- 10, 16,218,121,106, 5,216, 34,195,154,130,214,226,227, 44, 52, 45,167, 91,119,248,103,191,246,207, 1,248,239,255,201, 63,229,
- 67,159,252, 56,225,194, 37, 6, 71,199,116,254,210, 95, 96,248, 95,254, 28,157, 27, 79,187,231, 81,117,204,211, 11,231, 17, 7,
-153,176,206,207, 45,167, 23,225, 20,196, 98,103, 22, 55, 99,173,139, 57,126, 36,162,148, 71,212,236,115, 53,248,153,240,146,105,
-155, 62,179,126, 49, 91, 69,184,125,250,163,105,104,179,245,197,217, 8,214,202,151, 46, 85, 88, 9,232,242,106,114, 35,230, 52,
- 60,229, 70,241,101,105, 17, 82, 35, 85,128, 41, 38,149, 13, 79,205,118,140,186,185,142,240, 2,242,254,125, 68,153, 87, 75,124,
- 59, 63,240,109,101, 1, 84,211, 36, 13,133,215, 88, 67,232,128, 98,116,122,166, 88,179,143, 68, 0, 79,215, 64,182, 52,179,233,
-194,156,222,231,126,182, 74,200,106,202, 48, 5,232, 88, 84,180, 52, 53,209, 87,223,207,175,126, 64,185, 11,140,242, 35,188, 32,
-192,143,106, 44, 95,190, 68, 49,236, 81, 95, 59,135, 16, 37,249, 36,198, 22, 57, 66,182,240,163, 16,164,162, 72, 29, 5,179,190,
-180, 64, 89,150,110, 76, 95,150,140,122, 3, 58, 69, 65,150,228,148,105,134,177, 80,230, 25,105,156,145, 23, 78, 15, 97,173, 2,
-235,172,121, 6,131, 18, 1,201, 36,165,217,140, 96,173,141,148, 30, 69, 81, 96, 41, 89,106,183,200,203,210,249,166,243,140, 90,
- 88,163,179,186, 10, 88,194,122, 11, 47, 12, 40,203,204,189,174, 69,129, 10, 2,164, 84, 4,145,143, 45, 74,130,102,132,146,146,
- 98, 50, 4,163,144,158,166, 76, 83,172,180,100,131, 83,106,157, 37,231, 76,200, 98,252, 90, 29,139, 65,121, 1, 66, 40,116,173,
-134,174, 53,240,106, 13,108, 81,224, 71, 13,130, 70,141, 48, 2, 25,212, 48, 73,128, 45, 42, 63,121, 81,206, 35,131,172,197,170,
- 51,204,227, 89, 78,130,153,227,145, 43,125,132, 53, 85,143, 48,195, 44, 75,103, 45, 44, 43,199,201,116,127, 93, 41,241,167, 70,
- 16, 89,217,206, 26, 90, 83, 90, 8,113,123,116,163, 33, 85,134,154, 84,120, 8,199, 84, 80, 18,100, 13,202,161,203,174,168,130,
-123,106, 66,208,212, 2, 83, 74, 74, 99, 92,173, 87,173,111,252,138, 49,239,219, 42,147,188,218,191,251,158,194,152,148,228,100,
-139, 34,238,207, 37, 31, 70,114,250,245,231,248,237,127,252, 18, 55,191, 50,162,177,146,210, 90, 78,193, 36,172, 60,246, 52, 94,
- 35,226,233,252, 47,240, 92,244, 63,145,142,250, 68, 13,205,233,164,199,165,165, 21,188,154, 32,233, 11, 34, 45, 25,103, 41, 4,
- 37,202,106,222,249,228, 18,223,252,198, 14,169, 63,166, 93, 91,162,155, 28,209,241, 87,216, 88,188,198, 82,171,197,189,221, 29,
- 54,151,158, 96, 16,247,184,124,227, 34,175,189,249, 69, 30,219,248, 32, 91, 47,191,200, 51, 63,252, 41,186, 15,250,104,161,232,
- 29, 14,208,147,193,144,164,223,197, 26,143,173, 87, 94, 98,113,125, 21,147,231, 36,221, 19, 14,135, 61,252, 70,139,229,181,101,
- 22, 54,207,243,240,213,215, 88,190,116,153,201,112,200,194, 99,239,230,237, 47,252, 14,195,222, 33,207,254,232, 79,114,122,251,
-109, 26,171,231, 56,188,245, 42,235,239,124, 47,113,191,135,202, 19,106,171,151,153, 28,237, 81, 91,232, 48, 57,222,199,111, 52,
- 40, 83, 39, 34, 75,250,110,116, 28, 45,180, 57,188,115,151,198, 66, 29, 79, 90,116,212,226,242,123,222, 69, 50,140, 57,184,123,
-143,173, 87,222, 98,227,218, 58, 79,252,224,143,146,119, 7,116,183,183,121,240,250,171,132, 81,131,139, 55, 46,225,181, 23,185,
-253,194,203, 20,233,136,122,179, 65,158,166, 12,143, 79, 64, 5, 12, 7, 67,108,158,210, 59,233,146,142,187, 72,191, 65,232,151,
- 4,181, 14, 11, 43,231,200, 40,217,221,218,101,117,181,193,187,159,126,154, 36,206, 72,178,132,126,127, 72,156, 22, 12, 78,251,
- 76,198,251,148,118,200,185,205,203,108,239,158,178,253,224,109, 54,214, 58, 40,173, 24, 14, 83,206,111, 54,192, 70, 12,227, 49,
-147,126, 70,145, 25,178, 44, 39, 73, 50,242,162,192,148, 49, 87, 47, 52, 80,202,103,107,111, 27,229, 55,240, 68, 73, 20, 54,221,
-170, 47,239,115,243,238,155,116,218,154,135,187,175,179,126,174, 77, 18,231,244,123, 59,156, 63,127,157,237,157,155, 44, 54,159,
- 96, 60,121,147, 86, 99,145,254,100,196,228,222,109,122,147,132,183,146, 33, 55,239,239,114,227,234, 83, 60,220,191,197,223,254,
-197,191,201, 56,203,209, 81,232,198,204,121,142, 14,195,106, 60,236,186, 21,237, 5,110, 68,206,153,228,171,178,156,207, 57,221,
- 73,232,108,136,249,136, 50, 75,137,123, 39,196,131, 62, 88,220, 62, 93, 73,242,212, 89, 20, 67,237,179,244,238,167,156,109,109,
-230,163, 42,161,191,135, 57,238, 82,228, 25,188,245, 54,226,210, 38,229,120,204,205,123,135,168,166,143, 25,142,120,255, 47,254,
-115,178,211, 59,213,184,190,116, 22, 40,233,158,171,148, 26,137,117,148,186,233,206,214,184, 21,129, 53,146,176, 25,240,255,254,
-226, 63,230,195,159,254,243,124,236,253,143,113,233,156,207,119,159,174,240,197, 55, 46, 97, 70,175, 96,234,139,120, 90,146, 22,
- 25,182, 12, 40,226, 17,244,123,136,206, 50, 82,249, 72,161, 48, 66, 66,105,232, 15, 15, 9,228,101,174,190,251,221, 28, 14,122,
-179, 14,227,151,254,183,127,200,255,248, 47,126,135,222,193, 22,173,149,101,228, 51,239, 66, 25,129,108, 46,144,143,122,206, 75,
- 62,189,160,167,105,105,103,104,113, 98, 10,118, 17,103,236,108, 22, 76,165,157,159,118,178,162,178,127,207, 95, 19,135, 86, 45,
-167,226, 55,139, 67,249, 82,221,151,213, 40, 94, 41, 49,167,211, 21,211, 34, 96,122, 57,139, 51, 5,135, 83,247,206, 46,218,234,
-185, 26,172, 43,108, 68,165,111, 47,166, 59,248, 51, 54, 61, 11,210,107, 99,172,193,152, 49, 66, 74,138,202, 35, 79, 97, 17,233,
- 0, 59,201,177,133, 43, 12,164,117,143, 43, 42,221,128,208,129,123, 47, 25, 23,240, 99,115, 67, 25,143, 48,197, 49,182,200,220,
-225,110,108, 69, 38, 19,238,189, 56,163,244,149,103, 84,246, 83,202,142,152,141,232,203, 98,186,111,175,238,113,164, 3,223, 96,
-221, 46,221, 15, 33,141, 93,183, 46, 37,232,208,229,132,183,219, 52,180, 19,241,146, 47, 3, 25,101,156,224,213,234,116,174, 52,
- 40,227, 9,104,141,181, 5,170,222, 64, 55,154,144,142, 40,146,196,233, 49,132, 4, 95, 98,165,199,164,223, 39, 29, 78,220,197,
- 93,134,232, 70, 78, 54,206, 0,229,114, 76,112, 35,247, 34, 78,240,235, 17,237,118, 8,198,115, 3, 19, 37,104, 46, 45, 80,164,
- 73, 53, 22,118,197,166,146, 18,229, 5,120, 65,132,212, 10, 47, 10,208,126,132, 45,221,238,219, 20, 37, 74, 74,172,176, 40,207,
-131,192, 67,216, 18,229,215, 28,205, 50, 79,145, 86, 34,130, 0,147, 37, 72,169, 41,134,189,202,190,169, 81,202, 3,233,118,195,
-202,247, 80, 97, 29,191,189, 68,127,235, 14, 90,123,248,245, 6,205,134, 64,105, 87, 60,244,191,246, 42,233,241, 81,149,178,103,
-231, 16, 68, 41,177, 69,129,240,228, 44,159, 88,216, 41, 76,168,186,100,237, 52, 53, 87,206,180, 23,211,194,210,158,161, 33, 98,
-203, 10, 13,236, 62, 15,211,211, 72, 75, 65,205, 74, 39,156,149,146, 64, 73, 60,233, 82,239,146,194,224, 43, 65, 32, 92,231,237,
-215, 86, 80,181,101,138,242, 54,158, 25, 18, 74, 65,199, 19, 8,235,126, 86, 9, 37, 69, 41, 80,202,137,240,180, 21, 4, 82,208,
- 82,130,154, 18,104, 3,138,210,101, 97,148, 5,118,210,115, 86,202, 42,192, 71,135,171,116, 55,255, 60, 47,125,254, 46,253,227,
- 1, 23,158,108,209, 63,200,169, 7, 37, 75, 43,239,227,219,159,253, 71,116, 38, 47,146,141, 66, 62,181,248,211,252,171, 87,191,
-139, 35,241,105,174,174,105, 14, 7,135, 52,194,136,123,219,247, 56,223,190,128, 73, 50, 78, 71, 49, 27,231,150,121,245,230,235,
-124,250, 83,223,207,103, 63,255,219,188, 99,105, 21, 79, 55,232, 4, 75,156,246,247,152,140,186, 92, 88, 95,133,124,204, 56, 61,
-162,187, 27, 35,133,226,153, 79,222,224,149, 47,188,198,221,231,111,227,121, 17,214, 64,212,140,144,101,150,177,114,253, 9,198,
-189, 30,139,231, 86,105, 44,175, 80,140,251, 52, 23, 23, 56,247,216, 53, 86, 47, 95,160,181,126,129, 44,205,104, 44, 46, 18, 52,
- 91, 44, 94,112, 89,233,227,238, 33,207,254,200, 79, 50,216,190, 79,216,106,241,224, 91, 47,176,114,241, 18,170,190, 72,210, 61,
- 33,108,118, 40, 38,167,132,205, 22, 50,172,147, 15,187,232,214, 18,131,221, 45,138,116, 66, 17, 15, 72,250, 39, 16, 46,115,122,
-255, 30, 65,179,195,218, 59,222,197,209,219,183,105,158,191, 66, 62, 30, 81,111, 52,120,250, 19, 31,231,218, 7, 63, 68,188,183,
-205,238, 27,111,240,210,239,253, 1, 81, 75,210, 89, 95, 33, 45, 4,111,191,248, 26, 39,251,219,116, 86, 59,104,173,233,172,174,
-162,188, 26, 15,223,222,225,171,159,255, 67, 94,253,202, 87,104,120,134, 11,151,174,225, 41,201,202,198, 85, 38, 73,201,193,209,
- 62,119, 94,125, 21,145,245, 89,218, 92,228,193,246, 30,247,238, 63,224,237, 87, 95,225,244, 96,159,219,111,190,137, 77,143,185,
-116,233, 26, 69, 82,146, 38, 99,122,199,167,124,199,199,190,157, 75, 87,159, 32, 43, 34,146,201,152,102,103,129,126,191,207,225,
-246, 9,133,153,128, 54,212, 26, 30,151, 54,214,233,212,151,105,132,109,210, 84, 48,154,228,216, 66, 16,169,128,162, 44, 72,242,
-148, 97,156, 32,181,160, 55, 58, 33,141, 3, 60,134,236, 31,158,114,127,103, 11, 35, 20,175,188,245, 22, 81,205,227,171, 47,191,
-202, 82, 59, 98,231,228,132,192,243,232,142, 99, 2, 79,179,208, 12,121,241,222,109,110, 92,239, 47,154,189, 0, 0, 32, 0, 73,
- 68, 65, 84, 90,224, 95,254,250,103, 25,231, 14,166,130,117,112, 21, 21, 56, 4,175,144, 18,169,117,213,161, 7, 21, 83, 80,205,
-213, 85, 74, 87, 55,133, 7, 4, 78,218, 90,164, 96, 11,146,227, 35, 78,238,111, 49,158, 76,156,122,212, 66,145, 22, 20, 73, 66,
- 60,202,248,196, 39, 63, 4, 65,139, 89,110,168, 21, 64, 6, 7, 7,148,227, 9,249,214, 22,202,211, 8, 83,178,243,198,125,134,
- 11, 11,244, 30, 28,242, 39,255,227,175, 98,178,163,234, 16,102,166, 94,118,103,133,235,166,133,212, 8,237,205,199,240,179, 74,
- 58, 71,249, 30,255,240,223,253, 30, 31,126,255, 19, 92,222, 12,248,197, 95,248,171,124,230,207,252, 20, 55,174, 7, 12, 83,131,
-205,115,164, 18, 72,139, 99, 78,219, 18,115,122, 50,223, 51, 75,144, 24,208,154, 82, 22,188,113,171,203,157,123,111,241,153,239,
-251, 30,119,152,120, 48, 49, 17, 23, 46,249,124,235,185, 55,157, 74,247,199, 63,131,217,218, 38, 90,220,152, 43,208,153,101,178,
- 58, 30,246,153,101,183,153, 38, 87, 85,207,123,218,129, 78,215,199,211,238,211, 78,211,171,230, 16,249,121, 62,250, 25,194,170,
- 41,237,124, 84,125,134,139,238,186,250, 51,217,234,198, 96,138,178,250,190,165,155,184, 32,153,166,166, 58, 47,177,193, 22,147,
-249, 1,107, 77,117, 24,155, 71, 70,164, 22, 67,153, 14, 40,211,211, 89,126,246,252, 47, 96, 41, 39, 93, 76, 58,170,130, 88,230,
-148, 58,191,115, 25, 85, 91, 65,183, 54,145,126,228, 30,215, 26,164, 52, 20,227, 67,108,230, 32, 38,214,148,211, 24,152,185, 15,
-157, 57,124,126,214,196, 25,215,177, 79,167, 9, 83, 0,151,157, 22,146,194, 34,253, 26, 50,219,155, 23, 1, 83, 49,160, 80,160,
-130,153, 24, 76, 5, 33,209,242, 42, 65,187, 67,184,236, 52, 39,254,210, 2,181,197, 22, 94, 43, 34, 88, 94, 34, 88,108, 83, 91,
- 92,160,182,208,196, 15, 20,210,215,120,141, 8,169, 93,108,177,174, 57, 91,104, 16, 53,168,119,154, 4,205, 8, 29,248, 4, 97,
- 64,212,106, 82,107,214,240,107, 1,126,168,241, 61, 77, 80,215,212, 91, 53, 60,237, 17, 68,154,168, 85, 35, 12, 20,194,196,132,
- 97,141, 90, 20, 17, 69,154,122,163, 69, 45,138,104, 84,143, 17, 70, 33,126,224,187,100,178, 70,147,176,214,192,247, 53,186, 86,
-195, 15,125,119, 57,121, 26, 41, 36, 38, 75,240,107,110,188, 46,176, 40,173, 8,155,109, 60,223, 67, 7,117,148,246,241,194, 16,
-169, 60,116,212, 64, 69, 53,164, 23,226, 69, 77,148, 95, 39, 27,141, 73, 7, 67,130, 64, 16,117, 26,248, 81,192,224,104,196,233,
-243,191, 77, 57, 73, 49, 69, 81, 37,174, 85, 93,123,233,222,203, 54,183,149, 61,114, 42,144,155,231, 24, 88,203,140, 36, 56,207,
- 21,102,134,133,157, 90, 25,167,238, 17,169, 42,113, 36,142,104, 40, 75,240, 4, 52,180,162,165, 20, 13,169,136,164, 36,148,130,
-150, 22,212,112, 34, 59,167, 27, 72,201, 71,187,136, 60, 38, 64,208,242, 20,107,190,102,197, 87, 52,181,164, 38, 36,129,114,123,
-251, 0,129, 47, 32, 16,174, 91,215, 21, 83,193, 90,233, 66, 10,167,211,175,233,223,213, 90, 98,235,241,246, 27, 47, 33, 2,133,
-212, 5,129,239,179,180,209,164, 29, 61,195,143,254,181,191,202,226,141,111, 98,174, 10,204,149,152,236,114,206,103,158,253, 60,
- 31, 82,255,128,123,221,101,162, 32,224,246,221,109,150,162,115, 36,105, 12,228,172, 54, 86,144,101, 72, 22,215,121,233,197, 55,
- 88,240, 22,120,227,248, 38, 53,161, 73,138, 4, 99, 5,158, 47,105, 46, 23, 68, 65, 6,101,201,131,195, 99,124,219,230,197, 47,
-252, 1,101,174, 73, 99,159,163,237, 9,158, 14,156, 6,238,100,251, 1, 97,107, 1,207,211, 52,150,154, 68, 75,107,236,188,246,
- 34,155,239,126, 31,101, 26, 83,100, 49,183,190,254, 53,214, 46, 95,101,245,198,117,186, 91,135,228,241, 9,216,144,119,126,244,
- 35, 12, 30,220,169,198,186, 26,223,247, 9,150, 54, 41, 38,125,106,157, 37,144, 30,194,228, 8,229, 81,164, 57, 65, 84,195,228,
- 41,237,141,139,140,142,118,137, 22,150, 81,181, 54,253, 7, 55, 89,189,126, 17,155,167, 32, 44,181, 86,147, 50,203,200,146,156,
-120, 18, 99,165,100,239,185,219,100,233,144, 65, 55,101,121,173,201,210,230, 69, 78,247,142,232, 29,141,185,245,226,171,124,232,
- 59,159,166,209, 89,165,119,124,202,112, 56, 98, 50, 78, 56,222,235,226,201,130,143,126,247,119,145, 22,134, 87, 95,124,141,181,
-245,101, 30,222,219, 34, 30,229,116, 79,118,184,126,227, 34,237,214, 10, 55, 95,190,141,201, 18, 40, 97, 99, 99,131, 7,187, 61,
- 66, 74, 46, 94,127, 7,119,238, 60,228,198, 99,215, 72,146,156,203,143,109,114,235,222, 67, 70,131, 35,106, 94,139,181,181,101,
- 70,227, 4,207,143,232,159,198,100, 73, 78, 88, 15,137, 99, 67, 81, 88,116, 93, 98,100,141,221,195, 30, 74,122, 44,175, 44,147,
-100, 57, 81, 36,209,218,112,212, 27, 98, 10, 15,137,101,175,123, 72,171,222, 36,207, 6, 32, 82, 14,123, 6, 45, 37,195,137, 38,
-244, 83,142,251, 6, 97, 71,244, 70,117,154, 53,159,221,254, 8,133,229,175,253,228,247,241,211,127,227,175,208, 31,246, 80, 94,
- 48,143, 57,245, 61,247,218, 72,229, 20,163, 65, 4,126, 80, 45,181,196, 31, 83,101, 9,119,153,207,198,182, 67,151, 92, 52, 26,
-209,123,184,197,225,238, 30,147,241,132,210, 24,183, 79, 79, 50,148,214, 44,157, 91, 32, 88, 89,129, 90,219, 97, 57,167, 99,207,
-124, 2,195, 1, 70,121, 20,255,241,183, 8, 54, 86, 73,211,148,109, 36,233, 96,128,108, 71,172,125,252, 71,221,200,214,130, 65,
- 84,217,226,194,117,209,158, 3,203, 24,227,118,205,170,116,161, 21,115,101,152, 0, 47,226,252,245,247,208,207,250,236, 28,222,
-229, 87,126,231,247, 64,194, 15,255,216, 79,241,224, 63,254, 26,181,155, 95, 71,214, 27, 72, 79,186,241,178,209,100, 7,187,212,
-174, 62,238, 46,237, 90, 68, 62, 78, 73,199, 61,126,252, 83,223,229,236, 88,221, 19,126,233, 87,255, 37,207,125,253,157, 76,134,
-125,254,246,223,248,235,220,187,185,199, 36, 27, 0,224,111,108, 16, 23, 57,171, 79,127,156,209,246,155, 21, 88, 67,204, 70,115,
- 74,206,148,111, 21, 32,115, 74, 67,171, 4,104,218,193, 52,164,146, 85,184, 69,149,126, 86, 58, 75,145,157,134,170,152,105, 26,
- 92,181, 31, 47,173,179,208,137,185,178,125,122,201, 97,166,223, 99,170, 40,158, 14, 90,166,246,175, 0,175,177, 9,241, 9, 38,
- 31,206, 4, 77, 83, 27,221, 52,135, 89,206,211, 51,221,101, 56,251,143,184, 34,205, 90,202, 82,204, 71,169, 98,254,156,157, 38,
- 64,162,180, 27, 53,171, 90, 19, 21, 45, 81, 38, 3, 76,210,163, 76,123,143,132,181,204,140, 69, 83,157,192, 89,180,173, 57, 99,
- 89,156, 82,119,203,202,102, 87,169,253, 43, 82,253, 60,242,179,194,214,230,217,128,162,168,129,244,221, 79, 46,205,193,171, 57,
- 4, 89,149,185,169,188,128,168,179, 68,158,197,120,190,196, 38,125,192, 67, 26, 87,148, 42, 99, 48, 69,230, 8, 4, 70, 80,230,
- 49, 22,133,244, 3,202,188,112,214,184,178, 4,165, 81,214,128, 39, 17,198, 81, 24, 75, 85, 34,141,161, 20, 25, 2,137, 31, 10,
-132,118,157,191,197, 77, 16,164,239,158,131, 49, 22, 67, 6, 72,194,118,141, 44, 78,221,138, 69, 24,180, 23,184, 9, 91,165,189,
- 80,218,115,132, 53, 21, 96,202, 2, 79, 54, 16,194,204,200,121,166, 40, 80,158, 87, 77,179, 50,130,122,131,124, 60, 66, 9, 39,
- 68,148, 94, 29,237,249,238,253,225,251, 72,169, 80,158,143, 12,235, 40,237,161,181, 7,214,224,213, 35, 70,183, 95,230,252,119,
-126, 7, 74, 37, 24,165, 24,223,126, 64,178,191, 85,161,253,207, 20,167, 83,101,251, 60,127, 21,107, 42,210,159, 41,177, 56,194,
-223,236, 76,153, 65,104,102,161, 1,213,142,154, 25,226,116,170,217, 96, 38, 43,169, 66,144,140,112,171, 2,155,186, 98,186, 90,
-183, 88,161,102, 66, 61, 41,160, 24,159,206,136,117, 90, 10, 26, 82, 82,104, 69,146,151, 52,164, 32, 20,144, 85,190,255,192, 10,
-106, 66, 18, 2, 53, 36,190,117,105,149, 82,134,142,171, 80,230, 51, 81,157,168,246, 0, 81,179, 67,139, 38,201, 56,197,243,224,
-220,165, 69,198,221,152,235,159,124,158,193,151,123, 68,151,150, 16, 97, 76,124,152, 80,148,150,188, 99,169, 7,219,188,251,225,
-207,240,133,250,223,167, 69, 64, 24,120,140,226, 2, 99, 36,131,226,132, 5,211,100,152, 14, 57,236, 55, 89, 8,154,100,102,192,
-114,184,202, 48, 31,177, 20,118, 56,154,156,112,255,230,128,239,253,228, 71,121,251,193, 31,242,142, 43,239,229,254,246,155, 36,
-195, 77,130,150,166,179,236,115,241,169,107,244,238, 31,177,125,247, 1,210, 87,134,253,219,175, 19,117, 22,201,211,148,231, 63,
-247,239, 89,186,124,129, 36,142,233, 29, 28,145,197, 57,107,151, 46,160, 66,205,209,189,123,116, 31,222,103,243,217,143, 48, 60,
-222,229,222, 55,191, 78,180,224,240,178,187,175,189,194,226,197, 11,228,163, 30, 73,239,132,176,179, 76,124,122,226,170,122, 44,
-201,241, 54,126,163, 67,239,206, 27,160,124,234,203,171, 72, 93, 67,133, 33, 39,111,191, 73,231,250,147, 12,186, 61, 48, 5, 7,
-247,182, 56,185,247, 22, 69, 26, 19, 70, 53, 14,182,182, 72, 70, 35, 60,173,169, 5,150,205, 39, 30,163,183,115, 76, 60, 78,201,
-146,132,103, 63,252, 12,181,206, 57,118,183, 15,232,117, 15, 73,243,130,227,189, 3,164, 72,248,142,239,249, 14, 70,147,130,155,
-175,222, 38, 12, 52,195,193,128,241,104,196,225,254, 54,215,175,159,103,249,220, 5,238, 61,216, 39, 27,101, 44, 46,173,178,114,
-254, 34,167,147,132,227,131, 3, 30,127,199, 19,252,209,239,127,139,100,114,200, 36, 31,114,120,212,229,230,205,219,188,250,226,
- 75,188,227,241, 43,180,151, 22,216,218, 58, 66,251,138,126,191,207,198,198, 18, 11,237, 53, 6,221, 2, 83,133, 44, 36,113, 66,
- 82,140,105, 52, 37, 65,173, 36, 41,198, 96, 83, 38,241,144,163,227, 99, 14,142,250,196, 89,134,210,130,193,100,196,214,209, 14,
-253,137, 32,240, 66, 90,145, 32,206, 82, 14,123, 3,162, 40,224,206,222, 30,237,198, 2,227,180,203,254,233,152,201, 36,225,211,
- 31,123, 31, 63,253,215,126,158, 97, 50, 70,121,190, 35, 28, 89,131,212, 10, 89,117,184, 40,137, 14, 35,135, 96, 18,242, 12,237,
-163, 60,163,137, 14,206, 36,128, 85, 93,102, 50, 97,114,116,192,209,238, 62,201,104,140,181, 78,221,159,199, 25,217, 36,166, 63,
-204,120,223, 83, 87, 32,108,184,112, 30,230,254,106,226, 62,101,119, 64,145, 36,168,106, 15,185,245,210,219,236, 30,118,153,236,
-159,240,125,191,254,127, 80,166,135,142, 50, 53,181,183, 88, 23,106, 32, 61,141,212,161, 19,179,120, 33, 74, 5, 72,165,167,210,
-239,234, 18,177, 8, 60,182,247,118, 73, 6, 5,126, 1, 27,237,186, 11,127,202, 82,158,223, 61,114,227, 59, 37,241,124,141,148,
- 10,169, 21,249,176,239, 70,190, 64, 99,113,141,178, 72,232,239,108,243, 23,255,246, 95,231,111,254,239, 95, 66,141, 6,220,254,
-198, 87,249,210,115, 95,225,104,208,167,168,213,249,214, 87,111,177,185,177, 52,107,162,139,122, 72,163,179, 49,255, 49, 90,123,
- 54,115,101,118,129,115,134, 8, 55, 75, 84,155,238,126,103, 66, 56, 49, 35,110,157, 21, 21, 77,249,241,114,122, 96,202, 71,133,
- 97,211, 29,253, 76,140, 54, 37,176,137,105, 80, 70,197,166, 55,128,201,200,227, 46,182,116, 97, 21,166,156,122,196, 57,147,202,
- 34, 64,132, 51,246,235,116,180,234,242,218, 67,144, 53,183, 31,158,222,247,230, 44, 24,166, 18,190, 86, 93, 13,214, 82,198, 61,
-146,163,215, 49,105,151, 98,114, 92, 93,144,118,214,169, 77,113,176, 98,250, 94, 43,167,171, 9, 59,243,161,159,209, 77, 50, 3,
- 17,159, 13,194, 17, 98, 86,196,136, 74,236,231, 41, 77, 49, 56,153,251,241,253,192,141,243,109,233,254, 62,210,145,227,168,208,
-212, 66,129,244,106,168,176,142,246,131,217,244, 69,105, 55, 25, 50,121,142, 41, 74,242,225,128,124, 60, 1, 99,201,199, 67,242,
- 36,195,230, 41,214, 24,202,188,160, 72, 83,138, 52,195,152,188,218,213,186,203, 89, 42,141,192, 58, 91, 90,224,161, 61, 73, 16,
- 5,136, 34,135, 34, 70,121,154,112,161,141,223, 90, 64,107,229,236,112,210,128,114,186, 5, 97, 92,116,177, 84,202, 93,206, 82,
-160,180, 70, 74,131, 84,158,163, 85, 74, 77,216,106,163,180,231, 82, 21,133,194,164, 49,126,189,142,214, 1, 90,106, 23, 92,228,
- 7, 72,237,163,148,143,242, 66, 4, 10, 47,168,161,163, 22,165,129,248,104, 15, 19,167,172, 93, 94, 67,133, 18, 21,212, 25, 29,
-158,208,123,225, 15, 41, 51, 59,183,106, 87,175, 49,214,206, 94, 83, 51, 29,183, 87,179,118, 81,101, 11,219,162,172,112,176,198,
- 77,177,108, 21,251,236,246, 18,179,130, 88, 88,241,200,180,136,210, 86,239,127,137, 68,160, 5,168,178, 32,172, 18,216, 60, 37,
- 81,149,125, 81, 85,175,191, 48,174, 0, 18,182,226,191,151,130, 64,184,238, 60,210,138,186,148,212,180,131,247, 4, 66,208,240,
- 37, 77, 45,232,120,138,154,150, 46,153,205, 74, 52, 32,170, 24,211, 89, 1,105,220,122,170, 24,222,163,179,180, 78,107,177,198,
-197,199, 55, 64,198,156,123,252, 41, 78,190,254,143,216,122,213,231,155,255,188,207, 27,255, 58, 39, 62, 82,140,239, 73,198,135,
- 2, 93, 23,132, 53,195,183, 23,255,152, 19,209,100, 84, 28,179, 88,111, 34,149,101, 41,106, 16,231, 7,248, 66, 49, 72, 15, 16,
- 54, 33,146, 10,137,101, 49,168,227,107, 69,232,123,104,227,243, 59,159,255, 26,161,182,212, 90, 30, 55,158,184,129, 31,122, 68,
- 30,220,121,169,203,214,203, 47,114,239,245,111, 16,202, 6,178,190,188, 65, 45,240, 41, 76,206,222,157,219,172, 46, 47, 18,181,
-151,185,249,165,223,231,214,243,191,207,219,207,127,137,250,202, 58,219,175,188,196,194,250, 42, 23,158,126, 15, 59,223,250, 6,
-203, 87, 46,112,229,253, 31,102,210,239,179,247,246,155,108,188,235, 73,250, 59, 15,176, 69, 66,173,189, 64,255,225,109,138,116,
-136,242, 92, 12,168,242, 53,101,105,104, 44,173, 96,243,216, 89,166,172, 33, 27, 13,185,240,109,239, 35,237,245,217,254,198,115,
-132,231,206,227,105,195,218, 59,159, 33, 30,197,188,254,141, 23,168,133, 30,203, 23, 54,144,126,157,230,210, 34,167,251, 39, 28,
-239,239, 18, 15, 7,228,217,128,113,214,103,255,193, 67, 76, 62, 38,140,154,236,222,222,230,100,103,151,199,158, 56, 71,111, 56,
-230,230, 27,183,200, 38, 3,194, 90,141,209, 32,231,228,240,152,243, 27, 45, 22,207,173,243,240,222, 46, 38,203,105, 47, 45,178,
-183,127,204,221,187,183, 57,220,187,205,179,223,246, 4,183,183, 79,104,132, 17, 42, 86, 28,236,238,211,235, 30,177, 82,247,249,
-204,143,252, 0, 59,251, 67, 30,110,239,209,106, 71,108,223, 63,194,146, 34, 66, 67, 78, 74,107, 41, 34,168, 7, 51, 2, 86,111,
- 16,115,210,239, 51,152,164,148,185,117, 73, 67,169, 33, 43, 53,141, 70,224, 62, 16,198,146,151,150,243,157, 14,135,167, 93, 16,
-146,253,222,128,220, 20,148,214, 50,137, 83,172,205, 57, 56, 77,232,212, 35,186,147, 17,223,249,190, 27,252,220,223,250,121,134,
-241, 8,165,221,207, 25, 3, 82,121, 72,165,145, 90, 59, 92,123, 16,129, 23, 86,135,244,244, 84, 52,103,180,169,254, 35, 23,186,
-165, 4, 99,200, 7, 39, 12,142,142, 24,245,251, 88,235,148, 37, 69, 90,144,103, 57, 22, 75, 43,144,116, 54,215,161,177,228,192,
- 38, 83, 11, 19, 22,122,167,148,113, 74,185,127,128, 18, 2,155,103,156,140, 51, 68, 45,224,176, 52,172,126,199, 15, 97,146, 81,
- 53,146, 59,179,202, 23, 56,244,171, 23, 32, 84,224,118,237,202, 67,106, 15,132,118, 99, 58,227, 72,105,233,240,128,159,248,240,
- 53, 94,125,243, 33,227, 96,131,102, 61,156, 61,212,246,201, 41,248, 62,104,133,244, 61,119,233, 88, 67, 17,143,161,215,197, 0,
-126,189, 67, 89,166,148, 69,134,242, 61,190,254,127,255, 45, 30,255,254,159,231,205,175,223,229,239,253,157, 95,230, 63,252,235,
-223,228,240,225,132,207,255,238, 23,121,239,159,120,255,236,177,131, 63,245,189, 52,147,234,242, 59,131,156, 20,149, 16, 72,158,
-233,102,166,163, 59, 83,216,217, 24,210,150,243,217,123, 89,184,139,215,148,213,101,126,166, 91,177, 8,202,194, 9, 2,221,158,
-114, 10,161,153, 50,215,231, 88,117, 83, 86,151,237,153,112, 55,201,124,252, 89, 38,125, 23,138, 82,233,126, 85,224,160, 60, 83,
-131,131,210,129,187, 8, 13,179,128, 23,119, 96, 75, 84,208, 68,183, 86, 64,202,202, 23, 62,247,143, 99, 28, 34,214,150,102,230,
-134,156,174, 24, 76, 50,193, 20,238,242,118,145,204,210, 29,222,165,117,251, 94, 30,153,198, 86,135,191, 75,211,154,142,120,197,
-180,101, 51,213,142,220, 50,255,181, 57, 75, 38, 18,243,237,133, 45,220,202, 1,121,198,139,207, 28,134, 34, 85,165,161, 43, 17,
- 94,132,240,220,133, 41,180, 43,252,132,114,239, 57, 83, 58,141,129, 83,137,107,202,120, 76, 54, 26, 97,173, 68,228, 19, 76,154,
-145, 77, 38,148,133,197, 20,105,101,183, 20, 40,191, 62,211, 1, 80, 58,123,159,181, 37,148, 25,214,148,152,220, 56,173, 0, 78,
- 4, 40, 40, 33, 29,224,249, 10, 37,133, 99,145, 91,139,244,156, 50, 92, 5, 30, 74, 41,164,113, 4, 51,165, 21, 74,251, 40,207,
-125,198, 29, 53,207, 67,122,202, 77,112,108,230,214, 3,202, 71,133, 53,132,112,206, 23,165,157,255, 92,215,106,168, 90, 13, 85,
-115,118, 54,132, 34,235,159,112,244,234, 11,120,229,132,230,133, 77,148, 53,216,122,131,209, 27, 15,152,220,127,203, 13,132,242,
-114,246,249, 19,118,154,123,239, 86, 52,114,106,101, 44, 93,102,136, 53,165,155, 36, 80,197,173,150, 78, 20,234,206,253,233,216,
-190,116, 29,125, 21,225, 42,166,209,197, 85, 17, 96,171,115,113, 38, 1, 49, 6,129,197, 87, 2,105, 45,170, 82,186, 43, 33, 81,
- 83, 87, 70,233, 50, 6,166, 26, 13, 97, 44, 90, 64, 36, 21,117,173, 9, 42, 50, 93,164, 5, 53, 41,104,123,146, 5, 45,105, 40,
-129,175, 60, 60,191, 70, 89,164,149,112,212, 48,253,112, 90,220,243, 52,147, 17,235,107, 33,231, 46, 94, 36, 29, 37, 68,205,203,
- 92,255,248,191,224,225,243, 32, 85,193,234, 85,193,210, 26,200,216, 21,223,158, 22, 68,107,150,122,203,178, 33,182, 97,244,101,
-210,216,227,100,116,132, 45, 11,164,244, 8,131, 37,180, 16,148, 20, 72,169, 89,111, 95,116,239, 71, 21, 18,248, 62, 43, 81, 7,
-173, 3, 58,205, 69,218,225, 18,175,189,241, 26, 15,239, 28, 48, 30,116,105, 93, 94,160, 30, 88,238,189,116,196,224,180, 73,191,
-223, 67,142, 78, 79,201,211,156,193,238, 93,206, 63,241, 14, 54,159,121, 22, 89, 91, 32,238,119,121,199,251,191,157,201,233,125,
-162, 78,147,245,199,222,137,246,235, 72,165,209,126, 72,145,150, 20,121,194,248,164,143, 31,120, 32, 33, 90, 90,197, 91, 58,207,
-131,151, 94, 2,147,185, 16, 0, 63, 98,184,191,227, 70,219,184,136,207,108, 56,100,120,180,135, 80, 26,169,125,176,146,254,238,
- 3,158,250,201, 63,195,201,157,219, 92,120,239,251,120,251,203, 95,226,238, 43,175,243,228,251,158,100,243, 93, 79,241,224,205,
-155,244,142,118, 93,164,232,233,152,163,135, 15,217,187,253, 54,146, 2,223,247, 8,194,144,162, 16,156,118,123,140,198, 19, 54,
- 46,175, 49, 24, 38, 28,108, 31, 80,230, 49,157,213, 14,131,209,132,227,227,125, 54, 87,155,172,159, 63,207,105,119, 72,183,219,
- 67,251,146, 7, 91, 15,216,223,223,229,237, 91, 91, 44, 45,250, 28, 28, 29, 18, 15, 39,156,191,222,162,151, 55,248,214, 55,223,
-226,226,230, 18, 65,167,197,151,158,251, 38, 39,199,123, 8, 27, 83,148,240,214,157, 3, 30,220,217,226,181, 23, 94,225,230,107,
-111,242,202,139,175,113,239,214, 45,146,108,196,120,226,178,119, 61, 37, 49,101,129, 16, 25, 69, 57,198,215,128, 52, 52, 35,143,
- 97,146,176,223,139, 89,106, 42,222,218,237,114,101, 99,153, 52, 31,163,181,166, 63, 25, 59, 88,130, 84, 44, 54, 61,238,239,239,
-178,125, 50,230,131,143, 95,228,239,252,226, 63,224,180,127,234,192, 17,148, 46,187, 94,123, 72, 41,221,193,100,140,139, 84,245,
-107, 21,241,235,172,201, 68,254,177,255,159,142,214, 12,144,130,133,164,223,115,235,143, 60, 67,106,237,208,133,113,140, 64, 50,
-202, 44, 63,244,195,159,160,204, 75,240,235,238,107, 28, 15, 9,202, 24,142,143, 41,129,226,222,109,212, 66,157,193,206, 17,251,
- 89, 78, 60, 74,248,224,207,254,168,203, 38, 62, 19,160, 50,237,190,165,144,179, 96, 21,161,106,243,220,112,165,170, 67,162,196,
- 88,247,225, 30,157,246,249,238, 31,253, 24,175,188,244, 28,186,118,145,191,247,247,255, 30,190,118, 95,123,237,198,187, 24, 21,
-214,209,171,148,116,235,126, 41,145, 90,144,239,108, 33,161,234,204, 28,143,186,251,240, 14, 79,127,234,227, 60,255,235,255, 11,
-255,246,247, 95,229,213, 91, 71,252,234,191,253, 42, 95,124,254,109,126,246, 51,239,161,181,178,228,158,103, 89,162, 31,123, 12,
- 37,170, 66,131,185, 63,219,206,254,157,185,231,218,158, 77,106,179,115, 84,172,120,116, 31, 62,235,142,197,217, 78,232, 76,247,
- 94,133,186,216,169,226,216, 90,231,100, 56,155,129, 42,170, 67,205,216, 71,126,166,204,227, 91,220,104, 60,234, 16, 44, 63,134,
-172, 45, 86,187,123, 40,139,152,178, 24,131,156,238,189,153,121,206,139,241, 33,217,201,125, 23,175, 91,150,213,110,188,234,172,
-149, 87, 37,253,217, 89,232,138, 19,246, 25,164,112, 90, 2, 49,125, 30,214, 84,200,223,106,242, 32,253,185, 24,111, 10, 40,145,
- 85,218, 92,117, 96,219, 10,179, 38,228,244,159, 41, 11,190,234,206, 77, 37,202,156,190, 6,101, 73,113,122,136, 73, 97,198,210,
- 53,166,210,109, 76,187,245,194,177, 15,180,155, 10,161, 20,194, 11, 17,211,240, 17, 41, 41,211,216,141,216,189, 0,171, 52,101,
-154, 80, 36, 25,249,104, 72, 54, 74,176,105, 73, 58, 30, 99,226, 12,210, 20,144,148,121, 1, 57,148,147, 33, 54, 47, 16, 86, 57,
-150,183, 45,192, 20, 46, 49,112,120, 68,214, 63,162, 52,105, 69, 93,171, 80,193, 89, 82, 81, 30, 37,168,105,150,183, 69, 6, 62,
- 74, 73,215,169,123, 94, 53,242,150,200,208,119,159,111, 91,186, 81,177,201,145, 72,100, 16,162,148,135, 14,130,202, 26,106, 80,
-126,228,162, 98,181,231,192, 50, 65, 13,229,135,120,245,246,236,253,118,242,214,235,152,222, 30,139, 23, 22, 81,190,135,149,146,
-193,173, 83, 78,191,250,219,148,113, 86,193,101,196, 89,243, 68, 37, 12,156,221,123,179, 59,112,206,127, 63, 3,245,175, 58,245,
-153, 79,220, 86, 66,209,242,204,251, 29, 42, 77, 74,245,125,166, 19,169,234,247,148,116, 30,116,183,235,150, 21, 70, 89, 56, 42,
-164, 49, 8, 97, 43,250, 98, 89,233, 9, 4, 82, 90,148,148,180,151, 46,176,180,184, 65, 77, 86, 1, 48, 72,218, 90,178, 32, 37,
- 77, 37,241,149,162,181,246, 24,205,245, 27,136, 10,195, 76, 57, 95, 83,201,105,238,130, 41,184,241, 67,223, 65, 24,106, 86, 47,
-173, 96,226, 18,191,248,207,188,231,113,205,250, 69,193,249, 15,182,136, 22,157,160,111,150, 80,156, 89, 58,215, 74,108,164,248,
-169,206,151,216,203, 20,185, 21,148,129, 33, 10,107, 24, 3,107,245,243,180,194, 21, 10, 50,186,227, 46, 74,212,200,243,156, 66,
- 23,108,108, 92,224,252,133, 85,154, 77, 31, 21, 6,108, 54, 58,164, 22, 50,147,176,245,205, 29,118,183,183,104,132, 17,107, 23,
- 42, 60,241,207,253,196,247,255, 66,220,139,105, 47, 55, 80,126,141,230,230, 69,190,246,107,159,229,169,239,252, 40,175,125,241,
- 75,188,247, 99,207, 16,158,123, 55, 90,195,214, 43,175, 85,192,249,140,131,155,119, 89,127,231,227, 12,247,247,169,181, 90, 20,
-233,144,124, 18,187,142, 36,233, 19, 45, 46, 16, 54, 22, 49, 69,129, 23,248, 72, 41, 24, 29,239,226,215, 34,226, 65,159,230,202,
- 50,166, 44,185,247,226, 11,180, 22, 23, 8,106, 17,111,124,225,247, 88,186,116,158,221, 55,223,192, 22, 41,231,175, 95, 97,249,
-250,227,220,122,238, 27, 4, 94,192,242,230, 26, 89,146, 49,232,141,200,178,132,230,194, 34,101, 54,160,189,188,206, 96, 48,100,
- 50, 24, 96,109,140,239, 9,178, 60, 99, 60, 28,226,133, 30,218,243, 56,222, 63, 98, 50,234,115,249,202, 5, 22,206,109, 48, 28,
-198,116, 79, 6,100,113,193,238,206, 67, 60, 41, 25, 76, 6,108, 46,181,104, 55, 58, 12, 38, 41,199, 39, 9,233,120,159, 78,167,
-205,249,149, 85,114, 36, 59, 15, 15, 25,246, 79,241,149,161,209, 92, 96, 56,201,105,215, 61, 54,207,157,103,105,101, 25,223,143,
-104,182, 23,176,192,112, 28,147,102, 57, 39,195,132,211, 81,140, 16,150, 73,106,208, 66,178,115,116,202, 97,175, 79,111, 52,166,
- 55, 46, 8,125,205,106,167,201,131,147, 99,178, 76,177,185,210, 98,231,120, 68,179, 38, 56, 29,166, 36,121, 65, 51,170,113,121,
-181, 77,119, 20,243,111,254,205,175,208,237, 30,227, 55, 90, 78, 21, 45, 36,210,243,171,202, 93,185,177,159,175,209, 65, 29, 2,
- 61,111,233,230, 33,222,103, 46,117,111,222,169,139, 24,202, 18,147, 77, 24,239, 62, 36, 27, 77,208,126, 64,150, 21,140,187,125,
-242, 44,163,212, 33, 63,240, 35,223,133,182, 37, 94,163, 9,171,143, 65, 49,172, 44,113, 62,100, 99,204,131,251,228,113, 70,249,
-249,223,197,175,135,220,189,181,205,113, 90,176,123,208,231, 71,254,211,231,176,121,143,179,128, 52,119, 34,184, 29,174,242,124,
- 80, 81,181,239, 53, 80,102, 96, 5,121, 60,166,200,139,170,122,119,193, 32,231, 46, 93,226,255,252,165,127, 68, 41, 27, 92,190,
-124,158, 31,255,248,199,248,239,254,242,159,231,155,111,220,103,225,244,132,115,107, 77,172,212,238,125, 89,105, 63,202, 56, 33,
-184,250, 4, 0,195,195,135,149, 32,172,196,148, 57, 87,159,125, 63, 63,245,167,191,159, 31,250,216, 19,124,226,253, 79,240, 35,
- 63,241, 81,174, 62,243,212,236,178,198, 90,240, 60,228,115, 47,178,127,244, 38,229,120, 80,213, 29, 98, 6,102, 49, 22,215, 49,
- 61,202,154,155, 57, 7,173, 16,143,236, 33,207,210, 86, 4,103,144,169, 21,185,109,122,193,157,149, 64, 60, 10,126, 97,238,229,
-159, 5,202,156,249,154,202, 7, 63, 45, 64,132,210,144,141, 41,227,211, 89,119, 60,141,134,157, 62,190,169, 14,204,210,156, 25,
-233,159, 37,217, 76,159,138,196,117,161, 98,214, 48, 59, 39, 64, 21,183, 58,205,220,150,106, 74, 29,171, 38, 27, 58, 66,213, 90,
- 20, 89, 90, 81,238,206,216,223,236,163,210, 9,161,107, 8,191,137, 41,146,234,219,139, 51,113,178,184, 44,247, 51,170,126, 25,
- 4,180, 63,240,131,200, 64,131,205,207, 76,166, 20,152,100,254,107, 83, 49,255, 77,230, 46,221,120, 88, 37,193, 25,103, 21,204,
- 75, 76,158,145, 15,251,228,147, 9,101,146, 58, 61, 68, 37,210, 43,115,151,203,173,181,194,148,149,228, 75,234,170,160, 18, 78,
-164,106, 12,182, 18,151,229, 89, 94, 77, 70,242, 89, 17, 34,181,194, 15,235,206, 50,232,251, 8, 33,208,202,175,116, 74, 18, 47,
-136, 80,126,205,217,127,165, 68,105,175,162,227,185,224, 43,237,121, 46, 80, 44,112,105,107,202,243, 93,247,170, 52, 82, 41, 84,
-232, 68,129, 82,107,164,212,232, 32,116,191, 14,107, 72,229, 83,196, 99,132, 16, 28,124,241, 63,177,126,121,153,246,213, 43, 96,
- 10,116,115,153,135,191,254, 89, 70,183, 95,113,194,212,194,204,223,159, 83,173,198, 84, 9, 63, 47, 45, 43, 59,167, 56,115,220,
- 8, 39, 58,179,115,206,192,108,216, 98,206, 56, 23,170, 98,151,234,194, 22,178, 90,237, 76, 33, 67, 21, 37,113, 6, 28,170,254,
-151,231,174, 0,180, 66, 84,107, 37, 59, 43, 4, 76,233,138,122, 83, 26, 10, 96, 52, 30, 49,201, 83, 74, 11,145, 20,116, 60, 77,
- 91, 75, 58, 90, 17, 41,137,167, 52,118,220,167,204,198,160, 61,164,174,187,247,198,244, 57,217,146,115, 63,248, 95,113,188,227,
-177,112,126,145,172, 27,179,250,108,130,250,131,207,178,254,129, 5, 26,151,107,228, 61,131, 31, 4, 76, 30,164,120, 13,129,201,
- 36,202,119,140, 10,191,237,166,179, 79,202,151,185,169, 62,205,242,226,128, 56,206, 48,185,162,222,177,140,147,140, 65, 50,224,
-218,242,117,148,148, 28,199, 39,104,219,160,200, 4,147, 73, 12,170, 96, 56, 73,184,116,249, 60,199,199, 99, 60,105, 80, 42, 98,
-146,156, 82, 11, 23,169,181, 26,164,189, 9,178,181,216, 96, 97,115,133,246,230, 37, 22,175, 61,193,233,131,135, 60,249,241,143,
-146, 38,150,199,222,251, 20,173, 11, 31,230,185,255,235, 87, 24, 28, 29,176,126,237, 18,163,211, 17, 89,239,136,181,235, 55,152,
-116,247,168, 45, 45, 81, 22,150, 90,107, 5, 29,106, 78,183,110,179,116,229, 42, 97, 99,145,116,124,138,181,134,162,200,145, 94,
-141,160,214, 0,173,209,202, 33, 69, 81,146,209,193, 54, 82,123,188,250,251, 95, 96,251,245,175, 83, 95, 88,164,127,124, 76,103,
-227, 60, 69,150,178,253,250,235, 78,220,210,136, 56,218,221, 39,203,114, 78,118, 14,161,136, 29, 10,208, 90,122,221, 46,241, 96,
-194,237, 55, 94, 99,239,206, 77,250, 39,219,152,210,208,239,245,201,226, 9,251, 15,183,201,211, 24,223,143, 72,242, 33,131,225,
-144,211,211, 49, 69, 94, 50, 26, 15,240, 60,205,113,127,200,100,156,177,188,218,102,247,120, 72,239,120, 72,146,118, 49, 86, 51,
- 28, 29, 83, 91,108,240,214,237, 29,132, 76,105, 55,235,248, 65,147,131,147, 1,221,211, 46,168, 49,189,248,148,251, 15,119,184,
-253,224, 33,111,222,126,147, 36,233,145,231, 57, 39,195,152,227,193,144,193, 36, 33,203,115,164, 76,184,127,116,130,212, 1,151,
-215,207, 81, 15,106, 32, 33,240, 5,111,108, 29,243,228,249,117,122,241,152,222,104,200,201,104, 72,228,251, 85, 96, 68,206,113,
- 63,225,245, 7,135,252,231, 95,255,101,142,186,135,248,205,166, 27, 49, 73,129,244,220,248,205, 17,155, 36,194, 83,104, 63,132,
- 90,240,232,229,113,166,247,155, 94,234,243, 0,141, 24, 76,129, 45, 74,204,100,128,174, 69, 68,205, 58, 97,189, 78, 16, 4, 88,
-156,114,248,234, 19,239, 96,105,165,131, 65, 58, 95, 58,198, 29,142,211, 50,125,220,199, 12,199,152, 60, 67,164, 25,217, 32,102,
-127,152, 96,148, 70, 47,212,240,151,207,185, 14,172,156,239,219,168, 14,194,105, 87, 37,102, 19, 4, 85, 5,197,100, 21,171,189,
-122,126,101,137, 84,138,222,209, 9,159,251,205,127,198,231,127,227,151,185,243,246,152,111,220,201,216,186,117,202, 43,175,237,
-243,123,111, 62,196,247,148, 19,159, 85,182, 61,129,165, 24,143,176,201, 24,128,168,221,161,204, 38,148, 69, 70, 60,232, 51, 60,
-220,174, 64, 72, 55,184,252,190,247,160,107, 17, 38,207,102, 86,156,169, 40,212, 6,154,149,239,252, 76, 5,104,145,179,187,168,
-180,206,159,108,170,110,220, 84,170, 94, 91, 81,219,138,105, 60,173,177,148,213,138,120,122, 89, 26, 4, 69,233,168, 87, 69,105,
- 42, 33, 21,238,207, 78,143, 78, 49, 15,106, 41,193, 29, 90, 83, 49,153,113,193, 47,102,166, 43,158,198,225, 86, 7,106,133,103,
- 45,211, 33,233,248, 16, 83, 45,178,173,156,107,214,103,125,189,156, 3,108,236, 25, 74,222, 25,183,163,155, 20,216, 98, 30,143,
-202, 25,146,158,177,143,164,185,153,114,102,222,171,158,108, 65, 49,233,129,205,171,141,144, 2,229, 87, 7,248,153,100, 59, 9,
- 82, 71, 72, 47,154, 7,131, 84,147,130,105, 23,111, 77,181,175,157,238,228,211, 9,148,105, 5, 0, 58, 75,252, 49,143,234, 8,
-164,196,154,172,122, 86,210,173, 7,170, 2, 70,215,154,136,208,173,198,100,208, 66,122, 62,218,247, 9,130, 8, 41, 61,132,242,
-240,234, 77,188, 48,194,106, 15, 25,212,240,194, 58, 74, 72,132,242, 80, 94, 8, 40, 74,227, 58,120, 83,150,179,207, 25, 82, 66,
- 89,160,132,197,175, 71,174,187,242,125,164,210, 40,175,230,132,108,202, 9,195,100, 16,162,131,208,253, 60,202, 2,169, 61, 20,
-162, 2, 51, 89,144,218,185, 59,166,235, 12, 83,186,243, 64, 42,164,246,209,129,143,242,125,148, 31, 84,103,132,135,208, 62, 66,
-249, 72,165, 40,147, 9,195,157, 7,116, 86, 27,180, 46, 94,160, 76,135,232, 86,135,201, 16, 38, 59,183,177,101, 94, 77, 47,166,
-175,225,124, 26,244, 8, 73,105,166,115, 17, 51, 77,136,177,204,246,232,143,134, 29,205,127, 57, 61, 50,140,177,243,199,159, 10,
- 17,171,120, 94, 41, 57, 83, 84, 87,143, 91, 26,135, 45,158,110,100,170,169,199, 20, 74, 53, 77, 32,156,217,209,226, 49, 94, 25,
-211,246,148,131,252,104, 69,167,218,167,135, 74,224, 97, 49, 19,167,255,144, 10,252,112,137,218,242, 53,164,174,185,201, 81, 53,
-113, 58,247,241,191, 68,247,254, 9,201,192,210, 88,252, 8,151, 63,249, 11,180,195,182, 43,236, 82,129,215,241,176,189, 24,191,
-229, 10, 90, 45, 65,120, 22,213,112,217, 88,141,205,146,118, 52,161,158,127,133,102,115,145,123, 7, 59, 20,118, 76,154, 27,180,
- 9,200, 76, 65, 81, 72, 10,155, 19,232, 6,237, 70, 64,115, 65, 83,230,138,100, 0,101,110,216,217, 61,230,220, 66,128,239,215,
-176, 36, 88, 91, 32, 67,159,120, 60,225,112,239,109,116,125,249, 2,195,253,125,252,198, 18,249,120,140, 45, 10,103,189, 74, 39,
- 20, 70,241,194,231,126,131,149,245, 53,186,187, 59,152,245, 13,234,245,136, 98, 60, 65, 4,146,225, 97,151, 90,179, 73, 99,109,
-157,201,104,200,164, 59, 96,233,226, 5,164, 10,217,126,229,121, 54,222,245,148,211, 76, 29,109,147,215, 59,180, 86, 55,201, 77,
- 78,184,176, 76,220,239, 67,232,115,254,241,199, 57,188,245, 22,215,191,237, 3,156,191, 24,113,112,119,139,181,203,231,233,238,
- 60, 36,140,106,244,143,186, 24, 91, 50, 58,156,208, 92,168, 99,140, 34,140,106, 4,141, 54,199,123,123,152,162, 79,152, 27,142,
- 30,118, 1, 67,103,113,141,135,119, 31, 34, 57, 69, 9,205,176,127, 66,163,222, 96, 56, 73,185,127,111,139, 39,116, 7, 63,108,
- 81, 22, 41,241, 36, 1,145,146,149, 48,142, 83,164, 44, 72,108,193, 56,201, 25, 13, 19,142, 78,122, 92, 92, 95,231,206,253, 1,
-245,230, 30,218, 26,138, 60, 99, 97,105,209, 37,249, 76, 50, 90,117, 77,145,193,209,209, 41, 71,253, 30,203,109,143,141,213, 5,
-250,227,146, 52,117, 59,176,139, 43, 45,198,105, 65,119,148, 32,164, 79,205,179, 60, 60,238, 50,152,132,156,235, 4,152,177,161,
-230,107,114, 51,228,104,152,178,177,228,179,223, 75,185,126,110, 25,223, 11, 80,114,192,165,181, 21,126,235, 91, 55,249,226,175,
-254,207, 12, 7,167,120,141, 14,194, 42,164, 31, 33,131,192,249, 68,139,178,250,208,148,110, 71,234,135,103, 46,112,121,166, 67,
-159, 3, 60,132,240,170,174,200,141,207,203, 65, 15,213,104, 96,138,156,160,217,162,136, 19,204, 73,143, 44, 77, 41,133,100, 97,
-229, 34,223,246,201, 15,144,220,121, 11, 17, 4,176,176, 10,196,204,149, 78, 6,226, 24,147,102,152, 52, 65,154,146,222, 65,151,
-211,188, 32, 87,138,133,197,229,217,233, 63,179,177, 76, 43,114, 28, 3,154, 34,193,202,176,130,173,184,253,126, 58,232, 98,138,
- 12,155,231, 24, 36,210, 72,172, 41,241,163, 54, 69, 30,243,197, 47,252, 26,159,249,244,127,205,246,164,206,173, 39, 63,196,107,
-111,223,228,103,255,226, 7, 72, 78, 78, 97,101,205,217,100,170,139, 66,136, 18,115,176,135,184,116,157,214,198, 53,186,247,111,
-186, 92, 2,161,200, 77, 7,173,189,233,189, 69, 57, 60,165, 28, 12, 80, 89, 9,187,135,152,147, 35,204,209, 9,114,119,151,203,
- 31,253, 32,197,245,111,112,176,243, 26, 54, 25,186, 12,102, 49,183,178,185, 75,130,153,221,108, 38,103, 96,122,224,184, 87,203,
- 24,167, 2,158, 70, 82, 10, 43,102,123,122,206,106, 26,229, 25, 76,156,181,213,184,211,130, 22,179, 3,241,172,254, 81,136,121,
- 49,103,140,169,148,248, 98,198,167, 55, 85, 90,220,180,197,158, 90,196,230,174, 52, 15, 33,138,249,174,218, 80,105,221,197,204,
- 78, 55, 99, 5,153,106, 44,170,166, 20, 60, 89, 17,235, 92,145, 57,237,212,197,116, 74, 97,114,103, 65, 19, 2,164,166,118,254,
- 89,116,125,129,241,157,175, 64, 57,158, 99, 96,173,168,132,118, 2,165,230,225, 57,238, 15,200, 89,218,151,172, 48,183, 6,200,
- 78,246, 41,198,125,116,187, 89, 85, 5,211,106,203,141,201, 41,178,170, 48, 40, 16,214, 21, 62,174,224,113,157,189,244,163,170,
- 43, 52,168, 90, 11,226, 9,202, 15, 17,194,171, 82,186, 10, 40, 10, 20, 26,148, 68, 76, 38,149, 7, 31,164, 95, 67,151, 5, 70,
-104,242, 81, 31, 76,233, 52, 45,182, 64,123, 53, 84,160,137, 15, 15, 80, 81,132,210, 10, 45, 20, 74, 75,247,119, 17,211, 2,219,
- 67,120,145,222,125,159, 9, 0, 0, 32, 0, 73, 68, 65, 84,227, 52, 40,207, 5, 1, 97, 42, 77,137,219,197, 43, 63,152,129, 93,
-148, 31,206,114, 18,164,175,177,133, 68,120, 26,165,124,132,244, 93, 84,177,116,151,190, 10, 35,132, 12,176,165,161,180,134,184,
-219,165,255,246, 75,188,243, 19, 31,195,107, 53, 40,147, 9, 34, 92,160,247,149, 47, 82,156,236,187,215,144,121, 42,224,148, 2,
- 39,148,172, 68,109,103, 46,235, 41,252,168, 42,106,197, 12, 34, 84,189,111,102, 81,190,213, 62, 94,201, 10,159, 60,125, 91, 59,
-237,137, 67,106, 84,222,242,210,204,164, 16, 83,251,156, 96,110,122,112,155, 27, 51, 39, 38,154,194, 77, 83,166,106,123,107,144,
- 22, 52, 37,117, 33,105, 89, 75,233,107, 66, 37,104, 9, 65, 4,132, 21, 97, 83,148,153, 43, 10, 12,152, 50, 35,235,237, 80, 22,
-177, 3, 28, 89,193,202,167,126,130,221,175,221, 33,137,123,120,222, 34,106,237, 4,113,107, 7,239, 74,131, 98, 98,176,190,198,
-116, 45, 54,115, 92, 8, 1, 8, 31, 60, 35,200,115,139,167, 5, 54, 0,213,241,248,232,224,183,121,110,248, 93, 28,166,123, 92,
-238, 60,198, 78,119, 7,159,144,122, 80,103,152, 13, 41, 69, 70,123,161,134,240, 74, 10, 12,190,134,113, 92, 18, 5, 77, 76,110,
- 41,253, 4,169,234,244, 71,125, 90,245, 26,194,194,189,219, 47,112,225,202,187,209, 73,239,128,165,171, 87, 72, 70, 67,246,111,
-223,161,136, 99,151,119, 17, 68, 36,189, 46,231, 54,206,177,251,224, 54,173,133, 6, 34,175, 59,108, 94,227, 34,227,238, 14,235,
-239,122,150,209,225, 14,119,158,255, 34,235, 55, 30, 39,108, 53,168,111, 92,229,224,229, 23,216,124,234, 89, 76,150, 80,152,132,
-198,230, 99,100,189, 67, 70, 39,123,248,245, 38, 40, 73,119,231, 33, 69, 58, 98,245,242, 21,150,175, 95,225,222,215,191,194,181,
- 79,252, 48,119,191,252, 28, 43, 23,215,153, 12, 39, 20,185, 96, 50, 25,162, 80,100, 89, 66, 28,131,144,117,250,221, 83,242,131,
- 30,253,211, 33,151,111,156, 35, 25,149,196,227, 49, 23,175, 92,160,127,210,101,253,252, 58,147,100, 66, 94, 38, 96, 45, 74, 75,
-246,143, 78,176,197,132, 60,109,177,247,224, 33,165,209,156,246,251, 68,161,143, 18,146,238, 40, 99,185, 85,144, 76, 18,151,221,
-173, 45, 11,173, 38,163, 84,176,180,188, 68,146, 40,106,141, 8, 37,235, 12, 70, 46, 69,231,225,193, 1, 23, 55, 22,232, 15, 83,
-130, 80,209, 41,107, 72,173, 56,233, 23,156, 14, 39, 12,227,132,178,204,104,212,124,178,178, 36, 45, 37,113, 42,104,213,107,120,
-122, 76,111,156,209,136, 20,105, 81, 80,148,130,165,118,147, 55,238,238,114,253, 92, 68,127,104, 8, 60, 9, 70,179,178, 84,103,
-235,116,194,175,254, 15, 63,199,181,239,249,113,108, 20,161,164,130,244, 16,122,125, 24,143,160,151,186,139, 53, 90,128, 75,215,
- 65,228, 85,138,144,225,145, 83,121, 70, 46, 19,179,177,187,181, 14, 6, 68, 90, 41,122,105,185,241,177,242, 65,107,146, 52,101,
- 48, 24,177,184,126,129,115,171, 23, 81, 20, 20,149, 58,203, 54,218,136, 60,169, 30, 87, 67, 81,192,160,135,201,115,202,209, 24,
- 81, 20, 78, 20,164, 20,133, 49,252,192, 63,251,251,148, 19, 7,177, 48, 51, 53,180,156, 69,106, 90,105, 41,178, 24,237,215,156,
- 33, 44,207, 40,147,161, 19, 36,149,165, 75, 83,178, 10, 51,141, 4,181,160,148, 79,102, 12,191,245,165,207,177,251,234,107, 28,
- 60,216,229,198,179,127,138,198,133, 43,156,254,211,191, 75,176,184, 92,141, 94, 93, 39, 33, 61, 77,190,243,144,240,210,117,132,
- 31, 34, 27,117,100, 1,227, 23,191,193,254,183,126,133,131, 47,124,145,252,164, 79, 62,152, 80, 88,195,106,216,164,211,106, 17,
- 54, 23,232, 44, 45, 34, 60,143, 36,153,176,186,123,204,227, 31,250,147,220,168,255, 25, 94,248,220,255, 74,127,247,214, 60, 51,
-125,202, 67,159,225,206,221, 33,163,245, 60,177,202, 24,135, 91,145,103, 4,140, 98,182,143, 7, 83, 89,218,148, 39,102, 35, 93,
-236, 92,133, 44,254,152, 23,120,150,254, 86,117,203,166,202, 87,159,122,129, 93,163,122,102,164, 41,166, 8,215,234,170,158,125,
- 49,232,218, 50, 94,235, 60,249,233, 61,138,180, 63, 39,204, 85, 3,212,105,128, 10, 82, 84,130,121,119,144,138,170,235,146,213,
-216, 93, 76, 17, 59,118, 30, 29,235,158, 71, 89, 21, 88, 2, 97, 12,164, 67, 10, 83,128,205,102, 7,249, 52, 8,198,101,170,187,
- 75,193, 9,203,166, 99,222,121,203,103,101,229,105, 22,130,194, 66,118,120,139,112,227,124,245, 30, 79,171, 49,170,116,122,143,
- 51,133,149,149, 10, 33, 66,108, 22,187,176, 29, 63, 68,232, 26,178, 72, 81, 81, 27,170, 68, 71, 91,100, 72,223, 93,188, 38, 77,
-209,174,194,192,228, 57,214, 15, 17,227,145,155,202,196, 99,172, 9,176,201, 24,169, 61, 74,155, 80,243, 61, 74, 35,241,106, 1,
-182,200,241,234,117,188,168, 1,121,138,174,213,145,210,175,152, 77,174,211,148, 97,221,189, 39, 80,136, 50,115, 83, 12, 23,169,
- 86,197,125,106,140,117,246, 73,199,118,112, 83, 10, 29,132,110,114, 33,132,203,235,144, 10,161, 20,202,247, 29,239,189,178,176,
-217,210,184, 85,214,160,135, 41, 50, 58,109, 15,127,105,133, 50, 27,162,106, 77, 70,123, 19, 6,175, 60,135, 41, 11, 55, 81,157,
-199,236, 85,162,119, 59,131, 39,157,213,107, 76,167,109,103,187,234,105,128,212,180, 64,179, 21, 93,208, 37, 67,150,110, 21,117,
- 38, 99, 96,234,118,112,200,217,114,110,187,156,193,157,204,108, 63, 36,230,190, 55,151, 12,119, 70,196,103,167,159,133, 18,148,
-176, 40, 1,129, 20,116,124,129, 44, 20,190,128,150, 86,248,149,220,198, 83,103,147, 3, 13, 69,124,236,186,124,139,227,100,148,
- 5, 27,159,250, 27,188,246, 31,254,144,168,189,134, 8, 59,180, 46,253, 22,188, 92,184,105, 79, 46,177, 99,131,236, 14, 49,227,
- 2, 59, 17,168, 69, 73,218,119, 25,238,218, 23, 20, 6, 68, 41, 40,253,146,149, 85, 72,239,126, 22,169, 55, 25, 23, 41, 30,138,
-126,218, 67, 74, 69,230,101,110,147,169,224,100, 18,211, 12, 36, 73,238,206, 80, 99, 50,162,176,197, 81, 55, 65,216, 46,185,201,
-232,246, 51,210, 98,151,115,139, 79, 48, 56, 62, 68,119,206, 95,163, 40, 75,250,123,123, 80,102, 52,150,150,232,237,237, 34,114,
- 67,125,161, 77,173,209,228,198,234, 42, 94,212,224,230,151,127,151, 75, 79,159, 35,137, 71, 52, 87, 54,185,253,194,243, 8,202,
-255,143,175, 55, 15,182, 45,203,235, 58, 63,107,173,189,247,153,207,157,223,156,249, 94,190,247,114,172,202,154, 11,173,162,168,
- 98, 40, 64,170, 40,198,102,114, 64,233,208,198,182, 91,109, 20, 67,180,181,187,137,208,144,104, 21, 27, 9, 67,237, 70,176, 1,
- 81,161,105,170, 81, 40,192, 34,145,130, 42,107, 34,179,200,204,202,204,247,242,229,155,239,124,239,185,103,222,211, 26,250,143,
-181,246, 62,231,166,134, 47, 34, 35, 94,228,187,247,140,123,175,223,239,247,253,125, 7, 54, 47, 93, 97,253,226, 21,100,179,195,
-240,254, 61,226, 94,151, 50,205,144,194,161,186,109,108,150,209,232,173,145, 14,247,201,173, 32,105,197,140,143,247, 56,255,216,
- 21, 84, 20, 49, 59, 57, 6, 52,118, 50,166,152,205,184,253,194, 11,172,109,173,114,243,139,175,163,146, 25,101,158, 33,163,132,
- 56,110,145,230, 25,195,225,140, 78, 67,115,246,204, 26, 78, 11,156,130,110,167, 73, 89,106, 26,157, 46,227,241, 36,144,118, 10,
- 58,205, 21,182,247, 14,137,148,229,145, 75,231, 16,178,131,179,146,225,100,134,196,145,230,142,210,164, 92,189,176,193,225,193,
- 17,175,126,249, 14,105, 89,178,181,182,198, 74,175,197,108, 86,176,186,210,160,191,190, 74,207, 9,238,222,221,166,200, 13,202,
-149, 92, 59,115,129,151,110,236, 50, 60, 62,230,210,133,132,205,173, 51, 62, 32,193, 20, 52, 86, 87,185,116, 86,210,136, 20,243,
-194,144,229,154,251,123, 3, 14,134,115,180,107,114,113,115,141, 59, 7, 3, 16,109,238, 29, 28,210,116,154,107, 87,207,241,111,
-127,245,231,120,199, 7,191, 30, 21, 37,252,151,254,184,249,125,120,112, 11, 70, 99,152,164,216,121,134,214,218,235,173,231,115,
-230,163, 41,113,167,205,218,187,222, 71,242,214,167, 64, 5,109,119,229,181, 42,195,169,237, 18,207, 18,245,179,141, 63,184,202,
-140,114, 62, 71,246,253,222,186, 44,102, 28,221,187,207,232,248,132, 50,215,156, 93,191,200,245,119, 63,134, 62, 57,174,153,197,
- 34,234,131, 61, 89, 18, 74,151,144,121,119, 44, 59,207,144,206, 75,115,140,181,188,177, 55,164,117,245, 42,102, 58,172,163, 84,
- 61,108,237, 89, 54,206, 56,140,149,144,249,201,200, 23, 55, 67, 62, 26, 81,140,199, 88,165,160,221, 70, 52,187, 16,183,188,254,
-190,209, 34,201,230, 40,231, 40, 70, 25,231, 30,127,154, 11,207, 60,139,201, 11,204,100,234, 39, 23,163,195,242, 87,251,134, 77,
- 42,242,227,125, 26,198,123, 40, 60,255,177, 31, 96, 54,152, 51,193, 96,155, 17,237,110,155, 82, 66,178,209, 35,182,130,161, 82,
-172,172,118,105,182, 91,168,213, 85, 84,220,162,217, 72, 80, 43,125,220, 96,132,179,154,103, 62,244,167,248,236,191,254, 95, 78,
- 29,108, 66, 46,123, 96,123,210,152,117,139, 3,172, 42,164,206,217,154, 53,238,130,221,102,101,157, 90, 29,112,126, 95,233,106,
- 77,183, 88,142, 43,173,236, 93,235,131,215,213,222,236,182,182, 79, 93,172,238, 79, 65,159,114, 33,138,112,110,241,220, 81,163,
-239, 63, 47, 61,247,133,119,105, 50,170, 14,233,154,159, 39, 69, 45,207,115,117,130,220,146,234, 44,236, 95,109,165,193,167, 94,
-198,135,207,201,144, 29,188,178,120, 33, 1,240, 81,145,194,106, 11, 97,202,151, 98,169, 41, 49,212,121,236,214,121, 59,208,202,
-231, 32, 82, 2,123,112, 19,196, 55, 6, 18, 93, 8,163,183, 62,169,174, 10,119, 65, 42, 68,228, 29,236,156,247,173, 70,181,218,
-126,106, 78,218, 80, 24,112, 99,140,209, 68,221, 53,191, 27,151, 10,215,104,251,231, 45,141, 79, 58, 12, 30,250,121,154,161, 74,
-139,158,207,124,200,145,106,208,238,218, 0,153,227,237,169, 29, 52,251, 27, 62,203, 94,249, 6, 19,169,192,104, 95,208,101, 32,
-239, 85,106, 1, 21,227,138,204, 59, 44,138,216,107,228,109,137,117, 58, 16,223,124,240,145, 39,146,122, 11, 94, 41, 99, 47, 97,
- 21,139,152, 93, 25, 37, 72,229, 73,114,217,201, 17,217,201, 9,227,123, 55, 56,119,237, 18,205,205,107,216,124,134,140, 90,152,
-184,199,254,255,243, 47,153,222,124,209,167,146,185, 5,146,230,163, 73, 67,147, 22, 26, 68,196,194,223,223, 5, 35, 37, 31, 47,
-188, 36,193,172, 17,167,165,239,191,206, 50, 8,153,236, 98,105,221, 19, 60, 24,150, 67, 98, 8,196, 79, 17, 44,164, 45, 11,251,
- 99, 91,153,221,224, 35, 86, 43,162,158,148,146,128,245, 17, 57, 17, 8,154,146, 40,242,175,169, 33, 33, 10,114, 57,225, 92,208,
-212,251,166,201, 91, 39, 7,110,140, 19,180, 47, 63, 3,162,164,217,239, 34, 38, 83,116,118,141,118,255,187, 48, 89,215, 51,248,
- 51, 7,165,193,102,142, 98,236,112, 29, 73,126,100, 81, 45,144, 69,165,133, 13, 19,252,138, 32,159, 73,190, 97,245, 75,220, 25,
-125, 20,237,246,105,198, 45, 12,142, 65,126, 64,170,215,233, 52, 91,232, 18, 98,213,192, 24,111, 55, 25,197,138,121,166,153,206,
-167, 88,147,115,113,237, 60,227,124, 66,102, 4,243,244,128,245,245, 51,116, 59, 87,136,172,179, 28,222,127,192,209,206, 14,102,
- 62, 67,207,103,172,157, 89,199, 26,199,195, 91,183, 88, 63,115, 6, 99, 36, 14,205,197,199,159,101,176,243,128,222,122,151,193,
-238, 1, 82,103,156,123,226,113,186, 91, 23, 56,186,123,143,214,106,143,249,104, 68,118,178, 71,255, 93,239, 11,223,152, 33, 75,
- 83, 14,111,191,202,245,247,125,136,227, 59,183, 80, 73,159, 78,167,131,192,145,207,198,168,182, 98,235,242,101,178,217, 20, 99,
- 10,148,115,244,206, 93, 96,118,248, 69,158,252,202,183,176,123,235, 14, 82,164, 52, 91,109,102,227, 25,189, 94,204,153,179, 91,
- 28, 13,142, 41,180,164, 44, 50, 90,189, 54,233,124, 76,220,236, 80,150, 22,107, 82, 54,214,207,241,252,139,183, 16,110,198,149,
- 75,155, 88, 18, 28, 49,105, 58,195,160,105, 40,197,221,251,187,156,221,234,209,223,216,228,109,239,255, 10,222,246,161,175, 97,
-235,177, 39,232,172,108,144,180,186,252,215,254,184, 32,225,114,165,102,116,239, 53, 62,249,111,254, 21,159,255,244,103,185,191,
-127, 68, 20, 39,204, 75,135,146, 5,253, 78,131,193, 56,197,170, 38,143, 95,218, 98, 48,153, 49,156,150,236, 28, 76, 24,100,134,
- 79,252,198, 47,243,236, 7, 62, 76, 28,199, 75, 44,244, 60,144,157, 18, 95,120,167,247, 96,247, 33, 12,167, 48, 75,209,227, 25,
-229,124, 70, 49,153,145,229, 57,243,241,140, 34, 47,152,207,114,178,194,177,178, 63,164,255,197, 47,112,225,235,190, 26,217, 85,
-139,168, 77,109,160,213,129,222,150,215,235, 58,237, 91,227, 66, 99,116, 73, 57,157,208,194, 82, 24,195,108,111,159,233,104,140,
- 46, 11, 26,205, 14,205,181, 45,162,166,194,142, 74,136, 85,240, 41, 21, 1,246, 15, 21,194, 20,216,162,192,105,141,203,115, 76,
-166,217, 29,207, 40,130,112,174,209,223,196,148, 35, 47, 85,171, 72, 54,198, 31,200,206, 58,208, 37,102, 62,247, 38,119,189, 62,
- 78, 72,116, 36,112,217,156,217,107,175,145, 63,247,251,228, 47,191,193,225,112,202,248,120, 64,164, 28,147,105, 70,233, 28, 9,
-144, 89,203,197, 78, 31, 37, 4,162,221,162,181,177,194,123,255,193, 15, 97,243, 18, 89, 10,127,163, 70, 2,147,167,112,176, 11,
-231, 31,229,145, 31,248,110,254,227, 79,252, 12,221,110,215,171,245, 13,244, 84,132,179,112,109,101,221,167, 68,105, 77, 62,155,
-209,156, 78, 73,206,245, 73,186, 29,172, 80, 20,135,123,196,221,199,232,180, 87, 16, 50,198,153,178, 46,216,110, 57, 84,204, 6,
- 35,154, 96, 86, 99,141, 79,124, 90,196,134, 46,254,205, 35,173, 11, 98, 25,136, 90, 63,109,194,244, 93, 27,204, 86,196, 51,150,
-163, 76, 43,226, 92,120,174,234, 97,151,136, 73, 66, 8,191, 19,175, 16,147, 96, 98, 83,181, 32,249,232,126,152, 30,117, 45,153,
-243,251,224, 0,167, 42,177,228, 0, 23, 16,210,165,148,174,234,185, 22,104,130, 69, 18, 14,235, 72,214,211,254,194, 54,193,121,
-109,176,168,204,104,252,174,188, 78,119, 83, 11, 70,180,239, 9,156, 47,226, 44, 8,126,126,207, 12, 86, 27,180, 92, 15, 31,132,
- 62,125,211, 70,173, 96, 71,236,173,136,133,179, 88,167, 1,133,108,182,145,237, 13,191,255, 70, 34, 68,138,176,150,168,237,176,
-101,134,144,125,191,191, 15, 81,161,178,200,189,101,108, 89,250, 98, 47, 98,156, 76,176,206,219,232,198, 42, 33,233,119,209, 89,
-129,108,196, 56, 43,176,145, 14,171, 16,237,249, 40, 85, 18, 97,216,131,139, 72,121,181, 73,210,198,149,153, 15,203,137,146, 69,
-230, 18, 14,131, 9,142,206,129, 50, 40, 37, 82,248,180, 75,121,202,129,209,223,163, 66,197,168,164,237, 53,249, 81,194,236, 96,
-135,236,232,144,163, 87, 94,230,177,103,175, 16,181, 54,188, 31,124,255, 44,135,159,254, 2,147,151, 63,143, 73,103, 11, 20,164,
-170,147,214, 46,154,169,160,228,168,190, 15, 91, 17, 46,229, 82,138,158,117,167,214, 69, 34,246, 77,154,168,194,131,156, 79, 19,
-172,213, 17, 85,183,105,141, 79, 95, 52,186, 54,184, 9,164,148,192, 29,177,245, 78,191,110, 46, 23, 36,251,250, 90,175,221, 29,
-181,231, 25, 68, 97, 71, 31,203,160,103,199,145, 52, 59,160, 11,148, 12,215, 27,206,123, 13, 72,207,182, 23, 72, 48, 37, 79,252,
-229,159, 98,116, 56,164, 72,231, 68,137,196,154,231,137,229, 33,101,218,240,239,115,174,209, 7, 37,101, 10,195, 99, 71, 91, 88,
-178,210,209,108,122,178,169,201, 89,132, 34, 73,135,234, 90,244,177,224, 35,173,159,226, 51,238,251,217,104,206,152, 12,115, 36,
- 17, 89,121,194, 74,183,133, 19,134,149,149,136, 44,205,105, 42,133,112, 77, 30,166,247, 57,223,191, 64,171,221,102,144, 78, 88,
-219, 76,176, 7, 5, 78,181,185,247,240, 37,218,205, 51, 68,147,227,125,142, 31,220,163,219, 86, 60,242, 21, 31, 98,176,253,128,
-163,135,251,196, 13,199,250, 90,159, 39, 62,252, 81,182,159,255, 28,243,163, 93,202, 50, 71,185, 28, 87,182,233,109,173,210, 63,
-243, 52,186,200,217,125,253, 53,138,201,152,205,235, 79,114,227,243,159,163,215,142,152,143,199,100,195, 3,154,107,103, 49,105,
-134, 48, 57,233,224, 8,149, 68,228,211, 49,249,108,204,124, 24,211, 92,237, 17, 33, 72, 39, 51,198,119,238, 48, 29, 28,208,238,
-119, 24,239, 30,176,117,121, 11,129,165,221,109,211,233,109, 48, 60, 30,161, 53,180,186, 77, 6,195, 9, 71, 59, 59, 52, 59,138,
-102,167, 69, 18,173, 50, 63,201, 49,227, 25,141, 56,166,217, 89,229,104, 48, 1,173,185,242,232, 25,180,141, 72, 90, 61, 14, 14,
-238, 49, 30,205, 65, 42,222,255,237,223,202, 95,253, 83, 63, 72,119,245,236,155,138,181, 5,155,227,202,147, 37,182,142, 12, 48,
- 88, 96,204, 22, 25,166, 44, 67,225,154, 17, 27,203,199,254,228,159,229, 59,255,194, 95, 97, 50, 62,225, 83,191,250,175,248, 63,
-127,242,103, 80,157, 21,102, 5, 36,113,151, 68,193,241,116, 76, 59,105,241,112,247,144,127,253,111,254, 57, 31,250,206,239, 95,
- 42,228,206, 79,205, 66,128, 75,252, 65, 93, 30,194,221, 27,112, 56,132,233,156, 98, 58, 37, 31,142,200, 39, 19,230,227,169, 39,
- 93, 25, 13,210, 31, 80,177,116,232,200, 49, 57, 57, 33,203, 50,242,223,252, 36, 23,223,249, 12, 81, 51, 10,122, 98,237,223, 67,
-249,101,178,147, 19, 58,223,240,237,200,196, 65,153, 97,102, 19, 47, 57,209, 37, 58,159, 51, 59, 25, 82,230, 57,243,217,156,179,
- 87,159,165,213,239,162,164,173,111, 42,143, 14,235,165, 29,172,246,251,244,201, 20,107, 45,122, 58,193,164, 41,119,198, 41, 70,
- 42,230,145, 34, 89,105, 51, 63, 24,133,100, 7, 31, 12, 97,139, 18,103, 44,106,243, 44,210, 89, 92, 89,112,244,137,127,199,228,
- 55, 62,201,237,231,190, 72, 54,158, 48,205, 13,101, 44, 41,155, 77,154,237, 6,177,140, 88, 89,237,145,105,205, 74,175,143, 49,
-134,141,118,207,231, 43, 55,218, 68, 2, 82,231, 24,236, 29, 81,236,236, 19,109,109,248,131, 80,121,173,172,104, 72,244,206, 54,
-242,236, 5,158,253,161, 31,225, 23,127,236,159, 35, 58, 77, 26, 78,146, 40,104, 11, 65, 94, 20,236,140,135,172,196, 13,214,186,
- 43, 28,151, 25,173,121, 74,199, 1, 86,225,242, 25,170,213,195,108,111, 35, 46, 94, 34,105,118,201, 38, 39,254,250, 17, 21,129,
-206,213, 0,165, 13, 7, 97,149, 35,141,181, 75,100,180, 42, 91,122, 73, 3, 46,150,161,117,106, 95,245,186,136, 85,123,238,200,
- 79, 59,200,208,180, 40,185,224, 76, 84,177,239, 85,113,183, 11,150,178, 43, 23, 59,239, 10,213,116,181,254,184, 92,164,182,133,
- 67,176,202,128,175, 3, 97,168, 96, 84, 79,254,243, 59,210,144,181, 18,200,110,214, 56,164, 53, 33,104, 35,188, 24,183,120,207,
- 86, 19,228, 91,149, 95,252, 34, 4,167,242,251, 23, 75,159,129, 56, 5, 53, 44,233,171,170,166, 36,184,140, 37,171,231, 65,152,
- 83,146,205, 48,178,250, 14, 37,138,193,148,160, 34, 92,225,247,231,241,218, 69,223, 64, 33, 49, 90, 35,172, 67, 53, 12, 14,141,
-140,155,193,217,207, 34,172, 69, 68, 77,156, 41,176,186, 68,168, 18,167, 34,148,118, 68, 40,223, 20, 68, 49, 46,216,180, 58,102,
- 1, 50,215, 62,145, 78,167,136,164,133,209, 37, 82, 8,100,164, 64,135, 73,215,250, 73, 81, 4, 69, 6, 50, 66, 54, 34,255, 60,
- 1,159,142,227, 6, 78,250,215,226, 81, 26,133,140,125,184, 11, 42,242,236,118,165, 16, 81, 28,222,114,140,108, 52,145,145,194,
-106, 67,122, 50, 98,240,234,139,136,249, 49,205, 94, 11,135,193,166, 94, 42, 58,187,243, 42,249,104,232,137,158,118,129,248,200,
- 10, 38,183, 11,169,100,229, 96, 88, 59,250,202,197, 30,155,240,119, 89,135, 12,121,191,122,127,205,138,192,167, 88,254,125, 87,
- 27, 51,185,224,187, 94, 95, 37,225,121,156, 10,188, 33,231, 39,242,197, 26,170,202, 93,247,166, 91, 38,228,158, 83, 25, 28,133,
- 24,216,234,250,137,131, 87,178,168,155,186, 18,107, 23,121, 2, 46,240, 76,108,144, 4,182,214, 47,162, 83,197,108,103, 66, 54,
-155,179,126,246,173,156,127,239, 63,129,121,130, 56, 46, 48,218, 49, 63,246,141,222,116, 4,174, 16,228,115,139,206,160,140, 67,
- 80, 91,238,208, 86,120, 94,177,116, 20, 25,152, 6,244, 79,118, 56, 41, 30,208,113, 9, 69, 89, 98,173,166,223, 94,161,215, 77,
- 40,180, 64,246, 74,244, 36, 2,233,104, 10, 67, 36, 21,177,106, 17, 91,135, 70, 51, 58, 40,200,116,193,168, 56,160,223,124,140,
- 11,103,207, 16,169,168, 73,171,213,164,187,181,198,231,126,245,227, 60,241,174,119,177,182,181,194,249,103,223,197,189,207,254,
- 62, 47,255,230,191,163,213, 95,231,194, 91,222,195,193,237,215,104,116, 87, 61,116,209,233, 49,120,248,128, 7,175,190, 74,171,
-165,120,230,107,191,129,227, 91, 55, 40,103, 99,158,250,232,159,224,198,167,158, 99,243,242, 35, 72, 64, 91,205,153,235, 79, 51,
- 62,218, 37,110,182, 57,217,217,161,221,235, 49, 57, 57,100,235,177,199,120,248,218,171,148,218,177,186,177, 66,158, 78, 56,127,
-237, 41,238,189,250, 50,143,188,229, 26,233,120, 70,210,106,115, 50,154, 81,102, 41, 89, 58,163, 44, 11, 14, 30,236, 48,207, 50,
-138, 82,241,250,205, 91,188,247,171,190,154, 78,103,133,147,193, 1, 73,175,195, 92,195,112,120,204,227, 79, 92,196, 32, 24, 30,
-141,249,252,239,253, 14,255,253, 95,253,111,249,240,159,249, 97,218,253,245, 83,157, 94,109,186, 98, 50, 47,131,145, 45,136,187,
- 11, 98,153, 9,255,102, 76, 96,104, 75,100,164,112, 46, 33,234,180,136,140,195,229, 5,217,100, 0,243, 57, 95,243,117,255, 13,
- 95,243,145,239,227,159,254,189, 31,229,255,251,181, 79,146,180, 18, 74, 3, 69, 86,240,182,119, 62,205, 11, 47, 12,222,244,252,
- 65,227, 45, 60,243,219,137, 12,183,127, 19, 30,108,195,100,134,158,229,164,163, 17,211,163, 1,101,150,249, 16,142,124,142, 53,
- 26, 37, 21, 6, 11,133, 65, 90, 65, 19,201,180, 48,216, 56,102,184,187,135, 82,142,213,243, 91, 65,247,107,176,133,161,204,230,
- 12, 15, 78, 24,255,246,255,204,123,127,226,239, 83, 78,119, 49, 69,225,117,190,121, 70, 62, 58,241,211, 70,171,237,253,162, 27,
- 45,148, 48, 96,148,135, 33,133,196, 10,179,216,211, 87, 44,176, 44,197, 21,198,239,219,181, 97,146, 26,178,234,190,237,123, 3,
- 28,107,140,191,153,140, 65,108,158, 69, 21, 25,233,206, 30,111,252,200, 15,242,218, 39, 62,141, 53,150,125,237,136,251, 77,186,
-237, 54,110,125,149,178,240,164,195,190,138, 73,130,225,196,102,171, 75, 98, 45, 42,137,233, 70, 13,156, 16,204,203,156,181, 86,
-151, 66,103,160, 75,250, 43, 29,166, 55,110,179,126,225,108,152, 6, 45, 46,142, 80, 74,145,239, 63,160, 35,254, 40,157, 51, 23,
-105,118, 26, 72, 4,185,179,222, 13, 48, 48,126, 27,218,114, 51, 31,241,142, 70,131,149,164, 73,107,165,143,213,154,241,157, 47,
- 19,119, 59,116, 31,125, 28,157,231,196,101,201,218,211,127,132,157,207,255,122,176,211, 20, 65, 71, 28, 60, 83,194, 33,100,157,
- 91,178, 54,119,245,100, 33,100,197,105,175,184, 68, 34, 88,195,134,130, 92,123,157, 11, 8, 54,179, 11,175,149, 10,154,244,255,
-110,172,173, 73, 74, 85,226,153, 49,214, 19,177,146, 46,182,152,248,129,187,114,169, 91, 50,151, 95, 40,143,170, 67,217, 87,105,
- 83,101, 99,191, 57,160,189, 98,156,171, 69,118,124,189,234,116, 65,202, 22,174,111,129,172,194,183,131,253,175, 8,135,177, 67,
-196, 21,218, 96, 23,145,235,209,194,227,157, 32,219,172,156,100,221,178,197,130,240,148, 9, 47, 91,119, 24, 44,178,213, 89, 80,
-171,165,242,247, 46, 81,120,125,145,191,215, 84,140,203, 83,176,150,168,127,214,219,201, 6,147, 19, 5, 96, 98,172,107,161,180,
-129, 68, 5,229,133, 37,110, 52,253, 61, 64,130,206, 51,191,211,181, 32, 27, 26, 17, 12,126, 80, 81,200, 5, 23, 68,173, 14, 56,
-129,108, 72, 68, 38,112, 58,242,201,114,145,183,254,197, 73,172,176,222, 74, 66, 74,239,158, 88, 53,121,161,169,145,210,235,215,
-133, 19, 97, 34,151, 88,157, 6, 66, 92,208,176, 11,130,172,213, 59, 71, 10, 25,249, 53,158,192,179,222,165, 68,167, 41, 69, 54,
- 39,219,187,203,163,207, 60,130,179, 57,196, 45,162, 78,147,249,209,140,114, 52, 90,152,250, 24,106,215,192, 42,126,200,177, 68,
-144,100,169,201,171,215, 64,178, 18,177,215,114,245,106, 37, 84, 53,148,117, 84,113,128,212,101, 8,125,161,146, 43, 26, 27, 84,
- 11,126,125,101,140,169,175,123, 92,149,137,224,234, 35,199, 46,157,225,222, 99,158,218,146, 86,224,155, 15,169,146,112,191,149,
- 97,104,243,196, 60,167,211, 83,187,252, 74, 69, 43,165,244, 28, 7, 44, 87,126,224, 71,217,123,229, 30,141,118,147,254,214, 22,
- 73,127, 21, 97,143, 96, 38, 41, 83, 40,103, 97, 53, 36, 64, 68,142,194,128, 29, 67,158, 57, 68, 11,108,211, 23,113,153, 64, 57,
-113,152, 22,148,198,107,252,167, 78,241,177,198, 47,241,235,217,223, 32,118,175,208,146, 93,214,250, 61,226,182,197,229,142, 94,
-175, 69, 46, 35,144,154,155,251,175,113,101,227, 73, 86,215, 27,108, 31,108,243,200, 35, 23, 57,217, 46, 24, 20, 35,250,205, 45,
-114,123,200,253, 7, 19,162,217,201, 9,179,201,156,209,225, 46,151,159,120,156,249,116,202,232,248, 16, 77,196,100,156, 18,185,
- 25, 91, 79, 63,206, 27, 47,252, 1,145, 82,244,215, 87,201,178, 49,118, 56, 32, 29, 79,184,246,246,119,144,158, 28, 32, 84,194,
-246, 27,247,120,231,215,125,152,123,207,127,142, 66,107,230,131, 1,113,107, 5, 99, 53,199, 15,246,105,118,219,216, 50, 39,155,
-167,156,125,228, 60,195,131, 3,159,205,158,105, 92, 57, 97,227,202, 59, 56,217, 59,102, 58, 60, 96,125,235, 28, 89,154, 50,157,
-102,204,230,115,142,119,119,176,102, 74,167,187,129, 84,130,149,181, 21,204,177,225,100, 52,163,211,217,224,112,247, 22,157,230,
- 22,237, 94, 23, 43, 27,164,179, 25,221,126, 27, 84,204,205,151, 95,229, 3, 31,251, 40, 63,250, 43,191,249,159, 21,242,218, 69,
-205,229,160, 51, 80, 77,132,234,122, 7, 53,140,207, 99,118,102, 49,165,251, 48,110,159,227,157, 36,136,164,225, 25,174,137,130,
- 78,151,104,109,157,150,144, 32, 98,116, 54,227,175,253,139, 95,226,207,238,222, 97,251,245, 47,113,184,243,144,141, 11, 87,121,
-219, 7, 63,186,152, 66,132, 8,238, 87, 32, 68,240,109,183, 67,184,253, 10, 12,198,184,105,202,252,214, 29,202, 79,255, 39,216,
- 63, 64,142,198,100,163,148,195, 84,211,126,230, 50,103,190,226, 89,210,225,208, 95,132,185, 65,137,136,164,215,193, 72, 72,179,
-140,168,149, 48, 27, 79, 61,170, 96, 45,113, 28, 97,203,146,147,221, 99,242, 44, 39, 63, 58,198,205, 6, 94,122,152,166, 52,214,
- 54, 48,243, 49,113,183, 79,123,101, 78,145,149, 52,226, 4,235, 20, 91,103,187, 80,206,192, 88,108, 89, 32, 91, 93,223,117,227,
- 29,161, 48, 6,210,185, 15,125, 72,115,136, 34,202, 82, 47, 73, 95, 36, 46,203,112, 73,130,236,244,176,119, 95,167,252,241,159,
-228,225,191,250, 4,251,101, 73,188,214,231,145,115,155, 72, 33,216, 42, 75,102,165,227, 76,220, 96,160,115,246,165, 67,161, 88,
-141, 99,250,113,147,212,149,196, 56,166,182,160, 85, 40,166, 46,103,150,231,116,146,132,163,217,136, 22,160,165, 32, 78, 26, 28,
-127,225, 85, 54,191,254,171,252, 62,189, 98, 95,199, 49,229,100, 6,147, 1,244, 55,120,242,173,215,216,127,237, 30, 68,130,212,
- 64,230, 28, 13, 45,136, 59, 77, 34, 35, 24,102, 51,154, 14,138,209,128,217,209, 54,142,136,205, 75, 87, 16,171,125,226, 76, 99,
-165, 64,149,182,214,231, 46, 75,174, 93,248,139, 11, 19,172, 13, 17,143,203,228,160,229,162,186, 72, 97, 13,123,241, 69,220,121,
- 77,242,170, 98, 89, 79,217,241,213, 59,109,113,106,186,175,224,206,164,115,142,184,123,142,236,248, 70,136, 80, 93,250,185, 80,
-128, 23,145,171,139, 36, 76,191,111, 20,117, 3,178,248,165, 90,148, 95,191,120,161,100,125, 64,218,165,245, 65,197,198,175,244,
-201, 82, 46,246,253,158,212,231, 97, 73,112, 88, 23, 14,244, 58,195,157,234,131,171, 35, 63,157, 19,196,221, 75,136, 72,160, 39,
- 15,113,186,218,215, 58, 18, 33,188,119,187,168,113,227,160,142, 84,149,166,193, 23,118,227, 85, 27,170,221,247, 97, 47, 4, 52,
- 78,133,223,137, 98, 36, 22, 33,122,158, 80,151,207, 17,173,134,111,189, 34,131,213,222,231,221, 57, 65,212, 78,208,101,233,245,
-224,141, 4, 85,104,159,162,102, 28, 74, 52, 3,255, 36,241,153,220,137,196,217, 18, 33,155,254, 53,139, 64,120, 83,141, 64,253,
-240, 68, 93, 17, 41, 63,133, 86, 59, 14,235,188, 57, 16, 22, 33, 20, 34,138,124,193,143, 26, 72,233, 3,153,162,184,137,136,124,
-152,139, 76, 26,254,103, 80, 72, 25,121,178,105,145,225,102, 35,174,191,231,113,214,174, 63, 29,138, 91, 3,173, 20,179,215,191,
-236, 45,118, 27, 45, 92, 58,175, 17, 30, 74, 23,246,209, 98, 97,161, 16, 38,113,183,236,217,143, 91,124, 15,238, 77, 10,218, 37,
- 82, 71,213, 32,178,212,148,214, 4,185, 42,207, 32,100,167, 91,107,130, 90, 34, 40, 74,150, 72,162, 78, 46,249, 92,212,182,203,
-225, 62, 67, 98,169,130,101, 26, 52, 87, 46, 82, 76,143, 48,197,120,233, 51,117, 85,176, 92,205, 13,144,149,236, 48,240, 19, 84,
-163, 77,123,235,157, 60,184,241, 18, 78, 59, 86, 47,157, 97,186, 7,205,238, 46, 28,196,252,250, 47, 77,153,247, 5, 61, 11, 42,
-134,196, 65,187,233,175,178, 86,199, 81,104, 15, 14,198, 93,152, 28, 58, 92, 95, 48,219,119, 56,233, 48, 2,140,112,180, 69, 65,
-146,126, 28,215,124, 47, 43,113,147,194,150,136,121, 68,163, 89, 96,242, 14,131,116, 64,175,209,231,124,251, 81, 58, 23, 75,138,
-227,152,157,209, 49,173,102, 15,109, 28,173,200,123, 20,196, 46, 97,170,167, 68, 59,175,223,231,236,229,117, 58, 43,215,185,241,
-153,207,242,216, 59,223, 66, 58, 16,232,201, 49, 34,146,244,214,207,115,244,240, 33,217,116,192,123,190,245, 59,121,240,165,151,
-217,184,112, 9,135,226,224,230,107, 40,145,211, 63,115,145,147,237,123, 52,154,138, 60, 45,136,227,132,213,213, 14,243,241,128,
- 44,203, 57,247,248, 51,236,188,250, 7,156,187,254, 44,113, 35,161, 44, 10,134,251,187, 56,225, 72, 7, 71, 30, 50, 41, 29,217,
-108,194,225,254, 17,235,151, 54,153, 12, 82,198,131, 33, 70,107,178,241,148, 70,172, 72, 58,107, 76,166, 5,206, 25,138, 60, 35,
- 77, 83,239, 5,162, 58,164,243,140,213,190,192,186, 6,243,249,156,102, 75,113,116,239,132,139,215,175,242,227, 63,249, 5,111,
-210, 96,171, 27, 95,212, 59, 29,132,169,111,110,226,190,159,146, 93, 17,236, 13,203,197,169,104, 75,223,233, 39,141,224,172,218,
- 90, 50,111, 81, 65, 87, 93, 29, 57,133,215,209,235,148,236,193, 46, 73,158,114,253,234, 51,188,245,131,223,190,144,234,212, 5,
-221,158,118,117,155,221,129,219,119,161, 48,228,159,254, 12,249,175,253, 22,210, 65, 89,148,220, 59, 24,242,198,116,202,200, 88,
- 30,230,134,246,127,124, 30,254,211,139,252,201, 63,243,205,158,156, 99, 5, 73, 59, 66, 0,253,245, 46,243,189,153, 39,188,165,
- 25,206,104,202,194,144, 68, 18,103, 52,243,201, 24, 93, 20, 12,179,140,241, 43,175,208,186,180,133, 53, 37, 81, 4, 18, 69,103,
-243, 60, 46, 32, 11,205,241, 58, 82, 40, 26, 61,133, 57,206,188,159,179,113,225,166,177,190,241, 49,193, 36,166, 44, 60, 27, 55,
- 18,168,102, 66,174,245, 66, 53, 5,216,110, 31,247,227,127,159,227,159,249, 56, 69,145,179,250,232, 5,206, 60,117,153,104, 48,
-225,164, 40, 72,139,146,169,182, 12,203,130,193,201,140,225,217, 53,208,154,153,117,116,149,224, 36,205, 72,164, 68, 10,193, 56,
-203,152, 22, 5,170,165,120, 48,153,211,140, 37, 81, 20,113, 50, 57, 97,173,187, 66, 34, 21, 78, 8, 38, 71, 83, 31,215, 42, 43,
-120,214,239, 94,137, 20,246,193, 61,196,211,107,124,203,207,253, 60,255,251, 19,239,226,226,198, 10,189, 72,144, 4,104,142, 34,
-103, 43, 82,148,121, 70,167,183,202, 96, 58,225,226,163, 87, 41,243,130,236, 96,223, 91,110, 54,123, 68,165,161,181,126,142, 90,
-161,227,150, 78,181, 55,235,181, 69, 85,216,100,109,131,105,171, 53,239,146,127,124, 77,178,171, 32,116,199, 34,153,108,233, 57,
-106, 88,159,197, 78,126,137,144, 92, 19,149,172, 45,201, 71,219,152,114, 30,206,172,211,177,176,184,211, 36,168, 90, 22, 36, 23,
- 59,235,122,105, 94,189, 58,177, 56, 20,165,148,254,241,194,228, 94,161, 4,213,195, 27,227,234, 9,212,218, 42, 31, 94,176,100,
- 51,239,185, 0,149,198,189,114,215, 11,171,165,197, 58,193, 17, 53, 55,105, 94,124, 39,102,118, 76,121,178,131,136,108,125,220,
- 11, 37, 48,163,253,128, 34,133, 72, 95,169,168,131,230,101,236,239,103, 39, 16, 73,219, 19,231, 68, 20, 92,231,148,103,202, 43,
-175,255,182,206, 67,237, 56,235,155,140, 72, 66,169,113, 50, 70, 38, 17,182,152, 17, 53,219,152,178, 12,133, 89, 16, 55,123, 32,
-115,255, 90, 35,176, 58, 15,209,179, 37, 81,163,129, 41,114, 80, 77,207, 39,140,188,220,206, 26, 27, 82, 9, 5, 22, 19,214, 16,
- 50, 72, 12,189,101,155, 80,193, 92, 42, 72,202,148,108,249,124, 7, 17, 8,119,206,161,154,173,128,248, 72,100,210,244, 82, 63,
-229, 13,113,204,124,194,224,193, 29, 18,155,114,246,237,239, 64,245,124,179,162, 58, 43,100,199, 99, 70, 47,124,138, 98,184, 15,
- 21,212, 95,249,250, 75, 25,120,177,129,255, 33, 22,150,190,190,184,219,186, 42,214, 18,206, 10,209,145, 94,127,238, 97,245,165,
- 66,190, 84, 76,141,181, 11,181,132,240,147,186,171,136,107, 98, 97, 62, 83,173,164,150,159,195,201, 69,152, 82,245,122, 43, 41,
-101, 61,253,235,156, 98,122,132, 43,167, 75,167,180, 88,200,240, 2, 73, 84, 73, 81,199, 39,135, 11,150,205,175,252, 14, 6,219,
-135,244,207,246, 41, 38, 25,131,219, 59, 36,157,117,172, 59,196,190, 40,249,199, 59,142,223,253,137, 53,238,254,251, 9,251, 99,
-199,116,106, 25,167, 94,144,180,253,170, 96, 92, 64,167, 3, 89, 9,239,123, 70,176,158, 67,124, 65,112,247,174, 96, 56,176,236,
- 13, 45, 43, 74,241,145,222,203,252,108,246,181,108, 53,189,186, 39, 79,115,250,107, 61, 70,131, 41,137,108,112,247,228, 54, 23,
-251,151,120,241,229,187, 88,155,146,153, 49,179,201, 37,156,212,116, 26,125,166,197,196, 7,243,216, 46,209,245,119,191,149,147,
-253, 61,246,238, 62, 96,243,220, 25,132,106,208, 88,221, 34,155, 12, 56,184,125,147,205,243, 31, 36, 59, 25,114,254,242, 21,246,
- 94,123, 17,213,136, 40,117,196,225,189, 91, 92,125,247,251,152,156, 28, 49, 58, 56,160, 72,199, 60,242,244,179,236,190,126,147,
- 98,158,113,246,234,121,164, 74,152, 12,142,200,211, 25, 27,231, 47, 51, 62,220, 99, 54, 74,208, 69,202,201,222, 33, 43,107, 91,
-104, 99, 56,222,185,199, 59, 62,252, 97,242,201, 16,155, 77,136, 27, 9,195,227,135, 88, 93, 82,102, 25, 42, 17, 32, 91,228,185,
-102,120,180,143,177, 41,137,106,250, 44,239,118, 66,158, 23, 36, 70,144,151,150, 44, 47, 41,242, 57,217, 60,227, 71,126,225,227,
-116, 86,207,132,194, 73,189,147,242,215,171,241,251,107,157,131,106, 33, 84, 3,231, 74,156,208,193,197, 76, 19, 22,148, 33,154,
- 52, 9, 87, 97,128,240, 92,180, 56, 12,193, 55, 2, 54,199,229, 41, 78,107,172,209,228,227, 49,217,104,204,202,227,207, 18,183,
-186,225,117,232, 55,249,173,203, 69, 72,199,209, 43,240,198,125,202,189,125,210,127,246, 83,222, 15, 56, 74,120,248, 96,143,123,
-179, 57, 15,140,229,100, 86, 48,153,101,220,210,134,205, 72,113,177,211,226, 71,254,143, 95,228, 7,191,241,221, 92,125,242, 49,
- 76, 44,137,218, 49,178,211, 66, 74,111,176,211,176, 80,104,135, 46, 10,100,105,201,102, 41,197,120, 66,212,148, 68, 17, 28,124,
-246,121, 46,127,247, 71,200,199, 19, 58, 23, 46,162,226,216,203,123,226, 6,249, 52, 37,105,245,233,116, 87,253,116,149,229,152,
-172,192, 5, 18, 20,182,244, 5, 93, 56, 40,203,160,108,243, 97, 24,113,171,205, 88, 27,148,138, 24,204,115,190,235,210, 6,179,
-119,191, 31, 29, 69,180,174,158,135,225,148,241,108,142,117, 48, 46, 74,102,218, 11,172, 87, 34, 65,175,213,227,226,215,127, 13,
- 47,253,202,175, 19,117,154,172,136,136,173, 40,225,124,111,111,211, 5,170, 0, 0, 32, 0, 73, 68, 65, 84,133,181,102,135,172,
-204,137,162,216,231,214, 59,216, 72,188, 71,126, 44, 96,173,213, 36,182, 37, 58, 47, 33, 82, 76, 71, 83,156,246,251, 90, 41,164,
-215,203, 10,129,106,196,232,253,109,146,167,223, 78,255,242,117, 54,128,149, 68, 65, 97,105, 39,138,195,194, 91,184,108,196, 13,
-206,116,250,116,186,235,236, 77,142,217,127,112,151,254,234, 38,205,118, 23, 61,155,135, 73,117,147,249,112,175,222,151, 59, 22,
-209,169,117, 94,138, 19, 53,187,124,113,248, 44,236, 99,173, 91,212,157,101, 24,219,167,182,217,197,164, 36,150,131, 98, 22, 78,
-106,174,138,159, 20, 11,168,190,102,211, 11, 48,179, 99,223, 0, 4, 45,121,165,115,246,201,112,178,246,171,151, 65,138,230, 4,
-111, 66, 3, 64,196, 45, 95, 96, 93,177,100,137, 91,189, 38, 87, 67,247,226, 20, 18,230,187, 18, 33, 65, 42, 21,108,126, 67,209,
-103,161,147,175, 80,128, 58, 66,214, 85,187,220,160, 73,175,137,120, 2,103,166,100,219, 95,196,228, 19,164, 50,254,243, 80,213,
-113,236,130, 34, 35,174, 48,100,127,223, 46, 91, 36,219, 48, 90, 9, 9, 50,248, 57,168,200,163, 77, 34, 2, 97, 16,113, 18,184,
- 4,206, 75, 53,163, 40, 32, 33,222,224, 68, 88,135,136, 26, 88,109,112, 90,215,158,236, 86,167,126, 32,136, 98, 98,149, 80, 90,
-141,195, 17, 37, 45,116, 54,243,246,182, 14, 74,147, 19,137, 6, 68,222, 48, 72, 96, 17, 86,121,129,138,242,134, 39, 62,133, 77,
- 6,178,152, 70,132,215,234,139,118,132,144,222,125,206,255, 12,200, 70, 19, 91,228,126,146,151,193,105, 79, 69,100,131, 99,166,
- 59, 15,152, 61,188,205,229,235, 23,145,237,166,103,255,203, 22,170,211, 71,223, 59, 36,223,223, 70, 79,102, 62,159, 32, 88,192,
-214,237,184, 89,114,137, 11,146,204, 5,183, 66,212,205,172, 88,114, 61,172,164,141, 50, 56, 28,186,176, 91,175, 84, 15,149, 98,
- 98,217,122, 81,132,198, 87,197, 50,144,234,130,226, 59,100, 34, 72, 1, 90,219,133,210,194, 44,149,104,203,130, 88,233, 22,255,
- 79, 10,129,205,125, 58,161, 91, 74,133, 19, 66,248,115, 65, 46,124, 33,188,210,196, 6,146,161,227,236, 7,127, 8,215,204,216,
-123,238, 46,237,110,143, 98,110, 72, 26,146,120,148,243,167,126,232,136, 95,251,196, 38,233,254,132,100, 83,162,134,150, 86, 91,
- 16, 43,193,234,170,101,107, 5,118, 30, 6, 53, 98, 36,184,241, 26,164,202,115,139,159,120, 12,250, 23, 5, 87,159, 16,148,115,
-139, 56,144,188, 39,253,121,138,254, 95, 64,234, 57, 38, 41, 73,244, 42, 55,183,223, 64, 83,208, 80, 9, 39,233,128,205,228, 60,
- 37, 51, 82,189,206,225,236, 33,155,253,139,148,186,160,211,104, 80,154,148,203,103, 19,162,157,215, 95,199, 9,135, 18, 2, 27,
- 55, 57,126,176,205,241,206, 61,122,103,206,115,237,173, 79,179,121,245, 73,246,127,231,183,144,113,139,166,115, 36,173, 22,243,
-241, 9, 43, 91, 91, 76, 78,142, 40,211, 49,221,181, 51,244,174, 63,206, 31, 62,247, 28,143, 60,241, 40, 81, 35,166,152,251,100,
-174, 34, 77, 57,122,227, 53,180, 49, 20, 89, 70,171,219,101,180,255,144,254,218, 6,131,147, 99,202, 50,229,202, 83, 79, 98,202,
-156, 44, 45, 57,243,216, 21,118,110,189,129,206,230, 56, 33, 57, 57,188, 79,212,136, 49,185, 96,176,119,192,238,206, 49,237, 46,
-108,172, 55,137,155, 49,198, 8, 76,145, 35,104, 51, 29,205,121,253,245, 59, 92,127,230, 26, 63,242, 47,127,109,105, 42,150, 75,
- 94,194, 38, 16,104, 76, 32,204,116,194,207,149, 1, 51, 12,112,187,245, 25,212,254, 78,241,233, 97,126,113, 39,151,226, 42,157,
-151,112, 97, 64,231,152,249, 28, 61,159, 82,166, 57,147,189, 29,214,159,126, 23,155,151,223, 26, 30, 63,171, 13, 96, 42, 19,139,
-122, 21, 32, 44,238,193, 11,240,240,128,244,133, 23, 48,191,240, 75, 52,174, 92, 98,239,229, 59,188,124, 52,228,190,117,156,236,
- 31,211,232,119,120,207,119,124, 61,215,190,229,163, 52,182,206,178,253,252, 31,240,137, 31,255,103,156, 59,180,252,219, 79, 62,
-207,223,122,235,117, 68, 28,211,104, 55,145,173,132, 70, 51, 38, 51, 14, 25, 71, 20,101,137,203, 11,114, 93,112,238,242,117,110,
-237,221,199,234, 38,205, 68,240,202, 39,127,143, 71,190,253,195,152, 60, 67,182, 87,144, 88, 76,153,227, 76, 65, 89, 20, 52,154,
-107,180,207,108, 34,173,198,232,194, 79, 92, 78, 19,171, 40,232,127,131,107, 84, 89,128, 51, 65,210,101, 17,205, 4, 41, 37,155,
-137,228, 35, 79, 61,134,179,142,251, 7, 67, 10,109,136,142,198, 76,108, 73, 39,137,233,136, 24,103,141,119,136, 18,208,238,245,
- 33,157,177,247,241,223,224,201, 51, 27,180,156,164,223,108,114,166,217,246,174,108,229,156,134,146, 40,233,136, 20, 68,182,164,
- 20,150, 36,142, 56,153,142,233, 52, 26,204,129,121,150,209,235,247, 3,177,207, 64,164,234,180, 51,148, 66, 89,129,158,141, 73,
-166, 67, 84,127,131, 39,190,237,107,121,249,183, 63,141,139, 34, 26,153,165,196,242, 88,171,195, 88, 23,172, 21, 5, 73,187,205,
-197, 70, 35,200,149,164, 87,110,116, 58,184,201,148,150,146,164, 39,251, 53, 17,204, 5,150,184, 19,193,172,165, 58, 15,141, 91,
- 76, 30,194,213, 82,160,138,186, 81,177,230,149, 18, 75,135,156,173,137,106, 82, 44,249,252,188, 25,218,100, 41, 58,181, 78,109,
-171, 14,209, 80, 84, 3,223,184, 78,134,115,162,222,241,215, 43,242,106,122,183, 75, 29, 68,128,128,125,104, 77,177,152,132,164,
- 55,255,192,202,154, 25,191,188,107, 71, 84, 50, 36,223,104, 56, 25,161,162, 38, 78,143,107,151, 53, 39, 23,208,173,215,174,203,
-133,141,110, 48,203, 65, 46,244,208,214, 90, 76, 49,247, 59,229, 83,105,110,254, 83, 54, 22,138,237,155, 64,236, 97,238, 26, 38,
-178,222,144, 73, 23, 1, 26, 16,126,143,110,141, 47,240,214, 6, 34,157, 14,111,204,135, 11, 89,157, 7, 71, 62,143,130,121,243,
- 26,129,211,101, 40,126, 22,231,180, 15, 71,113, 51, 31,166,146, 68,128,242,196,183,184,225,247,184, 70, 19, 37, 49, 70,128,213,
- 5, 74,120, 29,185, 51, 6, 37, 84, 88, 49,232, 32,113, 20, 64, 85,176,109, 45,215,243, 10, 4, 21,172,118, 19, 84,212,240, 95,
-131,140,194,100,175,124, 32, 78,156,132,230, 82,122,110,203,206,125,230, 7, 15, 73, 15,119,105,191,251, 42, 50, 78,112,170, 69,
-212, 89,167, 40, 12,102, 50, 68,182,251,216,244, 94, 29, 38,180,168,212,226,148,223,160,117,167,221,228,172, 59,221,188, 89, 28,
-178,130,228, 77,128,159,116,224,148,104,235,155,202, 48,121, 59,177, 36,139,115,149, 36,205,213,211,186, 53, 11, 46,138, 16, 34,
-160, 61, 44, 60,225,171,166, 32, 16,237,170,230,178,134,229, 23, 1,137,167, 44,103, 43,195, 90, 47, 5,117,167,222,170, 16, 94,
-230,184,254,254,143,176,255,250, 3, 86,175,173,176,178,117,150,230,106,147,249,104, 76,154,221,227,230,191,216, 98,208,222,161,
-125,117,131, 98,156, 19, 53,188,182,188,114,103, 52,165, 64,173,192,121, 13,243, 28,146,134,100,171,227,232,172,249,158,113,119,
-219,145, 25,159,225,222,237, 9,100,228,120,195, 94,230, 92, 54, 71,107,201,246,254,152,241,241, 61,148, 76,208,214,178,218,218,
-100, 86,100, 88, 44, 45,213, 37, 18,134, 76, 37, 36, 56, 10, 83, 48,183, 57,202, 54,200,138,146,104,116,240,144,222,218, 42,187,
-219, 59,108,157, 93, 99, 58,119,108, 61,114, 13, 83, 78,201,178,130, 91,159,251, 2,198,192,193, 27, 95,226,201,175,250, 99, 12,
-238, 63, 36,207,114, 86,206,172,146,142,166,180,186, 45, 78,134, 39,104, 20,107,231,207,242,198,141, 59, 92,127,251, 51, 12, 14,
- 70,108,246, 26,116, 86, 55,152,142,142,152,142,166, 72,233,232,244,218, 52,155, 45, 92,121,196,240, 56, 71,158, 63,143, 60, 60,
- 33,205,115,116, 97,216,191,123,151,102,183,205,124, 56, 64,196,138,102,171,231, 89,163,194,209,217,232,179,145, 58,110,221,122,
-131, 78,167, 67,174,231, 8, 27,209, 91,105,211,104,247,249,242, 75,175,243,225,239,253,110,190,227, 47,255,237, 80,112, 23, 80,
-187,255,178,181, 47,194, 38,236,200, 85,107, 65,166, 17,194,195,199, 85, 39,175,226,128,138, 71, 1, 94, 95,100,100, 19,244,152,
- 30,186, 47, 48,211, 9,122, 62,161, 72,115,138,201,132,124, 62,229,252, 31,249, 48, 82,169, 0,229,155, 37,255,233, 70, 45,211,
-240, 47,209,194,253,231,113,247,247,152,255,135,223,198,253,222,103,104, 60,113,141, 59,159,127,153,207, 31,141, 56,152,102,116,
-214, 58,252,224,231,126,131,141,119,189,159,114, 58,164, 28, 28, 81, 22, 5, 79,124,211,199,120,235,247,124, 63,247, 62,247,105,
-254,202,183,124, 63,163,233,156, 51, 87,183,252,174, 95, 41,154,205,132,116,152,122,152,181,112,193,162, 87,112,248,234,151, 88,
- 89,105,161,115,131, 81,146,221,225,136, 50,205, 60,227, 87, 70, 94,230,230, 44,229, 60,163,200, 50,186,235,171, 52,187,109, 48,
- 3,108, 90,153,243, 8,159, 3, 96,116,216, 89, 6, 34,139,241,236,245,106,189,209,139, 99, 86, 87,123,160, 34, 38,195, 49, 9,
-222, 43,251, 32,205,185, 51,203,217,136, 45,205,134, 33,234,244, 24,140,199,100,165,230,104, 50,101, 29, 71,222,237, 48,158,229,
-180,162,136,145,118, 12,202,146, 97,154,145, 26,195,106, 28,115,182,211,227,254,248,132,139,253, 53,172,140, 57,204, 50,164,240,
-113,181,194, 41, 10, 39, 17, 90, 83,160, 60,107, 86, 9,124,134,163, 87, 51,200,196,179,129,221,206,125,108,119,133,111,248,169,
-255,155,231, 54, 31, 97,101, 45,162, 21, 50,150, 75, 99,233,202, 6,205,102, 19,213,110, 83,142, 70,104, 87, 34, 10, 71,220, 72,
-208,217,140, 36, 89,197,106,195,100,247,206,226, 10,177, 75, 68,239,192,128,175,190,243,138, 20, 87, 77,175,181,229,230,146,251,
-187, 11,251, 69, 33,133, 15,177,112,139,168, 83,106, 93,176, 91,218,133, 47, 29,118, 65,223,107,195, 80, 89, 17,136,148, 13,150,
-176,206, 45,183, 1, 56, 20, 2,111,108, 33,107,141,188, 59,109, 77, 47, 18, 68,156,224, 76,182,176, 91, 93,134,252,195, 94,216,
- 97,234, 93,118, 61,101,201,197,132, 23,247,206,129, 0, 61,154,156,210,204, 35, 2,107, 95, 44,199,182, 85,139, 78, 7, 70,212,
-100, 56, 41,229,127,193, 85,127, 73,238, 38, 28,150, 78,176,247, 92,172, 48, 80, 73,136, 97, 13, 31,112,212, 8,175,109, 89, 31,
-111,169,157,114,108, 96,159, 71, 14, 71, 89,179,241, 92,184,230,253, 32, 96, 65, 58,156,213, 1,158,174, 24,233, 49,182, 40,188,
-155,155,181, 40,153,120,227, 24, 21, 3, 51, 40,115,164,106,224, 2,228, 46,133,159,230, 93,109,176, 18, 66,141,130, 33,141, 95,
-205,120,180, 66,169,200,207,234, 42, 66,196, 17, 82, 38,222, 90, 86, 72,191,190,168,185, 3, 62,215,188,152, 76,152,238,110, 51,
-186,115,139, 78,148, 18,173,120, 3, 26,213,221,164, 44, 83,230,119,247, 41,199, 67,116, 58,173, 75,183,173, 34,255, 42,205, 97,
-213,148, 45, 93, 19, 50, 56,199, 45,172,139,235,211,182, 46,210,149, 75,164, 39,131,202, 69,188,174, 93, 90,221, 84,247,136,240,
- 44,117, 21,121, 73, 96,101,102,180, 28,146,228,236, 50, 4, 95,221, 59, 11, 34,202,169,134, 68,138,211,230, 10,222,177,231,148,
- 12,174,138,119,117,110,129,132, 85, 32,216,149,239,248, 91,188,241,249, 93,212,182, 67, 59, 67,115, 61,225,202,187,175,242,226,
-111,126,134, 89,255,143,178,217,248, 18,194, 21,200, 86,147,120, 69, 99,157,161,204, 65,233,202, 34, 87, 64, 34,188,148, 23,137,
- 83,142,124, 12,169, 51,232, 92, 16,197,158, 41, 63, 31, 42, 26,194,113, 44, 62, 64,119,122,130, 18, 93,206,182,207, 50,179, 51,
- 18,209,160, 33, 59, 28,207,143,233,197, 29,226,168, 65,164, 4,186,176, 72, 4, 90, 65, 34, 18,178,116,194,253,249, 45, 86,178,
- 53,162, 86,171,137, 53, 17,231, 30,189,130, 46, 13,227,189,155,232,233,128, 11, 79, 62, 75,153,101,236,221,123,141, 44,179, 60,
-241,150,107, 28,222,124, 17,151,172, 83, 22, 57, 58,106,113,254,153, 11,244,210, 17,230,206, 13,236,100,198,217, 7,175,115,117,
-173,135,184,253, 58, 27, 39, 3,246,174, 60,205, 81,154, 33,102, 25,141,222, 38,227,221, 87,145, 23, 47, 99,242, 33,206,244,105,
-247, 91, 76, 7,187, 88, 35,145, 19, 69,127,107,139,205, 71, 47, 51,216,190,141, 65, 82,140,118,232,172, 93,163, 76, 39,126, 66,
-182,176,249,200, 58,173,110,131,135,219,219,140,134, 25,231, 46,172, 83,228,142, 23, 94,120,137, 31,254, 71,255,136,167, 62,240,
-205, 11, 39, 45,183, 76,132, 11, 5,189,158,192, 85, 24,167,244,162,160,139, 37, 99, 12, 33,192,197,167, 77, 20,170, 61, 56,198,
- 59,176,233,130,114, 56,160, 72, 51,138,241,152,124, 50,197,152,146, 75, 95,249,141,225,226,200, 67,122, 25, 1, 10,108, 46, 17,
-227,194, 18,117,247,101,236,157, 29,230,191,243, 28,252,254,103, 73,174, 94, 96,255,165, 27,220, 73, 83,110,236, 15,248,190,191,
-255,215,120,203, 15,255, 93,210,221, 91, 76,239,220,192, 41, 85,107, 66,117, 81,146,239,109,179,246,232,101,254,249,243,159, 98,
-247, 39,127,140,139,141, 38, 78,249,174, 61,110,196, 40,229, 11, 44, 74, 97,245, 12,135,226, 19,255,246,151,153, 25,201,126,169,
-121,170,223,225,250,219,159,197,100, 57,182,200, 65, 54, 64,103, 76,118, 31,178,253,250, 45,102,105, 70,191,209,244,233, 81,101,
-177,136, 95, 12,211, 42,101,233,161,201,224,105,109,141,193,100,121, 72,250,146,108,158, 89,161,183,210,241,210,184, 44,103,152,
-151,140,178,146, 88, 41,214,227,152, 8,104,162, 24, 37,138,168,211, 34, 63,246,114,154,151, 78,198, 52, 58, 77, 34,165, 56, 46,
-194,202, 34,131, 50,220,178, 3,163,185,157,207,105, 75,201,170, 41, 72,203,146, 73, 94,176,209,106,115,148,101,100,214, 82, 88,
-203,181, 70,130,138, 37,148,166,158,100,144,145,159,218,181, 69, 68, 10,125,116, 68,252,164,160,185,113,150,203,143, 93,160, 28,
- 77,201,173, 33,146,130,177,214,108,246, 59,172,196, 9,147,195, 61,164, 74,232,109, 93, 12, 55,190, 37,234,246,145,205, 4, 17,
- 41,138,108,242, 38, 35, 3, 63, 33, 87, 44, 92, 23,164, 60, 62,246, 64, 46, 65,156, 62,174,181,102,156, 71,114, 41,209,141, 83,
- 41,122, 34,200,139,108,181,243,174, 77,249,196,169, 61,190,151, 7,201, 0, 55, 6,168, 91,136, 83,153,216, 66, 73, 28,130,214,
-198, 53,112,150,252,228,246, 41, 8,221, 85,134, 49, 42,162,117,225, 25,132, 74, 72,183, 95,168, 7,248, 83, 68,120, 33,176, 86,
-215,135,125,101,149,235,161, 90, 89,147,245,116,122,132, 45,230,245, 62,191,142,135,181,161, 1, 9,154,126, 23, 38, 63,161,150,
-104,214, 54, 4,127,176,164, 26,168, 62, 51, 37, 49,149, 2, 32, 22,184, 44,199,217, 24, 33,231,139, 49, 77, 73,127,173,186, 16,
- 60,164, 18,127,223,171,200,195,184, 50, 10,200, 91,208, 9, 74,127, 22, 8, 20,184, 34, 92,223,101, 56, 31,140, 39,160,225, 48,
- 58, 13,217, 0, 1,133,113,133,127, 63, 81, 32,183, 25,237,137,118, 81,140,211,165,215,157, 55, 59, 1,214,207,252,121, 36, 67,
- 66, 28, 32,156, 65, 56,133, 80,139,148, 59,240,209,176,194, 74,255,184, 34,132, 54,201, 8,217,108,162,100,236,175,111, 21, 33,
-149,195, 73,137, 41,189,228,110,186,255,128,114,116, 76, 49,216,229,250,135,222,225,213, 12, 46, 38,146, 9,217,241, 14,227, 87,
- 95, 32,219,223, 70,207, 83,156,168,140, 95,100,240, 86,119,245,103, 95,147, 56, 67, 15,100,150, 60,255, 43,148,200,138, 83,194,
- 96, 20,139, 92,129,138,149,230, 25,253,174,118,168,171,174,163, 42,225,207, 4,249,217, 50,171,221, 45, 53,190, 21, 9,211,123,
- 48, 44,252,252,157, 13,141,108,125,223,248,179,194, 4,155,218,224, 78,179, 88, 27, 4,249,156, 19,182,118,181,243,170, 30, 65,
- 99,101,131, 34,135,246, 86,131,241,195, 49,235,143,175,112,124,247,136,181,115,109,162,120,133,230,209,103,248,206,175, 11,231,
-159,237,208, 88,203,136,100, 73, 90, 58,156, 22,136, 72,208,110,193,120, 71, 96,170, 70,195,129,206,253,181, 93,102,160,172,207,
-111,111, 68,142,251,197, 58, 13, 49,103,148,206,120,246,202,163,232, 76,161,102, 6, 84,139, 8,137,148,138,205,213, 21, 52,134,
-118,212, 34,158, 77,217, 25, 13,209, 69, 19, 71, 70, 28, 39,116,146, 51, 76,139,125,162,210, 25,186, 20,244, 86,207,112,114,184,
-207,219, 62,248, 65, 26,107,125,112,138, 47,254,198, 39, 88,219, 56,195,185, 71,187,140, 6,115,214,207,183,137, 55, 46,113, 38,
- 73,177,191,246,113,182, 63,249,187,188, 60,204, 81,207, 92,193,116,122,136,205, 51, 20,247, 30, 96,157,166, 57,155,113,254, 51,
-159,229,189, 23,207,241,202,147,111,227, 68,103,244,215,207, 49, 60, 28, 16, 69, 49,153,206, 40,139, 28, 33, 99, 30,222,252, 50,
- 87,222,246, 30, 30,188,246, 10,235, 23, 30,163,221,223,160, 56, 62, 36,207, 5,173,114,130, 45,225,230, 11,175,176,119,176,203,
-249,243, 49,253,173,115,116,251, 13,202,178, 75, 94, 58, 30,222,223,229,127,248, 59, 63,198, 83, 31,248,230,218, 20, 97,193, 31,
-174, 98, 25, 43, 41, 90, 35,156, 68,202,239,212,145,225, 38,143, 3,244,238, 22,208, 28, 22, 33,162,197,206,219,185, 96,167, 58,
-193, 21, 37,233,224,152,124, 58,161, 76,115,140,209, 76, 15, 15,121,226, 99,223, 27, 46,233, 12,244,212,187, 14, 36,171, 64, 28,
- 30, 35, 11,240,127, 4,131,155,184, 47,223, 32,123,240, 0,247,220,239,209,186,126,133,253,155,247,185, 49, 51,124,234,246, 30,
-127,253,203,255,145,254, 83,239,100,254,224, 85,127, 32,199,145,159,238, 42,159,103,233, 3, 81,116, 81,224,230, 41,143,254,165,
-191, 1,255,225, 23,161,213,244, 33, 56, 81,132,104, 38, 36,205, 6, 46,245,190,198,247,238, 62,228, 53, 7,131, 89,202,230, 74,
-135, 23,178,156,189,223,253, 12, 31,200,178, 32, 27,211, 20,135, 59, 28,223,185, 31,220,184, 4, 82, 40,146, 24, 72, 11,116, 86,
- 96,180, 65, 74,111, 38,130, 46, 22,120,176,181, 88, 93,250, 3,217,249, 28,227,232,194, 57,196,120,196,124, 52, 99, 48, 47,185,
- 57, 79,131,206,180,196, 80,249,213,148,136,147, 33, 89,112,159,203, 71, 83,222,254,109,127,140,226, 15,254,144,219, 39, 67, 90,
- 81, 68, 23, 69, 87,249, 27, 46, 51,150, 86,146, 48,213,154,134, 16, 60,210,238,243,242,201, 17,189,134,143, 82, 61,211,104, 83,
- 58, 71,233, 28,177,148, 24,133,151, 32, 69,137, 63,145,226,216,127,191,145, 64, 25,133,153,158, 16, 15,246,177,107,231,248,139,
-175,188,202, 15,181, 86,120,242,226, 22,211,249,156,220, 26,114,109,216,158, 79, 97, 50,230,242,218, 38,197, 60,245, 82, 36, 33,
- 64,101,168,102,131, 89, 62,198,148,101, 24, 8, 68, 61,100,214,198, 29,161, 40, 75, 65, 13, 39, 46, 35,231,166, 42,196,149,142,
- 61, 68, 79, 11, 81,201,145, 93,125,240, 88, 81,249,185, 7, 35,157,144,195, 46,171, 29,122,216,133,219, 55,193,242, 34,172, 2,
-164, 12,100, 50,227, 95, 79, 57, 63,198,217, 18, 19,252,231,121,211,107,113, 70, 83,142,247,188,243,154,209,139,130, 30,194,131,
-252,196,164, 79, 53,192, 44, 65,249, 42, 90, 16,170,108, 62, 11,172, 99,129, 16, 17,136, 38, 48,175,247,153, 34,200,162,194,229,
-180,208,237, 87,178,191,208,184,212,125,247,146, 99, 94, 64,114,253, 96,159, 79,113, 54,171,173,109, 43,215,182, 96, 80, 31, 20,
- 44,118, 65, 98, 80,106,137, 37,223, 8,127, 15, 68, 62, 99, 60, 33,171,242,120,168, 44,117,147, 38,182, 24, 47, 30,190,244,193,
- 74, 86, 91,132, 43, 3, 42,163,124, 47,145, 77,188, 1, 76, 8,187,145,194,251, 61,136,184, 21,210,231,132, 71,201, 66,210,161,
- 80,194, 55,101,194,235,204,177, 2, 25, 69, 97, 37,144,212,104,128,140, 61, 4, 47,100,228, 97,229, 56,241,234, 20, 7,229,100,
- 72, 62, 30, 49, 63,216, 6,151,114,225,202, 58, 43,151,175,250,166,178,185,142,166,160, 24,166, 76,111,252, 39,202,169,241,205,
- 84,133, 84, 84,234,138, 37,104,154,165, 41,187,190,122,237, 50,241,145, 58,202,119,153, 91,178,140,228,171,138,253, 30,184, 31,
-181,121,141, 91,106,210,170,137,188, 62,119,171, 2, 29, 26,225,165, 72, 97, 28,167,118,242, 81, 80, 85, 84,215,158, 91,206,164,
-180,167,165,107, 24, 87,251, 44, 32, 93,205, 93,145, 42, 66, 24, 77,163,219, 98,180,125,130,146,138,193,173, 33, 70,231, 28,189,
-242, 26, 78, 23,232,179, 63,204,123,187,223,143,222,209, 8, 17, 97,202, 6, 91, 87,114,134, 47, 24,162,196,231, 49,228,218,175,
-181,179, 19, 40,123, 14, 81, 64,158, 11, 82, 45,136,157,192,150,146,182, 42, 57, 22,231,249,173,217, 55,240,150,205, 13, 30,140,
- 15,233,175,182,184,123,103, 64,183,223,165, 52, 26,155, 43,114,230,156,187,250, 8,119,182,111,178,126,225, 26,249,109, 80,170,
- 69,167,145, 48,205, 10,230,122,204,172, 60,102,179,251, 24,209,165,107, 79,176,254,232,117,246,111,191,129, 83, 13,238,190,242,
- 26,207,124,240,171,216,191,247,144,115, 23,183,184,254, 71, 62,200, 43,207,253, 14,105,156,242,246,198, 25,242,231,126,129, 87,
- 95,122,133,131,169,165,247,141,223,200,133,175,248, 26,202, 50, 34, 61,222,165,211,105, 48, 60, 60, 96,125,107,141,233,164,160,
-113,245, 49, 62,243, 59,159,228,209, 95,249,127,137,174, 60, 73,244, 61,223,204,237,223,253, 52, 73, 75,146, 52,219,228,101,193,
-252,232, 33, 81,179,199,157, 63,252, 2,231,174, 61, 73, 49, 31,241,240,230, 45, 54, 46,158,167,209,233,115,114,112, 68,145, 69,
- 88, 89, 82, 72,197,104, 92, 82,202,125, 86, 86,206,177,121,118,133,223,255,189, 63,228,111,254,228,143,243,182,175,251,246, 83,
-144,187,171,152,217,149,123,148, 41,194,132, 94, 65,109, 69,229,242, 81,121, 21,134,130,174,170,203,227,212,132,238,170,223, 41,
- 51,108,154, 83,206,199,228,163, 17,217,108,134,206,114,198,187,251, 60,245,157,127,124, 81,208,203, 33,228, 25,196,141,176,223,
-140, 60, 20, 47,138, 64,137, 29,195,141,215, 41,140,163,252,233,159,167,245,228,101,238,127,233, 85, 94, 59,153,115,251,246, 46,
-255,235,240, 54, 81,156,144,239, 63, 88, 16,115, 2,132, 36,157,195, 10,137,147,193, 15, 59,116,130,163, 89, 78,171,215,171,209,
- 75,233, 28,104, 11,145,103,229, 22,179,148,247,255,249, 31,224, 3,127,235,135, 25,126,249, 5,254,175,255,241,175,113, 51,181,
- 28, 25,195,224,179,159, 37,186,116, 9,138, 49,195,253, 61,140, 46, 72,154,109,172, 61, 65, 38, 13, 34,229,176, 69,134, 41,116,
- 40,220,213,231,170,161,212, 16, 71, 62, 47, 59,176,159,227,181, 30,174,116,180,214,123, 76,239, 60, 96,102, 44,115, 99,120,180,
- 21, 99,157, 36,213,154,150,148,104, 7, 67,109,112,113,196, 74,156,176,159,102, 92,217, 88,225,165, 95,249, 13,146, 94,139,110,
- 20, 49,214,150, 92, 57, 70,218,223,244,165,181, 52, 10,131,116, 18,148, 34, 66,208, 79, 18, 86, 26, 93,134,217,148,161,206, 73,
-173,245, 70, 45, 22,222,253, 77,239, 69, 31, 15, 80, 91, 21,252,106,125,252,104,168,188,214,148,184,135, 15, 16, 27,231,136,154,
- 45,254,202, 39,254, 13,127,231,155,190,151,235,171, 29,214, 58, 29, 86,218,109,134,217, 12, 1,236,165, 83, 54, 7, 59,196,113,
- 76,103,243, 28,178,209,160,177,190,193,151, 95,252, 77, 63,181, 85,192,248,178,189,230, 18, 78,236, 76,181,184,115, 11, 61,119,
- 48,119, 89,252,140, 11,123,210,255, 44,109, 21,107,189,143,181,179, 14, 25,203,122,130, 17,203, 58,246,112,216,185,101,131,152,
- 42,199, 71, 56,140, 94,154,128, 36, 20,243, 17, 74,152,224,209,190, 48,225, 48, 1, 10,117,214,161,167, 3,239,113, 45,150, 14,
-108, 83, 89,225, 46,217,193, 46, 75,245,170, 44, 14,107,130,115,218, 34,208, 67, 32, 72, 86,175, 16,119,206,145, 29,126, 9,167,
-103,117,250,156,172, 28,233,196,194,181, 78,212,112,237, 2,137,168, 10,189, 13,174, 58,145,148,245,122,193,215,106,189,208, 21,
-214,112,186,215,123,123, 40, 61, 15, 59,244, 42, 10, 76,159, 86, 44, 4, 36,207,185,210,103,173, 7, 85,140,168,173,128, 13, 34,
- 86,200, 82, 98,101, 28,144,192, 48, 89, 91,227,139, 71,236,139,135,138,171,253,120,112,190,179, 37, 50, 94, 4,185, 0, 72,171,
-125,166, 65, 21,227,171, 2, 82, 24,156,230,164,140,252, 36, 30, 71,254,186,137, 98, 47,101, 85, 73,237,238, 38,156,192,169, 24,
-178,140,124, 52,100,124,255, 54,229,244,132,134, 40, 56,251,236, 51,158, 29, 31,175,160, 26, 17,227,123,251,228,123, 15,209,243,
-130,226,104,175, 78,210,115,213,117,235, 76, 8,147,113,117,146, 90,125, 29,134,244,192, 40, 92,203, 53,209,210,248,162, 91, 41,
- 29, 85,197, 73, 10,176,188,177,118,201,133,206, 45,174,123,170, 70,216,157,138, 6,172,224,118, 92,152,202,151,236, 16, 22,222,
- 67, 11,248, 93, 27, 91,255,127, 17,248,144, 98,201, 82,182,234,170,189, 82, 35, 40, 26,196, 34, 89,144,192,236,183,121, 6,133,
- 37,105, 52, 49,197,140,184,189, 66,147, 38,197,124, 74, 57,154,179,254,244, 87,208,254, 98, 7,189,215,195,150, 57,236, 27,122,
- 61, 69,220, 48,152,202, 97, 81,251, 41,189,204, 2, 49,213, 9,138,212, 81,196,146, 21, 97,152,202,132,159,207,190,149,121,126,
-137,149,104,155, 94,167,141, 24,245, 25, 28,204, 17,141,146,102,175,197,228,160,164,223,145,152,163,146, 7,183, 14, 72, 75, 56,
-112, 3,134,147,130, 86,220,166,112, 26, 21, 9,122,226, 44,163, 50, 71, 88,131,204,115,199, 23, 62,241, 9,110,124,230, 51, 76,
- 14,118, 16,162, 96,188,115, 15,231, 36,103,175, 63,195,254,221,135, 60,245,177,143,240,149, 77,203,171,255,240, 31,242, 7,251,
- 19,220,135,191,149,179, 63,240,231,217,122,215, 7,153, 31, 30, 51,188,247, 42, 78,151, 20,165, 37,138, 91, 88,217, 4, 25, 49,
-220,222,102,229,226, 85,142,254,252, 95, 38,251,210, 23,225,183, 62,133,232,173,145,207, 14, 17, 81,140, 53,138,246,202, 22, 73,
-179,197,206,253, 61, 76, 62,197,148, 26, 21, 21, 28, 61,188,237,153,162,113,204,206,253,187,158, 41, 42, 21,187,131, 41,206, 26,
-166,179, 57,247,239,220,227,175,255,196, 63, 56, 85,208,235,189, 90,237,250,107, 66,225,142,253,127,213,212,238, 22, 68, 30,170,
-124, 99, 89,217,169,198, 75,251,185,165,130,174, 51,138,195, 61,102,135,123, 12,183,183,153, 15,135,216,162,100, 62, 25,179,245,
-246,119, 18, 53, 90, 30,114, 47,134, 48, 29, 67, 81, 4, 19,133, 70,176,148,157, 46,158,243,222, 13,116,102,152,255,244, 79,211,
-184,116,142,193,107,247,184, 59, 76,121,120,123,151,255,110,116,151, 40, 73, 48,243,153,159, 32, 2, 91,155, 40, 70, 68, 18, 39,
-131,195,221, 18, 14,170,243, 18, 61, 56, 98,250,228,123,144,211, 9, 78,151,120,106,159,243,110, 99, 97,129, 85, 74,199,116,127,
-143,185,106,243, 87,127,229, 23,121,186, 37,152,118, 59,252,189, 31,253, 9,214, 46, 61, 10,186,192, 26, 71,103,125,213,103, 64,
-231, 37,173,254, 10, 82, 79,177, 89, 73, 89, 20,148,185,198,164, 57,170,213,129, 60, 95, 72,218,132,223,249,137,102, 3,217,235,
-163,250, 61,244, 96,196, 78,154,241,198,112,198,217, 78,194, 73,110, 56,201, 11,134,165,225, 97, 81,114,172, 53, 7, 90,179,175,
- 45,163, 60, 39,199,241, 70,154,113,229,169,199,200,157, 99, 98, 44, 78, 64,110, 29,169,117,204,140, 69, 59,193,106,220,224,106,
-183,207,149,238, 26,119,230, 83,218, 42, 38,211,154,113, 81, 50, 42, 75, 86,163,132,110,146,144, 22, 5,107, 23,207, 98,103, 41,
- 20,165,135,220,195,212, 43, 2,156, 27, 69,138,114,251, 30,236,111, 3,240,216, 31,251, 14,254,233,209, 3,222,247,109,223, 68,
-223, 56,218,165, 37,154,149,184,113, 70,156, 90,116,225, 16,153, 65, 21,150, 70,183, 3,243,130,243,127,238, 47,122,201, 92,181,
- 23,117, 75,218,219,170,160, 90,183, 32,245, 84,225, 17,225,132,172, 6,164,138,180,179,144,143, 45, 14,217, 26, 68, 90, 98,182,
- 87,174, 95,206, 45,195,148,139, 6, 65, 4, 75, 90,177,228,209, 45, 68, 21,221, 89,101,192,155, 48, 25,157,246,112,168, 38,127,
- 63, 57,229,161, 88,185,165, 44,117,175, 93,183,122,241,252, 53, 81,174,154,188,148, 96,177, 0, 93,138,104, 21, 2, 91,102, 20,
-179,135, 88,147, 5,151,178, 5,172, 47,165, 92, 50, 41, 9,166, 38,132,105, 95,219,186,105,112, 97,167, 90,229,216, 99, 12, 14,
-139, 30,222,247, 38, 38,182,130,210, 61,193,172,142,235,115, 58,164,178,121,207,119,191, 7,177, 11,202,180, 11, 77,129, 13, 76,
-232, 64,128, 18,213,148,143,171,247,243, 54,188, 24, 83,204,195,227,134,247,173, 68, 77,188, 21, 81,236, 7, 11,103,131, 10, 64,
- 34, 85, 99,209,185,201,168,230, 33, 84, 48, 58, 72, 68,220,244,197, 59, 10, 25,235,177, 87,225, 40, 21,123, 59, 88, 21,251,239,
- 82,121,120,222,225,124,240, 71,153,162,103, 51,230,131, 3,210,147, 67, 54, 46,109,210, 62,115, 14, 23,121,147,165,217,241, 33,
-243,219, 55,153,220,124,145,242,228,152,114, 60,193,230,153,191, 76,173, 91,242,106,115,181, 77,176,245,195, 60,165,117,104,187,
-200,181,215, 14,202, 80, 76,171, 72,225, 16,219,224, 77, 86, 74,187,152,154, 43, 55, 68, 23,108,147,195,189, 96, 43, 20,164, 34,
-188, 73, 78,121,196,187,165,101,126,229,117, 96,157, 55,137,178, 46,252, 23,158, 88, 84,247,151, 89,250,123,136, 62,174,238, 35,
- 83, 25,217,132,235,198, 45,201, 64,133,115,216, 60, 69, 8, 75,212,108, 49, 61,153, 34, 98,139, 41,189,226,163,187,185,193,209,
-253, 67,210,254,117,138, 61,135, 62, 82,148, 99,139,217,139,104, 70, 18, 51, 17,216, 20,204, 56,132, 17, 42, 71,150, 57,138,194,
- 97, 21, 36,218,242,235,246, 3,252,204,236, 59,176,162,164,231,246,184,212,123,140, 89,225,249, 58,211, 60,197, 24,195,254,158,
- 65, 27, 9,165,247, 33, 24, 14, 51,166, 19,205,254, 65,138,138,161, 21, 75,110, 28,190,196,195,201, 29, 70,122,202,133,238, 89,
- 82, 61, 34,154, 14,142, 56,119, 97,131, 71, 63,250,205,152,116,226, 13, 73, 38, 99,242,163,251,236,140,199,188,229, 43,159, 97,
-246,179, 63,206,239,254,246, 23, 89,249,214,111, 33,215,150,220, 20,216,189, 59,176,118,201, 67,145,214,144,143, 7,204,142,119,
-233,172,175,177,251,198,235, 12,119,239,179,126,238, 12,142, 24,179, 95,146,254,233,239,101,246,119,255, 41,238, 47,252, 0,101,
-233,176,165, 38, 73,154, 62,143,216, 10,206, 94,186,204,157, 23, 95,224,194,147,207, 18,119, 26, 28,223,124,200,163,207,172, 48,
- 25,231,164, 69, 70,170, 61,203,252,120, 92,112,165,212,108, 31, 30,113,237,233,183,241,206,175,255, 78,156, 43, 16, 34, 57,253,
-229,139,210, 51,179,133,162, 22,132, 58,177,216,153, 85, 84, 93, 91,165, 67, 68, 32, 34,196, 41,233, 75,245, 39,135,116, 74,113,
- 50, 32,155, 76, 40,103, 25,174,208,100,227, 49,243,188, 96, 54, 56,225,169,111,249,227,158, 76,147, 30,194,201,145,127,220, 78,
- 27,162, 38, 2,133, 51, 71,190,248, 37, 61, 24,110,227,238, 60, 36,189,255,144,228,228,132,172,209,224, 15, 31, 28,240,198,253,
- 67,254,196, 75,191, 67,210,106,163,167,147, 5,110, 36, 36, 82,200, 96,212,228,189,146,173,211,254,159,140,163,217,237,208, 72,
- 34,244,172,205,254,116,198, 90,184,249, 85, 98,136,227,188,150,193,171, 56, 70,117,187,232,241,148, 86,191,199,235,183,238,242,
-183,255,253,207,242,125, 31,250, 94,110, 76, 44,131,135,247, 88,123,252,154,247, 53,207, 11,134,249, 1, 18,104,118, 87,136,220,
- 14, 38, 43, 40,231, 5,198,106,132, 41,144,205, 38, 20, 33,161, 77,137, 5,251,182,219,242,198, 29, 77, 69,212,110,112,245,220,
- 58,147,135, 71,124,234,112,124,202,148,101, 25,118,211, 97, 74,107, 4,206,192,157,251, 59,196, 81, 68,137, 35, 15,185,226, 74,
- 10, 46,198, 77,180,133, 39,251,155, 28,101, 51, 30, 76,134,204, 49, 52,149,162,163, 18,154, 81,132,212,154,189,188,160, 27, 41,
- 30,187,118, 30,185,178,234, 15,218, 72,249,168, 76, 25, 33,172,241,121,226,218, 32,210,194,195,142,111,220,192, 53, 18, 88,221,
- 34, 94, 63,195, 87,255,204, 47,224,246,246, 96,120,130,213,101, 96,107,135, 9, 41,137,188, 0, 53, 78,176,206,177,213,237,157,
-214,203,214,210,111,199, 82,234, 69,125,176,185, 55,193,239, 34, 16,133,234,157,119, 40,196,146,101,159, 23,183,208,146, 59,177,
- 20,238,178, 84,208,101,216, 87,214, 10,141, 69,241,173,246,148, 66, 46, 69,105, 86, 63, 90,113, 80,224,148,118, 93, 10,150,246,
-141, 11,159, 17,177,212,180,136, 72, 44,189, 7,111, 3, 90,219,120, 7, 89, 18,129,229, 46,234,180, 56,131,158, 62, 12,108,110,
-183,240,248,182,224,162,197, 69, 82,155,240, 24, 91, 39,122, 85,169,109,213,155,151,145,168,173, 71,145, 18, 21, 26, 94, 87, 69,
-173,170,224,247, 94,145,238,170, 47, 71,186,176,134, 51, 11,200,164,134,117,151, 36,173, 38,156, 17,200,154, 14,230,172, 9, 89,
-240, 30,249,177, 70,163,148,194,226,157,222,164,140, 48, 69,225, 93,241,150,209, 62, 23, 54,205, 81, 28, 32,238,200, 55, 44,198,
-248,181, 80, 80,128, 8, 21,123,227, 24, 41,145, 66, 5,232, 93, 32,226, 24,169,188,107,156,138,226,176, 67,151,254,123, 87,177,
- 47,144,133,166,152,140,201,198, 3,138,233,132,200,229,180,250, 43,136, 56,193,210, 66,207,198, 76,111,190,196,252,246, 29,242,
-221,123,148,211, 25,198, 58, 92, 94,134,107,204, 83, 39,117,224,124, 88,231,208,222,125,130,200,128, 97, 97, 68,148,227,136,131,
-198, 60, 51,126,116, 81,161,105,118, 54, 0,120,206,219, 27, 83,179,221,253, 4, 91, 27,208,212,158, 13, 11,210,114, 69,130,171,
-214, 54, 98,121,183,238, 22,236,247,106, 5, 83,223,111,102, 49,145,187, 37,102,124,245,249, 87, 54,180,111,246, 89,168,155,230,
- 74,138, 23, 9,202,116, 68,210,117, 36,205, 30,182,144,180,207,173, 32,163,136,131,123,187,204, 70, 95,226,222,234,159,230,202,
-244, 31,211,109,207, 73,167,138, 50,135,142,141, 56,153, 25,116,100, 60, 63, 33, 5,237,252,103, 41,173, 64, 72,203,111,159,249,
- 17, 46,232,148,193,254,171, 92,232, 93,227,100, 54,231, 36,155,178,213,238, 34,109,196,246,104,159,102,210,102,163,233, 61, 80,
- 84,226,144, 22,218,205, 38, 77, 90,200,100,204,209,120,128, 18, 9,177,106,146,235, 57,171,205,156, 76,107,148,108, 32,147,102,
-131, 52, 53,220,121,225,121,222,120,241, 85,238,191,250, 26,123,119, 31,144,166, 37,111,253,240,123, 56,248,223,254, 6, 47,127,
-233, 53, 58, 31,253,102,102, 81, 11,155,206,201, 78,118,232,174,156,225,232,254, 13,156, 43,152, 13, 15,152, 79, 14, 88,189,112,
- 9,169,154,148, 90,211, 93,221, 4, 23, 81,228,115,230,179, 41,114,255,144,213,159,248, 81,230,255,228,103,105, 94,184, 70, 62,
-159,130,181,140, 7, 7,168, 40, 97,227,252, 25,186,155,107,140,142, 15, 72, 84,139,254,217,117, 70,251,123, 56, 96,109,173, 67,
- 44, 12,115,157,179,218,111, 32, 68, 76,123,101,149,191,244, 79,126, 14,107,211, 37,169, 88,229, 6,164,125, 65,175,181, 66,225,
-104, 20,122, 41,120,164,172,195, 3, 60,254, 18, 5,136,220, 45,177, 45, 45,206,206,160,152,163,231,115,242,241,132,114, 54,103,
-126,114,204,244,100, 72, 94,148,204, 15, 15,121,215, 31,255, 51,254,177,230,187,176,183, 7,243,212,119,232, 73, 12,244,112,118,
- 2, 69, 26,240,160, 28,182,239,147,151, 80,254,210, 47, 67,191,199,203, 95,190,199, 40,203,120,255,223,252,115,172,190,245, 43,
-209,243,233, 2,116, 13,204, 98, 91,225, 72, 21, 68, 21,188,151, 91,171, 43,188,248,220,115,124,245, 71,254, 18, 95,251, 93,255,
- 19,179,193, 9,244, 86,113,210,161,164, 34, 78, 34,175, 21, 77, 98, 84,156, 96,180,195, 88, 31,123,185,178,210,229,249,219, 67,
-126,232,219,222, 71,137,224,227,255,226, 95,163, 58,125, 84,148,160,117,137, 46, 75,162, 86, 15,213,106, 64, 49,195,100, 37,233,
-120, 78, 49,247,118,178, 34,105,122, 52, 66,235,133, 91,172, 84,200, 86,203,147, 65,210,156,168,239, 37,131, 23, 90, 13,122,177,
-242, 61,212, 18,196, 40, 68,165, 13, 16, 20,118,161,123, 86, 81, 84, 45, 80,124,207, 16,138,213, 73, 89, 48,178, 57,191,127,176,
-205, 75,163, 1,251, 58,231,184, 44, 56,202,114,146,176,131, 44,177, 88, 9,145,118,188,235,123,190, 5, 45, 21,162,223, 71, 8,
- 79, 44,242, 46, 89, 6, 49,155, 35,210,153,159, 10,138, 2, 59, 25,193,246, 61, 24, 28,122, 95,122,103,224,236, 89, 56,119, 6,
-217,111, 19,157, 59,131, 58,179,137,220, 88,133,126, 31, 26, 13,232,118,145, 43,171,168,102,155,111,248,131,111,242,237,196, 0,
- 0, 32, 0, 73, 68, 65, 84, 33,155,239,251,112, 96,250,138, 37,237,197,178, 4,200,249, 3,116,217, 44, 99,121,106, 95,134,205,
- 43,121,142,228,212,142,218, 46, 77, 34,203,116,221,186,248,202, 37,153,206,114, 7,181,120, 9,117,225, 22,203,108,120, 81, 41,
- 56,151, 80,170,165,223,115,246,180, 73, 88,253,218,173,245,211,141, 91,144,142,107,157,156, 76,144,255, 63, 93,111, 30, 37, 89,
-118,215,119,126,238,189,239,189,216, 51,114,173,172,234,170,234,234, 77,106,169,105,181, 22,104, 75, 72, 72, 66,128, 5, 6,219,
-224, 1, 45, 72, 24,121, 60,172,246, 0,182,135,193,216,230, 48, 11, 94,176,199, 11, 54, 48,246, 88,216, 99,123, 12,104,192, 30,
-140,125, 96, 0, 33, 22,129, 16, 13,162, 37,181,122,175,174, 53, 43, 43,247,216,227,173,119,153, 63,238,125, 17, 81, 61,166,207,
-233,211, 75,101, 85, 84,101,188,184,247,183,124,191,159,111, 99,109, 49,178,240,227,212, 37,114,207, 89,235,119,155,245,239, 33,
- 48,205, 23, 65, 48,178, 78,129, 99,177,222,169,187, 53,161,150,220, 61, 23, 38, 1, 98, 33,206,115,216,217,204, 23,235,193,234,
-134, 82,139,156,248, 69,155, 86, 7,115, 47,140,206, 53,236,101,121, 62,184, 69, 82, 72,232,212,173,198,133,243, 99,233,173, 87,
-161,115, 14,197, 80, 28,213,187,135, 16, 33,106,254, 43,205,130,197, 86, 19, 31,169,170,181, 95, 81, 72,225, 11,227,184,225,153,
-237,210, 51, 31, 68, 32,197,169, 40,241, 63,150, 52, 17, 42, 66, 68, 13,144, 49, 66,198, 33, 29,205, 97,116,201,236,238, 30,211,
-187,183,145,213,140, 86, 2, 81,183,227,135, 22,105,202,240,217,223, 39,125,229, 11,164, 55,159, 65,159, 29, 97, 42,131,115, 2,
-227,108,208, 13,121,175,120,169,125, 71,174, 29, 84,193, 21,154, 89, 71,110, 44,153,131,153,241,248,216,153, 49,140, 52, 76,181,
- 35, 55,190, 56,205, 42, 71,105,253, 25,229,132,160, 48, 33,139,209,201,133,162,221,217,208, 93,215, 22,182,176,186, 16,225,124,
- 19,193, 62,103, 3,111,222, 90,135,113,206,115, 14,194,103, 64,155, 21,116,109, 93, 40,175, 6, 2,185,165, 47,125, 1, 51, 10,
-239,167, 93,164, 25, 46, 3, 94,252,151,249,103,232,228,133, 87,152, 29, 77,112, 34,166,187,211,161, 42, 11,102,147, 1,219, 15,
- 94, 64, 79, 83,102,233, 69, 94,236,253,115,126,254,185,239, 34, 31,119,104,152,130, 68,196,180,144, 20,195,136,116,232,161, 51,
- 14, 40,140, 36,146,134, 95,144,223, 74,115,126,157, 52, 45, 56,215,189,140,209,130, 78,187, 75,171,211,224,206,224,140,145,153,
-210, 80, 13,154,162, 69,183, 39, 25,100, 99, 78,134, 99, 54,122,231,124,200, 13,142,193, 36,103, 82,140, 24, 22, 35, 98,169, 72,
-162, 22,115, 93, 81,153,146,194,102,200,108, 50, 67, 74,152, 13,142,153, 28,239,115,238,210,121,154,173, 54, 79,252,233,175,228,
-248,123,190,139,253, 70,151,249,229,215, 51, 23, 5,170, 42,184,240,192, 21,186, 59, 15,145,229,154,249,228,152, 70,187,205,100,
- 56, 97,118, 54, 97,255,217, 79, 34,147, 22,107, 27,155,172,157,219, 69, 91, 75, 20,197,244, 54,183,233,108,159,103,120, 60, 97,
-253,235,223,206,244,149,151,176,182, 66, 59,139,206, 11,210,201, 8, 21, 9, 58,253, 11, 8, 17,115,188,119,155,254,230, 54, 85,
- 41,176,101, 73,187,155,112,249,202,101, 30, 58,183, 69,167,221, 97, 56,154,241,247,126,225,183,125,154,142, 32,248,190, 87, 78,
- 46, 91, 45,241,149, 50,136,162,156, 89, 98,140,116,232, 46,117, 16,202, 41,229,211,208, 22,135, 91, 77,122,203,124,112, 75,158,
- 81,140,134, 20, 89,202,124, 48, 66, 27,139, 54,154, 50, 77,233, 93,126,128, 70,103, 13,167, 15,225,246,109, 63,118,215,149, 31,
-187,199, 1,106, 81,141,234, 86, 25, 6,119,177,251, 71,100, 55,110, 16,151, 37,119,174,221,225, 8, 56, 43, 43,222,252,119,126,
- 18, 61,217, 91,185, 10, 22,143,120, 16,162,185,133, 15,185, 70, 40,166, 39, 71,124,203,255,244,179,188,227, 29,239,229,253, 95,
-247, 97,222,254,237,127, 23,217,235,226,170,202,163, 34,163,216, 83,168,156,247,243,175,111,111,176,185,185, 73,187,215, 71,107,
-139, 46, 50, 30,122,255, 55,211,199,241,107,159,123, 14, 98, 69,149,165,139,244,171, 40,110,121, 26, 95,145, 98,117,201,104, 56,
- 69,151, 94,131,110,198, 3,116, 16,199, 17, 70,157,178,209,196,197, 49,214, 25,156, 46, 97,125,147,217,217,132,212,216,197,200,
- 77, 59,139,113,222, 36, 84,177,224, 71,160,195, 30,215,214,106,113,159,168, 78,163, 78, 88, 66,144, 58,139, 14,190, 2, 33, 4,
- 70, 56, 26, 82,209, 75, 98, 42,107,209, 66,114, 50,159,115,174,211,226, 27,255,183,191, 78,213,136,137,250,235, 68,253, 13,228,
-122,215, 95, 16,217, 12,178, 20, 97, 28, 66,123,176,136,108, 68, 94,252,166, 20, 20, 51, 24,159, 66, 58,129,217,153,143,123,189,
-255, 17,216,217,133,254, 58,116,187,208,108,222, 51, 86,174, 73, 88, 95,242,147,255, 33, 92, 30, 43,221,195, 61,166,222,101, 72,
-133, 91, 90,127, 23,113,169, 43, 32,212, 37, 96,198, 44,213,191,222,114, 38,238,217, 45,215, 60,108, 27,118,201,190,203, 95,130,
-105,220,202, 11,249,213, 67,144, 67,132,200,209,186, 59,175,147,173, 22, 95, 47, 91, 72, 17,175,208,191,220,171,126,159, 43,222,
-229,250, 64,174,151,174,198,119,191, 73,239, 2,113,239, 60, 46, 92,164,181,103,216, 11,255,150,234,118, 81,143,109,130, 58,206,
- 89,235,213,244,206,135, 7, 57,233,150,118,105, 89,179,191,221,114,173, 33,237, 61,138, 41,151, 79,188, 40, 79, 36,203, 66,190,
- 30, 21, 44, 61,112,161,138,176, 43, 70,253, 32,124,112,225, 89,168, 75,203,197,239, 13,255, 92,219, 16, 22, 35,213, 10, 80, 42,
-200,185, 84,248,181,149,100, 69,121,232, 39, 69,216, 96,237,242,147, 9, 81, 39,149,169, 16,203, 41,149,199,190,170, 8,169, 66,
-218, 90,236,121, 15,170,209,242,209,170,113,130,140,252, 88,222, 23,102, 14,153, 52,125,103,170, 13,122, 54,103,122,116,151, 98,
-116, 68,171,225,216,121,232, 50, 81, 18, 97,116,196,228,250, 51, 76,127,247,183, 72,175, 94,167, 56, 58,161, 74, 51,180,214, 94,
- 31, 96,125,129,141,133,204, 56,180,129,202, 89,114, 39, 40,181, 35,119, 48, 46, 44,163, 82,144,250, 33, 23,103,133,101,160, 35,
-230,218, 39,213, 74,231, 24,229,134,212, 90, 52,160,141, 99, 86, 90, 74, 43,168,140, 69, 56, 67,165,125,204,242, 98,228,237,238,
-205, 66,192,248,149,161,199, 75, 4, 5,123,229, 22,105,135,216,149,245,149, 91,137,231,168,137,222,193,223,142, 93, 89,117,213,
- 63, 47, 4, 27,213,150, 58,159,107,224,252, 57, 22,124,242, 14,137,209, 16, 87, 16,199,130,181, 11, 93,170, 50, 99,116,109, 64,
-146, 52, 40,166,115, 26,155,231,201, 38, 99,154,106, 78, 71, 74,126,121,240, 67,252,206,254, 59,233,183,115,154,145,162,165, 36,
-177,147,100, 90, 98,157,163, 43, 43,126,197,189,143,158,201, 25, 78,115, 14, 50, 79, 84, 93,235, 53,144,192,124, 58,163,172, 50,
-250,170,131, 16,146, 97,126,202,209,208, 7, 95, 13,203, 51,110, 14,175, 17,183, 45, 81, 35,103, 61,217, 33, 51, 37,218, 85, 68,
-170, 65, 67, 53, 40,203,148, 65, 53,164, 23,109, 17,201, 40, 38,157,150,116,155,130,164,177, 1, 68,180,238,219, 70,125,226, 23,
- 56,185,120,145,193, 76,240,150,111,122, 31,179,227, 99, 78, 14,238,112,124,247,128, 40,150,168,164,143,214, 17,101,122,194,229,
- 71,223, 68, 58, 59, 69,207, 15,200, 38,199, 56, 39,152, 15,207,152,143, 79,112,186, 64, 53,123,180, 90, 45,140,145,240,240,235,
- 72, 38, 39,148,198,210, 74, 34, 82, 33,169,170,156,227, 59, 55,217,185,255, 81,210,193, 85,122,231, 47, 50, 60, 58, 36,238,118,
-184,254,252, 13,156, 48,108,239,236,240,123,207,222, 97,255,112,159, 79,223, 61, 9,159,201,114, 65,102, 91, 50,221,115,127, 89,
- 71,201,146, 61,185, 24,213,213, 59, 65,185, 28,199, 69, 75,124,228,226,160,196,128,205,112,197, 28,167, 13,243,131, 3,178,209,
-144,114,158,146,167,115,102,195, 49,218, 88,198, 39, 39,188,247, 91,190, 3,231, 70,176,119,155,242,244,152,168,211,241, 85,186,
- 16,144,172,129, 29,251, 79,138, 12,246,149,189,219,148,165, 65,255,250,199,145, 73,204,254,112,198,254,157, 19,190,237,214,139,
-216,236,208, 95,252,149,246, 73, 65,118, 5, 34,142,103, 76,251, 7,212,248, 17, 81,172,248,220,167, 62, 71,178,213, 99,167,183,
-207, 63,250, 55,255,132,191,248,190,191,192,207,253,210, 39,249,240, 87,191,131, 60, 77,137, 34,229, 43,197,188, 32,105,183,120,
-211,123, 62, 64,236, 26,124,237,155, 46,243, 3,127,243,123, 41,175,221,100,214, 59, 71,188,209,229,214,254, 25,122, 58,163,156,
-142, 65, 91,180,174,144,194,231, 50,187,116,142, 78,115,210, 73,138,164, 98,243,220, 54, 78,231,126,127, 7, 8,163, 49, 54,120,
-193,133,196, 26, 48,243, 12,241,200,253, 76,178,140,125, 3,153, 3, 77, 64, 71, 90,238,217,117,173, 30,141, 46, 28,168,149,214,
-139,145,180, 14, 51,178,134,144,232, 32, 90,110,202,152,150,148, 16, 43,186, 81,194,104, 58,103,110, 45, 31,248,240, 55,240,200,
- 87,124, 57,217,224,148,168,217, 36,238,118,161,221, 66,198, 13, 95,112, 69,145, 95, 27, 56,139,104, 37,190, 27, 82,254,240,164,
-202,160, 12, 8,224, 60,245,207,202,100,128,171, 12,244,214,161,179,238,163,107,165,128, 42, 95, 90,100, 16, 94, 8,133,227,161,
-143,124, 47,215,254,245,143, 45, 81,154, 11,192, 76,189,196, 91,250,114,107,134,110,221,217,215, 98, 54,108,216,103,202, 90,231,
- 85, 91,204,194, 35, 17,116,138, 94, 30,237, 22, 35,239,122,108,191, 8,115,177, 75,184,199, 98,151, 29, 88,219, 50,144,186,144,
- 75,116,113,221, 5,251,164, 55,139, 53,101, 40, 20,150,247,160,170,253,188,171, 25, 10, 74, 44,212,231, 70, 59, 84,228, 95,212,
-148, 83,116,122,138,208, 85,240, 90, 47,119,231,206, 2, 81,195,167,104,185,124,197, 10, 96,131, 8, 80,172, 68,121,174,120,137,
- 87,192, 57, 78,248, 46, 79, 70, 50,176,227,125,177,203,112,184, 68,196,214,137, 47,194, 6,229, 90, 30, 46,251, 87, 45, 83,169,
-131, 95,130, 66,126,209,185,135, 51, 68,151,158, 70,104,204,194,130,230,172,246, 98, 55,235, 47,250, 69, 71,238,252,196,193,217,
-202,211, 42, 77,137,160, 25,146, 9, 45, 18,231, 51, 0,162, 40, 4,150,196,200, 72, 98,141,244,190,245, 40,246, 83, 6, 25,194,
- 69,164, 31,187, 35, 37, 50,110, 46,118, 46, 34,124,222,106,237,133, 46, 50,138,201, 25, 39, 47, 60, 67, 54, 60,230,202,123,191,
-148,245, 7, 46, 99,136, 81, 89,206,217,111,254, 58,233,221, 67, 42, 43, 48,165,166,168, 12, 6, 71, 4,164,198, 63,115, 26,239,
- 28,201, 67, 23,108,156,163,114,130, 76,107,166, 70, 18,227,104, 57,199,160,242,160,160, 68, 58, 26,194,161,132, 99,162, 29,218,
- 65, 59, 86, 72,231, 72,129, 36,146,180,140,246,207,180,132, 56, 76,114,106, 0, 82,141, 64, 86, 11,221, 66,248,118, 91,139, 18,
- 98,225, 2,113,206, 46,179, 98,220,210, 9, 97,141, 11,104,124,183,120,254,234,134,221,216,101, 84,172, 39,200, 89,191,158,145,
- 75, 7, 7, 43,209,189,117, 2,157, 0,230, 7,175,208,126,243, 59, 57,189, 53, 32,150, 29,218,235,125,162,110,204,252,100,196,
-133,203,151, 41,244,140,195,235,123,184,246, 38,151,214,166,220,189,246,165,252,235,171,175,225,235,207,253, 91, 92,101,144,153,
- 47, 46,158,173,214,120,165,241, 77,116,149, 36,161,100, 54, 29,224,162, 38,182,178,156,142,231,104,235,208,206,209,137, 55, 41,
-141, 38,145, 45,182,251,231,184, 59,191, 78, 85,105,148,104, 16,203,132,163,201, 17, 45,149,176,182,158,208,155,110,210,105,182,
-209,182,192, 10, 69,166, 51,242,106, 70,149, 84, 68,186, 42,137, 99,191,227,216,186,124,137,171,207, 93,229, 29,253, 51,110,124,
-246, 5,246,174, 29,242,224, 95,248, 46,110,124,246, 25,140, 51,148,233,140,116, 62,198, 84, 51,182,207, 53,104,174,157, 99, 62,
- 56,161,187,187,137, 74, 58, 76, 6,138,102,145, 83, 25,131,140,155,172,237, 92,100, 58, 60,165, 44,114,182, 46, 92,225,232,230,
-117,100, 35,194, 9,133,208, 37,185,153, 17, 53,122, 76,142,239, 32, 68,139, 59, 47,127,134,118,255, 28, 2, 71, 85, 85, 52, 58,
- 27,108,157,219,224,183,159,122,158,183,175,175,113,251,248,140,127,252,209,127, 65,220,238, 7, 24,132, 12,187,244, 90, 41, 91,
-121,170,153, 82,161, 67,183, 43,192,236,101,202,143, 87,185, 74, 79,151, 66,222,211,165, 47, 12,209,186,192,230, 5,249,104, 64,
- 62,155, 80,165, 25,233,120,138,214, 21, 42, 74,184,251,202, 75,124,205, 15,253,109, 28, 41, 76, 78, 73,159,125,137, 10, 67,167,
-217,240,218,151, 94,207,131,102,202, 65,120,189, 4, 70,199,216,147, 33,249, 96, 76,124,116,202, 81, 90, 48,140, 21,235,143, 61,
- 68,231,226, 67,152,217,221, 48,254, 90,218, 70,132, 88,142, 27,151, 29,186,197,104,223,229, 68, 18,156,182,124,230,153, 47, 48,
- 41, 74,126,227,227,191, 64,245,166, 47,230,207, 55, 19,136,114,100, 35,241, 29,163,112, 24, 33,121,203,155,223,198, 27,206, 93,
-228,115, 55,134,252,201,247,255, 85, 62,241, 31,127,130,155,215,110,241,208,151, 60,198, 51, 31,255, 3,102,227, 51, 76,165,177,
-101, 69, 57,155,145,172,111,250,103,190,200,189, 24,207, 56,138,193,152,246,187,222,136,158, 77,137,218, 29, 68,164, 48, 69, 30,
-196, 72,145,247,126, 23, 62, 64,166,121,223,121,118,118,182,152,141,166, 20,186, 68, 91, 77,110, 5,107,210,167,140, 13,131, 26,
- 86,134, 4, 57, 39, 4,133,214, 92,220,236,115,245,120, 64, 34, 34, 76, 29,244, 1, 52,164, 36,145, 18, 45,252,184,112, 52, 43,
-152, 59,205,195, 23,206,241,238,111,255, 70,174,188,253,237,148,227, 17, 69, 54, 69, 52, 19,212, 90, 15, 90, 13, 84, 28, 35,156,
-197, 89,131,203, 52,162,209,244,223,208,178, 66,226,173,104,228,133, 95,157,184,145,239,196, 27, 45,207,250,143,154, 32, 13,228,
- 83,200,231,222,223, 28, 41,104,173, 65,171,227,133, 84,245,144, 72,107,238,127,223,183,115,253,255,252,177,149,144, 22,127,128,
-219,250,253, 12,150,183,122, 55, 94, 11,235,164, 88, 38, 8,212,135, 77,157, 59,110,107, 85,121, 16,191, 9,185, 20,163,201, 85,
- 79,124,109,125, 91, 85,195,175,136,239,236,170, 82, 94,213, 69,111,200,182,119,122, 69,169,111,125, 38,130, 91,209,143,213, 19,
-137,208,169,203,240,226, 14,159, 82,230,240, 73, 92, 11,166,183,113,184,108,176, 56,165,197,202, 30,211,135,179, 68, 52,187, 23,
-177,213, 4, 83,100, 11,251,218, 66, 3, 16,246,243,224, 16,166,214, 28, 56, 95,208, 32, 16, 81, 40,124,165,247, 64, 91, 43, 80,
-202,249,125,181,179,168,110,127,105, 75,195,132,253,121,181, 92,199, 57,179,244,191, 59, 29,196,180, 44,213,242,248, 24, 98, 84,
- 12,104,172, 41, 80,180,177, 43,251,124, 17, 10, 3, 41,193, 56,187,248,222, 58,194,254,220, 89, 48,213, 2,217, 42,163,196, 39,
- 44, 74,223,133, 99,212, 82,120, 79,132,140, 37, 66,196,136,164, 17,166, 45,126,159, 46, 98, 5, 81,228,105,123, 81,178, 16,215,
- 9, 17,138, 31, 7, 46,207, 40,135,103,100,131, 83,142,174,223, 96,107,163, 69,123,107,195, 23,156, 70, 50,120,234, 87,201,142,
- 78,200,210, 28,129,196, 58, 75,101,172,119,210, 56,199,180, 50, 62, 6, 55,140,219,199,149, 35,150, 10,227,252,106,236,160,240,
-151, 99, 39,130,125,173,252, 36,214, 25, 58, 18,180,115, 52, 66, 97,186,214,140, 73,181, 37,195,227,109,219,214, 96,176,254,162,
- 87,146, 50,168,230, 5,203,124,131, 26,166,228,140, 67,135, 9, 83,141,140,173,173,110,198,172,248,211,196,146,192, 88, 63,235,
- 11,142, 83, 16,126,152, 48, 25, 92, 21, 96, 10, 88,132,105, 81,107,117,130,192,112,193, 33,139,252,123,155,157,190,130, 27,188,
-145,214, 90,139, 42,183,100,243,156,236,176, 96,125,119,131,168, 39,153,239, 23, 92,127,110,143,118,187, 75,243, 74,204,100,146,
-243,230,119, 62,206,175,126,246,239,115,107,246, 18,167,233,103,201,229, 38,136, 14,102,118,141,203,151, 31,166,105,251,164,185,
- 38,165,192, 10,135, 84, 77, 58,145,196, 25, 73,110, 11,122,241, 58,169, 59,230,206,120,192,176, 60,193, 57,199,249,238,195, 40,
- 20,174,204,233,237,182,120,241,246, 11, 24,167,104, 42,112, 82,163, 92,143, 68, 68,100,206,145,149, 19,164,148,146,233,240,148,
-115, 15, 60,200,217,222, 1,143,188,229,181,156,252,231, 95,227,206,167,191, 64,245,192,163, 84,211, 33,163,211, 35, 48, 51,156,
-148, 68, 78,145, 52,186,148, 85, 70,163, 41, 49, 52, 24,223,221,103,116,188, 71,164, 4, 85, 85, 49, 31,157, 16, 9, 65,153,166,
-224, 44,189,126,143,241,217,152,162,156, 19,197,146,181,254, 14,103,135,135, 52, 58, 29, 58,107, 91,148,186,201,246,197, 93, 30,
-121,226,237,236, 94,126,136,233,112,200,185, 43, 87,176,214,209,221,218,100,107,103,155, 95,253,244,139,124,239,119,188,143,247,
-188,239, 47,134, 29,151, 14,116,182,149,238,206,133,157,185,138, 87,148,239, 53,187, 56,252,152, 11, 94,213, 56, 89, 26, 96, 87,
-137, 84,162, 2, 93, 97,117, 73, 62, 26, 80, 76, 39,164,103, 3, 38,131, 33, 70,107,170, 34,231,116,111,143,139, 79,188,145,184,
-145,224,138, 1,246,197,151,185,123,227, 22, 74,134,200,192, 40,134,230, 58,184,233,130,178,134,173,224,206, 30, 58, 47, 40,158,
-249, 60, 69, 89,241,242,201,136, 23, 94, 57,228,131,191,249, 27,152,244,174,183,182,216, 21,174, 50, 94,212,181,200, 24,118,190,
- 19,176,206, 51,201,103,227, 41,175,123,219,147, 28,157, 78,121,236, 77, 79, 2, 80,154,130,184,181,238, 71,225, 81,180,176,186,
- 52,146, 6,162,191,193,122,115,192, 63,253,216, 63,197, 76, 63,195,163,175,123,146,159,248, 39, 63, 65, 94, 20,124,207, 95,251,
-171, 28, 3, 71,207,127,142,164,215, 35,238,180,124,151,219,104, 34,112,152, 52,167, 42, 60, 53,107, 62,158, 19,117,123,216,162,
-192,150,117,192, 75, 16, 22,233, 18,100,228, 83,223,202,130,252,240,128,238, 7,190, 22, 51,246,150,165,221, 56, 66, 8,152, 88,
- 75, 34, 5,141,176, 83, 63,211,134,115,219, 27, 56, 33,104, 37, 9,173, 70,226,253, 11, 66,162, 84,140, 74, 18,156,129,227,225,
-140,211,209, 20, 25, 43, 30,125,236, 33,190,227,199,127,152,191,254,211, 63,193,251,255,197, 63,224,252, 27,159, 96,126,122,140,
- 46,115, 92,233,195,101,148, 20, 62,154, 82,250,104, 92, 17, 53, 60,214, 52,157, 65, 54, 67, 8,227,105,101,186,246, 95,105,159,
- 7, 80,204, 97, 54,132,201, 0, 38,167, 65, 19, 33, 32, 73,252,248,125,109, 29, 90,237, 48, 50, 44, 23,133,165, 84, 17,173,221,
-139,136, 40,241, 99,214, 21,143,184,116, 98, 49, 92, 23,175,166,161,213,187,238, 48, 58, 92,118, 35, 43,232,215,133, 26,190, 54,
-190, 47,247,241,203,103, 70,220,219,149,175,236,160,173, 91, 2, 58, 22,162, 82,213,160,177,118, 9, 25,183, 61,204,102, 69, 97,
-236,244,202, 18,189,198,235,174, 32, 66,157, 91, 90,187,109, 29,247, 90, 91,137,140,187,183,203,173, 39, 12,214,147,176,252,158,
-220, 97,202,177,239,228, 87,180, 0,245,142, 92,170, 14,201,198,195,200,184, 29, 94, 63, 28,255,193,162, 73, 16,253,201,208,172,
-202, 88, 64,188, 70,114,223, 91,137,183, 31,245, 41,130,181, 76, 62,192,130, 22,209,171,126, 41, 31, 56,240, 85,189,204, 95, 10,
- 7, 66,208,146,183,145,234,240,158, 41,239, 2, 8,121,245,206,104,191, 11, 55,218, 7,186,196,145,167,189, 69,181, 50,213,143,
-231,157,211, 33, 5,174,118,229,132,231, 65,169, 48,162,247,164,191, 5,131, 60,138, 80, 81,140, 84,177, 47, 70,163, 6, 34,106,
- 16, 37, 77,132,168, 99, 86, 61,135, 2,153,120, 95,191,146, 84, 89,198,252,112,159,233,193,190,199,156,110,247,104,174,173, 83,
-229, 37,197,213, 47,176,247,171,159, 96, 60,155,249,166,192,106,210,202,199,241, 58,163, 57,211, 48, 49,144, 26, 40,157, 99, 88,
- 89, 6, 21,156, 84,142,153,113, 92,157, 87,156, 20,134, 51,237,216,171, 20, 39,133,101,174, 29,211,210,176,159, 27,198, 90, 48,
-214, 2, 27, 55,184,155, 26,142, 75,203,221,194,112, 86, 90, 10,227,208, 50, 34,115,146,105,229, 69,177,165,118, 56,225,155, 47,
-129, 92, 12, 85, 23,151,116, 88,187,212,158,116,171, 77,216,189,135, 49,186, 14,251,112,107, 23,217,239,218, 44,105,132, 54, 60,
-228,214, 45, 87, 75,181,214, 66,212, 19,219,122,251,130, 13,181,157, 93, 60,163,206, 57,202,193, 62,122,158, 50, 57, 30, 50, 62,
- 61, 67,103, 57,243,209,144,211, 59, 35,210,233,148,225,241,152,254,214, 38,155,151,250,156,220, 41, 88, 91,111, 80,100, 57,179,
-225,243, 92,234, 39,244,154,219,124,217,165, 39,104,186, 17,177,106,211, 86, 29, 78,139, 19,214,215,214,233, 55, 54,216,237,239,
-144, 68,254,117,215,215,219,116,154,125,214, 55, 21, 69, 94, 48,215, 35,206,183, 31,164,153,108, 48, 46,206, 88, 75,186, 24,231,
-184,115, 56,100,174,231,148,100,140,210, 25,121, 94, 49,200, 15,153, 84, 19, 10, 91,145,217, 12, 41,165, 96,251,252, 46,147, 73,
-202,104, 56, 98,247,250,231,152, 76, 13,229,253,151,216,120,248, 49,110,127,246,147,236, 94,185, 66, 85, 66, 44, 37, 90, 40, 26,
-205, 22,198,148, 56, 93, 98,180,166,181,181, 78,171,211, 33,238,244,136, 90, 29, 84,188,198,108, 52,160,200,135, 8,149,160,162,
- 38,131,131, 35, 78,247,174, 18, 69, 17,233,124, 68,153, 71,156,222,125,133,102,183,197,238,165,115,244,207, 93, 68,170,152,147,
-189,219,116,250,187, 28,190,252, 57,144, 62,209,232, 79,191,247, 77,188,124,103,196,127,251,163,255,202, 11,198, 48, 94, 65,186,
- 18,134,130,208,126, 28, 42,227, 48,114,179,203,133,139, 9, 42,247,170, 10, 22,150,120,225,125,172,131, 30, 22,164, 56,157, 98,
-179, 57,213,217, 25,249,104,200,252,244,140,114,150, 97,139,156,233,104,200,124, 56, 97,124,124,202, 27,254,204, 55,224,210,155,
-136,195,125, 14, 63,127,149, 70, 84, 33, 35, 31,248, 71,171, 1,113, 15,202, 52,236,227, 52,140,206,112,131, 17, 58, 45,112, 55,
-111,178, 55, 73,153, 71, 9, 59, 15, 93,164,177,117, 95,176, 39,153,133,136, 67, 32, 80, 73, 76,212,108,250, 76,100,192, 25,159,
- 65,110,141,245,241,166,214,209,237,245, 89,151, 3,100,212,231,139, 95,115,137,243, 91,155,104, 93, 65,171,137,108, 38,222,114,
-133,127, 80, 90,187, 59,252,171,159,255,101,134,243,156,255,242,135, 79,115,229,178,227, 95,126,226,243,236,236,108, 50, 27,204,
-125,237, 83,105,146,102,155,164,221,245,137,122,147,153,199, 40, 90,141,177,150, 86,183, 73,210,235,224, 76,233,119,171, 58, 96,
- 97,171,210, 95,238, 58,120, 95, 98,127, 88, 69,107,107,180, 46, 95,100,231,173,143,115,115,154,113,228,180, 79,182,196,113, 22,
-246,174,221, 70, 66, 91, 9, 14,206,134, 97,106,105, 56, 62, 25,176,214,106, 50,205, 50,198,163, 49,107, 81,196, 59,191,244, 13,
-252,157,255,244, 47,249,209, 95,253, 25,126,224,167,255, 57, 95,245,125,223,137,181,150,244,244,132,233,245, 27, 84,211, 49,174,
-210, 8,107,137, 59, 77, 90, 91, 91,200, 70,211,119,183,205, 54,162,213,242, 41,114, 73, 3,209, 95, 71,172,111,250,203,121,107,
- 11, 46, 92,240,162,184,126, 31, 26, 9, 52,154, 94,232, 24, 75,127,145, 55, 19,223,185,199,161, 75,151,126,180, 43, 84, 8,213,
-168,153, 6,225, 98,250,138, 95,123,201,239, 64,131, 5,186,214,134,173, 50,168,239,189, 29,195,255,179, 43,187,227, 87,137,221,
-156, 91,238,208,107,177,156,183, 27, 5,107, 91,224,101, 47,172,108,139, 76,235,165, 74,248, 30, 68,157,117, 56,157, 83,101,103,
-216,106,182, 68,180,134, 67,213,213,118,186,112,104,186,213, 37,104,168, 66,252,254,183,137, 84, 18,171,189, 59,192,106, 27, 16,
-173,254, 80, 94, 96, 70, 23,187,126, 23, 46,119,141,201, 78,124, 12,173,168, 51,215, 89, 76, 39,146,222, 5, 90,151,159, 68, 53,
-183,239,141,155,115,118, 33,140, 91,134,131,248, 14, 63, 94,191, 68,231,209, 47, 39,217,188,226, 47, 63, 86,130,215,157,243,148,
- 72, 39, 22, 26, 21,108, 8,112, 34, 0,116,236, 61,100,149,122,159,192, 98, 76, 98,204, 82, 64, 23,148,239, 68, 50,140,226, 3,
-149,174, 38,227, 24, 63, 17, 20,206,226,170,124, 65, 92, 20, 50, 10,171,153,160,132, 87, 10, 21,171,176,194,137,124,209, 18, 69,
-126, 93,132,244,151,186, 16,158,170, 41,133,183,183, 57,231,255, 41, 5,182,210, 56, 99,152,220,189,201,232,224, 22,167,215, 94,
-100,247,252, 6, 59, 15,221,135,106, 70,224, 36, 39,191,242, 43,140,202,138,162,212,104, 13,198,250,177,118,161, 45,169, 17, 28,
-230,142,153, 22,148, 22,166, 5, 28,102,142,195,194,113, 82,192, 89, 41, 24, 86,112, 90,193, 64, 11, 70,165, 33,183, 48,169, 12,
- 7,153,101,104, 4,131, 10,230, 72,110, 79, 43,142,114,195,141,185,229, 40,183, 68, 2, 6, 21,156,150,142, 65,105, 49, 62,117,
-134,184,209, 68,198,141,133,235,194, 46, 36, 79, 50, 20, 90,203, 65, 43,245,145,191, 98,167, 52,182, 22, 94,250,169,142, 49,203,
-209,187,209,193, 66,103,184,183, 64,174, 87,126, 65, 33,239,140,143,125,181,193, 91,191, 96,204, 7,159, 91, 49, 59, 64, 87, 5,
-210,101,100,147, 49,189,115, 59,180,187, 13,210,225,136,253,231,110, 97,243, 53,214,183, 34, 70,135, 57,113,210,224,190, 7, 30,
- 32,157, 57, 46, 92,184, 66,164, 18, 46,116,174,240,204,241,179, 60,121,254,109, 8, 33,121,241,240, 38,179,172, 96,111,116, 11,
-156,226,116, 62,160,210,142,215, 63,122,133,219,195,155,180, 99,201,100,236, 39,158,145,104,130,112, 52, 68, 66, 83,182, 40,163,
- 49, 46,136, 62,155,209, 26,137,104, 49,175, 38,156,229, 67,198,197,136,220,122, 91,104, 81,205,136,230,195, 17,150,146, 13,169,
-136, 26, 22,119,253, 42,217,149,251, 56,184, 61,231,145,104,206,249,215,191,133, 60, 27, 19, 69, 49,179,233, 16,128,249,104,204,
-218,214, 57,172,140, 56,187,246, 5, 58, 27, 27,196,237,117,166, 39,135, 36, 73,129,148, 9,243, 98,132, 64,210,238, 54,136,146,
- 46,157,254,156,164,247, 4, 85,225,237, 31,107, 59, 27, 8,167,121,229, 15, 63, 69,119,189,131,140, 19,206,246,143, 89, 63,223,
-163,217,218,192,153, 71, 57,255,240,253,188,242,251, 39, 28,220, 61,230,233, 91, 47,172,236,189,245, 74,202, 89, 8, 99,113,185,
-255, 80,214,164, 40, 25,170,113,173,253, 56, 94,231,225, 67,212,168,231,149, 11,202,219, 2,106,168,167,216,108, 78,126,118, 74,
- 57, 25, 81, 76,166,100,195, 49,121,158, 51, 57, 27, 80,166, 25, 89, 94,162, 90,109,226,102, 7,119,116, 13,119, 60, 0, 59,163,
-187,222, 36,138, 35,111,159,234,111,121, 27,156, 14, 8, 85, 93,193,108,140, 45, 43,140, 53,152, 87,110,114,152,149,188,124,251,
-148,239,249,194,199, 49,233, 1,117,254,166,183, 64,249, 17, 91,212,232,120,107, 88, 92, 80,230, 41,198,106,172,118, 88, 99,208,
-218,139,136,142, 14,142,249,216,143,253, 0, 95,249,151,254, 25,127,243,195,239,231,116,118,194, 11, 95,120, 30, 26,109, 80, 21,
-210,129,180,142, 88, 10, 6,121,202,198,214, 6,195, 51,255, 62, 78,143,238, 82, 88, 73,145,231, 40, 21,115,165,211, 34,203, 74,
-154,189, 14,197, 28,146,102,139,108, 86, 34,149,247, 6, 87,179, 28, 87,149,188,237,187,191,149,217,205, 23,188,133,167,142,105,
- 84, 10, 97, 53, 46, 28, 98,245,114,204,132, 46,245,177,111,255, 16,119, 78, 70,124,242,233,151,217,221, 88, 67,104,237, 45, 51,
- 64,153,229, 30, 98, 17, 69,196,145,224,228,108,202,204,102,172, 95,220,225,251,255,242,135,184,244,206,119, 33,123, 93,168, 12,
-229,225, 1,213,193, 62, 70, 91,204,124,238, 63,192,202,239, 7,101, 20,211,236,181,137, 54,251,222,207,171, 36,178,221, 65, 36,
- 9, 20, 25,194, 25,232,118,124,119,164, 34,104,182,189,231,102,225,109, 9, 38,112,229,188,167,184, 38,208, 9,233,187,187, 36,
-246, 43, 27,153, 4, 33,213,255,127,183, 92,179,201,147,254, 6,127,234,211, 7,252,234,123, 30,164, 28,156,133,128,151, 37,188,
-195, 45, 80, 43, 44, 49, 87, 78, 44, 50,162,235, 47, 18,242, 85, 17,170,118,105, 43,115,247, 34,208, 61,122,150,101,246,116,205,
-200,174,219,109, 33, 86, 71,241,203, 9,180,201,198, 97,212,201,226,207,180,188,183, 87, 80,160,181, 88,179, 30,143, 74,137,106,
-248, 66,190, 24,222, 9, 59,252, 37,114,211, 45,128,109,129,120,167,124,191,107,141, 63,144,101, 0,219, 44,244,107,218, 45, 45,
- 71,198,146, 15,110,162,179, 33,182, 24, 44,199, 26, 43, 81,176,181,189,192,139, 20,125, 81,174, 7,183,153,255,209,255,131, 16,
- 51,132,138,194, 74, 33,196, 38, 47,216, 21,181, 58,207, 46, 5,180, 78,135, 11,158,101,103,175,171,229, 24, 37, 92,230, 86,107,
-156,213, 88, 93,134,105,199, 10,121,174, 14, 13,178, 6,103,117,104,248,125,252,171,211, 21, 52, 59,184,106,142,136, 19,132, 93,
-126,102,188,190,194, 23,134, 50,105, 32,163,166,127,147,149, 12,220,119,129, 12,141,136, 11,196, 29,161,130,231,222, 58, 84, 34,
-200, 7,167,164, 71, 7,204,238,238, 51, 63,186,203, 67,143,236,208,221,222,193,170, 4,187,119,149,195, 59,119,253,221,232,156,
-167,174, 25, 75,105, 33, 71, 48,170, 96,164, 5, 13,225, 72, 12, 28,151,134,253,220, 81, 72,197,154,132,204, 10,206, 42, 48, 72,
-140, 49,172,197,146,185, 54, 84,198, 98,156, 68,148,142,221, 38,220, 73, 13,149,241,128, 31,101, 45, 15,183, 21, 7,153, 65, 73,
-201,134, 16,172, 53,154,148,214,130,106, 32, 99,133,174, 74,138,188,164, 29, 75,140, 80, 40,103, 22, 41,110,245,196,196,185,149,
-162,116, 37,244, 72,226,215, 49,102, 17,243, 26, 46,240, 85, 98,114,189,134, 10, 99, 44, 19,232,131,254,249, 93, 73,112, 89,181,
-120, 44,108,155, 10, 83, 76, 57,217,123,133,238,230, 58,187, 23,238,231,228,246, 45,102,131, 17,142, 22,194,197, 56, 41,104,174,
-197,112, 34,232,239,238,144, 21,103,172,245,183,233,180, 13,141, 19,197,236,214,148, 52, 43,248,100,246,123,108,198, 91, 30,228,
- 99,155,236, 36, 13,172,116,140,230, 51, 94,115,223, 38,163,236, 14, 61,177,195, 75,103, 47,242,240,230,107, 88,211, 59, 88, 55,
-162, 33, 91,184,216, 43,141,142,199, 3,156,136,136,149, 33,145, 77,206,138,187, 8,169,232, 38, 93,210,106,134,197,210,109,173,
-113, 60, 59, 34,210, 85,138,138, 37, 39,123,123, 60,241, 37,143, 50,253,195,223,160,106,172, 49,161, 65, 20, 75,116,225,200,103,
-103,172,237,220,207,201,193, 13, 54,118,119,153,158,230, 68,177, 36,205,231,236,190,230, 77,168,184,135,171, 74,132,140, 40,210,
- 49, 66,118,168,202, 25,231,175, 60,236, 63, 27,198,210,108, 38,168, 42,226,232,250,139,108, 93,186, 72,156, 40, 38,163, 25,136,
-136,116, 60, 65,235,107, 52,154,107, 56,109, 25, 30, 95,167,209,220,102,126,114,136, 54,142, 55,188,245,203,233,110, 95, 9,171,
-190,114, 17, 14,224,156, 94,142,212,180,198, 73, 25,132, 42, 33, 53,202, 84,200, 36, 9,169,107, 26, 27, 88,205,175, 26,122,134,
-238,102,142,203,230, 84,227, 33, 8, 71, 62,157,146,142,134,228, 89, 70, 85,100,100,243,148,201,104,202,254,237, 67, 62,248, 63,
-255, 15, 56,119, 2, 2,210,179, 51, 98, 89,208,234, 95, 34,185,116,209,139,168, 90,235, 80,205,150,229,103, 89,194,104,228, 35,
- 89,243,140,179,233,148,145,136,152,173,183,188,133,109,122,199, 11,120, 66,181, 47,148, 66, 37, 13,136,155, 8, 98,156, 48, 11,
- 64,131,181, 14,171,181, 87,108,106,135, 49,154, 7, 30,127, 51,255,228,219,191,146, 31,248,232,127, 38,142, 28, 63,250,161,175,
- 12, 64, 29,175,184,141,140, 34,233,180,248,228, 31, 62,207,251,222,251, 21,252,222,239,254, 14,113, 20,179,254,218, 39,113,159,
-124, 25,139, 34, 77, 51,190,250, 79, 60,142, 81, 2,149, 52,144,149,247,243,219,162, 66, 70,202,119, 24, 74,176,182,187,133,153,
-157,133,224, 23, 19,198,185, 22,165, 75, 28,126, 74, 98,240, 86, 21, 33, 21,178,213,192,100, 5,103,175, 92,229,189, 63,248,221,
-188,238, 83,127,192, 71,255,217,199,112, 64,187, 21, 19, 43, 69,105, 52,179,212,171,245,183, 46,238,240,221, 63,249,195, 92,248,
-202,175,242, 83,143,219, 55, 49,131, 51,202,227, 99, 76, 61,230,199, 97, 10,179, 98, 55, 22,168,126,143,102,191, 79,180,190,230,
-111,146, 36, 70,196, 49,194, 24, 47,138, 11, 93, 58,113, 2,237,182,191,156,107,117,117,200,174, 70,135, 21, 77, 21,198,177, 54,
- 8,172, 36,254,251,105, 90,158, 33, 31,133, 61,171,248,175, 49, 13,150,151,188,213,134,175,248,165,231,248,127,191,116, 55,164,
-110,173,248,194, 87,125,226,171,162,157, 32,254, 90, 96,221, 88, 54,208,110, 65,211,122,213,197, 22, 14,167, 69,148,106,160, 15,
-214, 83,100, 33,253, 78,191, 78,255, 18, 65,179,177,160,118,173,126, 26,106,198,182,100, 9, 1,113, 43,211,234,149,236, 87,103,
- 13, 58, 61,193,204,142,253,235,215, 62,116, 41,150, 97, 42, 43,145,156,245, 72,212,143,139, 3,251,189, 22,233,173,128,148, 68,
-224, 30, 8, 89, 97,138,211, 48, 69, 11, 74,113,181, 48,251, 47,118,247,184, 90,123, 2,152, 57,197,248, 37,146,173,139,120, 89,
-230,171,246,232,139,194,198,188, 74, 36,183,226,142,177,218,191,191, 90,251,226, 79,251,213,215,226, 89, 89, 88,164, 86, 86,119,
-145, 79,100,115, 1, 21, 44,132,242, 52,201,240, 57,146, 42,246, 84, 58,159,230,227, 57,238, 66, 97,133,244, 95,139,167,214, 73,
- 17,123,209,166,138,253, 69,238, 25,187,203,209,188, 16,254,123, 38,189,135,221, 58,135,114, 80,205,230, 76,142,238, 50,220,187,
-133,208, 5,189,139,231,104,238,236, 32, 42,203,209,111,253, 38, 99,109,208, 40,176,144, 75,135, 2, 10, 43,152, 88,201,153,113,
-164,193, 75,237,172,225,110, 1,103,218,103, 55,116,163,136,253,180, 36,181, 96,133,165,173, 20,185,245, 92,220,180,244,239, 31,
-198,113,144, 25, 42,227, 66,214,186,102, 59,145, 92,207, 12, 13, 9,187, 77, 73, 33, 18, 14, 11,195,197,110,147,172,210,204,171,
-138, 78,179, 65, 65, 65, 43,106, 33, 93, 21, 38,145, 2, 33,188, 59,102,153,252,230, 22,122,162, 58,176,104, 17,198, 18,186,118,
- 23,220, 49,118, 21,205,108,150, 5,169,149,110,137,171,117,158,238, 38, 36,203,162,218,214,209,189,126, 34, 37, 4,136, 98,136,
-204,115, 78,110,158,240,192, 23, 95, 98,112,247, 22,107,219, 23, 48, 85,131,114,158, 50,156,222,164,215,219,161,211, 45, 56,188,
-125, 13, 51, 75, 24,244,198, 92,188,178, 77,107, 67, 97,110, 37,236, 54,119, 41, 44, 24, 52,157,100,141, 68, 38, 40,169,188, 14,
-162, 41, 56, 57, 27, 51,154, 38, 8, 21,115,127,251, 1,158, 61,250, 60,137,104,209,136, 27,228,100, 52, 27,142, 92,151,164,105,
- 65,225,206, 80, 82,177,219,219,161, 76, 13,109,149, 96, 85, 78,228, 32,142, 44,211,124,130,177,218,171,223,173, 54,104, 28,173,
- 59, 55,185, 57,207,153, 12, 13, 27,187,187, 88, 45,153, 79,166,204, 7, 71,116, 55, 46,176,117,225, 65, 42, 61,231,129, 39,158,
- 36,207,115,154,125,159, 68, 51, 62,218,199,150, 99,162,198, 14,147,241, 45,182,239,219, 66,235,152,107,159,123,138,238, 70, 31,
-109, 59, 20,179, 83,146,102, 7, 23, 25,162,214, 58,150, 41, 18, 31, 46,219,232,172,211, 94,219, 66, 42, 65, 49, 78,121,237,219,
-191,154,215,191,231, 27, 81, 8,144, 49, 81,170,153,189,248, 2, 58,105,209,220, 90,163,217,223,244,222, 79, 87, 33,132,196,234,
- 18, 25,247,144, 40,178,241,128, 60, 51,244,207,245, 73,141,225,198, 31,237, 51, 60, 58,226,202,253,155,220,255,216, 5,255,225,
-149, 18, 92, 99,197,238,147, 66,158, 82, 78,198, 88,227,152,159,156,144, 78, 38,148, 69, 69, 54,159, 51, 29,142,153, 12, 71, 76,
-179,130, 89,150,113,238, 53,175,129,219,207, 67, 81,144, 30,141,232,238,108, 19,109,108,194,230, 14, 52, 59, 94, 89, 91,156,250,
-137,129, 9, 73,110,147, 25, 38,207, 48,195, 33,119, 38, 57, 87, 71, 5,223,243,203,255, 7,118,126, 16,170,207, 42, 8,144, 44,
- 82, 6, 82, 20,113, 24,127,250, 92,121, 93,250,175, 49,206,121,133,111,200, 7, 30, 31, 13,248,186,111,254, 48,239,126,207, 87,
-112,231,234, 53,222,248,230, 55, 80, 12,247, 66, 84,164, 66,160,105, 52,218,252,230, 31, 61,205,180,213,229, 59, 62,240,223,241,
-249, 87,238,240, 7, 79,125,134,215,158,247,163,176,217,254, 17,223,240, 77,223, 64,119,115,139, 42, 47, 49, 69,137, 46, 74,100,
-163,177, 8,149,168,138, 42,136, 29, 92,122, 0, 0, 32, 0, 73, 68, 65, 84,228,126, 91, 4, 22, 39, 5,214, 84, 8, 35, 3, 24,
-196, 75,178,157, 54, 40,165,112,107, 29, 16, 17,102,150, 18,183,187,204,207,142, 56,255,198,215,241, 35, 63,247, 79, 25,222,188,
-197, 75, 79, 63,195,232,100, 64,255,194, 46,111,122,255,159, 35,121,240, 97,212,206, 6,204, 82,152, 5, 42, 95,158, 5,106,154,
- 87, 26, 91, 33, 16, 78, 34,187, 9, 66,117, 81, 66, 34, 27, 9,178,219, 65,182,154, 30,239,219, 80, 75,178, 77,179, 13, 73, 4,
- 89, 10, 91,219,254, 50, 95, 68,235, 6, 42,159,209,190,240,178,222,150,231,163, 62, 37,162, 17,121, 4,174,168, 15,119,159,145,
-237,109, 86,161,187, 19,138, 63,238, 47, 25, 69,200, 72,177,249,230,119, 48,120,250, 83,172, 28, 33,225,110, 8, 98,161, 90, 9,
-191,240,200, 46,100,105,129, 80,183,162,248, 94,180, 37,110, 65,149,171, 59,112,183,218,166,220, 67,158, 11, 59,220, 16, 4, 35,
- 86,132,151, 50, 68,163, 10,249,170, 92,152, 21,136, 7,117, 6,251, 10,113, 75,212,140,237, 58, 68, 35, 8,206, 68, 36, 67,110,
-246, 74, 81, 80,231,190,175,230,193, 47,216,242, 43,187,114,177,196, 74,136,149,200,215,213,144,153, 90, 24,231, 45, 74, 34,100,
-193,215,223, 85, 25, 14,102, 67,180,118,238, 85,194, 56,177, 82, 25,217,165,109,205,133,244,181,192,174, 95,136,219,156, 12, 8,
- 89,235,167,120, 53,216, 92, 46, 71, 36, 74,197,104,242,112,105, 71, 88,225, 1, 89,126,250, 30,242,207,133,243, 99, 83, 34,108,
- 62,241,163,116, 41, 3, 28, 5,143, 41, 85, 98, 97,189, 21,113,228,173,106,113, 12, 72,100,210,240, 94,110, 17,172,183,194,131,
-187, 80,114, 97, 35,180, 78,131, 41,201,166, 41,147,211, 33, 59, 91, 77,214,207, 95, 64,117,186,228,183, 95,225,230, 75, 55, 65,
- 72,178,210,250, 12, 38,167, 16,218, 48,183, 48,118, 17, 67, 99, 49,206,144,107,203, 28, 56,171,124,182,124,106, 28, 51, 43, 24,
-235,101, 46,122,101, 93, 32,202, 89, 50,163,193, 42, 58,177,160,116,144,133,253,182, 2, 14,115,203, 90, 18,145, 72,201, 73,105,
-153, 84, 25, 23,218, 9,221,180,100, 32,224,254,205, 13,238,142,207,216,109,183,112, 72,210,178,164, 19,199, 56, 28, 85,101,151,
- 44,255,176, 23, 55,214, 5,244,129,183,142, 58, 81,131,255,220, 66, 26,165, 67,224,145, 9, 32,122,183, 8,148,113, 24, 27,224,
- 70, 42, 40, 27,196,146,105, 47,101,205, 97, 16, 11,203,167,195,161, 44,200, 27,255, 5, 46,126, 45,197,244, 4,135,224,210, 99,
-143,240,210,239, 61, 75,163,181, 70,207, 73,250,219,125,142, 15, 78,232,117,250,156, 76,206,136, 39,125,110,189,120,130,165, 96,
-158,101,108,182,207,113,107,116,147,181,230, 22,243,114,206,133,173, 45,198,197,156, 75,235,151,120,230,240,105, 58, 81,135,162,
-172,208,102, 78, 33, 35,238,107, 95,228,110,118, 23,105, 37, 89, 53, 67,170, 6,251,227, 67, 18,213,194, 24, 75, 97, 75,174,158,
- 93,245,128, 32,213, 70,216,138, 66, 87,100, 26,230,213,156,205,214, 26, 81,127,231, 2,167,123, 87,113, 8,116, 46, 40,207,198,
-100,133, 98,237,145, 47, 34,157, 77, 17, 38, 99,253,194,253, 72, 37,201,103, 99,250,231,238, 35,157,156, 32,162, 53,142,238, 60,
-207,214,133,215,146,205,134,180,123,125,132, 44, 81, 81, 23, 41,124,149,183,126,225, 97,158,251,244,111,243,214,175,251, 83, 68,
-234, 1,140,213, 40,249, 58,202,249,140,168,211,167,245, 80,159,178,172, 48,233, 41, 27,231, 47, 99,178,130, 63,251,131,255, 43,
-110,124,130, 61, 57,165, 56,153,144,231, 57,229,108,202,236,238, 62,131, 59,251,236,221,216,231,206,225, 30,111,255,208, 7,120,
-242, 35, 31,193,216, 12, 21,245,248,201,191,241,253,252,247, 63,250,207, 22, 7,234,102,171,207,143,255,195,143,242, 85,127,238,
-189,188,112,237,144,255,244,209,143,179,177,214,225,235,191,238,173,188,225,109, 15,175,140,239, 52, 84, 21, 58, 79,169,178, 57,
-217,104,196,244,232,132,170, 40, 24, 28,159,144,207, 50,198,147, 9, 71,167, 35,166,211,156, 47,253, 51,239,134,217, 9, 12, 78,
- 49,163, 49,211,233,132,237,251,239, 67, 60,250,152,255, 5,219,155, 96,166,203,174,207,104,152, 77,188, 72,203, 57,138,147, 51,
-166,214,145,106,195,246,235, 31,167, 26,159, 5, 63,187,194, 58, 47, 92, 65,104,148, 46, 22,115,215,249,201, 1,101, 81,224,140,
-197,212,187, 59,150,161, 25, 50,138,152,158, 13,177, 50,230,210, 23,189, 1, 55, 57,195, 6,235,143,104, 40, 84, 21, 51,159,156,
-242, 35,223,251, 17,254,199, 31,251, 41,126,248,167, 62, 70,154, 13,121,227,229, 45,254,237,143,255, 93, 78, 79, 6,168, 88, 50,
- 27, 77,104,108, 93, 36, 61,221,167,200, 74,102,147, 9, 70,247,253, 37, 39,124, 58,148, 73,203,133, 20, 75,212,169, 37,214, 96,
-173, 68, 26, 9,202,225, 74,159,134,167, 26, 13, 76,101,208,206, 17,117,155,232, 44,199,148, 37,250,240, 46,253, 71, 30,228,109,
- 95,250, 36,116,186,126,111,173,141,247,132, 87, 51,127,113, 86,165,255,127,210, 23, 12, 36,209, 2, 31, 42,146,132,168,217, 70,
-181, 19,100,175,231,119,222,245, 37, 94,119, 95, 73,228, 47,240,102,203, 95, 76, 91,219,190,107, 50,198, 95,228, 58,236, 79,203,
- 18,170, 42, 76, 96,195, 36, 64,197, 97, 17, 30,123,255,250, 98,255,106, 87, 46, 87,113,239,104,250,143,233,216,157,181,188,254,
-175,252, 47,124,234, 35, 95,181, 80,128,175,166, 65,214, 49,145,171,169, 85,171, 2, 95, 87,147,218, 2, 42,213,173,118,231, 11,
- 62,186, 91,228,167,223,147,232, 38, 86,224, 44, 43, 23,162, 14, 5, 65,221,213,187, 16,175,229,156, 67, 68, 98, 57,186,151, 43,
-171, 2,227, 22, 68, 83, 63, 42,183, 75,166,188,172, 71,150,222,243, 43,194,191,215, 19,135,149,134,107, 1, 79, 18, 53, 4,238,
- 30,194,158, 64, 96,125,112, 71, 24,227,215, 63, 55,224,227,239, 9,155,169, 45,127,117,242,151,179, 14,167,252,247,184,249,218,
-183,174,232,106,228,202,200,195,132,136,229,200,179,223, 23,157, 90, 21, 38, 47,181,141,173,244,144,153,218,143, 30, 98,153, 93,
- 80, 7, 58,235, 64,185, 0,124, 1, 39,165, 79, 97,171,147,214, 88,102,197,251,245,128, 55, 81, 59, 87,225,156, 95, 17, 10,229,
-188,160, 82,128, 83, 17,182,210,200,164,137,140, 19,111,119, 11,188,120,225,156, 79,121, 19, 18,153,180,125, 70,123,179,237,167,
-149, 70,163,179, 20,157, 77,209,233,132, 70, 83,210, 91,107,210,218,222,162,156,206, 57,249,196,199,153, 91,235, 25,228, 64,105,
-125,153,111,156,247,162, 79,165, 34,119,142,188,244,221,105, 26, 60,229, 38,112,211,167,198,209,105, 40,138,176, 50, 49,120, 97,
-226,188, 52,126,205,164,252,133, 91,104, 71,101, 44,218,250, 16,147, 94,236,225, 81, 51,237,104, 40, 73, 51,145,164,165,225,101,
-109,121,100,123,157,155,227, 9, 93, 1, 66, 53, 72,203, 41, 45,233, 29, 42, 86, 87, 72, 21,176,177,194, 97, 92, 40,220, 22, 41,
-170,110,165,220,125,149, 22, 51,252,152, 91,224,225,188, 79, 94,174, 76,144,124, 26, 96,237, 20,185,103,216,178,140,148,149, 53,
-171,221, 34,230,119,104, 48,231,120,239, 54, 55, 94,185,197,198,133,243,172,223,215,230,248,230,148,110,167,199,205,107,175,208,
-235,239,176,113, 97,155,225,209, 4, 71, 73,145, 90,140,171,216,234,156,103, 90, 12, 72, 84,155,118,220, 98,127,118, 72, 99,199,
-226,246, 74,142,103,135,220,215,190,196,141,233, 30, 13, 41,105, 69,107,164,213,132, 88,181,145, 78, 50,175,198, 72,183,201,222,
-240, 54, 82, 40, 74, 91, 44,158,231, 66,231, 20, 38,199, 4,159,233,102,171,203, 81, 58, 64, 2, 7,105, 74,132,176,116,214,183,
-153, 76,142, 81, 58,103,247,221,239, 96,114,253,144,207, 61,243, 28, 79,254,153,119, 99,123,125,178,201, 16,161, 98,162,164, 65,
-158,141,104,180,250,100,195, 19,122,235,155,140, 79,206, 22,201, 77,186, 76, 17, 56,202,172, 96,109,235, 28,167,123,207,241,250,
- 39,223,130,201, 50,226,110,143,241,225, 1,211,163, 61,218,219, 91,172,239, 92,194, 20, 21,210,166, 20,182,193,175,255,187,159,
-226, 71,126,251, 6,213,179,191,139,109, 94,196,174,245,176, 73, 3,125,122, 76,158,143,152, 78, 14, 24,102,135,204,220, 25, 83,
-155,242,143,127,232,111,240,227,111,124,140,254,149,199,233,108, 38,252,196, 95,250,111,152,255,209, 47, 81,161,200,211,138,239,
-254,107, 63,200,135,255,242,251,249,206,223,250, 46,190,231, 7,191,143,163,225,235,185,241,210,203,252, 95,191,248, 20,127,105,
-247, 34,247,237, 64,163,219, 5, 87,226,178, 25, 38,205, 40,198, 99,102,167, 39,204, 67, 80,203,116, 56,196, 26,199,232,116,132,
- 20,130, 34,157,241,158,143,124, 8,119,227, 69, 68,119, 13,115,114,198,252,108,140,120,211, 55,120, 49, 94,171,239, 61,195,179,
-249,210, 31,171, 53,174, 40, 60,175,185,219, 69,207,102, 12,141, 37,105, 40, 26, 59,231, 73, 15,246,253, 89,163,226, 0,245, 16,
-216,170, 68,151,133,247,106, 86, 37,249, 44,197, 86,149,111,158,130, 32, 10,183, 4,140,184,176,195, 22, 14, 92,146,208,190,123,
-136, 56,183,133,204, 43, 76,240,122, 8, 44,107,247,237,242,239,254,213, 63, 34,159,122,159,125,163,221,229,224,246, 62, 56,136,
-226, 24,180, 96,173,219, 99,114,253, 57,242, 60, 16,179,176, 56, 25,227,148,103,164,151,185, 31, 89,187, 0,206,192, 46, 71,177,
- 88, 25,226, 12, 29, 24,135,108,199, 88, 33,176, 81,132,117, 94,245, 42,211, 28,164, 67, 87, 57,242,236, 12, 57, 25,122, 29, 66,
- 20,249,147,187, 44, 61, 79, 94,107,108,161,253,152,177,233, 67,108, 84,187,141,136, 27,168, 78, 27,177,181,233,187,112, 25, 14,
- 92, 93, 43,152,165,255,181, 34,229,237,104, 88,127,129,231,185, 63,208, 43,227,131,118, 42,141,203, 11, 31, 73, 91,195, 41,164,
- 0, 27,252,201, 86, 66, 85, 96,164,143,178,148,194,122, 41, 71, 85, 95,250,226,143, 29,191,223, 11, 13,179,172,189,246,113,255,
-190, 10,183, 12,159,144, 43, 0, 12,199, 34,217, 78, 4, 17, 97, 77, 49,245,151,163,191,176,101,232,124,157, 93, 38,182, 73, 81,
-243,221,173,247,150,135, 17,124,125,233,249,166, 69,248,142,176,134, 99,138, 37,148,131,149,255,246,171,227,240,218, 43,126,114,
- 17, 70,221,214,218, 37,218, 51,128,104,144, 75,100,104, 29,232,226, 66,235,228,139, 18,235, 61,244,181,103, 30,135,138, 85,216,
-143,122,223,249, 82,215, 18, 18,215, 2,184, 71,170,101,102,182, 39,181,249,175,151, 98, 5,133, 91, 31,224,138, 48, 77,240,191,
- 94,247, 13, 95,185,164,146, 16,133,253,185, 93,130,104,106, 91, 2,209, 50, 6,153, 87,137, 8,131,112,209, 25,179,146, 30, 82,
-239,209, 53,206,133,128, 40,173, 67,224,155,231,217,135,144,123,164,178, 1, 10, 84,103,180, 7, 88,140, 82, 11,109,133, 71,222,
-250, 81,188,104, 68,193,170, 23,225,242, 50,200,134, 34,132, 48,225,235,253, 4,164,134,208,212,197, 12,214, 49,190,123,199,127,
- 70,162, 22,155,151,118,112, 82, 97,246,111,242,194,103,175,162,149, 68, 35, 40, 12, 20,214, 75, 67, 82, 35,201, 44,164, 66,144,
- 25, 75,170, 29,145, 18, 76, 87,191, 21,210,227,112, 35, 33, 40,173, 37,137, 21,121,169, 57,201, 42,186,177, 36, 81,146,210,248,
-201, 97,110, 12,165,177, 68, 66,208, 75, 20,137,242,207,223,184,178, 52,180, 97,144, 91,218, 81,196,253,107, 29,110,143, 82,214,
- 99,193, 90,167,131,182, 22, 25,181,188, 46,198,250, 25,120, 85, 21, 68, 98, 73,132,139,164,183,179,217, 5, 47,126,249, 25,169,
-183,169,245,143, 45, 88, 68,245,103, 34, 88,225,132,112, 44, 82,124, 67,202, 95, 93, 68,219, 90,203,225, 21, 65,190,128, 85, 75,
-107, 92,103,239, 23,121,165,249, 46,146,164,195,248,248, 20, 20, 12,143, 71,116, 94,247, 0,229,116,196,157,131,148,141, 43,125,
-154,253,132,209,105,225,237,119, 90, 17, 17,211, 78, 98,182, 57,207,172,156,241,248,246, 27, 72,135,115,142,198, 19,206,109,107,
- 78, 71, 51, 18, 25,177,209,220, 97,174,103, 36, 81,194,126,122, 3,109, 13,145, 84, 84, 84, 68,170, 73, 66,147,169, 29, 16, 9,
-133, 20,138, 76,196, 56,145, 50,213, 19, 58,170,203,233,108,202,184, 26, 33, 69, 68,105,115,162, 50,203,144, 74,177,126,254, 1,
-236,157,103,153,255,222,103, 40,146, 22,219,231, 47,147,103, 19,108, 41, 73, 58,109,138,108, 20, 44,104, 27, 76,207,134,148,229,
-156,181,222, 54, 39,123, 55,144,170, 68, 87, 5, 22,239,215,204,102,115,138,116,192,230,165,199, 56,124,229, 51,152,202,241,236,
-167,159,226,209, 47,126, 11,173,173, 93,122,235, 61,202, 44,227,217, 79, 61,205,246, 37,193,133,135,222,194, 95,249,233,143,227,
- 14,158,163,210,107,180,182, 55, 72,243, 57,213,233, 41,246,240,152,249,243, 95,224,244,230, 45,174,189,114,149, 27,195, 17,175,
- 12, 38,124,243,159,124, 39, 27,175,121, 35, 81,183,203,205,159,255, 49,250, 15, 62,200, 28,129,108,247,232,236,110,243, 31,159,
-122,154, 23,127,241, 23,120,236,207,125,144, 86,191,197, 55,126,224, 91,184,126,173, 69, 58,159,241,244, 83,159,229,103, 62,241,
-191,243,183, 62,250, 51,144, 77,201,135, 67, 76,150, 50, 57, 57, 33, 61, 27, 83,102, 57,179,225,152, 50, 43,217, 63, 60,229,228,
-116, 4, 18,222,241,222,183,195,141, 47,192,193, 33,174,215, 37, 31,207, 88,123,221, 67,144,116,252,165,210,108,249, 11,166, 40,
- 86, 76,145, 26,225, 4,170,223,198,206, 75,214,222,252, 36, 15,253,135,143,243, 23,111, 63,197,228,218,139,136,164, 17, 14, 12,
-237,225, 50,132,232, 78,151, 98,180,241,123,116,237, 60,253, 75,219,112,134,201, 96, 39,170, 99, 18, 61,169, 9,103, 16,214, 18,
-105,239,213,151,202,160,164,192, 6,218,153,148,130,209, 96, 64, 54, 73,209,186,194,152,129,231, 49,227, 80, 42,162,213,104,210,
-223, 90,227,120, 58, 7, 41,233,111,244, 57,218,159,123,206,185,140,136, 98,133, 46,131,131,192,134, 81,101,164, 22, 31, 30,231,
-156,191, 52, 1,226,200,119,129,149, 93,118,139, 42,194, 68,150, 40,105, 98,165,194, 86, 21, 74, 54,160, 44, 3, 26, 86, 45,172,
- 68,214, 10,172,148,158,136,215,237, 17, 41,229,149,234, 27,155, 75, 59,162,241, 83, 22,226, 38,184,102,136,133,138,189,165,200,
- 90, 63,114,183,214,219,236,242, 28, 74,237,139,172,154,138,102,188,125,177, 78,117,176, 70,163,171,202, 39, 77, 57,223, 51,198,
-205, 18,213, 41, 17,113,139,184,239, 85,201, 43,196,149, 63,246, 46, 95,168,225,149, 34,138,218,196,107, 27,148,163, 97,128,142,
-112, 79, 71,190,104,248,133, 8,197,146, 88, 92,166, 53,188,102, 65,153, 51,203,188,232,250, 94,114, 33, 66,213,213, 59,245, 90,
-140,182,218, 5,215, 99,251,112,153, 47, 2, 99, 88,205, 48, 15, 16,153,123,181,122, 65,108,180,196,212,222, 43, 80,115,139,149,
-164, 87,173, 7, 91,102, 61,117, 55, 43, 19,132,197,248,116, 37,223, 58, 20,132, 66,250, 65,169,173,252, 5,173,132,196, 86,225,
-146,175, 11, 7,229, 95, 72,212,129,107,209, 50,151,123, 25,199,234, 95,173,113,223, 3,247, 38,228, 81, 99, 95, 11, 16,141, 48,
-118, 23,254,159, 11, 49,164, 88,241,232,233,229,191,139,197, 22, 61,160,106,125, 36,177,179,122,193,178,194,130,171, 50,159,254,
- 85, 71,210,106,207,255,246, 5,149,245, 58, 1,194,101, 92, 3, 81, 8,208, 35, 43, 86,242, 19, 98, 47,180,245,118, 20,255,254,
-135,142, 93, 42,181,208, 43,200, 40, 98,126,118, 74,220, 72, 48,211, 17,229,120,140, 43,230,172,237,238,224,170,138,179,167, 62,
-205,200,122, 34,227,188,114, 20, 78, 82, 57, 75,101, 64, 19, 49, 9,214,178,188,178, 84,120, 53,124,105,161,157, 68,164, 69, 69,
-183, 17, 17, 1, 89,101,233,181, 98, 38,185,102, 84,104,146, 72,210,140, 35,140,117, 84,214, 50, 41,189, 77,184, 23, 73, 90,177,
- 66, 74,201,172,212, 94, 20,231, 96,230,160, 21, 43, 58, 82, 50,169,204,226,153,239,196,134,180,208,108,181, 19,132,131, 70,179,
- 65, 62, 27,227,240, 65, 48, 50,248,222,107,103,165, 16,254,226,247,110, 28,223,212,152,160, 19,145, 44,221, 30,181,199, 93, 5,
-122,156,146,171, 92,135,149, 52,196, 5, 18,121,153, 78, 87,183,239, 54,232, 3, 34, 41,137,219, 23, 40, 77,147, 68,194,173,155,
- 87,137,163, 22, 81, 44,185,246,244, 53, 46,191,238, 10, 55, 95,184,197,237,231,166,172,111, 52,185, 59, 60, 96,187,117,129, 36,
-138,169,108, 65, 20,181,169,178, 41,231,186,231,232,181,218, 92, 61, 57,230,202,198, 5,158, 59,122,158,102,220, 98, 93,173, 83,
- 70, 67,210,124,194,102,123,141,110,209,231,180,186,131,118, 9,214,141,105,169,136,185, 24,210, 80, 17,133,201, 24,229, 35,226,
- 72,145, 22,217, 98, 21,150,155, 2, 37, 19,156,209, 24, 83, 33, 77, 85,162,136, 56,184,118, 13, 57,205, 24, 94, 63,225,129,115,
-155,220,124,233, 6,141,214, 58,211, 89,206,241,141,103,232,109,157,167,209, 94,103,120,114, 6,202,210,110,245, 72, 7, 35,122,
-155,107,168,164,233,119, 48,147, 49, 81,220,164, 42, 38, 24, 36,210,142,136, 90,219,216,106,200,165,215, 60,196,254, 75,207,210,
-104, 75,242,172,100, 54, 58,225,161,199, 47, 35,101,151,225,237, 23,216,186,244, 8,163,207, 62, 67,235,254,203,232,170,128,201,
-140,252,165,107, 28, 62,245,251,220,121,233, 21, 62,251,204,203,252,254,173, 35,158,186, 51, 96,239,120,198,151,189,255,131, 60,
-249,216, 91,248,135,239,251, 50,110, 94,127,153,131,235,183,200, 39, 83,239, 44, 85, 48,220,187,203, 83,127,249,131,124,240,130,
-226,223,127,236,223,147, 78, 14,217,217,222,224,190,203, 15,240,153,143,255, 60,235,253, 62,217,245,231, 60, 84, 69, 23, 76,143,
-143,168,102,115,230,179, 9, 69, 81,112,122,120,202,243,175,220,226,238,241, 25, 42,130,114,150,243, 21, 31,250,122,236,254, 29,
-210,131, 67,242, 91,183,152, 31,159,113,241,139,159, 8,187,214,134,223,215,148,249, 34,169,137,176,139,115,177,132,102, 27,167,
- 29,218,106, 30,123,224, 34,207,190,241,203,113, 59, 91, 84,211, 49, 85, 58, 69,151,153,231,173,151, 5,166,204,208,101,133,173,
- 74,140,174, 48,186,240, 96,150,192,102,118,214,248, 52,170,224,145,117,206, 82,101, 25,241,214, 14,195,223,252, 21, 84,183,231,
-245,131,113,128, 85,216, 80,165,134,135, 58, 74, 98,159,242,132, 92,228, 12, 75,225,169, 70,204,167,100,211, 9, 73,163, 65,210,
-106, 81,164,211,144, 86,232, 80,177,164, 42, 53, 85,154, 47,226, 39, 87, 34, 71, 66,214,113, 56,254,234, 44,238,197,235,198,136,
- 70, 11,209,106, 33,122, 93,108,156, 64,162,112,173, 6, 86, 70,184, 72,225,162,196, 23, 70,205, 6,178,213, 36,218,222, 70, 94,
-186,140,120,232, 65,120,221,227,240,192,195,208,237,133,203,192,248,215,104, 52,252,223,173, 70, 8, 88, 9,201, 91,217,204,191,
- 23,233, 12, 38, 51,152,167,216, 34, 71,151, 26, 83, 86, 56, 93, 98,139, 18,157,166,148,211, 9,217,100, 68,122, 54,160, 24,142,
-201, 38, 19,178,233,140, 98,158, 82,204,198,148,179, 9,182, 44,176,198,132, 34, 65, 47,146,188,238,133, 22,189,234, 66,175,163,
- 67, 3, 84,102, 57, 79, 95, 13,104, 97,249,172,120, 78, 37, 14,187,180,223,184, 85,155,217, 42,135,221, 45,253,183,238, 85,123,
-245, 21, 65,158,171, 71,146,172, 16,252,238,217, 17,172,196, 12,200,165, 18,216, 11,178,196, 50, 62, 97, 53, 28,190,222,103,174,
- 40,221,197, 74,222,118,125, 24, 47, 46, 68, 37, 22,136,218,218,206,182,240,235,215,138,102,231, 67,107,235,139,123,153,191, 80,
- 23, 33, 75, 4,173, 53,238,222,220,237,216, 23, 23, 62,115, 69, 18,239,190,198, 11,209,176, 1, 40,227, 49,168, 11,124,180,211,
-247,238,214,235, 64,116, 17,135, 46, 62,120,215,195, 40,222,233,106, 37,129,200,248, 98,218, 89,156,214, 56,157, 7,199,141, 47,
- 22, 69,146, 44, 68,112, 34, 82, 8,153, 4, 66,173,170,201, 58, 75,210,160,138,189, 18, 94,197,136,196,139,227,234,157,177, 16,
- 50,140,152, 3,119,195,225,225, 51, 82, 97,138, 2,148, 68, 41,137,144, 80,206,102, 76,143, 14, 80,145, 64, 24,235, 45,113,211,
- 33,195, 91,119,169,132,244,195, 41, 39, 60,209,209, 41, 78, 43, 1,113, 68,102, 5,149,119,130, 3,206, 3,157,128, 88, 9,148,
- 16,196, 2, 26,145,164,211,136,208,218,175,254,180,133,139,221,132,134, 16,228,149, 33,215,134, 94,162,216,108, 69,180, 27, 49,
-149,129, 73,161,201,141,199,188, 74,130,109, 95,192, 76,107, 78,178,140,147, 52,227, 44,173,184, 58,158,147, 11,255,251, 40, 80,
- 12,211,140, 82, 40,156, 74, 32,104,138,164,106, 32,101,200,140,176,254,121,169, 81,198,118,213,126,184, 80,200, 47, 81,199,102,
- 37,179,120, 73,175, 92,113,158,172,232, 53,234,211,204,215,164, 33, 73, 79,248,102, 74,173, 63,194, 99, 95,244, 14, 82, 55,229,
- 92,191,205,243, 55, 95, 4, 45,177,241,140, 63,250,244,231,216,184, 20,113, 50,191,203,100,150,210,111,244,112,210, 50,171, 10,
-246,166,215, 57,156,220,194, 34, 25,228, 3,116,231,152,245,181, 38,163,236,148,146,220, 35,116,197, 1,103,147, 83,250,237,152,
-211,236,132,211,242, 24, 41, 91, 88,171, 17, 56,114,166,148, 85, 70, 97,166,104, 91, 48, 46,207, 56, 74, 79,177,206, 82,154,130,
-169,158, 82, 5,230,180, 20,138,202, 89,162,217,208,155,234,155,189, 14,179,129, 64, 61,126, 63,167,198,146,116,122,204,166, 19,
- 98, 37, 48, 66, 50,184,245, 50,141,254, 46, 73, 34, 40,178, 20,129,101,255,165,103,217,186,255, 62,242,249,136,206,218, 38,145,
-136, 16, 18, 42,157,129,104, 50, 62,190,203,206,133,139,228,105,151,184, 33,217,186,252, 8,174,180,204,167,167,116,183,118,153,
-156,222, 97,235,226,131,156,238, 93,245, 86,185,163, 9,235, 73,131,106,239, 46,217,205, 59,220,250,244,239,114,182,119,131,105,
-154,243,194,193, 25, 47,140, 39,180,154, 13,186,237,132,195,178,207,103,111,191,204, 7, 30, 95, 99,255,230, 30,113,119,157, 70,
-191, 79,247,202,107,152,238, 93,103, 94,182, 72,183,224, 99, 95,128,190, 56,225, 19,191,254, 59,188,229,173, 95,195, 89, 10, 31,
-253,215,255,156, 23,238, 92,231, 31,124,219, 71,120,219, 23,191,149,215,189,245,113, 68,175, 67,239,242, 67, 76, 39, 41,251,215,
- 94,226,165, 23, 95,166,181,217, 71,209,100,146,101,188,238,205,143, 32,231, 99,104,247,104, 93, 80,100,131, 1,121,154, 99,187,
- 61, 95,101,199, 17,152,194,119,233,206,103, 20, 46,124,193, 34,194,234, 20,107, 43,162,107, 47, 35,139, 41,235,189, 38, 7,239,
-254, 70,182,126,237,103,177,183,239, 32, 59, 29,136,194,110, 55, 88,171,108, 61,162, 12, 20,188,186,131,164,102, 34, 91,111,111,
-179, 89, 74,227,252,125, 60,251, 3,223,207, 75,159,250, 35,206,253,173,111,227,202,187,222,229,213,255, 34, 70,200, 10, 41,240,
- 35,253, 70, 28, 72, 78, 22,225,108,136,237,116, 24,173, 17,198,226,242, 12, 83, 25, 58,253, 46,196, 13,146,102, 68, 85,134,160,
-150, 58, 22,209,249, 49,178, 92,216,127, 2,235, 60,164,152, 73,165, 60, 50, 54, 4,210,248,145,173, 32,106,198,184, 74, 34, 90,
- 94,188, 38,164, 66, 54,125,162, 91,212,246,137,103, 72,225, 69,105, 81, 4,221, 53,239, 13,143,130, 82,189,242, 99,121, 4,126,
-134, 40,228, 82,229, 98,131,126,161,204,161,200, 96, 58,135,217,204,255,217,202,202, 91,239,194, 62, 91, 23,165, 7,134, 24,139,
-169,252, 42, 1,107,194,127,107,108,101,124,151,222,106, 83, 21,254,242, 74,218,221,176,143,175,115, 37, 3, 75, 61,176, 18,254,
-107,234,119, 55,155, 32,218, 93,223,112, 5, 98,154, 91, 97,161, 72,193,138,112,109,165,235,116,120, 76,112,232,209,189, 32, 42,
-168,214, 9,226,184,122, 87, 29, 52, 93,102,201,210,172, 67,207,238, 25,173,215,161, 21,132,247, 77,172,122,228,101,184, 72,238,
-217, 61,251, 46,167, 62, 20,197, 34,219,244,222, 96, 23, 27, 82,197, 22,197,128,242, 57,227, 43,243,120, 86, 34,179,131, 6,196,
-219,215, 68,180,140,198, 18, 44, 11, 53, 33, 86,208,236,181,175, 61,164,124,121,229,248, 82,208,167,154,155, 88,151, 33, 85, 17,
-188,240,154,205,175,253,190,197,196,167,142, 90, 22,171,217,176, 11,122,207,189, 69,205, 50,204,197,250,145,187,144, 1, 6,164,
-125,231, 45, 20,198,152,165, 87,111, 97,177,243, 69,128,167,198, 73,164, 82, 88,161, 16, 90,250, 11,182, 38,245,213, 34, 60, 43,
-188,160, 79,184,133, 61,205,163,121,189,174, 70, 58,131, 12,211,131, 5, 61, 14,139,211,126, 31, 47,132,243, 42,251, 56, 33,233,
-116,152, 28,221, 33, 43, 75,210,241,152, 43,175,221,161,209,223, 34, 59,218,231,100, 86, 96, 81, 20, 56,230,218, 82, 74, 73, 20,
-197, 20,149,163, 20, 17, 22,131, 14,116, 0, 21,169, 69,184,137, 18,146, 86, 92, 71,221, 66, 39,137, 40,141,161,212,134, 43,253,
- 38,177,148,100, 84,228,198,208,111, 70,228,218,127, 47, 51,109,130,130,193,209, 75,212, 50, 51, 29, 47,176,203,173,163,112, 14,
-109, 29, 36,130,216, 74,102,133,215,184,216,134, 96, 51, 73, 88,143, 37,202,106,154,145,247,249, 23, 69,142,214,118, 65, 88,174,
-141, 10,139, 28,245,224,250,112,117,114,224, 74,177, 42, 86, 92, 38,171, 25, 67,220,155,113, 20,214,239, 53, 45, 49,172,188, 2,
- 94, 22, 7,231,158,252, 42,158,254,204, 9,187, 27, 91, 60,253,242,211, 72,169, 56, 60, 61,224,190,139,231,184,212,234, 50,216,
-155,208,109,198,156,140, 79, 57,191,118,129,146, 25,155,231,123,156, 93,135, 70, 35,102,156,142, 56, 43,142, 40, 15, 54,112,149,
-101, 80,206, 41,117, 65,212,156,161,138,132,204,206,168,102, 57, 39,243, 9,141,168, 69,166,231,180, 84,147,202,165,160, 65, 59,
-195,221,233, 49, 56,168,156,161, 52, 25,177,146, 20, 90,211,138, 19, 4, 21, 70, 84,148, 53,249,220, 89, 15, 51, 25,221,184, 78,
-235,171,223,205,253,207,190, 76,222,104,240,216,249, 38,179,179, 33,221,205, 62,136, 45,140, 43,169,138, 9,186,204,104,117,214,
- 41,210,130,141, 75,247,209,104,119,104,118,214,177,149,163, 44,231,200,188,203,228,108,204,206,149, 29,142,111,237,211,236, 14,
-233,110,236,146, 52, 55,153, 12,166, 76, 15,175,178,125,229, 10, 14, 69,123,253, 28, 88,203, 99,239,252, 26,108, 62, 36,217,185,
- 8,101, 78,126, 58,226,238,211,159,101,112, 50, 96,154,101,236,141,166, 12,203,130,172,210, 76,202,130,191,253,129, 15,242, 83,
- 63,247, 75, 60,152,192,241,100,138,222, 19,116,183,182,105,245,214,176,191,255, 27, 72,213, 97,247,225, 39, 56,219,252, 19,252,
-232,163,159,231,103,204, 19,220,185,117, 72,210,123,158,119,189,253,113, 94, 28, 31,112,119,127,196,159,255,251,255,146,203, 79,
- 60, 76,188,242, 6,223,247,214,247,240, 37,192,123, 7, 39,252,221,111,249, 86,230,243, 57,198, 90, 62,252,157, 31,192,124,254,
-115,168,221, 93,100,163, 67, 99, 83, 16,175, 85, 36,189, 62, 20, 97, 84, 55, 43,252,152, 79, 91,127, 40,135, 67, 72,103,115,152,
-205, 17, 78, 96, 7,103,116, 47,158,131,193, 20, 51, 50, 28,127,217, 55,177,246,111,254, 30,241,246, 38, 98, 52, 10, 29,191, 12,
-126,111,150,144, 10,235,194,120, 93, 4,167,156,195, 22,133,247,124, 54, 26,252,220,123,222,203, 90, 35, 98,237,194, 6,255,247,
-207,254, 10, 63,244,103,191, 30,115,122,230, 31,230, 88,162, 98,133,212, 6,147,168,240, 0,175,140, 63,157, 65, 23, 21,107,253,
- 14, 85, 81,178,182,189, 73,231,220, 57,140, 21, 68,113,228, 47,196,164, 5,162, 68,151,245,132,160,134,110,172,124, 88,234,147,
- 91, 9,132, 86,139,241,165,140,226, 5,133, 43, 74,154,168, 36, 65, 37, 9, 50,248,190,101, 20,249, 14, 93, 37, 75,184, 75,187,
-179,100,247,231, 83, 47,154,187,231, 54, 9,159,212, 34,243, 95, 83,148, 30, 62, 84,105,152, 76,176,101,133, 77,115,156,112, 84,
-243,148, 50,203,112,214, 83, 96,116, 81,121, 97,116, 80, 50, 43,165, 48,198,171,222,141,241, 17,171, 78, 72,172,174,136, 34,181,
-136,180, 92, 28,202,212,133,150, 89, 26,190, 95,221,169,223,185, 13,157, 30,206, 26,170,249, 28, 91,102,247,228,140,227,196, 2,
-120, 33,156, 93,168,225, 17, 46,188,239,158,233,238, 86,253,229,181, 42,222, 9,132,114,139, 46,218, 31, 92, 98, 49,210,182, 97,
- 55, 88,119,208, 82,137, 16,142, 97,125, 76,234,202,253, 37,213, 42,212, 35,236,244,195,228,102,209,129,215,162,203,154, 45, 47,
- 87,252,236, 44,253,226, 30,232, 97, 3,143,124,165,243, 95,168,216,195,234,160,170,131, 92,196,189, 63, 87,134, 92, 22, 89,119,
-226, 75, 49, 32, 34, 20, 50, 17, 11, 53,180,138,194, 26, 66,168, 32, 78,247, 47,210,125,226, 93,248,176, 80,185, 28,187, 59,231,
- 71,239, 53, 3,126,113,233, 23,222,173,178, 96,196,251,157,185, 80,202,231,177,107,141,171, 10,255,157,137,226,149, 56,103,229,
-197,111, 97,244, 47,149,192,234,192,153, 8, 23,180,139, 20,194, 69, 62, 48, 72,249,239,157, 53, 25,113,179, 7, 42, 70, 38, 13,
- 28, 42,112,230,141,255, 6,184, 42, 8, 22, 67,212,106, 20,121,178, 31,222,207,174,211, 12,149, 52,112,206, 81,149, 37, 73,103,
-141,108, 52,192,204,230, 88,163, 73,250,235, 36,253, 13, 78,126,251, 55,104,196, 49, 69,102, 73, 34,137, 17,146, 84, 59, 90, 74,
- 34,132,229, 44,215,200, 40, 66, 25, 19,224, 63,126, 63,175,132, 67, 69,138, 72,107, 98,229,255,108, 74, 9,250,205,132,105,174,
-233, 55,125,146,229,225, 84,179,221, 78, 48, 22,182,154, 17,198, 25,122, 66,161,132, 47, 26, 11,227,200, 42, 75,105,125,215, 46,
-125, 29, 67, 67, 73, 34, 33, 49, 14, 82, 99, 57,152,103, 92, 94,107,251,145,186,112,164,101,137, 18, 80, 86, 26,105, 42,156,173,
-130, 81,193,221, 19,141, 84,135, 29, 45,215, 76,203, 26,203,203, 20,195, 12,177,174,235,196, 50,138,184,166, 19,218,160,150, 95,
- 72, 51, 88, 41, 4,156, 23,148, 70, 74,112,124,144,147, 52, 18, 94,190,181, 71, 83,180,233,118, 36,243,114,196, 31,190,112,200,
-206,198, 14, 27,221, 54,103,217, 25, 13,209,230,230,240, 54,165, 26,240,112,231, 60,183,103,119,216,181,231, 56,206,206,120,160,
-115,153, 27,195, 61,118, 91,235, 76,138, 33,153,206,200,210,148, 88,120,254,192,116,182, 79, 35,234, 80, 21,158,243,146,153,156,
- 72,106,166,186,164, 29, 65, 34,125,228,121,105, 50,180,179, 76,179, 10, 37, 20, 78, 91, 42,163,177,133,159,187,106,103,137,148,
- 4,155,192,214,133,243, 28,221,218, 99,242,210, 29,204, 96, 72,235,145, 71, 25,220, 25,210,234, 40,226, 40, 33,138,219,224, 44,
-113,179,203,240,240,132,179, 59, 47,114,254,161, 7,144, 81, 66, 57,159, 97,172,160,211,239, 97,157,160,127,238, 62,108, 81,210,
-238,172, 49,184,123,151,141,139,175,161, 42, 44,197,124, 64, 89, 76, 72,218,109,146,246, 54,201,100,202,225,237,231,120,104,253,
-109, 20,147,129,135,126, 88,199,228,115,127,200, 44,157, 49, 76,125, 64,199,184, 52, 20, 70,147,196, 17,178,178,140,218, 45, 14,
-175,222,162,219, 78,120,230,104,204,238, 44,167,219,122,153, 86, 43,226,116,111,143,167,159,125,153,159,255,229,167, 88,123,236,
-107,120,235, 55,124, 27, 63,252,224,255,199,215,155,135,219,121,221,245,189,159,181,214, 59,236,241,236, 51, 75, 71,131, 37,121,
-146,226, 33,142, 29,103, 32, 36, 77,194, 12, 33, 55, 12, 33,185, 52, 4, 66,128, 2,133,134,161, 64,128, 66, 9, 5, 2,148, 66,
-105, 33,109,161,132,249, 50, 93,232, 45,195,101, 10, 16, 39,220,140,144,216,177,157, 56,150, 45, 89,211,209,145,206,180,231,253,
- 78,107,232, 31,107,237, 65,208,139,159, 71,126,100, 89,218,103,159,173,247,125,215,111,248,126, 63,223, 38, 91,171, 13, 30,254,
-130, 87,226,146, 26,127,242,219,127, 70, 81, 20, 60,240,210, 23,209,239,142,105,183, 83,116, 94, 80,159, 12, 16,209, 16,150, 26,
-180, 86, 79,240,206, 63,253, 51,254,240, 39,126,144,254,115,151,144,221,125, 70, 85, 69,109, 48, 36,138, 20, 81, 20, 77, 31, 23,
-254, 33, 63,201,102,156,103,103, 42,112, 33, 76,194,104,236,112, 12, 69,142,152,100,208,108,177,127,233, 58, 73,171,137, 80,146,
-229,173,101,170, 55,125, 23,213,125,183,211,248,129,183, 17,109, 29, 71,143, 38,216,209,192,143, 98,101,228, 71,239,214,224, 74,
-141,209,214,243,160, 91,109,100,163,197,213, 63,248, 93,254,246,167,222,205,198,198, 50, 29, 33,248, 64, 63,227,159,221,123, 7,
- 84, 30, 10, 35,140, 63,253, 84, 28,225,134, 19,226,141, 21, 76,222,157, 61,213,189,231,221,146,143,199,156,186,231,118,140,133,
-230,218, 10, 73,171, 67, 85, 22,184,170,192,150, 26,181,188,142,123,246, 25, 84, 44,201,123, 19,210, 86, 52, 59,208,230, 64, 77,
- 19,132, 61, 17, 82,249, 66, 68, 42,133, 75,107, 68,137, 66,160, 80,177, 64,198, 53,207, 15,136,253,152, 93, 70,177,239,204,229,
- 20,229, 41,252, 97,109,244,173,170,243,105,110,187, 79,105,240,249,211,163,161, 23,215, 5, 96, 9,186, 64,231, 37,174, 42,113,
- 86,163,243,146, 98, 48,162,202, 50,191,127, 19,194,219,207,117,232,242, 17,152,105,180,237,108, 68,237,191,158,169, 42,162,180,
- 65, 20, 71, 1,166, 18,172,108,102, 81,116,245,255,243,207,230, 49, 68,226,163, 62,111, 60,242,167,183, 50,212,103,249, 66, 33,
- 13,112,177,163, 88,240,163,207,136,165,130, 5, 49,155,152, 5,190, 76,243,218,221,148,143,174,196, 45, 41,100,211,208, 20,235,
-220,156,179, 97, 66,103, 30, 20,197, 86, 51,203, 59,159,109, 23,229, 66,209, 68,176,183,201,133,233,130,195, 39,220, 45, 40,138,
-103,226, 60,231, 64, 59,127,249,235,176,134, 49, 94, 43,160,166, 54, 56, 53,215, 8, 76,233, 93,179,188, 37,233, 47, 1, 27, 42,
- 10, 37,231, 10,114,107, 29, 24, 57,243,233,251,213, 67,215, 23,149, 10,176,146,218,169,251, 16,210,122,114, 28,229, 2,112,102,
- 65, 8, 63, 3,198,216, 57, 50,214, 84,158,117,175,226,192,111,159, 11, 9,173, 45, 17, 34,194,149,102, 14,181,178, 97,183,110,
-188,128, 85, 37, 45, 28, 5, 66, 58,156, 86, 56,109,144, 50,242,121,242, 98,154, 55, 56,125, 61,135, 20,102,193,129, 35,131,192,
-112, 62,202, 17, 73,125,129,132,167,231,218, 3,231, 16,170, 49, 31,255, 75,168, 47,175, 19,199,146,124, 84,160,226, 24,198, 3,
-134,219, 55,232,149, 26, 43, 35,191, 47,151,142,220, 69,232,202, 18,167, 9,185,182, 68, 18, 98, 68,200, 50,247,215,131, 18, 30,
- 48,227,163,142,161,158, 42, 98, 41,208, 56,142,182, 19,234,113,196, 48, 47,103, 87,126, 35,241,154,154,186,138,200,141, 97, 92,
-106,202, 80,116,233, 48,234,169, 69,130, 56, 92, 95,169, 18, 24,103,200,180,191,224,163, 52,226, 48,171,136, 5,228, 38,102, 45,
- 86,180, 2,176,221,184,202,251,214, 3,105,208, 5,218,219, 44,161,109, 97, 26, 53, 29,175, 79, 47, 90, 37,230,178,159,169,222,
-196,136,133, 24,231,233,118,244, 22,184, 83, 16,150, 34,194,202, 32,194,104, 77,169, 35,138,162,139, 41, 7, 28, 89, 63,202,167,
- 47, 92,100,167, 24, 19,197, 17,189,237, 17,141,184,201, 65,126,200,177,246,109, 12,139, 1,153, 45,248,205,143,125,138,251,150,
- 79,241, 76,247, 34,107,245, 37,174,101,215, 24,150, 61,238, 94, 57,193, 39, 14, 62, 21, 4,121, 48, 98, 68, 74, 68,110, 10,172,
-179, 36,145, 79,246, 76, 4, 12,245,152,126, 49,228, 96, 82, 81,186,138,202, 24,140,211, 62, 91, 37, 76, 63,141,177, 84, 97,245,
-227,107, 24, 73, 20,213,234, 36,173, 14,229,224,144, 43,195, 49, 15,189,250,126, 50,149,160, 79,220,142,123,246, 6,186,214, 66,
-132,253, 72,146,166, 68,178,134,147,251, 28,189,243, 12, 73, 99,131,253,203, 79,209, 57,122,156, 90,125,153,170,208, 12, 15, 15,
- 80, 82,120,224, 76, 93,209, 62,245, 60,250,123,123,228,131, 93,214, 78,220,201,201,123,238,231,242,227, 79,240,212,163,127,201,
-201, 19,171,188,228,141, 95,195,185, 87,126, 57,253,203,159,196,140,115,202,113,206,120,255,128, 43, 79, 62,197,225,120,192,193,
-254, 33,131, 50,103, 80,148,196, 74,208,232, 28,225,129, 7, 31,224,145,103,119, 73,149,100,167, 63,164,159, 21,108, 31, 60,193,
-111,252,197,223, 51, 78,143,241,186, 47,123, 51,223,245, 31,190,131,123,206,110,208, 73, 43,218,107,203,172,222,113, 39,221,222,
-136, 63,255,173,247,240,161, 79, 94,225,101, 15,223, 71, 90,143,113,198,144,141,115,100,145, 33, 6, 87,161,101,161,170,225, 84,
-142,115, 9,175,251,222, 31, 97,231, 55,222,137, 25,143,105,108, 30, 69, 74, 65,209,237, 98,178,146,165, 19, 71,125,119, 56, 21,
-194,184, 0,159,176,102, 94, 78,230, 25, 54,207,124,245, 20, 75,210,187,110,193,120,236,186, 0, 0, 32, 0, 73, 68, 65, 84,231,
-230,239,254, 9, 13,235,168,199, 49,101, 81, 48, 92,170,179,243,201,231, 40, 63,231, 45,172,109,172,176,249,165,175,162,246,217,
-175, 32, 58,117, 26,217,244,140,117,132,194,150,154, 98, 60, 98,124,254, 89, 14,254,239, 63,228,153,247,254, 61,153,181,140, 86,
-150,200,242,146,103, 5,244, 39, 57,175,249,234,255,147,236,224, 0, 89,171,251,231, 69,161, 17, 88,186,215,118,184,240, 7,191,
-199,139,222,254, 93, 20, 87,175, 99,180,193, 24,131,173, 42,116, 89, 82,140, 15, 81,241, 41,154,235,235,168, 90,221,143, 55, 99,
-201,112,231, 10,107,119, 63,196,232,195,143,208,238, 52,217, 62,127,157,187, 94,124,123,248,182, 13, 50,142,112, 24,223,149, 76,
- 91,192,192,232, 86, 82,162, 34,137, 74, 18,127,115,138,200, 19,222,162,196,251,203,147,122,160,186, 45,140,209,179,114, 14, 22,
- 55,118,154,118, 17,252,193,118, 54,214,245,128, 29,129,155, 76,176, 69,233,247,101,149, 14, 65, 28,134,170,204, 41,122, 3,116,
-145,161,203,210,247,175, 50,128,102, 8, 73, 91, 82,205, 19,212,132, 64, 88,235, 59, 52,225,225, 70,126,191,237,102,118,153, 91,
-128, 37,206,254,111,187,116, 0,145, 68, 33, 56, 2, 62,253,159,255, 45, 22,129, 13,233,116, 76, 21,238, 51,248,203, 66,224,234,
- 84, 28, 55, 13,242, 17,139,196, 26, 66,124,173, 8,135,158, 8,231,123, 16, 13, 89, 23,114,161,153, 91,215,194, 81,162,194,193,
- 61,221, 47,206, 4, 93, 11, 84, 60,187, 0,163, 89,100,219, 76,235, 8,177,112, 6,185,185, 64, 58,124, 54, 83,245,114, 72,156,
-179,115,213,252,220,202, 23,188,233,193, 90, 39,167, 80,153, 89,252,219, 12,153,227, 99,131, 67, 11,229, 66,170,220, 52,254,213,
- 91,251, 2,149, 78,250,244, 54, 41, 36, 66, 89, 58, 47,123,227, 34, 40, 63, 28,232,225,157,171,152,121,230,173,157,171, 1, 77,
- 1, 85,129,195, 34,226, 26, 78, 23, 51, 69,188, 51, 57, 18,111, 87,171,198,125,100, 92,247,201,107, 81,226,247,238, 42,242,207,
-128,164,229,143,237,170, 64, 36, 49,198, 22,193,153, 81,120, 44,236,116,237,226, 34,172,214,200, 40, 37, 80,240,195,161, 31, 68,
-132,214,204,175,161,176,135,183,101, 17, 10,175, 96,159, 11,145,214,214, 58,140,113,168,122, 13, 83, 20, 8, 83,146,245, 71,216,
-201,132, 73,111, 68,174,167,133,176,194, 25, 65, 81, 84,244,181,165, 29, 37,224,160,172, 12,113, 44,105, 36, 49,218, 24,198,133,
-247,213, 79,180, 37,150, 98, 6, 8,170,165, 10,133,163, 59, 49, 12,243,146,103, 14,199, 28,105,213,168, 41, 73, 86,105, 98, 33,
-136, 35,191,207,157,186, 54, 34, 37,168, 41, 57, 35, 46, 24,235,125,228,131,210,160,132, 36, 17, 6,129, 99,162,253,232,219, 24,
-195, 70, 77, 35, 19, 73,229, 52,202, 86, 36,104, 18,233,119,251, 46,172,149, 28,238, 22,160,145,148,129,237, 62,195, 48,135,221,
-249,172,250, 20, 11,181,147,152,137, 79,253,170,200,139,225,212, 2, 29,194, 3, 1,189,232, 78, 37, 45,162,219,223,196,181,107,
- 87,232,222,232,114,249,234, 33, 71,214, 45,203,109, 47,180, 60, 63,188,201,158,174,184,187,125,156,220, 76,120,114,255,105,182,
-106,109, 70, 85, 73, 39,142,120,162,247, 44, 27,201, 38,221,226,128,161,169,184,163,189,204,249,193, 83,172,197, 75, 92,201,111,
- 18, 9,133,115,130, 74,120,135,203,196,102,148,165, 14, 86, 80, 67,169, 43, 74,167,209, 70, 83,216,146, 72, 56,148,242,137,121,
-214, 58,132,172, 16, 83, 43,116,104,172,192, 17, 57, 32, 27,244, 64, 43,170, 68, 48, 41, 43,246,175,108,147,212,234,108,156, 62,
-193,222,238,136,113,211, 11,178,138,137,164,209, 89,103,121,115, 11, 93,120,117,118,218, 94,101,220,219, 39, 45, 75,132,104, 16,
-215, 83,116,153, 35,165, 64, 53, 36,181,198, 10,217,184,162,177,182, 70,150,229, 60,247,222,191,230,255,120,251,143,240,198, 59,
- 94,112,203,195,176, 42,251,228,189, 67,204, 96, 64,111,152, 49, 28, 15,233, 29,118,153, 88,203,165,222,136,205,102, 13, 45,224,
- 35,187,187, 52,151, 82,218, 43,235,220, 28, 25, 12, 57,215,171, 9, 63,246,182,111,231,181,223,248, 54,146, 68, 17, 71, 5,163,
-254,136,126,111, 72, 73,141,246,201, 19,244, 7, 99, 46, 62,126,158,229,186,224,193,187, 55, 57,186,182,140,176, 37,217,104,194,
- 48,207,104, 79, 6,180,237, 5, 88,189, 23,198, 35, 40, 13,178,115,198,167,228,188,241,109,240,200,239, 64,187, 1,237, 37,210,
- 56,166,251,196, 69, 58,175,120, 0,198, 19,175, 4, 17,248,177,180,214, 97,206,104, 65, 87,232,241, 48,124, 22,117, 76, 94,145,
- 30,221, 32,115, 48, 44, 42, 70,189, 9, 53, 41, 88,170,199,196,245,132,201,198, 18,187, 10,250,191,251,151,216, 95,248,127,136,
- 87,188,160,108,255,112,192,110, 85,177, 12, 68,206,145, 72,129,109, 55,232,119,218,116,139,146, 65,169, 61,244, 54, 82, 60,124,
-114,139,250,242, 42, 21, 2,167, 60,100, 98,202,175,190,237,246,187,121,231,247,255, 59,142,189,248, 65, 86, 30,120,152, 73,111,
-132, 45, 11,116,165,105,180,106, 28, 94,185,204,243, 62,251,179, 64, 58,226,102,155,114,212, 39,109,164,244,175,239,176,113,231,
- 41,132, 84, 94,120,110,133,199,101,138,185,154,218, 25,188, 71,125,225, 0, 82,113,130,177, 6, 21, 53,124, 28,173,246,118, 48,
- 31,124, 17,251, 81,123, 28,133, 49,189,245, 35,246,105,239,175, 75, 31, 93, 25,120,230, 82, 4, 4, 41, 18,148, 64,143,198,179,
-192, 17, 33, 5,182,204,209, 89,225, 71,204, 74, 80, 78,114,202, 81, 31,147, 23, 88, 93, 98, 75,237, 35, 57,162,200,163,119, 69,
- 24, 97, 91,139,139, 21,210, 5,245,172,243,176, 17, 57,245,177, 6,181,143,147,206,227,111, 23, 15,115, 59,133, 89,252,227,125,
-250,212,206, 38, 34, 69,213,235,205, 14, 25, 33,194, 3, 8, 55, 31,185,179,216, 96,139, 91,226, 73,165,243, 15, 40, 25,162, 62,
- 23, 23,130, 83, 70,186, 91, 32,156, 79,107, 0,187,128, 83, 21,179, 67, 59, 8,211, 66,170,153, 8,103,158, 13,175, 51,141,158,
- 12,122, 48, 66, 72,152,255,117,237,110, 25,221,207, 87,208, 33,198, 85,204,167, 1, 98, 65, 77, 44, 52, 16,205,225, 57, 78,134,
-105, 67,168,217,166,224,152, 41, 38,150,120,170,213, 80,200,116, 3,103,199, 56, 61, 14, 62,125, 49, 83,146,251,142,213,175, 64,
-166, 54, 56,172,163,245,208, 23, 45, 88,217,220, 2, 52, 38,154, 23,223, 51, 36,112, 8,224, 54,193, 90,103, 23,132,159, 50,242,
- 5,162, 13,172,246,217,247,171,103,108, 6, 33, 20, 78, 9,148, 51,254,112, 87,137,215, 93,136,224,146, 48,102,238, 62,176,115,
- 65,164,191,204, 42, 36,177, 47,214, 45, 97,183, 46, 17, 70, 5,141,138,197, 57, 63,157,179, 86, 35,130, 93,212,123,211,141, 47,
-224,164, 68, 56,131, 43, 11,207,133, 16,130,214,114, 11,138, 9, 66, 42, 42, 11,149, 19, 72, 33, 73, 34, 5,202,162, 43,199, 40,
- 43, 64,137, 16,207,224,104,165, 49,227,202, 97, 38,150, 72, 74,143,122,181,130, 72, 40,180, 55, 31, 16, 71,146,205,102,202,167,
-246, 70,156,234,212, 56,177,220,160, 55,174, 40,181, 65, 59, 40,171, 18,171,125, 6,123, 25, 0, 78, 94, 32,234,175, 20,141, 69,
-135,172,115,132, 13,162, 61, 75,174, 29,101,170, 80, 73,194,164, 48,140,157,162,150, 72,150, 27,117, 98,107, 16,182, 2, 91,249,
-189,121,136, 28,182, 83, 74,156,155, 23,198,114, 86, 24, 65, 36, 4,122,150,238,182,224,128,112,211,214, 93,206,215, 65,161,192,
-150, 66, 32,164,194, 90, 75,218, 57,194,218,171,191,149,157, 27, 41,227,124, 64,205,246,232,246,174,243,188, 83,183, 83,230, 17,
- 39, 78,172,178,115,179,207, 75,206, 62,143,237,253, 62,191,251,236, 71,233, 87, 19, 16, 17,253,114,192,233,230, 73,127,201,197,
-130,189,114,159,187, 91,199,185, 52,222,161, 19, 43,210,200, 81, 34, 48,182, 34,145, 17,145, 18, 20, 38,199, 57, 67,102, 10,154,
-202, 48, 40, 50, 34,169,208,182, 10, 79, 67,175,251, 41,173, 65, 27, 59, 43,250,116, 32, 35, 10, 4,149, 53,179,130, 38,202, 6,
- 61,146, 36,165,146, 57,182,148,196,175,126, 21,247, 28,222, 96,188,115,192,176,236,226,154, 45,170, 68, 18,199,117,146,218, 50,
- 68,222,214, 20,165, 41, 7, 23,182, 73,234, 19,234,173, 13,172,213,104, 3,217, 96,224,171,221,162, 79,123,125, 9,235, 34,138,
-236, 38, 73, 45,230, 21,111,254,118, 58, 91,103,124,184,105, 85,248,221,149,113,168, 52, 37,138, 35,138,124, 76,118, 99,151,253,
-237, 29,114,173, 73,155, 13, 14, 15,187,108, 53,106, 44,181, 83, 62,252,236, 21,254,228, 23,254, 11,159,250,244, 14,247,223,113,
-140,139,103, 31,230,205, 95,248, 48,111,252,174, 31,196, 53, 20,213,184,139, 41,115,118, 46,222,160,215, 47, 72, 91,109,150, 87,
-150, 57,236,246,201,187,125, 46, 95,188, 64,163, 94,227,182,141, 22, 27, 29,199,104, 48, 33,191,177, 79,111,231, 6,207,151,123,
-208,220,135,218, 50, 90,198,216, 44, 35,121,232, 56, 66, 36,144,180,112, 71, 79,248, 11, 99, 52,128, 40, 33, 43, 52, 43, 83, 14,
-167,158, 70,187,150, 97,222,233, 51,150,201, 51, 92, 81, 16,175, 44,251,155,124,255, 0,171,225,254,175,123, 61,191,244, 99,191,
-204,177,147,171, 28,228, 21, 3, 99, 25,219,156,150,148,104,107, 41, 99, 73,235, 72,135, 78,171,197, 40,203, 72,215,154,136,220,
-112,224, 28, 43, 82,112,169,172, 56, 40, 12, 53,105,168, 43,197,122,228,200,140, 99, 60, 28,241,205,239,252, 30, 38,251, 7, 36,
-107,171,126, 84,133, 67, 88, 75,163,209, 96,112,208,227,243,215,219,252,234,191,249, 25,190,242,251,191,133,206, 61,247, 51, 25,
- 14, 25,246, 7,156, 58,125,146,209,213, 29,108, 49, 33,105,180, 17, 82,161,179,130,201, 36,163, 49, 25, 67,156,160, 90, 45,234,
-195, 49,253,113, 6, 34,116,157,206, 34,173,131, 40, 4, 41, 74,159,107, 45,241,187,113,101,133, 31,181, 43,229, 71,173,137, 79,
-159, 34, 73, 67, 39, 51, 29,105, 87,254,146,212, 65, 93, 28,194,119, 92,248,255,179,206, 54, 73,160,178, 62, 29,174,172,188, 64,
-204,248, 74, 95, 32,112, 85, 69, 62,202, 48,217, 4, 61, 30, 98, 70, 99,116, 49,241,161, 13, 14,100, 18, 17, 37, 13, 84,163,134,
-178,201, 44, 23,219, 38,113,208, 64,132, 49,188,240, 10, 96,127,215,155, 57, 26,116,202,181,159, 5,114,252, 19,224, 25,103, 25,
- 93,185,228,195, 60,102,152, 88, 49,239, 18,103, 96,153, 48, 98,118,142,230,177,219, 89,125,254, 11, 89,125,225,139,193, 88, 6,
- 23,159,162,251,233, 79,145,109, 95,160,234, 30,248,215, 80, 10,129,153, 13, 44, 36,115,111,183, 53,115, 15,187,176, 11, 94,110,
- 21,210,204, 4, 51,207,248,236,207,203,169,181, 44, 60,229, 2, 74,118, 22,129, 26,102,152, 51,203, 92,152, 18,139,208,109,223,
-114,136, 79,159,162,194, 34, 2,212,221,153,133,213,128, 37, 0, 98,110, 5,127,120,133,187,244,163,123, 5, 34,174,145,172,223,
-141, 25, 95,163,234,143,103,120, 88, 59, 21, 2, 42, 22, 96, 61,222, 58,152, 28, 61,131,170,165,248,199,102,216,167,187,248,214,
- 50,196, 11, 2,194, 23,173,194, 24, 93,123,149,186,208, 11, 39,128,156,165,170,121, 4,172,245,177,169,214,121,130,101,210,242,
-157,189, 0, 23,213,231, 7,184,138,230,161, 81,206,161,162, 20, 67, 25, 10,223,114, 70, 2, 52, 70, 35, 93,224, 14, 84, 5, 42,
-109,250, 34, 25, 60, 77, 78,120, 94,188,119,146, 68, 30,195,173, 36, 34,173,133,240, 39, 13,198, 33,226, 4,149, 38,216,170,160,
-221, 73,169,183,155,184, 84,210, 47, 52,101, 40,150, 70,218,209,110,198, 48, 42, 61,137, 78, 64, 77,137,128,153,118,164, 9, 68,
- 70,134,201,143, 37,175, 44, 73, 61, 33,142, 4,163, 66,163, 90, 49,251,131,156, 84, 41,106,145,100,185,150,210,172, 71, 92,233,
-231,236, 79, 42,142,119, 82,138, 10,198, 78, 19, 43, 15,136,242,246, 56, 67, 21, 10,212, 41, 56, 47, 81, 94, 43, 36,164, 32, 22,
-146, 84,249,146,174,176, 22, 35, 19,100,164, 16,210,226,116,137,146, 80,234, 10, 25, 2,174, 92, 40,132,221,130,208, 77,178,112,
- 95, 45, 28,246, 50, 92, 96,206,134,200, 94, 49,159, 20,205, 24, 1,179,169, 84,132,192, 82, 91, 57, 70,243,249, 95, 67,175,172,
-241,220,197, 30, 42,142, 40, 51,203,181,139, 59, 28, 89, 62,194,242,122,139,235, 59,251, 40, 89,167,158, 26,210,180,197,241,141,
-101,254,205,209,231,113,225,234,179, 92,232,109,115,126,188,205,163,131,167, 40, 74, 67, 28, 69,212,101,141,139,227,109,140, 43,
-185, 58, 57,240,133,183,179, 76, 76, 73,129,183,165,149, 78,147, 72,133, 20,142,189,108,132,113,142, 68, 74, 10, 91,145, 42, 69,
-102, 12,101,101,169, 48,180,226, 4,237, 44, 58, 40,252,149, 20,196,194,147,251,150,146,134,143,195, 45,179, 17,227,222, 77,146,
- 90,135,102, 99,137, 79,156,191, 66,231,215,254,128,214, 23, 62,204,234,139,158,199,166, 75,136,182,111,114, 37, 54,136,202,114,
-241, 35,239,231,220,203, 95,137, 74,218, 44,109,172, 80, 91,218,162,202, 53, 69, 54, 32, 77, 19,180,171, 51,190,121,131, 56,133,
-246,250,253,244,111,238,115,223,171,191,140,187, 94,254,154,217,216,177, 40, 11,138,220, 43,196,227, 8,204,164, 32, 74,235,216,
-186, 96,210,239, 83, 91, 91,102,120,233, 2, 67,173,217,155,100,156, 94,170,179,223, 27,240, 5, 95,250, 90, 58,155,199,185,187,
-209,225,249,169,224, 45, 95,251,235,168, 78,155, 97,111,143,131,139, 93, 70,253, 1,163, 97, 69,189,179, 74,220, 74,152,228, 5,
-131, 73,142,156,140,217,190,112,141,189,131, 33, 7,227,125,206, 28,107,163,145,236,236,116,185,116,237, 58, 87,119,122,220,251,
- 57, 91, 56, 21, 51,122,246, 41, 92, 99,137,228,200, 41, 24,236, 65,231,184,127,223,205, 21,191,251,213,134,254,223, 61,198,250,
-131,231, 32, 27,207,163, 19, 69,136,239,180,129, 36,167, 43, 76, 54, 65,198, 10, 81,107, 82, 29, 28, 32,106, 41,206, 22,172,189,
-248, 33,222,252,195,138,119,255,216, 47, 35, 74,195, 94, 44,104,198, 49, 69,228, 11,250,178,240, 54, 19,121,216,163,210,254, 48,
- 26, 78,253,151, 73,132, 22,126, 76, 55,168, 44, 55, 74, 67, 34, 5,159,113,223,157,124,245, 15,252,107,138,241,144,100,101, 25,
-153,166, 94,224,147, 21, 48,201,169, 73,193,240, 96,143, 19,247,223,205,248, 19,159,230, 23,223,249, 46,190,250,219,191,142,244,
-204, 93, 84,147,156,254,206, 21,198,227, 17, 66,196,200, 56, 66,231, 99,178,238, 1,198, 56,118, 47, 60,197,217,242, 53,190,195,
-142, 36,131,131, 49,213, 48, 71,182, 26,126, 71,171, 75, 80, 53, 31, 60, 1, 62,105, 42,246, 2, 51, 17, 9,159, 93, 30, 62, 39,
-169, 34, 68,156,250, 7, 95,165,131, 61,202,120,236,173, 94, 80, 30, 91,237, 5,135,110,190,199,118,214,226, 38, 25, 14,139, 45,
-253, 68,164,202, 60, 62,215,134,177,165, 45,114,108,158, 97,242, 9,186,219,163,220, 63,164,218,239, 81,105,131,106, 55, 81,173,
- 22,172,134,131, 47,149, 62,147, 27,188, 42, 63, 18,184, 50,128,125,148,158, 31, 8,129, 79, 62, 79,233,181,243, 93,243, 63,241,
-143,140, 34, 62,241, 67,223,228,209,182,210,239, 89,231,142,238,233,174,219,139,147,134,173, 35,252,230,190,229,198, 83, 7,152,
- 79,254, 5, 95,124,209,240,166,239,252, 54,142,191,252,117,164, 67,120,238,202, 1, 71, 4,156,232, 12, 57,255,239,191,149,241,
-149, 11,179,192,149,233, 30, 92,132,113,253,148, 64, 71,232, 96,253,200, 59, 28,204,204, 19,135,229, 66,182,186,239,118,152, 45,
-246, 23, 49,173, 44,168,224, 67, 21,177,208,169,251, 52, 55,233,220,188, 75,183,204,137,117, 1, 49, 43, 3, 52,103,166,233,159,
- 2,103,172,152, 5,189, 76,255, 45, 16, 8, 59, 33,191,249, 40,194, 22, 11,224,154, 69, 78,126, 96,127,199,114,166, 44, 95,255,
-178,119, 4,222,187,143, 94,118, 97, 23,187, 16,121, 51, 29, 61,248,209,185, 84, 80, 45,134,241, 24,132,174, 22, 57,190, 88, 36,
-206, 86,216, 42, 40,104, 84,132,164, 54, 67, 4,169,184, 22,162, 65, 43,255,185, 68, 9,174,200, 17, 88,111, 61,139,162,217,251,
-115, 1, 57,235,117,105,222,199,142,211,179,252, 4,144,222, 57,128, 15,169,178, 65,101, 31,165, 41,149, 46,102,176, 33, 39, 5,
-174, 50,144, 68, 20,253, 67,170, 73,134, 84, 17,122,156,131,174, 40,246, 15, 25,143, 75,114, 20,218, 58, 38, 82, 82, 71,144, 70,
-138, 82,130,214,150, 72,121, 81, 91,101,172, 79, 60, 11,163,231,178,244,211,171,188, 40,193, 70, 84,149,225,202,225,152, 84, 73,
-206, 31, 12,169, 44, 12,243,130,188, 76, 57,179,210, 96,171, 25,163, 29,140,179,138, 72, 66,169, 45, 89,165,201, 45,212, 35, 95,
- 60, 21,214,206, 70,228,133,241, 48, 25,140,195, 8,141,182, 18, 37,194,116, 64,151,212,141, 34, 21,150,178,178,148, 78,147,134,
-221,143,156,130,118,132,155, 14,154, 66, 81,231,110, 49, 46, 76,119,205, 83,125,138, 96,158, 49, 32,165,152, 23,152,224,139, 78,
- 28,141,229, 99,172,125,230,183,112, 56,132,231,174,238,121,154,160,128, 74,143, 24,246,187, 28,223, 92,103,235,220, 42, 55, 47,
- 14,216,186,237, 4,137,108,160, 26, 29,138,209, 16,131,100,167,119,192,185, 7,239,225,206,226, 46, 30,222, 27,145,226,216, 31,
-246,121,102,255, 2,143,236, 61,205,118,214,167, 48,150,152, 9,157,180,134, 82, 30,221,173, 3, 79, 63,215,134, 67, 83, 98,173,
- 65, 74, 69,170, 20, 19,171,137,132, 96,179,150, 18,219,132, 87,158,219, 68,152, 58,227, 73,201,176,212, 24, 4, 78, 73,246,243,
-130,155,121,159,145,246,230,196,227,173, 51, 68,197,184,192,138, 26,169,148,140,199,125,114, 33,121,233, 15,124, 29,246,137,167,
- 41, 62,249, 81,220,131,175,166,115,230, 12,199, 14,110,178, 61,233,115,230, 5, 47, 66, 23, 26, 40,104,174,174, 50, 58,232,209,
-191,254, 12,171,167,110, 99,112,120, 19,168, 88, 61,121, 6,107, 38, 76,186,187,124,222,183,253,248, 44, 58, 52,171,124,238,176,
- 49, 62, 14,213, 26, 67, 81, 57,170, 66,211, 72,155, 68,171, 53,110,124,242, 73, 26,141, 38,119,157, 56,194,222,238, 13,206, 45,
-111,241,200,149,235,152,213, 45,190,241,219,223,206,206,238, 14,173,163, 27,196,245,132,237, 27,123,232, 75, 87, 24,246,199, 20,
-149,161,214, 92, 34, 93,170,211,237, 29,112,216, 29,178,185,190, 70,119,239,128,222,225, 33, 7,251, 93,174,119,135, 92,185,177,
- 71,167,190,201,126,191,224, 35, 79, 62,199,249,103,158,161,187,115,153, 63,187,222,230, 11, 95,190,133, 56,113,138,216, 88, 38,
- 7,123, 44, 35,168, 63,224, 15,117,115,254, 9, 92,103,157,201,246, 13,198, 2, 58, 27,235,222, 62,165,148, 63,208,197,162,101,
-197,143,187,165,144,136,122, 11,147,103,216, 60,247, 21,172,209,216,188,224,216,231,188,146, 31,252,202, 55,248,208,154,238,144,
-189, 39,158, 68, 40, 69,125,109,157,165,141, 53,212,164,242, 93,139,115,184,202, 50,220,221,131, 34,103,251,217, 11,116,247,123,
- 16, 69,108,221,113,154, 99,119,222, 65,173,213, 34, 90,234, 80,228, 19,162,213, 53,127,227,231, 57,228, 5, 20, 57,145,177, 84,
-163, 1,201,225, 30,175,254,201,159,227,195, 47,126, 25,175, 62,182,206,239,252,236,187,121,205,155,223,192, 93, 95,244,185,252,
-231,239,252,126,190,249,123,222, 66,229, 28,137, 49,184,162, 96, 60,232,163, 77,197,164,187,195,228,176,143, 72,235, 36,233,152,
- 40, 85,216,188, 32,106,213,112, 81,132, 19, 18, 41,195,142, 87, 41,132, 10,177,145, 74, 33,100,140,140,124,144,133, 19,218, 7,
-193, 40,233, 71,155,206,120,239,247, 52, 50,212, 4, 91,218,244, 80,178, 94,167, 96,243, 2, 83, 25,172,213,184,224,151,245,124,
-144,138, 42,203,144, 66,249,145,164,211,216, 73,134, 29, 15, 40,119,119, 41,119,246,169,122,125,156,246,202,229, 42,235,134,156,
-110, 15,238, 64, 42,164,244, 15,104, 34,131,179,106,230,163,198,201, 89,212,232,148,243,230, 57,219,206,219,141,166,251,254,127,
-130, 36,151,237,109,211,253,196, 71, 80,105,157,120,117, 19,226, 6,205,227,167,153, 28, 14,145, 82,177,247,212,163,212, 19,201,
-119, 63,126,147,107,250, 26,167, 54,150, 89,111,166, 92,233,102,252,204,255,252, 45, 62,240,177,199,248,161,159,124, 7, 71, 86,
-215,184,124,169,224,201,254,144,222,225, 1, 47,122,243,175,241, 89,175, 58,197, 51,239,252,102,110, 60,242, 39, 11, 7,112, 16,
- 18,205,215,231, 76,237,209, 56, 49, 87,159,107, 55, 35,255,201,160,222,118, 97, 98, 48,101,176, 76, 31,150, 98, 58,207, 55,206,
-115,221,157, 67,204,152,235, 83,203,226,124,226,237,228,130,130,120,250, 62,172, 91,200,120,247, 34,187, 25,254, 75,122,180,108,
- 20,135,174,123,150,240,230,192, 14,103,107,111, 25,205,237, 70,211,215, 83, 42, 20, 43, 66, 34,155,171, 52,206, 61, 28, 2,159,
-220,194,225,206, 92, 20, 55, 5, 6,133,145, 46,214,132, 67,116,238, 13,116,186,240,157,177, 89,132,207, 72, 16,202,111,249, 85,
-144, 83, 11, 9,198, 95,147,200,200,179,223,141, 3,157, 97,116, 53,179,117,138,194, 66, 36,176,149,241,143, 7,227,176,145, 35,
- 10, 33, 66, 70,107,226,122, 43, 48,200, 35,156,244,110, 19, 27,190, 47, 39, 45, 82,251,229,177,197,122,241,102,173,134,197,139,
- 92, 69, 90, 39,219,223, 1,107,137, 27, 9, 81, 42,201, 46, 95, 36, 15, 96,164, 10,168, 42, 75,175,176,172,180,107, 76,122,222,
-133, 97,140,161,211, 72, 25,230, 21,121,128, 23,201,160, 53, 81, 82, 80,139, 36,251,147,146, 90,164, 48,165, 97, 96, 43,122,133,
-161,157, 72,180,129,237, 94,198,206, 32,167, 21, 43, 54, 59, 77, 42,231, 80, 82,178,148, 40, 26,177,162,151,107, 70,165,246, 35,
-120, 55, 93, 22, 57, 74,231,131,168,148, 16, 36,210, 23,136, 54,128,177,198, 37, 92,177, 21, 35, 5, 43,177,163, 35,131,112, 82,
-204,147,254,102,102, 10, 57, 95, 4,137, 32,174, 20,145,215,149,168, 16, 59, 60, 53, 21,204,177,175, 65,172,233,252,239,169,175,
-157,100,227,101,223,196,225,176, 98,104, 37,251,215,187, 24,107, 88, 61,186, 68,189,153,240,216,223, 62,193,198,250, 18,141,206,
- 50,166,172,177,116, 36,161, 86,111,208,187,153,177,212,105, 80,182, 87,105, 52, 37, 85,166,217,219,185, 65, 81,106,164, 45,121,
-110,127,159,227, 39, 78,241,210,141,101, 30, 58,243, 18, 18, 7, 55, 6,135, 92,175,174,240, 87,151,159,224,234,160,135,148,146,
-134,138, 89, 77,235,220,222,108,178, 25,183, 57,190,180,201,122,125, 25,107, 13, 7,163, 33,107,205, 54,105, 11,122,195, 49,245,
- 52,225,198, 65,143, 36,105,208,138, 29,207,246, 14,137,180, 98, 47, 27,147,198, 45,180,200,105,171,136,213,250,105, 34,149,214,
- 16, 86,115,184,125,157,110,175,199,145,163, 91, 60,146,103,156,155,140,217, 60,121,140,242,111,255, 18,115,230, 78,142,223,251,
- 50,250,143,127,144, 82, 9, 38,131, 46,131,131, 79,113,228,204, 61, 44,173,175,210,218,120, 25, 85,214, 99,253,248, 50,221,189,
- 27,104, 51,228,200,169,123,121,248,203,190,117, 86, 77, 77,138,146,178,208, 20, 89,137,174, 42,162, 88,129,182, 68,145, 64, 73,
- 77,111,208,162,117,100,133,157,143, 61,197,206,206,132,194,122, 72,194, 7,174,221,160,185,121,138,175,250, 23, 95,207,216,228,
-196,157,101, 42, 20,105,189, 78,167, 35,217,126, 46,135,180,198,210, 82,141,209,104,204, 96, 52,166,127, 56,224,250, 94,223,123,
-234, 15, 45,127,247,228,121,142,172,172, 80,100,125,122,221,155,252,245, 71,246,185,227,196, 17,234,162,224, 96,251, 57,234, 42,
-227, 39, 63,118,141, 7,143, 88,148,117,196,181, 58, 34, 78, 40, 75,203,201,187, 95,140, 77,154,252,250,119,255, 87,190,250, 87,
-127,156,246,169, 99,180, 95,112, 15,140,250,129, 57, 30, 45,220,248, 83,210, 90,160,188, 9,129,209, 6,221, 31, 6,180,170, 68,
-196, 49,209,234,138,159,121,222,188, 65,179, 86,131, 83, 43,116, 78,159,246,213,183,177,208,235, 97,179, 46,165,241,234,109, 93,
-104,210,118, 27,219,104,114,250, 5, 29,110,171,140, 7, 91,196, 10, 42,141, 30, 14, 17,113, 68, 92,171,133, 67,209,248,135,117,
- 44, 16, 81, 29,161, 53,205,219,142, 19,111,172,147,191,255, 47,121,235, 47,253, 44,191,254,245,223,206,195, 71, 86,248,179,223,
-248, 61, 54, 30,253, 4, 15, 55, 90,168, 86, 29, 65, 9,174,134, 72, 83,172, 54,152,202,144, 68,142,253,243,207,176,182,126, 28,
-181,179,139, 41, 13, 66, 89, 92,101,144,169,242,221,139, 84,168,216,195, 52,100, 82,247, 62,116,231, 61,187, 34,242,163, 72, 39,
- 67, 32,134, 46,189,109,204,122,175,188, 11, 7,187,127,200, 78,187,114,131,201,114,108, 89, 98,139, 10, 93,230, 94, 8, 63,243,
-251, 18,124,241,194,119, 82,206, 98,198, 19,220,100,136, 25,140,176,253,204,199, 57, 52, 86,144,169, 34,105,181,137,234, 9,149,
-177,200, 68,249,236,239, 48, 5,240,118,163,208,186, 58,231, 21,229, 34, 4, 64, 44, 60, 60,188,194, 86,254, 3,114,203, 63, 26,
-188,251,137, 74,164,200,158,254, 4,247,124,247,187, 56,184,182,203,205, 75,151,217,217,221,229,218, 83,187, 12,199, 19,158, 61,
-184, 73,146, 46,241,103,159,190,198, 91, 94,250,124,126,230, 39,127, 24,217, 92, 65, 38, 49, 66, 68, 60,242,190,255,143,207,254,
-250,239,228,191,191,235, 23,248,150,111,249,122, 78,180, 98, 30,185,178,207,243,207,222, 78,191,183,203,239,253,222,144,151,127,
-251,187,249,188,239,235,241, 55,175,123, 0, 83,228, 11, 8,216,169,117, 39,104, 29,166,239,105,138,162, 93,196,194,134, 46,102,
-218,149, 79, 61,241,146,233,231, 49, 79, 68,115,102,225,207, 46, 44, 42,167, 10,250,233,131, 86,168,105, 22,246,212, 87, 46, 22,
-124,231,204, 56,237, 8,129, 12,114, 49,103,167,194,192,121,231, 37, 3, 17, 76,170, 91,131, 92, 84, 34, 49,198,205,240,185, 66,
- 56,150, 95,241,166, 25, 55, 96,190,192, 22,115, 11,192,244, 30,181,102, 38,138,196,234,105, 30,172, 47,204,103, 45, 96,216,157,
- 75,137,140, 19, 76, 85,122,145,188,209,222,182,102,181,167,190, 9, 17,212,240, 18,135, 9,201,132, 17, 72,139,209,165,239,238,
-141, 15, 62, 18, 82,225, 68,229,215, 83, 74,225,148,242, 91, 29,225, 97, 41, 82,197,190,192,136, 20,166, 44,252, 90, 43,173,225,
-202, 18, 45, 53, 42, 78,166,251, 14,144, 9,174, 44,177,177, 68,232, 18, 85, 75, 65,197, 52,218, 49,205,213, 85,246,254,254, 81,
- 34, 97,209, 66, 33, 36,228,133, 65, 24, 71, 77, 73, 90,141,132, 81,158, 19, 71,138, 81, 86, 96,172,223,151,207,102, 26,129,162,
- 86,134, 9, 70,105, 12,147, 80,116,215, 99,197,168,244, 12,135, 78, 44, 16, 66,177,147,105, 46,143,122,156, 94,105, 97,170,138,
- 49, 16, 73, 65, 43,150, 40, 17,209,203, 43, 42,227,166,112, 94,106,193,255, 58,195, 70, 79,157,133, 64,238, 28, 74, 67, 75, 56,
-198, 62,175,138,166,128,250, 20,223,176,248, 87, 57, 93,249, 4, 65,165, 80,120,119, 75, 56,180, 9, 78, 12, 43,131, 49, 34, 16,
-230,156,244, 60,136,135,223,246,110, 62,245,232,115, 92,190, 62,166,204, 44,234,176,164,210, 35, 90,203, 13,164,148,236, 93,238,
-161,164,229,200,169, 83,232,178,164,202,156,119,237, 68, 13,154, 43, 9,147,193,128,173,179, 91, 28, 92, 61,100,251,194, 5, 92,
-165, 88, 90,235,112, 80, 56,238,190,227, 54,150,214, 91, 52, 59,138,107,207,237,225, 74,203,102, 35,166,186,226,248, 87, 15,189,
- 12,164,166, 24, 86,116,150, 26, 92, 59,220,231,206,187,215, 57,255,169, 93, 80, 21,157,173, 26,174,140, 16,106,204,206,160,143,
- 28, 59,164, 90,193, 85, 41,133, 53, 92, 31, 14, 88,173,173,114,119,103,131,237,108,151, 35, 13,201,197,201, 54,210,149,156, 89,
-123, 53,131,106, 66, 52, 25, 31,210,108, 29,197,202, 33,155, 39, 78,210,219,189,206, 53, 35, 57,123,114,157, 39,222,253, 39,156,
-124,203,107, 57,254, 69,175,163,251,129,247,113,239,201,179,124,250,230, 53, 76, 26,177,122,226, 46,134, 7,219,148,147, 62, 42,
- 78, 73,219,171, 88, 36,157,245, 85, 54, 78,221,203,185, 87,127, 5,206, 57,186,131, 9,217, 56,167,158, 74,198,227,146, 86, 43,
-161, 44,253,158, 50,173,123,232, 66, 49, 49, 76, 38, 25, 89,121,134,214,201, 79,210,188,126,133,131,155, 61,164, 84,220,249, 25,
-159,205,179,251,154, 23,188,244,126, 14,179, 18,153, 38,140, 6, 99,226,162, 68,138, 8, 13, 68,145, 67, 23, 37,101, 53, 70,202,
-156,173, 35, 41, 31,122, 98,207, 91, 90,148, 98,216, 31, 48,234, 31,242,216, 19, 79,177,185,210,160, 55, 46, 24,142, 70,232, 73,
-198,234, 82,139, 81,175, 75, 15,120,235,255,251, 36,191,240, 26,139, 56,210,160,117,242, 52,217,246, 69,196,100,200, 71,254,237,
-191,229,171,127,246, 95, 19,103,125,116,149, 19, 9, 59,139, 85,117, 73, 26,238,132,169,224,107, 33, 64, 34,142,176, 89,134,213,
- 21, 42,138,112, 81,140, 76,107,200, 78,123,134,166,116, 82,133,216, 79,227, 51,223, 39,149,183,175, 53,154, 72,145, 19,201, 8,
-149, 56, 72, 35,255,170,193,106, 19, 53, 26,168, 70, 72,124, 10,147, 2,161, 66,135, 81, 26,168, 74,175, 70,119, 22,213,106, 34,
-147,148,218,210, 10,160, 88, 63,125, 55, 47,122,227,159,243,193,223,253,115, 30, 62,185,198, 31, 93,185,198, 43,163, 26,227, 43,
- 55,125,124,109,200,145,182, 14,210, 90,130,137, 12,187,231, 31,101,253, 85,255, 12,241,228,199,188,115,207, 74,162,162, 68, 52,
- 91,200, 72,161, 66,103, 46, 3,123,221,227, 48,167,231,158, 12, 65, 22,126, 76,105,221,188,155,117,214,191, 87,111,133,210,158,
-113, 95,149,152,188, 66, 23, 5,182,242,224,152,169,218,121,209, 23,110,157, 9,208, 62,135, 43,114,156, 46,113,113, 3, 26, 22,
-181,169,136,140, 69, 68, 49,170, 86, 71, 53,235, 8, 83, 81, 7,116,150, 83,185,128,139, 53, 37,200,186,239,114, 3,157,207,119,
-131, 54, 32, 97,131,245, 77, 42, 16, 33,220,101, 58,135,175, 55,254,183, 7,250,116, 71,252,161,223,255, 99,158, 59,127, 13,153,
- 56, 6,186, 98, 52, 25,113,181,219, 99, 55,203, 56,204, 51, 62,121,245, 6,239,252,146,207,228,159,191,229,205,108,239,238,209,
- 58,162,136, 92,155,193,254,117, 30,123,251,119,243, 7, 15, 39,124,245,135, 63,200, 75, 94,241, 50,238,187,227, 20,198, 70,252,
-205,123, 63,194,233,115,103, 57,113,246, 40,105,170,168,109,110,242, 69, 31,218,225, 67,111,251, 10,246, 63,240, 87, 51,165,249,
-172,193, 14, 7,178,196,211,231,164, 10,108, 25,175,110,155,251,117, 23,130, 86,230, 72,218, 41, 78, 54, 40,209,197, 20,155, 46,
- 22, 24,239,211,115,113,145, 54, 39, 8, 89,170,222,191, 29, 58,164,233,252,120, 74,241, 18,211,181,134, 12,187, 81,225, 31,254,
-216,169,170,125, 30, 74, 99, 29,243,208, 27, 49, 21, 78,250, 76,118,107, 45,237,151,188, 62,184, 36,236, 2,116, 71,131, 75,110,
-245, 46,217,194,127, 19,118,150,181, 25, 10, 6, 21,166, 11,118,161, 75, 23, 65, 91,229, 49,182, 84,101,248,121, 28, 44,124,190,
-131,183,166, 64, 8,239,224,112,120,162,155,173, 12,186, 42,188, 0,211,132,240, 35, 33, 23,132,149, 97, 90, 98, 12, 70, 23, 33,
-192, 68,250, 41, 86,158,249, 80,151, 50,243, 69,150,246, 66, 60,103, 43,168, 45, 5, 17, 86, 4, 56,186,207, 93,228,226,251,222,
-139, 41,199, 36,245, 58,113, 35, 97,220,237, 49,182,142,102, 36,153, 84,146, 90,236, 40,180,134, 88, 81,139, 99,162, 72, 50, 28,
-103, 44,213, 98,198,149,166,168, 12,145, 12, 49, 41,161, 40,170,130,224,179,212,150, 68, 10,250,149, 33,215,126, 58,147, 42, 65,
-229, 4,185,246,228,187,205,118,130,115,176,181,178,196,181,110,159, 81, 97,102,250,141, 86, 45,102,156,235, 96,189,156,138, 32,
- 37,105,152,188, 68,210,175,125, 42, 7,165,131, 84,192, 64, 7,179, 2,248,164,180,112,203, 41,235, 80, 74,204, 60,234,206, 57,
- 98,233,141,180, 83,106,227,212,192, 40,220, 66,182,122,112, 34, 78,215, 85,103,191,226,109,156,127,242, 18,249, 56, 98,233, 72,
-141,124,100, 24,119, 71, 68,113,141,221,107,125, 58,171, 37,147,193,144, 59,159,119, 23,147,126,159,230,202, 50,235,103, 54, 57,
-184, 56,164, 24,107,156, 21, 52,150, 86,217,191,176,207,104, 52,160,185,122,156, 19,103,182, 80,105,201, 90,239, 24,231,159, 60,
-143,209, 21,135, 59,138, 60,155, 96,156,132, 82,176,177,185,193,133,107, 87,184,227,212, 81,150, 55,235,236,223,232,114,229,224,
- 38,141,231, 18,242,210,208,106,214,217,187, 92, 34,100,201,141, 97,151,165,165,148,213,149,132,114, 20,113,163,219,231, 70, 62,
-224,174,213,219, 56,200, 14,209,194, 67,141,182,179,125, 98,167,121,213,201,215,114, 51, 43, 88, 74,214,136, 6,189, 30, 78, 53,
-121,230,233,139,220,251,192, 41,150,143, 30,167, 93, 22,188,111, 80,242,166,159,254, 30,220,214, 73, 62,246,109,223,193,185,239,
-251, 94,104, 44,113,223,198, 26,127,247,145,143, 80,196, 5,237,229, 99, 12,122,219, 36,174, 66,119, 51, 58, 71,206, 96,227, 77,
-206,189,234,245,104,107,216,219, 31,208, 61, 24,145, 38, 17, 84, 33, 9, 8, 77, 61, 73, 65, 56,198,227,194,251, 1,157, 65,151,
- 37,214, 90,186,171, 47, 39,127,240, 14,218,119, 14,104,201,132,131,253, 3, 30, 90,118,200,118,147,196,193,112, 98,200,171,156,
-201,245, 17, 50, 74,208,249,132, 98, 82, 80, 26,195,254, 65,159, 27, 55,119, 57,127,237,128,165, 86,131,188, 28,241,201,103,119,
-176, 85,193,184, 42,168,181,106,152, 42, 71,233,130,222,225, 77,180, 83,180,154, 41,166, 92,103, 83,246,216, 27,245,120,195,251,
- 7,252,187, 47,251, 28, 70,127,243, 55, 28, 22,130,131, 71,222,202,235, 91, 9,241,242,231, 50,217,126,206,251, 64, 99, 31, 62,
-162, 76, 16,124,153,234, 86, 34, 74,128, 54,152,202,251,172,163,122, 13, 89,171,249,174,176, 86,131, 56,193, 69, 65,253, 45, 85,
-240,242, 26, 92, 81,131,184, 4,215, 70, 58,129, 84, 49,241, 34,107,220,186,144, 15, 62, 37,171,137, 25,226, 82, 40, 21, 30,232,
- 50, 0, 92,162,160, 50,118,115,235,142, 21,144,214,112,163,125,190,248, 55,126,159,115, 95,254,219,252,252, 27,190,129,213, 52,
-226,209, 70,202, 23,252,202,123, 16,223,243,118,232,238,123,232,131,117, 40,169,208,166,226,240,218, 69,172,250, 66,164,130,164,
- 38, 57,184, 62,230,196,221,117,164,242,169,105, 72,133,136,164,255,108,144, 51, 88,139, 23,128,105,108,145,123,207,254,140,197,
- 24,192, 30,186,194, 21, 30,135,107, 75,127,144,235,178,240,234,122,235, 66,218,221, 60,117,204,137,249, 3, 90,104,129,147, 97,
-116,175, 34,207,209,215, 26,153,214,145,113, 50,139,207,116, 82, 98,176,136, 56,198,140, 39,200, 72,226, 74, 21,168, 97, 14,106,
-202, 11,136, 76,229,105,126, 1, 87,234, 45, 69, 11,169,108, 74,249,208,148,112,200, 11,149, 44,168,221, 93,240, 82, 91,250,187,
-219,252,245,187,126,149,215,255,252, 47,242,139,111,253, 42, 70, 7,123,236,220,216,230,218,225,128,237,113,206,213,113,206,137,
-229, 21, 94,124,108,153,251,206,220,198,133,103,158,225,200, 93,119, 97,141,161,214,170,243,115,111,249, 17, 62,231,117, 45, 94,
-254,203,125,206, 54,224,189,127,251,126, 78, 31,125, 3,171, 53, 73,243,182, 77, 70,147, 49,231,182,154,212,133,224, 19,151, 5,
- 23, 63,252,113, 94,248,230, 31,166,247,241, 15, 96,242,108, 70,132,147, 98,193, 2, 36,189,240,111,150, 3, 62, 77,181,114,183,
-142, 49,157,155,219,132,164, 18,225,165, 22,114,206,167,214,110, 59, 23,216, 17,246,155, 11, 73,227,225,225,189, 80,228,216, 57,
-150, 83, 50, 71,193, 10, 57,127, 31, 42,158, 94,207, 50, 36,174, 5,183,128, 5, 25,232,110, 18,225,159,218, 11, 73,115,233,233,
- 23, 16,175,157,192,185, 17, 66, 24, 15,147,177,121,168,175,245,172,128,156,237,213,103,211, 30,237, 51,205,157, 70,218,153,185,
-206, 95,103, 81,140,171,138, 25, 19, 94, 68, 53,108,158, 99,171, 50,164,167, 37,193,238, 24, 32, 55,210, 97,116,225, 69,157, 85,
-229, 63,150,108, 20,240,176, 2, 75,132, 80, 17,214,250,213,143, 53, 26,167, 53, 50,138, 61,215, 34,146, 8,107,188,141,114,218,
-101, 86,149,183, 30, 90,129, 49, 21, 74,198,216,170,196,165, 77, 76, 85, 33,156,101,220, 61,224,224,202, 85, 82,105,216,184,239,
- 36,221,167,158,162, 55,240,137,115,186,210,164, 50,193, 68,145, 71,217, 23, 37,170, 22, 35, 42,168,199, 49,145, 18,164, 90, 81,
- 88, 67, 30,166, 48, 38,180,194, 54,220,115, 82, 64,101, 45,101, 56, 80, 3, 37,192,239,198,149, 96, 57,137, 89,174,215,105,165,
- 9,113,146,240,226, 59,215,120,252,226, 37,118,179,210, 75, 21,173,161, 30, 43, 74, 99,209,193,218, 38,132,165, 52,222,187,206,
- 64,133,124, 0, 0, 32, 0, 73, 68, 65, 84,238, 28, 68, 66,134,195,216, 49,177,142, 36, 72, 29, 12,130, 84, 8,164,199,230, 7,
-107,219,130, 53, 82, 44,136, 55,109,128,209, 44, 58, 49,166,197,235,172, 85, 87,196,141, 58,162,113, 47,113, 62,192, 13, 53,221,
-235, 37,181,182, 35,203,198,172,109,181,216, 58,115,130,195,189, 46,107, 71, 78,161, 75,205,218,230, 49,210, 90,139,241, 94, 69,
-231,228, 38,147,221, 33, 85,165,169, 74,197,242,177,219,200, 46, 62,131,173, 52, 87,206,111,211, 94, 90, 66,169,152,229,205, 19,
-108,108, 52,153, 12, 10,246,119, 98, 58, 91, 41, 34,214,148, 99,104,181,150,120,230,252, 85, 38, 58,167,157, 46,113, 91,103,139,
-222,112,194,198,122,135,178,212, 52,150, 28,245,250, 50,133,214,236,116,187,212, 88, 70, 87, 21, 74,212,184,107,233, 52,224, 24,
-150, 3,138,202,177,159,103, 44, 71,142,135,182, 94,199,176,170,144,148,212,136,137,202,194, 80,140, 71, 36,181, 22,189, 94, 70,
-164, 44,141,118,131, 88,165,188,231,143,255,130,211,151,118,184,253,141,175,161,105, 51,116,225,200, 91, 75,188,228,133, 15,242,
-247, 31,255, 40, 69, 49,166,189,188,133, 21,150, 70,107,141,193,254, 77, 62,251,155,127,140, 82,107,250,195, 17,187,219, 55,169,
-215,107, 40,235,152, 76, 42,242, 73, 73, 99,109,137, 40,130, 97, 63, 15,247,166, 35,207, 43, 76,128,209,235,108, 72,156, 68,180,
- 55,150,105,164, 49,245, 68,240,188,123,238,240,157,252, 56,163,187, 63, 96, 56, 30,121,226,143,174, 24, 77, 74, 31, 34, 51,201,
-233, 13, 51,158,124,238, 6,182, 28,211,235,245,217, 61,136, 25,101, 99, 38,163, 9,121, 54,194,106, 67,166, 4,251,131, 9,105,
-173, 70,165, 75, 42,145,224,132, 35, 51, 17,159,251,138,175,225,173,159,117, 39,255,227,255,250,175, 60,252,194, 23,178,251,220,
- 53,234,249,132, 87,124,207, 55,145, 95,189,132,177,190,107, 52,210,143,241,234,203,203, 62,241,107, 74,223,176,198,123, 97,173,
- 7,161, 40, 21, 33, 83,137,104,119,112, 81,120, 18,198,137,207, 87, 78,147, 89,136, 6, 40,136, 44, 46,173,135,238, 33, 28,198,
- 85,229, 15,112,227,115,217,133,244, 54, 53,226, 38, 68,211,177,182, 13, 62, 84, 59,135,147, 24,227, 59,127,107, 64, 79,227, 41,
- 67, 44,216, 56,247,140,233,103, 30,227,206, 23, 62,204,127, 50, 25, 79,252,220, 79,240,235,111,255,113,126,186, 56,228, 55,222,
-255, 65,162,135,239, 67,137,132,164, 81, 11,170,114,112,122, 76, 81,106,162,180,230,109,110,135, 61, 78,218,101,172,177, 40,235,
- 17,150,222,178,164, 17,178,156,141, 56,173,212, 88,230,156,250,121,116,231,252, 48, 55, 69,137, 41,125,134,187, 49, 85,128,122,
- 4, 16,141,156,166, 98, 5,107,144, 83,254,251,181,122,142,126, 50, 94,105, 46,164,223,157, 11,169, 60, 81,142,128, 94,117, 38,
-216, 87, 44,198,106, 52, 96,148,240,153,239,214, 97,202, 18, 21, 55,102,113,140,126,141, 16, 7, 27,152, 87,215, 11,229, 95,215,
-151,252,254,128,135,197, 49,180,152,249,191,255,231, 79,253, 56,210,165,124,240,151,126,147, 55,253,251,159,230,155, 31,184,159,
- 27,192, 94,169,233, 21, 21, 75,181, 58,159,188,177,199,119,188,244, 44,207, 92,190,204,243, 86, 87,200,134,125, 84, 28,177, 55,
- 30,242,170,175,253, 82,222,243, 35,239,224,237,231,234,236, 21,240, 23, 23, 46, 82,142,123, 92,187, 52, 70,173, 29,229, 5,247,
-220, 77,173, 22,243,251,191,253, 62,126,237, 63,125, 39,181,193, 37, 62,122,152,241,146, 99,235,252,192,241,153, 61,119,182, 77,
-118,139,201, 86, 11,200,216,105, 40,134, 12, 29,243, 52, 89,205,163, 61, 23, 66, 94,108,136, 81,117,254,247,218, 50, 80,227,194,
-200,197, 46,236,238,103,201,129,102,186, 7,159, 10,249,230,234,100, 23,152,239, 50,140,199,167,133,135,213, 46, 56,207,252, 74,
-192,105, 17, 6, 37, 30,210, 35,165,167,102, 89,227, 41,137,126,130,238,104, 61,244,197, 64, 21,118,233, 11, 28, 80, 91,205, 15,
-113,100, 80, 78,121,239,184,239,170,213,108,131,226,215, 62,218,127,237, 40, 9,140,113,231,139, 72,194,107, 9, 48,122,130,136,
- 82, 63,189, 80, 9, 70, 23,254, 62, 20, 18, 87,100,161, 64,183,152, 60,243, 52,193, 34, 3, 43, 80,181,166,159, 36, 9, 31, 82,
-100,170, 2, 81,105, 68,195,239,211,197,116,106, 37,101,112,225, 73,255,107,186, 64, 70, 41,200, 8,213,234,120, 59,105, 57, 65,
-168, 24, 51, 24,161,164,164,204,198,104,109,168,213, 18,134, 31,122,156,126,229,139, 85, 17, 37,104,237,197, 14,173, 36, 69, 43,
- 73, 85,150, 56,225,136, 99, 65, 36, 37,214,249, 66,187,210, 6,107, 28,198,120,253,103,101,236,212, 52, 65, 97,230, 3,111, 41,
- 5,145, 16, 52,106, 94,208,181,214,172,179,181,218,225,200,218, 42,107,157, 21, 78,158, 62,197,221, 71, 54,248,163, 15,255, 61,
-215,243,146, 88, 64,161,141,247, 78, 71,114, 6,245, 81,211,226, 47, 32,100,173,117,212,149, 96, 57, 17,172,199,138, 78,228,104,
-135,191,186, 72,121,172,181, 13,133,170, 10,186, 6,107,195,106,198,205,181,141, 11, 89,132, 88, 17,190,206,116,192,103, 53,247,
-127,195,143,176,115,121,128,139, 18,210,142,164,234, 27,198,189,156, 40,174,177,119,229,144,237, 11,215, 88, 94, 91,103,237,220,
- 49, 76,233,169,125,113, 35, 69,198, 13, 92, 1,189,131, 67,150,150, 55,168, 92, 73,218, 20, 68,212, 32,177, 72,231,168, 47,215,
-105,172, 75,184, 98,217,221,238,145,103, 3,138,145, 99,247,146,225,216,185,117, 90, 13,201,232, 80,179,220,222,224,244,102,155,
-245,147,109,178,195,146, 71, 63,241, 52,166,148, 92,218,189,206,169,181, 19, 12,134, 25, 59,195, 30, 43,141, 13,198,147, 9,251,
-213,128,219, 86,155, 52,235,203,124,250,242, 51,220,156, 12,144, 98, 64,172,114,238, 95,125, 41,121, 89, 98,170, 62,206, 84, 40,
- 85, 39, 58, 56, 24, 98,172,100, 82,104,174, 93,217, 99, 60, 41, 57,178, 28,113,244,212,109,220,108,173,178,186, 89,240,188,151,
-127, 22,215,126,244,135,168,127,213,215,179,182,188,204,248,176,224, 37,159,255, 37, 60,250,193,247,115,233,234,167, 56,113,231,
-253, 12,246,118,120,213, 55,189,131,172, 40, 40,171,130,108, 48, 36, 77,107,232,178,100, 92, 84, 36,161,233,233,247,135,196,177,
- 66,196, 2,165, 45,165,177, 8, 97, 81,145, 63,236, 90,237, 58,181, 68,209, 61,236, 99,132,131, 90,157,214,230, 26,195,225,152,
-157,221, 30, 7,221, 46,131,193,136,122, 45,101, 56,202, 73, 19,135,116,146,189,110,151,231,174,237, 51,201,114,106,162,228,142,
- 83, 71,248,216, 99,207, 80, 25, 77, 82,175,129,140,201,178,140, 66, 66, 18, 69,228,147, 49, 74,197,216, 74,179,177,118,132,215,
-189,230, 53,124,230, 3, 39,184,248,222,255, 78,189,179,201,229, 27, 7,196,105,157, 77,233, 48,151,175, 80,184, 2,116,137,170,
- 53,112,147, 17, 66,249,209, 63, 69,129, 18, 62,156,193,155, 4,195,147, 43,173,249, 10, 63, 78,124, 68,104, 80,178,186, 40,116,
-230, 34,160, 71,171, 18,116, 17, 60,177, 22,202,106, 30, 26, 34,196,220,138, 83, 75,253, 78, 58, 12, 87,157, 49, 48, 30, 67, 89,
- 32,180,159, 8, 56, 29,230, 86, 82, 5, 69,173, 67, 37,113, 32,113,133,196, 40,169,112,148, 96, 71,136,120, 4, 7, 7,220,255,
-133,175,227,167,190,245,123,121,242, 39,126,148, 15,252,143, 63,228,243, 63,227,133, 56, 99,144, 72,226, 36,246,112, 6, 11,195,
-253,125, 54,154, 77,210,218, 16,147,151,232,108,140,176,210,135,172, 52,234, 8, 93,133, 67, 84,207,118,207, 66,120,150,187, 51,
- 83, 40,143,127,239,214,104, 76,158, 99,242, 18, 83,149,232,170, 12,106,224, 41, 60,213,112,107,250,136,223,201,139,105,152,139,
-155, 67, 79, 32, 36,109,169,128, 86,181, 65,192,101,237, 45,235,111, 87,105,132, 82,225,225, 32,253,238, 55,196,200, 98,116, 64,
-127, 26, 68, 20,205, 58,253,106, 50,161,182,188,238, 5, 82,211,157, 38,206,255,157,222, 98, 97, 51, 84,253, 46, 7,191,250,107,
-124,237, 79,255, 23,222,241,218,215,146, 77,198, 36,117,193,227,123,125, 76,163, 65,191,170, 24, 25,195, 74, 84, 99,185, 22,241,
-244, 94,159, 70, 43, 97,112,243, 6,173,122,138,210, 21,173,141, 45, 62,227,203,223,200,133,167, 47,241,137,223,250, 45, 46,200,
- 58, 95,248,138,135, 57,126,242, 12,175,107,103,156,125,248, 69,212, 86, 59,168,180, 78,241,204,111,242,219,223,242,121,156,251,
-174,159,226,217, 79, 61,198, 93,247,190,152,222, 70,147, 78,228, 66, 92, 41,225, 32, 14,226,178, 41,124, 67,120, 18,157, 92, 64,
-100,138,127,208, 89,179, 16,185,234, 66,177, 56,157, 96,203, 25,176,134,224,120,152, 69,100, 48, 93, 77,139,104, 14,174,145, 98,
-129,255,110,167, 7,124, 24,216,155,224,127, 23,115,127,188, 23, 54, 5,103,194,212, 2, 24,136, 55, 86, 76,209,182, 30,218, 40,
-163,136,100,243,204, 34,124, 62, 88,213,170,185, 15,157,192,159,189,133,209, 31,242,207, 77,128, 21,217,160,151, 8,133,251, 60,
- 58,207, 67,143,172,246, 33, 64, 82,133,140,135, 56,153,125,131,118,202, 89,144, 18,103,236, 12, 53,108, 60,223,212, 23, 83, 85,
-133, 49, 5,194, 73, 4,222,174,134,148,200, 90, 13, 21,165, 65,207, 80,161,162,122,192,159,250,201,165, 4, 34,229,131,153, 76,
- 81, 16, 55, 58, 62, 73, 80,151,104, 99,184,249,196, 71, 41, 39, 57,235,155, 29,184,118,131,107, 87,119, 81,105,141,200, 57,164,
- 17, 51,228,176,136, 36, 18, 75,187, 85,103,191, 59,198, 9, 63, 21, 74, 19,137,205, 29,147,202, 80,153,208,143, 56,139,118,222,
- 79, 31, 71,146, 76,251,251, 45,146,130, 72, 72, 34, 33, 56,218,106,177,181,182, 76,103,169, 77, 4, 36, 66,178,180,178,140,238,
-119, 89, 46, 38,188,225,142, 77,222,123,249, 38,143, 13, 75, 64,160,177, 72, 51,189,206, 66,138, 26, 98,150, 71, 16, 11, 65, 59,
-130, 37, 5, 74,122,246,125, 34, 5,117,101,145,206,206, 60, 35, 22, 23,120, 2,204,220, 54,102, 65, 35,178,176, 63, 10,147,169,
-185, 87, 93, 41,129,213, 29,172, 24, 48,234, 22, 88, 13,221,131, 30,235, 91, 29,180, 81,140, 14, 71,172,108,172,114,255,171, 31,
- 96,255,185, 30, 73,189, 78,173,185,140, 48, 22,109, 36, 69,175, 75,107,227, 8,181, 86, 74,107,181, 77,119,123,143,214,198, 10,
-203, 91, 13,174,127,250, 38,221,235, 7, 92,123,122,204,250,209, 35, 12,118,246,169,116,194,137,123, 79,146, 23, 57,163,189, 28,
-235, 12,157,227, 9, 71, 79,158,101,247,250, 30,159,250,208, 13,162,216, 80, 79,154,164,105,202,125,207, 59,202, 74,235,118, 30,
-127,236,227, 12,116,159,150,173,179,210, 86,220,230, 58,184,178,206,123, 47, 63,142, 17, 57,235,201, 42,205,122,198,241,250,195,
- 12,114, 77,167,166,168,201,117,218,174,194, 88, 71,116,125,119,200, 94,127,196,241,205,117,250, 3,201,246, 32,231, 96, 92,177,
-180,182,196, 49, 10,222,255,216,227,220,251, 23,127,196, 97, 5,247,175, 55,184,241,219,191,204,250, 87,254, 11,108, 89,242,226,
-207,252, 12,142, 93,220,226, 3, 31,251, 16,159,255,214,239, 70,196, 41,121,127,128,146,130,254,160,164,221, 72, 72,155,117,174,
- 93, 29,177,180,222,225,198,246, 14,203,203,203, 12,251, 35, 84,146, 96,157, 69, 77,211,115, 98, 71, 82, 75,176,122,137, 76,143,
-216,188,173, 69, 62, 28, 50,214, 19,182,175, 29, 80,107, 88,140,201,217,223,239,162,141, 37,142, 45,189,222, 33,135,195,156, 73,
- 62,225,218,141, 30,207, 63,119,140,253,253, 93, 38,149,230,177, 39,159,197,106, 77,156, 40,170,162,162, 42, 43, 70,101, 73,108,
- 42, 70,227, 49,245,102,139, 92,107,138, 42,225,182,211,119,115,112,254,175,160,190,196,179,215, 51,210, 90, 74, 26, 71,228,101,
-197,237,199,214, 25,149, 67, 12,130,168,172,112, 41, 8,109,193, 85,216,108,130,172, 55, 16, 42,153,119,111, 42,242,248,210, 40,
-241,135, 89, 90,247,191,110,140, 31,185, 11,229, 61,217,206,122,138, 85, 17,104, 86,101,229, 45, 94,211, 7,138,153,211,160,132,
- 13, 1, 14,218,115,229,167,198, 79,107, 13,110,146,227,240,202, 88,132, 66,198, 17, 34, 82,190,162, 55, 96,171,224,153, 15, 72,
- 48, 23,172, 37, 32, 49,227, 2,161, 20,217,126, 23,158,126,134,123,191,246,173,156, 43, 52, 38, 31,120,114,150,128, 72, 73,140,
- 18, 68,105,196,193,181,231, 56,122,100,139, 36,218, 99,104, 29, 85, 86, 33,236, 4, 91,149,144,110,134,179,214,219,155,166, 7,
-160,144,210, 7,192, 24,131, 11,135,190,173, 42, 76, 89,162,243, 18, 83,100, 94, 1,175,253,225,234,152,251,194,255,145, 24,205,
- 77,161,114, 34,136,217,172,199,120, 47,122,144, 93, 16,207, 97,231,145,152, 24,132, 51, 88, 17, 66,114, 98,137,116, 50,144,155,
-252, 4, 67, 23,133, 31,129,162, 60,111,219, 90,202,108, 68,218,234,132,115,197, 45, 4,160, 40,239, 76, 24,143,124,241, 86,139,
- 40,174, 92,231,189, 95,252, 50,154,119,157,229,232,203, 94,201,119,255,183,255,198,179, 31,255, 59,222,244, 37,111,160,189,214,
-102,123, 82, 82, 58,136,163,152,237, 94,159,219,151, 27,124,114,167,203,199,174,236, 50,121,239,147,232, 40, 66, 9,193, 70, 51,
-225,115, 31, 56,203, 90, 59,230,117,255,241, 87, 56,123,249, 16, 55, 28,210,223, 29,112,246, 69,207, 71,233, 9,233,238, 62,157,
-149,152,183,191,235, 87,102,171,137, 59,239,121, 1,223,244,207, 95,203,239,255,229,159,242,245,167, 18, 95,224,136, 57,120, 70,
-202, 91,125,225, 98,202, 90, 23,255, 32,162,117,145, 95,111, 93,216,179,223,154,140, 17, 88, 45,179,244,190,153, 55,125,170, 80,
- 14,157,186,138,230,248,205,233,199, 54,227,189, 59, 79,244,154,174, 2,230,177,169,254, 32,183,214, 6, 98,216,212, 6,103, 23,
-144,158, 30, 73, 44,156, 64, 24, 77,253,142,135,111, 77,231,112, 14,138,161,255, 90,105,228,211,215,204,116,109, 35,230, 74,190,
-169,193,110, 1,224,227,172,246, 99,232,106,154,128, 56,245,243,251,238, 80,197,117, 76, 85, 66, 62, 66,166,190,176, 51,101,142,
- 84, 94, 20,106,180,198, 21, 19,108, 49,133, 35, 73,116,145, 19,213, 82,176,150,114, 60, 68, 70, 53,172,169, 72,219,171,190,144,
-173,169, 48,137, 83, 56, 83, 5,171,163,247, 13, 90,109,189,168, 83,150, 88, 83, 33, 84,226,167, 9, 42, 66, 10, 71,247,202,101,
- 26, 75,109,226, 52,161,113,246, 44,201, 71, 31,165, 20, 2, 17, 75,156,148,180, 99, 73,149, 27,180,241, 41,139, 96,104,181, 18,
-246, 14,199,140, 68, 78,187,158, 32,201, 1, 73,105, 42, 4,144,107, 19, 70,241,142,194,194, 72, 27,164,244, 35,242,122, 20,113,
-180, 93,103,125,169, 73,187,158,178,181,212,166,222,108,176,186,190,129,233,118,145,229,152,164,154,208, 74, 99, 94,119,122,157,
-232,185, 27,124,108,104,209, 86,204,238,163, 56,136,229,100, 64,223,166, 82,210, 80,158, 11,111, 5, 36, 82,176,164, 4, 41, 6,
- 51,141, 64, 14,133,104, 20,180, 22,206,205, 45,152,254, 58, 20,179, 75,203,134,241,252,220,214,230,245, 15,214, 9,234, 27,203,
-140,159,221,163,213,110,114,229,233,235, 72,149,160, 11, 65,125, 53,226,206,251, 55,233,172,111, 49,184, 94,208,217, 88,225,250,
- 51, 55,184,253,197, 71,216,191,112, 72, 92,151, 52,150,155, 56, 85,195,149, 5,195,110, 31, 83, 56,138, 98,200,100, 82,178,180,
- 92, 99,119,251, 10,197,208,177,111,186,116,142,109, 82,142, 75,174, 62,113,133,245,179, 71,105, 44,213, 24, 31,104,198, 87, 74,
-174,247,174, 35, 83, 75,107, 67,114,247,185,115, 60,243,161, 43,236,237,239, 97,246, 98, 62, 54,121,132, 88,165,156,105,222, 78,
-226, 98, 30,187,126,158,182, 74,168, 71, 13,234, 74,226,100, 19, 68,143,207, 59,247,165,228,149,228,224,198, 33,157, 99, 9,101,
-183, 73,175,184,201, 65,222, 71,189,228,204,218, 59, 18, 25, 83,218,138,118, 51, 13,142, 34,193, 65,111,200, 67,189,107,220, 47,
- 51,174,125,252,113, 30,252,209, 31,227,194,127,124, 23, 71, 94,251, 90,244,159,252, 30,209,114, 29,142,156,160,115,215, 61,220,
-253,224, 43,104, 29,187,139, 73, 54,158,141,246,154,205, 6,135, 7, 3,246,110,116, 57,255,233,109, 76,158,241,244,249,155,228,
- 69, 73,179, 17,133, 84, 47, 77,187,149, 50, 25,103,148,121, 69,149, 23,196,105,204, 82,171, 70,164, 20,195,113,206,229,221, 62,
-177,114,100,163, 30, 31,255,212,101,118, 14,123, 20,197,132,221,195,190, 79, 30,211,154,221,131, 30, 91,107,117,198,227, 49, 69,
- 81,130, 48, 28,236, 30,250, 17,158,129,126,127,196,184, 40,104, 39,130,122, 12,141, 36, 38,118,154,147, 27, 91,124,197,151,124,
- 45,205,231,254,144,102,217,229,216,177, 19, 60,126,126,155,229,118, 11,107, 29,147, 73,198, 3, 15,222,201,114,236,253,131, 34,
-140,201,228, 82, 11, 97, 52, 34,174, 17, 55, 91, 62,232, 33, 10,135,121,218,128, 90, 19,146,212,139,232,210,250,156, 52, 38,148,
-143,104,204, 51, 40,114, 92,150,205,172,103,174, 10, 9,111, 85,229,127,132,145, 59,214,122,129, 78, 94, 32, 76,133,203, 10, 76,
- 85,121, 21,110,165,177,214,160,203,130,162, 55,162, 26, 79,168,170,146, 98,146,227,180, 70,151, 21, 58, 47,200,179,140,114,148,
- 49,233,142,200, 6, 35,198, 7, 67,202,201, 4, 93, 86,152, 74, 83,105, 77, 85, 85,100,215,182,161, 18, 36, 71, 59, 56, 12,253,
-107,215,152,116,251, 56, 39, 80,113, 66, 62,206, 56,126,251, 25,242,171,151, 24,151,142, 6, 67,156,242,153,198, 46,207,177,210,
- 43, 98,103,130, 41,230, 4, 54, 91, 85,184,178,192, 86, 26, 29, 34, 79,117, 81, 96,195,154,192,133,244, 44, 55,165, 62, 45,182,
-233,179,159,138,249,106, 98, 10, 75,177,198, 43,151,141,157,199, 42, 6,104,141,179, 6, 43, 76, 56,156, 4,214, 88, 92, 36,253,
-123, 84,254,192,178, 98, 30, 21,235, 2, 33, 67,132, 46, 14,231,136,106, 13, 68,148, 18, 53,151, 16, 81, 76,148, 52,188,161,119,
- 50,196,149, 25, 34,237,112,240,215,127,202, 31,191,254,179,136, 79,221,198,229,195, 62, 87, 31,121, 63,159,126,236,113,190,225,
-123,126,144,102, 59,101,164, 45,218,249,132,170, 68, 74, 26, 82,112, 48, 14, 1, 69,149, 35, 55,126,146, 34,162, 6, 73,251, 54,
- 54,142, 61,143,135, 95,253,122,126,254,247,222,195,122, 34,121,240,161,123, 56,118,230, 54,232, 31,114,116,240, 52,107,235,130,
-120,107, 19, 26, 77, 15, 71, 2,170,178,228,181, 95,254, 6,190,241,251,126,148,159,255,173, 71, 40,202, 62,227, 75, 79,135, 21,
-245, 60,176, 69,202,127,208, 57,187, 69,196,109, 0,207,200,160,102, 95, 88, 47, 76,133,110,211,238, 93, 46,248,197,167,145,190,
- 51, 79,252,180,128, 8, 14, 2,177, 80, 77,204,116,157, 66,204,208,177, 98, 26,193,234,194, 33,238,230,191,119,102,195, 51,132,
- 73,195,116,155,228, 11,213, 40,109,179,242,249,255, 18, 17,155, 57, 65,206,148, 80,142,110, 85,190, 99, 23,214,100,122,198,253,
- 71,151, 1, 9, 28,138,101,163, 3,154,182,154,253,121, 27,114, 4, 92, 72, 98,115,186,196,232,114, 6,191, 49,227, 30, 50, 74,
-113,214, 82, 13,122, 56, 99,208, 89,134, 46, 51,108, 85,160, 39,125, 84,220,244, 93,187,209, 68,245, 38,113,163, 73, 92,107,134,
-207,218, 79,178,156, 82, 33,101, 47,172, 36,172, 9,141,130,242,131, 0, 21, 33,107, 45,140,214, 20,251, 55, 24,237, 92,229,137,
-247,189, 15, 81, 85, 8,103, 56,221, 18, 92,126,118, 27,109, 12, 38,170,209,173, 44, 54, 78, 17,186, 66, 75,143, 72,150, 74,160,
-164,228,112,148,205, 2,230,178,202, 50,174, 12, 89,101, 48, 8,178,202,131,156,198,149, 35, 55, 26,231, 36,145,132,165, 52,229,
-182,149, 54,103, 54,214, 56,190,117,132, 51,183,157,162,179,186, 74, 85, 24,138, 97, 15,101, 52,170,223, 99,115,173,131, 46, 10,
-170,124,194,237, 34,231,169, 81,133,137, 34,234,145,164, 19, 73, 82, 41,168, 43,159, 4,183, 20, 71, 52,163,144,238,105, 29,113,
-192,204, 24,135, 47, 78, 66,144,203,108,152, 35, 22,210, 86, 23,221, 30, 82, 44,232,104,255,161,219, 2,148, 84,200, 70,139,162,
-246, 32, 86, 74,110, 94,238,147,180,196, 76, 15,145, 68,138,165,206, 42, 69,158,211, 62,185,194,100,191, 71,109,105,147, 40, 78,
-137,211,148, 81,111,192,225,245, 62,245, 78,157,195,107,187,244,247,250,200, 90,131,165,149, 26,147,126, 78,255,198,117, 38,227,
-130,165,246, 58, 27,167, 54,112, 70,146,212, 18,170,162, 2,227, 88, 90, 95,162,114, 3, 14, 14,135,220,118,199, 17, 46, 62,115,
- 21, 89, 37, 28, 30,244,105, 29, 23,172,110, 45,209,142,107,244,134, 5, 91,203,109,154,109, 73, 51,109, 51,158, 12,169,165, 53,
-164,176,108, 54,151,184, 52, 60,207,191,250,236,127,201,100,236, 72,235,208,108, 52,153,244, 43, 46, 29, 94, 36, 78, 5,227, 2,
-162, 71,159,219, 71, 41,137,146,126, 76, 51, 44, 43,164,136,120,227, 81, 73,219,142,209, 22, 26,177,229,202, 79,253, 48,186,190,
-129,217,222, 38,189,251,118,246,255,242, 47, 56,114,215, 3, 56, 37,137, 54,206,160,173, 65,235, 16, 88,159, 74,164,117,172,174,
-181,216,223,237,209,136, 37, 89,105, 73,210, 26,203,157, 22,147, 81,206,225,225,132,173,173, 53,118,111, 14,136, 34, 65,150, 85,
- 51,142,243, 48, 47, 73,227,152,122,163, 78, 75, 25, 70,131, 9, 89, 53,228,163,143, 61, 70,156,182, 57,121,116,153, 60,175, 24,
- 40, 73, 35, 73, 40, 75,205,179,151,123,228, 69,137, 37,162,168, 74, 42, 39, 40,199, 99,106, 53, 15, 69, 89, 86,130,209,168, 64,
-213, 82,106,245, 6, 34,105, 83, 95,189,131,151, 60,255, 40,255,225, 55, 46,240,138, 23, 61,159,189,131, 46,149, 49, 20, 89, 70,
- 61,245, 68,165,103, 47, 92,231,220,234,201, 25,177,204, 78, 50,228, 82,219,239,184,106, 41,196,225,199, 52, 19, 50, 74,102,252,
-238, 41,121,108,198,131,215, 85, 80,167, 23, 62,140,161,172,252,129,173,171,144, 6, 21,246,206,102, 14,249, 64, 72,204,116, 36,
- 31, 0, 44, 54,236,207,157,128,106, 52, 65, 23,165,247,113, 75,137,170, 74, 92, 18,161, 43,131,138,188,168,203,175, 23, 53, 85,
- 81,162,173,197,148, 6, 61,246, 23,191, 74, 19,100,146, 18, 37, 41, 73, 59,101,220,189, 73,178,179,138,216, 40,137, 19, 69,220,
-106,192, 56, 67,164, 9,189,157, 61,162,173, 59,137,196, 95,147,141, 74,138,245, 26,234,160, 71,180,182,130,201,250, 68,101,129,
-104, 84,176,190,236, 31, 78,113, 4,122,234,239,182,152,188,132, 80, 68,216,162,240, 59, 68,103,231, 96,145, 41, 9,220,253,131,
-108, 68, 37,131, 55,217,132, 24, 80, 21,124,215,198,239,188, 93, 0,199, 8, 47,163,245,138,106, 55,235,222,109,240,147, 59,169,
-252, 94, 15,112, 78,226, 42, 19,148,223, 83, 75,149,195,149, 21, 54,114, 84,147, 1, 56,133,200, 11,162,134,193, 84, 21,202, 5,
-189,194, 36,243,255,189,121,154, 71,222,246, 21,124,226, 61,239,161,185,113,130, 75, 87,247, 56,210, 90,225,119,246,183,249,224,
-223,126,152,211, 27, 45, 42,107, 25, 20,126,148,153, 74, 69, 77, 73,110, 78,114,198, 14, 54,235, 13, 94,114,246, 33,206,156,190,
-139,229,118,135,102,187,193,102, 43,194, 53,155, 60,245,201,199,121,197,217, 99, 60,255,190, 59, 73,155, 53,250, 59,215,120, 32,
-222,166,115,246, 12,118,243, 4,182,214, 36, 94,248,140,226,255,197,213,155, 7,219,150,221,245,125,159, 53,236,233,140,119,126,
-115, 79,106,169,213, 45,169, 37,132, 0,129, 6, 16,177, 24, 92, 54,132,193, 14, 41, 48,132, 50,118, 72,217, 84, 65, 82, 84, 18,
- 87, 25,112, 18, 87, 57, 9, 6, 59,184, 40, 87, 18, 28, 67,153, 33, 49, 97,176, 83,152, 50,131,176, 53, 32, 52,160,177, 39,117,
-191,238,126,227,125,239,142,103,220,211,154,242,199,218,231,156,219,168,170,235,117,247,187,245,250,222,163,189,215,250, 13,223,
-239,231,155,166, 8, 33,184,126, 99,143, 31,251, 91,223,193,143,254,240, 79,240,161,127,241,211,124,241,127,255, 73,206, 63,245,
- 71,145,138,214, 61,195,171,174, 59, 94,154, 98,189,229, 89,119,220,235, 72,209, 77,131,238,253, 10, 73,187,242,182,115,129,204,
-181,137,103, 93,165,146,198,121,233,166, 88, 18,106,197,184,239, 84,235,221,178,127,213,161,139, 21,156,198, 11, 54, 12, 79,177,
- 9,182,233, 4,117,171,203,124, 13,170, 25,109,197,241,125,232, 58,112, 95,131,112, 49,238,216,196,191, 23, 73, 55, 38,240, 49,
-238, 53,180, 85,252,225,117, 26,181, 24,171,233,217,170,248, 14, 22,239,226, 46, 91,136,168,144,119,117,217, 89,216,196, 38,175,
-219,182, 72, 20,166,110, 80, 89, 44,176,189,105, 9, 88,156,105,240,245, 18,231,226,247,101,154,134, 36,203,144, 90, 97,235, 57,
-217, 96, 4,105,130,112, 45, 82, 6,140,239,108,107,136,104,101,171, 43,124,144,232,254, 40, 78,194, 46, 68, 33, 6,231,153,222,
-123,141,217,237,155, 44,231, 11, 46, 63,114,153,172,159,240,240,133,155,156,216,248,156, 39,182, 37, 85, 41,165,115,152, 36, 35,
- 84, 53, 65,102, 4, 23, 72,180,140, 29, 47,129,243, 69,131,247,129,218, 58,108,103,195, 13, 65,176, 52, 46,130, 50,145, 72, 41,
- 24,101, 9,123,189, 30,143, 93,222,167,208, 9, 41,146,178, 44, 57, 63, 61,101,180,189,141, 38,193, 47,166,108,239,109, 81,158,
-157,177,172,230,152,197,148, 68, 10,126,248, 74,202,239,156, 88, 94,111, 65,168, 24, 16,147,117,183,174, 39, 96, 58,212,244, 64,
- 11,164,146, 24, 31, 88, 74, 79,218, 25, 20,122, 74,160,187, 66,210,119,107, 0,191,162, 39,178,225, 50,188,177,246, 23,235,128,
- 22, 41,163,149, 45,205, 51, 72, 61,119,254,252,156, 98, 91,144, 15, 6,204,155, 26,165,161,181, 22,227, 90,134, 87, 14,176,149,
-160,109, 20,187,143,245,200,198,138,118, 18, 8,141,163, 24,246,105,102, 21,197,120,136,208, 5,253,113, 10, 4,250,195,148,229,
- 36,103,188,147, 51, 63,171, 81,211,146,230,172, 66, 14, 18,246,110,236, 50,185,119,194,253,231,239,241,229,195,155,124,211,123,
- 62,200,205,231, 94, 71,164,138, 68, 23,100,105, 66,121, 63, 62,215,179,249,156, 32, 2,119, 78,207,169, 92,201, 40, 29, 33, 69,
-194,121, 61,231,176,188, 79, 79, 41,254,251,111,255,113,150, 50,160, 50,199,108,186, 96, 58, 45, 81,137, 97,111,188,197,201, 98,
-138,150, 18,253, 96,217,208, 75, 52,147,186, 37, 85,208, 79, 18,166,203, 5, 31,122, 92,110,242,148,131, 96,118,231, 14, 7,111,
- 63, 32, 49, 75, 78,110, 61, 36,219,222,165,126,120,159,252,218,123, 34, 84,160,105,208, 50,198, 26, 90, 19, 72, 82, 9,121,202,
-238, 86, 15,170,130, 59, 15,231, 56, 91,241,199,159, 60,229,175,126,227,147,228,137,224,244,116, 70,175,159, 71,129,115, 7,195,
-240, 93,212, 95,221, 90,132, 78, 25,237,140,248,216,167, 95,162, 92,158,114,126,120,139,225,214, 1,207, 77,206, 56,216, 27,197,
-209, 86,154, 96,237,130, 94, 1, 90, 43,108,211, 34,218,146,173,113, 15, 79,193,116, 58,103,171,151, 83, 86, 93, 85, 83,213, 32,
- 4,109, 61,231,111,254,224,119,240,123,255,219,127,197, 19, 55, 30, 97,220, 43,232,231, 57, 91, 69, 10,222, 83, 86, 37,214, 88,
- 62,253,249,175,240, 77,215, 11,122, 87, 15, 64, 73, 68,170, 8,203, 42, 42,169,107,131, 42,204,102,215,170,211,181, 53,171,139,
- 6,138,104, 72,219, 9,201, 86,167,152,117, 49, 89,204,196,203, 60,254,126,236,224, 67, 7,229,217,112, 16, 99,220,128,171,154,
- 40, 34, 91,143,244, 26, 92, 83,225,202,154,208,169,120, 69,158, 19,100,129,176, 14, 23, 26,130,211,241,115,117,116,208,255, 56,
-218, 84, 90,198,203,173, 75,218,146, 46,144,228, 25, 66,105,178,193,136,234,228, 1,195, 71,159, 37,248, 47,196,168, 71,149,144,
-245, 6,168,112, 74, 45, 50,242, 68,224,173, 33, 27, 95,166, 33,224, 79, 79,208,123, 7,248, 50,226, 88,243,126,129, 72,195,134,
-194,229,163,253,204,181, 49,241, 45,116, 94,225, 24,148,178, 73, 71, 91,143,215, 47, 72, 9,226,124,211, 95,192,180,134,142,175,
-189,177, 27,209,113,205,131,220,116,241, 32, 98,194,157,119, 4,181,202, 40,151,221, 40, 56,116,207, 90,204,174,247, 29,248,198,
-119, 33, 26,190,174,186,110,211,227,233,108, 75, 86,224, 45, 76, 39, 51,178,254, 14,229,225, 3,126,247,175,125, 11,141,117,100,
-251, 87,104,188, 65,101,125,126,241,181, 59,156,215, 13, 91,131,130,179,218, 32, 69,100,108,251, 16, 11,231, 97,158,115, 88, 26,
-254,254,119,127, 23, 79, 63,245, 52,105, 30,191,183,175,220,121, 72,223,181, 44,252,136,179,123,231,164,162,225,241, 27, 55,176,
-193,240,250,139, 47,243,126,255, 21,178,119, 63,141,237,143,227,129,181,156, 67,190, 5,106,240,134, 78,184, 95, 20,188,237,137,
-109,254,245,111,253,115,158,251,194, 39,248,174, 31,251, 41,228,143,253, 67, 62,254, 3,239,237,106, 28,223,193, 99,186, 93,235,
- 42,171, 60,128,235, 60,226, 43, 58,221, 42, 52,236,194, 21,222, 57, 16,196, 70,229,190, 98,177,116, 95, 47, 85,135,236,148, 97,
- 93, 28,188, 97, 61,205, 74, 83, 26,185,249, 43,234, 87,100,185,199,103, 85,136,168, 7,240,110,227, 58, 91,187, 32,173,239,194,
- 96,162,196, 62,149,174,131,226,248, 77, 70,188,143,228, 55, 42,131, 15, 13,162, 93,118,145,198, 9,194,214, 81,223, 33,117,199,
-111,215,120,215, 70,206,186,109,227,216, 29,139, 68,197, 12, 11,157,225,218, 6,103, 13, 66,200, 53,146, 87, 8, 17, 45,103, 34,
-193,154,146,224, 70,248,122, 17, 59,251, 54,106, 70, 98,113, 18,211, 18,131,157,226, 85, 31,169, 83,146,222, 40,218, 37,189,141,
-144,166,149,197, 46, 68,220, 45,222,163,242, 2,209, 54,168, 36,199, 27, 75, 8, 49,102, 52,116, 88,219,233,221,215,185,251,197,
- 47, 51,216, 30,211,248,128,152,206, 40,182,123,180,222, 99, 85,198,153,129, 52, 9, 40,165,104, 22, 6,175, 53,153,247,152,110,
-117,146, 37,138,186,117,241,140,239,220, 6,182,123,143, 28,129,210,172,212,238, 81, 29,211,207, 82,180,146,140,243, 34,194,117,
-180,164,109, 34,229,174,156, 76,168, 23,115, 30,221, 26,144, 10, 56, 45,167,180,243, 41,169,138, 5, 72,170,224,123, 14, 20,191,
-250,208,114,212, 58, 82,173,104, 2,164, 33, 32,181,160,144,158, 76, 74,132, 15,140,101, 96, 43,137, 77,216, 64, 16,249,244,248,
- 72,101,236, 10, 80, 27,181,193,107,129,231,106,120,167,244, 38, 49, 16,113,193,161, 17, 31, 28,116,190,141, 16,125,122,151, 22,
- 44, 39, 75,174, 60,186, 75,121,214,114,255,245,219, 60,241,212, 35, 56, 19, 39, 37,161,241,164,189, 1, 82, 11,172,145, 88, 11,
- 78, 74,124, 99,105,130,228,242,227,187,220,126,254, 62,179,163, 37, 66, 11, 76,227, 24,108,141,113,174, 33,205, 60,249, 80,163,
- 24,208,202, 37,105,218,167,182,134, 80, 25, 46,101,251,124,249,139,207,145,168,148,189,237, 29, 66, 86,210, 98,121,243, 87, 95,
-225, 43, 95,190,135,210,158,190, 30,211,147, 5,173,232,227,172,195,203,150,161,144, 76, 84,194, 79,253,245,159,224,228,236,148,
- 36,205,152,157, 45,152, 47,150, 88,103,120,254,236, 53,246,251, 59,212,174, 38,208, 67, 91,231,169,132, 99,209, 90, 6,169,198,
-122,199,110,218, 85,212,162, 27,167,117, 38,254,135,207,125, 22,191,152,161, 14,174,225, 31,189,134,104, 26,156,202,112,109, 36,
- 40,181, 77,217,189,248, 50, 30,168, 2,198, 91,125, 78, 14,193,183, 75, 62,255,229,219, 60,118,109,204,173,215, 15,217,221,237,
-147,230, 3,234, 38,224,154, 24,240, 46,112,164, 72,172,119,221, 7, 26,119, 90,151,247,115, 78,213,144,124,116,149,135,135,183,
-216, 26,247,121,240,218, 17, 72,141,119, 18,171, 20, 7,227, 17,139,243, 19,146, 34,103, 62,175,152, 83,145, 21,125, 22,141, 37,
- 53, 75, 18, 33, 98,184,136, 12, 12,122, 57,223,252,225, 31,161,254,204,207, 51,220,190,132, 94, 24,170,166,226,165, 87,207,169,
- 27,195,254,168,199,116, 89,197, 81,177, 8, 28,221, 61,226,250, 32,135,222, 0,185,183, 75,152,205, 8,178,192, 87, 75,154, 96,
- 72,183, 47,117, 36, 57,223,201,126,163,161, 55,168, 46,125,204,217,206, 66, 35,227, 37,223,182, 81,212, 86, 71,235,150, 51, 45,
-190,110, 8,109,187,137, 89, 5,188,144,235,212, 42,223, 68,164,170,109,106, 92,211, 68,114,218,108, 66, 88, 44,177,203, 22,177,
- 61, 68, 13,134, 36,163, 45, 40,122,177,166, 80, 17,201,180, 74, 26,139, 74,231, 16,109, 53, 62, 16,180, 68, 10,137,202,162, 50,
- 95,107, 77, 16, 93, 16,204,164, 70,247, 50,250,227,113, 7,206, 0,169, 21, 77, 89, 35,165, 66, 10, 15,233,101, 84, 58,197,169,
- 45,218,147, 99,212,214, 54,161,173, 8, 71, 15, 72,246,246,187,145,172,140,222,223,182,163,100, 57,183, 94,234,134, 46, 39,254,
- 13, 89,201, 65,188,113, 63,122, 49, 40,197, 69,227,106,232, 60,254, 43, 70,123, 88,237, 62,141, 95,239,215,195,202,141, 16,124,
-119,105,117,191, 23, 34,214, 52,172, 2, 34,130,239,184,220, 17, 2,130,214,209, 98,173, 84,204, 43,246, 26,100,142, 49,129,220,
- 57,116,235,249,216, 63,255, 73,158,255,253,223,103,116,249, 10, 46,120, 26, 82,254,244,116,193, 39, 30,220,161,167, 53, 82, 8,
-170,214,146,104,133,115,142,210,195,126, 47, 99, 90,183,140,250, 35,126,241,251,190,143,108,156, 51,153, 60,224,245,155,115,206,
-231, 53, 3, 37,225,250, 37,110,221,122, 64,235, 12,111,186, 52,230,120,177,228,252,240,132,119,154,135,140,223,172,176,105, 31,
-185,156, 34,149,142,236,240, 98, 7,149,239, 94,240,115,199, 34,103, 32,224,171,158,121,156,201,249, 93,254,143,191,247, 55,248,
-158, 31,250, 73,190,245, 35, 19,254,236,199,190,153,217,243,127,126, 33, 2,125, 19, 28,179, 78, 82, 91, 55,235, 29, 71,207,118,
-194, 53, 21, 46,208, 98,195, 58,151, 58, 92,160,133, 9,177,106,208, 3, 23, 83,106,196,133,100,182, 88,204, 93,208, 28, 10,129,
- 16, 43,152, 80,183, 11,245,157, 34, 78,132, 24,219,218,165, 24,107,213,133,186,116, 43,147, 56,250, 54, 23, 8,224, 43,161,104,
-178, 65, 55, 59,143,111, 75, 96,134, 28,236, 19,108, 11, 42, 33,216, 26,172, 69,100, 61,130,105,241,190,233, 46,228,121,252, 30,
-117, 15, 87, 77, 8,197, 24,215, 44,240,117, 73,208, 25,202,153,248,238, 42,133, 43,151,241,191,209, 54,216,122,129,107,218, 8,
-156,106, 23, 49, 68,168, 19,114, 6,231,208,189, 1, 2,137, 78,114,116,175,223, 41,221,227, 37,164,178, 2, 93,244,208, 89,142,
- 53, 38, 82,234,156,143, 1, 49,222,199, 68,183, 14,197,140,247,216,186,225,222, 75,175,240,240,193, 41,193, 7,150,117,195,246,
-163,187,120, 97, 24, 72,201,131,214, 16,178,156, 10, 73, 83, 53, 20,189,148,233,188, 34, 43,114,122,210, 83,182,150, 52,137,147,
-139, 89,235, 72, 47, 84,208, 33,132,136,141,149, 81,104, 38, 16,140,243, 12, 45, 21,189, 52, 97,177, 44,217, 26, 13,105, 91, 71,
- 89, 47, 89, 44, 75,182,135,125,246,243,132, 93, 44,199, 47,191,136,245,129,180, 40, 16,213,108,109,241,149,222,243, 55, 46, 39,
-124,124,226,120,190,140, 33, 83,121,183, 30, 13, 66, 50, 80,130,221, 20,114,225,217,210,130, 44, 4,180,140,124, 5, 41, 69,236,
-206,187,245,206, 42,137, 57,138, 55, 55, 73,128,157,121, 96,157,186,184, 89, 13,197, 2,179,184,252, 8,217, 32, 33, 75, 18, 70,
- 55,174, 50, 61,170,200,250, 57,245,210, 49,222,221,165,109, 90,130, 12,140, 30,217,231,181, 79,124,137,222,193,136, 84,194,233,
-221,115,132,128,249,164,101,255,145, 17,147, 7,231,204,206, 30, 80, 20, 99,118, 47,237,146,245, 21,229,121,201,236,161, 97,235,
-218, 8,215,120,154,178,102,247,234,152,151,190,112,139, 94,145, 82,150, 2,227,107,246,246,247, 80, 40,150,101,197,163,111,126,
-148,155, 95,190,195,253,155,103, 44,150, 11, 50, 61, 6,150,204,236, 2, 21, 2,214,183,228,137,224,112, 49,231, 39,191,253,111,
-115,120,122, 68, 81,244, 88,206,151,244,147,140, 48,176, 52, 6, 46,183,123,248,208, 99,222, 30,177, 83, 20,104,227, 3,109,219,
-117, 20, 66, 49, 55,150,247,111,203,120,246, 10,177,238,230,116,140,148,230,244,206, 43, 20,181,192,251,134,237, 31,254, 31,169,
-170, 37,189,188, 96,190,152,179,152,215, 36, 50,224,131,100,123,103,132, 76, 4, 37,142,157,157, 33, 55,111,222,226,109,143, 12,
- 56,121,112,194,161,182,156,205, 6, 92,191, 17,200,219, 6, 80, 88,231,168, 90,199,206, 32,163,106, 26,236,188,193,122,207,114,
- 89,209,180,134, 7, 71,199,188,227, 45, 87,249, 98,179,228,248,244, 12,219,206,216,219, 30, 32,244, 16,172,227,244,252,140,233,
-100,130, 63, 79,216,218, 25,177,152, 76, 88,180,150,173,126,206,108,114, 78,210, 31,145,164, 41,198,181,124,240,125,223,201, 19,
-211,223,225,112, 94, 49, 26,245, 89,204, 78,146,225,185,113, 0, 0, 32, 0, 73, 68, 65, 84,208, 66, 48, 84,154,147,208, 32, 37,
-164, 82, 33, 18, 79, 42, 51,238,221, 95,178,125,117, 74,238, 61,114, 16,227, 76,195,116, 14, 89,134, 88, 24, 26,125,134, 74,163,
- 14, 0,217,237,232, 0,146,110,100,222,217,162,226,152,221,196, 75,217,216,184,135,110, 90,172,181,208,117, 9,161, 67,104,174,
-179,129, 67,204, 31, 86, 33,122, 85,221,108,137,175,150,184,201, 57,246,238, 3,154, 69, 21, 61,218,167, 19,178, 71,174, 32,211,
- 44,122,233, 67,124, 89, 54,150,176,248,247, 74, 43,186,168,243,152, 85, 44, 21, 42, 77, 80, 73,142,202,114,100,146,162,138, 2,
- 87, 86,228,131, 29,134, 59, 45,105,175,199,226,124,134,232, 60,247, 33, 73, 34,209, 14,135,244, 1,151, 40,228,206, 46,246,252,
-140, 48, 28,224,141,197, 31, 31, 35,199,195,120,217,120,113,193, 39,188,138,187, 92,113,195,195, 38,150, 60,108, 46,229, 55,252,
-111,213,169,139, 0, 54, 22, 9,200, 8, 0,138, 41,183,241, 82, 70,132,104,237,235, 46,183,149,167,117,173,189,187,112,121,248,
-136, 83,139,159, 67,215,185,199,142,202, 98, 77,139, 74, 10,210,241, 54,164, 5, 89,222,199,182,134, 95,250,151,191,202,239,127,
-254, 37, 14, 46, 93,230,219,126,224,123,152,124,254,203, 60,184, 55,231,213,101, 96, 98,106,118,139,140,210,198,238, 71,119,147,
-167, 84, 43,178, 32, 24,224,120,203, 83, 79,241,214,167,223,202,159, 60,247, 34, 94, 40, 68,210, 35,209, 25,211,243, 83, 70,143,
- 93,227,181,227, 51,166, 75, 71, 63,109,152,212, 99, 62,243,185, 23, 57,157, 76,248,190,247, 13,168,210, 75, 20,229,130, 16, 28,
-121,154,227, 80,248,182, 69,134, 6, 33,178, 53, 32,101,126,255,140,197,141,109,194,225, 9, 55, 30,191,138,217,247,252,241,111,
-253, 2,239,185,127,151,175,249,185,223,229,249,255,245,239,114,244,145,223,125,131, 39, 27,186,177,235, 10,234, 18, 54,202,117,
-157,116, 49,143, 93,193,181, 22,192,177, 25, 60,173,214, 37, 65,136,152,179,174, 86,214,184,120,191,226, 58,192,140,239, 86, 74,
-146, 55,120,215,133,250, 11, 25,240,221, 40, 53,118, 89, 1,108,236, 24, 67,135,186, 21,158,232,158, 17,129,252,107, 62,176,122,
- 72, 46,128,159, 76, 39,196, 83, 49,255,192,153,184, 19, 95,158, 34,117,190,254,103, 84, 22, 39, 22,166, 92,123,242,108, 89,162,
- 18,137,107,107,154,243, 51,146, 65,131, 43,231,248,110,133, 69,162, 35,205, 13, 58,150, 66,156, 16,152,249,180,211, 9,121,156,
-119,113,213, 17, 20,193,148,200, 36, 71, 72,133, 16, 41, 66, 74, 20,160,179, 12, 91, 85,208, 27,196,247, 83, 41,140,137,241,192,
- 74,107,218,106,129,146,129, 32, 6, 4,211,162,148, 6, 41, 48, 29,152,198, 57, 71,227, 60,163, 94, 2, 72,122,253,148, 36,207,
-232,245, 51,182,140,224,176, 54, 52, 94, 66, 18,133,194,169, 74, 48,198,144, 20, 25,165,105,200, 19,141, 51, 22,213,237,165,165,
-128, 92, 43,106, 27, 87, 90,178,211, 70, 37, 82,162,132, 96, 81, 55,228, 74,241,252,225, 17,239,204,115,178, 92,208, 58,207,168,
- 87, 32, 77,197,163,163, 33,139,233, 41, 33,237, 49,238, 15, 49,179,135, 17,171,159,166, 96,236, 58, 29,240,253,219,138,167,250,
-158,187, 85,244,162,247, 59, 49,101, 42, 60,133,130,173, 68,146, 74, 80,157, 16, 46,116, 80,153, 24, 58, 40,214, 69,232,134, 58,
-184,153, 20, 73,249, 6, 74,243,122,197,227,125, 20,216,229, 59,215,152, 62, 92,114,120,231,144,183, 62,243, 54, 94,123,245, 22,
-136, 24,141,171, 18, 69, 47, 27,224,109,192,151, 51,208, 67,252,204,113,178,188, 75,146, 15,104,231, 53,215,158,190,132, 78, 53,
-211,123, 21,193,164,132,190,228,238,203, 71,140, 70, 5,147,147, 9, 91,251, 99,206,238,156,226,131,160, 46,107,132, 10,184,202,
-227,146, 40,178, 83,133,164, 89, 56, 46, 61,153,241,196,229,183,242,255,253,246, 71,121,250,137, 71,168, 22,158,201,180,229,234,
-182, 65,107,197,229,100,159,215,206, 94,229,188, 61, 99,106, 26,254,242,179,207,112,124,126,202,214,126,159,201, 98, 78,115, 58,
-163,182,150, 98,164,185,255,234, 49,253,194,114,237,198, 62,215,203,171,252,236,199,126, 22,109, 59,191,104,166, 4,149,179, 88,
-239,249,235,151,244,198,186, 19, 98,164,166, 95, 41, 11,125,160, 60,254, 10, 5, 79, 32,146, 2, 91, 85, 52,245, 34,134, 0, 44,
- 74,166,141,165,215,239, 99,157,165,173,106, 76,235,144,120,118, 71,125,238, 47,151,124,241,230, 29,244,157,187,188,255, 27,222,
-206,114,145, 67, 94,176,168, 27,148,138, 86,143,211,211, 37, 90, 11,180, 86, 72, 66,212,136,248,192,141,107,151,152,204,206,105,
-173, 97,208, 75, 57,183, 57, 47,222,122,192,168, 63,161,151,233,117,148,163,166, 97,118, 90,145, 36, 9,153,178,228, 26,138,131,
-125,206,102, 19, 48, 5,223,255, 87,254, 10,251,211,223,231,104, 86, 81, 20, 57, 54,120, 70, 69,129,169,107, 78,102,243, 24,103,
-232, 60,227, 97, 15,116,194,142,177,188, 60, 95,112,112,239,152,189, 3, 71, 64,144,110,141,145,222, 19,230,115, 84,154,194,241,
- 9,236,236, 16,242, 20,237,116, 28, 61, 10, 1,173,137,163, 62, 23,153,229,182,105, 9, 85,213, 93,228, 38, 42,101,173,237,130,
- 62,136,163,245,245, 24,186,131,156, 4,135, 68,224,156, 35,180, 38,142,237,210, 28, 89, 12, 81, 87, 83,114, 27, 80,137,194,216,
-104,103,112, 77,131,232, 57,164, 74, 17, 50,116,105, 89,172, 36,162, 72,161,241, 2, 20, 18,151,202,168, 34,149, 10,149,165,232,
-193, 16,161, 53, 66, 73,234,243, 51,210,253, 49, 58, 63, 35, 29, 12,112, 39,103, 8, 37,177,198,145,164, 49,121,230,164,106,248,
-211,143,254, 25, 31,126,239, 87,147,100, 26,215,235,211, 46,150,104, 85,195,214, 8,113, 54,137,193, 46, 58, 89,143,112,215, 64,
-151, 85,230,177, 91, 69,195,190, 49, 36,101,149, 46,135,232,148,253,171, 11, 58,184,206, 51,221,169, 96, 87, 9,106,221, 8, 61,
- 8,214,227,245, 55,254, 21, 29, 78,171,125,232, 74, 40, 21,130,195,117, 88, 95,107, 44,222, 11,210,124,128, 46,118, 24,110, 95,
- 66,160,249,185,255,235, 55,120,120,126,138,151,146,171,227, 20,219, 46,121,248,192, 50,218, 30, 96, 94, 63, 98, 54,183,156,149,
- 37,198,249, 24, 86,177, 66, 87, 10, 72,148,164, 31, 44,123,215,159, 68,140,199,124,242, 43,175, 51, 26,141, 25,245,250,204,107,
-203,189, 7,183,184,178,183,197,225,100, 74,235, 51,110, 29, 29,241,216,254, 0, 53,159,241,210,107,175,176,156,156,195,123,158,
-196,171,235,216,122,129,202, 51,172, 0, 91,205, 72,189,239,110,196,232, 51,158, 28,221,225,124, 89,243, 96, 58,231,250,104,192,
-236,248,140, 98,119,196,254, 51, 79,114,243,246,199,240,255,116,201, 87,253, 79,191,204, 23,255,254, 15,115,252,145,223,217, 40,
-211,217,132,167,191, 49, 56,101,147,173, 46, 59,135,133,232, 88,237, 74,117, 35,252, 16, 99, 47, 87,105,108, 82,139,245,129,186,
-138, 83,149, 82,108,132,119,116, 12,122, 45,214, 99,120,239, 34,230, 19, 23, 34,174, 87,172,124,242,171,208,236,176, 14,124,193,
-197, 68, 64, 41, 68,156,178,143,158,216,228,163, 95, 20, 86, 10,129, 76,114, 92, 85,226,189, 33,180,237,230,226, 15, 49,213, 79,
-166, 81, 16,231, 76, 29,131, 88,130,199,204, 30,226,210, 94, 44, 10,125,131,109, 20,206, 52,132, 16, 48, 45,113,149,211,205,119,
-189,141,248, 98,157,230, 88,211, 68,205,140,239, 82, 5,157, 7,225,226, 94, 94, 37, 8, 33, 81,121, 4,205,184,182, 65,234,232,
-254,113,243, 25,161,191, 90, 47, 69, 17,103,219,148,132,214,226, 18,240,211, 83,132, 46, 72,250,163, 88,108,170,148,249,189, 87,
-209, 73, 74, 91,183,212, 82,112,249,145,125,212,114,201,173, 87, 14,241, 46, 48, 30, 13, 32,179, 28,213,142,105,229, 81,105,252,
-188,140, 3,149,196,125,122,180, 20, 10,116,151, 77,159,233, 88,176, 25, 39,186,132,194, 85, 56, 10,180,214,161,165,164,178,150,
- 55, 95,185,204,210, 24,206,230, 75, 2,241,191,117,105, 48,192,232, 20, 39, 53,151,158,120,132,246,244, 40,118,213,189, 33,182,
-173,227,252,100,181, 16, 23,176,155, 72,118,147,248,234, 59, 65,156, 20,116,239,173,146,155, 33,205,234,189,117, 93,236,110,184,
-112,145, 59, 31,208, 98,163,225,240,126,109, 80,192,119,107, 35,183, 90, 31, 5,129, 37,176,251,214,175,225,214, 39,207,240,198,
-243,250,235,119, 48,181, 65, 37,112,251,244,140, 15,160,201,135, 3,142,239,223,161,158,143, 16, 50,193, 72,203,242,212,112,249,
- 77, 99, 78,170,150,197, 81,139, 21,115,204,194, 50,186,180,205,226,116,193,104,191,135,115,142,237,131, 45,202,101, 25,215,121,
-222,147,228, 41,243,233, 18, 47, 53,251,143,229,220,123,112,196,245,199,159,226,165,151, 94,224, 43, 95, 57,101,111,112,141,221,
-237,130, 73,125, 70, 95,143, 24, 23, 5, 75,183, 96,231, 74,131,114, 61,182,203, 29, 2,158, 66,215,252,230,103,255, 3, 63,253,
-159,253, 56,147,147, 19, 8,150,198, 47,113, 86,209, 52,134,169, 59, 39, 93, 38,180,175, 28,115,227,201,107,124,251,155,223,135,
-214,221, 15,111,124, 64, 11,201, 65, 79,115,144,138,117,194, 81,232,246, 94,206,116,149,144,140, 74,213,244,237,239,138,112,133,
-186, 69,229,138,182,174,241,206,176,189,221,163,169, 27, 36, 22,103, 60, 58, 13, 72,225,200,251, 41,198, 89,242, 60,229,193,131,
- 91,220,190,183, 71,109, 12,227,126,159, 52,207,232,247, 10, 90,179, 68, 8,137, 9,130,156,100, 13, 24,185,180,183,195,249,233,
- 57,231, 70,240,174,103,159,225,232,232, 20,113,251, 22,253, 34, 67,168,148,166, 90,112,116,126, 28,133,118,206,144,101, 41,153,
-212, 40, 5,167,167, 15,185,188,127,192,123,174,239,242,173,239,188,206,209,221,127,143, 43,182,232, 21, 57,130, 40, 66,203,122,
-209, 35,252,228,141, 75,220,185,191, 96,247, 96, 76,211,198,150, 33,104,201, 3,155,225,142,231,156, 15,123,136,172, 36,104, 65,
- 50,220,194,205,230, 36,219, 59, 72, 12,162,170,160, 95, 96,140,143, 41,101, 29, 63, 60, 52,113,212,238, 77,139, 93, 54,120,211,
-198, 93,137,139,213,124,236, 44, 67,167,118,221,136, 60,164, 88, 39,233,198, 14,214,154,117,154,147,202, 82,188,216, 34,217,150,
-160,227,104, 76, 16,240, 77, 73,217,152, 85, 32,215,102, 15, 42, 55, 50, 80, 33,117, 84, 50, 11,133, 20,186, 11, 93,209,232, 94,
- 63,142,196,118,118, 89,126,233,139, 24, 15,217,193, 21,146, 60,199, 53, 6,215, 90,164, 78,215,111,143, 18,130,225, 86,159, 82,
- 42,126,251,207,190,192,254,214,144,247, 60,126,153,162, 87, 96,155,150,242,232, 12,149, 74,116,146, 34,146, 28,153, 38,200, 44,
-141,113,160, 50,238,243,227,178, 61, 38,219, 5, 47,222,144,194,181,190,216, 59, 10, 93,140,145,245,235,228,182,176,206,196,246,
-107,220,172,119,161, 91, 53,116, 74,119,213,165, 89, 5,143,235, 62, 11,223,225, 63,125, 55,118,247, 86,224, 86, 24, 90, 20,217,
- 96,135,193,248, 50,181,131,127,241,123,127,196,171,231, 37,147,170, 68, 18,104,218,192,118, 95, 51,204, 45,159,189, 19,248, 79,
-159, 25,179, 59,204, 88, 28,149,180, 33,138,119, 50, 9,214, 9, 18, 21,247,247,169,179, 60,246,230,167,112, 91, 99,202,214,177,
-183,183, 67,146, 38,148,109,205,253,243, 51,100,104,153,183, 53, 85, 25,232,229, 22,220,156,233, 60, 58, 37,124, 83,114,188,156,
-114,255,240,148, 43,251, 39,140,149, 32, 29,143,112,198,210,206, 42,242,182, 3, 12, 73, 77,162, 21,251,251,215,248,161,247,190,
-155,231,111,190,196,224, 81,232,169, 62,253,162, 69,246, 91,134,215, 46,113,178,188,197,167,255,187,191,195,215,252,163,127,201,
-151,127,234,135, 56,250,200,239,110, 44,224, 23,214,224,235,177,249,138,228,231, 5, 65,119,251,246,149, 94,193,119, 79,215,202,
- 37,198, 42,159,190, 43,160,132, 64,200,139,221,245, 38, 68, 38, 90,214,194, 5,233, 68,119,250,202, 85, 32, 7,107,242, 93,167,
- 83,219,120,232, 87, 73,112,182,219,201,227,129,250, 66,112, 75,135,138, 85, 41,193,214, 4, 95,197,125,113, 83,145,166,219,224,
-108,212,118, 4, 8,174,193,213, 22,148,140, 97, 75, 54, 90, 44, 93, 93, 33,116, 70, 8, 14, 59, 63, 39,116,206, 23, 41, 28,182,
- 54,168,180,136,207, 84,221, 96,170, 41, 74,236,198,201,155, 45,163, 7,221,117,170,106, 28, 58,209, 4, 21,161, 68, 4,133,146,
-161,203, 94,151,164,233, 8,103,154,142, 41, 16, 21,238,206, 71, 95,189,200,243, 11,105, 38, 27,252,180, 80, 10, 87, 47,153,157,
-157, 99,140, 65,135, 12,103,162, 18,186,108,107,154,218,225,165,166, 81, 25, 89, 38, 25,167, 1,211,122,208,129, 4, 25,153, 2,
- 62,134,175, 84,198,197, 46, 86,119,140,253,206,141, 96, 99, 6, 77,236,226, 87,121,227, 50,106, 79, 78,102,115,198, 69, 78,166,
- 53,137,150,148,117, 73,126,229, 17, 78,207, 79,184,254,232,155, 16,206,146, 36, 41, 62,239, 81,150, 75,188,247,248,149,222, 97,
-165, 92,239,214, 95, 74,117,197, 3,113, 79,142, 18, 88, 31,214, 93,125, 16,108,194, 89, 58, 13,135,191, 0, 7, 52,145,103,211,
- 65,130,196, 58, 1,123, 37,162,148, 93,175, 32, 58, 21,157,241, 57, 87,223,114,137,207,124,250,203,236, 45, 27,134,151, 10,166,
-247, 65, 13,166,244,183,182,169,171, 9,161,113,180,193,145,229, 26,172, 32, 36,146,166, 46,113,203,115,142,143,103, 20,195, 61,
-138,222,128, 52,149, 44,167, 37,139, 73,131, 46, 36, 90, 42, 78,239, 78, 80,153, 38, 9, 9, 62, 83, 20, 38,229,196,223, 7,117,
-153,241, 65,134,208,138,118, 33, 17,164,124,238,179, 47,224, 91, 88,154,192,177,187,203,229, 98,159, 87, 78, 14,121,199,238, 85,
- 94,187,119,194,162, 93, 82,228,158,220,246, 72, 84,202,253, 91,247, 73,123, 2, 82,195,214, 65,143, 23,159, 59,132, 89,140, 93,
- 45,219,150,153,121, 13,110, 6, 62,240,236,135, 81,227, 34,253,153,135,203,150,218, 70, 98,211,175,189, 77,163,100,172,148,195,
- 90,133,189, 34,249,116, 47,163,132,199,254,135, 95,137, 57,175,173,165,156, 47, 49,173,165,223, 75, 40,178, 4,211,212, 32, 21,
-243,201, 28,129,165,109,226, 97, 60, 59,159,114,231,238, 93,238,222,191,131,181,130, 22,199, 78, 63, 35,120, 75,211, 52, 40,225,
-217,217, 42,104, 26, 67,162, 2, 77, 19,253,147, 69,162,144, 66,145,104,143,111, 61,214, 90,150, 38,238,154,166,179, 57,214, 89,
-180, 72,105, 90, 75,154, 14,168, 91,195,188,170, 72,210, 30,223,252,129, 31,226,127,249,137,239, 96,203,220,163,106, 44,105,214,
-163,109,107, 82,169,226,158, 46,215,152,198,163,180, 98,180,219,227,232,172, 98,127,111,132, 74, 82,218,166,197, 91,135, 38,240,
- 66,229,185,124,246,144,108,127, 59,118,143, 62, 64,150, 97,167,209,218, 16, 92, 76, 36, 66,198, 29, 91, 48, 6,187, 44,241,101,
-141,169, 74,236,178,193,212, 45,206, 24,130,105, 55,124,237,238, 81, 13, 46,114,148,215, 93,165,232,186, 74,235,214,126,225,208,
- 33, 43, 87,100, 78,143,236,194, 32, 36,182,109, 17, 82, 98, 67, 64,106,133, 44,122, 93, 1,214,189, 36, 74, 33,208, 72, 45,209,
- 58, 69, 38, 10,169, 19,100,146, 34,147, 12,153, 21,164,195, 1,233,181,235,220,250,103,255,140,108,239, 50,234,145, 45,146, 36,
- 35, 88, 75,181,172,152,158,157,179,253,196, 51,100,247, 95, 98,114, 86,146,236,239,243,202, 11,159,103,123, 60,166, 55, 28,112,
-167, 50, 28,149, 6, 65, 96,148, 38, 40,161, 98,158,114, 55, 70,113,206,226,155,206, 14,228,162, 43, 32, 4, 79,176, 93, 44,101,
-103, 67, 11,206,227,125,164,136, 69,253,144,143, 23,118, 7,196, 8, 54, 22, 68, 62,128,247, 46, 78, 40, 58,200, 71,112,177,210,
-143, 16,144,248,231,186, 16, 63, 75,135,199,219,128,115, 30,103, 29,174,141, 95, 99,172, 67, 37, 61,138,164,199,253, 7, 39,252,
-230, 23, 94,224,143,158,123, 1, 47, 4,121, 34,153,215,150,195,227, 25, 85, 93,161, 83,201,237,147, 57,253,188,224,250,158,134,
-249,146,101,213,242,202,164,236, 84,225, 18,235, 61,195, 68,145, 42,201, 25,138, 71,223,252, 4, 46, 72,246,183, 6,244,123, 5,
- 62, 88, 70,125,133,176,150, 73,213,144,165,154,179,249,130,179,233, 4,239, 44,139,186,165,170, 26,188,107,105,234, 40,136,121,
-247,229,130,178,172,201,138, 12, 91, 45, 56,189,245, 58,253, 43,111, 38,219,221,143, 9, 94, 1,102, 15,111,179,223, 10,254,195,
- 39,254,132,107,227, 17,185,240, 12,119, 34,201, 44,221,218,161,184,180, 79, 59, 57,164,253,242,243, 60,253,247,254, 41,183,126,
-245,159,116,128,150,141,135,125,253,235,122, 82, 39,215,251,117, 17, 54, 22,161,205,215,108,188,192,171,209,168,214,162,139,118,
- 21,107,194,238, 90,203,215,213, 98, 34,108,138, 56,209,165,200,197, 88, 81,162,115,161,243,174, 9, 41,214,216,130, 24,211, 26,
-214,217,218, 66, 64,255,224,128,226, 29, 31,238, 38, 22, 81, 63,178,214,182,120, 23,117, 42,193,225,154,136, 7,246,214,226,109,
- 75, 48,150, 96, 91,188,169, 8, 72,130,111,105, 38,167,221,200,222,226,218, 26,145,102, 93,154, 96,183, 42,240, 1,239,109,244,
-163,183, 45,174,169,215,252, 2,103,154,181, 31,218,117,224, 24,180,140, 29,186,206, 16, 90,162,117,142, 72, 83,116,150,198, 31,
- 47, 43, 34,240, 40,216,117, 24,140, 88, 81,251, 58, 60,178,206,251, 56, 23,213,209,222, 24,170,243, 83,206, 94,253, 10,159,254,
-131,143, 32,180, 38, 79, 21,184,150,235, 59, 3, 68,211,208, 4,143,146,154,172,159, 99,173,235, 38,111,130, 52,203,200, 18, 73,
-154,104,180, 86, 28,159, 46,162,216,205, 6,150,173,193,134, 64,101, 3,141,245, 52,206, 71,106, 91,119, 61,106, 41,216,201,114,
-188, 16, 36, 90, 48,238, 21,148,141,197, 89,203,141, 43, 87,105,172,227,242,213,235,244,139,130,164,169,112,243,115,150, 85, 69,
- 91, 47,241,166, 93,255,255, 37, 47, 20,101, 43,181,186,238,214, 62,234, 2,162, 56,172, 24,255, 97,227, 98, 93,215,143, 98, 99,
-115,148,114,195,129,127,195,243, 43, 55,105,193,206, 95,208, 28, 95,122, 47,195, 27, 91,188,246,153, 7, 56, 85, 83,164, 57, 47,
- 29,127,158,239,249,214,111, 67, 13, 83,218, 89,137, 42,122, 36,217, 0,188, 39, 29,244,176, 75,139, 74, 18,202,101, 69,179, 48,
-244,119,247,201,199, 41,121,175,192, 46,151,212,173,199,151,134,214, 26,218,198,224,188, 35,223, 43,232, 13, 50,178, 97,143,118,
-230,185,245,218, 67, 84, 57,224,246,205,123, 4, 37,233,231, 3,102,229,146,253, 43, 57,253,180,143,179, 22,143,231,116,121,204,
-100,210, 50,107,150,156,182,199,236,247,251,156,182,167,164, 18,102,147,138,190, 74,169,171, 37, 15, 95,159, 33,165,103,209,148,
-148,166, 34, 87, 26, 39, 2, 91,186,199, 51,239,185,129,254, 39, 63,250,125,120,231,152,215,130, 15,191,235,113,238,252,159,255,
-115,124, 39,216,228, 34,116,164,128, 56, 25,237,132, 44, 94,167, 88, 99, 48, 85, 75,235, 2,137,148,180,141, 93,151,238,109,217,
-160,165,197,182,129, 60,147, 44,149,164, 95,228,108, 13,122,204, 23,115,158,123,225,121,198,251, 3, 94,186,115,135,183, 94,191,
-138, 9, 10,231, 53,245, 97,203,214,168,160,172, 35, 18, 84,137, 64, 89, 89, 90, 99,200, 84,206, 97,179,164, 50,112,117,103,135,
-147,217,148,195,214,210,203, 82,202,202, 34,101,134,105, 91,156, 3, 45,114,156,213,124,221,215,190,147,219, 95,248, 61, 72, 10,
-124, 57,195, 59, 67,154,166,152,166,197, 89,203,149,253, 61, 22,147, 99,250,163, 1,163,237, 29,182,134, 37,217,160,160,109, 61,
-178,244,180,141, 39, 73, 19,122, 46,229,163,147,148, 15,191,248, 50,234, 93,111,195, 54, 13,109,219,146, 40, 73,123,120, 72,126,
-176,135, 60, 62, 69,247,234, 24,202, 96,163, 37,199,219,208,229,131,119, 9,100, 43,113,182,243, 23, 60,215, 93, 47,226, 76,215,
- 98,171,120, 40,116, 22,170,176,105,135,226,225, 41,187, 40, 77, 64,120, 71,219, 54,216,186, 34,200, 4,149,234,181,229,103, 5,
-219, 8,178, 19,196, 41, 21,199,223,169, 68,166,189,104,215,145, 9, 34,201, 81,189,130,236,202, 53, 22,159,248, 56, 92,185, 76,
-126,227, 90,140, 40,205,139,232, 57,109, 59,139, 79,146, 96,173, 37,209, 41, 22,131, 70,176,123,229, 82, 20,198, 40,137,183,142,
-135, 77,197,235,231, 11,242,214,240, 88, 46,217,234,231,144,102,209,119, 74,196,112, 74,170, 72,225, 91, 45,194,100, 23,194, 16,
-111, 96,130,176,235,128,156,200, 99, 95,249,210,227,161, 31,156, 32,208,196,174,220, 70, 33,162,239, 70,118,126,133, 47, 93, 51,
- 99, 58, 17,156,245, 56, 25,119,252,182,109, 49,166, 65,202,130, 17, 45,254,214, 39,169,151, 75,254,205,244, 10,139,164, 96, 80,
-228,136, 32, 72, 20,164, 42,144,105, 71,162, 19,142,207, 27,188,245,204,203, 41, 31,123,121,204,251, 14, 70, 60,126, 54,231, 43,
-167, 25,147,166, 69, 74, 65,162, 52,103,198, 80, 27,199,187,222,249, 44, 58,141,221,219,194,120,148,171, 57,158,198,145,240,225,
-121,201,176, 16, 44,150, 37, 14, 71, 85, 55, 12,115,197,178,110, 57,107,226,110, 63,193,243,235,183,103,124,219, 75,119, 24, 29,
-204, 40,219,154, 98,107,196,217,241, 41, 87,191,250,219,224,228, 24, 70, 91,200,222,144, 98,231, 18, 95,250,252,167,185,220, 75,
- 73,202, 37,147, 86,147,188,126,194,246,229, 45,194,108,142, 45,114,250,111,126,138,163,207,127,150, 27,159,255, 20,239,253,181,
- 79,243,241,239,125,251, 38,238, 84,176,206, 51,223,236,184,253,186, 67,218, 92,236, 98, 13,249, 88, 61,143,225, 2, 68,198,117,
- 28,241,176, 58,176, 87, 25, 56,157,122, 57,248, 21,209,110,163,167,243,157,253,136,213,110, 84, 69,177,156,191, 64, 10, 19,171,
-117,160, 88,217, 16, 65,205, 22,107,245,118,252,230,116, 23, 38, 19,119,230, 36, 61,124, 57,235,184,235,128,107, 8,206,211,150,
- 75,132, 16,104,157,224,154, 10,153,232, 53,223,192, 17,240,166, 38,204, 44, 66, 42,172, 16,104,157, 18,221,105, 41,182,141, 20,
- 68, 99, 27,180,210, 81, 49,222, 86,232,193,184,227, 61, 58,130,153, 32, 85, 30,221, 60, 73, 18,223,127, 37,208, 43, 34, 79,103,
- 21,115,182, 99,165,121, 79, 16,209, 33,162,178,116,157, 40,231, 58,210, 98,168, 5, 94,229,136, 60,167,156, 28,227,132, 98, 80,
-164, 28, 92,218, 33,197, 98,103, 51,188, 82,228,253, 1,203,218,161,165, 98,188,157, 51,169, 28,200, 6,231, 60, 82, 43,132, 22,
- 12,100, 74, 32,160,144, 24,103, 89, 54,142, 60, 81,204,156,197,134, 64,145,200, 78,107, 18, 47,224, 34,209, 52,206,226, 17,228,
- 73,194,253,201,148,237,126,159,171,151, 46,177, 8,142,199,246,174, 80,182,150,177,150,148,179, 9,211,249, 12, 91, 45, 9, 38,
-226,153,149, 8, 56,161,112, 4,146,176,166, 87,128,128, 54, 4,212,122, 99,210, 81, 9,229,198,111,177,138,240, 93,173, 84, 54,
- 23,255, 38, 15, 98,181, 74, 88,233, 52,252, 70,182,211, 5, 7,117,142,133,100,151,231, 62,246, 2,243,102,206,233,236, 33, 47,
- 30,222,225, 15,239,126,158, 31,255,145, 31,227,244,120,138, 19, 18,133,102,251,137, 33,147,155, 11,178,177, 70,157,120, 22,103,
-231,248, 32, 17, 42, 33, 29, 56,238,190,112,155,247,127,255, 55,114,255,149, 91, 20, 67,205, 98, 49,103,119,235, 18,167,135, 83,
- 70,251,125,122, 3,205,178, 62,103,127,231, 58,121, 33,240,231,142,251,167, 15, 24, 15,118, 34,109, 48, 64,191,200,176,218, 80,
-183,115, 84,136,164,204, 52,237,209, 56,203, 91, 47,111,241,185,123, 11,206,231,142,105, 99, 89,154,150,151,102,159,226,250,118,
-143,164, 72,201, 70, 30, 97, 19, 42,155, 80,132,140,198, 25,182,146, 1,183, 23,247, 72,255,164,135,250,222,175,127,251,207,136,
- 32,121,230,171,223,199,244, 55,126,150, 96,234,181, 15,149,117, 37,212, 85,210,132,104,235,234,247,217,249,206, 31,137, 35, 39,
-111,113,198, 49, 95, 44,233,167, 10,103, 12, 77, 85,227,156,165, 72, 53,182,110, 72, 50,133,240, 96,155,138,219,183, 14,121,253,
-222,125, 14, 79,238, 51,204,115, 70,131, 2,231, 45,211, 69, 76, 42, 58, 62, 95, 48,155, 45, 73, 84,130, 8, 49, 31,100,185,168,
-152, 47,150,180,214,177, 92,204,201, 19,133,113,134, 23, 95,187,141,241,158, 69, 99, 80, 50, 86,163, 73,170, 49, 70,144, 38,154,
-237,173, 43,252, 23,223,255,221,148,119, 63, 25,249,201, 93, 22,183, 82,106,157,249, 44, 69, 64,161,233,111, 15,208,105,138, 18,
- 18, 47, 99, 85,238,234,150,178,169,177, 38, 18,153,108,128,223,123,233, 1, 79,135, 37,195,235, 87, 99,199, 30, 4,206, 27,218,
-233, 2, 15,180,117,133,115, 46,122, 86,109, 84,178,175, 65, 44,235,131,167,243, 68,135, 21,112,197, 93,176,118,109,212, 31, 97,
-165,130,213,157,208,172,139,134,140,236,108, 31,209,165, 93,103,226,133, 36,201,178,216, 1,116, 68, 59,209,205,177,164,210, 72,
-173,145,137, 66,164, 41, 42,203,144,105,142, 42,122,168, 60, 71,102, 5,186, 63, 64, 95,189, 70,123,120, 72, 32,176,243,161, 15,
-226,234,115,116,150,211, 78,166,156,159,156,211, 44,107,174,189,235,235,241,207,127, 2,235,115, 30,158,221, 67, 15,123,228,195,
- 1, 82,170,245,207,170,165, 36, 79, 83, 92,128, 59,149,225,229,211, 25,199,103, 51,134,193,146,154,128,178,150,224, 28,109,221,
- 96,171, 26, 91, 86,216,186,198, 54,109,156,198,139,128, 55,113,245,224,157,195,181, 46,146,181,240,184,214,226,140,197, 89, 19,
-225, 57,173,193,182, 46, 2, 55,172,195,154,248,245,214, 88,156,245,216,198,198,176,160,214,208, 54, 13,245, 98, 65,109, 60, 53,
- 3,220,222, 91,121,242,235,191,141,249, 31,254, 2,214, 24,102, 33,225, 5,185,199,116,217,160,116,130, 74, 82,170,198,114,178,
- 40, 81, 74,209,239,247, 72,148, 64, 38,154,126, 18,225, 25,247,221, 22,195,158,231,186,140,236,129,101,107,144, 4, 70,219,123,
- 60,241,248,155,176,210,209, 88,137, 23,129,214, 5,140,135,197,114,201,188,170,104, 28,236, 12,114, 30, 78,231,216,166, 5, 37,
-169,202,138,170,110,176,222,210,203,146,152,160, 21, 44,255,238,214, 57,223,126,173,207,249,233,148,135, 15,206,105,235,154,241,
-104,159, 98,180, 75,178,189,133,201, 10,178, 36,229,231,255,155,191,203,193,112,128, 48,158, 52,120,178, 92, 83, 87,113, 50, 64,
-150,161,139,156,193,141, 71,152,255,249,159,113,229, 47,127, 31, 71,255,254,255,198,204,206,215, 49,166, 23,242, 93,214, 81,174,
- 23,247,219, 43,117,250, 10, 9,123, 49,183,125, 85, 75,174, 10,255, 21,151,155,117,184,198,198,170, 40, 59,111,250,133,112,183,
- 11,171,162,149,158,189,187,188, 67,156, 18, 6, 17, 34,178,120,149,202,149, 72, 70,207,126,144,244,153,111,233,198,238, 29,155,
-214, 55, 81,123,209, 86,248,106,134, 55, 77,164, 25,202,128,111,218, 88,164,212, 21, 58, 43, 8, 82,197, 11, 8,240,245,178, 67,
-215, 90, 8, 26,169, 20, 65, 37,248,106, 30,199,232, 34,165,173,170, 56,122,111, 22, 68,101,138,196, 57,135,115,158,172,215, 39,
- 88,143,243, 45,190,169, 17, 66,161, 84, 74,104, 27,210,254, 8,153,228,232, 44,139, 31,102,146, 70,113, 99, 80,132,142,216,230,
- 2, 4, 19,153, 19, 58, 45, 98,225,238, 61, 82, 41,116, 49,138, 9,106,222,243,241,223,248, 53,122, 69,142, 82,138, 71,159,126,
- 11,137,112, 92,223, 46,176,137, 70, 39, 41,122, 52,164, 50,150, 98,123,135,182, 83,225, 75, 64,234,149,114, 44, 48,157, 85,140,
-135, 25,179,101, 67,105, 45,181,245, 36, 90, 98,186, 56, 99,211, 77,191, 6, 89,130, 18,130,210, 56, 70, 69,206,172,110,201,147,
-148,235,151, 15,200,242,148,113,111,128,105, 27,118,181,224,228,222,109, 22,179, 9,178,173,208,174,225,180,149,248,173, 75,156,
-184,130, 44, 47,232,105, 58, 4,111,196,251,226, 60,234,226, 4,231, 47,240, 15, 86,166, 9, 37,228,230, 25, 96, 29, 0,184, 22,
-116,110, 28, 24,188, 97,239,190,202, 77,143, 72,224,130,183,124,215, 15,242,241,223,251,115,110,205, 14, 57,111,231, 28, 53,231,
-252,213,175,122,130,167,159,250, 58, 6,143, 12,169,143, 23, 20, 91, 3,206,110,157,208,219, 30,114,118,111,134,194,163,139, 49,
-109,217,224,129,179, 59, 39,177,161, 49,158,201,221, 51,170,105,195,206,229, 62,231, 15,167, 52,229, 18,211, 64, 89,159,211,239,
-109, 19, 18,143,105, 82, 50, 52,211,170, 98,123, 56, 98,186, 92,112, 88,158,162,181,102, 40,135,124,238,214, 45,106, 91, 97,156,
- 39, 21, 9, 18, 69,173,102,108,101, 48,200, 10,234, 86, 16, 66, 75,233, 42, 62,117,244, 10, 31,188,241, 12,137,110,104,131,100,
- 94,214, 56, 95,225,188,199, 57,199,206, 40,193,186, 28,245,183,255,210,215,252,204,162, 18, 60,114,253, 26,139,255,248, 59, 81,
-183, 36, 55,209,194,178, 91, 91,178, 74, 49, 82, 18,149,247, 40, 62,240,221, 72, 5,166,106, 40, 23, 37, 69,166,163, 5,204, 52,
-120, 23,189,136,229, 50,134, 26,164,169,194,180, 13,229,188, 65, 6,199,151, 94,184,201,100,126,194,124, 81,241,216,149, 45, 26,
- 52,137, 10, 12,123, 41,214, 89, 76,219,178, 40, 75,172,245,164, 90,210,212, 21,129,192,209,201, 57,199, 39,167,156, 78,230,212,
-117,131,237,186,221, 94,146, 81, 20, 41, 73,146, 48,155, 87,241, 48, 17,138, 39, 30,127, 27, 95,123,101, 74, 53,159,160, 18,141,
- 49,182, 3,100,120, 18,169,129, 8, 98,233, 13, 11,116,150,162,180, 98,107,119,140,173, 13, 4,183, 86,177,122,235,168,170,134,
-170, 53,236,142,135,188,108,122, 52,175,188,200,254, 56, 35,221,218, 5,157, 34,211, 40,130,145, 58, 69, 56,135, 72,147,248,128,
-106,213,237,144, 54, 44,243,181,149,250, 47,252, 26,225, 27,126,125, 82,174,173, 25,155,216,171,238,207, 88, 85,247,118,125, 28,
-202, 52,141, 99, 77,173, 98,168,137,214, 8,165,162,218,182, 91, 95, 72,157,163,242, 28,149,247,144, 89,129,208, 57, 42,235,161,
-178, 12, 85,244,144, 89,130,204, 50,242,189,203,208, 91,162,243, 62, 82, 37,148,231,167,204,142, 78,104,141,224,234,179,239,161,
-253,236,159,176,245,228,179, 60, 88,156,224,131, 35,205,139,181, 92, 58,120,143,179, 22,211, 26,188,181, 49,238, 52, 75,241, 82,
-113,232, 5, 71, 94,112,212,182, 44,171, 6,202,186, 3,241, 24,124,217, 66, 89,225, 23, 75,204,188,194,150, 21,166,170,177, 54,
-142, 38,189, 15,145,164,215, 29,160,190,117, 81,120,232, 34,173,206,183, 45,166,137,225, 48, 77, 83,211,180, 13,229,162,162,110,
- 3,139,144,114,102,122,204,146, 61,236,240, 6, 77,255, 58,249,206, 21, 6,163, 49,124,228,231,112,229, 2, 33, 37,159,110,119,
-185,107, 36,231,149, 97,216, 75, 25, 23, 5, 6,176,166, 65,137,192,172, 52, 52,198,241, 96,186,160,159, 75,206,203,150, 97, 34,
-120,104,251, 76,250,151, 80, 59, 7, 12,247, 15, 40,118, 14,112,105, 31,124, 25,105,131, 74, 81,154, 8,225,113,206,113,188,104,
-168,235, 26,112,180, 94,196, 73, 89, 85,225, 90,131, 74, 52,141,115, 56,239,177,206,145,136,232,113, 23, 2,254,213, 43,231,108,
- 59,203,181, 92, 48,153,204,145, 77,131, 74, 70, 76, 6,239,130, 76,211,207, 5,234,193, 43,204, 95,189,201,222, 78, 31, 39, 98,
-104,199,210, 88, 70,189,132,157,235, 87,113,206,144,247,134,216,182,100, 84, 9,210, 55, 61,197,217, 39,255,224, 66, 55,124, 1,
- 19,208,121,212,130,124,163,226, 24,177, 81, 22,111, 70,170,155,233,158, 92, 7,187,196,157,122,132,243,109,138, 0,121, 33,126,
- 53, 42,221, 87, 20,187, 78,178,177,154, 26,200, 46,211,190,147,195,203,110,207,186, 34,214, 57,227,185,244,253,255, 53,114,235,
-145, 77,132, 28, 46, 18,229,108, 75,112, 17,131,108,206,239,119,172, 1,179, 70, 58, 59,223,129,100, 68,138,107,107,130,109, 54,
-249,232, 50, 33,152, 26,145,165, 56, 18,100,112,200, 36, 39,136, 52,190,126,237,178,123, 87,193,153,101,231,203,114, 72,153, 18,
-130,237, 10, 32, 25,137,131,180,209,117,210, 27, 35,176, 8,157, 33,132, 70, 41, 21, 93, 34,182, 93,127,226, 90,197, 85,135, 76,
-114,108, 91, 34,117,134,148, 73, 55, 81,139, 63,180, 46,250, 60,124,238,243,188,118,243, 54,185,148, 36,166, 34,147, 48,206, 52,
-173, 74, 49, 73, 70,227, 65,229, 41,174,232,145,246,242, 46,210,214,163,133,196, 58, 67,107, 44,214, 57,182,122, 57,139,186,101,
- 86, 26, 90,239, 41,148,234,246,210,130,214,123,164,144,235, 36,181, 94,154, 82, 59,199,181,173, 45, 46,237,109,115,121,119,143,
-186,174, 41, 23, 75,250,137,224,193,225, 3,164,173,240,117,137, 12,150, 31,127, 93,115,122,237,125,252,210,115,175,242,233, 42,
-227, 63,150,125, 62,153,188, 27,245,117, 63,200,213,171, 87, 72,207, 94,195,153, 6,169, 58,150,196, 58,229,175, 59,243,214,186,
-142, 77, 96,203,234, 57,187,152,126,204, 27, 58,249,141, 77,147, 55, 80,254,193,155,150,226,209,255,132, 90,204,184,121,243,136,
-211,102,198,237,197,109,138, 12,222,251,212, 7, 25, 28, 36, 52,115, 79,177,155,178, 60, 51, 4, 4, 59,215,182, 57,186,125,206,
- 96,212,199,122, 34,188,171, 42,153,206,166,184, 54,242,244,241,150,195, 87, 79,169,103, 19, 78,167,150,203, 55,118,121,120,103,
- 74, 93, 55, 36,233,128, 23, 95,252, 10, 79, 60,253, 56,205,185,229,108, 57, 99,156, 15, 99,192, 89, 88,242,200,165,235,220, 63,
-190,135, 84,146, 94,210,103, 60, 54, 32, 13,109,153,240,112, 81, 98,252,130,214, 90,230,126,137,113, 13,123,201,136, 63,190,247,
- 89,222,123,227,113,116,175, 36, 75, 82,164,149, 28,213, 83, 70,253, 12,229, 21, 65, 10,244,116,214,146,168, 1, 3,225, 56,234,
-240,132, 17, 88,214, 57, 63, 93, 88, 87,213,161,203,210, 32, 8,130,105, 48,174,193,187,128,116, 13,190,245, 72, 37, 56, 63, 47,
-201,147, 4,111, 27,132, 72,112,120,202,101,141, 18,129,162, 16, 72,235,185,180,119,137,147,217, 67, 78,230, 19, 62,254,153, 47,
-240,174,119, 62,139, 27,142, 73,116,228,110,151,203,134,135,103, 15,233,247,115,118, 6, 79, 51,236,231, 92, 26,123,142, 31, 88,
-110,222,126, 29,231, 12,123, 59, 59,104, 45, 24, 37, 57, 50,192,178,170,105, 77,203,206, 96, 64,217, 54, 56,235,216, 26,141, 81,
-245, 41,214, 6, 92, 89, 33, 21, 36, 42,141,135,166,243, 40, 33,113,222,144,102,105, 20,183,185,120,234,244,250, 57,203,133, 71,
-203,248, 51,229,121, 18, 15, 43, 45, 80, 42, 35,203, 18,142,147, 39,249,215,159,185,199,123, 71,175,243,142, 15,126, 3, 77,136,
- 36, 40, 79, 64,104, 29, 47,180,174, 26, 13,193, 35,186,177,242,186, 67,239, 50,187, 67, 88,203,142,187, 17, 28, 93, 36,104,231,
-175, 20,157,194, 59,200, 11,123, 76, 25, 47,244, 78,200, 39,147,206,244,219,157,190,241, 32,140,204,119,149,234, 40,130,241, 14,
- 57, 72,215, 23,184, 72,122,136, 36, 69, 8, 69,208, 18,157,166,208, 90,148, 78,208,143,143,105,103,119, 73, 6, 67,204,226,156,
-242,228, 60, 94, 66, 34, 37,201, 60,166,172,217, 30,140,104,108, 69, 90,228,241,133, 83, 42, 10,240, 66,136,135,120,183,171,246,
- 54, 80,154, 42,118,186,189, 30,105,150, 17, 4, 76,155,134, 7,214, 96, 91,139,181, 54, 82,247, 86,214,191,224, 80, 38, 96,189,
- 37,235,148, 82,158,200,236, 49, 54, 90,213, 26,239, 16, 74,241,224,100, 74, 16,146, 36, 73,232,247,122,228,249,128,241,246, 22,
- 89, 86,144, 13, 51,116,150,199,145,124,211,224,109, 75,189,156,129,159,211, 79, 46,113,245,209, 3,142, 78,239,175,115,194, 79,
-157, 96,214, 24,108,240, 44, 90,199,163,185,100,177,104, 48, 33, 80, 54,150,121,211, 98, 61,236,245, 84,180,221, 40,193,188,170,
-185,178, 51,224,213,135,231, 17,170,209, 56,106, 83,209, 19, 18,211, 41,126,155,170, 98,119, 60,192,250, 16,191,127, 31,153, 3,
-189, 44, 97,178, 44,169,154,134, 97, 47, 99, 54,175, 81, 93,144,142, 39,238, 25,165, 16, 36, 90,225,101,206, 46, 13,191,126,175,
-226, 87,239,182,188,237,177,183,243,206,242,237,124,239,232,221,188,107,208, 99,250, 48,176, 55,114,188,231, 7,254, 22,191,254,
-139,191,194, 83,143, 95, 38, 87,130, 69,235, 41, 50, 73,235, 3,237,217, 4,185,181,141, 55, 53,121, 49, 98,246,240,117,182,191,
-241, 91,215,145,226, 43,121,236, 74,154, 37, 9, 81,236,230, 55, 89,234,161, 27, 24, 17, 88,143,192,161,139, 73,125, 67,199,221,
-125, 77, 71, 94, 93, 9,157,112, 27, 15,188,179, 43,164, 67,247,111,100, 71,160,115, 29, 23,220,117, 86, 38,221,237,209, 59,177,
-221,138, 50, 87, 72,133,126,236, 27, 35,190,149,110,241,238,234,120, 72,137, 40, 84,116,117, 25, 57, 11,222,227,219, 6,239, 74,
-208, 69, 20,197, 89,129, 16, 45, 36, 57,222,182, 8,215,196,224,148,224, 17,197, 0,223,148,247, 51, 43,242, 0, 0, 32, 0, 73,
- 68, 65, 84,184,242,148,116,235, 10, 33,180,216,118,142, 84, 41, 62,221, 38,132, 25, 82,121,172,139, 50,110,153, 22, 88, 27, 45,
-105, 73, 86, 68,133,123,150, 35,149, 70,137, 64,168, 78,113, 89, 31,105, 82,146,241,238,106, 46,140,171,107, 2, 14,149, 36, 56,
- 99,144, 42,190, 31, 42,237,227,157, 67, 40, 73,154,102, 52,139, 9,249,246, 85,156,109,217,127,228, 17,158,152,206, 72, 8,140,
- 15,182,233,185,154,122,182, 64,236, 29, 32,181, 68, 38, 45, 82,100, 40,233, 49,141, 69,106, 69,150,166,216,214,144,231, 57,214,
-149,140, 6, 57, 0,195, 34, 37, 79, 27,218,218,147, 36,146,212, 10, 22,181,237, 68,147, 33, 34,160,133,102,105, 29,151,135,125,
-188,132,189,237, 45, 22,229,146,170,110, 24, 13, 10, 22,101, 69,176, 6,235,106, 82,111,184, 53, 47, 57,216,186,194,107, 15, 95,
-227,210,246, 22, 94, 8,166,243,134,171,201,156,201,228, 30,175,125,213, 95,226,224,253,127,147,131,234, 62,254, 87,126, 20, 95,
- 70, 43,175, 87,155, 0,107,181,138,243, 85,241, 25,243,221,243,176,210,117,117, 91,181,232,172, 88,101,168,175,116, 29, 29,230,
- 0, 54, 52, 68,128,147,251, 47,210, 75,251,204,219, 25,231,237, 49,253, 20, 62,117,251, 14, 73,154,115,242,202, 9,229,178,198,
-222, 94,144,102, 61,170,243, 5,253,113,138, 41, 45,173,141,152,218,186,154,147, 13,135,200,153,141,128,154,126, 74,222,207,176,
-117,203,241,137, 97,188, 3, 89,161,169,235, 6, 23, 2, 85,117, 15,242, 25, 7, 55,182,121,249,139,175, 49,220,234, 38,182, 54,
- 80,132,148,179,163, 51,198,217, 8,227, 13,105, 97, 57,159, 52,188, 50,189, 75, 95,231,221, 61,144,179,176,199, 16, 2, 89,103,
-191,148, 8,126,254,147,127,192, 15, 62,249, 14, 92, 49,164, 63,204,176, 19, 75,226, 37, 58,111,169, 93,133, 92,204, 61, 87,175,
- 94,142,177,128, 62,172, 43, 35, 79, 84, 34,226,227,235,232,217,188,192,182,106,209,161,197,148,115,218,229, 2,223,214,180,203,
- 37,245,178, 36, 81,130,197, 98,193,217,241, 57,229,124, 78, 51,155, 50, 59,159,112,118,116,138,173, 43,122, 3,133, 78, 36, 46,
- 8, 70,189, 49,139,102,193,195,163,135, 24, 91,161, 92, 67,226, 13, 73, 48,236, 14, 50,180,111,185,125,239, 22,141,131,198, 6,
-230,243, 57,119,239,223,225,149,215,239,112,248,240, 1,173,169,113,109,195,178, 42,241, 30,170,170,142, 10,251,172,199,193,214,
- 22,166,154, 83, 87, 83, 26, 99,162, 32, 86, 38,212, 85,221,165, 42,123,132,247,104, 41,177,101,220,141,123, 23,131, 63, 84,166,
- 73, 19,137,116, 1,213,212, 76,143, 30, 16,130, 97,123,220,163, 63,140,213,122, 46, 96,103,103,135,127,123,162,249,135,191,244,
-239,104,207,207, 80,213, 18, 83,198, 46,211,151, 21,174,110,240, 77, 25, 33, 51,166,137,159,177, 53,113,234,225,221, 26,186, 18,
-130,141,170,109,225, 34,237, 35,152,168, 8, 55,209,238,230, 59,193,215, 74, 80,227,227, 15, 19,147,151, 86, 12,235,176,202, 48,
-234,192, 46,214,118,116, 58,139,112, 29, 84, 69,201, 40,138, 75,179,216,149,167, 9, 34, 85,200, 52,235,210,202, 60,140,118,241,
-237, 9, 58, 31, 18,116,130,171, 27,170,178,100,114,116,202,240,224, 50,110, 94, 17, 92, 75, 50, 24, 32, 80,104, 17,255, 92,209,
-141, 70,181,142, 68, 44, 73,180,218,101,121,198,176,200,233, 23, 61,180, 78, 16, 50,238, 18,211, 36, 97,212, 43, 24,101, 5,227,
- 44,103,216, 43,200,211,156, 36,207, 72,210, 2,122, 61,100,111, 64,157,166,204,132, 98,142,230,220,195, 92, 72, 74,169,112, 73,
- 74, 29, 36, 73,158, 51, 30,244,217, 25, 13, 41,210,132, 97, 47, 69, 5, 79, 38, 2, 50,196,110, 77,117, 46, 10, 99, 13,214, 59,
- 72, 53,143, 60,253, 12, 39,255,207, 79,111,212, 53, 14, 94, 93,198,150, 96,148,165,236,244, 51, 22,214, 97, 45, 28,140,251,180,
-222, 50,200, 64, 97, 72,117, 39,152, 34,208, 6,207,253,233, 18, 27, 98, 1, 44,148,192, 7, 73,109, 28,198, 58,164,138, 97, 20,
- 15,206, 23,204,150, 53,247, 39, 11, 4, 80,213, 45,121, 10, 34,120, 50, 25,152,151, 45,222,199, 95,173,139, 41, 99, 85, 19, 45,
-166,169, 12, 36, 26,178, 44,101,183,223,231,201,203, 7, 92, 57,184,206,179,111,126, 20, 77,203,235,183, 94, 96,123, 63, 22,131,
-249,104,136,150,241,125,177, 74, 83,187,184,110,162,137, 34, 68,109, 90,196,108, 25,169,138,211,179,117, 11,190,233,132,226,169,
- 24,121,241, 93,112,198,106,148,228, 55,221,117,108,199,195,218,246, 42, 69,167, 66, 38, 82,201, 86,255, 62,178,223, 87,161, 49,
-241,207,117, 62, 96, 93, 39, 17, 13,235,236,211, 78, 4, 25, 57, 13,126,101,175, 19, 81,103, 17,124,216, 32, 90, 93,252,126,228,
-155,158,236,226, 98, 67,135,134,237,146,100,124,244,158, 7, 27, 34, 18, 54,184, 8,143, 81, 9, 65,198,110,117,125,209,119,153,
- 0,222, 11,130, 76,241,214,116,172,121,139, 72, 83,100,222,195, 46,142,240, 62, 38,199, 5,211, 32,180, 66, 39, 25, 42, 43, 80,
-163, 43,136,172,223,217,125, 91,148,146,216,118, 9,193,162,147, 20,213,137,225,100,214, 71, 9,221, 5,192, 52, 17, 56,213,133,
-184,168, 52,141, 66,217, 21, 6,205, 26,112,241,172,176,203, 57,109, 27,227, 93, 77, 83, 33,165,230,242,179, 95, 75,154,231,164,
- 69, 15,223, 84, 24, 47,145,131, 62, 6,143,151,113,218,166,139, 4,107, 3, 58,145,100, 74,147, 20, 25, 50,209, 36, 66,146,106,
-141,240,129,202, 88,182,199, 57,125, 45, 73, 84,108, 50, 90, 23, 97, 77,161, 91,145,212,214, 83,228,241, 29,159, 52, 13,251,195,
- 62,101,185,196, 89,203,217,217, 41, 47,223,188,201,225,195, 67, 44,240, 66,155,242, 41,125,192,115, 97, 72, 82,244,240,182,101,
-217, 90,174, 95,122,148,191,243,131,255, 57, 31,122,255,187,105,219, 7,252,155, 95,251,121, 94,251,226, 71, 25, 61,253, 46, 30,
-251, 87,183,216,255,142,255,178,203,213,232, 2,249,194, 10, 74, 20,159, 7,239, 46,192,149,214,248,237, 40,178,147,157,206, 70,
-174,126,211,211,221, 91,221, 63,186,168,241,192, 67, 17,224,225,217,109,238,213, 39,212,182,162, 52,129,134, 22,233, 28,166,106,
-192, 10,150,243, 18,231, 2, 58,113,188,250,133, 91,232,190,198, 54, 21, 65,105,182,119, 47,225,132, 39,235,165, 20, 59,125, 46,
- 63, 49,192,122,131,151, 45,198, 85,152,202, 50, 63,157,147, 10, 77, 47, 41, 72,208, 96, 83,190,244,209,231,177, 1,202,202,114,
- 58, 59,198, 73, 71,170, 52,165, 45,217, 29,142, 72,180, 64,120, 79,109, 29,200,192, 40, 41,200,165,164,177, 53, 90, 10,122,170,
- 96, 91,141,113,222,160,132,166, 39, 83,126,249,149, 47, 49, 59,187,141, 43, 53,151,178, 62, 30,207,237,147, 25,214,120,244,123,
-158,185, 66, 93,157, 80, 77, 35, 13,201,251,139,139,138,104,117, 16,254, 66,208,130, 13, 56, 23,225, 39, 13,146,224, 28, 77,105,
- 65, 75,172, 9,104,237,169,102, 11, 38,115,195,246,184,136,197,119, 34,105,235, 6,133, 36, 17,150, 39,246, 6,188,210, 31, 80,
- 55, 13,211,122, 70,145, 73,238,220,127, 64, 89, 90,118,119,182,200,100,224,225,201,156,170,109, 56, 63,159,176,191,179,199,194,
- 72,250,233,144,183, 92,123, 27,127,237, 59,159,229, 67,207,126, 3, 39,159,253, 18, 63,242,255,254, 22, 87,182,182, 56,158, 85,
-108, 13,135, 36,170, 71,158,102,120, 59,167,169, 39, 8,191, 77,161, 53, 66,203,184,119,207,211,136,146, 69,161, 19,213, 85,124,
- 54,174, 12, 82,133,109, 29, 74, 18,247,243, 89,130,240,150, 94,162,233, 15, 10,122, 91, 91,209, 71,218, 90,166,211, 10,173, 5,
- 7, 69, 66,165, 15,248,199,127,240, 18, 31,120,116,155,111,121,207,147, 44,230, 77, 4,211, 52, 13, 65,107, 68,154,197, 29,120,
-199,179, 22,184,181,181, 35,194, 80, 86, 97, 19, 29, 60,197,118,225, 21, 62, 42,226,227, 94, 49, 30, 86, 2,191,169, 64,137,151,
-130, 76,244, 58,213, 73,172,128, 51, 62, 30,116,206, 6,164,202,214, 28,120,180,138,153,239, 73, 26, 5,102, 73, 26,173, 31,206,
-160, 84, 14,201,156, 80, 5,228,120, 4,120,166, 15,238,115,247,245, 91,204, 22, 21,143, 14, 71, 52,119, 95,142, 64,136,225, 8,
-111, 13, 94, 4,130, 9, 72,169,163,239,182,139,139, 12, 42, 65, 75,135,215, 62,174, 73, 8,104, 37,144,137,234,152, 2, 81,224,
-166,210,206,179,228, 37, 74,122,188,181, 52,157,183, 94,152, 54, 98, 91, 69,192, 6, 79, 47, 79, 49,198, 69, 88, 79,136, 28,209,
-188,139,150,157,207,151, 20,189, 30,117,213,146, 36, 5,222, 89, 84, 58, 32,120, 67, 99, 97,177,168, 98,236,170,173,184,118,112,
-149,244,240, 11,204,108,220,225, 11, 21,187, 78,165, 36, 34, 64,191,167, 73,181,162,109, 91,180,140,105, 85,169, 18,216, 46, 26,
-246,124, 58,101,145,101, 92, 30,245, 73,180,192,181,134,198, 58,132,116, 32, 20,153,214, 44,219, 22,213,229, 71,183, 46, 78, 90,
- 38,139, 37,227, 34, 37,201, 18,188, 77, 56, 58, 43, 17, 34,224,133, 68,227,105,101,212, 19, 96, 34,139, 58,116,226,174, 32, 32,
- 87, 81, 39,210, 56, 79, 89, 87, 40,233, 41,219,138,207,189,240, 50, 95,247,181,239,102,119, 91, 16, 51, 72, 4,147,202, 49,170,
- 91, 26,239,184, 60,200,121,252,250, 21,150,213,140,166, 49, 32, 43, 20,130,162,183,141,176, 96,103,103,172, 6, 65,114,227,170,
-140,173,143,164, 11,215, 8,235, 36,179, 85, 42, 91,116,193,108,162, 89,141,139,161, 47,206,121,212, 74,177, 46, 66,215,241,117,
-153,237, 68,214,247, 90,188, 4,107, 5,115,236,176, 68,215,137,123,240, 2,161,233,222, 5, 8,210,175,133,118, 8,129, 84, 80,
-188,229,131,113, 34,133,136,246,175,238,155, 14,182, 2, 31,112,245,140, 96, 27, 68,210,239, 50, 22, 0, 85,196, 8,213,164, 7,
-194, 98,171, 9, 42, 31, 19,154, 37,198, 59,146,254, 22,222, 84,177,104, 70,162,242, 33,118,233,177,205, 98, 61,221,178,203, 83,
-164, 78, 99,102,186,155, 33,147, 12, 97, 61, 42,235, 35,243, 17,162,173,145,201, 16,225,107,132,140,138,124,215,212,232,188,192,
-155, 58,126, 70,105,130, 74,123, 29,115, 33,218, 96,157,235,242,211,139, 30, 50, 40,156,171,226,249, 80,149, 81,204, 90,196,103,
-126,251,250, 13,250,253, 62,229,217, 9,106,184,205,150,136,252, 10,215, 90,194, 48, 1,171,176,203, 5,249,112, 72,179, 88,224,
-140, 69,167, 10,159,106,240,129,204,107,236, 32,199,206, 43, 16,146, 68, 75, 6,137,194, 7,176,193,163, 36,180, 94,144,105, 21,
- 39, 84,203,134, 31,254,208,123,185, 90, 12,232, 63,243,205,244,190,234,155, 24,188,233, 45,140,242, 5, 31,253,237, 63,228,165,
- 47, 60, 79, 49,251, 83,252,103, 62,206, 91,191,233,219,249,199,191,252, 57, 30,251,250, 39,241,211,146,175,125,251, 59,120,242,
-205,143,241,155,255,246, 55,249,226, 75, 47,172,197,145, 31,251,210,167,248, 7, 63,247,223,242, 11,255,224,151,248,254,159,250,
-135,236,190,229, 77, 60,255,143,126, 50, 78,106,226, 53,211,105,158,162,214, 64,117,147, 28, 65, 44,156,157,141, 64, 35,239,197,
-154, 60,185,202, 41, 80, 43,234,156,239,136,168, 68,171,228,233, 75,159,160, 85, 79,145, 37,146,198, 75, 90,107,249, 96, 95, 80,
- 54, 83,130, 22,108,239, 15,121,248,106,137, 23, 21,103,199,135,228,197, 21,210, 94,138,144,142,249,116,138, 36,103,113,188, 96,
-247,202, 1,167,183, 31,160,243, 17,242,255,231,234,189,163,109, 79,207,250,190,207, 91,126,109,183,211,239,185,117,238,189, 51,
-163,233, 51, 26,212, 53, 52, 33, 36,138,132, 36,140, 5, 54, 77,150,192, 33,203, 88,113,192,198, 1,199,216, 75,134,100,101,145,
- 64,176,157,229,144, 4, 34,123, 17, 69,150,196,162,153, 80, 12, 26, 6,132,122, 27,205, 72, 26,141,238,244,219, 78, 63,187,255,
-234, 91,242,199,251,219,251, 92,249,175,185,107,214,217,229,156,189,223,242, 60,207,247,251,249,250,138,184,215,161,168,142, 89,
-223,234, 49, 25, 21,164,253,140, 36,141,131, 61,219,172,179, 55, 62, 98, 99, 43,163,155,109,114,120,189,228,230,244, 58, 86,192,
-185,141,140,105, 94, 51, 49, 83,214,163, 45,106,115, 76, 87,118,217, 92, 75, 24,206, 37, 55,199, 99,182,178, 53, 74,142,200,115,
-133, 50, 10,141, 66, 74,129,242, 13,191,127,253, 37,190,255,108,143,210,166,236,150,199,120, 28,195, 60, 71,253,200,107,238,123,
-223,249,123, 95,193, 71,126,255,143,185,231, 91,190,153, 52,233, 82,238,220, 96,145,251,176, 88,196,214, 5, 79,225,162,191,150,
-221,118, 23,182, 55, 96, 62,203,151, 60,226,170,174,153,207, 10,234, 58, 8,197, 70,163, 25, 85,211, 16,139, 96, 33,202,167, 19,
-226, 88, 34,140,225,133,157, 17,135,163, 33,214, 22,148, 69,195,198,250,106, 72,230,169, 29, 89,183, 67, 55, 85, 40, 4, 55,246,
-199, 20,211, 35,238,188,237, 28,214, 11,126,238,189, 63,194,111,253,222,127,230,155, 38, 79,226,199, 35,190, 52,115, 68, 73, 68,
- 95, 74,162,120,133,243,219,103,216,219,127,158,155,187, 59,188,233,161,219,184,180,149,208, 84, 77,107, 7,243,196,113, 28, 18,
-123,218,185,160, 74, 51,226, 78, 6,214,145,245, 59, 20,211,130, 52, 14,126,236,166,169, 1, 79, 36, 21,107,219,167,200, 58, 25,
- 74,235,176, 41,217,160,200,143, 84,216, 96, 86,178,132, 43,251, 19, 62,243,236, 53, 94,121, 97,157, 88, 42,154, 22,139,234,155,
-128,127, 93, 84, 50,193,146,213,210,230,104,121,206, 33,235, 48,180,222, 23, 10, 16, 33,218, 3, 63,248, 48,195,198, 42, 78,188,
- 29,173,133, 38, 56, 64,218, 11,128, 12, 63,227,101, 11,124,104,161, 54, 42,138, 81,105, 55,196, 69, 70, 17,190, 14,184, 75, 33,
-130,210, 94,159,190,192,149,199,126,143,205, 59,239, 8,208,151,104,149,233,179,143,243,197, 71,255,134,253,157,125, 86, 55, 79,
- 81,161,216, 62,120,150,106, 58,103,229,225,111,230,202, 19, 31, 67,122, 25,124,222,214,130, 8,118, 49, 33,130,247, 91, 74,129,
- 51, 22, 87,215, 97,227, 86, 10,165,212,137,118,160,229, 61, 10, 21, 54,101,215,138, 5, 5, 46,184, 24,156, 11, 7,105,219,120,
- 50,173,191,223,218, 32,246,168,139,154,198, 89,148,104,173,124,132,131,175,155,118,209,145, 14,227, 13,235,152,141, 39, 88, 17,
-161,101, 67,217,120,238,188,116,145,226,209,127,183,204, 0, 89,200,190, 63,157,119, 41, 92,192,225,198, 58,194, 32,216, 90,233,
-128, 16, 28,207, 43,202,186,161,170, 27,166, 69, 67, 39, 22,116,210, 24,213,182,184,105,115, 11,180, 12,235,228, 56,175, 16,210,
- 97,105,187, 41, 82, 96, 77, 0,231,148, 85, 67, 28, 9,134,147, 57,117,109,201,210,136,105, 94,147,166,113, 91,221, 7,181,126,
-164, 61,214, 4,134,132,117, 80, 91,135,144, 17,157,238,128, 78,255, 52, 38, 74,121,237,195, 15,242,186, 71, 94,137,238,137,101,
-180,231,103,254,253,127, 64,100, 9, 85,101,217, 74, 18,198, 47,222, 32,202, 18,214,182,214,137, 59, 25,145, 78, 24,156, 57,139,
-144, 3, 14, 62,249,251,228, 47, 62, 29,198,231,126,209,169,243, 45,223,253, 86, 59,218,201, 1,190, 32,144, 45, 4, 74,110, 1,
-106, 21, 33,107,125,145,216,118, 98, 51,106,187, 1,174,181,201,202, 19,171,219,173,204,152,133,250,201,187,214,126, 79, 8,226,
- 88,206, 73, 23, 78,183,246, 77,157,251,169,223, 68,101, 29,160, 90,120, 29,192, 22, 97,140, 80,230,120, 23,232,142,193, 11, 30,
- 98, 61,141, 13, 85,184, 51, 53, 94,234, 48,211,110, 67, 76,164,140,218, 10,191, 65, 39,157,208, 69,104, 19,220,108, 57, 15, 20,
- 69,239,113,166, 14,243,238,184,139, 74, 58,224, 45, 42,235,163,146, 46,190, 46,113,213, 28,153,246, 81, 81,140, 80,129,201, 32,
-163, 24,111,218, 11,164,210, 33,186,151,150,107,186, 60,234,194, 60,221, 85,161,179, 87,205,231,164,171,107,225,162,222, 90, 67,
-165,140, 41,143,118,185,250,133,207,145,246,187, 12, 86, 58, 36, 77, 78, 61,158, 66,154,208,168,164,237,200, 69, 84,147, 17,200,
-160, 37, 40,243, 28,107,108,208, 68,169,136,217,108,142, 80,130,227, 97,206,254,180,164,104, 44,227,198,161, 60,204, 77,232,182,
- 92,157,148,124,255,203, 95,198, 47,253,236,223,231,204,229,115,244, 78,245,233,187, 25,189,181,237,144, 41,145,118, 57,255,192,
-253,148,118,157,175,154,187,249,133,223,252, 85,158,250,179,255,200,199,175, 92, 35,234,111,115,122,125,192,197, 11,219,252,251,
- 15,252, 54, 87,119,119,120, 56,129, 95,124,215, 15,240, 19,111,121, 19,111,190,231,110,222,240,240, 55,241, 51,191,254, 75, 12,
-138,211, 60,242, 15,255, 62,199,127,242, 33,236,116,132,211, 41, 19, 43,145,221, 77, 68,127,149,104,176,134,140, 50,180, 56,217,
- 75,164, 4, 39,195,231,177,152,167,187,246, 59,215, 78, 57,151, 26, 15,215, 90,179,227, 44,227,249,188,203,141,201, 49,147,106,
-130,244,240,217,241,140,159,252,182,119,162, 59,138,114, 18, 48,231,197,116,198,225,141,125, 54, 46,220, 17,236,182,190,102,239,
-197,125,138, 73,205,233,151,157,163,154,143,105, 74,112,214, 50, 63,170, 41,103,115,154,218,146, 37,146,209, 40,199, 56, 67,212,
-173, 88, 57,221,103, 58, 44,152, 53,115,142, 39, 71,232,184, 97,125,181,203,209,209, 52, 0,214,148,224,112, 56, 38,149, 41,185,
-153, 51,175, 10,188,132,105, 94, 50,107,230, 40,233,113, 54,103, 99,160,217,159, 21,104, 41,233,169, 14,145,212,228,182, 96, 16,
-117,185,153, 15,121,248,212, 25,178, 56,226, 32,159,210,137,186,168, 55,221,126,238,125,174, 46,120, 97,127,204,248,224, 69, 46,
-189,234, 17,206,124,235, 27, 25,126,254, 19, 75,244, 99, 16,105,251,165,104, 78, 8, 69,241,245, 39,233,190,230, 13, 24,211,112,
- 52,156,129,169,153,142, 70, 8,225, 49, 77, 69, 83,228, 84,166, 14,115,189,178,162,105,185,230,145,244,104, 28,197,172,226,165,
-195, 99,106, 87,163,132, 39,209,146,218, 40,234,150, 46,213,237,246, 24,116, 52,231,183, 6, 88, 15, 23,182, 86,233,247, 87,248,
-127,255,224,143,113, 54,226,251,238, 76,201,213, 38,127,120,229, 42,167,251, 61, 78,109,223,197,122, 55,229,139, 95,249, 24,243,
-188, 96, 86,195,187,223,244, 32,216,138, 56, 77,240,214, 34,125,136, 29,148, 90,225, 81,161, 58,147, 2, 37, 2, 85,205, 55,205,
- 9,208,196,154,224, 41,183, 22, 25, 69, 36,105,140,142,117,104,103,251, 80,213, 89,107,169,202,138, 44,214,104, 37,232,102, 17,
- 90, 40,254,244,203, 47, 48,159,140,184,107,107, 21, 97, 29, 85, 93, 35, 90,127,186,179, 46, 96, 93, 9, 33, 39,190, 54,173, 27,
- 52, 28,232,139,252,230,101,182,117,171, 6, 62,249,127,183,228, 63, 47,212, 75,250,132,133,238,252, 2, 51,219, 94, 18, 92,192,
-101, 10,165,145, 73,134, 87, 42, 36,164, 89, 27,126, 77,219,144, 14,182,120,236,253,255, 35,119,127,215, 59, 16,211, 67,228,202,
- 25,134, 95,251, 52,143,126,228,119,152,142, 39,164, 27,235, 68,120,238,180,115,200, 71,100,167,206,115,100,114,246,110, 60,191,
- 96,195, 45,161, 16, 74,170,192, 53, 80,234, 4, 32, 35,101, 72, 96, 16, 96, 93, 16,189,185,150, 32,225, 8,213,185,183, 38,100,
-196,183, 65, 47,150,144,197,238,188,167,105, 76,120,140,181, 84, 38, 76,207,188, 49, 88,235,136,180, 38,210,154, 88, 74,250,189,
- 46,113,156,128, 12,177,153, 42, 74,201,243, 41,181, 75, 16,190, 6,229,233,102, 43,156,250,234, 7,151,153,237,162,189, 0, 73,
- 4, 95,168,186, 68,177, 34,141, 99,146, 52, 65, 32,233, 38, 17,147,178,166,106, 44,243,170,164,106, 12,131, 94,196,120,150,115,
-122,173,135,245, 65, 49,156, 69,138,218, 6,134, 66,109, 12, 71,227, 25, 66,122,180,146,212,214,161,112,140,166, 5,117,211,208,
- 56,193,112, 94, 5, 58,161, 16, 20, 77,192, 25,143,242, 50, 84,163,222, 17,171,182,234, 21, 22, 41, 66, 11, 82, 43, 69,164, 99,
-210, 56,230,226,109,247,242,154,123,239,230,155,191,249,155,168,237, 58, 46,246,244, 50,197,181,199, 63,197,199,127,247,247, 25,
-244, 58, 36,145,100, 99, 53,101,109,125,133,149,211,171,168, 52, 37,234,116, 24,108,159,163,185,122,147,245,135, 31,225,197, 15,
-255, 90, 8,222,241, 39,234,115,207,201,124,124,105, 87,111, 55, 78,213,206, 56,151,131,247, 91, 84,242,139,246,209,146, 39, 47,
-110, 9,108, 89,122,212,197, 82,211,230,220,201,236, 29,119, 98, 85, 10,250, 21,185,212,149, 44,159, 79,158, 68,178,166,183,221,
-203,230, 91,222,139,247, 21, 66, 54,225, 65,205, 60, 8, 47,188,199,206,143,176,229, 28, 84,132, 41,167, 88, 17,227,209,152, 98,
- 26,116, 36,237,172, 56,140,182, 60,194, 24,108, 51, 71,182,226, 80,231, 5,182,152, 34,210, 62,206,217, 16,181, 44,131,216, 52,
-140,207,154,246,119, 48, 64, 72,192,179,249,184,205, 99, 23, 1, 69,107, 27,188,241,168,172, 27,132,118,117, 56,236, 93,157,163,
-180, 38,234,172,181, 74,254, 22,243,210, 94,106, 93, 93, 6,199,135,115,184,186, 65,170, 96, 65,179,141, 65,202, 8,213,233, 51,
-190,126,149,249,222, 14, 73,164, 88,205, 34,142,142, 38, 88,231,240, 73,140, 21, 65, 32, 43,226, 8, 83,228, 1, 3,140,162,152,
-151, 52,117,141,241,130,170, 8,130,185,107,135,115, 26,227,152, 52, 1,207, 52, 51,158,198, 57, 70,149,225,189,111,120, 57, 63,
-250, 67,111,161,194, 18,109,172, 19,111,174,211, 23, 2, 81,121,234,222,105,108,146, 81,140,103, 36,253, 46, 95,252,248,231,249,
-194,147, 47,241,190,255,243,127,225,255,122,255, 31, 82,151, 51,162, 40,226, 19,159,253, 20,227,217,132,135, 98,120,160,175,248,
-129,127,252,223,146,245,186, 88,111, 73,226,132,191,253,154,111,231, 31,253,175,191,200,219,223,246,115, 52,175,251, 59,252,235,
-191,249, 42,143,201,203, 92, 63,243, 58,110,158,122,144,228,117,111, 99,124,231,183, 83,220,255,189,196,223,241,110,146,239,124,
- 15,219,111,125, 55,151, 94,245, 32,243,171,207, 81,143,143,195, 87,183, 29,251,217,197,197,180, 29, 25, 59,183,200, 49, 17, 20,
-243, 9,205,153,251,248,252,139,207, 98,125, 77,225, 12,195, 58,231,159,252,224, 79, 81,152, 9,147,195, 9,105,111, 64, 81,228,
-140,134, 53, 23,239,187, 64,103,144,113,227,217,107, 36, 73, 15, 83, 87, 8, 41, 48,141, 64,198, 21,213,204, 82, 86,193, 45,166,
- 35, 73,149, 19, 46,228,221,156,106, 46, 64,151,156,189,184, 65, 49, 44, 57,152, 77,169, 42,195,254, 81, 65,156,120,122, 93,201,
- 60,175, 24, 87, 35,114, 59,195,217, 0, 6,234,233,140,185, 41,168, 76,206,164,153,144, 27,203,184, 10, 99,195,126, 20,147,196,
- 53, 17, 17,185,105, 16,194, 82, 88,199,188, 46,176, 70,209,209, 9, 26,133,250,103,111,251,214,247,117,210,136, 59,183, 79,241,
-174,223,250, 67,222,253,234,203,168,222, 38, 81,183,199,228,249,103,151,184,190,112,249, 22,139,152, 7, 92, 83, 33, 46,221, 75,
- 35, 4,179,233,140,107,251,199, 84,101,193,100, 50,103,158,231, 76, 11,139, 20,142,209,116, 78,130,225,104, 92, 32,176, 8,227,
-208, 26,102,147,156,235,251, 67,202,166,194,121, 71,162, 20, 90, 69,196,145,103, 54, 47,169,139, 25,251,195, 34,204,191,149,226,
-185,221, 3, 14, 14,247,184,182, 55,230,238, 45,197,221,162, 32,142, 50,190, 56,209,156, 93, 91,227,218,181, 23,120,235,229, 57,
- 31,121,252, 37, 54,186, 25,149, 79,121,251,195,103,218, 69, 39, 72, 98,133,179, 54, 16, 92,101,219,106, 93, 38,249,132,148, 40,
-211, 24,210, 88, 82, 22, 13, 90, 9,162, 56,180,196,180, 86,232, 54, 54, 81,181, 1, 13,182,169, 3,143,186, 53, 93,174,246, 59,
-164, 81, 68,150,104, 86, 59, 49,187,227, 57,143, 61,253, 18, 85, 62,229,142,205,117,164, 16, 84,141,129,198, 4, 30,181,255, 47,
- 50,129,157, 91, 76,196,195, 38,103, 93,251, 51,139, 42, 93,158,248,206,111,145,205, 47,218,152,190, 13,185, 94, 86,234,237,220,
-222, 57, 31,252,224, 81, 22, 20,192, 77, 0,192, 56, 4,206,212,100,253, 77,254,226, 35,255,134,249,108,194, 67,223,241,157, 28,
- 61,243, 20,227,171, 79,243,169, 71, 63,202,202,218, 26, 27, 90,114,103, 49,229,188,111,200,203,156, 81,212,229,154, 45, 57,218,
-127, 17,165, 99,124, 85, 47,227, 32,105, 69,150,194,133,249,160,104,189,241, 75, 37,150, 95, 80,226, 92,107, 77,241,237, 97,221,
- 6,187, 88, 75,211, 82,174,156,117,216,198,224,108,136,106,245,132, 46, 0, 62, 8, 55,235,170, 94,130, 41,180,146,116,123, 61,
-210, 52, 13, 33, 42, 77, 73,146,246,169,138, 60, 8,236, 26, 3,190, 2,169,121, 88, 30, 97,142,174,134,185,112,139, 26, 93,180,
-116,159,168, 58, 20, 78, 44, 85,227,162, 85, 67,119, 99, 77, 85,215,212,117,197,112, 90, 48,203,131,240,175,159, 42,164,212, 24,
-227,104, 92,176,231, 88, 23,230, 98,147,217, 60, 84, 22, 66, 98,172,195,184,112, 80, 5,176, 78,176,223, 41, 37,168,141,193, 25,
- 19, 14,126, 41, 72,212,162,178,149,232, 72, 18,169, 40,104, 56,210, 40, 40,166, 93,195,109,231,239,225, 91, 94,251, 8,119,220,
-117, 23, 62, 78,192, 23,172,159, 89, 33,139, 4,127,240, 47,127,158,114,116,136, 23,130,245, 52, 37,182, 6,210,136,222,198,128,
-206,202, 42,235,235,235, 36,221, 21,188, 17, 36,151,207,178,255,167, 31,110,233,109, 39,213,242,146,242, 38, 8,109,240,150,236,
-198, 45, 21,208,146,180,235, 69,216, 35, 90, 40,149,184,197,106,180,224,138, 47,158,191,237, 52, 47,193, 32, 50, 4,149,133,116,
-173,197,207,112,194,147, 15,161, 59,126, 1,254, 70, 44,196,131, 90,176,246,198,159,160,123,207, 43,195,188,222, 54, 96,171, 86,
- 62,111,176,245,124,153,172,214,148, 57,141,177,216,198, 96,138, 9,206,121, 76,219, 53,115,197, 4,154, 50,216,171, 16,168,180,
-131, 45,115, 28, 2, 91,229,173, 42, 91,227,202, 57, 58,235, 35,116, 8, 92,209,217, 32,248,223,171, 25,190,202,113,206,134,110,
-143,142, 16, 50, 66,168, 24, 29, 69, 97, 77,136, 54, 17,176,169,136,186,107, 33, 68,166,237,186, 9, 29,135,131, 63,216,139, 16,
-198,225,156,193,212, 13, 74, 71,152,170, 33,238,117,131,117,216,250,128,164, 22,193, 47,221, 76, 70,204,110,188, 64,119,101, 64,
- 87, 75,142,142,167,148,101,141, 19, 26,171, 34, 68,146,182,227,174, 24,169, 35,188, 14,196,186,170, 40,113, 45, 86, 88, 74, 65,
- 81, 89, 6,189, 46,243, 60,240, 70,106,231, 48,222,115,231, 70,159,159,253,241,183, 81, 54, 21,233,234, 74,120,237,201,156,248,
-104, 8, 94,144,187,117,102, 81,134,169, 13, 87,175,143,152, 22, 19,180,172,233,117,215,249,149, 95,253,167,124,234,177,231,120,
-226,107,143, 51,171,231,188,243,129,243,252,221,239,124, 45,239,248,153,127,200, 93,223,252, 70, 14,158,125, 10, 91, 22, 28,222,
-188,201,115,215,111, 96,202, 57, 47, 61, 59,228,221,239,121, 19,127,249,235, 63,207, 61,233, 17,155,253, 20,125,246, 33,158,191,
-182,199, 74,175,203,205,227, 41,147,249,156, 27,123, 67,242,170, 97,214,189,157,205,183,252, 24,247,254,228, 63, 98,243,194, 5,
-142,191,252, 56,166,204, 17, 58, 66,182, 90, 9,191,216, 31,219,241,145,240,142,203,175,248, 62, 62,241,213, 43, 52, 84,236,206,
-102,204,172,225,191,127,215,187, 57,184,113,157, 40,142,136,210,132,124, 56, 35, 78,186,228,195, 9,179,233, 33,179, 81, 65,127,
-101, 13,231, 42,154,162,161,170, 2,249,116, 60, 28,161,123, 37,151,239,185,204,225,205, 67,166,197, 28,173, 98,198,147, 10, 73,
-197,206,126,142,170, 4,207,239,223,192, 88, 67,166, 58,120, 33, 72,164,102, 86,207,192, 70,236, 21,187, 32, 4,141,109,200,162,
- 4,171, 42,250,113,138, 49,158, 88,166,116, 85, 74,110,114, 26, 91, 81, 56,207, 32,210,188, 52, 31, 81,186,154, 72,106,140,183,
-236,215, 37,155,145, 34,147, 41,113, 87,160,222,243,205, 15,190, 47,235,119, 72,164,230,223,253,197,167,121,243,229, 45,110, 94,
-125,137,187, 30,249, 22,246, 63,251,201,147, 52,171,118,247,243, 16, 50,130,149,162,252,250, 19, 28,157,185, 23,111, 43, 14, 71,
- 83,174, 29,140,105,140, 35, 86, 1,239,153,104, 71, 93, 55,140,103, 21,117, 93,112, 60,171, 88,233, 40, 34, 12,137,132,227, 81,
-205,172,153, 83,215, 53,101,227,232, 37, 25, 89, 18, 49,159,215,204, 75, 75,166,225,230,225,136,227,225,156, 98, 94,209, 88,195,
-212,193, 63,191, 63,225,233, 43, 59, 92,188,239, 85,252,155,143,126,140,143,126,250,243,252,226, 59,191,133,213, 24,174, 31, 79,
- 25,230, 13,169,234,240,253,223,254, 48,166,156, 18, 69, 18,211, 24, 18, 37,169,170, 18,225, 28,170, 13, 42, 8,220,117,215, 42,
-252, 5,182,118, 72, 76,235,139, 12,138,110, 79, 8,143,144, 94,130,181, 97, 50,104, 13,243,121, 25,136, 83, 66,162, 22,248, 85,
- 23, 32, 40,131, 44, 98,189,147,113, 84,214,124,250,249,107, 28, 29,143, 57,149, 37,100, 73,184, 40, 84, 77, 29, 90,115, 50, 84,
- 13, 46,244,143,218,247,211,182, 63,197,178, 94,106, 45, 28, 39,190, 34, 33, 67, 37,235,221,130,187, 29, 14, 70,219,182,240,173,
-109,130, 83, 65,197,193, 86,101,105,173, 95, 13,206, 88,176,144,246, 55,248,208,111,254, 18,113,156,226, 61,104, 51,231,197,167,
-158,102, 58,158,208,189,122,131, 83,135,187,164,182, 98,223, 10,158, 17,146, 35, 45,153,187, 38, 92, 10,140, 37,142,163,192,131,
-175,131,114,125, 1,139, 8,216,205,118, 54,102,195,223, 82, 72,129, 80, 42,176,209,111, 21,182,220, 66,131,114,173,218,218, 90,
-123,226,225,119,225,177,214,121,132, 10,127,103,103, 45,221,206, 10,221, 78,143, 78,183, 79,191,191, 78,191,223, 39,146, 17,198,
-148,232, 36, 69, 18,225,189,192, 24, 67, 99, 74,140,107,120,208, 29, 33,247,190,178,196,159, 46, 90,197, 11,241,215, 13, 6,204,
-101,192,230,102,113, 76, 22, 37,156, 91,239,208,120,200, 27,203,225,120, 14, 88,230,179,130,178,178,164,177,102,165,147, 96,189,
-199,250,192,231,143,148,164,110, 60,149,105,130, 63,222,153, 86, 96,230,131,205, 69, 11,140,135, 78, 44,176,214, 16, 73, 73,214,
- 73,192, 89,146, 52, 38, 47, 26,138,218, 46, 79, 63, 41,131,238,163,241, 10,143,103, 99,253, 2,231, 47,220,205,153,237,115,156,
-191,112,134,198, 58, 54, 54,207,145,173, 36,116, 18,193, 71,255,213,175, 32, 98,141, 22,158,110, 71,179,213, 95,199,198,176,182,
-182, 66,191,147,146,245, 87, 40, 94,186,202,197,159,248, 25,190,244,222,239, 9,246, 79,119,171, 83,242, 36,190, 82,180,216,208,
- 96,183,116,223, 32, 84, 90,180, 57, 23,100, 48,209,218,223, 78,230,152, 45,225, 79, 44,241,135, 97,198,174,196,178,250, 95,166,
-182,181,195, 80,239, 67,222,185, 88,204,217, 57,137,227, 13, 98,187, 64, 17,147,253, 53, 46,253,227, 15,226,125,131,240,121,184,
- 29,216,166,197, 46, 27,156,105,104,230, 67, 92, 83,225,172,164,153, 77,177, 77,129, 55, 97,116, 99,202, 57,166,152,128, 9,172,
-135, 32,208,171,240, 66, 45, 59,117, 34,138, 67,248, 11, 46, 84,217, 72, 92, 85, 32,116,132, 19, 50, 92,198,141, 1,157,130, 80,
-136, 40, 11, 29, 0,103,240,213,156,186,152,160,162,192,131,192, 59,124, 93, 5,234,220, 34,108, 9,129, 51, 21, 82, 42, 68,156,
-162, 85,180, 28,109,184,178,162,169,114,164,142,105,202, 28,143, 71,199,113,139,181,174, 80,105,135,184,179,194,222, 51, 95,165,
-155,198,116, 6, 43, 92,189,113,192,212, 43,138,105, 65,101, 66,244,171, 16, 42,240, 53,154, 6,157,100,193,110,171,194, 72,172,
-170, 42,156,151,188,176, 59,100, 56,171,104,156,163, 48,142, 72, 41,142,102, 21,191,241,222, 31,194,175, 13,216,184,243,110,180,
- 4,198, 19,220,124, 74, 36, 37,126, 94, 51, 58,125, 63,199,121,131,242,142,131,209,148,167,159,223,229,169, 47,127,145,126, 54,
-224,244, 29,119,240,182,239,121, 51, 47, 93,217, 33, 47, 29,159,123,230,171,124,247, 35, 15,178,158, 40, 26,107,201,199, 67,166,
-195, 35,158,185,114,133,151,246, 14,217,157,228, 60,246,197, 47,240, 51, 63,251,211,188,255,223,254, 26,155,171, 61, 46,136, 33,
-247,137,235, 92,190,251, 1, 62,241,204, 14, 54,207,177,192, 86, 71, 33, 84,130,119, 13,163,113,206,100,210, 80,110,221,206,189,
- 63,246,147, 92,124,205, 35,220,252,171, 63,195, 53, 53,173,178,231, 27,146, 5,113,158,217,179, 31,231, 82,106,184,204,156,207,
-204, 4,165,111,248,169,111,123, 19, 59, 55, 71,164,157, 8,175, 43,166, 71, 51, 64,135,200,233,172, 79, 83, 88, 58,171, 41,101,
- 97, 65, 52, 76, 71, 35,108,109, 73,226,152, 56, 21,140,246,142,217, 61, 24,210,235,117,217,216, 88,101, 62,159, 50,154, 84, 20,
-126,202,222,100, 68,166,250,148,174, 98,179,183, 70,154, 90,134,243, 57,222,122,166,245,152,198, 55, 68, 34, 65, 74,137, 86, 22,
- 48, 68, 90,208, 75, 36,120, 67, 63, 73,169,173, 33,214, 9, 10,207,176, 42,169, 93,141,113,166,117,145, 8,182,146, 21,166,166,
- 38,119, 51,206,117, 79,163,222,113,239,229,247,105, 1, 89, 18,241,161,143,125,145,203, 29,205,197,237, 13,182,182, 54, 64,105,
-102,215, 94,106,115,213, 79, 64, 52, 33,135,195, 35, 76, 67,148, 79,184, 26,175, 51,157,231, 24, 99,153,206,115,240,158, 72, 88,
-174, 29,140,153, 22, 53,113, 4,101, 99, 89,141,195,130,238,118, 98,180,247,236, 30, 78,169,157,227,250,193, 1,177,150,100,157,
-152,249,188, 34,234,164,212,198, 82, 91,136,180, 38, 75, 34,182, 86, 82, 58,145,102,179,215,161, 20, 43,188,174,111,249,209,223,
-253,107, 92, 99,121,253,253, 15,241, 61, 15,174, 50, 53,158, 55, 63,116, 7, 7,179,156, 66, 20,124,246,201, 35,222,254,250,203,
- 33, 49, 71, 10,170,162,194, 87, 5,166,168,130,162, 23, 31, 14,109, 99, 23, 6,218,160, 58,111, 17,166,206,123, 18, 37, 2, 24,
-196,133,195, 86,202, 48,187, 53,214, 34, 77, 19, 16,181, 74, 17, 41, 21,112,165, 22,172,113,212, 13, 84,141,197, 91, 79,162, 34,
-230,141,229,201,253, 17, 79,221, 60, 68,213, 13,107,177, 38, 22, 18,239, 66,218, 18,206,182,182, 29,219,230,140, 47,206,115,185,
-172, 36,219, 20, 20, 78, 58,117,126,153, 67,238, 90, 43, 88,192,160, 26,124,139, 67, 13,105, 82,182,245,143, 91,108,221, 48,216,
-188,141,137, 25,243,187,239,255, 85,186, 89, 39,120,116, 17, 92,127,230, 57, 70,251,251,236, 93,189,206, 80, 73,134,131, 62, 71,
- 89, 23,211,201,136,164, 68, 52, 97,195,196,186, 0,114,201, 75,148, 53, 40,225, 67,229,220,210,235,148, 8,109,244,197,235, 98,
-204, 45,244,167, 69,245,215,238,159,214,133, 96,151, 22,231, 42, 1,165, 36,170,229,113, 75,165, 90,130, 89,216,208,163, 72,209,
-235,108,144,165, 25,221, 78,151, 88,170, 32, 2,244,193,126,104,189, 65,203,136, 69, 82,235,241,112,138, 18,150,135,242, 23,136,
-230,215, 79, 46, 18,178,245, 70,183,137,122, 66,128,215, 17, 87,155, 20, 99,125,216, 44,179,132, 78, 28,135, 67,198, 58,242, 50,
-231,104, 18,224, 66, 69,109, 16,210,115,126,173,135,113, 96,140, 69, 43, 69,109, 61,105, 44,153,230, 5, 78, 70,152,170, 32, 82,
-130,188, 12,179,192,198,184,240, 61,196, 83,150, 77, 96,128, 43,201,112, 30,208,185,206, 58, 6,221, 44,140, 50,148, 38,175, 26,
-146, 72,161,149, 98,181,191,129,148, 9,235,167, 94,198,160, 63, 96,101,208, 37,206,250, 65,248,183,214,144, 63,255, 20, 87, 63,
-245,121,238,190,243,101, 92, 56,123,142, 83,167,206,178,122,246, 52, 82, 58,206, 92, 56, 71,154,164,204,174,223,100,251,109,127,
-151,175,253,203, 31,193, 84, 69, 16,226,201, 91, 8,146, 66,156,132,226,112, 98, 29, 90, 92, 42,253, 45,168,206,165,205,181, 85,
-191,135,202,136,147, 8,214,165, 87,238, 36,210,117, 33,240, 94, 36,231,249, 19,131,241, 18, 42, 18, 18,115,253,242, 51, 90,196,
-183, 10, 25,114,214,183,222,241,223,209,121,217, 43,240, 62,111, 47,216, 14,202, 41,182,152,225,138, 49,245,236, 24,239, 37,182,
-174,169,198,135, 45, 94, 88, 96, 26, 71, 61, 63, 38,202,214,208,113, 39, 0,162,156, 15,225, 71, 74, 7, 38, 59, 30, 47, 19, 92,
- 85, 98,203, 28, 91,215,148,199,161,149, 31,245, 86, 48,197,140,252,112,159,102, 50, 10, 30,248,121, 25,214,108, 85,225,133, 32,
- 78, 58,237,253, 69,225,234, 57,166, 14,157, 66,103, 27,132,107,139, 7,165, 16, 4, 37,189,243,174,165,202,133,238,148, 20, 33,
- 40, 6,194, 44, 92, 10,133,169,130, 90, 95,224,145, 42,240, 64,170,227, 67,142,159,251, 58,137, 22,172,110,246,184,190, 59, 68,
-197, 26,149,165, 65,124, 53,171, 80,105, 15,157,100, 24,107,169,203, 28,180,194, 58, 71, 62, 43,153,205, 43,106,235,216, 29,231,
- 56, 15,211,202,128, 16, 36, 58,160,167,127,252,135,222,136,204, 58,248, 42,103,246,252,179,212,243, 57,243,163, 33,126, 58,163,
-172, 36, 87, 2, 12, 54,152, 0, 0, 32, 0, 73, 68, 65, 84,244, 25,242, 38,103, 90, 54,236, 31,142,121,254,218,117,134,199,199,
- 28, 28, 30,241,224, 3, 15,163, 19,195,246,218, 22,145,169,153, 55, 9,255,251, 31,254, 17,191,243,151,159,225, 84, 49,228,182,
- 51,155,236,222,184,193,151,159,122,158,167,246,142,169,156,103,119,114,192,223,254,222,255,138,255,251,253,255,154, 78,150,114,
-110,125,133,141,181, 14,217,222,215,120,251,183,191,146,171,209, 41, 58,190, 97, 90, 89,202,170,161, 70,210,139, 21, 81,162,233,
- 36, 9,199,163,154,102,176,201,253,239,126, 15,171,219,231,217,255,212, 99, 1,159,108,220, 18,102,179,240,182,119,168,249, 90,
- 25,241,165,220, 81,123,195, 79,188,254,187,216,219, 61,164,211,233,114,120,237,136,193,198, 26,197,124, 78,156,197,140,167,135,
-116,178, 30, 59,215,174,146,245, 51,180,147,140, 14,135,164, 73,138,204, 28,215, 95,220,101, 50, 41,113,210,224,244,156,222,106,
-151,249,145, 33,201, 34, 6,114,149,221,226,144,110,146, 81,211,176,153,174,242,226,209, 46,181,171, 48, 62,112, 0, 42, 91, 48,
-136, 7,237, 69, 87, 48,174,103, 20, 77, 65,211, 88,198, 77,205,106, 87, 6,224,143,210, 68, 45, 16,191,241, 53, 78, 4, 59,116,
- 79,103,204,108,142, 22, 49,221, 56,225, 48, 31,162,203, 34,231,120,191, 97,181,223,231,238,181, 30, 31,120,242, 37, 94,243,178,
-115,236, 92,189,198,230, 93,247,176,251,201,143,209, 6, 40,161, 90, 21,161,111,161, 16,206, 3,207,125,141,181,222, 22,211,116,
- 13,237, 44,194, 89,246,143, 27, 92, 47,230,220,106,151,162, 54, 96, 27,110,142,115, 70, 82,112,247,246, 58,154, 20,175, 37,231,
-214, 58, 60,250,149, 27,172,247,123,228, 69, 73, 39,142,200,189,163,152,229,244,186, 25, 43,221,152,173, 65,151,162,108,168,106,
- 71,183, 63,224, 85,247, 62,196, 71, 63,243, 24,191,254,252,243,216,220,146, 70, 49,239,121,227,253,140,134,215, 80, 8,242, 74,
-242, 19,223,118, 31,222,193,199,158,188,194, 47,255,167,155,252,243,183,110, 50,153, 6,245,115, 97, 61, 62,207, 41, 5, 36, 89,
-140,107,119, 38, 87,213, 1,216,208, 52,161, 69,109, 45,218, 59, 74,171,137, 19, 77,147,151, 97,198,174, 84, 8,208, 0,156,146,
-244,146, 4, 47, 4, 90, 75, 34,227,105,128, 40, 74, 49,149,161,106, 36,211, 42,144,214,156,151,104,103,241, 78,240,137,107, 35,
-254,244,153, 3, 98, 41,120,228,252, 58,247, 93,216,162,179,214, 3, 33,169,218, 12,102,233, 29,210,132,136, 34,169, 84, 72, 91,
-211,106,153,170,181,216, 12, 67, 30,177, 93, 38,150, 45, 54, 68, 47, 66,234, 29,166, 2,209, 96, 99, 79, 22, 39,168,213, 85, 30,
-125,244, 3,236, 94,187, 78, 47, 75,153, 29, 15,233,109,172,227,204,156,186,172,131,168, 79, 70, 80,149,228, 67, 75,175, 91, 19,
-247,250, 52,120,170,170, 70, 56, 79, 89, 5,168,135, 82,138, 81,225,136, 36,196, 81,104, 13,187,210,208, 0, 74,235,246,194,100,
- 90,159,104,232, 34, 8,130, 72,209, 33, 66,148,165,247,120, 19, 42,217, 88,133, 86,181,104, 99, 51,149,142,113, 24,116, 45, 81,
-202, 98, 27,143,245, 6, 33, 42,164, 72,177,206, 5,197,185, 51, 40, 29, 83,150, 69,104,233,107, 75,213, 52,236,237, 13,121,205,
-195, 47,167,251,153, 15,134,138, 84,139,165,186,214,183, 81, 78, 42,110,233,129,222,115,142, 41,206,245, 40,234, 26,107, 51,108,
-213,160, 87, 66, 56,203, 84,107, 16, 17,177, 18, 28, 87, 53, 74, 88,166,243,138, 89, 94,208,237,116,195, 37,198, 6,220,166,117,
-150,126, 63,229,104, 92,210,160, 41,102, 21,107,221, 56,124,247,128, 44,139,131, 56, 49,210, 84, 69,133, 51,158,126, 39,165, 40,
- 10,180, 82,204,139,130, 52,138, 41,235,134,110, 26,161,162,144, 83,128,136, 57,179,125, 9,237, 44,167,214,122,156, 58,181, 65,
-111, 16, 81, 55, 57,183, 37, 61,126,246,173,111, 98,115,243, 44, 43,171, 41, 43,253, 85,234,114,196,100,118,196,185,219, 47,160,
-140,101,124, 52,225,129,255,250,159,240,228,207,253, 0,182,154,183,247,155, 5,220, 37, 28,162,238,150,138,124, 73,136, 91,230,
-162,183, 34, 54, 31,196,161, 11,222,103,152, 22,133,128, 14,107,253, 18, 23, 27, 58, 69, 98, 9, 18, 89,140, 92,150,182, 36,121,
- 75,179,191,173,250,157,109,231,232,162, 85,190,251, 80,136, 47,170, 18,223, 8, 80, 26,239, 10,132,176, 33, 54,181,174, 90,225,
-101, 0, 70, 57,231,168,139, 41,190, 54,120,149, 98,171,144, 77,225,188, 65, 70, 43, 84,211, 17, 50,206,208,113, 23,225, 26,172,
-151,184,186,128,162,164,206,199,148, 71, 55,105,138,138,227,107, 47,178,118,238, 60,229,232, 8, 91, 91, 80, 17,194,215, 12,175,
-237,179,114,102,155,254,169, 77, 38, 7,135,152,162,160,191,117,134,178,152, 19,167, 29,186,107,107,196,131, 77,210,213,245,224,
-222,168,139,176,134, 93, 96,186, 11,161,241,182, 10,114, 25, 33,112,229,148,198,166, 97, 4,104, 29,198, 52,184,198, 33,163, 36,
-172,235,186,164,193, 35,210, 30, 54,159,163,178, 53,116,154,226, 93,131,214, 93,136, 59,244,187, 25,165, 13,234,117, 45,194,243,
- 28,237,238,227,182,207, 18,119, 6, 28, 31,204, 24, 30,220,160,219, 79,217,221,159,144,164,154, 27,251, 35,114, 43, 80,248, 16,
-161, 42, 21,195, 60, 71, 74, 73,172,192, 9, 75,125,116, 68, 57,155, 83,215, 13,243,107,123, 8, 47,185, 33, 36, 87,138, 43,232,
-149,140,126,111,192,120,156, 51, 29,207,216, 92,137,233,233, 41, 7,215,111, 32,216,100, 88, 10,182,206,156,226,229,119,221, 67,
- 94, 20, 60,255,245,143,241, 11, 31,121,140,237,255,244,113,222,124,207,121,190,186,115,204,216,120, 4, 18, 7, 28, 29, 13,153,
- 89,199,238,180,228,218,254, 49,103,215, 82,206,221,121,137,151, 62,246,167,188,247,135,127,152, 95,249,168, 97,154,151,164, 29,
-143,136, 35,234,126,135, 27, 55,199, 76,102, 53,167, 55, 50,108, 28, 51,153, 37,108,124,231,247,240,230, 87, 63,194,159,255,216,
-119,127,195,197,115,161,169,243, 64,105, 91, 0, 18, 2,185, 82,176,178,190,130,138, 90, 59,176,115, 72, 25, 83,231, 57,211,227,
- 25,106,160, 40,231, 53,105, 50, 34,146, 93,210, 44, 98, 88, 29,113, 97,253, 60,218,121, 26,103, 49,222,177,150,244,152,236, 79,
-152,154, 57,174,178, 24, 17,113, 54,219,194, 41, 88,151,171, 92, 29,221,228,220, 96,131,121, 81,113, 88, 29,161,165,160, 23,247,
- 64, 86, 8,103, 73,100, 23, 85, 75, 38,102,134,181, 53, 74, 40,246, 70,138,126, 26, 97,124, 73, 47,145,216,185, 38,178, 17,153,
-240, 56,229,169,189,161,171, 58, 24,103, 24, 85, 97, 53,234,114, 62,225,194,153,203,184,166,228,252, 74,198,149,209, 20, 99, 12,
- 7,251,123,156,218,222, 64,119, 7,152,233,100,217,162, 12,183,240, 96,198, 95,196,220,173, 63,241,215, 76, 55, 47,243,185,238,
-109, 12, 18, 65, 89, 86,124,226,197,156,237,181, 30, 73,154,146,198, 49,101, 3,219,171, 93,148,176, 36,218,129,104,232,117,122,
- 72, 33,233, 36, 25,171,189, 14, 69,222, 16, 69,154, 78, 20,225,173, 33,159,207,184, 81,206,185,109,115,133,243,253,211,244,179,
-152, 95,254,141,255,153,181,193, 42,167,210, 14,141,242,188,229, 85,175,102, 51,155, 50,105,178, 16,148,226, 12,101, 21,230,228,
-175,191,184,197,237, 87,159, 96, 60,124,132,180, 19, 97,132,196,219,132, 89,221, 64, 93,227,227,184,165,178,121,108,221, 96,203,
- 28,169,117,128, 23,216, 32,120,138,227, 8, 23, 71, 8, 45,177,243, 18,148, 67,232,160,240,137,149,194,213, 13,198, 4,236,161,
-214, 97,142, 44, 45,168, 88,163,163,136, 52, 54, 88,107,176,206, 81,212,161,253, 39,148,166, 19, 37, 40,173,120,226,184,225,119,
-159,122,130,149, 36,226,161,211, 43,188,252,226, 41,182, 54,122, 33,135, 88,197,120,165, 48, 62, 0,107,100,211, 78,225,149, 10,
-162,178, 54,238, 18, 23,108, 99,222,134, 20,183, 19, 70,114, 32,201, 65,240, 43, 63,191,251, 28,147,175,142,137,163,140,245,173,
- 45,166,163, 25, 68, 49,179,249,156,195,225,152, 63,255,194,243,124, 97,127, 66,233,190,145,200,212,143, 37,111,127,232, 50,223,
-241,208, 29,108,172, 13, 40,154, 16, 3,171, 8,168, 78, 35, 4, 77, 99,201, 58, 49, 73, 26, 72,122,117, 99,105,106,215,118, 15,
-218,121,187, 7, 41, 27,156, 87,203,168, 69,219, 30,226, 14, 90, 53,190,192,183,214, 50,223,178,224,109,155, 42, 37, 34,139, 47,
- 61,101,145,147, 68, 10,165, 66,155,209,227, 41,124,137,245,150, 65,214, 97,231,104, 68, 28,119,121,235,247,126, 15,211,223,251,
- 85,220,226, 96,113,224,164, 88, 6,239,132,196,206, 86,165,237, 4, 93, 97,233, 39, 10, 33, 19,138,186,102,208, 9,255,237,198,
-154, 56, 18, 92, 88,239,145, 23, 57,251,135, 99, 42,231,169, 92,205,254,104,202,165, 52, 35, 81,146,162,117, 51,208,210,206,188,
- 51,116,210,132,169,117, 28, 76,115,122,113, 68, 28, 69, 24, 99,153, 20, 21,145, 20,164, 73,204,188, 40, 73,156, 71,235, 8,239,
- 44, 74,180,173,249, 40,232, 48,148,177,164,105,138,138, 83,106,159,176,125,219, 69,164,150,193, 47,111, 12, 89,154,112,253, 79,
-254, 31, 46,174,107,146, 53,197,193,225, 21,170,178, 71,218, 77,217, 58,117,138,170,154, 99,215, 54,217, 92, 95,225,139, 63,253,
-221,203,106, 91, 44, 18,176, 22,155,157,245,220,130, 87, 95,178, 93, 67, 28,106, 27, 87, 32, 79,232,146,178, 85, 22,203,150,245,
-105,141,111, 85,241, 30,225,195,115, 75, 47,240,141, 15,135,187,187, 37,111, 76,156, 84,247, 11,111,178, 91,200, 70, 22, 14,207,
- 22,164,134, 91, 68,111, 6, 60,114,231,246, 7,192,207,195,251,240, 17,184, 60,164, 32,150, 83,154, 98, 74, 83, 85,184,186,194,
-214, 5,214,120,234,170,192, 87, 53, 78, 8,108, 61,193, 89,129,180, 53, 42,222,164,202,115,118,158,252, 52, 10, 79, 61, 31, 51,
- 59,156, 50,220, 57, 66, 41, 73,210, 9,249,244,113,175,131,169, 67,194,162,183,161,171,116,248,194, 77,118,174, 92, 67,120, 67,
- 81,122,226,231,119,112,141,167,179,218, 37,237,198,116, 86, 6,116, 55,183,136, 87, 55,233,174,111,134,125,196,181, 26,142,170,
- 12,174,162, 40,105,133,125, 96,171,121,104,143, 19, 66, 96,240, 13,166,202,113, 46,176,227, 93, 93, 64,214, 37, 74, 51,148,130,
- 74, 64,220,233, 34,146,148,102, 62, 35,235,117,200, 71, 51,132, 23,116, 87, 87, 16,211, 41,149,105,248,242,227, 79,176,182,190,
- 74, 94, 86, 92, 63,152,112,116,101,151, 56,142,201,235,138,163,162, 14, 93, 32, 1, 89, 34, 24, 23, 21,221,172, 67,101,114,254,
-242, 47, 62,201, 27,191,253, 85,220,216,223,195,180, 40,102,135, 33, 90,189,141,191,184, 17,241,196,141, 79,112,251,217,109, 54,
-183,206,179,185, 50,224,116,175,160, 39, 27,198,165,163,154,236,113,184,171, 49,117,197,238,200,240,234, 7,238,224,244,106,198,
- 23,206,156,225,207, 31,251, 48, 77,221,240, 59, 95,122,129,173, 94, 23, 75, 24, 89, 93,220,190,135,221,171, 47,162,148,160, 65,
-240,236, 81,193,229,221, 9,235, 91, 51,182, 95,123, 15, 79,254,201, 31,241,175,222,245, 30,126,251,211, 37, 85, 81,147,102,125,
-156,245, 52,166,102,116, 56,103,111,199, 98, 81,220,113,231, 89,110,187,176,194,197,211,171,188,253,255,251, 44,127,252,206, 55,
- 82,207,198,173,126,202, 47,199,130, 99,155,144, 72, 79,227, 13, 47, 61,125,141, 11,119, 62,192, 83,159,121,138,122, 62,164,183,
-210, 39,238,121,154, 92,144, 69, 29, 76,211, 48, 62,218,227,236, 29,247,224, 75, 71,238,142,177,185,164,105, 38, 88, 47, 25,116,
- 53, 47, 30,239,145,206, 61,162, 86,148,166,162,151,116,153,204,142, 24, 68,171,244, 87, 27,132, 46,201,102,171, 28,229, 99,186,
- 81,196,154, 90, 97, 92,142,209, 8,140, 51,164,145, 38,175,102,236,151,251,120, 60,169, 78, 88,139, 87, 41, 76,195,246,170,102,
- 86,193,124, 46, 81,210, 19,171,152,142,140,105, 48, 24, 32,147,154,153, 41, 41,108,201,217,206, 69,212,143, 62,116,225,125,194,
- 84,244, 87,215,248,248,151,159,229, 51,251, 99,222,113,215,105, 34,173,217, 88, 91, 37, 90,219, 96,242,220, 51, 1,110, 34, 60,
-206,223,194,216,109, 87,167,243,130,181,114,196, 93,211, 27, 28,186,136, 27, 37, 28, 78,167, 92,121,225, 42, 27,169,102,181,223,
-165, 19,135,170,246,252, 90,134,162,161,154, 55,124,238,217,107, 28,143,143, 57,189,222, 39,214, 10,173, 97,173, 27,145, 8, 79,
- 22, 7, 85,231,197,245,109, 14, 71, 83, 62,241,196, 23,120,244, 11, 95,228,246,179,167, 57,187,190, 66, 20,197,220,127,246, 60,
- 63,248,200, 25, 70,199,147,144, 89,238, 61,190,174,136,210,148,175, 60,250, 41, 54,234,156,237,151, 63, 64, 41, 67,100, 98,164,
-130,229,200, 25, 75,211, 24,180,112,237,191, 27,132, 9, 76,227, 52,210,116,146, 24,169, 20,101, 94, 6,152,134,177, 68, 42, 84,
- 49,214,134, 69,168, 84,219,246,109, 69,107, 82, 4,177,157,144,193,170,160,165, 68, 75,129, 84,178,245,154, 43,178, 36, 66,183,
- 27,121, 22, 71,116,187, 29,214,122, 93, 86,147,132,211, 27,107,168,164,199, 81, 19,113,100, 18,142, 74, 71, 81, 52,152,249, 12,
- 97,109,192, 94,154, 6, 87, 53,152,178,192, 86, 53,174, 44,177, 85, 73, 83, 20,248,170,229,160,231, 21,182,110,104,170,154,195,
-233,148,157,227,125, 94,216,191,201,193,225, 14, 58, 78,232,118, 59,109, 5,237,168,235,138,131,195, 17, 95,127,113,135, 79,124,
-125,135,207, 30, 76,232, 68,154,126,172,232,196,154, 84, 73, 58, 81, 24, 45,124,238,234, 33,127,248,248,115,252,209,231,190,198,
-150,246,172,196,193,190,100, 93,123,225, 16,237,252,181,157,157,170,118,170,234, 76, 27,141, 42, 66, 57,230,234, 32, 8,180,198,
-226,125,152,157, 91,231, 90,128, 72,123,155,182, 54, 36, 23, 89,131,105,154,165, 15,213, 25, 67,213, 18,215,162, 40,198, 52, 21,
-121, 17,196,148,221, 56,102,247,232,152,127,241,123,143,242,182, 87,190,130, 7, 47,158,167,252,147,255, 35,216,159,148, 92, 98,
-143, 23,226,194,118,178, 17,170, 73, 4,178, 37,144, 29,202, 62, 7,141,167, 50,158, 78,154,132,158,136,148,116,180,226,112, 90,
- 50,153,207,153, 55, 22, 45, 5,147,217,156,202, 24, 46,172, 15,232,103, 49,133,113,116, 83, 77,217, 24,198,121,195,246, 90,151,
-163,227,201,210, 51, 59,169, 42,172,179, 72,103,137,116,208, 29,152,133,175,219, 59,148, 16, 52,117,128,206, 68,177, 14, 1, 19,
- 82,145, 38, 17,113,156,176,209, 91,225,206,219, 95, 70,214,233,176,189,190, 70, 22,167,108,111,173,177,117,118,149, 43,191,252,
- 35,108,187, 49,171,118,206,106, 95,179,114,250, 20,189,126,130,156, 28,208, 60,251, 36,230,169,207, 48,123,250,241,144,225,176,
- 64,128, 47, 71, 56, 75,254,240, 50, 49,109,209, 38, 95, 84,207,203,244,172,133,231,124, 17,229,238, 79,172,109,139, 4, 54,215,
- 2, 13, 23,175, 35,244,242, 35, 92,102,101, 11,213, 86,229,183, 42,231, 91,214,247, 55,192,224, 57,177,211, 9, 39, 80,189, 77,
-182,127,248,159,134,139,152, 45,161, 30, 7,120,140, 49,248,186, 12, 28,246,114,134,179,142,166,172,176,141,161,201,115,140,169,
- 64,165, 33,242, 51,206,240, 50,101,231,241,143,179,255,149,199,217,249,218, 11, 76,118,247, 25,239, 79, 24, 31,140,209, 73, 68,
- 28,197,237,124,222, 48, 61, 26, 99, 27,152,142,107,106,227, 56, 60,204,137, 34, 21,218,229, 42,198, 24, 79, 89, 90, 38,179,154,
- 42, 47,145, 8,102, 7,199, 76,118,246,153,238, 92, 99,182,127, 19,149,118,208, 89, 31,233, 13,118, 62, 10,186, 3,213,162,164,
- 85,180,220, 63,108, 29, 68,180,182,182,173, 85,152, 0,162, 17, 10, 83, 22,161,109,161, 98,116,214, 99,255,107, 95,197,151, 51,
-210,254,128,249,188, 96, 54, 41,200, 86, 6,200, 56,120,232,173, 51, 88, 15, 7,135, 99,174, 31,143,153,215,161,197,126, 84, 20,
- 28,150, 13, 90, 4,135, 65, 22, 71,228,117, 67, 55, 77,152, 23, 21,185,113,124,252,233,155, 60,251,220, 77, 46,173,101,100, 64,
-185,119,204,243,215,115,126,229,243,207,243, 23,207, 94, 9, 76,117, 21, 99,203, 57, 85,149,115,109,231, 6,222, 89,210, 68,112,
-102, 99, 13, 39, 34,174,239, 28, 6,247,201, 60,231, 21,247,110,114,102,181,203,197, 59,191,157, 79, 62,254, 9, 50,233,152, 86,
- 13,198, 65, 95,195,229,251,191,131,195,157, 43,220,188,254,117,180,144,244,133,103, 75, 11, 78,173,101,168,213, 21, 78,159,217,
-230,218,231,159,228, 29, 63,247, 15,120,236,111,158,161,219,203, 24,230, 53,137,175, 40, 28,108,118, 21,215,199, 5,227,153, 97,
- 58,202,201, 75,141, 79, 34, 94,243,174,119,243,236,239,126, 8, 91,149, 75,176,154,247,158,210,105,190, 82,192, 43, 83,201,155,
- 47,223, 73,173,123, 76, 14, 15, 89, 93, 95, 99,116, 52,225,112,239,128, 51,151,122,220,120,241,144,193,250, 10, 89,154,240,217,
-207, 62,193,202, 74, 76, 61, 83,148,118,198,234,106,143,114,218,144, 14, 98, 38,227,154,178,105,152,149, 13, 91,155, 33, 33, 47,
-209, 93,230,182, 98, 82,229,140,134,129, 63,114,148, 31, 81, 90, 67,105, 75,250,186,199,180, 26, 17,199,146,209,124, 78, 97, 11,
-180, 20,196, 42, 98, 37, 30, 48,172,199,156, 91,233,112, 99, 84,144,106, 65,211,120,166,198,112,170, 23, 81,218, 54,108, 71, 38,
-193, 88,228, 21, 66, 10,122,170,131,126,242,133, 61, 94,125,207, 69,164, 55,196, 74, 98, 1,107, 44,167, 54, 7,120,219,208,221,
- 88, 63, 89,244,238, 36,108,193,217,176, 9, 43,187, 80, 96, 11,164, 49,188,238,248, 10,175, 7, 26,173,177,235,158, 35, 53,227,
-243, 69,197,169,110,194,186,182,140,166, 51,230, 99, 3, 77,194,225,254, 53, 94,119,199, 25,102, 78, 80,229,115,124, 20, 98,232,
-144, 80, 55, 53, 79,239,236,242,216,240, 43,232, 40,230,182,173, 13,206,108,174, 81, 54,158, 44,201,184,107,208,227,237,175,185,
-204,100,120,136,150,193,251, 92, 55, 53, 81, 28, 51,124,252, 75,188,252, 76, 23,113,249,110,138, 84,145, 24,143,243, 53,213,172,
-106, 75, 2, 67, 62,157,112,124, 16,226,242,174, 31,141,249,171, 23, 14,121, 46,175,200,180, 98, 35,139,120,243, 61,231,249,238,
-135,110, 15,169, 68,135, 99,188,137, 72,147,136,106, 17, 15,218,138, 94, 34,173, 17,206, 81, 91,131, 23, 18, 69, 72, 36, 82,178,
-157,219,162,136, 84,216,188,157,131, 40,210, 8,169, 2,104, 66, 40,162, 36, 38, 75, 18,148,142,232,164, 41, 58,214,196,113, 76,
-146,165, 8,173, 41,156, 96,102, 29,229,108,142,112,150, 78,175, 75,146, 37,216,186, 14, 1, 40,166, 33,233,174,176,191,243,165,
-144, 88, 38, 60, 82, 71,168,246,208, 80, 73,196,170,150, 52,181,165, 28,207,168, 11,141,138, 52, 94, 64,150,165,225, 66,226, 4,
-155,157, 24,129, 64, 73, 22,217,152,203,121,166,117,158, 78,164, 90,207,177,226,195,159,127,134,242, 83, 95,231,199, 95,123, 7,
-175,190,231, 18,214, 41,156, 51,248, 82,162,163, 58,108, 68,237, 99,149,150,237, 38, 30,118,105, 29,183, 21,156,146, 88,111,161,
-109,255,249, 86, 17,239,140, 9, 27,179, 11,227,157, 0,239,104, 15,244,166, 65,120,208, 74, 51, 47,114,180,112,196, 74,242,169,
-103, 94,224, 79,159,122,129,162,177,156, 95, 31,240,173, 23, 54,184,246,232, 7,218,195, 18,180,247,120, 36, 82,182,222, 13,231,
-219, 0, 18,177,212, 36, 32, 29,198, 57, 94, 46, 15,184, 26,109, 51, 42, 43,170, 34, 39,213, 93, 76, 99,136, 35,205,102, 63,230,
-197, 93, 79,170, 37,163,210,210,137, 34,142, 39, 57,135,147, 25, 74, 43,210, 68, 19, 73, 69, 36, 21,153, 14,164, 50, 29, 41,172,
-175, 81,145, 6, 83, 3, 26, 35, 5,186, 85,243,107, 17,210, 80,100, 11,114,209, 89, 76,150, 6,224, 13,173,198,162,170, 66, 55,
- 33,138, 18, 6,157,136,203, 91, 25,167, 6, 25,107, 43, 17,253,110,135, 76,141, 49,163,131, 32,238,244, 53,234,120, 15,134,187,
- 44, 44,254, 82,122,236, 45,121,214,194,139, 37,229,109,225, 32, 8,249,232, 18, 47, 61,194,250, 37,143,221,223, 98, 53, 11, 22,
-183,246,125,249,160, 19,147,139,121,252, 34,177,205,180, 62,114, 25, 8,123, 74,137,144,238,216,250,211,229,178, 43, 19, 94,119,
-145,159, 45,110,185, 44, 88, 21, 64, 56,139, 33,188,115, 65, 37, 47,165,167,115,230, 14,100,148, 66,115, 4, 77,129, 43,203,112,
- 49,169, 26,154, 98, 78, 61, 31, 99,157,160, 41,230, 56, 84, 8, 94, 17, 18, 83, 6,184,148,238,174, 80, 28, 31,113,229,163,127,
-132, 51, 30,215,212,224, 29,121,110, 72,187, 26, 29, 43, 98,229,233,100, 32,117, 66, 36, 61, 99, 91, 19,101,162,181, 79,194,230,
-230, 38,211,163, 41,137,246,116,186, 17,199,141,197,150,134,141, 94, 76,156, 74, 48, 13, 82, 71, 52,198, 32, 43,205,228,230, 49,
-179,195,191, 65,117, 98, 46,191,234, 17, 6,167, 54, 17,173,229,109, 49, 95, 16,113,135,102, 62, 70,232,184,181,248, 85, 72, 84,
-200,144, 88,240,117, 0,124, 77, 61, 62, 32,233,111,161,180,198,213,225,111,108,242, 57, 85, 89,226,134,135,152,198, 32,181, 38,
-209, 9,195,241, 33,211,218, 96, 26, 67,101, 44,227, 58,112,223, 21, 39, 66,196, 97, 94, 6,222, 69, 89,211,248,176,238,210, 84,
-243,213,221, 99, 62,245, 59,135,104,192,246,215,185, 86,212, 36,206,114,113,109,133,110,167,195,214,122,143, 68, 41,134,163, 93,
-198,147, 35, 6,189, 51,224,224,224,104,159,158,235,178,119,120, 64, 57, 47,241, 98,206, 51, 47, 21, 60,116,239, 25, 86, 87, 75,
-182,255,217,111,240, 47,255,167,127,128, 38, 4,130, 85,241, 25,126,240,123,191,159,127,241,171, 63,207,197,126, 15,229, 60,107,
-169,162,163, 60,147, 27, 7,172,108,174,147, 63,120,142,181,188,230,153, 63,250, 32,255,205, 79,255, 29, 62,240,193, 79,115,122,
-189,143, 49, 9,195,253, 67,102, 42, 97, 53, 81,212,249,152, 58,118, 28,238, 29, 49, 25,231,140, 46,109,240,214,223,127,140, 63,
-123,231,155,168,198,199,203,177,210,170, 54,108,197, 17,127,111,107,206,244,197,199,137, 87,239, 8,123,112,127,133,188, 26,178,
- 58,232,242,229, 79, 61,195,217,115, 23,152, 21, 83,182,206,196,108, 60,191,198,225,206,132,173,179,155, 28, 92,217,231,165, 43,
-123, 20,212,172,102,231, 2, 50, 59,138,241, 94, 98,100,193,196, 86,104, 63, 64,107,131,241,129,202,231,109,201,122,186,198, 81,
- 53,102,179, 19, 97,108,142,195,115,156,231, 40,239,145, 40, 58,186, 67,237, 26, 6, 41, 88, 41,216,200, 82,174, 30, 31, 35,125,
-151,178,158,177,154,117,185, 54,217,225,114,127,155, 73, 33, 24, 54, 5, 25, 49,137,142, 16,206, 49,181, 67,212, 15,221,183,253,
-190,151,221,126,137, 56, 77,249,216,147,207,113, 80, 86,220,222,209,172, 38, 9,107,155,235, 40, 45, 57,250,218,149,160, 44,189,
- 5,166,191,112,178,250,214, 82,229, 90, 5,172,247, 97, 17, 42, 23,188,185,157,111,251, 46,110, 30,143,184,173, 31, 49,159,206,
-184,113, 60,101,165, 40,217,254,204, 31,240,242,230,152, 59, 71, 55,121,200,207, 16,103,239, 98,123,173,207,249,254, 42, 55,110,
-236,128,173,184, 62, 45,201,210, 14,247,157,219,166,151,198,108, 14,122,156, 95,233,241,250, 59,206,243,186,151,109, 83,207, 15,
-144, 82, 35,188, 65, 8, 80, 66, 96,170, 10,189,190, 6,167, 78,227,176,184,170,193, 54, 65,220,229, 93, 8,255,192, 4,140,105,
-145, 87,220,220, 31, 49, 44,106,210, 72, 49,175, 26,134,181,101, 90, 91,254,230,197, 3,254,195,231,158,229, 11,207, 93,231,109,
- 15, 94, 36, 22, 48,156,230,100,145,194, 90, 27,236, 90, 11, 65, 81,155, 63, 44, 91,107, 26,206, 44,173, 20, 56, 23,178,148,165,
- 12,106,107, 2,167, 92,181, 21,176,148, 26,133, 39,137, 99,192,211,233,118,233,100, 9, 73,183, 75, 28, 69, 36,177, 10,246, 58,
- 28, 73, 36, 73,179,152,172,219, 33, 74, 19,226, 36, 67, 41, 77, 85,220,164,202,131, 47, 52,210, 49, 81, 27,142,160,100, 56,192,
-227, 52, 69,199, 17,113, 18, 33, 37,216, 38,132,161, 52,141, 9, 52,169, 88,243,129, 39, 95, 36,213, 42, 68,180,202,246,115,108,
- 43, 48,219, 42, 76,172,135,123, 79,173,209,215,158,243, 43, 25, 47, 29, 78,168,139,156, 94, 44, 67,229,109, 12,222, 52, 72, 9,
-145,148, 40, 21, 70, 0,162, 37,147, 45,152,225,214,216,118,110,232,131, 88,201,187,208, 5,105, 59, 40,161, 66,113, 88,231,169,
-138,154,249,100, 74, 81, 84,225,226, 86, 7,112,207,104, 50,225, 63,126,254, 41, 62,244,249,167,121,122,239,152,126, 26,161,149,
-228,117, 61,184,124,240, 84,176, 66,106, 17, 0, 38, 11,101,151, 18,109,182,243, 34, 17, 74,180,110, 41, 25, 80,148, 8, 50,103,
-121, 65,172, 96,157, 39, 55, 14,173, 66, 42,184,240,158, 72,122, 20,158,157,113,206, 44, 47,112,222, 98, 29, 52,166,230,204,218,
- 10,169,146,228, 85,131,245,142,198, 58,242,202,160,148, 70, 73, 69, 89,134, 92,233, 52, 73, 16, 66,144,215, 13,149, 49, 88,130,
-120,206,249,182,231,236, 44, 90, 8, 34,165,112, 62, 0,144,186, 89,140,107,106,238,189,253, 62,206,172,159,162,147,198,172,116,
-186,220,247,224, 93,156,190,208, 33,223,185,202,141, 63,249,237,101, 70,249,162,230,110, 83,102, 91, 20,171,248,134,249,184,229,
-150, 84, 54, 47, 2,153,107, 33,140,187,101,206,237, 57, 49, 97, 44,198,109, 39, 24,209, 5, 8,177, 77, 82, 19, 39,169,108,254,
-150, 8, 87,111,218,139,191,227,150, 80,162,197,252,188,125, 75, 45,231, 93,184,147, 96,153,133, 74, 92,200, 32,178,148, 26,122,
-247,125, 11, 43,175,124, 3,206, 26,168,115,188,148,216,217,144,106,114,136,169, 74, 76,213, 80, 77, 70, 1, 82, 84, 86,152,124,
-134,169, 13,217,230, 57,170,124,198,238,147, 95, 96,239,171, 79, 48, 59, 58,166,202, 75,154,188, 33, 74, 4, 43,171, 25, 49, 13,
- 23, 46,245,136,149, 33,203, 52,189,174,132,166,166,183,158,145,104,193,160, 23,227,202,154, 78,228, 24,172,199, 36,137, 66,120,
-232,247, 18, 18,229,233,119, 97,125, 35, 33,138, 37,162,105, 88, 93,141, 73, 19, 65,150, 10, 38,195,146,186,178, 28,190,248, 60,
-219, 47,187,171,157, 45,180,128, 31, 23,184, 24, 33, 51,194, 33,116,140, 43, 75,164, 14, 22, 84,107,170,150,244, 25, 4,155, 74,
-106,172,151, 76,174,189,192,100,103,135,211,151, 46, 96, 77,195,193,254, 30,194, 26,242, 89,201,141,131, 33, 47,237, 29, 51,175,
- 13, 71,243,130,113,217,112, 92,213, 84,198, 97, 60, 52,158,160, 61,104,193, 44,165, 49,148,141,165, 52, 1, 30, 37,219,239, 96,
-162, 3,135, 63,177, 5,103, 55, 78,177,185,117,158,184,219,199, 10, 73, 93,214,140,166, 51,174,237,238,112,126,251, 20, 82, 39,
-172,244,187, 28, 28, 13, 41,173,194, 84, 37,123, 55,175,113,249,226, 54,195,241,136,166,168,216,218, 26,208, 79, 28, 15,221,255,
- 38, 62,255,197,207,176,210, 95,225,220,165, 7,185,237,212, 25,174, 63,247,105, 86,157, 65,227, 57,155,106, 82, 47,136,156, 35,
-139, 36,131,243,167,137,215,215,153,125,233, 10, 23,223,244,102,110,220,156,208,137, 5,101, 94,115,148, 87, 28,238,239, 80, 25,
- 79,175, 27,179, 63,173,136, 35,197, 90, 47,102,146, 27,102, 70,240,186,119,253, 48,207,124,232,253, 97,228, 7,120,175,120,121,
-214,208,145,142,124,178, 79,114,238,213,108,157, 61,197,100, 60,167, 46, 11, 78,157, 57,203,206, 75,215,217, 58,127,134,227,253,
- 3,202,202, 49,154,140,137, 84,130, 23, 21,249,108, 78,182,174,240,133,102, 52, 25, 50,172,230, 8, 39, 89, 95,233,227,242,140,
-170,178, 28,149, 7,236,205,135,100, 50,163,168, 74, 10,103, 2, 86,155, 6, 47, 60, 85,109, 25,153, 81,123,209, 21,156,238,247,
- 72, 84, 66,213, 52, 28,149, 51,148,215,236, 76,231,244,163,140,181, 30,104, 17,113, 56,159,160, 69, 28, 96, 65,102, 70,170, 18,
-188,144,173,248, 14,238,220, 24,160,222,241,178,211,239, 59,115,122,155, 65, 55,229,175,158,124,142,207,237, 15, 89, 83,138,251,
-207,172, 81, 57,201,106,191, 75, 51,159,147, 31, 28, 45,131,194,150, 43, 90, 44,211,151, 79,200,178,237,173,219,121, 88,187,255,
-229,124,224,153, 33,231,187,130,103,118,135,188,180,127,204, 35,179, 29,182,175,125, 25,135, 68, 88,207,224,155, 94,203,255,176,
-171, 24, 63,247,117,110,219,121,134,189,233,132,104,109,147,157, 89,197, 74,191,199, 61,219,171, 92, 58,181,194,165,205, 1, 15,
-156, 94,227,225, 75,103, 72,234, 33,117, 62,100,101, 48, 8, 2, 15, 33,104,170,146,178,106, 16,206,163,188,131,186, 9,115, 59,
- 88,122,158, 77, 19,216,233, 18,143, 86, 17,107,171, 61,206,157, 94,227,244, 74,135,245, 68,161, 27,195, 56,175,153, 3, 29, 45,
-233,105,201,184, 52,252,230,231,158, 99,247,120,196, 91,238, 61,207,164,168, 9, 38, 35,219,146,139, 78, 2, 90,228, 2, 3, 43,
-229,137,176,199, 59,104,154, 16,141,110,220,210, 59,233, 26,131,214, 26,209,250,232,165, 86,193, 74,227, 66, 43, 95,223, 74,210,
-194,163,180,250, 70, 47,177,247,204,199, 19,240, 5,163,227,171, 72, 17, 2, 33,108, 99, 65,171,165,106, 28, 1,174,110, 78, 34,
- 47, 91, 17, 83, 80,226,134, 47, 83, 63,139,249,200,151, 94, 36,211, 10,169, 90,146, 87,251, 58, 11,107,145, 16, 2, 45, 52, 15,
-175,167, 12, 18,205, 90, 22,113,182,151, 6,230, 71,221,144, 70, 26,173, 36, 90,171, 54,186, 55, 0,102,156,181,248,198,134, 56,
- 90,235,176,110,145,186, 6,166,170, 49,206,227, 27,139,177,134,170,170, 40,203,154,162, 40,153, 23, 37,101, 17, 66, 35,106, 99,
- 41,170,154,225,116,206,147,215, 15,248,237,207, 61,197, 95, 61,183,195,172,170,201,226,136, 88, 5,120,135,117,240,222,179,154,
- 76,130,214,242, 36, 32, 28,240,173,222,193,138,240,247,181,214, 47,219,195,139,239,178,243,193, 77,112, 62, 50, 60,103, 51,172,
- 11, 80, 36, 5,120,111, 73,149,194,123,207,193,120,142,181,150,188,108,176,206, 49,154, 87, 92, 88,239, 81,153,160,242,118,173,
- 7,212, 24, 67,154, 40,226, 56,162, 40, 10, 34,173, 66,104, 17, 80,213, 13,206, 7, 22, 65,109, 2,227,189,117, 37, 6,139,165,
-115,225,178,167, 21,117,211, 32,132,103,144,116, 89, 77, 58,188,226,129, 7,120,228,251,222,192,250,118, 2, 2,158,253,223,126,
-129,252,230,243,203, 51, 51, 28,208,225,247, 81,203, 17, 3,203,207, 20, 23, 32, 25,126,249,179,126,121,192,123, 43,194,154,241,
-254,196,151,126,130,114, 71,222, 10,128,243, 39, 57,216,170, 93,243, 11,229, 60,237, 76,125,153,139,189,248, 28,236, 55, 42,224,
-189, 59,201,195,110, 49, 12,225,192,111, 78,218,247,139,215,114, 30,186,119,220, 75,255,222, 7, 17,102,142,175, 10,108, 85, 97,
-170,130,166, 40,176,182, 14,109,103, 3,229,228,144,122, 54,195,202, 4,157,246, 56,124,225,235, 60,243, 87,127,206,252,240,144,
-249,104,136, 4,250, 29,197,217,179, 25,107, 43,138, 44, 19, 68, 90, 32,133,110,137,141,224,156, 14,126,246,218, 18,175, 12, 48,
-101, 73,210,139, 73, 6,221,214,150, 25,230,193, 90, 75,178,126,130,212, 17,211,131, 41,120,200,186, 49,117,105, 66,124,116, 28,
-147, 68, 96,171,146,233,216,144, 31,239,210, 63,125, 26, 41, 90,135, 71,148,224,165,196,215, 21, 58,206, 66,122,153,142,112,206,
-162,226, 4,172, 65,199, 25,222,134, 11,175,140,123,140,119,119,185,246,228,227, 12, 58,154,193,230, 38,135, 55,110,114,227,230,
- 17, 55, 14,167,188,112, 52,227, 96, 94, 49,171, 45,123,243,146,113,105, 40,141,197,180,151,116, 99,109,160,119, 6,145, 11,181,
-179, 40, 41,241, 94,208, 88, 71, 39,137, 88,237, 36, 40, 33,169, 77,232,160, 37,113, 4,243, 99,100,127, 64, 28, 71,212,214, 82,
-214, 51,168,115,182,215, 87,216, 59, 58,100,115,125,192,254,241,152,170,246,116,211,136,201,112,143,157,253, 3,180, 52,156,219,
-222, 96, 56,157, 50,158, 85,244, 98,205,230,170,226,237,223,247,247,168, 26,201,245,155, 59,236, 28,231,124,215, 27,223,194, 87,
- 63,251,103, 92,236,119, 89,143, 37,171,189, 20, 29,105,180,247,108,158,217, 68,119, 7,248,221, 33,167,222,240,157,188,120,117,
-140,144,112,115,239, 38, 43, 89,196,254,222, 14,171,157, 20,109,115, 98, 29,209,235,245, 56,181, 30, 35,189,103,181,167,153,161,
-120,249, 59,254, 22, 47,252,222, 7,131, 2, 94, 90, 82,239, 22,174, 74,142,163,117, 78,223,118, 27, 85, 61, 99, 54, 42,168,108,
- 73,154, 38, 12, 71, 67,226,158, 39,138, 18,154,178,102, 56, 30,179,186,217, 97, 58, 44,241, 77,132,143,107,170,194, 97,156,160,
-147, 36,236, 21,199,220,121,231, 22,199,163, 10,239, 36,133,157, 97, 81,164, 58, 65, 8,137,206,102,100, 73,204,225,100,200,126,
-121,128,150, 17,131, 56, 99,173,155,209,233, 6,157,205,184,204, 41,155, 2, 41, 52,206, 91, 6,137, 36,209,130,227,162,192, 88,
-219,142,188, 45, 18,205, 86, 47, 35,146, 26,111, 21, 86, 52,204, 75,208, 85,210,225,153,155,135,108,108, 12,216,153,228,212,214,
-243,210,164, 96, 52, 47,121,106,255, 25,148, 82,108,221,119, 31,199,207, 60, 19,132, 70,183, 36, 48, 45,111,241,136,147, 22,253,
-130, 26,229,224,175,229, 6,159,249,250, 23,137,210,138,239,136, 75,214, 34,255, 13, 49,163,151,126,224,111,241,159,191,240, 28,
-159,252,242,215,248,240, 29, 49, 10,199,157,179, 29,110,228, 67,234, 83,151,217, 94, 27,112,126,165,199,122, 26,177, 50, 57,194,
-124,226,147,152, 50,167,115,241, 34,245,197, 75,124,255,175,125,136,126,172,121,213,109, 91,188,233,254, 75, 92,222, 90, 67, 71,
-146, 44,137,192,123,140,113, 20, 77,168, 72,105, 43, 23,225, 91,176,137, 11,106,106,103, 29,157, 36,230,210,217, 45, 46,108,175,
-241,173,211,130,159,250,227, 47,177,145,106, 12,225, 0, 88,137, 20,143,190,120,204, 95,255,214,163,124,248,157,175,194,233,240,
-133,215,145, 11, 2, 18,123,114,152,139,182,177, 37,151,241,145, 44,209,167, 90,122,106,239,177,141,197, 9,133, 49, 37,198,216,
- 80,173,107, 21,152,203,197, 28,111, 67, 16, 73,148,132, 10, 59, 4,108,132, 67,223,122,143, 45,231,228,243,130,186,170,112,245,
- 14, 90, 36, 32, 61, 90,197,161,157,105, 67,224, 11, 4,193, 18, 74,133,249,160,103,233,163,199, 75, 36,150, 88,192,213,163,233,
- 73,186,150,151, 24,104, 85,208, 98,137, 35,137,148, 32, 85,154,215,220,113,138,162,177,100,113, 20,222, 19,158, 88,105,188,244,
- 96, 29,166,106,176,141, 67,171,197,140,181, 85,236,123,217, 86,228,150,198,186,165, 72,174,106,106,154, 42, 8, 62, 68, 27, 49,
- 42,148, 8,155, 29, 81, 80,147,123, 79,164, 12, 23, 55,215,248,183,159,252, 58,171,169,102, 32,195, 88, 96, 97,153, 82, 66, 16,
-197,138,245, 88,225,112,212,141, 67, 70, 2,237, 85,232,168,180, 34, 66, 33, 5,214,123,164,110,201,104, 1,238, 30,148,216, 46,
- 4,152,116,235, 25,119,235,148,167,125, 74, 89,214,116,180, 34,150,146, 94, 44,136,188,230,238,173, 62,166,169,201,171,134,198,
- 52,100,113,151,235,135,199,156,223, 62,139, 55,150, 36, 86,164, 89, 76, 83,215,225,194,105, 13,105,150,210,212,205, 50,253, 80,
- 9,137,214, 34, 96, 60,105, 72,163,136,121, 85, 83,153, 6,235, 53, 37,150,110,146,224,157, 35,214, 49,175,184,243, 97,190,237,
-117,111,228,117,111,248, 22,146, 21, 77, 83,148,204, 84, 77,210, 84, 28,126,246,163, 45,245,241, 22,107, 90, 59,192,182, 45, 97,
-144,101,164, 67, 96, 1,208, 70,135, 10, 68, 64, 40, 59,183,172,200,157,240,203, 52, 53,121, 75, 4,107,235,186, 97,241,148,246,
-150,214,188, 17,254,196,234,182, 24,191, 44, 42,117, 1, 77,221,114, 1,190,129, 43,223,210, 8,219,199,120, 31,198, 14, 65,112,
-218,238, 53, 46,164,196, 73, 5, 42,237,130,200, 0,141,183, 5,214, 26, 92, 99,104,230,163,208, 37, 52,130,114, 54,165,154, 77,
-208, 73, 15,209, 84,204,255,127,198,222, 51,198,178, 52,189,239,251,189,225,132, 27, 43, 87,117,117,156,153,157,176, 51,228, 70,
-114,185, 32,119, 73,237,146, 10, 54, 73, 16,150, 41,138, 38, 8, 75,176, 44,128,176, 45,152, 95,228, 15,134,236, 47, 14,132,224,
- 4,138,146, 41,201,166, 1, 38, 88, 6, 37, 80, 98, 16,204,180, 36,119,185, 75,114, 3,185,105,118,114,232,158, 14, 85, 93,249,
-166,115,207, 57,111,242,135,247,189, 97,150, 48,236, 30, 96,186, 81,221, 85,117,235,158,115,222,231,121,254,207, 63,140,231,156,
-125,249,139,156,189,249, 38, 90, 40,100, 30, 53,192,189, 50,122,203, 95, 93, 76,209, 69, 39, 6,156, 76,106,242, 1,100, 10, 76,
- 29, 80,170,193, 26,152,207,230,108,170, 28,215, 66,125, 57,167, 28, 6,132,131, 16, 36,189, 65,142,169, 45,161,245,180,141,161,
-110, 3,189, 66,115, 53,242, 88, 39,153,207,107, 70,213,148, 96, 49,152, 36, 0, 0, 32, 0, 73, 68, 65, 84,178, 44, 33,128, 6,
-154,139, 43, 94,253,157,223,225,230, 7,158,103,120,227, 73,122, 91, 57,152, 22,153,119,240,206,160,179,156,224, 13, 82,119,112,
-198,197,100, 56, 51,143,103,172,212,248,118,134, 8,150,147,135, 39, 28,126,228, 91, 40, 50,197,239,126,238, 27, 60,106, 98, 99,
-104, 66,252,125,230, 29,185,202,232,228,209,231,162, 50, 81, 37,147, 73, 13, 66,144,105,137,150, 26, 45, 5,211,214,224,129, 77,
- 85, 82,230,154, 78,166,201,179,140,190, 53,137,228,107,113,121, 73,247,226, 62,199,189, 27,152, 16, 48, 22,182,250, 37,168,104,
-188, 51,157,205,209, 4, 58,133,224,248,232, 46,103, 23, 99, 62,244,236, 13,246,246,250, 84, 77,205,238,193, 30, 15,143, 78, 49,
-141, 33, 47, 58,228,121,203, 39, 62,250,126,254,202,199,190,147, 63,127,241, 21,142,143,207,185,211,209,116,132,199,181, 30,223,
- 56,124, 38, 17,153,198, 77,231,132,254, 12,217,235, 70, 95,143, 0,151,163, 41,211,185, 97,124, 81,113,239,254, 49, 95,121,249,
- 1, 91, 91,219,252,149, 79,124, 23, 27, 5,152, 22, 90,111,120,116, 50,229,246,193, 6, 87,253, 62, 31,248,201,127,192,151,127,
-250,191,199,165,227,205, 6,208, 66,243, 83,159,254, 93,254,229, 7, 63,201,219, 47,191,193,193,205, 91,140, 46,198,212, 77, 69,
- 87,111, 83,208,229,244,244, 8,219,194,222,206, 22,247,222, 60, 65, 40,199,233,116,204,118,103,200,230,102,143,250,212,208,248,
- 25,130,154, 55, 31,188,193,216, 7, 14,251, 7,204,236, 12, 41,114,230,182, 66,235,128,240, 37,143, 70,231, 56, 15,154, 12, 21,
- 36,141,109,217,144,154,249, 60, 32,136, 50,233, 92,101, 20, 42, 71, 16, 19, 34,223, 30,157, 33, 4,116,101, 73, 47, 69,242,206,
-109, 77,213, 56,118, 7, 25, 77,235, 49,198,147,103,160,127,238, 51, 47,242, 83, 63,250,239, 32,148,226,112,208,103,167, 51,166,
- 65,240, 91,223,120,135, 31,255,203,223,197,191,253,163, 63,227, 71, 63,249, 97, 42,183, 92,181, 46,137, 51, 36,105,208,210, 23,
-101,241,144, 91,207,240,217,231,248,244,139,175,243, 83, 59,147, 4, 73, 67,147, 32, 78,137,162,119,109,143,119,190,242, 53, 62,
- 52, 40,249,169, 59, 3,138,155, 55,104,239,191, 65, 0,110,216, 57,215, 31,189, 4, 15,211, 33, 4,204,211,132,233, 29,132,183,
-238, 17,222,184,203,158, 82,140,157,231,183, 94,121,192,191,122,241,254,146, 86,179, 85,104, 10, 37,248,192,225, 38, 47, 28,108,
-242, 29, 79, 92,163, 95,228,116,202, 12, 21, 52, 99,219,208, 54, 6,188, 67, 46,116,224, 33,122,114,239,110,246,150,208,159, 64,
- 96, 67, 52,209, 40,149,192, 35,248,137, 95,251, 50,255,221,119, 63, 77,111,216,167,231, 59, 75, 31, 77,111,147,255,186,140,134,
- 22, 34, 37, 84, 41,169,162,213,110, 34, 20,134,214,198,108, 99, 29, 13,113,250,131, 33,117, 53, 37,184,150,121, 93, 83,118,250,
-204,171, 41,214,212,136, 76,209, 41, 59,232, 34, 67,201,140,166,154,226,133, 98,107, 48, 96, 58, 57,167,163,107,122,221, 97,154,
-192, 3, 14,207,172,137,246,143,190,170,227,100,152,103,177, 64, 10,145,244,186,177,248,122, 31,137, 56, 27,253, 30,191,241,135,
- 95,163,151,165,168, 74,191,130,223,150, 80,170,140, 48,118,235, 60,215,247,119,152,183, 22, 37,245, 18, 86, 95, 28,210,113,255,
-158, 26,166, 32, 81, 11,221,191, 90,145,232,252, 34,130,214, 5,164, 8,116,242,146, 94, 25, 63,110, 83, 1,208, 82, 46,227, 21,
-189,139,164,187,188, 44,249,227, 55, 30, 44,229, 86, 97, 57, 5,198,198, 75, 34,216, 43, 20,222,184,232,175,173, 5,194, 11,188,
- 12,132, 54,160, 11,181,220,253, 74,145, 24, 89, 74,196,200, 96, 45, 86,177,142, 38,190,206, 15,203, 83,102,157, 59, 60,152,182,
- 92,140, 3, 87, 34,208, 17, 27, 12, 59,154,107, 27, 5, 23,211,146,203,241,140,169, 16, 12,123, 3,142, 46,207,121,242,154,167,
-241,158,100,178, 71,145, 69,180,196,152, 24,185,218, 41,115,230,141,139, 70, 70, 74,161,165,100, 92,213,108,111,244, 24,205, 42,
-110, 31, 30,242,232,241, 9, 90, 70,232,125,107,235,144,167,111,189,159,253,193,144, 23, 94,120,158,155,215,247, 48,110,194,134,
-188, 67,222, 53, 20,206,114,244, 59,255, 50, 78,216, 42,196, 61,245,186,174, 92, 45,118,209,139,132,171, 68, 56, 12,139, 92, 0,
-191, 42,214, 11, 35,163,119,201,216, 22,156,131,149,227, 92,240, 41,145,109,137, 10,176,148,176,173,112,247, 85,147,239,151,134,
-112, 17, 29,201,178, 24,246, 18,117,248,169,145,244, 81, 46, 23, 29, 87, 5,214,166, 6,192, 38, 41,173, 76,177,173,245,140,249,
-189,175,224,235, 9,184,121,244,100,168,174, 16, 65,210,206,166, 52,117,154,110, 76, 75,109, 42,108, 40,184,184,255, 58,199, 47,
-125,131,126, 47, 71, 43,135,171, 91,202, 94,129,148, 57,179,139, 57,251,195,146,250,106,140, 14, 53,123,101, 73,115,117, 70,222,
- 43, 35,148,111, 29, 50,120,230, 86,210,220,171,200,164, 66, 58,197,124, 30, 80, 2,154,198,113,117,217,198,128,167,243, 57, 69,
-167,196, 9,193,168,110, 56,191,170,105,173,195,122,199,238,176,192,155,134, 94, 55,227,106,220,240,250,209,132,219, 7,125,202,
-151, 94,197,163,144, 50, 39, 43, 52, 42, 19, 41, 82, 57,146, 75, 69, 30, 39,121,231,106,100,158, 19, 42, 19,209, 47,111,233, 12,
- 6, 12,118,182,153, 94, 94, 97,174, 95,227,112,103,128, 25,213, 52,198, 49, 49,150,218, 5,246,203, 18,143,136, 80,123, 0, 41,
-212,114, 45,162, 51,193, 86,191,207,172,110, 56,158, 84, 20, 74,211, 43,115,106,103,176,206, 51,246, 13,147,209,132,126,158,163,
-148, 36,211,154, 97,161, 9,206,115,125,144, 51,170, 13,151,109,195,188,201,152, 28, 95,209, 41, 11,174, 46,175,200,139, 30, 82,
- 79,121,234,230, 13,170,214, 49,170, 45,123, 10,118,134, 57,165, 86,220, 57,220,230,114, 60, 3, 17,152, 91,207,236,178,198, 52,
- 35, 58,189, 33,207, 62,123,131, 63,253, 12,108,119, 10, 74, 2,173,117, 20, 78,163, 92, 92,185,137,198, 32, 58, 37, 8, 73,219,
- 90, 76,109,121,227,209,140,251,175,189,130, 55,151,216,186,230,224,233, 59,108,170,138, 65,103, 11,235, 12,123, 91, 61,130, 82,
- 76,230, 13,179, 22, 94,248,196, 95,230,203,255,244,127,193, 87,213,242,254,181, 24,156,135, 95,254,195, 95,224,199, 62,241,183,
-248,202, 87,254,140,178,200,217, 63,216,231,232,222, 25, 35,123,193, 86,119,155,251,151,199,100,189,156,126,217,197, 4, 79,107,
-102,248, 60,112,122,117,193,185,157,112,189,123, 8,149,230,106,100,152,217, 41,247,253, 17,221,188,135,214, 30,193,144,139,217,
- 57,175,158,127,157,219,189,167,232,103,201, 91, 3, 79,161, 50, 94,122,124,143,110, 54,160,163, 21,115, 87,179, 87,238, 48,109,
-199, 12,203, 30,243, 6,114,169,232,170, 14,165, 46, 40,114, 79, 33, 20,231,205,148, 78, 40,208,114,147, 11,123,197, 97,103, 31,
- 23, 26,244,199,159, 60,224,236,242, 10,239,174,241,141,243, 49,231,115,131, 2, 62,121,103,135, 87,239, 31, 49,113,150,135, 15,
-207,169, 2,204,109,146, 0,173,217,142, 71, 50,212, 34, 54, 47,186,174, 73,173,185,175, 55,121,120,122,202,249,208, 47, 55,117,
-113,197, 28,232, 12, 59, 92, 77, 42,182,103, 45, 97,119,147,239,254,200,211, 76,103,134,226,253, 31,226,254,203, 47,211,206, 42,
- 82,204,114,244, 91,111,109,108, 34,218,248,128, 11, 31,167,238,109, 5, 39,109,116, 65,218, 92, 60,248,137, 8, 53,247,129,223,
-127,235,148,223,126,243, 20,254,248,245, 72,210, 2, 14,251, 5,127,253,153, 61,190,247,185,219,232, 82, 71, 91,210,228,183, 94,
-100,138,174, 82,244,243, 56, 29,250, 0,150,176,204,227,149, 4,166, 14,254,203,207,190,201, 47,254,240, 71, 24,205, 42,116,166,
- 80, 82,147,134, 95,132,147, 75, 94,129,148, 10,169, 2, 34,203,144, 34, 32,132,164, 44, 52, 54, 33, 5,101,145, 33,125,195,112,
- 56,192, 57, 67,145,119,144, 42, 68, 35, 27,107,240, 77,197, 85, 53,161,219, 27,226, 77, 67,183,211,229,226,106,196,127,241,139,
-191,202,171,231,147,248, 51, 9,216, 40, 52,251,189,146,103,118,135,124,252, 61,135,236,109,246,217, 26,246,201,148, 68, 38,104,
-223,185,168, 19,175,109, 74,201, 74, 63,159, 0,222, 56,159, 80,234, 8, 45,187, 36,113,146,114,117,112,139, 4, 81, 91, 23,184,
-172, 44,131,110,134, 32,114, 4, 98, 72, 68, 72,159,235, 8, 54, 26,222, 40, 25,187,233,152,152, 20, 8, 54,162, 12, 33,196, 41,
- 39,134,184,136,101,178,156, 82,113, 15,239,146,166,125, 1,225, 7, 21,141,142,122,121,135,127,241,213,183, 25,230, 49,229,205,
-133, 16,217,187, 41, 76, 68, 74,120,111,145,226,103, 67,252,249,156,243, 72, 98, 67,227,189,143, 19,159, 20,160, 3,194,199,160,
- 14, 41, 37,206,196, 85,132,179, 81,225, 33,210,122,251,123,196, 17,191,162,247,160, 53,209,135,222, 25,240,146, 97,145,113,107,
-216,227,168, 59,101, 82, 53, 40,225, 25,148, 5,151,227,105,242,140,119, 4, 33,177, 46,250,251,187, 0,219,131, 14,117,237,168,
-154,154, 66, 65, 46, 53, 38,120,122,157, 46,179,105,205,147,215,159,230,124,116,198,118,255,128,110,145,211,235,245,217, 26,236,
-240,236, 19,183,184,121,176,203,173, 59,135,108,237,247, 24,118, 54,217,217,183,204,231, 21,133,128,187,191,252, 63, 71, 95,130,
- 69, 71,155,158,143,165, 42, 81, 71, 82,218, 10,119, 73, 10, 5,239,211, 20, 29,145, 14,145, 24, 68, 33,136,213, 84,239, 87,147,
-185, 8, 43, 7, 64,155,144,249,133, 51,160, 84,105,109,144,234,191, 82, 97, 17, 58,152,154,189,152, 75, 40, 69,160, 49, 97,137,
-154, 57, 27, 63, 55, 36, 4, 48, 57,236, 46, 19, 84,149,142, 67, 96, 76, 50, 76, 19,255,204,129,200,192, 55,120, 51,197, 25, 67,
- 83,141,104,235, 22,111, 90,230,163, 75,130, 26, 82,238,223,228, 51, 63,255,243,248,227,123, 92, 43, 61, 91, 58,163,110,106,178,
- 96, 80, 87,115,144,134,173,224, 81, 35, 65,185,216, 31,214, 45, 93, 13,180, 45, 42, 64, 39,139,207,113, 71,186, 20, 61,237,216,
- 85,177,200,138, 0, 20,158,186, 5,131, 68,236,120, 26,107,104,230, 1,183,217,227,230,126,135, 76, 9, 76, 20,203,112,122,210,
-208,214, 53, 85,235, 65, 42, 30, 93, 54,212,174, 98,243,236,203,220,120,230,136, 27,239,251, 16,253,162, 76,228,218, 16,145, 54,
-239, 9,182, 69, 21,121,228,182,200,144,120, 65, 14,221,221,196,215, 21,146, 14,163,211, 83,180, 80,228, 90,225, 61, 12,181, 64,
-155, 64,109, 61, 82, 75,186, 42,174, 17, 42, 99,201,181,102,103,216, 39,211,146,119,206, 46, 57,175, 26, 60,208,235, 20, 40, 1,
-165,212, 52,196, 51,113,163,204, 41,180, 78, 22,200,241,222,200,242, 28, 49, 62, 39,219,186,201,205,110, 75,107, 97,236, 36, 42,
-215, 20, 89, 70,219,204,168,102,158, 87,222,124,132,199, 48,175, 20,111,189,115,194, 19, 55,110,209,217,241, 4,165, 40,202, 30,
-135, 91, 29, 26, 7, 15, 78, 4, 13, 57,253,174,160,223,237, 50, 28,116, 41,164,162, 80, 1,229, 2,166,106,144,133, 38, 43, 53,
- 97,102, 40,222,251, 28,147, 81,195,217,168,166,154, 92,114,118,113, 74,183,107, 25,159,143,216,234,151,200, 96, 80,120, 50,237,
-113, 6,102,227, 10, 93,104,118,119,123,145, 44,236, 37, 31,250,207,254, 62, 95,248, 31,255,155, 72, 34, 77,125,232,123,202,130,
-127,246,165, 63,231,111,124,252,251,185,118,120,192,213,213,152,199,199, 71,168, 60,199,212, 45,199,211, 83,114, 85,226,108,205,
-227,217, 21,219,221, 14, 79,238,236,240,198,217, 99,164, 44, 56,232,110,240,120,122,204, 70,103, 72,225, 2, 90,149, 92,213, 21,
-186,212,132,144, 97,204,156, 65,161,233,214, 61, 6,185, 70,101,158,110, 54,224,104,122,193,173, 97,206,101,221,163,167, 51,114,
-153,225,149, 71, 98, 24,228, 69,228,111, 17,200,101, 70,169, 36,131,142, 39,151,154,135,227, 17, 90, 68,159,255, 71,151, 19,114,
-169,177, 97, 70, 38, 75,244, 78,175,207,193,181,107,252,227,127,243, 41, 6,133, 96, 43, 83, 52,214,243,184, 17, 60,165,115, 62,
-241,225,247,243,226,231, 62,139,180, 44,189,201,125, 8, 81,115, 41, 67, 60, 27, 76,124,128, 77,128, 66, 56,254,198,223,253, 17,
- 70, 95,125,137, 79,124,242, 54,199,243, 3,142,206,175, 24,108, 14,184,254,220, 83, 28, 8, 75,171,186,100,155,123,252,210, 63,
-249,231,124, 84, 43,132,243,184, 60,167, 23,106,158,120,239,211, 75, 40,120,120,243, 26,191,252,171,159,227,227, 31,250, 48, 95,
-255,226,231,145, 2, 84,202, 66,151,192,199,114,207, 43,141, 88,134,160,248, 37, 73, 39, 22,143, 92, 10,242,181, 32,168, 16, 2,
- 15,167, 13, 63,243,229, 7,252,204,151, 31,240, 19, 47, 28,240,253,223,122,135,121, 99,200,180,166,204, 20, 66, 36, 23, 57,151,
-108, 46,223,237,191, 17, 53,209,214,243, 3,255,231,159,240,111,126,244,163,244,178, 12, 27, 92,218, 9, 10,132,136,187,111,161,
- 98,168,130, 13, 2, 23,162, 91, 26, 50, 18,180,202, 76, 97,172,197,154,150,217,188, 66,138, 10,149,201,232, 72,214,122,138, 60,
-103,208, 45,144,178,160,109, 45,243,209, 5,156, 60,230, 51,175,188,201, 63,188, 95, 49,204, 37, 27,185, 90,238, 44,141,247,220,
- 27,205,120,245, 98,202,175,191,250,232,155, 52,230,138, 92, 41,158,223, 29,240,220,181, 77, 62,254,212, 33, 91,219, 27, 24,153,
- 17,106,147,148, 12, 62, 38,170, 45,172, 57,137,123, 97, 23, 22, 44,228,216,144,117,181,224,127,253,131, 23,249,169,127,239,163,
-156,141,167,209, 19, 63,133,111, 68,105,146,194,137,136,199, 70, 67,146,248, 96,197, 41,221, 39, 34,161,136,147, 59, 2,161,228,
-178, 9, 11, 8,124,146,220, 44, 24, 88, 62, 56,164, 44, 24,246, 11,254,236,222,163,168,147, 94,196, 1, 39, 46, 71, 36,244, 8,
-122, 90,241,124, 87, 36,147,164,232,219, 46, 23,190,207, 58, 78,135, 50, 21,155,104, 77,224, 35,107,216,249,104,118,146,194, 99,
-228, 66,228, 33, 4,189,219, 79,240,239,254,249,203,252,250,240, 54,210, 24,142, 47, 43,122, 90,178,211, 41,144, 67,199,197,222,
-128,171,170,193,121, 73,169, 51, 26,211,198,125,163, 15,200, 96,240, 66, 98,210,168, 42, 5, 20,153,160,200, 98,142,183, 84, 34,
-238,141, 69, 96,119,123,139,139,241, 21, 79,221,124,129, 7,231, 21,251,251, 59,104,225, 24, 12, 55,217,221,223,161, 59, 24,114,
-176,155, 51,232, 14, 25, 94,147,204, 47,198,200,174,231,141,127,241, 51,145, 8,183,220,111, 7,132, 93, 16,225,226,234,229, 93,
- 94,234, 33,238,175,227, 30, 61, 69,152,134,176,102,247, 42,214,164,110, 43, 13,185,124,215, 14,124, 97,126,180,246, 76,172, 37,
-173, 5, 34, 43,158,212, 24, 70,136, 63, 90,193,134, 16, 61,228, 67,186,159,130,128, 96,211,215,138,181, 46,249, 19,196,201,221,
-154,200, 39, 83, 33,250, 11,196,191,148, 4,107,161,157, 99,167, 99,124,107,177,243, 6, 91,215,180,179,105,204, 58,232, 12,249,
-244, 47,254, 50,217,213, 49,223, 58,152,196,198,101, 60,141,197, 91,130,200, 98,216, 17, 90, 98, 76, 68, 5, 98, 51,146,116,251,
-137,219,176,104,150, 22,206,120,113, 75,225,215,108,241, 5,185, 14,228,137, 40,176,171, 5,147,155,183,120,243,254, 25, 18,131,
-207, 37,214,120,156, 20,156,143, 90,174, 90,143,117, 2, 21, 34, 87, 98,103,187, 71, 57,232,113,122, 60,163, 24,188,141,200, 11,
-134, 59,187,132,224, 16, 42,143, 77,104, 46, 9,198, 18,156, 65,138, 16,109,184,123, 3,236,124, 78,127,107, 64, 38, 3,243,217,
-140,218, 58,246, 54,186,100,121, 78,221, 24, 38,181, 89, 94, 83,227, 19,129,222, 7,178, 60,163,219,237,128,210,228, 74,113,163,
- 53,209, 9, 79,169, 24, 17, 12, 84, 77, 75,109, 93,242,188,144, 12,180, 66,167, 6, 80,105, 73, 41, 3, 46, 11,156, 95, 25,106,
- 99,233,150, 29,166,117,139,111, 44, 27,195, 46, 77,219,240,204,147,251,156,158, 92,209, 56, 79,230, 21, 1,199,241,197,148, 97,
-167,160,223,203,113,120, 30,157, 53,204,106, 65,167,219,167, 91, 72,166,179, 49,147,121,197, 86,209,163,200, 21,193, 5,118,186,
- 61,118, 95,184, 67,214,217,160,208, 61,228,238, 22,223,120,253,146, 94,230, 49, 74, 82, 29,191,193,241,201,107, 28,238,238,144,
- 23, 25, 55,183, 10, 10, 37,169,166, 83, 26, 11,206,100, 20, 54,199,247, 51,156, 53, 76, 38,129,195, 15,126,219, 18,177, 90, 72,
- 45,159,208,134,175,170,130,191,251,191,255, 35,254,241,143,252, 61,238,142, 47,200,116, 78, 85, 89, 6,131, 46, 94,102,156,159,
- 92, 50,169, 12,131, 28, 46,231,134,142,174,177, 4,250, 82,224,131,229,172,154,128,147,140,204,156,218,215, 88,103,226, 46,222,
-205, 9, 65, 50,171, 27,118,179, 33, 71,213, 49,133, 84,220,222,220, 66,166,243,123,144,119, 0,207,245, 93,205,209, 69, 14, 78,
-112, 92, 95,162, 5, 40, 20,187,157, 1, 85, 91, 99,140,226,168,185, 98,160, 59, 84,205,140, 27,189, 45,242, 44,227,222,165, 97,
-208,201,105,141, 71,119,132,229,242,193,219, 60,189, 81, 80,202,125,222,183,215,231, 98,214,240,225,155,219, 60,185, 59,100,124,
-244,128, 34, 88,198, 11, 15,104,214,117,164,177,176, 19, 4,173,143,109,207,214,238, 22,125,209,208,249,192,211,144,229,108, 74,
-201,243, 69, 1, 90,227,172, 99,126,255,156,199,175,190,202,141,239,216, 97,112,243, 22,191,246,230, 59,104, 15,223,123,176,201,
-145,202,232,110,148,232, 60,231,205,139, 25,213,189, 83,126,240,125,135,252,254, 27, 15,121,230,219, 63,194, 31,254,233, 23, 48,
- 46, 78,204, 66, 64,129,163, 43, 53,149, 95,249, 81, 47,109,126,215,236, 46,229,162,224, 11, 65, 38, 23, 5, 7,190,114,217, 32,
-191,241,144, 31,248,200,243,252,225,215,223, 98,100, 26,254,234,115,183,150,187, 61, 23,194,242,162,175,162, 46,226,231,239,228,
-154,191,249, 43, 95,164,159, 9, 42, 23, 73,115, 54,188,219,180,197, 3,255,219,181,140,162,208,209,117,174,219, 65,117, 10,178,
-110, 23, 61,232,147, 23, 25,253,188, 36,151,150,151, 46, 26, 90, 23, 53,241,247, 70, 51, 62,253,230, 17,199,211,154,202, 4, 62,
-214, 21,252,205, 13,216, 11,176,145,107,220,194, 23, 61,125, 15,153,138, 92, 39, 25,116, 44, 62,102, 3, 24,231,105,172,231,115,
-247,207,249,236,253,115,254,143, 47,190, 73, 33,225,187,111,108,242,125,207,220, 96,119,107,128, 73,185,237,139,139,235,136,144,
-183,100,193,126, 15,100,233,189, 56,153,205,121,233,193, 9,207, 28,110,209,186, 16,175, 5, 2,239, 18,166, 26, 34,178,177,176,
- 14, 85, 16,215, 17, 90, 69, 56, 62, 77,230, 54, 56,100,154,212,145,130,186,141,144,161, 34,160, 69,108,174,130, 3,113,239,117,
-234,203, 49, 63,123,119,198, 48,139,254,231,137,194,144,118,211,130, 28, 65, 38, 21,251, 68,247, 58, 37, 3,198, 64,150, 69,126,
-135, 49,209,235, 31, 4, 74, 69,175, 5, 73,188,198,107, 33, 97, 32, 2, 54, 77,233,229,225, 77, 46, 79,207,105,166, 45,223, 85,
-156,242,105,177, 65,222, 52, 52,117,134,151,129, 94, 33,185,179,217,225,248,178,195,212,150,156, 92, 94,146,101, 29,130,143,105,
-128,181,141,137,132,222, 47,140,236, 60,247, 38, 13,193,218,232,129, 96, 28,185,138,154,128,203,217,140, 82, 41,154,160,216,221,
- 26, 80,148, 93,158,218,221, 98,115,103,147,155,123,219,108,110,118, 17,193,163,132, 66,183,115,102,174, 65,190,252, 58,143, 63,
-243, 27,137, 39,145, 28,220, 18,210, 16,156, 79,206,121, 97, 89,132, 73, 50, 62,111, 83,144,138, 19,203,160,181,133,219,223,242,
- 57, 89, 16,102, 18, 95,193,165, 68, 53,181,240, 17, 88, 16,235, 22,140,120,183,198,190, 88, 51,169,114,206, 35,149, 76, 95, 70,
- 36,143,119,177, 10,133, 89,172, 79,210,173,231, 12,132, 4,201,167,237, 8, 88,176,137,239, 32,157,160,122,240, 70, 76, 79, 51,
- 45, 88,131,171,167,216,121,133,157, 87,113,199,159,111,242,246,151,254,132,243, 7, 71,124,104, 27, 92,155,130,145, 68,140,196,
-245, 62,114, 41, 22,238,119, 90,137,132,196, 69,216, 31, 9, 50,136,196, 59, 16,233,117, 36, 50,223,178,203, 93, 52, 62, 34,161,
-113,130,157, 23,174,211,182,125, 30,156, 84, 96, 90, 92,153, 45, 3, 85,155,185, 71,105, 73,110, 64, 43,207,176, 83,146,119,114,
-242,188,164, 40,186,140, 47,198, 60,120,229, 33,198, 8,204,211, 13,219,215,111,197,235,102, 91,112, 38,250,197,203, 2, 65, 75,
-230, 90,130, 15,212,163, 75,154,113,197,222,243,207, 51,185,156,178,183, 51,196, 65,244,125,215,130, 65,174, 80, 89, 70,211, 90,
-122, 90, 99, 67, 96, 50,111, 40,116,204,119, 55,245, 28,132, 35,242,111, 5, 33, 56, 50, 41,217, 30, 14, 80, 90, 49,111,154, 72,
-168,243,158,198,218,229,110,197, 58,135,105, 44,123,237,152, 89,183, 79,215, 5,166,141,167,144,150,188,219, 35, 88,131,107, 26,
-222,124,251, 17, 69, 81, 46,239,195,106,222,144,229,138,199,151, 45,131, 78,193,131,218,210, 45, 58, 12, 6, 29,202, 76, 50,157,
- 54,220,184,126,200,231, 47,106, 62,124, 35,103, 54,155,179, 49,236, 50, 40, 36,221,205, 33,202,130,191,115,192,222, 51, 31,229,
-143,127,239, 62,253,142,226,149,211, 11,218,233,155,220, 62,216,194,152,192,222,176,139, 48, 35, 6, 29, 65,211, 26, 70, 70,113,
- 57,158,112,227,112,147,233,116, 70,161, 5,151, 99, 65,111,211, 83,110,237, 48, 59, 59, 95,214,179, 3, 29, 40,145,188, 51,155,
-242,104,250, 58,153,206, 80, 90, 33,179,138,217,220,208,216,192,188,109,216,217, 29,112,124, 60, 99, 30, 26,174,239, 13, 56,153,
- 84,244, 59, 37,199,211, 41, 79,244, 15, 57,105,174, 40, 85,142, 15, 45,150,140, 81,117, 74,153,117, 80,100, 92, 27,244, 25,205,
- 27,138,224,168, 92,197, 43,231,143, 81, 40,206,199, 51,180,204, 57,173, 79, 25, 63,152,178, 93,246,152,184, 57,153,210,104, 52,
- 61,149, 49,107, 91,140,183, 40,171,233,208, 37,120,201,110,177,201,104, 62, 99, 58,109,145,228,156, 76, 91,110,246,247,209, 23,
-111,221,195,189,121,151,171, 0, 99, 34,220, 92, 0,231, 95, 31,241,226,215, 95, 66,231, 18,149, 11,122, 74,188, 43,129,105, 21,
-185, 25,161,181, 82, 11,164,131,231,118, 6, 28,125,230, 75,244, 14,118, 16, 59, 27,200, 34,135,209,132,233,163, 51,142,207,174,
-216,222, 57,224,252,238, 67, 58,252, 57, 31,123,223, 11,252,209,107,119,169, 28,124,237,157, 11, 14,180,228,147,147, 46,227,137,
- 33,207, 37,131, 76,243,226,249,136,173,160, 57, 12,135,188, 60,143, 7,143, 92, 56,126, 6,248, 54,105,249, 90, 80,180, 74,160,
-124,192, 9,193,101,235, 16, 33,234,252,114, 33,151, 30,214, 90,172, 24,185,173,247,124,219,193, 54,167, 87, 99,158,187,115,141,
- 31,253,133, 79, 49, 11,129, 65, 57,228,102,175,228,203,231, 83,186, 42,237, 2, 89,139, 56, 79,144,183,245,129,173, 66,113,213,
- 24,132,140, 83, 73,182, 30,116, 1,236,107,193,253,214,163, 77, 74, 20,155, 38,107, 72, 41,144,233, 32,150, 2,126,107,236,248,
-253,234,221, 29, 65,169,162,212,108,187,212, 12, 10,129, 23,134, 34, 4,178, 68,238, 16, 9, 49,145, 41,105,140,176,242,233, 86,
- 50,166,182, 73, 86,141,152,150,171, 84, 56, 7,252,222,253, 43,174, 55, 21,223, 51, 80,148, 34,162, 44, 50,133,170,196, 73, 56,
- 68,169, 23, 43, 52, 64, 10,193,102, 39,231,167, 63,253, 10,191,240, 31,125,130,179,203, 73,156, 60,141, 69,248, 72,142,155,183,
- 45, 34,229,195, 55,173,229,114, 86,227,130, 96,220,180,156,215,150, 73,221,114, 86, 71, 95,125, 2,156, 86, 13, 46,192,191, 63,
-204,185,233, 42,240, 96,189, 79, 18,202,168,167,254,111, 47, 2,189, 76,226, 72,211,102, 84,157, 71,102,177,140, 54,174, 93, 45,
-201,132,133, 0,173,245,100,153,194,217, 16,237,188,165, 72, 54,174,129, 5,183,223, 18, 15,218, 54, 77,162, 66,186,248, 94, 6,
-200,247,110, 70,171,216,227,115,178,157, 30,135,213,140, 27, 82,240, 80,150,140,167,154,173, 92, 35,133,103,168, 36,251,165,228,
-201,206, 22, 38, 28,243,178, 19,220,217,232,114,247,114, 10, 46,160,117, 32, 87,113,143,121, 49,107, 99,124,167,138,161, 22, 72,
- 73,161, 37, 70,128,118,146,221,189,111, 97, 86,157,241, 45,239,121, 63,231,211,154,243,121, 77,175,169,232, 21,129, 44, 88,188,
- 9,228,217,140,241,131,154, 66,156,242,226, 79,255,125,124,114,122,243, 11,162, 95,194,191, 23,211,179, 72,227,112, 32,128, 91,
-133,179, 96,150,115,120, 92, 19, 45, 27,225,149,118,121, 97,219,206, 90,170,154, 79,220,137,176,226, 39,190, 43,177, 45,176,144,
-175,145,252,250,227, 10, 2, 1,210,198, 85,140, 77,197, 58, 72,177,218,241,167,255, 9, 1, 65,250, 4,235, 11,236, 26,177, 78,
- 74,176, 65,192,116, 14,174,194,215, 51,218,201,152,106,116,137,109, 26,234,217,148,144,245,169,199, 23, 28,221,125,135, 45,221,
-208,157, 94,224,228,194,178, 54, 16,212,130,105,159,154, 12, 23, 48, 65, 32, 67,114,122, 83, 34, 90, 6, 3,184,101, 96, 60,214,
-132,181,136,216,216, 32,121, 4, 69,158, 81,234,156, 92, 43,154, 90,241,218,163, 11,234,113, 69, 94,168,213,116,161, 36,158, 40,
-203,210, 82, 48,220,219,197, 52,142,157,189, 45,154,121, 67,145, 43,122,221,146,211,179, 17,211,175,204, 41,250, 93, 54,118,119,
-208, 89,137, 84, 42,162,133,206,198,247,190,109, 98, 56,140,241,200, 60,167, 74,249, 20,167,167, 23, 52,109,131,113,177, 57,207,
-133,164, 24,228, 72,149,211,237,248,168, 48, 9,176,187, 57,192, 11,133,113, 30, 95, 4, 26,227, 80, 58, 5,218, 68, 23,125,156,
-141, 42,149,110,174, 16, 34,167,181,134, 80, 69,238,145,150,130,178,236, 81,230, 57, 93, 5,199,231, 30, 43, 2,195, 66,225,101,
-134, 84,158,203,203,138,172,232, 96, 29,108,117, 58,220,185, 54,224,106,102,121,243,254, 99,158,189,181,135,243,129,199, 23, 53,
-253,178, 96, 82,213,108,109,244,217,232, 23,100, 66,242,214,203, 95,227,245, 54, 99,103, 88, 80,246, 74,134,133, 98,243, 96,139,
- 50,239, 35, 59, 61, 54,159,121,138, 63,253,218,132, 78,238, 57,185,152,243,133, 63,249, 93,234,182,101, 39,203,216,236,150,108,
-119, 51,114, 33, 56, 61, 61,102,127,111,159, 78,107,216,222,202,145, 62,174, 69,242,126,129,198, 49,110, 4, 59, 47,188,159,249,
- 31,253, 65,116,235,244,240, 76,222,112, 43,235, 81,200, 46,111,125,230,215,248,206, 31,252, 9, 94,124,233, 17,135, 55, 6,188,
-242,218, 9,189,162, 71,109,230,104,209,229,164,185,224,185,253,235, 60, 60,157, 80,102,154,147,217, 57,133,204,232,109, 25,122,
-167, 5,142,192,182, 30, 32,155, 49,149,179,140,234, 17,185,204,105, 92,195,118, 47,167,200,115,122, 77,206,189,233, 3,158,217,
-220,197, 57, 24,116, 13,143,166,145,143,101,156,165,106, 27,182,139, 30,221, 50,163, 54,241,243,174,102,138, 54,204,217, 27, 14,
-208, 58, 48,169,224,157,241, 21,183,123,251, 12, 59, 37, 51, 83, 99,228, 24,237,137, 19,237,150,128,203, 16, 15,114, 33, 96,228,
-161, 43, 98, 52,117,208,130, 66,197, 3,222,167, 98,146, 8,178, 75,157,171, 76,240,204,139,175, 63, 64, 7, 7,175,189,179,212,
-200, 46,136, 49,141, 9,184,215, 31, 51,243,160, 30,125,137, 66,194,237, 66, 97,124,136, 69, 37,192, 87,175,102, 52, 2,204,108,
- 69,132, 2,193,139,159,251, 2,183,178, 85,140,179,247, 96, 5, 52, 30, 62,162, 29, 58, 49,205, 37, 48,216, 41, 99,150,176, 11,
-220,247,112,214, 88, 38, 65,240,168,106, 49, 46,158, 82, 91, 2,126,251,149,119,120,102,216,231,199,126,230, 95, 35, 9,244, 4,
-252,219, 23, 95,103, 67, 43,254,234,193, 6, 15,170,154, 71, 85, 75,161, 4,237, 98, 82, 17, 43,171, 43,227, 61,106,221,191, 90,
-172,161, 24, 34,240, 66, 38,120, 96,124,210,208, 39,107,204, 84,168, 72,251,230,223,156,122, 30, 59,232,232,149,142, 88,132, 88,
-168, 8, 49, 24,165,113,158,183,234, 24,237,121, 71,195,235,109,124,239,197,218, 33, 28,190, 73, 58,180,248,220,120,180, 70,233,
-218, 18, 84, 13,144, 75,248,205, 43,199,119,102, 14,157, 96, 98,183,234,214,112,196,201, 38, 90,115, 46, 62, 63, 18,233, 54, 59,
-154,159,254,191,254,128, 31,202, 91,126,242, 34, 80, 39,184, 82, 74,104,191,201, 98,246,255,235,151, 18,160,165,160,155, 89,156,
- 51,139,188,151, 37,121,241, 87,166,129, 81,136, 48,117,156,176,253,114, 39,171,164, 32, 19,130, 82, 70,190, 68,198,154,149,177,
- 15, 8, 21,167, 76, 66, 32, 83,169,144,120,143, 79, 83,155, 75,250,233, 0, 96, 3,109, 86, 64, 94, 64, 61, 35,212, 45, 20, 57,
-230, 98,134,239,229,124,232,228,146,179,253, 67, 92, 93, 99,219,140, 66, 11, 74,229, 41,133,228,187,119, 53,121, 21,184,222, 90,
- 30, 90, 75, 47, 19, 92, 85, 45,141,141,138, 8, 37,147, 17,141,148,120, 17,232,104,137, 12, 2, 99, 29,131, 34,231,188,109,144,
-230,152, 15, 60,241, 28,165,110,217,217,235, 83,217,150,110, 38,208,161,161,144, 1,230, 30, 55,179,180,231, 15,121,249,159,255,
-131,149, 44,108,141, 64,138,136,129, 66,209,130, 53,217, 8,251,176,156,228, 9,137,241,159,166, 77,145,138,182, 99,137,198, 39,
-214,123, 42,246, 34, 65,229, 94, 44, 89,245,193,175,200,120,126, 13, 49,193, 71, 53,130, 88,147,173,201,197,142, 62, 53,139, 33,
-164,224,158, 20,224,179, 92, 29,167, 23,160, 84,140, 42,144, 2,188, 2,145,160,241,184, 2, 16,209, 44, 38,239,226,171, 57,118,
- 54, 78,198, 49,129,217,227, 71, 24,145,163,135, 3,190,241,251,159,226,213, 87, 31,240, 61,183, 59, 8,227,163,188,208,173,180,
-241, 66, 70, 72,127, 49,124,202,116, 63,120,191,104,138, 86, 94, 28, 11,163,156,165,165,110,162,242, 71, 90,134,160,171, 99, 46,
-196,116,208,103,236,123,244,122,138, 66, 43,180,238, 49,187, 28,131,212,145, 13,222,209,232, 18,242,162,192,121,141, 55, 6,149,
-105,218,241,148,102, 50,198,204, 43,186, 90, 33, 11,205,232,209, 57,253,237, 19,246,158,184,137,105, 44, 90,105,130,240, 96,155,
-216,232, 6,137, 49, 35, 92,107,233,151, 10,233,163,207,187,150,106,233,158, 40,180, 70, 10, 29, 37,173, 89,150,226,157,227,228,
-177, 32,202, 77,109,155, 60,242,109, 50,198,178,104,169,233,246, 75,138, 44,163,215, 41, 81,185,198, 26,199,214, 32, 70,172, 26,
-111, 81, 90, 67,128,218, 7,254,210,134,229, 83, 87,145, 60,215, 90,195,120, 6,239,185,189,203,108, 50,103,106, 29,167,151, 83,
-206,175,198, 92,223,219, 64, 73,201, 59,199,231,108, 14,186,236, 13,187, 60, 60, 31,211, 41,251,160, 43,130,200,185,121,237, 6,
-255,213,207,253, 12, 55,118,118,249,149,251, 51,254,243,247, 31,210,100, 37,219,215,174, 83, 92,127,130,205, 15, 63,205, 23,222,
-216,160,241, 35,180, 10, 84,163, 11,238,221,123,133,195,195,235,132,224,232,246,114,182,135, 5, 90, 53, 88, 99,105,155,134, 78,
-166, 24,148,130,160, 2,181,113,204,235,134,221,161,162,192, 51, 56,188, 30,221, 5,211,121,227, 60,124,127,191,225, 83,179,140,
-219,210,113,254,213,207,178,123,240, 45,188,115,111, 68, 39,203,233,246, 21,219,110,192,235, 71,143,233, 75,205,107, 39,239,160,
-133,224,112,227, 26,245,216, 48, 49, 13,254,178, 69,233,140, 59,187,125,198, 35,199, 27,163, 75,134,249, 22,221,188,203,220,183,
- 12,242, 28,107, 97, 82, 55,160, 12,153,204,120, 48, 26, 35,164,194,186, 62,251,157, 33,153,150,140,230,115,186,186,228,202, 84,
-140,140, 32, 19, 42, 42, 41,236,132,198,195,248,124,206, 48,239,113,101,230,108,102, 3, 30,206,206, 80,226,128,139,166,161, 84,
- 18, 61, 81,130,107, 8,242, 94,134,154,180, 75,211,148, 45, 21, 15,202, 49,112, 16, 64, 43,129, 13, 2, 77,124,208, 93, 8,100,
- 66, 70,216, 78,196, 9, 63,164,226, 46, 61,152,202,167, 66, 43,176, 10,188,134,172, 4, 59,243,241,144,202, 5, 38, 8, 54, 8,
-212, 8,132, 13,212,233, 80, 40, 3,204,210,179,216, 15,130, 41,208, 33,230, 40, 47,138,142, 74, 68, 46, 45, 2,103, 46, 94,148,
- 5, 44, 59,173,106,204,172, 70,134, 8,255,222,208,154, 60,207,248,246,221, 30,115,107,168, 91,131,179, 41,113,183,154,178,225,
- 61, 31,233, 68,198,181,192, 83, 32,185,209, 54,148,166,225,102, 6, 35, 31, 24, 3,231,233,123,228,233,181, 89,160, 47, 83, 65,
- 36,162, 4, 50, 21,191,142, 20,220, 53,158,183, 77,226, 1, 36, 40, 90,138,200,156,213, 2, 38, 65,112, 22,100,132,105, 67,148,
- 18,121, 32, 83, 34,241,139, 98,133, 82,222,242,200,196, 98,252,173,185,224, 77,155, 14,161, 16, 18,108,188, 34, 45, 46,127, 19,
- 44,181,195, 44,201,233, 97, 13,114,133,218,122, 30,154,120, 96,134, 52,161, 47,186, 18, 25, 18, 20,157,144, 17, 31, 60,141, 39,
-154,162, 56,207,105, 81,242,211,151, 13,117, 88, 28,224,241, 51,115,249,255,179,154, 47,195,185, 4, 90, 72,250,222, 18,222,221,
- 19,241,199, 77,224,203,173, 88, 78,146,203,200,206, 52, 34,230,196, 73, 61,151,146, 2,143, 98,245, 53, 23, 19,160, 74,211, 86,
- 16,145,221,237,130, 64,234,144,180,228,139,120, 80,133, 81, 5, 25, 32,219, 6,156,197, 85, 53,182,118,168, 66,209,142,106,102,
- 74,240,241,203, 11, 94,218,219,228,242,106, 66,183,204,152, 86, 53,123,131, 77,244,221,175, 98, 2, 92, 87,142,111, 84, 53, 87,
-243,150,166, 49,164,122, 74,191,204,104,173, 35,147, 81,226,103,156,195,167,230,228, 98,222,224,156,165,236,108,115,255,252,156,
-239,121,110,147,185,107,216, 40, 20,155,178,229,193, 27,119, 9,192,199,190,243,125,140,191,244, 41,222,254,245, 95, 90,178, 23,
- 23,158,249,114, 33, 19,117,145,172,233, 23,138, 4,181,154,182, 69,170,218, 11, 15,252,133,172,116, 25,214,178, 48,161, 73, 28,
- 7, 17,179,132,146, 85,108, 44,236,139, 95,110, 97,245,154,214, 88,107, 28,186,165,110, 61,248,176,132,246, 23, 77,237,226,235,
- 6, 23,150, 31,183,172,238,221,214, 69,235, 97, 36, 56, 19,215, 5,164,226,187,104, 86, 84,183,139,111,231,248,217,136,234,241,
- 17,179,203, 51,234,233, 12, 57,216,101,124,118, 78, 61,153, 50, 80,138, 77,115,177, 44,212,203,201, 60,120,132,147,203, 55, 77,
- 36,148, 75,132,176, 36,231, 17,226,251,150,250,188,165,164,207, 89, 31,125,238,133, 32,223, 28,176,243,158,235, 4, 74,206,173,
-165,181, 5, 97, 58, 69,117, 10, 66,104,233,237,236, 83, 12, 58, 52,149, 65,151, 37,211,139, 43, 74,153,211, 54,142,222,102, 15,
-211,182,120, 23,147, 31,171,209, 24, 77,244, 32, 23, 22,218,217,132,201,197,136,178,223,165,183,181, 27, 51,194, 67,204,150,176,
-213, 60, 78,212,141,139, 68,213, 78,201,193, 83, 79,114,255,193, 9,163, 89, 67,166,163,204, 84,169,232,102,103,156, 37, 24,129,
- 40,242,180, 66,136,164,130, 60,151,108,234,184, 22,113,214,209,182, 54,122, 35, 40, 77,191,223, 91,118,120,190,109, 49,117,139,
- 49, 38,229,217, 11,108, 27,195, 75,124,107, 9,222,240, 61,174,229, 43,161,207, 36, 43,217,218, 28,242,240,254, 25, 66, 8, 54,
- 7, 5, 51, 51,227,224,218, 54,199, 23, 99,118, 55,182,184,182,221, 99,110, 61,111, 31, 95,144,103,113,247,127,227,176, 96, 62,
- 27,115,122, 42, 57, 57,127,196,179, 55,111, 50, 42, 7,252,250,169,231,199,191,235, 26, 59, 79,223,193, 30,222,224,255,254, 82,
- 31,153,207,217,236, 74,204,188,230,143,191,248, 71, 12, 58, 25, 77, 51, 97,175,191,203,245, 97, 31,231, 5,221,197,106,210,182,
-232,188,164,109, 98, 12,107,167, 91,160,144,132, 68, 60,147, 9, 65, 11,107,135,206, 13,101,249,145, 65, 36,248, 78,238,127,141,
-237,219, 31,164, 40, 2,247, 30,157,177,121,176,199, 19,187, 61,238,127,241,140,157,193, 6, 29,163,120,229,242, 81, 36, 7,122,
- 79, 33, 2, 39,147, 25, 55, 7, 27, 72,109,241,162,165,175,251,120,111, 25,118, 59,148, 54, 67, 8, 75,235, 91, 90, 95, 51,110,
-166,244,178, 62,214, 89,148,128,153,153, 71, 75,104, 9,221, 76, 80, 22,138,147,137,197, 5,135,193,242,120,118,138, 22, 57,135,
-221, 29,198,237,140,137,169, 40, 85,137, 36,112,208,217,230,188,157,242,244,246, 1,119, 71,199,232,235, 82,160,210,158, 76, 47,
- 28,142,210, 36,211, 77, 15,105,222,141,110,103,121,154,110,144, 34,222,104, 36,166,171, 12,232, 32, 83, 24,125,192, 7,205,184,
-182,156, 10,120,182, 27,205, 59,156,139, 32,184, 42,162,109,167, 23, 33,154,217, 55,129, 78,218,251,117, 22,190,209, 4, 58,105,
-247, 54, 39,176, 45,160, 80, 48, 72, 94,227,142, 72,158, 1,184,103, 88,178,113, 23, 77,185, 90,184, 93, 45,122, 0,103,105, 43,
- 75,195,124, 57,149,200,181, 34,184, 11,140,150,164,159,128,109, 91,238,174,253,187,174,132, 82,192,126, 82,186, 84,136, 91, 0,
- 0, 32, 0, 73, 68, 65, 84, 66, 45, 10,163,128,184,223,206, 86, 26,219,176,118,136,233,181,221,186, 16, 17,245,180, 30,230, 62,
-254,121,150,224,116,147, 8, 57,209,127, 60,213,188,180, 42,112,206,241,181, 54,122, 56, 47,190,167, 2,156, 84,177,137, 90, 22,
-178,144,164,103, 43,162, 20, 98, 49,148,165,163,109,225, 12,151, 14,219,158, 86, 60,178,142,158,136, 77,203,138, 55, 16,225,184,
-165, 30,121, 73,122, 10, 52,214, 82, 40,197,220, 58,142,194, 42,134,115,157,119,176, 52,222, 33,252,191, 23,245,101,129, 14, 20,
- 10,188,115, 75, 75, 88,128, 51, 7,191, 81, 45,246, 61, 98,165,163, 23,209, 9, 32, 79,197, 92, 11,200, 4, 28,168,176, 12, 16,
-137, 59,154, 20, 60, 34, 35, 18,101,157,143,228, 58,145, 10, 68,130,130, 5, 42, 54,127,222, 16,218, 64,200, 52,243,241,156,188,
- 87, 32,149,143,110,111, 82,176, 93, 20,232,190,196, 93, 77, 56, 34, 48,182,144, 5,193,247,234,147,120,221,125,124,127,206,219,
- 26, 19, 2, 23,179, 26, 1,244, 50,201,196,199, 37, 70,174, 37, 77,235, 40, 51, 73,157, 8, 24, 74,122,134,221, 33, 91, 29,193,
- 51,215,174,195,124,198,217,201, 35, 94,126,120,143,147,209,152, 32, 4,255,245,223,250, 59,188,253,243,255,144,217,195,183,227,
- 91, 38, 19, 9, 46, 89,177,106,185, 34,137, 10,159,238, 67, 25, 31, 6, 17, 4,206, 71, 34,100,112, 1,181,240, 92, 79,150,185,
-137, 11, 21, 7,103, 27, 25,234, 98, 45,219, 97,201,130, 79,255, 45,167,251,101, 97, 23, 75,242,236, 58,171, 52,164, 70,207,249,
- 85, 20,171,124, 23, 10,147,200,116, 97,205,231, 61, 53, 27, 54,193,237,222,196, 7, 61, 1, 8,241,158,116, 45,225,242, 33,205,
-197, 41,118,124, 73, 59,155, 80,207, 29, 58,243, 76, 31, 31, 49,186, 28,243,209,189,168,115, 22,136,101,211,235, 9,232, 60, 14,
- 33, 66, 18,117,230,114,237,158, 21,107, 40,215,178,233, 16,233,245, 39, 47,132, 60,167,215, 47,217,184,189,143,216,186,206,232,
-114, 66, 59,157,163, 7,125,124,167, 75, 91, 77,176,243,154,118, 58,194, 89, 67,127,103,135, 32, 52, 66, 73,172,149,152,147,115,
-154,241,132,106, 50,165,211, 45,201, 11,205,213,101, 69,107, 12, 50, 68, 94,136,105, 90, 70,247,143,184,184,255, 14,251,183, 15,
-184,249,194,183,196, 92, 11, 27, 7, 36, 95,205, 9, 66,163, 85, 65,152, 55, 60,124,229,229,216, 36, 6, 73,174,114,130, 16,201,
-172, 40, 26, 65,233,162, 64,101, 89,204,122, 79,221,191, 86, 10,155,220, 27, 27, 31,232,244, 59,113,144,207,116,140,167,109,154,
-168,212,233,118, 40,183, 59,241,253,183,142,249,188,166,109, 91, 76,235,176,222, 66, 99, 8,182,229,219,155,135, 84,173,227,179,
-245, 45, 6, 58,163, 51,216,224,114, 90,211,205, 36,211,203, 10, 25, 28,184, 57, 71,103,130,186,177,116,138,140,241,164, 6,198,
- 84,173,231,253,239,253, 16,255,236,151,126,150,103,111, 29,114,176,115, 64, 89,150, 92,109,221,224, 23, 31, 31,242,100,126,135,
-236,184,207,238,102, 96,179, 12, 8, 83,243,224, 98,194, 43,223,248, 60,166,109,120, 98,123, 64,167,200,233,118, 51,182,186,154,
-201,220,176, 29, 26,102,115, 75, 71,180,228, 69, 78,145,199,247, 68, 11, 71, 47,203,145, 62,112,245,246, 91,139,203,188,146,121,
- 2,229, 98,253, 35, 21,255,195,239,253, 43,254,167,255,224, 63, 38,208,242,226,107,143,232,116,114,250, 61,197,229,252,138,173,
- 94,159,253,222,128,105,235,201,181, 36, 71,209,214, 87, 60, 28,143, 56,154, 94,177, 83,246,184,178, 83,158,232,239,129,112,228,
- 37, 84,179, 72, 64, 22, 65,177,153,109,161, 37,116,178,140,185,117,148,185,160, 54, 45,239,140,170,232, 45,208,198,117,130,105,
- 51,206,154, 17,215,203,125, 90,215, 50,119,211, 72, 34,207,187, 12,186, 30,211,102,140,219,154,190, 46,121,245,252, 46,183,135,
-183,209,125, 41,209, 58,178,197, 99, 46, 53,116, 4,236,164,213,219,118, 71, 33,213, 74,132, 42,114,150, 7,237,226, 81, 95,218,
- 62, 38, 50, 78,112,129,189,142,230,210, 56,180, 86,120, 31,208,105, 26, 13, 82, 70, 72,207,248,248, 48, 38, 66,155, 84, 17,226,
- 21,153, 88, 74,200,130,141,240, 72, 55, 8,188, 76,196, 25,177,154,216,102,201,226, 80, 39,109,130, 15, 43,194, 14,169,251,118,
-107,147,235,162,174,249, 53,147, 14, 31,224,154, 74,114, 61, 9, 3,224,106,173, 22,185,197, 68, 34,120,215,148,171, 82,195,160,
-196,154, 41,135,120,215,249,196,158,134,108,113, 82,136, 88,208,209,139,221,188,160, 14,129,209, 34,234, 50,201,145,220,114, 55,
- 30,101, 52,138,200,198, 95,188,110, 23, 2, 22,104,130,227, 82, 74, 38, 62,238,200,109,154,170,220,218,129,236,150,147,187, 95,
- 57,255, 37,184,219, 5, 16,193,243,219,227, 8,187,103, 66,166, 34,183, 40,200,126,117,200,177,144,232, 37,170,160, 15,120, 25,
-213, 5, 46,188,155, 24, 72, 88,241, 45,132, 88, 43,240,225, 47, 14,234,136,248,243, 60, 95,104, 30, 58,143,242,145,125,174, 36,
-252,163,169,120, 23,251,241, 93,205,131, 76,171, 1, 17,200,133,160, 43, 5, 27,210,211, 63,184, 78, 83,199, 28,108, 18,251,221,
-170,200, 14, 11, 22, 50, 29, 95,139, 74,100, 62,149,224, 87,145, 18,239,188, 15,184,214,161,114, 69, 61,139, 25,243,198,120, 54,
-138,104,244, 16,106, 65, 71,148,220,159,107,254,122,103,138,183, 30,103, 98,213,114, 46, 48, 5,106, 99, 49, 78,112,109,184,201,
-217,116, 70, 95, 88,178, 82,211, 24,139,198, 51,119,142,169,133, 50,211,244, 50,133, 8,138, 39,118, 15,120,127, 87,242,187, 95,
-254, 52, 71, 87,231, 60,185,183,205, 43,199, 23,220,220,221,162,151,247,184,109,142, 56,185,255,214,242,190,115, 54, 65, 25,137,
-101,110,213, 2, 98, 95,113, 70, 2,145,229, 46,214, 76, 97, 16, 33,238,184,191,137,209,238,237,106, 98,119,126,245,156,136,176,
- 38, 85, 19,188,139, 49,172, 82, 14,251, 98, 21,135, 88,217,190,146,246,230,173,143,164,214,197, 16,224, 21, 72, 23,215, 32,248,
- 5,244, 30,150, 4,187,133,198, 40, 36, 70,190, 82, 2,183, 16, 68, 36,246,121,121,243, 5,234,211, 7, 52,147, 41,190, 26, 49,
- 31,205, 16, 50,167,157, 77,120,237, 79,190, 68, 46, 21,218,182, 24,187,138,112, 21, 34,222,187, 38,153, 34, 57, 23,207,155,133,
- 34, 96,209,224, 44, 59, 0,201,146, 92,184,104, 90, 50,169,232,109, 13, 24,220,222, 71,119,182,153,142, 42,130, 44,200,202, 62,
-147,147, 99,108, 85, 71, 31, 8,235, 48,147, 43,218,218,145,247, 58,120,227, 17, 82,114,254,230, 93,170,218, 98,188,160, 54,129,
-147,199, 87, 52, 77, 67, 89,230,224, 2,181,247,248,218,208,154, 11,198, 87, 51,242, 94,151,171,199,103, 60,249,193,111,167,157,
- 77, 8,120,100, 94,160,140,195,204, 44,170, 23,213, 47, 66,101,188,243,224,140, 94,167,196, 89, 67,150,231,168,162, 64, 40,133,
-206,114,116,166, 17, 82,208,214,113,114,247,214, 51,183, 49, 53, 82, 41,133, 12, 30,156, 71,169,156,174,206,176,210,147, 17, 48,
-206,225,154, 26,188,141,118,197,173,193, 88, 7,214,146,203, 64,158, 73,240,130,198,198,247,104, 83, 5,190,215,158,240,175,231,
- 61,116, 53,162, 95,118,153, 54,129,129,132,166,246,156,204, 90,164, 56, 38, 47, 11,166,162,160,169, 43, 58,101,201,213,249, 37,
-175,189,250, 85,180,178,244,135,215,120,226,230, 1, 94,245,217,217,220, 97,115,119,200,238,160,160, 55, 40,217, 24, 20,216,214,
-112,121,113,201,221,215, 95,231,106,124, 65, 55, 87, 24, 23,184,177,213,101,160, 37,133, 10, 80, 40,122,101, 78,235, 26, 10, 93,
-226,189,197, 25, 65,167, 8,200,160,112,206,208, 17,112,250,202, 75,203,251,219, 39,194, 84, 88,205, 16,200, 96, 57,116,129, 95,
-249,252,167,248,240,193, 83,116, 50,205,233,213,140,202,214, 92,223,216,228,149,199, 15, 48,210, 35,131, 96,187, 51,224,178,169,
-233, 42,141, 18,138, 76,100, 92,204, 27,186, 34,227,180, 30,225,103,240,236,254, 6,247,235, 43,158,222,223,196,187,156,171,153,
-225,241,252,132,157,124, 7,227, 13,213, 60,112,222,142,217, 80, 61,114, 33,105,105, 80, 30, 92, 80,248, 0, 15,171, 99, 10, 93,
-178,171,186, 24, 44, 33, 24,198, 51, 29,165,222,210,160,181,166,173, 29,133, 46,208, 74, 8,138,110, 12, 8,201,100,172, 74,123,
- 1, 74,160,219, 85,104, 29, 61,138,157, 15,201,224, 36,185, 40,166, 73,200,167,100,178, 16, 2, 34, 75, 85, 48,139,133,231,154,
-241,220,175, 29,123,185,100,160,227, 54,212, 37, 29,115, 80,130, 66,197, 98, 49,151,208,211,177,160, 71,134,229, 34,230, 81, 80,
- 38, 88, 88, 38, 73,154, 74, 91,118,235, 2, 23, 62, 78,105, 65,164, 50,180,176, 66, 93,236,153, 5,100, 62, 70, 58,134,176, 34,
-249,132, 53,153,219,117, 17,215, 5,119,100, 60, 35, 75, 96,206,154,215,117, 82,191,248,181,194,229,215,135, 77,193,242, 80,123,
- 23,178, 44,226, 36,184,173, 86,132,162, 40,171,142,220, 4, 1, 12,145, 56,235, 35,132,157,166, 29,189, 44,120,171, 5,253,126,
- 38, 41,196,170, 72,223, 55,158, 2, 24,136,176,160,190, 39,118,255,202, 10,212,167, 41, 37, 36, 50,163, 88, 35, 52, 19, 60,153,
- 0, 37, 2, 61, 9, 83, 15, 51,239, 25, 35,105,188,164,101,221,166, 59, 94,227, 32, 98, 86,115,176,129, 38,217,127,213,118,117,
-237, 23, 69, 65, 39, 25,205,194,106, 84,165, 93,164, 18, 98, 29,117, 95,254,185,147,101,108,217,134,119,128,115, 11,207,222,216,
-161,215,235,178,249,202,125,174, 88, 5,113, 47,118,250, 75, 11,218,228, 77,239,131,167,113,112, 48,136, 9, 83,166,169, 17,198,
-162, 50,137, 49,142,188,147,199, 24,211, 69,103, 38, 33,182, 75, 50,106,217,165, 79, 50,170,120, 95,197,181, 76,100, 91, 23, 89,
-100, 10,207,109, 19, 39, 89,231,184, 52,142,241,172,230, 37, 15, 31,187,117,157,199,143, 31, 17,108,196, 62, 46, 29, 24,231,216,
-234, 12,217,216, 56,224, 39, 15, 79, 49,231,199,220,147,134,111,228, 37,149,208,108,117, 61,181,181,104,239,169,154,150, 78,166,
-248,107,246, 62,159,127,241,130, 55,155,156,255,228,137, 3,182, 38,143,121,179,204,152,207, 27,126,236, 47,253, 0,231,127,242,
-171,113,255, 47,214,211, 17,215,200,108, 54,221,131,110, 37,193, 90,176,216, 69, 88,101,161, 47, 32,236, 4, 94, 69,158,193,194,
-175, 96,109,106, 89, 44,205,215, 63,180, 14,201,171,116, 47, 6,151,158,163,196,121, 16,201,116,198,165,103, 46,194,243, 17, 89,
-241,196,130,238, 83, 83,216, 59,220, 69,231, 25,118, 58, 79,246,180, 13,205,168,138,104, 65,234,152, 77, 72,134,127,139,181,130,
- 11, 84, 15, 95,165, 61, 31, 96,170,154,234,114,130,173, 5,217,214, 46,103,111,191, 69,153,133,200,171,104, 99, 78,128, 79,197,
-220, 17,121, 61, 74,129,113, 43,222,202, 98,213, 44, 18,187, 95,234,116, 47,219,119, 63,203,101,167, 32,223,232,210,125,242, 26,
- 74,247, 48,173,199,180, 45,205,249, 49,151, 87, 83, 66,240,168,142,102,118, 50,166, 40, 51,108,144,216,121,203,252,236, 60,170,
- 66,148, 34,203, 37,186, 17, 88, 31,144,214, 81,185,154,170,118, 84, 6, 58,165,198, 27, 79, 43, 28,194, 6,230,115,131,156,205,
- 48, 62,112,247,139,159,231,246, 7,191,141,230,234,108,213,236,183, 83,212, 96,131, 91,207, 63,143,175,103,188,239,217, 91,188,
-125,255,113, 12,228,113,150,224, 44, 58,228, 72, 37, 9, 38, 62,255, 4, 79, 38, 5,178,147,163, 27,104,155, 54, 54,251, 2,242,
- 60,134,129,204,171,138, 44,207,200,181,140,196, 68,107, 49,243,121,108,190,211,126, 51, 16,112,198,162,172, 37, 83, 50, 54, 19,
- 4,108, 11, 7,205,148,131,225, 53, 94, 63, 59,231,120, 52,163,208, 18,107, 27,202, 60,231,178,106, 8,120,148,202,104,155, 64,
-183,215,103, 58, 25, 83,246, 55,233,150,154, 39,110, 60,201,176,200, 16, 89,201, 70, 87,179,181, 57, 96,103,208,199,121,207,181,
-237,130,170,106,184, 58,189,160,174,103,124,254,207,191,128, 20, 22, 33, 50,158,216,223,100,163,215,163, 83, 40, 10, 1,181,115,
-140, 70, 99,246,119,247,168,230,134, 92, 7, 6, 3,137,177,208, 31, 10, 76,211,160,189,164,190, 56, 79,207, 73,248, 11,104,227,
- 2,150,127,166, 80,252,236,215, 94,199, 30,156,242,220, 51, 31,224,254,213, 21,219,221, 62, 71,211, 49, 83, 63,143, 54,210, 50,
-227,193,244,156,221,206,128,105,219,226, 66,195, 65,111, 72, 38, 36,162,145, 84,173,199,227,121,227,116,196,118, 89,112,116, 49,
-165, 9, 48, 53, 19,114, 89, 50, 55,177,238, 58,239,232,169,130,110,174,240,161,225,250,176,207,253,171, 43, 14, 58, 27, 76,140,
- 96,183,236,211, 58,195,105, 51,102, 35,235, 96,189,163,114, 13,224, 41,117,135,163,201,132, 59,189,155,156, 77, 79,209, 66, 73,
- 36, 30,239,227,133, 20,192, 80,130, 46, 2, 42,207,210, 62,149, 36,191, 73, 18, 37, 18, 75, 53, 72,100, 18,185,106, 82,193, 79,
-190,201,185, 10,168, 0,109,235,208, 33,112,209,196,135,106, 43,147,203,112, 13, 43,225, 97,229,105,129,107,221,148, 17, 14,204,
-109,160,117,129, 78,218,137,231, 11,218,121,234,248, 33,164, 67, 67, 80,170,164,149,231,155,138,198, 98,130, 94,176,117, 19, 82,
- 64, 90, 43,108,175,177,217, 93,218,217,147,208,137,124, 45, 10,210,125, 83, 33, 95, 35,197, 46,235,174, 23,235,138, 0,177,252,
-222, 66, 64, 41, 23,123,246, 21,227, 56,136,213,174,251,118, 38,185,112,129,145, 91, 59, 68,197,218,201,156, 14,208, 92,197,239,
-251,216,120,242,149,111,203, 95,128,180,195, 10,108,127,183,188, 78,132,245,243,122, 89, 28, 14,181,224,145,137, 16,238, 16,159,
-166,175,213, 78,209,173, 53, 11,126, 97, 32, 20, 64, 90,203,166,142,239,107,235, 69, 28, 26, 69, 76,148,107, 67,160,151,171, 40,
-209, 91, 54, 25, 43,116,214, 47, 28,225,132, 96,232, 12,119, 61,244, 5, 12,180,224,235,143,206,241,156, 51,148,113, 77,209, 44,
-147, 64, 23,177,160,105,122, 74,126,227, 33,192,200, 5, 74,103,153,207, 42,230,117, 77, 46, 65,185,168,139, 23,198, 32, 92,160,
- 37,160, 22,214,176, 65, 32,164, 95,131, 90,211,222, 52, 77,102,193, 5,140,181,140,172, 89,194,199,193,195,133,129,243,201,148,
-231, 51,201,221,185, 96,187,114, 84,109, 65,199, 86, 4, 60, 67,233, 24,234, 28, 91, 85,252,157,239,185,206,221,223,253, 42, 65,
-192, 46,115,190, 79,206,147,109,176, 64,139, 72,226,147,189,248,134,188,113, 58,227,211,166,228,135,191,237, 35,220,124,227,143,
-112, 33,240, 67,157,192,111, 86, 5, 63,244, 29, 7,252,217, 23,166, 17,202, 94, 76,180,235, 38,111, 97, 61,169, 52, 54, 95,146,
- 85, 7, 40,146,140,107,185, 3, 15, 43, 20,197,248,149, 61, 43, 98,165, 17, 95,185, 21,164,123,210,177,230,178,152, 34,192,195,
-162,136,135,229,115,183,244,177, 72,198, 51, 34,164,231,197, 65,247,218, 30,239,253,225, 31,164, 79, 1, 23, 21, 15, 94,122,141,
- 60,147, 12,158, 30,128,214, 84,179, 57,221,142,224,236,193, 93, 46, 31,159,208, 78, 12,222,212,216,228,100,233,108,226,165,104,
- 73,123, 53,198, 25, 75,211, 88,218,170,101, 30, 78, 17,193, 50,154, 57, 94,232, 26,218,214,167,115, 40, 34, 73, 33,169, 77,188,
- 18,120, 27, 77,109,124,146, 46,170, 44,157, 91, 2,108,106,156, 22,176,132, 20, 18,149, 73,188, 9, 20,123, 67,220,220, 96,154,
- 11,234,121,131,187,156,112,213, 18, 59, 35, 27, 48,211, 8,245, 74,225,113,181, 33, 24,143,171, 90,124, 8,152, 54,166,160, 21,
- 58,238,239, 91, 39,208, 54,202,201,140,177, 92,153, 64,175,140,254, 5, 42,211, 17,255, 76,215,239,232,245,183,233,111,111,210,
-219,220,194,155,232, 37,111,173,161,158, 92, 98,102, 19,106,233,216,222, 30,240,232,100,132, 76, 54,159, 58,207,163, 89,146, 15,
- 4, 31,221, 31, 89,200, 86,173,139, 33, 69,153, 78, 67,142, 32, 56,139,144,138, 76,128, 8,113, 95, 95,230, 25, 94, 73,140,146,
-180, 54,126, 12, 17,163, 96,109, 8,132,224, 32,165,191, 57, 31,243, 45,166,206,243, 49,115,206, 85,111, 19,213,233,210,180,150,
-211,171, 11,202,204,179,191,127,141,203,139, 17,103,163, 43,118,134, 27, 49,204,138,192,110, 71,114,251,214, 62,111, 61, 28, 33,
- 16,244,105,216,218,221,100,119,152,163, 51,193,198, 70, 78, 64, 48,159,141, 57, 57,123,204,235,111, 63,224,205,187, 95, 39,215,
-146,253,237, 1,253,162,160, 87, 40, 10,145,188, 16, 16,116,242,156, 73,213, 34,116, 96, 80,150,212, 77, 75, 89,102, 52,181,101,
-123, 16,120,248,133, 47, 47,167, 58,181,230,111,194, 55,197,254, 62, 52, 25, 27,210,242, 65,127,130,122,252, 18,221,124,151,227,
-217, 37, 51,107,217, 46, 75,206,234, 57,133, 2,139,227,120,118,129, 72, 3,219,189, 81,195, 97,183, 79, 99, 44,141, 55,236,150,
- 67,164,116,244, 10, 73,238, 60,178,118, 52, 72,172,247,244, 51,207,227,122,194,173,254,144,185,209, 92,212,147,104, 86,244,184,
-198,225,105,236,152, 39, 55,187,188, 51,174,200,181, 98, 39,235,112, 94, 27,246,122,158,204,106,206,231,115,198,102,204,115, 27,
- 79,130, 52, 56,147,161, 75,173,146, 93,163,164,212,241,103, 45, 5,200, 66, 46,201, 4,121, 90, 46,123, 31, 25,199, 98, 1,237,
- 41,129, 20, 49, 70, 84, 10, 17, 11,124,122,119,180, 18,104, 47,185, 97, 3,141, 15,108,132, 40, 3,115, 6,138,168,168, 71, 10,
-197,117, 7,119,141,103,236, 98,151, 93,183,158,214,194, 36,113,125,186, 33,254, 33,147,209,250, 83, 47,164, 73,110,181,183,206,
- 20,108,166,165,157, 77,159,103, 67, 44,222,101, 4, 14,222, 85, 88,236,218, 84,191,128, 91,220,154, 6, 63, 91,131,123,213, 74,
-197,178,202,251, 78,223,247,250, 58,148,191,174,120, 89, 52, 0,196,104,218,176, 56,108,215,216,229,122, 77, 30,120,144,252,206,
-155, 5, 47,104, 65,128, 74,200, 73, 41,160, 35, 99,151,239, 72,232,196,250,129,190, 86,221, 23,210, 34,191, 38, 75, 82,146,101,
-210, 90, 88,179,252, 68, 64,145, 94, 87,177, 86,223, 22, 92,132, 44,253,124,198,191,251,103,103,141, 91,224, 60,148,139, 34, 16,
- 2,219,105, 83,227,157, 67,126,211, 10,125, 97, 47, 42,101, 4, 24, 50, 34,105,112, 32, 97, 83,197,195,226,154,142, 13,228, 61,
- 39,208, 30, 42, 4,115, 31, 8, 66,190,203,158, 52, 19, 17,243,168, 93,224, 35,157,156,174, 15,204,198, 85,100,128,203,216, 48,
-102, 73, 35, 43,147, 92, 41,184,200,134,150,233,162,122,239, 81, 8, 12, 16,132,199,250, 40,123,180,206,209, 18, 39,219, 54, 73,
-190, 76,128,199,117, 96,183,147, 83, 58,203,110,174, 25,141,167,124,228,201, 67, 94,190,184,228,238,195, 19, 4,158, 15,247, 52,
-159,169,227,162,230, 75,243,136, 2, 12, 4, 20, 58,170, 53, 22, 13,167,146,160, 17, 84, 33,112, 95,246,200,167, 21,127,239,125,
- 55,249, 79,191, 36, 40,139,146,235,193, 99,235, 9,213,212, 83,249, 2, 53,159,163,242,184,134, 89,152, 24,137,181,155, 64,138,
-133,254, 58, 21,215,164, 70, 17,169, 57, 12, 73, 43, 46,215,186,128,144,136,150, 98,225, 44,183, 38,137, 36,196,176,149,224, 23,
-118,175,107,100,146,133, 66, 98,193, 37, 72,215,150,165, 47,124,242, 18, 72, 68,205,167,126,240,251,121,246,123,191, 11,127,239,
-140,179,151, 95,225,236,232, 33,183,159,122,130,118, 84,113,254,232,138,121,219, 98,125, 67, 61,245,168,162,164,183,243, 52, 59,
- 55, 21,157,204, 50, 58,122, 76,101, 26,182,158,187,129,111,231,228,210,227, 70, 35,174,170,138,171,177,193,169,130, 48,185,207,
-217,253, 75,202, 92,147,203,200, 81,113, 73, 13, 32,149, 88,122, 54,200, 54,173,100, 44,232,100, 93,103,140, 64,138,176, 36,236,
- 45,238,253,120,175, 69,212, 70, 15, 10,218,139, 41,162,231,176,151,115,194,184,102,148,235,200,230,119, 62,186, 30,214, 30,103,
- 28, 34,143,238,134, 82, 6,204,188, 69, 21,139,208,121,143, 80, 80, 32,216, 20,112, 62,141, 67,143,129,104, 32, 83,187,165,225,
-138, 22, 2,167, 36,185,240, 92, 94, 76, 80, 82, 97,235, 58,146, 9,171, 25,190,153, 51, 25,143,217,216,221,103,252,224, 30,215,
-110,246, 49,243, 22,145,103,132, 16,162,132, 45,249, 78, 56,103, 81, 82,160,148, 70,107, 65, 99, 60,214,216,200, 77,209,146, 76,
-197,220, 9,145, 72,148,193,185,152,195,110,160,113, 22,219,218,116,157, 93, 92, 47, 56,135,118, 22, 91, 27,108,221,196,124, 3,
-107,144,214,160, 2,236, 95, 30,179,119,243, 58,111, 60, 58,103,115,216,165, 16,146,110,222,229,226,252,140,157,205,109,246,182,
- 54,152,205,198, 24,211,112,253,240, 16, 31, 60,199, 23,115,182,134, 93, 6,221,130,214, 4, 38, 85, 67,118, 49,226,206,173, 13,
-132, 7, 51,155,114,245,248,136,251,143,142,120,235,157, 55,208, 50,160,148,166, 40, 58, 12, 74, 77,169,161,173, 13, 6,168, 91,
- 75, 85, 77,168,188,227,112,187,131,242,146,128, 66,187, 64,183, 20,132, 22,134,201,104,203,175, 41,135,214, 61, 88, 22,176,188,
- 1,190,175, 23,201,225,246,242, 33,207,248, 99,142,175,189,143, 87, 79, 47,105, 93,131, 35,112, 58, 31, 49,200,122,140, 77,195,
- 48, 47,144, 8,186, 82,115, 81,207,145, 66,208,248,134,113, 59, 35, 19,240,206,228,130, 92, 9,106, 99, 25,230, 61,206,154,115,
-182,203,109, 6, 42,227,181,209, 57,187, 89,135, 76, 74,174,204,156,141,162,160, 35, 74, 38,198,240,133,147,199, 60, 59,220,228,
-104, 54, 99,220,214,145,236,237, 50,250, 89,193, 65, 55,231,237,201,132,147,234,138,146,146,143,188,255,105,116, 46, 5,153,210,
-160, 45,185, 16,108,138,120,179,105, 37, 17, 42, 90,114, 70,167, 37,159,164, 50, 9,102,149, 17, 87,246,248, 20,215,185, 80, 15,
-199, 3, 29, 41,144, 90, 35,115,129,180,142, 34, 4, 10,226, 52, 20, 18,139,212, 7, 24,148,146,231, 20,212,141, 79,211,161,160,
- 77,123,176,121, 8, 24, 4, 61, 29,187,253,220, 36,182,178,143, 7,229,183, 46, 18,177, 0,175,210,225,189,134,237, 46,229,111,
-139,125,123, 88, 48,162,197,170, 48, 45,162, 41,211,191,105,129, 78, 88, 21,174,197,116,233,210, 86,218,133,192, 32,192, 38, 96,
- 82,220,235,138,124,182,130, 39,197, 66, 98,181,248,158, 11,178, 79, 8,209, 11,126, 77,134,230, 67, 36,225, 45, 86, 27,141, 32,
-238,103, 89,105,204, 59, 18, 38, 30,138,133,214, 94, 44,226, 67, 87,135,180, 95, 67, 31,252, 90, 1, 89, 52, 17, 36, 23,172,197,
- 73, 62, 84,130, 34,177,242,181, 88,241, 13, 22, 48,239,194,183,123,241,119,118,237,198,215, 50, 34, 26, 83,191,118,214, 47,216,
-194,172,136, 81, 98,237, 65, 81, 98, 69, 62, 92, 20, 1,149, 10,102,103,177,251, 20, 17,186,223, 20,145,135, 33, 69, 12,222, 80,
-184,212,108, 9, 50,153, 94,179,138, 15,156, 14, 13, 15,141,224,102,202,241,214,106,105, 76, 28, 77, 86,164, 72,150,167,177,234,
- 36, 5,124,186,127, 19,210,147,236,108,103, 62,174,135, 92, 16,204,147,171, 96, 99, 61,173, 3,139, 68, 57,199,101,227, 9,214,
-208, 76, 90,154,195, 93,178,202,242, 86, 19,155,183,188,173,176, 65,243,233, 63,248, 44,103, 13,144,101,220,218,238,112,247,114,
-188, 36, 58,106, 17, 40,100, 44, 38,189, 76,179,239, 45,243, 82,242,183,255,201, 47,114,123,163,195,157,205,130,211,179, 41,127,
-251,153,235,252,222,151, 94,225,147,255,225,143,243,185,127,250,115,232,164, 14, 81, 62,229,154, 39, 79,245,104,235, 27, 93, 22,
-189, 17, 75,249,154, 16,160, 85,186, 23,146,135,187, 75,234, 0, 17, 86,156,137, 32,226,123,176,152,214,109,154,180, 23,251,117,
-193,202,117,110, 9, 81,250,119, 7, 54, 46,217,247,132,212, 20, 8,130,148, 60,247, 3,127,141,247,124,242,227, 52,175,223,231,
-232,165, 87,113,237,152,247,126,232,131, 28,189,122,151,217,172,198,249,216,104,217,185, 36,224,104,218, 54,106,174, 31, 91,218,
-198,160, 50,133,247, 37, 15, 62,119,140,192, 32, 59,224, 56,229,246,173, 46,173,151,180,102,142,153, 27, 64,208,203, 52,182,154,
- 97, 23,158,241, 10, 76,136, 3,198,226, 30,180, 33,170,117,204,226,172, 10,158, 32,227,123,182, 8,168,145, 42,224,124,188, 62,
-193,122, 52,208, 86, 6,115, 57, 39, 76, 91, 68, 39,163,177, 49, 32, 40, 32, 9,173,101, 60, 54,177, 72,166,251, 85,166,104, 83,
-146,250,197, 25, 31, 9,201, 2, 10, 9,155,101, 12, 56,178,134, 8,223, 35,176, 38,146, 26,149, 86,100,104, 92,128,249,188,101,
-122,114,204,206,157,167,240,117, 69,104, 13,222, 70, 75, 92,223,206,200,178,156,141,219, 7,132,224,201, 18,135,192, 59, 23,101,
-119,153,198, 11,141,144,209, 67, 62,248, 64,161,117,204, 71, 15,145,168, 44, 4, 56, 99,113,174,198, 59, 79,240, 46,134, 46,153,
-184,192, 51, 62, 25, 24, 37, 47,138, 96, 45, 77,107, 16,182, 69,123,143, 78, 46,116,145,247, 16, 21, 69, 7,221,156,163,110,159,
- 60,239,114,125,127,131,163,139, 43,138,172, 67,219, 26,124, 16,116, 7,155, 81,249,208,214, 60,121,253, 0,131, 39, 56, 79,142,
-228,218, 94,151,186,105, 40,115,197,233,197,152, 15,221,186,201,171, 95,255, 6, 95,123,243,109, 38,213,156,203,203,139,255,167,
-173, 55,139,185, 44,187,238,251,126,107,239,115,238,248,205, 53,116,117,117, 85, 15,100,179, 73,118, 55, 77, 82, 34, 41, 41,178,
-131,200,130,109,129,146,163, 56,182, 3, 25,201,147,135,228,197, 48,242, 22,192, 72, 0, 7, 1,132, 32, 49, 2, 56, 64, 28, 32,
- 72, 30, 98, 32, 49, 2,200,177,149, 4,142,141,216,134, 45, 89,110,137, 18,217, 20,155,100, 15, 98,143,213,213, 93,227, 55,223,
-233,156,179,247,202,195, 94,251,156,125,139,124,104, 84, 87,213, 87,223,119,239,185,231,236,181,214,127,253, 7, 14,231,187,116,
- 26,120,238,104,135,219, 71,187,104,215,177,220, 4,156, 19,150,235, 14, 46, 58,246, 14,106, 38,147, 9, 49, 68,246,167, 98,195,
- 7,220,251,225,219,252,193,127,243, 63,243,205,191,253, 55,249, 39,255,229,175,167,192,163, 98, 64,138,197,217,244, 83,163,205,
- 64,182, 38,125, 78,111,253,232, 77,100,247,144,143,214, 45, 87,198, 19,162, 84,156,183,151, 92,159,205,232, 66,228,162, 93,114,
- 28, 34,179,106,204, 65, 61,161,139,129,203,110,133, 23,101,175, 26, 83,185,228,163, 33,210,114,173,218,227,147,203, 53,141, 54,
- 84,226,120,220, 94,226,196,179, 91,141, 56, 91,109, 88, 85, 45,179,202,161,109,224,120,179,230, 11,215,102,188,123,188,164,211,
-196,205,136, 90,243,193,249,130,219,243,107, 28,238,120,174,237, 79,248, 23,223,121, 29,255,231,110,238,254,173,122, 84,209, 68,
- 88, 57,225,138,115, 76,156,163, 26, 85, 84,163,202, 44, 27,197,220,147,132,202, 37,199, 20,231,147,247,119,134,124,162, 40, 77,
-163, 44,219,200,163, 54,242,168, 9, 92,116,202,152, 68,168,242, 62, 77,217,181,145,147,215,109,228, 34, 40, 77,167,108, 52,185,
- 70,101,220,186,114,208,138,244,186,240,206, 58,232,214,165, 52,174, 25,233,215,220,100,120, 43, 4,206,100, 23, 94,172, 91,182,
-137,200, 27, 27, 29,151, 38,126,231,210,164, 39,217,196,198, 68,228, 42,194,169,133,153, 56,251,254, 25, 13,200, 73,179,207, 10,
-236,219,255,143,140,116, 86,219,215,213, 38,233,170,141,145,157, 53,216,117,126, 93,164,235,231,114,145,179,194, 88,219,251,168,
-237,245, 76,132,212, 56, 56,225, 80,132, 25, 32, 81, 88, 2,141, 57, 92,121,187, 62,158,244, 51,188, 8,222,165, 34,231,179,110,
- 59,191, 6, 25, 20, 1,206,246,210, 94,132, 93,148, 77,110,162,160,176,225, 77,135, 82, 38,145,251,226, 90,229,239, 55, 23,216,
-119,176,206, 42,136,126,122, 30,254,171, 25,190, 62,255,157, 55, 15,126, 95,188,166,218,193, 85,159,175,181, 41, 47,236,123,123,
-179,139,201,159, 91,122,159,246, 30,237, 26,140,236,253, 95,153, 56,155, 94,205,124,199, 73,111,206,211, 7,212,152,190,189, 39,
-125,149,146, 44, 10,199, 51,107,102,132, 20, 48,227, 17, 38,192,101, 80, 26,187, 79, 87, 33,112,222,116,212, 18, 57, 95,111,112,
-154,246,234, 51, 34, 63,183, 83,241,149, 43, 19, 94, 26, 9,135, 26,113,251, 59,188,113,186,228, 52, 42,199, 1, 30,117,202, 73,
- 80, 46, 58,225,221, 85,219,187,158,213, 40, 85,219,161, 65,121,247,124,201,111,191,243, 46,223,122,237,117,254,189, 63,254, 53,
- 62,190,123, 55,145, 37,227, 16,206,226,116,104,154, 84,123, 70, 92,223, 76,133,194,109, 49,147,222,138, 75, 49, 68,172,250,237,
-130,157,253,222,123,254,137,234,214, 90, 38,146, 38, 98,223, 55,127,153, 92, 50,104, 40,174,188,244, 10,175,252,165, 95, 69,239,
- 62,228,222,219,239,178,124,252, 41, 47,254,252,207,243,201,155,239,177, 88,175, 18,148, 27, 35,109,215, 17,124,164, 89,182,104,
- 5, 93, 27,104,218, 64, 27, 35,171, 77,203, 58, 68,214, 33,176,136,202,170,141,108, 52, 57,226,197,174,193, 35,136,175, 56,189,
-104, 57, 91,118, 28,152, 47,123,206,166,240,214, 64,187, 30, 25,147, 94,217,145,237,134,123, 3,159,252,222,123,132, 34,217, 61,
-199, 38, 33, 46,235,211, 85, 82, 19,120, 79, 23, 52, 73,225, 90,101,121,154,140, 95, 66, 84,166,117,122, 14,157, 36, 2, 98, 66,
- 51, 5,109,181, 95, 89,120,159, 26,177, 90, 32, 57, 35,155, 61,175,106,242, 53,176, 11, 93,143, 42, 54,155,200,201,189,135,236,
- 77,149,233,238, 30,205,201, 35,218,203, 51,206, 31, 62, 76,170, 6, 25,113,245,198, 30,159,188,247, 9,203, 77,135,160,172, 55,
- 9,114, 79, 71,106,178,112, 86, 43,206,196,180,154,112, 81, 9, 49, 32, 81, 83,131,103,156, 41, 98,164,109, 59, 98, 8,196, 16,
-240,161,163,234, 26,170, 60,141,183, 13,210,181,248, 16,241, 49, 38,159,245,216, 81,199,212, 16,136, 8,254,224,136, 79,163,227,
-188, 13,180,102,145,188,110,215, 84,126,204,200, 41,171, 54,240,217, 27, 87,145,218,211, 52, 29,243, 81,141,119,194,184,114,108,
- 90,165,219, 52, 76,198, 35,118,230, 59,108, 46,206,249,206,155,111,243,201,131, 99, 86,151,231,124,122,255, 19, 86,235,199,188,
-252,252,109,254,216,173,171, 60,117,184,203,166,105, 8, 33, 16,186,196, 81,152,212, 35,110, 94,221,199, 73,100, 50,174, 80, 51,
- 74,185, 58,134,255,246,111,252, 58,237,164,226,217,143,238,240,226,207,125,157, 59,127,244,110, 79,240,237,213, 66,118, 27, 79,
- 93,100,110, 75,165,160,233,172, 60,211,138, 95,190,253, 44,110,178,199,221,139, 51, 46, 99,195,211,211, 41,155,216,242,120,157,
-108, 99, 39,174,162,118, 85, 34,129, 91, 34,163, 71,184, 8, 27,206,154, 21,149, 8,119,150, 39, 92,198, 13, 99, 73,220,158,189,
-177,239,155,206,147,110,201, 78, 85,179,232, 90, 58, 85, 42, 28, 23,221,134,183, 78,206,104, 98,199,254,104,202,172, 74,233,157,
- 87,231,158, 24,106, 62,186, 56,197,109,166,124,243,231,190, 70,229,157, 80, 87, 21, 23, 46, 50, 22, 24,169,226, 39,224,146,199,
- 38,117, 45,125, 28,147,171, 60, 26, 34, 21, 41, 12,195, 87,142,208,164,182,184,217, 4, 84, 19,140,187,235, 93,234,131, 99,196,
-197, 68,213,242, 34, 84, 35,143, 88, 98,155, 56,199,153,166,253,235, 20,165,237,210, 9, 46, 81,169, 68,217, 15,137,153,186, 38,
-145, 52,162, 77,139, 23,166,231, 62, 32,145, 93, 84, 5,121,130,128, 85, 46,215, 51,220,172,113, 72,131,172, 34, 4, 55, 28, 80,
-173,194,210, 52,249,121,146, 82, 82,145,215,152, 38,157, 43, 2, 7, 58, 64,236,117,185,107, 87,251,189, 51, 6,127, 9,199,231,
-208, 27,147,199, 6, 85,106, 43,186,229, 10, 39,144, 31,110,237, 73,125,253,110,211,118,208, 71,214, 17, 95, 74, 54,130, 25,204,
- 83, 6, 61, 46,131,223,247,214,117, 72,175,113,215, 16, 18, 85,101,164,112,142, 14,235,134,188, 95,114, 3, 19, 58, 43, 8,170,
-252, 26,141, 71,116, 5, 88,199,180,130,208, 98,221,208,152, 59,221, 70,122, 85, 89,226, 97, 20,241,159, 94, 6,121,158,179,107,
-233,205,241, 79,101, 64, 58,110, 34,220,143, 22, 64, 99,187,226,202, 94, 67,239, 42,104,211, 70,101, 63,203, 85, 66,237, 92,255,
-185,103, 98,152, 56, 51, 15,201, 26,109,147, 53,132, 80, 42, 34,212,114,224,197,116,214,230, 9, 78, 98, 94,183,168,249,248, 39,
-121,231,129,131,139,243, 51,142, 73,107,140,214, 9,181,201, 19,127,243,209,130,167,108, 66,108, 84, 9, 44,184,110, 42,134,170,
- 48, 34,218,173,224,107, 7, 51, 70,149, 99, 26,225,116,221, 81, 79, 43, 22,151, 13,175,206, 42,166, 59, 99,252,166, 99, 18, 59,
-158,254,252,231,248,248,205,119,210, 94,219,165,239,211,230, 53, 73, 10, 36,237, 19,251, 50,161,208, 25,145, 49,216, 84,223,103,
-154, 27,195, 91,237,208,141,221,160, 93,247,174,200,161,239, 27, 31, 25,116,233,150, 64, 40, 36,175,137,158,124, 26, 51,251, 94,
-169,167, 51, 94,254,143,126, 25,150,107, 86,199,143, 88,159, 61,230,165, 63,249,117, 46, 62,190, 79, 39, 9,173, 10, 49, 49,178,
-131,198, 20, 12, 84, 57,218,182, 65, 5, 46,215,129, 46, 38,155,217,182, 11, 52, 17, 54,157, 50,157, 37,135,200, 7,199, 27,158,
-186, 86,247, 83,250,186,129,163,221, 49,122,188, 32,214,102, 93,108,145,187, 98,112,171,235, 17,178, 33,122, 55,102, 45,188,203,
-112,155,246,233,113, 93, 43,212, 68,212, 11,235,243, 53, 26, 83,194,141, 55, 78, 9, 10,109, 19, 9, 33, 57,174,197, 16,105,219,
-148,203, 46,153,132, 23, 6,242, 67, 14,197,113, 85,106, 45,188,131,253, 90, 57,219,164,193,194,197, 20,203,204,184,162,114,138,
-174,215,236,140,199,116,157,178, 57,191,224,220,125,146,252,223,215, 75, 30,126,112,159,201,222, 57,207, 63,123, 13,109,158,225,
-167, 63,127, 21, 89,195,120, 58,167, 81,229,237,143,238,114,190, 90,115,177, 8,136,171, 24,215, 85,207, 27, 9,109,151, 26, 11,
-151, 2,135,212, 38,116,231, 61, 94, 35, 83, 73, 40, 68,219, 54,104,211, 37,239,249,174, 35,134, 14, 66, 96,100,132,132,218,252,
- 43,208, 2, 25, 84,101,255,209, 93, 14, 14, 62,203, 97,229,185,243,120,201, 83, 71, 59, 52,205,148,211,213,154,123, 23, 13,211,
- 90,120,243,227, 79,248,202, 11, 55, 8,157,112,122,177,164,174,107,154,186, 99,226,132,229, 58,176,183,218,240,242,149, 67,254,
-249,107,191,203, 91, 31, 63, 74,171,151,208,129, 56, 70,117,205,171, 55, 15,185,125,117,135,177, 68, 98,215,177,110, 2,171, 54,
- 48,114,158,131,221, 57,203,213,138,221,201,148,102,181,161, 30, 9, 7, 71, 35,254,249,127,247, 63, 50,242,233,121,252,157, 15,
- 62, 97,242,195, 15,249,169,191,250, 23,248,131,191,255, 27, 61, 23,196,185, 65,241,164, 3, 39, 21, 47,194,158,139,252,204,164,
-101,245,240, 29, 70,251, 47, 37,217,159,119,188,123,121,154,126,110, 85,179, 8,129,153,119, 76, 70,201, 9,112, 19, 58, 38,190,
-226,113,187, 98, 44, 21, 83, 87, 83, 57,184, 49,222,195,139,208,198,150,139,208,178, 92,119,116, 26,168, 84,232, 52,210,106,139,
-119,202, 89,183,224,176,154,226, 17, 14, 76, 19,127,178, 89, 48,245, 53, 27, 85, 62, 92, 4,158,158,116, 92,153,142,121,239,242,
- 46, 95, 95,125,158,106, 50,173,146,235,152, 23,174, 3, 19,241,184,145,117,119, 57,166,201,129,243, 14, 49,108,214, 89, 90,131,
-118, 9, 54,161, 85,198,222, 89, 17,140,140, 85, 19,113,206,198,187,168,137,180,225, 67,242,175,214, 42,237,104,124, 20, 42, 36,
-121,143,123, 59, 84, 29,132, 32, 84, 30,198, 10,123,170,108, 72, 83, 42, 33, 21,188,181, 8, 39, 10, 87,205,200, 37,246,169, 11,
-153, 41,157,246, 82, 82,176, 30, 2,131, 12, 47,186,148, 74,149,189,172, 23,230,160, 54,137,106,187,245,129,116,119,213,193,216,
-220,214,122,137,143, 12, 80,123,236,137,109,105, 90,201,196,188,188,127,142, 5,196,158,209, 5, 74, 73,157, 29,150,254, 39, 16,
-218,120,130, 41,174,166, 76,184,170, 74,103, 86,155, 61, 35,223,224,237,153, 53, 6,174,216, 97,103,147,143,174,223,159,166, 98,
-224,141,233, 95,149, 18, 99, 63,164,111,229, 66,239,138,239,175, 2, 79,219,123,159,148,156, 3,155,204,235,226,250,120, 35, 42,
-230,213,196, 70,210,122,163,247,132, 47, 38,124, 45, 16, 11, 12,125,169,157,210, 70,225, 34,166,139,214, 23, 67,251,251,172, 59,
-207,187,208,140,172,100, 14, 67,229,156, 89,144, 70, 43, 94,105,159,222,134,228, 55,158, 59, 46, 49,235,216,188,162,201,127, 37,
- 26, 45,112, 33,221, 79, 25,125, 8, 36, 82, 95, 48,214,161, 24,215,164, 85,237, 13,112, 84,225, 60, 42, 83, 73,132,191, 85, 17,
-150,211, 35, 34,162, 44, 66,100,213, 6,150, 40,139, 0,159, 25, 59, 70,151, 27, 46, 98,228,131,243,134,151,214, 11,106, 47,124,
-235,245,215,137, 33,153, 26,229,224, 19, 87, 24,183, 84, 67, 47,102,190, 2, 58, 72, 17, 37, 21,111,188,105,175, 81, 92, 76, 82,
-199,172,180,200, 62, 11,217, 71, 62, 90, 31, 0, 0, 32, 0, 73, 68, 65, 84,124, 38,244, 69, 80,251,189,122, 63,196, 68, 16, 63,
-100, 40,244,123,249, 72,178, 93,117,138,212, 19, 70,235, 51, 88, 41,231,199,199,156,156, 94,194,244,144,229,250,152,150,192,170,
-217,176, 89, 53, 56, 21,186,208, 17, 66, 68, 93,250, 89,109,103,208, 57,202,178, 9, 61, 65,179,114, 46,117,206, 68,234, 74, 88,
- 44, 34,211, 73,197,102,221,178,142, 74, 19, 34, 58, 25,211, 53,107,124,149,190,151,183,247,158,154, 83,237,229,156,125,163, 25,
-139, 4, 58, 73,104, 71,236,178,243,162,237,218, 3,132, 16,136, 1,246, 38, 21,113,221,166,248, 98,132,118,221, 17, 84,240,146,
- 38,247,208, 69, 98,151, 10,166, 87, 69,187,100, 99,151,209,185, 96,200, 72,237, 29,161,237, 24,137,178, 83, 11,235, 46,210,137,
- 80,121, 77, 50,172,174, 98, 92,121, 66,179,198, 85,158,211,123, 15,113,116,204,166, 21,114,121,194,243, 55,166, 60,247,211,175,
- 48,189,246, 28,250,225, 99,226, 3,135,171, 91,226, 76, 25,143, 70,124,233,165, 87,184,188,243, 35,226,166, 67,247,119,249,206,
- 59,239,115,209,192,108, 50, 74,158, 13,149,103, 84, 37,199,187,208,117,180,155, 13,177,235,168, 80,188, 42, 93, 23,240,109,160,
- 11, 29, 93, 27,112, 49, 82,197,148,199,238, 53, 13, 94, 81,211,125,100,118,162,198,101,114,232,197, 57,183, 94,152,243,209,163,
-115,174,204,199,220,125,124,194,181,189, 29,102,181,227,185, 91,135,124,116,178,100,236,107,222,252,240, 33, 95,126,225, 58, 59,
-227, 49, 65, 3,151,203, 53, 93,229, 25, 57,152,184,128,196,134,215,223,122,135,201,168,194, 69,225,252,114,205, 98,181,224,149,
-103, 14,121,233,198, 62,243,113, 77,219, 69,186, 54,176, 94,183,172,214, 27,246,247, 15,216,171, 97,111,238,168, 98, 71,215, 69,
-170,122,204,219,255,219,255, 78,124,255,125,110, 77,107, 68,224,173,243, 21,191,252,212, 1, 59,111,190,199,205, 87,190,192,221,
-239,191,217, 59, 41,150, 92, 43,197,130,173, 68, 13,249, 76,234, 2,191,217,176,104, 87, 4, 75, 56,108, 66, 32, 84, 53, 93, 84,
-206,187, 53, 15, 54,129, 89, 85, 83,225,144,232,185, 57,157,114,222, 54, 4, 13,140,125,197, 50, 52, 92,116, 29, 51, 95, 51,247,
- 21,171, 24,168, 36, 69, 22,206,188,163,141,129, 38, 6, 98, 84,238,111,150, 28,212, 9, 53,239,136, 76,157,167,213,150,243,174,
- 99,207,215, 28, 55,107, 30, 53, 13,207, 76,246,217,108, 22,248, 95,123,118,255,111, 57, 28, 75, 85,246,213,160,163,218, 81,187,
- 42,249,253, 90, 2,151, 0,149,175,122,114, 78,237,146,179,152, 51,141,171,243,206, 36,103, 9, 14, 22,163,210,247, 80,179,201,
-154,134, 73,210,177,148, 1,222,205, 83,151, 51, 72,117,236, 96, 68,122, 88,198, 34, 28, 10,169, 73,112, 98,251,251, 52,217,141,
- 12, 98,207,147, 92, 45,169,144,120, 39,246,103,244,210, 22, 47,218,239, 0,189,193,252,181,164, 93,139, 26,129,171, 6,174, 56,
-120, 90,224,154,253,190,246,146,160, 94,103,215,199,126,173, 37,173, 33,114,129,169,220,176,162,200,113,160, 9,130,177, 63,115,
-121, 53,144,254,253,200, 57,170,254,181,219,117, 21,199,200,156,233,188,189, 39,143,244,144,187,104,186,190,149, 24,156,111,176,
-240, 68,132, 49,121,210,117,189,199,181, 43,160,245,158,115, 96,123, 85,135,176,148, 68, 20,203, 43,138,173,221,183, 93, 91, 87,
-236,234, 15,141, 84,151,215, 5, 34,219,176,123,101,215,213,219,207,170,141,104,153, 36,120,112, 32,176, 67,250,117, 79, 18,235,
-125,150,153,215, 69,250,151, 24, 44, 63,246,194,218, 10, 83,134,255,115,231,236, 4, 11,228,128,185, 23,118,237,250,247, 15,100,
- 79, 10,148,222, 61, 44,218, 58, 41,195,238,209,188,209,123,104, 54,239, 93,123, 14,196,128,232,116, 10, 75,107,228,206,186, 68,
-162,219,241,210, 95,183, 78, 19,122,225, 12, 57,137, 8, 27,155,248,157,221,255,249,126,119, 69,179, 71,209,216,100, 6,249,185,
- 17, 65, 37, 38,211, 37,177, 38,192,217, 33, 34,189,204, 51,193, 80,222,160,190,236,229,222,239,187, 51, 89, 80,182, 67, 87, 6,
- 95,227, 84,128,196,144, 47, 39, 3,154, 66, 17,195,235,101,176, 72, 77, 94,234, 6,237,187,116, 93,131, 33, 58,153,164,186, 90,
-173,168, 46,143,105, 46, 31,113,255,225, 61, 86,139, 21, 15,126,244, 54, 93,136, 44,151, 75,150,103, 75, 98,108,233, 98, 67,212,
- 14, 25, 57,226, 38, 77,221,222,140, 98,188,192,168,182,117, 96, 45,212, 36,255,241,113,157, 14,254, 86, 97, 84, 9, 77, 80, 46,
- 55, 29, 77, 39,232,122,205, 58, 70,154,144,114,196, 91,235,106,187, 66,205,226,236,158, 17,123, 24,242,125,144, 17, 61, 3, 19,
-251,166, 58,118,145, 54, 64, 37, 62, 73,123, 5,154, 54, 18, 99,100,101,166, 70, 85,239,204,151, 63,107, 75,121,203, 81,182,153,
-123, 99, 95,239, 43, 65, 59,237, 99,130, 35,233,153,174, 36,249,207,139, 36, 40,190,174, 60,116, 1,223,182, 92, 57,156, 32, 26,
-169,187,134,207,124,227,103,240,251, 87,208,198, 65,211,208, 92,172, 89, 94, 28, 51,217,219, 69,198, 83,154,197, 37, 50, 59,224,
-252,211, 59,140,199,115, 94,120,254, 5,102,205, 25,143,239,159,176,227,148, 81, 8,184,118,131,111, 26,220,106, 69, 88,172,136,
-235,134,184,222,176,186, 92,209,174, 55,208, 52,208,118, 72, 23,168,236,138, 84, 98, 48,189,173,180, 18,135, 40,221,205,206,200,
-200,117,136,124, 60, 63,100, 60,169,137,161,101, 50, 30,211,117,145, 85,219,113,190, 94,115,117, 54,198,123,199,180,246,156, 45,
-147,161,205,233,229,130,197,106,195,164,114, 60,181, 59,226,246,245,235,156, 93, 94,242,207,190,253,125,230, 46, 89, 4, 55,237,
-146,227,197, 37,191,248,133,103,248,204,205,171, 76,199,158,179,203, 13, 15,207, 87,156, 44, 87,204, 71, 19,118,119,230,220, 58,
-218,163, 18,184,247,224,148,113,132, 31,253,175,127,151,227,247, 63,100, 35,112, 99, 62,230,131,139,142,155,211,154, 80, 59,228,
-114,205, 31,251,153,111,240,246, 15,127, 48,168, 67,164, 80,234, 60, 65,140,207, 5,255,176,121,196,254,100,159,247, 55, 99,130,
- 83,188,140, 24,251,154, 24, 55,120,169,248,217,171,175,240, 82,181,225, 81,187, 66,188,231,164,221, 48, 98,132, 35,114,214,172,
- 24,185,154,131,186,230,188, 93,211, 1,149, 56,246, 42,207, 42,116,204,252,184, 31,166,246,235, 49,215,199, 83,118,235, 58,169,
- 85, 68, 88,134,142,141, 53,219,139,152,248, 19,183,166,187,172,186, 22,183,154, 80, 73, 16, 84, 34,187,226, 24,213, 32,211, 10,
-239, 42, 66, 8,120, 73, 58, 42,223, 7,168, 43,222,167, 92,174, 16,186,100,226, 97,169, 70, 17, 24,121,215, 23, 92,186,152, 24,
-152,201, 96, 57, 17, 79, 80, 36, 42,170,177,183,128,221,248,204,146, 77,120,111,212, 52, 45, 70, 11,238, 8, 65,168, 28,116, 81,
-184,230, 19,147,254,130, 4,155,173, 20,118,141,221, 35,214,125, 43, 66,109,251,189,206,246, 86, 89,131,235,122,253,180,193,108,
- 6, 90,143, 60,236,154,231, 53,213,224,107,173,198, 14,207,112,120, 52,137, 87,134,161,179, 0,215,121, 99,207, 27,137, 77,123,
-105,159, 24, 44,154,255,254,199, 13,106, 68,237, 64, 48,121, 73, 93,216,118, 6, 29, 60,213,123, 29,165, 85,220, 96, 29,114,204,
- 86,177, 12,211,177,160, 5,129,170, 72,214,210,109,195, 28,103, 5,118,165,121, 90,211, 30,174,206,214,172, 90, 56,132,169, 17,
- 4,131,193,221,165, 60, 46,115, 14,194, 79, 98,228, 23, 82,189, 50,178,179,112,253,181,247, 59, 68,232, 86,154, 52,206, 83,159,
-180,254, 39, 58,188,102,201, 12,250, 60,165,102, 83, 28, 39, 91,242,148,172,119,246, 94, 18,148,107,220,111, 53,109,106, 52, 29,
-116,204, 19,167,166,146,234,140,204, 40, 81, 7, 11,211, 46,153,203, 84,170, 76,172,248,174,128,139, 78,217,171,210,189,157,185,
- 3, 42,131,229,106,242,155,215,129,144, 89, 56,170,229,247,210, 50, 40, 45,214,209,144, 1,107,140,150, 12,215,218,153,165,105,
-225,175,212, 31, 59, 57,105,172,255,254,133, 7,190,115, 37,121, 81,251,192,161,188,214, 8,237,246,235,234,101,111,197, 33,166,
-106, 36,215,194, 19, 72, 11,187,216,124,207, 86,146, 73,165,240, 7,191,255, 30,149,255,128, 73, 93,113,126,209,208, 86, 53,135,
- 59, 31, 51,155,214, 76,118,167, 73,222, 55, 26,209,109, 90,180,117, 68, 2, 85,149,248, 60,155,203, 6, 63,118,172, 54, 29,123,
- 59,137,232, 53, 25,215,104, 8,140,188,167,139,202,129, 75,231, 80,140, 30, 79,228,218,124, 70, 8, 13,235,166, 75,197,127,232,
- 91,122,100, 72, 92,118, 20, 76, 46,151,130, 82, 85,233,139, 98,199,150,100, 16, 67,105, 40, 34,157,187, 54, 77,227,138,169,121,
- 84,112, 18, 77,246,152,204,126,180, 17, 66, 48,131, 39,151, 82, 10, 53, 67,125, 42,196, 54, 38,119, 63,227,184,212,146, 16,152,
- 70,211,154,167,242,105,213,160,109, 3, 84, 84,149,231, 98, 29,104,207, 79, 97, 54,229,232,169, 91,232,254, 62,122, 25,147,219,
- 92,229,211,121,184,114,236, 44,215,184,217,140,216,181,200,120, 66,179,129, 16, 26, 22,167,143,217,191,245, 28,254, 7,239,209,
- 94,122,186, 24, 7,103, 76,107,100, 37, 68,196, 26, 90, 40, 26,123,179,254,142, 50,112, 56,176,179,206, 57,233,137,152,217,148,
- 40, 10,248,213,130, 31,220,121,192,231,158,127, 26,191,233, 96, 58,230,112, 84,177,232, 58,238, 31,159, 49,118, 48,159, 84, 56,
-129, 77, 80, 58,148,182,221,112,124, 82, 51,171,110,176,216,192,155, 31,188,197,184,118,120, 34,235,118, 73, 12,129, 89,237,120,
-124,126,193,254,172, 78,100,190,174, 99,185,105, 89,173, 54, 76,171, 49,175,222,190,193,199, 31,188,207,143,254,224, 13,110, 60,
-252,144,179,216, 20, 14,162,202,249,122,201,207,222,152,115,255, 50,242,112,185, 97,181,233,152,252, 95,255,140,175,254,251,191,
-194,119,255,193,255, 67, 78,229,205, 3,105, 44, 29, 72, 25,206, 79, 5, 62,215, 61,224,223,253, 89,207,255,249,189,192,253, 14,
-102,206,241,125,119,155,231,103,123, 60, 27,239, 83, 93,124,192,159, 1, 22,177,226,141,234, 58, 43, 39,204,170, 25,227,198, 51,
-173, 60, 77,232,120,106, 60,227,128,134,103, 71,202,199, 11,199, 39, 45,156, 54, 75, 34,137, 95,163,116, 56, 28, 47,213,135,252,
- 92,181, 98,191,106,185,235, 43, 94,107, 59,212, 7, 54,209,211, 70,120,220, 42, 55,252,156,175,124,238, 54, 21,149, 39,198,200,
-142, 42,212,158, 74, 28,161,235,250, 3, 68,109,119, 38,189,121, 75, 52,107, 71, 33, 86,201,242,206, 27,220, 30,205, 34, 21,146,
-115, 92,154, 32, 20, 85,103, 80,166, 38, 29,116,116,228,111, 56,118,137, 97, 26,173,235,110, 99, 26,173, 29, 74, 75,218,135, 85,
- 36,187,200, 77,132, 29, 15,123, 81,120, 96, 39,250,218,152,240,153,121,221, 9, 61,139, 62,168, 36,136,216, 76, 54,212, 78,194,
-154,244, 48,102, 25, 71,232, 64,170, 33, 27, 58, 74,214, 47, 90,134,178, 77, 97,222,167,155,186,202, 78, 68, 36,253,120,200,135,
- 89, 46,138,246,122,186,172,127,213, 66,206,101, 19,146, 26, 92,231,220,144, 99,237,164,152, 14,236, 80,245,110, 96,164,111, 17,
-163,242,222,219,200,101, 91,190,233, 78,135,162,156, 11,189, 75, 19,121,173,195,251, 11,154, 12,108, 78,115,168, 9, 67,166,122,
-180, 59, 57,107,151, 51,156, 95,194,241, 82, 76,156, 53, 67,200, 76, 14, 3,201,135,191,127,130, 63, 32,229, 78,189,128,206,243,
- 67, 84,185, 97, 69,209,198,180,243,175,172,121,171,172,249,240,121, 71,172, 73,127,235, 84, 18, 81,199,185,190,113, 82, 45,229,
-254,150,208, 85,178, 93, 13, 50,244, 46,169, 56,188,221,179, 65,237,192, 50,155, 83, 15,180, 46,177,194,167,249,189,218,231,218,
-136,224, 66,114,182,187, 80,237, 85, 6, 3,159, 34, 85,187,206, 56, 13,101, 65,118, 12,242,177, 76, 34,220, 19, 88,202, 64,164,
-140, 10,109, 27,153,140,164,160,139,104, 79, 6,139, 90,124,246,206,118,201, 49, 53,198, 82,236,126,196,144,141, 12, 47,246, 72,
- 70, 70, 49,138, 66,237,101,152, 48, 67, 97,174, 36,170, 67,152, 75,230, 70,152, 33, 84,230, 84,228,162,159, 81,145,179, 46,242,
-193,122,131, 15,176,211, 53,124,186, 6,213, 53, 94,206,105, 52,113, 48,214, 49,145, 34, 27, 6,174, 73,120,194,127, 33,228,148,
- 69,148,218, 9,123,206,177, 55,242, 76,106,207,205,195, 57, 83, 17, 62,248,244, 33, 7, 46, 21,116,162,210,201,224,128,104, 30,
- 61,212, 12, 43,178, 92,213,210,170, 86,183, 89,253,214, 16,229,207, 73, 69,104, 67,100,100,193, 50,185,201,205,102, 75,209,138,
-116,232, 44,175, 62, 26, 50, 36,105,175, 30,109,192,137,125, 3,150, 72,116, 41, 30, 57, 25, 59, 5, 28, 26,148,186,118,140,170,
- 72, 8,208,109, 90,170,218, 39,100,201, 85,196, 85,203,236,250,211,189,201, 12,209, 27,227,189, 5, 55,162,221, 44,169,186, 25,
-170,145,205,201, 5,211, 43,251, 52,203, 13,110, 44,140,199,202,149,163, 61,206, 30,157, 80,227,240, 6,161,247,197,216,222,183,
- 47, 62,227,220, 8,149,196,201,222,180,165, 24, 93, 59, 77,107,147,218,194, 94,228,236,140,209,120,135,215,223,250,128,207, 28,
-204,249,249,112,204, 15,143, 94, 96, 62,159,161, 97,202, 98,189, 97,177,110,112, 50,162,197,179, 51, 27, 51, 25,239,176, 89,158,
-243,193,253,115, 94,121,105,202, 31,125,252, 9, 59,149,163,242, 35,118,240,116,245,136,105,213,242, 91,127,244,136,191,242,167,
-160, 11, 77,207, 33, 57,185,220,112,251,208, 35,247,223,227,141,127,244, 15,121,222,208,188, 32, 3,210,152,145,183, 59,167, 11,
-158,187,178,199,253, 79,150,184,153,231,241,102,197, 87, 15,175,243,109, 77,207, 76, 62,163,202, 1, 76,115, 74,161, 14, 86,199,
- 59, 71,112,231, 94,224,184, 77,196,222, 27,147,200, 95,254, 19, 31,242,189,223,169,233,206,218, 94,194, 58,211,142,229,178,229,
-251,237,154,202, 7,214, 93,210,137,237, 75,197, 21,239,248, 19,163, 19,104,224, 66,103, 76,165,166,209,192,216,124,250, 85, 59,
-246,253, 24,207, 25, 87,184,100, 20,148,207,146, 50, 36, 78, 36,240, 48,180, 28, 84,107,142,170, 11, 94,253,252, 47,241,135,223,
-253, 46,149,183, 32, 12,169, 61,222, 37,237,165,115,201, 46, 37, 31, 12, 98, 58, 94,130,237,217, 36,193,231,201,242, 49, 26,188,
-231,112, 33,117,160,174,210,148,139,220, 73,175, 91, 85,159,152,201, 18,149, 80,199,254,144,203, 48, 88,244,138, 55,241,184,184,
- 72,140, 48,245, 41, 88, 36,154,149,149, 86, 41,194,145, 42,133,204, 28,171, 16,253, 16,253,216, 5,225,210, 96,231,169,153,232,
-148, 33, 37,105,135, 43,201, 99, 93, 7,239,107,231,146,172,167,179,169, 78,236, 31, 85, 22,187,154,167, 80,103,164,186, 28, 61,
- 30,204, 42, 51, 31,158, 89,182, 22, 53, 57,158, 85,126,208,162, 71,172, 27, 22,151,136,118, 86,156, 58, 29, 66, 47,250, 0,173,
- 98,146,206,134, 55,244,250,117,221,130,135,156,237, 10,209,237, 46, 50,203,147,156,125,142,217, 9, 84, 92,250,194, 78, 6,103,
-176,126,207,111, 48,108,106,201,135, 7, 27,209, 94, 46,183, 46, 50, 47,134,181,193, 80,160,137, 9, 54,215,194,245,172,223,175,
- 23, 14,124, 63,246,239, 13, 38,175,116, 40, 88,185,200,143, 51,188,239, 6,213, 67,246,187,239, 97,103, 75,113,203,211,167, 98,
-201,129,246,208,227,211, 97,236, 43, 71, 23, 98, 58,148,109,138, 13, 6,201, 39,155,227,212, 33,183, 93, 42,226,181, 75,118,196,
- 77,201,240,215,196,193,136, 40,173,170,161, 8, 74, 99, 97, 63,137,100, 57,228,120, 71, 67,187, 50, 3, 59,218, 5,201, 43, 11,
- 41,204,138,156,131,221,152,222,243, 44, 14,166, 67, 49, 14,142,114,253,125,145, 81,170, 76, 18,180, 2,175,230, 1,239, 68,141,
- 64, 40,253,189, 62, 16, 51,181,160,116, 14,254, 6, 57,160, 73,204,214,184,180,147,197,136,163,153,152,168, 58,160, 63,117,206,
-144,208, 33,131, 97,236, 97, 71,225,104,148, 96,112, 85,232,218,244,124, 52, 49,173,101, 42, 75, 12,172, 99, 82,118, 56,151,254,
- 44,115, 39, 50, 47, 37,216,222,187,209, 52,197,222,211,192,186, 11,140, 29,156, 94,174,250,117, 80, 24,167,117, 72, 39,137,120,
- 22,157, 20,104,146, 20,254, 13, 41, 39, 32, 39,209,161,153, 93, 97, 68, 85,221,246,190,119,198,206,204, 41,143, 89,226, 39, 12,
-159, 77, 20,187, 31,205, 15, 33,230,168, 99,151, 78, 0, 17,233,165,147, 77,167,248,218, 17, 68,232, 4,218, 78,233, 72,254,181,
- 93, 23,241,222,225,124, 76, 73,131, 26,137, 93, 10, 92,153, 77,119,137, 59,187,200,250, 18, 90, 69,169, 32, 42,193,193, 58,116,
- 56,173,208, 78,232,214, 27,214,171,200,228,224,136,139,143, 63,162,174, 61, 77,219,178,174,199, 44,227,112, 51, 72,129,202,185,
-162, 88, 15,233,142,219,126, 23,189,179,102,164, 63,223, 40,207, 28, 15,203, 32,252,112, 5, 31, 93,222, 99, 58,154,242,239,156,
-223,197,199,150,175, 94,252, 97, 82, 77,248,154,227,233, 33, 15,235, 41,241,230,211,104, 50,210, 96,209,117,188,243,112,193,115,
-135, 87, 65, 28,161,105,185, 49,159, 39, 4,108, 62, 97,177, 94,178,214, 17, 79, 31, 93,229,127,250,167,111,240, 23,190,241, 44,
- 62,180,204, 93,224,214, 92, 16, 55,226,185,207,222, 30,172, 20,204,227, 36,216, 42, 52, 39, 12, 86,192,199,143,206,249,133, 47,
- 63,195,119,223,122,204, 93, 7, 47,190,254, 6,211,201,140,229,114, 73, 83,160,141, 89,208,145,209,178, 14,216,219,131,221,107,
- 32, 53,124,251,125, 56,239,224,133, 29,184,125, 0,151,199,208,174, 90,212, 21, 9,134,182, 74,156, 24, 71,104,234, 29,129,200,
-190,192, 23,125, 75, 27,210,103,112,232, 86,188,232, 39,124, 63,182,204,164,226, 84, 91,118,253,148, 25, 13,215, 36, 38,100,220,
-158,135, 91, 62,112, 12,236, 41, 44, 34,220,244,240,170,252, 19,218,182,166, 66, 5,169, 52, 73,211, 36,226,240,137,205, 41,158,
-168, 70,227,178, 67,177,167,202,136, 16,218, 46, 21, 71,155,214, 53,167,126, 72, 28,224, 24,243,218,118,142, 68,170, 67, 44,225,
- 77,168, 17,162, 11, 3, 59, 59, 38, 2,208, 88,180,152,170,134,120, 73, 68,104, 80, 90, 47, 76,173, 56,140, 85, 25,171,177,142,
- 21, 86,149, 82,217,135, 48, 47,111, 52,155, 74, 92, 49,233,120,155, 66,146,117,101,130,171, 43,211, 57, 85,222, 28,167,156,117,
-176,118, 88, 71,236, 70,206,158,240,190, 15, 62,178,212, 47,240, 86, 73,130,104,138,116,180, 98, 19,237, 6, 9, 36, 13,108,107,
-242,150, 11,115,247,218, 69,217, 97, 56, 68, 66, 1,249,248,173,225, 82, 6,121,146, 21,207,170, 48,205,200,205,129,194, 64,104,
-176,207,208,185, 1,206,175, 52, 29,162, 93,150,150, 37,179,169, 45,243, 25, 87, 22, 91,123,224,243, 13,223, 20,123,247, 57, 48,
-210, 33, 62, 83,216, 70, 23,226,147,196,191, 76, 44,236, 25,214,130, 22,133, 59, 71,171, 22, 36,108,246, 81, 86,118,232,102,142,
-135,239, 73,117,244,106,133,168,195, 78, 91,179, 65,139,100, 86,119,122,208,189, 79,174,113,206, 13,171,148, 60,181,122, 73, 38,
- 71,106, 69,100, 25, 97,233, 5, 31, 18,236, 94, 27,202,130,105,217, 61,218, 27, 23, 85,146, 21, 17,186, 53,169,231,215, 26,178,
-241, 76, 28,174,129,232,160,202, 64, 97,105,197,162,211,116, 15, 87,209,166,193, 14, 92,157, 77,132,172,240,218,148,149,239,173,
-104,247, 82, 79,250, 42,194,132, 74,158,129, 56,147,109, 25, 95, 2, 87, 4,175,232,128,182,248,194,116, 41,203,195,186,220, 64,
- 90, 17, 76,113,199, 67,211, 87,134,183, 72, 49,185,227,134, 4, 55, 52, 61,119,249, 62, 81, 96,238,134,162,161,190,240,153,135,
-173,207,154,110, 72,108,219,210,205,219,174,127,142, 90, 26,158,145, 17,213,194,111,236,135, 69,151, 6, 5,103,250,252, 46, 14,
-141,160,160, 67,254,129,125,243,152, 99,133,237, 30,113, 50, 68,203,170, 17, 18,181,183,226, 77,124,135,124,191,101, 85,138,203,
- 25,137,226,232, 66,250,217, 21,105, 47, 31, 68,210,127, 86,116,218, 46, 36, 23,187, 24,211,174,218,200,154, 82, 9,109, 19,104,
-103, 21,225,228,152,230,228, 4,223, 86,184,170, 38, 32,156,159, 47,160,142,172, 86, 27,244,252,132,205, 38,176, 94,119,140,231,
- 51, 54, 93,131,211, 41,237,229, 5,171,233,156, 15,215,214,164, 12,219,188,158,104,233,123,182,183,246,163,144, 24,122, 22,187,
-164,109,143,246,108,118,113,136,240,189,148, 26,246,175, 48,175, 91,254,197,157, 11,206,180,229, 27, 71, 7, 28,156,124,146,188,
- 70,101, 72, 91, 28,105,203,245,243,251, 92,143, 16, 30,126,192,247, 71, 83,238, 78, 15,121,230,233, 27, 60, 59,159,243, 31,254,
-217,111,242,247,255,239,223,224,233,153,176, 55, 85, 36,180,184,230,130,163,205, 37,179,110,195, 81,179,100,252,254,130,247, 63,
-120,131, 7,159,125,145,166, 30, 81,171,242,213,103,246,184,123, 25,248,197, 95,248,183,184,243, 91,175, 33, 85,186,242,206, 12,
-121, 92, 70,224, 76,182, 20,230,115,174,204, 79,185,123,222,176,222, 44,153, 95, 57, 96,181, 94, 34, 53, 52,164,220,136,176,232,
- 88, 3,183,106,144, 49,132, 67,120,233, 69,248,237, 63, 20,100,164,188,250, 5,224,189, 68, 63,248,220,243,240,246,191, 74,131,
- 31, 33,153,162,229,231,250, 21,127,198, 59,237, 12, 47, 13, 81, 19,226,131, 40, 7,186,160,203,171,177,168, 60,205, 5,151,126,
-194,134,138, 51, 93,179,139, 48,142,158,219,254,130,209, 20,218,101,122, 86, 47, 28,248, 26, 62,109, 82, 83,220, 5,168,142, 4,
- 31, 90,170, 30, 87, 55, 83,151,160, 93, 79,123, 22, 73,174, 91,206, 22,229, 98, 7,176,104,239,176,222,159,218,206,168,228, 49,
-164,221,181,102,154,117, 97,121,168, 49, 18, 53, 90,162,147,237,180, 37, 61,132, 41,230, 49, 38, 57, 73,200,141,114,218,167, 59,
-211,209,122,201, 16,200,144, 64,166,177, 40,184,185, 8,196, 1, 22,170, 76, 51,234,158,200,249,238,161,112, 59,137, 84,212, 10,
-151, 21,155, 98,202,204, 55, 35,174, 56,232,138,189,183,207,133,193, 37,246,111, 46, 92, 46,155,227,216,161, 89,187, 36,243, 19,
-171,150, 19,133,163,204,180,215,194, 0, 67,210,235,142, 49, 31,150,217, 99,125,216, 79, 71,217, 54,248,210,162,136, 86, 36, 56,
- 79, 36,145,133,156,233,229, 51,246,234, 76,126,215, 70, 88, 59, 11,217,208,212, 77,102, 19, 25,149,129, 5,159,119,242,253,190,
-152, 33,115,251,168, 64, 21, 68, 11,199,180,226,235,188, 22, 12,245,226,250,215,217,229,206,253,120,241, 47,217, 41,193,193, 28,
-161,147,161,202,187, 94, 59, 47,125, 88,137, 35, 29,170,209,238, 71,151, 67, 90, 44,210, 83,109,111, 48,164,206,165, 67,171, 11,
-209,220,214,146, 85, 40, 70,178,108,128,115, 77,177,163,149, 42,181,125,255, 0, 44,172,176,186,173,207, 96,200,227,206,216, 93,
- 46,100,153, 89,159, 45,232, 43, 25, 80, 36,239,100,139, 25,159,175,103,229, 6, 27, 87,151,227, 71,157, 77,199, 69, 80, 80, 14,
- 67,201,211, 73,249, 89,104, 31,185, 59, 88,186,198, 66,199, 29,237, 0,170, 44,156,133, 66,221,213,233,182,129, 80, 86,192,139,
-232,150, 77,173,133, 24, 39,226,148, 49,229, 93, 1,233,151,188, 10,111,107,140,122, 52, 16,210, 74, 71,175, 88, 10, 89, 92,113,
-191,219,125, 93, 46, 58,251,112, 37, 55, 60,168, 99, 47,140,173, 49,172,179,172, 44,199,137,155,199,129,235, 17, 42, 43,246,121,
-165,227, 6,191,231, 88, 24, 50,249,130, 63,146,205,122, 52,216, 26,203, 94,112,180,208,153,254, 1, 40,252, 0, 8,209,160,223,
- 20, 71,157,213, 4, 53,174, 87, 17, 84,226,146, 9, 14, 16,219, 36, 23,118, 26,204, 9, 81,113,157,114,126, 17,232,170,134,205,
- 7, 15, 56,127,124,204,229,229,165,169, 19, 2, 46, 8,163,113,205,167,159,108,216,223, 29,227,234, 49,209,213, 44,219, 5,199,
- 23, 75,198,139,142,249,238, 46,163,195, 61, 62,110, 98,239, 93, 81, 89,193,246,110, 32,201,142, 10,178,164,151, 33,153,207,153,
- 97,146,100,197,131,157, 75,162,112,184, 91, 67,115,194,225,243, 47,241,231, 14, 61, 63,120,231, 45,206, 31, 62,226, 20,229,219,
-157,240, 76,165, 60,180,161,161, 65,120,250,169,219,252,238,221, 79,121,121, 54,226, 79,191,248, 89,226,115,183,248,219,191,249,
- 59,252,218,175,252, 10,127,231,191,254,207,121,189,122,138, 95,110, 63, 37,154, 49, 85,206, 15, 80, 39, 44, 37,173,195,110, 76,
-198,140,191,255, 38, 46, 42, 31,118,194,239,253,224, 93,254,105, 55,226,175,255,197, 95, 66,221,107,140,167, 19,220,168, 66,196,
- 51, 59,216,199,213,158,157,163, 67,118,175, 95,101,178,187,139,171, 91,214, 39,103, 28, 47, 79, 56,125,188,226,133, 87, 31,241,
-249,167,224,219, 63,130,135, 43,229,232, 10, 92,236, 8,171, 99,229,119, 91,184,177, 3,191,246, 69,248,222, 59, 80, 79,149,229,
- 6,218,247,225,203,215, 96, 83, 65,104, 96,127, 31,154, 13,108, 86,219, 74,160,169, 68,118,165,194, 81,243, 40,174,104,169,217,
- 85,104, 93,205, 84,155,190,150,206,104,249,156, 58,206,213,243, 32,206,241,174,225,155, 87, 47,210,115,110,241,229,135, 35,240,
-107,120,169,134, 23,191, 1,247, 34,252,189,223,133,199,247,172, 46,253,230, 31,191,173,162,130,247, 62, 25, 76,152,113,139, 72,
- 98,179,187, 30,127,147, 65,247, 29,213,246,143,253,246, 21,141, 17,241,206, 92,137,204,173, 42, 70,211,111,134, 68, 22,242, 36,
- 9, 66,134,126,132, 36,137,195,140, 28,212,136,116, 46, 89,193,198, 24,211, 14, 44,127,141,164, 66, 87, 89,209, 89, 27,219, 94,
- 25,216,199, 98,114,166,153,237, 71,114,113,206,211, 74,206, 20, 39, 22,161, 76, 38,197,131,109, 87, 45,205, 89,212,206, 32, 69,
-243,161,110,181,136,186, 20,233, 59, 86,124, 34,199,196,152,152,209,157,166,169,163,138,219,112,142, 47, 36,100, 81, 6, 22, 89,
- 40, 96,193,193, 33, 78,183,114,127,179,103,186,151,109, 67,144,152,167,143, 62,250,148, 33,199,218,214, 6, 29,131,190,190, 69,
-105, 67, 42,152,143,227,118,202,154, 43, 44, 99, 51, 97, 74, 11,191,113,117, 48,142,176, 87, 76,152,177, 32,214,148,214,161, 79,
-250, 7,184, 18,134, 47,164,131,121,114,210,130,165,173,110, 91,250,215,217,245,150, 98, 74,115, 5,233,236,200, 11, 99, 51, 69,
-138,182,234,224,137, 29,160,154,106, 32, 90,113, 70,135, 92,237,126,186, 50, 22,251,105, 72, 82,198, 24,149,218,214, 69, 65,149,
- 85, 76,107,136,114,154,140,133,119,191, 60,145, 88,167, 69,192, 16, 69, 92,173, 74, 74,165,235,205, 96,138,154, 48, 17,216,103,
-216,225, 59, 82,103,142,203,174,123,186, 93,104, 92,134, 82,135, 84,187, 60,141, 33, 50,172,117,156,177,220,173,145,238,225,230,
-162,152,150, 90, 74,141,244,249, 15,253,250,160,128,106, 93, 89,148,251,107,169,101,116,129,101, 51, 12,133, 91,139,103, 47, 20,
- 13,114, 44,214, 65,250, 4, 89,171,191,166,193, 2,108,138,134,198,101,143,121,129,105, 37,204, 19,147, 17,103,202, 4, 12, 97,
-163, 63,219,204, 50,215,222,176, 20,205, 98,254, 28,242,144,227,178,119,132,105, 88,189,157,131, 33, 24,159, 32,251, 68,184, 1,
-134,114,162,253, 36, 31, 98, 25,180, 68, 31, 7,219,217, 51,182, 54, 34,202,198,226,108, 91, 59, 59,130, 53,152,121,253, 23, 66,
- 58, 55,174, 28,204,216, 4,229, 96,103,194,254,222, 46, 46, 4,218, 77,195,168,114,172,150,107,198,147,154, 54, 4,154, 46,208,
-118,145, 81,237, 89,172, 59, 30,174, 90,150, 81,121,247,241,146, 40,137,240, 57, 20,112,233,163,181,123, 85,137, 12,196,199,140,
- 0,250,114,231,158,125, 53, 50,247, 64, 6,226,234, 38, 42,159,180, 38,227,140,195,243,157, 27,197, 87,159,189,206, 81, 83,241,
-238,230,130, 63,117,251, 26,187,123, 71, 84,251,115, 94,124,225, 51,196,157, 49, 65,225, 47,253,247,127,143, 87, 63,247, 37,254,
-218,171, 71, 28,183, 74,236, 26,186,197,130, 14,101,134,242,255,126,231, 93,126,246,139, 47,242,229, 47, 62, 15,178, 78, 33, 54,
-179, 25,218, 53,252,167,255,224,117,254,135,255,224,167, 9,109, 76, 76,175,106,148,116,246,171, 85, 98, 53,111, 86,168, 38, 77,
-202,157,127,253, 61,238, 60,190,228,243,183,158,227,218,139, 31,242,123,191,213,242,105, 11,199,192,157, 13,236, 78,225,178,129,
-233, 12,254,230, 95,133,147,111,193,183,222,132,187, 45,236,239,192, 51,192,222, 1, 28,237,193,238, 4, 62,188, 11,223,249, 20,
-158, 57,244,172,238,133,190,177,142,192,194, 85,252,197,159,234,120,235, 93,248,116, 3,127,230,167,225,206,189,100, 88,117,185,
- 72,255,205, 39, 48,159,193,179, 7,176,218,164,115,230,116, 41,184, 29,225,173,143, 35,218,194,205, 93,152, 77, 97,231, 16, 78,
- 47,225,185,231,210,121,117,109, 23,254,229, 63,130,170,107, 99,218,237,196,206, 44, 79,179,182, 53,251, 70, 15,123, 85,177, 39,
- 81,140, 77,140,177,217,197,187,244, 0,231, 24,209,220,217,229,246,207,110,138,204,158,173,164,100,236, 40, 26, 98,255, 32,137,
- 75,112,181, 71,241, 57, 22,209,219, 30, 20,139, 50,181,105, 37, 63,112, 89, 27, 92,229, 18,100,238, 1, 9,174, 76, 55,159,198,
- 68,210,235,209,131,173, 41, 32,253, 44,205,133, 82, 6, 13,171,214,185,219, 54, 66,149,237, 41, 85,134, 93,183,183,226, 29, 67,
- 68,213, 37,130, 68,149, 26, 11,215, 71,180,166,201,165, 39, 19,161, 91,251,246, 12,211, 58, 51,246, 8, 5, 75,220,217,142, 54,
- 7,100,136, 29, 56, 72,177,143,181, 41, 82,101,219,132, 70,117,128,212, 70,182, 19,239, 44,165,170,118, 73,106, 54,118,112, 63,
-235,246,227, 48, 93,107, 97, 64,146, 93,229,118, 44,193, 79,101, 43, 62,187,215,252, 11, 3,212, 26, 10, 41,156,150,178,186, 30,
-105,208, 45, 84, 67,217,102,105,171, 14,147, 83, 46,228,209, 96,204,188,190,232,175,155, 77, 75,121, 47, 44, 78,136, 33,246, 76,
-188,124,157,189,232, 22,139,187,143,137,213,100, 39,235,156,112,177, 9,201, 23, 65, 64, 66,100,156,201,154,118, 47,117,164,169,
- 61, 50, 20,181,232,134,195, 63,234, 19, 44,245, 66,243,223,103,143, 23, 44,117, 74,212,168,248,218,214,212, 27,163, 39, 51,232,
- 85,123,116,163,111, 20,182,138,187,246,240, 56, 3,233,186,231, 75,196, 66,250,166,197, 7, 84,198, 2,244,191, 47,120, 41,165,
- 97, 80,138,238, 29, 14,245,252,231, 93,102,219,235,112, 61,164, 48,127, 82, 67,137, 92,225,218,151, 95,155,152,247,190, 20,225,
- 48, 90, 56, 20,198,242,190, 46, 50, 18,242,189,217,228,215, 29,210,138,101,251,122,202,118, 0,142,108, 27,210, 72, 65, 62,205,
- 22,204,131, 5,174,121,115,104, 50,124,200,185, 12,174,216,213,151, 72, 89,214,253,151, 10, 2, 41,208, 28, 45, 26,187,145, 75,
- 22,220,181,147,254,190,246,181, 17,232,188, 16,187,228,177,128, 75, 65, 87,143, 30,157,179,136,202,189,199, 23,168, 62, 68, 80,
-206, 34,220,239, 96, 99, 13,249,142,104, 58, 39,251, 85, 92, 38, 80,106,218, 47,219,189, 17, 72, 5,216, 91,244,172,195,140,117,
-242,116,110, 82,192,188, 27,206, 30, 61, 29,233,251,120,251, 0, 98,217,168, 1, 43, 21, 46,163,246,195, 79, 96, 32, 22,127,249,
-202,156, 47,132,150,199,103, 11,174,187,142,197,233,134,187, 15, 63,226,203, 95,124,137, 31,190,241, 22, 85, 93,115,120,176,199,
-127,246,242,231,208,121, 77,115,118,198,229, 15,223,102, 62,174, 24,183,145, 43,183,174,242, 27,175,253,136,163,163, 61,190,244,
-252, 45, 94,251,246, 31,242,139,191,250, 77,238,127,247,117, 78,127,255, 13,254,139,111,223,101, 19,133,199,143, 94,225,195,127,
-245, 59,248,209,136,157,195, 57,174,170,122,233,230, 24, 37,224,216,156, 47,184,115,177, 65,124,197,229,179, 23, 84,103, 45,237,
- 12,154,179,244,117, 47, 76,210, 71,190, 43,240,215,126, 13,218,199,240,240,177,121,116,212,176,211,130,159, 39,164,195,249,116,
-192, 94,153, 65, 92,194,248,170,176,145,225,253, 7,133, 63,251,243, 29,247, 31,193,102, 12,183,174,129, 27, 65,215,193,253,199,
-105,157,121,222,192,247, 78,224, 63,254, 85, 24,159,193,233, 73,106, 40,158,122, 90,217, 92, 42,127,254, 87,110,114,249,254, 61,
-222,249, 65,228,214,139, 48,158,142,184,121,181,225, 98,147, 38,247,247, 62,130,201,204,234,107,232, 66,154,204,125,218,125, 59,
-163,228, 70,183,173, 57,234,101, 85, 33, 29,168, 98, 55, 36, 33,152,131, 89, 50,172,201,147,145, 26,155,204,147,138,161,196, 68,
- 84, 11, 93, 34, 42, 73,140,125,247,239,197,210,159, 44,255,219,229,131, 79, 7, 22,186,216,174,186, 63,160,141, 4,150,137, 60,
- 61, 51,220, 75, 63,197,122, 49, 15,230,108,255, 57,240,192,250, 7,203, 25,228, 94,134, 90,144, 15,150,172, 51,245,105, 26, 19,
-211, 14,119, 58, 96,114, 25, 54, 87, 73,222,240, 99, 77,254,242,229,132, 29, 13,211, 78, 59, 54, 73, 15, 69, 62, 4,243,196, 96,
-144, 99, 20,161,178,194, 19,237,129,118,182,151,175,200, 30,230,177,159,132, 52, 79, 18,174,156,232,135,131,164, 43,166,229,169,
- 89,205, 46,116,240,131,151,168, 60, 69,193, 8, 38, 71,103,234,192,114,215,193, 53, 78, 11,184, 61, 22,112,187, 22, 68, 48,151,
-101,125,197,196, 90, 66,240,190, 32,125, 61,153, 54, 87,234,228,133, 1, 94,118,206, 98,107, 53, 82, 33,108, 98, 34, 18,121,115,
- 77, 91,199,228, 0,230,141,201,152, 15, 92,162,166,181,134, 73, 37, 85,134,233, 83,138, 10,161,154,214, 77, 27,155,188,147,133,
-237, 96, 14, 20, 37, 49,123,235,130,163,145, 27, 65,220,128,216,212,197, 46,154,156, 59,222,219,142, 26,226,243, 4,187, 54, 35,
- 66, 82,120,169,119,214, 56,118, 89,181,208, 65,109,141,170,211,159,224, 80,100,104, 67,249,231,133,175,138, 93,203,216,243, 36,
-122, 35, 25, 41,136, 82, 79,124,219, 82,247, 30, 98, 97,183,154,243, 17,114, 17,163,224,207,144, 44, 73,125,230,166,232, 0,187,
-247,153,240, 37, 65,243, 73,238, 75,145, 91, 80,198, 26, 87, 86,120,163,161, 95, 89,109,145,253, 18, 36, 59,221, 89, 99,224, 10,
- 8, 34, 35, 92, 72, 94, 93,216,179,108, 63, 44,111,167, 50, 97,208, 27,243,181,215,133,216, 17, 34, 70,232,205,207,156,147, 97,
-221, 80,122, 44,100, 94,140, 47,114,232,183,197,206, 57, 16, 73,251,152, 98, 33, 80,145,252,223, 51, 67,176, 54,163,151, 32,137,
-175, 51,117,142, 35,148, 46, 14,217, 12,215, 21,174,214,106, 9,106,208, 21, 55, 68, 40,116,250,173,216, 74, 98,208, 80,244, 50,
- 95,183,133,172,201, 22, 95, 33,147,233,122,137, 94,225,101,145, 51, 33,162, 53,161, 77, 84,206, 3,156,134,193,156, 43, 22,166,
- 93,175, 61, 92,240,219,186, 96, 82, 57,174,213, 53,239, 63, 56,102,207,193,244,221,119,121,241,230,117,166,126, 66, 56,126,204,
- 87, 63,255, 28,107,133,197,225, 17,191,254, 15,255, 77,127,238,200,155, 15,249, 79,110, 31,176, 63,134,223,255,255,254, 37,179,
-233,132,245,102,195,225,151,190,204,254,171, 95,226,127,249,133, 37,247,190,247, 67,214,213,156, 55,206, 55,140,234, 72,125,188,
- 68, 66,100, 82, 37,124,107,213,180, 56, 95,177,232, 34, 11, 17, 30, 44,214, 60,243,218,138,207, 94, 73, 7,228,205,153, 41, 85,
-234, 52, 45,207, 38,112,252,238, 28,255,212,130, 79, 23,176,119,148,248, 46,143,143, 83,113, 95, 52,214, 96, 46, 97,114, 8,215,
- 15,225,104,174,188, 31,134, 70,111, 54,203, 94, 44,240,240, 12,254,237,159,129,243,187,233,153,152,213,233, 76,152,143,224, 41,
- 67,100, 42,129, 56,130,105, 35,184, 78, 25,207, 96,245,224,152,195,151, 15,184,249,224,152,176,128,189,195,134, 22,184,125, 11,
- 30,190, 11,227,155,240,204,103,160,234,140,245, 81,105, 0,241,118, 67, 70,243,197,182, 46,178,170,172,179, 29,124, 67,213, 41,
-177,141, 6,207, 27,188, 24, 99, 63, 33, 57, 39,168,153,253, 7,115,103,138,153, 88, 97,134,209, 78,211,215,246, 19, 24,113,216,
-127,199, 28,245,169,253, 65, 66,145, 72, 90,217, 65,169, 93,222,155,217,100,208, 31,142, 25,194, 78,198, 14, 89, 63,239,122, 8,
-108,120, 40, 53, 67,120,229,195,106, 6, 54, 33, 23,221, 98,210, 8,110,128, 17,213, 13,218,245,138, 36,185,203, 9, 86,195, 40,
-149,186,167,141,233,163,131,237,125, 51,235, 56,179,100,181, 96, 72,247, 7,143,151,173, 98, 27,140,109,235,202,172,107,201,121,
-233,249,112,209,194, 8, 35,177,114,139, 21, 44, 53,105,226, 94,106, 50,147,240,110,136,152,205, 48,123,182, 28,245,108,239, 47,
- 51, 43, 93,139, 3, 53,239,139,181, 64, 14, 74, 25, 91,175,153, 46, 14,185,210,218,215, 61,113,128,244, 19, 86, 94, 7,101,137,
-145,153,172,100,104,185, 50, 73, 90,107, 59,241, 40,105,226, 78,204,243,244,193,230,226,236,141,204,152, 8,157, 89,150, 34,253,
- 30, 57, 23,196,243, 64,111, 48,226, 93, 33,188, 55, 66,156,151,225,243,117, 38,170, 29, 95, 0, 0, 6,177, 73, 68, 65, 84,153,
-247, 96, 71,228,200, 13, 54,164, 79, 54,195,206, 96,222,160,131, 51, 94,158,128,157,152, 81, 90,113,224,123, 51,175,185,208,194,
-125, 79,161,109, 19,105,138, 2, 54,231,201,235,151, 11,174, 69,201,230,166, 40,145,113,242,231,148,213, 2, 58, 52,108,113, 32,
- 70,150,222, 4, 90, 6, 93, 20, 30, 4,131,250, 34, 51,203,181,247,160, 79,156, 5, 29,214, 47, 70,232,140,197,110,189, 92, 73,
-100,164,226, 73, 25, 81,223, 24,201, 96, 15,156, 11, 75, 85,174, 9,172,102,111, 98,226,136,236,122, 35, 50,186,226,123,229,201,
-156, 18, 18,183,102, 78,183,191, 46,186, 60, 60, 36, 94, 79,176, 95,105, 82, 32,144,203,166, 70,174,120, 15,101, 82,157, 3,143,
- 35,228,251, 67,180,164,250,144,235,118, 45,195,123,236,101,196, 86,228,199,168,169,100, 82,131, 82,249,172,141, 79,252,151, 46,
- 19, 37, 17,102,182, 55,104,236, 89,108,237,194,119, 54, 8, 80, 72,186,134,196,190,129,213, 78,161, 56,233,139,183,157,113,149,
- 13, 56, 35, 55,116,226, 82,160,103, 62, 19, 9,179,244, 19,184, 18,183,215,126, 33, 14,240,123,101,134, 62, 15,186, 77, 47, 95,
-252,189,179, 21,225, 71,159,210, 69,184, 86,193,245,186,226,235, 55,175,241,226,222, 14, 27, 77, 40, 68,254,184,255,206, 71,167,
-160, 48,169,224, 86,237,249,199,255,213,223,229,218,222,148,175,188,252, 25,158,255,202,171,236,124,249,101,214,247, 30,240,131,
-241, 46,143,238, 63,102,228,182,117,230,109,132,165,182,125,163,187, 7, 92, 92,192,157, 6,158,221,135,147, 75, 56, 89,109,175,
- 12,223,252,116,197, 11, 59, 66,125,164,172, 3,156, 63,132, 77, 7,255,250, 99, 56, 94,195, 47, 41, 28,206,161, 91,194,245,219,
-240,143,223, 8,169, 22, 89,243,246, 39, 95, 78, 80,251,227, 5,172, 60,116,199,240,254, 3,104,218, 36,231,236, 52, 69, 2,239,
- 78, 97,189,132, 79, 63,129,218, 24,225,235, 21, 28,220, 80,218,227, 6,247,226,156, 27, 47,192,163, 79, 96,118, 5,214, 43,152,
-205, 18,163, 59, 25, 36,129,252, 31, 95,127, 74,243,142,220,155,251,153,144, 66, 7,156,243,116, 33,244,140,228, 65,150,152,164,
- 63, 33,116,198,236, 28,160,166, 72, 50,249, 16, 81,243, 68, 54,242, 18,195, 8, 25, 67,138,240,203,198, 54,138, 49,179,131,246,
-105, 18, 90, 64,210,146,163, 82,173,234, 68,131, 94, 67, 72, 59, 45,177,187, 83, 25, 96, 61,177,131, 92,109,186,214, 66, 27, 76,
-180, 66, 87,102,120,228, 46,221,228, 41, 25, 53,200, 93,119,126,112,187, 98, 2, 14, 20,154,236,226,112,225,137,157,106, 44,172,
-103, 99,145,101, 30, 24,200,118,226,182,119,142, 20,222,195,165, 33, 70, 57,129,247,122,246,130,188, 87,234,221, 7,232, 92,249,
-177,243, 95,147, 76, 43,191,134, 42, 90,236, 43,195, 26,192,214,151, 73,218, 84, 90, 39,234,118, 1, 46, 9, 81,108,203,192,183,
-138,192,147, 80,164,176,173,133,245, 67, 61,121, 34, 15, 94,182,118,243,153,153, 44,133,123, 92, 32, 57, 14,142, 36, 89, 22,147,
-249, 32,121,167,108,190,215,222,154, 42,113, 73,186,168,249,144, 39, 77,243,103,161,104, 54, 10,203, 88,213,196,225,200,213, 56,
- 40, 91,133, 53,232, 96,246,162, 91,217,204, 67,163, 40,100,100,102,187, 65, 45,171,121,223, 72, 62,113,221,118, 53,161, 44,206,
-100,111, 84,210,115, 51,228,137,175,237,111, 71,209,193, 97,239, 39, 76,190,133,179,114,239,104,168,229, 53,182,226,220, 19,235,
-182,123,149,129,192, 87, 76,115,177, 32, 11,150, 90,231,158, 5, 31,117, 59,242,184,252,148, 11,144, 65,101, 59,105,209, 11, 3,
-217, 47,135,212,196,237,245, 65, 43,201,246,120, 94, 9,243, 58,121,176,247,226, 29,111,236,116,187, 80,149, 31,220,245, 50, 31,
- 33,102, 35, 35, 55, 20,102, 41,214, 1, 94,205, 41,200, 48,213,188,222,160, 88, 21,136, 69, 83, 43,210, 19,231,242, 42, 5, 82,
-106, 92,134,194,123,165,134, 75,124,145,172,139,207, 97, 57, 99,147,252, 69,151, 8,194, 73, 85,108, 83,186, 33, 56, 49, 36, 52,
- 39,239,225,179,156, 54,104,236,135, 5, 10,178,107,118, 71,244, 61,178,177,157,156, 24,202,207,214,158,141, 32,169,201,196, 6,
- 15, 91,178,226,220,118, 19,153,185, 40,119, 54,202, 42,123,121,196,129, 63, 16,116, 72,122,212, 2,146,215, 66, 23,175,197,170,
-197, 65,127, 70,149, 95, 91,254,191,148, 94, 6,246,141,159, 31,123,110, 31,236,240, 40,194,221,199,103,204,221, 48, 84, 92,196,
- 66,162, 9,204, 12,189,244, 21, 91, 67, 76,121, 79,150,228,205, 45, 51, 26,133,211, 56, 32,161, 19,159,134, 58, 9,195,247,201,
-213,241,212,234,203,151,175,195,215,174,195, 59,247,225,225, 26,126,241,153, 52,165, 63,184,128,239, 60, 74, 77,209,216,195,159,
-127, 41, 33,139,237,169, 99,103, 63,114,103, 1, 93, 39,236, 79,149,229, 5, 28,222,132,189,125,184,118, 13,190,245, 86, 90, 5,
-140, 42,168,230, 32,191,241,181,235, 9, 61,244,201,218, 52,183,202, 94, 48,143,244,225,102,197, 2, 31, 36,187,100,185, 12, 33,
- 25,171,218,165, 29, 80,234,164,109,146,209,228, 15, 47, 34,132, 24,140,157,155,136,105, 82, 84,170,100,221, 24,183, 18,235,165,
- 36, 25,153, 92, 76,159, 56, 88,242,169,170, 97,123, 39,230, 92,102,209,219,238, 53,232, 86,225,204,210,154, 50,193, 41,147, 97,
-156, 47, 60,128, 25,220,229, 52, 14,135,184, 22,108, 96,108,170, 42, 3, 92,144,193, 94, 52, 75, 94,122, 56, 62,107,171,117,219,
-189,170, 12, 70,225, 9, 91,194,242, 6,115, 79,160, 22,169,129,210,173, 9, 42,239, 11, 93, 81,101,123, 66,150,237, 61,181,232,
-128, 71, 85,146,172,180,113,216,157,161, 67, 49,239, 39,249,254,115, 41,175,229, 86, 2,108, 95,204,159,168,203, 67,136, 87,182,
- 47, 85,221,154,204,134, 98, 52,124, 3,145, 31, 47,236,137,249,238,250,127,159, 15,231, 65, 78,101,145,172, 35, 25,156,214,158,
-112,180, 19, 55,232,237,212, 37, 50,230,178, 63,128,148,177,184,158, 4, 74,138, 55,232, 63, 23, 45,118,241,177,248, 92,243,212,
-175, 5,172,148,247,205, 90,248,238,111,191,163,237, 38, 73,133,159, 96, 76,153,126, 55, 33,169, 0,106, 39,125, 33, 26,106,154,
-246, 36,176, 30,110, 31,170,245, 54, 9,110,171, 65,226,199,246, 31,174,220,169,231,221,179,219, 54, 30,114, 79, 56, 6,254, 24,
-156, 94, 24, 17,121, 43, 74,177,159, 4,211, 10, 42,199, 16,187,178,185,165, 64,230,158,124,205,102,145,219,175,204,194,118,228,
-176, 74, 42,236,136, 48, 31, 75, 47,175,116,102,179, 43,144,236, 89,213,164,147,110,224,130,244,235, 30, 95,250, 32, 72,239, 73,
- 33, 5, 10,229, 58, 37,110,202,142,116, 48, 55,113, 98, 65, 41, 81,251,125, 60, 49, 38,139, 79, 91, 65,148,198, 72, 93,220,190,
-207,147,219, 95,186,243, 70, 73, 34,146,154, 23, 67, 89,186, 80, 72, 94,109, 32,106, 99,249,204, 15,188,230,220,108,230,117, 87,
-136,165,185,149,157, 39, 61, 39, 71,173,120, 13,135, 72,230,231,244,232, 69,206,211,144,180, 47,207, 9,152,249,190,168,156,112,
-222, 40,239, 54,197,115, 97,136,107, 44,134, 18,236, 94,118,102, 31,157, 7, 8, 95, 52,114, 99,243, 47, 88, 3,247,109,218,207,
-235, 30, 39,112,203,184, 61,209,250,172,141,253, 58, 49, 95,139,172,184,233, 52, 17, 76, 37,194, 42,192,165, 14,231,196,145,201,
- 54, 93,253, 99, 57, 96, 91,247,115,110,176,195, 19,145,222,103, 93,138,158,190,124,242,172, 83,184,237,179,103, 69, 66,143,238,
-218, 25, 82,206, 62,149,189,255,103, 76, 38,125,170,112, 18,135,219,106, 92,240, 89,246, 5,174,249,193,233,110, 21,225, 1,105,
-202,143, 10,215, 4,158,114, 48,217,133,255, 31,241, 38, 60, 68,184, 86,227, 95, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,
-};
diff --git a/source/blender/src/swapbuffers.c b/source/blender/src/swapbuffers.c
deleted file mode 100644
index 0bdb0e1dc39..00000000000
--- a/source/blender/src/swapbuffers.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-
-/* HRMS!!... blender has its own swapbuffers method. for sgi only that worked pretty nice.
- * but with porting to linux and win, with mesa and opengl variations, it all grow
- * out of control.
- * with the introduction of Ghost (2002) we really should bring this back to a single
- * method again. (ton)
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-
-#include "BKE_global.h"
-
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_mywindow.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
-#include "winlay.h"
-
-#if 0
-static void copy_back_to_front(void)
-{
- int actually_swap= 0;
- int winx, winy;
- char *data;
-
- winlay_get_winsize(&winx, &winy);
-
- if (actually_swap) {
- data= MEM_mallocN(4*winx*winy, "swap");
- glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data);
- }
-
- mywinset(1);
- glRasterPos2f(-0.5,-0.5);
- glReadBuffer(GL_BACK);
- glDrawBuffer(GL_FRONT);
- glCopyPixels(0, 0, winx, winy, GL_COLOR);
- glDrawBuffer(GL_BACK);
- glFlush();
-
- if (actually_swap) {
- glRasterPos2f(-0.5,-0.5);
- glDrawPixels(winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data);
- glFlush();
- MEM_freeN(data);
- }
-}
-#endif
-
-static void screen_swapbuffers_REDRAW(bScreen *sc)
-{
- ScrArea *sa;
- int doswap= 0, swap;
-
- /* a new implementation: only using redraws and a normal swapbuffer */
-
- /* all areas front ok? */
- sa= sc->areabase.first;
- while(sa) {
- if(sa->win && (sa->win_swap & WIN_FRONT_OK)==0) break;
- if(sa->headertype==0) sa->head_swap= WIN_EQUAL;
- if((sa->head_swap & WIN_FRONT_OK)==0) break;
- sa= sa->next;
- }
- if(sa==0) return;
-
- sa= sc->areabase.first;
- while(sa) {
- swap= sa->win_swap;
- if( (swap & WIN_BACK_OK) == 0) {
- scrarea_do_windraw(sa);
-
- doswap= 1;
- sa->win_swap= swap | WIN_BACK_OK;
- }
- else if( sa->win_swap==WIN_BACK_OK) doswap= 1;
-
- swap= sa->head_swap;
- if( (swap & WIN_BACK_OK) == 0) {
- if (sa->headertype) scrarea_do_headdraw(sa);
- doswap= 1;
- sa->head_swap = swap | WIN_BACK_OK;
- }
- else if( sa->head_swap==WIN_BACK_OK) doswap= 1;
-
- sa= sa->next;
- }
-
- /* the whole backbuffer should now be ok */
- if(doswap) {
- myswapbuffers();
- }
-}
-
-#include "BMF_Api.h"
-#include <stdio.h>
-
-static void draw_debug_win(int win)
-{
- static int drawcounter= 0;
- char buf[64];
- int x, y;
- int w, h;
-
- bwin_getsuborigin(win, &x, &y);
- bwin_getsize(win, &w, &h);
-
- mywinset(win);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0, w, 0, h, -1, 1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glColor3f(0.8, 0.8, 0.8);
- glRecti(0, 0, w, h);
-
- glColor3f(0.6, 0.6, 0.6);
- glRecti(2, 2, w-4, h-4);
-
- glColor3ub(0, 0, 0);
- glRasterPos2i(5, 5);
-
- sprintf(buf, "win: %d - (%d, %d, %d, %d) %d\n", win, x, y, w, h, drawcounter++);
- BMF_DrawString(G.font, buf);
-}
-
-static void screen_swapbuffers_DEBUG(bScreen *sc)
-{
- ScrArea *sa;
-
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- draw_debug_win(sa->win);
- if (sa->headwin) draw_debug_win(sa->headwin);
- }
-
- myswapbuffers();
-}
-
-static void screen_swapbuffers_DEBUG_SWAP(bScreen *sc)
-{
- ScrArea *sa;
- int doswap= 0, swap;
-
- /* a new implementation: only using redraws and a normal swapbuffer */
-
- /* all areas front ok? */
- sa= sc->areabase.first;
- while(sa) {
- if(sa->win && (sa->win_swap & WIN_FRONT_OK)==0) break;
- if(!sa->headertype) sa->head_swap= WIN_EQUAL;
- if((sa->head_swap & WIN_FRONT_OK)==0) break;
- sa= sa->next;
- }
- if(sa==0) return;
-
- sa= sc->areabase.first;
- while(sa) {
-
- swap= sa->win_swap;
- if( (swap & WIN_BACK_OK) == 0) {
- scrarea_do_windraw(sa);
- draw_debug_win(sa->win);
-
- doswap= 1;
- sa->win_swap= swap | WIN_BACK_OK;
- }
- else if( sa->win_swap==WIN_BACK_OK) doswap= 1;
-
- swap= sa->head_swap;
- if( (swap & WIN_BACK_OK) == 0) {
- if (sa->headertype) {
- scrarea_do_headdraw(sa);
- draw_debug_win(sa->headwin);
- }
- doswap= 1;
- sa->head_swap = swap | WIN_BACK_OK;
- }
- else if( sa->head_swap==WIN_BACK_OK) doswap= 1;
-
- sa= sa->next;
- }
-
- if(doswap) {
- myswapbuffers();
- }
-}
-
-static void screen_swapbuffers_SIMPLE(bScreen *sc)
-{
- ScrArea *sa;
-
- mywinset(1);
- glClearColor(0.8, 0.6, 0.7, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- scrarea_do_windraw(sa);
- if (sa->headertype) scrarea_do_headdraw(sa);
- }
-
- myswapbuffers();
-}
-
-static int drawmode_default= 'r';
-int debug_swapbuffers_override= 0;
-
-void set_debug_swapbuffers_ovveride(bScreen *sc, int mode)
-{
- ScrArea *sa;
- for (sa= sc->areabase.first; sa; sa= sa->next) {
- sa->win_swap= 0;
- sa->head_swap= 0;
- }
- debug_swapbuffers_override= mode;
-}
-
-void screen_swapbuffers(void)
-{
- ScrArea *tempsa;
-
- bScreen *sc= G.curscreen;
- int drawmode;
-
- if (debug_swapbuffers_override) {
- drawmode= debug_swapbuffers_override;
- } else {
- drawmode= drawmode_default;
- }
-
- tempsa= curarea;
- areawinset(1);
-
- if (drawmode=='s') {
- screen_swapbuffers_SIMPLE(sc);
- } else if (drawmode=='d') {
- screen_swapbuffers_DEBUG(sc);
- } else if (drawmode=='f') {
- screen_swapbuffers_DEBUG_SWAP(sc);
- } else {
- screen_swapbuffers_REDRAW(sc);
- }
-
- areawinset(tempsa->win);
-}
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
deleted file mode 100644
index 804660c3433..00000000000
--- a/source/blender/src/toets.c
+++ /dev/null
@@ -1,1013 +0,0 @@
-/**
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
-
- *
- *
- * General blender hot keys (toets = dutch), special hotkeys are in space.c
- *
- */
-
-#include <string.h>
-#include <math.h>
-
-#ifdef WIN32
-#include "BLI_winstuff.h"
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "PIL_time.h"
-
-#include "nla.h" /* Only for the #ifdef flag - To be removed later */
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_blender.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_ipo.h"
-#include "BKE_key.h"
-#include "BKE_object.h"
-#include "BKE_pointcache.h"
-#include "BKE_scene.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_butspace.h"
-#include "BIF_editseq.h"
-#include "BIF_editsound.h"
-#include "BIF_editmesh.h"
-#include "BIF_imasel.h"
-#include "BIF_editparticle.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_poseobject.h"
-#include "BIF_previewrender.h"
-#include "BIF_renderwin.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toets.h"
-#include "BIF_toolbox.h"
-#include "BIF_usiblender.h"
-#include "BIF_writeimage.h"
-
-#include "BDR_sculptmode.h"
-#include "BDR_vpaint.h"
-#include "BDR_editobject.h"
-#include "BDR_editface.h"
-
-#include "BSE_filesel.h" /* For activate_fileselect */
-#include "BSE_drawview.h" /* For play_anim */
-#include "BSE_view.h"
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_seqaudio.h"
-
-#include "blendef.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "GPU_draw.h"
-
-#include "mydevice.h"
-
-#include "transform.h"
-
-#define VIEW_ZOOM_OUT_FACTOR (1.15f)
-#define VIEW_ZOOM_IN_FACTOR (1.0f/VIEW_ZOOM_OUT_FACTOR)
-
-/* ------------------------------------------------------------------------- */
-
-static int is_an_active_object(void *ob) {
- Base *base;
-
- for (base= FIRSTBASE; base; base= base->next)
- if (base->object == ob)
- return 1;
-
- return 0;
-}
-
-/* run when pressing 1,3 or 7 */
-static void axis_set_view(float q1, float q2, float q3, float q4, short view, int perspo)
-{
- float new_quat[4];
- new_quat[0]= q1; new_quat[1]= q2;
- new_quat[2]= q3; new_quat[3]= q4;
- G.vd->view=0;
-
- if (G.vd->persp==V3D_CAMOB && G.vd->camera) {
- /* Is this switching from a camera view ? */
- float orig_ofs[3];
- float orig_lens= G.vd->lens;
- VECCOPY(orig_ofs, G.vd->ofs);
- view_settings_from_ob(G.vd->camera, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens);
-
- if (U.uiflag & USER_AUTOPERSP) G.vd->persp= V3D_ORTHO;
- else if(G.vd->persp==V3D_CAMOB) G.vd->persp= perspo;
-
- smooth_view(G.vd, orig_ofs, new_quat, NULL, &orig_lens);
- } else {
-
- if (U.uiflag & USER_AUTOPERSP) G.vd->persp= V3D_ORTHO;
- else if(G.vd->persp==V3D_CAMOB) G.vd->persp= perspo;
-
- smooth_view(G.vd, NULL, new_quat, NULL, NULL);
- }
- G.vd->view= view;
-}
-
-void persptoetsen(unsigned short event)
-{
- static Object *oldcamera=0;
- float phi, si, q1[4], vec[3];
- static int perspo=V3D_PERSP;
- int preview3d_event= 1;
- short mouseloc[2];
-
- float new_dist, orig_ofs[3];
-
- /* Use this to test if we started out with a camera */
- Object *act_cam_orig=NULL;
- if (G.vd->persp == V3D_CAMOB)
- act_cam_orig = G.vd->camera;
-
- if(event==PADENTER) {
- if (G.qual == LR_SHIFTKEY) {
- view3d_set_1_to_1_viewborder(G.vd);
- } else {
- if (G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom= 0;
- } else {
- new_dist = 10.0;
- smooth_view(G.vd, NULL, NULL, &new_dist, NULL);
- }
- }
- }
- else if((G.qual & (LR_SHIFTKEY | LR_CTRLKEY)) && (event != PAD0)) {
-
- /* Indicate that this view is inverted,
- * but only if it actually _was_ inverted (jobbe) */
- if (event==PAD7 || event == PAD1 || event == PAD3)
- G.vd->flag2 |= V3D_OPP_DIRECTION_NAME;
-
- if(event==PAD0) {
- /* G.vd->persp= 3; */
- }
- else if(event==PAD7) {
- axis_set_view(0.0, -1.0, 0.0, 0.0, 7, perspo);
- }
- else if(event==PAD1) {
- axis_set_view(0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0), 1, perspo);
- }
- else if(event==PAD3) {
- axis_set_view(0.5, -0.5, 0.5, 0.5, 3, perspo);
- }
- else if(event==PADMINUS) {
- /* this min and max is also in viewmove() */
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom-= 10;
- if(G.vd->camzoom<-30) G.vd->camzoom= -30;
- }
- else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f;
- }
- else if(event==PADPLUSKEY) {
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom+= 10;
- if(G.vd->camzoom>300) G.vd->camzoom= 300;
- }
- else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f;
- }
- else {
-
- initgrabz(0.0, 0.0, 0.0);
-
- if(event==PAD6) window_to_3d(vec, -32, 0);
- else if(event==PAD4) window_to_3d(vec, 32, 0);
- else if(event==PAD8) window_to_3d(vec, 0, -25);
- else if(event==PAD2) window_to_3d(vec, 0, 25);
- G.vd->ofs[0]+= vec[0];
- G.vd->ofs[1]+= vec[1];
- G.vd->ofs[2]+= vec[2];
- }
- }
- else {
- /* Indicate that this view is not inverted.
- * Don't do this for PADMINUS/PADPLUSKEY/PAD5, though. (jobbe)*/
- if (! ELEM3(event, PADMINUS, PADPLUSKEY, PAD5) )
- G.vd->flag2 &= ~V3D_OPP_DIRECTION_NAME;
-
-
- if(event==PAD7) {
- axis_set_view(1.0, 0.0, 0.0, 0.0, 7, perspo);
- }
- else if(event==PAD1) {
- axis_set_view((float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0, 1, perspo);
- }
- else if(event==PAD3) {
- axis_set_view(0.5, -0.5, -0.5, -0.5, 3, perspo);
- }
- else if(event==PADMINUS) {
- /* this min and max is also in viewmove() */
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom= MAX2(-30, G.vd->camzoom-5);
- }
- else if(G.vd->dist<10.0*G.vd->far) {
- getmouseco_areawin(mouseloc);
- view_zoom_mouseloc(VIEW_ZOOM_OUT_FACTOR, mouseloc);
- }
- if(G.vd->persp!=V3D_PERSP) preview3d_event= 0;
- }
- else if(event==PADPLUSKEY) {
- if(G.vd->persp==V3D_CAMOB) {
- G.vd->camzoom= MIN2(300, G.vd->camzoom+5);
- }
- else if(G.vd->dist> 0.001*G.vd->grid) {
- getmouseco_areawin(mouseloc);
- view_zoom_mouseloc(VIEW_ZOOM_IN_FACTOR, mouseloc);
- }
- if(G.vd->persp!=V3D_PERSP) preview3d_event= 0;
- }
- else if(event==PAD5) {
- if (U.smooth_viewtx) {
- if(G.vd->persp==V3D_PERSP) { G.vd->persp=V3D_ORTHO;
- } else if (act_cam_orig) {
- /* were from a camera view */
- float orig_dist= G.vd->dist;
- float orig_lens= G.vd->lens;
- VECCOPY(orig_ofs, G.vd->ofs);
-
- G.vd->persp=V3D_PERSP;
- G.vd->dist= 0.0;
-
- view_settings_from_ob(act_cam_orig, G.vd->ofs, NULL, NULL, &G.vd->lens);
-
- smooth_view(G.vd, orig_ofs, NULL, &orig_dist, &orig_lens);
-
- } else {
- G.vd->persp=V3D_PERSP;
- }
- } else {
- if(G.vd->persp==V3D_PERSP) G.vd->persp=V3D_ORTHO;
- else G.vd->persp=V3D_PERSP;
- }
- }
- else if(event==PAD0) {
- /* lastview - */
- if(G.vd->persp != V3D_CAMOB) {
- /* store settings of current view before allowing overwriting with camera view */
- QUATCOPY(G.vd->lviewquat, G.vd->viewquat);
- G.vd->lview= G.vd->view;
- G.vd->lpersp= G.vd->persp;
- }
- else {
- /* return to settings of last view */
- axis_set_view(G.vd->lviewquat[0], G.vd->lviewquat[1], G.vd->lviewquat[2], G.vd->lviewquat[3], G.vd->lview, G.vd->lpersp);
- }
-
- if(G.qual==LR_ALTKEY) {
- if(oldcamera && is_an_active_object(oldcamera)) {
- G.vd->camera= oldcamera;
- }
- handle_view3d_lock();
- }
- else if(BASACT) {
- /* check both G.vd as G.scene cameras */
- if(G.qual==LR_CTRLKEY) {
- if(G.vd->camera != OBACT || G.scene->camera != OBACT) {
- if(G.vd->camera && G.vd->camera->type==OB_CAMERA)
- oldcamera= G.vd->camera;
-
- G.vd->camera= OBACT;
- handle_view3d_lock();
- }
- }
- else if((G.vd->camera==NULL || G.scene->camera==NULL) && OBACT->type==OB_CAMERA) {
- G.vd->camera= OBACT;
- handle_view3d_lock();
- }
- }
-
- if(G.vd->camera==0) {
- G.vd->camera= scene_find_camera(G.scene);
- handle_view3d_lock();
- }
-
- if(G.vd->camera && (G.vd->camera != act_cam_orig)) {
- G.vd->persp= V3D_CAMOB;
- G.vd->view= 0;
-
- if(((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) || (G.qual & LR_SHIFTKEY)) {
- void setcameratoview3d(void); // view.c
- setcameratoview3d();
- autokeyframe_ob_cb_func(G.scene->camera, TFM_TRANSLATION|TFM_ROTATION);
- DAG_object_flush_update(G.scene, G.scene->camera, OB_RECALC_OB);
- BIF_undo_push("View to Camera position");
- allqueue(REDRAWVIEW3D, 0);
-
- } else if (U.smooth_viewtx) {
- /* move 3d view to camera view */
- float orig_lens = G.vd->lens;
- VECCOPY(orig_ofs, G.vd->ofs);
-
- if (act_cam_orig)
- view_settings_from_ob(act_cam_orig, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens);
-
- smooth_view_to_camera(G.vd);
- VECCOPY(G.vd->ofs, orig_ofs);
- G.vd->lens = orig_lens;
- }
- }
- }
- else if(event==PAD9) {
- countall();
- update_for_newframe();
-
- reset_slowparents(); /* editobject.c */
- }
- else if(G.vd->persp != V3D_CAMOB) {
- if(event==PAD4 || event==PAD6) {
- /* z-axis */
- phi= (float)(M_PI/360.0)*U.pad_rot_angle;
- if(event==PAD6) phi= -phi;
- si= (float)sin(phi);
- q1[0]= (float)cos(phi);
- q1[1]= q1[2]= 0.0;
- q1[3]= si;
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
- G.vd->view= 0;
- }
- if(event==PAD2 || event==PAD8) {
- /* horizontal axis */
- VECCOPY(q1+1, G.vd->viewinv[0]);
-
- Normalize(q1+1);
- phi= (float)(M_PI/360.0)*U.pad_rot_angle;
- if(event==PAD2) phi= -phi;
- si= (float)sin(phi);
- q1[0]= (float)cos(phi);
- q1[1]*= si;
- q1[2]*= si;
- q1[3]*= si;
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
- G.vd->view= 0;
- }
- }
-
- if(G.vd->persp != V3D_CAMOB) perspo= G.vd->persp;
- }
-
- if(G.vd->depths) G.vd->depths->damaged= 1;
- retopo_queue_updates(G.vd);
-
- if(preview3d_event)
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
- else
- BIF_view3d_previewrender_signal(curarea, PR_PROJECTED);
-
- scrarea_queue_redraw(curarea);
-}
-
-int untitled(char * name)
-{
- if (G.save_over == 0 ) {
- char * c= BLI_last_slash(name);
-
- if (c)
- strcpy(&c[1], "untitled.blend");
- else
- strcpy(name, "untitled.blend");
-
- return(TRUE);
- }
-
- return(FALSE);
-}
-
-char *recent_filelist(void)
-{
- struct RecentFile *recent;
- int event, i, ofs;
- char pup[2048], *p;
-
- p= pup + sprintf(pup, "Open Recent%%t");
-
- if (G.sce[0]) {
- p+= sprintf(p, "|%s %%x%d", G.sce, 1);
- ofs = 1;
- } else ofs = 0;
-
- for (recent = G.recent_files.first, i=0; (i<U.recent_files) && (recent); recent = recent->next, i++) {
- if (strcmp(recent->filename, G.sce)) {
- p+= sprintf(p, "|%s %%x%d", recent->filename, i+ofs+1);
- }
- }
- event= pupmenu(pup);
- if(event>0) {
- if (ofs && (event==1))
- return(G.sce);
- else
- recent = BLI_findlink(&(G.recent_files), event-1-ofs);
- if(recent) return(recent->filename);
- }
-
- return(NULL);
-}
-
-int blenderqread(unsigned short event, short val)
-{
- /* here do the general keys handling (not screen/window/space) */
- /* return 0: do not pass on to the other queues */
- extern int textediting;
- extern void playback_anim();
- ScrArea *sa;
- Object *ob;
- int textspace=0;
- /* Changed str and dir size to 160, to make sure there is enough
- * space for filenames. */
- char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2];
- char *recentfile;
-
- if(val==0) return 1;
- if(event==MOUSEY || event==MOUSEX) return 1;
- if (G.flags & G_FILE_AUTOPLAY) return 1;
-
- if (curarea && curarea->spacetype==SPACE_TEXT) textspace= 1;
- else if (curarea && curarea->spacetype==SPACE_SCRIPT) textspace= 1;
-
- switch(event) {
-
- case F1KEY:
- if(G.qual==0) {
- /* this exception because of the '?' button */
- if(curarea->spacetype==SPACE_INFO) {
- sa= closest_bigger_area();
- areawinset(sa->win);
- }
-
- activate_fileselect(FILE_BLENDER, "Open File", G.sce, BIF_read_file);
- return 0;
- }
- else if(G.qual==LR_SHIFTKEY) {
- activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0);
- return 0;
- }
- else if(G.qual==LR_CTRLKEY) {
- activate_imageselect(FILE_LOADLIB, "Load Library", G.lib, 0);
- return 0;
- }
- break;
- case F2KEY:
- if(G.qual==0) {
- strcpy(dir, G.sce);
- untitled(dir);
- activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
- return 0;
- }
- else if(G.qual==LR_CTRLKEY) {
- write_vrml_fs();
- return 0;
- }
- else if(G.qual==LR_SHIFTKEY) {
- write_dxf_fs();
- return 0;
- }
- break;
- case F3KEY:
- if(G.qual==0) {
- BIF_save_rendered_image_fs();
- return 0;
- }
- else if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_NODE);
- return 0;
- }
- else if(G.qual & LR_CTRLKEY) {
- BIF_screendump(0);
- }
- break;
- case F4KEY:
- if(G.qual==LR_SHIFTKEY) {
-
- memset(str, 0, 16);
- ob= OBACT;
- if(ob) strcpy(str, ob->id.name);
-
- activate_fileselect(FILE_MAIN, "Data Select", str, NULL);
- return 0;
- }
- else if(G.qual==LR_CTRLKEY) {
-
- memset(str, 0, 16);
- ob= OBACT;
- if(ob) strcpy(str, ob->id.name);
-
- activate_imageselect(FILE_MAIN, "Data Select", str, 0);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F5KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_VIEW3D);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F6KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_IPO);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F7KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_BUTS);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F8KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_SEQ);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F9KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_OOPS);
- return 0;
- }
- else if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)) {
- newspace(curarea, SPACE_OOPS+256);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F10KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_IMAGE);
- return 0;
- }
- else if(G.qual==0) {
- extern_set_butspace(event, 1);
- }
- break;
- case F11KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_TEXT);
- return 0;
- }
- else if (G.qual==LR_CTRLKEY) {
- playback_anim();
- }
- else if(G.qual==0) {
- BIF_toggle_render_display();
- return 0;
- }
- break;
- case F12KEY:
- if(G.qual==LR_SHIFTKEY) {
- newspace(curarea, SPACE_ACTION);
- return 0;
- }
- else if (G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
- newspace(curarea, SPACE_NLA);
- return 0;
- }
- else if (G.qual==LR_CTRLKEY) {
- BIF_do_render(1);
- }
- else {
- /* ctrl/alt + f12 should render too, for some macs have f12 assigned to cd eject */
- BIF_do_render(0);
- }
- return 0;
- break;
-
- case WHEELUPMOUSE:
- if(G.qual==LR_ALTKEY || G.qual==LR_COMMANDKEY) {
- if(CFRA>1) {
- CFRA--;
- update_for_newframe();
- }
- return 0;
- }
- break;
- case WHEELDOWNMOUSE:
- if(G.qual==LR_ALTKEY || G.qual==LR_COMMANDKEY) {
- CFRA++;
- update_for_newframe();
- return 0;
- }
- break;
-
- case LEFTARROWKEY:
- case DOWNARROWKEY:
- if(textediting==0 && textspace==0) {
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
- if(event==DOWNARROWKEY){
- if (G.qual==LR_ALTKEY)
- mainwindow_toggle_fullscreen(0);
- else if(G.qual==0)
- CFRA-= G.scene->jumpframe;
- }
-#else
- if((event==DOWNARROWKEY)&&(G.qual==0))
- CFRA-= G.scene->jumpframe;
-#endif
- else if((event==LEFTARROWKEY)&&(G.qual==0))
- CFRA--;
-
- if(G.qual==LR_SHIFTKEY)
- CFRA= PSFRA;
- if(CFRA<1) CFRA=1;
-
- update_for_newframe();
- return 0;
- }
- break;
-
- case RIGHTARROWKEY:
- case UPARROWKEY:
- if(textediting==0 && textspace==0) {
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
- if(event==UPARROWKEY){
- if(G.qual==LR_ALTKEY)
- mainwindow_toggle_fullscreen(1);
- else if(G.qual==0)
- CFRA+= G.scene->jumpframe;
- }
-#else
- if((event==UPARROWKEY)&&(G.qual==0))
- CFRA+= G.scene->jumpframe;
-#endif
- else if((event==RIGHTARROWKEY)&&(G.qual==0))
- CFRA++;
-
- if(G.qual==LR_SHIFTKEY)
- CFRA= PEFRA;
-
- update_for_newframe();
- }
- break;
-
- case ESCKEY:
- sound_stop_all_sounds(); // whats this?
-
- /* stop playback on ESC always */
- rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM);
- audiostream_stop();
- BKE_ptcache_set_continue_physics(0);
- allqueue(REDRAWALL, 0);
-
- break;
- case TABKEY:
- if(G.qual==0) {
- if(textspace==0) {
- if(curarea->spacetype==SPACE_IPO)
- set_editflag_editipo();
- else if(curarea->spacetype==SPACE_SEQ)
- enter_meta();
- else if(curarea->spacetype==SPACE_NODE)
- return 1;
- else if(G.vd) {
- /* also when Alt-E */
- if(G.obedit==NULL) {
- enter_editmode(EM_WAITCURSOR);
- if(G.obedit) BIF_undo_push("Original"); // here, because all over code enter_editmode is abused
- }
- else
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo
- }
- return 0;
- }
- }
- else if(G.qual==LR_CTRLKEY){
- Object *ob= OBACT;
- if(ob) {
- if(ob->type==OB_ARMATURE) {
- if(ob->flag & OB_POSEMODE) exit_posemode();
- else enter_posemode();
- }
- else if(ob->type==OB_MESH) {
- if(ob==G.obedit) EM_selectmode_menu();
- else if(G.f & G_PARTICLEEDIT)
- PE_selectbrush_menu();
- else if(G.f & G_SCULPTMODE)
- sculptmode_selectbrush_menu();
- else set_wpaint();
- }
- }
- }
- else if(G.qual&LR_CTRLKEY && G.qual&LR_SHIFTKEY){
- if(!(G.f & G_PARTICLEEDIT))
- exit_paint_modes();
- PE_set_particle_edit();
- }
- break;
-
- case BACKSPACEKEY:
- break;
- case SPACEKEY:
- if (curarea && curarea->spacetype==SPACE_SEQ) {
- SpaceSeq *sseq= curarea->spacedata.first;
- if (G.qual==0 && sseq->mainb) {
- play_anim(1);
- return 0;
- }
- }
- break;
- case AKEY:
- if(textediting==0 && textspace==0) {
- if ((G.qual==LR_ALTKEY) && (curarea && curarea->spacetype==SPACE_VIEW3D)) {
- play_anim(0);
- return 0;
- }
- else if ((G.qual==LR_ALTKEY) || (G.qual==(LR_ALTKEY|LR_SHIFTKEY))){
- play_anim(1);
- return 0;
- }
- }
- break;
- case EKEY:
- if(G.qual==LR_ALTKEY) {
- if(G.vd && textspace==0) {
- if(G.obedit==0) {
- enter_editmode(EM_WAITCURSOR);
- BIF_undo_push("Original");
- }
- else
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo
- return 0;
- }
- }
- break;
- case IKEY:
- if(textediting==0 && textspace==0 && !ELEM3(curarea->spacetype, SPACE_FILE, SPACE_IMASEL, SPACE_NODE)) {
- ob= OBACT;
-
- if(G.f & G_SCULPTMODE) return 1;
- else if(G.qual==LR_ALTKEY) {
- common_deletekey();
- return 0;
- }
- else if(G.qual==0) {
- common_insertkey();
- return 0;
- }
- }
- break;
- case JKEY:
- if(textediting==0 && textspace==0) {
- if (G.qual==0) {
- BIF_swap_render_rects();
- return 0;
- }
- }
- break;
-
- case NKEY:
- if(textediting==0 && textspace==0) {
- if(G.qual & LR_CTRLKEY);
- else if(G.qual==0 || (G.qual & LR_SHIFTKEY)) {
- if(curarea->spacetype==SPACE_VIEW3D); // is new panel, in view3d queue
- else if(curarea->spacetype==SPACE_IPO); // is new panel, in ipo queue
- else if(curarea->spacetype==SPACE_IMAGE); // is new panel, in ipo queue
- else if(curarea->spacetype==SPACE_ACTION); // is own queue
- else if(curarea->spacetype==SPACE_NLA); // is new panel
- else if(curarea->spacetype==SPACE_SEQ); // is new panel
- else {
- clever_numbuts();
- return 0;
- }
- }
- }
- break;
-
- case OKEY:
- if(textediting==0) {
- if(G.qual==LR_CTRLKEY) {
- recentfile = recent_filelist();
- if(recentfile) {
- BIF_read_file(recentfile);
- }
- return 0;
- }
- }
- break;
-
- case SKEY:
- if(G.obedit==NULL) {
- if(G.qual==LR_CTRLKEY) {
- strcpy(dir, G.sce);
- if (untitled(dir)) {
- activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
- } else {
- BIF_write_file(dir);
- free_filesel_spec(dir);
- }
- return 0;
- }
- }
- break;
-
- case TKEY:
- if (G.qual==(LR_SHIFTKEY|LR_ALTKEY|LR_CTRLKEY)) {
- Object *ob = OBACT;
- int event = pupmenu(ob?"Time%t|draw|recalc ob|recalc data":"Time%t|draw");
- int a;
- double delta, stime;
-
- if (event < 0) return 0; /* cancelled by user */
-
- waitcursor(1);
-
- stime= PIL_check_seconds_timer();
- for(a=0; a<100000; a++) {
- if (event==1) {
- scrarea_do_windraw(curarea);
- } else if (event==2) {
- ob->recalc |= OB_RECALC_OB;
- object_handle_update(ob);
- } else if (event==3) {
- ob->recalc |= OB_RECALC_DATA;
- object_handle_update(ob);
- }
-
- delta= PIL_check_seconds_timer()-stime;
- if (delta>5.0) break;
- }
-
- waitcursor(0);
- notice("%8.6f s/op - %6.2f ops/s - %d iterations", delta/a, a/delta, a);
- return 0;
- }
- else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) {
- int a;
- int event= pupmenu("10 Timer%t|draw|draw+swap|undo");
- if(event>0) {
- double stime= PIL_check_seconds_timer();
- char tmpstr[128];
- int time;
-
- waitcursor(1);
-
- for(a=0; a<10; a++) {
- if (event==1) {
- scrarea_do_windraw(curarea);
- } else if (event==2) {
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else if(event==3) {
- BIF_undo();
- BIF_redo();
- }
- }
-
- time= (int) ((PIL_check_seconds_timer()-stime)*1000);
-
- if(event==1) sprintf(tmpstr, "draw %%t|%d ms", time);
- if(event==2) sprintf(tmpstr, "d+sw %%t|%d ms", time);
- if(event==3) sprintf(tmpstr, "undo %%t|%d ms", time);
-
- waitcursor(0);
- pupmenu(tmpstr);
-
- }
- return 0;
- }
- break;
-
- case UKEY:
- if(textediting==0) {
- if(G.qual==LR_CTRLKEY) {
- if(okee("Save user defaults")) {
- BIF_write_homefile();
- }
- return 0;
- }
- else if(G.qual==LR_ALTKEY) {
- if(curarea->spacetype!=SPACE_TEXT) {
- BIF_undo_menu();
- return 0;
- }
- }
- }
- break;
-
- case WKEY:
- if(textediting==0) {
- if(G.qual==LR_CTRLKEY) {
- strcpy(dir, G.sce);
- if (untitled(dir)) {
- activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file);
- } else {
- BIF_write_file(dir);
- free_filesel_spec(dir);
- }
- return 0;
- }
- /* Python specials? ;)
- else if(G.qual==LR_ALTKEY) {
- write_videoscape_fs();
- return 0;
- }*/
- }
- break;
-
- case XKEY:
- if(textspace==0 && textediting==0) {
- if(G.qual==LR_CTRLKEY) {
- if(okee("Erase all")) {
- if( BIF_read_homefile(0)==0) error("No file ~/.B.blend");
-
- /* Reset lights
- * This isn't done when reading userdef, do it now
- * */
- GPU_default_lights();
- }
- return 0;
- }
- }
- break;
- case YKEY: // redo alternative
- if(textspace==0) {
- if(G.qual==LR_CTRLKEY) {
- BIF_redo();
- return 0;
- }
- }
- break;
- case ZKEY: // undo
- if(textspace==0) {
- if(G.qual & (LR_CTRLKEY|LR_COMMANDKEY)) { // all combos with ctrl/commandkey are accepted
- if ELEM(G.qual, LR_CTRLKEY, LR_COMMANDKEY) BIF_undo();
- else BIF_redo(); // all combos with ctrl is redo
- return 0;
- }
- }
- break;
- }
-
- return 1;
-}
-
-/* eof */
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
deleted file mode 100644
index b675f6868f8..00000000000
--- a/source/blender/src/toolbox.c
+++ /dev/null
@@ -1,2393 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#define PY_TOOLBOX 1
-
-#include <math.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include <fcntl.h>
-#include "MEM_guardedalloc.h"
-
-#include "BMF_Api.h"
-#include "BIF_language.h"
-#include "BIF_resources.h"
-
-#include "DNA_group_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_camera_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "BKE_displist.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_main.h"
-#include "BKE_plugin_types.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editnla.h"
-#include "BIF_editarmature.h"
-#include "BIF_editdeform.h"
-#include "BIF_editfont.h"
-#include "BIF_editmesh.h"
-#include "BIF_editseq.h"
-#include "BIF_editlattice.h"
-#include "BIF_editsima.h"
-#include "BIF_editoops.h"
-#include "BIF_editview.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_imasel.h"
-#include "BIF_interface.h"
-#include "BIF_keyframing.h"
-#include "BIF_mainqueue.h"
-#include "BIF_mywindow.h"
-#include "BIF_renderwin.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_tbcallback.h"
-#include "BIF_transform.h"
-
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_editmball.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-
-#include "IMB_imbuf.h"
-
-#include "blendef.h"
-#include "butspace.h"
-#include "mydevice.h"
-
-/* bpymenu */
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#include "BPY_menus.h"
-#endif
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-void asciitoraw(int ch, unsigned short *event, unsigned short *qual)
-{
- if( isupper(ch) ) {
- *qual= LEFTSHIFTKEY;
- ch= tolower(ch);
- }
-
- switch(ch) {
- case 'a': *event= AKEY; break;
- case 'b': *event= BKEY; break;
- case 'c': *event= CKEY; break;
- case 'd': *event= DKEY; break;
- case 'e': *event= EKEY; break;
- case 'f': *event= FKEY; break;
- case 'g': *event= GKEY; break;
- case 'h': *event= HKEY; break;
- case 'i': *event= IKEY; break;
- case 'j': *event= JKEY; break;
- case 'k': *event= KKEY; break;
- case 'l': *event= LKEY; break;
- case 'm': *event= MKEY; break;
- case 'n': *event= NKEY; break;
- case 'o': *event= OKEY; break;
- case 'p': *event= PKEY; break;
- case 'q': *event= QKEY; break;
- case 'r': *event= RKEY; break;
- case 's': *event= SKEY; break;
- case 't': *event= TKEY; break;
- case 'u': *event= UKEY; break;
- case 'v': *event= VKEY; break;
- case 'w': *event= WKEY; break;
- case 'x': *event= XKEY; break;
- case 'y': *event= YKEY; break;
- case 'z': *event= ZKEY; break;
- }
-}
-
-/* ************************************ */
-
-/* this va_ stuff allows printf() style codes in these menus */
-
-static int vconfirm(char *title, char *itemfmt, va_list ap)
-{
- char *s, buf[512];
-
- s= buf;
- if (title) s+= sprintf(s, "%s%%t|", title);
- vsprintf(s, itemfmt, ap);
-
- return (pupmenu(buf)>=0);
-}
-
-static int confirm(char *title, char *itemfmt, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, itemfmt);
- ret= vconfirm(title, itemfmt, ap);
- va_end(ap);
-
- return ret;
-}
-
-int okee(char *str, ...)
-{
- va_list ap;
- int ret;
- char titlestr[256];
-
- sprintf(titlestr, "OK? %%i%d", ICON_HELP);
-
- va_start(ap, str);
- ret= vconfirm(titlestr, str, ap);
- va_end(ap);
-
- return ret;
-}
-
-void notice(char *str, ...)
-{
- va_list ap;
-
- va_start(ap, str);
- vconfirm(NULL, str, ap);
- va_end(ap);
-}
-
-void error(char *fmt, ...)
-{
- va_list ap;
- char nfmt[256];
- char titlestr[256];
-
- sprintf(titlestr, "Error %%i%d", ICON_ERROR);
-
- sprintf(nfmt, "%s", fmt);
-
- va_start(ap, fmt);
- if (G.background || !G.curscreen) {
- vprintf(nfmt, ap);
- printf("\n");
- } else {
- vconfirm(titlestr, nfmt, ap);
- }
- va_end(ap);
-}
-
-void error_libdata(void)
-{
- error(ERROR_LIBDATA_MESSAGE);
-}
-
-int saveover(char *file)
-{
- size_t len= strlen(file);
-
- if(len==0)
- return 0;
-
- if(BLI_exists(file)==0)
- return 1;
-
- if( file[len-1]=='/' || file[len-1]=='\\' ) {
- error("Cannot overwrite a directory");
- return 0;
- }
-
- return confirm("Save over", file);
-}
-
-/* ****************** EXTRA STUFF **************** */
-
-short button(short *var, short min, short max, char *str)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- short x1,y1;
- short mval[2], ret=0;
-
- if(min>max) min= max;
-
- getmouseco_sc(mval);
-
- if(mval[0]<150) mval[0]=150;
- if(mval[1]<30) mval[1]=30;
- if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
- if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
-
- x1=mval[0]-150;
- y1=mval[1]-20;
-
- uiDefButS(block, NUM, 0, str, (short)(x1+5),(short)(y1+10),125,20, var,(float)min,(float)max, 0, 0, "");
- uiDefBut(block, BUT, 32767, "OK", (short)(x1+136),(short)(y1+10),25,20, NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 5);
-
- ret= uiDoBlocks(&listb, 0, 0);
-
- if(ret==UI_RETURN_OK) return 1;
- return 0;
-}
-
-short sbutton(char *var, short min, short max, char *str)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- short x1,y1;
- short mval[2], ret=0;
- char *editvar = NULL; /* dont edit the original text, incase we cancel the popup */
-
- if(min>max) min= max;
-
- getmouseco_sc(mval);
-
- if(mval[0]<250) mval[0]=250;
- if(mval[1]<30) mval[1]=30;
- if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
- if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
-
- x1=mval[0]-250;
- y1=mval[1]-20;
-
- editvar = MEM_callocN(max+1, "sbutton");
- BLI_strncpy(editvar, var, max);
-
- uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, editvar,(float)min,(float)max, 0, 0, "");
- uiDefBut(block, BUT, 32767, "OK", x1+236,y1+10,25,20, NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 5);
-
- mainqenter_ext(BUT_ACTIVATE, 32766, 0); /* note, button id '32766' is asking for errors some day! */
- ret= uiDoBlocks(&listb, 0, 0);
-
- if(ret==UI_RETURN_OK) {
- BLI_strncpy(var, editvar, max);
- MEM_freeN(editvar);
- return 1;
- }
- MEM_freeN(editvar);
- return 0;
-
-}
-
-short fbutton(float *var, float min, float max, float a1, float a2, char *str)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- short x1,y1;
- short mval[2], ret=0;
-
- if(min>max) min= max;
-
- getmouseco_sc(mval);
-
- if(mval[0]<150) mval[0]=150;
- if(mval[1]<30) mval[1]=30;
- if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
- if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
-
- x1=mval[0]-150;
- y1=mval[1]-20;
-
- uiDefButF(block, NUM, 0, str,(short)(x1+5),(short)(y1+10),125,20, var, min, max, a1, a2, "");
- uiDefBut(block, BUT, 32767, "OK",(short)(x1+136),(short)(y1+10), 35, 20, NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 2);
-
- ret= uiDoBlocks(&listb, 0, 0);
-
- if(ret==UI_RETURN_OK) return 1;
- return 0;
-}
-
-int movetolayer_buts(unsigned int *lay, char *title)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- int dx, dy, a, x1, y1, sizex=160, sizey=30;
- short pivot[2], mval[2], ret=0;
-
- if(G.vd->localview) {
- error("Not in localview ");
- return ret;
- }
-
- getmouseco_sc(mval);
-
- pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30);
- pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10);
-
- if (pivot[0]!=mval[0] || pivot[1]!=mval[1])
- warp_pointer(pivot[0], pivot[1]);
-
- mywinset(G.curscreen->mainwin);
-
- x1= pivot[0]-sizex+10;
- y1= pivot[1]-sizey/2;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
-
- dx= (sizex-5)/12;
- dy= sizey/2;
-
- if(title)
- uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, "");
-
- /* buttons have 0 as return event, to prevent menu to close on hotkeys */
- uiBlockBeginAlign(block);
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
- for(a=0; a<5; a++)
- uiDefButBitI(block, TOGR, 1<<(a+10), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
- x1+= 5;
-
- uiBlockBeginAlign(block);
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
- for(a=5; a<10; a++)
- uiDefButBitI(block, TOGR, 1<<(a+10), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
- uiBlockEndAlign(block);
-
- x1-= 5;
- uiDefBut(block, BUT, 32767, "OK", (short)(x1+10*dx+10), (short)y1, (short)(3*dx), (short)(2*dy), NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 2);
-
- ret= uiDoBlocks(&listb, 0, 0);
-
- if(ret==UI_RETURN_OK) return 1;
- return 0;
-}
-
-/* armature or bone */
-int movetolayer_short_buts(short *lay, char *title)
-{
- uiBlock *block;
- ListBase listb={0, 0};
- int dx, dy, a, x1, y1, sizex=120, sizey=30;
- short pivot[2], mval[2], ret=0;
-
- getmouseco_sc(mval);
-
- pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30);
- pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10);
-
- if (pivot[0]!=mval[0] || pivot[1]!=mval[1])
- warp_pointer(pivot[0], pivot[1]);
-
- mywinset(G.curscreen->mainwin);
-
- x1= pivot[0]-sizex+10;
- y1= pivot[1]-sizey/2;
-
- block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
-
- dx= (sizex-5)/10;
- dy= sizey/2;
-
- if(title)
- uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, "");
-
- /* buttons have 0 as return event, to prevent menu to close on hotkeys */
- uiBlockBeginAlign(block);
- for(a=0; a<8; a++)
- uiDefButBitS(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, lay, 0, 0, 0, 0, "");
- for(a=0; a<8; a++)
- uiDefButBitS(block, TOGR, 1<<(a+8), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, lay, 0, 0, 0, 0, "");
-
- uiBlockEndAlign(block);
-
- x1-= 5;
- uiDefBut(block, BUT, 32767, "OK", (short)(x1+8*dx+10), (short)y1, (short)(3*dx), (short)(2*dy), NULL, 0, 0, 0, 0, "");
-
- uiBoundsBlock(block, 2);
-
- ret= uiDoBlocks(&listb, 0, 0);
-
- if(ret==UI_RETURN_OK) return 1;
- return 0;
-}
-
-
-/* ********************** CLEVER_NUMBUTS ******************** */
-
-#define MAXNUMBUTS 120
-#define MAXNUMBUTROWS 8
-
-VarStruct numbuts[MAXNUMBUTS];
-void *numbpoin[MAXNUMBUTS];
-int numbdata[MAXNUMBUTS];
-
-void draw_numbuts_tip(char *str, int x1, int y1, int x2, int y2)
-{
- static char *last=0; /* avoid ugly updates! */
- int temp;
-
- if(str==last) return;
- last= str;
- if(str==0) return;
-
- glColor3ub(160, 160, 160); /* MGREY */
- glRecti(x1+4, y2-36, x2-4, y2-16);
-
- cpack(0x0);
-
- temp= 0;
- while( BIF_GetStringWidth(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS))>(x2 - x1-24)) temp++;
- glRasterPos2i(x1+16, y2-30);
- BIF_DrawString(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS));
-}
-
-int do_clever_numbuts(char *name, int tot, int winevent)
-{
- ListBase listb= {NULL, NULL};
- uiBlock *block;
- VarStruct *varstr;
- int a, sizex, sizey, x1, y2, width, colunms=1, xi=0, yi=0;
- short mval[2], event;
-
- /* Clear all events so tooltips work, this is not ideal and
- only needed because calls from the menu still have some events
- left over when do_clever_numbuts is called.
- Calls from keyshortcuts do not have this problem.*/
- ScrArea *sa;
- BWinEvent temp_bevt;
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- if(sa->win) {
- while( bwin_qread( sa->win, &temp_bevt ) ) {}
- }
- if(sa->headwin) {
- while( bwin_qread( sa->headwin, &temp_bevt ) ) {}
- }
- }
- /* Done clearing events */
-
- if(tot<=0 || tot>MAXNUMBUTS) return 0;
-
- /* if we have too many buttons then have more then 1 column */
- colunms= (int)ceil((double)tot / (double)MAXNUMBUTROWS);
-
- getmouseco_sc(mval);
-
- /* size */
- sizex= 175;
- sizey= 30+20*(MIN2(MAXNUMBUTROWS, tot)+1);
- width= (sizex*colunms)+60;
-
- /* center */
- if(mval[0]<width/2) mval[0]=width/2;
- if(mval[1]<sizey/2) mval[1]=sizey/2;
- if(mval[0]>G.curscreen->sizex -width/2) mval[0]= G.curscreen->sizex -width/2;
- if(mval[1]>G.curscreen->sizey -sizey/2) mval[1]= G.curscreen->sizey -sizey/2;
-
- mywinset(G.curscreen->mainwin);
-
- x1= mval[0]-width/2;
- y2= mval[1]+sizey/2;
-
- block= uiNewBlock(&listb, "numbuts", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
-
- /* WATCH IT: TEX BUTTON EXCEPTION */
- /* WARNING: ONLY A SINGLE BIT-BUTTON POSSIBLE: WE WORK AT COPIED DATA! */
-
- BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */
-
- uiDefBut(block, LABEL, 0, name, (short)(x1+15), (short)(y2-35), (short)(width-60), 19, 0, 1.0, 0.0, 0, 0, "");
-
- /*
- if(name[0]=='A' && name[7]=='O') {
- y2 -= 20;
- uiDefBut(block, LABEL, 0, "Rotations in degrees!", (short)(x1+15), (short)(y2-35), (short)(sizex-60), 19, 0, 0.0, 0.0, 0, 0, "");
- }*/
-
- uiBlockBeginAlign(block);
- varstr= &numbuts[0];
- for(a=0; a<tot; a++, varstr++) {
-
- if(varstr->type==TEX) {
- uiDefBut(block, TEX, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
- } else if(varstr->type==COL) {
- uiDefButF(block, COL, 0, "",(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, "");
- } else {
- if(varstr->type==LABEL) {/* dont include the label when rounding the buttons */
- uiBlockEndAlign(block);
-
- /* using the tip for the name, this is incorrect lets us get around the 16 char limit of name */
- /* Changed from the line below to use the tip since the tip isnt used for a label */
- uiDefBut(block, varstr->type, 0, varstr->tip,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, "");
- } else {
- uiDefBut(block, varstr->type, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
- }
-
- if(varstr->type==LABEL)
- uiBlockBeginAlign(block);
- }
-
- /* move to the next column */
- yi++;
- if (yi>=MAXNUMBUTROWS) {
- yi=0;
- xi++;
- uiBlockEndAlign(block);
- uiBlockBeginAlign(block);
- }
- }
- uiBlockEndAlign(block);
-
- uiDefBut(block, BUT, 4000, "OK", (short)(x1+width-40),(short)(y2-35-20*MIN2(MAXNUMBUTROWS,a)), 25, (short)(sizey-50), 0, 0, 0, 0, 0, "OK: Assign Values");
-
- uiBoundsBlock(block, 5);
-
- event= uiDoBlocks(&listb, 0, 0);
-
- areawinset(curarea->win);
-
- if(event & UI_RETURN_OK) {
-
- varstr= &numbuts[0];
- for(a=0; a<tot; a++, varstr++) {
- if(varstr->type==TEX);
- else if ELEM( (varstr->type & BUTPOIN), FLO, INT ) memcpy(numbpoin[a], numbdata+a, 4);
- else if((varstr->type & BUTPOIN)==SHO ) *((short *)(numbpoin[a]))= *( (short *)(numbdata+a));
- }
-
- if(winevent) {
- ScrArea *sa;
-
- sa= G.curscreen->areabase.first;
- while(sa) {
- if(sa->spacetype==curarea->spacetype) addqueue(sa->win, winevent, 1);
- sa= sa->next;
- }
- }
-
- return 1;
- }
- return 0;
-}
-
-void add_numbut(int nr, int type, char *str, float min, float max, void *poin, char *tip)
-{
- int tip_max = sizeof(numbuts[nr].tip);
- int name_max = sizeof(numbuts[nr].name);
-
- if(nr >= MAXNUMBUTS || (nr < 0)) return;
-
- numbuts[nr].type= type;
-
- numbuts[nr].min= min;
- numbuts[nr].max= max;
-
- if (type==LABEL) {
- /* evil use it tooltip for the label string to get around the 16 char limit of "name" */
- if (str) {
- strncpy(numbuts[nr].tip, str, tip_max);
- numbuts[nr].tip[tip_max-1] = 0;
- } else {
- strcpy(numbuts[nr].tip, "");
- }
- } else {
- /* for all other types */
- if (str) {
- strncpy(numbuts[nr].name, str, name_max);
- numbuts[nr].name[name_max-1] = 0;
- } else {
- strcpy(numbuts[nr].name, "");
- }
- if (tip) {
- strncpy(numbuts[nr].tip, tip, tip_max);
- numbuts[nr].tip[tip_max-1] = 0;
- } else {
- strcpy(numbuts[nr].tip, "");
- }
- }
-
- /*WATCH: TEX BUTTON EXCEPTION */
-
- numbpoin[nr]= poin;
-
- if ELEM( (type & BUTPOIN), FLO, INT ) memcpy(numbdata+nr, poin, 4);
- if((type & BUTPOIN)==SHO ) *((short *)(numbdata+nr))= *( (short *)poin);
-
- /* if( strncmp(numbuts[nr].name, "Rot", 3)==0 ) {
- float *fp;
-
- fp= (float *)(numbdata+nr);
- fp[0]= 180.0*fp[0]/M_PI;
- } */
-
-}
-
-void clever_numbuts(void)
-{
-
- if(curarea->spacetype==SPACE_VIEW3D) {
- // panel now
- }
- else if(curarea->spacetype==SPACE_NLA){
- // panel now
- }
- else if(curarea->spacetype==SPACE_IPO) {
- // panel now
- }
- else if(curarea->spacetype==SPACE_SEQ) {
- // panel now
- }
- else if(curarea->spacetype==SPACE_IMAGE) {
- // panel now
- }
- else if(curarea->spacetype==SPACE_IMASEL) {
- clever_numbuts_imasel();
- }
- else if(curarea->spacetype==SPACE_OOPS) {
- clever_numbuts_oops();
- }
- else if(curarea->spacetype==SPACE_ACTION){
- // in its own queue
- }
- else if(curarea->spacetype==SPACE_FILE) {
- clever_numbuts_filesel();
- }
-}
-
-
-void replace_names_but(void)
-{
- Image *ima= G.main->image.first;
- short len, tot=0;
- char old[64], new[64], temp[80];
-
- strcpy(old, "/");
- strcpy(new, "/");
-
- add_numbut(0, TEX, "Old:", 0, 63, old, 0);
- add_numbut(1, TEX, "New:", 0, 63, new, 0);
-
- if (do_clever_numbuts("Replace image name", 2, REDRAW) ) {
-
- len= strlen(old);
-
- while(ima) {
-
- if(strncmp(old, ima->name, len)==0) {
-
- strcpy(temp, new);
- strcat(temp, ima->name+len);
- BLI_strncpy(ima->name, temp, sizeof(ima->name));
-
- BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
-
- tot++;
- }
-
- ima= ima->id.next;
- }
-
- notice("Replaced %d names", tot);
- }
-
-}
-
-
-/* ********************** NEW TOOLBOX ********************** */
-
-ListBase tb_listb= {NULL, NULL};
-
-#define TB_TAB 256
-#define TB_ALT 512
-#define TB_CTRL 1024
-#define TB_PAD 2048
-#define TB_SHIFT 4096
-
-static void tb_do_hotkey(void *arg, int event)
-{
- unsigned short i, key=0;
- unsigned short qual[] = { 0,0,0,0 };
-
- if(event & TB_CTRL) {
- qual[0] = LEFTCTRLKEY;
- event &= ~TB_CTRL;
- }
- if(event & TB_ALT) {
- qual[1] = LEFTALTKEY;
- event &= ~TB_ALT;
- }
- if(event & TB_SHIFT) {
- qual[2] = LEFTSHIFTKEY;
- event &= ~TB_SHIFT;
- }
-
- if(event & TB_TAB) key= TABKEY;
- else if(event & TB_PAD) {
- event &= ~TB_PAD;
- switch(event) {
- case '-': key= PADMINUS; break;
- case '+': key= PADPLUSKEY; break;
- case '0': key= PAD0; break;
- case '5': key= PAD5; break;
- case '/': key= PADSLASHKEY; break;
- case '.': key= PADPERIOD; break;
- case '*': key= PADASTERKEY; break;
- case 'h': key= HOMEKEY; break;
- case 'u': key= PAGEUPKEY; break;
- case 'd': key= PAGEDOWNKEY; break;
- }
- }
- else if (isalpha(event))
- asciitoraw(event, &key, &qual[3]);
- else if (event == '~')
- key = ACCENTGRAVEKEY;
-
- for (i=0;i<4;i++)
- {
- if(qual[i]) mainqenter(qual[i], 1);
- }
- mainqenter(key, 1);
- mainqenter(key, 0);
- mainqenter(EXECUTE, 1);
-
- for (i=0;i<4;i++)
- {
- if(qual[i]) mainqenter(qual[i], 0);
- }
-}
-
-/* *************Select ********** */
-
-static TBitem tb_object_select_layer1_5[]= {
-{ 0, "1", 1, NULL},
-{ 0, "2", 2, NULL},
-{ 0, "3", 3, NULL},
-{ 0, "4", 4, NULL},
-{ 0, "5", 5, NULL},
-{ -1, "", 0, do_view3d_select_object_layermenu}};
-
-static TBitem tb_object_select_layer6_10[]= {
-{ 0, "6", 6, NULL},
-{ 0, "7", 7, NULL},
-{ 0, "8", 8, NULL},
-{ 0, "9", 9, NULL},
-{ 0, "10", 10, NULL},
-{ -1, "", 0, do_view3d_select_object_layermenu}};
-
-static TBitem tb_object_select_layer11_15[]= {
-{ 0, "11", 11, NULL},
-{ 0, "12", 12, NULL},
-{ 0, "13", 13, NULL},
-{ 0, "14", 14, NULL},
-{ 0, "15", 15, NULL},
-{ -1, "", 0, do_view3d_select_object_layermenu}};
-
-static TBitem tb_object_select_layer16_20[]= {
-{ 0, "16", 16, NULL},
-{ 0, "17", 17, NULL},
-{ 0, "18", 18, NULL},
-{ 0, "19", 19, NULL},
-{ 0, "20", 20, NULL},
-{ -1, "", 0, do_view3d_select_object_layermenu}};
-
-static TBitem tb_object_select_layer[]= {
-{ 0, "Layers 1-5", 0, tb_object_select_layer1_5},
-{ 0, "Layers 6-10", 0, tb_object_select_layer6_10},
-{ 0, "Layers 11-15", 0, tb_object_select_layer11_15},
-{ 0, "Layers 16-20", 0, tb_object_select_layer16_20},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_object_select_type[]= {
-{ 0, "Mesh", 1, NULL},
-{ 0, "Curve", 2, NULL},
-{ 0, "Surface", 3, NULL},
-{ 0, "Meta", 4, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Armature", 5, NULL},
-{ 0, "Lattice", 6, NULL},
-{ 0, "Text", 7, NULL},
-{ 0, "Empty", 8, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Camera", 9, NULL},
-{ 0, "Lamp", 10, NULL},
-{ -1, "", 0, do_view3d_select_object_typemenu}};
-
-static TBitem tb_object_select_linked[]= {
-{ 0, "Object Ipo|Shift L, 1", 1, NULL},
-{ 0, "ObData|Shift L, 2", 2, NULL},
-{ 0, "Material|Shift L, 3", 3, NULL},
-{ 0, "Texture|Shift L, 4", 4, NULL},
-{ -1, "", 0, do_view3d_select_object_linkedmenu}};
-
-static TBitem tb_object_select_grouped[]= {
-{ 0, "Children|Shift G, 1", 1, NULL},
-{ 0, "Immediate Children|Shift G, 2", 2, NULL},
-{ 0, "Parent|Shift G, 3", 3, NULL},
-{ 0, "Siblings (Shared Parent)|Shift G, 4", 4, NULL},
-{ 0, "Objects of Same Type|Shift G, 5", 5, NULL},
-{ 0, "Objects on Shared Layers|Shift G, 6", 6, NULL},
-{ 0, "Objects in Same Group|Shift G, 7", 7, NULL},
-{ 0, "Object Hooks|Shift G, 8", 8, NULL},
-{ 0, "Object PassIndex|Shift G, 9", 9, NULL},
-{ 0, "Object Color|Shift G, 0", 9, NULL},
-{ 0, "Game Properties|Shift G, Alt+1", 9, NULL},
-{ -1, "", 0, do_view3d_select_object_groupedmenu}};
-
-static TBitem tb_object_select[]= {
-{ 0, "Border Select|B", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Select/Deselect All|A", 1, NULL},
-{ 0, "Inverse", 2, NULL},
-{ 0, "Random", 3, NULL},
-{ 0, "Select All by Layer", 0, tb_object_select_layer},
-{ 0, "Select All by Type", 0, tb_object_select_type},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Linked", 0, tb_object_select_linked},
-{ 0, "Grouped", 0, tb_object_select_grouped},
-{ -1, "", 0, do_view3d_select_objectmenu}};
-
-static TBitem tb_face_select[]= {
-{ 0, "Border Select|B", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Select/Deselect All|A", 2, NULL},
-{ 0, "Inverse", 3, NULL},
-{ 0, "Same UV", 4, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Linked Faces|Ctrl L", 5, NULL},
-{ -1, "", 0, do_view3d_select_faceselmenu}};
-
-static TBitem tb_mesh_select[]= {
-{ 0, "Border Select|B", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Select/Deselect All|A", 2, NULL},
-{ 0, "Inverse|Ctrl I", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Random...", 5, NULL},
-{ 0, "Non-Manifold|Shift Ctrl Alt M", 9, NULL},
-{ 0, "Sharp Edges|Shift Ctrl Alt S", 14, NULL},
-{ 0, "Linked Flat Faces|Shift Ctrl Alt F", 15, NULL},
-{ 0, "Triangles|Shift Ctrl Alt 3", 11, NULL},
-{ 0, "Quads|Shift Ctrl Alt 4", 12, NULL},
-{ 0, "Non-Triangles/Quads|Shift Ctrl Alt 5", 13, NULL},
-{ 0, "Similar to Selection|Shift G", 21, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "More|Ctrl NumPad +", 7, NULL},
-{ 0, "Less|Ctrl NumPad -", 8, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Linked Vertices|Ctrl L", 4, NULL},
-{ 0, "Vertex Path|W Alt 7", 16, NULL},
-{ 0, "Edge Loop|Ctrl E 6", 17, NULL},
-{ 0, "Edge Ring|Ctrl E 7", 18, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Loop to Region|Ctrl E 8", 19, NULL},
-{ 0, "Region to Loop|Ctrl E 9", 20, NULL},
-{ -1, "", 0, do_view3d_select_meshmenu}};
-
-
-static TBitem tb_curve_select[]= {
-{ 0, "Border Select|B", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "(De)select All|A", 2, NULL},
-{ 0, "Inverse", 3, NULL},
-{ 0, "Random...", 13, NULL},
-{ 0, "Every Nth", 14, NULL},
-{ 0, "Row|Shift R", 5, NULL}, /* shouldn't be visible in case of bezier curves*/
-{ 0, "SEPR", 0, NULL},
-{ 0, "(De)select First", 7, NULL},
-{ 0, "(De)select Last", 8, NULL},
-{ 0, "Select Next", 11, NULL},
-{ 0, "Select Previous", 12, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "More|Ctrl NumPad +", 9, NULL},
-{ 0, "Less|Ctrl NumPad -", 10, NULL},
-{ -1, "", 0, do_view3d_select_curvemenu}};
-
-static TBitem tb_mball_select[]= {
-{ 0, "Border Select|B", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "(De)select All|A", 2, NULL},
-{ 0, "Inverse", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Random...", 4, NULL},
-{ -1, "", 0, do_view3d_select_metaballmenu}};
-
-static TBitem tb__select[]= {
-{ 0, "Border Select|B", 'b', NULL},
-{ 0, "(De)select All|A", 'a', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-/* *************Edit ********** */
-
-static TBitem tb_edit[]= {
-{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_curve_edit_seg[]= {
-{ 0, "Subdivide|W, 1", 0, NULL},
-{ 0, "Switch Direction|W, 2", 1, NULL},
-{ -1, "", 0, do_view3d_edit_curve_segmentsmenu}};
-
-static TBitem tb_curve_edit_cv[]= {
-{ 0, "Tilt|T", 't', NULL},
-{ 0, "Clear Tilt|Alt T", TB_ALT|'t', NULL},
-{ 0, "Separate|P", 'p', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Automatic|Shift H", 'H', NULL},
-{ 0, "Toggle Free/Aligned|H", 'h', NULL},
-{ 0, "Vector|V", 'v', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Make Vertex Parent|Ctrl P", TB_CTRL|'p', NULL},
-{ 0, "Add Hook|Ctrl H", TB_CTRL|'h', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-static TBitem tb_curve_edit[]= {
-{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Extrude|E", 'e', NULL},
-{ 0, "Duplicate|Shift D", 'D', NULL},
-{ 0, "Make Segment|F", 'f', NULL},
-{ 0, "Toggle Cyclic|C", 'c', NULL},
-{ 0, "Delete...|X", 'x', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Control Points", 0, tb_curve_edit_cv},
-{ 0, "Segments", 0, tb_curve_edit_seg},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-static TBitem tb_mesh_edit_vertex[]= {
-{ 0, "Merge...|Alt M", 5, NULL},
-{ 0, "Rip|V", 7, NULL},
-{ 0, "Split|Y", 4, NULL},
-{ 0, "Separate|P", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Smooth|W, Alt 1", 2, NULL},
-{ 0, "Remove Doubles|W, 6", 1, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Make Vertex Parent|Ctrl P", 0, NULL},
-{ 0, "Add Hook|Ctrl H", 6, NULL},
-{ -1, "", 0, do_view3d_edit_mesh_verticesmenu}};
-
-static TBitem tb_mesh_edit_edge[]= {
-{ 0, "Make Edge/Face|F", 5, NULL},
-{ 0, "Collapse|Alt M", 14, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Bevel|W, Alt 2", 6, NULL},
-{ 0, "Loop Subdivide|Ctrl R", 4, NULL},
-{ 0, "Knife Subdivide...|Shift K", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Subdivide|W, 1", 2, NULL},
-{ 0, "Subdivide Fractal|W, 2", 1, NULL},
-{ 0, "Subdivide Smooth|W, 3", 0, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Mark Seam|Ctrl E", 7, NULL},
-{ 0, "Clear Seam|Ctrl E", 8, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Crease SubSurf|Shift E", 9, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Rotate Edge CW|Ctrl E", 10, NULL},
-{ 0, "Rotate Edge CCW|Ctrl E", 11, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Slide Edge|Ctrl E", 12, NULL},
-{ 0, "Delete Edge Loop|X", 13, NULL},
-{ -1, "", 0, do_view3d_edit_mesh_edgesmenu}};
-
-static TBitem tb_mesh_edit_face[]= {
-{ 0, "Make Edge/Face|F", 5, NULL},
-{ 0, "Fill|Shift F", 0, NULL},
-{ 0, "Beautify Fill|Alt F", 1, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Convert to Triangles|Ctrl T", 2, NULL},
-{ 0, "Convert to Quads|Alt J", 3, NULL},
-{ 0, "Flip Triangle Edges|Ctrl Shift F", 4, NULL},
-{ 0, "Set Smooth|Ctrl F, 3", 6, NULL},
-{ 0, "Set Solid|Ctrl F, 4", 7, NULL},
-{ -1, "", 0, do_view3d_edit_mesh_facesmenu}};
-
-
-static TBitem tb_mesh_edit_normal[]= {
-{ 0, "Recalculate Outside|Ctrl N", 2, NULL},
-{ 0, "Recalculate Inside|Ctrl Shift N", 1, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Flip|Ctrl F, 1", 0, NULL},
-{ -1, "", 0, do_view3d_edit_mesh_normalsmenu}};
-
-static TBitem tb_mesh_edit[]= {
-{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
-{ 0, "Undo|Ctrl Z", 'u', NULL},
-{ 0, "Redo|Ctrl Shift Z", 'U', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Extrude|E", 'e', NULL},
-{ 0, "Duplicate|Shift D", 'D', NULL},
-{ 0, "Delete...|X", 'x', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Vertices", 0, tb_mesh_edit_vertex},
-{ 0, "Edges", 0, tb_mesh_edit_edge},
-{ 0, "Faces", 0, tb_mesh_edit_face},
-{ 0, "Normals", 0, tb_mesh_edit_normal},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-static TBitem tb_object_ipo[]= {
-{ 0, "Show/Hide", 'k', NULL},
-{ 0, "Select Next", TB_PAD|'u', NULL},
-{ 0, "Select Prev", TB_PAD|'d', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-static TBitem tb_object_edit[]= {
-{ 0, "Enter Editmode|Tab", TB_TAB, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Duplicate|Shift D", 'D', NULL},
-{ 0, "Duplicate Linked|Alt D", TB_ALT|'d', NULL},
-{ 0, "Delete|X", 'x', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Object Keys", 0, tb_object_ipo},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-/* ************* Type ********** */
-
-static TBitem tb_obdata_hide[]= {
-{ 0, "Show Hidden|Alt H", TB_ALT|'h', NULL},
-{ 0, "Hide Selected|H", 'h', NULL},
-{ 0, "Hide Deselected|Shift H", 'H', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static void tb_do_mesh(void *arg, int event){
- switch(event) {
- case 1: common_insertkey(); break;
- case 2: G.f ^= G_DRAWEDGES; break;
- case 3: G.f ^= G_DRAWFACES; break;
- case 4: G.f ^= G_DRAWNORMALS; break;
- case 5: flip_subdivison(-1); break;
- }
- addqueue(curarea->win, REDRAW, 1);
-}
-
-static TBitem tb_mesh[]= {
-{ 0, "Insert Keyframe|I", 1, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Show/Hide Edges", 2, NULL},
-{ 0, "Show/Hide Faces", 3, NULL},
-{ 0, "Show/Hide Normals", 4, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Subdivision Surface", 5, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Show/Hide Vertices", 0, tb_obdata_hide},
-{ -1, "", 0, tb_do_mesh}};
-
-static TBitem tb_curve_hide[]= {
-{ 0, "Show Hidden|Alt H", 10, NULL},
-{ 0, "Hide Selected|Alt Ctrl H", 11, NULL},
-{ -1, "", 0, do_view3d_edit_curve_showhidemenu}};
-
-
-static TBitem tb_curve[]= {
-{ 0, "Insert Keyframe|I", 'i', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Show/Hide Points", 0, tb_curve_hide},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_obdata[]= {
-{ 0, "Duplicate|Shift D", 'D', NULL},
-{ 0, "Delete|X", 'x', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_object_parent[]= {
-{ 0, "Make Parent...|Ctrl P", TB_CTRL|'p', NULL},
-{ 0, "Clear Parent...|Alt P", TB_ALT|'p', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_object_track[]= {
-{ 0, "Make Track|Ctrl T", TB_CTRL|'t', NULL},
-{ 0, "Clear Track|Alt T", TB_ALT|'t', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_object[]= {
-{ 0, "Insert Keyframe|I", 'i', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Make Links...|Ctrl L", TB_CTRL|'l', NULL},
-{ 0, "Make Single User...|U", 'u', NULL},
-{ 0, "Copy Attributes...|Ctrl C", TB_CTRL|'c', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Parent", 0, tb_object_parent},
-{ 0, "Track", 0, tb_object_track},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Boolean Operation|W", 'w', NULL},
-{ 0, "Join Objects...|Ctrl J", TB_CTRL|'j', NULL},
-{ 0, "Convert Object Type...|Alt C", TB_ALT|'c', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Move to Layer...|M", 'm', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-/* *************VIEW ********** */
-
-static void tb_do_view_dt(void *arg, int event){
- G.vd->drawtype= event;
- addqueue(curarea->win, REDRAW, 1);
-}
-
-static TBitem tb_view_dt[]= {
-{ ICON_BBOX, "Bounding Box", 1, NULL},
-{ ICON_WIRE, "Wireframe|Z", 2, NULL},
-{ ICON_SOLID, "Solid|Z", 3, NULL},
-{ ICON_SMOOTH, "Shaded|Shift Z", 4, NULL},
-{ ICON_POTATO, "Textured|Alt Z", 5, NULL},
-{ -1, "", 0, tb_do_view_dt}};
-
-static TBitem tb_view_alignview[]= {
-{ 0, "Center View to Cursor|C", 'c', NULL},
-{ 0, "Align Active Camera to View|Ctrl Alt NumPad 0",
-TB_CTRL|TB_ALT|TB_PAD|'0', NULL},
-{ 0, "Align View to Selected|NumPad *", TB_PAD|'*', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_view[]= {
-{ 0, "Viewport Shading", 0, tb_view_dt},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL},
-{ 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Show All Layers|Shift ~", TB_SHIFT|'~', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Align View", 0, tb_view_alignview},
-{ 0, "SEPR", 0, NULL},
-{ 0, "View Selected|NumPad .", TB_PAD|'.', NULL},
-{ 0, "View All|Home", TB_PAD|'h', NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Play Back Animation|Alt A", TB_ALT|'a', NULL},
-{ 0, "Camera Fly Mode|Shift F", TB_SHIFT|'f', NULL},
-{ -1, "", 0, tb_do_hotkey}};
-
-
-/* *************TRANSFORM ********** */
-
-static TBitem tb_transform_moveaxis[]= {
-{ 0, "X Global|G, X", 0, NULL},
-{ 0, "Y Global|G, Y", 1, NULL},
-{ 0, "Z Global|G, Z", 2, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "X Local|G, X, X", 3, NULL},
-{ 0, "Y Local|G, Y, Y", 4, NULL},
-{ 0, "Z Local|G, Z, Z", 5, NULL},
-{ -1, "", 0, do_view3d_transform_moveaxismenu}};
-
-static TBitem tb_transform_rotateaxis[]= {
-{ 0, "X Global|R, X", 0, NULL},
-{ 0, "Y Global|R, Y", 1, NULL},
-{ 0, "Z Global|R, Z", 2, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "X Local|R, X, X", 3, NULL},
-{ 0, "Y Local|R, Y, Y", 4, NULL},
-{ 0, "Z Local|R, Z, Z", 5, NULL},
-{ -1, "", 0, do_view3d_transform_rotateaxismenu}};
-
-static TBitem tb_transform_scaleaxis[]= {
-{ 0, "X Global|S, X", 0, NULL},
-{ 0, "Y Global|S, Y", 1, NULL},
-{ 0, "Z Global|S, Z", 2, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "X Local|S, X, X", 3, NULL},
-{ 0, "Y Local|S, Y, Y", 4, NULL},
-{ 0, "Z Local|S, Z, Z", 5, NULL},
-{ -1, "", 0, do_view3d_transform_scaleaxismenu}};
-
-static void tb_do_transform_clearapply(void *arg, int event)
-{
- Object *ob;
- ob= OBACT;
-
- switch(event)
- {
- case 0: /* clear location */
- clear_object('g');
- break;
- case 1: /* clear rotation */
- clear_object('r');
- break;
- case 2: /* clear scale */
- clear_object('s');
- break;
- case 3: /* apply scale/rotation */
- apply_objects_locrot();
- break;
- case 4: /* apply scale/rotation */
- apply_objects_visual_tx();
- break;
- case 5: /* apply deformation */
- object_apply_deform(ob);
- break;
- case 6: /* make duplicates real */
- if (ob->transflag & OB_DUPLI) make_duplilist_real();
- else error("The active object does not have dupliverts");
- break;
- }
-}
-
-static TBitem tb_transform_clearapply[]= {
-{ 0, "Clear Location|Alt G", 0, NULL},
-{ 0, "Clear Rotation|Alt R", 1, NULL},
-{ 0, "Clear Scale|Alt S", 2, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Apply Scale/Rotation to ObData|Ctrl A, 1", 3, NULL},
-{ 0, "Apply Visual Transform|Ctrl A, 2", 4, NULL},
-{ 0, "Apply Deformation|Shift Ctrl A", 5, NULL},
-{ 0, "Make Duplicates Real|Shift Ctrl A", 6, NULL},
-{ -1, "", 0, tb_do_transform_clearapply}};
-
-static TBitem tb_transform_snap[]= {
-{ 0, "Selection -> Grid|Shift S, 1", 1, NULL},
-{ 0, "Selection -> Cursor|Shift S, 2", 2, NULL},
-{ 0, "Selection -> Center|Shift S, 3", 3, NULL},
-{ 0, "Cursor -> Selection|Shift S, 4", 4, NULL},
-{ 0, "Cursor -> Grid|Shift S, 5", 5, NULL},
-{ 0, "Cursor -> Active|Shift S, 6", 6, NULL},
-{ -1, "", 0, do_view3d_edit_snapmenu}};
-
-static void tb_do_transform(void *arg, int event)
-{
- switch(event)
- {
- case 0: /* Grab/move */
- initTransform(TFM_TRANSLATION, CTX_NONE);
- Transform();
- break;
- case 1: /* Rotate */
- initTransform(TFM_ROTATION, CTX_NONE);
- Transform();
- break;
- case 2: /* Scale */
- initTransform(TFM_RESIZE,CTX_NONE);
- Transform();
- break;
- case 3: /* transform properties */
- add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
- break;
- case 4: /* snap */
- snapmenu();
- break;
- case 5: /* Shrink/Fatten Along Normals */
- initTransform(TFM_SHRINKFATTEN, CTX_NONE);
- Transform();
- break;
- case 6: /* Shear */
- initTransform(TFM_SHEAR, CTX_NONE);
- Transform();
- break;
- case 7: /* Warp */
- initTransform(TFM_WARP, CTX_NONE);
- Transform();
- break;
- case 8: /* proportional edit (toggle) */
- if(G.scene->proportional) G.scene->proportional= 0;
- else G.scene->proportional= 1;
- break;
- case 10:
- docenter(0);
- break;
- case 11:
- docenter_new();
- break;
- case 12:
- docenter_cursor();
- break;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static TBitem tb_transform_object_mirror[]= {
-{ 0, "X Local|Ctrl M, 1", 1, NULL},
-{ 0, "Y Local|Ctrl M, 2", 2, NULL},
-{ 0, "Z Local|Ctrl M, 3", 3, NULL},
-{ -1, "", 0, do_view3d_object_mirrormenu}};
-
-static TBitem tb_transform[]= {
-{ 0, "Grab/Move|G", 0, NULL},
-{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
-{ 0, "Rotate|R", 1, NULL},
-{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
-{ 0, "Scale|S", 2, NULL},
-{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
-{ 0, "SEPR", 0, NULL},
-{ 0, "ObData to Center", 10, NULL},
-{ 0, "Center New", 11, NULL},
-{ 0, "Center Cursor", 12, NULL},
-{ 0, "SEPR", 0, NULL},
-{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Mirror", 0, tb_transform_object_mirror},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Snap", 0, tb_transform_snap},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Clear/Apply", 0, tb_transform_clearapply},
-{ -1, "", 0, tb_do_transform}};
-
-static TBitem tb_transform_edit_mirror[]= {
-{ 0, "X Global|Ctrl M, 1", 1, NULL},
-{ 0, "Y Global|Ctrl M, 2", 2, NULL},
-{ 0, "Z Global|Ctrl M, 3", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "X Local|Ctrl M, 4", 4, NULL},
-{ 0, "Y Local|Ctrl M, 5", 5, NULL},
-{ 0, "Z Local|Ctrl M, 6", 6, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "X View|Ctrl M, 7", 7, NULL},
-{ 0, "Y View|Ctrl M, 8", 8, NULL},
-{ 0, "Z View|Ctrl M, 9", 9, NULL},
-{ -1, "", 0, do_view3d_edit_mirrormenu}};
-
-static TBitem tb_transform_editmode1[]= {
-{ 0, "Grab/Move|G", 0, NULL},
-{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
-{ 0, "Rotate|R", 1, NULL},
-{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
-{ 0, "Scale|S", 2, NULL},
-{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Shrink/Fatten|Alt S", 5, NULL},
-{ 0, "Shear|Ctrl S", 6, NULL},
-{ 0, "Warp|Shift W", 7, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "ObData to Center", 10, NULL},
-{ 0, "SEPR", 0, NULL},
-{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Mirror", 0, tb_transform_edit_mirror},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Snap", 0, tb_transform_snap},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Proportional Edit|O", 8, NULL},
-{ -1, "", 0, tb_do_transform}};
-
-
-static TBitem tb_transform_editmode2[]= {
-{ 0, "Grab/Move|G", 0, NULL},
-{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
-{ 0, "Rotate|R", 1, NULL},
-{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
-{ 0, "Scale|S", 2, NULL},
-{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
-{ 0, "SEPR", 0, NULL},
-{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
-{ 0, "Snap", 0, tb_transform_snap},
-{ -1, "", 0, tb_do_transform}};
-
-
-/* *************ADD ********** */
-
-static TBitem addmenu_curve[]= {
-{ 0, "Bezier Curve", 0, NULL},
-{ 0, "Bezier Circle", 1, NULL},
-{ 0, "NURBS Curve", 2, NULL},
-{ 0, "NURBS Circle", 3, NULL},
-{ 0, "Path", 4, NULL},
-{ -1, "", 0, do_info_add_curvemenu}};
-
-static TBitem addmenu_surf[]= {
-{ 0, "NURBS Curve", 0, NULL},
-{ 0, "NURBS Circle", 1, NULL},
-{ 0, "NURBS Surface", 2, NULL},
-{ 0, "NURBS Tube", 3, NULL},
-{ 0, "NURBS Sphere", 4, NULL},
-{ 0, "NURBS Donut", 5, NULL},
-{ -1, "", 0, do_info_add_surfacemenu}};
-
-static TBitem addmenu_meta[]= {
-{ 0, "Meta Ball", 0, NULL},
-{ 0, "Meta Tube", 1, NULL},
-{ 0, "Meta Plane", 2, NULL},
-{ 0, "Meta Ellipsoid", 3, NULL},
-{ 0, "Meta Cube", 4, NULL},
-{ -1, "", 0, do_info_add_metamenu}};
-
-static TBitem addmenu_lamp[]= {
-{ 0, "Lamp", 0, NULL},
-{ 0, "Sun", 1, NULL},
-{ 0, "Spot", 2, NULL},
-{ 0, "Hemi", 3, NULL},
-{ 0, "Area", 4, NULL},
-{ -1, "", 0, do_info_add_lampmenu}};
-
-static TBitem addmenu_YF_lamp[]= {
-{ 0, "Lamp", 0, NULL},
-{ 0, "Sun", 1, NULL},
-{ 0, "Spot", 2, NULL},
-{ 0, "Hemi", 3, NULL},
-{ 0, "Area", 4, NULL},
-{ 0, "Photon", 5, NULL},
-{ -1, "", 0, do_info_add_lampmenu}};
-
-
-static TBitem addmenu_armature[]= {
-{ 0, "Bone", 8, NULL},
-{ -1, "", 0, do_info_addmenu}};
-
-/* dynamic items */
-#define TB_ADD_MESH 0
-#define TB_ADD_GROUP 7
-#define TB_ADD_LAMP 10
-
-static TBitem tb_add[]= {
-{ 0, "Mesh", 0, NULL},
-{ 0, "Curve", 1, addmenu_curve},
-{ 0, "Surface", 2, addmenu_surf},
-{ 0, "Meta", 3, addmenu_meta},
-{ 0, "Text", 4, NULL},
-{ 0, "Empty", 5, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Group", 10, NULL},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Camera", 6, NULL},
-{ 0, "Lamp", 7, addmenu_lamp},
-{ 0, "SEPR", 0, NULL},
-{ 0, "Armature", 8, NULL},
-{ 0, "Lattice", 9, NULL},
-{ -1, "", 0, do_info_addmenu}};
-
-static TBitem tb_empty[]= {
-{ 0, "Nothing...", 0, NULL},
-{ -1, "", 0, NULL}};
-
-
-/* *************RENDER ********** */
-
-static void tb_do_render(void *arg, int event){
- switch(event)
- {
- case 1: /* set render border */
- set_render_border();
- break;
- case 2: /* render */
- BIF_do_render(0);
- break;
- case 3: /* render anim */
- BIF_do_render(1);
- break;
- case 4: /* passepartout */
- {
- Camera *ca= NULL;
- if(G.vd->camera==NULL) return;
-
- if(G.vd->camera->type==OB_CAMERA)
- ca= G.vd->camera->data;
- else return;
-
- if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT))
- ca->flag &= ~CAM_SHOWPASSEPARTOUT;
- else
- ca->flag |= CAM_SHOWPASSEPARTOUT;
- allqueue(REDRAWVIEW3D, 0);
- }
- break;
- case 5: /*preview render */
- toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
- scrarea_queue_winredraw(curarea);
- break;
- }
-}
-
-static TBitem tb_render[]= {
- { 0, "Passepartout", 4, NULL},
- { 0, "Set Border|Shift B", 1, NULL},
- { 0, "SEPR", 0, NULL},
- { 0, "Render|F12", 2, NULL},
- { 0, "Anim|Ctrl F12", 3, NULL},
- { 0, "Preview|Shift P", 5, NULL},
- { -1, "", 0, tb_do_render}};
-
-/* ************************* NODES *********************** */
-
-
-/* dynamic items */
-
-static TBitem tb_node_addsh[]= {
- { 0, "Input", 1, NULL},
- { 0, "Output", 2, NULL},
- { 0, "Color", 3, NULL},
- { 0, "Vector", 4, NULL},
- { 0, "Convertor", 5, NULL},
- { 0, "Group", 6, NULL},
- { 0, "Dynamic", 7, NULL},
- { -1, "", 0, NULL}};
-
-static TBitem tb_node_addcomp[]= {
- { 0, "Input", 1, NULL},
- { 0, "Output", 2, NULL},
- { 0, "Color", 3, NULL},
- { 0, "Vector", 4, NULL},
- { 0, "Filter", 5, NULL},
- { 0, "Convertor", 6, NULL},
- { 0, "Matte", 7, NULL},
- { 0, "Distort", 8, NULL},
- { 0, "Group", 9, NULL},
- { 0, "Dynamic", 10, NULL},
- { -1, "", 0, NULL}};
-
-static TBitem tb_node_addtex[]= {
- { 0, "Input", 1, NULL},
- { 0, "Output", 2, NULL},
- { 0, "Color", 3, NULL},
- { 0, "Convertor", 4, NULL},
- { 0, "Patterns", 5, NULL},
- { 0, "Textures", 6, NULL},
- { 0, "Distort", 7, NULL},
- { 0, "Group", 8, NULL},
- { -1, "", 0, NULL}};
-
-/* do_node_addmenu() in header_node.c, prototype in BSE_headerbuttons.h */
-
-/* dynamic toolbox sublevel */
-static TBitem *node_add_sublevel(ListBase *storage, bNodeTree *ntree, int nodeclass)
-{
- static TBitem _addmenu[]= { { 0, " ", 0, NULL}, { -1, "", 0, NULL}};
- Link *link;
- TBitem *addmenu;
- int tot= 0, a;
-
- if(ntree) {
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= G.main->nodetree.first;
- for(; ngroup; ngroup= ngroup->id.next)
- if(ngroup->type==ntree->type)
- tot++;
- }
- else {
- bNodeType *ntype = ntree->alltypes.first;
- while(ntype) {
- if(ntype->nclass == nodeclass) {
- tot++;
- }
- ntype= ntype->next;
- }
- }
- }
- if(tot==0) {
- return _addmenu;
- }
-
- link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "types menu");
- BLI_addtail(storage, link);
- addmenu= (TBitem *)(link+1);
-
- if(nodeclass==NODE_CLASS_GROUP) {
- bNodeTree *ngroup= G.main->nodetree.first;
- for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) {
- if(ngroup->type==ntree->type) {
- addmenu[a].name= ngroup->id.name+2;
- addmenu[a].retval= NODE_GROUP_MENU+tot; /* so we can use BLI_findlink() */
- a++;
- }
- }
- }
- else {
- bNodeType *type= ntree->alltypes.first;
- int script=0;
- for(a=0; type; type= type->next) {
- if( type->nclass == nodeclass ) {
- if(type->type == NODE_DYNAMIC) {
- if(type->id)
- addmenu[a].name= type->id->name+2;
- else
- addmenu[a].name= type->name;
- addmenu[a].retval= NODE_DYNAMIC_MENU+script;
- script++;
- } else {
- addmenu[a].name= type->name;
- addmenu[a].retval= type->type;
- }
- a++;
- }
- }
- }
-
- addmenu[a].icon= -1; /* end signal */
- addmenu[a].name= "";
- addmenu[a].retval= a;
- addmenu[a].poin= do_node_addmenu;
-
- return addmenu;
-}
-
-
-static TBitem tb_node_node[]= {
- { 0, "Duplicate|Shift D", TB_SHIFT|'d', NULL},
- { 0, "Delete|X", 'x', NULL},
- { 0, "SEPR", 0, NULL},
- { 0, "Make Link|F", 'f', NULL},
- { 0, "SEPR", 0, NULL},
- { 0, "Make Group|Ctrl G", TB_CTRL|'g', NULL},
- { 0, "Ungroup|Alt G", TB_ALT|'g', NULL},
- { 0, "Edit Group|Tab", TB_TAB, NULL},
- { 0, "SEPR", 0, NULL},
- { 0, "Hide/Unhide|H", 'h', NULL},
- { 0, "Rename|Ctrl R", TB_CTRL|'r', NULL},
- { 0, "SEPR", 0, NULL},
- { 0, "Read Saved Render Results|R", 'r', NULL},
- { 0, "Show Cyclic Dependencies|C", 'c', NULL},
- { -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_node_select[]= {
- { 0, "Select/Deselect All|A", 'a', NULL},
- { 0, "Border Select|B", 'b', NULL},
- { -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_node_transform[]= {
- { 0, "Grab/Move|G", 'g', NULL},
- { -1, "", 0, tb_do_hotkey}};
-
-static TBitem tb_node_view[]= {
- { 0, "Zoom In|NumPad +", TB_PAD|'+', NULL},
- { 0, "Zoom Out|NumPad -", TB_PAD|'-', NULL},
- { 0, "View All|Home", TB_PAD|'h', NULL},
- { -1, "", 0, tb_do_hotkey}};
-
-
-/* *********************************************** */
-
-static uiBlock *tb_makemenu(void *arg)
-{
- static int counter=0;
- TBitem *item= arg, *itemt;
- uiBlock *block;
- int xco= 0, yco= 0;
- char str[10];
-
- if(arg==NULL) return NULL;
-
- sprintf(str, "tb %d", counter++);
- block= uiNewBlock(&tb_listb, str, UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetCol(block, TH_MENU_ITEM);
-
- // last item has do_menu func, has to be stored in each button
- itemt= item;
- while(itemt->icon != -1) itemt++;
- uiBlockSetButmFunc(block, itemt->poin, NULL);
-
- // now make the buttons
- while(item->icon != -1) {
-
- if(strcmp(item->name, "SEPR")==0) {
- uiDefBut(block, SEPR, 0, "", xco, yco-=6, 50, 6, NULL, 0.0, 0.0, 0, 0, "");
- }
- else if(item->icon) {
- uiDefIconTextBut(block, BUTM, 1, item->icon, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
- }
- else if(item->poin) {
- uiDefIconTextBlockBut(block, tb_makemenu, item->poin, ICON_RIGHTARROW_THIN, item->name, 0, yco-=20, 80, 19, "");
- }
- else {
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
- }
-
- if(yco <= -600) {
- yco = 0;
- xco += 80;
- }
-
- item++;
- }
-
- uiTextBoundsBlock(block, 60);
-
- /* direction is also set in the function that calls this */
- if(U.uiflag & USER_PLAINMENUS)
- uiBlockSetDirection(block, UI_RIGHT);
- else
- uiBlockSetDirection(block, UI_RIGHT|UI_CENTER);
-
- return block;
-}
-
-static int tb_mainx= 1234, tb_mainy= 0;
-static void store_main(void *arg1, void *arg2)
-{
- tb_mainx= (intptr_t)arg1;
- tb_mainy= (intptr_t)arg2;
-}
-
-static void do_group_addmenu(void *arg, int event)
-{
- Object *ob;
-
- if(event<0) return;
-
- add_object_draw(OB_EMPTY);
- ob= OBACT;
-
- ob->dup_group= BLI_findlink(&G.main->group, event);
- if(ob->dup_group) {
- rename_id(&ob->id, ob->dup_group->id.name+2);
-
- id_us_plus((ID *)ob->dup_group);
- ob->transflag |= OB_DUPLIGROUP;
- DAG_scene_sort(G.scene);
- }
-}
-
-/* helper for create group menu */
-static void tag_groups_for_toolbox(void)
-{
- Group *group;
- GroupObject *go;
-
- for(group= G.main->group.first; group; group= group->id.next)
- group->id.flag |= LIB_DOIT;
-
- for(group= G.main->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT)
- for(go= group->gobject.first; go; go= go->next)
- if(go->ob && go->ob->dup_group)
- go->ob->dup_group->id.flag &= ~LIB_DOIT;
- }
-}
-
-/* helper for create group menu */
-/* note that group id.flag was set */
-static int count_group_libs(void)
-{
- Group *group;
- Library *lib;
- int tot= 0;
-
- for(lib= G.main->library.first; lib; lib= lib->id.next)
- lib->id.flag |= LIB_DOIT;
-
- for(group= G.main->group.first; group; group= group->id.next) {
- if(group->id.flag & LIB_DOIT) {
- if(group->id.lib && (group->id.lib->id.flag & LIB_DOIT)) {
- group->id.lib->id.flag &= ~LIB_DOIT;
- tot++;
- }
- }
- }
- return tot;
-}
-
-/* dynamic toolbox sublevel */
-static TBitem *create_group_sublevel(ListBase *storage, Library *lib)
-{
- static TBitem addmenu[]= { { 0, "No Groups", 0, NULL}, { -1, "", 0, NULL}};
- Link *link;
- TBitem *groupmenu, *gm;
- Group *group;
- int a;
- int tot= BLI_countlist(&G.main->group);
-
- if(tot==0) {
- return addmenu;
- }
-
- /* build menu, we insert a Link before the array of TBitems */
- link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "group menu lib");
- BLI_addtail(storage, link);
- gm= groupmenu= (TBitem *)(link+1);
- for(a=0, group= G.main->group.first; group; group= group->id.next, a++) {
- if(group->id.lib==lib && (group->id.flag & LIB_DOIT)) {
- gm->name= group->id.name+2;
- gm->retval= a;
- gm++;
- }
- }
- gm->icon= -1; /* end signal */
- gm->name= "";
- gm->retval= a;
- gm->poin= do_group_addmenu;
-
- return groupmenu;
-}
-
-static TBitem *create_group_all_sublevels(ListBase *storage)
-{
- Library *lib;
- Group *group;
- Link *link;
- TBitem *groupmenu, *gm;
- int a;
- int totlevel= 0;
- int totlocal= 0;
-
- /* we add totlevel + local groups entries */
-
- /* let's skip group-in-group */
- tag_groups_for_toolbox();
-
- /* this call checks for skipped group-in-groups */
- totlevel= count_group_libs();
-
- for(group= G.main->group.first; group; group= group->id.next)
- if(group->id.flag & LIB_DOIT)
- if(group->id.lib==NULL)
- totlocal++;
-
- if(totlocal+totlevel==0)
- return create_group_sublevel(storage, NULL);
-
- /* build menu, we insert a Link before the array of TBitems */
- link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totlocal+totlevel+1), "group menu");
- BLI_addtail(storage, link);
- gm= groupmenu= (TBitem *)(link+1);
-
- /* first all levels. libs with groups are not tagged */
- for(lib= G.main->library.first; lib; lib= lib->id.next) {
- if(!(lib->id.flag & LIB_DOIT)) {
- char *str;
- /* do some tricks to get .blend file name without extension */
- link= MEM_callocN(sizeof(Link) + 128, "string");
- BLI_addtail(storage, link);
- str= (char *)(link+1);
- BLI_strncpy(str, BLI_last_slash(lib->filename)+1, 128);
- if(strlen(str)>6) str[strlen(str)-6]= 0;
- gm->name= str;
- gm->retval= -1;
- gm->poin= create_group_sublevel(storage, lib);
- gm++;
- }
- }
- /* remaining groups */
- for(a=0, group= G.main->group.first; group; group= group->id.next, a++) {
- if(group->id.lib==NULL && (group->id.flag & LIB_DOIT)) {
- gm->name= group->id.name+2;
- gm->retval= a;
- gm++;
- }
- }
- gm->icon= -1; /* end signal */
- gm->name= "";
- gm->retval= a;
- gm->poin= do_group_addmenu;
-
- return groupmenu;
-}
-
-static TBitem *create_mesh_sublevel(ListBase *storage)
-{
- Link *link;
- TBitem *meshmenu, *mm;
- int totmenu= 10, totpymenu=0, a=0;
-
-#ifndef DISABLE_PYTHON
- /* Python Menu */
- BPyMenu *pym;
-
- /* count the python menu items*/
- for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, totpymenu++) {}
-#endif
-
- if (totpymenu) totmenu += totpymenu+1; /* add 1 for the seperator */
-
- link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totmenu+1), "mesh menu");
- BLI_addtail(storage, link);
- mm= meshmenu= (TBitem *)(link+1);
-
- mm->icon = 0; mm->retval= a; mm->name = "Plane"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Cube"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Circle"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "UVsphere"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Icosphere"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Cylinder"; mm++; a++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Cone"; mm++; a++;
- mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++;
- mm->icon = 0; mm->retval= a; mm->name = "Grid"; mm++; a++;
- mm->icon = 0; mm->retval= a; mm->name = "Monkey"; mm++; a++;
- /* a == 10 */
-
-#ifndef DISABLE_PYTHON
- if (totpymenu) {
- int i=0;
- mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++;
-
- /* note that we account for the 10 previous entries with i+4: */
- for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, i++) {
- mm->icon = ICON_PYTHON;
- mm->retval= i+20;
- mm->name = pym->name;
- mm++; a++;
- }
- }
-#endif
-
- /* terminate the menu */
- mm->icon= -1; mm->retval= a; mm->name= ""; mm->poin= do_info_add_meshmenu;
-
- return meshmenu;
-}
-
-
-
-void toolbox_n(void)
-{
- uiBlock *block;
- uiBut *but;
- ListBase storage= {NULL, NULL};
- TBitem *menu1=NULL, *menu2=NULL, *menu3=NULL;
- TBitem *menu4=NULL, *menu5=NULL, *menu6=NULL;
- TBitem *menu7=NULL;
- int dx=0;
- short event, mval[2], tot=0;
- char *str1=NULL, *str2=NULL, *str3=NULL, *str4=NULL, *str5=NULL, *str6=NULL, *str7=NULL;
-
- /* temporal too... when this flag is (was) saved, it should initialize OK */
- if(tb_mainx==1234) {
- if(U.uiflag & USER_PLAINMENUS) {
- tb_mainx= -32;
- tb_mainy= -5;
- } else {
- tb_mainx= 0;
- tb_mainy= -5;
- }
- }
-
- /* save present mouse position */
- toolbox_mousepos(mval, 1);
-
- mywinset(G.curscreen->mainwin); // we go to screenspace
-
- block= uiNewBlock(&tb_listb, "toolbox", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
- uiBlockSetCol(block, TH_MENU_ITEM);
-
- /* select context for main items */
- if(curarea->spacetype==SPACE_VIEW3D) {
-
- /* dynamic menu entries */
- tb_add[TB_ADD_GROUP].poin= create_group_all_sublevels(&storage);
- tb_add[TB_ADD_MESH].poin= create_mesh_sublevel(&storage);
-
- /* static */
- if (G.scene->r.renderer==R_YAFRAY)
- tb_add[TB_ADD_LAMP].poin= addmenu_YF_lamp;
- else
- tb_add[TB_ADD_LAMP].poin= addmenu_lamp;
-
- if(U.uiflag & USER_PLAINMENUS) {
- menu1= tb_add; str1= "Add";
- menu2= tb_object_edit; str2= "Edit";
- menu3= tb_object_select; str3= "Select";
- menu4= tb_transform; str4= "Transform";
- menu5= tb_object; str5= "Object";
- menu6= tb_view; str6= "View";
- menu7= tb_render; str7= "Render";
-
- dx= 96;
- tot= 7;
- } else {
- /* 3x2 layout menu */
- menu1= tb_object; str1= "Object";
- menu2= tb_add; str2= "Add";
- menu3= tb_object_select; str3= "Select";
- menu4= tb_object_edit; str4= "Edit";
- menu5= tb_transform; str5= "Transform";
- menu6= tb_view; str6= "View";
-
- dx= 64;
- tot= 6;
- }
-
- if(G.obedit) {
- if(U.uiflag & USER_PLAINMENUS) {
- switch(G.obedit->type){
- case OB_MESH:
- menu1= create_mesh_sublevel(&storage);
- menu2= tb_mesh_edit;
- menu3= tb_mesh_select;
- menu4= tb_transform_editmode1;
- menu5= tb_mesh; str5= "Mesh";
- break;
- case OB_CURVE:
- menu1= addmenu_curve;
- menu2= tb_curve_edit;
- menu3= tb_curve_select;
- menu4= tb_transform_editmode1;
- menu5= tb_curve; str5= "Curve";
- break;
- case OB_SURF:
- menu1= addmenu_surf;
- menu2= tb_curve_edit;
- menu3= tb_curve_select;
- menu4= tb_transform_editmode1;
- menu5= tb_curve; str5= "Surface";
- break;
- case OB_MBALL:
- menu1= addmenu_meta;
- menu2= tb_edit;
- menu3= tb_mball_select;
- menu4= tb_transform_editmode2;
- menu5= tb_obdata; str5= "Meta";
- break;
- case OB_ARMATURE:
- menu1= addmenu_armature;
- menu2= tb_edit;
- menu3= tb__select;
- menu4= tb_transform_editmode2;
- menu5= tb_obdata;str5= "Armature";
- break;
- case OB_LATTICE:
- menu1= tb_empty;
- menu2= tb_edit;
- menu3= tb__select;
- menu4= tb_transform_editmode1;
- menu5= tb_empty;str5= "Lattice";
- break;
- }
- } else {
- if(G.obedit->type==OB_MESH) {
- menu1= tb_mesh; str1= "Mesh";
- menu2= create_mesh_sublevel(&storage);
- menu3= tb_mesh_select;
- menu4= tb_mesh_edit;
- menu5= tb_transform_editmode1;
- }
- else if(G.obedit->type==OB_CURVE) {
- menu1= tb_curve; str1= "Curve";
- menu2= addmenu_curve;
- menu3= tb_curve_select;
- menu4= tb_curve_edit;
- menu5= tb_transform_editmode1;
- }
- else if(G.obedit->type==OB_SURF) {
- menu1= tb_curve; str1= "Surface";
- menu2= addmenu_surf;
- menu3= tb_curve_select;
- menu4= tb_curve_edit;
- menu5= tb_transform_editmode1;
- }
- else if(G.obedit->type==OB_MBALL) {
- menu1= tb_obdata; str1= "Meta";
- menu2= addmenu_meta;
- menu3= tb__select;
- menu4= tb_edit;
- menu5= tb_transform_editmode2;
- }
- else if(G.obedit->type==OB_ARMATURE) {
- menu1= tb_obdata;str1= "Armature";
- menu2= addmenu_armature;
- menu3= tb__select;
- menu4= tb_edit;
- menu5= tb_transform_editmode2;
- }
- else if(G.obedit->type==OB_LATTICE) {
- menu1= tb_empty;str1= "Lattice";
- menu2= tb_empty;
- menu3= tb__select;
- menu4= tb_edit;
- menu5= tb_transform_editmode1;
- }
- }
- }
- else if (FACESEL_PAINT_TEST) {
- menu3 = tb_face_select;
- }
- }
- else if(curarea->spacetype==SPACE_NODE) {
- SpaceNode *snode= curarea->spacedata.first;
-
- if(snode->treetype==NTREE_COMPOSIT)
- menu1= tb_node_addcomp;
- else if(snode->treetype==NTREE_SHADER)
- menu1= tb_node_addsh;
- else if(snode->treetype==NTREE_TEXTURE)
- menu1= tb_node_addtex;
-
- str1= "Add";
- menu2= tb_node_node; str2= "Node";
- menu3= tb_node_select; str3= "Select";
- menu4= tb_node_transform; str4= "Transform";
- menu5= tb_node_view; str5= "View";
-
- if(snode->treetype==NTREE_SHADER) {
- menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
- menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT);
- menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR);
- menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR);
- menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
- menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
- menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
- }
- else if(snode->treetype==NTREE_COMPOSIT) {
- menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
- menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT);
- menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR);
- menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR);
- menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_FILTER);
- menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
- menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_MATTE);
- menu1[7].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_DISTORT);
- menu1[8].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
- menu1[9].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
- }
- else if(snode->treetype==NTREE_TEXTURE) {
- menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
- menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT);
- menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR);
- menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
- menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_PATTERN);
- menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_TEXTURE);
- menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_DISTORT);
- menu1[7].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
- }
-
- dx= 96;
- tot= 5;
-
- }
-
- getmouseco_sc(mval);
-
- /* create the main buttons menu */
- if(tot==6) {
-
- /* check if it fits */
- if(mval[0]-1.5*dx+tb_mainx < 6) mval[0]= 6 + 1.5*dx -tb_mainx;
- else if(mval[0]+1.5*dx+tb_mainx > G.curscreen->sizex-6)
- mval[0]= G.curscreen->sizex-6-1.5*dx-tb_mainx;
-
- if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy;
- else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6)
- mval[1]= G.curscreen->sizey-6-20-tb_mainy;
-
- but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)-5);
-
- but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_TOP);
- uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)-5);
-
- but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)-5);
-
- but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)(intptr_t)dx, (void *)(intptr_t)5);
-
- but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_DOWN);
- uiButSetFunc(but, store_main, (void *)(intptr_t)0, (void *)(intptr_t)5);
-
- but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)(intptr_t)-dx, (void *)(intptr_t)5);
- } else if (tot==5 || tot==7) {
- /* check if it fits, dubious */
- if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx;
- else if(mval[0]+0.25*dx+tb_mainx > G.curscreen->sizex-6)
- mval[0]= G.curscreen->sizex-6-0.25*dx-tb_mainx;
-
- if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy;
- else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6)
- mval[1]= G.curscreen->sizey-6-20-tb_mainy;
-
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu1, ICON_RIGHTARROW_THIN, str1, mval[0]+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)-5);
-
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu2, ICON_RIGHTARROW_THIN, str2, mval[0]+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)15);
-
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu3, ICON_RIGHTARROW_THIN, str3, mval[0]+tb_mainx,mval[1]+tb_mainy-40, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)35);
-
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu4, ICON_RIGHTARROW_THIN, str4, mval[0]+tb_mainx,mval[1]+tb_mainy-60, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)55);
-
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu5, ICON_RIGHTARROW_THIN, str5, mval[0]+tb_mainx,mval[1]+tb_mainy-80, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)75);
-
- if(tot>5) {
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu6, ICON_RIGHTARROW_THIN, str6, mval[0]+tb_mainx,mval[1]+tb_mainy-100, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)95);
- }
- if(tot>6) {
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu7, ICON_RIGHTARROW_THIN, str7, mval[0]+tb_mainx,mval[1]+tb_mainy-120, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)-32, (void *)105);
- }
- }
-
- uiBoundsBlock(block, 2);
- event= uiDoBlocks(&tb_listb, 0, 1);
-
- /* free all dynamic entries... */
- BLI_freelistN(&storage);
-
- mywinset(curarea->win);
-}
-
-void toolbox_n_add(void)
-{
- reset_toolbox();
- toolbox_n();
-}
-
-void reset_toolbox(void)
-{
- if(U.uiflag & USER_PLAINMENUS) {
- tb_mainx= -32;
- tb_mainy= -5;
- } else {
- tb_mainx= 0;
- tb_mainy= -5;
- }
-}
-
-/* general toolbox for python access */
-void toolbox_generic( TBitem *generic_menu )
-{
- uiBlock *block;
- uiBut *but;
- TBitem *menu;
- int dx=96, first=1, len;
- short event, mval[2];
- intptr_t ypos = -5;
-
- tb_mainx= -32;
- tb_mainy= -5;
-
- mywinset(G.curscreen->mainwin); // we go to screenspace
-
- block= uiNewBlock(&tb_listb, "toolbox", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
- uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
- uiBlockSetCol(block, TH_MENU_ITEM);
-
- getmouseco_sc(mval);
-
- menu= generic_menu;
- while(menu->icon != -1) menu++;
- uiBlockSetButmFunc(block, menu->poin, NULL);
-
- /* Add the menu */
- for (menu = generic_menu; menu->icon != -1; menu++) {
- if (first && (len=strlen(menu->name)) > 2 && menu->name[len-2]=='%' && menu->name[len-1]=='t') {
- menu->name[len-2] = '\0';
- uiSetCurFont(block, UI_HELVB);
- uiDefIconTextBut(block, LABEL, 0, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, 0, "");
- uiSetCurFont(block, UI_HELV);
- ypos-=20;
- } else if(strcmp(menu->name, "SEPR")==0) {
- uiDefBut(block, SEPR, 0, "", mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 6, NULL, 0.0, 0.0, 0, 0, "");
- ypos-=6;
- } else {
- if (menu->poin) {
- but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
- uiButSetFlag(but, UI_MAKE_RIGHT);
-
- uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
- } else {
- /* TODO - add icon support */
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
- }
- ypos-=20;
- }
- first= 0;
- }
-
- uiBlockSetButmFunc(block, menu->poin, NULL);
-
- uiBoundsBlock(block, 2);
- event= uiDoBlocks(&tb_listb, 0, 1);
-
- mywinset(curarea->win);
-
- reset_toolbox();
-}
-
-/* save or restore mouse position when entering/exiting menus */
-void toolbox_mousepos( short *mpos, int save )
-{
- static short initpos[2];
- static int tog;
-
- if (save) {
- getmouseco_areawin(mpos);
- initpos[0]= mpos[0];
- initpos[1]= mpos[1];
- tog=1;
- } else {
- if (tog) {
- mpos[0]= initpos[0];
- mpos[1]= initpos[1];
- } else {
- getmouseco_areawin(mpos);
- }
- tog= 0;
- }
-}
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c
deleted file mode 100644
index 7a13943d0e0..00000000000
--- a/source/blender/src/transform.c
+++ /dev/null
@@ -1,4767 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h" /* for some special action-editor settings */
-#include "DNA_constraint_types.h"
-#include "DNA_ipo_types.h" /* some silly ipo flag */
-#include "DNA_listBase.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h" /* PET modes */
-#include "DNA_screen_types.h" /* area dimensions */
-#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_space_types.h"
-
-#include "BIF_editview.h" /* arrows_move_cursor */
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h" /* undo */
-#include "BIF_toets.h" /* persptoetsen */
-#include "BIF_mywindow.h" /* warp_pointer */
-#include "BIF_toolbox.h" /* notice */
-#include "BIF_editmesh.h"
-#include "BIF_editsima.h"
-#include "BIF_editparticle.h"
-#include "BIF_drawimage.h" /* uvco_to_areaco_noclip */
-#include "BIF_editaction.h"
-
-#include "BKE_action.h" /* get_action_frame */
-#include "BKE_bad_level_calls.h"/* popmenu and error */
-#include "BKE_bmesh.h"
-#include "BKE_constraint.h"
-#include "BKE_global.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-#include "BKE_utildefines.h"
-
-#include "BSE_drawipo.h"
-#include "BSE_editnla_types.h" /* for NLAWIDTH */
-#include "BSE_editaction_types.h"
-#include "BSE_time.h"
-#include "BSE_view.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "PIL_time.h" /* sleep */
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-#include "transform.h"
-
-/* GLOBAL VARIABLE THAT SHOULD MOVED TO SCREEN MEMBER OR SOMETHING */
-TransInfo Trans = {TFM_INIT, 0}; // enforce init on first usage
-
-/******************************** Helper functions ************************************/
-
-/* GLOBAL Wrapper Fonctions */
-
-void BIF_drawSnap()
-{
- drawSnapping(&Trans);
-}
-
-/* ************************** Dashed help line **************************** */
-
-
-/* bad frontbuffer call... because it is used in transform after force_draw() */
-static void helpline(TransInfo *t, float *vec)
-{
- float vecrot[3], cent[2];
- short mval[2];
-
- VECCOPY(vecrot, vec);
- if(t->flag & T_EDIT) {
- Object *ob=G.obedit;
- if(ob) Mat4MulVecfl(ob->obmat, vecrot);
- }
- else if(t->flag & T_POSE) {
- Object *ob=t->poseobj;
- if(ob) Mat4MulVecfl(ob->obmat, vecrot);
- }
-
- getmouseco_areawin(mval);
- projectFloatView(t, vecrot, cent); // no overflow in extreme cases
-
- persp(PERSP_WIN);
-
- glDrawBuffer(GL_FRONT);
-
- BIF_ThemeColor(TH_WIRE);
-
- setlinestyle(3);
- glBegin(GL_LINE_STRIP);
- glVertex2sv(mval);
- glVertex2fv(cent);
- glEnd();
- setlinestyle(0);
-
- persp(PERSP_VIEW);
- bglFlush(); // flush display for frontbuffer
- glDrawBuffer(GL_BACK);
-}
-
-
-
-/* ************************** INPUT FROM MOUSE *************************** */
-
-float InputScaleRatio(TransInfo *t, short mval[2]) {
- float ratio, dx, dy;
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- dx = (float)(t->center2d[0] - t->shiftmval[0]);
- dy = (float)(t->center2d[1] - t->shiftmval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio);
- }
- else {
- dx = (float)(t->center2d[0] - mval[0]);
- dy = (float)(t->center2d[1] - mval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
- return ratio;
-}
-
-float InputHorizontalRatio(TransInfo *t, short mval[2]) {
- float x, pad;
-
- pad = curarea->winx / 10;
-
- if (t->flag & T_SHIFT_MOD) {
- /* deal with Shift key by adding motion / 10 to motion before shift press */
- x = t->shiftmval[0] + (float)(mval[0] - t->shiftmval[0]) / 10.0f;
- }
- else {
- x = mval[0];
- }
- return (x - pad) / (curarea->winx - 2 * pad);
-}
-
-float InputHorizontalAbsolute(TransInfo *t, short mval[2]) {
- float vec[3];
- if(t->flag & T_SHIFT_MOD) {
- float dvec[3];
- /* calculate the main translation and the precise one separate */
- convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1]));
- VecMulf(dvec, 0.1f);
- convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1]));
- VecAddf(t->vec, t->vec, dvec);
- }
- else {
- convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1]));
- }
- Projf(vec, t->vec, t->viewinv[0]);
- return Inpf(t->viewinv[0], vec) * 2.0f;
-}
-
-float InputVerticalRatio(TransInfo *t, short mval[2]) {
- float y, pad;
-
- pad = curarea->winy / 10;
-
- if (t->flag & T_SHIFT_MOD) {
- /* deal with Shift key by adding motion / 10 to motion before shift press */
- y = t->shiftmval[1] + (float)(mval[1] - t->shiftmval[1]) / 10.0f;
- }
- else {
- y = mval[0];
- }
- return (y - pad) / (curarea->winy - 2 * pad);
-}
-
-float InputVerticalAbsolute(TransInfo *t, short mval[2]) {
- float vec[3];
- if(t->flag & T_SHIFT_MOD) {
- float dvec[3];
- /* calculate the main translation and the precise one separate */
- convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1]));
- VecMulf(dvec, 0.1f);
- convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1]));
- VecAddf(t->vec, t->vec, dvec);
- }
- else {
- convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1]));
- }
- Projf(vec, t->vec, t->viewinv[1]);
- return Inpf(t->viewinv[1], vec) * 2.0f;
-}
-
-float InputDeltaAngle(TransInfo *t, short mval[2])
-{
- double dx2 = mval[0] - t->center2d[0];
- double dy2 = mval[1] - t->center2d[1];
- double B = sqrt(dx2*dx2+dy2*dy2);
-
- double dx1 = t->imval[0] - t->center2d[0];
- double dy1 = t->imval[1] - t->center2d[1];
- double A = sqrt(dx1*dx1+dy1*dy1);
-
- double dx3 = mval[0] - t->imval[0];
- double dy3 = mval[1] - t->imval[1];
-
- /* use doubles here, to make sure a "1.0" (no rotation) doesnt become 9.999999e-01, which gives 0.02 for acos */
- double deler = ((dx1*dx1+dy1*dy1)+(dx2*dx2+dy2*dy2)-(dx3*dx3+dy3*dy3))
- / (2.0 * (A*B?A*B:1.0));
- /* (A*B?A*B:1.0f) this takes care of potential divide by zero errors */
-
- float dphi;
-
- dphi = saacos((float)deler);
- if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
-
- /* If the angle is zero, because of lack of precision close to the 1.0 value in acos
- * approximate the angle with the oposite side of the normalized triangle
- * This is a good approximation here since the smallest acos value seems to be around
- * 0.02 degree and lower values don't even have a 0.01% error compared to the approximation
- * */
- if (dphi == 0)
- {
- double dx, dy;
-
- dx2 /= A;
- dy2 /= A;
-
- dx1 /= B;
- dy1 /= B;
-
- dx = dx1 - dx2;
- dy = dy1 - dy2;
-
- dphi = sqrt(dx*dx + dy*dy);
- if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi;
- }
-
- if(t->flag & T_SHIFT_MOD) dphi = dphi/30.0f;
-
- /* if no delta angle, don't update initial position */
- if (dphi != 0)
- {
- t->imval[0] = mval[0];
- t->imval[1] = mval[1];
- }
-
- return dphi;
-}
-
-/* ************************** SPACE DEPENDANT CODE **************************** */
-
-void setTransformViewMatrices(TransInfo *t)
-{
- if(t->spacetype==SPACE_VIEW3D) {
- Mat4CpyMat4(t->viewmat, G.vd->viewmat);
- Mat4CpyMat4(t->viewinv, G.vd->viewinv);
- Mat4CpyMat4(t->persmat, G.vd->persmat);
- Mat4CpyMat4(t->persinv, G.vd->persinv);
- t->persp= G.vd->persp;
- }
- else {
- Mat4One(t->viewmat);
- Mat4One(t->viewinv);
- Mat4One(t->persmat);
- Mat4One(t->persinv);
- t->persp = V3D_ORTHO;
- }
-
- calculateCenter2D(t);
-
-}
-
-void convertViewVec(TransInfo *t, float *vec, short dx, short dy)
-{
- if (t->spacetype==SPACE_VIEW3D) {
- window_to_3d(vec, dx, dy);
- }
- else if(t->spacetype==SPACE_IMAGE) {
- float divx, divy, aspx, aspy;
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
-
- divx= G.v2d->mask.xmax-G.v2d->mask.xmin;
- divy= G.v2d->mask.ymax-G.v2d->mask.ymin;
-
- vec[0]= aspx*(G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/divx;
- vec[1]= aspy*(G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/divy;
- vec[2]= 0.0f;
- }
- else if(t->spacetype==SPACE_IPO) {
- float divx, divy;
-
- divx= G.v2d->mask.xmax-G.v2d->mask.xmin;
- divy= G.v2d->mask.ymax-G.v2d->mask.ymin;
-
- vec[0]= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx) / (divx);
- vec[1]= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy) / (divy);
- vec[2]= 0.0f;
- }
-}
-
-void projectIntView(TransInfo *t, float *vec, int *adr)
-{
- if (t->spacetype==SPACE_VIEW3D) {
- project_int_noclip(vec, adr);
- }
- else if(t->spacetype==SPACE_IMAGE) {
- float aspx, aspy, v[2];
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- v[0]= vec[0]/aspx;
- v[1]= vec[1]/aspy;
-
- uvco_to_areaco_noclip(v, adr);
- }
- else if(t->spacetype==SPACE_IPO) {
- short out[2] = {0.0f, 0.0f};
-
- ipoco_to_areaco(G.v2d, vec, out);
- adr[0]= out[0];
- adr[1]= out[1];
- }
-}
-
-void projectFloatView(TransInfo *t, float *vec, float *adr)
-{
- if (t->spacetype==SPACE_VIEW3D) {
- project_float_noclip(vec, adr);
- }
- else if(t->spacetype==SPACE_IMAGE) {
- int a[2];
-
- projectIntView(t, vec, a);
- adr[0]= a[0];
- adr[1]= a[1];
- }
- else if(t->spacetype==SPACE_IPO) {
- int a[2];
-
- projectIntView(t, vec, a);
- adr[0]= a[0];
- adr[1]= a[1];
- }
-}
-
-void convertVecToDisplayNum(float *vec, float *num)
-{
- TransInfo *t= BIF_GetTransInfo();
-
- VECCOPY(num, vec);
-
- if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
- float aspx, aspy;
-
- if((G.sima->flag & SI_COORDFLOATS)==0) {
- int width, height;
- transform_width_height_tface_uv(&width, &height);
-
- num[0] *= width;
- num[1] *= height;
- }
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- num[0] /= aspx;
- num[1] /= aspy;
- }
-}
-
-void convertDisplayNumToVec(float *num, float *vec)
-{
- TransInfo *t= BIF_GetTransInfo();
-
- VECCOPY(vec, num);
-
- if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
- float aspx, aspy;
-
- if((G.sima->flag & SI_COORDFLOATS)==0) {
- int width, height;
- transform_width_height_tface_uv(&width, &height);
-
- vec[0] /= width;
- vec[1] /= height;
- }
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- vec[0] *= aspx;
- vec[1] *= aspy;
- }
-}
-
-static void viewRedrawForce(TransInfo *t)
-{
- if (t->spacetype == SPACE_VIEW3D)
- force_draw(0);
- else if (t->spacetype==SPACE_IMAGE) {
- if (G.sima->lock) force_draw_plus(SPACE_VIEW3D, 0);
- else force_draw(0);
- }
- else if (t->spacetype == SPACE_ACTION) {
- if (G.saction->lock) {
- short context;
-
- /* we ignore the pointer this function returns (not needed) */
- get_action_context(&context);
-
- if (context == ACTCONT_ACTION)
- force_draw_plus(SPACE_VIEW3D, 0);
- else if (context == ACTCONT_SHAPEKEY)
- force_draw_all(0);
- else
- force_draw(0);
- }
- else {
- force_draw(0);
- }
- }
- else if (t->spacetype == SPACE_NLA) {
- if (G.snla->lock)
- force_draw_all(0);
- else
- force_draw(0);
- }
- else if (t->spacetype == SPACE_IPO) {
- /* update realtime */
- if (G.sipo->lock) {
- if (G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_TE)
- force_draw_plus(SPACE_BUTS, 0);
- else if (G.sipo->blocktype==ID_CA)
- force_draw_plus(SPACE_VIEW3D, 0);
- else if (G.sipo->blocktype==ID_KE)
- force_draw_plus(SPACE_VIEW3D, 0);
- else if (G.sipo->blocktype==ID_PO)
- force_draw_plus(SPACE_VIEW3D, 0);
- else if (G.sipo->blocktype==ID_OB)
- force_draw_plus(SPACE_VIEW3D, 0);
- else if (G.sipo->blocktype==ID_SEQ)
- force_draw_plus(SPACE_SEQ, 0);
- else
- force_draw(0);
- }
- else {
- force_draw(0);
- }
- }
-}
-
-static void viewRedrawPost(TransInfo *t)
-{
- if(t->spacetype==SPACE_VIEW3D) {
- allqueue(REDRAWBUTSOBJECT, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(t->spacetype==SPACE_IMAGE) {
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
- else if(ELEM3(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) {
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWIPO, 0);
- allqueue(REDRAWTIME, 0);
- allqueue(REDRAWBUTSOBJECT, 0);
- }
-
- scrarea_queue_headredraw(curarea);
-}
-
-/* ************************** TRANSFORMATIONS **************************** */
-
-void BIF_selectOrientation() {
- short val;
- char *str_menu = BIF_menustringTransformOrientation("Orientation");
- val= pupmenu(str_menu);
- MEM_freeN(str_menu);
-
- if(val >= 0) {
- G.vd->twmode = val;
- }
-}
-
-static void view_editmove(unsigned short event)
-{
- int refresh = 0;
- /* Regular: Zoom in */
- /* Shift: Scroll up */
- /* Ctrl: Scroll right */
- /* Alt-Shift: Rotate up */
- /* Alt-Ctrl: Rotate right */
-
- /* only work in 3D window for now
- * In the end, will have to send to event to a 2D window handler instead
- */
- if (Trans.flag & T_2D_EDIT)
- return;
-
- switch(event) {
- case WHEELUPMOUSE:
-
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD2);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD2);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD4);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD4);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADMINUS);
- else
- persptoetsen(PADPLUSKEY);
-
- refresh = 1;
- break;
- case WHEELDOWNMOUSE:
- if( G.qual & LR_SHIFTKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_SHIFTKEY;
- persptoetsen(PAD8);
- G.qual |= LR_SHIFTKEY;
- } else {
- persptoetsen(PAD8);
- }
- } else if( G.qual & LR_CTRLKEY ) {
- if( G.qual & LR_ALTKEY ) {
- G.qual &= ~LR_CTRLKEY;
- persptoetsen(PAD6);
- G.qual |= LR_CTRLKEY;
- } else {
- persptoetsen(PAD6);
- }
- } else if(U.uiflag & USER_WHEELZOOMDIR)
- persptoetsen(PADPLUSKEY);
- else
- persptoetsen(PADMINUS);
-
- refresh = 1;
- break;
- }
-
- if (refresh)
- setTransformViewMatrices(&Trans);
-}
-
-void checkFirstTime() {
- if(Trans.mode==TFM_INIT) {
- memset(&Trans, 0, sizeof(TransInfo));
- Trans.propsize = 1.0;
- }
-}
-
-static char *transform_to_undostr(TransInfo *t)
-{
- switch (t->mode) {
- case TFM_TRANSLATION:
- return "Translate";
- case TFM_ROTATION:
- return "Rotate";
- case TFM_RESIZE:
- return "Scale";
- case TFM_TOSPHERE:
- return "To Sphere";
- case TFM_SHEAR:
- return "Shear";
- case TFM_WARP:
- return "Warp";
- case TFM_SHRINKFATTEN:
- return "Shrink/Fatten";
- case TFM_TILT:
- return "Tilt";
- case TFM_TRACKBALL:
- return "Trackball";
- case TFM_PUSHPULL:
- return "Push/Pull";
- case TFM_BEVEL:
- return "Bevel";
- case TFM_BWEIGHT:
- return "Bevel Weight";
- case TFM_CREASE:
- return "Crease";
- case TFM_BONESIZE:
- return "Bone Width";
- case TFM_BONE_ENVELOPE:
- return "Bone Envelope";
- case TFM_TIME_TRANSLATE:
- return "Translate Anim. Data";
- case TFM_TIME_SCALE:
- return "Scale Anim. Data";
- case TFM_TIME_SLIDE:
- return "Time Slide";
- case TFM_BAKE_TIME:
- return "Key Time";
- case TFM_MIRROR:
- return "Mirror";
- }
- return "Transform";
-}
-
-/* ************************************************* */
-
-static void transformEvent(unsigned short event, short val) {
- float mati[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}};
- char cmode = constraintModeToChar(&Trans);
-
- if (val) {
- switch (event){
- /* enforce redraw of transform when modifiers are used */
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
- Trans.redraw = 1;
- break;
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- /* shift is modifier for higher resolution transform, works nice to store this mouse position */
- getmouseco_areawin(Trans.shiftmval);
- Trans.flag |= T_SHIFT_MOD;
- Trans.redraw = 1;
- break;
-
- case SPACEKEY:
- if ((Trans.spacetype==SPACE_VIEW3D) && (G.qual & LR_ALTKEY)) {
- short mval[2];
-
- getmouseco_sc(mval);
- BIF_selectOrientation();
- calc_manipulator_stats(curarea);
- Mat3CpyMat4(Trans.spacemtx, G.vd->twmat);
- warp_pointer(mval[0], mval[1]);
- }
- else {
- Trans.state = TRANS_CONFIRM;
- }
- break;
-
-
- case MIDDLEMOUSE:
- if ((Trans.flag & T_NO_CONSTRAINT)==0) {
- /* exception for switching to dolly, or trackball, in camera view */
- if (Trans.flag & T_CAMERA) {
- if (Trans.mode==TFM_TRANSLATION)
- setLocalConstraint(&Trans, (CON_AXIS2), "along local Z");
- else if (Trans.mode==TFM_ROTATION) {
- restoreTransObjects(&Trans);
- initTrackball(&Trans);
- }
- }
- else {
- Trans.flag |= T_MMB_PRESSED;
- if (Trans.con.mode & CON_APPLY) {
- stopConstraint(&Trans);
- }
- else {
- if (G.qual & LR_CTRLKEY) {
- initSelectConstraint(&Trans, Trans.spacemtx);
- }
- else {
- /* bit hackish... but it prevents mmb select to print the orientation from menu */
- strcpy(Trans.spacename, "global");
- initSelectConstraint(&Trans, mati);
- }
- postSelectConstraint(&Trans);
- }
- }
- Trans.redraw = 1;
- }
- break;
- case ESCKEY:
- case RIGHTMOUSE:
- Trans.state = TRANS_CANCEL;
- break;
- case LEFTMOUSE:
- case PADENTER:
- case RETKEY:
- Trans.state = TRANS_CONFIRM;
- break;
- case GKEY:
- /* only switch when... */
- if( ELEM3(Trans.mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) {
- restoreTransObjects(&Trans);
- initTranslation(&Trans);
- Trans.redraw = 1;
- }
- break;
- case SKEY:
- /* only switch when... */
- if( ELEM3(Trans.mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) {
- restoreTransObjects(&Trans);
- initResize(&Trans);
- Trans.redraw = 1;
- }
- break;
- case RKEY:
- /* only switch when... */
- if( ELEM4(Trans.mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) {
-
- if (Trans.mode == TFM_ROTATION) {
- restoreTransObjects(&Trans);
- initTrackball(&Trans);
- }
- else {
- restoreTransObjects(&Trans);
- initRotation(&Trans);
- }
- Trans.redraw = 1;
- }
- break;
- case CKEY:
- if (G.qual & LR_ALTKEY) {
- Trans.flag ^= T_PROP_CONNECTED;
- sort_trans_data_dist(&Trans);
- calculatePropRatio(&Trans);
- Trans.redraw= 1;
- }
- else {
- stopConstraint(&Trans);
- Trans.redraw = 1;
- }
- break;
- case XKEY:
- if ((Trans.flag & T_NO_CONSTRAINT)==0) {
- if (cmode == 'X') {
- if (Trans.flag & T_2D_EDIT) {
- stopConstraint(&Trans);
- }
- else {
- if (Trans.con.mode & CON_USER) {
- stopConstraint(&Trans);
- }
- else {
- if (G.qual == 0)
- setUserConstraint(&Trans, (CON_AXIS0), "along %s X");
- else if (G.qual == LR_SHIFTKEY)
- setUserConstraint(&Trans, (CON_AXIS1|CON_AXIS2), "locking %s X");
- }
- }
- }
- else {
- if (Trans.flag & T_2D_EDIT) {
- setConstraint(&Trans, mati, (CON_AXIS0), "along X axis");
- }
- else {
- if (G.qual == 0)
- setConstraint(&Trans, mati, (CON_AXIS0), "along global X");
- else if (G.qual == LR_SHIFTKEY)
- setConstraint(&Trans, mati, (CON_AXIS1|CON_AXIS2), "locking global X");
- }
- }
- Trans.redraw = 1;
- }
- break;
- case YKEY:
- if ((Trans.flag & T_NO_CONSTRAINT)==0) {
- if (cmode == 'Y') {
- if (Trans.flag & T_2D_EDIT) {
- stopConstraint(&Trans);
- }
- else {
- if (Trans.con.mode & CON_USER) {
- stopConstraint(&Trans);
- }
- else {
- if (G.qual == 0)
- setUserConstraint(&Trans, (CON_AXIS1), "along %s Y");
- else if (G.qual == LR_SHIFTKEY)
- setUserConstraint(&Trans, (CON_AXIS0|CON_AXIS2), "locking %s Y");
- }
- }
- }
- else {
- if (Trans.flag & T_2D_EDIT) {
- setConstraint(&Trans, mati, (CON_AXIS1), "along Y axis");
- }
- else {
- if (G.qual == 0)
- setConstraint(&Trans, mati, (CON_AXIS1), "along global Y");
- else if (G.qual == LR_SHIFTKEY)
- setConstraint(&Trans, mati, (CON_AXIS0|CON_AXIS2), "locking global Y");
- }
- }
- Trans.redraw = 1;
- }
- break;
- case ZKEY:
- if ((Trans.flag & T_NO_CONSTRAINT)==0) {
- if (cmode == 'Z') {
- if (Trans.con.mode & CON_USER) {
- stopConstraint(&Trans);
- }
- else {
- if (G.qual == 0)
- setUserConstraint(&Trans, (CON_AXIS2), "along %s Z");
- else if ((G.qual == LR_SHIFTKEY) && ((Trans.flag & T_2D_EDIT)==0))
- setUserConstraint(&Trans, (CON_AXIS0|CON_AXIS1), "locking %s Z");
- }
- }
- else if ((Trans.flag & T_2D_EDIT)==0) {
- if (G.qual == 0)
- setConstraint(&Trans, mati, (CON_AXIS2), "along global Z");
- else if (G.qual == LR_SHIFTKEY)
- setConstraint(&Trans, mati, (CON_AXIS0|CON_AXIS1), "locking global Z");
- }
- Trans.redraw = 1;
- }
- break;
- case OKEY:
- if (Trans.flag & T_PROP_EDIT && G.qual==LR_SHIFTKEY) {
- G.scene->prop_mode = (G.scene->prop_mode+1)%6;
- calculatePropRatio(&Trans);
- Trans.redraw= 1;
- }
- break;
- case PADPLUSKEY:
- if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 1.1f;
- calculatePropRatio(&Trans);
- }
- Trans.redraw= 1;
- break;
- case PAGEUPKEY:
- case WHEELDOWNMOUSE:
- if (Trans.flag & T_AUTOIK) {
- transform_autoik_update(&Trans, 1);
- }
- else if(Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 1.1f;
- calculatePropRatio(&Trans);
- }
- else view_editmove(event);
- Trans.redraw= 1;
- break;
- case PADMINUS:
- if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 0.90909090f;
- calculatePropRatio(&Trans);
- }
- Trans.redraw= 1;
- break;
- case PAGEDOWNKEY:
- case WHEELUPMOUSE:
- if (Trans.flag & T_AUTOIK) {
- transform_autoik_update(&Trans, -1);
- }
- else if (Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 0.90909090f;
- calculatePropRatio(&Trans);
- }
- else view_editmove(event);
- Trans.redraw= 1;
- break;
-// case NDOFMOTION:
-// viewmoveNDOF(1);
- // break;
- }
-
- // Numerical input events
- Trans.redraw |= handleNumInput(&(Trans.num), event);
-
- // NDof input events
- switch(handleNDofInput(&(Trans.ndof), event, val))
- {
- case NDOF_CONFIRM:
- if ((Trans.context & CTX_NDOF) == 0)
- {
- /* Confirm on normal transform only */
- Trans.state = TRANS_CONFIRM;
- }
- break;
- case NDOF_CANCEL:
- if (Trans.context & CTX_NDOF)
- {
- /* Cancel on pure NDOF transform */
- Trans.state = TRANS_CANCEL;
- }
- else
- {
- /* Otherwise, just redraw, NDof input was cancelled */
- Trans.redraw = 1;
- }
- break;
- case NDOF_NOMOVE:
- if (Trans.context & CTX_NDOF)
- {
- /* Confirm on pure NDOF transform */
- Trans.state = TRANS_CONFIRM;
- }
- break;
- case NDOF_REFRESH:
- Trans.redraw = 1;
- break;
-
- }
-
- // Snapping events
- Trans.redraw |= handleSnapping(&Trans, event);
-
- arrows_move_cursor(event);
- }
- else {
- switch (event){
- /* no redraw on release modifier keys! this makes sure you can assign the 'grid' still
- after releasing modifer key */
- case MIDDLEMOUSE:
- if ((Trans.flag & T_NO_CONSTRAINT)==0) {
- Trans.flag &= ~T_MMB_PRESSED;
- postSelectConstraint(&Trans);
- Trans.redraw = 1;
- }
- break;
- case LEFTMOUSE:
- case RIGHTMOUSE:
- if (Trans.context & CTX_TWEAK)
- Trans.state = TRANS_CONFIRM;
- break;
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- /* shift is modifier for higher resolution transform */
- Trans.flag &= ~T_SHIFT_MOD;
- break;
- }
- }
-
- // Per transform event, if present
- if (Trans.handleEvent)
- Trans.redraw |= Trans.handleEvent(&Trans, event, val);
-}
-
-int calculateTransformCenter(int centerMode, float *vec)
-{
- int success = 1;
- checkFirstTime();
-
- Trans.state = TRANS_RUNNING;
-
- Trans.context = CTX_NONE;
-
- Trans.mode = TFM_DUMMY;
-
- initTrans(&Trans); // internal data, mouse, vectors
-
- createTransData(&Trans); // make TransData structs from selection
-
- Trans.around = centerMode; // override userdefined mode
-
- if (Trans.total == 0) {
- success = 0;
- }
- else {
- success = 1;
-
- calculateCenter(&Trans);
-
- // Copy center from constraint center. Transform center can be local
- VECCOPY(vec, Trans.con.center);
- }
-
- postTrans(&Trans);
-
- /* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */
- special_aftertrans_update(&Trans);
-
- return success;
-}
-
-void initTransform(int mode, int context) {
- /* added initialize, for external calls to set stuff in TransInfo, like undo string */
- checkFirstTime();
-
- Trans.state = TRANS_RUNNING;
-
- Trans.context = context;
-
- Trans.mode = mode;
-
- initTrans(&Trans); // internal data, mouse, vectors
-
- if(Trans.spacetype==SPACE_VIEW3D) {
- calc_manipulator_stats(curarea);
- Mat3CpyMat4(Trans.spacemtx, G.vd->twmat);
- Mat3Ortho(Trans.spacemtx);
- }
- else
- Mat3One(Trans.spacemtx);
-
- createTransData(&Trans); // make TransData structs from selection
-
- initSnapping(&Trans); // Initialize snapping data AFTER mode flags
-
- if (Trans.total == 0) {
- postTrans(&Trans);
- return;
- }
-
- /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */
- /* EVIL2: we gave as argument also texture space context bit... was cleared */
- /* EVIL3: extend mode for animation editors also switches modes... but is best way to avoid duplicate code */
- mode = Trans.mode;
-
- calculatePropRatio(&Trans);
- calculateCenter(&Trans);
-
- switch (mode) {
- case TFM_TRANSLATION:
- initTranslation(&Trans);
- break;
- case TFM_ROTATION:
- initRotation(&Trans);
- break;
- case TFM_RESIZE:
- initResize(&Trans);
- break;
- case TFM_TOSPHERE:
- initToSphere(&Trans);
- break;
- case TFM_SHEAR:
- initShear(&Trans);
- break;
- case TFM_WARP:
- initWarp(&Trans);
- break;
- case TFM_SHRINKFATTEN:
- initShrinkFatten(&Trans);
- break;
- case TFM_TILT:
- initTilt(&Trans);
- break;
- case TFM_CURVE_SHRINKFATTEN:
- initCurveShrinkFatten(&Trans);
- break;
- case TFM_TRACKBALL:
- initTrackball(&Trans);
- break;
- case TFM_PUSHPULL:
- initPushPull(&Trans);
- break;
- case TFM_CREASE:
- initCrease(&Trans);
- break;
- case TFM_BONESIZE:
- { /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */
- bArmature *arm= Trans.poseobj->data;
- if(arm->drawtype==ARM_ENVELOPE)
- initBoneEnvelope(&Trans);
- else
- initBoneSize(&Trans);
- }
- break;
- case TFM_BONE_ENVELOPE:
- initBoneEnvelope(&Trans);
- break;
- case TFM_BONE_ROLL:
- initBoneRoll(&Trans);
- break;
- case TFM_TIME_TRANSLATE:
- initTimeTranslate(&Trans);
- break;
- case TFM_TIME_SLIDE:
- initTimeSlide(&Trans);
- break;
- case TFM_TIME_SCALE:
- initTimeScale(&Trans);
- break;
- case TFM_TIME_EXTEND:
- /* now that transdata has been made, do like for TFM_TIME_TRANSLATE */
- initTimeTranslate(&Trans);
- break;
- case TFM_BAKE_TIME:
- initBakeTime(&Trans);
- break;
- case TFM_MIRROR:
- initMirror(&Trans);
- break;
- case TFM_BEVEL:
- initBevel(&Trans);
- break;
- case TFM_BWEIGHT:
- initBevelWeight(&Trans);
- break;
- case TFM_ALIGN:
- initAlign(&Trans);
- break;
- }
-}
-
-void Transform()
-{
- short pmval[2] = {0, 0}, mval[2], val;
- unsigned short event;
-
- if(Trans.total==0) return; // added, can happen now! (ton)
-
- // Emptying event queue
- while( qtest() ) {
- event= extern_qread(&val);
- }
-
- Trans.redraw = 1; /* initial draw */
-
- while (Trans.state == TRANS_RUNNING) {
-
- getmouseco_areawin(mval);
-
- if (mval[0] != pmval[0] || mval[1] != pmval[1]) {
- if (Trans.flag & T_MMB_PRESSED)
- Trans.con.mode |= CON_SELECT;
- Trans.redraw = 1;
- }
- if (Trans.redraw) {
- pmval[0] = mval[0];
- pmval[1] = mval[1];
-
- selectConstraint(&Trans);
- if (Trans.transform) {
- Trans.transform(&Trans, mval); // calls recalcData()
- }
- Trans.redraw = 0;
- }
-
- /* If auto confirm is on, break after one pass */
- if (Trans.context & CTX_AUTOCONFIRM)
- {
- Trans.state = TRANS_CONFIRM;
- break;
- }
-
- /* essential for idling subloop */
- if( qtest()==0) PIL_sleep_ms(2);
-
- while( qtest() ) {
- event= extern_qread(&val);
- transformEvent(event, val);
- }
-
- if(BKE_ptcache_get_continue_physics()) {
- do_screenhandlers(G.curscreen);
- Trans.redraw= 1;
- }
- }
-
-
- /* handle restoring objects */
- if(Trans.state == TRANS_CANCEL)
- restoreTransObjects(&Trans); // calls recalcData()
-
- /* free data */
- postTrans(&Trans);
-
- /* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */
- special_aftertrans_update(&Trans);
-
- /* send events out for redraws */
- viewRedrawPost(&Trans);
-
- /* Undo as last, certainly after special_trans_update! */
- if(Trans.state == TRANS_CANCEL) {
- if(Trans.undostr) BIF_undo_push(Trans.undostr);
- }
- else {
- if(Trans.undostr) BIF_undo_push(Trans.undostr);
- else BIF_undo_push(transform_to_undostr(&Trans));
- }
- Trans.undostr= NULL;
-
-}
-
-/* ************************** Manipulator init and main **************************** */
-
-void initManipulator(int mode)
-{
- Trans.state = TRANS_RUNNING;
-
- Trans.context = CTX_NONE;
-
- Trans.mode = mode;
-
- /* automatic switch to scaling bone envelopes */
- if(mode==TFM_RESIZE && G.obedit && G.obedit->type==OB_ARMATURE) {
- bArmature *arm= G.obedit->data;
- if(arm->drawtype==ARM_ENVELOPE)
- mode= TFM_BONE_ENVELOPE;
- }
-
- initTrans(&Trans); // internal data, mouse, vectors
-
- G.moving |= G_TRANSFORM_MANIP; // signal to draw manipuls while transform
- createTransData(&Trans); // make TransData structs from selection
-
- if (Trans.total == 0)
- return;
-
- initSnapping(&Trans); // Initialize snapping data AFTER mode flags
-
- /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */
- /* EVIL2: we gave as argument also texture space context bit... was cleared */
- mode = Trans.mode;
-
- calculatePropRatio(&Trans);
- calculateCenter(&Trans);
-
- switch (mode) {
- case TFM_TRANSLATION:
- initTranslation(&Trans);
- break;
- case TFM_ROTATION:
- initRotation(&Trans);
- break;
- case TFM_RESIZE:
- initResize(&Trans);
- break;
- case TFM_TRACKBALL:
- initTrackball(&Trans);
- break;
- }
-
- Trans.flag |= T_USES_MANIPULATOR;
-}
-
-void ManipulatorTransform()
-{
- int mouse_moved = 0;
- short pmval[2] = {0, 0}, mval[2], val;
- unsigned short event;
-
- if (Trans.total == 0)
- return;
-
- Trans.redraw = 1; /* initial draw */
-
- while (Trans.state == TRANS_RUNNING) {
-
- getmouseco_areawin(mval);
-
- if (mval[0] != pmval[0] || mval[1] != pmval[1]) {
- Trans.redraw = 1;
- }
- if (Trans.redraw) {
- pmval[0] = mval[0];
- pmval[1] = mval[1];
-
- //selectConstraint(&Trans); needed?
- if (Trans.transform) {
- Trans.transform(&Trans, mval);
- }
- Trans.redraw = 0;
- }
-
- /* essential for idling subloop */
- if( qtest()==0) PIL_sleep_ms(2);
-
- while( qtest() ) {
- event= extern_qread(&val);
-
- switch (event){
- case MOUSEX:
- case MOUSEY:
- mouse_moved = 1;
- break;
- /* enforce redraw of transform when modifiers are used */
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
- if(val) Trans.redraw = 1;
- break;
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- /* shift is modifier for higher resolution transform, works nice to store this mouse position */
- if(val) {
- getmouseco_areawin(Trans.shiftmval);
- Trans.flag |= T_SHIFT_MOD;
- Trans.redraw = 1;
- }
- else Trans.flag &= ~T_SHIFT_MOD;
- break;
-
- case ESCKEY:
- case RIGHTMOUSE:
- Trans.state = TRANS_CANCEL;
- break;
- case LEFTMOUSE:
- if(mouse_moved==0 && val==0) break;
- // else we pass on event to next, which cancels
- case SPACEKEY:
- case PADENTER:
- case RETKEY:
- Trans.state = TRANS_CONFIRM;
- break;
- // case NDOFMOTION:
- // viewmoveNDOF(1);
- // break;
- }
- if(val) {
- switch(event) {
- case PADPLUSKEY:
- if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 1.1f;
- calculatePropRatio(&Trans);
- }
- Trans.redraw= 1;
- break;
- case PAGEUPKEY:
- case WHEELDOWNMOUSE:
- if (Trans.flag & T_AUTOIK) {
- transform_autoik_update(&Trans, 1);
- }
- else if(Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 1.1f;
- calculatePropRatio(&Trans);
- }
- else view_editmove(event);
- Trans.redraw= 1;
- break;
- case PADMINUS:
- if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 0.90909090f;
- calculatePropRatio(&Trans);
- }
- Trans.redraw= 1;
- break;
- case PAGEDOWNKEY:
- case WHEELUPMOUSE:
- if (Trans.flag & T_AUTOIK) {
- transform_autoik_update(&Trans, -1);
- }
- else if (Trans.flag & T_PROP_EDIT) {
- Trans.propsize*= 0.90909090f;
- calculatePropRatio(&Trans);
- }
- else view_editmove(event);
- Trans.redraw= 1;
- break;
- }
-
- // Numerical input events
- Trans.redraw |= handleNumInput(&(Trans.num), event);
- }
- }
- }
-
- if(Trans.state == TRANS_CANCEL) {
- restoreTransObjects(&Trans);
- }
-
- /* free data, reset vars */
- postTrans(&Trans);
-
- /* aftertrans does insert ipos and action channels, and clears base flags */
- special_aftertrans_update(&Trans);
-
- /* send events out for redraws */
- viewRedrawPost(&Trans);
-
- if(Trans.state != TRANS_CANCEL) {
- BIF_undo_push(transform_to_undostr(&Trans));
- }
-
-}
-
-/* ************************** TRANSFORM LOCKS **************************** */
-
-static void protectedTransBits(short protectflag, float *vec)
-{
- if(protectflag & OB_LOCK_LOCX)
- vec[0]= 0.0f;
- if(protectflag & OB_LOCK_LOCY)
- vec[1]= 0.0f;
- if(protectflag & OB_LOCK_LOCZ)
- vec[2]= 0.0f;
-}
-
-static void protectedSizeBits(short protectflag, float *size)
-{
- if(protectflag & OB_LOCK_SCALEX)
- size[0]= 1.0f;
- if(protectflag & OB_LOCK_SCALEY)
- size[1]= 1.0f;
- if(protectflag & OB_LOCK_SCALEZ)
- size[2]= 1.0f;
-}
-
-static void protectedRotateBits(short protectflag, float *eul, float *oldeul)
-{
- if(protectflag & OB_LOCK_ROTX)
- eul[0]= oldeul[0];
- if(protectflag & OB_LOCK_ROTY)
- eul[1]= oldeul[1];
- if(protectflag & OB_LOCK_ROTZ)
- eul[2]= oldeul[2];
-}
-
-static void protectedQuaternionBits(short protectflag, float *quat, float *oldquat)
-{
- /* quaternions get limited with euler... */
- /* this function only does the delta rotation */
-
- if(protectflag) {
- float eul[3], oldeul[3], quat1[4];
-
- QUATCOPY(quat1, quat);
- QuatToEul(quat, eul);
- QuatToEul(oldquat, oldeul);
-
- if(protectflag & OB_LOCK_ROTX)
- eul[0]= oldeul[0];
- if(protectflag & OB_LOCK_ROTY)
- eul[1]= oldeul[1];
- if(protectflag & OB_LOCK_ROTZ)
- eul[2]= oldeul[2];
-
- EulToQuat(eul, quat);
- /* quaternions flip w sign to accumulate rotations correctly */
- if( (quat1[0]<0.0f && quat[0]>0.0f) || (quat1[0]>0.0f && quat[0]<0.0f) ) {
- QuatMulf(quat, -1.0f);
- }
- }
-}
-
-/* ******************* TRANSFORM LIMITS ********************** */
-
-static void constraintTransLim(TransInfo *t, TransData *td)
-{
- if (td->con) {
- bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT);
- bConstraintOb cob;
- bConstraint *con;
-
- /* Make a temporary bConstraintOb for using these limit constraints
- * - they only care that cob->matrix is correctly set ;-)
- * - current space should be local
- */
- memset(&cob, 0, sizeof(bConstraintOb));
- Mat4One(cob.matrix);
- if (td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- cob.matrix[3][0]= tdi->locx[0];
- cob.matrix[3][1]= tdi->locy[0];
- cob.matrix[3][2]= tdi->locz[0];
- }
- else {
- VECCOPY(cob.matrix[3], td->loc);
- }
-
- /* Evaluate valid constraints */
- for (con= td->con; con; con= con->next) {
- float tmat[4][4];
-
- /* only consider constraint if enabled */
- if (con->flag & CONSTRAINT_DISABLE) continue;
- if (con->enforce == 0.0f) continue;
-
- /* only use it if it's tagged for this purpose (and the right type) */
- if (con->type == CONSTRAINT_TYPE_LOCLIMIT) {
- bLocLimitConstraint *data= con->data;
-
- if ((data->flag2 & LIMIT_TRANSFORM)==0)
- continue;
-
- /* do space conversions */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->mtx, tmat);
- }
- else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
- /* skip... incompatable spacetype */
- continue;
- }
-
- /* do constraint */
- cti->evaluate_constraint(con, &cob, NULL);
-
- /* convert spaces again */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->smtx, tmat);
- }
- }
- }
-
- /* copy results from cob->matrix */
- if (td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- tdi->locx[0]= cob.matrix[3][0];
- tdi->locy[0]= cob.matrix[3][1];
- tdi->locz[0]= cob.matrix[3][2];
- }
- else {
- VECCOPY(td->loc, cob.matrix[3]);
- }
- }
-}
-
-static void constraintRotLim(TransInfo *t, TransData *td)
-{
- if (td->con) {
- bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT);
- bConstraintOb cob;
- bConstraint *con;
-
- /* Make a temporary bConstraintOb for using these limit constraints
- * - they only care that cob->matrix is correctly set ;-)
- * - current space should be local
- */
- memset(&cob, 0, sizeof(bConstraintOb));
- if (td->flag & TD_USEQUAT) {
- /* quats */
- if (td->ext)
- QuatToMat4(td->ext->quat, cob.matrix);
- else
- return;
- }
- else if (td->tdi) {
- /* ipo-keys eulers */
- TransDataIpokey *tdi= td->tdi;
- float eul[3];
-
- eul[0]= tdi->rotx[0];
- eul[1]= tdi->roty[0];
- eul[2]= tdi->rotz[0];
-
- EulToMat4(eul, cob.matrix);
- }
- else {
- /* eulers */
- if (td->ext)
- EulToMat4(td->ext->rot, cob.matrix);
- else
- return;
- }
-
- /* Evaluate valid constraints */
- for (con= td->con; con; con= con->next) {
- /* only consider constraint if enabled */
- if (con->flag & CONSTRAINT_DISABLE) continue;
- if (con->enforce == 0.0f) continue;
-
- /* we're only interested in Limit-Rotation constraints */
- if (con->type == CONSTRAINT_TYPE_ROTLIMIT) {
- bRotLimitConstraint *data= con->data;
- float tmat[4][4];
-
- /* only use it if it's tagged for this purpose */
- if ((data->flag2 & LIMIT_TRANSFORM)==0)
- continue;
-
- /* do space conversions */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->mtx, tmat);
- }
- else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
- /* skip... incompatable spacetype */
- continue;
- }
-
- /* do constraint */
- cti->evaluate_constraint(con, &cob, NULL);
-
- /* convert spaces again */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->smtx, tmat);
- }
- }
- }
-
- /* copy results from cob->matrix */
- if (td->flag & TD_USEQUAT) {
- /* quats */
- Mat4ToQuat(cob.matrix, td->ext->quat);
- }
- else if (td->tdi) {
- /* ipo-keys eulers */
- TransDataIpokey *tdi= td->tdi;
- float eul[3];
-
- Mat4ToEul(cob.matrix, eul);
-
- tdi->rotx[0]= eul[0];
- tdi->roty[0]= eul[1];
- tdi->rotz[0]= eul[2];
- }
- else {
- /* eulers */
- Mat4ToEul(cob.matrix, td->ext->rot);
- }
- }
-}
-
-static void constraintSizeLim(TransInfo *t, TransData *td)
-{
- if (td->con && td->ext) {
- bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
- bConstraintOb cob;
- bConstraint *con;
-
- /* Make a temporary bConstraintOb for using these limit constraints
- * - they only care that cob->matrix is correctly set ;-)
- * - current space should be local
- */
- memset(&cob, 0, sizeof(bConstraintOb));
- if (td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- float size[3];
-
- size[0]= tdi->sizex[0];
- size[1]= tdi->sizey[0];
- size[2]= tdi->sizez[0];
- SizeToMat4(size, cob.matrix);
- }
- else if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
- /* scale val and reset size */
- return; // TODO: fix this case
- }
- else {
- /* Reset val if SINGLESIZE but using a constraint */
- if (td->flag & TD_SINGLESIZE)
- return;
-
- SizeToMat4(td->ext->size, cob.matrix);
- }
-
- /* Evaluate valid constraints */
- for (con= td->con; con; con= con->next) {
- /* only consider constraint if enabled */
- if (con->flag & CONSTRAINT_DISABLE) continue;
- if (con->enforce == 0.0f) continue;
-
- /* we're only interested in Limit-Scale constraints */
- if (con->type == CONSTRAINT_TYPE_SIZELIMIT) {
- bSizeLimitConstraint *data= con->data;
- float tmat[4][4];
-
- /* only use it if it's tagged for this purpose */
- if ((data->flag2 & LIMIT_TRANSFORM)==0)
- continue;
-
- /* do space conversions */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->mtx, tmat);
- }
- else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
- /* skip... incompatable spacetype */
- continue;
- }
-
- /* do constraint */
- cti->evaluate_constraint(con, &cob, NULL);
-
- /* convert spaces again */
- if (con->ownspace == CONSTRAINT_SPACE_WORLD) {
- /* just multiply by td->mtx (this should be ok) */
- Mat4CpyMat4(tmat, cob.matrix);
- Mat4MulMat34(cob.matrix, td->smtx, tmat);
- }
- }
- }
-
- /* copy results from cob->matrix */
- if (td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- float size[3];
-
- Mat4ToSize(cob.matrix, size);
-
- tdi->sizex[0]= size[0];
- tdi->sizey[0]= size[1];
- tdi->sizez[0]= size[2];
- }
- else if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) {
- /* scale val and reset size */
- return; // TODO: fix this case
- }
- else {
- /* Reset val if SINGLESIZE but using a constraint */
- if (td->flag & TD_SINGLESIZE)
- return;
-
- Mat4ToSize(cob.matrix, td->ext->size);
- }
- }
-}
-
-/* ************************** WARP *************************** */
-
-void initWarp(TransInfo *t)
-{
- float max[3], min[3];
- int i;
-
- t->mode = TFM_WARP;
- t->transform = Warp;
- t->handleEvent = handleEventWarp;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 5.0f;
- t->snap[2] = 1.0f;
-
- t->flag |= T_NO_CONSTRAINT;
-
-/* warp is done fully in view space */
- calculateCenterCursor(t);
- t->fac = (float)(t->center2d[0] - t->imval[0]);
-
- /* we need min/max in view space */
- for(i = 0; i < t->total; i++) {
- float center[3];
- VECCOPY(center, t->data[i].center);
- Mat3MulVecfl(t->data[i].mtx, center);
- Mat4MulVecfl(t->viewmat, center);
- VecSubf(center, center, t->viewmat[3]);
- if (i)
- MinMax3(min, max, center);
- else {
- VECCOPY(max, center);
- VECCOPY(min, center);
- }
- }
-
- t->center[0]= (min[0]+max[0])/2.0f;
- t->center[1]= (min[1]+max[1])/2.0f;
- t->center[2]= (min[2]+max[2])/2.0f;
-
- if (max[0] == min[0]) max[0] += 0.1; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */
- t->val= (max[0]-min[0])/2.0f; /* t->val is X dimension projected boundbox */
-}
-
-int handleEventWarp(TransInfo *t, unsigned short event, short val)
-{
- int status = 0;
-
- if (event == MIDDLEMOUSE && val)
- {
- // Use customData pointer to signal warp direction
- if (t->customData == 0)
- t->customData = (void*)1;
- else
- t->customData = 0;
-
- status = 1;
- }
-
- return status;
-}
-
-int Warp(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3];
- int i;
- char str[50];
-
- curs= give_cursor();
- /*
- * gcursor is the one used for helpline.
- * It has to be in the same space as the drawing loop
- * (that means it needs to be in the object's space when in edit mode and
- * in global space in object mode)
- *
- * cursor is used for calculations.
- * It needs to be in view space, but we need to take object's offset
- * into account if in Edit mode.
- */
- VECCOPY(cursor, curs);
- VECCOPY(gcursor, cursor);
- if (t->flag & T_EDIT) {
- VecSubf(cursor, cursor, G.obedit->obmat[3]);
- VecSubf(gcursor, gcursor, G.obedit->obmat[3]);
- Mat3MulVecfl(t->data->smtx, gcursor);
- }
- Mat4MulVecfl(t->viewmat, cursor);
- VecSubf(cursor, cursor, t->viewmat[3]);
-
- /* amount of degrees for warp */
- circumfac= 360.0f * InputHorizontalRatio(t, mval);
-
- if (t->customData) /* non-null value indicates reversed input */
- {
- circumfac *= -1;
- }
-
- snapGrid(t, &circumfac);
- applyNumInput(&t->num, &circumfac);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Warp: %s", c);
- }
- else {
- /* default header print */
- sprintf(str, "Warp: %.3f", circumfac);
- }
-
- circumfac*= (float)(-M_PI/360.0);
-
- for(i = 0; i < t->total; i++, td++) {
- float loc[3];
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- /* translate point to center, rotate in such a way that outline==distance */
- VECCOPY(vec, td->iloc);
- Mat3MulVecfl(td->mtx, vec);
- Mat4MulVecfl(t->viewmat, vec);
- VecSubf(vec, vec, t->viewmat[3]);
-
- dist= vec[0]-cursor[0];
-
- /* t->val is X dimension projected boundbox */
- phi0= (circumfac*dist/t->val);
-
- vec[1]= (vec[1]-cursor[1]);
-
- co= (float)cos(phi0);
- si= (float)sin(phi0);
- loc[0]= -si*vec[1]+cursor[0];
- loc[1]= co*vec[1]+cursor[1];
- loc[2]= vec[2];
-
- Mat4MulVecfl(t->viewinv, loc);
- VecSubf(loc, loc, t->viewinv[3]);
- Mat3MulVecfl(td->smtx, loc);
-
- VecSubf(loc, loc, td->iloc);
- VecMulf(loc, td->factor);
- VecAddf(td->loc, td->iloc, loc);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline(t, gcursor);
-
- return 1;
-}
-
-/* ************************** SHEAR *************************** */
-
-void initShear(TransInfo *t)
-{
- t->mode = TFM_SHEAR;
- t->transform = Shear;
- t->handleEvent = handleEventShear;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
-}
-
-int handleEventShear(TransInfo *t, unsigned short event, short val)
-{
- int status = 0;
-
- if (event == MIDDLEMOUSE && val)
- {
- // Use customData pointer to signal Shear direction
- if (t->customData == 0)
- t->customData = (void*)1;
- else
- t->customData = 0;
-
- status = 1;
- }
-
- return status;
-}
-
-
-int Shear(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float vec[3];
- float smat[3][3], tmat[3][3], totmat[3][3], persmat[3][3], persinv[3][3];
- float value;
- int i;
- char str[50];
-
- Mat3CpyMat4(persmat, t->viewmat);
- Mat3Inv(persinv, persmat);
-
- // Custom data signals shear direction
- if (t->customData == 0)
- value = 0.05f * InputHorizontalAbsolute(t, mval);
- else
- value = 0.05f * InputVerticalAbsolute(t, mval);
-
- snapGrid(t, &value);
-
- applyNumInput(&t->num, &value);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Shear: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- sprintf(str, "Shear: %.3f %s", value, t->proptext);
- }
-
- Mat3One(smat);
-
- // Custom data signals shear direction
- if (t->customData == 0)
- smat[1][0] = value;
- else
- smat[0][1] = value;
-
- Mat3MulMat3(tmat, smat, persmat);
- Mat3MulMat3(totmat, persinv, tmat);
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (G.obedit) {
- float mat3[3][3];
- Mat3MulMat3(mat3, totmat, td->mtx);
- Mat3MulMat3(tmat, td->smtx, mat3);
- }
- else {
- Mat3CpyMat3(tmat, totmat);
- }
- VecSubf(vec, td->center, t->center);
-
- Mat3MulVecfl(tmat, vec);
-
- VecAddf(vec, vec, t->center);
- VecSubf(vec, vec, td->center);
-
- VecMulf(vec, td->factor);
-
- VecAddf(td->loc, td->iloc, vec);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** RESIZE *************************** */
-
-void initResize(TransInfo *t)
-{
- t->mode = TFM_RESIZE;
- t->transform = Resize;
-
- t->flag |= T_NULL_ONE;
- t->num.flag |= NUM_NULL_ONE;
- t->num.flag |= NUM_AFFECT_ALL;
- if (!G.obedit) {
- t->flag |= T_NO_ZERO;
- t->num.flag |= NUM_NO_ZERO;
- }
-
- t->idx_max = 2;
- t->num.idx_max = 2;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->fac = (float)sqrt(
- (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-
- if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf
-}
-
-static void headerResize(TransInfo *t, float vec[3], char *str) {
- char tvec[60];
- if (hasNumInput(&t->num)) {
- outputNumInput(&(t->num), tvec);
- }
- else {
- sprintf(&tvec[0], "%.4f", vec[0]);
- sprintf(&tvec[20], "%.4f", vec[1]);
- sprintf(&tvec[40], "%.4f", vec[2]);
- }
-
- if (t->con.mode & CON_APPLY) {
- switch(t->num.idx_max) {
- case 0:
- sprintf(str, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext);
- break;
- case 1:
- sprintf(str, "Scale: %s : %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext);
- break;
- case 2:
- sprintf(str, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
- }
- }
- else {
- if (t->flag & T_2D_EDIT)
- sprintf(str, "Scale X: %s Y: %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext);
- else
- sprintf(str, "Scale X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
- }
-}
-
-#define SIGN(a) (a<-FLT_EPSILON?1:a>FLT_EPSILON?2:3)
-#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0)
-
-/* smat is reference matrix, only scaled */
-static void TransMat3ToSize( float mat[][3], float smat[][3], float *size)
-{
- float vec[3];
-
- VecCopyf(vec, mat[0]);
- size[0]= Normalize(vec);
- VecCopyf(vec, mat[1]);
- size[1]= Normalize(vec);
- VecCopyf(vec, mat[2]);
- size[2]= Normalize(vec);
-
- /* first tried with dotproduct... but the sign flip is crucial */
- if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0];
- if( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1];
- if( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2];
-}
-
-
-static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
- float tmat[3][3], smat[3][3], center[3];
- float vec[3];
-
- if (t->flag & T_EDIT) {
- Mat3MulMat3(smat, mat, td->mtx);
- Mat3MulMat3(tmat, td->smtx, smat);
- }
- else {
- Mat3CpyMat3(tmat, mat);
- }
-
- if (t->con.applySize) {
- t->con.applySize(t, td, tmat);
- }
-
- /* local constraint shouldn't alter center */
- if (t->around == V3D_LOCAL) {
- if (t->flag & T_OBJECT) {
- VECCOPY(center, td->center);
- }
- else if (t->flag & T_EDIT) {
-
- if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) {
- VECCOPY(center, td->center);
- }
- else {
- VECCOPY(center, t->center);
- }
- }
- else {
- VECCOPY(center, t->center);
- }
- }
- else {
- VECCOPY(center, t->center);
- }
-
- if (td->ext) {
- float fsize[3];
-
- if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) {
- float obsizemat[3][3];
- // Reorient the size mat to fit the oriented object.
- Mat3MulMat3(obsizemat, tmat, td->axismtx);
- //printmatrix3("obsizemat", obsizemat);
- TransMat3ToSize(obsizemat, td->axismtx, fsize);
- //printvecf("fsize", fsize);
- }
- else {
- Mat3ToSize(tmat, fsize);
- }
-
- protectedSizeBits(td->protectflag, fsize);
-
- if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself
- /* handle ipokeys? */
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- /* calculate delta size (equal for size and dsize) */
-
- vec[0]= (tdi->oldsize[0])*(fsize[0] -1.0f) * td->factor;
- vec[1]= (tdi->oldsize[1])*(fsize[1] -1.0f) * td->factor;
- vec[2]= (tdi->oldsize[2])*(fsize[2] -1.0f) * td->factor;
-
- add_tdi_poin(tdi->sizex, tdi->oldsize, vec[0]);
- add_tdi_poin(tdi->sizey, tdi->oldsize+1, vec[1]);
- add_tdi_poin(tdi->sizez, tdi->oldsize+2, vec[2]);
-
- }
- else if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)){
- /* scale val and reset size */
- *td->val = td->ival * fsize[0] * td->factor;
-
- td->ext->size[0] = td->ext->isize[0];
- td->ext->size[1] = td->ext->isize[1];
- td->ext->size[2] = td->ext->isize[2];
- }
- else {
- /* Reset val if SINGLESIZE but using a constraint */
- if (td->flag & TD_SINGLESIZE)
- *td->val = td->ival;
-
- td->ext->size[0] = td->ext->isize[0] * (fsize[0]) * td->factor;
- td->ext->size[1] = td->ext->isize[1] * (fsize[1]) * td->factor;
- td->ext->size[2] = td->ext->isize[2] * (fsize[2]) * td->factor;
- }
- }
-
- constraintSizeLim(t, td);
- }
-
- /* For individual element center, Editmode need to use iloc */
- if (t->flag & T_POINTS)
- VecSubf(vec, td->iloc, center);
- else
- VecSubf(vec, td->center, center);
-
- Mat3MulVecfl(tmat, vec);
-
- VecAddf(vec, vec, center);
- if (t->flag & T_POINTS)
- VecSubf(vec, vec, td->iloc);
- else
- VecSubf(vec, vec, td->center);
-
- VecMulf(vec, td->factor);
-
- if (t->flag & (T_OBJECT|T_POSE)) {
- Mat3MulVecfl(td->smtx, vec);
- }
-
- protectedTransBits(td->protectflag, vec);
-
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- add_tdi_poin(tdi->locx, tdi->oldloc, vec[0]);
- add_tdi_poin(tdi->locy, tdi->oldloc+1, vec[1]);
- add_tdi_poin(tdi->locz, tdi->oldloc+2, vec[2]);
- }
- else VecAddf(td->loc, td->iloc, vec);
-
- constraintTransLim(t, td);
-}
-
-int Resize(TransInfo *t, short mval[2])
-{
- TransData *td;
- float size[3], mat[3][3];
- float ratio;
- int i;
- char str[200];
-
- /* for manipulator, center handle, the scaling can't be done relative to center */
- if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) {
- ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
- }
- else {
- ratio = InputScaleRatio(t, mval);
-
- /* flip scale, but not for manipulator center handle */
- if ((t->center2d[0] - mval[0]) * (t->center2d[0] - t->imval[0]) +
- (t->center2d[1] - mval[1]) * (t->center2d[1] - t->imval[1]) < 0)
- ratio *= -1.0f;
- }
-
- size[0] = size[1] = size[2] = ratio;
-
- snapGrid(t, size);
-
- if (hasNumInput(&t->num)) {
- applyNumInput(&t->num, size);
- constraintNumInput(t, size);
- }
-
- applySnapping(t, size);
-
- SizeToMat3(size, mat);
-
- if (t->con.applySize) {
- t->con.applySize(t, NULL, mat);
- }
-
- Mat3CpyMat3(t->mat, mat); // used in manipulator
-
- headerResize(t, size, str);
-
- for(i = 0, td=t->data; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- ElementResize(t, td, mat);
- }
-
- /* evil hack - redo resize if cliping needed */
- if (t->flag & T_CLIP_UV && clipUVTransform(t, size, 1)) {
- SizeToMat3(size, mat);
-
- if (t->con.applySize)
- t->con.applySize(t, NULL, mat);
-
- for(i = 0, td=t->data; i < t->total; i++, td++)
- ElementResize(t, td, mat);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** TOSPHERE *************************** */
-
-void initToSphere(TransInfo *t)
-{
- TransData *td = t->data;
- int i;
-
- t->mode = TFM_TOSPHERE;
- t->transform = ToSphere;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->num.flag |= NUM_NULL_ONE | NUM_NO_NEGATIVE;
- t->flag |= T_NO_CONSTRAINT;
-
- // Calculate average radius
- for(i = 0 ; i < t->total; i++, td++) {
- t->val += VecLenf(t->center, td->iloc);
- }
-
- t->val /= (float)t->total;
-}
-
-int ToSphere(TransInfo *t, short mval[2])
-{
- float vec[3];
- float ratio, radius;
- int i;
- char str[64];
- TransData *td = t->data;
-
- ratio = InputHorizontalRatio(t, mval);
-
- snapGrid(t, &ratio);
-
- applyNumInput(&t->num, &ratio);
-
- if (ratio < 0)
- ratio = 0.0f;
- else if (ratio > 1)
- ratio = 1.0f;
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "To Sphere: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- sprintf(str, "To Sphere: %.4f %s", ratio, t->proptext);
- }
-
-
- for(i = 0 ; i < t->total; i++, td++) {
- float tratio;
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- VecSubf(vec, td->iloc, t->center);
-
- radius = Normalize(vec);
-
- tratio = ratio * td->factor;
-
- VecMulf(vec, radius * (1.0f - tratio) + t->val * tratio);
-
- VecAddf(td->loc, t->center, vec);
- }
-
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ************************** ROTATION *************************** */
-
-
-void initRotation(TransInfo *t)
-{
- t->mode = TFM_ROTATION;
- t->transform = Rotation;
-
- t->ndof.axis = 16;
- /* Scale down and flip input for rotation */
- t->ndof.factor[0] = -0.2f;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = (float)((5.0/180)*M_PI);
- t->snap[2] = t->snap[1] * 0.2f;
- t->fac = 0;
-
- if (t->flag & T_2D_EDIT)
- t->flag |= T_NO_CONSTRAINT;
-}
-
-static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short around) {
- float vec[3], totmat[3][3], smat[3][3];
- float eul[3], fmat[3][3], quat[4];
- float *center = t->center;
-
- /* local constraint shouldn't alter center */
- if (around == V3D_LOCAL) {
- if (t->flag & (T_OBJECT|T_POSE)) {
- center = td->center;
- }
- else {
- /* !TODO! Make this if not rely on G */
- if(around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) {
- center = td->center;
- }
- }
- }
-
- if (t->flag & T_POINTS) {
- Mat3MulMat3(totmat, mat, td->mtx);
- Mat3MulMat3(smat, td->smtx, totmat);
-
- VecSubf(vec, td->iloc, center);
- Mat3MulVecfl(smat, vec);
-
- VecAddf(td->loc, vec, center);
-
- VecSubf(vec,td->loc,td->iloc);
- protectedTransBits(td->protectflag, vec);
- VecAddf(td->loc, td->iloc, vec);
-
- if(td->flag & TD_USEQUAT) {
- Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
- Mat3ToQuat(fmat, quat); // Actual transform
-
- if(td->ext->quat){
- QuatMul(td->ext->quat, quat, td->ext->iquat);
-
- /* is there a reason not to have this here? -jahka */
- protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat);
- }
- }
- }
- /**
- * HACK WARNING
- *
- * This is some VERY ugly special case to deal with pose mode.
- *
- * The problem is that mtx and smtx include each bone orientation.
- *
- * That is needed to rotate each bone properly, HOWEVER, to calculate
- * the translation component, we only need the actual armature object's
- * matrix (and inverse). That is not all though. Once the proper translation
- * has been computed, it has to be converted back into the bone's space.
- */
- else if (t->flag & T_POSE) {
- float pmtx[3][3], imtx[3][3];
-
- // Extract and invert armature object matrix
- Mat3CpyMat4(pmtx, t->poseobj->obmat);
- Mat3Inv(imtx, pmtx);
-
- if ((td->flag & TD_NO_LOC) == 0)
- {
- VecSubf(vec, td->center, center);
-
- Mat3MulVecfl(pmtx, vec); // To Global space
- Mat3MulVecfl(mat, vec); // Applying rotation
- Mat3MulVecfl(imtx, vec); // To Local space
-
- VecAddf(vec, vec, center);
- /* vec now is the location where the object has to be */
-
- VecSubf(vec, vec, td->center); // Translation needed from the initial location
-
- Mat3MulVecfl(pmtx, vec); // To Global space
- Mat3MulVecfl(td->smtx, vec);// To Pose space
-
- protectedTransBits(td->protectflag, vec);
-
- VecAddf(td->loc, td->iloc, vec);
-
- constraintTransLim(t, td);
- }
-
- /* rotation */
- if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
- Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
-
- Mat3ToQuat(fmat, quat); // Actual transform
-
- QuatMul(td->ext->quat, quat, td->ext->iquat);
- /* this function works on end result */
- protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat);
-
- constraintRotLim(t, td);
- }
- }
- else {
-
- if ((td->flag & TD_NO_LOC) == 0)
- {
- /* translation */
- VecSubf(vec, td->center, center);
- Mat3MulVecfl(mat, vec);
- VecAddf(vec, vec, center);
- /* vec now is the location where the object has to be */
- VecSubf(vec, vec, td->center);
- Mat3MulVecfl(td->smtx, vec);
-
- protectedTransBits(td->protectflag, vec);
-
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- add_tdi_poin(tdi->locx, tdi->oldloc, vec[0]);
- add_tdi_poin(tdi->locy, tdi->oldloc+1, vec[1]);
- add_tdi_poin(tdi->locz, tdi->oldloc+2, vec[2]);
- }
- else VecAddf(td->loc, td->iloc, vec);
- }
-
-
- constraintTransLim(t, td);
-
- /* rotation */
- if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
- if(td->flag & TD_USEQUAT) {
- Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
- Mat3ToQuat(fmat, quat); // Actual transform
-
- QuatMul(td->ext->quat, quat, td->ext->iquat);
- /* this function works on end result */
- protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat);
- }
- else {
- float obmat[3][3];
-
- /* are there ipo keys? */
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- float current_rot[3];
- float rot[3];
-
- /* current IPO value for compatible euler */
- current_rot[0] = (tdi->rotx) ? tdi->rotx[0] : 0.0f;
- current_rot[1] = (tdi->roty) ? tdi->roty[0] : 0.0f;
- current_rot[2] = (tdi->rotz) ? tdi->rotz[0] : 0.0f;
- VecMulf(current_rot, (float)(M_PI_2 / 9.0));
-
- /* calculate the total rotatation in eulers */
- VecAddf(eul, td->ext->irot, td->ext->drot);
- EulToMat3(eul, obmat);
- /* mat = transform, obmat = object rotation */
- Mat3MulMat3(fmat, mat, obmat);
-
- Mat3ToCompatibleEul(fmat, eul, current_rot);
-
- /* correct back for delta rot */
- if(tdi->flag & TOB_IPODROT) {
- VecSubf(rot, eul, td->ext->irot);
- }
- else {
- VecSubf(rot, eul, td->ext->drot);
- }
-
- VecMulf(rot, (float)(9.0/M_PI_2));
- VecSubf(rot, rot, tdi->oldrot);
-
- protectedRotateBits(td->protectflag, rot, tdi->oldrot);
-
- add_tdi_poin(tdi->rotx, tdi->oldrot, rot[0]);
- add_tdi_poin(tdi->roty, tdi->oldrot+1, rot[1]);
- add_tdi_poin(tdi->rotz, tdi->oldrot+2, rot[2]);
- }
- else {
- Mat3MulMat3(totmat, mat, td->mtx);
- Mat3MulMat3(smat, td->smtx, totmat);
-
- /* calculate the total rotatation in eulers */
- VecAddf(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */
- EulToMat3(eul, obmat);
- /* mat = transform, obmat = object rotation */
- Mat3MulMat3(fmat, smat, obmat);
-
- Mat3ToCompatibleEul(fmat, eul, td->ext->rot);
-
- /* correct back for delta rot */
- VecSubf(eul, eul, td->ext->drot);
-
- /* and apply */
- protectedRotateBits(td->protectflag, eul, td->ext->irot);
- VECCOPY(td->ext->rot, eul);
- }
- }
-
- constraintRotLim(t, td);
- }
- }
-}
-
-static void applyRotation(TransInfo *t, float angle, float axis[3])
-{
- TransData *td = t->data;
- float mat[3][3];
- int i;
-
- VecRotToMat3(axis, angle, mat);
-
- for(i = 0 ; i < t->total; i++, td++) {
-
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (t->con.applyRot) {
- t->con.applyRot(t, td, axis, NULL);
- VecRotToMat3(axis, angle * td->factor, mat);
- }
- else if (t->flag & T_PROP_EDIT) {
- VecRotToMat3(axis, angle * td->factor, mat);
- }
-
- ElementRotation(t, td, mat, t->around);
- }
-}
-
-int Rotation(TransInfo *t, short mval[2])
-{
- char str[64];
-
- float final;
-
- float axis[3];
- float mat[3][3];
-
- VECCOPY(axis, t->viewinv[2]);
- VecMulf(axis, -1.0f);
- Normalize(axis);
-
- t->fac += InputDeltaAngle(t, mval);
-
- final = t->fac;
-
- applyNDofInput(&t->ndof, &final);
-
- snapGrid(t, &final);
-
- if (t->con.applyRot) {
- t->con.applyRot(t, NULL, axis, &final);
- }
-
- applySnapping(t, &final);
-
- if (hasNumInput(&t->num)) {
- char c[20];
-
- applyNumInput(&t->num, &final);
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Rot: %s %s %s", &c[0], t->con.text, t->proptext);
-
- /* Clamp between -180 and 180 */
- while (final >= 180.0)
- final -= 360.0;
-
- while (final <= -180.0)
- final += 360.0;
-
- final *= (float)(M_PI / 180.0);
- }
- else {
- sprintf(str, "Rot: %.2f%s %s", 180.0*final/M_PI, t->con.text, t->proptext);
- }
-
- VecRotToMat3(axis, final, mat);
-
- t->val = final; // used in manipulator
- Mat3CpyMat3(t->mat, mat); // used in manipulator
-
- applyRotation(t, final, axis);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-
-/* ************************** TRACKBALL *************************** */
-
-void initTrackball(TransInfo *t)
-{
- t->mode = TFM_TRACKBALL;
- t->transform = Trackball;
-
- t->ndof.axis = 40;
- /* Scale down input for rotation */
- t->ndof.factor[0] = 0.2f;
- t->ndof.factor[1] = 0.2f;
-
- t->idx_max = 1;
- t->num.idx_max = 1;
- t->snap[0] = 0.0f;
- t->snap[1] = (float)((5.0/180)*M_PI);
- t->snap[2] = t->snap[1] * 0.2f;
- t->fac = 0;
-
- t->flag |= T_NO_CONSTRAINT;
-}
-
-static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float angles[2])
-{
- TransData *td = t->data;
- float mat[3][3], smat[3][3], totmat[3][3];
- int i;
-
- VecRotToMat3(axis1, angles[0], smat);
- VecRotToMat3(axis2, angles[1], totmat);
-
- Mat3MulMat3(mat, smat, totmat);
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (t->flag & T_PROP_EDIT) {
- VecRotToMat3(axis1, td->factor * angles[0], smat);
- VecRotToMat3(axis2, td->factor * angles[1], totmat);
-
- Mat3MulMat3(mat, smat, totmat);
- }
-
- ElementRotation(t, td, mat, t->around);
- }
-}
-
-int Trackball(TransInfo *t, short mval[2])
-{
- char str[128];
- float axis1[3], axis2[3];
- float mat[3][3], totmat[3][3], smat[3][3];
- float phi[2];
-
- VECCOPY(axis1, t->persinv[0]);
- VECCOPY(axis2, t->persinv[1]);
- Normalize(axis1);
- Normalize(axis2);
-
- /* factore has to become setting or so */
- phi[0]= 0.01f*(float)( t->imval[1] - mval[1] );
- phi[1]= 0.01f*(float)( mval[0] - t->imval[0] );
-
- applyNDofInput(&t->ndof, phi);
-
- snapGrid(t, phi);
-
- if (hasNumInput(&t->num)) {
- char c[40];
-
- applyNumInput(&t->num, phi);
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Trackball: %s %s %s", &c[0], &c[20], t->proptext);
-
- phi[0] *= (float)(M_PI / 180.0);
- phi[1] *= (float)(M_PI / 180.0);
- }
- else {
- sprintf(str, "Trackball: %.2f %.2f %s", 180.0*phi[0]/M_PI, 180.0*phi[1]/M_PI, t->proptext);
-
- if(t->flag & T_SHIFT_MOD) {
- if(phi[0] != 0.0) phi[0]/= 5.0f;
- if(phi[1] != 0.0) phi[1]/= 5.0f;
- }
- }
-
- VecRotToMat3(axis1, phi[0], smat);
- VecRotToMat3(axis2, phi[1], totmat);
-
- Mat3MulMat3(mat, smat, totmat);
-
- Mat3CpyMat3(t->mat, mat); // used in manipulator
-
- applyTrackball(t, axis1, axis2, phi);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** TRANSLATION *************************** */
-
-void initTranslation(TransInfo *t)
-{
- t->mode = TFM_TRANSLATION;
- t->transform = Translation;
-
- t->idx_max = (t->flag & T_2D_EDIT)? 1: 2;
- t->num.flag = 0;
- t->num.idx_max = t->idx_max;
-
- t->ndof.axis = 7;
-
- if(t->spacetype == SPACE_VIEW3D) {
- /* initgrabz() defines a factor for perspective depth correction, used in window_to_3d() */
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- float vec[3];
-
- VECCOPY(vec, t->center);
- Mat4MulVecfl(ob->obmat, vec);
- initgrabz(vec[0], vec[1], vec[2]);
- }
- else {
- initgrabz(t->center[0], t->center[1], t->center[2]);
- }
-
- t->snap[0] = 0.0f;
- t->snap[1] = G.vd->gridview * 1.0f;
- t->snap[2] = t->snap[1] * 0.1f;
- }
- else if(t->spacetype == SPACE_IMAGE) {
- t->snap[0] = 0.0f;
- t->snap[1] = 0.125f;
- t->snap[2] = 0.0625f;
- }
- else {
- t->snap[0] = 0.0f;
- t->snap[1] = t->snap[2] = 1.0f;
- }
-}
-
-static void headerTranslation(TransInfo *t, float vec[3], char *str) {
- char tvec[60];
- char distvec[20];
- char autoik[20];
- float dvec[3];
- float dist;
-
- convertVecToDisplayNum(vec, dvec);
-
- if (hasNumInput(&t->num)) {
- outputNumInput(&(t->num), tvec);
- dist = VecLength(t->num.val);
- }
- else {
- dist = VecLength(vec);
- sprintf(&tvec[0], "%.4f", dvec[0]);
- sprintf(&tvec[20], "%.4f", dvec[1]);
- sprintf(&tvec[40], "%.4f", dvec[2]);
- }
-
- if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */
- sprintf(distvec, "%.4e", dist);
- else
- sprintf(distvec, "%.4f", dist);
-
- if(t->flag & T_AUTOIK) {
- short chainlen= G.scene->toolsettings->autoik_chainlen;
-
- if(chainlen)
- sprintf(autoik, "AutoIK-Len: %d", chainlen);
- else
- strcpy(autoik, "");
- }
- else
- strcpy(autoik, "");
-
- if (t->con.mode & CON_APPLY) {
- switch(t->num.idx_max) {
- case 0:
- sprintf(str, "D: %s (%s)%s %s %s", &tvec[0], distvec, t->con.text, t->proptext, &autoik[0]);
- break;
- case 1:
- sprintf(str, "D: %s D: %s (%s)%s %s %s", &tvec[0], &tvec[20], distvec, t->con.text, t->proptext, &autoik[0]);
- break;
- case 2:
- sprintf(str, "D: %s D: %s D: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]);
- }
- }
- else {
- if(t->flag & T_2D_EDIT)
- sprintf(str, "Dx: %s Dy: %s (%s)%s %s", &tvec[0], &tvec[20], distvec, t->con.text, t->proptext);
- else
- sprintf(str, "Dx: %s Dy: %s Dz: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]);
- }
-}
-
-static void applyTranslation(TransInfo *t, float vec[3]) {
- TransData *td = t->data;
- float tvec[3];
- int i;
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- /* handle snapping rotation before doing the translation */
- if (usingSnappingNormal(t))
- {
- if (validSnappingNormal(t))
- {
- float *original_normal = td->axismtx[2];
- float axis[3];
- float quat[4];
- float mat[3][3];
- float angle;
-
- Crossf(axis, original_normal, t->tsnap.snapNormal);
- angle = saacos(Inpf(original_normal, t->tsnap.snapNormal));
-
- AxisAngleToQuat(quat, axis, angle);
-
- QuatToMat3(quat, mat);
-
- ElementRotation(t, td, mat, V3D_LOCAL);
- }
- else
- {
- float mat[3][3];
-
- Mat3One(mat);
-
- ElementRotation(t, td, mat, V3D_LOCAL);
- }
- }
-
- if (t->con.applyVec) {
- float pvec[3];
- t->con.applyVec(t, td, vec, tvec, pvec);
- }
- else {
- VECCOPY(tvec, vec);
- }
-
- Mat3MulVecfl(td->smtx, tvec);
- VecMulf(tvec, td->factor);
-
- protectedTransBits(td->protectflag, tvec);
-
- /* transdata ipokey */
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
- add_tdi_poin(tdi->locx, tdi->oldloc, tvec[0]);
- add_tdi_poin(tdi->locy, tdi->oldloc+1, tvec[1]);
- add_tdi_poin(tdi->locz, tdi->oldloc+2, tvec[2]);
- }
- else VecAddf(td->loc, td->iloc, tvec);
-
- constraintTransLim(t, td);
- }
-}
-
-/* uses t->vec to store actual translation in */
-int Translation(TransInfo *t, short mval[2])
-{
- float tvec[3];
- char str[250];
-
- if(t->flag & T_SHIFT_MOD) {
- float dvec[3];
- /* calculate the main translation and the precise one separate */
- convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1]));
- VecMulf(dvec, 0.1f);
- convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1]));
- VecAddf(t->vec, t->vec, dvec);
- }
- else convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1]));
-
- if (t->con.mode & CON_APPLY) {
- float pvec[3] = {0.0f, 0.0f, 0.0f};
- applySnapping(t, t->vec);
- t->con.applyVec(t, NULL, t->vec, tvec, pvec);
- VECCOPY(t->vec, tvec);
- headerTranslation(t, pvec, str);
- }
- else {
- applyNDofInput(&t->ndof, t->vec);
- snapGrid(t, t->vec);
- applyNumInput(&t->num, t->vec);
- applySnapping(t, t->vec);
- headerTranslation(t, t->vec, str);
- }
-
- applyTranslation(t, t->vec);
-
- /* evil hack - redo translation if cliiping needeed */
- if (t->flag & T_CLIP_UV && clipUVTransform(t, t->vec, 0))
- applyTranslation(t, t->vec);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- drawSnapping(t);
-
- return 1;
-}
-
-/* ************************** SHRINK/FATTEN *************************** */
-
-void initShrinkFatten(TransInfo *t)
-{
- // If not in mesh edit mode, fallback to Resize
- if (G.obedit==NULL || G.obedit->type != OB_MESH) {
- initResize(t);
- }
- else {
- t->mode = TFM_SHRINKFATTEN;
- t->transform = ShrinkFatten;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 1.0f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
- }
-}
-
-
-
-int ShrinkFatten(TransInfo *t, short mval[2])
-{
- float vec[3];
- float distance;
- int i;
- char str[64];
- TransData *td = t->data;
-
- distance = -InputVerticalAbsolute(t, mval);
-
- snapGrid(t, &distance);
-
- applyNumInput(&t->num, &distance);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Shrink/Fatten: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- sprintf(str, "Shrink/Fatten: %.4f %s", distance, t->proptext);
- }
-
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- VECCOPY(vec, td->axismtx[2]);
- VecMulf(vec, distance);
- VecMulf(vec, td->factor);
-
- VecAddf(td->loc, td->iloc, vec);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ************************** TILT *************************** */
-
-void initTilt(TransInfo *t)
-{
- t->mode = TFM_TILT;
- t->transform = Tilt;
-
- t->ndof.axis = 16;
- /* Scale down and flip input for rotation */
- t->ndof.factor[0] = -0.2f;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = (float)((5.0/180)*M_PI);
- t->snap[2] = t->snap[1] * 0.2f;
- t->fac = 0;
-
- t->flag |= T_NO_CONSTRAINT;
-}
-
-
-
-int Tilt(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- int i;
- char str[50];
-
- float final;
-
- t->fac += InputDeltaAngle(t, mval);
-
- final = t->fac;
-
- applyNDofInput(&t->ndof, &final);
-
- snapGrid(t, &final);
-
- if (hasNumInput(&t->num)) {
- char c[20];
-
- applyNumInput(&t->num, &final);
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Tilt: %s %s", &c[0], t->proptext);
-
- final *= (float)(M_PI / 180.0);
- }
- else {
- sprintf(str, "Tilt: %.2f %s", 180.0*final/M_PI, t->proptext);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (td->val) {
- *td->val = td->ival + final * td->factor;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline (t, t->center);
-
- return 1;
-}
-
-
-/* ******************** Curve Shrink/Fatten *************** */
-
-int CurveShrinkFatten(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float ratio;
- int i;
- char str[50];
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- float dx= (float)(t->center2d[0] - t->shiftmval[0]);
- float dy= (float)(t->center2d[1] - t->shiftmval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio);
-
- }
- else {
- float dx= (float)(t->center2d[0] - mval[0]);
- float dy= (float)(t->center2d[1] - mval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
-
- snapGrid(t, &ratio);
-
- applyNumInput(&t->num, &ratio);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
- sprintf(str, "Shrink/Fatten: %s", c);
- }
- else {
- sprintf(str, "Shrink/Fatten: %3f", ratio);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if(td->val) {
- //*td->val= ratio;
- *td->val= td->ival*ratio;
- if (*td->val <= 0.0f) *td->val = 0.0001f;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-void initCurveShrinkFatten(TransInfo *t)
-{
- t->mode = TFM_CURVE_SHRINKFATTEN;
- t->transform = CurveShrinkFatten;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
-
- t->fac = (float)sqrt( (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-}
-
-/* ************************** PUSH/PULL *************************** */
-
-void initPushPull(TransInfo *t)
-{
- t->mode = TFM_PUSHPULL;
- t->transform = PushPull;
-
- t->ndof.axis = 4;
- /* Flip direction */
- t->ndof.factor[0] = -1.0f;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 1.0f;
- t->snap[2] = t->snap[1] * 0.1f;
-}
-
-
-int PushPull(TransInfo *t, short mval[2])
-{
- float vec[3], axis[3];
- float distance;
- int i;
- char str[128];
- TransData *td = t->data;
-
- distance = InputVerticalAbsolute(t, mval);
-
- applyNDofInput(&t->ndof, &distance);
-
- snapGrid(t, &distance);
-
- applyNumInput(&t->num, &distance);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Push/Pull: %s%s %s", c, t->con.text, t->proptext);
- }
- else {
- /* default header print */
- sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext);
- }
-
- if (t->con.applyRot && t->con.mode & CON_APPLY) {
- t->con.applyRot(t, NULL, axis, NULL);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- VecSubf(vec, t->center, td->center);
- if (t->con.applyRot && t->con.mode & CON_APPLY) {
- t->con.applyRot(t, td, axis, NULL);
- if (isLockConstraint(t)) {
- float dvec[3];
- Projf(dvec, vec, axis);
- VecSubf(vec, vec, dvec);
- }
- else {
- Projf(vec, vec, axis);
- }
- }
- Normalize(vec);
- VecMulf(vec, distance);
- VecMulf(vec, td->factor);
-
- VecAddf(td->loc, td->iloc, vec);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ************************** BEVEL **************************** */
-
-void initBevel(TransInfo *t)
-{
- t->mode = TFM_BEVEL;
- t->flag |= T_NO_CONSTRAINT;
- t->num.flag |= NUM_NO_NEGATIVE;
- t->transform = Bevel;
- t->handleEvent = handleEventBevel;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- /* DON'T KNOW WHY THIS IS NEEDED */
- if (G.editBMesh->imval[0] == 0 && G.editBMesh->imval[1] == 0) {
- /* save the initial mouse co */
- G.editBMesh->imval[0] = t->imval[0];
- G.editBMesh->imval[1] = t->imval[1];
- }
- else {
- /* restore the mouse co from a previous call to initTransform() */
- t->imval[0] = G.editBMesh->imval[0];
- t->imval[1] = G.editBMesh->imval[1];
- }
-}
-
-int handleEventBevel(TransInfo *t, unsigned short event, short val)
-{
- if (val) {
- if(!G.editBMesh) return 0;
-
- switch (event) {
- case MIDDLEMOUSE:
- G.editBMesh->options ^= BME_BEVEL_VERT;
- t->state = TRANS_CANCEL;
- return 1;
- //case PADPLUSKEY:
- // G.editBMesh->options ^= BME_BEVEL_RES;
- // G.editBMesh->res += 1;
- // if (G.editBMesh->res > 4) {
- // G.editBMesh->res = 4;
- // }
- // t->state = TRANS_CANCEL;
- // return 1;
- //case PADMINUS:
- // G.editBMesh->options ^= BME_BEVEL_RES;
- // G.editBMesh->res -= 1;
- // if (G.editBMesh->res < 0) {
- // G.editBMesh->res = 0;
- // }
- // t->state = TRANS_CANCEL;
- // return 1;
- default:
- return 0;
- }
- }
- return 0;
-}
-
-int Bevel(TransInfo *t, short mval[2])
-{
- float distance,d;
- int i;
- char str[128];
- char *mode;
- TransData *td = t->data;
-
- mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal";
- distance = InputHorizontalAbsolute(t, mval)/4; /* 4 just seemed a nice value to me, nothing special */
-
- distance = fabs(distance);
-
- snapGrid(t, &distance);
-
- applyNumInput(&t->num, &distance);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Bevel - Dist: %s, Mode: %s (MMB to toggle))", c, mode);
- }
- else {
- /* default header print */
- sprintf(str, "Bevel - Dist: %.4f, Mode: %s (MMB to toggle))", distance, mode);
- }
-
- if (distance < 0) distance = -distance;
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->axismtx[1][0] > 0 && distance > td->axismtx[1][0]) {
- d = td->axismtx[1][0];
- }
- else {
- d = distance;
- }
- VECADDFAC(td->loc,td->center,td->axismtx[0],(*td->val)*d);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ************************** BEVEL WEIGHT *************************** */
-
-void initBevelWeight(TransInfo *t)
-{
- t->mode = TFM_BWEIGHT;
- t->transform = BevelWeight;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
-
- t->fac = (float)sqrt(
- (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-
- if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf
-}
-
-int BevelWeight(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float weight;
- int i;
- char str[50];
-
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- float dx= (float)(t->center2d[0] - t->shiftmval[0]);
- float dy= (float)(t->center2d[1] - t->shiftmval[1]);
- weight = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- weight+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -weight);
-
- }
- else {
- float dx= (float)(t->center2d[0] - mval[0]);
- float dy= (float)(t->center2d[1] - mval[1]);
- weight = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
-
- weight -= 1.0f;
- if (weight > 1.0f) weight = 1.0f;
-
- snapGrid(t, &weight);
-
- applyNumInput(&t->num, &weight);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- if (weight >= 0.0f)
- sprintf(str, "Bevel Weight: +%s %s", c, t->proptext);
- else
- sprintf(str, "Bevel Weight: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- if (weight >= 0.0f)
- sprintf(str, "Bevel Weight: +%.3f %s", weight, t->proptext);
- else
- sprintf(str, "Bevel Weight: %.3f %s", weight, t->proptext);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->val) {
- *td->val = td->ival + weight * td->factor;
- if (*td->val < 0.0f) *td->val = 0.0f;
- if (*td->val > 1.0f) *td->val = 1.0f;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** CREASE *************************** */
-
-void initCrease(TransInfo *t)
-{
- t->mode = TFM_CREASE;
- t->transform = Crease;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
-
- t->fac = (float)sqrt(
- (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-
- if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf
-}
-
-int Crease(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float crease;
- int i;
- char str[50];
-
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- float dx= (float)(t->center2d[0] - t->shiftmval[0]);
- float dy= (float)(t->center2d[1] - t->shiftmval[1]);
- crease = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- crease+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -crease);
-
- }
- else {
- float dx= (float)(t->center2d[0] - mval[0]);
- float dy= (float)(t->center2d[1] - mval[1]);
- crease = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
-
- crease -= 1.0f;
- if (crease > 1.0f) crease = 1.0f;
-
- snapGrid(t, &crease);
-
- applyNumInput(&t->num, &crease);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- if (crease >= 0.0f)
- sprintf(str, "Crease: +%s %s", c, t->proptext);
- else
- sprintf(str, "Crease: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- if (crease >= 0.0f)
- sprintf(str, "Crease: +%.3f %s", crease, t->proptext);
- else
- sprintf(str, "Crease: %.3f %s", crease, t->proptext);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (td->val) {
- *td->val = td->ival + crease * td->factor;
- if (*td->val < 0.0f) *td->val = 0.0f;
- if (*td->val > 1.0f) *td->val = 1.0f;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline (t, t->center);
-
- return 1;
-}
-
-/* ******************** EditBone (B-bone) width scaling *************** */
-
-void initBoneSize(TransInfo *t)
-{
- t->mode = TFM_BONESIZE;
- t->transform = BoneSize;
-
- t->idx_max = 2;
- t->num.idx_max = 2;
- t->num.flag |= NUM_NULL_ONE;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->fac = (float)sqrt( (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-
- if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf
-}
-
-static void headerBoneSize(TransInfo *t, float vec[3], char *str) {
- char tvec[60];
- if (hasNumInput(&t->num)) {
- outputNumInput(&(t->num), tvec);
- }
- else {
- sprintf(&tvec[0], "%.4f", vec[0]);
- sprintf(&tvec[20], "%.4f", vec[1]);
- sprintf(&tvec[40], "%.4f", vec[2]);
- }
-
- /* hmm... perhaps the y-axis values don't need to be shown? */
- if (t->con.mode & CON_APPLY) {
- if (t->num.idx_max == 0)
- sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext);
- else
- sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
- }
- else {
- sprintf(str, "ScaleB X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
- }
-}
-
-static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3])
-{
- float tmat[3][3], smat[3][3], oldy;
- float sizemat[3][3];
-
- Mat3MulMat3(smat, mat, td->mtx);
- Mat3MulMat3(tmat, td->smtx, smat);
-
- if (t->con.applySize) {
- t->con.applySize(t, td, tmat);
- }
-
- /* we've tucked the scale in loc */
- oldy= td->iloc[1];
- SizeToMat3(td->iloc, sizemat);
- Mat3MulMat3(tmat, tmat, sizemat);
- Mat3ToSize(tmat, td->loc);
- td->loc[1]= oldy;
-}
-
-int BoneSize(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float size[3], mat[3][3];
- float ratio;
- int i;
- char str[60];
-
- /* for manipulator, center handle, the scaling can't be done relative to center */
- if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) {
- ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f;
- }
- else {
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- float dx= (float)(t->center2d[0] - t->shiftmval[0]);
- float dy= (float)(t->center2d[1] - t->shiftmval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio);
-
- }
- else {
- float dx= (float)(t->center2d[0] - mval[0]);
- float dy= (float)(t->center2d[1] - mval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
-
- /* flip scale, but not for manipulator center handle */
- if ((t->center2d[0] - mval[0]) * (t->center2d[0] - t->imval[0]) +
- (t->center2d[1] - mval[1]) * (t->center2d[1] - t->imval[1]) < 0)
- ratio *= -1.0f;
- }
-
- size[0] = size[1] = size[2] = ratio;
-
- snapGrid(t, size);
-
- if (hasNumInput(&t->num)) {
- applyNumInput(&t->num, size);
- constraintNumInput(t, size);
- }
-
- SizeToMat3(size, mat);
-
- if (t->con.applySize) {
- t->con.applySize(t, NULL, mat);
- }
-
- Mat3CpyMat3(t->mat, mat); // used in manipulator
-
- headerBoneSize(t, size, str);
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- ElementBoneSize(t, td, mat);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-
-/* ******************** EditBone envelope *************** */
-
-void initBoneEnvelope(TransInfo *t)
-{
- t->mode = TFM_BONE_ENVELOPE;
- t->transform = BoneEnvelope;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 0.1f;
- t->snap[2] = t->snap[1] * 0.1f;
-
- t->flag |= T_NO_CONSTRAINT;
-
- t->fac = (float)sqrt( (
- ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1]))
- +
- ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0]))
- ) );
-
- if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf
-}
-
-int BoneEnvelope(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float ratio;
- int i;
- char str[50];
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- float dx= (float)(t->center2d[0] - t->shiftmval[0]);
- float dy= (float)(t->center2d[1] - t->shiftmval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
-
- dx= (float)(t->center2d[0] - mval[0]);
- dy= (float)(t->center2d[1] - mval[1]);
- ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio);
-
- }
- else {
- float dx= (float)(t->center2d[0] - mval[0]);
- float dy= (float)(t->center2d[1] - mval[1]);
- ratio = (float)sqrt( dx*dx + dy*dy)/t->fac;
- }
-
- snapGrid(t, &ratio);
-
- applyNumInput(&t->num, &ratio);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
- sprintf(str, "Envelope: %s", c);
- }
- else {
- sprintf(str, "Envelope: %3f", ratio);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (td->val) {
- /* if the old/original value was 0.0f, then just use ratio */
- if (td->ival)
- *td->val= td->ival*ratio;
- else
- *td->val= ratio;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- force_draw(0);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-
-/* ******************** EditBone roll *************** */
-
-void initBoneRoll(TransInfo *t)
-{
- t->mode = TFM_BONE_ROLL;
- t->transform = BoneRoll;
-
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = (float)((5.0/180)*M_PI);
- t->snap[2] = t->snap[1] * 0.2f;
-
- t->fac = 0.0f;
-
- t->flag |= T_NO_CONSTRAINT;
-}
-
-int BoneRoll(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- int i;
- char str[50];
-
- float final;
-
- t->fac += InputDeltaAngle(t, mval);
-
- final = t->fac;
-
- snapGrid(t, &final);
-
- if (hasNumInput(&t->num)) {
- char c[20];
-
- applyNumInput(&t->num, &final);
-
- outputNumInput(&(t->num), c);
-
- sprintf(str, "Roll: %s", &c[0]);
-
- final *= (float)(M_PI / 180.0);
- }
- else {
- sprintf(str, "Roll: %.2f", 180.0*final/M_PI);
- }
-
- /* set roll values */
- for (i = 0; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- *(td->val) = td->ival - final;
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** BAKE TIME ******************* */
-
-void initBakeTime(TransInfo *t)
-{
- t->idx_max = 0;
- t->num.idx_max = 0;
- t->snap[0] = 0.0f;
- t->snap[1] = 1.0f;
- t->snap[2] = t->snap[1] * 0.1f;
- t->transform = BakeTime;
- t->fac = 0.1f;
-}
-
-int BakeTime(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float time;
- int i;
- char str[50];
-
-
- if(t->flag & T_SHIFT_MOD) {
- /* calculate ratio for shiftkey pos, and for total, and blend these for precision */
- time= (float)(t->center2d[0] - t->shiftmval[0])*t->fac;
- time+= 0.1f*((float)(t->center2d[0]*t->fac - mval[0]) -time);
- }
- else {
- time = (float)(t->center2d[0] - mval[0])*t->fac;
- }
-
- snapGrid(t, &time);
-
- applyNumInput(&t->num, &time);
-
- /* header print for NumInput */
- if (hasNumInput(&t->num)) {
- char c[20];
-
- outputNumInput(&(t->num), c);
-
- if (time >= 0.0f)
- sprintf(str, "Time: +%s %s", c, t->proptext);
- else
- sprintf(str, "Time: %s %s", c, t->proptext);
- }
- else {
- /* default header print */
- if (time >= 0.0f)
- sprintf(str, "Time: +%.3f %s", time, t->proptext);
- else
- sprintf(str, "Time: %.3f %s", time, t->proptext);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- if (td->val) {
- *td->val = td->ival + time * td->factor;
- if (td->ext->size && *td->val < *td->ext->size) *td->val = *td->ext->size;
- if (td->ext->quat && *td->val > *td->ext->quat) *td->val = *td->ext->quat;
- }
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- helpline (t, t->center);
-
- return 1;
-}
-
-/* ************************** MIRROR *************************** */
-
-void initMirror(TransInfo *t)
-{
- t->flag |= T_NULL_ONE;
- if (!G.obedit) {
- t->flag |= T_NO_ZERO;
- }
-
- t->transform = Mirror;
-}
-
-int Mirror(TransInfo *t, short mval[2])
-{
- TransData *td;
- float size[3], mat[3][3];
- int i;
- char str[200];
-
- /*
- * OPTIMISATION:
- * This still recalcs transformation on mouse move
- * while it should only recalc on constraint change
- * */
-
- /* if an axis has been selected */
- if (t->con.mode & CON_APPLY) {
- size[0] = size[1] = size[2] = -1;
-
- SizeToMat3(size, mat);
-
- if (t->con.applySize) {
- t->con.applySize(t, NULL, mat);
- }
-
- sprintf(str, "Mirror%s", t->con.text);
-
- for(i = 0, td=t->data; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- ElementResize(t, td, mat);
- }
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
- }
- else
- {
- size[0] = size[1] = size[2] = 1;
-
- SizeToMat3(size, mat);
-
- for(i = 0, td=t->data; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- ElementResize(t, td, mat);
- }
-
- recalcData(t);
-
- headerprint("Select a mirror axis (X, Y, Z)");
-
- viewRedrawForce(t);
- }
-
- return 1;
-}
-
-/* ************************** ALIGN *************************** */
-
-void initAlign(TransInfo *t)
-{
- t->flag |= T_NO_CONSTRAINT;
-
- t->transform = Align;
-}
-
-int Align(TransInfo *t, short mval[2])
-{
- TransData *td = t->data;
- float center[3];
- int i;
-
- /* saving original center */
- VECCOPY(center, t->center);
-
- for(i = 0 ; i < t->total; i++, td++)
- {
- float mat[3][3], invmat[3][3];
-
- if (td->flag & TD_NOACTION)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- /* around local centers */
- if (t->flag & (T_OBJECT|T_POSE)) {
- VECCOPY(t->center, td->center);
- }
- else {
- if(G.scene->selectmode & SCE_SELECT_FACE) {
- VECCOPY(t->center, td->center);
- }
- }
-
- Mat3Inv(invmat, td->axismtx);
-
- Mat3MulMat3(mat, t->spacemtx, invmat);
-
- ElementRotation(t, td, mat, t->around);
- }
-
- /* restoring original center */
- VECCOPY(t->center, center);
-
- recalcData(t);
-
- headerprint("Align");
-
- return 1;
-}
-
-/* ************************** ANIM EDITORS - TRANSFORM TOOLS *************************** */
-
-/* ---------------- Special Helpers for Various Settings ------------- */
-
-/* This function returns the snapping 'mode' for Animation Editors only
- * We cannot use the standard snapping due to NLA-strip scaling complexities.
- */
-static short getAnimEdit_SnapMode(TransInfo *t)
-{
- short autosnap= SACTSNAP_OFF;
-
- /* currently, some of these are only for the action editor */
- if (t->spacetype == SPACE_ACTION && G.saction) {
- switch (G.saction->autosnap) {
- case SACTSNAP_OFF:
- if (G.qual == LR_CTRLKEY)
- autosnap= SACTSNAP_STEP;
- else if (G.qual == LR_SHIFTKEY)
- autosnap= SACTSNAP_FRAME;
- else if (G.qual == LR_ALTKEY)
- autosnap= SACTSNAP_MARKER;
- else
- autosnap= SACTSNAP_OFF;
- break;
- case SACTSNAP_STEP:
- autosnap= (G.qual==LR_CTRLKEY)? SACTSNAP_OFF: SACTSNAP_STEP;
- break;
- case SACTSNAP_FRAME:
- autosnap= (G.qual==LR_SHIFTKEY)? SACTSNAP_OFF: SACTSNAP_FRAME;
- break;
- case SACTSNAP_MARKER:
- autosnap= (G.qual==LR_ALTKEY)? SACTSNAP_OFF: SACTSNAP_MARKER;
- break;
- }
- }
- else if (t->spacetype == SPACE_NLA && G.snla) {
- switch (G.snla->autosnap) {
- case SACTSNAP_OFF:
- if (G.qual == LR_CTRLKEY)
- autosnap= SACTSNAP_STEP;
- else if (G.qual == LR_SHIFTKEY)
- autosnap= SACTSNAP_FRAME;
- else if (G.qual == LR_ALTKEY)
- autosnap= SACTSNAP_MARKER;
- else
- autosnap= SACTSNAP_OFF;
- break;
- case SACTSNAP_STEP:
- autosnap= (G.qual==LR_CTRLKEY)? SACTSNAP_OFF: SACTSNAP_STEP;
- break;
- case SACTSNAP_FRAME:
- autosnap= (G.qual==LR_SHIFTKEY)? SACTSNAP_OFF: SACTSNAP_FRAME;
- break;
- case SACTSNAP_MARKER:
- autosnap= (G.qual==LR_ALTKEY)? SACTSNAP_OFF: SACTSNAP_MARKER;
- break;
- }
- }
- else {
- if (G.qual == LR_CTRLKEY)
- autosnap= SACTSNAP_STEP;
- else if (G.qual == LR_SHIFTKEY)
- autosnap= SACTSNAP_FRAME;
- else if (G.qual == LR_ALTKEY)
- autosnap= SACTSNAP_MARKER;
- else
- autosnap= SACTSNAP_OFF;
- }
-
- return autosnap;
-}
-
-/* This function is used for testing if an Animation Editor is displaying
- * its data in frames or seconds (and the data needing to be edited as such).
- * Returns 1 if in seconds, 0 if in frames
- */
-static short getAnimEdit_DrawTime(TransInfo *t)
-{
- short drawtime;
-
- /* currently, some of these are only for the action editor */
- if (t->spacetype == SPACE_ACTION && G.saction) {
- drawtime = (G.saction->flag & SACTION_DRAWTIME)? 1 : 0;
- }
- else if (t->spacetype == SPACE_NLA && G.snla) {
- drawtime = (G.snla->flag & SNLA_DRAWTIME)? 1 : 0;
- }
- else {
- drawtime = 0;
- }
-
- return drawtime;
-}
-
-
-/* This function is used by Animation Editor specific transform functions to do
- * the Snap Keyframe to Nearest Frame/Marker
- */
-static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short autosnap)
-{
- /* snap key to nearest frame? */
- if (autosnap == SACTSNAP_FRAME) {
- short doTime= getAnimEdit_DrawTime(t);
- double secf= FPS;
- double val;
-
- /* convert frame to nla-action time (if needed) */
- if (ob)
- val= get_action_frame_inv(ob, *(td->val));
- else
- val= *(td->val);
-
- /* do the snapping to nearest frame/second */
- if (doTime)
- val= (float)( floor((val/secf) + 0.5f) * secf );
- else
- val= (float)( floor(val+0.5f) );
-
- /* convert frame out of nla-action time */
- if (ob)
- *(td->val)= get_action_frame(ob, val);
- else
- *(td->val)= val;
- }
- /* snap key to nearest marker? */
- else if (autosnap == SACTSNAP_MARKER) {
- float val;
-
- /* convert frame to nla-action time (if needed) */
- if (ob)
- val= get_action_frame_inv(ob, *(td->val));
- else
- val= *(td->val);
-
- /* snap to nearest marker */
- val= (float)find_nearest_marker_time(val);
-
- /* convert frame out of nla-action time */
- if (ob)
- *(td->val)= get_action_frame(ob, val);
- else
- *(td->val)= val;
- }
-}
-
-/* ----------------- Translation ----------------------- */
-
-void initTimeTranslate(TransInfo *t)
-{
- t->mode = TFM_TIME_TRANSLATE;
- t->transform = TimeTranslate;
-
- /* num-input has max of (n-1) */
- t->idx_max = 0;
- t->num.flag = 0;
- t->num.idx_max = t->idx_max;
-
- /* initialise snap like for everything else */
- t->snap[0] = 0.0f;
- t->snap[1] = t->snap[2] = 1.0f;
-}
-
-static void headerTimeTranslate(TransInfo *t, char *str)
-{
- char tvec[60];
-
- /* if numeric input is active, use results from that, otherwise apply snapping to result */
- if (hasNumInput(&t->num)) {
- outputNumInput(&(t->num), tvec);
- }
- else {
- short autosnap= getAnimEdit_SnapMode(t);
- short doTime = getAnimEdit_DrawTime(t);
- double secf= FPS;
- float val= t->fac;
-
- /* apply snapping + frame->seconds conversions */
- if (autosnap == SACTSNAP_STEP) {
- if (doTime)
- val= floor(val/secf + 0.5f);
- else
- val= floor(val + 0.5f);
- }
- else {
- if (doTime)
- val= val / secf;
- }
-
- sprintf(&tvec[0], "%.4f", val);
- }
-
- sprintf(str, "DeltaX: %s", &tvec[0]);
-}
-
-static void applyTimeTranslate(TransInfo *t, float sval)
-{
- TransData *td = t->data;
- int i;
-
- short doTime= getAnimEdit_DrawTime(t);
- double secf= FPS;
-
- short autosnap= getAnimEdit_SnapMode(t);
-
- float deltax, val;
-
- /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */
- for (i = 0 ; i < t->total; i++, td++) {
- /* it is assumed that td->ob is a pointer to the object,
- * whose active action is where this keyframe comes from
- */
- Object *ob= td->ob;
-
- /* check if any need to apply nla-scaling */
- if (ob) {
- deltax = t->fac;
-
- if (autosnap == SACTSNAP_STEP) {
- if (doTime)
- deltax= (float)( floor((deltax/secf) + 0.5f) * secf );
- else
- deltax= (float)( floor(deltax + 0.5f) );
- }
-
- val = get_action_frame_inv(ob, td->ival);
- val += deltax;
- *(td->val) = get_action_frame(ob, val);
- }
- else {
- deltax = val = t->fac;
-
- if (autosnap == SACTSNAP_STEP) {
- if (doTime)
- val= (float)( floor((deltax/secf) + 0.5f) * secf );
- else
- val= (float)( floor(val + 0.5f) );
- }
-
- *(td->val) = td->ival + val;
- }
-
- /* apply nearest snapping */
- doAnimEdit_SnapFrame(t, td, ob, autosnap);
- }
-}
-
-int TimeTranslate(TransInfo *t, short mval[2])
-{
- float cval[2], sval[2];
- char str[200];
-
- /* calculate translation amount from mouse movement - in 'time-grid space' */
- areamouseco_to_ipoco(G.v2d, mval, &cval[0], &cval[1]);
- areamouseco_to_ipoco(G.v2d, t->imval, &sval[0], &sval[1]);
-
- /* we only need to calculate effect for time (applyTimeTranslate only needs that) */
- t->fac= cval[0] - sval[0];
-
- /* handle numeric-input stuff */
- t->vec[0] = t->fac;
- applyNumInput(&t->num, &t->vec[0]);
- t->fac = t->vec[0];
- headerTimeTranslate(t, str);
-
- applyTimeTranslate(t, sval[0]);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ----------------- Time Slide ----------------------- */
-
-void initTimeSlide(TransInfo *t)
-{
- /* this tool is only really available in the Action Editor... */
- if (t->spacetype == SPACE_ACTION) {
- /* set flag for drawing stuff*/
- G.saction->flag |= SACTION_MOVING;
- }
-
- t->mode = TFM_TIME_SLIDE;
- t->transform = TimeSlide;
- t->flag |= T_FREE_CUSTOMDATA;
-
- /* num-input has max of (n-1) */
- t->idx_max = 0;
- t->num.flag = 0;
- t->num.idx_max = t->idx_max;
-
- /* initialise snap like for everything else */
- t->snap[0] = 0.0f;
- t->snap[1] = t->snap[2] = 1.0f;
-}
-
-static void headerTimeSlide(TransInfo *t, float sval, char *str)
-{
- char tvec[60];
-
- if (hasNumInput(&t->num)) {
- outputNumInput(&(t->num), tvec);
- }
- else {
- float minx= *((float *)(t->customData));
- float maxx= *((float *)(t->customData) + 1);
- float cval= t->fac;
- float val;
-
- val= 2.0*(cval-sval) / (maxx-minx);
- CLAMP(val, -1.0f, 1.0f);
-
- sprintf(&tvec[0], "%.4f", val);
- }
-
- sprintf(str, "TimeSlide: %s", &tvec[0]);
-}
-
-static void applyTimeSlide(TransInfo *t, float sval)
-{
- TransData *td = t->data;
- int i;
-
- float minx= *((float *)(t->customData));
- float maxx= *((float *)(t->customData) + 1);
-
-
- /* set value for drawing black line */
- if (t->spacetype == SPACE_ACTION) {
- float cvalf = t->fac;
-
- if (NLA_ACTION_SCALED)
- cvalf= get_action_frame(OBACT, cvalf);
-
- G.saction->timeslide= cvalf;
- }
-
- /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */
- for (i = 0 ; i < t->total; i++, td++) {
- /* it is assumed that td->ob is a pointer to the object,
- * whose active action is where this keyframe comes from
- */
- Object *ob= td->ob;
- float cval = t->fac;
-
- /* apply scaling to necessary values */
- if (ob)
- cval= get_action_frame(ob, cval);
-
- /* only apply to data if in range */
- if ((sval > minx) && (sval < maxx)) {
- float cvalc= CLAMPIS(cval, minx, maxx);
- float timefac;
-
- /* left half? */
- if (td->ival < sval) {
- timefac= (sval - td->ival) / (sval - minx);
- *(td->val)= cvalc - timefac * (cvalc - minx);
- }
- else {
- timefac= (td->ival - sval) / (maxx - sval);
- *(td->val)= cvalc + timefac * (maxx - cvalc);
- }
- }
- }
-}
-
-int TimeSlide(TransInfo *t, short mval[2])
-{
- float cval[2], sval[2];
- float minx= *((float *)(t->customData));
- float maxx= *((float *)(t->customData) + 1);
- char str[200];
-
- /* calculate mouse co-ordinates */
- areamouseco_to_ipoco(G.v2d, mval, &cval[0], &cval[1]);
- areamouseco_to_ipoco(G.v2d, t->imval, &sval[0], &sval[1]);
-
- /* t->fac stores cval[0], which is the current mouse-pointer location (in frames) */
- t->fac= cval[0];
-
- /* handle numeric-input stuff */
- t->vec[0] = 2.0*(cval[0]-sval[0]) / (maxx-minx);
- applyNumInput(&t->num, &t->vec[0]);
- t->fac = (maxx-minx) * t->vec[0] / 2.0 + sval[0];
-
- headerTimeSlide(t, sval[0], str);
- applyTimeSlide(t, sval[0]);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ----------------- Scaling ----------------------- */
-
-void initTimeScale(TransInfo *t)
-{
- t->mode = TFM_TIME_SCALE;
- t->transform = TimeScale;
-
- t->flag |= T_NULL_ONE;
- t->num.flag |= NUM_NULL_ONE;
-
- /* num-input has max of (n-1) */
- t->idx_max = 0;
- t->num.flag = 0;
- t->num.idx_max = t->idx_max;
-
- /* initialise snap like for everything else */
- t->snap[0] = 0.0f;
- t->snap[1] = t->snap[2] = 1.0f;
-}
-
-static void headerTimeScale(TransInfo *t, char *str) {
- char tvec[60];
-
- if (hasNumInput(&t->num))
- outputNumInput(&(t->num), tvec);
- else
- sprintf(&tvec[0], "%.4f", t->fac);
-
- sprintf(str, "ScaleX: %s", &tvec[0]);
-}
-
-static void applyTimeScale(TransInfo *t) {
- TransData *td = t->data;
- int i;
-
- short autosnap= getAnimEdit_SnapMode(t);
- short doTime= getAnimEdit_DrawTime(t);
- double secf= FPS;
-
-
- for (i = 0 ; i < t->total; i++, td++) {
- /* it is assumed that td->ob is a pointer to the object,
- * whose active action is where this keyframe comes from
- */
- Object *ob= td->ob;
- float startx= CFRA;
- float fac= t->fac;
-
- if (autosnap == SACTSNAP_STEP) {
- if (doTime)
- fac= (float)( floor(fac/secf + 0.5f) * secf );
- else
- fac= (float)( floor(fac + 0.5f) );
- }
-
- /* check if any need to apply nla-scaling */
- if (ob)
- startx= get_action_frame(ob, startx);
-
- /* now, calculate the new value */
- *(td->val) = td->ival - startx;
- *(td->val) *= fac;
- *(td->val) += startx;
-
- /* apply nearest snapping */
- doAnimEdit_SnapFrame(t, td, ob, autosnap);
- }
-}
-
-int TimeScale(TransInfo *t, short mval[2])
-{
- float cval, sval;
- float deltax, startx;
- float width= 0.0f;
- char str[200];
-
- sval= t->imval[0];
- cval= mval[0];
-
- switch (t->spacetype) {
- case SPACE_ACTION:
- width= ACTWIDTH;
- break;
- case SPACE_NLA:
- width= NLAWIDTH;
- break;
- }
-
- /* calculate scaling factor */
- startx= sval-(width/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2);
- deltax= cval-(width/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2);
- t->fac = deltax / startx;
-
- /* handle numeric-input stuff */
- t->vec[0] = t->fac;
- applyNumInput(&t->num, &t->vec[0]);
- t->fac = t->vec[0];
- headerTimeScale(t, str);
-
- applyTimeScale(t);
-
- recalcData(t);
-
- headerprint(str);
-
- viewRedrawForce(t);
-
- return 1;
-}
-
-/* ************************************ */
-
-void BIF_TransformSetUndo(char *str)
-{
- Trans.undostr= str;
-}
-
-
-void NDofTransform()
-{
- float fval[7];
- float maxval = 50.0f; // also serves as threshold
- int axis = -1;
- int mode = 0;
- int i;
-
- getndof(fval);
-
- for(i = 0; i < 6; i++)
- {
- float val = fabs(fval[i]);
- if (val > maxval)
- {
- axis = i;
- maxval = val;
- }
- }
-
- switch(axis)
- {
- case -1:
- /* No proper axis found */
- break;
- case 0:
- case 1:
- case 2:
- mode = TFM_TRANSLATION;
- break;
- case 4:
- mode = TFM_ROTATION;
- break;
- case 3:
- case 5:
- mode = TFM_TRACKBALL;
- break;
- default:
- printf("ndof: what we are doing here ?");
- }
-
- if (mode != 0)
- {
- initTransform(mode, CTX_NDOF);
- Transform();
- }
-}
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c
deleted file mode 100644
index 796b013cb88..00000000000
--- a/source/blender/src/transform_constraints.c
+++ /dev/null
@@ -1,1070 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BIF_screen.h"
-#include "BIF_resources.h"
-#include "BIF_mywindow.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BSE_view.h"
-
-#include "BLI_arithb.h"
-
-#include "BDR_drawobject.h" /* drawcircball */
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-#include "transform.h"
-
-static void drawObjectConstraint(TransInfo *t);
-
-/* ************************** CONSTRAINTS ************************* */
-void constraintNumInput(TransInfo *t, float vec[3])
-{
- int mode = t->con.mode;
- if (mode & CON_APPLY) {
- float nval = (t->flag & T_NULL_ONE)?1.0f:0.0f;
-
- if (getConstraintSpaceDimension(t) == 2) {
- int axis = mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
- if (axis == (CON_AXIS0|CON_AXIS1)) {
- vec[2] = nval;
- }
- else if (axis == (CON_AXIS1|CON_AXIS2)) {
- vec[2] = vec[1];
- vec[1] = vec[0];
- vec[0] = nval;
- }
- else if (axis == (CON_AXIS0|CON_AXIS2)) {
- vec[2] = vec[1];
- vec[1] = nval;
- }
- }
- else if (getConstraintSpaceDimension(t) == 1) {
- if (mode & CON_AXIS0) {
- vec[1] = nval;
- vec[2] = nval;
- }
- else if (mode & CON_AXIS1) {
- vec[1] = vec[0];
- vec[0] = nval;
- vec[2] = nval;
- }
- else if (mode & CON_AXIS2) {
- vec[2] = vec[0];
- vec[0] = nval;
- vec[1] = nval;
- }
- }
- }
-}
-
-static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) {
- int i = 0;
-
- Mat3MulVecfl(t->con.imtx, vec);
-
- snapGrid(t, vec);
-
- if (t->num.flag & T_NULL_ONE) {
- if (!(t->con.mode & CON_AXIS0))
- vec[0] = 1.0f;
-
- if (!(t->con.mode & CON_AXIS1))
- vec[1] = 1.0f;
-
- if (!(t->con.mode & CON_AXIS2))
- vec[2] = 1.0f;
- }
-
- if (hasNumInput(&t->num)) {
- applyNumInput(&t->num, vec);
- constraintNumInput(t, vec);
- }
-
- if (t->con.mode & CON_AXIS0) {
- pvec[i++] = vec[0];
- }
- if (t->con.mode & CON_AXIS1) {
- pvec[i++] = vec[1];
- }
- if (t->con.mode & CON_AXIS2) {
- pvec[i++] = vec[2];
- }
-
- Mat3MulVecfl(t->con.mtx, vec);
-}
-
-static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3]) {
- float norm[3], vec[3], factor;
-
- if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f)
- return;
-
- /* For when view is parallel to constraint... will cause NaNs otherwise
- So we take vertical motion in 3D space and apply it to the
- constraint axis. Nice for camera grab + MMB */
- if(1.0f - fabs(Inpf(axis, t->viewinv[2])) < 0.000001f) {
- Projf(vec, in, t->viewinv[1]);
- factor = Inpf(t->viewinv[1], vec) * 2.0f;
- /* since camera distance is quite relative, use quadratic relationship. holding shift can compensate */
- if(factor<0.0f) factor*= -factor;
- else factor*= factor;
-
- VECCOPY(out, axis);
- Normalize(out);
- VecMulf(out, -factor); /* -factor makes move down going backwards */
- }
- else {
- float cb[3], ab[3];
-
- VECCOPY(out, axis);
-
- /* Get view vector on axis to define a plane */
- VecAddf(vec, t->con.center, in);
- getViewVector(vec, norm);
-
- Crossf(vec, norm, axis);
-
- /* Project input vector on the plane passing on axis */
- Projf(vec, in, vec);
- VecSubf(vec, in, vec);
-
- /* intersect the two lines: axis and norm */
- Crossf(cb, vec, norm);
- Crossf(ab, axis, norm);
-
- VecMulf(out, Inpf(cb, ab) / Inpf(ab, ab));
- }
-}
-
-static void planeProjection(TransInfo *t, float in[3], float out[3]) {
- float vec[3], factor, norm[3];
-
- VecAddf(vec, in, t->con.center);
- getViewVector(vec, norm);
-
- VecSubf(vec, out, in);
-
- factor = Inpf(vec, norm);
- if (fabs(factor) <= 0.001) {
- return; /* prevent divide by zero */
- }
- factor = Inpf(vec, vec) / factor;
-
- VECCOPY(vec, norm);
- VecMulf(vec, factor);
-
- VecAddf(out, in, vec);
-}
-
-/*
- * Generic callback for constant spacial constraints applied to linear motion
- *
- * The IN vector in projected into the constrained space and then further
- * projected along the view vector.
- * (in perspective mode, the view vector is relative to the position on screen)
- *
- */
-
-static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
-{
- VECCOPY(out, in);
- if (!td && t->con.mode & CON_APPLY) {
- Mat3MulVecfl(t->con.pmtx, out);
-
- // With snap, a projection is alright, no need to correct for view alignment
- if ((t->tsnap.status & SNAP_ON) == 0) {
- if (getConstraintSpaceDimension(t) == 2) {
- if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
- planeProjection(t, in, out);
- }
- }
- else if (getConstraintSpaceDimension(t) == 1) {
- float c[3];
-
- if (t->con.mode & CON_AXIS0) {
- VECCOPY(c, t->con.mtx[0]);
- }
- else if (t->con.mode & CON_AXIS1) {
- VECCOPY(c, t->con.mtx[1]);
- }
- else if (t->con.mode & CON_AXIS2) {
- VECCOPY(c, t->con.mtx[2]);
- }
- axisProjection(t, c, in, out);
- }
- }
- postConstraintChecks(t, out, pvec);
- }
-}
-
-/*
- * Generic callback for object based spacial constraints applied to linear motion
- *
- * At first, the following is applied to the first data in the array
- * The IN vector in projected into the constrained space and then further
- * projected along the view vector.
- * (in perspective mode, the view vector is relative to the position on screen)
- *
- * Further down, that vector is mapped to each data's space.
- */
-
-static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3])
-{
- VECCOPY(out, in);
- if (t->con.mode & CON_APPLY) {
- if (!td) {
- Mat3MulVecfl(t->con.pmtx, out);
- if (getConstraintSpaceDimension(t) == 2) {
- if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
- planeProjection(t, in, out);
- }
- }
- else if (getConstraintSpaceDimension(t) == 1) {
- float c[3];
-
- if (t->con.mode & CON_AXIS0) {
- VECCOPY(c, t->con.mtx[0]);
- }
- else if (t->con.mode & CON_AXIS1) {
- VECCOPY(c, t->con.mtx[1]);
- }
- else if (t->con.mode & CON_AXIS2) {
- VECCOPY(c, t->con.mtx[2]);
- }
- axisProjection(t, c, in, out);
- }
- postConstraintChecks(t, out, pvec);
- VECCOPY(out, pvec);
- }
- else {
- int i=0;
-
- out[0] = out[1] = out[2] = 0.0f;
- if (t->con.mode & CON_AXIS0) {
- out[0] = in[i++];
- }
- if (t->con.mode & CON_AXIS1) {
- out[1] = in[i++];
- }
- if (t->con.mode & CON_AXIS2) {
- out[2] = in[i++];
- }
- Mat3MulVecfl(td->axismtx, out);
- }
- }
-}
-
-/*
- * Generic callback for constant spacial constraints applied to resize motion
- *
- *
- */
-
-static void applyAxisConstraintSize(TransInfo *t, TransData *td, float smat[3][3])
-{
- if (!td && t->con.mode & CON_APPLY) {
- float tmat[3][3];
-
- if (!(t->con.mode & CON_AXIS0)) {
- smat[0][0] = 1.0f;
- }
- if (!(t->con.mode & CON_AXIS1)) {
- smat[1][1] = 1.0f;
- }
- if (!(t->con.mode & CON_AXIS2)) {
- smat[2][2] = 1.0f;
- }
-
- Mat3MulMat3(tmat, smat, t->con.imtx);
- Mat3MulMat3(smat, t->con.mtx, tmat);
- }
-}
-
-/*
- * Callback for object based spacial constraints applied to resize motion
- *
- *
- */
-
-static void applyObjectConstraintSize(TransInfo *t, TransData *td, float smat[3][3])
-{
- if (td && t->con.mode & CON_APPLY) {
- float tmat[3][3];
- float imat[3][3];
-
- Mat3Inv(imat, td->axismtx);
-
- if (!(t->con.mode & CON_AXIS0)) {
- smat[0][0] = 1.0f;
- }
- if (!(t->con.mode & CON_AXIS1)) {
- smat[1][1] = 1.0f;
- }
- if (!(t->con.mode & CON_AXIS2)) {
- smat[2][2] = 1.0f;
- }
-
- Mat3MulMat3(tmat, smat, imat);
- Mat3MulMat3(smat, td->axismtx, tmat);
- }
-}
-
-/*
- * Generic callback for constant spacial constraints applied to rotations
- *
- * The rotation axis is copied into VEC.
- *
- * In the case of single axis constraints, the rotation axis is directly the one constrained to.
- * For planar constraints (2 axis), the rotation axis is the normal of the plane.
- *
- * The following only applies when CON_NOFLIP is not set.
- * The vector is then modified to always point away from the screen (in global space)
- * This insures that the rotation is always logically following the mouse.
- * (ie: not doing counterclockwise rotations when the mouse moves clockwise).
- */
-
-static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle)
-{
- if (!td && t->con.mode & CON_APPLY) {
- int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
-
- switch(mode) {
- case CON_AXIS0:
- case (CON_AXIS1|CON_AXIS2):
- VECCOPY(vec, t->con.mtx[0]);
- break;
- case CON_AXIS1:
- case (CON_AXIS0|CON_AXIS2):
- VECCOPY(vec, t->con.mtx[1]);
- break;
- case CON_AXIS2:
- case (CON_AXIS0|CON_AXIS1):
- VECCOPY(vec, t->con.mtx[2]);
- break;
- }
- /* don't flip axis if asked to or if num input */
- if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) {
- if (Inpf(vec, t->viewinv[2]) > 0.0f) {
- *angle = -(*angle);
- }
- }
- }
-}
-
-/*
- * Callback for object based spacial constraints applied to rotations
- *
- * The rotation axis is copied into VEC.
- *
- * In the case of single axis constraints, the rotation axis is directly the one constrained to.
- * For planar constraints (2 axis), the rotation axis is the normal of the plane.
- *
- * The following only applies when CON_NOFLIP is not set.
- * The vector is then modified to always point away from the screen (in global space)
- * This insures that the rotation is always logically following the mouse.
- * (ie: not doing counterclockwise rotations when the mouse moves clockwise).
- */
-
-static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3], float *angle)
-{
- if (t->con.mode & CON_APPLY) {
- int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
-
- /* on setup call, use first object */
- if (td == NULL) {
- td= t->data;
- }
-
- switch(mode) {
- case CON_AXIS0:
- case (CON_AXIS1|CON_AXIS2):
- VECCOPY(vec, td->axismtx[0]);
- break;
- case CON_AXIS1:
- case (CON_AXIS0|CON_AXIS2):
- VECCOPY(vec, td->axismtx[1]);
- break;
- case CON_AXIS2:
- case (CON_AXIS0|CON_AXIS1):
- VECCOPY(vec, td->axismtx[2]);
- break;
- }
- if (angle && (mode & CON_NOFLIP) == 0 && hasNumInput(&t->num) == 0) {
- if (Inpf(vec, t->viewinv[2]) > 0.0f) {
- *angle = -(*angle);
- }
- }
- }
-}
-
-/*--------------------- INTERNAL SETUP CALLS ------------------*/
-
-void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]) {
- strncpy(t->con.text + 1, text, 48);
- Mat3CpyMat3(t->con.mtx, space);
- t->con.mode = mode;
- getConstraintMatrix(t);
-
- startConstraint(t);
-
- t->con.drawExtra = NULL;
- t->con.applyVec = applyAxisConstraintVec;
- t->con.applySize = applyAxisConstraintSize;
- t->con.applyRot = applyAxisConstraintRot;
- t->redraw = 1;
-}
-
-void setLocalConstraint(TransInfo *t, int mode, const char text[]) {
- if (t->flag & T_EDIT) {
- float obmat[3][3];
- Mat3CpyMat4(obmat, G.obedit->obmat);
- setConstraint(t, obmat, mode|CON_LOCAL, text);
- }
- else {
- if (t->total == 1) {
- setConstraint(t, t->data->axismtx, mode|CON_LOCAL, text);
- }
- else {
- strncpy(t->con.text + 1, text, 48);
- Mat3CpyMat3(t->con.mtx, t->data->axismtx);
- t->con.mode = mode|CON_LOCAL;
- getConstraintMatrix(t);
-
- startConstraint(t);
-
- t->con.drawExtra = drawObjectConstraint;
- t->con.applyVec = applyObjectConstraintVec;
- t->con.applySize = applyObjectConstraintSize;
- t->con.applyRot = applyObjectConstraintRot;
- t->redraw = 1;
- }
- }
-}
-
-/*
- Set the constraint according to the user defined orientation
-
- ftext is a format string passed to sprintf. It will add the name of
- the orientation where %s is (logically).
-*/
-void setUserConstraint(TransInfo *t, int mode, const char ftext[]) {
- char text[40];
- short twmode= (t->spacetype==SPACE_VIEW3D)? G.vd->twmode: V3D_MANIP_GLOBAL;
-
- switch(twmode) {
- case V3D_MANIP_GLOBAL:
- /*
- sprintf(text, ftext, "global");
- Mat3One(mtx);
- setConstraint(t, mtx, mode, text);
- break;
- */
- case V3D_MANIP_LOCAL:
- sprintf(text, ftext, "local");
- setLocalConstraint(t, mode, text);
- break;
- case V3D_MANIP_NORMAL:
- sprintf(text, ftext, "normal");
- setConstraint(t, t->spacemtx, mode, text);
- break;
- case V3D_MANIP_VIEW:
- sprintf(text, ftext, "view");
- setConstraint(t, t->spacemtx, mode, text);
- break;
- default: /* V3D_MANIP_CUSTOM */
- sprintf(text, ftext, t->spacename);
- setConstraint(t, t->spacemtx, mode, text);
- break;
- }
-
- t->con.mode |= CON_USER;
-}
-
-/*--------------------- EXTERNAL SETUP CALLS ------------------*/
-
-void BIF_setLocalLockConstraint(char axis, char *text) {
- TransInfo *t = BIF_GetTransInfo();
-
- if (t->total == 0) {
- return;
- }
-
- switch (axis) {
- case 'x':
- setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text);
- break;
- case 'y':
- setLocalConstraint(t, (CON_AXIS0|CON_AXIS2), text);
- break;
- case 'z':
- setLocalConstraint(t, (CON_AXIS0|CON_AXIS1), text);
- break;
- }
-}
-
-void BIF_setLocalAxisConstraint(char axis, char *text) {
- TransInfo *t = BIF_GetTransInfo();
-
- if (t->total == 0) {
- return;
- }
-
- switch (axis) {
- case 'X':
- setLocalConstraint(t, CON_AXIS0, text);
- break;
- case 'Y':
- setLocalConstraint(t, CON_AXIS1, text);
- break;
- case 'Z':
- setLocalConstraint(t, CON_AXIS2, text);
- break;
- }
-}
-
-/* text is optional, for header print */
-void BIF_setSingleAxisConstraint(float vec[3], char *text) {
- TransInfo *t = BIF_GetTransInfo();
- float space[3][3], v[3];
-
- if (t->total == 0) {
- return;
- }
-
- VECCOPY(space[0], vec);
-
- v[0] = vec[2];
- v[1] = vec[0];
- v[2] = vec[1];
-
- Crossf(space[1], vec, v);
- Crossf(space[2], vec, space[1]);
- Mat3Ortho(space);
-
- Mat3CpyMat3(t->con.mtx, space);
- t->con.mode = CON_AXIS0;
-
- getConstraintMatrix(t);
-
- startConstraint(t);
-
- /* start copying with an offset of 1, to reserve a spot for the SPACE char */
- if(text)
- {
- strncpy(t->con.text+1, text, 48); /* 50 in struct */
- }
- else
- {
- t->con.text[1] = '\0'; /* No text */
- }
-
- t->con.drawExtra = NULL;
- t->con.applyVec = applyAxisConstraintVec;
- t->con.applySize = applyAxisConstraintSize;
- t->con.applyRot = applyAxisConstraintRot;
- t->redraw = 1;
-}
-
-void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) {
- TransInfo *t = BIF_GetTransInfo();
- float space[3][3];
-
- if (t->total == 0) {
- return;
- }
-
- VECCOPY(space[0], vec1);
- VECCOPY(space[1], vec2);
- Crossf(space[2], space[0], space[1]);
- Mat3Ortho(space);
-
- Mat3CpyMat3(t->con.mtx, space);
- t->con.mode = CON_AXIS0|CON_AXIS1;
-
- getConstraintMatrix(t);
-
- startConstraint(t);
-
- /* start copying with an offset of 1, to reserve a spot for the SPACE char */
- if(text)
- {
- strncpy(t->con.text+1, text, 48); /* 50 in struct */
- }
- else
- {
- t->con.text[1] = '\0'; /* No text */
- }
-
- t->con.drawExtra = NULL;
- t->con.applyVec = applyAxisConstraintVec;
- t->con.applySize = applyAxisConstraintSize;
- t->con.applyRot = applyAxisConstraintRot;
- t->redraw = 1;
-}
-
-/*----------------- DRAWING CONSTRAINTS -------------------*/
-
-void BIF_drawConstraint(void)
-{
- TransInfo *t = BIF_GetTransInfo();
- TransCon *tc = &(t->con);
-
- if (t->spacetype!=SPACE_VIEW3D)
- return;
- if (!(tc->mode & CON_APPLY))
- return;
- if (t->flag & T_USES_MANIPULATOR)
- return;
-
- /* nasty exception for Z constraint in camera view */
- if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB)
- return;
-
- if (tc->drawExtra) {
- tc->drawExtra(t);
- }
- else {
- if (tc->mode & CON_SELECT) {
- float vec[3];
- short mval[2];
- char col2[3] = {255,255,255};
- getmouseco_areawin(mval);
- convertViewVec(t, vec, (short)(mval[0] - t->con.imval[0]), (short)(mval[1] - t->con.imval[1]));
- VecAddf(vec, vec, tc->center);
-
- drawLine(tc->center, tc->mtx[0], 'x', 0);
- drawLine(tc->center, tc->mtx[1], 'y', 0);
- drawLine(tc->center, tc->mtx[2], 'z', 0);
-
- glColor3ubv((GLubyte *)col2);
-
- glDisable(GL_DEPTH_TEST);
- setlinestyle(1);
- glBegin(GL_LINE_STRIP);
- glVertex3fv(tc->center);
- glVertex3fv(vec);
- glEnd();
- setlinestyle(0);
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- }
-
- if (tc->mode & CON_AXIS0) {
- drawLine(tc->center, tc->mtx[0], 'x', DRAWLIGHT);
- }
- if (tc->mode & CON_AXIS1) {
- drawLine(tc->center, tc->mtx[1], 'y', DRAWLIGHT);
- }
- if (tc->mode & CON_AXIS2) {
- drawLine(tc->center, tc->mtx[2], 'z', DRAWLIGHT);
- }
- }
-}
-
-/* called from drawview.c, as an extra per-window draw option */
-void BIF_drawPropCircle()
-{
- TransInfo *t = BIF_GetTransInfo();
-
- if (t->flag & T_PROP_EDIT) {
- float tmat[4][4], imat[4][4];
-
- BIF_ThemeColor(TH_GRID);
-
- /* if editmode we need to go into object space */
- if(G.obedit && t->spacetype == SPACE_VIEW3D)
- mymultmatrix(G.obedit->obmat);
-
- mygetmatrix(tmat);
- Mat4Invert(imat, tmat);
-
- set_inverted_drawing(1);
- drawcircball(GL_LINE_LOOP, t->center, t->propsize, imat);
- set_inverted_drawing(0);
-
- /* if editmode we restore */
- if(G.obedit && t->spacetype == SPACE_VIEW3D)
- myloadmatrix(G.vd->viewmat);
- }
-}
-
-void BIF_getPropCenter(float *center)
-{
- TransInfo *t = BIF_GetTransInfo();
-
- if (t && t->flag & T_PROP_EDIT) {
- VECCOPY(center, t->center);
- }
- else
- center[0] = center[1] = center[2] = 0.0f;
-}
-static void drawObjectConstraint(TransInfo *t) {
- int i;
- TransData * td = t->data;
-
- /* Draw the first one lighter because that's the one who controls the others.
- Meaning the transformation is projected on that one and just copied on the others
- constraint space.
- In a nutshell, the object with light axis is controlled by the user and the others follow.
- Without drawing the first light, users have little clue what they are doing.
- */
- if (t->con.mode & CON_AXIS0) {
- drawLine(td->ob->obmat[3], td->axismtx[0], 'x', DRAWLIGHT);
- }
- if (t->con.mode & CON_AXIS1) {
- drawLine(td->ob->obmat[3], td->axismtx[1], 'y', DRAWLIGHT);
- }
- if (t->con.mode & CON_AXIS2) {
- drawLine(td->ob->obmat[3], td->axismtx[2], 'z', DRAWLIGHT);
- }
-
- td++;
-
- for(i=1;i<t->total;i++,td++) {
- if (t->con.mode & CON_AXIS0) {
- drawLine(td->ob->obmat[3], td->axismtx[0], 'x', 0);
- }
- if (t->con.mode & CON_AXIS1) {
- drawLine(td->ob->obmat[3], td->axismtx[1], 'y', 0);
- }
- if (t->con.mode & CON_AXIS2) {
- drawLine(td->ob->obmat[3], td->axismtx[2], 'z', 0);
- }
- }
-}
-
-/*--------------------- START / STOP CONSTRAINTS ---------------------- */
-
-void startConstraint(TransInfo *t) {
- t->con.mode |= CON_APPLY;
- *t->con.text = ' ';
- t->num.idx_max = MIN2(getConstraintSpaceDimension(t) - 1, t->idx_max);
-}
-
-void stopConstraint(TransInfo *t) {
- t->con.mode &= ~(CON_APPLY|CON_SELECT);
- *t->con.text = '\0';
- t->num.idx_max = t->idx_max;
-}
-
-void getConstraintMatrix(TransInfo *t)
-{
- float mat[3][3];
- Mat3Inv(t->con.imtx, t->con.mtx);
- Mat3One(t->con.pmtx);
-
- if (!(t->con.mode & CON_AXIS0)) {
- t->con.pmtx[0][0] =
- t->con.pmtx[0][1] =
- t->con.pmtx[0][2] = 0.0f;
- }
-
- if (!(t->con.mode & CON_AXIS1)) {
- t->con.pmtx[1][0] =
- t->con.pmtx[1][1] =
- t->con.pmtx[1][2] = 0.0f;
- }
-
- if (!(t->con.mode & CON_AXIS2)) {
- t->con.pmtx[2][0] =
- t->con.pmtx[2][1] =
- t->con.pmtx[2][2] = 0.0f;
- }
-
- Mat3MulMat3(mat, t->con.pmtx, t->con.imtx);
- Mat3MulMat3(t->con.pmtx, t->con.mtx, mat);
-}
-
-/*------------------------- MMB Select -------------------------------*/
-
-void initSelectConstraint(TransInfo *t, float mtx[3][3])
-{
- Mat3CpyMat3(t->con.mtx, mtx);
- t->con.mode |= CON_APPLY;
- t->con.mode |= CON_SELECT;
- t->con.mode &= ~CON_LOCAL;
-
- setNearestAxis(t);
- t->con.drawExtra = NULL;
- t->con.applyVec = applyAxisConstraintVec;
- t->con.applySize = applyAxisConstraintSize;
- t->con.applyRot = applyAxisConstraintRot;
-}
-
-void selectConstraint(TransInfo *t) {
- if (t->con.mode & CON_SELECT) {
- setNearestAxis(t);
- startConstraint(t);
- }
-}
-
-void postSelectConstraint(TransInfo *t)
-{
- if (!(t->con.mode & CON_SELECT))
- return;
-
- t->con.mode &= ~CON_AXIS0;
- t->con.mode &= ~CON_AXIS1;
- t->con.mode &= ~CON_AXIS2;
- t->con.mode &= ~CON_SELECT;
-
- setNearestAxis(t);
-
- startConstraint(t);
- t->redraw = 1;
-}
-
-static void setNearestAxis2d(TransInfo *t)
-{
- short mval[2];
- short ival[2];
-
- getmouseco_areawin(mval);
- ival[0]= t->imval[0];
- ival[1]= t->imval[1];
-
- /* no correction needed... just use whichever one is lower */
- if ( abs(mval[0]-ival[0]) < abs(mval[1]-ival[1]) ) {
- t->con.mode |= CON_AXIS1;
- sprintf(t->con.text, " along Y axis");
- }
- else {
- t->con.mode |= CON_AXIS0;
- sprintf(t->con.text, " along X axis");
- }
-}
-
-static void setNearestAxis3d(TransInfo *t)
-{
- float zfac;
- float mvec[3], axis[3], proj[3];
- float len[3];
- int i, icoord[2];
- short coord[2];
-
- /* calculate mouse movement */
- getmouseco_areawin(coord);
- mvec[0] = (float)(coord[0] - t->con.imval[0]);
- mvec[1] = (float)(coord[1] - t->con.imval[1]);
- mvec[2] = 0.0f;
-
- /* we need to correct axis length for the current zoomlevel of view,
- this to prevent projected values to be clipped behind the camera
- and to overflow the short integers.
- The formula used is a bit stupid, just a simplification of the substraction
- of two 2D points 30 pixels apart (that's the last factor in the formula) after
- projecting them with window_to_3d and then get the length of that vector.
- */
- zfac= t->persmat[0][3]*t->center[0]+ t->persmat[1][3]*t->center[1]+ t->persmat[2][3]*t->center[2]+ t->persmat[3][3];
- zfac = VecLength(t->persinv[0]) * 2.0f/curarea->winx * zfac * 30.0f;
-
- for (i = 0; i<3; i++) {
- VECCOPY(axis, t->con.mtx[i]);
-
- VecMulf(axis, zfac);
- /* now we can project to get window coordinate */
- VecAddf(axis, axis, t->con.center);
- projectIntView(t, axis, icoord);
-
- axis[0] = (float)(icoord[0] - t->center2d[0]);
- axis[1] = (float)(icoord[1] - t->center2d[1]);
- axis[2] = 0.0f;
-
- if (Normalize(axis) != 0.0f) {
- Projf(proj, mvec, axis);
- VecSubf(axis, mvec, proj);
- len[i] = Normalize(axis);
- }
- else {
- len[i] = 10000000000.0f;
- }
- }
-
- if (len[0] <= len[1] && len[0] <= len[2]) {
- if (G.qual & LR_SHIFTKEY) {
- t->con.mode |= (CON_AXIS1|CON_AXIS2);
- sprintf(t->con.text, " locking %s X axis", t->spacename);
- }
- else {
- t->con.mode |= CON_AXIS0;
- sprintf(t->con.text, " along %s X axis", t->spacename);
- }
- }
- else if (len[1] <= len[0] && len[1] <= len[2]) {
- if (G.qual & LR_SHIFTKEY) {
- t->con.mode |= (CON_AXIS0|CON_AXIS2);
- sprintf(t->con.text, " locking %s Y axis", t->spacename);
- }
- else {
- t->con.mode |= CON_AXIS1;
- sprintf(t->con.text, " along %s Y axis", t->spacename);
- }
- }
- else if (len[2] <= len[1] && len[2] <= len[0]) {
- if (G.qual & LR_SHIFTKEY) {
- t->con.mode |= (CON_AXIS0|CON_AXIS1);
- sprintf(t->con.text, " locking %s Z axis", t->spacename);
- }
- else {
- t->con.mode |= CON_AXIS2;
- sprintf(t->con.text, " along %s Z axis", t->spacename);
- }
- }
-}
-
-void setNearestAxis(TransInfo *t)
-{
- /* clear any prior constraint flags */
- t->con.mode &= ~CON_AXIS0;
- t->con.mode &= ~CON_AXIS1;
- t->con.mode &= ~CON_AXIS2;
-
- /* constraint setting - depends on spacetype */
- if (t->spacetype == SPACE_VIEW3D) {
- /* 3d-view */
- setNearestAxis3d(t);
- }
- else {
- /* assume that this means a 2D-Editor */
- setNearestAxis2d(t);
- }
-
- getConstraintMatrix(t);
-}
-
-/*-------------- HELPER FUNCTIONS ----------------*/
-
-char constraintModeToChar(TransInfo *t) {
- if ((t->con.mode & CON_APPLY)==0) {
- return '\0';
- }
- switch (t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2)) {
- case (CON_AXIS0):
- case (CON_AXIS1|CON_AXIS2):
- return 'X';
- case (CON_AXIS1):
- case (CON_AXIS0|CON_AXIS2):
- return 'Y';
- case (CON_AXIS2):
- case (CON_AXIS0|CON_AXIS1):
- return 'Z';
- default:
- return '\0';
- }
-}
-
-
-int isLockConstraint(TransInfo *t) {
- int mode = t->con.mode;
-
- if ( (mode & (CON_AXIS0|CON_AXIS1)) == (CON_AXIS0|CON_AXIS1))
- return 1;
-
- if ( (mode & (CON_AXIS1|CON_AXIS2)) == (CON_AXIS1|CON_AXIS2))
- return 1;
-
- if ( (mode & (CON_AXIS0|CON_AXIS2)) == (CON_AXIS0|CON_AXIS2))
- return 1;
-
- return 0;
-}
-
-/*
- * Returns the dimension of the constraint space.
- *
- * For that reason, the flags always needs to be set to properly evaluate here,
- * even if they aren't actually used in the callback function. (Which could happen
- * for weird constraints not yet designed. Along a path for example.)
- */
-
-int getConstraintSpaceDimension(TransInfo *t)
-{
- int n = 0;
-
- if (t->con.mode & CON_AXIS0)
- n++;
-
- if (t->con.mode & CON_AXIS1)
- n++;
-
- if (t->con.mode & CON_AXIS2)
- n++;
-
- return n;
-/*
- Someone willing to do it criptically could do the following instead:
-
- return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2);
-
- Based on the assumptions that the axis flags are one after the other and start at 1
-*/
-}
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
deleted file mode 100644
index 496d5120bb9..00000000000
--- a/source/blender/src/transform_conversions.c
+++ /dev/null
@@ -1,4343 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_image_types.h"
-#include "DNA_ipo_types.h"
-#include "DNA_key_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_world_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_property_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_listBase.h"
-#include "DNA_gpencil_types.h"
-
-#include "BKE_action.h"
-#include "BKE_armature.h"
-#include "BKE_blender.h"
-#include "BKE_cloth.h"
-#include "BKE_curve.h"
-#include "BKE_constraint.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_effect.h"
-#include "BKE_font.h"
-#include "BKE_global.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_key.h"
-#include "BKE_main.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_pointcache.h"
-#include "BKE_softbody.h"
-#include "BKE_utildefines.h"
-#include "BKE_bmesh.h"
-
-#include "BIF_editaction.h"
-#include "BIF_editview.h"
-#include "BIF_editlattice.h"
-#include "BIF_editconstraint.h"
-#include "BIF_editarmature.h"
-#include "BIF_editmesh.h"
-#include "BIF_editnla.h"
-#include "BIF_editsima.h"
-#include "BIF_editparticle.h"
-#include "BIF_gl.h"
-#include "BIF_keyframing.h"
-#include "BIF_poseobject.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_retopo.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_view.h"
-#include "BSE_drawipo.h"
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_editipo_types.h"
-#include "BSE_editaction_types.h"
-
-#include "BDR_drawaction.h" // list of keyframes in action
-#include "BDR_editobject.h" // reset_slowparents()
-#include "BDR_gpencil.h"
-#include "BDR_unwrapper.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "editmesh.h"
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-extern ListBase editNurb;
-extern ListBase editelems;
-
-#include "transform.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-/* local function prototype - for Object/Bone Constraints */
-static short constraints_list_needinv(TransInfo *t, ListBase *list);
-/* local function prototype - for finding number of keyframes that are selected for editing */
-static int count_ipo_keys(Ipo *ipo, char side, float cfra);
-
-/* ************************** Functions *************************** */
-
-static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail) {
- TransData pivot = *head;
- TransData *ihead = head;
- TransData *itail = tail;
- short connected = t->flag & T_PROP_CONNECTED;
-
- while (head < tail)
- {
- if (connected) {
- while ((tail->dist >= pivot.dist) && (head < tail))
- tail--;
- }
- else {
- while ((tail->rdist >= pivot.rdist) && (head < tail))
- tail--;
- }
-
- if (head != tail)
- {
- *head = *tail;
- head++;
- }
-
- if (connected) {
- while ((head->dist <= pivot.dist) && (head < tail))
- head++;
- }
- else {
- while ((head->rdist <= pivot.rdist) && (head < tail))
- head++;
- }
-
- if (head != tail)
- {
- *tail = *head;
- tail--;
- }
- }
-
- *head = pivot;
- if (ihead < head) {
- qsort_trans_data(t, ihead, head-1);
- }
- if (itail > head) {
- qsort_trans_data(t, head+1, itail);
- }
-}
-
-void sort_trans_data_dist(TransInfo *t) {
- TransData *start = t->data;
- int i = 1;
-
- while(i < t->total && start->flag & TD_SELECTED) {
- start++;
- i++;
- }
- qsort_trans_data(t, start, t->data + t->total - 1);
-}
-
-static void sort_trans_data(TransInfo *t)
-{
- TransData *sel, *unsel;
- TransData temp;
- unsel = t->data;
- sel = t->data;
- sel += t->total - 1;
- while (sel > unsel) {
- while (unsel->flag & TD_SELECTED) {
- unsel++;
- if (unsel == sel) {
- return;
- }
- }
- while (!(sel->flag & TD_SELECTED)) {
- sel--;
- if (unsel == sel) {
- return;
- }
- }
- temp = *unsel;
- *unsel = *sel;
- *sel = temp;
- sel--;
- unsel++;
- }
-}
-
-/* distance calculated from not-selected vertex to nearest selected vertex
- warning; this is loops inside loop, has minor N^2 issues, but by sorting list it is OK */
-static void set_prop_dist(TransInfo *t, short with_dist)
-{
- TransData *tob;
- int a;
-
- for(a=0, tob= t->data; a<t->total; a++, tob++) {
-
- tob->rdist= 0.0f; // init, it was mallocced
-
- if((tob->flag & TD_SELECTED)==0) {
- TransData *td;
- int i;
- float dist, vec[3];
-
- tob->rdist = -1.0f; // signal for next loop
-
- for (i = 0, td= t->data; i < t->total; i++, td++) {
- if(td->flag & TD_SELECTED) {
- VecSubf(vec, tob->center, td->center);
- Mat3MulVecfl(tob->mtx, vec);
- dist = Normalize(vec);
- if (tob->rdist == -1.0f) {
- tob->rdist = dist;
- }
- else if (dist < tob->rdist) {
- tob->rdist = dist;
- }
- }
- else break; // by definition transdata has selected items in beginning
- }
- if (with_dist) {
- tob->dist = tob->rdist;
- }
- }
- }
-}
-
-/* ************************** CONVERSIONS ************************* */
-
-/* ********************* texture space ********* */
-
-static void createTransTexspace(TransInfo *t)
-{
- TransData *td;
- Object *ob;
- ID *id;
- int *texflag;
-
- ob= OBACT;
-
- if (ob==NULL) { // Shouldn't logically happen, but still...
- t->total = 0;
- return;
- }
-
- id= ob->data;
- if(id==NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) {
- t->total = 0;
- return;
- }
-
- t->total = 1;
- td= t->data= MEM_callocN(sizeof(TransData), "TransTexspace");
- td->ext= t->ext= MEM_callocN(sizeof(TransDataExtension), "TransTexspace");
-
- td->flag= TD_SELECTED;
- VECCOPY(td->center, ob->obmat[3]);
- td->ob = ob;
-
- Mat3CpyMat4(td->mtx, ob->obmat);
- Mat3CpyMat4(td->axismtx, ob->obmat);
- Mat3Ortho(td->axismtx);
- Mat3Inv(td->smtx, td->mtx);
-
- if (give_obdata_texspace(ob, &texflag, &td->loc, &td->ext->size, &td->ext->rot)) {
- *texflag &= ~AUTOSPACE;
- }
-
- VECCOPY(td->iloc, td->loc);
- VECCOPY(td->ext->irot, td->ext->rot);
- VECCOPY(td->ext->isize, td->ext->size);
-}
-
-/* ********************* edge (for crease) ***** */
-
-static void createTransEdge(TransInfo *t) {
- TransData *td = NULL;
- EditMesh *em = G.editMesh;
- EditEdge *eed;
- float mtx[3][3], smtx[3][3];
- int count=0, countsel=0;
- int propmode = t->flag & T_PROP_EDIT;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- if (eed->f & SELECT) countsel++;
- if (propmode) count++;
- }
- }
-
- if (countsel == 0)
- return;
-
- if(propmode) {
- t->total = count;
- }
- else {
- t->total = countsel;
- }
-
- td= t->data= MEM_callocN(t->total * sizeof(TransData), "TransCrease");
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0 && (eed->f & SELECT || propmode)) {
- /* need to set center for center calculations */
- VecAddf(td->center, eed->v1->co, eed->v2->co);
- VecMulf(td->center, 0.5f);
-
- td->loc= NULL;
- if (eed->f & SELECT)
- td->flag= TD_SELECTED;
- else
- td->flag= 0;
-
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->ext = NULL;
- td->tdi = NULL;
- if (t->mode == TFM_BWEIGHT) {
- td->val = &(eed->bweight);
- td->ival = eed->bweight;
- }
- else {
- td->val = &(eed->crease);
- td->ival = eed->crease;
- }
-
- td++;
- }
- }
-}
-
-/* ********************* pose mode ************* */
-
-static bKinematicConstraint *has_targetless_ik(bPoseChannel *pchan)
-{
- bConstraint *con= pchan->constraints.first;
-
- for(;con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) {
- bKinematicConstraint *data= con->data;
-
- if(data->tar==NULL)
- return data;
- if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0)
- return data;
- }
- }
- return NULL;
-}
-
-static short apply_targetless_ik(Object *ob)
-{
- bPoseChannel *pchan, *parchan, *chanlist[256];
- bKinematicConstraint *data;
- int segcount, apply= 0;
-
- /* now we got a difficult situation... we have to find the
- target-less IK pchans, and apply transformation to the all
- pchans that were in the chain */
-
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- data= has_targetless_ik(pchan);
- if(data && (data->flag & CONSTRAINT_IK_AUTO)) {
-
- /* fill the array with the bones of the chain (armature.c does same, keep it synced) */
- segcount= 0;
-
- /* exclude tip from chain? */
- if(!(data->flag & CONSTRAINT_IK_TIP))
- parchan= pchan->parent;
- else
- parchan= pchan;
-
- /* Find the chain's root & count the segments needed */
- for (; parchan; parchan=parchan->parent){
- chanlist[segcount]= parchan;
- segcount++;
-
- if(segcount==data->rootbone || segcount>255) break; // 255 is weak
- }
- for(;segcount;segcount--) {
- Bone *bone;
- float rmat[4][4], tmat[4][4], imat[4][4];
-
- /* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */
- /* we put in channel the entire result of rmat= (channel * constraint * IK) */
- /* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */
- /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */
-
- parchan= chanlist[segcount-1];
- bone= parchan->bone;
- bone->flag |= BONE_TRANSFORM; /* ensures it gets an auto key inserted */
-
- if(parchan->parent) {
- Bone *parbone= parchan->parent->bone;
- float offs_bone[4][4];
-
- /* offs_bone = yoffs(b-1) + root(b) + bonemat(b) */
- Mat4CpyMat3(offs_bone, bone->bone_mat);
-
- /* The bone's root offset (is in the parent's coordinate system) */
- VECCOPY(offs_bone[3], bone->head);
-
- /* Get the length translation of parent (length along y axis) */
- offs_bone[3][1]+= parbone->length;
-
- /* pose_mat(b-1) * offs_bone */
- if(parchan->bone->flag & BONE_HINGE) {
- /* the rotation of the parent restposition */
- Mat4CpyMat4(rmat, parbone->arm_mat); /* rmat used as temp */
-
- /* the location of actual parent transform */
- VECCOPY(rmat[3], offs_bone[3]);
- offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
- Mat4MulVecfl(parchan->parent->pose_mat, rmat[3]);
-
- Mat4MulMat4(tmat, offs_bone, rmat);
- }
- else if(parchan->bone->flag & BONE_NO_SCALE) {
- Mat4MulMat4(tmat, offs_bone, parchan->parent->pose_mat);
- Mat4Ortho(tmat);
- }
- else
- Mat4MulMat4(tmat, offs_bone, parchan->parent->pose_mat);
-
- Mat4Invert(imat, tmat);
- }
- else {
- Mat4CpyMat3(tmat, bone->bone_mat);
-
- VECCOPY(tmat[3], bone->head);
- Mat4Invert(imat, tmat);
- }
- /* result matrix */
- Mat4MulMat4(rmat, parchan->pose_mat, imat);
-
- /* apply and decompose, doesn't work for constraints or non-uniform scale well */
- {
- float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3];
-
- Mat3CpyMat4(rmat3, rmat);
-
- /* quaternion */
- Mat3ToQuat(rmat3, parchan->quat);
-
- /* for size, remove rotation */
- /* causes problems with some constraints (so apply only if needed) */
- if (data->flag & CONSTRAINT_IK_STRETCH) {
- QuatToMat3(parchan->quat, qmat);
- Mat3Inv(imat, qmat);
- Mat3MulMat3(smat, rmat3, imat);
- Mat3ToSize(smat, parchan->size);
- }
-
- /* causes problems with some constraints (e.g. childof), so disable this */
- /* as it is IK shouldn't affect location directly */
- /* VECCOPY(parchan->loc, rmat[3]); */
- }
-
- }
-
- apply= 1;
- data->flag &= ~CONSTRAINT_IK_AUTO;
- }
- }
-
- return apply;
-}
-
-static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, TransData *td)
-{
- Bone *bone= pchan->bone;
- float pmat[3][3], omat[3][3];
- float cmat[3][3], tmat[3][3];
- float vec[3];
-
- VECCOPY(vec, pchan->pose_mat[3]);
- VECCOPY(td->center, vec);
-
- td->ob = ob;
- td->flag= TD_SELECTED|TD_USEQUAT;
- if (bone->flag & BONE_HINGE_CHILD_TRANSFORM)
- {
- td->flag |= TD_NOCENTER;
- }
-
- if (bone->flag & BONE_TRANSFORM_CHILD)
- {
- td->flag |= TD_NOCENTER;
- td->flag |= TD_NO_LOC;
- }
-
- td->protectflag= pchan->protectflag;
-
- td->loc = pchan->loc;
- VECCOPY(td->iloc, pchan->loc);
-
- td->ext->rot= NULL;
- td->ext->quat= pchan->quat;
- td->ext->size= pchan->size;
-
- QUATCOPY(td->ext->iquat, pchan->quat);
- VECCOPY(td->ext->isize, pchan->size);
-
- /* proper way to get parent transform + own transform + constraints transform */
- Mat3CpyMat4(omat, ob->obmat);
-
- if(pchan->parent) {
- if(pchan->bone->flag & BONE_HINGE)
- Mat3CpyMat4(pmat, pchan->parent->bone->arm_mat);
- else
- Mat3CpyMat4(pmat, pchan->parent->pose_mat);
-
- if (constraints_list_needinv(t, &pchan->constraints)) {
- Mat3CpyMat4(tmat, pchan->constinv);
- Mat3Inv(cmat, tmat);
- Mat3MulSerie(td->mtx, pchan->bone->bone_mat, pmat, omat, cmat, 0,0,0,0); // dang mulserie swaps args
- }
- else
- Mat3MulSerie(td->mtx, pchan->bone->bone_mat, pmat, omat, 0,0,0,0,0); // dang mulserie swaps args
- }
- else {
- if (constraints_list_needinv(t, &pchan->constraints)) {
- Mat3CpyMat4(tmat, pchan->constinv);
- Mat3Inv(cmat, tmat);
- Mat3MulSerie(td->mtx, pchan->bone->bone_mat, omat, cmat, 0,0,0,0,0); // dang mulserie swaps args
- }
- else
- Mat3MulMat3(td->mtx, omat, pchan->bone->bone_mat); // Mat3MulMat3 has swapped args!
- }
-
- Mat3Inv(td->smtx, td->mtx);
-
- /* for axismat we use bone's own transform */
- Mat3CpyMat4(pmat, pchan->pose_mat);
- Mat3MulMat3(td->axismtx, omat, pmat);
- Mat3Ortho(td->axismtx);
-
- if(t->mode==TFM_BONESIZE) {
- bArmature *arm= t->poseobj->data;
-
- if(arm->drawtype==ARM_ENVELOPE) {
- td->loc= NULL;
- td->val= &bone->dist;
- td->ival= bone->dist;
- }
- else {
- // abusive storage of scale in the loc pointer :)
- td->loc= &bone->xwidth;
- VECCOPY (td->iloc, td->loc);
- td->val= NULL;
- }
- }
-
- /* in this case we can do target-less IK grabbing */
- if(t->mode==TFM_TRANSLATION) {
- bKinematicConstraint *data= has_targetless_ik(pchan);
- if(data) {
- if(data->flag & CONSTRAINT_IK_TIP) {
- VECCOPY(data->grabtarget, pchan->pose_tail);
- }
- else {
- VECCOPY(data->grabtarget, pchan->pose_head);
- }
- td->loc = data->grabtarget;
- VECCOPY(td->iloc, td->loc);
- data->flag |= CONSTRAINT_IK_AUTO;
-
- /* only object matrix correction */
- Mat3CpyMat3 (td->mtx, omat);
- Mat3Inv (td->smtx, td->mtx);
- }
- }
-
- /* store reference to first constraint */
- td->con= pchan->constraints.first;
-}
-
-static void bone_children_clear_transflag(TransInfo *t, ListBase *lb)
-{
- Bone *bone= lb->first;
-
- for(;bone;bone= bone->next) {
- if((bone->flag & BONE_HINGE) && (bone->flag & BONE_CONNECTED))
- {
- bone->flag |= BONE_HINGE_CHILD_TRANSFORM;
- }
- else if (bone->flag & BONE_TRANSFORM && (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL))
- {
- bone->flag |= BONE_TRANSFORM_CHILD;
- }
- else
- {
- bone->flag &= ~BONE_TRANSFORM;
- }
-
- bone_children_clear_transflag(t, &bone->childbase);
- }
-}
-
-/* sets transform flags in the bones, returns total */
-static void set_pose_transflags(TransInfo *t, Object *ob)
-{
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- Bone *bone;
- int hastranslation;
-
- t->total= 0;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
- if(bone->layer & arm->layer) {
- if(bone->flag & BONE_SELECTED)
- bone->flag |= BONE_TRANSFORM;
- else
- bone->flag &= ~BONE_TRANSFORM;
-
- bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM;
- bone->flag &= ~BONE_TRANSFORM_CHILD;
- }
- }
-
- /* make sure no bone can be transformed when a parent is transformed */
- /* since pchans are depsgraph sorted, the parents are in beginning of list */
- if(t->mode!=TFM_BONESIZE) {
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
- if(bone->flag & BONE_TRANSFORM)
- bone_children_clear_transflag(t, &bone->childbase);
- }
- }
- /* now count, and check if we have autoIK or have to switch from translate to rotate */
- hastranslation= 0;
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- bone= pchan->bone;
- if(bone->flag & BONE_TRANSFORM) {
-
- t->total++;
-
- if(t->mode==TFM_TRANSLATION) {
- if( has_targetless_ik(pchan)==NULL ) {
- if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
- if(pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
- hastranslation= 1;
- }
- else if((pchan->protectflag & OB_LOCK_LOC)!=OB_LOCK_LOC)
- hastranslation= 1;
- }
- else
- hastranslation= 1;
- }
- }
- }
-
- /* if there are no translatable bones, do rotation */
- if(t->mode==TFM_TRANSLATION && !hastranslation)
- t->mode= TFM_ROTATION;
-}
-
-
-/* -------- Auto-IK ---------- */
-
-/* adjust pose-channel's auto-ik chainlen */
-static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen)
-{
- bConstraint *con;
-
- /* don't bother to search if no valid constraints */
- if ((pchan->constflag & (PCHAN_HAS_IK|PCHAN_HAS_TARGET))==0)
- return;
-
- /* check if pchan has ik-constraint */
- for (con= pchan->constraints.first; con; con= con->next) {
- if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) {
- bKinematicConstraint *data= con->data;
-
- /* only accept if a temporary one (for auto-ik) */
- if (data->flag & CONSTRAINT_IK_TEMP) {
- /* chainlen is new chainlen, but is limited by maximum chainlen */
- if ((chainlen==0) || (chainlen > data->max_rootbone))
- data->rootbone= data->max_rootbone;
- else
- data->rootbone= chainlen;
- }
- }
- }
-}
-
-/* change the chain-length of auto-ik */
-void transform_autoik_update (TransInfo *t, short mode)
-{
- short *chainlen= &G.scene->toolsettings->autoik_chainlen;
- bPoseChannel *pchan;
-
- /* mode determines what change to apply to chainlen */
- if (mode == 1) {
- /* mode=1 is from WHEELMOUSEDOWN... increases len */
- (*chainlen)++;
- }
- else if (mode == -1) {
- /* mode==-1 is from WHEELMOUSEUP... decreases len */
- if (*chainlen > 0) (*chainlen)--;
- }
-
- /* sanity checks (don't assume t->poseobj is set, or that it is an armature) */
- if (ELEM(NULL, t->poseobj, t->poseobj->pose))
- return;
-
- /* apply to all pose-channels */
- for (pchan=t->poseobj->pose->chanbase.first; pchan; pchan=pchan->next) {
- pchan_autoik_adjust(pchan, *chainlen);
- }
-}
-
-/* frees temporal IKs */
-static void pose_grab_with_ik_clear(Object *ob)
-{
- bKinematicConstraint *data;
- bPoseChannel *pchan;
- bConstraint *con;
-
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- /* clear all temporary lock flags */
- pchan->ikflag &= ~(BONE_IK_NO_XDOF_TEMP|BONE_IK_NO_YDOF_TEMP|BONE_IK_NO_ZDOF_TEMP);
-
- pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET);
- /* remove all temporary IK-constraints added */
- for (con= pchan->constraints.first; con; con= con->next) {
- if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
- data= con->data;
- if (data->flag & CONSTRAINT_IK_TEMP) {
- BLI_remlink(&pchan->constraints, con);
- MEM_freeN(con->data);
- MEM_freeN(con);
- continue;
- }
- pchan->constflag |= PCHAN_HAS_IK;
- if(data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0))
- pchan->constflag |= PCHAN_HAS_TARGET;
- }
- }
- }
-}
-
-/* adds the IK to pchan - returns if added */
-static short pose_grab_with_ik_add(bPoseChannel *pchan)
-{
- bKinematicConstraint *data;
- bConstraint *con;
- bConstraint *targetless = 0;
-
- /* Sanity check */
- if (pchan == NULL)
- return 0;
-
- /* Rule: not if there's already an IK on this channel */
- for (con= pchan->constraints.first; con; con= con->next) {
- if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
- bKinematicConstraint *data= con->data;
- if(data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0)) {
- targetless = con;
- /* but, if this is a targetless IK, we make it auto anyway (for the children loop) */
- if (con->enforce!=0.0) {
- targetless->flag |= CONSTRAINT_IK_AUTO;
- return 0;
- }
- }
- if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0))
- return 0;
- }
- }
-
- con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC);
- BLI_addtail(&pchan->constraints, con);
- pchan->constflag |= (PCHAN_HAS_IK|PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */
- data= con->data;
- if (targetless) { /* if exists use values from last targetless IK-constraint as base */
- *data = *((bKinematicConstraint*)targetless->data);
- }
- else
- data->flag= CONSTRAINT_IK_TIP;
- data->flag |= CONSTRAINT_IK_TEMP|CONSTRAINT_IK_AUTO;
- VECCOPY(data->grabtarget, pchan->pose_tail);
- data->rootbone= 1;
-
- /* we include only a connected chain */
- while ((pchan) && (pchan->bone->flag & BONE_CONNECTED)) {
- /* here, we set ik-settings for bone from pchan->protectflag */
- if (pchan->protectflag & OB_LOCK_ROTX) pchan->ikflag |= BONE_IK_NO_XDOF_TEMP;
- if (pchan->protectflag & OB_LOCK_ROTY) pchan->ikflag |= BONE_IK_NO_YDOF_TEMP;
- if (pchan->protectflag & OB_LOCK_ROTZ) pchan->ikflag |= BONE_IK_NO_ZDOF_TEMP;
-
- /* now we count this pchan as being included */
- data->rootbone++;
- pchan= pchan->parent;
- }
-
- /* make a copy of maximum chain-length */
- data->max_rootbone= data->rootbone;
-
- return 1;
-}
-
-/* bone is a candidate to get IK, but we don't do it if it has children connected */
-static short pose_grab_with_ik_children(bPose *pose, Bone *bone)
-{
- Bone *bonec;
- short wentdeeper=0, added=0;
-
- /* go deeper if children & children are connected */
- for (bonec= bone->childbase.first; bonec; bonec= bonec->next) {
- if (bonec->flag & BONE_CONNECTED) {
- wentdeeper= 1;
- added+= pose_grab_with_ik_children(pose, bonec);
- }
- }
- if (wentdeeper==0) {
- bPoseChannel *pchan= get_pose_channel(pose, bone->name);
- if (pchan)
- added+= pose_grab_with_ik_add(pchan);
- }
-
- return added;
-}
-
-/* main call which adds temporal IK chains */
-static short pose_grab_with_ik(Object *ob)
-{
- bArmature *arm;
- bPoseChannel *pchan, *parent;
- Bone *bonec;
- short tot_ik= 0;
-
- if ((ob==NULL) || (ob->pose==NULL) || (ob->flag & OB_POSEMODE)==0)
- return 0;
-
- arm = ob->data;
-
- /* Rule: allow multiple Bones (but they must be selected, and only one ik-solver per chain should get added) */
- for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone->layer & arm->layer) {
- if (pchan->bone->flag & BONE_SELECTED) {
- /* Rule: no IK for solitatry (unconnected) bones */
- for (bonec=pchan->bone->childbase.first; bonec; bonec=bonec->next) {
- if (bonec->flag & BONE_CONNECTED) {
- break;
- }
- }
- if ((pchan->bone->flag & BONE_CONNECTED)==0 && (bonec == NULL))
- continue;
-
- /* rule: if selected Bone is not a root bone, it gets a temporal IK */
- if (pchan->parent) {
- /* only adds if there's no IK yet (and no parent bone was selected) */
- for (parent= pchan->parent; parent; parent= parent->parent) {
- if (parent->bone->flag & BONE_SELECTED)
- break;
- }
- if (parent == NULL)
- tot_ik += pose_grab_with_ik_add(pchan);
- }
- else {
- /* rule: go over the children and add IK to the tips */
- tot_ik += pose_grab_with_ik_children(ob->pose, pchan->bone);
- }
- }
- }
- }
-
- return (tot_ik) ? 1 : 0;
-}
-
-
-/* only called with pose mode active object now */
-static void createTransPose(TransInfo *t, Object *ob)
-{
- bArmature *arm;
- bPoseChannel *pchan;
- TransData *td;
- TransDataExtension *tdx;
- short ik_on= 0;
- int i;
-
- t->total= 0;
-
- /* check validity of state */
- arm=get_armature (ob);
- if (arm==NULL || ob->pose==NULL) return;
-
- if (arm->flag & ARM_RESTPOS) {
- if(ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) {
- notice("Pose edit not possible while Rest Position is enabled");
- return;
- }
- }
- if (!(ob->lay & G.vd->lay)) return;
-
- /* do we need to add temporal IK chains? */
- if ((arm->flag & ARM_AUTO_IK) && t->mode==TFM_TRANSLATION) {
- ik_on= pose_grab_with_ik(ob);
- if (ik_on) t->flag |= T_AUTOIK;
- }
-
- /* set flags and count total (warning, can change transform to rotate) */
- set_pose_transflags(t, ob);
-
- if(t->total==0) return;
-
- t->flag |= T_POSE;
- t->poseobj= ob; /* we also allow non-active objects to be transformed, in weightpaint */
-
- /* make sure the lock is set OK, unlock can be accidentally saved? */
- ob->pose->flag |= POSE_LOCKED;
- ob->pose->flag &= ~POSE_DO_UNLOCK;
-
- /* init trans data */
- td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone");
- tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt");
- for(i=0; i<t->total; i++, td++, tdx++) {
- td->ext= tdx;
- td->tdi = NULL;
- td->val = NULL;
- }
-
- /* use pose channels to fill trans data */
- td= t->data;
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone->flag & BONE_TRANSFORM) {
- add_pose_transdata(t, pchan, ob, td);
- td++;
- }
- }
-
- if(td != (t->data+t->total)) printf("Bone selection count error\n");
-
- /* initialise initial auto=ik chainlen's? */
- if (ik_on) transform_autoik_update(t, 0);
-}
-
-/* ********************* armature ************** */
-
-static void createTransArmatureVerts(TransInfo *t)
-{
- EditBone *ebo;
- bArmature *arm= G.obedit->data;
- TransData *td;
- float mtx[3][3], smtx[3][3], delta[3], bonemat[3][3];
-
- t->total = 0;
- for (ebo=G.edbo.first;ebo;ebo=ebo->next) {
- if(ebo->layer & arm->layer) {
- if (t->mode==TFM_BONESIZE) {
- if (ebo->flag & BONE_SELECTED)
- t->total++;
- }
- else if (t->mode==TFM_BONE_ROLL) {
- if (ebo->flag & BONE_SELECTED)
- t->total++;
- }
- else {
- if (ebo->flag & BONE_TIPSEL)
- t->total++;
- if (ebo->flag & BONE_ROOTSEL)
- t->total++;
- }
- }
- }
-
- if (!t->total) return;
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone");
-
- for (ebo=G.edbo.first;ebo;ebo=ebo->next){
- ebo->oldlength= ebo->length; // length==0.0 on extrude, used for scaling radius of bone points
-
- if(ebo->layer & arm->layer) {
- if (t->mode==TFM_BONE_ENVELOPE) {
-
- if (ebo->flag & BONE_ROOTSEL){
- td->val= &ebo->rad_head;
- td->ival= *td->val;
-
- VECCOPY (td->center, ebo->head);
- td->flag= TD_SELECTED;
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->loc = NULL;
- td->ext = NULL;
- td->tdi = NULL;
-
- td++;
- }
- if (ebo->flag & BONE_TIPSEL){
- td->val= &ebo->rad_tail;
- td->ival= *td->val;
- VECCOPY (td->center, ebo->tail);
- td->flag= TD_SELECTED;
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->loc = NULL;
- td->ext = NULL;
- td->tdi = NULL;
-
- td++;
- }
-
- }
- else if (t->mode==TFM_BONESIZE) {
- if (ebo->flag & BONE_SELECTED) {
- if(arm->drawtype==ARM_ENVELOPE) {
- td->loc= NULL;
- td->val= &ebo->dist;
- td->ival= ebo->dist;
- }
- else {
- // abusive storage of scale in the loc pointer :)
- td->loc= &ebo->xwidth;
- VECCOPY (td->iloc, td->loc);
- td->val= NULL;
- }
- VECCOPY (td->center, ebo->head);
- td->flag= TD_SELECTED;
-
- /* use local bone matrix */
- VecSubf(delta, ebo->tail, ebo->head);
- vec_roll_to_mat3(delta, ebo->roll, bonemat);
- Mat3MulMat3(td->mtx, mtx, bonemat);
- Mat3Inv(td->smtx, td->mtx);
-
- Mat3CpyMat3(td->axismtx, td->mtx);
- Mat3Ortho(td->axismtx);
-
- td->ext = NULL;
- td->tdi = NULL;
-
- td++;
- }
- }
- else if (t->mode==TFM_BONE_ROLL) {
- if (ebo->flag & BONE_SELECTED) {
- td->loc= NULL;
- td->val= &(ebo->roll);
- td->ival= ebo->roll;
-
- VECCOPY (td->center, ebo->head);
- td->flag= TD_SELECTED;
-
- td->ext = NULL;
- td->tdi = NULL;
-
- td++;
- }
- }
- else {
- if (ebo->flag & BONE_TIPSEL){
- VECCOPY (td->iloc, ebo->tail);
- VECCOPY (td->center, td->iloc);
- td->loc= ebo->tail;
- td->flag= TD_SELECTED;
- if (ebo->flag & BONE_EDITMODE_LOCKED)
- td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE;
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
-
- td++;
- }
- if (ebo->flag & BONE_ROOTSEL){
- VECCOPY (td->iloc, ebo->head);
- VECCOPY (td->center, td->iloc);
- td->loc= ebo->head;
- td->flag= TD_SELECTED;
- if (ebo->flag & BONE_EDITMODE_LOCKED)
- td->protectflag = OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE;
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
-
- td++;
- }
- }
- }
- }
-}
-
-/* ********************* meta elements ********* */
-
-static void createTransMBallVerts(TransInfo *t)
-{
- MetaElem *ml;
- TransData *td;
- TransDataExtension *tx;
- float mtx[3][3], smtx[3][3];
- int count=0, countsel=0;
- int propmode = t->flag & T_PROP_EDIT;
-
- /* count totals */
- for(ml= editelems.first; ml; ml= ml->next) {
- if(ml->flag & SELECT) countsel++;
- if(propmode) count++;
- }
-
- /* note: in prop mode we need at least 1 selected */
- if (countsel==0) return;
-
- if(propmode) t->total = count;
- else t->total = countsel;
-
- td = t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)");
- tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "MetaElement_TransExtension");
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- for(ml= editelems.first; ml; ml= ml->next) {
- if(propmode || (ml->flag & SELECT)) {
- td->loc= &ml->x;
- VECCOPY(td->iloc, td->loc);
- VECCOPY(td->center, td->loc);
-
- if(ml->flag & SELECT) td->flag= TD_SELECTED | TD_USEQUAT | TD_SINGLESIZE;
- else td->flag= TD_USEQUAT;
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->ext = tx;
- td->tdi = NULL;
-
- /* Radius of MetaElem (mass of MetaElem influence) */
- if(ml->flag & MB_SCALE_RAD){
- td->val = &ml->rad;
- td->ival = ml->rad;
- }
- else{
- td->val = &ml->s;
- td->ival = ml->s;
- }
-
- /* expx/expy/expz determine "shape" of some MetaElem types */
- tx->size = &ml->expx;
- tx->isize[0] = ml->expx;
- tx->isize[1] = ml->expy;
- tx->isize[2] = ml->expz;
-
- /* quat is used for rotation of MetaElem */
- tx->quat = ml->quat;
- QUATCOPY(tx->iquat, ml->quat);
-
- tx->rot = NULL;
-
- td++;
- tx++;
- }
- }
-}
-
-/* ********************* curve/surface ********* */
-
-static void calc_distanceCurveVerts(TransData *head, TransData *tail) {
- TransData *td, *td_near = NULL;
- for (td = head; td<=tail; td++) {
- if (td->flag & TD_SELECTED) {
- td_near = td;
- td->dist = 0.0f;
- }
- else if(td_near) {
- float dist;
- dist = VecLenf(td_near->center, td->center);
- if (dist < (td-1)->dist) {
- td->dist = (td-1)->dist;
- }
- else {
- td->dist = dist;
- }
- }
- else {
- td->dist = MAXFLOAT;
- td->flag |= TD_NOTCONNECTED;
- }
- }
- td_near = NULL;
- for (td = tail; td>=head; td--) {
- if (td->flag & TD_SELECTED) {
- td_near = td;
- td->dist = 0.0f;
- }
- else if(td_near) {
- float dist;
- dist = VecLenf(td_near->center, td->center);
- if (td->flag & TD_NOTCONNECTED || dist < td->dist || (td+1)->dist < td->dist) {
- td->flag &= ~TD_NOTCONNECTED;
- if (dist < (td+1)->dist) {
- td->dist = (td+1)->dist;
- }
- else {
- td->dist = dist;
- }
- }
- }
- }
-}
-
-/* Utility function for getting the handle data from bezier's */
-TransDataCurveHandleFlags *initTransDataCurveHandes(TransData *td, struct BezTriple *bezt) {
- TransDataCurveHandleFlags *hdata;
- td->flag |= TD_BEZTRIPLE;
- hdata = td->hdata = MEM_mallocN(sizeof(TransDataCurveHandleFlags), "CuHandle Data");
- hdata->ih1 = bezt->h1;
- hdata->h1 = &bezt->h1;
- hdata->ih2 = bezt->h2; /* incase the second is not selected */
- hdata->h2 = &bezt->h2;
- return hdata;
-}
-
-static void createTransCurveVerts(TransInfo *t)
-{
- TransData *td = NULL;
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
- float mtx[3][3], smtx[3][3];
- int a;
- int count=0, countsel=0;
- int propmode = t->flag & T_PROP_EDIT;
-
- /* count total of vertices, check identical as in 2nd loop for making transdata! */
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
- if(bezt->hide==0) {
- if (G.f & G_HIDDENHANDLES) {
- if(bezt->f2 & SELECT) countsel+=3;
- if(propmode) count+= 3;
- } else {
- if(bezt->f1 & SELECT) countsel++;
- if(bezt->f2 & SELECT) countsel++;
- if(bezt->f3 & SELECT) countsel++;
- if(propmode) count+= 3;
- }
- }
- }
- }
- else {
- for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
- if(bp->hide==0) {
- if(propmode) count++;
- if(bp->f1 & SELECT) countsel++;
- }
- }
- }
- }
- /* note: in prop mode we need at least 1 selected */
- if (countsel==0) return;
-
- if(propmode) t->total = count;
- else t->total = countsel;
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)");
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- td = t->data;
- for(nu= editNurb.first; nu; nu= nu->next) {
- if((nu->type & 7)==CU_BEZIER) {
- TransData *head, *tail;
- head = tail = td;
- for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {
- if(bezt->hide==0) {
- TransDataCurveHandleFlags *hdata = NULL;
-
- if( propmode ||
- ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) ||
- ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)==0)
- ) {
- VECCOPY(td->iloc, bezt->vec[0]);
- td->loc= bezt->vec[0];
- VECCOPY(td->center, bezt->vec[1]);
- if (G.f & G_HIDDENHANDLES) {
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- } else {
- if(bezt->f1 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- }
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
-
- hdata = initTransDataCurveHandes(td, bezt);
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td++;
- count++;
- tail++;
- }
-
- /* This is the Curve Point, the other two are handles */
- if(propmode || (bezt->f2 & SELECT)) {
- VECCOPY(td->iloc, bezt->vec[1]);
- td->loc= bezt->vec[1];
- VECCOPY(td->center, td->loc);
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- td->ext = NULL;
- td->tdi = NULL;
-
- if (t->mode==TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */
- td->val = &(bezt->radius);
- td->ival = bezt->radius;
- } else if (t->mode==TFM_TILT) {
- td->val = &(bezt->alfa);
- td->ival = bezt->alfa;
- } else {
- td->val = NULL;
- }
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- if ((bezt->f1&SELECT)==0 && (bezt->f3&SELECT)==0)
- /* If the middle is selected but the sides arnt, this is needed */
- if (hdata==NULL) { /* if the handle was not saved by the previous handle */
- hdata = initTransDataCurveHandes(td, bezt);
- }
-
- td++;
- count++;
- tail++;
- }
- if( propmode ||
- ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) ||
- ((bezt->f3 & SELECT) && (G.f & G_HIDDENHANDLES)==0)
- ) {
- VECCOPY(td->iloc, bezt->vec[2]);
- td->loc= bezt->vec[2];
- VECCOPY(td->center, bezt->vec[1]);
- if (G.f & G_HIDDENHANDLES) {
- if(bezt->f2 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- } else {
- if(bezt->f3 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- }
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
-
- if (hdata==NULL) { /* if the handle was not saved by the previous handle */
- hdata = initTransDataCurveHandes(td, bezt);
- }
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td++;
- count++;
- tail++;
- }
- }
- else if (propmode && head != tail) {
- calc_distanceCurveVerts(head, tail-1);
- head = tail;
- }
- }
- if (propmode && head != tail)
- calc_distanceCurveVerts(head, tail-1);
-
- /* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandes
- * but for now just dont change handle types */
- if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0)
- testhandlesNurb(nu); /* sets the handles based on their selection, do this after the data is copied to the TransData */
- }
- else {
- TransData *head, *tail;
- head = tail = td;
- for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) {
- if(bp->hide==0) {
- if(propmode || (bp->f1 & SELECT)) {
- VECCOPY(td->iloc, bp->vec);
- td->loc= bp->vec;
- VECCOPY(td->center, td->loc);
- if(bp->f1 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- td->ext = NULL;
- td->tdi = NULL;
-
- if (t->mode==TFM_CURVE_SHRINKFATTEN || t->mode==TFM_RESIZE) {
- td->val = &(bp->radius);
- td->ival = bp->radius;
- } else {
- td->val = &(bp->alfa);
- td->ival = bp->alfa;
- }
-
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td++;
- count++;
- tail++;
- }
- }
- else if (propmode && head != tail) {
- calc_distanceCurveVerts(head, tail-1);
- head = tail;
- }
- }
- if (propmode && head != tail)
- calc_distanceCurveVerts(head, tail-1);
- }
- }
-}
-
-/* ********************* lattice *************** */
-
-static void createTransLatticeVerts(TransInfo *t)
-{
- TransData *td = NULL;
- BPoint *bp;
- float mtx[3][3], smtx[3][3];
- int a;
- int count=0, countsel=0;
- int propmode = t->flag & T_PROP_EDIT;
-
- bp= editLatt->def;
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- while(a--) {
- if(bp->hide==0) {
- if(bp->f1 & SELECT) countsel++;
- if(propmode) count++;
- }
- bp++;
- }
-
- /* note: in prop mode we need at least 1 selected */
- if (countsel==0) return;
-
- if(propmode) t->total = count;
- else t->total = countsel;
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)");
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- td = t->data;
- bp= editLatt->def;
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- while(a--) {
- if(propmode || (bp->f1 & SELECT)) {
- if(bp->hide==0) {
- VECCOPY(td->iloc, bp->vec);
- td->loc= bp->vec;
- VECCOPY(td->center, td->loc);
- if(bp->f1 & SELECT) td->flag= TD_SELECTED;
- else td->flag= 0;
- Mat3CpyMat3(td->smtx, smtx);
- Mat3CpyMat3(td->mtx, mtx);
-
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
-
- td++;
- count++;
- }
- }
- bp++;
- }
-}
-
-/* ******************* particle edit **************** */
-static void createTransParticleVerts(TransInfo *t)
-{
- TransData *td = NULL;
- TransDataExtension *tx;
- Base *base = BASACT;
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleSystemModifierData *psmd = NULL;
- ParticleEditSettings *pset = PE_settings();
- ParticleData *pa = NULL;
- ParticleEdit *edit;
- ParticleEditKey *key;
- float mat[4][4];
- int i,k, totpart, transformparticle;
- int count = 0, hasselected = 0;
- int propmode = t->flag & T_PROP_EDIT;
-
- if(psys==NULL || G.scene->selectmode==SCE_SELECT_PATH) return;
-
- psmd = psys_get_modifier(ob,psys);
-
- edit = psys->edit;
- totpart = psys->totpart;
- base->flag |= BA_HAS_RECALC_DATA;
-
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
- pa->flag &= ~PARS_TRANSFORM;
- transformparticle= 0;
-
- if((pa->flag & PARS_HIDE)==0) {
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++) {
- if((key->flag&PEK_HIDE)==0) {
- if(key->flag&PEK_SELECT) {
- hasselected= 1;
- transformparticle= 1;
- }
- else if(propmode)
- transformparticle= 1;
- }
- }
- }
-
- if(transformparticle) {
- count += pa->totkey;
- pa->flag |= PARS_TRANSFORM;
- }
- }
-
- /* note: in prop mode we need at least 1 selected */
- if (hasselected==0) return;
-
- t->total = count;
- td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Particle Mode)");
-
- if(t->mode == TFM_BAKE_TIME)
- tx = t->ext = MEM_callocN(t->total * sizeof(TransDataExtension), "Particle_TransExtension");
- else
- tx = t->ext = NULL;
-
- Mat4One(mat);
-
- Mat4Invert(ob->imat,ob->obmat);
-
- for(i=0, pa=psys->particles; i<totpart; i++, pa++) {
- TransData *head, *tail;
- head = tail = td;
-
- if(!(pa->flag & PARS_TRANSFORM)) continue;
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
-
- for(k=0, key=edit->keys[i]; k<pa->totkey; k++, key++) {
- VECCOPY(key->world_co, key->co);
- Mat4MulVecfl(mat, key->world_co);
- td->loc = key->world_co;
-
- VECCOPY(td->iloc, td->loc);
- VECCOPY(td->center, td->loc);
-
- if(key->flag & PEK_SELECT)
- td->flag |= TD_SELECTED;
- else if(!propmode)
- td->flag |= TD_SKIP;
-
- Mat3One(td->mtx);
- Mat3One(td->smtx);
-
- /* don't allow moving roots */
- if(k==0 && pset->flag & PE_LOCK_FIRST)
- td->protectflag |= OB_LOCK_LOC;
-
- td->ob = ob;
- td->ext = tx;
- td->tdi = NULL;
- if(t->mode == TFM_BAKE_TIME) {
- td->val = key->time;
- td->ival = *(key->time);
- /* abuse size and quat for min/max values */
- td->flag |= TD_NO_EXT;
- if(k==0) tx->size = 0;
- else tx->size = (key - 1)->time;
-
- if(k == pa->totkey - 1) tx->quat = 0;
- else tx->quat = (key + 1)->time;
- }
-
- td++;
- if(tx)
- tx++;
- tail++;
- }
- if (propmode && head != tail)
- calc_distanceCurveVerts(head, tail - 1);
- }
-}
-
-void flushTransParticles(TransInfo *t)
-{
- Object *ob = OBACT;
- ParticleSystem *psys = PE_get_current(ob);
- ParticleSystemModifierData *psmd;
- ParticleData *pa;
- ParticleEditKey *key;
- TransData *td;
- float mat[4][4], imat[4][4], co[3];
- int i, k, propmode = t->flag & T_PROP_EDIT;
-
- psmd = psys_get_modifier(ob, psys);
-
- /* we do transform in world space, so flush world space position
- * back to particle local space */
- td= t->data;
- for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++, td++) {
- if(!(pa->flag & PARS_TRANSFORM)) continue;
-
- psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat);
- Mat4Invert(imat,mat);
-
- for(k=0, key=psys->edit->keys[i]; k<pa->totkey; k++, key++) {
- VECCOPY(co, key->world_co);
- Mat4MulVecfl(imat, co);
-
- /* optimization for proportional edit */
- if(!propmode || !FloatCompare(key->co, co, 0.0001f)) {
- VECCOPY(key->co, co);
- pa->flag |= PARS_EDIT_RECALC;
- }
- }
- }
-
- PE_update_object(OBACT, 1);
-}
-
-/* ********************* mesh ****************** */
-
-/* proportional distance based on connectivity */
-#define E_VEC(a) (vectors + (3 * (a)->tmp.l))
-#define E_NEAR(a) (nears[((a)->tmp.l)])
-#define THRESHOLD 0.0001f
-static void editmesh_set_connectivity_distance(int total, float *vectors, EditVert **nears)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditEdge *eed;
- int i= 0, done= 1;
-
- /* f2 flag is used for 'selection' */
- /* tmp.l is offset on scratch array */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0) {
- eve->tmp.l = i++;
-
- if(eve->f & SELECT) {
- eve->f2= 2;
- E_NEAR(eve) = eve;
- E_VEC(eve)[0] = 0.0f;
- E_VEC(eve)[1] = 0.0f;
- E_VEC(eve)[2] = 0.0f;
- }
- else {
- eve->f2 = 0;
- }
- }
- }
-
-
- /* Floodfill routine */
- /*
- At worst this is n*n of complexity where n is number of edges
- Best case would be n if the list is ordered perfectly.
- Estimate is n log n in average (so not too bad)
- */
- while(done) {
- done= 0;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0) {
- EditVert *v1= eed->v1, *v2= eed->v2;
- float *vec2 = E_VEC(v2);
- float *vec1 = E_VEC(v1);
-
- if (v1->f2 + v2->f2 == 4)
- continue;
-
- if (v1->f2) {
- if (v2->f2) {
- float nvec[3];
- float len1 = VecLength(vec1);
- float len2 = VecLength(vec2);
- float lenn;
- /* for v2 if not selected */
- if (v2->f2 != 2) {
- VecSubf(nvec, v2->co, E_NEAR(v1)->co);
- lenn = VecLength(nvec);
- /* 1 < n < 2 */
- if (lenn - len1 > THRESHOLD && len2 - lenn > THRESHOLD) {
- VECCOPY(vec2, nvec);
- E_NEAR(v2) = E_NEAR(v1);
- done = 1;
- }
- /* n < 1 < 2 */
- else if (len2 - len1 > THRESHOLD && len1 - lenn > THRESHOLD) {
- VECCOPY(vec2, vec1);
- E_NEAR(v2) = E_NEAR(v1);
- done = 1;
- }
- }
- /* for v1 if not selected */
- if (v1->f2 != 2) {
- VecSubf(nvec, v1->co, E_NEAR(v2)->co);
- lenn = VecLength(nvec);
- /* 2 < n < 1 */
- if (lenn - len2 > THRESHOLD && len1 - lenn > THRESHOLD) {
- VECCOPY(vec1, nvec);
- E_NEAR(v1) = E_NEAR(v2);
- done = 1;
- }
- /* n < 2 < 1 */
- else if (len1 - len2 > THRESHOLD && len2 - lenn > THRESHOLD) {
- VECCOPY(vec1, vec2);
- E_NEAR(v1) = E_NEAR(v2);
- done = 1;
- }
- }
- }
- else {
- v2->f2 = 1;
- VecSubf(vec2, v2->co, E_NEAR(v1)->co);
- /* 2 < 1 */
- if (VecLength(vec1) - VecLength(vec2) > THRESHOLD) {
- VECCOPY(vec2, vec1);
- }
- E_NEAR(v2) = E_NEAR(v1);
- done = 1;
- }
- }
- else if (v2->f2) {
- v1->f2 = 1;
- VecSubf(vec1, v1->co, E_NEAR(v2)->co);
- /* 2 < 1 */
- if (VecLength(vec2) - VecLength(vec1) > THRESHOLD) {
- VECCOPY(vec1, vec2);
- }
- E_NEAR(v1) = E_NEAR(v2);
- done = 1;
- }
- }
- }
- }
-}
-
-/* loop-in-a-loop I know, but we need it! (ton) */
-static void get_face_center(float *cent, EditVert *eve)
-{
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- for(efa= em->faces.first; efa; efa= efa->next)
- if(efa->f & SELECT)
- if(efa->v1==eve || efa->v2==eve || efa->v3==eve || efa->v4==eve)
- break;
- if(efa) {
- VECCOPY(cent, efa->cent);
- }
-}
-
-//way to overwrite what data is edited with transform
-//static void VertsToTransData(TransData *td, EditVert *eve, BakeKey *key)
-static void VertsToTransData(TransData *td, EditVert *eve)
-{
- td->flag = 0;
- //if(key)
- // td->loc = key->co;
- //else
- td->loc = eve->co;
-
- VECCOPY(td->center, td->loc);
- if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE))
- get_face_center(td->center, eve);
- VECCOPY(td->iloc, td->loc);
-
- // Setting normals
- VECCOPY(td->axismtx[2], eve->no);
- td->axismtx[0][0] =
- td->axismtx[0][1] =
- td->axismtx[0][2] =
- td->axismtx[1][0] =
- td->axismtx[1][1] =
- td->axismtx[1][2] = 0.0f;
-
- td->ext = NULL;
- td->tdi = NULL;
- td->val = NULL;
- td->tdmir = NULL;
- if (BIF_GetTransInfo()->mode == TFM_BWEIGHT) {
- td->val = &(eve->bweight);
- td->ival = eve->bweight;
- }
-
-#ifdef WITH_VERSE
- if(eve->vvert) {
- td->verse = (void*)eve->vvert;
- td->flag |= TD_VERSE_VERT;
- }
- else
- td->flag &= ~TD_VERSE_VERT;
-#endif
-}
-
-/* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */
-
-static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
-{
- float *vec = userData;
-
- vec+= 3*index;
- VECCOPY(vec, co);
-}
-
-static int modifiers_disable_subsurf_temporary(Object *ob)
-{
- ModifierData *md;
- int disabled = 0;
-
- for(md=ob->modifiers.first; md; md=md->next)
- if(md->type==eModifierType_Subsurf)
- if(md->mode & eModifierMode_OnCage) {
- md->mode ^= eModifierMode_DisableTemporary;
- disabled= 1;
- }
-
- return disabled;
-}
-
-/* disable subsurf temporal, get mapped cos, and enable it */
-static float *get_crazy_mapped_editverts(void)
-{
- DerivedMesh *dm;
- float *vertexcos;
-
- /* disable subsurf temporal, get mapped cos, and enable it */
- if(modifiers_disable_subsurf_temporary(G.obedit)) {
- /* need to make new derivemesh */
- makeDerivedMesh(G.obedit, CD_MASK_BAREMESH);
- }
-
- /* now get the cage */
- dm= editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- vertexcos= MEM_mallocN(3*sizeof(float)*G.totvert, "vertexcos map");
- dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos);
-
- dm->release(dm);
-
- /* set back the flag, no new cage needs to be built, transform does it */
- modifiers_disable_subsurf_temporary(G.obedit);
-
- return vertexcos;
-}
-
-#define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2])
-static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3)
-{
- float vecu[3], vecv[3];
- float q1[4], q2[4];
-
- TAN_MAKE_VEC(vecu, v1, v2);
- TAN_MAKE_VEC(vecv, v1, v3);
- triatoquat(v1, vecu, vecv, q1);
-
- TAN_MAKE_VEC(vecu, def1, def2);
- TAN_MAKE_VEC(vecv, def1, def3);
- triatoquat(def1, vecu, vecv, q2);
-
- QuatSub(quat, q2, q1);
-}
-#undef TAN_MAKE_VEC
-
-static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
-{
- EditMesh *em = G.editMesh;
- EditVert *eve, *prev;
- EditFace *efa;
- float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4;
- intptr_t index= 0;
-
- /* two abused locations in vertices */
- for(eve= em->verts.first; eve; eve= eve->next, index++) {
- eve->tmp.p = NULL;
- eve->prev= (EditVert *)index;
- }
-
- /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */
- for(efa= em->faces.first; efa; efa= efa->next) {
-
- /* retrieve mapped coordinates */
- v1= mappedcos + 3*(intptr_t)(efa->v1->prev);
- v2= mappedcos + 3*(intptr_t)(efa->v2->prev);
- v3= mappedcos + 3*(intptr_t)(efa->v3->prev);
-
- co1= (origcos)? origcos + 3*(intptr_t)(efa->v1->prev): efa->v1->co;
- co2= (origcos)? origcos + 3*(intptr_t)(efa->v2->prev): efa->v2->co;
- co3= (origcos)? origcos + 3*(intptr_t)(efa->v3->prev): efa->v3->co;
-
- if(efa->v2->tmp.p==NULL && efa->v2->f1) {
- set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1);
- efa->v2->tmp.p= (void*)quats;
- quats+= 4;
- }
-
- if(efa->v4) {
- v4= mappedcos + 3*(intptr_t)(efa->v4->prev);
- co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co;
-
- if(efa->v1->tmp.p==NULL && efa->v1->f1) {
- set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4);
- efa->v1->tmp.p= (void*)quats;
- quats+= 4;
- }
- if(efa->v3->tmp.p==NULL && efa->v3->f1) {
- set_crazy_vertex_quat(quats, co3, co4, co2, v3, v4, v2);
- efa->v3->tmp.p= (void*)quats;
- quats+= 4;
- }
- if(efa->v4->tmp.p==NULL && efa->v4->f1) {
- set_crazy_vertex_quat(quats, co4, co1, co3, v4, v1, v3);
- efa->v4->tmp.p= (void*)quats;
- quats+= 4;
- }
- }
- else {
- if(efa->v1->tmp.p==NULL && efa->v1->f1) {
- set_crazy_vertex_quat(quats, co1, co2, co3, v1, v2, v3);
- efa->v1->tmp.p= (void*)quats;
- quats+= 4;
- }
- if(efa->v3->tmp.p==NULL && efa->v3->f1) {
- set_crazy_vertex_quat(quats, co3, co1, co2, v3, v1, v2);
- efa->v3->tmp.p= (void*)quats;
- quats+= 4;
- }
- }
- }
-
- /* restore abused prev pointer */
- for(prev= NULL, eve= em->verts.first; eve; prev= eve, eve= eve->next)
- eve->prev= prev;
-
-}
-
-void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head *td) {
- BME_Vert *v;
- BME_TransData *vtd;
- TransData *tob;
- int i;
-
- tob = t->data = MEM_callocN(td->len*sizeof(TransData), "TransObData(Bevel tool)");
-
- for (i=0,v=bm->verts.first;v;v=v->next) {
- if ( (vtd = BME_get_transdata(td,v)) ) {
- tob->loc = vtd->loc;
- tob->val = &vtd->factor;
- VECCOPY(tob->iloc,vtd->co);
- VECCOPY(tob->center,vtd->org);
- VECCOPY(tob->axismtx[0],vtd->vec);
- tob->axismtx[1][0] = vtd->max ? *vtd->max : 0;
- tob++;
- i++;
- }
- }
- /* since td is a memarena, it can hold more transdata than actual elements
- * (i.e. we can't depend on td->len to determine the number of actual elements) */
- t->total = i;
-}
-
-static void createTransEditVerts(TransInfo *t)
-{
- TransData *tob = NULL;
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditVert **nears = NULL;
- EditVert *eve_act = NULL;
- float *vectors = NULL, *mappedcos = NULL, *quats= NULL;
- float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL;
- int count=0, countsel=0, a, totleft;
- int propmode = t->flag & T_PROP_EDIT;
- int mirror = 0;
-
- if ((t->context & CTX_NO_MIRROR) == 0 && (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR))
- {
- mirror = 1;
- }
-
- // transform now requires awareness for select mode, so we tag the f1 flags in verts
- if(G.scene->selectmode & SCE_SELECT_VERTEX) {
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0 && (eve->f & SELECT))
- eve->f1= SELECT;
- else
- eve->f1= 0;
- }
- }
- else if(G.scene->selectmode & SCE_SELECT_EDGE) {
- EditEdge *eed;
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->h==0 && (eed->f & SELECT))
- eed->v1->f1= eed->v2->f1= SELECT;
- }
- }
- else {
- EditFace *efa;
- for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
- for(efa= em->faces.first; efa; efa= efa->next) {
- if(efa->h==0 && (efa->f & SELECT)) {
- efa->v1->f1= efa->v2->f1= efa->v3->f1= SELECT;
- if(efa->v4) efa->v4->f1= SELECT;
- }
- }
- }
-
- /* now we can count */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->h==0) {
- if(eve->f1) countsel++;
- if(propmode) count++;
- }
- }
-
- /* note: in prop mode we need at least 1 selected */
- if (countsel==0) return;
-
- /* check active */
- if (G.editMesh->selected.last) {
- EditSelection *ese = G.editMesh->selected.last;
- if ( ese->type == EDITVERT ) {
- eve_act = (EditVert *)ese->data;
- }
- }
-
-
- if(propmode) {
- t->total = count;
-
- /* allocating scratch arrays */
- vectors = (float *)MEM_mallocN(t->total * 3 * sizeof(float), "scratch vectors");
- nears = (EditVert**)MEM_mallocN(t->total * sizeof(EditVert*), "scratch nears");
- }
- else t->total = countsel;
- tob= t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Mesh EditMode)");
-
- Mat3CpyMat4(mtx, G.obedit->obmat);
- Mat3Inv(smtx, mtx);
-
- if(propmode) editmesh_set_connectivity_distance(t->total, vectors, nears);
-
- /* detect CrazySpace [tm] */
- if(propmode==0) {
- if(modifiers_getCageIndex(G.obedit, NULL)>=0) {
- if(modifiers_isDeformed(G.obedit)) {
- /* check if we can use deform matrices for modifier from the
- start up to stack, they are more accurate than quats */
- totleft= editmesh_get_first_deform_matrices(&defmats, &defcos);
-
- /* if we still have more modifiers, also do crazyspace
- correction with quats, relative to the coordinates after
- the modifiers that support deform matrices (defcos) */
- if(totleft > 0) {
- mappedcos= get_crazy_mapped_editverts();
- quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
- set_crazyspace_quats((float*)defcos, mappedcos, quats);
- if(mappedcos)
- MEM_freeN(mappedcos);
- }
-
- if(defcos)
- MEM_freeN(defcos);
- }
- }
- }
-
- /* find out which half we do */
- if(mirror) {
- for (eve=em->verts.first; eve; eve=eve->next) {
- if(eve->h==0 && eve->f1 && eve->co[0]!=0.0f) {
- if(eve->co[0]<0.0f)
- mirror = -1;
- break;
- }
- }
- }
-
- for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) {
- if(eve->h==0) {
- if(propmode || eve->f1) {
- VertsToTransData(tob, eve);
-
- /* selected */
- if(eve->f1) tob->flag |= TD_SELECTED;
-
- /* active */
- if(eve == eve_act) tob->flag |= TD_ACTIVE;
-
- if(propmode) {
- if (eve->f2) {
- float vec[3];
- VECCOPY(vec, E_VEC(eve));
- Mat3MulVecfl(mtx, vec);
- tob->dist= VecLength(vec);
- }
- else {
- tob->flag |= TD_NOTCONNECTED;
- tob->dist = MAXFLOAT;
- }
- }
-
- /* CrazySpace */
- if(defmats || (quats && eve->tmp.p)) {
- float mat[3][3], imat[3][3], qmat[3][3];
-
- /* use both or either quat and defmat correction */
- if(quats && eve->tmp.f) {
- QuatToMat3(eve->tmp.p, qmat);
-
- if(defmats)
- Mat3MulSerie(mat, mtx, qmat, defmats[a],
- NULL, NULL, NULL, NULL, NULL);
- else
- Mat3MulMat3(mat, mtx, qmat);
- }
- else
- Mat3MulMat3(mat, mtx, defmats[a]);
-
- Mat3Inv(imat, mat);
-
- Mat3CpyMat3(tob->smtx, imat);
- Mat3CpyMat3(tob->mtx, mat);
- }
- else {
- Mat3CpyMat3(tob->smtx, smtx);
- Mat3CpyMat3(tob->mtx, mtx);
- }
-
- /* Mirror? */
- if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) {
- EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, tob->iloc); /* initializes octree on first call */
- if(vmir != eve) tob->tdmir = vmir;
- }
- tob++;
- }
- }
- }
- if (propmode) {
- MEM_freeN(vectors);
- MEM_freeN(nears);
- }
- /* crazy space free */
- if(quats)
- MEM_freeN(quats);
- if(defmats)
- MEM_freeN(defmats);
-}
-
-/* ********************* UV ****************** */
-
-static void UVsToTransData(TransData *td, TransData2D *td2d, float *uv, int selected)
-{
- float aspx, aspy;
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
-
- /* uv coords are scaled by aspects. this is needed for rotations and
- proportional editing to be consistent with the stretchted uv coords
- that are displayed. this also means that for display and numinput,
- and when the the uv coords are flushed, these are converted each time */
- td2d->loc[0] = uv[0]*aspx;
- td2d->loc[1] = uv[1]*aspy;
- td2d->loc[2] = 0.0f;
- td2d->loc2d = uv;
-
- td->flag = 0;
- td->loc = td2d->loc;
- VECCOPY(td->center, td->loc);
- VECCOPY(td->iloc, td->loc);
-
- memset(td->axismtx, 0, sizeof(td->axismtx));
- td->axismtx[2][2] = 1.0f;
-
- td->ext= NULL; td->tdi= NULL; td->val= NULL;
-
- if(selected) {
- td->flag |= TD_SELECTED;
- td->dist= 0.0;
- }
- else {
- td->dist= MAXFLOAT;
- }
- Mat3One(td->mtx);
- Mat3One(td->smtx);
-}
-
-static void createTransUVs(TransInfo *t)
-{
- TransData *td = NULL;
- TransData2D *td2d = NULL;
- MTFace *tf;
- int count=0, countsel=0;
- int propmode = t->flag & T_PROP_EDIT;
- int efa_s1,efa_s2,efa_s3,efa_s4;
-
- EditMesh *em = G.editMesh;
- EditFace *efa;
-
- if(is_uv_tface_editing_allowed()==0) return;
-
- /* count */
- if (G.sima->flag & SI_BE_SQUARE && !propmode) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- /* store face pointer for second loop, prevent second lookup */
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- efa->tmp.p = tf;
-
- efa_s1 = simaUVSel_Check(efa, tf, 0);
- efa_s2 = simaUVSel_Check(efa, tf, 1);
- efa_s3 = simaUVSel_Check(efa, tf, 2);
- if (efa->v4) {
- efa_s4 = simaUVSel_Check(efa, tf, 3);
- if ( efa_s1 || efa_s2 || efa_s3 || efa_s4 ) {
- countsel += 4; /* all corners of this quad need their edges moved. so we must store TD for each */
- }
- } else {
- /* tri's are delt with normally when SI_BE_SQUARE's enabled */
- if (efa_s1) countsel++;
- if (efa_s2) countsel++;
- if (efa_s3) countsel++;
- }
- } else {
- efa->tmp.p = NULL;
- }
- }
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {
- efa->tmp.p = tf;
-
- if (simaUVSel_Check(efa, tf, 0)) countsel++;
- if (simaUVSel_Check(efa, tf, 1)) countsel++;
- if (simaUVSel_Check(efa, tf, 2)) countsel++;
- if (efa->v4 && simaUVSel_Check(efa, tf, 3)) countsel++;
- if(propmode)
- count += (efa->v4)? 4: 3;
- } else {
- efa->tmp.p = NULL;
- }
- }
- }
-
- /* note: in prop mode we need at least 1 selected */
- if (countsel==0) return;
-
- t->total= (propmode)? count: countsel;
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(UV Editing)");
- /* for each 2d uv coord a 3d vector is allocated, so that they can be
- treated just as if they were 3d verts */
- t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransObData2D(UV Editing)");
-
- if(G.sima->flag & SI_CLIP_UV)
- t->flag |= T_CLIP_UV;
-
- td= t->data;
- td2d= t->data2d;
-
- if (G.sima->flag & SI_BE_SQUARE && !propmode) {
- for (efa= em->faces.first; efa; efa= efa->next) {
- tf=(MTFace *)efa->tmp.p;
- if (tf) {
- efa_s1 = simaUVSel_Check(efa, tf, 0);
- efa_s2 = simaUVSel_Check(efa, tf, 1);
- efa_s3 = simaUVSel_Check(efa, tf, 2);
-
- if (efa->v4) {
- efa_s4 = simaUVSel_Check(efa, tf, 3);
-
- if ( efa_s1 || efa_s2 || efa_s3 || efa_s4 ) {
- /* all corners of this quad need their edges moved. so we must store TD for each */
-
- UVsToTransData(td, td2d, tf->uv[0], efa_s1);
- if (!efa_s1) td->flag |= TD_SKIP;
- td++; td2d++;
-
- UVsToTransData(td, td2d, tf->uv[1], efa_s2);
- if (!efa_s2) td->flag |= TD_SKIP;
- td++; td2d++;
-
- UVsToTransData(td, td2d, tf->uv[2], efa_s3);
- if (!efa_s3) td->flag |= TD_SKIP;
- td++; td2d++;
-
- UVsToTransData(td, td2d, tf->uv[3], efa_s4);
- if (!efa_s4) td->flag |= TD_SKIP;
- td++; td2d++;
- }
- } else {
- /* tri's are delt with normally when SI_BE_SQUARE's enabled */
- if (efa_s1) UVsToTransData(td++, td2d++, tf->uv[0], 1);
- if (efa_s2) UVsToTransData(td++, td2d++, tf->uv[1], 1);
- if (efa_s3) UVsToTransData(td++, td2d++, tf->uv[2], 1);
- }
- }
- }
- } else {
- for (efa= em->faces.first; efa; efa= efa->next) {
- /*tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- if (simaFaceDraw_Check(efa, tf)) {*/
- if ((tf=(MTFace *)efa->tmp.p)) {
- if (propmode) {
- UVsToTransData(td++, td2d++, tf->uv[0], simaUVSel_Check(efa, tf, 0));
- UVsToTransData(td++, td2d++, tf->uv[1], simaUVSel_Check(efa, tf, 1));
- UVsToTransData(td++, td2d++, tf->uv[2], simaUVSel_Check(efa, tf, 2));
- if(efa->v4)
- UVsToTransData(td++, td2d++, tf->uv[3], simaUVSel_Check(efa, tf, 3));
- } else {
- if(simaUVSel_Check(efa, tf, 0)) UVsToTransData(td++, td2d++, tf->uv[0], 1);
- if(simaUVSel_Check(efa, tf, 1)) UVsToTransData(td++, td2d++, tf->uv[1], 1);
- if(simaUVSel_Check(efa, tf, 2)) UVsToTransData(td++, td2d++, tf->uv[2], 1);
- if(efa->v4 && simaUVSel_Check(efa, tf, 3)) UVsToTransData(td++, td2d++, tf->uv[3], 1);
- }
- }
- }
- }
-
- if (G.sima->flag & SI_LIVE_UNWRAP)
- unwrap_lscm_live_begin();
-}
-
-void flushTransUVs(TransInfo *t)
-{
- TransData2D *td;
- int a, width, height;
- Object *ob= OBACT;
- EditMesh *em = G.editMesh;
- float aspx, aspy, invx, invy;
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- transform_width_height_tface_uv(&width, &height);
- invx= 1.0f/aspx;
- invy= 1.0f/aspy;
-
- /* flush to 2d vector from internally used 3d vector */
- for(a=0, td= t->data2d; a<t->total; a++, td++) {
- td->loc2d[0]= td->loc[0]*invx;
- td->loc2d[1]= td->loc[1]*invy;
-
- if((G.sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) {
- td->loc2d[0]= (float)floor(width*td->loc2d[0] + 0.5f)/width;
- td->loc2d[1]= (float)floor(height*td->loc2d[1] + 0.5f)/height;
- }
- }
-
- if((G.sima->flag & SI_BE_SQUARE) && (t->flag & T_PROP_EDIT)==0 && (t->state != TRANS_CANCEL))
- be_square_tface_uv(em);
-
- /* this is overkill if G.sima->lock is not set, but still needed */
- object_uvs_changed(ob);
-}
-
-int clipUVTransform(TransInfo *t, float *vec, int resize)
-{
- TransData *td;
- int a, clipx=1, clipy=1;
- float aspx, aspy, min[2], max[2];
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- min[0]= min[1]= 0.0f;
- max[0]= aspx; max[1]= aspy;
-
- for(a=0, td= t->data; a<t->total; a++, td++) {
- DO_MINMAX2(td->loc, min, max);
- }
-
- if(resize) {
- if(min[0] < 0.0f && t->center[0] > 0.0f && t->center[0] < aspx*0.5f)
- vec[0] *= t->center[0]/(t->center[0] - min[0]);
- else if(max[0] > aspx && t->center[0] < aspx)
- vec[0] *= (t->center[0] - aspx)/(t->center[0] - max[0]);
- else
- clipx= 0;
-
- if(min[1] < 0.0f && t->center[1] > 0.0f && t->center[1] < aspy*0.5f)
- vec[1] *= t->center[1]/(t->center[1] - min[1]);
- else if(max[1] > aspy && t->center[1] < aspy)
- vec[1] *= (t->center[1] - aspy)/(t->center[1] - max[1]);
- else
- clipy= 0;
- }
- else {
- if(min[0] < 0.0f)
- vec[0] -= min[0];
- else if(max[0] > aspx)
- vec[0] -= max[0]-aspx;
- else
- clipx= 0;
-
- if(min[1] < 0.0f)
- vec[1] -= min[1];
- else if(max[1] > aspy)
- vec[1] -= max[1]-aspy;
- else
- clipy= 0;
- }
-
- return (clipx || clipy);
-}
-
-/* ********************* IPO EDITOR ************************* */
-
-/* for IPO Editor transform - but actual creation of transform structures is not performed here
- * due to bad globals that would need to be imported specially for this
- */
-static void createTransIpoData(TransInfo *t)
-{
- /* in editipo.c due to some globals that are defined in that file... */
- make_ipo_transdata(t);
-}
-
-/* this function is called on recalcData to apply the transforms applied
- * to the transdata on to the actual keyframe data
- */
-void flushTransIpoData(TransInfo *t)
-{
- TransData2D *td;
- int a;
-
- /* flush to 2d vector from internally used 3d vector */
- for (a=0, td= t->data2d; a<t->total; a++, td++) {
- /* we need to unapply the nla-scaling from the time in some situations */
- if (NLA_IPO_SCALED)
- td->loc2d[0]= get_action_frame(OBACT, td->loc[0]);
- else
- td->loc2d[0]= td->loc[0];
-
- /* when the icu that point comes from is a bitflag holder, don't allow adjusting values */
- if ((t->data[a].flag & TD_TIMEONLY)==0)
- td->loc2d[1]= td->loc[1];
- }
-}
-
-/* ********************* ACTION/NLA EDITOR ****************** */
-
-/* Called by special_aftertrans_update to make sure selected gp-frames replace
- * any other gp-frames which may reside on that frame (that are not selected).
- * It also makes sure gp-frames are still stored in chronological order after
- * transform.
- */
-static void posttrans_gpd_clean (bGPdata *gpd)
-{
- bGPDlayer *gpl;
-
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- ListBase sel_buffer = {NULL, NULL};
- bGPDframe *gpf, *gpfn;
- bGPDframe *gfs, *gfsn;
-
- /* loop 1: loop through and isolate selected gp-frames to buffer
- * (these need to be sorted as they are isolated)
- */
- for (gpf= gpl->frames.first; gpf; gpf= gpfn) {
- short added= 0;
- gpfn= gpf->next;
-
- if (gpf->flag & GP_FRAME_SELECT) {
- BLI_remlink(&gpl->frames, gpf);
-
- /* find place to add them in buffer
- * - go backwards as most frames will still be in order,
- * so doing it this way will be faster
- */
- for (gfs= sel_buffer.last; gfs; gfs= gfs->prev) {
- /* if current (gpf) occurs after this one in buffer, add! */
- if (gfs->framenum < gpf->framenum) {
- BLI_insertlinkafter(&sel_buffer, gfs, gpf);
- added= 1;
- break;
- }
- }
- if (added == 0)
- BLI_addhead(&sel_buffer, gpf);
- }
- }
-
- /* error checking: it is unlikely, but may be possible to have none selected */
- if (sel_buffer.first == NULL)
- continue;
-
- /* if all were selected (i.e. gpl->frames is empty), then just transfer sel-buf over */
- if (gpl->frames.first == NULL) {
- gpl->frames.first= sel_buffer.first;
- gpl->frames.last= sel_buffer.last;
-
- continue;
- }
-
- /* loop 2: remove duplicates of frames in buffers */
- for (gpf= gpl->frames.first; gpf && sel_buffer.first; gpf= gpfn) {
- gpfn= gpf->next;
-
- /* loop through sel_buffer, emptying stuff from front of buffer if ok */
- for (gfs= sel_buffer.first; gfs && gpf; gfs= gfsn) {
- gfsn= gfs->next;
-
- /* if this buffer frame needs to go before current, add it! */
- if (gfs->framenum < gpf->framenum) {
- /* transfer buffer frame to frames list (before current) */
- BLI_remlink(&sel_buffer, gfs);
- BLI_insertlinkbefore(&gpl->frames, gpf, gfs);
- }
- /* if this buffer frame is on same frame, replace current with it and stop */
- else if (gfs->framenum == gpf->framenum) {
- /* transfer buffer frame to frames list (before current) */
- BLI_remlink(&sel_buffer, gfs);
- BLI_insertlinkbefore(&gpl->frames, gpf, gfs);
-
- /* get rid of current frame */
- gpencil_layer_delframe(gpl, gpf);
- }
- }
- }
-
- /* if anything is still in buffer, append to end */
- for (gfs= sel_buffer.first; gfs; gfs= gfsn) {
- gfsn= gfs->next;
-
- BLI_remlink(&sel_buffer, gfs);
- BLI_addtail(&gpl->frames, gfs);
- }
- }
-}
-
-/* Called by special_aftertrans_update to make sure selected keyframes replace
- * any other keyframes which may reside on that frame (that is not selected).
- */
-static void posttrans_ipo_clean (Ipo *ipo)
-{
- IpoCurve *icu;
- int i;
-
- /* delete any keyframes that occur on same frame as selected keyframe, but is not selected */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- float *selcache; /* cache for frame numbers of selected frames (icu->totvert*sizeof(float)) */
- int len, index; /* number of frames in cache, item index */
-
- /* allocate memory for the cache */
- // TODO: investigate using GHash for this instead?
- if (icu->totvert == 0)
- continue;
- selcache= MEM_callocN(sizeof(float)*icu->totvert, "IcuSelFrameNums");
- len= 0;
- index= 0;
-
- /* We do 2 loops, 1 for marking keyframes for deletion, one for deleting
- * as there is no guarantee what order the keyframes are exactly, even though
- * they have been sorted by time.
- */
-
- /* Loop 1: find selected keyframes */
- for (i = 0; i < icu->totvert; i++) {
- BezTriple *bezt= &icu->bezt[i];
-
- if (BEZSELECTED(bezt)) {
- selcache[index]= bezt->vec[1][0];
- index++;
- len++;
- }
- }
-
- /* Loop 2: delete unselected keyframes on the same frames (if any keyframes were found) */
- if (len) {
- for (i = 0; i < icu->totvert; i++) {
- BezTriple *bezt= &icu->bezt[i];
-
- if (BEZSELECTED(bezt) == 0) {
- /* check beztriple should be removed according to cache */
- for (index= 0; index < len; index++) {
- if (IS_EQ(bezt->vec[1][0], selcache[index])) {
- delete_icu_key(icu, i, 0);
- break;
- }
- else if (bezt->vec[1][0] > selcache[index])
- break;
- }
- }
- }
-
- testhandles_ipocurve(icu);
- }
-
- /* free cache */
- MEM_freeN(selcache);
- }
-}
-
-/* Called by special_aftertrans_update to make sure selected keyframes replace
- * any other keyframes which may reside on that frame (that is not selected).
- * remake_action_ipos should have already been called
- */
-static void posttrans_action_clean (bAction *act)
-{
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- int filter;
-
- /* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, act, ACTCONT_ACTION);
-
- /* loop through relevant data, removing keyframes from the ipo-blocks that were attached
- * - all keyframes are converted in/out of global time
- */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (NLA_ACTION_SCALED) {
- actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1);
- posttrans_ipo_clean(ale->key_data);
- actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1);
- }
- else
- posttrans_ipo_clean(ale->key_data);
- }
-
- /* free temp data */
- BLI_freelistN(&act_data);
-}
-
-/* Called by special_aftertrans_update to make sure selected keyframes replace
- * any other keyframes which may reside on that frame (that is not selected).
- * remake_all_ipos should have already been called
- */
-static void posttrans_nla_clean (TransInfo *t)
-{
- Base *base;
- Object *ob;
- bActionStrip *strip;
- bActionChannel *achan;
- bConstraintChannel *conchan;
- float cfra;
- char side;
- int i;
-
- /* which side of the current frame should be allowed */
- if (t->mode == TFM_TIME_EXTEND) {
- /* only side on which mouse is gets transformed */
- float xmouse, ymouse;
-
- areamouseco_to_ipoco(G.v2d, t->imval, &xmouse, &ymouse);
- side = (xmouse > CFRA) ? 'R' : 'L';
- }
- else {
- /* normal transform - both sides of current frame are considered */
- side = 'B';
- }
-
- /* only affect keyframes */
- for (base=G.scene->base.first; base; base=base->next) {
- ob= base->object;
-
- /* Check object ipos */
- i= count_ipo_keys(ob->ipo, side, (float)CFRA);
- if (i) posttrans_ipo_clean(ob->ipo);
-
- /* Check object constraint ipos */
- for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next) {
- i= count_ipo_keys(conchan->ipo, side, (float)CFRA);
- if (i) posttrans_ipo_clean(conchan->ipo);
- }
-
- /* skip actions and nlastrips if object is collapsed */
- if (ob->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Check action ipos */
- if (ob->action) {
- /* exclude if strip is selected too */
- for (strip=ob->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- if (strip->act == ob->action)
- break;
- }
- }
- if (strip==NULL) {
- cfra = get_action_frame(ob, (float)CFRA);
-
- for (achan=ob->action->chanbase.first; achan; achan=achan->next) {
- if (EDITABLE_ACHAN(achan)) {
- i= count_ipo_keys(achan->ipo, side, cfra);
- if (i) {
- actstrip_map_ipo_keys(ob, achan->ipo, 0, 1);
- posttrans_ipo_clean(achan->ipo);
- actstrip_map_ipo_keys(ob, achan->ipo, 1, 1);
- }
-
- /* Check action constraint ipos */
- if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) {
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (EDITABLE_CONCHAN(conchan)) {
- i = count_ipo_keys(conchan->ipo, side, cfra);
- if (i) {
- actstrip_map_ipo_keys(ob, conchan->ipo, 0, 1);
- posttrans_ipo_clean(conchan->ipo);
- actstrip_map_ipo_keys(ob, conchan->ipo, 1, 1);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-/* ----------------------------- */
-
-/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */
-static short FrameOnMouseSide(char side, float frame, float cframe)
-{
- /* both sides, so it doesn't matter */
- if (side == 'B') return 1;
-
- /* only on the named side */
- if (side == 'R')
- return (frame >= cframe) ? 1 : 0;
- else
- return (frame <= cframe) ? 1 : 0;
-}
-
-/* fully select selected beztriples, but only include if it's on the right side of cfra */
-static int count_ipo_keys(Ipo *ipo, char side, float cfra)
-{
- IpoCurve *icu;
- BezTriple *bezt;
- int i, count = 0;
-
- if (ipo == NULL)
- return count;
-
- /* only include points that occur on the right side of cfra */
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- if (bezt->f2 & SELECT) {
- /* fully select the other two keys */
- bezt->f1 |= SELECT;
- bezt->f3 |= SELECT;
-
- /* increment by 3, as there are 3 points (3 * x-coordinates) that need transform */
- if (FrameOnMouseSide(side, bezt->vec[1][0], cfra))
- count += 3;
- }
- }
- }
-
- return count;
-}
-
-/* fully select selected beztriples, but only include if it's on the right side of cfra */
-static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra)
-{
- bGPDframe *gpf;
- int count = 0;
-
- if (gpl == NULL)
- return count;
-
- /* only include points that occur on the right side of cfra */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if (gpf->flag & GP_FRAME_SELECT) {
- if (FrameOnMouseSide(side, (float)gpf->framenum, cfra))
- count++;
- }
- }
-
- return count;
-}
-
-/* This function assigns the information to transdata */
-static void TimeToTransData(TransData *td, float *time, Object *ob)
-{
- /* memory is calloc'ed, so that should zero everything nicely for us */
- td->val = time;
- td->ival = *(time);
-
- /* store the Object where this keyframe exists as a keyframe of the
- * active action as td->ob. Usually, this member is only used for constraints
- * drawing
- */
- td->ob= ob;
-}
-
-/* This function advances the address to which td points to, so it must return
- * the new address so that the next time new transform data is added, it doesn't
- * overwrite the existing ones... i.e. td = IpoToTransData(td, ipo, ob, side, cfra);
- *
- * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data
- * on the named side are used.
- */
-static TransData *IpoToTransData(TransData *td, Ipo *ipo, Object *ob, char side, float cfra)
-{
- IpoCurve *icu;
- BezTriple *bezt;
- int i;
-
- if (ipo == NULL)
- return td;
-
- for (icu= ipo->curve.first; icu; icu= icu->next) {
- for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) {
- /* only add selected keyframes (for now, proportional edit is not enabled) */
- if (BEZSELECTED(bezt)) {
- /* only add if on the right 'side' of the current frame */
- if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) {
- /* each control point needs to be added separetely */
- TimeToTransData(td, bezt->vec[0], ob);
- td++;
-
- TimeToTransData(td, bezt->vec[1], ob);
- td++;
-
- TimeToTransData(td, bezt->vec[2], ob);
- td++;
- }
- }
- }
- }
-
- return td;
-}
-
-/* helper struct for gp-frame transforms (only used here) */
-typedef struct tGPFtransdata {
- float val; /* where transdata writes transform */
- int *sdata; /* pointer to gpf->framenum */
-} tGPFtransdata;
-
-/* This function helps flush transdata written to tempdata into the gp-frames */
-void flushTransGPactionData (TransInfo *t)
-{
- tGPFtransdata *tfd;
- int i;
-
- /* find the first one to start from */
- if (t->mode == TFM_TIME_SLIDE)
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
- else
- tfd= (tGPFtransdata *)(t->customData);
-
- /* flush data! */
- for (i = 0; i < t->total; i++, tfd++) {
- *(tfd->sdata)= (int)floor(tfd->val + 0.5);
- }
-}
-
-/* This function advances the address to which td points to, so it must return
- * the new address so that the next time new transform data is added, it doesn't
- * overwrite the existing ones... i.e. td = GPLayerToTransData(td, ipo, ob, side, cfra);
- *
- * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data
- * on the named side are used.
- */
-static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl, char side, float cfra)
-{
- bGPDframe *gpf;
- int count= 0;
-
- /* check for select frames on right side of current frame */
- for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
- if (gpf->flag & GP_FRAME_SELECT) {
- if (FrameOnMouseSide(side, (float)gpf->framenum, cfra)) {
- /* memory is calloc'ed, so that should zero everything nicely for us */
- td->val= &tfd->val;
- td->ival= (float)gpf->framenum;
-
- tfd->val= (float)gpf->framenum;
- tfd->sdata= &gpf->framenum;
-
- /* advance td now */
- td++;
- tfd++;
- count++;
- }
- }
- }
-
- return count;
-}
-
-static void createTransActionData(TransInfo *t)
-{
- TransData *td = NULL;
- tGPFtransdata *tfd = NULL;
- Object *ob= NULL;
-
- ListBase act_data = {NULL, NULL};
- bActListElem *ale;
- void *data;
- short datatype;
- int filter;
-
- int count=0;
- float cfra;
- char side;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
-
- /* filter data */
- if (datatype == ACTCONT_GPENCIL)
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT);
- else
- filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
- actdata_filter(&act_data, filter, data, datatype);
-
- /* is the action scaled? if so, the it should belong to the active object */
- if (NLA_ACTION_SCALED)
- ob= OBACT;
-
- /* which side of the current frame should be allowed */
- if (t->mode == TFM_TIME_EXTEND) {
- /* only side on which mouse is gets transformed */
- float xmouse, ymouse;
-
- areamouseco_to_ipoco(G.v2d, t->imval, &xmouse, &ymouse);
- side = (xmouse > CFRA) ? 'R' : 'L';
- }
- else {
- /* normal transform - both sides of current frame are considered */
- side = 'B';
- }
-
- /* convert current-frame to action-time (slightly less accurate, espcially under
- * higher scaling ratios, but is faster than converting all points)
- */
- if (ob)
- cfra = get_action_frame(ob, (float)CFRA);
- else
- cfra = (float)CFRA;
-
- /* loop 1: fully select ipo-keys and count how many BezTriples are selected */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER)
- count += count_gplayer_frames(ale->data, side, cfra);
- else
- count += count_ipo_keys(ale->key_data, side, cfra);
- }
-
- /* stop if trying to build list if nothing selected */
- if (count == 0) {
- /* cleanup temp list */
- BLI_freelistN(&act_data);
- return;
- }
-
- /* allocate memory for data */
- t->total= count;
-
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(Action Editor)");
- td= t->data;
-
- if (datatype == ACTCONT_GPENCIL) {
- if (t->mode == TFM_TIME_SLIDE) {
- t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata");
- tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 );
- }
- else {
- t->customData= MEM_callocN(sizeof(tGPFtransdata)*count, "tGPFtransdata");
- tfd= (tGPFtransdata *)(t->customData);
- }
- }
- else if (t->mode == TFM_TIME_SLIDE)
- t->customData= MEM_callocN(sizeof(float)*2, "TimeSlide Min/Max");
-
- /* loop 2: build transdata array */
- for (ale= act_data.first; ale; ale= ale->next) {
- if (ale->type == ACTTYPE_GPLAYER) {
- bGPDlayer *gpl= (bGPDlayer *)ale->data;
- int i;
-
- i = GPLayerToTransData(td, tfd, gpl, side, cfra);
- td += i;
- tfd += i;
- }
- else {
- Ipo *ipo= (Ipo *)ale->key_data;
-
- td= IpoToTransData(td, ipo, ob, side, cfra);
- }
- }
-
- /* check if we're supposed to be setting minx/maxx for TimeSlide */
- if (t->mode == TFM_TIME_SLIDE) {
- float min=999999999.0f, max=-999999999.0f;
- int i;
-
- td= (t->data + 1);
- for (i=1; i < count; i+=3, td+=3) {
- if (min > *(td->val)) min= *(td->val);
- if (max < *(td->val)) max= *(td->val);
- }
-
- /* minx/maxx values used by TimeSlide are stored as a
- * calloced 2-float array in t->customData. This gets freed
- * in postTrans (T_FREE_CUSTOMDATA).
- */
- *((float *)(t->customData)) = min;
- *((float *)(t->customData) + 1) = max;
- }
-
- /* cleanup temp list */
- BLI_freelistN(&act_data);
-}
-
-static void createTransNlaData(TransInfo *t)
-{
- Base *base;
- bActionStrip *strip;
- bActionChannel *achan;
- bConstraintChannel *conchan;
-
- TransData *td = NULL;
- int count=0, i;
- float cfra;
- char side;
-
- /* which side of the current frame should be allowed */
- if (t->mode == TFM_TIME_EXTEND) {
- /* only side on which mouse is gets transformed */
- float xmouse, ymouse;
-
- areamouseco_to_ipoco(G.v2d, t->imval, &xmouse, &ymouse);
- side = (xmouse > CFRA) ? 'R' : 'L';
- }
- else {
- /* normal transform - both sides of current frame are considered */
- side = 'B';
- }
-
- /* Ensure that partial selections result in beztriple selections */
- for (base=G.scene->base.first; base; base=base->next) {
- /* Check object ipos */
- i= count_ipo_keys(base->object->ipo, side, (float)CFRA);
- if (i) base->flag |= BA_HAS_RECALC_OB;
- count += i;
-
- /* Check object constraint ipos */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
- count += count_ipo_keys(conchan->ipo, side, (float)CFRA);
-
- /* skip actions and nlastrips if object is collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Check action ipos */
- if (base->object->action) {
- /* exclude if strip is selected too */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- if (strip->act == base->object->action)
- break;
- }
- }
- if (strip==NULL) {
- cfra = get_action_frame(base->object, (float)CFRA);
-
- for (achan=base->object->action->chanbase.first; achan; achan=achan->next) {
- if (EDITABLE_ACHAN(achan)) {
- i= count_ipo_keys(achan->ipo, side, cfra);
- if (i) base->flag |= BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA;
- count += i;
-
- /* Check action constraint ipos */
- if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) {
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (EDITABLE_CONCHAN(conchan))
- count += count_ipo_keys(conchan->ipo, side, cfra);
- }
- }
- }
- }
- }
- }
-
- /* Check nlastrips */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- base->flag |= BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA;
-
- if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++;
- if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++;
- }
- }
- }
-
- /* If nothing is selected, bail out */
- if (count == 0)
- return;
-
- /* allocate memory for data */
- t->total= count;
- t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (NLA Editor)");
-
- /* build the transdata structure */
- td= t->data;
- for (base=G.scene->base.first; base; base=base->next) {
- /* Manipulate object ipos */
- /* - no scaling of keyframe times is allowed here */
- td= IpoToTransData(td, base->object->ipo, NULL, side, (float)CFRA);
-
- /* Manipulate object constraint ipos */
- /* - no scaling of keyframe times is allowed here */
- for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
- td= IpoToTransData(td, conchan->ipo, NULL, side, (float)CFRA);
-
- /* skip actions and nlastrips if object collapsed */
- if (base->object->nlaflag & OB_NLA_COLLAPSED)
- continue;
-
- /* Manipulate action ipos */
- if (base->object->action) {
- /* exclude if strip that active action belongs to is selected too */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- if (strip->act == base->object->action)
- break;
- }
- }
-
- /* can include if no strip found */
- if (strip==NULL) {
- cfra = get_action_frame(base->object, (float)CFRA);
-
- for (achan=base->object->action->chanbase.first; achan; achan=achan->next) {
- if (EDITABLE_ACHAN(achan)) {
- td= IpoToTransData(td, achan->ipo, base->object, side, cfra);
-
- /* Manipulate action constraint ipos */
- if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) {
- for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
- if (EDITABLE_CONCHAN(conchan))
- td= IpoToTransData(td, conchan->ipo, base->object, side, cfra);
- }
- }
- }
- }
- }
- }
-
- /* Manipulate nlastrips */
- for (strip=base->object->nlastrips.first; strip; strip=strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- /* first TransData is the start, second is the end */
- if (FrameOnMouseSide(side, strip->start, (float)CFRA)) {
- td->val = &strip->start;
- td->ival = strip->start;
- td++;
- }
- if (FrameOnMouseSide(side, strip->end, (float)CFRA)) {
- td->val = &strip->end;
- td->ival = strip->end;
- td++;
- }
- }
- }
- }
-}
-
-/* **************** IpoKey stuff, for Object TransData ********** */
-
-/* storage of bezier triple. thats why -3 and +3! */
-static void set_tdi_old(float *old, float *poin)
-{
- old[0]= *(poin);
- old[3]= *(poin-3);
- old[6]= *(poin+3);
-}
-
-/* while transforming */
-void add_tdi_poin(float *poin, float *old, float delta)
-{
- if(poin) {
- poin[0]= old[0]+delta;
- poin[-3]= old[3]+delta;
- poin[3]= old[6]+delta;
- }
-}
-
-/* fill ipokey transdata with old vals and pointers */
-static void ipokey_to_transdata(IpoKey *ik, TransData *td)
-{
- extern int ob_ar[]; // blenkernel ipo.c
- TransDataIpokey *tdi= td->tdi;
- BezTriple *bezt;
- int a, delta= 0;
-
- td->val= NULL; // is read on ESC
-
- for(a=0; a<OB_TOTIPO; a++) {
- if(ik->data[a]) {
- bezt= ik->data[a];
-
- switch( ob_ar[a] ) {
- case OB_LOC_X:
- case OB_DLOC_X:
- tdi->locx= &(bezt->vec[1][1]); break;
- case OB_LOC_Y:
- case OB_DLOC_Y:
- tdi->locy= &(bezt->vec[1][1]); break;
- case OB_LOC_Z:
- case OB_DLOC_Z:
- tdi->locz= &(bezt->vec[1][1]); break;
-
- case OB_DROT_X:
- delta= 1;
- case OB_ROT_X:
- tdi->rotx= &(bezt->vec[1][1]); break;
- case OB_DROT_Y:
- delta= 1;
- case OB_ROT_Y:
- tdi->roty= &(bezt->vec[1][1]); break;
- case OB_DROT_Z:
- delta= 1;
- case OB_ROT_Z:
- tdi->rotz= &(bezt->vec[1][1]); break;
-
- case OB_SIZE_X:
- case OB_DSIZE_X:
- tdi->sizex= &(bezt->vec[1][1]); break;
- case OB_SIZE_Y:
- case OB_DSIZE_Y:
- tdi->sizey= &(bezt->vec[1][1]); break;
- case OB_SIZE_Z:
- case OB_DSIZE_Z:
- tdi->sizez= &(bezt->vec[1][1]); break;
- }
- }
- }
-
- /* oldvals for e.g. undo */
- if(tdi->locx) set_tdi_old(tdi->oldloc, tdi->locx);
- if(tdi->locy) set_tdi_old(tdi->oldloc+1, tdi->locy);
- if(tdi->locz) set_tdi_old(tdi->oldloc+2, tdi->locz);
-
- /* remember, for mapping curves ('1'=10 degrees) */
- if(tdi->rotx) set_tdi_old(tdi->oldrot, tdi->rotx);
- if(tdi->roty) set_tdi_old(tdi->oldrot+1, tdi->roty);
- if(tdi->rotz) set_tdi_old(tdi->oldrot+2, tdi->rotz);
-
- /* this is not allowed to be dsize! */
- if(tdi->sizex) set_tdi_old(tdi->oldsize, tdi->sizex);
- if(tdi->sizey) set_tdi_old(tdi->oldsize+1, tdi->sizey);
- if(tdi->sizez) set_tdi_old(tdi->oldsize+2, tdi->sizez);
-
- tdi->flag= TOB_IPO;
- if(delta) tdi->flag |= TOB_IPODROT;
-}
-
-
-/* *************************** Object Transform data ******************* */
-
-/* Little helper function for ObjectToTransData used to give certain
- * constraints (ChildOf, FollowPath, and others that may be added)
- * inverse corrections for transform, so that they aren't in CrazySpace.
- * These particular constraints benefit from this, but others don't, hence
- * this semi-hack ;-) - Aligorith
- */
-static short constraints_list_needinv(TransInfo *t, ListBase *list)
-{
- bConstraint *con;
-
- /* loop through constraints, checking if there's one of the mentioned
- * constraints needing special crazyspace corrections
- */
- if (list) {
- for (con= list->first; con; con=con->next) {
- /* only consider constraint if it is enabled, and has influence on result */
- if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) {
- /* (affirmative) returns for specific constraints here... */
- /* constraints that require this regardless */
- if (con->type == CONSTRAINT_TYPE_CHILDOF) return 1;
- if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) return 1;
- if (con->type == CONSTRAINT_TYPE_CLAMPTO) return 1;
-
- /* constraints that require this only under special conditions */
- if (con->type == CONSTRAINT_TYPE_ROTLIKE) {
- /* CopyRot constraint only does this when rotating, and offset is on */
- bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data;
-
- if ((data->flag & ROTLIKE_OFFSET) && (t->mode == TFM_ROTATION))
- return 1;
- }
- }
- }
- }
-
- /* no appropriate candidates found */
- return 0;
-}
-
-/* transcribe given object into TransData for Transforming */
-static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
-{
- Object *track;
- ListBase fakecons = {NULL, NULL};
- float obmtx[3][3];
- short constinv;
- short skip_invert = 0;
-
- /* axismtx has the real orientation */
- Mat3CpyMat4(td->axismtx, ob->obmat);
- Mat3Ortho(td->axismtx);
-
- td->con= ob->constraints.first;
-
- /* hack: tempolarily disable tracking and/or constraints when getting
- * object matrix, if tracking is on, or if constraints don't need
- * inverse correction to stop it from screwing up space conversion
- * matrix later
- */
- constinv = constraints_list_needinv(t, &ob->constraints);
-
- /* disable constraints inversion for dummy pass */
- if (t->mode == TFM_DUMMY)
- skip_invert = 1;
-
- if (skip_invert == 0 && (ob->track || constinv==0)) {
- track= ob->track;
- ob->track= NULL;
-
- if (constinv == 0) {
- fakecons.first = ob->constraints.first;
- fakecons.last = ob->constraints.last;
- ob->constraints.first = ob->constraints.last = NULL;
- }
-
- where_is_object(ob);
-
- if (constinv == 0) {
- ob->constraints.first = fakecons.first;
- ob->constraints.last = fakecons.last;
- }
-
- ob->track= track;
- }
- else
- where_is_object(ob);
-
- td->ob = ob;
-
- td->loc = ob->loc;
- VECCOPY(td->iloc, td->loc);
-
- td->ext->rot = ob->rot;
- VECCOPY(td->ext->irot, ob->rot);
- VECCOPY(td->ext->drot, ob->drot);
-
- td->ext->size = ob->size;
- VECCOPY(td->ext->isize, ob->size);
- VECCOPY(td->ext->dsize, ob->dsize);
-
- VECCOPY(td->center, ob->obmat[3]);
-
- Mat4CpyMat4(td->ext->obmat, ob->obmat);
-
- /* is there a need to set the global<->data space conversion matrices? */
- if (ob->parent || constinv) {
- float totmat[3][3], obinv[3][3];
-
- /* Get the effect of parenting, and/or certain constraints.
- * NOTE: some Constraints, and also Tracking should never get this
- * done, as it doesn't work well.
- */
- object_to_mat3(ob, obmtx);
- Mat3CpyMat4(totmat, ob->obmat);
- Mat3Inv(obinv, totmat);
- Mat3MulMat3(td->smtx, obmtx, obinv);
- Mat3Inv(td->mtx, td->smtx);
- }
- else {
- /* no conversion to/from dataspace */
- Mat3One(td->smtx);
- Mat3One(td->mtx);
- }
-
- /* set active flag */
- if (BASACT && BASACT->object == ob)
- {
- td->flag |= TD_ACTIVE;
- }
-
-#ifdef WITH_VERSE
- if(ob->vnode) {
- td->verse = (void*)ob;
- td->flag |= TD_VERSE_OBJECT;
- }
- else
- td->flag &= ~TD_VERSE_OBJECT;
-#endif
-}
-
-
-/* sets flags in Bases to define whether they take part in transform */
-/* it deselects Bases, so we have to call the clear function always after */
-static void set_trans_object_base_flags(TransInfo *t)
-{
- /*
- if Base selected and has parent selected:
- base->flag= BA_WAS_SEL
- */
- Base *base;
-
- /* don't do it if we're not actually going to recalculate anything */
- if(t->mode == TFM_DUMMY)
- return;
-
- /* makes sure base flags and object flags are identical */
- copy_baseflags();
-
- /* handle pending update events, otherwise they got copied below */
- for (base= FIRSTBASE; base; base= base->next) {
- if(base->object->recalc)
- object_handle_update(base->object);
- }
-
- for (base= FIRSTBASE; base; base= base->next) {
- base->flag &= ~BA_WAS_SEL;
-
- if(TESTBASELIB(base)) {
- Object *ob= base->object;
- Object *parsel= ob->parent;
-
- /* if parent selected, deselect */
- while(parsel) {
- if(parsel->flag & SELECT) break;
- parsel= parsel->parent;
- }
-
- if(parsel)
- {
- if (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL)
- {
- base->flag |= BA_TRANSFORM_CHILD;
- }
- else
- {
- base->flag &= ~SELECT;
- base->flag |= BA_WAS_SEL;
- }
- }
- /* used for flush, depgraph will change recalcs if needed :) */
- ob->recalc |= OB_RECALC_OB;
- }
- }
-
- /* all recalc flags get flushed to all layers, so a layer flip later on works fine */
- DAG_scene_flush_update(G.scene, -1, 0);
-
- /* and we store them temporal in base (only used for transform code) */
- /* this because after doing updates, the object->recalc is cleared */
- for (base= FIRSTBASE; base; base= base->next) {
- if(base->object->recalc & OB_RECALC_OB)
- base->flag |= BA_HAS_RECALC_OB;
- if(base->object->recalc & OB_RECALC_DATA)
- base->flag |= BA_HAS_RECALC_DATA;
- }
-}
-
-static void clear_trans_object_base_flags(void)
-{
- Base *base;
-
- base= FIRSTBASE;
- while(base) {
- if(base->flag & BA_WAS_SEL) base->flag |= SELECT;
- base->flag &= ~(BA_WAS_SEL|BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA|BA_DO_IPO|BA_TRANSFORM_CHILD);
-
- base = base->next;
- }
-}
-
-/* auto-keyframing feature - checks for whether anything should be done for the current frame */
-short autokeyframe_cfra_can_key(Object *ob)
-{
- ListBase keys = {NULL, NULL};
- ActKeyColumn *ak;
- float cfra;
- short found= 0;
-
- /* only filter if auto-key mode requires this */
- if (IS_AUTOKEY_ON == 0)
- return 0;
- else if (IS_AUTOKEY_MODE(NORMAL))
- return 1;
-
- /* sanity check */
- if (ob == NULL)
- return 0;
-
- /* get keyframes that object has (bone anim is stored on ob too) */
- if (ob->action)
- action_to_keylist(ob->action, &keys, NULL, NULL);
- else if (ob->ipo)
- ipo_to_keylist(ob->ipo, &keys, NULL, NULL);
- else
- return 0;
-
- /* get current frame (will apply nla-scaling as necessary) */
- // ack... this is messy...
- cfra= frame_to_float(CFRA);
- cfra= get_action_frame(ob, cfra);
-
- /* check if a keyframe occurs on current frame */
- for (ak= keys.first; ak; ak= ak->next) {
- if (IS_EQ(cfra, ak->cfra)) {
- found= 1;
- break;
- }
- }
-
- /* free temp list */
- BLI_freelistN(&keys);
-
- return found;
-}
-
-/* auto-keyframing feature - for objects
- * tmode: should be a transform mode
- */
-void autokeyframe_ob_cb_func(Object *ob, int tmode)
-{
- ID *id= (ID *)(ob);
- IpoCurve *icu;
-
- if (autokeyframe_cfra_can_key(ob)) {
- char *actname = NULL;
- short flag = 0;
-
- if (ob->ipoflag & OB_ACTION_OB)
- actname= "Object";
-
- if (IS_AUTOKEY_FLAG(INSERTNEEDED))
- flag |= INSERTKEY_NEEDED;
- if (IS_AUTOKEY_FLAG(AUTOMATKEY))
- flag |= INSERTKEY_MATRIX;
-
- if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
- /* only key on available channels */
- if ((ob->ipo) || (ob->action)) {
- if (ob->action && actname) {
- bActionChannel *achan;
- achan= get_action_channel(ob->action, actname);
-
- if (achan && achan->ipo)
- icu= achan->ipo->curve.first;
- else
- icu= NULL;
- }
- else
- icu= ob->ipo->curve.first;
-
- for (; icu; icu= icu->next) {
- icu->flag &= ~IPO_SELECT;
- insertkey(id, ID_OB, actname, NULL, icu->adrcode, flag);
- }
- }
- }
- else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
- short doLoc=0, doRot=0, doScale=0;
-
- /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
- if (tmode == TFM_TRANSLATION) {
- doLoc = 1;
- }
- else if (tmode == TFM_ROTATION) {
- if (G.vd->around == V3D_ACTIVE) {
- if (ob != OBACT)
- doLoc = 1;
- }
- else if (G.vd->around == V3D_CURSOR)
- doLoc = 1;
-
- if ((G.vd->flag & V3D_ALIGN)==0)
- doRot = 1;
- }
- else if (tmode == TFM_RESIZE) {
- if (G.vd->around == V3D_ACTIVE) {
- if (ob != OBACT)
- doLoc = 1;
- }
- else if (G.vd->around == V3D_CURSOR)
- doLoc = 1;
-
- if ((G.vd->flag & V3D_ALIGN)==0)
- doScale = 1;
- }
-
- if (doLoc) {
- insertkey(id, ID_OB, actname, NULL, OB_LOC_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_LOC_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_LOC_Z, flag);
- }
- if (doRot) {
- insertkey(id, ID_OB, actname, NULL, OB_ROT_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_ROT_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_ROT_Z, flag);
- }
- if (doScale) {
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_Z, flag);
- }
- }
- else {
- insertkey(id, ID_OB, actname, NULL, OB_LOC_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_LOC_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_LOC_Z, flag);
-
- insertkey(id, ID_OB, actname, NULL, OB_ROT_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_ROT_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_ROT_Z, flag);
-
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_X, flag);
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_Y, flag);
- insertkey(id, ID_OB, actname, NULL, OB_SIZE_Z, flag);
- }
-
- remake_object_ipos(ob);
- allqueue(REDRAWMARKER, 0);
- allqueue(REDRAWOOPS, 0);
- }
-}
-
-/* auto-keyframing feature - for poses/pose-channels
- * tmode: should be a transform mode
- * targetless_ik: has targetless ik been done on any channels?
- */
-void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik)
-{
- ID *id= (ID *)(ob);
- bArmature *arm= ob->data;
- bAction *act;
- bPose *pose;
- bPoseChannel *pchan;
- IpoCurve *icu;
-
- pose= ob->pose;
- act= ob->action;
-
- if (autokeyframe_cfra_can_key(ob)) {
- short flag= 0;
-
- if (act == NULL)
- act= ob->action= add_empty_action("Action");
-
- if (IS_AUTOKEY_FLAG(INSERTNEEDED))
- flag |= INSERTKEY_NEEDED;
- if (IS_AUTOKEY_FLAG(AUTOMATKEY))
- flag |= INSERTKEY_MATRIX;
-
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
- if (pchan->bone->flag & BONE_TRANSFORM) {
- /* clear any 'unkeyed' flag it may have */
- pchan->bone->flag &= ~BONE_UNKEYED;
-
- /* only insert into available channels? */
- if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
- bActionChannel *achan;
-
- achan= get_action_channel(act, pchan->name);
- if (achan && achan->ipo) {
- for (icu= achan->ipo->curve.first; icu; icu= icu->next)
- insertkey(id, ID_PO, pchan->name, NULL, icu->adrcode, flag);
- }
- }
- /* only insert keyframe if needed? */
- else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
- short doLoc=0, doRot=0, doScale=0;
-
- /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
- if (tmode == TFM_TRANSLATION) {
- if (targetless_ik)
- doRot= 1;
- else
- doLoc = 1;
- }
- else if (tmode == TFM_ROTATION) {
- if (ELEM(G.vd->around, V3D_CURSOR, V3D_ACTIVE))
- doLoc = 1;
-
- if ((G.vd->flag & V3D_ALIGN)==0)
- doRot = 1;
- }
- else if (tmode == TFM_RESIZE) {
- if (ELEM(G.vd->around, V3D_CURSOR, V3D_ACTIVE))
- doLoc = 1;
-
- if ((G.vd->flag & V3D_ALIGN)==0)
- doScale = 1;
- }
-
- if (doLoc) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, flag);
- }
- if (doRot) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, flag);
- }
- if (doScale) {
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, flag);
- }
- }
- /* insert keyframe in any channel that's appropriate */
- else {
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, flag);
-
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, flag);
-
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, flag);
- insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, flag);
- }
- }
- }
-
- remake_action_ipos(act);
- allqueue(REDRAWMARKER, 0);
- allqueue(REDRAWOOPS, 0);
-
- /* locking can be disabled */
- ob->pose->flag &= ~(POSE_DO_UNLOCK|POSE_LOCKED);
-
- /* do the bone paths */
- if (arm->pathflag & ARM_PATH_ACFRA) {
- //pose_clear_paths(ob);
- pose_recalculate_paths(ob);
- }
- }
- else {
- /* tag channels that should have unkeyed data */
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
- if (pchan->bone->flag & BONE_TRANSFORM) {
- /* tag this channel */
- pchan->bone->flag |= BONE_UNKEYED;
- }
- }
- }
-}
-
-/* very bad call!!! - copied from editnla.c! */
-static void recalc_all_ipos(void)
-{
- Ipo *ipo;
- IpoCurve *icu;
-
- /* Go to each ipo */
- for (ipo=G.main->ipo.first; ipo; ipo=ipo->id.next){
- for (icu = ipo->curve.first; icu; icu=icu->next){
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
- }
-}
-
-/* inserting keys, refresh ipo-keys, pointcache, redraw events... (ton) */
-/* note: transdata has been freed already! */
-void special_aftertrans_update(TransInfo *t)
-{
- Object *ob;
- Base *base;
- short redrawipo=0, resetslowpar=1;
- int cancelled= (t->state == TRANS_CANCEL);
- short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0;
-
- if (t->spacetype==SPACE_VIEW3D) {
- if (G.obedit) {
- if (cancelled==0) {
- EM_automerge(1);
- /* when snapping, delay retopo until after automerge */
- if (G.qual & LR_CTRLKEY) {
- retopo_do_all();
- }
- }
- }
- }
- if (t->spacetype == SPACE_ACTION) {
- void *data;
- short datatype;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&datatype);
- if (data == NULL) return;
- ob = OBACT;
-
- if (datatype == ACTCONT_ACTION) {
- /* Depending on the lock status, draw necessary views */
- if (ob) {
- ob->ctime= -1234567.0f;
-
- if(ob->pose || ob_get_key(ob))
- DAG_object_flush_update(G.scene, ob, OB_RECALC);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
-
- /* Do curve cleanups? */
- if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
- {
- posttrans_action_clean((bAction *)data);
- }
-
- /* Do curve updates */
- remake_action_ipos((bAction *)data);
- }
- else if (datatype == ACTCONT_SHAPEKEY) {
- /* fix up the Ipocurves and redraw stuff */
- Key *key= (Key *)data;
- if (key->ipo) {
- IpoCurve *icu;
-
- if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
- {
- posttrans_ipo_clean(key->ipo);
- }
-
- for (icu = key->ipo->curve.first; icu; icu=icu->next) {
- sort_time_ipocurve(icu);
- testhandles_ipocurve(icu);
- }
- }
-
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- }
- else if (datatype == ACTCONT_GPENCIL) {
- /* remove duplicate frames and also make sure points are in order! */
- if ((cancelled == 0) || (duplicate))
- {
- ScrArea *sa;
-
- /* BAD... we need to loop over all screen areas for current screen...
- * - sync this with actdata_filter_gpencil() in editaction.c
- */
- for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
- bGPdata *gpd= gpencil_data_getactive(sa);
-
- if (gpd)
- posttrans_gpd_clean(gpd);
- }
- }
- }
-
- G.saction->flag &= ~SACTION_MOVING;
- }
- else if (t->spacetype == SPACE_NLA) {
- recalc_all_ipos(); // bad
- synchronize_action_strips();
-
- /* cleanup */
- for (base=G.scene->base.first; base; base=base->next)
- base->flag &= ~(BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA);
-
- /* after transform, remove duplicate keyframes on a frame that resulted from transform */
- if ( (G.snla->flag & SNLA_NOTRANSKEYCULL)==0 &&
- ((cancelled == 0) || (duplicate)) )
- {
- posttrans_nla_clean(t);
- }
- }
- else if (t->spacetype == SPACE_IPO) {
- // FIXME! is there any code from the old transform_ipo that needs to be added back?
-
- /* after transform, remove duplicate keyframes on a frame that resulted from transform */
- if (G.sipo->ipo)
- {
- if ( (G.sipo->flag & SIPO_NOTRANSKEYCULL)==0 &&
- (cancelled == 0) )
- {
- /* NOTE: no need to do NLA scaling stuff here, as when there is NLA scaling,
- * the transformed handles will get moved wrong (seem to match wrong repeat cycle)
- */
- posttrans_ipo_clean(G.sipo->ipo);
- }
- }
-
- /* resetting slow-parents isn't really necessary when editing sequence ipo's */
- if (G.sipo->blocktype==ID_SEQ)
- resetslowpar= 0;
- }
- else if (G.obedit) {
- if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE)
- allqueue(REDRAWBUTSEDIT, 0);
-
- /* table needs to be created for each edit command, since vertices can move etc */
- mesh_octree_table(G.obedit, NULL, 'e');
- }
- else if ((t->flag & T_POSE) && (t->poseobj)) {
- bArmature *arm;
- bPose *pose;
- bPoseChannel *pchan;
- short targetless_ik= 0;
-
- ob= t->poseobj;
- arm= ob->data;
- pose= ob->pose;
-
- /* this signal does one recalc on pose, then unlocks, so ESC or edit will work */
- pose->flag |= POSE_DO_UNLOCK;
-
- /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */
- if (!cancelled && t->mode==TFM_TRANSLATION)
- targetless_ik= apply_targetless_ik(ob);
- else {
- /* not forget to clear the auto flag */
- for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) {
- bKinematicConstraint *data= has_targetless_ik(pchan);
- if(data) data->flag &= ~CONSTRAINT_IK_AUTO;
- }
- }
-
- if (t->mode==TFM_TRANSLATION)
- pose_grab_with_ik_clear(ob);
-
- /* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */
- if (!cancelled && (t->mode != TFM_DUMMY)) {
- autokeyframe_pose_cb_func(ob, t->mode, targetless_ik);
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else if (arm->flag & ARM_DELAYDEFORM) {
- /* old optimize trick... this enforces to bypass the depgraph */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- ob->recalc= 0; // is set on OK position already by recalcData()
- }
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE)
- allqueue(REDRAWBUTSEDIT, 0);
-
- }
- else if(G.f & G_PARTICLEEDIT) {
- ;
- }
- else {
- base= FIRSTBASE;
-
- while (base) {
-
- if(base->flag & BA_DO_IPO) redrawipo= 1;
-
- ob= base->object;
-
- if(base->flag & SELECT && (t->mode != TFM_DUMMY)) {
- if(BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH))
- ob->recalc |= OB_RECALC_DATA;
-
- /* Set autokey if necessary */
- if (!cancelled)
- autokeyframe_ob_cb_func(ob, t->mode);
- }
-
- base= base->next;
- }
-
- }
-
- clear_trans_object_base_flags();
-
- if (redrawipo) {
- allqueue(REDRAWNLA, 0);
- allqueue(REDRAWACTION, 0);
- allqueue(REDRAWIPO, 0);
- }
-
- if(resetslowpar)
- reset_slowparents();
-
- /* note; should actually only be done for all objects when a lamp is moved... (ton) */
- if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED)
- reshadeall_displist();
-}
-
-static void createTransObject(TransInfo *t)
-{
- TransData *td = NULL;
- TransDataExtension *tx;
- Object *ob;
- Base *base;
- IpoKey *ik;
- ListBase elems;
-
- set_trans_object_base_flags(t);
-
- /* count */
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASE(base) {
- ob= base->object;
-
- /* store ipo keys? */
- if ((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
- elems.first= elems.last= NULL;
- make_ipokey_transform(ob, &elems, 1); /* '1' only selected keys */
-
- pushdata(&elems, sizeof(ListBase));
-
- for(ik= elems.first; ik; ik= ik->next)
- t->total++;
-
- if(elems.first==NULL)
- t->total++;
- }
- else {
- t->total++;
- }
- }
- }
-
- if(!t->total) {
- /* clear here, main transform function escapes too */
- clear_trans_object_base_flags();
- return;
- }
-
- td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransOb");
- tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransObExtension");
-
- for(base= FIRSTBASE; base; base= base->next) {
- if TESTBASE(base) {
- ob= base->object;
-
- td->flag = TD_SELECTED;
- td->protectflag= ob->protectflag;
- td->ext = tx;
-
- if (base->flag & BA_TRANSFORM_CHILD)
- {
- td->flag |= TD_NOCENTER;
- td->flag |= TD_NO_LOC;
- }
-
- /* select linked objects, but skip them later */
- if (ob->id.lib != 0) {
- td->flag |= TD_SKIP;
- }
-
- /* store ipo keys? */
- if((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) {
-
- popfirst(&elems); // bring back pushed listbase
-
- if(elems.first) {
- int cfraont;
- int ipoflag;
-
- base->flag |= BA_DO_IPO+BA_WAS_SEL;
- base->flag &= ~SELECT;
-
- cfraont= CFRA;
- set_no_parent_ipo(1);
- ipoflag= ob->ipoflag;
- ob->ipoflag &= ~OB_OFFS_OB;
-
- /*
- * This is really EVIL code that pushes down Object values
- * (loc, dloc, orig, size, dsize, rot, drot)
- * */
-
- pushdata((void*)ob->loc, 7 * 3 * sizeof(float)); // tsk! tsk!
-
- for(ik= elems.first; ik; ik= ik->next) {
-
- /* weak... this doesn't correct for floating values, giving small errors */
- CFRA= (int)(ik->val/G.scene->r.framelen);
-
- do_ob_ipo(ob);
- ObjectToTransData(t, td, ob); // does where_is_object()
-
- td->flag= TD_SELECTED;
-
- td->tdi= MEM_callocN(sizeof(TransDataIpokey), "TransDataIpokey");
- /* also does tdi->flag and oldvals, needs to be after ob_to_transob()! */
- ipokey_to_transdata(ik, td);
-
- td++;
- tx++;
- if(ik->next) td->ext= tx; // prevent corrupting mem!
- }
- free_ipokey(&elems);
-
- poplast(ob->loc);
- set_no_parent_ipo(0);
-
- CFRA= cfraont;
- ob->ipoflag= ipoflag;
-
- where_is_object(ob); // restore
- }
- else {
- ObjectToTransData(t, td, ob);
- td->tdi = NULL;
- td->val = NULL;
- td++;
- tx++;
- }
- }
- else {
- ObjectToTransData(t, td, ob);
- td->tdi = NULL;
- td->val = NULL;
- td++;
- tx++;
- }
- }
- }
-}
-
-void createTransData(TransInfo *t)
-{
- Object *ob= OBACT;
-
- if (t->context == CTX_TEXTURE) {
- t->flag |= T_TEXTURE;
- createTransTexspace(t);
- }
- else if (t->context == CTX_EDGE) {
- t->ext = NULL;
- t->flag |= T_EDIT;
- createTransEdge(t);
- if(t->data && t->flag & T_PROP_EDIT) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 1);
- sort_trans_data_dist(t);
- }
- }
- else if (t->context == CTX_BMESH) {
- createTransBMeshVerts(t, G.editBMesh->bm, G.editBMesh->td);
- }
- else if (t->spacetype == SPACE_IMAGE) {
- t->flag |= T_POINTS|T_2D_EDIT;
- createTransUVs(t);
- if(t->data && (t->flag & T_PROP_EDIT)) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 1);
- sort_trans_data_dist(t);
- }
- }
- else if (t->spacetype == SPACE_ACTION) {
- t->flag |= T_POINTS|T_2D_EDIT;
- createTransActionData(t);
- }
- else if (t->spacetype == SPACE_NLA) {
- t->flag |= T_POINTS|T_2D_EDIT;
- createTransNlaData(t);
- }
- else if (t->spacetype == SPACE_IPO) {
- t->flag |= T_POINTS|T_2D_EDIT;
- createTransIpoData(t);
- if (t->data && (t->flag & T_PROP_EDIT)) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 1);
- sort_trans_data_dist(t);
- }
- }
- else if (G.obedit) {
- t->ext = NULL;
- if (G.obedit->type == OB_MESH) {
- createTransEditVerts(t);
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- createTransCurveVerts(t);
- }
- else if (G.obedit->type==OB_LATTICE) {
- createTransLatticeVerts(t);
- }
- else if (G.obedit->type==OB_MBALL) {
- createTransMBallVerts(t);
- }
- else if (G.obedit->type==OB_ARMATURE) {
- t->flag &= ~T_PROP_EDIT;
- createTransArmatureVerts(t);
- }
- else {
- printf("not done yet! only have mesh surface curve lattice mball armature\n");
- }
-
- if(t->data && t->flag & T_PROP_EDIT) {
- if (ELEM(G.obedit->type, OB_CURVE, OB_MESH)) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 0);
- sort_trans_data_dist(t);
- }
- else {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 1);
- sort_trans_data_dist(t);
- }
- }
-
- t->flag |= T_EDIT|T_POINTS;
-
- /* exception... hackish, we want bonesize to use bone orientation matrix (ton) */
- if(t->mode==TFM_BONESIZE) {
- t->flag &= ~(T_EDIT|T_POINTS);
- t->flag |= T_POSE;
- t->poseobj= ob; /* <- tsk tsk, this is going to give issues one day */
- }
- }
- else if (ob && (ob->flag & OB_POSEMODE)) {
- createTransPose(t, OBACT);
- }
- else if (G.f & G_WEIGHTPAINT) {
- /* exception, we look for the one selected armature */
- Base *base;
- for(base=FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(base)) {
- if(base->object->type==OB_ARMATURE)
- if(base->object->flag & OB_POSEMODE)
- break;
- }
- }
- if(base) {
- createTransPose(t, base->object);
- }
- }
- else if (G.f & G_PARTICLEEDIT && PE_can_edit(PE_get_current(ob))) {
- createTransParticleVerts(t);
-
- if(t->data && t->flag & T_PROP_EDIT) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, 1);
- sort_trans_data_dist(t);
- }
-
- t->flag |= T_POINTS;
- }
- else {
- t->flag &= ~T_PROP_EDIT; /* no proportional edit in object mode */
- createTransObject(t);
- t->flag |= T_OBJECT;
- }
-
- if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB) {
- t->flag |= T_CAMERA;
- }
-
- /* temporal...? */
- G.scene->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */
-}
-
-
-
-
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
deleted file mode 100644
index 2a91b66ad8e..00000000000
--- a/source/blender/src/transform_generics.c
+++ /dev/null
@@ -1,1114 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <math.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLO_sys_types.h" // for intptr_t support
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_constraint_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_nla_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BIF_screen.h"
-#include "BIF_resources.h"
-#include "BIF_mywindow.h"
-#include "BIF_gl.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editmesh.h"
-#include "BIF_editnla.h"
-#include "BIF_editsima.h"
-#include "BIF_editparticle.h"
-#include "BIF_meshtools.h"
-#include "BIF_retopo.h"
-
-#include "BSE_editipo.h"
-#include "BSE_editipo_types.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_cloth.h"
-#include "BKE_curve.h"
-#include "BKE_depsgraph.h"
-#include "BKE_displist.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_ipo.h"
-#include "BKE_lattice.h"
-#include "BKE_key.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#ifdef WITH_VERSE
-#include "BKE_verse.h"
-#endif
-
-#include "BSE_view.h"
-#include "BSE_editaction_types.h"
-#include "BDR_unwrapper.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-#include "BLI_rand.h"
-
-#include "blendef.h"
-
-#include "mydevice.h"
-
-#include "transform.h"
-
-extern ListBase editNurb;
-extern ListBase editelems;
-
-extern TransInfo Trans; /* From transform.c */
-
-/* ************************** Functions *************************** */
-
-void getViewVector(float coord[3], float vec[3])
-{
- TransInfo *t = BIF_GetTransInfo();
-
- if (t->persp != V3D_ORTHO)
- {
- float p1[4], p2[4];
-
- VECCOPY(p1, coord);
- p1[3] = 1.0f;
- VECCOPY(p2, p1);
- p2[3] = 1.0f;
- Mat4MulVec4fl(t->viewmat, p2);
-
- p2[0] = 2.0f * p2[0];
- p2[1] = 2.0f * p2[1];
- p2[2] = 2.0f * p2[2];
-
- Mat4MulVec4fl(t->viewinv, p2);
-
- VecSubf(vec, p1, p2);
- }
- else {
- VECCOPY(vec, t->viewinv[2]);
- }
- Normalize(vec);
-}
-
-/* ************************** GENERICS **************************** */
-
-static void clipMirrorModifier(TransInfo *t, Object *ob)
-{
- ModifierData *md= ob->modifiers.first;
- float tolerance[3] = {0.0f, 0.0f, 0.0f};
- int axis = 0;
-
- for (; md; md=md->next) {
- if (md->type==eModifierType_Mirror) {
- MirrorModifierData *mmd = (MirrorModifierData*) md;
-
- if(mmd->flag & MOD_MIR_CLIPPING) {
- axis = 0;
- if(mmd->flag & MOD_MIR_AXIS_X) {
- axis |= 1;
- tolerance[0] = mmd->tolerance;
- }
- if(mmd->flag & MOD_MIR_AXIS_Y) {
- axis |= 2;
- tolerance[1] = mmd->tolerance;
- }
- if(mmd->flag & MOD_MIR_AXIS_Z) {
- axis |= 4;
- tolerance[2] = mmd->tolerance;
- }
- if (axis) {
- float mtx[4][4], imtx[4][4];
- int i;
- TransData *td = t->data;
-
- if (mmd->mirror_ob) {
- float obinv[4][4];
-
- Mat4Invert(obinv, mmd->mirror_ob->obmat);
- Mat4MulMat4(mtx, ob->obmat, obinv);
- Mat4Invert(imtx, mtx);
- }
-
- for(i = 0 ; i < t->total; i++, td++) {
- int clip;
- float loc[3], iloc[3];
-
- if (td->flag & TD_NOACTION)
- break;
- if (td->loc==NULL)
- break;
-
- if (td->flag & TD_SKIP)
- continue;
-
- VecCopyf(loc, td->loc);
- VecCopyf(iloc, td->iloc);
-
- if (mmd->mirror_ob) {
- VecMat4MulVecfl(loc, mtx, loc);
- VecMat4MulVecfl(iloc, mtx, iloc);
- }
-
- clip = 0;
- if(axis & 1) {
- if(fabs(iloc[0])<=tolerance[0] ||
- loc[0]*iloc[0]<0.0f) {
- loc[0]= 0.0f;
- clip = 1;
- }
- }
-
- if(axis & 2) {
- if(fabs(iloc[1])<=tolerance[1] ||
- loc[1]*iloc[1]<0.0f) {
- loc[1]= 0.0f;
- clip = 1;
- }
- }
- if(axis & 4) {
- if(fabs(iloc[2])<=tolerance[2] ||
- loc[2]*iloc[2]<0.0f) {
- loc[2]= 0.0f;
- clip = 1;
- }
- }
- if (clip) {
- if (mmd->mirror_ob) {
- VecMat4MulVecfl(loc, imtx, loc);
- }
- VecCopyf(td->loc, loc);
- }
- }
- }
-
- }
- }
- }
-}
-
-/* assumes G.obedit set to mesh object */
-static void editmesh_apply_to_mirror(TransInfo *t)
-{
- TransData *td = t->data;
- EditVert *eve;
- int i;
-
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_NOACTION)
- break;
- if (td->loc==NULL)
- break;
- if (td->flag & TD_SKIP)
- continue;
-
- eve = td->tdmir;
- if(eve) {
- eve->co[0]= -td->loc[0];
- eve->co[1]= td->loc[1];
- eve->co[2]= td->loc[2];
- }
- }
-}
-
-/* called for updating while transform acts, once per redraw */
-void recalcData(TransInfo *t)
-{
- Base *base;
-#ifdef WITH_VERSE
- struct TransData *td;
-#endif
-
- if (t->spacetype == SPACE_ACTION) {
- Object *ob= OBACT;
- void *data;
- short context;
-
- /* determine what type of data we are operating on */
- data = get_action_context(&context);
- if (data == NULL) return;
-
- /* always flush data if gpencil context */
- if (context == ACTCONT_GPENCIL) {
- flushTransGPactionData(t);
- }
-
- if (G.saction->lock) {
- if (context == ACTCONT_ACTION) {
- if(ob) {
- ob->ctime= -1234567.0f;
- if(ob->pose || ob_get_key(ob))
- DAG_object_flush_update(G.scene, ob, OB_RECALC);
- else
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
- }
- else if (context == ACTCONT_SHAPEKEY) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA);
- }
- }
- }
- else if (t->spacetype == SPACE_NLA) {
- if (G.snla->lock) {
- for (base=G.scene->base.first; base; base=base->next) {
- if (base->flag & BA_HAS_RECALC_OB)
- base->object->recalc |= OB_RECALC_OB;
- if (base->flag & BA_HAS_RECALC_DATA)
- base->object->recalc |= OB_RECALC_DATA;
-
- if (base->object->recalc)
- base->object->ctime= -1234567.0f; // eveil!
-
- /* recalculate scale of selected nla-strips */
- if (base->object->nlastrips.first) {
- Object *bob= base->object;
- bActionStrip *strip;
-
- for (strip= bob->nlastrips.first; strip; strip= strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- float actlen= strip->actend - strip->actstart;
- float len= strip->end - strip->start;
-
- strip->scale= len / (actlen * strip->repeat);
- }
- }
- }
- }
-
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- }
- else {
- for (base=G.scene->base.first; base; base=base->next) {
- /* recalculate scale of selected nla-strips */
- if (base->object && base->object->nlastrips.first) {
- Object *bob= base->object;
- bActionStrip *strip;
-
- for (strip= bob->nlastrips.first; strip; strip= strip->next) {
- if (strip->flag & ACTSTRIP_SELECT) {
- float actlen= strip->actend - strip->actstart;
- float len= strip->end - strip->start;
-
- /* prevent 'negative' scaling */
- if (len < 0) {
- SWAP(float, strip->start, strip->end);
- len= fabs(len);
- }
-
- /* calculate new scale */
- strip->scale= len / (actlen * strip->repeat);
- }
- }
- }
- }
- }
- }
- else if (t->spacetype == SPACE_IPO) {
- EditIpo *ei;
- int dosort = 0;
- int a;
-
- /* do the flush first */
- flushTransIpoData(t);
-
- /* now test if there is a need to re-sort */
- ei= G.sipo->editipo;
- for (a=0; a<G.sipo->totipo; a++, ei++) {
- if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) {
-
- /* watch it: if the time is wrong: do not correct handles */
- if (test_time_ipocurve(ei->icu)) {
- dosort++;
- } else {
- calchandles_ipocurve(ei->icu);
- }
- }
- }
-
- /* do resort and other updates? */
- if (dosort) remake_ipo_transdata(t);
- if (G.sipo->showkey) update_ipokey_val();
-
- calc_ipo(G.sipo->ipo, (float)CFRA);
-
- /* update realtime - not working? */
- if (G.sipo->lock) {
- if (G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_TE) {
- do_ipo(G.sipo->ipo);
- }
- else if(G.sipo->blocktype==ID_CA) {
- do_ipo(G.sipo->ipo);
- }
- else if(G.sipo->blocktype==ID_KE) {
- Object *ob= OBACT;
- if(ob) {
- ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- else if(G.sipo->blocktype==ID_PO) {
- Object *ob= OBACT;
- if(ob && ob->pose) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- }
- else if(G.sipo->blocktype==ID_OB) {
- Object *ob= OBACT;
- Base *base= FIRSTBASE;
-
- /* only if this if active object has this ipo in an action (assumes that current ipo is in action) */
- if ((ob) && (ob->ipoflag & OB_ACTION_OB) && (G.sipo->pin==0)) {
- ob->ctime= -1234567.0f;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
- }
-
- while(base) {
- if(base->object->ipo==G.sipo->ipo) {
- do_ob_ipo(base->object);
- base->object->recalc |= OB_RECALC_OB;
- }
- base= base->next;
- }
- DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0);
- }
- }
- }
- else if (G.obedit) {
- if (G.obedit->type == OB_MESH) {
- if(t->spacetype==SPACE_IMAGE) {
- flushTransUVs(t);
- if (G.sima->flag & SI_LIVE_UNWRAP)
- unwrap_lscm_live_re_solve();
- } else {
- /* mirror modifier clipping? */
- if(t->state != TRANS_CANCEL) {
- if ((G.qual & LR_CTRLKEY)==0) {
- /* Only retopo if not snapping, Note, this is the only case of G.qual being used, but we have no T_SHIFT_MOD - Campbell */
- retopo_do_all();
- }
- clipMirrorModifier(t, G.obedit);
- }
- if((t->context & CTX_NO_MIRROR) == 0 && (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR))
- editmesh_apply_to_mirror(t);
-
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */
-
- recalc_editnormals();
- }
- }
- else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
- Nurb *nu= editNurb.first;
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */
-
- if (t->state == TRANS_CANCEL) {
- while(nu) {
- calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
- nu= nu->next;
- }
- } else {
- /* Normal updating */
- while(nu) {
- test2DNurb(nu);
- calchandlesNurb(nu);
- nu= nu->next;
- }
- retopo_do_all();
- }
- }
- else if(G.obedit->type==OB_ARMATURE){ /* no recalc flag, does pose */
- bArmature *arm= G.obedit->data;
- EditBone *ebo;
-
- /* Ensure all bones are correctly adjusted */
- for (ebo=G.edbo.first; ebo; ebo=ebo->next){
-
- if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
- /* If this bone has a parent tip that has been moved */
- if (ebo->parent->flag & BONE_TIPSEL){
- VECCOPY (ebo->head, ebo->parent->tail);
- if(t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail;
- }
- /* If this bone has a parent tip that has NOT been moved */
- else{
- VECCOPY (ebo->parent->tail, ebo->head);
- if(t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head;
- }
- }
-
- /* on extrude bones, oldlength==0.0f, so we scale radius of points */
- ebo->length= VecLenf(ebo->head, ebo->tail);
- if(ebo->oldlength==0.0f) {
- ebo->rad_head= 0.25f*ebo->length;
- ebo->rad_tail= 0.10f*ebo->length;
- ebo->dist= 0.25f*ebo->length;
- if(ebo->parent) {
- if(ebo->rad_head > ebo->parent->rad_tail)
- ebo->rad_head= ebo->parent->rad_tail;
- }
- }
- else if(t->mode!=TFM_BONE_ENVELOPE) {
- /* if bones change length, lets do that for the deform distance as well */
- ebo->dist*= ebo->length/ebo->oldlength;
- ebo->rad_head*= ebo->length/ebo->oldlength;
- ebo->rad_tail*= ebo->length/ebo->oldlength;
- ebo->oldlength= ebo->length;
- }
- }
- if(arm->flag & ARM_MIRROR_EDIT)
- transform_armature_mirror_update();
-
- }
- else if(G.obedit->type==OB_LATTICE) {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */
-
- if(editLatt->flag & LT_OUTSIDE) outside_lattice(editLatt);
- }
- else {
- DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */
- }
- }
- else if( (t->flag & T_POSE) && t->poseobj) {
- Object *ob= t->poseobj;
- bArmature *arm= ob->data;
-
- /* old optimize trick... this enforces to bypass the depgraph */
- if (!(arm->flag & ARM_DELAYDEFORM)) {
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); /* sets recalc flags */
- }
- else
- where_is_pose(ob);
- }
- else if(G.f & G_PARTICLEEDIT) {
- flushTransParticles(t);
- }
- else {
- for(base= FIRSTBASE; base; base= base->next) {
- Object *ob= base->object;
-
- /* this flag is from depgraph, was stored in initialize phase, handled in drawview.c */
- if(base->flag & BA_HAS_RECALC_OB)
- ob->recalc |= OB_RECALC_OB;
- if(base->flag & BA_HAS_RECALC_DATA)
- ob->recalc |= OB_RECALC_DATA;
-
- /* thanks to ob->ctime usage, ipos are not called in where_is_object,
- unless we edit ipokeys */
- if(base->flag & BA_DO_IPO) {
- if(ob->ipo) {
- IpoCurve *icu;
-
- ob->ctime= -1234567.0;
-
- icu= ob->ipo->curve.first;
- while(icu) {
- calchandles_ipocurve(icu);
- icu= icu->next;
- }
- }
- }
-
- /* proxy exception */
- if(ob->proxy)
- ob->proxy->recalc |= ob->recalc;
- if(ob->proxy_group)
- group_tag_recalc(ob->proxy_group->dup_group);
- }
- }
-
-#ifdef WITH_VERSE
- for (td = t->data; td < t->data + t->total; td++) {
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse)
- send_versevert_pos((VerseVert*)td->verse);
- }
- else if(td->flag & TD_VERSE_OBJECT)
- if(td->verse) b_verse_send_transformation((Object*)td->verse);
- }
-#endif
-
- /* update shaded drawmode while transform */
- if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED)
- reshadeall_displist();
-}
-
-void drawLine(float *center, float *dir, char axis, short options)
-{
- extern void make_axis_color(char *col, char *col2, char axis); // drawview.c
- float v1[3], v2[3], v3[3];
- char col[3], col2[3];
-
- //if(G.obedit) mymultmatrix(G.obedit->obmat); // sets opengl viewing
-
- VecCopyf(v3, dir);
- VecMulf(v3, G.vd->far);
-
- VecSubf(v2, center, v3);
- VecAddf(v1, center, v3);
-
- if (options & DRAWLIGHT) {
- col[0] = col[1] = col[2] = 220;
- }
- else {
- BIF_GetThemeColor3ubv(TH_GRID, col);
- }
- make_axis_color(col, col2, axis);
- glColor3ubv((GLubyte *)col2);
-
- setlinestyle(0);
- glBegin(GL_LINE_STRIP);
- glVertex3fv(v1);
- glVertex3fv(v2);
- glEnd();
-
- myloadmatrix(G.vd->viewmat);
-}
-
-void initTrans (TransInfo *t)
-{
-
- /* moving: is shown in drawobject() (transform color) */
- if(G.obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT;
- else if(G.f & G_PARTICLEEDIT) G.moving= G_TRANSFORM_PARTICLE;
- else G.moving= G_TRANSFORM_OBJ;
-
- t->data = NULL;
- t->ext = NULL;
-
- t->flag = 0;
-
- /* setting PET flag */
- if ((t->context & CTX_NO_PET) == 0 && (G.scene->proportional)) {
- t->flag |= T_PROP_EDIT;
- if(G.scene->proportional==2) t->flag |= T_PROP_CONNECTED; // yes i know, has to become define
- }
-
- getmouseco_areawin(t->imval);
- t->con.imval[0] = t->imval[0];
- t->con.imval[1] = t->imval[1];
-
- t->transform = NULL;
- t->handleEvent = NULL;
-
- t->total = 0;
-
- t->val = 0.0f;
-
- t->vec[0] =
- t->vec[1] =
- t->vec[2] = 0.0f;
-
- t->center[0] =
- t->center[1] =
- t->center[2] = 0.0f;
-
- Mat3One(t->mat);
-
- t->spacetype = curarea->spacetype;
- if(t->spacetype==SPACE_VIEW3D) {
- if(G.vd->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
- t->around = G.vd->around;
- } else if(t->spacetype==SPACE_IMAGE) {
- t->around = G.v2d->around;
- }
- else
- t->around = V3D_CENTER;
-
- setTransformViewMatrices(t);
- initNumInput(&t->num);
- initNDofInput(&t->ndof);
-}
-
-/* Here I would suggest only TransInfo related issues, like free data & reset vars. Not redraws */
-void postTrans (TransInfo *t)
-{
- TransData *td;
-
- G.moving = 0; // Set moving flag off (display as usual)
-#ifdef WITH_VERSE
-
- for (td = t->data; td < t->data + t->total; td++) {
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse) send_versevert_pos((VerseVert*)td->verse);
- }
- else if(td->flag & TD_VERSE_OBJECT) {
- if(td->verse) {
- struct VNode *vnode;
- vnode = (VNode*)((Object*)td->verse)->vnode;
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
- b_verse_send_transformation((Object*)td->verse);
- }
- }
- }
-#endif
-
- stopConstraint(t);
-
- /* postTrans can be called when nothing is selected, so data is NULL already */
- if (t->data) {
- int a;
-
- /* since ipokeys are optional on objects, we mallocced them per trans-data */
- for(a=0, td= t->data; a<t->total; a++, td++) {
- if(td->tdi) MEM_freeN(td->tdi);
- if (td->flag & TD_BEZTRIPLE) MEM_freeN(td->hdata);
- }
- MEM_freeN(t->data);
- }
-
- if (t->ext) MEM_freeN(t->ext);
- if (t->data2d) {
- MEM_freeN(t->data2d);
- t->data2d= NULL;
- }
-
- if(t->spacetype==SPACE_IMAGE) {
- if (G.sima->flag & SI_LIVE_UNWRAP)
- unwrap_lscm_live_end(t->state == TRANS_CANCEL);
- }
- else if(t->spacetype==SPACE_ACTION) {
- if (t->customData)
- MEM_freeN(t->customData);
- }
-}
-
-void applyTransObjects(TransInfo *t)
-{
- TransData *td;
-
- for (td = t->data; td < t->data + t->total; td++) {
- VECCOPY(td->iloc, td->loc);
- if (td->ext->rot) {
- VECCOPY(td->ext->irot, td->ext->rot);
- }
- if (td->ext->size) {
- VECCOPY(td->ext->isize, td->ext->size);
- }
- }
- recalcData(t);
-}
-
-/* helper for below */
-static void restore_ipokey(float *poin, float *old)
-{
- if(poin) {
- poin[0]= old[0];
- poin[-3]= old[3];
- poin[3]= old[6];
- }
-}
-
-static void restoreElement(TransData *td) {
- /* TransData for crease has no loc */
- if (td->loc) {
- VECCOPY(td->loc, td->iloc);
- }
- if (td->val) {
- *td->val = td->ival;
- }
- if (td->ext && (td->flag&TD_NO_EXT)==0) {
- if (td->ext->rot) {
- VECCOPY(td->ext->rot, td->ext->irot);
- }
- if (td->ext->size) {
- VECCOPY(td->ext->size, td->ext->isize);
- }
- if(td->flag & TD_USEQUAT) {
- if (td->ext->quat) {
- QUATCOPY(td->ext->quat, td->ext->iquat);
- }
- }
- }
-
- if (td->flag & TD_BEZTRIPLE) {
- *(td->hdata->h1) = td->hdata->ih1;
- *(td->hdata->h2) = td->hdata->ih2;
- }
-
- if(td->tdi) {
- TransDataIpokey *tdi= td->tdi;
-
- restore_ipokey(tdi->locx, tdi->oldloc);
- restore_ipokey(tdi->locy, tdi->oldloc+1);
- restore_ipokey(tdi->locz, tdi->oldloc+2);
-
- restore_ipokey(tdi->rotx, tdi->oldrot);
- restore_ipokey(tdi->roty, tdi->oldrot+1);
- restore_ipokey(tdi->rotz, tdi->oldrot+2);
-
- restore_ipokey(tdi->sizex, tdi->oldsize);
- restore_ipokey(tdi->sizey, tdi->oldsize+1);
- restore_ipokey(tdi->sizez, tdi->oldsize+2);
- }
-}
-
-void restoreTransObjects(TransInfo *t)
-{
- TransData *td;
-
- for (td = t->data; td < t->data + t->total; td++) {
- restoreElement(td);
-#ifdef WITH_VERSE
- /* position of vertexes and object transformation matrix is sent
- * extra, becuase blender uses synchronous sending of vertexes
- * position as well object trans. matrix and it isn't possible to
- * send it in recalcData sometimes */
- if(td->flag & TD_VERSE_VERT) {
- if(td->verse) {
- ((VerseVert*)td->verse)->flag |= VERT_POS_OBSOLETE;
- }
- }
- else if(td->flag & TD_VERSE_OBJECT)
- if(td->verse) {
- struct VNode *vnode;
- vnode = (VNode*)((Object*)td->verse)->vnode;
- ((VObjectData*)vnode->data)->flag |= POS_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY;
- ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY;
- }
-#endif
- }
- recalcData(t);
-}
-
-void calculateCenter2D(TransInfo *t)
-{
- if (t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- float vec[3];
-
- VECCOPY(vec, t->center);
- Mat4MulVecfl(ob->obmat, vec);
- projectIntView(t, vec, t->center2d);
- }
- else {
- projectIntView(t, t->center, t->center2d);
- }
-}
-
-void calculateCenterCursor(TransInfo *t)
-{
- float *cursor;
-
- cursor = give_cursor();
- VECCOPY(t->center, cursor);
-
- /* If edit or pose mode, move cursor in local space */
- if (t->flag & (T_EDIT|T_POSE)) {
- Object *ob = G.obedit?G.obedit:t->poseobj;
- float mat[3][3], imat[3][3];
-
- VecSubf(t->center, t->center, ob->obmat[3]);
- Mat3CpyMat4(mat, ob->obmat);
- Mat3Inv(imat, mat);
- Mat3MulVecfl(imat, t->center);
- }
-
- calculateCenter2D(t);
-}
-
-void calculateCenterCursor2D(TransInfo *t)
-{
- float aspx=1.0, aspy=1.0;
-
- if(t->spacetype==SPACE_IMAGE) /* only space supported right now but may change */
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- if (G.v2d) {
- t->center[0] = G.v2d->cursor[0] * aspx;
- t->center[1] = G.v2d->cursor[1] * aspy;
- }
- calculateCenter2D(t);
-}
-
-void calculateCenterMedian(TransInfo *t)
-{
- float partial[3] = {0.0f, 0.0f, 0.0f};
- int total = 0;
- int i;
-
- for(i = 0; i < t->total; i++) {
- if (t->data[i].flag & TD_SELECTED) {
- if (!(t->data[i].flag & TD_NOCENTER))
- {
- VecAddf(partial, partial, t->data[i].center);
- total++;
- }
- }
- else {
- /*
- All the selected elements are at the head of the array
- which means we can stop when it finds unselected data
- */
- break;
- }
- }
- if(i)
- VecMulf(partial, 1.0f / total);
- VECCOPY(t->center, partial);
-
- calculateCenter2D(t);
-}
-
-void calculateCenterBound(TransInfo *t)
-{
- float max[3];
- float min[3];
- int i;
- for(i = 0; i < t->total; i++) {
- if (i) {
- if (t->data[i].flag & TD_SELECTED) {
- if (!(t->data[i].flag & TD_NOCENTER))
- MinMax3(min, max, t->data[i].center);
- }
- else {
- /*
- All the selected elements are at the head of the array
- which means we can stop when it finds unselected data
- */
- break;
- }
- }
- else {
- VECCOPY(max, t->data[i].center);
- VECCOPY(min, t->data[i].center);
- }
- }
- VecAddf(t->center, min, max);
- VecMulf(t->center, 0.5);
-
- calculateCenter2D(t);
-}
-
-void calculateCenter(TransInfo *t)
-{
- switch(t->around) {
- case V3D_CENTER:
- calculateCenterBound(t);
- break;
- case V3D_CENTROID:
- calculateCenterMedian(t);
- break;
- case V3D_CURSOR:
- if(t->spacetype==SPACE_IMAGE)
- calculateCenterCursor2D(t);
- else
- calculateCenterCursor(t);
- break;
- case V3D_LOCAL:
- /* Individual element center uses median center for helpline and such */
- calculateCenterMedian(t);
- break;
- case V3D_ACTIVE:
- {
- /* set median, and if if if... do object center */
- EditSelection ese;
- /* EDIT MODE ACTIVE EDITMODE ELEMENT */
- if (G.obedit && G.obedit->type == OB_MESH && EM_get_actSelection(&ese)) {
- EM_editselection_center(t->center, &ese);
- calculateCenter2D(t);
- break;
- } /* END EDIT MODE ACTIVE ELEMENT */
-
- calculateCenterMedian(t);
- if((t->flag & (T_EDIT|T_POSE))==0) {
- Object *ob= OBACT;
- if(ob) {
- VECCOPY(t->center, ob->obmat[3]);
- projectIntView(t, t->center, t->center2d);
- }
- }
-
- }
- }
-
- /* setting constraint center */
- VECCOPY(t->con.center, t->center);
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, t->con.center);
- }
-
- /* voor panning from cameraview */
- if(t->flag & T_OBJECT) {
- if( G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB) {
- float axis[3];
- /* persinv is nasty, use viewinv instead, always right */
- VECCOPY(axis, t->viewinv[2]);
- Normalize(axis);
-
- /* 6.0 = 6 grid units */
- axis[0]= t->center[0]- 6.0f*axis[0];
- axis[1]= t->center[1]- 6.0f*axis[1];
- axis[2]= t->center[2]- 6.0f*axis[2];
-
- projectIntView(t, axis, t->center2d);
-
- /* rotate only needs correct 2d center, grab needs initgrabz() value */
- if(t->mode==TFM_TRANSLATION) {
- VECCOPY(t->center, axis);
- VECCOPY(t->con.center, t->center);
- }
- }
- }
-
- if(t->spacetype==SPACE_VIEW3D)
- initgrabz(t->center[0], t->center[1], t->center[2]);
-}
-
-void calculatePropRatio(TransInfo *t)
-{
- TransData *td = t->data;
- int i;
- float dist;
- short connected = t->flag & T_PROP_CONNECTED;
-
- if (t->flag & T_PROP_EDIT) {
- for(i = 0 ; i < t->total; i++, td++) {
- if (td->flag & TD_SELECTED) {
- td->factor = 1.0f;
- }
- else if ((connected &&
- (td->flag & TD_NOTCONNECTED || td->dist > t->propsize))
- ||
- (connected == 0 &&
- td->rdist > t->propsize)) {
- /*
- The elements are sorted according to their dist member in the array,
- that means we can stop when it finds one element outside of the propsize.
- */
- td->flag |= TD_NOACTION;
- td->factor = 0.0f;
- restoreElement(td);
- }
- else {
- /* Use rdist for falloff calculations, it is the real distance */
- td->flag &= ~TD_NOACTION;
- dist= (t->propsize-td->rdist)/t->propsize;
-
- /*
- * Clamp to positive numbers.
- * Certain corner cases with connectivity and individual centers
- * can give values of rdist larger than propsize.
- */
- if (dist < 0.0f)
- dist = 0.0f;
-
- switch(G.scene->prop_mode) {
- case PROP_SHARP:
- td->factor= dist*dist;
- break;
- case PROP_SMOOTH:
- td->factor= 3.0f*dist*dist - 2.0f*dist*dist*dist;
- break;
- case PROP_ROOT:
- td->factor = (float)sqrt(dist);
- break;
- case PROP_LIN:
- td->factor = dist;
- break;
- case PROP_CONST:
- td->factor = 1.0f;
- break;
- case PROP_SPHERE:
- td->factor = (float)sqrt(2*dist - dist * dist);
- break;
- case PROP_RANDOM:
- BLI_srand( BLI_rand() ); /* random seed */
- td->factor = BLI_frand()*dist;
- break;
- default:
- td->factor = 1;
- }
- }
- }
- switch(G.scene->prop_mode) {
- case PROP_SHARP:
- strcpy(t->proptext, "(Sharp)");
- break;
- case PROP_SMOOTH:
- strcpy(t->proptext, "(Smooth)");
- break;
- case PROP_ROOT:
- strcpy(t->proptext, "(Root)");
- break;
- case PROP_LIN:
- strcpy(t->proptext, "(Linear)");
- break;
- case PROP_CONST:
- strcpy(t->proptext, "(Constant)");
- break;
- case PROP_SPHERE:
- strcpy(t->proptext, "(Sphere)");
- break;
- case PROP_RANDOM:
- strcpy(t->proptext, "(Random)");
- break;
- default:
- strcpy(t->proptext, "");
- }
- }
- else {
- for(i = 0 ; i < t->total; i++, td++) {
- td->factor = 1.0;
- }
- strcpy(t->proptext, "");
- }
-}
-
-TransInfo * BIF_GetTransInfo() {
- return &Trans;
-}
-
diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c
deleted file mode 100644
index b5a5ecd05ce..00000000000
--- a/source/blender/src/transform_manipulator.c
+++ /dev/null
@@ -1,1701 +0,0 @@
-/**
-* $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include <io.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_armature.h"
-#include "BKE_global.h"
-#include "BKE_lattice.h"
-#include "BKE_object.h"
-#include "BKE_particle.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "BIF_editarmature.h"
-#include "BIF_gl.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_transform.h"
-#include "BIF_editmesh.h"
-#include "BIF_editparticle.h"
-
-#include "BSE_edit.h"
-#include "BSE_view.h"
-#include "BDR_drawobject.h"
-
-#include "blendef.h"
-#include "transform.h"
-
-/* return codes for select, and drawing flags */
-
-#define MAN_TRANS_X 1
-#define MAN_TRANS_Y 2
-#define MAN_TRANS_Z 4
-#define MAN_TRANS_C 7
-
-#define MAN_ROT_X 8
-#define MAN_ROT_Y 16
-#define MAN_ROT_Z 32
-#define MAN_ROT_V 64
-#define MAN_ROT_T 128
-#define MAN_ROT_C 248
-
-#define MAN_SCALE_X 256
-#define MAN_SCALE_Y 512
-#define MAN_SCALE_Z 1024
-#define MAN_SCALE_C 1792
-
-/* color codes */
-
-#define MAN_RGB 0
-#define MAN_GHOST 1
-#define MAN_MOVECOL 2
-
-/* GLOBAL VARIABLE THAT SHOULD MOVED TO SCREEN MEMBER OR SOMETHING */
-extern TransInfo Trans;
-
-
-static int is_mat4_flipped(float mat[][4])
-{
- float vec[3];
-
- Crossf(vec, mat[0], mat[1]);
- if( Inpf(vec, mat[2]) < 0.0 ) return 1;
- return 0;
-}
-
-/* transform widget center calc helper for below */
-static void calc_tw_center(float *co)
-{
- float *twcent= G.scene->twcent;
- float *min= G.scene->twmin;
- float *max= G.scene->twmax;
-
- DO_MINMAX(co, min, max);
- VecAddf(twcent, twcent, co);
-}
-
-static void protectflag_to_drawflags(short protectflag, short *drawflags)
-{
- if(protectflag & OB_LOCK_LOCX)
- *drawflags &= ~MAN_TRANS_X;
- if(protectflag & OB_LOCK_LOCY)
- *drawflags &= ~MAN_TRANS_Y;
- if(protectflag & OB_LOCK_LOCZ)
- *drawflags &= ~MAN_TRANS_Z;
-
- if(protectflag & OB_LOCK_ROTX)
- *drawflags &= ~MAN_ROT_X;
- if(protectflag & OB_LOCK_ROTY)
- *drawflags &= ~MAN_ROT_Y;
- if(protectflag & OB_LOCK_ROTZ)
- *drawflags &= ~MAN_ROT_Z;
-
- if(protectflag & OB_LOCK_SCALEX)
- *drawflags &= ~MAN_SCALE_X;
- if(protectflag & OB_LOCK_SCALEY)
- *drawflags &= ~MAN_SCALE_Y;
- if(protectflag & OB_LOCK_SCALEZ)
- *drawflags &= ~MAN_SCALE_Z;
-}
-
-/* for pose mode */
-static void stats_pose(View3D *v3d, bPoseChannel *pchan)
-{
- Bone *bone= pchan->bone;
-
- if(bone) {
- if (bone->flag & BONE_TRANSFORM) {
- calc_tw_center(pchan->pose_head);
- protectflag_to_drawflags(pchan->protectflag, &v3d->twdrawflag);
- }
- }
-}
-
-/* for editmode*/
-static void stats_editbone(View3D *v3d, EditBone *ebo)
-{
- if (ebo->flag & BONE_EDITMODE_LOCKED)
- protectflag_to_drawflags(OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE, &v3d->twdrawflag);
-}
-
-/* only counts the parent selection, and tags transform flag */
-/* bad call... should re-use method from transform_conversion once */
-static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it)
-{
- Bone *bone;
- int do_next;
-
- for(bone= lb->first; bone; bone= bone->next) {
- bone->flag &= ~BONE_TRANSFORM;
- do_next= do_it;
- if(do_it) {
- if(bone->layer & arm->layer) {
- if (bone->flag & BONE_SELECTED) {
- /* We don't let connected children get "grabbed" */
- if ( (t->mode!=TFM_TRANSLATION) || (bone->flag & BONE_CONNECTED)==0 ) {
- bone->flag |= BONE_TRANSFORM;
- t->total++;
- do_next= 0; // no transform on children if one parent bone is selected
- }
- }
- }
- }
- count_bone_select(t, arm, &bone->childbase, do_next);
- }
-}
-
-/* centroid, boundbox, of selection */
-/* returns total items selected */
-int calc_manipulator_stats(ScrArea *sa)
-{
- extern ListBase editNurb;
- TransInfo *t;
- View3D *v3d= sa->spacedata.first;
- Base *base;
- Object *ob= OBACT;
- float normal[3]={0.0, 0.0, 0.0};
- float plane[3]={0.0, 0.0, 0.0};
- int a, totsel=0;
-
- t = BIF_GetTransInfo();
-
- /* transform widget matrix */
- Mat4One(v3d->twmat);
-
- v3d->twdrawflag= 0xFFFF;
-
- /* transform widget centroid/center */
- G.scene->twcent[0]= G.scene->twcent[1]= G.scene->twcent[2]= 0.0f;
- INIT_MINMAX(G.scene->twmin, G.scene->twmax);
-
- if(G.obedit) {
- ob= G.obedit;
- if((ob->lay & G.vd->lay)==0) return 0;
-
- if(G.obedit->type==OB_MESH) {
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditSelection ese;
- float vec[3]= {0,0,0};
-
- /* USE LAST SELECTE WITH ACTIVE */
- if (G.vd->around==V3D_ACTIVE && EM_get_actSelection(&ese)) {
- EM_editselection_center(vec, &ese);
- calc_tw_center(vec);
- totsel= 1;
- } else {
- /* do vertices for center, and if still no normal found, use vertex normals */
- for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->f & SELECT) {
- totsel++;
- calc_tw_center(eve->co);
- }
- }
- }
- } /* end editmesh */
- else if (G.obedit->type==OB_ARMATURE){
- bArmature *arm= G.obedit->data;
- EditBone *ebo;
- for (ebo=G.edbo.first;ebo;ebo=ebo->next){
- if(ebo->layer & arm->layer) {
- if (ebo->flag & BONE_TIPSEL) {
- calc_tw_center(ebo->tail);
- totsel++;
- }
- if (ebo->flag & BONE_ROOTSEL) {
- calc_tw_center(ebo->head);
- totsel++;
- }
- if (ebo->flag & BONE_SELECTED) {
- stats_editbone(v3d, ebo);
- }
- }
- }
- }
- else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT) {
- Nurb *nu;
- BezTriple *bezt;
- BPoint *bp;
-
- nu= editNurb.first;
- while(nu) {
- if((nu->type & 7)==CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--) {
- /* exceptions
- * if handles are hidden then only check the center points.
- * If 2 or more are selected then only use the center point too.
- */
- if (G.f & G_HIDDENHANDLES) {
- if (bezt->f2 & SELECT) {
- calc_tw_center(bezt->vec[1]);
- totsel++;
- }
- }
- else if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT ) {
- calc_tw_center(bezt->vec[1]);
- totsel++;
- }
- else {
- if(bezt->f1) {
- calc_tw_center(bezt->vec[0]);
- totsel++;
- }
- if(bezt->f2) {
- calc_tw_center(bezt->vec[1]);
- totsel++;
- }
- if(bezt->f3) {
- calc_tw_center(bezt->vec[2]);
- totsel++;
- }
- }
- bezt++;
- }
- }
- else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
- while(a--) {
- if(bp->f1 & SELECT) {
- calc_tw_center(bp->vec);
- totsel++;
- }
- bp++;
- }
- }
- nu= nu->next;
- }
- }
- else if(G.obedit->type==OB_MBALL) {
- /* editmball.c */
- extern ListBase editelems; /* go away ! */
- MetaElem *ml, *ml_sel=NULL;
-
- ml= editelems.first;
- while(ml) {
- if(ml->flag & SELECT) {
- calc_tw_center(&ml->x);
- ml_sel = ml;
- totsel++;
- }
- ml= ml->next;
- }
- }
- else if(G.obedit->type==OB_LATTICE) {
- BPoint *bp;
- bp= editLatt->def;
-
- a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
- while(a--) {
- if(bp->f1 & SELECT) {
- calc_tw_center(bp->vec);
- totsel++;
- }
- bp++;
- }
- }
-
- /* selection center */
- if(totsel) {
- VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid!
- Mat4MulVecfl(G.obedit->obmat, G.scene->twcent);
- Mat4MulVecfl(G.obedit->obmat, G.scene->twmin);
- Mat4MulVecfl(G.obedit->obmat, G.scene->twmax);
- }
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- bArmature *arm = ob->data;
- bPoseChannel *pchan;
- int mode;
-
- if((ob->lay & G.vd->lay)==0) return 0;
-
- mode = Trans.mode;
- Trans.mode = TFM_ROTATION; // mislead counting bones... bah
-
- /* count total, we use same method as transform will do */
- Trans.total= 0;
- count_bone_select(&Trans, arm, &arm->bonebase, 1);
- totsel = Trans.total;
- if(totsel) {
- /* use channels to get stats */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- stats_pose(v3d, pchan);
- }
-
- VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid!
- Mat4MulVecfl(ob->obmat, G.scene->twcent);
- Mat4MulVecfl(ob->obmat, G.scene->twmin);
- Mat4MulVecfl(ob->obmat, G.scene->twmax);
- }
- /* restore, mode can be TFM_INIT */
- Trans.mode = mode;
- }
- else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) {
- ;
- }
- else if(G.f & G_PARTICLEEDIT) {
- ParticleSystem *psys=PE_get_current(OBACT);
- ParticleData *pa = psys->particles;
- ParticleEditKey *ek;
- int k;
-
- if(psys->edit){
- for(a=0; a<psys->totpart; a++,pa++){
- if(pa->flag & PARS_HIDE) continue;
- for(k=0, ek=psys->edit->keys[a]; k<pa->totkey; k++,ek++){
- if(ek->flag & PEK_SELECT){
- calc_tw_center(ek->world_co);
- totsel++;
- }
- }
- }
- /* selection center */
- if(totsel)
- VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid!
- }
- }
- else {
-
- /* we need the one selected object, if its not active */
- ob= OBACT;
- if(ob && !(ob->flag & SELECT)) ob= NULL;
-
- for(base= G.scene->base.first; base; base= base->next) {
- if TESTBASELIB(base) {
- if(ob==NULL)
- ob= base->object;
- calc_tw_center(base->object->obmat[3]);
- protectflag_to_drawflags(base->object->protectflag, &v3d->twdrawflag);
- totsel++;
- }
- }
-
- /* selection center */
- if(totsel) {
- VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid!
- }
- }
-
- /* global, local or normal orientation? */
- if(ob && totsel) {
-
- switch(v3d->twmode) {
- case V3D_MANIP_GLOBAL:
- strcpy(t->spacename, "global");
- break;
-
- case V3D_MANIP_NORMAL:
- if(G.obedit || ob->flag & OB_POSEMODE) {
- float mat[3][3];
- int type;
-
- strcpy(t->spacename, "normal");
-
- type = getTransformOrientation(normal, plane, (G.vd->around == V3D_ACTIVE));
-
- switch (type)
- {
- case ORIENTATION_NORMAL:
- if (createSpaceNormalTangent(mat, normal, plane) == 0)
- {
- type = ORIENTATION_NONE;
- }
- break;
- case ORIENTATION_VERT:
- if (createSpaceNormal(mat, normal) == 0)
- {
- type = ORIENTATION_NONE;
- }
- break;
- case ORIENTATION_EDGE:
- if (createSpaceNormalTangent(mat, normal, plane) == 0)
- {
- type = ORIENTATION_NONE;
- }
- break;
- case ORIENTATION_FACE:
- if (createSpaceNormalTangent(mat, normal, plane) == 0)
- {
- type = ORIENTATION_NONE;
- }
- break;
- }
-
- if (type == ORIENTATION_NONE)
- {
- Mat4One(v3d->twmat);
- }
- else
- {
- Mat4CpyMat3(v3d->twmat, mat);
- }
- break;
- }
- /* no break we define 'normal' as 'local' in Object mode */
- case V3D_MANIP_LOCAL:
- strcpy(t->spacename, "local");
- Mat4CpyMat4(v3d->twmat, ob->obmat);
- Mat4Ortho(v3d->twmat);
- break;
-
- case V3D_MANIP_VIEW:
- {
- float mat[3][3];
- strcpy(t->spacename, "view");
- Mat3CpyMat4(mat, v3d->viewinv);
- Mat3Ortho(mat);
- Mat4CpyMat3(v3d->twmat, mat);
- }
- break;
- default: /* V3D_MANIP_CUSTOM */
- applyTransformOrientation();
- break;
- }
-
- }
-
- return totsel;
-}
-
-/* ******************** DRAWING STUFFIES *********** */
-
-static float screen_aligned(float mat[][4])
-{
- float vec[3], size;
-
- VECCOPY(vec, mat[0]);
- size= Normalize(vec);
-
- glTranslatef(mat[3][0], mat[3][1], mat[3][2]);
-
- /* sets view screen aligned */
- glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]);
-
- return size;
-}
-
-
-/* radring = radius of donut rings
- radhole = radius hole
- start = starting segment (based on nrings)
- end = end segment
- nsides = amount of points in ring
- nrigns = amount of rings
-*/
-static void partial_donut(float radring, float radhole, int start, int end, int nsides, int nrings)
-{
- float theta, phi, theta1;
- float cos_theta, sin_theta;
- float cos_theta1, sin_theta1;
- float ring_delta, side_delta;
- int i, j, docaps= 1;
-
- if(start==0 && end==nrings) docaps= 0;
-
- ring_delta= 2.0f*(float)M_PI/(float)nrings;
- side_delta= 2.0f*(float)M_PI/(float)nsides;
-
- theta= (float)M_PI+0.5f*ring_delta;
- cos_theta= (float)cos(theta);
- sin_theta= (float)sin(theta);
-
- for(i= nrings - 1; i >= 0; i--) {
- theta1= theta + ring_delta;
- cos_theta1= (float)cos(theta1);
- sin_theta1= (float)sin(theta1);
-
- if(docaps && i==start) { // cap
- glBegin(GL_POLYGON);
- phi= 0.0;
- for(j= nsides; j >= 0; j--) {
- float cos_phi, sin_phi, dist;
-
- phi += side_delta;
- cos_phi= (float)cos(phi);
- sin_phi= (float)sin(phi);
- dist= radhole + radring * cos_phi;
-
- glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi);
- }
- glEnd();
- }
- if(i>=start && i<=end) {
- glBegin(GL_QUAD_STRIP);
- phi= 0.0;
- for(j= nsides; j >= 0; j--) {
- float cos_phi, sin_phi, dist;
-
- phi += side_delta;
- cos_phi= (float)cos(phi);
- sin_phi= (float)sin(phi);
- dist= radhole + radring * cos_phi;
-
- glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi);
- glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi);
- }
- glEnd();
- }
-
- if(docaps && i==end) { // cap
- glBegin(GL_POLYGON);
- phi= 0.0;
- for(j= nsides; j >= 0; j--) {
- float cos_phi, sin_phi, dist;
-
- phi -= side_delta;
- cos_phi= (float)cos(phi);
- sin_phi= (float)sin(phi);
- dist= radhole + radring * cos_phi;
-
- glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi);
- }
- glEnd();
- }
-
-
- theta= theta1;
- cos_theta= cos_theta1;
- sin_theta= sin_theta1;
- }
-}
-
-/* three colors can be set;
- grey for ghosting
- moving: in transform theme color
- else the red/green/blue
-*/
-static void manipulator_setcolor(char axis, int colcode)
-{
- float vec[4];
- char col[4];
-
- vec[3]= 0.7f; // alpha set on 0.5, can be glEnabled or not
-
- if(colcode==MAN_GHOST) {
- glColor4ub(0, 0, 0, 70);
- }
- else if(colcode==MAN_MOVECOL) {
- BIF_GetThemeColor3ubv(TH_TRANSFORM, col);
- glColor4ub(col[0], col[1], col[2], 128);
- }
- else {
- switch(axis) {
- case 'c':
- BIF_GetThemeColor3ubv(TH_TRANSFORM, col);
- if(G.vd->twmode == V3D_MANIP_LOCAL) {
- col[0]= col[0]>200?255:col[0]+55;
- col[1]= col[1]>200?255:col[1]+55;
- col[2]= col[2]>200?255:col[2]+55;
- }
- else if(G.vd->twmode == V3D_MANIP_NORMAL) {
- col[0]= col[0]<55?0:col[0]-55;
- col[1]= col[1]<55?0:col[1]-55;
- col[2]= col[2]<55?0:col[2]-55;
- }
- glColor4ub(col[0], col[1], col[2], 128);
- break;
- case 'x':
- glColor4ub(220, 0, 0, 128);
- break;
- case 'y':
- glColor4ub(0, 220, 0, 128);
- break;
- case 'z':
- glColor4ub(30, 30, 220, 128);
- break;
- }
- }
-}
-
-/* viewmatrix should have been set OK, also no shademode! */
-static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz)
-{
-
- /* axes */
- if(flagx) {
- manipulator_setcolor('x', colcode);
- if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X);
- else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X);
- glBegin(GL_LINES);
- glVertex3f(0.2f, 0.0f, 0.0f);
- glVertex3f(1.0f, 0.0f, 0.0f);
- glEnd();
- }
- if(flagy) {
- if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y);
- else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y);
- manipulator_setcolor('y', colcode);
- glBegin(GL_LINES);
- glVertex3f(0.0f, 0.2f, 0.0f);
- glVertex3f(0.0f, 1.0f, 0.0f);
- glEnd();
- }
- if(flagz) {
- if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z);
- else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z);
- manipulator_setcolor('z', colcode);
- glBegin(GL_LINES);
- glVertex3f(0.0f, 0.0f, 0.2f);
- glVertex3f(0.0f, 0.0f, 1.0f);
- glEnd();
- }
-}
-
-/* only called while G.moving */
-static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags)
-{
- GLUquadricObj *qobj;
- float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3];
- int arcs= (G.rt!=2);
-
- glDisable(GL_DEPTH_TEST);
-
- qobj= gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_FILL);
-
- glColor4ub(0,0,0,64);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
-
- /* we need both [4][4] transforms, Trans.mat seems to be premul, not post for mat[][4] */
- Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3]
- Mat4MulMat34(matt, Trans.mat, mat);
-
- /* Screen aligned view rot circle */
- if(drawflags & MAN_ROT_V) {
-
- /* prepare for screen aligned draw */
- glPushMatrix();
- size= screen_aligned(mat);
-
- vec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]);
- vec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]);
- vec[2]= 0.0f;
- Normalize(vec);
-
- startphi= saacos( vec[1] );
- if(vec[0]<0.0) startphi= -startphi;
-
- phi= (float)fmod(180.0*Trans.val/M_PI, 360.0);
- if(phi > 180.0) phi-= 360.0;
- else if(phi<-180.0) phi+= 360.0;
-
- gluPartialDisk(qobj, 0.0, size, 32, 1, 180.0*startphi/M_PI, phi);
-
- glPopMatrix();
- }
- else if(arcs) {
- float imat[3][3], ivmat[3][3];
- /* try to get the start rotation */
-
- svec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]);
- svec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]);
- svec[2]= 0.0f;
-
- /* screen aligned vec transform back to manipulator space */
- Mat3CpyMat4(ivmat, G.vd->viewinv);
- Mat3CpyMat4(tmat, mat);
- Mat3Inv(imat, tmat);
- Mat3MulMat3(tmat, imat, ivmat);
-
- Mat3MulVecfl(tmat, svec); // tmat is used further on
- Normalize(svec);
- }
-
- mymultmatrix(mat); // aligns with original widget
-
- /* Z disk */
- if(drawflags & MAN_ROT_Z) {
- if(arcs) {
- /* correct for squeezed arc */
- svec[0]+= tmat[2][0];
- svec[1]+= tmat[2][1];
- Normalize(svec);
-
- startphi= (float)atan2(svec[0], svec[1]);
- }
- else startphi= 0.5f*(float)M_PI;
-
- VECCOPY(vec, mat[0]); // use x axis to detect rotation
- Normalize(vec);
- Normalize(matt[0]);
- phi= saacos( Inpf(vec, matt[0]) );
- if(phi!=0.0) {
- Crossf(cross, vec, matt[0]); // results in z vector
- if(Inpf(cross, mat[2]) > 0.0) phi= -phi;
- gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*(phi)/M_PI);
- }
- }
- /* X disk */
- if(drawflags & MAN_ROT_X) {
- if(arcs) {
- /* correct for squeezed arc */
- svec[1]+= tmat[2][1];
- svec[2]+= tmat[2][2];
- Normalize(svec);
-
- startphi= (float)(M_PI + atan2(svec[2], -svec[1]));
- }
- else startphi= 0.0f;
-
- VECCOPY(vec, mat[1]); // use y axis to detect rotation
- Normalize(vec);
- Normalize(matt[1]);
- phi= saacos( Inpf(vec, matt[1]) );
- if(phi!=0.0) {
- Crossf(cross, vec, matt[1]); // results in x vector
- if(Inpf(cross, mat[0]) > 0.0) phi= -phi;
- glRotatef(90.0, 0.0, 1.0, 0.0);
- gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI);
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- }
- }
- /* Y circle */
- if(drawflags & MAN_ROT_Y) {
- if(arcs) {
- /* correct for squeezed arc */
- svec[0]+= tmat[2][0];
- svec[2]+= tmat[2][2];
- Normalize(svec);
-
- startphi= (float)(M_PI + atan2(-svec[0], svec[2]));
- }
- else startphi= (float)M_PI;
-
- VECCOPY(vec, mat[2]); // use z axis to detect rotation
- Normalize(vec);
- Normalize(matt[2]);
- phi= saacos( Inpf(vec, matt[2]) );
- if(phi!=0.0) {
- Crossf(cross, vec, matt[2]); // results in y vector
- if(Inpf(cross, mat[1]) > 0.0) phi= -phi;
- glRotatef(-90.0, 1.0, 0.0, 0.0);
- gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI);
- glRotatef(90.0, 1.0, 0.0, 0.0);
- }
- }
-
- glDisable(GL_BLEND);
- myloadmatrix(G.vd->viewmat);
-}
-
-static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, int combo)
-{
- GLUquadricObj *qobj;
- double plane[4];
- float size, vec[3], unitmat[4][4];
- float cywid= 0.33f*0.01f*(float)U.tw_handlesize;
- float cusize= cywid*0.65f;
- int arcs= (G.rt!=2);
- int colcode;
-
- if(moving) colcode= MAN_MOVECOL;
- else colcode= MAN_RGB;
-
- /* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_ROT_C)==0) return;
-
- /* Init stuff */
- glDisable(GL_DEPTH_TEST);
- Mat4One(unitmat);
-
- qobj= gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_FILL);
-
- /* prepare for screen aligned draw */
- VECCOPY(vec, mat[0]);
- size= Normalize(vec);
- glPushMatrix();
- glTranslatef(mat[3][0], mat[3][1], mat[3][2]);
-
- if(arcs) {
- /* clipplane makes nice handles, calc here because of multmatrix but with translate! */
- VECCOPY(plane, G.vd->viewinv[2]);
- plane[3]= -0.02*size; // clip just a bit more
- glClipPlane(GL_CLIP_PLANE0, plane);
- }
- /* sets view screen aligned */
- glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]);
-
- /* Screen aligned help circle */
- if(arcs) {
- if((G.f & G_PICKSEL)==0) {
- BIF_ThemeColorShade(TH_BACK, -30);
- drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
- }
- }
- /* Screen aligned view rot circle */
- if(drawflags & MAN_ROT_V) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
- BIF_ThemeColor(TH_TRANSFORM);
- drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
-
- if(moving) {
- float vec[3];
- vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]);
- vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]);
- vec[2]= 0.0f;
- Normalize(vec);
- VecMulf(vec, 1.2f*size);
- glBegin(GL_LINES);
- glVertex3f(0.0f, 0.0f, 0.0f);
- glVertex3fv(vec);
- glEnd();
- }
- }
- glPopMatrix();
-
- /* apply the transform delta */
- if(moving) {
- float matt[4][4];
- Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3]
- Mat4MulMat34(matt, Trans.mat, mat);
- mymultmatrix(matt);
- glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW);
- }
- else {
- glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW);
- mymultmatrix(mat);
- }
-
- /* axes */
- if(arcs==0) {
- if(!(G.f & G_PICKSEL)) {
- if( (combo & V3D_MANIP_SCALE)==0) {
- /* axis */
- glBegin(GL_LINES);
- if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) {
- manipulator_setcolor('x', colcode);
- glVertex3f(0.2f, 0.0f, 0.0f);
- glVertex3f(1.0f, 0.0f, 0.0f);
- }
- if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) {
- manipulator_setcolor('y', colcode);
- glVertex3f(0.0f, 0.2f, 0.0f);
- glVertex3f(0.0f, 1.0f, 0.0f);
- }
- if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) {
- manipulator_setcolor('z', colcode);
- glVertex3f(0.0f, 0.0f, 0.2f);
- glVertex3f(0.0f, 0.0f, 1.0f);
- }
- glEnd();
- }
- }
- }
-
- if(arcs==0 && moving) {
-
- /* Z circle */
- if(drawflags & MAN_ROT_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor('z', colcode);
- drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
- }
- /* X circle */
- if(drawflags & MAN_ROT_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
- glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor('x', colcode);
- drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- }
- /* Y circle */
- if(drawflags & MAN_ROT_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
- glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor('y', colcode);
- drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
- glRotatef(90.0, 1.0, 0.0, 0.0);
- }
-
- if(arcs) glDisable(GL_CLIP_PLANE0);
- }
- // donut arcs
- if(arcs) {
- glEnable(GL_CLIP_PLANE0);
-
- /* Z circle */
- if(drawflags & MAN_ROT_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor('z', colcode);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
- }
- /* X circle */
- if(drawflags & MAN_ROT_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
- glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor('x', colcode);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- }
- /* Y circle */
- if(drawflags & MAN_ROT_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
- glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor('y', colcode);
- partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
- glRotatef(90.0, 1.0, 0.0, 0.0);
- }
-
- glDisable(GL_CLIP_PLANE0);
- }
-
- if(arcs==0) {
-
- /* Z handle on X axis */
- if(drawflags & MAN_ROT_Z) {
- glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor('z', colcode);
-
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
-
- glPopMatrix();
- }
-
- /* Y handle on X axis */
- if(drawflags & MAN_ROT_Y) {
- glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
- manipulator_setcolor('y', colcode);
-
- glRotatef(90.0, 1.0, 0.0, 0.0);
- glRotatef(90.0, 0.0, 0.0, 1.0);
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
-
- glPopMatrix();
- }
-
- /* X handle on Z axis */
- if(drawflags & MAN_ROT_X) {
- glPushMatrix();
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
- manipulator_setcolor('x', colcode);
-
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- glRotatef(90.0, 0.0, 0.0, 1.0);
- partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
-
- glPopMatrix();
- }
-
- }
-
- /* restore */
- myloadmatrix(G.vd->viewmat);
- gluDeleteQuadric(qobj);
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
-}
-
-static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, int combo, int colcode)
-{
- float cywid= 0.25f*0.01f*(float)U.tw_handlesize;
- float cusize= cywid*0.75f, dz;
-
- /* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_SCALE_C)==0) return;
-
- glDisable(GL_DEPTH_TEST);
-
- /* not in combo mode */
- if( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) {
- float size, unitmat[4][4];
-
- /* center circle, do not add to selection when shift is pressed (planar constraint) */
- if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_SCALE_C);
-
- manipulator_setcolor('c', colcode);
- glPushMatrix();
- size= screen_aligned(mat);
- Mat4One(unitmat);
- drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat);
- glPopMatrix();
-
- dz= 1.0;
- }
- else dz= 1.0f-4.0f*cusize;
-
- if(moving) {
- float matt[4][4];
-
- Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3]
- Mat4MulMat34(matt, Trans.mat, mat);
- mymultmatrix(matt);
- glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW);
- }
- else {
- mymultmatrix(mat);
- glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW);
- }
-
- /* axis */
-
- /* in combo mode, this is always drawn as first type */
- draw_manipulator_axes(colcode, drawflags & MAN_SCALE_X, drawflags & MAN_SCALE_Y, drawflags & MAN_SCALE_Z);
-
- /* Z cube */
- glTranslatef(0.0, 0.0, dz);
- if(drawflags & MAN_SCALE_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z);
- manipulator_setcolor('z', colcode);
- drawsolidcube(cusize);
- }
- /* X cube */
- glTranslatef(dz, 0.0, -dz);
- if(drawflags & MAN_SCALE_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X);
- manipulator_setcolor('x', colcode);
- drawsolidcube(cusize);
- }
- /* Y cube */
- glTranslatef(-dz, dz, 0.0);
- if(drawflags & MAN_SCALE_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y);
- manipulator_setcolor('y', colcode);
- drawsolidcube(cusize);
- }
-
- /* if shiftkey, center point as last, for selectbuffer order */
- if(G.f & G_PICKSEL) {
- if(G.qual & LR_SHIFTKEY) {
- glTranslatef(0.0, -dz, 0.0);
- glLoadName(MAN_SCALE_C);
- glBegin(GL_POINTS);
- glVertex3f(0.0, 0.0, 0.0);
- glEnd();
- }
- }
-
- /* restore */
- myloadmatrix(G.vd->viewmat);
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- glFrontFace(GL_CCW);
-}
-
-
-static void draw_cone(GLUquadricObj *qobj, float len, float width)
-{
- glTranslatef(0.0, 0.0, -0.5f*len);
- gluCylinder(qobj, width, 0.0, len, 8, 1);
- gluQuadricOrientation(qobj, GLU_INSIDE);
- gluDisk(qobj, 0.0, width, 8, 1);
- gluQuadricOrientation(qobj, GLU_OUTSIDE);
- glTranslatef(0.0, 0.0, 0.5f*len);
-}
-
-static void draw_cylinder(GLUquadricObj *qobj, float len, float width)
-{
-
- width*= 0.8f; // just for beauty
-
- glTranslatef(0.0, 0.0, -0.5f*len);
- gluCylinder(qobj, width, width, len, 8, 1);
- gluQuadricOrientation(qobj, GLU_INSIDE);
- gluDisk(qobj, 0.0, width, 8, 1);
- gluQuadricOrientation(qobj, GLU_OUTSIDE);
- glTranslatef(0.0, 0.0, len);
- gluDisk(qobj, 0.0, width, 8, 1);
- glTranslatef(0.0, 0.0, -0.5f*len);
-}
-
-
-static void draw_manipulator_translate(float mat[][4], int moving, int drawflags, int combo, int colcode)
-{
- GLUquadricObj *qobj;
- float cylen= 0.01f*(float)U.tw_handlesize;
- float cywid= 0.25f*cylen, dz, size;
- float unitmat[4][4];
-
- /* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_TRANS_C)==0) return;
-
- if(moving) glTranslatef(Trans.vec[0], Trans.vec[1], Trans.vec[2]);
- glDisable(GL_DEPTH_TEST);
-
- qobj= gluNewQuadric();
- gluQuadricDrawStyle(qobj, GLU_FILL);
-
- /* center circle, do not add to selection when shift is pressed (planar constraint) */
- if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_TRANS_C);
-
- manipulator_setcolor('c', colcode);
- glPushMatrix();
- size= screen_aligned(mat);
- Mat4One(unitmat);
- drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat);
- glPopMatrix();
-
- /* and now apply matrix, we move to local matrix drawing */
- mymultmatrix(mat);
-
- /* axis */
- glLoadName(-1);
-
- // translate drawn as last, only axis when no combo with scale, or for ghosting
- if((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST)
- draw_manipulator_axes(colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z);
-
-
- /* offset in combo mode, for rotate a bit more */
- if(combo & (V3D_MANIP_ROTATE)) dz= 1.0f+2.0f*cylen;
- else if(combo & (V3D_MANIP_SCALE)) dz= 1.0f+0.5f*cylen;
- else dz= 1.0f;
-
- /* Z Cone */
- glTranslatef(0.0, 0.0, dz);
- if(drawflags & MAN_TRANS_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z);
- manipulator_setcolor('z', colcode);
- draw_cone(qobj, cylen, cywid);
- }
- /* X Cone */
- glTranslatef(dz, 0.0, -dz);
- if(drawflags & MAN_TRANS_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X);
- glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor('x', colcode);
- draw_cone(qobj, cylen, cywid);
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- }
- /* Y Cone */
- glTranslatef(-dz, dz, 0.0);
- if(drawflags & MAN_TRANS_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y);
- glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor('y', colcode);
- draw_cone(qobj, cylen, cywid);
- }
-
- gluDeleteQuadric(qobj);
- myloadmatrix(G.vd->viewmat);
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
-}
-
-static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflags, int combo, int colcode)
-{
- GLUquadricObj *qobj;
- float size;
- float cylen= 0.01f*(float)U.tw_handlesize;
- float cywid= 0.25f*cylen;
-
- /* when called while moving in mixed mode, do not draw when... */
- if((drawflags & MAN_ROT_C)==0) return;
-
- /* prepare for screen aligned draw */
- glPushMatrix();
- size= screen_aligned(mat);
-
- glDisable(GL_DEPTH_TEST);
-
- qobj= gluNewQuadric();
-
- /* Screen aligned view rot circle */
- if(drawflags & MAN_ROT_V) {
- float unitmat[4][4];
- Mat4One(unitmat);
-
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V);
- BIF_ThemeColor(TH_TRANSFORM);
- drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat);
-
- if(moving) {
- float vec[3];
- vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]);
- vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]);
- vec[2]= 0.0f;
- Normalize(vec);
- VecMulf(vec, 1.2f*size);
- glBegin(GL_LINES);
- glVertex3f(0.0, 0.0, 0.0);
- glVertex3fv(vec);
- glEnd();
- }
- }
- glPopMatrix();
-
- /* apply the transform delta */
- if(moving) {
- float matt[4][4];
- Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3]
- if (Trans.flag & T_USES_MANIPULATOR) {
- Mat4MulMat34(matt, Trans.mat, mat);
- }
- mymultmatrix(matt);
- }
- else {
- mymultmatrix(mat);
- }
-
- glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW);
-
- /* axis */
- if( (G.f & G_PICKSEL)==0 ) {
-
- // only draw axis when combo didn't draw scale axes
- if((combo & V3D_MANIP_SCALE)==0)
- draw_manipulator_axes(colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z);
-
- /* only has to be set when not in picking */
- gluQuadricDrawStyle(qobj, GLU_FILL);
- }
-
- /* Z cyl */
- glTranslatef(0.0, 0.0, 1.0);
- if(drawflags & MAN_ROT_Z) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor('z', colcode);
- draw_cylinder(qobj, cylen, cywid);
- }
- /* X cyl */
- glTranslatef(1.0, 0.0, -1.0);
- if(drawflags & MAN_ROT_X) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
- glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor('x', colcode);
- draw_cylinder(qobj, cylen, cywid);
- glRotatef(-90.0, 0.0, 1.0, 0.0);
- }
- /* Y cylinder */
- glTranslatef(-1.0, 1.0, 0.0);
- if(drawflags & MAN_ROT_Y) {
- if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
- glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor('y', colcode);
- draw_cylinder(qobj, cylen, cywid);
- }
-
- /* restore */
-
- gluDeleteQuadric(qobj);
- myloadmatrix(G.vd->viewmat);
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
-
-}
-
-
-/* ********************************************* */
-
-float get_drawsize(View3D *v3d, float *co)
-{
- ScrArea *sa = v3d->area;
- float size, vec[3], len1, len2;
-
- /* size calculus, depending ortho/persp settings, like initgrabz() */
- size= v3d->persmat[0][3]*co[0]+ v3d->persmat[1][3]*co[1]+ v3d->persmat[2][3]*co[2]+ v3d->persmat[3][3];
-
- VECCOPY(vec, v3d->persinv[0]);
- len1= Normalize(vec);
- VECCOPY(vec, v3d->persinv[1]);
- len2= Normalize(vec);
-
- size*= 0.01f*(len1>len2?len1:len2);
-
- /* correct for window size to make widgets appear fixed size */
- if(sa->winx > sa->winy) size*= 1000.0f/(float)sa->winx;
- else size*= 1000.0f/(float)sa->winy;
-
- return size;
-}
-
-static float get_manipulator_drawsize(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
- float size = get_drawsize(v3d, v3d->twmat[3]);
-
- size*= (float)U.tw_size;
-
- return size;
-}
-
-/* exported to transform_constraints.c */
-/* mat, vec = default orientation and location */
-/* type = transform type */
-/* axis = x, y, z, c */
-/* col: 0 = colored, 1 = moving, 2 = ghost */
-void draw_manipulator_ext(ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3])
-{
- int drawflags= 0;
- float mat4[4][4];
- int colcode;
-
- Mat4CpyMat3(mat4, mat);
- VECCOPY(mat4[3], vec);
-
- Mat4MulFloat3((float *)mat4, get_manipulator_drawsize(sa));
-
- glEnable(GL_BLEND); // let's do it transparent by default
- if(col==0) colcode= MAN_RGB;
- else if(col==1) colcode= MAN_MOVECOL;
- else colcode= MAN_GHOST;
-
-
- if(type==TFM_ROTATION) {
- if(axis=='x') drawflags= MAN_ROT_X;
- else if(axis=='y') drawflags= MAN_ROT_Y;
- else if(axis=='z') drawflags= MAN_ROT_Z;
- else drawflags= MAN_ROT_C;
-
- draw_manipulator_rotate_cyl(mat4, col, drawflags, V3D_MANIP_ROTATE, colcode);
- }
- else if(type==TFM_RESIZE) {
- if(axis=='x') drawflags= MAN_SCALE_X;
- else if(axis=='y') drawflags= MAN_SCALE_Y;
- else if(axis=='z') drawflags= MAN_SCALE_Z;
- else drawflags= MAN_SCALE_C;
-
- draw_manipulator_scale(mat4, col, drawflags, V3D_MANIP_SCALE, colcode);
- }
- else {
- if(axis=='x') drawflags= MAN_TRANS_X;
- else if(axis=='y') drawflags= MAN_TRANS_Y;
- else if(axis=='z') drawflags= MAN_TRANS_Z;
- else drawflags= MAN_TRANS_C;
-
- draw_manipulator_translate(mat4, 0, drawflags, V3D_MANIP_TRANSLATE, colcode);
- }
-
-
- glDisable(GL_BLEND);
-}
-
-/* main call, does calc centers & orientation too */
-/* uses global G.moving */
-static int drawflags= 0xFFFF; // only for the calls below, belongs in scene...?
-void BIF_draw_manipulator(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
- int totsel;
-
- if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return;
- if(G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return;
-
- if(G.moving==0) {
- v3d->twflag &= ~V3D_DRAW_MANIPULATOR;
-
- totsel= calc_manipulator_stats(sa);
- if(totsel==0) return;
- drawflags= v3d->twdrawflag; /* set in calc_manipulator_stats */
-
- v3d->twflag |= V3D_DRAW_MANIPULATOR;
-
- /* now we can define center */
- switch(v3d->around) {
- case V3D_CENTER:
- case V3D_ACTIVE:
- v3d->twmat[3][0]= (G.scene->twmin[0] + G.scene->twmax[0])/2.0f;
- v3d->twmat[3][1]= (G.scene->twmin[1] + G.scene->twmax[1])/2.0f;
- v3d->twmat[3][2]= (G.scene->twmin[2] + G.scene->twmax[2])/2.0f;
- if(v3d->around==V3D_ACTIVE && G.obedit==NULL) {
- Object *ob= OBACT;
- if(ob && !(ob->flag & OB_POSEMODE))
- VECCOPY(v3d->twmat[3], ob->obmat[3]);
- }
- break;
- case V3D_LOCAL:
- case V3D_CENTROID:
- VECCOPY(v3d->twmat[3], G.scene->twcent);
- break;
- case V3D_CURSOR:
- VECCOPY(v3d->twmat[3], give_cursor());
- break;
- }
-
- Mat4MulFloat3((float *)v3d->twmat, get_manipulator_drawsize(sa));
- }
-
- if(v3d->twflag & V3D_DRAW_MANIPULATOR) {
-
- if(v3d->twtype & V3D_MANIP_ROTATE) {
-
- /* rotate has special ghosting draw, for pie chart */
- if(G.moving) draw_manipulator_rotate_ghost(v3d->twmat, drawflags);
-
- if(G.moving) glEnable(GL_BLEND);
-
- if(G.rt==3) {
- if(G.moving) draw_manipulator_rotate_cyl(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL);
- else draw_manipulator_rotate_cyl(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB);
- }
- else
- draw_manipulator_rotate(v3d->twmat, G.moving, drawflags, v3d->twtype);
-
- glDisable(GL_BLEND);
- }
- if(v3d->twtype & V3D_MANIP_SCALE) {
- if(G.moving) {
- glEnable(GL_BLEND);
- draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST);
- draw_manipulator_scale(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL);
- glDisable(GL_BLEND);
- }
- else draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB);
- }
- if(v3d->twtype & V3D_MANIP_TRANSLATE) {
- if(G.moving) {
- glEnable(GL_BLEND);
- draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST);
- draw_manipulator_translate(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL);
- glDisable(GL_BLEND);
- }
- else draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB);
- }
- }
-}
-
-static int manipulator_selectbuf(ScrArea *sa, float hotspot)
-{
- View3D *v3d= sa->spacedata.first;
- rctf rect;
- GLuint buffer[64]; // max 4 items per select, so large enuf
- short hits, mval[2];
-
- G.f |= G_PICKSEL;
-
- getmouseco_areawin(mval);
- rect.xmin= mval[0]-hotspot;
- rect.xmax= mval[0]+hotspot;
- rect.ymin= mval[1]-hotspot;
- rect.ymax= mval[1]+hotspot;
-
- /* get rid of overlay button matrix */
- persp(PERSP_VIEW);
-
- setwinmatrixview3d(sa->winx, sa->winy, &rect);
- Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat);
-
- glSelectBuffer( 64, buffer);
- glRenderMode(GL_SELECT);
- glInitNames(); /* these two calls whatfor? It doesnt work otherwise */
- glPushName(-2);
-
- /* do the drawing */
- if(v3d->twtype & V3D_MANIP_ROTATE) {
- if(G.rt==3) draw_manipulator_rotate_cyl(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype, MAN_RGB);
- else draw_manipulator_rotate(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype);
- }
- if(v3d->twtype & V3D_MANIP_SCALE)
- draw_manipulator_scale(v3d->twmat, 0, MAN_SCALE_C & v3d->twdrawflag, v3d->twtype, MAN_RGB);
- if(v3d->twtype & V3D_MANIP_TRANSLATE)
- draw_manipulator_translate(v3d->twmat, 0, MAN_TRANS_C & v3d->twdrawflag, v3d->twtype, MAN_RGB);
-
- glPopName();
- hits= glRenderMode(GL_RENDER);
-
- G.f &= ~G_PICKSEL;
- setwinmatrixview3d(sa->winx, sa->winy, NULL);
- Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat);
-
- persp(PERSP_WIN);
-
- if(hits==1) return buffer[3];
- else if(hits>1) {
- GLuint val, dep, mindep=0, mindeprot=0, minval=0, minvalrot=0;
- int a;
-
- /* we compare the hits in buffer, but value centers highest */
- /* we also store the rotation hits separate (because of arcs) and return hits on other widgets if there are */
-
- for(a=0; a<hits; a++) {
- dep= buffer[4*a + 1];
- val= buffer[4*a + 3];
-
- if(val==MAN_TRANS_C) return MAN_TRANS_C;
- else if(val==MAN_SCALE_C) return MAN_SCALE_C;
- else {
- if(val & MAN_ROT_C) {
- if(minvalrot==0 || dep<mindeprot) {
- mindeprot= dep;
- minvalrot= val;
- }
- }
- else {
- if(minval==0 || dep<mindep) {
- mindep= dep;
- minval= val;
- }
- }
- }
- }
-
- if(minval)
- return minval;
- else
- return minvalrot;
- }
- return 0;
-}
-
-/* return 0; nothing happened */
-int BIF_do_manipulator(ScrArea *sa)
-{
- View3D *v3d= sa->spacedata.first;
- int val;
-
- if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0;
- if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0;
-
- // find the hotspots first test narrow hotspot
- val= manipulator_selectbuf(sa, 0.5f*(float)U.tw_hotspot);
- if(val) {
- checkFirstTime(); // TEMPORARY, check this before doing any transform call.
- // drawflags still global, for drawing call above
- drawflags= manipulator_selectbuf(sa, 0.2f*(float)U.tw_hotspot);
- if(drawflags==0) drawflags= val;
-
- if (drawflags & MAN_TRANS_C) {
- initManipulator(TFM_TRANSLATION);
- switch(drawflags) {
- case MAN_TRANS_C:
- break;
- case MAN_TRANS_X:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_TRANS_Y|MAN_TRANS_Z;
- BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[0], " X");
- break;
- case MAN_TRANS_Y:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_TRANS_X|MAN_TRANS_Z;
- BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[1], " Y");
- break;
- case MAN_TRANS_Z:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_TRANS_X|MAN_TRANS_Y;
- BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[2], " Z");
- break;
- }
- ManipulatorTransform();
- }
- else if (drawflags & MAN_SCALE_C) {
- initManipulator(TFM_RESIZE);
- switch(drawflags) {
- case MAN_SCALE_X:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_SCALE_Y|MAN_SCALE_Z;
- BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[0], " X");
- break;
- case MAN_SCALE_Y:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_SCALE_X|MAN_SCALE_Z;
- BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[1], " Y");
- break;
- case MAN_SCALE_Z:
- if(G.qual & LR_SHIFTKEY) {
- drawflags= MAN_SCALE_X|MAN_SCALE_Y;
- BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y");
- }
- else
- BIF_setSingleAxisConstraint(v3d->twmat[2], " Z");
- break;
- }
- ManipulatorTransform();
- }
- else if (drawflags == MAN_ROT_T) { /* trackbal need special case, init is different */
- initManipulator(TFM_TRACKBALL);
- ManipulatorTransform();
- }
- else if (drawflags & MAN_ROT_C) {
- initManipulator(TFM_ROTATION);
- switch(drawflags) {
- case MAN_ROT_X:
- BIF_setSingleAxisConstraint(v3d->twmat[0], " X");
- break;
- case MAN_ROT_Y:
- BIF_setSingleAxisConstraint(v3d->twmat[1], " Y");
- break;
- case MAN_ROT_Z:
- BIF_setSingleAxisConstraint(v3d->twmat[2], " Z");
- break;
- }
- ManipulatorTransform();
- }
- }
- /* after transform, restore drawflags */
- drawflags= 0xFFFF;
-
- return val;
-}
-
-
diff --git a/source/blender/src/transform_ndofinput.c b/source/blender/src/transform_ndofinput.c
deleted file mode 100644
index a22c7ed6472..00000000000
--- a/source/blender/src/transform_ndofinput.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
- #include <math.h> /* fabs */
-#include <stdio.h> /* for sprintf */
-
-#include "BKE_global.h" /* for G */
-#include "BKE_utildefines.h" /* ABS */
-
-#include "DNA_view3d_types.h" /* for G.vd (view3d) */
-
-#include "BIF_mywindow.h"
-
-#include "mydevice.h" /* for KEY defines */
-
-#include "transform.h"
-
-static int updateNDofMotion(NDofInput *n); // return 0 when motion is null
-static void resetNDofInput(NDofInput *n);
-
-void initNDofInput(NDofInput *n)
-{
- int i;
-
- n->flag = 0;
- n->axis = 0;
-
- resetNDofInput(n);
-
- for(i = 0; i < 3; i++)
- {
- n->factor[i] = 1.0f;
- }
-}
-
-static void resetNDofInput(NDofInput *n)
-{
- int i;
- for(i = 0; i < 6; i++)
- {
- n->fval[i] = 0.0f;
- }
-}
-
-
-int handleNDofInput(NDofInput *n, unsigned short event, short val)
-{
- int retval = 0;
-
- switch(event)
- {
- case NDOFMOTION:
- if (updateNDofMotion(n) == 0)
- {
- retval = NDOF_NOMOVE;
- }
- else
- {
- retval = NDOF_REFRESH;
- }
- break;
- case NDOFBUTTON:
- if (val == 1)
- {
- retval = NDOF_CONFIRM;
- }
- else if (val == 2)
- {
- retval = NDOF_CANCEL;
- resetNDofInput(n);
- n->flag &= ~NDOF_INIT;
- }
- break;
- }
-
- return retval;
-}
-
-int hasNDofInput(NDofInput *n)
-{
- return (n->flag & NDOF_INIT) == NDOF_INIT;
-}
-
-void applyNDofInput(NDofInput *n, float *vec)
-{
- if (hasNDofInput(n))
- {
- int i, j;
-
- for (i = 0, j = 0; i < 6; i++)
- {
- if (n->axis & (1 << i))
- {
- vec[j] = n->fval[i] * n->factor[j];
- j++;
- }
- }
- }
-}
-
-
-static int updateNDofMotion(NDofInput *n)
-{
- float fval[7];
- int i;
- int retval = 0;
-
- getndof(fval);
-
- if (G.vd->ndoffilter)
- filterNDOFvalues(fval);
-
- for(i = 0; i < 6; i++)
- {
- if (!retval && fval[i] != 0.0f)
- {
- retval = 1;
- }
-
- n->fval[i] += fval[i] / 1024.0f;
- }
-
- n->flag |= NDOF_INIT;
-
- return retval;
-}
-
-
-
-
diff --git a/source/blender/src/transform_numinput.c b/source/blender/src/transform_numinput.c
deleted file mode 100644
index 89a76c097e0..00000000000
--- a/source/blender/src/transform_numinput.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h> /* fabs */
-#include <stdio.h> /* for sprintf */
-
-#include "BKE_global.h" /* for G */
-#include "BKE_utildefines.h" /* ABS */
-
-#include "mydevice.h" /* for KEY defines */
-
-#include "transform.h"
-
-/* ************************** Functions *************************** */
-
-/* ************************** NUMINPUT **************************** */
-
-void initNumInput(NumInput *n)
-{
- n->flag =
- n->idx =
- n->idx_max =
- n->ctrl[0] =
- n->ctrl[1] =
- n->ctrl[2] = 0;
-
- n->val[0] =
- n->val[1] =
- n->val[2] = 0.0f;
-}
-
-void outputNumInput(NumInput *n, char *str)
-{
- char cur;
- short i, j;
-
- for (j=0; j<=n->idx_max; j++) {
- /* if AFFECTALL and no number typed and cursor not on number, use first number */
- if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0)
- i = 0;
- else
- i = j;
-
- if (n->idx != i)
- cur = ' ';
- else
- cur = '|';
-
- if( n->val[i] > 1e10 || n->val[i] < -1e10 )
- sprintf(&str[j*20], "%.4e%c", n->val[i], cur);
- else
- switch (n->ctrl[i]) {
- case 0:
- sprintf(&str[j*20], "NONE%c", cur);
- break;
- case 1:
- case -1:
- sprintf(&str[j*20], "%.0f%c", n->val[i], cur);
- break;
- case 10:
- case -10:
- sprintf(&str[j*20], "%.f.%c", n->val[i], cur);
- break;
- case 100:
- case -100:
- sprintf(&str[j*20], "%.1f%c", n->val[i], cur);
- break;
- case 1000:
- case -1000:
- sprintf(&str[j*20], "%.2f%c", n->val[i], cur);
- break;
- case 10000:
- case -10000:
- sprintf(&str[j*20], "%.3f%c", n->val[i], cur);
- break;
- default:
- sprintf(&str[j*20], "%.4e%c", n->val[i], cur);
- }
- }
-}
-
-short hasNumInput(NumInput *n)
-{
- short i;
-
- for (i=0; i<=n->idx_max; i++) {
- if (n->ctrl[i])
- return 1;
- }
-
- return 0;
-}
-
-void applyNumInput(NumInput *n, float *vec)
-{
- short i, j;
- float val[3];
-
- if (hasNumInput(n)) {
- convertDisplayNumToVec(n->val, val);
-
- for (j=0; j<=n->idx_max; j++) {
- /* if AFFECTALL and no number typed and cursor not on number, use first number */
- if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0)
- i = 0;
- else
- i = j;
-
- if (n->ctrl[i] == 0 && n->flag & NUM_NULL_ONE) {
- vec[j] = 1.0f;
- }
- else if (val[i] == 0.0f && n->flag & NUM_NO_ZERO) {
- vec[j] = 0.0001f;
- }
- else {
- vec[j] = val[i];
- }
- }
- }
-}
-
-char handleNumInput(NumInput *n, unsigned short event)
-{
- float Val = 0;
- short idx = n->idx, idx_max = n->idx_max;
-
- switch (event) {
- case BACKSPACEKEY:
- if (n->ctrl[idx] == 0) {
- n->val[0] =
- n->val[1] =
- n->val[2] = 0.0f;
- n->ctrl[0] =
- n->ctrl[1] =
- n->ctrl[2] = 0;
- }
- else {
- n->val[idx] = 0.0f;
- n->ctrl[idx] = 0;
- }
- break;
- case PERIODKEY:
- case PADPERIOD:
- if (n->flag & NUM_NO_FRACTION)
- break;
-
- switch (n->ctrl[idx])
- {
- case 0:
- case 1:
- n->ctrl[idx] = 10;
- break;
- case -1:
- n->ctrl[idx] = -10;
- }
- break;
- case PADMINUS:
- if(G.qual & LR_ALTKEY)
- break;
- case MINUSKEY:
- if (n->flag & NUM_NO_NEGATIVE)
- break;
-
- if (n->ctrl[idx]) {
- n->ctrl[idx] *= -1;
- n->val[idx] *= -1;
- }
- else
- n->ctrl[idx] = -1;
- break;
- case TABKEY:
- idx++;
- if (idx > idx_max)
- idx = 0;
- n->idx = idx;
- break;
- case PAD9:
- case NINEKEY:
- Val += 1.0f;
- case PAD8:
- case EIGHTKEY:
- Val += 1.0f;
- case PAD7:
- case SEVENKEY:
- Val += 1.0f;
- case PAD6:
- case SIXKEY:
- Val += 1.0f;
- case PAD5:
- case FIVEKEY:
- Val += 1.0f;
- case PAD4:
- case FOURKEY:
- Val += 1.0f;
- case PAD3:
- case THREEKEY:
- Val += 1.0f;
- case PAD2:
- case TWOKEY:
- Val += 1.0f;
- case PAD1:
- case ONEKEY:
- Val += 1.0f;
- case PAD0:
- case ZEROKEY:
- if (!n->ctrl[idx])
- n->ctrl[idx] = 1;
-
- if (fabs(n->val[idx]) > 9999999.0f);
- else if (n->ctrl[idx] == 1) {
- n->val[idx] *= 10;
- n->val[idx] += Val;
- }
- else if (n->ctrl[idx] == -1) {
- n->val[idx] *= 10;
- n->val[idx] -= Val;
- }
- else {
- /* float resolution breaks when over six digits after comma */
- if( ABS(n->ctrl[idx]) < 10000000) {
- n->val[idx] += Val / (float)n->ctrl[idx];
- n->ctrl[idx] *= 10;
- }
- }
- break;
- default:
- return 0;
- }
-
- /* REDRAW SINCE NUMBERS HAVE CHANGED */
- return 1;
-}
diff --git a/source/blender/src/transform_orientations.c b/source/blender/src/transform_orientations.c
deleted file mode 100644
index fc9dfbb902e..00000000000
--- a/source/blender/src/transform_orientations.c
+++ /dev/null
@@ -1,774 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_action_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_listBase.h"
-#include "DNA_object_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-
-#include "BIF_editmesh.h"
-#include "BIF_editarmature.h"
-#include "BIF_interface.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-
-#include "blendef.h"
-
-
-#include "transform.h"
-
-
-/* *********************** TransSpace ************************** */
-
-void BIF_clearTransformOrientation(void)
-{
- ListBase *transform_spaces = &G.scene->transform_spaces;
- BLI_freelistN(transform_spaces);
-
- if (G.vd->twmode >= V3D_MANIP_CUSTOM)
- G.vd->twmode = V3D_MANIP_GLOBAL; /* fallback to global */
-}
-
-void BIF_manageTransformOrientation(int confirm, int set) {
- Object *ob = OBACT;
- int index = -1;
-
- if (G.obedit) {
- if (G.obedit->type == OB_MESH)
- index = manageMeshSpace(confirm, set);
- else if (G.obedit->type == OB_ARMATURE)
- index = manageBoneSpace(confirm, set);
- }
- else if (ob && (ob->flag & OB_POSEMODE)) {
- index = manageBoneSpace(confirm, set);
- }
- else {
- index = manageObjectSpace(confirm, set);
- }
-
- if (set && index != -1)
- {
- BIF_selectTransformOrientationFromIndex(index);
- }
-}
-
-int manageObjectSpace(int confirm, int set) {
- Base *base = BASACT;
-
- if (base == NULL)
- return -1;
-
- if (confirm == 0) {
- if (set && pupmenu("Custom Orientation %t|Add and Use Active Object%x1") != 1) {
- return -1;
- }
- else if (set == 0 && pupmenu("Custom Orientation %t|Add Active Object%x1") != 1) {
- return -1;
- }
- }
-
- return addObjectSpace(base->object);
-}
-
-/* return 1 on confirm */
-int confirmSpace(int set, char text[])
-{
- char menu[64];
-
- if (set) {
- sprintf(menu, "Custom Orientation %%t|Add and Use %s%%x1", text);
- }
- else {
- sprintf(menu, "Custom Orientation %%t|Add %s%%x1", text);
- }
-
- if (pupmenu(menu) == 1) {
- return 1;
- }
- else {
- return 0;
- }
-}
-
-int manageBoneSpace(int confirm, int set) {
- float mat[3][3];
- float normal[3], plane[3];
- char name[36] = "";
- int index;
-
- getTransformOrientation(normal, plane, 0);
-
- if (confirm == 0 && confirmSpace(set, "Bone") == 0) {
- return -1;
- }
-
- if (createSpaceNormalTangent(mat, normal, plane) == 0) {
- error("Cannot use zero-length bone");
- return -1;
- }
-
- strcpy(name, "Bone");
-
- /* Input name */
- sbutton(name, 1, 35, "name: ");
-
- index = addMatrixSpace(mat, name);
- return index;
-}
-
-int manageMeshSpace(int confirm, int set) {
- float mat[3][3];
- float normal[3], plane[3];
- char name[36] = "";
- int index;
- int type;
-
- type = getTransformOrientation(normal, plane, 0);
-
- switch (type)
- {
- case ORIENTATION_VERT:
- if (confirm == 0 && confirmSpace(set, "vertex") == 0) {
- return -1;
- }
-
- if (createSpaceNormal(mat, normal) == 0) {
- error("Cannot use vertex with zero-length normal");
- return -1;
- }
-
- strcpy(name, "Vertex");
- break;
- case ORIENTATION_EDGE:
- if (confirm == 0 && confirmSpace(set, "Edge") == 0) {
- return -1;
- }
-
- if (createSpaceNormalTangent(mat, normal, plane) == 0) {
- error("Cannot use zero-length edge");
- return -1;
- }
-
- strcpy(name, "Edge");
- break;
- case ORIENTATION_FACE:
- if (confirm == 0 && confirmSpace(set, "Face") == 0) {
- return -1;
- }
-
- if (createSpaceNormalTangent(mat, normal, plane) == 0) {
- error("Cannot use zero-area face");
- return -1;
- }
-
- strcpy(name, "Face");
- break;
- default:
- return -1;
- break;
- }
-
- /* Input name */
- sbutton(name, 1, 35, "name: ");
-
- index = addMatrixSpace(mat, name);
- return index;
-}
-
-int createSpaceNormal(float mat[3][3], float normal[3])
-{
- float tangent[3] = {0.0f, 0.0f, 1.0f};
-
- VECCOPY(mat[2], normal);
- if (Normalize(mat[2]) == 0.0f) {
- return 0; /* error return */
- }
-
- Crossf(mat[0], mat[2], tangent);
- if (Inpf(mat[0], mat[0]) == 0.0f) {
- tangent[0] = 1.0f;
- tangent[1] = tangent[2] = 0.0f;
- Crossf(mat[0], tangent, mat[2]);
- }
-
- Crossf(mat[1], mat[2], mat[0]);
-
- Mat3Ortho(mat);
-
- return 1;
-}
-
-int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3])
-{
- VECCOPY(mat[2], normal);
- if (Normalize(mat[2]) == 0.0f) {
- return 0; /* error return */
- }
-
- /* preempt zero length tangent from causing trouble */
- if (tangent[0] == 0 && tangent[1] == 0 && tangent[2] == 0)
- {
- tangent[2] = 1;
- }
-
- Crossf(mat[0], mat[2], tangent);
- if (Normalize(mat[0]) == 0.0f) {
- return 0; /* error return */
- }
-
- Crossf(mat[1], mat[2], mat[0]);
-
- Mat3Ortho(mat);
-
- return 1;
-}
-
-
-int addObjectSpace(Object *ob) {
- float mat[3][3];
- char name[36] = "";
-
- Mat3CpyMat4(mat, ob->obmat);
- Mat3Ortho(mat);
-
- strncpy(name, ob->id.name+2, 35);
-
- /* Input name */
- sbutton(name, 1, 35, "name: ");
-
- return addMatrixSpace(mat, name);
-}
-
-int addMatrixSpace(float mat[3][3], char name[]) {
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts;
- int index = 0;
-
- /* if name is found in list, reuse that transform space */
- for (index = 0, ts = transform_spaces->first; ts; ts = ts->next, index++) {
- if (strncmp(ts->name, name, 35) == 0) {
- break;
- }
- }
-
- /* if not, create a new one */
- if (ts == NULL)
- {
- ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix");
- BLI_addtail(transform_spaces, ts);
- strncpy(ts->name, name, 35);
- }
-
- /* copy matrix into transform space */
- Mat3CpyMat3(ts->mat, mat);
-
- BIF_undo_push("Add/Update Transform Orientation");
-
- return index;
-}
-
-void BIF_removeTransformOrientation(TransformOrientation *target) {
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts = transform_spaces->first;
- int selected_index = (G.vd->twmode - V3D_MANIP_CUSTOM);
- int i;
-
- for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
- if (ts == target) {
- if (selected_index == i) {
- G.vd->twmode = V3D_MANIP_GLOBAL; /* fallback to global */
- }
- else if (selected_index > i)
- G.vd->twmode--;
-
- BLI_freelinkN(transform_spaces, ts);
- break;
- }
- }
- BIF_undo_push("Remove Transform Orientation");
-}
-
-void BIF_selectTransformOrientation(TransformOrientation *target) {
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts = transform_spaces->first;
- int i;
-
- for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) {
- if (ts == target) {
- G.vd->twmode = V3D_MANIP_CUSTOM + i;
- break;
- }
- }
-}
-
-void BIF_selectTransformOrientationFromIndex(int index) {
- G.vd->twmode = V3D_MANIP_CUSTOM + index;
-}
-
-char * BIF_menustringTransformOrientation(char *title) {
- char menu[] = "%t|Global%x0|Local%x1|Normal%x2|View%x3";
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts;
- int i = V3D_MANIP_CUSTOM;
- char *str_menu, *p;
-
-
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(), "UserTransSpace from matrix");
- p = str_menu;
-
- p += sprintf(str_menu, "%s", title);
- p += sprintf(p, "%s", menu);
-
- for (ts = transform_spaces->first; ts; ts = ts->next) {
- p += sprintf(p, "|%s%%x%d", ts->name, i++);
- }
-
- return str_menu;
-}
-
-int BIF_countTransformOrientation() {
- ListBase *transform_spaces = &G.scene->transform_spaces;
- TransformOrientation *ts;
- int count = 0;
-
- for (ts = transform_spaces->first; ts; ts = ts->next) {
- count++;
- }
-
- return count;
-}
-
-void applyTransformOrientation() {
- TransInfo *t = BIF_GetTransInfo();
- TransformOrientation *ts;
- int selected_index = (G.vd->twmode - V3D_MANIP_CUSTOM);
- int i;
-
- if (selected_index >= 0) {
- for (i = 0, ts = G.scene->transform_spaces.first; ts; ts = ts->next, i++) {
- if (selected_index == i) {
- strcpy(t->spacename, ts->name);
- Mat3CpyMat3(t->spacemtx, ts->mat);
- Mat4CpyMat3(G.vd->twmat, ts->mat);
- break;
- }
- }
- }
-}
-
-static int count_bone_select(bArmature *arm, ListBase *lb, int do_it)
-{
- Bone *bone;
- int do_next;
- int total = 0;
-
- for(bone= lb->first; bone; bone= bone->next) {
- bone->flag &= ~BONE_TRANSFORM;
- do_next = do_it;
- if(do_it) {
- if(bone->layer & arm->layer) {
- if (bone->flag & BONE_SELECTED) {
- bone->flag |= BONE_TRANSFORM;
- total++;
- do_next= 0; // no transform on children if one parent bone is selected
- }
- }
- }
- total += count_bone_select(arm, &bone->childbase, do_next);
- }
-
- return total;
-}
-
-int getTransformOrientation(float normal[3], float plane[3], int activeOnly)
-{
- Base *base;
- Object *ob = OBACT;
- int result = ORIENTATION_NONE;
-
- normal[0] = normal[1] = normal[2] = 0;
- plane[0] = plane[1] = plane[2] = 0;
-
- if(G.obedit)
- {
- float imat[3][3], mat[3][3];
-
- /* we need the transpose of the inverse for a normal... */
- Mat3CpyMat4(imat, ob->obmat);
-
- Mat3Inv(mat, imat);
- Mat3Transp(mat);
-
- ob= G.obedit;
-
- if(G.obedit->type==OB_MESH)
- {
- EditMesh *em = G.editMesh;
- EditVert *eve;
- EditSelection ese;
- float vec[3]= {0,0,0};
-
- /* USE LAST SELECTED WITH ACTIVE */
- if (activeOnly && EM_get_actSelection(&ese))
- {
- EM_editselection_normal(normal, &ese);
- EM_editselection_plane(plane, &ese);
-
- switch (ese.type)
- {
- case EDITVERT:
- result = ORIENTATION_VERT;
- break;
- case EDITEDGE:
- result = ORIENTATION_EDGE;
- break;
- case EDITFACE:
- result = ORIENTATION_FACE;
- break;
- }
- }
- else
- {
- if (G.totfacesel >= 1)
- {
- EditFace *efa;
-
- for(efa= em->faces.first; efa; efa= efa->next)
- {
- if(efa->f & SELECT)
- {
- VECADD(normal, normal, efa->n);
- VecSubf(vec, efa->v2->co, efa->v1->co);
- VECADD(plane, plane, vec);
- }
- }
-
- result = ORIENTATION_FACE;
- }
- else if (G.totvertsel == 3)
- {
- EditVert *v1 = NULL, *v2 = NULL, *v3 = NULL;
- float cotangent[3];
-
- for (eve = em->verts.first; eve; eve = eve->next)
- {
- if ( eve->f & SELECT ) {
- if (v1 == NULL) {
- v1 = eve;
- }
- else if (v2 == NULL) {
- v2 = eve;
- }
- else {
- v3 = eve;
-
- VecSubf(plane, v2->co, v1->co);
- VecSubf(cotangent, v3->co, v2->co);
- Crossf(normal, cotangent, plane);
- break;
- }
- }
- }
-
- /* if there's an edge available, use that for the tangent */
- if (G.totedgesel >= 1)
- {
- EditEdge *eed = NULL;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f & SELECT) {
- VecSubf(plane, eed->v2->co, eed->v1->co);
- break;
- }
- }
- }
-
- result = ORIENTATION_FACE;
- }
- else if (G.totedgesel == 1)
- {
- EditEdge *eed;
-
- for(eed= em->edges.first; eed; eed= eed->next) {
- if(eed->f & SELECT) {
- /* use average vert normals as plane and edge vector as normal */
- VECCOPY(plane, eed->v1->no);
- VECADD(plane, plane, eed->v2->no);
- VecSubf(normal, eed->v2->co, eed->v1->co);
- break;
- }
- }
- result = ORIENTATION_EDGE;
- }
- else if (G.totvertsel == 2)
- {
- EditVert *v1 = NULL, *v2 = NULL;
-
- for (eve = em->verts.first; eve; eve = eve->next)
- {
- if ( eve->f & SELECT ) {
- if (v1 == NULL) {
- v1 = eve;
- }
- else {
- v2 = eve;
-
- VECCOPY(plane, v1->no);
- VECADD(plane, plane, v2->no);
- VecSubf(normal, v2->co, v1->co);
- break;
- }
- }
- }
- result = ORIENTATION_EDGE;
- }
- else if (G.totvertsel == 1)
- {
- for (eve = em->verts.first; eve; eve = eve->next)
- {
- if ( eve->f & SELECT ) {
- VECCOPY(normal, eve->no);
- break;
- }
- }
- result = ORIENTATION_VERT;
- }
- else if (G.totvertsel > 3)
- {
- normal[0] = normal[1] = normal[2] = 0;
-
- for (eve = em->verts.first; eve; eve = eve->next)
- {
- if ( eve->f & SELECT ) {
- VecAddf(normal, normal, eve->no);
- }
- }
- Normalize(normal);
- result = ORIENTATION_VERT;
- }
- }
- } /* end editmesh */
- else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT)
- {
- extern ListBase editNurb; /* BOOO! go away stupid extern */
- Nurb *nu;
- BezTriple *bezt;
- int a;
-
- for (nu = editNurb.first; nu; nu = nu->next)
- {
- /* only bezier has a normal */
- if((nu->type & 7) == CU_BEZIER)
- {
- bezt= nu->bezt;
- a= nu->pntsu;
- while(a--)
- {
- /* exception */
- if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT )
- {
- VecSubf(normal, bezt->vec[0], bezt->vec[2]);
- }
- else
- {
- if(bezt->f1)
- {
- VecSubf(normal, bezt->vec[0], bezt->vec[1]);
- }
- if(bezt->f2)
- {
- VecSubf(normal, bezt->vec[0], bezt->vec[2]);
- }
- if(bezt->f3)
- {
- VecSubf(normal, bezt->vec[1], bezt->vec[2]);
- }
- }
- bezt++;
- }
- }
- }
-
- if (normal[0] != 0 || normal[1] != 0 || normal[2] != 0)
- {
- result = ORIENTATION_NORMAL;
- }
- }
- else if(G.obedit->type==OB_MBALL)
- {
- /* editmball.c */
- extern ListBase editelems; /* go away ! */
- MetaElem *ml, *ml_sel = NULL;
-
- /* loop and check that only one element is selected */
- for (ml = editelems.first; ml; ml = ml->next)
- {
- if (ml->flag & SELECT) {
- if (ml_sel == NULL)
- {
- ml_sel = ml;
- }
- else
- {
- ml_sel = NULL;
- break;
- }
- }
- }
-
- if (ml_sel)
- {
- float mat[4][4];
-
- /* Rotation of MetaElem is stored in quat */
- QuatToMat4(ml_sel->quat, mat);
-
- VECCOPY(normal, mat[2]);
- VECCOPY(plane, mat[1]);
-
- VecMulf(plane, -1.0);
-
- result = ORIENTATION_NORMAL;
- }
- }
- else if (G.obedit->type == OB_ARMATURE)
- {
- bArmature *arm = G.obedit->data;
- EditBone *ebone;
-
- for (ebone = G.edbo.first; ebone; ebone=ebone->next) {
- if (arm->layer & ebone->layer)
- {
- if (ebone->flag & BONE_SELECTED)
- {
- float vec[3];
- VecSubf(vec, ebone->tail, ebone->head);
- Normalize(vec);
- VecAddf(normal, normal, vec);
- }
- }
- }
-
- Normalize(normal);
- Crossf(plane, G.obedit->obmat[0], normal);
-
- if (Inpf(plane, plane) < FLT_EPSILON)
- {
- Crossf(plane, G.obedit->obmat[1], normal);
- }
-
- if (plane[0] != 0 || plane[1] != 0 || plane[2] != 0)
- {
- result = ORIENTATION_EDGE;
- }
-
- }
-
- /* Vectors from edges don't need the special transpose inverse multiplication */
- if (result == ORIENTATION_EDGE)
- {
- Mat4Mul3Vecfl(ob->obmat, normal);
- Mat4Mul3Vecfl(ob->obmat, plane);
- }
- else
- {
- Mat3MulVecfl(mat, normal);
- Mat3MulVecfl(mat, plane);
- }
- }
- else if(ob && (ob->flag & OB_POSEMODE))
- {
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- int totsel;
-
- totsel = count_bone_select(arm, &arm->bonebase, 1);
- if(totsel) {
- float imat[3][3], mat[3][3];
-
- /* use channels to get stats */
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if (pchan->bone && pchan->bone->flag & BONE_TRANSFORM) {
- VecAddf(normal, normal, pchan->pose_mat[2]);
- VecAddf(plane, plane, pchan->pose_mat[1]);
- }
- }
- VecMulf(plane, -1.0);
-
- /* we need the transpose of the inverse for a normal... */
- Mat3CpyMat4(imat, ob->obmat);
-
- Mat3Inv(mat, imat);
- Mat3Transp(mat);
- Mat3MulVecfl(mat, normal);
- Mat3MulVecfl(mat, plane);
-
- result = ORIENTATION_EDGE;
- }
- }
- else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE))
- {
- }
- else if(G.f & G_PARTICLEEDIT)
- {
- }
- else {
- /* we need the one selected object, if its not active */
- ob = OBACT;
- if(ob && !(ob->flag & SELECT)) ob = NULL;
-
- for(base= G.scene->base.first; base; base= base->next) {
- if TESTBASELIB(base) {
- if(ob == NULL) {
- ob= base->object;
- break;
- }
- }
- }
-
- VECCOPY(normal, ob->obmat[2]);
- VECCOPY(plane, ob->obmat[1]);
- result = ORIENTATION_NORMAL;
- }
-
- return result;
-}
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c
deleted file mode 100644
index e7937e72c2b..00000000000
--- a/source/blender/src/transform_snap.c
+++ /dev/null
@@ -1,1282 +0,0 @@
-/**
- * $Id:
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <math.h>
-#include <stdio.h>
-
-#include "PIL_time.h"
-
-#include "DNA_object_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_meshdata_types.h" // Temporary, for snapping to other unselected meshes
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BLI_arithb.h"
-#include "BLI_editVert.h"
-
-#include "BDR_drawobject.h"
-
-#include "editmesh.h"
-#include "BIF_editsima.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_mywindow.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_editsima.h"
-#include "BIF_drawimage.h"
-#include "BIF_editmesh.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_object.h"
-#include "BKE_anim.h" /* for duplis */
-
-#include "BSE_view.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "transform.h"
-#include "mydevice.h" /* for KEY defines */
-#include "blendef.h" /* for selection modes */
-
-/********************* PROTOTYPES ***********************/
-
-void setSnappingCallback(TransInfo *t);
-
-void ApplySnapTranslation(TransInfo *t, float vec[3]);
-void ApplySnapRotation(TransInfo *t, float *vec);
-void ApplySnapResize(TransInfo *t, float *vec);
-
-void CalcSnapGrid(TransInfo *t, float *vec);
-void CalcSnapGeometry(TransInfo *t, float *vec);
-
-void TargetSnapMedian(TransInfo *t);
-void TargetSnapCenter(TransInfo *t);
-void TargetSnapClosest(TransInfo *t);
-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]);
-
-/* Modes */
-#define NOT_SELECTED 0
-#define NOT_ACTIVE 1
-int snapObjects(int *dist, float *loc, float *no, int mode);
-
-
-/****************** IMPLEMENTATIONS *********************/
-
-int BIF_snappingSupported(void)
-{
- int status = 0;
-
- if (G.obedit == NULL || G.obedit->type==OB_MESH) /* only support object or mesh */
- {
- status = 1;
- }
-
- return status;
-}
-
-void drawSnapping(TransInfo *t)
-{
- if ((t->tsnap.status & (SNAP_ON|POINT_INIT|TARGET_INIT)) == (SNAP_ON|POINT_INIT|TARGET_INIT) &&
- (G.qual & LR_CTRLKEY)) {
-
- char col[4];
- BIF_GetThemeColor3ubv(TH_TRANSFORM, col);
- glColor4ub(col[0], col[1], col[2], 128);
-
- if (t->spacetype==SPACE_VIEW3D) {
- float unitmat[4][4];
- float size;
-
- glDisable(GL_DEPTH_TEST);
-
- size = get_drawsize(G.vd, t->tsnap.snapPoint);
-
- size *= 0.5f * BIF_GetThemeValuef(TH_VERTEX_SIZE);
-
- glPushMatrix();
-
- glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], t->tsnap.snapPoint[2]);
-
- /* draw normal if needed */
- if (usingSnappingNormal(t) && validSnappingNormal(t))
- {
- glBegin(GL_LINES);
- glVertex3f(0, 0, 0);
- glVertex3f(t->tsnap.snapNormal[0], t->tsnap.snapNormal[1], t->tsnap.snapNormal[2]);
- glEnd();
- }
-
- /* sets view screen aligned */
- glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]);
-
- Mat4One(unitmat);
- drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat);
-
- glPopMatrix();
-
- if(G.vd->zbuf) glEnable(GL_DEPTH_TEST);
- } else if (t->spacetype==SPACE_IMAGE) {
- /*This will not draw, and Im nor sure why - campbell */
-
- /*
- float xuser_asp, yuser_asp;
- int wi, hi;
- float w, h;
-
- calc_image_view(G.sima, 'f'); // float
- myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
- glLoadIdentity();
-
- aspect_sima(G.sima, &xuser_asp, &yuser_asp);
-
- transform_width_height_tface_uv(&wi, &hi);
- w = (((float)wi)/256.0f)*G.sima->zoom * xuser_asp;
- h = (((float)hi)/256.0f)*G.sima->zoom * yuser_asp;
-
- cpack(0xFFFFFF);
- glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], 0.0f);
-
- //glRectf(0,0,1,1);
-
- setlinestyle(0);
- cpack(0x0);
- fdrawline(-0.020/w, 0, -0.1/w, 0);
- fdrawline(0.1/w, 0, .020/w, 0);
- fdrawline(0, -0.020/h, 0, -0.1/h);
- fdrawline(0, 0.1/h, 0, 0.020/h);
-
- glTranslatef(-t->tsnap.snapPoint[0], -t->tsnap.snapPoint[1], 0.0f);
- setlinestyle(0);
- */
-
- }
- }
-}
-
-int handleSnapping(TransInfo *t, int event)
-{
- int status = 0;
-
- if (BIF_snappingSupported() && event == TABKEY && (G.qual & LR_SHIFTKEY) == LR_SHIFTKEY)
- {
- /* toggle snap and reinit */
- G.scene->snap_flag ^= SCE_SNAP;
- initSnapping(t);
- status = 1;
- }
-
- return status;
-}
-
-void applySnapping(TransInfo *t, float *vec)
-{
- if ((t->tsnap.status & SNAP_ON) &&
- (G.qual & LR_CTRLKEY))
- {
- double current = PIL_check_seconds_timer();
-
- // Time base quirky code to go around findnearest slowness
- /* !TODO! add exception for object mode, no need to slow it down then */
- if (current - t->tsnap.last >= 0.1)
- {
- t->tsnap.calcSnap(t, vec);
- t->tsnap.targetSnap(t);
-
- t->tsnap.last = current;
- }
- if ((t->tsnap.status & (POINT_INIT|TARGET_INIT)) == (POINT_INIT|TARGET_INIT))
- {
- t->tsnap.applySnap(t, vec);
- }
- }
-}
-
-void resetSnapping(TransInfo *t)
-{
- t->tsnap.status = 0;
- t->tsnap.modePoint = 0;
- t->tsnap.modeTarget = 0;
- t->tsnap.last = 0;
- t->tsnap.applySnap = NULL;
-
- t->tsnap.snapNormal[0] = 0;
- t->tsnap.snapNormal[1] = 0;
- t->tsnap.snapNormal[2] = 0;
-}
-
-int usingSnappingNormal(TransInfo *t)
-{
- if (G.scene->snap_flag & SCE_SNAP_ROTATE)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-int validSnappingNormal(TransInfo *t)
-{
- if ((t->tsnap.status & (POINT_INIT|TARGET_INIT)) == (POINT_INIT|TARGET_INIT))
- {
- if (Inpf(t->tsnap.snapNormal, t->tsnap.snapNormal) > 0)
- {
- return 1;
- }
- }
-
- return 0;
-}
-
-void initSnapping(TransInfo *t)
-{
- resetSnapping(t);
-
- if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && // Only 3D view or UV
- (t->flag & T_CAMERA) == 0) { // Not with camera selected
- setSnappingCallback(t);
-
- /* Edit mode */
- if (t->tsnap.applySnap != NULL && // A snapping function actually exist
- (G.scene->snap_flag & SCE_SNAP) && // Only if the snap flag is on
- (G.obedit != NULL && G.obedit->type==OB_MESH) && // Temporary limited to edit mode meshes
- ((t->flag & T_PROP_EDIT) == 0) ) // No PET, obviously
- {
- t->tsnap.status |= SNAP_ON;
- t->tsnap.modePoint = SNAP_GEO;
- }
- /* Object mode */
- else if (t->tsnap.applySnap != NULL && // A snapping function actually exist
- (G.scene->snap_flag & SCE_SNAP) && // Only if the snap flag is on
- (G.obedit == NULL) ) // Object Mode
- {
- t->tsnap.status |= SNAP_ON;
- t->tsnap.modePoint = SNAP_GEO;
- }
- else
- {
- /* Grid if snap is not possible */
- t->tsnap.modePoint = SNAP_GRID;
- }
- }
- else
- {
- /* Always grid outside of 3D view */
- t->tsnap.modePoint = SNAP_GRID;
- }
-}
-
-void setSnappingCallback(TransInfo *t)
-{
- t->tsnap.calcSnap = CalcSnapGeometry;
-
- switch(G.scene->snap_target)
- {
- case SCE_SNAP_TARGET_CLOSEST:
- t->tsnap.modeTarget = SNAP_CLOSEST;
- t->tsnap.targetSnap = TargetSnapClosest;
- break;
- case SCE_SNAP_TARGET_CENTER:
- t->tsnap.modeTarget = SNAP_CENTER;
- t->tsnap.targetSnap = TargetSnapCenter;
- break;
- case SCE_SNAP_TARGET_MEDIAN:
- t->tsnap.modeTarget = SNAP_MEDIAN;
- t->tsnap.targetSnap = TargetSnapMedian;
- break;
- case SCE_SNAP_TARGET_ACTIVE:
- t->tsnap.modeTarget = SNAP_ACTIVE;
- t->tsnap.targetSnap = TargetSnapActive;
- break;
-
- }
-
- switch (t->mode)
- {
- case TFM_TRANSLATION:
- t->tsnap.applySnap = ApplySnapTranslation;
- t->tsnap.distance = TranslationBetween;
- break;
- case TFM_ROTATION:
- t->tsnap.applySnap = ApplySnapRotation;
- t->tsnap.distance = RotationBetween;
-
- // Can't do TARGET_CENTER with rotation, use TARGET_MEDIAN instead
- if (G.scene->snap_target == SCE_SNAP_TARGET_CENTER) {
- t->tsnap.modeTarget = SNAP_MEDIAN;
- t->tsnap.targetSnap = TargetSnapMedian;
- }
- break;
- case TFM_RESIZE:
- t->tsnap.applySnap = ApplySnapResize;
- t->tsnap.distance = ResizeBetween;
-
- // Can't do TARGET_CENTER with resize, use TARGET_MEDIAN instead
- if (G.scene->snap_target == SCE_SNAP_TARGET_CENTER) {
- t->tsnap.modeTarget = SNAP_MEDIAN;
- t->tsnap.targetSnap = TargetSnapMedian;
- }
- break;
- default:
- t->tsnap.applySnap = NULL;
- break;
- }
-}
-
-/********************** APPLY **************************/
-
-void ApplySnapTranslation(TransInfo *t, float vec[3])
-{
- VecSubf(vec, t->tsnap.snapPoint, t->tsnap.snapTarget);
-}
-
-void ApplySnapRotation(TransInfo *t, float *vec)
-{
- if (t->tsnap.modeTarget == SNAP_CLOSEST) {
- *vec = t->tsnap.dist;
- }
- else {
- *vec = RotationBetween(t, t->tsnap.snapTarget, t->tsnap.snapPoint);
- }
-}
-
-void ApplySnapResize(TransInfo *t, float vec[3])
-{
- if (t->tsnap.modeTarget == SNAP_CLOSEST) {
- vec[0] = vec[1] = vec[2] = t->tsnap.dist;
- }
- else {
- vec[0] = vec[1] = vec[2] = ResizeBetween(t, t->tsnap.snapTarget, t->tsnap.snapPoint);
- }
-}
-
-/********************** DISTANCE **************************/
-
-float TranslationBetween(TransInfo *t, float p1[3], float p2[3])
-{
- return VecLenf(p1, p2);
-}
-
-float RotationBetween(TransInfo *t, float p1[3], float p2[3])
-{
- float angle, start[3], end[3], center[3];
-
- VECCOPY(center, t->center);
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, center);
- }
-
- VecSubf(start, p1, center);
- VecSubf(end, p2, center);
-
- // Angle around a constraint axis (error prone, will need debug)
- if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) {
- float axis[3], tmp[3];
-
- t->con.applyRot(t, NULL, axis, NULL);
-
- Projf(tmp, end, axis);
- VecSubf(end, end, tmp);
-
- Projf(tmp, start, axis);
- VecSubf(start, start, tmp);
-
- Normalize(end);
- Normalize(start);
-
- Crossf(tmp, start, end);
-
- if (Inpf(tmp, axis) < 0.0)
- angle = -acos(Inpf(start, end));
- else
- angle = acos(Inpf(start, end));
- }
- else {
- float mtx[3][3];
-
- Mat3CpyMat4(mtx, t->viewmat);
-
- Mat3MulVecfl(mtx, end);
- Mat3MulVecfl(mtx, start);
-
- angle = atan2(start[1],start[0]) - atan2(end[1],end[0]);
- }
-
- if (angle > M_PI) {
- angle = angle - 2 * M_PI;
- }
- else if (angle < -(M_PI)) {
- angle = 2 * M_PI + angle;
- }
-
- return angle;
-}
-
-float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
-{
- float d1[3], d2[3], center[3];
-
- VECCOPY(center, t->center);
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, center);
- }
-
- VecSubf(d1, p1, center);
- VecSubf(d2, p2, center);
-
- if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) {
- Mat3MulVecfl(t->con.pmtx, d1);
- Mat3MulVecfl(t->con.pmtx, d2);
- }
-
- return VecLength(d2) / VecLength(d1);
-}
-
-/********************** CALC **************************/
-
-void CalcSnapGrid(TransInfo *t, float *vec)
-{
- snapGridAction(t, t->tsnap.snapPoint, BIG_GEARS);
-}
-
-void CalcSnapGeometry(TransInfo *t, float *vec)
-{
- /* Object mode */
- if (G.obedit == NULL)
- {
- if (t->spacetype == SPACE_VIEW3D)
- {
- float vec[3];
- float no[3];
- int found = 0;
- int dist = 40; // Use a user defined value here
-
- found = snapObjects(&dist, vec, no, NOT_SELECTED);
- if (found == 1)
- {
- float tangent[3];
-
- VecSubf(tangent, vec, t->tsnap.snapPoint);
- tangent[2] = 0;
-
- if (Inpf(tangent, tangent) > 0)
- {
- VECCOPY(t->tsnap.snapTangent, tangent);
- }
-
- VECCOPY(t->tsnap.snapPoint, vec);
- VECCOPY(t->tsnap.snapNormal, no);
-
- t->tsnap.status |= POINT_INIT;
- }
- else
- {
- t->tsnap.status &= ~POINT_INIT;
- }
- }
- }
- /* Mesh edit mode */
- else if (G.obedit != NULL && G.obedit->type==OB_MESH)
- {
- if (t->spacetype == SPACE_VIEW3D)
- {
- float vec[3];
- float no[3];
- int found = 0;
- int dist = 40; // Use a user defined value here
-
- found = snapObjects(&dist, vec, no, NOT_ACTIVE);
- if (found == 1)
- {
- VECCOPY(t->tsnap.snapPoint, vec);
- VECCOPY(t->tsnap.snapNormal, no);
-
- t->tsnap.status |= POINT_INIT;
- }
- else
- {
- t->tsnap.status &= ~POINT_INIT;
- }
- }
- else if (t->spacetype == SPACE_IMAGE)
- { /* same as above but for UV's */
- MTFace *nearesttf=NULL;
- float aspx, aspy;
- int face_corner;
-
- find_nearest_uv(&nearesttf, NULL, NULL, &face_corner);
-
- if (nearesttf != NULL)
- {
- VECCOPY2D(t->tsnap.snapPoint, nearesttf->uv[face_corner]);
-
- transform_aspect_ratio_tface_uv(&aspx, &aspy);
- t->tsnap.snapPoint[0] *= aspx;
- t->tsnap.snapPoint[1] *= aspy;
-
- //Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint);
-
- t->tsnap.status |= POINT_INIT;
- }
- else
- {
- t->tsnap.status &= ~POINT_INIT;
- }
- }
- }
-}
-
-/********************** TARGET **************************/
-
-void TargetSnapCenter(TransInfo *t)
-{
- // Only need to calculate once
- if ((t->tsnap.status & TARGET_INIT) == 0)
- {
- VECCOPY(t->tsnap.snapTarget, t->center);
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget);
- }
-
- t->tsnap.status |= TARGET_INIT;
- }
-}
-
-void TargetSnapActive(TransInfo *t)
-{
- // Only need to calculate once
- if ((t->tsnap.status & TARGET_INIT) == 0)
- {
- TransData *td = NULL;
- TransData *active_td = NULL;
- int i;
-
- for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
- {
- if (td->flag & TD_ACTIVE)
- {
- active_td = td;
- break;
- }
- }
-
- if (active_td)
- {
- VECCOPY(t->tsnap.snapTarget, active_td->center);
-
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget);
- }
-
- t->tsnap.status |= TARGET_INIT;
- }
- /* No active, default to median */
- else
- {
- t->tsnap.modeTarget = SNAP_MEDIAN;
- t->tsnap.targetSnap = TargetSnapMedian;
- TargetSnapMedian(t);
- }
- }
-}
-
-void TargetSnapMedian(TransInfo *t)
-{
- // Only need to calculate once
- if ((t->tsnap.status & TARGET_INIT) == 0)
- {
- TransData *td = NULL;
- int i;
-
- t->tsnap.snapTarget[0] = 0;
- t->tsnap.snapTarget[1] = 0;
- t->tsnap.snapTarget[2] = 0;
-
- for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
- {
- VecAddf(t->tsnap.snapTarget, t->tsnap.snapTarget, td->center);
- }
-
- VecMulf(t->tsnap.snapTarget, 1.0 / t->total);
-
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget);
- }
-
- t->tsnap.status |= TARGET_INIT;
- }
-}
-
-void TargetSnapClosest(TransInfo *t)
-{
- // Only valid if a snap point has been selected
- if (t->tsnap.status & POINT_INIT)
- {
- TransData *closest = NULL, *td = NULL;
-
- /* Object mode */
- if (t->flag & T_OBJECT)
- {
- int i;
- for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
- {
- struct BoundBox *bb = object_get_boundbox(td->ob);
-
- /* use boundbox if possible */
- if (bb)
- {
- int j;
-
- for (j = 0; j < 8; j++) {
- float loc[3];
- float dist;
-
- VECCOPY(loc, bb->vec[j]);
- Mat4MulVecfl(td->ext->obmat, loc);
-
- dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
-
- if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
- {
- VECCOPY(t->tsnap.snapTarget, loc);
- closest = td;
- t->tsnap.dist = dist;
- }
- }
- }
- /* use element center otherwise */
- else
- {
- float loc[3];
- float dist;
-
- VECCOPY(loc, td->center);
-
- dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
-
- if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
- {
- VECCOPY(t->tsnap.snapTarget, loc);
- closest = td;
- t->tsnap.dist = dist;
- }
- }
- }
- }
- else
- {
- int i;
- for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++)
- {
- float loc[3];
- float dist;
-
- VECCOPY(loc, td->center);
-
- if(t->flag & (T_EDIT|T_POSE)) {
- Object *ob= G.obedit?G.obedit:t->poseobj;
- Mat4MulVecfl(ob->obmat, loc);
- }
-
- dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint);
-
- if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist))
- {
- VECCOPY(t->tsnap.snapTarget, loc);
- closest = td;
- t->tsnap.dist = dist;
- }
- }
- }
-
- t->tsnap.status |= TARGET_INIT;
- }
-}
-/*================================================================*/
-
-int snapDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth, short EditMesh)
-{
- int retval = 0;
- int totvert = dm->getNumVerts(dm);
- int totface = dm->getNumFaces(dm);
-
- if (totvert > 0) {
- float imat[4][4];
- float timat[3][3]; /* transpose inverse matrix for normals */
- float ray_start_local[3], ray_normal_local[3];
- int test = 1;
-
- Mat4Invert(imat, obmat);
-
- Mat3CpyMat4(timat, imat);
- Mat3Transp(timat);
-
- VECCOPY(ray_start_local, ray_start);
- VECCOPY(ray_normal_local, ray_normal);
-
- Mat4MulVecfl(imat, ray_start_local);
- Mat4Mul3Vecfl(imat, ray_normal_local);
-
-
- /* If number of vert is more than an arbitrary limit,
- * test against boundbox first
- * */
- if (totface > 16) {
- struct BoundBox *bb = object_get_boundbox(ob);
- test = ray_hit_boundbox(bb, ray_start_local, ray_normal_local);
- }
-
- if (test == 1) {
-
- switch (G.scene->snap_mode)
- {
- case SCE_SNAP_MODE_FACE:
- {
- MVert *verts = dm->getVertArray(dm);
- MFace *faces = dm->getFaceArray(dm);
- int *index_array = NULL;
- int index = 0;
- int i;
-
- if (EditMesh)
- {
- index_array = dm->getFaceDataArray(dm, CD_ORIGINDEX);
- EM_init_index_arrays(0, 0, 1);
- }
-
- for( i = 0; i < totface; i++) {
- EditFace *efa = NULL;
- MFace *f = faces + i;
- float lambda;
- int result;
-
- test = 1; /* reset for every face */
-
- if (EditMesh)
- {
- if (index_array)
- {
- index = index_array[i];
- }
- else
- {
- index = i;
- }
-
- if (index == ORIGINDEX_NONE)
- {
- test = 0;
- }
- else
- {
- efa = EM_get_face_for_index(index);
-
- if (efa && (efa->h || (efa->v1->f & SELECT) || (efa->v2->f & SELECT) || (efa->v3->f & SELECT) || (efa->v4 && efa->v4->f & SELECT)))
- {
- test = 0;
- }
- }
- }
-
-
- if (test)
- {
- result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, &lambda, NULL);
-
- if (result) {
- float location[3], normal[3];
- float intersect[3];
- float new_depth;
- int screen_loc[2];
- int new_dist;
-
- VECCOPY(intersect, ray_normal_local);
- VecMulf(intersect, lambda);
- VecAddf(intersect, intersect, ray_start_local);
-
- VECCOPY(location, intersect);
-
- if (f->v4)
- CalcNormFloat4(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co, normal);
- else
- CalcNormFloat(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, normal);
-
- Mat4MulVecfl(obmat, location);
-
- new_depth = VecLenf(location, ray_start);
-
- project_int(location, screen_loc);
- new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]);
-
- if (new_dist <= *dist && new_depth < *depth)
- {
- *depth = new_depth;
- retval = 1;
-
- VECCOPY(loc, location);
- VECCOPY(no, normal);
-
- Mat3MulVecfl(timat, no);
- Normalize(no);
-
- *dist = new_dist;
- }
- }
-
- if (f->v4 && result == 0)
- {
- result = RayIntersectsTriangle(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL);
-
- if (result) {
- float location[3], normal[3];
- float intersect[3];
- float new_depth;
- int screen_loc[2];
- int new_dist;
-
- VECCOPY(intersect, ray_normal_local);
- VecMulf(intersect, lambda);
- VecAddf(intersect, intersect, ray_start_local);
-
- VECCOPY(location, intersect);
-
- if (f->v4)
- CalcNormFloat4(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co, normal);
- else
- CalcNormFloat(verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, normal);
-
- Mat4MulVecfl(obmat, location);
-
- new_depth = VecLenf(location, ray_start);
-
- project_int(location, screen_loc);
- new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]);
-
- if (new_dist <= *dist && new_depth < *depth)
- {
- *depth = new_depth;
- retval = 1;
-
- VECCOPY(loc, location);
- VECCOPY(no, normal);
-
- Mat3MulVecfl(timat, no);
- Normalize(no);
-
- *dist = new_dist;
- }
- }
- }
- }
- }
-
- if (EditMesh)
- {
- EM_free_index_arrays();
- }
- break;
- }
- case SCE_SNAP_MODE_VERTEX:
- {
- MVert *verts = dm->getVertArray(dm);
- int *index_array = NULL;
- int index = 0;
- int i;
-
- if (EditMesh)
- {
- index_array = dm->getVertDataArray(dm, CD_ORIGINDEX);
- EM_init_index_arrays(1, 0, 0);
- }
-
- for( i = 0; i < totvert; i++) {
- EditVert *eve = NULL;
- MVert *v = verts + i;
-
- test = 1; /* reset for every vert */
-
- if (EditMesh)
- {
- if (index_array)
- {
- index = index_array[i];
- }
- else
- {
- index = i;
- }
-
- if (index == ORIGINDEX_NONE)
- {
- test = 0;
- }
- else
- {
- eve = EM_get_vert_for_index(index);
-
- if (eve && (eve->h || (eve->f & SELECT)))
- {
- test = 0;
- }
- }
- }
-
-
- if (test)
- {
- float dvec[3];
-
- VecSubf(dvec, v->co, ray_start_local);
-
- if (Inpf(ray_normal_local, dvec) > 0)
- {
- float location[3];
- float new_depth;
- int screen_loc[2];
- int new_dist;
-
- VECCOPY(location, v->co);
-
- Mat4MulVecfl(obmat, location);
-
- new_depth = VecLenf(location, ray_start);
-
- project_int(location, screen_loc);
- new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]);
-
- if (new_dist <= *dist && new_depth < *depth)
- {
- *depth = new_depth;
- retval = 1;
-
- VECCOPY(loc, location);
-
- NormalShortToFloat(no, v->no);
- Mat3MulVecfl(timat, no);
- Normalize(no);
-
- *dist = new_dist;
- }
- }
- }
- }
-
- if (EditMesh)
- {
- EM_free_index_arrays();
- }
- break;
- }
- case SCE_SNAP_MODE_EDGE:
- {
- MVert *verts = dm->getVertArray(dm);
- MEdge *edges = dm->getEdgeArray(dm);
- int totedge = dm->getNumEdges(dm);
- int *index_array = NULL;
- int index = 0;
- int i;
-
- if (EditMesh)
- {
- index_array = dm->getEdgeDataArray(dm, CD_ORIGINDEX);
- EM_init_index_arrays(0, 1, 0);
- }
-
- for( i = 0; i < totedge; i++) {
- EditEdge *eed = NULL;
- MEdge *e = edges + i;
-
- test = 1; /* reset for every vert */
-
- if (EditMesh)
- {
- if (index_array)
- {
- index = index_array[i];
- }
- else
- {
- index = i;
- }
-
- if (index == ORIGINDEX_NONE)
- {
- test = 0;
- }
- else
- {
- eed = EM_get_edge_for_index(index);
-
- if (eed && (eed->h || (eed->v1->f & SELECT) || (eed->v2->f & SELECT)))
- {
- test = 0;
- }
- }
- }
-
-
- if (test)
- {
- float intersect[3] = {0, 0, 0}, ray_end[3], dvec[3];
- int result;
-
- VECCOPY(ray_end, ray_normal_local);
- VecMulf(ray_end, 2000);
- VecAddf(ray_end, ray_start_local, ray_end);
-
- result = LineIntersectLine(verts[e->v1].co, verts[e->v2].co, ray_start_local, ray_end, intersect, dvec); /* dvec used but we don't care about result */
-
- if (result)
- {
- float edge_loc[3], vec[3];
- float mul;
-
- /* check for behind ray_start */
- VecSubf(dvec, intersect, ray_start_local);
-
- VecSubf(edge_loc, verts[e->v1].co, verts[e->v2].co);
- VecSubf(vec, intersect, verts[e->v2].co);
-
- mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc);
-
- if (mul > 1) {
- mul = 1;
- VECCOPY(intersect, verts[e->v1].co);
- }
- else if (mul < 0) {
- mul = 0;
- VECCOPY(intersect, verts[e->v2].co);
- }
-
- if (Inpf(ray_normal_local, dvec) > 0)
- {
- float location[3];
- float new_depth;
- int screen_loc[2];
- int new_dist;
-
- VECCOPY(location, intersect);
-
- Mat4MulVecfl(obmat, location);
-
- new_depth = VecLenf(location, ray_start);
-
- project_int(location, screen_loc);
- new_dist = abs(screen_loc[0] - mval[0]) + abs(screen_loc[1] - mval[1]);
-
- if (new_dist <= *dist && new_depth < *depth)
- {
- float n1[3], n2[3];
-
- *depth = new_depth;
- retval = 1;
-
- VecSubf(edge_loc, verts[e->v1].co, verts[e->v2].co);
- VecSubf(vec, intersect, verts[e->v2].co);
-
- mul = Inpf(vec, edge_loc) / Inpf(edge_loc, edge_loc);
-
- NormalShortToFloat(n1, verts[e->v1].no);
- NormalShortToFloat(n2, verts[e->v2].no);
- VecLerpf(no, n2, n1, mul);
- Normalize(no);
-
- VECCOPY(loc, location);
-
- Mat3MulVecfl(timat, no);
- Normalize(no);
-
- *dist = new_dist;
- }
- }
- }
- }
- }
-
- if (EditMesh)
- {
- EM_free_index_arrays();
- }
- break;
- }
- }
- }
- }
-
- return retval;
-}
-
-int snapObjects(int *dist, float *loc, float *no, int mode) {
- Base *base;
- float depth = FLT_MAX;
- int retval = 0;
- short mval[2];
- float ray_start[3], ray_normal[3];
-
- getmouseco_areawin(mval);
- viewray(mval, ray_start, ray_normal);
-
- if (mode == NOT_ACTIVE)
- {
- DerivedMesh *dm;
- Object *ob = G.obedit;
-
- dm = editmesh_get_derived_cage(CD_MASK_BAREMESH);
-
- retval = snapDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth, 1);
-
- dm->release(dm);
- }
-
- base= FIRSTBASE;
- for ( base = FIRSTBASE; base != NULL; base = base->next ) {
- if ( BASE_SELECTABLE(base) && (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && ((mode == NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || (mode == NOT_ACTIVE && base != BASACT)) ) {
- Object *ob = base->object;
-
- if (ob->transflag & OB_DUPLI)
- {
- DupliObject *dupli_ob;
- ListBase *lb = object_duplilist(G.scene, ob);
-
- for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
- {
- Object *ob = dupli_ob->ob;
-
- if (ob->type == OB_MESH) {
- DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
- int val;
-
- val = snapDerivedMesh(ob, dm, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth, 0);
-
- retval = retval || val;
-
- dm->release(dm);
- }
- }
-
- free_object_duplilist(lb);
- }
-
- if (ob->type == OB_MESH) {
- DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
- int val;
-
- val = snapDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth, 0);
-
- retval = retval || val;
-
- dm->release(dm);
- }
- }
- }
-
- return retval;
-}
-
-/*================================================================*/
-
-static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action);
-
-
-void snapGridAction(TransInfo *t, float *val, GearsType action) {
- float fac[3];
-
- fac[NO_GEARS] = t->snap[0];
- fac[BIG_GEARS] = t->snap[1];
- fac[SMALL_GEARS] = t->snap[2];
-
- applyGrid(t, val, t->idx_max, fac, action);
-}
-
-
-void snapGrid(TransInfo *t, float *val) {
- int invert;
- GearsType action;
-
- // Only do something if using Snap to Grid
- if (t->tsnap.modePoint != SNAP_GRID)
- return;
-
- if(t->mode==TFM_ROTATION || t->mode==TFM_WARP || t->mode==TFM_TILT || t->mode==TFM_TRACKBALL || t->mode==TFM_BONE_ROLL)
- invert = U.flag & USER_AUTOROTGRID;
- else if(t->mode==TFM_RESIZE || t->mode==TFM_SHEAR || t->mode==TFM_BONESIZE || t->mode==TFM_SHRINKFATTEN || t->mode==TFM_CURVE_SHRINKFATTEN)
- invert = U.flag & USER_AUTOSIZEGRID;
- else
- invert = U.flag & USER_AUTOGRABGRID;
-
- if(invert) {
- action = (G.qual & LR_CTRLKEY) ? NO_GEARS: BIG_GEARS;
- }
- else {
- action = (G.qual & LR_CTRLKEY) ? BIG_GEARS : NO_GEARS;
- }
-
- if (action == BIG_GEARS && (G.qual & LR_SHIFTKEY)) {
- action = SMALL_GEARS;
- }
-
- snapGridAction(t, val, action);
-}
-
-
-static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action)
-{
- int i;
- float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3)
-
- // Early bailing out if no need to snap
- if (fac[action] == 0.0)
- return;
-
- /* evil hack - snapping needs to be adapted for image aspect ratio */
- if((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) {
- transform_aspect_ratio_tface_uv(asp, asp+1);
- }
-
- for (i=0; i<=max_index; i++) {
- val[i]= fac[action]*asp[i]*(float)floor(val[i]/(fac[action]*asp[i]) +.5);
- }
-}
diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c
deleted file mode 100644
index 612e068c6ca..00000000000
--- a/source/blender/src/unwrapper.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_utildefines.h"
-#include "BKE_customdata.h"
-
-#include "BLI_arithb.h"
-#include "BLI_edgehash.h"
-#include "BLI_editVert.h"
-
-#include "BIF_editsima.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_editmesh.h"
-
-#include "blendef.h"
-#include "mydevice.h"
-
-#include "BDR_unwrapper.h"
-
-#include "PIL_time.h"
-
-#include "parametrizer.h"
-
-/* Set tface seams based on edge data, uses hash table to find seam edges. */
-
-static void hash_add_face(EdgeHash *ehash, MFace *mf)
-{
- BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL);
- BLI_edgehash_insert(ehash, mf->v2, mf->v3, NULL);
- if(mf->v4) {
- BLI_edgehash_insert(ehash, mf->v3, mf->v4, NULL);
- BLI_edgehash_insert(ehash, mf->v4, mf->v1, NULL);
- }
- else
- BLI_edgehash_insert(ehash, mf->v3, mf->v1, NULL);
-}
-
-void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index)
-{
- MFace *mf;
- int a, doit=1, mark=0;
- char *linkflag;
- EdgeHash *ehash, *seamhash;
- MEdge *med;
-
- ehash= BLI_edgehash_new();
- seamhash = BLI_edgehash_new();
- linkflag= MEM_callocN(sizeof(char)*me->totface, "linkflaguv");
-
- for(med=me->medge, a=0; a < me->totedge; a++, med++)
- if(med->flag & ME_SEAM)
- BLI_edgehash_insert(seamhash, med->v1, med->v2, NULL);
-
- if (mode==0 || mode==1) {
- /* only put face under cursor in array */
- mf= ((MFace*)me->mface) + index;
- hash_add_face(ehash, mf);
- linkflag[index]= 1;
- }
- else {
- /* fill array by selection */
- mf= me->mface;
- for(a=0; a<me->totface; a++, mf++) {
- if(mf->flag & ME_HIDE);
- else if(mf->flag & ME_FACE_SEL) {
- hash_add_face(ehash, mf);
- linkflag[a]= 1;
- }
- }
- }
-
- while(doit) {
- doit= 0;
-
- /* expand selection */
- mf= me->mface;
- for(a=0; a<me->totface; a++, mf++) {
- if(mf->flag & ME_HIDE)
- continue;
-
- if(!linkflag[a]) {
- mark= 0;
-
- if(!BLI_edgehash_haskey(seamhash, mf->v1, mf->v2))
- if(BLI_edgehash_haskey(ehash, mf->v1, mf->v2))
- mark= 1;
- if(!BLI_edgehash_haskey(seamhash, mf->v2, mf->v3))
- if(BLI_edgehash_haskey(ehash, mf->v2, mf->v3))
- mark= 1;
- if(mf->v4) {
- if(!BLI_edgehash_haskey(seamhash, mf->v3, mf->v4))
- if(BLI_edgehash_haskey(ehash, mf->v3, mf->v4))
- mark= 1;
- if(!BLI_edgehash_haskey(seamhash, mf->v4, mf->v1))
- if(BLI_edgehash_haskey(ehash, mf->v4, mf->v1))
- mark= 1;
- }
- else if(!BLI_edgehash_haskey(seamhash, mf->v3, mf->v1))
- if(BLI_edgehash_haskey(ehash, mf->v3, mf->v1))
- mark = 1;
-
- if(mark) {
- linkflag[a]= 1;
- hash_add_face(ehash, mf);
- doit= 1;
- }
- }
- }
-
- }
-
- BLI_edgehash_free(ehash, NULL);
- BLI_edgehash_free(seamhash, NULL);
-
- if(mode==0 || mode==2) {
- for(a=0, mf=me->mface; a<me->totface; a++, mf++)
- if(linkflag[a])
- mf->flag |= ME_FACE_SEL;
- else
- mf->flag &= ~ME_FACE_SEL;
- }
- else if(mode==1) {
- for(a=0, mf=me->mface; a<me->totface; a++, mf++)
- if(linkflag[a] && (mf->flag & ME_FACE_SEL))
- break;
-
- if (a<me->totface) {
- for(a=0, mf=me->mface; a<me->totface; a++, mf++)
- if(linkflag[a])
- mf->flag &= ~ME_FACE_SEL;
- }
- else {
- for(a=0, mf=me->mface; a<me->totface; a++, mf++)
- if(linkflag[a])
- mf->flag |= ME_FACE_SEL;
- }
- }
-
- MEM_freeN(linkflag);
-
- BIF_undo_push("Select linked UV face");
- object_tface_flags_changed(OBACT, 0);
-}
-
-/* Parametrizer */
-ParamHandle *construct_param_handle(EditMesh *em, short implicit, short fill, short sel)
-{
- int a;
- MTFace *tf;
-
- EditFace *efa;
- EditEdge *eed;
- EditVert *ev;
-
- ParamHandle *handle;
-
- handle = param_construct_begin();
-
- if ((G.scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT)==0) {
- efa = EM_get_actFace(1);
- if (efa) {
- float aspx, aspy;
- MTFace *tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- image_final_aspect(tface->tpage, &aspx, &aspy);
-
- if (aspx!=aspy)
- param_aspect_ratio(handle, aspx, aspy);
- }
- }
-
- /* we need the vert indicies */
- for (ev= em->verts.first, a=0; ev; ev= ev->next, a++)
- ev->tmp.l = a;
-
- for (efa= em->faces.first; efa; efa= efa->next) {
- ParamKey key, vkeys[4];
- ParamBool pin[4], select[4];
- float *co[4];
- float *uv[4];
- int nverts;
-
- if ((efa->h) || (sel && (efa->f & SELECT)==0))
- continue;
-
- tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
-
- if (implicit &&
- !( simaUVSel_Check(efa, tf, 0) ||
- simaUVSel_Check(efa, tf, 1) ||
- simaUVSel_Check(efa, tf, 2) ||
- (efa->v4 && simaUVSel_Check(efa, tf, 3)) )
- ) {
- continue;
- }
-
- key = (ParamKey)efa;
- vkeys[0] = (ParamKey)efa->v1->tmp.l;
- vkeys[1] = (ParamKey)efa->v2->tmp.l;
- vkeys[2] = (ParamKey)efa->v3->tmp.l;
-
- co[0] = efa->v1->co;
- co[1] = efa->v2->co;
- co[2] = efa->v3->co;
-
- uv[0] = tf->uv[0];
- uv[1] = tf->uv[1];
- uv[2] = tf->uv[2];
-
- pin[0] = ((tf->unwrap & TF_PIN1) != 0);
- pin[1] = ((tf->unwrap & TF_PIN2) != 0);
- pin[2] = ((tf->unwrap & TF_PIN3) != 0);
-
- select[0] = ((simaUVSel_Check(efa, tf, 0)) != 0);
- select[1] = ((simaUVSel_Check(efa, tf, 1)) != 0);
- select[2] = ((simaUVSel_Check(efa, tf, 2)) != 0);
-
- if (efa->v4) {
- vkeys[3] = (ParamKey)efa->v4->tmp.l;
- co[3] = efa->v4->co;
- uv[3] = tf->uv[3];
- pin[3] = ((tf->unwrap & TF_PIN4) != 0);
- select[3] = (simaUVSel_Check(efa, tf, 3) != 0);
- nverts = 4;
- }
- else
- nverts = 3;
-
- param_face_add(handle, key, nverts, vkeys, co, uv, pin, select);
- }
-
- if (!implicit) {
- for (eed= em->edges.first; eed; eed= eed->next) {
- if(eed->seam) {
- ParamKey vkeys[2];
- vkeys[0] = (ParamKey)eed->v1->tmp.l;
- vkeys[1] = (ParamKey)eed->v2->tmp.l;
- param_edge_set_seam(handle, vkeys);
- }
- }
- }
-
- param_construct_end(handle, fill, implicit);
-
- return handle;
-}
-
-
-extern int EM_texFaceCheck(void);
-
-void unwrap_lscm(short seamcut)
-{
- EditMesh *em = G.editMesh;
- ParamHandle *handle;
- short abf = G.scene->toolsettings->unwrapper == 1;
- short fillholes = G.scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
-
- /* add uvs if there not here */
- if (!EM_texFaceCheck()) {
- if (em && em->faces.first)
- EM_add_data_layer(&em->fdata, CD_MTFACE);
-
- if (!EM_texFaceCheck())
- return;
-
- if (G.sima && G.sima->image) /* this is a bit of a kludge, but assume they want the image on their mesh when UVs are added */
- image_changed(G.sima, G.sima->image);
-
- /* select new UV's */
- if ((G.sima==0 || G.sima->flag & SI_SYNC_UVSEL)==0) {
- EditFace *efa;
- MTFace *tf;
- for(efa=em->faces.first; efa; efa=efa->next) {
- tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- simaFaceSel_Set(efa, tf);
- }
- }
- }
-
- handle = construct_param_handle(em, 0, fillholes, seamcut == 0);
-
- param_lscm_begin(handle, PARAM_FALSE, abf);
- param_lscm_solve(handle);
- param_lscm_end(handle);
-
- param_pack(handle);
-
- param_flush(handle);
-
- param_delete(handle);
-
- if (!seamcut)
- BIF_undo_push("UV unwrap");
-
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void minimize_stretch_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- ParamHandle *handle;
- double lasttime;
- short doit = 1, escape = 0, val, blend = 0;
- unsigned short event = 0;
- short fillholes = G.scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
-
- if(!EM_texFaceCheck()) return;
-
- handle = construct_param_handle(em, 1, fillholes, 1);
-
- lasttime = PIL_check_seconds_timer();
-
- param_stretch_begin(handle);
-
- while (doit) {
- param_stretch_iter(handle);
-
- while (qtest()) {
- event= extern_qread(&val);
-
- if (val) {
- switch (event) {
- case ESCKEY:
- escape = 1;
- case RETKEY:
- case PADENTER:
- doit = 0;
- break;
- case PADPLUSKEY:
- case WHEELUPMOUSE:
- if (blend < 10) {
- blend++;
- param_stretch_blend(handle, blend*0.1f);
- param_flush(handle);
- lasttime = 0.0f;
- }
- break;
- case PADMINUS:
- case WHEELDOWNMOUSE:
- if (blend > 0) {
- blend--;
- param_stretch_blend(handle, blend*0.1f);
- param_flush(handle);
- lasttime = 0.0f;
- }
- break;
- }
- }
- else if ((event == LEFTMOUSE) || (event == RIGHTMOUSE)) {
- escape = (event == RIGHTMOUSE);
- doit = 0;
- }
- }
-
- if (!doit)
- break;
-
- if (PIL_check_seconds_timer() - lasttime > 0.5) {
- char str[100];
-
- param_flush(handle);
-
- sprintf(str, "Stretch minimize. Blend %.2f.", blend*0.1f);
- headerprint(str);
-
- lasttime = PIL_check_seconds_timer();
- object_uvs_changed(OBACT);
- if(G.sima->lock) force_draw_plus(SPACE_VIEW3D, 0);
- else force_draw(0);
- }
- }
-
- if (escape)
- param_flush_restore(handle);
- else
- param_flush(handle);
-
- param_stretch_end(handle);
-
- param_delete(handle);
-
- BIF_undo_push("UV stretch minimize");
-
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-void pack_charts_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- ParamHandle *handle;
-
- if(!EM_texFaceCheck()) return;
-
- handle = construct_param_handle(em, 1, 0, 1);
- param_pack(handle);
- param_flush(handle);
- param_delete(handle);
-
- BIF_undo_push("UV pack islands");
-
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-
-void average_charts_tface_uv(void)
-{
- EditMesh *em = G.editMesh;
- ParamHandle *handle;
-
- if(!EM_texFaceCheck()) return;
-
- handle = construct_param_handle(em, 1, 0, 1);
- param_average(handle);
- param_flush(handle);
- param_delete(handle);
-
- BIF_undo_push("UV average island scale");
-
- object_uvs_changed(OBACT);
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
-}
-
-/* LSCM live mode */
-
-static ParamHandle *liveHandle = NULL;
-
-void unwrap_lscm_live_begin(void)
-{
- EditMesh *em = G.editMesh;
- short abf = G.scene->toolsettings->unwrapper == 1;
- short fillholes = G.scene->toolsettings->uvcalc_flag & UVCALC_FILLHOLES;
-
- if(!EM_texFaceCheck()) return;
-
- liveHandle = construct_param_handle(em, 0, fillholes, 1);
-
- param_lscm_begin(liveHandle, PARAM_TRUE, abf);
-}
-
-void unwrap_lscm_live_re_solve(void)
-{
- if (liveHandle) {
- param_lscm_solve(liveHandle);
- param_flush(liveHandle);
- }
-}
-
-void unwrap_lscm_live_end(short cancel)
-{
- if (liveHandle) {
- param_lscm_end(liveHandle);
- if (cancel)
- param_flush_restore(liveHandle);
- param_delete(liveHandle);
- liveHandle = NULL;
- }
-}
-
diff --git a/source/blender/src/verse_common.c b/source/blender/src/verse_common.c
deleted file mode 100644
index 1336151e3af..00000000000
--- a/source/blender/src/verse_common.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "mydevice.h"
-
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-
-#include "BKE_global.h"
-#include "BKE_blender.h"
-
-#include "BIF_verse.h"
-#include "BIF_space.h"
-#include "BIF_interface.h"
-
-extern ListBase session_list;
-extern ListBase server_list;
-
-/*
- * this function creates popup menu with all active VerseSessions
- * it return pointer at selected VerseSession, if no VerseSession
- * is selected, then NULL is returned
- */
-VerseSession *session_menu(void)
-{
- struct VerseSession *session;
- char session_number[10];
- short i=1, num=1;
- char session_address_list[1024]; /* pupmenu business */
-
- session_number[0] = '\0';
- session_address_list[0] = '\0';
-
- strcat(session_address_list, "Session list %t");
-
- session = session_list.first;
-
- while(session){
- strcat(session_address_list, "| ");
- strcat(session_address_list, session->address);
- strcat(session_address_list, " %x");
- sprintf(session_number, "%d", num);
- strcat(session_address_list, session_number);
- num++;
- session = session->next;
- }
-
- printf("session list: %s\n", session_address_list);
- num = pupmenu(session_address_list);
-
- if(num==-1) return NULL;
-
- session = session_list.first;
-
- while(session) {
- if(i==num) return session;
- i++;
- session = session->next;
- }
-
- return NULL;
-}
-
-/*
- * returns name of verse client (it is used as avatar's name)
- */
-char *verse_client_name(void)
-{
- char *client_name;
- char blender_version[5];
- short name_lenght = 14;
-
-#ifndef WIN32
- char *hostname;
- hostname = getenv("HOSTNAME");
- if(hostname) name_lenght += strlen(hostname);
-#endif
-
- client_name = (char*)MEM_mallocN(sizeof(char)*name_lenght, "verse client name");
- client_name[0] = '\0';
-
- strcat(client_name, "blender_");
- blender_version[0] = '\0';
- sprintf(blender_version, "%d", BLENDER_VERSION);
- strcat(client_name, blender_version);
-
-#ifndef WIN32
- /* add at the end of the client name hostname */
- if(hostname) {
- strcat(client_name, ":");
- strcat(client_name, hostname);
- }
-#endif
-
- return client_name;
-}
-
-/*===========================================================
- *
- * functions executed after calling callback functions
- *
- ============================================================*/
-
-/*
- * this function is called, when some tag was changed or new tag was created
- */
-void post_tag_change(VTag *vtag)
-{
- printf("\tnew tag %s was created or changed\n", vtag->name);
-}
-
-/*
- * this function is called, when verse taggroup was created
- */
-void post_taggroup_create(VTagGroup *vtaggroup)
-{
- printf("\tnew taggroup %s was created\n", vtaggroup->name);
-}
-
-/*
- * this function is called after creating of new VerseNode
- */
-void post_node_create(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
-
- if((session->flag & VERSE_AUTOSUBSCRIBE) && (vnode->owner_id != VN_OWNER_MINE)) {
- if(vnode->type == V_NT_OBJECT) {
- create_object_from_verse_node(vnode);
- }
- else if(vnode->type == V_NT_GEOMETRY) {
- create_mesh_from_geom_node(vnode);;
- }
- }
-
- allqueue(REDRAWOOPS, 0);
-}
-
-/*
- * this function is called after destroying of VerseNode
- */
-void post_node_destroy(VNode *vnode)
-{
- allqueue(REDRAWOOPS, 0);
-
- /* TODO: destroy bindings between vnode and blender data structures */
-}
-
-/*
- * this function is calles after renaming of VerseNode by verse_server
- */
-void post_node_name_set(VNode *vnode)
-{
- /* if VerseNode has coresponding blender data structure, then
- * change ID name of data structure */
- if(vnode->type==V_NT_OBJECT) {
- struct Object *ob;
- ob = (Object*)((VObjectData*)vnode->data)->object;
- if(ob) {
- char *str;
- str = (char*)malloc(sizeof(char)*(strlen(vnode->name)+3));
- str[0] = '\0';
- strcat(str, "OB");
- strcat(str, vnode->name);
- strncpy(ob->id.name, str, 23);
- printf("\tob->id.name: %s\n", ob->id.name);
- free(str);
- }
- }
- else if(vnode->type==V_NT_GEOMETRY) {
- struct Mesh *me;
-
- me = (Mesh*)((VGeomData*)vnode->data)->mesh;
- if(me) {
- char *str;
- str = (char*)malloc(sizeof(char)*(strlen(vnode->name)+3));
- str[0] = '\0';
- strcat(str, "ME");
- strcat(str, vnode->name);
- strncpy(me->id.name, str, 23);
- printf("\tme->id.name: %s\n", me->id.name);
- free(str);
- }
- }
-
- allqueue(REDRAWALL, 0);
-}
-
-/*
- * this function is called after acception connection with verse server
- */
-void post_connect_accept(VerseSession *session)
-{
- VerseServer *server;
-
- G.f |= G_VERSE_CONNECTED;
-
- session->counter = 0;
-
- server = server_list.first;
- while(server) {
- if(strcmp(server->ip, session->address)==0) {
- server->flag = session->flag;
- break;
- }
- server = server->next;
- }
-
- allqueue(REDRAWOOPS, 0);
-}
-
-void post_server_add(void)
-{
- allqueue(REDRAWOOPS, 0);
-}
-
-/*
- * this function is called, when connestion with verse server is ended/terminated/etc.
- */
-void post_connect_terminated(VerseSession *session)
-{
- VerseServer *server;
- server = server_list.first;
- while(server) {
- if(strcmp(server->ip, session->address)==0) {
- server->flag = 0;
- server->session=NULL;
- break;
- }
- server = server->next;
- }
-
- /* if it is last session, then no other will exist ... set Global flag */
- if((session->prev==NULL) && (session->next==NULL))
- G.f &= ~G_VERSE_CONNECTED;
-
- allqueue(REDRAWOOPS, 0);
-}
-
-/*
- * if connection wasn't accepted, then free VerseSession
- * and print warning message with popupmenu
- */
-void post_connect_update(VerseSession *session)
-{
- if(session->flag & VERSE_CONNECTING) {
- session->counter++;
- if(session->counter > MAX_UNCONNECTED_EVENTS) {
- char *str;
- /* popup menu*/
- str = malloc(sizeof(char)*(strlen(session->address)+35));
- str[0]='\0';
- strcat(str, "Error%t|No response from server: ");
- strcat(str, session->address);
- pupmenu(str);
- free(str);
-
- session->flag = 0;
- session->counter = 0;
- session->post_connect_terminated(session);
- free_verse_session(session);
- }
- }
-}
-
-#endif
-
diff --git a/source/blender/src/verse_image.c b/source/blender/src/verse_image.c
deleted file mode 100644
index edb3a0a9f2c..00000000000
--- a/source/blender/src/verse_image.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include <string.h>
-
-#include "mydevice.h"
-
-#include "BKE_verse.h"
-#include "BKE_image.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_image_types.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "BDR_drawmesh.h"
-
-#include "BIF_verse.h"
-#include "BIF_space.h"
-
-#include "GPU_draw.h"
-
-/*
- * unsubscribe from verse bitmap
- */
-void unsubscribe_from_bitmap_node(VNode *vnode)
-{
- if(vnode->type != V_NT_BITMAP) return;
-
- /* TODO */
-}
-
-/*
- * upload image to verse server
- */
-void push_image_to_verse_server(VerseSession *session, Image *image)
-{
- ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- struct VNode *vnode;
-
- if(!session) return;
-
- if(!(session->flag & VERSE_CONNECTED)) return;
-
- /* create "my" new object VerseNode */
- vnode= create_verse_node(session, -1 , V_NT_BITMAP, VN_OWNER_MINE);
- /* create object data */
- vnode->data = create_bitmap_data();
-
- /* set up name of VerseNode */
- vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(image->id.name)-1), "object node name");
- vnode->name[0] = '\0';
- strcat(vnode->name, image->id.name+2);
-
- /* set up dimension of image */
- if(ibuf) {
- ((VBitmapData*)vnode->data)->width = ibuf->x;
- ((VBitmapData*)vnode->data)->height = ibuf->y;
- }
- else {
- ((VBitmapData*)vnode->data)->width = 0;
- ((VBitmapData*)vnode->data)->height = 0;
- }
- ((VBitmapData*)(vnode->data))->height = 1;
-
- /* set up pointers between Object and VerseNode */
- ((VBitmapData*)vnode->data)->image = (void*)image;
- image->vnode = (void*)vnode;
-
- /* add node to sending queue */
- add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE);
-}
-
-/*
- * synchronize blender image channel (R,G,B,A) with verse bitmap layer
- */
-void sync_blender_image_channel_with_verse_layer(VNode *vnode, VBitmapLayer *vblayer)
-{
- struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image;
- struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- unsigned char *rect;
- int x, y, height, t_width, i, channel=0;
-
- if(!image) return;
-
- if(!ibuf) return;
-
- rect = (unsigned char*)ibuf->rect;
-
- /* select channel due to verse layer name */
- if(strcmp(vblayer->name,"col_r")==0)
- channel = 0;
- else if(strcmp(vblayer->name,"col_g")==0)
- channel = 1;
- else if(strcmp(vblayer->name, "col_b")==0)
- channel = 2;
- else if(strcmp(vblayer->name,"alpha")==0)
- channel = 3;
-
-#ifdef VERSE_DEBUG_PRINT
- printf(" %s:%d\n", vblayer->name, channel);
-#endif
-
- height = ((VBitmapData*)(vnode->data))->height;
- t_width = ((VBitmapData*)(vnode->data))->t_width;
-
- i = (height-1)*t_width;
-
-#ifdef VERSE_DEBUG_PRINT
- printf("\ti:%d\n", i);
-#endif
-
- if(vblayer->type==VN_B_LAYER_UINT8) {
- unsigned char *vuint8 = (unsigned char*)vblayer->data;
- for(y=height-1; y>=0; y--, i=y*t_width)
- for(x=0; x<ibuf->x; x++, rect+=4, i++)
- rect[channel] = (char)vuint8[i];
- }
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/*
- * synchronize blender image with verse image
- */
-void sync_blender_image_with_verse_bitmap_node(VNode *vnode)
-{
- struct VBitmapLayer *vblayer;
-
- vblayer = ((VBitmapData*)(vnode->data))->layers.lb.first;
-
- while(vblayer) {
-#ifdef VERSE_DEBUG_PRINT
- printf("\tsyncing layer:");
-#endif
- sync_blender_image_channel_with_verse_layer(vnode, vblayer);
- vblayer = vblayer->next;
- }
-}
-
-/*
- * This function is called, when some other verse client change dimension of image.
- * It is neccesary to reallocate blender image too, when dimension of verse image
- * is different from blender image.
- */
-void post_bitmap_dimension_set(VNode *vnode)
-{
- struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image;
- struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
-
- if(!image) return;
-
- if(!ibuf) return;
-
- if(vnode->owner_id == VN_OWNER_MINE) {
- if( ((VBitmapData*)vnode->data)->layers.lb.first == NULL ) {
- /* send all verse bitmap layers (RGBA) to verse server */
- printf("\tsending all bitmap layers to verse server\n");
- verse_send_b_layer_create(vnode->id, -1, "col_r", VN_B_LAYER_UINT8);
- verse_send_b_layer_create(vnode->id, -1, "col_g", VN_B_LAYER_UINT8);
- verse_send_b_layer_create(vnode->id, -1, "col_b", VN_B_LAYER_UINT8);
- verse_send_b_layer_create(vnode->id, -1, "alpha", VN_B_LAYER_UINT8);
-
- return;
- }
- }
-
- if((ibuf->x!=((VBitmapData*)vnode->data)->width) || (ibuf->y!=((VBitmapData*)vnode->data)->height)) {
- struct VBitmapLayer *vblayer;
- struct ImBuf *new_ibuf;
-
- /* allocate new ibuf */
- new_ibuf= IMB_allocImBuf(((VBitmapData*)vnode->data)->width,
- ((VBitmapData*)vnode->data)->height, 24, IB_rect, 0);
- /* free old ibuf */
- BKE_image_signal(image, NULL, IMA_SIGNAL_FREE);
- /* set up pointer at new ibuf */
- BKE_image_assign_ibuf(image, ibuf);
-
- /* sync blender image with all verse layers */
- vblayer = ((VBitmapData*)(vnode->data))->layers.lb.first;
- while(vblayer) {
- sync_blender_image_channel_with_verse_layer(vnode, vblayer);
- vblayer = vblayer->next;
- }
- }
-}
-
-/*
- * when blender tries to upload image to verse server, then it is neccessary
- * to push coresponding channel data to verse server, when verse bitmap layer
- * was created
- */
-void post_bitmap_layer_create(VBitmapLayer *vblayer)
-{
- struct VNode *vnode = vblayer->vnode;
- struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image;
- struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- unsigned char *rect;
- short channel;
-/* VNBTile tile[VN_B_TILE_SIZE*VN_B_TILE_SIZE];
- unsigned int width, t_width, height, t_height, x, y, i, j; */
-
- /* if this application doesn't try to upload this image to verse
- * server then do nothing */
- if(vnode->owner_id != VN_OWNER_MINE) return;
-
- if(!image) return;
-
- if(!ibuf) return;
-
- rect = (unsigned char*)ibuf->rect;
-
- if(strncmp(vblayer->name, "col_r", 5))
- channel = 0;
- else if(strncmp(vblayer->name, "col_g", 5))
- channel = 1;
- else if(strncmp(vblayer->name, "col_b", 5))
- channel = 2;
- else if(strncmp(vblayer->name, "alpha", 5))
- channel = 3;
-
- /* TODO: send all data of channel to verse server */
-}
-
-/*
- * dummy function now
- */
-void post_bitmap_layer_destroy(VBitmapLayer *vblayer)
-{
-}
-
-/*
- * this function is executed, when some image changed tile comes from verse server,
- * it is neccessary to do some crazy transformation here, because blender uses
- * different (very unstandard) image coordinate system (begining of coordinate
- * system is in bottom left corner) ... all other programs (including verse) has
- * begining of image coordinate system in left top corner
- */
-void post_bitmap_tile_set(VBitmapLayer *vblayer, unsigned int xs, unsigned int ys)
-{
- struct VNode *vnode = vblayer->vnode;
- struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image;
- struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
- unsigned char *rect, *i_rect;
- unsigned int x, y, t_width, t_height, height, m_ys, m_y, d, i, j, channel=0;
-
- if(!image) return;
-
- if(!ibuf) return;
-
- /* select channel due to verse layer name */
- if(strcmp(vblayer->name,"color_r")==0)
- channel = 0;
- else if(strcmp(vblayer->name,"color_g")==0)
- channel = 1;
- else if(strcmp(vblayer->name, "color_b")==0)
- channel = 2;
- else if(strcmp(vblayer->name,"transparency")==0)
- channel = 3;
-
- i_rect = rect = (unsigned char*)ibuf->rect;
-
- /* width of verse image including all tiles */
- t_width =((VBitmapData*)vnode->data)->t_width;
- /* height of verse image including all tiles */
- t_height =((VBitmapData*)vnode->data)->t_height;
- /* height of blender image */
- height = ((VBitmapData*)vnode->data)->height;
-
- /* if the bitmap's dimensions are not integer multiples of the tile
- * side length, eight, then d will not be zero (height of "uncomplete
- * tile") */
- d = VN_B_TILE_SIZE - (t_height - height);
- /* mirrored coordination of received tile */
- m_ys = t_height - ys - VN_B_TILE_SIZE;
-
- /* ys and m_ys are y axis, where we will do some changes */
- if(ys + VN_B_TILE_SIZE > height) {
- m_ys = 0;
- ys = ys + d - 1;
- }
- else {
- m_ys = m_ys - VN_B_TILE_SIZE + d;
- ys = ys + VN_B_TILE_SIZE - 1;
- }
-
- /* "index" of blender image */
- j = m_ys*ibuf->x + xs;
- /* index of verse image */
- i = ys*t_width + xs;
-
- /* pointer at image data, that will be changed in following loop */
- rect = i_rect + 4*j;
-
- /* it seems hackish, but I didn't find better solution :-/ */
- if(vblayer->type==VN_B_LAYER_UINT8) {
- unsigned char *vuint8 = (unsigned char*)vblayer->data;
- for(y=ys, m_y = m_ys;
- (m_y<m_ys+VN_B_TILE_SIZE) && (m_y<ibuf->y);
- y--, m_y++, i=y*t_width+xs, j=m_y*ibuf->x+xs, rect=i_rect+4*j)
- for(x=xs; (x<xs+VN_B_TILE_SIZE) && (x<ibuf->x); x++, rect+=4, i++, j++)
- rect[channel] = (char)vuint8[i];
- }
-
- GPU_free_image(image);
-
- /* redraw preview of image ... uncommented, because rendering
- * was computed too often */
-/* BIF_preview_changed(ID_TE); */
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-#endif
-
diff --git a/source/blender/src/verse_mesh.c b/source/blender/src/verse_mesh.c
deleted file mode 100644
index f2769c0d7e6..00000000000
--- a/source/blender/src/verse_mesh.c
+++ /dev/null
@@ -1,1626 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "mydevice.h"
-
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-#include "BLI_edgehash.h"
-#include "BLI_editVert.h"
-
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_utildefines.h"
-#include "BKE_verse.h"
-
-#include "BIF_verse.h"
-#include "BIF_editmesh.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-
-#include "BSE_edit.h"
-
-#include "editmesh.h"
-
-#include "verse.h"
-
-/* prototypes of static functions */
-
-static void mark_changed_face_obsolete(struct VerseFace *vface);
-static void sync_verseface_with_editface(struct VLayer *vlayer, struct VerseFace *vface);
-
-void createVerseVertNL(struct EditVert *ev, struct VNode *vnode, struct VLayer *vlayer);
-static void createAllVerseVerts(struct VNode *vnode, struct VLayer *vlayer);
-void createVerseFaceNL(struct EditFace *efa, struct VNode *vnode, struct VLayer *vlayer);
-static void createAllVerseFaces(struct VNode *vnode, struct VLayer *vlayer);
-
-/*=============================================================================
- *
- * functions handling verse/blender FACES
- *
- *===========================================================================*/
-
-/*
- * create new VerseFace (polygon), due to information about EditFace
- * put VerseFace to queue ... send to verse host (server)
- */
-void createVerseFace(EditFace *efa)
-{
- if(G.editMesh->vnode) {
- struct VLayer *vlayer = find_verse_layer_type((VGeomData*)((VNode*)G.editMesh->vnode)->data, POLYGON_LAYER);
- createVerseFaceNL(efa, (VNode*)G.editMesh->vnode, vlayer);
- }
- else efa->vface = NULL;
-}
-
-/*
- * create new VerseFace (polygon), due to information about EditFace
- * put VerseFace to queue ... send to verse host (server)
- * NL version of function (infomration about verse node and
- * layer is known ... optimalisation)
- */
-void createVerseFaceNL(EditFace *efa, VNode *vnode, VLayer *vlayer)
-{
- struct VerseFace *vface;
-
- vface = (VerseFace*)create_verse_face(vlayer, vlayer->counter, -1, -1, -1, -1);
-
- vface->face = (void*)efa;
- efa->vface = (void*)vface;
-
- vface->flag |= FACE_SEND_READY;
-
- /* EditVert #1 */
- if(efa->v1) {
- if(efa->v1->vvert) {
- vface->vvert0 = (VerseVert*)efa->v1->vvert;
- if(((VerseVert*)efa->v1->vvert)->flag & VERT_RECEIVED) {
- vface->v0 = ((VerseVert*)efa->v1->vvert)->id;
- vface->counter--;
- }
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- }
- else
- vface->counter--;
-
- /* EditVert #2 */
- if(efa->v2) {
- if(efa->v2->vvert) {
- vface->vvert1 = (VerseVert*)efa->v2->vvert;
- if(((VerseVert*)efa->v2->vvert)->flag & VERT_RECEIVED) {
- vface->v1 = ((VerseVert*)efa->v2->vvert)->id;
- vface->counter--;
- }
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- }
- else
- vface->counter--;
- /* EditVert #3 */
- if(efa->v3) {
- if(efa->v3->vvert) {
- vface->vvert2 = (VerseVert*)efa->v3->vvert;
- if(((VerseVert*)efa->v3->vvert)->flag & VERT_RECEIVED) {
- vface->v2 = ((VerseVert*)efa->v3->vvert)->id;
- vface->counter--;
- }
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- }
- else
- vface->counter--;
- /* EditVert #4 */
- if(efa->v4) {
- if(efa->v4->vvert) {
- vface->vvert3 = (VerseVert*)efa->v4->vvert;
- if(((VerseVert*)efa->v4->vvert)->flag & VERT_RECEIVED) {
- vface->v3 = ((VerseVert*)efa->v4->vvert)->id;
- vface->counter--;
- }
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- }
- else
- vface->counter--;
-
- add_item_to_send_queue(&(vlayer->queue), (void*)vface, VERSE_FACE);
-}
-
-/*
- * creates new verse faces, add all of then to queue ... send to verse server
- */
-static void createAllVerseFaces(VNode *vnode, VLayer *vlayer)
-{
- if(G.obedit) {
- struct EditMesh *em;
- struct EditFace *efa;
-
- em = G.editMesh;
-
- efa = em->faces.first;
- /* push all EditFaces to the verse server */
- while(efa){
- createVerseFaceNL(efa, vnode, vlayer);
- efa = efa->next;
- }
- }
-}
-
-/*
- * When verse face is changed during sending/receiving from verse server, then
- * this verse face is marked as obsolete and it will be send again, when it
- * will be received from verse server
- */
-static void mark_changed_face_obsolete(VerseFace *vface)
-{
- struct EditFace *efa = (EditFace*)vface->face;
-
- if(efa) {
- if(vface->vvert0->vertex != efa->v1) vface->flag |= FACE_OBSOLETE;
- if(vface->vvert1->vertex != efa->v2) vface->flag |= FACE_OBSOLETE;
- if(vface->vvert2->vertex != efa->v3) vface->flag |= FACE_OBSOLETE;
- if(vface->vvert3 && (vface->vvert3->vertex != efa->v4)) vface->flag |= FACE_OBSOLETE;
- }
-}
-
-/*
- * this function will sync EditFace and VerseFace and it will send changes to
- * verse server too
- */
-static void sync_verseface_with_editface(VLayer *vlayer, VerseFace *vface)
-{
- struct EditFace *efa = (EditFace*)vface->face;
- int dosend = 0;
-
- /* edit face and probably verse face was deleted */
- if(!efa || (vface->flag & FACE_DELETED)) return;
-
- /* blender nor verse don't support such crazy things */
- if(!(vface->vvert0) || !(vface->vvert1) || !(vface->vvert2)) {
- printf("\tERROR: vface->vvert0: %p, vface->vvert1: %p, vface->vvert2: %p\n", vface->vvert0, vface->vvert1, vface->vvert2);
- return;
- }
-
- /* initialize verse face flag */
- vface->flag |= FACE_SEND_READY;
-
- /* debug print */
-#if 0
- printf("\n");
- if(efa->v4) {
- printf("\tefa->v1,v2,v3,v4->vvert->id: %d, %d, %d, %d\n",
- ((VerseVert*)efa->v1->vvert)->id,
- ((VerseVert*)efa->v2->vvert)->id,
- ((VerseVert*)efa->v3->vvert)->id,
- ((VerseVert*)efa->v4->vvert)->id);
- printf("\tefa->v1,v2,v3,v4->vvert: %p, %p, %p, %p\n",
- efa->v1->vvert,
- efa->v2->vvert,
- efa->v3->vvert,
- efa->v4->vvert);
- }
- else {
- printf("\tefa->v1,v2,v3->vvert->id: %d, %d, %d, NULL\n",
- ((VerseVert*)efa->v1->vvert)->id,
- ((VerseVert*)efa->v2->vvert)->id,
- ((VerseVert*)efa->v3->vvert)->id);
- printf("\tefa->v1,v2,v3,v4->vvert: %p, %p, %p, NULL\n",
- efa->v1->vvert,
- efa->v2->vvert,
- efa->v3->vvert);
- }
- printf("\tvface->vvert0, vvvert1, vvvert2, vvvert3: %p, %p, %p, %p\n",
- vface->vvert0,
- vface->vvert1,
- vface->vvert2,
- vface->vvert3);
-
- printf("\tefa->v1, v2, v3, v4: %p, %p, %p, %p\n",
- efa->v1,
- efa->v2,
- efa->v3,
- efa->v4);
- if(vface->vvert3) {
- printf("\tvface->v0,v1,v2,v3: %d, %d, %d, %d\n",
- vface->v0,
- vface->v1,
- vface->v2,
- vface->v3);
- printf("\tvface->vvert0,vvvert1,vvvert2,vvvert3->vertex: %p, %p, %p, %p\n",
- vface->vvert0->vertex,
- vface->vvert1->vertex,
- vface->vvert2->vertex,
- vface->vvert3->vertex);
- }
- else {
- printf("\tvface->v0,v1,v2,v3: %d, %d, %d, NULL\n",
- vface->v0,
- vface->v1,
- vface->v2);
- printf("\tvface->vvert0,vvvert1,vvvert2->vertex: %p, %p, %p, NULL\n",
- vface->vvert0->vertex,
- vface->vvert1->vertex,
- vface->vvert2->vertex);
- }
-#endif
-
- /* initialize counter of unreceived vertexes */
- vface->counter = 4;
-
- /* 1st vertex */
- if(vface->vvert0->vertex != efa->v1) {
- dosend = 1;
- vface->vvert0->counter--;
- vface->vvert0 = (VerseVert*)efa->v1->vvert;
- vface->v0 = vface->vvert0->id;
- if(vface->vvert0->flag & VERT_RECEIVED)
- vface->counter--;
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- else
- vface->counter--;
-
- /* 2nd vertex */
- if(vface->vvert1->vertex != efa->v2) {
- dosend = 1;
- vface->vvert1->counter--;
- vface->vvert1 = (VerseVert*)efa->v2->vvert;
- vface->v1 = vface->vvert1->id;
- if(vface->vvert1->flag & VERT_RECEIVED)
- vface->counter--;
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- else
- vface->counter--;
-
- /* 3th vertex */
- if(vface->vvert2->vertex != efa->v3) {
- dosend = 1;
- vface->vvert2->counter--;
- vface->vvert2 = (VerseVert*)efa->v3->vvert;
- vface->v2 = vface->vvert2->id;
- if(vface->vvert2->flag & VERT_RECEIVED)
- vface->counter--;
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- else
- vface->counter--;
-
- /* 4th vertex */
- if(vface->vvert3 && ((vface->vvert3->vertex != efa->v4) || (vface->vvert3 && !efa->v4) || (vface->v3 != vface->vvert3->id))) {
- dosend = 1;
- if(efa->v4) {
- vface->vvert3->counter--;
- vface->vvert3 = (VerseVert*)efa->v4->vvert;
- vface->v3 = vface->vvert3->id;
- if(vface->vvert3->flag & VERT_RECEIVED)
- vface->counter--;
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- else {
- vface->vvert3->counter--;
- vface->vvert3 = NULL;
- vface->v3 = -1;
- vface->counter--;
- }
- }
- /* verse face has 4 vertexes now, not 3 vertexes as in past */
- else if(!(vface->vvert3) && efa->v4) {
- dosend = 1;
- vface->vvert3 = (VerseVert*)efa->v4->vvert;
- vface->v3 = vface->vvert3->id;
- if(vface->vvert3->flag & VERT_RECEIVED)
- vface->counter--;
- else
- vface->flag &= ~FACE_SEND_READY;
- }
- else
- vface->counter--;
-
- if(dosend) {
- /* printf("\tsending CHANGED FACE\n");
- printf("\t\tnew: %d %d %d %d\n", vface->v0, vface->v1, vface->v2, vface->v3);*/
- vface->flag |= FACE_CHANGED;
- /* remove verse face from list of received faces */
- BLI_dlist_rem_item(&(vlayer->dl), vface->id);
- /* and add verse face again to sending queue */
- add_item_to_send_queue(&(vlayer->queue), (void*)vface, VERSE_FACE);
- }
-}
-
-/*
- * this function will sync all VerseFaces with coresponding EditFaces,
- * this is useful, when some editmesh tool has changed editface pointers at
- * vertexes (edges), parameter of this function is geometry node
- */
-void sync_all_versefaces_with_editfaces(VNode *vnode)
-{
- struct VLayer *vlayer;
- struct VerseFace *vface, *nvface;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- /* mark changed verse faces in sending queue as obsolete at the first time */
- vface = vlayer->queue.first;
- while(vface) {
- mark_changed_face_obsolete(vface);
- vface = vface->next;
- }
-
- /* send all received and changed verse face again to verse server */
- vface = vlayer->dl.lb.first;
- while(vface) {
- nvface = vface->next;
- sync_verseface_with_editface(vlayer, vface);
- vface = nvface;
- }
-}
-
-/*
- * send delete polygon command to verse server
- */
-void b_verse_send_face_delete(EditFace *efa)
-{
- ((VerseFace*)efa->vface)->face = NULL;
- send_verse_face_delete((VerseFace*)efa->vface);
- efa->vface = NULL;
-}
-
-/*=============================================================================
- *
- * functions handling verse/blender VERTEXES
- *
- *===========================================================================*/
-
-/*
- * this function will sync position of all VerseVerts with EditVerts
- * this function is called after actions: Smooth, Noise and To Sphere,
- * because position of vertexes isn't managed by transform system
- */
-void sync_all_verseverts_with_editverts(VNode *vnode)
-{
- struct VLayer *vlayer;
- struct VerseVert *vvert;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
-
- vvert = vlayer->dl.lb.first;
-
- /* sync all received vertexes */
- while(vvert) {
- send_versevert_pos(vvert);
- vvert = vvert->next;
- }
-
- vvert = vlayer->queue.first;
-
- /* sync all unreceived vertexes (mar pos as obsolete, when
- * actual position was changed) */
- while(vvert) {
- send_versevert_pos(vvert);
- vvert = vvert->next;
- }
-
- verse_callback_update(0);
-}
-
-/*
- * send delete vertex command to verse server
- */
-void b_verse_send_vertex_delete(EditVert *eve)
-{
- ((VerseVert*)eve->vvert)->vertex = NULL;
- send_verse_vertex_delete((VerseVert*)eve->vvert);
- eve->vvert = NULL;
-}
-
-/*
- * send position of verse vertex to verse server
- */
-void send_versevert_pos(VerseVert *vvert)
-{
- /* delete command was sent to verse server ... sending one
- * more position command would create new vertex */
- if ((vvert->flag & VERT_DELETED) | (vvert->flag & VERT_OBSOLETE)) return;
-
- /* don't send position of verse vertex to verse server, because it could create
- * new vertex */
- if(vvert->flag & VERT_RECEIVED) {
- if(vvert->flag & VERT_LOCKED) {
- /* when position of verse vert was sent to verse server
- * and it wasn't received yet, then mark sent position
- * as obsolete ... blender will automaticaly send actual
- * position, when old will be received */
- vvert->flag |= VERT_POS_OBSOLETE;
- }
- else {
- struct EditVert *eve = (EditVert*)vvert->vertex;
- /* send position to verse server, when it is different from actual position */
- if(eve && (eve->co[0]!=vvert->co[0] || eve->co[1]!=vvert->co[1] || eve->co[2]!=vvert->co[2])) {
- /* lock vertex and send its position to verse server,
- * locking of vertex prevents from sending too many
- * informations about vertex position during draging
- * of vertex */
- vvert->flag |= VERT_LOCKED;
- VECCOPY(vvert->co, eve->co);
- send_verse_vertex(vvert);
- }
- }
- }
- else {
- /* we created this vertex and we sent new position to verse server, but "confirmation" command about
- * position of vertex didn't arrived yet, then we can't send new position of vertex ... we only mark
- * position of vertex as obsolete and new position will be sent to verse server, when confirmation
- * command will arive */
- struct EditVert *eve = (EditVert*)vvert->vertex;
- if(eve && (eve->co[0]!=vvert->co[0] || eve->co[1]!=vvert->co[1] || eve->co[2]!=vvert->co[2])) {
- vvert->flag |= VERT_POS_OBSOLETE;
- }
- }
-
- verse_callback_update(0);
-}
-
-/*
- * create new VerseVert due to information about EditVert,
- * put VerseVert to queue ... send to verse host (server)
- */
-void createVerseVert(EditVert *eve)
-{
- if(G.editMesh->vnode) {
- struct VLayer *vlayer = find_verse_layer_type((VGeomData*)((VNode*)G.editMesh->vnode)->data, VERTEX_LAYER);
- createVerseVertNL(eve, (VNode*)G.editMesh->vnode, vlayer);
- }
- else eve->vvert = NULL;
-}
-
-/*
- * create new VerseVert due to information about EditVert,
- * put VerseVert to queue ... send to verse host (server)
- * NL version of function (infomration about verse node and
- * layer is known ... optimalisation)
- */
-void createVerseVertNL(EditVert *eve, VNode *vnode, VLayer *vlayer)
-{
- struct VerseVert *vvert;
-
- vvert = create_verse_vertex(vlayer, vlayer->counter, eve->co[0], eve->co[1], eve->co[2]);
-
- vvert->vertex = (void*)eve;
- eve->vvert = (void*)vvert;
-
- vvert->flag |= VERT_LOCKED;
-
-/* printf("\tsend_versevert_pos: %d create and LOCK \n", vvert->id);*/
-
- /* add vvert to sending queue */
- add_item_to_send_queue(&(vlayer->queue), (void*)vvert, VERSE_VERT);
-}
-
-/*
- * create new verse vertexes due to all vertexes and send all of them to verse server
- */
-static void createAllVerseVerts(VNode *vnode, VLayer *vlayer)
-{
- if(G.obedit) {
- struct EditMesh *em;
- struct EditVert *eve;
-
- em = G.editMesh;
- eve = em->verts.first;
-
- /* push all EditVertexes to the verse server */
- while(eve){
- createVerseVertNL(eve, vnode, vlayer);
- eve = eve->next;
- }
- }
-}
-
-/*
- * unsubscribe from verse geometry layers of verse geometry node
- * and clear bindings between verse node and mesh
- */
-void unsubscribe_from_geom_node(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
-
- struct VLayer *vlayer = ((VGeomData*)vnode->data)->layers.lb.first;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- /* free bindings between verse node and blender mesh*/
- if(((VGeomData*)vnode->data)->mesh) {
- ((Mesh*)((VGeomData*)vnode->data)->mesh)->vnode = NULL;
- ((VGeomData*)vnode->data)->mesh = NULL;
- }
-
- /* free bindings between verse node and blender editmesh */
- if(((VGeomData*)vnode->data)->editmesh) {
- ((EditMesh*)((VGeomData*)vnode->data)->editmesh)->vnode = NULL;
- ((VGeomData*)vnode->data)->editmesh = NULL;
- }
-
- /* free all verse layer data and unsubscribe from all layers */
- while(vlayer) {
- BLI_dlist_reinit(&(vlayer->dl));
- BLI_freelistN(&(vlayer->queue));
- BLI_freelistN(&(vlayer->orphans));
-
- if(session->flag & VERSE_CONNECTED)
- verse_send_g_layer_unsubscribe(vnode->id, vlayer->id);
-
- vlayer = vlayer->next;
- }
-
-}
-
-/* ===================================================================================
- *
- * Function executed after execution of callback functions
- *
- * ===================================================================================*/
-
-/*
- * Actions executed after new VerseLayer is created
- */
-void post_layer_create(struct VLayer *vlayer)
-{
- /* if we are owners of VerseNode, then push geometry to verse server */
- if(vlayer->vnode->owner_id == VN_OWNER_MINE) {
- switch(vlayer->type){
- case VN_G_LAYER_VERTEX_XYZ:
-/* if(vlayer->id==0) createAllVerseVerts(vlayer->vnode, vlayer);
- break;*/
- case VN_G_LAYER_POLYGON_CORNER_UINT32:
-/* if(vlayer->id==1) createAllVerseFaces(vlayer->vnode, vlayer);
- break;*/
- case VN_G_LAYER_VERTEX_UINT32:
- case VN_G_LAYER_VERTEX_REAL:
- case VN_G_LAYER_POLYGON_CORNER_REAL:
- case VN_G_LAYER_POLYGON_FACE_UINT8:
- case VN_G_LAYER_POLYGON_FACE_UINT32:
- case VN_G_LAYER_POLYGON_FACE_REAL:
- break;
- }
- }
- else {
- switch(vlayer->type) {
- case VN_G_LAYER_VERTEX_XYZ:
- case VN_G_LAYER_POLYGON_CORNER_UINT32:
- case VN_G_LAYER_VERTEX_UINT32:
- case VN_G_LAYER_VERTEX_REAL:
- case VN_G_LAYER_POLYGON_CORNER_REAL:
- case VN_G_LAYER_POLYGON_FACE_UINT8:
- case VN_G_LAYER_POLYGON_FACE_UINT32:
- case VN_G_LAYER_POLYGON_FACE_REAL:
- break;
- }
- }
-}
-
-/*
- * Actions after destroying of VerseLayer
- */
-void post_layer_destroy(struct VLayer *vlayer)
-{
-}
-
-/*
- * Actions executed after creating of new VerseVert, when object is in edit
- * mode, and this client didn't create this VerseVert (vvert->vertex is NULL),
- * then new editvert is created
- */
-void post_vertex_create(VerseVert *vvert)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vvert->vlayer->vnode;
- struct EditMesh *em=NULL;
-
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh;
- }
-
- /* when vert was changed during sending to verse server, then
- * we have to send it to verse server again */
- if(vvert->flag & VERT_POS_OBSOLETE) {
- vvert->flag &= ~VERT_POS_OBSOLETE;
-
- if(em && (vvert->vertex)) {
- struct EditVert *eve = (EditVert*)vvert->vertex;
- VECCOPY(vvert->co, eve->co);
- send_verse_vertex(vvert);
- verse_callback_update(0);
-
- return;
- }
- }
-
- if(em && !(vvert->vertex)) {
- struct EditVert *eve;
-
- /* to prevent never ending loop of sending and receiving
- * vertexes, because addvertlist() sends new vertex to verse
- * server if em->vnode isn't NULL */
- em->vnode = NULL;
- eve = addvertlist(vvert->co, NULL);
- em->vnode = (void*)geom_vnode;
-
- eve->vvert = (void*)vvert;
- vvert->vertex = (void*)eve;
-
- countall();
-
- recalc_editnormals();
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * Actions executed, when position of VerseVert was changed
- * position of EditVert is changed in edit mode
- */
-void post_vertex_set_xyz(VerseVert *vvert)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vvert->vlayer->vnode;
- struct EditVert *eve = NULL;
-
- /* when vert was changed during sending to verse server, then
- * we have to send it to verse server again */
- if(vvert->flag & VERT_POS_OBSOLETE) {
- if(vvert->vertex) {
- vvert->flag &= ~VERT_POS_OBSOLETE;
- vvert->flag |= VERT_LOCKED;
-
- eve = (EditVert*)vvert->vertex;
- VECCOPY(vvert->co, eve->co);
- send_verse_vertex(vvert);
- verse_callback_update(0);
- }
- else {
- printf("\terror: vvert->vertex shouldn't be NULL\n");
- }
-
- return;
- }
-
- /* when shared object is in edit mode, then update editmesh */
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- if(vvert->vertex) {
- eve = (EditVert*)vvert->vertex;
- VECCOPY(eve->co, vvert->co);
- recalc_editnormals();
- }
- else {
- printf("\terror: vvert->vertex shouldn't be NULL\n");
- }
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * Actions executed after deleting of VerseVert
- */
-void post_vertex_delete(VerseVert *vvert)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vvert->vlayer->vnode;
- struct EditMesh *em = NULL;
- struct EditEdge *ed, *edn;
- struct EditVert *eve = NULL;
-
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh;
- eve = (EditVert*)vvert->vertex;
- }
-
- if(em && eve) {
- /*printf("\tPOST_VERTEX_DELETE()\n");*/
-
- /* delete all edges needing eve vertex */
- ed = em->edges.first;
- while(ed) {
- edn = ed->next;
- if(ed->v1==eve || ed->v2==eve) {
- remedge(ed);
- free_editedge(ed);
- }
- ed = edn;
- }
-
- eve->vvert = NULL;
- BLI_remlink(&em->verts, eve);
- free_editvert(eve);
- vvert->vertex = NULL;
-
- countall();
-
- recalc_editnormals();
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * free constraint between VerseVert and EditVert
- */
-void post_vertex_free_constraint(VerseVert *vvert)
-{
- if(vvert->vertex) {
- ((EditVert*)vvert->vertex)->vvert=NULL;
- vvert->vertex=NULL;
- }
-}
-
-/*
- * Action executed after setting up uint8 value of polygon
- */
-void post_polygon_set_uint8(VerseFace *vface)
-{
-}
-
-/*
- * Action executed after creating of new VerseFace
- */
-void post_polygon_create(VerseFace *vface)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vface->vlayer->vnode;
- struct EditMesh *em = NULL;
-
- /* if verse face was set as deleted during sending to verse server, then send
- * delete command to verse server now ... we know verse face id */
-/* if(vface->flag & FACE_DELETED) {
- send_verse_face_delete(vface);
- return;
- }*/
-
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh;
- }
-
- /* when face was changed during sending to verse server, then
- * we have to send it to verse server again */
- if(vface->flag & FACE_OBSOLETE) {
- vface->flag &= ~FACE_OBSOLETE;
- sync_verseface_with_editface(vface->vlayer, vface);
- return;
- }
-
- if(em && !(vface->face) && (vface->counter==0)) {
- struct VLayer *vlayer;
- struct VerseVert *vvert;
- struct EditFace *efa;
- struct EditVert *eves[4]={NULL, NULL, NULL, NULL};
- uint32 vert_ids[4]={vface->v0, vface->v1, vface->v2, vface->v3};
- int i;
-
- /*printf("\tPOST_POLYGON_CREATE()\n");*/
-
- vlayer = find_verse_layer_type((VGeomData*)geom_vnode->data, VERTEX_LAYER);
-
- for(i=0; i<4; i++) {
- if(vert_ids[i] != -1) {
- vvert = BLI_dlist_find_link(&(vlayer->dl), vert_ids[i]);
- if(vvert) eves[i] = (EditVert*)vvert->vertex;
- }
- }
-
- /* to prevent never ending loop of sending and receiving
- * faces, because addfacelist() sends new face to verse
- * server if em->vnode isn't NULL */
- em->vnode = NULL;
- efa = addfacelist(eves[0], eves[1], eves[2], eves[3], NULL, NULL);
- em->vnode = geom_vnode;
-
- if(efa) {
- efa->vface = vface;
- vface->face = efa;
- }
-
- countall();
-
- recalc_editnormals();
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * Action executed after changes of VerseFace
- * ... order of vertexes was fliped, etc.
- */
-void post_polygon_set_corner(VerseFace *vface)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vface->vlayer->vnode;
- struct EditMesh *em = NULL;
- struct EditFace *efa = NULL;
- struct EditEdge *eed, *eedn;
-
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh;
- efa = (EditFace*)vface->face;
- }
-
- if(em && efa) {
-
- /* when face was changed during sending to verse server, then
- * we have to send it to verse server again */
- if(vface->flag & FACE_OBSOLETE) {
- vface->flag &= ~FACE_OBSOLETE;
- sync_verseface_with_editface(vface->vlayer, vface);
- return;
- }
-
- /* mark all edges, which are part of face efa */
- efa->e1->f2 = 1;
- efa->e2->f2 = 1;
- efa->e3->f2 = 1;
- if(efa->e4) efa->e4->f2 = 1;
-
- /* change pointers at EdtitVerts and decrease counters of "old"
- * VerseVertexes reference ... less VerseFaces will need them */
- if(vface->vvert0 != efa->v1->vvert)
- efa->v1 = (EditVert*)vface->vvert0->vertex;
- if(vface->vvert1 != efa->v2->vvert)
- efa->v2 = (EditVert*)vface->vvert1->vertex;
- if(vface->vvert2 != efa->v3->vvert)
- efa->v3 = (EditVert*)vface->vvert2->vertex;
- if(efa->v4) {
- if(!vface->vvert3)
- efa->v4 = NULL;
- else if(vface->vvert3 != efa->v4->vvert)
- efa->v4 = (EditVert*)vface->vvert3->vertex;
- }
-
- /* change pointers at EditEdges */
-
- /* 1st edge */
- eed = findedgelist(efa->v1, efa->v2);
- if(eed) efa->e1 = eed;
- else efa->e1 = addedgelist(efa->v1, efa->v2, NULL);
-
- /* 2nd edge */
- eed = findedgelist(efa->v2, efa->v3);
- if(eed) efa->e2 = eed;
- else efa->e2 = addedgelist(efa->v2, efa->v3, NULL);
-
- if(efa->v4) {
- /* 3th edge */
- eed = findedgelist(efa->v2, efa->v3);
- if(eed) efa->e3 = eed;
- else efa->e3 = addedgelist(efa->v2, efa->v3, NULL);
- /* 4th edge */
- eed = findedgelist(efa->v4, efa->v1);
- if(eed) efa->e4 = eed;
- else efa->e4 = addedgelist(efa->v4, efa->v1, NULL);
- }
- else {
- /* 3th edge */
- eed = findedgelist(efa->v3, efa->v1);
- if(eed) efa->e3 = eed;
- else efa->e3 = addedgelist(efa->v3, efa->v1, NULL);
- /* 4th edge */
- efa->e4 = NULL;
- }
-
- /* unmark needed edges */
- efa = em->faces.first;
- while(efa) {
- efa->e1->f2 = 0;
- efa->e2->f2 = 0;
- efa->e3->f2 = 0;
- if(efa->e4) efa->e4->f2 = 0;
- efa = efa->next;
- }
-
- /* delete all unneeded edges */
- eed = em->edges.first;
- while(eed) {
- eedn = eed->next;
- if(eed->f2) {
- remedge(eed);
- free_editedge(eed);
- }
- eed = eedn;
- }
-
- countall();
-
- recalc_editnormals();
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * Action executed after deleting of VerseFace
- */
-void post_polygon_delete(VerseFace *vface)
-{
- struct VNode *obj_vnode;
- struct VNode *geom_vnode = vface->vlayer->vnode;
- struct EditMesh *em = NULL;
- struct EditFace *efa = NULL;
- struct EditEdge *eed, *eedn;
-
- if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) {
- em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh;
- efa = (EditFace*)vface->face;
- }
-
- if(em && efa) {
- /*printf("\tPOST_POLYGON_DELETE()\n");*/
-
- /* mark all edges, which are part of face efa */
- efa->e1->f2 = 1;
- efa->e2->f2 = 1;
- efa->e3->f2 = 1;
- if(efa->e4) efa->e4->f2 = 1;
-
- efa->vface = NULL;
- BLI_remlink(&em->faces, efa);
- free_editface(efa);
- vface->face = NULL;
-
- /* following two crazy loops wouldn't be neccessary if verse spec
- * would support edges */
-
- /* unmark needed edges */
- efa = em->faces.first;
- while(efa) {
- efa->e1->f2 = 0;
- efa->e2->f2 = 0;
- efa->e3->f2 = 0;
- if(efa->e4) efa->e4->f2 = 0;
- efa = efa->next;
- }
-
- /* delete all unneeded edges */
- eed = em->edges.first;
- while(eed) {
- eedn = eed->next;
- if(eed->f2) {
- remedge(eed);
- free_editedge(eed);
- }
- eed = eedn;
- }
-
- countall();
- }
-
- if(((VGeomData*)geom_vnode->data)->vlink) {
- obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source;
- DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 1);
- }
-}
-
-/*
- * free constraint between VerseFace and EditFace
- */
-void post_polygon_free_constraint(VerseFace *vface)
-{
- if(vface->face) {
- ((EditFace*)vface->face)->vface = NULL;
- vface->face = NULL;
- }
-}
-
-/*
- * free constraint between VGeomData, EditMesh and Mesh
- */
-void post_geometry_free_constraint(VNode *vnode)
-{
- if(((VGeomData*)vnode->data)->editmesh) {
- G.editMesh->vnode = NULL;
- ((VGeomData*)vnode->data)->editmesh = NULL;
- }
- if(((VGeomData*)vnode->data)->mesh) {
- ((Mesh*)((VGeomData*)vnode->data)->mesh)->vnode = NULL;
- ((VGeomData*)vnode->data)->mesh = NULL;
- }
-}
-
-/* =========================================================================
- *
- * Functions influencing whole EditMesh or VerseMesh
- *
- * ========================================================================= */
-
-/*
- * free all bindings between EditMesh and "verse mesh" ... it is called between
- * restorng editmesh from undo stack
- */
-void destroy_versemesh(VNode *vnode)
-{
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseVert *vvert;
- struct VerseFace *vface;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
-
- /* send delete command to all received verse faces */
- vface = face_vlayer->dl.lb.first;
- while(vface) {
- if(vface->face) ((EditFace*)vface->face)->vface = NULL;
- vface->face = NULL;
- send_verse_face_delete(vface);
- vface = vface->next;
- }
- /* send delete command to all verse faces waiting in orphan list */
- vface = face_vlayer->orphans.first;
- while(vface) {
- if(vface->face) ((EditFace*)vface->face)->vface = NULL;
- vface->face = NULL;
- send_verse_face_delete(vface);
- vface = vface->next;
- }
- /* mark all verse faces waiting in sending queue as deleted,
- * send delete command, when this verse face was changed */
- vface = face_vlayer->queue.first;
- while(vface) {
- if(vface->face) ((EditFace*)vface->face)->vface = NULL;
- vface->face = NULL;
- if(vface->flag & FACE_CHANGED)
- send_verse_face_delete(vface);
- else {
- vface->flag |= FACE_DELETED;
- }
- vface = vface->next;
- }
-
- /* send delete command to all received verse vertexes */
- vvert = vert_vlayer->dl.lb.first;
- while(vvert) {
- if(vvert->vertex) ((EditVert*)vvert->vertex)->vvert = NULL;
- vvert->vertex = NULL;
- send_verse_vertex_delete(vvert);
- vvert = vvert->next;
- }
- /* mark all verse vertexes waiting in sending queue as deleted
- * ... verse vertexes will be deleted, when received */
- vvert = vert_vlayer->queue.first;
- while(vvert) {
- if(vvert->vertex) ((EditVert*)vvert->vertex)->vvert = NULL;
- vvert->vertex = NULL;
- vvert = vvert->next;
- }
-}
-
-/*
- * duplicate geometry verse node, this can be handy, when you duplicate some
- * object or make object single user
- */
-VNode *create_geom_vnode_from_geom_vnode(VNode *vnode)
-{
- struct VNode *n_vnode; /* new verse geometry node */
- struct VGeomData *geom_data; /* new geometry data */
- struct VLayer *n_vert_vlayer, *n_face_vlayer; /* new vertex and polygon layer */
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseVert *n_vvert, *vvert;
- struct VerseFace *n_vface, *vface;
- int i;
-
- if(!vnode) return NULL;
-
- if(vnode->type != V_NT_GEOMETRY) return NULL;
-
- /* create new verse node, when no one exist */
- n_vnode= create_verse_node(vnode->session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE);
- /* create new geometry data */
- geom_data = create_geometry_data();
- n_vnode->data = (void*)geom_data;
-
- /* set up name of VerseNode */
- n_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(vnode->name)-1), "new geom node name");
- n_vnode->name[0] = '\0';
- strcat(n_vnode->name, vnode->name);
-
- /* add node to sending queue */
- add_item_to_send_queue(&(vnode->session->queue), n_vnode, VERSE_NODE);
-
- /* create vertex verse layer */
- n_vert_vlayer = create_verse_layer(n_vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), n_vert_vlayer, VERSE_LAYER);
-
- /* create polygon verse layer */
- n_face_vlayer = create_verse_layer(n_vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), n_face_vlayer, VERSE_LAYER);
-
- /* find vertex layer of old verse node */
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- /* find polygon layer of old verse node */
- face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- /* duplicate verse vertexes */
- for(i=0, vvert = (VerseVert*)vert_vlayer->dl.lb.first; vvert; vvert = vvert->next, i++) {
- n_vvert = create_verse_vertex(n_vert_vlayer, i, vvert->co[0], vvert->co[1], vvert->co[2]);
- vvert->tmp.vvert = n_vvert;
- add_item_to_send_queue(&(n_vert_vlayer->queue), n_vvert, VERSE_VERT);
- }
-
- /* duplicate verse faces (polyons) */
- for(i=0, vface = (VerseFace*)face_vlayer->dl.lb.first; vface; vface = vface->next, i++) {
- n_vface = create_verse_face(n_face_vlayer, i, -1, -1, -1, -1);
- n_vface->vvert0 = vface->vvert0->tmp.vvert;
- n_vface->vvert1 = vface->vvert1->tmp.vvert;
- n_vface->vvert2 = vface->vvert2->tmp.vvert;
- if(vface->vvert3)
- n_vface->vvert3 = vface->vvert3->tmp.vvert;
- else
- n_vface->vvert3 = NULL;
- add_item_to_send_queue(&(n_face_vlayer->queue), n_vface, VERSE_FACE);
- }
-
- return n_vnode;
-}
-
-/*
- * create new geometry node, make bindings between geometry node and editmesh,
- * make bindings between editverts and verseverts, make bindings between editfaces
- * and versefaces
- */
-VNode *create_geom_vnode_data_from_editmesh(VerseSession *session, EditMesh *em)
-{
- struct VNode *vnode;
- struct Mesh *me;
- struct VGeomData *geom_data;
- struct VLayer *vert_vlayer, *face_vlayer;
-
- if(!session) return NULL;
-
- if(!em) return NULL;
-
- /* some verse geometry node already exists */
- if(em->vnode) return NULL;
-
- /* we will need mesh too (mesh name, creating bindings between verse node, etc.) */
- me = get_mesh(G.obedit);
-
- /* create new verse node, when no one exist */
- vnode = create_verse_node(session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE);
- /* create new geometry data */
- geom_data = create_geometry_data();
- vnode->data = (void*)geom_data;
-
- /* set up name of VerseNode */
- vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(me->id.name)-1), "geom node name");
- vnode->name[0] = '\0';
- strcat(vnode->name, me->id.name+2);
-
- /* set up bindings */
- me->vnode = (void*)vnode;
- em->vnode = (void*)vnode;
- geom_data->mesh = (void*)me;
- geom_data->editmesh = (void*)em;
-
- /* add node to sending queue */
- add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE);
-
- /* create vertex verse layer */
- vert_vlayer = create_verse_layer(vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), vert_vlayer, VERSE_LAYER);
-
- /* create polygon verse layer */
- face_vlayer = create_verse_layer(vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), face_vlayer, VERSE_LAYER);
-
- /* create all verse verts and add them to sending queue */
- createAllVerseVerts(vnode, vert_vlayer);
-
- /* create all verse faces and add tehm to sending queue */
- createAllVerseFaces(vnode, face_vlayer);
-
- return vnode;
-}
-
-/*
- * create new geometry node, make bindings between geometry node and mesh and
- * fill geometry node with new data based at mesh data
- */
-VNode *create_geom_vnode_data_from_mesh(VerseSession *session, Mesh *me)
-{
- struct VNode *vnode;
- struct VGeomData *geom_data;
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseVert *vvert, **vverts;
- struct VerseFace *vface;
- struct MVert *mvert;
- struct MFace *mface;
- int i;
-
- if(!session) return NULL;
-
- if(!me) return NULL;
-
- /* some verse geometry node already exists */
- if(me->vnode) return NULL;
-
- /* create new verse node, when no one exist */
- vnode = create_verse_node(session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE);
- /* create new geometry data */
- geom_data = create_geometry_data();
- vnode->data = (void*)geom_data;
-
- /* set up name of VerseNode */
- vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(me->id.name)-1), "geom node name");
- vnode->name[0] = '\0';
- strcat(vnode->name, me->id.name+2);
-
- /* set up bindings */
- me->vnode = (void*)vnode;
- geom_data->mesh = (void*)me;
-
- /* add node to sending queue */
- add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE);
-
- /* create vertex verse layer */
- vert_vlayer = create_verse_layer(vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), vert_vlayer, VERSE_LAYER);
-
- /* create polygon verse layer */
- face_vlayer = create_verse_layer(vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0);
- add_item_to_send_queue(&(geom_data->queue), face_vlayer, VERSE_LAYER);
-
- /* temporary array of VerseVerts */
- vverts = (VerseVert**)MEM_mallocN(sizeof(VerseVert*)*me->totvert,"temp array of vverts");
-
- /* "fill vertex layer with vertexes" and add them to sending queue (send them to verse server) */
- for(i=0, mvert=me->mvert; i<me->totvert; i++, mvert++) {
- vverts[i] = vvert = create_verse_vertex(vert_vlayer, i, mvert->co[0], mvert->co[1], mvert->co[2]);
- add_item_to_send_queue(&(vert_vlayer->queue), vvert, VERSE_VERT);
- }
-
- /* "fill face/polygon layer with faces" and them to sending queue */
- for(i=0, mface = me->mface; i<me->totface; i++, mface++) {
- if(mface->v4) {
- vface = create_verse_face(face_vlayer, i, mface->v1, mface->v2, mface->v3, mface->v4);
- vface->vvert0 = vverts[mface->v1];
- vface->vvert1 = vverts[mface->v2];
- vface->vvert2 = vverts[mface->v3];
- vface->vvert3 = vverts[mface->v4];
- vface->counter = 4;
- }
- else {
- vface = create_verse_face(face_vlayer, i, mface->v1, mface->v2, mface->v3, -1);
- vface->vvert0 = vverts[mface->v1];
- vface->vvert1 = vverts[mface->v2];
- vface->vvert2 = vverts[mface->v3];
- vface->counter = 3;
- }
- add_item_to_send_queue(&(face_vlayer->queue), vface, VERSE_FACE);
- }
-
- MEM_freeN(vverts);
-
- return vnode;
-}
-
-/*
- * creates Mesh from verse geometry node and create bindings
- * between them
- */
-Mesh *create_mesh_from_geom_node(VNode *vnode)
-{
- struct Mesh *me;
-
- if(vnode->type != V_NT_GEOMETRY) return NULL;
-
- /* add new empty mesh*/
- me = add_mesh("Mesh");
- /* set up bindings between mesh and verse node */
- me->vnode = (void*)vnode;
- ((VGeomData*)vnode->data)->mesh = (void*)me;
-
- return me;
-}
-
-/*
- * create mesh from verse mesh
- */
-void create_meshdata_from_geom_node(Mesh *me, VNode *vnode)
-{
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseVert *vvert;
- struct VerseFace *vface;
- struct MVert *mvert;
- struct MFace *mface;
- struct EdgeHash *edges;
- int index;
-
- if(!me || !vnode) return;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- CustomData_free(&me->vdata, me->totvert);
- CustomData_free(&me->edata, me->totedge);
- CustomData_free(&me->fdata, me->totface);
- mesh_update_customdata_pointers(me);
-
- if(me->mselect) {
- MEM_freeN(me->mselect);
- me->mselect = NULL;
- }
-
- me->totvert = vert_vlayer ? vert_vlayer->dl.da.count : 0;
- me->totface = face_vlayer ? face_vlayer->dl.da.count : 0;
- me->totselect = 0;
-
- CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
- CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface);
- mesh_update_customdata_pointers(me);
-
- mvert = me->mvert;
- mface = me->mface;
-
- index = 0;
- vvert = vert_vlayer ? vert_vlayer->dl.lb.first : NULL;
- while(vvert) {
- VECCOPY(mvert->co, vvert->co);
- VECCOPY(mvert->no, vvert->no);
- mvert->flag = 0;
- mvert->mat_nr = 0;
- vvert->tmp.index = index++;
- vvert = vvert->next;
- mvert++;
- }
-
- edges = BLI_edgehash_new();
- vface = face_vlayer ? face_vlayer->dl.lb.first : NULL;
- while(vface) {
- mface->v1 = vface->vvert0->tmp.index;
- mface->v2 = vface->vvert1->tmp.index;
- mface->v3 = vface->vvert2->tmp.index;
-
- if(!BLI_edgehash_haskey(edges, mface->v1, mface->v2))
- BLI_edgehash_insert(edges, mface->v1, mface->v2, NULL);
- if(!BLI_edgehash_haskey(edges, mface->v2, mface->v3))
- BLI_edgehash_insert(edges, mface->v2, mface->v3, NULL);
- if(vface->vvert3) {
- mface->v4 = vface->vvert3->tmp.index;
- if(!BLI_edgehash_haskey(edges, mface->v3, mface->v4))
- BLI_edgehash_insert(edges, mface->v3, mface->v4, NULL);
- if(!BLI_edgehash_haskey(edges, mface->v4, mface->v1))
- BLI_edgehash_insert(edges, mface->v4, mface->v1, NULL);
- } else {
- mface->v4 = 0;
- if(!BLI_edgehash_haskey(edges, mface->v3, mface->v1))
- BLI_edgehash_insert(edges, mface->v3, mface->v1, NULL);
- }
-
- mface->flag = 0;
- mface->pad = 0;
- mface->mat_nr = 0;
- mface->edcode = 0;
-
- /* index 0 isn't allowed at location 3 or 4 */
- test_index_face(mface, NULL, 0, vface->vvert3?4:3);
-/* printf("\t mface: %d, %d, %d, %d\n", mface->v1, mface->v2, mface->v3, mface->v4);*/
-
- vface = vface->next;
- mface++;
- }
-
- me->totedge = BLI_edgehash_size(edges);
-
- if(me->totedge) {
- EdgeHashIterator *i;
- MEdge *medge = me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge);
-
- for(i = BLI_edgehashIterator_new(edges); !BLI_edgehashIterator_isDone(i); BLI_edgehashIterator_step(i), ++medge) {
- memset(medge, 0, sizeof(struct MEdge));
- BLI_edgehashIterator_getKey(i, (int*)&medge->v1, (int*)&medge->v2);
- }
- BLI_edgehashIterator_free(i);
- }
-
- BLI_edgehash_free(edges, NULL);
-
- mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
-}
-
-/*
- * Create EditMesh from VerseMesh and keep system in consitant state, this
- * function is called, when edit mode is entered ... edit mesh is generated
- * from verse mesh (not from Mesh: (Mesh*)ob->data)
- */
-void create_edit_mesh_from_geom_node(VNode *vnode)
-{
- struct VLayer *vert_layer, *face_layer;
- struct VerseVert *vvert;
- struct VerseFace *vface;
- struct Mesh *me;
- struct EditVert *eve, *eve0, *eve1, *eve2, *eve3;
- struct EditFace *efa;
- unsigned int keyindex;
-
- if(!(G.obedit && G.obedit->type==OB_MESH)) return;
- me = (Mesh*)G.obedit->data;
- if(vnode!=(VNode*)me->vnode || vnode->type!=V_NT_GEOMETRY) return;
-
- vert_layer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- face_layer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
-
- if(!(vert_layer && face_layer)) return;
-
- waitcursor(1);
-
- /* free old editMesh */
- free_editMesh(G.editMesh);
-
- G.editMesh->vnode = NULL;
-
- vvert = vert_layer->dl.lb.first;
-
- keyindex = 0;
-
- /* create all EditVerts */
- while(vvert) {
- eve = addvertlist(vvert->co, NULL);
-
- eve->f = 0;
- eve->h = 0;
- eve->data = NULL;
- eve->keyindex = keyindex;
- eve->vvert = (void*)vvert;
-
- vvert->vertex = (void*)eve;
-
- keyindex++;
- vvert = vvert->next;
- }
-
- vface = face_layer->dl.lb.first;
-
- /* create all EditFaces and EditEdges */
- while(vface) {
- if(vface->vvert0) eve0= vface->vvert0->vertex;
- else eve0 = NULL;
- if(vface->vvert1) eve1= vface->vvert1->vertex;
- else eve1 = NULL;
- if(vface->vvert2) eve2= vface->vvert2->vertex;
- else eve2 = NULL;
- if(vface->vvert3) eve3= vface->vvert3->vertex;
- else eve3 = NULL;
-
- efa= addfacelist(eve0, eve1, eve2, eve3, NULL, NULL);
- if(efa) {
- efa->f = 0;
- efa->h = 0;
- efa->vface = (void*)vface;
- vface->face = (void*)efa;
- }
- vface = vface->next;
- }
-
- countall();
-
- recalc_editnormals();
-
- G.editMesh->vnode = (void*)vnode;
- ((VGeomData*)vnode->data)->editmesh = (void*)G.editMesh;
-
- waitcursor(0);
-}
-
-/*
- * destroy bindings between EditMesh and VerseMesh and send delete commands
- * for all VerseVerts and VerseFaces to verse server, Verse Node has to be
- * geometry node
- */
-
-void destroy_verse_mesh(VNode *vnode)
-{
- struct VLayer *vert_vlayer, *face_vlayer;
- struct VerseFace *vface;
- struct VerseVert *vvert;
-
- if(vnode->type != V_NT_GEOMETRY) return;
-
- face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER);
- vface = face_vlayer->dl.lb.first;
-
- while(vface) {
- ((EditFace*)vface->face)->vface = NULL;
- vface->face = NULL;
- vface = vface->next;
- }
-
- vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER);
- vvert = vert_vlayer->dl.lb.first;
-
- while(vvert) {
- ((EditVert*)vvert->vertex)->vvert = NULL;
- vvert->vertex = NULL;
- vvert = vvert->next;
- }
-
- destroy_geometry(vnode);
-}
-
-#endif
-
diff --git a/source/blender/src/verse_object.c b/source/blender/src/verse_object.c
deleted file mode 100644
index e3c87eaf548..00000000000
--- a/source/blender/src/verse_object.c
+++ /dev/null
@@ -1,598 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contributor(s): Jiri Hnidek.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef WITH_VERSE
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "mydevice.h"
-
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_image_types.h"
-#include "DNA_listBase.h"
-
-#include "BLI_dynamiclist.h"
-#include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-#include "BLI_arithb.h"
-
-#include "BIF_verse.h"
-#include "BIF_space.h"
-#include "BIF_editmesh.h"
-#include "BIF_drawimage.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_toolbox.h"
-
-#include "BKE_verse.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-#include "BKE_depsgraph.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_mesh.h"
-#include "BKE_displist.h"
-
-#include "BDR_editobject.h"
-
-#include "verse.h"
-
-/* button callback function, it test object name and send new name to verse server */
-void test_and_send_idbutton_cb(void *obj, void *ob_name)
-{
- struct Object *ob = (Object*)obj;
- char *name= (char*)ob_name;
-
- test_idbutton(name+2);
-
- if(ob->vnode) verse_send_node_name_set(((VNode*)ob->vnode)->id, name+2);
-}
-
-/*
- * duplicate verse object nodes
- */
-void b_verse_duplicate_object(VerseSession *session, Object *ob, Object *n_ob)
-{
- struct VNode *obj_vnode;
-
- if(!session) return;
-
- if(!(session->flag & VERSE_CONNECTED)) return;
-
- /* create "my" new object VerseNode */
- obj_vnode= create_verse_node(session, -1 , V_NT_OBJECT, VN_OWNER_MINE);
- /* create object data */
- obj_vnode->data = create_object_data();
-
- /* set up name of VerseNode */
- obj_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(n_ob->id.name)-1), "object node name");
- obj_vnode->name[0] = '\0';
- strcat(obj_vnode->name, n_ob->id.name+2);
-
- /* set up object node transformation */
- VECCOPY(((VObjectData*)obj_vnode->data)->pos, n_ob->loc);
- EulToQuat(n_ob->rot, ((VObjectData*)obj_vnode->data)->quat);
- VECCOPY(((VObjectData*)obj_vnode->data)->scale, n_ob->size);
-
- /* set up pointers between Object and VerseNode */
- ((VObjectData*)obj_vnode->data)->object = (void*)n_ob;
- n_ob->vnode = (void*)obj_vnode;
-
- /* add node to sending queue */
- add_item_to_send_queue(&(session->queue), obj_vnode, VERSE_NODE);
-
- if(ob->type==OB_MESH) {
- struct Mesh *me;
- struct VNode *geom_vnode;
- struct VLink *vlink;
-
- /* when current mesh already shared at verse server, then only set up link
- * between object node and geometry node */
- if(ob->data == n_ob->data) {
- geom_vnode = (VNode*)((Mesh*)ob->data)->vnode;
- }
- else {
- geom_vnode = create_geom_vnode_from_geom_vnode((VNode*)((Mesh*)ob->data)->vnode);
- me = (Mesh*)n_ob->data;
- me->vnode = (void*)geom_vnode;
- ((VGeomData*)geom_vnode->data)->mesh = (void*)me;
-
- }
- /* create new link between VereseNodes */
- vlink = create_verse_link(session, obj_vnode, geom_vnode, -1, -1, "geometry");
- /* "send" link to verse server */
- add_item_to_send_queue(&(((VObjectData*)obj_vnode->data)->queue), vlink, VERSE_LINK);
- }
-}
-
-/*
- * temp hack: this function push mesh objects (edit mode only) to verse server
- */
-void b_verse_push_object(VerseSession *session, Object *ob)
-{
- struct VNode *obj_vnode;
-
- if(!session) return;
-
- if(!(session->flag & VERSE_CONNECTED)) return;
-
- /* create "my" new object VerseNode */
- obj_vnode= create_verse_node(session, -1 , V_NT_OBJECT, VN_OWNER_MINE);
- /* create object data */
- obj_vnode->data = create_object_data();
-
- /* set up name of VerseNode */
- obj_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(ob->id.name)-1), "object node name");
- obj_vnode->name[0] = '\0';
- strcat(obj_vnode->name, ob->id.name+2);
-
- /* set up object node transformation */
- VECCOPY(((VObjectData*)obj_vnode->data)->pos, ob->loc);
- EulToQuat(ob->rot, ((VObjectData*)obj_vnode->data)->quat);
- VECCOPY(((VObjectData*)obj_vnode->data)->scale, ob->size);
-
- /* set up pointers between Object and VerseNode */
- ((VObjectData*)obj_vnode->data)->object = (void*)ob;
- ob->vnode = (void*)obj_vnode;
-
- /* add node to sending queue */
- add_item_to_send_queue(&(session->queue), obj_vnode, VERSE_NODE);
-
- if(ob->type==OB_MESH) {
- struct VNode *geom_vnode;
- struct VLink *vlink;
-
- if(G.obedit)
- geom_vnode = create_geom_vnode_data_from_editmesh(session, G.editMesh);
- else
- geom_vnode = create_geom_vnode_data_from_mesh(session, get_mesh(ob));
-
- if(geom_vnode) {
- /* create new link between VereseNodes */
- vlink = create_verse_link(session, obj_vnode, geom_vnode, -1, -1, "geometry");
- /* send link to verse server */
- add_item_to_send_queue(&(((VObjectData*)obj_vnode->data)->queue), vlink, VERSE_LINK);
- }
- }
-}
-
-/*
- * creates blender object from verse object node and it
- * will create links between them
- */
-Object *create_object_from_verse_node(VNode *vnode)
-{
- struct Object *ob;
-
- if(vnode->type != V_NT_OBJECT) return NULL;
-
- /* create new object*/
- ob = add_object(OB_MESH);
- /* set up bindings between verse node and blender object */
- ob->vnode = (void*)vnode;
- ((VObjectData*)vnode->data)->object = (void*)ob;
- /* set up flags */
- ((VObjectData*)vnode->data)->flag |= POS_RECEIVE_READY;
- ((VObjectData*)vnode->data)->flag |= ROT_RECEIVE_READY;
- ((VObjectData*)vnode->data)->flag |= SCALE_RECEIVE_READY;
- /* copy name from verse node to object */
- if(vnode->name) {
- char *str;
- str = (char*)MEM_mallocN(sizeof(char)*(strlen(vnode->name)+3), "temp object name");
- str[0] = '\0';
- strcat(str, "OB");
- strcat(str, vnode->name);
- strncpy(ob->id.name, str, 23);
- MEM_freeN(str);
- }
- /* subscribe for object transformation */
- verse_send_o_transform_subscribe(vnode->id, 0);
-
- return ob;
-}
-
-/*
- * Create blender object-mesh from verse object node, verse geometry node,
- */
-void b_verse_pop_node(VNode *vnode)
-{
- if((!vnode) || (!(vnode->data))) return;
-
- if(vnode->type==V_NT_OBJECT) {
- struct VNode *geom_node=NULL;
- struct VLink *vlink;
- struct VLayer *vlayer;
- struct Object *ob;
- struct Mesh *me;
-
- if(((VObjectData*)vnode->data)->object) {
- printf("\tError: already subscribed to object node.\n");
- return;
- }
-
- vlink = ((VObjectData*)vnode->data)->links.lb.first;
-
- /* try to find geometry node */
- while(vlink) {
- if(vlink->target && vlink->target->type==V_NT_GEOMETRY){
- geom_node = vlink->target;
- break;
- }
- vlink = vlink->next;
- }
-
- /* we are not interested now in avatars node, etc. (vnodes without
- * links at geometry node) */
- if(!geom_node) return;
-
- /* subscribe to all verse geometry layer */
- vlayer = ((VGeomData*)geom_node->data)->layers.lb.first;
- while(vlayer) {
- verse_send_g_layer_subscribe(geom_node->id, vlayer->id, 0);
- vlayer = vlayer->next;
- }
-
- ob = create_object_from_verse_node(vnode);
-
- me = create_mesh_from_geom_node(geom_node);
-
- /* set up bindings between object and mesh */
- if(ob && me) ob->data = me;
- }
- else if(vnode->type==V_NT_BITMAP) {
- struct VBitmapData *vbitmap;
- struct VBitmapLayer *vblayer;
- float color[] = {0, 0, 0, 1};
-
- vbitmap = (VBitmapData*)vnode->data;
-
- vblayer = vbitmap->layers.lb.first;
-
- while(vblayer) {
- if(!(vblayer->flag & VBLAYER_SUBSCRIBED)) {
- /* 0 means level of subscription (full resolution) */
- verse_send_b_layer_subscribe(vnode->id, vblayer->id, 0);
- vblayer->flag |= VBLAYER_SUBSCRIBED;
- }
- vblayer = vblayer->next;
- }
-
- if(vbitmap->image) {
- printf("\tError: already subscribed to image node.\n");
- return;
- }
-
- vbitmap->image = (void*)BKE_add_image_size(
- vbitmap->width,
- vbitmap->height,
- vnode->name,
- 0,
- 0,
- color);
- ((Image*)vbitmap->image)->vnode = (void*)vnode;
- sync_blender_image_with_verse_bitmap_node(vnode);
-
- allqueue(REDRAWIMAGE, 0);
- allqueue(REDRAWVIEW3D, 0);
- }
-}
-
-/*
- * this function will unsubscribe object node from transformation, but it will
- * keep all tags and links at other nodes ... user could subscribe to this node
- * again in future
- */
-void unsubscribe_from_obj_node(VNode *vnode)
-{
- struct VerseSession *session = vnode->session;
- struct VLink *vlink;
-
- if(vnode->type != V_NT_OBJECT) return;
-
- /* unsubscribe from receiving changes of transformation matrix */
- if(session->flag & VERSE_CONNECTED)
- verse_send_o_transform_unsubscribe(vnode->id, 0);
-
- /* we have to reinitialize object node transformation */
- ((VObjectData*)vnode->data)->pos[0] = 0.0f;
- ((VObjectData*)vnode->data)->pos[1] = 0.0f;
- ((VObjectData*)vnode->data)->pos[2] = 0.0f;
-
- ((VObjectData*)vnode->data)->quat[0] = 0.0f;
- ((VObjectData*)vnode->data)->quat[1] = 0.0f;
- ((VObjectData*)vnode->data)->quat[2] = 0.0f;
- ((VObjectData*)vnode->data)->quat[3] = 0.0f;
-
- ((VObjectData*)vnode->data)->scale[0] = 0.0f;
- ((VObjectData*)vnode->data)->scale[1] = 0.0f;
- ((VObjectData*)vnode->data)->scale[2] = 0.0f;
-
- /* clear bindings between object and object node */
- if(((VObjectData*)vnode->data)->object) {
- ((Object*)((VObjectData*)vnode->data)->object)->vnode = NULL;
- ((VObjectData*)vnode->data)->object = NULL;
- }
-
- /* unsubscribe from all supported verse nodes */
- vlink = ((VObjectData*)vnode->data)->links.lb.first;
- while(vlink) {
- if(vlink->target->counter==1) {
- switch(vlink->target->type) {
- case V_NT_OBJECT:
- unsubscribe_from_obj_node(vlink->target);
- break;
- case V_NT_GEOMETRY:
- unsubscribe_from_geom_node(vlink->target);
- break;
- case V_NT_BITMAP:
- unsubscribe_from_bitmap_node(vlink->target);
- break;
- default:
- break;
- }
- }
- vlink = vlink->next;
- }
-}
-
-/*
- * when blender Object is deleted, then we have to unsubscribe and free all
- * VerseNode dependent on this object
- */
-void b_verse_delete_object(Object *object)
-{
- struct VNode *vnode;
-
- vnode = (VNode*)object->vnode;
-
- if(vnode) unsubscribe_from_obj_node(vnode);
-}
-
-/*
- * "fake" unsubscribing from object node and all child nodes
- */
-void b_verse_unsubscribe(VNode *vnode)
-{
- struct VLink *vlink = ((VObjectData*)vnode->data)->links.lb.first;
- struct Object *ob = (Object*)((VObjectData*)vnode->data)->object;
-
- if(vnode->type==V_NT_OBJECT) {
- /* exit edit mode */
- if(G.obedit && G.obedit->vnode == (void*)vnode)
- exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
-
- /* when some geometry node is child of this object node, then create mesh data */
- while(vlink){
- if(vlink->target->type == V_NT_GEOMETRY) {
- struct Mesh *me;
- me = ((VGeomData*)vlink->target->data)->mesh;
- create_meshdata_from_geom_node(me, vlink->target);
- break;
- }
- vlink = vlink->next;
- }
-
- /* unsubscribe from object transformation and clear bindings between
- * verse object node and object */
- unsubscribe_from_obj_node(vnode);
-
- /* when geometry node was shared with more object nodes, then make
- * data single user */
- if(ob->type == OB_MESH) {
- struct ID *id = ob->data;
- if(id && id->us>1 && id->lib==0) {
- ob->recalc= OB_RECALC_DATA;
- ob->data = copy_mesh(ob->data);
- id->us--;
- id->newid= ob->data;
- }
- }
-
- /* reinitialize object derived mesh */
- makeDerivedMesh(ob, get_viewedit_datamask());
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- }
- else if(vnode->type==V_NT_BITMAP) {
- /* fake ... it isn't impelemented yet ... poke jiri, when needed */
- unsubscribe_from_bitmap_node(vnode);
- }
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-/*
- * whe VerseLink is created between two nodes, the Object start to point at
- * coresponding data
- */
-void post_link_set(VLink *vlink)
-{
- struct VNode *target, *source;
- struct Object *ob=NULL;
- struct Mesh *me=NULL;
-
- source = vlink->source;
- target = vlink->target;
-
- if(source->type==V_NT_OBJECT && target->type==V_NT_GEOMETRY){
- if(((VObjectData*)source->data)->object)
- ob = (Object*)((VObjectData*)source->data)->object;
- if(((VGeomData*)target->data)->mesh)
- me = (Mesh*)((VGeomData*)target->data)->mesh;
- if(ob && me && ob->data!=me) {
- ob->data = me;
- makeDerivedMesh(ob, get_viewedit_datamask());
- }
- }
-
- allqueue(REDRAWALL, 1);
-}
-
-/*
- * when VerseLink is deleted, then bindings between Object and data should be removed
- */
-void post_link_destroy(VLink *vlink)
-{
- struct VNode *source, *target;
- struct Object *ob;
-
- source = vlink->source;
- target = vlink->target;
-
- if(source->type==V_NT_OBJECT && target->type==V_NT_GEOMETRY) {
- if(((VObjectData*)source->data)->object) {
- ob = (Object*)((VObjectData*)source->data)->object;
- ob->data=NULL;
- }
- }
-
- allqueue(REDRAWALL, 1);
-}
-
-/*
- * update position of blender object
- */
-void post_transform_pos(VNode *vnode)
-{
- struct VObjectData *obj_data = (VObjectData*)vnode->data;
- struct Object *ob = (Object*)obj_data->object;
-
- VECCOPY(ob->loc, obj_data->pos);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-/*
- * update rotation of blender object
- */
-void post_transform_rot(VNode *vnode)
-{
- struct VObjectData *obj_data = (VObjectData*)vnode->data;
- struct Object *ob = (Object*)obj_data->object;
-
- /* convert quaternion to euler rotation */
- QuatToEul(obj_data->quat, ob->rot);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-/*
- * update scale of blender object
- */
-void post_transform_scale(VNode *vnode)
-{
- struct VObjectData *obj_data = (VObjectData*)vnode->data;
- struct Object *ob = (Object*)obj_data->object;
-
- VECCOPY(ob->size, obj_data->scale);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-
- allqueue(REDRAWVIEW3D, 1);
-}
-
-/*
- * send transformation of Object to verse server
- */
-void b_verse_send_transformation(Object *ob)
-{
- struct VNode *vnode= ob->vnode;
- float quat[4];
-
- if(!vnode) return;
-
- /* if last sent position wasn't received yet, then next change of position
- * can't be send until last send change is received */
- if( ((VObjectData*)vnode->data)->flag & POS_SEND_READY ) {
- if((((VObjectData*)vnode->data)->pos[0]!=ob->loc[0]) ||
- (((VObjectData*)vnode->data)->pos[1]!=ob->loc[1]) ||
- (((VObjectData*)vnode->data)->pos[2]!=ob->loc[2])) {
- VECCOPY(((VObjectData*)vnode->data)->pos, ob->loc);
- send_verse_object_position(vnode);
- }
- }
-
- /* if last sent rotation wasn't received yet, then next change of rotation
- * can't be send until last send change is received */
- if( ((VObjectData*)vnode->data)->flag & ROT_SEND_READY ) {
- EulToQuat(ob->rot, quat);
-
- if((((VObjectData*)vnode->data)->quat[0] != quat[0]) ||
- (((VObjectData*)vnode->data)->quat[1] != quat[1]) ||
- (((VObjectData*)vnode->data)->quat[2] != quat[2]) ||
- (((VObjectData*)vnode->data)->quat[3] != quat[3])) {
- QUATCOPY(((VObjectData*)vnode->data)->quat, quat);
- send_verse_object_rotation(vnode);
- }
- }
-
- /* if last sent object size wasn't received yet, then next change of object size
- * can't be send until last send change is received */
- if( ((VObjectData*)vnode->data)->flag & SCALE_SEND_READY ) {
- if((((VObjectData*)vnode->data)->scale[0]!=ob->size[0]) ||
- (((VObjectData*)vnode->data)->scale[1]!=ob->size[1]) ||
- (((VObjectData*)vnode->data)->scale[2]!=ob->size[2])) {
- VECCOPY(((VObjectData*)vnode->data)->scale, ob->size);
- send_verse_object_scale(vnode);
- }
- }
-
- verse_callback_update(0);
-}
-
-/*
- * free constraint between object VerseNode and blender Object
- */
-void post_object_free_constraint(VNode *vnode)
-{
- if(((VObjectData*)vnode->data)->object) {
- /* free pointer at verse derived mesh */
- struct Object *ob = (Object*)((VObjectData*)vnode->data)->object;
- if(ob) {
- if(ob->derivedFinal) {
- ob->derivedFinal->needsFree = 1;
- ob->derivedFinal->release((DerivedMesh*)ob->derivedFinal);
- ob->derivedFinal = NULL;
- }
- if(ob->derivedDeform) {
- ob->derivedDeform->needsFree = 1;
- ob->derivedDeform->release((DerivedMesh*)ob->derivedDeform);
- ob->derivedDeform = NULL;
- }
- }
- /* free constraint */
- ((Object*)((VObjectData*)vnode->data)->object)->vnode = NULL;
- ((VObjectData*)vnode->data)->object = NULL;
- }
-}
-
-#endif
-
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
deleted file mode 100644
index 258e4fd99e0..00000000000
--- a/source/blender/src/view.c
+++ /dev/null
@@ -1,2558 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * Trackball math (in calctrackballvec()) Copyright (C) Silicon Graphics, Inc.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_userdef_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_action.h"
-#include "BKE_anim.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-#include "BKE_object.h"
-#include "BKE_sculpt.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_transform.h"
-#include "BIF_editparticle.h"
-#include "BIF_gl.h"
-#include "BIF_previewrender.h"
-#include "BIF_mywindow.h"
-#include "BIF_retopo.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BSE_view.h"
-#include "BSE_edit.h" /* For countall */
-#include "BSE_drawview.h" /* For inner_play_anim_loop */
-
-#include "BDR_drawobject.h" /* For draw_object */
-#include "BDR_editface.h" /* For minmax_tface */
-#include "BDR_sculptmode.h"
-
-#include "mydevice.h"
-#include "blendef.h"
-#include "transform.h"
-
-#include "PIL_time.h" /* smoothview */
-#include <float.h>
-
-#define TRACKBALLSIZE (1.1)
-#define BL_NEAR_CLIP 0.001
-
-#define COS45 0.70710678118654746
-#define SIN45 COS45
-
-
-/* local prototypes ----------*/
-void setcameratoview3d(void); /* windows.c & toets.c */
-
-void persp_general(int a)
-{
- /* for all window types, not 3D */
-
- if(a== 0) {
- glPushMatrix();
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
-
- myortho2(-0.375f, ((float)(curarea->winx))-0.375f, -0.375f, ((float)(curarea->winy))-0.375f);
- glLoadIdentity();
- }
- else if(a== 1) {
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- }
-}
-
-void persp(int a)
-{
- /* only 3D windows */
-
- if(curarea->spacetype!=SPACE_VIEW3D) persp_general(a);
- else if(a == PERSP_STORE) { // only store
- glMatrixMode(GL_PROJECTION);
- mygetmatrix(G.vd->winmat1);
- glMatrixMode(GL_MODELVIEW);
- mygetmatrix(G.vd->viewmat1);
- }
- else if(a== PERSP_WIN) { // only set
- myortho2(-0.375f, (float)(curarea->winx)-0.375f, -0.375f, (float)(curarea->winy)-0.375f);
- glLoadIdentity();
- }
- else if(a== PERSP_VIEW) {
- glMatrixMode(GL_PROJECTION);
- myloadmatrix(G.vd->winmat1); // put back
- Mat4CpyMat4(curarea->winmat, G.vd->winmat1); // to be sure?
- glMatrixMode(GL_MODELVIEW);
- myloadmatrix(G.vd->viewmat); // put back
-
- }
-}
-
-/* create intersection ray in view Z direction at mouse coordinates */
-void viewray(short mval[2], float ray_start[3], float ray_normal[3])
-{
- float ray_end[3];
- viewline(mval, ray_start, ray_end);
- VecSubf(ray_normal, ray_end, ray_start);
- Normalize(ray_normal);
-}
-
-/* create intersection coordinates in view Z direction at mouse coordinates */
-void viewline(short mval[2], float ray_start[3], float ray_end[3])
-{
- float vec[4];
-
- if(G.vd->persp != V3D_ORTHO){
- vec[0]= 2.0f * mval[0] / curarea->winx - 1;
- vec[1]= 2.0f * mval[1] / curarea->winy - 1;
- vec[2]= -1.0f;
- vec[3]= 1.0f;
-
- Mat4MulVec4fl(G.vd->persinv, vec);
- VecMulf(vec, 1.0f / vec[3]);
-
- VECCOPY(ray_start, G.vd->viewinv[3]);
- VECSUB(vec, vec, ray_start);
- Normalize(vec);
-
- VECADDFAC(ray_start, G.vd->viewinv[3], vec, G.vd->near);
- VECADDFAC(ray_end, G.vd->viewinv[3], vec, G.vd->far);
- }
- else {
- vec[0] = 2.0f * mval[0] / curarea->winx - 1;
- vec[1] = 2.0f * mval[1] / curarea->winy - 1;
- vec[2] = 0.0f;
- vec[3] = 1.0f;
-
- Mat4MulVec4fl(G.vd->persinv, vec);
-
- VECADDFAC(ray_start, vec, G.vd->viewinv[2], 1000.0f);
- VECADDFAC(ray_end, vec, G.vd->viewinv[2], -1000.0f);
- }
-}
-
-void initgrabz(float x, float y, float z)
-{
- if(G.vd==NULL) return;
- G.vd->zfac= G.vd->persmat[0][3]*x+ G.vd->persmat[1][3]*y+ G.vd->persmat[2][3]*z+ G.vd->persmat[3][3];
-
- /* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that
- * (accounting for near zero values)
- * */
- if (G.vd->zfac < 1.e-6f && G.vd->zfac > -1.e-6f) G.vd->zfac = 1.0f;
-
- /* Negative zfac means x, y, z was behind the camera (in perspective).
- * This gives flipped directions, so revert back to ok default case.
- */
- if (G.vd->zfac < 0.0f) G.vd->zfac = 1.0f;
-}
-
-void window_to_3d(float *vec, short mx, short my)
-{
- /* always call initgrabz */
- float dx, dy;
-
- dx= 2.0f*mx*G.vd->zfac/curarea->winx;
- dy= 2.0f*my*G.vd->zfac/curarea->winy;
-
- vec[0]= (G.vd->persinv[0][0]*dx + G.vd->persinv[1][0]*dy);
- vec[1]= (G.vd->persinv[0][1]*dx + G.vd->persinv[1][1]*dy);
- vec[2]= (G.vd->persinv[0][2]*dx + G.vd->persinv[1][2]*dy);
-}
-
-void project_short(float *vec, short *adr) /* clips */
-{
- float fx, fy, vec4[4];
-
- adr[0]= IS_CLIPPED;
-
- if(G.vd->flag & V3D_CLIPPING) {
- if(view3d_test_clipping(G.vd, vec))
- return;
- }
-
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]);
-
- if( fx>0 && fx<curarea->winx) {
-
- fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]);
-
- if(fy>0.0 && fy< (float)curarea->winy) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
- }
- }
- }
-}
-
-void project_int(float *vec, int *adr)
-{
- float fx, fy, vec4[4];
-
- adr[0]= (int)2140000000.0f;
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]);
-
- if( fx>-2140000000.0f && fx<2140000000.0f) {
- fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]);
-
- if(fy>-2140000000.0f && fy<2140000000.0f) {
- adr[0]= (int)floor(fx);
- adr[1]= (int)floor(fy);
- }
- }
- }
-}
-
-void project_int_noclip(float *vec, int *adr)
-{
- float fx, fy, vec4[4];
-
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( fabs(vec4[3]) > BL_NEAR_CLIP ) {
- fx = (curarea->winx/2)*(1 + vec4[0]/vec4[3]);
- fy = (curarea->winy/2)*(1 + vec4[1]/vec4[3]);
-
- adr[0] = (int)floor(fx);
- adr[1] = (int)floor(fy);
- }
- else
- {
- adr[0] = curarea->winx / 2;
- adr[1] = curarea->winy / 2;
- }
-}
-
-void project_short_noclip(float *vec, short *adr)
-{
- float fx, fy, vec4[4];
-
- adr[0]= IS_CLIPPED;
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]);
-
- if( fx>-32700 && fx<32700) {
-
- fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]);
-
- if(fy>-32700.0 && fy<32700.0) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
- }
- }
- }
-}
-
-void project_float(float *vec, float *adr)
-{
- float vec4[4];
-
- adr[0]= IS_CLIPPED;
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( vec4[3]>BL_NEAR_CLIP ) {
- adr[0] = (float)(curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3];
- adr[1] = (float)(curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3];
- }
-}
-
-void project_float_noclip(float *vec, float *adr)
-{
- float vec4[4];
-
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(G.vd->persmat, vec4);
-
- if( fabs(vec4[3]) > BL_NEAR_CLIP ) {
- adr[0] = (float)(curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3];
- adr[1] = (float)(curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3];
- }
- else
- {
- adr[0] = curarea->winx / 2.0f;
- adr[1] = curarea->winy / 2.0f;
- }
-}
-
-void view3d_get_object_project_mat(ScrArea *area, Object *ob, float pmat[4][4], float vmat[4][4])
-{
- if (area->spacetype!=SPACE_VIEW3D || !area->spacedata.first) {
- Mat4One(pmat);
- Mat4One(vmat);
- } else {
- View3D *vd = area->spacedata.first;
-
- Mat4MulMat4(vmat, ob->obmat, vd->viewmat);
- Mat4MulMat4(pmat, vmat, vd->winmat1);
- Mat4CpyMat4(vmat, ob->obmat);
- }
-}
-
-/* projectmat brings it to window coords, wmat to rotated world space */
-void view3d_project_short_clip(ScrArea *area, float *vec, short *adr, float projmat[4][4], float wmat[4][4])
-{
- View3D *v3d= area->spacedata.first;
- float fx, fy, vec4[4];
-
- adr[0]= IS_CLIPPED;
-
- /* clipplanes in eye space */
- if(v3d->flag & V3D_CLIPPING) {
- VECCOPY(vec4, vec);
- Mat4MulVecfl(wmat, vec4);
- if(view3d_test_clipping(v3d, vec4))
- return;
- }
-
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(projmat, vec4);
-
- /* clipplanes in window space */
- if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (area->winx/2)*(1 + vec4[0]/vec4[3]);
-
- if( fx>0 && fx<area->winx) {
-
- fy= (area->winy/2)*(1 + vec4[1]/vec4[3]);
-
- if(fy>0.0 && fy< (float)area->winy) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
- }
- }
- }
-}
-
-void view3d_project_short_noclip(ScrArea *area, float *vec, short *adr, float mat[4][4])
-{
- float fx, fy, vec4[4];
-
- adr[0]= IS_CLIPPED;
-
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(mat, vec4);
-
- if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */
- fx= (area->winx/2)*(1 + vec4[0]/vec4[3]);
-
- if( fx>-32700 && fx<32700) {
-
- fy= (area->winy/2)*(1 + vec4[1]/vec4[3]);
-
- if(fy>-32700.0 && fy<32700.0) {
- adr[0]= (short)floor(fx);
- adr[1]= (short)floor(fy);
- }
- }
- }
-}
-
-void view3d_project_float(ScrArea *area, float *vec, float *adr, float mat[4][4])
-{
- float vec4[4];
-
- adr[0]= IS_CLIPPED;
- VECCOPY(vec4, vec);
- vec4[3]= 1.0;
-
- Mat4MulVec4fl(mat, vec4);
-
- if( vec4[3]>FLT_EPSILON ) {
- adr[0] = (float)(area->winx/2.0f)+(area->winx/2.0f)*vec4[0]/vec4[3];
- adr[1] = (float)(area->winy/2.0f)+(area->winy/2.0f)*vec4[1]/vec4[3];
- } else {
- adr[0] = adr[1] = 0.0f;
- }
-}
-
-int boundbox_clip(float obmat[][4], BoundBox *bb)
-{
- /* return 1: draw */
-
- float mat[4][4];
- float vec[4], min, max;
- int a, flag= -1, fl;
-
- if(bb==NULL) return 1;
- if(bb->flag & OB_BB_DISABLED) return 1;
-
- Mat4MulMat4(mat, obmat, G.vd->persmat);
-
- for(a=0; a<8; a++) {
- VECCOPY(vec, bb->vec[a]);
- vec[3]= 1.0;
- Mat4MulVec4fl(mat, vec);
- max= vec[3];
- min= -vec[3];
-
- fl= 0;
- if(vec[0] < min) fl+= 1;
- if(vec[0] > max) fl+= 2;
- if(vec[1] < min) fl+= 4;
- if(vec[1] > max) fl+= 8;
- if(vec[2] < min) fl+= 16;
- if(vec[2] > max) fl+= 32;
-
- flag &= fl;
- if(flag==0) return 1;
- }
-
- return 0;
-
-}
-
-void fdrawline(float x1, float y1, float x2, float y2)
-{
- float v[2];
-
- glBegin(GL_LINE_STRIP);
- v[0] = x1; v[1] = y1;
- glVertex2fv(v);
- v[0] = x2; v[1] = y2;
- glVertex2fv(v);
- glEnd();
-}
-
-void fdrawbox(float x1, float y1, float x2, float y2)
-{
- float v[2];
-
- glBegin(GL_LINE_STRIP);
-
- v[0] = x1; v[1] = y1;
- glVertex2fv(v);
- v[0] = x1; v[1] = y2;
- glVertex2fv(v);
- v[0] = x2; v[1] = y2;
- glVertex2fv(v);
- v[0] = x2; v[1] = y1;
- glVertex2fv(v);
- v[0] = x1; v[1] = y1;
- glVertex2fv(v);
-
- glEnd();
-}
-
-void sdrawline(short x1, short y1, short x2, short y2)
-{
- short v[2];
-
- glBegin(GL_LINE_STRIP);
- v[0] = x1; v[1] = y1;
- glVertex2sv(v);
- v[0] = x2; v[1] = y2;
- glVertex2sv(v);
- glEnd();
-}
-
-void sdrawbox(short x1, short y1, short x2, short y2)
-{
- short v[2];
-
- glBegin(GL_LINE_STRIP);
-
- v[0] = x1; v[1] = y1;
- glVertex2sv(v);
- v[0] = x1; v[1] = y2;
- glVertex2sv(v);
- v[0] = x2; v[1] = y2;
- glVertex2sv(v);
- v[0] = x2; v[1] = y1;
- glVertex2sv(v);
- v[0] = x1; v[1] = y1;
- glVertex2sv(v);
-
- glEnd();
-}
-
-/* the central math in this function was copied from trackball.cpp, sample code from the
- Developers Toolbox series by SGI. */
-
-/* trackball: better one than a full spherical solution */
-
-void calctrackballvecfirst(rcti *area, short *mval, float *vec)
-{
- float x, y, radius, d, z, t;
-
- radius= TRACKBALLSIZE;
-
- /* normalize x and y */
- x= (area->xmax + area->xmin)/2 -mval[0];
- x/= (float)((area->xmax - area->xmin)/2);
- y= (area->ymax + area->ymin)/2 -mval[1];
- y/= (float)((area->ymax - area->ymin)/2);
-
- d = sqrt(x*x + y*y);
- if (d < radius*M_SQRT1_2) /* Inside sphere */
- z = sqrt(radius*radius - d*d);
- else
- { /* On hyperbola */
- t = radius / M_SQRT2;
- z = t*t / d;
- }
-
- vec[0]= x;
- vec[1]= y;
- vec[2]= -z; /* yah yah! */
-
- if( fabs(vec[2])>fabs(vec[1]) && fabs(vec[2])>fabs(vec[0]) ) {
- vec[0]= 0.0;
- vec[1]= 0.0;
- if(vec[2]>0.0) vec[2]= 1.0; else vec[2]= -1.0;
- }
- else if( fabs(vec[1])>fabs(vec[0]) && fabs(vec[1])>fabs(vec[2]) ) {
- vec[0]= 0.0;
- vec[2]= 0.0;
- if(vec[1]>0.0) vec[1]= 1.0; else vec[1]= -1.0;
- }
- else {
- vec[1]= 0.0;
- vec[2]= 0.0;
- if(vec[0]>0.0) vec[0]= 1.0; else vec[0]= -1.0;
- }
-}
-
-void calctrackballvec(rcti *area, short *mval, float *vec)
-{
- float x, y, radius, d, z, t;
-
- radius= TRACKBALLSIZE;
-
- /* x en y normalizeren */
- x= (area->xmax + area->xmin)/2 -mval[0];
- x/= (float)((area->xmax - area->xmin)/4);
- y= (area->ymax + area->ymin)/2 -mval[1];
- y/= (float)((area->ymax - area->ymin)/2);
-
- d = sqrt(x*x + y*y);
- if (d < radius*M_SQRT1_2) /* Inside sphere */
- z = sqrt(radius*radius - d*d);
- else
- { /* On hyperbola */
- t = radius / M_SQRT2;
- z = t*t / d;
- }
-
- vec[0]= x;
- vec[1]= y;
- vec[2]= -z; /* yah yah! */
-
-}
-
-
-// ndof scaling will be moved to user setting.
-// In the mean time this is just a place holder.
-
-// Note: scaling in the plugin and ghostwinlay.c
-// should be removed. With driver default setting,
-// each axis returns approx. +-200 max deflection.
-
-// The values I selected are based on the older
-// polling i/f. With event i/f, the sensistivity
-// can be increased for improved response from
-// small deflections of the device input.
-
-
-// lukep notes : i disagree on the range.
-// the normal 3Dconnection driver give +/-400
-// on defaut range in other applications
-// and up to +/- 1000 if set to maximum
-// because i remove the scaling by delta,
-// which was a bad idea as it depend of the system
-// speed and os, i changed the scaling values, but
-// those are still not ok
-
-
-float ndof_axis_scale[6] = {
- +0.01, // Tx
- +0.01, // Tz
- +0.01, // Ty
- +0.0015, // Rx
- +0.0015, // Rz
- +0.0015 // Ry
-};
-
-// statics for controlling G.vd->dist corrections.
-// viewmoveNDOF zeros and adjusts G.vd->ofs.
-// viewmove restores based on dz_flag state.
-
-int dz_flag = 0;
-float m_dist;
-
-void viewmoveNDOFfly(int mode)
-{
- int i;
- float phi;
- float dval[7];
- // static fval[6] for low pass filter; device input vector is dval[6]
- static float fval[6];
- float tvec[3],rvec[3];
- float q1[4];
- float mat[3][3];
- float upvec[3];
-
-
- /*----------------------------------------------------
- * sometimes this routine is called from headerbuttons
- * viewmove needs to refresh the screen
- */
- areawinset(curarea->win);
-
-
- // fetch the current state of the ndof device
- getndof(dval);
-
- if (G.vd->ndoffilter)
- filterNDOFvalues(fval);
-
- // Scale input values
-
-// if(dval[6] == 0) return; // guard against divide by zero
-
- for(i=0;i<6;i++) {
-
- // user scaling
- dval[i] = dval[i] * ndof_axis_scale[i];
- }
-
-
- // low pass filter with zero crossing reset
-
- for(i=0;i<6;i++) {
- if((dval[i] * fval[i]) >= 0)
- dval[i] = (fval[i] * 15 + dval[i]) / 16;
- else
- fval[i] = 0;
- }
-
-
- // force perspective mode. This is a hack and is
- // incomplete. It doesn't actually effect the view
- // until the first draw and doesn't update the menu
- // to reflect persp mode.
-
- G.vd->persp = V3D_PERSP;
-
-
- // Correct the distance jump if G.vd->dist != 0
-
- // This is due to a side effect of the original
- // mouse view rotation code. The rotation point is
- // set a distance in front of the viewport to
- // make rotating with the mouse look better.
- // The distance effect is written at a low level
- // in the view management instead of the mouse
- // view function. This means that all other view
- // movement devices must subtract this from their
- // view transformations.
-
- if(G.vd->dist != 0.0) {
- dz_flag = 1;
- m_dist = G.vd->dist;
- upvec[0] = upvec[1] = 0;
- upvec[2] = G.vd->dist;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecSubf(G.vd->ofs, G.vd->ofs, upvec);
- G.vd->dist = 0.0;
- }
-
-
- // Apply rotation
- // Rotations feel relatively faster than translations only in fly mode, so
- // we have no choice but to fix that here (not in the plugins)
- rvec[0] = -0.5 * dval[3];
- rvec[1] = -0.5 * dval[4];
- rvec[2] = -0.5 * dval[5];
-
- // rotate device x and y by view z
-
- Mat3CpyMat4(mat, G.vd->viewinv);
- mat[2][2] = 0.0f;
- Mat3MulVecfl(mat, rvec);
-
- // rotate the view
-
- phi = Normalize(rvec);
- if(phi != 0) {
- VecRotToQuat(rvec,phi,q1);
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
- }
-
-
- // Apply translation
-
- tvec[0] = dval[0];
- tvec[1] = dval[1];
- tvec[2] = -dval[2];
-
- // the next three lines rotate the x and y translation coordinates
- // by the current z axis angle
-
- Mat3CpyMat4(mat, G.vd->viewinv);
- mat[2][2] = 0.0f;
- Mat3MulVecfl(mat, tvec);
-
- // translate the view
-
- VecSubf(G.vd->ofs, G.vd->ofs, tvec);
-
-
- /*----------------------------------------------------
- * refresh the screen
- */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- // update render preview window
-
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
-}
-
-int view_autodist( float mouse_worldloc[3] ) //, float *autodist )
-{
- View3D *v3d = G.vd;
-
- /* Zooms in on a border drawn by the user */
- short mval[2];
- rcti rect;
-
- /* ZBuffer depth vars */
- bglMats mats;
- float depth, depth_close= MAXFLOAT;
- int had_depth = 0;
- double cent[2], p[3];
- int xs, ys;
-
- getmouseco_areawin(mval);
-
- persp(PERSP_VIEW);
-
- rect.xmax = mval[0] + 4;
- rect.ymax = mval[1] + 4;
-
- rect.xmin = mval[0] - 4;
- rect.ymin = mval[1] - 4;
-
- /* Get Z Depths, needed for perspective, nice for ortho */
- bgl_get_mats(&mats);
- draw_depth(curarea, (void *)v3d, NULL);
-
- /* force updating */
- if (v3d->depths) {
- had_depth = 1;
- v3d->depths->damaged = 1;
- }
-
- view3d_update_depths(v3d);
-
- /* Constrain rect to depth bounds */
- if (rect.xmin < 0) rect.xmin = 0;
- if (rect.ymin < 0) rect.ymin = 0;
- if (rect.xmax >= v3d->depths->w) rect.xmax = v3d->depths->w-1;
- if (rect.ymax >= v3d->depths->h) rect.ymax = v3d->depths->h-1;
-
- /* Find the closest Z pixel */
- for (xs=rect.xmin; xs < rect.xmax; xs++) {
- for (ys=rect.ymin; ys < rect.ymax; ys++) {
- depth= v3d->depths->depths[ys*v3d->depths->w+xs];
- if(depth < v3d->depths->depth_range[1] && depth > v3d->depths->depth_range[0]) {
- if (depth_close > depth) {
- depth_close = depth;
- }
- }
- }
- }
-
- if (depth_close==MAXFLOAT)
- return 0;
-
- if (had_depth==0) {
- MEM_freeN(v3d->depths->depths);
- v3d->depths->depths = NULL;
- }
- v3d->depths->damaged = 1;
-
- cent[0] = (double)mval[0];
- cent[1] = (double)mval[1];
-
- if (!gluUnProject(cent[0], cent[1], depth_close, mats.modelview, mats.projection, mats.viewport, &p[0], &p[1], &p[2]))
- return 0;
-
- mouse_worldloc[0] = (float)p[0];
- mouse_worldloc[1] = (float)p[1];
- mouse_worldloc[2] = (float)p[2];
- return 1;
-}
-
-void viewmove(int mode)
-{
- static float lastofs[3] = {0,0,0};
- Object *ob = OBACT;
- float firstvec[3], newvec[3], dvec[3];
- float reverse, oldquat[4], q1[4], si, phi, dist0;
- float ofs[3], obofs[3]= {0.0f, 0.0f, 0.0f};
- int firsttime=1;
- short mvalball[2], mval[2], mvalo[2], mval_area[2], mvali[2];
- short use_sel = 0;
- short preview3d_event= 1;
-
- // locals for dist correction
- float mat[3][3];
- float upvec[3];
-
- /* 3D window may not be defined */
- if( !G.vd ) {
- fprintf( stderr, "G.vd == NULL in viewmove()\n" );
- return;
- }
-
- // dist correction from other movement devices
- if((dz_flag)||G.vd->dist==0) {
- dz_flag = 0;
- G.vd->dist = m_dist;
- upvec[0] = upvec[1] = 0;
- upvec[2] = G.vd->dist;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecAddf(G.vd->ofs, G.vd->ofs, upvec);
- }
-
- /* sometimes this routine is called from headerbuttons */
-
- areawinset(curarea->win);
-
- QUATCOPY(oldquat, G.vd->viewquat);
-
- getmouseco_areawin(mval_area); /* for zoom to mouse loc */
- getmouseco_sc(mvali); /* work with screen coordinates because of trackball function */
- mvalball[0]= mvalo[0] = mvali[0]; /* needed for turntable to work */
- mvalball[1]= mvalo[1] = mvali[1];
- dist0= G.vd->dist;
-
- calctrackballvec(&curarea->winrct, mvalo, firstvec);
-
- /* cumultime(0); */
-
- if(!G.obedit && (G.f & G_SCULPTMODE) && ob && G.vd->pivot_last) {
- use_sel= 1;
- VecCopyf(ofs, G.vd->ofs);
-
- VecCopyf(obofs, sculpt_data()->pivot);
- Mat4MulVecfl(ob->obmat, obofs);
- obofs[0]= -obofs[0];
- obofs[1]= -obofs[1];
- obofs[2]= -obofs[2];
- }
- else if (U.uiflag & USER_ORBIT_SELECTION) {
- use_sel = 1;
-
- VECCOPY(ofs, G.vd->ofs);
-
- /* If there's no selection, lastofs is unmodified and last value since static */
- calculateTransformCenter(V3D_CENTROID, lastofs);
-
- VECCOPY(obofs, lastofs);
- VecMulf(obofs, -1.0f);
- }
- else if (U.uiflag & USER_ORBIT_ZBUF) {
- if ((use_sel=view_autodist(obofs))) {
- if (G.vd->persp==V3D_PERSP) {
- float my_origin[3]; /* original G.vd->ofs */
- float my_pivot[3]; /* view */
-
- VECCOPY(my_origin, G.vd->ofs);
- VecMulf(my_origin, -1.0f); /* ofs is flipped */
-
- /* Set the dist value to be the distance from this 3d point */
- /* this means youll always be able to zoom into it and panning wont go bad when dist was zero */
-
- /* remove dist value */
- upvec[0] = upvec[1] = 0;
- upvec[2] = G.vd->dist;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecSubf(my_pivot, G.vd->ofs, upvec);
- VecMulf(my_pivot, -1.0f); /* ofs is flipped */
-
- /* find a new ofs value that is allong the view axis (rather then the mouse location) */
- lambda_cp_line_ex(obofs, my_pivot, my_origin, dvec);
- dist0 = G.vd->dist = VecLenf(my_pivot, dvec);
-
- VecMulf(dvec, -1.0f);
- VECCOPY(G.vd->ofs, dvec);
- }
- VecMulf(obofs, -1.0f);
- VECCOPY(ofs, G.vd->ofs);
- } else {
- ofs[0] = ofs[1] = ofs[2] = 0.0f;
- }
- }
- else
- ofs[0] = ofs[1] = ofs[2] = 0.0f;
-
- initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
-
- reverse= 1.0f;
- if (G.vd->persmat[2][1] < 0.0f)
- reverse= -1.0f;
-
- while(TRUE) {
- getmouseco_sc(mval);
-
- // if playanim = alt+A, screenhandlers are for animated UI, python, etc
- if( (mode==2 && U.viewzoom==USER_ZOOM_CONT) || /* continues zoom always update */
- mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || /* mouse moved, so update */
- (G.f & G_PLAYANIM) || do_screenhandlers(G.curscreen)
- ) {
-
- if(firsttime) {
-
- firsttime= 0;
- /* are we translating, rotating or zooming? */
- if(mode==0) {
- if(G.vd->view!=0) scrarea_queue_headredraw(curarea); /*for button */
- }
- if(G.vd->persp==V3D_CAMOB && mode!=1 && G.vd->camera) {
- G.vd->persp= V3D_PERSP;
- scrarea_do_windraw(curarea);
- scrarea_queue_headredraw(curarea);
- }
- }
-
- if(mode==0) { /* view rotate */
- G.vd->view= 0; /* need to reset everytime because of view snapping */
-
- if (U.uiflag & USER_AUTOPERSP) G.vd->persp= V3D_PERSP;
-
- if (U.flag & USER_TRACKBALL) mvalball[0]= mval[0];
- mvalball[1]= mval[1];
-
- calctrackballvec(&curarea->winrct, mvalball, newvec);
-
- VecSubf(dvec, newvec, firstvec);
-
- si= sqrt(dvec[0]*dvec[0]+ dvec[1]*dvec[1]+ dvec[2]*dvec[2]);
- si/= (2.0*TRACKBALLSIZE);
-
- if (U.flag & USER_TRACKBALL) {
- Crossf(q1+1, firstvec, newvec);
-
- Normalize(q1+1);
-
- /* Allow for rotation beyond the interval
- * [-pi, pi] */
- while (si > 1.0)
- si -= 2.0;
-
- /* This relation is used instead of
- * phi = asin(si) so that the angle
- * of rotation is linearly proportional
- * to the distance that the mouse is
- * dragged. */
- phi = si * M_PI / 2.0;
-
- si= sin(phi);
- q1[0]= cos(phi);
- q1[1]*= si;
- q1[2]*= si;
- q1[3]*= si;
- QuatMul(G.vd->viewquat, q1, oldquat);
-
- if (use_sel) {
- /* compute the post multiplication quat, to rotate the offset correctly */
- QUATCOPY(q1, oldquat);
- QuatConj(q1);
- QuatMul(q1, q1, G.vd->viewquat);
-
- QuatConj(q1); /* conj == inv for unit quat */
- VECCOPY(G.vd->ofs, ofs);
- VecSubf(G.vd->ofs, G.vd->ofs, obofs);
- QuatMulVecf(q1, G.vd->ofs);
- VecAddf(G.vd->ofs, G.vd->ofs, obofs);
- }
- } else {
- /* New turntable view code by John Aughey */
-
- float m[3][3];
- float m_inv[3][3];
- float xvec[3] = {1,0,0};
- /* Sensitivity will control how fast the viewport rotates. 0.0035 was
- obtained experimentally by looking at viewport rotation sensitivities
- on other modeling programs. */
- /* Perhaps this should be a configurable user parameter. */
- const float sensitivity = 0.0035;
-
- /* Get the 3x3 matrix and its inverse from the quaternion */
- QuatToMat3(G.vd->viewquat, m);
- Mat3Inv(m_inv,m);
-
- /* Determine the direction of the x vector (for rotating up and down) */
- /* This can likely be compuated directly from the quaternion. */
- Mat3MulVecfl(m_inv,xvec);
-
- /* Perform the up/down rotation */
- phi = sensitivity * -(mval[1] - mvalo[1]);
- si = sin(phi);
- q1[0] = cos(phi);
- q1[1] = si * xvec[0];
- q1[2] = si * xvec[1];
- q1[3] = si * xvec[2];
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- if (use_sel) {
- QuatConj(q1); /* conj == inv for unit quat */
- VecSubf(G.vd->ofs, G.vd->ofs, obofs);
- QuatMulVecf(q1, G.vd->ofs);
- VecAddf(G.vd->ofs, G.vd->ofs, obofs);
- }
-
- /* Perform the orbital rotation */
- phi = sensitivity * reverse * (mval[0] - mvalo[0]);
- q1[0] = cos(phi);
- q1[1] = q1[2] = 0.0;
- q1[3] = sin(phi);
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- if (use_sel) {
- QuatConj(q1);
- VecSubf(G.vd->ofs, G.vd->ofs, obofs);
- QuatMulVecf(q1, G.vd->ofs);
- VecAddf(G.vd->ofs, G.vd->ofs, obofs);
- }
- }
-
- /* check for view snap */
- if (G.qual==LR_CTRLKEY){
- int i;
- float viewmat[3][3];
-
- static const float thres = 0.93f; //cos(20 deg);
-
- static float snapquats[39][6] = {
- /*{q0, q1, q3, q4, view, oposite_direction}*/
- {COS45, -SIN45, 0.0, 0.0, 1, 0}, //front
- {0.0, 0.0, -SIN45, -SIN45, 1, 1}, //back
- {1.0, 0.0, 0.0, 0.0, 7, 0}, //top
- {0.0, -1.0, 0.0, 0.0, 7, 1}, //bottom
- {0.5, -0.5, -0.5, -0.5, 3, 0}, //left
- {0.5, -0.5, 0.5, 0.5, 3, 1}, //right
-
- /* some more 45 deg snaps */
- {0.65328145027160645, -0.65328145027160645, 0.27059805393218994, 0.27059805393218994, 0, 0},
- {0.92387950420379639, 0.0, 0.0, 0.38268342614173889, 0, 0},
- {0.0, -0.92387950420379639, 0.38268342614173889, 0.0, 0, 0},
- {0.35355335474014282, -0.85355335474014282, 0.35355338454246521, 0.14644660055637360, 0, 0},
- {0.85355335474014282, -0.35355335474014282, 0.14644660055637360, 0.35355338454246521, 0, 0},
- {0.49999994039535522, -0.49999994039535522, 0.49999997019767761, 0.49999997019767761, 0, 0},
- {0.27059802412986755, -0.65328145027160645, 0.65328145027160645, 0.27059802412986755, 0, 0},
- {0.65328145027160645, -0.27059802412986755, 0.27059802412986755, 0.65328145027160645, 0, 0},
- {0.27059799432754517, -0.27059799432754517, 0.65328139066696167, 0.65328139066696167, 0, 0},
- {0.38268336653709412, 0.0, 0.0, 0.92387944459915161, 0, 0},
- {0.0, -0.38268336653709412, 0.92387944459915161, 0.0, 0, 0},
- {0.14644658565521240, -0.35355335474014282, 0.85355335474014282, 0.35355335474014282, 0, 0},
- {0.35355335474014282, -0.14644658565521240, 0.35355335474014282, 0.85355335474014282, 0, 0},
- {0.0, 0.0, 0.92387944459915161, 0.38268336653709412, 0, 0},
- {-0.0, 0.0, 0.38268336653709412, 0.92387944459915161, 0, 0},
- {-0.27059802412986755, 0.27059802412986755, 0.65328133106231689, 0.65328133106231689, 0, 0},
- {-0.38268339633941650, 0.0, 0.0, 0.92387938499450684, 0, 0},
- {0.0, 0.38268339633941650, 0.92387938499450684, 0.0, 0, 0},
- {-0.14644658565521240, 0.35355338454246521, 0.85355329513549805, 0.35355332493782043, 0, 0},
- {-0.35355338454246521, 0.14644658565521240, 0.35355332493782043, 0.85355329513549805, 0, 0},
- {-0.49999991059303284, 0.49999991059303284, 0.49999985098838806, 0.49999985098838806, 0, 0},
- {-0.27059799432754517, 0.65328145027160645, 0.65328139066696167, 0.27059799432754517, 0, 0},
- {-0.65328145027160645, 0.27059799432754517, 0.27059799432754517, 0.65328139066696167, 0, 0},
- {-0.65328133106231689, 0.65328133106231689, 0.27059793472290039, 0.27059793472290039, 0, 0},
- {-0.92387932538986206, 0.0, 0.0, 0.38268333673477173, 0, 0},
- {0.0, 0.92387932538986206, 0.38268333673477173, 0.0, 0, 0},
- {-0.35355329513549805, 0.85355329513549805, 0.35355329513549805, 0.14644657075405121, 0, 0},
- {-0.85355329513549805, 0.35355329513549805, 0.14644657075405121, 0.35355329513549805, 0, 0},
- {-0.38268330693244934, 0.92387938499450684, 0.0, 0.0, 0, 0},
- {-0.92387938499450684, 0.38268330693244934, 0.0, 0.0, 0, 0},
- {-COS45, 0.0, 0.0, SIN45, 0, 0},
- {COS45, 0.0, 0.0, SIN45, 0, 0},
- {0.0, 0.0, 0.0, 1.0, 0, 0}
- };
-
- QuatToMat3(G.vd->viewquat, viewmat);
-
- for (i = 0 ; i < 39; i++){
- float snapmat[3][3];
- float view = (int)snapquats[i][4];
- float oposite_dir = (int)snapquats[i][5];
-
- QuatToMat3(snapquats[i], snapmat);
-
- if ((Inpf(snapmat[0], viewmat[0]) > thres) &&
- (Inpf(snapmat[1], viewmat[1]) > thres) &&
- (Inpf(snapmat[2], viewmat[2]) > thres)){
-
- QUATCOPY(G.vd->viewquat, snapquats[i]);
-
- G.vd->view = view;
- if (view){
- if (oposite_dir){
- G.vd->flag2 |= V3D_OPP_DIRECTION_NAME;
- }else{
- G.vd->flag2 &= ~V3D_OPP_DIRECTION_NAME;
- }
- }
-
- break;
- }
- }
- }
- }
- else if(mode==1) { /* translate */
- if(G.vd->persp==V3D_CAMOB) {
- float max= (float)MAX2(curarea->winx, curarea->winy);
-
- G.vd->camdx += (mvalo[0]-mval[0])/(max);
- G.vd->camdy += (mvalo[1]-mval[1])/(max);
- CLAMP(G.vd->camdx, -1.0f, 1.0f);
- CLAMP(G.vd->camdy, -1.0f, 1.0f);
- preview3d_event= 0;
- }
- else {
- window_to_3d(dvec, mval[0]-mvalo[0], mval[1]-mvalo[1]);
- VecAddf(G.vd->ofs, G.vd->ofs, dvec);
- }
- }
- else if(mode==2) {
- float zfac=1.0;
-
- /* use initial value (do not use mvalo (that is used to detect mouse moviments)) */
- mvalo[0] = mvali[0];
- mvalo[1] = mvali[1];
-
- if(U.viewzoom==USER_ZOOM_CONT) {
- // oldstyle zoom
- zfac = 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/1000.0;
- }
- else if(U.viewzoom==USER_ZOOM_SCALE) {
- int ctr[2], len1, len2;
- // method which zooms based on how far you move the mouse
-
- ctr[0] = (curarea->winrct.xmax + curarea->winrct.xmin)/2;
- ctr[1] = (curarea->winrct.ymax + curarea->winrct.ymin)/2;
-
- len1 = (int)sqrt((ctr[0] - mval[0])*(ctr[0] - mval[0]) + (ctr[1] - mval[1])*(ctr[1] - mval[1])) + 5;
- len2 = (int)sqrt((ctr[0] - mvalo[0])*(ctr[0] - mvalo[0]) + (ctr[1] - mvalo[1])*(ctr[1] - mvalo[1])) + 5;
-
- zfac = dist0 * ((float)len2/len1) / G.vd->dist;
- }
- else { /* USER_ZOOM_DOLLY */
- float len1 = (curarea->winrct.ymax - mval[1]) + 5;
- float len2 = (curarea->winrct.ymax - mvalo[1]) + 5;
- zfac = dist0 * (2.0*((len2/len1)-1.0) + 1.0) / G.vd->dist;
- }
-
- if(zfac != 1.0 && zfac*G.vd->dist > 0.001*G.vd->grid &&
- zfac*G.vd->dist < 10.0*G.vd->far)
- view_zoom_mouseloc(zfac, mval_area);
-
-
- if ((U.uiflag & USER_ORBIT_ZBUF) && (U.viewzoom==USER_ZOOM_CONT) && (G.vd->persp==V3D_PERSP)) {
- /* Secret apricot feature, translate the view when in continues mode */
- upvec[0] = upvec[1] = 0;
- upvec[2] = (dist0 - G.vd->dist) * G.vd->grid;
- G.vd->dist = dist0;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecAddf(G.vd->ofs, G.vd->ofs, upvec);
- } else {
- /* these limits are in toets.c too */
- if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid;
- if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far;
- }
-
- if(G.vd->persp==V3D_ORTHO || G.vd->persp==V3D_CAMOB) preview3d_event= 0;
- }
-
-
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- if(G.f & G_PLAYANIM) inner_play_anim_loop(0, 0);
-
- /* If in retopo paint mode, update lines */
- if(retopo_mesh_paint_check() && G.vd->retopo_view_data) {
- G.vd->retopo_view_data->queue_matrix_update= 1;
- retopo_paint_view_update(G.vd);
- }
-
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
- }
- else {
- short val;
- unsigned short event;
- /* we need to empty the queue... when you do this very long it overflows */
- while(qtest()) event= extern_qread(&val);
-
- BIF_wait_for_statechange();
- }
-
- /* this in the end, otherwise get_mbut does not work on a PC... */
- if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break;
- }
-
- if(G.vd->depths) G.vd->depths->damaged= 1;
- retopo_queue_updates(G.vd);
- allqueue(REDRAWVIEW3D, 0);
-
- if(preview3d_event)
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
- else
- BIF_view3d_previewrender_signal(curarea, PR_PROJECTED);
-
-}
-
-void view_zoom_mouseloc(float dfac, short *mouseloc)
-{
- if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
- short vb[2];
- float dvec[3];
- float tvec[3];
- float tpos[3];
- float new_dist;
-
- /* find the current window width and height */
- vb[0] = G.vd->area->winx;
- vb[1] = G.vd->area->winy;
-
- tpos[0] = -G.vd->ofs[0];
- tpos[1] = -G.vd->ofs[1];
- tpos[2] = -G.vd->ofs[2];
-
- /* Project cursor position into 3D space */
- initgrabz(tpos[0], tpos[1], tpos[2]);
- window_to_3d(dvec, mouseloc[0]-vb[0]/2, mouseloc[1]-vb[1]/2);
-
- /* Calculate view target position for dolly */
- tvec[0] = -(tpos[0] + dvec[0]);
- tvec[1] = -(tpos[1] + dvec[1]);
- tvec[2] = -(tpos[2] + dvec[2]);
-
- /* Offset to target position and dolly */
- new_dist = G.vd->dist * dfac;
-
- VECCOPY(G.vd->ofs, tvec);
- G.vd->dist = new_dist;
-
- /* Calculate final offset */
- dvec[0] = tvec[0] + dvec[0] * dfac;
- dvec[1] = tvec[1] + dvec[1] * dfac;
- dvec[2] = tvec[2] + dvec[2] * dfac;
-
- VECCOPY(G.vd->ofs, dvec);
- } else {
- G.vd->dist *= dfac;
- }
-}
-
-void viewmoveNDOF(int mode)
-{
- float fval[7];
- float dvec[3];
- float sbadjust = 1.0f;
- float len;
- short use_sel = 0;
- Object *ob = OBACT;
- float m[3][3];
- float m_inv[3][3];
- float xvec[3] = {1,0,0};
- float yvec[3] = {0,-1,0};
- float zvec[3] = {0,0,1};
- float phi, si;
- float q1[4];
- float obofs[3];
- float reverse;
- //float diff[4];
- float d, curareaX, curareaY;
- float mat[3][3];
- float upvec[3];
-
- /* Sensitivity will control how fast the view rotates. The value was
- * obtained experimentally by tweaking until the author didn't get dizzy watching.
- * Perhaps this should be a configurable user parameter.
- */
- float psens = 0.005f * (float) U.ndof_pan; /* pan sensitivity */
- float rsens = 0.005f * (float) U.ndof_rotate; /* rotate sensitivity */
- float zsens = 0.3f; /* zoom sensitivity */
-
- const float minZoom = -30.0f;
- const float maxZoom = 300.0f;
-
- //reset view type
- G.vd->view = 0;
-//printf("passing here \n");
-//
- if (G.obedit==NULL && ob && !(ob->flag & OB_POSEMODE)) {
- use_sel = 1;
- }
-
- if((dz_flag)||G.vd->dist==0) {
- dz_flag = 0;
- G.vd->dist = m_dist;
- upvec[0] = upvec[1] = 0;
- upvec[2] = G.vd->dist;
- Mat3CpyMat4(mat, G.vd->viewinv);
- Mat3MulVecfl(mat, upvec);
- VecAddf(G.vd->ofs, G.vd->ofs, upvec);
- }
-
- /*----------------------------------------------------
- * sometimes this routine is called from headerbuttons
- * viewmove needs to refresh the screen
- */
- areawinset(curarea->win);
-
- /*----------------------------------------------------
- * record how much time has passed. clamp at 10 Hz
- * pretend the previous frame occured at the clamped time
- */
-// now = PIL_check_seconds_timer();
- // frametime = (now - prevTime);
- // if (frametime > 0.1f){ /* if more than 1/10s */
- // frametime = 1.0f/60.0; /* clamp at 1/60s so no jumps when starting to move */
-// }
-// prevTime = now;
- // sbadjust *= 60 * frametime; /* normalize ndof device adjustments to 100Hz for framerate independence */
-
- /* fetch the current state of the ndof device & enforce dominant mode if selected */
- getndof(fval);
- if (G.vd->ndoffilter)
- filterNDOFvalues(fval);
-
-
- // put scaling back here, was previously in ghostwinlay
- fval[0] = fval[0] * (1.0f/600.0f);
- fval[1] = fval[1] * (1.0f/600.0f);
- fval[2] = fval[2] * (1.0f/1100.0f);
- fval[3] = fval[3] * 0.00005f;
- fval[4] =-fval[4] * 0.00005f;
- fval[5] = fval[5] * 0.00005f;
- fval[6] = fval[6] / 1000000.0f;
-
- // scale more if not in perspective mode
- if (G.vd->persp == V3D_ORTHO) {
- fval[0] = fval[0] * 0.05f;
- fval[1] = fval[1] * 0.05f;
- fval[2] = fval[2] * 0.05f;
- fval[3] = fval[3] * 0.9f;
- fval[4] = fval[4] * 0.9f;
- fval[5] = fval[5] * 0.9f;
- zsens *= 8;
- }
-
-
- /* set object offset */
- if (ob) {
- obofs[0] = -ob->obmat[3][0];
- obofs[1] = -ob->obmat[3][1];
- obofs[2] = -ob->obmat[3][2];
- }
- else {
- VECCOPY(obofs, G.vd->ofs);
- }
-
- /* calc an adjustment based on distance from camera
- disabled per patch 14402 */
- d = 1.0f;
-
-/* if (ob) {
- VecSubf(diff, obofs, G.vd->ofs);
- d = VecLength(diff);
- }
-*/
-
- reverse = (G.vd->persmat[2][1] < 0.0f) ? -1.0f : 1.0f;
-
- /*----------------------------------------------------
- * ndof device pan
- */
- psens *= 1.0f + d;
- curareaX = sbadjust * psens * fval[0];
- curareaY = sbadjust * psens * fval[1];
- dvec[0] = curareaX * G.vd->persinv[0][0] + curareaY * G.vd->persinv[1][0];
- dvec[1] = curareaX * G.vd->persinv[0][1] + curareaY * G.vd->persinv[1][1];
- dvec[2] = curareaX * G.vd->persinv[0][2] + curareaY * G.vd->persinv[1][2];
- VecAddf(G.vd->ofs, G.vd->ofs, dvec);
-
- /*----------------------------------------------------
- * ndof device dolly
- */
- len = zsens * sbadjust * fval[2];
-
- if (G.vd->persp==V3D_CAMOB) {
- if(G.vd->persp==V3D_CAMOB) { /* This is stupid, please fix - TODO */
- G.vd->camzoom+= 10.0f * -len;
- }
- if (G.vd->camzoom < minZoom) G.vd->camzoom = minZoom;
- else if (G.vd->camzoom > maxZoom) G.vd->camzoom = maxZoom;
- }
- else if ((G.vd->dist> 0.001*G.vd->grid) && (G.vd->dist<10.0*G.vd->far)) {
- G.vd->dist*=(1.0 + len);
- }
-
-
- /*----------------------------------------------------
- * ndof device turntable
- * derived from the turntable code in viewmove
- */
-
- /* Get the 3x3 matrix and its inverse from the quaternion */
- QuatToMat3(G.vd->viewquat, m);
- Mat3Inv(m_inv,m);
-
- /* Determine the direction of the x vector (for rotating up and down) */
- /* This can likely be compuated directly from the quaternion. */
- Mat3MulVecfl(m_inv,xvec);
- Mat3MulVecfl(m_inv,yvec);
- Mat3MulVecfl(m_inv,zvec);
-
- /* Perform the up/down rotation */
- phi = sbadjust * rsens * /*0.5f * */ fval[3]; /* spin vertically half as fast as horizontally */
- si = sin(phi);
- q1[0] = cos(phi);
- q1[1] = si * xvec[0];
- q1[2] = si * xvec[1];
- q1[3] = si * xvec[2];
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- if (use_sel) {
- QuatConj(q1); /* conj == inv for unit quat */
- VecSubf(G.vd->ofs, G.vd->ofs, obofs);
- QuatMulVecf(q1, G.vd->ofs);
- VecAddf(G.vd->ofs, G.vd->ofs, obofs);
- }
-
- /* Perform the orbital rotation */
- /* Perform the orbital rotation
- If the seen Up axis is parallel to the zoom axis, rotation should be
- achieved with a pure Roll motion (no Spin) on the device. When you start
- to tilt, moving from Top to Side view, Spinning will increasingly become
- more relevant while the Roll component will decrease. When a full
- Side view is reached, rotations around the world's Up axis are achieved
- with a pure Spin-only motion. In other words the control of the spinning
- around the world's Up axis should move from the device's Spin axis to the
- device's Roll axis depending on the orientation of the world's Up axis
- relative to the screen. */
- //phi = sbadjust * rsens * reverse * fval[4]; /* spin the knob, y axis */
- phi = sbadjust * rsens * (yvec[2] * fval[4] + zvec[2] * fval[5]);
- q1[0] = cos(phi);
- q1[1] = q1[2] = 0.0;
- q1[3] = sin(phi);
- QuatMul(G.vd->viewquat, G.vd->viewquat, q1);
-
- if (use_sel) {
- QuatConj(q1);
- VecSubf(G.vd->ofs, G.vd->ofs, obofs);
- QuatMulVecf(q1, G.vd->ofs);
- VecAddf(G.vd->ofs, G.vd->ofs, obofs);
- }
-
- /*----------------------------------------------------
- * refresh the screen
- */
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-}
-
-
-/* Gets the lens and clipping values from a camera of lamp type object */
-void object_view_settings(Object *ob, float *lens, float *clipsta, float *clipend)
-{
- if (!ob) return;
-
- if(ob->type==OB_LAMP ) {
- Lamp *la = ob->data;
- if (lens) {
- float x1, fac;
- fac= cos( M_PI*la->spotsize/360.0);
- x1= saacos(fac);
- *lens= 16.0*fac/sin(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;
- }
-}
-
-
-int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
-{
- Camera *cam=NULL;
- float lens, fac, x1, y1, x2, y2;
- float winx= (float)winxi, winy= (float)winyi;
- int orth= 0;
-
- lens= G.vd->lens;
-
- *clipsta= G.vd->near;
- *clipend= G.vd->far;
-
-/*
- * Cant use this since we need the fac and x1 values set
- * if(G.vd->persp==V3D_CAMOB)
- object_view_settings(G.vd->camera, &lens, &(*clipsta), &(*clipend));*/
-
- if(G.vd->persp==V3D_CAMOB) {
- if(G.vd->camera) {
- if(G.vd->camera->type==OB_LAMP ) {
- Lamp *la;
-
- la= G.vd->camera->data;
- fac= cos( M_PI*la->spotsize/360.0);
-
- x1= saacos(fac);
- lens= 16.0*fac/sin(x1);
-
- *clipsta= la->clipsta;
- *clipend= la->clipend;
- }
- else if(G.vd->camera->type==OB_CAMERA) {
- cam= G.vd->camera->data;
- lens= cam->lens;
- *clipsta= cam->clipsta;
- *clipend= cam->clipend;
- }
- }
- }
-
- if(G.vd->persp==V3D_ORTHO) {
- if(winx>winy) x1= -G.vd->dist;
- else x1= -winx*G.vd->dist/winy;
- x2= -x1;
-
- if(winx>winy) y1= -winy*G.vd->dist/winx;
- else y1= -G.vd->dist;
- y2= -y1;
-
- *clipend *= 0.5; // otherwise too extreme low zbuffer quality
- *clipsta= - *clipend;
- orth= 1;
- }
- else {
- /* fac for zoom, also used for camdx */
- if(G.vd->persp==V3D_CAMOB) {
- fac= (1.41421+( (float)G.vd->camzoom )/50.0);
- fac*= fac;
- }
- 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.0*cam->ortho_scale/fac;
-
- if(winx>winy) x1= -dfac;
- else x1= -winx*dfac/winy;
- x2= -x1;
-
- if(winx>winy) y1= -winy*dfac/winx;
- else y1= -dfac;
- y2= -y1;
- orth= 1;
- }
- else {
- float dfac;
-
- if(winx>winy) dfac= 64.0/(fac*winx*lens);
- else dfac= 64.0/(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.5*fac*G.vd->camdx*(x2-x1);
- float dy= 0.5*fac*G.vd->camdy*(y2-y1);
- x1+= dx;
- x2+= dx;
- y1+= dy;
- y2+= dy;
- }
- }
-
- if(pixsize) {
- float viewfac;
-
- if(orth) {
- viewfac= (winx >= winy)? winx: winy;
- *pixsize= 1.0f/viewfac;
- }
- else {
- viewfac= (((winx >= winy)? winx: winy)*lens)/32.0;
- *pixsize= *clipsta/viewfac;
- }
- }
-
- viewplane->xmin= x1;
- viewplane->ymin= y1;
- viewplane->xmax= x2;
- viewplane->ymax= y2;
-
- return orth;
-}
-
-/* important to not set windows active in here, can be renderwin for example */
-void setwinmatrixview3d(int winx, int winy, rctf *rect) /* rect: for picking */
-{
- rctf viewplane;
- float clipsta, clipend, x1, y1, x2, y2;
- int orth;
-
- orth= get_view3d_viewplane(winx, winy, &viewplane, &clipsta, &clipend, NULL);
-// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend);
- x1= viewplane.xmin;
- y1= viewplane.ymin;
- x2= viewplane.xmax;
- y2= viewplane.ymax;
-
- if(rect) { /* picking */
- rect->xmin/= (float)curarea->winx;
- rect->xmin= x1+rect->xmin*(x2-x1);
- rect->ymin/= (float)curarea->winy;
- rect->ymin= y1+rect->ymin*(y2-y1);
- rect->xmax/= (float)curarea->winx;
- rect->xmax= x1+rect->xmax*(x2-x1);
- rect->ymax/= (float)curarea->winy;
- rect->ymax= y1+rect->ymax*(y2-y1);
-
- if(orth) myortho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend);
- else mywindow(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend);
-
- }
- else {
- if(orth) myortho(x1, x2, y1, y2, clipsta, clipend);
- else mywindow(x1, x2, y1, y2, clipsta, clipend);
- }
-
- /* not sure what this was for? (ton) */
- glMatrixMode(GL_PROJECTION);
- mygetmatrix(curarea->winmat);
- glMatrixMode(GL_MODELVIEW);
-}
-
-void obmat_to_viewmat(Object *ob, short smooth)
-{
- float bmat[4][4];
- float tmat[3][3];
-
- G.vd->view= 0; /* dont show the grid */
-
- Mat4CpyMat4(bmat, ob->obmat);
- Mat4Ortho(bmat);
- Mat4Invert(G.vd->viewmat, bmat);
-
- /* view quat calculation, needed for add object */
- Mat3CpyMat4(tmat, G.vd->viewmat);
- if (smooth) {
- float new_quat[4];
- if (G.vd->persp==V3D_CAMOB && G.vd->camera) {
- /* were from a camera view */
-
- float orig_ofs[3];
- float orig_dist= G.vd->dist;
- float orig_lens= G.vd->lens;
- VECCOPY(orig_ofs, G.vd->ofs);
-
- /* Switch from camera view */
- Mat3ToQuat(tmat, new_quat);
-
- G.vd->persp=V3D_PERSP;
- G.vd->dist= 0.0;
-
- view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens);
- smooth_view(G.vd, orig_ofs, new_quat, &orig_dist, &orig_lens);
-
- G.vd->persp=V3D_CAMOB; /* just to be polite, not needed */
-
- } else {
- Mat3ToQuat(tmat, new_quat);
- smooth_view(G.vd, NULL, new_quat, NULL, NULL);
- }
- } else {
- Mat3ToQuat(tmat, G.vd->viewquat);
- }
-}
-
-/* dont set windows active in in here, is used by renderwin too */
-void setviewmatrixview3d()
-{
- if(G.vd->persp==V3D_CAMOB) { /* obs/camera */
- if(G.vd->camera) {
- where_is_object(G.vd->camera);
- obmat_to_viewmat(G.vd->camera, 0);
- }
- else {
- QuatToMat4(G.vd->viewquat, G.vd->viewmat);
- G.vd->viewmat[3][2]-= G.vd->dist;
- }
- }
- else {
-
- QuatToMat4(G.vd->viewquat, G.vd->viewmat);
- if(G.vd->persp==V3D_PERSP) G.vd->viewmat[3][2]-= G.vd->dist;
- if(G.vd->ob_centre) {
- Object *ob= G.vd->ob_centre;
- float vec[3];
-
- VECCOPY(vec, ob->obmat[3]);
- if(ob->type==OB_ARMATURE && G.vd->ob_centre_bone[0]) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, G.vd->ob_centre_bone);
- if(pchan) {
- VECCOPY(vec, pchan->pose_mat[3]);
- Mat4MulVecfl(ob->obmat, vec);
- }
- }
- i_translate(-vec[0], -vec[1], -vec[2], G.vd->viewmat);
- }
- else i_translate(G.vd->ofs[0], G.vd->ofs[1], G.vd->ofs[2], G.vd->viewmat);
- }
-}
-
-void setcameratoview3d(void)
-{
- Object *ob;
- float dvec[3];
-
- ob= G.vd->camera;
- dvec[0]= G.vd->dist*G.vd->viewinv[2][0];
- dvec[1]= G.vd->dist*G.vd->viewinv[2][1];
- dvec[2]= G.vd->dist*G.vd->viewinv[2][2];
- VECCOPY(ob->loc, dvec);
- VecSubf(ob->loc, ob->loc, G.vd->ofs);
- G.vd->viewquat[0]= -G.vd->viewquat[0];
- /* */
- /*if (ob->transflag & OB_QUAT) {
- QUATCOPY(ob->quat, G.vd->viewquat);
- } else {*/
- QuatToEul(G.vd->viewquat, ob->rot);
- /*}*/
- G.vd->viewquat[0]= -G.vd->viewquat[0];
-}
-
-/* IGLuint-> GLuint*/
-/* Warning: be sure to account for a negative return value
- * This is an error, "Too many objects in select buffer"
- * and no action should be taken (can crash blender) if this happens
- */
-short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1, short y1, short x2, short y2)
-{
- rctf rect;
- short mval[2], code, hits;
-
- G.f |= G_PICKSEL;
-
- if(x1==0 && x2==0 && y1==0 && y2==0) {
- getmouseco_areawin(mval);
- rect.xmin= mval[0]-12; // seems to be default value for bones only now
- rect.xmax= mval[0]+12;
- rect.ymin= mval[1]-12;
- rect.ymax= mval[1]+12;
- }
- else {
- rect.xmin= x1;
- rect.xmax= x2;
- rect.ymin= y1;
- rect.ymax= y2;
- }
- /* get rid of overlay button matrix */
- persp(PERSP_VIEW);
- setwinmatrixview3d(curarea->winx, curarea->winy, &rect);
- Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat);
-
- if(G.vd->drawtype > OB_WIRE) {
- G.vd->zbuf= TRUE;
- glEnable(GL_DEPTH_TEST);
- }
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_set_clipping(G.vd);
-
- glSelectBuffer( bufsize, (GLuint *)buffer);
- glRenderMode(GL_SELECT);
- glInitNames(); /* these two calls whatfor? It doesnt work otherwise */
- glPushName(-1);
- code= 1;
-
- if(G.obedit && G.obedit->type==OB_MBALL) {
- draw_object(BASACT, DRAW_PICKING|DRAW_CONSTCOLOR);
- }
- else if ((G.obedit && G.obedit->type==OB_ARMATURE)) {
- draw_object(BASACT, DRAW_PICKING|DRAW_CONSTCOLOR);
- }
- else {
- Base *base;
-
- G.vd->xray= TRUE; // otherwise it postpones drawing
- for(base= G.scene->base.first; base; base= base->next) {
- if(base->lay & G.vd->lay) {
-
- if (base->object->restrictflag & OB_RESTRICT_SELECT)
- base->selcol= 0;
- else {
- base->selcol= code;
- glLoadName(code);
- draw_object(base, DRAW_PICKING|DRAW_CONSTCOLOR);
-
- /* we draw group-duplicators for selection too */
- if((base->object->transflag & OB_DUPLI) && base->object->dup_group) {
- ListBase *lb;
- DupliObject *dob;
- Base tbase;
-
- tbase.flag= OB_FROMDUPLI;
- lb= object_duplilist(G.scene, base->object);
-
- for(dob= lb->first; dob; dob= dob->next) {
- tbase.object= dob->ob;
- Mat4CpyMat4(dob->ob->obmat, dob->mat);
-
- draw_object(&tbase, DRAW_PICKING|DRAW_CONSTCOLOR);
-
- Mat4CpyMat4(dob->ob->obmat, dob->omat);
- }
- free_object_duplilist(lb);
- }
- code++;
- }
- }
- }
- G.vd->xray= FALSE; // restore
- }
-
- glPopName(); /* see above (pushname) */
- hits= glRenderMode(GL_RENDER);
-
- G.f &= ~G_PICKSEL;
- setwinmatrixview3d(curarea->winx, curarea->winy, NULL);
- Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat);
-
- if(G.vd->drawtype > OB_WIRE) {
- G.vd->zbuf= 0;
- glDisable(GL_DEPTH_TEST);
- }
- persp(PERSP_WIN);
-
- if(G.vd->flag & V3D_CLIPPING)
- view3d_clr_clipping();
-
- if(hits<0) error("Too many objects in select buffer");
-
- return hits;
-}
-
-float *give_cursor()
-{
- if(G.vd && G.vd->localview) return G.vd->cursor;
- else return G.scene->cursor;
-}
-
-unsigned int free_localbit()
-{
- unsigned int lay;
- ScrArea *sa;
- bScreen *sc;
-
- lay= 0;
-
- /* sometimes we loose a localview: when an area is closed */
- /* check all areas: which localviews are in use? */
- sc= G.main->screen.first;
- while(sc) {
- sa= sc->areabase.first;
- while(sa) {
- SpaceLink *sl= sa->spacedata.first;
- while(sl) {
- if(sl->spacetype==SPACE_VIEW3D) {
- View3D *v3d= (View3D*) sl;
- lay |= v3d->lay;
- }
- sl= sl->next;
- }
- sa= sa->next;
- }
- sc= sc->id.next;
- }
-
- if( (lay & 0x01000000)==0) return 0x01000000;
- if( (lay & 0x02000000)==0) return 0x02000000;
- if( (lay & 0x04000000)==0) return 0x04000000;
- if( (lay & 0x08000000)==0) return 0x08000000;
- if( (lay & 0x10000000)==0) return 0x10000000;
- if( (lay & 0x20000000)==0) return 0x20000000;
- if( (lay & 0x40000000)==0) return 0x40000000;
- if( (lay & 0x80000000)==0) return 0x80000000;
-
- return 0;
-}
-
-
-void initlocalview()
-{
- Base *base;
- float size = 0.0, min[3], max[3], afm[3];
- unsigned int locallay;
- int ok=0;
-
- if(G.vd->localvd) return;
-
- INIT_MINMAX(min, max);
-
- locallay= free_localbit();
-
- if(locallay==0) {
- error("Sorry, no more than 8 localviews");
- ok= 0;
- }
- else {
- if(G.obedit) {
- minmax_object(G.obedit, min, max);
-
- ok= 1;
-
- BASACT->lay |= locallay;
- G.obedit->lay= BASACT->lay;
- }
- else {
- base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- minmax_object(base->object, min, max);
- base->lay |= locallay;
- base->object->lay= base->lay;
- ok= 1;
- }
- base= base->next;
- }
- }
-
- afm[0]= (max[0]-min[0]);
- afm[1]= (max[1]-min[1]);
- afm[2]= (max[2]-min[2]);
- size= 0.7*MAX3(afm[0], afm[1], afm[2]);
- if(size<=0.01) size= 0.01;
- }
-
- if(ok) {
- G.vd->localvd= MEM_mallocN(sizeof(View3D), "localview");
- memcpy(G.vd->localvd, G.vd, sizeof(View3D));
-
- G.vd->ofs[0]= -(min[0]+max[0])/2.0;
- G.vd->ofs[1]= -(min[1]+max[1])/2.0;
- G.vd->ofs[2]= -(min[2]+max[2])/2.0;
-
- G.vd->dist= size;
-
- // correction for window aspect ratio
- if(curarea->winy>2 && curarea->winx>2) {
- size= (float)curarea->winx/(float)curarea->winy;
- if(size<1.0) size= 1.0/size;
- G.vd->dist*= size;
- }
-
- if (G.vd->persp==V3D_CAMOB) G.vd->persp= V3D_PERSP;
- if (G.vd->near> 0.1) G.vd->near= 0.1;
-
- G.vd->cursor[0]= -G.vd->ofs[0];
- G.vd->cursor[1]= -G.vd->ofs[1];
- G.vd->cursor[2]= -G.vd->ofs[2];
-
- G.vd->lay= locallay;
-
- countall();
- scrarea_queue_winredraw(curarea);
- }
- else {
- /* clear flags */
- base= FIRSTBASE;
- while(base) {
- if( base->lay & locallay ) {
- base->lay-= locallay;
- if(base->lay==0) base->lay= G.vd->layact;
- if(base->object != G.obedit) base->flag |= SELECT;
- base->object->lay= base->lay;
- }
- base= base->next;
- }
- scrarea_queue_headredraw(curarea);
-
- G.vd->localview= 0;
- }
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
-}
-
-void centerview() /* like a localview without local! */
-{
- Object *ob= OBACT;
- float size, min[3], max[3], afm[3];
- int ok=0;
-
- /* SMOOTHVIEW */
- float new_ofs[3];
- float new_dist;
-
- INIT_MINMAX(min, max);
-
- if (G.f & G_WEIGHTPAINT) {
- /* hardcoded exception, we look for the one selected armature */
- /* this is weak code this way, we should make a generic active/selection callback interface once... */
- Base *base;
- for(base=FIRSTBASE; base; base= base->next) {
- if(TESTBASELIB(base)) {
- if(base->object->type==OB_ARMATURE)
- if(base->object->flag & OB_POSEMODE)
- break;
- }
- }
- if(base)
- ob= base->object;
- }
-
-
- if(G.obedit) {
- ok = minmax_verts(min, max); /* only selected */
- }
- else if(ob && (ob->flag & OB_POSEMODE)) {
- if(ob->pose) {
- bArmature *arm= ob->data;
- bPoseChannel *pchan;
- float vec[3];
-
- for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
- if(pchan->bone->flag & BONE_SELECTED) {
- if(pchan->bone->layer & arm->layer) {
- ok= 1;
- VECCOPY(vec, pchan->pose_head);
- Mat4MulVecfl(ob->obmat, vec);
- DO_MINMAX(vec, min, max);
- VECCOPY(vec, pchan->pose_tail);
- Mat4MulVecfl(ob->obmat, vec);
- DO_MINMAX(vec, min, max);
- }
- }
- }
- }
- }
- else if (FACESEL_PAINT_TEST) {
- ok= minmax_tface(min, max);
- }
- else if (G.f & G_PARTICLEEDIT) {
- ok= PE_minmax(min, max);
- }
- else {
- Base *base= FIRSTBASE;
- while(base) {
- if TESTBASE(base) {
- minmax_object(base->object, min, max);
- /* account for duplis */
- minmax_object_duplis(base->object, min, max);
-
- ok= 1;
- }
- base= base->next;
- }
- }
-
- if(ok==0) return;
-
- afm[0]= (max[0]-min[0]);
- afm[1]= (max[1]-min[1]);
- afm[2]= (max[2]-min[2]);
- size= 0.7f*MAX3(afm[0], afm[1], afm[2]);
-
- if(size <= G.vd->near*1.5f) size= G.vd->near*1.5f;
-
- new_ofs[0]= -(min[0]+max[0])/2.0f;
- new_ofs[1]= -(min[1]+max[1])/2.0f;
- new_ofs[2]= -(min[2]+max[2])/2.0f;
-
- new_dist = size;
-
- /* correction for window aspect ratio */
- if(curarea->winy>2 && curarea->winx>2) {
- size= (float)curarea->winx/(float)curarea->winy;
- if(size<1.0f) size= 1.0f/size;
- new_dist*= size;
- }
-
- G.vd->cursor[0]= -new_ofs[0];
- G.vd->cursor[1]= -new_ofs[1];
- G.vd->cursor[2]= -new_ofs[2];
-
- if (G.vd->persp==V3D_CAMOB && G.vd->camera) {
- float orig_lens= G.vd->lens;
-
- G.vd->persp=V3D_PERSP;
- G.vd->dist= 0.0f;
- view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens);
- smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens);
- } else {
- if(G.vd->persp==V3D_CAMOB)
- G.vd->persp= V3D_PERSP;
-
- smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
- }
- scrarea_queue_winredraw(curarea);
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
-
-}
-
-
-void restore_localviewdata(View3D *vd)
-{
- if(vd->localvd==0) return;
-
- VECCOPY(vd->ofs, vd->localvd->ofs);
- vd->dist= vd->localvd->dist;
- vd->persp= vd->localvd->persp;
- vd->view= vd->localvd->view;
- vd->near= vd->localvd->near;
- vd->far= vd->localvd->far;
- vd->lay= vd->localvd->lay;
- vd->layact= vd->localvd->layact;
- vd->drawtype= vd->localvd->drawtype;
- vd->camera= vd->localvd->camera;
- QUATCOPY(vd->viewquat, vd->localvd->viewquat);
-
-}
-
-void endlocalview(ScrArea *sa)
-{
- View3D *v3d;
- struct Base *base;
- unsigned int locallay;
-
- if(sa->spacetype!=SPACE_VIEW3D) return;
- v3d= sa->spacedata.first;
-
- if(v3d->localvd) {
-
- locallay= v3d->lay & 0xFF000000;
-
- restore_localviewdata(v3d);
-
- MEM_freeN(v3d->localvd);
- v3d->localvd= 0;
- v3d->localview= 0;
-
- /* for when in other window the layers have changed */
- if(v3d->scenelock) v3d->lay= G.scene->lay;
-
- base= FIRSTBASE;
- while(base) {
- if( base->lay & locallay ) {
- base->lay-= locallay;
- if(base->lay==0) base->lay= v3d->layact;
- if(base->object != G.obedit) {
- base->flag |= SELECT;
- base->object->flag |= SELECT;
- }
- base->object->lay= base->lay;
- }
- base= base->next;
- }
-
- countall();
- allqueue(REDRAWVIEW3D, 0); /* because of select */
- allqueue(REDRAWOOPS, 0); /* because of select */
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
- }
-}
-
-void view3d_home(int center)
-{
- Base *base;
- float size, min[3], max[3], afm[3];
- int ok= 1, onedone=0;
-
- if(center) {
- min[0]= min[1]= min[2]= 0.0f;
- max[0]= max[1]= max[2]= 0.0f;
- }
- else {
- INIT_MINMAX(min, max);
- }
-
- for(base= FIRSTBASE; base; base= base->next) {
- if(base->lay & G.vd->lay) {
- onedone= 1;
- minmax_object(base->object, min, max);
- }
- }
- if(!onedone) return;
-
- afm[0]= (max[0]-min[0]);
- afm[1]= (max[1]-min[1]);
- afm[2]= (max[2]-min[2]);
- size= 0.7f*MAX3(afm[0], afm[1], afm[2]);
- if(size==0.0) ok= 0;
-
- if(ok) {
- float new_dist;
- float new_ofs[3];
-
- new_dist = size;
- new_ofs[0]= -(min[0]+max[0])/2.0f;
- new_ofs[1]= -(min[1]+max[1])/2.0f;
- new_ofs[2]= -(min[2]+max[2])/2.0f;
-
- // correction for window aspect ratio
- if(curarea->winy>2 && curarea->winx>2) {
- size= (float)curarea->winx/(float)curarea->winy;
- if(size<1.0) size= 1.0f/size;
- new_dist*= size;
- }
-
- if (G.vd->persp==V3D_CAMOB && G.vd->camera) {
- /* switch out of camera view */
- float orig_lens= G.vd->lens;
-
- G.vd->persp= V3D_PERSP;
- G.vd->dist= 0.0;
- view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens);
- smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens);
-
- } else {
- if(G.vd->persp==V3D_CAMOB) G.vd->persp= V3D_PERSP;
- smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL);
- }
- scrarea_queue_winredraw(curarea);
- }
- BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
-
-}
-
-
-void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3])
-{
- float alignaxis[3] = {0.0, 0.0, 0.0};
- float norm[3], axis[3], angle, new_quat[4];
-
- if(axisidx > 0) alignaxis[axisidx-1]= 1.0;
- else alignaxis[-axisidx-1]= -1.0;
-
- VECCOPY(norm, vec);
- Normalize(norm);
-
- angle= (float)acos(Inpf(alignaxis, norm));
- Crossf(axis, alignaxis, norm);
- VecRotToQuat(axis, -angle, new_quat);
-
- v3d->view= 0;
-
- if (v3d->persp==V3D_CAMOB && v3d->camera) {
- /* switch out of camera view */
- float orig_ofs[3];
- float orig_dist= v3d->dist;
- float orig_lens= v3d->lens;
-
- VECCOPY(orig_ofs, v3d->ofs);
- G.vd->persp= V3D_PERSP;
- G.vd->dist= 0.0;
- view_settings_from_ob(v3d->camera, v3d->ofs, NULL, NULL, &v3d->lens);
- smooth_view(G.vd, orig_ofs, new_quat, &orig_dist, &orig_lens);
- } else {
- if (v3d->persp==V3D_CAMOB) v3d->persp= V3D_PERSP; /* switch out of camera mode */
- smooth_view(v3d, NULL, new_quat, NULL, NULL);
- }
-}
-
-
-
-/* SMOOTHVIEW */
-void smooth_view(View3D *v3d, float *ofs, float *quat, float *dist, float *lens)
-{
- /* View Animation enabled */
- if (U.smooth_viewtx) {
- int i;
- char changed = 0;
- float step = 0.0, step_inv;
- float orig_dist;
- float orig_lens;
- float orig_quat[4];
- float orig_ofs[3];
-
- double time_allowed, time_current, time_start;
-
- /* if there is no difference, return */
- changed = 0; /* zero means no difference */
- if (dist) {
- if ((*dist) != v3d->dist)
- changed = 1;
- }
-
- if (lens) {
- if ((*lens) != v3d->lens)
- changed = 1;
- }
-
- if (!changed && ofs) {
- if ((ofs[0]!=v3d->ofs[0]) ||
- (ofs[1]!=v3d->ofs[1]) ||
- (ofs[2]!=v3d->ofs[2]) )
- changed = 1;
- }
-
- if (!changed && quat ) {
- if ((quat[0]!=v3d->viewquat[0]) ||
- (quat[1]!=v3d->viewquat[1]) ||
- (quat[2]!=v3d->viewquat[2]) ||
- (quat[3]!=v3d->viewquat[3]) )
- changed = 1;
- }
-
- /* The new view is different from the old one
- * so animate the view */
- if (changed) {
-
- /* store original values */
- VECCOPY(orig_ofs, v3d->ofs);
- QUATCOPY(orig_quat, v3d->viewquat);
- orig_dist = v3d->dist;
- orig_lens = v3d->lens;
-
- time_allowed= (float)U.smooth_viewtx / 1000.0;
- time_current = time_start = PIL_check_seconds_timer();
-
- /* if this is view rotation only
- * we can decrease the time allowed by
- * the angle between quats
- * this means small rotations wont lag */
- if (quat && !ofs && !dist) {
- float vec1[3], vec2[3];
- VECCOPY(vec1, quat);
- VECCOPY(vec2, v3d->viewquat);
- Normalize(vec1);
- Normalize(vec2);
- /* scale the time allowed by the rotation */
- time_allowed *= NormalizedVecAngle2(vec1, vec2)/(M_PI/2);
- }
-
- while (time_start + time_allowed > time_current) {
-
- step = (float)((time_current-time_start) / time_allowed);
-
- /* ease in/out */
- if (step < 0.5) step = (float)pow(step*2, 2)/2;
- else step = (float)1-(pow(2*(1-step),2)/2);
-
- step_inv = 1-step;
-
- if (ofs)
- for (i=0; i<3; i++)
- v3d->ofs[i] = ofs[i]*step + orig_ofs[i]*step_inv;
-
-
- if (quat)
- QuatInterpol(v3d->viewquat, orig_quat, quat, step);
-
- if (dist)
- v3d->dist = ((*dist)*step) + (orig_dist*step_inv);
-
- if (lens)
- v3d->lens = ((*lens)*step) + (orig_lens*step_inv);
-
- /*redraw the view*/
- scrarea_do_windraw(curarea);
- screen_swapbuffers();
-
- time_current= PIL_check_seconds_timer();
- }
- }
- }
-
- /* set these values even if animation is enabled because flaot
- * error will make then not quite accurate */
- if (ofs)
- VECCOPY(v3d->ofs, ofs);
- if (quat)
- QUATCOPY(v3d->viewquat, quat);
- if (dist)
- v3d->dist = *dist;
- if (lens)
- v3d->lens = *lens;
-
-}
-
-
-
-/* Gets the view trasnformation from a camera
- * currently dosnt take camzoom into account
- *
- * The dist is not modified for this function, if NULL its assimed zero
- * */
-void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens)
-{
- float bmat[4][4];
- float imat[4][4];
- float tmat[3][3];
-
- if (!ob) return;
-
- /* Offset */
- if (ofs) {
- where_is_object(ob);
- VECCOPY(ofs, ob->obmat[3]);
- VecMulf(ofs, -1.0f); /*flip the vector*/
- }
-
- /* Quat */
- if (quat) {
- Mat4CpyMat4(bmat, ob->obmat);
- Mat4Ortho(bmat);
- Mat4Invert(imat, bmat);
- Mat3CpyMat4(tmat, imat);
- Mat3ToQuat(tmat, quat);
- }
-
- if (dist) {
- float vec[3];
- Mat3CpyMat4(tmat, ob->obmat);
-
- vec[0]= vec[1] = 0.0;
- vec[2]= -(*dist);
- Mat3MulVecfl(tmat, vec);
- VecSubf(ofs, ofs, vec);
- }
-
- /* Lens */
- if (lens)
- object_view_settings(ob, lens, NULL, NULL);
-}
-
-/* For use with smooth view
- *
- * the current view is unchanged, blend between the current view and the
- * camera view
- * */
-void smooth_view_to_camera(View3D *v3d)
-{
- if (!U.smooth_viewtx || !v3d->camera || G.vd->persp != V3D_CAMOB) {
- return;
- } else {
- Object *ob = v3d->camera;
-
- float orig_ofs[3];
- float orig_dist=v3d->dist;
- float orig_lens=v3d->lens;
- float new_dist=0.0;
- float new_lens=35.0;
- float new_quat[4];
- float new_ofs[3];
-
- VECCOPY(orig_ofs, v3d->ofs);
-
- view_settings_from_ob(ob, new_ofs, new_quat, NULL, &new_lens);
-
- G.vd->persp= V3D_PERSP;
- smooth_view(v3d, new_ofs, new_quat, &new_dist, &new_lens);
- VECCOPY(v3d->ofs, orig_ofs);
- v3d->lens= orig_lens;
- v3d->dist = orig_dist; /* restore the dist */
-
- v3d->camera = ob;
- v3d->persp= V3D_CAMOB;
- }
-}
-
diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c
deleted file mode 100644
index 8da5e1b2572..00000000000
--- a/source/blender/src/vpaint.c
+++ /dev/null
@@ -1,1638 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <math.h>
-#include <string.h>
-
-#ifdef WIN32
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-#include "MEM_guardedalloc.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
-#include "MTC_matrixops.h"
-
-#include "DNA_action_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_brush_types.h"
-#include "DNA_cloth_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_particle_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_space_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_view3d_types.h"
-#include "DNA_userdef_types.h"
-
-#include "BKE_armature.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_cloth.h"
-#include "BKE_customdata.h"
-#include "BKE_depsgraph.h"
-#include "BKE_deform.h"
-#include "BKE_displist.h"
-#include "BKE_global.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_multires.h"
-#include "BKE_object.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_editview.h"
-#include "BIF_graphics.h"
-#include "BIF_glutil.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_meshtools.h"
-#include "BIF_mywindow.h"
-#include "BIF_space.h"
-#include "BIF_screen.h"
-#include "BIF_toolbox.h"
-
-#include "BDR_vpaint.h"
-#include "BDR_editobject.h"
-
-#include "BSE_drawview.h"
-#include "BSE_trans_types.h"
-#include "BSE_view.h"
-
-#include "multires.h"
-#include "mydevice.h"
-#include "blendef.h"
-
-#include "BIF_editdeform.h"
-
- /* Gvp.mode */
-#define VP_MIX 0
-#define VP_ADD 1
-#define VP_SUB 2
-#define VP_MUL 3
-#define VP_BLUR 4
-#define VP_LIGHTEN 5
-#define VP_DARKEN 6
-
-#define MAXINDEX 512000
-
-VPaint Gvp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT+VP_SPRAY, 0};
-VPaint Gwp= {1.0, 1.0, 1.0, 1.0, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, 0};
-
-static int *get_indexarray(void)
-{
- return MEM_mallocN(sizeof(int)*MAXINDEX + 2, "vertexpaint");
-}
-
-void free_vertexpaint()
-{
-
- if(Gvp.vpaint_prev) MEM_freeN(Gvp.vpaint_prev);
- Gvp.vpaint_prev= NULL;
-
- mesh_octree_table(NULL, NULL, 'e');
-}
-
-/* in contradiction to cpack drawing colors, the MCOL colors (vpaint colors) are per byte!
- so not endian sensitive. Mcol = ABGR!!! so be cautious with cpack calls */
-
-unsigned int rgba_to_mcol(float r, float g, float b, float a)
-{
- int ir, ig, ib, ia;
- unsigned int col;
- char *cp;
-
- ir= floor(255.0*r);
- if(ir<0) ir= 0; else if(ir>255) ir= 255;
- ig= floor(255.0*g);
- if(ig<0) ig= 0; else if(ig>255) ig= 255;
- ib= floor(255.0*b);
- if(ib<0) ib= 0; else if(ib>255) ib= 255;
- ia= floor(255.0*a);
- if(ia<0) ia= 0; else if(ia>255) ia= 255;
-
- cp= (char *)&col;
- cp[0]= ia;
- cp[1]= ib;
- cp[2]= ig;
- cp[3]= ir;
-
- return col;
-
-}
-
-static unsigned int vpaint_get_current_col(VPaint *vp)
-{
- return rgba_to_mcol(vp->r, vp->g, vp->b, 1.0f);
-}
-
-void do_shared_vertexcol(Mesh *me)
-{
- /* if no mcol: do not do */
- /* if tface: only the involved faces, otherwise all */
- MFace *mface;
- MTFace *tface;
- int a;
- short *scolmain, *scol;
- char *mcol;
-
- if(me->mcol==0 || me->totvert==0 || me->totface==0) return;
-
- scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain");
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (G.f & G_FACESELECT)==0) {
- scol= scolmain+4*mface->v1;
- scol[0]++; scol[1]+= mcol[1]; scol[2]+= mcol[2]; scol[3]+= mcol[3];
- scol= scolmain+4*mface->v2;
- scol[0]++; scol[1]+= mcol[5]; scol[2]+= mcol[6]; scol[3]+= mcol[7];
- scol= scolmain+4*mface->v3;
- scol[0]++; scol[1]+= mcol[9]; scol[2]+= mcol[10]; scol[3]+= mcol[11];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- scol[0]++; scol[1]+= mcol[13]; scol[2]+= mcol[14]; scol[3]+= mcol[15];
- }
- }
- if(tface) tface++;
- }
-
- a= me->totvert;
- scol= scolmain;
- while(a--) {
- if(scol[0]>1) {
- scol[1]/= scol[0];
- scol[2]/= scol[0];
- scol[3]/= scol[0];
- }
- scol+= 4;
- }
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (G.f & G_FACESELECT)==0) {
- scol= scolmain+4*mface->v1;
- mcol[1]= scol[1]; mcol[2]= scol[2]; mcol[3]= scol[3];
- scol= scolmain+4*mface->v2;
- mcol[5]= scol[1]; mcol[6]= scol[2]; mcol[7]= scol[3];
- scol= scolmain+4*mface->v3;
- mcol[9]= scol[1]; mcol[10]= scol[2]; mcol[11]= scol[3];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- mcol[13]= scol[1]; mcol[14]= scol[2]; mcol[15]= scol[3];
- }
- }
- if(tface) tface++;
- }
-
- MEM_freeN(scolmain);
-}
-
-void make_vertexcol(int shade) /* single ob */
-{
- Object *ob;
- Mesh *me;
-
- if(G.obedit) {
- error("Unable to perform function in Edit Mode");
- return;
- }
-
- ob= OBACT;
- if(!ob || ob->id.lib) return;
- me= get_mesh(ob);
- if(me==0) return;
-
- /* copies from shadedisplist to mcol */
- if(!me->mcol) {
- CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC, NULL, me->totface);
- mesh_update_customdata_pointers(me);
- }
-
- if(shade)
- shadeMeshMCol(ob, me);
- else
- memset(me->mcol, 255, 4*sizeof(MCol)*me->totface);
-
- if (me->mr) multires_load_cols(me);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWBUTSEDIT, 0);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot)
-{
- if(vp->vpaint_prev) {
- MEM_freeN(vp->vpaint_prev);
- vp->vpaint_prev= NULL;
- }
- vp->tot= tot;
-
- if(mcol==NULL || tot==0) return;
-
- vp->vpaint_prev= MEM_mallocN(4*sizeof(int)*tot, "vpaint_prev");
- memcpy(vp->vpaint_prev, mcol, 4*sizeof(int)*tot);
-
-}
-
-static void copy_wpaint_prev (VPaint *vp, MDeformVert *dverts, int dcount)
-{
- if (vp->wpaint_prev) {
- free_dverts(vp->wpaint_prev, vp->tot);
- vp->wpaint_prev= NULL;
- }
-
- if(dverts && dcount) {
-
- vp->wpaint_prev = MEM_mallocN (sizeof(MDeformVert)*dcount, "wpaint prev");
- vp->tot = dcount;
- copy_dverts (vp->wpaint_prev, dverts, dcount);
- }
-}
-
-
-void clear_vpaint()
-{
- Mesh *me;
- Object *ob;
- unsigned int *to, paintcol;
- int a;
-
- if((G.f & G_VERTEXPAINT)==0) return;
-
- ob= OBACT;
- me= get_mesh(ob);
- if(!ob || ob->id.lib) return;
-
- if(me==0 || me->mcol==0 || me->totface==0) return;
-
- paintcol= vpaint_get_current_col(&Gvp);
-
- to= (unsigned int *)me->mcol;
- a= 4*me->totface;
- while(a--) {
- *to= paintcol;
- to++;
- }
- BIF_undo_push("Clear vertex colors");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void clear_vpaint_selectedfaces()
-{
- Mesh *me;
- MFace *mf;
- Object *ob;
- unsigned int paintcol, *mcol;
- int i;
-
- ob= OBACT;
- me= get_mesh(ob);
- if(me==0 || me->totface==0) return;
-
- if(!me->mcol)
- make_vertexcol(0);
-
- paintcol= vpaint_get_current_col(&Gvp);
-
- mf = me->mface;
- mcol = (unsigned int*)me->mcol;
- for (i = 0; i < me->totface; i++, mf++, mcol+=4) {
- if (mf->flag & ME_FACE_SEL) {
- mcol[0] = paintcol;
- mcol[1] = paintcol;
- mcol[2] = paintcol;
- mcol[3] = paintcol;
- }
- }
-
- BIF_undo_push("Clear vertex colors");
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-/* fills in the selected faces with the current weight and vertex group */
-void clear_wpaint_selectedfaces()
-{
- extern float editbutvweight;
- float paintweight= editbutvweight;
- Mesh *me;
- MFace *mface;
- Object *ob;
- MDeformWeight *dw, *uw;
- int *indexar;
- int index, vgroup;
- unsigned int faceverts[5]={0,0,0,0,0};
- unsigned char i;
- int vgroup_mirror= -1;
-
- ob= OBACT;
- me= ob->data;
- if(me==0 || me->totface==0 || me->dvert==0 || !me->mface) return;
-
- indexar= get_indexarray();
- for(index=0, mface=me->mface; index<me->totface; index++, mface++) {
- if((mface->flag & ME_FACE_SEL)==0)
- indexar[index]= 0;
- else
- indexar[index]= index+1;
- }
-
- vgroup= ob->actdef-1;
-
- /* directly copied from weight_paint, should probaby split into a seperate function */
- /* if mirror painting, find the other group */
- if(Gwp.flag & VP_MIRROR_X) {
- bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1);
- if(defgroup) {
- bDeformGroup *curdef;
- int actdef= 0;
- char name[32];
-
- BLI_strncpy(name, defgroup->name, 32);
- bone_flip_name(name, 0); /* 0 = don't strip off number extensions */
-
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++)
- if (!strcmp(curdef->name, name))
- break;
- if(curdef==NULL) {
- int olddef= ob->actdef; /* tsk, add_defgroup sets the active defgroup */
- curdef= add_defgroup_name (ob, name);
- ob->actdef= olddef;
- }
-
- if(curdef && curdef!=defgroup)
- vgroup_mirror= actdef;
- }
- }
- /* end copy from weight_paint*/
-
- copy_wpaint_prev(&Gwp, me->dvert, me->totvert);
-
- for(index=0; index<me->totface; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- mface= me->mface + (indexar[index]-1);
- /* just so we can loop through the verts */
- faceverts[0]= mface->v1;
- faceverts[1]= mface->v2;
- faceverts[2]= mface->v3;
- faceverts[3]= mface->v4;
- for (i=0; i<3 || faceverts[i]; i++) {
- if(!((me->dvert+faceverts[i])->flag)) {
- dw= verify_defweight(me->dvert+faceverts[i], vgroup);
- if(dw) {
- uw= verify_defweight(Gwp.wpaint_prev+faceverts[i], vgroup);
- uw->weight= dw->weight; /* set the undio weight */
- dw->weight= paintweight;
-
- if(Gwp.flag & VP_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, faceverts[i]);
- if(j>=0) {
- /* copy, not paint again */
- if(vgroup_mirror != -1) {
- dw= verify_defweight(me->dvert+j, vgroup_mirror);
- uw= verify_defweight(Gwp.wpaint_prev+j, vgroup_mirror);
- } else {
- dw= verify_defweight(me->dvert+j, vgroup);
- uw= verify_defweight(Gwp.wpaint_prev+j, vgroup);
- }
- uw->weight= dw->weight; /* set the undo weight */
- dw->weight= paintweight;
- }
- }
- }
- (me->dvert+faceverts[i])->flag= 1;
- }
- }
- }
- }
-
- index=0;
- while (index<me->totvert) {
- (me->dvert+index)->flag= 0;
- index++;
- }
-
- MEM_freeN(indexar);
- copy_wpaint_prev(&Gwp, NULL, 0);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- BIF_undo_push("Set vertex weight");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-
-void vpaint_dogamma()
-{
- Mesh *me;
- Object *ob;
- float igam, fac;
- int a, temp;
- char *cp, gamtab[256];
-
- if((G.f & G_VERTEXPAINT)==0) return;
-
- ob= OBACT;
- me= get_mesh(ob);
- if(me==0 || me->mcol==0 || me->totface==0) return;
-
- igam= 1.0/Gvp.gamma;
- for(a=0; a<256; a++) {
-
- fac= ((float)a)/255.0;
- fac= Gvp.mul*pow( fac, igam);
-
- temp= 255.9*fac;
-
- if(temp<=0) gamtab[a]= 0;
- else if(temp>=255) gamtab[a]= 255;
- else gamtab[a]= temp;
- }
-
- a= 4*me->totface;
- cp= (char *)me->mcol;
- while(a--) {
-
- cp[1]= gamtab[ cp[1] ];
- cp[2]= gamtab[ cp[2] ];
- cp[3]= gamtab[ cp[3] ];
-
- cp+= 4;
- }
- allqueue(REDRAWVIEW3D, 0);
-}
-
-/* used for both 3d view and image window */
-void sample_vpaint() /* frontbuf */
-{
- unsigned int col;
- int x, y;
- short mval[2];
- char *cp;
-
- getmouseco_areawin(mval);
- x= mval[0]; y= mval[1];
-
- if(x<0 || y<0) return;
- if(x>=curarea->winx || y>=curarea->winy) return;
-
- x+= curarea->winrct.xmin;
- y+= curarea->winrct.ymin;
-
- glReadBuffer(GL_FRONT);
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
- glReadBuffer(GL_BACK);
-
- cp = (char *)&col;
-
- if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT)) {
- Gvp.r= cp[0]/255.0f;
- Gvp.g= cp[1]/255.0f;
- Gvp.b= cp[2]/255.0f;
- }
- else {
- Brush *brush= G.scene->toolsettings->imapaint.brush;
-
- if(brush) {
- brush->rgb[0]= cp[0]/255.0f;
- brush->rgb[1]= cp[1]/255.0f;
- brush->rgb[2]= cp[2]/255.0f;
-
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWIMAGE, 0);
- }
- }
-
- allqueue(REDRAWBUTSEDIT, 0);
- addqueue(curarea->win, REDRAW, 1); /* needed for when panel is open... */
-}
-
-static unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
-
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
-
- return col;
-}
-
-static unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int temp;
- unsigned int col=0;
-
- if(fac==0) return col1;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- temp= cp1[1] + ((fac*cp2[1])/255);
- if(temp>254) cp[1]= 255; else cp[1]= temp;
- temp= cp1[2] + ((fac*cp2[2])/255);
- if(temp>254) cp[2]= 255; else cp[2]= temp;
- temp= cp1[3] + ((fac*cp2[3])/255);
- if(temp>254) cp[3]= 255; else cp[3]= temp;
-
- return col;
-}
-
-static unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int temp;
- unsigned int col=0;
-
- if(fac==0) return col1;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- cp[0]= 255;
- temp= cp1[1] - ((fac*cp2[1])/255);
- if(temp<0) cp[1]= 0; else cp[1]= temp;
- temp= cp1[2] - ((fac*cp2[2])/255);
- if(temp<0) cp[2]= 0; else cp[2]= temp;
- temp= cp1[3] - ((fac*cp2[3])/255);
- if(temp<0) cp[3]= 0; else cp[3]= temp;
-
- return col;
-}
-
-static unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
-
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- /* first mul, then blend the fac */
- cp[0]= 255;
- cp[1]= (mfac*cp1[1] + fac*((cp2[1]*cp1[1])/255) )/255;
- cp[2]= (mfac*cp1[2] + fac*((cp2[2]*cp1[2])/255) )/255;
- cp[3]= (mfac*cp1[3] + fac*((cp2[3]*cp1[3])/255) )/255;
-
-
- return col;
-}
-
-static unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
-
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- /* See if are lighter, if so mix, else dont do anything.
- if the paint col is darker then the original, then ignore */
- if (cp1[1]+cp1[2]+cp1[3] > cp2[1]+cp2[2]+cp2[3])
- return col1;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
-
- return col;
-}
-
-static unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac)
-{
- char *cp1, *cp2, *cp;
- int mfac;
- unsigned int col=0;
-
- if(fac==0) return col1;
- if(fac>=255) return col2;
-
- mfac= 255-fac;
-
- cp1= (char *)&col1;
- cp2= (char *)&col2;
- cp= (char *)&col;
-
- /* See if were darker, if so mix, else dont do anything.
- if the paint col is brighter then the original, then ignore */
- if (cp1[1]+cp1[2]+cp1[3] < cp2[1]+cp2[2]+cp2[3])
- return col1;
-
- cp[0]= 255;
- cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
- cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
- cp[3]= (mfac*cp1[3]+fac*cp2[3])/255;
- return col;
-}
-
-static void vpaint_blend( unsigned int *col, unsigned int *colorig, unsigned int paintcol, int alpha)
-{
-
- if(Gvp.mode==VP_MIX || Gvp.mode==VP_BLUR) *col= mcol_blend( *col, paintcol, alpha);
- else if(Gvp.mode==VP_ADD) *col= mcol_add( *col, paintcol, alpha);
- else if(Gvp.mode==VP_SUB) *col= mcol_sub( *col, paintcol, alpha);
- else if(Gvp.mode==VP_MUL) *col= mcol_mul( *col, paintcol, alpha);
- else if(Gvp.mode==VP_LIGHTEN) *col= mcol_lighten( *col, paintcol, alpha);
- else if(Gvp.mode==VP_DARKEN) *col= mcol_darken( *col, paintcol, alpha);
-
- /* if no spray, clip color adding with colorig & orig alpha */
- if((Gvp.flag & VP_SPRAY)==0) {
- unsigned int testcol=0, a;
- char *cp, *ct, *co;
-
- alpha= (int)(255.0*Gvp.a);
-
- if(Gvp.mode==VP_MIX || Gvp.mode==VP_BLUR) testcol= mcol_blend( *colorig, paintcol, alpha);
- else if(Gvp.mode==VP_ADD) testcol= mcol_add( *colorig, paintcol, alpha);
- else if(Gvp.mode==VP_SUB) testcol= mcol_sub( *colorig, paintcol, alpha);
- else if(Gvp.mode==VP_MUL) testcol= mcol_mul( *colorig, paintcol, alpha);
- else if(Gvp.mode==VP_LIGHTEN) testcol= mcol_lighten( *colorig, paintcol, alpha);
- else if(Gvp.mode==VP_DARKEN) testcol= mcol_darken( *colorig, paintcol, alpha);
-
- cp= (char *)col;
- ct= (char *)&testcol;
- co= (char *)colorig;
-
- for(a=0; a<4; a++) {
- if( ct[a]<co[a] ) {
- if( cp[a]<ct[a] ) cp[a]= ct[a];
- else if( cp[a]>co[a] ) cp[a]= co[a];
- }
- else {
- if( cp[a]<co[a] ) cp[a]= co[a];
- else if( cp[a]>ct[a] ) cp[a]= ct[a];
- }
- }
- }
-}
-
-
-static int sample_backbuf_area(int *indexar, int totface, int x, int y, float size)
-{
- unsigned int *rt;
- struct ImBuf *ibuf;
- int x1, y1, x2, y2, a, tot=0, index;
-
- if(totface+4>=MAXINDEX) return 0;
-
- if(size>64.0) size= 64.0;
-
- x1= x-size;
- x2= x+size;
- CLAMP(x1, 0, curarea->winx-1);
- CLAMP(x2, 0, curarea->winx-1);
- y1= y-size;
- y2= y+size;
- CLAMP(y1, 0, curarea->winy-1);
- CLAMP(y2, 0, curarea->winy-1);
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0);
-#endif
-
- if(x1>=x2 || y1>=y2) return 0;
-
- ibuf = IMB_allocImBuf(2*size + 4, 2*size + 4, 32, IB_rect, 0);
- glReadPixels(x1+curarea->winrct.xmin, y1+curarea->winrct.ymin, x2-x1+1, y2-y1+1, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- glReadBuffer(GL_BACK);
-
- if(G.order==B_ENDIAN) {
- IMB_convert_rgba_to_abgr(ibuf);
- }
-
- rt= ibuf->rect;
- size= (y2-y1)*(x2-x1);
- if(size<=0) return 0;
-
- memset(indexar, 0, sizeof(int)*totface+4); /* plus 2! first element is total, +2 was giving valgrind errors, +4 seems ok */
-
- while(size--) {
-
- if(*rt) {
- index= framebuffer_to_index(*rt);
- if(index>0 && index<=totface)
- indexar[index] = 1;
- }
-
- rt++;
- }
-
- for(a=1; a<=totface; a++) {
- if(indexar[a]) indexar[tot++]= a;
- }
-
- IMB_freeImBuf(ibuf);
-
- return tot;
-}
-
-static int calc_vp_alpha_dl(VPaint *vp, float vpimat[][3], float *vert_nor, short *mval)
-{
- float fac, dx, dy;
- int alpha;
- short vertco[2];
-
- if(vp->flag & VP_SOFT) {
- project_short_noclip(vert_nor, vertco);
- dx= mval[0]-vertco[0];
- dy= mval[1]-vertco[1];
-
- fac= sqrt(dx*dx + dy*dy);
- if(fac > vp->size) return 0;
- if(vp->flag & VP_HARD)
- alpha= 255;
- else
- alpha= 255.0*vp->a*(1.0-fac/vp->size);
- }
- else {
- alpha= 255.0*vp->a;
- }
-
- if(vp->flag & VP_NORMALS) {
- float *no= vert_nor+3;
-
- /* transpose ! */
- fac= vpimat[2][0]*no[0]+vpimat[2][1]*no[1]+vpimat[2][2]*no[2];
- if(fac>0.0) {
- dx= vpimat[0][0]*no[0]+vpimat[0][1]*no[1]+vpimat[0][2]*no[2];
- dy= vpimat[1][0]*no[0]+vpimat[1][1]*no[1]+vpimat[1][2]*no[2];
-
- alpha*= fac/sqrt(dx*dx + dy*dy + fac*fac);
- }
- else return 0;
- }
-
- return alpha;
-}
-
-static void wpaint_blend(MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval)
-{
-
- if(dw==NULL || uw==NULL) return;
-
- if(Gwp.mode==VP_MIX || Gwp.mode==VP_BLUR)
- dw->weight = paintval*alpha + dw->weight*(1.0-alpha);
- else if(Gwp.mode==VP_ADD)
- dw->weight += paintval*alpha;
- else if(Gwp.mode==VP_SUB)
- dw->weight -= paintval*alpha;
- else if(Gwp.mode==VP_MUL)
- /* first mul, then blend the fac */
- dw->weight = ((1.0-alpha) + alpha*paintval)*dw->weight;
- else if(Gwp.mode==VP_LIGHTEN) {
- if (dw->weight < paintval)
- dw->weight = paintval*alpha + dw->weight*(1.0-alpha);
- } else if(Gwp.mode==VP_DARKEN) {
- if (dw->weight > paintval)
- dw->weight = paintval*alpha + dw->weight*(1.0-alpha);
- }
- CLAMP(dw->weight, 0.0f, 1.0f);
-
- /* if no spray, clip result with orig weight & orig alpha */
- if((Gwp.flag & VP_SPRAY)==0) {
- float testw=0.0f;
-
- alpha= Gwp.a;
- if(Gwp.mode==VP_MIX || Gwp.mode==VP_BLUR)
- testw = paintval*alpha + uw->weight*(1.0-alpha);
- else if(Gwp.mode==VP_ADD)
- testw = uw->weight + paintval*alpha;
- else if(Gwp.mode==VP_SUB)
- testw = uw->weight - paintval*alpha;
- else if(Gwp.mode==VP_MUL)
- /* first mul, then blend the fac */
- testw = ((1.0-alpha) + alpha*paintval)*uw->weight;
- else if(Gwp.mode==VP_LIGHTEN) {
- if (uw->weight < paintval)
- testw = paintval*alpha + uw->weight*(1.0-alpha);
- else
- testw = uw->weight;
- } else if(Gwp.mode==VP_DARKEN) {
- if (uw->weight > paintval)
- testw = paintval*alpha + uw->weight*(1.0-alpha);
- else
- testw = uw->weight;
- }
- CLAMP(testw, 0.0f, 1.0f);
-
- if( testw<uw->weight ) {
- if(dw->weight < testw) dw->weight= testw;
- else if(dw->weight > uw->weight) dw->weight= uw->weight;
- }
- else {
- if(dw->weight > testw) dw->weight= testw;
- else if(dw->weight < uw->weight) dw->weight= uw->weight;
- }
- }
-
-}
-
-/* ----------------------------------------------------- */
-
-/* used for 3d view, on active object, assumes me->dvert exists */
-/* if mode==1: */
-/* samples cursor location, and gives menu with vertex groups to activate */
-/* else */
-/* sets editbutvweight to the closest weight value to vertex */
-/* note: we cant sample frontbuf, weight colors are interpolated too unpredictable */
-static void sample_wpaint(int mode)
-{
- Object *ob= OBACT;
- Mesh *me= get_mesh(ob);
- int index;
- short mval[2], sco[2];
-
- if (!me) return;
-
- getmouseco_areawin(mval);
- index= sample_backbuf(mval[0], mval[1]);
-
- if(index && index<=me->totface) {
- MFace *mface;
-
- mface= ((MFace *)me->mface) + index-1;
-
- if(mode==1) { /* sampe which groups are in here */
- MDeformVert *dv;
- int a, totgroup;
-
- totgroup= BLI_countlist(&ob->defbase);
- if(totgroup) {
- int totmenu=0;
- int *groups=MEM_callocN(totgroup*sizeof(int), "groups");
-
- dv= me->dvert+mface->v1;
- for(a=0; a<dv->totweight; a++) {
- if (dv->dw[a].def_nr<totgroup)
- groups[dv->dw[a].def_nr]= 1;
- }
- dv= me->dvert+mface->v2;
- for(a=0; a<dv->totweight; a++) {
- if (dv->dw[a].def_nr<totgroup)
- groups[dv->dw[a].def_nr]= 1;
- }
- dv= me->dvert+mface->v3;
- for(a=0; a<dv->totweight; a++) {
- if (dv->dw[a].def_nr<totgroup)
- groups[dv->dw[a].def_nr]= 1;
- }
- if(mface->v4) {
- dv= me->dvert+mface->v4;
- for(a=0; a<dv->totweight; a++) {
- if (dv->dw[a].def_nr<totgroup)
- groups[dv->dw[a].def_nr]= 1;
- }
- }
- for(a=0; a<totgroup; a++)
- if(groups[a]) totmenu++;
-
- if(totmenu==0) {
- notice("No Vertex Group Selected");
- }
- else {
- bDeformGroup *dg;
- short val;
- char item[40], *str= MEM_mallocN(40*totmenu+40, "menu");
-
- strcpy(str, "Vertex Groups %t");
- for(a=0, dg=ob->defbase.first; dg && a<totgroup; a++, dg= dg->next) {
- if(groups[a]) {
- sprintf(item, "|%s %%x%d", dg->name, a);
- strcat(str, item);
- }
- }
-
- val= pupmenu(str);
- if(val>=0) {
- ob->actdef= val+1;
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- allqueue(REDRAWVIEW3D, 0);
- allqueue(REDRAWOOPS, 0);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- MEM_freeN(str);
- }
- MEM_freeN(groups);
- }
- else notice("No Vertex Groups in Object");
- }
- else {
- DerivedMesh *dm;
- MDeformWeight *dw;
- extern float editbutvweight;
- float w1, w2, w3, w4, co[3], fac;
-
- dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH);
- if(dm->getVertCo==NULL) {
- notice("Not supported yet");
- }
- else {
- /* calc 3 or 4 corner weights */
- dm->getVertCo(dm, mface->v1, co);
- project_short_noclip(co, sco);
- w1= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
-
- dm->getVertCo(dm, mface->v2, co);
- project_short_noclip(co, sco);
- w2= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
-
- dm->getVertCo(dm, mface->v3, co);
- project_short_noclip(co, sco);
- w3= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
-
- if(mface->v4) {
- dm->getVertCo(dm, mface->v4, co);
- project_short_noclip(co, sco);
- w4= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1]));
- }
- else w4= 1.0e10;
-
- fac= MIN4(w1, w2, w3, w4);
- if(w1==fac) {
- dw= get_defweight(me->dvert+mface->v1, ob->actdef-1);
- if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f;
- }
- else if(w2==fac) {
- dw= get_defweight(me->dvert+mface->v2, ob->actdef-1);
- if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f;
- }
- else if(w3==fac) {
- dw= get_defweight(me->dvert+mface->v3, ob->actdef-1);
- if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f;
- }
- else if(w4==fac) {
- if(mface->v4) {
- dw= get_defweight(me->dvert+mface->v4, ob->actdef-1);
- if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f;
- }
- }
- }
- dm->release(dm);
- }
-
- }
- allqueue(REDRAWBUTSEDIT, 0);
-
-}
-
-static void do_weight_paint_vertex(Object *ob, int index, int alpha, float paintweight, int vgroup_mirror)
-{
- Mesh *me= ob->data;
- MDeformWeight *dw, *uw;
- int vgroup= ob->actdef-1;
-
- if(Gwp.flag & VP_ONLYVGROUP) {
- dw= get_defweight(me->dvert+index, vgroup);
- uw= get_defweight(Gwp.wpaint_prev+index, vgroup);
- }
- else {
- dw= verify_defweight(me->dvert+index, vgroup);
- uw= verify_defweight(Gwp.wpaint_prev+index, vgroup);
- }
- if(dw==NULL || uw==NULL)
- return;
-
- wpaint_blend(dw, uw, (float)alpha/255.0, paintweight);
-
- if(Gwp.flag & VP_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, index);
- if(j>=0) {
- /* copy, not paint again */
- if(vgroup_mirror != -1)
- uw= verify_defweight(me->dvert+j, vgroup_mirror);
- else
- uw= verify_defweight(me->dvert+j, vgroup);
-
- uw->weight= dw->weight;
- }
- }
-}
-
-void weight_paint(void)
-{
- extern float editbutvweight;
- Object *ob;
- Mesh *me;
- MFace *mface;
- float mat[4][4], imat[4][4], paintweight, *vertexcosnos;
- float vpimat[3][3];
- int *indexar, index, totindex, alpha, totw;
- int vgroup_mirror= -1;
- short mval[2], mvalo[2], firsttime=1;
-
- if((G.f & G_WEIGHTPAINT)==0) return;
- if(G.obedit) return;
- if(multires_level1_test()) return;
-
- ob= OBACT;
- if(!ob || ob->id.lib) return;
-
- me= get_mesh(ob);
- if(me==NULL || me->totface==0) return;
-
- /* if nothing was added yet, we make dverts and a vertex deform group */
- if (!me->dvert)
- create_dverts(&me->id);
-
- if(G.qual & LR_CTRLKEY) {
- sample_wpaint(0);
- return;
- }
- if(G.qual & LR_SHIFTKEY) {
- sample_wpaint(1);
- return;
- }
-
- /* ALLOCATIONS! no return after this line */
- /* painting on subsurfs should give correct points too, this returns me->totvert amount */
- vertexcosnos= mesh_get_mapped_verts_nors(ob);
- indexar= get_indexarray();
- copy_wpaint_prev(&Gwp, me->dvert, me->totvert);
-
- /* this happens on a Bone select, when no vgroup existed yet */
- if(ob->actdef<=0) {
- Object *modob;
- if((modob = modifiers_isDeformedByArmature(ob))) {
- bPoseChannel *pchan;
- for(pchan= modob->pose->chanbase.first; pchan; pchan= pchan->next)
- if(pchan->bone->flag & SELECT)
- break;
- if(pchan) {
- bDeformGroup *dg= get_named_vertexgroup(ob, pchan->name);
- if(dg==NULL)
- dg= add_defgroup_name(ob, pchan->name); /* sets actdef */
- else
- ob->actdef= get_defgroup_num(ob, dg);
- allqueue(REDRAWBUTSEDIT, 0);
- }
- }
- }
- if(ob->defbase.first==NULL) {
- add_defgroup(ob);
- allqueue(REDRAWBUTSEDIT, 0);
- }
-
- if(ob->lay & G.vd->lay); else error("Active object is not in this layer");
-
- persp(PERSP_VIEW);
- /* imat for normals */
- Mat4MulMat4(mat, ob->obmat, G.vd->viewmat);
- Mat4Invert(imat, mat);
- Mat3CpyMat4(vpimat, imat);
-
- /* load projection matrix */
- mymultmatrix(ob->obmat);
- mygetsingmatrix(mat);
- myloadmatrix(G.vd->viewmat);
-
- getmouseco_areawin(mvalo);
-
- getmouseco_areawin(mval);
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- /* if mirror painting, find the other group */
- if(Gwp.flag & VP_MIRROR_X) {
- bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1);
- if(defgroup) {
- bDeformGroup *curdef;
- int actdef= 0;
- char name[32];
-
- BLI_strncpy(name, defgroup->name, 32);
- bone_flip_name(name, 0); /* 0 = don't strip off number extensions */
-
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++)
- if (!strcmp(curdef->name, name))
- break;
- if(curdef==NULL) {
- int olddef= ob->actdef; /* tsk, add_defgroup sets the active defgroup */
- curdef= add_defgroup_name (ob, name);
- ob->actdef= olddef;
- }
-
- if(curdef && curdef!=defgroup)
- vgroup_mirror= actdef;
- }
- }
-
- while (get_mbut() & L_MOUSE) {
- getmouseco_areawin(mval);
-
- if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
- firsttime= 0;
-
- /* which faces are involved */
- if(Gwp.flag & VP_AREA) {
- totindex= sample_backbuf_area(indexar, me->totface, mval[0], mval[1], Gwp.size);
- }
- else {
- indexar[0]= sample_backbuf(mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
- }
-
- MTC_Mat4SwapMat4(G.vd->persmat, mat);
-
- if(Gwp.flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
-
- mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if(mface->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
- }
- }
- }
- }
-
- if((G.f & G_FACESELECT) && me->mface) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
-
- mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if((mface->flag & ME_FACE_SEL)==0) {
- indexar[index]= 0;
- }
- }
- }
- }
-
- /* make sure each vertex gets treated only once */
- /* and calculate filter weight */
- totw= 0;
- if(Gwp.mode==VP_BLUR)
- paintweight= 0.0f;
- else
- paintweight= editbutvweight;
-
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- mface= me->mface + (indexar[index]-1);
-
- (me->dvert+mface->v1)->flag= 1;
- (me->dvert+mface->v2)->flag= 1;
- (me->dvert+mface->v3)->flag= 1;
- if(mface->v4) (me->dvert+mface->v4)->flag= 1;
-
- if(Gwp.mode==VP_BLUR) {
- MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight;
-
- if(Gwp.flag & VP_ONLYVGROUP)
- dw_func= get_defweight;
-
- dw= dw_func(me->dvert+mface->v1, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v2, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v3, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- if(mface->v4) {
- dw= dw_func(me->dvert+mface->v4, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- }
- }
- }
- }
-
- if(Gwp.mode==VP_BLUR)
- paintweight/= (float)totw;
-
- for(index=0; index<totindex; index++) {
-
- if(indexar[index] && indexar[index]<=me->totface) {
- mface= me->mface + (indexar[index]-1);
-
- if((me->dvert+mface->v1)->flag) {
- alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v1, mval);
- if(alpha) {
- do_weight_paint_vertex(ob, mface->v1, alpha, paintweight, vgroup_mirror);
- }
- (me->dvert+mface->v1)->flag= 0;
- }
-
- if((me->dvert+mface->v2)->flag) {
- alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v2, mval);
- if(alpha) {
- do_weight_paint_vertex(ob, mface->v2, alpha, paintweight, vgroup_mirror);
- }
- (me->dvert+mface->v2)->flag= 0;
- }
-
- if((me->dvert+mface->v3)->flag) {
- alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v3, mval);
- if(alpha) {
- do_weight_paint_vertex(ob, mface->v3, alpha, paintweight, vgroup_mirror);
- }
- (me->dvert+mface->v3)->flag= 0;
- }
-
- if((me->dvert+mface->v4)->flag) {
- if(mface->v4) {
- alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v4, mval);
- if(alpha) {
- do_weight_paint_vertex(ob, mface->v4, alpha, paintweight, vgroup_mirror);
- }
- (me->dvert+mface->v4)->flag= 0;
- }
- }
- }
- }
-
- MTC_Mat4SwapMat4(G.vd->persmat, mat);
-
- }
- else BIF_wait_for_statechange();
-
- if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- scrarea_do_windraw(curarea);
-
- if(Gwp.flag & (VP_AREA|VP_SOFT)) {
- /* draw circle in backbuf! */
- persp(PERSP_WIN);
- fdrawXORcirc((float)mval[0], (float)mval[1], Gwp.size);
- persp(PERSP_VIEW);
- }
-
- screen_swapbuffers();
- backdrawview3d(0);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
- }
-
- if(vertexcosnos)
- MEM_freeN(vertexcosnos);
- MEM_freeN(indexar);
- copy_wpaint_prev(&Gwp, NULL, 0);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- /* and particles too */
- if(ob->particlesystem.first) {
- ParticleSystem *psys;
- int i;
-
- psys= ob->particlesystem.first;
- while(psys) {
- for(i=0; i<PSYS_TOT_VG; i++) {
- if(psys->vgroup[i]==ob->actdef) {
- psys->recalc |= PSYS_RECALC_HAIR;
- break;
- }
- }
-
- psys= psys->next;
- }
- }
-
- BIF_undo_push("Weight Paint");
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void vertex_paint()
-{
- Object *ob;
- Mesh *me;
- MFace *mface;
- float mat[4][4], imat[4][4], *vertexcosnos;
- float vpimat[3][3];
- unsigned int paintcol=0, *mcol, *mcolorig, fcol1, fcol2;
- int *indexar, index, alpha, totindex;
- short mval[2], mvalo[2], firsttime=1;
-
- if((G.f & G_VERTEXPAINT)==0) return;
- if(G.obedit) return;
-
- ob= OBACT;
- if(!ob || ob->id.lib) return;
-
- me= get_mesh(ob);
- if(me==NULL || me->totface==0) return;
- if(ob->lay & G.vd->lay); else error("Active object is not in this layer");
-
- if(me->mcol==NULL) make_vertexcol(0);
-
- if(me->mcol==NULL) return;
-
- /* ALLOCATIONS! No return after his line */
-
- /* painting on subsurfs should give correct points too, this returns me->totvert amount */
- vertexcosnos= mesh_get_mapped_verts_nors(ob);
- indexar= get_indexarray();
- copy_vpaint_prev(&Gvp, (unsigned int *)me->mcol, me->totface);
-
- /* opengl/matrix stuff */
- persp(PERSP_VIEW);
- /* imat for normals */
- Mat4MulMat4(mat, ob->obmat, G.vd->viewmat);
- Mat4Invert(imat, mat);
- Mat3CpyMat4(vpimat, imat);
-
- /* load projection matrix */
- mymultmatrix(ob->obmat);
- mygetsingmatrix(mat);
- myloadmatrix(G.vd->viewmat);
-
- paintcol= vpaint_get_current_col(&Gvp);
-
- getmouseco_areawin(mvalo);
-
- getmouseco_areawin(mval);
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
-
- while (get_mbut() & L_MOUSE) {
- getmouseco_areawin(mval);
-
- if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
-
- firsttime= 0;
-
- /* which faces are involved */
- if(Gvp.flag & VP_AREA) {
- totindex= sample_backbuf_area(indexar, me->totface, mval[0], mval[1], Gvp.size);
- }
- else {
- indexar[0]= sample_backbuf(mval[0], mval[1]);
- if(indexar[0]) totindex= 1;
- else totindex= 0;
- }
-
- MTC_Mat4SwapMat4(G.vd->persmat, mat);
-
- if(Gvp.flag & VP_COLINDEX) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
-
- mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if(mface->mat_nr!=ob->actcol-1) {
- indexar[index]= 0;
- }
- }
- }
- }
- if((G.f & G_FACESELECT) && me->mface) {
- for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- mface= ((MFace *)me->mface) + (indexar[index]-1);
-
- if((mface->flag & ME_FACE_SEL)==0)
- indexar[index]= 0;
- }
- }
- }
-
- for(index=0; index<totindex; index++) {
-
- if(indexar[index] && indexar[index]<=me->totface) {
-
- mface= ((MFace *)me->mface) + (indexar[index]-1);
- mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1);
- mcolorig= ( (unsigned int *)Gvp.vpaint_prev) + 4*(indexar[index]-1);
-
- if(Gvp.mode==VP_BLUR) {
- fcol1= mcol_blend( mcol[0], mcol[1], 128);
- if(mface->v4) {
- fcol2= mcol_blend( mcol[2], mcol[3], 128);
- paintcol= mcol_blend( fcol1, fcol2, 128);
- }
- else {
- paintcol= mcol_blend( mcol[2], fcol1, 170);
- }
-
- }
-
- alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v1, mval);
- if(alpha) vpaint_blend( mcol, mcolorig, paintcol, alpha);
-
- alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v2, mval);
- if(alpha) vpaint_blend( mcol+1, mcolorig+1, paintcol, alpha);
-
- alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v3, mval);
- if(alpha) vpaint_blend( mcol+2, mcolorig+2, paintcol, alpha);
-
- if(mface->v4) {
- alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v4, mval);
- if(alpha) vpaint_blend( mcol+3, mcolorig+3, paintcol, alpha);
- }
- }
- }
-
- MTC_Mat4SwapMat4(G.vd->persmat, mat);
-
- do_shared_vertexcol(me);
-
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
- scrarea_do_windraw(curarea);
-
- if(Gvp.flag & (VP_AREA|VP_SOFT)) {
- /* draw circle in backbuf! */
- persp(PERSP_WIN);
- fdrawXORcirc((float)mval[0], (float)mval[1], Gvp.size);
- persp(PERSP_VIEW);
- }
- screen_swapbuffers();
- backdrawview3d(0);
-
- mvalo[0]= mval[0];
- mvalo[1]= mval[1];
- }
- else BIF_wait_for_statechange();
- }
-
- if(vertexcosnos)
- MEM_freeN(vertexcosnos);
- MEM_freeN(indexar);
-
- /* frees prev buffer */
- copy_vpaint_prev(&Gvp, NULL, 0);
-
- BIF_undo_push("Vertex Paint");
-
- allqueue(REDRAWVIEW3D, 0);
-}
-
-void set_wpaint(void) /* toggle */
-{
- Object *ob;
- Mesh *me;
-
- scrarea_queue_headredraw(curarea);
- ob= OBACT;
- if(!ob || ob->id.lib) return;
- me= get_mesh(ob);
-
- if(me && me->totface>=MAXINDEX) {
- error("Maximum number of faces: %d", MAXINDEX-1);
- G.f &= ~G_WEIGHTPAINT;
- return;
- }
-
- if(G.f & G_WEIGHTPAINT) G.f &= ~G_WEIGHTPAINT;
- else G.f |= G_WEIGHTPAINT;
-
- allqueue(REDRAWVIEW3D, 1); /* including header */
- allqueue(REDRAWBUTSEDIT, 0);
-
- /* Weightpaint works by overriding colors in mesh,
- * so need to make sure we recalc on enter and
- * exit (exit needs doing regardless because we
- * should redeform).
- */
- if (me) {
- DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
- }
-
- if(G.f & G_WEIGHTPAINT) {
- Object *par;
-
- setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT);
-
- mesh_octree_table(ob, NULL, 's');
-
- /* verify if active weight group is also active bone */
- par= modifiers_isDeformedByArmature(ob);
- if(par && (par->flag & OB_POSEMODE)) {
- bPoseChannel *pchan;
- for(pchan= par->pose->chanbase.first; pchan; pchan= pchan->next)
- if(pchan->bone->flag & BONE_ACTIVE)
- break;
- if(pchan)
- vertexgroup_select_by_name(ob, pchan->name);
- }
- }
- else {
- if(!(G.f & G_FACESELECT))
- setcursor_space(SPACE_VIEW3D, CURSOR_STD);
-
- mesh_octree_table(ob, NULL, 'e');
- }
-}
-
-
-void set_vpaint(void) /* toggle */
-{
- Object *ob;
- Mesh *me;
-
- scrarea_queue_headredraw(curarea);
- ob= OBACT;
- if(!ob || object_data_is_libdata(ob)) {
- G.f &= ~G_VERTEXPAINT;
- return;
- }
-
- me= get_mesh(ob);
-
- if(me && me->totface>=MAXINDEX) {
- error("Maximum number of faces: %d", MAXINDEX-1);
- G.f &= ~G_VERTEXPAINT;
- return;
- }
-
- if(me && me->mcol==NULL) make_vertexcol(0);
-
- if(G.f & G_VERTEXPAINT){
- G.f &= ~G_VERTEXPAINT;
- }
- else {
- G.f |= G_VERTEXPAINT;
- /* Turn off weight painting */
- if (G.f & G_WEIGHTPAINT)
- set_wpaint();
- }
-
- allqueue(REDRAWVIEW3D, 1); /* including header */
- allqueue(REDRAWBUTSEDIT, 0);
-
- if (me)
- /* update modifier stack for mapping requirements */
- DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
-
- if(G.f & G_VERTEXPAINT) {
- setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT);
- }
- else {
- if((G.f & G_FACESELECT)==0) setcursor_space(SPACE_VIEW3D, CURSOR_STD);
- }
-}
-
diff --git a/source/blender/src/winlay.h b/source/blender/src/winlay.h
deleted file mode 100644
index 53a8c28317e..00000000000
--- a/source/blender/src/winlay.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* Abstract window operations */
-
-struct BCursor;
-
-typedef struct _Window Window;
-typedef void (*WindowHandlerFP) (Window *win, void *user_data, short evt, short val, char ascii);
-
-Window* window_open (char *title, int x, int y, int width, int height, int start_maximized);
-void window_set_handler (Window *win, WindowHandlerFP handler, void *user_data);
-void window_destroy (Window *win);
-
-void window_set_timer (Window *win, int delay_ms, int event);
-
-void window_make_active (Window *win);
-void window_swap_buffers (Window *win);
-
-#if 0
-//#ifdef _WIN32 // FULLSCREEN
-void window_toggle_fullscreen(Window *win, int fullscreen);
-#endif
-
-void window_raise (Window *win);
-void window_lower (Window *win);
-
-short window_get_qual (Window *win);
-short window_get_mbut (Window *win);
-void window_get_mouse (Window *win, short *mval);
-void window_get_ndof (Window* win, float* sbval);
-
-float window_get_pressure(Window *win);
-void window_get_tilt(Window *win, float *xtilt, float *ytilt);
-short window_get_activedevice(Window *win);
-
-void window_get_position (Window *win, int *posx_r, int *poxy_r);
-
-void window_get_size (Window *win, int *width_r, int *height_r);
-void window_set_size (Window *win, int width, int height);
-
-char* window_get_title (Window *win);
-void window_set_title (Window *win, char *title);
-
-void window_set_cursor (Window *win, int cursor);
-void window_set_custom_cursor (Window *win, unsigned char mask[16][2],
- unsigned char bitmap[16][2], int hotx, int hoty );
-void window_set_custom_cursor_ex (Window *win, struct BCursor *cursor, int useBig);
-
-void window_warp_pointer (Window *win, int x, int y);
-
-void window_queue_redraw (Window *win);
-
-void window_open_ndof(Window* win);
-
- /* Global windowing operations */
-
-Window* winlay_get_active_window(void);
-
-void winlay_process_events (int wait_for_event);
-
-void winlay_get_screensize (int *width_r, int *height_r);
-
- /* Copy and paste functions in ghostwinlay.c */
-
-char *getClipboard(int flag);
-
-void putClipboard(char *buffer, int flag);
diff --git a/source/blender/src/writeavicodec.c b/source/blender/src/writeavicodec.c
deleted file mode 100644
index bb58699169a..00000000000
--- a/source/blender/src/writeavicodec.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/**
- * Functions for writing windows avi-format files.
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#if defined(_WIN32) && !defined(FREE_WINDOWS)
-
-#define INC_OLE2
-#include <windows.h>
-#undef rad1
-#undef rad2
-
-#include <windowsx.h>
-#include <memory.h>
-#include <mmsystem.h>
-#include <vfw.h>
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-#include "BLI_blenlib.h"
-#include "DNA_userdef_types.h"
-#include "DNA_scene_types.h"
-
-#include "BKE_global.h"
-#include "BKE_scene.h"
-#include "BKE_writeavi.h"
-
-#include "BIF_toolbox.h"
-
-// this defines the compression type for
-// the output video stream
-
-AVICOMPRESSOPTIONS opts;
-
-static int sframe;
-static PAVIFILE pfile = NULL;
-static int avifileinitdone = 0;
-static PAVISTREAM psUncompressed = NULL, psCompressed = NULL;
-
-// function definitions
-static void init_bmi(BITMAPINFOHEADER *bmi,int rectx, int recty );
-static void opts_to_acd(AviCodecData *acd);
-static void acd_to_opts(AviCodecData *acd);
-static void free_opts_data();
-static int open_avi_codec_file(char * name,RenderData *rd,int rectx, int recty );
-
-///////////////////////////////////////////////////////////////////////////
-//
-// silly default parameters
-//
-///////////////////////////////////////////////////////////////////////////
-
-#define DEFAULT_WIDTH 240
-#define DEFAULT_HEIGHT 120
-#define DEFAULT_LENGTH 100
-#define DEFAULT_SIZE 6
-#define DEFAULT_COLOR RGB(255,0,0)
-#define XSPEED 7
-#define YSPEED 5
-
-///////////////////////////////////////////////////////////////////////////
-//
-// useful macros
-//
-///////////////////////////////////////////////////////////////////////////
-
-#define ALIGNULONG(i) ((i+3)&(~3)) /* ULONG aligned ! */
-#define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */
-#define DIBWIDTHBYTES(bi) (int)WIDTHBYTES((int)(bi).biWidth * (int)(bi).biBitCount)
-#define DIBPTR(lpbi) ((LPBYTE)(lpbi) + \
- (int)(lpbi)->biSize + \
- (int)(lpbi)->biClrUsed * sizeof(RGBQUAD) )
-
-///////////////////////////////////////////////////////////////////////////
-//
-// custom video stream instance structure
-//
-///////////////////////////////////////////////////////////////////////////
-
-typedef struct {
-
- //
- // The Vtbl must come first
- //
- IAVIStreamVtbl * lpvtbl;
-
- //
- // private ball instance data
- //
- ULONG ulRefCount;
-
- DWORD fccType; // is this audio/video
-
- int width; // size in pixels of each frame
- int height;
- int length; // length in frames of the pretend AVI movie
- int size;
- COLORREF color; // ball color
-
-} AVIBALL, * PAVIBALL;
-
-///////////////////////////////////////////////////////////////////////////
-//
-// custom stream methods
-//
-///////////////////////////////////////////////////////////////////////////
-
-HRESULT STDMETHODCALLTYPE AVIBallQueryInterface(PAVISTREAM ps, REFIID riid, LPVOID * ppvObj);
-HRESULT STDMETHODCALLTYPE AVIBallCreate (PAVISTREAM ps, LONG lParam1, LONG lParam2);
-ULONG STDMETHODCALLTYPE AVIBallAddRef (PAVISTREAM ps);
-ULONG STDMETHODCALLTYPE AVIBallRelease (PAVISTREAM ps);
-HRESULT STDMETHODCALLTYPE AVIBallInfo (PAVISTREAM ps, AVISTREAMINFOW * psi, LONG lSize);
-LONG STDMETHODCALLTYPE AVIBallFindSample (PAVISTREAM ps, LONG lPos, LONG lFlags);
-HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG *lpcbFormat);
-HRESULT STDMETHODCALLTYPE AVIBallSetFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG cbFormat);
-HRESULT STDMETHODCALLTYPE AVIBallRead (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, LONG * plBytes,LONG * plSamples);
-HRESULT STDMETHODCALLTYPE AVIBallWrite (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten);
-HRESULT STDMETHODCALLTYPE AVIBallDelete (PAVISTREAM ps, LONG lStart, LONG lSamples);
-HRESULT STDMETHODCALLTYPE AVIBallReadData (PAVISTREAM ps, DWORD fcc, LPVOID lp,LONG *lpcb);
-HRESULT STDMETHODCALLTYPE AVIBallWriteData (PAVISTREAM ps, DWORD fcc, LPVOID lp,LONG cb);
-
-IAVIStreamVtbl AVIBallHandler = {
- AVIBallQueryInterface,
- AVIBallAddRef,
- AVIBallRelease,
- AVIBallCreate,
- AVIBallInfo,
- AVIBallFindSample,
- AVIBallReadFormat,
- AVIBallSetFormat,
- AVIBallRead,
- AVIBallWrite,
- AVIBallDelete,
- AVIBallReadData,
- AVIBallWriteData
-};
-
-
-//
-// This is the function an application would call to create a PAVISTREAM to
-// reference the ball. Then the standard AVIStream function calls can be
-// used to work with this stream.
-//
-PAVISTREAM WINAPI NewBall(void)
-{
- static AVIBALL ball;
- PAVIBALL pball = &ball;
-
- //
- // Fill the function table
- //
- pball->lpvtbl = &AVIBallHandler;
-
- //
- // Call our own create code to create a new instance (calls AVIBallCreate)
- // For now, don't use any lParams.
- //
- pball->lpvtbl->Create((PAVISTREAM) pball, 0, 0);
-
- return (PAVISTREAM) pball;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// This function is called to initialize an instance of the bouncing ball.
-//
-// When called, we look at the information possibly passed in <lParam1>,
-// if any, and use it to determine the length of movie they want. (Not
-// supported by NewBall right now, but it could be).
-//
-///////////////////////////////////////////////////////////////////////////
-HRESULT STDMETHODCALLTYPE AVIBallCreate(PAVISTREAM ps, LONG lParam1, LONG lParam2)
-{
- PAVIBALL pball = (PAVIBALL) ps;
-
- //
- // what type of data are we? (audio/video/other stream)
- //
- pball->fccType = streamtypeVIDEO;
-
- //
- // We define lParam1 as being the length of movie they want us to pretend
- // to be.
- //
- if (lParam1)
- pball->length = (int) lParam1;
- else
- pball->length = DEFAULT_LENGTH;
-
- switch (pball->fccType) {
-
- case streamtypeVIDEO:
- pball->color = DEFAULT_COLOR;
- pball->width = DEFAULT_WIDTH;
- pball->height = DEFAULT_HEIGHT;
- pball->size = DEFAULT_SIZE;
- pball->ulRefCount = 1; // note that we are opened once
- return AVIERR_OK; // success
-
- case streamtypeAUDIO:
- return ResultFromScode(AVIERR_UNSUPPORTED); // we don't do audio
-
- default:
- return ResultFromScode(AVIERR_UNSUPPORTED); // or anything else
- }
-}
-
-
-//
-// Increment our reference count
-//
-ULONG STDMETHODCALLTYPE AVIBallAddRef(PAVISTREAM ps)
-{
- PAVIBALL pball = (PAVIBALL) ps;
- return (++pball->ulRefCount);
-}
-
-
-//
-// Decrement our reference count
-//
-ULONG STDMETHODCALLTYPE AVIBallRelease(PAVISTREAM ps)
-{
- PAVIBALL pball = (PAVIBALL) ps;
- if (--pball->ulRefCount)
- return pball->ulRefCount;
-
- // Free any data we're keeping around - like our private structure
- GlobalFreePtr(pball);
-
- return 0;
-}
-
-
-//
-// Fills an AVISTREAMINFO structure
-//
-HRESULT STDMETHODCALLTYPE AVIBallInfo(PAVISTREAM ps, AVISTREAMINFOW * psi, LONG lSize)
-{
- PAVIBALL pball = (PAVIBALL) ps;
-
- if (lSize < sizeof(AVISTREAMINFO))
- return ResultFromScode(AVIERR_BUFFERTOOSMALL);
-
- _fmemset(psi, 0, (int)lSize);
-
- // Fill out a stream header with information about us.
- psi->fccType = pball->fccType;
- psi->fccHandler = mmioFOURCC('B','a','l','l');
- psi->dwScale = 1;
- psi->dwRate = 15;
- psi->dwLength = pball->length;
- psi->dwSuggestedBufferSize = pball->height * ALIGNULONG(pball->width);
- psi->rcFrame.right = pball->width;
- psi->rcFrame.bottom = pball->height;
- CopyMemory((PVOID)psi->szName,
- (PVOID)L"Bouncing ball video",
- sizeof(L"Bouncing ball video"));
-
- return AVIERR_OK;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// AVIBallReadFormat: needs to return the format of our data.
-//
-///////////////////////////////////////////////////////////////////////////
-HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos,LPVOID lpFormat,LONG *lpcbFormat)
-{
- PAVIBALL pball = (PAVIBALL) ps;
- LPBITMAPINFO lpbi = (LPBITMAPINFO) lpFormat;
-
- if (lpFormat == NULL || *lpcbFormat == 0) {
- *lpcbFormat = sizeof(BITMAPINFOHEADER);
- return AVIERR_OK;
- }
-
- if (*lpcbFormat < sizeof(BITMAPINFOHEADER))
- return ResultFromScode(AVIERR_BUFFERTOOSMALL);
-
- // This is a relatively silly example: we build up our
- // format from scratch every time.
-
- /*
- lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- lpbi->bmiHeader.biCompression = BI_RGB;
- lpbi->bmiHeader.biWidth = pball->width;
- lpbi->bmiHeader.biHeight = pball->height;
- lpbi->bmiHeader.biBitCount = 8;
- lpbi->bmiHeader.biPlanes = 1;
- lpbi->bmiHeader.biClrUsed = 2;
- lpbi->bmiHeader.biSizeImage = pball->height * DIBWIDTHBYTES(lpbi->bmiHeader);
- */
-
- //init_bmi(&lpbi->bmiHeader);
-
- memset(&lpbi->bmiHeader, 0, sizeof(BITMAPINFOHEADER));
- lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- lpbi->bmiHeader.biWidth = pball->width;
- lpbi->bmiHeader.biHeight = pball->height;
- lpbi->bmiHeader.biPlanes = 1;
- lpbi->bmiHeader.biBitCount = 24;
- lpbi->bmiHeader.biSizeImage = pball->width * pball->height * sizeof(RGBTRIPLE);
-
- /*
- lpbi->bmiColors[0].rgbRed = 0;
- lpbi->bmiColors[0].rgbGreen = 0;
- lpbi->bmiColors[0].rgbBlue = 0;
- lpbi->bmiColors[1].rgbRed = GetRValue(pball->color);
- lpbi->bmiColors[1].rgbGreen = GetGValue(pball->color);
- lpbi->bmiColors[1].rgbBlue = GetBValue(pball->color);
- */
-
- *lpcbFormat = sizeof(BITMAPINFOHEADER);
-
- return AVIERR_OK;
-}
-
-///////////////////////////////////////////////////////////////////////////
-//
-// AVIBallRead: needs to return the data for a particular frame.
-//
-///////////////////////////////////////////////////////////////////////////
-HRESULT STDMETHODCALLTYPE AVIBallRead (PAVISTREAM ps, LONG lStart,LONG lSamples,LPVOID lpBuffer,LONG cbBuffer,LONG * plBytes,LONG * plSamples)
-{
- PAVIBALL pball = (PAVIBALL) ps;
- LONG lSize = pball->height * ALIGNULONG(pball->width); // size of frame
- // in bytes
- int x, y;
- HPSTR hp = lpBuffer;
- int xPos, yPos;
-
- // Reject out of range values
- if (lStart < 0 || lStart >= pball->length)
- return ResultFromScode(AVIERR_BADPARAM);
-
- // Did they just want to know the size of our data?
- if (lpBuffer == NULL || cbBuffer == 0)
- goto exit;
-
- // Will our frame fit in the buffer passed?
- if (lSize > cbBuffer)
- return ResultFromScode(AVIERR_BUFFERTOOSMALL);
-
- // Figure out the position of the ball.
- // It just bounces back and forth.
-
- xPos = 5 + XSPEED * (int) lStart; // x = x0 + vt
- xPos = xPos % ((pball->width - pball->size) * 2); // limit to 2xwidth
- if (xPos > (pball->width - pball->size)) // reflect if
- xPos = 2 * (pball->width - pball->size) - xPos; // needed
-
- yPos = 5 + YSPEED * (int) lStart;
- yPos = yPos % ((pball->height - pball->size) * 2);
- if (yPos > (pball->height - pball->size))
- yPos = 2 * (pball->height - pball->size) - yPos;
-
- //
- // Build a DIB from scratch by writing in 1's where the ball is, 0's
- // where it isn't.
- //
- // Notice that we just build it in the buffer we've been passed.
- //
- // This is pretty ugly, I have to admit.
- //
- for (y = 0; y < pball->height; y++)
- {
- if (y >= yPos && y < yPos + pball->size)
- {
- for (x = 0; x < pball->width; x++)
- {
- *hp++ = (BYTE) ((x >= xPos && x < xPos + pball->size) ? 1 : 0);
- }
- }
- else
- {
- for (x = 0; x < pball->width; x++)
- {
- *hp++ = 0;
- }
- }
-
- hp += pball->width - ALIGNULONG(pball->width);
- }
-
-exit:
- // We always return exactly one frame
- if (plSamples)
- *plSamples = 1;
-
- // Return the size of our frame
- if (plBytes)
- *plBytes = lSize;
-
- return AVIERR_OK;
-}
-
-
-HRESULT STDMETHODCALLTYPE AVIBallQueryInterface(PAVISTREAM ps, REFIID riid, LPVOID * ppvObj)
-{
- PAVIBALL pball = (PAVIBALL) ps;
-
- // We support the Unknown interface (everybody does) and our Stream
- // interface.
-
- if (_fmemcmp(riid, &IID_IUnknown, sizeof(GUID)) == 0)
- *ppvObj = (LPVOID)pball;
-
- else if (_fmemcmp(riid, &IID_IAVIStream, sizeof(GUID)) == 0)
- *ppvObj = (LPVOID)pball;
-
- else {
- *ppvObj = NULL;
- return ResultFromScode(E_NOINTERFACE);
- }
-
- AVIBallAddRef(ps);
-
- return AVIERR_OK;
-}
-
-LONG STDMETHODCALLTYPE AVIBallFindSample (PAVISTREAM ps, LONG lPos, LONG lFlags)
-{
- // The only format change is frame 0
- if ((lFlags & FIND_TYPE) == FIND_FORMAT) {
- if ((lFlags & FIND_DIR) == FIND_NEXT && lPos > 0)
- return -1; // no more format changes
- else
- return 0;
-
- // FIND_KEY and FIND_ANY always return the same position because
- // every frame is non-empty and a key frame
- } else
- return lPos;
-}
-
-HRESULT STDMETHODCALLTYPE AVIBallReadData (PAVISTREAM ps, DWORD fcc, LPVOID lp, LONG *lpcb)
-{
- return ResultFromScode(AVIERR_UNSUPPORTED);
-}
-
-HRESULT STDMETHODCALLTYPE AVIBallSetFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG cbFormat)
-{
- return ResultFromScode(AVIERR_UNSUPPORTED);
-}
-
-HRESULT STDMETHODCALLTYPE AVIBallWriteData (PAVISTREAM ps, DWORD fcc, LPVOID lp, LONG cb)
-{
- return ResultFromScode(AVIERR_UNSUPPORTED);
-}
-
-HRESULT STDMETHODCALLTYPE AVIBallWrite (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten)
-{
- return ResultFromScode(AVIERR_UNSUPPORTED);
-}
-
-HRESULT STDMETHODCALLTYPE AVIBallDelete (PAVISTREAM ps, LONG lStart, LONG lSamples)
-{
- return ResultFromScode(AVIERR_UNSUPPORTED);
-}
-
-
-//////////////////////////////////////
-static void init_bmi(BITMAPINFOHEADER *bmi,int rectx, int recty )
-{
- memset(bmi, 0, sizeof(BITMAPINFOHEADER));
- bmi->biSize = sizeof(BITMAPINFOHEADER);
- bmi->biWidth = rectx;
- bmi->biHeight = recty;
- bmi->biPlanes = 1;
- bmi->biBitCount = 24;
- bmi->biSizeImage = bmi->biWidth * bmi->biHeight * sizeof(RGBTRIPLE);
-}
-
-
-static void opts_to_acd(AviCodecData *acd)
-{
- HIC hic;
- ICINFO icinfo;
-
- acd->fccType = opts.fccType;
- acd->fccHandler = opts.fccHandler;
- acd->dwKeyFrameEvery = opts.dwKeyFrameEvery;
- acd->dwQuality = opts.dwQuality;
- acd->dwBytesPerSecond = opts.dwBytesPerSecond;
- acd->dwFlags = opts.dwFlags;
- acd->dwInterleaveEvery = opts.dwInterleaveEvery;
- acd->cbFormat = opts.cbFormat;
- acd->cbParms = opts.cbParms;
-
- if (opts.lpFormat && opts.cbFormat) {
- acd->lpFormat = MEM_mallocN(opts.cbFormat, "avi.lpFormat");
- memcpy(acd->lpFormat, opts.lpFormat, opts.cbFormat);
- }
-
- if (opts.lpParms && opts.cbParms) {
- acd->lpParms = MEM_mallocN(opts.cbParms, "avi.lpParms");
- memcpy(acd->lpParms, opts.lpParms, opts.cbParms);
- }
-
- if ((hic=ICOpen(ICTYPE_VIDEO,acd->fccHandler,ICMODE_QUERY))!=NULL) {
- icinfo.dwSize=sizeof(ICINFO);
- if (ICGetInfo(hic,&icinfo,sizeof(ICINFO))) {
- WideCharToMultiByte(CP_ACP,0,icinfo.szDescription,-1,acd->avicodecname,128,NULL,NULL);
- } else
- sprintf(acd->avicodecname, "undefined");
- if (ICClose(hic)!=ICERR_OK)
-;// return 0;
- } else {
- sprintf(acd->avicodecname, "Full Frames (Uncompressed)"); //heh, nasty
- }
-}
-
-
-static void acd_to_opts(AviCodecData *acd)
-{
- memset(&opts, 0, sizeof(opts));
- if (acd) {
- opts.fccType = acd->fccType;
- opts.fccHandler = acd->fccHandler;
- opts.dwKeyFrameEvery = acd->dwKeyFrameEvery;
- opts.dwQuality = acd->dwQuality;
- opts.dwBytesPerSecond = acd->dwBytesPerSecond;
- opts.dwFlags = acd->dwFlags;
- opts.dwInterleaveEvery = acd->dwInterleaveEvery;
- opts.cbFormat = acd->cbFormat;
- opts.cbParms = acd->cbParms;
-
- if (acd->lpFormat && acd->cbFormat) {
- opts.lpFormat = MEM_mallocN(opts.cbFormat, "opts lpFormat");
- memcpy(opts.lpFormat, acd->lpFormat, opts.cbFormat);
- }
-
- if (acd->lpParms && acd->cbParms) {
- opts.lpParms = MEM_mallocN(opts.cbParms, "opts.cbParms");
- memcpy(opts.lpParms, acd->lpParms, opts.cbParms);
- }
- }
-}
-
-static void free_opts_data()
-{
- if (opts.lpFormat) {
- MEM_freeN(opts.lpFormat);
- opts.lpFormat = NULL;
- }
- if (opts.lpParms) {
- MEM_freeN(opts.lpParms);
- opts.lpParms = NULL;
- }
-}
-
-static int open_avi_codec_file(char * name,RenderData *rd,int rectx, int recty )
-{
- HRESULT hr;
- WORD wVer;
- BITMAPINFOHEADER bmi;
- AVISTREAMINFO strhdr;
- int ret_val = 0;
-
- wVer = HIWORD(VideoForWindowsVersion());
- if (wVer < 0x010a){
- // this is probably an obsolete check...
- ret_val = 1;
- } else {
- AVIFileInit();
- avifileinitdone++;
-
- hr = AVIFileOpen(&pfile, // returned file pointer
- name, // file name
- OF_WRITE | OF_CREATE, // mode to open file with
- NULL); // use handler determined
-
- if (hr != AVIERR_OK) {
- ret_val = 1;
- } else {
- // initialize the BITMAPINFOHEADER
- init_bmi(&bmi,rectx,recty);
- // and associate a stream with the input images
- memset(&strhdr, 0, sizeof(strhdr));
- strhdr.fccType = streamtypeVIDEO; // stream type
- if (G.scene->r.avicodecdata) {
- strhdr.fccHandler = G.scene->r.avicodecdata->fccHandler;
- }
- strhdr.dwScale = 1;
- strhdr.dwRate = rd->frs_sec;
- strhdr.dwSuggestedBufferSize = bmi.biSizeImage;
- SetRect(&strhdr.rcFrame, 0, 0, // rectangle for stream
- (int) bmi.biWidth,
- (int) bmi.biHeight);
-
- // And create the stream
- hr = AVIFileCreateStream(
- pfile, // file pointer
- &psUncompressed,// returned stream pointer
- &strhdr); // stream header
-
- if (hr != AVIERR_OK) {
- ret_val = 1;
- } else {
- acd_to_opts(G.scene->r.avicodecdata);
- }
- }
- }
-
- return(ret_val);
-}
-
-
-void end_avi_codec(void)
-{
- free_opts_data();
-
- if (psUncompressed) {
- AVIStreamClose(psUncompressed);
- psUncompressed = NULL;
- }
-
- if (psCompressed) {
- AVIStreamClose(psCompressed);
- psCompressed = NULL;
- }
-
- if (pfile) {
- AVIFileClose(pfile);
- pfile = NULL;
- }
-
- if (avifileinitdone > 0) {
- AVIFileExit();
- avifileinitdone--;
- }
-}
-
-
-void start_avi_codec(RenderData *rd,int rectx, int recty )
-{
- HRESULT hr;
- BITMAPINFOHEADER bmi;
- char name[2048];
- char bakname[2048];
-
- makeavistring(rd,name);
- sframe = (G.scene->r.sfra);
-
- strcpy(bakname, name);
- strcat(bakname, ".bak");
-
- if (BLI_exists(name)) {
- BLI_move(name, bakname);
- }
-
- // initialize the BITMAPINFOHEADER
- init_bmi(&bmi,rectx,recty);
-
- if (open_avi_codec_file(name,rd,rectx,recty)) {
- error("Can not open file %s", name);
- G.afbreek = 1;
- } else {
- // now create a compressed stream from the uncompressed
- // stream and the compression options
- hr = AVIMakeCompressedStream(
- &psCompressed, // returned stream pointer
- psUncompressed, // uncompressed stream
- &opts, // compression options
- NULL); // Unknown...
- if (hr != AVIERR_OK) {
- error("Codec is locked or not supported.");
- G.afbreek = 1;
- } else {
- hr = AVIStreamSetFormat(psCompressed, 0,
- &bmi, // stream format
- bmi.biSize + // format size
- bmi.biClrUsed * sizeof(RGBQUAD)); // plus size of colormap
- if (hr != AVIERR_OK) {
- printf("AVIStreamSetFormat() failed .. may be bad image dimensions? \n");
- error("Codec refuses format.");
- G.afbreek = 1;
- }
- }
- }
-
- if (G.afbreek != 1) {
- printf("Created win avi: %s\n", name);
- if (BLI_exists(bakname)) {
- BLI_delete(bakname, 0, 0);
- }
- } else {
- // close the darn thing and remove it.
- end_avi_codec();
- if (BLI_exists(name)) {
- BLI_delete(name, 0, 0);
- }
- if (BLI_exists(bakname)) {
- BLI_move(bakname, name);
- }
- }
-}
-
-
-void append_avi_codec(int frame,int *pixels,int rectx, int recty)
-{
- HRESULT hr;
- BITMAPINFOHEADER bmi;
- RGBTRIPLE *buffer, *to;
- int x, y ,pad, align =2;
- unsigned char *from;
-
- if (psCompressed) {
- // initialize the BITMAPINFOHEADER
- init_bmi(&bmi, rectx, recty);
-
- //windows wants bitmap rows aligned
- pad = (rectx*3) - align*((rectx*3)/align);
- if (pad) {
- pad = align - pad;
- }
-
- // copy pixels
- buffer = MEM_mallocN(bmi.biSizeImage + pad * recty, "append_win_avi");
- to = buffer;
- from = (unsigned char *) pixels;
- for (y = recty; y > 0 ; y--) {
- for (x = rectx; x > 0 ; x--) {
- to->rgbtRed = from[0];
- to->rgbtGreen = from[1];
- to->rgbtBlue = from[2];
- to++; from += 4;
- }
- (unsigned char *)to += pad;
- }
-
- hr = AVIStreamWrite(
- psCompressed, // stream pointer
- frame - sframe, // frame number
- 1, // number to write
- (LPBYTE) buffer,// pointer to data
- bmi.biSizeImage + pad * recty, // size of this frame
- AVIIF_KEYFRAME, // flags....
- NULL,
- NULL);
-
- MEM_freeN(buffer);
-
- if (hr != AVIERR_OK) {
- G.afbreek = 1;
- } else {
- printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe);
- }
- }
-}
-
-
-int get_avicodec_settings(void)
-{
- int ret_val = 0;
- AVICOMPRESSOPTIONS *aopts[1] = {&opts};
- AviCodecData *acd = G.scene->r.avicodecdata;
- static PAVISTREAM psdummy;
- UINT uiFlags;
-
- acd_to_opts(G.scene->r.avicodecdata);
-
- psdummy = NewBall();
-
- if(U.uiflag & USER_ALLWINCODECS)
- uiFlags = ICMF_CHOOSE_ALLCOMPRESSORS;
- else
- uiFlags = ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE;
-
- if (psdummy == NULL) {
- ret_val = 1;
- } else {
- if (!AVISaveOptions(NULL,
- uiFlags,
-// ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE,
-// ICMF_CHOOSE_ALLCOMPRESSORS,
- 1,
- &psdummy,
- (LPAVICOMPRESSOPTIONS *) &aopts))
- {
- ret_val = 1;
- } else {
- if (acd) {
- free_avicodecdata(acd);
- } else {
- acd = G.scene->r.avicodecdata = MEM_callocN(sizeof(AviCodecData), "AviCodecData");
- }
-
- opts_to_acd(acd);
-
- AVISaveOptionsFree(1, aopts);
- memset(&opts, 0, sizeof(opts));
- }
- }
-
- return(ret_val);
-}
-
-#endif // _WIN32
diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c
deleted file mode 100644
index b21c14bed35..00000000000
--- a/source/blender/src/writeimage.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "IMB_imbuf.h"
-#include "IMB_imbuf_types.h" // ImBuf{}
-
-#include "BLI_blenlib.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_texture_types.h" // EnvMap{}
-#include "DNA_image_types.h" // Image{}
-
-#include "BKE_global.h" // struct G
-#include "BKE_image.h"
-#include "BKE_utildefines.h" // ELEM
-
-#include "BIF_screen.h" // waitcursor
-#include "BIF_toolbox.h"
-#include "BIF_writeimage.h"
-
-#include "BSE_filesel.h"
-
-#include "RE_pipeline.h"
-
-/* ------------------------------------------------------------------------- */
-
-
-void BIF_save_envmap(EnvMap *env, char *str)
-{
- ImBuf *ibuf;
-/* extern rectcpy(); */
- int dx;
-
- /* all interactive stuff is handled in buttons.c */
- if(env->cube[0]==NULL) return;
-
- dx= env->cube[0]->x;
- ibuf= IMB_allocImBuf(3*dx, 2*dx, 24, IB_rect, 0);
-
- IMB_rectcpy(ibuf, env->cube[0], 0, 0, 0, 0, dx, dx);
- IMB_rectcpy(ibuf, env->cube[1], dx, 0, 0, 0, dx, dx);
- IMB_rectcpy(ibuf, env->cube[2], 2*dx, 0, 0, 0, dx, dx);
- IMB_rectcpy(ibuf, env->cube[3], 0, dx, 0, 0, dx, dx);
- IMB_rectcpy(ibuf, env->cube[4], dx, dx, 0, 0, dx, dx);
- IMB_rectcpy(ibuf, env->cube[5], 2*dx, dx, 0, 0, dx, dx);
-
- BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality);
- IMB_freeImBuf(ibuf);
-}
-
-
-
-/* callback for fileselect to save rendered image, renderresult was checked to exist */
-static void save_rendered_image_cb_real(char *name, int confirm)
-{
- char str[FILE_MAXDIR+FILE_MAXFILE];
- int overwrite;
-
- if(BLI_testextensie(name,".blend")) {
- error("Wrong filename");
- return;
- }
-
- /* BKE_add_image_extension() checks for if extension was already set */
- if(G.scene->r.scemode & R_EXTENSION)
- if(strlen(name)<FILE_MAXDIR+FILE_MAXFILE-5)
- BKE_add_image_extension(name, G.scene->r.imtype);
-
- strcpy(str, name);
- BLI_convertstringcode(str, G.sce);
- BLI_convertstringframe(str, G.scene->r.cfra); /* TODO - is this even used? */
-
- if (confirm)
- overwrite = saveover(str);
- else
- overwrite = 1;
-
- if(overwrite) {
- if(G.scene->r.imtype==R_MULTILAYER) {
- RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name));
- if(rr)
- RE_WriteRenderResult(rr, str, G.scene->r.quality);
- }
- else {
- RenderResult rres;
- ImBuf *ibuf;
-
- RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres);
-
- waitcursor(1); /* from screen.c */
-
- ibuf= IMB_allocImBuf(rres.rectx, rres.recty, G.scene->r.planes, 0, 0);
- ibuf->rect= (unsigned int *)rres.rect32;
- ibuf->rect_float= rres.rectf;
- ibuf->zbuf_float= rres.rectz;
-
- /* float factor for random dither, imbuf takes care of it */
- ibuf->dither= G.scene->r.dither_intensity;
-
- BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality);
- IMB_freeImBuf(ibuf); /* imbuf knows rects are not part of ibuf */
- }
-
- strcpy(G.ima, name);
-
- waitcursor(0);
- }
-}
-
-
-void save_image_filesel_str(char *str)
-{
- switch(G.scene->r.imtype) {
- case R_RADHDR:
- strcpy(str, "Save Radiance HDR");
- break;
- case R_FFMPEG:
- case R_PNG:
- strcpy(str, "Save PNG");
- break;
-#ifdef WITH_DDS
- case R_DDS:
- strcpy(str, "Save DDS");
- break;
-#endif
- case R_BMP:
- strcpy(str, "Save BMP");
- break;
- case R_TIFF:
- if (G.have_libtiff)
- strcpy(str, "Save TIFF");
- break;
-#ifdef WITH_OPENEXR
- case R_OPENEXR:
- strcpy(str, "Save OpenEXR");
- break;
-#endif
- case R_CINEON:
- strcpy(str, "Save Cineon");
- break;
- case R_DPX:
- strcpy(str, "Save DPX");
- break;
- case R_RAWTGA:
- strcpy(str, "Save Raw Targa");
- break;
- case R_IRIS:
- strcpy(str, "Save IRIS");
- break;
- case R_IRIZ:
- strcpy(str, "Save IRIS");
- break;
- case R_HAMX:
- strcpy(str, "Save HAMX");
- break;
- case R_TARGA:
- strcpy(str, "Save Targa");
- break;
- case R_MULTILAYER:
- strcpy(str, "Save Multi Layer EXR");
- break;
- /* default we save jpeg, also for all movie formats */
- case R_JPEG90:
- case R_MOVIE:
- case R_AVICODEC:
- case R_AVIRAW:
- case R_AVIJPEG:
- default:
- strcpy(str, "Save JPEG");
- break;
- }
-}
-
-static void save_rendered_image_cb(char *name)
-{
- save_rendered_image_cb_real(name, 1);
-}
-
-/* no fileselect, no confirm */
-void BIF_save_rendered_image(char *name)
-{
- save_rendered_image_cb_real(name, 0);
-}
-
-/* calls fileselect */
-void BIF_save_rendered_image_fs(void)
-{
- RenderResult rres;
-
- RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres);
-
- if(!rres.rectf && !rres.rect32) {
- error("No image rendered");
- }
- else {
- char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2];
-
- if(G.ima[0]==0) {
- strcpy(dir, G.sce);
- BLI_splitdirstring(dir, str);
- strcpy(G.ima, dir);
- }
-
- save_image_filesel_str(str);
- activate_fileselect(FILE_SPECIAL, str, G.ima, save_rendered_image_cb);
- }
-}
-
-
diff --git a/source/blender/src/writemovie.c b/source/blender/src/writemovie.c
deleted file mode 100644
index dea7fbd9ddb..00000000000
--- a/source/blender/src/writemovie.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-//#ifdef __sgi
-#if 0
-
-#include <unistd.h>
-#include <movie.h>
-#include <cdaudio.h>
-#include <dmedia/cl.h>
-#include <dmedia/cl_cosmo.h>
-#include <sys/file.h> /* flock */
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-#include "BIF_gl.h"
-#include "BIF_writemovie.h"
-#include "BIF_toolbox.h"
-
-#include "render.h"
-
-#define error(str) {perror(str) ; error("%s", str); G.afbreek= 1;}
-#define QUIT(str) {error(str); return;}
-
-#define DIR_UP 1
-#define DIR_DOWN 2
-#define DIR_BOTH (DIR_UP | DIR_DOWN)
-
-#define MAXQUAL R.r.quality
-#define MINQUAL 30
-
-
-/* globals */
-
-static CL_Handle compr, soft_compr;
-static MVid movie, image;
-static DMparams *movie_params, *image_params;
-static int compr_params[64];
-static int myindex, qualindex, qualnow, mv_outx, mv_outy, numfields= 2;
-static char *comp_buf;
-static int sfra, efra, first = TRUE, maxbufsize;
-static int ntsc = FALSE;
-
-#define FIRST_IMAGE "FIRST_IMAGE"
-#define BLENDER_FIRST_IMAGE "BLENDER_1ST_IMG"
-
-
-static void report_flock(void)
-{
- static int flock_reported = FALSE;
-
- if (flock_reported) return;
- flock_reported = TRUE;
-
- error("WriteMovie: couldn't flock() moviefile. Ignoring.");
-}
-
-
-static void make_movie_name(char *string)
-{
- int len;
- char txt[64];
-
- if (string==0) return;
-
- strcpy(string, G.scene->r.pic);
- BLI_convertstringcode(string, G.sce);
- len= strlen(string);
-
- BLI_make_existing_file(string);
-
- if (BLI_strcasecmp(string + len - 3, ".mv")) {
- sprintf(txt, "%04d_%04d.mv", sfra, efra);
- strcat(string, txt);
- }
-}
-
-static int my_Compress(uint * rect, int *bufsize)
-{
- int err = 0;
-
- compr_params[qualindex] = qualnow;
- clSetParams(compr, compr_params, myindex);
-
- while (clCompress(compr, numfields, rect, bufsize, comp_buf) != numfields) {
- if (compr == soft_compr) {
- error("clCompress (software)");
- return 1;
- }
-
- /* hardware opnieuw initialiseren */
- clCloseCompressor(compr);
- clOpenCompressor(CL_JPEG_COSMO, &compr);
-
- qualnow--;
- compr_params[qualindex] = qualnow;
- clSetParams(compr, compr_params, myindex);
- printf("retrying at quality %d\n", qualnow);
-
- err= TRUE;
- }
-
- return (err);
-}
-
-static void set_sfra_efra(void)
-{
- sfra = (G.scene->r.sfra);
- efra = (G.scene->r.efra);
-}
-
-static void open_compressor(void)
-{
- int cosmo = FAILURE;
-
- /* initialiseren van de compressor */
-
- if (clOpenCompressor(CL_JPEG_SOFTWARE, &soft_compr) != SUCCESS) QUIT("clOpenCompressor");
-
- if (G.scene->r.mode & R_COSMO) {
- cosmo = clOpenCompressor(CL_JPEG_COSMO, &compr);
- if (cosmo != SUCCESS && first) error("warning: using software compression");
- first = FALSE;
- }
-
- if (cosmo != SUCCESS) compr = soft_compr;
-
- myindex = 0;
-
- compr_params[myindex++]= CL_IMAGE_WIDTH;
- compr_params[myindex++]= mv_outx;
-
- compr_params[myindex++]= CL_IMAGE_HEIGHT;
- compr_params[myindex++]= mv_outy / numfields;
-
- compr_params[myindex++]= CL_JPEG_QUALITY_FACTOR;
- qualindex = myindex;
- compr_params[myindex++]= R.r.quality;
-
- compr_params[myindex++]= CL_ORIGINAL_FORMAT;
- compr_params[myindex++]= CL_RGBX;
-
- compr_params[myindex++]= CL_ORIENTATION;
- compr_params[myindex++]= CL_TOP_DOWN;
-
- compr_params[myindex++]= CL_INTERNAL_FORMAT;
- compr_params[myindex++]= CL_YUV422;
-
- /* this parameter must be set for non-queueing mode */
- compr_params[myindex++]= CL_ENABLE_IMAGEINFO;
- compr_params[myindex++]= 1;
-
- /* enable stream headers */
- compr_params[myindex++]= CL_STREAM_HEADERS;
- compr_params[myindex++]= TRUE;
-
- clSetParams(compr, compr_params, myindex);
- if (compr != soft_compr) clSetParams(soft_compr, compr_params, myindex);
-
- maxbufsize = 2 * clGetParam(compr, CL_COMPRESSED_BUFFER_SIZE);
- comp_buf = MEM_mallocN(maxbufsize, "cosmo_buffer");
-}
-
-static void close_compressor(void)
-{
- MEM_freeN(comp_buf);
- comp_buf = 0;
-
- clCloseCompressor(compr);
- if (soft_compr != compr) clCloseCompressor(soft_compr);
-}
-
-void end_movie(void)
-{
-}
-
-static void new_movie(int fd)
-{
- char string[120];
-
- if (dmParamsCreate(&movie_params) != DM_SUCCESS) QUIT("dmParamsCreate");
- if (dmParamsCreate(&image_params) != DM_SUCCESS) QUIT("dmParamsCreate");
-
- if (mvSetMovieDefaults(movie_params, MV_FORMAT_SGI_3) != DM_SUCCESS) QUIT("mvSetMovieDefaults");
- if (dmSetImageDefaults(image_params, mv_outx, mv_outy, DM_PACKING_RGBX) != DM_SUCCESS) QUIT("dmSetImageDefaults");
-
- mvAddUserParam(BLENDER_FIRST_IMAGE);
- sprintf(string, "%04d", sfra);
- dmParamsSetString(image_params, BLENDER_FIRST_IMAGE, string);
-
- if (ntsc) dmParamsSetFloat(image_params, DM_IMAGE_RATE, 29.97);
- else dmParamsSetFloat(image_params, DM_IMAGE_RATE, 25.0);
-
- if (numfields == 2) {
- if (ntsc) dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_INTERLACED_ODD);
- else dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_INTERLACED_EVEN);
- } else dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_NONINTERLACED);
-
- dmParamsSetEnum(image_params, DM_IMAGE_ORIENTATION, DM_TOP_TO_BOTTOM);
- dmParamsSetString(image_params, DM_IMAGE_COMPRESSION, DM_IMAGE_JPEG);
-
- if (mvCreateFD(fd, movie_params, NULL, &movie) != DM_SUCCESS) QUIT("mvCreateFile");
- if (mvAddTrack(movie, DM_IMAGE, image_params, NULL, &image)) QUIT("mvAddTrack");;
- if (mvSetLoopMode(movie, MV_LOOP_CONTINUOUSLY) != DM_SUCCESS) QUIT("mvSetMovieDefaults");
-
- if (mvWrite(movie) != DM_SUCCESS) QUIT("mvWrite");
- if (mvClose(movie) != DM_SUCCESS) QUIT("mvClose");
-
- dmParamsDestroy(image_params);
- dmParamsDestroy(movie_params);
-}
-
-
-void start_movie(void)
-{
- char name[FILE_MAXDIR+FILE_MAXFILE];
- char bak[sizeof(name) + 4];
- int fd;
-
- first = TRUE;
-
- set_sfra_efra();
-
- /* naam bedenken voor de movie */
- make_movie_name(name);
-
- ntsc = FALSE;
-
- switch (R.recty) {
- case 480: case 360: case 240: case 120:
- ntsc = TRUE;
- }
-
- if (ntsc) {
- switch (R.rectx) {
- case 360: case 320: case 720: case 640:
- mv_outx = R.rectx;
- break;
- default:
- if (R.rectx <= 320) mv_outx = 320;
- else if (R.rectx <= 640) mv_outx = 640;
- else mv_outx = 720;
- }
- } else {
- switch (R.rectx) {
- case 360: case 384: case 720: case 768:
- mv_outx = R.rectx;
- break;
- default:
- if (R.rectx < 384) mv_outx = 384;
- else mv_outx = 768;
- }
- }
-
- if (ntsc) {
- if (R.recty <= 240) {
- mv_outy = 240;
- numfields = 1;
- } else {
- mv_outy = 480;
- numfields = 2;
- }
- } else {
- if (R.recty <= 288) {
- mv_outy = 288;
- numfields = 1;
- } else {
- mv_outy = 576;
- numfields = 2;
- }
- }
-
- qualnow = R.r.quality;
-
- fd = open(name, O_BINARY|O_RDWR);
- if (fd != -1) {
- if (flock(fd, LOCK_EX) == -1) report_flock();
-
- if (mvOpenFD(fd, &movie) == DM_SUCCESS) {
- if (mvFindTrackByMedium(movie, DM_IMAGE, &image) == DM_SUCCESS) {
- if (mvGetImageWidth(image) == mv_outx) {
- if (mvGetImageHeight(image) == mv_outy) {
- mvClose(movie);
- close(fd);
- return;
- }
- }
- }
- strcpy(bak, name);
- strcat(bak, ".bak");
- BLI_rename(name, bak);
- mvClose(movie);
- }
-
- close(fd);
- }
- fd = open(name, O_BINARY|O_RDWR | O_CREAT | O_EXCL, 0664);
- if (fd != -1) {
- if (flock(fd, LOCK_EX) == -1) report_flock();
- new_movie(fd);
- printf("Created movie: %s\n", name);
- close(fd);
- }
-}
-
-void append_movie(int cfra)
-{
- ImBuf *ibuf, *tbuf;
- int err, ofsx, ofsy, bufsize, rate, lastqual, qualstep, direction, first_image, num_images;
- char name[FILE_MAXDIR+FILE_MAXFILE];
- const char *string;
- int fd;
- float col[4] = {0.0,0.0,0.0,0.0};
-
- set_sfra_efra();
- make_movie_name(name);
- open_compressor();
-
- rate = 1024 * R.r.maximsize;
-
- /* veranderd: kopie van rectot maken */
- ibuf= IMB_allocImBuf(R.rectx, R.recty, 32, IB_rect, 0);
- memcpy(ibuf->rect, R.rectot, 4*R.rectx*R.recty);
-
- if (ibuf->x != mv_outx || ibuf->y != mv_outy) {
- tbuf = IMB_allocImBuf(mv_outx, mv_outy, 32, IB_rect, 0);
- IMB_rectfill(tbuf,col);
-
- ofsx = (tbuf->x - ibuf->x) / 2;
- ofsy = (tbuf->y - ibuf->y) / 2;
- if (numfields == 2) ofsy &= ~1;
-
- IMB_rectcpy(tbuf, ibuf, ofsx, ofsy, 0, 0, ibuf->x, ibuf->y);
- IMB_freeImBuf(ibuf);
- strcpy(tbuf->name, ibuf->name);
- ibuf = tbuf;
- }
- IMB_convert_rgba_to_abgr(ibuf);
-
- if (numfields == 2) {
- if (ntsc) {
- IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y);
- IMB_flipy(ibuf);
- IMB_de_interlace(ibuf);
- if (ntsc) IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y);
- } else {
- IMB_flipy(ibuf);
- IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y);
- IMB_de_interlace(ibuf);
- }
- }
- else {
- /* kleine movies anders op de kop */
- IMB_flipy(ibuf);
- }
-
- if (rate == 0) {
- qualnow = R.r.quality;
- my_Compress(ibuf->rect, &bufsize);
- } else {
- qualstep = 4;
- direction = 0;
-
- do {
- if (qualnow > MAXQUAL) qualnow = MAXQUAL;
- if (qualnow < MINQUAL) qualnow = MINQUAL;
-
- compr_params[qualindex] = qualnow;
- clSetParams(compr, compr_params, myindex);
-
- lastqual = qualnow;
- err = my_Compress(ibuf->rect, &bufsize);
-
- printf(" tried quality: %d, size %d\n", qualnow, bufsize);
-
- if (bufsize < 0.9 * rate) {
- if (err) {
- /* forget about this frame, retry next frame at old quality settting */
- qualnow = lastqual;
- break;
- }
- if (qualnow == MAXQUAL) break;
- direction |= DIR_UP;
- if (direction == DIR_BOTH) qualstep /= 2;
- qualnow += qualstep;
- } else if (bufsize > 1.1 * rate) {
- if (qualnow == MINQUAL) break;
- direction |= DIR_DOWN;
- if (direction == DIR_BOTH) qualstep /= 2;
- qualnow -= qualstep;
- } else break;
-
- if (qualstep == 0) {
- /* this was the last iteration. Make sure that the buffer isn't to big */
- if (bufsize < 1.1 * rate) break;
- else qualnow--;
- }
- } while (1);
-
- printf("used quality: %d\n", qualnow);
-
- if (bufsize < rate) qualnow++;
- else qualnow--;
-
- }
-
- fd = open(name, O_BINARY|O_RDWR);
-
- if (fd != -1) {
- if (flock(fd, LOCK_EX) == -1) report_flock();
- if (mvOpenFD(fd, &movie) == DM_SUCCESS){
- if (mvFindTrackByMedium(movie, DM_IMAGE, &image) == DM_SUCCESS) {
- image_params = mvGetParams(image);
-
- first_image = 1;
-
- string = dmParamsGetString(image_params, FIRST_IMAGE);
- if (string) {
- first_image = atoi(string);
- }
- string = dmParamsGetString(image_params, BLENDER_FIRST_IMAGE);
- if (string) {
- first_image = atoi(string);
- }
-
- num_images = mvGetTrackLength(image);
-
- if (cfra >= first_image && cfra <= (first_image + num_images - 1)) {
- if (mvDeleteFrames(image, cfra - first_image, 1) != DM_SUCCESS) {
- mvDestroyMovie(movie);
- error("mvDeleteFrames");
- G.afbreek = 1;
- }
- }
-
- if (G.afbreek != 1) {
- if (mvInsertCompressedImage(image, cfra - first_image, bufsize, comp_buf) == DM_SUCCESS) {
- printf("added frame %3d (frame %3d in movie): length %6d: ", cfra, cfra - first_image + 1, bufsize);
- mvClose(movie);
- } else {
- mvDestroyMovie(movie);
- error("mvInsertCompressedImage");
- G.afbreek = 1;
- }
- }
- } else {
- mvDestroyMovie(movie);
- error("mvFindTrackByMedium");
- G.afbreek = 1;
- }
- }else {
- error("mvOpenFD");
- G.afbreek = 1;
- }
- close(fd);
- } else {
- error("open movie");
- G.afbreek = 1;
- }
-
- IMB_freeImBuf(ibuf);
-
- close_compressor();
-}
-
-#endif /* __sgi */
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
new file mode 100644
index 00000000000..73e72ab8761
--- /dev/null
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -0,0 +1,83 @@
+# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+FILE(GLOB SRC intern/*.c)
+
+SET(INC .
+ ../editors/include
+ ../../../intern/guardedalloc ../../../intern/memutil
+ ../blenlib ../makesdna ../makesrna ../blenkernel
+ ../include ../../../intern/bmfont ../imbuf ../render/extern/include
+ ../../../intern/bsp/extern ../radiosity/extern/include
+ ../../../intern/decimation/extern ../blenloader ../python
+ ../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue
+ ../quicktime ../../../intern/elbeem/extern
+ ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include
+ ../nodes
+ ${PYTHON_INC}
+ ${SDL_INC}
+)
+
+IF(WITH_INTERNATIONAL)
+ SET(INC ${INC} ../ftfont)
+ ADD_DEFINITIONS(-DINTERNATIONAL)
+ ADD_DEFINITIONS(-DFTGL_STATIC_LIBRARY)
+ENDIF(WITH_INTERNATIONAL)
+
+IF(WITH_OPENEXR)
+ ADD_DEFINITIONS(-DWITH_OPENEXR)
+ENDIF(WITH_OPENEXR)
+
+IF(WITH_QUICKTIME)
+ SET(INC ${INC} ${QUICKTIME_INC})
+ ADD_DEFINITIONS(-DWITH_QUICKTIME)
+ENDIF(WITH_QUICKTIME)
+
+IF(WITH_FFMPEG)
+ SET(INC ${INC} ${FFMPEG_INC})
+ ADD_DEFINITIONS(-DWITH_FFMPEG)
+ENDIF(WITH_FFMPEG)
+
+IF(WIN32)
+ SET(INC ${INC} ${PTHREADS_INC})
+ENDIF(WIN32)
+
+IF(WITH_VERSE)
+ SET(INC ${INC} ${VERSE_INC})
+ ADD_DEFINITIONS(-DWITH_VERSE)
+ENDIF(WITH_VERSE)
+
+# TODO buildinfo
+IF(BF_BUILDINFO)
+ ADD_DEFINITIONS(-DNAN_BUILDINFO)
+ENDIF(BF_BUILDINFO)
+
+BLENDERLIB_NOLIST(bf_windowmanager "${SRC}" "${INC}")
+
+IF(WITH_VERSE)
+ ADD_DEPENDENCIES(bf_windowmanager mkprot verse)
+ENDIF(WITH_VERSE)
+
diff --git a/source/blender/windowmanager/Makefile b/source/blender/windowmanager/Makefile
new file mode 100644
index 00000000000..ad574aa0d4c
--- /dev/null
+++ b/source/blender/windowmanager/Makefile
@@ -0,0 +1,34 @@
+#
+# $Id: Makefile
+#
+# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) Blender Foundation.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL LICENSE BLOCK *****
+#
+# Bounces make to subdirectories.
+
+SOURCEDIR = source/blender/windowmanager
+DIRS = intern
+
+include nan_subdirs.mk
diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript
new file mode 100644
index 00000000000..7e591ad34f6
--- /dev/null
+++ b/source/blender/windowmanager/SConscript
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+Import ('env')
+
+sources = env.Glob('intern/*.c')
+
+#incs = '#/intern/guardedalloc ../blenlib ../makesdna ../blenkernel'
+#incs += ' ../imbuf ../editors/include ../render/extern/include ../render/intern/include'
+
+incs = '. ../editors/include ../python ../makesdna ../blenlib ../blenkernel'
+incs += ' ../nodes ../imbuf ../blenloader ../render/extern/include'
+incs += ' ../ftfont ../radiosity/extern/include ../../kernel/gen_system'
+incs += ' ../makesrna'
+
+incs += ' #/intern/guardedalloc #/intern/memutil #/intern/ghost #/intern/bmfont'
+incs += ' #/intern/elbeem #/extern/glew/include'
+env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), [], libtype=['core','intern'], priority=[45, 45] )
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
new file mode 100644
index 00000000000..908070d33fa
--- /dev/null
+++ b/source/blender/windowmanager/WM_api.h
@@ -0,0 +1,140 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef WM_API_H
+#define WM_API_H
+
+/* dna-savable wmStructs here */
+#include "DNA_windowmanager_types.h"
+
+struct bContext;
+struct wmEvent;
+struct wmEventHandler;
+struct wmGesture;
+struct rcti;
+
+ /* general API */
+void WM_setprefsize (int stax, int stay, int sizx, int sizy);
+
+void WM_init (struct bContext *C);
+void WM_exit (struct bContext *C);
+void WM_main (struct bContext *C);
+
+wmWindow *WM_window_open (struct bContext *C, struct rcti *rect);
+
+ /* files */
+int WM_read_homefile (struct bContext *C, int from_memory);
+int WM_write_homefile (struct bContext *C, struct wmOperator *op);
+void WM_read_file (struct bContext *C, char *name);
+void WM_write_file (struct bContext *C, char *target);
+void WM_read_autosavefile(struct bContext *C);
+void WM_write_autosave (struct bContext *C);
+
+ /* mouse cursors */
+void WM_init_cursor_data (void);
+void WM_set_cursor (struct bContext *C, int curs);
+void WM_waitcursor (struct bContext *C, int val);
+void WM_timecursor (struct bContext *C, int nr);
+
+ /* keymap and handlers */
+void WM_keymap_set_item (ListBase *lb, char *idname, short type,
+ short val, int modifier, short keymodifier);
+void WM_keymap_verify_item(ListBase *lb, char *idname, short type,
+ short val, int modifier, short keymodifier);
+void WM_keymap_add_item (ListBase *lb, char *idname, short type,
+ short val, int modifier, short keymodifier);
+ListBase *WM_keymap_listbase (wmWindowManager *wm, const char *nameid,
+ int spaceid, int regionid);
+
+
+struct wmEventHandler *WM_event_add_keymap_handler(ListBase *handlers, ListBase *keymap);
+ /* boundbox, optional subwindow boundbox for offset */
+struct wmEventHandler *WM_event_add_keymap_handler_bb(ListBase *handlers, ListBase *keymap, rcti *bb, rcti *swinbb);
+
+void WM_event_remove_keymap_handler(ListBase *handlers, ListBase *keymap);
+
+struct wmEventHandler *WM_event_add_ui_handler(bContext *C, ListBase *handlers,
+ int (*func)(bContext *C, struct wmEvent *event), void (*remove)(bContext *C));
+void WM_event_remove_ui_handler(ListBase *handlers);
+
+struct wmEventHandler *WM_event_add_modal_handler(bContext *C, ListBase *handlers, wmOperator *op);
+void WM_event_remove_handlers(bContext *C, ListBase *handlers);
+
+void WM_event_add_mousemove(bContext *C);
+
+void WM_event_add_notifier(bContext *C, int type, int value, void *data);
+
+void wm_event_add (wmWindow *win, struct wmEvent *event_to_add); /* XXX only for warning */
+
+ /* one-shot timer, returns wmTimerData.handle */
+struct wmTimerHandle *WM_event_add_window_timer(wmWindow *win, int delay_ms, int interval_ms);
+void WM_event_remove_window_timer(wmWindow *wm, struct wmTimerHandle *handle);
+
+ /* operator api, default callbacks */
+ /* confirm menu + exec */
+int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
+ /* context checks */
+int WM_operator_winactive (struct bContext *C);
+
+ /* operator api */
+wmOperatorType *WM_operatortype_find(const char *idname);
+void WM_operatortype_append (void (*opfunc)(wmOperatorType*));
+
+int WM_operator_invoke (struct bContext *C, wmOperatorType *ot, struct wmEvent *event);
+int WM_operator_call (struct bContext *C, const char *opstring);
+int WM_operator_call_rwin (struct bContext *C, const char *opstring);
+
+ /* default operator callbacks for border/lasso */
+int WM_border_select_invoke (struct bContext *C, wmOperator *op, struct wmEvent *event);
+int WM_border_select_modal (struct bContext *C, wmOperator *op, struct wmEvent *event);
+
+ /* default operator for arearegions, generates event */
+void WM_OT_tweak_gesture(wmOperatorType *ot);
+
+ /* Gesture manager API */
+struct wmGesture *WM_gesture_new(struct bContext *C, struct wmEvent *event, int type);
+void WM_gesture_end(struct bContext *C, struct wmGesture *gesture);
+
+ /* Reporting information and errors */
+void WM_report(struct bContext *C, int type, const char *message);
+void WM_reportf(struct bContext *C, int type, const char *format, ...);
+
+ /* OpenGL wrappers, mimicing opengl syntax */
+void wmLoadMatrix (wmWindow *win, float mat[][4]);
+void wmGetMatrix (wmWindow *win, float mat[][4]);
+void wmMultMatrix (wmWindow *win, float mat[][4]);
+void wmGetSingleMatrix (wmWindow *win, float mat[][4]);
+void wmScale (wmWindow *win, float x, float y, float z);
+void wmLoadIdentity (wmWindow *win); /* note: old name clear_view_mat */
+
+void wmFrustum (wmWindow *win, float x1, float x2, float y1, float y2, float n, float f);
+void wmOrtho (wmWindow *win, float x1, float x2, float y1, float y2, float n, float f);
+void wmOrtho2 (wmWindow *win, float x1, float x2, float y1, float y2);
+
+
+#endif /* WM_API_H */
+
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
new file mode 100644
index 00000000000..c8ca8195db0
--- /dev/null
+++ b/source/blender/windowmanager/WM_types.h
@@ -0,0 +1,189 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef WM_TYPES_H
+#define WM_TYPES_H
+
+/* exported types for WM */
+
+#include "wm_cursors.h"
+#include "wm_event_types.h"
+
+/* ************** wmOperatorType ************************ */
+
+/* flag */
+#define OPTYPE_REGISTER 1
+
+/* ************** wmEvent ************************ */
+
+/* each event should have full modifier state */
+/* event comes from eventmanager and from keymap */
+typedef struct wmEvent {
+ struct wmEvent *next, *prev;
+
+ short type; /* event code itself (short, is also in keymap) */
+ short val; /* press, release, scrollvalue */
+ short x, y; /* mouse pointer position */
+ short prevx, prevy; /* previous mouse pointer position */
+ short unicode; /* future, ghost? */
+ char ascii; /* from ghost */
+ char pad1;
+
+ /* modifier states */
+ short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */
+ short keymodifier; /* rawkey modifier */
+
+ /* keymap item, set by handler (weak?) */
+ const char *keymap_idname;
+
+ /* custom data */
+ short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */
+ void *customdata; /* ascii, unicode, mouse coords, angles, vectors, dragdrop info */
+ short customdatafree;
+
+} wmEvent;
+
+
+/* ************** wmKeyMap ************************ */
+
+/* modifier */
+#define KM_SHIFT 1
+#define KM_CTRL 2
+#define KM_ALT 4
+#define KM_OSKEY 8
+ /* means modifier should be pressed 2nd */
+#define KM_SHIFT2 16
+#define KM_CTRL2 32
+#define KM_ALT2 64
+#define KM_OSKEY2 128
+
+/* val */
+#define KM_ANY -1
+#define KM_RELEASE 0
+#define KM_PRESS 1
+
+/* ************** UI Handler ***************** */
+
+#define WM_UI_HANDLER_CONTINUE 0
+#define WM_UI_HANDLER_BREAK 1
+
+typedef int (*wmUIHandlerFunc)(bContext *C, struct wmEvent *event);
+typedef void (*wmUIHandlerRemoveFunc)(bContext *C);
+
+/* ************** Notifiers ****************** */
+
+typedef struct wmNotifier {
+ struct wmNotifier *prev, *next;
+
+ struct wmWindow *window;
+
+ int swinid;
+ int type;
+ int value;
+ void *data;
+
+} wmNotifier;
+
+
+enum {
+ WM_NOTE_WINDOW_REDRAW,
+ WM_NOTE_SCREEN_CHANGED,
+ WM_NOTE_AREA_REDRAW,
+ WM_NOTE_REGION_REDRAW,
+ WM_NOTE_GESTURE_REDRAW,
+ WM_NOTE_OBJECT_CHANGED,
+ WM_NOTE_LAST
+};
+
+/* ************** Gesture Manager data ************** */
+
+/* wmGesture->type */
+#define WM_GESTURE_TWEAK 0
+#define WM_GESTURE_LINE 1
+#define WM_GESTURE_RECT 2
+#define WM_GESTURE_CROSS_RECT 3
+#define WM_GESTURE_LASSO 4
+#define WM_GESTURE_CIRCLE 5
+
+/* wmGesture is registered to window listbase, handled by operator callbacks */
+typedef struct wmGesture {
+ struct wmGesture *next, *prev;
+ int event_type; /* event->type */
+ int mode; /* for modal callback */
+ int type; /* gesture type define */
+ int swinid; /* initial subwindow id where it started */
+
+ void *customdata;
+ /* customdata for border is a recti */
+
+} wmGesture;
+
+
+/* ************** custom wmEvent data ************** */
+
+#define DEV_STYLUS 1
+#define DEV_ERASER 2
+
+typedef struct wmTabletData {
+ int Active; /* 0=None, 1=Stylus, 2=Eraser */
+ float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
+ float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
+ float Ytilt; /* as above */
+} wmTabletData;
+
+struct wmTimerHandle;
+typedef struct wmTimerHandle wmTimerHandle;
+
+/* ****************** Messages ********************* */
+
+enum {
+ WM_LOG_DEBUG = 0,
+ WM_LOG_INFO = 1000,
+ WM_LOG_WARNING = 2000,
+ WM_ERROR_UNDEFINED = 3000,
+ WM_ERROR_INVALID_INPUT = 3001,
+ WM_ERROR_INVALID_CONTEXT = 3002,
+ WM_ERROR_OUT_OF_MEMORY = 3003
+};
+
+typedef struct wmReport {
+ struct wmReport *next, *prev;
+ int type;
+ const char *typestr;
+ char *message;
+} wmReport;
+
+/* *************** migrated stuff, clean later? ******************************** */
+
+typedef struct RecentFile {
+ struct RecentFile *next, *prev;
+ char *filename;
+} RecentFile;
+
+
+#endif /* WM_TYPES_H */
+
diff --git a/source/blender/src/Makefile b/source/blender/windowmanager/intern/Makefile
index 46e916b0437..00412f00445 100644
--- a/source/blender/src/Makefile
+++ b/source/blender/windowmanager/intern/Makefile
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -28,64 +28,60 @@
#
#
-ORGLIBNAME = src
-LIBNAME ?= $(ORGLIBNAME)
-DIR ?= $(OCGDIR)/blender/$(ORGLIBNAME)
-
-CSRCS ?= $(wildcard *.c)
-PUB_CSRCS ?= $(CSRCS)
-CRE_CSRCS ?= $(CSRCS) $(wildcard cre/*.c)
-
-OBJS = $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)DNA.o
-
-ALLTARGETS = publisher
+LIBNAME = windowmanager
+DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
-# Cflags stuff ------------------------------------------
+CFLAGS += $(LEVEL_1_C_WARNINGS)
-CFLAGS += $(LEVEL_1_C_WARNINGS)
-#CFLAGS += $(LEVEL_1_C_WARNINGS) -diag_error 1196
+# OpenGL and Python
+CPPFLAGS += -I$(NAN_GLEW)/include
+CPPFLAGS += $(OGL_CPPFLAGS)
+CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-# PreProcessor stuff ------------------------------------------
+# PreProcessor stuff
-CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
CPPFLAGS += -I$(NAN_GHOST)/include
CPPFLAGS += -I$(NAN_BMFONT)/include
CPPFLAGS += -I$(NAN_ELBEEM)/include
CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
-# External interfaces of modules:
-CPPFLAGS += -I../render/extern/include
-CPPFLAGS += -I../blenkernel
-CPPFLAGS += -I../blenlib
-CPPFLAGS += -I../nodes
-CPPFLAGS += -I../python
-CPPFLAGS += -I../makesdna
-CPPFLAGS += -I../imbuf
-CPPFLAGS += -I../blenloader
-CPPFLAGS += -I..
-CPPFLAGS += -I../../kernel/gen_system
-CPPFLAGS += -I../../gameengine/SoundSystem
-CPPFLAGS += -I../ftfont
-CPPFLAGS += -I../gpu
-
-# Only used by py_demo.c !!!
-CPPFLAGS += -I../radiosity/extern/include
-
-CPPFLAGS += -I$(SRCHOME)/gameengine/Physics/Sumo/include
+# modules
+CPPFLAGS += -I../../editors/include
+CPPFLAGS += -I../../python
+CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
+CPPFLAGS += -I../../blenlib
+CPPFLAGS += -I../../blenkernel
+CPPFLAGS += -I../../nodes
+CPPFLAGS += -I../../imbuf
+CPPFLAGS += -I../../blenloader
+CPPFLAGS += -I../../render/extern/include
+CPPFLAGS += -I../../ftfont
+CPPFLAGS += -I../../radiosity/extern/include
+CPPFLAGS += -I../../../kernel/gen_system
+
+# path to the guarded memory allocator
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I$(NAN_MEMUTIL)/include
-CPPFLAGS += -I$(NAN_DECIMATION)/include
-CPPFLAGS += -I$(NAN_BSP)/include
-CPPFLAGS += -I$(NAN_OPENNL)/include
+ifeq ($(INTERNATIONAL), true)
+ CPPFLAGS += -DINTERNATIONAL
+endif
-CPPFLAGS += -I../readstreamglue
-CPPFLAGS += -I../include
+ifeq ($(WITH_VERSE), true)
+ CPPFLAGS += -DWITH_VERSE
+ CPPFLAGS += -I$(NAN_VERSE)/include
+ # print some other debug information
+ ifeq ($(VERSE_DEBUG_PRINT), true)
+ CPPFLAGS += -DVERSE_DEBUG_PRINT
+ endif
+endif
-ifdef NAN_BUILDINFO
- CPPFLAGS += -DNAN_BUILDINFO
+ifeq ($(WITH_QUICKTIME),true)
+ CPPFLAGS += -I../quicktime
+ CPPFLAGS += -DWITH_QUICKTIME
endif
ifeq ($(OS),linux)
@@ -100,49 +96,5 @@ ifeq ($(OS),linux)
endif
endif
-ifeq ($(WITH_QUICKTIME),true)
- CPPFLAGS += -I../quicktime
- CPPFLAGS += -DWITH_QUICKTIME
-endif
-
-ifeq ($(WITH_ICONV), true)
- CPPFLAGS += -DWITH_ICONV
- CPPFLAGS += $(NAN_ICONV_INC)
-endif
-
-ifeq ($(WITH_FFMPEG),true)
- CPPFLAGS += -DWITH_FFMPEG
- CPPFLAGS += $(NAN_FFMPEGCFLAGS)
-endif
-
-ifdef NAN_PTHREADS
- CPPFLAGS += -I$(NAN_PTHREADS)/include
-endif
-
-ifeq ($(WITH_OPENEXR),true)
- CPPFLAGS += -DWITH_OPENEXR
-endif
-
-ifeq ($(WITH_DDS),true)
- CPPFLAGS += -DWITH_DDS
-endif
-
-ifeq ($(INTERNATIONAL), true)
- CPPFLAGS += -DINTERNATIONAL
-endif
-
-ifeq ($(WITH_VERSE), true)
- CPPFLAGS += -DWITH_VERSE
- CPPFLAGS += -I$(NAN_VERSE)/include
- # print some other debug information
- ifeq ($(VERSE_DEBUG_PRINT), true)
- CPPFLAGS += -DVERSE_DEBUG_PRINT
- endif
-endif
-
-ifeq ($(NAN_TWEAK_MODE), true)
- CPPFLAGS += -DTWEAK_MODE
-endif
-
-CPPFLAGS += -I$(NAN_GLEW)/include
-CPPFLAGS += -I$(OPENGL_HEADERS)
+# path to our own headerfiles
+CPPFLAGS += -I..
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
new file mode 100644
index 00000000000..9e0408097d9
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm.c
@@ -0,0 +1,192 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_idprop.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_window.h"
+#include "wm_event_system.h"
+#include "wm_event_types.h"
+#include "wm.h"
+
+#include "ED_screen.h"
+
+/* ****************************************************** */
+
+#define MAX_OP_REGISTERED 32
+
+void wm_operator_free(wmOperator *op)
+{
+ if(op->properties) {
+ IDP_FreeProperty(op->properties);
+
+ /* This need change, when the idprop code only
+ * need call IDP_FreeProperty. (check BKE_idprop.h) */
+ MEM_freeN(op->properties);
+ op->properties= NULL;
+ }
+
+ if(op->ptr)
+ MEM_freeN(op->ptr);
+
+ MEM_freeN(op);
+}
+
+/* all operations get registered in the windowmanager here */
+/* called on event handling by event_system.c */
+void wm_operator_register(wmWindowManager *wm, wmOperator *op)
+{
+ int tot;
+
+ BLI_addtail(&wm->operators, op);
+ tot= BLI_countlist(&wm->operators);
+
+ while(tot>MAX_OP_REGISTERED) {
+ wmOperator *opt= wm->operators.first;
+ BLI_remlink(&wm->operators, opt);
+ wm_operator_free(opt);
+ tot--;
+ }
+}
+
+
+/* ****************************************** */
+
+void wm_check(bContext *C)
+{
+
+ /* wm context */
+ if(C->wm==NULL) C->wm= G.main->wm.first;
+ if(C->wm==NULL) return;
+ if(C->wm->windows.first==NULL) return;
+
+ /* case: no open windows at all, for old file reads */
+ wm_window_add_ghostwindows(C->wm);
+
+ /* case: fileread */
+ if(C->wm->initialized==0) {
+
+ wm_window_keymap(C->wm);
+ ED_spacetypes_keymap(C->wm);
+
+ ED_screens_initialize(C->wm);
+ C->wm->initialized= 1;
+ }
+}
+
+/* on startup, it adds all data, for matching */
+void wm_add_default(bContext *C)
+{
+ wmWindowManager *wm= alloc_libblock(&G.main->wm, ID_WM, "WinMan");
+ wmWindow *win;
+
+ C->wm= wm;
+
+ win= wm_window_new(C);
+ win->screen= C->screen;
+ wm->winactive= win;
+ wm_window_make_drawable(C, win);
+}
+
+
+/* context is allowed to be NULL, do not free wm itself (library.c) */
+void wm_close_and_free(bContext *C, wmWindowManager *wm)
+{
+ wmWindow *win;
+ wmOperator *op;
+ wmReport *report;
+ wmKeyMap *km;
+
+ while((win= wm->windows.first)) {
+ BLI_remlink(&wm->windows, win);
+ wm_window_free(C, win);
+ }
+
+ while((op= wm->operators.first)) {
+ BLI_remlink(&wm->operators, op);
+ wm_operator_free(op);
+ }
+
+ while((report= wm->reports.first)) {
+ BLI_remlink(&wm->reports, report);
+ wm_report_free(report);
+ }
+
+ while((km= wm->keymaps.first)) {
+ BLI_freelistN(&km->keymap);
+ BLI_remlink(&wm->keymaps, km);
+ MEM_freeN(km);
+ }
+
+ BLI_freelistN(&wm->queue);
+
+ if(C && C->wm==wm) C->wm= NULL;
+}
+
+void wm_close_and_free_all(bContext *C, ListBase *wmlist)
+{
+ wmWindowManager *wm;
+
+ while((wm=wmlist->first)) {
+ wm_close_and_free(C, wm);
+ BLI_remlink(wmlist, wm);
+ MEM_freeN(wm);
+ }
+}
+
+void WM_main(bContext *C)
+{
+ while(1) {
+
+ /* get events from ghost, handle window events, add to window queues */
+ /* WM_init has assigned to ghost the bContext already */
+ wm_window_process_events(1);
+
+ /* per window, all events to the window, screen, area and region handlers */
+ wm_event_do_handlers(C);
+
+ /* events have left notes about changes, we handle and cache it */
+ wm_event_do_notifiers(C);
+
+ /* execute cached changes draw */
+ wm_draw_update(C);
+ }
+}
+
+
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
new file mode 100644
index 00000000000..e04457fc515
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -0,0 +1,138 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifdef __APPLE__
+
+#include "BKE_global.h"
+#include "WM_api.h"
+
+#include <OpenGL/OpenGL.h>
+#define __CARBONSOUND__
+/* XXX BIG WARNING: carbon.h can not be included in blender code, it conflicts with struct ID */
+#define ID ID_
+#include <Carbon/Carbon.h>
+
+
+/* To avoid killing small end comps, we want to allow
+blender to start maximised if all the followings are true :
+- Renderer is OpenGL capable
+- Hardware acceleration
+- VRAM > 16 Mo
+
+ We will bail out if VRAM is less than 8Mo
+ */
+/* bad global, used in wm_window.c to open windows */
+int macPrefState = 0;
+
+static int checkAppleVideoCard(void)
+{
+ CGLRendererInfoObj rend;
+ long theErr;
+ unsigned long display_mask;
+ long nrend;
+ int j;
+ long value;
+ long maxvram = 0; /* we get always more than 1 renderer, check one, at least, has 8 Mo */
+
+ display_mask = CGDisplayIDToOpenGLDisplayMask (CGMainDisplayID() );
+
+ theErr = CGLQueryRendererInfo( display_mask, &rend, &nrend);
+ if (theErr == 0) {
+ theErr = CGLDescribeRenderer (rend, 0, kCGLRPRendererCount, &nrend);
+ if (theErr == 0) {
+ for (j = 0; j < nrend; j++) {
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value);
+ if (value > maxvram)
+ maxvram = value;
+ if ((theErr == 0) && (value >= 20000000)) {
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value);
+ if ((theErr == 0) && (value != 0)) {
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value);
+ if ((theErr == 0) && (value != 0)) {
+ /*fprintf(stderr,"make it big\n");*/
+ CGLDestroyRendererInfo (rend);
+ macPrefState = 8;
+ return 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (maxvram < 7500000 ) { /* put a standard alert and quit*/
+ SInt16 junkHit;
+ char inError[] = "* Not enough VRAM ";
+ char inText[] = "* blender needs at least 8Mb ";
+ inError[0] = 16;
+ inText[0] = 28;
+
+ fprintf(stderr, " vram is %li . not enough, aborting\n", maxvram);
+ StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit);
+ abort();
+ }
+CGLDestroyRendererInfo (rend);
+return 0;
+}
+
+static void getMacAvailableBounds(short *top, short *left, short *bottom, short *right)
+{
+ Rect outAvailableRect;
+
+ GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect);
+
+ *top = outAvailableRect.top;
+ *left = outAvailableRect.left;
+ *bottom = outAvailableRect.bottom;
+ *right = outAvailableRect.right;
+}
+
+
+void wm_set_apple_prefsize(int scr_x, int scr_y)
+{
+
+ /* first let us check if we are hardware accelerated and with VRAM > 16 Mo */
+
+ if (checkAppleVideoCard()) {
+ short top, left, bottom, right;
+
+ getMacAvailableBounds(&top, &left, &bottom, &right);
+ WM_setprefsize(left +10,scr_y - bottom +10,right-left -20,bottom - 64);
+ G.windowstate= 0;
+
+ } else {
+
+ /* 40 + 684 + (headers) 22 + 22 = 768, the powerbook screen height */
+ WM_setprefsize(120, 40, 850, 684);
+ G.windowstate= 0;
+ }
+}
+
+
+#endif /* __APPLE__ */
+
+
diff --git a/source/blender/src/cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 1ed8e97ef1d..e4299b8949b 100644
--- a/source/blender/src/cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -1,12 +1,12 @@
/**
-* $Id$
+* $Id: wm_cursors.c
*
* ***** 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
@@ -17,35 +17,166 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
-* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+* The Original Code is Copyright (C) 2005-2007 Blender Foundation
* All rights reserved.
*
* The Original Code is: all of this file.
*
-* Contributor(s): none yet.
+* Contributor(s): Matt Ebb
*
-* ***** END GPL LICENSE BLOCK *****
+* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#include <stdio.h>
+#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "GHOST_C-api.h"
#include "DNA_listBase.h"
#include "DNA_userdef_types.h"
-#include "BIF_cursors.h"
-#include "BIF_resources.h"
-#include "BIF_graphics.h"
-#include "BIF_screen.h"
+#include "BKE_global.h"
-#include "winlay.h"
+#include "WM_api.h"
+#include "wm_cursors.h"
+
+/* XXX this still is mess from old code */
+
+
+
+/* Some simple ghost <-> blender conversions */
+static GHOST_TStandardCursor convert_cursor(int curs)
+{
+ switch(curs) {
+ default:
+ case CURSOR_STD: return GHOST_kStandardCursorDefault;
+ case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow;
+ case CURSOR_WAIT: return GHOST_kStandardCursorWait;
+ case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair;
+ case CURSOR_HELP: return GHOST_kStandardCursorHelp;
+ case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight;
+ case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown;
+ case CURSOR_PENCIL: return GHOST_kStandardCursorPencil;
+ }
+}
+
+void window_set_custom_cursor(wmWindow *win, unsigned char mask[16][2],
+ unsigned char bitmap[16][2], int hotx, int hoty)
+{
+ GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty);
+}
+
+static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor, int useBig)
+{
+ if (useBig) {
+ GHOST_SetCustomCursorShapeEx(win->ghostwin,
+ (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask,
+ cursor->big_sizex,cursor->big_sizey,
+ cursor->big_hotx,cursor->big_hoty,
+ cursor->fg_color, cursor->bg_color);
+ } else {
+ GHOST_SetCustomCursorShapeEx(win->ghostwin,
+ (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask,
+ cursor->small_sizex,cursor->small_sizey,
+ cursor->small_hotx,cursor->small_hoty,
+ cursor->fg_color, cursor->bg_color);
+ }
+}
+
+
+/* Cursor Globals */
+static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */
+static short CurrentCursor=-1, LastCursor=-1;
+
+void WM_set_cursor(bContext *C, int curs)
+{
+ wmWindow *win= C->window;
+
+ if (win==NULL) return; /* Can't set custom cursor before Window init */
+ win->cursor= curs;
+
+ if (curs==CURSOR_NONE) {
+ GHOST_SetCursorVisibility(win->ghostwin, 0);
+ return;
+ }
+
+ GHOST_SetCursorVisibility(win->ghostwin, 1);
+
+ LastCursor=CurrentCursor;
+ CurrentCursor=curs;
+
+ /* previous cursor? */
+ if (curs==LASTCURSOR) curs=LastCursor;
+
+ /* detect if we use system cursor or Blender cursor */
+ if(curs>=BC_GHOST_CURSORS) {
+ GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs));
+ }
+ else {
+ if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;
+
+ if (curs==SYSCURSOR) { /* System default Cursor */
+ GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
+ }
+ else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
+ window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
+ }
+ else {
+ window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
+ }
+ }
+}
+
+void WM_waitcursor(bContext *C, int val)
+{
+ if(C->window) {
+ if(val) {
+ WM_set_cursor(C, CURSOR_WAIT);
+ } else {
+ WM_set_cursor(C, LASTCURSOR);
+ }
+ }
+}
+
+void WM_timecursor(bContext *C, int nr)
+{
+ /* 10 8x8 digits */
+ static char number_bitmaps[10][8]= {
+ {0, 56, 68, 68, 68, 68, 68, 56},
+ {0, 24, 16, 16, 16, 16, 16, 56},
+ {0, 60, 66, 32, 16, 8, 4, 126},
+ {0, 124, 32, 16, 56, 64, 66, 60},
+ {0, 32, 48, 40, 36, 126, 32, 32},
+ {0, 124, 4, 60, 64, 64, 68, 56},
+ {0, 56, 4, 4, 60, 68, 68, 56},
+ {0, 124, 64, 32, 16, 8, 8, 8},
+ {0, 60, 66, 66, 60, 66, 66, 60},
+ {0, 56, 68, 68, 120, 64, 68, 56}
+ };
+ unsigned char mask[16][2];
+ unsigned char bitmap[16][2];
+ int i, idx;
+
+ memset(&bitmap, 0x00, sizeof(bitmap));
+ memset(&mask, 0xFF, sizeof(mask));
+
+ /* print number bottom right justified */
+ for (idx= 3; nr && idx>=0; idx--) {
+ char *digit= number_bitmaps[nr%10];
+ int x = idx%2;
+ int y = idx/2;
+
+ for (i=0; i<8; i++)
+ bitmap[i + y*8][x]= digit[i];
+ nr/= 10;
+ }
+
+ window_set_custom_cursor(C->window, mask, bitmap, 7, 7);
+}
/* ******************************************************************
-Cursor Description:
+Custom Cursor Description:
Each bit represents a pixel, so 1 byte = 8 pixels,
the bytes go Left to Right. Top to bottom
@@ -78,55 +209,15 @@ It will copy its output to the console when you press 'Do it'.
*/
/* Because defining a cursor mixes declarations and executable code
- each cursor needs it's own scoping block or it would be split up
- over several hundred lines of code. To enforce/document this better
- I define 2 pretty braindead macros so it's obvious what the extra "[]"
- are for */
+each cursor needs it's own scoping block or it would be split up
+over several hundred lines of code. To enforce/document this better
+I define 2 pretty braindead macros so it's obvious what the extra "[]"
+are for */
#define BEGIN_CURSOR_BLOCK {
#define END_CURSOR_BLOCK }
-/* Cursor Globals */
-static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */
-static short CurrentCursor=-1, LastCursor=-1;
-
-short GetBlenderCursor(void) {
- return CurrentCursor;
-}
-
-void SetBlenderCursor(short curs){
- Window *win;
-
- if ((curs<LASTCURSOR)||(curs>=BC_NUMCURSORS)) return;
-
- win=winlay_get_active_window();
-
- if (win==NULL) return; /* Can't set custom cursor before Window init */
-
- LastCursor=CurrentCursor;
- CurrentCursor=curs;
-
- if (curs==LASTCURSOR) curs=LastCursor;
-
- if (curs==SYSCURSOR) { /* System default Cursor */
- window_set_cursor(win, CURSOR_STD);
- //set_cursor(CURSOR_STD);
- }
- else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) {
- window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
- }
- else {
- window_set_custom_cursor_ex(win, BlenderCursor[curs], 1);
- }
-}
-
-/* unused no prototypes
-short GetCurrentCursor(void){
- return(CurrentCursor);
-}
-*/
-
-void InitCursorData(void){
+void WM_init_cursor_data(void){
/********************** NW_ARROW Cursor **************************/
BEGIN_CURSOR_BLOCK
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
new file mode 100644
index 00000000000..88c29ddae29
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -0,0 +1,980 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "DNA_listBase.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+#include "DNA_userdef_types.h" /* U.flag & TWOBUTTONMOUSE */
+
+#include "MEM_guardedalloc.h"
+
+#include "GHOST_C-api.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+#include "RNA_access.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm.h"
+#include "wm_window.h"
+#include "wm_event_system.h"
+#include "wm_event_types.h"
+
+/* ************ event management ************** */
+
+void wm_event_add(wmWindow *win, wmEvent *event_to_add)
+{
+ wmEvent *event= MEM_callocN(sizeof(wmEvent), "event");
+
+ *event= *event_to_add;
+ BLI_addtail(&win->queue, event);
+}
+
+wmEvent *wm_event_next(wmWindow *win)
+{
+ wmEvent *event= win->queue.first;
+
+ if(event) BLI_remlink(&win->queue, event);
+ return event;
+}
+
+static void wm_event_free(wmEvent *event)
+{
+ if(event->customdata && event->customdatafree)
+ MEM_freeN(event->customdata);
+ MEM_freeN(event);
+}
+
+void wm_event_free_all(wmWindow *win)
+{
+ wmEvent *event;
+
+ while((event= win->queue.first)) {
+ BLI_remlink(&win->queue, event);
+ wm_event_free(event);
+ }
+}
+
+/* ********************* notifiers, listeners *************** */
+
+/* XXX: in future, which notifiers to send to other windows? */
+void WM_event_add_notifier(bContext *C, int type, int value, void *data)
+{
+ wmNotifier *note= MEM_callocN(sizeof(wmNotifier), "notifier");
+
+ BLI_addtail(&C->wm->queue, note);
+
+ note->window= C->window;
+
+ /* catch global notifications here */
+ switch (type) {
+ case WM_NOTE_WINDOW_REDRAW:
+ case WM_NOTE_SCREEN_CHANGED:
+ break;
+ default:
+ if(C->region) note->swinid= C->region->swinid;
+ }
+
+ note->type= type;
+ note->value= value;
+ note->data= data;
+}
+
+static wmNotifier *wm_notifier_next(wmWindowManager *wm)
+{
+ wmNotifier *note= wm->queue.first;
+
+ if(note) BLI_remlink(&wm->queue, note);
+ return note;
+}
+
+/* called in mainloop */
+void wm_event_do_notifiers(bContext *C)
+{
+ wmNotifier *note;
+
+ while( (note=wm_notifier_next(C->wm)) ) {
+ wmWindow *win;
+
+ for(win= C->wm->windows.first; win; win= win->next) {
+ ScrArea *sa;
+ ARegion *ar;
+
+ C->window= win;
+ C->screen= win->screen;
+
+ if(note->window && note->window!=win)
+ continue;
+ if(win->screen==NULL)
+ continue;
+
+ /* printf("notifier win %d screen %s\n", win->winid, win->screen->id.name+2); */
+ ED_screen_do_listen(win, note);
+
+ for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
+ if(note->swinid && note->swinid!=ar->swinid)
+ continue;
+
+ C->region= ar;
+ ED_region_do_listen(ar, note);
+ C->region= NULL;
+ }
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ C->area= sa;
+
+ for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ if(note->swinid && note->swinid!=ar->swinid)
+ continue;
+
+ C->region= ar;
+ ED_region_do_listen(ar, note);
+ C->region= NULL;
+ }
+
+ C->area= NULL;
+ }
+
+ C->window= NULL;
+ C->screen= NULL;
+ }
+ if(note->data)
+ MEM_freeN(note->data);
+ MEM_freeN(note);
+ }
+}
+
+/* quick test to prevent changing window drawable */
+static int wm_draw_update_test_window(wmWindow *win)
+{
+ ScrArea *sa;
+ ARegion *ar;
+
+ if(win->screen->do_refresh)
+ return 1;
+ if(win->screen->do_draw)
+ return 1;
+ if(win->screen->do_gesture)
+ return 1;
+
+ for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
+ if(ar->swinid && ar->do_draw)
+ return 1;
+ }
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ if(ar->swinid && ar->do_draw)
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void wm_draw_update(bContext *C)
+{
+ wmWindow *win;
+
+ for(win= C->wm->windows.first; win; win= win->next) {
+ if(wm_draw_update_test_window(win)) {
+ ScrArea *sa;
+ ARegion *ar;
+
+ C->window= win;
+ C->screen= win->screen;
+
+ /* sets context window+screen */
+ wm_window_make_drawable(C, win);
+
+ /* notifiers for screen redraw */
+ if(win->screen->do_refresh)
+ ED_screen_refresh(C->wm, win);
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ int area_do_draw= 0;
+
+ C->area= sa;
+
+ for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ C->region= ar;
+
+ if(ar->swinid && ar->do_draw) {
+ ED_region_do_draw(C, ar);
+ area_do_draw= 1;
+ }
+
+ C->region= NULL;
+ }
+ /* only internal decoration, like AZone */
+ if(area_do_draw)
+ ED_area_do_draw(C, sa);
+
+ C->area = NULL;
+ }
+
+ /* move this here so we can do area 'overlay' drawing */
+ if(win->screen->do_draw)
+ ED_screen_draw(win);
+
+ /* regions are menus here */
+ for(ar=win->screen->regionbase.first; ar; ar= ar->next) {
+ C->region= ar;
+
+ if(ar->swinid && ar->do_draw)
+ ED_region_do_draw(C, ar);
+
+ C->region= NULL;
+ }
+
+ if(win->screen->do_gesture)
+ wm_gesture_draw(win);
+
+ wm_window_swap_buffers(win);
+
+ C->window= NULL;
+ C->screen= NULL;
+ }
+ }
+}
+
+/* ********************* operators ******************* */
+
+
+int WM_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event)
+{
+ int retval= OPERATOR_PASS_THROUGH;
+
+ if(ot->poll==NULL || ot->poll(C)) {
+ wmOperator *op= MEM_callocN(sizeof(wmOperator), "wmOperator");
+
+ /* XXX adding new operator could be function, only happens here now */
+ op->type= ot;
+ BLI_strncpy(op->idname, ot->idname, OP_MAX_TYPENAME);
+
+ op->ptr= MEM_callocN(sizeof(PointerRNA), "wmOperatorPtrRNA");
+ RNA_pointer_create(&RNA_WindowManager, &C->wm->id, ot->srna, op, op->ptr);
+
+ if(op->type->invoke)
+ retval= (*op->type->invoke)(C, op, event);
+ else if(op->type->exec)
+ retval= op->type->exec(C, op);
+
+ if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
+ wm_operator_register(C->wm, op);
+ }
+ else if(!(retval & OPERATOR_RUNNING_MODAL)) {
+ wm_operator_free(op);
+ }
+ }
+
+ return retval;
+}
+
+/* forces event to go to the region window, for header menus */
+int WM_operator_call_rwin(bContext *C, const char *opstring)
+{
+ wmOperatorType *ot= WM_operatortype_find(opstring);
+
+ /* dummie test */
+ if(ot && C && C->window) {
+ ARegion *ar= C->region;
+ int retval;
+
+ if(C->area) {
+ ARegion *ar1= C->area->regionbase.first;
+ for(; ar1; ar1= ar1->next)
+ if(ar1->regiontype==RGN_TYPE_WINDOW)
+ break;
+ if(ar1)
+ C->region= ar1;
+ }
+
+ retval= WM_operator_invoke(C, ot, C->window->eventstate);
+
+ /* set region back */
+ C->region= ar;
+
+ return retval;
+ }
+
+ return 0;
+}
+
+/* invokes operator in context */
+int WM_operator_call(bContext *C, const char *opstring)
+{
+ wmOperatorType *ot= WM_operatortype_find(opstring);
+
+ /* dummie test */
+ if(ot && C && C->window) {
+ return WM_operator_invoke(C, ot, C->window->eventstate);
+ }
+
+ return 0;
+}
+
+/* ********************* handlers *************** */
+
+
+/* not handler itself, is called by UI to move handlers to other queues, so don't close modal ones */
+static void wm_event_free_handler(wmEventHandler *handler)
+{
+
+}
+
+/* called on exit or remove area, only here call cancel callback */
+void WM_event_remove_handlers(bContext *C, ListBase *handlers)
+{
+ wmEventHandler *handler;
+
+ /* C is zero on freeing database, modal handlers then already were freed */
+ while((handler=handlers->first)) {
+ BLI_remlink(handlers, handler);
+
+ if(handler->op) {
+ if(handler->op->type->cancel) {
+ ScrArea *area= C->area;
+ ARegion *region= C->region;
+
+ C->area= handler->op_area;
+ C->region= handler->op_region;
+
+ handler->op->type->cancel(C, handler->op);
+
+ C->area= area;
+ C->region= region;
+ }
+
+ wm_operator_free(handler->op);
+ }
+ else if(handler->ui_remove) {
+ ScrArea *area= C->area;
+ ARegion *region= C->region;
+
+ if(handler->ui_area) C->area= handler->ui_area;
+ if(handler->ui_region) C->region= handler->ui_region;
+
+ handler->ui_remove(C);
+
+ C->area= area;
+ C->region= region;
+ }
+
+ wm_event_free_handler(handler);
+ MEM_freeN(handler);
+ }
+}
+
+static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
+{
+
+ if(winevent->type!=kmi->type) return 0;
+
+ if(kmi->val!=KM_ANY)
+ if(winevent->val!=kmi->val) return 0;
+
+ if(winevent->shift!=kmi->shift) return 0;
+ if(winevent->ctrl!=kmi->ctrl) return 0;
+ if(winevent->alt!=kmi->alt) return 0;
+ if(winevent->oskey!=kmi->oskey) return 0;
+ if(kmi->keymodifier)
+ if(winevent->keymodifier!=kmi->keymodifier) return 0;
+
+
+ return 1;
+}
+
+/* Warning: this function removes a modal handler, when finished */
+static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHandler *handler, wmEvent *event)
+{
+ int retval= OPERATOR_PASS_THROUGH;
+
+ /* derived, modal or blocking operator */
+ if(handler->op) {
+ wmOperator *op= handler->op;
+ wmOperatorType *ot= op->type;
+
+ if(ot->modal) {
+ /* we set context to where modal handler came from */
+ ScrArea *area= C->area;
+ ARegion *region= C->region;
+
+ C->area= handler->op_area;
+ C->region= handler->op_region;
+
+ retval= ot->modal(C, op, event);
+
+ /* putting back screen context */
+ C->area= area;
+ C->region= region;
+
+ if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
+ wm_operator_register(C->wm, op);
+ handler->op= NULL;
+ }
+ else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ wm_operator_free(op);
+ handler->op= NULL;
+ }
+
+
+ /* remove modal handler, operator itself should have been cancelled and freed */
+ if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ BLI_remlink(handlers, handler);
+ wm_event_free_handler(handler);
+ MEM_freeN(handler);
+
+ /* prevent silly errors from operator users */
+ retval &= ~OPERATOR_PASS_THROUGH;
+ }
+
+ }
+ else
+ printf("wm_handler_operator_call error\n");
+ }
+ else {
+ wmOperatorType *ot= WM_operatortype_find(event->keymap_idname);
+
+ if(ot)
+ retval= WM_operator_invoke(C, ot, event);
+ }
+
+ if(retval & OPERATOR_PASS_THROUGH)
+ return WM_HANDLER_CONTINUE;
+
+ return WM_HANDLER_BREAK;
+}
+
+static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *event)
+{
+ ScrArea *area= C->area;
+ ARegion *region= C->region;
+ int retval;
+
+ /* we set context to where ui handler came from */
+ if(handler->ui_area) C->area= handler->ui_area;
+ if(handler->ui_region) C->region= handler->ui_region;
+
+ retval= handler->ui_handle(C, event);
+
+ /* putting back screen context */
+ C->area= area;
+ C->region= region;
+
+ if(retval == WM_UI_HANDLER_BREAK)
+ return WM_HANDLER_BREAK;
+
+ return WM_HANDLER_CONTINUE;
+}
+
+static int wm_event_always_pass(wmEvent *event)
+{
+ /* some events we always pass on, to ensure proper communication */
+ return (event->type == TIMER);
+}
+
+static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event)
+{
+ if(handler->bbwin) {
+ if(handler->bblocal) {
+ rcti rect= *handler->bblocal;
+ BLI_translate_rcti(&rect, handler->bbwin->xmin, handler->bbwin->ymin);
+ return BLI_in_rcti(&rect, event->x, event->y);
+ }
+ else
+ return BLI_in_rcti(handler->bbwin, event->x, event->y);
+ }
+ return 1;
+}
+
+static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
+{
+ wmEventHandler *handler, *nexthandler;
+ int action= WM_HANDLER_CONTINUE;
+
+ if(handlers==NULL) return action;
+
+ /* modal handlers can get removed in this loop, we keep the loop this way */
+ for(handler= handlers->first; handler; handler= nexthandler) {
+ nexthandler= handler->next;
+
+ /* optional boundbox */
+ if(handler_boundbox_test(handler, event)) {
+
+ /* modal+blocking handler */
+ if(handler->flag & WM_HANDLER_BLOCKING)
+ action= WM_HANDLER_BREAK;
+
+ if(handler->keymap) {
+ wmKeymapItem *kmi;
+
+ for(kmi= handler->keymap->first; kmi; kmi= kmi->next) {
+ if(wm_eventmatch(event, kmi)) {
+ /* if(event->type!=MOUSEMOVE)
+ printf("handle evt %d win %d op %s\n", event->type, C->window->winid, kmi->idname); */
+
+ event->keymap_idname= kmi->idname; /* weak, but allows interactive callback to not use rawkey */
+
+ action= wm_handler_operator_call(C, handlers, handler, event);
+ if(action==WM_HANDLER_BREAK) /* not wm_event_always_pass(event) here, it denotes removed handler */
+ break;
+ }
+ }
+ }
+ else if(handler->ui_handle) {
+ action= wm_handler_ui_call(C, handler, event);
+ }
+ else {
+ /* modal, swallows all */
+ action= wm_handler_operator_call(C, handlers, handler, event);
+ }
+
+ if(!wm_event_always_pass(event) && action==WM_HANDLER_BREAK)
+ break;
+ }
+
+ }
+ return action;
+}
+
+static int wm_event_inside_i(wmEvent *event, rcti *rect)
+{
+ return BLI_in_rcti(rect, event->x, event->y);
+}
+
+static int wm_event_prev_inside_i(wmEvent *event, rcti *rect)
+{
+ if(BLI_in_rcti(rect, event->x, event->y))
+ return 1;
+ if(event->type==MOUSEMOVE) {
+ if( BLI_in_rcti(rect, event->prevx, event->prevy)) {
+ return 1;
+ }
+ return 0;
+ }
+ return 0;
+}
+
+static ScrArea *area_event_inside(bContext *C, wmEvent *event)
+{
+ ScrArea *sa;
+
+ if(C->screen)
+ for(sa= C->screen->areabase.first; sa; sa= sa->next)
+ if(BLI_in_rcti(&sa->totrct, event->x, event->y))
+ return sa;
+ return NULL;
+}
+
+static ARegion *region_event_inside(bContext *C, wmEvent *event)
+{
+ ARegion *ar;
+
+ if(C->screen && C->area)
+ for(ar= C->area->regionbase.first; ar; ar= ar->next)
+ if(BLI_in_rcti(&ar->winrct, event->x, event->y))
+ return ar;
+ return NULL;
+}
+
+
+/* called in main loop */
+/* goes over entire hierarchy: events -> window -> screen -> area -> region */
+void wm_event_do_handlers(bContext *C)
+{
+ wmWindow *win;
+
+ for(win= C->wm->windows.first; win; win= win->next) {
+ wmEvent *event;
+
+ if( win->screen==NULL )
+ wm_event_free_all(win);
+
+ while( (event=wm_event_next(win)) ) {
+ int action;
+
+ C->window= win;
+ C->screen= win->screen;
+ C->area= area_event_inside(C, event);
+ C->region= region_event_inside(C, event);
+
+ /* MVC demands to not draw in event handlers... for now we leave it */
+ wm_window_make_drawable(C, win);
+
+ action= wm_handlers_do(C, event, &win->handlers);
+
+ if(wm_event_always_pass(event) || action==WM_HANDLER_CONTINUE) {
+ ScrArea *sa;
+ ARegion *ar;
+ int doit= 0;
+
+ for(sa= win->screen->areabase.first; sa; sa= sa->next) {
+ if(wm_event_always_pass(event) || wm_event_prev_inside_i(event, &sa->totrct)) {
+ doit= 1;
+ C->area= sa;
+ action= wm_handlers_do(C, event, &sa->handlers);
+
+ if(wm_event_always_pass(event) || action==WM_HANDLER_CONTINUE) {
+ for(ar=sa->regionbase.first; ar; ar= ar->next) {
+ if(wm_event_always_pass(event) || wm_event_inside_i(event, &ar->winrct) || wm_event_prev_inside_i(event, &ar->winrct)) {
+ C->region= ar;
+ action= wm_handlers_do(C, event, &ar->handlers);
+ C->region= NULL;
+
+ if(!wm_event_always_pass(event)) {
+ if(action==WM_HANDLER_BREAK)
+ break;
+ }
+ }
+ }
+ }
+
+ C->area= NULL;
+ /* NOTE: do not escape on WM_HANDLER_BREAK, mousemove needs handled for previous area */
+ }
+ }
+ /* XXX hrmf, this gives reliable previous mouse coord for area change, feels bad?
+ doing it on ghost queue gives errors when mousemoves go over area borders */
+ if(doit) {
+ C->window->eventstate->prevx= event->x;
+ C->window->eventstate->prevy= event->y;
+ }
+ }
+ wm_event_free(event);
+
+ C->window= NULL;
+ C->screen= NULL;
+ }
+ }
+}
+
+/* lets not expose struct outside wm? */
+void WM_event_set_handler_flag(wmEventHandler *handler, int flag)
+{
+ handler->flag= flag;
+}
+
+wmEventHandler *WM_event_add_modal_handler(bContext *C, ListBase *handlers, wmOperator *op)
+{
+ wmEventHandler *handler= MEM_callocN(sizeof(wmEventHandler), "event modal handler");
+ handler->op= op;
+ handler->op_area= C->area; /* means frozen screen context for modal handlers! */
+ handler->op_region= C->region;
+
+ BLI_addhead(handlers, handler);
+
+ return handler;
+}
+
+wmEventHandler *WM_event_add_keymap_handler(ListBase *handlers, ListBase *keymap)
+{
+ wmEventHandler *handler;
+
+ /* only allow same keymap once */
+ for(handler= handlers->first; handler; handler= handler->next)
+ if(handler->keymap==keymap)
+ return handler;
+
+ handler= MEM_callocN(sizeof(wmEventHandler), "event keymap handler");
+ BLI_addtail(handlers, handler);
+ handler->keymap= keymap;
+
+ return handler;
+}
+
+wmEventHandler *WM_event_add_keymap_handler_bb(ListBase *handlers, ListBase *keymap, rcti *bblocal, rcti *bbwin)
+{
+ wmEventHandler *handler= WM_event_add_keymap_handler(handlers, keymap);
+ handler->bblocal= bblocal;
+ handler->bbwin= bbwin;
+
+ return handler;
+}
+
+void WM_event_remove_keymap_handler(ListBase *handlers, ListBase *keymap)
+{
+ wmEventHandler *handler;
+
+ for(handler= handlers->first; handler; handler= handler->next) {
+ if(handler->keymap==keymap) {
+ BLI_remlink(handlers, handler);
+ wm_event_free_handler(handler);
+ MEM_freeN(handler);
+ break;
+ }
+ }
+}
+
+wmEventHandler *WM_event_add_ui_handler(bContext *C, ListBase *handlers, wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove)
+{
+ wmEventHandler *handler= MEM_callocN(sizeof(wmEventHandler), "event ui handler");
+ handler->ui_handle= func;
+ handler->ui_remove= remove;
+ handler->ui_area= (C)? C->area: NULL;
+ handler->ui_region= (C)? C->region: NULL;
+
+ BLI_addhead(handlers, handler);
+
+ return handler;
+}
+
+void WM_event_remove_ui_handler(ListBase *handlers)
+{
+ wmEventHandler *handler;
+
+ for(handler= handlers->first; handler; handler= handler->next) {
+ if(handler->ui_handle) {
+ BLI_remlink(handlers, handler);
+ wm_event_free_handler(handler);
+ MEM_freeN(handler);
+ break;
+ }
+ }
+}
+
+void WM_event_add_mousemove(bContext *C)
+{
+ wmEvent event= *(C->window->eventstate);
+ event.type= MOUSEMOVE;
+ event.prevx= event.x;
+ event.prevy= event.y;
+ wm_event_add(C->window, &event);
+}
+
+/* ********************* ghost stuff *************** */
+
+static int convert_key(GHOST_TKey key)
+{
+ if (key>=GHOST_kKeyA && key<=GHOST_kKeyZ) {
+ return (AKEY + ((int) key - GHOST_kKeyA));
+ } else if (key>=GHOST_kKey0 && key<=GHOST_kKey9) {
+ return (ZEROKEY + ((int) key - GHOST_kKey0));
+ } else if (key>=GHOST_kKeyNumpad0 && key<=GHOST_kKeyNumpad9) {
+ return (PAD0 + ((int) key - GHOST_kKeyNumpad0));
+ } else if (key>=GHOST_kKeyF1 && key<=GHOST_kKeyF12) {
+ return (F1KEY + ((int) key - GHOST_kKeyF1));
+ } else {
+ switch (key) {
+ case GHOST_kKeyBackSpace: return BACKSPACEKEY;
+ case GHOST_kKeyTab: return TABKEY;
+ case GHOST_kKeyLinefeed: return LINEFEEDKEY;
+ case GHOST_kKeyClear: return 0;
+ case GHOST_kKeyEnter: return RETKEY;
+
+ case GHOST_kKeyEsc: return ESCKEY;
+ case GHOST_kKeySpace: return SPACEKEY;
+ case GHOST_kKeyQuote: return QUOTEKEY;
+ case GHOST_kKeyComma: return COMMAKEY;
+ case GHOST_kKeyMinus: return MINUSKEY;
+ case GHOST_kKeyPeriod: return PERIODKEY;
+ case GHOST_kKeySlash: return SLASHKEY;
+
+ case GHOST_kKeySemicolon: return SEMICOLONKEY;
+ case GHOST_kKeyEqual: return EQUALKEY;
+
+ case GHOST_kKeyLeftBracket: return LEFTBRACKETKEY;
+ case GHOST_kKeyRightBracket: return RIGHTBRACKETKEY;
+ case GHOST_kKeyBackslash: return BACKSLASHKEY;
+ case GHOST_kKeyAccentGrave: return ACCENTGRAVEKEY;
+
+ case GHOST_kKeyLeftShift: return LEFTSHIFTKEY;
+ case GHOST_kKeyRightShift: return RIGHTSHIFTKEY;
+ case GHOST_kKeyLeftControl: return LEFTCTRLKEY;
+ case GHOST_kKeyRightControl: return RIGHTCTRLKEY;
+ case GHOST_kKeyCommand: return COMMANDKEY;
+ case GHOST_kKeyLeftAlt: return LEFTALTKEY;
+ case GHOST_kKeyRightAlt: return RIGHTALTKEY;
+
+ case GHOST_kKeyCapsLock: return CAPSLOCKKEY;
+ case GHOST_kKeyNumLock: return 0;
+ case GHOST_kKeyScrollLock: return 0;
+
+ case GHOST_kKeyLeftArrow: return LEFTARROWKEY;
+ case GHOST_kKeyRightArrow: return RIGHTARROWKEY;
+ case GHOST_kKeyUpArrow: return UPARROWKEY;
+ case GHOST_kKeyDownArrow: return DOWNARROWKEY;
+
+ case GHOST_kKeyPrintScreen: return 0;
+ case GHOST_kKeyPause: return PAUSEKEY;
+
+ case GHOST_kKeyInsert: return INSERTKEY;
+ case GHOST_kKeyDelete: return DELKEY;
+ case GHOST_kKeyHome: return HOMEKEY;
+ case GHOST_kKeyEnd: return ENDKEY;
+ case GHOST_kKeyUpPage: return PAGEUPKEY;
+ case GHOST_kKeyDownPage: return PAGEDOWNKEY;
+
+ case GHOST_kKeyNumpadPeriod: return PADPERIOD;
+ case GHOST_kKeyNumpadEnter: return PADENTER;
+ case GHOST_kKeyNumpadPlus: return PADPLUSKEY;
+ case GHOST_kKeyNumpadMinus: return PADMINUS;
+ case GHOST_kKeyNumpadAsterisk: return PADASTERKEY;
+ case GHOST_kKeyNumpadSlash: return PADSLASHKEY;
+
+ case GHOST_kKeyGrLess: return GRLESSKEY;
+
+ default:
+ return UNKNOWNKEY; /* GHOST_kKeyUnknown */
+ }
+ }
+}
+
+/* adds customdata to event */
+static void update_tablet_data(wmWindow *win, wmEvent *event)
+{
+ const GHOST_TabletData *td= GHOST_GetTabletData(win->ghostwin);
+
+ /* if there's tablet data from an active tablet device then add it */
+ if ((td != NULL) && td->Active) {
+ struct wmTabletData *wmtab= MEM_mallocN(sizeof(wmTabletData), "customdata tablet");
+
+ wmtab->Active = td->Active;
+ wmtab->Pressure = td->Pressure;
+ wmtab->Xtilt = td->Xtilt;
+ wmtab->Ytilt = td->Ytilt;
+
+ event->custom= EVT_DATA_TABLET;
+ event->customdata= wmtab;
+ event->customdatafree= 1;
+ }
+}
+
+
+/* windows store own event queues, no bContext here */
+void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata)
+{
+ wmEvent event, *evt= win->eventstate;
+
+ /* initialize and copy state (only mouse x y and modifiers) */
+ event= *evt;
+
+ switch (type) {
+ /* mouse move */
+ case GHOST_kEventCursorMove: {
+ if(win->active) {
+ GHOST_TEventCursorData *cd= customdata;
+ int cx, cy;
+
+ GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy);
+
+ event.type= MOUSEMOVE;
+ event.x= evt->x= cx;
+ event.y= evt->y= (win->sizey-1) - cy;
+
+ ED_screen_set_subwinactive(win); /* state variables in screen */
+
+ update_tablet_data(win, &event);
+ wm_event_add(win, &event);
+ }
+ break;
+ }
+ /* mouse button */
+ case GHOST_kEventButtonDown:
+ case GHOST_kEventButtonUp: {
+ GHOST_TEventButtonData *bd= customdata;
+ event.val= (type==GHOST_kEventButtonDown);
+
+ if (bd->button == GHOST_kButtonMaskLeft)
+ event.type= LEFTMOUSE;
+ else if (bd->button == GHOST_kButtonMaskRight)
+ event.type= RIGHTMOUSE;
+ else
+ event.type= MIDDLEMOUSE;
+
+ if(event.val)
+ event.keymodifier= evt->keymodifier= event.type;
+ else
+ event.keymodifier= evt->keymodifier= 0;
+
+ update_tablet_data(win, &event);
+ wm_event_add(win, &event);
+
+ break;
+ }
+ /* keyboard */
+ case GHOST_kEventKeyDown:
+ case GHOST_kEventKeyUp: {
+ GHOST_TEventKeyData *kd= customdata;
+ event.type= convert_key(kd->key);
+ event.ascii= kd->ascii;
+ event.val= (type==GHOST_kEventKeyDown); /* XXX eventmatch uses defines, bad code... */
+
+ /* modifiers */
+ if (event.type==LEFTSHIFTKEY || event.type==RIGHTSHIFTKEY) {
+ event.shift= evt->shift= event.val;
+ } else if (event.type==LEFTCTRLKEY || event.type==RIGHTCTRLKEY) {
+ event.ctrl= evt->ctrl= event.val;
+ } else if (event.type==LEFTALTKEY || event.type==RIGHTALTKEY) {
+ event.alt= evt->alt= event.val;
+ } else if (event.type==COMMANDKEY) {
+ event.oskey= evt->oskey= event.val;
+ }
+
+ wm_event_add(win, &event);
+
+ break;
+ }
+
+ case GHOST_kEventWheel: {
+ GHOST_TEventWheelData* wheelData = customdata;
+
+ if (wheelData->z > 0)
+ event.type= WHEELUPMOUSE;
+ else
+ event.type= WHEELDOWNMOUSE;
+
+ event.val= wheelData->z; /* currently -1 or +1, see ghost for improvements here... */
+ wm_event_add(win, &event);
+
+ break;
+ }
+ case GHOST_kEventTimer: {
+ event.type= TIMER;
+ event.custom= EVT_DATA_TIMER;
+ event.customdata= customdata;
+ wm_event_add(win, &event);
+
+ break;
+ }
+
+ case GHOST_kEventUnknown:
+ case GHOST_kNumEventTypes:
+ break;
+ }
+}
+
diff --git a/source/blender/src/usiblender.c b/source/blender/windowmanager/intern/wm_files.c
index 16c26336b89..75306dc75d8 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1,12 +1,12 @@
/**
- * $Id$
+ * $Id: wm_files.c
*
* ***** 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
@@ -20,9 +20,7 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation 2007
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -30,7 +28,6 @@
/* placed up here because of crappy
* winsock stuff.
*/
-#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -45,132 +42,61 @@
#else
#include <unistd.h> /* getpid */
#endif
+
#include "MEM_guardedalloc.h"
#include "MEM_CacheLimiterC-Api.h"
-#include "BMF_Api.h"
-#include "BIF_language.h"
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif
-
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
#include "BLI_linklist.h"
-#include "IMB_imbuf_types.h"
-#include "IMB_imbuf.h"
-
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_sound_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_text_types.h"
+#include "DNA_windowmanager_types.h"
#include "BKE_blender.h"
-#include "BKE_curve.h"
-#include "BKE_displist.h"
#include "BKE_DerivedMesh.h"
#include "BKE_exotic.h"
#include "BKE_font.h"
#include "BKE_global.h"
+#include "BKE_library.h"
#include "BKE_main.h"
-#include "BKE_mball.h"
-#include "BKE_node.h"
#include "BKE_packedFile.h"
-#include "BKE_suggestions.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
-#include "BKE_pointcache.h"
#ifdef WITH_VERSE
#include "BKE_verse.h"
#endif
-#include "BLI_vfontdata.h"
-
-#include "BIF_fsmenu.h"
-#include "BIF_gl.h"
-#include "BIF_interface.h"
-#include "BIF_usiblender.h"
-#include "BIF_drawtext.h"
-#include "BIF_editaction.h"
-#include "BIF_editarmature.h"
-#include "BIF_editlattice.h"
-#include "BIF_editfont.h"
-#include "BIF_editmesh.h"
-#include "BIF_editmode_undo.h"
-#include "BIF_editsound.h"
-#include "BIF_filelist.h"
-#include "BIF_poseobject.h"
-#include "BIF_previewrender.h"
-#include "BIF_renderwin.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-#include "BIF_toolbox.h"
-#include "BIF_cursors.h"
-
-#ifdef WITH_VERSE
-#include "BIF_verse.h"
-#endif
-
-
-#include "BSE_drawview.h"
-#include "BSE_edit.h"
-#include "BSE_editipo.h"
-#include "BSE_filesel.h"
-#include "BSE_headerbuttons.h"
-#include "BSE_node.h"
-
#include "BLO_readfile.h"
#include "BLO_writefile.h"
-#include "BDR_drawobject.h"
-#include "BDR_editobject.h"
-#include "BDR_editcurve.h"
-#include "BDR_imagepaint.h"
-#include "BDR_vpaint.h"
+#include "ED_datafiles.h"
+#include "ED_screen.h"
-#ifndef DISABLE_PYTHON
-#include "BPY_extern.h"
-#endif
-
-#include "blendef.h"
-
-#include "RE_pipeline.h" /* RE_ free stuff */
-
-#include "radio.h"
-#include "datatoc.h"
-
-#include "SYS_System.h"
-
-#include "PIL_time.h"
+#include "UI_interface.h"
-#include "reeb.h"
+// XXX #include "BPY_extern.h"
-#include "GPU_extensions.h"
-#include "GPU_draw.h"
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm.h"
/***/
/* define for setting colors in theme below */
#define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a;
-/* patching UserDef struct, set globals for UI stuff */
-static void init_userdef_file(void)
+/* patching UserDef struct and Themes */
+static void init_userdef_themes(void)
{
+ // sets themes, fonts, .. from userdef
+ UI_init_userdef();
- BIF_InitTheme(); // sets default again
-
- mainwindow_set_filename_to_title(""); // empty string re-initializes title to "Blender"
- countall();
- G.save_over = 0; // start with save preference untitled.blend
-
- /* disable autoplay in .B.blend... */
- G.fileflags &= ~G_FILE_AUTOPLAY;
+// countall();
/* the UserDef struct is not corrected with do_versions() .... ugh! */
if(U.wheellinescroll == 0) U.wheellinescroll = 3;
@@ -184,11 +110,13 @@ static void init_userdef_file(void)
}
if(U.mixbufsize==0) U.mixbufsize= 2048;
if (BLI_streq(U.tempdir, "/")) {
- BLI_where_is_temp(U.tempdir, 0);
+ char *tmp= getenv("TEMP");
+
+ strcpy(U.tempdir, tmp?tmp:"/tmp/");
}
if (U.savetime <= 0) {
U.savetime = 1;
- error(".B.blend is buggy, please consider removing it.\n");
+// XXX error(".B.blend is buggy, please consider removing it.\n");
}
/* transform widget settings */
if(U.tw_hotspot==0) {
@@ -199,29 +127,9 @@ static void init_userdef_file(void)
if(U.pad_rot_angle==0)
U.pad_rot_angle= 15;
- if (U.ndof_pan==0) {
- U.ndof_pan = 100;
- }
- if (U.ndof_rotate==0) {
- U.ndof_rotate = 100;
- }
- if (U.gp_eraser == 0) {
- U.gp_eraser= 25;
- }
-
if(U.flag & USER_CUSTOM_RANGE)
vDM_ColorBand_store(&U.coba_weight); /* signal for derivedmesh to use colorband */
- /* Auto-keyframing settings */
- if(U.autokey_mode == 0) {
- /* AUTOKEY_MODE_NORMAL - AUTOKEY_ON = x <==> 3 - 1 = 2 */
- U.autokey_mode |= 2;
-
- if(U.flag & (1<<15)) U.autokey_flag |= AUTOKEY_FLAG_INSERTAVAIL;
- if(U.flag & (1<<19)) U.autokey_flag |= AUTOKEY_FLAG_INSERTNEEDED;
- if(G.flags & (1<<30)) U.autokey_flag |= AUTOKEY_FLAG_AUTOMATKEY;
- }
-
if (G.main->versionfile <= 191) {
strcpy(U.plugtexdir, U.textudir);
strcpy(U.sounddir, "/");
@@ -401,7 +309,7 @@ static void init_userdef_file(void)
if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 11)) {
bTheme *btheme;
for (btheme= U.themes.first; btheme; btheme= btheme->next) {
- /* these should all use the same color */
+ /* these should all use the same colour */
SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
SETCOL(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255);
SETCOL(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255);
@@ -411,110 +319,7 @@ static void init_userdef_file(void)
SETCOL(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255);
}
}
- if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 13)) {
- bTheme *btheme;
- for (btheme= U.themes.first; btheme; btheme= btheme->next) {
- /* action channel groups (recolor anyway) */
- SETCOL(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
- SETCOL(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
-
- /* bone custom-color sets */
- // FIXME: this check for initialised colors is bad
- if (btheme->tarm[0].solid[3] == 0) {
- /* set 1 */
- SETCOL(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
- SETCOL(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
- SETCOL(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
- /* set 2 */
- SETCOL(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
- SETCOL(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
- SETCOL(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
- /* set 3 */
- SETCOL(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
- SETCOL(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
- SETCOL(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
- /* set 4 */
- SETCOL(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
- SETCOL(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
- SETCOL(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
- /* set 5 */
- SETCOL(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
- SETCOL(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
- SETCOL(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
- /* set 6 */
- SETCOL(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
- SETCOL(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
- SETCOL(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
- /* set 7 */
- SETCOL(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
- SETCOL(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
- SETCOL(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
- /* set 8 */
- SETCOL(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
- SETCOL(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
- SETCOL(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
- /* set 9 */
- SETCOL(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
- SETCOL(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
- SETCOL(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
- /* set 10 */
- SETCOL(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
- SETCOL(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
- SETCOL(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
- /* set 11 */
- SETCOL(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
- SETCOL(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
- SETCOL(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
- /* set 12 */
- SETCOL(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
- SETCOL(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
- SETCOL(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
- /* set 13 */
- SETCOL(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
- SETCOL(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
- SETCOL(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
- /* set 14 */
- SETCOL(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
- SETCOL(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
- SETCOL(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
- /* set 15 */
- SETCOL(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
- SETCOL(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
- SETCOL(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
- }
- }
- }
- if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) {
- U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
- }
- if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile <= 2)) {
- bTheme *btheme;
-
- /* adjust themes */
- for (btheme= U.themes.first; btheme; btheme= btheme->next) {
- char *col;
-
- /* IPO Editor: Handles/Vertices */
- col = btheme->tipo.vertex;
- SETCOL(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
- col = btheme->tipo.vertex_select;
- SETCOL(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
- btheme->tipo.handle_vertex_size= btheme->tipo.vertex_size;
-
- /* Sequence/Image Editor: colors for GPencil text */
- col = btheme->tv3d.bone_pose;
- SETCOL(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
- SETCOL(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
- col = btheme->tv3d.vertex_select;
- SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
- }
- }
- if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile <= 9)) {
- /* define grease-pencil distances */
- U.gp_manhattendist= 2;
- U.gp_euclideandist= 15;
- }
-
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
@@ -529,95 +334,191 @@ static void init_userdef_file(void)
MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
- reset_autosave();
-
-#ifdef INTERNATIONAL
- read_languagefile();
-#endif
-
- refresh_interface_font();
+ /* funny name, but it is GE stuff, moves userdef stuff to engine */
+// XXX space_set_commmandline_options();
+ /* this timer uses U */
+// XXX reset_autosave();
#ifdef WITH_VERSE
if(strlen(U.versemaster)<1) {
- strcpy(U.versemaster, "master.uni-verse.org");
+ strcpy(U.versemaster, "master.uni-verse.org");
}
if(strlen(U.verseuser)<1) {
- char *name = verse_client_name();
- strcpy(U.verseuser, name);
- MEM_freeN(name);
+// XXX char *name = verse_client_name();
+// XXX strcpy(U.verseuser, name);
+// XXX MEM_freeN(name);
}
#endif
}
-#ifdef WITH_VERSE
-extern ListBase session_list;
-#endif
+/* To be able to read files without windows closing, opening, moving
+ we try to prepare for worst case:
+ - active window gets active screen from file
+ - restoring the screens from non-active windows
+ Best case is all screens match, in that case they get assigned to proper window
+*/
+static void wm_window_match_init(bContext *C, ListBase *wmlist)
+{
+ wmWindowManager *wm= G.main->wm.first;
+ wmWindow *win;
+
+ *wmlist= G.main->wm;
+ G.main->wm.first= G.main->wm.last= NULL;
+
+return;
+ if(wm==NULL) return;
+ if(G.fileflags & G_FILE_NO_UI) return;
+
+ /* we take apart the used screens from non-active window */
+ for(win= wm->windows.first; win; win= win->next) {
+ BLI_strncpy(win->screenname, win->screen->id.name, MAX_ID_NAME);
+ if(win!=C->wm->winactive) {
+ BLI_remlink(&G.main->screen, win->screen);
+ //BLI_addtail(screenbase, win->screen);
+ }
+ }
+}
+
+/* match old WM with new, 4 cases:
+ 1- no current wm, no read wm: make new default
+ 2- no current wm, but read wm: that's OK, do nothing
+ 3- current wm, but not in file: try match screen names
+ 4- current wm, and wm in file: try match ghostwin
-void BIF_read_file(char *name)
+*/
+static void wm_window_match_do(bContext *C, ListBase *wmlist)
{
- extern short winqueue_break; /* editscreen.c */
- int retval;
+ wmWindowManager *oldwm, *wm;
+ wmWindow *oldwin, *win;
+
+ /* cases 1 and 2 */
+ if(wmlist->first==NULL) {
+ if(G.main->wm.first); /* nothing todo */
+ else
+ wm_add_default(C);
+ }
+ else {
+ /* cases 3 and 4 */
+
+ /* we've read file without wm... */
+ if(G.main->wm.first==NULL) {
+ /* match oldwm to new dbase, only old files */
+
+ for(wm= wmlist->first; wm; wm= wm->id.next) {
+ for(win= wm->windows.first; win; win= win->next) {
+ win->screen= (bScreen *)find_id("SR", win->screenname);
+
+ if(win->screen==NULL)
+ win->screen= ED_screen_duplicate(win, C->screen); /* active screen */
+
+ if(win->screen->winid==0)
+ win->screen->winid= win->winid;
+ }
+ }
+ /* XXX still solve, case where multiple windows open */
+
+ G.main->wm= *wmlist;
+ }
+ else {
+ /* what if old was 3, and loaded 1? */
+ /* this code could move to setup_appdata */
+ oldwm= wmlist->first;
+ wm= G.main->wm.first;
+ /* only first wm in list has ghostwins */
+ for(win= wm->windows.first; win; win= win->next) {
+ for(oldwin= oldwm->windows.first; oldwin; oldwin= oldwin->next) {
+
+ if(oldwin->winid == win->winid ) {
+ win->ghostwin= oldwin->ghostwin;
+ oldwin->ghostwin= NULL;
+ }
+ }
+ }
+ wm_close_and_free_all(C, wmlist);
+ }
+ }
+}
+
#ifdef WITH_VERSE
+static void verse_unsub(void)
+{
+ extern ListBase session_list;
struct VerseSession *session;
struct VNode *vnode;
-
+
session = session_list.first;
while(session) {
vnode = session->nodes.lb.first;
while(vnode) {
switch(vnode->type) {
case V_NT_OBJECT:
- unsubscribe_from_obj_node(vnode);
+//XXX unsubscribe_from_obj_node(vnode);
break;
case V_NT_GEOMETRY:
- unsubscribe_from_geom_node(vnode);
+//XXX unsubscribe_from_geom_node(vnode);
break;
case V_NT_BITMAP:
- unsubscribe_from_bitmap_node(vnode);
+//XXX unsubscribe_from_bitmap_node(vnode);
break;
}
vnode = vnode->next;
}
session = session->next;
}
+}
#endif
- /* first try to read exotic file formats... */
+void WM_read_file(bContext *C, char *name)
+{
+ int retval;
+
+#ifdef WITH_VERSE
+ verse_unsub(); /* bad call here (ton) */
+#endif
+
+ /* first try to append data from exotic file formats... */
/* it throws error box when file doesnt exist and returns -1 */
retval= BKE_read_exotic(name);
+ /* we didn't succeed, now try to read Blender file */
if (retval== 0) {
- BIF_clear_tempfiles();
+ ListBase wmbase;
+
+ /* put aside screens to match with persistant windows later */
+ wm_window_match_init(C, &wmbase);
- /* we didn't succeed, now try to read Blender file */
- retval= BKE_read_file(name, NULL);
+ retval= BKE_read_file(C, name, NULL);
- mainwindow_set_filename_to_title(G.main->name);
- countall();
- sound_initialize_sounds();
+ /* match the read WM with current WM */
+ wm_window_match_do(C, &wmbase);
+
+// XXX mainwindow_set_filename_to_title(G.main->name);
+// countall(); <-- will be listener
+// XXX sound_initialize_sounds();
- winqueue_break= 1; /* leave queues everywhere */
+// winqueue_break= 1; /* leave queues everywhere */
- if(retval==2) init_userdef_file(); // in case a userdef is read from regular .blend
+// XXX if(retval==2) init_userdef_themes(); // in case a userdef is read from regular .blend
if (retval!=0) G.relbase_valid = 1;
- undo_editmode_clear();
- undo_imagepaint_clear();
+// XXX undo_editmode_clear();
BKE_reset_undo();
- BKE_write_undo("Original"); /* save current state */
+ BKE_write_undo(C, "original"); /* save current state */
- refresh_interface_font();
+// refresh_interface_font();
}
- else if(retval==1)
- BIF_undo_push("Import file");
+// else if(retval==1)
+// XXX BIF_undo_push("Import file");
}
static void outliner_242_patch(void)
{
ScrArea *sa;
+// XXX
+ if(G.curscreen==NULL) return;
for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
SpaceLink *sl= sa->spacedata.first;
for(; sl; sl= sl->next) {
@@ -625,7 +526,7 @@ static void outliner_242_patch(void)
SpaceOops *soops= (SpaceOops *)sl;
if(soops->type!=SO_OUTLINER) {
soops->type= SO_OUTLINER;
- init_v2d_oops(sa, soops);
+// XXX init_v2d_oops(sa, soops);
}
}
}
@@ -633,61 +534,59 @@ static void outliner_242_patch(void)
G.fileflags |= G_FILE_GAME_MAT;
}
-/* only here settings for fullscreen */
-int BIF_read_homefile(int from_memory)
+/* called on startup, (context entirely filled with NULLs) */
+/* or called for 'Erase All' */
+int WM_read_homefile(bContext *C, int from_memory)
{
- char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAX];
+ ListBase wmbase;
+ char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
char *home= BLI_gethome();
int success;
- struct TmpFont *tf;
-
- BIF_clear_tempfiles();
BLI_clean(home);
-
- tf= G.ttfdata.first;
- while(tf)
- {
- freePackedFile(tf->pf);
- tf->pf = NULL;
- tf->vfont = NULL;
- tf= tf->next;
- }
- BLI_freelistN(&G.ttfdata);
+
+ free_ttfont(); /* still weird... what does it here? */
G.relbase_valid = 0;
if (!from_memory) BLI_make_file_string(G.sce, tstr, home, ".B.blend");
- BLI_strncpy(scestr, G.sce, FILE_MAX); /* temporal store */
+ strcpy(scestr, G.sce); /* temporary store */
/* prevent loading no UI */
G.fileflags &= ~G_FILE_NO_UI;
+ /* put aside screens to match with persistant windows later */
+ wm_window_match_init(C, &wmbase);
+
if (!from_memory && BLI_exists(tstr)) {
- success = BKE_read_file(tstr, NULL);
+ success = BKE_read_file(C, tstr, NULL);
} else {
- success = BKE_read_file_from_memory(datatoc_B_blend, datatoc_B_blend_size, NULL);
+ success = BKE_read_file_from_memory(C, datatoc_B_blend, datatoc_B_blend_size, NULL);
/* outliner patch for 2.42 .b.blend */
outliner_242_patch();
}
-
- BLI_clean(scestr);
- strcpy(G.sce, scestr);
-
- space_set_commmandline_options();
- init_userdef_file();
+ /* match the read WM with current WM */
+ wm_window_match_do(C, &wmbase);
+
+ strcpy(G.sce, scestr); /* restore */
- undo_editmode_clear();
- undo_imagepaint_clear();
- BKE_reset_undo();
- BKE_write_undo("Original"); /* save current state */
+ init_userdef_themes();
+
+ /* XXX */
+ G.save_over = 0; // start with save preference untitled.blend
+ G.fileflags &= ~G_FILE_AUTOPLAY; /* disable autoplay in .B.blend... */
+// mainwindow_set_filename_to_title(""); // empty string re-initializes title to "Blender"
-#ifndef DISABLE_PYTHON
- /* if from memory, need to refresh python scripts */
- if (from_memory) {
- BPY_path_update();
- }
+#ifdef INTERNATIONAL
+// XXX read_languagefile();
#endif
+
+// refresh_interface_font();
+
+// undo_editmode_clear();
+ BKE_reset_undo();
+ BKE_write_undo(C, "original"); /* save current state */
+
return success;
}
@@ -703,7 +602,7 @@ static void get_autosave_location(char buf[FILE_MAXDIR+FILE_MAXFILE])
sprintf(pidstr, "%d.blend", abs(getpid()));
#ifdef WIN32
- if (!BLI_exists(btempdir)) {
+ if (!BLI_exists(U.tempdir)) {
BLI_strncpy(subdir, "autosave", sizeof(subdir));
BLI_make_file_string("/", savedir, BLI_gethome(), subdir);
@@ -716,10 +615,10 @@ static void get_autosave_location(char buf[FILE_MAXDIR+FILE_MAXFILE])
}
#endif
- BLI_make_file_string("/", buf, btempdir, pidstr);
+ BLI_make_file_string("/", buf, U.tempdir, pidstr);
}
-void BIF_read_autosavefile(void)
+void WM_read_autosavefile(bContext *C)
{
char tstr[FILE_MAX], scestr[FILE_MAX];
int save_over;
@@ -729,23 +628,13 @@ void BIF_read_autosavefile(void)
get_autosave_location(tstr);
save_over = G.save_over;
- BKE_read_file(tstr, NULL);
+ BKE_read_file(C, tstr, NULL);
G.save_over = save_over;
BLI_strncpy(G.sce, scestr, FILE_MAX);
}
-/* free strings of open recent files */
-static void free_openrecent(void)
-{
- struct RecentFile *recent;
-
- for(recent = G.recent_files.first; recent; recent=recent->next)
- MEM_freeN(recent->filename);
- BLI_freelistN(&(G.recent_files));
-}
-
-static void readBlog(void)
+void read_Blog(void)
{
char name[FILE_MAX], filename[FILE_MAX];
LinkNode *l, *lines;
@@ -796,23 +685,20 @@ static void readBlog(void)
tmps[2]='\\';
tmps[3]=0;
- fsmenu_insert_entry(tmps, 0, 0);
+// XX fsmenu_insert_entry(tmps, 0, 0);
}
}
/* Adding Desktop and My Documents */
- fsmenu_append_separator();
+// XXX fsmenu_append_separator();
SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0);
- fsmenu_insert_entry(folder, 0, 0);
+// XXX fsmenu_insert_entry(folder, 0, 0);
SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0);
- fsmenu_insert_entry(folder, 0, 0);
+// XXX fsmenu_insert_entry(folder, 0, 0);
- fsmenu_append_separator();
+// XXX fsmenu_append_separator();
}
-#else
- /* add home dir on linux systems */
- fsmenu_insert_entry(BLI_gethome(), 0, 0);
#endif
BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs");
@@ -822,16 +708,16 @@ static void readBlog(void)
char *line= l->link;
if (!BLI_streq(line, "")) {
- fsmenu_insert_entry(line, 0, 1);
+// XXX fsmenu_insert_entry(line, 0, 1);
}
}
- fsmenu_append_separator();
+// XXX fsmenu_append_separator();
/* add last saved file */
- BLI_split_dirfile_basic(G.sce, name, filename); /* G.sce shouldn't be relative */
+ BLI_split_dirfile(G.sce, name, filename); /* G.sce shouldn't be relative */
- fsmenu_insert_entry(name, 0, 0);
+// XXX fsmenu_insert_entry(name, 0, 0);
BLI_free_file_lines(lines);
}
@@ -892,8 +778,8 @@ static void do_history(char *name)
sprintf(tempname1, "%s%d", name, hisnr-1);
sprintf(tempname2, "%s%d", name, hisnr);
- if(BLI_rename(tempname1, tempname2))
- error("Unable to make version backup");
+// if(BLI_rename(tempname1, tempname2))
+// XXX error("Unable to make version backup");
hisnr--;
}
@@ -901,11 +787,11 @@ static void do_history(char *name)
/* is needed when hisnr==1 */
sprintf(tempname1, "%s%d", name, hisnr);
- if(BLI_rename(name, tempname1))
- error("Unable to make version backup");
+// if(BLI_rename(name, tempname1))
+// XXX error("Unable to make version backup");
}
-void BIF_write_file(char *target)
+void WM_write_file(bContext *C, char *target)
{
Library *li;
int writeflags, len;
@@ -916,18 +802,16 @@ void BIF_write_file(char *target)
if (len == 0) return;
if (len >= FILE_MAX) {
- error("Path too long, cannot save");
+// XXX error("Path too long, cannot save");
return;
}
-#ifndef DISABLE_PYTHON
/* send the OnSave event */
- if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript(&G.scene->id, SCRIPT_ONSAVE);
-#endif
+// XXX if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript(&C->scene->id, SCRIPT_ONSAVE);
for (li= G.main->library.first; li; li= li->id.next) {
- if (li->parent==NULL && BLI_streq(li->name, target)) {
- error("Cannot overwrite used library");
+ if (BLI_streq(li->name, target)) {
+// XXX error("Cannot overwrite used library");
return;
}
}
@@ -939,18 +823,18 @@ void BIF_write_file(char *target)
}
if (BLI_exists(di)) {
- if(!saveover(di))
- return;
+// XXX if(!saveover(di))
+// XXX return;
}
if(G.obedit) {
- exit_editmode(0); /* 0 = no free data */
+// XXX exit_editmode(0); /* 0 = no free data */
}
if (G.fileflags & G_AUTOPACK) {
packAll();
}
- waitcursor(1); // exit_editmode sets cursor too
+// XXX waitcursor(1); // exit_editmode sets cursor too
do_history(di);
@@ -959,24 +843,25 @@ void BIF_write_file(char *target)
if(U.flag & USER_FILECOMPRESS)
writeflags |= G_FILE_COMPRESS;
- if (BLO_write_file(di, writeflags, &err)) {
+ if (BLO_write_file(C, di, writeflags, &err)) {
strcpy(G.sce, di);
G.relbase_valid = 1;
- BLI_strncpy(G.main->name, di, FILE_MAX); /* is guaranteed current file */
+ strcpy(G.main->name, di); /* is guaranteed current file */
- mainwindow_set_filename_to_title(G.main->name);
+// XXX mainwindow_set_filename_to_title(G.main->name);
G.save_over = 1;
writeBlog();
} else {
- error("failed to write blend file: %s", err);
+// XXX error("%s", err);
}
- waitcursor(0);
+// XXX waitcursor(0);
}
-void BIF_write_homefile(void)
+/* operator entry */
+int WM_write_homefile(bContext *C, wmOperator *op)
{
char *err, tstr[FILE_MAXDIR+FILE_MAXFILE];
int write_flags;
@@ -985,13 +870,12 @@ void BIF_write_homefile(void)
/* force save as regular blend file */
write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
+ BLO_write_file(C, tstr, write_flags, &err);
- if (!BLO_write_file(tstr, write_flags, &err)) {
- error("failed writing defaults: %s", err);
- }
+ return OPERATOR_FINISHED;
}
-void BIF_write_autosave(void)
+void WM_write_autosave(bContext *C)
{
char *err, tstr[FILE_MAXDIR+FILE_MAXFILE];
int write_flags;
@@ -1000,23 +884,11 @@ void BIF_write_autosave(void)
/* force save as regular blend file */
write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
- if (!BLO_write_file(tstr, write_flags, &err)) {
- fprintf(stderr, "failed to write autosave: %s\n", err); /* using error(...) is too annoying here */
- }
-}
-
-/* remove temp files assosiated with this blend file when quitting, loading or saving in a new path */
-void BIF_clear_tempfiles( void )
-{
- /* TODO - remove exr files from the temp dir */
-
- if (!G.relbase_valid) { /* We could have pointcache saved in tyhe temp dir, if its there */
- BKE_ptcache_remove();
- }
+ BLO_write_file(C, tstr, write_flags, &err);
}
/* if global undo; remove tempsave, otherwise rename */
-static void delete_autosave(void)
+void delete_autosave(void)
{
char tstr[FILE_MAXDIR+FILE_MAXFILE];
@@ -1024,7 +896,7 @@ static void delete_autosave(void)
if (BLI_exists(tstr)) {
char str[FILE_MAXDIR+FILE_MAXFILE];
- BLI_make_file_string("/", str, btempdir, "quit.blend");
+ BLI_make_file_string("/", str, U.tempdir, "quit.blend");
if(U.uiflag & USER_GLOBALUNDO) BLI_delete(tstr, 0, 0);
else BLI_rename(tstr, str);
@@ -1033,195 +905,7 @@ static void delete_autosave(void)
/***/
-static void initbuttons(void)
-{
- uiDefFont(UI_HELVB,
- BMF_GetFont(BMF_kHelveticaBold14),
- BMF_GetFont(BMF_kHelveticaBold12),
- BMF_GetFont(BMF_kHelveticaBold10),
- BMF_GetFont(BMF_kHelveticaBold8));
- uiDefFont(UI_HELV,
- BMF_GetFont(BMF_kHelvetica12),
- BMF_GetFont(BMF_kHelvetica12),
- BMF_GetFont(BMF_kHelvetica10),
- BMF_GetFont(BMF_kHelveticaBold8));
-
- glClearColor(.7f, .7f, .6f, 0.0);
-
- G.font= BMF_GetFont(BMF_kHelvetica12);
- G.fonts= BMF_GetFont(BMF_kHelvetica10);
- G.fontss= BMF_GetFont(BMF_kHelveticaBold8);
-
- clear_matcopybuf();
-
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-}
-
-static void sound_init_listener(void)
-{
- G.listener = MEM_callocN(sizeof(bSoundListener), "soundlistener");
- G.listener->gain = 1.0;
- G.listener->dopplerfactor = 1.0;
- G.listener->dopplervelocity = 340.29f;
-}
-
-void BIF_init(void)
-{
- initscreen(); /* for (visuele) speed, this first, then setscreen */
- initbuttons();
- InitCursorData();
- sound_init_listener();
- init_node_butfuncs();
-
- BIF_preview_init_dbase();
- BIF_read_homefile(0);
- BIF_resources_init(); /* after homefile, to dynamically load an icon file based on theme settings */
-
- BIF_filelist_init_icons();
- GPU_state_init();
- GPU_extensions_init();
-
- readBlog();
- BLI_strncpy(G.lib, G.sce, FILE_MAX);
-}
-
-/***/
-
-extern ListBase editNurb;
-extern ListBase editelems;
-
-void exit_usiblender(void)
-{
- struct TmpFont *tf;
- int totblock;
-
- BIF_clear_tempfiles();
-
- BIF_GlobalReebFree();
- BIF_freeRetarget();
-
- tf= G.ttfdata.first;
- while(tf)
- {
- freePackedFile(tf->pf);
- tf->pf= NULL;
- tf->vfont= NULL;
- tf= tf->next;
- }
- BLI_freelistN(&G.ttfdata);
-#ifdef WITH_VERSE
- end_all_verse_sessions();
-#endif
- free_openrecent();
-
- freeAllRad();
- BKE_freecubetable();
-
- if (G.background == 0)
- sound_end_all_sounds();
-
- if(G.obedit) {
- if(G.obedit->type==OB_FONT) {
- free_editText();
- }
- else if(G.obedit->type==OB_MBALL) BLI_freelistN(&editelems);
- free_editMesh(G.editMesh);
- }
-
- free_editLatt();
- free_editArmature();
- free_posebuf();
-
-#ifndef DISABLE_PYTHON
- /* before free_blender so py's gc happens while library still exists */
- /* needed at least for a rare sigsegv that can happen in pydrivers */
- BPY_end_python();
-#endif
-
- fastshade_free_render(); /* shaded view */
- free_blender(); /* blender.c, does entire library */
- free_matcopybuf();
- free_ipocopybuf();
- free_actcopybuf();
- free_gpcopybuf();
- free_vertexpaint();
- free_texttools();
-
- /* editnurb can remain to exist outside editmode */
- freeNurblist(&editNurb);
-
- fsmenu_free();
-
-#ifdef INTERNATIONAL
- free_languagemenu();
-#endif
-
- RE_FreeAllRender();
-
- free_txt_data();
-
- sound_exit_audio();
- if(G.listener) MEM_freeN(G.listener);
-
- GPU_extensions_exit();
-
- libtiff_exit();
-
-#ifdef WITH_QUICKTIME
- quicktime_exit();
-#endif
-
- /* undo free stuff */
- undo_editmode_clear();
- undo_imagepaint_clear();
-
- BKE_undo_save_quit(); // saves quit.blend if global undo is on
- BKE_reset_undo();
-
- if (!G.background) {
- BIF_resources_free();
-
- BIF_filelist_free_icons();
-
- BIF_free_render_spare();
- BIF_close_render_display();
- mainwindow_close();
- }
-
-#ifdef INTERNATIONAL
- FTF_End();
-#endif
-
- if (copybuf) MEM_freeN(copybuf);
- if (copybufinfo) MEM_freeN(copybufinfo);
-
-//
- BLI_freelistN(&U.themes);
- BIF_preview_free_dbase();
-
- totblock= MEM_get_memory_blocks_in_use();
- if(totblock!=0) {
- printf("Error Totblock: %d\n",totblock);
- MEM_printmemlist();
- }
- delete_autosave();
-
- printf("\nBlender quit\n");
-
-#ifdef WIN32
- /* ask user to press enter when in debug mode */
- if(G.f & G_DEBUG) {
- printf("press enter key to exit...\n\n");
- getchar();
- }
-#endif
-
-
- SYS_DeleteSystem(SYS_GetSystem());
-
- exit(G.afbreek==1);
-}
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
new file mode 100644
index 00000000000..ba8da93495c
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -0,0 +1,202 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+#include "DNA_screen_types.h"
+#include "DNA_vec_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "wm_event_system.h"
+#include "wm_subwindow.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+
+/* context checked on having screen, window and area */
+wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
+{
+ wmGesture *gesture= MEM_callocN(sizeof(wmGesture), "new gesture");
+ int sx, sy;
+
+ BLI_addtail(&C->window->gesture, gesture);
+
+ gesture->type= type;
+ gesture->event_type= event->type;
+ gesture->swinid= C->screen->subwinactive; /* means only in area-region context! */
+
+ wm_subwindow_getorigin(C->window, gesture->swinid, &sx, &sy);
+
+ if( ELEM3(type, WM_GESTURE_RECT, WM_GESTURE_CROSS_RECT, WM_GESTURE_TWEAK)) {
+ rcti *rect= MEM_callocN(sizeof(rcti), "gesture rect new");
+
+ gesture->customdata= rect;
+ rect->xmin= event->x - sx;
+ rect->ymin= event->y - sy;
+ rect->xmax= event->x - sx;
+ rect->ymax= event->y - sy;
+ }
+
+ return gesture;
+}
+
+void WM_gesture_end(bContext *C, wmGesture *gesture)
+{
+ BLI_remlink(&C->window->gesture, gesture);
+ MEM_freeN(gesture->customdata);
+ MEM_freeN(gesture);
+}
+
+/* for line, lasso, ... */
+void wm_gesture_point_add(bContext *C, wmGesture *gesture)
+{
+
+}
+
+/* tweak and line gestures */
+#define TWEAK_THRESHOLD 10
+int wm_gesture_evaluate(bContext *C, wmGesture *gesture)
+{
+ if(gesture->type==WM_GESTURE_TWEAK) {
+ rcti *rect= gesture->customdata;
+ int dx= rect->xmax - rect->xmin;
+ int dy= rect->ymax - rect->ymin;
+ if(ABS(dx)+ABS(dy) > TWEAK_THRESHOLD) {
+ int theta= (int)floor(4.0f*atan2((float)dy, (float)dx)/M_PI + 0.5);
+ int val= EVT_GESTURE_W;
+
+ if(theta==0) val= EVT_GESTURE_E;
+ else if(theta==1) val= EVT_GESTURE_NE;
+ else if(theta==2) val= EVT_GESTURE_N;
+ else if(theta==3) val= EVT_GESTURE_NW;
+ else if(theta==-1) val= EVT_GESTURE_SE;
+ else if(theta==-2) val= EVT_GESTURE_S;
+ else if(theta==-3) val= EVT_GESTURE_SW;
+
+#if 0
+ /* debug */
+ if(val==1) printf("tweak north\n");
+ if(val==2) printf("tweak north-east\n");
+ if(val==3) printf("tweak east\n");
+ if(val==4) printf("tweak south-east\n");
+ if(val==5) printf("tweak south\n");
+ if(val==6) printf("tweak south-west\n");
+ if(val==7) printf("tweak west\n");
+ if(val==8) printf("tweak north-west\n");
+#endif
+ return val;
+ }
+ }
+ return 0;
+}
+
+
+/* ******************* gesture draw ******************* */
+
+static void wm_gesture_draw_rect(wmWindow *win, wmGesture *gt)
+{
+ rcti *rect= (rcti *)gt->customdata;
+
+ glEnable(GL_LINE_STIPPLE);
+ glColor3ub(0, 0, 0);
+ glLineStipple(1, 0xCCCC);
+ sdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+ glColor3ub(255, 255, 255);
+ glLineStipple(1, 0x3333);
+ sdrawbox(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+ glDisable(GL_LINE_STIPPLE);
+}
+
+static void wm_gesture_draw_line(wmWindow *win, wmGesture *gt)
+{
+ rcti *rect= (rcti *)gt->customdata;
+
+ glEnable(GL_LINE_STIPPLE);
+ glColor3ub(0, 0, 0);
+ glLineStipple(1, 0xAAAA);
+ sdrawline(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+ glColor3ub(255, 255, 255);
+ glLineStipple(1, 0x5555);
+ sdrawline(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+
+ glDisable(GL_LINE_STIPPLE);
+
+}
+
+static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
+{
+ rcti *rect= (rcti *)gt->customdata;
+
+ glEnable(GL_LINE_STIPPLE);
+ glColor3ub(0, 0, 0);
+ glLineStipple(1, 0xCCCC);
+ sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
+ sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+
+ glColor3ub(255, 255, 255);
+ glLineStipple(1, 0x3333);
+ sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
+ sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+ glDisable(GL_LINE_STIPPLE);
+}
+
+/* called in wm_event_system.c */
+void wm_gesture_draw(wmWindow *win)
+{
+ wmGesture *gt= (wmGesture *)win->gesture.first;
+
+ for(; gt; gt= gt->next) {
+ /* all in subwindow space */
+ wm_subwindow_set(win, gt->swinid);
+
+ if(gt->type==WM_GESTURE_RECT)
+ wm_gesture_draw_rect(win, gt);
+ else if(gt->type==WM_GESTURE_TWEAK)
+ wm_gesture_draw_line(win, gt);
+ else if(gt->type==WM_GESTURE_CROSS_RECT) {
+ if(gt->mode==1)
+ wm_gesture_draw_rect(win, gt);
+ else
+ wm_gesture_draw_cross(win, gt);
+ }
+ }
+}
+
+
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
new file mode 100644
index 00000000000..db37f0754a0
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -0,0 +1,286 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+#include "MEM_CacheLimiterC-Api.h"
+
+#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_sound_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BKE_blender.h"
+#include "BKE_curve.h"
+#include "BKE_displist.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_font.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_mball.h"
+#include "BKE_utildefines.h"
+#include "BKE_packedFile.h"
+
+#include "BMF_Api.h"
+#ifdef INTERNATIONAL
+#include "FTF_Api.h"
+#endif
+
+#include "BLI_blenlib.h"
+
+#include "RE_pipeline.h" /* RE_ free stuff */
+
+#include "radio.h"
+
+#include "BPY_extern.h"
+
+#include "SYS_System.h"
+
+#include "UI_interface.h"
+
+#include "RNA_define.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_event_system.h"
+#include "wm.h"
+#include "wm_files.h"
+#include "wm_window.h"
+
+#include "ED_screen.h"
+
+static void initbuttons(void)
+{
+ UI_init();
+
+// glClearColor(.7f, .7f, .6f, 0.0);
+
+ G.font= BMF_GetFont(BMF_kHelvetica12);
+ G.fonts= BMF_GetFont(BMF_kHelvetica10);
+ G.fontss= BMF_GetFont(BMF_kHelveticaBold8);
+
+// clear_matcopybuf(); /* XXX */
+
+// glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+}
+
+/* XXX */
+static void sound_init_listener(void)
+{
+ G.listener = MEM_callocN(sizeof(bSoundListener), "soundlistener");
+ G.listener->gain = 1.0;
+ G.listener->dopplerfactor = 1.0;
+ G.listener->dopplervelocity = 340.29f;
+}
+
+/* only called once, for startup */
+void WM_init(bContext *C)
+{
+
+ wm_ghost_init(C); /* note: it assigns C to ghost! */
+ wm_operatortype_init();
+
+ set_free_windowmanager_cb(wm_close_and_free); /* library.c */
+
+ ED_spacetypes_init(); /* editors/area/spacetype.c */
+
+ /* get the default database, plus a wm */
+ WM_read_homefile(C, 0);
+
+ wm_check(C); /* opens window(s), checks keymaps */
+
+// initscreen(); /* for (visual) speed, this first, then setscreen */
+ initbuttons();
+// InitCursorData();
+ sound_init_listener();
+// init_node_butfuncs();
+
+// XXX BIF_preview_init_dbase();
+
+// XXX UI_filelist_init_icons();
+
+// init_gl_stuff(); /* drawview.c, after homefile */
+ read_Blog();
+ BLI_strncpy(G.lib, G.sce, FILE_MAX);
+}
+
+/* free strings of open recent files */
+static void free_openrecent(void)
+{
+ struct RecentFile *recent;
+
+ for(recent = G.recent_files.first; recent; recent=recent->next)
+ MEM_freeN(recent->filename);
+
+ BLI_freelistN(&(G.recent_files));
+}
+
+
+/* bad stuff*/
+
+extern ListBase editNurb;
+extern ListBase editelems;
+extern wchar_t *copybuf;
+extern wchar_t *copybufinfo;
+
+/* called in creator.c even... tsk, split this! */
+void WM_exit(bContext *C)
+{
+ wmWindow *win;
+
+ /* first wrap up running stuff, we assume only the active WM is running */
+ /* modal handlers are on window level freed, others too? */
+ if(C && C->wm) {
+ for(win= C->wm->windows.first; win; win= win->next) {
+ ARegion *ar;
+
+ C->window= win; /* needed by operator close callbacks */
+ WM_event_remove_handlers(C, &win->handlers);
+
+ for(ar= win->screen->regionbase.first; ar; ar= ar->next)
+ WM_event_remove_handlers(C, &ar->handlers);
+
+ ED_screen_exit(C, win, win->screen);
+ }
+ }
+ wm_operatortype_free();
+
+ free_ttfont(); /* bke_font.h */
+
+#ifdef WITH_VERSE
+ end_all_verse_sessions();
+#endif
+ free_openrecent();
+
+ freeAllRad();
+ BKE_freecubetable();
+
+// if (G.background == 0)
+// sound_end_all_sounds();
+
+ if(G.obedit) {
+ if(G.obedit->type==OB_FONT) {
+// free_editText();
+ }
+// else if(G.obedit->type==OB_MBALL) BLI_freelistN(&editelems);
+// free_editMesh(G.editMesh);
+ }
+
+// free_editLatt();
+// free_editArmature();
+// free_posebuf();
+
+ /* before free_blender so py's gc happens while library still exists */
+ /* needed at least for a rare sigsegv that can happen in pydrivers */
+// BPY_end_python();
+
+// fastshade_free_render(); /* shaded view */
+ free_blender(); /* blender.c, does entire library */
+// free_matcopybuf();
+// free_ipocopybuf();
+// free_actcopybuf();
+// free_vertexpaint();
+// free_imagepaint();
+
+ /* editnurb can remain to exist outside editmode */
+ freeNurblist(&editNurb);
+
+// fsmenu_free();
+
+#ifdef INTERNATIONAL
+// free_languagemenu();
+#endif
+
+ RE_FreeAllRender();
+
+// free_txt_data();
+
+// sound_exit_audio();
+ if(G.listener) MEM_freeN(G.listener);
+
+
+ libtiff_exit();
+
+#ifdef WITH_QUICKTIME
+ quicktime_exit();
+#endif
+
+ if (!G.background) {
+// XXX UI_filelist_free_icons();
+ }
+
+#ifdef INTERNATIONAL
+ FTF_End();
+#endif
+
+// if (copybuf) MEM_freeN(copybuf);
+// if (copybufinfo) MEM_freeN(copybufinfo);
+
+ /* undo free stuff */
+// undo_editmode_clear();
+
+ BKE_undo_save_quit(); // saves quit.blend if global undo is on
+ BKE_reset_undo();
+
+ UI_exit();
+ BLI_freelistN(&U.themes);
+// XXX BIF_preview_free_dbase();
+
+ RNA_exit();
+
+ MEM_freeN(C);
+
+ if(MEM_get_memory_blocks_in_use()!=0) {
+ printf("Error Totblock: %d\n", MEM_get_memory_blocks_in_use());
+ MEM_printmemlist();
+ }
+// delete_autosave();
+
+ printf("\nBlender quit\n");
+
+#ifdef WIN32
+ /* ask user to press enter when in debug mode */
+ if(G.f & G_DEBUG) {
+ printf("press enter key to exit...\n\n");
+ getchar();
+ }
+#endif
+
+
+ SYS_DeleteSystem(SYS_GetSystem());
+
+ exit(G.afbreek==1);
+}
+
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
new file mode 100644
index 00000000000..439f5c304d1
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -0,0 +1,147 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm_window.h"
+#include "wm_event_system.h"
+#include "wm_event_types.h"
+
+/* ***************** generic call, exported **************** */
+
+static void keymap_set(wmKeymapItem *kmi, short type, short val, int modifier, short keymodifier)
+{
+ kmi->type= type;
+ kmi->val= val;
+ kmi->keymodifier= keymodifier;
+
+ if(modifier & KM_SHIFT)
+ kmi->shift= 1;
+ else if(modifier & KM_SHIFT2)
+ kmi->shift= 2;
+ if(modifier & KM_CTRL)
+ kmi->ctrl= 1;
+ else if(modifier & KM_CTRL2)
+ kmi->ctrl= 2;
+ if(modifier & KM_ALT)
+ kmi->alt= 1;
+ else if(modifier & KM_ALT2)
+ kmi->alt= 2;
+ if(modifier & KM_OSKEY)
+ kmi->oskey= 1;
+ else if(modifier & KM_OSKEY2)
+ kmi->oskey= 2;
+}
+
+/* if item was added, then bail out */
+void WM_keymap_verify_item(ListBase *lb, char *idname, short type, short val, int modifier, short keymodifier)
+{
+ wmKeymapItem *kmi;
+
+ for(kmi= lb->first; kmi; kmi= kmi->next)
+ if(strncmp(kmi->idname, idname, OP_MAX_TYPENAME)==0)
+ break;
+ if(kmi==NULL) {
+ kmi= MEM_callocN(sizeof(wmKeymapItem), "keymap entry");
+
+ BLI_addtail(lb, kmi);
+ BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME);
+
+ keymap_set(kmi, type, val, modifier, keymodifier);
+ }
+
+}
+
+/* if item was added, then replace */
+void WM_keymap_set_item(ListBase *lb, char *idname, short type, short val, int modifier, short keymodifier)
+{
+ wmKeymapItem *kmi;
+
+ for(kmi= lb->first; kmi; kmi= kmi->next)
+ if(strncmp(kmi->idname, idname, OP_MAX_TYPENAME)==0)
+ break;
+ if(kmi==NULL) {
+ kmi= MEM_callocN(sizeof(wmKeymapItem), "keymap entry");
+
+ BLI_addtail(lb, kmi);
+ BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME);
+ }
+ keymap_set(kmi, type, val, modifier, keymodifier);
+}
+
+/* always add item */
+void WM_keymap_add_item(ListBase *lb, char *idname, short type, short val, int modifier, short keymodifier)
+{
+ wmKeymapItem *kmi= MEM_callocN(sizeof(wmKeymapItem), "keymap entry");
+
+ BLI_addtail(lb, kmi);
+ BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME);
+
+ keymap_set(kmi, type, val, modifier, keymodifier);
+}
+
+/* ****************** storage in WM ************ */
+
+/* name id's are for storing general or multiple keymaps,
+ space/region ids are same as DNA_space_types.h */
+/* gets free'd in wm.c */
+
+ListBase *WM_keymap_listbase(wmWindowManager *wm, const char *nameid, int spaceid, int regionid)
+{
+ wmKeyMap *km;
+
+ for(km= wm->keymaps.first; km; km= km->next)
+ if(km->spaceid==spaceid && km->regionid==regionid)
+ if(0==strncmp(nameid, km->nameid, KMAP_MAX_NAME))
+ break;
+
+ if(km==NULL) {
+ km= MEM_callocN(sizeof(struct wmKeyMap), "keymap list");
+ BLI_strncpy(km->nameid, nameid, KMAP_MAX_NAME);
+ km->spaceid= spaceid;
+ km->regionid= regionid;
+ printf("added keymap %s %d %d\n", nameid, spaceid, regionid);
+ BLI_addtail(&wm->keymaps, km);
+ }
+
+ return &km->keymap;
+}
+
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
new file mode 100644
index 00000000000..5dd36d737b1
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -0,0 +1,363 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <string.h>
+
+#include "DNA_ID.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+#include "BKE_idprop.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_utildefines.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "wm.h"
+#include "wm_window.h"
+#include "wm_subwindow.h"
+#include "wm_event_system.h"
+
+static ListBase global_ops= {NULL, NULL};
+
+/* ************ operator API, exported ********** */
+
+wmOperatorType *WM_operatortype_find(const char *idname)
+{
+ wmOperatorType *ot;
+
+ for(ot= global_ops.first; ot; ot= ot->next) {
+ if(strncmp(ot->idname, idname, OP_MAX_TYPENAME)==0)
+ return ot;
+ }
+ printf("search for unknown operator %s\n", idname);
+ return NULL;
+}
+
+/* all ops in 1 list (for time being... needs evaluation later) */
+void WM_operatortype_append(void (*opfunc)(wmOperatorType*))
+{
+ wmOperatorType *ot;
+
+ ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
+ ot->srna= RNA_def_struct(&BLENDER_RNA, "", "Operator", "");
+ opfunc(ot);
+ RNA_def_struct_identifier(ot->srna, ot->idname, ot->name);
+ BLI_addtail(&global_ops, ot);
+}
+
+/* ************ default op callbacks, exported *********** */
+
+int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event)
+{
+// if(okee(op->type->name)) {
+// return op->type->exec(C, op);
+// }
+ return 0;
+}
+int WM_operator_winactive(bContext *C)
+{
+ if(C->window==NULL) return 0;
+ return 1;
+}
+
+/* ************ window / screen operator definitions ************** */
+
+static void WM_OT_window_duplicate(wmOperatorType *ot)
+{
+ ot->name= "Duplicate Window";
+ ot->idname= "WM_OT_window_duplicate";
+
+ ot->invoke= NULL; //WM_operator_confirm;
+ ot->exec= wm_window_duplicate_op;
+ ot->poll= WM_operator_winactive;
+}
+
+static void WM_OT_save_homefile(wmOperatorType *ot)
+{
+ ot->name= "Save User Settings";
+ ot->idname= "WM_OT_save_homefile";
+
+ ot->invoke= NULL; //WM_operator_confirm;
+ ot->exec= WM_write_homefile;
+ ot->poll= WM_operator_winactive;
+
+ ot->flag= OPTYPE_REGISTER;
+}
+
+static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
+{
+ ot->name= "Toggle Fullscreen";
+ ot->idname= "WM_OT_window_fullscreen_toggle";
+
+ ot->invoke= NULL;
+ ot->exec= wm_window_fullscreen_toggle_op;
+ ot->poll= WM_operator_winactive;
+}
+
+static void WM_OT_exit_blender(wmOperatorType *ot)
+{
+ ot->name= "Exit Blender";
+ ot->idname= "WM_OT_exit_blender";
+
+ ot->invoke= NULL; /* do confirm stuff */
+ ot->exec= wm_exit_blender_op;
+ ot->poll= WM_operator_winactive;
+}
+
+/* ************ window gesture operator-callback definitions ************** */
+/*
+ * These are default callbacks for use in operators requiring gesture input
+ */
+
+/* **************** Border gesture *************** */
+
+/* Border gesture has two types:
+ 1) WM_GESTURE_CROSS_RECT: starts a cross, on mouse click it changes to border
+ 2) WM_GESTURE_RECT: starts immediate as a border, on mouse click or release it ends
+
+ It stores 4 values (xmin, xmax, ymin, ymax) and event it ended with (event_type)
+*/
+
+static void border_select_apply(bContext *C, wmOperator *op, int event_type)
+{
+ wmGesture *gesture= op->customdata;
+ rcti *rect= gesture->customdata;
+
+ if(rect->xmin > rect->xmax)
+ SWAP(int, rect->xmin, rect->xmax);
+ if(rect->ymin > rect->ymax)
+ SWAP(int, rect->ymin, rect->ymax);
+
+ /* operator arguments and storage. */
+ RNA_int_set(op->ptr, "xmin", rect->xmin);
+ RNA_int_set(op->ptr, "ymin", rect->ymin);
+ RNA_int_set(op->ptr, "xmax", rect->xmax);
+ RNA_int_set(op->ptr, "ymax", rect->ymax);
+
+ RNA_int_set(op->ptr, "event_type", event_type);
+
+ op->type->exec(C, op);
+}
+
+static void border_select_end(bContext *C, wmOperator *op)
+{
+ wmGesture *gesture= op->customdata;
+
+ WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
+ op->customdata= NULL;
+
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+}
+
+int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ op->customdata= WM_gesture_new(C, event, WM_GESTURE_CROSS_RECT);
+
+ /* add modal handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ wmGesture *gesture= op->customdata;
+ rcti *rect= gesture->customdata;
+ int sx, sy;
+
+ switch(event->type) {
+ case MOUSEMOVE:
+
+ wm_subwindow_getorigin(C->window, gesture->swinid, &sx, &sy);
+
+ if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) {
+ rect->xmin= rect->xmax= event->x - sx;
+ rect->ymin= rect->ymax= event->y - sy;
+ }
+ else {
+ rect->xmax= event->x - sx;
+ rect->ymax= event->y - sy;
+ }
+
+ WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+
+ break;
+
+ case LEFTMOUSE:
+ case MIDDLEMOUSE:
+ case RIGHTMOUSE:
+ if(event->val==1) {
+ if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) {
+ gesture->mode= 1;
+ WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+ }
+ }
+ else {
+ border_select_apply(C, op, event->type);
+ border_select_end(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ case ESCKEY:
+ border_select_end(C, op);
+ return OPERATOR_CANCELLED;
+ }
+ return OPERATOR_RUNNING_MODAL;
+}
+
+/* **************** Tweak gesture *************** */
+
+static int tweak_gesture_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ op->customdata= WM_gesture_new(C, event, WM_GESTURE_TWEAK);
+
+ /* add modal handler */
+ WM_event_add_modal_handler(C, &C->window->handlers, op);
+
+ WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static void tweak_gesture_end(bContext *C, wmOperator *op)
+{
+ wmGesture *gesture= op->customdata;
+
+ WM_gesture_end(C, gesture); /* frees gesture itself, and unregisters from window */
+ op->customdata= NULL;
+
+ WM_event_add_notifier(C, WM_NOTE_AREA_REDRAW, 0, NULL);
+
+}
+
+static int tweak_gesture_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ wmGesture *gesture= op->customdata;
+ rcti *rect= gesture->customdata;
+ int sx, sy, val;
+
+ switch(event->type) {
+ case MOUSEMOVE:
+
+ wm_subwindow_getorigin(C->window, gesture->swinid, &sx, &sy);
+
+ rect->xmax= event->x - sx;
+ rect->ymax= event->y - sy;
+
+ if((val= wm_gesture_evaluate(C, gesture))) {
+ wmEvent event;
+
+ event= *(C->window->eventstate);
+ if(gesture->event_type==LEFTMOUSE)
+ event.type= EVT_TWEAK_L;
+ else if(gesture->event_type==RIGHTMOUSE)
+ event.type= EVT_TWEAK_R;
+ else
+ event.type= EVT_TWEAK_M;
+ event.val= val;
+ /* mouse coords! */
+ wm_event_add(C->window, &event);
+
+ tweak_gesture_end(C, op);
+ return OPERATOR_FINISHED;
+ }
+ else
+ WM_event_add_notifier(C, WM_NOTE_GESTURE_REDRAW, 0, NULL);
+
+ break;
+
+ case LEFTMOUSE:
+ case RIGHTMOUSE:
+ case MIDDLEMOUSE:
+ if(gesture->event_type==event->type) {
+ wm_gesture_evaluate(C, gesture);
+ tweak_gesture_end(C, op);
+ return OPERATOR_FINISHED;
+ }
+ break;
+ }
+ return OPERATOR_RUNNING_MODAL;
+}
+
+void WM_OT_tweak_gesture(wmOperatorType *ot)
+{
+ ot->name= "Tweak Gesture";
+ ot->idname= "WM_OT_tweak_gesture";
+
+ ot->invoke= tweak_gesture_invoke;
+ ot->modal= tweak_gesture_modal;
+
+ ot->poll= WM_operator_winactive;
+}
+
+
+/* ******************************************************* */
+
+/* called on initialize WM_exit() */
+void wm_operatortype_free(void)
+{
+ BLI_freelistN(&global_ops);
+}
+
+/* called on initialize WM_init() */
+void wm_operatortype_init(void)
+{
+ WM_operatortype_append(WM_OT_window_duplicate);
+ WM_operatortype_append(WM_OT_save_homefile);
+ WM_operatortype_append(WM_OT_window_fullscreen_toggle);
+ WM_operatortype_append(WM_OT_exit_blender);
+ WM_operatortype_append(WM_OT_tweak_gesture);
+}
+
+/* default keymap for windows and screens, only call once per WM */
+void wm_window_keymap(wmWindowManager *wm)
+{
+ ListBase *keymap= WM_keymap_listbase(wm, "Window", 0, 0);
+
+ /* note, this doesn't replace existing keymap items */
+ WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", FKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
+}
+
diff --git a/source/blender/windowmanager/intern/wm_report.c b/source/blender/windowmanager/intern/wm_report.c
new file mode 100644
index 00000000000..3be991e12e4
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_report.c
@@ -0,0 +1,134 @@
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_global.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef _WIN32
+#ifndef vsnprintf
+#define vsnprintf _vsnprintf
+#endif
+#endif
+
+static int wmReportLevel= WM_LOG_INFO;
+static int wmReportPrint= 0;
+
+static const char *wm_report_type_str(int type)
+{
+ switch(type) {
+ case WM_LOG_DEBUG: return "Debug";
+ case WM_LOG_INFO: return "Info";
+ case WM_LOG_WARNING: return "Warning";
+ case WM_ERROR_UNDEFINED: return "Error";
+ case WM_ERROR_INVALID_INPUT: return "Invalid Input Error";
+ case WM_ERROR_INVALID_CONTEXT: return "Invalid Context Error";
+ case WM_ERROR_OUT_OF_MEMORY: return "Out Of Memory Error";
+ default: return "Undefined Type";
+ }
+}
+
+static void wm_print_report(wmReport *report)
+{
+ printf("%s: %s\n", report->typestr, report->message);
+ fflush(stdout); /* this ensures the message is printed before a crash */
+}
+
+void WM_report(bContext *C, int type, const char *message)
+{
+ wmReport *report;
+ int len;
+
+ if(!C->wm) {
+ fprintf(stderr, "WM_report: can't report without windowmanager.\n");
+ return;
+ }
+ if(type < wmReportLevel)
+ return;
+
+ report= MEM_callocN(sizeof(wmReport), "wmReport");
+ report->type= type;
+ report->typestr= wm_report_type_str(type);
+
+ len= strlen(message);
+ report->message= MEM_callocN(sizeof(char)*(len+1), "wmReportMessage");
+ memcpy(report->message, message, sizeof(char)*(len+1));
+
+ if(wmReportPrint)
+ wm_print_report(report);
+
+ BLI_addtail(&C->wm->reports, report);
+}
+
+void WM_reportf(bContext *C, int type, const char *format, ...)
+{
+ wmReport *report;
+ va_list args;
+ char *message;
+ int len= 256, maxlen= 65536, retval;
+
+ if(!C->wm) {
+ fprintf(stderr, "WM_report: can't report without windowmanager.\n");
+ return;
+ }
+ if(type < wmReportLevel)
+ return;
+
+ while(1) {
+ message= MEM_callocN(sizeof(char)*len+1, "wmReportMessage");
+
+ va_start(args, format);
+ retval= vsnprintf(message, len, format, args);
+ va_end(args);
+
+ if(retval == -1) {
+ /* -1 means not enough space, but on windows it may also mean
+ * there is a formatting error, so we impose a maximum length */
+ MEM_freeN(message);
+ message= NULL;
+
+ len *= 2;
+ if(len > maxlen) {
+ fprintf(stderr, "WM_report message too long or format error.\n");
+ break;
+ }
+ }
+ else if(retval > len) {
+ /* in C99 the actual length required is returned */
+ MEM_freeN(message);
+ message= NULL;
+
+ len= retval;
+ }
+ else
+ break;
+ }
+
+ if(message) {
+ report= MEM_callocN(sizeof(wmReport), "wmReport");
+ report->type= type;
+ report->typestr= wm_report_type_str(type);
+ report->message= message;
+
+ if(wmReportPrint)
+ wm_print_report(report);
+
+ BLI_addtail(&C->wm->reports, report);
+ }
+}
+
+void wm_report_free(wmReport *report)
+{
+ MEM_freeN(report->message);
+ MEM_freeN(report);
+}
+
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
new file mode 100644
index 00000000000..cfd111d355c
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -0,0 +1,528 @@
+/**
+ * $Id: mywindow.c 9584 2007-01-03 13:45:03Z ton $
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributor(s): 2007 Blender Foundation (refactor)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ *
+ * Subwindow opengl handling.
+ * BTW: subwindows open/close in X11 are way too slow, tried it, and choose for my own system... (ton)
+ *
+ */
+
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_windowmanager_types.h"
+#include "DNA_screen_types.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BKE_global.h"
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "WM_api.h"
+#include "wm_subwindow.h"
+#include "wm_window.h"
+
+/* wmSubWindow stored in wmWindow... but not exposed outside this C file */
+/* it seems a bit redundant (area regions can store it too, but we keep it
+ because we can store all kind of future opengl fanciness here */
+
+/* we use indices and array because:
+ - index has safety, no pointers from this C file hanging around
+ - fast lookups of indices with array, list would give overhead
+ - old code used it this way...
+ - keep option open to have 2 screens using same window
+*/
+
+typedef struct wmSubWindow {
+ struct wmSubWindow *next, *prev;
+
+ rcti winrct;
+ int swinid;
+
+ float viewmat[4][4], winmat[4][4];
+} wmSubWindow;
+
+
+/* ******************* open, free, set, get data ******************** */
+
+/* not subwindow itself */
+static void wm_subwindow_free(wmSubWindow *swin)
+{
+ /* future fancy stuff */
+}
+
+void wm_subwindows_free(wmWindow *win)
+{
+ wmSubWindow *swin;
+
+ for(swin= win->subwindows.first; swin; swin= swin->next)
+ wm_subwindow_free(swin);
+
+ BLI_freelistN(&win->subwindows);
+}
+
+
+int wm_subwindow_get(wmWindow *win)
+{
+ if(win->curswin)
+ return win->curswin->swinid;
+ return 0;
+}
+
+static wmSubWindow *swin_from_swinid(wmWindow *win, int swinid)
+{
+ wmSubWindow *swin;
+
+ for(swin= win->subwindows.first; swin; swin= swin->next)
+ if(swin->swinid==swinid)
+ break;
+ return swin;
+}
+
+void wm_subwindow_getsize(wmWindow *win, int swinid, int *x, int *y)
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+
+ if(swin) {
+ *x= swin->winrct.xmax - swin->winrct.xmin + 1;
+ *y= swin->winrct.ymax - swin->winrct.ymin + 1;
+ }
+}
+
+void wm_subwindow_getorigin(wmWindow *win, int swinid, int *x, int *y)
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+
+ if(swin) {
+ *x= swin->winrct.xmin;
+ *y= swin->winrct.ymin;
+ }
+}
+
+void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4])
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+
+ if(swin)
+ Mat4MulMat4(mat, swin->viewmat, swin->winmat);
+}
+
+void wm_subwindow_set(wmWindow *win, int swinid)
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+ int width, height;
+
+ if(swin==NULL) {
+ printf("wm_subwindow_set %d: doesn't exist\n", swinid);
+ return;
+ }
+
+ win->curswin= swin;
+ wm_subwindow_getsize(win, swinid, &width, &height);
+
+ glViewport(swin->winrct.xmin, swin->winrct.ymin, width, height);
+ glScissor(swin->winrct.xmin, swin->winrct.ymin, width, height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadMatrixf(&swin->winmat[0][0]);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadMatrixf(&swin->viewmat[0][0]);
+
+ glFlush();
+
+}
+
+/* always sets pixel-precise 2D window/view matrices */
+/* coords is in whole pixels. xmin = 15, xmax= 16: means window is 2 pix big */
+int wm_subwindow_open(wmWindow *win, rcti *winrct)
+{
+ wmSubWindow *swin;
+ int width, height;
+ int freewinid= 1;
+
+ for(swin= win->subwindows.first; swin; swin= swin->next)
+ if(freewinid <= swin->swinid)
+ freewinid= swin->swinid+1;
+
+ win->curswin= swin= MEM_callocN(sizeof(wmSubWindow), "swinopen");
+ BLI_addtail(&win->subwindows, swin);
+
+ if(G.f & G_DEBUG) printf("swin %d added\n", freewinid);
+ swin->swinid= freewinid;
+ swin->winrct= *winrct;
+
+ Mat4One(swin->viewmat);
+ Mat4One(swin->winmat);
+
+ /* and we appy it all right away */
+ wm_subwindow_set(win, swin->swinid);
+
+ /* extra service */
+ wm_subwindow_getsize(win, swin->swinid, &width, &height);
+ wmOrtho2(win, -0.375, (float)width-0.375, -0.375, (float)height-0.375);
+ wmLoadIdentity(win);
+
+ return swin->swinid;
+}
+
+
+void wm_subwindow_close(wmWindow *win, int swinid)
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+
+ if (swin) {
+ if (swin==win->curswin)
+ win->curswin= NULL;
+ wm_subwindow_free(swin);
+ BLI_remlink(&win->subwindows, swin);
+ MEM_freeN(swin);
+ }
+ else {
+ printf("wm_subwindow_close: Internal error, bad winid: %d\n", swinid);
+ }
+
+}
+
+/* pixels go from 0-99 for a 100 pixel window */
+void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct)
+{
+ wmSubWindow *swin= swin_from_swinid(win, swinid);
+
+ if(swin) {
+ int width, height;
+
+ swin->winrct= *winrct;
+
+ /* CRITICAL, this clamping ensures that
+ * the viewport never goes outside the screen
+ * edges (assuming the x, y coords aren't
+ * outside). This caused a hardware lock
+ * on Matrox cards if it happens.
+ *
+ * Really Blender should never _ever_ try
+ * to do such a thing, but just to be safe
+ * clamp it anyway (or fix the bScreen
+ * scaling routine, and be damn sure you
+ * fixed it). - zr (2001!)
+ */
+
+ if (swin->winrct.xmax >= win->sizex)
+ swin->winrct.xmax= win->sizex-1;
+ if (swin->winrct.ymax >= win->sizey)
+ swin->winrct.ymax= win->sizey-1;
+
+ /* extra service */
+ wm_subwindow_set(win, swinid);
+ wm_subwindow_getsize(win, swinid, &width, &height);
+ wmOrtho2(win, -0.375, (float)width-0.375, -0.375, (float)height-0.375);
+ }
+ else {
+ printf("wm_subwindow_position: Internal error, bad winid: %d\n", swinid);
+ }
+}
+
+/* ---------------- WM versions of OpenGL calls, using glBlah() syntax ------------------------ */
+/* ----------------- exported in WM_api.h ------------------------------------------------------ */
+
+
+void wmLoadMatrix(wmWindow *win, float mat[][4])
+{
+ if(win->curswin==NULL) return;
+
+ glLoadMatrixf(mat);
+
+ if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW)
+ Mat4CpyMat4(win->curswin->viewmat, mat);
+ else
+ Mat4CpyMat4(win->curswin->winmat, mat);
+}
+
+void wmGetMatrix(wmWindow *win, float mat[][4])
+{
+ if(win->curswin==NULL) return;
+
+ if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) {
+ Mat4CpyMat4(mat, win->curswin->viewmat);
+ } else {
+ Mat4CpyMat4(mat, win->curswin->winmat);
+ }
+}
+
+void wmMultMatrix(wmWindow *win, float mat[][4])
+{
+ if(win->curswin==NULL) return;
+
+ glMultMatrixf((float*) mat);
+
+ if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW)
+ glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->curswin->viewmat);
+ else
+ glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->curswin->winmat);
+}
+
+void wmGetSingleMatrix(wmWindow *win, float mat[][4])
+{
+ if(win->curswin)
+ Mat4MulMat4(mat, win->curswin->viewmat, win->curswin->winmat);
+}
+
+void wmScale(wmWindow *win, float x, float y, float z)
+{
+ if(win->curswin==NULL) return;
+
+ glScalef(x, y, z);
+
+ if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW)
+ glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->curswin->viewmat);
+ else
+ glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->curswin->winmat);
+
+}
+
+void wmLoadIdentity(wmWindow *win)
+{
+ if(win->curswin==NULL) return;
+
+ if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW)
+ Mat4One(win->curswin->viewmat);
+ else
+ Mat4One(win->curswin->winmat);
+
+ glLoadIdentity();
+}
+
+void wmFrustum(wmWindow *win, float x1, float x2, float y1, float y2, float n, float f)
+{
+ if(win->curswin) {
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(x1, x2, y1, y2, n, f);
+
+ glGetFloatv(GL_PROJECTION_MATRIX, (float *)win->curswin->winmat);
+ glMatrixMode(GL_MODELVIEW);
+ }
+}
+
+void wmOrtho(wmWindow *win, float x1, float x2, float y1, float y2, float n, float f)
+{
+ if(win->curswin) {
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+
+ glOrtho(x1, x2, y1, y2, n, f);
+
+ glGetFloatv(GL_PROJECTION_MATRIX, (float *)win->curswin->winmat);
+ glMatrixMode(GL_MODELVIEW);
+ }
+}
+
+void wmOrtho2(wmWindow *win, float x1, float x2, float y1, float y2)
+{
+ /* prevent opengl from generating errors */
+ if(x1==x2) x2+=1.0;
+ if(y1==y2) y2+=1.0;
+ wmOrtho(win, x1, x2, y1, y2, -100, 100);
+}
+
+
+/* *************************** Framebuffer color depth, for selection codes ********************** */
+
+static int wm_get_colordepth(void)
+{
+ static int mainwin_color_depth= 0;
+
+ if(mainwin_color_depth==0) {
+ GLint r, g, b;
+
+ glGetIntegerv(GL_RED_BITS, &r);
+ glGetIntegerv(GL_GREEN_BITS, &g);
+ glGetIntegerv(GL_BLUE_BITS, &b);
+
+ mainwin_color_depth= r + g + b;
+ if(G.f & G_DEBUG) {
+ printf("Color depth r %d g %d b %d\n", (int)r, (int)g, (int)b);
+ glGetIntegerv(GL_AUX_BUFFERS, &r);
+ printf("Aux buffers: %d\n", (int)r);
+ }
+ }
+ return mainwin_color_depth;
+}
+
+
+#ifdef __APPLE__
+
+/* apple seems to round colors to below and up on some configs */
+
+static unsigned int index_to_framebuffer(int index)
+{
+ unsigned int i= index;
+
+ switch(wm_get_colordepth()) {
+ case 12:
+ i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
+ /* sometimes dithering subtracts! */
+ i |= 0x070707;
+ break;
+ case 15:
+ case 16:
+ i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
+ i |= 0x030303;
+ break;
+ case 24:
+ break;
+ default: // 18 bits...
+ i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
+ i |= 0x010101;
+ break;
+ }
+
+ return i;
+}
+
+#else
+
+/* this is the old method as being in use for ages.... seems to work? colors are rounded to lower values */
+
+static unsigned int index_to_framebuffer(int index)
+{
+ unsigned int i= index;
+
+ switch(wm_get_colordepth()) {
+ case 8:
+ i= ((i & 48)<<18) + ((i & 12)<<12) + ((i & 3)<<6);
+ i |= 0x3F3F3F;
+ break;
+ case 12:
+ i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4);
+ /* sometimes dithering subtracts! */
+ i |= 0x0F0F0F;
+ break;
+ case 15:
+ case 16:
+ i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
+ i |= 0x070707;
+ break;
+ case 24:
+ break;
+ default: // 18 bits...
+ i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
+ i |= 0x030303;
+ break;
+ }
+
+ return i;
+}
+
+#endif
+
+void set_framebuffer_index_color(int index)
+{
+ cpack(index_to_framebuffer(index));
+}
+
+int framebuffer_to_index(unsigned int col)
+{
+ if (col==0) return 0;
+
+ switch(wm_get_colordepth()) {
+ case 8:
+ return ((col & 0xC00000)>>18) + ((col & 0xC000)>>12) + ((col & 0xC0)>>6);
+ case 12:
+ return ((col & 0xF00000)>>12) + ((col & 0xF000)>>8) + ((col & 0xF0)>>4);
+ case 15:
+ case 16:
+ return ((col & 0xF80000)>>9) + ((col & 0xF800)>>6) + ((col & 0xF8)>>3);
+ case 24:
+ return col & 0xFFFFFF;
+ default: // 18 bits...
+ return ((col & 0xFC0000)>>6) + ((col & 0xFC00)>>4) + ((col & 0xFC)>>2);
+ }
+}
+
+
+/* ********** END MY WINDOW ************** */
+
+#ifdef WIN32
+static int is_a_really_crappy_nvidia_card(void) {
+ static int well_is_it= -1;
+
+ /* Do you understand the implication? Do you? */
+ if (well_is_it==-1)
+ well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0);
+
+ return well_is_it;
+}
+#endif
+
+void myswapbuffers(void) /* XXX */
+{
+ ScrArea *sa;
+
+ sa= G.curscreen->areabase.first;
+ while(sa) {
+// if(sa->win_swap==WIN_BACK_OK) sa->win_swap= WIN_FRONT_OK;
+// if(sa->head_swap==WIN_BACK_OK) sa->head_swap= WIN_FRONT_OK;
+
+ sa= sa->next;
+ }
+
+ /* HACK, some windows drivers feel they should honor the scissor
+ * test when swapping buffers, disable the test while swapping
+ * on WIN32. (namely Matrox and NVidia's new drivers around Oct 1 2001)
+ * - zr
+ */
+
+#ifdef WIN32
+ /* HACK, in some NVidia driver release some kind of
+ * fancy optimiziation (I presume) was put in which for
+ * some reason causes parts of the buffer not to be
+ * swapped. One way to defeat it is the following wierd
+ * code (which we only do for nvidia cards). This should
+ * be removed if NVidia fixes their drivers. - zr
+ */
+ if (is_a_really_crappy_nvidia_card()) {
+ glDrawBuffer(GL_FRONT);
+
+ glBegin(GL_LINES);
+ glEnd();
+
+ glDrawBuffer(GL_BACK);
+ }
+
+ glDisable(GL_SCISSOR_TEST);
+// window_swap_buffers(winlay_mainwindow);
+ glEnable(GL_SCISSOR_TEST);
+#else
+// window_swap_buffers(winlay_mainwindow);
+#endif
+}
+
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
new file mode 100644
index 00000000000..644f1a95c8e
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -0,0 +1,582 @@
+/**
+ * $Id: wm_window.c
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation but based
+ * on ghostwinlay.c (C) 2001-2002 by NaN Holding BV
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation, 2008
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "DNA_listBase.h"
+#include "DNA_screen_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "GHOST_C-api.h"
+
+#include "BLI_blenlib.h"
+
+#include "BKE_blender.h"
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "BIF_gl.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+#include "wm.h"
+#include "wm_window.h"
+#include "wm_subwindow.h"
+#include "wm_event_system.h"
+
+#include "ED_screen.h"
+
+/* the global to talk to ghost */
+GHOST_SystemHandle g_system= NULL;
+
+/* set by commandline */
+static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0;
+
+
+/* ******** win open & close ************ */
+
+
+static void wm_get_screensize(int *width_r, int *height_r)
+{
+ unsigned int uiwidth;
+ unsigned int uiheight;
+
+ GHOST_GetMainDisplayDimensions(g_system, &uiwidth, &uiheight);
+ *width_r= uiwidth;
+ *height_r= uiheight;
+}
+
+static void wm_ghostwindow_destroy(wmWindow *win)
+{
+ if(win->ghostwin) {
+ GHOST_DisposeWindow(g_system, win->ghostwin);
+ win->ghostwin= NULL;
+ }
+}
+
+/* including window itself, C can be NULL.
+ ED_screen_exit should have been called */
+void wm_window_free(bContext *C, wmWindow *win)
+{
+ /* update context */
+ if(C) {
+ if(C->wm->windrawable==win)
+ C->wm->windrawable= NULL;
+ if(C->wm->winactive==win)
+ C->wm->winactive= NULL;
+ if(C->window==win)
+ C->window= NULL;
+ if(C->screen==win->screen)
+ C->screen= NULL;
+ }
+
+ if(win->eventstate) MEM_freeN(win->eventstate);
+
+ wm_event_free_all(win);
+ wm_subwindows_free(win);
+
+ wm_ghostwindow_destroy(win);
+
+ MEM_freeN(win);
+}
+
+static int find_free_winid(wmWindowManager *wm)
+{
+ wmWindow *win;
+ int id= 0;
+
+ for(win= wm->windows.first; win; win= win->next)
+ if(id <= win->winid)
+ id= win->winid+1;
+
+ return id;
+}
+
+/* dont change context itself */
+wmWindow *wm_window_new(bContext *C)
+{
+ wmWindow *win= MEM_callocN(sizeof(wmWindow), "window");
+
+ BLI_addtail(&C->wm->windows, win);
+ win->winid= find_free_winid(C->wm);
+
+ return win;
+}
+
+
+/* part of wm_window.c api */
+wmWindow *wm_window_copy(bContext *C, wmWindow *winorig)
+{
+ wmWindow *win= wm_window_new(C);
+
+ win->posx= winorig->posx+10;
+ win->posy= winorig->posy;
+ win->sizex= winorig->sizex;
+ win->sizey= winorig->sizey;
+
+ win->screen= ED_screen_duplicate(win, winorig->screen);
+ win->screen->do_refresh= 1;
+ win->screen->do_draw= 1;
+
+ return win;
+}
+
+/* this is event from ghost */
+static void wm_window_close(bContext *C, wmWindow *win)
+{
+ BLI_remlink(&C->wm->windows, win);
+
+ ED_screen_exit(C, win, win->screen);
+ wm_window_free(C, win);
+
+ if(C->wm->windows.first==NULL)
+ WM_exit(C);
+}
+
+/* belongs to below */
+static void wm_window_add_ghostwindow(wmWindowManager *wm, char *title, wmWindow *win)
+{
+ GHOST_WindowHandle ghostwin;
+ GHOST_TWindowState inital_state;
+ int scr_w, scr_h, posy;
+
+ wm_get_screensize(&scr_w, &scr_h);
+ posy= (scr_h - win->posy - win->sizey);
+
+ // inital_state = GHOST_kWindowStateFullScreen;
+ // inital_state = GHOST_kWindowStateMaximized;
+ inital_state = GHOST_kWindowStateNormal;
+
+#ifdef __APPLE__
+ {
+ extern int macPrefState; /* creator.c */
+ inital_state += macPrefState;
+ }
+#endif
+
+ ghostwin= GHOST_CreateWindow(g_system, title,
+ win->posx, posy, win->sizex, win->sizey,
+ inital_state,
+ GHOST_kDrawingContextTypeOpenGL,
+ 0 /* no stereo */);
+
+ if (ghostwin) {
+ ListBase *keymap;
+
+ win->ghostwin= ghostwin;
+ GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
+
+ if(win->eventstate==NULL)
+ win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state");
+
+ /* add keymap handlers (1 handler for all keys in map!) */
+ keymap= WM_keymap_listbase(wm, "Window", 0, 0);
+ WM_event_add_keymap_handler(&win->handlers, keymap);
+
+ keymap= WM_keymap_listbase(wm, "Screen", 0, 0);
+ WM_event_add_keymap_handler(&win->handlers, keymap);
+
+ /* until screens get drawn, make it nice grey */
+ glClearColor(.55, .55, .55, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ wm_window_swap_buffers(win);
+
+ /* standard state vars for window */
+ glEnable(GL_SCISSOR_TEST);
+ }
+}
+
+/* for wmWindows without ghostwin, open these and clear */
+/* window size is read from window, if 0 it uses prefsize */
+void wm_window_add_ghostwindows(wmWindowManager *wm)
+{
+ wmWindow *win;
+
+ /* no commandline prefsize? then we set this */
+ if (!prefsizx) {
+ wm_get_screensize(&prefsizx, &prefsizy);
+
+#ifdef __APPLE__
+ {
+ extern void wm_set_apple_prefsize(int, int); /* wm_apple.c */
+
+ wm_set_apple_prefsize(prefsizx, prefsizy);
+ }
+#else
+ prefstax= 0;
+ prefstay= 0;
+
+#endif
+ }
+
+ for(win= wm->windows.first; win; win= win->next) {
+ if(win->ghostwin==NULL) {
+ if(win->sizex==0) {
+ win->posx= prefstax;
+ win->posy= prefstay;
+ win->sizex= prefsizx;
+ win->sizey= prefsizy;
+ win->windowstate= 0;
+ }
+ wm_window_add_ghostwindow(wm, "Blender", win);
+ }
+ }
+}
+
+/* new window, no screen yet, but we open ghostwindow for it */
+/* also gets the window level handlers */
+/* area-rip calls this */
+wmWindow *WM_window_open(bContext *C, rcti *rect)
+{
+ wmWindow *win= wm_window_new(C);
+
+ win->posx= rect->xmin;
+ win->posy= rect->ymin;
+ win->sizex= rect->xmax - rect->xmin;
+ win->sizey= rect->ymax - rect->ymin;
+
+ wm_window_add_ghostwindow(C->wm, "Blender", win);
+
+ return win;
+}
+
+
+/* ****************** Operators ****************** */
+
+/* operator callback */
+int wm_window_duplicate_op(bContext *C, wmOperator *op)
+{
+ wm_window_copy(C, C->window);
+ wm_check(C);
+
+ return OPERATOR_FINISHED;
+}
+
+
+/* fullscreen operator callback */
+int wm_window_fullscreen_toggle_op(bContext *C, wmOperator *op)
+{
+ GHOST_TWindowState state = GHOST_GetWindowState(C->window->ghostwin);
+ if(state!=GHOST_kWindowStateFullScreen)
+ GHOST_SetWindowState(C->window->ghostwin, GHOST_kWindowStateFullScreen);
+ else
+ GHOST_SetWindowState(C->window->ghostwin, GHOST_kWindowStateNormal);
+
+ return OPERATOR_FINISHED;
+
+}
+
+
+/* exit blender */
+int wm_exit_blender_op(bContext *C, wmOperator *op)
+{
+ wmWindow *win= C->wm->windows.first;
+ while(win) {
+ wm_window_close(C, win);
+ win= win->next;
+ }
+
+ return OPERATOR_FINISHED;
+}
+
+
+/* ************ events *************** */
+
+static int query_qual(char qual)
+{
+ GHOST_TModifierKeyMask left, right;
+ int val= 0;
+
+ if (qual=='s') {
+ left= GHOST_kModifierKeyLeftShift;
+ right= GHOST_kModifierKeyRightShift;
+ } else if (qual=='c') {
+ left= GHOST_kModifierKeyLeftControl;
+ right= GHOST_kModifierKeyRightControl;
+ } else if (qual=='C') {
+ left= right= GHOST_kModifierKeyCommand;
+ } else {
+ left= GHOST_kModifierKeyLeftAlt;
+ right= GHOST_kModifierKeyRightAlt;
+ }
+
+ GHOST_GetModifierKeyState(g_system, left, &val);
+ if (!val)
+ GHOST_GetModifierKeyState(g_system, right, &val);
+
+ return val;
+}
+
+void wm_window_make_drawable(bContext *C, wmWindow *win)
+{
+ if (win != C->wm->windrawable && win->ghostwin) {
+// win->lmbut= 0; /* keeps hanging when mousepressed while other window opened */
+
+ C->wm->windrawable= win;
+ if(G.f & G_DEBUG) printf("set drawable %d\n", win->winid);
+ GHOST_ActivateWindowDrawingContext(win->ghostwin);
+ }
+}
+
+/* called by ghost, here we handle events for windows themselves or send to event system */
+static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
+{
+ bContext *C= private;
+ GHOST_TEventType type= GHOST_GetEventType(evt);
+
+ if (type == GHOST_kEventQuit) {
+ WM_exit(C);
+ } else {
+ GHOST_WindowHandle ghostwin= GHOST_GetEventWindow(evt);
+ GHOST_TEventDataPtr data= GHOST_GetEventData(evt);
+ wmWindow *win;
+
+ if (!ghostwin) {
+ // XXX - should be checked, why are we getting an event here, and
+ // what is it?
+
+ return 1;
+ } else if (!GHOST_ValidWindow(g_system, ghostwin)) {
+ // XXX - should be checked, why are we getting an event here, and
+ // what is it?
+
+ return 1;
+ } else {
+ win= GHOST_GetWindowUserData(ghostwin);
+ }
+
+ switch(type) {
+ case GHOST_kEventWindowDeactivate:
+ win->active= 0; /* XXX */
+ break;
+ case GHOST_kEventWindowActivate:
+ {
+ GHOST_TEventKeyData kdata;
+ int cx, cy, wx, wy;
+
+ C->wm->winactive= win; /* no context change! c->wm->windrawable is drawable, or for area queues */
+
+ win->active= 1;
+// window_handle(win, INPUTCHANGE, win->active);
+
+ /* bad ghost support for modifier keys... so on activate we set the modifiers again */
+ kdata.ascii= 0;
+ if (win->eventstate->shift && !query_qual('s')) {
+ kdata.key= GHOST_kKeyLeftShift;
+ wm_event_add_ghostevent(win, GHOST_kEventKeyUp, &kdata);
+ }
+ if (win->eventstate->ctrl && !query_qual('c')) {
+ kdata.key= GHOST_kKeyLeftControl;
+ wm_event_add_ghostevent(win, GHOST_kEventKeyUp, &kdata);
+ }
+ if (win->eventstate->alt && !query_qual('a')) {
+ kdata.key= GHOST_kKeyLeftAlt;
+ wm_event_add_ghostevent(win, GHOST_kEventKeyUp, &kdata);
+ }
+ if (win->eventstate->oskey && !query_qual('C')) {
+ kdata.key= GHOST_kKeyCommand;
+ wm_event_add_ghostevent(win, GHOST_kEventKeyUp, &kdata);
+ }
+
+ /* entering window, update mouse pos. but no event */
+ GHOST_GetCursorPosition(g_system, &wx, &wy);
+
+ GHOST_ScreenToClient(win->ghostwin, wx, wy, &cx, &cy);
+ win->eventstate->x= cx;
+ win->eventstate->y= (win->sizey-1) - cy;
+
+ ED_screen_set_subwinactive(win); /* active subwindow in screen */
+
+ wm_window_make_drawable(C, win);
+ break;
+ }
+ case GHOST_kEventWindowClose: {
+ wm_window_close(C, win);
+ break;
+ }
+ case GHOST_kEventWindowUpdate: {
+ if(G.f & G_DEBUG) printf("ghost redraw\n");
+
+ wm_window_make_drawable(C, win);
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+
+ break;
+ }
+ case GHOST_kEventWindowSize:
+ case GHOST_kEventWindowMove: {
+ GHOST_RectangleHandle client_rect;
+ int l, t, r, b, scr_w, scr_h;
+
+ client_rect= GHOST_GetClientBounds(win->ghostwin);
+ GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
+
+ GHOST_DisposeRectangle(client_rect);
+
+ wm_get_screensize(&scr_w, &scr_h);
+ win->sizex= r-l;
+ win->sizey= b-t;
+ win->posx= l;
+ win->posy= scr_h - t - win->sizey;
+
+ /* debug prints */
+ if(0) {
+ GHOST_TWindowState state;
+ state = GHOST_GetWindowState(win->ghostwin);
+
+ if(state==GHOST_kWindowStateNormal) {
+ if(G.f & G_DEBUG) printf("window state: normal\n");
+ }
+ else if(state==GHOST_kWindowStateMinimized) {
+ if(G.f & G_DEBUG) printf("window state: minimized\n");
+ }
+ else if(state==GHOST_kWindowStateMaximized) {
+ if(G.f & G_DEBUG) printf("window state: maximized\n");
+ }
+ else if(state==GHOST_kWindowStateFullScreen) {
+ if(G.f & G_DEBUG) printf("window state: fullscreen\n");
+ }
+
+ if(type!=GHOST_kEventWindowSize) {
+ if(G.f & G_DEBUG) printf("win move event pos %d %d size %d %d\n", win->posx, win->posy, win->sizex, win->sizey);
+ }
+
+ }
+
+ wm_window_make_drawable(C, win);
+ WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL);
+
+ break;
+ }
+ default:
+ if(type==GHOST_kEventKeyDown) // XXX debug
+ WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
+ wm_event_add_ghostevent(win, type, data);
+ break;
+ }
+
+ }
+ return 1;
+}
+
+void wm_window_process_events(int wait_for_event)
+{
+ GHOST_ProcessEvents(g_system, wait_for_event);
+ GHOST_DispatchEvents(g_system);
+}
+
+/* **************** init ********************** */
+
+void wm_ghost_init(bContext *C)
+{
+ if (!g_system) {
+ GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(ghost_event_proc, C);
+
+ g_system= GHOST_CreateSystem();
+ GHOST_AddEventConsumer(g_system, consumer);
+ }
+}
+
+/* **************** timer ********************** */
+
+static void window_event_timer_proc(GHOST_TimerTaskHandle timer, GHOST_TUns64 time)
+{
+ wmWindow *window;
+
+ window= GHOST_GetTimerTaskUserData(timer);
+
+ wm_event_add_ghostevent(window, GHOST_kEventTimer, (wmTimerHandle*)timer);
+}
+
+wmTimerHandle *WM_event_add_window_timer(wmWindow *win, int delay_ms, int interval_ms)
+{
+ return (wmTimerHandle*)GHOST_InstallTimer(g_system, delay_ms, interval_ms,
+ window_event_timer_proc, win);
+}
+
+void WM_event_remove_window_timer(wmWindow *wm, wmTimerHandle *handle)
+{
+ GHOST_RemoveTimer(g_system, (GHOST_TimerTaskHandle)handle);
+}
+
+/* ************************************ */
+
+void wm_window_set_title(wmWindow *win, char *title)
+{
+ GHOST_SetTitle(win->ghostwin, title);
+}
+
+void wm_window_get_position(wmWindow *win, int *posx_r, int *posy_r)
+{
+ *posx_r= win->posx;
+ *posy_r= win->posy;
+}
+
+void wm_window_get_size(wmWindow *win, int *width_r, int *height_r)
+{
+ *width_r= win->sizex;
+ *height_r= win->sizey;
+}
+
+void wm_window_set_size(wmWindow *win, int width, int height)
+{
+ GHOST_SetClientSize(win->ghostwin, width, height);
+}
+
+void wm_window_lower(wmWindow *win)
+{
+ GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderBottom);
+}
+
+void wm_window_raise(wmWindow *win)
+{
+ GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderTop);
+#ifdef _WIN32
+// markdirty_all(); /* to avoid redraw errors in fullscreen mode (aphex) */
+#endif
+}
+
+void wm_window_swap_buffers(wmWindow *win)
+{
+ GHOST_SwapWindowBuffers(win->ghostwin);
+}
+
+/* ******************* exported api ***************** */
+
+
+/* called whem no ghost system was initialized */
+void WM_setprefsize(int stax, int stay, int sizx, int sizy)
+{
+ prefstax= stax;
+ prefstay= stay;
+ prefsizx= sizx;
+ prefsizy= sizy;
+}
+
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h
new file mode 100644
index 00000000000..139c360dfda
--- /dev/null
+++ b/source/blender/windowmanager/wm.h
@@ -0,0 +1,55 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef WM_H
+#define WM_H
+
+struct wmWindow;
+
+extern void wm_close_and_free(bContext *C, wmWindowManager *);
+extern void wm_close_and_free_all(bContext *C, ListBase *);
+
+extern void wm_add_default(bContext *C);
+extern void wm_check(bContext *C);
+
+void wm_operator_free(wmOperator *op);
+ /* register to windowmanager for redo or macro */
+void wm_operator_register(wmWindowManager *wm, wmOperator *op);
+
+extern void wm_report_free(wmReport *report);
+
+/* wm_operator.c, for init/exit */
+void wm_operatortype_free(void);
+void wm_operatortype_init(void);
+void wm_window_keymap(wmWindowManager *wm);
+
+/* wm_gesture.c */
+void wm_gesture_draw(struct wmWindow *win);
+int wm_gesture_evaluate(bContext *C, wmGesture *gesture);
+
+#endif /* WM_H */
+
diff --git a/source/blender/include/BIF_cursors.h b/source/blender/windowmanager/wm_cursors.h
index f4f4750b2e8..73ff6ccc19e 100644
--- a/source/blender/include/BIF_cursors.h
+++ b/source/blender/windowmanager/wm_cursors.h
@@ -1,5 +1,5 @@
/**
- * $Id$
+ * $Id: BIF_cursors.h 7739 2006-06-15 14:22:59Z broken $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -29,12 +29,24 @@
-#ifndef __BLI_CURSORS_DOT_H__
-#define __BLI_CURSORS_DOT_H__
+#ifndef WM_CURSORS_H
+#define WM_CURSORS_H
+
+#define BC_GHOST_CURSORS 1000
+
+/* old cursors */
+enum {
+ CURSOR_FACESEL=BC_GHOST_CURSORS,
+ CURSOR_WAIT,
+ CURSOR_EDIT,
+ CURSOR_X_MOVE,
+ CURSOR_Y_MOVE,
+ CURSOR_HELP,
+ CURSOR_STD,
+ CURSOR_NONE,
+ CURSOR_PENCIL,
+};
-void InitCursorData(void);
-short GetBlenderCursor(void);
-void SetBlenderCursor(short cursornum);
//typedef struct BCursor_s BCursor;
typedef struct BCursor {
@@ -96,5 +108,5 @@ enum {
#define SMALL_CURSOR 0
#define BIG_CURSOR 1
-#endif
+#endif /* WM_CURSORS_H */
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
new file mode 100644
index 00000000000..d4dddf8e222
--- /dev/null
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -0,0 +1,94 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef WM_EVENT_SYSTEM_H
+#define WM_EVENT_SYSTEM_H
+
+/* return value of handler-operator call */
+#define WM_HANDLER_CONTINUE 0
+#define WM_HANDLER_BREAK 1
+
+struct ScrArea;
+struct ARegion;
+
+/* wmKeyMap is in DNA_windowmanager.h, it's savable */
+
+typedef struct wmEventHandler {
+ struct wmEventHandler *next, *prev;
+
+ int type, flag; /* type default=0, rest is custom */
+
+ /* keymap handler */
+ ListBase *keymap; /* pointer to builtin/custom keymaps */
+
+ rcti *bblocal, *bbwin; /* optional local and windowspace bb */
+
+ /* modal operator handler */
+ wmOperator *op; /* for derived/modal handlers */
+ struct ScrArea *op_area; /* for derived/modal handlers */
+ struct ARegion *op_region; /* for derived/modal handlers */
+
+ /* ui handler */
+ wmUIHandlerFunc ui_handle; /* callback receiving events */
+ wmUIHandlerRemoveFunc ui_remove; /* callback when handler is removed */
+ struct ScrArea *ui_area; /* for derived/modal handlers */
+ struct ARegion *ui_region; /* for derived/modal handlers */
+
+} wmEventHandler;
+
+
+/* handler flag */
+ /* after this handler all others are ignored */
+#define WM_HANDLER_BLOCKING 1
+
+
+
+/* custom types for handlers, for signalling, freeing */
+enum {
+ WM_HANDLER_DEFAULT,
+ WM_HANDLER_TRANSFORM
+};
+
+
+/* wm_event_system.c */
+void wm_event_add(wmWindow *win, wmEvent *event_to_add);
+void wm_event_free_all (wmWindow *win);
+wmEvent *wm_event_next (wmWindow *win);
+
+ /* goes over entire hierarchy: events -> window -> screen -> area -> region */
+void wm_event_do_handlers (bContext *C);
+
+void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata);
+
+void wm_event_do_notifiers (bContext *C);
+void wm_draw_update (bContext *C);
+
+/* wm_keymap.c */
+
+
+#endif /* WM_EVENT_SYSTEM_H */
+
diff --git a/source/blender/include/mydevice.h b/source/blender/windowmanager/wm_event_types.h
index 5396a347b92..87c9e3cb2db 100644
--- a/source/blender/include/mydevice.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -1,22 +1,12 @@
-
-#ifndef __MYDEVICE_H__
-#define __MYDEVICE_H__
-
/*
- * This file has its origin at sgi, where all device defines were written down.
- * Blender copied this concept quite some, and expanded it with internal new defines (ton)
- *
- * mouse / timer / window: until 0x020
- * custom codes: 0x4...
- *
- * $Id$
+ * $Id: wm_event_types.h
*
* ***** 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
@@ -30,46 +20,54 @@
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
-/* MOUSE : 0x00x */
+/*
+ * These define have its origin at sgi, where all device defines were written down in device.h.
+ * Blender copied the conventions quite some, and expanded it with internal new defines (ton)
+ *
+ */
+
+
+#ifndef WM_EVENT_TYPES_H
+#define WM_EVENT_TYPES_H
+
+/* customdata type */
+#define EVT_DATA_TABLET 1
+#define EVT_DATA_GESTURE 2
+#define EVT_DATA_TIMER 3
-#define LEFTMOUSE 0x001
-#define MIDDLEMOUSE 0x002
-#define RIGHTMOUSE 0x003
#define MOUSEX 0x004
#define MOUSEY 0x005
+
+/* MOUSE : 0x00x */
+#define LEFTMOUSE 0x001
+#define MIDDLEMOUSE 0x002
+#define RIGHTMOUSE 0x003
+#define MOUSEMOVE 0x004
+ /* only use if you want user option switch possible */
+#define ACTIONMOUSE 0x005
+#define SELECTMOUSE 0x006
+
#define WHEELUPMOUSE 0x00a
#define WHEELDOWNMOUSE 0x00b
-/* timers */
-
-#define TIMER0 0x006
-#define TIMER1 0x007
-#define TIMER2 0x008
-#define TIMER3 0x009
/* SYSTEM : 0x01x */
-
-#define KEYBD 0x010 /* keyboard */
-#define RAWKEYBD 0x011 /* raw keyboard for keyboard manager */
-#define REDRAW 0x012 /* used by port manager to signal redraws */
-#define INPUTCHANGE 0x013 /* input connected or disconnected */
-#define QFULL 0x014 /* queue was filled */
-#define WINFREEZE 0x015 /* user wants process in this win to shut up */
-#define WINTHAW 0x016 /* user wants process in this win to go again */
-#define WINCLOSE 0x017 /* window close */
-#define WINQUIT 0x018 /* signal from user that app is to go away */
-#define Q_FIRSTTIME 0x019 /* on startup */
-
-/* N-degre of freedom device : 500 */
-#define NDOFMOTION 500
-#define NDOFBUTTON 501
+#define KEYBD 0x0100 /* keyboard */
+#define RAWKEYBD 0x0101 /* raw keyboard for keyboard manager */
+#define REDRAW 0x0102 /* used by port manager to signal redraws */
+#define INPUTCHANGE 0x0103 /* input connected or disconnected */
+#define QFULL 0x0104 /* queue was filled */
+#define WINFREEZE 0x0105 /* user wants process in this win to shut up */
+#define WINTHAW 0x0106 /* user wants process in this win to go again */
+#define WINCLOSE 0x0107 /* window close */
+#define WINQUIT 0x0108 /* signal from user that app is to go away */
+#define Q_FIRSTTIME 0x0109 /* on startup */
+#define TIMER 0x0110 /* timer event */
/* standard keyboard */
@@ -257,5 +255,34 @@
#define REDRAWMARKER 0x4040 /* all views that display markers */
#define REDRAWVIEW3D_IMAGE 0x4041
-#endif /* !__MYDEVICE_H__ */
+/* **************** BLENDER GESTURE EVENTS ********************* */
+
+#define EVT_ACTIONZONE 0x5001
+/* tweak events, for L M R mousebuttons */
+#define EVT_TWEAK_L 0x5002
+#define EVT_TWEAK_M 0x5003
+#define EVT_TWEAK_R 0x5004
+
+#define EVT_GESTURE 0x5005
+
+/* value of tweaks and line gestures, note, KM_ANY (-1) works for this case too */
+#define EVT_GESTURE_N 1
+#define EVT_GESTURE_NE 2
+#define EVT_GESTURE_E 3
+#define EVT_GESTURE_SE 4
+#define EVT_GESTURE_S 5
+#define EVT_GESTURE_SW 6
+#define EVT_GESTURE_W 7
+#define EVT_GESTURE_NW 8
+/* value of corner gestures */
+#define EVT_GESTURE_N_E 9
+#define EVT_GESTURE_N_W 10
+#define EVT_GESTURE_E_N 11
+#define EVT_GESTURE_E_S 12
+#define EVT_GESTURE_S_E 13
+#define EVT_GESTURE_S_W 14
+#define EVT_GESTURE_W_S 15
+#define EVT_GESTURE_W_N 16
+
+#endif /* WM_EVENT_TYPES_H */
diff --git a/source/blender/python/api2_2x/Sys.h b/source/blender/windowmanager/wm_files.h
index 401a3aadc23..3f54c388091 100644
--- a/source/blender/python/api2_2x/Sys.h
+++ b/source/blender/windowmanager/wm_files.h
@@ -1,12 +1,12 @@
-/*
- * $Id$
+/**
+ * $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
@@ -17,21 +17,20 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
* All rights reserved.
*
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano
+ *
+ * Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
-*/
+ */
+#ifndef WM_FILES_H
+#define WM_FILES_H
-#ifndef EXPP_sys_H
-#define EXPP_sys_H
+extern void read_Blog(void);
+extern void delete_autosave(void);
-#include <Python.h>
-PyObject *sys_Init( void );
+#endif /* WM_FILES_H */
-#endif /* EXPP_sys_H */
diff --git a/source/blender/windowmanager/wm_subwindow.h b/source/blender/windowmanager/wm_subwindow.h
new file mode 100644
index 00000000000..0e8c76a8eec
--- /dev/null
+++ b/source/blender/windowmanager/wm_subwindow.h
@@ -0,0 +1,51 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef WM_SUBWINDOW_H
+#define WM_SUBWINDOW_H
+
+
+/* *************** internal api ************** */
+#define WM_MAXSUBWIN 256
+
+void wm_subwindows_free(wmWindow *win);
+
+int wm_subwindow_open(wmWindow *win, rcti *winrct);
+void wm_subwindow_set(wmWindow *win, int swinid); /* set drawable */
+void wm_subwindow_close(wmWindow *win, int swinid);
+int wm_subwindow_get(wmWindow *win); /* returns id */
+
+void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct);
+
+void wm_subwindow_getsize(wmWindow *win, int swinid, int *x, int *y);
+void wm_subwindow_getorigin(wmWindow *win, int swinid, int *x, int *y);
+void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4]);
+
+
+#endif /* WM_SUBWINDOW_H */
+
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
new file mode 100644
index 00000000000..b02a16304cb
--- /dev/null
+++ b/source/blender/windowmanager/wm_window.h
@@ -0,0 +1,63 @@
+/**
+ * $Id: wm_window.h
+ *
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2007 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef WM_WINDOW_H
+#define WM_WINDOW_H
+
+struct bScreen;
+
+/* *************** internal api ************** */
+void wm_ghost_init (bContext *C);
+
+wmWindow *wm_window_new (bContext *C);
+void wm_window_free (bContext *C, wmWindow *win);
+void wm_window_add_ghostwindows (wmWindowManager *wm);
+void wm_window_process_events (int wait_for_event);
+
+void wm_window_make_drawable(bContext *C, wmWindow *win);
+
+void wm_window_raise (wmWindow *win);
+void wm_window_lower (wmWindow *win);
+void wm_window_set_size (wmWindow *win, int width, int height);
+void wm_window_get_size (wmWindow *win, int *width_r, int *height_r);
+void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r);
+void wm_window_set_title (wmWindow *win, char *title);
+void wm_window_swap_buffers (wmWindow *win);
+
+wmWindow *wm_window_copy (bContext *C, wmWindow *winorig);
+wmWindow *wm_window_rip (bContext *C, wmWindow *winorig);
+
+/* *************** window operators ************** */
+int wm_window_duplicate_op (bContext *C, wmOperator *op);
+int wm_window_rip_op (bContext *C, wmOperator *op, struct wmEvent *event);
+int wm_window_fullscreen_toggle_op(bContext *C, wmOperator *op);
+int wm_exit_blender_op(bContext *C, wmOperator *op);
+
+
+#endif /* WM_WINDOW_H */
+
diff --git a/source/blender/yafray/SConscript b/source/blender/yafray/SConscript
index dd744f92d39..1f8d39cbab1 100644
--- a/source/blender/yafray/SConscript
+++ b/source/blender/yafray/SConscript
@@ -4,6 +4,6 @@ Import ('env')
sources = env.Glob('intern/*.cpp')
incs = '#/intern/guardedalloc ../blenlib ../makesdna ../blenkernel'
-incs += ' ../imbuf ../include ../render/extern/include ../render/intern/include'
+incs += ' ../imbuf ../editors/include ../render/extern/include ../render/intern/include'
env.BlenderLib ( 'bf_yafray', sources, Split(incs), [], libtype=['blender','player'], priority=[5, 190] )
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index ee6f19e457d..9908b98d285 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES(../../intern/guardedalloc
../blender/python
../blender/makesdna
../blender/gpu
+ ../blender/windowmanager
../kernel/gen_messaging
../kernel/gen_system
../../extern/glew/include
@@ -64,12 +65,15 @@ ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rna.c
+ COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/rna.c ${CMAKE_SOURCE_DIR}/source/blender/makesrna/
+ DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna
)
IF(WIN32)
- ADD_EXECUTABLE(blender ${EXETYPE} creator.c ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
+ ADD_EXECUTABLE(blender ${EXETYPE} creator.c ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_CURRENT_BINARY_DIR}/rna.c ../icons/winblender.rc)
ELSE(WIN32)
- ADD_EXECUTABLE(blender ${EXETYPE} creator.c ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
+ ADD_EXECUTABLE(blender ${EXETYPE} creator.c ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_CURRENT_BINARY_DIR}/rna.c)
ENDIF(WIN32)
@@ -190,7 +194,7 @@ ADD_DEPENDENCIES(blender makesdna)
FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
-SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} src blender_python blender_render blender_radiosity)
+SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render blender_radiosity)
IF(WITH_ELBEEM)
SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem)
@@ -203,7 +207,8 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(UNIX)
# Sort libraries
SET(BLENDER_SORTED_LIBS
- src
+ bf_windowmanager
+ bf_editors
bf_decimation
blender_BSP
bf_soundsystem
@@ -212,7 +217,7 @@ IF(UNIX)
blender_render
blender_radiosity
blender_ONL
- blender_python
+ bf_python
bf_blenkernel
bf_nodes
bf_gpu
@@ -237,7 +242,8 @@ IF(UNIX)
bf_moto
bf_bmfont
verse
- src
+ bf_windowmanager
+ bf_editors
bf_ftfont
extern_ftgl
bf_blroutines
@@ -263,7 +269,7 @@ IF(UNIX)
extern_solid
extern_qhull
bf_moto
- blender_python
+ bf_python
bf_quicktime
extern_binreloc
extern_glew
diff --git a/source/creator/Makefile b/source/creator/Makefile
index 9273d943883..ea301ad80a9 100644
--- a/source/creator/Makefile
+++ b/source/creator/Makefile
@@ -44,12 +44,13 @@ CPPFLAGS += -I../blender/radiosity/extern/include
CPPFLAGS += -I../blender/imbuf
CPPFLAGS += -I../blender/makesdna
CPPFLAGS += -I../blender/blenlib
-CPPFLAGS += -I../blender/include
+CPPFLAGS += -I../blender/editors/include
CPPFLAGS += -I../blender/renderconverter
CPPFLAGS += -I../blender/blenkernel
CPPFLAGS += -I../blender/python
CPPFLAGS += -I../blender/blenloader
CPPFLAGS += -I../blender/gpu
+CPPFLAGS += -I../blender/windowmanager
CPPFLAGS += -I../kernel/gen_system
CPPFLAGS += -I../kernel/gen_messaging
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
diff --git a/source/creator/SConscript b/source/creator/SConscript
index 505b69b8e6d..6c36a8f5b41 100644
--- a/source/creator/SConscript
+++ b/source/creator/SConscript
@@ -4,8 +4,8 @@ Import ('env')
sources = 'creator.c'
incs = '#/intern/guardedalloc ../blender/blenlib ../blender/blenkernel'
-incs += ' ../blender/include ../blender/blenloader ../blender/imbuf'
-incs += ' ../blender/renderconverter ../blender/render/extern/include'
+incs += ' ../blender/editors/include ../blender/blenloader ../blender/imbuf'
+incs += ' ../blender/renderconverter ../blender/render/extern/include ../blender/windowmanager'
incs += ' ../blender/makesdna ../kernel/gen_messaging'
incs += ' ../kernel/gen_system #/extern/glew/include ../blender/gpu'
incs += ' ' + env['BF_OPENGL_INC']
@@ -30,4 +30,4 @@ if env['WITH_BF_PYTHON']:
else:
defs.append('DISABLE_PYTHON')
-env.BlenderLib ( libname = 'blender_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 1 )
+env.BlenderLib ( libname = 'bf_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 0 )
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 872a5f4d497..bfc03c976fb 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -29,6 +29,13 @@
#include <stdlib.h>
#include <string.h>
+
+/* for setuid / getuid */
+#ifdef __sgi
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
/* This little block needed for linking to Blender... */
#include "MEM_guardedalloc.h"
@@ -43,8 +50,6 @@
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
-#include "blendef.h" /* for MAXFRAME */
-
#include "BKE_utildefines.h"
#include "BKE_blender.h"
@@ -56,20 +61,6 @@
#include "BKE_scene.h"
#include "BKE_node.h"
-#include "BIF_gl.h"
-#include "BIF_graphics.h"
-#include "BIF_mainqueue.h"
-#include "BIF_graphics.h"
-#include "BIF_editsound.h"
-#include "BIF_usiblender.h"
-#include "BIF_drawscene.h" /* set_scene() */
-#include "BIF_screen.h" /* waitcursor and more */
-#include "BIF_usiblender.h"
-#include "BIF_toolbox.h"
-
-#include "BLO_writefile.h"
-#include "BLO_readfile.h"
-
#include "IMB_imbuf.h" // for quicktime_init
#ifndef DISABLE_PYTHON
@@ -78,14 +69,16 @@
#include "RE_pipeline.h"
+//XXX #include "playanim_ext.h"
+#include "wm_event_types.h"
+//XXX #include "nla.h"
+//XXX #include "datatoc.h"
+
+#include "WM_api.h"
+
#include "GPU_draw.h"
#include "GPU_extensions.h"
-#include "playanim_ext.h"
-#include "mydevice.h"
-#include "nla.h"
-#include "datatoc.h"
-
/* for passing information between creator and gameengine */
#include "SYS_System.h"
@@ -113,16 +106,6 @@ extern char * build_type;
static void print_help(void);
static void print_version(void);
-
-/* defined in ghostwinlay and winlay, we can't include carbon here, conflict with DNA */
-#ifdef __APPLE__
-extern int checkAppleVideoCard(void);
-extern void getMacAvailableBounds(short *top, short *left, short *bottom, short *right);
-extern void winlay_get_screensize(int *width_r, int *height_r);
-extern void winlay_process_events(int wait_for_event);
-#endif
-
-
/* for the callbacks: */
extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */
@@ -201,7 +184,7 @@ static void print_help(void)
printf (" -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
printf (" [1-8], 0 for systems processor count.\n");
printf ("\nAnimation playback options:\n");
- printf (" -a <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
+ printf (" -a <options> <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
printf (" -m\t\tRead from disk (Don't buffer)\n");
printf (" -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
@@ -262,21 +245,24 @@ static void print_help(void)
double PIL_check_seconds_timer(void);
-extern void winlay_get_screensize(int *width_r, int *height_r);
-static void main_init_screen( void )
+/* XXX This was here to fix a crash when running python scripts
+ * with -P that used the screen.
+ *
+ * static void main_init_screen( void )
{
setscreen(G.curscreen);
if(G.main->scene.first==0) {
set_scene( add_scene("1") );
}
-}
+}*/
int main(int argc, char **argv)
{
- int a, i, stax, stay, sizx, sizy, scr_init = 0;
SYS_SystemHandle syshandle;
+ bContext *C= MEM_callocN(sizeof(bContext), "creator.c context");
+ int a, i, stax, stay, sizx, sizy /*XXX, scr_init = 0*/;
#if defined(WIN32) || defined (__linux__)
int audio = 1;
@@ -293,29 +279,13 @@ int main(int argc, char **argv)
#ifdef __APPLE__
/* patch to ignore argument finder gives us (pid?) */
if (argc==2 && strncmp(argv[1], "-psn_", 5)==0) {
+ extern void wm_window_process_events(int wait_for_event);
extern int GHOST_HACK_getFirstFile(char buf[]);
static char firstfilebuf[512];
- int scr_x,scr_y;
argc= 1;
- /* first let us check if we are hardware accelerated and with VRAM > 16 Mo */
-
- if (checkAppleVideoCard()) {
- short top, left, bottom, right;
-
- winlay_get_screensize(&scr_x, &scr_y);
- getMacAvailableBounds(&top, &left, &bottom, &right);
- setprefsize(left +10,scr_y - bottom +10,right-left -20,bottom - 64, 0);
-
- } else {
- winlay_get_screensize(&scr_x, &scr_y);
-
- /* 40 + 684 + (headers) 22 + 22 = 768, the powerbook screen height */
- setprefsize(120, 40, 850, 684, 0);
- }
-
- winlay_process_events(0);
+ wm_window_process_events(0);
if (GHOST_HACK_getFirstFile(firstfilebuf)) {
argc= 2;
argv[1]= firstfilebuf;
@@ -385,7 +355,7 @@ int main(int argc, char **argv)
/* exception here, see below, it probably needs happens after qt init? */
libtiff_init();
- playanim(argc-1, argv+1);
+// XXX playanim(argc-1, argv+1);
exit(0);
break;
case 'b':
@@ -434,15 +404,11 @@ int main(int argc, char **argv)
if(G.background) signal(SIGINT, blender_esc); /* ctrl c out bg render */
/* background render uses this font too */
- BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size);
+ //XXX BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size);
init_def_material();
if(G.background==0) {
- winlay_get_screensize(&sizx, &sizy);
- stax=0;
- stay=0;
-
for(a=1; a<argc; a++) {
if(argv[a][0] == '-') {
switch(argv[a][1]) {
@@ -459,8 +425,8 @@ int main(int argc, char **argv)
sizx= atoi(argv[a]);
a++;
sizy= atoi(argv[a]);
- G.windowstate = G_WINDOWSTATE_BORDER;
+ WM_setprefsize(stax, stay, sizx, sizy);
break;
case 'd':
G.f |= G_DEBUG; /* std output printf's */
@@ -476,11 +442,11 @@ int main(int argc, char **argv)
break;
case 'w':
- G.windowstate = G_WINDOWSTATE_BORDER;
+ /* with borders XXX OLD CRUFT!*/
break;
case 'W':
+ /* borderless, win + linux XXX OLD CRUFT */
/* XXX, fixme mein, borderless on OSX */
- G.windowstate = G_WINDOWSTATE_FULLSCREEN;
break;
case 'R':
/* Registering filetypes only makes sense on windows... */
@@ -515,8 +481,6 @@ int main(int argc, char **argv)
}
}
- if ( (G.windowstate == G_WINDOWSTATE_BORDER) || (G.windowstate == G_WINDOWSTATE_FULLSCREEN))
- setprefsize(stax, stay, sizx, sizy, 0);
#ifndef DISABLE_PYTHON
BPY_start_python(argc, argv);
#endif
@@ -526,8 +490,9 @@ int main(int argc, char **argv)
* added note (ton): i removed it altogether
*/
- BIF_init(); /* loads .B.blend */
+ WM_init(C);
+ // XXX BRECHT SOLVE
BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */
#ifndef DISABLE_SDL
@@ -554,10 +519,10 @@ int main(int argc, char **argv)
}
#ifndef DISABLE_PYTHON
/**
- * NOTE: the U.pythondir string is NULL until BIF_init() is executed,
+ * NOTE: the U.pythondir string is NULL until WM_init() is executed,
* so we provide the BPY_ function below to append the user defined
* pythondir to Python's sys.path at this point. Simply putting
- * BIF_init() before BPY_start_python() crashes Blender at startup.
+ * WM_init() before BPY_start_python() crashes Blender at startup.
* Update: now this function also inits the bpymenus, which also depend
* on U.pythondir.
*/
@@ -710,7 +675,13 @@ int main(int argc, char **argv)
}
break;
case 'P':
+
#ifndef DISABLE_PYTHON
+ //XXX
+ // FOR TESTING ONLY
+ a++;
+ BPY_run_python_script (argv[a]);
+#if 0
a++;
if (a < argc) {
/* If we're not running in background mode, then give python a valid screen */
@@ -721,6 +692,7 @@ int main(int argc, char **argv)
BPY_run_python_script (argv[a]);
}
else printf("\nError: you must specify a Python script after '-P '.\n");
+#endif
#else
printf("This blender was built without python support\n");
#endif /* DISABLE_PYTHON */
@@ -813,41 +785,45 @@ int main(int argc, char **argv)
BLI_convertstringcwd(filename);
if (G.background) {
- int retval = BKE_read_file(filename, NULL);
- sound_initialize_sounds();
+ int retval = BKE_read_file(C, argv[a], NULL);
+// XXX sound_initialize_sounds();
/*we successfully loaded a blend file, get sure that
pointcache works */
if (retval!=0) G.relbase_valid = 1;
- /* happens for the UI on file reading too */
- BKE_reset_undo();
- BKE_write_undo("original"); /* save current state */
+ /* happens for the UI on file reading too (huh? (ton))*/
+// XXX BKE_reset_undo();
+// BKE_write_undo("original"); /* save current state */
} else {
/* we are not running in background mode here, but start blender in UI mode with
a file - this should do everything a 'load file' does */
- BIF_read_file(filename);
+ WM_read_file(C, filename);
}
}
}
-
+
if(G.background) {
/* actually incorrect, but works for now (ton) */
- exit_usiblender();
+ WM_exit(C);
}
+
+
+ WM_main(C);
- if (scr_init==0) {
+ /*XXX if (scr_init==0) {
main_init_screen();
}
- screenmain(); /* main display loop */
+ screenmain();*/ /* main display loop */
return 0;
} /* end of int main(argc,argv) */
static void error_cb(char *err)
{
- error("%s", err);
+
+ printf("%s\n", err); /* XXX do this in WM too */
}
static void mem_error_cb(char *errorStr)
@@ -865,6 +841,6 @@ static void setCallbacks(void)
/* BLI_blenlib: */
BLI_setErrorCallBack(error_cb); /* */
- BLI_setInterruptCallBack(blender_test_break);
+// XXX BLI_setInterruptCallBack(blender_test_break);
}
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 4410763ec53..0dab583567d 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -71,8 +71,8 @@
#include "DNA_screen_types.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
-#include "BIF_screen.h"
-#include "BIF_scrarea.h"
+//XXX #include "BIF_screen.h"
+//XXX #include "BIF_scrarea.h"
#include "BKE_main.h"
#include "BLI_blenlib.h"
@@ -85,7 +85,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-#include "BSE_headerbuttons.h"
+//XXX #include "BSE_headerbuttons.h"
void update_for_newframe();
#ifdef __cplusplus
}
@@ -219,7 +219,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
}
for (i = 0; i < 16; i++)
{
- float *projmat_linear = (float*) area->winmat;
+ float *projmat_linear; //XXX = (float*) area->winmat;
projmat.setElem(i, projmat_linear[i]);
}
@@ -407,10 +407,10 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
}
// test for the ESC key
- while (qtest())
+ while (0) //XXX while (qtest())
{
short val;
- unsigned short event = extern_qread(&val);
+ unsigned short event = 0; //XXX extern_qread(&val);
if (keyboarddevice->ConvertBlenderEvent(event,val))
exitrequested = KX_EXIT_REQUEST_BLENDER_ESC;
@@ -419,9 +419,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
* should this really be?
*/
if (event==MOUSEX) {
- val = val - scrarea_get_win_x(area);
+ val = 0;//XXX val - scrarea_get_win_x(area);
} else if (event==MOUSEY) {
- val = scrarea_get_win_height(area) - (val - scrarea_get_win_y(area)) - 1;
+ val = 0;//XXX scrarea_get_win_height(area) - (val - scrarea_get_win_y(area)) - 1;
}
mousedevice->ConvertBlenderEvent(event,val);
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt
index 340a1ae310b..2300323a55e 100644
--- a/source/gameengine/BlenderRoutines/CMakeLists.txt
+++ b/source/gameengine/BlenderRoutines/CMakeLists.txt
@@ -15,6 +15,8 @@ SET(INC
../../../source/gameengine/Ketsji
../../../source/blender/blenlib
../../../source/blender/blenkernel
+ ../../../source/blender/editors/include
+ ../../../source/blender/windowmanager
../../../source/blender
../../../source/blender/include
../../../source/blender/makesdna
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 1604dfe5cce..750a1ef3f93 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -26,7 +26,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include "BIF_scrarea.h"
+//XXX #include "BIF_scrarea.h"
#include "KX_BlenderCanvas.h"
#ifdef HAVE_CONFIG_H
@@ -93,12 +93,12 @@ void KX_BlenderCanvas::ClearBuffer(int type)
int KX_BlenderCanvas::GetWidth(
) const {
- return scrarea_get_win_width(m_area);
+ return 0; //XXX scrarea_get_win_width(m_area);
}
int KX_BlenderCanvas::GetHeight(
) const {
- return scrarea_get_win_height(m_area);
+ return 0; //XXX scrarea_get_win_height(m_area);
}
RAS_Rect &
@@ -116,8 +116,8 @@ SetViewPort(
){
int vp_width = (x2 - x1) + 1;
int vp_height = (y2 - y1) + 1;
- int minx = scrarea_get_win_x(m_area);
- int miny = scrarea_get_win_y(m_area);
+ int minx = 0;//XXX scrarea_get_win_x(m_area);
+ int miny = 0;//XXX scrarea_get_win_y(m_area);
m_area_rect.SetLeft(minx + x1);
m_area_rect.SetBottom(miny + y1);
@@ -159,9 +159,9 @@ void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate)
// (0,0) is top left, (width,height) is bottom right
void KX_BlenderCanvas::SetMousePosition(int x,int y)
{
- int winX = scrarea_get_win_x(m_area);
- int winY = scrarea_get_win_y(m_area);
- int winH = scrarea_get_win_height(m_area);
+ int winX = 0;//XXX scrarea_get_win_x(m_area);
+ int winY = 0;//XXX scrarea_get_win_y(m_area);
+ int winH = 0;//XXX scrarea_get_win_height(m_area);
BL_warp_pointer(winX + x, winY + (winH-y-1));
}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
index 54d1eb7e011..b3b10e8bf07 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
@@ -65,10 +65,10 @@
#include "BKE_image.h"
extern "C" {
-#include "BDR_drawmesh.h"
-#include "BIF_mywindow.h"
-#include "BIF_toolbox.h"
-#include "BIF_graphics.h" /* For CURSOR_NONE CURSOR_WAIT CURSOR_STD */
+//XXX #include "BDR_drawmesh.h"
+//XXX #include "BIF_mywindow.h"
+//XXX #include "BIF_toolbox.h"
+//XXX #include "BIF_graphics.h" /* For CURSOR_NONE CURSOR_WAIT CURSOR_STD */
}
@@ -84,12 +84,12 @@ void spack(unsigned int ucol)
void BL_warp_pointer(int x,int y)
{
- warp_pointer(x,y);
+ //XXX warp_pointer(x,y);
}
void BL_SwapBuffers()
{
- myswapbuffers();
+ //XXX myswapbuffers();
}
void DisableForText()
@@ -201,19 +201,19 @@ void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int
void BL_HideMouse()
{
- set_cursor(CURSOR_NONE);
+ //XXX set_cursor(CURSOR_NONE);
}
void BL_WaitMouse()
{
- set_cursor(CURSOR_WAIT);
+ //XXX set_cursor(CURSOR_WAIT);
}
void BL_NormalMouse()
{
- set_cursor(CURSOR_STD);
+ //XXX set_cursor(CURSOR_STD);
}
#define MAX_FILE_LENGTH 512
@@ -226,9 +226,9 @@ void BL_MakeScreenShot(struct ScrArea *area, const char* filename)
// filename read - only
/* XXX will need to change at some point */
- BIF_screendump(0);
+ //XXX BIF_screendump(0);
// write+read filename
- write_screendump((char*) copyfilename);
+ //XXX write_screendump((char*) copyfilename);
}
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
index 8e5d508f8cb..4294971d225 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
+++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
@@ -35,14 +35,15 @@
#include <map>
-/* need to be here for conversion purposes */
-#ifdef FREE_WINDOWS
-#undef HKEY
-#endif
-
-#include "mydevice.h"
+#include "wm_event_types.h"
#include "SCA_IInputDevice.h"
+/* timers */
+#define TIMER0 0x006
+#define TIMER1 0x007
+#define TIMER2 0x008
+#define TIMER3 0x009
+
/**
Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
*/
@@ -93,7 +94,15 @@ public:
m_reverseKeyTranslateTable[EKEY ] = KX_EKEY ;
m_reverseKeyTranslateTable[FKEY ] = KX_FKEY ;
m_reverseKeyTranslateTable[GKEY ] = KX_GKEY ;
+//XXX clean up
+#ifdef WIN32
+#define HKEY 'h'
+#endif
m_reverseKeyTranslateTable[HKEY ] = KX_HKEY ;
+//XXX clean up
+#ifdef WIN32
+#undef HKEY
+#endif
m_reverseKeyTranslateTable[IKEY ] = KX_IKEY ;
m_reverseKeyTranslateTable[JKEY ] = KX_JKEY ;
m_reverseKeyTranslateTable[KKEY ] = KX_KKEY ;
diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile
index 4b9a2a3af17..b1be56ac47f 100644
--- a/source/gameengine/BlenderRoutines/Makefile
+++ b/source/gameengine/BlenderRoutines/Makefile
@@ -35,6 +35,7 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(NAN_SUMO)/include -I$(NAN_SOLID)/include
CPPFLAGS += -I$(NAN_SOLID)
CPPFLAGS += -I$(NAN_STRING)/include
@@ -46,8 +47,9 @@ CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# because of kernel dependency on makesdna
CPPFLAGS += -I../../blender/makesdna
-CPPFLAGS += -I../../blender/include
+CPPFLAGS += -I../../blender/editors/include
# because of kernel dependency on imbuf
+CPPFLAGS += -I../../blender/windowmanager
CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/blenlib
CPPFLAGS += -I../../blender/blenkernel
diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript
index 78adbc83d9b..7722b6f69a6 100644
--- a/source/gameengine/BlenderRoutines/SConscript
+++ b/source/gameengine/BlenderRoutines/SConscript
@@ -8,7 +8,7 @@ incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
incs += ' #source/gameengine/Converter #source/blender/imbuf'
incs += ' #intern/ghost/include'
incs += ' #intern/moto/include #source/gameengine/Ketsji #source/blender/blenlib'
-incs += ' #source/blender/blenkernel #source/blender #source/blender/include'
+incs += ' #source/blender/blenkernel #source/blender #source/blender/editors/include'
incs += ' #source/blender/makesdna #source/gameengine/Rasterizer #source/gameengine/GameLogic'
incs += ' #source/gameengine/Expressions #source/gameengine/Network'
incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common'
@@ -16,6 +16,7 @@ incs += ' #source/gameengine/Physics/Bullet #source/gameengine/Physics/Sumo'
incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader'
incs += ' #extern/glew/include #source/blender/gpu'
+incs += ' #source/blender/windowmanager'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_SOLID_INC']
@@ -26,4 +27,4 @@ cxxflags = []
if env['OURPLATFORM']=='win32-vc':
cxxflags.append ('/GR')
-env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , compileflags=cxxflags)
+env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 45] , compileflags=cxxflags)
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 9c699b67b28..487c8ab4b9b 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -178,8 +178,8 @@ extern "C" {
#ifdef __cplusplus
extern "C" {
#endif
-#include "BSE_headerbuttons.h"
-void update_for_newframe();
+//XXX #include "BSE_headerbuttons.h"
+//XXX void update_for_newframe();
//void scene_update_for_newframe(struct Scene *sce, unsigned int lay);
//#include "BKE_ipo.h"
//void do_all_data_ipos(void);
@@ -1705,7 +1705,7 @@ struct parentChildLink {
};
#include "DNA_constraint_types.h"
-#include "BIF_editconstraint.h"
+//XXX #include "BIF_editconstraint.h"
bPoseChannel *get_active_posechannel2 (Object *ob)
{
@@ -1929,7 +1929,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (converter->addInitFromFrame){//rcruiz
float eulxyzPrev[3];
blenderscene->r.cfra=blenderscene->r.sfra-1;
- update_for_newframe();
+ //XXX update_for_newframe();
MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0],
blenderobject->loc[1]+blenderobject->dloc[1],
blenderobject->loc[2]+blenderobject->dloc[2]
@@ -1947,7 +1947,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
tmp.scale(fps, fps, fps);
iniang.push_back(tmp);
blenderscene->r.cfra=blenderscene->r.sfra;
- update_for_newframe();
+ //XXX update_for_newframe();
}
gameobj->NodeSetLocalPosition(pos);
@@ -2131,7 +2131,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
if (converter->addInitFromFrame){//rcruiz
float eulxyzPrev[3];
blenderscene->r.cfra=blenderscene->r.sfra-1;
- update_for_newframe();
+ //XXX update_for_newframe();
MT_Vector3 tmp=pos-MT_Point3(blenderobject->loc[0]+blenderobject->dloc[0],
blenderobject->loc[1]+blenderobject->dloc[1],
blenderobject->loc[2]+blenderobject->dloc[2]
@@ -2149,7 +2149,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
tmp.scale(fps, fps, fps);
iniang.push_back(tmp);
blenderscene->r.cfra=blenderscene->r.sfra;
- update_for_newframe();
+ //XXX update_for_newframe();
}
gameobj->NodeSetLocalPosition(pos);
diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt
index 217bdb30907..a5219b9e759 100644
--- a/source/gameengine/Converter/CMakeLists.txt
+++ b/source/gameengine/Converter/CMakeLists.txt
@@ -46,6 +46,7 @@ SET(INC
../../../source/gameengine/Ketsji/KXNetwork
../../../source/blender/blenlib
../../../source/blender/blenkernel
+ ../../../source/blender/windowmanager
../../../source/blender
../../../source/blender/include
../../../source/blender/makesdna
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 7eec93dc402..7b68dbda176 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -83,8 +83,8 @@ extern "C"
#include "DNA_curve_types.h"
#include "BLI_blenlib.h"
#include "MEM_guardedalloc.h"
-#include "BSE_editipo.h"
-#include "BSE_editipo_types.h"
+//XXX #include "BSE_editipo.h"
+//XXX #include "BSE_editipo_types.h"
#include "DNA_ipo_types.h"
#include "BKE_global.h"
#include "DNA_space_types.h"
@@ -643,6 +643,7 @@ void KX_BlenderSceneConverter::localDel_ipoCurve ( IpoCurve * icu ,struct SpaceI
return;
int i;
+#if 0 //XXX
EditIpo *ei= (EditIpo *)sipo->editipo;
if (!ei) return;
@@ -653,14 +654,15 @@ void KX_BlenderSceneConverter::localDel_ipoCurve ( IpoCurve * icu ,struct SpaceI
return;
}
}
+#endif
}
//quick hack
extern "C"
{
Ipo *add_ipo( char *name, int idcode );
- char *getIpoCurveName( IpoCurve * icu );
- struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int, short);
+ //XXX char *getIpoCurveName( IpoCurve * icu );
+ //XXX struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int);
void testhandles_ipocurve(struct IpoCurve *icu);
void insert_vert_icu(struct IpoCurve *, float, float, short);
void Mat3ToEul(float tmat[][3], float *eul);
@@ -671,11 +673,11 @@ IpoCurve* findIpoCurve(IpoCurve* first, const char* searchName)
IpoCurve* icu1;
for( icu1 = first; icu1; icu1 = icu1->next )
{
- char* curveName = getIpoCurveName( icu1 );
+ /*XXX char* curveName = getIpoCurveName( icu1 );
if( !strcmp( curveName, searchName) )
{
return icu1;
- }
+ }*/
}
return 0;
}
@@ -872,28 +874,28 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
//create the curves, if not existing
IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z);
@@ -903,7 +905,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = position.x();
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
#endif
@@ -912,7 +914,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = position.y();
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
@@ -922,7 +924,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = position.z();
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
#endif
@@ -931,7 +933,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = eulerAngles[0];
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
@@ -941,7 +943,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = eulerAngles[1];
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
@@ -951,7 +953,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
if (icu1)
{
float curVal = eulerAngles[2];
- insert_vert_icu(icu1, frameNumber, curVal, 0);
+ //XXX insert_vert_icu(icu1, frameNumber, curVal, 0);
#ifdef TEST_HANDLES_GAME2IPO
testhandles_ipocurve(icu1);
@@ -1028,28 +1030,28 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo()
//create the curves, if not existing
IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y);
icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ");
- if (!icu1)
- icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1);
+ //XXX if (!icu1)
+ //XXX icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z);
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 13b7f43195d..4cf302b1f64 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -36,6 +36,7 @@
#pragma warning (disable : 4786)
#endif //WIN32
+#include "wm_event_types.h"
#include "KX_BlenderSceneConverter.h"
#include "KX_ConvertSensors.h"
@@ -143,7 +144,15 @@ void BL_ConvertSensors(struct Object* blenderobject,
gReverseKeyTranslateTable[EKEY ] = SCA_IInputDevice::KX_EKEY;
gReverseKeyTranslateTable[FKEY ] = SCA_IInputDevice::KX_FKEY;
gReverseKeyTranslateTable[GKEY ] = SCA_IInputDevice::KX_GKEY;
+//XXX clean up
+#ifdef WIN32
+#define HKEY 'h'
+#endif
gReverseKeyTranslateTable[HKEY ] = SCA_IInputDevice::KX_HKEY;
+//XXX clean up
+#ifdef WIN32
+#undef HKEY
+#endif
gReverseKeyTranslateTable[IKEY ] = SCA_IInputDevice::KX_IKEY;
gReverseKeyTranslateTable[JKEY ] = SCA_IInputDevice::KX_JKEY;
gReverseKeyTranslateTable[KKEY ] = SCA_IInputDevice::KX_KKEY;
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index 4dd63e428bd..938994e8b62 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -45,9 +45,10 @@ CPPFLAGS += -I$(NAN_BULLET2)/include
CPPFLAGS += -I../../blender
# these two needed because of blenkernel
+CPPFLAGS += -I../../blender/windowmanager
CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/makesdna
-CPPFLAGS += -I../../blender/include
+CPPFLAGS += -I../../blender/editors/include
CPPFLAGS += -I../../blender/blenlib
CPPFLAGS += -I../../blender/blenkernel
CPPFLAGS += -I../../blender/render/extern/include
diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript
index 3be352c568b..434fad0f544 100644
--- a/source/gameengine/Converter/SConscript
+++ b/source/gameengine/Converter/SConscript
@@ -10,16 +10,17 @@ incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengin
incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf'
incs += ' #intern/moto/include #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork'
incs += ' #source/blender/blenlib #source/blender/blenkernel #source/blender'
-incs += ' #source/blender/include #source/blender/makesdna #source/gameengine/Rasterizer'
+incs += ' #source/blender/editors/include #source/blender/makesdna #source/gameengine/Rasterizer'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #source/gameengine/GameLogic'
incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/gameengine/SceneGraph'
incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet #source/gameengine/Physics/BlOde'
incs += ' #source/gameengine/Physics/Dummy #source/gameengine/Physics/Sumo'
incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
incs += ' #source/blender/misc #source/blender/blenloader #source/blender/gpu'
+incs += ' #source/blender/windowmanager'
incs += ' ' + env['BF_PYTHON_INC']
incs += ' ' + env['BF_SOLID_INC']
incs += ' ' + env['BF_BULLET_INC']
-env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,70] )
+env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,50] )
diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript
index 809ac31371e..2d4988586de 100644
--- a/source/gameengine/Expressions/SConscript
+++ b/source/gameengine/Expressions/SConscript
@@ -6,4 +6,4 @@ sources = env.Glob('*.cpp')
incs ='. #source/kernel/gen_system #intern/string #intern/moto/include'
incs += ' ' + env['BF_PYTHON_INC']
-env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['game','player'], priority = [45,125] )
+env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['game','player'], priority = [45,120] )
diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript
index b4e2159dc22..ee0e638af60 100644
--- a/source/gameengine/GameLogic/SConscript
+++ b/source/gameengine/GameLogic/SConscript
@@ -17,4 +17,4 @@ if env['WITH_BF_SDL']:
else:
defs += ' DISABLE_SDL'
-env.BlenderLib ( 'bf_logic', sources, Split(incs), Split(defs), libtype=['game','player'], priority=[30, 110] )
+env.BlenderLib ( 'bf_logic', sources, Split(incs), Split(defs), libtype=['game','player'], priority=[30, 100] )
diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile
index a2bdb7225a0..3d44a41afee 100644
--- a/source/gameengine/GamePlayer/common/unix/Makefile
+++ b/source/gameengine/GamePlayer/common/unix/Makefile
@@ -35,6 +35,7 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
+CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index 33cf07b6211..a7ee2d51d14 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -50,4 +50,4 @@ if env['OURPLATFORM']=='win32-vc':
cflags = ['/GR']
-env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags)
+env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=5, compileflags=cflags)
diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt
index 58411f6d25e..d054894589f 100644
--- a/source/gameengine/Ketsji/CMakeLists.txt
+++ b/source/gameengine/Ketsji/CMakeLists.txt
@@ -25,17 +25,19 @@
# ***** END GPL LICENSE BLOCK *****
FILE(GLOB SRC *.cpp)
-SET(SRC
- ${SRC}
- ../../../source/blender/python/api2_2x/Mathutils.c
- ../../../source/blender/python/api2_2x/constant.c
- ../../../source/blender/python/api2_2x/euler.c
- ../../../source/blender/python/api2_2x/gen_utils.c
- ../../../source/blender/python/api2_2x/matrix.c
- ../../../source/blender/python/api2_2x/point.c
- ../../../source/blender/python/api2_2x/quat.c
- ../../../source/blender/python/api2_2x/vector.c
-)
+
+#XXX disabled for 2.5 because of missing python
+#SET(SRC
+# ${SRC}
+# ../../../source/blender/python/api2_2x/Mathutils.c
+# ../../../source/blender/python/api2_2x/constant.c
+# ../../../source/blender/python/api2_2x/euler.c
+# ../../../source/blender/python/api2_2x/gen_utils.c
+# ../../../source/blender/python/api2_2x/matrix.c
+# ../../../source/blender/python/api2_2x/point.c
+# ../../../source/blender/python/api2_2x/quat.c
+# ../../../source/blender/python/api2_2x/vector.c
+#)
SET(INC
.
diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript
index 2297b96c19e..812d7bfc7f9 100644
--- a/source/gameengine/Ketsji/KXNetwork/SConscript
+++ b/source/gameengine/Ketsji/KXNetwork/SConscript
@@ -9,4 +9,4 @@ incs += ' #source/gameengine/Network'
incs += ' ' + env['BF_PYTHON_INC']
-env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[5, 155] )
+env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[5, 145] )
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
index bf838e60210..3a20bbfbb11 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
@@ -185,7 +185,8 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost)
m_savedMass = GetMass();
m_savedCollisionFilterGroup = handle->m_collisionFilterGroup;
m_savedCollisionFilterMask = handle->m_collisionFilterMask;
- body->setActivationState(DISABLE_SIMULATION);
+ m_savedActivationState = body->getActivationState();
+ body->forceActivationState(DISABLE_SIMULATION);
GetPhysicsEnvironment()->updateCcdPhysicsController(this,
0.0,
btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)),
@@ -204,7 +205,7 @@ void KX_BulletPhysicsController::RestoreDynamics()
m_savedCollisionFlags,
m_savedCollisionFilterGroup,
m_savedCollisionFilterMask);
- GetRigidBody()->forceActivationState(ACTIVE_TAG);
+ GetRigidBody()->forceActivationState(m_savedActivationState);
}
}
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
index cdcb82c87ca..d5fca4ec6d3 100644
--- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h
+++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h
@@ -9,6 +9,7 @@ class KX_BulletPhysicsController : public KX_IPhysicsController ,public CcdPhysi
{
private:
int m_savedCollisionFlags;
+ int m_savedActivationState;
short int m_savedCollisionFilterGroup;
short int m_savedCollisionFilterMask;
MT_Scalar m_savedMass;
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 53b3e348a36..fb91c793765 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -259,10 +259,75 @@ void KX_Camera::ExtractFrustumSphere()
if (m_set_frustum_center)
return;
- // The most extreme points on the near and far plane. (normalized device coords)
- MT_Vector4 hnear(1., 1., 0., 1.), hfar(1., 1., 1., 1.);
+ // compute sphere for the general case and not only symmetric frustum:
+ // the mirror code in ImageRender can use very asymmetric frustum.
+ // We will put the sphere center on the line that goes from origin to the center of the far clipping plane
+ // This is the optimal position if the frustum is symmetric or very asymmetric and probably close
+ // to optimal for the general case. The sphere center position is computed so that the distance to
+ // the near and far extreme frustum points are equal.
+
+ // get the transformation matrix from device coordinate to camera coordinate
MT_Matrix4x4 clip_camcs_matrix = m_projection_matrix;
clip_camcs_matrix.invert();
+
+ // detect which of the corner of the far clipping plane is the farthest to the origin
+ MT_Vector4 nfar; // far point in device normalized coordinate
+ MT_Point3 farpoint; // most extreme far point in camera coordinate
+ MT_Point3 nearpoint;// most extreme near point in camera coordinate
+ MT_Point3 farcenter(0.,0.,0.);// center of far cliping plane in camera coordinate
+ MT_Scalar F=1.0, N; // square distance of far and near point to origin
+ MT_Scalar f, n; // distance of far and near point to z axis. f is always > 0 but n can be < 0
+ MT_Scalar e, s; // far and near clipping distance (<0)
+ MT_Scalar c; // slope of center line = distance of far clipping center to z axis / far clipping distance
+ MT_Scalar z; // projection of sphere center on z axis (<0)
+ // tmp value
+ MT_Vector4 npoint(1., 1., 1., 1.);
+ MT_Vector4 hpoint;
+ MT_Point3 point;
+ MT_Scalar len;
+ for (int i=0; i<4; i++)
+ {
+ hpoint = clip_camcs_matrix*npoint;
+ point.setValue(hpoint[0]/hpoint[3], hpoint[1]/hpoint[3], hpoint[2]/hpoint[3]);
+ len = point.dot(point);
+ if (len > F)
+ {
+ nfar = npoint;
+ farpoint = point;
+ F = len;
+ }
+ // rotate by 90 degree along the z axis to walk through the 4 extreme points of the far clipping plane
+ len = npoint[0];
+ npoint[0] = -npoint[1];
+ npoint[1] = len;
+ farcenter += point;
+ }
+ // the far center is the average of the far clipping points
+ farcenter *= 0.25;
+ // the extreme near point is the opposite point on the near clipping plane
+ nfar.setValue(-nfar[0], -nfar[1], -1., 1.);
+ nfar = clip_camcs_matrix*nfar;
+ nearpoint.setValue(nfar[0]/nfar[3], nfar[1]/nfar[3], nfar[2]/nfar[3]);
+ N = nearpoint.dot(nearpoint);
+ e = farpoint[2];
+ s = nearpoint[2];
+ // projection on XY plane for distance to axis computation
+ MT_Point2 farxy(farpoint[0], farpoint[1]);
+ // f is forced positive by construction
+ f = farxy.length();
+ // get corresponding point on the near plane
+ farxy *= s/e;
+ // this formula preserve the sign of n
+ n = f*s/e - MT_Point2(nearpoint[0]-farxy[0], nearpoint[1]-farxy[1]).length();
+ c = MT_Point2(farcenter[0], farcenter[1]).length()/e;
+ // the big formula, it simplifies to (F-N)/(2(e-s)) for the symmetric case
+ z = (F-N)/(2.0*(e-s+c*(f-n)));
+ m_frustum_center = MT_Point3(farcenter[0]*z/e, farcenter[1]*z/e, z);
+ m_frustum_radius = m_frustum_center.distance(farpoint);
+
+#if 0
+ // The most extreme points on the near and far plane. (normalized device coords)
+ MT_Vector4 hnear(1., 1., 0., 1.), hfar(1., 1., 1., 1.);
// Transform to hom camera local space
hnear = clip_camcs_matrix*hnear;
@@ -273,10 +338,12 @@ void KX_Camera::ExtractFrustumSphere()
MT_Point3 farpoint(hfar[0]/hfar[3], hfar[1]/hfar[3], hfar[2]/hfar[3]);
// Compute center
+ // don't use camera data in case the user specifies the matrix directly
m_frustum_center = MT_Point3(0., 0.,
- (nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(m_camdata.m_clipend - m_camdata.m_clipstart)));
+ (nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(nearpoint[2]-farpoint[2] /*m_camdata.m_clipend - m_camdata.m_clipstart*/)));
m_frustum_radius = m_frustum_center.distance(farpoint);
-
+#endif
+
// Transform to world space.
m_frustum_center = GetCameraToWorld()(m_frustum_center);
m_frustum_radius /= fabs(NodeGetWorldScaling()[NodeGetWorldScaling().closestAxis()]);
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index a168beb9a70..e4a37b589a8 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -615,6 +615,7 @@ void KX_GameObject::setAngularVelocity(const MT_Vector3& ang_vel,bool local)
m_pPhysicsController1->SetAngularVelocity(ang_vel,local);
}
+
void KX_GameObject::ResolveCombinedVelocities(
const MT_Vector3 & lin_vel,
const MT_Vector3 & ang_vel,
@@ -969,6 +970,10 @@ PyMethodDef KX_GameObject::Methods[] = {
{"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS},
{"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O},
{"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O},
+ {"applyForce", (PyCFunction) KX_GameObject::sPyApplyForce, METH_VARARGS},
+ {"applyTorque", (PyCFunction) KX_GameObject::sPyApplyTorque, METH_VARARGS},
+ {"applyRotation", (PyCFunction) KX_GameObject::sPyApplyRotation, METH_VARARGS},
+ {"applyMovement", (PyCFunction) KX_GameObject::sPyApplyMovement, METH_VARARGS},
{"getLinearVelocity", (PyCFunction) KX_GameObject::sPyGetLinearVelocity, METH_VARARGS},
{"setLinearVelocity", (PyCFunction) KX_GameObject::sPySetLinearVelocity, METH_VARARGS},
{"getAngularVelocity", (PyCFunction) KX_GameObject::sPyGetAngularVelocity, METH_VARARGS},
@@ -1261,6 +1266,65 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr
return SCA_IObject::_setattr(attr, value);
}
+PyObject* KX_GameObject::PyApplyForce(PyObject* self, PyObject* args)
+{
+ int local = 0;
+ PyObject* pyvect;
+
+ if (PyArg_ParseTuple(args, "O|i", &pyvect, &local)) {
+ MT_Vector3 force;
+ if (PyVecTo(pyvect, force)) {
+ ApplyForce(force, (local!=0));
+ Py_RETURN_NONE;
+ }
+ }
+ return NULL;
+}
+
+PyObject* KX_GameObject::PyApplyTorque(PyObject* self, PyObject* args)
+{
+ int local = 0;
+ PyObject* pyvect;
+
+ if (PyArg_ParseTuple(args, "O|i", &pyvect, &local)) {
+ MT_Vector3 torque;
+ if (PyVecTo(pyvect, torque)) {
+ ApplyTorque(torque, (local!=0));
+ Py_RETURN_NONE;
+ }
+ }
+ return NULL;
+}
+
+PyObject* KX_GameObject::PyApplyRotation(PyObject* self, PyObject* args)
+{
+ int local = 0;
+ PyObject* pyvect;
+
+ if (PyArg_ParseTuple(args, "O|i", &pyvect, &local)) {
+ MT_Vector3 rotation;
+ if (PyVecTo(pyvect, rotation)) {
+ ApplyRotation(rotation, (local!=0));
+ Py_RETURN_NONE;
+ }
+ }
+ return NULL;
+}
+
+PyObject* KX_GameObject::PyApplyMovement(PyObject* self, PyObject* args)
+{
+ int local = 0;
+ PyObject* pyvect;
+
+ if (PyArg_ParseTuple(args, "O|i", &pyvect, &local)) {
+ MT_Vector3 movement;
+ if (PyVecTo(pyvect, movement)) {
+ ApplyMovement(movement, (local!=0));
+ Py_RETURN_NONE;
+ }
+ }
+ return NULL;
+}
PyObject* KX_GameObject::PyGetLinearVelocity(PyObject* self, PyObject* args)
{
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 20b15787d27..4f26031356f 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -772,6 +772,10 @@ public:
KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
KX_PYMETHOD_O(KX_GameObject,SetPosition);
KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
+ KX_PYMETHOD_VARARGS(KX_GameObject, ApplyForce);
+ KX_PYMETHOD_VARARGS(KX_GameObject, ApplyTorque);
+ KX_PYMETHOD_VARARGS(KX_GameObject, ApplyRotation);
+ KX_PYMETHOD_VARARGS(KX_GameObject, ApplyMovement);
KX_PYMETHOD_VARARGS(KX_GameObject,GetLinearVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,SetLinearVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 4184202c518..8516049f6d8 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -184,7 +184,6 @@ private:
void RenderDebugProperties();
void RenderShadowBuffers(KX_Scene *scene);
void SetBackGround(KX_WorldInfo* worldinfo);
- void SetWorldSettings(KX_WorldInfo* worldinfo);
void DoSound(KX_Scene* scene);
public:
@@ -193,6 +192,7 @@ public:
virtual ~KX_KetsjiEngine();
// set the devices and stuff. the client must take care of creating these
+ void SetWorldSettings(KX_WorldInfo* worldinfo);
void SetKeyboardDevice(SCA_IInputDevice* keyboarddevice);
void SetMouseDevice(SCA_IInputDevice* mousedevice);
void SetNetworkDevice(NG_NetworkDeviceInterface* networkdevice);
@@ -205,6 +205,8 @@ public:
void SetGame2IpoMode(bool game2ipo,int startFrame);
RAS_IRasterizer* GetRasterizer(){return m_rasterizer;};
+ RAS_ICanvas* GetCanvas(){return m_canvas;};
+ RAS_IRenderTools* GetRenderTools(){return m_rendertools;};
///returns true if an update happened to indicate -> Render
bool NextFrame();
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 0032d83c2ff..7ac817488fe 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -70,9 +70,12 @@
#include "PyObjectPlus.h"
+//XXX
+#if 0
extern "C" {
#include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
}
+#endif
#include "marshal.h" /* python header for loading/saving dicts */
@@ -1458,7 +1461,7 @@ PyObject* initGameKeys()
PyObject* initMathutils()
{
- return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
+ return NULL; //XXX Mathutils_Init("Mathutils"); // Use as a top level module in BGE
}
void KX_SetActiveScene(class KX_Scene* scene)
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index caa71441b1d..476a931355f 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1249,7 +1249,7 @@ void KX_Scene::MarkVisible(RAS_IRasterizer* rasty, KX_GameObject* gameobj,KX_Cam
// If the camera is inside this node, then the object is visible.
if (!vis)
{
- vis = gameobj->GetSGNode()->inside( GetActiveCamera()->GetCameraLocation() );
+ vis = gameobj->GetSGNode()->inside( cam->GetCameraLocation() );
}
// Test the object's bound sphere against the view frustum.
diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile
index 0b48ad8b8c3..bdc0b335b02 100644
--- a/source/gameengine/Ketsji/Makefile
+++ b/source/gameengine/Ketsji/Makefile
@@ -61,7 +61,7 @@ CPPFLAGS += -I.
CPPFLAGS += -I../Converter
CPPFLAGS += -I../../blender/blenkernel
CPPFLAGS += -I../../blender/blenlib
-CPPFLAGS += -I../../blender/include
+CPPFLAGS += -I../../blender/editors/include
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/gpu
diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript
index f5c620b583f..7d2cfb403c0 100644
--- a/source/gameengine/Ketsji/SConscript
+++ b/source/gameengine/Ketsji/SConscript
@@ -5,17 +5,18 @@ Import ('env')
sources = env.Glob('*.cpp')
+#XXX
# Mathutils C files.
-sources.extend([\
- '#source/blender/python/api2_2x/Mathutils.c',\
- '#source/blender/python/api2_2x/constant.c',\
- '#source/blender/python/api2_2x/euler.c',\
- '#source/blender/python/api2_2x/gen_utils.c',\
- '#source/blender/python/api2_2x/matrix.c',\
- '#source/blender/python/api2_2x/point.c',\
- '#source/blender/python/api2_2x/quat.c',\
- '#source/blender/python/api2_2x/vector.c',\
-])
+#sources.extend([\
+# '#source/blender/python/api2_2x/Mathutils.c',\
+# '#source/blender/python/api2_2x/constant.c',\
+# '#source/blender/python/api2_2x/euler.c',\
+# '#source/blender/python/api2_2x/gen_utils.c',\
+# '#source/blender/python/api2_2x/matrix.c',\
+# '#source/blender/python/api2_2x/point.c',\
+# '#source/blender/python/api2_2x/quat.c',\
+# '#source/blender/python/api2_2x/vector.c',\
+#])
incs = '. #source/blender/python/api2_2x' # Only for Mathutils! - no other deps
@@ -25,7 +26,7 @@ incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/op
incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf #intern/moto/include'
incs += ' #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork #source/blender/blenlib'
-incs += ' #source/blender/blenkernel #source/blender #source/blender/include'
+incs += ' #source/blender/blenkernel #source/blender #source/blender/editors/include'
incs += ' #source/blender/makesdna #source/blender/python #source/gameengine/Rasterizer'
incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions #source/gameengine/Network'
incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #source/gameengine/Physics/Bullet'
@@ -47,4 +48,4 @@ incs += ' ' + env['BF_OPENGL_INC']
if env['WITH_BF_SDL']:
incs += ' ' + env['BF_SDL_INC']
-env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 72], compileflags = cflags )
+env.BlenderLib ( 'bf_ketsji', sources, Split(incs), [], libtype=['game','player'], priority=[25, 60], compileflags = cflags )
diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript
index 987603f1a49..1cf94cc10ea 100644
--- a/source/gameengine/Network/LoopBackNetwork/SConscript
+++ b/source/gameengine/Network/LoopBackNetwork/SConscript
@@ -5,4 +5,4 @@ sources = 'NG_LoopBackNetworkDeviceInterface.cpp'
incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network'
-env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[25, 165] )
+env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['game2', 'player'], priority=[35, 155] )
diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript
index 0778418045f..6cbf8608788 100644
--- a/source/gameengine/Network/SConscript
+++ b/source/gameengine/Network/SConscript
@@ -5,4 +5,4 @@ sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_Netw
incs = '. #source/kernel/gen_system #intern/string #intern/moto/include'
-env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['game2', 'player'], priority=[15, 160] )
+env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['game2', 'player'], priority=[15, 150] )
diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript
index 0936d45197a..138ae493013 100644
--- a/source/gameengine/Physics/Bullet/SConscript
+++ b/source/gameengine/Physics/Bullet/SConscript
@@ -12,4 +12,4 @@ if env['OURPLATFORM']=='win32-vc':
cflags.append('/GR')
cflags.append('/O2')
-env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['game','player'], priority=[15,90] )
+env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['game','player'], priority=[15,80] )
diff --git a/source/gameengine/Physics/Dummy/SConscript b/source/gameengine/Physics/Dummy/SConscript
index e24b150531f..59579eb7132 100644
--- a/source/gameengine/Physics/Dummy/SConscript
+++ b/source/gameengine/Physics/Dummy/SConscript
@@ -5,4 +5,4 @@ sources = 'DummyPhysicsEnvironment.cpp'
incs = '. ../common'
-env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['game','player'], priority=[10,100] )
+env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['game','player'], priority=[10,95] )
diff --git a/source/gameengine/Physics/Sumo/SConscript b/source/gameengine/Physics/Sumo/SConscript
index 86e8db5919f..fdf6fdafec2 100644
--- a/source/gameengine/Physics/Sumo/SConscript
+++ b/source/gameengine/Physics/Sumo/SConscript
@@ -22,4 +22,4 @@ if env['OURPLATFORM']=='win32-vc':
cflags.append('/GR')
cflags.append('/O1')
-env.BlenderLib ( 'bf_sumo', sources, incs, [], libtype=['game2','player'], priority=[30, 70] , compileflags=cflags)
+env.BlenderLib ( 'bf_sumo', sources, incs, [], libtype=['game2','player'], priority=[40, 55] , compileflags=cflags)
diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript
index 91c5101675e..dff4c0fe6c6 100644
--- a/source/gameengine/Physics/common/SConscript
+++ b/source/gameengine/Physics/common/SConscript
@@ -5,4 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IPhysicsController.cpp PHY_IPhysicsEnvironme
incs = '. ../Dummy #intern/moto/include'
-env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['game', 'game2','player'], priority=[20, 35, 95] )
+env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['game', 'game2','player'], priority=[20, 45, 90] )
diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py
index 505ce253dd1..efeffab2eed 100644
--- a/source/gameengine/PyDoc/KX_GameObject.py
+++ b/source/gameengine/PyDoc/KX_GameObject.py
@@ -123,6 +123,50 @@ class KX_GameObject:
@return: The game object's rotation matrix
@note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed.
"""
+ def applyMovement(movement, local = 0):
+ """
+ Sets the game object's movement.
+
+ @type movement: 3d vector.
+ @param movement: movement vector.
+ @type local: boolean
+ @param local: - False: you get the "global" movement ie: relative to world orientation (default).
+ - True: you get the "local" movement ie: relative to object orientation.
+ """
+ def applyRotation(movement, local = 0):
+ """
+ Sets the game object's rotation.
+
+ @type rotation: 3d vector.
+ @param rotation: rotation vector.
+ @type local: boolean
+ @param local: - False: you get the "global" rotation ie: relative to world orientation (default).
+ - True: you get the "local" rotation ie: relative to object orientation.
+ """
+ def applyForce(force, local = 0):
+ """
+ Sets the game object's force.
+
+ This requires a dynamic object.
+
+ @type force: 3d vector.
+ @param force: force vector.
+ @type local: boolean
+ @param local: - False: you get the "global" force ie: relative to world orientation (default).
+ - True: you get the "local" force ie: relative to object orientation.
+ """
+ def applyTorque(torque, local = 0):
+ """
+ Sets the game object's torque.
+
+ This requires a dynamic object.
+
+ @type torque: 3d vector.
+ @param torque: torque vector.
+ @type local: boolean
+ @param local: - False: you get the "global" torque ie: relative to world orientation (default).
+ - True: you get the "local" torque ie: relative to object orientation.
+ """
def getLinearVelocity(local = 0):
"""
Gets the game object's linear velocity.
@@ -143,6 +187,8 @@ class KX_GameObject:
This method sets game object's velocity through it's centre of mass,
ie no angular velocity component.
+ This requires a dynamic object.
+
@type velocity: 3d vector.
@param velocity: linear velocity vector.
@type local: boolean
@@ -163,6 +209,8 @@ class KX_GameObject:
"""
Sets the game object's angular velocity.
+ This requires a dynamic object.
+
@type velocity: 3d vector.
@param velocity: angular velocity vector.
@type local: boolean
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index d2cfa7d07f9..282c7306285 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -58,7 +58,7 @@
RAS_2DFilterManager::RAS_2DFilterManager():
texturewidth(-1), textureheight(-1),
canvaswidth(-1), canvasheight(-1),
-numberoffilters(0)
+numberoffilters(0), need_tex_update(true)
{
isshadersupported = GLEW_ARB_shader_objects &&
GLEW_ARB_fragment_shader && GLEW_ARB_multitexture;
@@ -217,50 +217,50 @@ void RAS_2DFilterManager::StartShaderProgram(int passindex)
glActiveTextureARB(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texname[0]);
- if (uniformLoc != -1)
- {
+ if (uniformLoc != -1)
+ {
glUniform1iARB(uniformLoc, 0);
- }
+ }
- /* send depth texture to glsl program if it needs */
+ /* send depth texture to glsl program if it needs */
if(texflag[passindex] & 0x1){
- uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture");
- glActiveTextureARB(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, texname[1]);
+ uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_DepthTexture");
+ glActiveTextureARB(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, texname[1]);
- if (uniformLoc != -1)
- {
- glUniform1iARB(uniformLoc, 1);
- }
- }
+ if (uniformLoc != -1)
+ {
+ glUniform1iARB(uniformLoc, 1);
+ }
+ }
- /* send luminance texture to glsl program if it needs */
+ /* send luminance texture to glsl program if it needs */
if(texflag[passindex] & 0x2){
- uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture");
- glActiveTextureARB(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_2D, texname[2]);
-
- if (uniformLoc != -1)
- {
- glUniform1iARB(uniformLoc, 2);
- }
+ uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_LuminanceTexture");
+ glActiveTextureARB(GL_TEXTURE2);
+ glBindTexture(GL_TEXTURE_2D, texname[2]);
+
+ if (uniformLoc != -1)
+ {
+ glUniform1iARB(uniformLoc, 2);
+ }
}
uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_TextureCoordinateOffset");
- if (uniformLoc != -1)
- {
- glUniform2fvARB(uniformLoc, 9, textureoffsets);
- }
+ if (uniformLoc != -1)
+ {
+ glUniform2fvARB(uniformLoc, 9, textureoffsets);
+ }
uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureWidth");
- if (uniformLoc != -1)
- {
+ if (uniformLoc != -1)
+ {
glUniform1fARB(uniformLoc,texturewidth);
- }
+ }
uniformLoc = glGetUniformLocationARB(m_filters[passindex], "bgl_RenderedTextureHeight");
- if (uniformLoc != -1)
- {
+ if (uniformLoc != -1)
+ {
glUniform1fARB(uniformLoc,textureheight);
- }
+ }
int i, objProperties = m_properties[passindex].size();
for(i=0; i<objProperties; i++)
@@ -332,20 +332,20 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas)
RAS_Rect canvas_rect = canvas->GetWindowArea();
canvaswidth = canvas->GetWidth();
canvasheight = canvas->GetHeight();
- texturewidth = canvaswidth;
- textureheight = canvasheight;
+ texturewidth = canvaswidth + canvas_rect.GetLeft();
+ textureheight = canvasheight + canvas_rect.GetBottom();
GLint i,j;
i = 0;
- while ((1 << i) <= texturewidth)
- i++;
- texturewidth = (1 << (i));
+ while ((1 << i) <= texturewidth)
+ i++;
+ texturewidth = (1 << (i));
- // Now for height
- i = 0;
- while ((1 << i) <= textureheight)
- i++;
- textureheight = (1 << (i));
+ // Now for height
+ i = 0;
+ while ((1 << i) <= textureheight)
+ i++;
+ textureheight = (1 << (i));
GLfloat xInc = 1.0f / (GLfloat)texturewidth;
GLfloat yInc = 1.0f / (GLfloat)textureheight;
@@ -360,6 +360,23 @@ void RAS_2DFilterManager::UpdateOffsetMatrix(RAS_ICanvas* canvas)
}
}
+void RAS_2DFilterManager::UpdateCanvasTextureCoord(unsigned int * viewport)
+{
+ /*
+ This function update canvascoord[].
+ These parameters are used to create texcoord[1]
+ That way we can access the texcoord relative to the canvas:
+ (0.0,0.0) bottom left, (1.0,1.0) top right, (0.5,0.5) center
+ */
+ canvascoord[0] = (GLfloat) viewport[0] / viewport[2];
+ canvascoord[0] *= -1;
+ canvascoord[1] = (GLfloat) (texturewidth - viewport[0]) / viewport[2];
+
+ canvascoord[2] = (GLfloat) viewport[1] / viewport[3];
+ canvascoord[2] *= -1;
+ canvascoord[3] = (GLfloat)(textureheight - viewport[1]) / viewport[3];
+}
+
void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
{
bool need_depth=false;
@@ -387,27 +404,35 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
if(num_filters <= 0)
return;
+ GLuint viewport[4]={0};
+ glGetIntegerv(GL_VIEWPORT,(GLint *)viewport);
+
if(canvaswidth != canvas->GetWidth() || canvasheight != canvas->GetHeight())
{
UpdateOffsetMatrix(canvas);
+ UpdateCanvasTextureCoord((unsigned int*)viewport);
+ need_tex_update = true;
+ }
+
+ if(need_tex_update)
+ {
SetupTextures(need_depth, need_luminance);
+ need_tex_update = false;
}
- GLuint viewport[4]={0};
if(need_depth){
glActiveTextureARB(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, texname[1]);
- glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, viewport[0], viewport[1], texturewidth,textureheight, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, 0, 0, texturewidth,textureheight, 0);
}
if(need_luminance){
glActiveTextureARB(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, texname[2]);
- glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, viewport[0], viewport[1] , texturewidth,textureheight, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, 0, 0, texturewidth,textureheight, 0);
}
- glGetIntegerv(GL_VIEWPORT,(GLint *)viewport);
- glViewport(viewport[0],viewport[1], texturewidth, textureheight);
+ glViewport(0,0, texturewidth, textureheight);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_TEXTURE);
@@ -425,20 +450,15 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
glActiveTextureARB(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texname[0]);
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, viewport[0], viewport[1], texturewidth, textureheight, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, texturewidth, textureheight, 0);
glClear(GL_COLOR_BUFFER_BIT);
- float canvascoordx, canvascoordy;
-
- canvascoordx = (GLfloat) texturewidth / canvaswidth;
- canvascoordy = (GLfloat) textureheight / canvasheight;
-
glBegin(GL_QUADS);
glColor4f(1.f, 1.f, 1.f, 1.f);
- glTexCoord2f(1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, canvascoordx, canvascoordy); glVertex2f(1,1);
- glTexCoord2f(0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, canvascoordy); glVertex2f(-1,1);
- glTexCoord2f(0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0); glVertex2f(-1,-1);
- glTexCoord2f(1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, canvascoordx, 0.0); glVertex2f(1,-1);
+ glTexCoord2f(1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); glVertex2f(1,1);
+ glTexCoord2f(0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); glVertex2f(-1,1);
+ glTexCoord2f(0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); glVertex2f(-1,-1);
+ glTexCoord2f(1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); glVertex2f(1,-1);
glEnd();
}
}
@@ -454,7 +474,7 @@ void RAS_2DFilterManager::EnableFilter(vector<STR_String>& propNames, void* game
return;
if(pass<0 || pass>=MAX_RENDER_PASS)
return;
-
+ need_tex_update = true;
if(mode == RAS_2DFILTER_DISABLED)
{
m_enabled[pass] = 0;
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
index 454643a5077..6a420a974d4 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h
@@ -44,7 +44,9 @@ private:
void FreeTextures();
void UpdateOffsetMatrix(RAS_ICanvas* canvas);
-
+ void UpdateCanvasTextureCoord(unsigned int * viewport);
+
+ float canvascoord[4];
float textureoffsets[18];
float view[4];
/* texname[0] contains render to texture, texname[1] contains depth texture, texname[2] contains luminance texture*/
@@ -60,6 +62,7 @@ private:
bool isshadersupported;
bool errorprinted;
+ bool need_tex_update;
unsigned int m_filters[MAX_RENDER_PASS];
short m_enabled[MAX_RENDER_PASS];
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h
index 9cb59f300f7..610bd13ff12 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.h
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.h
@@ -212,9 +212,6 @@ public :
RAS_FrameFrustum &frustum
);
-
-private :
-
static
void
ComputeDefaultFrustum(
@@ -225,6 +222,8 @@ private :
RAS_FrameFrustum & frustum
);
+private :
+
static
void
ComputeBestFitViewRect(
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 411b28fa3b7..b4b90c3608b 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -200,6 +200,7 @@ public:
* @return true if stereo mode is enabled.
*/
virtual bool Stereo()=0;
+ virtual StereoMode GetStereoMode()=0;
virtual bool InterlacedStereo()=0;
/**
* Sets which eye buffer subsequent primitives will be rendered to.
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 87a0a1d8b9e..3cad5fe74f2 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -406,14 +406,16 @@ void RAS_OpenGLRasterizer::SetRenderArea()
break;
}
}
-
void RAS_OpenGLRasterizer::SetStereoMode(const StereoMode stereomode)
{
m_stereomode = stereomode;
}
-
+RAS_IRasterizer::StereoMode RAS_OpenGLRasterizer::GetStereoMode()
+{
+ return m_stereomode;
+}
bool RAS_OpenGLRasterizer::Stereo()
{
@@ -775,7 +777,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
float frustnear,
float frustfar,
float focallength,
- bool
+ bool
){
MT_Matrix4x4 result;
double mat[16];
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index 0717cce0ce8..d39fd642f86 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -137,6 +137,7 @@ public:
virtual void SetRenderArea();
virtual void SetStereoMode(const StereoMode stereomode);
+ virtual RAS_IRasterizer::StereoMode GetStereoMode();
virtual bool Stereo();
virtual bool InterlacedStereo();
virtual void SetEye(const StereoEye eye);
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
index 8d46528f7f0..0f2a537265a 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
@@ -6,4 +6,4 @@ sources = env.Glob('*.cpp')
incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines '
incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC']
-env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['game','player'], priority=[40, 120] )
+env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['game','player'], priority=[40, 115] )
diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript
index 23c1c24c297..90559e41bc0 100644
--- a/source/gameengine/SceneGraph/SConscript
+++ b/source/gameengine/SceneGraph/SConscript
@@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') #'SG_BBox.cpp SG_Controller.cpp SG_IObject.cpp SG_No
incs = '. #intern/moto/include'
-env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['game','player'], priority=[50,130] )
+env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['game','player'], priority=[50,125] )
diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt
index 1674602edd7..12b6b83cabe 100644
--- a/source/gameengine/VideoTexture/CMakeLists.txt
+++ b/source/gameengine/VideoTexture/CMakeLists.txt
@@ -39,6 +39,7 @@ SET(INC
../../../source/blender/blenlib
../../../source/blender/blenkernel
../../../source/blender/makesdna
+ ../../../source/blender/editors/include
../../../source/blender/imbuf
../../../source/blender/python
../../../source/blender/gpu
diff --git a/source/gameengine/VideoTexture/Exception.cpp b/source/gameengine/VideoTexture/Exception.cpp
index 3f939de6bc2..8704d49f2a7 100644
--- a/source/gameengine/VideoTexture/Exception.cpp
+++ b/source/gameengine/VideoTexture/Exception.cpp
@@ -204,6 +204,12 @@ void registerAllExceptions(void)
ImageSizesNotMatchDesc.registerDesc();
SceneInvalidDesc.registerDesc();
CameraInvalidDesc.registerDesc();
+ ObserverInvalidDesc.registerDesc();
+ MirrorInvalidDesc.registerDesc();
+ MirrorSizeInvalidDesc.registerDesc();
+ MirrorNormalInvalidDesc.registerDesc();
+ MirrorHorizontalDesc.registerDesc();
+ MirrorTooSmallDesc.registerDesc();
SourceVideoEmptyDesc.registerDesc();
SourceVideoCreationDesc.registerDesc();
}
diff --git a/source/gameengine/VideoTexture/Exception.h b/source/gameengine/VideoTexture/Exception.h
index 5345e87f199..1a3c25071b1 100644
--- a/source/gameengine/VideoTexture/Exception.h
+++ b/source/gameengine/VideoTexture/Exception.h
@@ -202,6 +202,12 @@ extern ExpDesc MaterialNotAvailDesc;
extern ExpDesc ImageSizesNotMatchDesc;
extern ExpDesc SceneInvalidDesc;
extern ExpDesc CameraInvalidDesc;
+extern ExpDesc ObserverInvalidDesc;
+extern ExpDesc MirrorInvalidDesc;
+extern ExpDesc MirrorSizeInvalidDesc;
+extern ExpDesc MirrorNormalInvalidDesc;
+extern ExpDesc MirrorHorizontalDesc;
+extern ExpDesc MirrorTooSmallDesc;
extern ExpDesc SourceVideoEmptyDesc;
extern ExpDesc SourceVideoCreationDesc;
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index a8f7871fa21..58697ed3cc7 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -24,96 +24,238 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <PyObjectPlus.h>
#include <structmember.h>
+#include <float.h>
+#include <math.h>
-#include <KX_BlenderCanvas.h>
-#include <KX_BlenderRenderTools.h>
-#include <RAS_IRasterizer.h>
-#include <RAS_OpenGLRasterizer.h>
-#include <KX_WorldInfo.h>
-#include <KX_Light.h>
-#include "ImageRender.h"
+#include <BIF_gl.h>
+
+#include "KX_PythonInit.h"
+#include "DNA_scene_types.h"
+#include "RAS_CameraData.h"
+#include "RAS_MeshObject.h"
+#include "BLI_arithb.h"
+#include "ImageRender.h"
#include "ImageBase.h"
#include "BlendType.h"
#include "Exception.h"
+#include "Texture.h"
-ExceptionID SceneInvalid, CameraInvalid;
+ExceptionID SceneInvalid, CameraInvalid, ObserverInvalid;
+ExceptionID MirrorInvalid, MirrorSizeInvalid, MirrorNormalInvalid, MirrorHorizontal, MirrorTooSmall;
ExpDesc SceneInvalidDesc (SceneInvalid, "Scene object is invalid");
ExpDesc CameraInvalidDesc (CameraInvalid, "Camera object is invalid");
-
-#if 0 // not yet supported
+ExpDesc ObserverInvalidDesc (ObserverInvalid, "Observer object is invalid");
+ExpDesc MirrorInvalidDesc (MirrorInvalid, "Mirror object is invalid");
+ExpDesc MirrorSizeInvalidDesc (MirrorSizeInvalid, "Mirror has no vertex or no size");
+ExpDesc MirrorNormalInvalidDesc (MirrorNormalInvalid, "Cannot determine mirror plane");
+ExpDesc MirrorHorizontalDesc (MirrorHorizontal, "Mirror is horizontal in local space");
+ExpDesc MirrorTooSmallDesc (MirrorTooSmall, "Mirror is too small");
// constructor
-ImageRender::ImageRender (KX_Scene * scene, KX_Camera * camera) : m_scene(scene),
-m_camera(camera)
+ImageRender::ImageRender (KX_Scene * scene, KX_Camera * camera) :
+ ImageViewport(),
+ m_render(true),
+ m_scene(scene),
+ m_camera(camera),
+ m_owncamera(false),
+ m_observer(NULL),
+ m_mirror(NULL),
+ m_clip(100.f)
{
- // create screen area
- m_area.winrct.xmin = m_upLeft[0];
- m_area.winrct.ymin = m_upLeft[1];
- m_area.winx = m_size[0];
- m_area.winy = m_size[1];
- // create canvas
- m_canvas = new KX_BlenderCanvas(&m_area);
- // create render tools
- m_rendertools = new KX_BlenderRenderTools();
- // create rasterizer
- m_rasterizer = new RAS_OpenGLRasterizer(m_canvas);
- m_rasterizer->Init();
// initialize background colour
- setBackground(0, 0, 255);
- // refresh lights
- refreshLights();
+ setBackground(0, 0, 255, 255);
+ // retrieve rendering objects
+ m_engine = KX_GetActiveEngine();
+ m_rasterizer = m_engine->GetRasterizer();
+ m_canvas = m_engine->GetCanvas();
+ m_rendertools = m_engine->GetRenderTools();
}
// destructor
ImageRender::~ImageRender (void)
{
- // release allocated objects
- delete m_rasterizer;
- delete m_rendertools;
- delete m_canvas;
+ if (m_owncamera)
+ m_camera->Release();
}
// set background color
-void ImageRender::setBackground (unsigned char red, unsigned char green, unsigned char blue)
+void ImageRender::setBackground (int red, int green, int blue, int alpha)
{
- m_background[0] = red;
- m_background[1] = green;
- m_background[2] = blue;
- m_rasterizer->SetBackColor(m_background[0], m_background[1], m_background[2], 1.0);
+ m_background[0] = (red < 0) ? 0.f : (red > 255) ? 1.f : float(red)/255.f;
+ m_background[1] = (green < 0) ? 0.f : (green > 255) ? 1.f : float(green)/255.f;
+ m_background[2] = (blue < 0) ? 0.f : (blue > 255) ? 1.f : float(blue)/255.f;
+ m_background[3] = (alpha < 0) ? 0.f : (alpha > 255) ? 1.f : float(alpha)/255.f;
}
// capture image from viewport
void ImageRender::calcImage (unsigned int texId)
{
- // setup camera
- bool cameraPasive = !m_camera->GetViewport();
- // render scene
- Render();
- // reset camera
- if (cameraPasive) m_camera->EnableViewport(false);
+ if (m_rasterizer->GetDrawingMode() != RAS_IRasterizer::KX_TEXTURED || // no need for texture
+ m_camera->GetViewport() || // camera must be inactive
+ m_camera == m_scene->GetActiveCamera())
+ {
+ // no need to compute texture in non texture rendering
+ m_avail = false;
+ return;
+ }
+ // render the scene from the camera
+ Render();
// get image from viewport
ImageViewport::calcImage(texId);
+ // restore OpenGL state
+ m_canvas->EndFrame();
}
void ImageRender::Render()
{
- //
-}
+ RAS_FrameFrustum frustrum;
+
+ if (!m_render)
+ return;
+
+ if (m_mirror)
+ {
+ // mirror mode, compute camera frustrum, position and orientation
+ // convert mirror position and normal in world space
+ const MT_Matrix3x3 & mirrorObjWorldOri = m_mirror->GetSGNode()->GetWorldOrientation();
+ const MT_Point3 & mirrorObjWorldPos = m_mirror->GetSGNode()->GetWorldPosition();
+ const MT_Vector3 & mirrorObjWorldScale = m_mirror->GetSGNode()->GetWorldScaling();
+ MT_Point3 mirrorWorldPos =
+ mirrorObjWorldPos + mirrorObjWorldScale * (mirrorObjWorldOri * m_mirrorPos);
+ MT_Vector3 mirrorWorldZ = mirrorObjWorldOri * m_mirrorZ;
+ // get observer world position
+ const MT_Point3 & observerWorldPos = m_observer->GetSGNode()->GetWorldPosition();
+ // get plane D term = mirrorPos . normal
+ MT_Scalar mirrorPlaneDTerm = mirrorWorldPos.dot(mirrorWorldZ);
+ // compute distance of observer to mirror = D - observerPos . normal
+ MT_Scalar observerDistance = mirrorPlaneDTerm - observerWorldPos.dot(mirrorWorldZ);
+ // if distance < 0.01 => observer is on wrong side of mirror, don't render
+ if (observerDistance < 0.01f)
+ return;
+ // set camera world position = observerPos + normal * 2 * distance
+ MT_Point3 cameraWorldPos = observerWorldPos + (MT_Scalar(2.0)*observerDistance)*mirrorWorldZ;
+ m_camera->GetSGNode()->SetLocalPosition(cameraWorldPos);
+ // set camera orientation: z=normal, y=mirror_up in world space, x= y x z
+ MT_Vector3 mirrorWorldY = mirrorObjWorldOri * m_mirrorY;
+ MT_Vector3 mirrorWorldX = mirrorObjWorldOri * m_mirrorX;
+ MT_Matrix3x3 cameraWorldOri(
+ mirrorWorldX[0], mirrorWorldY[0], mirrorWorldZ[0],
+ mirrorWorldX[1], mirrorWorldY[1], mirrorWorldZ[1],
+ mirrorWorldX[2], mirrorWorldY[2], mirrorWorldZ[2]);
+ m_camera->GetSGNode()->SetLocalOrientation(cameraWorldOri);
+ m_camera->GetSGNode()->UpdateWorldData(0.0);
+ // compute camera frustrum:
+ // get position of mirror relative to camera: offset = mirrorPos-cameraPos
+ MT_Vector3 mirrorOffset = mirrorWorldPos - cameraWorldPos;
+ // convert to camera orientation
+ mirrorOffset = mirrorOffset * cameraWorldOri;
+ // scale mirror size to world scale:
+ // get closest local axis for mirror Y and X axis and scale height and width by local axis scale
+ MT_Scalar x, y;
+ x = fabs(m_mirrorY[0]);
+ y = fabs(m_mirrorY[1]);
+ float height = (x > y) ?
+ ((x > fabs(m_mirrorY[2])) ? mirrorObjWorldScale[0] : mirrorObjWorldScale[2]):
+ ((y > fabs(m_mirrorY[2])) ? mirrorObjWorldScale[1] : mirrorObjWorldScale[2]);
+ x = fabs(m_mirrorX[0]);
+ y = fabs(m_mirrorX[1]);
+ float width = (x > y) ?
+ ((x > fabs(m_mirrorX[2])) ? mirrorObjWorldScale[0] : mirrorObjWorldScale[2]):
+ ((y > fabs(m_mirrorX[2])) ? mirrorObjWorldScale[1] : mirrorObjWorldScale[2]);
+ width *= m_mirrorHalfWidth;
+ height *= m_mirrorHalfHeight;
+ // left = offsetx-width
+ // right = offsetx+width
+ // top = offsety+height
+ // bottom = offsety-height
+ // near = -offsetz
+ // far = near+100
+ frustrum.x1 = mirrorOffset[0]-width;
+ frustrum.x2 = mirrorOffset[0]+width;
+ frustrum.y1 = mirrorOffset[1]-height;
+ frustrum.y2 = mirrorOffset[1]+height;
+ frustrum.camnear = -mirrorOffset[2];
+ frustrum.camfar = -mirrorOffset[2]+m_clip;
+ }
+ const float ortho = 100.0;
+ const RAS_IRasterizer::StereoMode stereomode = m_rasterizer->GetStereoMode();
+
+ // The screen area that ImageViewport will copy is also the rendering zone
+ m_canvas->SetViewPort(m_position[0], m_position[1], m_position[0]+m_capSize[0]-1, m_position[1]+m_capSize[1]-1);
+ m_canvas->ClearColor(m_background[0], m_background[1], m_background[2], m_background[3]);
+ m_canvas->ClearBuffer(RAS_ICanvas::COLOR_BUFFER|RAS_ICanvas::DEPTH_BUFFER);
+ m_rasterizer->BeginFrame(RAS_IRasterizer::KX_TEXTURED,m_engine->GetClockTime());
+ m_rendertools->BeginFrame(m_rasterizer);
+ m_engine->SetWorldSettings(m_scene->GetWorldInfo());
+ m_rendertools->SetAuxilaryClientInfo(m_scene);
+ m_rasterizer->DisplayFog();
+ // matrix calculation, don't apply any of the stereo mode
+ m_rasterizer->SetStereoMode(RAS_IRasterizer::RAS_STEREO_NOSTEREO);
+ if (m_mirror)
+ {
+ // frustrum was computed above
+ // get frustrum matrix and set projection matrix
+ MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix(
+ frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar);
+
+ m_camera->SetProjectionMatrix(projmat);
+ } else if (m_camera->hasValidProjectionMatrix())
+ {
+ m_rasterizer->SetProjectionMatrix(m_camera->GetProjectionMatrix());
+ } else
+ {
+ float lens = m_camera->GetLens();
+ bool orthographic = !m_camera->GetCameraData()->m_perspective;
+ float nearfrust = m_camera->GetCameraNear();
+ float farfrust = m_camera->GetCameraFar();
+ float aspect_ratio = 1.0f;
+ Scene *blenderScene = m_scene->GetBlenderScene();
+
+ if (orthographic) {
+ lens *= ortho;
+ nearfrust = (nearfrust + 1.0)*ortho;
+ farfrust *= ortho;
+ }
+ // compute the aspect ratio from frame blender scene settings so that render to texture
+ // works the same in Blender and in Blender player
+ if (blenderScene->r.ysch != 0)
+ aspect_ratio = float(blenderScene->r.xsch) / float(blenderScene->r.ysch);
+
+ RAS_FramingManager::ComputeDefaultFrustum(
+ nearfrust,
+ farfrust,
+ lens,
+ aspect_ratio,
+ frustrum);
+
+ MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix(
+ frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar);
+
+ m_camera->SetProjectionMatrix(projmat);
+ }
-// refresh lights
-void ImageRender::refreshLights (void)
-{
- // clear lights list
- //m_rendertools->RemoveAllLights();
- // set lights
- //for (int idx = 0; idx < scene->GetLightList()->GetCount(); ++idx)
- // m_rendertools->AddLight(((KX_LightObject*)(scene->GetLightList()->GetValue(idx)))->GetLightData());
-}
+ MT_Transform camtrans(m_camera->GetWorldToCamera());
+ if (!m_camera->GetCameraData()->m_perspective)
+ camtrans.getOrigin()[2] *= ortho;
+ MT_Matrix4x4 viewmat(camtrans);
+
+ m_rasterizer->SetViewMatrix(viewmat, m_camera->NodeGetWorldPosition(),
+ m_camera->GetCameraLocation(), m_camera->GetCameraOrientation());
+ m_camera->SetModelviewMatrix(viewmat);
+ // restore the stereo mode now that the matrix is computed
+ m_rasterizer->SetStereoMode(stereomode);
+
+ // do not update the mesh, we don't want to do it more than once per frame
+ //m_scene->UpdateMeshTransformations();
+ m_scene->CalculateVisibleMeshes(m_rasterizer,m_camera);
+
+ m_scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
+}
// cast Image pointer to ImageRender
@@ -174,26 +316,31 @@ static int ImageRender_init (PyObject * pySelf, PyObject * args, PyObject * kwds
// get background color
PyObject * getBackground (PyImage * self, void * closure)
{
- return Py_BuildValue("[BBB]", getImageRender(self)->getBackground()[0],
- getImageRender(self)->getBackground()[1], getImageRender(self)->getBackground()[2]);
+ return Py_BuildValue("[BBBB]",
+ getImageRender(self)->getBackground(0),
+ getImageRender(self)->getBackground(1),
+ getImageRender(self)->getBackground(2),
+ getImageRender(self)->getBackground(3));
}
// set color
static int setBackground (PyImage * self, PyObject * value, void * closure)
{
// check validity of parameter
- if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 3
+ if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 4
|| !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0))
|| !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))
- || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2)))
+ || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2))
+ || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 3)))
{
- PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 3 ints");
+ PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 4 integer between 0 and 255");
return -1;
}
// set background color
getImageRender(self)->setBackground((unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))),
(unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))),
- (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2))));
+ (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2))),
+ (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 3))));
// success
return 0;
}
@@ -209,6 +356,10 @@ static PyMethodDef imageRenderMethods[] =
static PyGetSetDef imageRenderGetSets[] =
{
{(char*)"background", (getter)getBackground, (setter)setBackground, (char*)"background color", NULL},
+ // attribute from ImageViewport
+ {(char*)"capsize", (getter)ImageViewport_getCaptureSize, (setter)ImageViewport_setCaptureSize, (char*)"size of render area", NULL},
+ {(char*)"alpha", (getter)ImageViewport_getAlpha, (setter)ImageViewport_setAlpha, (char*)"use alpha in texture", NULL},
+ {(char*)"whole", (getter)ImageViewport_getWhole, (setter)ImageViewport_setWhole, (char*)"use whole viewport to render", NULL},
// attributes from ImageBase class
{(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
{(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
@@ -263,5 +414,329 @@ PyTypeObject ImageRenderType =
Image_allocNew, /* tp_new */
};
+// object initialization
+static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds)
+{
+ // parameters - scene object
+ PyObject * scene;
+ // reference object for mirror
+ PyObject * observer;
+ // object holding the mirror
+ PyObject * mirror;
+ // material of the mirror
+ short materialID = 0;
+ // parameter keywords
+ static char *kwlist[] = {"scene", "observer", "mirror", "material", NULL};
+ // get parameters
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO|h", kwlist, &scene, &observer, &mirror, &materialID))
+ return -1;
+ try
+ {
+ // get scene pointer
+ KX_Scene * scenePtr (NULL);
+ if (scene != NULL && PyObject_TypeCheck(scene, &KX_Scene::Type))
+ scenePtr = static_cast<KX_Scene*>(scene);
+ else
+ THRWEXCP(SceneInvalid, S_OK);
+
+ // get observer pointer
+ KX_GameObject * observerPtr (NULL);
+ if (observer != NULL && PyObject_TypeCheck(observer, &KX_GameObject::Type))
+ observerPtr = static_cast<KX_GameObject*>(observer);
+ else if (observer != NULL && PyObject_TypeCheck(observer, &KX_Camera::Type))
+ observerPtr = static_cast<KX_Camera*>(observer);
+ else
+ THRWEXCP(ObserverInvalid, S_OK);
+
+ // get mirror pointer
+ KX_GameObject * mirrorPtr (NULL);
+ if (mirror != NULL && PyObject_TypeCheck(mirror, &KX_GameObject::Type))
+ mirrorPtr = static_cast<KX_GameObject*>(mirror);
+ else
+ THRWEXCP(MirrorInvalid, S_OK);
+
+ // locate the material in the mirror
+ RAS_IPolyMaterial * material = getMaterial(mirror, materialID);
+ if (material == NULL)
+ THRWEXCP(MaterialNotAvail, S_OK);
+
+ // get pointer to image structure
+ PyImage * self = reinterpret_cast<PyImage*>(pySelf);
+
+ // create source object
+ if (self->m_image != NULL)
+ {
+ delete self->m_image;
+ self->m_image = NULL;
+ }
+ self->m_image = new ImageRender(scenePtr, observerPtr, mirrorPtr, material);
+ }
+ catch (Exception & exp)
+ {
+ exp.report();
+ return -1;
+ }
+ // initialization succeded
+ return 0;
+}
+
+// get background color
+PyObject * getClip (PyImage * self, void * closure)
+{
+ return PyFloat_FromDouble(getImageRender(self)->getClip());
+}
+
+// set clip
+static int setClip (PyImage * self, PyObject * value, void * closure)
+{
+ // check validity of parameter
+ double clip;
+ if (value == NULL || !PyFloat_Check(value) || (clip = PyFloat_AsDouble(value)) < 0.01 || clip > 5000.0)
+ {
+ PyErr_SetString(PyExc_TypeError, "The value must be an float between 0.01 and 5000");
+ return -1;
+ }
+ // set background color
+ getImageRender(self)->setClip(float(clip));
+ // success
+ return 0;
+}
+
+// attributes structure
+static PyGetSetDef imageMirrorGetSets[] =
+{
+ {(char*)"clip", (getter)getClip, (setter)setClip, (char*)"clipping distance", NULL},
+ // attribute from ImageRender
+ {(char*)"background", (getter)getBackground, (setter)setBackground, (char*)"background color", NULL},
+ // attribute from ImageViewport
+ {(char*)"capsize", (getter)ImageViewport_getCaptureSize, (setter)ImageViewport_setCaptureSize, (char*)"size of render area", NULL},
+ {(char*)"alpha", (getter)ImageViewport_getAlpha, (setter)ImageViewport_setAlpha, (char*)"use alpha in texture", NULL},
+ {(char*)"whole", (getter)ImageViewport_getWhole, (setter)ImageViewport_setWhole, (char*)"use whole viewport to render", NULL},
+ // attributes from ImageBase class
+ {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
+ {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
+ {(char*)"scale", (getter)Image_getScale, (setter)Image_setScale, (char*)"fast scale of image (near neighbour)", NULL},
+ {(char*)"flip", (getter)Image_getFlip, (setter)Image_setFlip, (char*)"flip image vertically", NULL},
+ {(char*)"filter", (getter)Image_getFilter, (setter)Image_setFilter, (char*)"pixel filter", NULL},
+ {NULL}
+};
+
+
+// constructor
+ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObject * mirror, RAS_IPolyMaterial * mat) :
+ ImageViewport(),
+ m_render(false),
+ m_scene(scene),
+ m_observer(observer),
+ m_mirror(mirror),
+ m_clip(100.f)
+{
+ // this constructor is used for automatic planar mirror
+ // create a camera, take all data by default, in any case we will recompute the frustrum on each frame
+ RAS_CameraData camdata;
+ vector<RAS_TexVert*> mirrorVerts;
+ vector<RAS_TexVert*>::iterator it;
+ float mirrorArea = 0.f;
+ float mirrorNormal[3] = {0.f, 0.f, 0.f};
+ float mirrorUp[3];
+ float dist, vec[3], axis[3];
+ float zaxis[3] = {0.f, 0.f, 1.f};
+ float yaxis[3] = {0.f, 1.f, 0.f};
+ float mirrorMat[3][3];
+ float left, right, top, bottom, back;
+
+ m_camera= new KX_Camera(scene, KX_Scene::m_callbacks, camdata);
+ m_camera->SetName("__mirror__cam__");
+ // don't add the camera to the scene object list, it doesn't need to be accessible
+ m_owncamera = true;
+ // retrieve rendering objects
+ m_engine = KX_GetActiveEngine();
+ m_rasterizer = m_engine->GetRasterizer();
+ m_canvas = m_engine->GetCanvas();
+ m_rendertools = m_engine->GetRenderTools();
+ // locate the vertex assigned to mat and do following calculation in mesh coordinates
+ for (int meshIndex = 0; meshIndex < mirror->GetMeshCount(); meshIndex++)
+ {
+ RAS_MeshObject* mesh = mirror->GetMesh(meshIndex);
+ int numPolygons = mesh->NumPolygons();
+ for (int polygonIndex=0; polygonIndex < numPolygons; polygonIndex++)
+ {
+ RAS_Polygon* polygon = mesh->GetPolygon(polygonIndex);
+ if (polygon->GetMaterial()->GetPolyMaterial() == mat)
+ {
+ RAS_TexVert *v1, *v2, *v3, *v4;
+ float normal[3];
+ float area;
+ // this polygon is part of the mirror,
+ v1 = polygon->GetVertex(0);
+ v2 = polygon->GetVertex(1);
+ v3 = polygon->GetVertex(2);
+ mirrorVerts.push_back(v1);
+ mirrorVerts.push_back(v2);
+ mirrorVerts.push_back(v3);
+ if (polygon->VertexCount() == 4)
+ {
+ v4 = polygon->GetVertex(3);
+ mirrorVerts.push_back(v4);
+ area = CalcNormFloat4((float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ(), (float*)v4->getXYZ(), normal);
+ } else
+ {
+ area = CalcNormFloat((float*)v1->getXYZ(), (float*)v2->getXYZ(), (float*)v3->getXYZ(), normal);
+ }
+ area = fabs(area);
+ mirrorArea += area;
+ VecMulf(normal, area);
+ VecAddf(mirrorNormal, mirrorNormal, normal);
+ }
+ }
+ }
+ if (mirrorVerts.size() == 0 || mirrorArea < FLT_EPSILON)
+ {
+ // no vertex or zero size mirror
+ THRWEXCP(MirrorSizeInvalid, S_OK);
+ }
+ // compute average normal of mirror faces
+ VecMulf(mirrorNormal, 1.0f/mirrorArea);
+ if (Normalize(mirrorNormal) == 0.f)
+ {
+ // no normal
+ THRWEXCP(MirrorNormalInvalid, S_OK);
+ }
+ // the mirror plane has an equation of the type ax+by+cz = d where (a,b,c) is the normal vector
+ // if the mirror is more vertical then horizontal, the Z axis is the up direction.
+ // otherwise the Y axis is the up direction.
+ // If the mirror is not perfectly vertical(horizontal), the Z(Y) axis projection on the mirror
+ // plan by the normal will be the up direction.
+ if (fabs(mirrorNormal[2]) > fabs(mirrorNormal[1]) &&
+ fabs(mirrorNormal[2]) > fabs(mirrorNormal[0]))
+ {
+ // the mirror is more horizontal than vertical
+ VecCopyf(axis, yaxis);
+ }
+ else
+ {
+ // the mirror is more vertical than horizontal
+ VecCopyf(axis, zaxis);
+ }
+ dist = Inpf(mirrorNormal, axis);
+ if (fabs(dist) < FLT_EPSILON)
+ {
+ // the mirror is already fully aligned with up axis
+ VecCopyf(mirrorUp, axis);
+ }
+ else
+ {
+ // projection of axis to mirror plane through normal
+ VecCopyf(vec, mirrorNormal);
+ VecMulf(vec, dist);
+ VecSubf(mirrorUp, axis, vec);
+ if (Normalize(mirrorUp) == 0.f)
+ {
+ // should not happen
+ THRWEXCP(MirrorHorizontal, S_OK);
+ return;
+ }
+ }
+ // compute rotation matrix between local coord and mirror coord
+ // to match camera orientation, we select mirror z = -normal, y = up, x = y x z
+ VecCopyf(mirrorMat[2], mirrorNormal);
+ VecMulf(mirrorMat[2], -1.0f);
+ VecCopyf(mirrorMat[1], mirrorUp);
+ Crossf(mirrorMat[0], mirrorMat[1], mirrorMat[2]);
+ // transpose to make it a orientation matrix from local space to mirror space
+ Mat3Transp(mirrorMat);
+ // transform all vertex to plane coordinates and determine mirror position
+ left = FLT_MAX;
+ right = -FLT_MAX;
+ bottom = FLT_MAX;
+ top = -FLT_MAX;
+ back = -FLT_MAX; // most backward vertex (=highest Z coord in mirror space)
+ for (it = mirrorVerts.begin(); it != mirrorVerts.end(); it++)
+ {
+ VecCopyf(vec, (float*)(*it)->getXYZ());
+ Mat3MulVecfl(mirrorMat, vec);
+ if (vec[0] < left)
+ left = vec[0];
+ if (vec[0] > right)
+ right = vec[0];
+ if (vec[1] < bottom)
+ bottom = vec[1];
+ if (vec[1] > top)
+ top = vec[1];
+ if (vec[2] > back)
+ back = vec[2];
+ }
+ // now store this information in the object for later rendering
+ m_mirrorHalfWidth = (right-left)*0.5f;
+ m_mirrorHalfHeight = (top-bottom)*0.5f;
+ if (m_mirrorHalfWidth < 0.01f || m_mirrorHalfHeight < 0.01f)
+ {
+ // mirror too small
+ THRWEXCP(MirrorTooSmall, S_OK);
+ }
+ // mirror position in mirror coord
+ vec[0] = (left+right)*0.5f;
+ vec[1] = (top+bottom)*0.5f;
+ vec[2] = back;
+ // convert it in local space: transpose again the matrix to get back to mirror to local transform
+ Mat3Transp(mirrorMat);
+ Mat3MulVecfl(mirrorMat, vec);
+ // mirror position in local space
+ m_mirrorPos.setValue(vec[0], vec[1], vec[2]);
+ // mirror normal vector (pointed towards the back of the mirror) in local space
+ m_mirrorZ.setValue(-mirrorNormal[0], -mirrorNormal[1], -mirrorNormal[2]);
+ m_mirrorY.setValue(mirrorUp[0], mirrorUp[1], mirrorUp[2]);
+ m_mirrorX = m_mirrorY.cross(m_mirrorZ);
+ m_render = true;
+
+ setBackground(0, 0, 255, 255);
+}
+
+
+
+
+// define python type
+PyTypeObject ImageMirrorType =
+{
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "VideoTexture.ImageMirror", /*tp_name*/
+ sizeof(PyImage), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)Image_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash */
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ "Image source from mirror", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ imageRenderMethods, /* tp_methods */
+ 0, /* tp_members */
+ imageMirrorGetSets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)ImageMirror_init, /* tp_init */
+ 0, /* tp_alloc */
+ Image_allocNew, /* tp_new */
+};
+
-#endif // #if 0
diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h
index 66255f04d2c..c94e2f1e718 100644
--- a/source/gameengine/VideoTexture/ImageRender.h
+++ b/source/gameengine/VideoTexture/ImageRender.h
@@ -42,42 +42,56 @@ class ImageRender : public ImageViewport
public:
/// constructor
ImageRender (KX_Scene * scene, KX_Camera * camera);
+ ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObject * mirror, RAS_IPolyMaterial * mat);
/// destructor
virtual ~ImageRender (void);
/// get background color
- unsigned char * getBackground (void) { return m_background; }
+ int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); }
/// set background color
- void setBackground (unsigned char red, unsigned char green, unsigned char blue);
+ void setBackground (int red, int green, int blue, int alpha);
+
+ /// clipping distance
+ float getClip (void) { return m_clip; }
+ /// set whole buffer use
+ void setClip (float clip) { m_clip = clip; }
protected:
+ /// true if ready to render
+ bool m_render;
/// rendered scene
KX_Scene * m_scene;
/// camera for render
KX_Camera * m_camera;
-
- /// screen area for rendering
- ScrArea m_area;
- /// rendering device
- RAS_ICanvas * m_canvas;
- /// rasterizer
- RAS_IRasterizer * m_rasterizer;
- /// render tools
- RAS_IRenderTools * m_rendertools;
+ /// do we own the camera?
+ bool m_owncamera;
+ /// for mirror operation
+ KX_GameObject * m_observer;
+ KX_GameObject * m_mirror;
+ float m_clip; // clipping distance
+ float m_mirrorHalfWidth; // mirror width in mirror space
+ float m_mirrorHalfHeight; // mirror height in mirror space
+ MT_Point3 m_mirrorPos; // mirror center position in local space
+ MT_Vector3 m_mirrorZ; // mirror Z axis in local space
+ MT_Vector3 m_mirrorY; // mirror Y axis in local space
+ MT_Vector3 m_mirrorX; // mirror X axis in local space
+ /// canvas
+ RAS_ICanvas* m_canvas;
+ /// rasterizer
+ RAS_IRasterizer* m_rasterizer;
+ /// render tools
+ RAS_IRenderTools* m_rendertools;
+ /// engine
+ KX_KetsjiEngine* m_engine;
/// background colour
- unsigned char m_background[3];
+ float m_background[4];
/// render 3d scene to image
virtual void calcImage (unsigned int texId);
- /// refresh lights
- void refreshLights (void);
- /// methods from KX_KetsjiEngine
- bool BeginFrame();
- void EndFrame();
void Render();
void SetupRenderFrame(KX_Scene *scene, KX_Camera* cam);
void RenderFrame(KX_Scene* scene, KX_Camera* cam);
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp
index deb66ffb6ba..4c2c81e2208 100644
--- a/source/gameengine/VideoTexture/ImageViewport.cpp
+++ b/source/gameengine/VideoTexture/ImageViewport.cpp
@@ -34,12 +34,12 @@ http://www.gnu.org/copyleft/lesser.txt.
// constructor
-ImageViewport::ImageViewport (void) : m_texInit(false)
+ImageViewport::ImageViewport (void) : m_alpha(false), m_texInit(false)
{
// get viewport rectangle
glGetIntegerv(GL_VIEWPORT, m_viewport);
// create buffer for viewport image
- m_viewportImage = new BYTE [3 * getViewportSize()[0] * getViewportSize()[1]];
+ m_viewportImage = new BYTE [4 * getViewportSize()[0] * getViewportSize()[1]];
// set attributes
setWhole(false);
}
@@ -62,7 +62,7 @@ void ImageViewport::setWhole (bool whole)
m_capSize[idx] = whole ? short(getViewportSize()[idx])
: calcSize(short(getViewportSize()[idx]));
// position
- m_position[idx] = whole ? 0 : (getViewportSize()[idx] - m_capSize[idx]) >> 1;
+ m_position[idx] = whole ? 0 : ((getViewportSize()[idx] - m_capSize[idx]) >> 1);
}
// init image
init(m_capSize[0], m_capSize[1]);
@@ -123,20 +123,31 @@ void ImageViewport::calcImage (unsigned int texId)
&& m_capSize[1] == calcSize(m_capSize[1]) && !m_flip)
{
// just copy current viewport to texture
- glBindTexture(GL_TEXTURE_2D, texId);
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1]);
- // image is not available
- m_avail = false;
+ glBindTexture(GL_TEXTURE_2D, texId);
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1]);
+ // image is not available
+ m_avail = false;
}
// otherwise copy viewport to buffer, if image is not available
else if (!m_avail)
{
// get frame buffer data
- glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB,
- GL_UNSIGNED_BYTE, m_viewportImage);
- // filter loaded data
- FilterRGB24 filt;
- filterImage(filt, m_viewportImage, m_capSize);
+ if (m_alpha)
+ {
+ glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGBA,
+ GL_UNSIGNED_BYTE, m_viewportImage);
+ // filter loaded data
+ FilterRGBA32 filt;
+ filterImage(filt, m_viewportImage, m_capSize);
+ }
+ else
+ {
+ glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB,
+ GL_UNSIGNED_BYTE, m_viewportImage);
+ // filter loaded data
+ FilterRGB24 filt;
+ filterImage(filt, m_viewportImage, m_capSize);
+ }
}
}
@@ -151,14 +162,14 @@ inline ImageViewport * getImageViewport (PyImage * self)
// get whole
-static PyObject * ImageViewport_getWhole (PyImage * self, void * closure)
+PyObject * ImageViewport_getWhole (PyImage * self, void * closure)
{
if (self->m_image != NULL && getImageViewport(self)->getWhole()) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
}
// set whole
-static int ImageViewport_setWhole (PyImage * self, PyObject * value, void * closure)
+int ImageViewport_setWhole (PyImage * self, PyObject * value, void * closure)
{
// check parameter, report failure
if (value == NULL || !PyBool_Check(value))
@@ -172,6 +183,28 @@ static int ImageViewport_setWhole (PyImage * self, PyObject * value, void * clos
return 0;
}
+// get alpha
+PyObject * ImageViewport_getAlpha (PyImage * self, void * closure)
+{
+ if (self->m_image != NULL && getImageViewport(self)->getAlpha()) Py_RETURN_TRUE;
+ else Py_RETURN_FALSE;
+}
+
+// set whole
+int ImageViewport_setAlpha (PyImage * self, PyObject * value, void * closure)
+{
+ // check parameter, report failure
+ if (value == NULL || !PyBool_Check(value))
+ {
+ PyErr_SetString(PyExc_TypeError, "The value must be a bool");
+ return -1;
+ }
+ // set alpha
+ if (self->m_image != NULL) getImageViewport(self)->setAlpha(value == Py_True);
+ // success
+ return 0;
+}
+
// get position
static PyObject * ImageViewport_getPosition (PyImage * self, void * closure)
@@ -202,14 +235,14 @@ static int ImageViewport_setPosition (PyImage * self, PyObject * value, void * c
}
// get capture size
-static PyObject * ImageViewport_getCaptureSize (PyImage * self, void * closure)
+PyObject * ImageViewport_getCaptureSize (PyImage * self, void * closure)
{
return Py_BuildValue("(ii)", getImageViewport(self)->getCaptureSize()[0],
getImageViewport(self)->getCaptureSize()[1]);
}
// set capture size
-static int ImageViewport_setCaptureSize (PyImage * self, PyObject * value, void * closure)
+int ImageViewport_setCaptureSize (PyImage * self, PyObject * value, void * closure)
{
// check validity of parameter
if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2
@@ -242,6 +275,7 @@ static PyGetSetDef imageViewportGetSets[] =
{(char*)"whole", (getter)ImageViewport_getWhole, (setter)ImageViewport_setWhole, (char*)"use whole viewport to capture", NULL},
{(char*)"position", (getter)ImageViewport_getPosition, (setter)ImageViewport_setPosition, (char*)"upper left corner of captured area", NULL},
{(char*)"capsize", (getter)ImageViewport_getCaptureSize, (setter)ImageViewport_setCaptureSize, (char*)"size of viewport area being captured", NULL},
+ {(char*)"alpha", (getter)ImageViewport_getAlpha, (setter)ImageViewport_setAlpha, (char*)"use alpha in texture", NULL},
// attributes from ImageBase class
{(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL},
{(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL},
diff --git a/source/gameengine/VideoTexture/ImageViewport.h b/source/gameengine/VideoTexture/ImageViewport.h
index 4265906b8f5..0449249cf95 100644
--- a/source/gameengine/VideoTexture/ImageViewport.h
+++ b/source/gameengine/VideoTexture/ImageViewport.h
@@ -43,6 +43,12 @@ public:
bool getWhole (void) { return m_whole; }
/// set whole buffer use
void setWhole (bool whole);
+
+ /// is alpha channel used
+ bool getAlpha (void) { return m_alpha; }
+ /// set whole buffer use
+ void setAlpha (bool alpha) { m_alpha = alpha; }
+
/// get capture size in viewport
short * getCaptureSize (void) { return m_capSize; }
/// set capture size in viewport
@@ -61,6 +67,8 @@ protected:
short m_capSize[2];
/// use whole viewport
bool m_whole;
+ /// use alpha channel
+ bool m_alpha;
/// position of capture rectangle in viewport
GLint m_position[2];
@@ -79,6 +87,12 @@ protected:
GLint * getViewportSize (void) { return m_viewport + 2; }
};
+PyObject * ImageViewport_getCaptureSize (PyImage * self, void * closure);
+int ImageViewport_setCaptureSize (PyImage * self, PyObject * value, void * closure);
+PyObject * ImageViewport_getWhole (PyImage * self, void * closure);
+int ImageViewport_setWhole (PyImage * self, PyObject * value, void * closure);
+PyObject * ImageViewport_getAlpha (PyImage * self, void * closure);
+int ImageViewport_setAlpha (PyImage * self, PyObject * value, void * closure);
#endif
diff --git a/source/gameengine/VideoTexture/Makefile b/source/gameengine/VideoTexture/Makefile
index bead176808b..e4a70428c60 100644
--- a/source/gameengine/VideoTexture/Makefile
+++ b/source/gameengine/VideoTexture/Makefile
@@ -51,7 +51,7 @@ CPPFLAGS += -I../../kernel/gen_system
CPPFLAGS += -I.
CPPFLAGS += -I../../blender/blenkernel
CPPFLAGS += -I../../blender/blenlib
-CPPFLAGS += -I../../blender/include
+CPPFLAGS += -I../../blender/editors/include
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I../../blender/imbuf
CPPFLAGS += -I../../blender/gpu
diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript
index f3fe0dab6ad..91a74516bc5 100644
--- a/source/gameengine/VideoTexture/SConscript
+++ b/source/gameengine/VideoTexture/SConscript
@@ -9,7 +9,7 @@ incs = '. #source/gameengine/Ketsji #source/gameengine/Expressions'
incs += ' #source/gameengine/GameLogic #source/gameengine/SceneGraph #source/gameengine/Rasterizer'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer'
incs += ' #source/gameengine/BlenderRoutines'
-incs += ' #source/blender/include #source/blender/blenlib #source/blender/blenkernel'
+incs += ' #source/blender/editors/include #source/blender/blenlib #source/blender/blenkernel'
incs += ' #source/blender/makesdna #source/blender/imbuf #source/blender/python'
incs += ' #source/blender/gpu #source/kernel/gen_system #intern/string #intern/moto/include'
incs += ' #intern/guardedalloc #intern/SoundSystem'
diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp
index 66c67023e38..12d4e79ad89 100644
--- a/source/gameengine/VideoTexture/Texture.cpp
+++ b/source/gameengine/VideoTexture/Texture.cpp
@@ -31,7 +31,6 @@ http://www.gnu.org/copyleft/lesser.txt.
#include <DNA_meshdata_types.h>
#include <DNA_image_types.h>
#include <IMB_imbuf_types.h>
-#include <BDR_drawmesh.h>
#include <KX_PolygonMaterial.h>
#include <MEM_guardedalloc.h>
diff --git a/source/gameengine/VideoTexture/Texture.h b/source/gameengine/VideoTexture/Texture.h
index 3c371e51537..1bbef8f0f9e 100644
--- a/source/gameengine/VideoTexture/Texture.h
+++ b/source/gameengine/VideoTexture/Texture.h
@@ -32,6 +32,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "ImageBase.h"
#include "BlendType.h"
+#include "Exception.h"
// type Texture declaration
@@ -82,5 +83,10 @@ RAS_IPolyMaterial * getMaterial (PyObject *obj, short matID);
// get material ID
short getMaterialID (PyObject * obj, char * name);
+// Exceptions
+extern ExceptionID MaterialNotAvail;
+
+// object type
+extern BlendType<KX_GameObject> gameObjectType;
#endif
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp
index b38882f8164..ec066811a52 100644
--- a/source/gameengine/VideoTexture/blendVideoTex.cpp
+++ b/source/gameengine/VideoTexture/blendVideoTex.cpp
@@ -132,6 +132,7 @@ extern PyTypeObject FilterBGR24Type;
extern PyTypeObject ImageBuffType;
extern PyTypeObject ImageMixType;
extern PyTypeObject ImageRenderType;
+extern PyTypeObject ImageMirrorType;
extern PyTypeObject ImageViewportType;
extern PyTypeObject ImageViewportType;
@@ -144,7 +145,8 @@ static void registerAllTypes(void)
#endif
pyImageTypes.add(&ImageBuffType, "ImageBuff");
pyImageTypes.add(&ImageMixType, "ImageMix");
- //pyImageTypes.add(&ImageRenderType, "ImageRender");
+ pyImageTypes.add(&ImageRenderType, "ImageRender");
+ pyImageTypes.add(&ImageMirrorType, "ImageMirror");
pyImageTypes.add(&ImageViewportType, "ImageViewport");
pyFilterTypes.add(&FilterBlueScreenType, "FilterBlueScreen");
diff --git a/source/nan_compile.mk b/source/nan_compile.mk
index 4b13ef8f678..19d833b5b0d 100644
--- a/source/nan_compile.mk
+++ b/source/nan_compile.mk
@@ -120,22 +120,34 @@ ifeq ($(OS),freebsd)
endif
ifeq ($(OS),irix)
- CC = cc
- CCC = CC
- CFLAGS += -n32 -mips3 -Xcpluscomm
- CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std
-ifdef MIPS73_ISOHEADERS
- CCFLAGS += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS)
-else
- CCFLAGS += -LANG:libc_in_namespace_std=off
-endif
- REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
- REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
+ ifeq ($(IRIX_USE_GCC),true)
+ CC = gcc
+ CCC = g++
+ CFLAGS += -fPIC -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4
+ CCFLAGS += -fPIC -fpermissive -funsigned-char -fno-strict-aliasing -mabi=n32 -mips4
+ REL_CFLAGS += -O2
+ REL_CCFLAGS += -O2
+ CPPFLAGS += -DXP_UNIX
+ DBG_CFLAGS += -g3 -gdwarf-2 -ggdb
+ DBG_CCFLAGS += -g3 -gdwarf-2 -ggdb
+ else
+ CC = cc
+ CCC = CC
+ CFLAGS += -n32 -mips3 -Xcpluscomm
+ CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std
+ ifdef MIPS73_ISOHEADERS
+ CCFLAGS += -LANG:libc_in_namespace_std=off -I$(MIPS73_ISOHEADERS)
+ else
+ CCFLAGS += -LANG:libc_in_namespace_std=off
+ endif
+ REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
+ REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
+ endif
OPENGL_HEADERS = /usr/include
NAN_DEPEND = true
AR = CC
ARFLAGS = -ar -o
- ARFLAGSQUIET = -ar -o
+ ARFLAGSQUIET = -ar -o
endif
ifeq ($(OS),linux)
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index 424a7c558d7..04a1d107931 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -75,6 +75,7 @@ else
export NAN_SOLID ?= $(LCGDIR)/solid
export NAN_QHULL ?= $(LCGDIR)/qhull
endif
+ export NAN_USE_BULLET ?= true
export NAN_BULLET2 ?= $(LCGDIR)/bullet2
export NAN_SUMO ?= $(SRCHOME)/gameengine/Physics/Sumo
export NAN_FUZZICS ?= $(SRCHOME)/gameengine/Physics/Sumo/Fuzzics
@@ -83,7 +84,7 @@ endif
export NAN_GUARDEDALLOC ?= $(LCGDIR)/guardedalloc
export NAN_IKSOLVER ?= $(LCGDIR)/iksolver
export NAN_BSP ?= $(LCGDIR)/bsp
- export NAN_BOOLOP ?= $(LCGDIR)/boolop
+ export NAN_BOOLOP ?= $(LCGDIR)/boolop
export NAN_SOUNDSYSTEM ?= $(LCGDIR)/SoundSystem
export NAN_STRING ?= $(LCGDIR)/string
export NAN_MEMUTIL ?= $(LCGDIR)/memutil
@@ -116,7 +117,7 @@ endif
export WITH_DDS ?= true
ifeq ($(OS),windows)
- export NAN_WINTAB ?= $(LCGDIR)/wintab
+ export NAN_WINTAB ?= $(LCGDIR)/wintab
ifeq ($(FREE_WINDOWS), true)
export NAN_PTHREADS ?= $(LCGDIR)/pthreads
export NAN_OPENEXR ?= $(LCGDIR)/gcc/openexr
@@ -129,28 +130,34 @@ endif
endif
else
ifeq ($(OS),darwin)
- export NAN_OPENEXR ?= $(LCGDIR)/openexr
- ifeq ($(CPU),powerpc)
- export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a
- else
- export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
- endif
+ export NAN_OPENEXR ?= $(LCGDIR)/openexr
+ ifeq ($(CPU),powerpc)
+ export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a
+ else
+ export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
+ endif
else
ifeq ($(OS),linux)
- ifeq ($(WITH_OPENEXR), true)
- NAN_OPENEXR?=$(shell pkg-config --variable=prefix OpenEXR )
- NAN_OPENEXR_INC?=$(shell pkg-config --cflags OpenEXR )
- NAN_OPENEXR_LIBS?=$(addprefix ${NAN_OPENEXR}/lib/lib,$(addsuffix .a,$(shell pkg-config --libs-only-l OpenEXR | sed -s "s/-l//g" )))
- endif
+ ifeq ($(WITH_OPENEXR), true)
+ NAN_OPENEXR?=$(shell pkg-config --variable=prefix OpenEXR )
+ NAN_OPENEXR_INC?=$(shell pkg-config --cflags OpenEXR )
+ NAN_OPENEXR_LIBS?=$(addprefix ${NAN_OPENEXR}/lib/lib,$(addsuffix .a,$(shell pkg-config --libs-only-l OpenEXR | sed -s "s/-l//g" )))
+ endif
else
ifeq ($(OS), solaris)
# this only exists at the moment for i386-64 CPU Types at the moment
export NAN_OPENEXR ?= $(LCGDIR)/openexr
-
export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a -lrt
else
- export NAN_OPENEXR ?= /usr/local
- export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a
+ ifeq ($(OS), irix)
+ ifeq ($(IRIX_USE_GCC), true)
+ export NAN_OPENEXR ?= $(LCGDIR)/openexr/gcc
+ else
+ export NAN_OPENEXR ?= $(LCGDIR)/openexr
+ endif
+ endif
+ export NAN_OPENEXR_INC ?= -I$(NAN_OPENEXR)/include -I$(NAN_OPENEXR)/include/OpenEXR
+ export NAN_OPENEXR_LIBS ?= $(NAN_OPENEXR)/lib/libIlmImf.a $(NAN_OPENEXR)/lib/libHalf.a $(NAN_OPENEXR)/lib/libIex.a $(NAN_OPENEXR)/lib/libIlmThread.a
endif
endif
endif
@@ -331,23 +338,27 @@ endif
export NAN_PYTHON ?= $(LCGDIR)/python
export NAN_PYTHON_VERSION ?= 2.3
export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION)
- export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a
+ export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a -lpthread
export NAN_OPENAL ?= $(LCGDIR)/openal
export NAN_FMOD ?= $(LCGDIR)/fmod
export NAN_JPEG ?= $(LCGDIR)/jpeg
export NAN_PNG ?= $(LCGDIR)/png
- export NAN_TIFF ?= /usr/freeware
+ export NAN_TIFF ?= $(LCGDIR)/tiff
export NAN_ODE ?= $(LCGDIR)/ode
export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay
export NAN_MESA ?= /usr/src/Mesa-3.1
- export NAN_ZLIB ?= /usr/freeware
+ export NAN_ZLIB ?= $(LCGDIR)/zlib
export NAN_NSPR ?= $(LCGDIR)/nspr
- export NAN_FREETYPE ?= /usr/freeware
- export NAN_GETTEXT ?= /usr/freeware
- export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib32/libintl.a
+ export NAN_FREETYPE ?= $(LCGDIR)/freetype
+ export NAN_ICONV ?= $(LCGDIR)/iconv
+ export NAN_GETTEXT ?= $(LCGDIR)/gettext
+ export NAN_GETTEXT_LIB ?= $(NAN_GETTEXT)/lib/libintl.a $(NAN_ICONV)/lib/libiconv.a
export NAN_SDL ?= $(LCGDIR)/sdl
- export NAN_SDLLIBS ?= -L$(NAN_SDL)/lib -lSDL
+ export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include/SDL
+ export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg
+ export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a
+ export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
# Uncomment the following line to use Mozilla inplace of netscape
# CPPFLAGS +=-DMOZ_NOT_NET
diff --git a/source/nan_link.mk b/source/nan_link.mk
index 8dda3b8c2df..186fe07e09a 100644
--- a/source/nan_link.mk
+++ b/source/nan_link.mk
@@ -72,11 +72,19 @@ ifeq ($(OS),freebsd)
endif
ifeq ($(OS),irix)
- LDFLAGS += -mips3
- LLIBS = -lmovieGL -lGLU -lGL -lXmu -lXext -lX11 -lc -lm -ldmedia
- LLIBS += -lcl -laudio -ldb -lCio -lz
- LLIBS += -lpthread
- LLIBS += -woff 84,171
+ ifeq ($(IRIX_USE_GCC), true)
+ LDFLAGS += -mabi=n32 -mips4
+ DBG_LDFLAGS += -LD_LAYOUT:lgot_buffer=40
+ else
+ LDFLAGS += -n32 -mips3
+ LDFLAGS += -woff 84,171
+ endif
+ LLIBS = -lmovieGL -lGLU -lGL -lXmu -lXext -lXi -lX11 -lc -lm -ldmedia
+ LLIBS += -lcl -laudio
+ ifneq ($(IRIX_USE_GCC), true)
+ LLIBS += -lCio -ldb
+ endif
+ LLIBS += -lz -lpthread
DYNLDFLAGS = -shared $(LDFLAGS)
endif
@@ -90,7 +98,7 @@ ifeq ($(OS),linux)
ifeq ($(CPU),$(findstring $(CPU), "i386 x86_64 ia64 parisc64 powerpc sparc64"))
COMMENT = "MESA 3.1"
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
- LLIBS += -lutil -lc -lm -ldl -lpthread
+ LLIBS += -lutil -lc -lm -ldl -lpthread
# LLIBS += -L$(NAN_ODE)/lib -lode
LOPTS = -export-dynamic
DADD = -lGL -lGLU
diff --git a/tools/Blender.py b/tools/Blender.py
index 3b5e33eda59..c52bbaa0613 100644
--- a/tools/Blender.py
+++ b/tools/Blender.py
@@ -190,7 +190,7 @@ def setup_syslibs(lenv):
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross'):
syslibs += Split(lenv['BF_PTHREADS_LIB'])
- syslibs += Split(lenv['LLIBS'])
+ syslibs += lenv['LLIBS']
return syslibs
@@ -457,7 +457,7 @@ class BlenderEnvironment(SConsEnvironment):
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
lenv = self.Clone()
if lenv['OURPLATFORM'] in ['win32-vc', 'cygwin']:
- lenv.Append(LINKFLAGS = Split(lenv['PLATFORM_LINKFLAGS']))
+ lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
if lenv['BF_DEBUG']:
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
if lenv['OURPLATFORM']=='linux2':
@@ -476,7 +476,7 @@ class BlenderEnvironment(SConsEnvironment):
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
if lenv['BF_PROFILE']:
- lenv.Append(LINKFLAGS = lenv['BF_PROFILE_FLAGS'])
+ lenv.Append(LINKFLAGS = lenv['BF_PROFILE_LINKFLAGS'])
lenv.Append(CPPPATH=includes)
if root_build_dir[0]==os.sep or root_build_dir[1]==':':
lenv.Append(LIBPATH=root_build_dir + '/lib')
diff --git a/tools/btools.py b/tools/btools.py
index 66d5ecc6b9a..21ab547b11a 100755
--- a/tools/btools.py
+++ b/tools/btools.py
@@ -19,13 +19,15 @@ BoolVariable = SCons.Variables.BoolVariable
def print_arguments(args, bc):
if len(args):
for k,v in args.iteritems():
+ if type(v)==list:
+ v = ' '.join(v)
print '\t'+bc.OKBLUE+k+bc.ENDC+' = '+bc.OKGREEN + v + bc.ENDC
else:
print '\t'+bc.WARNING+'No command-line arguments given'+bc.ENDC
def validate_arguments(args, bc):
opts_list = [
- 'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LINKFLAGS', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC',
+ 'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
@@ -47,17 +49,11 @@ def validate_arguments(args, bc):
'WITH_BF_YAFRAY',
'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
- 'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'BF_OPENGL_LINKFLAGS',
+ 'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
'WITH_BF_FTGL', 'BF_FTGL', 'BF_FTGL_INC', 'BF_FTGL_LIB',
'WITH_BF_PLAYER',
'WITH_BF_NOBLENDER',
'WITH_BF_BINRELOC',
- 'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
- 'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
- 'BF_PROFILE_FLAGS', 'BF_PROFILE_FLAGS', 'BF_PROFILE_CXXFLAGS',
- 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
- 'C_WARN', 'CC_WARN', 'CXX_WARN',
- 'LLIBS', 'PLATFORM_LINKFLAGS',
'LCGDIR',
'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
'WITH_BF_VERSE', 'BF_VERSE_INCLUDE',
@@ -72,7 +68,20 @@ def validate_arguments(args, bc):
'WITH_BF_DOCS',
'BF_NUMJOBS',
]
-
+
+ # Have options here that scons expects to be lists
+ opts_list_split = [
+ 'BF_PYTHON_LINKFLAGS',
+ 'BF_OPENGL_LINKFLAGS',
+ 'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
+ 'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
+ 'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
+ 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
+ 'C_WARN', 'CC_WARN', 'CXX_WARN',
+ 'LLIBS', 'PLATFORM_LINKFLAGS',
+ ]
+
+
arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE',
@@ -81,12 +90,13 @@ def validate_arguments(args, bc):
'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG',
'BF_DOCDIR']
- all_list = opts_list + arg_list
okdict = {}
for k,v in args.iteritems():
- if k in all_list:
+ if (k in opts_list) or (k in arg_list):
okdict[k] = v
+ elif k in opts_list_split:
+ okdict[k] = v.split() # "" have alredy been stripped
else:
print '\t'+bc.WARNING+'Invalid argument: '+bc.ENDC+k+'='+v
@@ -340,6 +350,7 @@ def read_opts(cfg, args):
('BF_PROFILE_CFLAGS', 'C only profiling flags', ''),
('BF_PROFILE_CCFLAGS', 'C and C++ profiling flags', ''),
('BF_PROFILE_CXXFLAGS', 'C++ only profiling flags', ''),
+ ('BF_PROFILE_LINKFLAGS', 'Profile linkflags', ''),
(BoolVariable('BF_DEBUG', 'Add debug flags if true', False)),
('BF_DEBUG_CFLAGS', 'C only debug flags', ''),
@@ -544,8 +555,10 @@ def NSIS_Installer(target=None, source=None, env=None):
new_nsis = open(tmpnsi, 'w')
new_nsis.write(ns_cnt)
new_nsis.close()
+ print "Preparing nsis file looks ok\n"
os.chdir(start_dir)
+ print "try to launch 'makensis' ...make sure it is on the path \n"
cmdline = "makensis " + "\""+tmpnsi+"\""
diff --git a/tools/crossmingw.py b/tools/crossmingw.py
index 1c8924ca7f6..299bfca929d 100755
--- a/tools/crossmingw.py
+++ b/tools/crossmingw.py
@@ -109,7 +109,7 @@ def shlib_emitter(target, source, env):
#JB """ I'm blindly susbstuting lines from the mingw.py
#JB file becase these lines cause python errors here. """
#JB shlib_action = SCons.Action.Action(shlib_generator,generator=1)
-shlib_action = SCons.Action.CommandGenerator(shlib_generator)
+shlib_action = SCons.Action.CommandGeneratorAction(shlib_generator)
res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')